Built motion from commit 380fdcb5.|2.6.4
authorAndrea Amorese <andrea.amorese@xenialab.it>
Fri, 4 Mar 2022 13:07:46 +0000 (14:07 +0100)
committerAndrea Amorese <andrea.amorese@xenialab.it>
Fri, 4 Mar 2022 13:07:46 +0000 (14:07 +0100)
1189 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/api.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/events.js
server/services/agi/graph/index.js
server/services/agi/index.js
server/services/agi/mailRpc/index.js
server/services/agi/project.js
server/services/agi/reply.js
server/services/agi/rpc/index.js
server/services/agi/scripts/aws/index.js
server/services/agi/scripts/aws/lex/index.js
server/services/agi/scripts/aws/lex/lib/api.js
server/services/agi/scripts/aws/polly/index.js
server/services/agi/scripts/aws/polly/lib/api.js
server/services/agi/scripts/google/asr/index.js
server/services/agi/scripts/google/asr/lib/api.js
server/services/agi/scripts/google/index.js
server/services/agi/scripts/index.js
server/services/agi/scripts/sestek/index.js
server/services/agi/scripts/sestek/nda/index.js
server/services/agi/scripts/tilde/asr/index.js
server/services/agi/scripts/tilde/asr/lib/api.js
server/services/agi/scripts/tilde/index.js
server/services/agi/server.js
server/services/agi/vertices.js
server/services/ami/acw/index.js
server/services/ami/ami.js
server/services/ami/client.js
server/services/ami/dialer/action.js
server/services/ami/dialer/agentComplete.js
server/services/ami/dialer/final.js
server/services/ami/dialer/hangup.js
server/services/ami/dialer/history.js
server/services/ami/dialer/index.js
server/services/ami/dialer/queueCallerAbandon.js
server/services/ami/fax/action.js
server/services/ami/fax/index.js
server/services/ami/fax/rpcDb.js
server/services/ami/fax/util/gs.js
server/services/ami/fax/util/util.js
server/services/ami/index.js
server/services/ami/model/agent.js
server/services/ami/model/campaign.js
server/services/ami/model/channel.js
server/services/ami/model/deskAccount.js
server/services/ami/model/dynamics365Account.js
server/services/ami/model/faxAccount.js
server/services/ami/model/freshdeskAccount.js
server/services/ami/model/freshsalesAccount.js
server/services/ami/model/queueReport.js
server/services/ami/model/salesforceAccount.js
server/services/ami/model/servicenowAccount.js
server/services/ami/model/sugarcrmAccount.js
server/services/ami/model/telephone.js
server/services/ami/model/template.js
server/services/ami/model/trigger.js
server/services/ami/model/trunk.js
server/services/ami/model/voiceExtension.js
server/services/ami/model/voiceQueue.js
server/services/ami/model/vtigerAccount.js
server/services/ami/model/zendeskAccount.js
server/services/ami/model/zohoAccount.js
server/services/ami/preview/action.js
server/services/ami/preview/index.js
server/services/ami/preview/rpcDb.js
server/services/ami/preview/util/util.js
server/services/ami/properties.js
server/services/ami/realtime/index.js
server/services/ami/report/index.js
server/services/ami/report/userReport.js
server/services/ami/report/voiceAgentReport.js
server/services/ami/report/voiceCallReport.js
server/services/ami/report/voiceDialReport.js
server/services/ami/report/voiceQueueReport.js
server/services/ami/rpc/agentReportPreview.js
server/services/ami/rpc/attachment.js
server/services/ami/rpc/campaign.js
server/services/ami/rpc/cmContact.js
server/services/ami/rpc/cmHopper.js
server/services/ami/rpc/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 6f7ca09..db93485 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-03-04T12:36:08.387Z",
+    "time": "2022-03-04T12:54:17.541Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index ac8e098..e744626 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-03-04T12:36:08.387Z",
+    "time": "2022-03-04T12:54:17.541Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index da40c27..c8cb683 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc74f=['STRING','contactManager','integration','motionbar','jscripty','urlForward','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]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL','action'];(function(_0x306ceb,_0x22a49c){var _0x5221fe=function(_0x2aa873){while(--_0x2aa873){_0x306ceb['push'](_0x306ceb['shift']());}};_0x5221fe(++_0x22a49c);}(_0xc74f,0xd4));var _0xfc74=function(_0x403039,_0x5fea0e){_0x403039=_0x403039-0x0;var _0x3dfb53=_0xc74f[_0x403039];return _0x3dfb53;};'use strict';var Sequelize=require(_0xfc74('0x0'));module[_0xfc74('0x1')]={'name':{'type':Sequelize[_0xfc74('0x2')],'get':function(_0x428fd0){return this['getDataValue'](_0xfc74('0x3'));}},'action':{'type':Sequelize[_0xfc74('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xfc74('0x5'),_0xfc74('0x6'),_0xfc74('0x7'),_0xfc74('0x8'),_0xfc74('0x9'),'browser',_0xfc74('0xa'),_0xfc74('0xb')]],'msg':_0xfc74('0xc')}},'comment':_0xfc74('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xfc74('0xd')},'data2':{'type':Sequelize[_0xfc74('0x4')](0x1000),'comment':_0xfc74('0xe')},'data3':{'type':Sequelize[_0xfc74('0x4')](0x1000),'comment':_0xfc74('0xf')},'data4':{'type':Sequelize[_0xfc74('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xfc74('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xfc74('0x4')],'comments':_0xfc74('0x10')},'data7':{'type':Sequelize[_0xfc74('0x11')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x2738=['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]','sequelize','exports','action','STRING','integration','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2738,0x1db));var _0x8273=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x2738[_0x1b6c6d];return _0x290d9d;};'use strict';var Sequelize=require(_0x8273('0x0'));module[_0x8273('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x41a1ad){return this['getDataValue'](_0x8273('0x2'));}},'action':{'type':Sequelize[_0x8273('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x8273('0x4'),_0x8273('0x5'),_0x8273('0x6'),_0x8273('0x7'),_0x8273('0x8'),'bot',_0x8273('0x9')]],'msg':_0x8273('0xa')}},'comment':_0x8273('0xa')},'data1':{'type':Sequelize[_0x8273('0x3')](0x1000),'comment':_0x8273('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x8273('0xc')},'data3':{'type':Sequelize[_0x8273('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['STRING'](0x1000),'comments':_0x8273('0xd')},'data5':{'type':Sequelize[_0x8273('0x3')](0x1000),'comments':_0x8273('0xe')},'data6':{'type':Sequelize[_0x8273('0x3')],'comments':_0x8273('0xf')},'data7':{'type':Sequelize[_0x8273('0x10')],'comments':_0x8273('0x11')}};
\ No newline at end of file
index bb1ff66..3f369d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x859f=['to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','apply','save','update','then','destroy','error','stack','name','send','body','Action','find','catch','params','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x4749dd,_0x6375b4){var _0x45ff3b=function(_0x442b55){while(--_0x442b55){_0x4749dd['push'](_0x4749dd['shift']());}};_0x45ff3b(++_0x6375b4);}(_0x859f,0x7c));var _0xf859=function(_0x3eb2fb,_0x37f70c){_0x3eb2fb=_0x3eb2fb-0x0;var _0x414419=_0x859f[_0x3eb2fb];return _0x414419;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf859('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf859('0x1'));var rp=require(_0xf859('0x2'));var moment=require('moment');var BPromise=require(_0xf859('0x3'));var Mustache=require(_0xf859('0x4'));var util=require(_0xf859('0x5'));var path=require(_0xf859('0x6'));var sox=require(_0xf859('0x7'));var csv=require(_0xf859('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf859('0x9'));var _=require('lodash');var squel=require(_0xf859('0xa'));var crypto=require(_0xf859('0xb'));var jsforce=require(_0xf859('0xc'));var deskjs=require(_0xf859('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf859('0xe'));var authService=require(_0xf859('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf859('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf859('0x11'))(_0xf859('0x12'));var utils=require(_0xf859('0x13'));var config=require(_0xf859('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf859('0x15'))['db'];function respondWithStatusCode(_0x239573,_0x13d7d2){_0x13d7d2=_0x13d7d2||0xcc;return function(_0x17b660){if(_0x17b660){return _0x239573[_0xf859('0x16')](_0x13d7d2);}return _0x239573['status'](_0x13d7d2)[_0xf859('0x17')]();};}function respondWithResult(_0x1a602a,_0x1fb007){_0x1fb007=_0x1fb007||0xc8;return function(_0x1c7c9f){if(_0x1c7c9f){return _0x1a602a[_0xf859('0x18')](_0x1fb007)[_0xf859('0x19')](_0x1c7c9f);}};}function respondWithFilteredResult(_0x273956,_0x1b4dae){return function(_0x56807c){if(_0x56807c){var _0x32d362=typeof _0x1b4dae[_0xf859('0x1a')]==='undefined'&&typeof _0x1b4dae['limit']===_0xf859('0x1b');var _0x5d76f2=_0x56807c[_0xf859('0x1c')];var _0x52d2a8=_0x32d362?0x0:_0x1b4dae[_0xf859('0x1a')];var _0x2c4929=_0x32d362?_0x56807c['count']:_0x1b4dae[_0xf859('0x1a')]+_0x1b4dae['limit'];var _0x4f4f27;if(_0x2c4929>=_0x5d76f2){_0x2c4929=_0x5d76f2;_0x4f4f27=0xc8;}else{_0x4f4f27=0xce;}_0x273956[_0xf859('0x18')](_0x4f4f27);return _0x273956[_0xf859('0x1d')]('Content-Range',_0x52d2a8+'-'+_0x2c4929+'/'+_0x5d76f2)[_0xf859('0x19')](_0x56807c);}return null;};}function patchUpdates(_0xb166b){return function(_0x6059fa){try{jsonpatch[_0xf859('0x1e')](_0x6059fa,_0xb166b,!![]);}catch(_0x22c240){return BPromise['reject'](_0x22c240);}return _0x6059fa[_0xf859('0x1f')]();};}function saveUpdates(_0x13453b,_0x31a595){return function(_0x1f4633){if(_0x1f4633){return _0x1f4633[_0xf859('0x20')](_0x13453b)[_0xf859('0x21')](function(_0x447191){return _0x447191;});}return null;};}function removeEntity(_0xd9a8f3,_0x436ed1){return function(_0x13456d){if(_0x13456d){return _0x13456d[_0xf859('0x22')]()['then'](function(){_0xd9a8f3['status'](0xcc)[_0xf859('0x17')]();});}};}function handleEntityNotFound(_0x270a33,_0x122bb2){return function(_0x478454){if(!_0x478454){_0x270a33['sendStatus'](0x194);}return _0x478454;};}function handleError(_0x1cd22f,_0xb0fee4){_0xb0fee4=_0xb0fee4||0x1f4;return function(_0x58720e){logger[_0xf859('0x23')](_0x58720e[_0xf859('0x24')]);if(_0x58720e[_0xf859('0x25')]){delete _0x58720e[_0xf859('0x25')];}_0x1cd22f[_0xf859('0x18')](_0xb0fee4)[_0xf859('0x26')](_0x58720e);};}exports[_0xf859('0x20')]=function(_0x316759,_0x13a106){if(_0x316759[_0xf859('0x27')]['id']){delete _0x316759['body']['id'];}return db[_0xf859('0x28')][_0xf859('0x29')]({'where':{'id':_0x316759['params']['id']}})[_0xf859('0x21')](handleEntityNotFound(_0x13a106,null))[_0xf859('0x21')](saveUpdates(_0x316759[_0xf859('0x27')],null))[_0xf859('0x21')](respondWithResult(_0x13a106,null))[_0xf859('0x2a')](handleError(_0x13a106,null));};exports[_0xf859('0x22')]=function(_0x1216b1,_0x3b1113){return db[_0xf859('0x28')][_0xf859('0x29')]({'where':{'id':_0x1216b1[_0xf859('0x2b')]['id']}})[_0xf859('0x21')](handleEntityNotFound(_0x3b1113,null))[_0xf859('0x21')](removeEntity(_0x3b1113,null))['catch'](handleError(_0x3b1113,null));};
\ No newline at end of file
+var _0xa5ed=['Action','find','params','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','body'];(function(_0xb8135c,_0x46c002){var _0x4e54e5=function(_0x5689bd){while(--_0x5689bd){_0xb8135c['push'](_0xb8135c['shift']());}};_0x4e54e5(++_0x46c002);}(_0xa5ed,0x1d1));var _0xda5e=function(_0x32c7b2,_0x322dbd){_0x32c7b2=_0x32c7b2-0x0;var _0x360ece=_0xa5ed[_0x32c7b2];return _0x360ece;};'use strict';var emlformat=require(_0xda5e('0x0'));var rimraf=require(_0xda5e('0x1'));var zipdir=require(_0xda5e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda5e('0x3'));var moment=require(_0xda5e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xda5e('0x5'));var util=require(_0xda5e('0x6'));var path=require(_0xda5e('0x7'));var sox=require(_0xda5e('0x8'));var csv=require(_0xda5e('0x9'));var ejs=require(_0xda5e('0xa'));var fs=require('fs');var fs_extra=require(_0xda5e('0xb'));var _=require(_0xda5e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xda5e('0xd'));var deskjs=require(_0xda5e('0xe'));var toCsv=require(_0xda5e('0x9'));var querystring=require('querystring');var Papa=require(_0xda5e('0xf'));var Redis=require('ioredis');var authService=require(_0xda5e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xda5e('0x11'));var hardwareService=require(_0xda5e('0x12'));var logger=require('../../config/logger')(_0xda5e('0x13'));var utils=require(_0xda5e('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xda5e('0x15'))['db'];function respondWithStatusCode(_0x32d450,_0x3a4976){_0x3a4976=_0x3a4976||0xcc;return function(_0x1976bd){if(_0x1976bd){return _0x32d450[_0xda5e('0x16')](_0x3a4976);}return _0x32d450[_0xda5e('0x17')](_0x3a4976)[_0xda5e('0x18')]();};}function respondWithResult(_0xdc1024,_0x289597){_0x289597=_0x289597||0xc8;return function(_0x42a5e4){if(_0x42a5e4){return _0xdc1024[_0xda5e('0x17')](_0x289597)['json'](_0x42a5e4);}};}function respondWithFilteredResult(_0x3fe68c,_0x556418){return function(_0x2bf806){if(_0x2bf806){var _0x576e97=typeof _0x556418[_0xda5e('0x19')]===_0xda5e('0x1a')&&typeof _0x556418[_0xda5e('0x1b')]===_0xda5e('0x1a');var _0x9ab65=_0x2bf806['count'];var _0x5940df=_0x576e97?0x0:_0x556418[_0xda5e('0x19')];var _0x4059ad=_0x576e97?_0x2bf806[_0xda5e('0x1c')]:_0x556418[_0xda5e('0x19')]+_0x556418['limit'];var _0x1a1183;if(_0x4059ad>=_0x9ab65){_0x4059ad=_0x9ab65;_0x1a1183=0xc8;}else{_0x1a1183=0xce;}_0x3fe68c[_0xda5e('0x17')](_0x1a1183);return _0x3fe68c[_0xda5e('0x1d')](_0xda5e('0x1e'),_0x5940df+'-'+_0x4059ad+'/'+_0x9ab65)[_0xda5e('0x1f')](_0x2bf806);}return null;};}function patchUpdates(_0x57d83c){return function(_0x3ff676){try{jsonpatch[_0xda5e('0x20')](_0x3ff676,_0x57d83c,!![]);}catch(_0x27b528){return BPromise[_0xda5e('0x21')](_0x27b528);}return _0x3ff676[_0xda5e('0x22')]();};}function saveUpdates(_0x52436f,_0x34da40){return function(_0x5e9ca3){if(_0x5e9ca3){return _0x5e9ca3['update'](_0x52436f)[_0xda5e('0x23')](function(_0x2c7c1b){return _0x2c7c1b;});}return null;};}function removeEntity(_0x55734e,_0x1ad3d0){return function(_0x52e35a){if(_0x52e35a){return _0x52e35a['destroy']()[_0xda5e('0x23')](function(){_0x55734e[_0xda5e('0x17')](0xcc)[_0xda5e('0x18')]();});}};}function handleEntityNotFound(_0x2ef12b,_0x4e981a){return function(_0x497dbf){if(!_0x497dbf){_0x2ef12b[_0xda5e('0x16')](0x194);}return _0x497dbf;};}function handleError(_0x38b94a,_0x14a98b){_0x14a98b=_0x14a98b||0x1f4;return function(_0x4a47fc){logger[_0xda5e('0x24')](_0x4a47fc[_0xda5e('0x25')]);if(_0x4a47fc['name']){delete _0x4a47fc[_0xda5e('0x26')];}_0x38b94a[_0xda5e('0x17')](_0x14a98b)[_0xda5e('0x27')](_0x4a47fc);};}exports['update']=function(_0x169ca6,_0x580f40){if(_0x169ca6[_0xda5e('0x28')]['id']){delete _0x169ca6[_0xda5e('0x28')]['id'];}return db[_0xda5e('0x29')][_0xda5e('0x2a')]({'where':{'id':_0x169ca6[_0xda5e('0x2b')]['id']}})[_0xda5e('0x23')](handleEntityNotFound(_0x580f40,null))['then'](saveUpdates(_0x169ca6['body'],null))['then'](respondWithResult(_0x580f40,null))[_0xda5e('0x2c')](handleError(_0x580f40,null));};exports[_0xda5e('0x2d')]=function(_0x35aaa7,_0x39e269){return db[_0xda5e('0x29')][_0xda5e('0x2a')]({'where':{'id':_0x35aaa7['params']['id']}})[_0xda5e('0x23')](handleEntityNotFound(_0x39e269,null))[_0xda5e('0x23')](removeEntity(_0x39e269,null))[_0xda5e('0x2c')](handleError(_0x39e269,null));};
\ No newline at end of file
index b1b285f..f49ef73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8433=['exports','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./action.attributes'];(function(_0x1576ba,_0x16d400){var _0x2bf6d6=function(_0x23ac99){while(--_0x23ac99){_0x1576ba['push'](_0x1576ba['shift']());}};_0x2bf6d6(++_0x16d400);}(_0x8433,0x1d8));var _0x3843=function(_0x26bbd1,_0xb274f3){_0x26bbd1=_0x26bbd1-0x0;var _0x26b1eb=_0x8433[_0x26bbd1];return _0x26b1eb;};'use strict';var _=require(_0x3843('0x0'));var util=require(_0x3843('0x1'));var logger=require(_0x3843('0x2'))(_0x3843('0x3'));var moment=require(_0x3843('0x4'));var BPromise=require(_0x3843('0x5'));var rp=require(_0x3843('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3843('0x7'));var config=require('../../config/environment');var attributes=require(_0x3843('0x8'));module[_0x3843('0x9')]=function(_0x10d5ec,_0x2118f3){return _0x10d5ec[_0x3843('0xa')](_0x3843('0xb'),attributes,{'tableName':_0x3843('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9e63=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','lodash','util','../../config/logger'];(function(_0x4b25ea,_0x52a3b6){var _0x41e3d4=function(_0x10585b){while(--_0x10585b){_0x4b25ea['push'](_0x4b25ea['shift']());}};_0x41e3d4(++_0x52a3b6);}(_0x9e63,0x65));var _0x39e6=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x9e63[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x39e6('0x0'));var util=require(_0x39e6('0x1'));var logger=require(_0x39e6('0x2'))('api');var moment=require(_0x39e6('0x3'));var BPromise=require(_0x39e6('0x4'));var rp=require(_0x39e6('0x5'));var fs=require('fs');var path=require(_0x39e6('0x6'));var rimraf=require(_0x39e6('0x7'));var config=require(_0x39e6('0x8'));var attributes=require(_0x39e6('0x9'));module[_0x39e6('0xa')]=function(_0x48f3bb,_0x367e77){return _0x48f3bb[_0x39e6('0xb')](_0x39e6('0xc'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a84c572..ed418ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x53ec,0x192));var _0xc53e=function(_0xffad61,_0x5f0282){_0xffad61=_0xffad61-0x0;var _0x33ef10=_0x53ec[_0xffad61];return _0x33ef10;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
+var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x3f3416,_0x1a6f5c){var _0x23c3bd=function(_0x26ef01){while(--_0x26ef01){_0x3f3416['push'](_0x3f3416['shift']());}};_0x23c3bd(++_0x1a6f5c);}(_0xabce,0x103));var _0xeabc=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xabce[_0x481bf7];return _0x461787;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
index 03a5c34..93b8ce3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8059=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','destroy','exports'];(function(_0x1d47c3,_0x856818){var _0x220130=function(_0x1dddd6){while(--_0x1dddd6){_0x1d47c3['push'](_0x1d47c3['shift']());}};_0x220130(++_0x856818);}(_0x8059,0x70));var _0x9805=function(_0x108831,_0x5e4f70){_0x108831=_0x108831-0x0;var _0x4da77a=_0x8059[_0x108831];return _0x4da77a;};'use strict';var multer=require('multer');var util=require(_0x9805('0x0'));var path=require(_0x9805('0x1'));var timeout=require(_0x9805('0x2'));var express=require(_0x9805('0x3'));var router=express[_0x9805('0x4')]();var fs_extra=require(_0x9805('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9805('0x6'));var config=require(_0x9805('0x7'));var controller=require('./action.controller');router[_0x9805('0x8')](_0x9805('0x9'),auth[_0x9805('0xa')](),controller[_0x9805('0xb')]);router['delete'](_0x9805('0x9'),auth[_0x9805('0xa')](),controller[_0x9805('0xc')]);module[_0x9805('0xd')]=router;
\ No newline at end of file
+var _0x3a59=['/:id','update','delete','isAuthenticated','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','put'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3a59,0xf0));var _0x93a5=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x3a59[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0x93a5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x93a5('0x1'));var express=require('express');var router=express[_0x93a5('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x93a5('0x3'));var interaction=require(_0x93a5('0x4'));var config=require(_0x93a5('0x5'));var controller=require('./action.controller');router[_0x93a5('0x6')](_0x93a5('0x7'),auth['isAuthenticated'](),controller[_0x93a5('0x8')]);router[_0x93a5('0x9')](_0x93a5('0x7'),auth[_0x93a5('0xa')](),controller[_0x93a5('0xb')]);module[_0x93a5('0xc')]=router;
\ No newline at end of file
index 6ac9a04..3b33b0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x59b0c3,_0x37b575){var _0x402c21=function(_0x3570e6){while(--_0x3570e6){_0x59b0c3['push'](_0x59b0c3['shift']());}};_0x402c21(++_0x37b575);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x201bf8,_0x1c9551){_0x201bf8=_0x201bf8-0x0;var _0x586fac=_0x3eea[_0x201bf8];return _0x586fac;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
+var _0xae24=['sequelize','STRING'];(function(_0x30f1bc,_0x54b715){var _0x4f2de4=function(_0x24c5f2){while(--_0x24c5f2){_0x30f1bc['push'](_0x30f1bc['shift']());}};_0x4f2de4(++_0x54b715);}(_0xae24,0x182));var _0x4ae2=function(_0x4c0f76,_0x1e9b4a){_0x4c0f76=_0x4c0f76-0x0;var _0x5123c2=_0xae24[_0x4c0f76];return _0x5123c2;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ae2('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4ae2('0x1')]},'table':{'type':Sequelize[_0x4ae2('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 8d7fa4a..af6e535 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24fc=['limit','count','offset','Content-Range','reject','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','rows','catch','show','AnalyticCustomReport','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','params','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','alias','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','sequelize','toString','SELECT','join','SUM(%s)','MAX(%s)','SEC_TO_TIME(%s)','DATE(%s)','operator','DESC','clone','output','web','%s-%s.%s','generate','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','run','runReport','IS\x20NULL','value','Sequelize','findAll','Limited\x20Query:','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','undefined'];(function(_0x3a6c29,_0x34f506){var _0x2ae4f0=function(_0x4515f8){while(--_0x4515f8){_0x3a6c29['push'](_0x3a6c29['shift']());}};_0x2ae4f0(++_0x34f506);}(_0x24fc,0x12b));var _0xc24f=function(_0x115752,_0x206760){_0x115752=_0x115752-0x0;var _0x1fab41=_0x24fc[_0x115752];return _0x1fab41;};'use strict';var emlformat=require(_0xc24f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc24f('0x1'));var jsonpatch=require(_0xc24f('0x2'));var rp=require('request-promise');var moment=require(_0xc24f('0x3'));var BPromise=require(_0xc24f('0x4'));var Mustache=require(_0xc24f('0x5'));var util=require(_0xc24f('0x6'));var path=require(_0xc24f('0x7'));var sox=require('sox');var csv=require(_0xc24f('0x8'));var ejs=require(_0xc24f('0x9'));var fs=require('fs');var fs_extra=require(_0xc24f('0xa'));var _=require(_0xc24f('0xb'));var squel=require(_0xc24f('0xc'));var crypto=require(_0xc24f('0xd'));var jsforce=require(_0xc24f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc24f('0x8'));var querystring=require(_0xc24f('0xf'));var Papa=require(_0xc24f('0x10'));var Redis=require(_0xc24f('0x11'));var authService=require(_0xc24f('0x12'));var qs=require(_0xc24f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc24f('0x14'));var logger=require('../../config/logger')(_0xc24f('0x15'));var utils=require(_0xc24f('0x16'));var config=require(_0xc24f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc24f('0x18'))['db'];var dbH=require(_0xc24f('0x18'))[_0xc24f('0x19')];function respondWithStatusCode(_0x268144,_0x4066f7){_0x4066f7=_0x4066f7||0xcc;return function(_0x27c71a){if(_0x27c71a){return _0x268144[_0xc24f('0x1a')](_0x4066f7);}return _0x268144[_0xc24f('0x1b')](_0x4066f7)[_0xc24f('0x1c')]();};}function respondWithResult(_0x543381,_0x1ba686){_0x1ba686=_0x1ba686||0xc8;return function(_0x3201eb){if(_0x3201eb){return _0x543381[_0xc24f('0x1b')](_0x1ba686)[_0xc24f('0x1d')](_0x3201eb);}};}function respondWithFilteredResult(_0x4d451a,_0x278a34){return function(_0x48cf4d){if(_0x48cf4d){var _0x52ab86=typeof _0x278a34['offset']===_0xc24f('0x1e')&&typeof _0x278a34[_0xc24f('0x1f')]===_0xc24f('0x1e');var _0x421043=_0x48cf4d[_0xc24f('0x20')];var _0xac24ea=_0x52ab86?0x0:_0x278a34['offset'];var _0x5a49e3=_0x52ab86?_0x48cf4d[_0xc24f('0x20')]:_0x278a34[_0xc24f('0x21')]+_0x278a34[_0xc24f('0x1f')];var _0x6f5908;if(_0x5a49e3>=_0x421043){_0x5a49e3=_0x421043;_0x6f5908=0xc8;}else{_0x6f5908=0xce;}_0x4d451a['status'](_0x6f5908);return _0x4d451a['set'](_0xc24f('0x22'),_0xac24ea+'-'+_0x5a49e3+'/'+_0x421043)[_0xc24f('0x1d')](_0x48cf4d);}return null;};}function patchUpdates(_0x1de891){return function(_0x428734){try{jsonpatch['apply'](_0x428734,_0x1de891,!![]);}catch(_0x1c06ba){return BPromise[_0xc24f('0x23')](_0x1c06ba);}return _0x428734[_0xc24f('0x24')]();};}function saveUpdates(_0x39de68,_0x271f82){return function(_0x43b3bf){if(_0x43b3bf){return _0x43b3bf[_0xc24f('0x25')](_0x39de68)[_0xc24f('0x26')](function(_0x9296df){return _0x9296df;});}return null;};}function removeEntity(_0x38ab4a,_0x4dada6){return function(_0x742458){if(_0x742458){return _0x742458[_0xc24f('0x27')]()[_0xc24f('0x26')](function(){var _0x484ee1=_0x742458['get']({'plain':!![]});var _0x1edcbc=_0xc24f('0x28');return db[_0xc24f('0x29')][_0xc24f('0x27')]({'where':{'type':_0x1edcbc,'resourceId':_0x484ee1['id']}})[_0xc24f('0x26')](function(){return _0x742458;});})[_0xc24f('0x26')](function(){_0x38ab4a[_0xc24f('0x1b')](0xcc)[_0xc24f('0x1c')]();});}};}function handleEntityNotFound(_0x24c0b6,_0x342d94){return function(_0x19a758){if(!_0x19a758){_0x24c0b6[_0xc24f('0x1a')](0x194);}return _0x19a758;};}function handleError(_0x3c96a0,_0x2fecb2){_0x2fecb2=_0x2fecb2||0x1f4;return function(_0x25a8c4){logger[_0xc24f('0x2a')](_0x25a8c4[_0xc24f('0x2b')]);if(_0x25a8c4['name']){delete _0x25a8c4[_0xc24f('0x2c')];}_0x3c96a0['status'](_0x2fecb2)['send'](_0x25a8c4);};}exports['index']=function(_0x154829,_0x3ebaac){var _0x3c7db7={},_0x1fda87={},_0x2471f3={'count':0x0,'rows':[]};var _0x29ee0b=_['map'](db['AnalyticCustomReport'][_0xc24f('0x2d')],function(_0x26c715){return{'name':_0x26c715[_0xc24f('0x2e')],'type':_0x26c715[_0xc24f('0x2f')][_0xc24f('0x30')]};});_0x1fda87[_0xc24f('0x31')]=_[_0xc24f('0x32')](_0x29ee0b,_0xc24f('0x2c'));_0x1fda87[_0xc24f('0x33')]=_[_0xc24f('0x34')](_0x154829[_0xc24f('0x33')]);_0x1fda87[_0xc24f('0x35')]=_[_0xc24f('0x36')](_0x1fda87[_0xc24f('0x31')],_0x1fda87[_0xc24f('0x33')]);_0x3c7db7[_0xc24f('0x37')]=_[_0xc24f('0x36')](_0x1fda87[_0xc24f('0x31')],qs[_0xc24f('0x38')](_0x154829[_0xc24f('0x33')][_0xc24f('0x38')]));_0x3c7db7['attributes']=_0x3c7db7[_0xc24f('0x37')][_0xc24f('0x39')]?_0x3c7db7[_0xc24f('0x37')]:_0x1fda87[_0xc24f('0x31')];if(!_0x154829[_0xc24f('0x33')]['hasOwnProperty'](_0xc24f('0x3a'))){_0x3c7db7[_0xc24f('0x1f')]=qs[_0xc24f('0x1f')](_0x154829[_0xc24f('0x33')][_0xc24f('0x1f')]);_0x3c7db7[_0xc24f('0x21')]=qs[_0xc24f('0x21')](_0x154829['query'][_0xc24f('0x21')]);}_0x3c7db7[_0xc24f('0x3b')]=qs[_0xc24f('0x3c')](_0x154829[_0xc24f('0x33')][_0xc24f('0x3c')]);_0x3c7db7[_0xc24f('0x3d')]=qs[_0xc24f('0x35')](_['pick'](_0x154829[_0xc24f('0x33')],_0x1fda87[_0xc24f('0x35')]),_0x29ee0b);if(_0x154829[_0xc24f('0x33')]['filter']){_0x3c7db7[_0xc24f('0x3d')]=_[_0xc24f('0x3e')](_0x3c7db7[_0xc24f('0x3d')],{'$or':_['map'](_0x29ee0b,function(_0x366046){if(_0x366046[_0xc24f('0x2f')]!==_0xc24f('0x3f')){var _0x381187={};_0x381187[_0x366046[_0xc24f('0x2c')]]={'$like':'%'+_0x154829['query'][_0xc24f('0x40')]+'%'};return _0x381187;}})});}_0x3c7db7=_[_0xc24f('0x3e')]({},_0x3c7db7,_0x154829[_0xc24f('0x41')]);var _0x777901={'where':_0x3c7db7[_0xc24f('0x3d')]};return db['AnalyticCustomReport'][_0xc24f('0x20')](_0x777901)[_0xc24f('0x26')](function(_0x1f31c5){_0x2471f3[_0xc24f('0x20')]=_0x1f31c5;if(_0x154829[_0xc24f('0x33')]['includeAll']){_0x3c7db7[_0xc24f('0x42')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x3c7db7);})['then'](function(_0x56254c){_0x2471f3[_0xc24f('0x43')]=_0x56254c;return _0x2471f3;})['then'](respondWithFilteredResult(_0x3ebaac,_0x3c7db7))[_0xc24f('0x44')](handleError(_0x3ebaac,null));};exports[_0xc24f('0x45')]=function(_0xbc9067,_0x308ec4){var _0x9a99c6={'raw':![],'where':{'id':_0xbc9067['params']['id']}},_0x2c0bd4={};_0x2c0bd4[_0xc24f('0x31')]=_[_0xc24f('0x34')](db[_0xc24f('0x46')][_0xc24f('0x2d')]);_0x2c0bd4[_0xc24f('0x33')]=_['keys'](_0xbc9067[_0xc24f('0x33')]);_0x2c0bd4[_0xc24f('0x35')]=_[_0xc24f('0x36')](_0x2c0bd4[_0xc24f('0x31')],_0x2c0bd4[_0xc24f('0x33')]);_0x9a99c6[_0xc24f('0x37')]=_[_0xc24f('0x36')](_0x2c0bd4['model'],qs[_0xc24f('0x38')](_0xbc9067[_0xc24f('0x33')][_0xc24f('0x38')]));_0x9a99c6[_0xc24f('0x37')]=_0x9a99c6['attributes'][_0xc24f('0x39')]?_0x9a99c6[_0xc24f('0x37')]:_0x2c0bd4[_0xc24f('0x31')];if(_0xbc9067[_0xc24f('0x33')][_0xc24f('0x47')]){_0x9a99c6['include']=[{'all':!![]}];}_0x9a99c6=_[_0xc24f('0x3e')]({},_0x9a99c6,_0xbc9067[_0xc24f('0x41')]);return db['AnalyticCustomReport'][_0xc24f('0x48')](_0x9a99c6)[_0xc24f('0x26')](handleEntityNotFound(_0x308ec4,null))[_0xc24f('0x26')](respondWithResult(_0x308ec4,null))[_0xc24f('0x44')](handleError(_0x308ec4,null));};exports[_0xc24f('0x49')]=function(_0x439d20,_0x592c41){return db['AnalyticCustomReport'][_0xc24f('0x49')](_0x439d20[_0xc24f('0x4a')],{})[_0xc24f('0x26')](function(_0x13bdeb){var _0x36709f=_0x439d20['user'][_0xc24f('0x4b')]({'plain':!![]});if(!_0x36709f)throw new Error(_0xc24f('0x4c'));if(_0x36709f[_0xc24f('0x4d')]==='user'){var _0x257d6d=_0x13bdeb[_0xc24f('0x4b')]({'plain':!![]});var _0x2140f3=_0xc24f('0x4e');return db[_0xc24f('0x4f')][_0xc24f('0x48')]({'where':{'name':_0x2140f3,'userProfileId':_0x36709f[_0xc24f('0x50')]},'raw':!![]})[_0xc24f('0x26')](function(_0x252792){if(_0x252792&&_0x252792[_0xc24f('0x51')]===0x0){return db[_0xc24f('0x29')][_0xc24f('0x49')]({'name':_0x257d6d['name'],'resourceId':_0x257d6d['id'],'type':'CustomReports','sectionId':_0x252792['id']},{})['then'](function(){return _0x13bdeb;});}else{return _0x13bdeb;}})['catch'](function(_0x5ad8e7){logger['error'](_0xc24f('0x52'),_0x5ad8e7);throw _0x5ad8e7;});}return _0x13bdeb;})[_0xc24f('0x26')](respondWithResult(_0x592c41,0xc9))['catch'](handleError(_0x592c41,null));};exports['update']=function(_0x1cf698,_0xaf17db){if(_0x1cf698['body']['id']){delete _0x1cf698[_0xc24f('0x4a')]['id'];}return db[_0xc24f('0x46')][_0xc24f('0x48')]({'where':{'id':_0x1cf698['params']['id']}})[_0xc24f('0x26')](handleEntityNotFound(_0xaf17db,null))[_0xc24f('0x26')](saveUpdates(_0x1cf698['body'],null))[_0xc24f('0x26')](respondWithResult(_0xaf17db,null))[_0xc24f('0x44')](handleError(_0xaf17db,null));};exports[_0xc24f('0x27')]=function(_0x4e3b54,_0x472011){return db['AnalyticCustomReport'][_0xc24f('0x48')]({'where':{'id':_0x4e3b54['params']['id']}})[_0xc24f('0x26')](handleEntityNotFound(_0x472011,null))[_0xc24f('0x26')](removeEntity(_0x472011,null))['catch'](handleError(_0x472011,null));};exports[_0xc24f('0x53')]=function(_0x3b2f64,_0x49fda7){var _0x5a0af4=0xa;var _0x41f0e7=['join',_0xc24f('0x54'),_0xc24f('0x55'),_0xc24f('0x56')];var _0x586ac2={'SUM':'SUM(%s)','COUNT':_0xc24f('0x57'),'COUNT DISTINCT':_0xc24f('0x58'),'MAX':'MAX(%s)','MIN':_0xc24f('0x59'),'AVG':_0xc24f('0x5a'),'GROUP_CONCAT':_0xc24f('0x5b'),'GROUP_CONCAT ASC':_0xc24f('0x5c'),'GROUP_CONCAT DESC':_0xc24f('0x5d')};var _0x59d1b7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xc24f('0x5e'),'ROUND':_0xc24f('0x5f'),'UNIX_TIMESTAMP':_0xc24f('0x60')};var _0x5dd403=function(_0x2cf239){return!_[_0xc24f('0x61')](['IS\x20NULL',_0xc24f('0x62'),_0xc24f('0x63'),_0xc24f('0x64')],_0x2cf239);};var _0x2a0a1e=function(_0xc75873){if(!_0xc75873||!_0xc75873[_0xc24f('0x65')][_0xc24f('0x39')]){return'';}for(var _0x30e782='(',_0x1aadc5=0x0;_0x1aadc5<_0xc75873[_0xc24f('0x65')][_0xc24f('0x39')];_0x1aadc5+=0x1){_0x1aadc5>0x0&&(_0x30e782+='\x20'+_0xc75873['operator']+'\x20');_0x30e782+=_0xc75873[_0xc24f('0x65')][_0x1aadc5][_0xc24f('0x66')]?_0x2a0a1e(_0xc75873['rules'][_0x1aadc5][_0xc24f('0x66')]):_0xc75873[_0xc24f('0x65')][_0x1aadc5][_0xc24f('0x67')]+'\x20'+_0xc75873[_0xc24f('0x65')][_0x1aadc5][_0xc24f('0x68')]+(_0x5dd403(_0xc75873[_0xc24f('0x65')][_0x1aadc5][_0xc24f('0x68')])?'\x20'+_0xc75873[_0xc24f('0x65')][_0x1aadc5]['value']:'');}return _0x30e782+')';};var _0x34754b={'where':{'id':_0x3b2f64[_0xc24f('0x69')]['id']}},_0x1c617d,_0xbc1b61,_0x4ced5b,_0x12a49d,_0xd90338;_0x34754b=_[_0xc24f('0x3e')]({},_0x34754b,_0x3b2f64['options']);return db[_0xc24f('0x46')][_0xc24f('0x48')](_0x34754b)[_0xc24f('0x26')](function(_0x477e83){if(_0x477e83){_0x1c617d=_0x477e83;return _0x477e83[_0xc24f('0x6a')]();}return null;})[_0xc24f('0x26')](function(_0x13bbec){if(_0x13bbec){if(!_0x13bbec[_0xc24f('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc24f('0x6b'),0x193);}_0xbc1b61=_0x13bbec;return db[_0xc24f('0x6c')]['findAll']({'raw':!![]});}return null;})[_0xc24f('0x26')](function(_0x2949c1){if(_0x2949c1){_0x4ced5b=_[_0xc24f('0x6d')](_0x2949c1,'id');var _0x29676a;var _0x2b4a7d=squel[_0xc24f('0x6e')]();_0x2b4a7d[_0xc24f('0x6f')](_0x1c617d[_0xc24f('0x70')]);for(var _0x90cad3=0x0;_0x90cad3<_0xbc1b61[_0xc24f('0x39')];_0x90cad3+=0x1){_0x29676a=_0xbc1b61[_0x90cad3]['MetricId']?_0x4ced5b[_0xbc1b61[_0x90cad3][_0xc24f('0x71')]][_0xc24f('0x72')]:_0xbc1b61[_0x90cad3][_0xc24f('0x67')];_0x29676a=_0xbc1b61[_0x90cad3]['function']?_[_0xc24f('0x73')](_0x586ac2[_0xbc1b61[_0x90cad3][_0xc24f('0x74')]],'%s',_0x29676a):_0x29676a;_0x29676a=_0xbc1b61[_0x90cad3][_0xc24f('0x75')]?_[_0xc24f('0x73')](_0x59d1b7[_0xbc1b61[_0x90cad3]['format']],'%s',_0x29676a):_0x29676a;if(_0xbc1b61[_0x90cad3][_0xc24f('0x76')]){_0x2b4a7d[_0xc24f('0x66')](_0x29676a);}_0xbc1b61[_0x90cad3][_0xc24f('0x77')]&&_0x2b4a7d[_0xc24f('0x3b')](_0x29676a,_0xbc1b61[_0x90cad3][_0xc24f('0x77')]==='DESC'?![]:!![]);_0x2b4a7d[_0xc24f('0x67')](_0x29676a,_0xbc1b61[_0x90cad3][_0xc24f('0x78')]||_0x29676a);}if(_0x1c617d['joins']){_0x1c617d['joins']=JSON[_0xc24f('0x79')](_0x1c617d[_0xc24f('0x7a')]);for(var _0xc2a3ea=0x0;_0xc2a3ea<_0x1c617d[_0xc24f('0x7a')][_0xc24f('0x39')];_0xc2a3ea+=0x1){if(_0x1c617d[_0xc24f('0x7a')][_0xc2a3ea]['type']&&_[_0xc24f('0x61')](_0x41f0e7,_0x1c617d[_0xc24f('0x7a')][_0xc2a3ea][_0xc24f('0x2f')])&&_0x1c617d[_0xc24f('0x7a')][_0xc2a3ea][_0xc24f('0x7b')]&&_0x1c617d[_0xc24f('0x7a')][_0xc2a3ea][_0xc24f('0x7c')]&&_0x1c617d[_0xc24f('0x7a')][_0xc2a3ea][_0xc24f('0x7d')]){_0x2b4a7d[_0x1c617d[_0xc24f('0x7a')][_0xc2a3ea][_0xc24f('0x2f')]](_0x1c617d['joins'][_0xc2a3ea][_0xc24f('0x7c')],null,util[_0xc24f('0x75')](_0xc24f('0x7e'),_0x1c617d[_0xc24f('0x70')],_0x1c617d[_0xc24f('0x7a')][_0xc2a3ea][_0xc24f('0x7b')],_0x1c617d[_0xc24f('0x7a')][_0xc2a3ea][_0xc24f('0x7c')],_0x1c617d[_0xc24f('0x7a')][_0xc2a3ea][_0xc24f('0x7d')]));}}}if(_0x1c617d[_0xc24f('0x7f')]){_0x1c617d[_0xc24f('0x7f')]=JSON[_0xc24f('0x79')](_0x1c617d[_0xc24f('0x7f')]);_0x2b4a7d[_0xc24f('0x3d')](_0x2a0a1e(_0x1c617d[_0xc24f('0x7f')][_0xc24f('0x66')]));}_0xd90338=_0x2b4a7d['clone']();_0x2b4a7d[_0xc24f('0x1f')](_0x5a0af4);_0x2b4a7d[_0xc24f('0x21')](0x0);logger[_0xc24f('0x80')]('Limited\x20Query:',_0x2b4a7d['toString']());return dbH[_0xc24f('0x81')][_0xc24f('0x33')](_0x2b4a7d[_0xc24f('0x82')](),{'type':dbH['sequelize']['QueryTypes'][_0xc24f('0x83')]});}})['then'](respondWithResult(_0x49fda7,null))[_0xc24f('0x44')](handleError(_0x49fda7,null));};function runReport(_0x226c61,_0x35b850,_0x4af757){var _0x1a033d=_0x35b850['name'];var _0x553857=0xa;var _0x1fdc3c=[_0xc24f('0x84'),_0xc24f('0x54'),_0xc24f('0x55'),_0xc24f('0x56')];var _0x32f7e6={'SUM':_0xc24f('0x85'),'COUNT':_0xc24f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc24f('0x86'),'MIN':_0xc24f('0x59'),'AVG':_0xc24f('0x5a'),'GROUP_CONCAT':_0xc24f('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc24f('0x5d')};var _0x1fc426={'SEC_TO_TIME':_0xc24f('0x87'),'DATE':_0xc24f('0x88'),'HOUR':_0xc24f('0x5e'),'ROUND':_0xc24f('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1d9104=function(_0x1a322e){return!_[_0xc24f('0x61')](['IS\x20NULL',_0xc24f('0x62'),_0xc24f('0x63'),_0xc24f('0x64')],_0x1a322e);};var _0x35d517=function(_0x5416ed){if(!_0x5416ed||!_0x5416ed['rules'][_0xc24f('0x39')]){return'';}for(var _0x4a31bd='(',_0x5cc37d=0x0;_0x5cc37d<_0x5416ed['rules']['length'];_0x5cc37d+=0x1){_0x5cc37d>0x0&&(_0x4a31bd+='\x20'+_0x5416ed[_0xc24f('0x89')]+'\x20');_0x4a31bd+=_0x5416ed[_0xc24f('0x65')][_0x5cc37d][_0xc24f('0x66')]?_0x35d517(_0x5416ed[_0xc24f('0x65')][_0x5cc37d][_0xc24f('0x66')]):_0x5416ed[_0xc24f('0x65')][_0x5cc37d][_0xc24f('0x67')]+'\x20'+_0x5416ed[_0xc24f('0x65')][_0x5cc37d]['condition']+(_0x1d9104(_0x5416ed[_0xc24f('0x65')][_0x5cc37d][_0xc24f('0x68')])?'\x20'+_0x5416ed[_0xc24f('0x65')][_0x5cc37d]['value']:'');}return _0x4a31bd+')';};var _0x82e7d0={'where':{'id':_0x226c61['id']}},_0x5e138d,_0x7cd6,_0x374728,_0x23b0f1,_0x467acc;_0x82e7d0=_[_0xc24f('0x3e')]({},_0x82e7d0,_0x4af757);return db[_0xc24f('0x46')][_0xc24f('0x48')](_0x82e7d0)[_0xc24f('0x26')](function(_0x5c6bcd){if(_0x5c6bcd){_0x5e138d=_0x5c6bcd;return _0x5c6bcd['getFields']();}return null;})['then'](function(_0x323ac6){if(_0x323ac6){if(!_0x323ac6['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xc24f('0x6b'),0x193);}_0x7cd6=_0x323ac6;return db[_0xc24f('0x6c')]['findAll']({'raw':!![]});}return null;})[_0xc24f('0x26')](function(_0x2ee8e7){if(_0x2ee8e7){_0x374728=_[_0xc24f('0x6d')](_0x2ee8e7,'id');var _0x35ab80;var _0xdfb647=squel[_0xc24f('0x6e')]();_0xdfb647[_0xc24f('0x6f')](_0x5e138d[_0xc24f('0x70')]);for(var _0x4b0c06=0x0;_0x4b0c06<_0x7cd6[_0xc24f('0x39')];_0x4b0c06+=0x1){_0x35ab80=_0x7cd6[_0x4b0c06][_0xc24f('0x71')]?_0x374728[_0x7cd6[_0x4b0c06][_0xc24f('0x71')]]['metric']:_0x7cd6[_0x4b0c06]['field'];_0x35ab80=_0x7cd6[_0x4b0c06][_0xc24f('0x74')]?_[_0xc24f('0x73')](_0x32f7e6[_0x7cd6[_0x4b0c06]['function']],'%s',_0x35ab80):_0x35ab80;_0x35ab80=_0x7cd6[_0x4b0c06]['format']?_[_0xc24f('0x73')](_0x1fc426[_0x7cd6[_0x4b0c06][_0xc24f('0x75')]],'%s',_0x35ab80):_0x35ab80;if(_0x7cd6[_0x4b0c06][_0xc24f('0x76')]){_0xdfb647[_0xc24f('0x66')](_0x35ab80);}_0x7cd6[_0x4b0c06][_0xc24f('0x77')]&&_0xdfb647['order'](_0x35ab80,_0x7cd6[_0x4b0c06][_0xc24f('0x77')]===_0xc24f('0x8a')?![]:!![]);_0xdfb647[_0xc24f('0x67')](_0x35ab80,_0x7cd6[_0x4b0c06]['alias']||_0x35ab80);}if(_0x5e138d[_0xc24f('0x7a')]){_0x5e138d[_0xc24f('0x7a')]=JSON[_0xc24f('0x79')](_0x5e138d[_0xc24f('0x7a')]);for(var _0x2c23f1=0x0;_0x2c23f1<_0x5e138d['joins'][_0xc24f('0x39')];_0x2c23f1+=0x1){if(_0x5e138d[_0xc24f('0x7a')][_0x2c23f1][_0xc24f('0x2f')]&&_[_0xc24f('0x61')](_0x1fdc3c,_0x5e138d[_0xc24f('0x7a')][_0x2c23f1][_0xc24f('0x2f')])&&_0x5e138d[_0xc24f('0x7a')][_0x2c23f1]['parentKey']&&_0x5e138d[_0xc24f('0x7a')][_0x2c23f1][_0xc24f('0x7c')]&&_0x5e138d[_0xc24f('0x7a')][_0x2c23f1][_0xc24f('0x7d')]){_0xdfb647[_0x5e138d['joins'][_0x2c23f1][_0xc24f('0x2f')]](_0x5e138d[_0xc24f('0x7a')][_0x2c23f1][_0xc24f('0x7c')],null,util[_0xc24f('0x75')](_0xc24f('0x7e'),_0x5e138d[_0xc24f('0x70')],_0x5e138d['joins'][_0x2c23f1][_0xc24f('0x7b')],_0x5e138d[_0xc24f('0x7a')][_0x2c23f1][_0xc24f('0x7c')],_0x5e138d[_0xc24f('0x7a')][_0x2c23f1][_0xc24f('0x7d')]));}}}if(_0x5e138d[_0xc24f('0x7f')]){_0x5e138d[_0xc24f('0x7f')]=JSON[_0xc24f('0x79')](_0x5e138d[_0xc24f('0x7f')]);_0xdfb647[_0xc24f('0x3d')](_0x35d517(_0x5e138d[_0xc24f('0x7f')][_0xc24f('0x66')]));}_0x467acc=_0xdfb647[_0xc24f('0x8b')]();_0xdfb647[_0xc24f('0x1f')](_0x553857);_0xdfb647[_0xc24f('0x21')](0x0);return;}})[_0xc24f('0x26')](function(){if(_0x35b850[_0xc24f('0x8c')]===_0xc24f('0x8d')){return null;}var _0x5d6bc8=_[_0xc24f('0x3e')](_0x35b850,{'name':_0x35b850['fullPath']||_0x35b850[_0xc24f('0x2c')]||_0x5e138d[_0xc24f('0x2c')],'basename':_0x1a033d,'savename':util[_0xc24f('0x75')](_0xc24f('0x8e'),_0x35b850[_0xc24f('0x2c')]||_0x5e138d[_0xc24f('0x2c')],require('randomstring')[_0xc24f('0x8f')](0x4),_0x35b850[_0xc24f('0x8c')]||_0xc24f('0x90')),'reportId':_0x5e138d['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xc24f('0x49')](_0x5d6bc8,{'raw':!![]});})[_0xc24f('0x26')](function(_0x27d667){if(_0x5e138d[_0xc24f('0x70')]===_0xc24f('0x91')){_0x467acc[_0xc24f('0x3d')](_0x5e138d['table']+_0xc24f('0x92'),_0x35b850[_0xc24f('0x93')],_0x35b850[_0xc24f('0x94')]);}else{_0x467acc[_0xc24f('0x3d')](_0x5e138d['table']+_0xc24f('0x95'),_0x35b850['startDate'],_0x35b850['endDate']);}if(_0x27d667){logger[_0xc24f('0x96')](_0xc24f('0x97'),_0x467acc[_0xc24f('0x82')]());require(_0xc24f('0x98'))['fork'](path[_0xc24f('0x84')](__dirname,_0xc24f('0x99'),_0x27d667[_0xc24f('0x8c')]),[_0x27d667['id'],_0x467acc[_0xc24f('0x82')](),path[_0xc24f('0x84')](__dirname,_0xc24f('0x9a'),_0x27d667['savename']),_0x1a033d]);return _0x27d667;}else{var _0x480edd=squel['select']();_0x480edd[_0xc24f('0x6f')]('('+_0x467acc[_0xc24f('0x82')]()+')',_0xc24f('0x9b'));_0x480edd[_0xc24f('0x67')](_0xc24f('0x9c'),_0xc24f('0x20'));_0x467acc[_0xc24f('0x1f')](_0x35b850[_0xc24f('0x1f')]||_0x553857);_0x467acc[_0xc24f('0x21')](_0x35b850['offset']||0x0);return dbH[_0xc24f('0x81')]['query'](_0x480edd[_0xc24f('0x82')](),{'type':dbH[_0xc24f('0x81')][_0xc24f('0x9d')]['SELECT']})['then'](function(_0x5b9eb2){if(!_0x5b9eb2['length']){_0x23b0f1=0x0;}else{_0x23b0f1=_0x5b9eb2[0x0]['count']||0x0;}return dbH[_0xc24f('0x81')][_0xc24f('0x33')](_0x467acc[_0xc24f('0x82')](),{'type':dbH['sequelize'][_0xc24f('0x9d')][_0xc24f('0x83')]});})['then'](function(_0x563018){return{'rows':_0x563018||[],'count':_0x23b0f1};});}});}exports[_0xc24f('0x9e')]=function(_0x43534b,_0xe248cc){return runReport(_0x43534b[_0xc24f('0x69')],_0x43534b[_0xc24f('0x33')],_0x43534b[_0xc24f('0x41')])['then'](respondWithResult(_0xe248cc,null))[_0xc24f('0x44')](handleError(_0xe248cc,null));};exports[_0xc24f('0x9f')]=runReport;exports['query']=function(_0xa2d33f,_0x1c6c71){var _0x5aef40=0xa;var _0x267ea0=[_0xc24f('0x84'),'left_join',_0xc24f('0x55'),_0xc24f('0x56')];var _0x195383={'SUM':_0xc24f('0x85'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc24f('0x58'),'MAX':_0xc24f('0x86'),'MIN':_0xc24f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc24f('0x5c'),'GROUP_CONCAT DESC':_0xc24f('0x5d')};var _0x67ba0a={'SEC_TO_TIME':_0xc24f('0x87'),'DATE':_0xc24f('0x88'),'HOUR':_0xc24f('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc24f('0x60')};var _0x1f3911=function(_0x483b4e){return!_['includes']([_0xc24f('0xa0'),_0xc24f('0x62'),_0xc24f('0x63'),'IS\x20NOT\x20EMPTY'],_0x483b4e);};var _0x5f435c=function(_0x4fa19a){if(!_0x4fa19a||!_0x4fa19a[_0xc24f('0x65')][_0xc24f('0x39')]){return'';}for(var _0x2f6327='(',_0x52dcfd=0x0;_0x52dcfd<_0x4fa19a['rules'][_0xc24f('0x39')];_0x52dcfd+=0x1){_0x52dcfd>0x0&&(_0x2f6327+='\x20'+_0x4fa19a[_0xc24f('0x89')]+'\x20');_0x2f6327+=_0x4fa19a[_0xc24f('0x65')][_0x52dcfd][_0xc24f('0x66')]?_0x5f435c(_0x4fa19a[_0xc24f('0x65')][_0x52dcfd][_0xc24f('0x66')]):_0x4fa19a[_0xc24f('0x65')][_0x52dcfd][_0xc24f('0x67')]+'\x20'+_0x4fa19a[_0xc24f('0x65')][_0x52dcfd]['condition']+(_0x1f3911(_0x4fa19a[_0xc24f('0x65')][_0x52dcfd][_0xc24f('0x68')])?'\x20'+_0x4fa19a[_0xc24f('0x65')][_0x52dcfd][_0xc24f('0xa1')]:'');}return _0x2f6327+')';};var _0x3ec0c1={'where':{'id':_0xa2d33f[_0xc24f('0x69')]['id']}},_0x31d476,_0xad4f07,_0x9cd604,_0xd46958,_0x1cb07e;_0x3ec0c1=_[_0xc24f('0x3e')]({},_0x3ec0c1,_0xa2d33f[_0xc24f('0x41')]);return db['AnalyticCustomReport']['find'](_0x3ec0c1)[_0xc24f('0x26')](function(_0x66a746){if(_0x66a746){_0x31d476=_0x66a746;return _0x66a746[_0xc24f('0x6a')]();}return null;})[_0xc24f('0x26')](function(_0x55b4f8){if(_0x55b4f8){if(!_0x55b4f8['length']){throw new db[(_0xc24f('0xa2'))]['ValidationErrorItem'](_0xc24f('0x6b'),0x193);}_0xad4f07=_0x55b4f8;return db[_0xc24f('0x6c')][_0xc24f('0xa3')]({'raw':!![]});}return null;})['then'](function(_0x46e48d){if(_0x46e48d){_0x9cd604=_['keyBy'](_0x46e48d,'id');var _0x303124;var _0x597d2b=squel[_0xc24f('0x6e')]();_0x597d2b[_0xc24f('0x6f')](_0x31d476[_0xc24f('0x70')]);for(var _0x20bf77=0x0;_0x20bf77<_0xad4f07[_0xc24f('0x39')];_0x20bf77+=0x1){_0x303124=_0xad4f07[_0x20bf77][_0xc24f('0x71')]?_0x9cd604[_0xad4f07[_0x20bf77][_0xc24f('0x71')]][_0xc24f('0x72')]:_0xad4f07[_0x20bf77][_0xc24f('0x67')];_0x303124=_0xad4f07[_0x20bf77][_0xc24f('0x74')]?_[_0xc24f('0x73')](_0x195383[_0xad4f07[_0x20bf77][_0xc24f('0x74')]],'%s',_0x303124):_0x303124;_0x303124=_0xad4f07[_0x20bf77][_0xc24f('0x75')]?_[_0xc24f('0x73')](_0x67ba0a[_0xad4f07[_0x20bf77][_0xc24f('0x75')]],'%s',_0x303124):_0x303124;if(_0xad4f07[_0x20bf77]['groupBy']){_0x597d2b['group'](_0x303124);}_0xad4f07[_0x20bf77][_0xc24f('0x77')]&&_0x597d2b[_0xc24f('0x3b')](_0x303124,_0xad4f07[_0x20bf77][_0xc24f('0x77')]===_0xc24f('0x8a')?![]:!![]);_0x597d2b[_0xc24f('0x67')](_0x303124,_0xad4f07[_0x20bf77][_0xc24f('0x78')]||_0x303124);}if(_0x31d476[_0xc24f('0x7a')]){_0x31d476[_0xc24f('0x7a')]=JSON[_0xc24f('0x79')](_0x31d476[_0xc24f('0x7a')]);for(var _0xaf9816=0x0;_0xaf9816<_0x31d476[_0xc24f('0x7a')][_0xc24f('0x39')];_0xaf9816+=0x1){if(_0x31d476[_0xc24f('0x7a')][_0xaf9816][_0xc24f('0x2f')]&&_[_0xc24f('0x61')](_0x267ea0,_0x31d476[_0xc24f('0x7a')][_0xaf9816][_0xc24f('0x2f')])&&_0x31d476[_0xc24f('0x7a')][_0xaf9816][_0xc24f('0x7b')]&&_0x31d476['joins'][_0xaf9816][_0xc24f('0x7c')]&&_0x31d476['joins'][_0xaf9816]['foreignKey']){_0x597d2b[_0x31d476[_0xc24f('0x7a')][_0xaf9816][_0xc24f('0x2f')]](_0x31d476['joins'][_0xaf9816]['foreignTable'],null,util[_0xc24f('0x75')](_0xc24f('0x7e'),_0x31d476[_0xc24f('0x70')],_0x31d476[_0xc24f('0x7a')][_0xaf9816][_0xc24f('0x7b')],_0x31d476['joins'][_0xaf9816][_0xc24f('0x7c')],_0x31d476[_0xc24f('0x7a')][_0xaf9816][_0xc24f('0x7d')]));}}}if(_0x31d476['conditions']){_0x31d476[_0xc24f('0x7f')]=JSON[_0xc24f('0x79')](_0x31d476[_0xc24f('0x7f')]);_0x597d2b[_0xc24f('0x3d')](_0x5f435c(_0x31d476['conditions'][_0xc24f('0x66')]));}_0x1cb07e=_0x597d2b[_0xc24f('0x8b')]();_0x597d2b['limit'](_0x5aef40);_0x597d2b[_0xc24f('0x21')](0x0);logger['debug'](_0xc24f('0xa4'),_0x597d2b[_0xc24f('0x82')]());return dbH[_0xc24f('0x81')][_0xc24f('0x33')](_0x597d2b['toString'](),{'type':dbH[_0xc24f('0x81')]['QueryTypes'][_0xc24f('0x83')]});}})[_0xc24f('0x26')](function(){return{'sql':_0x1cb07e[_0xc24f('0x82')]()};})[_0xc24f('0x26')](respondWithResult(_0x1c6c71,null))['catch'](handleError(_0x1c6c71,null));};
\ No newline at end of file
+var _0x953d=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','json','undefined','limit','count','Content-Range','apply','reject','update','get','CustomReports','UserProfileResource','destroy','then','end','sendStatus','error','stack','name','send','AnalyticCustomReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','rows','catch','show','params','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','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)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','sequelize','QueryTypes','SELECT','join','COUNT(%s)','MAX(%s)','HOUR(%s)','from','web','fullPath','randomstring','generate','output','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','toString','child_process','fork','savename','select','run','runReport','order','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x35181c,_0x82694a){var _0xe14bf9=function(_0x2be9b7){while(--_0x2be9b7){_0x35181c['push'](_0x35181c['shift']());}};_0xe14bf9(++_0x82694a);}(_0x953d,0x93));var _0xd953=function(_0x34bc5e,_0x538eb4){_0x34bc5e=_0x34bc5e-0x0;var _0x3e6969=_0x953d[_0x34bc5e];return _0x3e6969;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd953('0x0'));var zipdir=require(_0xd953('0x1'));var jsonpatch=require(_0xd953('0x2'));var rp=require('request-promise');var moment=require(_0xd953('0x3'));var BPromise=require(_0xd953('0x4'));var Mustache=require(_0xd953('0x5'));var util=require(_0xd953('0x6'));var path=require(_0xd953('0x7'));var sox=require(_0xd953('0x8'));var csv=require('to-csv');var ejs=require(_0xd953('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd953('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd953('0xb'));var querystring=require('querystring');var Papa=require(_0xd953('0xc'));var Redis=require(_0xd953('0xd'));var authService=require(_0xd953('0xe'));var qs=require(_0xd953('0xf'));var as=require(_0xd953('0x10'));var hardwareService=require(_0xd953('0x11'));var logger=require('../../config/logger')(_0xd953('0x12'));var utils=require(_0xd953('0x13'));var config=require(_0xd953('0x14'));var licenseUtil=require(_0xd953('0x15'));var db=require(_0xd953('0x16'))['db'];var dbH=require(_0xd953('0x16'))[_0xd953('0x17')];function respondWithStatusCode(_0x14ce0e,_0x3381c9){_0x3381c9=_0x3381c9||0xcc;return function(_0x4e100e){if(_0x4e100e){return _0x14ce0e['sendStatus'](_0x3381c9);}return _0x14ce0e[_0xd953('0x18')](_0x3381c9)['end']();};}function respondWithResult(_0x1431b8,_0x1dfdcf){_0x1dfdcf=_0x1dfdcf||0xc8;return function(_0x5c1fd1){if(_0x5c1fd1){return _0x1431b8[_0xd953('0x18')](_0x1dfdcf)[_0xd953('0x19')](_0x5c1fd1);}};}function respondWithFilteredResult(_0x16626d,_0x2e268f){return function(_0x8dcf90){if(_0x8dcf90){var _0x5f417e=typeof _0x2e268f['offset']===_0xd953('0x1a')&&typeof _0x2e268f[_0xd953('0x1b')]===_0xd953('0x1a');var _0x2e6e21=_0x8dcf90[_0xd953('0x1c')];var _0x4a42d3=_0x5f417e?0x0:_0x2e268f['offset'];var _0xe2825=_0x5f417e?_0x8dcf90[_0xd953('0x1c')]:_0x2e268f['offset']+_0x2e268f[_0xd953('0x1b')];var _0x33b4ed;if(_0xe2825>=_0x2e6e21){_0xe2825=_0x2e6e21;_0x33b4ed=0xc8;}else{_0x33b4ed=0xce;}_0x16626d[_0xd953('0x18')](_0x33b4ed);return _0x16626d['set'](_0xd953('0x1d'),_0x4a42d3+'-'+_0xe2825+'/'+_0x2e6e21)['json'](_0x8dcf90);}return null;};}function patchUpdates(_0x32ed2d){return function(_0x17e4db){try{jsonpatch[_0xd953('0x1e')](_0x17e4db,_0x32ed2d,!![]);}catch(_0x53aee5){return BPromise[_0xd953('0x1f')](_0x53aee5);}return _0x17e4db['save']();};}function saveUpdates(_0x53f814,_0x47f2eb){return function(_0x381639){if(_0x381639){return _0x381639[_0xd953('0x20')](_0x53f814)['then'](function(_0x1516af){return _0x1516af;});}return null;};}function removeEntity(_0x2bd319,_0x4cf97c){return function(_0x1fba70){if(_0x1fba70){return _0x1fba70['destroy']()['then'](function(){var _0x982bde=_0x1fba70[_0xd953('0x21')]({'plain':!![]});var _0x1ef42a=_0xd953('0x22');return db[_0xd953('0x23')][_0xd953('0x24')]({'where':{'type':_0x1ef42a,'resourceId':_0x982bde['id']}})[_0xd953('0x25')](function(){return _0x1fba70;});})[_0xd953('0x25')](function(){_0x2bd319[_0xd953('0x18')](0xcc)[_0xd953('0x26')]();});}};}function handleEntityNotFound(_0xa5325a,_0x52f2f0){return function(_0x25a18b){if(!_0x25a18b){_0xa5325a[_0xd953('0x27')](0x194);}return _0x25a18b;};}function handleError(_0xe1ec71,_0x37c8aa){_0x37c8aa=_0x37c8aa||0x1f4;return function(_0x42a11a){logger[_0xd953('0x28')](_0x42a11a[_0xd953('0x29')]);if(_0x42a11a[_0xd953('0x2a')]){delete _0x42a11a[_0xd953('0x2a')];}_0xe1ec71['status'](_0x37c8aa)[_0xd953('0x2b')](_0x42a11a);};}exports['index']=function(_0x355410,_0x52ea20){var _0x21c004={},_0x53be4f={},_0x59f5bb={'count':0x0,'rows':[]};var _0x176a47=_['map'](db[_0xd953('0x2c')][_0xd953('0x2d')],function(_0x46f438){return{'name':_0x46f438['fieldName'],'type':_0x46f438[_0xd953('0x2e')][_0xd953('0x2f')]};});_0x53be4f[_0xd953('0x30')]=_[_0xd953('0x31')](_0x176a47,'name');_0x53be4f[_0xd953('0x32')]=_[_0xd953('0x33')](_0x355410[_0xd953('0x32')]);_0x53be4f[_0xd953('0x34')]=_[_0xd953('0x35')](_0x53be4f[_0xd953('0x30')],_0x53be4f[_0xd953('0x32')]);_0x21c004[_0xd953('0x36')]=_[_0xd953('0x35')](_0x53be4f['model'],qs['fields'](_0x355410['query'][_0xd953('0x37')]));_0x21c004[_0xd953('0x36')]=_0x21c004['attributes']['length']?_0x21c004[_0xd953('0x36')]:_0x53be4f[_0xd953('0x30')];if(!_0x355410[_0xd953('0x32')][_0xd953('0x38')](_0xd953('0x39'))){_0x21c004[_0xd953('0x1b')]=qs[_0xd953('0x1b')](_0x355410[_0xd953('0x32')][_0xd953('0x1b')]);_0x21c004['offset']=qs['offset'](_0x355410[_0xd953('0x32')][_0xd953('0x3a')]);}_0x21c004['order']=qs[_0xd953('0x3b')](_0x355410[_0xd953('0x32')][_0xd953('0x3b')]);_0x21c004['where']=qs[_0xd953('0x34')](_[_0xd953('0x3c')](_0x355410[_0xd953('0x32')],_0x53be4f[_0xd953('0x34')]),_0x176a47);if(_0x355410[_0xd953('0x32')][_0xd953('0x3d')]){_0x21c004['where']=_[_0xd953('0x3e')](_0x21c004[_0xd953('0x3f')],{'$or':_[_0xd953('0x31')](_0x176a47,function(_0x4f104b){if(_0x4f104b['type']!==_0xd953('0x40')){var _0x4893c0={};_0x4893c0[_0x4f104b['name']]={'$like':'%'+_0x355410[_0xd953('0x32')][_0xd953('0x3d')]+'%'};return _0x4893c0;}})});}_0x21c004=_['merge']({},_0x21c004,_0x355410['options']);var _0x3f0cc0={'where':_0x21c004[_0xd953('0x3f')]};return db['AnalyticCustomReport'][_0xd953('0x1c')](_0x3f0cc0)[_0xd953('0x25')](function(_0x1e7446){_0x59f5bb[_0xd953('0x1c')]=_0x1e7446;if(_0x355410['query'][_0xd953('0x41')]){_0x21c004[_0xd953('0x42')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x21c004);})['then'](function(_0x57a715){_0x59f5bb[_0xd953('0x43')]=_0x57a715;return _0x59f5bb;})[_0xd953('0x25')](respondWithFilteredResult(_0x52ea20,_0x21c004))[_0xd953('0x44')](handleError(_0x52ea20,null));};exports[_0xd953('0x45')]=function(_0x55fc6a,_0x29b3db){var _0x5063ac={'raw':![],'where':{'id':_0x55fc6a[_0xd953('0x46')]['id']}},_0x5899d6={};_0x5899d6[_0xd953('0x30')]=_['keys'](db[_0xd953('0x2c')][_0xd953('0x2d')]);_0x5899d6[_0xd953('0x32')]=_[_0xd953('0x33')](_0x55fc6a[_0xd953('0x32')]);_0x5899d6[_0xd953('0x34')]=_['intersection'](_0x5899d6[_0xd953('0x30')],_0x5899d6[_0xd953('0x32')]);_0x5063ac[_0xd953('0x36')]=_[_0xd953('0x35')](_0x5899d6[_0xd953('0x30')],qs['fields'](_0x55fc6a[_0xd953('0x32')][_0xd953('0x37')]));_0x5063ac['attributes']=_0x5063ac[_0xd953('0x36')]['length']?_0x5063ac['attributes']:_0x5899d6[_0xd953('0x30')];if(_0x55fc6a[_0xd953('0x32')][_0xd953('0x41')]){_0x5063ac[_0xd953('0x42')]=[{'all':!![]}];}_0x5063ac=_[_0xd953('0x3e')]({},_0x5063ac,_0x55fc6a[_0xd953('0x47')]);return db[_0xd953('0x2c')]['find'](_0x5063ac)[_0xd953('0x25')](handleEntityNotFound(_0x29b3db,null))[_0xd953('0x25')](respondWithResult(_0x29b3db,null))[_0xd953('0x44')](handleError(_0x29b3db,null));};exports[_0xd953('0x48')]=function(_0x3c68e7,_0x4fd5f7){return db[_0xd953('0x2c')][_0xd953('0x48')](_0x3c68e7['body'],{})[_0xd953('0x25')](function(_0x3728e8){var _0x177d20=_0x3c68e7[_0xd953('0x49')][_0xd953('0x21')]({'plain':!![]});if(!_0x177d20)throw new Error(_0xd953('0x4a'));if(_0x177d20[_0xd953('0x4b')]===_0xd953('0x49')){var _0x3681e8=_0x3728e8[_0xd953('0x21')]({'plain':!![]});var _0x31f9ff=_0xd953('0x4c');return db['UserProfileSection'][_0xd953('0x4d')]({'where':{'name':_0x31f9ff,'userProfileId':_0x177d20[_0xd953('0x4e')]},'raw':!![]})[_0xd953('0x25')](function(_0x9800ad){if(_0x9800ad&&_0x9800ad[_0xd953('0x4f')]===0x0){return db[_0xd953('0x23')][_0xd953('0x48')]({'name':_0x3681e8[_0xd953('0x2a')],'resourceId':_0x3681e8['id'],'type':_0xd953('0x22'),'sectionId':_0x9800ad['id']},{})['then'](function(){return _0x3728e8;});}else{return _0x3728e8;}})[_0xd953('0x44')](function(_0x31c558){logger['error'](_0xd953('0x50'),_0x31c558);throw _0x31c558;});}return _0x3728e8;})['then'](respondWithResult(_0x4fd5f7,0xc9))[_0xd953('0x44')](handleError(_0x4fd5f7,null));};exports[_0xd953('0x20')]=function(_0x4c9e69,_0x2f4f43){if(_0x4c9e69[_0xd953('0x51')]['id']){delete _0x4c9e69[_0xd953('0x51')]['id'];}return db['AnalyticCustomReport'][_0xd953('0x4d')]({'where':{'id':_0x4c9e69['params']['id']}})[_0xd953('0x25')](handleEntityNotFound(_0x2f4f43,null))[_0xd953('0x25')](saveUpdates(_0x4c9e69[_0xd953('0x51')],null))['then'](respondWithResult(_0x2f4f43,null))[_0xd953('0x44')](handleError(_0x2f4f43,null));};exports[_0xd953('0x24')]=function(_0xc4f001,_0x3bd92a){return db[_0xd953('0x2c')]['find']({'where':{'id':_0xc4f001[_0xd953('0x46')]['id']}})[_0xd953('0x25')](handleEntityNotFound(_0x3bd92a,null))[_0xd953('0x25')](removeEntity(_0x3bd92a,null))[_0xd953('0x44')](handleError(_0x3bd92a,null));};exports[_0xd953('0x52')]=function(_0x2b2c99,_0x2ac661){var _0x1485a0=0xa;var _0x48d331=['join',_0xd953('0x53'),_0xd953('0x54'),_0xd953('0x55')];var _0x3c94ed={'SUM':_0xd953('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd953('0x57'),'MAX':'MAX(%s)','MIN':_0xd953('0x58'),'AVG':_0xd953('0x59'),'GROUP_CONCAT':_0xd953('0x5a'),'GROUP_CONCAT ASC':_0xd953('0x5b'),'GROUP_CONCAT DESC':_0xd953('0x5c')};var _0xcd161a={'SEC_TO_TIME':_0xd953('0x5d'),'DATE':_0xd953('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0xd953('0x5f'),'UNIX_TIMESTAMP':_0xd953('0x60')};var _0x4f1952=function(_0x39fd29){return!_[_0xd953('0x61')]([_0xd953('0x62'),_0xd953('0x63'),_0xd953('0x64'),_0xd953('0x65')],_0x39fd29);};var _0x3158b4=function(_0x5258d9){if(!_0x5258d9||!_0x5258d9[_0xd953('0x66')][_0xd953('0x67')]){return'';}for(var _0x1723cc='(',_0x386965=0x0;_0x386965<_0x5258d9[_0xd953('0x66')]['length'];_0x386965+=0x1){_0x386965>0x0&&(_0x1723cc+='\x20'+_0x5258d9[_0xd953('0x68')]+'\x20');_0x1723cc+=_0x5258d9['rules'][_0x386965][_0xd953('0x69')]?_0x3158b4(_0x5258d9[_0xd953('0x66')][_0x386965][_0xd953('0x69')]):_0x5258d9['rules'][_0x386965][_0xd953('0x6a')]+'\x20'+_0x5258d9['rules'][_0x386965][_0xd953('0x6b')]+(_0x4f1952(_0x5258d9['rules'][_0x386965][_0xd953('0x6b')])?'\x20'+_0x5258d9[_0xd953('0x66')][_0x386965][_0xd953('0x6c')]:'');}return _0x1723cc+')';};var _0x2f7e9d={'where':{'id':_0x2b2c99[_0xd953('0x46')]['id']}},_0x192632,_0x5cbec2,_0x20eb1a,_0x481854,_0x1da44f;_0x2f7e9d=_['merge']({},_0x2f7e9d,_0x2b2c99['options']);return db[_0xd953('0x2c')]['find'](_0x2f7e9d)['then'](function(_0x451d5f){if(_0x451d5f){_0x192632=_0x451d5f;return _0x451d5f['getFields']();}return null;})[_0xd953('0x25')](function(_0x3072ba){if(_0x3072ba){if(!_0x3072ba['length']){throw new db[(_0xd953('0x6d'))][(_0xd953('0x6e'))](_0xd953('0x6f'),0x193);}_0x5cbec2=_0x3072ba;return db[_0xd953('0x70')][_0xd953('0x71')]({'raw':!![]});}return null;})[_0xd953('0x25')](function(_0x3c76a2){if(_0x3c76a2){_0x20eb1a=_[_0xd953('0x72')](_0x3c76a2,'id');var _0x38096c;var _0x59b006=squel['select']();_0x59b006['from'](_0x192632[_0xd953('0x73')]);for(var _0x2be5c0=0x0;_0x2be5c0<_0x5cbec2['length'];_0x2be5c0+=0x1){_0x38096c=_0x5cbec2[_0x2be5c0]['MetricId']?_0x20eb1a[_0x5cbec2[_0x2be5c0][_0xd953('0x74')]][_0xd953('0x75')]:_0x5cbec2[_0x2be5c0][_0xd953('0x6a')];_0x38096c=_0x5cbec2[_0x2be5c0][_0xd953('0x76')]?_['replace'](_0x3c94ed[_0x5cbec2[_0x2be5c0][_0xd953('0x76')]],'%s',_0x38096c):_0x38096c;_0x38096c=_0x5cbec2[_0x2be5c0][_0xd953('0x77')]?_[_0xd953('0x78')](_0xcd161a[_0x5cbec2[_0x2be5c0][_0xd953('0x77')]],'%s',_0x38096c):_0x38096c;if(_0x5cbec2[_0x2be5c0][_0xd953('0x79')]){_0x59b006[_0xd953('0x69')](_0x38096c);}_0x5cbec2[_0x2be5c0]['orderBy']&&_0x59b006['order'](_0x38096c,_0x5cbec2[_0x2be5c0][_0xd953('0x7a')]===_0xd953('0x7b')?![]:!![]);_0x59b006[_0xd953('0x6a')](_0x38096c,_0x5cbec2[_0x2be5c0][_0xd953('0x7c')]||_0x38096c);}if(_0x192632[_0xd953('0x7d')]){_0x192632[_0xd953('0x7d')]=JSON[_0xd953('0x7e')](_0x192632[_0xd953('0x7d')]);for(var _0x347ca9=0x0;_0x347ca9<_0x192632[_0xd953('0x7d')][_0xd953('0x67')];_0x347ca9+=0x1){if(_0x192632[_0xd953('0x7d')][_0x347ca9][_0xd953('0x2e')]&&_[_0xd953('0x61')](_0x48d331,_0x192632['joins'][_0x347ca9][_0xd953('0x2e')])&&_0x192632[_0xd953('0x7d')][_0x347ca9][_0xd953('0x7f')]&&_0x192632[_0xd953('0x7d')][_0x347ca9][_0xd953('0x80')]&&_0x192632['joins'][_0x347ca9]['foreignKey']){_0x59b006[_0x192632[_0xd953('0x7d')][_0x347ca9][_0xd953('0x2e')]](_0x192632[_0xd953('0x7d')][_0x347ca9]['foreignTable'],null,util[_0xd953('0x77')](_0xd953('0x81'),_0x192632[_0xd953('0x73')],_0x192632['joins'][_0x347ca9]['parentKey'],_0x192632[_0xd953('0x7d')][_0x347ca9]['foreignTable'],_0x192632[_0xd953('0x7d')][_0x347ca9][_0xd953('0x82')]));}}}if(_0x192632['conditions']){_0x192632[_0xd953('0x83')]=JSON[_0xd953('0x7e')](_0x192632[_0xd953('0x83')]);_0x59b006[_0xd953('0x3f')](_0x3158b4(_0x192632[_0xd953('0x83')]['group']));}_0x1da44f=_0x59b006[_0xd953('0x84')]();_0x59b006['limit'](_0x1485a0);_0x59b006[_0xd953('0x3a')](0x0);logger[_0xd953('0x85')]('Limited\x20Query:',_0x59b006['toString']());return dbH[_0xd953('0x86')][_0xd953('0x32')](_0x59b006['toString'](),{'type':dbH['sequelize'][_0xd953('0x87')][_0xd953('0x88')]});}})[_0xd953('0x25')](respondWithResult(_0x2ac661,null))[_0xd953('0x44')](handleError(_0x2ac661,null));};function runReport(_0x1f4912,_0x3e9722,_0x2eacfc){var _0x377341=_0x3e9722[_0xd953('0x2a')];var _0x472ed6=0xa;var _0x37321e=[_0xd953('0x89'),_0xd953('0x53'),'right_join',_0xd953('0x55')];var _0x193513={'SUM':_0xd953('0x56'),'COUNT':_0xd953('0x8a'),'COUNT DISTINCT':_0xd953('0x57'),'MAX':_0xd953('0x8b'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd953('0x5a'),'GROUP_CONCAT ASC':_0xd953('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x7057e0={'SEC_TO_TIME':_0xd953('0x5d'),'DATE':_0xd953('0x5e'),'HOUR':_0xd953('0x8c'),'ROUND':_0xd953('0x5f'),'UNIX_TIMESTAMP':_0xd953('0x60')};var _0x3b89b7=function(_0x231e4f){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xd953('0x64'),_0xd953('0x65')],_0x231e4f);};var _0x5d9a4a=function(_0x1c22c2){if(!_0x1c22c2||!_0x1c22c2[_0xd953('0x66')][_0xd953('0x67')]){return'';}for(var _0x32d7ba='(',_0x426797=0x0;_0x426797<_0x1c22c2[_0xd953('0x66')]['length'];_0x426797+=0x1){_0x426797>0x0&&(_0x32d7ba+='\x20'+_0x1c22c2[_0xd953('0x68')]+'\x20');_0x32d7ba+=_0x1c22c2[_0xd953('0x66')][_0x426797]['group']?_0x5d9a4a(_0x1c22c2['rules'][_0x426797][_0xd953('0x69')]):_0x1c22c2[_0xd953('0x66')][_0x426797]['field']+'\x20'+_0x1c22c2['rules'][_0x426797]['condition']+(_0x3b89b7(_0x1c22c2['rules'][_0x426797][_0xd953('0x6b')])?'\x20'+_0x1c22c2[_0xd953('0x66')][_0x426797]['value']:'');}return _0x32d7ba+')';};var _0x172fad={'where':{'id':_0x1f4912['id']}},_0x2acae2,_0x5abab6,_0x21a785,_0x106ab3,_0xad7aec;_0x172fad=_['merge']({},_0x172fad,_0x2eacfc);return db[_0xd953('0x2c')]['find'](_0x172fad)[_0xd953('0x25')](function(_0x559242){if(_0x559242){_0x2acae2=_0x559242;return _0x559242['getFields']();}return null;})['then'](function(_0x5036f0){if(_0x5036f0){if(!_0x5036f0['length']){throw new db[(_0xd953('0x6d'))][(_0xd953('0x6e'))](_0xd953('0x6f'),0x193);}_0x5abab6=_0x5036f0;return db['AnalyticMetric'][_0xd953('0x71')]({'raw':!![]});}return null;})[_0xd953('0x25')](function(_0x45f503){if(_0x45f503){_0x21a785=_[_0xd953('0x72')](_0x45f503,'id');var _0x3280f0;var _0x1eace6=squel['select']();_0x1eace6[_0xd953('0x8d')](_0x2acae2[_0xd953('0x73')]);for(var _0x4430ff=0x0;_0x4430ff<_0x5abab6[_0xd953('0x67')];_0x4430ff+=0x1){_0x3280f0=_0x5abab6[_0x4430ff][_0xd953('0x74')]?_0x21a785[_0x5abab6[_0x4430ff][_0xd953('0x74')]]['metric']:_0x5abab6[_0x4430ff][_0xd953('0x6a')];_0x3280f0=_0x5abab6[_0x4430ff]['function']?_['replace'](_0x193513[_0x5abab6[_0x4430ff]['function']],'%s',_0x3280f0):_0x3280f0;_0x3280f0=_0x5abab6[_0x4430ff][_0xd953('0x77')]?_[_0xd953('0x78')](_0x7057e0[_0x5abab6[_0x4430ff][_0xd953('0x77')]],'%s',_0x3280f0):_0x3280f0;if(_0x5abab6[_0x4430ff][_0xd953('0x79')]){_0x1eace6[_0xd953('0x69')](_0x3280f0);}_0x5abab6[_0x4430ff]['orderBy']&&_0x1eace6['order'](_0x3280f0,_0x5abab6[_0x4430ff][_0xd953('0x7a')]==='DESC'?![]:!![]);_0x1eace6['field'](_0x3280f0,_0x5abab6[_0x4430ff][_0xd953('0x7c')]||_0x3280f0);}if(_0x2acae2['joins']){_0x2acae2[_0xd953('0x7d')]=JSON[_0xd953('0x7e')](_0x2acae2['joins']);for(var _0x3be497=0x0;_0x3be497<_0x2acae2[_0xd953('0x7d')]['length'];_0x3be497+=0x1){if(_0x2acae2['joins'][_0x3be497][_0xd953('0x2e')]&&_[_0xd953('0x61')](_0x37321e,_0x2acae2['joins'][_0x3be497][_0xd953('0x2e')])&&_0x2acae2[_0xd953('0x7d')][_0x3be497][_0xd953('0x7f')]&&_0x2acae2[_0xd953('0x7d')][_0x3be497][_0xd953('0x80')]&&_0x2acae2[_0xd953('0x7d')][_0x3be497][_0xd953('0x82')]){_0x1eace6[_0x2acae2[_0xd953('0x7d')][_0x3be497][_0xd953('0x2e')]](_0x2acae2['joins'][_0x3be497][_0xd953('0x80')],null,util[_0xd953('0x77')](_0xd953('0x81'),_0x2acae2[_0xd953('0x73')],_0x2acae2[_0xd953('0x7d')][_0x3be497][_0xd953('0x7f')],_0x2acae2['joins'][_0x3be497][_0xd953('0x80')],_0x2acae2[_0xd953('0x7d')][_0x3be497]['foreignKey']));}}}if(_0x2acae2[_0xd953('0x83')]){_0x2acae2['conditions']=JSON['parse'](_0x2acae2[_0xd953('0x83')]);_0x1eace6[_0xd953('0x3f')](_0x5d9a4a(_0x2acae2[_0xd953('0x83')][_0xd953('0x69')]));}_0xad7aec=_0x1eace6[_0xd953('0x84')]();_0x1eace6[_0xd953('0x1b')](_0x472ed6);_0x1eace6[_0xd953('0x3a')](0x0);return;}})[_0xd953('0x25')](function(){if(_0x3e9722['output']===_0xd953('0x8e')){return null;}var _0x537945=_[_0xd953('0x3e')](_0x3e9722,{'name':_0x3e9722[_0xd953('0x8f')]||_0x3e9722[_0xd953('0x2a')]||_0x2acae2['name'],'basename':_0x377341,'savename':util[_0xd953('0x77')]('%s-%s.%s',_0x3e9722['name']||_0x2acae2[_0xd953('0x2a')],require(_0xd953('0x90'))[_0xd953('0x91')](0x4),_0x3e9722[_0xd953('0x92')]||_0xd953('0x93')),'reportId':_0x2acae2['id'],'reportType':_0xd953('0x94')});return db[_0xd953('0x95')]['create'](_0x537945,{'raw':!![]});})[_0xd953('0x25')](function(_0x20f566){if(_0x2acae2['table']==='cdr'){_0xad7aec[_0xd953('0x3f')](_0x2acae2[_0xd953('0x73')]+_0xd953('0x96'),_0x3e9722['startDate'],_0x3e9722[_0xd953('0x97')]);}else{_0xad7aec[_0xd953('0x3f')](_0x2acae2[_0xd953('0x73')]+_0xd953('0x98'),_0x3e9722[_0xd953('0x99')],_0x3e9722[_0xd953('0x97')]);}if(_0x20f566){logger['info']('Run\x20Query:',_0xad7aec[_0xd953('0x9a')]());require(_0xd953('0x9b'))[_0xd953('0x9c')](path[_0xd953('0x89')](__dirname,'../../components/export/',_0x20f566['output']),[_0x20f566['id'],_0xad7aec[_0xd953('0x9a')](),path[_0xd953('0x89')](__dirname,'../../files/reports',_0x20f566[_0xd953('0x9d')]),_0x377341]);return _0x20f566;}else{var _0x543034=squel[_0xd953('0x9e')]();_0x543034[_0xd953('0x8d')]('('+_0xad7aec[_0xd953('0x9a')]()+')','countTable');_0x543034[_0xd953('0x6a')]('COUNT(*)',_0xd953('0x1c'));_0xad7aec[_0xd953('0x1b')](_0x3e9722[_0xd953('0x1b')]||_0x472ed6);_0xad7aec[_0xd953('0x3a')](_0x3e9722[_0xd953('0x3a')]||0x0);return dbH[_0xd953('0x86')][_0xd953('0x32')](_0x543034[_0xd953('0x9a')](),{'type':dbH[_0xd953('0x86')][_0xd953('0x87')][_0xd953('0x88')]})[_0xd953('0x25')](function(_0x31beb1){if(!_0x31beb1[_0xd953('0x67')]){_0x106ab3=0x0;}else{_0x106ab3=_0x31beb1[0x0][_0xd953('0x1c')]||0x0;}return dbH['sequelize']['query'](_0xad7aec['toString'](),{'type':dbH[_0xd953('0x86')]['QueryTypes'][_0xd953('0x88')]});})[_0xd953('0x25')](function(_0x4c5322){return{'rows':_0x4c5322||[],'count':_0x106ab3};});}});}exports[_0xd953('0x9f')]=function(_0x2cc06e,_0x5eedd1){return runReport(_0x2cc06e['params'],_0x2cc06e[_0xd953('0x32')],_0x2cc06e[_0xd953('0x47')])[_0xd953('0x25')](respondWithResult(_0x5eedd1,null))[_0xd953('0x44')](handleError(_0x5eedd1,null));};exports[_0xd953('0xa0')]=runReport;exports[_0xd953('0x32')]=function(_0x36db70,_0x55b3c6){var _0x421d10=0xa;var _0x33dda0=[_0xd953('0x89'),'left_join','right_join',_0xd953('0x55')];var _0x3477e8={'SUM':'SUM(%s)','COUNT':_0xd953('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd953('0x8b'),'MIN':_0xd953('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd953('0x5a'),'GROUP_CONCAT ASC':_0xd953('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x14a82e={'SEC_TO_TIME':_0xd953('0x5d'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd953('0x5f'),'UNIX_TIMESTAMP':_0xd953('0x60')};var _0x283052=function(_0x54e3ac){return!_['includes']([_0xd953('0x62'),'IS\x20NOT\x20NULL',_0xd953('0x64'),_0xd953('0x65')],_0x54e3ac);};var _0x179645=function(_0x24a24f){if(!_0x24a24f||!_0x24a24f[_0xd953('0x66')][_0xd953('0x67')]){return'';}for(var _0x46b93b='(',_0x1870b2=0x0;_0x1870b2<_0x24a24f['rules'][_0xd953('0x67')];_0x1870b2+=0x1){_0x1870b2>0x0&&(_0x46b93b+='\x20'+_0x24a24f[_0xd953('0x68')]+'\x20');_0x46b93b+=_0x24a24f[_0xd953('0x66')][_0x1870b2][_0xd953('0x69')]?_0x179645(_0x24a24f[_0xd953('0x66')][_0x1870b2][_0xd953('0x69')]):_0x24a24f[_0xd953('0x66')][_0x1870b2][_0xd953('0x6a')]+'\x20'+_0x24a24f[_0xd953('0x66')][_0x1870b2][_0xd953('0x6b')]+(_0x283052(_0x24a24f[_0xd953('0x66')][_0x1870b2][_0xd953('0x6b')])?'\x20'+_0x24a24f['rules'][_0x1870b2]['value']:'');}return _0x46b93b+')';};var _0x383830={'where':{'id':_0x36db70['params']['id']}},_0x658c89,_0x422904,_0x1482a5,_0x30cd75,_0x4b24ff;_0x383830=_[_0xd953('0x3e')]({},_0x383830,_0x36db70[_0xd953('0x47')]);return db[_0xd953('0x2c')][_0xd953('0x4d')](_0x383830)[_0xd953('0x25')](function(_0x4195c7){if(_0x4195c7){_0x658c89=_0x4195c7;return _0x4195c7['getFields']();}return null;})['then'](function(_0xf02777){if(_0xf02777){if(!_0xf02777[_0xd953('0x67')]){throw new db['Sequelize'][(_0xd953('0x6e'))](_0xd953('0x6f'),0x193);}_0x422904=_0xf02777;return db[_0xd953('0x70')][_0xd953('0x71')]({'raw':!![]});}return null;})[_0xd953('0x25')](function(_0x5ddc82){if(_0x5ddc82){_0x1482a5=_[_0xd953('0x72')](_0x5ddc82,'id');var _0x4d688e;var _0x58d3b2=squel[_0xd953('0x9e')]();_0x58d3b2['from'](_0x658c89[_0xd953('0x73')]);for(var _0x142b9c=0x0;_0x142b9c<_0x422904['length'];_0x142b9c+=0x1){_0x4d688e=_0x422904[_0x142b9c][_0xd953('0x74')]?_0x1482a5[_0x422904[_0x142b9c][_0xd953('0x74')]][_0xd953('0x75')]:_0x422904[_0x142b9c][_0xd953('0x6a')];_0x4d688e=_0x422904[_0x142b9c][_0xd953('0x76')]?_[_0xd953('0x78')](_0x3477e8[_0x422904[_0x142b9c][_0xd953('0x76')]],'%s',_0x4d688e):_0x4d688e;_0x4d688e=_0x422904[_0x142b9c]['format']?_[_0xd953('0x78')](_0x14a82e[_0x422904[_0x142b9c][_0xd953('0x77')]],'%s',_0x4d688e):_0x4d688e;if(_0x422904[_0x142b9c]['groupBy']){_0x58d3b2['group'](_0x4d688e);}_0x422904[_0x142b9c][_0xd953('0x7a')]&&_0x58d3b2[_0xd953('0xa1')](_0x4d688e,_0x422904[_0x142b9c]['orderBy']==='DESC'?![]:!![]);_0x58d3b2[_0xd953('0x6a')](_0x4d688e,_0x422904[_0x142b9c][_0xd953('0x7c')]||_0x4d688e);}if(_0x658c89[_0xd953('0x7d')]){_0x658c89[_0xd953('0x7d')]=JSON['parse'](_0x658c89[_0xd953('0x7d')]);for(var _0x4b6589=0x0;_0x4b6589<_0x658c89[_0xd953('0x7d')]['length'];_0x4b6589+=0x1){if(_0x658c89[_0xd953('0x7d')][_0x4b6589][_0xd953('0x2e')]&&_['includes'](_0x33dda0,_0x658c89[_0xd953('0x7d')][_0x4b6589][_0xd953('0x2e')])&&_0x658c89[_0xd953('0x7d')][_0x4b6589]['parentKey']&&_0x658c89['joins'][_0x4b6589][_0xd953('0x80')]&&_0x658c89[_0xd953('0x7d')][_0x4b6589][_0xd953('0x82')]){_0x58d3b2[_0x658c89['joins'][_0x4b6589][_0xd953('0x2e')]](_0x658c89[_0xd953('0x7d')][_0x4b6589][_0xd953('0x80')],null,util[_0xd953('0x77')](_0xd953('0x81'),_0x658c89['table'],_0x658c89[_0xd953('0x7d')][_0x4b6589][_0xd953('0x7f')],_0x658c89[_0xd953('0x7d')][_0x4b6589][_0xd953('0x80')],_0x658c89[_0xd953('0x7d')][_0x4b6589][_0xd953('0x82')]));}}}if(_0x658c89[_0xd953('0x83')]){_0x658c89[_0xd953('0x83')]=JSON['parse'](_0x658c89[_0xd953('0x83')]);_0x58d3b2[_0xd953('0x3f')](_0x179645(_0x658c89['conditions']['group']));}_0x4b24ff=_0x58d3b2[_0xd953('0x84')]();_0x58d3b2[_0xd953('0x1b')](_0x421d10);_0x58d3b2[_0xd953('0x3a')](0x0);logger['debug'](_0xd953('0xa2'),_0x58d3b2[_0xd953('0x9a')]());return dbH[_0xd953('0x86')][_0xd953('0x32')](_0x58d3b2[_0xd953('0x9a')](),{'type':dbH[_0xd953('0x86')][_0xd953('0x87')]['SELECT']});}})[_0xd953('0x25')](function(){return{'sql':_0x4b24ff[_0xd953('0x9a')]()};})[_0xd953('0x25')](respondWithResult(_0x55b3c6,null))[_0xd953('0x44')](handleError(_0x55b3c6,null));};
\ No newline at end of file
index 72c397d..a14b855 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6dac=['../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x9b767e,_0x15989e){var _0x7785d9=function(_0x24e85b){while(--_0x24e85b){_0x9b767e['push'](_0x9b767e['shift']());}};_0x7785d9(++_0x15989e);}(_0x6dac,0x16e));var _0xc6da=function(_0x223f7f,_0x5bf071){_0x223f7f=_0x223f7f-0x0;var _0x55497b=_0x6dac[_0x223f7f];return _0x55497b;};'use strict';var _=require(_0xc6da('0x0'));var util=require(_0xc6da('0x1'));var logger=require(_0xc6da('0x2'))(_0xc6da('0x3'));var moment=require(_0xc6da('0x4'));var BPromise=require(_0xc6da('0x5'));var rp=require(_0xc6da('0x6'));var fs=require('fs');var path=require(_0xc6da('0x7'));var rimraf=require(_0xc6da('0x8'));var config=require(_0xc6da('0x9'));var attributes=require(_0xc6da('0xa'));module[_0xc6da('0xb')]=function(_0x325f49,_0x5caf49){return _0x325f49[_0xc6da('0xc')](_0xc6da('0xd'),attributes,{'tableName':_0xc6da('0xe'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x94be=['request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird'];(function(_0xe01fb6,_0x3886fa){var _0x3db03f=function(_0x5a2ef0){while(--_0x5a2ef0){_0xe01fb6['push'](_0xe01fb6['shift']());}};_0x3db03f(++_0x3886fa);}(_0x94be,0x1c3));var _0xe94b=function(_0x3c70b8,_0x5402d2){_0x3c70b8=_0x3c70b8-0x0;var _0x47e68d=_0x94be[_0x3c70b8];return _0x47e68d;};'use strict';var _=require(_0xe94b('0x0'));var util=require('util');var logger=require(_0xe94b('0x1'))(_0xe94b('0x2'));var moment=require(_0xe94b('0x3'));var BPromise=require(_0xe94b('0x4'));var rp=require(_0xe94b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe94b('0x6'));var config=require(_0xe94b('0x7'));var attributes=require(_0xe94b('0x8'));module[_0xe94b('0x9')]=function(_0x105cb4,_0x603005){return _0x105cb4['define'](_0xe94b('0xa'),attributes,{'tableName':_0xe94b('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 321be53..8f48f02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0240=['request','then','info','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x31c02e,_0x1541f6){var _0xdd636e=function(_0x57edd4){while(--_0x57edd4){_0x31c02e['push'](_0x31c02e['shift']());}};_0xdd636e(++_0x1541f6);}(_0x0240,0x6a));var _0x0024=function(_0x5938b7,_0x3b2236){_0x5938b7=_0x5938b7-0x0;var _0x13194f=_0x0240[_0x5938b7];return _0x13194f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0024('0x0'));var BPromise=require('bluebird');var rs=require(_0x0024('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0024('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x0024('0x3'))(_0x0024('0x4'));var config=require(_0x0024('0x5'));var jayson=require(_0x0024('0x6'));var client=jayson['client'][_0x0024('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x505c94,_0x302399,_0x1cd55e){return new BPromise(function(_0x287952,_0x5398c9){return client[_0x0024('0x8')](_0x505c94,_0x1cd55e)[_0x0024('0x9')](function(_0x3f390e){logger[_0x0024('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x302399,_0x0024('0xb'));logger['debug'](_0x0024('0xc'),_0x302399,_0x0024('0xb'),JSON['stringify'](_0x3f390e));if(_0x3f390e[_0x0024('0xd')]){if(_0x3f390e[_0x0024('0xd')][_0x0024('0xe')]===0x1f4){logger[_0x0024('0xd')](_0x0024('0xf'),_0x302399,_0x3f390e[_0x0024('0xd')][_0x0024('0x10')]);return _0x5398c9(_0x3f390e[_0x0024('0xd')]['message']);}logger[_0x0024('0xd')](_0x0024('0xf'),_0x302399,_0x3f390e[_0x0024('0xd')][_0x0024('0x10')]);return _0x287952(_0x3f390e[_0x0024('0xd')][_0x0024('0x10')]);}else{logger[_0x0024('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x302399,'request\x20sent');_0x287952(_0x3f390e[_0x0024('0x11')][_0x0024('0x10')]);}})[_0x0024('0x12')](function(_0x5da09b){logger['error'](_0x0024('0xf'),_0x302399,_0x5da09b);_0x5398c9(_0x5da09b);});});}
\ No newline at end of file
+var _0xad96=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x1018f7,_0x39a3a3){var _0x4e9284=function(_0x1cd405){while(--_0x1cd405){_0x1018f7['push'](_0x1018f7['shift']());}};_0x4e9284(++_0x39a3a3);}(_0xad96,0x193));var _0x6ad9=function(_0xf65238,_0x59edab){_0xf65238=_0xf65238-0x0;var _0x2e8975=_0xad96[_0xf65238];return _0x2e8975;};'use strict';var _=require(_0x6ad9('0x0'));var util=require(_0x6ad9('0x1'));var moment=require(_0x6ad9('0x2'));var BPromise=require(_0x6ad9('0x3'));var rs=require(_0x6ad9('0x4'));var fs=require('fs');var Redis=require(_0x6ad9('0x5'));var db=require(_0x6ad9('0x6'))['db'];var utils=require(_0x6ad9('0x7'));var logger=require(_0x6ad9('0x8'))(_0x6ad9('0x9'));var config=require(_0x6ad9('0xa'));var jayson=require(_0x6ad9('0xb'));var client=jayson[_0x6ad9('0xc')][_0x6ad9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x75e492,_0x1d4314,_0x52fde7){return new BPromise(function(_0x4678a3,_0x69b288){return client[_0x6ad9('0xe')](_0x75e492,_0x52fde7)[_0x6ad9('0xf')](function(_0x533cc4){logger[_0x6ad9('0x10')](_0x6ad9('0x11'),_0x1d4314,_0x6ad9('0x12'));logger[_0x6ad9('0x13')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x1d4314,_0x6ad9('0x12'),JSON['stringify'](_0x533cc4));if(_0x533cc4[_0x6ad9('0x14')]){if(_0x533cc4['error'][_0x6ad9('0x15')]===0x1f4){logger['error'](_0x6ad9('0x11'),_0x1d4314,_0x533cc4['error'][_0x6ad9('0x16')]);return _0x69b288(_0x533cc4['error'][_0x6ad9('0x16')]);}logger[_0x6ad9('0x14')](_0x6ad9('0x11'),_0x1d4314,_0x533cc4[_0x6ad9('0x14')][_0x6ad9('0x16')]);return _0x4678a3(_0x533cc4[_0x6ad9('0x14')]['message']);}else{logger[_0x6ad9('0x10')](_0x6ad9('0x11'),_0x1d4314,_0x6ad9('0x12'));_0x4678a3(_0x533cc4[_0x6ad9('0x17')][_0x6ad9('0x16')]);}})[_0x6ad9('0x18')](function(_0x1c15e5){logger['error'](_0x6ad9('0x11'),_0x1d4314,_0x1c15e5);_0x69b288(_0x1c15e5);});});}
\ No newline at end of file
index e8b0b09..4fe02d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa986=['../../components/auth/service','./analyticCustomReport.controller','isAuthenticated','index','show','get','preview','/:id/run','run','/:id/query','create','update','exports','util','path','connect-timeout','fs-extra'];(function(_0x3654ea,_0x367b4b){var _0x2d7d66=function(_0x52a064){while(--_0x52a064){_0x3654ea['push'](_0x3654ea['shift']());}};_0x2d7d66(++_0x367b4b);}(_0xa986,0xea));var _0x6a98=function(_0x35ea1f,_0x1ff72d){_0x35ea1f=_0x35ea1f-0x0;var _0x380218=_0xa986[_0x35ea1f];return _0x380218;};'use strict';var multer=require('multer');var util=require(_0x6a98('0x0'));var path=require(_0x6a98('0x1'));var timeout=require(_0x6a98('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6a98('0x3'));var auth=require(_0x6a98('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6a98('0x5'));router['get']('/',auth[_0x6a98('0x6')](),controller[_0x6a98('0x7')]);router['get']('/:id',auth[_0x6a98('0x6')](),controller[_0x6a98('0x8')]);router[_0x6a98('0x9')]('/:id/preview',auth[_0x6a98('0x6')](),controller[_0x6a98('0xa')]);router[_0x6a98('0x9')](_0x6a98('0xb'),auth[_0x6a98('0x6')](),controller[_0x6a98('0xc')]);router[_0x6a98('0x9')](_0x6a98('0xd'),auth['isAuthenticated'](),controller['query']);router['post']('/',auth['isAuthenticated'](),controller[_0x6a98('0xe')]);router['put']('/:id',auth[_0x6a98('0x6')](),controller[_0x6a98('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6a98('0x10')]=router;
\ No newline at end of file
+var _0xa59f=['preview','/:id/run','run','query','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview'];(function(_0x113685,_0x57c8dc){var _0x324ad8=function(_0x3e4eeb){while(--_0x3e4eeb){_0x113685['push'](_0x113685['shift']());}};_0x324ad8(++_0x57c8dc);}(_0xa59f,0xf5));var _0xfa59=function(_0xabfbae,_0x4cfda7){_0xabfbae=_0xabfbae-0x0;var _0xd99f19=_0xa59f[_0xabfbae];return _0xd99f19;};'use strict';var multer=require(_0xfa59('0x0'));var util=require(_0xfa59('0x1'));var path=require(_0xfa59('0x2'));var timeout=require(_0xfa59('0x3'));var express=require(_0xfa59('0x4'));var router=express[_0xfa59('0x5')]();var fs_extra=require(_0xfa59('0x6'));var auth=require(_0xfa59('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xfa59('0x8'));var controller=require(_0xfa59('0x9'));router[_0xfa59('0xa')]('/',auth[_0xfa59('0xb')](),controller[_0xfa59('0xc')]);router[_0xfa59('0xa')]('/:id',auth[_0xfa59('0xb')](),controller[_0xfa59('0xd')]);router[_0xfa59('0xa')](_0xfa59('0xe'),auth['isAuthenticated'](),controller[_0xfa59('0xf')]);router[_0xfa59('0xa')](_0xfa59('0x10'),auth[_0xfa59('0xb')](),controller[_0xfa59('0x11')]);router[_0xfa59('0xa')]('/:id/query',auth[_0xfa59('0xb')](),controller[_0xfa59('0x12')]);router[_0xfa59('0x13')]('/',auth[_0xfa59('0xb')](),controller[_0xfa59('0x14')]);router[_0xfa59('0x15')](_0xfa59('0x16'),auth[_0xfa59('0xb')](),controller[_0xfa59('0x17')]);router[_0xfa59('0x18')](_0xfa59('0x16'),auth[_0xfa59('0xb')](),controller['destroy']);module[_0xfa59('0x19')]=router;
\ No newline at end of file
index 5053b31..13f4e36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee14=['STRING','TEXT'];(function(_0x11f2f6,_0x4b776d){var _0x50b13e=function(_0x309862){while(--_0x309862){_0x11f2f6['push'](_0x11f2f6['shift']());}};_0x50b13e(++_0x4b776d);}(_0xee14,0x13a));var _0x4ee1=function(_0x43f892,_0x1d3e7a){_0x43f892=_0x43f892-0x0;var _0x5d8744=_0xee14[_0x43f892];return _0x5d8744;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}};
\ No newline at end of file
+var _0x2675=['sequelize','STRING','TEXT'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x2675,0x75));var _0x5267=function(_0x4e83f5,_0x503410){_0x4e83f5=_0x4e83f5-0x0;var _0x51e2c5=_0x2675[_0x4e83f5];return _0x51e2c5;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
index dfb8007..550922c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','from','function','order','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','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','run','params','runReport','AVG(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','query','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone'];(function(_0x44d993,_0x5df3f7){var _0x135836=function(_0xc53e40){while(--_0xc53e40){_0x44d993['push'](_0x44d993['shift']());}};_0x135836(++_0x5df3f7);}(_0x5fab,0x177));var _0xb5fa=function(_0x165c96,_0x2269de){_0x165c96=_0x165c96-0x0;var _0x5c2420=_0x5fab[_0x165c96];return _0x5c2420;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];var dbH=require('../../mysqldb')[_0xb5fa('0x1a')];function respondWithStatusCode(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xcc;return function(_0x116849){if(_0x116849){return _0x3dad4d['sendStatus'](_0x56e8b0);}return _0x3dad4d[_0xb5fa('0x1b')](_0x56e8b0)[_0xb5fa('0x1c')]();};}function respondWithResult(_0x40c914,_0xca8d82){_0xca8d82=_0xca8d82||0xc8;return function(_0x8e9d1c){if(_0x8e9d1c){return _0x40c914['status'](_0xca8d82)['json'](_0x8e9d1c);}};}function respondWithFilteredResult(_0x38e964,_0x587043){return function(_0x31f252){if(_0x31f252){var _0x27c8f7=typeof _0x587043['offset']==='undefined'&&typeof _0x587043[_0xb5fa('0x1d')]===_0xb5fa('0x1e');var _0x32e9e5=_0x31f252[_0xb5fa('0x1f')];var _0x324ba5=_0x27c8f7?0x0:_0x587043[_0xb5fa('0x20')];var _0x3b0f69=_0x27c8f7?_0x31f252[_0xb5fa('0x1f')]:_0x587043[_0xb5fa('0x20')]+_0x587043[_0xb5fa('0x1d')];var _0x3c8d53;if(_0x3b0f69>=_0x32e9e5){_0x3b0f69=_0x32e9e5;_0x3c8d53=0xc8;}else{_0x3c8d53=0xce;}_0x38e964[_0xb5fa('0x1b')](_0x3c8d53);return _0x38e964['set'](_0xb5fa('0x21'),_0x324ba5+'-'+_0x3b0f69+'/'+_0x32e9e5)['json'](_0x31f252);}return null;};}function patchUpdates(_0x37ae06){return function(_0x4a6c04){try{jsonpatch[_0xb5fa('0x22')](_0x4a6c04,_0x37ae06,!![]);}catch(_0x43c09f){return BPromise['reject'](_0x43c09f);}return _0x4a6c04[_0xb5fa('0x23')]();};}function saveUpdates(_0x3a2ab9,_0x283a56){return function(_0x47f71a){if(_0x47f71a){return _0x47f71a[_0xb5fa('0x24')](_0x3a2ab9)[_0xb5fa('0x25')](function(_0x444237){return _0x444237;});}return null;};}function removeEntity(_0x542348,_0x224ec8){return function(_0x5d55f7){if(_0x5d55f7){return _0x5d55f7[_0xb5fa('0x26')]()[_0xb5fa('0x25')](function(){var _0x11053a=_0x5d55f7[_0xb5fa('0x27')]({'plain':!![]});var _0x2dbd22=_0xb5fa('0x28');return db[_0xb5fa('0x29')][_0xb5fa('0x26')]({'where':{'type':_0x2dbd22,'resourceId':_0x11053a['id']}})['then'](function(){return _0x5d55f7;});})['then'](function(){_0x542348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a350,_0x460b54){return function(_0x12c0d4){if(!_0x12c0d4){_0x28a350[_0xb5fa('0x2a')](0x194);}return _0x12c0d4;};}function handleError(_0x534884,_0x3506a4){_0x3506a4=_0x3506a4||0x1f4;return function(_0x358549){logger[_0xb5fa('0x2b')](_0x358549[_0xb5fa('0x2c')]);if(_0x358549[_0xb5fa('0x2d')]){delete _0x358549[_0xb5fa('0x2d')];}_0x534884[_0xb5fa('0x1b')](_0x3506a4)[_0xb5fa('0x2e')](_0x358549);};}exports[_0xb5fa('0x2f')]=function(_0xed02e,_0x116773){var _0x5a0152={},_0x3fd1fb={},_0x21fc7e={'count':0x0,'rows':[]};var _0x319c48=_[_0xb5fa('0x30')](db[_0xb5fa('0x31')][_0xb5fa('0x32')],function(_0x25fc7c){return{'name':_0x25fc7c['fieldName'],'type':_0x25fc7c[_0xb5fa('0x33')]['key']};});_0x3fd1fb['model']=_['map'](_0x319c48,_0xb5fa('0x2d'));_0x3fd1fb['query']=_[_0xb5fa('0x34')](_0xed02e['query']);_0x3fd1fb['filters']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],_0x3fd1fb['query']);_0x5a0152['attributes']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0xed02e['query'][_0xb5fa('0x37')]));_0x5a0152[_0xb5fa('0x38')]=_0x5a0152['attributes'][_0xb5fa('0x39')]?_0x5a0152[_0xb5fa('0x38')]:_0x3fd1fb[_0xb5fa('0x36')];if(!_0xed02e['query'][_0xb5fa('0x3a')](_0xb5fa('0x3b'))){_0x5a0152[_0xb5fa('0x1d')]=qs['limit'](_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x1d')]);_0x5a0152[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0xed02e['query']['offset']);}_0x5a0152['order']=qs['sort'](_0xed02e['query']['sort']);_0x5a0152[_0xb5fa('0x3d')]=qs['filters'](_[_0xb5fa('0x3e')](_0xed02e[_0xb5fa('0x3c')],_0x3fd1fb[_0xb5fa('0x3f')]),_0x319c48);if(_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]){_0x5a0152[_0xb5fa('0x3d')]=_['merge'](_0x5a0152['where'],{'$or':_['map'](_0x319c48,function(_0x534b38){if(_0x534b38['type']!==_0xb5fa('0x41')){var _0x5addd5={};_0x5addd5[_0x534b38['name']]={'$like':'%'+_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]+'%'};return _0x5addd5;}})});}_0x5a0152=_[_0xb5fa('0x42')]({},_0x5a0152,_0xed02e[_0xb5fa('0x43')]);var _0x5bc93f={'where':_0x5a0152[_0xb5fa('0x3d')]};return db[_0xb5fa('0x31')][_0xb5fa('0x1f')](_0x5bc93f)[_0xb5fa('0x25')](function(_0x402a68){_0x21fc7e['count']=_0x402a68;if(_0xed02e[_0xb5fa('0x3c')]['includeAll']){_0x5a0152[_0xb5fa('0x44')]=[{'all':!![]}];}return db[_0xb5fa('0x31')][_0xb5fa('0x45')](_0x5a0152);})[_0xb5fa('0x25')](function(_0x1c706b){_0x21fc7e[_0xb5fa('0x46')]=_0x1c706b;return _0x21fc7e;})[_0xb5fa('0x25')](respondWithFilteredResult(_0x116773,_0x5a0152))[_0xb5fa('0x47')](handleError(_0x116773,null));};exports['show']=function(_0x1c3c2c,_0xc03e44){var _0x59ae64={'raw':!![],'where':{'id':_0x1c3c2c['params']['id']}},_0x293c19={};_0x293c19[_0xb5fa('0x36')]=_[_0xb5fa('0x34')](db['AnalyticDefaultReport']['rawAttributes']);_0x293c19[_0xb5fa('0x3c')]=_[_0xb5fa('0x34')](_0x1c3c2c[_0xb5fa('0x3c')]);_0x293c19[_0xb5fa('0x3f')]=_[_0xb5fa('0x35')](_0x293c19[_0xb5fa('0x36')],_0x293c19[_0xb5fa('0x3c')]);_0x59ae64[_0xb5fa('0x38')]=_['intersection'](_0x293c19[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0x1c3c2c['query'][_0xb5fa('0x37')]));_0x59ae64[_0xb5fa('0x38')]=_0x59ae64[_0xb5fa('0x38')][_0xb5fa('0x39')]?_0x59ae64[_0xb5fa('0x38')]:_0x293c19[_0xb5fa('0x36')];if(_0x1c3c2c[_0xb5fa('0x3c')][_0xb5fa('0x48')]){_0x59ae64[_0xb5fa('0x44')]=[{'all':!![]}];}_0x59ae64=_[_0xb5fa('0x42')]({},_0x59ae64,_0x1c3c2c[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x59ae64)[_0xb5fa('0x25')](handleEntityNotFound(_0xc03e44,null))[_0xb5fa('0x25')](respondWithResult(_0xc03e44,null))[_0xb5fa('0x47')](handleError(_0xc03e44,null));};exports['create']=function(_0x56dceb,_0x46194d){return db['AnalyticDefaultReport'][_0xb5fa('0x4a')](_0x56dceb[_0xb5fa('0x4b')],{})['then'](function(_0x4ef1d0){var _0x2931a7=_0x56dceb[_0xb5fa('0x4c')][_0xb5fa('0x27')]({'plain':!![]});if(!_0x2931a7)throw new Error(_0xb5fa('0x4d'));if(_0x2931a7[_0xb5fa('0x4e')]==='user'){var _0x27a651=_0x4ef1d0['get']({'plain':!![]});var _0x251d36=_0xb5fa('0x4f');return db[_0xb5fa('0x50')]['find']({'where':{'name':_0x251d36,'userProfileId':_0x2931a7[_0xb5fa('0x51')]},'raw':!![]})[_0xb5fa('0x25')](function(_0x4dea87){if(_0x4dea87&&_0x4dea87['autoAssociation']===0x0){return db[_0xb5fa('0x29')][_0xb5fa('0x4a')]({'name':_0x27a651[_0xb5fa('0x2d')],'resourceId':_0x27a651['id'],'type':_0xb5fa('0x28'),'sectionId':_0x4dea87['id']},{})[_0xb5fa('0x25')](function(){return _0x4ef1d0;});}else{return _0x4ef1d0;}})[_0xb5fa('0x47')](function(_0x31c91f){logger[_0xb5fa('0x2b')](_0xb5fa('0x52'),_0x31c91f);throw _0x31c91f;});}return _0x4ef1d0;})[_0xb5fa('0x25')](respondWithResult(_0x46194d,0xc9))[_0xb5fa('0x47')](handleError(_0x46194d,null));};exports[_0xb5fa('0x24')]=function(_0x3ccfd1,_0x2799e7){if(_0x3ccfd1[_0xb5fa('0x4b')]['id']){delete _0x3ccfd1[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x3ccfd1['params']['id']}})[_0xb5fa('0x25')](handleEntityNotFound(_0x2799e7,null))[_0xb5fa('0x25')](saveUpdates(_0x3ccfd1[_0xb5fa('0x4b')],null))[_0xb5fa('0x25')](respondWithResult(_0x2799e7,null))[_0xb5fa('0x47')](handleError(_0x2799e7,null));};exports[_0xb5fa('0x26')]=function(_0x4224cf,_0x24117e){return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x4224cf['params']['id']}})['then'](handleEntityNotFound(_0x24117e,null))[_0xb5fa('0x25')](removeEntity(_0x24117e,null))[_0xb5fa('0x47')](handleError(_0x24117e,null));};exports[_0xb5fa('0x53')]=function(_0x5caf84,_0x441c41){var _0x367f7a=0xa;var _0x1572fb=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x4f82f0={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x2b9a45={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0x1c24e3=function(_0xfb88cc){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0xfb88cc);};var _0x41cce9=function(_0x23fb01){if(!_0x23fb01||!_0x23fb01[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x421a93='(',_0x36fc0f=0x0;_0x36fc0f<_0x23fb01['rules'][_0xb5fa('0x39')];_0x36fc0f+=0x1){_0x36fc0f>0x0&&(_0x421a93+='\x20'+_0x23fb01[_0xb5fa('0x6a')]+'\x20');_0x421a93+=_0x23fb01[_0xb5fa('0x69')][_0x36fc0f]['group']?_0x41cce9(_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6b')]):_0x23fb01['rules'][_0x36fc0f][_0xb5fa('0x6c')]+'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6d')]+(_0x1c24e3(_0x23fb01['rules'][_0x36fc0f]['condition'])?'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6e')]:'');}return _0x421a93+')';};var _0x432f04={'where':{'id':_0x5caf84['params']['id']}},_0x57d8b7,_0x597206,_0x30d53b,_0x199555,_0x12b0a2;_0x432f04=_['merge']({},_0x432f04,_0x5caf84['options']);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x432f04)[_0xb5fa('0x25')](function(_0x4ce1bd){if(_0x4ce1bd){_0x57d8b7=_0x4ce1bd;return _0x4ce1bd[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x13ef3a){if(_0x13ef3a){if(!_0x13ef3a[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x597206=_0x13ef3a;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x3a1db9){if(_0x3a1db9){_0x30d53b=_[_0xb5fa('0x74')](_0x3a1db9,'id');var _0xecdff3;var _0x38faa6=squel[_0xb5fa('0x75')]();_0x38faa6['from'](_0x57d8b7[_0xb5fa('0x76')]);for(var _0x5a6f74=0x0;_0x5a6f74<_0x597206[_0xb5fa('0x39')];_0x5a6f74+=0x1){_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x77')]?_0x30d53b[_0x597206[_0x5a6f74][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x597206[_0x5a6f74][_0xb5fa('0x6c')];_0xecdff3=_0x597206[_0x5a6f74]['function']?_[_0xb5fa('0x79')](_0x4f82f0[_0x597206[_0x5a6f74]['function']],'%s',_0xecdff3):_0xecdff3;_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x2b9a45[_0x597206[_0x5a6f74][_0xb5fa('0x7a')]],'%s',_0xecdff3):_0xecdff3;if(_0x597206[_0x5a6f74][_0xb5fa('0x7b')]){_0x38faa6['group'](_0xecdff3);}_0x597206[_0x5a6f74]['orderBy']&&_0x38faa6['order'](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x38faa6[_0xb5fa('0x6c')](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7e')]||_0xecdff3);}if(_0x57d8b7[_0xb5fa('0x7f')]){_0x57d8b7[_0xb5fa('0x7f')]=JSON['parse'](_0x57d8b7[_0xb5fa('0x7f')]);for(var _0x5c08e1=0x0;_0x5c08e1<_0x57d8b7['joins'][_0xb5fa('0x39')];_0x5c08e1+=0x1){if(_0x57d8b7['joins'][_0x5c08e1]['type']&&_['includes'](_0x1572fb,_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type'])&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')]&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['foreignTable']&&_0x57d8b7['joins'][_0x5c08e1][_0xb5fa('0x81')]){_0x38faa6[_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type']](_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x57d8b7['table'],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x81')]));}}}if(_0x57d8b7[_0xb5fa('0x84')]){_0x57d8b7['conditions']=JSON[_0xb5fa('0x85')](_0x57d8b7['conditions']);_0x38faa6[_0xb5fa('0x3d')](_0x41cce9(_0x57d8b7[_0xb5fa('0x84')]['group']));}_0x12b0a2=_0x38faa6[_0xb5fa('0x86')]();_0x38faa6[_0xb5fa('0x1d')](_0x367f7a);_0x38faa6[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x38faa6[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x38faa6['toString'](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](respondWithResult(_0x441c41,null))['catch'](handleError(_0x441c41,null));};function runReport(_0x593386,_0x47d72b,_0x5557a3){var _0x1c60bd=_0x47d72b[_0xb5fa('0x2d')];var _0xff504d=0xa;var _0x188e66=['join','left_join',_0xb5fa('0x56'),'cross_join'];var _0x32eebd={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':'MAX(%s)','MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6852={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0xa7fd3b=function(_0x42e210){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0x42e210);};var _0x86dfe9=function(_0x53c7b5){if(!_0x53c7b5||!_0x53c7b5['rules'][_0xb5fa('0x39')]){return'';}for(var _0x52384b='(',_0x1cb113=0x0;_0x1cb113<_0x53c7b5[_0xb5fa('0x69')]['length'];_0x1cb113+=0x1){_0x1cb113>0x0&&(_0x52384b+='\x20'+_0x53c7b5[_0xb5fa('0x6a')]+'\x20');_0x52384b+=_0x53c7b5[_0xb5fa('0x69')][_0x1cb113]['group']?_0x86dfe9(_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6b')]):_0x53c7b5['rules'][_0x1cb113][_0xb5fa('0x6c')]+'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6d')]+(_0xa7fd3b(_0x53c7b5['rules'][_0x1cb113]['condition'])?'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6e')]:'');}return _0x52384b+')';};var _0x3b5e1d={'where':{'id':_0x593386['id']}},_0x3d18a9,_0x397830,_0x234d9d,_0x10222c,_0x1eec65;_0x3b5e1d=_[_0xb5fa('0x42')]({},_0x3b5e1d,_0x5557a3);return db[_0xb5fa('0x31')]['find'](_0x3b5e1d)['then'](function(_0x3c5563){if(_0x3c5563){_0x3d18a9=_0x3c5563;return _0x3c5563[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x18498d){if(_0x18498d){if(!_0x18498d['length']){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x397830=_0x18498d;return db['AnalyticMetric'][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x109dd9){if(_0x109dd9){_0x234d9d=_[_0xb5fa('0x74')](_0x109dd9,'id');var _0x5ba2e7;var _0x1175da=squel[_0xb5fa('0x75')]();_0x1175da[_0xb5fa('0x8e')](_0x3d18a9[_0xb5fa('0x76')]);for(var _0x19717a=0x0;_0x19717a<_0x397830[_0xb5fa('0x39')];_0x19717a+=0x1){_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x77')]?_0x234d9d[_0x397830[_0x19717a][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x397830[_0x19717a][_0xb5fa('0x6c')];_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x32eebd[_0x397830[_0x19717a][_0xb5fa('0x8f')]],'%s',_0x5ba2e7):_0x5ba2e7;_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x5e6852[_0x397830[_0x19717a]['format']],'%s',_0x5ba2e7):_0x5ba2e7;if(_0x397830[_0x19717a][_0xb5fa('0x7b')]){_0x1175da[_0xb5fa('0x6b')](_0x5ba2e7);}_0x397830[_0x19717a][_0xb5fa('0x7c')]&&_0x1175da[_0xb5fa('0x90')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x1175da[_0xb5fa('0x6c')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7e')]||_0x5ba2e7);}if(_0x3d18a9['joins']){_0x3d18a9['joins']=JSON[_0xb5fa('0x85')](_0x3d18a9['joins']);for(var _0x5d0ca8=0x0;_0x5d0ca8<_0x3d18a9[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x5d0ca8+=0x1){if(_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['type']&&_[_0xb5fa('0x64')](_0x188e66,_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')])&&_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x80')]&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable']&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x81')]){_0x1175da[_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')]](_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3d18a9[_0xb5fa('0x76')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x80')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable'],_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x81')]));}}}if(_0x3d18a9[_0xb5fa('0x84')]){_0x3d18a9[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3d18a9['conditions']);_0x1175da['where'](_0x86dfe9(_0x3d18a9['conditions']['group']));}_0x1eec65=_0x1175da[_0xb5fa('0x86')]();_0x1175da[_0xb5fa('0x1d')](_0xff504d);_0x1175da[_0xb5fa('0x20')](0x0);return;}})[_0xb5fa('0x25')](function(){if(_0x47d72b[_0xb5fa('0x91')]===_0xb5fa('0x92')){return null;}var _0x3c36a8=_[_0xb5fa('0x42')](_0x47d72b,{'name':_0x47d72b[_0xb5fa('0x93')]||_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9[_0xb5fa('0x2d')],'basename':_0x1c60bd,'savename':util['format'](_0xb5fa('0x94'),_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9['name'],require(_0xb5fa('0x95'))[_0xb5fa('0x96')](0x4),_0x47d72b['output']||_0xb5fa('0x97')),'reportId':_0x3d18a9['id'],'reportType':_0xb5fa('0x98')});return db[_0xb5fa('0x99')][_0xb5fa('0x4a')](_0x3c36a8,{'raw':!![]});})[_0xb5fa('0x25')](function(_0x2b449a){if(_0x3d18a9[_0xb5fa('0x76')]===_0xb5fa('0x9a')){_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9['table']+_0xb5fa('0x9b'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}else{_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9[_0xb5fa('0x76')]+_0xb5fa('0x9e'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}if(_0x2b449a){logger['info'](_0xb5fa('0x9f'),_0x1eec65['toString']());require(_0xb5fa('0xa0'))[_0xb5fa('0xa1')](path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa2'),_0x2b449a[_0xb5fa('0x91')]),[_0x2b449a['id'],_0x1eec65[_0xb5fa('0x89')](),path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa3'),_0x2b449a[_0xb5fa('0xa4')]),_0x1c60bd]);return _0x2b449a;}else{var _0x4bb9b4=squel['select']();_0x4bb9b4[_0xb5fa('0x8e')]('('+_0x1eec65[_0xb5fa('0x89')]()+')',_0xb5fa('0xa5'));_0x4bb9b4[_0xb5fa('0x6c')]('COUNT(*)',_0xb5fa('0x1f'));_0x1eec65['limit'](_0x47d72b[_0xb5fa('0x1d')]||_0xff504d);_0x1eec65[_0xb5fa('0x20')](_0x47d72b['offset']||0x0);return dbH[_0xb5fa('0x8a')]['query'](_0x4bb9b4[_0xb5fa('0x89')](),{'type':dbH['sequelize'][_0xb5fa('0x8b')][_0xb5fa('0x8c')]})[_0xb5fa('0x25')](function(_0x70e4ae){if(!_0x70e4ae[_0xb5fa('0x39')]){_0x10222c=0x0;}else{_0x10222c=_0x70e4ae[0x0][_0xb5fa('0x1f')]||0x0;}return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x1eec65[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')]['SELECT']});})[_0xb5fa('0x25')](function(_0x284b34){return{'rows':_0x284b34||[],'count':_0x10222c};});}});}exports[_0xb5fa('0xa6')]=function(_0x497931,_0x2145d8){return runReport(_0x497931[_0xb5fa('0xa7')],_0x497931[_0xb5fa('0x3c')],_0x497931[_0xb5fa('0x43')])[_0xb5fa('0x25')](respondWithResult(_0x2145d8,null))[_0xb5fa('0x47')](handleError(_0x2145d8,null));};exports[_0xb5fa('0xa8')]=runReport;exports[_0xb5fa('0x3c')]=function(_0x59fd75,_0x245ee1){var _0x5c1e1f=0xa;var _0x3ba723=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x105c0f={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':_0xb5fa('0xa9'),'GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x41e086={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd34c31=function(_0x2e614e){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb5fa('0x67'),_0xb5fa('0x68')],_0x2e614e);};var _0x1aae82=function(_0x474bb){if(!_0x474bb||!_0x474bb[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x17ae50='(',_0x51c9ba=0x0;_0x51c9ba<_0x474bb['rules']['length'];_0x51c9ba+=0x1){_0x51c9ba>0x0&&(_0x17ae50+='\x20'+_0x474bb[_0xb5fa('0x6a')]+'\x20');_0x17ae50+=_0x474bb['rules'][_0x51c9ba]['group']?_0x1aae82(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['group']):_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6c')]+'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6d')]+(_0xd34c31(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['condition'])?'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6e')]:'');}return _0x17ae50+')';};var _0x2fe715={'where':{'id':_0x59fd75[_0xb5fa('0xa7')]['id']}},_0x3c5ac4,_0x23b70f,_0x488818,_0x15b228,_0x42fd84;_0x2fe715=_[_0xb5fa('0x42')]({},_0x2fe715,_0x59fd75[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')]['find'](_0x2fe715)[_0xb5fa('0x25')](function(_0x390043){if(_0x390043){_0x3c5ac4=_0x390043;return _0x390043[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x32c191){if(_0x32c191){if(!_0x32c191[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x23b70f=_0x32c191;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x1d307c){if(_0x1d307c){_0x488818=_[_0xb5fa('0x74')](_0x1d307c,'id');var _0x3347eb;var _0x349e0b=squel[_0xb5fa('0x75')]();_0x349e0b[_0xb5fa('0x8e')](_0x3c5ac4[_0xb5fa('0x76')]);for(var _0x2b1c3f=0x0;_0x2b1c3f<_0x23b70f[_0xb5fa('0x39')];_0x2b1c3f+=0x1){_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x77')]?_0x488818[_0x23b70f[_0x2b1c3f]['MetricId']]['metric']:_0x23b70f[_0x2b1c3f][_0xb5fa('0x6c')];_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x105c0f[_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]],'%s',_0x3347eb):_0x3347eb;_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x41e086[_0x23b70f[_0x2b1c3f]['format']],'%s',_0x3347eb):_0x3347eb;if(_0x23b70f[_0x2b1c3f]['groupBy']){_0x349e0b['group'](_0x3347eb);}_0x23b70f[_0x2b1c3f][_0xb5fa('0x7c')]&&_0x349e0b[_0xb5fa('0x90')](_0x3347eb,_0x23b70f[_0x2b1c3f]['orderBy']===_0xb5fa('0x7d')?![]:!![]);_0x349e0b[_0xb5fa('0x6c')](_0x3347eb,_0x23b70f[_0x2b1c3f]['alias']||_0x3347eb);}if(_0x3c5ac4[_0xb5fa('0x7f')]){_0x3c5ac4[_0xb5fa('0x7f')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x7f')]);for(var _0x10dbdf=0x0;_0x10dbdf<_0x3c5ac4[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x10dbdf+=0x1){if(_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['type']&&_[_0xb5fa('0x64')](_0x3ba723,_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x33')])&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')]&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable']&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x81')]){_0x349e0b[_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x33')]](_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x3c5ac4[_0xb5fa('0x76')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable'],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignKey']));}}}if(_0x3c5ac4[_0xb5fa('0x84')]){_0x3c5ac4[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x84')]);_0x349e0b[_0xb5fa('0x3d')](_0x1aae82(_0x3c5ac4[_0xb5fa('0x84')][_0xb5fa('0x6b')]));}_0x42fd84=_0x349e0b['clone']();_0x349e0b['limit'](_0x5c1e1f);_0x349e0b[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x349e0b[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x349e0b[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')]['QueryTypes'][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](function(){return{'sql':_0x42fd84[_0xb5fa('0x89')]()};})[_0xb5fa('0x25')](respondWithResult(_0x245ee1,null))[_0xb5fa('0x47')](handleError(_0x245ee1,null));};
\ No newline at end of file
+var _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x344dcd,_0x5ed4a2){var _0x4b6c50=function(_0x341361){while(--_0x341361){_0x344dcd['push'](_0x344dcd['shift']());}};_0x4b6c50(++_0x5ed4a2);}(_0x4975,0x86));var _0x5497=function(_0x55fb4e,_0xb66fce){_0x55fb4e=_0x55fb4e-0x0;var _0x410c0b=_0x4975[_0x55fb4e];return _0x410c0b;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));};
\ No newline at end of file
index 2b95442..49c3ea3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x481f=['bluebird','rimraf','exports','AnalyticDefaultReport','analytics_default_reports','lodash','api','moment'];(function(_0x307ecc,_0x168595){var _0x5684aa=function(_0x3243f7){while(--_0x3243f7){_0x307ecc['push'](_0x307ecc['shift']());}};_0x5684aa(++_0x168595);}(_0x481f,0x14d));var _0xf481=function(_0x2e9b8b,_0x4f44c3){_0x2e9b8b=_0x2e9b8b-0x0;var _0x4e0a1d=_0x481f[_0x2e9b8b];return _0x4e0a1d;};'use strict';var _=require(_0xf481('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf481('0x1'));var moment=require(_0xf481('0x2'));var BPromise=require(_0xf481('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf481('0x4'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0xf481('0x5')]=function(_0x291ac3,_0x302a07){return _0x291ac3['define'](_0xf481('0x6'),attributes,{'tableName':_0xf481('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf273=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','AnalyticDefaultReport','lodash','../../config/logger'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf273,0x6c));var _0x3f27=function(_0x23227c,_0x4bec43){_0x23227c=_0x23227c-0x0;var _0x5f59c0=_0xf273[_0x23227c];return _0x5f59c0;};'use strict';var _=require(_0x3f27('0x0'));var util=require('util');var logger=require(_0x3f27('0x1'))(_0x3f27('0x2'));var moment=require(_0x3f27('0x3'));var BPromise=require(_0x3f27('0x4'));var rp=require(_0x3f27('0x5'));var fs=require('fs');var path=require(_0x3f27('0x6'));var rimraf=require('rimraf');var config=require(_0x3f27('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x3f27('0x8')]=function(_0x166c0d,_0x267796){return _0x166c0d[_0x3f27('0x9')](_0x3f27('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4b45b9f..9bb55da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cd9=['jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x5cd6e3,_0x45c17a){var _0x19a431=function(_0x249418){while(--_0x249418){_0x5cd6e3['push'](_0x5cd6e3['shift']());}};_0x19a431(++_0x45c17a);}(_0x5cd9,0x65));var _0x95cd=function(_0x204ad1,_0x53ca97){_0x204ad1=_0x204ad1-0x0;var _0x57050e=_0x5cd9[_0x204ad1];return _0x57050e;};'use strict';var _=require(_0x95cd('0x0'));var util=require(_0x95cd('0x1'));var moment=require(_0x95cd('0x2'));var BPromise=require(_0x95cd('0x3'));var rs=require(_0x95cd('0x4'));var fs=require('fs');var Redis=require(_0x95cd('0x5'));var db=require(_0x95cd('0x6'))['db'];var utils=require(_0x95cd('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x95cd('0x8'));var jayson=require(_0x95cd('0x9'));var client=jayson['client'][_0x95cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e31bc,_0x3aaf0c,_0x28c121){return new BPromise(function(_0xf6d9b7,_0x221e39){return client[_0x95cd('0xb')](_0x3e31bc,_0x28c121)[_0x95cd('0xc')](function(_0x581dee){logger[_0x95cd('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3aaf0c,_0x95cd('0xe'));logger[_0x95cd('0xf')](_0x95cd('0x10'),_0x3aaf0c,'request\x20sent',JSON[_0x95cd('0x11')](_0x581dee));if(_0x581dee[_0x95cd('0x12')]){if(_0x581dee['error'][_0x95cd('0x13')]===0x1f4){logger[_0x95cd('0x12')](_0x95cd('0x14'),_0x3aaf0c,_0x581dee[_0x95cd('0x12')][_0x95cd('0x15')]);return _0x221e39(_0x581dee[_0x95cd('0x12')][_0x95cd('0x15')]);}logger[_0x95cd('0x12')](_0x95cd('0x14'),_0x3aaf0c,_0x581dee[_0x95cd('0x12')][_0x95cd('0x15')]);return _0xf6d9b7(_0x581dee['error'][_0x95cd('0x15')]);}else{logger['info'](_0x95cd('0x14'),_0x3aaf0c,_0x95cd('0xe'));_0xf6d9b7(_0x581dee['result']['message']);}})['catch'](function(_0x5de1c3){logger[_0x95cd('0x12')](_0x95cd('0x14'),_0x3aaf0c,_0x5de1c3);_0x221e39(_0x5de1c3);});});}
\ No newline at end of file
+var _0xff40=['code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4fbffe,_0x4c69d1){var _0x2bbd73=function(_0x6078b4){while(--_0x6078b4){_0x4fbffe['push'](_0x4fbffe['shift']());}};_0x2bbd73(++_0x4c69d1);}(_0xff40,0x97));var _0x0ff4=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xff40[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require(_0x0ff4('0x0'));var util=require(_0x0ff4('0x1'));var moment=require('moment');var BPromise=require(_0x0ff4('0x2'));var rs=require(_0x0ff4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ff4('0x4'))['db'];var utils=require(_0x0ff4('0x5'));var logger=require('../../config/logger')(_0x0ff4('0x6'));var config=require(_0x0ff4('0x7'));var jayson=require(_0x0ff4('0x8'));var client=jayson[_0x0ff4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22128f,_0x169953,_0x21c950){return new BPromise(function(_0x2ddbc4,_0x3ee6d2){return client['request'](_0x22128f,_0x21c950)['then'](function(_0x1d3f69){logger[_0x0ff4('0xa')](_0x0ff4('0xb'),_0x169953,_0x0ff4('0xc'));logger[_0x0ff4('0xd')](_0x0ff4('0xe'),_0x169953,'request\x20sent',JSON[_0x0ff4('0xf')](_0x1d3f69));if(_0x1d3f69[_0x0ff4('0x10')]){if(_0x1d3f69[_0x0ff4('0x10')][_0x0ff4('0x11')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x169953,_0x1d3f69[_0x0ff4('0x10')][_0x0ff4('0x12')]);return _0x3ee6d2(_0x1d3f69[_0x0ff4('0x10')][_0x0ff4('0x12')]);}logger[_0x0ff4('0x10')](_0x0ff4('0xb'),_0x169953,_0x1d3f69[_0x0ff4('0x10')][_0x0ff4('0x12')]);return _0x2ddbc4(_0x1d3f69['error'][_0x0ff4('0x12')]);}else{logger[_0x0ff4('0xa')](_0x0ff4('0xb'),_0x169953,_0x0ff4('0xc'));_0x2ddbc4(_0x1d3f69[_0x0ff4('0x13')][_0x0ff4('0x12')]);}})[_0x0ff4('0x14')](function(_0x1088f0){logger['error'](_0x0ff4('0xb'),_0x169953,_0x1088f0);_0x3ee6d2(_0x1088f0);});});}
\ No newline at end of file
index 07b68a3..8c516bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec90=['show','/:id/preview','preview','/:id/run','run','query','create','put','update','delete','/:id','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index'];(function(_0x15eb16,_0x54df0f){var _0xc35bd=function(_0x252785){while(--_0x252785){_0x15eb16['push'](_0x15eb16['shift']());}};_0xc35bd(++_0x54df0f);}(_0xec90,0x19c));var _0x0ec9=function(_0x28ba9e,_0x1e8204){_0x28ba9e=_0x28ba9e-0x0;var _0x18c3cb=_0xec90[_0x28ba9e];return _0x18c3cb;};'use strict';var multer=require(_0x0ec9('0x0'));var util=require(_0x0ec9('0x1'));var path=require('path');var timeout=require(_0x0ec9('0x2'));var express=require(_0x0ec9('0x3'));var router=express[_0x0ec9('0x4')]();var fs_extra=require(_0x0ec9('0x5'));var auth=require(_0x0ec9('0x6'));var interaction=require(_0x0ec9('0x7'));var config=require(_0x0ec9('0x8'));var controller=require(_0x0ec9('0x9'));router[_0x0ec9('0xa')]('/',auth[_0x0ec9('0xb')](),controller[_0x0ec9('0xc')]);router[_0x0ec9('0xa')]('/:id',auth[_0x0ec9('0xb')](),controller[_0x0ec9('0xd')]);router[_0x0ec9('0xa')](_0x0ec9('0xe'),auth[_0x0ec9('0xb')](),controller[_0x0ec9('0xf')]);router[_0x0ec9('0xa')](_0x0ec9('0x10'),auth[_0x0ec9('0xb')](),controller[_0x0ec9('0x11')]);router[_0x0ec9('0xa')]('/:id/query',auth[_0x0ec9('0xb')](),controller[_0x0ec9('0x12')]);router['post']('/',auth[_0x0ec9('0xb')](),controller[_0x0ec9('0x13')]);router[_0x0ec9('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x0ec9('0x15')]);router[_0x0ec9('0x16')](_0x0ec9('0x17'),auth[_0x0ec9('0xb')](),controller['destroy']);module[_0x0ec9('0x18')]=router;
\ No newline at end of file
+var _0xe7d9=['preview','/:id/run','/:id/query','query','create','put','update','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview'];(function(_0x480455,_0x449bb4){var _0x9105e4=function(_0xd6fdcd){while(--_0xd6fdcd){_0x480455['push'](_0x480455['shift']());}};_0x9105e4(++_0x449bb4);}(_0xe7d9,0xc5));var _0x9e7d=function(_0x538a07,_0x4307c6){_0x538a07=_0x538a07-0x0;var _0x52922b=_0xe7d9[_0x538a07];return _0x52922b;};'use strict';var multer=require('multer');var util=require(_0x9e7d('0x0'));var path=require(_0x9e7d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9e7d('0x2'));var auth=require(_0x9e7d('0x3'));var interaction=require(_0x9e7d('0x4'));var config=require('../../config/environment');var controller=require(_0x9e7d('0x5'));router['get']('/',auth[_0x9e7d('0x6')](),controller[_0x9e7d('0x7')]);router[_0x9e7d('0x8')](_0x9e7d('0x9'),auth[_0x9e7d('0x6')](),controller[_0x9e7d('0xa')]);router[_0x9e7d('0x8')](_0x9e7d('0xb'),auth[_0x9e7d('0x6')](),controller[_0x9e7d('0xc')]);router['get'](_0x9e7d('0xd'),auth[_0x9e7d('0x6')](),controller['run']);router[_0x9e7d('0x8')](_0x9e7d('0xe'),auth['isAuthenticated'](),controller[_0x9e7d('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9e7d('0x10')]);router[_0x9e7d('0x11')](_0x9e7d('0x9'),auth[_0x9e7d('0x6')](),controller[_0x9e7d('0x12')]);router['delete'](_0x9e7d('0x9'),auth[_0x9e7d('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index f72a9ef..6e713b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x470e=['manual','INTEGER','UNSIGNED','STRING','xlsx','csv','DATE','Loading','ENUM'];(function(_0x59f1a5,_0x5b10ad){var _0x464c59=function(_0x3b86ef){while(--_0x3b86ef){_0x59f1a5['push'](_0x59f1a5['shift']());}};_0x464c59(++_0x5b10ad);}(_0x470e,0xe4));var _0xe470=function(_0x1109db,_0x5c6dc7){_0x1109db=_0x1109db-0x0;var _0x27d529=_0x470e[_0x1109db];return _0x27d529;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0xe470('0x0')],'allowNull':![]},'basename':{'type':Sequelize[_0xe470('0x0')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv','pdf',_0xe470('0x1')),'allowNull':![],'defaultValue':_0xe470('0x2')},'savename':{'type':Sequelize[_0xe470('0x0')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe470('0x3')]},'endDate':{'type':Sequelize[_0xe470('0x3')]},'status':{'type':Sequelize[_0xe470('0x0')],'defaultValue':_0xe470('0x4')},'type':{'type':Sequelize[_0xe470('0x5')](_0xe470('0x6'),'scheduled'),'allowNull':![],'defaultValue':_0xe470('0x6')},'reportId':{'type':Sequelize[_0xe470('0x7')](0xb)[_0xe470('0x8')]},'reportType':{'type':Sequelize[_0xe470('0x0')]}};
\ No newline at end of file
+var _0xfa27=['DATE','Loading','scheduled','manual','INTEGER','UNSIGNED','moment','STRING','ENUM','csv','pdf','xlsx'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfa27,0x17a));var _0x7fa2=function(_0x11db66,_0x29dcea){_0x11db66=_0x11db66-0x0;var _0x47966b=_0xfa27[_0x11db66];return _0x47966b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7fa2('0x0'));module['exports']={'name':{'type':Sequelize[_0x7fa2('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x7fa2('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x7fa2('0x2')](_0x7fa2('0x3'),_0x7fa2('0x4'),_0x7fa2('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x7fa2('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x7fa2('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0x7fa2('0x7')},'type':{'type':Sequelize[_0x7fa2('0x2')]('manual',_0x7fa2('0x8')),'allowNull':![],'defaultValue':_0x7fa2('0x9')},'reportId':{'type':Sequelize[_0x7fa2('0xa')](0xb)[_0x7fa2('0xb')]},'reportType':{'type':Sequelize[_0x7fa2('0x1')]}};
\ No newline at end of file
index 9ffdbe8..d34b6fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb5d=['savename','output','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','toLowerCase','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','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','Content-Range','reject','save','update','destroy','then','ExtractedReports','UserProfileResource','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','find','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','download','basename'];(function(_0x29b8c1,_0x20140f){var _0xda1c47=function(_0x2a89d2){while(--_0x2a89d2){_0x29b8c1['push'](_0x29b8c1['shift']());}};_0xda1c47(++_0x20140f);}(_0xdb5d,0x6a));var _0xddb5=function(_0x35a6af,_0x1115f9){_0x35a6af=_0x35a6af-0x0;var _0x1647d4=_0xdb5d[_0x35a6af];return _0x1647d4;};'use strict';var emlformat=require(_0xddb5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xddb5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xddb5('0x2'));var BPromise=require(_0xddb5('0x3'));var Mustache=require(_0xddb5('0x4'));var util=require(_0xddb5('0x5'));var path=require(_0xddb5('0x6'));var sox=require(_0xddb5('0x7'));var csv=require(_0xddb5('0x8'));var ejs=require(_0xddb5('0x9'));var fs=require('fs');var fs_extra=require(_0xddb5('0xa'));var _=require('lodash');var squel=require(_0xddb5('0xb'));var crypto=require(_0xddb5('0xc'));var jsforce=require(_0xddb5('0xd'));var deskjs=require(_0xddb5('0xe'));var toCsv=require(_0xddb5('0x8'));var querystring=require('querystring');var Papa=require(_0xddb5('0xf'));var Redis=require(_0xddb5('0x10'));var authService=require(_0xddb5('0x11'));var qs=require(_0xddb5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddb5('0x13'));var logger=require(_0xddb5('0x14'))(_0xddb5('0x15'));var utils=require('../../config/utils');var config=require(_0xddb5('0x16'));var licenseUtil=require(_0xddb5('0x17'));var db=require(_0xddb5('0x18'))['db'];function respondWithStatusCode(_0x3a3376,_0x100184){_0x100184=_0x100184||0xcc;return function(_0x3171ec){if(_0x3171ec){return _0x3a3376[_0xddb5('0x19')](_0x100184);}return _0x3a3376[_0xddb5('0x1a')](_0x100184)[_0xddb5('0x1b')]();};}function respondWithResult(_0x4b64fb,_0x4af026){_0x4af026=_0x4af026||0xc8;return function(_0x805edc){if(_0x805edc){return _0x4b64fb['status'](_0x4af026)[_0xddb5('0x1c')](_0x805edc);}};}function respondWithFilteredResult(_0x17e7eb,_0x235453){return function(_0x521950){if(_0x521950){var _0x4def7e=typeof _0x235453[_0xddb5('0x1d')]===_0xddb5('0x1e')&&typeof _0x235453[_0xddb5('0x1f')]==='undefined';var _0x21684c=_0x521950['count'];var _0x338752=_0x4def7e?0x0:_0x235453[_0xddb5('0x1d')];var _0x41d789=_0x4def7e?_0x521950['count']:_0x235453[_0xddb5('0x1d')]+_0x235453['limit'];var _0x20f22f;if(_0x41d789>=_0x21684c){_0x41d789=_0x21684c;_0x20f22f=0xc8;}else{_0x20f22f=0xce;}_0x17e7eb[_0xddb5('0x1a')](_0x20f22f);return _0x17e7eb['set'](_0xddb5('0x20'),_0x338752+'-'+_0x41d789+'/'+_0x21684c)['json'](_0x521950);}return null;};}function patchUpdates(_0x4f8c56){return function(_0x35182a){try{jsonpatch['apply'](_0x35182a,_0x4f8c56,!![]);}catch(_0x4a83a9){return BPromise[_0xddb5('0x21')](_0x4a83a9);}return _0x35182a[_0xddb5('0x22')]();};}function saveUpdates(_0x548bb6,_0x11ea22){return function(_0x93d530){if(_0x93d530){return _0x93d530[_0xddb5('0x23')](_0x548bb6)['then'](function(_0x50a6d1){return _0x50a6d1;});}return null;};}function removeEntity(_0x464a3c,_0x5a0cfd){return function(_0x2055a0){if(_0x2055a0){return _0x2055a0[_0xddb5('0x24')]()[_0xddb5('0x25')](function(){var _0x2d563f=_0x2055a0['get']({'plain':!![]});var _0xfd248f=_0xddb5('0x26');return db[_0xddb5('0x27')][_0xddb5('0x24')]({'where':{'type':_0xfd248f,'resourceId':_0x2d563f['id']}})[_0xddb5('0x25')](function(){return _0x2055a0;});})[_0xddb5('0x25')](function(){_0x464a3c[_0xddb5('0x1a')](0xcc)[_0xddb5('0x1b')]();});}};}function handleEntityNotFound(_0x266667,_0x3e8702){return function(_0x2a4e90){if(!_0x2a4e90){_0x266667[_0xddb5('0x19')](0x194);}return _0x2a4e90;};}function handleError(_0x536e51,_0x5f47cb){_0x5f47cb=_0x5f47cb||0x1f4;return function(_0xe1ce80){logger['error'](_0xe1ce80['stack']);if(_0xe1ce80[_0xddb5('0x28')]){delete _0xe1ce80[_0xddb5('0x28')];}_0x536e51[_0xddb5('0x1a')](_0x5f47cb)[_0xddb5('0x29')](_0xe1ce80);};}exports[_0xddb5('0x2a')]=function(_0x3f0d16,_0x220c4f){var _0x2ce1d={},_0x554bcf={},_0x4c4229={'count':0x0,'rows':[]};var _0x296144=_[_0xddb5('0x2b')](db[_0xddb5('0x2c')][_0xddb5('0x2d')],function(_0x11bf14){return{'name':_0x11bf14[_0xddb5('0x2e')],'type':_0x11bf14[_0xddb5('0x2f')][_0xddb5('0x30')]};});_0x554bcf['model']=_[_0xddb5('0x2b')](_0x296144,_0xddb5('0x28'));_0x554bcf[_0xddb5('0x31')]=_[_0xddb5('0x32')](_0x3f0d16['query']);_0x554bcf[_0xddb5('0x33')]=_[_0xddb5('0x34')](_0x554bcf[_0xddb5('0x35')],_0x554bcf[_0xddb5('0x31')]);_0x2ce1d[_0xddb5('0x36')]=_[_0xddb5('0x34')](_0x554bcf[_0xddb5('0x35')],qs['fields'](_0x3f0d16[_0xddb5('0x31')][_0xddb5('0x37')]));_0x2ce1d[_0xddb5('0x36')]=_0x2ce1d[_0xddb5('0x36')]['length']?_0x2ce1d[_0xddb5('0x36')]:_0x554bcf['model'];if(!_0x3f0d16[_0xddb5('0x31')][_0xddb5('0x38')](_0xddb5('0x39'))){_0x2ce1d[_0xddb5('0x1f')]=qs[_0xddb5('0x1f')](_0x3f0d16[_0xddb5('0x31')][_0xddb5('0x1f')]);_0x2ce1d[_0xddb5('0x1d')]=qs[_0xddb5('0x1d')](_0x3f0d16[_0xddb5('0x31')][_0xddb5('0x1d')]);}_0x2ce1d[_0xddb5('0x3a')]=qs[_0xddb5('0x3b')](_0x3f0d16['query'][_0xddb5('0x3b')]);_0x2ce1d[_0xddb5('0x3c')]=qs[_0xddb5('0x33')](_[_0xddb5('0x3d')](_0x3f0d16[_0xddb5('0x31')],_0x554bcf[_0xddb5('0x33')]),_0x296144);if(_0x3f0d16[_0xddb5('0x31')][_0xddb5('0x3e')]){_0x2ce1d['where']=_[_0xddb5('0x3f')](_0x2ce1d[_0xddb5('0x3c')],{'$or':_['map'](_0x296144,function(_0x3931f8){if(_0x3931f8[_0xddb5('0x2f')]!==_0xddb5('0x40')){var _0x3b2d32={};_0x3b2d32[_0x3931f8['name']]={'$like':'%'+_0x3f0d16[_0xddb5('0x31')][_0xddb5('0x3e')]+'%'};return _0x3b2d32;}})});}_0x2ce1d=_[_0xddb5('0x3f')]({},_0x2ce1d,_0x3f0d16[_0xddb5('0x41')]);var _0x560cc4={'where':_0x2ce1d[_0xddb5('0x3c')]};return db[_0xddb5('0x2c')]['count'](_0x560cc4)[_0xddb5('0x25')](function(_0x40ef88){_0x4c4229[_0xddb5('0x42')]=_0x40ef88;if(_0x3f0d16[_0xddb5('0x31')]['includeAll']){_0x2ce1d[_0xddb5('0x43')]=[{'all':!![]}];}return db[_0xddb5('0x2c')][_0xddb5('0x44')](_0x2ce1d);})[_0xddb5('0x25')](function(_0x2f853f){_0x4c4229[_0xddb5('0x45')]=_0x2f853f;return _0x4c4229;})[_0xddb5('0x25')](respondWithFilteredResult(_0x220c4f,_0x2ce1d))[_0xddb5('0x46')](handleError(_0x220c4f,null));};exports[_0xddb5('0x47')]=function(_0x3782a2,_0x253cbf){var _0x111af8={'raw':!![],'where':{'id':_0x3782a2[_0xddb5('0x48')]['id']}},_0x212737={};_0x212737['model']=_[_0xddb5('0x32')](db[_0xddb5('0x2c')][_0xddb5('0x2d')]);_0x212737[_0xddb5('0x31')]=_[_0xddb5('0x32')](_0x3782a2[_0xddb5('0x31')]);_0x212737[_0xddb5('0x33')]=_[_0xddb5('0x34')](_0x212737[_0xddb5('0x35')],_0x212737[_0xddb5('0x31')]);_0x111af8[_0xddb5('0x36')]=_[_0xddb5('0x34')](_0x212737[_0xddb5('0x35')],qs[_0xddb5('0x37')](_0x3782a2[_0xddb5('0x31')][_0xddb5('0x37')]));_0x111af8[_0xddb5('0x36')]=_0x111af8['attributes']['length']?_0x111af8[_0xddb5('0x36')]:_0x212737['model'];if(_0x3782a2[_0xddb5('0x31')]['includeAll']){_0x111af8[_0xddb5('0x43')]=[{'all':!![]}];}_0x111af8=_[_0xddb5('0x3f')]({},_0x111af8,_0x3782a2[_0xddb5('0x41')]);return db[_0xddb5('0x2c')][_0xddb5('0x49')](_0x111af8)[_0xddb5('0x25')](handleEntityNotFound(_0x253cbf,null))[_0xddb5('0x25')](respondWithResult(_0x253cbf,null))[_0xddb5('0x46')](handleError(_0x253cbf,null));};exports[_0xddb5('0x4a')]=function(_0x4a2e75,_0x232202){return db[_0xddb5('0x2c')]['create'](_0x4a2e75[_0xddb5('0x4b')],{})[_0xddb5('0x25')](function(_0x117bea){var _0x45bec3=_0x4a2e75[_0xddb5('0x4c')]['get']({'plain':!![]});if(!_0x45bec3)throw new Error(_0xddb5('0x4d'));if(_0x45bec3[_0xddb5('0x4e')]===_0xddb5('0x4c')){var _0x573f2d=_0x117bea['get']({'plain':!![]});var _0x35aa23=_0xddb5('0x26');return db[_0xddb5('0x4f')][_0xddb5('0x49')]({'where':{'name':_0x35aa23,'userProfileId':_0x45bec3[_0xddb5('0x50')]},'raw':!![]})['then'](function(_0x51598c){if(_0x51598c&&_0x51598c[_0xddb5('0x51')]===0x0){return db[_0xddb5('0x27')][_0xddb5('0x4a')]({'name':_0x573f2d[_0xddb5('0x28')],'resourceId':_0x573f2d['id'],'type':_0x51598c['name'],'sectionId':_0x51598c['id']},{})[_0xddb5('0x25')](function(){return _0x117bea;});}else{return _0x117bea;}})[_0xddb5('0x46')](function(_0x50cd91){logger[_0xddb5('0x52')](_0xddb5('0x53'),_0x50cd91);throw _0x50cd91;});}return _0x117bea;})['then'](respondWithResult(_0x232202,0xc9))['catch'](handleError(_0x232202,null));};exports[_0xddb5('0x23')]=function(_0x25681f,_0x550ef1){if(_0x25681f[_0xddb5('0x4b')]['id']){delete _0x25681f[_0xddb5('0x4b')]['id'];}return db[_0xddb5('0x2c')][_0xddb5('0x49')]({'where':{'id':_0x25681f[_0xddb5('0x48')]['id']}})[_0xddb5('0x25')](handleEntityNotFound(_0x550ef1,null))[_0xddb5('0x25')](saveUpdates(_0x25681f[_0xddb5('0x4b')],null))[_0xddb5('0x25')](respondWithResult(_0x550ef1,null))[_0xddb5('0x46')](handleError(_0x550ef1,null));};exports[_0xddb5('0x24')]=function(_0x29a849,_0x59a986){return db[_0xddb5('0x2c')][_0xddb5('0x49')]({'where':{'id':_0x29a849[_0xddb5('0x48')]['id']}})[_0xddb5('0x25')](handleEntityNotFound(_0x59a986,null))[_0xddb5('0x25')](removeEntity(_0x59a986,null))['catch'](handleError(_0x59a986,null));};exports[_0xddb5('0x54')]=function(_0x42c927,_0x588e5e,_0x37f06b){return db[_0xddb5('0x2c')][_0xddb5('0x49')]({'where':{'id':_0x42c927['params']['id']},'attributes':[_0xddb5('0x28'),_0xddb5('0x55'),_0xddb5('0x56'),_0xddb5('0x57')],'raw':!![]})[_0xddb5('0x25')](handleEntityNotFound(_0x588e5e,null))[_0xddb5('0x25')](function(_0x2a5728){if(_0x2a5728){if(!fs['existsSync'](path[_0xddb5('0x58')](config[_0xddb5('0x59')],_0xddb5('0x5a'),_0x2a5728['savename']))){throw new db['Sequelize'][(_0xddb5('0x5b'))](_0xddb5('0x5c'));}if(_0x42c927['query'][_0xddb5('0x5d')]){return _0x588e5e[_0xddb5('0x19')](0xc8);}return _0x588e5e[_0xddb5('0x54')](path[_0xddb5('0x58')](config['root'],_0xddb5('0x5a'),_0x2a5728['savename']),util[_0xddb5('0x5e')]('%s.%s',_0x2a5728['basename']||_0x2a5728[_0xddb5('0x28')],_0x2a5728[_0xddb5('0x57')][_0xddb5('0x5f')]()));}})[_0xddb5('0x46')](handleError(_0x588e5e,null));};
\ No newline at end of file
+var _0x43d9=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','get','ExtractedReports','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','download','basename','savename','Sequelize','ValidationError','exists','join','root','format','%s.%s','output','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path'];(function(_0x3dc538,_0x4f7702){var _0x72c2fd=function(_0x5a7260){while(--_0x5a7260){_0x3dc538['push'](_0x3dc538['shift']());}};_0x72c2fd(++_0x4f7702);}(_0x43d9,0x17e));var _0x943d=function(_0x14e7cd,_0xdf9c3d){_0x14e7cd=_0x14e7cd-0x0;var _0x15d587=_0x43d9[_0x14e7cd];return _0x15d587;};'use strict';var emlformat=require(_0x943d('0x0'));var rimraf=require(_0x943d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x943d('0x2'));var rp=require(_0x943d('0x3'));var moment=require('moment');var BPromise=require(_0x943d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x943d('0x5'));var sox=require(_0x943d('0x6'));var csv=require(_0x943d('0x7'));var ejs=require(_0x943d('0x8'));var fs=require('fs');var fs_extra=require(_0x943d('0x9'));var _=require(_0x943d('0xa'));var squel=require(_0x943d('0xb'));var crypto=require(_0x943d('0xc'));var jsforce=require(_0x943d('0xd'));var deskjs=require(_0x943d('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x943d('0xf'));var authService=require(_0x943d('0x10'));var qs=require(_0x943d('0x11'));var as=require(_0x943d('0x12'));var hardwareService=require(_0x943d('0x13'));var logger=require(_0x943d('0x14'))(_0x943d('0x15'));var utils=require(_0x943d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x943d('0x17'));var db=require(_0x943d('0x18'))['db'];function respondWithStatusCode(_0x3b3fc0,_0x4ef056){_0x4ef056=_0x4ef056||0xcc;return function(_0x198075){if(_0x198075){return _0x3b3fc0[_0x943d('0x19')](_0x4ef056);}return _0x3b3fc0[_0x943d('0x1a')](_0x4ef056)[_0x943d('0x1b')]();};}function respondWithResult(_0x3bda65,_0x2ae63c){_0x2ae63c=_0x2ae63c||0xc8;return function(_0x395783){if(_0x395783){return _0x3bda65['status'](_0x2ae63c)['json'](_0x395783);}};}function respondWithFilteredResult(_0x95f638,_0x336133){return function(_0x30d376){if(_0x30d376){var _0x30d4cd=typeof _0x336133[_0x943d('0x1c')]===_0x943d('0x1d')&&typeof _0x336133[_0x943d('0x1e')]===_0x943d('0x1d');var _0x2322c9=_0x30d376['count'];var _0x3312f9=_0x30d4cd?0x0:_0x336133[_0x943d('0x1c')];var _0x166eee=_0x30d4cd?_0x30d376[_0x943d('0x1f')]:_0x336133['offset']+_0x336133[_0x943d('0x1e')];var _0xe9859d;if(_0x166eee>=_0x2322c9){_0x166eee=_0x2322c9;_0xe9859d=0xc8;}else{_0xe9859d=0xce;}_0x95f638[_0x943d('0x1a')](_0xe9859d);return _0x95f638[_0x943d('0x20')](_0x943d('0x21'),_0x3312f9+'-'+_0x166eee+'/'+_0x2322c9)[_0x943d('0x22')](_0x30d376);}return null;};}function patchUpdates(_0x59e7ed){return function(_0x4569ff){try{jsonpatch[_0x943d('0x23')](_0x4569ff,_0x59e7ed,!![]);}catch(_0x4f1c67){return BPromise[_0x943d('0x24')](_0x4f1c67);}return _0x4569ff['save']();};}function saveUpdates(_0x2ace46,_0xf797b3){return function(_0x321c2a){if(_0x321c2a){return _0x321c2a['update'](_0x2ace46)[_0x943d('0x25')](function(_0x480f4d){return _0x480f4d;});}return null;};}function removeEntity(_0x37d2d3,_0x5a4ca6){return function(_0x520924){if(_0x520924){return _0x520924[_0x943d('0x26')]()[_0x943d('0x25')](function(){var _0x5f58f0=_0x520924[_0x943d('0x27')]({'plain':!![]});var _0x24b510=_0x943d('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x24b510,'resourceId':_0x5f58f0['id']}})[_0x943d('0x25')](function(){return _0x520924;});})['then'](function(){_0x37d2d3[_0x943d('0x1a')](0xcc)[_0x943d('0x1b')]();});}};}function handleEntityNotFound(_0x5b4b3c,_0x47114c){return function(_0x15fc85){if(!_0x15fc85){_0x5b4b3c[_0x943d('0x19')](0x194);}return _0x15fc85;};}function handleError(_0x1e8701,_0x580ab3){_0x580ab3=_0x580ab3||0x1f4;return function(_0x55fc6f){logger['error'](_0x55fc6f[_0x943d('0x29')]);if(_0x55fc6f[_0x943d('0x2a')]){delete _0x55fc6f[_0x943d('0x2a')];}_0x1e8701[_0x943d('0x1a')](_0x580ab3)[_0x943d('0x2b')](_0x55fc6f);};}exports[_0x943d('0x2c')]=function(_0x58c81a,_0x5bd221){var _0x1d8a37={},_0x479763={},_0x377312={'count':0x0,'rows':[]};var _0x387238=_[_0x943d('0x2d')](db[_0x943d('0x2e')][_0x943d('0x2f')],function(_0x2e7fc7){return{'name':_0x2e7fc7['fieldName'],'type':_0x2e7fc7['type'][_0x943d('0x30')]};});_0x479763[_0x943d('0x31')]=_[_0x943d('0x2d')](_0x387238,'name');_0x479763[_0x943d('0x32')]=_[_0x943d('0x33')](_0x58c81a[_0x943d('0x32')]);_0x479763[_0x943d('0x34')]=_[_0x943d('0x35')](_0x479763[_0x943d('0x31')],_0x479763[_0x943d('0x32')]);_0x1d8a37[_0x943d('0x36')]=_['intersection'](_0x479763[_0x943d('0x31')],qs[_0x943d('0x37')](_0x58c81a[_0x943d('0x32')]['fields']));_0x1d8a37[_0x943d('0x36')]=_0x1d8a37[_0x943d('0x36')][_0x943d('0x38')]?_0x1d8a37[_0x943d('0x36')]:_0x479763['model'];if(!_0x58c81a[_0x943d('0x32')]['hasOwnProperty'](_0x943d('0x39'))){_0x1d8a37['limit']=qs['limit'](_0x58c81a[_0x943d('0x32')][_0x943d('0x1e')]);_0x1d8a37['offset']=qs[_0x943d('0x1c')](_0x58c81a['query'][_0x943d('0x1c')]);}_0x1d8a37['order']=qs[_0x943d('0x3a')](_0x58c81a[_0x943d('0x32')][_0x943d('0x3a')]);_0x1d8a37[_0x943d('0x3b')]=qs[_0x943d('0x34')](_[_0x943d('0x3c')](_0x58c81a[_0x943d('0x32')],_0x479763[_0x943d('0x34')]),_0x387238);if(_0x58c81a['query'][_0x943d('0x3d')]){_0x1d8a37[_0x943d('0x3b')]=_[_0x943d('0x3e')](_0x1d8a37[_0x943d('0x3b')],{'$or':_[_0x943d('0x2d')](_0x387238,function(_0x273f3f){if(_0x273f3f[_0x943d('0x3f')]!==_0x943d('0x40')){var _0x3ebffd={};_0x3ebffd[_0x273f3f['name']]={'$like':'%'+_0x58c81a[_0x943d('0x32')][_0x943d('0x3d')]+'%'};return _0x3ebffd;}})});}_0x1d8a37=_[_0x943d('0x3e')]({},_0x1d8a37,_0x58c81a[_0x943d('0x41')]);var _0x14403b={'where':_0x1d8a37[_0x943d('0x3b')]};return db[_0x943d('0x2e')][_0x943d('0x1f')](_0x14403b)[_0x943d('0x25')](function(_0x20853d){_0x377312[_0x943d('0x1f')]=_0x20853d;if(_0x58c81a[_0x943d('0x32')][_0x943d('0x42')]){_0x1d8a37[_0x943d('0x43')]=[{'all':!![]}];}return db[_0x943d('0x2e')][_0x943d('0x44')](_0x1d8a37);})[_0x943d('0x25')](function(_0x35afe5){_0x377312[_0x943d('0x45')]=_0x35afe5;return _0x377312;})[_0x943d('0x25')](respondWithFilteredResult(_0x5bd221,_0x1d8a37))[_0x943d('0x46')](handleError(_0x5bd221,null));};exports[_0x943d('0x47')]=function(_0x49228c,_0x49c2db){var _0x18827e={'raw':!![],'where':{'id':_0x49228c['params']['id']}},_0xb36df1={};_0xb36df1[_0x943d('0x31')]=_[_0x943d('0x33')](db['AnalyticExtractedReport'][_0x943d('0x2f')]);_0xb36df1[_0x943d('0x32')]=_['keys'](_0x49228c['query']);_0xb36df1[_0x943d('0x34')]=_[_0x943d('0x35')](_0xb36df1[_0x943d('0x31')],_0xb36df1[_0x943d('0x32')]);_0x18827e[_0x943d('0x36')]=_['intersection'](_0xb36df1[_0x943d('0x31')],qs[_0x943d('0x37')](_0x49228c[_0x943d('0x32')][_0x943d('0x37')]));_0x18827e[_0x943d('0x36')]=_0x18827e['attributes'][_0x943d('0x38')]?_0x18827e[_0x943d('0x36')]:_0xb36df1[_0x943d('0x31')];if(_0x49228c[_0x943d('0x32')][_0x943d('0x42')]){_0x18827e[_0x943d('0x43')]=[{'all':!![]}];}_0x18827e=_['merge']({},_0x18827e,_0x49228c[_0x943d('0x41')]);return db[_0x943d('0x2e')]['find'](_0x18827e)['then'](handleEntityNotFound(_0x49c2db,null))[_0x943d('0x25')](respondWithResult(_0x49c2db,null))[_0x943d('0x46')](handleError(_0x49c2db,null));};exports[_0x943d('0x48')]=function(_0x30520b,_0x3cdc75){return db[_0x943d('0x2e')][_0x943d('0x48')](_0x30520b[_0x943d('0x49')],{})[_0x943d('0x25')](function(_0x72fe69){var _0x1b4b8e=_0x30520b['user'][_0x943d('0x27')]({'plain':!![]});if(!_0x1b4b8e)throw new Error(_0x943d('0x4a'));if(_0x1b4b8e[_0x943d('0x4b')]===_0x943d('0x4c')){var _0x4ad707=_0x72fe69['get']({'plain':!![]});var _0x1cf2cd=_0x943d('0x28');return db[_0x943d('0x4d')][_0x943d('0x4e')]({'where':{'name':_0x1cf2cd,'userProfileId':_0x1b4b8e[_0x943d('0x4f')]},'raw':!![]})['then'](function(_0x87a3b2){if(_0x87a3b2&&_0x87a3b2[_0x943d('0x50')]===0x0){return db[_0x943d('0x51')][_0x943d('0x48')]({'name':_0x4ad707[_0x943d('0x2a')],'resourceId':_0x4ad707['id'],'type':_0x87a3b2[_0x943d('0x2a')],'sectionId':_0x87a3b2['id']},{})[_0x943d('0x25')](function(){return _0x72fe69;});}else{return _0x72fe69;}})[_0x943d('0x46')](function(_0x496d27){logger[_0x943d('0x52')](_0x943d('0x53'),_0x496d27);throw _0x496d27;});}return _0x72fe69;})[_0x943d('0x25')](respondWithResult(_0x3cdc75,0xc9))[_0x943d('0x46')](handleError(_0x3cdc75,null));};exports[_0x943d('0x54')]=function(_0x2774c7,_0x55446d){if(_0x2774c7['body']['id']){delete _0x2774c7['body']['id'];}return db[_0x943d('0x2e')]['find']({'where':{'id':_0x2774c7[_0x943d('0x55')]['id']}})[_0x943d('0x25')](handleEntityNotFound(_0x55446d,null))['then'](saveUpdates(_0x2774c7[_0x943d('0x49')],null))[_0x943d('0x25')](respondWithResult(_0x55446d,null))[_0x943d('0x46')](handleError(_0x55446d,null));};exports[_0x943d('0x26')]=function(_0x51f5cf,_0x52d25){return db[_0x943d('0x2e')]['find']({'where':{'id':_0x51f5cf[_0x943d('0x55')]['id']}})[_0x943d('0x25')](handleEntityNotFound(_0x52d25,null))[_0x943d('0x25')](removeEntity(_0x52d25,null))[_0x943d('0x46')](handleError(_0x52d25,null));};exports[_0x943d('0x56')]=function(_0x2f0d9a,_0x360e51,_0x4e63c3){return db[_0x943d('0x2e')]['find']({'where':{'id':_0x2f0d9a[_0x943d('0x55')]['id']},'attributes':[_0x943d('0x2a'),_0x943d('0x57'),'savename','output'],'raw':!![]})[_0x943d('0x25')](handleEntityNotFound(_0x360e51,null))[_0x943d('0x25')](function(_0x566583){if(_0x566583){if(!fs['existsSync'](path['join'](config['root'],'server/files/reports',_0x566583[_0x943d('0x58')]))){throw new db[(_0x943d('0x59'))][(_0x943d('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x2f0d9a[_0x943d('0x32')][_0x943d('0x5b')]){return _0x360e51[_0x943d('0x19')](0xc8);}return _0x360e51[_0x943d('0x56')](path[_0x943d('0x5c')](config[_0x943d('0x5d')],'server/files/reports',_0x566583[_0x943d('0x58')]),util[_0x943d('0x5e')](_0x943d('0x5f'),_0x566583['basename']||_0x566583[_0x943d('0x2a')],_0x566583[_0x943d('0x60')]['toLowerCase']()));}})[_0x943d('0x46')](handleError(_0x360e51,null));};
\ No newline at end of file
index de52c0e..0a7b701 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10b8=['define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./analyticExtractedReport.attributes'];(function(_0xc6056f,_0x2254ce){var _0x32008c=function(_0x40c5c3){while(--_0x40c5c3){_0xc6056f['push'](_0xc6056f['shift']());}};_0x32008c(++_0x2254ce);}(_0x10b8,0x1a7));var _0x810b=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x10b8[_0x39e283];return _0x7de89f;};'use strict';var _=require(_0x810b('0x0'));var util=require(_0x810b('0x1'));var logger=require(_0x810b('0x2'))(_0x810b('0x3'));var moment=require(_0x810b('0x4'));var BPromise=require(_0x810b('0x5'));var rp=require(_0x810b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x810b('0x7'));var config=require('../../config/environment');var attributes=require(_0x810b('0x8'));module['exports']=function(_0x5c1619,_0x1f2744){return _0x5c1619[_0x810b('0x9')](_0x810b('0xa'),attributes,{'tableName':_0x810b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x56bc=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','util'];(function(_0x45c981,_0x2ad2d4){var _0x4f62c8=function(_0x55209b){while(--_0x55209b){_0x45c981['push'](_0x45c981['shift']());}};_0x4f62c8(++_0x2ad2d4);}(_0x56bc,0x143));var _0xc56b=function(_0x5d7a73,_0x509f6b){_0x5d7a73=_0x5d7a73-0x0;var _0x2e550d=_0x56bc[_0x5d7a73];return _0x2e550d;};'use strict';var _=require('lodash');var util=require(_0xc56b('0x0'));var logger=require(_0xc56b('0x1'))(_0xc56b('0x2'));var moment=require(_0xc56b('0x3'));var BPromise=require('bluebird');var rp=require(_0xc56b('0x4'));var fs=require('fs');var path=require(_0xc56b('0x5'));var rimraf=require(_0xc56b('0x6'));var config=require(_0xc56b('0x7'));var attributes=require(_0xc56b('0x8'));module[_0xc56b('0x9')]=function(_0x255c17,_0x1aee98){return _0x255c17[_0xc56b('0xa')](_0xc56b('0xb'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7cc0a94..0e0413c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf640=['then','info','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x2cc82a,_0x302488){var _0x36e378=function(_0x5cf555){while(--_0x5cf555){_0x2cc82a['push'](_0x2cc82a['shift']());}};_0x36e378(++_0x302488);}(_0xf640,0x16e));var _0x0f64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf640[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0f64('0x0'));var util=require(_0x0f64('0x1'));var moment=require(_0x0f64('0x2'));var BPromise=require(_0x0f64('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f64('0x4'));var db=require(_0x0f64('0x5'))['db'];var utils=require(_0x0f64('0x6'));var logger=require(_0x0f64('0x7'))('rpc');var config=require(_0x0f64('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0f64('0x9')][_0x0f64('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56de6b,_0x4596b3,_0xbb7460){return new BPromise(function(_0x3b1630,_0x14058f){return client[_0x0f64('0xb')](_0x56de6b,_0xbb7460)[_0x0f64('0xc')](function(_0x43ebb4){logger[_0x0f64('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4596b3,_0x0f64('0xe'));logger['debug'](_0x0f64('0xf'),_0x4596b3,_0x0f64('0xe'),JSON['stringify'](_0x43ebb4));if(_0x43ebb4['error']){if(_0x43ebb4[_0x0f64('0x10')][_0x0f64('0x11')]===0x1f4){logger[_0x0f64('0x10')](_0x0f64('0x12'),_0x4596b3,_0x43ebb4[_0x0f64('0x10')][_0x0f64('0x13')]);return _0x14058f(_0x43ebb4[_0x0f64('0x10')][_0x0f64('0x13')]);}logger[_0x0f64('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4596b3,_0x43ebb4['error']['message']);return _0x3b1630(_0x43ebb4['error'][_0x0f64('0x13')]);}else{logger[_0x0f64('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4596b3,_0x0f64('0xe'));_0x3b1630(_0x43ebb4['result'][_0x0f64('0x13')]);}})[_0x0f64('0x14')](function(_0x4c23c9){logger[_0x0f64('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4596b3,_0x4c23c9);_0x14058f(_0x4c23c9);});});}
\ No newline at end of file
+var _0x8efc=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8efc,0xb3));var _0xc8ef=function(_0x239875,_0x52a793){_0x239875=_0x239875-0x0;var _0x55a8d6=_0x8efc[_0x239875];return _0x55a8d6;};'use strict';var _=require('lodash');var util=require(_0xc8ef('0x0'));var moment=require(_0xc8ef('0x1'));var BPromise=require(_0xc8ef('0x2'));var rs=require(_0xc8ef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc8ef('0x4'))['db'];var utils=require(_0xc8ef('0x5'));var logger=require(_0xc8ef('0x6'))('rpc');var config=require(_0xc8ef('0x7'));var jayson=require(_0xc8ef('0x8'));var client=jayson[_0xc8ef('0x9')][_0xc8ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x576ff9,_0x1fa519,_0x3d06cd){return new BPromise(function(_0x1c8931,_0x489778){return client[_0xc8ef('0xb')](_0x576ff9,_0x3d06cd)[_0xc8ef('0xc')](function(_0x1a9a5f){logger[_0xc8ef('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1fa519,_0xc8ef('0xe'));logger['debug'](_0xc8ef('0xf'),_0x1fa519,_0xc8ef('0xe'),JSON[_0xc8ef('0x10')](_0x1a9a5f));if(_0x1a9a5f[_0xc8ef('0x11')]){if(_0x1a9a5f[_0xc8ef('0x11')][_0xc8ef('0x12')]===0x1f4){logger[_0xc8ef('0x11')](_0xc8ef('0x13'),_0x1fa519,_0x1a9a5f[_0xc8ef('0x11')][_0xc8ef('0x14')]);return _0x489778(_0x1a9a5f[_0xc8ef('0x11')][_0xc8ef('0x14')]);}logger[_0xc8ef('0x11')](_0xc8ef('0x13'),_0x1fa519,_0x1a9a5f[_0xc8ef('0x11')][_0xc8ef('0x14')]);return _0x1c8931(_0x1a9a5f[_0xc8ef('0x11')][_0xc8ef('0x14')]);}else{logger[_0xc8ef('0xd')](_0xc8ef('0x13'),_0x1fa519,_0xc8ef('0xe'));_0x1c8931(_0x1a9a5f[_0xc8ef('0x15')]['message']);}})[_0xc8ef('0x16')](function(_0x332e70){logger[_0xc8ef('0x11')](_0xc8ef('0x13'),_0x1fa519,_0x332e70);_0x489778(_0x332e70);});});}
\ No newline at end of file
index d6c5059..1cb2052 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1671=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','/:id/download','post','create','put','update','destroy'];(function(_0x21b36b,_0x49b49c){var _0x4dd316=function(_0x2f30a3){while(--_0x2f30a3){_0x21b36b['push'](_0x21b36b['shift']());}};_0x4dd316(++_0x49b49c);}(_0x1671,0xe5));var _0x1167=function(_0x5d14fa,_0x7ee288){_0x5d14fa=_0x5d14fa-0x0;var _0x59d129=_0x1671[_0x5d14fa];return _0x59d129;};'use strict';var multer=require(_0x1167('0x0'));var util=require(_0x1167('0x1'));var path=require(_0x1167('0x2'));var timeout=require(_0x1167('0x3'));var express=require('express');var router=express[_0x1167('0x4')]();var fs_extra=require(_0x1167('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1167('0x6'));var config=require('../../config/environment');var controller=require(_0x1167('0x7'));router[_0x1167('0x8')]('/',auth[_0x1167('0x9')](),controller['index']);router[_0x1167('0x8')](_0x1167('0xa'),auth['isAuthenticated'](),controller[_0x1167('0xb')]);router[_0x1167('0x8')](_0x1167('0xc'),auth[_0x1167('0x9')](),controller['download']);router[_0x1167('0xd')]('/',auth[_0x1167('0x9')](),controller[_0x1167('0xe')]);router[_0x1167('0xf')](_0x1167('0xa'),auth[_0x1167('0x9')](),controller[_0x1167('0x10')]);router['delete']('/:id',auth[_0x1167('0x9')](),controller[_0x1167('0x11')]);module[_0x1167('0x12')]=router;
\ No newline at end of file
+var _0x9e95=['delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','create','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9e95,0x1de));var _0x59e9=function(_0x388957,_0x5e7b93){_0x388957=_0x388957-0x0;var _0x3c61c8=_0x9e95[_0x388957];return _0x3c61c8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x59e9('0x0'));var timeout=require(_0x59e9('0x1'));var express=require(_0x59e9('0x2'));var router=express['Router']();var fs_extra=require(_0x59e9('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x59e9('0x4'));var config=require(_0x59e9('0x5'));var controller=require(_0x59e9('0x6'));router['get']('/',auth[_0x59e9('0x7')](),controller[_0x59e9('0x8')]);router[_0x59e9('0x9')](_0x59e9('0xa'),auth[_0x59e9('0x7')](),controller[_0x59e9('0xb')]);router[_0x59e9('0x9')](_0x59e9('0xc'),auth[_0x59e9('0x7')](),controller[_0x59e9('0xd')]);router['post']('/',auth[_0x59e9('0x7')](),controller[_0x59e9('0xe')]);router[_0x59e9('0xf')]('/:id',auth[_0x59e9('0x7')](),controller['update']);router[_0x59e9('0x10')](_0x59e9('0xa'),auth['isAuthenticated'](),controller[_0x59e9('0x11')]);module[_0x59e9('0x12')]=router;
\ No newline at end of file
index e092699..f0b15ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5931=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x1bef07,_0x2a4e64){var _0x29edf6=function(_0x3e0230){while(--_0x3e0230){_0x1bef07['push'](_0x1bef07['shift']());}};_0x29edf6(++_0x2a4e64);}(_0x5931,0x151));var _0x1593=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0x5931[_0x267d8d];return _0x11a98f;};'use strict';var Sequelize=require(_0x1593('0x0'));module[_0x1593('0x1')]={'field':{'type':Sequelize[_0x1593('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x1593('0x3')]},'format':{'type':Sequelize[_0x1593('0x3')]},'groupBy':{'type':Sequelize[_0x1593('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1593('0x3')]},'custom':{'type':Sequelize[_0x1593('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x81c8=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x4c15e9,_0x37b73f){var _0x405b7d=function(_0x5b5f2a){while(--_0x5b5f2a){_0x4c15e9['push'](_0x4c15e9['shift']());}};_0x405b7d(++_0x37b73f);}(_0x81c8,0x81));var _0x881c=function(_0x58bbc5,_0x509e1b){_0x58bbc5=_0x58bbc5-0x0;var _0x5c0024=_0x81c8[_0x58bbc5];return _0x5c0024;};'use strict';var Sequelize=require(_0x881c('0x0'));module[_0x881c('0x1')]={'field':{'type':Sequelize[_0x881c('0x2')]},'alias':{'type':Sequelize[_0x881c('0x3')]},'function':{'type':Sequelize[_0x881c('0x3')]},'format':{'type':Sequelize[_0x881c('0x3')]},'groupBy':{'type':Sequelize[_0x881c('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x881c('0x3')]},'custom':{'type':Sequelize[_0x881c('0x4')],'defaultValue':![]}};
\ No newline at end of file
index a10ce82..3efba9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa72e=['bulkCreate','ids','addFields','AnalyticCustomReport','sequelize','transaction','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','error','stack','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','include','find','create','body'];(function(_0x5133c2,_0x49fa51){var _0x55b197=function(_0x59b2c8){while(--_0x59b2c8){_0x5133c2['push'](_0x5133c2['shift']());}};_0x55b197(++_0x49fa51);}(_0xa72e,0xa4));var _0xea72=function(_0xd8a1e3,_0x32e80e){_0xd8a1e3=_0xd8a1e3-0x0;var _0x2b193a=_0xa72e[_0xd8a1e3];return _0x2b193a;};'use strict';var emlformat=require(_0xea72('0x0'));var rimraf=require(_0xea72('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea72('0x2'));var rp=require(_0xea72('0x3'));var moment=require(_0xea72('0x4'));var BPromise=require(_0xea72('0x5'));var Mustache=require(_0xea72('0x6'));var util=require('util');var path=require(_0xea72('0x7'));var sox=require(_0xea72('0x8'));var csv=require(_0xea72('0x9'));var ejs=require(_0xea72('0xa'));var fs=require('fs');var fs_extra=require(_0xea72('0xb'));var _=require(_0xea72('0xc'));var squel=require('squel');var crypto=require(_0xea72('0xd'));var jsforce=require(_0xea72('0xe'));var deskjs=require(_0xea72('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xea72('0x10'));var Redis=require('ioredis');var authService=require(_0xea72('0x11'));var qs=require(_0xea72('0x12'));var as=require(_0xea72('0x13'));var hardwareService=require(_0xea72('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xea72('0x15'));var licenseUtil=require(_0xea72('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb72b95,_0x82e2f2){_0x82e2f2=_0x82e2f2||0xcc;return function(_0x48ed46){if(_0x48ed46){return _0xb72b95[_0xea72('0x17')](_0x82e2f2);}return _0xb72b95[_0xea72('0x18')](_0x82e2f2)[_0xea72('0x19')]();};}function respondWithResult(_0x13fb6d,_0x59329c){_0x59329c=_0x59329c||0xc8;return function(_0x23f10c){if(_0x23f10c){return _0x13fb6d[_0xea72('0x18')](_0x59329c)[_0xea72('0x1a')](_0x23f10c);}};}function respondWithFilteredResult(_0x17a095,_0x2dbd50){return function(_0x5c7c52){if(_0x5c7c52){var _0x407fd4=typeof _0x2dbd50[_0xea72('0x1b')]===_0xea72('0x1c')&&typeof _0x2dbd50[_0xea72('0x1d')]===_0xea72('0x1c');var _0x25f694=_0x5c7c52['count'];var _0x2785c2=_0x407fd4?0x0:_0x2dbd50['offset'];var _0x2f50e1=_0x407fd4?_0x5c7c52[_0xea72('0x1e')]:_0x2dbd50[_0xea72('0x1b')]+_0x2dbd50['limit'];var _0x27cc9b;if(_0x2f50e1>=_0x25f694){_0x2f50e1=_0x25f694;_0x27cc9b=0xc8;}else{_0x27cc9b=0xce;}_0x17a095[_0xea72('0x18')](_0x27cc9b);return _0x17a095[_0xea72('0x1f')]('Content-Range',_0x2785c2+'-'+_0x2f50e1+'/'+_0x25f694)['json'](_0x5c7c52);}return null;};}function patchUpdates(_0x330c0e){return function(_0x500065){try{jsonpatch[_0xea72('0x20')](_0x500065,_0x330c0e,!![]);}catch(_0xff9bd3){return BPromise['reject'](_0xff9bd3);}return _0x500065[_0xea72('0x21')]();};}function saveUpdates(_0x295265,_0x308345){return function(_0xa28e3e){if(_0xa28e3e){return _0xa28e3e[_0xea72('0x22')](_0x295265)['then'](function(_0x27ceff){return _0x27ceff;});}return null;};}function removeEntity(_0x3f7259,_0x2bbc5a){return function(_0x50c488){if(_0x50c488){return _0x50c488[_0xea72('0x23')]()[_0xea72('0x24')](function(){_0x3f7259[_0xea72('0x18')](0xcc)[_0xea72('0x19')]();});}};}function handleEntityNotFound(_0x2744fb,_0x4b746c){return function(_0x475154){if(!_0x475154){_0x2744fb['sendStatus'](0x194);}return _0x475154;};}function handleError(_0x194244,_0xa53835){_0xa53835=_0xa53835||0x1f4;return function(_0xdf70b0){logger[_0xea72('0x25')](_0xdf70b0[_0xea72('0x26')]);if(_0xdf70b0[_0xea72('0x27')]){delete _0xdf70b0['name'];}_0x194244[_0xea72('0x18')](_0xa53835)[_0xea72('0x28')](_0xdf70b0);};}exports['index']=function(_0x796f7d,_0x10c113){var _0x3d7e78={},_0x3d1ba4={},_0x230949={'count':0x0,'rows':[]};var _0x4dd964=_[_0xea72('0x29')](db[_0xea72('0x2a')][_0xea72('0x2b')],function(_0x32a874){return{'name':_0x32a874[_0xea72('0x2c')],'type':_0x32a874['type'][_0xea72('0x2d')]};});_0x3d1ba4[_0xea72('0x2e')]=_['map'](_0x4dd964,'name');_0x3d1ba4[_0xea72('0x2f')]=_[_0xea72('0x30')](_0x796f7d['query']);_0x3d1ba4[_0xea72('0x31')]=_[_0xea72('0x32')](_0x3d1ba4[_0xea72('0x2e')],_0x3d1ba4['query']);_0x3d7e78[_0xea72('0x33')]=_[_0xea72('0x32')](_0x3d1ba4['model'],qs[_0xea72('0x34')](_0x796f7d[_0xea72('0x2f')][_0xea72('0x34')]));_0x3d7e78[_0xea72('0x33')]=_0x3d7e78['attributes'][_0xea72('0x35')]?_0x3d7e78[_0xea72('0x33')]:_0x3d1ba4['model'];if(!_0x796f7d[_0xea72('0x2f')][_0xea72('0x36')](_0xea72('0x37'))){_0x3d7e78[_0xea72('0x1d')]=qs['limit'](_0x796f7d[_0xea72('0x2f')]['limit']);_0x3d7e78[_0xea72('0x1b')]=qs[_0xea72('0x1b')](_0x796f7d[_0xea72('0x2f')][_0xea72('0x1b')]);}_0x3d7e78[_0xea72('0x38')]=qs[_0xea72('0x39')](_0x796f7d[_0xea72('0x2f')][_0xea72('0x39')]);_0x3d7e78[_0xea72('0x3a')]=qs[_0xea72('0x31')](_['pick'](_0x796f7d[_0xea72('0x2f')],_0x3d1ba4['filters']),_0x4dd964);if(_0x796f7d[_0xea72('0x2f')]['filter']){_0x3d7e78[_0xea72('0x3a')]=_[_0xea72('0x3b')](_0x3d7e78[_0xea72('0x3a')],{'$or':_[_0xea72('0x29')](_0x4dd964,function(_0x546204){if(_0x546204[_0xea72('0x3c')]!==_0xea72('0x3d')){var _0x3a2d69={};_0x3a2d69[_0x546204[_0xea72('0x27')]]={'$like':'%'+_0x796f7d[_0xea72('0x2f')][_0xea72('0x3e')]+'%'};return _0x3a2d69;}})});}_0x3d7e78=_[_0xea72('0x3b')]({},_0x3d7e78,_0x796f7d[_0xea72('0x3f')]);var _0x2a672c={'where':_0x3d7e78[_0xea72('0x3a')]};return db['AnalyticFieldReport'][_0xea72('0x1e')](_0x2a672c)['then'](function(_0x21a41a){_0x230949['count']=_0x21a41a;if(_0x796f7d[_0xea72('0x2f')][_0xea72('0x40')]){_0x3d7e78['include']=[{'all':!![]}];}return db[_0xea72('0x2a')][_0xea72('0x41')](_0x3d7e78);})[_0xea72('0x24')](function(_0x4b23d4){_0x230949['rows']=_0x4b23d4;return _0x230949;})[_0xea72('0x24')](respondWithFilteredResult(_0x10c113,_0x3d7e78))[_0xea72('0x42')](handleError(_0x10c113,null));};exports[_0xea72('0x43')]=function(_0x9bce36,_0x23f57e){var _0x2fb832={'raw':![],'where':{'id':_0x9bce36[_0xea72('0x44')]['id']}},_0x2e6b47={};_0x2e6b47[_0xea72('0x2e')]=_[_0xea72('0x30')](db['AnalyticFieldReport']['rawAttributes']);_0x2e6b47[_0xea72('0x2f')]=_[_0xea72('0x30')](_0x9bce36[_0xea72('0x2f')]);_0x2e6b47[_0xea72('0x31')]=_[_0xea72('0x32')](_0x2e6b47[_0xea72('0x2e')],_0x2e6b47[_0xea72('0x2f')]);_0x2fb832[_0xea72('0x33')]=_[_0xea72('0x32')](_0x2e6b47[_0xea72('0x2e')],qs[_0xea72('0x34')](_0x9bce36[_0xea72('0x2f')][_0xea72('0x34')]));_0x2fb832[_0xea72('0x33')]=_0x2fb832[_0xea72('0x33')][_0xea72('0x35')]?_0x2fb832[_0xea72('0x33')]:_0x2e6b47[_0xea72('0x2e')];if(_0x9bce36[_0xea72('0x2f')]['includeAll']){_0x2fb832[_0xea72('0x45')]=[{'all':!![]}];}_0x2fb832=_[_0xea72('0x3b')]({},_0x2fb832,_0x9bce36[_0xea72('0x3f')]);return db[_0xea72('0x2a')][_0xea72('0x46')](_0x2fb832)['then'](handleEntityNotFound(_0x23f57e,null))['then'](respondWithResult(_0x23f57e,null))['catch'](handleError(_0x23f57e,null));};exports[_0xea72('0x47')]=function(_0x52ddc6,_0x20f82a){return db[_0xea72('0x2a')][_0xea72('0x47')](_0x52ddc6[_0xea72('0x48')],{})[_0xea72('0x24')](respondWithResult(_0x20f82a,0xc9))[_0xea72('0x42')](handleError(_0x20f82a,null));};exports[_0xea72('0x49')]=function(_0x60f637,_0x3bbdf9){return db[_0xea72('0x2a')][_0xea72('0x49')](_0x60f637[_0xea72('0x48')],{'raw':![],'individualHooks':!![]})[_0xea72('0x24')](respondWithResult(_0x3bbdf9,0xc9))[_0xea72('0x42')](handleError(_0x3bbdf9,null));};exports[_0xea72('0x22')]=function(_0x463579,_0x397712){if(_0x463579[_0xea72('0x48')]['id']){delete _0x463579['body']['id'];}return db['AnalyticFieldReport'][_0xea72('0x46')]({'where':{'id':_0x463579['params']['id']}})[_0xea72('0x24')](handleEntityNotFound(_0x397712,null))['then'](saveUpdates(_0x463579[_0xea72('0x48')],null))[_0xea72('0x24')](respondWithResult(_0x397712,null))['catch'](handleError(_0x397712,null));};exports[_0xea72('0x23')]=function(_0x152899,_0x534670){return db['AnalyticFieldReport'][_0xea72('0x46')]({'where':{'id':_0x152899['params']['id']}})[_0xea72('0x24')](handleEntityNotFound(_0x534670,null))['then'](removeEntity(_0x534670,null))[_0xea72('0x42')](handleError(_0x534670,null));};exports['bulkDestroy']=function(_0x4ef709,_0x16151d){return db[_0xea72('0x2a')][_0xea72('0x23')]({'where':{'id':_0x4ef709[_0xea72('0x2f')][_0xea72('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xea72('0x24')](respondWithResult(_0x16151d,0xcc))['catch'](handleError(_0x16151d,null));};exports[_0xea72('0x4b')]=function(_0x5d5469,_0x1ffac0,_0x4cf1cc){return db[_0xea72('0x4c')]['findOne']({'where':{'id':_0x5d5469[_0xea72('0x44')]['id']}})[_0xea72('0x24')](handleEntityNotFound(_0x1ffac0,null))[_0xea72('0x24')](function(_0x2f0329){if(_0x2f0329){return db[_0xea72('0x4d')][_0xea72('0x4e')](function(_0xe0f1a3){return db[_0xea72('0x2a')][_0xea72('0x23')]({'where':{'CustomReportId':_0x5d5469[_0xea72('0x44')]['id']},'transaction':_0xe0f1a3})[_0xea72('0x24')](function(_0x2250e1){var _0x583c11=_['map'](_0x5d5469['body'],function(_0x44ffd5){delete _0x44ffd5['id'];_0x44ffd5['CustomReportId']=_0x5d5469[_0xea72('0x44')]['id'];return _0x44ffd5;});return db[_0xea72('0x2a')][_0xea72('0x49')](_0x583c11,{'transaction':_0xe0f1a3});});})[_0xea72('0x24')](function(){return db['AnalyticFieldReport'][_0xea72('0x41')]({'where':{'CustomReportId':_0x5d5469['params']['id']}});});}})['then'](respondWithResult(_0x1ffac0,null))[_0xea72('0x42')](handleError(_0x1ffac0,null));};
\ No newline at end of file
+var _0xab1a=['model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type','merge','options','includeAll','include','findAll','catch','show','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key'];(function(_0x4f91cf,_0x543cea){var _0x531468=function(_0x14e8c7){while(--_0x14e8c7){_0x4f91cf['push'](_0x4f91cf['shift']());}};_0x531468(++_0x543cea);}(_0xab1a,0x1d0));var _0xaab1=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xab1a[_0x13e741];return _0x3f8bb3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaab1('0x0'));var zipdir=require(_0xaab1('0x1'));var jsonpatch=require(_0xaab1('0x2'));var rp=require('request-promise');var moment=require(_0xaab1('0x3'));var BPromise=require(_0xaab1('0x4'));var Mustache=require(_0xaab1('0x5'));var util=require('util');var path=require(_0xaab1('0x6'));var sox=require(_0xaab1('0x7'));var csv=require(_0xaab1('0x8'));var ejs=require(_0xaab1('0x9'));var fs=require('fs');var fs_extra=require(_0xaab1('0xa'));var _=require(_0xaab1('0xb'));var squel=require(_0xaab1('0xc'));var crypto=require(_0xaab1('0xd'));var jsforce=require(_0xaab1('0xe'));var deskjs=require(_0xaab1('0xf'));var toCsv=require(_0xaab1('0x8'));var querystring=require(_0xaab1('0x10'));var Papa=require(_0xaab1('0x11'));var Redis=require(_0xaab1('0x12'));var authService=require(_0xaab1('0x13'));var qs=require(_0xaab1('0x14'));var as=require(_0xaab1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaab1('0x16'));var utils=require(_0xaab1('0x17'));var config=require(_0xaab1('0x18'));var licenseUtil=require(_0xaab1('0x19'));var db=require(_0xaab1('0x1a'))['db'];function respondWithStatusCode(_0x4e52df,_0xfc9bfa){_0xfc9bfa=_0xfc9bfa||0xcc;return function(_0x2baf87){if(_0x2baf87){return _0x4e52df[_0xaab1('0x1b')](_0xfc9bfa);}return _0x4e52df['status'](_0xfc9bfa)[_0xaab1('0x1c')]();};}function respondWithResult(_0x39bd15,_0x386a1c){_0x386a1c=_0x386a1c||0xc8;return function(_0x30e475){if(_0x30e475){return _0x39bd15[_0xaab1('0x1d')](_0x386a1c)[_0xaab1('0x1e')](_0x30e475);}};}function respondWithFilteredResult(_0x16f795,_0x2ffcbf){return function(_0x24ecf7){if(_0x24ecf7){var _0x39699f=typeof _0x2ffcbf[_0xaab1('0x1f')]===_0xaab1('0x20')&&typeof _0x2ffcbf[_0xaab1('0x21')]===_0xaab1('0x20');var _0x502c69=_0x24ecf7[_0xaab1('0x22')];var _0x45b061=_0x39699f?0x0:_0x2ffcbf[_0xaab1('0x1f')];var _0x18b47b=_0x39699f?_0x24ecf7[_0xaab1('0x22')]:_0x2ffcbf[_0xaab1('0x1f')]+_0x2ffcbf[_0xaab1('0x21')];var _0x39a6bb;if(_0x18b47b>=_0x502c69){_0x18b47b=_0x502c69;_0x39a6bb=0xc8;}else{_0x39a6bb=0xce;}_0x16f795[_0xaab1('0x1d')](_0x39a6bb);return _0x16f795[_0xaab1('0x23')](_0xaab1('0x24'),_0x45b061+'-'+_0x18b47b+'/'+_0x502c69)[_0xaab1('0x1e')](_0x24ecf7);}return null;};}function patchUpdates(_0x42aa04){return function(_0x4687ea){try{jsonpatch[_0xaab1('0x25')](_0x4687ea,_0x42aa04,!![]);}catch(_0x41c099){return BPromise[_0xaab1('0x26')](_0x41c099);}return _0x4687ea['save']();};}function saveUpdates(_0x357ac0,_0x2856ea){return function(_0x423c72){if(_0x423c72){return _0x423c72[_0xaab1('0x27')](_0x357ac0)[_0xaab1('0x28')](function(_0xbd86a4){return _0xbd86a4;});}return null;};}function removeEntity(_0x2a83a3,_0x25aace){return function(_0x958e6c){if(_0x958e6c){return _0x958e6c[_0xaab1('0x29')]()[_0xaab1('0x28')](function(){_0x2a83a3['status'](0xcc)[_0xaab1('0x1c')]();});}};}function handleEntityNotFound(_0x566490,_0x2ce4d4){return function(_0x3f1d7c){if(!_0x3f1d7c){_0x566490[_0xaab1('0x1b')](0x194);}return _0x3f1d7c;};}function handleError(_0xfaf886,_0x207ef6){_0x207ef6=_0x207ef6||0x1f4;return function(_0x5f3eae){logger[_0xaab1('0x2a')](_0x5f3eae[_0xaab1('0x2b')]);if(_0x5f3eae[_0xaab1('0x2c')]){delete _0x5f3eae['name'];}_0xfaf886['status'](_0x207ef6)[_0xaab1('0x2d')](_0x5f3eae);};}exports[_0xaab1('0x2e')]=function(_0x2e22d1,_0x11f7cd){var _0x8e9eb2={},_0x2023a3={},_0x570d31={'count':0x0,'rows':[]};var _0x369515=_[_0xaab1('0x2f')](db[_0xaab1('0x30')][_0xaab1('0x31')],function(_0x469bbd){return{'name':_0x469bbd[_0xaab1('0x32')],'type':_0x469bbd['type'][_0xaab1('0x33')]};});_0x2023a3[_0xaab1('0x34')]=_[_0xaab1('0x2f')](_0x369515,'name');_0x2023a3[_0xaab1('0x35')]=_[_0xaab1('0x36')](_0x2e22d1[_0xaab1('0x35')]);_0x2023a3['filters']=_[_0xaab1('0x37')](_0x2023a3[_0xaab1('0x34')],_0x2023a3['query']);_0x8e9eb2['attributes']=_['intersection'](_0x2023a3[_0xaab1('0x34')],qs['fields'](_0x2e22d1[_0xaab1('0x35')][_0xaab1('0x38')]));_0x8e9eb2['attributes']=_0x8e9eb2[_0xaab1('0x39')][_0xaab1('0x3a')]?_0x8e9eb2[_0xaab1('0x39')]:_0x2023a3['model'];if(!_0x2e22d1['query'][_0xaab1('0x3b')](_0xaab1('0x3c'))){_0x8e9eb2[_0xaab1('0x21')]=qs[_0xaab1('0x21')](_0x2e22d1[_0xaab1('0x35')][_0xaab1('0x21')]);_0x8e9eb2[_0xaab1('0x1f')]=qs[_0xaab1('0x1f')](_0x2e22d1[_0xaab1('0x35')][_0xaab1('0x1f')]);}_0x8e9eb2['order']=qs[_0xaab1('0x3d')](_0x2e22d1[_0xaab1('0x35')]['sort']);_0x8e9eb2[_0xaab1('0x3e')]=qs[_0xaab1('0x3f')](_[_0xaab1('0x40')](_0x2e22d1[_0xaab1('0x35')],_0x2023a3[_0xaab1('0x3f')]),_0x369515);if(_0x2e22d1[_0xaab1('0x35')][_0xaab1('0x41')]){_0x8e9eb2[_0xaab1('0x3e')]=_['merge'](_0x8e9eb2[_0xaab1('0x3e')],{'$or':_[_0xaab1('0x2f')](_0x369515,function(_0x6a7bc){if(_0x6a7bc[_0xaab1('0x42')]!=='VIRTUAL'){var _0x309117={};_0x309117[_0x6a7bc[_0xaab1('0x2c')]]={'$like':'%'+_0x2e22d1[_0xaab1('0x35')]['filter']+'%'};return _0x309117;}})});}_0x8e9eb2=_[_0xaab1('0x43')]({},_0x8e9eb2,_0x2e22d1[_0xaab1('0x44')]);var _0x9beec7={'where':_0x8e9eb2[_0xaab1('0x3e')]};return db[_0xaab1('0x30')][_0xaab1('0x22')](_0x9beec7)[_0xaab1('0x28')](function(_0xcf9aa){_0x570d31[_0xaab1('0x22')]=_0xcf9aa;if(_0x2e22d1['query'][_0xaab1('0x45')]){_0x8e9eb2[_0xaab1('0x46')]=[{'all':!![]}];}return db[_0xaab1('0x30')][_0xaab1('0x47')](_0x8e9eb2);})[_0xaab1('0x28')](function(_0x2eba21){_0x570d31['rows']=_0x2eba21;return _0x570d31;})[_0xaab1('0x28')](respondWithFilteredResult(_0x11f7cd,_0x8e9eb2))[_0xaab1('0x48')](handleError(_0x11f7cd,null));};exports[_0xaab1('0x49')]=function(_0x3d1710,_0x5bafab){var _0x56a0a1={'raw':![],'where':{'id':_0x3d1710['params']['id']}},_0xa45f90={};_0xa45f90['model']=_[_0xaab1('0x36')](db[_0xaab1('0x30')][_0xaab1('0x31')]);_0xa45f90['query']=_['keys'](_0x3d1710[_0xaab1('0x35')]);_0xa45f90[_0xaab1('0x3f')]=_[_0xaab1('0x37')](_0xa45f90[_0xaab1('0x34')],_0xa45f90[_0xaab1('0x35')]);_0x56a0a1[_0xaab1('0x39')]=_[_0xaab1('0x37')](_0xa45f90['model'],qs[_0xaab1('0x38')](_0x3d1710[_0xaab1('0x35')][_0xaab1('0x38')]));_0x56a0a1[_0xaab1('0x39')]=_0x56a0a1[_0xaab1('0x39')][_0xaab1('0x3a')]?_0x56a0a1[_0xaab1('0x39')]:_0xa45f90[_0xaab1('0x34')];if(_0x3d1710[_0xaab1('0x35')][_0xaab1('0x45')]){_0x56a0a1[_0xaab1('0x46')]=[{'all':!![]}];}_0x56a0a1=_[_0xaab1('0x43')]({},_0x56a0a1,_0x3d1710[_0xaab1('0x44')]);return db[_0xaab1('0x30')][_0xaab1('0x4a')](_0x56a0a1)[_0xaab1('0x28')](handleEntityNotFound(_0x5bafab,null))[_0xaab1('0x28')](respondWithResult(_0x5bafab,null))[_0xaab1('0x48')](handleError(_0x5bafab,null));};exports[_0xaab1('0x4b')]=function(_0x157ff2,_0x45cf79){return db[_0xaab1('0x30')]['create'](_0x157ff2[_0xaab1('0x4c')],{})[_0xaab1('0x28')](respondWithResult(_0x45cf79,0xc9))[_0xaab1('0x48')](handleError(_0x45cf79,null));};exports[_0xaab1('0x4d')]=function(_0x40da7c,_0x4d47da){return db[_0xaab1('0x30')][_0xaab1('0x4d')](_0x40da7c['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4d47da,0xc9))[_0xaab1('0x48')](handleError(_0x4d47da,null));};exports[_0xaab1('0x27')]=function(_0x264cf0,_0x55d32a){if(_0x264cf0[_0xaab1('0x4c')]['id']){delete _0x264cf0[_0xaab1('0x4c')]['id'];}return db['AnalyticFieldReport'][_0xaab1('0x4a')]({'where':{'id':_0x264cf0[_0xaab1('0x4e')]['id']}})[_0xaab1('0x28')](handleEntityNotFound(_0x55d32a,null))['then'](saveUpdates(_0x264cf0[_0xaab1('0x4c')],null))[_0xaab1('0x28')](respondWithResult(_0x55d32a,null))['catch'](handleError(_0x55d32a,null));};exports[_0xaab1('0x29')]=function(_0x481e0b,_0x3de7ad){return db[_0xaab1('0x30')][_0xaab1('0x4a')]({'where':{'id':_0x481e0b[_0xaab1('0x4e')]['id']}})[_0xaab1('0x28')](handleEntityNotFound(_0x3de7ad,null))[_0xaab1('0x28')](removeEntity(_0x3de7ad,null))[_0xaab1('0x48')](handleError(_0x3de7ad,null));};exports[_0xaab1('0x4f')]=function(_0x564d4e,_0x2da2e8){return db[_0xaab1('0x30')][_0xaab1('0x29')]({'where':{'id':_0x564d4e['query'][_0xaab1('0x50')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2da2e8,0xcc))['catch'](handleError(_0x2da2e8,null));};exports[_0xaab1('0x51')]=function(_0x5e4735,_0x1dd058,_0x4be2f3){return db[_0xaab1('0x52')][_0xaab1('0x53')]({'where':{'id':_0x5e4735[_0xaab1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1dd058,null))[_0xaab1('0x28')](function(_0x5592aa){if(_0x5592aa){return db['sequelize'][_0xaab1('0x54')](function(_0x4bda16){return db[_0xaab1('0x30')][_0xaab1('0x29')]({'where':{'CustomReportId':_0x5e4735['params']['id']},'transaction':_0x4bda16})[_0xaab1('0x28')](function(_0xab2144){var _0x279a37=_[_0xaab1('0x2f')](_0x5e4735[_0xaab1('0x4c')],function(_0x3b0ddc){delete _0x3b0ddc['id'];_0x3b0ddc[_0xaab1('0x55')]=_0x5e4735[_0xaab1('0x4e')]['id'];return _0x3b0ddc;});return db[_0xaab1('0x30')]['bulkCreate'](_0x279a37,{'transaction':_0x4bda16});});})['then'](function(){return db['AnalyticFieldReport'][_0xaab1('0x47')]({'where':{'CustomReportId':_0x5e4735[_0xaab1('0x4e')]['id']}});});}})['then'](respondWithResult(_0x1dd058,null))[_0xaab1('0x48')](handleError(_0x1dd058,null));};
\ No newline at end of file
index 2368834..20f3b01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e18=['path','../../config/environment','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','moment','bluebird','request-promise'];(function(_0xf482c1,_0x32cbca){var _0x184548=function(_0x2f8086){while(--_0x2f8086){_0xf482c1['push'](_0xf482c1['shift']());}};_0x184548(++_0x32cbca);}(_0x0e18,0x13a));var _0x80e1=function(_0x4678b0,_0x470017){_0x4678b0=_0x4678b0-0x0;var _0x3224dd=_0x0e18[_0x4678b0];return _0x3224dd;};'use strict';var _=require('lodash');var util=require(_0x80e1('0x0'));var logger=require(_0x80e1('0x1'))('api');var moment=require(_0x80e1('0x2'));var BPromise=require(_0x80e1('0x3'));var rp=require(_0x80e1('0x4'));var fs=require('fs');var path=require(_0x80e1('0x5'));var rimraf=require('rimraf');var config=require(_0x80e1('0x6'));var attributes=require('./analyticFieldReport.attributes');module[_0x80e1('0x7')]=function(_0x455c01,_0xcc0f86){return _0x455c01[_0x80e1('0x8')](_0x80e1('0x9'),attributes,{'tableName':_0x80e1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a4d=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','AnalyticFieldReport','analytics_report_fields'];(function(_0x57f5c5,_0x447b19){var _0x5d98da=function(_0x4d21b4){while(--_0x4d21b4){_0x57f5c5['push'](_0x57f5c5['shift']());}};_0x5d98da(++_0x447b19);}(_0x4a4d,0x78));var _0xd4a4=function(_0x521ec6,_0x26c897){_0x521ec6=_0x521ec6-0x0;var _0x213874=_0x4a4d[_0x521ec6];return _0x213874;};'use strict';var _=require(_0xd4a4('0x0'));var util=require(_0xd4a4('0x1'));var logger=require(_0xd4a4('0x2'))(_0xd4a4('0x3'));var moment=require(_0xd4a4('0x4'));var BPromise=require('bluebird');var rp=require(_0xd4a4('0x5'));var fs=require('fs');var path=require(_0xd4a4('0x6'));var rimraf=require(_0xd4a4('0x7'));var config=require(_0xd4a4('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0xd4a4('0x9')]=function(_0x24aea5,_0x41328c){return _0x24aea5['define'](_0xd4a4('0xa'),attributes,{'tableName':_0xd4a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1159330..4bb7438 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb129=['../../config/utils','../../config/environment','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','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x2f2edb,_0x43742b){var _0x5cec36=function(_0x210347){while(--_0x210347){_0x2f2edb['push'](_0x2f2edb['shift']());}};_0x5cec36(++_0x43742b);}(_0xb129,0x1c8));var _0x9b12=function(_0x398784,_0x4f43d4){_0x398784=_0x398784-0x0;var _0x76f0e1=_0xb129[_0x398784];return _0x76f0e1;};'use strict';var _=require(_0x9b12('0x0'));var util=require(_0x9b12('0x1'));var moment=require(_0x9b12('0x2'));var BPromise=require(_0x9b12('0x3'));var rs=require(_0x9b12('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9b12('0x5'))['db'];var utils=require(_0x9b12('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9b12('0x7'));var jayson=require(_0x9b12('0x8'));var client=jayson[_0x9b12('0x9')][_0x9b12('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4feb23,_0xb07fff,_0x5855b9){return new BPromise(function(_0x1dc7c9,_0xc34836){return client[_0x9b12('0xb')](_0x4feb23,_0x5855b9)[_0x9b12('0xc')](function(_0x587c67){logger[_0x9b12('0xd')](_0x9b12('0xe'),_0xb07fff,_0x9b12('0xf'));logger[_0x9b12('0x10')](_0x9b12('0x11'),_0xb07fff,_0x9b12('0xf'),JSON[_0x9b12('0x12')](_0x587c67));if(_0x587c67[_0x9b12('0x13')]){if(_0x587c67[_0x9b12('0x13')]['code']===0x1f4){logger[_0x9b12('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0xb07fff,_0x587c67[_0x9b12('0x13')]['message']);return _0xc34836(_0x587c67[_0x9b12('0x13')]['message']);}logger['error'](_0x9b12('0xe'),_0xb07fff,_0x587c67[_0x9b12('0x13')]['message']);return _0x1dc7c9(_0x587c67[_0x9b12('0x13')][_0x9b12('0x14')]);}else{logger[_0x9b12('0xd')](_0x9b12('0xe'),_0xb07fff,_0x9b12('0xf'));_0x1dc7c9(_0x587c67[_0x9b12('0x15')]['message']);}})['catch'](function(_0x388423){logger[_0x9b12('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0xb07fff,_0x388423);_0xc34836(_0x388423);});});}
\ No newline at end of file
+var _0x11ac=['client','http','request','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x11ac,0x6a));var _0xc11a=function(_0x4d9ae7,_0x216573){_0x4d9ae7=_0x4d9ae7-0x0;var _0xc4e2bb=_0x11ac[_0x4d9ae7];return _0xc4e2bb;};'use strict';var _=require(_0xc11a('0x0'));var util=require(_0xc11a('0x1'));var moment=require(_0xc11a('0x2'));var BPromise=require(_0xc11a('0x3'));var rs=require(_0xc11a('0x4'));var fs=require('fs');var Redis=require(_0xc11a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc11a('0x6'));var config=require(_0xc11a('0x7'));var jayson=require(_0xc11a('0x8'));var client=jayson[_0xc11a('0x9')][_0xc11a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e3d01,_0x4074b6,_0xe25d98){return new BPromise(function(_0x34b494,_0x465d81){return client[_0xc11a('0xb')](_0x1e3d01,_0xe25d98)['then'](function(_0x3a6ee3){logger[_0xc11a('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4074b6,_0xc11a('0xd'));logger[_0xc11a('0xe')](_0xc11a('0xf'),_0x4074b6,_0xc11a('0xd'),JSON[_0xc11a('0x10')](_0x3a6ee3));if(_0x3a6ee3['error']){if(_0x3a6ee3[_0xc11a('0x11')][_0xc11a('0x12')]===0x1f4){logger[_0xc11a('0x11')](_0xc11a('0x13'),_0x4074b6,_0x3a6ee3['error'][_0xc11a('0x14')]);return _0x465d81(_0x3a6ee3['error']['message']);}logger['error'](_0xc11a('0x13'),_0x4074b6,_0x3a6ee3[_0xc11a('0x11')][_0xc11a('0x14')]);return _0x34b494(_0x3a6ee3[_0xc11a('0x11')][_0xc11a('0x14')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x4074b6,'request\x20sent');_0x34b494(_0x3a6ee3[_0xc11a('0x15')][_0xc11a('0x14')]);}})[_0xc11a('0x16')](function(_0x126cb0){logger[_0xc11a('0x11')](_0xc11a('0x13'),_0x4074b6,_0x126cb0);_0x465d81(_0x126cb0);});});}
\ No newline at end of file
index 32cf4fc..82d56b6 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(_0x5d83a5,_0x3bc32a){var _0x246fd9=function(_0x47ac44){while(--_0x47ac44){_0x5d83a5['push'](_0x5d83a5['shift']());}};_0x246fd9(++_0x3bc32a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x51a2b8,_0x396459){var _0x554da8=function(_0x5a6e17){while(--_0x5a6e17){_0x51a2b8['push'](_0x51a2b8['shift']());}};_0x554da8(++_0x396459);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 248182c..57ce7cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x639a=['exports','STRING','name','TEXT'];(function(_0x48708f,_0x554e98){var _0x4726f2=function(_0x3828dd){while(--_0x3828dd){_0x48708f['push'](_0x48708f['shift']());}};_0x4726f2(++_0x554e98);}(_0x639a,0xec));var _0xa639=function(_0x3d7850,_0x4aefb4){_0x3d7850=_0x3d7850-0x0;var _0x2e9ac6=_0x639a[_0x3d7850];return _0x2e9ac6;};'use strict';var Sequelize=require('sequelize');module[_0xa639('0x0')]={'name':{'type':Sequelize[_0xa639('0x1')],'allowNull':![],'unique':_0xa639('0x2')},'table':{'type':Sequelize[_0xa639('0x1')]},'metric':{'type':Sequelize[_0xa639('0x3')]},'description':{'type':Sequelize[_0xa639('0x1')]}};
\ No newline at end of file
+var _0x80c7=['name','sequelize','exports','STRING'];(function(_0x45cf06,_0x5e3b73){var _0x1c735c=function(_0x5f1317){while(--_0x5f1317){_0x45cf06['push'](_0x45cf06['shift']());}};_0x1c735c(++_0x5e3b73);}(_0x80c7,0x8d));var _0x780c=function(_0x5659bb,_0x285247){_0x5659bb=_0x5659bb-0x0;var _0x373f58=_0x80c7[_0x5659bb];return _0x373f58;};'use strict';var Sequelize=require(_0x780c('0x0'));module[_0x780c('0x1')]={'name':{'type':Sequelize[_0x780c('0x2')],'allowNull':![],'unique':_0x780c('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x780c('0x2')]}};
\ No newline at end of file
index 07f4748..3dc16b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ed=['where','pick','filter','merge','map','type','options','count','includeAll','include','findAll','rows','params','keys','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x446eaf,_0x38316b){var _0x44c1b2=function(_0x38c8b2){while(--_0x38c8b2){_0x446eaf['push'](_0x446eaf['shift']());}};_0x44c1b2(++_0x38316b);}(_0x46ed,0x168));var _0xd46e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x46ed[_0x46698a];return _0x356db0;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];function respondWithStatusCode(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xcc;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0x1a')](_0x48550b);}return _0x5bc1da['status'](_0x48550b)['end']();};}function respondWithResult(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0xc8;return function(_0x1e9aae){if(_0x1e9aae){return _0xacd799[_0xd46e('0x1b')](_0x4688ae)['json'](_0x1e9aae);}};}function respondWithFilteredResult(_0x3b6d25,_0x44a620){return function(_0x417402){if(_0x417402){var _0x3d72ce=typeof _0x44a620[_0xd46e('0x1c')]==='undefined'&&typeof _0x44a620[_0xd46e('0x1d')]===_0xd46e('0x1e');var _0x3583a5=_0x417402['count'];var _0x5ddd04=_0x3d72ce?0x0:_0x44a620[_0xd46e('0x1c')];var _0x1bd574=_0x3d72ce?_0x417402['count']:_0x44a620['offset']+_0x44a620[_0xd46e('0x1d')];var _0x2f2571;if(_0x1bd574>=_0x3583a5){_0x1bd574=_0x3583a5;_0x2f2571=0xc8;}else{_0x2f2571=0xce;}_0x3b6d25[_0xd46e('0x1b')](_0x2f2571);return _0x3b6d25[_0xd46e('0x1f')](_0xd46e('0x20'),_0x5ddd04+'-'+_0x1bd574+'/'+_0x3583a5)[_0xd46e('0x21')](_0x417402);}return null;};}function patchUpdates(_0x3b5fa4){return function(_0x327b7e){try{jsonpatch[_0xd46e('0x22')](_0x327b7e,_0x3b5fa4,!![]);}catch(_0x3c7e91){return BPromise[_0xd46e('0x23')](_0x3c7e91);}return _0x327b7e['save']();};}function saveUpdates(_0x259072,_0x1c83fa){return function(_0x79aa51){if(_0x79aa51){return _0x79aa51[_0xd46e('0x24')](_0x259072)[_0xd46e('0x25')](function(_0xc1af7f){return _0xc1af7f;});}return null;};}function removeEntity(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(_0x62dea5){return _0x62dea5['destroy']()[_0xd46e('0x25')](function(){var _0x5424e5=_0x62dea5['get']({'plain':!![]});var _0x371054=_0xd46e('0x26');return db[_0xd46e('0x27')][_0xd46e('0x28')]({'where':{'type':_0x371054,'resourceId':_0x5424e5['id']}})[_0xd46e('0x25')](function(){return _0x62dea5;});})[_0xd46e('0x25')](function(){_0x33c2e0[_0xd46e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45d789,_0x3c301a){return function(_0xddbce9){if(!_0xddbce9){_0x45d789[_0xd46e('0x1a')](0x194);}return _0xddbce9;};}function handleError(_0x96f15c,_0x16e941){_0x16e941=_0x16e941||0x1f4;return function(_0x58aeef){logger[_0xd46e('0x29')](_0x58aeef[_0xd46e('0x2a')]);if(_0x58aeef[_0xd46e('0x2b')]){delete _0x58aeef[_0xd46e('0x2b')];}_0x96f15c[_0xd46e('0x1b')](_0x16e941)[_0xd46e('0x2c')](_0x58aeef);};}exports[_0xd46e('0x2d')]=function(_0x2c5ec7,_0x18f060){var _0x45ea47={},_0x2ff785={},_0x504324={'count':0x0,'rows':[]};var _0x2f4a1b=_['map'](db[_0xd46e('0x2e')][_0xd46e('0x2f')],function(_0x4f5718){return{'name':_0x4f5718[_0xd46e('0x30')],'type':_0x4f5718['type'][_0xd46e('0x31')]};});_0x2ff785[_0xd46e('0x32')]=_['map'](_0x2f4a1b,_0xd46e('0x2b'));_0x2ff785[_0xd46e('0x33')]=_['keys'](_0x2c5ec7[_0xd46e('0x33')]);_0x2ff785[_0xd46e('0x34')]=_[_0xd46e('0x35')](_0x2ff785['model'],_0x2ff785['query']);_0x45ea47[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x2ff785[_0xd46e('0x32')],qs[_0xd46e('0x37')](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x37')]));_0x45ea47[_0xd46e('0x36')]=_0x45ea47[_0xd46e('0x36')]['length']?_0x45ea47[_0xd46e('0x36')]:_0x2ff785[_0xd46e('0x32')];if(!_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x38')](_0xd46e('0x39'))){_0x45ea47[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x2c5ec7['query'][_0xd46e('0x1d')]);_0x45ea47[_0xd46e('0x1c')]=qs['offset'](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x1c')]);}_0x45ea47[_0xd46e('0x3a')]=qs[_0xd46e('0x3b')](_0x2c5ec7['query'][_0xd46e('0x3b')]);_0x45ea47[_0xd46e('0x3c')]=qs[_0xd46e('0x34')](_[_0xd46e('0x3d')](_0x2c5ec7[_0xd46e('0x33')],_0x2ff785[_0xd46e('0x34')]),_0x2f4a1b);if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x3e')]){_0x45ea47['where']=_[_0xd46e('0x3f')](_0x45ea47[_0xd46e('0x3c')],{'$or':_[_0xd46e('0x40')](_0x2f4a1b,function(_0x25657a){if(_0x25657a[_0xd46e('0x41')]!=='VIRTUAL'){var _0x964c66={};_0x964c66[_0x25657a['name']]={'$like':'%'+_0x2c5ec7['query']['filter']+'%'};return _0x964c66;}})});}_0x45ea47=_['merge']({},_0x45ea47,_0x2c5ec7[_0xd46e('0x42')]);var _0x54949f={'where':_0x45ea47[_0xd46e('0x3c')]};return db[_0xd46e('0x2e')]['count'](_0x54949f)[_0xd46e('0x25')](function(_0x4114e6){_0x504324[_0xd46e('0x43')]=_0x4114e6;if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x44')]){_0x45ea47[_0xd46e('0x45')]=[{'all':!![]}];}return db[_0xd46e('0x2e')][_0xd46e('0x46')](_0x45ea47);})[_0xd46e('0x25')](function(_0xec367d){_0x504324[_0xd46e('0x47')]=_0xec367d;return _0x504324;})['then'](respondWithFilteredResult(_0x18f060,_0x45ea47))['catch'](handleError(_0x18f060,null));};exports['show']=function(_0x2b4a5a,_0x4e1d94){var _0x168d35={'raw':!![],'where':{'id':_0x2b4a5a[_0xd46e('0x48')]['id']}},_0x272f5f={};_0x272f5f[_0xd46e('0x32')]=_[_0xd46e('0x49')](db[_0xd46e('0x2e')][_0xd46e('0x2f')]);_0x272f5f[_0xd46e('0x33')]=_['keys'](_0x2b4a5a[_0xd46e('0x33')]);_0x272f5f['filters']=_[_0xd46e('0x35')](_0x272f5f[_0xd46e('0x32')],_0x272f5f[_0xd46e('0x33')]);_0x168d35[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x272f5f['model'],qs[_0xd46e('0x37')](_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x37')]));_0x168d35[_0xd46e('0x36')]=_0x168d35[_0xd46e('0x36')]['length']?_0x168d35[_0xd46e('0x36')]:_0x272f5f[_0xd46e('0x32')];if(_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x44')]){_0x168d35[_0xd46e('0x45')]=[{'all':!![]}];}_0x168d35=_['merge']({},_0x168d35,_0x2b4a5a[_0xd46e('0x42')]);return db[_0xd46e('0x2e')][_0xd46e('0x4a')](_0x168d35)[_0xd46e('0x25')](handleEntityNotFound(_0x4e1d94,null))[_0xd46e('0x25')](respondWithResult(_0x4e1d94,null))[_0xd46e('0x4b')](handleError(_0x4e1d94,null));};exports[_0xd46e('0x4c')]=function(_0x440dcc,_0x5188f6){return db[_0xd46e('0x2e')][_0xd46e('0x4c')](_0x440dcc[_0xd46e('0x4d')],{})[_0xd46e('0x25')](function(_0x1f1941){var _0x4e84c8=_0x440dcc['user'][_0xd46e('0x4e')]({'plain':!![]});if(!_0x4e84c8)throw new Error(_0xd46e('0x4f'));if(_0x4e84c8[_0xd46e('0x50')]==='user'){var _0x479711=_0x1f1941[_0xd46e('0x4e')]({'plain':!![]});var _0x9d8638='Metrics';return db[_0xd46e('0x51')][_0xd46e('0x4a')]({'where':{'name':_0x9d8638,'userProfileId':_0x4e84c8[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x25')](function(_0x1bd8a5){if(_0x1bd8a5&&_0x1bd8a5[_0xd46e('0x53')]===0x0){return db[_0xd46e('0x27')][_0xd46e('0x4c')]({'name':_0x479711['name'],'resourceId':_0x479711['id'],'type':_0x1bd8a5[_0xd46e('0x2b')],'sectionId':_0x1bd8a5['id']},{})[_0xd46e('0x25')](function(){return _0x1f1941;});}else{return _0x1f1941;}})[_0xd46e('0x4b')](function(_0x63ee74){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x63ee74);throw _0x63ee74;});}return _0x1f1941;})[_0xd46e('0x25')](respondWithResult(_0x5188f6,0xc9))['catch'](handleError(_0x5188f6,null));};exports[_0xd46e('0x24')]=function(_0x2af20b,_0x393cb9){if(_0x2af20b[_0xd46e('0x4d')]['id']){delete _0x2af20b[_0xd46e('0x4d')]['id'];}return db[_0xd46e('0x2e')]['find']({'where':{'id':_0x2af20b[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x393cb9,null))[_0xd46e('0x25')](saveUpdates(_0x2af20b['body'],null))[_0xd46e('0x25')](respondWithResult(_0x393cb9,null))[_0xd46e('0x4b')](handleError(_0x393cb9,null));};exports[_0xd46e('0x28')]=function(_0x2042d4,_0x1886e6){return db[_0xd46e('0x2e')][_0xd46e('0x4a')]({'where':{'id':_0x2042d4[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x1886e6,null))[_0xd46e('0x25')](removeEntity(_0x1886e6,null))[_0xd46e('0x4b')](handleError(_0x1886e6,null));};
\ No newline at end of file
+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(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x7da7,0x10d));var _0x77da=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x7da7[_0x1a36a5];return _0x746243;};'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
index 85af944..65cd5a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c49=['analytics_metrics','lodash','util','moment','request-promise','path','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x7c49,0x141));var _0x97c4=function(_0xde5a9f,_0x161c48){_0xde5a9f=_0xde5a9f-0x0;var _0x1947d0=_0x7c49[_0xde5a9f];return _0x1947d0;};'use strict';var _=require(_0x97c4('0x0'));var util=require(_0x97c4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x97c4('0x2'));var BPromise=require('bluebird');var rp=require(_0x97c4('0x3'));var fs=require('fs');var path=require(_0x97c4('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x97c4('0x5'));module[_0x97c4('0x6')]=function(_0x2f02ec,_0x538c14){return _0x2f02ec[_0x97c4('0x7')](_0x97c4('0x8'),attributes,{'tableName':_0x97c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd9c8=['bluebird','request-promise','path','rimraf','../../config/environment','define','AnalyticMetric','lodash','util','api','moment'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xd9c8,0x15c));var _0x8d9c=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xd9c8[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x8d9c('0x0'));var util=require(_0x8d9c('0x1'));var logger=require('../../config/logger')(_0x8d9c('0x2'));var moment=require(_0x8d9c('0x3'));var BPromise=require(_0x8d9c('0x4'));var rp=require(_0x8d9c('0x5'));var fs=require('fs');var path=require(_0x8d9c('0x6'));var rimraf=require(_0x8d9c('0x7'));var config=require(_0x8d9c('0x8'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x53567f,_0x2c083c){return _0x53567f[_0x8d9c('0x9')](_0x8d9c('0xa'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b4d9c73..a56a48b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d2e=['then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0xa0dc2b,_0x3d37b6){var _0x7d3190=function(_0x56c107){while(--_0x56c107){_0xa0dc2b['push'](_0xa0dc2b['shift']());}};_0x7d3190(++_0x3d37b6);}(_0x9d2e,0x8a));var _0xe9d2=function(_0x556482,_0x41febf){_0x556482=_0x556482-0x0;var _0x3ecaa3=_0x9d2e[_0x556482];return _0x3ecaa3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe9d2('0x0'));var BPromise=require('bluebird');var rs=require(_0xe9d2('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9d2('0x2'))['db'];var utils=require(_0xe9d2('0x3'));var logger=require(_0xe9d2('0x4'))(_0xe9d2('0x5'));var config=require(_0xe9d2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe9d2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x117d3c,_0x447303,_0x113936){return new BPromise(function(_0x4ae3ab,_0x1e929e){return client[_0xe9d2('0x8')](_0x117d3c,_0x113936)[_0xe9d2('0x9')](function(_0xa2a34e){logger[_0xe9d2('0xa')](_0xe9d2('0xb'),_0x447303,_0xe9d2('0xc'));logger[_0xe9d2('0xd')](_0xe9d2('0xe'),_0x447303,_0xe9d2('0xc'),JSON[_0xe9d2('0xf')](_0xa2a34e));if(_0xa2a34e[_0xe9d2('0x10')]){if(_0xa2a34e[_0xe9d2('0x10')][_0xe9d2('0x11')]===0x1f4){logger[_0xe9d2('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x447303,_0xa2a34e[_0xe9d2('0x10')][_0xe9d2('0x12')]);return _0x1e929e(_0xa2a34e[_0xe9d2('0x10')]['message']);}logger[_0xe9d2('0x10')](_0xe9d2('0xb'),_0x447303,_0xa2a34e[_0xe9d2('0x10')]['message']);return _0x4ae3ab(_0xa2a34e[_0xe9d2('0x10')]['message']);}else{logger[_0xe9d2('0xa')](_0xe9d2('0xb'),_0x447303,_0xe9d2('0xc'));_0x4ae3ab(_0xa2a34e[_0xe9d2('0x13')][_0xe9d2('0x12')]);}})[_0xe9d2('0x14')](function(_0x25aa99){logger[_0xe9d2('0x10')](_0xe9d2('0xb'),_0x447303,_0x25aa99);_0x1e929e(_0x25aa99);});});}
\ No newline at end of file
+var _0x3987=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','util','randomstring'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3987,0x138));var _0x7398=function(_0x1a73e7,_0xd7ecbc){_0x1a73e7=_0x1a73e7-0x0;var _0x515a31=_0x3987[_0x1a73e7];return _0x515a31;};'use strict';var _=require(_0x7398('0x0'));var util=require(_0x7398('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7398('0x2'));var fs=require('fs');var Redis=require(_0x7398('0x3'));var db=require(_0x7398('0x4'))['db'];var utils=require(_0x7398('0x5'));var logger=require(_0x7398('0x6'))(_0x7398('0x7'));var config=require('../../config/environment');var jayson=require(_0x7398('0x8'));var client=jayson[_0x7398('0x9')][_0x7398('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fc22e,_0x5e5124,_0x4af2a7){return new BPromise(function(_0x1f99e3,_0x2666fa){return client['request'](_0x3fc22e,_0x4af2a7)[_0x7398('0xb')](function(_0x14efba){logger[_0x7398('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x5e5124,_0x7398('0xd'));logger[_0x7398('0xe')](_0x7398('0xf'),_0x5e5124,_0x7398('0xd'),JSON[_0x7398('0x10')](_0x14efba));if(_0x14efba[_0x7398('0x11')]){if(_0x14efba[_0x7398('0x11')]['code']===0x1f4){logger[_0x7398('0x11')](_0x7398('0x12'),_0x5e5124,_0x14efba[_0x7398('0x11')][_0x7398('0x13')]);return _0x2666fa(_0x14efba['error'][_0x7398('0x13')]);}logger['error'](_0x7398('0x12'),_0x5e5124,_0x14efba[_0x7398('0x11')]['message']);return _0x1f99e3(_0x14efba[_0x7398('0x11')]['message']);}else{logger[_0x7398('0xc')](_0x7398('0x12'),_0x5e5124,_0x7398('0xd'));_0x1f99e3(_0x14efba['result'][_0x7398('0x13')]);}})[_0x7398('0x14')](function(_0xdff76){logger[_0x7398('0x11')](_0x7398('0x12'),_0x5e5124,_0xdff76);_0x2666fa(_0xdff76);});});}
\ No newline at end of file
index da43144..4fe8491 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8b2=['isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticMetric.controller','get'];(function(_0x2ac235,_0x454ae5){var _0x5a8357=function(_0x2c0951){while(--_0x2c0951){_0x2ac235['push'](_0x2ac235['shift']());}};_0x5a8357(++_0x454ae5);}(_0xf8b2,0x15e));var _0x2f8b=function(_0xa20d3d,_0x26685c){_0xa20d3d=_0xa20d3d-0x0;var _0x292aed=_0xf8b2[_0xa20d3d];return _0x292aed;};'use strict';var multer=require(_0x2f8b('0x0'));var util=require(_0x2f8b('0x1'));var path=require(_0x2f8b('0x2'));var timeout=require(_0x2f8b('0x3'));var express=require(_0x2f8b('0x4'));var router=express[_0x2f8b('0x5')]();var fs_extra=require(_0x2f8b('0x6'));var auth=require(_0x2f8b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2f8b('0x8'));router[_0x2f8b('0x9')]('/',auth[_0x2f8b('0xa')](),controller[_0x2f8b('0xb')]);router[_0x2f8b('0x9')](_0x2f8b('0xc'),auth[_0x2f8b('0xa')](),controller[_0x2f8b('0xd')]);router[_0x2f8b('0xe')]('/',auth['isAuthenticated'](),controller[_0x2f8b('0xf')]);router[_0x2f8b('0x10')](_0x2f8b('0xc'),auth['isAuthenticated'](),controller[_0x2f8b('0x11')]);router[_0x2f8b('0x12')](_0x2f8b('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x2f8b('0x13')]=router;
\ No newline at end of file
+var _0xa647=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x15ccab,_0x5c1a5d){var _0x11e1cb=function(_0x94fa6e){while(--_0x94fa6e){_0x15ccab['push'](_0x15ccab['shift']());}};_0x11e1cb(++_0x5c1a5d);}(_0xa647,0x81));var _0x7a64=function(_0x57befa,_0x39264d){_0x57befa=_0x57befa-0x0;var _0x498fe2=_0xa647[_0x57befa];return _0x498fe2;};'use strict';var multer=require(_0x7a64('0x0'));var util=require(_0x7a64('0x1'));var path=require(_0x7a64('0x2'));var timeout=require(_0x7a64('0x3'));var express=require(_0x7a64('0x4'));var router=express[_0x7a64('0x5')]();var fs_extra=require(_0x7a64('0x6'));var auth=require(_0x7a64('0x7'));var interaction=require(_0x7a64('0x8'));var config=require(_0x7a64('0x9'));var controller=require(_0x7a64('0xa'));router[_0x7a64('0xb')]('/',auth['isAuthenticated'](),controller[_0x7a64('0xc')]);router[_0x7a64('0xb')]('/:id',auth[_0x7a64('0xd')](),controller[_0x7a64('0xe')]);router[_0x7a64('0xf')]('/',auth[_0x7a64('0xd')](),controller[_0x7a64('0x10')]);router[_0x7a64('0x11')](_0x7a64('0x12'),auth[_0x7a64('0xd')](),controller[_0x7a64('0x13')]);router[_0x7a64('0x14')](_0x7a64('0x12'),auth[_0x7a64('0xd')](),controller[_0x7a64('0x15')]);module['exports']=router;
\ No newline at end of file
index 88e1dbc..372b1f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b15=['exports','TEXT','sequelize'];(function(_0x45c02b,_0x5e9968){var _0x5ff431=function(_0x1f84c5){while(--_0x1f84c5){_0x45c02b['push'](_0x45c02b['shift']());}};_0x5ff431(++_0x5e9968);}(_0x9b15,0x191));var _0x59b1=function(_0x3873d3,_0x63aadf){_0x3873d3=_0x3873d3-0x0;var _0xbf12eb=_0x9b15[_0x3873d3];return _0xbf12eb;};'use strict';var Sequelize=require(_0x59b1('0x0'));module[_0x59b1('0x1')]={'tree':{'type':Sequelize[_0x59b1('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x676b=['sequelize'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x676b,0x163));var _0xb676=function(_0x3df871,_0xda2e11){_0x3df871=_0x3df871-0x0;var _0x570f7b=_0x676b[_0x3df871];return _0x570f7b;};'use strict';var Sequelize=require(_0xb676('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
index 7ea3c27..02b9f68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9783=['options','includeAll','findAll','catch','show','params','include','find','create','body','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','filter','merge','VIRTUAL'];(function(_0x141d76,_0x139b96){var _0xfc3285=function(_0x42bc03){while(--_0x42bc03){_0x141d76['push'](_0x141d76['shift']());}};_0xfc3285(++_0x139b96);}(_0x9783,0x112));var _0x3978=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9783[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3978('0x0'));var zipdir=require(_0x3978('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3978('0x2'));var Mustache=require(_0x3978('0x3'));var util=require(_0x3978('0x4'));var path=require(_0x3978('0x5'));var sox=require('sox');var csv=require(_0x3978('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3978('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3978('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x3978('0x6'));var querystring=require('querystring');var Papa=require(_0x3978('0x9'));var Redis=require(_0x3978('0xa'));var authService=require(_0x3978('0xb'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3978('0xc'));var logger=require(_0x3978('0xd'))(_0x3978('0xe'));var utils=require('../../config/utils');var config=require(_0x3978('0xf'));var licenseUtil=require('../../config/license/util');var db=require(_0x3978('0x10'))['db'];function respondWithStatusCode(_0x5cf897,_0x3a3ba5){_0x3a3ba5=_0x3a3ba5||0xcc;return function(_0x126087){if(_0x126087){return _0x5cf897[_0x3978('0x11')](_0x3a3ba5);}return _0x5cf897['status'](_0x3a3ba5)[_0x3978('0x12')]();};}function respondWithResult(_0x5423d0,_0x285695){_0x285695=_0x285695||0xc8;return function(_0x313306){if(_0x313306){return _0x5423d0[_0x3978('0x13')](_0x285695)[_0x3978('0x14')](_0x313306);}};}function respondWithFilteredResult(_0x14874c,_0x4ebc4){return function(_0x37f188){if(_0x37f188){var _0x52a9b3=typeof _0x4ebc4['offset']===_0x3978('0x15')&&typeof _0x4ebc4['limit']==='undefined';var _0x1d66a4=_0x37f188[_0x3978('0x16')];var _0x3ae2b4=_0x52a9b3?0x0:_0x4ebc4['offset'];var _0x4f48bf=_0x52a9b3?_0x37f188[_0x3978('0x16')]:_0x4ebc4['offset']+_0x4ebc4['limit'];var _0x394f1c;if(_0x4f48bf>=_0x1d66a4){_0x4f48bf=_0x1d66a4;_0x394f1c=0xc8;}else{_0x394f1c=0xce;}_0x14874c['status'](_0x394f1c);return _0x14874c[_0x3978('0x17')](_0x3978('0x18'),_0x3ae2b4+'-'+_0x4f48bf+'/'+_0x1d66a4)['json'](_0x37f188);}return null;};}function patchUpdates(_0x171998){return function(_0x4c4875){try{jsonpatch['apply'](_0x4c4875,_0x171998,!![]);}catch(_0x2706a1){return BPromise[_0x3978('0x19')](_0x2706a1);}return _0x4c4875['save']();};}function saveUpdates(_0x5ec959,_0x1131b3){return function(_0xf6f304){if(_0xf6f304){return _0xf6f304[_0x3978('0x1a')](_0x5ec959)[_0x3978('0x1b')](function(_0x45b413){return _0x45b413;});}return null;};}function removeEntity(_0x2d08e8,_0x312ba6){return function(_0xe5f2d){if(_0xe5f2d){return _0xe5f2d[_0x3978('0x1c')]()[_0x3978('0x1b')](function(){_0x2d08e8[_0x3978('0x13')](0xcc)[_0x3978('0x12')]();});}};}function handleEntityNotFound(_0x148429,_0x172359){return function(_0x46450e){if(!_0x46450e){_0x148429[_0x3978('0x11')](0x194);}return _0x46450e;};}function handleError(_0x165dc0,_0x54efd2){_0x54efd2=_0x54efd2||0x1f4;return function(_0x293596){logger[_0x3978('0x1d')](_0x293596[_0x3978('0x1e')]);if(_0x293596[_0x3978('0x1f')]){delete _0x293596['name'];}_0x165dc0[_0x3978('0x13')](_0x54efd2)[_0x3978('0x20')](_0x293596);};}exports['index']=function(_0x406e3d,_0x1f8529){var _0x25364e={},_0x25699b={},_0x417aa9={'count':0x0,'rows':[]};var _0x514a83=_[_0x3978('0x21')](db[_0x3978('0x22')][_0x3978('0x23')],function(_0x3c4e67){return{'name':_0x3c4e67[_0x3978('0x24')],'type':_0x3c4e67['type'][_0x3978('0x25')]};});_0x25699b[_0x3978('0x26')]=_[_0x3978('0x21')](_0x514a83,_0x3978('0x1f'));_0x25699b[_0x3978('0x27')]=_[_0x3978('0x28')](_0x406e3d[_0x3978('0x27')]);_0x25699b[_0x3978('0x29')]=_[_0x3978('0x2a')](_0x25699b[_0x3978('0x26')],_0x25699b[_0x3978('0x27')]);_0x25364e['attributes']=_[_0x3978('0x2a')](_0x25699b['model'],qs['fields'](_0x406e3d[_0x3978('0x27')][_0x3978('0x2b')]));_0x25364e[_0x3978('0x2c')]=_0x25364e[_0x3978('0x2c')][_0x3978('0x2d')]?_0x25364e['attributes']:_0x25699b[_0x3978('0x26')];if(!_0x406e3d[_0x3978('0x27')][_0x3978('0x2e')](_0x3978('0x2f'))){_0x25364e[_0x3978('0x30')]=qs[_0x3978('0x30')](_0x406e3d['query'][_0x3978('0x30')]);_0x25364e['offset']=qs['offset'](_0x406e3d[_0x3978('0x27')][_0x3978('0x31')]);}_0x25364e[_0x3978('0x32')]=qs[_0x3978('0x33')](_0x406e3d[_0x3978('0x27')][_0x3978('0x33')]);_0x25364e[_0x3978('0x34')]=qs[_0x3978('0x29')](_['pick'](_0x406e3d['query'],_0x25699b[_0x3978('0x29')]),_0x514a83);if(_0x406e3d[_0x3978('0x27')][_0x3978('0x35')]){_0x25364e[_0x3978('0x34')]=_[_0x3978('0x36')](_0x25364e[_0x3978('0x34')],{'$or':_[_0x3978('0x21')](_0x514a83,function(_0x5c5072){if(_0x5c5072['type']!==_0x3978('0x37')){var _0x4d44be={};_0x4d44be[_0x5c5072[_0x3978('0x1f')]]={'$like':'%'+_0x406e3d[_0x3978('0x27')]['filter']+'%'};return _0x4d44be;}})});}_0x25364e=_[_0x3978('0x36')]({},_0x25364e,_0x406e3d[_0x3978('0x38')]);var _0x392584={'where':_0x25364e['where']};return db['AnalyticTreeReport']['count'](_0x392584)[_0x3978('0x1b')](function(_0x3fc2d9){_0x417aa9[_0x3978('0x16')]=_0x3fc2d9;if(_0x406e3d[_0x3978('0x27')][_0x3978('0x39')]){_0x25364e['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x3978('0x3a')](_0x25364e);})[_0x3978('0x1b')](function(_0x46126e){_0x417aa9['rows']=_0x46126e;return _0x417aa9;})[_0x3978('0x1b')](respondWithFilteredResult(_0x1f8529,_0x25364e))[_0x3978('0x3b')](handleError(_0x1f8529,null));};exports[_0x3978('0x3c')]=function(_0x624d61,_0x41e084){var _0x1b5564={'raw':!![],'where':{'id':_0x624d61[_0x3978('0x3d')]['id']}},_0x825a08={};_0x825a08[_0x3978('0x26')]=_[_0x3978('0x28')](db['AnalyticTreeReport'][_0x3978('0x23')]);_0x825a08[_0x3978('0x27')]=_[_0x3978('0x28')](_0x624d61[_0x3978('0x27')]);_0x825a08[_0x3978('0x29')]=_['intersection'](_0x825a08[_0x3978('0x26')],_0x825a08[_0x3978('0x27')]);_0x1b5564[_0x3978('0x2c')]=_[_0x3978('0x2a')](_0x825a08['model'],qs[_0x3978('0x2b')](_0x624d61['query'][_0x3978('0x2b')]));_0x1b5564[_0x3978('0x2c')]=_0x1b5564[_0x3978('0x2c')][_0x3978('0x2d')]?_0x1b5564['attributes']:_0x825a08['model'];if(_0x624d61['query'][_0x3978('0x39')]){_0x1b5564[_0x3978('0x3e')]=[{'all':!![]}];}_0x1b5564=_[_0x3978('0x36')]({},_0x1b5564,_0x624d61[_0x3978('0x38')]);return db[_0x3978('0x22')][_0x3978('0x3f')](_0x1b5564)[_0x3978('0x1b')](handleEntityNotFound(_0x41e084,null))[_0x3978('0x1b')](respondWithResult(_0x41e084,null))[_0x3978('0x3b')](handleError(_0x41e084,null));};exports[_0x3978('0x40')]=function(_0x2943be,_0x52c19e){return db[_0x3978('0x22')][_0x3978('0x40')](_0x2943be[_0x3978('0x41')],{})[_0x3978('0x1b')](respondWithResult(_0x52c19e,0xc9))[_0x3978('0x3b')](handleError(_0x52c19e,null));};exports['update']=function(_0x56fae8,_0x2ba501){if(_0x56fae8[_0x3978('0x41')]['id']){delete _0x56fae8[_0x3978('0x41')]['id'];}return db[_0x3978('0x22')]['find']({'where':{'id':_0x56fae8[_0x3978('0x3d')]['id']}})[_0x3978('0x1b')](handleEntityNotFound(_0x2ba501,null))['then'](saveUpdates(_0x56fae8[_0x3978('0x41')],null))[_0x3978('0x1b')](respondWithResult(_0x2ba501,null))[_0x3978('0x3b')](handleError(_0x2ba501,null));};exports[_0x3978('0x1c')]=function(_0x168d48,_0x2ed0a0){return db[_0x3978('0x22')][_0x3978('0x3f')]({'where':{'id':_0x168d48['params']['id']}})['then'](handleEntityNotFound(_0x2ed0a0,null))[_0x3978('0x1b')](removeEntity(_0x2ed0a0,null))[_0x3978('0x3b')](handleError(_0x2ed0a0,null));};
\ No newline at end of file
+var _0x6aea=['update','params','eml-format','zip-dir','fast-json-patch','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/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','destroy','then','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body'];(function(_0x529a88,_0x61025d){var _0x1815a3=function(_0x2515b1){while(--_0x2515b1){_0x529a88['push'](_0x529a88['shift']());}};_0x1815a3(++_0x61025d);}(_0x6aea,0x9c));var _0xa6ae=function(_0x44222c,_0x360ae6){_0x44222c=_0x44222c-0x0;var _0x2283f3=_0x6aea[_0x44222c];return _0x2283f3;};'use strict';var emlformat=require(_0xa6ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa6ae('0x1'));var jsonpatch=require(_0xa6ae('0x2'));var rp=require('request-promise');var moment=require(_0xa6ae('0x3'));var BPromise=require(_0xa6ae('0x4'));var Mustache=require(_0xa6ae('0x5'));var util=require(_0xa6ae('0x6'));var path=require(_0xa6ae('0x7'));var sox=require(_0xa6ae('0x8'));var csv=require(_0xa6ae('0x9'));var ejs=require(_0xa6ae('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa6ae('0xb'));var squel=require(_0xa6ae('0xc'));var crypto=require(_0xa6ae('0xd'));var jsforce=require(_0xa6ae('0xe'));var deskjs=require(_0xa6ae('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa6ae('0x10'));var Papa=require(_0xa6ae('0x11'));var Redis=require(_0xa6ae('0x12'));var authService=require(_0xa6ae('0x13'));var qs=require(_0xa6ae('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa6ae('0x15'));var logger=require('../../config/logger')(_0xa6ae('0x16'));var utils=require(_0xa6ae('0x17'));var config=require(_0xa6ae('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa6ae('0x19'))['db'];function respondWithStatusCode(_0x3c23a2,_0x2d6540){_0x2d6540=_0x2d6540||0xcc;return function(_0x1ac20b){if(_0x1ac20b){return _0x3c23a2[_0xa6ae('0x1a')](_0x2d6540);}return _0x3c23a2['status'](_0x2d6540)[_0xa6ae('0x1b')]();};}function respondWithResult(_0x51c655,_0xad5a0d){_0xad5a0d=_0xad5a0d||0xc8;return function(_0x41a5ec){if(_0x41a5ec){return _0x51c655[_0xa6ae('0x1c')](_0xad5a0d)[_0xa6ae('0x1d')](_0x41a5ec);}};}function respondWithFilteredResult(_0xe200de,_0x6ea4c5){return function(_0x18f930){if(_0x18f930){var _0x318bc3=typeof _0x6ea4c5[_0xa6ae('0x1e')]==='undefined'&&typeof _0x6ea4c5[_0xa6ae('0x1f')]==='undefined';var _0x273aa7=_0x18f930[_0xa6ae('0x20')];var _0x245cf9=_0x318bc3?0x0:_0x6ea4c5['offset'];var _0x3b6460=_0x318bc3?_0x18f930[_0xa6ae('0x20')]:_0x6ea4c5['offset']+_0x6ea4c5['limit'];var _0x20bf3f;if(_0x3b6460>=_0x273aa7){_0x3b6460=_0x273aa7;_0x20bf3f=0xc8;}else{_0x20bf3f=0xce;}_0xe200de['status'](_0x20bf3f);return _0xe200de[_0xa6ae('0x21')](_0xa6ae('0x22'),_0x245cf9+'-'+_0x3b6460+'/'+_0x273aa7)[_0xa6ae('0x1d')](_0x18f930);}return null;};}function patchUpdates(_0x2b6b5c){return function(_0x19fc59){try{jsonpatch[_0xa6ae('0x23')](_0x19fc59,_0x2b6b5c,!![]);}catch(_0x4e0575){return BPromise[_0xa6ae('0x24')](_0x4e0575);}return _0x19fc59['save']();};}function saveUpdates(_0x426bb4,_0x5306d1){return function(_0x2e5eae){if(_0x2e5eae){return _0x2e5eae['update'](_0x426bb4)['then'](function(_0x4bd0e9){return _0x4bd0e9;});}return null;};}function removeEntity(_0x280e70,_0x273c02){return function(_0x44d13c){if(_0x44d13c){return _0x44d13c[_0xa6ae('0x25')]()[_0xa6ae('0x26')](function(){_0x280e70['status'](0xcc)[_0xa6ae('0x1b')]();});}};}function handleEntityNotFound(_0xeb88af,_0x197c87){return function(_0x4e2bab){if(!_0x4e2bab){_0xeb88af['sendStatus'](0x194);}return _0x4e2bab;};}function handleError(_0x3e115c,_0x52455f){_0x52455f=_0x52455f||0x1f4;return function(_0xcec9e7){logger['error'](_0xcec9e7[_0xa6ae('0x27')]);if(_0xcec9e7[_0xa6ae('0x28')]){delete _0xcec9e7[_0xa6ae('0x28')];}_0x3e115c[_0xa6ae('0x1c')](_0x52455f)[_0xa6ae('0x29')](_0xcec9e7);};}exports[_0xa6ae('0x2a')]=function(_0x401f36,_0x3cf5d5){var _0x26fa6f={},_0x23a812={},_0x17e64e={'count':0x0,'rows':[]};var _0x583cb3=_[_0xa6ae('0x2b')](db[_0xa6ae('0x2c')][_0xa6ae('0x2d')],function(_0x351c23){return{'name':_0x351c23[_0xa6ae('0x2e')],'type':_0x351c23[_0xa6ae('0x2f')][_0xa6ae('0x30')]};});_0x23a812[_0xa6ae('0x31')]=_[_0xa6ae('0x2b')](_0x583cb3,_0xa6ae('0x28'));_0x23a812[_0xa6ae('0x32')]=_[_0xa6ae('0x33')](_0x401f36['query']);_0x23a812['filters']=_[_0xa6ae('0x34')](_0x23a812[_0xa6ae('0x31')],_0x23a812[_0xa6ae('0x32')]);_0x26fa6f[_0xa6ae('0x35')]=_['intersection'](_0x23a812[_0xa6ae('0x31')],qs[_0xa6ae('0x36')](_0x401f36[_0xa6ae('0x32')][_0xa6ae('0x36')]));_0x26fa6f[_0xa6ae('0x35')]=_0x26fa6f[_0xa6ae('0x35')][_0xa6ae('0x37')]?_0x26fa6f['attributes']:_0x23a812[_0xa6ae('0x31')];if(!_0x401f36[_0xa6ae('0x32')][_0xa6ae('0x38')](_0xa6ae('0x39'))){_0x26fa6f[_0xa6ae('0x1f')]=qs[_0xa6ae('0x1f')](_0x401f36[_0xa6ae('0x32')][_0xa6ae('0x1f')]);_0x26fa6f['offset']=qs[_0xa6ae('0x1e')](_0x401f36[_0xa6ae('0x32')]['offset']);}_0x26fa6f[_0xa6ae('0x3a')]=qs['sort'](_0x401f36[_0xa6ae('0x32')][_0xa6ae('0x3b')]);_0x26fa6f[_0xa6ae('0x3c')]=qs['filters'](_[_0xa6ae('0x3d')](_0x401f36[_0xa6ae('0x32')],_0x23a812[_0xa6ae('0x3e')]),_0x583cb3);if(_0x401f36[_0xa6ae('0x32')][_0xa6ae('0x3f')]){_0x26fa6f[_0xa6ae('0x3c')]=_[_0xa6ae('0x40')](_0x26fa6f[_0xa6ae('0x3c')],{'$or':_[_0xa6ae('0x2b')](_0x583cb3,function(_0x32e933){if(_0x32e933[_0xa6ae('0x2f')]!==_0xa6ae('0x41')){var _0x4a7011={};_0x4a7011[_0x32e933[_0xa6ae('0x28')]]={'$like':'%'+_0x401f36[_0xa6ae('0x32')][_0xa6ae('0x3f')]+'%'};return _0x4a7011;}})});}_0x26fa6f=_[_0xa6ae('0x40')]({},_0x26fa6f,_0x401f36[_0xa6ae('0x42')]);var _0x5ffb73={'where':_0x26fa6f[_0xa6ae('0x3c')]};return db[_0xa6ae('0x2c')][_0xa6ae('0x20')](_0x5ffb73)['then'](function(_0x1861a4){_0x17e64e[_0xa6ae('0x20')]=_0x1861a4;if(_0x401f36[_0xa6ae('0x32')][_0xa6ae('0x43')]){_0x26fa6f[_0xa6ae('0x44')]=[{'all':!![]}];}return db[_0xa6ae('0x2c')][_0xa6ae('0x45')](_0x26fa6f);})[_0xa6ae('0x26')](function(_0x5285f7){_0x17e64e[_0xa6ae('0x46')]=_0x5285f7;return _0x17e64e;})[_0xa6ae('0x26')](respondWithFilteredResult(_0x3cf5d5,_0x26fa6f))[_0xa6ae('0x47')](handleError(_0x3cf5d5,null));};exports['show']=function(_0x58c255,_0x2f7df5){var _0x2b7d53={'raw':!![],'where':{'id':_0x58c255['params']['id']}},_0x5abf50={};_0x5abf50['model']=_[_0xa6ae('0x33')](db[_0xa6ae('0x2c')][_0xa6ae('0x2d')]);_0x5abf50[_0xa6ae('0x32')]=_[_0xa6ae('0x33')](_0x58c255[_0xa6ae('0x32')]);_0x5abf50[_0xa6ae('0x3e')]=_['intersection'](_0x5abf50[_0xa6ae('0x31')],_0x5abf50[_0xa6ae('0x32')]);_0x2b7d53['attributes']=_[_0xa6ae('0x34')](_0x5abf50[_0xa6ae('0x31')],qs[_0xa6ae('0x36')](_0x58c255[_0xa6ae('0x32')][_0xa6ae('0x36')]));_0x2b7d53[_0xa6ae('0x35')]=_0x2b7d53[_0xa6ae('0x35')]['length']?_0x2b7d53[_0xa6ae('0x35')]:_0x5abf50[_0xa6ae('0x31')];if(_0x58c255['query']['includeAll']){_0x2b7d53[_0xa6ae('0x44')]=[{'all':!![]}];}_0x2b7d53=_['merge']({},_0x2b7d53,_0x58c255[_0xa6ae('0x42')]);return db[_0xa6ae('0x2c')][_0xa6ae('0x48')](_0x2b7d53)[_0xa6ae('0x26')](handleEntityNotFound(_0x2f7df5,null))['then'](respondWithResult(_0x2f7df5,null))[_0xa6ae('0x47')](handleError(_0x2f7df5,null));};exports[_0xa6ae('0x49')]=function(_0x6592ca,_0x2367b7){return db[_0xa6ae('0x2c')][_0xa6ae('0x49')](_0x6592ca[_0xa6ae('0x4a')],{})['then'](respondWithResult(_0x2367b7,0xc9))[_0xa6ae('0x47')](handleError(_0x2367b7,null));};exports[_0xa6ae('0x4b')]=function(_0x1b76e9,_0x20195d){if(_0x1b76e9[_0xa6ae('0x4a')]['id']){delete _0x1b76e9[_0xa6ae('0x4a')]['id'];}return db[_0xa6ae('0x2c')][_0xa6ae('0x48')]({'where':{'id':_0x1b76e9[_0xa6ae('0x4c')]['id']}})[_0xa6ae('0x26')](handleEntityNotFound(_0x20195d,null))[_0xa6ae('0x26')](saveUpdates(_0x1b76e9[_0xa6ae('0x4a')],null))[_0xa6ae('0x26')](respondWithResult(_0x20195d,null))[_0xa6ae('0x47')](handleError(_0x20195d,null));};exports[_0xa6ae('0x25')]=function(_0x49b8cd,_0x45a405){return db['AnalyticTreeReport'][_0xa6ae('0x48')]({'where':{'id':_0x49b8cd[_0xa6ae('0x4c')]['id']}})[_0xa6ae('0x26')](handleEntityNotFound(_0x45a405,null))[_0xa6ae('0x26')](removeEntity(_0x45a405,null))[_0xa6ae('0x47')](handleError(_0x45a405,null));};
\ No newline at end of file
index 38ad9f7..7becbb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64ab=['moment','bluebird','request-promise','rimraf','exports','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x64ab,0x7f));var _0xb64a=function(_0xc4469a,_0x322cf9){_0xc4469a=_0xc4469a-0x0;var _0x531027=_0x64ab[_0xc4469a];return _0x531027;};'use strict';var _=require(_0xb64a('0x0'));var util=require('util');var logger=require(_0xb64a('0x1'))(_0xb64a('0x2'));var moment=require(_0xb64a('0x3'));var BPromise=require(_0xb64a('0x4'));var rp=require(_0xb64a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb64a('0x6'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0xb64a('0x7')]=function(_0x41e6cb,_0x3a5808){return _0x41e6cb['define'](_0xb64a('0x8'),attributes,{'tableName':_0xb64a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x25ff=['../../config/environment','./analyticTreeReport.attributes','analytics_report_trees','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x31a576,_0x424419){var _0x30b1d3=function(_0x4710e8){while(--_0x4710e8){_0x31a576['push'](_0x31a576['shift']());}};_0x30b1d3(++_0x424419);}(_0x25ff,0x8f));var _0xf25f=function(_0x550826,_0x94d6ea){_0x550826=_0x550826-0x0;var _0x4ce62b=_0x25ff[_0x550826];return _0x4ce62b;};'use strict';var _=require(_0xf25f('0x0'));var util=require(_0xf25f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf25f('0x2'));var BPromise=require(_0xf25f('0x3'));var rp=require(_0xf25f('0x4'));var fs=require('fs');var path=require(_0xf25f('0x5'));var rimraf=require(_0xf25f('0x6'));var config=require(_0xf25f('0x7'));var attributes=require(_0xf25f('0x8'));module['exports']=function(_0xae9832,_0x4f21ba){return _0xae9832['define']('AnalyticTreeReport',attributes,{'tableName':_0xf25f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 769f767..c8e347c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x2b4dda,_0x57da3b){var _0x2ea63d=function(_0x4363e7){while(--_0x4363e7){_0x2b4dda['push'](_0x2b4dda['shift']());}};_0x2ea63d(++_0x57da3b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x125aee,_0x80c13f){var _0x1e6c7d=function(_0x3f2143){while(--_0x3f2143){_0x125aee['push'](_0x125aee['shift']());}};_0x1e6c7d(++_0x80c13f);}(_0xdb28,0x106));var _0x8db2=function(_0x444cdc,_0x4a9e35){_0x444cdc=_0x444cdc-0x0;var _0x5b3df8=_0xdb28[_0x444cdc];return _0x5b3df8;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
index 6ce6b1b..9c3737a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef5e=['/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x207a3f,_0x4f77ed){var _0x5c41ec=function(_0x1aef8){while(--_0x1aef8){_0x207a3f['push'](_0x207a3f['shift']());}};_0x5c41ec(++_0x4f77ed);}(_0xef5e,0x1e0));var _0xeef5=function(_0x23eb4c,_0x5e5f1a){_0x23eb4c=_0x23eb4c-0x0;var _0x3b41b9=_0xef5e[_0x23eb4c];return _0x3b41b9;};'use strict';var multer=require(_0xeef5('0x0'));var util=require('util');var path=require(_0xeef5('0x1'));var timeout=require('connect-timeout');var express=require(_0xeef5('0x2'));var router=express[_0xeef5('0x3')]();var fs_extra=require(_0xeef5('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xeef5('0x5'));var controller=require(_0xeef5('0x6'));router[_0xeef5('0x7')]('/',auth[_0xeef5('0x8')](),controller[_0xeef5('0x9')]);router[_0xeef5('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xeef5('0xa')]);router[_0xeef5('0xb')]('/',auth[_0xeef5('0x8')](),controller[_0xeef5('0xc')]);router[_0xeef5('0xd')](_0xeef5('0xe'),auth[_0xeef5('0x8')](),controller[_0xeef5('0xf')]);router[_0xeef5('0x10')](_0xeef5('0xe'),auth['isAuthenticated'](),controller[_0xeef5('0x11')]);module[_0xeef5('0x12')]=router;
\ No newline at end of file
+var _0x088f=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer','path'];(function(_0x1ac292,_0x4912bc){var _0x1ef8ae=function(_0xe5631c){while(--_0xe5631c){_0x1ac292['push'](_0x1ac292['shift']());}};_0x1ef8ae(++_0x4912bc);}(_0x088f,0x1ec));var _0xf088=function(_0x327fd9,_0x227820){_0x327fd9=_0x327fd9-0x0;var _0x3a07cf=_0x088f[_0x327fd9];return _0x3a07cf;};'use strict';var multer=require(_0xf088('0x0'));var util=require('util');var path=require(_0xf088('0x1'));var timeout=require(_0xf088('0x2'));var express=require(_0xf088('0x3'));var router=express[_0xf088('0x4')]();var fs_extra=require(_0xf088('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf088('0x6'));var config=require(_0xf088('0x7'));var controller=require(_0xf088('0x8'));router[_0xf088('0x9')]('/',auth[_0xf088('0xa')](),controller[_0xf088('0xb')]);router[_0xf088('0x9')](_0xf088('0xc'),auth[_0xf088('0xa')](),controller[_0xf088('0xd')]);router[_0xf088('0xe')]('/',auth[_0xf088('0xa')](),controller['create']);router[_0xf088('0xf')](_0xf088('0xc'),auth[_0xf088('0xa')](),controller['update']);router[_0xf088('0x10')](_0xf088('0xc'),auth[_0xf088('0xa')](),controller[_0xf088('0x11')]);module[_0xf088('0x12')]=router;
\ No newline at end of file
index 96ec471..dc4a308 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac72=['exports','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac72,0x1eb));var _0x2ac7=function(_0x2fefbc,_0xf1f224){_0x2fefbc=_0x2fefbc-0x0;var _0x59ad62=_0xac72[_0x2fefbc];return _0x59ad62;};'use strict';var Sequelize=require(_0x2ac7('0x0'));module[_0x2ac7('0x1')]={'name':{'type':Sequelize[_0x2ac7('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2ac7('0x2')]}};
\ No newline at end of file
+var _0x9a19=['sequelize','exports','STRING'];(function(_0x298374,_0x5c017d){var _0x15b25a=function(_0x78423e){while(--_0x78423e){_0x298374['push'](_0x298374['shift']());}};_0x15b25a(++_0x5c017d);}(_0x9a19,0x114));var _0x99a1=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0x9a19[_0x104e21];return _0x605b37;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'name':{'type':Sequelize[_0x99a1('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x99a1('0x2')]}};
\ No newline at end of file
index 953db85..8e1a949 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb333=['include','findAll','rows','params','rawAttributes','find','catch','length','get','omit','createdAt','updatedAt','body','create','basename','file','filename','mimetype','download','findOne','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','Attachment','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll'];(function(_0x39709c,_0x341236){var _0x220cd3=function(_0x4fa012){while(--_0x4fa012){_0x39709c['push'](_0x39709c['shift']());}};_0x220cd3(++_0x341236);}(_0xb333,0x126));var _0x3b33=function(_0x237456,_0x4eef49){_0x237456=_0x237456-0x0;var _0x10c329=_0xb333[_0x237456];return _0x10c329;};'use strict';var emlformat=require(_0x3b33('0x0'));var rimraf=require(_0x3b33('0x1'));var zipdir=require(_0x3b33('0x2'));var jsonpatch=require(_0x3b33('0x3'));var rp=require(_0x3b33('0x4'));var moment=require(_0x3b33('0x5'));var BPromise=require(_0x3b33('0x6'));var Mustache=require(_0x3b33('0x7'));var util=require(_0x3b33('0x8'));var path=require(_0x3b33('0x9'));var sox=require('sox');var csv=require(_0x3b33('0xa'));var ejs=require(_0x3b33('0xb'));var fs=require('fs');var fs_extra=require(_0x3b33('0xc'));var _=require(_0x3b33('0xd'));var squel=require('squel');var crypto=require(_0x3b33('0xe'));var jsforce=require(_0x3b33('0xf'));var deskjs=require(_0x3b33('0x10'));var toCsv=require(_0x3b33('0xa'));var querystring=require(_0x3b33('0x11'));var Papa=require(_0x3b33('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3b33('0x13'));var hardwareService=require(_0x3b33('0x14'));var logger=require(_0x3b33('0x15'))(_0x3b33('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3b33('0x17'));var db=require(_0x3b33('0x18'))['db'];function respondWithStatusCode(_0x2bc146,_0x59f045){_0x59f045=_0x59f045||0xcc;return function(_0x30a86d){if(_0x30a86d){return _0x2bc146['sendStatus'](_0x59f045);}return _0x2bc146[_0x3b33('0x19')](_0x59f045)[_0x3b33('0x1a')]();};}function respondWithResult(_0xbfa470,_0x5af7d2){_0x5af7d2=_0x5af7d2||0xc8;return function(_0x568b92){if(_0x568b92){return _0xbfa470[_0x3b33('0x19')](_0x5af7d2)[_0x3b33('0x1b')](_0x568b92);}};}function respondWithFilteredResult(_0x520382,_0x2baafd){return function(_0x201e81){if(_0x201e81){var _0x4c9a0b=typeof _0x2baafd[_0x3b33('0x1c')]===_0x3b33('0x1d')&&typeof _0x2baafd['limit']===_0x3b33('0x1d');var _0x55fcbf=_0x201e81[_0x3b33('0x1e')];var _0x5b37f6=_0x4c9a0b?0x0:_0x2baafd['offset'];var _0x22f407=_0x4c9a0b?_0x201e81['count']:_0x2baafd[_0x3b33('0x1c')]+_0x2baafd['limit'];var _0xbb6acd;if(_0x22f407>=_0x55fcbf){_0x22f407=_0x55fcbf;_0xbb6acd=0xc8;}else{_0xbb6acd=0xce;}_0x520382[_0x3b33('0x19')](_0xbb6acd);return _0x520382[_0x3b33('0x1f')](_0x3b33('0x20'),_0x5b37f6+'-'+_0x22f407+'/'+_0x55fcbf)['json'](_0x201e81);}return null;};}function patchUpdates(_0x87310e){return function(_0x2c8ff0){try{jsonpatch[_0x3b33('0x21')](_0x2c8ff0,_0x87310e,!![]);}catch(_0x276e10){return BPromise[_0x3b33('0x22')](_0x276e10);}return _0x2c8ff0['save']();};}function saveUpdates(_0x3cfa48,_0xe1cf19){return function(_0x29ba04){if(_0x29ba04){return _0x29ba04[_0x3b33('0x23')](_0x3cfa48)[_0x3b33('0x24')](function(_0x2ef7e8){return _0x2ef7e8;});}return null;};}function removeEntity(_0x368641,_0x54bd2c){return function(_0x518db1){if(_0x518db1){return _0x518db1[_0x3b33('0x25')]()[_0x3b33('0x24')](function(){_0x368641[_0x3b33('0x19')](0xcc)[_0x3b33('0x1a')]();});}};}function handleEntityNotFound(_0x544591,_0x23e69a){return function(_0x14141b){if(!_0x14141b){_0x544591['sendStatus'](0x194);}return _0x14141b;};}function handleError(_0x3e4546,_0x5e6d1c){_0x5e6d1c=_0x5e6d1c||0x1f4;return function(_0x51c735){logger[_0x3b33('0x26')](_0x51c735[_0x3b33('0x27')]);if(_0x51c735[_0x3b33('0x28')]){delete _0x51c735[_0x3b33('0x28')];}_0x3e4546[_0x3b33('0x19')](_0x5e6d1c)[_0x3b33('0x29')](_0x51c735);};}exports[_0x3b33('0x2a')]=function(_0x41a79d,_0x587d5e){var _0x20ee4e={},_0x25e152={},_0x10a5b7={'count':0x0,'rows':[]};var _0xefe676=_['map'](db[_0x3b33('0x2b')]['rawAttributes'],function(_0x4c68fe){return{'name':_0x4c68fe[_0x3b33('0x2c')],'type':_0x4c68fe[_0x3b33('0x2d')][_0x3b33('0x2e')]};});_0x25e152[_0x3b33('0x2f')]=_[_0x3b33('0x30')](_0xefe676,_0x3b33('0x28'));_0x25e152['query']=_[_0x3b33('0x31')](_0x41a79d[_0x3b33('0x32')]);_0x25e152[_0x3b33('0x33')]=_[_0x3b33('0x34')](_0x25e152[_0x3b33('0x2f')],_0x25e152[_0x3b33('0x32')]);_0x20ee4e[_0x3b33('0x35')]=_[_0x3b33('0x34')](_0x25e152[_0x3b33('0x2f')],qs[_0x3b33('0x36')](_0x41a79d[_0x3b33('0x32')][_0x3b33('0x36')]));_0x20ee4e[_0x3b33('0x35')]=_0x20ee4e['attributes']['length']?_0x20ee4e[_0x3b33('0x35')]:_0x25e152['model'];if(!_0x41a79d['query'][_0x3b33('0x37')]('nolimit')){_0x20ee4e[_0x3b33('0x38')]=qs[_0x3b33('0x38')](_0x41a79d[_0x3b33('0x32')][_0x3b33('0x38')]);_0x20ee4e['offset']=qs[_0x3b33('0x1c')](_0x41a79d['query'][_0x3b33('0x1c')]);}_0x20ee4e[_0x3b33('0x39')]=qs[_0x3b33('0x3a')](_0x41a79d[_0x3b33('0x32')]['sort']);_0x20ee4e[_0x3b33('0x3b')]=qs[_0x3b33('0x33')](_[_0x3b33('0x3c')](_0x41a79d['query'],_0x25e152[_0x3b33('0x33')]),_0xefe676);if(_0x41a79d['query']['filter']){_0x20ee4e[_0x3b33('0x3b')]=_[_0x3b33('0x3d')](_0x20ee4e['where'],{'$or':_[_0x3b33('0x30')](_0xefe676,function(_0x584718){if(_0x584718[_0x3b33('0x2d')]!==_0x3b33('0x3e')){var _0x3d65c2={};_0x3d65c2[_0x584718[_0x3b33('0x28')]]={'$like':'%'+_0x41a79d[_0x3b33('0x32')][_0x3b33('0x3f')]+'%'};return _0x3d65c2;}})});}_0x20ee4e=_[_0x3b33('0x3d')]({},_0x20ee4e,_0x41a79d[_0x3b33('0x40')]);var _0x35a62b={'where':_0x20ee4e['where']};return db[_0x3b33('0x2b')][_0x3b33('0x1e')](_0x35a62b)[_0x3b33('0x24')](function(_0x3ea300){_0x10a5b7['count']=_0x3ea300;if(_0x41a79d[_0x3b33('0x32')][_0x3b33('0x41')]){_0x20ee4e[_0x3b33('0x42')]=[{'all':!![]}];}return db['Attachment'][_0x3b33('0x43')](_0x20ee4e);})['then'](function(_0x52b190){_0x10a5b7[_0x3b33('0x44')]=_0x52b190;return _0x10a5b7;})[_0x3b33('0x24')](respondWithFilteredResult(_0x587d5e,_0x20ee4e))['catch'](handleError(_0x587d5e,null));};exports['show']=function(_0x1831f7,_0x66ce26){var _0x13faf0={'raw':!![],'where':{'id':_0x1831f7[_0x3b33('0x45')]['id']}},_0xf1413f={};_0xf1413f[_0x3b33('0x2f')]=_[_0x3b33('0x31')](db[_0x3b33('0x2b')][_0x3b33('0x46')]);_0xf1413f[_0x3b33('0x32')]=_['keys'](_0x1831f7[_0x3b33('0x32')]);_0xf1413f['filters']=_[_0x3b33('0x34')](_0xf1413f[_0x3b33('0x2f')],_0xf1413f[_0x3b33('0x32')]);_0x13faf0[_0x3b33('0x35')]=_['intersection'](_0xf1413f[_0x3b33('0x2f')],qs['fields'](_0x1831f7[_0x3b33('0x32')]['fields']));_0x13faf0[_0x3b33('0x35')]=_0x13faf0[_0x3b33('0x35')]['length']?_0x13faf0[_0x3b33('0x35')]:_0xf1413f['model'];if(_0x1831f7['query'][_0x3b33('0x41')]){_0x13faf0[_0x3b33('0x42')]=[{'all':!![]}];}_0x13faf0=_[_0x3b33('0x3d')]({},_0x13faf0,_0x1831f7[_0x3b33('0x40')]);return db['Attachment'][_0x3b33('0x47')](_0x13faf0)[_0x3b33('0x24')](handleEntityNotFound(_0x66ce26,null))['then'](respondWithResult(_0x66ce26,null))[_0x3b33('0x48')](handleError(_0x66ce26,null));};exports['clone']=function(_0x179bd6,_0x110889){var _0xdd4d6d={'where':{'id':_0x179bd6['params']['id']}},_0x1e8344={};_0x1e8344[_0x3b33('0x2f')]=_[_0x3b33('0x31')](db[_0x3b33('0x2b')][_0x3b33('0x46')]);_0xdd4d6d[_0x3b33('0x35')]=_[_0x3b33('0x34')](_0x1e8344[_0x3b33('0x2f')],qs[_0x3b33('0x36')](_0x179bd6[_0x3b33('0x32')][_0x3b33('0x36')]));_0xdd4d6d[_0x3b33('0x35')]=_0xdd4d6d[_0x3b33('0x35')][_0x3b33('0x49')]?_0xdd4d6d[_0x3b33('0x35')]:_0x1e8344[_0x3b33('0x2f')];if(_0x179bd6[_0x3b33('0x32')]['includeAll']){_0xdd4d6d[_0x3b33('0x42')]=[{'all':!![]}];}_0xdd4d6d=_[_0x3b33('0x3d')]({},_0xdd4d6d,_0x179bd6[_0x3b33('0x40')]);return db['Attachment']['find'](_0xdd4d6d)[_0x3b33('0x24')](handleEntityNotFound(_0x110889,null))['then'](function(_0x11d56f){if(_0x11d56f){var _0x2641a4=_0x11d56f[_0x3b33('0x4a')]({'plain':!![]});_0x2641a4=qs[_0x3b33('0x4b')](_0x2641a4,['id',_0x3b33('0x4c'),_0x3b33('0x4d')]);_0x179bd6['body']=_[_0x3b33('0x4b')](_0x179bd6[_0x3b33('0x4e')],['id',_0x3b33('0x4c'),_0x3b33('0x4d')]);return db[_0x3b33('0x2b')][_0x3b33('0x4f')](_['merge'](_0x2641a4,_0x179bd6['body']),{'include':_0x179bd6['query'][_0x3b33('0x41')]?[{'all':!![]}]:undefined});}})[_0x3b33('0x24')](respondWithResult(_0x110889,0xc9))[_0x3b33('0x48')](handleError(_0x110889,null));};exports[_0x3b33('0x23')]=function(_0x540708,_0x3b79e0){if(_0x540708[_0x3b33('0x4e')]['id']){delete _0x540708[_0x3b33('0x4e')]['id'];}return db['Attachment']['find']({'where':{'id':_0x540708[_0x3b33('0x45')]['id']}})[_0x3b33('0x24')](handleEntityNotFound(_0x3b79e0,null))[_0x3b33('0x24')](saveUpdates(_0x540708['body'],null))[_0x3b33('0x24')](respondWithResult(_0x3b79e0,null))[_0x3b33('0x48')](handleError(_0x3b79e0,null));};exports[_0x3b33('0x25')]=function(_0x2e0c8a,_0x375a9a){return db[_0x3b33('0x2b')]['find']({'where':{'id':_0x2e0c8a[_0x3b33('0x45')]['id']}})[_0x3b33('0x24')](handleEntityNotFound(_0x375a9a,null))[_0x3b33('0x24')](removeEntity(_0x375a9a,null))[_0x3b33('0x48')](handleError(_0x375a9a,null));};exports['create']=function(_0x1c78de,_0x5549e1,_0x198b57){_0x1c78de['body'][_0x3b33('0x28')]=_0x1c78de['file']['originalname'];_0x1c78de['body'][_0x3b33('0x50')]=_0x1c78de[_0x3b33('0x51')][_0x3b33('0x52')];_0x1c78de[_0x3b33('0x4e')][_0x3b33('0x2d')]=_0x1c78de[_0x3b33('0x51')][_0x3b33('0x53')];return db[_0x3b33('0x2b')][_0x3b33('0x4f')](_0x1c78de[_0x3b33('0x4e')])['then'](respondWithResult(_0x5549e1,0xc9))['catch'](handleError(_0x5549e1,null));};exports[_0x3b33('0x54')]=function(_0x5b81d7,_0x548fbf,_0x4e6c5a){return db[_0x3b33('0x2b')][_0x3b33('0x55')]({'where':{'id':_0x5b81d7[_0x3b33('0x45')]['id']},'raw':!![]})[_0x3b33('0x24')](handleEntityNotFound(_0x548fbf,null))[_0x3b33('0x24')](function(_0x553e75){if(_0x553e75){var _0xd4c3c3=_0x553e75['ChatOfflineMessageId']!==null;var _0x3c0594=path[_0x3b33('0x56')](config[_0x3b33('0x57')],_0x3b33('0x58'));if(_0xd4c3c3){_0x3c0594=path[_0x3b33('0x56')](_0x3c0594,_0x3b33('0x59'));}var _0x10c7b4=path['join'](_0x3c0594,_0x553e75['basename']);return _0x548fbf[_0x3b33('0x54')](_0x10c7b4);}})[_0x3b33('0x48')](handleError(_0x548fbf,null));};
\ No newline at end of file
+var _0x7a43=['destroy','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','then','includeAll','findAll','catch','show','params','intersection','include','merge','options','find','get','omit','createdAt','body','updatedAt','create'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0x7a43,0x1c9));var _0x37a4=function(_0x39b87c,_0x4b8c02){_0x39b87c=_0x39b87c-0x0;var _0x81605b=_0x7a43[_0x39b87c];return _0x81605b;};'use strict';var emlformat=require(_0x37a4('0x0'));var rimraf=require(_0x37a4('0x1'));var zipdir=require(_0x37a4('0x2'));var jsonpatch=require(_0x37a4('0x3'));var rp=require('request-promise');var moment=require(_0x37a4('0x4'));var BPromise=require(_0x37a4('0x5'));var Mustache=require(_0x37a4('0x6'));var util=require('util');var path=require('path');var sox=require(_0x37a4('0x7'));var csv=require(_0x37a4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x37a4('0x9'));var squel=require(_0x37a4('0xa'));var crypto=require('crypto');var jsforce=require(_0x37a4('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x37a4('0xc'));var Redis=require(_0x37a4('0xd'));var authService=require(_0x37a4('0xe'));var qs=require(_0x37a4('0xf'));var as=require(_0x37a4('0x10'));var hardwareService=require(_0x37a4('0x11'));var logger=require(_0x37a4('0x12'))('api');var utils=require(_0x37a4('0x13'));var config=require(_0x37a4('0x14'));var licenseUtil=require(_0x37a4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x596555,_0x45b5bf){_0x45b5bf=_0x45b5bf||0xcc;return function(_0x33908a){if(_0x33908a){return _0x596555[_0x37a4('0x16')](_0x45b5bf);}return _0x596555[_0x37a4('0x17')](_0x45b5bf)[_0x37a4('0x18')]();};}function respondWithResult(_0x5ccbd6,_0xa9737d){_0xa9737d=_0xa9737d||0xc8;return function(_0x4c37a9){if(_0x4c37a9){return _0x5ccbd6[_0x37a4('0x17')](_0xa9737d)[_0x37a4('0x19')](_0x4c37a9);}};}function respondWithFilteredResult(_0x558672,_0x3fdf1e){return function(_0x9fbb0e){if(_0x9fbb0e){var _0x4180de=typeof _0x3fdf1e[_0x37a4('0x1a')]===_0x37a4('0x1b')&&typeof _0x3fdf1e[_0x37a4('0x1c')]==='undefined';var _0xec617f=_0x9fbb0e[_0x37a4('0x1d')];var _0x41165f=_0x4180de?0x0:_0x3fdf1e[_0x37a4('0x1a')];var _0x521d4c=_0x4180de?_0x9fbb0e[_0x37a4('0x1d')]:_0x3fdf1e[_0x37a4('0x1a')]+_0x3fdf1e[_0x37a4('0x1c')];var _0x2899ed;if(_0x521d4c>=_0xec617f){_0x521d4c=_0xec617f;_0x2899ed=0xc8;}else{_0x2899ed=0xce;}_0x558672[_0x37a4('0x17')](_0x2899ed);return _0x558672[_0x37a4('0x1e')]('Content-Range',_0x41165f+'-'+_0x521d4c+'/'+_0xec617f)[_0x37a4('0x19')](_0x9fbb0e);}return null;};}function patchUpdates(_0x4f1f75){return function(_0x45472c){try{jsonpatch[_0x37a4('0x1f')](_0x45472c,_0x4f1f75,!![]);}catch(_0x1c8246){return BPromise[_0x37a4('0x20')](_0x1c8246);}return _0x45472c[_0x37a4('0x21')]();};}function saveUpdates(_0x45abfc,_0x106696){return function(_0x6a9661){if(_0x6a9661){return _0x6a9661[_0x37a4('0x22')](_0x45abfc)['then'](function(_0x5b730b){return _0x5b730b;});}return null;};}function removeEntity(_0xf510f3,_0x2b0424){return function(_0x3ba8fc){if(_0x3ba8fc){return _0x3ba8fc['destroy']()['then'](function(){_0xf510f3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2445ee,_0x218979){return function(_0x1139d9){if(!_0x1139d9){_0x2445ee[_0x37a4('0x16')](0x194);}return _0x1139d9;};}function handleError(_0x5a7447,_0x3a3397){_0x3a3397=_0x3a3397||0x1f4;return function(_0x4ff888){logger[_0x37a4('0x23')](_0x4ff888[_0x37a4('0x24')]);if(_0x4ff888[_0x37a4('0x25')]){delete _0x4ff888[_0x37a4('0x25')];}_0x5a7447['status'](_0x3a3397)[_0x37a4('0x26')](_0x4ff888);};}exports[_0x37a4('0x27')]=function(_0x390ee5,_0x2933e8){var _0x55f3f9={},_0x4c282f={},_0x1023bd={'count':0x0,'rows':[]};var _0x2b9dbf=_[_0x37a4('0x28')](db[_0x37a4('0x29')][_0x37a4('0x2a')],function(_0x354e86){return{'name':_0x354e86[_0x37a4('0x2b')],'type':_0x354e86[_0x37a4('0x2c')][_0x37a4('0x2d')]};});_0x4c282f[_0x37a4('0x2e')]=_[_0x37a4('0x28')](_0x2b9dbf,_0x37a4('0x25'));_0x4c282f['query']=_[_0x37a4('0x2f')](_0x390ee5[_0x37a4('0x30')]);_0x4c282f['filters']=_['intersection'](_0x4c282f[_0x37a4('0x2e')],_0x4c282f['query']);_0x55f3f9[_0x37a4('0x31')]=_['intersection'](_0x4c282f[_0x37a4('0x2e')],qs[_0x37a4('0x32')](_0x390ee5[_0x37a4('0x30')][_0x37a4('0x32')]));_0x55f3f9['attributes']=_0x55f3f9[_0x37a4('0x31')][_0x37a4('0x33')]?_0x55f3f9['attributes']:_0x4c282f[_0x37a4('0x2e')];if(!_0x390ee5[_0x37a4('0x30')][_0x37a4('0x34')](_0x37a4('0x35'))){_0x55f3f9[_0x37a4('0x1c')]=qs['limit'](_0x390ee5[_0x37a4('0x30')][_0x37a4('0x1c')]);_0x55f3f9['offset']=qs['offset'](_0x390ee5[_0x37a4('0x30')][_0x37a4('0x1a')]);}_0x55f3f9[_0x37a4('0x36')]=qs[_0x37a4('0x37')](_0x390ee5[_0x37a4('0x30')][_0x37a4('0x37')]);_0x55f3f9[_0x37a4('0x38')]=qs['filters'](_[_0x37a4('0x39')](_0x390ee5[_0x37a4('0x30')],_0x4c282f[_0x37a4('0x3a')]),_0x2b9dbf);if(_0x390ee5['query'][_0x37a4('0x3b')]){_0x55f3f9['where']=_['merge'](_0x55f3f9[_0x37a4('0x38')],{'$or':_[_0x37a4('0x28')](_0x2b9dbf,function(_0x32b443){if(_0x32b443['type']!=='VIRTUAL'){var _0x50772c={};_0x50772c[_0x32b443[_0x37a4('0x25')]]={'$like':'%'+_0x390ee5['query'][_0x37a4('0x3b')]+'%'};return _0x50772c;}})});}_0x55f3f9=_['merge']({},_0x55f3f9,_0x390ee5['options']);var _0x5bc8bf={'where':_0x55f3f9[_0x37a4('0x38')]};return db[_0x37a4('0x29')]['count'](_0x5bc8bf)[_0x37a4('0x3c')](function(_0x57feee){_0x1023bd[_0x37a4('0x1d')]=_0x57feee;if(_0x390ee5['query'][_0x37a4('0x3d')]){_0x55f3f9['include']=[{'all':!![]}];}return db[_0x37a4('0x29')][_0x37a4('0x3e')](_0x55f3f9);})['then'](function(_0x232fdb){_0x1023bd['rows']=_0x232fdb;return _0x1023bd;})[_0x37a4('0x3c')](respondWithFilteredResult(_0x2933e8,_0x55f3f9))[_0x37a4('0x3f')](handleError(_0x2933e8,null));};exports[_0x37a4('0x40')]=function(_0x42c146,_0x2e8350){var _0x393af6={'raw':!![],'where':{'id':_0x42c146[_0x37a4('0x41')]['id']}},_0x7e1a4d={};_0x7e1a4d[_0x37a4('0x2e')]=_[_0x37a4('0x2f')](db[_0x37a4('0x29')]['rawAttributes']);_0x7e1a4d[_0x37a4('0x30')]=_[_0x37a4('0x2f')](_0x42c146[_0x37a4('0x30')]);_0x7e1a4d[_0x37a4('0x3a')]=_[_0x37a4('0x42')](_0x7e1a4d[_0x37a4('0x2e')],_0x7e1a4d[_0x37a4('0x30')]);_0x393af6[_0x37a4('0x31')]=_['intersection'](_0x7e1a4d[_0x37a4('0x2e')],qs[_0x37a4('0x32')](_0x42c146['query'][_0x37a4('0x32')]));_0x393af6[_0x37a4('0x31')]=_0x393af6['attributes'][_0x37a4('0x33')]?_0x393af6['attributes']:_0x7e1a4d['model'];if(_0x42c146[_0x37a4('0x30')][_0x37a4('0x3d')]){_0x393af6[_0x37a4('0x43')]=[{'all':!![]}];}_0x393af6=_[_0x37a4('0x44')]({},_0x393af6,_0x42c146[_0x37a4('0x45')]);return db['Attachment'][_0x37a4('0x46')](_0x393af6)['then'](handleEntityNotFound(_0x2e8350,null))[_0x37a4('0x3c')](respondWithResult(_0x2e8350,null))[_0x37a4('0x3f')](handleError(_0x2e8350,null));};exports['clone']=function(_0x1cf86e,_0x15c482){var _0x1aa620={'where':{'id':_0x1cf86e[_0x37a4('0x41')]['id']}},_0x500453={};_0x500453[_0x37a4('0x2e')]=_[_0x37a4('0x2f')](db[_0x37a4('0x29')][_0x37a4('0x2a')]);_0x1aa620['attributes']=_['intersection'](_0x500453[_0x37a4('0x2e')],qs['fields'](_0x1cf86e[_0x37a4('0x30')][_0x37a4('0x32')]));_0x1aa620[_0x37a4('0x31')]=_0x1aa620[_0x37a4('0x31')][_0x37a4('0x33')]?_0x1aa620['attributes']:_0x500453[_0x37a4('0x2e')];if(_0x1cf86e[_0x37a4('0x30')][_0x37a4('0x3d')]){_0x1aa620[_0x37a4('0x43')]=[{'all':!![]}];}_0x1aa620=_[_0x37a4('0x44')]({},_0x1aa620,_0x1cf86e[_0x37a4('0x45')]);return db[_0x37a4('0x29')][_0x37a4('0x46')](_0x1aa620)[_0x37a4('0x3c')](handleEntityNotFound(_0x15c482,null))[_0x37a4('0x3c')](function(_0x23b46b){if(_0x23b46b){var _0x2b3fc3=_0x23b46b[_0x37a4('0x47')]({'plain':!![]});_0x2b3fc3=qs[_0x37a4('0x48')](_0x2b3fc3,['id',_0x37a4('0x49'),'updatedAt']);_0x1cf86e[_0x37a4('0x4a')]=_[_0x37a4('0x48')](_0x1cf86e[_0x37a4('0x4a')],['id',_0x37a4('0x49'),_0x37a4('0x4b')]);return db[_0x37a4('0x29')][_0x37a4('0x4c')](_['merge'](_0x2b3fc3,_0x1cf86e[_0x37a4('0x4a')]),{'include':_0x1cf86e[_0x37a4('0x30')][_0x37a4('0x3d')]?[{'all':!![]}]:undefined});}})[_0x37a4('0x3c')](respondWithResult(_0x15c482,0xc9))[_0x37a4('0x3f')](handleError(_0x15c482,null));};exports['update']=function(_0xc9e791,_0x16938e){if(_0xc9e791[_0x37a4('0x4a')]['id']){delete _0xc9e791[_0x37a4('0x4a')]['id'];}return db[_0x37a4('0x29')][_0x37a4('0x46')]({'where':{'id':_0xc9e791[_0x37a4('0x41')]['id']}})['then'](handleEntityNotFound(_0x16938e,null))[_0x37a4('0x3c')](saveUpdates(_0xc9e791[_0x37a4('0x4a')],null))[_0x37a4('0x3c')](respondWithResult(_0x16938e,null))[_0x37a4('0x3f')](handleError(_0x16938e,null));};exports[_0x37a4('0x4d')]=function(_0x21373d,_0x192512){return db[_0x37a4('0x29')]['find']({'where':{'id':_0x21373d[_0x37a4('0x41')]['id']}})[_0x37a4('0x3c')](handleEntityNotFound(_0x192512,null))['then'](removeEntity(_0x192512,null))[_0x37a4('0x3f')](handleError(_0x192512,null));};exports[_0x37a4('0x4c')]=function(_0x460aa4,_0x34849f,_0x6d6fac){_0x460aa4[_0x37a4('0x4a')][_0x37a4('0x25')]=_0x460aa4[_0x37a4('0x4e')][_0x37a4('0x4f')];_0x460aa4[_0x37a4('0x4a')][_0x37a4('0x50')]=_0x460aa4['file'][_0x37a4('0x51')];_0x460aa4[_0x37a4('0x4a')]['type']=_0x460aa4[_0x37a4('0x4e')][_0x37a4('0x52')];return db[_0x37a4('0x29')][_0x37a4('0x4c')](_0x460aa4[_0x37a4('0x4a')])[_0x37a4('0x3c')](respondWithResult(_0x34849f,0xc9))[_0x37a4('0x3f')](handleError(_0x34849f,null));};exports[_0x37a4('0x53')]=function(_0x2e1468,_0x33cc85,_0x19362c){return db[_0x37a4('0x29')][_0x37a4('0x54')]({'where':{'id':_0x2e1468['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x33cc85,null))[_0x37a4('0x3c')](function(_0x18fddd){if(_0x18fddd){var _0x2abc27=_0x18fddd[_0x37a4('0x55')]!==null;var _0x533006=path[_0x37a4('0x56')](config[_0x37a4('0x57')],_0x37a4('0x58'));if(_0x2abc27){_0x533006=path[_0x37a4('0x56')](_0x533006,'offline-chat/');}var _0x367239=path['join'](_0x533006,_0x18fddd[_0x37a4('0x50')]);return _0x33cc85[_0x37a4('0x53')](_0x367239);}})[_0x37a4('0x3f')](handleError(_0x33cc85,null));};
\ No newline at end of file
index fa8a295..314351f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9350=['../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x36bfe3,_0x358938){var _0x9b0436=function(_0x86e47d){while(--_0x86e47d){_0x36bfe3['push'](_0x36bfe3['shift']());}};_0x9b0436(++_0x358938);}(_0x9350,0x110));var _0x0935=function(_0x102f97,_0x5bda2f){_0x102f97=_0x102f97-0x0;var _0xd22058=_0x9350[_0x102f97];return _0xd22058;};'use strict';var _=require(_0x0935('0x0'));var util=require(_0x0935('0x1'));var logger=require('../../config/logger')(_0x0935('0x2'));var moment=require(_0x0935('0x3'));var BPromise=require(_0x0935('0x4'));var rp=require(_0x0935('0x5'));var fs=require('fs');var path=require(_0x0935('0x6'));var rimraf=require(_0x0935('0x7'));var config=require(_0x0935('0x8'));var attributes=require(_0x0935('0x9'));module[_0x0935('0xa')]=function(_0x48fc22,_0x207828){return _0x48fc22[_0x0935('0xb')](_0x0935('0xc'),attributes,{'tableName':_0x0935('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8a83=['./attachment.attributes','define','Attachment','lodash','util','moment','bluebird','path','rimraf'];(function(_0x1c76bc,_0x2dea2c){var _0x1eedae=function(_0x2a1a78){while(--_0x2a1a78){_0x1c76bc['push'](_0x1c76bc['shift']());}};_0x1eedae(++_0x2dea2c);}(_0x8a83,0x150));var _0x38a8=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x8a83[_0x1eda20];return _0x31b953;};'use strict';var _=require(_0x38a8('0x0'));var util=require(_0x38a8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x38a8('0x2'));var BPromise=require(_0x38a8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x38a8('0x4'));var rimraf=require(_0x38a8('0x5'));var config=require('../../config/environment');var attributes=require(_0x38a8('0x6'));module['exports']=function(_0x335eee,_0x504bca){return _0x335eee[_0x38a8('0x7')](_0x38a8('0x8'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cf00072..48e9f4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae79=['options','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','create','body'];(function(_0x6839e1,_0x424ff0){var _0x57cd23=function(_0x35db51){while(--_0x35db51){_0x6839e1['push'](_0x6839e1['shift']());}};_0x57cd23(++_0x424ff0);}(_0xae79,0x1d3));var _0x9ae7=function(_0x418d45,_0x318a82){_0x418d45=_0x418d45-0x0;var _0x5915ea=_0xae79[_0x418d45];return _0x5915ea;};'use strict';var _=require(_0x9ae7('0x0'));var util=require(_0x9ae7('0x1'));var moment=require(_0x9ae7('0x2'));var BPromise=require(_0x9ae7('0x3'));var rs=require(_0x9ae7('0x4'));var fs=require('fs');var Redis=require(_0x9ae7('0x5'));var db=require(_0x9ae7('0x6'))['db'];var utils=require(_0x9ae7('0x7'));var logger=require(_0x9ae7('0x8'))(_0x9ae7('0x9'));var config=require(_0x9ae7('0xa'));var jayson=require(_0x9ae7('0xb'));var client=jayson[_0x9ae7('0xc')][_0x9ae7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x409d34,_0x57114d,_0x2761c2){return new BPromise(function(_0x47774e,_0x3c7738){return client[_0x9ae7('0xe')](_0x409d34,_0x2761c2)[_0x9ae7('0xf')](function(_0xc023d2){logger['info'](_0x9ae7('0x10'),_0x57114d,'request\x20sent');logger[_0x9ae7('0x11')](_0x9ae7('0x12'),_0x57114d,_0x9ae7('0x13'),JSON[_0x9ae7('0x14')](_0xc023d2));if(_0xc023d2[_0x9ae7('0x15')]){if(_0xc023d2[_0x9ae7('0x15')][_0x9ae7('0x16')]===0x1f4){logger['error'](_0x9ae7('0x10'),_0x57114d,_0xc023d2[_0x9ae7('0x15')]['message']);return _0x3c7738(_0xc023d2[_0x9ae7('0x15')][_0x9ae7('0x17')]);}logger[_0x9ae7('0x15')](_0x9ae7('0x10'),_0x57114d,_0xc023d2[_0x9ae7('0x15')][_0x9ae7('0x17')]);return _0x47774e(_0xc023d2[_0x9ae7('0x15')]['message']);}else{logger[_0x9ae7('0x18')](_0x9ae7('0x10'),_0x57114d,_0x9ae7('0x13'));_0x47774e(_0xc023d2[_0x9ae7('0x19')]['message']);}})[_0x9ae7('0x1a')](function(_0xe1a2d1){logger[_0x9ae7('0x15')]('Attachment,\x20%s,\x20%s',_0x57114d,_0xe1a2d1);_0x3c7738(_0xe1a2d1);});});}exports['CreateAttachment']=function(_0x2c7643){var _0x5e69c2=this;return new Promise(function(_0x5d6ad1,_0x5d0635){return db['Attachment'][_0x9ae7('0x1b')](_0x2c7643[_0x9ae7('0x1c')],{'raw':_0x2c7643[_0x9ae7('0x1d')]?_0x2c7643[_0x9ae7('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x9ae7('0xf')](function(_0x1d94fb){logger['info'](_0x9ae7('0x1e'),_0x2c7643);logger['debug'](_0x9ae7('0x1e'),_0x2c7643,JSON[_0x9ae7('0x14')](_0x1d94fb));_0x5d6ad1(_0x1d94fb);})['catch'](function(_0x356559){logger['error']('CreateAttachment',_0x356559[_0x9ae7('0x17')],_0x2c7643);_0x5d0635(_0x5e69c2[_0x9ae7('0x15')](0x1f4,_0x356559[_0x9ae7('0x17')]));});});};
\ No newline at end of file
+var _0x032a=['result','catch','CreateAttachment','Attachment','create','options','raw','then','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x3772a2,_0xd5e57d){var _0x3d1a63=function(_0x44eb28){while(--_0x44eb28){_0x3772a2['push'](_0x3772a2['shift']());}};_0x3d1a63(++_0xd5e57d);}(_0x032a,0xf0));var _0xa032=function(_0x23eb8c,_0x5618e8){_0x23eb8c=_0x23eb8c-0x0;var _0x4978ba=_0x032a[_0x23eb8c];return _0x4978ba;};'use strict';var _=require('lodash');var util=require(_0xa032('0x0'));var moment=require('moment');var BPromise=require(_0xa032('0x1'));var rs=require(_0xa032('0x2'));var fs=require('fs');var Redis=require(_0xa032('0x3'));var db=require(_0xa032('0x4'))['db'];var utils=require(_0xa032('0x5'));var logger=require(_0xa032('0x6'))(_0xa032('0x7'));var config=require(_0xa032('0x8'));var jayson=require(_0xa032('0x9'));var client=jayson[_0xa032('0xa')][_0xa032('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40128a,_0x54275c,_0x616437){return new BPromise(function(_0x4a5d8e,_0x5d0744){return client[_0xa032('0xc')](_0x40128a,_0x616437)['then'](function(_0x18283a){logger[_0xa032('0xd')](_0xa032('0xe'),_0x54275c,_0xa032('0xf'));logger[_0xa032('0x10')]('Attachment,\x20%s,\x20%s,\x20%s',_0x54275c,_0xa032('0xf'),JSON[_0xa032('0x11')](_0x18283a));if(_0x18283a['error']){if(_0x18283a[_0xa032('0x12')][_0xa032('0x13')]===0x1f4){logger[_0xa032('0x12')](_0xa032('0xe'),_0x54275c,_0x18283a[_0xa032('0x12')]['message']);return _0x5d0744(_0x18283a[_0xa032('0x12')][_0xa032('0x14')]);}logger[_0xa032('0x12')](_0xa032('0xe'),_0x54275c,_0x18283a[_0xa032('0x12')][_0xa032('0x14')]);return _0x4a5d8e(_0x18283a[_0xa032('0x12')][_0xa032('0x14')]);}else{logger[_0xa032('0xd')](_0xa032('0xe'),_0x54275c,'request\x20sent');_0x4a5d8e(_0x18283a[_0xa032('0x15')][_0xa032('0x14')]);}})[_0xa032('0x16')](function(_0x2caacd){logger[_0xa032('0x12')](_0xa032('0xe'),_0x54275c,_0x2caacd);_0x5d0744(_0x2caacd);});});}exports[_0xa032('0x17')]=function(_0x577406){var _0xff6817=this;return new Promise(function(_0x54fba7,_0x1d8cf4){return db[_0xa032('0x18')][_0xa032('0x19')](_0x577406['body'],{'raw':_0x577406[_0xa032('0x1a')]?_0x577406['options'][_0xa032('0x1b')]===undefined?!![]:![]:!![]})[_0xa032('0x1c')](function(_0x471757){logger[_0xa032('0xd')](_0xa032('0x17'),_0x577406);logger[_0xa032('0x10')]('CreateAttachment',_0x577406,JSON[_0xa032('0x11')](_0x471757));_0x54fba7(_0x471757);})[_0xa032('0x16')](function(_0x5a817b){logger[_0xa032('0x12')]('CreateAttachment',_0x5a817b[_0xa032('0x14')],_0x577406);_0x1d8cf4(_0xff6817['error'](0x1f4,_0x5a817b[_0xa032('0x14')]));});});};
\ No newline at end of file
index f862d6e..f227d57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x9995a,_0x5aea92){var _0x223f72=function(_0x23e161){while(--_0x23e161){_0x9995a['push'](_0x9995a['shift']());}};_0x223f72(++_0x5aea92);}(_0xb10b,0x12a));var _0xbb10=function(_0xd12233,_0x19c37e){_0xd12233=_0xd12233-0x0;var _0x89aefd=_0xb10b[_0xd12233];return _0x89aefd;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
+var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0x0b0e[_0x1f7201];return _0x289fd2;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
index cd7cb5b..ca7b006 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a9a=['getLicense','catch','status','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','ad-login','passport','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled','blocked','blockedAt','admin','user','domain','add','minutes','clearBlockUser'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0a9a,0x1a7));var _0xa0a9=function(_0x34fba5,_0x4af024){_0x34fba5=_0x34fba5-0x0;var _0x40af30=_0x0a9a[_0x34fba5];return _0x40af30;};'use strict';var passport=require(_0xa0a9('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xa0a9('0x1'));var util=require(_0xa0a9('0x2'));var db=require(_0xa0a9('0x3'))['db'];var authService=require(_0xa0a9('0x4'));var utils=require(_0xa0a9('0x5'));var config=require(_0xa0a9('0x6'));var logger=require('../../config/logger')(_0xa0a9('0x7'));function isActiveDirectoryConfigured(_0xca31fa){var _0x1f4386=![];if(typeof _0xca31fa[_0xa0a9('0x8')]!==_0xa0a9('0x9')){_0x1f4386=_0xca31fa[_0xa0a9('0x8')][_0xa0a9('0xa')]&&_0xca31fa[_0xa0a9('0x8')][_0xa0a9('0xb')]&&_0xca31fa[_0xa0a9('0x8')]['domain'];}return _0x1f4386;}function adAuthenticate(_0x428227,_0x47c943,_0x2e62e7){return new BPromise(function(_0x2bf2e1,_0x2ba763){try{var _0x500c72=new ActiveDirectory(_0x428227);_0x500c72[_0xa0a9('0xc')](_0x47c943,_0x2e62e7,function(_0x1c8921,_0x1ae3e0){if(_0x1c8921){logger[_0xa0a9('0xd')](_0xa0a9('0xe'),_0x47c943,util[_0xa0a9('0xf')](_0x1c8921,{'showHidden':![],'depth':null}));_0x2ba763(_0xa0a9('0x10'));}else if(!_0x1ae3e0){logger['error'](_0xa0a9('0x11'),_0x47c943);_0x2ba763('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2bf2e1(_0x1ae3e0);}});}catch(_0x5e5482){_0x2ba763(_0x5e5482);}});}function ActiveDirectoryAuthenticate(_0x2c8254,_0x5076c0,_0xa88555,_0x43dbc4){var _0x3ba91c,_0x4f901a;if(!isActiveDirectoryConfigured(config)){logger[_0xa0a9('0xd')](_0xa0a9('0x12'),_0x5076c0);return _0x43dbc4(null,![],{'message':_0xa0a9('0x10')});}return db[_0xa0a9('0x13')][_0xa0a9('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xa0a9('0x15')],'raw':!![]})[_0xa0a9('0x16')](function(_0x3fcd6a){_0x3ba91c=_0x3fcd6a;if(!_0x3ba91c[_0xa0a9('0x17')]){logger[_0xa0a9('0xd')](_0xa0a9('0x18'),_0x5076c0);throw new Error(_0xa0a9('0x10'));}return _0x2c8254[_0xa0a9('0x14')]({'attributes':['id',_0xa0a9('0x19'),_0xa0a9('0x1a'),'salt',_0xa0a9('0x1b'),_0xa0a9('0x1c'),_0xa0a9('0x1d'),_0xa0a9('0x1e'),'online'],'where':{'name':_0x5076c0,'role':{'$or':[_0xa0a9('0x1f'),_0xa0a9('0x20'),'agent']},'adSsoEnabled':!![]}});})[_0xa0a9('0x16')](function(_0x44abac){if(!_0x44abac||_0x44abac&&_0x44abac[_0xa0a9('0x19')]!==_0x5076c0){throw new Error(_0xa0a9('0x10'));}_0x4f901a=_0x44abac;var _0x454ced=_0x4f901a[_0xa0a9('0x19')]+'@'+config[_0xa0a9('0x8')][_0xa0a9('0x21')];return adAuthenticate(config[_0xa0a9('0x8')],_0x454ced,_0xa88555);})[_0xa0a9('0x16')](function(_0x4deae4){if(_0x4f901a[_0xa0a9('0x1c')]){throw new Error(_0xa0a9('0x10'));}if(_0x3ba91c[_0xa0a9('0x15')]>0x0){if(_0x4f901a['blocked']){if(moment(_0x4f901a['blockedAt'])[_0xa0a9('0x22')](_0x3ba91c['blockDuration'],_0xa0a9('0x23'))>moment()){throw new Error(_0xa0a9('0x10'));}return utils[_0xa0a9('0x24')](_0x4f901a,0x0,![],null)['then'](function(){return utils[_0xa0a9('0x25')](_0x4f901a);})['then'](function(){return _0x43dbc4(null,_0x4f901a);});}else{return utils['getLicense'](_0x4f901a)[_0xa0a9('0x16')](function(){return _0x43dbc4(null,_0x4f901a);});}}else{return utils[_0xa0a9('0x25')](_0x4f901a)[_0xa0a9('0x16')](function(){return _0x43dbc4(null,_0x4f901a);});}})[_0xa0a9('0x26')](function(_0x3817d1){return _0x43dbc4(null,![],_0x3817d1);});}function handleError(_0x16ed1e,_0x42fe5c,_0x20309d){return _0x16ed1e[_0xa0a9('0x27')](_0x42fe5c||0x1f4)['send']({'message':_0x20309d?_0x20309d[_0xa0a9('0x28')]||_0x20309d:''});}exports[_0xa0a9('0x29')]=function(_0x5a496d,_0x4ba374,_0x30f64b){passport[_0xa0a9('0xc')]('ad-login',function(_0x5663cd,_0x2acfde,_0xfd3185){var _0x4745ef=_0x5663cd||_0xfd3185;if(_0x4745ef){return handleError(_0x4ba374,0x191,_0x4745ef);}if(!_0x2acfde){return handleError(_0x4ba374,0x194,{'message':_0xa0a9('0x2a')});}else{var _0x49fe8b={'payload':{'id':_0x2acfde['id'],'role':_0x2acfde['role']},'options':{'expiresIn':0x15180}};return authService[_0xa0a9('0x2b')](_0x49fe8b)[_0xa0a9('0x16')](function(_0x54d45f){_0x4ba374['json']({'id':_0x2acfde['id'],'token':_0x54d45f,'statusCall':'','isAlreadyLogged':_0x2acfde['online']});});}})(_0x5a496d,_0x4ba374,_0x30f64b);};passport[_0xa0a9('0x2c')](_0xa0a9('0x2d'),new LocalStrategy({'usernameField':'name','passwordField':_0xa0a9('0x1a')},function(_0x254b11,_0x4d584e,_0x14ce36){return ActiveDirectoryAuthenticate(db['User'],_0x254b11,_0x4d584e,_0x14ce36);}));
\ No newline at end of file
+var _0x9fee=['adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','password','salt','role','disabled','blocked','blockedAt','admin','user','agent','name','blockDuration','minutes','clearBlockUser','getLicense','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','User','passport-local','Strategy','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','url','domain','error','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','then'];(function(_0x53664a,_0x127252){var _0x2816e3=function(_0x3c44f5){while(--_0x3c44f5){_0x53664a['push'](_0x53664a['shift']());}};_0x2816e3(++_0x127252);}(_0x9fee,0x1e7));var _0xe9fe=function(_0x2f2744,_0x4525fe){_0x2f2744=_0x2f2744-0x0;var _0x43b6ed=_0x9fee[_0x2f2744];return _0x43b6ed;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xe9fe('0x0'))[_0xe9fe('0x1')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xe9fe('0x2'));var util=require(_0xe9fe('0x3'));var db=require(_0xe9fe('0x4'))['db'];var authService=require(_0xe9fe('0x5'));var utils=require(_0xe9fe('0x6'));var config=require(_0xe9fe('0x7'));var logger=require(_0xe9fe('0x8'))('api');function isActiveDirectoryConfigured(_0x14a512){var _0x317db9=![];if(typeof _0x14a512[_0xe9fe('0x9')]!=='undefined'){_0x317db9=_0x14a512[_0xe9fe('0x9')][_0xe9fe('0xa')]&&_0x14a512[_0xe9fe('0x9')][_0xe9fe('0xb')]&&_0x14a512[_0xe9fe('0x9')][_0xe9fe('0xc')];}return _0x317db9;}function adAuthenticate(_0x124d25,_0x2fb93c,_0x548660){return new BPromise(function(_0x2631c5,_0x3011f4){try{var _0x4cc6ee=new ActiveDirectory(_0x124d25);_0x4cc6ee['authenticate'](_0x2fb93c,_0x548660,function(_0x3a0851,_0x538a20){if(_0x3a0851){logger[_0xe9fe('0xd')]('Error\x20authenticate\x20%s:\x20%s',_0x2fb93c,util[_0xe9fe('0xe')](_0x3a0851,{'showHidden':![],'depth':null}));_0x3011f4('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x538a20){logger['error'](_0xe9fe('0xf'),_0x2fb93c);_0x3011f4(_0xe9fe('0x10'));}else{_0x2631c5(_0x538a20);}});}catch(_0x9bbcbd){_0x3011f4(_0x9bbcbd);}});}function ActiveDirectoryAuthenticate(_0x453bb3,_0x1bf664,_0x4ef5d0,_0x5bd6b4){var _0x4d6f84,_0x9a7ae6;if(!isActiveDirectoryConfigured(config)){logger[_0xe9fe('0xd')](_0xe9fe('0x11'),_0x1bf664);return _0x5bd6b4(null,![],{'message':_0xe9fe('0x10')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})[_0xe9fe('0x12')](function(_0x5cb9ee){_0x4d6f84=_0x5cb9ee;if(!_0x4d6f84[_0xe9fe('0x13')]){logger['error'](_0xe9fe('0x14'),_0x1bf664);throw new Error(_0xe9fe('0x10'));}return _0x453bb3[_0xe9fe('0x15')]({'attributes':['id','name',_0xe9fe('0x16'),_0xe9fe('0x17'),_0xe9fe('0x18'),_0xe9fe('0x19'),_0xe9fe('0x1a'),_0xe9fe('0x1b'),'online'],'where':{'name':_0x1bf664,'role':{'$or':[_0xe9fe('0x1c'),_0xe9fe('0x1d'),_0xe9fe('0x1e')]},'adSsoEnabled':!![]}});})[_0xe9fe('0x12')](function(_0x4e453a){if(!_0x4e453a||_0x4e453a&&_0x4e453a[_0xe9fe('0x1f')]!==_0x1bf664){throw new Error(_0xe9fe('0x10'));}_0x9a7ae6=_0x4e453a;var _0x26f421=_0x9a7ae6[_0xe9fe('0x1f')]+'@'+config[_0xe9fe('0x9')]['domain'];return adAuthenticate(config[_0xe9fe('0x9')],_0x26f421,_0x4ef5d0);})[_0xe9fe('0x12')](function(_0x2794ad){if(_0x9a7ae6[_0xe9fe('0x19')]){throw new Error(_0xe9fe('0x10'));}if(_0x4d6f84['blockDuration']>0x0){if(_0x9a7ae6[_0xe9fe('0x1a')]){if(moment(_0x9a7ae6[_0xe9fe('0x1b')])['add'](_0x4d6f84[_0xe9fe('0x20')],_0xe9fe('0x21'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xe9fe('0x22')](_0x9a7ae6,0x0,![],null)[_0xe9fe('0x12')](function(){return utils[_0xe9fe('0x23')](_0x9a7ae6);})[_0xe9fe('0x12')](function(){return _0x5bd6b4(null,_0x9a7ae6);});}else{return utils[_0xe9fe('0x23')](_0x9a7ae6)[_0xe9fe('0x12')](function(){return _0x5bd6b4(null,_0x9a7ae6);});}}else{return utils[_0xe9fe('0x23')](_0x9a7ae6)[_0xe9fe('0x12')](function(){return _0x5bd6b4(null,_0x9a7ae6);});}})['catch'](function(_0x1dc60f){return _0x5bd6b4(null,![],_0x1dc60f);});}function handleError(_0xf22214,_0x3cb2cf,_0x55e2d2){return _0xf22214['status'](_0x3cb2cf||0x1f4)['send']({'message':_0x55e2d2?_0x55e2d2[_0xe9fe('0x24')]||_0x55e2d2:''});}exports[_0xe9fe('0x25')]=function(_0x25312c,_0x3b84be,_0x3fc57f){passport[_0xe9fe('0x26')](_0xe9fe('0x27'),function(_0x56bbf5,_0x126ebc,_0x92b49e){var _0x513d15=_0x56bbf5||_0x92b49e;if(_0x513d15){return handleError(_0x3b84be,0x191,_0x513d15);}if(!_0x126ebc){return handleError(_0x3b84be,0x194,{'message':_0xe9fe('0x28')});}else{var _0x3fb989={'payload':{'id':_0x126ebc['id'],'role':_0x126ebc[_0xe9fe('0x18')]},'options':{'expiresIn':0x15180}};return authService[_0xe9fe('0x29')](_0x3fb989)[_0xe9fe('0x12')](function(_0x33c51f){_0x3b84be[_0xe9fe('0x2a')]({'id':_0x126ebc['id'],'token':_0x33c51f,'statusCall':'','isAlreadyLogged':_0x126ebc[_0xe9fe('0x2b')]});});}})(_0x25312c,_0x3b84be,_0x3fc57f);};passport[_0xe9fe('0x2c')](_0xe9fe('0x27'),new LocalStrategy({'usernameField':_0xe9fe('0x1f'),'passwordField':_0xe9fe('0x16')},function(_0x48790f,_0x58b81e,_0x96d392){return ActiveDirectoryAuthenticate(db[_0xe9fe('0x2d')],_0x48790f,_0x58b81e,_0x96d392);}));
\ No newline at end of file
index 598efa9..39d0b22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb36d=['Router','./authActiveDirectory.controller','post','login','exports','express'];(function(_0x478d72,_0x2d6b7a){var _0x5ef7cf=function(_0x199aea){while(--_0x199aea){_0x478d72['push'](_0x478d72['shift']());}};_0x5ef7cf(++_0x2d6b7a);}(_0xb36d,0xf5));var _0xdb36=function(_0x2be17a,_0x28d186){_0x2be17a=_0x2be17a-0x0;var _0x2d16f8=_0xb36d[_0x2be17a];return _0x2d16f8;};'use strict';var express=require(_0xdb36('0x0'));var router=express[_0xdb36('0x1')]();var controller=require(_0xdb36('0x2'));router[_0xdb36('0x3')]('/',controller[_0xdb36('0x4')]);module[_0xdb36('0x5')]=router;
\ No newline at end of file
+var _0xc764=['exports','express','./authActiveDirectory.controller','post'];(function(_0x18a74c,_0x5ddfdb){var _0x5dae7f=function(_0x3e3631){while(--_0x3e3631){_0x18a74c['push'](_0x18a74c['shift']());}};_0x5dae7f(++_0x5ddfdb);}(_0xc764,0x191));var _0x4c76=function(_0x2d9d6f,_0x5dd47f){_0x2d9d6f=_0x2d9d6f-0x0;var _0x571297=_0xc764[_0x2d9d6f];return _0x571297;};'use strict';var express=require(_0x4c76('0x0'));var router=express['Router']();var controller=require(_0x4c76('0x1'));router[_0x4c76('0x2')]('/',controller['login']);module[_0x4c76('0x3')]=router;
\ No newline at end of file
index 66312e8..788633c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0xd7683d,_0x3f93a3){var _0x353e45=function(_0x4eb5a1){while(--_0x4eb5a1){_0xd7683d['push'](_0xd7683d['shift']());}};_0x353e45(++_0x3f93a3);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x17045c,_0x470ebe){var _0x844ac5=function(_0x1ce250){while(--_0x1ce250){_0x17045c['push'](_0x17045c['shift']());}};_0x844ac5(++_0x470ebe);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
index b696b77..d3bd268 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd4b=['login','/callback','callback','isMiddleware','Router','./authGoogle.controller','../../components/auth/service','get'];(function(_0x43440a,_0x2a7258){var _0x3a72d2=function(_0x5477f1){while(--_0x5477f1){_0x43440a['push'](_0x43440a['shift']());}};_0x3a72d2(++_0x2a7258);}(_0xdd4b,0xbc));var _0xbdd4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xdd4b[_0x465a0c];return _0x1e202e;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0xbdd4('0x0')]();var controller=require(_0xbdd4('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0xbdd4('0x2'));router[_0xbdd4('0x3')]('/',controller[_0xbdd4('0x4')]);router[_0xbdd4('0x3')](_0xbdd4('0x5'),controller[_0xbdd4('0x6')],authService[_0xbdd4('0x7')],userController[_0xbdd4('0x4')],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
+var _0x1e79=['setTokenCookie','exports','express','passport','Router','../user/user.controller.js','../../components/auth/service','get','callback','isMiddleware','login'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1e79,0xff));var _0x91e7=function(_0x5a76f2,_0x19b1a8){_0x5a76f2=_0x5a76f2-0x0;var _0x5a3485=_0x1e79[_0x5a76f2];return _0x5a3485;};'use strict';var express=require(_0x91e7('0x0'));var passport=require(_0x91e7('0x1'));var router=express[_0x91e7('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x91e7('0x3'));var authService=require(_0x91e7('0x4'));router[_0x91e7('0x5')]('/',controller['login']);router[_0x91e7('0x5')]('/callback',controller[_0x91e7('0x6')],authService[_0x91e7('0x7')],userController[_0x91e7('0x8')],authService[_0x91e7('0x9')]);module[_0x91e7('0xa')]=router;
\ No newline at end of file
index 211dd57..3edadec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x672c=['authenticate','blockDuration','add','minutes','clearBlockUser','disabled','blockedAt','getLicense','catch','MailAccount','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','SendMail','error','message','stringify','status','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','body','trim','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','previousPasswords','passwordHistoryLimit','Password\x20reset!','use','User','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','then','name','password','blocked','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x104112,_0x342eb6){var _0x394ab4=function(_0x48db18){while(--_0x48db18){_0x104112['push'](_0x104112['shift']());}};_0x394ab4(++_0x342eb6);}(_0x672c,0xda));var _0xc672=function(_0x5ac3e1,_0x23bf49){_0x5ac3e1=_0x5ac3e1-0x0;var _0x54873a=_0x672c[_0x5ac3e1];return _0x54873a;};'use strict';var util=require(_0xc672('0x0'));var passport=require(_0xc672('0x1'));var LocalStrategy=require(_0xc672('0x2'))[_0xc672('0x3')];var jayson=require(_0xc672('0x4'));var _=require(_0xc672('0x5'));var rs=require(_0xc672('0x6'));var moment=require('moment');var db=require(_0xc672('0x7'))['db'];var authService=require(_0xc672('0x8'));var utils=require(_0xc672('0x9'));var client=jayson[_0xc672('0xa')][_0xc672('0xb')]({'port':0x232b});function localAuthenticate(_0x28395c,_0x5d42d8,_0x570ab2,_0x5def36){var _0x3f6973,_0x4e359b;return db['Setting'][_0xc672('0xc')]({'where':{'id':0x1},'attributes':[_0xc672('0xd'),'blockDuration'],'raw':!![]})[_0xc672('0xe')](function(_0x5f1936){_0x3f6973=_0x5f1936;return _0x28395c[_0xc672('0xc')]({'attributes':['id',_0xc672('0xf'),_0xc672('0x10'),'salt','role','disabled',_0xc672('0x11'),'blockedAt',_0xc672('0x12')],'where':{'name':_0x5d42d8,'role':{'$or':['admin',_0xc672('0x13'),_0xc672('0x14')]}}});})[_0xc672('0xe')](function(_0x37d8d5){if(!_0x37d8d5||_0x37d8d5&&_0x37d8d5['name']!==_0x5d42d8){throw new Error(_0xc672('0x15'));}else{_0x4e359b=_0x37d8d5;return _0x4e359b;}})[_0xc672('0xe')](function(){_0x4e359b[_0xc672('0x16')](_0x570ab2,function(_0x20325c,_0x55df98){var _0x1059fb=_0x4e359b[_0xc672('0x12')]+0x1;if(_0x20325c){return _0x5def36(_0x20325c);}else if(!_0x55df98){if(_0x4e359b['disabled']){return _0x5def36(null,![],{'message':_0xc672('0x15')});}else if(_0x3f6973[_0xc672('0xd')]>0x0){if(_0x4e359b[_0xc672('0x11')]){if(_0x3f6973[_0xc672('0x17')]>0x0){if(moment(_0x4e359b['blockedAt'])[_0xc672('0x18')](_0x3f6973[_0xc672('0x17')],_0xc672('0x19'))>moment()){return _0x5def36(null,![],{'message':_0xc672('0x15')});}else{return utils[_0xc672('0x1a')](_0x4e359b,_0x1059fb,![],null)[_0xc672('0xe')](function(){return _0x5def36(null,![],{'message':_0xc672('0x15')});});}}else{return _0x5def36(null,![],{'message':_0xc672('0x15')});}}else{if(_0x1059fb>=_0x3f6973[_0xc672('0xd')]){return utils[_0xc672('0x1a')](_0x4e359b,0x0,!![],moment())[_0xc672('0xe')](function(){return _0x5def36(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xc672('0x1a')](_0x4e359b,_0x1059fb,![],null)['then'](function(){return _0x5def36(null,![],{'message':_0xc672('0x15')});});}}}else{return _0x5def36(null,![],{'message':_0xc672('0x15')});}}else{if(_0x4e359b[_0xc672('0x1b')]){return _0x5def36(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3f6973[_0xc672('0xd')]>0x0){if(_0x4e359b[_0xc672('0x11')]){if(_0x3f6973[_0xc672('0x17')]>0x0){if(moment(_0x4e359b[_0xc672('0x1c')])[_0xc672('0x18')](_0x3f6973[_0xc672('0x17')],_0xc672('0x19'))>moment()){return _0x5def36(null,![],{'message':_0xc672('0x15')});}else{return utils[_0xc672('0x1a')](_0x4e359b,0x0,![],null)[_0xc672('0xe')](function(){return utils['getLicense'](_0x4e359b);})[_0xc672('0xe')](function(){return _0x5def36(null,_0x4e359b);});}}else{return _0x5def36(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xc672('0x1a')](_0x4e359b,0x0,![],null)[_0xc672('0xe')](function(){return utils[_0xc672('0x1d')](_0x4e359b);})[_0xc672('0xe')](function(){return _0x5def36(null,_0x4e359b);})[_0xc672('0x1e')](function(_0x1325df){return _0x5def36(null,![],_0x1325df);});}}else{if(_0x4e359b[_0xc672('0x11')]){return _0x5def36(null,![],{'message':_0xc672('0x15')});}else{return utils[_0xc672('0x1d')](_0x4e359b)[_0xc672('0xe')](function(){return _0x5def36(null,_0x4e359b);});}}}});})[_0xc672('0x1e')](function(_0x3752e0){return _0x5def36(null,![],_0x3752e0);});}function sendServiceMail(_0x5be0e4){return db[_0xc672('0x1f')][_0xc672('0x20')]({'where':{'service':!![]},'attributes':['id',_0xc672('0xf'),_0xc672('0x21')],'include':[{'model':db[_0xc672('0x22')],'as':'Smtp','include':[{'model':db[_0xc672('0x23')],'as':'CloudProvider'}]}]})[_0xc672('0xe')](function(_0x22e7dd){if(!_0x22e7dd){throw new Error(_0xc672('0x24'));}var _0x4b272b=_0x22e7dd[_0xc672('0x25')]();var _0x4e7363={'account':_0x4b272b,'message':_[_0xc672('0x26')]({'from':util[_0xc672('0x27')](_0xc672('0x28'),_0x22e7dd[_0xc672('0xf')],_0x22e7dd[_0xc672('0x21')]||_0x22e7dd[_0xc672('0x29')][_0xc672('0x13')])},_0x5be0e4)};return client['request'](_0xc672('0x2a'),_0x4e7363);})[_0xc672('0xe')](function(_0x570797){if(_0x570797[_0xc672('0x2b')]){throw new Error(util[_0xc672('0x27')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x570797[_0xc672('0x2b')][_0xc672('0x2c')]||JSON[_0xc672('0x2d')](_0x570797[_0xc672('0x2b')])));}return!![];});}function handleError(_0x250a16,_0x493098,_0x64b38f){return _0x250a16[_0xc672('0x2e')](_0x493098||0x1f4)[_0xc672('0x2f')]({'message':_0x64b38f?_0x64b38f['message']||_0x64b38f:''});}exports['login']=function(_0x1b2a3a,_0x1321e6,_0x5eb5f8){passport[_0xc672('0x16')](_0xc672('0x30'),function(_0x474735,_0x2e6691,_0x5bcde7){var _0x26c84e=_0x474735||_0x5bcde7;if(_0x26c84e){return handleError(_0x1321e6,0x191,_0x26c84e);}if(!_0x2e6691){return handleError(_0x1321e6,0x194,{'message':_0xc672('0x31')});}else{var _0x34b48f={'payload':{'id':_0x2e6691['id'],'role':_0x2e6691[_0xc672('0x32')]},'options':{'expiresIn':0x15180}};return authService[_0xc672('0x33')](_0x34b48f)[_0xc672('0xe')](function(_0x1854c4){_0x1321e6[_0xc672('0x34')]({'id':_0x2e6691['id'],'token':_0x1854c4,'statusCall':'','isAlreadyLogged':_0x2e6691[_0xc672('0x35')]});});}})(_0x1b2a3a,_0x1321e6,_0x5eb5f8);};exports[_0xc672('0x36')]=function(_0x5c7c33,_0x2b8f2a){if(!_0x5c7c33['body'][_0xc672('0x21')]){return handleError(_0x2b8f2a,0x1f4,{'message':_0xc672('0x37')});}var _0x3c3d69=rs['generate']();_0x5c7c33[_0xc672('0x38')][_0xc672('0x21')]=_0x5c7c33[_0xc672('0x38')]['email'][_0xc672('0x39')]()[_0xc672('0x3a')]();var _0x452492;return db['Setting'][_0xc672('0xc')]({'where':{'id':0x1},'attributes':[_0xc672('0xd'),_0xc672('0x17')],'raw':!![]})[_0xc672('0xe')](function(_0x313064){_0x452492=_0x313064;return db['User'][_0xc672('0x20')]({'where':{'email':_0x5c7c33[_0xc672('0x38')][_0xc672('0x21')]}});})[_0xc672('0xe')](function(_0x59b9fa){if(!_0x59b9fa){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x59b9fa[_0xc672('0x1b')]){throw new Error(_0xc672('0x3b'));}if(_0x59b9fa[_0xc672('0x11')]){if(moment(_0x59b9fa[_0xc672('0x1c')])[_0xc672('0x18')](_0x452492[_0xc672('0x17')],_0xc672('0x19'))>moment()){throw new Error(_0xc672('0x3c'));}else{_0x59b9fa['blocked']=![];_0x59b9fa['blockedAt']=null;}}_0x59b9fa[_0xc672('0x3d')]=_0x3c3d69;_0x59b9fa[_0xc672('0x3e')]=Date[_0xc672('0x3f')]()+0x36ee80;return _0x59b9fa[_0xc672('0x40')]();})[_0xc672('0xe')](function(){return sendServiceMail({'to':_0x5c7c33[_0xc672('0x38')][_0xc672('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xc672('0x41')+_0xc672('0x42')+_0xc672('0x43')+_0x5c7c33['headers']['host']+_0xc672('0x44')+_0x3c3d69+'\x0a\x0a'+_0xc672('0x45')});})[_0xc672('0xe')](function(){_0x2b8f2a[_0xc672('0x2e')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0xc672('0x1e')](function(_0x3fd5c6){return handleError(_0x2b8f2a,0x1f4,_0x3fd5c6);});};exports[_0xc672('0x46')]=function(_0x5c4d4f,_0x200250){return db['User'][_0xc672('0x20')]({'where':{'resetPasswordToken':_0x5c4d4f[_0xc672('0x47')][_0xc672('0x48')],'resetPasswordExpires':{'$gt':Date[_0xc672('0x3f')]()}}})[_0xc672('0xe')](function(_0x1fd840){if(!_0x1fd840){throw new Error(_0xc672('0x49'));}return db['Setting'][_0xc672('0xc')]({'attributes':['id','securePassword',_0xc672('0x4a'),'passwordHistoryLimit']})[_0xc672('0xe')](function(_0x1085f8){if(_0x1085f8['securePassword'])authService['validatePasswordPattern'](_0x5c4d4f['body'][_0xc672('0x10')]);if(!_0x1085f8[_0xc672('0x4a')]||!_0x1fd840[_0xc672('0x4b')])return _0x1fd840;authService['validatePasswordHistory'](_0x5c4d4f[_0xc672('0x38')]['password'],_0x1fd840[_0xc672('0x4b')],_0x1085f8[_0xc672('0x4c')]);return _0x1fd840;})[_0xc672('0xe')](function(){_0x1fd840[_0xc672('0x10')]=_0x5c4d4f[_0xc672('0x38')][_0xc672('0x10')];_0x1fd840[_0xc672('0x3d')]=null;_0x1fd840[_0xc672('0x3e')]=null;return _0x1fd840[_0xc672('0x40')]();});})[_0xc672('0xe')](function(){_0x200250[_0xc672('0x2e')](0xc8)[_0xc672('0x2f')]({'message':_0xc672('0x4d')});})['catch'](function(_0x2e84c5){return handleError(_0x200250,0x1f4,_0x2e84c5);});};passport[_0xc672('0x4e')]('local-login',new LocalStrategy({'usernameField':_0xc672('0xf'),'passwordField':_0xc672('0x10')},function(_0x1e778c,_0x1c888,_0x35328f){return localAuthenticate(db[_0xc672('0x4f')],_0x1e778c,_0x1c888,_0x35328f);}));
\ No newline at end of file
+var _0xa1b9=['forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','reset','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','use','util','Strategy','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','online'];(function(_0x39842f,_0x323e5a){var _0x4baf33=function(_0x21eb8b){while(--_0x21eb8b){_0x39842f['push'](_0x39842f['shift']());}};_0x4baf33(++_0x323e5a);}(_0xa1b9,0x155));var _0x9a1b=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa1b9[_0x12d033];return _0x3b4e80;};'use strict';var util=require(_0x9a1b('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0x9a1b('0x1')];var jayson=require(_0x9a1b('0x2'));var _=require('lodash');var rs=require(_0x9a1b('0x3'));var moment=require('moment');var db=require(_0x9a1b('0x4'))['db'];var authService=require(_0x9a1b('0x5'));var utils=require('../../config/utils');var client=jayson['client'][_0x9a1b('0x6')]({'port':0x232b});function localAuthenticate(_0x4b9621,_0x467643,_0x30c00f,_0x344dbd){var _0x4522d5,_0x23cb51;return db[_0x9a1b('0x7')][_0x9a1b('0x8')]({'where':{'id':0x1},'attributes':[_0x9a1b('0x9'),_0x9a1b('0xa')],'raw':!![]})[_0x9a1b('0xb')](function(_0xe0f8d5){_0x4522d5=_0xe0f8d5;return _0x4b9621[_0x9a1b('0x8')]({'attributes':['id',_0x9a1b('0xc'),_0x9a1b('0xd'),'salt',_0x9a1b('0xe'),_0x9a1b('0xf'),_0x9a1b('0x10'),_0x9a1b('0x11'),_0x9a1b('0x12')],'where':{'name':_0x467643,'role':{'$or':[_0x9a1b('0x13'),_0x9a1b('0x14'),_0x9a1b('0x15')]}}});})['then'](function(_0x339457){if(!_0x339457||_0x339457&&_0x339457['name']!==_0x467643){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x23cb51=_0x339457;return _0x23cb51;}})[_0x9a1b('0xb')](function(){_0x23cb51[_0x9a1b('0x16')](_0x30c00f,function(_0x11aebf,_0x3db217){var _0x448307=_0x23cb51[_0x9a1b('0x12')]+0x1;if(_0x11aebf){return _0x344dbd(_0x11aebf);}else if(!_0x3db217){if(_0x23cb51['disabled']){return _0x344dbd(null,![],{'message':_0x9a1b('0x17')});}else if(_0x4522d5[_0x9a1b('0x9')]>0x0){if(_0x23cb51['blocked']){if(_0x4522d5[_0x9a1b('0xa')]>0x0){if(moment(_0x23cb51[_0x9a1b('0x11')])[_0x9a1b('0x18')](_0x4522d5[_0x9a1b('0xa')],'minutes')>moment()){return _0x344dbd(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x9a1b('0x19')](_0x23cb51,_0x448307,![],null)[_0x9a1b('0xb')](function(){return _0x344dbd(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x344dbd(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x448307>=_0x4522d5[_0x9a1b('0x9')]){return utils[_0x9a1b('0x19')](_0x23cb51,0x0,!![],moment())['then'](function(){return _0x344dbd(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x9a1b('0x19')](_0x23cb51,_0x448307,![],null)[_0x9a1b('0xb')](function(){return _0x344dbd(null,![],{'message':_0x9a1b('0x17')});});}}}else{return _0x344dbd(null,![],{'message':_0x9a1b('0x17')});}}else{if(_0x23cb51[_0x9a1b('0xf')]){return _0x344dbd(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4522d5['allowedLoginAttempts']>0x0){if(_0x23cb51[_0x9a1b('0x10')]){if(_0x4522d5[_0x9a1b('0xa')]>0x0){if(moment(_0x23cb51['blockedAt'])['add'](_0x4522d5['blockDuration'],_0x9a1b('0x1a'))>moment()){return _0x344dbd(null,![],{'message':_0x9a1b('0x17')});}else{return utils[_0x9a1b('0x19')](_0x23cb51,0x0,![],null)['then'](function(){return utils[_0x9a1b('0x1b')](_0x23cb51);})[_0x9a1b('0xb')](function(){return _0x344dbd(null,_0x23cb51);});}}else{return _0x344dbd(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x9a1b('0x19')](_0x23cb51,0x0,![],null)[_0x9a1b('0xb')](function(){return utils[_0x9a1b('0x1b')](_0x23cb51);})[_0x9a1b('0xb')](function(){return _0x344dbd(null,_0x23cb51);})[_0x9a1b('0x1c')](function(_0x416176){return _0x344dbd(null,![],_0x416176);});}}else{if(_0x23cb51['blocked']){return _0x344dbd(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x9a1b('0x1b')](_0x23cb51)['then'](function(){return _0x344dbd(null,_0x23cb51);});}}}});})[_0x9a1b('0x1c')](function(_0x3aa814){return _0x344dbd(null,![],_0x3aa814);});}function sendServiceMail(_0x12b3cb){return db[_0x9a1b('0x1d')][_0x9a1b('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x9a1b('0xc'),_0x9a1b('0x1f')],'include':[{'model':db[_0x9a1b('0x20')],'as':_0x9a1b('0x21'),'include':[{'model':db[_0x9a1b('0x22')],'as':_0x9a1b('0x22')}]}]})[_0x9a1b('0xb')](function(_0x2dc711){if(!_0x2dc711){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x2a3e4b=_0x2dc711[_0x9a1b('0x23')]();var _0x2af1f8={'account':_0x2a3e4b,'message':_[_0x9a1b('0x24')]({'from':util[_0x9a1b('0x25')]('\x22%s\x22\x20<%s>',_0x2dc711[_0x9a1b('0xc')],_0x2dc711[_0x9a1b('0x1f')]||_0x2dc711['Smtp'][_0x9a1b('0x14')])},_0x12b3cb)};return client[_0x9a1b('0x26')](_0x9a1b('0x27'),_0x2af1f8);})[_0x9a1b('0xb')](function(_0x441fdc){if(_0x441fdc[_0x9a1b('0x28')]){throw new Error(util[_0x9a1b('0x25')](_0x9a1b('0x29'),_0x441fdc[_0x9a1b('0x28')][_0x9a1b('0x2a')]||JSON[_0x9a1b('0x2b')](_0x441fdc['error'])));}return!![];});}function handleError(_0x3c717c,_0x175ead,_0x5551f9){return _0x3c717c[_0x9a1b('0x2c')](_0x175ead||0x1f4)[_0x9a1b('0x2d')]({'message':_0x5551f9?_0x5551f9[_0x9a1b('0x2a')]||_0x5551f9:''});}exports['login']=function(_0x51c44f,_0x244241,_0x5d61f4){passport['authenticate'](_0x9a1b('0x2e'),function(_0x2eb770,_0x558e3f,_0xe883e9){var _0xdf9404=_0x2eb770||_0xe883e9;if(_0xdf9404){return handleError(_0x244241,0x191,_0xdf9404);}if(!_0x558e3f){return handleError(_0x244241,0x194,{'message':_0x9a1b('0x2f')});}else{var _0x3a1dd8={'payload':{'id':_0x558e3f['id'],'role':_0x558e3f[_0x9a1b('0xe')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3a1dd8)[_0x9a1b('0xb')](function(_0x4c4d0a){_0x244241['json']({'id':_0x558e3f['id'],'token':_0x4c4d0a,'statusCall':'','isAlreadyLogged':_0x558e3f[_0x9a1b('0x30')]});});}})(_0x51c44f,_0x244241,_0x5d61f4);};exports[_0x9a1b('0x31')]=function(_0x902a68,_0x235975){if(!_0x902a68[_0x9a1b('0x32')]['email']){return handleError(_0x235975,0x1f4,{'message':_0x9a1b('0x33')});}var _0x95881b=rs[_0x9a1b('0x34')]();_0x902a68['body']['email']=_0x902a68['body'][_0x9a1b('0x1f')][_0x9a1b('0x35')]()['toLowerCase']();var _0x5014f8;return db['Setting'][_0x9a1b('0x8')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x9a1b('0xa')],'raw':!![]})['then'](function(_0x194e2e){_0x5014f8=_0x194e2e;return db[_0x9a1b('0x36')][_0x9a1b('0x1e')]({'where':{'email':_0x902a68[_0x9a1b('0x32')][_0x9a1b('0x1f')]}});})[_0x9a1b('0xb')](function(_0x3ffa1f){if(!_0x3ffa1f){throw new Error(_0x9a1b('0x37'));}if(_0x3ffa1f['disabled']){throw new Error(_0x9a1b('0x38'));}if(_0x3ffa1f[_0x9a1b('0x10')]){if(moment(_0x3ffa1f[_0x9a1b('0x11')])[_0x9a1b('0x18')](_0x5014f8['blockDuration'],_0x9a1b('0x1a'))>moment()){throw new Error(_0x9a1b('0x39'));}else{_0x3ffa1f[_0x9a1b('0x10')]=![];_0x3ffa1f[_0x9a1b('0x11')]=null;}}_0x3ffa1f['resetPasswordToken']=_0x95881b;_0x3ffa1f[_0x9a1b('0x3a')]=Date[_0x9a1b('0x3b')]()+0x36ee80;return _0x3ffa1f[_0x9a1b('0x3c')]();})[_0x9a1b('0xb')](function(){return sendServiceMail({'to':_0x902a68[_0x9a1b('0x32')]['email'],'subject':_0x9a1b('0x3d'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x9a1b('0x3e')+_0x9a1b('0x3f')+_0x902a68[_0x9a1b('0x40')][_0x9a1b('0x41')]+_0x9a1b('0x42')+_0x95881b+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x9a1b('0xb')](function(){_0x235975[_0x9a1b('0x2c')](0xc8)[_0x9a1b('0x2d')]({'message':'Reset\x20Email\x20sent!'});})[_0x9a1b('0x1c')](function(_0x24a7eb){return handleError(_0x235975,0x1f4,_0x24a7eb);});};exports[_0x9a1b('0x43')]=function(_0x48c550,_0x4e173b){return db[_0x9a1b('0x36')][_0x9a1b('0x1e')]({'where':{'resetPasswordToken':_0x48c550['params'][_0x9a1b('0x44')],'resetPasswordExpires':{'$gt':Date[_0x9a1b('0x3b')]()}}})[_0x9a1b('0xb')](function(_0x20f87b){if(!_0x20f87b){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x9a1b('0x8')]({'attributes':['id',_0x9a1b('0x45'),_0x9a1b('0x46'),_0x9a1b('0x47')]})[_0x9a1b('0xb')](function(_0x5c0ef6){if(_0x5c0ef6[_0x9a1b('0x45')])authService[_0x9a1b('0x48')](_0x48c550['body'][_0x9a1b('0xd')]);if(!_0x5c0ef6['enforcePasswordHistory']||!_0x20f87b[_0x9a1b('0x49')])return _0x20f87b;authService[_0x9a1b('0x4a')](_0x48c550[_0x9a1b('0x32')][_0x9a1b('0xd')],_0x20f87b['previousPasswords'],_0x5c0ef6[_0x9a1b('0x47')]);return _0x20f87b;})[_0x9a1b('0xb')](function(){_0x20f87b[_0x9a1b('0xd')]=_0x48c550['body'][_0x9a1b('0xd')];_0x20f87b[_0x9a1b('0x4b')]=null;_0x20f87b[_0x9a1b('0x3a')]=null;return _0x20f87b[_0x9a1b('0x3c')]();});})['then'](function(){_0x4e173b[_0x9a1b('0x2c')](0xc8)['send']({'message':_0x9a1b('0x4c')});})[_0x9a1b('0x1c')](function(_0x45ded7){return handleError(_0x4e173b,0x1f4,_0x45ded7);});};passport[_0x9a1b('0x4d')](_0x9a1b('0x2e'),new LocalStrategy({'usernameField':_0x9a1b('0xc'),'passwordField':_0x9a1b('0xd')},function(_0x16ca92,_0x1eaeba,_0x2419a3){return localAuthenticate(db[_0x9a1b('0x36')],_0x16ca92,_0x1eaeba,_0x2419a3);}));
\ No newline at end of file
index df99256..4f52f42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e4e=['express','Router','./authLocal.controller','post','/forgot','forgot','/reset/:token','reset'];(function(_0x5ed0c9,_0x6ba17c){var _0x26a3ce=function(_0x31cac0){while(--_0x31cac0){_0x5ed0c9['push'](_0x5ed0c9['shift']());}};_0x26a3ce(++_0x6ba17c);}(_0x6e4e,0x98));var _0xe6e4=function(_0x449fd,_0x456222){_0x449fd=_0x449fd-0x0;var _0x3a4fb1=_0x6e4e[_0x449fd];return _0x3a4fb1;};'use strict';var express=require(_0xe6e4('0x0'));var router=express[_0xe6e4('0x1')]();var controller=require(_0xe6e4('0x2'));router[_0xe6e4('0x3')]('/',controller['login']);router['post'](_0xe6e4('0x4'),controller[_0xe6e4('0x5')]);router['post'](_0xe6e4('0x6'),controller[_0xe6e4('0x7')]);module['exports']=router;
\ No newline at end of file
+var _0x5340=['./authLocal.controller','post','login','/forgot','forgot','/reset/:token','exports','express','Router'];(function(_0x2bfa35,_0x4f3960){var _0x42ad5a=function(_0x2e72f5){while(--_0x2e72f5){_0x2bfa35['push'](_0x2bfa35['shift']());}};_0x42ad5a(++_0x4f3960);}(_0x5340,0xc4));var _0x0534=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5340[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x0534('0x0'));var router=express[_0x0534('0x1')]();var controller=require(_0x0534('0x2'));router[_0x0534('0x3')]('/',controller[_0x0534('0x4')]);router[_0x0534('0x3')](_0x0534('0x5'),controller[_0x0534('0x6')]);router['post'](_0x0534('0x7'),controller['reset']);module[_0x0534('0x8')]=router;
\ No newline at end of file
index a123f11..83214b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8496=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x4dc99d,_0x4bbe75){var _0x5ea055=function(_0x1ebeb0){while(--_0x1ebeb0){_0x4dc99d['push'](_0x4dc99d['shift']());}};_0x5ea055(++_0x4bbe75);}(_0x8496,0xe5));var _0x6849=function(_0x599200,_0x3eb01f){_0x599200=_0x599200-0x0;var _0x181228=_0x8496[_0x599200];return _0x181228;};'use strict';var Sequelize=require(_0x6849('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x6849('0x1')]},'description':{'type':Sequelize[_0x6849('0x1')]},'status':{'type':Sequelize[_0x6849('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6849('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x9013=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4b3cd2,_0x503175){var _0x46315a=function(_0x5ddfb7){while(--_0x5ddfb7){_0x4b3cd2['push'](_0x4b3cd2['shift']());}};_0x46315a(++_0x503175);}(_0x9013,0x1d3));var _0x3901=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x9013[_0xa148b7];return _0x51efd3;};'use strict';var Sequelize=require(_0x3901('0x0'));module[_0x3901('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x3901('0x2')]},'description':{'type':Sequelize[_0x3901('0x2')]},'status':{'type':Sequelize[_0x3901('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
index 3ba7c92..4833ed7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe244=['omit','findOne','getConditions','addActions','Action','getActions','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','Automation','rawAttributes','fieldName','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','params','length','includeAll','find','create','body','addConditions','Condition','ids'];(function(_0x480063,_0x4ef5f9){var _0x5a9ebc=function(_0x1548fe){while(--_0x1548fe){_0x480063['push'](_0x480063['shift']());}};_0x5a9ebc(++_0x4ef5f9);}(_0xe244,0x15b));var _0x4e24=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe244[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x4e24('0x0'));var rimraf=require(_0x4e24('0x1'));var zipdir=require(_0x4e24('0x2'));var jsonpatch=require(_0x4e24('0x3'));var rp=require(_0x4e24('0x4'));var moment=require(_0x4e24('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4e24('0x6'));var util=require('util');var path=require(_0x4e24('0x7'));var sox=require('sox');var csv=require(_0x4e24('0x8'));var ejs=require(_0x4e24('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4e24('0xa'));var squel=require(_0x4e24('0xb'));var crypto=require(_0x4e24('0xc'));var jsforce=require(_0x4e24('0xd'));var deskjs=require(_0x4e24('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4e24('0xf'));var Papa=require('papaparse');var Redis=require(_0x4e24('0x10'));var authService=require(_0x4e24('0x11'));var qs=require(_0x4e24('0x12'));var as=require(_0x4e24('0x13'));var hardwareService=require(_0x4e24('0x14'));var logger=require(_0x4e24('0x15'))(_0x4e24('0x16'));var utils=require(_0x4e24('0x17'));var config=require(_0x4e24('0x18'));var licenseUtil=require(_0x4e24('0x19'));var db=require(_0x4e24('0x1a'))['db'];function respondWithStatusCode(_0x2a5877,_0x4056da){_0x4056da=_0x4056da||0xcc;return function(_0x46db2d){if(_0x46db2d){return _0x2a5877['sendStatus'](_0x4056da);}return _0x2a5877[_0x4e24('0x1b')](_0x4056da)['end']();};}function respondWithResult(_0x51ee3b,_0x358322){_0x358322=_0x358322||0xc8;return function(_0x4ad232){if(_0x4ad232){return _0x51ee3b[_0x4e24('0x1b')](_0x358322)['json'](_0x4ad232);}};}function respondWithFilteredResult(_0x52bb84,_0x362717){return function(_0x2d4e27){if(_0x2d4e27){var _0x161f33=typeof _0x362717[_0x4e24('0x1c')]===_0x4e24('0x1d')&&typeof _0x362717[_0x4e24('0x1e')]===_0x4e24('0x1d');var _0x374e35=_0x2d4e27['count'];var _0x593b24=_0x161f33?0x0:_0x362717[_0x4e24('0x1c')];var _0x5e7b92=_0x161f33?_0x2d4e27[_0x4e24('0x1f')]:_0x362717[_0x4e24('0x1c')]+_0x362717[_0x4e24('0x1e')];var _0x536805;if(_0x5e7b92>=_0x374e35){_0x5e7b92=_0x374e35;_0x536805=0xc8;}else{_0x536805=0xce;}_0x52bb84[_0x4e24('0x1b')](_0x536805);return _0x52bb84[_0x4e24('0x20')](_0x4e24('0x21'),_0x593b24+'-'+_0x5e7b92+'/'+_0x374e35)[_0x4e24('0x22')](_0x2d4e27);}return null;};}function patchUpdates(_0x5ca90c){return function(_0x1a349e){try{jsonpatch[_0x4e24('0x23')](_0x1a349e,_0x5ca90c,!![]);}catch(_0x4e599e){return BPromise['reject'](_0x4e599e);}return _0x1a349e[_0x4e24('0x24')]();};}function saveUpdates(_0x156cc7,_0x49f679){return function(_0x26fa67){if(_0x26fa67){return _0x26fa67[_0x4e24('0x25')](_0x156cc7)[_0x4e24('0x26')](function(_0x1b5ec3){return _0x1b5ec3;});}return null;};}function removeEntity(_0x59137d,_0x3448bd){return function(_0xe7e147){if(_0xe7e147){return _0xe7e147[_0x4e24('0x27')]()[_0x4e24('0x26')](function(){_0x59137d[_0x4e24('0x1b')](0xcc)[_0x4e24('0x28')]();});}};}function handleEntityNotFound(_0x177fcd,_0x40e1f8){return function(_0x3e3ec0){if(!_0x3e3ec0){_0x177fcd[_0x4e24('0x29')](0x194);}return _0x3e3ec0;};}function handleError(_0x2006f1,_0x55a8e5){_0x55a8e5=_0x55a8e5||0x1f4;return function(_0x14fcda){logger[_0x4e24('0x2a')](_0x14fcda[_0x4e24('0x2b')]);if(_0x14fcda[_0x4e24('0x2c')]){delete _0x14fcda[_0x4e24('0x2c')];}_0x2006f1[_0x4e24('0x1b')](_0x55a8e5)[_0x4e24('0x2d')](_0x14fcda);};}exports['index']=function(_0x3c82bc,_0x49ab76){var _0x514ef2={},_0x45b82e={},_0x5a7709={'count':0x0,'rows':[]};var _0x130933=_[_0x4e24('0x2e')](db[_0x4e24('0x2f')][_0x4e24('0x30')],function(_0x3cebbf){return{'name':_0x3cebbf[_0x4e24('0x31')],'type':_0x3cebbf['type']['key']};});_0x45b82e['model']=_[_0x4e24('0x2e')](_0x130933,_0x4e24('0x2c'));_0x45b82e['query']=_[_0x4e24('0x32')](_0x3c82bc[_0x4e24('0x33')]);_0x45b82e[_0x4e24('0x34')]=_[_0x4e24('0x35')](_0x45b82e[_0x4e24('0x36')],_0x45b82e[_0x4e24('0x33')]);_0x514ef2[_0x4e24('0x37')]=_[_0x4e24('0x35')](_0x45b82e['model'],qs[_0x4e24('0x38')](_0x3c82bc[_0x4e24('0x33')]['fields']));_0x514ef2[_0x4e24('0x37')]=_0x514ef2[_0x4e24('0x37')]['length']?_0x514ef2[_0x4e24('0x37')]:_0x45b82e[_0x4e24('0x36')];if(!_0x3c82bc[_0x4e24('0x33')]['hasOwnProperty'](_0x4e24('0x39'))){_0x514ef2[_0x4e24('0x1e')]=qs['limit'](_0x3c82bc[_0x4e24('0x33')]['limit']);_0x514ef2['offset']=qs['offset'](_0x3c82bc[_0x4e24('0x33')]['offset']);}_0x514ef2[_0x4e24('0x3a')]=qs[_0x4e24('0x3b')](_0x3c82bc[_0x4e24('0x33')][_0x4e24('0x3b')]);_0x514ef2[_0x4e24('0x3c')]=qs[_0x4e24('0x34')](_[_0x4e24('0x3d')](_0x3c82bc[_0x4e24('0x33')],_0x45b82e['filters']),_0x130933);if(_0x3c82bc['query'][_0x4e24('0x3e')]){_0x514ef2[_0x4e24('0x3c')]=_['merge'](_0x514ef2[_0x4e24('0x3c')],{'$or':_['map'](_0x130933,function(_0x53affc){if(_0x53affc['type']!==_0x4e24('0x3f')){var _0x59bd62={};_0x59bd62[_0x53affc[_0x4e24('0x2c')]]={'$like':'%'+_0x3c82bc['query'][_0x4e24('0x3e')]+'%'};return _0x59bd62;}})});}_0x514ef2=_[_0x4e24('0x40')]({},_0x514ef2,_0x3c82bc[_0x4e24('0x41')]);var _0x4a7528={'where':_0x514ef2[_0x4e24('0x3c')]};return db[_0x4e24('0x2f')]['count'](_0x4a7528)[_0x4e24('0x26')](function(_0x6f95d5){_0x5a7709[_0x4e24('0x1f')]=_0x6f95d5;if(_0x3c82bc[_0x4e24('0x33')]['includeAll']){_0x514ef2['include']=[{'all':!![]}];}return db[_0x4e24('0x2f')][_0x4e24('0x42')](_0x514ef2);})['then'](function(_0x549c6d){_0x5a7709[_0x4e24('0x43')]=_0x549c6d;return _0x5a7709;})['then'](respondWithFilteredResult(_0x49ab76,_0x514ef2))[_0x4e24('0x44')](handleError(_0x49ab76,null));};exports['show']=function(_0x2964f0,_0x4b8f9e){var _0xc38aa={'raw':![],'where':{'id':_0x2964f0[_0x4e24('0x45')]['id']}},_0x314d50={};_0x314d50[_0x4e24('0x36')]=_['keys'](db['Automation']['rawAttributes']);_0x314d50[_0x4e24('0x33')]=_[_0x4e24('0x32')](_0x2964f0['query']);_0x314d50[_0x4e24('0x34')]=_[_0x4e24('0x35')](_0x314d50['model'],_0x314d50['query']);_0xc38aa[_0x4e24('0x37')]=_['intersection'](_0x314d50[_0x4e24('0x36')],qs[_0x4e24('0x38')](_0x2964f0[_0x4e24('0x33')][_0x4e24('0x38')]));_0xc38aa['attributes']=_0xc38aa[_0x4e24('0x37')][_0x4e24('0x46')]?_0xc38aa[_0x4e24('0x37')]:_0x314d50[_0x4e24('0x36')];if(_0x2964f0['query'][_0x4e24('0x47')]){_0xc38aa['include']=[{'all':!![]}];}_0xc38aa=_[_0x4e24('0x40')]({},_0xc38aa,_0x2964f0[_0x4e24('0x41')]);return db[_0x4e24('0x2f')][_0x4e24('0x48')](_0xc38aa)['then'](handleEntityNotFound(_0x4b8f9e,null))['then'](respondWithResult(_0x4b8f9e,null))[_0x4e24('0x44')](handleError(_0x4b8f9e,null));};exports[_0x4e24('0x49')]=function(_0x52b679,_0x1cdf1d){return db[_0x4e24('0x2f')][_0x4e24('0x49')](_0x52b679[_0x4e24('0x4a')],{})[_0x4e24('0x26')](respondWithResult(_0x1cdf1d,0xc9))['catch'](handleError(_0x1cdf1d,null));};exports[_0x4e24('0x25')]=function(_0x28f597,_0x35196c){if(_0x28f597[_0x4e24('0x4a')]['id']){delete _0x28f597[_0x4e24('0x4a')]['id'];}return db[_0x4e24('0x2f')]['find']({'where':{'id':_0x28f597[_0x4e24('0x45')]['id']}})[_0x4e24('0x26')](handleEntityNotFound(_0x35196c,null))[_0x4e24('0x26')](saveUpdates(_0x28f597[_0x4e24('0x4a')],null))[_0x4e24('0x26')](respondWithResult(_0x35196c,null))[_0x4e24('0x44')](handleError(_0x35196c,null));};exports[_0x4e24('0x27')]=function(_0x7b4ec2,_0x49b32c){return db[_0x4e24('0x2f')]['find']({'where':{'id':_0x7b4ec2['params']['id']}})[_0x4e24('0x26')](handleEntityNotFound(_0x49b32c,null))[_0x4e24('0x26')](removeEntity(_0x49b32c,null))['catch'](handleError(_0x49b32c,null));};exports[_0x4e24('0x4b')]=function(_0x37c83,_0x17a550,_0x1a4bbd){return db[_0x4e24('0x4c')]['find']({'where':{'id':_0x37c83[_0x4e24('0x45')]['id']}})[_0x4e24('0x26')](handleEntityNotFound(_0x17a550,null))[_0x4e24('0x26')](function(_0x445f3a){if(_0x445f3a){return _0x445f3a[_0x4e24('0x4b')](_0x37c83[_0x4e24('0x4a')][_0x4e24('0x4d')],_[_0x4e24('0x4e')](_0x37c83[_0x4e24('0x4a')],[_0x4e24('0x4d'),'id'])||{});}})[_0x4e24('0x26')](respondWithResult(_0x17a550,null))[_0x4e24('0x44')](handleError(_0x17a550,null));};exports['getConditions']=function(_0x5bdc74,_0x483665,_0x4f3091){var _0x24146a={};var _0x28f45d={};var _0x2d946c;var _0x3f90e3;return db['Automation'][_0x4e24('0x4f')]({'where':{'id':_0x5bdc74[_0x4e24('0x45')]['id']}})[_0x4e24('0x26')](handleEntityNotFound(_0x483665,null))['then'](function(_0x49a938){if(_0x49a938){_0x2d946c=_0x49a938;_0x28f45d[_0x4e24('0x36')]=_['keys'](db[_0x4e24('0x4c')]['rawAttributes']);_0x28f45d[_0x4e24('0x33')]=_['keys'](_0x5bdc74[_0x4e24('0x33')]);_0x28f45d['filters']=_[_0x4e24('0x35')](_0x28f45d['model'],_0x28f45d[_0x4e24('0x33')]);_0x24146a['attributes']=_['intersection'](_0x28f45d[_0x4e24('0x36')],qs[_0x4e24('0x38')](_0x5bdc74[_0x4e24('0x33')][_0x4e24('0x38')]));_0x24146a[_0x4e24('0x37')]=_0x24146a[_0x4e24('0x37')]['length']?_0x24146a[_0x4e24('0x37')]:_0x28f45d[_0x4e24('0x36')];_0x24146a['order']=qs[_0x4e24('0x3b')](_0x5bdc74[_0x4e24('0x33')]['sort']);_0x24146a[_0x4e24('0x3c')]=qs[_0x4e24('0x34')](_[_0x4e24('0x3d')](_0x5bdc74['query'],_0x28f45d[_0x4e24('0x34')]));if(_0x5bdc74[_0x4e24('0x33')]['filter']){_0x24146a[_0x4e24('0x3c')]=_['merge'](_0x24146a['where'],{'$or':_['map'](_0x24146a['attributes'],function(_0x531bf3){var _0x28e371={};_0x28e371[_0x531bf3]={'$like':'%'+_0x5bdc74[_0x4e24('0x33')]['filter']+'%'};return _0x28e371;})});}_0x24146a=_[_0x4e24('0x40')]({},_0x24146a,_0x5bdc74[_0x4e24('0x41')]);return _0x2d946c[_0x4e24('0x50')](_0x24146a);}})[_0x4e24('0x26')](function(_0x2a03d7){if(_0x2a03d7){_0x3f90e3=_0x2a03d7[_0x4e24('0x46')];if(!_0x5bdc74[_0x4e24('0x33')]['hasOwnProperty'](_0x4e24('0x39'))){_0x24146a[_0x4e24('0x1e')]=qs[_0x4e24('0x1e')](_0x5bdc74[_0x4e24('0x33')][_0x4e24('0x1e')]);_0x24146a[_0x4e24('0x1c')]=qs[_0x4e24('0x1c')](_0x5bdc74[_0x4e24('0x33')][_0x4e24('0x1c')]);}return _0x2d946c['getConditions'](_0x24146a);}})[_0x4e24('0x26')](function(_0x46c724){if(_0x46c724){return _0x46c724?{'count':_0x3f90e3,'rows':_0x46c724}:null;}})[_0x4e24('0x26')](respondWithResult(_0x483665,null))[_0x4e24('0x44')](handleError(_0x483665,null));};exports[_0x4e24('0x51')]=function(_0xea3fab,_0x4553a3,_0x136b3e){return db[_0x4e24('0x52')][_0x4e24('0x48')]({'where':{'id':_0xea3fab['params']['id']}})[_0x4e24('0x26')](handleEntityNotFound(_0x4553a3,null))['then'](function(_0x1dde1a){if(_0x1dde1a){return _0x1dde1a[_0x4e24('0x51')](_0xea3fab[_0x4e24('0x4a')][_0x4e24('0x4d')],_[_0x4e24('0x4e')](_0xea3fab[_0x4e24('0x4a')],[_0x4e24('0x4d'),'id'])||{});}})[_0x4e24('0x26')](respondWithResult(_0x4553a3,null))['catch'](handleError(_0x4553a3,null));};exports['getActions']=function(_0x149df2,_0x4e495a,_0x3fe5f6){var _0x312e37={};var _0x1060bb={};var _0x586054;var _0x39f471;return db['Automation'][_0x4e24('0x4f')]({'where':{'id':_0x149df2[_0x4e24('0x45')]['id']}})[_0x4e24('0x26')](handleEntityNotFound(_0x4e495a,null))[_0x4e24('0x26')](function(_0x4de705){if(_0x4de705){_0x586054=_0x4de705;_0x1060bb[_0x4e24('0x36')]=_[_0x4e24('0x32')](db['Action']['rawAttributes']);_0x1060bb['query']=_[_0x4e24('0x32')](_0x149df2[_0x4e24('0x33')]);_0x1060bb[_0x4e24('0x34')]=_[_0x4e24('0x35')](_0x1060bb[_0x4e24('0x36')],_0x1060bb['query']);_0x312e37[_0x4e24('0x37')]=_['intersection'](_0x1060bb[_0x4e24('0x36')],qs['fields'](_0x149df2[_0x4e24('0x33')][_0x4e24('0x38')]));_0x312e37[_0x4e24('0x37')]=_0x312e37['attributes']['length']?_0x312e37[_0x4e24('0x37')]:_0x1060bb[_0x4e24('0x36')];_0x312e37[_0x4e24('0x3a')]=qs[_0x4e24('0x3b')](_0x149df2['query'][_0x4e24('0x3b')]);_0x312e37[_0x4e24('0x3c')]=qs['filters'](_['pick'](_0x149df2[_0x4e24('0x33')],_0x1060bb[_0x4e24('0x34')]));if(_0x149df2[_0x4e24('0x33')]['filter']){_0x312e37[_0x4e24('0x3c')]=_[_0x4e24('0x40')](_0x312e37[_0x4e24('0x3c')],{'$or':_[_0x4e24('0x2e')](_0x312e37[_0x4e24('0x37')],function(_0x489372){var _0x149ce9={};_0x149ce9[_0x489372]={'$like':'%'+_0x149df2[_0x4e24('0x33')]['filter']+'%'};return _0x149ce9;})});}_0x312e37=_['merge']({},_0x312e37,_0x149df2[_0x4e24('0x41')]);return _0x586054[_0x4e24('0x53')](_0x312e37);}})[_0x4e24('0x26')](function(_0x1af5c5){if(_0x1af5c5){_0x39f471=_0x1af5c5['length'];if(!_0x149df2[_0x4e24('0x33')][_0x4e24('0x54')]('nolimit')){_0x312e37[_0x4e24('0x1e')]=qs[_0x4e24('0x1e')](_0x149df2[_0x4e24('0x33')][_0x4e24('0x1e')]);_0x312e37['offset']=qs['offset'](_0x149df2[_0x4e24('0x33')][_0x4e24('0x1c')]);}return _0x586054[_0x4e24('0x53')](_0x312e37);}})['then'](function(_0xff3711){if(_0xff3711){return _0xff3711?{'count':_0x39f471,'rows':_0xff3711}:null;}})[_0x4e24('0x26')](respondWithResult(_0x4e495a,null))[_0x4e24('0x44')](handleError(_0x4e495a,null));};
\ No newline at end of file
+var _0x91e5=['Condition','addConditions','omit','ids','getConditions','findOne','Action','getActions','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','then','destroy','stack','name','index','map','Automation','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','update'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x91e5,0xb1));var _0x591e=function(_0x4637b3,_0x1a5599){_0x4637b3=_0x4637b3-0x0;var _0x23604d=_0x91e5[_0x4637b3];return _0x23604d;};'use strict';var emlformat=require(_0x591e('0x0'));var rimraf=require(_0x591e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x591e('0x2'));var rp=require(_0x591e('0x3'));var moment=require(_0x591e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x591e('0x5'));var sox=require(_0x591e('0x6'));var csv=require(_0x591e('0x7'));var ejs=require(_0x591e('0x8'));var fs=require('fs');var fs_extra=require(_0x591e('0x9'));var _=require(_0x591e('0xa'));var squel=require(_0x591e('0xb'));var crypto=require(_0x591e('0xc'));var jsforce=require(_0x591e('0xd'));var deskjs=require(_0x591e('0xe'));var toCsv=require(_0x591e('0x7'));var querystring=require(_0x591e('0xf'));var Papa=require(_0x591e('0x10'));var Redis=require('ioredis');var authService=require(_0x591e('0x11'));var qs=require(_0x591e('0x12'));var as=require(_0x591e('0x13'));var hardwareService=require(_0x591e('0x14'));var logger=require(_0x591e('0x15'))(_0x591e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x591e('0x17'));var db=require(_0x591e('0x18'))['db'];function respondWithStatusCode(_0x27cb99,_0x9f526){_0x9f526=_0x9f526||0xcc;return function(_0x2660d6){if(_0x2660d6){return _0x27cb99[_0x591e('0x19')](_0x9f526);}return _0x27cb99[_0x591e('0x1a')](_0x9f526)[_0x591e('0x1b')]();};}function respondWithResult(_0x5d5b34,_0x3fae7c){_0x3fae7c=_0x3fae7c||0xc8;return function(_0x5db910){if(_0x5db910){return _0x5d5b34['status'](_0x3fae7c)[_0x591e('0x1c')](_0x5db910);}};}function respondWithFilteredResult(_0x1f840d,_0x21dfdb){return function(_0x48d1f5){if(_0x48d1f5){var _0x4806a8=typeof _0x21dfdb[_0x591e('0x1d')]===_0x591e('0x1e')&&typeof _0x21dfdb[_0x591e('0x1f')]==='undefined';var _0x123c18=_0x48d1f5['count'];var _0x28c8b3=_0x4806a8?0x0:_0x21dfdb[_0x591e('0x1d')];var _0x58c2d9=_0x4806a8?_0x48d1f5['count']:_0x21dfdb[_0x591e('0x1d')]+_0x21dfdb[_0x591e('0x1f')];var _0x22e60b;if(_0x58c2d9>=_0x123c18){_0x58c2d9=_0x123c18;_0x22e60b=0xc8;}else{_0x22e60b=0xce;}_0x1f840d[_0x591e('0x1a')](_0x22e60b);return _0x1f840d[_0x591e('0x20')]('Content-Range',_0x28c8b3+'-'+_0x58c2d9+'/'+_0x123c18)[_0x591e('0x1c')](_0x48d1f5);}return null;};}function patchUpdates(_0x1f4656){return function(_0x26c49f){try{jsonpatch[_0x591e('0x21')](_0x26c49f,_0x1f4656,!![]);}catch(_0x470c9b){return BPromise[_0x591e('0x22')](_0x470c9b);}return _0x26c49f[_0x591e('0x23')]();};}function saveUpdates(_0x35d1f6,_0x625728){return function(_0x18f018){if(_0x18f018){return _0x18f018['update'](_0x35d1f6)[_0x591e('0x24')](function(_0x4f4430){return _0x4f4430;});}return null;};}function removeEntity(_0x8abc2a,_0x13e26b){return function(_0x4f9b9e){if(_0x4f9b9e){return _0x4f9b9e[_0x591e('0x25')]()[_0x591e('0x24')](function(){_0x8abc2a[_0x591e('0x1a')](0xcc)[_0x591e('0x1b')]();});}};}function handleEntityNotFound(_0x26e64e,_0x26947b){return function(_0x454048){if(!_0x454048){_0x26e64e[_0x591e('0x19')](0x194);}return _0x454048;};}function handleError(_0x4617bb,_0xf5c97e){_0xf5c97e=_0xf5c97e||0x1f4;return function(_0x420094){logger['error'](_0x420094[_0x591e('0x26')]);if(_0x420094[_0x591e('0x27')]){delete _0x420094['name'];}_0x4617bb['status'](_0xf5c97e)['send'](_0x420094);};}exports[_0x591e('0x28')]=function(_0x15e8e0,_0x3a656c){var _0x2be22c={},_0xfc4352={},_0x4f7ce8={'count':0x0,'rows':[]};var _0x6e5a52=_[_0x591e('0x29')](db[_0x591e('0x2a')]['rawAttributes'],function(_0x1616c8){return{'name':_0x1616c8[_0x591e('0x2b')],'type':_0x1616c8[_0x591e('0x2c')][_0x591e('0x2d')]};});_0xfc4352[_0x591e('0x2e')]=_['map'](_0x6e5a52,'name');_0xfc4352[_0x591e('0x2f')]=_[_0x591e('0x30')](_0x15e8e0['query']);_0xfc4352[_0x591e('0x31')]=_[_0x591e('0x32')](_0xfc4352[_0x591e('0x2e')],_0xfc4352[_0x591e('0x2f')]);_0x2be22c[_0x591e('0x33')]=_[_0x591e('0x32')](_0xfc4352[_0x591e('0x2e')],qs['fields'](_0x15e8e0[_0x591e('0x2f')][_0x591e('0x34')]));_0x2be22c[_0x591e('0x33')]=_0x2be22c[_0x591e('0x33')][_0x591e('0x35')]?_0x2be22c[_0x591e('0x33')]:_0xfc4352[_0x591e('0x2e')];if(!_0x15e8e0[_0x591e('0x2f')]['hasOwnProperty'](_0x591e('0x36'))){_0x2be22c['limit']=qs[_0x591e('0x1f')](_0x15e8e0[_0x591e('0x2f')]['limit']);_0x2be22c['offset']=qs[_0x591e('0x1d')](_0x15e8e0[_0x591e('0x2f')][_0x591e('0x1d')]);}_0x2be22c[_0x591e('0x37')]=qs[_0x591e('0x38')](_0x15e8e0['query'][_0x591e('0x38')]);_0x2be22c['where']=qs[_0x591e('0x31')](_[_0x591e('0x39')](_0x15e8e0[_0x591e('0x2f')],_0xfc4352[_0x591e('0x31')]),_0x6e5a52);if(_0x15e8e0[_0x591e('0x2f')]['filter']){_0x2be22c[_0x591e('0x3a')]=_['merge'](_0x2be22c[_0x591e('0x3a')],{'$or':_[_0x591e('0x29')](_0x6e5a52,function(_0x521b97){if(_0x521b97[_0x591e('0x2c')]!==_0x591e('0x3b')){var _0x2bc673={};_0x2bc673[_0x521b97[_0x591e('0x27')]]={'$like':'%'+_0x15e8e0[_0x591e('0x2f')][_0x591e('0x3c')]+'%'};return _0x2bc673;}})});}_0x2be22c=_[_0x591e('0x3d')]({},_0x2be22c,_0x15e8e0[_0x591e('0x3e')]);var _0x3e3568={'where':_0x2be22c[_0x591e('0x3a')]};return db[_0x591e('0x2a')][_0x591e('0x3f')](_0x3e3568)[_0x591e('0x24')](function(_0x505aee){_0x4f7ce8[_0x591e('0x3f')]=_0x505aee;if(_0x15e8e0[_0x591e('0x2f')][_0x591e('0x40')]){_0x2be22c[_0x591e('0x41')]=[{'all':!![]}];}return db[_0x591e('0x2a')][_0x591e('0x42')](_0x2be22c);})['then'](function(_0x20e71f){_0x4f7ce8['rows']=_0x20e71f;return _0x4f7ce8;})['then'](respondWithFilteredResult(_0x3a656c,_0x2be22c))[_0x591e('0x43')](handleError(_0x3a656c,null));};exports[_0x591e('0x44')]=function(_0x2b0fd4,_0x3ada9c){var _0x1ea44c={'raw':![],'where':{'id':_0x2b0fd4[_0x591e('0x45')]['id']}},_0x514da1={};_0x514da1[_0x591e('0x2e')]=_[_0x591e('0x30')](db[_0x591e('0x2a')][_0x591e('0x46')]);_0x514da1[_0x591e('0x2f')]=_[_0x591e('0x30')](_0x2b0fd4[_0x591e('0x2f')]);_0x514da1[_0x591e('0x31')]=_[_0x591e('0x32')](_0x514da1[_0x591e('0x2e')],_0x514da1[_0x591e('0x2f')]);_0x1ea44c['attributes']=_[_0x591e('0x32')](_0x514da1[_0x591e('0x2e')],qs['fields'](_0x2b0fd4['query'][_0x591e('0x34')]));_0x1ea44c[_0x591e('0x33')]=_0x1ea44c[_0x591e('0x33')][_0x591e('0x35')]?_0x1ea44c[_0x591e('0x33')]:_0x514da1['model'];if(_0x2b0fd4[_0x591e('0x2f')][_0x591e('0x40')]){_0x1ea44c[_0x591e('0x41')]=[{'all':!![]}];}_0x1ea44c=_['merge']({},_0x1ea44c,_0x2b0fd4[_0x591e('0x3e')]);return db['Automation'][_0x591e('0x47')](_0x1ea44c)[_0x591e('0x24')](handleEntityNotFound(_0x3ada9c,null))[_0x591e('0x24')](respondWithResult(_0x3ada9c,null))['catch'](handleError(_0x3ada9c,null));};exports['create']=function(_0x11feb4,_0x303bd0){return db['Automation'][_0x591e('0x48')](_0x11feb4[_0x591e('0x49')],{})[_0x591e('0x24')](respondWithResult(_0x303bd0,0xc9))[_0x591e('0x43')](handleError(_0x303bd0,null));};exports[_0x591e('0x4a')]=function(_0x2ffa81,_0x24c088){if(_0x2ffa81[_0x591e('0x49')]['id']){delete _0x2ffa81[_0x591e('0x49')]['id'];}return db[_0x591e('0x2a')][_0x591e('0x47')]({'where':{'id':_0x2ffa81['params']['id']}})['then'](handleEntityNotFound(_0x24c088,null))[_0x591e('0x24')](saveUpdates(_0x2ffa81['body'],null))['then'](respondWithResult(_0x24c088,null))[_0x591e('0x43')](handleError(_0x24c088,null));};exports[_0x591e('0x25')]=function(_0x4b6e6a,_0x4c4ce6){return db[_0x591e('0x2a')][_0x591e('0x47')]({'where':{'id':_0x4b6e6a['params']['id']}})[_0x591e('0x24')](handleEntityNotFound(_0x4c4ce6,null))['then'](removeEntity(_0x4c4ce6,null))[_0x591e('0x43')](handleError(_0x4c4ce6,null));};exports['addConditions']=function(_0x517dd3,_0x27c76d,_0x485461){return db[_0x591e('0x4b')]['find']({'where':{'id':_0x517dd3['params']['id']}})[_0x591e('0x24')](handleEntityNotFound(_0x27c76d,null))['then'](function(_0xafb405){if(_0xafb405){return _0xafb405[_0x591e('0x4c')](_0x517dd3[_0x591e('0x49')]['ids'],_[_0x591e('0x4d')](_0x517dd3[_0x591e('0x49')],[_0x591e('0x4e'),'id'])||{});}})[_0x591e('0x24')](respondWithResult(_0x27c76d,null))[_0x591e('0x43')](handleError(_0x27c76d,null));};exports[_0x591e('0x4f')]=function(_0x3e351b,_0x261afe,_0xf9c831){var _0x25a33a={};var _0x5ae920={};var _0x373f9a;var _0x5a9774;return db[_0x591e('0x2a')][_0x591e('0x50')]({'where':{'id':_0x3e351b[_0x591e('0x45')]['id']}})['then'](handleEntityNotFound(_0x261afe,null))['then'](function(_0x598377){if(_0x598377){_0x373f9a=_0x598377;_0x5ae920[_0x591e('0x2e')]=_[_0x591e('0x30')](db['Condition'][_0x591e('0x46')]);_0x5ae920[_0x591e('0x2f')]=_[_0x591e('0x30')](_0x3e351b[_0x591e('0x2f')]);_0x5ae920[_0x591e('0x31')]=_[_0x591e('0x32')](_0x5ae920[_0x591e('0x2e')],_0x5ae920['query']);_0x25a33a['attributes']=_[_0x591e('0x32')](_0x5ae920[_0x591e('0x2e')],qs[_0x591e('0x34')](_0x3e351b['query'][_0x591e('0x34')]));_0x25a33a['attributes']=_0x25a33a[_0x591e('0x33')][_0x591e('0x35')]?_0x25a33a[_0x591e('0x33')]:_0x5ae920[_0x591e('0x2e')];_0x25a33a[_0x591e('0x37')]=qs['sort'](_0x3e351b[_0x591e('0x2f')][_0x591e('0x38')]);_0x25a33a[_0x591e('0x3a')]=qs[_0x591e('0x31')](_[_0x591e('0x39')](_0x3e351b[_0x591e('0x2f')],_0x5ae920[_0x591e('0x31')]));if(_0x3e351b[_0x591e('0x2f')][_0x591e('0x3c')]){_0x25a33a[_0x591e('0x3a')]=_['merge'](_0x25a33a[_0x591e('0x3a')],{'$or':_[_0x591e('0x29')](_0x25a33a[_0x591e('0x33')],function(_0xa82752){var _0xe196ff={};_0xe196ff[_0xa82752]={'$like':'%'+_0x3e351b[_0x591e('0x2f')][_0x591e('0x3c')]+'%'};return _0xe196ff;})});}_0x25a33a=_[_0x591e('0x3d')]({},_0x25a33a,_0x3e351b['options']);return _0x373f9a[_0x591e('0x4f')](_0x25a33a);}})[_0x591e('0x24')](function(_0x515a5f){if(_0x515a5f){_0x5a9774=_0x515a5f['length'];if(!_0x3e351b['query']['hasOwnProperty']('nolimit')){_0x25a33a['limit']=qs[_0x591e('0x1f')](_0x3e351b[_0x591e('0x2f')]['limit']);_0x25a33a[_0x591e('0x1d')]=qs[_0x591e('0x1d')](_0x3e351b[_0x591e('0x2f')][_0x591e('0x1d')]);}return _0x373f9a[_0x591e('0x4f')](_0x25a33a);}})[_0x591e('0x24')](function(_0xfc39ea){if(_0xfc39ea){return _0xfc39ea?{'count':_0x5a9774,'rows':_0xfc39ea}:null;}})[_0x591e('0x24')](respondWithResult(_0x261afe,null))[_0x591e('0x43')](handleError(_0x261afe,null));};exports['addActions']=function(_0x441f55,_0x3f6ae6,_0x59eccc){return db[_0x591e('0x51')][_0x591e('0x47')]({'where':{'id':_0x441f55['params']['id']}})[_0x591e('0x24')](handleEntityNotFound(_0x3f6ae6,null))[_0x591e('0x24')](function(_0x9daf82){if(_0x9daf82){return _0x9daf82['addActions'](_0x441f55[_0x591e('0x49')][_0x591e('0x4e')],_[_0x591e('0x4d')](_0x441f55[_0x591e('0x49')],[_0x591e('0x4e'),'id'])||{});}})[_0x591e('0x24')](respondWithResult(_0x3f6ae6,null))[_0x591e('0x43')](handleError(_0x3f6ae6,null));};exports[_0x591e('0x52')]=function(_0x406224,_0x1ac9cb,_0xfb279f){var _0x5c9968={};var _0x5113b5={};var _0x3a9b6c;var _0xacd317;return db[_0x591e('0x2a')]['findOne']({'where':{'id':_0x406224['params']['id']}})['then'](handleEntityNotFound(_0x1ac9cb,null))['then'](function(_0x4d3517){if(_0x4d3517){_0x3a9b6c=_0x4d3517;_0x5113b5[_0x591e('0x2e')]=_[_0x591e('0x30')](db[_0x591e('0x51')][_0x591e('0x46')]);_0x5113b5[_0x591e('0x2f')]=_['keys'](_0x406224[_0x591e('0x2f')]);_0x5113b5[_0x591e('0x31')]=_['intersection'](_0x5113b5[_0x591e('0x2e')],_0x5113b5['query']);_0x5c9968[_0x591e('0x33')]=_[_0x591e('0x32')](_0x5113b5[_0x591e('0x2e')],qs['fields'](_0x406224[_0x591e('0x2f')]['fields']));_0x5c9968[_0x591e('0x33')]=_0x5c9968[_0x591e('0x33')][_0x591e('0x35')]?_0x5c9968[_0x591e('0x33')]:_0x5113b5[_0x591e('0x2e')];_0x5c9968['order']=qs['sort'](_0x406224[_0x591e('0x2f')][_0x591e('0x38')]);_0x5c9968[_0x591e('0x3a')]=qs[_0x591e('0x31')](_[_0x591e('0x39')](_0x406224['query'],_0x5113b5[_0x591e('0x31')]));if(_0x406224[_0x591e('0x2f')][_0x591e('0x3c')]){_0x5c9968['where']=_['merge'](_0x5c9968[_0x591e('0x3a')],{'$or':_['map'](_0x5c9968['attributes'],function(_0x381006){var _0x104948={};_0x104948[_0x381006]={'$like':'%'+_0x406224['query']['filter']+'%'};return _0x104948;})});}_0x5c9968=_[_0x591e('0x3d')]({},_0x5c9968,_0x406224[_0x591e('0x3e')]);return _0x3a9b6c[_0x591e('0x52')](_0x5c9968);}})[_0x591e('0x24')](function(_0x507698){if(_0x507698){_0xacd317=_0x507698[_0x591e('0x35')];if(!_0x406224['query'][_0x591e('0x53')](_0x591e('0x36'))){_0x5c9968[_0x591e('0x1f')]=qs['limit'](_0x406224[_0x591e('0x2f')][_0x591e('0x1f')]);_0x5c9968[_0x591e('0x1d')]=qs[_0x591e('0x1d')](_0x406224[_0x591e('0x2f')][_0x591e('0x1d')]);}return _0x3a9b6c[_0x591e('0x52')](_0x5c9968);}})['then'](function(_0x7aa0c5){if(_0x7aa0c5){return _0x7aa0c5?{'count':_0xacd317,'rows':_0x7aa0c5}:null;}})['then'](respondWithResult(_0x1ac9cb,null))[_0x591e('0x43')](handleError(_0x1ac9cb,null));};
\ No newline at end of file
index 022f11b..b88a1c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7373=['moment','bluebird','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api'];(function(_0x15797b,_0x5a2b14){var _0x5cc612=function(_0x35b0a7){while(--_0x35b0a7){_0x15797b['push'](_0x15797b['shift']());}};_0x5cc612(++_0x5a2b14);}(_0x7373,0x74));var _0x3737=function(_0x440aaa,_0x22d029){_0x440aaa=_0x440aaa-0x0;var _0x3808d0=_0x7373[_0x440aaa];return _0x3808d0;};'use strict';var _=require(_0x3737('0x0'));var util=require(_0x3737('0x1'));var logger=require(_0x3737('0x2'))(_0x3737('0x3'));var moment=require(_0x3737('0x4'));var BPromise=require(_0x3737('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3737('0x6'));var config=require('../../config/environment');var attributes=require(_0x3737('0x7'));module[_0x3737('0x8')]=function(_0x5d2c9d,_0x370567){return _0x5d2c9d[_0x3737('0x9')](_0x3737('0xa'),attributes,{'tableName':_0x3737('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d46=['moment','request-promise','rimraf','./automation.attributes','exports','define','Automation','util','api'];(function(_0x1876ab,_0x173848){var _0x101285=function(_0x4b5fa3){while(--_0x4b5fa3){_0x1876ab['push'](_0x1876ab['shift']());}};_0x101285(++_0x173848);}(_0x1d46,0x18a));var _0x61d4=function(_0x64aff8,_0x106082){_0x64aff8=_0x64aff8-0x0;var _0x5488a3=_0x1d46[_0x64aff8];return _0x5488a3;};'use strict';var _=require('lodash');var util=require(_0x61d4('0x0'));var logger=require('../../config/logger')(_0x61d4('0x1'));var moment=require(_0x61d4('0x2'));var BPromise=require('bluebird');var rp=require(_0x61d4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x61d4('0x4'));var config=require('../../config/environment');var attributes=require(_0x61d4('0x5'));module[_0x61d4('0x6')]=function(_0x460259,_0x370940){return _0x460259[_0x61d4('0x7')](_0x61d4('0x8'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d2baf37..52da56f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6629=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x561ec6,_0x7b9170){var _0x4f7379=function(_0x55c01f){while(--_0x55c01f){_0x561ec6['push'](_0x561ec6['shift']());}};_0x4f7379(++_0x7b9170);}(_0x6629,0x1c2));var _0x9662=function(_0x30383b,_0x4e85d9){_0x30383b=_0x30383b-0x0;var _0x30dff1=_0x6629[_0x30383b];return _0x30dff1;};'use strict';var _=require(_0x9662('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9662('0x1'));var rs=require(_0x9662('0x2'));var fs=require('fs');var Redis=require(_0x9662('0x3'));var db=require(_0x9662('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9662('0x5'))(_0x9662('0x6'));var config=require(_0x9662('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9662('0x8')][_0x9662('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x457681,_0x5ec533,_0x1a1809){return new BPromise(function(_0x58e45a,_0xa866f2){return client[_0x9662('0xa')](_0x457681,_0x1a1809)[_0x9662('0xb')](function(_0x11ae91){logger[_0x9662('0xc')](_0x9662('0xd'),_0x5ec533,_0x9662('0xe'));logger[_0x9662('0xf')](_0x9662('0x10'),_0x5ec533,_0x9662('0xe'),JSON[_0x9662('0x11')](_0x11ae91));if(_0x11ae91['error']){if(_0x11ae91[_0x9662('0x12')]['code']===0x1f4){logger[_0x9662('0x12')](_0x9662('0xd'),_0x5ec533,_0x11ae91['error'][_0x9662('0x13')]);return _0xa866f2(_0x11ae91[_0x9662('0x12')][_0x9662('0x13')]);}logger['error']('Automation,\x20%s,\x20%s',_0x5ec533,_0x11ae91[_0x9662('0x12')]['message']);return _0x58e45a(_0x11ae91[_0x9662('0x12')][_0x9662('0x13')]);}else{logger[_0x9662('0xc')]('Automation,\x20%s,\x20%s',_0x5ec533,'request\x20sent');_0x58e45a(_0x11ae91['result'][_0x9662('0x13')]);}})[_0x9662('0x14')](function(_0x4930c5){logger[_0x9662('0x12')](_0x9662('0xd'),_0x5ec533,_0x4930c5);_0xa866f2(_0x4930c5);});});}
\ No newline at end of file
+var _0x82d8=['jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','ioredis','../../config/utils','../../config/environment'];(function(_0x444199,_0x1acd8f){var _0x56cfc8=function(_0x1012b8){while(--_0x1012b8){_0x444199['push'](_0x444199['shift']());}};_0x56cfc8(++_0x1acd8f);}(_0x82d8,0xff));var _0x882d=function(_0x4b6c78,_0x575a56){_0x4b6c78=_0x4b6c78-0x0;var _0x52d539=_0x82d8[_0x4b6c78];return _0x52d539;};'use strict';var _=require(_0x882d('0x0'));var util=require('util');var moment=require(_0x882d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x882d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x882d('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x882d('0x4'));var jayson=require(_0x882d('0x5'));var client=jayson[_0x882d('0x6')][_0x882d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb7539b,_0x3c8b67,_0x4067a9){return new BPromise(function(_0x4ea710,_0x4035ba){return client[_0x882d('0x8')](_0xb7539b,_0x4067a9)[_0x882d('0x9')](function(_0x4da4aa){logger[_0x882d('0xa')](_0x882d('0xb'),_0x3c8b67,'request\x20sent');logger[_0x882d('0xc')](_0x882d('0xd'),_0x3c8b67,_0x882d('0xe'),JSON['stringify'](_0x4da4aa));if(_0x4da4aa[_0x882d('0xf')]){if(_0x4da4aa[_0x882d('0xf')][_0x882d('0x10')]===0x1f4){logger[_0x882d('0xf')](_0x882d('0xb'),_0x3c8b67,_0x4da4aa[_0x882d('0xf')][_0x882d('0x11')]);return _0x4035ba(_0x4da4aa['error']['message']);}logger[_0x882d('0xf')](_0x882d('0xb'),_0x3c8b67,_0x4da4aa[_0x882d('0xf')][_0x882d('0x11')]);return _0x4ea710(_0x4da4aa[_0x882d('0xf')]['message']);}else{logger[_0x882d('0xa')](_0x882d('0xb'),_0x3c8b67,_0x882d('0xe'));_0x4ea710(_0x4da4aa[_0x882d('0x12')][_0x882d('0x11')]);}})[_0x882d('0x13')](function(_0x46cfcc){logger[_0x882d('0xf')](_0x882d('0xb'),_0x3c8b67,_0x46cfcc);_0x4035ba(_0x46cfcc);});});}
\ No newline at end of file
index a0d88e9..389e1fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef8b=['/:id','show','/:id/actions','isAuthenticated','getActions','post','create','/:id/conditions','addConditions','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index'];(function(_0x31c19c,_0xbe4b70){var _0x1a87f7=function(_0x23cf92){while(--_0x23cf92){_0x31c19c['push'](_0x31c19c['shift']());}};_0x1a87f7(++_0xbe4b70);}(_0xef8b,0x192));var _0xbef8=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0xef8b[_0x5eaa0b];return _0x28b295;};'use strict';var multer=require('multer');var util=require(_0xbef8('0x0'));var path=require(_0xbef8('0x1'));var timeout=require(_0xbef8('0x2'));var express=require(_0xbef8('0x3'));var router=express[_0xbef8('0x4')]();var fs_extra=require(_0xbef8('0x5'));var auth=require(_0xbef8('0x6'));var interaction=require(_0xbef8('0x7'));var config=require(_0xbef8('0x8'));var controller=require(_0xbef8('0x9'));router[_0xbef8('0xa')]('/',auth['isAuthenticated'](),controller[_0xbef8('0xb')]);router[_0xbef8('0xa')](_0xbef8('0xc'),auth['isAuthenticated'](),controller[_0xbef8('0xd')]);router[_0xbef8('0xa')]('/:id/conditions',auth['isAuthenticated'](),controller['getConditions']);router[_0xbef8('0xa')](_0xbef8('0xe'),auth[_0xbef8('0xf')](),controller[_0xbef8('0x10')]);router[_0xbef8('0x11')]('/',auth[_0xbef8('0xf')](),controller[_0xbef8('0x12')]);router[_0xbef8('0x11')](_0xbef8('0x13'),auth['isAuthenticated'](),controller[_0xbef8('0x14')]);router[_0xbef8('0x11')](_0xbef8('0xe'),auth['isAuthenticated'](),controller['addActions']);router['put'](_0xbef8('0xc'),auth['isAuthenticated'](),controller[_0xbef8('0x15')]);router[_0xbef8('0x16')]('/:id',auth[_0xbef8('0xf')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x710b=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','getConditions','getActions','post','create','addConditions','/:id/actions','put','update','destroy','multer'];(function(_0x4766ba,_0x414f42){var _0x18505a=function(_0x5b1f01){while(--_0x5b1f01){_0x4766ba['push'](_0x4766ba['shift']());}};_0x18505a(++_0x414f42);}(_0x710b,0x110));var _0xb710=function(_0x3a74c2,_0x282fb9){_0x3a74c2=_0x3a74c2-0x0;var _0x19d99c=_0x710b[_0x3a74c2];return _0x19d99c;};'use strict';var multer=require(_0xb710('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb710('0x1'));var express=require(_0xb710('0x2'));var router=express[_0xb710('0x3')]();var fs_extra=require(_0xb710('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb710('0x5'));var config=require(_0xb710('0x6'));var controller=require(_0xb710('0x7'));router[_0xb710('0x8')]('/',auth[_0xb710('0x9')](),controller['index']);router[_0xb710('0x8')](_0xb710('0xa'),auth['isAuthenticated'](),controller[_0xb710('0xb')]);router[_0xb710('0x8')]('/:id/conditions',auth[_0xb710('0x9')](),controller[_0xb710('0xc')]);router['get']('/:id/actions',auth[_0xb710('0x9')](),controller[_0xb710('0xd')]);router[_0xb710('0xe')]('/',auth['isAuthenticated'](),controller[_0xb710('0xf')]);router[_0xb710('0xe')]('/:id/conditions',auth[_0xb710('0x9')](),controller[_0xb710('0x10')]);router[_0xb710('0xe')](_0xb710('0x11'),auth[_0xb710('0x9')](),controller['addActions']);router[_0xb710('0x12')](_0xb710('0xa'),auth[_0xb710('0x9')](),controller[_0xb710('0x13')]);router['delete'](_0xb710('0xa'),auth[_0xb710('0x9')](),controller[_0xb710('0x14')]);module['exports']=router;
\ No newline at end of file
index 9c63979..2b0f81e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d39=['UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','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\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x5d39,0xcb));var _0x95d3=function(_0x5c489a,_0x10236a){_0x5c489a=_0x5c489a-0x0;var _0x3dcd94=_0x5d39[_0x5c489a];return _0x3dcd94;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x95d3('0x0')],'unique':_0x95d3('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x95d3('0x2')](_0x95d3('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x95d3('0x0')]},'active':{'type':Sequelize[_0x95d3('0x4')],'defaultValue':0x0,'comment':_0x95d3('0x5')},'limitCalls':{'type':Sequelize[_0x95d3('0x6')](0x4)[_0x95d3('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x95d3('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x95d3('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0x95d3('0x6')](0x3)[_0x95d3('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x95d3('0x6')](0x3)[_0x95d3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x95d3('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x95d3('0x6')](0x5)[_0x95d3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x95d3('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x95d3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x95d3('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x95d3('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x95d3('0x6')](0x5)[_0x95d3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x95d3('0xb')},'dialGlobalMaxRetry':{'type':Sequelize[_0x95d3('0x6')](0x3)[_0x95d3('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x95d3('0xc')},'dialTimezone':{'type':Sequelize[_0x95d3('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x95d3('0x0')],'defaultValue':_0x95d3('0xd')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x95d3('0xe'),_0x95d3('0xf'),_0x95d3('0x10')),'defaultValue':_0x95d3('0xe')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x95d3('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x95d3('0x6')](0x9)[_0x95d3('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x95d3('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x95d3('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x95d3('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x95d3('0x6')](0x9)[_0x95d3('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x95d3('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x95d3('0x6')](0x9)[_0x95d3('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x95d3('0x6')](0x9)[_0x95d3('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x95d3('0x6')](0x9)[_0x95d3('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x95d3('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x95d3('0x6')](0x5)[_0x95d3('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x95d3('0x6')](0x9)[_0x95d3('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x95d3('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0x95d3('0x2')](_0x95d3('0x17'),_0x95d3('0x18')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x95d3('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x95d3('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x95d3('0x19')},'dialCutDigit':{'type':Sequelize[_0x95d3('0x6')](0x3)[_0x95d3('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x95d3('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x95d3('0x6')](0x3)[_0x95d3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x95d3('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0x95d3('0x6')](0x3)[_0x95d3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x95d3('0x1c')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x95d3('0x6')](0x3)[_0x95d3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x95d3('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x95d3('0x6')](0x5)[_0x95d3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x95d3('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x95d3('0x6')](0x3)[_0x95d3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x95d3('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x95d3('0x6')](0x5)[_0x95d3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x95d3('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x95d3('0x6')](0x3)[_0x95d3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x95d3('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x95d3('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x95d3('0x22')}};
\ No newline at end of file
+var _0xc04a=['#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)','#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','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','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)','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'];(function(_0x5657bb,_0x2f1219){var _0x2a5ecb=function(_0x193add){while(--_0x193add){_0x5657bb['push'](_0x5657bb['shift']());}};_0x2a5ecb(++_0x2f1219);}(_0xc04a,0x12e));var _0xac04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc04a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xac04('0x0'));module['exports']={'name':{'type':Sequelize[_0xac04('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xac04('0x2')](_0xac04('0x3')),'allowNull':![],'defaultValue':_0xac04('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xac04('0x4')],'defaultValue':0x0,'comment':_0xac04('0x5')},'limitCalls':{'type':Sequelize[_0xac04('0x6')](0x4)[_0xac04('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xac04('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xac04('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xac04('0x6')](0x3)[_0xac04('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xac04('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xac04('0x6')](0x5)[_0xac04('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xac04('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xac04('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xac04('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xac04('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xac04('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xac04('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xac04('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xac04('0x6')](0x3)[_0xac04('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xac04('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xac04('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xac04('0x2')](_0xac04('0xe'),'never',_0xac04('0xf')),'defaultValue':_0xac04('0xe')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xac04('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xac04('0x10')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xac04('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xac04('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xac04('0x11')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xac04('0x12')},'dialAMDMinWordLength':{'type':Sequelize[_0xac04('0x6')](0x9)[_0xac04('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xac04('0x6')](0x9)[_0xac04('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xac04('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xac04('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xac04('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xac04('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xac04('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xac04('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xac04('0x16')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xac04('0x17'),_0xac04('0x18')),'defaultValue':_0xac04('0x17')},'dialPrefix':{'type':Sequelize[_0xac04('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xac04('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xac04('0x19')},'dialCutDigit':{'type':Sequelize[_0xac04('0x6')](0x3)[_0xac04('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xac04('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xac04('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xac04('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xac04('0x6')](0x5)[_0xac04('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xac04('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0xac04('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xac04('0x1d')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xac04('0x6')](0x3)[_0xac04('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xac04('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xac04('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0xac04('0x6')](0x3)[_0xac04('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xac04('0x20')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xac04('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xac04('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xac04('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xac04('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xac04('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xac04('0x23')}};
\ No newline at end of file
index 83f252e..3ada8b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde6f=['crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','IvrCampaigns','UserProfileResource','destroy','error','stack','name','index','map','Campaign','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','role','getHoppers','findOne','CmHopper','nolimit','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','dialCheckDuplicateType','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','select','field','NOW()','CmListId','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel'];(function(_0x23c02b,_0x411b4d){var _0x25efc5=function(_0x50e9e4){while(--_0x50e9e4){_0x23c02b['push'](_0x23c02b['shift']());}};_0x25efc5(++_0x411b4d);}(_0xde6f,0x84));var _0xfde6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde6f[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfde6('0x0'));var jsonpatch=require(_0xfde6('0x1'));var rp=require(_0xfde6('0x2'));var moment=require('moment');var BPromise=require(_0xfde6('0x3'));var Mustache=require(_0xfde6('0x4'));var util=require(_0xfde6('0x5'));var path=require(_0xfde6('0x6'));var sox=require(_0xfde6('0x7'));var csv=require(_0xfde6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfde6('0x9'));var squel=require(_0xfde6('0xa'));var crypto=require(_0xfde6('0xb'));var jsforce=require(_0xfde6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfde6('0x8'));var querystring=require(_0xfde6('0xd'));var Papa=require(_0xfde6('0xe'));var Redis=require('ioredis');var authService=require(_0xfde6('0xf'));var qs=require(_0xfde6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfde6('0x11'))(_0xfde6('0x12'));var utils=require(_0xfde6('0x13'));var config=require(_0xfde6('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xfde6('0x15'))['db'];function respondWithStatusCode(_0x9a96cf,_0x3a3776){_0x3a3776=_0x3a3776||0xcc;return function(_0x1c5ade){if(_0x1c5ade){return _0x9a96cf[_0xfde6('0x16')](_0x3a3776);}return _0x9a96cf['status'](_0x3a3776)[_0xfde6('0x17')]();};}function respondWithResult(_0x18de07,_0x5d129c){_0x5d129c=_0x5d129c||0xc8;return function(_0x8237f4){if(_0x8237f4){return _0x18de07[_0xfde6('0x18')](_0x5d129c)[_0xfde6('0x19')](_0x8237f4);}};}function respondWithFilteredResult(_0x506b96,_0x159254){return function(_0xcd2776){if(_0xcd2776){var _0x101ea8=typeof _0x159254[_0xfde6('0x1a')]==='undefined'&&typeof _0x159254['limit']===_0xfde6('0x1b');var _0x507dbf=_0xcd2776[_0xfde6('0x1c')];var _0x1bfeba=_0x101ea8?0x0:_0x159254['offset'];var _0x3514f2=_0x101ea8?_0xcd2776['count']:_0x159254[_0xfde6('0x1a')]+_0x159254[_0xfde6('0x1d')];var _0x44756d;if(_0x3514f2>=_0x507dbf){_0x3514f2=_0x507dbf;_0x44756d=0xc8;}else{_0x44756d=0xce;}_0x506b96[_0xfde6('0x18')](_0x44756d);return _0x506b96[_0xfde6('0x1e')](_0xfde6('0x1f'),_0x1bfeba+'-'+_0x3514f2+'/'+_0x507dbf)[_0xfde6('0x19')](_0xcd2776);}return null;};}function patchUpdates(_0x1841d8){return function(_0x1a4076){try{jsonpatch['apply'](_0x1a4076,_0x1841d8,!![]);}catch(_0x2ab014){return BPromise[_0xfde6('0x20')](_0x2ab014);}return _0x1a4076['save']();};}function saveUpdates(_0x2577a1,_0x458cfc){return function(_0x4ff8e2){if(_0x4ff8e2){return _0x4ff8e2[_0xfde6('0x21')](_0x2577a1)[_0xfde6('0x22')](function(_0x4919ab){return _0x4919ab;});}return null;};}function removeEntity(_0x56664c,_0x2c3c4d){return function(_0xc18655){if(_0xc18655){return _0xc18655['destroy']()[_0xfde6('0x22')](function(){var _0x492219=_0xc18655['get']({'plain':!![]});var _0x2cac84=_0xfde6('0x23');return db[_0xfde6('0x24')][_0xfde6('0x25')]({'where':{'type':_0x2cac84,'resourceId':_0x492219['id']}})[_0xfde6('0x22')](function(){return _0xc18655;});})[_0xfde6('0x22')](function(){_0x56664c['status'](0xcc)[_0xfde6('0x17')]();});}};}function handleEntityNotFound(_0x262373,_0x5f2171){return function(_0x26b355){if(!_0x26b355){_0x262373['sendStatus'](0x194);}return _0x26b355;};}function handleError(_0x2e9b86,_0x2eb564){_0x2eb564=_0x2eb564||0x1f4;return function(_0x59661f){logger[_0xfde6('0x26')](_0x59661f[_0xfde6('0x27')]);if(_0x59661f['name']){delete _0x59661f[_0xfde6('0x28')];}_0x2e9b86[_0xfde6('0x18')](_0x2eb564)['send'](_0x59661f);};}exports[_0xfde6('0x29')]=function(_0x4d8860,_0x287d8d){var _0x584476={},_0x52c0db={},_0x4bde2a={'count':0x0,'rows':[]};var _0x3d0b9b=_[_0xfde6('0x2a')](db[_0xfde6('0x2b')][_0xfde6('0x2c')],function(_0x43dca4){return{'name':_0x43dca4['fieldName'],'type':_0x43dca4['type']['key']};});_0x52c0db[_0xfde6('0x2d')]=_[_0xfde6('0x2a')](_0x3d0b9b,_0xfde6('0x28'));_0x52c0db[_0xfde6('0x2e')]=_[_0xfde6('0x2f')](_0x4d8860[_0xfde6('0x2e')]);_0x52c0db[_0xfde6('0x30')]=_[_0xfde6('0x31')](_0x52c0db[_0xfde6('0x2d')],_0x52c0db['query']);_0x584476[_0xfde6('0x32')]=_[_0xfde6('0x31')](_0x52c0db[_0xfde6('0x2d')],qs[_0xfde6('0x33')](_0x4d8860['query'][_0xfde6('0x33')]));_0x584476['attributes']=_0x584476[_0xfde6('0x32')][_0xfde6('0x34')]?_0x584476[_0xfde6('0x32')]:_0x52c0db[_0xfde6('0x2d')];if(!_0x4d8860['query'][_0xfde6('0x35')]('nolimit')){_0x584476[_0xfde6('0x1d')]=qs[_0xfde6('0x1d')](_0x4d8860['query'][_0xfde6('0x1d')]);_0x584476[_0xfde6('0x1a')]=qs[_0xfde6('0x1a')](_0x4d8860[_0xfde6('0x2e')]['offset']);}_0x584476[_0xfde6('0x36')]=qs[_0xfde6('0x37')](_0x4d8860[_0xfde6('0x2e')][_0xfde6('0x37')]);_0x584476[_0xfde6('0x38')]=qs[_0xfde6('0x30')](_[_0xfde6('0x39')](_0x4d8860[_0xfde6('0x2e')],_0x52c0db[_0xfde6('0x30')]),_0x3d0b9b);if(_0x4d8860[_0xfde6('0x2e')][_0xfde6('0x3a')]){_0x584476[_0xfde6('0x38')]=_[_0xfde6('0x3b')](_0x584476[_0xfde6('0x38')],{'$or':_[_0xfde6('0x2a')](_0x3d0b9b,function(_0x1adae6){if(_0x1adae6[_0xfde6('0x3c')]!=='VIRTUAL'){var _0x4b7160={};_0x4b7160[_0x1adae6['name']]={'$like':'%'+_0x4d8860[_0xfde6('0x2e')][_0xfde6('0x3a')]+'%'};return _0x4b7160;}})});}_0x584476=_['merge']({},_0x584476,_0x4d8860[_0xfde6('0x3d')]);var _0x2f5c2e={'where':_0x584476[_0xfde6('0x38')]};return db[_0xfde6('0x2b')][_0xfde6('0x1c')](_0x2f5c2e)[_0xfde6('0x22')](function(_0x2b7a24){_0x4bde2a[_0xfde6('0x1c')]=_0x2b7a24;if(_0x4d8860[_0xfde6('0x2e')][_0xfde6('0x3e')]){_0x584476[_0xfde6('0x3f')]=[{'all':!![]}];}return db[_0xfde6('0x2b')][_0xfde6('0x40')](_0x584476);})['then'](function(_0x26e182){_0x4bde2a[_0xfde6('0x41')]=_0x26e182;return _0x4bde2a;})['then'](respondWithFilteredResult(_0x287d8d,_0x584476))[_0xfde6('0x42')](handleError(_0x287d8d,null));};exports[_0xfde6('0x43')]=function(_0x3b988f,_0x330719){var _0x383698={'raw':![],'where':{'id':_0x3b988f[_0xfde6('0x44')]['id']}},_0x3b2cfe={};_0x3b2cfe[_0xfde6('0x2d')]=_[_0xfde6('0x2f')](db[_0xfde6('0x2b')][_0xfde6('0x2c')]);_0x3b2cfe[_0xfde6('0x2e')]=_[_0xfde6('0x2f')](_0x3b988f[_0xfde6('0x2e')]);_0x3b2cfe[_0xfde6('0x30')]=_[_0xfde6('0x31')](_0x3b2cfe['model'],_0x3b2cfe[_0xfde6('0x2e')]);_0x383698[_0xfde6('0x32')]=_[_0xfde6('0x31')](_0x3b2cfe[_0xfde6('0x2d')],qs[_0xfde6('0x33')](_0x3b988f['query'][_0xfde6('0x33')]));_0x383698[_0xfde6('0x32')]=_0x383698[_0xfde6('0x32')]['length']?_0x383698['attributes']:_0x3b2cfe[_0xfde6('0x2d')];if(_0x3b988f[_0xfde6('0x2e')][_0xfde6('0x3e')]){_0x383698[_0xfde6('0x3f')]=[{'all':!![]}];}_0x383698=_[_0xfde6('0x3b')]({},_0x383698,_0x3b988f['options']);return db[_0xfde6('0x2b')][_0xfde6('0x45')](_0x383698)[_0xfde6('0x22')](handleEntityNotFound(_0x330719,null))[_0xfde6('0x22')](respondWithResult(_0x330719,null))['catch'](handleError(_0x330719,null));};exports[_0xfde6('0x46')]=function(_0x5ccefb,_0x1cb1c5){return db[_0xfde6('0x2b')][_0xfde6('0x46')](_0x5ccefb[_0xfde6('0x47')],{})[_0xfde6('0x22')](function(_0x31d0a5){var _0x362ed2=_0x5ccefb[_0xfde6('0x48')][_0xfde6('0x49')]({'plain':!![]});if(!_0x362ed2)throw new Error(_0xfde6('0x4a'));if(_0x362ed2['role']===_0xfde6('0x48')){var _0x43677d=_0x31d0a5['get']({'plain':!![]});var _0xa649e7=_0xfde6('0x23');return db['UserProfileSection'][_0xfde6('0x45')]({'where':{'name':_0xa649e7,'userProfileId':_0x362ed2[_0xfde6('0x4b')]},'raw':!![]})[_0xfde6('0x22')](function(_0x27dfb2){if(_0x27dfb2&&_0x27dfb2[_0xfde6('0x4c')]===0x0){return db[_0xfde6('0x24')][_0xfde6('0x46')]({'name':_0x43677d[_0xfde6('0x28')],'resourceId':_0x43677d['id'],'type':_0x27dfb2[_0xfde6('0x28')],'sectionId':_0x27dfb2['id']},{})[_0xfde6('0x22')](function(){return _0x31d0a5;});}else{return _0x31d0a5;}})[_0xfde6('0x42')](function(_0x507d55){logger['error'](_0xfde6('0x4d'),_0x507d55);throw _0x507d55;});}return _0x31d0a5;})[_0xfde6('0x22')](respondWithResult(_0x1cb1c5,0xc9))[_0xfde6('0x42')](handleError(_0x1cb1c5,null));};exports[_0xfde6('0x4e')]=function(_0x344c8e,_0x267e5d){var _0x42256d={'where':{'id':_0x344c8e[_0xfde6('0x44')]['id']}},_0x2a25d6={};_0x2a25d6[_0xfde6('0x2d')]=_[_0xfde6('0x2f')](db[_0xfde6('0x2b')][_0xfde6('0x2c')]);_0x42256d[_0xfde6('0x32')]=_[_0xfde6('0x31')](_0x2a25d6[_0xfde6('0x2d')],qs[_0xfde6('0x33')](_0x344c8e['query']['fields']));_0x42256d['attributes']=_0x42256d[_0xfde6('0x32')][_0xfde6('0x34')]?_0x42256d[_0xfde6('0x32')]:_0x2a25d6[_0xfde6('0x2d')];if(_0x344c8e[_0xfde6('0x2e')][_0xfde6('0x3e')]){_0x42256d['include']=[{'all':!![]}];}_0x42256d=_['merge']({},_0x42256d,_0x344c8e[_0xfde6('0x3d')]);return db['Campaign']['find'](_0x42256d)[_0xfde6('0x22')](handleEntityNotFound(_0x267e5d,null))[_0xfde6('0x22')](function(_0x43587f){if(_0x43587f){var _0x1de127=_0x43587f[_0xfde6('0x49')]({'plain':!![]});_0x1de127=qs[_0xfde6('0x4f')](_0x1de127,['id','createdAt','updatedAt']);_0x344c8e[_0xfde6('0x47')]=_['omit'](_0x344c8e[_0xfde6('0x47')],['id','createdAt',_0xfde6('0x50')]);return db[_0xfde6('0x2b')][_0xfde6('0x46')](_[_0xfde6('0x3b')](_0x1de127,_0x344c8e[_0xfde6('0x47')]),{'include':_0x344c8e[_0xfde6('0x2e')][_0xfde6('0x3e')]?[{'all':!![]}]:undefined})[_0xfde6('0x22')](function(_0x4ebd9){var _0x350cf4=_0x344c8e['user'][_0xfde6('0x49')]({'plain':!![]});if(!_0x350cf4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x350cf4[_0xfde6('0x51')]===_0xfde6('0x48')){var _0x24ef0f=_0x4ebd9[_0xfde6('0x49')]({'plain':!![]});var _0x4d81d5=_0xfde6('0x23');return db['UserProfileSection'][_0xfde6('0x45')]({'where':{'name':_0x4d81d5,'userProfileId':_0x350cf4[_0xfde6('0x4b')]},'raw':!![]})[_0xfde6('0x22')](function(_0x5aa2d6){if(_0x5aa2d6&&_0x5aa2d6[_0xfde6('0x4c')]===0x0){return db[_0xfde6('0x24')][_0xfde6('0x46')]({'name':_0x24ef0f[_0xfde6('0x28')],'resourceId':_0x24ef0f['id'],'type':_0x5aa2d6[_0xfde6('0x28')],'sectionId':_0x5aa2d6['id']},{})[_0xfde6('0x22')](function(){return _0x4ebd9;});}else{return _0x4ebd9;}})[_0xfde6('0x42')](function(_0x568f5e){logger[_0xfde6('0x26')](_0xfde6('0x4d'),_0x568f5e);throw _0x568f5e;});}return _0x4ebd9;});}})[_0xfde6('0x22')](respondWithResult(_0x267e5d,0xc9))[_0xfde6('0x42')](handleError(_0x267e5d,null));};exports[_0xfde6('0x21')]=function(_0x2c6ade,_0x98ef51){if(_0x2c6ade[_0xfde6('0x47')]['id']){delete _0x2c6ade[_0xfde6('0x47')]['id'];}return db[_0xfde6('0x2b')][_0xfde6('0x45')]({'where':{'id':_0x2c6ade[_0xfde6('0x44')]['id']}})[_0xfde6('0x22')](handleEntityNotFound(_0x98ef51,null))[_0xfde6('0x22')](saveUpdates(_0x2c6ade[_0xfde6('0x47')],null))['then'](respondWithResult(_0x98ef51,null))[_0xfde6('0x42')](handleError(_0x98ef51,null));};exports['destroy']=function(_0x4c161d,_0x4f4fd0){return db['Campaign'][_0xfde6('0x45')]({'where':{'id':_0x4c161d['params']['id']}})['then'](handleEntityNotFound(_0x4f4fd0,null))['then'](removeEntity(_0x4f4fd0,null))[_0xfde6('0x42')](handleError(_0x4f4fd0,null));};exports[_0xfde6('0x52')]=function(_0x5ee0f0,_0x6396de,_0x3bc7de){var _0x15b0bc={'raw':!![],'where':{}};var _0x1c9fae={};var _0x578ea7={'count':0x0,'rows':[]};return db[_0xfde6('0x2b')][_0xfde6('0x53')]({'where':{'id':_0x5ee0f0[_0xfde6('0x44')]['id']}})[_0xfde6('0x22')](handleEntityNotFound(_0x6396de,null))[_0xfde6('0x22')](function(_0x45e3ee){if(_0x45e3ee){_0x1c9fae[_0xfde6('0x2d')]=_[_0xfde6('0x2f')](db[_0xfde6('0x54')][_0xfde6('0x2c')]);_0x1c9fae[_0xfde6('0x2e')]=_[_0xfde6('0x2f')](_0x5ee0f0[_0xfde6('0x2e')]);_0x1c9fae[_0xfde6('0x30')]=_['intersection'](_0x1c9fae[_0xfde6('0x2d')],_0x1c9fae[_0xfde6('0x2e')]);_0x15b0bc[_0xfde6('0x32')]=_['intersection'](_0x1c9fae['model'],qs[_0xfde6('0x33')](_0x5ee0f0['query'][_0xfde6('0x33')]));_0x15b0bc[_0xfde6('0x32')]=_0x15b0bc[_0xfde6('0x32')][_0xfde6('0x34')]?_0x15b0bc[_0xfde6('0x32')]:_0x1c9fae[_0xfde6('0x2d')];if(!_0x5ee0f0[_0xfde6('0x2e')][_0xfde6('0x35')](_0xfde6('0x55'))){_0x15b0bc[_0xfde6('0x1d')]=qs[_0xfde6('0x1d')](_0x5ee0f0[_0xfde6('0x2e')][_0xfde6('0x1d')]);_0x15b0bc[_0xfde6('0x1a')]=qs[_0xfde6('0x1a')](_0x5ee0f0[_0xfde6('0x2e')]['offset']);}_0x15b0bc[_0xfde6('0x36')]=qs[_0xfde6('0x37')](_0x5ee0f0[_0xfde6('0x2e')]['sort']);_0x15b0bc[_0xfde6('0x38')]=qs[_0xfde6('0x30')](_['pick'](_0x5ee0f0[_0xfde6('0x2e')],_0x1c9fae[_0xfde6('0x30')]));_0x15b0bc[_0xfde6('0x38')]['CampaignId']=_0x45e3ee['id'];if(_0x5ee0f0['query'][_0xfde6('0x3a')]){_0x15b0bc[_0xfde6('0x38')]=_['merge'](_0x15b0bc[_0xfde6('0x38')],{'$or':_[_0xfde6('0x2a')](_0x15b0bc['attributes'],function(_0x57bef0){var _0x4fbf9f={};_0x4fbf9f[_0x57bef0]={'$like':'%'+_0x5ee0f0['query'][_0xfde6('0x3a')]+'%'};return _0x4fbf9f;})});}_0x15b0bc=_[_0xfde6('0x3b')]({},_0x15b0bc,_0x5ee0f0[_0xfde6('0x3d')]);return db[_0xfde6('0x54')][_0xfde6('0x1c')]({'where':_0x15b0bc[_0xfde6('0x38')]})['then'](function(_0x529b14){_0x578ea7['count']=_0x529b14;if(_0x5ee0f0[_0xfde6('0x2e')][_0xfde6('0x3e')]){_0x15b0bc[_0xfde6('0x3f')]=[{'all':!![]}];}return db['CmHopper'][_0xfde6('0x40')](_0x15b0bc);})[_0xfde6('0x22')](function(_0x3cb08c){_0x578ea7[_0xfde6('0x41')]=_0x3cb08c;return _0x578ea7;});}})[_0xfde6('0x22')](respondWithFilteredResult(_0x6396de,_0x15b0bc))[_0xfde6('0x42')](handleError(_0x6396de,null));};exports[_0xfde6('0x56')]=function(_0x9e8a04,_0x93eb48,_0x585d91){var _0x572903={'raw':!![],'where':{}};var _0x2d1e60={};var _0x5025e7={'count':0x0,'rows':[]};return db[_0xfde6('0x2b')]['findOne']({'where':{'id':_0x9e8a04[_0xfde6('0x44')]['id']}})[_0xfde6('0x22')](handleEntityNotFound(_0x93eb48,null))[_0xfde6('0x22')](function(_0xabb89c){if(_0xabb89c){_0x2d1e60[_0xfde6('0x2d')]=_[_0xfde6('0x2f')](db[_0xfde6('0x57')][_0xfde6('0x2c')]);_0x2d1e60[_0xfde6('0x2e')]=_['keys'](_0x9e8a04[_0xfde6('0x2e')]);_0x2d1e60[_0xfde6('0x30')]=_['intersection'](_0x2d1e60[_0xfde6('0x2d')],_0x2d1e60[_0xfde6('0x2e')]);_0x572903[_0xfde6('0x32')]=_[_0xfde6('0x31')](_0x2d1e60[_0xfde6('0x2d')],qs[_0xfde6('0x33')](_0x9e8a04[_0xfde6('0x2e')][_0xfde6('0x33')]));_0x572903[_0xfde6('0x32')]=_0x572903[_0xfde6('0x32')][_0xfde6('0x34')]?_0x572903[_0xfde6('0x32')]:_0x2d1e60[_0xfde6('0x2d')];if(!_0x9e8a04[_0xfde6('0x2e')][_0xfde6('0x35')](_0xfde6('0x55'))){_0x572903[_0xfde6('0x1d')]=qs[_0xfde6('0x1d')](_0x9e8a04[_0xfde6('0x2e')][_0xfde6('0x1d')]);_0x572903[_0xfde6('0x1a')]=qs['offset'](_0x9e8a04[_0xfde6('0x2e')][_0xfde6('0x1a')]);}_0x572903['order']=qs['sort'](_0x9e8a04['query'][_0xfde6('0x37')]);_0x572903[_0xfde6('0x38')]=qs[_0xfde6('0x30')](_['pick'](_0x9e8a04[_0xfde6('0x2e')],_0x2d1e60['filters']));_0x572903[_0xfde6('0x38')][_0xfde6('0x58')]=_0xabb89c['id'];if(_0x9e8a04['query'][_0xfde6('0x3a')]){_0x572903['where']=_[_0xfde6('0x3b')](_0x572903['where'],{'$or':_[_0xfde6('0x2a')](_0x572903[_0xfde6('0x32')],function(_0x5cfd3e){var _0x2a73a4={};_0x2a73a4[_0x5cfd3e]={'$like':'%'+_0x9e8a04[_0xfde6('0x2e')][_0xfde6('0x3a')]+'%'};return _0x2a73a4;})});}_0x572903=_['merge']({},_0x572903,_0x9e8a04[_0xfde6('0x3d')]);return db[_0xfde6('0x57')][_0xfde6('0x1c')]({'where':_0x572903['where']})[_0xfde6('0x22')](function(_0x1b7ff8){_0x5025e7[_0xfde6('0x1c')]=_0x1b7ff8;if(_0x9e8a04[_0xfde6('0x2e')][_0xfde6('0x3e')]){_0x572903['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xfde6('0x40')](_0x572903);})[_0xfde6('0x22')](function(_0x4b9736){_0x5025e7[_0xfde6('0x41')]=_0x4b9736;return _0x5025e7;});}})[_0xfde6('0x22')](respondWithFilteredResult(_0x93eb48,_0x572903))[_0xfde6('0x42')](handleError(_0x93eb48,null));};exports[_0xfde6('0x59')]=function(_0x528d9,_0x1c5f09,_0x503850){var _0xf2f95d={'raw':!![],'where':{}};var _0x3b200a={};var _0x5e6073={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x528d9['params']['id']}})[_0xfde6('0x22')](handleEntityNotFound(_0x1c5f09,null))[_0xfde6('0x22')](function(_0x3b6b71){if(_0x3b6b71){_0x3b200a['model']=_[_0xfde6('0x2f')](db['CmHopperFinal'][_0xfde6('0x2c')]);_0x3b200a[_0xfde6('0x2e')]=_['keys'](_0x528d9['query']);_0x3b200a['filters']=_[_0xfde6('0x31')](_0x3b200a[_0xfde6('0x2d')],_0x3b200a['query']);_0xf2f95d[_0xfde6('0x32')]=_[_0xfde6('0x31')](_0x3b200a[_0xfde6('0x2d')],qs[_0xfde6('0x33')](_0x528d9[_0xfde6('0x2e')][_0xfde6('0x33')]));_0xf2f95d['attributes']=_0xf2f95d[_0xfde6('0x32')]['length']?_0xf2f95d[_0xfde6('0x32')]:_0x3b200a['model'];if(!_0x528d9[_0xfde6('0x2e')][_0xfde6('0x35')]('nolimit')){_0xf2f95d[_0xfde6('0x1d')]=qs[_0xfde6('0x1d')](_0x528d9['query'][_0xfde6('0x1d')]);_0xf2f95d[_0xfde6('0x1a')]=qs[_0xfde6('0x1a')](_0x528d9[_0xfde6('0x2e')][_0xfde6('0x1a')]);}_0xf2f95d[_0xfde6('0x36')]=qs[_0xfde6('0x37')](_0x528d9['query'][_0xfde6('0x37')]);_0xf2f95d[_0xfde6('0x38')]=qs[_0xfde6('0x30')](_[_0xfde6('0x39')](_0x528d9[_0xfde6('0x2e')],_0x3b200a[_0xfde6('0x30')]));_0xf2f95d[_0xfde6('0x38')]['CampaignId']=_0x3b6b71['id'];if(_0x528d9[_0xfde6('0x2e')][_0xfde6('0x3a')]){_0xf2f95d[_0xfde6('0x38')]=_[_0xfde6('0x3b')](_0xf2f95d[_0xfde6('0x38')],{'$or':_['map'](_0xf2f95d[_0xfde6('0x32')],function(_0x4c229c){var _0x19d18f={};_0x19d18f[_0x4c229c]={'$like':'%'+_0x528d9['query']['filter']+'%'};return _0x19d18f;})});}_0xf2f95d=_['merge']({},_0xf2f95d,_0x528d9[_0xfde6('0x3d')]);return db[_0xfde6('0x5a')]['count']({'where':_0xf2f95d[_0xfde6('0x38')]})['then'](function(_0x23ddfa){_0x5e6073['count']=_0x23ddfa;if(_0x528d9[_0xfde6('0x2e')][_0xfde6('0x3e')]){_0xf2f95d[_0xfde6('0x3f')]=[{'all':!![]}];}return db[_0xfde6('0x5a')]['findAll'](_0xf2f95d);})[_0xfde6('0x22')](function(_0x401607){_0x5e6073[_0xfde6('0x41')]=_0x401607;return _0x5e6073;});}})[_0xfde6('0x22')](respondWithFilteredResult(_0x1c5f09,_0xf2f95d))[_0xfde6('0x42')](handleError(_0x1c5f09,null));};exports[_0xfde6('0x5b')]=function(_0x426f3b,_0x5efc85,_0x2cfc60){var _0x14d65a={'raw':!![],'where':{}};var _0x1fab0f={};var _0x256918={'count':0x0,'rows':[]};return db[_0xfde6('0x2b')][_0xfde6('0x53')]({'where':{'id':_0x426f3b[_0xfde6('0x44')]['id']}})[_0xfde6('0x22')](handleEntityNotFound(_0x5efc85,null))['then'](function(_0x15c827){if(_0x15c827){_0x1fab0f[_0xfde6('0x2d')]=_[_0xfde6('0x2f')](db[_0xfde6('0x5c')][_0xfde6('0x2c')]);_0x1fab0f[_0xfde6('0x2e')]=_[_0xfde6('0x2f')](_0x426f3b[_0xfde6('0x2e')]);_0x1fab0f['filters']=_[_0xfde6('0x31')](_0x1fab0f['model'],_0x1fab0f[_0xfde6('0x2e')]);_0x14d65a['attributes']=_[_0xfde6('0x31')](_0x1fab0f[_0xfde6('0x2d')],qs[_0xfde6('0x33')](_0x426f3b[_0xfde6('0x2e')][_0xfde6('0x33')]));_0x14d65a[_0xfde6('0x32')]=_0x14d65a[_0xfde6('0x32')]['length']?_0x14d65a[_0xfde6('0x32')]:_0x1fab0f[_0xfde6('0x2d')];if(!_0x426f3b['query'][_0xfde6('0x35')]('nolimit')){_0x14d65a['limit']=qs['limit'](_0x426f3b[_0xfde6('0x2e')][_0xfde6('0x1d')]);_0x14d65a['offset']=qs[_0xfde6('0x1a')](_0x426f3b['query'][_0xfde6('0x1a')]);}_0x14d65a[_0xfde6('0x36')]=qs[_0xfde6('0x37')](_0x426f3b[_0xfde6('0x2e')]['sort']);_0x14d65a[_0xfde6('0x38')]=qs[_0xfde6('0x30')](_['pick'](_0x426f3b[_0xfde6('0x2e')],_0x1fab0f['filters']));_0x14d65a[_0xfde6('0x38')][_0xfde6('0x58')]=_0x15c827['id'];if(_0x426f3b[_0xfde6('0x2e')]['filter']){_0x14d65a[_0xfde6('0x38')]=_[_0xfde6('0x3b')](_0x14d65a[_0xfde6('0x38')],{'$or':_['map'](_0x14d65a[_0xfde6('0x32')],function(_0x56755e){var _0x52bf11={};_0x52bf11[_0x56755e]={'$like':'%'+_0x426f3b[_0xfde6('0x2e')][_0xfde6('0x3a')]+'%'};return _0x52bf11;})});}_0x14d65a=_['merge']({},_0x14d65a,_0x426f3b[_0xfde6('0x3d')]);return db[_0xfde6('0x5c')][_0xfde6('0x1c')]({'where':_0x14d65a[_0xfde6('0x38')]})[_0xfde6('0x22')](function(_0x1f6497){_0x256918['count']=_0x1f6497;if(_0x426f3b[_0xfde6('0x2e')]['includeAll']){_0x14d65a[_0xfde6('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xfde6('0x40')](_0x14d65a);})['then'](function(_0x1417f2){_0x256918[_0xfde6('0x41')]=_0x1417f2;return _0x256918;});}})[_0xfde6('0x22')](respondWithFilteredResult(_0x5efc85,_0x14d65a))[_0xfde6('0x42')](handleError(_0x5efc85,null));};exports[_0xfde6('0x5d')]=function(_0x2a2d24,_0xa105b8,_0x4b4359){var _0xf918e3={};var _0x14ac2b={};var _0x24e236;var _0x3b583e;return db['Campaign'][_0xfde6('0x53')]({'where':{'id':_0x2a2d24[_0xfde6('0x44')]['id']}})[_0xfde6('0x22')](handleEntityNotFound(_0xa105b8,null))[_0xfde6('0x22')](function(_0x186376){if(_0x186376){_0x24e236=_0x186376;_0x14ac2b[_0xfde6('0x2d')]=_[_0xfde6('0x2f')](db[_0xfde6('0x5e')][_0xfde6('0x2c')]);_0x14ac2b[_0xfde6('0x2e')]=_[_0xfde6('0x2f')](_0x2a2d24['query']);_0x14ac2b['filters']=_[_0xfde6('0x31')](_0x14ac2b[_0xfde6('0x2d')],_0x14ac2b[_0xfde6('0x2e')]);_0xf918e3['attributes']=_[_0xfde6('0x31')](_0x14ac2b[_0xfde6('0x2d')],qs['fields'](_0x2a2d24['query']['fields']));_0xf918e3[_0xfde6('0x32')]=_0xf918e3['attributes'][_0xfde6('0x34')]?_0xf918e3['attributes']:_0x14ac2b[_0xfde6('0x2d')];_0xf918e3['order']=qs[_0xfde6('0x37')](_0x2a2d24['query'][_0xfde6('0x37')]);_0xf918e3[_0xfde6('0x38')]=qs[_0xfde6('0x30')](_[_0xfde6('0x39')](_0x2a2d24[_0xfde6('0x2e')],_0x14ac2b[_0xfde6('0x30')]));if(_0x2a2d24[_0xfde6('0x2e')][_0xfde6('0x3a')]){_0xf918e3[_0xfde6('0x38')]=_[_0xfde6('0x3b')](_0xf918e3['where'],{'$or':_[_0xfde6('0x2a')](_0xf918e3['attributes'],function(_0x5e6c69){var _0x35e03b={};_0x35e03b[_0x5e6c69]={'$like':'%'+_0x2a2d24[_0xfde6('0x2e')][_0xfde6('0x3a')]+'%'};return _0x35e03b;})});}_0xf918e3=_[_0xfde6('0x3b')]({},_0xf918e3,_0x2a2d24[_0xfde6('0x3d')]);return _0x24e236[_0xfde6('0x5d')](_0xf918e3);}})[_0xfde6('0x22')](function(_0x321e32){if(_0x321e32){_0x3b583e=_0x321e32['length'];if(!_0x2a2d24['query'][_0xfde6('0x35')]('nolimit')){_0xf918e3['limit']=qs[_0xfde6('0x1d')](_0x2a2d24[_0xfde6('0x2e')][_0xfde6('0x1d')]);_0xf918e3[_0xfde6('0x1a')]=qs[_0xfde6('0x1a')](_0x2a2d24[_0xfde6('0x2e')][_0xfde6('0x1a')]);}return _0x24e236[_0xfde6('0x5d')](_0xf918e3);}})[_0xfde6('0x22')](function(_0x40741d){if(_0x40741d){return _0x40741d?{'count':_0x3b583e,'rows':_0x40741d}:null;}})[_0xfde6('0x22')](respondWithResult(_0xa105b8,null))[_0xfde6('0x42')](handleError(_0xa105b8,null));};exports[_0xfde6('0x5f')]=function(_0x462f4d,_0x4955b8,_0x227b42){var _0x136400,_0x534be7;var _0x2087dd=[];var _0x4f9936=moment()[_0xfde6('0x60')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xfde6('0x2b')][_0xfde6('0x45')]({'where':{'id':_0x462f4d[_0xfde6('0x44')]['id']}})[_0xfde6('0x22')](handleEntityNotFound(_0x4955b8,null))[_0xfde6('0x22')](function(_0x40ef8f){if(_0x40ef8f){_0x534be7=_0x40ef8f;return _0x40ef8f['addLists'](_0x462f4d['body']['ids'],_[_0xfde6('0x4f')](_0x462f4d['body'],[_0xfde6('0x61'),'id'])||{});}return null;})['spread'](function(_0x236a3f){var _0x37a663;var _0x44c2ee;_0x136400=_0x236a3f||[];var _0x2aa208=[];if(_0x236a3f){for(var _0x3d2896=0x0;_0x3d2896<_0x236a3f[_0xfde6('0x34')];_0x3d2896+=0x1){var _0x4fd5a7=_0x236a3f[_0x3d2896]['get']({'plain':!![]});_0x534be7[_0xfde6('0x62')]=_0x462f4d['body'][_0xfde6('0x62')]?_0x462f4d['body']['dialCheckDuplicateType']:_0x534be7[_0xfde6('0x62')];switch(_0x534be7[_0xfde6('0x62')]){case'always':_0x37a663=squel['insert']()['into'](_0xfde6('0x63'))[_0xfde6('0x64')]([_0xfde6('0x65'),_0xfde6('0x66'),_0xfde6('0x67'),'ListId',_0xfde6('0x58'),_0xfde6('0x68'),'updatedAt'],squel[_0xfde6('0x69')]()[_0xfde6('0x6a')](_0xfde6('0x65'),_0xfde6('0x65'))[_0xfde6('0x6a')](_0xfde6('0x6b'),_0xfde6('0x66'))[_0xfde6('0x6a')]('id','ContactId')[_0xfde6('0x6a')](_0x4fd5a7[_0xfde6('0x6c')][_0xfde6('0x6d')](),_0xfde6('0x6e'))[_0xfde6('0x6a')](_0x462f4d[_0xfde6('0x44')]['id'][_0xfde6('0x6d')](),'CampaignId')['field']('\x27'+_0x4f9936+'\x27',_0xfde6('0x68'))[_0xfde6('0x6a')]('\x27'+_0x4f9936+'\x27',_0xfde6('0x50'))[_0xfde6('0x6f')](_0xfde6('0x70'))[_0xfde6('0x38')](_0xfde6('0x71'))['where'](_0xfde6('0x72'),_0x4fd5a7['CmListId'][_0xfde6('0x6d')]())[_0xfde6('0x38')](_0xfde6('0x73'))[_0xfde6('0x38')](_0xfde6('0x74'),squel[_0xfde6('0x69')]()['field'](_0xfde6('0x75'))[_0xfde6('0x6f')](_0xfde6('0x76'))[_0xfde6('0x38')](_0xfde6('0x77'),_0x462f4d['params']['id'][_0xfde6('0x6d')]()))[_0xfde6('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0xfde6('0x69')]()[_0xfde6('0x6a')](_0xfde6('0x78'))[_0xfde6('0x6f')](_0xfde6('0x63'))[_0xfde6('0x38')](_0xfde6('0x77'),_0x462f4d['params']['id'][_0xfde6('0x6d')]())))[_0xfde6('0x6d')]();break;case _0xfde6('0x79'):_0x37a663=squel[_0xfde6('0x7a')]()[_0xfde6('0x7b')]('cm_hopper')['fromQuery']([_0xfde6('0x65'),_0xfde6('0x66'),_0xfde6('0x67'),'ListId',_0xfde6('0x58'),_0xfde6('0x68'),_0xfde6('0x50')],squel[_0xfde6('0x69')]()[_0xfde6('0x6a')](_0xfde6('0x65'),_0xfde6('0x65'))[_0xfde6('0x6a')]('NOW()',_0xfde6('0x66'))[_0xfde6('0x6a')]('id',_0xfde6('0x67'))[_0xfde6('0x6a')](_0x4fd5a7[_0xfde6('0x6c')][_0xfde6('0x6d')](),_0xfde6('0x6e'))['field'](_0x462f4d[_0xfde6('0x44')]['id'][_0xfde6('0x6d')](),_0xfde6('0x58'))['field']('\x27'+_0x4f9936+'\x27',_0xfde6('0x68'))[_0xfde6('0x6a')]('\x27'+_0x4f9936+'\x27',_0xfde6('0x50'))['from'](_0xfde6('0x70'))[_0xfde6('0x38')](_0xfde6('0x71'))[_0xfde6('0x38')](_0xfde6('0x72'),_0x4fd5a7[_0xfde6('0x6c')]['toString']())[_0xfde6('0x38')](_0xfde6('0x73'))['where'](_0xfde6('0x74'),squel['select']()[_0xfde6('0x6a')](_0xfde6('0x78'))[_0xfde6('0x6f')]('cm_hopper')[_0xfde6('0x38')](_0xfde6('0x77'),_0x462f4d[_0xfde6('0x44')]['id'][_0xfde6('0x6d')]())))[_0xfde6('0x6d')]();break;default:_0x37a663=squel[_0xfde6('0x7a')]()[_0xfde6('0x7b')]('cm_hopper')[_0xfde6('0x64')]([_0xfde6('0x65'),_0xfde6('0x66'),'ContactId',_0xfde6('0x6e'),_0xfde6('0x58'),_0xfde6('0x68'),_0xfde6('0x50')],squel[_0xfde6('0x69')]()[_0xfde6('0x6a')](_0xfde6('0x65'),_0xfde6('0x65'))[_0xfde6('0x6a')](_0xfde6('0x6b'),'scheduledAt')[_0xfde6('0x6a')]('id',_0xfde6('0x67'))[_0xfde6('0x6a')](_0x4fd5a7[_0xfde6('0x6c')][_0xfde6('0x6d')](),_0xfde6('0x6e'))[_0xfde6('0x6a')](_0x462f4d['params']['id'][_0xfde6('0x6d')](),_0xfde6('0x58'))[_0xfde6('0x6a')]('\x27'+_0x4f9936+'\x27',_0xfde6('0x68'))['field']('\x27'+_0x4f9936+'\x27','updatedAt')[_0xfde6('0x6f')]('cm_contacts')[_0xfde6('0x38')](_0xfde6('0x71'))['where']('ListId\x20=\x20?',_0x4fd5a7[_0xfde6('0x6c')][_0xfde6('0x6d')]())['where'](_0xfde6('0x73')))[_0xfde6('0x6d')]();}_0x44c2ee=squel[_0xfde6('0x7a')]()[_0xfde6('0x7b')](_0xfde6('0x7c'))[_0xfde6('0x64')]([_0xfde6('0x7d'),_0xfde6('0x66'),_0xfde6('0x65'),'OrderBy','createdAt',_0xfde6('0x50')],squel[_0xfde6('0x69')]()['field'](_0xfde6('0x7e'),'id')['field']('NOW()',_0xfde6('0x66'))[_0xfde6('0x6a')](_0xfde6('0x7f'),_0xfde6('0x65'))[_0xfde6('0x6a')](_0xfde6('0x80'),_0xfde6('0x81'))[_0xfde6('0x6a')]('\x27'+_0x4f9936+'\x27','createdAt')[_0xfde6('0x6a')]('\x27'+_0x4f9936+'\x27','updatedAt')['from'](_0xfde6('0x82'),'ci')['join'](_0xfde6('0x63'),'h',_0xfde6('0x83'))[_0xfde6('0x38')](_0xfde6('0x84'),_0x4fd5a7[_0xfde6('0x6c')][_0xfde6('0x6d')]())['where'](_0xfde6('0x85'),_0x462f4d[_0xfde6('0x44')]['id'][_0xfde6('0x6d')]())[_0xfde6('0x38')](_0xfde6('0x86'),_0x4f9936))['toString']();_0x2aa208[_0xfde6('0x87')](db[_0xfde6('0x88')][_0xfde6('0x2e')](_0x37a663));_0x2087dd[_0xfde6('0x87')](db[_0xfde6('0x88')][_0xfde6('0x2e')](_0x44c2ee));}return BPromise[_0xfde6('0x89')](_0x2aa208);}})['then'](function(){return BPromise[_0xfde6('0x89')](_0x2087dd);})[_0xfde6('0x22')](function(){return _0x136400;})[_0xfde6('0x22')](respondWithResult(_0x4955b8,null))['catch'](handleError(_0x4955b8,null));};exports[_0xfde6('0x8a')]=function(_0x3244e4,_0x94aaf6,_0xf03ef1){return db[_0xfde6('0x2b')][_0xfde6('0x45')]({'where':{'id':_0x3244e4['params']['id']}})[_0xfde6('0x22')](handleEntityNotFound(_0x94aaf6,null))[_0xfde6('0x22')](function(_0x4aee1f){if(_0x4aee1f){return _0x4aee1f[_0xfde6('0x8a')](_0x3244e4[_0xfde6('0x2e')]['ids']);}})[_0xfde6('0x22')](function(_0x59c75b){if(_0x59c75b){return db[_0xfde6('0x54')][_0xfde6('0x25')]({'where':{'ListId':_0x3244e4[_0xfde6('0x2e')][_0xfde6('0x61')],'CampaignId':_0x3244e4[_0xfde6('0x44')]['id']}})[_0xfde6('0x22')](function(){return _0x59c75b;});}})[_0xfde6('0x22')](respondWithStatusCode(_0x94aaf6,null))[_0xfde6('0x42')](handleError(_0x94aaf6,null));};exports['getBlackLists']=function(_0x43e636,_0x170ca2,_0x53ff55){var _0x29b800={};var _0x5ba2d5={};var _0x27cc9a;var _0x34f4b2;return db[_0xfde6('0x2b')]['findOne']({'where':{'id':_0x43e636['params']['id']}})[_0xfde6('0x22')](handleEntityNotFound(_0x170ca2,null))['then'](function(_0x45c797){if(_0x45c797){_0x27cc9a=_0x45c797;_0x5ba2d5[_0xfde6('0x2d')]=_[_0xfde6('0x2f')](db[_0xfde6('0x5e')][_0xfde6('0x2c')]);_0x5ba2d5[_0xfde6('0x2e')]=_[_0xfde6('0x2f')](_0x43e636[_0xfde6('0x2e')]);_0x5ba2d5[_0xfde6('0x30')]=_[_0xfde6('0x31')](_0x5ba2d5[_0xfde6('0x2d')],_0x5ba2d5[_0xfde6('0x2e')]);_0x29b800[_0xfde6('0x32')]=_['intersection'](_0x5ba2d5[_0xfde6('0x2d')],qs['fields'](_0x43e636[_0xfde6('0x2e')][_0xfde6('0x33')]));_0x29b800[_0xfde6('0x32')]=_0x29b800[_0xfde6('0x32')]['length']?_0x29b800[_0xfde6('0x32')]:_0x5ba2d5[_0xfde6('0x2d')];_0x29b800[_0xfde6('0x36')]=qs[_0xfde6('0x37')](_0x43e636['query'][_0xfde6('0x37')]);_0x29b800[_0xfde6('0x38')]=qs[_0xfde6('0x30')](_[_0xfde6('0x39')](_0x43e636[_0xfde6('0x2e')],_0x5ba2d5[_0xfde6('0x30')]));if(_0x43e636[_0xfde6('0x2e')][_0xfde6('0x3a')]){_0x29b800['where']=_[_0xfde6('0x3b')](_0x29b800[_0xfde6('0x38')],{'$or':_['map'](_0x29b800['attributes'],function(_0x53ee5e){var _0x567ad7={};_0x567ad7[_0x53ee5e]={'$like':'%'+_0x43e636[_0xfde6('0x2e')][_0xfde6('0x3a')]+'%'};return _0x567ad7;})});}_0x29b800=_[_0xfde6('0x3b')]({},_0x29b800,_0x43e636[_0xfde6('0x3d')]);return _0x27cc9a['getBlackLists'](_0x29b800);}})['then'](function(_0xa99cbf){if(_0xa99cbf){_0x34f4b2=_0xa99cbf['length'];if(!_0x43e636[_0xfde6('0x2e')]['hasOwnProperty']('nolimit')){_0x29b800[_0xfde6('0x1d')]=qs[_0xfde6('0x1d')](_0x43e636[_0xfde6('0x2e')][_0xfde6('0x1d')]);_0x29b800[_0xfde6('0x1a')]=qs[_0xfde6('0x1a')](_0x43e636[_0xfde6('0x2e')][_0xfde6('0x1a')]);}return _0x27cc9a['getBlackLists'](_0x29b800);}})[_0xfde6('0x22')](function(_0x2bf407){if(_0x2bf407){return _0x2bf407?{'count':_0x34f4b2,'rows':_0x2bf407}:null;}})[_0xfde6('0x22')](respondWithResult(_0x170ca2,null))[_0xfde6('0x42')](handleError(_0x170ca2,null));};exports[_0xfde6('0x8b')]=function(_0x59b59d,_0x4f68ff,_0x2fc51d){var _0x243b10,_0x46b1e4;var _0x4506e6=[];var _0x45718f=moment()[_0xfde6('0x60')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xfde6('0x2b')][_0xfde6('0x45')]({'where':{'id':_0x59b59d[_0xfde6('0x44')]['id']}})['then'](handleEntityNotFound(_0x4f68ff,null))[_0xfde6('0x22')](function(_0x1e572c){if(_0x1e572c){_0x46b1e4=_0x1e572c;return _0x1e572c[_0xfde6('0x8b')](_0x59b59d['body'][_0xfde6('0x61')],_[_0xfde6('0x4f')](_0x59b59d[_0xfde6('0x47')],[_0xfde6('0x61'),'id'])||{});}return null;})[_0xfde6('0x8c')](function(_0x1e04aa){var _0x36bd48;var _0x5d42c4;_0x243b10=_0x1e04aa||[];var _0x260215=[];if(_0x1e04aa){for(var _0x137a56=0x0;_0x137a56<_0x1e04aa[_0xfde6('0x34')];_0x137a56+=0x1){var _0xccb654=_0x1e04aa[_0x137a56][_0xfde6('0x49')]({'plain':!![]});_0x36bd48=squel[_0xfde6('0x7a')]()[_0xfde6('0x7b')](_0xfde6('0x8d'))[_0xfde6('0x64')](['phone',_0xfde6('0x67'),_0xfde6('0x6e'),'CampaignId',_0xfde6('0x68'),_0xfde6('0x50')],squel[_0xfde6('0x69')]()[_0xfde6('0x6a')](_0xfde6('0x65'),_0xfde6('0x65'))['field']('id',_0xfde6('0x67'))['field'](_0xccb654['CmListId'][_0xfde6('0x6d')](),'ListId')['field'](_0x59b59d[_0xfde6('0x44')]['id'][_0xfde6('0x6d')](),'CampaignId')[_0xfde6('0x6a')]('NOW()',_0xfde6('0x68'))[_0xfde6('0x6a')](_0xfde6('0x6b'),'updatedAt')['from'](_0xfde6('0x70'))[_0xfde6('0x38')](_0xfde6('0x71'))[_0xfde6('0x38')](_0xfde6('0x72'),_0xccb654['CmListId'][_0xfde6('0x6d')]())[_0xfde6('0x38')](_0xfde6('0x73')))[_0xfde6('0x6d')]();_0x260215[_0xfde6('0x87')](db[_0xfde6('0x88')][_0xfde6('0x2e')](_0x36bd48));}return BPromise[_0xfde6('0x89')](_0x260215);}})['then'](function(){return _0x243b10;})[_0xfde6('0x22')](respondWithResult(_0x4f68ff,null))['catch'](handleError(_0x4f68ff,null));};exports['removeBlackLists']=function(_0x22928e,_0x33b64f,_0x2798ca){return db[_0xfde6('0x2b')][_0xfde6('0x45')]({'where':{'id':_0x22928e[_0xfde6('0x44')]['id']}})[_0xfde6('0x22')](handleEntityNotFound(_0x33b64f,null))[_0xfde6('0x22')](function(_0x5f4c48){if(_0x5f4c48){return _0x5f4c48[_0xfde6('0x8e')](_0x22928e['query'][_0xfde6('0x61')]);}})[_0xfde6('0x22')](function(_0x29bfbc){if(_0x29bfbc){return db[_0xfde6('0x5c')][_0xfde6('0x25')]({'where':{'ListId':_0x22928e[_0xfde6('0x2e')][_0xfde6('0x61')],'CampaignId':_0x22928e[_0xfde6('0x44')]['id']}})[_0xfde6('0x22')](function(){return _0x29bfbc;});}})[_0xfde6('0x22')](respondWithStatusCode(_0x33b64f,null))[_0xfde6('0x42')](handleError(_0x33b64f,null));};
\ No newline at end of file
+var _0xc222=['undefined','count','apply','save','update','then','destroy','IvrCampaigns','error','stack','name','send','index','map','Campaign','fieldName','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','find','autoAssociation','getHoppers','CmHopper','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','into','phone','ContactId','ListId','select','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','scheduledAt','NOW()','fromQuery','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit'];(function(_0x35731c,_0x5ab1d1){var _0x2f2957=function(_0x2d6583){while(--_0x2d6583){_0x35731c['push'](_0x35731c['shift']());}};_0x2f2957(++_0x5ab1d1);}(_0xc222,0x75));var _0x2c22=function(_0x120cbc,_0x4c1b9e){_0x120cbc=_0x120cbc-0x0;var _0x3c89ad=_0xc222[_0x120cbc];return _0x3c89ad;};'use strict';var emlformat=require(_0x2c22('0x0'));var rimraf=require(_0x2c22('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c22('0x2'));var rp=require('request-promise');var moment=require(_0x2c22('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2c22('0x4'));var sox=require(_0x2c22('0x5'));var csv=require(_0x2c22('0x6'));var ejs=require(_0x2c22('0x7'));var fs=require('fs');var fs_extra=require(_0x2c22('0x8'));var _=require(_0x2c22('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2c22('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2c22('0x6'));var querystring=require(_0x2c22('0xb'));var Papa=require(_0x2c22('0xc'));var Redis=require(_0x2c22('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x2c22('0xe'));var as=require(_0x2c22('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2c22('0x10'));var utils=require('../../config/utils');var config=require(_0x2c22('0x11'));var licenseUtil=require(_0x2c22('0x12'));var db=require(_0x2c22('0x13'))['db'];function respondWithStatusCode(_0x1ecd88,_0x3bd5ba){_0x3bd5ba=_0x3bd5ba||0xcc;return function(_0x40b90b){if(_0x40b90b){return _0x1ecd88[_0x2c22('0x14')](_0x3bd5ba);}return _0x1ecd88[_0x2c22('0x15')](_0x3bd5ba)[_0x2c22('0x16')]();};}function respondWithResult(_0x572d56,_0x2426c9){_0x2426c9=_0x2426c9||0xc8;return function(_0x22c424){if(_0x22c424){return _0x572d56[_0x2c22('0x15')](_0x2426c9)[_0x2c22('0x17')](_0x22c424);}};}function respondWithFilteredResult(_0x5b174e,_0x10b3f0){return function(_0x1193c5){if(_0x1193c5){var _0x22a9b8=typeof _0x10b3f0[_0x2c22('0x18')]==='undefined'&&typeof _0x10b3f0[_0x2c22('0x19')]===_0x2c22('0x1a');var _0x5c2368=_0x1193c5[_0x2c22('0x1b')];var _0x13347e=_0x22a9b8?0x0:_0x10b3f0['offset'];var _0x3223f1=_0x22a9b8?_0x1193c5[_0x2c22('0x1b')]:_0x10b3f0[_0x2c22('0x18')]+_0x10b3f0[_0x2c22('0x19')];var _0x4bc49e;if(_0x3223f1>=_0x5c2368){_0x3223f1=_0x5c2368;_0x4bc49e=0xc8;}else{_0x4bc49e=0xce;}_0x5b174e[_0x2c22('0x15')](_0x4bc49e);return _0x5b174e['set']('Content-Range',_0x13347e+'-'+_0x3223f1+'/'+_0x5c2368)['json'](_0x1193c5);}return null;};}function patchUpdates(_0x5a5297){return function(_0x3f32b3){try{jsonpatch[_0x2c22('0x1c')](_0x3f32b3,_0x5a5297,!![]);}catch(_0x1d3d2a){return BPromise['reject'](_0x1d3d2a);}return _0x3f32b3[_0x2c22('0x1d')]();};}function saveUpdates(_0x49bb3e,_0x4585db){return function(_0x103c57){if(_0x103c57){return _0x103c57[_0x2c22('0x1e')](_0x49bb3e)[_0x2c22('0x1f')](function(_0x519fe7){return _0x519fe7;});}return null;};}function removeEntity(_0x133908,_0x486c87){return function(_0xd3445a){if(_0xd3445a){return _0xd3445a[_0x2c22('0x20')]()[_0x2c22('0x1f')](function(){var _0x5760f1=_0xd3445a['get']({'plain':!![]});var _0x156d3e=_0x2c22('0x21');return db['UserProfileResource'][_0x2c22('0x20')]({'where':{'type':_0x156d3e,'resourceId':_0x5760f1['id']}})[_0x2c22('0x1f')](function(){return _0xd3445a;});})[_0x2c22('0x1f')](function(){_0x133908[_0x2c22('0x15')](0xcc)[_0x2c22('0x16')]();});}};}function handleEntityNotFound(_0x252647,_0x34ea0a){return function(_0x1b920c){if(!_0x1b920c){_0x252647[_0x2c22('0x14')](0x194);}return _0x1b920c;};}function handleError(_0x4752a2,_0x20a04f){_0x20a04f=_0x20a04f||0x1f4;return function(_0x4fc591){logger[_0x2c22('0x22')](_0x4fc591[_0x2c22('0x23')]);if(_0x4fc591[_0x2c22('0x24')]){delete _0x4fc591[_0x2c22('0x24')];}_0x4752a2[_0x2c22('0x15')](_0x20a04f)[_0x2c22('0x25')](_0x4fc591);};}exports[_0x2c22('0x26')]=function(_0x4d0bb8,_0x54c616){var _0x5c27e8={},_0x30ef48={},_0x171d91={'count':0x0,'rows':[]};var _0x1c291b=_[_0x2c22('0x27')](db[_0x2c22('0x28')]['rawAttributes'],function(_0x15df25){return{'name':_0x15df25[_0x2c22('0x29')],'type':_0x15df25['type'][_0x2c22('0x2a')]};});_0x30ef48['model']=_[_0x2c22('0x27')](_0x1c291b,_0x2c22('0x24'));_0x30ef48['query']=_[_0x2c22('0x2b')](_0x4d0bb8[_0x2c22('0x2c')]);_0x30ef48['filters']=_[_0x2c22('0x2d')](_0x30ef48[_0x2c22('0x2e')],_0x30ef48[_0x2c22('0x2c')]);_0x5c27e8[_0x2c22('0x2f')]=_['intersection'](_0x30ef48[_0x2c22('0x2e')],qs[_0x2c22('0x30')](_0x4d0bb8[_0x2c22('0x2c')]['fields']));_0x5c27e8[_0x2c22('0x2f')]=_0x5c27e8[_0x2c22('0x2f')][_0x2c22('0x31')]?_0x5c27e8[_0x2c22('0x2f')]:_0x30ef48['model'];if(!_0x4d0bb8[_0x2c22('0x2c')][_0x2c22('0x32')](_0x2c22('0x33'))){_0x5c27e8['limit']=qs[_0x2c22('0x19')](_0x4d0bb8['query'][_0x2c22('0x19')]);_0x5c27e8['offset']=qs[_0x2c22('0x18')](_0x4d0bb8[_0x2c22('0x2c')]['offset']);}_0x5c27e8[_0x2c22('0x34')]=qs['sort'](_0x4d0bb8[_0x2c22('0x2c')][_0x2c22('0x35')]);_0x5c27e8[_0x2c22('0x36')]=qs[_0x2c22('0x37')](_[_0x2c22('0x38')](_0x4d0bb8[_0x2c22('0x2c')],_0x30ef48[_0x2c22('0x37')]),_0x1c291b);if(_0x4d0bb8[_0x2c22('0x2c')][_0x2c22('0x39')]){_0x5c27e8[_0x2c22('0x36')]=_[_0x2c22('0x3a')](_0x5c27e8['where'],{'$or':_[_0x2c22('0x27')](_0x1c291b,function(_0x410059){if(_0x410059[_0x2c22('0x3b')]!==_0x2c22('0x3c')){var _0x1bf619={};_0x1bf619[_0x410059[_0x2c22('0x24')]]={'$like':'%'+_0x4d0bb8[_0x2c22('0x2c')][_0x2c22('0x39')]+'%'};return _0x1bf619;}})});}_0x5c27e8=_[_0x2c22('0x3a')]({},_0x5c27e8,_0x4d0bb8[_0x2c22('0x3d')]);var _0x3fe27d={'where':_0x5c27e8['where']};return db['Campaign'][_0x2c22('0x1b')](_0x3fe27d)[_0x2c22('0x1f')](function(_0x2d1fa2){_0x171d91['count']=_0x2d1fa2;if(_0x4d0bb8['query'][_0x2c22('0x3e')]){_0x5c27e8[_0x2c22('0x3f')]=[{'all':!![]}];}return db[_0x2c22('0x28')][_0x2c22('0x40')](_0x5c27e8);})['then'](function(_0xd63b21){_0x171d91['rows']=_0xd63b21;return _0x171d91;})[_0x2c22('0x1f')](respondWithFilteredResult(_0x54c616,_0x5c27e8))[_0x2c22('0x41')](handleError(_0x54c616,null));};exports['show']=function(_0x3b894d,_0x59dbf5){var _0x3fd5b3={'raw':![],'where':{'id':_0x3b894d[_0x2c22('0x42')]['id']}},_0x4a39dc={};_0x4a39dc[_0x2c22('0x2e')]=_[_0x2c22('0x2b')](db['Campaign'][_0x2c22('0x43')]);_0x4a39dc[_0x2c22('0x2c')]=_[_0x2c22('0x2b')](_0x3b894d[_0x2c22('0x2c')]);_0x4a39dc[_0x2c22('0x37')]=_[_0x2c22('0x2d')](_0x4a39dc[_0x2c22('0x2e')],_0x4a39dc[_0x2c22('0x2c')]);_0x3fd5b3[_0x2c22('0x2f')]=_[_0x2c22('0x2d')](_0x4a39dc[_0x2c22('0x2e')],qs[_0x2c22('0x30')](_0x3b894d[_0x2c22('0x2c')][_0x2c22('0x30')]));_0x3fd5b3[_0x2c22('0x2f')]=_0x3fd5b3[_0x2c22('0x2f')]['length']?_0x3fd5b3[_0x2c22('0x2f')]:_0x4a39dc[_0x2c22('0x2e')];if(_0x3b894d['query'][_0x2c22('0x3e')]){_0x3fd5b3[_0x2c22('0x3f')]=[{'all':!![]}];}_0x3fd5b3=_[_0x2c22('0x3a')]({},_0x3fd5b3,_0x3b894d[_0x2c22('0x3d')]);return db[_0x2c22('0x28')]['find'](_0x3fd5b3)[_0x2c22('0x1f')](handleEntityNotFound(_0x59dbf5,null))[_0x2c22('0x1f')](respondWithResult(_0x59dbf5,null))[_0x2c22('0x41')](handleError(_0x59dbf5,null));};exports['create']=function(_0x344a2a,_0x475c40){return db[_0x2c22('0x28')][_0x2c22('0x44')](_0x344a2a[_0x2c22('0x45')],{})[_0x2c22('0x1f')](function(_0x1fd776){var _0x4c2668=_0x344a2a[_0x2c22('0x46')][_0x2c22('0x47')]({'plain':!![]});if(!_0x4c2668)throw new Error(_0x2c22('0x48'));if(_0x4c2668[_0x2c22('0x49')]===_0x2c22('0x46')){var _0x1c842c=_0x1fd776[_0x2c22('0x47')]({'plain':!![]});var _0x4e0b80='IvrCampaigns';return db[_0x2c22('0x4a')]['find']({'where':{'name':_0x4e0b80,'userProfileId':_0x4c2668[_0x2c22('0x4b')]},'raw':!![]})[_0x2c22('0x1f')](function(_0x2b0110){if(_0x2b0110&&_0x2b0110['autoAssociation']===0x0){return db[_0x2c22('0x4c')][_0x2c22('0x44')]({'name':_0x1c842c[_0x2c22('0x24')],'resourceId':_0x1c842c['id'],'type':_0x2b0110[_0x2c22('0x24')],'sectionId':_0x2b0110['id']},{})['then'](function(){return _0x1fd776;});}else{return _0x1fd776;}})[_0x2c22('0x41')](function(_0x379d42){logger['error'](_0x2c22('0x4d'),_0x379d42);throw _0x379d42;});}return _0x1fd776;})[_0x2c22('0x1f')](respondWithResult(_0x475c40,0xc9))[_0x2c22('0x41')](handleError(_0x475c40,null));};exports[_0x2c22('0x4e')]=function(_0x5886b6,_0x204f62){var _0x578c70={'where':{'id':_0x5886b6[_0x2c22('0x42')]['id']}},_0x2c36e8={};_0x2c36e8[_0x2c22('0x2e')]=_[_0x2c22('0x2b')](db[_0x2c22('0x28')]['rawAttributes']);_0x578c70[_0x2c22('0x2f')]=_[_0x2c22('0x2d')](_0x2c36e8['model'],qs[_0x2c22('0x30')](_0x5886b6[_0x2c22('0x2c')][_0x2c22('0x30')]));_0x578c70[_0x2c22('0x2f')]=_0x578c70[_0x2c22('0x2f')][_0x2c22('0x31')]?_0x578c70[_0x2c22('0x2f')]:_0x2c36e8['model'];if(_0x5886b6['query'][_0x2c22('0x3e')]){_0x578c70[_0x2c22('0x3f')]=[{'all':!![]}];}_0x578c70=_[_0x2c22('0x3a')]({},_0x578c70,_0x5886b6[_0x2c22('0x3d')]);return db[_0x2c22('0x28')]['find'](_0x578c70)[_0x2c22('0x1f')](handleEntityNotFound(_0x204f62,null))[_0x2c22('0x1f')](function(_0x3d0a31){if(_0x3d0a31){var _0x9df808=_0x3d0a31[_0x2c22('0x47')]({'plain':!![]});_0x9df808=qs[_0x2c22('0x4f')](_0x9df808,['id',_0x2c22('0x50'),_0x2c22('0x51')]);_0x5886b6[_0x2c22('0x45')]=_[_0x2c22('0x4f')](_0x5886b6[_0x2c22('0x45')],['id',_0x2c22('0x50'),'updatedAt']);return db[_0x2c22('0x28')][_0x2c22('0x44')](_['merge'](_0x9df808,_0x5886b6[_0x2c22('0x45')]),{'include':_0x5886b6[_0x2c22('0x2c')][_0x2c22('0x3e')]?[{'all':!![]}]:undefined})[_0x2c22('0x1f')](function(_0x5ee2f5){var _0x283f07=_0x5886b6[_0x2c22('0x46')][_0x2c22('0x47')]({'plain':!![]});if(!_0x283f07)throw new Error(_0x2c22('0x48'));if(_0x283f07[_0x2c22('0x49')]===_0x2c22('0x46')){var _0x1de81b=_0x5ee2f5['get']({'plain':!![]});var _0x3ebb51=_0x2c22('0x21');return db[_0x2c22('0x4a')][_0x2c22('0x52')]({'where':{'name':_0x3ebb51,'userProfileId':_0x283f07[_0x2c22('0x4b')]},'raw':!![]})[_0x2c22('0x1f')](function(_0x52c774){if(_0x52c774&&_0x52c774[_0x2c22('0x53')]===0x0){return db[_0x2c22('0x4c')]['create']({'name':_0x1de81b[_0x2c22('0x24')],'resourceId':_0x1de81b['id'],'type':_0x52c774[_0x2c22('0x24')],'sectionId':_0x52c774['id']},{})[_0x2c22('0x1f')](function(){return _0x5ee2f5;});}else{return _0x5ee2f5;}})[_0x2c22('0x41')](function(_0x23aa16){logger[_0x2c22('0x22')](_0x2c22('0x4d'),_0x23aa16);throw _0x23aa16;});}return _0x5ee2f5;});}})[_0x2c22('0x1f')](respondWithResult(_0x204f62,0xc9))['catch'](handleError(_0x204f62,null));};exports[_0x2c22('0x1e')]=function(_0x179c9d,_0x327c81){if(_0x179c9d[_0x2c22('0x45')]['id']){delete _0x179c9d['body']['id'];}return db['Campaign']['find']({'where':{'id':_0x179c9d['params']['id']}})['then'](handleEntityNotFound(_0x327c81,null))[_0x2c22('0x1f')](saveUpdates(_0x179c9d['body'],null))[_0x2c22('0x1f')](respondWithResult(_0x327c81,null))['catch'](handleError(_0x327c81,null));};exports[_0x2c22('0x20')]=function(_0x2f3b17,_0x5182be){return db['Campaign'][_0x2c22('0x52')]({'where':{'id':_0x2f3b17[_0x2c22('0x42')]['id']}})[_0x2c22('0x1f')](handleEntityNotFound(_0x5182be,null))['then'](removeEntity(_0x5182be,null))['catch'](handleError(_0x5182be,null));};exports[_0x2c22('0x54')]=function(_0x5ceddb,_0x363159,_0x5b8e1c){var _0xe84682={'raw':!![],'where':{}};var _0x4f5f9a={};var _0x3928cf={'count':0x0,'rows':[]};return db[_0x2c22('0x28')]['findOne']({'where':{'id':_0x5ceddb[_0x2c22('0x42')]['id']}})[_0x2c22('0x1f')](handleEntityNotFound(_0x363159,null))[_0x2c22('0x1f')](function(_0x123582){if(_0x123582){_0x4f5f9a['model']=_[_0x2c22('0x2b')](db[_0x2c22('0x55')]['rawAttributes']);_0x4f5f9a['query']=_['keys'](_0x5ceddb['query']);_0x4f5f9a['filters']=_['intersection'](_0x4f5f9a[_0x2c22('0x2e')],_0x4f5f9a['query']);_0xe84682[_0x2c22('0x2f')]=_[_0x2c22('0x2d')](_0x4f5f9a[_0x2c22('0x2e')],qs[_0x2c22('0x30')](_0x5ceddb['query']['fields']));_0xe84682[_0x2c22('0x2f')]=_0xe84682[_0x2c22('0x2f')][_0x2c22('0x31')]?_0xe84682['attributes']:_0x4f5f9a[_0x2c22('0x2e')];if(!_0x5ceddb['query'][_0x2c22('0x32')]('nolimit')){_0xe84682[_0x2c22('0x19')]=qs[_0x2c22('0x19')](_0x5ceddb[_0x2c22('0x2c')][_0x2c22('0x19')]);_0xe84682[_0x2c22('0x18')]=qs[_0x2c22('0x18')](_0x5ceddb['query']['offset']);}_0xe84682[_0x2c22('0x34')]=qs['sort'](_0x5ceddb[_0x2c22('0x2c')][_0x2c22('0x35')]);_0xe84682[_0x2c22('0x36')]=qs['filters'](_['pick'](_0x5ceddb[_0x2c22('0x2c')],_0x4f5f9a['filters']));_0xe84682[_0x2c22('0x36')][_0x2c22('0x56')]=_0x123582['id'];if(_0x5ceddb[_0x2c22('0x2c')][_0x2c22('0x39')]){_0xe84682[_0x2c22('0x36')]=_[_0x2c22('0x3a')](_0xe84682[_0x2c22('0x36')],{'$or':_['map'](_0xe84682['attributes'],function(_0x43117c){var _0x7f60e6={};_0x7f60e6[_0x43117c]={'$like':'%'+_0x5ceddb[_0x2c22('0x2c')][_0x2c22('0x39')]+'%'};return _0x7f60e6;})});}_0xe84682=_[_0x2c22('0x3a')]({},_0xe84682,_0x5ceddb[_0x2c22('0x3d')]);return db[_0x2c22('0x55')][_0x2c22('0x1b')]({'where':_0xe84682[_0x2c22('0x36')]})['then'](function(_0x7efb4e){_0x3928cf[_0x2c22('0x1b')]=_0x7efb4e;if(_0x5ceddb[_0x2c22('0x2c')][_0x2c22('0x3e')]){_0xe84682['include']=[{'all':!![]}];}return db[_0x2c22('0x55')][_0x2c22('0x40')](_0xe84682);})[_0x2c22('0x1f')](function(_0xe8531f){_0x3928cf[_0x2c22('0x57')]=_0xe8531f;return _0x3928cf;});}})['then'](respondWithFilteredResult(_0x363159,_0xe84682))['catch'](handleError(_0x363159,null));};exports[_0x2c22('0x58')]=function(_0x2471c4,_0x321ad7,_0x14549f){var _0x4cf104={'raw':!![],'where':{}};var _0x8f0219={};var _0x410572={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x2471c4['params']['id']}})[_0x2c22('0x1f')](handleEntityNotFound(_0x321ad7,null))[_0x2c22('0x1f')](function(_0x2f2375){if(_0x2f2375){_0x8f0219[_0x2c22('0x2e')]=_[_0x2c22('0x2b')](db['CmHopperHistory'][_0x2c22('0x43')]);_0x8f0219[_0x2c22('0x2c')]=_[_0x2c22('0x2b')](_0x2471c4[_0x2c22('0x2c')]);_0x8f0219[_0x2c22('0x37')]=_['intersection'](_0x8f0219['model'],_0x8f0219[_0x2c22('0x2c')]);_0x4cf104[_0x2c22('0x2f')]=_[_0x2c22('0x2d')](_0x8f0219[_0x2c22('0x2e')],qs['fields'](_0x2471c4[_0x2c22('0x2c')][_0x2c22('0x30')]));_0x4cf104[_0x2c22('0x2f')]=_0x4cf104[_0x2c22('0x2f')][_0x2c22('0x31')]?_0x4cf104['attributes']:_0x8f0219['model'];if(!_0x2471c4[_0x2c22('0x2c')]['hasOwnProperty'](_0x2c22('0x33'))){_0x4cf104[_0x2c22('0x19')]=qs[_0x2c22('0x19')](_0x2471c4[_0x2c22('0x2c')][_0x2c22('0x19')]);_0x4cf104[_0x2c22('0x18')]=qs[_0x2c22('0x18')](_0x2471c4[_0x2c22('0x2c')][_0x2c22('0x18')]);}_0x4cf104['order']=qs[_0x2c22('0x35')](_0x2471c4[_0x2c22('0x2c')]['sort']);_0x4cf104['where']=qs[_0x2c22('0x37')](_[_0x2c22('0x38')](_0x2471c4[_0x2c22('0x2c')],_0x8f0219['filters']));_0x4cf104[_0x2c22('0x36')][_0x2c22('0x56')]=_0x2f2375['id'];if(_0x2471c4[_0x2c22('0x2c')]['filter']){_0x4cf104[_0x2c22('0x36')]=_[_0x2c22('0x3a')](_0x4cf104[_0x2c22('0x36')],{'$or':_[_0x2c22('0x27')](_0x4cf104[_0x2c22('0x2f')],function(_0x520bf8){var _0x30c98a={};_0x30c98a[_0x520bf8]={'$like':'%'+_0x2471c4[_0x2c22('0x2c')]['filter']+'%'};return _0x30c98a;})});}_0x4cf104=_['merge']({},_0x4cf104,_0x2471c4[_0x2c22('0x3d')]);return db[_0x2c22('0x59')]['count']({'where':_0x4cf104['where']})[_0x2c22('0x1f')](function(_0x508ff0){_0x410572['count']=_0x508ff0;if(_0x2471c4['query'][_0x2c22('0x3e')]){_0x4cf104['include']=[{'all':!![]}];}return db[_0x2c22('0x59')][_0x2c22('0x40')](_0x4cf104);})[_0x2c22('0x1f')](function(_0x179aa1){_0x410572[_0x2c22('0x57')]=_0x179aa1;return _0x410572;});}})[_0x2c22('0x1f')](respondWithFilteredResult(_0x321ad7,_0x4cf104))[_0x2c22('0x41')](handleError(_0x321ad7,null));};exports[_0x2c22('0x5a')]=function(_0x4197e6,_0x3d7b95,_0x517c21){var _0x4720c1={'raw':!![],'where':{}};var _0x525186={};var _0x3a4019={'count':0x0,'rows':[]};return db['Campaign'][_0x2c22('0x5b')]({'where':{'id':_0x4197e6[_0x2c22('0x42')]['id']}})[_0x2c22('0x1f')](handleEntityNotFound(_0x3d7b95,null))[_0x2c22('0x1f')](function(_0x3cd376){if(_0x3cd376){_0x525186['model']=_['keys'](db[_0x2c22('0x5c')][_0x2c22('0x43')]);_0x525186[_0x2c22('0x2c')]=_[_0x2c22('0x2b')](_0x4197e6[_0x2c22('0x2c')]);_0x525186[_0x2c22('0x37')]=_['intersection'](_0x525186[_0x2c22('0x2e')],_0x525186[_0x2c22('0x2c')]);_0x4720c1['attributes']=_[_0x2c22('0x2d')](_0x525186[_0x2c22('0x2e')],qs[_0x2c22('0x30')](_0x4197e6[_0x2c22('0x2c')][_0x2c22('0x30')]));_0x4720c1['attributes']=_0x4720c1[_0x2c22('0x2f')][_0x2c22('0x31')]?_0x4720c1['attributes']:_0x525186[_0x2c22('0x2e')];if(!_0x4197e6['query'][_0x2c22('0x32')](_0x2c22('0x33'))){_0x4720c1[_0x2c22('0x19')]=qs[_0x2c22('0x19')](_0x4197e6['query'][_0x2c22('0x19')]);_0x4720c1[_0x2c22('0x18')]=qs['offset'](_0x4197e6['query']['offset']);}_0x4720c1[_0x2c22('0x34')]=qs[_0x2c22('0x35')](_0x4197e6[_0x2c22('0x2c')][_0x2c22('0x35')]);_0x4720c1[_0x2c22('0x36')]=qs[_0x2c22('0x37')](_[_0x2c22('0x38')](_0x4197e6[_0x2c22('0x2c')],_0x525186['filters']));_0x4720c1[_0x2c22('0x36')][_0x2c22('0x56')]=_0x3cd376['id'];if(_0x4197e6[_0x2c22('0x2c')]['filter']){_0x4720c1[_0x2c22('0x36')]=_[_0x2c22('0x3a')](_0x4720c1['where'],{'$or':_[_0x2c22('0x27')](_0x4720c1[_0x2c22('0x2f')],function(_0x231651){var _0x3a1300={};_0x3a1300[_0x231651]={'$like':'%'+_0x4197e6['query']['filter']+'%'};return _0x3a1300;})});}_0x4720c1=_[_0x2c22('0x3a')]({},_0x4720c1,_0x4197e6[_0x2c22('0x3d')]);return db[_0x2c22('0x5c')][_0x2c22('0x1b')]({'where':_0x4720c1[_0x2c22('0x36')]})[_0x2c22('0x1f')](function(_0x5ae5f7){_0x3a4019[_0x2c22('0x1b')]=_0x5ae5f7;if(_0x4197e6[_0x2c22('0x2c')][_0x2c22('0x3e')]){_0x4720c1['include']=[{'all':!![]}];}return db[_0x2c22('0x5c')][_0x2c22('0x40')](_0x4720c1);})[_0x2c22('0x1f')](function(_0x455ebc){_0x3a4019[_0x2c22('0x57')]=_0x455ebc;return _0x3a4019;});}})[_0x2c22('0x1f')](respondWithFilteredResult(_0x3d7b95,_0x4720c1))[_0x2c22('0x41')](handleError(_0x3d7b95,null));};exports[_0x2c22('0x5d')]=function(_0x5cca87,_0x3042c4,_0x580b3c){var _0x22ba7a={'raw':!![],'where':{}};var _0xc6fedb={};var _0x17d765={'count':0x0,'rows':[]};return db['Campaign'][_0x2c22('0x5b')]({'where':{'id':_0x5cca87['params']['id']}})[_0x2c22('0x1f')](handleEntityNotFound(_0x3042c4,null))[_0x2c22('0x1f')](function(_0x503805){if(_0x503805){_0xc6fedb[_0x2c22('0x2e')]=_['keys'](db[_0x2c22('0x5e')]['rawAttributes']);_0xc6fedb['query']=_[_0x2c22('0x2b')](_0x5cca87[_0x2c22('0x2c')]);_0xc6fedb[_0x2c22('0x37')]=_[_0x2c22('0x2d')](_0xc6fedb[_0x2c22('0x2e')],_0xc6fedb[_0x2c22('0x2c')]);_0x22ba7a[_0x2c22('0x2f')]=_['intersection'](_0xc6fedb[_0x2c22('0x2e')],qs[_0x2c22('0x30')](_0x5cca87['query'][_0x2c22('0x30')]));_0x22ba7a[_0x2c22('0x2f')]=_0x22ba7a['attributes']['length']?_0x22ba7a[_0x2c22('0x2f')]:_0xc6fedb[_0x2c22('0x2e')];if(!_0x5cca87[_0x2c22('0x2c')][_0x2c22('0x32')]('nolimit')){_0x22ba7a['limit']=qs[_0x2c22('0x19')](_0x5cca87['query']['limit']);_0x22ba7a[_0x2c22('0x18')]=qs['offset'](_0x5cca87[_0x2c22('0x2c')][_0x2c22('0x18')]);}_0x22ba7a[_0x2c22('0x34')]=qs['sort'](_0x5cca87[_0x2c22('0x2c')][_0x2c22('0x35')]);_0x22ba7a[_0x2c22('0x36')]=qs['filters'](_[_0x2c22('0x38')](_0x5cca87['query'],_0xc6fedb[_0x2c22('0x37')]));_0x22ba7a[_0x2c22('0x36')]['CampaignId']=_0x503805['id'];if(_0x5cca87[_0x2c22('0x2c')][_0x2c22('0x39')]){_0x22ba7a[_0x2c22('0x36')]=_['merge'](_0x22ba7a[_0x2c22('0x36')],{'$or':_[_0x2c22('0x27')](_0x22ba7a[_0x2c22('0x2f')],function(_0x11b430){var _0x52ccb9={};_0x52ccb9[_0x11b430]={'$like':'%'+_0x5cca87[_0x2c22('0x2c')][_0x2c22('0x39')]+'%'};return _0x52ccb9;})});}_0x22ba7a=_[_0x2c22('0x3a')]({},_0x22ba7a,_0x5cca87[_0x2c22('0x3d')]);return db[_0x2c22('0x5e')][_0x2c22('0x1b')]({'where':_0x22ba7a[_0x2c22('0x36')]})[_0x2c22('0x1f')](function(_0x4b06ec){_0x17d765[_0x2c22('0x1b')]=_0x4b06ec;if(_0x5cca87[_0x2c22('0x2c')][_0x2c22('0x3e')]){_0x22ba7a[_0x2c22('0x3f')]=[{'all':!![]}];}return db[_0x2c22('0x5e')][_0x2c22('0x40')](_0x22ba7a);})[_0x2c22('0x1f')](function(_0x19101f){_0x17d765[_0x2c22('0x57')]=_0x19101f;return _0x17d765;});}})[_0x2c22('0x1f')](respondWithFilteredResult(_0x3042c4,_0x22ba7a))['catch'](handleError(_0x3042c4,null));};exports['getLists']=function(_0x1727cd,_0x3f505d,_0x52bd93){var _0x397982={};var _0x31fe08={};var _0x3de7de;var _0x203523;return db[_0x2c22('0x28')][_0x2c22('0x5b')]({'where':{'id':_0x1727cd[_0x2c22('0x42')]['id']}})['then'](handleEntityNotFound(_0x3f505d,null))[_0x2c22('0x1f')](function(_0x190f9b){if(_0x190f9b){_0x3de7de=_0x190f9b;_0x31fe08[_0x2c22('0x2e')]=_[_0x2c22('0x2b')](db['CmList']['rawAttributes']);_0x31fe08[_0x2c22('0x2c')]=_[_0x2c22('0x2b')](_0x1727cd[_0x2c22('0x2c')]);_0x31fe08[_0x2c22('0x37')]=_[_0x2c22('0x2d')](_0x31fe08[_0x2c22('0x2e')],_0x31fe08['query']);_0x397982[_0x2c22('0x2f')]=_[_0x2c22('0x2d')](_0x31fe08[_0x2c22('0x2e')],qs[_0x2c22('0x30')](_0x1727cd[_0x2c22('0x2c')]['fields']));_0x397982['attributes']=_0x397982[_0x2c22('0x2f')][_0x2c22('0x31')]?_0x397982['attributes']:_0x31fe08['model'];_0x397982[_0x2c22('0x34')]=qs[_0x2c22('0x35')](_0x1727cd[_0x2c22('0x2c')][_0x2c22('0x35')]);_0x397982['where']=qs[_0x2c22('0x37')](_[_0x2c22('0x38')](_0x1727cd['query'],_0x31fe08[_0x2c22('0x37')]));if(_0x1727cd[_0x2c22('0x2c')]['filter']){_0x397982[_0x2c22('0x36')]=_[_0x2c22('0x3a')](_0x397982['where'],{'$or':_[_0x2c22('0x27')](_0x397982['attributes'],function(_0x15611a){var _0xbe588c={};_0xbe588c[_0x15611a]={'$like':'%'+_0x1727cd[_0x2c22('0x2c')][_0x2c22('0x39')]+'%'};return _0xbe588c;})});}_0x397982=_[_0x2c22('0x3a')]({},_0x397982,_0x1727cd[_0x2c22('0x3d')]);return _0x3de7de[_0x2c22('0x5f')](_0x397982);}})[_0x2c22('0x1f')](function(_0x44e220){if(_0x44e220){_0x203523=_0x44e220[_0x2c22('0x31')];if(!_0x1727cd[_0x2c22('0x2c')][_0x2c22('0x32')](_0x2c22('0x33'))){_0x397982[_0x2c22('0x19')]=qs[_0x2c22('0x19')](_0x1727cd['query'][_0x2c22('0x19')]);_0x397982[_0x2c22('0x18')]=qs[_0x2c22('0x18')](_0x1727cd['query']['offset']);}return _0x3de7de['getLists'](_0x397982);}})[_0x2c22('0x1f')](function(_0xd4c57){if(_0xd4c57){return _0xd4c57?{'count':_0x203523,'rows':_0xd4c57}:null;}})['then'](respondWithResult(_0x3f505d,null))[_0x2c22('0x41')](handleError(_0x3f505d,null));};exports['addLists']=function(_0xccfeea,_0x2f2e30,_0x11a2b7){var _0x30f718,_0x55b49e;var _0x133f91=[];var _0x5a7490=moment()[_0x2c22('0x60')](_0x2c22('0x61'));return db[_0x2c22('0x28')][_0x2c22('0x52')]({'where':{'id':_0xccfeea[_0x2c22('0x42')]['id']}})[_0x2c22('0x1f')](handleEntityNotFound(_0x2f2e30,null))['then'](function(_0x4e272a){if(_0x4e272a){_0x55b49e=_0x4e272a;return _0x4e272a[_0x2c22('0x62')](_0xccfeea[_0x2c22('0x45')][_0x2c22('0x63')],_[_0x2c22('0x4f')](_0xccfeea[_0x2c22('0x45')],[_0x2c22('0x63'),'id'])||{});}return null;})[_0x2c22('0x64')](function(_0x6798cf){var _0x4ab4ee;var _0x2b0bf8;_0x30f718=_0x6798cf||[];var _0x555c44=[];if(_0x6798cf){for(var _0x43be82=0x0;_0x43be82<_0x6798cf[_0x2c22('0x31')];_0x43be82+=0x1){var _0x5dacb1=_0x6798cf[_0x43be82][_0x2c22('0x47')]({'plain':!![]});_0x55b49e[_0x2c22('0x65')]=_0xccfeea[_0x2c22('0x45')][_0x2c22('0x65')]?_0xccfeea['body']['dialCheckDuplicateType']:_0x55b49e[_0x2c22('0x65')];switch(_0x55b49e['dialCheckDuplicateType']){case _0x2c22('0x66'):_0x4ab4ee=squel['insert']()[_0x2c22('0x67')]('cm_hopper')['fromQuery']([_0x2c22('0x68'),'scheduledAt',_0x2c22('0x69'),_0x2c22('0x6a'),_0x2c22('0x56'),_0x2c22('0x50'),_0x2c22('0x51')],squel[_0x2c22('0x6b')]()[_0x2c22('0x6c')](_0x2c22('0x68'),_0x2c22('0x68'))[_0x2c22('0x6c')]('NOW()','scheduledAt')[_0x2c22('0x6c')]('id',_0x2c22('0x69'))['field'](_0x5dacb1[_0x2c22('0x6d')][_0x2c22('0x6e')](),_0x2c22('0x6a'))[_0x2c22('0x6c')](_0xccfeea[_0x2c22('0x42')]['id']['toString'](),'CampaignId')[_0x2c22('0x6c')]('\x27'+_0x5a7490+'\x27',_0x2c22('0x50'))['field']('\x27'+_0x5a7490+'\x27',_0x2c22('0x51'))[_0x2c22('0x6f')](_0x2c22('0x70'))[_0x2c22('0x36')](_0x2c22('0x71'))[_0x2c22('0x36')](_0x2c22('0x72'),_0x5dacb1[_0x2c22('0x6d')]['toString']())[_0x2c22('0x36')](_0x2c22('0x73'))[_0x2c22('0x36')](_0x2c22('0x74'),squel[_0x2c22('0x6b')]()[_0x2c22('0x6c')](_0x2c22('0x75'))[_0x2c22('0x6f')]('cm_hopper_final')[_0x2c22('0x36')](_0x2c22('0x76'),_0xccfeea[_0x2c22('0x42')]['id'][_0x2c22('0x6e')]()))['where'](_0x2c22('0x74'),squel['select']()['field'](_0x2c22('0x77'))[_0x2c22('0x6f')](_0x2c22('0x78'))['where'](_0x2c22('0x76'),_0xccfeea['params']['id']['toString']())))[_0x2c22('0x6e')]();break;case _0x2c22('0x79'):_0x4ab4ee=squel[_0x2c22('0x7a')]()[_0x2c22('0x67')](_0x2c22('0x78'))['fromQuery'](['phone',_0x2c22('0x7b'),_0x2c22('0x69'),'ListId',_0x2c22('0x56'),'createdAt',_0x2c22('0x51')],squel[_0x2c22('0x6b')]()[_0x2c22('0x6c')](_0x2c22('0x68'),_0x2c22('0x68'))[_0x2c22('0x6c')](_0x2c22('0x7c'),'scheduledAt')[_0x2c22('0x6c')]('id',_0x2c22('0x69'))['field'](_0x5dacb1[_0x2c22('0x6d')][_0x2c22('0x6e')](),'ListId')[_0x2c22('0x6c')](_0xccfeea[_0x2c22('0x42')]['id'][_0x2c22('0x6e')](),_0x2c22('0x56'))[_0x2c22('0x6c')]('\x27'+_0x5a7490+'\x27',_0x2c22('0x50'))[_0x2c22('0x6c')]('\x27'+_0x5a7490+'\x27','updatedAt')[_0x2c22('0x6f')](_0x2c22('0x70'))['where'](_0x2c22('0x71'))[_0x2c22('0x36')]('ListId\x20=\x20?',_0x5dacb1[_0x2c22('0x6d')][_0x2c22('0x6e')]())[_0x2c22('0x36')]('phone\x20IS\x20NOT\x20NULL')[_0x2c22('0x36')]('phone\x20NOT\x20IN\x20(?)',squel[_0x2c22('0x6b')]()[_0x2c22('0x6c')](_0x2c22('0x77'))[_0x2c22('0x6f')]('cm_hopper')[_0x2c22('0x36')](_0x2c22('0x76'),_0xccfeea[_0x2c22('0x42')]['id'][_0x2c22('0x6e')]())))[_0x2c22('0x6e')]();break;default:_0x4ab4ee=squel['insert']()[_0x2c22('0x67')](_0x2c22('0x78'))[_0x2c22('0x7d')]([_0x2c22('0x68'),_0x2c22('0x7b'),_0x2c22('0x69'),_0x2c22('0x6a'),_0x2c22('0x56'),_0x2c22('0x50'),'updatedAt'],squel[_0x2c22('0x6b')]()[_0x2c22('0x6c')](_0x2c22('0x68'),_0x2c22('0x68'))[_0x2c22('0x6c')](_0x2c22('0x7c'),'scheduledAt')[_0x2c22('0x6c')]('id','ContactId')['field'](_0x5dacb1[_0x2c22('0x6d')][_0x2c22('0x6e')](),_0x2c22('0x6a'))[_0x2c22('0x6c')](_0xccfeea[_0x2c22('0x42')]['id'][_0x2c22('0x6e')](),_0x2c22('0x56'))[_0x2c22('0x6c')]('\x27'+_0x5a7490+'\x27',_0x2c22('0x50'))[_0x2c22('0x6c')]('\x27'+_0x5a7490+'\x27',_0x2c22('0x51'))['from'](_0x2c22('0x70'))[_0x2c22('0x36')](_0x2c22('0x71'))['where'](_0x2c22('0x72'),_0x5dacb1[_0x2c22('0x6d')][_0x2c22('0x6e')]())[_0x2c22('0x36')]('phone\x20IS\x20NOT\x20NULL'))[_0x2c22('0x6e')]();}_0x2b0bf8=squel['insert']()['into']('cm_hopper_additional_phones')[_0x2c22('0x7d')]([_0x2c22('0x7e'),_0x2c22('0x7b'),_0x2c22('0x68'),_0x2c22('0x7f'),'createdAt','updatedAt'],squel['select']()[_0x2c22('0x6c')](_0x2c22('0x80'),'id')[_0x2c22('0x6c')](_0x2c22('0x7c'),_0x2c22('0x7b'))['field'](_0x2c22('0x81'),_0x2c22('0x68'))[_0x2c22('0x6c')](_0x2c22('0x82'),_0x2c22('0x7f'))[_0x2c22('0x6c')]('\x27'+_0x5a7490+'\x27','createdAt')[_0x2c22('0x6c')]('\x27'+_0x5a7490+'\x27','updatedAt')[_0x2c22('0x6f')](_0x2c22('0x83'),'ci')[_0x2c22('0x84')](_0x2c22('0x78'),'h',_0x2c22('0x85'))['where'](_0x2c22('0x86'),_0x5dacb1[_0x2c22('0x6d')]['toString']())[_0x2c22('0x36')]('h.CampaignId=?',_0xccfeea[_0x2c22('0x42')]['id'][_0x2c22('0x6e')]())[_0x2c22('0x36')]('h.createdAt\x20=\x20?',_0x5a7490))['toString']();_0x555c44[_0x2c22('0x87')](db[_0x2c22('0x88')][_0x2c22('0x2c')](_0x4ab4ee));_0x133f91['push'](db['sequelize'][_0x2c22('0x2c')](_0x2b0bf8));}return BPromise[_0x2c22('0x89')](_0x555c44);}})['then'](function(){return BPromise[_0x2c22('0x89')](_0x133f91);})[_0x2c22('0x1f')](function(){return _0x30f718;})[_0x2c22('0x1f')](respondWithResult(_0x2f2e30,null))[_0x2c22('0x41')](handleError(_0x2f2e30,null));};exports[_0x2c22('0x8a')]=function(_0x47c86b,_0x168f44,_0xa4782c){return db[_0x2c22('0x28')][_0x2c22('0x52')]({'where':{'id':_0x47c86b[_0x2c22('0x42')]['id']}})[_0x2c22('0x1f')](handleEntityNotFound(_0x168f44,null))['then'](function(_0x8d4647){if(_0x8d4647){return _0x8d4647[_0x2c22('0x8a')](_0x47c86b['query'][_0x2c22('0x63')]);}})['then'](function(_0x22dc08){if(_0x22dc08){return db['CmHopper'][_0x2c22('0x20')]({'where':{'ListId':_0x47c86b[_0x2c22('0x2c')][_0x2c22('0x63')],'CampaignId':_0x47c86b[_0x2c22('0x42')]['id']}})[_0x2c22('0x1f')](function(){return _0x22dc08;});}})['then'](respondWithStatusCode(_0x168f44,null))[_0x2c22('0x41')](handleError(_0x168f44,null));};exports['getBlackLists']=function(_0x3ee0bc,_0x1f8ac9,_0xf7109e){var _0x4154f9={};var _0xbe7f0c={};var _0x55b760;var _0x147353;return db['Campaign'][_0x2c22('0x5b')]({'where':{'id':_0x3ee0bc['params']['id']}})[_0x2c22('0x1f')](handleEntityNotFound(_0x1f8ac9,null))[_0x2c22('0x1f')](function(_0x37a14d){if(_0x37a14d){_0x55b760=_0x37a14d;_0xbe7f0c[_0x2c22('0x2e')]=_[_0x2c22('0x2b')](db['CmList'][_0x2c22('0x43')]);_0xbe7f0c['query']=_[_0x2c22('0x2b')](_0x3ee0bc['query']);_0xbe7f0c[_0x2c22('0x37')]=_[_0x2c22('0x2d')](_0xbe7f0c['model'],_0xbe7f0c['query']);_0x4154f9[_0x2c22('0x2f')]=_[_0x2c22('0x2d')](_0xbe7f0c[_0x2c22('0x2e')],qs[_0x2c22('0x30')](_0x3ee0bc[_0x2c22('0x2c')][_0x2c22('0x30')]));_0x4154f9[_0x2c22('0x2f')]=_0x4154f9[_0x2c22('0x2f')][_0x2c22('0x31')]?_0x4154f9[_0x2c22('0x2f')]:_0xbe7f0c[_0x2c22('0x2e')];_0x4154f9['order']=qs[_0x2c22('0x35')](_0x3ee0bc['query'][_0x2c22('0x35')]);_0x4154f9[_0x2c22('0x36')]=qs[_0x2c22('0x37')](_[_0x2c22('0x38')](_0x3ee0bc[_0x2c22('0x2c')],_0xbe7f0c[_0x2c22('0x37')]));if(_0x3ee0bc[_0x2c22('0x2c')][_0x2c22('0x39')]){_0x4154f9[_0x2c22('0x36')]=_[_0x2c22('0x3a')](_0x4154f9[_0x2c22('0x36')],{'$or':_[_0x2c22('0x27')](_0x4154f9[_0x2c22('0x2f')],function(_0x279b84){var _0x325afd={};_0x325afd[_0x279b84]={'$like':'%'+_0x3ee0bc[_0x2c22('0x2c')][_0x2c22('0x39')]+'%'};return _0x325afd;})});}_0x4154f9=_[_0x2c22('0x3a')]({},_0x4154f9,_0x3ee0bc[_0x2c22('0x3d')]);return _0x55b760[_0x2c22('0x8b')](_0x4154f9);}})[_0x2c22('0x1f')](function(_0x151ca1){if(_0x151ca1){_0x147353=_0x151ca1['length'];if(!_0x3ee0bc[_0x2c22('0x2c')][_0x2c22('0x32')]('nolimit')){_0x4154f9[_0x2c22('0x19')]=qs['limit'](_0x3ee0bc[_0x2c22('0x2c')][_0x2c22('0x19')]);_0x4154f9[_0x2c22('0x18')]=qs[_0x2c22('0x18')](_0x3ee0bc['query'][_0x2c22('0x18')]);}return _0x55b760[_0x2c22('0x8b')](_0x4154f9);}})[_0x2c22('0x1f')](function(_0x2b71a7){if(_0x2b71a7){return _0x2b71a7?{'count':_0x147353,'rows':_0x2b71a7}:null;}})[_0x2c22('0x1f')](respondWithResult(_0x1f8ac9,null))[_0x2c22('0x41')](handleError(_0x1f8ac9,null));};exports[_0x2c22('0x8c')]=function(_0x2fc058,_0x3e0936,_0x28eb6f){var _0x53d1dd,_0x5d40ab;var _0x16caaa=[];var _0x454a6e=moment()[_0x2c22('0x60')](_0x2c22('0x61'));return db[_0x2c22('0x28')]['find']({'where':{'id':_0x2fc058[_0x2c22('0x42')]['id']}})[_0x2c22('0x1f')](handleEntityNotFound(_0x3e0936,null))[_0x2c22('0x1f')](function(_0x1de334){if(_0x1de334){_0x5d40ab=_0x1de334;return _0x1de334['addBlackLists'](_0x2fc058[_0x2c22('0x45')]['ids'],_[_0x2c22('0x4f')](_0x2fc058['body'],[_0x2c22('0x63'),'id'])||{});}return null;})[_0x2c22('0x64')](function(_0x5f1f31){var _0x42c735;var _0x21dba4;_0x53d1dd=_0x5f1f31||[];var _0x514a54=[];if(_0x5f1f31){for(var _0x19d85b=0x0;_0x19d85b<_0x5f1f31[_0x2c22('0x31')];_0x19d85b+=0x1){var _0x428951=_0x5f1f31[_0x19d85b][_0x2c22('0x47')]({'plain':!![]});_0x42c735=squel[_0x2c22('0x7a')]()[_0x2c22('0x67')](_0x2c22('0x8d'))['fromQuery']([_0x2c22('0x68'),_0x2c22('0x69'),_0x2c22('0x6a'),'CampaignId','createdAt',_0x2c22('0x51')],squel[_0x2c22('0x6b')]()[_0x2c22('0x6c')]('phone',_0x2c22('0x68'))[_0x2c22('0x6c')]('id',_0x2c22('0x69'))[_0x2c22('0x6c')](_0x428951[_0x2c22('0x6d')][_0x2c22('0x6e')](),_0x2c22('0x6a'))[_0x2c22('0x6c')](_0x2fc058[_0x2c22('0x42')]['id'][_0x2c22('0x6e')](),_0x2c22('0x56'))[_0x2c22('0x6c')]('NOW()',_0x2c22('0x50'))[_0x2c22('0x6c')](_0x2c22('0x7c'),'updatedAt')[_0x2c22('0x6f')]('cm_contacts')[_0x2c22('0x36')](_0x2c22('0x71'))['where']('ListId\x20=\x20?',_0x428951[_0x2c22('0x6d')][_0x2c22('0x6e')]())[_0x2c22('0x36')](_0x2c22('0x73')))[_0x2c22('0x6e')]();_0x514a54[_0x2c22('0x87')](db[_0x2c22('0x88')][_0x2c22('0x2c')](_0x42c735));}return BPromise[_0x2c22('0x89')](_0x514a54);}})['then'](function(){return _0x53d1dd;})[_0x2c22('0x1f')](respondWithResult(_0x3e0936,null))[_0x2c22('0x41')](handleError(_0x3e0936,null));};exports['removeBlackLists']=function(_0x270f44,_0x4aeaca,_0x43ee35){return db[_0x2c22('0x28')][_0x2c22('0x52')]({'where':{'id':_0x270f44['params']['id']}})[_0x2c22('0x1f')](handleEntityNotFound(_0x4aeaca,null))[_0x2c22('0x1f')](function(_0x4801d4){if(_0x4801d4){return _0x4801d4[_0x2c22('0x8e')](_0x270f44['query']['ids']);}})[_0x2c22('0x1f')](function(_0x5c3930){if(_0x5c3930){return db[_0x2c22('0x5e')][_0x2c22('0x20')]({'where':{'ListId':_0x270f44['query'][_0x2c22('0x63')],'CampaignId':_0x270f44[_0x2c22('0x42')]['id']}})[_0x2c22('0x1f')](function(){return _0x5c3930;});}})[_0x2c22('0x1f')](respondWithStatusCode(_0x4aeaca,null))['catch'](handleError(_0x4aeaca,null));};
\ No newline at end of file
index b093a69..e534151 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(_0x364b32,_0x4dec35){var _0x3f3ea0=function(_0x1911a8){while(--_0x1911a8){_0x364b32['push'](_0x364b32['shift']());}};_0x3f3ea0(++_0x4dec35);}(_0x7a54,0x106));var _0x47a5=function(_0x53ae30,_0x3b0a8d){_0x53ae30=_0x53ae30-0x0;var _0x2cf0ff=_0x7a54[_0x53ae30];return _0x2cf0ff;};'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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3c4bb8d..2eeccd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdeb7=['message','result','catch','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','GetCampaign','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s'];(function(_0xa60351,_0x1ce888){var _0x59f0d5=function(_0x14dd6e){while(--_0x14dd6e){_0xa60351['push'](_0xa60351['shift']());}};_0x59f0d5(++_0x1ce888);}(_0xdeb7,0x77));var _0x7deb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdeb7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7deb('0x0'));var util=require(_0x7deb('0x1'));var moment=require(_0x7deb('0x2'));var BPromise=require('bluebird');var rs=require(_0x7deb('0x3'));var fs=require('fs');var Redis=require(_0x7deb('0x4'));var db=require(_0x7deb('0x5'))['db'];var utils=require(_0x7deb('0x6'));var logger=require(_0x7deb('0x7'))('rpc');var config=require(_0x7deb('0x8'));var jayson=require(_0x7deb('0x9'));var client=jayson[_0x7deb('0xa')][_0x7deb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d4de9,_0x1a5058,_0x4e3d14){return new BPromise(function(_0xfa72b7,_0x366e44){return client[_0x7deb('0xc')](_0x1d4de9,_0x4e3d14)[_0x7deb('0xd')](function(_0x5bdde4){logger[_0x7deb('0xe')]('Campaign,\x20%s,\x20%s',_0x1a5058,'request\x20sent');logger[_0x7deb('0xf')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1a5058,_0x7deb('0x10'),JSON[_0x7deb('0x11')](_0x5bdde4));if(_0x5bdde4[_0x7deb('0x12')]){if(_0x5bdde4['error'][_0x7deb('0x13')]===0x1f4){logger[_0x7deb('0x12')](_0x7deb('0x14'),_0x1a5058,_0x5bdde4[_0x7deb('0x12')]['message']);return _0x366e44(_0x5bdde4[_0x7deb('0x12')][_0x7deb('0x15')]);}logger[_0x7deb('0x12')](_0x7deb('0x14'),_0x1a5058,_0x5bdde4[_0x7deb('0x12')][_0x7deb('0x15')]);return _0xfa72b7(_0x5bdde4[_0x7deb('0x12')][_0x7deb('0x15')]);}else{logger[_0x7deb('0xe')](_0x7deb('0x14'),_0x1a5058,_0x7deb('0x10'));_0xfa72b7(_0x5bdde4[_0x7deb('0x16')][_0x7deb('0x15')]);}})[_0x7deb('0x17')](function(_0xbe8e2a){logger['error'](_0x7deb('0x14'),_0x1a5058,_0xbe8e2a);_0x366e44(_0xbe8e2a);});});}exports['GetCampaign']=function(_0x2241a3){var _0xbd6ea8=this;return new Promise(function(_0x5439ac,_0x2ad65a){return db[_0x7deb('0x18')][_0x7deb('0x19')]({'raw':_0x2241a3[_0x7deb('0x1a')]?_0x2241a3[_0x7deb('0x1a')][_0x7deb('0x1b')]===undefined?!![]:![]:!![],'where':_0x2241a3[_0x7deb('0x1a')]?_0x2241a3[_0x7deb('0x1a')][_0x7deb('0x1c')]||null:null,'attributes':_0x2241a3['options']?_0x2241a3[_0x7deb('0x1a')][_0x7deb('0x1d')]||null:null,'limit':_0x2241a3[_0x7deb('0x1a')]?_0x2241a3[_0x7deb('0x1a')][_0x7deb('0x1e')]||null:null,'include':_0x2241a3[_0x7deb('0x1a')]?_0x2241a3[_0x7deb('0x1a')][_0x7deb('0x1f')]?_['map'](_0x2241a3[_0x7deb('0x1a')][_0x7deb('0x1f')],function(_0x2cb976){return{'model':db[_0x2cb976['model']],'as':_0x2cb976['as'],'attributes':_0x2cb976[_0x7deb('0x1d')],'include':_0x2cb976[_0x7deb('0x1f')]?_[_0x7deb('0x20')](_0x2cb976[_0x7deb('0x1f')],function(_0x5e2258){return{'model':db[_0x5e2258[_0x7deb('0x21')]],'as':_0x5e2258['as'],'attributes':_0x5e2258[_0x7deb('0x1d')],'include':_0x5e2258[_0x7deb('0x1f')]?_[_0x7deb('0x20')](_0x5e2258[_0x7deb('0x1f')],function(_0x1e9806){return{'model':db[_0x1e9806[_0x7deb('0x21')]],'as':_0x1e9806['as'],'attributes':_0x1e9806[_0x7deb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7deb('0xd')](function(_0x28f884){logger[_0x7deb('0xe')](_0x7deb('0x22'),_0x2241a3);logger[_0x7deb('0xf')](_0x7deb('0x22'),_0x2241a3,JSON['stringify'](_0x28f884));_0x5439ac(_0x28f884);})[_0x7deb('0x17')](function(_0x50ce4b){logger[_0x7deb('0x12')]('GetCampaign',_0x50ce4b[_0x7deb('0x15')],_0x2241a3);_0x2ad65a(_0xbd6ea8[_0x7deb('0x12')](0x1f4,_0x50ce4b['message']));});});};
\ No newline at end of file
+var _0x6c50=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s,\x20%s','error','Campaign,\x20%s,\x20%s','message','request\x20sent','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','map','include','model','debug','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x1a8cbf,_0x981a0c){var _0x3251fb=function(_0x5d5a0c){while(--_0x5d5a0c){_0x1a8cbf['push'](_0x1a8cbf['shift']());}};_0x3251fb(++_0x981a0c);}(_0x6c50,0xa4));var _0x06c5=function(_0x645f1b,_0xca9d56){_0x645f1b=_0x645f1b-0x0;var _0x206703=_0x6c50[_0x645f1b];return _0x206703;};'use strict';var _=require(_0x06c5('0x0'));var util=require(_0x06c5('0x1'));var moment=require(_0x06c5('0x2'));var BPromise=require(_0x06c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06c5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x06c5('0x5'));var logger=require(_0x06c5('0x6'))(_0x06c5('0x7'));var config=require(_0x06c5('0x8'));var jayson=require(_0x06c5('0x9'));var client=jayson[_0x06c5('0xa')][_0x06c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x427dd6,_0x181c7f,_0x17c636){return new BPromise(function(_0x154b0a,_0x546ae5){return client[_0x06c5('0xc')](_0x427dd6,_0x17c636)[_0x06c5('0xd')](function(_0x3010af){logger[_0x06c5('0xe')]('Campaign,\x20%s,\x20%s',_0x181c7f,'request\x20sent');logger['debug'](_0x06c5('0xf'),_0x181c7f,'request\x20sent',JSON['stringify'](_0x3010af));if(_0x3010af['error']){if(_0x3010af[_0x06c5('0x10')]['code']===0x1f4){logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x3010af[_0x06c5('0x10')]['message']);return _0x546ae5(_0x3010af[_0x06c5('0x10')][_0x06c5('0x12')]);}logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x3010af['error']['message']);return _0x154b0a(_0x3010af[_0x06c5('0x10')][_0x06c5('0x12')]);}else{logger[_0x06c5('0xe')]('Campaign,\x20%s,\x20%s',_0x181c7f,_0x06c5('0x13'));_0x154b0a(_0x3010af[_0x06c5('0x14')]['message']);}})[_0x06c5('0x15')](function(_0x9045e6){logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x9045e6);_0x546ae5(_0x9045e6);});});}exports[_0x06c5('0x16')]=function(_0x36b9e9){var _0x44d14e=this;return new Promise(function(_0x18a070,_0x1393f5){return db[_0x06c5('0x17')][_0x06c5('0x18')]({'raw':_0x36b9e9[_0x06c5('0x19')]?_0x36b9e9[_0x06c5('0x19')][_0x06c5('0x1a')]===undefined?!![]:![]:!![],'where':_0x36b9e9[_0x06c5('0x19')]?_0x36b9e9[_0x06c5('0x19')][_0x06c5('0x1b')]||null:null,'attributes':_0x36b9e9['options']?_0x36b9e9[_0x06c5('0x19')][_0x06c5('0x1c')]||null:null,'limit':_0x36b9e9[_0x06c5('0x19')]?_0x36b9e9[_0x06c5('0x19')][_0x06c5('0x1d')]||null:null,'include':_0x36b9e9[_0x06c5('0x19')]?_0x36b9e9[_0x06c5('0x19')]['include']?_[_0x06c5('0x1e')](_0x36b9e9[_0x06c5('0x19')][_0x06c5('0x1f')],function(_0x20ba9e){return{'model':db[_0x20ba9e[_0x06c5('0x20')]],'as':_0x20ba9e['as'],'attributes':_0x20ba9e[_0x06c5('0x1c')],'include':_0x20ba9e[_0x06c5('0x1f')]?_['map'](_0x20ba9e[_0x06c5('0x1f')],function(_0x5aeb6c){return{'model':db[_0x5aeb6c['model']],'as':_0x5aeb6c['as'],'attributes':_0x5aeb6c['attributes'],'include':_0x5aeb6c['include']?_[_0x06c5('0x1e')](_0x5aeb6c[_0x06c5('0x1f')],function(_0x1067e1){return{'model':db[_0x1067e1[_0x06c5('0x20')]],'as':_0x1067e1['as'],'attributes':_0x1067e1[_0x06c5('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x221965){logger[_0x06c5('0xe')](_0x06c5('0x16'),_0x36b9e9);logger[_0x06c5('0x21')](_0x06c5('0x16'),_0x36b9e9,JSON['stringify'](_0x221965));_0x18a070(_0x221965);})[_0x06c5('0x15')](function(_0x432de5){logger[_0x06c5('0x10')]('GetCampaign',_0x432de5[_0x06c5('0x12')],_0x36b9e9);_0x1393f5(_0x44d14e[_0x06c5('0x10')](0x1f4,_0x432de5[_0x06c5('0x12')]));});});};
\ No newline at end of file
index 7e72772..6692f38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcee7=['/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/blacklists','getBlackLists','post','clone','/:id/lists','put','update','delete','destroy','removeBlackLists','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show'];(function(_0x1b5127,_0x24e36a){var _0x122a1e=function(_0x4f4d81){while(--_0x4f4d81){_0x1b5127['push'](_0x1b5127['shift']());}};_0x122a1e(++_0x24e36a);}(_0xcee7,0x160));var _0x7cee=function(_0xb444f4,_0x459a16){_0xb444f4=_0xb444f4-0x0;var _0x9dbba8=_0xcee7[_0xb444f4];return _0x9dbba8;};'use strict';var multer=require(_0x7cee('0x0'));var util=require(_0x7cee('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7cee('0x2')]();var fs_extra=require(_0x7cee('0x3'));var auth=require(_0x7cee('0x4'));var interaction=require(_0x7cee('0x5'));var config=require(_0x7cee('0x6'));var controller=require(_0x7cee('0x7'));router[_0x7cee('0x8')]('/',auth[_0x7cee('0x9')](),controller['index']);router['get'](_0x7cee('0xa'),auth[_0x7cee('0x9')](),controller[_0x7cee('0xb')]);router[_0x7cee('0x8')](_0x7cee('0xc'),auth[_0x7cee('0x9')](),controller['getHoppers']);router[_0x7cee('0x8')](_0x7cee('0xd'),auth['isAuthenticated'](),controller[_0x7cee('0xe')]);router['get'](_0x7cee('0xf'),auth[_0x7cee('0x9')](),controller[_0x7cee('0x10')]);router[_0x7cee('0x8')](_0x7cee('0x11'),auth[_0x7cee('0x9')](),controller['getHopperBlacks']);router[_0x7cee('0x8')]('/:id/lists',auth[_0x7cee('0x9')](),controller['getLists']);router[_0x7cee('0x8')](_0x7cee('0x12'),auth[_0x7cee('0x9')](),controller[_0x7cee('0x13')]);router[_0x7cee('0x14')]('/',auth[_0x7cee('0x9')](),controller['create']);router[_0x7cee('0x14')]('/:id/clone',auth[_0x7cee('0x9')](),controller[_0x7cee('0x15')]);router[_0x7cee('0x14')](_0x7cee('0x16'),auth[_0x7cee('0x9')](),controller['addLists']);router[_0x7cee('0x14')](_0x7cee('0x12'),auth[_0x7cee('0x9')](),controller['addBlackLists']);router[_0x7cee('0x17')]('/:id',auth[_0x7cee('0x9')](),controller[_0x7cee('0x18')]);router[_0x7cee('0x19')](_0x7cee('0xa'),auth[_0x7cee('0x9')](),controller[_0x7cee('0x1a')]);router[_0x7cee('0x19')](_0x7cee('0x16'),auth[_0x7cee('0x9')](),controller['removeLists']);router[_0x7cee('0x19')](_0x7cee('0x12'),auth[_0x7cee('0x9')](),controller[_0x7cee('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x83ed=['/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','express','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','index'];(function(_0x5b35d2,_0xe1235a){var _0xe7c7b2=function(_0x66930d){while(--_0x66930d){_0x5b35d2['push'](_0x5b35d2['shift']());}};_0xe7c7b2(++_0xe1235a);}(_0x83ed,0x85));var _0xd83e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x83ed[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd83e('0x0'));var router=express['Router']();var fs_extra=require(_0xd83e('0x1'));var auth=require(_0xd83e('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xd83e('0x3'));var controller=require(_0xd83e('0x4'));router[_0xd83e('0x5')]('/',auth['isAuthenticated'](),controller[_0xd83e('0x6')]);router['get'](_0xd83e('0x7'),auth[_0xd83e('0x8')](),controller[_0xd83e('0x9')]);router[_0xd83e('0x5')](_0xd83e('0xa'),auth[_0xd83e('0x8')](),controller[_0xd83e('0xb')]);router[_0xd83e('0x5')](_0xd83e('0xc'),auth['isAuthenticated'](),controller[_0xd83e('0xd')]);router[_0xd83e('0x5')](_0xd83e('0xe'),auth[_0xd83e('0x8')](),controller[_0xd83e('0xf')]);router['get'](_0xd83e('0x10'),auth[_0xd83e('0x8')](),controller[_0xd83e('0x11')]);router[_0xd83e('0x5')]('/:id/lists',auth[_0xd83e('0x8')](),controller[_0xd83e('0x12')]);router[_0xd83e('0x5')](_0xd83e('0x13'),auth[_0xd83e('0x8')](),controller[_0xd83e('0x14')]);router[_0xd83e('0x15')]('/',auth[_0xd83e('0x8')](),controller[_0xd83e('0x16')]);router[_0xd83e('0x15')](_0xd83e('0x17'),auth[_0xd83e('0x8')](),controller[_0xd83e('0x18')]);router[_0xd83e('0x15')](_0xd83e('0x19'),auth[_0xd83e('0x8')](),controller[_0xd83e('0x1a')]);router['post']('/:id/blacklists',auth[_0xd83e('0x8')](),controller[_0xd83e('0x1b')]);router[_0xd83e('0x1c')]('/:id',auth[_0xd83e('0x8')](),controller[_0xd83e('0x1d')]);router[_0xd83e('0x1e')](_0xd83e('0x7'),auth[_0xd83e('0x8')](),controller[_0xd83e('0x1f')]);router[_0xd83e('0x1e')](_0xd83e('0x19'),auth['isAuthenticated'](),controller[_0xd83e('0x20')]);router[_0xd83e('0x1e')]('/:id/blacklists',auth[_0xd83e('0x8')](),controller[_0xd83e('0x21')]);module[_0xd83e('0x22')]=router;
\ No newline at end of file
index 5a276b4..0e2d246 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b42=['TEXT','VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x4fbdd5,_0x4a7e9f){var _0x3eeb76=function(_0xfa07a8){while(--_0xfa07a8){_0x4fbdd5['push'](_0x4fbdd5['shift']());}};_0x3eeb76(++_0x4a7e9f);}(_0x4b42,0x193));var _0x24b4=function(_0x2e79f5,_0x5232fe){_0x2e79f5=_0x2e79f5-0x0;var _0xd0585d=_0x4b42[_0x2e79f5];return _0xd0585d;};'use strict';var Sequelize=require(_0x24b4('0x0'));module[_0x24b4('0x1')]={'key':{'type':Sequelize[_0x24b4('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x24b4('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x24b4('0x4')],'get':function(){return this[_0x24b4('0x5')](_0x24b4('0x6'));}}};
\ No newline at end of file
+var _0x841d=['TEXT','VIRTUAL','key','sequelize','exports'];(function(_0x1428d9,_0xded63c){var _0x438019=function(_0x31c37d){while(--_0x31c37d){_0x1428d9['push'](_0x1428d9['shift']());}};_0x438019(++_0xded63c);}(_0x841d,0x1c5));var _0xd841=function(_0x44119a,_0x5c313a){_0x44119a=_0x44119a-0x0;var _0x447673=_0x841d[_0x44119a];return _0x447673;};'use strict';var Sequelize=require(_0xd841('0x0'));module[_0xd841('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xd841('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xd841('0x3')],'get':function(){return this['getDataValue'](_0xd841('0x4'));}}};
\ No newline at end of file
index a1232fd..cd42f76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ccf=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','CannedAnswers','error','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x5d1258,_0x5342b2){var _0x5e5d34=function(_0x35ab1d){while(--_0x35ab1d){_0x5d1258['push'](_0x5d1258['shift']());}};_0x5e5d34(++_0x5342b2);}(_0x6ccf,0x100));var _0xf6cc=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x6ccf[_0x556bb1];return _0x45455f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6cc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6cc('0x1'));var rp=require('request-promise');var moment=require(_0xf6cc('0x2'));var BPromise=require(_0xf6cc('0x3'));var Mustache=require(_0xf6cc('0x4'));var util=require(_0xf6cc('0x5'));var path=require(_0xf6cc('0x6'));var sox=require(_0xf6cc('0x7'));var csv=require('to-csv');var ejs=require(_0xf6cc('0x8'));var fs=require('fs');var fs_extra=require(_0xf6cc('0x9'));var _=require(_0xf6cc('0xa'));var squel=require(_0xf6cc('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf6cc('0xc'));var toCsv=require(_0xf6cc('0xd'));var querystring=require(_0xf6cc('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf6cc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf6cc('0x10'));var hardwareService=require(_0xf6cc('0x11'));var logger=require(_0xf6cc('0x12'))(_0xf6cc('0x13'));var utils=require(_0xf6cc('0x14'));var config=require(_0xf6cc('0x15'));var licenseUtil=require(_0xf6cc('0x16'));var db=require(_0xf6cc('0x17'))['db'];function respondWithStatusCode(_0x4634d6,_0x45062d){_0x45062d=_0x45062d||0xcc;return function(_0x3fed15){if(_0x3fed15){return _0x4634d6[_0xf6cc('0x18')](_0x45062d);}return _0x4634d6[_0xf6cc('0x19')](_0x45062d)[_0xf6cc('0x1a')]();};}function respondWithResult(_0x1dee1f,_0x46bb78){_0x46bb78=_0x46bb78||0xc8;return function(_0x331be9){if(_0x331be9){return _0x1dee1f['status'](_0x46bb78)[_0xf6cc('0x1b')](_0x331be9);}};}function respondWithFilteredResult(_0x5eee54,_0x438085){return function(_0x48ff25){if(_0x48ff25){var _0x11d453=typeof _0x438085[_0xf6cc('0x1c')]==='undefined'&&typeof _0x438085[_0xf6cc('0x1d')]===_0xf6cc('0x1e');var _0x369408=_0x48ff25[_0xf6cc('0x1f')];var _0x2f8237=_0x11d453?0x0:_0x438085['offset'];var _0x1cbae1=_0x11d453?_0x48ff25[_0xf6cc('0x1f')]:_0x438085[_0xf6cc('0x1c')]+_0x438085[_0xf6cc('0x1d')];var _0x2121e3;if(_0x1cbae1>=_0x369408){_0x1cbae1=_0x369408;_0x2121e3=0xc8;}else{_0x2121e3=0xce;}_0x5eee54['status'](_0x2121e3);return _0x5eee54[_0xf6cc('0x20')]('Content-Range',_0x2f8237+'-'+_0x1cbae1+'/'+_0x369408)[_0xf6cc('0x1b')](_0x48ff25);}return null;};}function patchUpdates(_0x151242){return function(_0x1b4099){try{jsonpatch[_0xf6cc('0x21')](_0x1b4099,_0x151242,!![]);}catch(_0x5cbfc3){return BPromise[_0xf6cc('0x22')](_0x5cbfc3);}return _0x1b4099[_0xf6cc('0x23')]();};}function saveUpdates(_0x9a2190,_0x3d1620){return function(_0x45742b){if(_0x45742b){return _0x45742b[_0xf6cc('0x24')](_0x9a2190)[_0xf6cc('0x25')](function(_0x346835){return _0x346835;});}return null;};}function removeEntity(_0x1a88a2,_0x435baa){return function(_0x17b951){if(_0x17b951){return _0x17b951[_0xf6cc('0x26')]()['then'](function(){var _0xc03456=_0x17b951[_0xf6cc('0x27')]({'plain':!![]});var _0x5cb34a=_0xf6cc('0x28');return db['UserProfileResource'][_0xf6cc('0x26')]({'where':{'type':_0x5cb34a,'resourceId':_0xc03456['id']}})['then'](function(){return _0x17b951;});})[_0xf6cc('0x25')](function(){_0x1a88a2[_0xf6cc('0x19')](0xcc)[_0xf6cc('0x1a')]();});}};}function handleEntityNotFound(_0x343912,_0x3c324f){return function(_0xc2b4cd){if(!_0xc2b4cd){_0x343912[_0xf6cc('0x18')](0x194);}return _0xc2b4cd;};}function handleError(_0x3413e6,_0x19861b){_0x19861b=_0x19861b||0x1f4;return function(_0x357796){logger[_0xf6cc('0x29')](_0x357796[_0xf6cc('0x2a')]);if(_0x357796[_0xf6cc('0x2b')]){delete _0x357796[_0xf6cc('0x2b')];}_0x3413e6[_0xf6cc('0x19')](_0x19861b)[_0xf6cc('0x2c')](_0x357796);};}exports['index']=function(_0x42d2d9,_0x45bf06){var _0x550b0c={},_0x1c7826={},_0x13009b={'count':0x0,'rows':[]};var _0x217393=_[_0xf6cc('0x2d')](db[_0xf6cc('0x2e')][_0xf6cc('0x2f')],function(_0x13dd58){return{'name':_0x13dd58[_0xf6cc('0x30')],'type':_0x13dd58[_0xf6cc('0x31')][_0xf6cc('0x32')]};});_0x1c7826[_0xf6cc('0x33')]=_[_0xf6cc('0x2d')](_0x217393,'name');_0x1c7826['query']=_[_0xf6cc('0x34')](_0x42d2d9[_0xf6cc('0x35')]);_0x1c7826[_0xf6cc('0x36')]=_['intersection'](_0x1c7826[_0xf6cc('0x33')],_0x1c7826[_0xf6cc('0x35')]);_0x550b0c[_0xf6cc('0x37')]=_[_0xf6cc('0x38')](_0x1c7826['model'],qs['fields'](_0x42d2d9[_0xf6cc('0x35')][_0xf6cc('0x39')]));_0x550b0c['attributes']=_0x550b0c[_0xf6cc('0x37')][_0xf6cc('0x3a')]?_0x550b0c['attributes']:_0x1c7826[_0xf6cc('0x33')];if(!_0x42d2d9[_0xf6cc('0x35')][_0xf6cc('0x3b')](_0xf6cc('0x3c'))){_0x550b0c['limit']=qs['limit'](_0x42d2d9[_0xf6cc('0x35')]['limit']);_0x550b0c[_0xf6cc('0x1c')]=qs[_0xf6cc('0x1c')](_0x42d2d9[_0xf6cc('0x35')]['offset']);}_0x550b0c[_0xf6cc('0x3d')]=qs['sort'](_0x42d2d9['query']['sort']);_0x550b0c[_0xf6cc('0x3e')]=qs[_0xf6cc('0x36')](_[_0xf6cc('0x3f')](_0x42d2d9[_0xf6cc('0x35')],_0x1c7826[_0xf6cc('0x36')]),_0x217393);if(_0x42d2d9[_0xf6cc('0x35')][_0xf6cc('0x40')]){_0x550b0c[_0xf6cc('0x3e')]=_[_0xf6cc('0x41')](_0x550b0c[_0xf6cc('0x3e')],{'$or':[{'key':{'$like':'%'+_0x42d2d9[_0xf6cc('0x35')][_0xf6cc('0x40')]+'%'}},{'value':{'$like':'%'+_0x42d2d9[_0xf6cc('0x35')][_0xf6cc('0x40')]+'%'}}]});}_0x550b0c=_['merge']({},_0x550b0c,_0x42d2d9[_0xf6cc('0x42')]);var _0x21d6d6={'where':_0x550b0c[_0xf6cc('0x3e')]};return db[_0xf6cc('0x2e')][_0xf6cc('0x1f')](_0x21d6d6)[_0xf6cc('0x25')](function(_0x4d8ea3){_0x13009b[_0xf6cc('0x1f')]=_0x4d8ea3;if(_0x42d2d9[_0xf6cc('0x35')][_0xf6cc('0x43')]){_0x550b0c[_0xf6cc('0x44')]=[{'all':!![]}];}return db[_0xf6cc('0x2e')][_0xf6cc('0x45')](_0x550b0c);})['then'](function(_0x191df8){_0x13009b[_0xf6cc('0x46')]=_0x191df8;return _0x13009b;})[_0xf6cc('0x25')](respondWithFilteredResult(_0x45bf06,_0x550b0c))[_0xf6cc('0x47')](handleError(_0x45bf06,null));};exports[_0xf6cc('0x48')]=function(_0x115993,_0x59899c){var _0x3b32f7={'raw':!![],'where':{'id':_0x115993[_0xf6cc('0x49')]['id']}},_0x3af581={};_0x3af581[_0xf6cc('0x33')]=_[_0xf6cc('0x34')](db[_0xf6cc('0x2e')][_0xf6cc('0x2f')]);_0x3af581[_0xf6cc('0x35')]=_[_0xf6cc('0x34')](_0x115993[_0xf6cc('0x35')]);_0x3af581[_0xf6cc('0x36')]=_['intersection'](_0x3af581['model'],_0x3af581[_0xf6cc('0x35')]);_0x3b32f7[_0xf6cc('0x37')]=_[_0xf6cc('0x38')](_0x3af581[_0xf6cc('0x33')],qs['fields'](_0x115993[_0xf6cc('0x35')][_0xf6cc('0x39')]));_0x3b32f7[_0xf6cc('0x37')]=_0x3b32f7[_0xf6cc('0x37')][_0xf6cc('0x3a')]?_0x3b32f7[_0xf6cc('0x37')]:_0x3af581[_0xf6cc('0x33')];if(_0x115993[_0xf6cc('0x35')][_0xf6cc('0x43')]){_0x3b32f7[_0xf6cc('0x44')]=[{'all':!![]}];}_0x3b32f7=_[_0xf6cc('0x41')]({},_0x3b32f7,_0x115993['options']);return db[_0xf6cc('0x2e')]['find'](_0x3b32f7)[_0xf6cc('0x25')](handleEntityNotFound(_0x59899c,null))['then'](respondWithResult(_0x59899c,null))[_0xf6cc('0x47')](handleError(_0x59899c,null));};exports[_0xf6cc('0x24')]=function(_0x263d84,_0x391df0){if(_0x263d84[_0xf6cc('0x4a')]['id']){delete _0x263d84['body']['id'];}return db[_0xf6cc('0x2e')][_0xf6cc('0x4b')]({'where':{'id':_0x263d84[_0xf6cc('0x49')]['id']}})['then'](handleEntityNotFound(_0x391df0,null))[_0xf6cc('0x25')](saveUpdates(_0x263d84[_0xf6cc('0x4a')],null))[_0xf6cc('0x25')](respondWithResult(_0x391df0,null))[_0xf6cc('0x47')](handleError(_0x391df0,null));};exports['destroy']=function(_0x594fb7,_0x5c0e34){return db['CannedAnswer']['find']({'where':{'id':_0x594fb7['params']['id']}})[_0xf6cc('0x25')](handleEntityNotFound(_0x5c0e34,null))[_0xf6cc('0x25')](removeEntity(_0x5c0e34,null))[_0xf6cc('0x47')](handleError(_0x5c0e34,null));};exports[_0xf6cc('0x4c')]=function(_0x14952a,_0x33f8f8){var _0x486a43={'key':_0x14952a[_0xf6cc('0x4a')][_0xf6cc('0x32')]};if(_0x14952a[_0xf6cc('0x4a')][_0xf6cc('0x4d')]){_0x486a43[_0xf6cc('0x4d')]=_0x14952a[_0xf6cc('0x4a')][_0xf6cc('0x4d')];}else if(_0x14952a['body'][_0xf6cc('0x4e')]){_0x486a43['SmsAccountId']=_0x14952a[_0xf6cc('0x4a')][_0xf6cc('0x4e')];}else if(_0x14952a[_0xf6cc('0x4a')][_0xf6cc('0x4f')]){_0x486a43[_0xf6cc('0x4f')]=_0x14952a['body'][_0xf6cc('0x4f')];}else if(_0x14952a[_0xf6cc('0x4a')]['ChatWebsiteId']){_0x486a43[_0xf6cc('0x50')]=_0x14952a[_0xf6cc('0x4a')][_0xf6cc('0x50')];}return db[_0xf6cc('0x2e')][_0xf6cc('0x4b')]({'where':_0x486a43})[_0xf6cc('0x25')](function(_0x2f860e){if(_0x2f860e){throw new db[(_0xf6cc('0x51'))][(_0xf6cc('0x52'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xf6cc('0x2e')][_0xf6cc('0x4c')](_0x14952a[_0xf6cc('0x4a')]);})[_0xf6cc('0x25')](function(_0x405a77){var _0x1d8635=_0x14952a[_0xf6cc('0x53')][_0xf6cc('0x27')]({'plain':!![]});if(!_0x1d8635)throw new Error(_0xf6cc('0x54'));if(_0x1d8635[_0xf6cc('0x55')]==='user'){var _0x51038a=_0x405a77[_0xf6cc('0x27')]({'plain':!![]});return db[_0xf6cc('0x56')][_0xf6cc('0x4b')]({'where':{'name':_0xf6cc('0x28'),'userProfileId':_0x1d8635[_0xf6cc('0x57')]},'raw':!![]})[_0xf6cc('0x25')](function(_0x5e3c35){if(_0x5e3c35&&_0x5e3c35[_0xf6cc('0x58')]===0x0){return db[_0xf6cc('0x59')][_0xf6cc('0x4c')]({'name':_0x51038a[_0xf6cc('0x2b')],'resourceId':_0x51038a['id'],'type':_0x5e3c35[_0xf6cc('0x2b')],'sectionId':_0x5e3c35['id']},{})[_0xf6cc('0x25')](function(){return _0x405a77;});}else{return _0x405a77;}})[_0xf6cc('0x47')](function(_0xc03596){logger['error'](_0xf6cc('0x5a'),_0xc03596);throw _0xc03596;});}return _0x405a77;})[_0xf6cc('0x25')](respondWithResult(_0x33f8f8,0xc9))[_0xf6cc('0x47')](handleError(_0x33f8f8,null));};
\ No newline at end of file
+var _0x174f=['userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','then','get','CannedAnswers','destroy','error','name','send','index','CannedAnswer','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','options','find','catch','update','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection'];(function(_0x5056a3,_0x29873a){var _0x5c51c4=function(_0x38c9d5){while(--_0x38c9d5){_0x5056a3['push'](_0x5056a3['shift']());}};_0x5c51c4(++_0x29873a);}(_0x174f,0x1c1));var _0xf174=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x174f[_0x4fc9e6];return _0x551d28;};'use strict';var emlformat=require(_0xf174('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf174('0x1'));var jsonpatch=require(_0xf174('0x2'));var rp=require(_0xf174('0x3'));var moment=require(_0xf174('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf174('0x5'));var util=require(_0xf174('0x6'));var path=require(_0xf174('0x7'));var sox=require(_0xf174('0x8'));var csv=require(_0xf174('0x9'));var ejs=require(_0xf174('0xa'));var fs=require('fs');var fs_extra=require(_0xf174('0xb'));var _=require('lodash');var squel=require(_0xf174('0xc'));var crypto=require(_0xf174('0xd'));var jsforce=require(_0xf174('0xe'));var deskjs=require(_0xf174('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf174('0x10'));var Redis=require('ioredis');var authService=require(_0xf174('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf174('0x12'));var hardwareService=require(_0xf174('0x13'));var logger=require('../../config/logger')(_0xf174('0x14'));var utils=require(_0xf174('0x15'));var config=require(_0xf174('0x16'));var licenseUtil=require(_0xf174('0x17'));var db=require(_0xf174('0x18'))['db'];function respondWithStatusCode(_0x49e7a9,_0xd7b4c6){_0xd7b4c6=_0xd7b4c6||0xcc;return function(_0x2fff7e){if(_0x2fff7e){return _0x49e7a9[_0xf174('0x19')](_0xd7b4c6);}return _0x49e7a9[_0xf174('0x1a')](_0xd7b4c6)[_0xf174('0x1b')]();};}function respondWithResult(_0x2d20b9,_0x5ad735){_0x5ad735=_0x5ad735||0xc8;return function(_0x592abb){if(_0x592abb){return _0x2d20b9[_0xf174('0x1a')](_0x5ad735)[_0xf174('0x1c')](_0x592abb);}};}function respondWithFilteredResult(_0x563664,_0x26a6bb){return function(_0x11db4a){if(_0x11db4a){var _0x1dfe27=typeof _0x26a6bb['offset']===_0xf174('0x1d')&&typeof _0x26a6bb[_0xf174('0x1e')]===_0xf174('0x1d');var _0x366f49=_0x11db4a[_0xf174('0x1f')];var _0x250cb8=_0x1dfe27?0x0:_0x26a6bb[_0xf174('0x20')];var _0x3be0b3=_0x1dfe27?_0x11db4a['count']:_0x26a6bb['offset']+_0x26a6bb[_0xf174('0x1e')];var _0x421846;if(_0x3be0b3>=_0x366f49){_0x3be0b3=_0x366f49;_0x421846=0xc8;}else{_0x421846=0xce;}_0x563664['status'](_0x421846);return _0x563664[_0xf174('0x21')]('Content-Range',_0x250cb8+'-'+_0x3be0b3+'/'+_0x366f49)[_0xf174('0x1c')](_0x11db4a);}return null;};}function patchUpdates(_0x374ddc){return function(_0x562dce){try{jsonpatch[_0xf174('0x22')](_0x562dce,_0x374ddc,!![]);}catch(_0x414af5){return BPromise['reject'](_0x414af5);}return _0x562dce[_0xf174('0x23')]();};}function saveUpdates(_0x4f8416,_0xe03747){return function(_0x5ca1f4){if(_0x5ca1f4){return _0x5ca1f4['update'](_0x4f8416)['then'](function(_0x5dcfb9){return _0x5dcfb9;});}return null;};}function removeEntity(_0x321ccd,_0x5e49ea){return function(_0x4232ae){if(_0x4232ae){return _0x4232ae['destroy']()[_0xf174('0x24')](function(){var _0x29de2b=_0x4232ae[_0xf174('0x25')]({'plain':!![]});var _0x3c526e=_0xf174('0x26');return db['UserProfileResource'][_0xf174('0x27')]({'where':{'type':_0x3c526e,'resourceId':_0x29de2b['id']}})[_0xf174('0x24')](function(){return _0x4232ae;});})['then'](function(){_0x321ccd['status'](0xcc)[_0xf174('0x1b')]();});}};}function handleEntityNotFound(_0x998206,_0x4f0a81){return function(_0x3fdb61){if(!_0x3fdb61){_0x998206[_0xf174('0x19')](0x194);}return _0x3fdb61;};}function handleError(_0x2958c5,_0x2defa3){_0x2defa3=_0x2defa3||0x1f4;return function(_0x298d3f){logger[_0xf174('0x28')](_0x298d3f['stack']);if(_0x298d3f['name']){delete _0x298d3f[_0xf174('0x29')];}_0x2958c5[_0xf174('0x1a')](_0x2defa3)[_0xf174('0x2a')](_0x298d3f);};}exports[_0xf174('0x2b')]=function(_0x18391b,_0xa2793b){var _0x24f424={},_0x106548={},_0xd9dfca={'count':0x0,'rows':[]};var _0x823390=_['map'](db[_0xf174('0x2c')][_0xf174('0x2d')],function(_0x4ba81f){return{'name':_0x4ba81f[_0xf174('0x2e')],'type':_0x4ba81f['type'][_0xf174('0x2f')]};});_0x106548[_0xf174('0x30')]=_[_0xf174('0x31')](_0x823390,_0xf174('0x29'));_0x106548[_0xf174('0x32')]=_[_0xf174('0x33')](_0x18391b[_0xf174('0x32')]);_0x106548[_0xf174('0x34')]=_[_0xf174('0x35')](_0x106548[_0xf174('0x30')],_0x106548[_0xf174('0x32')]);_0x24f424[_0xf174('0x36')]=_['intersection'](_0x106548['model'],qs[_0xf174('0x37')](_0x18391b[_0xf174('0x32')][_0xf174('0x37')]));_0x24f424[_0xf174('0x36')]=_0x24f424['attributes'][_0xf174('0x38')]?_0x24f424[_0xf174('0x36')]:_0x106548[_0xf174('0x30')];if(!_0x18391b[_0xf174('0x32')][_0xf174('0x39')](_0xf174('0x3a'))){_0x24f424[_0xf174('0x1e')]=qs['limit'](_0x18391b[_0xf174('0x32')][_0xf174('0x1e')]);_0x24f424['offset']=qs[_0xf174('0x20')](_0x18391b['query']['offset']);}_0x24f424['order']=qs['sort'](_0x18391b['query'][_0xf174('0x3b')]);_0x24f424[_0xf174('0x3c')]=qs[_0xf174('0x34')](_[_0xf174('0x3d')](_0x18391b[_0xf174('0x32')],_0x106548['filters']),_0x823390);if(_0x18391b[_0xf174('0x32')][_0xf174('0x3e')]){_0x24f424[_0xf174('0x3c')]=_[_0xf174('0x3f')](_0x24f424[_0xf174('0x3c')],{'$or':[{'key':{'$like':'%'+_0x18391b[_0xf174('0x32')][_0xf174('0x3e')]+'%'}},{'value':{'$like':'%'+_0x18391b[_0xf174('0x32')][_0xf174('0x3e')]+'%'}}]});}_0x24f424=_[_0xf174('0x3f')]({},_0x24f424,_0x18391b['options']);var _0x38f7f1={'where':_0x24f424[_0xf174('0x3c')]};return db[_0xf174('0x2c')][_0xf174('0x1f')](_0x38f7f1)[_0xf174('0x24')](function(_0x4ce385){_0xd9dfca['count']=_0x4ce385;if(_0x18391b[_0xf174('0x32')][_0xf174('0x40')]){_0x24f424[_0xf174('0x41')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf174('0x42')](_0x24f424);})[_0xf174('0x24')](function(_0x23c193){_0xd9dfca[_0xf174('0x43')]=_0x23c193;return _0xd9dfca;})[_0xf174('0x24')](respondWithFilteredResult(_0xa2793b,_0x24f424))['catch'](handleError(_0xa2793b,null));};exports[_0xf174('0x44')]=function(_0x1fd8df,_0x1dab81){var _0x25638e={'raw':!![],'where':{'id':_0x1fd8df[_0xf174('0x45')]['id']}},_0x4c1324={};_0x4c1324[_0xf174('0x30')]=_[_0xf174('0x33')](db[_0xf174('0x2c')][_0xf174('0x2d')]);_0x4c1324['query']=_[_0xf174('0x33')](_0x1fd8df[_0xf174('0x32')]);_0x4c1324[_0xf174('0x34')]=_[_0xf174('0x35')](_0x4c1324[_0xf174('0x30')],_0x4c1324['query']);_0x25638e[_0xf174('0x36')]=_[_0xf174('0x35')](_0x4c1324[_0xf174('0x30')],qs[_0xf174('0x37')](_0x1fd8df['query']['fields']));_0x25638e[_0xf174('0x36')]=_0x25638e[_0xf174('0x36')][_0xf174('0x38')]?_0x25638e[_0xf174('0x36')]:_0x4c1324[_0xf174('0x30')];if(_0x1fd8df[_0xf174('0x32')][_0xf174('0x40')]){_0x25638e['include']=[{'all':!![]}];}_0x25638e=_['merge']({},_0x25638e,_0x1fd8df[_0xf174('0x46')]);return db[_0xf174('0x2c')][_0xf174('0x47')](_0x25638e)[_0xf174('0x24')](handleEntityNotFound(_0x1dab81,null))['then'](respondWithResult(_0x1dab81,null))[_0xf174('0x48')](handleError(_0x1dab81,null));};exports[_0xf174('0x49')]=function(_0x7207d6,_0x2b1d79){if(_0x7207d6[_0xf174('0x4a')]['id']){delete _0x7207d6[_0xf174('0x4a')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x7207d6[_0xf174('0x45')]['id']}})['then'](handleEntityNotFound(_0x2b1d79,null))[_0xf174('0x24')](saveUpdates(_0x7207d6[_0xf174('0x4a')],null))[_0xf174('0x24')](respondWithResult(_0x2b1d79,null))[_0xf174('0x48')](handleError(_0x2b1d79,null));};exports[_0xf174('0x27')]=function(_0x33d4bc,_0x4b02c2){return db[_0xf174('0x2c')]['find']({'where':{'id':_0x33d4bc[_0xf174('0x45')]['id']}})[_0xf174('0x24')](handleEntityNotFound(_0x4b02c2,null))['then'](removeEntity(_0x4b02c2,null))[_0xf174('0x48')](handleError(_0x4b02c2,null));};exports['create']=function(_0x52a019,_0x3c7fcc){var _0x75f4c4={'key':_0x52a019[_0xf174('0x4a')][_0xf174('0x2f')]};if(_0x52a019[_0xf174('0x4a')][_0xf174('0x4b')]){_0x75f4c4[_0xf174('0x4b')]=_0x52a019['body'][_0xf174('0x4b')];}else if(_0x52a019[_0xf174('0x4a')][_0xf174('0x4c')]){_0x75f4c4['SmsAccountId']=_0x52a019[_0xf174('0x4a')][_0xf174('0x4c')];}else if(_0x52a019[_0xf174('0x4a')][_0xf174('0x4d')]){_0x75f4c4[_0xf174('0x4d')]=_0x52a019[_0xf174('0x4a')][_0xf174('0x4d')];}else if(_0x52a019[_0xf174('0x4a')][_0xf174('0x4e')]){_0x75f4c4[_0xf174('0x4e')]=_0x52a019['body'][_0xf174('0x4e')];}return db['CannedAnswer'][_0xf174('0x47')]({'where':_0x75f4c4})[_0xf174('0x24')](function(_0x6469cc){if(_0x6469cc){throw new db[(_0xf174('0x4f'))][(_0xf174('0x50'))](_0xf174('0x51'));}return db[_0xf174('0x2c')]['create'](_0x52a019[_0xf174('0x4a')]);})[_0xf174('0x24')](function(_0x447858){var _0x17ae41=_0x52a019[_0xf174('0x52')][_0xf174('0x25')]({'plain':!![]});if(!_0x17ae41)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17ae41[_0xf174('0x53')]===_0xf174('0x52')){var _0x4d68be=_0x447858[_0xf174('0x25')]({'plain':!![]});return db[_0xf174('0x54')][_0xf174('0x47')]({'where':{'name':_0xf174('0x26'),'userProfileId':_0x17ae41[_0xf174('0x55')]},'raw':!![]})[_0xf174('0x24')](function(_0x55f293){if(_0x55f293&&_0x55f293[_0xf174('0x56')]===0x0){return db['UserProfileResource'][_0xf174('0x57')]({'name':_0x4d68be[_0xf174('0x29')],'resourceId':_0x4d68be['id'],'type':_0x55f293[_0xf174('0x29')],'sectionId':_0x55f293['id']},{})['then'](function(){return _0x447858;});}else{return _0x447858;}})[_0xf174('0x48')](function(_0x37a97d){logger[_0xf174('0x28')](_0xf174('0x58'),_0x37a97d);throw _0x37a97d;});}return _0x447858;})[_0xf174('0x24')](respondWithResult(_0x3c7fcc,0xc9))[_0xf174('0x48')](handleError(_0x3c7fcc,null));};
\ No newline at end of file
index 715a439..2cd8e10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x314e=['moment','request-promise','path','../../config/environment','exports','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x314e,0x173));var _0xe314=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x314e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe314('0x0'));var util=require(_0xe314('0x1'));var logger=require(_0xe314('0x2'))('api');var moment=require(_0xe314('0x3'));var BPromise=require('bluebird');var rp=require(_0xe314('0x4'));var fs=require('fs');var path=require(_0xe314('0x5'));var rimraf=require('rimraf');var config=require(_0xe314('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0xe314('0x7')]=function(_0x2aec94,_0x41ba1f){return _0x2aec94['define']('CannedAnswer',attributes,{'tableName':_0xe314('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe314('0x9'),'collate':_0xe314('0xa')});};
\ No newline at end of file
+var _0xf064=['request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x41b594,_0x1a9543){var _0x488d36=function(_0x14805d){while(--_0x14805d){_0x41b594['push'](_0x41b594['shift']());}};_0x488d36(++_0x1a9543);}(_0xf064,0xb0));var _0x4f06=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xf064[_0x15c421];return _0x5e5ed5;};'use strict';var _=require(_0x4f06('0x0'));var util=require(_0x4f06('0x1'));var logger=require(_0x4f06('0x2'))(_0x4f06('0x3'));var moment=require(_0x4f06('0x4'));var BPromise=require(_0x4f06('0x5'));var rp=require(_0x4f06('0x6'));var fs=require('fs');var path=require(_0x4f06('0x7'));var rimraf=require(_0x4f06('0x8'));var config=require(_0x4f06('0x9'));var attributes=require(_0x4f06('0xa'));module['exports']=function(_0xdc371d,_0x49f64e){return _0xdc371d['define']('CannedAnswer',attributes,{'tableName':_0x4f06('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4f06('0xc')});};
\ No newline at end of file
index dc3c3be..13f0665 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(_0xbf2ac7,_0x11f4cb){var _0x35511a=function(_0x1051ed){while(--_0x1051ed){_0xbf2ac7['push'](_0xbf2ac7['shift']());}};_0x35511a(++_0x11f4cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+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(_0x18580b,_0x4a20d8){var _0x13cfec=function(_0x3261aa){while(--_0x3261aa){_0x18580b['push'](_0x18580b['shift']());}};_0x13cfec(++_0x4a20d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 1d151f1..396ecd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ed7=['create','put','update','delete','/:id','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','post'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x6ed7,0x192));var _0x76ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ed7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x76ed('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x76ed('0x1'));var express=require('express');var router=express[_0x76ed('0x2')]();var fs_extra=require(_0x76ed('0x3'));var auth=require(_0x76ed('0x4'));var interaction=require(_0x76ed('0x5'));var config=require(_0x76ed('0x6'));var controller=require(_0x76ed('0x7'));router[_0x76ed('0x8')]('/',auth[_0x76ed('0x9')](),controller[_0x76ed('0xa')]);router[_0x76ed('0x8')]('/:id',auth[_0x76ed('0x9')](),controller['show']);router[_0x76ed('0xb')]('/',auth['isAuthenticated'](),controller[_0x76ed('0xc')]);router[_0x76ed('0xd')]('/:id',auth[_0x76ed('0x9')](),controller[_0x76ed('0xe')]);router[_0x76ed('0xf')](_0x76ed('0x10'),auth[_0x76ed('0x9')](),controller['destroy']);module[_0x76ed('0x11')]=router;
\ No newline at end of file
+var _0x3eb7=['update','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x40c604,_0x123450){var _0x4c5616=function(_0x5f3000){while(--_0x5f3000){_0x40c604['push'](_0x40c604['shift']());}};_0x4c5616(++_0x123450);}(_0x3eb7,0x178));var _0x73eb=function(_0x2b0433,_0x2ba431){_0x2b0433=_0x2b0433-0x0;var _0x149a1e=_0x3eb7[_0x2b0433];return _0x149a1e;};'use strict';var multer=require(_0x73eb('0x0'));var util=require(_0x73eb('0x1'));var path=require(_0x73eb('0x2'));var timeout=require(_0x73eb('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x73eb('0x4'));var auth=require(_0x73eb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x73eb('0x6'));var controller=require(_0x73eb('0x7'));router[_0x73eb('0x8')]('/',auth[_0x73eb('0x9')](),controller[_0x73eb('0xa')]);router['get'](_0x73eb('0xb'),auth[_0x73eb('0x9')](),controller[_0x73eb('0xc')]);router[_0x73eb('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x73eb('0xe')](_0x73eb('0xb'),auth['isAuthenticated'](),controller[_0x73eb('0xf')]);router['delete'](_0x73eb('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x73eb('0x10')]=router;
\ No newline at end of file
index 3fca5fb..d481f91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c8a=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x5b85ec,_0x2fceb2){var _0xda5abc=function(_0x11268b){while(--_0x11268b){_0x5b85ec['push'](_0x5b85ec['shift']());}};_0xda5abc(++_0x2fceb2);}(_0x1c8a,0x140));var _0xa1c8=function(_0xdc06ca,_0x3950c5){_0xdc06ca=_0xdc06ca-0x0;var _0x4fea82=_0x1c8a[_0xdc06ca];return _0x4fea82;};'use strict';var Sequelize=require(_0xa1c8('0x0'));module[_0xa1c8('0x1')]={'calldate':{'type':Sequelize[_0xa1c8('0x2')],'allowNull':![],'defaultValue':_0xa1c8('0x3')},'clid':{'type':Sequelize[_0xa1c8('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xa1c8('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xa1c8('0x4')]},'dstchannel':{'type':Sequelize[_0xa1c8('0x4')]},'lastapp':{'type':Sequelize[_0xa1c8('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xa1c8('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xa1c8('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa1c8('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xa1c8('0x4')]},'userfield':{'type':Sequelize[_0xa1c8('0x4')]},'uniqueid':{'type':Sequelize[_0xa1c8('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xa1c8('0x4')]},'peeraccount':{'type':Sequelize[_0xa1c8('0x4')]},'type':{'type':Sequelize[_0xa1c8('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb16f=['DATE','STRING','sequelize','exports'];(function(_0x3f14d2,_0x908e69){var _0x3ad354=function(_0x4f5662){while(--_0x4f5662){_0x3f14d2['push'](_0x3f14d2['shift']());}};_0x3ad354(++_0x908e69);}(_0xb16f,0xf6));var _0xfb16=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xb16f[_0x45783c];return _0x1161da;};'use strict';var Sequelize=require(_0xfb16('0x0'));module[_0xfb16('0x1')]={'calldate':{'type':Sequelize[_0xfb16('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xfb16('0x3')]},'src':{'type':Sequelize[_0xfb16('0x3')]},'dst':{'type':Sequelize[_0xfb16('0x3')]},'dcontext':{'type':Sequelize[_0xfb16('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xfb16('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xfb16('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xfb16('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xfb16('0x3')]},'linkedid':{'type':Sequelize[_0xfb16('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xfb16('0x3')]}};
\ No newline at end of file
index 4bef075..7335b3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf767=['apply','save','then','error','stack','name','map','Cdr','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','merge','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','undefined','count','limit','status','set','json'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0xf767,0x76));var _0x7f76=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0xf767[_0x4953da];return _0x2d3780;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f76('0x0'));var zipdir=require(_0x7f76('0x1'));var jsonpatch=require(_0x7f76('0x2'));var rp=require(_0x7f76('0x3'));var moment=require(_0x7f76('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7f76('0x5'));var util=require(_0x7f76('0x6'));var path=require(_0x7f76('0x7'));var sox=require(_0x7f76('0x8'));var csv=require('to-csv');var ejs=require(_0x7f76('0x9'));var fs=require('fs');var fs_extra=require(_0x7f76('0xa'));var _=require(_0x7f76('0xb'));var squel=require(_0x7f76('0xc'));var crypto=require(_0x7f76('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f76('0xe'));var toCsv=require(_0x7f76('0xf'));var querystring=require(_0x7f76('0x10'));var Papa=require(_0x7f76('0x11'));var Redis=require('ioredis');var authService=require(_0x7f76('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7f76('0x13'));var hardwareService=require(_0x7f76('0x14'));var logger=require(_0x7f76('0x15'))(_0x7f76('0x16'));var utils=require(_0x7f76('0x17'));var config=require(_0x7f76('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f76('0x19'))['db'];function respondWithStatusCode(_0x2cd1b3,_0x47403b){_0x47403b=_0x47403b||0xcc;return function(_0x32392b){if(_0x32392b){return _0x2cd1b3[_0x7f76('0x1a')](_0x47403b);}return _0x2cd1b3['status'](_0x47403b)[_0x7f76('0x1b')]();};}function respondWithResult(_0x4d8de0,_0x42a9d3){_0x42a9d3=_0x42a9d3||0xc8;return function(_0x256f79){if(_0x256f79){return _0x4d8de0['status'](_0x42a9d3)['json'](_0x256f79);}};}function respondWithFilteredResult(_0x58d2f3,_0xe81aa9){return function(_0x2df2db){if(_0x2df2db){var _0x286e96=typeof _0xe81aa9['offset']===_0x7f76('0x1c')&&typeof _0xe81aa9['limit']===_0x7f76('0x1c');var _0x3ceb6a=_0x2df2db[_0x7f76('0x1d')];var _0x4802ff=_0x286e96?0x0:_0xe81aa9['offset'];var _0x494537=_0x286e96?_0x2df2db['count']:_0xe81aa9['offset']+_0xe81aa9[_0x7f76('0x1e')];var _0xdb1407;if(_0x494537>=_0x3ceb6a){_0x494537=_0x3ceb6a;_0xdb1407=0xc8;}else{_0xdb1407=0xce;}_0x58d2f3[_0x7f76('0x1f')](_0xdb1407);return _0x58d2f3[_0x7f76('0x20')]('Content-Range',_0x4802ff+'-'+_0x494537+'/'+_0x3ceb6a)[_0x7f76('0x21')](_0x2df2db);}return null;};}function patchUpdates(_0x557c0f){return function(_0x38c4d6){try{jsonpatch[_0x7f76('0x22')](_0x38c4d6,_0x557c0f,!![]);}catch(_0x5a28b0){return BPromise['reject'](_0x5a28b0);}return _0x38c4d6[_0x7f76('0x23')]();};}function saveUpdates(_0xb647d8,_0x5efed5){return function(_0x3f2536){if(_0x3f2536){return _0x3f2536['update'](_0xb647d8)[_0x7f76('0x24')](function(_0x333056){return _0x333056;});}return null;};}function removeEntity(_0x31993d,_0x3deb00){return function(_0x3eea75){if(_0x3eea75){return _0x3eea75['destroy']()[_0x7f76('0x24')](function(){_0x31993d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x197519,_0x45f1c9){return function(_0x3492f4){if(!_0x3492f4){_0x197519['sendStatus'](0x194);}return _0x3492f4;};}function handleError(_0xbe6ac1,_0x1347bf){_0x1347bf=_0x1347bf||0x1f4;return function(_0x3e624d){logger[_0x7f76('0x25')](_0x3e624d[_0x7f76('0x26')]);if(_0x3e624d['name']){delete _0x3e624d[_0x7f76('0x27')];}_0xbe6ac1[_0x7f76('0x1f')](_0x1347bf)['send'](_0x3e624d);};}exports['index']=function(_0xe459de,_0x58829a){var _0x1dd664={},_0x3542e3={},_0xd5ba7={'count':0x0,'rows':[]};var _0x393bdd=_[_0x7f76('0x28')](db[_0x7f76('0x29')]['rawAttributes'],function(_0x3570ec){return{'name':_0x3570ec[_0x7f76('0x2a')],'type':_0x3570ec[_0x7f76('0x2b')][_0x7f76('0x2c')]};});_0x3542e3['model']=_[_0x7f76('0x28')](_0x393bdd,_0x7f76('0x27'));_0x3542e3[_0x7f76('0x2d')]=_['keys'](_0xe459de[_0x7f76('0x2d')]);_0x3542e3[_0x7f76('0x2e')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],_0x3542e3[_0x7f76('0x2d')]);_0x1dd664[_0x7f76('0x31')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0xe459de[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x1dd664[_0x7f76('0x31')]=_0x1dd664[_0x7f76('0x31')]['length']?_0x1dd664[_0x7f76('0x31')]:_0x3542e3[_0x7f76('0x30')];if(!_0xe459de[_0x7f76('0x2d')][_0x7f76('0x33')](_0x7f76('0x34'))){_0x1dd664[_0x7f76('0x1e')]=qs[_0x7f76('0x1e')](_0xe459de[_0x7f76('0x2d')]['limit']);_0x1dd664[_0x7f76('0x35')]=qs['offset'](_0xe459de['query'][_0x7f76('0x35')]);}_0x1dd664['order']=qs[_0x7f76('0x36')](_0xe459de[_0x7f76('0x2d')]['sort']);_0x1dd664[_0x7f76('0x37')]=qs['filters'](_['pick'](_0xe459de[_0x7f76('0x2d')],_0x3542e3[_0x7f76('0x2e')]),_0x393bdd);if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]){_0x1dd664[_0x7f76('0x37')]=_['merge'](_0x1dd664[_0x7f76('0x37')],{'$or':_[_0x7f76('0x28')](_0x393bdd,function(_0x4edf74){if(_0x4edf74['type']!==_0x7f76('0x39')){var _0x4ea167={};_0x4ea167[_0x4edf74[_0x7f76('0x27')]]={'$like':'%'+_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]+'%'};return _0x4ea167;}})});}_0x1dd664=_['merge']({},_0x1dd664,_0xe459de[_0x7f76('0x3a')]);var _0x26b537={'where':_0x1dd664[_0x7f76('0x37')]};return db[_0x7f76('0x29')][_0x7f76('0x1d')](_0x26b537)[_0x7f76('0x24')](function(_0x58649f){_0xd5ba7['count']=_0x58649f;if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x1dd664[_0x7f76('0x3c')]=[{'all':!![]}];}return db[_0x7f76('0x29')][_0x7f76('0x3d')](_0x1dd664);})[_0x7f76('0x24')](function(_0x401284){_0xd5ba7[_0x7f76('0x3e')]=_0x401284;return _0xd5ba7;})[_0x7f76('0x24')](respondWithFilteredResult(_0x58829a,_0x1dd664))[_0x7f76('0x3f')](handleError(_0x58829a,null));};exports[_0x7f76('0x40')]=function(_0x313d37,_0x3229b9){var _0x391d04={'raw':!![],'where':{'id':_0x313d37[_0x7f76('0x41')]['id']}},_0x2a43f1={};_0x2a43f1[_0x7f76('0x30')]=_[_0x7f76('0x42')](db['Cdr'][_0x7f76('0x43')]);_0x2a43f1[_0x7f76('0x2d')]=_[_0x7f76('0x42')](_0x313d37['query']);_0x2a43f1['filters']=_[_0x7f76('0x2f')](_0x2a43f1['model'],_0x2a43f1[_0x7f76('0x2d')]);_0x391d04['attributes']=_['intersection'](_0x2a43f1[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0x313d37[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x391d04[_0x7f76('0x31')]=_0x391d04[_0x7f76('0x31')][_0x7f76('0x44')]?_0x391d04[_0x7f76('0x31')]:_0x2a43f1[_0x7f76('0x30')];if(_0x313d37[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x391d04[_0x7f76('0x3c')]=[{'all':!![]}];}_0x391d04=_[_0x7f76('0x45')]({},_0x391d04,_0x313d37[_0x7f76('0x3a')]);return db['Cdr'][_0x7f76('0x46')](_0x391d04)['then'](handleEntityNotFound(_0x3229b9,null))[_0x7f76('0x24')](respondWithResult(_0x3229b9,null))[_0x7f76('0x3f')](handleError(_0x3229b9,null));};exports[_0x7f76('0x47')]=function(_0x39bbef,_0x487b1f){return db[_0x7f76('0x29')][_0x7f76('0x47')](_0x39bbef[_0x7f76('0x48')],{})[_0x7f76('0x24')](respondWithResult(_0x487b1f,0xc9))['catch'](handleError(_0x487b1f,null));};exports[_0x7f76('0x49')]=function(_0xd87fe7,_0x53f77a){if(_0xd87fe7[_0x7f76('0x48')]['id']){delete _0xd87fe7[_0x7f76('0x48')]['id'];}return db[_0x7f76('0x29')]['find']({'where':{'id':_0xd87fe7[_0x7f76('0x41')]['id']}})[_0x7f76('0x24')](handleEntityNotFound(_0x53f77a,null))[_0x7f76('0x24')](saveUpdates(_0xd87fe7[_0x7f76('0x48')],null))[_0x7f76('0x24')](respondWithResult(_0x53f77a,null))[_0x7f76('0x3f')](handleError(_0x53f77a,null));};exports[_0x7f76('0x4a')]=function(_0x42abd9,_0x1a4d3c){return db[_0x7f76('0x29')][_0x7f76('0x46')]({'where':{'id':_0x42abd9[_0x7f76('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a4d3c,null))[_0x7f76('0x24')](removeEntity(_0x1a4d3c,null))['catch'](handleError(_0x1a4d3c,null));};exports[_0x7f76('0x4b')]=function(_0x3bcd59,_0x171c71){return db['Cdr'][_0x7f76('0x4b')]()[_0x7f76('0x24')](respondWithResult(_0x171c71,null))['catch'](handleError(_0x171c71,null));};
\ No newline at end of file
+var _0x0bde=['findAll','rows','create','body','catch','update','find','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe0bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0bd('0x1'));var rp=require(_0xe0bd('0x2'));var moment=require(_0xe0bd('0x3'));var BPromise=require(_0xe0bd('0x4'));var Mustache=require(_0xe0bd('0x5'));var util=require('util');var path=require(_0xe0bd('0x6'));var sox=require(_0xe0bd('0x7'));var csv=require(_0xe0bd('0x8'));var ejs=require(_0xe0bd('0x9'));var fs=require('fs');var fs_extra=require(_0xe0bd('0xa'));var _=require(_0xe0bd('0xb'));var squel=require(_0xe0bd('0xc'));var crypto=require('crypto');var jsforce=require(_0xe0bd('0xd'));var deskjs=require(_0xe0bd('0xe'));var toCsv=require(_0xe0bd('0x8'));var querystring=require(_0xe0bd('0xf'));var Papa=require(_0xe0bd('0x10'));var Redis=require(_0xe0bd('0x11'));var authService=require(_0xe0bd('0x12'));var qs=require(_0xe0bd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe0bd('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe0bd('0x15'));var db=require(_0xe0bd('0x16'))['db'];function respondWithStatusCode(_0x54d40e,_0xc492b4){_0xc492b4=_0xc492b4||0xcc;return function(_0x5272ca){if(_0x5272ca){return _0x54d40e[_0xe0bd('0x17')](_0xc492b4);}return _0x54d40e[_0xe0bd('0x18')](_0xc492b4)[_0xe0bd('0x19')]();};}function respondWithResult(_0x20ab47,_0x47664e){_0x47664e=_0x47664e||0xc8;return function(_0x335f17){if(_0x335f17){return _0x20ab47[_0xe0bd('0x18')](_0x47664e)[_0xe0bd('0x1a')](_0x335f17);}};}function respondWithFilteredResult(_0x4f63fa,_0x50891d){return function(_0x4fb006){if(_0x4fb006){var _0x2ff887=typeof _0x50891d[_0xe0bd('0x1b')]===_0xe0bd('0x1c')&&typeof _0x50891d[_0xe0bd('0x1d')]===_0xe0bd('0x1c');var _0x55f304=_0x4fb006['count'];var _0x1becc8=_0x2ff887?0x0:_0x50891d['offset'];var _0x4f36f7=_0x2ff887?_0x4fb006[_0xe0bd('0x1e')]:_0x50891d[_0xe0bd('0x1b')]+_0x50891d[_0xe0bd('0x1d')];var _0x5f22e2;if(_0x4f36f7>=_0x55f304){_0x4f36f7=_0x55f304;_0x5f22e2=0xc8;}else{_0x5f22e2=0xce;}_0x4f63fa[_0xe0bd('0x18')](_0x5f22e2);return _0x4f63fa[_0xe0bd('0x1f')](_0xe0bd('0x20'),_0x1becc8+'-'+_0x4f36f7+'/'+_0x55f304)['json'](_0x4fb006);}return null;};}function patchUpdates(_0x1bf742){return function(_0x25f595){try{jsonpatch[_0xe0bd('0x21')](_0x25f595,_0x1bf742,!![]);}catch(_0x532584){return BPromise[_0xe0bd('0x22')](_0x532584);}return _0x25f595[_0xe0bd('0x23')]();};}function saveUpdates(_0x2b4f7d,_0x5378d2){return function(_0x1d6a19){if(_0x1d6a19){return _0x1d6a19['update'](_0x2b4f7d)[_0xe0bd('0x24')](function(_0x2bcfcc){return _0x2bcfcc;});}return null;};}function removeEntity(_0x4bcd48,_0xa4a4e9){return function(_0xf6d956){if(_0xf6d956){return _0xf6d956[_0xe0bd('0x25')]()[_0xe0bd('0x24')](function(){_0x4bcd48[_0xe0bd('0x18')](0xcc)[_0xe0bd('0x19')]();});}};}function handleEntityNotFound(_0x2096a2,_0x162356){return function(_0x537708){if(!_0x537708){_0x2096a2['sendStatus'](0x194);}return _0x537708;};}function handleError(_0x275f14,_0x39c98e){_0x39c98e=_0x39c98e||0x1f4;return function(_0x47d171){logger['error'](_0x47d171[_0xe0bd('0x26')]);if(_0x47d171[_0xe0bd('0x27')]){delete _0x47d171[_0xe0bd('0x27')];}_0x275f14[_0xe0bd('0x18')](_0x39c98e)['send'](_0x47d171);};}exports[_0xe0bd('0x28')]=function(_0x4ef39b,_0x9146fe){var _0x170874={},_0x42bea7={},_0x1b857c={'count':0x0,'rows':[]};var _0x1e2020=_[_0xe0bd('0x29')](db[_0xe0bd('0x2a')][_0xe0bd('0x2b')],function(_0x25d515){return{'name':_0x25d515[_0xe0bd('0x2c')],'type':_0x25d515[_0xe0bd('0x2d')][_0xe0bd('0x2e')]};});_0x42bea7[_0xe0bd('0x2f')]=_['map'](_0x1e2020,_0xe0bd('0x27'));_0x42bea7[_0xe0bd('0x30')]=_[_0xe0bd('0x31')](_0x4ef39b[_0xe0bd('0x30')]);_0x42bea7[_0xe0bd('0x32')]=_[_0xe0bd('0x33')](_0x42bea7['model'],_0x42bea7['query']);_0x170874[_0xe0bd('0x34')]=_[_0xe0bd('0x33')](_0x42bea7[_0xe0bd('0x2f')],qs[_0xe0bd('0x35')](_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x35')]));_0x170874[_0xe0bd('0x34')]=_0x170874['attributes'][_0xe0bd('0x36')]?_0x170874[_0xe0bd('0x34')]:_0x42bea7[_0xe0bd('0x2f')];if(!_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x37')](_0xe0bd('0x38'))){_0x170874['limit']=qs[_0xe0bd('0x1d')](_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x1d')]);_0x170874[_0xe0bd('0x1b')]=qs[_0xe0bd('0x1b')](_0x4ef39b['query']['offset']);}_0x170874[_0xe0bd('0x39')]=qs[_0xe0bd('0x3a')](_0x4ef39b[_0xe0bd('0x30')]['sort']);_0x170874[_0xe0bd('0x3b')]=qs['filters'](_['pick'](_0x4ef39b[_0xe0bd('0x30')],_0x42bea7[_0xe0bd('0x32')]),_0x1e2020);if(_0x4ef39b['query']['filter']){_0x170874['where']=_[_0xe0bd('0x3c')](_0x170874[_0xe0bd('0x3b')],{'$or':_[_0xe0bd('0x29')](_0x1e2020,function(_0x5d2aff){if(_0x5d2aff[_0xe0bd('0x2d')]!==_0xe0bd('0x3d')){var _0x1e6823={};_0x1e6823[_0x5d2aff['name']]={'$like':'%'+_0x4ef39b['query'][_0xe0bd('0x3e')]+'%'};return _0x1e6823;}})});}_0x170874=_['merge']({},_0x170874,_0x4ef39b[_0xe0bd('0x3f')]);var _0x195f0f={'where':_0x170874['where']};return db[_0xe0bd('0x2a')][_0xe0bd('0x1e')](_0x195f0f)[_0xe0bd('0x24')](function(_0xb65059){_0x1b857c[_0xe0bd('0x1e')]=_0xb65059;if(_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x40')]){_0x170874['include']=[{'all':!![]}];}return db[_0xe0bd('0x2a')][_0xe0bd('0x41')](_0x170874);})[_0xe0bd('0x24')](function(_0x3c138e){_0x1b857c[_0xe0bd('0x42')]=_0x3c138e;return _0x1b857c;})['then'](respondWithFilteredResult(_0x9146fe,_0x170874))['catch'](handleError(_0x9146fe,null));};exports['show']=function(_0x2b27b1,_0x1a121f){var _0x15de49={'raw':!![],'where':{'id':_0x2b27b1['params']['id']}},_0x32ed4f={};_0x32ed4f['model']=_[_0xe0bd('0x31')](db[_0xe0bd('0x2a')][_0xe0bd('0x2b')]);_0x32ed4f[_0xe0bd('0x30')]=_[_0xe0bd('0x31')](_0x2b27b1[_0xe0bd('0x30')]);_0x32ed4f[_0xe0bd('0x32')]=_['intersection'](_0x32ed4f[_0xe0bd('0x2f')],_0x32ed4f['query']);_0x15de49[_0xe0bd('0x34')]=_[_0xe0bd('0x33')](_0x32ed4f['model'],qs['fields'](_0x2b27b1[_0xe0bd('0x30')][_0xe0bd('0x35')]));_0x15de49[_0xe0bd('0x34')]=_0x15de49[_0xe0bd('0x34')][_0xe0bd('0x36')]?_0x15de49[_0xe0bd('0x34')]:_0x32ed4f[_0xe0bd('0x2f')];if(_0x2b27b1[_0xe0bd('0x30')][_0xe0bd('0x40')]){_0x15de49['include']=[{'all':!![]}];}_0x15de49=_[_0xe0bd('0x3c')]({},_0x15de49,_0x2b27b1[_0xe0bd('0x3f')]);return db[_0xe0bd('0x2a')]['find'](_0x15de49)[_0xe0bd('0x24')](handleEntityNotFound(_0x1a121f,null))[_0xe0bd('0x24')](respondWithResult(_0x1a121f,null))['catch'](handleError(_0x1a121f,null));};exports[_0xe0bd('0x43')]=function(_0x136ac6,_0x578792){return db[_0xe0bd('0x2a')][_0xe0bd('0x43')](_0x136ac6[_0xe0bd('0x44')],{})['then'](respondWithResult(_0x578792,0xc9))[_0xe0bd('0x45')](handleError(_0x578792,null));};exports[_0xe0bd('0x46')]=function(_0x147438,_0x21ae20){if(_0x147438[_0xe0bd('0x44')]['id']){delete _0x147438[_0xe0bd('0x44')]['id'];}return db[_0xe0bd('0x2a')][_0xe0bd('0x47')]({'where':{'id':_0x147438[_0xe0bd('0x48')]['id']}})['then'](handleEntityNotFound(_0x21ae20,null))['then'](saveUpdates(_0x147438['body'],null))[_0xe0bd('0x24')](respondWithResult(_0x21ae20,null))[_0xe0bd('0x45')](handleError(_0x21ae20,null));};exports['destroy']=function(_0xacd120,_0x284ea3){return db[_0xe0bd('0x2a')][_0xe0bd('0x47')]({'where':{'id':_0xacd120[_0xe0bd('0x48')]['id']}})[_0xe0bd('0x24')](handleEntityNotFound(_0x284ea3,null))[_0xe0bd('0x24')](removeEntity(_0x284ea3,null))[_0xe0bd('0x45')](handleError(_0x284ea3,null));};exports[_0xe0bd('0x49')]=function(_0x2631f5,_0x503939){return db[_0xe0bd('0x2a')][_0xe0bd('0x49')]()[_0xe0bd('0x24')](respondWithResult(_0x503939,null))['catch'](handleError(_0x503939,null));};
\ No newline at end of file
index 4bf720a..40ab1b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x2b917e,_0x336270){var _0x22b3f3=function(_0x357443){while(--_0x357443){_0x2b917e['push'](_0x2b917e['shift']());}};_0x22b3f3(++_0x336270);}(_0x7a54,0x106));var _0x47a5=function(_0x3cf3cc,_0x4eb013){_0x3cf3cc=_0x3cf3cc-0x0;var _0x509619=_0x7a54[_0x3cf3cc];return _0x509619;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x21aea9,_0x8c3df3){var _0x284171=function(_0xbcefd5){while(--_0xbcefd5){_0x21aea9['push'](_0x21aea9['shift']());}};_0x284171(++_0x8c3df3);}(_0x7a54,0x106));var _0x47a5=function(_0x149e96,_0x977e7c){_0x149e96=_0x149e96-0x0;var _0x21f626=_0x7a54[_0x149e96];return _0x21f626;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
index 6d4a404..48baed4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40ce=['info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2490d2,_0x50cc19){var _0x37ed58=function(_0x258f65){while(--_0x258f65){_0x2490d2['push'](_0x2490d2['shift']());}};_0x37ed58(++_0x50cc19);}(_0x40ce,0x72));var _0xe40c=function(_0x51fdfa,_0xc613c){_0x51fdfa=_0x51fdfa-0x0;var _0x111234=_0x40ce[_0x51fdfa];return _0x111234;};'use strict';var _=require(_0xe40c('0x0'));var util=require('util');var moment=require(_0xe40c('0x1'));var BPromise=require(_0xe40c('0x2'));var rs=require(_0xe40c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe40c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe40c('0x5'))(_0xe40c('0x6'));var config=require(_0xe40c('0x7'));var jayson=require(_0xe40c('0x8'));var client=jayson[_0xe40c('0x9')][_0xe40c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x154b96,_0xe58c05,_0x58ba56){return new BPromise(function(_0x24a6b9,_0xb3e416){return client[_0xe40c('0xb')](_0x154b96,_0x58ba56)['then'](function(_0x59d1f1){logger[_0xe40c('0xc')](_0xe40c('0xd'),_0xe58c05,'request\x20sent');logger[_0xe40c('0xe')](_0xe40c('0xf'),_0xe58c05,_0xe40c('0x10'),JSON['stringify'](_0x59d1f1));if(_0x59d1f1[_0xe40c('0x11')]){if(_0x59d1f1['error'][_0xe40c('0x12')]===0x1f4){logger[_0xe40c('0x11')](_0xe40c('0xd'),_0xe58c05,_0x59d1f1[_0xe40c('0x11')]['message']);return _0xb3e416(_0x59d1f1[_0xe40c('0x11')][_0xe40c('0x13')]);}logger[_0xe40c('0x11')](_0xe40c('0xd'),_0xe58c05,_0x59d1f1[_0xe40c('0x11')][_0xe40c('0x13')]);return _0x24a6b9(_0x59d1f1[_0xe40c('0x11')][_0xe40c('0x13')]);}else{logger['info'](_0xe40c('0xd'),_0xe58c05,_0xe40c('0x10'));_0x24a6b9(_0x59d1f1['result'][_0xe40c('0x13')]);}})[_0xe40c('0x14')](function(_0x4e43ac){logger['error'](_0xe40c('0xd'),_0xe58c05,_0x4e43ac);_0xb3e416(_0x4e43ac);});});}
\ No newline at end of file
+var _0xd765=['result','catch','util','moment','ioredis','rpc','../../config/environment','jayson/promise','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x344939,_0x15bc47){var _0x361a75=function(_0x28b240){while(--_0x28b240){_0x344939['push'](_0x344939['shift']());}};_0x361a75(++_0x15bc47);}(_0xd765,0x122));var _0x5d76=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xd765[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0x5d76('0x0'));var moment=require(_0x5d76('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d76('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5d76('0x3'));var config=require(_0x5d76('0x4'));var jayson=require(_0x5d76('0x5'));var client=jayson['client'][_0x5d76('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xafa3f0,_0xe3b39d,_0x107716){return new BPromise(function(_0x299386,_0x353a81){return client[_0x5d76('0x7')](_0xafa3f0,_0x107716)['then'](function(_0xc27e0c){logger[_0x5d76('0x8')](_0x5d76('0x9'),_0xe3b39d,_0x5d76('0xa'));logger[_0x5d76('0xb')](_0x5d76('0xc'),_0xe3b39d,_0x5d76('0xa'),JSON[_0x5d76('0xd')](_0xc27e0c));if(_0xc27e0c[_0x5d76('0xe')]){if(_0xc27e0c[_0x5d76('0xe')]['code']===0x1f4){logger[_0x5d76('0xe')](_0x5d76('0x9'),_0xe3b39d,_0xc27e0c[_0x5d76('0xe')]['message']);return _0x353a81(_0xc27e0c[_0x5d76('0xe')]['message']);}logger[_0x5d76('0xe')](_0x5d76('0x9'),_0xe3b39d,_0xc27e0c[_0x5d76('0xe')][_0x5d76('0xf')]);return _0x299386(_0xc27e0c['error'][_0x5d76('0xf')]);}else{logger[_0x5d76('0x8')](_0x5d76('0x9'),_0xe3b39d,_0x5d76('0xa'));_0x299386(_0xc27e0c[_0x5d76('0x10')]['message']);}})[_0x5d76('0x11')](function(_0x430fb2){logger['error'](_0x5d76('0x9'),_0xe3b39d,_0x430fb2);_0x353a81(_0x430fb2);});});}
\ No newline at end of file
index b0d5f9f..240ada5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x4f5108,_0x46a54b){var _0x2d56ca=function(_0x5b3c1e){while(--_0x5b3c1e){_0x4f5108['push'](_0x4f5108['shift']());}};_0x2d56ca(++_0x46a54b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_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 de8c794..a35102d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bd9=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x5bccad,_0x2a6ac8){var _0x54dadf=function(_0x11dc92){while(--_0x11dc92){_0x5bccad['push'](_0x5bccad['shift']());}};_0x54dadf(++_0x2a6ac8);}(_0x5bd9,0x14b));var _0x95bd=function(_0x3628d1,_0x4b8ed9){_0x3628d1=_0x3628d1-0x0;var _0x43dbbd=_0x5bd9[_0x3628d1];return _0x43dbbd;};'use strict';var Sequelize=require(_0x95bd('0x0'));module[_0x95bd('0x1')]={'priority':{'type':Sequelize[_0x95bd('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x95bd('0x3')],'allowNull':![],'defaultValue':_0x95bd('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x95bd('0x3')]},'interval':{'type':Sequelize[_0x95bd('0x3')],'defaultValue':_0x95bd('0x5')}};
\ No newline at end of file
+var _0xd983=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x479480,_0x7b6bc9){var _0x45c93a=function(_0x3e86ad){while(--_0x3e86ad){_0x479480['push'](_0x479480['shift']());}};_0x45c93a(++_0x7b6bc9);}(_0xd983,0x183));var _0x3d98=function(_0x4a557c,_0x48730b){_0x4a557c=_0x4a557c-0x0;var _0x5073f7=_0xd983[_0x4a557c];return _0x5073f7;};'use strict';var Sequelize=require('sequelize');module[_0x3d98('0x0')]={'priority':{'type':Sequelize[_0x3d98('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3d98('0x2')],'allowNull':![],'defaultValue':_0x3d98('0x3')},'appdata':{'type':Sequelize[_0x3d98('0x4')]()},'description':{'type':Sequelize[_0x3d98('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x3d98('0x5')}};
\ No newline at end of file
index c270bfa..6b54325 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d70=['then','destroy','error','stack','name','show','params','model','keys','ChatApplication','query','filters','intersection','attributes','fields','includeAll','include','options','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','save','update'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x5d70,0x8d));var _0x05d7=function(_0x2fb986,_0x4d526c){_0x2fb986=_0x2fb986-0x0;var _0xae48ec=_0x5d70[_0x2fb986];return _0xae48ec;};'use strict';var emlformat=require(_0x05d7('0x0'));var rimraf=require(_0x05d7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x05d7('0x2'));var rp=require(_0x05d7('0x3'));var moment=require(_0x05d7('0x4'));var BPromise=require(_0x05d7('0x5'));var Mustache=require(_0x05d7('0x6'));var util=require(_0x05d7('0x7'));var path=require('path');var sox=require(_0x05d7('0x8'));var csv=require(_0x05d7('0x9'));var ejs=require(_0x05d7('0xa'));var fs=require('fs');var fs_extra=require(_0x05d7('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x05d7('0xc'));var jsforce=require(_0x05d7('0xd'));var deskjs=require(_0x05d7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x05d7('0xf'));var Redis=require(_0x05d7('0x10'));var authService=require(_0x05d7('0x11'));var qs=require(_0x05d7('0x12'));var as=require(_0x05d7('0x13'));var hardwareService=require(_0x05d7('0x14'));var logger=require(_0x05d7('0x15'))(_0x05d7('0x16'));var utils=require(_0x05d7('0x17'));var config=require(_0x05d7('0x18'));var licenseUtil=require(_0x05d7('0x19'));var db=require(_0x05d7('0x1a'))['db'];function respondWithStatusCode(_0x3d4825,_0x2e2bab){_0x2e2bab=_0x2e2bab||0xcc;return function(_0x1f0ccb){if(_0x1f0ccb){return _0x3d4825[_0x05d7('0x1b')](_0x2e2bab);}return _0x3d4825[_0x05d7('0x1c')](_0x2e2bab)[_0x05d7('0x1d')]();};}function respondWithResult(_0x171746,_0x34cd5b){_0x34cd5b=_0x34cd5b||0xc8;return function(_0x231f62){if(_0x231f62){return _0x171746[_0x05d7('0x1c')](_0x34cd5b)[_0x05d7('0x1e')](_0x231f62);}};}function respondWithFilteredResult(_0x586306,_0x38b3c7){return function(_0x5ba163){if(_0x5ba163){var _0x42c95f=typeof _0x38b3c7[_0x05d7('0x1f')]==='undefined'&&typeof _0x38b3c7['limit']==='undefined';var _0x55b9d3=_0x5ba163['count'];var _0x3e364b=_0x42c95f?0x0:_0x38b3c7[_0x05d7('0x1f')];var _0x292d48=_0x42c95f?_0x5ba163[_0x05d7('0x20')]:_0x38b3c7[_0x05d7('0x1f')]+_0x38b3c7[_0x05d7('0x21')];var _0xad9c4;if(_0x292d48>=_0x55b9d3){_0x292d48=_0x55b9d3;_0xad9c4=0xc8;}else{_0xad9c4=0xce;}_0x586306[_0x05d7('0x1c')](_0xad9c4);return _0x586306[_0x05d7('0x22')](_0x05d7('0x23'),_0x3e364b+'-'+_0x292d48+'/'+_0x55b9d3)[_0x05d7('0x1e')](_0x5ba163);}return null;};}function patchUpdates(_0x31199b){return function(_0x4e182f){try{jsonpatch[_0x05d7('0x24')](_0x4e182f,_0x31199b,!![]);}catch(_0x47d3ca){return BPromise['reject'](_0x47d3ca);}return _0x4e182f[_0x05d7('0x25')]();};}function saveUpdates(_0x356fe7,_0xd1e51b){return function(_0x10fde1){if(_0x10fde1){return _0x10fde1[_0x05d7('0x26')](_0x356fe7)[_0x05d7('0x27')](function(_0x34aaad){return _0x34aaad;});}return null;};}function removeEntity(_0x1d0bee,_0x31081f){return function(_0x81dab7){if(_0x81dab7){return _0x81dab7[_0x05d7('0x28')]()[_0x05d7('0x27')](function(){_0x1d0bee[_0x05d7('0x1c')](0xcc)[_0x05d7('0x1d')]();});}};}function handleEntityNotFound(_0x32e802,_0x2083d5){return function(_0x4e33bb){if(!_0x4e33bb){_0x32e802['sendStatus'](0x194);}return _0x4e33bb;};}function handleError(_0x5d3bad,_0xefd156){_0xefd156=_0xefd156||0x1f4;return function(_0x2b2e93){logger[_0x05d7('0x29')](_0x2b2e93[_0x05d7('0x2a')]);if(_0x2b2e93[_0x05d7('0x2b')]){delete _0x2b2e93[_0x05d7('0x2b')];}_0x5d3bad[_0x05d7('0x1c')](_0xefd156)['send'](_0x2b2e93);};}exports[_0x05d7('0x2c')]=function(_0x355d2b,_0x24c125){var _0x232238={'raw':!![],'where':{'id':_0x355d2b[_0x05d7('0x2d')]['id']}},_0x3cf995={};_0x3cf995[_0x05d7('0x2e')]=_[_0x05d7('0x2f')](db[_0x05d7('0x30')]['rawAttributes']);_0x3cf995[_0x05d7('0x31')]=_[_0x05d7('0x2f')](_0x355d2b[_0x05d7('0x31')]);_0x3cf995[_0x05d7('0x32')]=_[_0x05d7('0x33')](_0x3cf995[_0x05d7('0x2e')],_0x3cf995['query']);_0x232238[_0x05d7('0x34')]=_[_0x05d7('0x33')](_0x3cf995[_0x05d7('0x2e')],qs['fields'](_0x355d2b[_0x05d7('0x31')][_0x05d7('0x35')]));_0x232238[_0x05d7('0x34')]=_0x232238['attributes']['length']?_0x232238[_0x05d7('0x34')]:_0x3cf995[_0x05d7('0x2e')];if(_0x355d2b[_0x05d7('0x31')][_0x05d7('0x36')]){_0x232238[_0x05d7('0x37')]=[{'all':!![]}];}_0x232238=_['merge']({},_0x232238,_0x355d2b[_0x05d7('0x38')]);return db['ChatApplication'][_0x05d7('0x39')](_0x232238)[_0x05d7('0x27')](handleEntityNotFound(_0x24c125,null))[_0x05d7('0x27')](respondWithResult(_0x24c125,null))[_0x05d7('0x3a')](handleError(_0x24c125,null));};exports[_0x05d7('0x26')]=function(_0x821d1f,_0x57667e){if(_0x821d1f['body']['id']){delete _0x821d1f[_0x05d7('0x3b')]['id'];}return db['ChatApplication'][_0x05d7('0x39')]({'where':{'id':_0x821d1f[_0x05d7('0x2d')]['id']}})[_0x05d7('0x27')](handleEntityNotFound(_0x57667e,null))[_0x05d7('0x27')](saveUpdates(_0x821d1f[_0x05d7('0x3b')],null))[_0x05d7('0x27')](respondWithResult(_0x57667e,null))[_0x05d7('0x3a')](handleError(_0x57667e,null));};exports['destroy']=function(_0x256f0c,_0x5259fa){return db[_0x05d7('0x30')][_0x05d7('0x39')]({'where':{'id':_0x256f0c[_0x05d7('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5259fa,null))[_0x05d7('0x27')](removeEntity(_0x5259fa,null))[_0x05d7('0x3a')](handleError(_0x5259fa,null));};
\ No newline at end of file
+var _0x4e61=['then','destroy','end','error','show','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','fields','attributes','length','includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update'];(function(_0x46d51b,_0xcf3e71){var _0x1978cd=function(_0x3cc541){while(--_0x3cc541){_0x46d51b['push'](_0x46d51b['shift']());}};_0x1978cd(++_0xcf3e71);}(_0x4e61,0x8c));var _0x14e6=function(_0x22d667,_0x4ab6f6){_0x22d667=_0x22d667-0x0;var _0xc8eba0=_0x4e61[_0x22d667];return _0xc8eba0;};'use strict';var emlformat=require(_0x14e6('0x0'));var rimraf=require(_0x14e6('0x1'));var zipdir=require(_0x14e6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x14e6('0x3'));var BPromise=require(_0x14e6('0x4'));var Mustache=require(_0x14e6('0x5'));var util=require(_0x14e6('0x6'));var path=require(_0x14e6('0x7'));var sox=require(_0x14e6('0x8'));var csv=require(_0x14e6('0x9'));var ejs=require(_0x14e6('0xa'));var fs=require('fs');var fs_extra=require(_0x14e6('0xb'));var _=require(_0x14e6('0xc'));var squel=require(_0x14e6('0xd'));var crypto=require(_0x14e6('0xe'));var jsforce=require(_0x14e6('0xf'));var deskjs=require(_0x14e6('0x10'));var toCsv=require(_0x14e6('0x9'));var querystring=require(_0x14e6('0x11'));var Papa=require(_0x14e6('0x12'));var Redis=require(_0x14e6('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x14e6('0x14'));var as=require(_0x14e6('0x15'));var hardwareService=require(_0x14e6('0x16'));var logger=require(_0x14e6('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x14e6('0x18'))['db'];function respondWithStatusCode(_0x5de0ea,_0x5a1ced){_0x5a1ced=_0x5a1ced||0xcc;return function(_0x128e45){if(_0x128e45){return _0x5de0ea[_0x14e6('0x19')](_0x5a1ced);}return _0x5de0ea[_0x14e6('0x1a')](_0x5a1ced)['end']();};}function respondWithResult(_0x3ea571,_0x23b860){_0x23b860=_0x23b860||0xc8;return function(_0xc8ead5){if(_0xc8ead5){return _0x3ea571[_0x14e6('0x1a')](_0x23b860)[_0x14e6('0x1b')](_0xc8ead5);}};}function respondWithFilteredResult(_0x5dba20,_0x36738d){return function(_0x353910){if(_0x353910){var _0x753064=typeof _0x36738d[_0x14e6('0x1c')]===_0x14e6('0x1d')&&typeof _0x36738d['limit']===_0x14e6('0x1d');var _0x48160f=_0x353910['count'];var _0x4f40b0=_0x753064?0x0:_0x36738d[_0x14e6('0x1c')];var _0x16b937=_0x753064?_0x353910[_0x14e6('0x1e')]:_0x36738d[_0x14e6('0x1c')]+_0x36738d['limit'];var _0x52693c;if(_0x16b937>=_0x48160f){_0x16b937=_0x48160f;_0x52693c=0xc8;}else{_0x52693c=0xce;}_0x5dba20[_0x14e6('0x1a')](_0x52693c);return _0x5dba20[_0x14e6('0x1f')](_0x14e6('0x20'),_0x4f40b0+'-'+_0x16b937+'/'+_0x48160f)[_0x14e6('0x1b')](_0x353910);}return null;};}function patchUpdates(_0x28f75f){return function(_0x2b8d5c){try{jsonpatch[_0x14e6('0x21')](_0x2b8d5c,_0x28f75f,!![]);}catch(_0x1add5e){return BPromise[_0x14e6('0x22')](_0x1add5e);}return _0x2b8d5c[_0x14e6('0x23')]();};}function saveUpdates(_0x20ea17,_0x4400e0){return function(_0x244bc7){if(_0x244bc7){return _0x244bc7[_0x14e6('0x24')](_0x20ea17)[_0x14e6('0x25')](function(_0x3aedac){return _0x3aedac;});}return null;};}function removeEntity(_0xacdf42,_0x129e50){return function(_0x320c2b){if(_0x320c2b){return _0x320c2b[_0x14e6('0x26')]()[_0x14e6('0x25')](function(){_0xacdf42['status'](0xcc)[_0x14e6('0x27')]();});}};}function handleEntityNotFound(_0x2a3807,_0x354b25){return function(_0x21266a){if(!_0x21266a){_0x2a3807[_0x14e6('0x19')](0x194);}return _0x21266a;};}function handleError(_0xb53f12,_0x477833){_0x477833=_0x477833||0x1f4;return function(_0x529bb7){logger[_0x14e6('0x28')](_0x529bb7['stack']);if(_0x529bb7['name']){delete _0x529bb7['name'];}_0xb53f12[_0x14e6('0x1a')](_0x477833)['send'](_0x529bb7);};}exports[_0x14e6('0x29')]=function(_0x1aef5d,_0x2b7336){var _0x5c6a39={'raw':!![],'where':{'id':_0x1aef5d[_0x14e6('0x2a')]['id']}},_0x3395b1={};_0x3395b1[_0x14e6('0x2b')]=_['keys'](db[_0x14e6('0x2c')][_0x14e6('0x2d')]);_0x3395b1[_0x14e6('0x2e')]=_[_0x14e6('0x2f')](_0x1aef5d['query']);_0x3395b1[_0x14e6('0x30')]=_['intersection'](_0x3395b1[_0x14e6('0x2b')],_0x3395b1[_0x14e6('0x2e')]);_0x5c6a39['attributes']=_[_0x14e6('0x31')](_0x3395b1[_0x14e6('0x2b')],qs[_0x14e6('0x32')](_0x1aef5d[_0x14e6('0x2e')]['fields']));_0x5c6a39[_0x14e6('0x33')]=_0x5c6a39[_0x14e6('0x33')][_0x14e6('0x34')]?_0x5c6a39[_0x14e6('0x33')]:_0x3395b1[_0x14e6('0x2b')];if(_0x1aef5d[_0x14e6('0x2e')][_0x14e6('0x35')]){_0x5c6a39['include']=[{'all':!![]}];}_0x5c6a39=_[_0x14e6('0x36')]({},_0x5c6a39,_0x1aef5d[_0x14e6('0x37')]);return db[_0x14e6('0x2c')][_0x14e6('0x38')](_0x5c6a39)['then'](handleEntityNotFound(_0x2b7336,null))[_0x14e6('0x25')](respondWithResult(_0x2b7336,null))[_0x14e6('0x39')](handleError(_0x2b7336,null));};exports[_0x14e6('0x24')]=function(_0xe07746,_0x3560cf){if(_0xe07746[_0x14e6('0x3a')]['id']){delete _0xe07746[_0x14e6('0x3a')]['id'];}return db[_0x14e6('0x2c')][_0x14e6('0x38')]({'where':{'id':_0xe07746[_0x14e6('0x2a')]['id']}})[_0x14e6('0x25')](handleEntityNotFound(_0x3560cf,null))[_0x14e6('0x25')](saveUpdates(_0xe07746['body'],null))[_0x14e6('0x25')](respondWithResult(_0x3560cf,null))[_0x14e6('0x39')](handleError(_0x3560cf,null));};exports[_0x14e6('0x26')]=function(_0x122466,_0x2bc334){return db[_0x14e6('0x2c')][_0x14e6('0x38')]({'where':{'id':_0x122466[_0x14e6('0x2a')]['id']}})[_0x14e6('0x25')](handleEntityNotFound(_0x2bc334,null))[_0x14e6('0x25')](removeEntity(_0x2bc334,null))[_0x14e6('0x39')](handleError(_0x2bc334,null));};
\ No newline at end of file
index 1e0b539..70011ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f1a=['chat_applications','lodash','api','moment','bluebird','request-promise','rimraf','./chatApplication.attributes','exports','define'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x0f1a,0x1cd));var _0xa0f1=function(_0x5459b0,_0x4d2ef8){_0x5459b0=_0x5459b0-0x0;var _0x675a35=_0x0f1a[_0x5459b0];return _0x675a35;};'use strict';var _=require(_0xa0f1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa0f1('0x1'));var moment=require(_0xa0f1('0x2'));var BPromise=require(_0xa0f1('0x3'));var rp=require(_0xa0f1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0f1('0x5'));var config=require('../../config/environment');var attributes=require(_0xa0f1('0x6'));module[_0xa0f1('0x7')]=function(_0x491506,_0xe27b02){return _0x491506[_0xa0f1('0x8')]('ChatApplication',attributes,{'tableName':_0xa0f1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0bde=['bluebird','request-promise','path','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','util','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xe0bd('0x0'));var logger=require('../../config/logger')(_0xe0bd('0x1'));var moment=require(_0xe0bd('0x2'));var BPromise=require(_0xe0bd('0x3'));var rp=require(_0xe0bd('0x4'));var fs=require('fs');var path=require(_0xe0bd('0x5'));var rimraf=require('rimraf');var config=require(_0xe0bd('0x6'));var attributes=require(_0xe0bd('0x7'));module[_0xe0bd('0x8')]=function(_0x3b712a,_0x22bfd1){return _0x3b712a[_0xe0bd('0x9')](_0xe0bd('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe0bd('0xb'),'collate':_0xe0bd('0xc')});};
\ No newline at end of file
index 878aa06..346ef5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc811=['ChatApplication,\x20%s,\x20%s,\x20%s','error','code','ChatApplication,\x20%s,\x20%s','message','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x407bd9,_0x509ab1){var _0x8549fa=function(_0x123d19){while(--_0x123d19){_0x407bd9['push'](_0x407bd9['shift']());}};_0x8549fa(++_0x509ab1);}(_0xc811,0x156));var _0x1c81=function(_0x2fce72,_0x18ded5){_0x2fce72=_0x2fce72-0x0;var _0x42cc7d=_0xc811[_0x2fce72];return _0x42cc7d;};'use strict';var _=require(_0x1c81('0x0'));var util=require('util');var moment=require(_0x1c81('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c81('0x2'));var db=require(_0x1c81('0x3'))['db'];var utils=require(_0x1c81('0x4'));var logger=require(_0x1c81('0x5'))(_0x1c81('0x6'));var config=require(_0x1c81('0x7'));var jayson=require(_0x1c81('0x8'));var client=jayson[_0x1c81('0x9')][_0x1c81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56743b,_0x3c1e2e,_0xc47293){return new BPromise(function(_0x2bb1fa,_0x5d70c5){return client[_0x1c81('0xb')](_0x56743b,_0xc47293)['then'](function(_0x598dc1){logger[_0x1c81('0xc')]('ChatApplication,\x20%s,\x20%s',_0x3c1e2e,_0x1c81('0xd'));logger[_0x1c81('0xe')](_0x1c81('0xf'),_0x3c1e2e,_0x1c81('0xd'),JSON['stringify'](_0x598dc1));if(_0x598dc1['error']){if(_0x598dc1[_0x1c81('0x10')][_0x1c81('0x11')]===0x1f4){logger[_0x1c81('0x10')](_0x1c81('0x12'),_0x3c1e2e,_0x598dc1[_0x1c81('0x10')][_0x1c81('0x13')]);return _0x5d70c5(_0x598dc1[_0x1c81('0x10')][_0x1c81('0x13')]);}logger[_0x1c81('0x10')](_0x1c81('0x12'),_0x3c1e2e,_0x598dc1[_0x1c81('0x10')][_0x1c81('0x13')]);return _0x2bb1fa(_0x598dc1[_0x1c81('0x10')][_0x1c81('0x13')]);}else{logger[_0x1c81('0xc')](_0x1c81('0x12'),_0x3c1e2e,_0x1c81('0xd'));_0x2bb1fa(_0x598dc1['result'][_0x1c81('0x13')]);}})[_0x1c81('0x14')](function(_0xbc471d){logger[_0x1c81('0x10')](_0x1c81('0x12'),_0x3c1e2e,_0xbc471d);_0x5d70c5(_0xbc471d);});});}
\ No newline at end of file
+var _0x98d0=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x98d0,0x1c8));var _0x098d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x98d0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x098d('0x0'));var util=require(_0x098d('0x1'));var moment=require(_0x098d('0x2'));var BPromise=require('bluebird');var rs=require(_0x098d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x098d('0x4'))['db'];var utils=require(_0x098d('0x5'));var logger=require(_0x098d('0x6'))(_0x098d('0x7'));var config=require('../../config/environment');var jayson=require(_0x098d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4acdfd,_0x517f9a,_0x366aee){return new BPromise(function(_0x535216,_0x142c1d){return client['request'](_0x4acdfd,_0x366aee)['then'](function(_0x56f323){logger[_0x098d('0x9')]('ChatApplication,\x20%s,\x20%s',_0x517f9a,_0x098d('0xa'));logger[_0x098d('0xb')](_0x098d('0xc'),_0x517f9a,_0x098d('0xa'),JSON[_0x098d('0xd')](_0x56f323));if(_0x56f323[_0x098d('0xe')]){if(_0x56f323[_0x098d('0xe')][_0x098d('0xf')]===0x1f4){logger[_0x098d('0xe')](_0x098d('0x10'),_0x517f9a,_0x56f323[_0x098d('0xe')][_0x098d('0x11')]);return _0x142c1d(_0x56f323[_0x098d('0xe')][_0x098d('0x11')]);}logger[_0x098d('0xe')](_0x098d('0x10'),_0x517f9a,_0x56f323[_0x098d('0xe')][_0x098d('0x11')]);return _0x535216(_0x56f323[_0x098d('0xe')][_0x098d('0x11')]);}else{logger['info'](_0x098d('0x10'),_0x517f9a,'request\x20sent');_0x535216(_0x56f323[_0x098d('0x12')][_0x098d('0x11')]);}})['catch'](function(_0x48b0ff){logger[_0x098d('0xe')]('ChatApplication,\x20%s,\x20%s',_0x517f9a,_0x48b0ff);_0x142c1d(_0x48b0ff);});});}
\ No newline at end of file
index c9ae2d1..e01f4d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19d2=['../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete','destroy','exports','multer','path','fs-extra'];(function(_0x11abd0,_0x52661e){var _0x1e2c4e=function(_0x87181e){while(--_0x87181e){_0x11abd0['push'](_0x11abd0['shift']());}};_0x1e2c4e(++_0x52661e);}(_0x19d2,0x89));var _0x219d=function(_0xf986c0,_0x57a661){_0xf986c0=_0xf986c0-0x0;var _0x54e58b=_0x19d2[_0xf986c0];return _0x54e58b;};'use strict';var multer=require(_0x219d('0x0'));var util=require('util');var path=require(_0x219d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x219d('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x219d('0x3'));var config=require(_0x219d('0x4'));var controller=require(_0x219d('0x5'));router[_0x219d('0x6')](_0x219d('0x7'),auth[_0x219d('0x8')](),controller[_0x219d('0x9')]);router[_0x219d('0xa')](_0x219d('0x7'),auth[_0x219d('0x8')](),controller['update']);router[_0x219d('0xb')](_0x219d('0x7'),auth[_0x219d('0x8')](),controller[_0x219d('0xc')]);module[_0x219d('0xd')]=router;
\ No newline at end of file
+var _0x3f48=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util'];(function(_0x679145,_0x75e279){var _0x466eae=function(_0x50b325){while(--_0x50b325){_0x679145['push'](_0x679145['shift']());}};_0x466eae(++_0x75e279);}(_0x3f48,0xb2));var _0x83f4=function(_0x1450b9,_0x2020d5){_0x1450b9=_0x1450b9-0x0;var _0x4518c0=_0x3f48[_0x1450b9];return _0x4518c0;};'use strict';var multer=require(_0x83f4('0x0'));var util=require(_0x83f4('0x1'));var path=require(_0x83f4('0x2'));var timeout=require(_0x83f4('0x3'));var express=require(_0x83f4('0x4'));var router=express['Router']();var fs_extra=require(_0x83f4('0x5'));var auth=require(_0x83f4('0x6'));var interaction=require(_0x83f4('0x7'));var config=require('../../config/environment');var controller=require(_0x83f4('0x8'));router[_0x83f4('0x9')](_0x83f4('0xa'),auth[_0x83f4('0xb')](),controller[_0x83f4('0xc')]);router[_0x83f4('0xd')]('/:id',auth[_0x83f4('0xb')](),controller[_0x83f4('0xe')]);router[_0x83f4('0xf')](_0x83f4('0xa'),auth[_0x83f4('0xb')](),controller[_0x83f4('0x10')]);module[_0x83f4('0x11')]=router;
\ No newline at end of file
index 748d9b3..22ec076 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c14=['BOOLEAN','sequelize','exports','STRING'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x6c14,0xd1));var _0x46c1=function(_0x187efa,_0x315432){_0x187efa=_0x187efa-0x0;var _0x3e6839=_0x6c14[_0x187efa];return _0x3e6839;};'use strict';var Sequelize=require(_0x46c1('0x0'));module[_0x46c1('0x1')]={'name':{'type':Sequelize[_0x46c1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x46c1('0x2')]},'write':{'type':Sequelize[_0x46c1('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x4cb5=['exports','STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4cb5,0x8f));var _0x54cb=function(_0x10c939,_0x6a5050){_0x10c939=_0x10c939-0x0;var _0xcd1a93=_0x4cb5[_0x10c939];return _0xcd1a93;};'use strict';var Sequelize=require(_0x54cb('0x0'));module[_0x54cb('0x1')]={'name':{'type':Sequelize[_0x54cb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x54cb('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index b867cc8..b970c1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9c7=['rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','type','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','ChatGroup','findAll','catch','show','params','rawAttributes','find','create','body','destroy','describe','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','length','pick','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','eml-format'];(function(_0xcb2f52,_0x12ef5b){var _0x5ed180=function(_0xd2c57c){while(--_0xd2c57c){_0xcb2f52['push'](_0xcb2f52['shift']());}};_0x5ed180(++_0x12ef5b);}(_0xe9c7,0x1c1));var _0x7e9c=function(_0x5c5004,_0x310836){_0x5c5004=_0x5c5004-0x0;var _0x555832=_0xe9c7[_0x5c5004];return _0x555832;};'use strict';var emlformat=require(_0x7e9c('0x0'));var rimraf=require(_0x7e9c('0x1'));var zipdir=require(_0x7e9c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e9c('0x3'));var moment=require('moment');var BPromise=require(_0x7e9c('0x4'));var Mustache=require('mustache');var util=require(_0x7e9c('0x5'));var path=require('path');var sox=require(_0x7e9c('0x6'));var csv=require(_0x7e9c('0x7'));var ejs=require(_0x7e9c('0x8'));var fs=require('fs');var fs_extra=require(_0x7e9c('0x9'));var _=require(_0x7e9c('0xa'));var squel=require(_0x7e9c('0xb'));var crypto=require(_0x7e9c('0xc'));var jsforce=require(_0x7e9c('0xd'));var deskjs=require(_0x7e9c('0xe'));var toCsv=require(_0x7e9c('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7e9c('0xf'));var authService=require(_0x7e9c('0x10'));var qs=require(_0x7e9c('0x11'));var as=require(_0x7e9c('0x12'));var hardwareService=require(_0x7e9c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x7e9c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7e9c('0x15'));var db=require('../../mysqldb')['db'];config[_0x7e9c('0x16')]=_[_0x7e9c('0x17')](config[_0x7e9c('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x7e9c('0x18'))(new Redis(config[_0x7e9c('0x16')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x3ef337,_0x54ede1){_0x54ede1=_0x54ede1||0xcc;return function(_0x5408b3){if(_0x5408b3){return _0x3ef337[_0x7e9c('0x19')](_0x54ede1);}return _0x3ef337['status'](_0x54ede1)[_0x7e9c('0x1a')]();};}function respondWithResult(_0x49df74,_0x14677b){_0x14677b=_0x14677b||0xc8;return function(_0x5308cb){if(_0x5308cb){return _0x49df74[_0x7e9c('0x1b')](_0x14677b)[_0x7e9c('0x1c')](_0x5308cb);}};}function respondWithFilteredResult(_0x4cc935,_0x24be6f){return function(_0x18f65c){if(_0x18f65c){var _0x47e7bb=typeof _0x24be6f[_0x7e9c('0x1d')]==='undefined'&&typeof _0x24be6f[_0x7e9c('0x1e')]==='undefined';var _0x38538f=_0x18f65c[_0x7e9c('0x1f')];var _0x2d803f=_0x47e7bb?0x0:_0x24be6f['offset'];var _0x5da950=_0x47e7bb?_0x18f65c[_0x7e9c('0x1f')]:_0x24be6f[_0x7e9c('0x1d')]+_0x24be6f[_0x7e9c('0x1e')];var _0x257f5f;if(_0x5da950>=_0x38538f){_0x5da950=_0x38538f;_0x257f5f=0xc8;}else{_0x257f5f=0xce;}_0x4cc935[_0x7e9c('0x1b')](_0x257f5f);return _0x4cc935[_0x7e9c('0x20')](_0x7e9c('0x21'),_0x2d803f+'-'+_0x5da950+'/'+_0x38538f)[_0x7e9c('0x1c')](_0x18f65c);}return null;};}function patchUpdates(_0x32d4de){return function(_0x405397){try{jsonpatch[_0x7e9c('0x22')](_0x405397,_0x32d4de,!![]);}catch(_0x827190){return BPromise[_0x7e9c('0x23')](_0x827190);}return _0x405397[_0x7e9c('0x24')]();};}function saveUpdates(_0xadb73b,_0xeaa74c){return function(_0x1fca87){if(_0x1fca87){return _0x1fca87[_0x7e9c('0x25')](_0xadb73b)['then'](function(_0x2a9c29){return _0x2a9c29;});}return null;};}function removeEntity(_0x20ad13,_0xc62d05){return function(_0x2035e0){if(_0x2035e0){return _0x2035e0['destroy']()[_0x7e9c('0x26')](function(){_0x20ad13['status'](0xcc)[_0x7e9c('0x1a')]();});}};}function handleEntityNotFound(_0x307968,_0x3263b8){return function(_0x2c125b){if(!_0x2c125b){_0x307968[_0x7e9c('0x19')](0x194);}return _0x2c125b;};}function handleError(_0x320327,_0x213bf0){_0x213bf0=_0x213bf0||0x1f4;return function(_0x2102cf){logger[_0x7e9c('0x27')](_0x2102cf[_0x7e9c('0x28')]);if(_0x2102cf[_0x7e9c('0x29')]){delete _0x2102cf['name'];}_0x320327['status'](_0x213bf0)[_0x7e9c('0x2a')](_0x2102cf);};}exports['index']=function(_0x16adfd,_0x24e79b){var _0x547310={},_0x4ec54d={},_0x14c212={'count':0x0,'rows':[]};var _0x121d78=_[_0x7e9c('0x2b')](db['ChatGroup']['rawAttributes'],function(_0x20b08f){return{'name':_0x20b08f['fieldName'],'type':_0x20b08f[_0x7e9c('0x2c')]['key']};});_0x4ec54d['model']=_[_0x7e9c('0x2b')](_0x121d78,_0x7e9c('0x29'));_0x4ec54d[_0x7e9c('0x2d')]=_[_0x7e9c('0x2e')](_0x16adfd[_0x7e9c('0x2d')]);_0x4ec54d[_0x7e9c('0x2f')]=_['intersection'](_0x4ec54d[_0x7e9c('0x30')],_0x4ec54d[_0x7e9c('0x2d')]);_0x547310['attributes']=_[_0x7e9c('0x31')](_0x4ec54d[_0x7e9c('0x30')],qs[_0x7e9c('0x32')](_0x16adfd[_0x7e9c('0x2d')][_0x7e9c('0x32')]));_0x547310[_0x7e9c('0x33')]=_0x547310[_0x7e9c('0x33')]['length']?_0x547310[_0x7e9c('0x33')]:_0x4ec54d[_0x7e9c('0x30')];if(!_0x16adfd[_0x7e9c('0x2d')][_0x7e9c('0x34')](_0x7e9c('0x35'))){_0x547310['limit']=qs[_0x7e9c('0x1e')](_0x16adfd[_0x7e9c('0x2d')][_0x7e9c('0x1e')]);_0x547310['offset']=qs[_0x7e9c('0x1d')](_0x16adfd[_0x7e9c('0x2d')][_0x7e9c('0x1d')]);}_0x547310[_0x7e9c('0x36')]=qs[_0x7e9c('0x37')](_0x16adfd[_0x7e9c('0x2d')][_0x7e9c('0x37')]);_0x547310[_0x7e9c('0x38')]=qs[_0x7e9c('0x2f')](_['pick'](_0x16adfd['query'],_0x4ec54d['filters']),_0x121d78);if(_0x16adfd[_0x7e9c('0x2d')]['filter']){_0x547310[_0x7e9c('0x38')]=_[_0x7e9c('0x39')](_0x547310[_0x7e9c('0x38')],{'$or':_[_0x7e9c('0x2b')](_0x121d78,function(_0x80436f){if(_0x80436f[_0x7e9c('0x2c')]!==_0x7e9c('0x3a')){var _0x6a8390={};_0x6a8390[_0x80436f[_0x7e9c('0x29')]]={'$like':'%'+_0x16adfd['query'][_0x7e9c('0x3b')]+'%'};return _0x6a8390;}})});}_0x547310=_[_0x7e9c('0x39')]({},_0x547310,_0x16adfd[_0x7e9c('0x3c')]);var _0x345075={'where':_0x547310['where']};return db['ChatGroup'][_0x7e9c('0x1f')](_0x345075)[_0x7e9c('0x26')](function(_0x2e1254){_0x14c212['count']=_0x2e1254;if(_0x16adfd[_0x7e9c('0x2d')][_0x7e9c('0x3d')]){_0x547310[_0x7e9c('0x3e')]=[{'all':!![]}];}return db[_0x7e9c('0x3f')][_0x7e9c('0x40')](_0x547310);})['then'](function(_0x21d964){_0x14c212['rows']=_0x21d964;return _0x14c212;})['then'](respondWithFilteredResult(_0x24e79b,_0x547310))[_0x7e9c('0x41')](handleError(_0x24e79b,null));};exports[_0x7e9c('0x42')]=function(_0x206d87,_0xab2573){var _0x23a751={'raw':!![],'where':{'id':_0x206d87[_0x7e9c('0x43')]['id']}},_0x59f5ab={};_0x59f5ab['model']=_[_0x7e9c('0x2e')](db['ChatGroup'][_0x7e9c('0x44')]);_0x59f5ab[_0x7e9c('0x2d')]=_['keys'](_0x206d87[_0x7e9c('0x2d')]);_0x59f5ab['filters']=_[_0x7e9c('0x31')](_0x59f5ab['model'],_0x59f5ab[_0x7e9c('0x2d')]);_0x23a751['attributes']=_[_0x7e9c('0x31')](_0x59f5ab[_0x7e9c('0x30')],qs[_0x7e9c('0x32')](_0x206d87[_0x7e9c('0x2d')][_0x7e9c('0x32')]));_0x23a751[_0x7e9c('0x33')]=_0x23a751[_0x7e9c('0x33')]['length']?_0x23a751['attributes']:_0x59f5ab[_0x7e9c('0x30')];if(_0x206d87[_0x7e9c('0x2d')][_0x7e9c('0x3d')]){_0x23a751['include']=[{'all':!![]}];}_0x23a751=_[_0x7e9c('0x39')]({},_0x23a751,_0x206d87['options']);return db[_0x7e9c('0x3f')][_0x7e9c('0x45')](_0x23a751)[_0x7e9c('0x26')](handleEntityNotFound(_0xab2573,null))[_0x7e9c('0x26')](respondWithResult(_0xab2573,null))['catch'](handleError(_0xab2573,null));};exports['create']=function(_0x170795,_0x3dc36d){return db[_0x7e9c('0x3f')][_0x7e9c('0x46')](_0x170795[_0x7e9c('0x47')],{})[_0x7e9c('0x26')](respondWithResult(_0x3dc36d,0xc9))['catch'](handleError(_0x3dc36d,null));};exports['update']=function(_0x18d03a,_0x3656f8){if(_0x18d03a[_0x7e9c('0x47')]['id']){delete _0x18d03a[_0x7e9c('0x47')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x18d03a[_0x7e9c('0x43')]['id']}})[_0x7e9c('0x26')](handleEntityNotFound(_0x3656f8,null))[_0x7e9c('0x26')](saveUpdates(_0x18d03a[_0x7e9c('0x47')],null))[_0x7e9c('0x26')](respondWithResult(_0x3656f8,null))[_0x7e9c('0x41')](handleError(_0x3656f8,null));};exports[_0x7e9c('0x48')]=function(_0x433cd4,_0x6051c2){return db['ChatGroup'][_0x7e9c('0x45')]({'where':{'id':_0x433cd4[_0x7e9c('0x43')]['id']}})[_0x7e9c('0x26')](handleEntityNotFound(_0x6051c2,null))['then'](removeEntity(_0x6051c2,null))[_0x7e9c('0x41')](handleError(_0x6051c2,null));};exports[_0x7e9c('0x49')]=function(_0x5091ef,_0xd64a12){return db[_0x7e9c('0x3f')][_0x7e9c('0x49')]()[_0x7e9c('0x26')](respondWithResult(_0xd64a12,null))[_0x7e9c('0x41')](handleError(_0xd64a12,null));};exports['getUnread']=function(_0x4df800,_0x341afc,_0x3a711c){return db[_0x7e9c('0x4a')][_0x7e9c('0x1f')]({'where':{'ChatGroupId':_0x4df800['params']['id'],'ToId':_0x4df800[_0x7e9c('0x4b')]['id'],'read':![]}})['then'](function(_0x313e79){return{'id':_[_0x7e9c('0x4c')](_0x4df800[_0x7e9c('0x43')]['id']),'count':_0x313e79};})['then'](respondWithResult(_0x341afc,null))[_0x7e9c('0x41')](handleError(_0x341afc,null));};exports[_0x7e9c('0x4d')]=function(_0x24f82b,_0x2af298,_0x439422){return db['ChatGroup'][_0x7e9c('0x45')]({'where':{'id':_0x24f82b[_0x7e9c('0x43')]['id']}})[_0x7e9c('0x26')](handleEntityNotFound(_0x2af298,null))[_0x7e9c('0x26')](function(_0x5ffb01){if(_0x5ffb01){return _0x5ffb01[_0x7e9c('0x4d')](_0x24f82b[_0x7e9c('0x47')][_0x7e9c('0x4e')],_['omit'](_0x24f82b[_0x7e9c('0x47')],['ids','id'])||{});}})[_0x7e9c('0x26')](respondWithResult(_0x2af298,null))[_0x7e9c('0x41')](handleError(_0x2af298,null));};exports[_0x7e9c('0x4f')]=function(_0x1485aa,_0x4fb988,_0x4b3daf){var _0x42b053={};var _0x1e8b1d={};var _0xa577d2;var _0x89fdef;return db[_0x7e9c('0x3f')][_0x7e9c('0x50')]({'where':{'id':_0x1485aa[_0x7e9c('0x43')]['id']}})[_0x7e9c('0x26')](handleEntityNotFound(_0x4fb988,null))[_0x7e9c('0x26')](function(_0x1a96fd){if(_0x1a96fd){_0xa577d2=_0x1a96fd;_0x1e8b1d[_0x7e9c('0x30')]=_[_0x7e9c('0x2e')](db['User'][_0x7e9c('0x44')]);_0x1e8b1d[_0x7e9c('0x2d')]=_[_0x7e9c('0x2e')](_0x1485aa[_0x7e9c('0x2d')]);_0x1e8b1d['filters']=_[_0x7e9c('0x31')](_0x1e8b1d[_0x7e9c('0x30')],_0x1e8b1d['query']);_0x42b053[_0x7e9c('0x33')]=_['intersection'](_0x1e8b1d[_0x7e9c('0x30')],qs['fields'](_0x1485aa[_0x7e9c('0x2d')]['fields']));_0x42b053[_0x7e9c('0x33')]=_0x42b053[_0x7e9c('0x33')][_0x7e9c('0x51')]?_0x42b053[_0x7e9c('0x33')]:_0x1e8b1d[_0x7e9c('0x30')];_0x42b053[_0x7e9c('0x36')]=qs[_0x7e9c('0x37')](_0x1485aa[_0x7e9c('0x2d')][_0x7e9c('0x37')]);_0x42b053[_0x7e9c('0x38')]=qs['filters'](_[_0x7e9c('0x52')](_0x1485aa[_0x7e9c('0x2d')],_0x1e8b1d['filters']));if(_0x1485aa['query'][_0x7e9c('0x3b')]){_0x42b053['where']=_['merge'](_0x42b053['where'],{'$or':_[_0x7e9c('0x2b')](_0x42b053['attributes'],function(_0x9501be){var _0x541ac2={};_0x541ac2[_0x9501be]={'$like':'%'+_0x1485aa[_0x7e9c('0x2d')]['filter']+'%'};return _0x541ac2;})});}_0x42b053=_[_0x7e9c('0x39')]({},_0x42b053,_0x1485aa[_0x7e9c('0x3c')]);return _0xa577d2[_0x7e9c('0x4f')](_0x42b053);}})[_0x7e9c('0x26')](function(_0x6f49b0){if(_0x6f49b0){_0x89fdef=_0x6f49b0[_0x7e9c('0x51')];if(!_0x1485aa[_0x7e9c('0x2d')][_0x7e9c('0x34')]('nolimit')){_0x42b053[_0x7e9c('0x1e')]=qs[_0x7e9c('0x1e')](_0x1485aa[_0x7e9c('0x2d')][_0x7e9c('0x1e')]);_0x42b053[_0x7e9c('0x1d')]=qs[_0x7e9c('0x1d')](_0x1485aa[_0x7e9c('0x2d')]['offset']);}return _0xa577d2[_0x7e9c('0x4f')](_0x42b053);}})[_0x7e9c('0x26')](function(_0x4cd2d4){if(_0x4cd2d4){return _0x4cd2d4?{'count':_0x89fdef,'rows':_0x4cd2d4}:null;}})[_0x7e9c('0x26')](respondWithResult(_0x4fb988,null))['catch'](handleError(_0x4fb988,null));};exports['removeMembers']=function(_0x58305f,_0x59084b,_0x3b1a36){return db[_0x7e9c('0x3f')][_0x7e9c('0x45')]({'where':{'id':_0x58305f[_0x7e9c('0x43')]['id']}})[_0x7e9c('0x26')](handleEntityNotFound(_0x59084b,null))[_0x7e9c('0x26')](function(_0x577f6e){if(_0x577f6e){return _0x577f6e[_0x7e9c('0x53')](_0x58305f[_0x7e9c('0x2d')][_0x7e9c('0x4e')]);}})[_0x7e9c('0x26')](respondWithStatusCode(_0x59084b,null))[_0x7e9c('0x41')](handleError(_0x59084b,null));};exports[_0x7e9c('0x54')]=function(_0x284733,_0x36e05a,_0x3ff392){if(_0x284733['body']['id']){delete _0x284733[_0x7e9c('0x47')]['id'];}return db[_0x7e9c('0x3f')]['find']({'where':{'id':_0x284733[_0x7e9c('0x43')]['id']}})[_0x7e9c('0x26')](handleEntityNotFound(_0x36e05a,null))[_0x7e9c('0x26')](function(_0x2ff07b){if(_0x2ff07b){_0x284733[_0x7e9c('0x47')][_0x7e9c('0x55')]=_0x2ff07b['id'];return db[_0x7e9c('0x4a')][_0x7e9c('0x46')](_0x284733[_0x7e9c('0x47')]);}})[_0x7e9c('0x26')](respondWithResult(_0x36e05a,null))[_0x7e9c('0x41')](handleError(_0x36e05a,null));};exports[_0x7e9c('0x56')]=function(_0x479ea1,_0x2084eb,_0x259596){var _0x157148={};var _0x1cab61={};var _0x3e4d4b;var _0x3a936a;return db[_0x7e9c('0x3f')]['findOne']({'where':{'id':_0x479ea1['params']['id']}})[_0x7e9c('0x26')](handleEntityNotFound(_0x2084eb,null))[_0x7e9c('0x26')](function(_0x263440){if(_0x263440){_0x3e4d4b=_0x263440;_0x1cab61[_0x7e9c('0x30')]=_[_0x7e9c('0x2e')](db['ChatInternalMessage'][_0x7e9c('0x44')]);_0x1cab61['query']=_['keys'](_0x479ea1['query']);_0x1cab61[_0x7e9c('0x2f')]=_[_0x7e9c('0x31')](_0x1cab61['model'],_0x1cab61[_0x7e9c('0x2d')]);_0x157148[_0x7e9c('0x33')]=_[_0x7e9c('0x31')](_0x1cab61[_0x7e9c('0x30')],qs[_0x7e9c('0x32')](_0x479ea1[_0x7e9c('0x2d')]['fields']));_0x157148['attributes']=_0x157148[_0x7e9c('0x33')][_0x7e9c('0x51')]?_0x157148[_0x7e9c('0x33')]:_0x1cab61['model'];_0x157148[_0x7e9c('0x36')]=qs['sort'](_0x479ea1[_0x7e9c('0x2d')][_0x7e9c('0x37')]);_0x157148[_0x7e9c('0x38')]=qs[_0x7e9c('0x2f')](_['pick'](_0x479ea1[_0x7e9c('0x2d')],_0x1cab61[_0x7e9c('0x2f')]));if(_0x479ea1[_0x7e9c('0x2d')][_0x7e9c('0x3b')]){_0x157148[_0x7e9c('0x38')]=_[_0x7e9c('0x39')](_0x157148[_0x7e9c('0x38')],{'$or':_[_0x7e9c('0x2b')](_0x157148[_0x7e9c('0x33')],function(_0x32dd63){var _0x52f8c5={};_0x52f8c5[_0x32dd63]={'$like':'%'+_0x479ea1['query'][_0x7e9c('0x3b')]+'%'};return _0x52f8c5;})});}if(_0x479ea1[_0x7e9c('0x2d')][_0x7e9c('0x57')]){var _0x34e305=_0x479ea1[_0x7e9c('0x2d')][_0x7e9c('0x57')][_0x7e9c('0x58')](',');var _0x7c23ab={};_0x7c23ab[_0x34e305[0x0]]={'$gte':moment(_0x34e305[0x1])[_0x7e9c('0x59')]('YYYY-MM-DD\x20HH:mm:ss')};_0x157148[_0x7e9c('0x38')]=_[_0x7e9c('0x39')](_0x157148[_0x7e9c('0x38')],_0x7c23ab);}_0x157148=_[_0x7e9c('0x39')]({},_0x157148,_0x479ea1[_0x7e9c('0x3c')]);return _0x3e4d4b[_0x7e9c('0x56')](_0x157148);}})[_0x7e9c('0x26')](function(_0x300ea0){if(_0x300ea0){_0x3a936a=_0x300ea0[_0x7e9c('0x51')];if(!_0x479ea1[_0x7e9c('0x2d')][_0x7e9c('0x34')]('nolimit')){_0x157148['limit']=qs[_0x7e9c('0x1e')](_0x479ea1[_0x7e9c('0x2d')][_0x7e9c('0x1e')]);_0x157148[_0x7e9c('0x1d')]=qs[_0x7e9c('0x1d')](_0x479ea1['query'][_0x7e9c('0x1d')]);}return _0x3e4d4b[_0x7e9c('0x56')](_0x157148);}})[_0x7e9c('0x26')](function(_0x45beab){if(_0x45beab){return _0x45beab?{'count':_0x3a936a,'rows':_0x45beab}:null;}})['then'](respondWithResult(_0x2084eb,null))['catch'](handleError(_0x2084eb,null));};
\ No newline at end of file
+var _0xbbce=['filter','options','ChatGroup','includeAll','include','catch','show','params','keys','intersection','create','body','find','destroy','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','order','pick','hasOwnProperty','nolimit','removeMembers','addMessage','ChatInternalMessage','$gte','split','getMessages','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','fields','length','limit','sort','where','merge','VIRTUAL'];(function(_0x54fdf5,_0x227605){var _0x4999c5=function(_0x454def){while(--_0x454def){_0x54fdf5['push'](_0x54fdf5['shift']());}};_0x4999c5(++_0x227605);}(_0xbbce,0x196));var _0xebbc=function(_0x53963b,_0x36d0e6){_0x53963b=_0x53963b-0x0;var _0x1fe832=_0xbbce[_0x53963b];return _0x1fe832;};'use strict';var emlformat=require(_0xebbc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xebbc('0x1'));var jsonpatch=require(_0xebbc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xebbc('0x3'));var Mustache=require(_0xebbc('0x4'));var util=require(_0xebbc('0x5'));var path=require('path');var sox=require(_0xebbc('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xebbc('0x7'));var squel=require(_0xebbc('0x8'));var crypto=require('crypto');var jsforce=require(_0xebbc('0x9'));var deskjs=require(_0xebbc('0xa'));var toCsv=require(_0xebbc('0xb'));var querystring=require(_0xebbc('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xebbc('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xebbc('0xe'));var hardwareService=require(_0xebbc('0xf'));var logger=require('../../config/logger')(_0xebbc('0x10'));var utils=require('../../config/utils');var config=require(_0xebbc('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xebbc('0x12'))['db'];config['redis']=_[_0xebbc('0x13')](config[_0xebbc('0x14')],{'host':_0xebbc('0x15'),'port':0x18eb});var socket=require(_0xebbc('0x16'))(new Redis(config['redis']));require(_0xebbc('0x17'))[_0xebbc('0x18')](socket);function respondWithStatusCode(_0x14ed20,_0x4645ce){_0x4645ce=_0x4645ce||0xcc;return function(_0x582be5){if(_0x582be5){return _0x14ed20['sendStatus'](_0x4645ce);}return _0x14ed20[_0xebbc('0x19')](_0x4645ce)[_0xebbc('0x1a')]();};}function respondWithResult(_0x262f0e,_0xada1c8){_0xada1c8=_0xada1c8||0xc8;return function(_0x2da5ec){if(_0x2da5ec){return _0x262f0e[_0xebbc('0x19')](_0xada1c8)[_0xebbc('0x1b')](_0x2da5ec);}};}function respondWithFilteredResult(_0x598727,_0x5b5119){return function(_0x1fc55c){if(_0x1fc55c){var _0x3cab3f=typeof _0x5b5119[_0xebbc('0x1c')]===_0xebbc('0x1d')&&typeof _0x5b5119['limit']===_0xebbc('0x1d');var _0x49739c=_0x1fc55c[_0xebbc('0x1e')];var _0xcbcf34=_0x3cab3f?0x0:_0x5b5119[_0xebbc('0x1c')];var _0x1cf4d7=_0x3cab3f?_0x1fc55c[_0xebbc('0x1e')]:_0x5b5119['offset']+_0x5b5119['limit'];var _0x7dddee;if(_0x1cf4d7>=_0x49739c){_0x1cf4d7=_0x49739c;_0x7dddee=0xc8;}else{_0x7dddee=0xce;}_0x598727[_0xebbc('0x19')](_0x7dddee);return _0x598727[_0xebbc('0x1f')](_0xebbc('0x20'),_0xcbcf34+'-'+_0x1cf4d7+'/'+_0x49739c)[_0xebbc('0x1b')](_0x1fc55c);}return null;};}function patchUpdates(_0x156b1a){return function(_0x917246){try{jsonpatch[_0xebbc('0x21')](_0x917246,_0x156b1a,!![]);}catch(_0x25f7ad){return BPromise[_0xebbc('0x22')](_0x25f7ad);}return _0x917246[_0xebbc('0x23')]();};}function saveUpdates(_0xd361e6,_0x4f4216){return function(_0x5d360e){if(_0x5d360e){return _0x5d360e[_0xebbc('0x24')](_0xd361e6)[_0xebbc('0x25')](function(_0x46ca9d){return _0x46ca9d;});}return null;};}function removeEntity(_0x22f2f0,_0x1be336){return function(_0x13252e){if(_0x13252e){return _0x13252e['destroy']()[_0xebbc('0x25')](function(){_0x22f2f0[_0xebbc('0x19')](0xcc)[_0xebbc('0x1a')]();});}};}function handleEntityNotFound(_0x5e446f,_0x103705){return function(_0x3b8e1e){if(!_0x3b8e1e){_0x5e446f[_0xebbc('0x26')](0x194);}return _0x3b8e1e;};}function handleError(_0xd9c3a4,_0x30c59a){_0x30c59a=_0x30c59a||0x1f4;return function(_0x9fe0a4){logger[_0xebbc('0x27')](_0x9fe0a4[_0xebbc('0x28')]);if(_0x9fe0a4['name']){delete _0x9fe0a4[_0xebbc('0x29')];}_0xd9c3a4[_0xebbc('0x19')](_0x30c59a)['send'](_0x9fe0a4);};}exports[_0xebbc('0x2a')]=function(_0x3c84e6,_0x3e5bf4){var _0x37b8f3={},_0x29d67a={},_0xcadbea={'count':0x0,'rows':[]};var _0x4dddd2=_['map'](db['ChatGroup'][_0xebbc('0x2b')],function(_0x3d899a){return{'name':_0x3d899a[_0xebbc('0x2c')],'type':_0x3d899a[_0xebbc('0x2d')][_0xebbc('0x2e')]};});_0x29d67a[_0xebbc('0x2f')]=_[_0xebbc('0x30')](_0x4dddd2,'name');_0x29d67a[_0xebbc('0x31')]=_['keys'](_0x3c84e6[_0xebbc('0x31')]);_0x29d67a[_0xebbc('0x32')]=_['intersection'](_0x29d67a[_0xebbc('0x2f')],_0x29d67a[_0xebbc('0x31')]);_0x37b8f3[_0xebbc('0x33')]=_['intersection'](_0x29d67a[_0xebbc('0x2f')],qs[_0xebbc('0x34')](_0x3c84e6[_0xebbc('0x31')][_0xebbc('0x34')]));_0x37b8f3[_0xebbc('0x33')]=_0x37b8f3[_0xebbc('0x33')][_0xebbc('0x35')]?_0x37b8f3[_0xebbc('0x33')]:_0x29d67a[_0xebbc('0x2f')];if(!_0x3c84e6[_0xebbc('0x31')]['hasOwnProperty']('nolimit')){_0x37b8f3[_0xebbc('0x36')]=qs['limit'](_0x3c84e6[_0xebbc('0x31')][_0xebbc('0x36')]);_0x37b8f3[_0xebbc('0x1c')]=qs[_0xebbc('0x1c')](_0x3c84e6['query'][_0xebbc('0x1c')]);}_0x37b8f3['order']=qs[_0xebbc('0x37')](_0x3c84e6['query'][_0xebbc('0x37')]);_0x37b8f3[_0xebbc('0x38')]=qs[_0xebbc('0x32')](_['pick'](_0x3c84e6[_0xebbc('0x31')],_0x29d67a[_0xebbc('0x32')]),_0x4dddd2);if(_0x3c84e6[_0xebbc('0x31')]['filter']){_0x37b8f3[_0xebbc('0x38')]=_[_0xebbc('0x39')](_0x37b8f3[_0xebbc('0x38')],{'$or':_[_0xebbc('0x30')](_0x4dddd2,function(_0x30ea8e){if(_0x30ea8e[_0xebbc('0x2d')]!==_0xebbc('0x3a')){var _0x5e1994={};_0x5e1994[_0x30ea8e[_0xebbc('0x29')]]={'$like':'%'+_0x3c84e6['query'][_0xebbc('0x3b')]+'%'};return _0x5e1994;}})});}_0x37b8f3=_['merge']({},_0x37b8f3,_0x3c84e6[_0xebbc('0x3c')]);var _0x40b265={'where':_0x37b8f3[_0xebbc('0x38')]};return db[_0xebbc('0x3d')]['count'](_0x40b265)[_0xebbc('0x25')](function(_0x3060){_0xcadbea[_0xebbc('0x1e')]=_0x3060;if(_0x3c84e6[_0xebbc('0x31')][_0xebbc('0x3e')]){_0x37b8f3[_0xebbc('0x3f')]=[{'all':!![]}];}return db[_0xebbc('0x3d')]['findAll'](_0x37b8f3);})['then'](function(_0x563e6e){_0xcadbea['rows']=_0x563e6e;return _0xcadbea;})['then'](respondWithFilteredResult(_0x3e5bf4,_0x37b8f3))[_0xebbc('0x40')](handleError(_0x3e5bf4,null));};exports[_0xebbc('0x41')]=function(_0x1774b9,_0x1d082a){var _0x39f750={'raw':!![],'where':{'id':_0x1774b9[_0xebbc('0x42')]['id']}},_0x3cb539={};_0x3cb539[_0xebbc('0x2f')]=_[_0xebbc('0x43')](db['ChatGroup']['rawAttributes']);_0x3cb539[_0xebbc('0x31')]=_[_0xebbc('0x43')](_0x1774b9[_0xebbc('0x31')]);_0x3cb539[_0xebbc('0x32')]=_[_0xebbc('0x44')](_0x3cb539['model'],_0x3cb539['query']);_0x39f750[_0xebbc('0x33')]=_[_0xebbc('0x44')](_0x3cb539[_0xebbc('0x2f')],qs['fields'](_0x1774b9[_0xebbc('0x31')]['fields']));_0x39f750[_0xebbc('0x33')]=_0x39f750['attributes'][_0xebbc('0x35')]?_0x39f750[_0xebbc('0x33')]:_0x3cb539[_0xebbc('0x2f')];if(_0x1774b9['query'][_0xebbc('0x3e')]){_0x39f750[_0xebbc('0x3f')]=[{'all':!![]}];}_0x39f750=_[_0xebbc('0x39')]({},_0x39f750,_0x1774b9[_0xebbc('0x3c')]);return db['ChatGroup']['find'](_0x39f750)[_0xebbc('0x25')](handleEntityNotFound(_0x1d082a,null))['then'](respondWithResult(_0x1d082a,null))[_0xebbc('0x40')](handleError(_0x1d082a,null));};exports[_0xebbc('0x45')]=function(_0x224825,_0x320160){return db['ChatGroup']['create'](_0x224825[_0xebbc('0x46')],{})['then'](respondWithResult(_0x320160,0xc9))[_0xebbc('0x40')](handleError(_0x320160,null));};exports[_0xebbc('0x24')]=function(_0x4469e1,_0xff4d21){if(_0x4469e1[_0xebbc('0x46')]['id']){delete _0x4469e1['body']['id'];}return db['ChatGroup'][_0xebbc('0x47')]({'where':{'id':_0x4469e1['params']['id']}})[_0xebbc('0x25')](handleEntityNotFound(_0xff4d21,null))[_0xebbc('0x25')](saveUpdates(_0x4469e1[_0xebbc('0x46')],null))[_0xebbc('0x25')](respondWithResult(_0xff4d21,null))['catch'](handleError(_0xff4d21,null));};exports[_0xebbc('0x48')]=function(_0x258fbc,_0x889613){return db[_0xebbc('0x3d')][_0xebbc('0x47')]({'where':{'id':_0x258fbc['params']['id']}})[_0xebbc('0x25')](handleEntityNotFound(_0x889613,null))[_0xebbc('0x25')](removeEntity(_0x889613,null))[_0xebbc('0x40')](handleError(_0x889613,null));};exports[_0xebbc('0x49')]=function(_0x228c1b,_0x27e1fe){return db[_0xebbc('0x3d')][_0xebbc('0x49')]()[_0xebbc('0x25')](respondWithResult(_0x27e1fe,null))['catch'](handleError(_0x27e1fe,null));};exports[_0xebbc('0x4a')]=function(_0x2345e6,_0xaa0725,_0xc8303c){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x2345e6[_0xebbc('0x42')]['id'],'ToId':_0x2345e6[_0xebbc('0x4b')]['id'],'read':![]}})[_0xebbc('0x25')](function(_0x5d6a81){return{'id':_[_0xebbc('0x4c')](_0x2345e6['params']['id']),'count':_0x5d6a81};})['then'](respondWithResult(_0xaa0725,null))[_0xebbc('0x40')](handleError(_0xaa0725,null));};exports[_0xebbc('0x4d')]=function(_0x1a99e8,_0x1cbda1,_0x4bdca0){return db[_0xebbc('0x3d')][_0xebbc('0x47')]({'where':{'id':_0x1a99e8[_0xebbc('0x42')]['id']}})['then'](handleEntityNotFound(_0x1cbda1,null))[_0xebbc('0x25')](function(_0x5a1cc1){if(_0x5a1cc1){return _0x5a1cc1['addMembers'](_0x1a99e8[_0xebbc('0x46')][_0xebbc('0x4e')],_[_0xebbc('0x4f')](_0x1a99e8[_0xebbc('0x46')],[_0xebbc('0x4e'),'id'])||{});}})[_0xebbc('0x25')](respondWithResult(_0x1cbda1,null))['catch'](handleError(_0x1cbda1,null));};exports[_0xebbc('0x50')]=function(_0x2df875,_0x4966e5,_0x3f2659){var _0x22e715={};var _0x59206c={};var _0x1800e2;var _0x1425ef;return db[_0xebbc('0x3d')][_0xebbc('0x51')]({'where':{'id':_0x2df875[_0xebbc('0x42')]['id']}})[_0xebbc('0x25')](handleEntityNotFound(_0x4966e5,null))[_0xebbc('0x25')](function(_0x38914c){if(_0x38914c){_0x1800e2=_0x38914c;_0x59206c[_0xebbc('0x2f')]=_[_0xebbc('0x43')](db[_0xebbc('0x52')][_0xebbc('0x2b')]);_0x59206c[_0xebbc('0x31')]=_['keys'](_0x2df875['query']);_0x59206c[_0xebbc('0x32')]=_[_0xebbc('0x44')](_0x59206c[_0xebbc('0x2f')],_0x59206c[_0xebbc('0x31')]);_0x22e715[_0xebbc('0x33')]=_[_0xebbc('0x44')](_0x59206c[_0xebbc('0x2f')],qs[_0xebbc('0x34')](_0x2df875[_0xebbc('0x31')]['fields']));_0x22e715[_0xebbc('0x33')]=_0x22e715['attributes'][_0xebbc('0x35')]?_0x22e715['attributes']:_0x59206c[_0xebbc('0x2f')];_0x22e715[_0xebbc('0x53')]=qs[_0xebbc('0x37')](_0x2df875[_0xebbc('0x31')][_0xebbc('0x37')]);_0x22e715[_0xebbc('0x38')]=qs['filters'](_[_0xebbc('0x54')](_0x2df875[_0xebbc('0x31')],_0x59206c[_0xebbc('0x32')]));if(_0x2df875[_0xebbc('0x31')][_0xebbc('0x3b')]){_0x22e715[_0xebbc('0x38')]=_['merge'](_0x22e715[_0xebbc('0x38')],{'$or':_[_0xebbc('0x30')](_0x22e715[_0xebbc('0x33')],function(_0x3df600){var _0xc8f4a1={};_0xc8f4a1[_0x3df600]={'$like':'%'+_0x2df875['query'][_0xebbc('0x3b')]+'%'};return _0xc8f4a1;})});}_0x22e715=_[_0xebbc('0x39')]({},_0x22e715,_0x2df875[_0xebbc('0x3c')]);return _0x1800e2['getMembers'](_0x22e715);}})[_0xebbc('0x25')](function(_0x2f1969){if(_0x2f1969){_0x1425ef=_0x2f1969[_0xebbc('0x35')];if(!_0x2df875[_0xebbc('0x31')][_0xebbc('0x55')](_0xebbc('0x56'))){_0x22e715['limit']=qs[_0xebbc('0x36')](_0x2df875[_0xebbc('0x31')][_0xebbc('0x36')]);_0x22e715[_0xebbc('0x1c')]=qs[_0xebbc('0x1c')](_0x2df875[_0xebbc('0x31')]['offset']);}return _0x1800e2[_0xebbc('0x50')](_0x22e715);}})[_0xebbc('0x25')](function(_0x2f5a3e){if(_0x2f5a3e){return _0x2f5a3e?{'count':_0x1425ef,'rows':_0x2f5a3e}:null;}})['then'](respondWithResult(_0x4966e5,null))['catch'](handleError(_0x4966e5,null));};exports[_0xebbc('0x57')]=function(_0x3515d9,_0x567507,_0x4cab00){return db[_0xebbc('0x3d')][_0xebbc('0x47')]({'where':{'id':_0x3515d9['params']['id']}})[_0xebbc('0x25')](handleEntityNotFound(_0x567507,null))[_0xebbc('0x25')](function(_0x1d9ebb){if(_0x1d9ebb){return _0x1d9ebb[_0xebbc('0x57')](_0x3515d9[_0xebbc('0x31')]['ids']);}})['then'](respondWithStatusCode(_0x567507,null))['catch'](handleError(_0x567507,null));};exports[_0xebbc('0x58')]=function(_0x501806,_0x3c4d21,_0x200cf5){if(_0x501806['body']['id']){delete _0x501806[_0xebbc('0x46')]['id'];}return db[_0xebbc('0x3d')][_0xebbc('0x47')]({'where':{'id':_0x501806[_0xebbc('0x42')]['id']}})[_0xebbc('0x25')](handleEntityNotFound(_0x3c4d21,null))[_0xebbc('0x25')](function(_0x5868cf){if(_0x5868cf){_0x501806['body']['ChatGroupId']=_0x5868cf['id'];return db[_0xebbc('0x59')][_0xebbc('0x45')](_0x501806[_0xebbc('0x46')]);}})[_0xebbc('0x25')](respondWithResult(_0x3c4d21,null))[_0xebbc('0x40')](handleError(_0x3c4d21,null));};exports['getMessages']=function(_0x287fa7,_0x814f49,_0x52bdfb){var _0x56d7bf={};var _0xc809e5={};var _0x49fbe1;var _0x931abf;return db[_0xebbc('0x3d')][_0xebbc('0x51')]({'where':{'id':_0x287fa7[_0xebbc('0x42')]['id']}})[_0xebbc('0x25')](handleEntityNotFound(_0x814f49,null))['then'](function(_0x1fe0e7){if(_0x1fe0e7){_0x49fbe1=_0x1fe0e7;_0xc809e5[_0xebbc('0x2f')]=_[_0xebbc('0x43')](db['ChatInternalMessage'][_0xebbc('0x2b')]);_0xc809e5[_0xebbc('0x31')]=_['keys'](_0x287fa7[_0xebbc('0x31')]);_0xc809e5[_0xebbc('0x32')]=_['intersection'](_0xc809e5[_0xebbc('0x2f')],_0xc809e5['query']);_0x56d7bf[_0xebbc('0x33')]=_[_0xebbc('0x44')](_0xc809e5[_0xebbc('0x2f')],qs[_0xebbc('0x34')](_0x287fa7[_0xebbc('0x31')]['fields']));_0x56d7bf[_0xebbc('0x33')]=_0x56d7bf[_0xebbc('0x33')][_0xebbc('0x35')]?_0x56d7bf['attributes']:_0xc809e5[_0xebbc('0x2f')];_0x56d7bf['order']=qs['sort'](_0x287fa7[_0xebbc('0x31')][_0xebbc('0x37')]);_0x56d7bf[_0xebbc('0x38')]=qs[_0xebbc('0x32')](_[_0xebbc('0x54')](_0x287fa7[_0xebbc('0x31')],_0xc809e5[_0xebbc('0x32')]));if(_0x287fa7[_0xebbc('0x31')][_0xebbc('0x3b')]){_0x56d7bf[_0xebbc('0x38')]=_[_0xebbc('0x39')](_0x56d7bf[_0xebbc('0x38')],{'$or':_[_0xebbc('0x30')](_0x56d7bf[_0xebbc('0x33')],function(_0x33c96f){var _0x14bf37={};_0x14bf37[_0x33c96f]={'$like':'%'+_0x287fa7[_0xebbc('0x31')][_0xebbc('0x3b')]+'%'};return _0x14bf37;})});}if(_0x287fa7[_0xebbc('0x31')][_0xebbc('0x5a')]){var _0x330646=_0x287fa7[_0xebbc('0x31')][_0xebbc('0x5a')][_0xebbc('0x5b')](',');var _0x2c5424={};_0x2c5424[_0x330646[0x0]]={'$gte':moment(_0x330646[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x56d7bf[_0xebbc('0x38')]=_['merge'](_0x56d7bf['where'],_0x2c5424);}_0x56d7bf=_[_0xebbc('0x39')]({},_0x56d7bf,_0x287fa7['options']);return _0x49fbe1[_0xebbc('0x5c')](_0x56d7bf);}})[_0xebbc('0x25')](function(_0x35035f){if(_0x35035f){_0x931abf=_0x35035f[_0xebbc('0x35')];if(!_0x287fa7[_0xebbc('0x31')][_0xebbc('0x55')](_0xebbc('0x56'))){_0x56d7bf[_0xebbc('0x36')]=qs[_0xebbc('0x36')](_0x287fa7[_0xebbc('0x31')][_0xebbc('0x36')]);_0x56d7bf[_0xebbc('0x1c')]=qs[_0xebbc('0x1c')](_0x287fa7[_0xebbc('0x31')][_0xebbc('0x1c')]);}return _0x49fbe1['getMessages'](_0x56d7bf);}})[_0xebbc('0x25')](function(_0x53b2fb){if(_0x53b2fb){return _0x53b2fb?{'count':_0x931abf,'rows':_0x53b2fb}:null;}})['then'](respondWithResult(_0x814f49,null))[_0xebbc('0x40')](handleError(_0x814f49,null));};
\ No newline at end of file
index b50cf0a..3b181f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ff6=['../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x1e3586,_0x3e3654){var _0x2ae49c=function(_0x543386){while(--_0x543386){_0x1e3586['push'](_0x1e3586['shift']());}};_0x2ae49c(++_0x3e3654);}(_0x3ff6,0x1a3));var _0x63ff=function(_0x5772d1,_0x56731d){_0x5772d1=_0x5772d1-0x0;var _0x5ad953=_0x3ff6[_0x5772d1];return _0x5ad953;};'use strict';var EventEmitter=require(_0x63ff('0x0'));var ChatGroup=require(_0x63ff('0x1'))['db'][_0x63ff('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x63ff('0x3')](0x0);var events={'afterCreate':_0x63ff('0x4'),'afterUpdate':_0x63ff('0x5'),'afterDestroy':_0x63ff('0x6')};function emitEvent(_0x587f75){return function(_0x2a1350,_0x4310ae,_0xef8702){ChatGroupEvents[_0x63ff('0x7')](_0x587f75+':'+_0x2a1350['id'],_0x2a1350);ChatGroupEvents[_0x63ff('0x7')](_0x587f75,_0x2a1350);_0xef8702(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x63ff('0x8')](e,emitEvent(event));}}module[_0x63ff('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0x57e8=['exports','../../mysqldb','update','emit','hasOwnProperty'];(function(_0x24cb64,_0x543b00){var _0x20a1cf=function(_0x9e78ef){while(--_0x9e78ef){_0x24cb64['push'](_0x24cb64['shift']());}};_0x20a1cf(++_0x543b00);}(_0x57e8,0x10a));var _0x857e=function(_0x1967c9,_0x53214f){_0x1967c9=_0x1967c9-0x0;var _0x296e31=_0x57e8[_0x1967c9];return _0x296e31;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x857e('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x857e('0x1'),'afterDestroy':'remove'};function emitEvent(_0x333dc6){return function(_0x8df9a0,_0x440ec1,_0x4d789c){ChatGroupEvents[_0x857e('0x2')](_0x333dc6+':'+_0x8df9a0['id'],_0x8df9a0);ChatGroupEvents[_0x857e('0x2')](_0x333dc6,_0x8df9a0);_0x4d789c(null);};}for(var e in events){if(events[_0x857e('0x3')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x857e('0x4')]=ChatGroupEvents;
\ No newline at end of file
index 8f33f37..38a3902 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc553=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatGroup','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc553,0x8c));var _0x3c55=function(_0x6eed7c,_0x5aaba7){_0x6eed7c=_0x6eed7c-0x0;var _0x5ac198=_0xc553[_0x6eed7c];return _0x5ac198;};'use strict';var _=require(_0x3c55('0x0'));var util=require(_0x3c55('0x1'));var logger=require('../../config/logger')(_0x3c55('0x2'));var moment=require(_0x3c55('0x3'));var BPromise=require(_0x3c55('0x4'));var rp=require(_0x3c55('0x5'));var fs=require('fs');var path=require(_0x3c55('0x6'));var rimraf=require(_0x3c55('0x7'));var config=require(_0x3c55('0x8'));var attributes=require('./chatGroup.attributes');module[_0x3c55('0x9')]=function(_0xbd4d33,_0x573edd){return _0xbd4d33['define'](_0x3c55('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x94ef=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1c1f71,_0x502d94){var _0x24b632=function(_0xcbadb6){while(--_0xcbadb6){_0x1c1f71['push'](_0x1c1f71['shift']());}};_0x24b632(++_0x502d94);}(_0x94ef,0xae));var _0xf94e=function(_0x3786fe,_0x4803be){_0x3786fe=_0x3786fe-0x0;var _0x59a8e9=_0x94ef[_0x3786fe];return _0x59a8e9;};'use strict';var _=require(_0xf94e('0x0'));var util=require(_0xf94e('0x1'));var logger=require(_0xf94e('0x2'))(_0xf94e('0x3'));var moment=require(_0xf94e('0x4'));var BPromise=require(_0xf94e('0x5'));var rp=require(_0xf94e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf94e('0x7'));var config=require(_0xf94e('0x8'));var attributes=require(_0xf94e('0x9'));module[_0xf94e('0xa')]=function(_0x3cb891,_0xc6779c){return _0x3cb891[_0xf94e('0xb')](_0xf94e('0xc'),attributes,{'tableName':_0xf94e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dbbf49b..977b233 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd50=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request'];(function(_0x36cba4,_0x53a452){var _0xcc6047=function(_0x20b2a5){while(--_0x20b2a5){_0x36cba4['push'](_0x36cba4['shift']());}};_0xcc6047(++_0x53a452);}(_0xdd50,0x172));var _0x0dd5=function(_0x372ee1,_0x45c637){_0x372ee1=_0x372ee1-0x0;var _0x31ea06=_0xdd50[_0x372ee1];return _0x31ea06;};'use strict';var _=require('lodash');var util=require(_0x0dd5('0x0'));var moment=require(_0x0dd5('0x1'));var BPromise=require(_0x0dd5('0x2'));var rs=require(_0x0dd5('0x3'));var fs=require('fs');var Redis=require(_0x0dd5('0x4'));var db=require(_0x0dd5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0dd5('0x6'));var client=jayson[_0x0dd5('0x7')][_0x0dd5('0x8')]({'port':0x232a});config[_0x0dd5('0x9')]=_[_0x0dd5('0xa')](config['redis'],{'host':_0x0dd5('0xb'),'port':0x18eb});var socket=require(_0x0dd5('0xc'))(new Redis(config[_0x0dd5('0x9')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x2a07db,_0x22419f,_0x20b37b){return new BPromise(function(_0x53c590,_0x574b2e){return client[_0x0dd5('0xd')](_0x2a07db,_0x20b37b)[_0x0dd5('0xe')](function(_0x51b19a){logger[_0x0dd5('0xf')](_0x0dd5('0x10'),_0x22419f,_0x0dd5('0x11'));logger[_0x0dd5('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x22419f,_0x0dd5('0x11'),JSON['stringify'](_0x51b19a));if(_0x51b19a[_0x0dd5('0x13')]){if(_0x51b19a['error'][_0x0dd5('0x14')]===0x1f4){logger[_0x0dd5('0x13')](_0x0dd5('0x10'),_0x22419f,_0x51b19a[_0x0dd5('0x13')][_0x0dd5('0x15')]);return _0x574b2e(_0x51b19a[_0x0dd5('0x13')]['message']);}logger[_0x0dd5('0x13')](_0x0dd5('0x10'),_0x22419f,_0x51b19a[_0x0dd5('0x13')][_0x0dd5('0x15')]);return _0x53c590(_0x51b19a['error'][_0x0dd5('0x15')]);}else{logger[_0x0dd5('0xf')](_0x0dd5('0x10'),_0x22419f,'request\x20sent');_0x53c590(_0x51b19a[_0x0dd5('0x16')][_0x0dd5('0x15')]);}})[_0x0dd5('0x17')](function(_0x2cba7e){logger[_0x0dd5('0x13')](_0x0dd5('0x10'),_0x22419f,_0x2cba7e);_0x574b2e(_0x2cba7e);});});}
\ No newline at end of file
+var _0x165d=['rpc','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','ChatGroup,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x4c12b1,_0x253dab){var _0x2da0dc=function(_0x13465f){while(--_0x13465f){_0x4c12b1['push'](_0x4c12b1['shift']());}};_0x2da0dc(++_0x253dab);}(_0x165d,0x14a));var _0xd165=function(_0x9bdf99,_0xd14695){_0x9bdf99=_0x9bdf99-0x0;var _0x2dea85=_0x165d[_0x9bdf99];return _0x2dea85;};'use strict';var _=require(_0xd165('0x0'));var util=require(_0xd165('0x1'));var moment=require(_0xd165('0x2'));var BPromise=require(_0xd165('0x3'));var rs=require(_0xd165('0x4'));var fs=require('fs');var Redis=require(_0xd165('0x5'));var db=require(_0xd165('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd165('0x7'))(_0xd165('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd165('0x9')]({'port':0x232a});config[_0xd165('0xa')]=_['defaults'](config['redis'],{'host':_0xd165('0xb'),'port':0x18eb});var socket=require(_0xd165('0xc'))(new Redis(config[_0xd165('0xa')]));require(_0xd165('0xd'))[_0xd165('0xe')](socket);function respondWithRpcPromise(_0x239d6d,_0x249052,_0x1a36f4){return new BPromise(function(_0x51f6f8,_0x3ce4f3){return client[_0xd165('0xf')](_0x239d6d,_0x1a36f4)[_0xd165('0x10')](function(_0x50f6b7){logger[_0xd165('0x11')]('ChatGroup,\x20%s,\x20%s',_0x249052,_0xd165('0x12'));logger[_0xd165('0x13')](_0xd165('0x14'),_0x249052,_0xd165('0x12'),JSON['stringify'](_0x50f6b7));if(_0x50f6b7['error']){if(_0x50f6b7[_0xd165('0x15')][_0xd165('0x16')]===0x1f4){logger[_0xd165('0x15')]('ChatGroup,\x20%s,\x20%s',_0x249052,_0x50f6b7['error']['message']);return _0x3ce4f3(_0x50f6b7[_0xd165('0x15')][_0xd165('0x17')]);}logger['error'](_0xd165('0x18'),_0x249052,_0x50f6b7[_0xd165('0x15')]['message']);return _0x51f6f8(_0x50f6b7['error'][_0xd165('0x17')]);}else{logger[_0xd165('0x11')]('ChatGroup,\x20%s,\x20%s',_0x249052,'request\x20sent');_0x51f6f8(_0x50f6b7['result']['message']);}})[_0xd165('0x19')](function(_0x1521be){logger[_0xd165('0x15')](_0xd165('0x18'),_0x249052,_0x1521be);_0x3ce4f3(_0x1521be);});});}
\ No newline at end of file
index cff36f0..2b12470 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1820=['removeListener','register','./chatGroup.events','save'];(function(_0x4f9049,_0x54f8fe){var _0x4c3737=function(_0x4f9397){while(--_0x4f9397){_0x4f9049['push'](_0x4f9049['shift']());}};_0x4c3737(++_0x54f8fe);}(_0x1820,0xda));var _0x0182=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x1820[_0x55e08b];return _0xd1a7ff;};'use strict';var ChatGroupEvents=require(_0x0182('0x0'));var events=[_0x0182('0x1'),'remove','update'];function createListener(_0x590e66,_0x41bd7e){return function(_0x5e916d){_0x41bd7e['emit'](_0x590e66,_0x5e916d);};}function removeListener(_0x53b249,_0x11bb6b){return function(){ChatGroupEvents[_0x0182('0x2')](_0x53b249,_0x11bb6b);};}exports[_0x0182('0x3')]=function(_0x18e51a){for(var _0x3bf8c7=0x0,_0x4b6d98=events['length'];_0x3bf8c7<_0x4b6d98;_0x3bf8c7++){var _0x366c1f=events[_0x3bf8c7];var _0x17b6b5=createListener('chatGroup:'+_0x366c1f,_0x18e51a);ChatGroupEvents['on'](_0x366c1f,_0x17b6b5);}};
\ No newline at end of file
+var _0x0807=['length','chatGroup:','./chatGroup.events','remove','emit','removeListener','register'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0x0807,0x159));var _0x7080=function(_0x1ca17e,_0x559004){_0x1ca17e=_0x1ca17e-0x0;var _0x453e80=_0x0807[_0x1ca17e];return _0x453e80;};'use strict';var ChatGroupEvents=require(_0x7080('0x0'));var events=['save',_0x7080('0x1'),'update'];function createListener(_0x26d2f9,_0x4f3dd0){return function(_0x1c41ef){_0x4f3dd0[_0x7080('0x2')](_0x26d2f9,_0x1c41ef);};}function removeListener(_0x2f6256,_0x375110){return function(){ChatGroupEvents[_0x7080('0x3')](_0x2f6256,_0x375110);};}exports[_0x7080('0x4')]=function(_0x2eb3a5){for(var _0x53b122=0x0,_0x397638=events[_0x7080('0x5')];_0x53b122<_0x397638;_0x53b122++){var _0x379234=events[_0x53b122];var _0x13b269=createListener(_0x7080('0x6')+_0x379234,_0x2eb3a5);ChatGroupEvents['on'](_0x379234,_0x13b269);}};
\ No newline at end of file
index a3b0197..463b52e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3e7=['destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','addMessage','put','delete'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xf3e7,0x17c));var _0x7f3e=function(_0x3cf868,_0x28a57a){_0x3cf868=_0x3cf868-0x0;var _0x104034=_0xf3e7[_0x3cf868];return _0x104034;};'use strict';var multer=require(_0x7f3e('0x0'));var util=require(_0x7f3e('0x1'));var path=require(_0x7f3e('0x2'));var timeout=require(_0x7f3e('0x3'));var express=require(_0x7f3e('0x4'));var router=express[_0x7f3e('0x5')]();var fs_extra=require(_0x7f3e('0x6'));var auth=require(_0x7f3e('0x7'));var interaction=require(_0x7f3e('0x8'));var config=require(_0x7f3e('0x9'));var controller=require(_0x7f3e('0xa'));router[_0x7f3e('0xb')]('/',auth[_0x7f3e('0xc')](),controller['index']);router[_0x7f3e('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x7f3e('0xb')](_0x7f3e('0xd'),auth['isAuthenticated'](),controller[_0x7f3e('0xe')]);router[_0x7f3e('0xb')](_0x7f3e('0xf'),auth['isAuthenticated'](),controller[_0x7f3e('0x10')]);router[_0x7f3e('0xb')](_0x7f3e('0x11'),auth['isAuthenticated'](),controller['getMembers']);router[_0x7f3e('0xb')](_0x7f3e('0x12'),auth[_0x7f3e('0xc')](),controller[_0x7f3e('0x13')]);router[_0x7f3e('0x14')]('/',auth[_0x7f3e('0xc')](),controller[_0x7f3e('0x15')]);router[_0x7f3e('0x14')](_0x7f3e('0x11'),auth[_0x7f3e('0xc')](),controller[_0x7f3e('0x16')]);router['post'](_0x7f3e('0x12'),auth['isAuthenticated'](),controller[_0x7f3e('0x17')]);router[_0x7f3e('0x18')](_0x7f3e('0xd'),auth[_0x7f3e('0xc')](),controller['update']);router[_0x7f3e('0x19')](_0x7f3e('0xd'),auth[_0x7f3e('0xc')](),controller[_0x7f3e('0x1a')]);router[_0x7f3e('0x19')](_0x7f3e('0x11'),auth[_0x7f3e('0xc')](),controller[_0x7f3e('0x1b')]);module[_0x7f3e('0x1c')]=router;
\ No newline at end of file
+var _0x8b6f=['/:id/messages','getMessages','post','/:id/members','addMembers','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','describe','/:id','isAuthenticated','/:id/unread','getUnread','getMembers'];(function(_0x1a5dd4,_0x22f4c3){var _0x41499f=function(_0x3ada1d){while(--_0x3ada1d){_0x1a5dd4['push'](_0x1a5dd4['shift']());}};_0x41499f(++_0x22f4c3);}(_0x8b6f,0x1d4));var _0xf8b6=function(_0x1620e4,_0x586b59){_0x1620e4=_0x1620e4-0x0;var _0x59bb43=_0x8b6f[_0x1620e4];return _0x59bb43;};'use strict';var multer=require(_0xf8b6('0x0'));var util=require(_0xf8b6('0x1'));var path=require(_0xf8b6('0x2'));var timeout=require(_0xf8b6('0x3'));var express=require(_0xf8b6('0x4'));var router=express[_0xf8b6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf8b6('0x6'));var interaction=require(_0xf8b6('0x7'));var config=require(_0xf8b6('0x8'));var controller=require(_0xf8b6('0x9'));router[_0xf8b6('0xa')]('/',auth['isAuthenticated'](),controller[_0xf8b6('0xb')]);router[_0xf8b6('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xf8b6('0xc')]);router[_0xf8b6('0xa')](_0xf8b6('0xd'),auth[_0xf8b6('0xe')](),controller['show']);router[_0xf8b6('0xa')](_0xf8b6('0xf'),auth[_0xf8b6('0xe')](),controller[_0xf8b6('0x10')]);router[_0xf8b6('0xa')]('/:id/members',auth[_0xf8b6('0xe')](),controller[_0xf8b6('0x11')]);router[_0xf8b6('0xa')](_0xf8b6('0x12'),auth[_0xf8b6('0xe')](),controller[_0xf8b6('0x13')]);router[_0xf8b6('0x14')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xf8b6('0x15'),auth[_0xf8b6('0xe')](),controller[_0xf8b6('0x16')]);router['post'](_0xf8b6('0x12'),auth[_0xf8b6('0xe')](),controller['addMessage']);router[_0xf8b6('0x17')](_0xf8b6('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xf8b6('0x18')]('/:id',auth[_0xf8b6('0xe')](),controller[_0xf8b6('0x19')]);router[_0xf8b6('0x18')]('/:id/members',auth[_0xf8b6('0xe')](),controller['removeMembers']);module[_0xf8b6('0x1a')]=router;
\ No newline at end of file
index 3fc67ac..b729319 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb8=['thumb','TEXT','STRING','DATE','long','out','BOOLEAN','INTEGER','ENUM','star'];(function(_0x5a3cde,_0x21e4a5){var _0x18023b=function(_0x305a5a){while(--_0x305a5a){_0x5a3cde['push'](_0x5a3cde['shift']());}};_0x18023b(++_0x21e4a5);}(_0x5eb8,0xb0));var _0x85eb=function(_0x494315,_0x2d42bd){_0x494315=_0x494315-0x0;var _0x49cc18=_0x5eb8[_0x494315];return _0x49cc18;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x85eb('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x85eb('0x1')]},'ratingType':{'type':Sequelize[_0x85eb('0x2')](_0x85eb('0x3'),_0x85eb('0x4')),'defaultValue':_0x85eb('0x3')},'ratingMessage':{'type':Sequelize[_0x85eb('0x5')]},'pathTranscript':{'type':Sequelize[_0x85eb('0x5')]},'mailTranscript':{'type':Sequelize[_0x85eb('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x85eb('0x7')]},'disposition':{'type':Sequelize[_0x85eb('0x6')]},'secondDisposition':{'type':Sequelize[_0x85eb('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x85eb('0x6')]},'browserName':{'type':Sequelize[_0x85eb('0x6')]},'browserVersion':{'type':Sequelize[_0x85eb('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x85eb('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x85eb('0x6')]},'deviceType':{'type':Sequelize[_0x85eb('0x6')]},'referer':{'type':Sequelize[_0x85eb('0x5')]},'customerIp':{'type':Sequelize[_0x85eb('0x6')]},'formData':{'type':Sequelize[_0x85eb('0x5')](_0x85eb('0x8'))},'read1stAt':{'type':Sequelize[_0x85eb('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x85eb('0x2')]('in',_0x85eb('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x85eb('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x85eb('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x85eb('0x0')],'defaultValue':![]}};
\ No newline at end of file
+var _0x65c9=['out','BOOLEAN','sequelize','exports','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long'];(function(_0x5a27e6,_0xc502e3){var _0x6dde23=function(_0x101b4b){while(--_0x101b4b){_0x5a27e6['push'](_0x5a27e6['shift']());}};_0x6dde23(++_0xc502e3);}(_0x65c9,0x182));var _0x965c=function(_0x37ceee,_0x179bae){_0x37ceee=_0x37ceee-0x0;var _0x3849fb=_0x65c9[_0x37ceee];return _0x3849fb;};'use strict';var Sequelize=require(_0x965c('0x0'));module[_0x965c('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x965c('0x2')]},'ratingType':{'type':Sequelize[_0x965c('0x3')](_0x965c('0x4'),_0x965c('0x5')),'defaultValue':_0x965c('0x4')},'ratingMessage':{'type':Sequelize[_0x965c('0x6')]},'pathTranscript':{'type':Sequelize[_0x965c('0x6')]},'mailTranscript':{'type':Sequelize[_0x965c('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x965c('0x8')]},'disposition':{'type':Sequelize[_0x965c('0x7')]},'secondDisposition':{'type':Sequelize[_0x965c('0x7')]},'thirdDisposition':{'type':Sequelize[_0x965c('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x965c('0x7')]},'browserVersion':{'type':Sequelize[_0x965c('0x7')]},'osName':{'type':Sequelize[_0x965c('0x7')]},'osVersion':{'type':Sequelize[_0x965c('0x7')]},'deviceModel':{'type':Sequelize[_0x965c('0x7')]},'deviceVendor':{'type':Sequelize[_0x965c('0x7')]},'deviceType':{'type':Sequelize[_0x965c('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x965c('0x7')]},'formData':{'type':Sequelize[_0x965c('0x6')](_0x965c('0x9'))},'read1stAt':{'type':Sequelize[_0x965c('0x8')]},'lastMsgAt':{'type':Sequelize[_0x965c('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x965c('0x3')]('in',_0x965c('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x965c('0x7')]},'customerPort':{'type':Sequelize[_0x965c('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x965c('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x965c('0xb')],'defaultValue':![]}};
\ No newline at end of file
index 4aca29e..2f5043d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5636=['update','then','destroy','sendStatus','stack','name','send','render','body','contact','agent','interaction','account','map','Tags','TagIds','forEach','push','talking','answered','abandoned','total','closed','UserId','waiting','disposition','unmanaged','index','rawAttributes','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','field','color','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','value','having','`\x20>\x200','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','some','compact','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','params','includeAll','options','ChatInteraction','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooNote','isNull','metadata','ValidationError','Sequelize','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','attachmentUpload','file','originalname','basename','Attachment','json','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','mailTranscript','format','now','pathTranscript','Messages','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','SendMail','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','pick','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','secret','addTags','setTags','emit','chatInteractionTags:save','removeTags','server','tmp','files','firstName','lastName','direction','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','unlinkSync','rimraf','zip-dir','mustache','util','path','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./chatInteraction.socket','http','client','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','end','status','undefined','limit','count','offset','Content-Range'];(function(_0x2c27ed,_0x5c50f0){var _0x597bd1=function(_0xd6db18){while(--_0xd6db18){_0x2c27ed['push'](_0x2c27ed['shift']());}};_0x597bd1(++_0x5c50f0);}(_0x5636,0x102));var _0x6563=function(_0x589ba8,_0x1e6108){_0x589ba8=_0x589ba8-0x0;var _0x23cc2e=_0x5636[_0x589ba8];return _0x23cc2e;};'use strict';var rimraf=require(_0x6563('0x0'));var zipdir=require(_0x6563('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6563('0x2'));var util=require(_0x6563('0x3'));var path=require(_0x6563('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6563('0x5'));var squel=require(_0x6563('0x6'));var Redis=require(_0x6563('0x7'));var qs=require(_0x6563('0x8'));var as=require(_0x6563('0x9'));var pdf=require(_0x6563('0xa'));var logger=require(_0x6563('0xb'))(_0x6563('0xc'));var config=require(_0x6563('0xd'));var db=require(_0x6563('0xe'))['db'];config[_0x6563('0xf')]=_[_0x6563('0x10')](config[_0x6563('0xf')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6563('0xf')]));require(_0x6563('0x11'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x6563('0x12')]({'port':0x232b});var client9004=jayson[_0x6563('0x13')][_0x6563('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x12429c,_0x33816e,_0x2ed676,_0x31d3fa){return new BPromise(function(_0xbbae72,_0x447f9a){var _0x51aeca=_0x31d3fa||client;return _0x51aeca[_0x6563('0x14')](_0x12429c,_0x2ed676)['then'](function(_0x37131e){logger[_0x6563('0x15')](_0x6563('0x16'),_0x33816e,_0x6563('0x17'));logger['debug'](_0x6563('0x18'),_0x33816e,_0x6563('0x17'),JSON[_0x6563('0x19')](_0x37131e));if(_0x37131e[_0x6563('0x1a')]){if(_0x37131e['error'][_0x6563('0x1b')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x33816e,_0x37131e['error'][_0x6563('0x1c')]);return _0x447f9a(_0x37131e['error']['message']);}logger[_0x6563('0x1a')](_0x6563('0x16'),_0x33816e,_0x37131e[_0x6563('0x1a')][_0x6563('0x1c')]);return _0xbbae72(_0x37131e[_0x6563('0x1a')][_0x6563('0x1c')]);}else{logger[_0x6563('0x15')](_0x6563('0x16'),_0x33816e,_0x6563('0x17'));_0xbbae72(_0x37131e['result'][_0x6563('0x1c')]);}})[_0x6563('0x1d')](function(_0x20b478){logger['error'](_0x6563('0x16'),_0x33816e,_0x20b478);_0x447f9a(_0x20b478);});});}function respondWithStatusCode(_0x5c37bb,_0x5953c5){_0x5953c5=_0x5953c5||0xcc;return function(_0x105379){if(_0x105379){return _0x5c37bb['sendStatus'](_0x5953c5);}return _0x5c37bb['status'](_0x5953c5)[_0x6563('0x1e')]();};}function respondWithResult(_0x492f45,_0x1097d0){_0x1097d0=_0x1097d0||0xc8;return function(_0x19f34e){if(_0x19f34e){return _0x492f45[_0x6563('0x1f')](_0x1097d0)['json'](_0x19f34e);}};}function respondWithFilteredResult(_0xd860d5,_0x51ff06){return function(_0x7ea857){if(_0x7ea857){var _0x1590e6=typeof _0x51ff06['offset']===_0x6563('0x20')&&typeof _0x51ff06[_0x6563('0x21')]==='undefined';var _0x2ddb2b=_0x7ea857['count'];var _0x1fe1cb=_0x1590e6?0x0:_0x51ff06['offset'];var _0x480408=_0x1590e6?_0x7ea857[_0x6563('0x22')]:_0x51ff06[_0x6563('0x23')]+_0x51ff06[_0x6563('0x21')];var _0x2a1550;if(_0x480408>=_0x2ddb2b){_0x480408=_0x2ddb2b;_0x2a1550=0xc8;}else{_0x2a1550=0xce;}_0xd860d5[_0x6563('0x1f')](_0x2a1550);return _0xd860d5['set'](_0x6563('0x24'),_0x1fe1cb+'-'+_0x480408+'/'+_0x2ddb2b)['json'](_0x7ea857);}return null;};}function saveUpdates(_0x5b100b){return function(_0x3582c9){if(_0x3582c9){return _0x3582c9[_0x6563('0x25')](_0x5b100b)[_0x6563('0x26')](function(_0xdbbdda){return _0xdbbdda;});}return null;};}function removeEntity(_0x116605){return function(_0x305861){if(_0x305861){return _0x305861[_0x6563('0x27')]()[_0x6563('0x26')](function(){_0x116605[_0x6563('0x1f')](0xcc)[_0x6563('0x1e')]();});}};}function handleEntityNotFound(_0x59b1a6){return function(_0x9b3d86){if(!_0x9b3d86){_0x59b1a6[_0x6563('0x28')](0x194);}return _0x9b3d86;};}function handleError(_0x29fb9d,_0x1558fb){_0x1558fb=_0x1558fb||0x1f4;return function(_0x29ab06){logger[_0x6563('0x1a')](_0x29ab06[_0x6563('0x29')]);if(_0x29ab06['name']){delete _0x29ab06[_0x6563('0x2a')];}_0x29fb9d[_0x6563('0x1f')](_0x1558fb)[_0x6563('0x2b')](_0x29ab06);};}function getMustacheRender(_0x46fb1b,_0x3f79da){return Mustache[_0x6563('0x2c')](_0x46fb1b,_['merge'](_0x3f79da[_0x6563('0x2d')],{'contact':_0x3f79da[_0x6563('0x2e')],'message':_0x3f79da[_0x6563('0x1c')],'agent':_0x3f79da[_0x6563('0x2f')],'interaction':_0x3f79da[_0x6563('0x30')],'account':_0x3f79da[_0x6563('0x31')]}))||'';}function getInteractionUsers(_0x3f578a,_0x4cc655){return new BPromise(function(_0x1925cc,_0x394120){try{if(_0x4cc655[_0x3f578a['id']]){_0x3f578a['Users']=_[_0x6563('0x32')](_0x4cc655[_0x3f578a['id']],function(_0x1ff47d){return{'id':_0x1ff47d['id'],'fullname':_0x1ff47d['fullname']};});}}catch(_0x582650){_0x394120(_0x582650);}_0x1925cc(_0x3f578a);});}function getInteractionTags(_0x38fef5,_0x5ca0ab){return new BPromise(function(_0x227ac1,_0x45feb9){try{if(_0x38fef5['TagIds']){_0x38fef5[_0x6563('0x33')]=[];_0x38fef5[_0x6563('0x34')]['split'](',')[_0x6563('0x35')](function(_0xe5e80f){_0x38fef5[_0x6563('0x33')][_0x6563('0x36')](_0x5ca0ab[_0xe5e80f]);});}delete _0x38fef5[_0x6563('0x34')];}catch(_0x1f6341){_0x45feb9(_0x1f6341);}_0x227ac1(_0x38fef5);});}function updateChatInteraction(_0x95e404,_0x15c23e,_0x2e4177){return new BPromise(function(_0x54b601,_0x130a88){return getInteractionUsers(_0x95e404,_0x2e4177)[_0x6563('0x26')](function(_0x3b7a24){return getInteractionTags(_0x3b7a24,_0x15c23e);})[_0x6563('0x26')](function(_0x5ebe88){return getStateInteraction(_0x5ebe88);})['then'](function(_0x13bbbb){_0x54b601(_0x13bbbb);})[_0x6563('0x1d')](function(_0x28db6f){_0x130a88(_0x28db6f);});});}function getStateInteraction(_0x5db29d){return new BPromise(function(_0x3eadab){_0x5db29d['waiting']=0x0;_0x5db29d[_0x6563('0x37')]=0x0;_0x5db29d[_0x6563('0x38')]=0x0;_0x5db29d['unmanaged']=0x0;_0x5db29d[_0x6563('0x39')]=0x0;_0x5db29d[_0x6563('0x3a')]=0x0;if(!_0x5db29d[_0x6563('0x3b')]&&!_0x5db29d[_0x6563('0x3c')]){_0x5db29d[_0x6563('0x3d')]+=0x1;}if(!_0x5db29d[_0x6563('0x3b')]&&_0x5db29d[_0x6563('0x3c')]){_0x5db29d[_0x6563('0x37')]+=0x1;if(_0x5db29d[_0x6563('0x3d')]){_0x5db29d[_0x6563('0x3d')]-=0x1;}}if(_0x5db29d[_0x6563('0x3b')]&&_0x5db29d['disposition']==='abandoned'){_0x5db29d[_0x6563('0x39')]+=0x1;if(_0x5db29d[_0x6563('0x3d')]){_0x5db29d[_0x6563('0x3d')]-=0x1;}}else if(_0x5db29d[_0x6563('0x3b')]&&!_0x5db29d[_0x6563('0x3c')]&&_0x5db29d[_0x6563('0x3e')]){_0x5db29d[_0x6563('0x3f')]+=0x1;if(_0x5db29d['waiting']){_0x5db29d[_0x6563('0x3d')]-=0x1;}}else if(_0x5db29d[_0x6563('0x3b')]&&_0x5db29d[_0x6563('0x3c')]){_0x5db29d[_0x6563('0x38')]+=0x1;if(_0x5db29d['talking']){_0x5db29d[_0x6563('0x37')]-=0x1;}}_0x5db29d[_0x6563('0x3a')]+=0x1;_0x3eadab(_0x5db29d);});}exports[_0x6563('0x40')]=function(_0x257106,_0x1032eb){var _0x4e0f0a={},_0x496602={},_0x1504ca={'count':0x0,'rows':[]};var _0x42d54c=_[_0x6563('0x32')](db['ChatInteraction'][_0x6563('0x41')],function(_0x120723){return{'name':_0x120723[_0x6563('0x42')],'type':_0x120723[_0x6563('0x43')]['key']};});_0x496602[_0x6563('0x44')]=_[_0x6563('0x32')](_0x42d54c,_0x6563('0x2a'));_0x496602['query']=_[_0x6563('0x45')](_0x257106['query']);_0x496602[_0x6563('0x46')]=_['intersection'](_0x496602['model'],_0x496602[_0x6563('0x47')]);_0x4e0f0a[_0x6563('0x48')]=_[_0x6563('0x49')](_0x496602[_0x6563('0x44')],qs[_0x6563('0x4a')](_0x257106[_0x6563('0x47')][_0x6563('0x4a')]));_0x4e0f0a[_0x6563('0x48')]=_0x4e0f0a[_0x6563('0x48')][_0x6563('0x4b')]?_0x4e0f0a['attributes']:_0x496602[_0x6563('0x44')];if(!_0x257106['query'][_0x6563('0x4c')](_0x6563('0x4d'))){_0x4e0f0a[_0x6563('0x21')]=qs['limit'](_0x257106[_0x6563('0x47')][_0x6563('0x21')]);_0x4e0f0a['offset']=qs[_0x6563('0x23')](_0x257106[_0x6563('0x47')][_0x6563('0x23')]);}_0x4e0f0a[_0x6563('0x4e')]=qs[_0x6563('0x4f')](_0x257106['query'][_0x6563('0x4f')]);_0x4e0f0a['where']=qs[_0x6563('0x46')](_['pick'](_0x257106[_0x6563('0x47')],_0x496602['filters']),_0x42d54c);var _0x55e002=[];var _0x5c8274=squel['select']()[_0x6563('0x50')]('id')['field'](_0x6563('0x2a'))['field'](_0x6563('0x51'))[_0x6563('0x52')](_0x6563('0x53'));var _0x32ebac=squel[_0x6563('0x54')]()[_0x6563('0x50')](_0x6563('0x55'))[_0x6563('0x50')](_0x6563('0x56'))['field'](_0x6563('0x57'))[_0x6563('0x52')](_0x6563('0x58'),'ui')[_0x6563('0x59')](_0x6563('0x5a'),'u',_0x6563('0x5b'));var _0x40c99b=squel[_0x6563('0x54')]()[_0x6563('0x52')](_0x6563('0x5c'),'i')[_0x6563('0x59')]('cm_contacts','c',_0x6563('0x5d'))[_0x6563('0x59')](_0x6563('0x5a'),'o',_0x6563('0x5e'))[_0x6563('0x59')](_0x6563('0x5f'),'a',_0x6563('0x60'))[_0x6563('0x59')]('chat_messages','me',_0x6563('0x61'))['left_join'](_0x6563('0x62'),'it',_0x6563('0x63'))['left_join']('tools_tags','t',_0x6563('0x64'));var _0x8f5e46=squel[_0x6563('0x65')]();var _0x39fc04=[];var _0x52fffa=squel[_0x6563('0x65')]();var _0x49c1e0;if(_0x257106[_0x6563('0x47')][_0x6563('0x66')]){_0x49c1e0=as['parseSearch'](_0x257106['query'][_0x6563('0x66')]);var _0x5bae4c=_0x49c1e0['sqlOperator'];for(var _0x1fa23f=0x0;_0x1fa23f<_0x49c1e0['conditions'][_0x6563('0x4b')];_0x1fa23f++){var _0x41adce=_0x49c1e0[_0x6563('0x67')][_0x1fa23f];var _0x21d111='i';var _0x4829ab=_[_0x6563('0x68')](_0x42d54c,[_0x6563('0x2a'),_0x41adce[_0x6563('0x50')]]);if(!_0x4829ab){switch(_0x41adce[_0x6563('0x50')]){case _0x6563('0x69'):if(_0x41adce[_0x6563('0x6a')]==0x1){_0x40c99b[_0x6563('0x6b')]('`'+_0x41adce[_0x6563('0x50')]+'`\x20=\x200');}else{_0x40c99b['having']('`'+_0x41adce[_0x6563('0x50')]+_0x6563('0x6c'));}break;case'Contact':if(_0x41adce['operator']==='$substring'){if(_0x41adce[_0x6563('0x6a')][_0x6563('0x6d')]('\x20')[_0x6563('0x4b')]>0x1){_0x8f5e46[_0x5bae4c](_0x6563('0x6e'),qs['getFullTextValue'](_0x41adce[_0x6563('0x6a')]),null);}else{var _0x1a5c54='%'+_0x41adce[_0x6563('0x6a')]+'%';_0x8f5e46[_0x5bae4c](_0x6563('0x6f'),_0x1a5c54,_0x1a5c54,_0x1a5c54);}}else{_0x4829ab=_[_0x6563('0x68')](_0x42d54c,['name','ContactId']);_0x41adce[_0x6563('0x50')]=_0x6563('0x70');_0x331239=as[_0x6563('0x71')](_0x21d111,_0x4829ab['type'],_0x41adce);_0x8f5e46[_0x5bae4c](_0x331239[_0x6563('0x72')],_0x331239['value'][_0x6563('0x73')],_0x331239[_0x6563('0x6a')][_0x6563('0x1e')]);}break;case _0x6563('0x74'):var _0x254c3f=_0x41adce[_0x6563('0x6a')][_0x6563('0x6d')](',')['map'](function(_0x58671e){return Number(_0x58671e);});_0x254c3f[_0x6563('0x35')](function(_0x1228b3){_0x52fffa['or'](_0x6563('0x75'),'%,'+_0x1228b3+',%');});_0x39fc04=_[_0x6563('0x76')](_0x39fc04,_0x254c3f);break;case _0x6563('0x77'):if(_0x41adce[_0x6563('0x78')]==='$substring'){_0x8f5e46[_0x5bae4c]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x41adce['value']+'%',null);}else{_0x4829ab=_[_0x6563('0x68')](_0x42d54c,[_0x6563('0x2a'),_0x6563('0x3c')]);_0x41adce[_0x6563('0x50')]=_0x6563('0x3c');_0x331239=as['buildExpression'](_0x21d111,_0x4829ab[_0x6563('0x43')],_0x41adce);_0x8f5e46[_0x5bae4c](_0x331239[_0x6563('0x72')],_0x331239[_0x6563('0x6a')][_0x6563('0x73')],_0x331239['value'][_0x6563('0x1e')]);}break;case _0x6563('0x2d'):_0x331239=as[_0x6563('0x71')]('me',null,_0x41adce);_0x8f5e46[_0x5bae4c](_0x331239[_0x6563('0x72')],_0x331239[_0x6563('0x6a')][_0x6563('0x73')],_0x331239[_0x6563('0x6a')][_0x6563('0x1e')]);break;}}else{var _0x331239=as[_0x6563('0x71')](_0x21d111,_0x4829ab[_0x6563('0x43')],_0x41adce);_0x8f5e46[_0x5bae4c](_0x331239[_0x6563('0x72')],_0x331239[_0x6563('0x6a')][_0x6563('0x73')],_0x331239[_0x6563('0x6a')]['end']);}}}else{var _0x173574=_(_0x257106[_0x6563('0x47')])[_0x6563('0x45')]()[_0x6563('0x32')](function(_0x2b4801){return _[_0x6563('0x79')](_0x42d54c,[_0x6563('0x2a'),_0x2b4801])?_0x2b4801:undefined;})[_0x6563('0x7a')]()[_0x6563('0x6a')]();if(!_[_0x6563('0x7b')](_0x173574)){_0x173574['forEach'](function(_0x1fd976){if(_0x1fd976===_0x6563('0x7c')){_0x40c99b[_0x6563('0x7d')](_0x6563('0x7e'),[][_0x6563('0x7f')](_0x257106[_0x6563('0x47')][_0x1fd976]));}else if(_0x1fd976===_0x6563('0x80')){var _0x489c26=JSON[_0x6563('0x81')](_0x257106[_0x6563('0x47')][_0x1fd976])[_0x6563('0x82')];var _0x3aaf22=JSON[_0x6563('0x81')](_0x257106[_0x6563('0x47')][_0x1fd976])['$lte'];_0x40c99b[_0x6563('0x7d')](_0x6563('0x83'),_0x489c26,_0x3aaf22);}else{if(_0x257106[_0x6563('0x47')][_0x1fd976]==='null'){_0x40c99b[_0x6563('0x7d')]('i.'+_0x1fd976+_0x6563('0x84'));}else{_0x40c99b[_0x6563('0x7d')]('i.'+_0x1fd976+'\x20=\x20?',_0x257106['query'][_0x1fd976]);}}});}if(_0x257106['query'][_0x6563('0x85')]){if(_0x257106[_0x6563('0x47')][_0x6563('0x85')]==0x1){_0x40c99b[_0x6563('0x6b')]('`unreadMessages`\x20=\x200');}else{_0x40c99b[_0x6563('0x6b')](_0x6563('0x86'));}}if(_0x257106['query']['tag']){_0x39fc04=_[_0x6563('0x87')](_0x257106[_0x6563('0x47')][_0x6563('0x88')])?_0x257106[_0x6563('0x47')]['tag']:new Array(_0x257106[_0x6563('0x47')][_0x6563('0x88')]);_0x39fc04[_0x6563('0x35')](function(_0x22c981){_0x52fffa['or'](_0x6563('0x75'),'%,'+_0x22c981+',%');});}if(_0x257106[_0x6563('0x47')][_0x6563('0x89')]){var _0x142c9a=_0x257106[_0x6563('0x47')]['filter'][_0x6563('0x8a')]('\x5c','\x5c\x5c')[_0x6563('0x8a')](/'/g,'\x27\x27');if(qs[_0x6563('0x8b')](_0x142c9a)){_0x8f5e46['or'](_0x6563('0x8c'),_0x142c9a+'%');}else{_0x8f5e46['or'](_0x6563('0x8d'),qs[_0x6563('0x8e')](_0x142c9a))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x142c9a+'%');}}}_0x40c99b[_0x6563('0x7d')](_0x8f5e46);_0x40c99b[_0x6563('0x8f')](_0x6563('0x90'));var _0x5bec95={'type':db['Sequelize'][_0x6563('0x91')][_0x6563('0x92')],'raw':!![]};var _0x143eb9=_0x40c99b[_0x6563('0x93')]();_0x143eb9[_0x6563('0x50')]('i.id');_0x143eb9['field'](_0x6563('0x94'),'unreadMessages');if(_0x4e0f0a[_0x6563('0x4e')]){_0x4e0f0a['order']['forEach'](function(_0x2014f4){var _0x9eee43=_0x2014f4[0x0]===_0x6563('0x95')?_0x2014f4[0x0]:'i.'+_0x2014f4[0x0];_0x40c99b[_0x6563('0x4e')](_0x9eee43,_0x2014f4[0x1]===_0x6563('0x96')?![]:!![]);});}if(!_[_0x6563('0x7b')](_0x39fc04)){_0x40c99b[_0x6563('0x6b')](_0x52fffa);_0x143eb9[_0x6563('0x7d')]('t.id\x20IN\x20?',_0x39fc04);}BPromise[_0x6563('0x97')]()[_0x6563('0x26')](function(){if(!_0x49c1e0){if(_0x257106[_0x6563('0x47')][_0x6563('0x7c')])return;_0x143eb9['where'](_0x6563('0x98'));_0x40c99b['where'](_0x6563('0x98'));return;}if(_0x257106[_0x6563('0x99')][_0x6563('0x9a')]!==_0x6563('0x2f'))return;return _0x257106[_0x6563('0x99')][_0x6563('0x9b')]({'attributes':['id'],'raw':!![]})[_0x6563('0x26')](function(_0x32623a){if(_[_0x6563('0x7b')](_0x32623a)){_0x143eb9[_0x6563('0x7d')](_0x6563('0x9c'));_0x40c99b[_0x6563('0x7d')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x143eb9[_0x6563('0x7d')]('i.ChatWebsiteId\x20IN\x20?',_[_0x6563('0x32')](_0x32623a,'id'));_0x40c99b[_0x6563('0x7d')](_0x6563('0x7e'),_[_0x6563('0x32')](_0x32623a,'id'));}});})[_0x6563('0x26')](function(){if(_0x257106[_0x6563('0x99')][_0x6563('0x9a')]===_0x6563('0x2f')&&!_0x49c1e0&&!_0x257106[_0x6563('0x47')][_0x6563('0x7c')])return[];return db[_0x6563('0x9d')]['query'](_0x143eb9[_0x6563('0x9e')](),_0x5bec95);})[_0x6563('0x26')](function(_0xd233f5){_0x1504ca['count']=_0xd233f5[_0x6563('0x4b')];if(_0x1504ca[_0x6563('0x22')]===0x0)return[];return db[_0x6563('0x9d')][_0x6563('0x47')](_0x5c8274[_0x6563('0x9e')](),_0x5bec95)[_0x6563('0x26')](function(_0x563412){_0x55e002=_[_0x6563('0x9f')](_0x563412,'id');_0x5bec95=_[_0x6563('0xa0')](_0x5bec95,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x257106[_0x6563('0x47')]['fields']){_0x4e0f0a['attributes'][_0x6563('0x35')](function(_0x2bcba1){_0x40c99b[_0x6563('0x50')]('i.'+_0x2bcba1);});}else{_0x40c99b[_0x6563('0x50')](_0x6563('0x94'),_0x6563('0x69'));_0x40c99b[_0x6563('0x50')](_0x6563('0xa1'),_0x6563('0xa2'));_0x40c99b[_0x6563('0x50')]('a.mandatoryDisposition',_0x6563('0xa3'));_0x40c99b[_0x6563('0x50')]('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');_0x40c99b[_0x6563('0x50')](_0x6563('0xa4'));_0x40c99b[_0x6563('0x50')](_0x6563('0xa5'),'Contact.firstName');_0x40c99b[_0x6563('0x50')]('c.lastName',_0x6563('0xa6'));_0x40c99b[_0x6563('0x50')](_0x6563('0xa7'),_0x6563('0xa8'));_0x40c99b[_0x6563('0x50')](_0x6563('0xa9'),'Contact.phone');_0x40c99b['field'](_0x6563('0xaa'),_0x6563('0xab'));_0x40c99b['field'](_0x6563('0xac'),'Contact.fax');_0x40c99b['field'](_0x6563('0xad'),_0x6563('0xae'));_0x40c99b[_0x6563('0x50')](_0x6563('0xaf'),'Owner.internal');_0x40c99b[_0x6563('0x50')](_0x6563('0xb0'),_0x6563('0x34'));}if(_0x4e0f0a[_0x6563('0x21')])_0x40c99b[_0x6563('0x21')](_0x4e0f0a[_0x6563('0x21')]);if(_0x4e0f0a[_0x6563('0x23')])_0x40c99b['offset'](_0x4e0f0a[_0x6563('0x23')]);return db[_0x6563('0x9d')][_0x6563('0x47')](_0x40c99b[_0x6563('0x9e')](),_0x5bec95);})['then'](function(_0x4a12c8){if(_0x4a12c8[_0x6563('0x4b')]>0x0)_0x32ebac[_0x6563('0x7d')](_0x6563('0xb1'),_[_0x6563('0x32')](_0x4a12c8,'id'));return db[_0x6563('0x9d')][_0x6563('0x47')](_0x32ebac[_0x6563('0x9e')](),_0x5bec95)[_0x6563('0x26')](function(_0x2deafc){var _0x59b0b9=_['groupBy'](_0x2deafc,_0x6563('0xb2'));var _0x822c8=[];_0x4a12c8[_0x6563('0x35')](function(_0x2fb4b1){_0x822c8[_0x6563('0x36')](updateChatInteraction(_0x2fb4b1,_0x55e002,_0x59b0b9));});return BPromise[_0x6563('0xb3')](_0x822c8);});});})['then'](function(_0x355453){_0x1504ca[_0x6563('0xb4')]=_0x355453;return _0x1504ca;})[_0x6563('0x26')](respondWithFilteredResult(_0x1032eb,_0x4e0f0a))[_0x6563('0x1d')](handleError(_0x1032eb,null));};exports[_0x6563('0xb5')]=function(_0x42171f,_0x1192f4){var _0x54148d={'raw':![],'where':{'id':_0x42171f[_0x6563('0xb6')]['id']}},_0x1a553d={};_0x1a553d[_0x6563('0x44')]=_[_0x6563('0x45')](db['ChatInteraction'][_0x6563('0x41')]);_0x1a553d[_0x6563('0x47')]=_[_0x6563('0x45')](_0x42171f[_0x6563('0x47')]);_0x1a553d[_0x6563('0x46')]=_[_0x6563('0x49')](_0x1a553d[_0x6563('0x44')],_0x1a553d['query']);_0x54148d['attributes']=_[_0x6563('0x49')](_0x1a553d[_0x6563('0x44')],qs[_0x6563('0x4a')](_0x42171f[_0x6563('0x47')]['fields']));_0x54148d['attributes']=_0x54148d[_0x6563('0x48')][_0x6563('0x4b')]?_0x54148d['attributes']:_0x1a553d[_0x6563('0x44')];if(_0x42171f['query'][_0x6563('0xb7')]){_0x54148d['include']=[{'all':!![]}];}_0x54148d=_[_0x6563('0xa0')]({},_0x54148d,_0x42171f[_0x6563('0xb8')]);return db[_0x6563('0xb9')]['find'](_0x54148d)[_0x6563('0x26')](handleEntityNotFound(_0x1192f4,null))[_0x6563('0x26')](respondWithResult(_0x1192f4,null))[_0x6563('0x1d')](handleError(_0x1192f4,null));};exports[_0x6563('0xba')]=function(_0x40a68a,_0x1692c4){return db['ChatInteraction'][_0x6563('0xba')](_0x40a68a[_0x6563('0x2d')],{})[_0x6563('0x26')](respondWithResult(_0x1692c4,0xc9))[_0x6563('0x1d')](handleError(_0x1692c4,null));};exports[_0x6563('0x25')]=function(_0x35bdff,_0x44e5c4){if(_0x35bdff[_0x6563('0x2d')]['id']){delete _0x35bdff['body']['id'];}return db[_0x6563('0xb9')]['find']({'where':{'id':_0x35bdff[_0x6563('0xb6')]['id']}})[_0x6563('0x26')](handleEntityNotFound(_0x44e5c4,null))['then'](saveUpdates(_0x35bdff[_0x6563('0x2d')],null))[_0x6563('0x26')](respondWithResult(_0x44e5c4,null))[_0x6563('0x1d')](handleError(_0x44e5c4,null));};exports[_0x6563('0x27')]=function(_0x367404,_0x76476e){return db[_0x6563('0xb9')]['find']({'where':{'id':_0x367404[_0x6563('0xb6')]['id']}})[_0x6563('0x26')](handleEntityNotFound(_0x76476e,null))[_0x6563('0x26')](removeEntity(_0x76476e,null))[_0x6563('0x1d')](handleError(_0x76476e,null));};exports[_0x6563('0xbb')]=function(_0x298704,_0x2221de){return db['ChatInteraction']['describe']()['then'](respondWithResult(_0x2221de,null))[_0x6563('0x1d')](handleError(_0x2221de,null));};exports[_0x6563('0xbc')]=function(_0x4f51f4,_0x20e323){var _0x39c44e=_0x4f51f4[_0x6563('0xb6')]['id'];var _0x472c6b;var _0x9aec93;var _0x60af4;return db[_0x6563('0xb9')]['findOne']({'where':{'id':_0x39c44e}})[_0x6563('0x26')](function(_0x392dca){_0x472c6b=_0x392dca;return db[_0x6563('0xbd')][_0x6563('0xbe')]({'where':{'id':_0x392dca[_0x6563('0x7c')]},'attributes':['id',_0x6563('0xbf'),_0x6563('0xc0'),_0x6563('0xc1'),'vidaooNote',_0x6563('0xc2')],'raw':!![]});})['then'](function(_0xb1e285){if(_0xb1e285&&_0xb1e285[_0x6563('0xbf')]&&_0xb1e285[_0x6563('0xc0')]){_0x9aec93=_0xb1e285;var _0x39ad28={'interaction':{'id':_0x39c44e},'agent':{'id':_0x4f51f4['user']['id'],'name':_0x4f51f4[_0x6563('0x99')][_0x6563('0x2a')],'fullname':_0x4f51f4[_0x6563('0x99')][_0x6563('0xc3')],'email':_0x4f51f4[_0x6563('0x99')][_0x6563('0xc4')]},'contact':_0x4f51f4[_0x6563('0x2d')][_0x6563('0x2e')],'account':_0x4f51f4['body'][_0x6563('0x31')]};var _0x4ac568={'rejectUnauthorized':![],'method':_0x6563('0xc5'),'url':_0x6563('0xc6'),'headers':{'X-APIKEY':_0xb1e285[_0x6563('0xbf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4f51f4[_0x6563('0x99')][_0x6563('0xc4')]],'buttons':null,'topic':_0x9aec93['vidaooTopic'],'note':_['isNull'](_0x9aec93['vidaooNote'])?null:getMustacheRender(_0x9aec93[_0x6563('0xc7')],_0x39ad28),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x6563('0xc8')](_0x9aec93['vidaooMetadata'])){var _0x26e00c=getMustacheRender(_0x9aec93[_0x6563('0xc2')],_0x39ad28);var _0x1e75f7=JSON[_0x6563('0x81')](_0x26e00c);_0x4ac568[_0x6563('0x2d')][_0x6563('0xc9')]=_0x1e75f7;}}catch(_0x5d22bd){throw new db['Sequelize'][(_0x6563('0xca'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x4ac568);}else{throw new db[(_0x6563('0xcb'))][(_0x6563('0xca'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x6563('0x26')](function(_0x5babf2){_0x60af4=_0x5babf2;if(_0x60af4['id']){var _0x4b223f={'body':_0x60af4[_0x6563('0xcc')],'ChatWebsiteId':_0x9aec93['id'],'ChatInteractionId':_0x472c6b['id'],'direction':_0x6563('0xcd'),'UserId':_0x4f51f4[_0x6563('0x99')]['id']};return db[_0x6563('0xce')][_0x6563('0xba')](_0x4b223f,{});}else{throw new db['Sequelize'][(_0x6563('0xca'))](_0x6563('0xcf'));}})[_0x6563('0x26')](function(){return _0x472c6b[_0x6563('0xd0')]({'vidaooSessionId':_0x60af4['id']});})[_0x6563('0x26')](respondWithResult(_0x20e323,null))[_0x6563('0x1d')](handleError(_0x20e323,null));};exports[_0x6563('0xd1')]=function(_0x123b5e,_0x35cbd2){if(_0x123b5e[_0x6563('0x2d')]['id']){delete _0x123b5e[_0x6563('0x2d')]['id'];}return db[_0x6563('0xb9')][_0x6563('0x68')]({'where':{'id':_0x123b5e[_0x6563('0xb6')]['id']},'include':[{'model':db[_0x6563('0xd2')],'as':_0x6563('0xd3')}]})[_0x6563('0x26')](handleEntityNotFound(_0x35cbd2,null))[_0x6563('0x26')](saveUpdates(_0x123b5e[_0x6563('0x2d')],null))['then'](respondWithResult(_0x35cbd2,null))[_0x6563('0x1d')](handleError(_0x35cbd2,null));};exports[_0x6563('0xd4')]=function(_0x1a8f03,_0x47298a){if(_0x1a8f03[_0x6563('0x2d')]['id']){delete _0x1a8f03[_0x6563('0x2d')]['id'];}return db[_0x6563('0xb9')][_0x6563('0x68')]({'where':{'id':_0x1a8f03[_0x6563('0xb6')]['id']}})['then'](function(_0xdcdeb8){if(!_0xdcdeb8){logger['error'](_0x6563('0xd5'),_0x6563('0xd4'),0x194,_0x6563('0xd6'));_0x47298a['sendStatus'](0x194);}else{if(_0xdcdeb8[_0x6563('0x3c')]){throw new db[(_0x6563('0xcb'))]['ValidationError'](_0x6563('0xd7'));}}return _0xdcdeb8;})[_0x6563('0x26')](function(_0x3b8422){if(_0x3b8422){return _0x3b8422['update']({'closed':_0x1a8f03[_0x6563('0x2d')]['closed'],'disposition':_0x1a8f03[_0x6563('0x2d')][_0x6563('0x3e')]})['then'](function(_0xf16e8){return _0xf16e8;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0x6563('0xd4'),_0x1a8f03[_0x6563('0x2d')],client9004);})[_0x6563('0x26')](respondWithResult(_0x47298a,null))[_0x6563('0x1d')](handleError(_0x47298a,null));};exports[_0x6563('0xd8')]=function(_0x32f037,_0x32ee06){_0x32f037[_0x6563('0x2d')][_0x6563('0x2a')]=_0x32f037[_0x6563('0xd9')][_0x6563('0xda')];_0x32f037[_0x6563('0x2d')][_0x6563('0xdb')]=_0x32f037[_0x6563('0xd9')]['filename'];_0x32f037[_0x6563('0x2d')][_0x6563('0x43')]=_0x32f037[_0x6563('0xd9')]['mimetype'];return db[_0x6563('0xdc')]['create'](_0x32f037[_0x6563('0x2d')])[_0x6563('0x26')](respondWithResult(_0x32ee06,0xc9))[_0x6563('0x1d')](handleError(_0x32ee06,null));};exports['attachmentDownload']=function(_0x474a74,_0x425980){return db['ChatInteraction'][_0x6563('0xbe')]({'where':{'id':_0x474a74[_0x6563('0xb6')]['id']},'raw':!![]})[_0x6563('0x26')](handleEntityNotFound(_0x425980,null))[_0x6563('0x26')](function(_0x3c8318){if(_0x3c8318){if(_0x3c8318['closed']){return _0x425980[_0x6563('0x1f')](0x193)[_0x6563('0xdd')]({'status':0x193,'message':'Unauthorized'});}return db[_0x6563('0xdc')]['findOne']({'where':{'id':_0x474a74['query'][_0x6563('0xde')]},'raw':!![]})[_0x6563('0x26')](handleEntityNotFound(_0x425980,null));}})[_0x6563('0x26')](function(_0x108511){if(_0x108511){var _0x12a51c=_0x108511[_0x6563('0xdf')]!==null;var _0x355f23=path[_0x6563('0xe0')](config[_0x6563('0xe1')],_0x6563('0xe2'));if(_0x12a51c){_0x355f23=path['join'](_0x355f23,_0x6563('0xe3'));}var _0x401aec=path[_0x6563('0xe0')](_0x355f23,_0x108511[_0x6563('0xdb')]);return _0x425980[_0x6563('0xe4')](_0x401aec);}})[_0x6563('0x1d')](handleError(_0x425980,null));};exports['close']=function(_0x46664e,_0x11f51d){var _0x2cd600=null;var _0x1883d0=null;var _0x42100b=null;if(_0x46664e[_0x6563('0x2d')]['id']){delete _0x46664e[_0x6563('0x2d')]['id'];}if(_0x46664e[_0x6563('0x2d')][_0x6563('0xe5')]){_0x42100b=path[_0x6563('0xe0')](config['root'],'server/files/chat/upload/',util[_0x6563('0xe6')]('transcript-%s.txt',Date[_0x6563('0xe7')]()));_0x46664e[_0x6563('0x2d')][_0x6563('0xe8')]=_0x42100b;}return db['ChatInteraction']['find']({'where':{'id':_0x46664e[_0x6563('0xb6')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x6563('0x77')],'as':'User'}]}]})[_0x6563('0x26')](handleEntityNotFound(_0x11f51d,null))[_0x6563('0x26')](saveUpdates(_0x46664e[_0x6563('0x2d')],null))['then'](function(_0x4d30d8){if(_0x4d30d8){_0x2cd600=_0x4d30d8;return db[_0x6563('0xbd')]['find']({'where':{'id':_0x2cd600[_0x6563('0x7c')]}});}})[_0x6563('0x26')](function(_0x30c100){if(_0x30c100){_0x1883d0=_0x30c100;return db[_0x6563('0xd2')][_0x6563('0x68')]({'where':{'id':_0x2cd600[_0x6563('0x70')]}});}})[_0x6563('0x26')](function(_0x23c5dc){if(_0x23c5dc){if(_0x42100b){var _0x7225ad=null;for(var _0x27c154=0x1;_0x27c154<_0x2cd600[_0x6563('0xe9')][_0x6563('0x4b')];++_0x27c154){_0x7225ad=_0x2cd600[_0x6563('0xe9')][_0x27c154];var _0x1b4885=_0x7225ad[_0x6563('0x3c')]?util[_0x6563('0xe6')](_0x6563('0xea'),_0x1883d0[_0x6563('0xeb')],_0x7225ad[_0x6563('0x3c')]):_0x6563('0xec');var _0x43077f=_0x46664e[_0x6563('0x2d')][_0x6563('0xed')]||util[_0x6563('0xe6')](_0x6563('0xea'),'Visitor',_0x7225ad['ContactId']);switch(_0x1883d0[_0x6563('0xee')]){case _0x6563('0xef'):_0x1b4885=_0x7225ad['UserId']?util[_0x6563('0xe6')](_0x6563('0xea'),_0x1883d0['agentAlias'],_0x7225ad[_0x6563('0x3c')]):_0x6563('0xec');break;case _0x6563('0xf0'):_0x1b4885=_0x7225ad[_0x6563('0x3c')]?_0x7225ad[_0x6563('0x77')][_0x6563('0xf1')]||_0x7225ad['User']['fullname']:_0x6563('0xec');break;case _0x6563('0xf2'):_0x1b4885=_0x7225ad[_0x6563('0x3c')]?_0x7225ad['User'][_0x6563('0xc3')]:_0x6563('0xec');break;default:_0x1b4885=_0x7225ad[_0x6563('0x3c')]?util[_0x6563('0xe6')](_0x6563('0xea'),_0x1883d0[_0x6563('0xeb')],_0x7225ad[_0x6563('0x3c')]):'System';}var _0x15bce2=util[_0x6563('0xe6')](_0x6563('0xf3'),moment(_0x7225ad['createdAt'])[_0x6563('0xe6')](_0x6563('0xf4')),_0x7225ad['direction']==='in'?_0x43077f:_0x1b4885,_0x7225ad[_0x6563('0x2d')]);if(!_0x7225ad['secret']){fs[_0x6563('0xf5')](_0x42100b,_0x15bce2);}}return db[_0x6563('0xf6')][_0x6563('0xbe')]({'where':{'service':!![]},'include':[{'model':db[_0x6563('0xf7')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x6563('0xf8')],'as':_0x6563('0xf8'),'raw':!![]}]}]});}}})[_0x6563('0x26')](function(_0x183752){if(!_0x183752||!_0x183752[_0x6563('0xf9')]||!_0x46664e[_0x6563('0x2d')])return _0x2cd600;var _0x1ce2bb=_0x183752['getSmtpOptions']();return respondWithRpcPromise(_0x6563('0xfa'),_0x6563('0xfb'),{'account':_0x1ce2bb,'message':{'from':util[_0x6563('0xe6')](_0x6563('0xfc'),_0x183752[_0x6563('0x2a')],_0x183752[_0x6563('0xc4')]||_0x183752['Smtp'][_0x6563('0x99')]),'to':_0x46664e[_0x6563('0x2d')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x6563('0xe6')](_0x6563('0xfd'),_0x46664e[_0x6563('0x2d')]['mailTranscript']),'attachments':[{'path':_0x42100b}]}})[_0x6563('0x26')](function(){return _0x2cd600;})[_0x6563('0x1d')](function(_0xb6a8fc){logger[_0x6563('0x1a')](_0xb6a8fc);});})['then'](respondWithStatusCode(_0x11f51d,0xc8))['catch'](handleError(_0x11f51d,null));};exports[_0x6563('0xfe')]=function(_0x207bc3,_0x572f9f){return db[_0x6563('0xce')][_0x6563('0x68')]({'where':{'id':_0x207bc3[_0x6563('0xb6')]['id']}})[_0x6563('0x26')](handleEntityNotFound(_0x572f9f,null))[_0x6563('0x26')](function(_0x2d5cdc){if(_0x2d5cdc){return _0x2d5cdc[_0x6563('0xfe')](_0x207bc3[_0x6563('0x2d')]['ids'],_[_0x6563('0xff')](_0x207bc3[_0x6563('0x2d')],[_0x6563('0x100'),'id'])||{});}})[_0x6563('0x26')](respondWithResult(_0x572f9f,null))[_0x6563('0x1d')](handleError(_0x572f9f,null));};exports['getMessages']=function(_0x6fc07c,_0x3f1050){var _0x2847e0={'raw':![],'where':{}};var _0x15fccc={};var _0x14fa16={'count':0x0,'rows':[]};return db[_0x6563('0xb9')][_0x6563('0xbe')]({'where':{'id':_0x6fc07c['params']['id']}})[_0x6563('0x26')](handleEntityNotFound(_0x3f1050,null))[_0x6563('0x26')](function(_0x165efe){if(_0x165efe){_0x15fccc[_0x6563('0x44')]=_[_0x6563('0x45')](db[_0x6563('0xce')][_0x6563('0x41')]);_0x15fccc[_0x6563('0x47')]=_[_0x6563('0x45')](_0x6fc07c[_0x6563('0x47')]);_0x15fccc[_0x6563('0x46')]=_[_0x6563('0x49')](_0x15fccc['model'],_0x15fccc['query']);_0x2847e0[_0x6563('0x48')]=_[_0x6563('0x49')](_0x15fccc['model'],qs[_0x6563('0x4a')](_0x6fc07c[_0x6563('0x47')]['fields']));_0x2847e0['attributes']=_0x2847e0['attributes'][_0x6563('0x4b')]?_0x2847e0[_0x6563('0x48')]:_0x15fccc['model'];if(!_0x6fc07c[_0x6563('0x47')]['hasOwnProperty'](_0x6563('0x4d'))){_0x2847e0[_0x6563('0x21')]=qs['limit'](_0x6fc07c[_0x6563('0x47')][_0x6563('0x21')]);_0x2847e0[_0x6563('0x23')]=qs[_0x6563('0x23')](_0x6fc07c[_0x6563('0x47')]['offset']);}_0x2847e0[_0x6563('0x4e')]=qs['sort'](_0x6fc07c[_0x6563('0x47')][_0x6563('0x4f')]);_0x2847e0[_0x6563('0x7d')]=qs['filters'](_[_0x6563('0x101')](_0x6fc07c['query'],_0x15fccc[_0x6563('0x46')]));_0x2847e0[_0x6563('0x7d')][_0x6563('0xb2')]=_0x165efe['id'];if(_0x6fc07c[_0x6563('0x47')]['filter']){_0x2847e0[_0x6563('0x7d')]=_[_0x6563('0xa0')](_0x2847e0[_0x6563('0x7d')],{'$or':_[_0x6563('0x32')](_0x2847e0[_0x6563('0x48')],function(_0x422cd3){var _0x5a3361={};_0x5a3361[_0x422cd3]={'$like':'%'+_0x6fc07c['query'][_0x6563('0x89')]+'%'};return _0x5a3361;})});}if(_0x6fc07c[_0x6563('0x47')]['$gte']){var _0x4c5265=_0x6fc07c[_0x6563('0x47')][_0x6563('0x82')]['split'](',');var _0x38ae7f={};_0x38ae7f[_0x4c5265[0x0]]={'$gte':moment(_0x4c5265[0x1])[_0x6563('0xe6')](_0x6563('0x102'))};_0x2847e0[_0x6563('0x7d')]=_[_0x6563('0xa0')](_0x2847e0[_0x6563('0x7d')],_0x38ae7f);}_0x2847e0=_[_0x6563('0xa0')]({},_0x2847e0,_0x6fc07c['options']);return db[_0x6563('0xce')][_0x6563('0x22')]({'where':_0x2847e0[_0x6563('0x7d')]})[_0x6563('0x26')](function(_0xf613d){_0x14fa16[_0x6563('0x22')]=_0xf613d;if(_0x6fc07c['query']['includeAll']){_0x2847e0[_0x6563('0x103')]=[{'all':!![]}];}return db[_0x6563('0xce')][_0x6563('0x104')](_0x2847e0);})['then'](function(_0x20845d){_0x14fa16[_0x6563('0xb4')]=_0x20845d;return _0x14fa16;});}})['then'](respondWithFilteredResult(_0x3f1050,_0x2847e0))[_0x6563('0x1d')](handleError(_0x3f1050,null));};exports[_0x6563('0x105')]=function(_0x16d9c0,_0x49cccf){var _0x302287={'where':{}},_0x386a90={},_0x454b00={'count':0x0,'rows':[]};return db[_0x6563('0xb9')][_0x6563('0xbe')]({'where':{'id':_0x16d9c0[_0x6563('0xb6')]['id']}})[_0x6563('0x26')](handleEntityNotFound(_0x49cccf,null))[_0x6563('0x26')](function(_0x395fd4){if(_0x395fd4){_0x386a90[_0x6563('0x44')]=_['keys'](db['ChatMessage'][_0x6563('0x41')]);_0x386a90[_0x6563('0x47')]=_['keys'](_0x16d9c0['query']);_0x386a90[_0x6563('0x46')]=_[_0x6563('0x49')](_0x386a90[_0x6563('0x44')],_0x386a90[_0x6563('0x47')]);_0x302287['attributes']=_['intersection'](_0x386a90['model'],qs['fields'](_0x16d9c0[_0x6563('0x47')]['fields']));_0x302287[_0x6563('0x48')]=_0x302287[_0x6563('0x48')]['length']?_0x302287[_0x6563('0x48')]:_0x386a90['model'];if(!_0x16d9c0['query']['hasOwnProperty'](_0x6563('0x4d'))){_0x302287[_0x6563('0x21')]=qs['limit'](_0x16d9c0['query'][_0x6563('0x21')]);_0x302287[_0x6563('0x23')]=qs[_0x6563('0x23')](_0x16d9c0[_0x6563('0x47')]['offset']);}_0x302287[_0x6563('0x4e')]=qs['sort'](_0x16d9c0[_0x6563('0x47')]['sort']);_0x302287[_0x6563('0x7d')]=qs[_0x6563('0x46')](_[_0x6563('0x101')](_0x16d9c0['query'],_0x386a90['filters']));_0x302287[_0x6563('0x7d')][_0x6563('0xb2')]=_0x395fd4['id'];if(_0x16d9c0[_0x6563('0x47')][_0x6563('0x89')]){_0x302287['where']=_['merge'](_0x302287['where'],{'$or':_[_0x6563('0x32')](_0x302287[_0x6563('0x48')],function(_0x88b2d9){var _0x118d14={};_0x118d14[_0x88b2d9]={'$like':'%'+_0x16d9c0[_0x6563('0x47')]['filter']+'%'};return _0x118d14;})});}_0x302287[_0x6563('0x7d')][_0x6563('0x106')]=![];if(_0x16d9c0[_0x6563('0x47')]['id']){_0x302287['where']['id']={'$gt':_0x16d9c0[_0x6563('0x47')]['id']};}_0x302287=_['merge']({},_0x302287,_0x16d9c0[_0x6563('0xb8')]);return db[_0x6563('0xce')]['count']({'where':_0x302287['where']})[_0x6563('0x26')](function(_0x15eefb){_0x454b00[_0x6563('0x22')]=_0x15eefb;_0x302287[_0x6563('0x103')]=[];if(_0x16d9c0[_0x6563('0x47')]['includeAgent']){_0x302287[_0x6563('0x103')]['push']({'model':db[_0x6563('0x77')],'as':'User','attributes':['id',_0x6563('0xc3'),_0x6563('0xf1')]});}if(_0x16d9c0['query']['includeAll']){_0x302287[_0x6563('0x103')]=[{'all':!![]}];}return db[_0x6563('0xce')][_0x6563('0x104')](_0x302287);})[_0x6563('0x26')](function(_0x3cef21){_0x454b00[_0x6563('0xb4')]=_0x3cef21;return _0x454b00;});}})[_0x6563('0x26')](respondWithFilteredResult(_0x49cccf,_0x302287))[_0x6563('0x1d')](handleError(_0x49cccf,null));};exports[_0x6563('0x107')]=function(_0x28c4e1,_0x12681c){return db[_0x6563('0xb9')][_0x6563('0x68')]({'where':{'id':_0x28c4e1[_0x6563('0xb6')]['id']}})[_0x6563('0x26')](handleEntityNotFound(_0x12681c,null))[_0x6563('0x26')](function(_0x2dcf31){if(_0x2dcf31){return _0x2dcf31[_0x6563('0x108')](_0x28c4e1[_0x6563('0x2d')]['ids'],_[_0x6563('0xff')](_0x28c4e1['body'],[_0x6563('0x100'),'id'])||{})['spread'](function(){return db['Tag'][_0x6563('0x104')]({'attributes':['id',_0x6563('0x2a'),_0x6563('0x51')],'where':{'id':_0x28c4e1[_0x6563('0x2d')]['ids']}});})[_0x6563('0x26')](function(_0x1abbd2){socket[_0x6563('0x109')](_0x6563('0x10a'),{'id':Number(_0x28c4e1[_0x6563('0xb6')]['id']),'tags':_0x1abbd2||[]});return{'id':Number(_0x28c4e1[_0x6563('0xb6')]['id']),'tags':_0x1abbd2||[]};});}})[_0x6563('0x26')](respondWithResult(_0x12681c,null))['catch'](handleError(_0x12681c,null));};exports[_0x6563('0x10b')]=function(_0x4dd4fc,_0x5260ee){return db[_0x6563('0xb9')][_0x6563('0x68')]({'where':{'id':_0x4dd4fc[_0x6563('0xb6')]['id']}})['then'](handleEntityNotFound(_0x5260ee,null))[_0x6563('0x26')](function(_0xf8aa3d){if(_0xf8aa3d){return _0xf8aa3d[_0x6563('0x10b')](_0x4dd4fc['query'][_0x6563('0x100')]);}})[_0x6563('0x26')](respondWithStatusCode(_0x5260ee,null))[_0x6563('0x1d')](handleError(_0x5260ee,null));};exports[_0x6563('0xe4')]=function(_0x1e38cb,_0x51a23d){var _0x5dc7ac=moment()['unix']()[_0x6563('0x9e')]();var _0x3a86fb=path[_0x6563('0xe0')](config[_0x6563('0xe1')],_0x6563('0x10c'),'files',_0x6563('0x10d'));var _0x58f8bb=path['join'](config[_0x6563('0xe1')],'server',_0x6563('0x10e'),'attachments');var _0x169e28=path[_0x6563('0xe0')](_0x3a86fb,_0x5dc7ac);var _0x266576=util['format']('transcript-%d-%s.zip',_0x1e38cb[_0x6563('0xb6')]['id'],_0x5dc7ac);var _0x232cb1=path[_0x6563('0xe0')](_0x3a86fb,_0x266576);var _0x3ae6c9=[];_0x3ae6c9[_0x6563('0x36')]({'model':db[_0x6563('0x77')],'as':_0x6563('0x77'),'attributes':['id',_0x6563('0xc3')],'raw':!![]});_0x3ae6c9[_0x6563('0x36')]({'model':db['CmContact'],'as':_0x6563('0xd3'),'attributes':['id',_0x6563('0x10f'),_0x6563('0x110')],'raw':!![]});if(_0x1e38cb['query']['attachments']){_0x3ae6c9[_0x6563('0x36')]({'model':db['Attachment'],'as':_0x6563('0xdc'),'raw':!![]});}var _0x4dcbf1=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0x6563('0x2d'),_0x6563('0x80'),_0x6563('0x111'),_0x6563('0x106'),_0x6563('0x85')],'include':_0x3ae6c9}];_0x4dcbf1[_0x6563('0x36')]({'model':db[_0x6563('0xbd')],'as':_0x6563('0x112'),'attributes':['id',_0x6563('0x2a')]});_0x4dcbf1[_0x6563('0x36')]({'model':db[_0x6563('0x77')],'as':_0x6563('0x113'),'attributes':['id',_0x6563('0xc3')]});return db[_0x6563('0xb9')][_0x6563('0x68')]({'where':{'id':_0x1e38cb['params']['id']},'include':_0x4dcbf1})[_0x6563('0x26')](handleEntityNotFound(_0x51a23d,null))[_0x6563('0x26')](function(_0x10ce72){if(_0x10ce72){var _0x39daee=_0x10ce72[_0x6563('0x114')]({'plain':!![]});fs[_0x6563('0x115')](_0x169e28);var _0x5db6ff={'channel':_0x6563('0x116'),'account':_0x39daee['Account']['name'],'agent':_0x39daee[_0x6563('0x113')]?_0x39daee[_0x6563('0x113')][_0x6563('0xc3')]:'N.A.','createdAt':moment(_0x39daee[_0x6563('0x80')])[_0x6563('0xe6')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6563('0x9e')](),'closedAt':_0x39daee[_0x6563('0x3b')]?moment(_0x39daee[_0x6563('0x117')])[_0x6563('0xe6')](_0x6563('0x102'))['toString']():'','disposition':_0x39daee[_0x6563('0x3e')],'chatInfo':{'browser':_0x39daee[_0x6563('0x118')],'os':_0x39daee[_0x6563('0x119')],'referer':_0x39daee['referer'],'customerIp':_0x39daee['customerIp'],'customerPort':_0x39daee[_0x6563('0x11a')]?_0x39daee[_0x6563('0x11a')]:'N.A.'},'messages':_(_0x39daee[_0x6563('0xe9')])[_0x6563('0x11b')]()[_0x6563('0x89')]({'secret':![]})[_0x6563('0x32')](function(_0x3ccef7){if(_0x3ccef7['Attachment']){var _0x109c74=path['join'](_0x58f8bb,_0x3ccef7[_0x6563('0xdc')][_0x6563('0xdb')]);if(fs[_0x6563('0x11c')](_0x109c74)){fs[_0x6563('0x11d')](_0x109c74)[_0x6563('0x11e')](fs[_0x6563('0x11f')](path[_0x6563('0xe0')](_0x169e28,_0x3ccef7[_0x6563('0xdc')][_0x6563('0xdb')])));}}return{'date':moment(_0x3ccef7[_0x6563('0x80')])[_0x6563('0xe6')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6563('0x9e')](),'sender':_0x3ccef7['direction']===_0x6563('0xcd')?_0x3ccef7[_0x6563('0x77')]?_0x3ccef7[_0x6563('0x77')][_0x6563('0xc3')]:_0x6563('0xec'):_0x3ccef7[_0x6563('0xd3')][_0x6563('0x10f')]+(_0x3ccef7[_0x6563('0xd3')][_0x6563('0x110')]?'\x20'+_0x3ccef7[_0x6563('0xd3')][_0x6563('0x110')]:''),'body':_0x3ccef7[_0x6563('0xdc')]?_0x3ccef7['Attachment']['basename']:_0x3ccef7[_0x6563('0x2d')],'direction':_0x3ccef7['direction']===_0x6563('0xcd')?'A':'C','secret':_0x3ccef7[_0x6563('0x106')],'read':_0x3ccef7[_0x6563('0x85')],'attachment':_0x3ccef7['Attachment']};})[_0x6563('0x6a')]()};return ejs[_0x6563('0x120')](path[_0x6563('0xe0')](config[_0x6563('0xe1')],'server',_0x6563('0x121'),_0x6563('0x122')),{'interaction':_0x5db6ff})[_0x6563('0x26')](function(_0x153e78){var _0x6ece24=path['join'](_0x169e28,_0x6563('0x123')+_0x39daee['id']+'-'+_0x5dc7ac+_0x6563('0x124'));var _0x474ec2={'path':_0x6ece24,'channel':_0x6563('0x116'),'interactionId':_0x39daee['id']};return pdf['createPdfFromHTML'](_0x153e78,_0x474ec2);})[_0x6563('0x26')](function(){return new Promise(function(_0x3b1818,_0x1c2e23){zipdir(_0x169e28,{'saveTo':_0x232cb1},function(_0xdf9537,_0x3027f9){if(_0xdf9537)return _0x1c2e23(_0xdf9537);return _0x3b1818(_0x3027f9);});})[_0x6563('0x26')](function(){return new BPromise(function(_0x88eb81,_0x3c2fb6){rimraf(_0x169e28,function(_0x40f56c){if(_0x40f56c)_0x3c2fb6(_0x40f56c);return _0x88eb81();});});})[_0x6563('0x26')](function(){return _0x51a23d['download'](_0x232cb1,_0x266576,function(_0x3efd40){if(_0x3efd40){logger[_0x6563('0x1a')](_0x6563('0x125'),_0x3efd40);}else{fs[_0x6563('0x126')](_0x232cb1);}});});});}else{return _0x51a23d[_0x6563('0x28')](0xc8);}})[_0x6563('0x1d')](handleError(_0x51a23d,null));};
\ No newline at end of file
+var _0x4bc3=['customer','%s%d','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','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','mailTranscript','addMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','findAll','addTags','setTags','omit','Tag','color','emit','removeTags','unix','server','files','tmp','transcript-%d-%s.zip','firstName','lastName','Account','get','mkdirSync','Owner','N.A.','closedAt','browserName','osName','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','views','downloadInteraction.ejs','.pdf','Chat','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','squel','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','http','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','update','then','destroy','stack','name','send','merge','body','contact','agent','map','fullname','Tags','TagIds','split','push','waiting','answered','unmanaged','abandoned','closed','UserId','talking','disposition','index','ChatInteraction','rawAttributes','fieldName','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','`\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','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','type','keys','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','count','toString','keyBy','fields','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','c.firstName','c.lastName','Contact.lastName','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','params','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','vidaooMetadata','parse','metadata','Error\x20in\x20conversion\x20vidaooMetadata','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','ValidationError','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','transcript-%s.txt','ChatMessage','Messages','format','agentAlias'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x4bc3,0x16e));var _0x34bc=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x4bc3[_0x3d42d8];return _0x27fc41;};'use strict';var rimraf=require(_0x34bc('0x0'));var zipdir=require(_0x34bc('0x1'));var rp=require('request-promise');var moment=require(_0x34bc('0x2'));var BPromise=require(_0x34bc('0x3'));var Mustache=require('mustache');var util=require(_0x34bc('0x4'));var path=require(_0x34bc('0x5'));var ejs=require(_0x34bc('0x6'));var fs=require('fs');var _=require(_0x34bc('0x7'));var squel=require(_0x34bc('0x8'));var Redis=require(_0x34bc('0x9'));var qs=require(_0x34bc('0xa'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x34bc('0xb'));var logger=require('../../config/logger')('api');var config=require(_0x34bc('0xc'));var db=require(_0x34bc('0xd'))['db'];config[_0x34bc('0xe')]=_[_0x34bc('0xf')](config[_0x34bc('0xe')],{'host':_0x34bc('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x34bc('0x11'))[_0x34bc('0x12')](socket);var jayson=require(_0x34bc('0x13'));var client=jayson['client'][_0x34bc('0x14')]({'port':0x232b});var client9004=jayson['client'][_0x34bc('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x124b87,_0x164fb2,_0x536ebd,_0x3f8852){return new BPromise(function(_0x553a7d,_0x12cf72){var _0x43ff68=_0x3f8852||client;return _0x43ff68[_0x34bc('0x15')](_0x124b87,_0x536ebd)['then'](function(_0x4c365a){logger[_0x34bc('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x164fb2,_0x34bc('0x17'));logger[_0x34bc('0x18')](_0x34bc('0x19'),_0x164fb2,_0x34bc('0x17'),JSON[_0x34bc('0x1a')](_0x4c365a));if(_0x4c365a[_0x34bc('0x1b')]){if(_0x4c365a['error']['code']===0x1f4){logger['error'](_0x34bc('0x1c'),_0x164fb2,_0x4c365a[_0x34bc('0x1b')][_0x34bc('0x1d')]);return _0x12cf72(_0x4c365a[_0x34bc('0x1b')]['message']);}logger[_0x34bc('0x1b')](_0x34bc('0x1c'),_0x164fb2,_0x4c365a['error'][_0x34bc('0x1d')]);return _0x553a7d(_0x4c365a[_0x34bc('0x1b')]['message']);}else{logger[_0x34bc('0x16')](_0x34bc('0x1c'),_0x164fb2,_0x34bc('0x17'));_0x553a7d(_0x4c365a[_0x34bc('0x1e')][_0x34bc('0x1d')]);}})[_0x34bc('0x1f')](function(_0x48087e){logger[_0x34bc('0x1b')](_0x34bc('0x1c'),_0x164fb2,_0x48087e);_0x12cf72(_0x48087e);});});}function respondWithStatusCode(_0x38882c,_0x48eb94){_0x48eb94=_0x48eb94||0xcc;return function(_0x4c4b9a){if(_0x4c4b9a){return _0x38882c[_0x34bc('0x20')](_0x48eb94);}return _0x38882c[_0x34bc('0x21')](_0x48eb94)[_0x34bc('0x22')]();};}function respondWithResult(_0x410800,_0x13094a){_0x13094a=_0x13094a||0xc8;return function(_0x2e22e3){if(_0x2e22e3){return _0x410800[_0x34bc('0x21')](_0x13094a)[_0x34bc('0x23')](_0x2e22e3);}};}function respondWithFilteredResult(_0x19472e,_0x25d6fe){return function(_0x2de017){if(_0x2de017){var _0x1edcb0=typeof _0x25d6fe['offset']===_0x34bc('0x24')&&typeof _0x25d6fe['limit']==='undefined';var _0x3da96b=_0x2de017['count'];var _0x4082c3=_0x1edcb0?0x0:_0x25d6fe[_0x34bc('0x25')];var _0x46fd76=_0x1edcb0?_0x2de017['count']:_0x25d6fe[_0x34bc('0x25')]+_0x25d6fe[_0x34bc('0x26')];var _0x384fd7;if(_0x46fd76>=_0x3da96b){_0x46fd76=_0x3da96b;_0x384fd7=0xc8;}else{_0x384fd7=0xce;}_0x19472e[_0x34bc('0x21')](_0x384fd7);return _0x19472e[_0x34bc('0x27')](_0x34bc('0x28'),_0x4082c3+'-'+_0x46fd76+'/'+_0x3da96b)['json'](_0x2de017);}return null;};}function saveUpdates(_0xff07bd){return function(_0x1fb7c5){if(_0x1fb7c5){return _0x1fb7c5[_0x34bc('0x29')](_0xff07bd)[_0x34bc('0x2a')](function(_0x2241b4){return _0x2241b4;});}return null;};}function removeEntity(_0xd92957){return function(_0x5b37de){if(_0x5b37de){return _0x5b37de[_0x34bc('0x2b')]()['then'](function(){_0xd92957['status'](0xcc)[_0x34bc('0x22')]();});}};}function handleEntityNotFound(_0x540aa3){return function(_0x1e8445){if(!_0x1e8445){_0x540aa3[_0x34bc('0x20')](0x194);}return _0x1e8445;};}function handleError(_0xb446f4,_0x452a51){_0x452a51=_0x452a51||0x1f4;return function(_0x1b6264){logger[_0x34bc('0x1b')](_0x1b6264[_0x34bc('0x2c')]);if(_0x1b6264['name']){delete _0x1b6264[_0x34bc('0x2d')];}_0xb446f4[_0x34bc('0x21')](_0x452a51)[_0x34bc('0x2e')](_0x1b6264);};}function getMustacheRender(_0x3224c7,_0x360126){return Mustache['render'](_0x3224c7,_[_0x34bc('0x2f')](_0x360126[_0x34bc('0x30')],{'contact':_0x360126[_0x34bc('0x31')],'message':_0x360126[_0x34bc('0x1d')],'agent':_0x360126[_0x34bc('0x32')],'interaction':_0x360126['interaction'],'account':_0x360126['account']}))||'';}function getInteractionUsers(_0x39e630,_0x6a3bd3){return new BPromise(function(_0xf9453c,_0x128c1c){try{if(_0x6a3bd3[_0x39e630['id']]){_0x39e630['Users']=_[_0x34bc('0x33')](_0x6a3bd3[_0x39e630['id']],function(_0x4477bd){return{'id':_0x4477bd['id'],'fullname':_0x4477bd[_0x34bc('0x34')]};});}}catch(_0x5b6acd){_0x128c1c(_0x5b6acd);}_0xf9453c(_0x39e630);});}function getInteractionTags(_0x37cd30,_0x42d1eb){return new BPromise(function(_0xd0e121,_0x18663c){try{if(_0x37cd30['TagIds']){_0x37cd30[_0x34bc('0x35')]=[];_0x37cd30[_0x34bc('0x36')][_0x34bc('0x37')](',')['forEach'](function(_0x246a86){_0x37cd30[_0x34bc('0x35')][_0x34bc('0x38')](_0x42d1eb[_0x246a86]);});}delete _0x37cd30[_0x34bc('0x36')];}catch(_0x348cea){_0x18663c(_0x348cea);}_0xd0e121(_0x37cd30);});}function updateChatInteraction(_0x4fc2dc,_0xca2aaf,_0x281e81){return new BPromise(function(_0xb66ba0,_0x174cfe){return getInteractionUsers(_0x4fc2dc,_0x281e81)[_0x34bc('0x2a')](function(_0x4bf331){return getInteractionTags(_0x4bf331,_0xca2aaf);})[_0x34bc('0x2a')](function(_0x50f1ee){return getStateInteraction(_0x50f1ee);})[_0x34bc('0x2a')](function(_0x3f07f5){_0xb66ba0(_0x3f07f5);})[_0x34bc('0x1f')](function(_0x384994){_0x174cfe(_0x384994);});});}function getStateInteraction(_0x53feca){return new BPromise(function(_0x11ab9c){_0x53feca[_0x34bc('0x39')]=0x0;_0x53feca['talking']=0x0;_0x53feca[_0x34bc('0x3a')]=0x0;_0x53feca[_0x34bc('0x3b')]=0x0;_0x53feca[_0x34bc('0x3c')]=0x0;_0x53feca['total']=0x0;if(!_0x53feca[_0x34bc('0x3d')]&&!_0x53feca[_0x34bc('0x3e')]){_0x53feca[_0x34bc('0x39')]+=0x1;}if(!_0x53feca[_0x34bc('0x3d')]&&_0x53feca[_0x34bc('0x3e')]){_0x53feca[_0x34bc('0x3f')]+=0x1;if(_0x53feca[_0x34bc('0x39')]){_0x53feca[_0x34bc('0x39')]-=0x1;}}if(_0x53feca[_0x34bc('0x3d')]&&_0x53feca[_0x34bc('0x40')]===_0x34bc('0x3c')){_0x53feca['abandoned']+=0x1;if(_0x53feca['waiting']){_0x53feca[_0x34bc('0x39')]-=0x1;}}else if(_0x53feca[_0x34bc('0x3d')]&&!_0x53feca[_0x34bc('0x3e')]&&_0x53feca[_0x34bc('0x40')]){_0x53feca[_0x34bc('0x3b')]+=0x1;if(_0x53feca[_0x34bc('0x39')]){_0x53feca['waiting']-=0x1;}}else if(_0x53feca[_0x34bc('0x3d')]&&_0x53feca['UserId']){_0x53feca[_0x34bc('0x3a')]+=0x1;if(_0x53feca[_0x34bc('0x3f')]){_0x53feca[_0x34bc('0x3f')]-=0x1;}}_0x53feca['total']+=0x1;_0x11ab9c(_0x53feca);});}exports[_0x34bc('0x41')]=function(_0xf7c0be,_0x1b42f5){var _0x1c6480={},_0x21b903={},_0x26924c={'count':0x0,'rows':[]};var _0xba179d=_[_0x34bc('0x33')](db[_0x34bc('0x42')][_0x34bc('0x43')],function(_0x100c70){return{'name':_0x100c70[_0x34bc('0x44')],'type':_0x100c70['type']['key']};});_0x21b903[_0x34bc('0x45')]=_[_0x34bc('0x33')](_0xba179d,_0x34bc('0x2d'));_0x21b903['query']=_['keys'](_0xf7c0be[_0x34bc('0x46')]);_0x21b903[_0x34bc('0x47')]=_[_0x34bc('0x48')](_0x21b903['model'],_0x21b903[_0x34bc('0x46')]);_0x1c6480[_0x34bc('0x49')]=_['intersection'](_0x21b903[_0x34bc('0x45')],qs['fields'](_0xf7c0be[_0x34bc('0x46')]['fields']));_0x1c6480[_0x34bc('0x49')]=_0x1c6480[_0x34bc('0x49')][_0x34bc('0x4a')]?_0x1c6480[_0x34bc('0x49')]:_0x21b903['model'];if(!_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x4b')](_0x34bc('0x4c'))){_0x1c6480[_0x34bc('0x26')]=qs[_0x34bc('0x26')](_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x26')]);_0x1c6480[_0x34bc('0x25')]=qs['offset'](_0xf7c0be['query']['offset']);}_0x1c6480[_0x34bc('0x4d')]=qs[_0x34bc('0x4e')](_0xf7c0be['query'][_0x34bc('0x4e')]);_0x1c6480[_0x34bc('0x4f')]=qs[_0x34bc('0x47')](_[_0x34bc('0x50')](_0xf7c0be[_0x34bc('0x46')],_0x21b903['filters']),_0xba179d);var _0x5b6497=[];var _0x52d4c7=squel[_0x34bc('0x51')]()[_0x34bc('0x52')]('id')[_0x34bc('0x52')](_0x34bc('0x2d'))[_0x34bc('0x52')]('color')[_0x34bc('0x53')](_0x34bc('0x54'));var _0x3dabaa=squel[_0x34bc('0x51')]()['field'](_0x34bc('0x55'))[_0x34bc('0x52')](_0x34bc('0x56'))[_0x34bc('0x52')](_0x34bc('0x57'))[_0x34bc('0x53')](_0x34bc('0x58'),'ui')[_0x34bc('0x59')](_0x34bc('0x5a'),'u',_0x34bc('0x5b'));var _0x39c580=squel[_0x34bc('0x51')]()[_0x34bc('0x53')]('chat_interactions','i')[_0x34bc('0x59')](_0x34bc('0x5c'),'c',_0x34bc('0x5d'))[_0x34bc('0x59')](_0x34bc('0x5a'),'o',_0x34bc('0x5e'))[_0x34bc('0x59')](_0x34bc('0x5f'),'a',_0x34bc('0x60'))[_0x34bc('0x59')](_0x34bc('0x61'),'me',_0x34bc('0x62'))[_0x34bc('0x59')](_0x34bc('0x63'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x34bc('0x59')](_0x34bc('0x54'),'t',_0x34bc('0x64'));var _0x320d86=squel[_0x34bc('0x65')]();var _0x2b46b8=[];var _0x16ac8a=squel[_0x34bc('0x65')]();var _0x47068c;if(_0xf7c0be[_0x34bc('0x46')]['search']){_0x47068c=as[_0x34bc('0x66')](_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x67')]);var _0x582931=_0x47068c[_0x34bc('0x68')];for(var _0x295420=0x0;_0x295420<_0x47068c[_0x34bc('0x69')][_0x34bc('0x4a')];_0x295420++){var _0x535a53=_0x47068c[_0x34bc('0x69')][_0x295420];var _0x284b55='i';var _0x3701b7=_[_0x34bc('0x6a')](_0xba179d,[_0x34bc('0x2d'),_0x535a53[_0x34bc('0x52')]]);if(!_0x3701b7){switch(_0x535a53[_0x34bc('0x52')]){case _0x34bc('0x6b'):if(_0x535a53['value']==0x1){_0x39c580['having']('`'+_0x535a53[_0x34bc('0x52')]+_0x34bc('0x6c'));}else{_0x39c580[_0x34bc('0x6d')]('`'+_0x535a53[_0x34bc('0x52')]+_0x34bc('0x6e'));}break;case _0x34bc('0x6f'):if(_0x535a53[_0x34bc('0x70')]===_0x34bc('0x71')){if(_0x535a53[_0x34bc('0x72')][_0x34bc('0x37')]('\x20')[_0x34bc('0x4a')]>0x1){_0x320d86[_0x582931](_0x34bc('0x73'),qs[_0x34bc('0x74')](_0x535a53[_0x34bc('0x72')]),null);}else{var _0x4d7c67='%'+_0x535a53[_0x34bc('0x72')]+'%';_0x320d86[_0x582931](_0x34bc('0x75'),_0x4d7c67,_0x4d7c67,_0x4d7c67);}}else{_0x3701b7=_[_0x34bc('0x6a')](_0xba179d,['name',_0x34bc('0x76')]);_0x535a53[_0x34bc('0x52')]=_0x34bc('0x76');_0x348be3=as[_0x34bc('0x77')](_0x284b55,_0x3701b7['type'],_0x535a53);_0x320d86[_0x582931](_0x348be3[_0x34bc('0x78')],_0x348be3[_0x34bc('0x72')][_0x34bc('0x79')],_0x348be3[_0x34bc('0x72')][_0x34bc('0x22')]);}break;case'Tag':var _0xc08131=_0x535a53[_0x34bc('0x72')][_0x34bc('0x37')](',')[_0x34bc('0x33')](function(_0x52b73a){return Number(_0x52b73a);});_0xc08131[_0x34bc('0x7a')](function(_0xb920a6){_0x16ac8a['or'](_0x34bc('0x7b'),'%,'+_0xb920a6+',%');});_0x2b46b8=_[_0x34bc('0x7c')](_0x2b46b8,_0xc08131);break;case _0x34bc('0x7d'):if(_0x535a53[_0x34bc('0x70')]==='$substring'){_0x320d86[_0x582931]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x535a53[_0x34bc('0x72')]+'%',null);}else{_0x3701b7=_[_0x34bc('0x6a')](_0xba179d,['name',_0x34bc('0x3e')]);_0x535a53[_0x34bc('0x52')]=_0x34bc('0x3e');_0x348be3=as[_0x34bc('0x77')](_0x284b55,_0x3701b7['type'],_0x535a53);_0x320d86[_0x582931](_0x348be3['text'],_0x348be3[_0x34bc('0x72')][_0x34bc('0x79')],_0x348be3[_0x34bc('0x72')][_0x34bc('0x22')]);}break;case _0x34bc('0x30'):_0x348be3=as[_0x34bc('0x77')]('me',null,_0x535a53);_0x320d86[_0x582931](_0x348be3[_0x34bc('0x78')],_0x348be3[_0x34bc('0x72')][_0x34bc('0x79')],_0x348be3[_0x34bc('0x72')][_0x34bc('0x22')]);break;}}else{var _0x348be3=as[_0x34bc('0x77')](_0x284b55,_0x3701b7[_0x34bc('0x7e')],_0x535a53);_0x320d86[_0x582931](_0x348be3[_0x34bc('0x78')],_0x348be3[_0x34bc('0x72')]['start'],_0x348be3[_0x34bc('0x72')][_0x34bc('0x22')]);}}}else{var _0x1d9f60=_(_0xf7c0be[_0x34bc('0x46')])[_0x34bc('0x7f')]()['map'](function(_0x415c29){return _[_0x34bc('0x80')](_0xba179d,[_0x34bc('0x2d'),_0x415c29])?_0x415c29:undefined;})[_0x34bc('0x81')]()[_0x34bc('0x72')]();if(!_['isEmpty'](_0x1d9f60)){_0x1d9f60[_0x34bc('0x7a')](function(_0x3dbf1b){if(_0x3dbf1b===_0x34bc('0x82')){_0x39c580[_0x34bc('0x4f')](_0x34bc('0x83'),[][_0x34bc('0x84')](_0xf7c0be['query'][_0x3dbf1b]));}else if(_0x3dbf1b===_0x34bc('0x85')){var _0xcdbda5=JSON['parse'](_0xf7c0be[_0x34bc('0x46')][_0x3dbf1b])[_0x34bc('0x86')];var _0xd0213e=JSON['parse'](_0xf7c0be['query'][_0x3dbf1b])[_0x34bc('0x87')];_0x39c580['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xcdbda5,_0xd0213e);}else{if(_0xf7c0be['query'][_0x3dbf1b]===_0x34bc('0x88')){_0x39c580[_0x34bc('0x4f')]('i.'+_0x3dbf1b+_0x34bc('0x89'));}else{_0x39c580['where']('i.'+_0x3dbf1b+_0x34bc('0x8a'),_0xf7c0be[_0x34bc('0x46')][_0x3dbf1b]);}}});}if(_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x8b')]){if(_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x8b')]==0x1){_0x39c580[_0x34bc('0x6d')](_0x34bc('0x8c'));}else{_0x39c580[_0x34bc('0x6d')](_0x34bc('0x8d'));}}if(_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x8e')]){_0x2b46b8=_['isArray'](_0xf7c0be['query'][_0x34bc('0x8e')])?_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x8e')]:new Array(_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x8e')]);_0x2b46b8[_0x34bc('0x7a')](function(_0x46e789){_0x16ac8a['or'](_0x34bc('0x7b'),'%,'+_0x46e789+',%');});}if(_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x8f')]){var _0x498a83=_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x8f')][_0x34bc('0x90')]('\x5c','\x5c\x5c')[_0x34bc('0x90')](/'/g,'\x27\x27');if(qs[_0x34bc('0x91')](_0x498a83)){_0x320d86['or'](_0x34bc('0x92'),_0x498a83+'%');}else{_0x320d86['or'](_0x34bc('0x93'),qs[_0x34bc('0x74')](_0x498a83))['or'](_0x34bc('0x94'),_0x498a83+'%');}}}_0x39c580['where'](_0x320d86);_0x39c580[_0x34bc('0x95')]('i.id');var _0x5ba38f={'type':db[_0x34bc('0x96')]['QueryTypes']['SELECT'],'raw':!![]};var _0x4368f9=_0x39c580[_0x34bc('0x97')]();_0x4368f9['field'](_0x34bc('0x98'));_0x4368f9[_0x34bc('0x52')](_0x34bc('0x99'),_0x34bc('0x6b'));if(_0x1c6480['order']){_0x1c6480[_0x34bc('0x4d')][_0x34bc('0x7a')](function(_0x5e1b4d){var _0x4ea0d8=_0x5e1b4d[0x0]==='contactName'?_0x5e1b4d[0x0]:'i.'+_0x5e1b4d[0x0];_0x39c580[_0x34bc('0x4d')](_0x4ea0d8,_0x5e1b4d[0x1]===_0x34bc('0x9a')?![]:!![]);});}if(!_[_0x34bc('0x9b')](_0x2b46b8)){_0x39c580[_0x34bc('0x6d')](_0x16ac8a);_0x4368f9[_0x34bc('0x4f')](_0x34bc('0x9c'),_0x2b46b8);}BPromise[_0x34bc('0x9d')]()[_0x34bc('0x2a')](function(){if(!_0x47068c){if(_0xf7c0be[_0x34bc('0x46')]['ChatWebsiteId'])return;_0x4368f9[_0x34bc('0x4f')](_0x34bc('0x9e'));_0x39c580[_0x34bc('0x4f')](_0x34bc('0x9e'));return;}if(_0xf7c0be[_0x34bc('0x9f')][_0x34bc('0xa0')]!=='agent')return;return _0xf7c0be[_0x34bc('0x9f')][_0x34bc('0xa1')]({'attributes':['id'],'raw':!![]})[_0x34bc('0x2a')](function(_0x21cbfc){if(_[_0x34bc('0x9b')](_0x21cbfc)){_0x4368f9[_0x34bc('0x4f')](_0x34bc('0xa2'));_0x39c580[_0x34bc('0x4f')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x4368f9[_0x34bc('0x4f')](_0x34bc('0x83'),_[_0x34bc('0x33')](_0x21cbfc,'id'));_0x39c580['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x34bc('0x33')](_0x21cbfc,'id'));}});})[_0x34bc('0x2a')](function(){if(_0xf7c0be[_0x34bc('0x9f')][_0x34bc('0xa0')]==='agent'&&!_0x47068c&&!_0xf7c0be[_0x34bc('0x46')][_0x34bc('0x82')])return[];return db[_0x34bc('0xa3')][_0x34bc('0x46')](_0x4368f9['toString'](),_0x5ba38f);})[_0x34bc('0x2a')](function(_0x29cd84){_0x26924c[_0x34bc('0xa4')]=_0x29cd84[_0x34bc('0x4a')];if(_0x26924c[_0x34bc('0xa4')]===0x0)return[];return db[_0x34bc('0xa3')]['query'](_0x52d4c7[_0x34bc('0xa5')](),_0x5ba38f)[_0x34bc('0x2a')](function(_0x4094e4){_0x5b6497=_[_0x34bc('0xa6')](_0x4094e4,'id');_0x5ba38f=_['merge'](_0x5ba38f,{'model':db[_0x34bc('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xf7c0be[_0x34bc('0x46')][_0x34bc('0xa7')]){_0x1c6480['attributes'][_0x34bc('0x7a')](function(_0x257991){_0x39c580[_0x34bc('0x52')]('i.'+_0x257991);});}else{_0x39c580[_0x34bc('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x34bc('0x6b'));_0x39c580['field']('a.key',_0x34bc('0xa8'));_0x39c580['field'](_0x34bc('0xa9'),_0x34bc('0xaa'));_0x39c580[_0x34bc('0x52')](_0x34bc('0xab'),'contactName');_0x39c580[_0x34bc('0x52')]('i.*');_0x39c580[_0x34bc('0x52')](_0x34bc('0xac'),'Contact.firstName');_0x39c580[_0x34bc('0x52')](_0x34bc('0xad'),_0x34bc('0xae'));_0x39c580['field']('c.email','Contact.email');_0x39c580['field']('c.phone',_0x34bc('0xaf'));_0x39c580[_0x34bc('0x52')](_0x34bc('0xb0'),_0x34bc('0xb1'));_0x39c580['field'](_0x34bc('0xb2'),_0x34bc('0xb3'));_0x39c580[_0x34bc('0x52')](_0x34bc('0xb4'),_0x34bc('0xb5'));_0x39c580[_0x34bc('0x52')](_0x34bc('0xb6'),_0x34bc('0xb7'));_0x39c580[_0x34bc('0x52')](_0x34bc('0xb8'),_0x34bc('0x36'));}if(_0x1c6480[_0x34bc('0x26')])_0x39c580[_0x34bc('0x26')](_0x1c6480[_0x34bc('0x26')]);if(_0x1c6480[_0x34bc('0x25')])_0x39c580[_0x34bc('0x25')](_0x1c6480[_0x34bc('0x25')]);return db[_0x34bc('0xa3')]['query'](_0x39c580['toString'](),_0x5ba38f);})['then'](function(_0x653f3){if(_0x653f3[_0x34bc('0x4a')]>0x0)_0x3dabaa[_0x34bc('0x4f')](_0x34bc('0xb9'),_['map'](_0x653f3,'id'));return db[_0x34bc('0xa3')][_0x34bc('0x46')](_0x3dabaa[_0x34bc('0xa5')](),_0x5ba38f)[_0x34bc('0x2a')](function(_0x4ac316){var _0x3a2365=_['groupBy'](_0x4ac316,_0x34bc('0xba'));var _0x24f4f4=[];_0x653f3['forEach'](function(_0x3d8e3f){_0x24f4f4['push'](updateChatInteraction(_0x3d8e3f,_0x5b6497,_0x3a2365));});return BPromise[_0x34bc('0xbb')](_0x24f4f4);});});})[_0x34bc('0x2a')](function(_0x661409){_0x26924c[_0x34bc('0xbc')]=_0x661409;return _0x26924c;})['then'](respondWithFilteredResult(_0x1b42f5,_0x1c6480))[_0x34bc('0x1f')](handleError(_0x1b42f5,null));};exports[_0x34bc('0xbd')]=function(_0x17b018,_0x48a9d8){var _0x400402={'raw':![],'where':{'id':_0x17b018[_0x34bc('0xbe')]['id']}},_0xcebf49={};_0xcebf49[_0x34bc('0x45')]=_[_0x34bc('0x7f')](db[_0x34bc('0x42')][_0x34bc('0x43')]);_0xcebf49[_0x34bc('0x46')]=_[_0x34bc('0x7f')](_0x17b018[_0x34bc('0x46')]);_0xcebf49['filters']=_[_0x34bc('0x48')](_0xcebf49[_0x34bc('0x45')],_0xcebf49[_0x34bc('0x46')]);_0x400402[_0x34bc('0x49')]=_[_0x34bc('0x48')](_0xcebf49[_0x34bc('0x45')],qs[_0x34bc('0xa7')](_0x17b018[_0x34bc('0x46')][_0x34bc('0xa7')]));_0x400402[_0x34bc('0x49')]=_0x400402['attributes'][_0x34bc('0x4a')]?_0x400402[_0x34bc('0x49')]:_0xcebf49[_0x34bc('0x45')];if(_0x17b018[_0x34bc('0x46')][_0x34bc('0xbf')]){_0x400402[_0x34bc('0xc0')]=[{'all':!![]}];}_0x400402=_[_0x34bc('0x2f')]({},_0x400402,_0x17b018[_0x34bc('0xc1')]);return db[_0x34bc('0x42')][_0x34bc('0x6a')](_0x400402)[_0x34bc('0x2a')](handleEntityNotFound(_0x48a9d8,null))[_0x34bc('0x2a')](respondWithResult(_0x48a9d8,null))[_0x34bc('0x1f')](handleError(_0x48a9d8,null));};exports[_0x34bc('0xc2')]=function(_0x4e0f61,_0x19c29b){return db[_0x34bc('0x42')][_0x34bc('0xc2')](_0x4e0f61['body'],{})['then'](respondWithResult(_0x19c29b,0xc9))['catch'](handleError(_0x19c29b,null));};exports[_0x34bc('0x29')]=function(_0x5c1440,_0x1bda2f){if(_0x5c1440[_0x34bc('0x30')]['id']){delete _0x5c1440['body']['id'];}return db['ChatInteraction'][_0x34bc('0x6a')]({'where':{'id':_0x5c1440[_0x34bc('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1bda2f,null))[_0x34bc('0x2a')](saveUpdates(_0x5c1440['body'],null))[_0x34bc('0x2a')](respondWithResult(_0x1bda2f,null))[_0x34bc('0x1f')](handleError(_0x1bda2f,null));};exports[_0x34bc('0x2b')]=function(_0x1a81ad,_0x5debcf){return db[_0x34bc('0x42')][_0x34bc('0x6a')]({'where':{'id':_0x1a81ad[_0x34bc('0xbe')]['id']}})[_0x34bc('0x2a')](handleEntityNotFound(_0x5debcf,null))[_0x34bc('0x2a')](removeEntity(_0x5debcf,null))[_0x34bc('0x1f')](handleError(_0x5debcf,null));};exports[_0x34bc('0xc3')]=function(_0x52b208,_0x55be12){return db[_0x34bc('0x42')][_0x34bc('0xc3')]()[_0x34bc('0x2a')](respondWithResult(_0x55be12,null))['catch'](handleError(_0x55be12,null));};exports[_0x34bc('0xc4')]=function(_0x26c7b9,_0x23a24d){var _0xf9d80e=_0x26c7b9['params']['id'];var _0x402476;var _0x4252f6;var _0x4035ce;return db[_0x34bc('0x42')][_0x34bc('0xc5')]({'where':{'id':_0xf9d80e}})[_0x34bc('0x2a')](function(_0x1df2b5){_0x402476=_0x1df2b5;return db[_0x34bc('0xc6')][_0x34bc('0xc5')]({'where':{'id':_0x1df2b5[_0x34bc('0x82')]},'attributes':['id',_0x34bc('0xc7'),_0x34bc('0xc8'),_0x34bc('0xc9'),_0x34bc('0xca'),'vidaooMetadata'],'raw':!![]});})[_0x34bc('0x2a')](function(_0x43baf3){if(_0x43baf3&&_0x43baf3['vidaooApiKey']&&_0x43baf3[_0x34bc('0xc8')]){_0x4252f6=_0x43baf3;var _0xf2127c={'interaction':{'id':_0xf9d80e},'agent':{'id':_0x26c7b9[_0x34bc('0x9f')]['id'],'name':_0x26c7b9[_0x34bc('0x9f')][_0x34bc('0x2d')],'fullname':_0x26c7b9[_0x34bc('0x9f')]['fullname'],'email':_0x26c7b9[_0x34bc('0x9f')]['email']},'contact':_0x26c7b9[_0x34bc('0x30')]['contact'],'account':_0x26c7b9[_0x34bc('0x30')][_0x34bc('0xcb')]};var _0x5bc02a={'rejectUnauthorized':![],'method':_0x34bc('0xcc'),'url':_0x34bc('0xcd'),'headers':{'X-APIKEY':_0x43baf3[_0x34bc('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x26c7b9['user'][_0x34bc('0xce')]],'buttons':null,'topic':_0x4252f6[_0x34bc('0xc9')],'note':_[_0x34bc('0xcf')](_0x4252f6[_0x34bc('0xca')])?null:getMustacheRender(_0x4252f6[_0x34bc('0xca')],_0xf2127c),'metadata':null},'redirect':_0x34bc('0xd0'),'json':!![]};try{if(!_['isNull'](_0x4252f6[_0x34bc('0xd1')])){var _0x2eacb1=getMustacheRender(_0x4252f6['vidaooMetadata'],_0xf2127c);var _0x53604d=JSON[_0x34bc('0xd2')](_0x2eacb1);_0x5bc02a['body'][_0x34bc('0xd3')]=_0x53604d;}}catch(_0x2fc389){throw new db[(_0x34bc('0x96'))]['ValidationError'](_0x34bc('0xd4'));}return rp(_0x5bc02a);}else{throw new db['Sequelize']['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x34bc('0x2a')](function(_0x48d8c4){_0x4035ce=_0x48d8c4;if(_0x4035ce['id']){var _0x3afd00={'body':_0x4035ce['join_url'],'ChatWebsiteId':_0x4252f6['id'],'ChatInteractionId':_0x402476['id'],'direction':'out','UserId':_0x26c7b9[_0x34bc('0x9f')]['id']};return db['ChatMessage']['create'](_0x3afd00,{});}else{throw new db[(_0x34bc('0x96'))]['ValidationError'](_0x34bc('0xd5'));}})[_0x34bc('0x2a')](function(){return _0x402476[_0x34bc('0xd6')]({'vidaooSessionId':_0x4035ce['id']});})[_0x34bc('0x2a')](respondWithResult(_0x23a24d,null))['catch'](handleError(_0x23a24d,null));};exports[_0x34bc('0xd7')]=function(_0x4054b4,_0x22ac51){if(_0x4054b4[_0x34bc('0x30')]['id']){delete _0x4054b4['body']['id'];}return db[_0x34bc('0x42')][_0x34bc('0x6a')]({'where':{'id':_0x4054b4[_0x34bc('0xbe')]['id']},'include':[{'model':db[_0x34bc('0xd8')],'as':_0x34bc('0x6f')}]})[_0x34bc('0x2a')](handleEntityNotFound(_0x22ac51,null))[_0x34bc('0x2a')](saveUpdates(_0x4054b4[_0x34bc('0x30')],null))[_0x34bc('0x2a')](respondWithResult(_0x22ac51,null))[_0x34bc('0x1f')](handleError(_0x22ac51,null));};exports[_0x34bc('0xd9')]=function(_0x596197,_0x4c7317){if(_0x596197['body']['id']){delete _0x596197[_0x34bc('0x30')]['id'];}return db[_0x34bc('0x42')]['find']({'where':{'id':_0x596197[_0x34bc('0xbe')]['id']}})[_0x34bc('0x2a')](function(_0x4fc697){if(!_0x4fc697){logger['error'](_0x34bc('0xda'),_0x34bc('0xd9'),0x194,'entity\x20not\x20found');_0x4c7317['sendStatus'](0x194);}else{if(_0x4fc697[_0x34bc('0x3e')]){throw new db[(_0x34bc('0x96'))][(_0x34bc('0xdb'))]('Interaction\x20already\x20assigned');}}return _0x4fc697;})['then'](function(_0x4f30e3){if(_0x4f30e3){return _0x4f30e3[_0x34bc('0x29')]({'closed':_0x596197['body'][_0x34bc('0x3d')],'disposition':_0x596197['body']['disposition']})[_0x34bc('0x2a')](function(_0x2186b1){return _0x2186b1;});}})[_0x34bc('0x2a')](function(){return respondWithRpcPromise(_0x34bc('0xdc'),_0x34bc('0xd9'),_0x596197[_0x34bc('0x30')],client9004);})[_0x34bc('0x2a')](respondWithResult(_0x4c7317,null))[_0x34bc('0x1f')](handleError(_0x4c7317,null));};exports[_0x34bc('0xdd')]=function(_0x248b3e,_0x37451f){_0x248b3e['body'][_0x34bc('0x2d')]=_0x248b3e[_0x34bc('0xde')][_0x34bc('0xdf')];_0x248b3e[_0x34bc('0x30')][_0x34bc('0xe0')]=_0x248b3e['file'][_0x34bc('0xe1')];_0x248b3e['body'][_0x34bc('0x7e')]=_0x248b3e['file']['mimetype'];return db[_0x34bc('0xe2')][_0x34bc('0xc2')](_0x248b3e[_0x34bc('0x30')])[_0x34bc('0x2a')](respondWithResult(_0x37451f,0xc9))[_0x34bc('0x1f')](handleError(_0x37451f,null));};exports['attachmentDownload']=function(_0x4a85fc,_0x1e41fa){return db[_0x34bc('0x42')][_0x34bc('0xc5')]({'where':{'id':_0x4a85fc[_0x34bc('0xbe')]['id']},'raw':!![]})[_0x34bc('0x2a')](handleEntityNotFound(_0x1e41fa,null))[_0x34bc('0x2a')](function(_0x17ae0e){if(_0x17ae0e){if(_0x17ae0e['closed']){return _0x1e41fa['status'](0x193)[_0x34bc('0x23')]({'status':0x193,'message':_0x34bc('0xe3')});}return db['Attachment'][_0x34bc('0xc5')]({'where':{'id':_0x4a85fc[_0x34bc('0x46')][_0x34bc('0xe4')]},'raw':!![]})[_0x34bc('0x2a')](handleEntityNotFound(_0x1e41fa,null));}})['then'](function(_0x3b45e8){if(_0x3b45e8){var _0xc20c96=_0x3b45e8[_0x34bc('0xe5')]!==null;var _0x2d5a65=path[_0x34bc('0xe6')](config[_0x34bc('0xe7')],'server/files/attachments/');if(_0xc20c96){_0x2d5a65=path[_0x34bc('0xe6')](_0x2d5a65,_0x34bc('0xe8'));}var _0x1fc4cc=path['join'](_0x2d5a65,_0x3b45e8[_0x34bc('0xe0')]);return _0x1e41fa[_0x34bc('0xe9')](_0x1fc4cc);}})[_0x34bc('0x1f')](handleError(_0x1e41fa,null));};exports[_0x34bc('0xea')]=function(_0x12dc1c,_0x1db257){var _0x286b11=null;var _0x2a4683=null;var _0x4e93ba=null;if(_0x12dc1c[_0x34bc('0x30')]['id']){delete _0x12dc1c[_0x34bc('0x30')]['id'];}if(_0x12dc1c[_0x34bc('0x30')]['mailTranscript']){_0x4e93ba=path[_0x34bc('0xe6')](config['root'],'server/files/chat/upload/',util['format'](_0x34bc('0xeb'),Date['now']()));_0x12dc1c['body']['pathTranscript']=_0x4e93ba;}return db['ChatInteraction'][_0x34bc('0x6a')]({'where':{'id':_0x12dc1c[_0x34bc('0xbe')]['id']},'include':[{'model':db[_0x34bc('0xec')],'as':_0x34bc('0xed'),'include':[{'model':db[_0x34bc('0x7d')],'as':_0x34bc('0x7d')}]}]})[_0x34bc('0x2a')](handleEntityNotFound(_0x1db257,null))[_0x34bc('0x2a')](saveUpdates(_0x12dc1c[_0x34bc('0x30')],null))['then'](function(_0x4e8810){if(_0x4e8810){_0x286b11=_0x4e8810;return db[_0x34bc('0xc6')][_0x34bc('0x6a')]({'where':{'id':_0x286b11[_0x34bc('0x82')]}});}})[_0x34bc('0x2a')](function(_0x3f67dc){if(_0x3f67dc){_0x2a4683=_0x3f67dc;return db[_0x34bc('0xd8')][_0x34bc('0x6a')]({'where':{'id':_0x286b11[_0x34bc('0x76')]}});}})['then'](function(_0x4626a5){if(_0x4626a5){if(_0x4e93ba){var _0x5ae468=null;for(var _0x547709=0x1;_0x547709<_0x286b11[_0x34bc('0xed')]['length'];++_0x547709){_0x5ae468=_0x286b11[_0x34bc('0xed')][_0x547709];var _0x5b9a25=_0x5ae468['UserId']?util[_0x34bc('0xee')]('%s%d',_0x2a4683[_0x34bc('0xef')],_0x5ae468[_0x34bc('0x3e')]):'System';var _0x1b2e09=_0x12dc1c[_0x34bc('0x30')][_0x34bc('0xf0')]||util[_0x34bc('0xee')](_0x34bc('0xf1'),_0x34bc('0xf2'),_0x5ae468[_0x34bc('0x76')]);switch(_0x2a4683[_0x34bc('0xf3')]){case _0x34bc('0xf4'):_0x5b9a25=_0x5ae468[_0x34bc('0x3e')]?util[_0x34bc('0xee')](_0x34bc('0xf1'),_0x2a4683[_0x34bc('0xef')],_0x5ae468['UserId']):_0x34bc('0xf5');break;case _0x34bc('0xf6'):_0x5b9a25=_0x5ae468[_0x34bc('0x3e')]?_0x5ae468[_0x34bc('0x7d')][_0x34bc('0xf7')]||_0x5ae468[_0x34bc('0x7d')][_0x34bc('0x34')]:'System';break;case _0x34bc('0xf8'):_0x5b9a25=_0x5ae468[_0x34bc('0x3e')]?_0x5ae468[_0x34bc('0x7d')][_0x34bc('0x34')]:_0x34bc('0xf5');break;default:_0x5b9a25=_0x5ae468[_0x34bc('0x3e')]?util['format']('%s%d',_0x2a4683[_0x34bc('0xef')],_0x5ae468[_0x34bc('0x3e')]):'System';}var _0x17a7c4=util['format'](_0x34bc('0xf9'),moment(_0x5ae468['createdAt'])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x5ae468[_0x34bc('0xfa')]==='in'?_0x1b2e09:_0x5b9a25,_0x5ae468[_0x34bc('0x30')]);if(!_0x5ae468[_0x34bc('0xfb')]){fs[_0x34bc('0xfc')](_0x4e93ba,_0x17a7c4);}}return db[_0x34bc('0xfd')][_0x34bc('0xc5')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x34bc('0xfe'),'raw':!![],'include':[{'model':db[_0x34bc('0xff')],'as':_0x34bc('0xff'),'raw':!![]}]}]});}}})[_0x34bc('0x2a')](function(_0x1b5b81){if(!_0x1b5b81||!_0x1b5b81[_0x34bc('0xfe')]||!_0x12dc1c['body'])return _0x286b11;var _0x3622c2=_0x1b5b81[_0x34bc('0x100')]();return respondWithRpcPromise(_0x34bc('0x101'),_0x34bc('0x102'),{'account':_0x3622c2,'message':{'from':util[_0x34bc('0xee')](_0x34bc('0x103'),_0x1b5b81[_0x34bc('0x2d')],_0x1b5b81[_0x34bc('0xce')]||_0x1b5b81[_0x34bc('0xfe')][_0x34bc('0x9f')]),'to':_0x12dc1c['body']['mailTranscript'],'subject':_0x34bc('0x104'),'text':util[_0x34bc('0xee')](_0x34bc('0x105'),_0x12dc1c['body'][_0x34bc('0x106')]),'attachments':[{'path':_0x4e93ba}]}})['then'](function(){return _0x286b11;})[_0x34bc('0x1f')](function(_0x2543f9){logger[_0x34bc('0x1b')](_0x2543f9);});})[_0x34bc('0x2a')](respondWithStatusCode(_0x1db257,0xc8))['catch'](handleError(_0x1db257,null));};exports[_0x34bc('0x107')]=function(_0x526111,_0x3cc362){return db[_0x34bc('0xec')]['find']({'where':{'id':_0x526111[_0x34bc('0xbe')]['id']}})[_0x34bc('0x2a')](handleEntityNotFound(_0x3cc362,null))['then'](function(_0x4dab7c){if(_0x4dab7c){return _0x4dab7c[_0x34bc('0x107')](_0x526111[_0x34bc('0x30')]['ids'],_['omit'](_0x526111[_0x34bc('0x30')],[_0x34bc('0x108'),'id'])||{});}})[_0x34bc('0x2a')](respondWithResult(_0x3cc362,null))['catch'](handleError(_0x3cc362,null));};exports[_0x34bc('0x109')]=function(_0x40b723,_0x5b99fe){var _0x1deb67={'raw':![],'where':{}};var _0x4c2aed={};var _0xb2ed0c={'count':0x0,'rows':[]};return db[_0x34bc('0x42')][_0x34bc('0xc5')]({'where':{'id':_0x40b723[_0x34bc('0xbe')]['id']}})[_0x34bc('0x2a')](handleEntityNotFound(_0x5b99fe,null))[_0x34bc('0x2a')](function(_0x55d529){if(_0x55d529){_0x4c2aed['model']=_[_0x34bc('0x7f')](db['ChatMessage'][_0x34bc('0x43')]);_0x4c2aed[_0x34bc('0x46')]=_['keys'](_0x40b723[_0x34bc('0x46')]);_0x4c2aed[_0x34bc('0x47')]=_[_0x34bc('0x48')](_0x4c2aed[_0x34bc('0x45')],_0x4c2aed[_0x34bc('0x46')]);_0x1deb67['attributes']=_[_0x34bc('0x48')](_0x4c2aed[_0x34bc('0x45')],qs[_0x34bc('0xa7')](_0x40b723[_0x34bc('0x46')][_0x34bc('0xa7')]));_0x1deb67[_0x34bc('0x49')]=_0x1deb67[_0x34bc('0x49')]['length']?_0x1deb67[_0x34bc('0x49')]:_0x4c2aed[_0x34bc('0x45')];if(!_0x40b723[_0x34bc('0x46')][_0x34bc('0x4b')](_0x34bc('0x4c'))){_0x1deb67[_0x34bc('0x26')]=qs['limit'](_0x40b723[_0x34bc('0x46')][_0x34bc('0x26')]);_0x1deb67[_0x34bc('0x25')]=qs[_0x34bc('0x25')](_0x40b723[_0x34bc('0x46')][_0x34bc('0x25')]);}_0x1deb67['order']=qs[_0x34bc('0x4e')](_0x40b723[_0x34bc('0x46')][_0x34bc('0x4e')]);_0x1deb67[_0x34bc('0x4f')]=qs[_0x34bc('0x47')](_[_0x34bc('0x50')](_0x40b723[_0x34bc('0x46')],_0x4c2aed['filters']));_0x1deb67['where'][_0x34bc('0xba')]=_0x55d529['id'];if(_0x40b723[_0x34bc('0x46')][_0x34bc('0x8f')]){_0x1deb67[_0x34bc('0x4f')]=_[_0x34bc('0x2f')](_0x1deb67[_0x34bc('0x4f')],{'$or':_['map'](_0x1deb67[_0x34bc('0x49')],function(_0x10b53a){var _0x5d6d9e={};_0x5d6d9e[_0x10b53a]={'$like':'%'+_0x40b723[_0x34bc('0x46')][_0x34bc('0x8f')]+'%'};return _0x5d6d9e;})});}if(_0x40b723['query']['$gte']){var _0x3bc686=_0x40b723[_0x34bc('0x46')][_0x34bc('0x86')][_0x34bc('0x37')](',');var _0x329589={};_0x329589[_0x3bc686[0x0]]={'$gte':moment(_0x3bc686[0x1])[_0x34bc('0xee')](_0x34bc('0x10a'))};_0x1deb67[_0x34bc('0x4f')]=_[_0x34bc('0x2f')](_0x1deb67[_0x34bc('0x4f')],_0x329589);}_0x1deb67=_[_0x34bc('0x2f')]({},_0x1deb67,_0x40b723['options']);return db[_0x34bc('0xec')][_0x34bc('0xa4')]({'where':_0x1deb67[_0x34bc('0x4f')]})[_0x34bc('0x2a')](function(_0x80b623){_0xb2ed0c[_0x34bc('0xa4')]=_0x80b623;if(_0x40b723['query'][_0x34bc('0xbf')]){_0x1deb67['include']=[{'all':!![]}];}return db[_0x34bc('0xec')]['findAll'](_0x1deb67);})['then'](function(_0x2ddc87){_0xb2ed0c[_0x34bc('0xbc')]=_0x2ddc87;return _0xb2ed0c;});}})[_0x34bc('0x2a')](respondWithFilteredResult(_0x5b99fe,_0x1deb67))['catch'](handleError(_0x5b99fe,null));};exports[_0x34bc('0x10b')]=function(_0x4cdb0f,_0xd514e6){var _0x4c5ec0={'where':{}},_0x1df1f6={},_0x24e563={'count':0x0,'rows':[]};return db[_0x34bc('0x42')]['findOne']({'where':{'id':_0x4cdb0f['params']['id']}})[_0x34bc('0x2a')](handleEntityNotFound(_0xd514e6,null))['then'](function(_0x5c8fff){if(_0x5c8fff){_0x1df1f6[_0x34bc('0x45')]=_[_0x34bc('0x7f')](db[_0x34bc('0xec')][_0x34bc('0x43')]);_0x1df1f6[_0x34bc('0x46')]=_[_0x34bc('0x7f')](_0x4cdb0f[_0x34bc('0x46')]);_0x1df1f6['filters']=_['intersection'](_0x1df1f6[_0x34bc('0x45')],_0x1df1f6[_0x34bc('0x46')]);_0x4c5ec0['attributes']=_[_0x34bc('0x48')](_0x1df1f6['model'],qs[_0x34bc('0xa7')](_0x4cdb0f[_0x34bc('0x46')][_0x34bc('0xa7')]));_0x4c5ec0[_0x34bc('0x49')]=_0x4c5ec0[_0x34bc('0x49')][_0x34bc('0x4a')]?_0x4c5ec0['attributes']:_0x1df1f6['model'];if(!_0x4cdb0f[_0x34bc('0x46')][_0x34bc('0x4b')](_0x34bc('0x4c'))){_0x4c5ec0['limit']=qs['limit'](_0x4cdb0f[_0x34bc('0x46')]['limit']);_0x4c5ec0['offset']=qs[_0x34bc('0x25')](_0x4cdb0f[_0x34bc('0x46')][_0x34bc('0x25')]);}_0x4c5ec0[_0x34bc('0x4d')]=qs[_0x34bc('0x4e')](_0x4cdb0f[_0x34bc('0x46')][_0x34bc('0x4e')]);_0x4c5ec0['where']=qs[_0x34bc('0x47')](_['pick'](_0x4cdb0f[_0x34bc('0x46')],_0x1df1f6[_0x34bc('0x47')]));_0x4c5ec0['where'][_0x34bc('0xba')]=_0x5c8fff['id'];if(_0x4cdb0f['query'][_0x34bc('0x8f')]){_0x4c5ec0['where']=_['merge'](_0x4c5ec0[_0x34bc('0x4f')],{'$or':_[_0x34bc('0x33')](_0x4c5ec0['attributes'],function(_0x5158bf){var _0x2dce96={};_0x2dce96[_0x5158bf]={'$like':'%'+_0x4cdb0f['query']['filter']+'%'};return _0x2dce96;})});}_0x4c5ec0[_0x34bc('0x4f')][_0x34bc('0xfb')]=![];if(_0x4cdb0f[_0x34bc('0x46')]['id']){_0x4c5ec0['where']['id']={'$gt':_0x4cdb0f[_0x34bc('0x46')]['id']};}_0x4c5ec0=_[_0x34bc('0x2f')]({},_0x4c5ec0,_0x4cdb0f['options']);return db[_0x34bc('0xec')][_0x34bc('0xa4')]({'where':_0x4c5ec0['where']})[_0x34bc('0x2a')](function(_0x4d7373){_0x24e563[_0x34bc('0xa4')]=_0x4d7373;_0x4c5ec0[_0x34bc('0xc0')]=[];if(_0x4cdb0f['query']['includeAgent']){_0x4c5ec0[_0x34bc('0xc0')]['push']({'model':db[_0x34bc('0x7d')],'as':_0x34bc('0x7d'),'attributes':['id','fullname',_0x34bc('0xf7')]});}if(_0x4cdb0f[_0x34bc('0x46')][_0x34bc('0xbf')]){_0x4c5ec0['include']=[{'all':!![]}];}return db[_0x34bc('0xec')][_0x34bc('0x10c')](_0x4c5ec0);})[_0x34bc('0x2a')](function(_0x2fe410){_0x24e563[_0x34bc('0xbc')]=_0x2fe410;return _0x24e563;});}})[_0x34bc('0x2a')](respondWithFilteredResult(_0xd514e6,_0x4c5ec0))[_0x34bc('0x1f')](handleError(_0xd514e6,null));};exports[_0x34bc('0x10d')]=function(_0xe7cb34,_0x4ee3de){return db[_0x34bc('0x42')][_0x34bc('0x6a')]({'where':{'id':_0xe7cb34[_0x34bc('0xbe')]['id']}})[_0x34bc('0x2a')](handleEntityNotFound(_0x4ee3de,null))[_0x34bc('0x2a')](function(_0x2d2b36){if(_0x2d2b36){return _0x2d2b36[_0x34bc('0x10e')](_0xe7cb34[_0x34bc('0x30')][_0x34bc('0x108')],_[_0x34bc('0x10f')](_0xe7cb34['body'],['ids','id'])||{})['spread'](function(){return db[_0x34bc('0x110')][_0x34bc('0x10c')]({'attributes':['id',_0x34bc('0x2d'),_0x34bc('0x111')],'where':{'id':_0xe7cb34[_0x34bc('0x30')][_0x34bc('0x108')]}});})[_0x34bc('0x2a')](function(_0x332229){socket[_0x34bc('0x112')]('chatInteractionTags:save',{'id':Number(_0xe7cb34[_0x34bc('0xbe')]['id']),'tags':_0x332229||[]});return{'id':Number(_0xe7cb34[_0x34bc('0xbe')]['id']),'tags':_0x332229||[]};});}})[_0x34bc('0x2a')](respondWithResult(_0x4ee3de,null))[_0x34bc('0x1f')](handleError(_0x4ee3de,null));};exports['removeTags']=function(_0x583111,_0x2aae4c){return db[_0x34bc('0x42')][_0x34bc('0x6a')]({'where':{'id':_0x583111[_0x34bc('0xbe')]['id']}})[_0x34bc('0x2a')](handleEntityNotFound(_0x2aae4c,null))[_0x34bc('0x2a')](function(_0x586528){if(_0x586528){return _0x586528[_0x34bc('0x113')](_0x583111['query'][_0x34bc('0x108')]);}})[_0x34bc('0x2a')](respondWithStatusCode(_0x2aae4c,null))[_0x34bc('0x1f')](handleError(_0x2aae4c,null));};exports['download']=function(_0x15905c,_0x117e5f){var _0x445029=moment()[_0x34bc('0x114')]()[_0x34bc('0xa5')]();var _0x483dbd=path[_0x34bc('0xe6')](config[_0x34bc('0xe7')],_0x34bc('0x115'),_0x34bc('0x116'),_0x34bc('0x117'));var _0x14e049=path[_0x34bc('0xe6')](config[_0x34bc('0xe7')],_0x34bc('0x115'),_0x34bc('0x116'),'attachments');var _0x43f1db=path[_0x34bc('0xe6')](_0x483dbd,_0x445029);var _0x5c012b=util[_0x34bc('0xee')](_0x34bc('0x118'),_0x15905c[_0x34bc('0xbe')]['id'],_0x445029);var _0x2a9205=path[_0x34bc('0xe6')](_0x483dbd,_0x5c012b);var _0x5e8ae=[];_0x5e8ae[_0x34bc('0x38')]({'model':db['User'],'as':_0x34bc('0x7d'),'attributes':['id',_0x34bc('0x34')],'raw':!![]});_0x5e8ae[_0x34bc('0x38')]({'model':db[_0x34bc('0xd8')],'as':_0x34bc('0x6f'),'attributes':['id',_0x34bc('0x119'),_0x34bc('0x11a')],'raw':!![]});if(_0x15905c[_0x34bc('0x46')]['attachments']){_0x5e8ae[_0x34bc('0x38')]({'model':db[_0x34bc('0xe2')],'as':_0x34bc('0xe2'),'raw':!![]});}var _0x15a2ae=[{'model':db[_0x34bc('0xec')],'as':'Messages','attributes':['id',_0x34bc('0x30'),_0x34bc('0x85'),_0x34bc('0xfa'),_0x34bc('0xfb'),'read'],'include':_0x5e8ae}];_0x15a2ae[_0x34bc('0x38')]({'model':db[_0x34bc('0xc6')],'as':_0x34bc('0x11b'),'attributes':['id',_0x34bc('0x2d')]});_0x15a2ae[_0x34bc('0x38')]({'model':db[_0x34bc('0x7d')],'as':'Owner','attributes':['id','fullname']});return db[_0x34bc('0x42')][_0x34bc('0x6a')]({'where':{'id':_0x15905c[_0x34bc('0xbe')]['id']},'include':_0x15a2ae})[_0x34bc('0x2a')](handleEntityNotFound(_0x117e5f,null))['then'](function(_0x86bfb0){if(_0x86bfb0){var _0x2d5e16=_0x86bfb0[_0x34bc('0x11c')]({'plain':!![]});fs[_0x34bc('0x11d')](_0x43f1db);var _0x4d01bf={'channel':'Chat','account':_0x2d5e16[_0x34bc('0x11b')][_0x34bc('0x2d')],'agent':_0x2d5e16[_0x34bc('0x11e')]?_0x2d5e16[_0x34bc('0x11e')]['fullname']:_0x34bc('0x11f'),'createdAt':moment(_0x2d5e16['createdAt'])[_0x34bc('0xee')](_0x34bc('0x10a'))[_0x34bc('0xa5')](),'closedAt':_0x2d5e16['closed']?moment(_0x2d5e16[_0x34bc('0x120')])[_0x34bc('0xee')](_0x34bc('0x10a'))[_0x34bc('0xa5')]():'','disposition':_0x2d5e16[_0x34bc('0x40')],'chatInfo':{'browser':_0x2d5e16[_0x34bc('0x121')],'os':_0x2d5e16[_0x34bc('0x122')],'referer':_0x2d5e16['referer'],'customerIp':_0x2d5e16['customerIp'],'customerPort':_0x2d5e16[_0x34bc('0x123')]?_0x2d5e16[_0x34bc('0x123')]:_0x34bc('0x11f')},'messages':_(_0x2d5e16[_0x34bc('0xed')])['tail']()[_0x34bc('0x8f')]({'secret':![]})[_0x34bc('0x33')](function(_0x2b7927){if(_0x2b7927[_0x34bc('0xe2')]){var _0x3222c0=path[_0x34bc('0xe6')](_0x14e049,_0x2b7927['Attachment'][_0x34bc('0xe0')]);if(fs[_0x34bc('0x124')](_0x3222c0)){fs[_0x34bc('0x125')](_0x3222c0)[_0x34bc('0x126')](fs[_0x34bc('0x127')](path[_0x34bc('0xe6')](_0x43f1db,_0x2b7927[_0x34bc('0xe2')][_0x34bc('0xe0')])));}}return{'date':moment(_0x2b7927[_0x34bc('0x85')])[_0x34bc('0xee')](_0x34bc('0x10a'))[_0x34bc('0xa5')](),'sender':_0x2b7927[_0x34bc('0xfa')]===_0x34bc('0x128')?_0x2b7927[_0x34bc('0x7d')]?_0x2b7927[_0x34bc('0x7d')][_0x34bc('0x34')]:'System':_0x2b7927[_0x34bc('0x6f')][_0x34bc('0x119')]+(_0x2b7927['Contact'][_0x34bc('0x11a')]?'\x20'+_0x2b7927[_0x34bc('0x6f')][_0x34bc('0x11a')]:''),'body':_0x2b7927[_0x34bc('0xe2')]?_0x2b7927[_0x34bc('0xe2')]['basename']:_0x2b7927[_0x34bc('0x30')],'direction':_0x2b7927[_0x34bc('0xfa')]===_0x34bc('0x128')?'A':'C','secret':_0x2b7927[_0x34bc('0xfb')],'read':_0x2b7927[_0x34bc('0x8b')],'attachment':_0x2b7927[_0x34bc('0xe2')]};})[_0x34bc('0x72')]()};return ejs['renderFile'](path[_0x34bc('0xe6')](config[_0x34bc('0xe7')],_0x34bc('0x115'),_0x34bc('0x129'),_0x34bc('0x12a')),{'interaction':_0x4d01bf})['then'](function(_0x4427bd){var _0x33bc51=path[_0x34bc('0xe6')](_0x43f1db,'transcript-'+_0x2d5e16['id']+'-'+_0x445029+_0x34bc('0x12b'));var _0x5f0236={'path':_0x33bc51,'channel':_0x34bc('0x12c'),'interactionId':_0x2d5e16['id']};return pdf['createPdfFromHTML'](_0x4427bd,_0x5f0236);})[_0x34bc('0x2a')](function(){return new Promise(function(_0x9d5061,_0x472306){zipdir(_0x43f1db,{'saveTo':_0x2a9205},function(_0x233a70,_0x44c796){if(_0x233a70)return _0x472306(_0x233a70);return _0x9d5061(_0x44c796);});})[_0x34bc('0x2a')](function(){return new BPromise(function(_0x21c965,_0x2e8fb6){rimraf(_0x43f1db,function(_0x352b09){if(_0x352b09)_0x2e8fb6(_0x352b09);return _0x21c965();});});})['then'](function(){return _0x117e5f[_0x34bc('0xe9')](_0x2a9205,_0x5c012b,function(_0x186e8b){if(_0x186e8b){logger[_0x34bc('0x1b')](_0x34bc('0x12d'),_0x186e8b);}else{fs[_0x34bc('0x12e')](_0x2a9205);}});});});}else{return _0x117e5f[_0x34bc('0x20')](0xc8);}})[_0x34bc('0x1f')](handleError(_0x117e5f,null));};
\ No newline at end of file
index d707c05..f537fb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x344e=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x344e,0x15c));var _0xe344=function(_0x592015,_0x412832){_0x592015=_0x592015-0x0;var _0x1461e7=_0x344e[_0x592015];return _0x1461e7;};'use strict';var EventEmitter=require(_0xe344('0x0'));var ChatInteraction=require(_0xe344('0x1'))['db'][_0xe344('0x2')];var ChatMessage=require(_0xe344('0x1'))['db'][_0xe344('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xe344('0x4')](0x0);var events={'afterCreate':_0xe344('0x5'),'afterUpdate':_0xe344('0x6'),'afterDestroy':_0xe344('0x7')};function emitEvent(_0x3bf861){return function(_0x11c219,_0x4a12c8,_0x1b3cd0){_0x11c219[_0xe344('0x8')]({'attributes':['id'],'raw':!![]})[_0xe344('0x9')](function(_0x18668d){_0x11c219['setDataValue'](_0xe344('0xa'),_0x18668d[_0xe344('0xb')](function(_0x4a8235){return{'id':_0x4a8235['id']};}));return ChatMessage[_0xe344('0xc')]({'where':{'ChatInteractionId':_0x11c219['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x44cd85){_0x11c219[_0xe344('0xd')](_0xe344('0xe'),_0x44cd85[_0xe344('0xf')]);ChatInteractionEvents[_0xe344('0x10')](_0x3bf861+':'+_0x11c219['id'],_0x11c219);ChatInteractionEvents['emit'](_0x3bf861,_0x11c219);_0x1b3cd0(null);})[_0xe344('0x11')](_0x1b3cd0(null));};}for(var e in events){if(events[_0xe344('0x12')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x690b=['ChatMessage','setMaxListeners','save','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','exports','events','../../mysqldb'];(function(_0x119705,_0xba9427){var _0x2affc2=function(_0x16f7e2){while(--_0x16f7e2){_0x119705['push'](_0x119705['shift']());}};_0x2affc2(++_0xba9427);}(_0x690b,0x8e));var _0xb690=function(_0x4492af,_0x47e25d){_0x4492af=_0x4492af-0x0;var _0x216729=_0x690b[_0x4492af];return _0x216729;};'use strict';var EventEmitter=require(_0xb690('0x0'));var ChatInteraction=require(_0xb690('0x1'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0xb690('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb690('0x3')](0x0);var events={'afterCreate':_0xb690('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3b9a0f){return function(_0x2bb609,_0x158a1e,_0x2a4b7e){_0x2bb609[_0xb690('0x5')]({'attributes':['id'],'raw':!![]})[_0xb690('0x6')](function(_0x215218){_0x2bb609['setDataValue'](_0xb690('0x7'),_0x215218[_0xb690('0x8')](function(_0x363e03){return{'id':_0x363e03['id']};}));return ChatMessage[_0xb690('0x9')]({'where':{'ChatInteractionId':_0x2bb609['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1a20c6){_0x2bb609[_0xb690('0xa')](_0xb690('0xb'),_0x1a20c6[_0xb690('0xc')]);ChatInteractionEvents[_0xb690('0xd')](_0x3b9a0f+':'+_0x2bb609['id'],_0x2bb609);ChatInteractionEvents[_0xb690('0xd')](_0x3b9a0f,_0x2bb609);_0x2a4b7e(null);})[_0xb690('0xe')](_0x2a4b7e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xb690('0xf')]=ChatInteractionEvents;
\ No newline at end of file
index 5b300db..84a7748 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1291=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','api','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions'];(function(_0x1e6ee8,_0x12d1b3){var _0x529c60=function(_0x4653fc){while(--_0x4653fc){_0x1e6ee8['push'](_0x1e6ee8['shift']());}};_0x529c60(++_0x12d1b3);}(_0x1291,0x64));var _0x1129=function(_0x1b2675,_0x3363b7){_0x1b2675=_0x1b2675-0x0;var _0x508da2=_0x1291[_0x1b2675];return _0x508da2;};'use strict';var _=require(_0x1129('0x0'));var util=require(_0x1129('0x1'));var logger=require('../../config/logger')(_0x1129('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1129('0x3'));var fs=require('fs');var path=require(_0x1129('0x4'));var rimraf=require(_0x1129('0x5'));var config=require(_0x1129('0x6'));var attributes=require(_0x1129('0x7'));module[_0x1129('0x8')]=function(_0x1a0ade,_0x458b2e){return _0x1a0ade[_0x1129('0x9')](_0x1129('0xa'),attributes,{'tableName':_0x1129('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b82a1,_0x46baab,_0xf6eee7){if(_0x2b82a1['changed']('closed')){_0x2b82a1[_0x1129('0xc')]=moment()[_0x1129('0xd')](_0x1129('0xe'));}_0xf6eee7(null,_0x2b82a1);}},'charset':'utf8mb4','collate':_0x1129('0xf')});};
\ No newline at end of file
+var _0x86e8=['chat_interactions','changed','format','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction'];(function(_0x65185e,_0x4153b0){var _0x3d7a61=function(_0x37d6db){while(--_0x37d6db){_0x65185e['push'](_0x65185e['shift']());}};_0x3d7a61(++_0x4153b0);}(_0x86e8,0x6b));var _0x886e=function(_0x6b5577,_0x254a33){_0x6b5577=_0x6b5577-0x0;var _0x35da0b=_0x86e8[_0x6b5577];return _0x35da0b;};'use strict';var _=require('lodash');var util=require(_0x886e('0x0'));var logger=require(_0x886e('0x1'))(_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(_0x3852c3,_0x442c87){return _0x3852c3['define'](_0x886e('0xb'),attributes,{'tableName':_0x886e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xfb5316,_0x2ccd9e,_0xa88ba8){if(_0xfb5316[_0x886e('0xd')]('closed')){_0xfb5316['closedAt']=moment()[_0x886e('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0xa88ba8(null,_0xfb5316);}},'charset':_0x886e('0xf'),'collate':_0x886e('0x10')});};
\ No newline at end of file
index f626eb2..52b32df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49c3=['UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','limit','AddTagsToChatInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0x49c3,0x188));var _0x349c=function(_0x1f9464,_0x6d8a39){_0x1f9464=_0x1f9464-0x0;var _0x1498f7=_0x49c3[_0x1f9464];return _0x1498f7;};'use strict';var _=require(_0x349c('0x0'));var util=require(_0x349c('0x1'));var moment=require(_0x349c('0x2'));var BPromise=require(_0x349c('0x3'));var rs=require(_0x349c('0x4'));var fs=require('fs');var Redis=require(_0x349c('0x5'));var db=require(_0x349c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x349c('0x7'))(_0x349c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x349c('0x9')][_0x349c('0xa')]({'port':0x232a});config[_0x349c('0xb')]=_[_0x349c('0xc')](config[_0x349c('0xb')],{'host':_0x349c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x349c('0xb')]));require(_0x349c('0xe'))[_0x349c('0xf')](socket);function respondWithRpcPromise(_0x3f338e,_0x173394,_0x26b409){return new BPromise(function(_0x5d4658,_0x412f72){return client[_0x349c('0x10')](_0x3f338e,_0x26b409)[_0x349c('0x11')](function(_0x27d6fa){logger[_0x349c('0x12')](_0x349c('0x13'),_0x173394,'request\x20sent');logger[_0x349c('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x173394,_0x349c('0x15'),JSON[_0x349c('0x16')](_0x27d6fa));if(_0x27d6fa[_0x349c('0x17')]){if(_0x27d6fa[_0x349c('0x17')][_0x349c('0x18')]===0x1f4){logger[_0x349c('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x173394,_0x27d6fa[_0x349c('0x17')][_0x349c('0x19')]);return _0x412f72(_0x27d6fa[_0x349c('0x17')][_0x349c('0x19')]);}logger[_0x349c('0x17')](_0x349c('0x13'),_0x173394,_0x27d6fa[_0x349c('0x17')][_0x349c('0x19')]);return _0x5d4658(_0x27d6fa[_0x349c('0x17')][_0x349c('0x19')]);}else{logger[_0x349c('0x12')](_0x349c('0x13'),_0x173394,_0x349c('0x15'));_0x5d4658(_0x27d6fa[_0x349c('0x1a')][_0x349c('0x19')]);}})[_0x349c('0x1b')](function(_0xe10f00){logger[_0x349c('0x17')](_0x349c('0x13'),_0x173394,_0xe10f00);_0x412f72(_0xe10f00);});});}exports[_0x349c('0x1c')]=function(_0x2bb68a){var _0x1317ae=this;return new Promise(function(_0x154123,_0x4d19cd){return db[_0x349c('0x1d')][_0x349c('0x1e')](_0x2bb68a[_0x349c('0x1f')],{'raw':_0x2bb68a['options']?_0x2bb68a[_0x349c('0x20')][_0x349c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bb68a['options']?_0x2bb68a['options']['where']||null:null,'attributes':_0x2bb68a[_0x349c('0x20')]?_0x2bb68a['options'][_0x349c('0x22')]||null:null,'limit':_0x2bb68a['options']?_0x2bb68a[_0x349c('0x20')][_0x349c('0x23')]||null:null})['then'](function(_0x4f5a72){logger[_0x349c('0x12')](_0x349c('0x1c'),_0x2bb68a);logger[_0x349c('0x14')](_0x349c('0x1c'),_0x2bb68a,JSON[_0x349c('0x16')](_0x4f5a72));_0x154123(_0x4f5a72);})[_0x349c('0x1b')](function(_0x2ac887){logger['error']('UpdateChatInteraction',_0x2ac887[_0x349c('0x19')],_0x2bb68a);_0x4d19cd(_0x1317ae[_0x349c('0x17')](0x1f4,_0x2ac887[_0x349c('0x19')]));});});};exports[_0x349c('0x24')]=function(_0x41319a){return new Promise(function(_0x314aa4,_0xa3bbd0){return db[_0x349c('0x1d')][_0x349c('0x25')]({'where':_0x41319a[_0x349c('0x20')]?_0x41319a[_0x349c('0x20')]['where']||null:null})[_0x349c('0x11')](function(_0x50b7f4){if(_0x50b7f4){return _0x50b7f4[_0x349c('0x26')](_0x41319a[_0x349c('0x1f')][_0x349c('0x27')],_['omit'](_0x41319a[_0x349c('0x1f')],['ids','id'])||{});}})[_0x349c('0x28')](function(_0x491222){logger[_0x349c('0x12')](_0x349c('0x29'),_0x41319a);logger[_0x349c('0x14')]('AddTags',_0x41319a,JSON[_0x349c('0x16')](_0x491222));_0x314aa4(_0x491222);})[_0x349c('0x1b')](function(_0xd8fec2){logger[_0x349c('0x17')](_0x349c('0x29'),_0xd8fec2[_0x349c('0x19')],_0x41319a);_0xa3bbd0(_this[_0x349c('0x17')](0x1f4,_0xd8fec2[_0x349c('0x19')]));});});};
\ No newline at end of file
+var _0x9b21=['limit','UpdateChatInteraction','AddTagsToChatInteraction','ChatInteraction','find','addTags','omit','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','update','body','options','where','attributes'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9b21,0x130));var _0x19b2=function(_0x367a9a,_0x56d901){_0x367a9a=_0x367a9a-0x0;var _0x149c3c=_0x9b21[_0x367a9a];return _0x149c3c;};'use strict';var _=require(_0x19b2('0x0'));var util=require('util');var moment=require(_0x19b2('0x1'));var BPromise=require(_0x19b2('0x2'));var rs=require(_0x19b2('0x3'));var fs=require('fs');var Redis=require(_0x19b2('0x4'));var db=require(_0x19b2('0x5'))['db'];var utils=require(_0x19b2('0x6'));var logger=require(_0x19b2('0x7'))(_0x19b2('0x8'));var config=require(_0x19b2('0x9'));var jayson=require(_0x19b2('0xa'));var client=jayson[_0x19b2('0xb')]['http']({'port':0x232a});config[_0x19b2('0xc')]=_['defaults'](config[_0x19b2('0xc')],{'host':_0x19b2('0xd'),'port':0x18eb});var socket=require(_0x19b2('0xe'))(new Redis(config[_0x19b2('0xc')]));require(_0x19b2('0xf'))[_0x19b2('0x10')](socket);function respondWithRpcPromise(_0x55cf22,_0x17f09b,_0x5d811a){return new BPromise(function(_0x5bd7ef,_0x2e8c22){return client['request'](_0x55cf22,_0x5d811a)[_0x19b2('0x11')](function(_0x5e3c67){logger[_0x19b2('0x12')](_0x19b2('0x13'),_0x17f09b,_0x19b2('0x14'));logger[_0x19b2('0x15')](_0x19b2('0x16'),_0x17f09b,_0x19b2('0x14'),JSON[_0x19b2('0x17')](_0x5e3c67));if(_0x5e3c67[_0x19b2('0x18')]){if(_0x5e3c67[_0x19b2('0x18')]['code']===0x1f4){logger[_0x19b2('0x18')](_0x19b2('0x13'),_0x17f09b,_0x5e3c67[_0x19b2('0x18')]['message']);return _0x2e8c22(_0x5e3c67['error'][_0x19b2('0x19')]);}logger[_0x19b2('0x18')](_0x19b2('0x13'),_0x17f09b,_0x5e3c67[_0x19b2('0x18')][_0x19b2('0x19')]);return _0x5bd7ef(_0x5e3c67[_0x19b2('0x18')]['message']);}else{logger[_0x19b2('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x17f09b,_0x19b2('0x14'));_0x5bd7ef(_0x5e3c67['result']['message']);}})[_0x19b2('0x1a')](function(_0x134497){logger[_0x19b2('0x18')](_0x19b2('0x13'),_0x17f09b,_0x134497);_0x2e8c22(_0x134497);});});}exports['UpdateChatInteraction']=function(_0x2e06b9){var _0x4615a4=this;return new Promise(function(_0xc224d3,_0x30bf07){return db['ChatInteraction'][_0x19b2('0x1b')](_0x2e06b9[_0x19b2('0x1c')],{'raw':_0x2e06b9[_0x19b2('0x1d')]?_0x2e06b9[_0x19b2('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e06b9[_0x19b2('0x1d')]?_0x2e06b9[_0x19b2('0x1d')][_0x19b2('0x1e')]||null:null,'attributes':_0x2e06b9[_0x19b2('0x1d')]?_0x2e06b9[_0x19b2('0x1d')][_0x19b2('0x1f')]||null:null,'limit':_0x2e06b9[_0x19b2('0x1d')]?_0x2e06b9[_0x19b2('0x1d')][_0x19b2('0x20')]||null:null})[_0x19b2('0x11')](function(_0x4d4c6e){logger[_0x19b2('0x12')](_0x19b2('0x21'),_0x2e06b9);logger[_0x19b2('0x15')](_0x19b2('0x21'),_0x2e06b9,JSON[_0x19b2('0x17')](_0x4d4c6e));_0xc224d3(_0x4d4c6e);})[_0x19b2('0x1a')](function(_0x3db878){logger[_0x19b2('0x18')](_0x19b2('0x21'),_0x3db878['message'],_0x2e06b9);_0x30bf07(_0x4615a4[_0x19b2('0x18')](0x1f4,_0x3db878[_0x19b2('0x19')]));});});};exports[_0x19b2('0x22')]=function(_0xa66474){return new Promise(function(_0x486477,_0xae0604){return db[_0x19b2('0x23')][_0x19b2('0x24')]({'where':_0xa66474[_0x19b2('0x1d')]?_0xa66474[_0x19b2('0x1d')][_0x19b2('0x1e')]||null:null})[_0x19b2('0x11')](function(_0x1286fe){if(_0x1286fe){return _0x1286fe[_0x19b2('0x25')](_0xa66474[_0x19b2('0x1c')]['ids'],_[_0x19b2('0x26')](_0xa66474[_0x19b2('0x1c')],[_0x19b2('0x27'),'id'])||{});}})[_0x19b2('0x28')](function(_0x5a3ca1){logger[_0x19b2('0x12')](_0x19b2('0x29'),_0xa66474);logger[_0x19b2('0x15')](_0x19b2('0x29'),_0xa66474,JSON[_0x19b2('0x17')](_0x5a3ca1));_0x486477(_0x5a3ca1);})[_0x19b2('0x1a')](function(_0x230beb){logger[_0x19b2('0x18')](_0x19b2('0x29'),_0x230beb[_0x19b2('0x19')],_0xa66474);_0xae0604(_this[_0x19b2('0x18')](0x1f4,_0x230beb['message']));});});};
\ No newline at end of file
index e2cff22..a03c3fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9351=['register','length','remove','update','emit','removeListener'];(function(_0x2b1b53,_0x230e62){var _0x5ec8c9=function(_0xac4a5d){while(--_0xac4a5d){_0x2b1b53['push'](_0x2b1b53['shift']());}};_0x5ec8c9(++_0x230e62);}(_0x9351,0x98));var _0x1935=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9351[_0x19e35c];return _0x3e1fe8;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x1935('0x0'),_0x1935('0x1')];function createListener(_0x36e1e6,_0x3ffdd7){return function(_0x4aa6c4){_0x3ffdd7[_0x1935('0x2')](_0x36e1e6,_0x4aa6c4);};}function removeListener(_0x1ecc7c,_0x11a899){return function(){ChatInteractionEvents[_0x1935('0x3')](_0x1ecc7c,_0x11a899);};}exports[_0x1935('0x4')]=function(_0xffcc54){for(var _0x3d1554=0x0,_0x228446=events[_0x1935('0x5')];_0x3d1554<_0x228446;_0x3d1554++){var _0x866b46=events[_0x3d1554];var _0x31be38=createListener('chatInteraction:'+_0x866b46,_0xffcc54);ChatInteractionEvents['on'](_0x866b46,_0x31be38);}};
\ No newline at end of file
+var _0xc0be=['save','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x1a156e,_0x4e3646){var _0x2a7230=function(_0x7a72a8){while(--_0x7a72a8){_0x1a156e['push'](_0x1a156e['shift']());}};_0x2a7230(++_0x4e3646);}(_0xc0be,0x13f));var _0xec0b=function(_0x376c5e,_0x2f21b6){_0x376c5e=_0x376c5e-0x0;var _0x517811=_0xc0be[_0x376c5e];return _0x517811;};'use strict';var ChatInteractionEvents=require(_0xec0b('0x0'));var events=[_0xec0b('0x1'),'remove',_0xec0b('0x2')];function createListener(_0x2d245c,_0x341e0c){return function(_0x58b17a){_0x341e0c[_0xec0b('0x3')](_0x2d245c,_0x58b17a);};}function removeListener(_0x14f0fb,_0x30786a){return function(){ChatInteractionEvents[_0xec0b('0x4')](_0x14f0fb,_0x30786a);};}exports[_0xec0b('0x5')]=function(_0x4a9c0d){for(var _0x183972=0x0,_0x2c8d2b=events[_0xec0b('0x6')];_0x183972<_0x2c8d2b;_0x183972++){var _0x5b6982=events[_0x183972];var _0x5eea85=createListener(_0xec0b('0x7')+_0x5b6982,_0x4a9c0d);ChatInteractionEvents['on'](_0x5b6982,_0x5eea85);}};
\ No newline at end of file
index 844114e..8d6afbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67e0=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','server/files/attachments/','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','chatinteraction:addtags','addTags','put','tracked','/:id/custom_update','/:id/abandon','/:id/close','delete','chat','chatinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout'];(function(_0x3e88e2,_0x4d3329){var _0x35d5ba=function(_0x9d2040){while(--_0x9d2040){_0x3e88e2['push'](_0x3e88e2['shift']());}};_0x35d5ba(++_0x4d3329);}(_0x67e0,0x168));var _0x067e=function(_0x5a6b45,_0x48fea6){_0x5a6b45=_0x5a6b45-0x0;var _0x2ad452=_0x67e0[_0x5a6b45];return _0x2ad452;};'use strict';var multer=require(_0x067e('0x0'));var util=require(_0x067e('0x1'));var path=require(_0x067e('0x2'));var timeout=require(_0x067e('0x3'));var express=require(_0x067e('0x4'));var router=express['Router']();var fs_extra=require(_0x067e('0x5'));var auth=require(_0x067e('0x6'));var interaction=require(_0x067e('0x7'));var config=require(_0x067e('0x8'));var controller=require(_0x067e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x067e('0xa')]);router[_0x067e('0xb')](_0x067e('0xc'),auth[_0x067e('0xd')](),controller[_0x067e('0xe')]);router[_0x067e('0xb')](_0x067e('0xf'),auth[_0x067e('0x10')](),controller[_0x067e('0x11')]);router['get'](_0x067e('0x12'),auth[_0x067e('0x10')](),controller[_0x067e('0x13')]);router[_0x067e('0xb')](_0x067e('0x14'),auth[_0x067e('0xd')](),controller[_0x067e('0x15')]);router['get'](_0x067e('0x16'),auth[_0x067e('0x10')](),controller[_0x067e('0x17')]);router[_0x067e('0xb')](_0x067e('0x18'),auth['isAuthenticated'](),controller[_0x067e('0x19')]);router[_0x067e('0x1a')]('/',auth['isAuthenticated'](),controller[_0x067e('0x1b')]);router[_0x067e('0x1a')](_0x067e('0x1c'),auth[_0x067e('0xd')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x067e('0x1d')]({'destination':function(_0x3330cc,_0x2ffd5c,_0x33450a){_0x33450a(null,path['join'](config['root'],_0x067e('0x1e')));},'filename':function(_0x36393d,_0x4f03ff,_0x351652){_0x351652(null,util['format'](_0x067e('0x1f'),Date[_0x067e('0x20')](),_0x4f03ff[_0x067e('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x067e('0x1a')](_0x067e('0x22'),upload[_0x067e('0x23')](_0x067e('0x24')),controller[_0x067e('0x25')]);router[_0x067e('0x1a')](_0x067e('0x14'),auth['isChatInteractionAuthorized'](),controller[_0x067e('0x26')]);router[_0x067e('0x1a')]('/:id/tags',auth[_0x067e('0xd')](),interaction['tracked']('chat',_0x067e('0x27')),controller[_0x067e('0x28')]);router[_0x067e('0x29')](_0x067e('0xf'),auth[_0x067e('0xd')](),interaction[_0x067e('0x2a')]('chat','chatinteraction:update'),controller['update']);router[_0x067e('0x29')](_0x067e('0x2b'),controller['customUpdate']);router[_0x067e('0x29')](_0x067e('0x2c'),auth[_0x067e('0x10')](),controller['abandon']);router[_0x067e('0x29')](_0x067e('0x2d'),controller['close']);router[_0x067e('0x2e')]('/:id',auth['isAuthenticated'](),interaction[_0x067e('0x2a')](_0x067e('0x2f'),_0x067e('0x30')),controller[_0x067e('0x31')]);router[_0x067e('0x2e')](_0x067e('0x32'),auth[_0x067e('0xd')](),controller[_0x067e('0x33')]);module['exports']=router;
\ No newline at end of file
+var _0x12b6=['originalname','single','file','attachmentUpload','addMessage','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','path','express','fs-extra','../../components/auth/service','isAuthenticated','index','describe','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now'];(function(_0xa52dbd,_0x386625){var _0x3fa0a2=function(_0x392864){while(--_0x392864){_0xa52dbd['push'](_0xa52dbd['shift']());}};_0x3fa0a2(++_0x386625);}(_0x12b6,0x1bf));var _0x612b=function(_0x20a7ac,_0x4d91fe){_0x20a7ac=_0x20a7ac-0x0;var _0xd65727=_0x12b6[_0x20a7ac];return _0xd65727;};'use strict';var multer=require(_0x612b('0x0'));var util=require('util');var path=require(_0x612b('0x1'));var timeout=require('connect-timeout');var express=require(_0x612b('0x2'));var router=express['Router']();var fs_extra=require(_0x612b('0x3'));var auth=require(_0x612b('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x612b('0x5')](),controller[_0x612b('0x6')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x612b('0x7')]);router[_0x612b('0x8')](_0x612b('0x9'),auth[_0x612b('0xa')](),controller[_0x612b('0xb')]);router[_0x612b('0x8')](_0x612b('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x612b('0xd')]);router[_0x612b('0x8')](_0x612b('0xe'),auth['isAuthenticated'](),controller[_0x612b('0xf')]);router['get'](_0x612b('0x10'),auth[_0x612b('0xa')](),controller[_0x612b('0x11')]);router[_0x612b('0x8')](_0x612b('0x12'),auth['isAuthenticated'](),controller[_0x612b('0x13')]);router['post']('/',auth[_0x612b('0x5')](),controller[_0x612b('0x14')]);router[_0x612b('0x15')](_0x612b('0x16'),auth[_0x612b('0x5')](),controller[_0x612b('0x17')]);var upload=multer({'storage':multer[_0x612b('0x18')]({'destination':function(_0x2a1857,_0x43e9f8,_0x3e106f){_0x3e106f(null,path[_0x612b('0x19')](config[_0x612b('0x1a')],_0x612b('0x1b')));},'filename':function(_0x20c3ed,_0x5e5884,_0x58ad7f){_0x58ad7f(null,util['format'](_0x612b('0x1c'),Date[_0x612b('0x1d')](),_0x5e5884[_0x612b('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x612b('0x1f')](_0x612b('0x20')),controller[_0x612b('0x21')]);router[_0x612b('0x15')](_0x612b('0xe'),auth[_0x612b('0xa')](),controller[_0x612b('0x22')]);router['post'](_0x612b('0x23'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x612b('0x24')),controller[_0x612b('0x25')]);router[_0x612b('0x26')](_0x612b('0x9'),auth[_0x612b('0x5')](),interaction[_0x612b('0x27')](_0x612b('0x28'),'chatinteraction:update'),controller[_0x612b('0x29')]);router['put'](_0x612b('0x2a'),controller[_0x612b('0x2b')]);router['put'](_0x612b('0x2c'),auth[_0x612b('0xa')](),controller[_0x612b('0x2d')]);router['put'](_0x612b('0x2e'),controller[_0x612b('0x2f')]);router[_0x612b('0x30')](_0x612b('0x9'),auth[_0x612b('0x5')](),interaction[_0x612b('0x27')](_0x612b('0x28'),_0x612b('0x31')),controller[_0x612b('0x32')]);router['delete'](_0x612b('0x23'),auth['isAuthenticated'](),controller[_0x612b('0x33')]);module[_0x612b('0x34')]=router;
\ No newline at end of file
index 7c48ef6..a974519 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3671=['INTEGER','exports','medium','BOOLEAN'];(function(_0x4424b5,_0x4b595e){var _0x54de60=function(_0x4fb49f){while(--_0x4fb49f){_0x4424b5['push'](_0x4424b5['shift']());}};_0x54de60(++_0x4b595e);}(_0x3671,0x145));var _0x1367=function(_0x275caa,_0x166d5e){_0x275caa=_0x275caa-0x0;var _0x28d670=_0x3671[_0x275caa];return _0x28d670;};'use strict';var Sequelize=require('sequelize');module[_0x1367('0x0')]={'body':{'type':Sequelize['TEXT'](_0x1367('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x1367('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1367('0x3')]}};
\ No newline at end of file
+var _0xdfeb=['INTEGER','exports','TEXT','BOOLEAN'];(function(_0xa40e11,_0x2e37b7){var _0x5a93db=function(_0x50bb96){while(--_0x50bb96){_0xa40e11['push'](_0xa40e11['shift']());}};_0x5a93db(++_0x2e37b7);}(_0xdfeb,0x1d9));var _0xbdfe=function(_0x1aa67e,_0x25de96){_0x1aa67e=_0x1aa67e-0x0;var _0x484209=_0xdfeb[_0x1aa67e];return _0x484209;};'use strict';var Sequelize=require('sequelize');module[_0xbdfe('0x0')]={'body':{'type':Sequelize[_0xbdfe('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbdfe('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xbdfe('0x3')]}};
\ No newline at end of file
index 6ba0538..335bacd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd23c=['index','map','ChatInternalMessage','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','keys','rawAttributes','fields','length','includeAll','include','find','create','body','params','describe','get','lastMessageAt','createdAt','lastMessage','format','getUsers','User','agent','admin','user','fullname','role','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','UserProfileSection','Agents','UserProfileResource','isEmpty','resourceId','push','messages','FromId','ToId','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send'];(function(_0x346915,_0x424914){var _0x14b83d=function(_0x3835e5){while(--_0x3835e5){_0x346915['push'](_0x346915['shift']());}};_0x14b83d(++_0x424914);}(_0xd23c,0x183));var _0xcd23=function(_0x4d1f7e,_0x100517){_0x4d1f7e=_0x4d1f7e-0x0;var _0x3c41af=_0xd23c[_0x4d1f7e];return _0x3c41af;};'use strict';var emlformat=require(_0xcd23('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd23('0x1'));var jsonpatch=require(_0xcd23('0x2'));var rp=require(_0xcd23('0x3'));var moment=require(_0xcd23('0x4'));var BPromise=require(_0xcd23('0x5'));var Mustache=require('mustache');var util=require(_0xcd23('0x6'));var path=require(_0xcd23('0x7'));var sox=require(_0xcd23('0x8'));var csv=require(_0xcd23('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd23('0xa'));var squel=require(_0xcd23('0xb'));var crypto=require(_0xcd23('0xc'));var jsforce=require(_0xcd23('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcd23('0x9'));var querystring=require(_0xcd23('0xe'));var Papa=require(_0xcd23('0xf'));var Redis=require('ioredis');var authService=require(_0xcd23('0x10'));var qs=require(_0xcd23('0x11'));var as=require(_0xcd23('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xcd23('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xcd23('0x14')]=_[_0xcd23('0x15')](config['redis'],{'host':_0xcd23('0x16'),'port':0x18eb});var socket=require(_0xcd23('0x17'))(new Redis(config['redis']));require(_0xcd23('0x18'))[_0xcd23('0x19')](socket);function respondWithStatusCode(_0xb17efb,_0x9b7d47){_0x9b7d47=_0x9b7d47||0xcc;return function(_0x2aa9d0){if(_0x2aa9d0){return _0xb17efb['sendStatus'](_0x9b7d47);}return _0xb17efb[_0xcd23('0x1a')](_0x9b7d47)[_0xcd23('0x1b')]();};}function respondWithResult(_0x214fe2,_0x2ffc2e){_0x2ffc2e=_0x2ffc2e||0xc8;return function(_0x5de3c1){if(_0x5de3c1){return _0x214fe2[_0xcd23('0x1a')](_0x2ffc2e)[_0xcd23('0x1c')](_0x5de3c1);}};}function respondWithFilteredResult(_0x160bd8,_0x1d60a3){return function(_0x2525f7){if(_0x2525f7){var _0x2ac631=typeof _0x1d60a3['offset']===_0xcd23('0x1d')&&typeof _0x1d60a3[_0xcd23('0x1e')]===_0xcd23('0x1d');var _0x5d352b=_0x2525f7[_0xcd23('0x1f')];var _0x2d2a5d=_0x2ac631?0x0:_0x1d60a3[_0xcd23('0x20')];var _0x560b6f=_0x2ac631?_0x2525f7[_0xcd23('0x1f')]:_0x1d60a3[_0xcd23('0x20')]+_0x1d60a3[_0xcd23('0x1e')];var _0x2d3733;if(_0x560b6f>=_0x5d352b){_0x560b6f=_0x5d352b;_0x2d3733=0xc8;}else{_0x2d3733=0xce;}_0x160bd8[_0xcd23('0x1a')](_0x2d3733);return _0x160bd8[_0xcd23('0x21')](_0xcd23('0x22'),_0x2d2a5d+'-'+_0x560b6f+'/'+_0x5d352b)['json'](_0x2525f7);}return null;};}function patchUpdates(_0x2cb697){return function(_0x2d095c){try{jsonpatch['apply'](_0x2d095c,_0x2cb697,!![]);}catch(_0x514ebc){return BPromise[_0xcd23('0x23')](_0x514ebc);}return _0x2d095c[_0xcd23('0x24')]();};}function saveUpdates(_0x3fc392,_0x1edacc){return function(_0x4b39dd){if(_0x4b39dd){return _0x4b39dd[_0xcd23('0x25')](_0x3fc392)[_0xcd23('0x26')](function(_0x981ad8){return _0x981ad8;});}return null;};}function removeEntity(_0x51d022,_0x4c9ba0){return function(_0x44d839){if(_0x44d839){return _0x44d839[_0xcd23('0x27')]()[_0xcd23('0x26')](function(){_0x51d022['status'](0xcc)[_0xcd23('0x1b')]();});}};}function handleEntityNotFound(_0x5e4f0c,_0x33a15f){return function(_0x56ee75){if(!_0x56ee75){_0x5e4f0c[_0xcd23('0x28')](0x194);}return _0x56ee75;};}function handleError(_0x309b5a,_0x4df9fc){_0x4df9fc=_0x4df9fc||0x1f4;return function(_0x5c788d){logger[_0xcd23('0x29')](_0x5c788d[_0xcd23('0x2a')]);if(_0x5c788d['name']){delete _0x5c788d[_0xcd23('0x2b')];}_0x309b5a[_0xcd23('0x1a')](_0x4df9fc)[_0xcd23('0x2c')](_0x5c788d);};}exports[_0xcd23('0x2d')]=function(_0x6f142,_0x49677d){var _0x3a754a={},_0x24c266={},_0x4df60a={'count':0x0,'rows':[]};var _0x4d5a29=_[_0xcd23('0x2e')](db[_0xcd23('0x2f')]['rawAttributes'],function(_0x4c8c54){return{'name':_0x4c8c54['fieldName'],'type':_0x4c8c54[_0xcd23('0x30')][_0xcd23('0x31')]};});_0x24c266[_0xcd23('0x32')]=_[_0xcd23('0x2e')](_0x4d5a29,_0xcd23('0x2b'));_0x24c266['query']=_['keys'](_0x6f142[_0xcd23('0x33')]);_0x24c266[_0xcd23('0x34')]=_[_0xcd23('0x35')](_0x24c266['model'],_0x24c266[_0xcd23('0x33')]);_0x3a754a['attributes']=_[_0xcd23('0x35')](_0x24c266[_0xcd23('0x32')],qs['fields'](_0x6f142[_0xcd23('0x33')]['fields']));_0x3a754a[_0xcd23('0x36')]=_0x3a754a[_0xcd23('0x36')]['length']?_0x3a754a[_0xcd23('0x36')]:_0x24c266['model'];if(!_0x6f142['query'][_0xcd23('0x37')](_0xcd23('0x38'))){_0x3a754a[_0xcd23('0x1e')]=qs['limit'](_0x6f142[_0xcd23('0x33')]['limit']);_0x3a754a[_0xcd23('0x20')]=qs[_0xcd23('0x20')](_0x6f142[_0xcd23('0x33')][_0xcd23('0x20')]);}_0x3a754a[_0xcd23('0x39')]=qs[_0xcd23('0x3a')](_0x6f142['query'][_0xcd23('0x3a')]);_0x3a754a[_0xcd23('0x3b')]=qs[_0xcd23('0x34')](_[_0xcd23('0x3c')](_0x6f142['query'],_0x24c266['filters']),_0x4d5a29);if(_0x6f142[_0xcd23('0x33')][_0xcd23('0x3d')]){_0x3a754a['where']=_[_0xcd23('0x3e')](_0x3a754a[_0xcd23('0x3b')],{'$or':_[_0xcd23('0x2e')](_0x4d5a29,function(_0x9ef197){if(_0x9ef197[_0xcd23('0x30')]!==_0xcd23('0x3f')){var _0x478e52={};_0x478e52[_0x9ef197['name']]={'$like':'%'+_0x6f142[_0xcd23('0x33')]['filter']+'%'};return _0x478e52;}})});}_0x3a754a=_['merge']({},_0x3a754a,_0x6f142[_0xcd23('0x40')]);var _0x50e22c={'where':_0x3a754a[_0xcd23('0x3b')]};return db[_0xcd23('0x2f')]['count'](_0x50e22c)[_0xcd23('0x26')](function(_0x5c4a31){_0x4df60a['count']=_0x5c4a31;if(_0x6f142['query']['includeAll']){_0x3a754a['include']=[{'all':!![]}];}return db[_0xcd23('0x2f')][_0xcd23('0x41')](_0x3a754a);})[_0xcd23('0x26')](function(_0x17cdd4){_0x4df60a[_0xcd23('0x42')]=_0x17cdd4;return _0x4df60a;})[_0xcd23('0x26')](respondWithFilteredResult(_0x49677d,_0x3a754a))[_0xcd23('0x43')](handleError(_0x49677d,null));};exports[_0xcd23('0x44')]=function(_0x457729,_0x5ed493){var _0x466540={'raw':!![],'where':{'id':_0x457729['params']['id']}},_0x4857da={};_0x4857da['model']=_[_0xcd23('0x45')](db[_0xcd23('0x2f')][_0xcd23('0x46')]);_0x4857da[_0xcd23('0x33')]=_['keys'](_0x457729[_0xcd23('0x33')]);_0x4857da[_0xcd23('0x34')]=_[_0xcd23('0x35')](_0x4857da[_0xcd23('0x32')],_0x4857da[_0xcd23('0x33')]);_0x466540[_0xcd23('0x36')]=_[_0xcd23('0x35')](_0x4857da[_0xcd23('0x32')],qs[_0xcd23('0x47')](_0x457729[_0xcd23('0x33')]['fields']));_0x466540[_0xcd23('0x36')]=_0x466540['attributes'][_0xcd23('0x48')]?_0x466540[_0xcd23('0x36')]:_0x4857da[_0xcd23('0x32')];if(_0x457729[_0xcd23('0x33')][_0xcd23('0x49')]){_0x466540[_0xcd23('0x4a')]=[{'all':!![]}];}_0x466540=_[_0xcd23('0x3e')]({},_0x466540,_0x457729[_0xcd23('0x40')]);return db[_0xcd23('0x2f')][_0xcd23('0x4b')](_0x466540)[_0xcd23('0x26')](handleEntityNotFound(_0x5ed493,null))[_0xcd23('0x26')](respondWithResult(_0x5ed493,null))['catch'](handleError(_0x5ed493,null));};exports[_0xcd23('0x4c')]=function(_0x488f78,_0x349451){return db[_0xcd23('0x2f')][_0xcd23('0x4c')](_0x488f78[_0xcd23('0x4d')],{})[_0xcd23('0x26')](respondWithResult(_0x349451,0xc9))[_0xcd23('0x43')](handleError(_0x349451,null));};exports[_0xcd23('0x25')]=function(_0x5ec2ac,_0x43c276){if(_0x5ec2ac[_0xcd23('0x4d')]['id']){delete _0x5ec2ac['body']['id'];}return db[_0xcd23('0x2f')]['find']({'where':{'id':_0x5ec2ac[_0xcd23('0x4e')]['id']}})[_0xcd23('0x26')](handleEntityNotFound(_0x43c276,null))['then'](saveUpdates(_0x5ec2ac['body'],null))[_0xcd23('0x26')](respondWithResult(_0x43c276,null))[_0xcd23('0x43')](handleError(_0x43c276,null));};exports[_0xcd23('0x27')]=function(_0x42982e,_0x36d91e){return db[_0xcd23('0x2f')][_0xcd23('0x4b')]({'where':{'id':_0x42982e['params']['id']}})[_0xcd23('0x26')](handleEntityNotFound(_0x36d91e,null))[_0xcd23('0x26')](removeEntity(_0x36d91e,null))['catch'](handleError(_0x36d91e,null));};exports['describe']=function(_0x2d2b26,_0x55db46){return db[_0xcd23('0x2f')][_0xcd23('0x4f')]()['then'](respondWithResult(_0x55db46,null))['catch'](handleError(_0x55db46,null));};function wrapUser(_0x19b834){return function(_0x5aac1c){var _0x37e319=_0x19b834[_0xcd23('0x50')]({'plain':!![]});_0x37e319['messages']=[];if(_0x5aac1c){_0x37e319[_0xcd23('0x51')]=_0x5aac1c[_0xcd23('0x52')];_0x37e319[_0xcd23('0x53')]=_0x5aac1c;}else{_0x37e319[_0xcd23('0x51')]=moment(0x0)[_0xcd23('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x37e319[_0xcd23('0x53')]={};}return _0x37e319;};}exports[_0xcd23('0x55')]=function(_0x439356,_0x5d5e14,_0x550ead){var _0xeb8fce=[];return db[_0xcd23('0x56')][_0xcd23('0x41')]({'where':{'role':[_0xcd23('0x57'),_0xcd23('0x58'),_0xcd23('0x59')]},'attributes':['id',_0xcd23('0x5a'),_0xcd23('0x2b'),_0xcd23('0x5b'),'userpic',_0xcd23('0x5c'),_0xcd23('0x5d'),_0xcd23('0x5e'),'allowmessenger',_0xcd23('0x5f')],'order':qs[_0xcd23('0x3a')](_0xcd23('0x60')),'include':[{'model':db[_0xcd23('0x61')],'as':'VoiceQueues','attributes':['id',_0xcd23('0x2b'),'type'],'through':{'attributes':[]}}]})[_0xcd23('0x26')](function(_0x5ade87){if(_0x5ade87){var _0x22e44b=_0x439356['user']['get']({'plain':!![]});if(!_0x22e44b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22e44b[_0xcd23('0x5b')]===_0xcd23('0x59')){return db[_0xcd23('0x62')]['find']({'where':{'name':_0xcd23('0x63'),'userProfileId':_0x22e44b['userProfileId']},'raw':!![]})[_0xcd23('0x26')](function(_0x564e26){if(_0x564e26){if(_0x564e26['autoAssociation']===0x0){return db[_0xcd23('0x64')][_0xcd23('0x41')]({'where':{'sectionId':_0x564e26['id']},'raw':!![]})[_0xcd23('0x26')](function(_0x1e9317){var _0x10669b=[];if(_[_0xcd23('0x65')](_0x1e9317)){_0x10669b=_[_0xcd23('0x3d')](_0x5ade87,function(_0x534583){if(_0x534583[_0xcd23('0x5b')]!==_0xcd23('0x57')){return _0x534583;}});return _0x10669b;}else{for(var _0x5167c6=0x0;_0x5167c6<_0x5ade87['length'];_0x5167c6++){var _0x34815f=_0x5ade87[_0x5167c6];if(_0x34815f[_0xcd23('0x5b')]===_0xcd23('0x57')){var _0x6320b3=_[_0xcd23('0x4b')](_0x1e9317,function(_0x169789){return _0x169789[_0xcd23('0x66')]===_0x34815f['id'];});if(_0x6320b3)_0x10669b[_0xcd23('0x67')](_0x34815f);}else{_0x10669b['push'](_0x34815f);}}return _0x10669b;}});}else{return _0x5ade87;}}else{var _0x2cc504=_['filter'](_0x5ade87,function(_0x2cf4a0){if(_0x2cf4a0[_0xcd23('0x5b')]!==_0xcd23('0x57')){return _0x2cf4a0;}});return _0x2cc504;}});}else{return _0x5ade87;}}})[_0xcd23('0x26')](function(_0x6eea3f){var _0x2c6a97=[];if(_0x6eea3f){_0xeb8fce=_0x6eea3f;for(var _0x271698=0x0;_0x271698<_0x6eea3f[_0xcd23('0x48')];_0x271698+=0x1){_0xeb8fce[_0x271698][_0xcd23('0x68')]=[];_0x2c6a97[_0xcd23('0x67')](db[_0xcd23('0x2f')][_0xcd23('0x4b')]({'where':{'FromId':[_0x439356['user']['id'],_0x6eea3f[_0x271698]['id']],'ToId':[_0x439356[_0xcd23('0x59')]['id'],_0x6eea3f[_0x271698]['id']],'ChatGroupId':null},'attributes':['id',_0xcd23('0x52'),_0xcd23('0x69'),_0xcd23('0x6a'),'read',_0xcd23('0x4d')],'order':qs[_0xcd23('0x3a')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xcd23('0x26')](wrapUser(_0x6eea3f[_0x271698])));}return BPromise[_0xcd23('0x6b')](_0x2c6a97);}return[];})['then'](function(_0x111153){return{'rows':_0x111153,'count':_0x111153[_0xcd23('0x48')]};})[_0xcd23('0x26')](respondWithResult(_0x5d5e14,null))['catch'](handleError(_0x5d5e14,null));};
\ No newline at end of file
+var _0x8519=['resourceId','push','FromId','-createdAt','all','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','options','includeAll','ChatInternalMessage','findAll','catch','show','params','length','include','find','create','body','describe','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','agent','admin','user','role','userpic','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty'];(function(_0x3b77a8,_0x466360){var _0x18af5f=function(_0x2dde22){while(--_0x2dde22){_0x3b77a8['push'](_0x3b77a8['shift']());}};_0x18af5f(++_0x466360);}(_0x8519,0x1b5));var _0x9851=function(_0x1111f3,_0x539015){_0x1111f3=_0x1111f3-0x0;var _0xd73af3=_0x8519[_0x1111f3];return _0xd73af3;};'use strict';var emlformat=require(_0x9851('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9851('0x1'));var jsonpatch=require(_0x9851('0x2'));var rp=require('request-promise');var moment=require(_0x9851('0x3'));var BPromise=require(_0x9851('0x4'));var Mustache=require(_0x9851('0x5'));var util=require(_0x9851('0x6'));var path=require(_0x9851('0x7'));var sox=require(_0x9851('0x8'));var csv=require('to-csv');var ejs=require(_0x9851('0x9'));var fs=require('fs');var fs_extra=require(_0x9851('0xa'));var _=require(_0x9851('0xb'));var squel=require(_0x9851('0xc'));var crypto=require(_0x9851('0xd'));var jsforce=require(_0x9851('0xe'));var deskjs=require(_0x9851('0xf'));var toCsv=require(_0x9851('0x10'));var querystring=require(_0x9851('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9851('0x12'));var qs=require(_0x9851('0x13'));var as=require(_0x9851('0x14'));var hardwareService=require(_0x9851('0x15'));var logger=require(_0x9851('0x16'))(_0x9851('0x17'));var utils=require(_0x9851('0x18'));var config=require(_0x9851('0x19'));var licenseUtil=require(_0x9851('0x1a'));var db=require(_0x9851('0x1b'))['db'];config[_0x9851('0x1c')]=_[_0x9851('0x1d')](config[_0x9851('0x1c')],{'host':_0x9851('0x1e'),'port':0x18eb});var socket=require(_0x9851('0x1f'))(new Redis(config[_0x9851('0x1c')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0xfdbfe4,_0x3df251){_0x3df251=_0x3df251||0xcc;return function(_0x3efda9){if(_0x3efda9){return _0xfdbfe4[_0x9851('0x20')](_0x3df251);}return _0xfdbfe4['status'](_0x3df251)[_0x9851('0x21')]();};}function respondWithResult(_0x362419,_0x3359bc){_0x3359bc=_0x3359bc||0xc8;return function(_0x2a710b){if(_0x2a710b){return _0x362419[_0x9851('0x22')](_0x3359bc)[_0x9851('0x23')](_0x2a710b);}};}function respondWithFilteredResult(_0x219744,_0x587111){return function(_0x40cd47){if(_0x40cd47){var _0xb35cdf=typeof _0x587111[_0x9851('0x24')]===_0x9851('0x25')&&typeof _0x587111[_0x9851('0x26')]===_0x9851('0x25');var _0x4e3839=_0x40cd47[_0x9851('0x27')];var _0x55f0b9=_0xb35cdf?0x0:_0x587111[_0x9851('0x24')];var _0x315934=_0xb35cdf?_0x40cd47[_0x9851('0x27')]:_0x587111[_0x9851('0x24')]+_0x587111[_0x9851('0x26')];var _0x24f826;if(_0x315934>=_0x4e3839){_0x315934=_0x4e3839;_0x24f826=0xc8;}else{_0x24f826=0xce;}_0x219744['status'](_0x24f826);return _0x219744[_0x9851('0x28')](_0x9851('0x29'),_0x55f0b9+'-'+_0x315934+'/'+_0x4e3839)[_0x9851('0x23')](_0x40cd47);}return null;};}function patchUpdates(_0x3de660){return function(_0x20424d){try{jsonpatch['apply'](_0x20424d,_0x3de660,!![]);}catch(_0x288e03){return BPromise[_0x9851('0x2a')](_0x288e03);}return _0x20424d['save']();};}function saveUpdates(_0x31ef10,_0x5bf8a2){return function(_0x348603){if(_0x348603){return _0x348603[_0x9851('0x2b')](_0x31ef10)[_0x9851('0x2c')](function(_0x27fe29){return _0x27fe29;});}return null;};}function removeEntity(_0x57898d,_0x989454){return function(_0x3fe72d){if(_0x3fe72d){return _0x3fe72d[_0x9851('0x2d')]()[_0x9851('0x2c')](function(){_0x57898d[_0x9851('0x22')](0xcc)[_0x9851('0x21')]();});}};}function handleEntityNotFound(_0x43ab32,_0x3778a5){return function(_0x571185){if(!_0x571185){_0x43ab32[_0x9851('0x20')](0x194);}return _0x571185;};}function handleError(_0x1a4bca,_0x23efca){_0x23efca=_0x23efca||0x1f4;return function(_0x19c867){logger[_0x9851('0x2e')](_0x19c867[_0x9851('0x2f')]);if(_0x19c867[_0x9851('0x30')]){delete _0x19c867[_0x9851('0x30')];}_0x1a4bca['status'](_0x23efca)['send'](_0x19c867);};}exports[_0x9851('0x31')]=function(_0xaadf2,_0xe6443d){var _0x3fa0c8={},_0x3d2522={},_0x2e5e4f={'count':0x0,'rows':[]};var _0x432628=_[_0x9851('0x32')](db['ChatInternalMessage'][_0x9851('0x33')],function(_0xef948){return{'name':_0xef948[_0x9851('0x34')],'type':_0xef948[_0x9851('0x35')][_0x9851('0x36')]};});_0x3d2522[_0x9851('0x37')]=_[_0x9851('0x32')](_0x432628,'name');_0x3d2522[_0x9851('0x38')]=_[_0x9851('0x39')](_0xaadf2[_0x9851('0x38')]);_0x3d2522[_0x9851('0x3a')]=_[_0x9851('0x3b')](_0x3d2522[_0x9851('0x37')],_0x3d2522[_0x9851('0x38')]);_0x3fa0c8[_0x9851('0x3c')]=_[_0x9851('0x3b')](_0x3d2522['model'],qs['fields'](_0xaadf2[_0x9851('0x38')][_0x9851('0x3d')]));_0x3fa0c8['attributes']=_0x3fa0c8[_0x9851('0x3c')]['length']?_0x3fa0c8[_0x9851('0x3c')]:_0x3d2522[_0x9851('0x37')];if(!_0xaadf2['query'][_0x9851('0x3e')]('nolimit')){_0x3fa0c8[_0x9851('0x26')]=qs[_0x9851('0x26')](_0xaadf2[_0x9851('0x38')][_0x9851('0x26')]);_0x3fa0c8[_0x9851('0x24')]=qs[_0x9851('0x24')](_0xaadf2[_0x9851('0x38')][_0x9851('0x24')]);}_0x3fa0c8[_0x9851('0x3f')]=qs[_0x9851('0x40')](_0xaadf2[_0x9851('0x38')][_0x9851('0x40')]);_0x3fa0c8[_0x9851('0x41')]=qs[_0x9851('0x3a')](_[_0x9851('0x42')](_0xaadf2[_0x9851('0x38')],_0x3d2522[_0x9851('0x3a')]),_0x432628);if(_0xaadf2[_0x9851('0x38')][_0x9851('0x43')]){_0x3fa0c8['where']=_['merge'](_0x3fa0c8['where'],{'$or':_[_0x9851('0x32')](_0x432628,function(_0x291b44){if(_0x291b44[_0x9851('0x35')]!=='VIRTUAL'){var _0x44ca19={};_0x44ca19[_0x291b44[_0x9851('0x30')]]={'$like':'%'+_0xaadf2[_0x9851('0x38')][_0x9851('0x43')]+'%'};return _0x44ca19;}})});}_0x3fa0c8=_['merge']({},_0x3fa0c8,_0xaadf2[_0x9851('0x44')]);var _0x474147={'where':_0x3fa0c8[_0x9851('0x41')]};return db['ChatInternalMessage'][_0x9851('0x27')](_0x474147)[_0x9851('0x2c')](function(_0x277183){_0x2e5e4f[_0x9851('0x27')]=_0x277183;if(_0xaadf2[_0x9851('0x38')][_0x9851('0x45')]){_0x3fa0c8['include']=[{'all':!![]}];}return db[_0x9851('0x46')][_0x9851('0x47')](_0x3fa0c8);})[_0x9851('0x2c')](function(_0x37a378){_0x2e5e4f['rows']=_0x37a378;return _0x2e5e4f;})['then'](respondWithFilteredResult(_0xe6443d,_0x3fa0c8))[_0x9851('0x48')](handleError(_0xe6443d,null));};exports[_0x9851('0x49')]=function(_0x241196,_0x309e2f){var _0x183500={'raw':!![],'where':{'id':_0x241196[_0x9851('0x4a')]['id']}},_0x48d3ff={};_0x48d3ff['model']=_[_0x9851('0x39')](db[_0x9851('0x46')][_0x9851('0x33')]);_0x48d3ff[_0x9851('0x38')]=_[_0x9851('0x39')](_0x241196[_0x9851('0x38')]);_0x48d3ff[_0x9851('0x3a')]=_['intersection'](_0x48d3ff[_0x9851('0x37')],_0x48d3ff['query']);_0x183500['attributes']=_[_0x9851('0x3b')](_0x48d3ff['model'],qs[_0x9851('0x3d')](_0x241196['query'][_0x9851('0x3d')]));_0x183500['attributes']=_0x183500['attributes'][_0x9851('0x4b')]?_0x183500[_0x9851('0x3c')]:_0x48d3ff[_0x9851('0x37')];if(_0x241196[_0x9851('0x38')][_0x9851('0x45')]){_0x183500[_0x9851('0x4c')]=[{'all':!![]}];}_0x183500=_['merge']({},_0x183500,_0x241196['options']);return db[_0x9851('0x46')][_0x9851('0x4d')](_0x183500)[_0x9851('0x2c')](handleEntityNotFound(_0x309e2f,null))['then'](respondWithResult(_0x309e2f,null))[_0x9851('0x48')](handleError(_0x309e2f,null));};exports[_0x9851('0x4e')]=function(_0x11c832,_0x2f843f){return db[_0x9851('0x46')][_0x9851('0x4e')](_0x11c832['body'],{})[_0x9851('0x2c')](respondWithResult(_0x2f843f,0xc9))['catch'](handleError(_0x2f843f,null));};exports[_0x9851('0x2b')]=function(_0xb0d624,_0x5af637){if(_0xb0d624[_0x9851('0x4f')]['id']){delete _0xb0d624[_0x9851('0x4f')]['id'];}return db[_0x9851('0x46')][_0x9851('0x4d')]({'where':{'id':_0xb0d624[_0x9851('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5af637,null))[_0x9851('0x2c')](saveUpdates(_0xb0d624[_0x9851('0x4f')],null))[_0x9851('0x2c')](respondWithResult(_0x5af637,null))[_0x9851('0x48')](handleError(_0x5af637,null));};exports[_0x9851('0x2d')]=function(_0x29a100,_0x247916){return db[_0x9851('0x46')][_0x9851('0x4d')]({'where':{'id':_0x29a100[_0x9851('0x4a')]['id']}})[_0x9851('0x2c')](handleEntityNotFound(_0x247916,null))[_0x9851('0x2c')](removeEntity(_0x247916,null))[_0x9851('0x48')](handleError(_0x247916,null));};exports[_0x9851('0x50')]=function(_0x571760,_0x2495ad){return db[_0x9851('0x46')][_0x9851('0x50')]()[_0x9851('0x2c')](respondWithResult(_0x2495ad,null))[_0x9851('0x48')](handleError(_0x2495ad,null));};function wrapUser(_0x22046b){return function(_0x463988){var _0x38ba91=_0x22046b['get']({'plain':!![]});_0x38ba91[_0x9851('0x51')]=[];if(_0x463988){_0x38ba91[_0x9851('0x52')]=_0x463988[_0x9851('0x53')];_0x38ba91[_0x9851('0x54')]=_0x463988;}else{_0x38ba91[_0x9851('0x52')]=moment(0x0)['format'](_0x9851('0x55'));_0x38ba91['lastMessage']={};}return _0x38ba91;};}exports['getUsers']=function(_0x49a084,_0x4b2873,_0x5ce970){var _0x38cd77=[];return db['User'][_0x9851('0x47')]({'where':{'role':[_0x9851('0x56'),_0x9851('0x57'),_0x9851('0x58')]},'attributes':['id','fullname',_0x9851('0x30'),_0x9851('0x59'),_0x9851('0x5a'),'internal',_0x9851('0x5b'),_0x9851('0x5c'),'allowmessenger',_0x9851('0x5d')],'order':qs[_0x9851('0x40')](_0x9851('0x5e')),'include':[{'model':db[_0x9851('0x5f')],'as':_0x9851('0x60'),'attributes':['id','name',_0x9851('0x35')],'through':{'attributes':[]}}]})[_0x9851('0x2c')](function(_0x481290){if(_0x481290){var _0x130937=_0x49a084['user']['get']({'plain':!![]});if(!_0x130937)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x130937[_0x9851('0x59')]==='user'){return db[_0x9851('0x61')][_0x9851('0x4d')]({'where':{'name':_0x9851('0x62'),'userProfileId':_0x130937[_0x9851('0x63')]},'raw':!![]})[_0x9851('0x2c')](function(_0x209df3){if(_0x209df3){if(_0x209df3[_0x9851('0x64')]===0x0){return db[_0x9851('0x65')]['findAll']({'where':{'sectionId':_0x209df3['id']},'raw':!![]})[_0x9851('0x2c')](function(_0x288783){var _0x23f5c7=[];if(_[_0x9851('0x66')](_0x288783)){_0x23f5c7=_['filter'](_0x481290,function(_0x519f03){if(_0x519f03['role']!==_0x9851('0x56')){return _0x519f03;}});return _0x23f5c7;}else{for(var _0x77b95d=0x0;_0x77b95d<_0x481290[_0x9851('0x4b')];_0x77b95d++){var _0x226045=_0x481290[_0x77b95d];if(_0x226045[_0x9851('0x59')]==='agent'){var _0x59e81b=_[_0x9851('0x4d')](_0x288783,function(_0x5ec285){return _0x5ec285[_0x9851('0x67')]===_0x226045['id'];});if(_0x59e81b)_0x23f5c7[_0x9851('0x68')](_0x226045);}else{_0x23f5c7[_0x9851('0x68')](_0x226045);}}return _0x23f5c7;}});}else{return _0x481290;}}else{var _0x51dd6a=_['filter'](_0x481290,function(_0x119dc4){if(_0x119dc4[_0x9851('0x59')]!==_0x9851('0x56')){return _0x119dc4;}});return _0x51dd6a;}});}else{return _0x481290;}}})[_0x9851('0x2c')](function(_0xaec9ca){var _0x566295=[];if(_0xaec9ca){_0x38cd77=_0xaec9ca;for(var _0x207ba8=0x0;_0x207ba8<_0xaec9ca[_0x9851('0x4b')];_0x207ba8+=0x1){_0x38cd77[_0x207ba8][_0x9851('0x51')]=[];_0x566295[_0x9851('0x68')](db[_0x9851('0x46')]['find']({'where':{'FromId':[_0x49a084[_0x9851('0x58')]['id'],_0xaec9ca[_0x207ba8]['id']],'ToId':[_0x49a084[_0x9851('0x58')]['id'],_0xaec9ca[_0x207ba8]['id']],'ChatGroupId':null},'attributes':['id',_0x9851('0x53'),_0x9851('0x69'),'ToId','read','body'],'order':qs[_0x9851('0x40')](_0x9851('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0xaec9ca[_0x207ba8])));}return BPromise[_0x9851('0x6b')](_0x566295);}return[];})['then'](function(_0x2356f5){return{'rows':_0x2356f5,'count':_0x2356f5[_0x9851('0x4b')]};})[_0x9851('0x2c')](respondWithResult(_0x4b2873,null))['catch'](handleError(_0x4b2873,null));};
\ No newline at end of file
index 6985045..3d3f144 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7336=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7336,0x141));var _0x6733=function(_0x1a6c5c,_0x3a5f5f){_0x1a6c5c=_0x1a6c5c-0x0;var _0x3a5421=_0x7336[_0x1a6c5c];return _0x3a5421;};'use strict';var EventEmitter=require(_0x6733('0x0'));var ChatInternalMessage=require(_0x6733('0x1'))['db'][_0x6733('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6733('0x3'),'afterDestroy':_0x6733('0x4')};function emitEvent(_0x3a6f80){return function(_0x555725,_0x212035,_0x406410){ChatInternalMessageEvents[_0x6733('0x5')](_0x3a6f80+':'+_0x555725['id'],_0x555725);ChatInternalMessageEvents[_0x6733('0x5')](_0x3a6f80,_0x555725);_0x406410(null);};}for(var e in events){if(events[_0x6733('0x6')](e)){var event=events[e];ChatInternalMessage[_0x6733('0x7')](e,emitEvent(event));}}module[_0x6733('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x7b8f=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x25db2a,_0x12d182){var _0x3b7682=function(_0xf0d880){while(--_0xf0d880){_0x25db2a['push'](_0x25db2a['shift']());}};_0x3b7682(++_0x12d182);}(_0x7b8f,0x1cb));var _0xf7b8=function(_0x204e52,_0x1d553a){_0x204e52=_0x204e52-0x0;var _0xe5dd25=_0x7b8f[_0x204e52];return _0xe5dd25;};'use strict';var EventEmitter=require(_0xf7b8('0x0'));var ChatInternalMessage=require(_0xf7b8('0x1'))['db'][_0xf7b8('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf7b8('0x3')](0x0);var events={'afterCreate':_0xf7b8('0x4'),'afterUpdate':_0xf7b8('0x5'),'afterDestroy':_0xf7b8('0x6')};function emitEvent(_0x1baa84){return function(_0x28b120,_0x849dba,_0x793de0){ChatInternalMessageEvents[_0xf7b8('0x7')](_0x1baa84+':'+_0x28b120['id'],_0x28b120);ChatInternalMessageEvents[_0xf7b8('0x7')](_0x1baa84,_0x28b120);_0x793de0(null);};}for(var e in events){if(events[_0xf7b8('0x8')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xf7b8('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
index 40303c6..f7df94d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7d9=['../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path'];(function(_0x1e0ac7,_0x25a571){var _0xc2b1e1=function(_0x38e588){while(--_0x38e588){_0x1e0ac7['push'](_0x1e0ac7['shift']());}};_0xc2b1e1(++_0x25a571);}(_0xa7d9,0x8a));var _0x9a7d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa7d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9a7d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9a7d('0x1'));var moment=require('moment');var BPromise=require(_0x9a7d('0x2'));var rp=require(_0x9a7d('0x3'));var fs=require('fs');var path=require(_0x9a7d('0x4'));var rimraf=require('rimraf');var config=require(_0x9a7d('0x5'));var attributes=require(_0x9a7d('0x6'));module[_0x9a7d('0x7')]=function(_0x3b0607,_0xe31625){return _0x3b0607['define'](_0x9a7d('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9a7d('0x9'),'collate':_0x9a7d('0xa')});};
\ No newline at end of file
+var _0x1562=['ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','api','moment','bluebird','rimraf','../../config/environment','exports','define'];(function(_0x35e3a2,_0x330e06){var _0x471e4d=function(_0x89831c){while(--_0x89831c){_0x35e3a2['push'](_0x35e3a2['shift']());}};_0x471e4d(++_0x330e06);}(_0x1562,0x14d));var _0x2156=function(_0x23b2b4,_0x1af875){_0x23b2b4=_0x23b2b4-0x0;var _0x4918ae=_0x1562[_0x23b2b4];return _0x4918ae;};'use strict';var _=require(_0x2156('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2156('0x1'));var moment=require(_0x2156('0x2'));var BPromise=require(_0x2156('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2156('0x4'));var config=require(_0x2156('0x5'));var attributes=require('./chatInternalMessage.attributes');module[_0x2156('0x6')]=function(_0x16fbca,_0x178d78){return _0x16fbca[_0x2156('0x7')](_0x2156('0x8'),attributes,{'tableName':_0x2156('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2156('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 092959c..243c0c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1c6=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','lodash'];(function(_0x3266dc,_0x129686){var _0x456a1a=function(_0xa60445){while(--_0xa60445){_0x3266dc['push'](_0x3266dc['shift']());}};_0x456a1a(++_0x129686);}(_0xa1c6,0x195));var _0x6a1c=function(_0x281cc4,_0x4e15d9){_0x281cc4=_0x281cc4-0x0;var _0x469546=_0xa1c6[_0x281cc4];return _0x469546;};'use strict';var _=require(_0x6a1c('0x0'));var util=require(_0x6a1c('0x1'));var moment=require(_0x6a1c('0x2'));var BPromise=require(_0x6a1c('0x3'));var rs=require(_0x6a1c('0x4'));var fs=require('fs');var Redis=require(_0x6a1c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6a1c('0x6'));var logger=require(_0x6a1c('0x7'))(_0x6a1c('0x8'));var config=require(_0x6a1c('0x9'));var jayson=require(_0x6a1c('0xa'));var client=jayson[_0x6a1c('0xb')][_0x6a1c('0xc')]({'port':0x232a});config[_0x6a1c('0xd')]=_[_0x6a1c('0xe')](config['redis'],{'host':_0x6a1c('0xf'),'port':0x18eb});var socket=require(_0x6a1c('0x10'))(new Redis(config['redis']));require(_0x6a1c('0x11'))[_0x6a1c('0x12')](socket);function respondWithRpcPromise(_0x17df3c,_0x46b805,_0x571e59){return new BPromise(function(_0x2d2713,_0x4d3eb9){return client[_0x6a1c('0x13')](_0x17df3c,_0x571e59)['then'](function(_0x18e373){logger['info'](_0x6a1c('0x14'),_0x46b805,'request\x20sent');logger[_0x6a1c('0x15')](_0x6a1c('0x16'),_0x46b805,_0x6a1c('0x17'),JSON['stringify'](_0x18e373));if(_0x18e373[_0x6a1c('0x18')]){if(_0x18e373['error'][_0x6a1c('0x19')]===0x1f4){logger['error'](_0x6a1c('0x14'),_0x46b805,_0x18e373['error'][_0x6a1c('0x1a')]);return _0x4d3eb9(_0x18e373[_0x6a1c('0x18')][_0x6a1c('0x1a')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x46b805,_0x18e373[_0x6a1c('0x18')][_0x6a1c('0x1a')]);return _0x2d2713(_0x18e373[_0x6a1c('0x18')][_0x6a1c('0x1a')]);}else{logger[_0x6a1c('0x1b')](_0x6a1c('0x14'),_0x46b805,_0x6a1c('0x17'));_0x2d2713(_0x18e373[_0x6a1c('0x1c')][_0x6a1c('0x1a')]);}})['catch'](function(_0x5589dd){logger[_0x6a1c('0x18')](_0x6a1c('0x14'),_0x46b805,_0x5589dd);_0x4d3eb9(_0x5589dd);});});}
\ No newline at end of file
+var _0x7399=['request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','./chatInternalMessage.socket','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x36d91f,_0x41da8d){var _0x3f95e8=function(_0x3a09dc){while(--_0x3a09dc){_0x36d91f['push'](_0x36d91f['shift']());}};_0x3f95e8(++_0x41da8d);}(_0x7399,0x13e));var _0x9739=function(_0x24003a,_0x4f4649){_0x24003a=_0x24003a-0x0;var _0x1d76b0=_0x7399[_0x24003a];return _0x1d76b0;};'use strict';var _=require(_0x9739('0x0'));var util=require(_0x9739('0x1'));var moment=require(_0x9739('0x2'));var BPromise=require(_0x9739('0x3'));var rs=require(_0x9739('0x4'));var fs=require('fs');var Redis=require(_0x9739('0x5'));var db=require(_0x9739('0x6'))['db'];var utils=require(_0x9739('0x7'));var logger=require(_0x9739('0x8'))(_0x9739('0x9'));var config=require(_0x9739('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x9739('0xb')]=_['defaults'](config[_0x9739('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9739('0xb')]));require(_0x9739('0xc'))['register'](socket);function respondWithRpcPromise(_0x12b05c,_0x3555dc,_0x1681d1){return new BPromise(function(_0x442966,_0x2b9d3a){return client['request'](_0x12b05c,_0x1681d1)[_0x9739('0xd')](function(_0x2c897a){logger[_0x9739('0xe')](_0x9739('0xf'),_0x3555dc,'request\x20sent');logger[_0x9739('0x10')](_0x9739('0x11'),_0x3555dc,_0x9739('0x12'),JSON[_0x9739('0x13')](_0x2c897a));if(_0x2c897a[_0x9739('0x14')]){if(_0x2c897a[_0x9739('0x14')][_0x9739('0x15')]===0x1f4){logger['error'](_0x9739('0xf'),_0x3555dc,_0x2c897a[_0x9739('0x14')][_0x9739('0x16')]);return _0x2b9d3a(_0x2c897a[_0x9739('0x14')][_0x9739('0x16')]);}logger[_0x9739('0x14')](_0x9739('0xf'),_0x3555dc,_0x2c897a[_0x9739('0x14')]['message']);return _0x442966(_0x2c897a['error']['message']);}else{logger[_0x9739('0xe')](_0x9739('0xf'),_0x3555dc,_0x9739('0x12'));_0x442966(_0x2c897a[_0x9739('0x17')]['message']);}})['catch'](function(_0x508a91){logger[_0x9739('0x14')](_0x9739('0xf'),_0x3555dc,_0x508a91);_0x2b9d3a(_0x508a91);});});}
\ No newline at end of file
index cc18a8f..f84b0f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50d6=['length','chatInternalMessage:','./chatInternalMessage.events','save','removeListener','register'];(function(_0x1a61db,_0x3ad3af){var _0x5ac3bf=function(_0x2eca5b){while(--_0x2eca5b){_0x1a61db['push'](_0x1a61db['shift']());}};_0x5ac3bf(++_0x3ad3af);}(_0x50d6,0x170));var _0x650d=function(_0x80b6a,_0x1b138c){_0x80b6a=_0x80b6a-0x0;var _0x58de9b=_0x50d6[_0x80b6a];return _0x58de9b;};'use strict';var ChatInternalMessageEvents=require(_0x650d('0x0'));var events=[_0x650d('0x1'),'remove','update'];function createListener(_0x158141,_0x364b86){return function(_0x49cf63){_0x364b86['emit'](_0x158141,_0x49cf63);};}function removeListener(_0x473a1f,_0x14f3cc){return function(){ChatInternalMessageEvents[_0x650d('0x2')](_0x473a1f,_0x14f3cc);};}exports[_0x650d('0x3')]=function(_0x2982b9){for(var _0x167e8c=0x0,_0x5a0f0a=events[_0x650d('0x4')];_0x167e8c<_0x5a0f0a;_0x167e8c++){var _0x4be29e=events[_0x167e8c];var _0x371bfb=createListener(_0x650d('0x5')+_0x4be29e,_0x2982b9);ChatInternalMessageEvents['on'](_0x4be29e,_0x371bfb);}};
\ No newline at end of file
+var _0x00b7=['register','length','chatInternalMessage:','./chatInternalMessage.events','emit','removeListener'];(function(_0x16d9d7,_0x4cc7fd){var _0x596ed0=function(_0x500b6e){while(--_0x500b6e){_0x16d9d7['push'](_0x16d9d7['shift']());}};_0x596ed0(++_0x4cc7fd);}(_0x00b7,0xab));var _0x700b=function(_0x59d24c,_0x5b012e){_0x59d24c=_0x59d24c-0x0;var _0x165db5=_0x00b7[_0x59d24c];return _0x165db5;};'use strict';var ChatInternalMessageEvents=require(_0x700b('0x0'));var events=['save','remove','update'];function createListener(_0x45fb06,_0x1c669b){return function(_0x245a33){_0x1c669b[_0x700b('0x1')](_0x45fb06,_0x245a33);};}function removeListener(_0x3c5e4a,_0x18e748){return function(){ChatInternalMessageEvents[_0x700b('0x2')](_0x3c5e4a,_0x18e748);};}exports[_0x700b('0x3')]=function(_0x50ad49){for(var _0x1a612d=0x0,_0x514948=events[_0x700b('0x4')];_0x1a612d<_0x514948;_0x1a612d++){var _0x44413f=events[_0x1a612d];var _0x3a3612=createListener(_0x700b('0x5')+_0x44413f,_0x50ad49);ChatInternalMessageEvents['on'](_0x44413f,_0x3a3612);}};
\ No newline at end of file
index 937a8cf..04b99f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdeb1=['/:id','post','create','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users'];(function(_0x2ad35f,_0x3b8bce){var _0x444bbf=function(_0x47a8a6){while(--_0x47a8a6){_0x2ad35f['push'](_0x2ad35f['shift']());}};_0x444bbf(++_0x3b8bce);}(_0xdeb1,0x194));var _0x1deb=function(_0x290ae8,_0x10fffc){_0x290ae8=_0x290ae8-0x0;var _0x247612=_0xdeb1[_0x290ae8];return _0x247612;};'use strict';var multer=require(_0x1deb('0x0'));var util=require(_0x1deb('0x1'));var path=require(_0x1deb('0x2'));var timeout=require(_0x1deb('0x3'));var express=require('express');var router=express[_0x1deb('0x4')]();var fs_extra=require(_0x1deb('0x5'));var auth=require(_0x1deb('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1deb('0x7'));router[_0x1deb('0x8')]('/',auth[_0x1deb('0x9')](),controller[_0x1deb('0xa')]);router[_0x1deb('0x8')](_0x1deb('0xb'),auth['isAuthenticated'](),controller[_0x1deb('0xc')]);router[_0x1deb('0x8')](_0x1deb('0xd'),auth[_0x1deb('0x9')](),controller['getUsers']);router[_0x1deb('0x8')](_0x1deb('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x1deb('0xf')]('/',auth[_0x1deb('0x9')](),controller[_0x1deb('0x10')]);router['put'](_0x1deb('0xe'),controller[_0x1deb('0x11')]);router['delete']('/:id',auth[_0x1deb('0x9')](),controller['destroy']);module[_0x1deb('0x12')]=router;
\ No newline at end of file
+var _0x7432=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','describe','/users','getUsers','/:id','show','post','create','update','multer','util','path','connect-timeout'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x7432,0x13e));var _0x2743=function(_0x3a0747,_0x2dfac3){_0x3a0747=_0x3a0747-0x0;var _0x2a4450=_0x7432[_0x3a0747];return _0x2a4450;};'use strict';var multer=require(_0x2743('0x0'));var util=require(_0x2743('0x1'));var path=require(_0x2743('0x2'));var timeout=require(_0x2743('0x3'));var express=require(_0x2743('0x4'));var router=express[_0x2743('0x5')]();var fs_extra=require(_0x2743('0x6'));var auth=require(_0x2743('0x7'));var interaction=require(_0x2743('0x8'));var config=require(_0x2743('0x9'));var controller=require(_0x2743('0xa'));router[_0x2743('0xb')]('/',auth['isAuthenticated'](),controller[_0x2743('0xc')]);router['get'](_0x2743('0xd'),auth[_0x2743('0xe')](),controller[_0x2743('0xf')]);router[_0x2743('0xb')](_0x2743('0x10'),auth[_0x2743('0xe')](),controller[_0x2743('0x11')]);router[_0x2743('0xb')](_0x2743('0x12'),auth[_0x2743('0xe')](),controller[_0x2743('0x13')]);router[_0x2743('0x14')]('/',auth[_0x2743('0xe')](),controller[_0x2743('0x15')]);router['put'](_0x2743('0x12'),controller[_0x2743('0x16')]);router['delete'](_0x2743('0x12'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 972ec73..03b784e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x253d=['out','DATE','TEXT','sequelize','BOOLEAN','ENUM'];(function(_0x33f459,_0x2ade6e){var _0x2ec524=function(_0x5eb825){while(--_0x5eb825){_0x33f459['push'](_0x33f459['shift']());}};_0x2ec524(++_0x2ade6e);}(_0x253d,0x1b3));var _0xd253=function(_0x4e0962,_0x5c4a8c){_0x4e0962=_0x4e0962-0x0;var _0x242e78=_0x253d[_0x4e0962];return _0x242e78;};'use strict';var Sequelize=require(_0xd253('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xd253('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd253('0x2')]('in',_0xd253('0x3')),'defaultValue':_0xd253('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd253('0x4')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xd253('0x5')]}};
\ No newline at end of file
+var _0x2964=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x825ce5,_0x420669){var _0x27495b=function(_0x1fb2da){while(--_0x1fb2da){_0x825ce5['push'](_0x825ce5['shift']());}};_0x27495b(++_0x420669);}(_0x2964,0x108));var _0x4296=function(_0x18dcee,_0x160bd2){_0x18dcee=_0x18dcee-0x0;var _0x2a4e56=_0x2964[_0x18dcee];return _0x2a4e56;};'use strict';var Sequelize=require(_0x4296('0x0'));module[_0x4296('0x1')]={'body':{'type':Sequelize[_0x4296('0x2')](_0x4296('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4296('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4296('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4296('0x5')]('in',_0x4296('0x6')),'defaultValue':_0x4296('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x4296('0x7')]},'providerResponse':{'type':Sequelize[_0x4296('0x2')]}};
\ No newline at end of file
index 7632370..14f520c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95e0=['ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','model','rawAttributes','find','create','body','params','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','channel','motionChannel','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','interface','SIP/%s','event','rejectmessage','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','jayson/promise','http','client','request','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','info','catch','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','end','name','send','index','map'];(function(_0x49b78f,_0x1ccdf7){var _0x544d2=function(_0x396757){while(--_0x396757){_0x49b78f['push'](_0x49b78f['shift']());}};_0x544d2(++_0x1ccdf7);}(_0x95e0,0x1e0));var _0x095e=function(_0x293b1d,_0x3e5c3c){_0x293b1d=_0x293b1d-0x0;var _0x48a2fe=_0x95e0[_0x293b1d];return _0x48a2fe;};'use strict';var emlformat=require(_0x095e('0x0'));var rimraf=require(_0x095e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x095e('0x2'));var moment=require(_0x095e('0x3'));var BPromise=require(_0x095e('0x4'));var Mustache=require(_0x095e('0x5'));var util=require('util');var path=require(_0x095e('0x6'));var sox=require('sox');var csv=require(_0x095e('0x7'));var ejs=require(_0x095e('0x8'));var fs=require('fs');var fs_extra=require(_0x095e('0x9'));var _=require(_0x095e('0xa'));var squel=require(_0x095e('0xb'));var crypto=require(_0x095e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x095e('0xd'));var toCsv=require(_0x095e('0x7'));var querystring=require(_0x095e('0xe'));var Papa=require(_0x095e('0xf'));var Redis=require(_0x095e('0x10'));var authService=require(_0x095e('0x11'));var qs=require(_0x095e('0x12'));var as=require(_0x095e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x095e('0x14'))('api');var utils=require(_0x095e('0x15'));var config=require(_0x095e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x095e('0x17'))['db'];config[_0x095e('0x18')]=_[_0x095e('0x19')](config[_0x095e('0x18')],{'host':_0x095e('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x095e('0x18')]));require(_0x095e('0x1b'))['register'](socket);var jayson=require(_0x095e('0x1c'));var client=jayson['client'][_0x095e('0x1d')]({'port':0x232c});var client9002=jayson[_0x095e('0x1e')][_0x095e('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3a8f77,_0x481b57,_0x34ad77,_0x4a3bef){return new BPromise(function(_0xdd2e78,_0x31931f){var _0x25a01c=_0x4a3bef||client;return _0x25a01c[_0x095e('0x1f')](_0x3a8f77,_0x34ad77)['then'](function(_0x30d8b2){logger['info']('ChatMessage,\x20%s,\x20%s',_0x481b57,_0x095e('0x20'));logger[_0x095e('0x21')](_0x095e('0x22'),_0x481b57,'request\x20sent',JSON[_0x095e('0x23')](_0x30d8b2));if(_0x30d8b2['error']){if(_0x30d8b2[_0x095e('0x24')][_0x095e('0x25')]===0x1f4){logger[_0x095e('0x24')]('ChatMessage,\x20%s,\x20%s',_0x481b57,_0x30d8b2[_0x095e('0x24')][_0x095e('0x26')]);return _0x31931f(_0x30d8b2[_0x095e('0x24')][_0x095e('0x26')]);}logger[_0x095e('0x24')](_0x095e('0x27'),_0x481b57,_0x30d8b2['error'][_0x095e('0x26')]);return _0xdd2e78(_0x30d8b2['error'][_0x095e('0x26')]);}else{logger[_0x095e('0x28')](_0x095e('0x27'),_0x481b57,_0x095e('0x20'));_0xdd2e78(_0x30d8b2['result'][_0x095e('0x26')]);}})[_0x095e('0x29')](function(_0x335d0e){logger[_0x095e('0x24')](_0x095e('0x27'),_0x481b57,_0x335d0e);_0x31931f(_0x335d0e);});});}function respondWithStatusCode(_0x4a6e33,_0x2fe922){_0x2fe922=_0x2fe922||0xcc;return function(_0x2f8c61){if(_0x2f8c61){return _0x4a6e33[_0x095e('0x2a')](_0x2fe922);}return _0x4a6e33[_0x095e('0x2b')](_0x2fe922)['end']();};}function respondWithResult(_0x44ddc2,_0x1a3a52){_0x1a3a52=_0x1a3a52||0xc8;return function(_0x1c1eef){if(_0x1c1eef){return _0x44ddc2[_0x095e('0x2b')](_0x1a3a52)[_0x095e('0x2c')](_0x1c1eef);}};}function respondWithFilteredResult(_0x5dea74,_0x596638){return function(_0x569ade){if(_0x569ade){var _0x4f3223=typeof _0x596638[_0x095e('0x2d')]===_0x095e('0x2e')&&typeof _0x596638[_0x095e('0x2f')]===_0x095e('0x2e');var _0x5cc56d=_0x569ade['count'];var _0x3c4457=_0x4f3223?0x0:_0x596638[_0x095e('0x2d')];var _0x14d40a=_0x4f3223?_0x569ade[_0x095e('0x30')]:_0x596638['offset']+_0x596638['limit'];var _0x9ee77;if(_0x14d40a>=_0x5cc56d){_0x14d40a=_0x5cc56d;_0x9ee77=0xc8;}else{_0x9ee77=0xce;}_0x5dea74[_0x095e('0x2b')](_0x9ee77);return _0x5dea74['set']('Content-Range',_0x3c4457+'-'+_0x14d40a+'/'+_0x5cc56d)[_0x095e('0x2c')](_0x569ade);}return null;};}function patchUpdates(_0x5da5a6){return function(_0x5afe4d){try{jsonpatch[_0x095e('0x31')](_0x5afe4d,_0x5da5a6,!![]);}catch(_0x4410cf){return BPromise[_0x095e('0x32')](_0x4410cf);}return _0x5afe4d[_0x095e('0x33')]();};}function saveUpdates(_0x5a469c,_0xa04b68){return function(_0x355964){if(_0x355964){return _0x355964[_0x095e('0x34')](_0x5a469c)['then'](function(_0x11b46e){return _0x11b46e;});}return null;};}function removeEntity(_0x1c4bcb,_0x507998){return function(_0xa6edc0){if(_0xa6edc0){return _0xa6edc0[_0x095e('0x35')]()[_0x095e('0x36')](function(){_0x1c4bcb[_0x095e('0x2b')](0xcc)[_0x095e('0x37')]();});}};}function handleEntityNotFound(_0x59a930,_0x6cfa16){return function(_0x4fcb86){if(!_0x4fcb86){_0x59a930['sendStatus'](0x194);}return _0x4fcb86;};}function handleError(_0x19d50a,_0x5651ae){_0x5651ae=_0x5651ae||0x1f4;return function(_0x3c9021){logger[_0x095e('0x24')](_0x3c9021['stack']);if(_0x3c9021[_0x095e('0x38')]){delete _0x3c9021['name'];}_0x19d50a['status'](_0x5651ae)[_0x095e('0x39')](_0x3c9021);};}exports[_0x095e('0x3a')]=function(_0x1d1d0b,_0x4be172){var _0x25e523={},_0x4654b6={},_0x38778a={'count':0x0,'rows':[]};var _0x184f5b=_[_0x095e('0x3b')](db[_0x095e('0x3c')]['rawAttributes'],function(_0x5d10db){return{'name':_0x5d10db[_0x095e('0x3d')],'type':_0x5d10db[_0x095e('0x3e')]['key']};});_0x4654b6['model']=_[_0x095e('0x3b')](_0x184f5b,'name');_0x4654b6['query']=_[_0x095e('0x3f')](_0x1d1d0b[_0x095e('0x40')]);_0x4654b6[_0x095e('0x41')]=_[_0x095e('0x42')](_0x4654b6['model'],_0x4654b6[_0x095e('0x40')]);_0x25e523[_0x095e('0x43')]=_[_0x095e('0x42')](_0x4654b6['model'],qs[_0x095e('0x44')](_0x1d1d0b[_0x095e('0x40')][_0x095e('0x44')]));_0x25e523[_0x095e('0x43')]=_0x25e523[_0x095e('0x43')][_0x095e('0x45')]?_0x25e523[_0x095e('0x43')]:_0x4654b6['model'];if(!_0x1d1d0b[_0x095e('0x40')][_0x095e('0x46')](_0x095e('0x47'))){_0x25e523[_0x095e('0x2f')]=qs[_0x095e('0x2f')](_0x1d1d0b[_0x095e('0x40')][_0x095e('0x2f')]);_0x25e523['offset']=qs[_0x095e('0x2d')](_0x1d1d0b[_0x095e('0x40')]['offset']);}_0x25e523[_0x095e('0x48')]=qs['sort'](_0x1d1d0b[_0x095e('0x40')][_0x095e('0x49')]);_0x25e523[_0x095e('0x4a')]=qs[_0x095e('0x41')](_[_0x095e('0x4b')](_0x1d1d0b[_0x095e('0x40')],_0x4654b6[_0x095e('0x41')]),_0x184f5b);if(_0x1d1d0b['query'][_0x095e('0x4c')]){_0x25e523['where']=_['merge'](_0x25e523['where'],{'$or':_[_0x095e('0x3b')](_0x184f5b,function(_0x1762d4){if(_0x1762d4[_0x095e('0x3e')]!==_0x095e('0x4d')){var _0x210e59={};_0x210e59[_0x1762d4[_0x095e('0x38')]]={'$like':'%'+_0x1d1d0b[_0x095e('0x40')][_0x095e('0x4c')]+'%'};return _0x210e59;}})});}_0x25e523=_[_0x095e('0x4e')]({},_0x25e523,_0x1d1d0b[_0x095e('0x4f')]);var _0xfedb5f={'where':_0x25e523[_0x095e('0x4a')]};return db[_0x095e('0x3c')][_0x095e('0x30')](_0xfedb5f)['then'](function(_0x59d9ee){_0x38778a[_0x095e('0x30')]=_0x59d9ee;if(_0x1d1d0b[_0x095e('0x40')][_0x095e('0x50')]){_0x25e523[_0x095e('0x51')]=[{'all':!![]}];}return db[_0x095e('0x3c')][_0x095e('0x52')](_0x25e523);})[_0x095e('0x36')](function(_0xdacfe4){_0x38778a[_0x095e('0x53')]=_0xdacfe4;return _0x38778a;})[_0x095e('0x36')](respondWithFilteredResult(_0x4be172,_0x25e523))[_0x095e('0x29')](handleError(_0x4be172,null));};exports[_0x095e('0x54')]=function(_0x3300c0,_0xc11bf2){var _0x28f5fe={'raw':!![],'where':{'id':_0x3300c0['params']['id']}},_0x952904={};_0x952904[_0x095e('0x55')]=_[_0x095e('0x3f')](db[_0x095e('0x3c')][_0x095e('0x56')]);_0x952904['query']=_['keys'](_0x3300c0[_0x095e('0x40')]);_0x952904[_0x095e('0x41')]=_[_0x095e('0x42')](_0x952904[_0x095e('0x55')],_0x952904[_0x095e('0x40')]);_0x28f5fe['attributes']=_['intersection'](_0x952904[_0x095e('0x55')],qs[_0x095e('0x44')](_0x3300c0[_0x095e('0x40')][_0x095e('0x44')]));_0x28f5fe['attributes']=_0x28f5fe[_0x095e('0x43')][_0x095e('0x45')]?_0x28f5fe[_0x095e('0x43')]:_0x952904[_0x095e('0x55')];if(_0x3300c0[_0x095e('0x40')][_0x095e('0x50')]){_0x28f5fe['include']=[{'all':!![]}];}_0x28f5fe=_[_0x095e('0x4e')]({},_0x28f5fe,_0x3300c0[_0x095e('0x4f')]);return db[_0x095e('0x3c')][_0x095e('0x57')](_0x28f5fe)[_0x095e('0x36')](handleEntityNotFound(_0xc11bf2,null))[_0x095e('0x36')](respondWithResult(_0xc11bf2,null))[_0x095e('0x29')](handleError(_0xc11bf2,null));};exports[_0x095e('0x58')]=function(_0x24fa1e,_0x4ef37f){return db[_0x095e('0x3c')][_0x095e('0x58')](_0x24fa1e['body'],{})['then'](respondWithResult(_0x4ef37f,0xc9))[_0x095e('0x29')](handleError(_0x4ef37f,null));};exports['update']=function(_0x27a36b,_0x460cae){if(_0x27a36b[_0x095e('0x59')]['id']){delete _0x27a36b['body']['id'];}return db['ChatMessage'][_0x095e('0x57')]({'where':{'id':_0x27a36b[_0x095e('0x5a')]['id']}})[_0x095e('0x36')](handleEntityNotFound(_0x460cae,null))[_0x095e('0x36')](saveUpdates(_0x27a36b[_0x095e('0x59')],null))[_0x095e('0x36')](respondWithResult(_0x460cae,null))['catch'](handleError(_0x460cae,null));};exports['destroy']=function(_0x356780,_0x58250b){return db[_0x095e('0x3c')][_0x095e('0x57')]({'where':{'id':_0x356780[_0x095e('0x5a')]['id']}})[_0x095e('0x36')](handleEntityNotFound(_0x58250b,null))[_0x095e('0x36')](removeEntity(_0x58250b,null))['catch'](handleError(_0x58250b,null));};exports['describe']=function(_0x143b9a,_0x1ef6b9){return db[_0x095e('0x3c')][_0x095e('0x5b')]()[_0x095e('0x36')](respondWithResult(_0x1ef6b9,null))[_0x095e('0x29')](handleError(_0x1ef6b9,null));};var interaction_log=require(_0x095e('0x14'))(_0x095e('0x5c'));exports[_0x095e('0x5d')]=function(_0x14a134,_0x5c2cd1,_0x5c1cb8){var _0x33209e={'agent':{},'channel':_0x095e('0x5e')};if(_0x14a134[_0x095e('0x59')]['id']){delete _0x14a134[_0x095e('0x59')]['id'];}_0x14a134[_0x095e('0x59')][_0x095e('0x5f')]=!![];_0x14a134[_0x095e('0x59')][_0x095e('0x60')]=moment()['format'](_0x095e('0x61'));_0x14a134[_0x095e('0x59')][_0x095e('0x62')]=_0x14a134[_0x095e('0x59')][_0x095e('0x62')]||_0x14a134[_0x095e('0x63')]['id'];_0x33209e[_0x095e('0x64')]['id']=_0x14a134['body'][_0x095e('0x62')];return db['ChatMessage'][_0x095e('0x57')]({'where':{'id':_0x14a134[_0x095e('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5c2cd1,null))[_0x095e('0x36')](saveUpdates(_0x14a134[_0x095e('0x59')],null))[_0x095e('0x36')](function(_0x52ff69){if(_0x52ff69){_0x33209e[_0x095e('0x26')]=_0x52ff69[_0x095e('0x65')]({'plain':!![]});return db['ChatInteraction'][_0x095e('0x57')]({'where':{'id':_0x52ff69[_0x095e('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x5c2cd1,null))[_0x095e('0x36')](function(_0x56050c){if(_0x56050c){return _0x56050c[_0x095e('0x34')]({'UserId':_0x14a134[_0x095e('0x59')]['UserId'],'read1stAt':_[_0x095e('0x67')](_0x56050c[_0x095e('0x68')])?moment()[_0x095e('0x69')](_0x095e('0x61')):undefined});}return null;})['then'](function(_0x2ccc1e){if(_0x2ccc1e){_0x33209e[_0x095e('0x6a')]=_0x2ccc1e[_0x095e('0x65')]({'plain':!![]});interaction_log[_0x095e('0x28')](_0x095e('0x6b'),_0x14a134['user']['id'],_0x14a134[_0x095e('0x63')][_0x095e('0x38')],_0x14a134[_0x095e('0x63')][_0x095e('0x6c')],_0x33209e[_0x095e('0x6a')]['id'],_0x14a134[_0x095e('0x59')]?JSON[_0x095e('0x23')](_0x14a134['body']):_0x095e('0x6d'));return respondWithRpcPromise('AcceptMessage',_0x095e('0x6e'),_0x33209e);}return null;})[_0x095e('0x36')](function(_0x574f30){var _0x442fad=_0x095e('0x6f')+_0x574f30['message'][_0x095e('0x70')];return db[_0x095e('0x71')][_0x095e('0x40')](_0x442fad,{'type':db[_0x095e('0x72')][_0x095e('0x73')][_0x095e('0x74')],'raw':!![]})[_0x095e('0x36')](function(_0x16676f){return _0x16676f;});})[_0x095e('0x36')](function(_0x8fea59){if(_0x8fea59){_0x33209e[_0x095e('0x26')][_0x095e('0x75')]=_0x8fea59[0x0];if(!_0x14a134[_0x095e('0x59')][_0x095e('0x62')])return;return db[_0x095e('0x76')][_0x095e('0x57')]({'where':{'id':_0x14a134[_0x095e('0x59')][_0x095e('0x62')],'role':_0x095e('0x64')},'attributes':['id',_0x095e('0x38'),'fullname',_0x095e('0x77'),_0x095e('0x78')],'raw':!![]});}return null;})['then'](function(_0x140335){if(!_0x140335)return null;_0x33209e[_0x095e('0x26')][_0x095e('0x64')]=_0x140335;return _0x33209e;})['then'](function(_0x7bb783){if(_0x7bb783){if(_0x14a134[_0x095e('0x59')][_0x095e('0x79')]){_0x33209e[_0x095e('0x26')]['interface']=util[_0x095e('0x69')]('SIP/%s',_0x14a134[_0x095e('0x63')][_0x095e('0x38')]);_0x33209e[_0x095e('0x26')][_0x095e('0x7a')]=_0x33209e[_0x095e('0x7a')];_0x33209e['message'][_0x095e('0x7b')]=_0x33209e[_0x095e('0x7a')];_0x33209e[_0x095e('0x26')]['event']=_0x095e('0x5d');return respondWithRpcPromise(_0x095e('0x7c'),'EventManager',{'event':_0x095e('0x7d'),'message':_[_0x095e('0x4e')](_0x33209e[_0x095e('0x26')],JSON['parse'](_0x33209e[_0x095e('0x6a')][_0x095e('0x7e')]))},client9002)[_0x095e('0x36')](function(){return _0x33209e;});}return _0x33209e;}return null;})['then'](respondWithResult(_0x5c2cd1,null))[_0x095e('0x29')](handleError(_0x5c2cd1,null));};var interaction_log=require(_0x095e('0x14'))(_0x095e('0x5c'));exports[_0x095e('0x32')]=function(_0x194715,_0x2f4438,_0x492788){var _0x5e289e={'agent':{},'channel':_0x095e('0x5e')};if(_0x194715['body']['id']){delete _0x194715[_0x095e('0x59')]['id'];}_0x194715[_0x095e('0x59')][_0x095e('0x62')]=_0x194715[_0x095e('0x59')][_0x095e('0x62')]||_0x194715['user']['id'];_0x5e289e[_0x095e('0x64')]['id']=_0x194715[_0x095e('0x59')]['UserId'];return db[_0x095e('0x3c')][_0x095e('0x57')]({'where':{'id':_0x194715[_0x095e('0x5a')]['id'],'UserId':null}})[_0x095e('0x36')](handleEntityNotFound(_0x2f4438,null))[_0x095e('0x36')](function(_0x32dbc5){if(_0x32dbc5){_0x5e289e['message']=_0x32dbc5[_0x095e('0x65')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x32dbc5[_0x095e('0x66')]}});}return null;})[_0x095e('0x36')](handleEntityNotFound(_0x2f4438,null))[_0x095e('0x36')](function(_0x5fe9e0){if(_0x5fe9e0){_0x5e289e[_0x095e('0x6a')]=_0x5fe9e0[_0x095e('0x65')]({'plain':!![]});interaction_log[_0x095e('0x28')](_0x095e('0x7f'),_0x194715[_0x095e('0x63')]['id'],_0x194715[_0x095e('0x63')][_0x095e('0x38')],_0x194715[_0x095e('0x63')][_0x095e('0x6c')],_0x5e289e[_0x095e('0x6a')]['id'],_0x194715['body']?JSON['stringify'](_0x194715['body']):_0x095e('0x6d'));return respondWithRpcPromise(_0x095e('0x80'),_0x095e('0x81'),_0x5e289e);}return null;})['then'](function(_0x414396){var _0x87eec=_0x095e('0x6f')+_0x414396[_0x095e('0x26')][_0x095e('0x70')];return db['sequelize'][_0x095e('0x40')](_0x87eec,{'type':db[_0x095e('0x72')][_0x095e('0x73')][_0x095e('0x74')],'raw':!![]})[_0x095e('0x36')](function(_0x376c6e){return _0x376c6e;});})[_0x095e('0x36')](function(_0x38598e){if(_0x38598e){_0x5e289e['message']['contact']=_0x38598e[0x0];if(!_0x194715[_0x095e('0x59')]['UserId'])return;return db['User'][_0x095e('0x57')]({'where':{'id':_0x194715['body'][_0x095e('0x62')],'role':_0x095e('0x64')},'attributes':['id',_0x095e('0x38'),_0x095e('0x82'),_0x095e('0x77'),'internal'],'raw':!![]});}return null;})['then'](function(_0x5d4711){if(!_0x5d4711)return null;_0x5e289e['message'][_0x095e('0x64')]=_0x5d4711;return _0x5e289e;})[_0x095e('0x36')](function(_0x1a8f1c){if(_0x1a8f1c){_0x1a8f1c[_0x095e('0x26')][_0x095e('0x83')]=util[_0x095e('0x69')](_0x095e('0x84'),_0x194715[_0x095e('0x63')][_0x095e('0x38')]);_0x1a8f1c[_0x095e('0x26')]['channel']=_0x5e289e[_0x095e('0x7a')];_0x1a8f1c[_0x095e('0x26')][_0x095e('0x7b')]=_0x5e289e[_0x095e('0x7a')];_0x1a8f1c[_0x095e('0x26')][_0x095e('0x85')]='reject';respondWithRpcPromise(_0x095e('0x7c'),'EventManager',{'event':_0x095e('0x86'),'message':_['merge'](_0x5e289e[_0x095e('0x26')],JSON['parse'](_0x5e289e['interaction'][_0x095e('0x7e')]))},client9002);return _0x5e289e;}return null;})[_0x095e('0x36')](respondWithResult(_0x2f4438,null))[_0x095e('0x29')](handleError(_0x2f4438,null));};
\ No newline at end of file
+var _0x4b79=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','defaults','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','update','destroy','end','stack','name','send','index','ChatMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','params','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','UserId','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','rejectmessage','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','lodash','squel'];(function(_0x2f8f22,_0x122fdd){var _0x1091b2=function(_0x44d1c9){while(--_0x44d1c9){_0x2f8f22['push'](_0x2f8f22['shift']());}};_0x1091b2(++_0x122fdd);}(_0x4b79,0x1f4));var _0x94b7=function(_0x3441c5,_0x266858){_0x3441c5=_0x3441c5-0x0;var _0x15442d=_0x4b79[_0x3441c5];return _0x15442d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x94b7('0x0'));var rp=require(_0x94b7('0x1'));var moment=require('moment');var BPromise=require(_0x94b7('0x2'));var Mustache=require(_0x94b7('0x3'));var util=require('util');var path=require('path');var sox=require(_0x94b7('0x4'));var csv=require(_0x94b7('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x94b7('0x6'));var squel=require(_0x94b7('0x7'));var crypto=require(_0x94b7('0x8'));var jsforce=require(_0x94b7('0x9'));var deskjs=require(_0x94b7('0xa'));var toCsv=require(_0x94b7('0x5'));var querystring=require(_0x94b7('0xb'));var Papa=require(_0x94b7('0xc'));var Redis=require(_0x94b7('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x94b7('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x94b7('0xf'))(_0x94b7('0x10'));var utils=require(_0x94b7('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x94b7('0x12')](config[_0x94b7('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x94b7('0x14'))(new Redis(config['redis']));require(_0x94b7('0x15'))[_0x94b7('0x16')](socket);var jayson=require(_0x94b7('0x17'));var client=jayson[_0x94b7('0x18')][_0x94b7('0x19')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3f30ee,_0x4a7a6b,_0x4e90bb,_0x217e6d){return new BPromise(function(_0x5ebf90,_0x323e1f){var _0x20d07c=_0x217e6d||client;return _0x20d07c[_0x94b7('0x1a')](_0x3f30ee,_0x4e90bb)[_0x94b7('0x1b')](function(_0x446412){logger[_0x94b7('0x1c')](_0x94b7('0x1d'),_0x4a7a6b,_0x94b7('0x1e'));logger[_0x94b7('0x1f')](_0x94b7('0x20'),_0x4a7a6b,_0x94b7('0x1e'),JSON[_0x94b7('0x21')](_0x446412));if(_0x446412[_0x94b7('0x22')]){if(_0x446412[_0x94b7('0x22')]['code']===0x1f4){logger[_0x94b7('0x22')](_0x94b7('0x1d'),_0x4a7a6b,_0x446412['error'][_0x94b7('0x23')]);return _0x323e1f(_0x446412['error']['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x4a7a6b,_0x446412['error'][_0x94b7('0x23')]);return _0x5ebf90(_0x446412['error'][_0x94b7('0x23')]);}else{logger['info'](_0x94b7('0x1d'),_0x4a7a6b,_0x94b7('0x1e'));_0x5ebf90(_0x446412['result'][_0x94b7('0x23')]);}})[_0x94b7('0x24')](function(_0x21ebe8){logger[_0x94b7('0x22')](_0x94b7('0x1d'),_0x4a7a6b,_0x21ebe8);_0x323e1f(_0x21ebe8);});});}function respondWithStatusCode(_0x17c2e5,_0x36d3b0){_0x36d3b0=_0x36d3b0||0xcc;return function(_0x48698a){if(_0x48698a){return _0x17c2e5[_0x94b7('0x25')](_0x36d3b0);}return _0x17c2e5[_0x94b7('0x26')](_0x36d3b0)['end']();};}function respondWithResult(_0x1e6d52,_0x5bca4b){_0x5bca4b=_0x5bca4b||0xc8;return function(_0x490ddb){if(_0x490ddb){return _0x1e6d52[_0x94b7('0x26')](_0x5bca4b)[_0x94b7('0x27')](_0x490ddb);}};}function respondWithFilteredResult(_0x33afe6,_0xec5c5e){return function(_0x56e1df){if(_0x56e1df){var _0x2583dc=typeof _0xec5c5e['offset']===_0x94b7('0x28')&&typeof _0xec5c5e[_0x94b7('0x29')]===_0x94b7('0x28');var _0x37cd97=_0x56e1df[_0x94b7('0x2a')];var _0x2abea6=_0x2583dc?0x0:_0xec5c5e['offset'];var _0x519711=_0x2583dc?_0x56e1df[_0x94b7('0x2a')]:_0xec5c5e[_0x94b7('0x2b')]+_0xec5c5e[_0x94b7('0x29')];var _0x379289;if(_0x519711>=_0x37cd97){_0x519711=_0x37cd97;_0x379289=0xc8;}else{_0x379289=0xce;}_0x33afe6[_0x94b7('0x26')](_0x379289);return _0x33afe6[_0x94b7('0x2c')]('Content-Range',_0x2abea6+'-'+_0x519711+'/'+_0x37cd97)['json'](_0x56e1df);}return null;};}function patchUpdates(_0x35ab0){return function(_0x107005){try{jsonpatch[_0x94b7('0x2d')](_0x107005,_0x35ab0,!![]);}catch(_0x4a1cd8){return BPromise[_0x94b7('0x2e')](_0x4a1cd8);}return _0x107005['save']();};}function saveUpdates(_0x37ef41,_0x3d27b2){return function(_0x1627fc){if(_0x1627fc){return _0x1627fc[_0x94b7('0x2f')](_0x37ef41)[_0x94b7('0x1b')](function(_0x595883){return _0x595883;});}return null;};}function removeEntity(_0x1a0998,_0x361a99){return function(_0x2509a2){if(_0x2509a2){return _0x2509a2[_0x94b7('0x30')]()[_0x94b7('0x1b')](function(){_0x1a0998[_0x94b7('0x26')](0xcc)[_0x94b7('0x31')]();});}};}function handleEntityNotFound(_0x3b45e1,_0x4b5e26){return function(_0x56f872){if(!_0x56f872){_0x3b45e1[_0x94b7('0x25')](0x194);}return _0x56f872;};}function handleError(_0x58daf7,_0x24d315){_0x24d315=_0x24d315||0x1f4;return function(_0x403157){logger[_0x94b7('0x22')](_0x403157[_0x94b7('0x32')]);if(_0x403157['name']){delete _0x403157[_0x94b7('0x33')];}_0x58daf7[_0x94b7('0x26')](_0x24d315)[_0x94b7('0x34')](_0x403157);};}exports[_0x94b7('0x35')]=function(_0x33fce5,_0x36a172){var _0x57c31e={},_0x38038f={},_0xb9577e={'count':0x0,'rows':[]};var _0x5a96ab=_['map'](db[_0x94b7('0x36')][_0x94b7('0x37')],function(_0x2b00b5){return{'name':_0x2b00b5['fieldName'],'type':_0x2b00b5[_0x94b7('0x38')][_0x94b7('0x39')]};});_0x38038f[_0x94b7('0x3a')]=_[_0x94b7('0x3b')](_0x5a96ab,_0x94b7('0x33'));_0x38038f[_0x94b7('0x3c')]=_[_0x94b7('0x3d')](_0x33fce5['query']);_0x38038f[_0x94b7('0x3e')]=_[_0x94b7('0x3f')](_0x38038f[_0x94b7('0x3a')],_0x38038f[_0x94b7('0x3c')]);_0x57c31e[_0x94b7('0x40')]=_[_0x94b7('0x3f')](_0x38038f['model'],qs['fields'](_0x33fce5[_0x94b7('0x3c')][_0x94b7('0x41')]));_0x57c31e[_0x94b7('0x40')]=_0x57c31e['attributes'][_0x94b7('0x42')]?_0x57c31e[_0x94b7('0x40')]:_0x38038f['model'];if(!_0x33fce5['query'][_0x94b7('0x43')](_0x94b7('0x44'))){_0x57c31e[_0x94b7('0x29')]=qs[_0x94b7('0x29')](_0x33fce5[_0x94b7('0x3c')][_0x94b7('0x29')]);_0x57c31e['offset']=qs[_0x94b7('0x2b')](_0x33fce5[_0x94b7('0x3c')][_0x94b7('0x2b')]);}_0x57c31e['order']=qs[_0x94b7('0x45')](_0x33fce5[_0x94b7('0x3c')]['sort']);_0x57c31e[_0x94b7('0x46')]=qs[_0x94b7('0x3e')](_[_0x94b7('0x47')](_0x33fce5[_0x94b7('0x3c')],_0x38038f['filters']),_0x5a96ab);if(_0x33fce5['query'][_0x94b7('0x48')]){_0x57c31e[_0x94b7('0x46')]=_[_0x94b7('0x49')](_0x57c31e[_0x94b7('0x46')],{'$or':_[_0x94b7('0x3b')](_0x5a96ab,function(_0x1b1603){if(_0x1b1603['type']!==_0x94b7('0x4a')){var _0x57ecec={};_0x57ecec[_0x1b1603[_0x94b7('0x33')]]={'$like':'%'+_0x33fce5[_0x94b7('0x3c')]['filter']+'%'};return _0x57ecec;}})});}_0x57c31e=_[_0x94b7('0x49')]({},_0x57c31e,_0x33fce5[_0x94b7('0x4b')]);var _0x28e3d2={'where':_0x57c31e[_0x94b7('0x46')]};return db[_0x94b7('0x36')]['count'](_0x28e3d2)[_0x94b7('0x1b')](function(_0x5765c5){_0xb9577e['count']=_0x5765c5;if(_0x33fce5[_0x94b7('0x3c')][_0x94b7('0x4c')]){_0x57c31e[_0x94b7('0x4d')]=[{'all':!![]}];}return db[_0x94b7('0x36')]['findAll'](_0x57c31e);})[_0x94b7('0x1b')](function(_0x2d860a){_0xb9577e['rows']=_0x2d860a;return _0xb9577e;})[_0x94b7('0x1b')](respondWithFilteredResult(_0x36a172,_0x57c31e))['catch'](handleError(_0x36a172,null));};exports['show']=function(_0x1024f9,_0x46b1a1){var _0x5a754f={'raw':!![],'where':{'id':_0x1024f9[_0x94b7('0x4e')]['id']}},_0x14ee86={};_0x14ee86[_0x94b7('0x3a')]=_[_0x94b7('0x3d')](db[_0x94b7('0x36')][_0x94b7('0x37')]);_0x14ee86[_0x94b7('0x3c')]=_['keys'](_0x1024f9['query']);_0x14ee86[_0x94b7('0x3e')]=_[_0x94b7('0x3f')](_0x14ee86[_0x94b7('0x3a')],_0x14ee86[_0x94b7('0x3c')]);_0x5a754f[_0x94b7('0x40')]=_[_0x94b7('0x3f')](_0x14ee86[_0x94b7('0x3a')],qs['fields'](_0x1024f9[_0x94b7('0x3c')][_0x94b7('0x41')]));_0x5a754f[_0x94b7('0x40')]=_0x5a754f['attributes'][_0x94b7('0x42')]?_0x5a754f[_0x94b7('0x40')]:_0x14ee86[_0x94b7('0x3a')];if(_0x1024f9[_0x94b7('0x3c')][_0x94b7('0x4c')]){_0x5a754f[_0x94b7('0x4d')]=[{'all':!![]}];}_0x5a754f=_[_0x94b7('0x49')]({},_0x5a754f,_0x1024f9[_0x94b7('0x4b')]);return db[_0x94b7('0x36')][_0x94b7('0x4f')](_0x5a754f)['then'](handleEntityNotFound(_0x46b1a1,null))['then'](respondWithResult(_0x46b1a1,null))['catch'](handleError(_0x46b1a1,null));};exports['create']=function(_0x1262da,_0x574516){return db['ChatMessage'][_0x94b7('0x50')](_0x1262da[_0x94b7('0x51')],{})[_0x94b7('0x1b')](respondWithResult(_0x574516,0xc9))[_0x94b7('0x24')](handleError(_0x574516,null));};exports[_0x94b7('0x2f')]=function(_0x46a502,_0x5eab3c){if(_0x46a502[_0x94b7('0x51')]['id']){delete _0x46a502[_0x94b7('0x51')]['id'];}return db[_0x94b7('0x36')][_0x94b7('0x4f')]({'where':{'id':_0x46a502[_0x94b7('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5eab3c,null))[_0x94b7('0x1b')](saveUpdates(_0x46a502[_0x94b7('0x51')],null))[_0x94b7('0x1b')](respondWithResult(_0x5eab3c,null))[_0x94b7('0x24')](handleError(_0x5eab3c,null));};exports[_0x94b7('0x30')]=function(_0x4e4650,_0x4f3dc4){return db[_0x94b7('0x36')][_0x94b7('0x4f')]({'where':{'id':_0x4e4650[_0x94b7('0x4e')]['id']}})[_0x94b7('0x1b')](handleEntityNotFound(_0x4f3dc4,null))['then'](removeEntity(_0x4f3dc4,null))[_0x94b7('0x24')](handleError(_0x4f3dc4,null));};exports[_0x94b7('0x52')]=function(_0x2de4cd,_0x9c9f88){return db[_0x94b7('0x36')]['describe']()[_0x94b7('0x1b')](respondWithResult(_0x9c9f88,null))['catch'](handleError(_0x9c9f88,null));};var interaction_log=require(_0x94b7('0xf'))(_0x94b7('0x53'));exports[_0x94b7('0x54')]=function(_0x46fa93,_0x374310,_0x566e8f){var _0x75c915={'agent':{},'channel':_0x94b7('0x55')};if(_0x46fa93[_0x94b7('0x51')]['id']){delete _0x46fa93[_0x94b7('0x51')]['id'];}_0x46fa93['body'][_0x94b7('0x56')]=!![];_0x46fa93[_0x94b7('0x51')][_0x94b7('0x57')]=moment()[_0x94b7('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x46fa93[_0x94b7('0x51')]['UserId']=_0x46fa93['body'][_0x94b7('0x59')]||_0x46fa93['user']['id'];_0x75c915[_0x94b7('0x5a')]['id']=_0x46fa93[_0x94b7('0x51')][_0x94b7('0x59')];return db[_0x94b7('0x36')]['find']({'where':{'id':_0x46fa93[_0x94b7('0x4e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x374310,null))[_0x94b7('0x1b')](saveUpdates(_0x46fa93['body'],null))[_0x94b7('0x1b')](function(_0x5d6ca3){if(_0x5d6ca3){_0x75c915[_0x94b7('0x23')]=_0x5d6ca3[_0x94b7('0x5b')]({'plain':!![]});return db[_0x94b7('0x5c')][_0x94b7('0x4f')]({'where':{'id':_0x5d6ca3[_0x94b7('0x5d')]}});}return null;})[_0x94b7('0x1b')](handleEntityNotFound(_0x374310,null))[_0x94b7('0x1b')](function(_0x97b4da){if(_0x97b4da){return _0x97b4da[_0x94b7('0x2f')]({'UserId':_0x46fa93['body'][_0x94b7('0x59')],'read1stAt':_[_0x94b7('0x5e')](_0x97b4da[_0x94b7('0x5f')])?moment()['format'](_0x94b7('0x60')):undefined});}return null;})['then'](function(_0x339d1b){if(_0x339d1b){_0x75c915[_0x94b7('0x61')]=_0x339d1b['get']({'plain':!![]});interaction_log[_0x94b7('0x1c')](_0x94b7('0x62'),_0x46fa93[_0x94b7('0x63')]['id'],_0x46fa93[_0x94b7('0x63')]['name'],_0x46fa93[_0x94b7('0x63')][_0x94b7('0x64')],_0x75c915[_0x94b7('0x61')]['id'],_0x46fa93[_0x94b7('0x51')]?JSON[_0x94b7('0x21')](_0x46fa93[_0x94b7('0x51')]):_0x94b7('0x65'));return respondWithRpcPromise(_0x94b7('0x66'),_0x94b7('0x67'),_0x75c915);}return null;})['then'](function(_0x5f4281){var _0x5d2e6f=_0x94b7('0x68')+_0x5f4281[_0x94b7('0x23')][_0x94b7('0x69')];return db['sequelize'][_0x94b7('0x3c')](_0x5d2e6f,{'type':db[_0x94b7('0x6a')]['QueryTypes'][_0x94b7('0x6b')],'raw':!![]})['then'](function(_0x4fcaca){return _0x4fcaca;});})[_0x94b7('0x1b')](function(_0x3134b0){if(_0x3134b0){_0x75c915['message'][_0x94b7('0x6c')]=_0x3134b0[0x0];if(!_0x46fa93[_0x94b7('0x51')][_0x94b7('0x59')])return;return db[_0x94b7('0x6d')][_0x94b7('0x4f')]({'where':{'id':_0x46fa93[_0x94b7('0x51')]['UserId'],'role':_0x94b7('0x5a')},'attributes':['id',_0x94b7('0x33'),_0x94b7('0x6e'),_0x94b7('0x6f'),_0x94b7('0x70')],'raw':!![]});}return null;})[_0x94b7('0x1b')](function(_0x2328fc){if(!_0x2328fc)return null;_0x75c915[_0x94b7('0x23')][_0x94b7('0x5a')]=_0x2328fc;return _0x75c915;})[_0x94b7('0x1b')](function(_0x2c8230){if(_0x2c8230){if(_0x46fa93['body'][_0x94b7('0x71')]){_0x75c915[_0x94b7('0x23')][_0x94b7('0x72')]=util[_0x94b7('0x58')](_0x94b7('0x73'),_0x46fa93[_0x94b7('0x63')][_0x94b7('0x33')]);_0x75c915[_0x94b7('0x23')][_0x94b7('0x74')]=_0x75c915['channel'];_0x75c915['message'][_0x94b7('0x75')]=_0x75c915[_0x94b7('0x74')];_0x75c915[_0x94b7('0x23')][_0x94b7('0x76')]=_0x94b7('0x54');return respondWithRpcPromise(_0x94b7('0x77'),_0x94b7('0x77'),{'event':'acceptmessage','message':_['merge'](_0x75c915[_0x94b7('0x23')],JSON[_0x94b7('0x78')](_0x75c915[_0x94b7('0x61')][_0x94b7('0x79')]))},client9002)[_0x94b7('0x1b')](function(){return _0x75c915;});}return _0x75c915;}return null;})['then'](respondWithResult(_0x374310,null))[_0x94b7('0x24')](handleError(_0x374310,null));};var interaction_log=require('../../config/logger')(_0x94b7('0x53'));exports[_0x94b7('0x2e')]=function(_0x163b26,_0x5cd60a,_0x213c87){var _0x5422ae={'agent':{},'channel':_0x94b7('0x55')};if(_0x163b26[_0x94b7('0x51')]['id']){delete _0x163b26['body']['id'];}_0x163b26[_0x94b7('0x51')][_0x94b7('0x59')]=_0x163b26[_0x94b7('0x51')][_0x94b7('0x59')]||_0x163b26[_0x94b7('0x63')]['id'];_0x5422ae[_0x94b7('0x5a')]['id']=_0x163b26[_0x94b7('0x51')][_0x94b7('0x59')];return db[_0x94b7('0x36')][_0x94b7('0x4f')]({'where':{'id':_0x163b26[_0x94b7('0x4e')]['id'],'UserId':null}})[_0x94b7('0x1b')](handleEntityNotFound(_0x5cd60a,null))[_0x94b7('0x1b')](function(_0x5794ea){if(_0x5794ea){_0x5422ae[_0x94b7('0x23')]=_0x5794ea[_0x94b7('0x5b')]({'plain':!![]});return db[_0x94b7('0x5c')][_0x94b7('0x4f')]({'where':{'id':_0x5794ea[_0x94b7('0x5d')]}});}return null;})['then'](handleEntityNotFound(_0x5cd60a,null))[_0x94b7('0x1b')](function(_0x2876a3){if(_0x2876a3){_0x5422ae[_0x94b7('0x61')]=_0x2876a3[_0x94b7('0x5b')]({'plain':!![]});interaction_log['info'](_0x94b7('0x7a'),_0x163b26[_0x94b7('0x63')]['id'],_0x163b26[_0x94b7('0x63')][_0x94b7('0x33')],_0x163b26[_0x94b7('0x63')][_0x94b7('0x64')],_0x5422ae[_0x94b7('0x61')]['id'],_0x163b26['body']?JSON[_0x94b7('0x21')](_0x163b26[_0x94b7('0x51')]):_0x94b7('0x65'));return respondWithRpcPromise(_0x94b7('0x7b'),_0x94b7('0x7c'),_0x5422ae);}return null;})['then'](function(_0x297afd){var _0x35a8cd=_0x94b7('0x68')+_0x297afd[_0x94b7('0x23')][_0x94b7('0x69')];return db[_0x94b7('0x7d')][_0x94b7('0x3c')](_0x35a8cd,{'type':db[_0x94b7('0x6a')]['QueryTypes'][_0x94b7('0x6b')],'raw':!![]})[_0x94b7('0x1b')](function(_0x462cac){return _0x462cac;});})[_0x94b7('0x1b')](function(_0xd3b967){if(_0xd3b967){_0x5422ae[_0x94b7('0x23')][_0x94b7('0x6c')]=_0xd3b967[0x0];if(!_0x163b26['body'][_0x94b7('0x59')])return;return db[_0x94b7('0x6d')][_0x94b7('0x4f')]({'where':{'id':_0x163b26[_0x94b7('0x51')]['UserId'],'role':'agent'},'attributes':['id','name',_0x94b7('0x6e'),_0x94b7('0x6f'),'internal'],'raw':!![]});}return null;})[_0x94b7('0x1b')](function(_0xf526ac){if(!_0xf526ac)return null;_0x5422ae[_0x94b7('0x23')][_0x94b7('0x5a')]=_0xf526ac;return _0x5422ae;})['then'](function(_0x11ed4d){if(_0x11ed4d){_0x11ed4d[_0x94b7('0x23')][_0x94b7('0x72')]=util[_0x94b7('0x58')](_0x94b7('0x73'),_0x163b26[_0x94b7('0x63')]['name']);_0x11ed4d[_0x94b7('0x23')][_0x94b7('0x74')]=_0x5422ae[_0x94b7('0x74')];_0x11ed4d[_0x94b7('0x23')][_0x94b7('0x75')]=_0x5422ae[_0x94b7('0x74')];_0x11ed4d[_0x94b7('0x23')][_0x94b7('0x76')]='reject';respondWithRpcPromise(_0x94b7('0x77'),_0x94b7('0x77'),{'event':_0x94b7('0x7e'),'message':_[_0x94b7('0x49')](_0x5422ae[_0x94b7('0x23')],JSON[_0x94b7('0x78')](_0x5422ae[_0x94b7('0x61')][_0x94b7('0x79')]))},client9002);return _0x5422ae;}return null;})[_0x94b7('0x1b')](respondWithResult(_0x5cd60a,null))['catch'](handleError(_0x5cd60a,null));};
\ No newline at end of file
index c85dcd7..5f083c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9458=['emit','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x29fc02,_0x1be1d7){var _0x12aadf=function(_0x2ab24b){while(--_0x2ab24b){_0x29fc02['push'](_0x29fc02['shift']());}};_0x12aadf(++_0x1be1d7);}(_0x9458,0x11a));var _0x8945=function(_0x19a9ee,_0x406cea){_0x19a9ee=_0x19a9ee-0x0;var _0x1edc35=_0x9458[_0x19a9ee];return _0x1edc35;};'use strict';var EventEmitter=require(_0x8945('0x0'));var ChatMessage=require(_0x8945('0x1'))['db'][_0x8945('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8945('0x3')](0x0);var events={'afterCreate':_0x8945('0x4'),'afterUpdate':_0x8945('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2f0b94){return function(_0x434a73,_0x4d828e,_0x2d06f2){ChatMessageEvents['emit'](_0x2f0b94+':'+_0x434a73['id'],_0x434a73);ChatMessageEvents[_0x8945('0x6')](_0x2f0b94,_0x434a73);_0x2d06f2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x8945('0x7')](e,emitEvent(event));}}module[_0x8945('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0xf26d=['hook','events','../../mysqldb','ChatMessage','save','update','remove','emit','hasOwnProperty'];(function(_0x54ff9e,_0x18b796){var _0x1719e8=function(_0x42a235){while(--_0x42a235){_0x54ff9e['push'](_0x54ff9e['shift']());}};_0x1719e8(++_0x18b796);}(_0xf26d,0xbe));var _0xdf26=function(_0x30278e,_0x2c5095){_0x30278e=_0x30278e-0x0;var _0x478b5a=_0xf26d[_0x30278e];return _0x478b5a;};'use strict';var EventEmitter=require(_0xdf26('0x0'));var ChatMessage=require(_0xdf26('0x1'))['db'][_0xdf26('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdf26('0x3'),'afterUpdate':_0xdf26('0x4'),'afterDestroy':_0xdf26('0x5')};function emitEvent(_0x591f79){return function(_0x1f933a,_0x1ba242,_0x43b8aa){ChatMessageEvents[_0xdf26('0x6')](_0x591f79+':'+_0x1f933a['id'],_0x1f933a);ChatMessageEvents[_0xdf26('0x6')](_0x591f79,_0x1f933a);_0x43b8aa(null);};}for(var e in events){if(events[_0xdf26('0x7')](e)){var event=events[e];ChatMessage[_0xdf26('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
index 4723b1f..3b1c845 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fbd=['../../config/logger','api','moment','path','./chatMessage.attributes','define','ChatMessage','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','catch','utf8mb4_unicode_ci','lodash'];(function(_0x3ea87e,_0x335255){var _0x5d9f59=function(_0x24776e){while(--_0x24776e){_0x3ea87e['push'](_0x3ea87e['shift']());}};_0x5d9f59(++_0x335255);}(_0x3fbd,0x110));var _0xd3fb=function(_0x122a2f,_0x346594){_0x122a2f=_0x122a2f-0x0;var _0x36fc38=_0x3fbd[_0x122a2f];return _0x36fc38;};'use strict';var _=require(_0xd3fb('0x0'));var util=require('util');var logger=require(_0xd3fb('0x1'))(_0xd3fb('0x2'));var moment=require(_0xd3fb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3fb('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd3fb('0x5'));module['exports']=function(_0x2de1ed,_0x5879ab){return _0x2de1ed[_0xd3fb('0x6')](_0xd3fb('0x7'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xd3fb('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x57ce8c,_0x21356c,_0x4a4454){var _0x19b459=_0x2de1ed[_0xd3fb('0x9')];var _0x3990bd=_0x57ce8c[_0xd3fb('0xa')]({'plain':!![]});if(_0x3990bd[_0xd3fb('0xb')][_0xd3fb('0xc')]()==='in'||_0x3990bd[_0xd3fb('0xb')]['toLowerCase']()==='out'&&!_0x3990bd[_0xd3fb('0xd')]&&!_['isNil'](_0x3990bd[_0xd3fb('0xe')])){_0x19b459[_0xd3fb('0xf')][_0xd3fb('0x10')]({'where':{'id':_0x3990bd[_0xd3fb('0x11')]}})[_0xd3fb('0x12')](function(_0x2be571){if(_0x2be571){_0x2be571['update']({'lastMsgAt':_0x3990bd['createdAt'],'lastMsgDirection':_0x3990bd[_0xd3fb('0xb')]['toLowerCase']()});}})[_0xd3fb('0x13')](function(_0x2f1989){console['error'](_0x2f1989);});}_0x4a4454();}},'charset':'utf8mb4','collate':_0xd3fb('0x14')});};
\ No newline at end of file
+var _0x3f91=['get','direction','out','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT'];(function(_0x3ee768,_0x11af44){var _0x26ddae=function(_0x43f17e){while(--_0x43f17e){_0x3ee768['push'](_0x3ee768['shift']());}};_0x26ddae(++_0x11af44);}(_0x3f91,0x99));var _0x13f9=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x3f91[_0x35885a];return _0xe86249;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x13f9('0x0'))(_0x13f9('0x1'));var moment=require(_0x13f9('0x2'));var BPromise=require('bluebird');var rp=require(_0x13f9('0x3'));var fs=require('fs');var path=require(_0x13f9('0x4'));var rimraf=require(_0x13f9('0x5'));var config=require(_0x13f9('0x6'));var attributes=require(_0x13f9('0x7'));module[_0x13f9('0x8')]=function(_0x5b6ad9,_0x537190){return _0x5b6ad9[_0x13f9('0x9')](_0x13f9('0xa'),attributes,{'tableName':_0x13f9('0xb'),'paranoid':![],'indexes':[{'name':_0x13f9('0xc'),'fields':[_0x13f9('0xd')],'type':_0x13f9('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e9a3e,_0x1e2e3b,_0x2fc598){var _0x115cb7=_0x5b6ad9['models'];var _0x13d79a=_0x1e9a3e[_0x13f9('0xf')]({'plain':!![]});if(_0x13d79a[_0x13f9('0x10')]['toLowerCase']()==='in'||_0x13d79a[_0x13f9('0x10')]['toLowerCase']()===_0x13f9('0x11')&&!_0x13d79a['secret']&&!_[_0x13f9('0x12')](_0x13d79a[_0x13f9('0x13')])){_0x115cb7[_0x13f9('0x14')]['findOne']({'where':{'id':_0x13d79a[_0x13f9('0x15')]}})[_0x13f9('0x16')](function(_0x469942){if(_0x469942){_0x469942[_0x13f9('0x17')]({'lastMsgAt':_0x13d79a[_0x13f9('0x18')],'lastMsgDirection':_0x13d79a['direction']['toLowerCase']()});}})[_0x13f9('0x19')](function(_0x103e32){console[_0x13f9('0x1a')](_0x103e32);});}_0x2fc598();}},'charset':_0x13f9('0x1b'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 3aa2a82..a429ed0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d2b=['bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','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','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment'];(function(_0x3e83f1,_0x1b09ae){var _0x28cd96=function(_0x2ffc3e){while(--_0x2ffc3e){_0x3e83f1['push'](_0x3e83f1['shift']());}};_0x28cd96(++_0x1b09ae);}(_0x7d2b,0x1aa));var _0xb7d2=function(_0x74610c,_0xf8d050){_0x74610c=_0x74610c-0x0;var _0x111ecb=_0x7d2b[_0x74610c];return _0x111ecb;};'use strict';var _=require(_0xb7d2('0x0'));var util=require(_0xb7d2('0x1'));var moment=require(_0xb7d2('0x2'));var BPromise=require(_0xb7d2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7d2('0x4'))['db'];var utils=require(_0xb7d2('0x5'));var logger=require('../../config/logger')(_0xb7d2('0x6'));var config=require(_0xb7d2('0x7'));var jayson=require(_0xb7d2('0x8'));var client=jayson[_0xb7d2('0x9')][_0xb7d2('0xa')]({'port':0x232a});config[_0xb7d2('0xb')]=_['defaults'](config[_0xb7d2('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xb7d2('0xc'))(new Redis(config['redis']));require(_0xb7d2('0xd'))[_0xb7d2('0xe')](socket);function respondWithRpcPromise(_0x1a6a36,_0x5c8c49,_0x5795f1){return new BPromise(function(_0x2d5180,_0x78649f){return client[_0xb7d2('0xf')](_0x1a6a36,_0x5795f1)[_0xb7d2('0x10')](function(_0x1d9c02){logger[_0xb7d2('0x11')](_0xb7d2('0x12'),_0x5c8c49,_0xb7d2('0x13'));logger[_0xb7d2('0x14')](_0xb7d2('0x15'),_0x5c8c49,'request\x20sent',JSON[_0xb7d2('0x16')](_0x1d9c02));if(_0x1d9c02['error']){if(_0x1d9c02[_0xb7d2('0x17')]['code']===0x1f4){logger[_0xb7d2('0x17')]('ChatMessage,\x20%s,\x20%s',_0x5c8c49,_0x1d9c02['error'][_0xb7d2('0x18')]);return _0x78649f(_0x1d9c02['error'][_0xb7d2('0x18')]);}logger[_0xb7d2('0x17')]('ChatMessage,\x20%s,\x20%s',_0x5c8c49,_0x1d9c02[_0xb7d2('0x17')][_0xb7d2('0x18')]);return _0x2d5180(_0x1d9c02[_0xb7d2('0x17')][_0xb7d2('0x18')]);}else{logger['info'](_0xb7d2('0x12'),_0x5c8c49,'request\x20sent');_0x2d5180(_0x1d9c02[_0xb7d2('0x19')]['message']);}})[_0xb7d2('0x1a')](function(_0x57f4ad){logger[_0xb7d2('0x17')](_0xb7d2('0x12'),_0x5c8c49,_0x57f4ad);_0x78649f(_0x57f4ad);});});}exports[_0xb7d2('0x1b')]=function(_0x4afa3f){var _0x336254=this;return new Promise(function(_0x1a22ff,_0x4753d2){return db[_0xb7d2('0x1c')][_0xb7d2('0x1d')](_0x4afa3f[_0xb7d2('0x1e')],{'raw':_0x4afa3f[_0xb7d2('0x1f')]?_0x4afa3f[_0xb7d2('0x1f')][_0xb7d2('0x20')]===undefined?!![]:![]:!![]})[_0xb7d2('0x10')](function(_0xfb99a7){logger[_0xb7d2('0x11')](_0xb7d2('0x1b'),_0x4afa3f);logger[_0xb7d2('0x14')](_0xb7d2('0x1b'),_0x4afa3f,JSON[_0xb7d2('0x16')](_0xfb99a7));_0x1a22ff(_0xfb99a7);})[_0xb7d2('0x1a')](function(_0x160c11){logger[_0xb7d2('0x17')](_0xb7d2('0x1b'),_0x160c11[_0xb7d2('0x18')],_0x4afa3f);_0x4753d2(_0x336254['error'](0x1f4,_0x160c11[_0xb7d2('0x18')]));});});};
\ No newline at end of file
+var _0x34e7=['request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','body','options','raw','then','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x34e7,0x1be));var _0x734e=function(_0x5b96f6,_0x26fe54){_0x5b96f6=_0x5b96f6-0x0;var _0xe67cd8=_0x34e7[_0x5b96f6];return _0xe67cd8;};'use strict';var _=require('lodash');var util=require(_0x734e('0x0'));var moment=require('moment');var BPromise=require(_0x734e('0x1'));var rs=require(_0x734e('0x2'));var fs=require('fs');var Redis=require(_0x734e('0x3'));var db=require(_0x734e('0x4'))['db'];var utils=require(_0x734e('0x5'));var logger=require('../../config/logger')(_0x734e('0x6'));var config=require(_0x734e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x734e('0x8')][_0x734e('0x9')]({'port':0x232a});config[_0x734e('0xa')]=_[_0x734e('0xb')](config[_0x734e('0xa')],{'host':_0x734e('0xc'),'port':0x18eb});var socket=require(_0x734e('0xd'))(new Redis(config[_0x734e('0xa')]));require(_0x734e('0xe'))[_0x734e('0xf')](socket);function respondWithRpcPromise(_0x3810cc,_0x8578d2,_0xd69de7){return new BPromise(function(_0x258716,_0x659b6e){return client[_0x734e('0x10')](_0x3810cc,_0xd69de7)['then'](function(_0x1beb36){logger[_0x734e('0x11')](_0x734e('0x12'),_0x8578d2,_0x734e('0x13'));logger[_0x734e('0x14')](_0x734e('0x15'),_0x8578d2,'request\x20sent',JSON[_0x734e('0x16')](_0x1beb36));if(_0x1beb36[_0x734e('0x17')]){if(_0x1beb36[_0x734e('0x17')][_0x734e('0x18')]===0x1f4){logger[_0x734e('0x17')](_0x734e('0x12'),_0x8578d2,_0x1beb36['error'][_0x734e('0x19')]);return _0x659b6e(_0x1beb36['error'][_0x734e('0x19')]);}logger['error'](_0x734e('0x12'),_0x8578d2,_0x1beb36[_0x734e('0x17')][_0x734e('0x19')]);return _0x258716(_0x1beb36[_0x734e('0x17')]['message']);}else{logger[_0x734e('0x11')](_0x734e('0x12'),_0x8578d2,_0x734e('0x13'));_0x258716(_0x1beb36[_0x734e('0x1a')][_0x734e('0x19')]);}})[_0x734e('0x1b')](function(_0x62329c){logger['error']('ChatMessage,\x20%s,\x20%s',_0x8578d2,_0x62329c);_0x659b6e(_0x62329c);});});}exports[_0x734e('0x1c')]=function(_0xef7216){var _0x5a2007=this;return new Promise(function(_0x4dc538,_0x4cfced){return db['ChatMessage']['create'](_0xef7216[_0x734e('0x1d')],{'raw':_0xef7216[_0x734e('0x1e')]?_0xef7216[_0x734e('0x1e')][_0x734e('0x1f')]===undefined?!![]:![]:!![]})[_0x734e('0x20')](function(_0x26e410){logger[_0x734e('0x11')](_0x734e('0x1c'),_0xef7216);logger['debug'](_0x734e('0x1c'),_0xef7216,JSON[_0x734e('0x16')](_0x26e410));_0x4dc538(_0x26e410);})[_0x734e('0x1b')](function(_0x3da8bf){logger[_0x734e('0x17')](_0x734e('0x1c'),_0x3da8bf['message'],_0xef7216);_0x4cfced(_0x5a2007[_0x734e('0x17')](0x1f4,_0x3da8bf[_0x734e('0x19')]));});});};
\ No newline at end of file
index 9c99ee5..75c2270 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1224=['update','emit','register','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x57baf,_0x1dff25){var _0x3c9a14=function(_0x14c79f){while(--_0x14c79f){_0x57baf['push'](_0x57baf['shift']());}};_0x3c9a14(++_0x1dff25);}(_0x1224,0x10d));var _0x4122=function(_0x344d91,_0x16e5f5){_0x344d91=_0x344d91-0x0;var _0x30507f=_0x1224[_0x344d91];return _0x30507f;};'use strict';var ChatMessageEvents=require(_0x4122('0x0'));var events=[_0x4122('0x1'),_0x4122('0x2'),_0x4122('0x3')];function createListener(_0x488f55,_0x3d42a9){return function(_0x51632b){_0x3d42a9[_0x4122('0x4')](_0x488f55,_0x51632b);};}function removeListener(_0x1f1533,_0x2f506b){return function(){ChatMessageEvents['removeListener'](_0x1f1533,_0x2f506b);};}exports[_0x4122('0x5')]=function(_0x76278c){for(var _0xc6dfaf=0x0,_0x40b5e4=events[_0x4122('0x6')];_0xc6dfaf<_0x40b5e4;_0xc6dfaf++){var _0x431470=events[_0xc6dfaf];var _0x2444a3=createListener(_0x4122('0x7')+_0x431470,_0x76278c);ChatMessageEvents['on'](_0x431470,_0x2444a3);}};
\ No newline at end of file
+var _0xfd87=['./chatMessage.events','save','remove','update','emit','removeListener','length','chatMessage:'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require(_0x7fd8('0x0'));var events=[_0x7fd8('0x1'),_0x7fd8('0x2'),_0x7fd8('0x3')];function createListener(_0x11b128,_0x15d25f){return function(_0x2631d9){_0x15d25f[_0x7fd8('0x4')](_0x11b128,_0x2631d9);};}function removeListener(_0x4429f2,_0x43b442){return function(){ChatMessageEvents[_0x7fd8('0x5')](_0x4429f2,_0x43b442);};}exports['register']=function(_0x1395b6){for(var _0x10a778=0x0,_0x55681d=events[_0x7fd8('0x6')];_0x10a778<_0x55681d;_0x10a778++){var _0x6eaf96=events[_0x10a778];var _0x2e2d74=createListener(_0x7fd8('0x7')+_0x6eaf96,_0x1395b6);ChatMessageEvents['on'](_0x6eaf96,_0x2e2d74);}};
\ No newline at end of file
index 44c5ccb..dcb60f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22c7=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','/:id','show','tracked','chat','chatmessage:create','create','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x5c98ea,_0xa782aa){var _0x51e853=function(_0x57d5b0){while(--_0x57d5b0){_0x5c98ea['push'](_0x5c98ea['shift']());}};_0x51e853(++_0xa782aa);}(_0x22c7,0x1ef));var _0x722c=function(_0x42e4ab,_0x2cd481){_0x42e4ab=_0x42e4ab-0x0;var _0x3eba59=_0x22c7[_0x42e4ab];return _0x3eba59;};'use strict';var multer=require(_0x722c('0x0'));var util=require(_0x722c('0x1'));var path=require(_0x722c('0x2'));var timeout=require(_0x722c('0x3'));var express=require(_0x722c('0x4'));var router=express[_0x722c('0x5')]();var fs_extra=require(_0x722c('0x6'));var auth=require(_0x722c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x722c('0x8'));var controller=require(_0x722c('0x9'));router['get']('/',auth[_0x722c('0xa')](),controller[_0x722c('0xb')]);router['get']('/describe',auth[_0x722c('0xa')](),controller['describe']);router['get'](_0x722c('0xc'),auth[_0x722c('0xa')](),controller[_0x722c('0xd')]);router['post']('/',auth[_0x722c('0xa')](),interaction[_0x722c('0xe')](_0x722c('0xf'),_0x722c('0x10')),controller[_0x722c('0x11')]);router['put'](_0x722c('0xc'),controller[_0x722c('0x12')]);router['put'](_0x722c('0x13'),auth[_0x722c('0xa')](),controller[_0x722c('0x14')]);router['put'](_0x722c('0x15'),auth[_0x722c('0xa')](),controller[_0x722c('0x16')]);router[_0x722c('0x17')]('/:id',auth[_0x722c('0xa')](),controller['destroy']);module[_0x722c('0x18')]=router;
\ No newline at end of file
+var _0x275b=['/describe','post','tracked','chatmessage:create','/:id','accept','put','reject','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x275b,0x155));var _0xb275=function(_0x3653ec,_0x3281c2){_0x3653ec=_0x3653ec-0x0;var _0x16a9fc=_0x275b[_0x3653ec];return _0x16a9fc;};'use strict';var multer=require(_0xb275('0x0'));var util=require('util');var path=require(_0xb275('0x1'));var timeout=require('connect-timeout');var express=require(_0xb275('0x2'));var router=express[_0xb275('0x3')]();var fs_extra=require(_0xb275('0x4'));var auth=require(_0xb275('0x5'));var interaction=require(_0xb275('0x6'));var config=require(_0xb275('0x7'));var controller=require(_0xb275('0x8'));router[_0xb275('0x9')]('/',auth[_0xb275('0xa')](),controller['index']);router[_0xb275('0x9')](_0xb275('0xb'),auth[_0xb275('0xa')](),controller['describe']);router[_0xb275('0x9')]('/:id',auth[_0xb275('0xa')](),controller['show']);router[_0xb275('0xc')]('/',auth[_0xb275('0xa')](),interaction[_0xb275('0xd')]('chat',_0xb275('0xe')),controller['create']);router['put'](_0xb275('0xf'),controller['update']);router['put']('/:id/accept',auth[_0xb275('0xa')](),controller[_0xb275('0x10')]);router[_0xb275('0x11')]('/:id/reject',auth['isAuthenticated'](),controller[_0xb275('0x12')]);router[_0xb275('0x13')](_0xb275('0xf'),auth[_0xb275('0xa')](),controller[_0xb275('0x14')]);module[_0xb275('0x15')]=router;
\ No newline at end of file
index 94e0481..78be9e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['medium','TEXT','exports'];(function(_0x10dd0d,_0x3fb50a){var _0x81b282=function(_0x4a385b){while(--_0x4a385b){_0x10dd0d['push'](_0x10dd0d['shift']());}};_0x81b282(++_0x3fb50a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x3b6ebe,_0x46fdee){var _0x149026=function(_0x49f0ca){while(--_0x49f0ca){_0x3b6ebe['push'](_0x3b6ebe['shift']());}};_0x149026(++_0x46fdee);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3c71aa,_0x56d51e){_0x3c71aa=_0x3c71aa-0x0;var _0x175062=_0x5f2f[_0x3c71aa];return _0x175062;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
index bf4b67e..8801bed 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(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x7a54,0x106));var _0x47a5=function(_0x5a95a2,_0x1d4fa8){_0x5a95a2=_0x5a95a2-0x0;var _0xe56287=_0x7a54[_0x5a95a2];return _0xe56287;};'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(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x7a54,0x106));var _0x47a5=function(_0x521ea1,_0x14fb02){_0x521ea1=_0x521ea1-0x0;var _0xe62915=_0x7a54[_0x521ea1];return _0xe62915;};'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 2ff6e5d..ad17d20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ecb=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x3ecb,0x181));var _0xb3ec=function(_0x1168e6,_0x4580fc){_0x1168e6=_0x1168e6-0x0;var _0x27c4c2=_0x3ecb[_0x1168e6];return _0x27c4c2;};'use strict';var EventEmitter=require(_0xb3ec('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xb3ec('0x1')](0x0);var events={'afterCreate':_0xb3ec('0x2'),'afterUpdate':_0xb3ec('0x3'),'afterDestroy':_0xb3ec('0x4')};function emitEvent(_0x477cc0){return function(_0x516b18,_0x566a97,_0x17575a){ChatOfflineMessageEvents[_0xb3ec('0x5')](_0x477cc0+':'+_0x516b18['id'],_0x516b18);ChatOfflineMessageEvents['emit'](_0x477cc0,_0x516b18);_0x17575a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xb3ec('0x6')](e,emitEvent(event));}}module[_0xb3ec('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xde8a=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update'];(function(_0x3e9c60,_0x4582ae){var _0x569f61=function(_0x43db1a){while(--_0x43db1a){_0x3e9c60['push'](_0x3e9c60['shift']());}};_0x569f61(++_0x4582ae);}(_0xde8a,0x9c));var _0xade8=function(_0x2557d0,_0x394d10){_0x2557d0=_0x2557d0-0x0;var _0x2deb37=_0xde8a[_0x2557d0];return _0x2deb37;};'use strict';var EventEmitter=require(_0xade8('0x0'));var ChatOfflineMessage=require(_0xade8('0x1'))['db'][_0xade8('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xade8('0x3')](0x0);var events={'afterCreate':_0xade8('0x4'),'afterUpdate':_0xade8('0x5'),'afterDestroy':'remove'};function emitEvent(_0x53cd21){return function(_0x2c6fb6,_0x2e73f6,_0x1d0228){ChatOfflineMessageEvents[_0xade8('0x6')](_0x53cd21+':'+_0x2c6fb6['id'],_0x2c6fb6);ChatOfflineMessageEvents['emit'](_0x53cd21,_0x2c6fb6);_0x1d0228(null);};}for(var e in events){if(events[_0xade8('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xade8('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
index 511e28f..e6daff6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecfd=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x522d1f,_0x9246e2){var _0x2d652d=function(_0x449599){while(--_0x449599){_0x522d1f['push'](_0x522d1f['shift']());}};_0x2d652d(++_0x9246e2);}(_0xecfd,0x11e));var _0xdecf=function(_0x42817d,_0x17482f){_0x42817d=_0x42817d-0x0;var _0x2edeb1=_0xecfd[_0x42817d];return _0x2edeb1;};'use strict';var attributes=require(_0xdecf('0x0'));module[_0xdecf('0x1')]=function(_0x59073e){return _0x59073e[_0xdecf('0x2')](_0xdecf('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xdecf('0x4')});};
\ No newline at end of file
+var _0xa8b1=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports','define'];(function(_0x26f561,_0x3df6e1){var _0x19a296=function(_0x21cd48){while(--_0x21cd48){_0x26f561['push'](_0x26f561['shift']());}};_0x19a296(++_0x3df6e1);}(_0xa8b1,0x184));var _0x1a8b=function(_0x5f59cc,_0x55d03f){_0x5f59cc=_0x5f59cc-0x0;var _0x5d2625=_0xa8b1[_0x5f59cc];return _0x5d2625;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x1a8b('0x0')]=function(_0x169abb){return _0x169abb[_0x1a8b('0x1')]('ChatOfflineMessage',attributes,{'tableName':_0x1a8b('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1a8b('0x3'),'collate':_0x1a8b('0x4')});};
\ No newline at end of file
index a3634f5..ccf6179 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2086=['lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x8fa43e,_0x37164d){var _0x17bc28=function(_0x2dd824){while(--_0x2dd824){_0x8fa43e['push'](_0x8fa43e['shift']());}};_0x17bc28(++_0x37164d);}(_0x2086,0x165));var _0x6208=function(_0x3db7d7,_0x22e85){_0x3db7d7=_0x3db7d7-0x0;var _0x892655=_0x2086[_0x3db7d7];return _0x892655;};'use strict';var _=require(_0x6208('0x0'));var util=require(_0x6208('0x1'));var moment=require('moment');var BPromise=require(_0x6208('0x2'));var rs=require(_0x6208('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6208('0x4'));var logger=require(_0x6208('0x5'))(_0x6208('0x6'));var config=require(_0x6208('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6208('0x8')][_0x6208('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17b6ef,_0xada426,_0x5bbcbd){return new BPromise(function(_0x311ec3,_0x2182a8){return client[_0x6208('0xa')](_0x17b6ef,_0x5bbcbd)[_0x6208('0xb')](function(_0x41bcdf){logger[_0x6208('0xc')](_0x6208('0xd'),_0xada426,_0x6208('0xe'));logger[_0x6208('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0xada426,'request\x20sent',JSON[_0x6208('0x10')](_0x41bcdf));if(_0x41bcdf['error']){if(_0x41bcdf[_0x6208('0x11')][_0x6208('0x12')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0xada426,_0x41bcdf[_0x6208('0x11')][_0x6208('0x13')]);return _0x2182a8(_0x41bcdf[_0x6208('0x11')]['message']);}logger[_0x6208('0x11')](_0x6208('0xd'),_0xada426,_0x41bcdf[_0x6208('0x11')][_0x6208('0x13')]);return _0x311ec3(_0x41bcdf['error'][_0x6208('0x13')]);}else{logger[_0x6208('0xc')](_0x6208('0xd'),_0xada426,_0x6208('0xe'));_0x311ec3(_0x41bcdf['result']['message']);}})[_0x6208('0x14')](function(_0x2205b8){logger['error'](_0x6208('0xd'),_0xada426,_0x2205b8);_0x2182a8(_0x2205b8);});});}
\ No newline at end of file
+var _0x5523=['stringify','error','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4e0919,_0x2ed183){var _0x4d4578=function(_0x596bbd){while(--_0x596bbd){_0x4e0919['push'](_0x4e0919['shift']());}};_0x4d4578(++_0x2ed183);}(_0x5523,0x15b));var _0x3552=function(_0xb587e5,_0x351d50){_0xb587e5=_0xb587e5-0x0;var _0x31a440=_0x5523[_0xb587e5];return _0x31a440;};'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')]('ChatOfflineMessage,\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')]('ChatOfflineMessage,\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']('ChatOfflineMessage,\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
index d47b133..892a353 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1217=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x1217,0xc5));var _0x7121=function(_0x33b62c,_0x371dbe){_0x33b62c=_0x33b62c-0x0;var _0x3fa4bf=_0x1217[_0x33b62c];return _0x3fa4bf;};'use strict';var multer=require(_0x7121('0x0'));var util=require(_0x7121('0x1'));var path=require(_0x7121('0x2'));var timeout=require(_0x7121('0x3'));var express=require('express');var router=express[_0x7121('0x4')]();var fs_extra=require(_0x7121('0x5'));var auth=require(_0x7121('0x6'));var interaction=require(_0x7121('0x7'));var config=require('../../config/environment');var controller=require(_0x7121('0x8'));router[_0x7121('0x9')]('/',auth[_0x7121('0xa')](),controller[_0x7121('0xb')]);router['get'](_0x7121('0xc'),auth[_0x7121('0xa')](),controller[_0x7121('0xd')]);router['get']('/:id',auth[_0x7121('0xa')](),controller['show']);router[_0x7121('0xe')]('/',auth[_0x7121('0xa')](),controller[_0x7121('0xf')]);router[_0x7121('0x10')](_0x7121('0x11'),auth['isAuthenticated'](),controller[_0x7121('0x12')]);router[_0x7121('0x13')](_0x7121('0x11'),auth['isAuthenticated'](),controller[_0x7121('0x14')]);module[_0x7121('0x15')]=router;
\ No newline at end of file
+var _0x4af4=['exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','post','create','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4af4,0xab));var _0x44af=function(_0x4acddb,_0x1c3ef2){_0x4acddb=_0x4acddb-0x0;var _0x3b08df=_0x4af4[_0x4acddb];return _0x3b08df;};'use strict';var multer=require(_0x44af('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x44af('0x1'));var express=require(_0x44af('0x2'));var router=express[_0x44af('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x44af('0x4'));var config=require(_0x44af('0x5'));var controller=require(_0x44af('0x6'));router[_0x44af('0x7')]('/',auth[_0x44af('0x8')](),controller['index']);router[_0x44af('0x7')](_0x44af('0x9'),auth['isAuthenticated'](),controller[_0x44af('0xa')]);router[_0x44af('0x7')](_0x44af('0xb'),auth[_0x44af('0x8')](),controller['show']);router[_0x44af('0xc')]('/',auth['isAuthenticated'](),controller[_0x44af('0xd')]);router['put']('/:id',auth[_0x44af('0x8')](),controller['update']);router[_0x44af('0xe')](_0x44af('0xb'),auth[_0x44af('0x8')](),controller[_0x44af('0xf')]);module[_0x44af('0x10')]=router;
\ No newline at end of file
index f79ce94..4448be2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7161=['INTEGER','sequelize','exports','STRING','timeout'];(function(_0x251b9e,_0x989cd1){var _0x4879fa=function(_0x473014){while(--_0x473014){_0x251b9e['push'](_0x251b9e['shift']());}};_0x4879fa(++_0x989cd1);}(_0x7161,0x1d2));var _0x1716=function(_0x3c7813,_0x3134d2){_0x3c7813=_0x3c7813-0x0;var _0x45f060=_0x7161[_0x3c7813];return _0x45f060;};'use strict';var Sequelize=require(_0x1716('0x0'));module[_0x1716('0x1')]={'name':{'type':Sequelize[_0x1716('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x1716('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x1716('0x2')]},'timeout':{'type':Sequelize[_0x1716('0x4')]}};
\ No newline at end of file
+var _0x7730=['ENUM','mouseOver','INTEGER','sequelize','STRING'];(function(_0x53f6a0,_0x16d576){var _0x3e6f05=function(_0x419759){while(--_0x419759){_0x53f6a0['push'](_0x53f6a0['shift']());}};_0x3e6f05(++_0x16d576);}(_0x7730,0x1e3));var _0x0773=function(_0x5ebe34,_0x421337){_0x5ebe34=_0x5ebe34-0x0;var _0x36a3ee=_0x7730[_0x5ebe34];return _0x36a3ee;};'use strict';var Sequelize=require(_0x0773('0x0'));module['exports']={'name':{'type':Sequelize[_0x0773('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0773('0x2')](_0x0773('0x3'),'timeout'),'defaultValue':_0x0773('0x3')},'selector':{'type':Sequelize[_0x0773('0x1')]},'timeout':{'type':Sequelize[_0x0773('0x4')]}};
\ No newline at end of file
index 26233c2..8bad90d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ed=['eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','options','find','catch','create','body','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x46ed,0x168));var _0xd46e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x46ed[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];function respondWithStatusCode(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xcc;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0x1a')](_0x48550b);}return _0x5bc1da['status'](_0x48550b)['end']();};}function respondWithResult(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0xc8;return function(_0x1e9aae){if(_0x1e9aae){return _0xacd799[_0xd46e('0x1b')](_0x4688ae)['json'](_0x1e9aae);}};}function respondWithFilteredResult(_0x3b6d25,_0x44a620){return function(_0x417402){if(_0x417402){var _0x3d72ce=typeof _0x44a620[_0xd46e('0x1c')]==='undefined'&&typeof _0x44a620[_0xd46e('0x1d')]===_0xd46e('0x1e');var _0x3583a5=_0x417402['count'];var _0x5ddd04=_0x3d72ce?0x0:_0x44a620[_0xd46e('0x1c')];var _0x1bd574=_0x3d72ce?_0x417402['count']:_0x44a620['offset']+_0x44a620[_0xd46e('0x1d')];var _0x2f2571;if(_0x1bd574>=_0x3583a5){_0x1bd574=_0x3583a5;_0x2f2571=0xc8;}else{_0x2f2571=0xce;}_0x3b6d25[_0xd46e('0x1b')](_0x2f2571);return _0x3b6d25[_0xd46e('0x1f')](_0xd46e('0x20'),_0x5ddd04+'-'+_0x1bd574+'/'+_0x3583a5)[_0xd46e('0x21')](_0x417402);}return null;};}function patchUpdates(_0x3b5fa4){return function(_0x327b7e){try{jsonpatch[_0xd46e('0x22')](_0x327b7e,_0x3b5fa4,!![]);}catch(_0x3c7e91){return BPromise[_0xd46e('0x23')](_0x3c7e91);}return _0x327b7e['save']();};}function saveUpdates(_0x259072,_0x1c83fa){return function(_0x79aa51){if(_0x79aa51){return _0x79aa51[_0xd46e('0x24')](_0x259072)[_0xd46e('0x25')](function(_0xc1af7f){return _0xc1af7f;});}return null;};}function removeEntity(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(_0x62dea5){return _0x62dea5['destroy']()[_0xd46e('0x25')](function(){_0x33c2e0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x371054,_0x2a5271){return function(_0x21135f){if(!_0x21135f){_0x371054[_0xd46e('0x1a')](0x194);}return _0x21135f;};}function handleError(_0x247b9f,_0x180851){_0x180851=_0x180851||0x1f4;return function(_0x1740d1){logger['error'](_0x1740d1[_0xd46e('0x26')]);if(_0x1740d1[_0xd46e('0x27')]){delete _0x1740d1[_0xd46e('0x27')];}_0x247b9f[_0xd46e('0x1b')](_0x180851)[_0xd46e('0x28')](_0x1740d1);};}exports[_0xd46e('0x29')]=function(_0x58aeef,_0x465d54){var _0x3a1ced={'raw':!![],'where':{'id':_0x58aeef[_0xd46e('0x2a')]['id']}},_0x2d1afe={};_0x2d1afe[_0xd46e('0x2b')]=_[_0xd46e('0x2c')](db[_0xd46e('0x2d')][_0xd46e('0x2e')]);_0x2d1afe[_0xd46e('0x2f')]=_[_0xd46e('0x2c')](_0x58aeef[_0xd46e('0x2f')]);_0x2d1afe[_0xd46e('0x30')]=_[_0xd46e('0x31')](_0x2d1afe['model'],_0x2d1afe[_0xd46e('0x2f')]);_0x3a1ced[_0xd46e('0x32')]=_[_0xd46e('0x31')](_0x2d1afe[_0xd46e('0x2b')],qs['fields'](_0x58aeef[_0xd46e('0x2f')][_0xd46e('0x33')]));_0x3a1ced['attributes']=_0x3a1ced[_0xd46e('0x32')][_0xd46e('0x34')]?_0x3a1ced['attributes']:_0x2d1afe[_0xd46e('0x2b')];if(_0x58aeef[_0xd46e('0x2f')][_0xd46e('0x35')]){_0x3a1ced['include']=[{'all':!![]}];}_0x3a1ced=_['merge']({},_0x3a1ced,_0x58aeef[_0xd46e('0x36')]);return db[_0xd46e('0x2d')][_0xd46e('0x37')](_0x3a1ced)[_0xd46e('0x25')](handleEntityNotFound(_0x465d54,null))[_0xd46e('0x25')](respondWithResult(_0x465d54,null))[_0xd46e('0x38')](handleError(_0x465d54,null));};exports[_0xd46e('0x39')]=function(_0xf8b746,_0x527a2f){return db[_0xd46e('0x2d')][_0xd46e('0x39')](_0xf8b746[_0xd46e('0x3a')],{})[_0xd46e('0x25')](respondWithResult(_0x527a2f,0xc9))[_0xd46e('0x38')](handleError(_0x527a2f,null));};exports[_0xd46e('0x24')]=function(_0x42ddde,_0x5158e6){if(_0x42ddde[_0xd46e('0x3a')]['id']){delete _0x42ddde[_0xd46e('0x3a')]['id'];}return db['ChatProactiveAction'][_0xd46e('0x37')]({'where':{'id':_0x42ddde[_0xd46e('0x2a')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x5158e6,null))[_0xd46e('0x25')](saveUpdates(_0x42ddde['body'],null))[_0xd46e('0x25')](respondWithResult(_0x5158e6,null))[_0xd46e('0x38')](handleError(_0x5158e6,null));};exports[_0xd46e('0x3b')]=function(_0x42dbaf,_0xefe5f4){return db[_0xd46e('0x2d')][_0xd46e('0x37')]({'where':{'id':_0x42dbaf[_0xd46e('0x2a')]['id']}})['then'](handleEntityNotFound(_0xefe5f4,null))[_0xd46e('0x25')](removeEntity(_0xefe5f4,null))[_0xd46e('0x38')](handleError(_0xefe5f4,null));};
\ No newline at end of file
+var _0xe700=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','ChatProactiveAction','rawAttributes','query','filters','intersection','model','attributes','fields','includeAll','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x39e62c,_0x3a540b){var _0x5470a1=function(_0x2c9f32){while(--_0x2c9f32){_0x39e62c['push'](_0x39e62c['shift']());}};_0x5470a1(++_0x3a540b);}(_0xe700,0x75));var _0x0e70=function(_0x44ac19,_0x44226e){_0x44ac19=_0x44ac19-0x0;var _0x1f795d=_0xe700[_0x44ac19];return _0x1f795d;};'use strict';var emlformat=require(_0x0e70('0x0'));var rimraf=require(_0x0e70('0x1'));var zipdir=require(_0x0e70('0x2'));var jsonpatch=require(_0x0e70('0x3'));var rp=require(_0x0e70('0x4'));var moment=require(_0x0e70('0x5'));var BPromise=require(_0x0e70('0x6'));var Mustache=require(_0x0e70('0x7'));var util=require(_0x0e70('0x8'));var path=require(_0x0e70('0x9'));var sox=require('sox');var csv=require(_0x0e70('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0e70('0xb'));var _=require(_0x0e70('0xc'));var squel=require(_0x0e70('0xd'));var crypto=require(_0x0e70('0xe'));var jsforce=require(_0x0e70('0xf'));var deskjs=require(_0x0e70('0x10'));var toCsv=require(_0x0e70('0xa'));var querystring=require(_0x0e70('0x11'));var Papa=require(_0x0e70('0x12'));var Redis=require(_0x0e70('0x13'));var authService=require(_0x0e70('0x14'));var qs=require(_0x0e70('0x15'));var as=require(_0x0e70('0x16'));var hardwareService=require(_0x0e70('0x17'));var logger=require(_0x0e70('0x18'))('api');var utils=require(_0x0e70('0x19'));var config=require(_0x0e70('0x1a'));var licenseUtil=require(_0x0e70('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x154a94,_0x23191d){_0x23191d=_0x23191d||0xcc;return function(_0x36a5d3){if(_0x36a5d3){return _0x154a94[_0x0e70('0x1c')](_0x23191d);}return _0x154a94['status'](_0x23191d)[_0x0e70('0x1d')]();};}function respondWithResult(_0x175bca,_0x30660e){_0x30660e=_0x30660e||0xc8;return function(_0x58a533){if(_0x58a533){return _0x175bca['status'](_0x30660e)[_0x0e70('0x1e')](_0x58a533);}};}function respondWithFilteredResult(_0x4b3e5f,_0x47446b){return function(_0x11af6e){if(_0x11af6e){var _0x41cb06=typeof _0x47446b[_0x0e70('0x1f')]==='undefined'&&typeof _0x47446b[_0x0e70('0x20')]===_0x0e70('0x21');var _0x21b1f1=_0x11af6e[_0x0e70('0x22')];var _0x13ff53=_0x41cb06?0x0:_0x47446b[_0x0e70('0x1f')];var _0x5a6206=_0x41cb06?_0x11af6e[_0x0e70('0x22')]:_0x47446b[_0x0e70('0x1f')]+_0x47446b['limit'];var _0x11d879;if(_0x5a6206>=_0x21b1f1){_0x5a6206=_0x21b1f1;_0x11d879=0xc8;}else{_0x11d879=0xce;}_0x4b3e5f[_0x0e70('0x23')](_0x11d879);return _0x4b3e5f[_0x0e70('0x24')](_0x0e70('0x25'),_0x13ff53+'-'+_0x5a6206+'/'+_0x21b1f1)['json'](_0x11af6e);}return null;};}function patchUpdates(_0x43062e){return function(_0x368216){try{jsonpatch[_0x0e70('0x26')](_0x368216,_0x43062e,!![]);}catch(_0x5653f2){return BPromise[_0x0e70('0x27')](_0x5653f2);}return _0x368216[_0x0e70('0x28')]();};}function saveUpdates(_0x4c9c9b,_0x3b2d2a){return function(_0x22ee57){if(_0x22ee57){return _0x22ee57[_0x0e70('0x29')](_0x4c9c9b)[_0x0e70('0x2a')](function(_0x422877){return _0x422877;});}return null;};}function removeEntity(_0x469553,_0x102289){return function(_0x350afc){if(_0x350afc){return _0x350afc[_0x0e70('0x2b')]()[_0x0e70('0x2a')](function(){_0x469553[_0x0e70('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c15fe,_0x22028f){return function(_0x4c2f0c){if(!_0x4c2f0c){_0x4c15fe[_0x0e70('0x1c')](0x194);}return _0x4c2f0c;};}function handleError(_0x59ae58,_0x3341ee){_0x3341ee=_0x3341ee||0x1f4;return function(_0x1a20e1){logger[_0x0e70('0x2c')](_0x1a20e1[_0x0e70('0x2d')]);if(_0x1a20e1[_0x0e70('0x2e')]){delete _0x1a20e1[_0x0e70('0x2e')];}_0x59ae58[_0x0e70('0x23')](_0x3341ee)[_0x0e70('0x2f')](_0x1a20e1);};}exports[_0x0e70('0x30')]=function(_0x15b86c,_0x39d0d2){var _0x132fe2={'raw':!![],'where':{'id':_0x15b86c[_0x0e70('0x31')]['id']}},_0xa59504={};_0xa59504['model']=_['keys'](db[_0x0e70('0x32')][_0x0e70('0x33')]);_0xa59504['query']=_['keys'](_0x15b86c[_0x0e70('0x34')]);_0xa59504[_0x0e70('0x35')]=_[_0x0e70('0x36')](_0xa59504[_0x0e70('0x37')],_0xa59504[_0x0e70('0x34')]);_0x132fe2[_0x0e70('0x38')]=_[_0x0e70('0x36')](_0xa59504[_0x0e70('0x37')],qs[_0x0e70('0x39')](_0x15b86c[_0x0e70('0x34')][_0x0e70('0x39')]));_0x132fe2[_0x0e70('0x38')]=_0x132fe2['attributes']['length']?_0x132fe2[_0x0e70('0x38')]:_0xa59504[_0x0e70('0x37')];if(_0x15b86c[_0x0e70('0x34')][_0x0e70('0x3a')]){_0x132fe2['include']=[{'all':!![]}];}_0x132fe2=_[_0x0e70('0x3b')]({},_0x132fe2,_0x15b86c['options']);return db[_0x0e70('0x32')][_0x0e70('0x3c')](_0x132fe2)['then'](handleEntityNotFound(_0x39d0d2,null))[_0x0e70('0x2a')](respondWithResult(_0x39d0d2,null))[_0x0e70('0x3d')](handleError(_0x39d0d2,null));};exports['create']=function(_0x42e46f,_0x42a212){return db[_0x0e70('0x32')][_0x0e70('0x3e')](_0x42e46f[_0x0e70('0x3f')],{})[_0x0e70('0x2a')](respondWithResult(_0x42a212,0xc9))[_0x0e70('0x3d')](handleError(_0x42a212,null));};exports['update']=function(_0x896a30,_0x144447){if(_0x896a30[_0x0e70('0x3f')]['id']){delete _0x896a30['body']['id'];}return db[_0x0e70('0x32')][_0x0e70('0x3c')]({'where':{'id':_0x896a30['params']['id']}})[_0x0e70('0x2a')](handleEntityNotFound(_0x144447,null))['then'](saveUpdates(_0x896a30['body'],null))[_0x0e70('0x2a')](respondWithResult(_0x144447,null))['catch'](handleError(_0x144447,null));};exports[_0x0e70('0x2b')]=function(_0x530f96,_0x3d1462){return db[_0x0e70('0x32')][_0x0e70('0x3c')]({'where':{'id':_0x530f96[_0x0e70('0x31')]['id']}})[_0x0e70('0x2a')](handleEntityNotFound(_0x3d1462,null))['then'](removeEntity(_0x3d1462,null))[_0x0e70('0x3d')](handleError(_0x3d1462,null));};
\ No newline at end of file
index 1272953..54f86ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x480a=['lodash','../../config/logger','moment','request-promise','path','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x36f47c,_0x38ef4d){var _0x296c55=function(_0x403eec){while(--_0x403eec){_0x36f47c['push'](_0x36f47c['shift']());}};_0x296c55(++_0x38ef4d);}(_0x480a,0xaa));var _0xa480=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x480a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa480('0x0'));var util=require('util');var logger=require(_0xa480('0x1'))('api');var moment=require(_0xa480('0x2'));var BPromise=require('bluebird');var rp=require(_0xa480('0x3'));var fs=require('fs');var path=require(_0xa480('0x4'));var rimraf=require('rimraf');var config=require(_0xa480('0x5'));var attributes=require('./chatProactiveAction.attributes');module[_0xa480('0x6')]=function(_0x5c6d65,_0x387fe1){return _0x5c6d65[_0xa480('0x7')](_0xa480('0x8'),attributes,{'tableName':_0xa480('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd877=['request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xd877,0x171));var _0x7d87=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xd877[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x7d87('0x0'));var util=require(_0x7d87('0x1'));var logger=require(_0x7d87('0x2'))(_0x7d87('0x3'));var moment=require(_0x7d87('0x4'));var BPromise=require(_0x7d87('0x5'));var rp=require(_0x7d87('0x6'));var fs=require('fs');var path=require(_0x7d87('0x7'));var rimraf=require(_0x7d87('0x8'));var config=require(_0x7d87('0x9'));var attributes=require(_0x7d87('0xa'));module[_0x7d87('0xb')]=function(_0x169469,_0x38ea33){return _0x169469[_0x7d87('0xc')](_0x7d87('0xd'),attributes,{'tableName':_0x7d87('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f777014..aee5b97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eef=['catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x5dd848,_0x59c784){var _0x22becf=function(_0x542c7b){while(--_0x542c7b){_0x5dd848['push'](_0x5dd848['shift']());}};_0x22becf(++_0x59c784);}(_0x5eef,0x8d));var _0xf5ee=function(_0x565847,_0x3f8b9b){_0x565847=_0x565847-0x0;var _0x1bd110=_0x5eef[_0x565847];return _0x1bd110;};'use strict';var _=require('lodash');var util=require(_0xf5ee('0x0'));var moment=require(_0xf5ee('0x1'));var BPromise=require('bluebird');var rs=require(_0xf5ee('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5ee('0x3'))['db'];var utils=require(_0xf5ee('0x4'));var logger=require(_0xf5ee('0x5'))('rpc');var config=require(_0xf5ee('0x6'));var jayson=require(_0xf5ee('0x7'));var client=jayson[_0xf5ee('0x8')][_0xf5ee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27f5b4,_0x1117f6,_0x1163d5){return new BPromise(function(_0x35f017,_0x992f32){return client[_0xf5ee('0xa')](_0x27f5b4,_0x1163d5)['then'](function(_0xe01fe){logger[_0xf5ee('0xb')](_0xf5ee('0xc'),_0x1117f6,_0xf5ee('0xd'));logger[_0xf5ee('0xe')](_0xf5ee('0xf'),_0x1117f6,'request\x20sent',JSON['stringify'](_0xe01fe));if(_0xe01fe[_0xf5ee('0x10')]){if(_0xe01fe['error']['code']===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x1117f6,_0xe01fe[_0xf5ee('0x10')][_0xf5ee('0x11')]);return _0x992f32(_0xe01fe['error'][_0xf5ee('0x11')]);}logger[_0xf5ee('0x10')](_0xf5ee('0xc'),_0x1117f6,_0xe01fe['error'][_0xf5ee('0x11')]);return _0x35f017(_0xe01fe[_0xf5ee('0x10')][_0xf5ee('0x11')]);}else{logger[_0xf5ee('0xb')](_0xf5ee('0xc'),_0x1117f6,_0xf5ee('0xd'));_0x35f017(_0xe01fe[_0xf5ee('0x12')][_0xf5ee('0x11')]);}})[_0xf5ee('0x13')](function(_0x34e5d1){logger['error'](_0xf5ee('0xc'),_0x1117f6,_0x34e5d1);_0x992f32(_0x34e5d1);});});}
\ No newline at end of file
+var _0x1516=['then','ChatProactiveAction,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request'];(function(_0x142be0,_0x32a81d){var _0x4a58a2=function(_0x133e59){while(--_0x133e59){_0x142be0['push'](_0x142be0['shift']());}};_0x4a58a2(++_0x32a81d);}(_0x1516,0xa0));var _0x6151=function(_0x489a2a,_0x3ed526){_0x489a2a=_0x489a2a-0x0;var _0x5e4c09=_0x1516[_0x489a2a];return _0x5e4c09;};'use strict';var _=require('lodash');var util=require(_0x6151('0x0'));var moment=require(_0x6151('0x1'));var BPromise=require(_0x6151('0x2'));var rs=require(_0x6151('0x3'));var fs=require('fs');var Redis=require(_0x6151('0x4'));var db=require(_0x6151('0x5'))['db'];var utils=require(_0x6151('0x6'));var logger=require(_0x6151('0x7'))('rpc');var config=require(_0x6151('0x8'));var jayson=require(_0x6151('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45c630,_0x1e002f,_0x45549a){return new BPromise(function(_0x37b750,_0x1597af){return client[_0x6151('0xa')](_0x45c630,_0x45549a)[_0x6151('0xb')](function(_0x59d862){logger['info'](_0x6151('0xc'),_0x1e002f,'request\x20sent');logger[_0x6151('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x1e002f,_0x6151('0xe'),JSON['stringify'](_0x59d862));if(_0x59d862[_0x6151('0xf')]){if(_0x59d862[_0x6151('0xf')]['code']===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x1e002f,_0x59d862[_0x6151('0xf')][_0x6151('0x10')]);return _0x1597af(_0x59d862[_0x6151('0xf')][_0x6151('0x10')]);}logger['error'](_0x6151('0xc'),_0x1e002f,_0x59d862[_0x6151('0xf')]['message']);return _0x37b750(_0x59d862[_0x6151('0xf')][_0x6151('0x10')]);}else{logger['info'](_0x6151('0xc'),_0x1e002f,_0x6151('0xe'));_0x37b750(_0x59d862[_0x6151('0x11')]['message']);}})[_0x6151('0x12')](function(_0x31c77b){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x1e002f,_0x31c77b);_0x1597af(_0x31c77b);});});}
\ No newline at end of file
index 8d64ce7..b6d81a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeda8=['get','/:id','isAuthenticated','show','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x20ab76,_0x3251aa){var _0x19bd65=function(_0x3165ea){while(--_0x3165ea){_0x20ab76['push'](_0x20ab76['shift']());}};_0x19bd65(++_0x3251aa);}(_0xeda8,0x104));var _0x8eda=function(_0x255652,_0x55bfe0){_0x255652=_0x255652-0x0;var _0x35b239=_0xeda8[_0x255652];return _0x35b239;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')](_0x8eda('0xb'),auth[_0x8eda('0xc')](),controller[_0x8eda('0xd')]);router['post']('/',auth[_0x8eda('0xc')](),controller[_0x8eda('0xe')]);router[_0x8eda('0xf')](_0x8eda('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8eda('0xc')](),controller[_0x8eda('0x10')]);module[_0x8eda('0x11')]=router;
\ No newline at end of file
+var _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x378bd7,_0x59fe69){var _0x4801d4=function(_0x1fa6be){while(--_0x1fa6be){_0x378bd7['push'](_0x378bd7['shift']());}};_0x4801d4(++_0x59fe69);}(_0x032e,0x124));var _0xe032=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x032e[_0x5bd426];return _0x23a7eb;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router;
\ No newline at end of file
index 96204c3..5a2556b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3419=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3419,0x7b));var _0x9341=function(_0xa5a920,_0x2d8772){_0xa5a920=_0xa5a920-0x0;var _0x596618=_0x3419[_0xa5a920];return _0x596618;};'use strict';var Sequelize=require('sequelize');module[_0x9341('0x0')]={'name':{'type':Sequelize[_0x9341('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9341('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9341('0x3')](_0x9341('0x4'),_0x9341('0x5'),_0x9341('0x6'))}};
\ No newline at end of file
+var _0x2998=['ENUM','rrmemory','roundrobin','STRING','name','INTEGER'];(function(_0x4514c7,_0x3525f8){var _0x11126e=function(_0x375813){while(--_0x375813){_0x4514c7['push'](_0x4514c7['shift']());}};_0x11126e(++_0x3525f8);}(_0x2998,0x12f));var _0x8299=function(_0x596edb,_0xff7985){_0x596edb=_0x596edb-0x0;var _0x1fe2ea=_0x2998[_0x596edb];return _0x1fe2ea;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8299('0x0')],'unique':_0x8299('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8299('0x0')]},'timeout':{'type':Sequelize[_0x8299('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8299('0x3')](_0x8299('0x4'),'beepall',_0x8299('0x5'))}};
\ No newline at end of file
index b800a87..d2ee664 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb48b=['isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','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','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','merge','includeAll','include','rows','params','length','options','find','catch','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','filter','findAll','UserId','agent','chatPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','addTeams','ids','Team','User','Agents','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','isEmpty','userChatQueue:remove','addAgents','spread','removeAgents'];(function(_0x5c9900,_0x36f494){var _0x2e3fc5=function(_0x48d062){while(--_0x48d062){_0x5c9900['push'](_0x5c9900['shift']());}};_0x2e3fc5(++_0x36f494);}(_0xb48b,0x1d3));var _0xbb48=function(_0x39c99b,_0x1b22c9){_0x39c99b=_0x39c99b-0x0;var _0x1944e1=_0xb48b[_0x39c99b];return _0x1944e1;};'use strict';var emlformat=require(_0xbb48('0x0'));var rimraf=require(_0xbb48('0x1'));var zipdir=require(_0xbb48('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb48('0x3'));var moment=require(_0xbb48('0x4'));var BPromise=require(_0xbb48('0x5'));var Mustache=require(_0xbb48('0x6'));var util=require(_0xbb48('0x7'));var path=require(_0xbb48('0x8'));var sox=require('sox');var csv=require(_0xbb48('0x9'));var ejs=require(_0xbb48('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb48('0xb'));var squel=require(_0xbb48('0xc'));var crypto=require(_0xbb48('0xd'));var jsforce=require(_0xbb48('0xe'));var deskjs=require(_0xbb48('0xf'));var toCsv=require(_0xbb48('0x9'));var querystring=require(_0xbb48('0x10'));var Papa=require(_0xbb48('0x11'));var Redis=require(_0xbb48('0x12'));var authService=require(_0xbb48('0x13'));var qs=require(_0xbb48('0x14'));var as=require(_0xbb48('0x15'));var hardwareService=require(_0xbb48('0x16'));var logger=require('../../config/logger')(_0xbb48('0x17'));var utils=require(_0xbb48('0x18'));var config=require(_0xbb48('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xbb48('0x1a')]=_[_0xbb48('0x1b')](config[_0xbb48('0x1a')],{'host':_0xbb48('0x1c'),'port':0x18eb});var socket=require(_0xbb48('0x1d'))(new Redis(config[_0xbb48('0x1a')]));require(_0xbb48('0x1e'))['register'](socket);var jayson=require(_0xbb48('0x1f'));var client=jayson[_0xbb48('0x20')][_0xbb48('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x113a26,_0x40a566,_0x8725ad,_0x51a47e){return new BPromise(function(_0x2ac0f5,_0x4e2adf){var _0x1b3cf9=_0x51a47e||client;return _0x1b3cf9[_0xbb48('0x22')](_0x113a26,_0x8725ad)[_0xbb48('0x23')](function(_0x49fbaf){logger[_0xbb48('0x24')](_0xbb48('0x25'),_0x40a566,_0xbb48('0x26'));logger[_0xbb48('0x27')](_0xbb48('0x28'),_0x40a566,_0xbb48('0x26'),JSON[_0xbb48('0x29')](_0x49fbaf));if(_0x49fbaf['error']){if(_0x49fbaf[_0xbb48('0x2a')][_0xbb48('0x2b')]===0x1f4){logger['error'](_0xbb48('0x25'),_0x40a566,_0x49fbaf['error'][_0xbb48('0x2c')]);return _0x4e2adf(_0x49fbaf['error'][_0xbb48('0x2c')]);}logger[_0xbb48('0x2a')](_0xbb48('0x25'),_0x40a566,_0x49fbaf[_0xbb48('0x2a')][_0xbb48('0x2c')]);return _0x2ac0f5(_0x49fbaf[_0xbb48('0x2a')][_0xbb48('0x2c')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x40a566,_0xbb48('0x26'));_0x2ac0f5(_0x49fbaf[_0xbb48('0x2d')][_0xbb48('0x2c')]);}})['catch'](function(_0x228193){logger[_0xbb48('0x2a')](_0xbb48('0x25'),_0x40a566,_0x228193);_0x4e2adf(_0x228193);});});}function respondWithStatusCode(_0x1c769e,_0x33b808){_0x33b808=_0x33b808||0xcc;return function(_0x20f26a){if(_0x20f26a){return _0x1c769e[_0xbb48('0x2e')](_0x33b808);}return _0x1c769e['status'](_0x33b808)[_0xbb48('0x2f')]();};}function respondWithResult(_0x56cdd9,_0x554586){_0x554586=_0x554586||0xc8;return function(_0x40b3f7){if(_0x40b3f7){return _0x56cdd9[_0xbb48('0x30')](_0x554586)['json'](_0x40b3f7);}};}function respondWithFilteredResult(_0x14221a,_0x1d54a5){return function(_0x2e257a){if(_0x2e257a){var _0x29cef6=typeof _0x1d54a5[_0xbb48('0x31')]===_0xbb48('0x32')&&typeof _0x1d54a5[_0xbb48('0x33')]===_0xbb48('0x32');var _0x28398d=_0x2e257a['count'];var _0x569f87=_0x29cef6?0x0:_0x1d54a5[_0xbb48('0x31')];var _0x143fe2=_0x29cef6?_0x2e257a[_0xbb48('0x34')]:_0x1d54a5[_0xbb48('0x31')]+_0x1d54a5[_0xbb48('0x33')];var _0x28332d;if(_0x143fe2>=_0x28398d){_0x143fe2=_0x28398d;_0x28332d=0xc8;}else{_0x28332d=0xce;}_0x14221a['status'](_0x28332d);return _0x14221a['set'](_0xbb48('0x35'),_0x569f87+'-'+_0x143fe2+'/'+_0x28398d)[_0xbb48('0x36')](_0x2e257a);}return null;};}function patchUpdates(_0x16fdab){return function(_0x5f25b4){try{jsonpatch[_0xbb48('0x37')](_0x5f25b4,_0x16fdab,!![]);}catch(_0xae9567){return BPromise[_0xbb48('0x38')](_0xae9567);}return _0x5f25b4[_0xbb48('0x39')]();};}function saveUpdates(_0x2764a2,_0x133c0e){return function(_0x586cc7){if(_0x586cc7){return _0x586cc7[_0xbb48('0x3a')](_0x2764a2)[_0xbb48('0x23')](function(_0x54ef25){return _0x54ef25;});}return null;};}function removeEntity(_0x15c9b3,_0x6a1f70){return function(_0x3436cf){if(_0x3436cf){return _0x3436cf[_0xbb48('0x3b')]()[_0xbb48('0x23')](function(){var _0x28ef8d=_0x3436cf[_0xbb48('0x3c')]({'plain':!![]});var _0x21088b=_0xbb48('0x3d');return db[_0xbb48('0x3e')]['destroy']({'where':{'type':_0x21088b,'resourceId':_0x28ef8d['id']}})[_0xbb48('0x23')](function(){return _0x3436cf;});})[_0xbb48('0x23')](function(){_0x15c9b3['status'](0xcc)[_0xbb48('0x2f')]();});}};}function handleEntityNotFound(_0x466934,_0x4a9cc5){return function(_0x563554){if(!_0x563554){_0x466934[_0xbb48('0x2e')](0x194);}return _0x563554;};}function handleError(_0x4d0e19,_0x331cb6){_0x331cb6=_0x331cb6||0x1f4;return function(_0x364631){logger[_0xbb48('0x2a')](_0x364631[_0xbb48('0x3f')]);if(_0x364631[_0xbb48('0x40')]){delete _0x364631['name'];}_0x4d0e19[_0xbb48('0x30')](_0x331cb6)[_0xbb48('0x41')](_0x364631);};}exports[_0xbb48('0x42')]=function(_0x19f5aa,_0x325107){var _0x4aef84={},_0x4803f9={},_0x2667fa={'count':0x0,'rows':[]};var _0x21340d=_[_0xbb48('0x43')](db[_0xbb48('0x44')][_0xbb48('0x45')],function(_0x251df0){return{'name':_0x251df0['fieldName'],'type':_0x251df0['type'][_0xbb48('0x46')]};});_0x4803f9[_0xbb48('0x47')]=_['map'](_0x21340d,_0xbb48('0x40'));_0x4803f9[_0xbb48('0x48')]=_[_0xbb48('0x49')](_0x19f5aa[_0xbb48('0x48')]);_0x4803f9[_0xbb48('0x4a')]=_[_0xbb48('0x4b')](_0x4803f9[_0xbb48('0x47')],_0x4803f9['query']);_0x4aef84[_0xbb48('0x4c')]=_[_0xbb48('0x4b')](_0x4803f9['model'],qs[_0xbb48('0x4d')](_0x19f5aa[_0xbb48('0x48')]['fields']));_0x4aef84[_0xbb48('0x4c')]=_0x4aef84[_0xbb48('0x4c')]['length']?_0x4aef84[_0xbb48('0x4c')]:_0x4803f9[_0xbb48('0x47')];if(!_0x19f5aa[_0xbb48('0x48')][_0xbb48('0x4e')](_0xbb48('0x4f'))){_0x4aef84['limit']=qs[_0xbb48('0x33')](_0x19f5aa['query'][_0xbb48('0x33')]);_0x4aef84[_0xbb48('0x31')]=qs[_0xbb48('0x31')](_0x19f5aa[_0xbb48('0x48')]['offset']);}_0x4aef84[_0xbb48('0x50')]=qs[_0xbb48('0x51')](_0x19f5aa[_0xbb48('0x48')][_0xbb48('0x51')]);_0x4aef84[_0xbb48('0x52')]=qs[_0xbb48('0x4a')](_[_0xbb48('0x53')](_0x19f5aa[_0xbb48('0x48')],_0x4803f9[_0xbb48('0x4a')]),_0x21340d);if(_0x19f5aa[_0xbb48('0x48')]['filter']){_0x4aef84[_0xbb48('0x52')]=_['merge'](_0x4aef84[_0xbb48('0x52')],{'$or':_[_0xbb48('0x43')](_0x21340d,function(_0x1c6764){if(_0x1c6764[_0xbb48('0x54')]!==_0xbb48('0x55')){var _0x503706={};_0x503706[_0x1c6764[_0xbb48('0x40')]]={'$like':'%'+_0x19f5aa[_0xbb48('0x48')]['filter']+'%'};return _0x503706;}})});}_0x4aef84=_[_0xbb48('0x56')]({},_0x4aef84,_0x19f5aa['options']);var _0xe7d23b={'where':_0x4aef84['where']};return db[_0xbb48('0x44')]['count'](_0xe7d23b)[_0xbb48('0x23')](function(_0x12a2ac){_0x2667fa['count']=_0x12a2ac;if(_0x19f5aa[_0xbb48('0x48')][_0xbb48('0x57')]){_0x4aef84[_0xbb48('0x58')]=[{'all':!![]}];}return db[_0xbb48('0x44')]['findAll'](_0x4aef84);})[_0xbb48('0x23')](function(_0x16afb2){_0x2667fa[_0xbb48('0x59')]=_0x16afb2;return _0x2667fa;})[_0xbb48('0x23')](respondWithFilteredResult(_0x325107,_0x4aef84))['catch'](handleError(_0x325107,null));};exports['show']=function(_0x34de69,_0x29e206){var _0x16c740={'raw':!![],'where':{'id':_0x34de69[_0xbb48('0x5a')]['id']}},_0x198f7b={};_0x198f7b['model']=_['keys'](db[_0xbb48('0x44')][_0xbb48('0x45')]);_0x198f7b[_0xbb48('0x48')]=_[_0xbb48('0x49')](_0x34de69[_0xbb48('0x48')]);_0x198f7b[_0xbb48('0x4a')]=_[_0xbb48('0x4b')](_0x198f7b[_0xbb48('0x47')],_0x198f7b[_0xbb48('0x48')]);_0x16c740[_0xbb48('0x4c')]=_[_0xbb48('0x4b')](_0x198f7b['model'],qs[_0xbb48('0x4d')](_0x34de69[_0xbb48('0x48')][_0xbb48('0x4d')]));_0x16c740[_0xbb48('0x4c')]=_0x16c740[_0xbb48('0x4c')][_0xbb48('0x5b')]?_0x16c740[_0xbb48('0x4c')]:_0x198f7b[_0xbb48('0x47')];if(_0x34de69['query'][_0xbb48('0x57')]){_0x16c740[_0xbb48('0x58')]=[{'all':!![]}];}_0x16c740=_[_0xbb48('0x56')]({},_0x16c740,_0x34de69[_0xbb48('0x5c')]);return db[_0xbb48('0x44')][_0xbb48('0x5d')](_0x16c740)[_0xbb48('0x23')](handleEntityNotFound(_0x29e206,null))[_0xbb48('0x23')](respondWithResult(_0x29e206,null))[_0xbb48('0x5e')](handleError(_0x29e206,null));};exports[_0xbb48('0x5f')]=function(_0x4c4162,_0xacd601){return db[_0xbb48('0x44')]['create'](_0x4c4162[_0xbb48('0x60')],{})['then'](function(_0x4327e7){var _0x3d0e2a=_0x4c4162[_0xbb48('0x61')][_0xbb48('0x3c')]({'plain':!![]});if(!_0x3d0e2a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d0e2a[_0xbb48('0x62')]==='user'){var _0xc83a44=_0x4327e7['get']({'plain':!![]});var _0x3ba7b4=_0xbb48('0x3d');return db['UserProfileSection'][_0xbb48('0x5d')]({'where':{'name':_0x3ba7b4,'userProfileId':_0x3d0e2a[_0xbb48('0x63')]},'raw':!![]})['then'](function(_0x400b93){if(_0x400b93&&_0x400b93[_0xbb48('0x64')]===0x0){return db[_0xbb48('0x3e')][_0xbb48('0x5f')]({'name':_0xc83a44[_0xbb48('0x40')],'resourceId':_0xc83a44['id'],'type':_0x400b93['name'],'sectionId':_0x400b93['id']},{})['then'](function(){return _0x4327e7;});}else{return _0x4327e7;}})['catch'](function(_0x39efbe){logger[_0xbb48('0x2a')](_0xbb48('0x65'),_0x39efbe);throw _0x39efbe;});}return _0x4327e7;})[_0xbb48('0x23')](respondWithResult(_0xacd601,0xc9))[_0xbb48('0x5e')](handleError(_0xacd601,null));};exports[_0xbb48('0x3a')]=function(_0x397bc8,_0x1ad483){if(_0x397bc8['body']['id']){delete _0x397bc8[_0xbb48('0x60')]['id'];}return db[_0xbb48('0x44')][_0xbb48('0x5d')]({'where':{'id':_0x397bc8['params']['id']}})[_0xbb48('0x23')](handleEntityNotFound(_0x1ad483,null))['then'](saveUpdates(_0x397bc8[_0xbb48('0x60')],null))[_0xbb48('0x23')](respondWithResult(_0x1ad483,null))[_0xbb48('0x5e')](handleError(_0x1ad483,null));};exports[_0xbb48('0x3b')]=function(_0x464edb,_0x5659e7){return db[_0xbb48('0x44')][_0xbb48('0x5d')]({'where':{'id':_0x464edb[_0xbb48('0x5a')]['id']}})[_0xbb48('0x23')](handleEntityNotFound(_0x5659e7,null))[_0xbb48('0x23')](removeEntity(_0x5659e7,null))['catch'](handleError(_0x5659e7,null));};exports[_0xbb48('0x66')]=function(_0x344284,_0x6368a3){return db[_0xbb48('0x44')]['describe']()[_0xbb48('0x23')](respondWithResult(_0x6368a3,null))['catch'](handleError(_0x6368a3,null));};exports[_0xbb48('0x67')]=function(_0x24a82e,_0x557fc0,_0x2f9c45){var _0x1beb4c={'raw':!![],'where':{}},_0x3dbcf2={},_0x3dedd9;return db[_0xbb48('0x44')][_0xbb48('0x68')]({'where':{'id':_0x24a82e['params']['id']}})[_0xbb48('0x23')](handleEntityNotFound(_0x557fc0,null))[_0xbb48('0x23')](function(_0x107c6b){if(_0x107c6b){_0x3dedd9=_0x107c6b[_0xbb48('0x3c')]({'plain':!![]});_0x3dbcf2[_0xbb48('0x47')]=_[_0xbb48('0x49')](db[_0xbb48('0x69')][_0xbb48('0x45')]);_0x3dbcf2[_0xbb48('0x48')]=_[_0xbb48('0x49')](_0x24a82e[_0xbb48('0x48')]);_0x3dbcf2[_0xbb48('0x4a')]=_[_0xbb48('0x4b')](_0x3dbcf2[_0xbb48('0x47')],_0x3dbcf2['query']);_0x1beb4c[_0xbb48('0x4c')]=_['intersection'](_0x3dbcf2['model'],qs[_0xbb48('0x4d')](_0x24a82e[_0xbb48('0x48')]['fields']));_0x1beb4c[_0xbb48('0x4c')]=_0x1beb4c[_0xbb48('0x4c')][_0xbb48('0x5b')]?_0x1beb4c['attributes']:_0x3dbcf2[_0xbb48('0x47')];if(!_0x24a82e[_0xbb48('0x48')]['hasOwnProperty'](_0xbb48('0x4f'))){_0x1beb4c[_0xbb48('0x33')]=qs[_0xbb48('0x33')](_0x24a82e[_0xbb48('0x48')][_0xbb48('0x33')]);_0x1beb4c[_0xbb48('0x31')]=qs[_0xbb48('0x31')](_0x24a82e[_0xbb48('0x48')][_0xbb48('0x31')]);}_0x1beb4c[_0xbb48('0x50')]=qs['sort'](_0x24a82e['query'][_0xbb48('0x51')]);_0x1beb4c['where']=qs[_0xbb48('0x4a')](_[_0xbb48('0x53')](_0x24a82e[_0xbb48('0x48')],_0x3dbcf2[_0xbb48('0x4a')]));_0x1beb4c[_0xbb48('0x52')]['ChatQueueId']=_0x107c6b['id'];if(_0x24a82e[_0xbb48('0x48')]['filter']){_0x1beb4c[_0xbb48('0x52')]=_[_0xbb48('0x56')](_0x1beb4c[_0xbb48('0x52')],{'$or':_[_0xbb48('0x43')](_0x1beb4c['attributes'],function(_0x1c1b89){var _0x14b335={};_0x14b335[_0x1c1b89]={'$like':'%'+_0x24a82e['query'][_0xbb48('0x6a')]+'%'};return _0x14b335;})});}_0x1beb4c=_[_0xbb48('0x56')]({},_0x1beb4c,_0x24a82e['options']);return db[_0xbb48('0x69')][_0xbb48('0x6b')](_0x1beb4c);}})[_0xbb48('0x23')](function(_0x3c7cb9){if(_0x3c7cb9){return db['User']['findAndCountAll']({'where':{'id':_[_0xbb48('0x43')](_0x3c7cb9,_0xbb48('0x6c')),'role':_0xbb48('0x6d')},'attributes':['id',_0xbb48('0x40'),_0xbb48('0x6e'),'updatedAt',_0xbb48('0x6f')]});}})[_0xbb48('0x23')](function(_0x23afc2){if(_0x23afc2){return{'count':_0x23afc2[_0xbb48('0x34')],'rows':_[_0xbb48('0x43')](_0x23afc2[_0xbb48('0x59')],function(_0x46479d){return{'membername':_0x46479d[_0xbb48('0x40')],'UserId':_0x46479d['id'],'queue_name':_0x3dedd9['name'],'ChatQueueId':_0x3dedd9['id'],'interface':util[_0xbb48('0x70')](_0xbb48('0x71'),_0xbb48('0x72'),_0x46479d[_0xbb48('0x40')]),'penalty':0x0,'paused':_0x46479d[_0xbb48('0x6e')],'createdAt':_0x46479d[_0xbb48('0x6f')],'updatedAt':_0x46479d[_0xbb48('0x73')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x557fc0,_0x1beb4c))[_0xbb48('0x5e')](handleError(_0x557fc0,null));};exports[_0xbb48('0x74')]=function(_0x5b80a6,_0xf9317e,_0x5a256b){var _0xd89ae6={};var _0x3d1362={};var _0x1b8ced;var _0x2b2cae;return db[_0xbb48('0x44')][_0xbb48('0x68')]({'where':{'id':_0x5b80a6[_0xbb48('0x5a')]['id']}})['then'](handleEntityNotFound(_0xf9317e,null))[_0xbb48('0x23')](function(_0x4f28be){if(_0x4f28be){_0x1b8ced=_0x4f28be;_0x3d1362[_0xbb48('0x47')]=_[_0xbb48('0x49')](db['Team'][_0xbb48('0x45')]);_0x3d1362[_0xbb48('0x48')]=_[_0xbb48('0x49')](_0x5b80a6[_0xbb48('0x48')]);_0x3d1362[_0xbb48('0x4a')]=_[_0xbb48('0x4b')](_0x3d1362[_0xbb48('0x47')],_0x3d1362[_0xbb48('0x48')]);_0xd89ae6[_0xbb48('0x4c')]=_['intersection'](_0x3d1362[_0xbb48('0x47')],qs[_0xbb48('0x4d')](_0x5b80a6[_0xbb48('0x48')][_0xbb48('0x4d')]));_0xd89ae6['attributes']=_0xd89ae6['attributes'][_0xbb48('0x5b')]?_0xd89ae6[_0xbb48('0x4c')]:_0x3d1362['model'];_0xd89ae6[_0xbb48('0x50')]=qs[_0xbb48('0x51')](_0x5b80a6[_0xbb48('0x48')][_0xbb48('0x51')]);_0xd89ae6[_0xbb48('0x52')]=qs[_0xbb48('0x4a')](_[_0xbb48('0x53')](_0x5b80a6[_0xbb48('0x48')],_0x3d1362[_0xbb48('0x4a')]));if(_0x5b80a6[_0xbb48('0x48')][_0xbb48('0x6a')]){_0xd89ae6[_0xbb48('0x52')]=_[_0xbb48('0x56')](_0xd89ae6[_0xbb48('0x52')],{'$or':_['map'](_0xd89ae6[_0xbb48('0x4c')],function(_0x2bdfc8){var _0x2ae772={};_0x2ae772[_0x2bdfc8]={'$like':'%'+_0x5b80a6['query'][_0xbb48('0x6a')]+'%'};return _0x2ae772;})});}_0xd89ae6=_[_0xbb48('0x56')]({},_0xd89ae6,_0x5b80a6[_0xbb48('0x5c')]);return _0x1b8ced['getTeams'](_0xd89ae6);}})[_0xbb48('0x23')](function(_0x1d41ab){if(_0x1d41ab){_0x2b2cae=_0x1d41ab['length'];if(!_0x5b80a6[_0xbb48('0x48')][_0xbb48('0x4e')](_0xbb48('0x4f'))){_0xd89ae6[_0xbb48('0x33')]=qs[_0xbb48('0x33')](_0x5b80a6[_0xbb48('0x48')][_0xbb48('0x33')]);_0xd89ae6[_0xbb48('0x31')]=qs[_0xbb48('0x31')](_0x5b80a6[_0xbb48('0x48')]['offset']);}return _0x1b8ced['getTeams'](_0xd89ae6);}})['then'](function(_0x4c97f5){if(_0x4c97f5){return _0x4c97f5?{'count':_0x2b2cae,'rows':_0x4c97f5}:null;}})[_0xbb48('0x23')](respondWithResult(_0xf9317e,null))[_0xbb48('0x5e')](handleError(_0xf9317e,null));};exports[_0xbb48('0x75')]=function(_0x5087be,_0x40ba99,_0x2141e7){var _0x1460a7=_0x5087be['body'][_0xbb48('0x76')];return db[_0xbb48('0x77')][_0xbb48('0x6b')]({'where':{'id':_0x1460a7},'attributes':['id'],'include':[{'model':db[_0xbb48('0x78')],'as':_0xbb48('0x79'),'attributes':['id',_0xbb48('0x40'),'online','voicePause',_0xbb48('0x7a')],'raw':!![]}]})[_0xbb48('0x23')](function(_0x307c28){if(_0x307c28){var _0x3770e7=_[_0xbb48('0x7b')](_0x307c28,function(_0xe9fc88){var _0x4ae433=_0xe9fc88[_0xbb48('0x3c')]({'plain':!![]});return _0x4ae433['Agents'];});return db[_0xbb48('0x44')][_0xbb48('0x5d')]({'where':{'id':_0x5087be[_0xbb48('0x5a')]['id']}})[_0xbb48('0x23')](function(_0x568e10){return db[_0xbb48('0x7c')][_0xbb48('0x7d')](function(_0x346135){return _0x568e10[_0xbb48('0x75')](_0x1460a7,{'transaction':_0x346135})[_0xbb48('0x23')](function(){return BPromise['each'](_0x3770e7,function(_0x7374d4){return db[_0xbb48('0x69')][_0xbb48('0x7e')]({'where':{'UserId':_0x7374d4['id'],'ChatQueueId':_0x5087be[_0xbb48('0x5a')]['id']},'transaction':_0x346135});});})[_0xbb48('0x23')](function(){_0x3770e7[_0xbb48('0x7f')](function(_0x762152){socket[_0xbb48('0x80')](_0xbb48('0x81'),{'UserId':_0x762152['id'],'ChatQueueId':_0x568e10['id']});});});});});}})[_0xbb48('0x23')](respondWithStatusCode(_0x40ba99,null))['catch'](handleError(_0x40ba99,null));};exports[_0xbb48('0x82')]=function(_0x1962a3,_0x190a58,_0x16c3ec){return db['Team'][_0xbb48('0x6b')]({'where':{'id':_0x1962a3[_0xbb48('0x48')][_0xbb48('0x76')]},'attributes':['id'],'include':[{'model':db[_0xbb48('0x78')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xbb48('0x23')](handleEntityNotFound(_0x190a58,null))['then'](function(_0x2424ff){var _0x43ecef=_[_0xbb48('0x43')](_0x2424ff,'id');var _0x452e16=[];var _0x26f855=[];var _0x16d6fb=squel[_0xbb48('0x83')]();_0x16d6fb[_0xbb48('0x84')](_0xbb48('0x85'))[_0xbb48('0x86')](_0xbb48('0x87'),'tq')['join'](_0xbb48('0x88'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xbb48('0x52')](_0xbb48('0x89'),_0x1962a3[_0xbb48('0x5a')]['id']);for(var _0x20ab72=0x0;_0x20ab72<_0x2424ff['length'];_0x20ab72+=0x1){let _0xa9a8c9=_0x2424ff[_0x20ab72];for(var _0x20de6a=0x0;_0x20de6a<_0xa9a8c9[_0xbb48('0x79')][_0xbb48('0x5b')];_0x20de6a+=0x1){let _0x308356=_0xa9a8c9[_0xbb48('0x79')][_0x20de6a];var _0x51ff06=_0x16d6fb[_0xbb48('0x8a')]();_0x51ff06[_0xbb48('0x52')]('ut.UserId\x20=\x20?',_0x308356['id']);_0x26f855[_0xbb48('0x8b')](db[_0xbb48('0x7c')][_0xbb48('0x48')](_0x51ff06[_0xbb48('0x8c')](),{'type':db[_0xbb48('0x7c')][_0xbb48('0x8d')][_0xbb48('0x8e')]})[_0xbb48('0x23')](function(_0x2b877c){if(_0x2b877c['length']===0x1){return _0x308356['id'];}else{var _0x56598f=_[_0xbb48('0x8f')](_[_0xbb48('0x43')](_0x2b877c,_0xbb48('0x90')),function(_0x3bf28b){return _[_0xbb48('0x91')](_0x43ecef,_0x3bf28b);});if(_0x56598f){return _0x308356['id'];}}}));}}return BPromise['all'](_0x26f855)[_0xbb48('0x23')](function(_0x36daad){_0x452e16=_(_0x452e16)[_0xbb48('0x92')](_0x36daad)[_0xbb48('0x93')]()['value']();return db[_0xbb48('0x44')][_0xbb48('0x5d')]({'where':{'id':_0x1962a3['params']['id']}})[_0xbb48('0x23')](function(_0x2016c2){return db[_0xbb48('0x7c')][_0xbb48('0x7d')](function(_0x1ec791){return _0x2016c2[_0xbb48('0x82')](_0x1962a3['query'][_0xbb48('0x76')],{'transaction':_0x1ec791})['then'](function(){if(!_[_0xbb48('0x94')](_0x452e16)){return _0x2016c2['removeAgents'](_0x452e16,{'transaction':_0x1ec791});}})[_0xbb48('0x23')](function(){_0x452e16[_0xbb48('0x7f')](function(_0x314648){socket[_0xbb48('0x80')](_0xbb48('0x95'),{'UserId':_0x314648,'ChatQueueId':_0x2016c2['id']});});});});});});})[_0xbb48('0x23')](respondWithStatusCode(_0x190a58,null))[_0xbb48('0x5e')](handleError(_0x190a58,null));};exports[_0xbb48('0x96')]=function(_0x1b3cdf,_0x28632a,_0x5e4247){return db[_0xbb48('0x44')][_0xbb48('0x5d')]({'where':{'id':_0x1b3cdf[_0xbb48('0x5a')]['id']}})[_0xbb48('0x23')](handleEntityNotFound(_0x28632a,null))[_0xbb48('0x23')](function(_0x4676bd){if(_0x4676bd){return _0x4676bd[_0xbb48('0x96')](_0x1b3cdf[_0xbb48('0x60')][_0xbb48('0x76')],_['omit'](_0x1b3cdf[_0xbb48('0x60')],[_0xbb48('0x76'),'id'])||{})[_0xbb48('0x97')](function(_0x2bd6da){for(var _0x2b840d=0x0;_0x2b840d<_0x1b3cdf[_0xbb48('0x60')][_0xbb48('0x76')][_0xbb48('0x5b')];_0x2b840d+=0x1){socket['emit'](_0xbb48('0x81'),{'UserId':Number(_0x1b3cdf['body']['ids'][_0x2b840d]),'ChatQueueId':Number(_0x1b3cdf[_0xbb48('0x5a')]['id'])});}return _0x2bd6da;});}})[_0xbb48('0x23')](respondWithResult(_0x28632a,null))[_0xbb48('0x5e')](handleError(_0x28632a,null));};exports[_0xbb48('0x98')]=function(_0x2d1b2e,_0x23ea96,_0x31d7b3){return db[_0xbb48('0x44')][_0xbb48('0x5d')]({'where':{'id':_0x2d1b2e[_0xbb48('0x5a')]['id']}})[_0xbb48('0x23')](handleEntityNotFound(_0x23ea96,null))['then'](function(_0x48e3ce){if(_0x48e3ce){return _0x48e3ce[_0xbb48('0x98')](_0x2d1b2e['query'][_0xbb48('0x76')])[_0xbb48('0x23')](function(){if(_[_0xbb48('0x99')](_0x2d1b2e[_0xbb48('0x48')]['ids'])){for(var _0x2e7a28=0x0;_0x2e7a28<_0x2d1b2e['query'][_0xbb48('0x76')][_0xbb48('0x5b')];_0x2e7a28+=0x1){socket[_0xbb48('0x80')](_0xbb48('0x95'),{'UserId':Number(_0x2d1b2e[_0xbb48('0x48')][_0xbb48('0x76')][_0x2e7a28]),'ChatQueueId':Number(_0x2d1b2e[_0xbb48('0x5a')]['id'])});}}else{socket[_0xbb48('0x80')](_0xbb48('0x95'),{'UserId':Number(_0x2d1b2e[_0xbb48('0x48')][_0xbb48('0x76')]),'ChatQueueId':Number(_0x2d1b2e[_0xbb48('0x5a')]['id'])});}});}})[_0xbb48('0x23')](respondWithStatusCode(_0x23ea96,null))['catch'](handleError(_0x23ea96,null));};exports['getAgents']=function(_0x24ff03,_0x1241dd,_0x3472db){var _0x3e4499={};var _0x486a83={};var _0x358c68;var _0x54f9e7;return db['ChatQueue']['findOne']({'where':{'id':_0x24ff03[_0xbb48('0x5a')]['id']}})[_0xbb48('0x23')](handleEntityNotFound(_0x1241dd,null))['then'](function(_0x1ed7fd){if(_0x1ed7fd){_0x358c68=_0x1ed7fd;_0x486a83[_0xbb48('0x47')]=_[_0xbb48('0x49')](db[_0xbb48('0x78')][_0xbb48('0x45')]);_0x486a83['query']=_[_0xbb48('0x49')](_0x24ff03[_0xbb48('0x48')]);_0x486a83['filters']=_[_0xbb48('0x4b')](_0x486a83[_0xbb48('0x47')],_0x486a83['query']);_0x3e4499[_0xbb48('0x4c')]=_['intersection'](_0x486a83[_0xbb48('0x47')],qs[_0xbb48('0x4d')](_0x24ff03[_0xbb48('0x48')][_0xbb48('0x4d')]));_0x3e4499[_0xbb48('0x4c')]=_0x3e4499['attributes'][_0xbb48('0x5b')]?_0x3e4499['attributes']:_0x486a83['model'];_0x3e4499[_0xbb48('0x50')]=qs[_0xbb48('0x51')](_0x24ff03[_0xbb48('0x48')]['sort']);_0x3e4499[_0xbb48('0x52')]=qs['filters'](_[_0xbb48('0x53')](_0x24ff03[_0xbb48('0x48')],_0x486a83[_0xbb48('0x4a')]));if(_0x24ff03[_0xbb48('0x48')][_0xbb48('0x6a')]){_0x3e4499['where']=_[_0xbb48('0x56')](_0x3e4499[_0xbb48('0x52')],{'$or':_[_0xbb48('0x43')](_0x3e4499[_0xbb48('0x4c')],function(_0xf3de7b){var _0x26eab4={};_0x26eab4[_0xf3de7b]={'$like':'%'+_0x24ff03[_0xbb48('0x48')][_0xbb48('0x6a')]+'%'};return _0x26eab4;})});}_0x3e4499=_[_0xbb48('0x56')]({},_0x3e4499,_0x24ff03[_0xbb48('0x5c')]);return _0x358c68['getAgents'](_0x3e4499);}})[_0xbb48('0x23')](function(_0x42681e){if(_0x42681e){_0x54f9e7=_0x42681e['length'];if(!_0x24ff03[_0xbb48('0x48')]['hasOwnProperty'](_0xbb48('0x4f'))){_0x3e4499['limit']=qs[_0xbb48('0x33')](_0x24ff03[_0xbb48('0x48')][_0xbb48('0x33')]);_0x3e4499[_0xbb48('0x31')]=qs['offset'](_0x24ff03[_0xbb48('0x48')][_0xbb48('0x31')]);}return _0x358c68[_0xbb48('0x9a')](_0x3e4499);}})[_0xbb48('0x23')](function(_0x51ee4c){if(_0x51ee4c){return _0x51ee4c?{'count':_0x54f9e7,'rows':_0x51ee4c}:null;}})['then'](respondWithResult(_0x1241dd,null))[_0xbb48('0x5e')](handleError(_0x1241dd,null));};
\ No newline at end of file
+var _0x6ece=['set','Content-Range','json','apply','reject','save','update','get','destroy','stack','name','send','index','map','ChatQueue','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','rawAttributes','create','role','user','ChatQueues','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserChatQueue','nolimit','ChatQueueId','User','findAndCountAll','agent','chatPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','includes','union','value','userChatQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','zip-dir','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/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','sendStatus','status','end','undefined','limit','count','offset'];(function(_0xea8e01,_0x4dad1f){var _0x1a7dee=function(_0xf6820b){while(--_0xf6820b){_0xea8e01['push'](_0xea8e01['shift']());}};_0x1a7dee(++_0x4dad1f);}(_0x6ece,0x10c));var _0xe6ec=function(_0x56b14a,_0x290e8a){_0x56b14a=_0x56b14a-0x0;var _0x2252f1=_0x6ece[_0x56b14a];return _0x2252f1;};'use strict';var emlformat=require(_0xe6ec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe6ec('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe6ec('0x2'));var moment=require(_0xe6ec('0x3'));var BPromise=require(_0xe6ec('0x4'));var Mustache=require(_0xe6ec('0x5'));var util=require(_0xe6ec('0x6'));var path=require(_0xe6ec('0x7'));var sox=require(_0xe6ec('0x8'));var csv=require(_0xe6ec('0x9'));var ejs=require(_0xe6ec('0xa'));var fs=require('fs');var fs_extra=require(_0xe6ec('0xb'));var _=require(_0xe6ec('0xc'));var squel=require('squel');var crypto=require(_0xe6ec('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe6ec('0xe'));var toCsv=require(_0xe6ec('0x9'));var querystring=require(_0xe6ec('0xf'));var Papa=require(_0xe6ec('0x10'));var Redis=require(_0xe6ec('0x11'));var authService=require(_0xe6ec('0x12'));var qs=require(_0xe6ec('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe6ec('0x14'));var logger=require(_0xe6ec('0x15'))(_0xe6ec('0x16'));var utils=require(_0xe6ec('0x17'));var config=require(_0xe6ec('0x18'));var licenseUtil=require(_0xe6ec('0x19'));var db=require(_0xe6ec('0x1a'))['db'];config[_0xe6ec('0x1b')]=_[_0xe6ec('0x1c')](config[_0xe6ec('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xe6ec('0x1d'))(new Redis(config[_0xe6ec('0x1b')]));require(_0xe6ec('0x1e'))[_0xe6ec('0x1f')](socket);var jayson=require(_0xe6ec('0x20'));var client=jayson[_0xe6ec('0x21')][_0xe6ec('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x45cb70,_0x18ff70,_0x22d81d,_0x48d5cf){return new BPromise(function(_0x40e5d3,_0x53b1ed){var _0x3cf097=_0x48d5cf||client;return _0x3cf097[_0xe6ec('0x23')](_0x45cb70,_0x22d81d)[_0xe6ec('0x24')](function(_0x1782c3){logger[_0xe6ec('0x25')](_0xe6ec('0x26'),_0x18ff70,_0xe6ec('0x27'));logger[_0xe6ec('0x28')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x18ff70,'request\x20sent',JSON[_0xe6ec('0x29')](_0x1782c3));if(_0x1782c3['error']){if(_0x1782c3['error'][_0xe6ec('0x2a')]===0x1f4){logger['error'](_0xe6ec('0x26'),_0x18ff70,_0x1782c3[_0xe6ec('0x2b')][_0xe6ec('0x2c')]);return _0x53b1ed(_0x1782c3[_0xe6ec('0x2b')]['message']);}logger[_0xe6ec('0x2b')](_0xe6ec('0x26'),_0x18ff70,_0x1782c3['error'][_0xe6ec('0x2c')]);return _0x40e5d3(_0x1782c3[_0xe6ec('0x2b')]['message']);}else{logger[_0xe6ec('0x25')](_0xe6ec('0x26'),_0x18ff70,_0xe6ec('0x27'));_0x40e5d3(_0x1782c3[_0xe6ec('0x2d')][_0xe6ec('0x2c')]);}})[_0xe6ec('0x2e')](function(_0x202c05){logger[_0xe6ec('0x2b')](_0xe6ec('0x26'),_0x18ff70,_0x202c05);_0x53b1ed(_0x202c05);});});}function respondWithStatusCode(_0x37a6b8,_0x19c986){_0x19c986=_0x19c986||0xcc;return function(_0x912171){if(_0x912171){return _0x37a6b8[_0xe6ec('0x2f')](_0x19c986);}return _0x37a6b8[_0xe6ec('0x30')](_0x19c986)[_0xe6ec('0x31')]();};}function respondWithResult(_0x10c498,_0x139585){_0x139585=_0x139585||0xc8;return function(_0x577622){if(_0x577622){return _0x10c498[_0xe6ec('0x30')](_0x139585)['json'](_0x577622);}};}function respondWithFilteredResult(_0x5a88e9,_0x241dd7){return function(_0x291f55){if(_0x291f55){var _0x54370c=typeof _0x241dd7['offset']===_0xe6ec('0x32')&&typeof _0x241dd7[_0xe6ec('0x33')]==='undefined';var _0x239b99=_0x291f55[_0xe6ec('0x34')];var _0x42a3a8=_0x54370c?0x0:_0x241dd7['offset'];var _0x36c756=_0x54370c?_0x291f55[_0xe6ec('0x34')]:_0x241dd7[_0xe6ec('0x35')]+_0x241dd7['limit'];var _0x5db93b;if(_0x36c756>=_0x239b99){_0x36c756=_0x239b99;_0x5db93b=0xc8;}else{_0x5db93b=0xce;}_0x5a88e9[_0xe6ec('0x30')](_0x5db93b);return _0x5a88e9[_0xe6ec('0x36')](_0xe6ec('0x37'),_0x42a3a8+'-'+_0x36c756+'/'+_0x239b99)[_0xe6ec('0x38')](_0x291f55);}return null;};}function patchUpdates(_0x560130){return function(_0x2691b5){try{jsonpatch[_0xe6ec('0x39')](_0x2691b5,_0x560130,!![]);}catch(_0x261023){return BPromise[_0xe6ec('0x3a')](_0x261023);}return _0x2691b5[_0xe6ec('0x3b')]();};}function saveUpdates(_0x51ef6e,_0x2f07a7){return function(_0x59753c){if(_0x59753c){return _0x59753c[_0xe6ec('0x3c')](_0x51ef6e)[_0xe6ec('0x24')](function(_0x38d6e7){return _0x38d6e7;});}return null;};}function removeEntity(_0x51ba0e,_0x2a9391){return function(_0x136465){if(_0x136465){return _0x136465['destroy']()[_0xe6ec('0x24')](function(){var _0x266ae4=_0x136465[_0xe6ec('0x3d')]({'plain':!![]});var _0x432ce7='ChatQueues';return db['UserProfileResource'][_0xe6ec('0x3e')]({'where':{'type':_0x432ce7,'resourceId':_0x266ae4['id']}})['then'](function(){return _0x136465;});})['then'](function(){_0x51ba0e[_0xe6ec('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ba70e,_0x53e561){return function(_0x38d041){if(!_0x38d041){_0x1ba70e[_0xe6ec('0x2f')](0x194);}return _0x38d041;};}function handleError(_0x1814b9,_0x3e5783){_0x3e5783=_0x3e5783||0x1f4;return function(_0x80894a){logger[_0xe6ec('0x2b')](_0x80894a[_0xe6ec('0x3f')]);if(_0x80894a[_0xe6ec('0x40')]){delete _0x80894a[_0xe6ec('0x40')];}_0x1814b9[_0xe6ec('0x30')](_0x3e5783)[_0xe6ec('0x41')](_0x80894a);};}exports[_0xe6ec('0x42')]=function(_0x4dcd34,_0x14a4a4){var _0x32d732={},_0x2f9068={},_0x212278={'count':0x0,'rows':[]};var _0xa4cf85=_[_0xe6ec('0x43')](db[_0xe6ec('0x44')]['rawAttributes'],function(_0x534c9c){return{'name':_0x534c9c[_0xe6ec('0x45')],'type':_0x534c9c['type'][_0xe6ec('0x46')]};});_0x2f9068['model']=_[_0xe6ec('0x43')](_0xa4cf85,_0xe6ec('0x40'));_0x2f9068[_0xe6ec('0x47')]=_[_0xe6ec('0x48')](_0x4dcd34[_0xe6ec('0x47')]);_0x2f9068[_0xe6ec('0x49')]=_[_0xe6ec('0x4a')](_0x2f9068[_0xe6ec('0x4b')],_0x2f9068[_0xe6ec('0x47')]);_0x32d732[_0xe6ec('0x4c')]=_[_0xe6ec('0x4a')](_0x2f9068['model'],qs[_0xe6ec('0x4d')](_0x4dcd34[_0xe6ec('0x47')][_0xe6ec('0x4d')]));_0x32d732['attributes']=_0x32d732[_0xe6ec('0x4c')][_0xe6ec('0x4e')]?_0x32d732[_0xe6ec('0x4c')]:_0x2f9068[_0xe6ec('0x4b')];if(!_0x4dcd34[_0xe6ec('0x47')][_0xe6ec('0x4f')]('nolimit')){_0x32d732[_0xe6ec('0x33')]=qs[_0xe6ec('0x33')](_0x4dcd34[_0xe6ec('0x47')][_0xe6ec('0x33')]);_0x32d732['offset']=qs[_0xe6ec('0x35')](_0x4dcd34[_0xe6ec('0x47')]['offset']);}_0x32d732[_0xe6ec('0x50')]=qs[_0xe6ec('0x51')](_0x4dcd34[_0xe6ec('0x47')]['sort']);_0x32d732[_0xe6ec('0x52')]=qs[_0xe6ec('0x49')](_[_0xe6ec('0x53')](_0x4dcd34[_0xe6ec('0x47')],_0x2f9068[_0xe6ec('0x49')]),_0xa4cf85);if(_0x4dcd34[_0xe6ec('0x47')][_0xe6ec('0x54')]){_0x32d732['where']=_['merge'](_0x32d732[_0xe6ec('0x52')],{'$or':_[_0xe6ec('0x43')](_0xa4cf85,function(_0x30feec){if(_0x30feec[_0xe6ec('0x55')]!==_0xe6ec('0x56')){var _0x6539e4={};_0x6539e4[_0x30feec[_0xe6ec('0x40')]]={'$like':'%'+_0x4dcd34[_0xe6ec('0x47')][_0xe6ec('0x54')]+'%'};return _0x6539e4;}})});}_0x32d732=_[_0xe6ec('0x57')]({},_0x32d732,_0x4dcd34[_0xe6ec('0x58')]);var _0xa30b8f={'where':_0x32d732[_0xe6ec('0x52')]};return db['ChatQueue'][_0xe6ec('0x34')](_0xa30b8f)[_0xe6ec('0x24')](function(_0x3649c9){_0x212278[_0xe6ec('0x34')]=_0x3649c9;if(_0x4dcd34[_0xe6ec('0x47')][_0xe6ec('0x59')]){_0x32d732[_0xe6ec('0x5a')]=[{'all':!![]}];}return db[_0xe6ec('0x44')][_0xe6ec('0x5b')](_0x32d732);})[_0xe6ec('0x24')](function(_0x6810b1){_0x212278[_0xe6ec('0x5c')]=_0x6810b1;return _0x212278;})[_0xe6ec('0x24')](respondWithFilteredResult(_0x14a4a4,_0x32d732))[_0xe6ec('0x2e')](handleError(_0x14a4a4,null));};exports[_0xe6ec('0x5d')]=function(_0x1e9a7d,_0x24ebb1){var _0x340094={'raw':!![],'where':{'id':_0x1e9a7d['params']['id']}},_0x51d88a={};_0x51d88a['model']=_[_0xe6ec('0x48')](db[_0xe6ec('0x44')][_0xe6ec('0x5e')]);_0x51d88a[_0xe6ec('0x47')]=_[_0xe6ec('0x48')](_0x1e9a7d[_0xe6ec('0x47')]);_0x51d88a['filters']=_[_0xe6ec('0x4a')](_0x51d88a[_0xe6ec('0x4b')],_0x51d88a[_0xe6ec('0x47')]);_0x340094['attributes']=_[_0xe6ec('0x4a')](_0x51d88a[_0xe6ec('0x4b')],qs[_0xe6ec('0x4d')](_0x1e9a7d[_0xe6ec('0x47')]['fields']));_0x340094[_0xe6ec('0x4c')]=_0x340094[_0xe6ec('0x4c')][_0xe6ec('0x4e')]?_0x340094['attributes']:_0x51d88a[_0xe6ec('0x4b')];if(_0x1e9a7d[_0xe6ec('0x47')][_0xe6ec('0x59')]){_0x340094[_0xe6ec('0x5a')]=[{'all':!![]}];}_0x340094=_[_0xe6ec('0x57')]({},_0x340094,_0x1e9a7d['options']);return db[_0xe6ec('0x44')]['find'](_0x340094)[_0xe6ec('0x24')](handleEntityNotFound(_0x24ebb1,null))[_0xe6ec('0x24')](respondWithResult(_0x24ebb1,null))[_0xe6ec('0x2e')](handleError(_0x24ebb1,null));};exports[_0xe6ec('0x5f')]=function(_0xa9636f,_0x5c2d3e){return db[_0xe6ec('0x44')]['create'](_0xa9636f['body'],{})['then'](function(_0x2259ca){var _0x3218a2=_0xa9636f['user'][_0xe6ec('0x3d')]({'plain':!![]});if(!_0x3218a2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3218a2[_0xe6ec('0x60')]===_0xe6ec('0x61')){var _0x485a27=_0x2259ca[_0xe6ec('0x3d')]({'plain':!![]});var _0x2bf886=_0xe6ec('0x62');return db[_0xe6ec('0x63')][_0xe6ec('0x64')]({'where':{'name':_0x2bf886,'userProfileId':_0x3218a2[_0xe6ec('0x65')]},'raw':!![]})['then'](function(_0x5762a2){if(_0x5762a2&&_0x5762a2['autoAssociation']===0x0){return db[_0xe6ec('0x66')][_0xe6ec('0x5f')]({'name':_0x485a27[_0xe6ec('0x40')],'resourceId':_0x485a27['id'],'type':_0x5762a2['name'],'sectionId':_0x5762a2['id']},{})[_0xe6ec('0x24')](function(){return _0x2259ca;});}else{return _0x2259ca;}})[_0xe6ec('0x2e')](function(_0x4fd1da){logger['error'](_0xe6ec('0x67'),_0x4fd1da);throw _0x4fd1da;});}return _0x2259ca;})[_0xe6ec('0x24')](respondWithResult(_0x5c2d3e,0xc9))[_0xe6ec('0x2e')](handleError(_0x5c2d3e,null));};exports[_0xe6ec('0x3c')]=function(_0x992aad,_0x2e0531){if(_0x992aad[_0xe6ec('0x68')]['id']){delete _0x992aad['body']['id'];}return db[_0xe6ec('0x44')]['find']({'where':{'id':_0x992aad[_0xe6ec('0x69')]['id']}})[_0xe6ec('0x24')](handleEntityNotFound(_0x2e0531,null))[_0xe6ec('0x24')](saveUpdates(_0x992aad[_0xe6ec('0x68')],null))[_0xe6ec('0x24')](respondWithResult(_0x2e0531,null))[_0xe6ec('0x2e')](handleError(_0x2e0531,null));};exports[_0xe6ec('0x3e')]=function(_0x13d8ea,_0x2070fb){return db[_0xe6ec('0x44')][_0xe6ec('0x64')]({'where':{'id':_0x13d8ea[_0xe6ec('0x69')]['id']}})['then'](handleEntityNotFound(_0x2070fb,null))[_0xe6ec('0x24')](removeEntity(_0x2070fb,null))[_0xe6ec('0x2e')](handleError(_0x2070fb,null));};exports[_0xe6ec('0x6a')]=function(_0x28efb9,_0x29c485){return db[_0xe6ec('0x44')][_0xe6ec('0x6a')]()[_0xe6ec('0x24')](respondWithResult(_0x29c485,null))[_0xe6ec('0x2e')](handleError(_0x29c485,null));};exports[_0xe6ec('0x6b')]=function(_0x27993e,_0x5f20c2,_0x1a90ee){var _0x5fc04f={'raw':!![],'where':{}},_0x25cc2d={},_0x4ea764;return db[_0xe6ec('0x44')][_0xe6ec('0x6c')]({'where':{'id':_0x27993e[_0xe6ec('0x69')]['id']}})[_0xe6ec('0x24')](handleEntityNotFound(_0x5f20c2,null))[_0xe6ec('0x24')](function(_0x12d89b){if(_0x12d89b){_0x4ea764=_0x12d89b[_0xe6ec('0x3d')]({'plain':!![]});_0x25cc2d[_0xe6ec('0x4b')]=_['keys'](db[_0xe6ec('0x6d')][_0xe6ec('0x5e')]);_0x25cc2d[_0xe6ec('0x47')]=_[_0xe6ec('0x48')](_0x27993e[_0xe6ec('0x47')]);_0x25cc2d[_0xe6ec('0x49')]=_[_0xe6ec('0x4a')](_0x25cc2d[_0xe6ec('0x4b')],_0x25cc2d['query']);_0x5fc04f['attributes']=_['intersection'](_0x25cc2d[_0xe6ec('0x4b')],qs[_0xe6ec('0x4d')](_0x27993e['query'][_0xe6ec('0x4d')]));_0x5fc04f[_0xe6ec('0x4c')]=_0x5fc04f[_0xe6ec('0x4c')]['length']?_0x5fc04f[_0xe6ec('0x4c')]:_0x25cc2d['model'];if(!_0x27993e['query'][_0xe6ec('0x4f')](_0xe6ec('0x6e'))){_0x5fc04f[_0xe6ec('0x33')]=qs['limit'](_0x27993e[_0xe6ec('0x47')]['limit']);_0x5fc04f[_0xe6ec('0x35')]=qs[_0xe6ec('0x35')](_0x27993e['query'][_0xe6ec('0x35')]);}_0x5fc04f[_0xe6ec('0x50')]=qs[_0xe6ec('0x51')](_0x27993e[_0xe6ec('0x47')][_0xe6ec('0x51')]);_0x5fc04f[_0xe6ec('0x52')]=qs[_0xe6ec('0x49')](_[_0xe6ec('0x53')](_0x27993e[_0xe6ec('0x47')],_0x25cc2d[_0xe6ec('0x49')]));_0x5fc04f[_0xe6ec('0x52')][_0xe6ec('0x6f')]=_0x12d89b['id'];if(_0x27993e[_0xe6ec('0x47')]['filter']){_0x5fc04f[_0xe6ec('0x52')]=_[_0xe6ec('0x57')](_0x5fc04f[_0xe6ec('0x52')],{'$or':_[_0xe6ec('0x43')](_0x5fc04f[_0xe6ec('0x4c')],function(_0x23a523){var _0x251c10={};_0x251c10[_0x23a523]={'$like':'%'+_0x27993e['query'][_0xe6ec('0x54')]+'%'};return _0x251c10;})});}_0x5fc04f=_[_0xe6ec('0x57')]({},_0x5fc04f,_0x27993e[_0xe6ec('0x58')]);return db['UserChatQueue'][_0xe6ec('0x5b')](_0x5fc04f);}})[_0xe6ec('0x24')](function(_0xf5dd7c){if(_0xf5dd7c){return db[_0xe6ec('0x70')][_0xe6ec('0x71')]({'where':{'id':_[_0xe6ec('0x43')](_0xf5dd7c,'UserId'),'role':_0xe6ec('0x72')},'attributes':['id',_0xe6ec('0x40'),_0xe6ec('0x73'),'updatedAt',_0xe6ec('0x74')]});}})['then'](function(_0x37845d){if(_0x37845d){return{'count':_0x37845d[_0xe6ec('0x34')],'rows':_[_0xe6ec('0x43')](_0x37845d[_0xe6ec('0x5c')],function(_0x4e1049){return{'membername':_0x4e1049[_0xe6ec('0x40')],'UserId':_0x4e1049['id'],'queue_name':_0x4ea764['name'],'ChatQueueId':_0x4ea764['id'],'interface':util[_0xe6ec('0x75')](_0xe6ec('0x76'),_0xe6ec('0x77'),_0x4e1049[_0xe6ec('0x40')]),'penalty':0x0,'paused':_0x4e1049['chatPause'],'createdAt':_0x4e1049[_0xe6ec('0x74')],'updatedAt':_0x4e1049[_0xe6ec('0x78')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe6ec('0x24')](respondWithFilteredResult(_0x5f20c2,_0x5fc04f))['catch'](handleError(_0x5f20c2,null));};exports['getTeams']=function(_0x6206d5,_0x4eac29,_0x3a405b){var _0x459c64={};var _0x599f75={};var _0x2612a5;var _0x4ff330;return db[_0xe6ec('0x44')][_0xe6ec('0x6c')]({'where':{'id':_0x6206d5[_0xe6ec('0x69')]['id']}})[_0xe6ec('0x24')](handleEntityNotFound(_0x4eac29,null))[_0xe6ec('0x24')](function(_0x41578d){if(_0x41578d){_0x2612a5=_0x41578d;_0x599f75[_0xe6ec('0x4b')]=_[_0xe6ec('0x48')](db[_0xe6ec('0x79')]['rawAttributes']);_0x599f75[_0xe6ec('0x47')]=_[_0xe6ec('0x48')](_0x6206d5[_0xe6ec('0x47')]);_0x599f75[_0xe6ec('0x49')]=_[_0xe6ec('0x4a')](_0x599f75[_0xe6ec('0x4b')],_0x599f75[_0xe6ec('0x47')]);_0x459c64['attributes']=_[_0xe6ec('0x4a')](_0x599f75[_0xe6ec('0x4b')],qs['fields'](_0x6206d5[_0xe6ec('0x47')][_0xe6ec('0x4d')]));_0x459c64[_0xe6ec('0x4c')]=_0x459c64['attributes']['length']?_0x459c64['attributes']:_0x599f75[_0xe6ec('0x4b')];_0x459c64[_0xe6ec('0x50')]=qs[_0xe6ec('0x51')](_0x6206d5[_0xe6ec('0x47')][_0xe6ec('0x51')]);_0x459c64['where']=qs['filters'](_['pick'](_0x6206d5['query'],_0x599f75['filters']));if(_0x6206d5[_0xe6ec('0x47')][_0xe6ec('0x54')]){_0x459c64[_0xe6ec('0x52')]=_[_0xe6ec('0x57')](_0x459c64[_0xe6ec('0x52')],{'$or':_[_0xe6ec('0x43')](_0x459c64[_0xe6ec('0x4c')],function(_0x3e5050){var _0x2fcbef={};_0x2fcbef[_0x3e5050]={'$like':'%'+_0x6206d5[_0xe6ec('0x47')][_0xe6ec('0x54')]+'%'};return _0x2fcbef;})});}_0x459c64=_[_0xe6ec('0x57')]({},_0x459c64,_0x6206d5[_0xe6ec('0x58')]);return _0x2612a5[_0xe6ec('0x7a')](_0x459c64);}})[_0xe6ec('0x24')](function(_0x5d0bf3){if(_0x5d0bf3){_0x4ff330=_0x5d0bf3[_0xe6ec('0x4e')];if(!_0x6206d5[_0xe6ec('0x47')][_0xe6ec('0x4f')](_0xe6ec('0x6e'))){_0x459c64[_0xe6ec('0x33')]=qs[_0xe6ec('0x33')](_0x6206d5['query'][_0xe6ec('0x33')]);_0x459c64[_0xe6ec('0x35')]=qs[_0xe6ec('0x35')](_0x6206d5[_0xe6ec('0x47')][_0xe6ec('0x35')]);}return _0x2612a5['getTeams'](_0x459c64);}})['then'](function(_0x3ff9db){if(_0x3ff9db){return _0x3ff9db?{'count':_0x4ff330,'rows':_0x3ff9db}:null;}})[_0xe6ec('0x24')](respondWithResult(_0x4eac29,null))[_0xe6ec('0x2e')](handleError(_0x4eac29,null));};exports[_0xe6ec('0x7b')]=function(_0x573080,_0x516ef8,_0x10807b){var _0x3a29e7=_0x573080[_0xe6ec('0x68')][_0xe6ec('0x7c')];return db[_0xe6ec('0x79')]['findAll']({'where':{'id':_0x3a29e7},'attributes':['id'],'include':[{'model':db[_0xe6ec('0x70')],'as':_0xe6ec('0x7d'),'attributes':['id',_0xe6ec('0x40'),_0xe6ec('0x7e'),_0xe6ec('0x7f'),_0xe6ec('0x80')],'raw':!![]}]})['then'](function(_0x163fe1){if(_0x163fe1){var _0x2e7de9=_[_0xe6ec('0x81')](_0x163fe1,function(_0x20c530){var _0x1a3e2e=_0x20c530['get']({'plain':!![]});return _0x1a3e2e[_0xe6ec('0x7d')];});return db['ChatQueue'][_0xe6ec('0x64')]({'where':{'id':_0x573080[_0xe6ec('0x69')]['id']}})[_0xe6ec('0x24')](function(_0x1c9e90){return db['sequelize'][_0xe6ec('0x82')](function(_0x3f10b9){return _0x1c9e90['addTeams'](_0x3a29e7,{'transaction':_0x3f10b9})[_0xe6ec('0x24')](function(){return BPromise[_0xe6ec('0x83')](_0x2e7de9,function(_0x3d3455){return db[_0xe6ec('0x6d')][_0xe6ec('0x84')]({'where':{'UserId':_0x3d3455['id'],'ChatQueueId':_0x573080['params']['id']},'transaction':_0x3f10b9});});})[_0xe6ec('0x24')](function(){_0x2e7de9[_0xe6ec('0x85')](function(_0x30c202){socket[_0xe6ec('0x86')](_0xe6ec('0x87'),{'UserId':_0x30c202['id'],'ChatQueueId':_0x1c9e90['id']});});});});});}})[_0xe6ec('0x24')](respondWithStatusCode(_0x516ef8,null))['catch'](handleError(_0x516ef8,null));};exports[_0xe6ec('0x88')]=function(_0x2df8a0,_0xa56f6b,_0x226bda){return db[_0xe6ec('0x79')]['findAll']({'where':{'id':_0x2df8a0[_0xe6ec('0x47')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe6ec('0x70')],'as':_0xe6ec('0x7d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xa56f6b,null))[_0xe6ec('0x24')](function(_0x1dae20){var _0xa80b51=_[_0xe6ec('0x43')](_0x1dae20,'id');var _0x25839e=[];var _0x4d96fa=[];var _0x4a11f3=squel['select']();_0x4a11f3[_0xe6ec('0x89')](_0xe6ec('0x8a'))[_0xe6ec('0x8b')](_0xe6ec('0x8c'),'tq')[_0xe6ec('0x8d')](_0xe6ec('0x8e'),'ut',_0xe6ec('0x8f'))[_0xe6ec('0x52')](_0xe6ec('0x90'),_0x2df8a0[_0xe6ec('0x69')]['id']);for(var _0x3d7fcb=0x0;_0x3d7fcb<_0x1dae20['length'];_0x3d7fcb+=0x1){let _0x5585bf=_0x1dae20[_0x3d7fcb];for(var _0x284348=0x0;_0x284348<_0x5585bf[_0xe6ec('0x7d')]['length'];_0x284348+=0x1){let _0x22ca94=_0x5585bf[_0xe6ec('0x7d')][_0x284348];var _0x42ee3c=_0x4a11f3[_0xe6ec('0x91')]();_0x42ee3c['where']('ut.UserId\x20=\x20?',_0x22ca94['id']);_0x4d96fa[_0xe6ec('0x92')](db[_0xe6ec('0x93')]['query'](_0x42ee3c[_0xe6ec('0x94')](),{'type':db['sequelize'][_0xe6ec('0x95')][_0xe6ec('0x96')]})['then'](function(_0x484e6a){if(_0x484e6a[_0xe6ec('0x4e')]===0x1){return _0x22ca94['id'];}else{var _0x4e7390=_[_0xe6ec('0x97')](_[_0xe6ec('0x43')](_0x484e6a,'TeamId'),function(_0x1a515d){return _[_0xe6ec('0x98')](_0xa80b51,_0x1a515d);});if(_0x4e7390){return _0x22ca94['id'];}}}));}}return BPromise['all'](_0x4d96fa)['then'](function(_0x3ea671){_0x25839e=_(_0x25839e)[_0xe6ec('0x99')](_0x3ea671)['compact']()[_0xe6ec('0x9a')]();return db[_0xe6ec('0x44')][_0xe6ec('0x64')]({'where':{'id':_0x2df8a0[_0xe6ec('0x69')]['id']}})[_0xe6ec('0x24')](function(_0x4a2a5e){return db[_0xe6ec('0x93')]['transaction'](function(_0x185ff2){return _0x4a2a5e[_0xe6ec('0x88')](_0x2df8a0['query'][_0xe6ec('0x7c')],{'transaction':_0x185ff2})['then'](function(){if(!_['isEmpty'](_0x25839e)){return _0x4a2a5e['removeAgents'](_0x25839e,{'transaction':_0x185ff2});}})[_0xe6ec('0x24')](function(){_0x25839e[_0xe6ec('0x85')](function(_0x46f513){socket['emit'](_0xe6ec('0x9b'),{'UserId':_0x46f513,'ChatQueueId':_0x4a2a5e['id']});});});});});});})[_0xe6ec('0x24')](respondWithStatusCode(_0xa56f6b,null))['catch'](handleError(_0xa56f6b,null));};exports['addAgents']=function(_0x2a2986,_0x40b135,_0x22452b){return db['ChatQueue'][_0xe6ec('0x64')]({'where':{'id':_0x2a2986[_0xe6ec('0x69')]['id']}})['then'](handleEntityNotFound(_0x40b135,null))[_0xe6ec('0x24')](function(_0x51df8a){if(_0x51df8a){return _0x51df8a[_0xe6ec('0x9c')](_0x2a2986[_0xe6ec('0x68')][_0xe6ec('0x7c')],_[_0xe6ec('0x9d')](_0x2a2986[_0xe6ec('0x68')],[_0xe6ec('0x7c'),'id'])||{})['spread'](function(_0x414845){for(var _0x32e545=0x0;_0x32e545<_0x2a2986[_0xe6ec('0x68')][_0xe6ec('0x7c')][_0xe6ec('0x4e')];_0x32e545+=0x1){socket['emit'](_0xe6ec('0x87'),{'UserId':Number(_0x2a2986[_0xe6ec('0x68')][_0xe6ec('0x7c')][_0x32e545]),'ChatQueueId':Number(_0x2a2986[_0xe6ec('0x69')]['id'])});}return _0x414845;});}})['then'](respondWithResult(_0x40b135,null))['catch'](handleError(_0x40b135,null));};exports[_0xe6ec('0x9e')]=function(_0x44b1ef,_0x3fa6af,_0xa2a06){return db[_0xe6ec('0x44')][_0xe6ec('0x64')]({'where':{'id':_0x44b1ef[_0xe6ec('0x69')]['id']}})[_0xe6ec('0x24')](handleEntityNotFound(_0x3fa6af,null))[_0xe6ec('0x24')](function(_0x443021){if(_0x443021){return _0x443021['removeAgents'](_0x44b1ef['query'][_0xe6ec('0x7c')])[_0xe6ec('0x24')](function(){if(_[_0xe6ec('0x9f')](_0x44b1ef[_0xe6ec('0x47')][_0xe6ec('0x7c')])){for(var _0x47fa4f=0x0;_0x47fa4f<_0x44b1ef['query']['ids'][_0xe6ec('0x4e')];_0x47fa4f+=0x1){socket[_0xe6ec('0x86')](_0xe6ec('0x9b'),{'UserId':Number(_0x44b1ef['query']['ids'][_0x47fa4f]),'ChatQueueId':Number(_0x44b1ef[_0xe6ec('0x69')]['id'])});}}else{socket[_0xe6ec('0x86')](_0xe6ec('0x9b'),{'UserId':Number(_0x44b1ef[_0xe6ec('0x47')][_0xe6ec('0x7c')]),'ChatQueueId':Number(_0x44b1ef[_0xe6ec('0x69')]['id'])});}});}})[_0xe6ec('0x24')](respondWithStatusCode(_0x3fa6af,null))[_0xe6ec('0x2e')](handleError(_0x3fa6af,null));};exports[_0xe6ec('0xa0')]=function(_0x1d1e92,_0x4ea62f,_0x55c157){var _0x51c000={};var _0x20355f={};var _0x2e5009;var _0x3afef4;return db['ChatQueue'][_0xe6ec('0x6c')]({'where':{'id':_0x1d1e92[_0xe6ec('0x69')]['id']}})[_0xe6ec('0x24')](handleEntityNotFound(_0x4ea62f,null))[_0xe6ec('0x24')](function(_0x5bab42){if(_0x5bab42){_0x2e5009=_0x5bab42;_0x20355f[_0xe6ec('0x4b')]=_[_0xe6ec('0x48')](db[_0xe6ec('0x70')][_0xe6ec('0x5e')]);_0x20355f[_0xe6ec('0x47')]=_[_0xe6ec('0x48')](_0x1d1e92[_0xe6ec('0x47')]);_0x20355f[_0xe6ec('0x49')]=_[_0xe6ec('0x4a')](_0x20355f[_0xe6ec('0x4b')],_0x20355f['query']);_0x51c000[_0xe6ec('0x4c')]=_[_0xe6ec('0x4a')](_0x20355f[_0xe6ec('0x4b')],qs[_0xe6ec('0x4d')](_0x1d1e92['query'][_0xe6ec('0x4d')]));_0x51c000[_0xe6ec('0x4c')]=_0x51c000['attributes'][_0xe6ec('0x4e')]?_0x51c000[_0xe6ec('0x4c')]:_0x20355f[_0xe6ec('0x4b')];_0x51c000[_0xe6ec('0x50')]=qs[_0xe6ec('0x51')](_0x1d1e92[_0xe6ec('0x47')][_0xe6ec('0x51')]);_0x51c000[_0xe6ec('0x52')]=qs[_0xe6ec('0x49')](_[_0xe6ec('0x53')](_0x1d1e92['query'],_0x20355f[_0xe6ec('0x49')]));if(_0x1d1e92[_0xe6ec('0x47')][_0xe6ec('0x54')]){_0x51c000['where']=_[_0xe6ec('0x57')](_0x51c000[_0xe6ec('0x52')],{'$or':_['map'](_0x51c000[_0xe6ec('0x4c')],function(_0x5715fb){var _0x24c191={};_0x24c191[_0x5715fb]={'$like':'%'+_0x1d1e92[_0xe6ec('0x47')][_0xe6ec('0x54')]+'%'};return _0x24c191;})});}_0x51c000=_[_0xe6ec('0x57')]({},_0x51c000,_0x1d1e92['options']);return _0x2e5009['getAgents'](_0x51c000);}})[_0xe6ec('0x24')](function(_0x17534b){if(_0x17534b){_0x3afef4=_0x17534b[_0xe6ec('0x4e')];if(!_0x1d1e92[_0xe6ec('0x47')]['hasOwnProperty'](_0xe6ec('0x6e'))){_0x51c000['limit']=qs['limit'](_0x1d1e92['query'][_0xe6ec('0x33')]);_0x51c000[_0xe6ec('0x35')]=qs[_0xe6ec('0x35')](_0x1d1e92[_0xe6ec('0x47')][_0xe6ec('0x35')]);}return _0x2e5009[_0xe6ec('0xa0')](_0x51c000);}})[_0xe6ec('0x24')](function(_0x33b618){if(_0x33b618){return _0x33b618?{'count':_0x3afef4,'rows':_0x33b618}:null;}})['then'](respondWithResult(_0x4ea62f,null))['catch'](handleError(_0x4ea62f,null));};
\ No newline at end of file
index 85e9f4f..b868269 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4016=['ChatQueue','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x4eb6e3,_0x555008){var _0x11bd33=function(_0x572af7){while(--_0x572af7){_0x4eb6e3['push'](_0x4eb6e3['shift']());}};_0x11bd33(++_0x555008);}(_0x4016,0x131));var _0x6401=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4016[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x6401('0x0'))['db'][_0x6401('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6401('0x2')};function emitEvent(_0x4de6b1){return function(_0x4fc38,_0x27c82a,_0x5f37ea){ChatQueueEvents['emit'](_0x4de6b1+':'+_0x4fc38['id'],_0x4fc38);ChatQueueEvents[_0x6401('0x3')](_0x4de6b1,_0x4fc38);_0x5f37ea(null);};}for(var e in events){if(events[_0x6401('0x4')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x6401('0x5')]=ChatQueueEvents;
\ No newline at end of file
+var _0x3b64=['events','../../mysqldb','ChatQueue','setMaxListeners','save','update','emit','hook','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3b64,0x1b0));var _0x43b6=function(_0x15482b,_0x3c38ae){_0x15482b=_0x15482b-0x0;var _0x2f8c47=_0x3b64[_0x15482b];return _0x2f8c47;};'use strict';var EventEmitter=require(_0x43b6('0x0'));var ChatQueue=require(_0x43b6('0x1'))['db'][_0x43b6('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x43b6('0x3')](0x0);var events={'afterCreate':_0x43b6('0x4'),'afterUpdate':_0x43b6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2113b7){return function(_0x1504da,_0x2aa435,_0x537706){ChatQueueEvents[_0x43b6('0x6')](_0x2113b7+':'+_0x1504da['id'],_0x1504da);ChatQueueEvents[_0x43b6('0x6')](_0x2113b7,_0x1504da);_0x537706(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x43b6('0x7')](e,emitEvent(event));}}module[_0x43b6('0x8')]=ChatQueueEvents;
\ No newline at end of file
index f9122cb..0921c07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7da6=['define','ChatQueue','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7da6,0x152));var _0x67da=function(_0xe1441d,_0x36fb8e){_0xe1441d=_0xe1441d-0x0;var _0x2ef242=_0x7da6[_0xe1441d];return _0x2ef242;};'use strict';var _=require(_0x67da('0x0'));var util=require('util');var logger=require(_0x67da('0x1'))(_0x67da('0x2'));var moment=require(_0x67da('0x3'));var BPromise=require('bluebird');var rp=require(_0x67da('0x4'));var fs=require('fs');var path=require(_0x67da('0x5'));var rimraf=require(_0x67da('0x6'));var config=require(_0x67da('0x7'));var attributes=require(_0x67da('0x8'));module[_0x67da('0x9')]=function(_0x308a03,_0x12e954){return _0x308a03[_0x67da('0xa')](_0x67da('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1fb1=['../../config/environment','exports','define','ChatQueue','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x373693,_0x22362f){var _0x261642=function(_0x32ed86){while(--_0x32ed86){_0x373693['push'](_0x373693['shift']());}};_0x261642(++_0x22362f);}(_0x1fb1,0x14e));var _0x11fb=function(_0x21e56e,_0x51ae6d){_0x21e56e=_0x21e56e-0x0;var _0x5b89ef=_0x1fb1[_0x21e56e];return _0x5b89ef;};'use strict';var _=require(_0x11fb('0x0'));var util=require(_0x11fb('0x1'));var logger=require(_0x11fb('0x2'))(_0x11fb('0x3'));var moment=require(_0x11fb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x11fb('0x5'));var rimraf=require(_0x11fb('0x6'));var config=require(_0x11fb('0x7'));var attributes=require('./chatQueue.attributes');module[_0x11fb('0x8')]=function(_0xf34ad,_0x1b649c){return _0xf34ad[_0x11fb('0x9')](_0x11fb('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7587365..1ae6105 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5601=['include','map','model','ShowChatQueue','ChatQueue','find','where','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','findAll','options','attributes'];(function(_0x890db7,_0x4dcf2c){var _0x46412=function(_0x2685df){while(--_0x2685df){_0x890db7['push'](_0x890db7['shift']());}};_0x46412(++_0x4dcf2c);}(_0x5601,0x1cf));var _0x1560=function(_0x2f26b1,_0xdd1828){_0x2f26b1=_0x2f26b1-0x0;var _0x54a7ce=_0x5601[_0x2f26b1];return _0x54a7ce;};'use strict';var _=require(_0x1560('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1560('0x1'));var rs=require(_0x1560('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1560('0x3'))['db'];var utils=require(_0x1560('0x4'));var logger=require('../../config/logger')(_0x1560('0x5'));var config=require(_0x1560('0x6'));var jayson=require(_0x1560('0x7'));var client=jayson[_0x1560('0x8')]['http']({'port':0x232a});config['redis']=_[_0x1560('0x9')](config['redis'],{'host':_0x1560('0xa'),'port':0x18eb});var socket=require(_0x1560('0xb'))(new Redis(config[_0x1560('0xc')]));require(_0x1560('0xd'))['register'](socket);function respondWithRpcPromise(_0xa3fd9b,_0x43d987,_0x5e7026){return new BPromise(function(_0x4f7646,_0x2daf1e){return client[_0x1560('0xe')](_0xa3fd9b,_0x5e7026)[_0x1560('0xf')](function(_0x3b438a){logger[_0x1560('0x10')](_0x1560('0x11'),_0x43d987,_0x1560('0x12'));logger[_0x1560('0x13')](_0x1560('0x14'),_0x43d987,_0x1560('0x12'),JSON[_0x1560('0x15')](_0x3b438a));if(_0x3b438a[_0x1560('0x16')]){if(_0x3b438a[_0x1560('0x16')][_0x1560('0x17')]===0x1f4){logger[_0x1560('0x16')](_0x1560('0x11'),_0x43d987,_0x3b438a['error'][_0x1560('0x18')]);return _0x2daf1e(_0x3b438a['error'][_0x1560('0x18')]);}logger[_0x1560('0x16')](_0x1560('0x11'),_0x43d987,_0x3b438a[_0x1560('0x16')][_0x1560('0x18')]);return _0x4f7646(_0x3b438a[_0x1560('0x16')][_0x1560('0x18')]);}else{logger[_0x1560('0x10')]('ChatQueue,\x20%s,\x20%s',_0x43d987,_0x1560('0x12'));_0x4f7646(_0x3b438a[_0x1560('0x19')][_0x1560('0x18')]);}})[_0x1560('0x1a')](function(_0x2a2d16){logger[_0x1560('0x16')](_0x1560('0x11'),_0x43d987,_0x2a2d16);_0x2daf1e(_0x2a2d16);});});}exports[_0x1560('0x1b')]=function(_0xb36b81){var _0x4c81ca=this;return new Promise(function(_0x5577b9,_0x3c0e38){return db['ChatQueue'][_0x1560('0x1c')]({'raw':_0xb36b81[_0x1560('0x1d')]?_0xb36b81[_0x1560('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0xb36b81[_0x1560('0x1d')]?_0xb36b81['options']['where']||null:null,'attributes':_0xb36b81[_0x1560('0x1d')]?_0xb36b81[_0x1560('0x1d')][_0x1560('0x1e')]||null:null,'limit':_0xb36b81[_0x1560('0x1d')]?_0xb36b81[_0x1560('0x1d')]['limit']||null:null,'include':_0xb36b81[_0x1560('0x1d')]?_0xb36b81['options'][_0x1560('0x1f')]?_[_0x1560('0x20')](_0xb36b81[_0x1560('0x1d')]['include'],function(_0x3f0ad8){return{'model':db[_0x3f0ad8[_0x1560('0x21')]],'as':_0x3f0ad8['as'],'attributes':_0x3f0ad8[_0x1560('0x1e')],'include':_0x3f0ad8[_0x1560('0x1f')]?_[_0x1560('0x20')](_0x3f0ad8['include'],function(_0x51129d){return{'model':db[_0x51129d[_0x1560('0x21')]],'as':_0x51129d['as'],'attributes':_0x51129d['attributes'],'include':_0x51129d[_0x1560('0x1f')]?_['map'](_0x51129d[_0x1560('0x1f')],function(_0x356205){return{'model':db[_0x356205[_0x1560('0x21')]],'as':_0x356205['as'],'attributes':_0x356205[_0x1560('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x277ffe){logger['info'](_0x1560('0x1b'),_0xb36b81);logger['debug'](_0x1560('0x1b'),_0xb36b81,JSON[_0x1560('0x15')](_0x277ffe));_0x5577b9(_0x277ffe);})['catch'](function(_0x2832b8){logger[_0x1560('0x16')](_0x1560('0x1b'),_0x2832b8[_0x1560('0x18')],_0xb36b81);_0x3c0e38(_0x4c81ca[_0x1560('0x16')](0x1f4,_0x2832b8[_0x1560('0x18')]));});});};exports[_0x1560('0x22')]=function(_0x13b60f){var _0x298b4a=this;return new Promise(function(_0x5f187c,_0x226098){return db[_0x1560('0x23')][_0x1560('0x24')]({'raw':_0x13b60f[_0x1560('0x1d')]?_0x13b60f[_0x1560('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x13b60f[_0x1560('0x1d')]?_0x13b60f[_0x1560('0x1d')][_0x1560('0x25')]||null:null,'attributes':_0x13b60f['options']?_0x13b60f[_0x1560('0x1d')][_0x1560('0x1e')]||null:null,'include':_0x13b60f['options']?_0x13b60f[_0x1560('0x1d')][_0x1560('0x1f')]?_[_0x1560('0x20')](_0x13b60f[_0x1560('0x1d')][_0x1560('0x1f')],function(_0x46ced8){return{'model':db[_0x46ced8[_0x1560('0x21')]],'as':_0x46ced8['as'],'attributes':_0x46ced8[_0x1560('0x1e')],'include':_0x46ced8['include']?_[_0x1560('0x20')](_0x46ced8[_0x1560('0x1f')],function(_0x3c6346){return{'model':db[_0x3c6346[_0x1560('0x21')]],'as':_0x3c6346['as'],'attributes':_0x3c6346[_0x1560('0x1e')],'include':_0x3c6346[_0x1560('0x1f')]?_[_0x1560('0x20')](_0x3c6346[_0x1560('0x1f')],function(_0x3bc056){return{'model':db[_0x3bc056['model']],'as':_0x3bc056['as'],'attributes':_0x3bc056[_0x1560('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1560('0xf')](function(_0x4b4c3a){logger[_0x1560('0x10')](_0x1560('0x22'),_0x13b60f);logger['debug']('ShowChatQueue',_0x13b60f,JSON[_0x1560('0x15')](_0x4b4c3a));_0x5f187c(_0x4b4c3a);})[_0x1560('0x1a')](function(_0x23147c){logger[_0x1560('0x16')](_0x1560('0x22'),_0x23147c[_0x1560('0x18')],_0x13b60f);_0x226098(_0x298b4a[_0x1560('0x16')](0x1f4,_0x23147c[_0x1560('0x18')]));});});};
\ No newline at end of file
+var _0x8bec=['client','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','GetChatQueue','raw','options','attributes','limit','include','map','model','then','stringify','ShowChatQueue','ChatQueue','find','where','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5ed9b0,_0x451c84){var _0x2db987=function(_0x445683){while(--_0x445683){_0x5ed9b0['push'](_0x5ed9b0['shift']());}};_0x2db987(++_0x451c84);}(_0x8bec,0x6e));var _0xc8be=function(_0x290054,_0x3ca372){_0x290054=_0x290054-0x0;var _0x1ba3ce=_0x8bec[_0x290054];return _0x1ba3ce;};'use strict';var _=require(_0xc8be('0x0'));var util=require(_0xc8be('0x1'));var moment=require(_0xc8be('0x2'));var BPromise=require(_0xc8be('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8be('0x4'));var db=require(_0xc8be('0x5'))['db'];var utils=require(_0xc8be('0x6'));var logger=require(_0xc8be('0x7'))(_0xc8be('0x8'));var config=require(_0xc8be('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc8be('0xa')]['http']({'port':0x232a});config['redis']=_[_0xc8be('0xb')](config[_0xc8be('0xc')],{'host':_0xc8be('0xd'),'port':0x18eb});var socket=require(_0xc8be('0xe'))(new Redis(config[_0xc8be('0xc')]));require(_0xc8be('0xf'))[_0xc8be('0x10')](socket);function respondWithRpcPromise(_0x586030,_0x34f963,_0x37533e){return new BPromise(function(_0xb2f6b5,_0x4523e6){return client[_0xc8be('0x11')](_0x586030,_0x37533e)['then'](function(_0x181b12){logger['info'](_0xc8be('0x12'),_0x34f963,'request\x20sent');logger[_0xc8be('0x13')](_0xc8be('0x14'),_0x34f963,_0xc8be('0x15'),JSON['stringify'](_0x181b12));if(_0x181b12[_0xc8be('0x16')]){if(_0x181b12[_0xc8be('0x16')]['code']===0x1f4){logger[_0xc8be('0x16')]('ChatQueue,\x20%s,\x20%s',_0x34f963,_0x181b12[_0xc8be('0x16')][_0xc8be('0x17')]);return _0x4523e6(_0x181b12['error']['message']);}logger[_0xc8be('0x16')](_0xc8be('0x12'),_0x34f963,_0x181b12[_0xc8be('0x16')]['message']);return _0xb2f6b5(_0x181b12[_0xc8be('0x16')][_0xc8be('0x17')]);}else{logger[_0xc8be('0x18')](_0xc8be('0x12'),_0x34f963,_0xc8be('0x15'));_0xb2f6b5(_0x181b12['result'][_0xc8be('0x17')]);}})['catch'](function(_0x36486d){logger[_0xc8be('0x16')](_0xc8be('0x12'),_0x34f963,_0x36486d);_0x4523e6(_0x36486d);});});}exports[_0xc8be('0x19')]=function(_0x2243bc){var _0x945497=this;return new Promise(function(_0x2f8888,_0x4e8ffe){return db['ChatQueue']['findAll']({'raw':_0x2243bc['options']?_0x2243bc['options'][_0xc8be('0x1a')]===undefined?!![]:![]:!![],'where':_0x2243bc[_0xc8be('0x1b')]?_0x2243bc[_0xc8be('0x1b')]['where']||null:null,'attributes':_0x2243bc[_0xc8be('0x1b')]?_0x2243bc[_0xc8be('0x1b')][_0xc8be('0x1c')]||null:null,'limit':_0x2243bc['options']?_0x2243bc[_0xc8be('0x1b')][_0xc8be('0x1d')]||null:null,'include':_0x2243bc[_0xc8be('0x1b')]?_0x2243bc[_0xc8be('0x1b')][_0xc8be('0x1e')]?_[_0xc8be('0x1f')](_0x2243bc[_0xc8be('0x1b')][_0xc8be('0x1e')],function(_0x297474){return{'model':db[_0x297474[_0xc8be('0x20')]],'as':_0x297474['as'],'attributes':_0x297474[_0xc8be('0x1c')],'include':_0x297474[_0xc8be('0x1e')]?_[_0xc8be('0x1f')](_0x297474['include'],function(_0x10c45e){return{'model':db[_0x10c45e['model']],'as':_0x10c45e['as'],'attributes':_0x10c45e[_0xc8be('0x1c')],'include':_0x10c45e[_0xc8be('0x1e')]?_['map'](_0x10c45e['include'],function(_0x583c4e){return{'model':db[_0x583c4e[_0xc8be('0x20')]],'as':_0x583c4e['as'],'attributes':_0x583c4e[_0xc8be('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc8be('0x21')](function(_0x32d2f6){logger[_0xc8be('0x18')](_0xc8be('0x19'),_0x2243bc);logger[_0xc8be('0x13')](_0xc8be('0x19'),_0x2243bc,JSON[_0xc8be('0x22')](_0x32d2f6));_0x2f8888(_0x32d2f6);})['catch'](function(_0x4df788){logger['error'](_0xc8be('0x19'),_0x4df788[_0xc8be('0x17')],_0x2243bc);_0x4e8ffe(_0x945497[_0xc8be('0x16')](0x1f4,_0x4df788[_0xc8be('0x17')]));});});};exports[_0xc8be('0x23')]=function(_0x48fb6e){var _0x2ee045=this;return new Promise(function(_0x237dde,_0x839222){return db[_0xc8be('0x24')][_0xc8be('0x25')]({'raw':_0x48fb6e[_0xc8be('0x1b')]?_0x48fb6e['options'][_0xc8be('0x1a')]===undefined?!![]:![]:!![],'where':_0x48fb6e['options']?_0x48fb6e[_0xc8be('0x1b')][_0xc8be('0x26')]||null:null,'attributes':_0x48fb6e[_0xc8be('0x1b')]?_0x48fb6e['options'][_0xc8be('0x1c')]||null:null,'include':_0x48fb6e[_0xc8be('0x1b')]?_0x48fb6e[_0xc8be('0x1b')]['include']?_[_0xc8be('0x1f')](_0x48fb6e[_0xc8be('0x1b')][_0xc8be('0x1e')],function(_0x18c6f3){return{'model':db[_0x18c6f3['model']],'as':_0x18c6f3['as'],'attributes':_0x18c6f3['attributes'],'include':_0x18c6f3[_0xc8be('0x1e')]?_[_0xc8be('0x1f')](_0x18c6f3['include'],function(_0x109bfc){return{'model':db[_0x109bfc[_0xc8be('0x20')]],'as':_0x109bfc['as'],'attributes':_0x109bfc[_0xc8be('0x1c')],'include':_0x109bfc['include']?_['map'](_0x109bfc[_0xc8be('0x1e')],function(_0x2af27f){return{'model':db[_0x2af27f[_0xc8be('0x20')]],'as':_0x2af27f['as'],'attributes':_0x2af27f[_0xc8be('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc8be('0x21')](function(_0x3d1a8b){logger[_0xc8be('0x18')](_0xc8be('0x23'),_0x48fb6e);logger[_0xc8be('0x13')]('ShowChatQueue',_0x48fb6e,JSON[_0xc8be('0x22')](_0x3d1a8b));_0x237dde(_0x3d1a8b);})[_0xc8be('0x27')](function(_0x8eda79){logger[_0xc8be('0x16')](_0xc8be('0x23'),_0x8eda79['message'],_0x48fb6e);_0x839222(_0x2ee045[_0xc8be('0x16')](0x1f4,_0x8eda79[_0xc8be('0x17')]));});});};
\ No newline at end of file
index ac58bdc..a5ba9ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['remove','emit','removeListener','length','./chatQueue.events','save'];(function(_0x48704e,_0x38e049){var _0x32619f=function(_0x296796){while(--_0x296796){_0x48704e['push'](_0x48704e['shift']());}};_0x32619f(++_0x38e049);}(_0x54ef,0x112));var _0xf54e=function(_0x2f7ba3,_0x282bd3){_0x2f7ba3=_0x2f7ba3-0x0;var _0xb162e6=_0x54ef[_0x2f7ba3];return _0xb162e6;};'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 _0x425d=['./chatQueue.events','remove','update','emit','removeListener','register','length','chatQueue:'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x425d,0x1e0));var _0xd425=function(_0x557b0e,_0x4cb914){_0x557b0e=_0x557b0e-0x0;var _0x437a9f=_0x425d[_0x557b0e];return _0x437a9f;};'use strict';var ChatQueueEvents=require(_0xd425('0x0'));var events=['save',_0xd425('0x1'),_0xd425('0x2')];function createListener(_0x314a2b,_0x97e370){return function(_0x183caa){_0x97e370[_0xd425('0x3')](_0x314a2b,_0x183caa);};}function removeListener(_0x47043f,_0x596be7){return function(){ChatQueueEvents[_0xd425('0x4')](_0x47043f,_0x596be7);};}exports[_0xd425('0x5')]=function(_0xc4e080){for(var _0x36866e=0x0,_0x1d97d9=events[_0xd425('0x6')];_0x36866e<_0x1d97d9;_0x36866e++){var _0x50b061=events[_0x36866e];var _0xb6ba8e=createListener(_0xd425('0x7')+_0x50b061,_0xc4e080);ChatQueueEvents['on'](_0x50b061,_0xb6ba8e);}};
\ No newline at end of file
index 6f7c1fa..e536e2e 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(_0x2ab22c,_0x59ff3e){var _0x24fba8=function(_0x27d216){while(--_0x27d216){_0x2ab22c['push'](_0x2ab22c['shift']());}};_0x24fba8(++_0x59ff3e);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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(_0x4fcaae,_0x18a1bf){var _0x594332=function(_0x3dfc64){while(--_0x3dfc64){_0x4fcaae['push'](_0x4fcaae['shift']());}};_0x594332(++_0x18a1bf);}(_0x7217,0x19e));var _0x7721=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x7217[_0x92c450];return _0x2a9599;};'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 74d036f..3ab651e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a93=['moment','sequelize','exports','STRING','DATE'];(function(_0x50a8e3,_0x5f5c4b){var _0xe2f3a3=function(_0xb75ad0){while(--_0xb75ad0){_0x50a8e3['push'](_0x50a8e3['shift']());}};_0xe2f3a3(++_0x5f5c4b);}(_0x1a93,0xa0));var _0x31a9=function(_0x44fbea,_0x19cd7a){_0x44fbea=_0x44fbea-0x0;var _0x425e27=_0x1a93[_0x44fbea];return _0x425e27;};'use strict';var moment=require(_0x31a9('0x0'));var Sequelize=require(_0x31a9('0x1'));module[_0x31a9('0x2')]={'uniqueid':{'type':Sequelize[_0x31a9('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x31a9('0x3')]},'joinAt':{'type':Sequelize[_0x31a9('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x31a9('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x31a9('0x3')]}};
\ No newline at end of file
+var _0x15c4=['DATE','moment','sequelize','exports'];(function(_0xf3c557,_0x434d9b){var _0x42852c=function(_0x2f2464){while(--_0x2f2464){_0xf3c557['push'](_0xf3c557['shift']());}};_0x42852c(++_0x434d9b);}(_0x15c4,0x10d));var _0x415c=function(_0x5c1149,_0x4f50a2){_0x5c1149=_0x5c1149-0x0;var _0xc69f36=_0x15c4[_0x5c1149];return _0xc69f36;};'use strict';var moment=require(_0x415c('0x0'));var Sequelize=require(_0x415c('0x1'));module[_0x415c('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x415c('0x3')]},'leaveAt':{'type':Sequelize[_0x415c('0x3')]},'acceptAt':{'type':Sequelize[_0x415c('0x3')]},'exitAt':{'type':Sequelize[_0x415c('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index e69ef0c..32f5143 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a58=['mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','end','error','stack','name','index','ChatQueueReport','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','update','destroy','describe','eml-format','rimraf','fast-json-patch','moment'];(function(_0x552799,_0x4927d6){var _0x4f46e2=function(_0xa29cb2){while(--_0xa29cb2){_0x552799['push'](_0x552799['shift']());}};_0x4f46e2(++_0x4927d6);}(_0x6a58,0x120));var _0x86a5=function(_0x3f88bc,_0xe38cf5){_0x3f88bc=_0x3f88bc-0x0;var _0x4df1c4=_0x6a58[_0x3f88bc];return _0x4df1c4;};'use strict';var emlformat=require(_0x86a5('0x0'));var rimraf=require(_0x86a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x86a5('0x2'));var rp=require('request-promise');var moment=require(_0x86a5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x86a5('0x4'));var util=require(_0x86a5('0x5'));var path=require(_0x86a5('0x6'));var sox=require(_0x86a5('0x7'));var csv=require(_0x86a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x86a5('0x9'));var _=require(_0x86a5('0xa'));var squel=require('squel');var crypto=require(_0x86a5('0xb'));var jsforce=require(_0x86a5('0xc'));var deskjs=require(_0x86a5('0xd'));var toCsv=require(_0x86a5('0x8'));var querystring=require(_0x86a5('0xe'));var Papa=require(_0x86a5('0xf'));var Redis=require(_0x86a5('0x10'));var authService=require(_0x86a5('0x11'));var qs=require(_0x86a5('0x12'));var as=require(_0x86a5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x86a5('0x14'));var utils=require('../../config/utils');var config=require(_0x86a5('0x15'));var licenseUtil=require(_0x86a5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2df079,_0x320af5){_0x320af5=_0x320af5||0xcc;return function(_0x4b4655){if(_0x4b4655){return _0x2df079[_0x86a5('0x17')](_0x320af5);}return _0x2df079[_0x86a5('0x18')](_0x320af5)['end']();};}function respondWithResult(_0x40dcf6,_0x156a2b){_0x156a2b=_0x156a2b||0xc8;return function(_0xc8ccdb){if(_0xc8ccdb){return _0x40dcf6[_0x86a5('0x18')](_0x156a2b)[_0x86a5('0x19')](_0xc8ccdb);}};}function respondWithFilteredResult(_0x5bbdbe,_0x485829){return function(_0x12999d){if(_0x12999d){var _0x5c3c99=typeof _0x485829[_0x86a5('0x1a')]===_0x86a5('0x1b')&&typeof _0x485829[_0x86a5('0x1c')]==='undefined';var _0x497fce=_0x12999d[_0x86a5('0x1d')];var _0x173005=_0x5c3c99?0x0:_0x485829[_0x86a5('0x1a')];var _0x130048=_0x5c3c99?_0x12999d[_0x86a5('0x1d')]:_0x485829['offset']+_0x485829[_0x86a5('0x1c')];var _0x5480b1;if(_0x130048>=_0x497fce){_0x130048=_0x497fce;_0x5480b1=0xc8;}else{_0x5480b1=0xce;}_0x5bbdbe[_0x86a5('0x18')](_0x5480b1);return _0x5bbdbe[_0x86a5('0x1e')](_0x86a5('0x1f'),_0x173005+'-'+_0x130048+'/'+_0x497fce)[_0x86a5('0x19')](_0x12999d);}return null;};}function patchUpdates(_0x1f79b1){return function(_0x390feb){try{jsonpatch[_0x86a5('0x20')](_0x390feb,_0x1f79b1,!![]);}catch(_0x1b56c8){return BPromise['reject'](_0x1b56c8);}return _0x390feb['save']();};}function saveUpdates(_0x1f0af0,_0x39dcde){return function(_0x54ffc0){if(_0x54ffc0){return _0x54ffc0['update'](_0x1f0af0)['then'](function(_0x278715){return _0x278715;});}return null;};}function removeEntity(_0x2960f7,_0x2ef076){return function(_0x512df9){if(_0x512df9){return _0x512df9['destroy']()[_0x86a5('0x21')](function(){_0x2960f7[_0x86a5('0x18')](0xcc)[_0x86a5('0x22')]();});}};}function handleEntityNotFound(_0x56fd69,_0x38d7c4){return function(_0x566396){if(!_0x566396){_0x56fd69[_0x86a5('0x17')](0x194);}return _0x566396;};}function handleError(_0x573f65,_0x3d36a6){_0x3d36a6=_0x3d36a6||0x1f4;return function(_0x9ede82){logger[_0x86a5('0x23')](_0x9ede82[_0x86a5('0x24')]);if(_0x9ede82[_0x86a5('0x25')]){delete _0x9ede82[_0x86a5('0x25')];}_0x573f65['status'](_0x3d36a6)['send'](_0x9ede82);};}exports[_0x86a5('0x26')]=function(_0x9589d3,_0x1568b7){var _0xcbf54e={},_0x14a4d2={},_0xd3aee9={'count':0x0,'rows':[]};var _0x2b089a=_['map'](db[_0x86a5('0x27')]['rawAttributes'],function(_0x50420d){return{'name':_0x50420d[_0x86a5('0x28')],'type':_0x50420d['type'][_0x86a5('0x29')]};});_0x14a4d2[_0x86a5('0x2a')]=_[_0x86a5('0x2b')](_0x2b089a,_0x86a5('0x25'));_0x14a4d2[_0x86a5('0x2c')]=_[_0x86a5('0x2d')](_0x9589d3[_0x86a5('0x2c')]);_0x14a4d2[_0x86a5('0x2e')]=_[_0x86a5('0x2f')](_0x14a4d2[_0x86a5('0x2a')],_0x14a4d2[_0x86a5('0x2c')]);_0xcbf54e[_0x86a5('0x30')]=_[_0x86a5('0x2f')](_0x14a4d2[_0x86a5('0x2a')],qs['fields'](_0x9589d3[_0x86a5('0x2c')][_0x86a5('0x31')]));_0xcbf54e[_0x86a5('0x30')]=_0xcbf54e[_0x86a5('0x30')][_0x86a5('0x32')]?_0xcbf54e[_0x86a5('0x30')]:_0x14a4d2[_0x86a5('0x2a')];if(!_0x9589d3['query']['hasOwnProperty'](_0x86a5('0x33'))){_0xcbf54e[_0x86a5('0x1c')]=qs[_0x86a5('0x1c')](_0x9589d3[_0x86a5('0x2c')][_0x86a5('0x1c')]);_0xcbf54e[_0x86a5('0x1a')]=qs['offset'](_0x9589d3[_0x86a5('0x2c')][_0x86a5('0x1a')]);}_0xcbf54e['order']=qs[_0x86a5('0x34')](_0x9589d3[_0x86a5('0x2c')]['sort']);_0xcbf54e['where']=qs[_0x86a5('0x2e')](_[_0x86a5('0x35')](_0x9589d3[_0x86a5('0x2c')],_0x14a4d2[_0x86a5('0x2e')]),_0x2b089a);if(_0x9589d3['query'][_0x86a5('0x36')]){_0xcbf54e[_0x86a5('0x37')]=_[_0x86a5('0x38')](_0xcbf54e[_0x86a5('0x37')],{'$or':_[_0x86a5('0x2b')](_0x2b089a,function(_0x504045){if(_0x504045[_0x86a5('0x39')]!==_0x86a5('0x3a')){var _0x46fb24={};_0x46fb24[_0x504045['name']]={'$like':'%'+_0x9589d3[_0x86a5('0x2c')]['filter']+'%'};return _0x46fb24;}})});}_0xcbf54e=_['merge']({},_0xcbf54e,_0x9589d3['options']);var _0x2d7d5b={'where':_0xcbf54e[_0x86a5('0x37')]};return db['ChatQueueReport'][_0x86a5('0x1d')](_0x2d7d5b)[_0x86a5('0x21')](function(_0x57f609){_0xd3aee9[_0x86a5('0x1d')]=_0x57f609;if(_0x9589d3[_0x86a5('0x2c')][_0x86a5('0x3b')]){_0xcbf54e[_0x86a5('0x3c')]=[{'all':!![]}];}return db[_0x86a5('0x27')][_0x86a5('0x3d')](_0xcbf54e);})[_0x86a5('0x21')](function(_0x4d4cb3){_0xd3aee9[_0x86a5('0x3e')]=_0x4d4cb3;return _0xd3aee9;})[_0x86a5('0x21')](respondWithFilteredResult(_0x1568b7,_0xcbf54e))[_0x86a5('0x3f')](handleError(_0x1568b7,null));};exports[_0x86a5('0x40')]=function(_0x3f47ea,_0x59b9dd){var _0x27eb73={'raw':!![],'where':{'id':_0x3f47ea[_0x86a5('0x41')]['id']}},_0x48bba1={};_0x48bba1[_0x86a5('0x2a')]=_[_0x86a5('0x2d')](db[_0x86a5('0x27')][_0x86a5('0x42')]);_0x48bba1['query']=_[_0x86a5('0x2d')](_0x3f47ea[_0x86a5('0x2c')]);_0x48bba1['filters']=_[_0x86a5('0x2f')](_0x48bba1[_0x86a5('0x2a')],_0x48bba1[_0x86a5('0x2c')]);_0x27eb73[_0x86a5('0x30')]=_[_0x86a5('0x2f')](_0x48bba1[_0x86a5('0x2a')],qs[_0x86a5('0x31')](_0x3f47ea[_0x86a5('0x2c')][_0x86a5('0x31')]));_0x27eb73[_0x86a5('0x30')]=_0x27eb73[_0x86a5('0x30')]['length']?_0x27eb73['attributes']:_0x48bba1['model'];if(_0x3f47ea[_0x86a5('0x2c')][_0x86a5('0x3b')]){_0x27eb73[_0x86a5('0x3c')]=[{'all':!![]}];}_0x27eb73=_[_0x86a5('0x38')]({},_0x27eb73,_0x3f47ea[_0x86a5('0x43')]);return db[_0x86a5('0x27')]['find'](_0x27eb73)[_0x86a5('0x21')](handleEntityNotFound(_0x59b9dd,null))[_0x86a5('0x21')](respondWithResult(_0x59b9dd,null))['catch'](handleError(_0x59b9dd,null));};exports[_0x86a5('0x44')]=function(_0x3e1e16,_0x18aeab){return db[_0x86a5('0x27')][_0x86a5('0x44')](_0x3e1e16[_0x86a5('0x45')],{})['then'](respondWithResult(_0x18aeab,0xc9))[_0x86a5('0x3f')](handleError(_0x18aeab,null));};exports[_0x86a5('0x46')]=function(_0x1ed787,_0x11cef4){if(_0x1ed787[_0x86a5('0x45')]['id']){delete _0x1ed787[_0x86a5('0x45')]['id'];}return db[_0x86a5('0x27')]['find']({'where':{'id':_0x1ed787['params']['id']}})[_0x86a5('0x21')](handleEntityNotFound(_0x11cef4,null))['then'](saveUpdates(_0x1ed787['body'],null))[_0x86a5('0x21')](respondWithResult(_0x11cef4,null))[_0x86a5('0x3f')](handleError(_0x11cef4,null));};exports[_0x86a5('0x47')]=function(_0x11390a,_0x40df9c){return db['ChatQueueReport']['find']({'where':{'id':_0x11390a[_0x86a5('0x41')]['id']}})[_0x86a5('0x21')](handleEntityNotFound(_0x40df9c,null))[_0x86a5('0x21')](removeEntity(_0x40df9c,null))[_0x86a5('0x3f')](handleError(_0x40df9c,null));};exports['describe']=function(_0x2be006,_0xd526dd){return db[_0x86a5('0x27')][_0x86a5('0x48')]()[_0x86a5('0x21')](respondWithResult(_0xd526dd,null))[_0x86a5('0x3f')](handleError(_0xd526dd,null));};
\ No newline at end of file
+var _0x7a3e=['path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','length','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','util'];(function(_0x300e03,_0x35bf0a){var _0xf4711b=function(_0x5ee9ef){while(--_0x5ee9ef){_0x300e03['push'](_0x300e03['shift']());}};_0xf4711b(++_0x35bf0a);}(_0x7a3e,0x18a));var _0xe7a3=function(_0x5c3862,_0x3dd5d1){_0x5c3862=_0x5c3862-0x0;var _0x832a78=_0x7a3e[_0x5c3862];return _0x832a78;};'use strict';var emlformat=require(_0xe7a3('0x0'));var rimraf=require(_0xe7a3('0x1'));var zipdir=require(_0xe7a3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7a3('0x3'));var moment=require(_0xe7a3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe7a3('0x5'));var path=require(_0xe7a3('0x6'));var sox=require(_0xe7a3('0x7'));var csv=require('to-csv');var ejs=require(_0xe7a3('0x8'));var fs=require('fs');var fs_extra=require(_0xe7a3('0x9'));var _=require(_0xe7a3('0xa'));var squel=require(_0xe7a3('0xb'));var crypto=require(_0xe7a3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe7a3('0xd'));var toCsv=require(_0xe7a3('0xe'));var querystring=require(_0xe7a3('0xf'));var Papa=require(_0xe7a3('0x10'));var Redis=require('ioredis');var authService=require(_0xe7a3('0x11'));var qs=require(_0xe7a3('0x12'));var as=require(_0xe7a3('0x13'));var hardwareService=require(_0xe7a3('0x14'));var logger=require(_0xe7a3('0x15'))(_0xe7a3('0x16'));var utils=require(_0xe7a3('0x17'));var config=require(_0xe7a3('0x18'));var licenseUtil=require(_0xe7a3('0x19'));var db=require(_0xe7a3('0x1a'))['db'];function respondWithStatusCode(_0x355a0e,_0x35ec39){_0x35ec39=_0x35ec39||0xcc;return function(_0x584dbe){if(_0x584dbe){return _0x355a0e[_0xe7a3('0x1b')](_0x35ec39);}return _0x355a0e[_0xe7a3('0x1c')](_0x35ec39)[_0xe7a3('0x1d')]();};}function respondWithResult(_0x12798a,_0x4fb862){_0x4fb862=_0x4fb862||0xc8;return function(_0x4a37da){if(_0x4a37da){return _0x12798a[_0xe7a3('0x1c')](_0x4fb862)[_0xe7a3('0x1e')](_0x4a37da);}};}function respondWithFilteredResult(_0x3b7ac6,_0x194c34){return function(_0xb53629){if(_0xb53629){var _0x2c8d77=typeof _0x194c34[_0xe7a3('0x1f')]===_0xe7a3('0x20')&&typeof _0x194c34[_0xe7a3('0x21')]===_0xe7a3('0x20');var _0x57060a=_0xb53629[_0xe7a3('0x22')];var _0x55b6e2=_0x2c8d77?0x0:_0x194c34['offset'];var _0xd74816=_0x2c8d77?_0xb53629['count']:_0x194c34[_0xe7a3('0x1f')]+_0x194c34[_0xe7a3('0x21')];var _0x486b53;if(_0xd74816>=_0x57060a){_0xd74816=_0x57060a;_0x486b53=0xc8;}else{_0x486b53=0xce;}_0x3b7ac6[_0xe7a3('0x1c')](_0x486b53);return _0x3b7ac6[_0xe7a3('0x23')](_0xe7a3('0x24'),_0x55b6e2+'-'+_0xd74816+'/'+_0x57060a)['json'](_0xb53629);}return null;};}function patchUpdates(_0x2db060){return function(_0xc4fe15){try{jsonpatch[_0xe7a3('0x25')](_0xc4fe15,_0x2db060,!![]);}catch(_0x47a934){return BPromise[_0xe7a3('0x26')](_0x47a934);}return _0xc4fe15['save']();};}function saveUpdates(_0x1ca41b,_0x440852){return function(_0x64a86b){if(_0x64a86b){return _0x64a86b[_0xe7a3('0x27')](_0x1ca41b)[_0xe7a3('0x28')](function(_0x3917a1){return _0x3917a1;});}return null;};}function removeEntity(_0x222179,_0x3b0b69){return function(_0x585af8){if(_0x585af8){return _0x585af8[_0xe7a3('0x29')]()[_0xe7a3('0x28')](function(){_0x222179[_0xe7a3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1afeaf,_0x2d7cd2){return function(_0x4535ed){if(!_0x4535ed){_0x1afeaf[_0xe7a3('0x1b')](0x194);}return _0x4535ed;};}function handleError(_0x31e27c,_0x58e43b){_0x58e43b=_0x58e43b||0x1f4;return function(_0x27a96e){logger[_0xe7a3('0x2a')](_0x27a96e['stack']);if(_0x27a96e[_0xe7a3('0x2b')]){delete _0x27a96e['name'];}_0x31e27c[_0xe7a3('0x1c')](_0x58e43b)[_0xe7a3('0x2c')](_0x27a96e);};}exports[_0xe7a3('0x2d')]=function(_0xf952e5,_0x54cfbc){var _0x385b38={},_0x36fa2e={},_0x1456ee={'count':0x0,'rows':[]};var _0x3a4253=_[_0xe7a3('0x2e')](db[_0xe7a3('0x2f')][_0xe7a3('0x30')],function(_0x231f5e){return{'name':_0x231f5e[_0xe7a3('0x31')],'type':_0x231f5e[_0xe7a3('0x32')][_0xe7a3('0x33')]};});_0x36fa2e[_0xe7a3('0x34')]=_['map'](_0x3a4253,_0xe7a3('0x2b'));_0x36fa2e[_0xe7a3('0x35')]=_['keys'](_0xf952e5[_0xe7a3('0x35')]);_0x36fa2e['filters']=_['intersection'](_0x36fa2e['model'],_0x36fa2e[_0xe7a3('0x35')]);_0x385b38[_0xe7a3('0x36')]=_[_0xe7a3('0x37')](_0x36fa2e[_0xe7a3('0x34')],qs['fields'](_0xf952e5[_0xe7a3('0x35')][_0xe7a3('0x38')]));_0x385b38[_0xe7a3('0x36')]=_0x385b38[_0xe7a3('0x36')]['length']?_0x385b38[_0xe7a3('0x36')]:_0x36fa2e[_0xe7a3('0x34')];if(!_0xf952e5[_0xe7a3('0x35')][_0xe7a3('0x39')]('nolimit')){_0x385b38[_0xe7a3('0x21')]=qs[_0xe7a3('0x21')](_0xf952e5['query'][_0xe7a3('0x21')]);_0x385b38[_0xe7a3('0x1f')]=qs[_0xe7a3('0x1f')](_0xf952e5[_0xe7a3('0x35')][_0xe7a3('0x1f')]);}_0x385b38[_0xe7a3('0x3a')]=qs[_0xe7a3('0x3b')](_0xf952e5[_0xe7a3('0x35')][_0xe7a3('0x3b')]);_0x385b38['where']=qs[_0xe7a3('0x3c')](_[_0xe7a3('0x3d')](_0xf952e5[_0xe7a3('0x35')],_0x36fa2e[_0xe7a3('0x3c')]),_0x3a4253);if(_0xf952e5['query'][_0xe7a3('0x3e')]){_0x385b38[_0xe7a3('0x3f')]=_[_0xe7a3('0x40')](_0x385b38['where'],{'$or':_['map'](_0x3a4253,function(_0x46d294){if(_0x46d294[_0xe7a3('0x32')]!==_0xe7a3('0x41')){var _0x136696={};_0x136696[_0x46d294[_0xe7a3('0x2b')]]={'$like':'%'+_0xf952e5[_0xe7a3('0x35')][_0xe7a3('0x3e')]+'%'};return _0x136696;}})});}_0x385b38=_[_0xe7a3('0x40')]({},_0x385b38,_0xf952e5[_0xe7a3('0x42')]);var _0x483b59={'where':_0x385b38[_0xe7a3('0x3f')]};return db[_0xe7a3('0x2f')]['count'](_0x483b59)[_0xe7a3('0x28')](function(_0x1c6bd9){_0x1456ee[_0xe7a3('0x22')]=_0x1c6bd9;if(_0xf952e5[_0xe7a3('0x35')]['includeAll']){_0x385b38[_0xe7a3('0x43')]=[{'all':!![]}];}return db[_0xe7a3('0x2f')][_0xe7a3('0x44')](_0x385b38);})[_0xe7a3('0x28')](function(_0x3d7bca){_0x1456ee[_0xe7a3('0x45')]=_0x3d7bca;return _0x1456ee;})[_0xe7a3('0x28')](respondWithFilteredResult(_0x54cfbc,_0x385b38))['catch'](handleError(_0x54cfbc,null));};exports[_0xe7a3('0x46')]=function(_0x5cb68e,_0x3583ea){var _0x3a92d5={'raw':!![],'where':{'id':_0x5cb68e[_0xe7a3('0x47')]['id']}},_0x14b5cd={};_0x14b5cd[_0xe7a3('0x34')]=_[_0xe7a3('0x48')](db['ChatQueueReport'][_0xe7a3('0x30')]);_0x14b5cd['query']=_[_0xe7a3('0x48')](_0x5cb68e[_0xe7a3('0x35')]);_0x14b5cd[_0xe7a3('0x3c')]=_['intersection'](_0x14b5cd[_0xe7a3('0x34')],_0x14b5cd['query']);_0x3a92d5['attributes']=_['intersection'](_0x14b5cd[_0xe7a3('0x34')],qs[_0xe7a3('0x38')](_0x5cb68e[_0xe7a3('0x35')][_0xe7a3('0x38')]));_0x3a92d5[_0xe7a3('0x36')]=_0x3a92d5[_0xe7a3('0x36')][_0xe7a3('0x49')]?_0x3a92d5[_0xe7a3('0x36')]:_0x14b5cd['model'];if(_0x5cb68e[_0xe7a3('0x35')][_0xe7a3('0x4a')]){_0x3a92d5[_0xe7a3('0x43')]=[{'all':!![]}];}_0x3a92d5=_['merge']({},_0x3a92d5,_0x5cb68e[_0xe7a3('0x42')]);return db[_0xe7a3('0x2f')][_0xe7a3('0x4b')](_0x3a92d5)[_0xe7a3('0x28')](handleEntityNotFound(_0x3583ea,null))[_0xe7a3('0x28')](respondWithResult(_0x3583ea,null))[_0xe7a3('0x4c')](handleError(_0x3583ea,null));};exports[_0xe7a3('0x4d')]=function(_0x59c941,_0x561f5b){return db[_0xe7a3('0x2f')][_0xe7a3('0x4d')](_0x59c941[_0xe7a3('0x4e')],{})['then'](respondWithResult(_0x561f5b,0xc9))[_0xe7a3('0x4c')](handleError(_0x561f5b,null));};exports['update']=function(_0x1bcd17,_0x36223e){if(_0x1bcd17[_0xe7a3('0x4e')]['id']){delete _0x1bcd17['body']['id'];}return db[_0xe7a3('0x2f')][_0xe7a3('0x4b')]({'where':{'id':_0x1bcd17[_0xe7a3('0x47')]['id']}})[_0xe7a3('0x28')](handleEntityNotFound(_0x36223e,null))['then'](saveUpdates(_0x1bcd17[_0xe7a3('0x4e')],null))[_0xe7a3('0x28')](respondWithResult(_0x36223e,null))[_0xe7a3('0x4c')](handleError(_0x36223e,null));};exports[_0xe7a3('0x29')]=function(_0x32ad31,_0x503c24){return db[_0xe7a3('0x2f')][_0xe7a3('0x4b')]({'where':{'id':_0x32ad31[_0xe7a3('0x47')]['id']}})[_0xe7a3('0x28')](handleEntityNotFound(_0x503c24,null))[_0xe7a3('0x28')](removeEntity(_0x503c24,null))[_0xe7a3('0x4c')](handleError(_0x503c24,null));};exports[_0xe7a3('0x4f')]=function(_0x5357a9,_0x1fcd78){return db[_0xe7a3('0x2f')]['describe']()[_0xe7a3('0x28')](respondWithResult(_0x1fcd78,null))['catch'](handleError(_0x1fcd78,null));};
\ No newline at end of file
index 0aff2ba..a78df51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0xdcda3,_0x4252fb){var _0x2bec82=function(_0x589fe2){while(--_0x589fe2){_0xdcda3['push'](_0xdcda3['shift']());}};_0x2bec82(++_0x4252fb);}(_0xb10b,0x12a));var _0xbb10=function(_0x324189,_0x202ac1){_0x324189=_0x324189-0x0;var _0x495eee=_0xb10b[_0x324189];return _0x495eee;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x5de237,_0x2058e8){var _0x3b3d4d=function(_0x3debe1){while(--_0x3debe1){_0x5de237['push'](_0x5de237['shift']());}};_0x3b3d4d(++_0x2058e8);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a0ae2,_0x4930df){_0x4a0ae2=_0x4a0ae2-0x0;var _0x3986a6=_0xb10b[_0x4a0ae2];return _0x3986a6;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 986a762..390f359 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbba8=['update','where','attributes','limit','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','catch','UpdateChatQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbba8,0x197));var _0x8bba=function(_0x5979f1,_0x4c5c6d){_0x5979f1=_0x5979f1-0x0;var _0x47d73c=_0xbba8[_0x5979f1];return _0x47d73c;};'use strict';var _=require('lodash');var util=require(_0x8bba('0x0'));var moment=require(_0x8bba('0x1'));var BPromise=require('bluebird');var rs=require(_0x8bba('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8bba('0x3'));var logger=require(_0x8bba('0x4'))('rpc');var config=require(_0x8bba('0x5'));var jayson=require(_0x8bba('0x6'));var client=jayson['client'][_0x8bba('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43f4bb,_0x241841,_0x287cb4){return new BPromise(function(_0x37d116,_0x32cf23){return client[_0x8bba('0x8')](_0x43f4bb,_0x287cb4)[_0x8bba('0x9')](function(_0x1f70f1){logger['info'](_0x8bba('0xa'),_0x241841,_0x8bba('0xb'));logger[_0x8bba('0xc')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x241841,'request\x20sent',JSON['stringify'](_0x1f70f1));if(_0x1f70f1[_0x8bba('0xd')]){if(_0x1f70f1[_0x8bba('0xd')][_0x8bba('0xe')]===0x1f4){logger[_0x8bba('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x241841,_0x1f70f1[_0x8bba('0xd')]['message']);return _0x32cf23(_0x1f70f1[_0x8bba('0xd')][_0x8bba('0xf')]);}logger[_0x8bba('0xd')](_0x8bba('0xa'),_0x241841,_0x1f70f1[_0x8bba('0xd')]['message']);return _0x37d116(_0x1f70f1[_0x8bba('0xd')]['message']);}else{logger[_0x8bba('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x241841,_0x8bba('0xb'));_0x37d116(_0x1f70f1[_0x8bba('0x11')][_0x8bba('0xf')]);}})['catch'](function(_0x20515a){logger['error'](_0x8bba('0xa'),_0x241841,_0x20515a);_0x32cf23(_0x20515a);});});}exports[_0x8bba('0x12')]=function(_0x2e1180){var _0x2863af=this;return new Promise(function(_0x464cb6,_0x411864){return db[_0x8bba('0x13')][_0x8bba('0x14')](_0x2e1180[_0x8bba('0x15')],{'raw':_0x2e1180[_0x8bba('0x16')]?_0x2e1180['options'][_0x8bba('0x17')]===undefined?!![]:![]:!![]})[_0x8bba('0x9')](function(_0x26779d){logger[_0x8bba('0x10')]('CreateChatQueueReport',_0x2e1180);logger[_0x8bba('0xc')](_0x8bba('0x12'),_0x2e1180,JSON[_0x8bba('0x18')](_0x26779d));_0x464cb6(_0x26779d);})[_0x8bba('0x19')](function(_0x5328d3){logger[_0x8bba('0xd')]('CreateChatQueueReport',_0x5328d3[_0x8bba('0xf')],_0x2e1180);_0x411864(_0x2863af['error'](0x1f4,_0x5328d3['message']));});});};exports[_0x8bba('0x1a')]=function(_0x1ec8c0){var _0x179282=this;return new Promise(function(_0x37f7a5,_0x51cfc5){return db[_0x8bba('0x13')][_0x8bba('0x1b')](_0x1ec8c0['body'],{'raw':_0x1ec8c0['options']?_0x1ec8c0['options'][_0x8bba('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ec8c0[_0x8bba('0x16')]?_0x1ec8c0[_0x8bba('0x16')][_0x8bba('0x1c')]||null:null,'attributes':_0x1ec8c0['options']?_0x1ec8c0[_0x8bba('0x16')][_0x8bba('0x1d')]||null:null,'limit':_0x1ec8c0['options']?_0x1ec8c0[_0x8bba('0x16')][_0x8bba('0x1e')]||null:null})[_0x8bba('0x9')](function(_0x297a1a){logger[_0x8bba('0x10')](_0x8bba('0x1a'),_0x1ec8c0);logger[_0x8bba('0xc')](_0x8bba('0x1a'),_0x1ec8c0,JSON['stringify'](_0x297a1a));_0x37f7a5(_0x297a1a);})[_0x8bba('0x19')](function(_0x55b6f6){logger[_0x8bba('0xd')]('UpdateChatQueueReport',_0x55b6f6[_0x8bba('0xf')],_0x1ec8c0);_0x51cfc5(_0x179282[_0x8bba('0xd')](0x1f4,_0x55b6f6[_0x8bba('0xf')]));});});};
\ No newline at end of file
+var _0xcf01=['create','body','options','then','debug','UpdateChatQueueReport','raw','attributes','catch','lodash','moment','ioredis','../../mysqldb','../../config/environment','http','request','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','CreateChatQueueReport','ChatQueueReport'];(function(_0x381251,_0x1ba408){var _0x252ea9=function(_0x4d9afc){while(--_0x4d9afc){_0x381251['push'](_0x381251['shift']());}};_0x252ea9(++_0x1ba408);}(_0xcf01,0x141));var _0x1cf0=function(_0x3a2a33,_0x29372a){_0x3a2a33=_0x3a2a33-0x0;var _0x10d6d2=_0xcf01[_0x3a2a33];return _0x10d6d2;};'use strict';var _=require(_0x1cf0('0x0'));var util=require('util');var moment=require(_0x1cf0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cf0('0x2'));var db=require(_0x1cf0('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1cf0('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1cf0('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2be34c,_0x2db047,_0x108d73){return new BPromise(function(_0x128e75,_0x1a18bc){return client[_0x1cf0('0x6')](_0x2be34c,_0x108d73)['then'](function(_0x595ea7){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x2db047,'request\x20sent');logger['debug'](_0x1cf0('0x7'),_0x2db047,_0x1cf0('0x8'),JSON[_0x1cf0('0x9')](_0x595ea7));if(_0x595ea7[_0x1cf0('0xa')]){if(_0x595ea7[_0x1cf0('0xa')][_0x1cf0('0xb')]===0x1f4){logger[_0x1cf0('0xa')](_0x1cf0('0xc'),_0x2db047,_0x595ea7[_0x1cf0('0xa')]['message']);return _0x1a18bc(_0x595ea7[_0x1cf0('0xa')][_0x1cf0('0xd')]);}logger[_0x1cf0('0xa')](_0x1cf0('0xc'),_0x2db047,_0x595ea7[_0x1cf0('0xa')][_0x1cf0('0xd')]);return _0x128e75(_0x595ea7[_0x1cf0('0xa')]['message']);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x2db047,_0x1cf0('0x8'));_0x128e75(_0x595ea7[_0x1cf0('0xe')][_0x1cf0('0xd')]);}})['catch'](function(_0x3b571a){logger[_0x1cf0('0xa')](_0x1cf0('0xc'),_0x2db047,_0x3b571a);_0x1a18bc(_0x3b571a);});});}exports[_0x1cf0('0xf')]=function(_0x379695){var _0x227078=this;return new Promise(function(_0x38aef0,_0x315e85){return db[_0x1cf0('0x10')][_0x1cf0('0x11')](_0x379695[_0x1cf0('0x12')],{'raw':_0x379695[_0x1cf0('0x13')]?_0x379695[_0x1cf0('0x13')]['raw']===undefined?!![]:![]:!![]})[_0x1cf0('0x14')](function(_0x130c83){logger['info'](_0x1cf0('0xf'),_0x379695);logger[_0x1cf0('0x15')](_0x1cf0('0xf'),_0x379695,JSON[_0x1cf0('0x9')](_0x130c83));_0x38aef0(_0x130c83);})['catch'](function(_0x2f0a1b){logger[_0x1cf0('0xa')]('CreateChatQueueReport',_0x2f0a1b['message'],_0x379695);_0x315e85(_0x227078[_0x1cf0('0xa')](0x1f4,_0x2f0a1b[_0x1cf0('0xd')]));});});};exports[_0x1cf0('0x16')]=function(_0x5a996b){var _0x52820c=this;return new Promise(function(_0x54f2de,_0x30e746){return db[_0x1cf0('0x10')]['update'](_0x5a996b['body'],{'raw':_0x5a996b[_0x1cf0('0x13')]?_0x5a996b[_0x1cf0('0x13')][_0x1cf0('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a996b[_0x1cf0('0x13')]?_0x5a996b[_0x1cf0('0x13')]['where']||null:null,'attributes':_0x5a996b['options']?_0x5a996b[_0x1cf0('0x13')][_0x1cf0('0x18')]||null:null,'limit':_0x5a996b['options']?_0x5a996b[_0x1cf0('0x13')]['limit']||null:null})[_0x1cf0('0x14')](function(_0x37ffcc){logger['info']('UpdateChatQueueReport',_0x5a996b);logger['debug'](_0x1cf0('0x16'),_0x5a996b,JSON[_0x1cf0('0x9')](_0x37ffcc));_0x54f2de(_0x37ffcc);})[_0x1cf0('0x19')](function(_0x3c867d){logger[_0x1cf0('0xa')](_0x1cf0('0x16'),_0x3c867d['message'],_0x5a996b);_0x30e746(_0x52820c[_0x1cf0('0xa')](0x1f4,_0x3c867d['message']));});});};
\ No newline at end of file
index 707f902..60e5261 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9718=['../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2eee6b,_0x9c0a25){var _0x2a8684=function(_0x394d42){while(--_0x394d42){_0x2eee6b['push'](_0x2eee6b['shift']());}};_0x2a8684(++_0x9c0a25);}(_0x9718,0x17e));var _0x8971=function(_0x4b4406,_0x46ee6f){_0x4b4406=_0x4b4406-0x0;var _0x5f2b2d=_0x9718[_0x4b4406];return _0x5f2b2d;};'use strict';var multer=require(_0x8971('0x0'));var util=require(_0x8971('0x1'));var path=require(_0x8971('0x2'));var timeout=require(_0x8971('0x3'));var express=require(_0x8971('0x4'));var router=express[_0x8971('0x5')]();var fs_extra=require(_0x8971('0x6'));var auth=require(_0x8971('0x7'));var interaction=require(_0x8971('0x8'));var config=require(_0x8971('0x9'));var controller=require('./chatQueueReport.controller');router[_0x8971('0xa')]('/',auth[_0x8971('0xb')](),controller[_0x8971('0xc')]);router['get'](_0x8971('0xd'),auth[_0x8971('0xb')](),controller[_0x8971('0xe')]);router[_0x8971('0xa')]('/:id',auth[_0x8971('0xb')](),controller[_0x8971('0xf')]);router[_0x8971('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8971('0x11')](_0x8971('0x12'),auth['isAuthenticated'](),controller[_0x8971('0x13')]);router[_0x8971('0x14')]('/:id',auth[_0x8971('0xb')](),controller[_0x8971('0x15')]);module[_0x8971('0x16')]=router;
\ No newline at end of file
+var _0x2abf=['/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe'];(function(_0x1d7c5f,_0x518a3b){var _0x8648f4=function(_0x596496){while(--_0x596496){_0x1d7c5f['push'](_0x1d7c5f['shift']());}};_0x8648f4(++_0x518a3b);}(_0x2abf,0x70));var _0xf2ab=function(_0x39722c,_0x42c0af){_0x39722c=_0x39722c-0x0;var _0x4b4183=_0x2abf[_0x39722c];return _0x4b4183;};'use strict';var multer=require(_0xf2ab('0x0'));var util=require(_0xf2ab('0x1'));var path=require(_0xf2ab('0x2'));var timeout=require(_0xf2ab('0x3'));var express=require(_0xf2ab('0x4'));var router=express[_0xf2ab('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf2ab('0x6'));var interaction=require(_0xf2ab('0x7'));var config=require(_0xf2ab('0x8'));var controller=require(_0xf2ab('0x9'));router[_0xf2ab('0xa')]('/',auth[_0xf2ab('0xb')](),controller[_0xf2ab('0xc')]);router[_0xf2ab('0xa')]('/describe',auth[_0xf2ab('0xb')](),controller[_0xf2ab('0xd')]);router['get'](_0xf2ab('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xf2ab('0xf')]('/',auth[_0xf2ab('0xb')](),controller['create']);router[_0xf2ab('0x10')](_0xf2ab('0xe'),auth[_0xf2ab('0xb')](),controller[_0xf2ab('0x11')]);router[_0xf2ab('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xf2ab('0x13')]);module[_0xf2ab('0x14')]=router;
\ No newline at end of file
index df14ad8..ef21ea6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x5da14d,_0x7bdb93){var _0x49ef25=function(_0x355690){while(--_0x355690){_0x5da14d['push'](_0x5da14d['shift']());}};_0x49ef25(++_0x7bdb93);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xf3cd[_0x3947c9];return _0x2e7871;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0xbdb163,_0x19e360){var _0x589230=function(_0x482937){while(--_0x482937){_0xbdb163['push'](_0xbdb163['shift']());}};_0x589230(++_0x19e360);}(_0x70e0,0x17b));var _0x070e=function(_0x57829a,_0x1af64c){_0x57829a=_0x57829a-0x0;var _0xa1dbc8=_0x70e0[_0x57829a];return _0xa1dbc8;};'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 cf9e2ce..919de54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1006=['merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','length','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','limit','undefined','count','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick'];(function(_0x1dd82f,_0x52acb7){var _0x353ca4=function(_0x5ee4c9){while(--_0x5ee4c9){_0x1dd82f['push'](_0x1dd82f['shift']());}};_0x353ca4(++_0x52acb7);}(_0x1006,0xed));var _0x6100=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x1006[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x6100('0x0'));var rimraf=require(_0x6100('0x1'));var zipdir=require(_0x6100('0x2'));var jsonpatch=require(_0x6100('0x3'));var rp=require('request-promise');var moment=require(_0x6100('0x4'));var BPromise=require(_0x6100('0x5'));var Mustache=require(_0x6100('0x6'));var util=require(_0x6100('0x7'));var path=require(_0x6100('0x8'));var sox=require('sox');var csv=require(_0x6100('0x9'));var ejs=require(_0x6100('0xa'));var fs=require('fs');var fs_extra=require(_0x6100('0xb'));var _=require('lodash');var squel=require(_0x6100('0xc'));var crypto=require('crypto');var jsforce=require(_0x6100('0xd'));var deskjs=require(_0x6100('0xe'));var toCsv=require(_0x6100('0x9'));var querystring=require(_0x6100('0xf'));var Papa=require(_0x6100('0x10'));var Redis=require('ioredis');var authService=require(_0x6100('0x11'));var qs=require(_0x6100('0x12'));var as=require(_0x6100('0x13'));var hardwareService=require(_0x6100('0x14'));var logger=require(_0x6100('0x15'))(_0x6100('0x16'));var utils=require('../../config/utils');var config=require(_0x6100('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b17f2,_0x4126d9){_0x4126d9=_0x4126d9||0xcc;return function(_0x29b3c7){if(_0x29b3c7){return _0x2b17f2[_0x6100('0x18')](_0x4126d9);}return _0x2b17f2[_0x6100('0x19')](_0x4126d9)[_0x6100('0x1a')]();};}function respondWithResult(_0x4ddbc8,_0x1f54bc){_0x1f54bc=_0x1f54bc||0xc8;return function(_0x25934d){if(_0x25934d){return _0x4ddbc8[_0x6100('0x19')](_0x1f54bc)['json'](_0x25934d);}};}function respondWithFilteredResult(_0x18afa1,_0xa3fd61){return function(_0x494aa9){if(_0x494aa9){var _0x329d63=typeof _0xa3fd61[_0x6100('0x1b')]==='undefined'&&typeof _0xa3fd61[_0x6100('0x1c')]===_0x6100('0x1d');var _0x5965c7=_0x494aa9[_0x6100('0x1e')];var _0x1914fd=_0x329d63?0x0:_0xa3fd61['offset'];var _0x4e834a=_0x329d63?_0x494aa9['count']:_0xa3fd61[_0x6100('0x1b')]+_0xa3fd61['limit'];var _0x265289;if(_0x4e834a>=_0x5965c7){_0x4e834a=_0x5965c7;_0x265289=0xc8;}else{_0x265289=0xce;}_0x18afa1[_0x6100('0x19')](_0x265289);return _0x18afa1['set']('Content-Range',_0x1914fd+'-'+_0x4e834a+'/'+_0x5965c7)[_0x6100('0x1f')](_0x494aa9);}return null;};}function patchUpdates(_0x50250c){return function(_0x2eb437){try{jsonpatch[_0x6100('0x20')](_0x2eb437,_0x50250c,!![]);}catch(_0x346e1f){return BPromise[_0x6100('0x21')](_0x346e1f);}return _0x2eb437[_0x6100('0x22')]();};}function saveUpdates(_0x198b40,_0x10749c){return function(_0x4988aa){if(_0x4988aa){return _0x4988aa['update'](_0x198b40)[_0x6100('0x23')](function(_0x28e385){return _0x28e385;});}return null;};}function removeEntity(_0x1234f7,_0x4fcde4){return function(_0x494e03){if(_0x494e03){return _0x494e03[_0x6100('0x24')]()[_0x6100('0x23')](function(){_0x1234f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1144e1,_0x551222){return function(_0x2c2133){if(!_0x2c2133){_0x1144e1['sendStatus'](0x194);}return _0x2c2133;};}function handleError(_0xd0e325,_0x258ec6){_0x258ec6=_0x258ec6||0x1f4;return function(_0x5771b2){logger[_0x6100('0x25')](_0x5771b2[_0x6100('0x26')]);if(_0x5771b2[_0x6100('0x27')]){delete _0x5771b2[_0x6100('0x27')];}_0xd0e325[_0x6100('0x19')](_0x258ec6)[_0x6100('0x28')](_0x5771b2);};}exports[_0x6100('0x29')]=function(_0x20dcf7,_0x364094){var _0x36a505={},_0x29e679={},_0x49a818={'count':0x0,'rows':[]};var _0x4b7ecd=_[_0x6100('0x2a')](db[_0x6100('0x2b')][_0x6100('0x2c')],function(_0x29745e){return{'name':_0x29745e[_0x6100('0x2d')],'type':_0x29745e[_0x6100('0x2e')]['key']};});_0x29e679['model']=_['map'](_0x4b7ecd,'name');_0x29e679[_0x6100('0x2f')]=_[_0x6100('0x30')](_0x20dcf7['query']);_0x29e679[_0x6100('0x31')]=_[_0x6100('0x32')](_0x29e679[_0x6100('0x33')],_0x29e679[_0x6100('0x2f')]);_0x36a505['attributes']=_['intersection'](_0x29e679['model'],qs[_0x6100('0x34')](_0x20dcf7['query'][_0x6100('0x34')]));_0x36a505[_0x6100('0x35')]=_0x36a505[_0x6100('0x35')]['length']?_0x36a505['attributes']:_0x29e679[_0x6100('0x33')];if(!_0x20dcf7[_0x6100('0x2f')]['hasOwnProperty'](_0x6100('0x36'))){_0x36a505[_0x6100('0x1c')]=qs['limit'](_0x20dcf7[_0x6100('0x2f')][_0x6100('0x1c')]);_0x36a505['offset']=qs[_0x6100('0x1b')](_0x20dcf7[_0x6100('0x2f')][_0x6100('0x1b')]);}_0x36a505[_0x6100('0x37')]=qs[_0x6100('0x38')](_0x20dcf7[_0x6100('0x2f')][_0x6100('0x38')]);_0x36a505[_0x6100('0x39')]=qs[_0x6100('0x31')](_[_0x6100('0x3a')](_0x20dcf7['query'],_0x29e679['filters']),_0x4b7ecd);if(_0x20dcf7['query']['filter']){_0x36a505[_0x6100('0x39')]=_[_0x6100('0x3b')](_0x36a505[_0x6100('0x39')],{'$or':_['map'](_0x4b7ecd,function(_0x449a42){if(_0x449a42[_0x6100('0x2e')]!==_0x6100('0x3c')){var _0x41c192={};_0x41c192[_0x449a42['name']]={'$like':'%'+_0x20dcf7[_0x6100('0x2f')][_0x6100('0x3d')]+'%'};return _0x41c192;}})});}_0x36a505=_[_0x6100('0x3b')]({},_0x36a505,_0x20dcf7[_0x6100('0x3e')]);var _0x5169f1={'where':_0x36a505[_0x6100('0x39')]};return db[_0x6100('0x2b')]['count'](_0x5169f1)[_0x6100('0x23')](function(_0x4ee719){_0x49a818[_0x6100('0x1e')]=_0x4ee719;if(_0x20dcf7[_0x6100('0x2f')]['includeAll']){_0x36a505[_0x6100('0x3f')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x6100('0x40')](_0x36a505);})['then'](function(_0x47e2e6){_0x49a818[_0x6100('0x41')]=_0x47e2e6;return _0x49a818;})[_0x6100('0x23')](respondWithFilteredResult(_0x364094,_0x36a505))[_0x6100('0x42')](handleError(_0x364094,null));};exports['show']=function(_0x1cff2d,_0x1b0f5b){var _0x3d994c={'raw':!![],'where':{'id':_0x1cff2d[_0x6100('0x43')]['id']}},_0x1b3eb4={};_0x1b3eb4['model']=_[_0x6100('0x30')](db[_0x6100('0x2b')][_0x6100('0x2c')]);_0x1b3eb4[_0x6100('0x2f')]=_[_0x6100('0x30')](_0x1cff2d[_0x6100('0x2f')]);_0x1b3eb4['filters']=_[_0x6100('0x32')](_0x1b3eb4[_0x6100('0x33')],_0x1b3eb4['query']);_0x3d994c[_0x6100('0x35')]=_[_0x6100('0x32')](_0x1b3eb4[_0x6100('0x33')],qs['fields'](_0x1cff2d[_0x6100('0x2f')]['fields']));_0x3d994c['attributes']=_0x3d994c['attributes'][_0x6100('0x44')]?_0x3d994c['attributes']:_0x1b3eb4['model'];if(_0x1cff2d[_0x6100('0x2f')][_0x6100('0x45')]){_0x3d994c[_0x6100('0x3f')]=[{'all':!![]}];}_0x3d994c=_['merge']({},_0x3d994c,_0x1cff2d[_0x6100('0x3e')]);return db[_0x6100('0x2b')][_0x6100('0x46')](_0x3d994c)[_0x6100('0x23')](handleEntityNotFound(_0x1b0f5b,null))[_0x6100('0x23')](respondWithResult(_0x1b0f5b,null))[_0x6100('0x42')](handleError(_0x1b0f5b,null));};exports[_0x6100('0x47')]=function(_0x21f9a2,_0x3d20f7){return db[_0x6100('0x2b')][_0x6100('0x47')](_0x21f9a2['body'],{})[_0x6100('0x23')](respondWithResult(_0x3d20f7,0xc9))[_0x6100('0x42')](handleError(_0x3d20f7,null));};exports['update']=function(_0x382603,_0x9fc9c5){if(_0x382603[_0x6100('0x48')]['id']){delete _0x382603[_0x6100('0x48')]['id'];}return db[_0x6100('0x2b')][_0x6100('0x46')]({'where':{'id':_0x382603['params']['id']}})[_0x6100('0x23')](handleEntityNotFound(_0x9fc9c5,null))[_0x6100('0x23')](saveUpdates(_0x382603['body'],null))[_0x6100('0x23')](respondWithResult(_0x9fc9c5,null))[_0x6100('0x42')](handleError(_0x9fc9c5,null));};exports['destroy']=function(_0x1c64a8,_0x2bc795){return db['ChatTransferReport'][_0x6100('0x46')]({'where':{'id':_0x1c64a8[_0x6100('0x43')]['id']}})[_0x6100('0x23')](handleEntityNotFound(_0x2bc795,null))[_0x6100('0x23')](removeEntity(_0x2bc795,null))['catch'](handleError(_0x2bc795,null));};exports[_0x6100('0x49')]=function(_0x59e0f6,_0x2f99a1){return db[_0x6100('0x2b')][_0x6100('0x49')]()[_0x6100('0x23')](respondWithResult(_0x2f99a1,null))[_0x6100('0x42')](handleError(_0x2f99a1,null));};
\ No newline at end of file
+var _0x24ef=['intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','ChatTransferReport','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','stack','name','map','rawAttributes','type','key','query','keys'];(function(_0x1b494d,_0x90d951){var _0x1e03f6=function(_0x550633){while(--_0x550633){_0x1b494d['push'](_0x1b494d['shift']());}};_0x1e03f6(++_0x90d951);}(_0x24ef,0xff));var _0xf24e=function(_0x1e32b9,_0x211da1){_0x1e32b9=_0x1e32b9-0x0;var _0x19a761=_0x24ef[_0x1e32b9];return _0x19a761;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf24e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf24e('0x1'));var moment=require(_0xf24e('0x2'));var BPromise=require(_0xf24e('0x3'));var Mustache=require(_0xf24e('0x4'));var util=require(_0xf24e('0x5'));var path=require(_0xf24e('0x6'));var sox=require(_0xf24e('0x7'));var csv=require(_0xf24e('0x8'));var ejs=require(_0xf24e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf24e('0xa'));var squel=require(_0xf24e('0xb'));var crypto=require(_0xf24e('0xc'));var jsforce=require(_0xf24e('0xd'));var deskjs=require(_0xf24e('0xe'));var toCsv=require(_0xf24e('0x8'));var querystring=require(_0xf24e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf24e('0x10'));var authService=require(_0xf24e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf24e('0x12'));var hardwareService=require(_0xf24e('0x13'));var logger=require(_0xf24e('0x14'))(_0xf24e('0x15'));var utils=require(_0xf24e('0x16'));var config=require(_0xf24e('0x17'));var licenseUtil=require(_0xf24e('0x18'));var db=require(_0xf24e('0x19'))['db'];function respondWithStatusCode(_0x4f1d85,_0x4b4a4c){_0x4b4a4c=_0x4b4a4c||0xcc;return function(_0x25ec18){if(_0x25ec18){return _0x4f1d85[_0xf24e('0x1a')](_0x4b4a4c);}return _0x4f1d85[_0xf24e('0x1b')](_0x4b4a4c)[_0xf24e('0x1c')]();};}function respondWithResult(_0x1c44a7,_0x52cf74){_0x52cf74=_0x52cf74||0xc8;return function(_0x299323){if(_0x299323){return _0x1c44a7[_0xf24e('0x1b')](_0x52cf74)['json'](_0x299323);}};}function respondWithFilteredResult(_0x5ebe66,_0x1aac79){return function(_0x5d5400){if(_0x5d5400){var _0x3ffe2f=typeof _0x1aac79['offset']===_0xf24e('0x1d')&&typeof _0x1aac79[_0xf24e('0x1e')]==='undefined';var _0x1eeb42=_0x5d5400[_0xf24e('0x1f')];var _0x256cdd=_0x3ffe2f?0x0:_0x1aac79[_0xf24e('0x20')];var _0x20088b=_0x3ffe2f?_0x5d5400[_0xf24e('0x1f')]:_0x1aac79[_0xf24e('0x20')]+_0x1aac79['limit'];var _0x29e099;if(_0x20088b>=_0x1eeb42){_0x20088b=_0x1eeb42;_0x29e099=0xc8;}else{_0x29e099=0xce;}_0x5ebe66[_0xf24e('0x1b')](_0x29e099);return _0x5ebe66[_0xf24e('0x21')](_0xf24e('0x22'),_0x256cdd+'-'+_0x20088b+'/'+_0x1eeb42)[_0xf24e('0x23')](_0x5d5400);}return null;};}function patchUpdates(_0x4ce6ec){return function(_0x9494ae){try{jsonpatch['apply'](_0x9494ae,_0x4ce6ec,!![]);}catch(_0x57f95d){return BPromise[_0xf24e('0x24')](_0x57f95d);}return _0x9494ae[_0xf24e('0x25')]();};}function saveUpdates(_0x35dcef,_0x4767da){return function(_0x47faeb){if(_0x47faeb){return _0x47faeb[_0xf24e('0x26')](_0x35dcef)[_0xf24e('0x27')](function(_0x42be40){return _0x42be40;});}return null;};}function removeEntity(_0x22b9ce,_0x390108){return function(_0x5909e8){if(_0x5909e8){return _0x5909e8[_0xf24e('0x28')]()[_0xf24e('0x27')](function(){_0x22b9ce[_0xf24e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47fcd9,_0x3a8ea0){return function(_0x347ace){if(!_0x347ace){_0x47fcd9[_0xf24e('0x1a')](0x194);}return _0x347ace;};}function handleError(_0x3ec523,_0x4496c9){_0x4496c9=_0x4496c9||0x1f4;return function(_0x23a792){logger['error'](_0x23a792[_0xf24e('0x29')]);if(_0x23a792[_0xf24e('0x2a')]){delete _0x23a792[_0xf24e('0x2a')];}_0x3ec523[_0xf24e('0x1b')](_0x4496c9)['send'](_0x23a792);};}exports['index']=function(_0x464470,_0x2e97d1){var _0x703c6={},_0x187166={},_0x50dde8={'count':0x0,'rows':[]};var _0x4b028b=_[_0xf24e('0x2b')](db['ChatTransferReport'][_0xf24e('0x2c')],function(_0x274333){return{'name':_0x274333['fieldName'],'type':_0x274333[_0xf24e('0x2d')][_0xf24e('0x2e')]};});_0x187166['model']=_[_0xf24e('0x2b')](_0x4b028b,_0xf24e('0x2a'));_0x187166[_0xf24e('0x2f')]=_[_0xf24e('0x30')](_0x464470[_0xf24e('0x2f')]);_0x187166['filters']=_[_0xf24e('0x31')](_0x187166['model'],_0x187166[_0xf24e('0x2f')]);_0x703c6[_0xf24e('0x32')]=_[_0xf24e('0x31')](_0x187166[_0xf24e('0x33')],qs['fields'](_0x464470[_0xf24e('0x2f')][_0xf24e('0x34')]));_0x703c6[_0xf24e('0x32')]=_0x703c6[_0xf24e('0x32')][_0xf24e('0x35')]?_0x703c6[_0xf24e('0x32')]:_0x187166[_0xf24e('0x33')];if(!_0x464470['query'][_0xf24e('0x36')](_0xf24e('0x37'))){_0x703c6[_0xf24e('0x1e')]=qs[_0xf24e('0x1e')](_0x464470[_0xf24e('0x2f')][_0xf24e('0x1e')]);_0x703c6[_0xf24e('0x20')]=qs[_0xf24e('0x20')](_0x464470[_0xf24e('0x2f')][_0xf24e('0x20')]);}_0x703c6['order']=qs[_0xf24e('0x38')](_0x464470[_0xf24e('0x2f')][_0xf24e('0x38')]);_0x703c6[_0xf24e('0x39')]=qs[_0xf24e('0x3a')](_[_0xf24e('0x3b')](_0x464470[_0xf24e('0x2f')],_0x187166['filters']),_0x4b028b);if(_0x464470['query'][_0xf24e('0x3c')]){_0x703c6[_0xf24e('0x39')]=_['merge'](_0x703c6['where'],{'$or':_[_0xf24e('0x2b')](_0x4b028b,function(_0x3c492b){if(_0x3c492b[_0xf24e('0x2d')]!==_0xf24e('0x3d')){var _0x10ddbe={};_0x10ddbe[_0x3c492b[_0xf24e('0x2a')]]={'$like':'%'+_0x464470[_0xf24e('0x2f')][_0xf24e('0x3c')]+'%'};return _0x10ddbe;}})});}_0x703c6=_[_0xf24e('0x3e')]({},_0x703c6,_0x464470[_0xf24e('0x3f')]);var _0x446033={'where':_0x703c6[_0xf24e('0x39')]};return db[_0xf24e('0x40')][_0xf24e('0x1f')](_0x446033)[_0xf24e('0x27')](function(_0x28f59c){_0x50dde8[_0xf24e('0x1f')]=_0x28f59c;if(_0x464470['query'][_0xf24e('0x41')]){_0x703c6[_0xf24e('0x42')]=[{'all':!![]}];}return db[_0xf24e('0x40')][_0xf24e('0x43')](_0x703c6);})['then'](function(_0x4ecd5b){_0x50dde8[_0xf24e('0x44')]=_0x4ecd5b;return _0x50dde8;})[_0xf24e('0x27')](respondWithFilteredResult(_0x2e97d1,_0x703c6))[_0xf24e('0x45')](handleError(_0x2e97d1,null));};exports[_0xf24e('0x46')]=function(_0x29d0b3,_0x5c3e0e){var _0x3fb0c4={'raw':!![],'where':{'id':_0x29d0b3['params']['id']}},_0x58c795={};_0x58c795[_0xf24e('0x33')]=_[_0xf24e('0x30')](db[_0xf24e('0x40')]['rawAttributes']);_0x58c795[_0xf24e('0x2f')]=_[_0xf24e('0x30')](_0x29d0b3['query']);_0x58c795['filters']=_[_0xf24e('0x31')](_0x58c795[_0xf24e('0x33')],_0x58c795[_0xf24e('0x2f')]);_0x3fb0c4[_0xf24e('0x32')]=_[_0xf24e('0x31')](_0x58c795[_0xf24e('0x33')],qs['fields'](_0x29d0b3[_0xf24e('0x2f')][_0xf24e('0x34')]));_0x3fb0c4['attributes']=_0x3fb0c4['attributes'][_0xf24e('0x35')]?_0x3fb0c4[_0xf24e('0x32')]:_0x58c795['model'];if(_0x29d0b3[_0xf24e('0x2f')][_0xf24e('0x41')]){_0x3fb0c4[_0xf24e('0x42')]=[{'all':!![]}];}_0x3fb0c4=_[_0xf24e('0x3e')]({},_0x3fb0c4,_0x29d0b3['options']);return db[_0xf24e('0x40')][_0xf24e('0x47')](_0x3fb0c4)[_0xf24e('0x27')](handleEntityNotFound(_0x5c3e0e,null))[_0xf24e('0x27')](respondWithResult(_0x5c3e0e,null))[_0xf24e('0x45')](handleError(_0x5c3e0e,null));};exports[_0xf24e('0x48')]=function(_0x4939bf,_0x2308f8){return db[_0xf24e('0x40')][_0xf24e('0x48')](_0x4939bf[_0xf24e('0x49')],{})[_0xf24e('0x27')](respondWithResult(_0x2308f8,0xc9))['catch'](handleError(_0x2308f8,null));};exports[_0xf24e('0x26')]=function(_0x45d619,_0x3ac744){if(_0x45d619[_0xf24e('0x49')]['id']){delete _0x45d619['body']['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x45d619[_0xf24e('0x4a')]['id']}})[_0xf24e('0x27')](handleEntityNotFound(_0x3ac744,null))[_0xf24e('0x27')](saveUpdates(_0x45d619[_0xf24e('0x49')],null))[_0xf24e('0x27')](respondWithResult(_0x3ac744,null))[_0xf24e('0x45')](handleError(_0x3ac744,null));};exports[_0xf24e('0x28')]=function(_0x211b67,_0x37fdcb){return db['ChatTransferReport'][_0xf24e('0x47')]({'where':{'id':_0x211b67['params']['id']}})[_0xf24e('0x27')](handleEntityNotFound(_0x37fdcb,null))[_0xf24e('0x27')](removeEntity(_0x37fdcb,null))[_0xf24e('0x45')](handleError(_0x37fdcb,null));};exports[_0xf24e('0x4b')]=function(_0xce8bb0,_0x2d5df9){return db['ChatTransferReport'][_0xf24e('0x4b')]()[_0xf24e('0x27')](respondWithResult(_0x2d5df9,null))[_0xf24e('0x45')](handleError(_0x2d5df9,null));};
\ No newline at end of file
index 77e259f..5cae820 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb793=['api','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x18f659,_0x153e5b){var _0x1c91fd=function(_0x110fad){while(--_0x110fad){_0x18f659['push'](_0x18f659['shift']());}};_0x1c91fd(++_0x153e5b);}(_0xb793,0x107));var _0x3b79=function(_0x32eb27,_0x21adff){_0x32eb27=_0x32eb27-0x0;var _0x5dbed4=_0xb793[_0x32eb27];return _0x5dbed4;};'use strict';var _=require(_0x3b79('0x0'));var util=require(_0x3b79('0x1'));var logger=require(_0x3b79('0x2'))(_0x3b79('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3b79('0x4'));var fs=require('fs');var path=require(_0x3b79('0x5'));var rimraf=require(_0x3b79('0x6'));var config=require(_0x3b79('0x7'));var attributes=require(_0x3b79('0x8'));module[_0x3b79('0x9')]=function(_0x2efc76,_0x4622ba){return _0x2efc76[_0x3b79('0xa')](_0x3b79('0xb'),attributes,{'tableName':_0x3b79('0xc'),'paranoid':![],'indexes':[{'name':_0x3b79('0xd'),'fields':[_0x3b79('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd0ab=['define','uniqueid','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x2bdffa,_0x453a43){var _0x55f512=function(_0x4710b4){while(--_0x4710b4){_0x2bdffa['push'](_0x2bdffa['shift']());}};_0x55f512(++_0x453a43);}(_0xd0ab,0xb6));var _0xbd0a=function(_0x162018,_0x4fe692){_0x162018=_0x162018-0x0;var _0x7585be=_0xd0ab[_0x162018];return _0x7585be;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbd0a('0x0'))('api');var moment=require(_0xbd0a('0x1'));var BPromise=require(_0xbd0a('0x2'));var rp=require(_0xbd0a('0x3'));var fs=require('fs');var path=require(_0xbd0a('0x4'));var rimraf=require(_0xbd0a('0x5'));var config=require(_0xbd0a('0x6'));var attributes=require(_0xbd0a('0x7'));module['exports']=function(_0x23bc02,_0x28a58e){return _0x23bc02[_0xbd0a('0x8')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xbd0a('0x9'),'fields':[_0xbd0a('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index c8adc9a..6f94473 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f1a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8f1a,0x9d));var _0xa8f1=function(_0x3557e6,_0x28ea31){_0x3557e6=_0x3557e6-0x0;var _0x4deea3=_0x8f1a[_0x3557e6];return _0x4deea3;};'use strict';var _=require(_0xa8f1('0x0'));var util=require(_0xa8f1('0x1'));var moment=require('moment');var BPromise=require(_0xa8f1('0x2'));var rs=require(_0xa8f1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa8f1('0x4'))['db'];var utils=require(_0xa8f1('0x5'));var logger=require(_0xa8f1('0x6'))(_0xa8f1('0x7'));var config=require(_0xa8f1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa8f1('0x9')][_0xa8f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59101a,_0x2d6100,_0x56ded9){return new BPromise(function(_0x32b9e9,_0x47b6c1){return client['request'](_0x59101a,_0x56ded9)[_0xa8f1('0xb')](function(_0x5010d5){logger[_0xa8f1('0xc')](_0xa8f1('0xd'),_0x2d6100,_0xa8f1('0xe'));logger[_0xa8f1('0xf')](_0xa8f1('0x10'),_0x2d6100,_0xa8f1('0xe'),JSON[_0xa8f1('0x11')](_0x5010d5));if(_0x5010d5[_0xa8f1('0x12')]){if(_0x5010d5['error'][_0xa8f1('0x13')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x2d6100,_0x5010d5[_0xa8f1('0x12')][_0xa8f1('0x14')]);return _0x47b6c1(_0x5010d5['error'][_0xa8f1('0x14')]);}logger[_0xa8f1('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x2d6100,_0x5010d5[_0xa8f1('0x12')][_0xa8f1('0x14')]);return _0x32b9e9(_0x5010d5['error'][_0xa8f1('0x14')]);}else{logger[_0xa8f1('0xc')](_0xa8f1('0xd'),_0x2d6100,_0xa8f1('0xe'));_0x32b9e9(_0x5010d5[_0xa8f1('0x15')][_0xa8f1('0x14')]);}})[_0xa8f1('0x16')](function(_0x2d410e){logger[_0xa8f1('0x12')](_0xa8f1('0xd'),_0x2d6100,_0x2d410e);_0x47b6c1(_0x2d410e);});});}
\ No newline at end of file
+var _0x63f3=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x202fd1,_0x448cef){var _0x372d22=function(_0x1f401f){while(--_0x1f401f){_0x202fd1['push'](_0x202fd1['shift']());}};_0x372d22(++_0x448cef);}(_0x63f3,0x91));var _0x363f=function(_0x3a8dc1,_0x2f03b8){_0x3a8dc1=_0x3a8dc1-0x0;var _0x4b3595=_0x63f3[_0x3a8dc1];return _0x4b3595;};'use strict';var _=require(_0x363f('0x0'));var util=require(_0x363f('0x1'));var moment=require(_0x363f('0x2'));var BPromise=require(_0x363f('0x3'));var rs=require(_0x363f('0x4'));var fs=require('fs');var Redis=require(_0x363f('0x5'));var db=require(_0x363f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x363f('0x7'))(_0x363f('0x8'));var config=require(_0x363f('0x9'));var jayson=require(_0x363f('0xa'));var client=jayson[_0x363f('0xb')][_0x363f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x383099,_0x2c2275,_0x19c88f){return new BPromise(function(_0xaf11c8,_0x3416f9){return client[_0x363f('0xd')](_0x383099,_0x19c88f)[_0x363f('0xe')](function(_0x2ed9c2){logger['info'](_0x363f('0xf'),_0x2c2275,_0x363f('0x10'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x2c2275,_0x363f('0x10'),JSON[_0x363f('0x11')](_0x2ed9c2));if(_0x2ed9c2[_0x363f('0x12')]){if(_0x2ed9c2[_0x363f('0x12')][_0x363f('0x13')]===0x1f4){logger[_0x363f('0x12')](_0x363f('0xf'),_0x2c2275,_0x2ed9c2[_0x363f('0x12')][_0x363f('0x14')]);return _0x3416f9(_0x2ed9c2[_0x363f('0x12')]['message']);}logger['error'](_0x363f('0xf'),_0x2c2275,_0x2ed9c2[_0x363f('0x12')][_0x363f('0x14')]);return _0xaf11c8(_0x2ed9c2[_0x363f('0x12')][_0x363f('0x14')]);}else{logger[_0x363f('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x2c2275,_0x363f('0x10'));_0xaf11c8(_0x2ed9c2[_0x363f('0x16')][_0x363f('0x14')]);}})[_0x363f('0x17')](function(_0x392a85){logger[_0x363f('0x12')](_0x363f('0xf'),_0x2c2275,_0x392a85);_0x3416f9(_0x392a85);});});}
\ No newline at end of file
index 829884b..b55b2bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4fc=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x298374,_0x4d34c4){var _0x42ada1=function(_0x1ed25b){while(--_0x1ed25b){_0x298374['push'](_0x298374['shift']());}};_0x42ada1(++_0x4d34c4);}(_0xa4fc,0x8f));var _0xca4f=function(_0x273010,_0x5e16e8){_0x273010=_0x273010-0x0;var _0x5d1f87=_0xa4fc[_0x273010];return _0x5d1f87;};'use strict';var multer=require(_0xca4f('0x0'));var util=require(_0xca4f('0x1'));var path=require(_0xca4f('0x2'));var timeout=require(_0xca4f('0x3'));var express=require(_0xca4f('0x4'));var router=express[_0xca4f('0x5')]();var fs_extra=require(_0xca4f('0x6'));var auth=require(_0xca4f('0x7'));var interaction=require(_0xca4f('0x8'));var config=require('../../config/environment');var controller=require(_0xca4f('0x9'));router['get']('/',auth[_0xca4f('0xa')](),controller[_0xca4f('0xb')]);router[_0xca4f('0xc')](_0xca4f('0xd'),auth[_0xca4f('0xa')](),controller[_0xca4f('0xe')]);router['get'](_0xca4f('0xf'),auth[_0xca4f('0xa')](),controller[_0xca4f('0x10')]);router[_0xca4f('0x11')]('/',auth[_0xca4f('0xa')](),controller['create']);router[_0xca4f('0x12')](_0xca4f('0xf'),auth['isAuthenticated'](),controller[_0xca4f('0x13')]);router[_0xca4f('0x14')](_0xca4f('0xf'),auth[_0xca4f('0xa')](),controller[_0xca4f('0x15')]);module[_0xca4f('0x16')]=router;
\ No newline at end of file
+var _0x57d6=['destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x57d6,0x1e2));var _0x657d=function(_0x16ecad,_0x205047){_0x16ecad=_0x16ecad-0x0;var _0x313ff7=_0x57d6[_0x16ecad];return _0x313ff7;};'use strict';var multer=require(_0x657d('0x0'));var util=require(_0x657d('0x1'));var path=require(_0x657d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x657d('0x3')]();var fs_extra=require(_0x657d('0x4'));var auth=require(_0x657d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x657d('0x6'));var controller=require(_0x657d('0x7'));router[_0x657d('0x8')]('/',auth[_0x657d('0x9')](),controller[_0x657d('0xa')]);router[_0x657d('0x8')](_0x657d('0xb'),auth[_0x657d('0x9')](),controller['describe']);router[_0x657d('0x8')](_0x657d('0xc'),auth['isAuthenticated'](),controller[_0x657d('0xd')]);router[_0x657d('0xe')]('/',auth[_0x657d('0x9')](),controller[_0x657d('0xf')]);router['put'](_0x657d('0xc'),auth[_0x657d('0x9')](),controller[_0x657d('0x10')]);router[_0x657d('0x11')](_0x657d('0xc'),auth[_0x657d('0x9')](),controller[_0x657d('0x12')]);module[_0x657d('0x13')]=router;
\ No newline at end of file
index 6a7e4e4..4b180e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55e0=['CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','name','text','input','getDataValue','onlineForm','parse','Comments','Leave\x20your\x20comments','offlineForm','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','Skip','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right'];(function(_0x667ff8,_0x59e7df){var _0x2ddfc7=function(_0x5a4a46){while(--_0x5a4a46){_0x667ff8['push'](_0x667ff8['shift']());}};_0x2ddfc7(++_0x59e7df);}(_0x55e0,0xdc));var _0x055e=function(_0xbad2b4,_0x165d66){_0xbad2b4=_0xbad2b4-0x0;var _0x9304ef=_0x55e0[_0xbad2b4];return _0x9304ef;};'use strict';var Sequelize=require(_0x055e('0x0'));var rs=require(_0x055e('0x1'));module[_0x055e('0x2')]={'name':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x055e('0x3')]},'mapKey':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'mapKeyOffline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'key':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x055e('0x3')]},'animation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x055e('0x9')]('rounded','squared'),'defaultValue':_0x055e('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0xb')},'start_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xc')},'offline_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'header_offline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x055e('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x13')},'noteTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x14')},'placeholderMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x16')},'closingMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'skipMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x17')},'ratingType':{'type':Sequelize[_0x055e('0x9')](_0x055e('0x18'),_0x055e('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON[_0x055e('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x055e('0x1b'),'type':_0x055e('0x1c'),'required':!![]},'props':{'title':_0x055e('0x1b'),'helpText':''}},{'type':_0x055e('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x1f'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')](_0x055e('0x1f'))):{};},'set':function(_0x4c653c){return this['setDataValue'](_0x055e('0x1f'),JSON[_0x055e('0x1a')](_0x4c653c));}},'offlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x055e('0x1d'),'props':{'title':_0x055e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':_0x055e('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x055e('0x21')},'props':{'title':'Comments','helpText':_0x055e('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x23'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')]('offlineForm')):{};},'set':function(_0x99a372){return this[_0x055e('0x24')](_0x055e('0x23'),JSON[_0x055e('0x1a')](_0x99a372));}},'token':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return rs[_0x055e('0x25')]();}},'autoclose':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x055e('0x3')]},'forwardOffline':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x26')},'waitingMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x29')},'sendUnmanaged':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x055e('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x055e('0x3')]},'notificationTemplate':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return _0x055e('0x2a');}},'notificationSound':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2c')},'verticalAlignment':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2e')},'defaultTitle':{'type':Sequelize[_0x055e('0x3')]},'customerAvatar':{'type':Sequelize[_0x055e('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x30')},'systemAvatar':{'type':Sequelize[_0x055e('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x055e('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1012a4){if(!_0x1012a4)this[_0x055e('0x24')](_0x055e('0x32'),null);this['setDataValue'](_0x055e('0x33'),_0x1012a4);}},'vidaooEscalation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x34')},'vidaooNote':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x055e('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x055e('0x10')]}};
\ No newline at end of file
+var _0x6f0d=['Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','TEXT','input','name','getDataValue','parse','onlineForm','stringify','Comments','offlineForm','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.','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','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message'];(function(_0x1ddafd,_0x394f73){var _0x3b3b31=function(_0x365201){while(--_0x365201){_0x1ddafd['push'](_0x1ddafd['shift']());}};_0x3b3b31(++_0x394f73);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x50d490,_0x359cea){_0x50d490=_0x50d490-0x0;var _0x288ce5=_0x6f0d[_0x50d490];return _0x288ce5;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xd6f0('0x0'));module[_0xd6f0('0x1')]={'name':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xd6f0('0x2')]},'mapKey':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x3')},'mapKeyOffline':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'defaultValue':_0xd6f0('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd6f0('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'defaultValue':_0xd6f0('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd6f0('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd6f0('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd6f0('0x7')](_0xd6f0('0x8'),_0xd6f0('0x9')),'defaultValue':_0xd6f0('0x8')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xd6f0('0xa')},'start_chat_button':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0xb')},'offline_chat_button':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0xc')},'header_offline':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0xd')},'download_transcript':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd6f0('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xd6f0('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x11')},'noteTitle':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x12')},'placeholderMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x13')},'closingMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x14')},'closingMessageButton':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0xc')},'skipMessageButton':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x15')},'conditionAgreement':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x16')},'ratingType':{'type':Sequelize[_0xd6f0('0x7')]('star',_0xd6f0('0x17')),'defaultValue':_0xd6f0('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd6f0('0x19')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xd6f0('0x1a'),'variable':null,'config':{'placeholder':_0xd6f0('0x1b'),'type':'text','required':!![]},'props':{'title':_0xd6f0('0x1b'),'helpText':''}},{'type':_0xd6f0('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xd6f0('0x3'),'type':_0xd6f0('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd6f0('0x1c')]('onlineForm')?JSON[_0xd6f0('0x1d')](this[_0xd6f0('0x1c')]('onlineForm')):{};},'set':function(_0xcea0ae){return this['setDataValue'](_0xd6f0('0x1e'),JSON[_0xd6f0('0x1f')](_0xcea0ae));}},'offlineForm':{'type':Sequelize[_0xd6f0('0x19')],'defaultValue':function(){return JSON[_0xd6f0('0x1f')]({'items':[{'type':_0xd6f0('0x1a'),'props':{'title':_0xd6f0('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xd6f0('0x3'),'type':_0xd6f0('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0xd6f0('0x20')},'props':{'title':_0xd6f0('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xd6f0('0x1c')](_0xd6f0('0x21'))?JSON[_0xd6f0('0x1d')](this[_0xd6f0('0x1c')](_0xd6f0('0x21'))):{};},'set':function(_0x39e96a){return this[_0xd6f0('0x22')](_0xd6f0('0x21'),JSON[_0xd6f0('0x1f')](_0x39e96a));}},'token':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':function(){return rs[_0xd6f0('0x23')]();}},'autoclose':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd6f0('0x2')]},'forwardOffline':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd6f0('0x2')]},'waitingTitle':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x24')},'waitingMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x26')},'skipUnmanaged':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x15')},'sendUnmanaged':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd6f0('0x19')]},'showAgentAvatar':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd6f0('0x2')]},'notificationTemplate':{'type':Sequelize[_0xd6f0('0x19')],'defaultValue':function(){return _0xd6f0('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xd6f0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xd6f0('0x28')},'verticalAlignment':{'type':Sequelize[_0xd6f0('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x29')},'messagesAlignment':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x2a')},'defaultTitle':{'type':Sequelize[_0xd6f0('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd6f0('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'defaultValue':_0xd6f0('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd6f0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x2c')},'systemAvatar':{'type':Sequelize[_0xd6f0('0x19')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd6f0('0x6')],'comment':_0xd6f0('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1af620){if(!_0x1af620)this[_0xd6f0('0x22')](_0xd6f0('0x2e'),null);this[_0xd6f0('0x22')]('mandatoryDisposition',_0x1af620);}},'vidaooEscalation':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd6f0('0x2')]},'vidaooTopic':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'defaultValue':_0xd6f0('0x2f')},'vidaooNote':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xd6f0('0x19')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd6f0('0x19')]}};
\ No newline at end of file
index b77898c..a37c66d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd3f=['limit','count','offset','status','set','update','destroy','get','ChatWebsites','UserProfileResource','end','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ChatWebsite','includeAll','rows','show','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','../../config/license/util','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','describe','Sequelize','no\x20available\x20attributes','createdAt','difference','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','updatedAt','DESC','ChatApplication','Applications','List','list','orderBy','applications','priority','asc','account','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','ContactId','interaction','spread','lastName','messageId','created','push','close','unmanaged','ChatMessage','UserId','User','*,*,*,*','forcedOwnership','Start','EventManager','files','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','email','Chat','MailAccountId','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','interval','timezone','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','inspect','No\x20timezone','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','render','verticalAlignment','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','ISOLATION_LEVELS','finally','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','json','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd3f,0x109));var _0xffd3=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xfd3f[_0x176329];return _0x31997c;};'use strict';var BPromise=require(_0xffd3('0x0'));var Mustache=require(_0xffd3('0x1'));var util=require(_0xffd3('0x2'));var path=require(_0xffd3('0x3'));var ejs=require(_0xffd3('0x4'));var fs=require('fs');var fs_extra=require(_0xffd3('0x5'));var _=require(_0xffd3('0x6'));var querystring=require('querystring');var Redis=require(_0xffd3('0x7'));var qs=require(_0xffd3('0x8'));var logger=require(_0xffd3('0x9'))(_0xffd3('0xa'));var config=require(_0xffd3('0xb'));var db=require(_0xffd3('0xc'))['db'];config['redis']=_['defaults'](config[_0xffd3('0xd')],{'host':_0xffd3('0xe'),'port':0x18eb});var socket=require(_0xffd3('0xf'))(new Redis(config[_0xffd3('0xd')]));require(_0xffd3('0x10'))[_0xffd3('0x11')](socket);var htmlToText=require(_0xffd3('0x12'));var jayson=require('jayson/promise');var client=jayson[_0xffd3('0x13')]['http']({'port':0x232c});var client9002=jayson['client'][_0xffd3('0x14')]({'port':0x232a});var client9003=jayson[_0xffd3('0x13')]['http']({'port':0x232b});var client9001=jayson[_0xffd3('0x13')][_0xffd3('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x1b6fd7,_0x254a48,_0x29005f,_0x5f33bd){return new BPromise(function(_0x30dd8e,_0xfc694f){var _0x8a19af=_0x5f33bd||client;return _0x8a19af[_0xffd3('0x15')](_0x1b6fd7,_0x29005f)[_0xffd3('0x16')](function(_0x4761b7){logger['info'](_0xffd3('0x17'),_0x254a48,_0xffd3('0x18'));logger[_0xffd3('0x19')](_0xffd3('0x1a'),_0x254a48,_0xffd3('0x18'),JSON[_0xffd3('0x1b')](_0x4761b7));if(_0x4761b7[_0xffd3('0x1c')]){if(_0x4761b7[_0xffd3('0x1c')][_0xffd3('0x1d')]===0x1f4){logger[_0xffd3('0x1c')](_0xffd3('0x17'),_0x254a48,_0x4761b7[_0xffd3('0x1c')][_0xffd3('0x1e')]);return _0xfc694f(_0x4761b7[_0xffd3('0x1c')][_0xffd3('0x1e')]);}logger[_0xffd3('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x254a48,_0x4761b7[_0xffd3('0x1c')][_0xffd3('0x1e')]);return _0x30dd8e(_0x4761b7[_0xffd3('0x1c')]['message']);}else{logger[_0xffd3('0x1f')](_0xffd3('0x17'),_0x254a48,'request\x20sent');_0x30dd8e(_0x4761b7[_0xffd3('0x20')][_0xffd3('0x1e')]);}})[_0xffd3('0x21')](function(_0x5d00de){logger[_0xffd3('0x1c')](_0xffd3('0x17'),_0x254a48,_0x5d00de);_0xfc694f(_0x5d00de);});});}function respondWithStatusCode(_0x47b335,_0x5f4be5){_0x5f4be5=_0x5f4be5||0xcc;return function(_0x15964b){if(_0x15964b){return _0x47b335['sendStatus'](_0x5f4be5);}return _0x47b335['status'](_0x5f4be5)['end']();};}function respondWithResult(_0xf7a3f1,_0x4ccb17){_0x4ccb17=_0x4ccb17||0xc8;return function(_0x437f50){if(_0x437f50){return _0xf7a3f1['status'](_0x4ccb17)[_0xffd3('0x22')](_0x437f50);}};}function respondWithFilteredResult(_0x424654,_0x5d5442){return function(_0x3614b8){if(_0x3614b8){var _0x58b47e=typeof _0x5d5442['offset']===_0xffd3('0x23')&&typeof _0x5d5442[_0xffd3('0x24')]===_0xffd3('0x23');var _0x1e9420=_0x3614b8[_0xffd3('0x25')];var _0xb885a1=_0x58b47e?0x0:_0x5d5442[_0xffd3('0x26')];var _0x830b7=_0x58b47e?_0x3614b8[_0xffd3('0x25')]:_0x5d5442['offset']+_0x5d5442[_0xffd3('0x24')];var _0x46d720;if(_0x830b7>=_0x1e9420){_0x830b7=_0x1e9420;_0x46d720=0xc8;}else{_0x46d720=0xce;}_0x424654[_0xffd3('0x27')](_0x46d720);return _0x424654[_0xffd3('0x28')]('Content-Range',_0xb885a1+'-'+_0x830b7+'/'+_0x1e9420)[_0xffd3('0x22')](_0x3614b8);}return null;};}function saveUpdates(_0x4244f6){return function(_0x297c90){if(_0x297c90){return _0x297c90[_0xffd3('0x29')](_0x4244f6)['then'](function(_0x44d0b1){return _0x44d0b1;});}return null;};}function removeEntity(_0x373ad2){return function(_0x538763){if(_0x538763){return _0x538763[_0xffd3('0x2a')]()[_0xffd3('0x16')](function(){var _0x4f4caf=_0x538763[_0xffd3('0x2b')]({'plain':!![]});var _0x23fd1f=_0xffd3('0x2c');return db[_0xffd3('0x2d')][_0xffd3('0x2a')]({'where':{'type':_0x23fd1f,'resourceId':_0x4f4caf['id']}})[_0xffd3('0x16')](function(){return _0x538763;});})[_0xffd3('0x16')](function(){_0x373ad2[_0xffd3('0x27')](0xcc)[_0xffd3('0x2e')]();});}};}function handleEntityNotFound(_0x8b72b){return function(_0x3c7013){if(!_0x3c7013){_0x8b72b[_0xffd3('0x2f')](0x194);}return _0x3c7013;};}function handleError(_0x56bdef,_0x22b30c){_0x22b30c=_0x22b30c||0x1f4;return function(_0x52f254){logger['error'](_0x52f254[_0xffd3('0x30')]);if(_0x52f254[_0xffd3('0x31')]){delete _0x52f254[_0xffd3('0x31')];}_0x56bdef[_0xffd3('0x27')](_0x22b30c)[_0xffd3('0x32')](_0x52f254);};}exports[_0xffd3('0x33')]=function(_0x196c8e,_0x5138dd){var _0x269c5f={'include':[{'model':db[_0xffd3('0x34')],'as':_0xffd3('0x35')}]},_0x2aed03={},_0x94c05c={'count':0x0,'rows':[]};var _0x5bb4a2=_[_0xffd3('0x36')](db['ChatWebsite'][_0xffd3('0x37')],function(_0x31dcb7){return{'name':_0x31dcb7['fieldName'],'type':_0x31dcb7[_0xffd3('0x38')]['key']};});_0x2aed03[_0xffd3('0x39')]=_[_0xffd3('0x36')](_0x5bb4a2,_0xffd3('0x31'));_0x2aed03['query']=_[_0xffd3('0x3a')](_0x196c8e[_0xffd3('0x3b')]);_0x2aed03[_0xffd3('0x3c')]=_[_0xffd3('0x3d')](_0x2aed03['model'],_0x2aed03[_0xffd3('0x3b')]);_0x269c5f[_0xffd3('0x3e')]=_[_0xffd3('0x3d')](_0x2aed03[_0xffd3('0x39')],qs[_0xffd3('0x3f')](_0x196c8e[_0xffd3('0x3b')][_0xffd3('0x3f')]));_0x269c5f[_0xffd3('0x3e')]=_0x269c5f['attributes'][_0xffd3('0x40')]?_0x269c5f[_0xffd3('0x3e')]:_0x2aed03[_0xffd3('0x39')];if(!_0x196c8e[_0xffd3('0x3b')][_0xffd3('0x41')](_0xffd3('0x42'))){_0x269c5f[_0xffd3('0x24')]=qs[_0xffd3('0x24')](_0x196c8e[_0xffd3('0x3b')][_0xffd3('0x24')]);_0x269c5f[_0xffd3('0x26')]=qs[_0xffd3('0x26')](_0x196c8e['query'][_0xffd3('0x26')]);}_0x269c5f[_0xffd3('0x43')]=qs[_0xffd3('0x44')](_0x196c8e[_0xffd3('0x3b')]['sort']);_0x269c5f[_0xffd3('0x45')]=qs[_0xffd3('0x3c')](_[_0xffd3('0x46')](_0x196c8e['query'],_0x2aed03[_0xffd3('0x3c')]),_0x5bb4a2);if(_0x196c8e[_0xffd3('0x3b')][_0xffd3('0x47')]){_0x269c5f[_0xffd3('0x45')]=_[_0xffd3('0x48')](_0x269c5f[_0xffd3('0x45')],{'$or':_[_0xffd3('0x36')](_0x5bb4a2,function(_0x24eeb8){if(_0x24eeb8[_0xffd3('0x38')]!=='VIRTUAL'){var _0x42c442={};_0x42c442[_0x24eeb8[_0xffd3('0x31')]]={'$like':'%'+_0x196c8e[_0xffd3('0x3b')]['filter']+'%'};return _0x42c442;}})});}_0x269c5f=_['merge']({},_0x269c5f,_0x196c8e[_0xffd3('0x49')]);var _0x4bf298={'where':_0x269c5f[_0xffd3('0x45')]};return db[_0xffd3('0x4a')][_0xffd3('0x25')](_0x4bf298)[_0xffd3('0x16')](function(_0x325d98){_0x94c05c[_0xffd3('0x25')]=_0x325d98;if(_0x196c8e[_0xffd3('0x3b')][_0xffd3('0x4b')]){_0x269c5f['include']=[{'all':!![]}];}return db[_0xffd3('0x4a')]['findAll'](_0x269c5f);})['then'](function(_0x1ce11d){_0x94c05c[_0xffd3('0x4c')]=_0x1ce11d;return _0x94c05c;})[_0xffd3('0x16')](respondWithFilteredResult(_0x5138dd,_0x269c5f))[_0xffd3('0x21')](handleError(_0x5138dd,null));};exports[_0xffd3('0x4d')]=function(_0x427446,_0x289fc2){var _0x384886={'raw':![],'where':{'id':_0x427446['params']['id']},'include':[{'model':db[_0xffd3('0x34')],'as':_0xffd3('0x35')}]},_0x50829e={};_0x50829e[_0xffd3('0x39')]=_[_0xffd3('0x3a')](db['ChatWebsite'][_0xffd3('0x37')]);_0x50829e[_0xffd3('0x3b')]=_[_0xffd3('0x3a')](_0x427446[_0xffd3('0x3b')]);_0x50829e[_0xffd3('0x3c')]=_[_0xffd3('0x3d')](_0x50829e[_0xffd3('0x39')],_0x50829e[_0xffd3('0x3b')]);_0x384886['attributes']=_[_0xffd3('0x3d')](_0x50829e[_0xffd3('0x39')],qs[_0xffd3('0x3f')](_0x427446[_0xffd3('0x3b')][_0xffd3('0x3f')]));_0x384886[_0xffd3('0x3e')]=_0x384886[_0xffd3('0x3e')][_0xffd3('0x40')]?_0x384886[_0xffd3('0x3e')]:_0x50829e[_0xffd3('0x39')];if(_0x427446[_0xffd3('0x3b')][_0xffd3('0x4b')]){_0x384886[_0xffd3('0x4e')]=[{'all':!![]}];}_0x384886=_[_0xffd3('0x48')]({},_0x384886,_0x427446[_0xffd3('0x49')]);return db[_0xffd3('0x4a')][_0xffd3('0x4f')](_0x384886)[_0xffd3('0x16')](handleEntityNotFound(_0x289fc2,null))[_0xffd3('0x16')](respondWithResult(_0x289fc2,null))[_0xffd3('0x21')](handleError(_0x289fc2,null));};exports[_0xffd3('0x50')]=function(_0x54d41e,_0x2a71fe){return db[_0xffd3('0x4a')][_0xffd3('0x50')](_0x54d41e['body'],{})[_0xffd3('0x16')](function(_0x3e2a48){var _0x58b63c=_0x54d41e['user'][_0xffd3('0x2b')]({'plain':!![]});if(!_0x58b63c)throw new Error(_0xffd3('0x51'));if(_0x58b63c[_0xffd3('0x52')]===_0xffd3('0x53')){var _0x31876d=_0x3e2a48[_0xffd3('0x2b')]({'plain':!![]});var _0xcaf054=_0xffd3('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0xcaf054,'userProfileId':_0x58b63c[_0xffd3('0x54')]},'raw':!![]})['then'](function(_0x4e983d){if(_0x4e983d&&_0x4e983d[_0xffd3('0x55')]===0x0){return db['UserProfileResource'][_0xffd3('0x50')]({'name':_0x31876d[_0xffd3('0x31')],'resourceId':_0x31876d['id'],'type':_0x4e983d[_0xffd3('0x31')],'sectionId':_0x4e983d['id']},{})[_0xffd3('0x16')](function(){return _0x3e2a48;});}else{return _0x3e2a48;}})[_0xffd3('0x21')](function(_0x482c00){logger[_0xffd3('0x1c')](_0xffd3('0x56'),_0x482c00);throw _0x482c00;});}return _0x3e2a48;})[_0xffd3('0x16')](respondWithResult(_0x2a71fe,0xc9))[_0xffd3('0x21')](handleError(_0x2a71fe,null));};exports[_0xffd3('0x29')]=function(_0x51005c,_0x347fbe){if(_0x51005c[_0xffd3('0x57')]['id']){delete _0x51005c['body']['id'];}return db[_0xffd3('0x4a')][_0xffd3('0x4f')]({'where':{'id':_0x51005c['params']['id']},'include':[{'model':db[_0xffd3('0x34')],'as':'mandatoryDispositionPause'}]})[_0xffd3('0x16')](handleEntityNotFound(_0x347fbe,null))['then'](saveUpdates(_0x51005c[_0xffd3('0x57')],null))[_0xffd3('0x16')](respondWithResult(_0x347fbe,null))['catch'](handleError(_0x347fbe,null));};exports['destroy']=function(_0x71fa62,_0x2b1dc8){return db[_0xffd3('0x4a')][_0xffd3('0x4f')]({'where':{'id':_0x71fa62[_0xffd3('0x58')]['id']}})['then'](handleEntityNotFound(_0x2b1dc8,null))[_0xffd3('0x16')](removeEntity(_0x2b1dc8,null))['catch'](handleError(_0x2b1dc8,null));};exports['describe']=function(_0x545867,_0x3f77b3){return db[_0xffd3('0x4a')]['describe']()[_0xffd3('0x16')](respondWithResult(_0x3f77b3,null))[_0xffd3('0x21')](handleError(_0x3f77b3,null));};exports[_0xffd3('0x59')]=function(_0x1af42e,_0x4b026e){if(_0x1af42e[_0xffd3('0x57')]['id']){delete _0x1af42e[_0xffd3('0x57')]['id'];}return db[_0xffd3('0x4a')][_0xffd3('0x4f')]({'where':{'id':_0x1af42e[_0xffd3('0x58')]['id']}})[_0xffd3('0x16')](handleEntityNotFound(_0x4b026e,null))[_0xffd3('0x16')](function(_0x26c0f3){if(_0x26c0f3){_0x1af42e[_0xffd3('0x57')][_0xffd3('0x5a')]=_0x26c0f3['id'];return db[_0xffd3('0x5b')][_0xffd3('0x50')](_0x1af42e[_0xffd3('0x57')]);}})[_0xffd3('0x16')](respondWithResult(_0x4b026e,null))['catch'](handleError(_0x4b026e,null));};exports[_0xffd3('0x5c')]=function(_0x22b072,_0x5120ff){var _0x35d813={'raw':![],'where':{}};var _0x37a6ad={};var _0x4c784a={'count':0x0,'rows':[]};return db[_0xffd3('0x4a')][_0xffd3('0x5d')]({'where':{'id':_0x22b072[_0xffd3('0x58')]['id']}})['then'](handleEntityNotFound(_0x5120ff,null))[_0xffd3('0x16')](function(_0x3d777b){if(_0x3d777b){_0x37a6ad[_0xffd3('0x39')]=_[_0xffd3('0x3a')](db[_0xffd3('0x5b')][_0xffd3('0x37')]);_0x37a6ad[_0xffd3('0x3b')]=_['keys'](_0x22b072[_0xffd3('0x3b')]);_0x37a6ad[_0xffd3('0x3c')]=_[_0xffd3('0x3d')](_0x37a6ad[_0xffd3('0x39')],_0x37a6ad[_0xffd3('0x3b')]);_0x35d813['attributes']=_[_0xffd3('0x3d')](_0x37a6ad[_0xffd3('0x39')],qs['fields'](_0x22b072['query']['fields']));_0x35d813[_0xffd3('0x3e')]=_0x35d813[_0xffd3('0x3e')][_0xffd3('0x40')]?_0x35d813[_0xffd3('0x3e')]:_0x37a6ad[_0xffd3('0x39')];if(!_0x22b072['query'][_0xffd3('0x41')](_0xffd3('0x42'))){_0x35d813[_0xffd3('0x24')]=qs[_0xffd3('0x24')](_0x22b072[_0xffd3('0x3b')][_0xffd3('0x24')]);_0x35d813[_0xffd3('0x26')]=qs[_0xffd3('0x26')](_0x22b072[_0xffd3('0x3b')][_0xffd3('0x26')]);}_0x35d813[_0xffd3('0x43')]=qs['sort'](_0x22b072[_0xffd3('0x3b')][_0xffd3('0x44')]);_0x35d813[_0xffd3('0x45')]=qs[_0xffd3('0x3c')](_[_0xffd3('0x46')](_0x22b072['query'],_0x37a6ad[_0xffd3('0x3c')]));_0x35d813[_0xffd3('0x45')][_0xffd3('0x5a')]=_0x3d777b['id'];if(_0x22b072[_0xffd3('0x3b')]['filter']){_0x35d813[_0xffd3('0x45')]=_[_0xffd3('0x48')](_0x35d813['where'],{'$or':_[_0xffd3('0x36')](_0x35d813['attributes'],function(_0x43e80c){var _0x3e8fe8={};_0x3e8fe8[_0x43e80c]={'$like':'%'+_0x22b072['query'][_0xffd3('0x47')]+'%'};return _0x3e8fe8;})});}_0x35d813=_[_0xffd3('0x48')]({},_0x35d813,_0x22b072['options']);return db['Disposition'][_0xffd3('0x25')]({'where':_0x35d813[_0xffd3('0x45')]})[_0xffd3('0x16')](function(_0x3331ca){_0x4c784a[_0xffd3('0x25')]=_0x3331ca;if(_0x22b072['query'][_0xffd3('0x4b')]){_0x35d813['include']=[{'all':!![]}];}return db[_0xffd3('0x5b')][_0xffd3('0x5e')](_0x35d813);})['then'](function(_0xe3c080){_0x4c784a[_0xffd3('0x4c')]=_0xe3c080;return _0x4c784a;});}})[_0xffd3('0x16')](respondWithFilteredResult(_0x5120ff,_0x35d813))[_0xffd3('0x21')](handleError(_0x5120ff,null));};exports['removeDispositions']=function(_0x6acee6,_0x4950e7){return db[_0xffd3('0x4a')][_0xffd3('0x4f')]({'where':{'id':_0x6acee6[_0xffd3('0x58')]['id']}})[_0xffd3('0x16')](handleEntityNotFound(_0x4950e7,null))[_0xffd3('0x16')](function(_0x448d86){if(_0x448d86){return _0x448d86[_0xffd3('0x5f')](_0x6acee6['query'][_0xffd3('0x60')]);}})[_0xffd3('0x16')](respondWithStatusCode(_0x4950e7,null))[_0xffd3('0x21')](handleError(_0x4950e7,null));};exports['addAnswer']=function(_0x211153,_0x3144f2){if(_0x211153[_0xffd3('0x57')]['id']){delete _0x211153[_0xffd3('0x57')]['id'];}return db[_0xffd3('0x4a')][_0xffd3('0x4f')]({'where':{'id':_0x211153[_0xffd3('0x58')]['id']}})[_0xffd3('0x16')](handleEntityNotFound(_0x3144f2,null))['then'](function(_0x5cce1f){if(_0x5cce1f){_0x211153[_0xffd3('0x57')][_0xffd3('0x5a')]=_0x5cce1f['id'];return db[_0xffd3('0x61')]['create'](_0x211153['body']);}})[_0xffd3('0x16')](respondWithResult(_0x3144f2,null))[_0xffd3('0x21')](handleError(_0x3144f2,null));};exports['getAnswers']=function(_0x191372,_0x4d171e){var _0x35f617={'raw':![],'where':{}};var _0x2f50c1={};var _0x4a2448={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xffd3('0x5d')]({'where':{'id':_0x191372[_0xffd3('0x58')]['id']}})[_0xffd3('0x16')](handleEntityNotFound(_0x4d171e,null))[_0xffd3('0x16')](function(_0xfb08b0){if(_0xfb08b0){_0x2f50c1['model']=_[_0xffd3('0x3a')](db['CannedAnswer'][_0xffd3('0x37')]);_0x2f50c1['query']=_[_0xffd3('0x3a')](_0x191372[_0xffd3('0x3b')]);_0x2f50c1['filters']=_[_0xffd3('0x3d')](_0x2f50c1['model'],_0x2f50c1['query']);_0x35f617['attributes']=_[_0xffd3('0x3d')](_0x2f50c1[_0xffd3('0x39')],qs[_0xffd3('0x3f')](_0x191372['query'][_0xffd3('0x3f')]));_0x35f617[_0xffd3('0x3e')]=_0x35f617[_0xffd3('0x3e')][_0xffd3('0x40')]?_0x35f617[_0xffd3('0x3e')]:_0x2f50c1['model'];if(!_0x191372[_0xffd3('0x3b')][_0xffd3('0x41')](_0xffd3('0x42'))){_0x35f617[_0xffd3('0x24')]=qs[_0xffd3('0x24')](_0x191372[_0xffd3('0x3b')]['limit']);_0x35f617[_0xffd3('0x26')]=qs[_0xffd3('0x26')](_0x191372[_0xffd3('0x3b')][_0xffd3('0x26')]);}_0x35f617[_0xffd3('0x43')]=qs[_0xffd3('0x44')](_0x191372[_0xffd3('0x3b')][_0xffd3('0x44')]);_0x35f617[_0xffd3('0x45')]=qs[_0xffd3('0x3c')](_[_0xffd3('0x46')](_0x191372[_0xffd3('0x3b')],_0x2f50c1['filters']));_0x35f617['where'][_0xffd3('0x5a')]=_0xfb08b0['id'];if(_0x191372[_0xffd3('0x3b')][_0xffd3('0x47')]){_0x35f617['where']=_[_0xffd3('0x48')](_0x35f617['where'],{'$or':_[_0xffd3('0x36')](_0x35f617['attributes'],function(_0x5903c8){var _0xbdf1a2={};_0xbdf1a2[_0x5903c8]={'$like':'%'+_0x191372[_0xffd3('0x3b')]['filter']+'%'};return _0xbdf1a2;})});}_0x35f617=_[_0xffd3('0x48')]({},_0x35f617,_0x191372[_0xffd3('0x49')]);return db[_0xffd3('0x61')][_0xffd3('0x25')]({'where':_0x35f617[_0xffd3('0x45')]})[_0xffd3('0x16')](function(_0x5c1653){_0x4a2448['count']=_0x5c1653;if(_0x191372[_0xffd3('0x3b')][_0xffd3('0x4b')]){_0x35f617[_0xffd3('0x4e')]=[{'all':!![]}];}return db['CannedAnswer'][_0xffd3('0x5e')](_0x35f617);})[_0xffd3('0x16')](function(_0x3ff678){_0x4a2448[_0xffd3('0x4c')]=_0x3ff678;return _0x4a2448;});}})['then'](respondWithFilteredResult(_0x4d171e,_0x35f617))['catch'](handleError(_0x4d171e,null));};exports[_0xffd3('0x62')]=function(_0x1e8407,_0x207f20){return db[_0xffd3('0x4a')][_0xffd3('0x4f')]({'where':{'id':_0x1e8407[_0xffd3('0x58')]['id']}})[_0xffd3('0x16')](handleEntityNotFound(_0x207f20,null))[_0xffd3('0x16')](function(_0x456217){if(_0x456217){return _0x456217[_0xffd3('0x62')](_0x1e8407['query']['ids']);}})[_0xffd3('0x16')](respondWithStatusCode(_0x207f20,null))[_0xffd3('0x21')](handleError(_0x207f20,null));};exports[_0xffd3('0x63')]=function(_0x4253e4,_0x3d329e){_0x4253e4[_0xffd3('0x57')][_0xffd3('0x64')]=_0x4253e4[_0xffd3('0x65')][_0xffd3('0x66')];return db['ChatWebsite'][_0xffd3('0x4f')]({'where':{'id':_0x4253e4['params']['id']}})[_0xffd3('0x16')](handleEntityNotFound(_0x3d329e,null))['then'](saveUpdates(_0x4253e4[_0xffd3('0x57')],null))['then'](respondWithResult(_0x3d329e,null))[_0xffd3('0x21')](handleError(_0x3d329e,null));};exports[_0xffd3('0x67')]=function(_0x315818,_0x5948c4){_0x315818[_0xffd3('0x57')][_0xffd3('0x68')]=_0x315818['file'][_0xffd3('0x66')];return db[_0xffd3('0x4a')][_0xffd3('0x4f')]({'where':{'id':_0x315818[_0xffd3('0x58')]['id']}})['then'](handleEntityNotFound(_0x5948c4,null))[_0xffd3('0x16')](saveUpdates(_0x315818[_0xffd3('0x57')],null))[_0xffd3('0x16')](respondWithResult(_0x5948c4,null))[_0xffd3('0x21')](handleError(_0x5948c4,null));};exports[_0xffd3('0x69')]=function(_0x494f11,_0x17398e){_0x494f11[_0xffd3('0x57')]['customerAvatar']=_0x494f11[_0xffd3('0x65')][_0xffd3('0x66')];return db['ChatWebsite'][_0xffd3('0x4f')]({'where':{'id':_0x494f11['params']['id']}})[_0xffd3('0x16')](handleEntityNotFound(_0x17398e,null))['then'](saveUpdates(_0x494f11[_0xffd3('0x57')],null))[_0xffd3('0x16')](respondWithResult(_0x17398e,null))['catch'](handleError(_0x17398e,null));};exports[_0xffd3('0x6a')]=function(_0x10c49f,_0x374da4){_0x10c49f[_0xffd3('0x57')][_0xffd3('0x6b')]=_0x10c49f[_0xffd3('0x65')]['filename'];return db[_0xffd3('0x4a')][_0xffd3('0x4f')]({'where':{'id':_0x10c49f['params']['id']}})['then'](handleEntityNotFound(_0x374da4,null))[_0xffd3('0x16')](saveUpdates(_0x10c49f[_0xffd3('0x57')],null))[_0xffd3('0x16')](respondWithResult(_0x374da4,null))[_0xffd3('0x21')](handleError(_0x374da4,null));};exports[_0xffd3('0x6c')]=function(_0x30b114,_0x2a361d){var _0x2a3209=path['join'](config[_0xffd3('0x6d')],'server/files/images/logos/default_logo.svg');var _0xf3cabd={'where':{'id':_0x30b114[_0xffd3('0x58')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0xa72cb9=![];return require(_0xffd3('0x6e'))['getLicense']()[_0xffd3('0x16')](function(_0x116d52){if(_0x116d52){_0xa72cb9=_0x116d52[_0xffd3('0x6f')];}})[_0xffd3('0x16')](function(){return db[_0xffd3('0x4a')][_0xffd3('0x4f')](_0xf3cabd);})['then'](handleEntityNotFound(_0x2a361d,null))[_0xffd3('0x16')](function(_0x59d9f6){if(_0x59d9f6){if(!_[_0xffd3('0x70')](_0x59d9f6[_0xffd3('0x64')])){if(fs[_0xffd3('0x71')](path['join'](config[_0xffd3('0x6d')],'server/files/images/logos/',_0x59d9f6[_0xffd3('0x64')]))&&_0xa72cb9){_0x2a3209=path[_0xffd3('0x72')](config['root'],_0xffd3('0x73'),_0x59d9f6['sitepic']);}}return _0x2a361d[_0xffd3('0x74')](_0x2a3209);}})[_0xffd3('0x21')](handleError(_0x2a361d,null));};exports[_0xffd3('0x75')]=function(_0x57d67a,_0xd1894a){var _0x1bad5a=path['join'](config['root'],'server/files/images/avatars/default_avatar.png');var _0x20d44c={'where':{'id':_0x57d67a[_0xffd3('0x58')]['id']},'attributes':['id',_0xffd3('0x68')],'raw':!![]};return db['ChatWebsite']['find'](_0x20d44c)[_0xffd3('0x16')](handleEntityNotFound(_0xd1894a,null))['then'](function(_0x49808f){if(_0x49808f){if(!_[_0xffd3('0x70')](_0x49808f[_0xffd3('0x68')])){if(fs[_0xffd3('0x71')](path['join'](config[_0xffd3('0x6d')],_0xffd3('0x76'),_0x49808f[_0xffd3('0x68')]))){_0x1bad5a=path[_0xffd3('0x72')](config[_0xffd3('0x6d')],_0xffd3('0x76'),_0x49808f[_0xffd3('0x68')]);}}return _0xd1894a['download'](_0x1bad5a);}})[_0xffd3('0x21')](handleError(_0xd1894a,null));};exports[_0xffd3('0x77')]=function(_0x826064,_0x454f56){var _0x459611=path['join'](config[_0xffd3('0x6d')],_0xffd3('0x78'));var _0x174583={'where':{'id':_0x826064[_0xffd3('0x58')]['id']},'attributes':['id',_0xffd3('0x79'),_0xffd3('0x7a')],'raw':!![]};return db[_0xffd3('0x4a')][_0xffd3('0x4f')](_0x174583)[_0xffd3('0x16')](handleEntityNotFound(_0x454f56,null))[_0xffd3('0x16')](function(_0x5694c8){if(_0x5694c8){if(!_[_0xffd3('0x70')](_0x5694c8['customerAvatar'])){if(fs['existsSync'](path['join'](config[_0xffd3('0x6d')],'server/files/images/avatars/',_0x5694c8[_0xffd3('0x79')]))&&_0x5694c8['showCustomerAvatar']){_0x459611=path[_0xffd3('0x72')](config[_0xffd3('0x6d')],_0xffd3('0x76'),_0x5694c8['customerAvatar']);}}return _0x454f56['download'](_0x459611);}})['catch'](handleError(_0x454f56,null));};exports[_0xffd3('0x7b')]=function(_0x312551,_0x4c5770){var _0x484256=path[_0xffd3('0x72')](config[_0xffd3('0x6d')],_0xffd3('0x7c'));var _0xa4a86b={'where':{'id':_0x312551[_0xffd3('0x58')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xffd3('0x4a')]['find'](_0xa4a86b)[_0xffd3('0x16')](handleEntityNotFound(_0x4c5770,null))[_0xffd3('0x16')](function(_0x329891){if(_0x329891){if(!_[_0xffd3('0x70')](_0x329891[_0xffd3('0x6b')])){if(fs[_0xffd3('0x71')](path['join'](config[_0xffd3('0x6d')],_0xffd3('0x76'),_0x329891['systemAvatar']))){_0x484256=path['join'](config[_0xffd3('0x6d')],_0xffd3('0x76'),_0x329891['systemAvatar']);}}return _0x4c5770['download'](_0x484256);}})[_0xffd3('0x21')](handleError(_0x4c5770,null));};exports[_0xffd3('0x7d')]=function(_0x36db55,_0xae7f86){var _0x5a1fdb=require(_0xffd3('0x7e'));var _0x1c4990=new _0x5a1fdb();var _0x29a3c6=_0x1c4990[_0xffd3('0x7f')](_0x36db55[_0xffd3('0x80')][_0xffd3('0x81')])[_0xffd3('0x82')]();var _0xe544d3={'body':_0x36db55[_0xffd3('0x57')],'channel':_0xffd3('0x83')};var _0x1baf32=[];var _0x317655=[];var _0x270dab={};var _0x3aa06b=![];return db['CmContact'][_0xffd3('0x84')]()['then'](function(_0xfe2a4b){if(!_0xfe2a4b){throw new db[(_0xffd3('0x85'))]['ValidationError'](_0xffd3('0x86'));}_0x1baf32=_['difference'](_[_0xffd3('0x3a')](_0xfe2a4b),[_0xffd3('0x87'),'updatedAt']);_0x317655=_[_0xffd3('0x88')](_[_0xffd3('0x3a')](_0xfe2a4b),[_0xffd3('0x87'),'updatedAt',_0xffd3('0x89'),_0xffd3('0x8a')]);if(_0x36db55[_0xffd3('0x57')]['id']){delete _0x36db55[_0xffd3('0x57')]['id'];}if(_[_0xffd3('0x70')](_0x36db55[_0xffd3('0x57')][_0xffd3('0x8b')])){throw new db[(_0xffd3('0x85'))][(_0xffd3('0x8c'))](_0xffd3('0x8d'));}if(_[_0xffd3('0x70')](_0x36db55['body'][_0xffd3('0x57')])||_0x36db55[_0xffd3('0x57')][_0xffd3('0x57')]===''){throw new db['Sequelize'][(_0xffd3('0x8c'))](_0xffd3('0x8e'));}if(_[_0xffd3('0x70')](_0x36db55[_0xffd3('0x57')][_0xffd3('0x8f')])){throw new db['Sequelize'][(_0xffd3('0x8c'))](_0xffd3('0x90')+_0x317655);}if(!_[_0xffd3('0x91')](_0x317655,_0x36db55[_0xffd3('0x57')][_0xffd3('0x8f')])){throw new db[(_0xffd3('0x85'))][(_0xffd3('0x8c'))](_0xffd3('0x92')+_0x317655);}_0x270dab[_0x36db55['body'][_0xffd3('0x8f')]]=_0x36db55[_0xffd3('0x57')][_0xffd3('0x8b')];})[_0xffd3('0x16')](function(){return db[_0xffd3('0x4a')]['find']({'where':{'id':_0x36db55['params']['id']},'include':[{'model':db[_0xffd3('0x93')],'as':'List','include':[{'model':db[_0xffd3('0x94')],'as':_0xffd3('0x95'),'where':_0x270dab,'limit':0x1,'order':[[_0xffd3('0x96'),_0xffd3('0x97')]]}]},{'model':db[_0xffd3('0x98')],'as':_0xffd3('0x99')}]});})[_0xffd3('0x16')](handleEntityNotFound(_0xae7f86,null))['then'](function(_0x3e677a){if(_0x3e677a&&_0x3e677a[_0xffd3('0x9a')]){_0xe544d3['account']=_0x3e677a;_0xe544d3['applications']=_0x3e677a[_0xffd3('0x99')];_0xe544d3[_0xffd3('0x9b')]=_0x3e677a['List'];_0xe544d3['applications']=_[_0xffd3('0x9c')](_0xe544d3[_0xffd3('0x9d')],[_0xffd3('0x9e')],[_0xffd3('0x9f')]);if(_0xe544d3[_0xffd3('0xa0')][_0xffd3('0x99')]){delete _0xe544d3[_0xffd3('0xa0')]['Applications'];}if(_0xe544d3[_0xffd3('0xa0')][_0xffd3('0x9a')]&&_0xe544d3['account']['List'][_0xffd3('0x95')][_0xffd3('0x40')]){return _0xe544d3[_0xffd3('0xa0')][_0xffd3('0x9a')][_0xffd3('0x95')][0x0];}var _0xcb38cf=_['defaults'](_0x36db55[_0xffd3('0x57')],{'firstName':_0x36db55[_0xffd3('0x57')][_0xffd3('0x8b')],'ListId':_0x3e677a['ListId']});_0xcb38cf[_0x36db55[_0xffd3('0x57')][_0xffd3('0x8f')]]=_0x36db55[_0xffd3('0x57')]['from'];return db[_0xffd3('0x94')][_0xffd3('0x50')](_0xcb38cf,{'fields':_0x1baf32,'raw':!![]});}})[_0xffd3('0x16')](handleEntityNotFound(_0xae7f86,null))[_0xffd3('0x16')](function(_0x21be35){_0xe544d3[_0xffd3('0xa1')]=_0x21be35;var _0x4d2f99=_0x36db55['body'][_0xffd3('0xa2')];if(_0x36db55['headers']['cf-connecting-ip']){_0x4d2f99=_0x36db55[_0xffd3('0x80')][_0xffd3('0xa3')];}else if(_0x36db55[_0xffd3('0x80')][_0xffd3('0xa4')]){_0x4d2f99=_[_0xffd3('0xa5')](_0x36db55[_0xffd3('0x80')][_0xffd3('0xa4')][_0xffd3('0xa6')](','));}if(_0x21be35){var _0x2dab30={'ContactId':_0x21be35['id'],'ChatWebsiteId':_0x36db55['params']['id'],'from':(_0x21be35[_0xffd3('0xa7')]||'')+'\x20'+(_0x21be35['lastName']||''),'customerIp':_0x4d2f99,'customerPort':_0x36db55[_0xffd3('0x80')][_0xffd3('0xa8')]?_0x36db55[_0xffd3('0x80')]['x-real-port']:null,'referer':_0x36db55['body']['referer'],'browserName':_0x29a3c6['browser'][_0xffd3('0x31')]&&_0x29a3c6[_0xffd3('0xa9')][_0xffd3('0xaa')]?util[_0xffd3('0xab')](_0xffd3('0xac'),_0x29a3c6[_0xffd3('0xa9')][_0xffd3('0x31')],_0x29a3c6[_0xffd3('0xa9')][_0xffd3('0xaa')]):_0xffd3('0xad'),'browserVersion':_0x29a3c6[_0xffd3('0xa9')]['version']||_0xffd3('0xad'),'osName':util[_0xffd3('0xab')](_0xffd3('0xac'),_0x29a3c6['os']['name'],_0x29a3c6['os'][_0xffd3('0xaa')]),'osVersion':_0x29a3c6['os'][_0xffd3('0xaa')],'deviceModel':_0x29a3c6[_0xffd3('0xae')][_0xffd3('0x39')]&&_0x29a3c6['device'][_0xffd3('0xaf')]?util[_0xffd3('0xab')](_0xffd3('0xb0'),_0x29a3c6[_0xffd3('0xae')][_0xffd3('0x39')],_0x29a3c6[_0xffd3('0xae')][_0xffd3('0xaf')],_0x29a3c6['device']['type']):null,'deviceVendor':_0x29a3c6['device'][_0xffd3('0xaf')],'deviceType':_0x29a3c6['device'][_0xffd3('0x38')],'formData':JSON[_0xffd3('0x1b')](_0x36db55[_0xffd3('0x57')])};var _0x196dce={'ChatWebsiteId':_0x36db55[_0xffd3('0x58')]['id'],'closed':![]};if(_0x36db55[_0xffd3('0x57')][_0xffd3('0xb1')]){_0x196dce[_0xffd3('0xb1')]=_0x36db55[_0xffd3('0x57')][_0xffd3('0xb1')];return db['ChatInteraction'][_0xffd3('0x4f')]({'where':_0x196dce})[_0xffd3('0x16')](function(_0x21c259){if(_0x21c259){return[_0x21c259,![]];}_0x2dab30[_0xffd3('0xb1')]=_0x36db55[_0xffd3('0x57')]['threadId'];_0x2dab30['externalUrl']=_0x36db55[_0xffd3('0x57')]['externalUrl'];return db[_0xffd3('0xb2')][_0xffd3('0x50')](_0x2dab30)[_0xffd3('0x16')](function(_0x50d909){return[_0x50d909,!![]];});});}_0x196dce[_0xffd3('0xb3')]=_0x21be35['id'];if(_0x36db55[_0xffd3('0x57')][_0xffd3('0xb4')]&&_0x36db55[_0xffd3('0x57')][_0xffd3('0xb4')]['id']){_0x196dce['id']=_0x36db55['body'][_0xffd3('0xb4')]['id'];return db[_0xffd3('0xb2')][_0xffd3('0x4f')]({'where':_0x196dce})[_0xffd3('0x16')](function(_0x261868){if(_0x261868){return[_0x261868,![]];}return db[_0xffd3('0xb2')][_0xffd3('0x50')](_0x2dab30)[_0xffd3('0x16')](function(_0x15be93){return[_0x15be93,!![]];});});}return db['ChatInteraction'][_0xffd3('0x50')](_0x2dab30)[_0xffd3('0x16')](function(_0x56b68d){return[_0x56b68d,!![]];});}})[_0xffd3('0xb5')](function(_0x1241c9,_0x29e285){if(_0x1241c9){_0x3aa06b=_0x29e285;if(!_0x29e285){var _0x215bb0={'from':(_0xe544d3['contact']['firstName']||'')+'\x20'+(_0xe544d3['contact'][_0xffd3('0xb6')]||'')};if(_0x36db55[_0xffd3('0x57')]['threadId']&&_0x36db55[_0xffd3('0x57')][_0xffd3('0xb7')]&&_0x36db55[_0xffd3('0x57')][_0xffd3('0xb1')]!=_0x36db55['body']['messageId']){_0x215bb0[_0xffd3('0xb1')]=_0x36db55[_0xffd3('0x57')]['messageId'];}return _0x1241c9['update'](_0x215bb0);}else{return _0x1241c9;}}})[_0xffd3('0x16')](function(_0x5cc610){_0xe544d3['interaction']=_0x5cc610[_0xffd3('0x2b')]({'plain':!![]});_0xe544d3['interaction'][_0xffd3('0xb8')]=_0x3aa06b;if(_0xe544d3['interaction'][_0xffd3('0xb8')]){if(_0xe544d3[_0xffd3('0xa0')]['autoclose']){_0xe544d3[_0xffd3('0x9d')][_0xffd3('0xb9')]({'id':0x0,'priority':_0xe544d3[_0xffd3('0x9d')][_0xffd3('0x40')]+0x1,'app':_0xffd3('0xba'),'appdata':_0xffd3('0xbb'),'interval':'*,*,*,*'});}}return db[_0xffd3('0xbc')][_0xffd3('0x50')]({'body':_0x36db55[_0xffd3('0x57')][_0xffd3('0x57')],'ChatWebsiteId':_0x36db55[_0xffd3('0x58')]['id'],'ChatInteractionId':_0x5cc610['id'],'direction':'in','ContactId':_0xe544d3[_0xffd3('0xa1')]['id'],'AttachmentId':_0x36db55[_0xffd3('0x57')]['AttachmentId']});})[_0xffd3('0x16')](function(_0x2ebf6c){_0xe544d3[_0xffd3('0x1e')]=_0x2ebf6c;if(_0xe544d3[_0xffd3('0xb4')][_0xffd3('0xbd')]){return db[_0xffd3('0xbe')][_0xffd3('0x4f')]({'attributes':['id',_0xffd3('0x31')],'where':{'id':_0xe544d3[_0xffd3('0xb4')]['UserId']}})[_0xffd3('0x16')](function(_0x2100ac){if(_0x2100ac){_0xe544d3[_0xffd3('0x9d')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2100ac['name']+','+(_0xe544d3[_0xffd3('0xa0')]['waitForTheAssignedAgent']||0xa),'interval':_0xffd3('0xbf')});_0xe544d3[_0xffd3('0xc0')]=!![];}return respondWithRpcPromise(_0xffd3('0xc1'),'startRouting',_0xe544d3);});}return respondWithRpcPromise(_0xffd3('0xc1'),'startRouting',_0xe544d3);})[_0xffd3('0x16')](function(_0x3b12d3){respondWithRpcPromise(_0xffd3('0xc2'),_0xffd3('0xc2'),{'event':_0xffd3('0x7d'),'message':_0x3b12d3},client9002);return _0x3b12d3;})[_0xffd3('0x16')](respondWithResult(_0xae7f86,null))[_0xffd3('0x21')](handleError(_0xae7f86,null));};exports['offline']=function(_0x1aea05,_0x2b2e91){var _0x1192cf,_0x2dc0d0,_0x42d925;var _0x2cc12b=[];var _0x5e43bc={};var _0xadf9ad=_0x1aea05[_0xffd3('0xc3')]||[];var _0x2f119f=[];var _0x570402;return db[_0xffd3('0x94')]['describe']()[_0xffd3('0x16')](function(_0x3d3441){if(!_0x3d3441){throw new db[(_0xffd3('0x85'))][(_0xffd3('0x8c'))](_0xffd3('0x86'));}_0x2cc12b=_[_0xffd3('0x88')](_[_0xffd3('0x3a')](_0x3d3441),[_0xffd3('0x87'),_0xffd3('0x96'),'CompanyId',_0xffd3('0x8a')]);if(_0x1aea05[_0xffd3('0x57')]['id']){delete _0x1aea05[_0xffd3('0x57')]['id'];}if(_[_0xffd3('0x70')](_0x1aea05[_0xffd3('0x57')][_0xffd3('0x8b')])){throw _0x2b2e91[_0xffd3('0x27')](0x1f4)[_0xffd3('0x32')](new db['Sequelize'][(_0xffd3('0x8c'))](_0xffd3('0x8d')));}if(_[_0xffd3('0x70')](_0x1aea05[_0xffd3('0x57')][_0xffd3('0x57')])||_0x1aea05['body'][_0xffd3('0x57')]===''){throw _0x2b2e91['status'](0x1f4)[_0xffd3('0x32')](new db['Sequelize'][(_0xffd3('0x8c'))](_0xffd3('0x8e')));}if(_[_0xffd3('0x70')](_0x1aea05[_0xffd3('0x57')]['mapKeyOffline'])){throw _0x2b2e91[_0xffd3('0x27')](0x1f4)[_0xffd3('0x32')](new db[(_0xffd3('0x85'))][(_0xffd3('0x8c'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2cc12b));}if(!_[_0xffd3('0x91')](_0x2cc12b,_0x1aea05[_0xffd3('0x57')][_0xffd3('0xc4')])){throw _0x2b2e91[_0xffd3('0x27')](0x1f4)[_0xffd3('0x32')](new db[(_0xffd3('0x85'))][(_0xffd3('0x8c'))](_0xffd3('0xc5')+_0x2cc12b));}_0x5e43bc[_0x1aea05[_0xffd3('0x57')]['mapKeyOffline']]=_0x1aea05['body']['from'];})['then'](function(){return db[_0xffd3('0x4a')][_0xffd3('0x4f')]({'where':{'id':_0x1aea05[_0xffd3('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0xffd3('0x9a')},{'model':db[_0xffd3('0xc6')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x2b2e91,null))[_0xffd3('0x16')](function(_0x3a0564){if(_0x3a0564&&_0x3a0564[_0xffd3('0x9a')]){_0x2dc0d0=_0x3a0564;var _0x2122ca=_[_0xffd3('0xc7')](_0x1aea05[_0xffd3('0x57')],{'firstName':_0x1aea05[_0xffd3('0x57')][_0xffd3('0x8b')],'phone':_0x1aea05[_0xffd3('0x57')][_0xffd3('0x8b')],'ListId':_0x3a0564[_0xffd3('0x8a')]});_0x2122ca[_0x1aea05[_0xffd3('0x57')]['mapKeyOffline']]=_0x1aea05['body']['from'];return db[_0xffd3('0x94')][_0xffd3('0xc8')]({'where':_0x5e43bc,'defaults':_0x2122ca});}})[_0xffd3('0xb5')](function(_0x543293){if(_0x543293){_0x42d925=_0x543293;var _0x477d1b=fs[_0xffd3('0xc9')](path[_0xffd3('0x72')](config[_0xffd3('0x6d')],_0xffd3('0xca')),_0xffd3('0xcb'));var _0x2ae805=ejs['render'](_0x477d1b,{'body':_[_0xffd3('0xcc')](_0x1aea05['body'][_0xffd3('0x57')]),'bodyTitle':_0x2dc0d0[_0xffd3('0xcd')]});return db[_0xffd3('0xce')][_0xffd3('0x50')]({'body':_0x2ae805,'plainBody':htmlToText['fromString'](_0x2ae805),'ContactId':_0x543293['id'],'ChatWebsiteId':_0x2dc0d0['id']});}})[_0xffd3('0x16')](function(_0x2b0e3e){_0x570402=_0x2b0e3e;if(_0xadf9ad['length']){var _0x5f34b2=_0xadf9ad[_0xffd3('0x36')](function(_0x5e29f1){return{'name':_0x5e29f1[_0xffd3('0xcf')],'basename':_0x5e29f1[_0xffd3('0x66')],'type':_0x5e29f1[_0xffd3('0xd0')],'ChatOfflineMessageId':_0x2b0e3e['id']};});_0x2f119f=_0x5f34b2[_0xffd3('0x36')](_0x424944=>{var _0x510bf3={'filename':_0x424944[_0xffd3('0x31')],'path':path[_0xffd3('0x72')](config[_0xffd3('0x6d')],_0xffd3('0xd1'),_0xffd3('0xc3'),_0xffd3('0xd2'),_0xffd3('0xd3'),_0x424944[_0xffd3('0xd4')])};return _0x510bf3;});if(!_0x2dc0d0[_0xffd3('0xd5')]){return db[_0xffd3('0xd6')][_0xffd3('0xd7')](function(_0x310bfd){return db[_0xffd3('0xd8')][_0xffd3('0xd9')](_0x5f34b2,{'transaction':_0x310bfd});});}}})['then'](function(){if(_0x570402){_0x1192cf=_0x570402;return db[_0xffd3('0xc6')][_0xffd3('0x5d')]({'where':{'service':!![]},'include':[{'model':db[_0xffd3('0xda')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xffd3('0xdb'),'raw':!![]}]}]});}})[_0xffd3('0x16')](function(_0x4885fd){if(_0x4885fd&&_0x4885fd[_0xffd3('0xdc')]&&_0x2dc0d0[_0xffd3('0xdd')]&&_0x2dc0d0[_0xffd3('0xde')]){var _0x4ef5f7=_0x4885fd[_0xffd3('0xdf')]();return respondWithRpcPromise(_0xffd3('0xe0'),_0xffd3('0xe1'),{'account':_0x4ef5f7,'message':{'from':util[_0xffd3('0xab')](_0xffd3('0xe2'),_0x4885fd['name'],_0x4885fd['email']||_0x4885fd[_0xffd3('0xdc')][_0xffd3('0x53')]),'to':_0x2dc0d0[_0xffd3('0xde')],'subject':_0x2dc0d0[_0xffd3('0xe3')],'html':_0x1192cf['body'],'attachments':_0x2f119f}},client9003)[_0xffd3('0x16')](function(){return _0x1192cf;})['catch'](function(_0x5df812){logger['error'](_0x5df812);});}})[_0xffd3('0x16')](function(){if(_0x2dc0d0&&_0x2dc0d0[_0xffd3('0xd5')]&&_0x2dc0d0['MailAccountId']){var _0xc2c1cb=[];if(_0xadf9ad[_0xffd3('0x40')]){_0xc2c1cb=_0xadf9ad[_0xffd3('0x36')](function(_0x1aaa03){return{'name':_0x1aaa03[_0xffd3('0xcf')],'basename':_0x1aaa03['filename'],'type':_0x1aaa03[_0xffd3('0xd0')],'ChatOfflineMessageId':_0x570402['id']};});}var _0x457e45;if(!_['isNil'](_0x2dc0d0[_0xffd3('0xe4')])){var _0x3b3f01=_[_0xffd3('0x36')](_0x1aea05[_0xffd3('0x57')],function(_0xbbc4ac){return _0xbbc4ac;});var _0x2abb68=_[_0xffd3('0xe5')](_0x3b3f01)[0x0];var _0x1355e6=_[_0xffd3('0xe6')](_0x2abb68,function(_0x5e5f89){return _0x5e5f89;});_0x457e45=_0x1355e6[0x1][_0x2dc0d0[_0xffd3('0xe4')]];}var _0x208df6={'from':_0x42d925[_0xffd3('0xe7')],'firstName':_0x42d925[_0xffd3('0xa7')],'lastName':_0x42d925[_0xffd3('0xb6')],'mapKey':'email','message':{'from':_0x42d925[_0xffd3('0xe7')],'to':_0x2dc0d0['MailAccount']['email'],'cc':'','subject':_[_0xffd3('0x70')](_0x457e45)?_0x2dc0d0[_0xffd3('0xe3')]:_0x457e45,'messageId':'','sentAt':new Date(),'attach':_0xc2c1cb[_0xffd3('0x40')],'attachments':_0xc2c1cb,'originChannel':_0xffd3('0xe8'),'ChatWebsiteId':_0x2dc0d0['id'],'ChatOfflineMessageId':_0x1192cf['id'],'originTo':_0x2dc0d0['MailAccount'][_0xffd3('0xe7')]},'body':_0x1192cf[_0xffd3('0x57')]};var _0x5697ad={'account':{'id':_0x2dc0d0[_0xffd3('0xe9')]},'body':_0x208df6,'log':_0xffd3('0xea')};return respondWithRpcPromise(_0xffd3('0xea'),_0xffd3('0xeb'),_0x5697ad,client9001)[_0xffd3('0x16')](function(){return _0x1192cf;})[_0xffd3('0x21')](function(_0x333177){logger[_0xffd3('0x1c')](_0x333177);});}return;})['then'](function(){if(_0x1192cf){return _0x1192cf;}})['then'](respondWithResult(_0x2b2e91,null))[_0xffd3('0x21')](function(_0x477c66){logger[_0xffd3('0x1c')](_0xffd3('0x21'),_0x477c66);for(var _0x2c151f of _0xadf9ad){var _0x5952d1=path['join'](config[_0xffd3('0x6d')],_0xffd3('0xd1'),_0xffd3('0xc3'),'attachments','offline-chat',_0x2c151f[_0xffd3('0x66')]);fs_extra['remove'](_0x5952d1)['catch'](function(_0x13eefd){logger['error'](_0xffd3('0xec'),_0x5952d1,_0x13eefd);});}});};exports['addInteraction']=function(_0x3e4e93,_0x52ba84){return db['ChatInteraction'][_0xffd3('0x4f')]({'where':{'id':_0x3e4e93[_0xffd3('0x58')]['id']}})[_0xffd3('0x16')](handleEntityNotFound(_0x52ba84,null))[_0xffd3('0x16')](function(_0x1a8559){if(_0x1a8559){return _0x1a8559[_0xffd3('0xed')](_0x3e4e93[_0xffd3('0x57')]['ids'],_['omit'](_0x3e4e93['body'],[_0xffd3('0x60'),'id'])||{});}})[_0xffd3('0x16')](respondWithResult(_0x52ba84,null))['catch'](handleError(_0x52ba84,null));};exports[_0xffd3('0xee')]=function(_0x48dad1,_0x23b431){var _0x429620={'raw':![],'where':{}};var _0x3c8283={};var _0x4480d5={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xffd3('0x5d')]({'where':{'id':_0x48dad1[_0xffd3('0x58')]['id']}})[_0xffd3('0x16')](handleEntityNotFound(_0x23b431,null))['then'](function(_0xcaab32){if(_0xcaab32){_0x3c8283[_0xffd3('0x39')]=_[_0xffd3('0x3a')](db[_0xffd3('0xb2')][_0xffd3('0x37')]);_0x3c8283[_0xffd3('0x3b')]=_[_0xffd3('0x3a')](_0x48dad1[_0xffd3('0x3b')]);_0x3c8283[_0xffd3('0x3c')]=_[_0xffd3('0x3d')](_0x3c8283['model'],_0x3c8283[_0xffd3('0x3b')]);_0x429620[_0xffd3('0x3e')]=_[_0xffd3('0x3d')](_0x3c8283[_0xffd3('0x39')],qs[_0xffd3('0x3f')](_0x48dad1[_0xffd3('0x3b')][_0xffd3('0x3f')]));_0x429620[_0xffd3('0x3e')]=_0x429620['attributes'][_0xffd3('0x40')]?_0x429620[_0xffd3('0x3e')]:_0x3c8283['model'];if(!_0x48dad1[_0xffd3('0x3b')][_0xffd3('0x41')](_0xffd3('0x42'))){_0x429620[_0xffd3('0x24')]=qs[_0xffd3('0x24')](_0x48dad1['query']['limit']);_0x429620[_0xffd3('0x26')]=qs[_0xffd3('0x26')](_0x48dad1[_0xffd3('0x3b')]['offset']);}_0x429620['order']=qs[_0xffd3('0x44')](_0x48dad1[_0xffd3('0x3b')][_0xffd3('0x44')]);_0x429620[_0xffd3('0x45')]=qs[_0xffd3('0x3c')](_[_0xffd3('0x46')](_0x48dad1[_0xffd3('0x3b')],_0x3c8283[_0xffd3('0x3c')]));_0x429620[_0xffd3('0x45')]['ChatWebsiteId']=_0xcaab32['id'];if(_0x48dad1['query'][_0xffd3('0x47')]){_0x429620[_0xffd3('0x45')]=_[_0xffd3('0x48')](_0x429620[_0xffd3('0x45')],{'$or':_['map'](_0x429620[_0xffd3('0x3e')],function(_0x2231a7){var _0x15054f={};_0x15054f[_0x2231a7]={'$like':'%'+_0x48dad1[_0xffd3('0x3b')][_0xffd3('0x47')]+'%'};return _0x15054f;})});}_0x429620=_[_0xffd3('0x48')]({},_0x429620,_0x48dad1[_0xffd3('0x49')]);return db['ChatInteraction'][_0xffd3('0x25')]({'where':_0x429620['where']})[_0xffd3('0x16')](function(_0x411908){_0x4480d5[_0xffd3('0x25')]=_0x411908;if(_0x48dad1['query'][_0xffd3('0x4b')]){_0x429620[_0xffd3('0x4e')]=[{'model':db[_0xffd3('0x94')],'as':'Contact','required':![]},{'model':db[_0xffd3('0xbe')],'as':'Owner','attributes':[_0xffd3('0x31'),_0xffd3('0xef'),_0xffd3('0xf0')],'required':![]},{'model':db[_0xffd3('0xf1')],'as':_0xffd3('0xf2'),'attributes':['id',_0xffd3('0x31'),_0xffd3('0xf3')],'where':_0x48dad1['query'][_0xffd3('0xf4')]?{'id':_0x48dad1['query']['tag']}:undefined,'required':_0x48dad1[_0xffd3('0x3b')]['tag']?!![]:![]}];}return db[_0xffd3('0xb2')][_0xffd3('0x5e')](_0x429620);})[_0xffd3('0x16')](function(_0x1529ec){_0x4480d5[_0xffd3('0x4c')]=_0x1529ec;return _0x4480d5;});}})[_0xffd3('0x16')](respondWithFilteredResult(_0x23b431,_0x429620))[_0xffd3('0x21')](handleError(_0x23b431,null));};function iftimePromise(_0x1b958d,_0x291e08){return respondWithRpcPromise(_0xffd3('0xf5'),_0xffd3('0xf6'),{'command':_0x291e08['timezone']?util[_0xffd3('0xab')]('iftime\x20%s,%s',_0x1b958d[_0xffd3('0xf7')],_0x291e08[_0xffd3('0xf8')]):util[_0xffd3('0xab')](_0xffd3('0xf9'),_0x1b958d[_0xffd3('0xf7')])},client9002)[_0xffd3('0x16')](function(_0x29d131){var _0x56807b=_0x29d131&&_0x29d131[_0xffd3('0xfa')]('true')>=0x0?!![]:![];logger[_0xffd3('0x1f')](_0xffd3('0xfb'),_0x291e08['id'],_0x1b958d['id'],_0x1b958d[_0xffd3('0xf7')],_0x56807b?_0xffd3('0xfc'):'OFFLINE',_0x291e08[_0xffd3('0xf8')]?_0x291e08[_0xffd3('0xf8')]:'No\x20timezone');return _0x56807b;})[_0xffd3('0x21')](function(_0x1167fc){logger[_0xffd3('0x1c')](_0xffd3('0xfb'),_0x291e08['id'],_0x1b958d['id'],_0x1b958d['interval'],util[_0xffd3('0xfd')](_0x1167fc,{'showHidden':![],'depth':null}),_0x291e08[_0xffd3('0xf8')]?_0x291e08[_0xffd3('0xf8')]:_0xffd3('0xfe'));return![];});}exports[_0xffd3('0xf6')]=function(_0x1d31d7,_0x5dee92){var _0x535f23=0x0;var _0x12c0fa=0x0;var _0xb77e37=![];var _0xab97b;var _0x4cd16b;return db[_0xffd3('0x4a')][_0xffd3('0x4f')]({'where':{'id':_0x1d31d7['params']['id']},'include':[{'model':db[_0xffd3('0xff')],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xffd3('0xf7')],'raw':!![]}]}]})[_0xffd3('0x16')](handleEntityNotFound(_0x5dee92,null))[_0xffd3('0x16')](function(_0xe6c4e4){if(_0xe6c4e4){_0xab97b=_0xe6c4e4;return _0xe6c4e4[_0xffd3('0x100')]({'raw':!![]});}})[_0xffd3('0x16')](function(_0x36cb70){if(_0xab97b){if(_0x36cb70){_0x4cd16b=_0x36cb70;}}return require('../../config/license/util')['getLicense']();})[_0xffd3('0x16')](function(_0x38726f){if(_0x38726f){_0x12c0fa=_0x38726f[_0xffd3('0x101')];_0xb77e37=_0x38726f[_0xffd3('0x6f')];}})[_0xffd3('0x16')](function(){return db[_0xffd3('0xb2')][_0xffd3('0x25')]({'where':{'closed':![]}});})[_0xffd3('0x16')](function(_0x4eda1c){_0x535f23=_0x4eda1c;if(_0x12c0fa&&_0x4eda1c>_0x12c0fa){return db[_0xffd3('0x102')]['findOne']({'where':{'id':0x1}})[_0xffd3('0x16')](function(_0x2c3f59){if(_0x2c3f59){_0x2c3f59[_0xffd3('0x103')](_0xffd3('0x104'));}});}})[_0xffd3('0x16')](function(){if(_0xab97b[_0xffd3('0xff')]&&_0xab97b[_0xffd3('0xff')]['Intervals']){var _0x17067a=[];for(var _0x4a4c30=0x0;_0x4a4c30<_0xab97b[_0xffd3('0xff')][_0xffd3('0x105')][_0xffd3('0x40')];_0x4a4c30++){var _0x5f2e20=_0xab97b[_0xffd3('0xff')]['Intervals'][_0x4a4c30][_0xffd3('0x2b')]({'plain':!![]});_0x17067a[_0xffd3('0xb9')](iftimePromise(_0x5f2e20,_0xab97b));}return BPromise[_0xffd3('0x106')](_0x17067a)[_0xffd3('0x16')](function(_0x37f499){return _[_0xffd3('0x107')](_0x37f499);});}else{return!![];}})[_0xffd3('0x16')](function(_0x4a684d){var _0x3465fe=fs[_0xffd3('0xc9')](path[_0xffd3('0x72')](config['root'],_0xffd3('0x108')),_0xffd3('0xcb'));var _0x355e0d={'remote':_0xab97b[_0xffd3('0x109')],'query':querystring[_0xffd3('0x1b')](_['merge'](_0xab97b[_0xffd3('0x2b')]({'plain':!![]}),{'customerIp':_0x1d31d7[_0xffd3('0x80')][_0xffd3('0xa4')]||_0x1d31d7['headers'][_0xffd3('0x10a')]||_0x1d31d7[_0xffd3('0x10b')][_0xffd3('0x10c')]||_0x1d31d7['ip'],'referer':_0x1d31d7[_0xffd3('0x80')]['referer'],'openedInteractions':_0x535f23,'maxInteractions':_0x12c0fa,'virtual':_0xb77e37[_0xffd3('0x101')],'online':_0x4a684d,'custom':_0xb77e37}))[_0xffd3('0x10d')](/'/g,'\x5c\x27')};_0x5dee92[_0xffd3('0x32')](ejs[_0xffd3('0x10e')](Mustache[_0xffd3('0x10e')](_0x3465fe,_0x355e0d),{'proactiveActions':_0x4cd16b,'alignment':_0xab97b['alignment'],'verticalAlignment':_0xab97b[_0xffd3('0x10f')],'div_color':_0xab97b['color'],'labelText':_0xab97b['labelText'],'text_color':_0xab97b[_0xffd3('0x110')],'text_button_color':_0xab97b['textButtonColor'],'button_color':_0xab97b[_0xffd3('0x111')],'background_color':_0xab97b[_0xffd3('0x112')],'hideWhenOffline':_0xab97b[_0xffd3('0x113')],'interval':_0xab97b[_0xffd3('0x114')]}));})[_0xffd3('0x21')](handleError(_0x5dee92,null));};exports[_0xffd3('0x115')]=function(_0x1ec3a5,_0x19bfe8){var _0x54e044=_0x1ec3a5['params']['id'];var _0x4705ce=_0x1ec3a5[_0xffd3('0x57')];var _0xfcc31b=0xc8;var _0x1d7cbb=null;return db['sequelize'][_0xffd3('0xd7')]({'isolationLevel':db['sequelize']['Transaction'][_0xffd3('0x116')]['READ_COMMITTED']},function(_0x22fd7a){return db[_0xffd3('0x4a')][_0xffd3('0x5d')]({'where':{'id':_0x54e044},'transaction':_0x22fd7a})[_0xffd3('0x16')](function(_0x5b6ff5){if(_0x5b6ff5){return db[_0xffd3('0x98')][_0xffd3('0x2a')]({'where':{'ChatWebsiteId':_0x54e044},'transaction':_0x22fd7a})[_0xffd3('0x16')](function(){var _0x1dd3dd=_[_0xffd3('0x36')](_0x4705ce,function(_0x41ebb6){_0x41ebb6['ChatWebsiteId']=_0x54e044;return _0x41ebb6;});return db[_0xffd3('0x98')][_0xffd3('0xd9')](_0x1dd3dd,{'transaction':_0x22fd7a});});}else{_0xfcc31b=0x194;_0x1d7cbb=[];}});})[_0xffd3('0x16')](function(){if(_0xfcc31b!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x54e044},'order':'priority'})[_0xffd3('0x16')](function(_0x3b207e){_0x1d7cbb=_0x3b207e;});}})['catch'](function(_0x4d68d5){_0xfcc31b=0x1f4;logger[_0xffd3('0x1c')](_0x4d68d5[_0xffd3('0x30')]);if(_0x4d68d5[_0xffd3('0x31')]){delete _0x4d68d5[_0xffd3('0x31')];}_0x1d7cbb=_0x4d68d5;})[_0xffd3('0x117')](function(){if(_0x1d7cbb===null){_0x19bfe8[_0xffd3('0x2f')](_0xfcc31b);}else{if(_0xfcc31b===0x1f4){_0x19bfe8['status'](_0xfcc31b)['send'](_0x1d7cbb);}else{_0x19bfe8[_0xffd3('0x27')](_0xfcc31b)[_0xffd3('0x22')](_0x1d7cbb);}}});};exports[_0xffd3('0x118')]=function(_0x89ff02,_0x4b970e){var _0x2e0108={};var _0x1ea61e={};var _0x365cf6;var _0x480c1f;return db[_0xffd3('0x4a')][_0xffd3('0x5d')]({'where':{'id':_0x89ff02['params']['id']}})['then'](handleEntityNotFound(_0x4b970e,null))['then'](function(_0x4aa046){if(_0x4aa046){_0x365cf6=_0x4aa046;_0x1ea61e[_0xffd3('0x39')]=_[_0xffd3('0x3a')](db['ChatApplication'][_0xffd3('0x37')]);_0x1ea61e['query']=_[_0xffd3('0x3a')](_0x89ff02[_0xffd3('0x3b')]);_0x1ea61e[_0xffd3('0x3c')]=_[_0xffd3('0x3d')](_0x1ea61e[_0xffd3('0x39')],_0x1ea61e[_0xffd3('0x3b')]);_0x2e0108[_0xffd3('0x3e')]=_[_0xffd3('0x3d')](_0x1ea61e[_0xffd3('0x39')],qs[_0xffd3('0x3f')](_0x89ff02[_0xffd3('0x3b')][_0xffd3('0x3f')]));_0x2e0108[_0xffd3('0x3e')]=_0x2e0108[_0xffd3('0x3e')]['length']?_0x2e0108[_0xffd3('0x3e')]:_0x1ea61e[_0xffd3('0x39')];_0x2e0108['order']=qs[_0xffd3('0x44')](_0x89ff02[_0xffd3('0x3b')][_0xffd3('0x44')]);_0x2e0108['where']=qs['filters'](_[_0xffd3('0x46')](_0x89ff02[_0xffd3('0x3b')],_0x1ea61e[_0xffd3('0x3c')]));if(_0x89ff02[_0xffd3('0x3b')][_0xffd3('0x47')]){_0x2e0108[_0xffd3('0x45')]=_[_0xffd3('0x48')](_0x2e0108['where'],{'$or':_[_0xffd3('0x36')](_0x2e0108['attributes'],function(_0x21b6fd){var _0x3958a9={};_0x3958a9[_0x21b6fd]={'$like':'%'+_0x89ff02[_0xffd3('0x3b')][_0xffd3('0x47')]+'%'};return _0x3958a9;})});}_0x2e0108=_[_0xffd3('0x48')]({},_0x2e0108,_0x89ff02['options']);return _0x365cf6[_0xffd3('0x118')](_0x2e0108);}})[_0xffd3('0x16')](function(_0x2cd63d){if(_0x2cd63d){_0x480c1f=_0x2cd63d['length'];if(!_0x89ff02['query'][_0xffd3('0x41')]('nolimit')){_0x2e0108['limit']=qs[_0xffd3('0x24')](_0x89ff02[_0xffd3('0x3b')][_0xffd3('0x24')]);_0x2e0108[_0xffd3('0x26')]=qs['offset'](_0x89ff02[_0xffd3('0x3b')][_0xffd3('0x26')]);}return _0x365cf6[_0xffd3('0x118')](_0x2e0108);}})[_0xffd3('0x16')](function(_0x2b34fa){if(_0x2b34fa){return _0x2b34fa?{'count':_0x480c1f,'rows':_0x2b34fa}:null;}})['then'](respondWithResult(_0x4b970e,null))[_0xffd3('0x21')](handleError(_0x4b970e,null));};exports[_0xffd3('0x119')]=function(_0xddfffd,_0x5e07c5){return db[_0xffd3('0x11a')]['find']({'where':{'id':_0xddfffd[_0xffd3('0x58')]['id']}})[_0xffd3('0x16')](handleEntityNotFound(_0x5e07c5,null))[_0xffd3('0x16')](function(_0x302d52){if(_0x302d52){return _0x302d52[_0xffd3('0x119')](_0xddfffd[_0xffd3('0x57')][_0xffd3('0x60')],_[_0xffd3('0x11b')](_0xddfffd[_0xffd3('0x57')],[_0xffd3('0x60'),'id'])||{});}})[_0xffd3('0x16')](respondWithResult(_0x5e07c5,null))[_0xffd3('0x21')](handleError(_0x5e07c5,null));};exports[_0xffd3('0x100')]=function(_0x33b64e,_0x467ef2){var _0x5b2323={};var _0x59663d={};var _0x3facea;var _0x13b65b;return db[_0xffd3('0x4a')]['findOne']({'where':{'id':_0x33b64e[_0xffd3('0x58')]['id']}})['then'](handleEntityNotFound(_0x467ef2,null))[_0xffd3('0x16')](function(_0x26de97){if(_0x26de97){_0x3facea=_0x26de97;_0x59663d[_0xffd3('0x39')]=_['keys'](db[_0xffd3('0x11c')][_0xffd3('0x37')]);_0x59663d[_0xffd3('0x3b')]=_[_0xffd3('0x3a')](_0x33b64e[_0xffd3('0x3b')]);_0x59663d[_0xffd3('0x3c')]=_['intersection'](_0x59663d[_0xffd3('0x39')],_0x59663d[_0xffd3('0x3b')]);_0x5b2323[_0xffd3('0x3e')]=_[_0xffd3('0x3d')](_0x59663d[_0xffd3('0x39')],qs[_0xffd3('0x3f')](_0x33b64e[_0xffd3('0x3b')]['fields']));_0x5b2323[_0xffd3('0x3e')]=_0x5b2323[_0xffd3('0x3e')][_0xffd3('0x40')]?_0x5b2323[_0xffd3('0x3e')]:_0x59663d['model'];_0x5b2323[_0xffd3('0x43')]=qs[_0xffd3('0x44')](_0x33b64e[_0xffd3('0x3b')][_0xffd3('0x44')]);_0x5b2323['where']=qs[_0xffd3('0x3c')](_[_0xffd3('0x46')](_0x33b64e[_0xffd3('0x3b')],_0x59663d['filters']));if(_0x33b64e['query'][_0xffd3('0x47')]){_0x5b2323[_0xffd3('0x45')]=_['merge'](_0x5b2323[_0xffd3('0x45')],{'$or':_[_0xffd3('0x36')](_0x5b2323[_0xffd3('0x3e')],function(_0x41bf89){var _0x42b811={};_0x42b811[_0x41bf89]={'$like':'%'+_0x33b64e[_0xffd3('0x3b')][_0xffd3('0x47')]+'%'};return _0x42b811;})});}_0x5b2323=_[_0xffd3('0x48')]({},_0x5b2323,_0x33b64e[_0xffd3('0x49')]);return _0x3facea[_0xffd3('0x100')](_0x5b2323);}})[_0xffd3('0x16')](function(_0x39b9ce){if(_0x39b9ce){_0x13b65b=_0x39b9ce[_0xffd3('0x40')];if(!_0x33b64e['query']['hasOwnProperty']('nolimit')){_0x5b2323[_0xffd3('0x24')]=qs['limit'](_0x33b64e[_0xffd3('0x3b')][_0xffd3('0x24')]);_0x5b2323[_0xffd3('0x26')]=qs[_0xffd3('0x26')](_0x33b64e[_0xffd3('0x3b')][_0xffd3('0x26')]);}return _0x3facea[_0xffd3('0x100')](_0x5b2323);}})[_0xffd3('0x16')](function(_0x32b027){if(_0x32b027){return _0x32b027?{'count':_0x13b65b,'rows':_0x32b027}:null;}})[_0xffd3('0x16')](respondWithResult(_0x467ef2,null))['catch'](handleError(_0x467ef2,null));};exports[_0xffd3('0x11d')]=function(_0x3965fa,_0x554846){var _0x28a9e0=_0x3965fa[_0xffd3('0x3b')][_0xffd3('0x11e')]===_0xffd3('0x11f')?_0xffd3('0x120'):_0xffd3('0x121');return db[_0xffd3('0x4a')][_0xffd3('0x4f')]({'attributes':['id',_0x28a9e0],'where':{'id':_0x3965fa[_0xffd3('0x58')]['id']}})[_0xffd3('0x16')](handleEntityNotFound(_0x554846,null))[_0xffd3('0x16')](function(_0x597f87){if(_0x597f87){var _0x150c49=_0x597f87[_0x28a9e0];var _0x3554ea=_0x150c49&&_0x150c49[_0xffd3('0x122')]?_0x150c49[_0xffd3('0x122')]:[];_0x554846[_0xffd3('0x32')]({'fromKey':_[_0xffd3('0x70')](_0x150c49['fromKey'])?undefined:_0x150c49[_0xffd3('0x123')],'count':_0x3554ea['length'],'rows':_0x3554ea});}})['catch'](handleError(_0x554846,null));};exports[_0xffd3('0x124')]=function(_0x10aff7,_0x3eec3f){var _0x83dece={'raw':![],'where':{}};var _0x42f00e={};var _0x4e53d7={'count':0x0,'rows':[]};return db[_0xffd3('0x4a')][_0xffd3('0x5d')]({'where':{'id':_0x10aff7['params']['id']}})['then'](handleEntityNotFound(_0x3eec3f,null))[_0xffd3('0x16')](function(_0x3be40a){if(_0x3be40a){_0x42f00e[_0xffd3('0x39')]=_[_0xffd3('0x3a')](db['ChatOfflineMessage'][_0xffd3('0x37')]);_0x42f00e['query']=_[_0xffd3('0x3a')](_0x10aff7[_0xffd3('0x3b')]);_0x42f00e[_0xffd3('0x3c')]=_['intersection'](_0x42f00e[_0xffd3('0x39')],_0x42f00e[_0xffd3('0x3b')]);_0x83dece[_0xffd3('0x3e')]=_[_0xffd3('0x3d')](_0x42f00e[_0xffd3('0x39')],qs[_0xffd3('0x3f')](_0x10aff7[_0xffd3('0x3b')][_0xffd3('0x3f')]));_0x83dece[_0xffd3('0x3e')]=_0x83dece[_0xffd3('0x3e')]['length']?_0x83dece[_0xffd3('0x3e')]:_0x42f00e[_0xffd3('0x39')];if(!_0x10aff7[_0xffd3('0x3b')][_0xffd3('0x41')](_0xffd3('0x42'))){_0x83dece['limit']=qs[_0xffd3('0x24')](_0x10aff7[_0xffd3('0x3b')][_0xffd3('0x24')]);_0x83dece[_0xffd3('0x26')]=qs[_0xffd3('0x26')](_0x10aff7[_0xffd3('0x3b')][_0xffd3('0x26')]);}_0x83dece['order']=qs[_0xffd3('0x44')](_0x10aff7[_0xffd3('0x3b')][_0xffd3('0x44')]);_0x83dece[_0xffd3('0x45')]=qs[_0xffd3('0x3c')](_[_0xffd3('0x46')](_0x10aff7[_0xffd3('0x3b')],_0x42f00e['filters']));_0x83dece['where'][_0xffd3('0x5a')]=_0x3be40a['id'];if(_0x10aff7['query'][_0xffd3('0x47')]){_0x83dece[_0xffd3('0x45')]=_[_0xffd3('0x48')](_0x83dece[_0xffd3('0x45')],{'$or':_[_0xffd3('0x36')](_0x83dece['attributes'],function(_0x51dd16){var _0x55be31={};_0x55be31[_0x51dd16]={'$like':'%'+_0x10aff7[_0xffd3('0x3b')]['filter']+'%'};return _0x55be31;})});}_0x83dece=_['merge']({},_0x83dece,_0x10aff7[_0xffd3('0x49')]);return db[_0xffd3('0xce')][_0xffd3('0x25')]({'where':_0x83dece[_0xffd3('0x45')]})[_0xffd3('0x16')](function(_0x2ef6d3){_0x4e53d7['count']=_0x2ef6d3;if(_0x10aff7[_0xffd3('0x3b')]['includeAll']){_0x83dece[_0xffd3('0x4e')]=[{'all':!![]}];}else{_0x83dece[_0xffd3('0x4e')]=[{'model':db[_0xffd3('0x94')],'as':_0xffd3('0x125'),'required':![]},{'model':db[_0xffd3('0xd8')],'as':_0xffd3('0x126'),'required':![]}];}return db[_0xffd3('0xce')]['findAll'](_0x83dece);})[_0xffd3('0x16')](function(_0x349ea4){_0x4e53d7[_0xffd3('0x4c')]=_0x349ea4;return _0x4e53d7;});}})[_0xffd3('0x16')](respondWithFilteredResult(_0x3eec3f,_0x83dece))[_0xffd3('0x21')](handleError(_0x3eec3f,null));};exports['addAgents']=function(_0x31e9f0,_0x122d2f){return db['ChatWebsite'][_0xffd3('0x4f')]({'where':{'id':_0x31e9f0[_0xffd3('0x58')]['id']}})[_0xffd3('0x16')](handleEntityNotFound(_0x122d2f,null))[_0xffd3('0x16')](function(_0x273b85){if(_0x273b85){return _0x273b85['addAgents'](_0x31e9f0['body'][_0xffd3('0x60')],_[_0xffd3('0x11b')](_0x31e9f0[_0xffd3('0x57')],['ids','id'])||{})['spread'](function(_0x5884dc){for(var _0x2891f7=0x0;_0x2891f7<_0x31e9f0[_0xffd3('0x57')][_0xffd3('0x60')][_0xffd3('0x40')];_0x2891f7+=0x1){socket[_0xffd3('0x127')](_0xffd3('0x128'),{'UserId':Number(_0x31e9f0[_0xffd3('0x57')][_0xffd3('0x60')][_0x2891f7]),'ChatWebsiteId':Number(_0x31e9f0[_0xffd3('0x58')]['id'])});}return _0x5884dc;});}})[_0xffd3('0x16')](respondWithResult(_0x122d2f,null))[_0xffd3('0x21')](handleError(_0x122d2f,null));};exports[_0xffd3('0x129')]=function(_0x48b1a2,_0x411210){return db[_0xffd3('0x4a')][_0xffd3('0x4f')]({'where':{'id':_0x48b1a2['params']['id']}})[_0xffd3('0x16')](handleEntityNotFound(_0x411210,null))[_0xffd3('0x16')](function(_0x511684){if(_0x511684){return _0x511684[_0xffd3('0x129')](_0x48b1a2[_0xffd3('0x3b')][_0xffd3('0x60')])[_0xffd3('0x16')](function(){if(_[_0xffd3('0x12a')](_0x48b1a2[_0xffd3('0x3b')][_0xffd3('0x60')])){for(var _0x2f5382=0x0;_0x2f5382<_0x48b1a2[_0xffd3('0x3b')][_0xffd3('0x60')]['length'];_0x2f5382+=0x1){socket[_0xffd3('0x127')](_0xffd3('0x12b'),{'UserId':Number(_0x48b1a2['query'][_0xffd3('0x60')][_0x2f5382]),'ChatWebsiteId':Number(_0x48b1a2[_0xffd3('0x58')]['id'])});}}else{socket['emit'](_0xffd3('0x12b'),{'UserId':Number(_0x48b1a2['query'][_0xffd3('0x60')]),'ChatWebsiteId':Number(_0x48b1a2[_0xffd3('0x58')]['id'])});}});}})[_0xffd3('0x16')](respondWithStatusCode(_0x411210,null))['catch'](handleError(_0x411210,null));};exports[_0xffd3('0x12c')]=function(_0x56df1e,_0xde7eec){var _0x2f8ed3={};var _0x5a655c={};var _0x50bc93;var _0xf6969d;return db[_0xffd3('0x4a')][_0xffd3('0x5d')]({'where':{'id':_0x56df1e[_0xffd3('0x58')]['id']}})['then'](handleEntityNotFound(_0xde7eec,null))[_0xffd3('0x16')](function(_0x3574fa){if(_0x3574fa){_0x50bc93=_0x3574fa;_0x5a655c['model']=_[_0xffd3('0x3a')](db[_0xffd3('0xbe')][_0xffd3('0x37')]);_0x5a655c['query']=_[_0xffd3('0x3a')](_0x56df1e['query']);_0x5a655c[_0xffd3('0x3c')]=_[_0xffd3('0x3d')](_0x5a655c[_0xffd3('0x39')],_0x5a655c[_0xffd3('0x3b')]);_0x2f8ed3[_0xffd3('0x3e')]=_['intersection'](_0x5a655c[_0xffd3('0x39')],qs[_0xffd3('0x3f')](_0x56df1e['query'][_0xffd3('0x3f')]));_0x2f8ed3[_0xffd3('0x3e')]=_0x2f8ed3[_0xffd3('0x3e')][_0xffd3('0x40')]?_0x2f8ed3[_0xffd3('0x3e')]:_0x5a655c[_0xffd3('0x39')];_0x2f8ed3[_0xffd3('0x43')]=qs[_0xffd3('0x44')](_0x56df1e['query'][_0xffd3('0x44')]);_0x2f8ed3[_0xffd3('0x45')]=qs[_0xffd3('0x3c')](_[_0xffd3('0x46')](_0x56df1e['query'],_0x5a655c[_0xffd3('0x3c')]));if(_0x56df1e[_0xffd3('0x3b')][_0xffd3('0x47')]){_0x2f8ed3['where']=_[_0xffd3('0x48')](_0x2f8ed3['where'],{'$or':_[_0xffd3('0x36')](_0x2f8ed3[_0xffd3('0x3e')],function(_0x2fce72){var _0xeb766c={};_0xeb766c[_0x2fce72]={'$like':'%'+_0x56df1e['query'][_0xffd3('0x47')]+'%'};return _0xeb766c;})});}_0x2f8ed3=_['merge']({},_0x2f8ed3,_0x56df1e[_0xffd3('0x49')]);return _0x50bc93[_0xffd3('0x12c')](_0x2f8ed3);}})['then'](function(_0x1f20d6){if(_0x1f20d6){_0xf6969d=_0x1f20d6[_0xffd3('0x40')];if(!_0x56df1e[_0xffd3('0x3b')]['hasOwnProperty'](_0xffd3('0x42'))){_0x2f8ed3[_0xffd3('0x24')]=qs[_0xffd3('0x24')](_0x56df1e['query'][_0xffd3('0x24')]);_0x2f8ed3[_0xffd3('0x26')]=qs[_0xffd3('0x26')](_0x56df1e[_0xffd3('0x3b')]['offset']);}return _0x50bc93[_0xffd3('0x12c')](_0x2f8ed3);}})[_0xffd3('0x16')](function(_0x3690fa){if(_0x3690fa){return _0x3690fa?{'count':_0xf6969d,'rows':_0x3690fa}:null;}})['then'](respondWithResult(_0xde7eec,null))['catch'](handleError(_0xde7eec,null));};
\ No newline at end of file
+var _0xd222=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','rows','show','mandatoryDispositionPause','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','ChatWebsiteId','Disposition','findAll','removeDispositions','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','file','filename','customerAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','agentAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','notify','user-agent-parser','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','ChatApplication','Applications','List','applications','list','orderBy','priority','account','Contacts','contact','customerIp','cf-connecting-ip','headers','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','mimetype','subjectOffline','email','Chat','MailAccountId','NotifyMailAccount','notifyMail','remove','addInteraction','omit','ids','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','sendStatus','getApplications','chatProactiveAction','addProactiveActions','getFields','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','ejs','fs-extra','lodash','ioredis','api','../../mysqldb','redis','localhost','socket.io-emitter','register','html-to-text','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','get','UserProfileResource','stack','name','send','index','Pause','map','ChatWebsite','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection'];(function(_0x5c48ee,_0x48f8c4){var _0x5cb967=function(_0x337b1){while(--_0x337b1){_0x5c48ee['push'](_0x5c48ee['shift']());}};_0x5cb967(++_0x48f8c4);}(_0xd222,0xeb));var _0x2d22=function(_0x6d6a66,_0x2924af){_0x6d6a66=_0x6d6a66-0x0;var _0x11eb6e=_0xd222[_0x6d6a66];return _0x11eb6e;};'use strict';var BPromise=require(_0x2d22('0x0'));var Mustache=require(_0x2d22('0x1'));var util=require(_0x2d22('0x2'));var path=require('path');var ejs=require(_0x2d22('0x3'));var fs=require('fs');var fs_extra=require(_0x2d22('0x4'));var _=require(_0x2d22('0x5'));var querystring=require('querystring');var Redis=require(_0x2d22('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x2d22('0x7'));var config=require('../../config/environment');var db=require(_0x2d22('0x8'))['db'];config[_0x2d22('0x9')]=_['defaults'](config[_0x2d22('0x9')],{'host':_0x2d22('0xa'),'port':0x18eb});var socket=require(_0x2d22('0xb'))(new Redis(config[_0x2d22('0x9')]));require('./chatWebsite.socket')[_0x2d22('0xc')](socket);var htmlToText=require(_0x2d22('0xd'));var jayson=require(_0x2d22('0xe'));var client=jayson[_0x2d22('0xf')][_0x2d22('0x10')]({'port':0x232c});var client9002=jayson[_0x2d22('0xf')]['http']({'port':0x232a});var client9003=jayson[_0x2d22('0xf')]['http']({'port':0x232b});var client9001=jayson[_0x2d22('0xf')][_0x2d22('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x1ff8bd,_0x30efd4,_0x52a8fd,_0x56ec62){return new BPromise(function(_0x4ac745,_0x1cf39a){var _0x1a9f5d=_0x56ec62||client;return _0x1a9f5d[_0x2d22('0x11')](_0x1ff8bd,_0x52a8fd)['then'](function(_0x38d52f){logger[_0x2d22('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x30efd4,_0x2d22('0x13'));logger[_0x2d22('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x30efd4,'request\x20sent',JSON[_0x2d22('0x15')](_0x38d52f));if(_0x38d52f[_0x2d22('0x16')]){if(_0x38d52f[_0x2d22('0x16')]['code']===0x1f4){logger['error'](_0x2d22('0x17'),_0x30efd4,_0x38d52f[_0x2d22('0x16')][_0x2d22('0x18')]);return _0x1cf39a(_0x38d52f[_0x2d22('0x16')][_0x2d22('0x18')]);}logger['error'](_0x2d22('0x17'),_0x30efd4,_0x38d52f[_0x2d22('0x16')]['message']);return _0x4ac745(_0x38d52f[_0x2d22('0x16')]['message']);}else{logger[_0x2d22('0x12')](_0x2d22('0x17'),_0x30efd4,_0x2d22('0x13'));_0x4ac745(_0x38d52f[_0x2d22('0x19')][_0x2d22('0x18')]);}})[_0x2d22('0x1a')](function(_0x5ed86c){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x30efd4,_0x5ed86c);_0x1cf39a(_0x5ed86c);});});}function respondWithStatusCode(_0x53ace2,_0x3671a5){_0x3671a5=_0x3671a5||0xcc;return function(_0x30886d){if(_0x30886d){return _0x53ace2['sendStatus'](_0x3671a5);}return _0x53ace2[_0x2d22('0x1b')](_0x3671a5)[_0x2d22('0x1c')]();};}function respondWithResult(_0x14ba43,_0x24fc27){_0x24fc27=_0x24fc27||0xc8;return function(_0x465958){if(_0x465958){return _0x14ba43[_0x2d22('0x1b')](_0x24fc27)['json'](_0x465958);}};}function respondWithFilteredResult(_0x2d0731,_0x3e2a3b){return function(_0x2180c1){if(_0x2180c1){var _0x52d213=typeof _0x3e2a3b[_0x2d22('0x1d')]===_0x2d22('0x1e')&&typeof _0x3e2a3b[_0x2d22('0x1f')]===_0x2d22('0x1e');var _0x4e1242=_0x2180c1[_0x2d22('0x20')];var _0x267dc7=_0x52d213?0x0:_0x3e2a3b[_0x2d22('0x1d')];var _0x22524d=_0x52d213?_0x2180c1[_0x2d22('0x20')]:_0x3e2a3b[_0x2d22('0x1d')]+_0x3e2a3b['limit'];var _0x147c04;if(_0x22524d>=_0x4e1242){_0x22524d=_0x4e1242;_0x147c04=0xc8;}else{_0x147c04=0xce;}_0x2d0731['status'](_0x147c04);return _0x2d0731[_0x2d22('0x21')](_0x2d22('0x22'),_0x267dc7+'-'+_0x22524d+'/'+_0x4e1242)[_0x2d22('0x23')](_0x2180c1);}return null;};}function saveUpdates(_0x580462){return function(_0x477854){if(_0x477854){return _0x477854[_0x2d22('0x24')](_0x580462)[_0x2d22('0x25')](function(_0x1ecf7c){return _0x1ecf7c;});}return null;};}function removeEntity(_0xa3668f){return function(_0x2c887e){if(_0x2c887e){return _0x2c887e[_0x2d22('0x26')]()[_0x2d22('0x25')](function(){var _0x366aa3=_0x2c887e[_0x2d22('0x27')]({'plain':!![]});var _0x5db8a4='ChatWebsites';return db[_0x2d22('0x28')]['destroy']({'where':{'type':_0x5db8a4,'resourceId':_0x366aa3['id']}})[_0x2d22('0x25')](function(){return _0x2c887e;});})[_0x2d22('0x25')](function(){_0xa3668f[_0x2d22('0x1b')](0xcc)[_0x2d22('0x1c')]();});}};}function handleEntityNotFound(_0x59c5e7){return function(_0x5b83f6){if(!_0x5b83f6){_0x59c5e7['sendStatus'](0x194);}return _0x5b83f6;};}function handleError(_0x14dbb7,_0xc4cd3){_0xc4cd3=_0xc4cd3||0x1f4;return function(_0x29a8d1){logger['error'](_0x29a8d1[_0x2d22('0x29')]);if(_0x29a8d1[_0x2d22('0x2a')]){delete _0x29a8d1[_0x2d22('0x2a')];}_0x14dbb7[_0x2d22('0x1b')](_0xc4cd3)[_0x2d22('0x2b')](_0x29a8d1);};}exports[_0x2d22('0x2c')]=function(_0x2a8dbe,_0x259bb5){var _0x28ac15={'include':[{'model':db[_0x2d22('0x2d')],'as':'mandatoryDispositionPause'}]},_0x2a62bb={},_0x2b796a={'count':0x0,'rows':[]};var _0x5c171c=_[_0x2d22('0x2e')](db[_0x2d22('0x2f')][_0x2d22('0x30')],function(_0x2a2d10){return{'name':_0x2a2d10[_0x2d22('0x31')],'type':_0x2a2d10['type']['key']};});_0x2a62bb[_0x2d22('0x32')]=_['map'](_0x5c171c,_0x2d22('0x2a'));_0x2a62bb[_0x2d22('0x33')]=_[_0x2d22('0x34')](_0x2a8dbe[_0x2d22('0x33')]);_0x2a62bb[_0x2d22('0x35')]=_['intersection'](_0x2a62bb[_0x2d22('0x32')],_0x2a62bb[_0x2d22('0x33')]);_0x28ac15[_0x2d22('0x36')]=_[_0x2d22('0x37')](_0x2a62bb[_0x2d22('0x32')],qs['fields'](_0x2a8dbe[_0x2d22('0x33')][_0x2d22('0x38')]));_0x28ac15[_0x2d22('0x36')]=_0x28ac15['attributes'][_0x2d22('0x39')]?_0x28ac15['attributes']:_0x2a62bb['model'];if(!_0x2a8dbe[_0x2d22('0x33')][_0x2d22('0x3a')](_0x2d22('0x3b'))){_0x28ac15[_0x2d22('0x1f')]=qs[_0x2d22('0x1f')](_0x2a8dbe['query']['limit']);_0x28ac15[_0x2d22('0x1d')]=qs[_0x2d22('0x1d')](_0x2a8dbe[_0x2d22('0x33')][_0x2d22('0x1d')]);}_0x28ac15[_0x2d22('0x3c')]=qs[_0x2d22('0x3d')](_0x2a8dbe[_0x2d22('0x33')][_0x2d22('0x3d')]);_0x28ac15[_0x2d22('0x3e')]=qs[_0x2d22('0x35')](_[_0x2d22('0x3f')](_0x2a8dbe['query'],_0x2a62bb[_0x2d22('0x35')]),_0x5c171c);if(_0x2a8dbe[_0x2d22('0x33')][_0x2d22('0x40')]){_0x28ac15[_0x2d22('0x3e')]=_['merge'](_0x28ac15[_0x2d22('0x3e')],{'$or':_[_0x2d22('0x2e')](_0x5c171c,function(_0x1d68a0){if(_0x1d68a0[_0x2d22('0x41')]!==_0x2d22('0x42')){var _0x53c34f={};_0x53c34f[_0x1d68a0['name']]={'$like':'%'+_0x2a8dbe[_0x2d22('0x33')][_0x2d22('0x40')]+'%'};return _0x53c34f;}})});}_0x28ac15=_[_0x2d22('0x43')]({},_0x28ac15,_0x2a8dbe['options']);var _0x3905fe={'where':_0x28ac15[_0x2d22('0x3e')]};return db[_0x2d22('0x2f')][_0x2d22('0x20')](_0x3905fe)[_0x2d22('0x25')](function(_0x210896){_0x2b796a[_0x2d22('0x20')]=_0x210896;if(_0x2a8dbe[_0x2d22('0x33')][_0x2d22('0x44')]){_0x28ac15['include']=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x28ac15);})[_0x2d22('0x25')](function(_0x2f37c3){_0x2b796a[_0x2d22('0x45')]=_0x2f37c3;return _0x2b796a;})[_0x2d22('0x25')](respondWithFilteredResult(_0x259bb5,_0x28ac15))[_0x2d22('0x1a')](handleError(_0x259bb5,null));};exports[_0x2d22('0x46')]=function(_0x4ab938,_0x53790e){var _0x5041dd={'raw':![],'where':{'id':_0x4ab938['params']['id']},'include':[{'model':db['Pause'],'as':_0x2d22('0x47')}]},_0x2613ff={};_0x2613ff[_0x2d22('0x32')]=_[_0x2d22('0x34')](db[_0x2d22('0x2f')][_0x2d22('0x30')]);_0x2613ff[_0x2d22('0x33')]=_['keys'](_0x4ab938[_0x2d22('0x33')]);_0x2613ff[_0x2d22('0x35')]=_[_0x2d22('0x37')](_0x2613ff['model'],_0x2613ff[_0x2d22('0x33')]);_0x5041dd[_0x2d22('0x36')]=_[_0x2d22('0x37')](_0x2613ff[_0x2d22('0x32')],qs[_0x2d22('0x38')](_0x4ab938[_0x2d22('0x33')][_0x2d22('0x38')]));_0x5041dd[_0x2d22('0x36')]=_0x5041dd[_0x2d22('0x36')]['length']?_0x5041dd[_0x2d22('0x36')]:_0x2613ff[_0x2d22('0x32')];if(_0x4ab938[_0x2d22('0x33')][_0x2d22('0x44')]){_0x5041dd[_0x2d22('0x48')]=[{'all':!![]}];}_0x5041dd=_[_0x2d22('0x43')]({},_0x5041dd,_0x4ab938[_0x2d22('0x49')]);return db[_0x2d22('0x2f')][_0x2d22('0x4a')](_0x5041dd)[_0x2d22('0x25')](handleEntityNotFound(_0x53790e,null))[_0x2d22('0x25')](respondWithResult(_0x53790e,null))[_0x2d22('0x1a')](handleError(_0x53790e,null));};exports[_0x2d22('0x4b')]=function(_0x5c482f,_0x39f82d){return db[_0x2d22('0x2f')][_0x2d22('0x4b')](_0x5c482f[_0x2d22('0x4c')],{})['then'](function(_0x38dac3){var _0x53e3eb=_0x5c482f[_0x2d22('0x4d')][_0x2d22('0x27')]({'plain':!![]});if(!_0x53e3eb)throw new Error(_0x2d22('0x4e'));if(_0x53e3eb[_0x2d22('0x4f')]===_0x2d22('0x4d')){var _0x134f4d=_0x38dac3['get']({'plain':!![]});var _0x762391='ChatWebsites';return db[_0x2d22('0x50')][_0x2d22('0x4a')]({'where':{'name':_0x762391,'userProfileId':_0x53e3eb[_0x2d22('0x51')]},'raw':!![]})[_0x2d22('0x25')](function(_0x155355){if(_0x155355&&_0x155355['autoAssociation']===0x0){return db[_0x2d22('0x28')][_0x2d22('0x4b')]({'name':_0x134f4d[_0x2d22('0x2a')],'resourceId':_0x134f4d['id'],'type':_0x155355[_0x2d22('0x2a')],'sectionId':_0x155355['id']},{})[_0x2d22('0x25')](function(){return _0x38dac3;});}else{return _0x38dac3;}})[_0x2d22('0x1a')](function(_0x3c2692){logger['error'](_0x2d22('0x52'),_0x3c2692);throw _0x3c2692;});}return _0x38dac3;})[_0x2d22('0x25')](respondWithResult(_0x39f82d,0xc9))['catch'](handleError(_0x39f82d,null));};exports[_0x2d22('0x24')]=function(_0x4e05a1,_0x486d12){if(_0x4e05a1[_0x2d22('0x4c')]['id']){delete _0x4e05a1[_0x2d22('0x4c')]['id'];}return db['ChatWebsite'][_0x2d22('0x4a')]({'where':{'id':_0x4e05a1[_0x2d22('0x53')]['id']},'include':[{'model':db[_0x2d22('0x2d')],'as':_0x2d22('0x47')}]})[_0x2d22('0x25')](handleEntityNotFound(_0x486d12,null))[_0x2d22('0x25')](saveUpdates(_0x4e05a1[_0x2d22('0x4c')],null))[_0x2d22('0x25')](respondWithResult(_0x486d12,null))['catch'](handleError(_0x486d12,null));};exports[_0x2d22('0x26')]=function(_0x32ec5b,_0x1daa16){return db['ChatWebsite'][_0x2d22('0x4a')]({'where':{'id':_0x32ec5b[_0x2d22('0x53')]['id']}})[_0x2d22('0x25')](handleEntityNotFound(_0x1daa16,null))[_0x2d22('0x25')](removeEntity(_0x1daa16,null))[_0x2d22('0x1a')](handleError(_0x1daa16,null));};exports[_0x2d22('0x54')]=function(_0x561bfc,_0x2ca276){return db[_0x2d22('0x2f')][_0x2d22('0x54')]()[_0x2d22('0x25')](respondWithResult(_0x2ca276,null))[_0x2d22('0x1a')](handleError(_0x2ca276,null));};exports['addDisposition']=function(_0x171e8a,_0x37c040){if(_0x171e8a[_0x2d22('0x4c')]['id']){delete _0x171e8a[_0x2d22('0x4c')]['id'];}return db['ChatWebsite'][_0x2d22('0x4a')]({'where':{'id':_0x171e8a[_0x2d22('0x53')]['id']}})[_0x2d22('0x25')](handleEntityNotFound(_0x37c040,null))[_0x2d22('0x25')](function(_0x279826){if(_0x279826){_0x171e8a[_0x2d22('0x4c')][_0x2d22('0x55')]=_0x279826['id'];return db[_0x2d22('0x56')]['create'](_0x171e8a['body']);}})[_0x2d22('0x25')](respondWithResult(_0x37c040,null))[_0x2d22('0x1a')](handleError(_0x37c040,null));};exports['getDispositions']=function(_0x722e75,_0x125ebc){var _0x40a8db={'raw':![],'where':{}};var _0x237c91={};var _0x30b4f5={'count':0x0,'rows':[]};return db[_0x2d22('0x2f')]['findOne']({'where':{'id':_0x722e75[_0x2d22('0x53')]['id']}})[_0x2d22('0x25')](handleEntityNotFound(_0x125ebc,null))['then'](function(_0x4b8e6d){if(_0x4b8e6d){_0x237c91['model']=_['keys'](db[_0x2d22('0x56')]['rawAttributes']);_0x237c91[_0x2d22('0x33')]=_['keys'](_0x722e75[_0x2d22('0x33')]);_0x237c91[_0x2d22('0x35')]=_[_0x2d22('0x37')](_0x237c91[_0x2d22('0x32')],_0x237c91[_0x2d22('0x33')]);_0x40a8db['attributes']=_[_0x2d22('0x37')](_0x237c91[_0x2d22('0x32')],qs[_0x2d22('0x38')](_0x722e75['query'][_0x2d22('0x38')]));_0x40a8db[_0x2d22('0x36')]=_0x40a8db[_0x2d22('0x36')]['length']?_0x40a8db[_0x2d22('0x36')]:_0x237c91[_0x2d22('0x32')];if(!_0x722e75[_0x2d22('0x33')][_0x2d22('0x3a')](_0x2d22('0x3b'))){_0x40a8db[_0x2d22('0x1f')]=qs['limit'](_0x722e75[_0x2d22('0x33')][_0x2d22('0x1f')]);_0x40a8db[_0x2d22('0x1d')]=qs[_0x2d22('0x1d')](_0x722e75[_0x2d22('0x33')][_0x2d22('0x1d')]);}_0x40a8db['order']=qs['sort'](_0x722e75[_0x2d22('0x33')][_0x2d22('0x3d')]);_0x40a8db[_0x2d22('0x3e')]=qs[_0x2d22('0x35')](_[_0x2d22('0x3f')](_0x722e75[_0x2d22('0x33')],_0x237c91['filters']));_0x40a8db[_0x2d22('0x3e')][_0x2d22('0x55')]=_0x4b8e6d['id'];if(_0x722e75['query'][_0x2d22('0x40')]){_0x40a8db[_0x2d22('0x3e')]=_['merge'](_0x40a8db[_0x2d22('0x3e')],{'$or':_[_0x2d22('0x2e')](_0x40a8db[_0x2d22('0x36')],function(_0x9f4481){var _0x2c8089={};_0x2c8089[_0x9f4481]={'$like':'%'+_0x722e75[_0x2d22('0x33')][_0x2d22('0x40')]+'%'};return _0x2c8089;})});}_0x40a8db=_[_0x2d22('0x43')]({},_0x40a8db,_0x722e75['options']);return db[_0x2d22('0x56')]['count']({'where':_0x40a8db[_0x2d22('0x3e')]})['then'](function(_0x492e23){_0x30b4f5[_0x2d22('0x20')]=_0x492e23;if(_0x722e75[_0x2d22('0x33')][_0x2d22('0x44')]){_0x40a8db[_0x2d22('0x48')]=[{'all':!![]}];}return db[_0x2d22('0x56')][_0x2d22('0x57')](_0x40a8db);})[_0x2d22('0x25')](function(_0x4f3d59){_0x30b4f5[_0x2d22('0x45')]=_0x4f3d59;return _0x30b4f5;});}})[_0x2d22('0x25')](respondWithFilteredResult(_0x125ebc,_0x40a8db))[_0x2d22('0x1a')](handleError(_0x125ebc,null));};exports[_0x2d22('0x58')]=function(_0x22e44d,_0x39448f){return db[_0x2d22('0x2f')][_0x2d22('0x4a')]({'where':{'id':_0x22e44d[_0x2d22('0x53')]['id']}})['then'](handleEntityNotFound(_0x39448f,null))[_0x2d22('0x25')](function(_0x3facb5){if(_0x3facb5){return _0x3facb5[_0x2d22('0x58')](_0x22e44d[_0x2d22('0x33')]['ids']);}})[_0x2d22('0x25')](respondWithStatusCode(_0x39448f,null))[_0x2d22('0x1a')](handleError(_0x39448f,null));};exports['addAnswer']=function(_0x3b94bf,_0xb27ff4){if(_0x3b94bf[_0x2d22('0x4c')]['id']){delete _0x3b94bf[_0x2d22('0x4c')]['id'];}return db['ChatWebsite'][_0x2d22('0x4a')]({'where':{'id':_0x3b94bf[_0x2d22('0x53')]['id']}})[_0x2d22('0x25')](handleEntityNotFound(_0xb27ff4,null))[_0x2d22('0x25')](function(_0x6b5867){if(_0x6b5867){_0x3b94bf[_0x2d22('0x4c')][_0x2d22('0x55')]=_0x6b5867['id'];return db[_0x2d22('0x59')]['create'](_0x3b94bf[_0x2d22('0x4c')]);}})['then'](respondWithResult(_0xb27ff4,null))['catch'](handleError(_0xb27ff4,null));};exports[_0x2d22('0x5a')]=function(_0x4d5bb9,_0x115cc8){var _0x55fd6c={'raw':![],'where':{}};var _0x27a38d={};var _0x39853c={'count':0x0,'rows':[]};return db[_0x2d22('0x2f')][_0x2d22('0x5b')]({'where':{'id':_0x4d5bb9[_0x2d22('0x53')]['id']}})['then'](handleEntityNotFound(_0x115cc8,null))[_0x2d22('0x25')](function(_0x45b3c8){if(_0x45b3c8){_0x27a38d[_0x2d22('0x32')]=_[_0x2d22('0x34')](db[_0x2d22('0x59')][_0x2d22('0x30')]);_0x27a38d[_0x2d22('0x33')]=_[_0x2d22('0x34')](_0x4d5bb9['query']);_0x27a38d[_0x2d22('0x35')]=_[_0x2d22('0x37')](_0x27a38d[_0x2d22('0x32')],_0x27a38d[_0x2d22('0x33')]);_0x55fd6c['attributes']=_[_0x2d22('0x37')](_0x27a38d['model'],qs['fields'](_0x4d5bb9[_0x2d22('0x33')][_0x2d22('0x38')]));_0x55fd6c[_0x2d22('0x36')]=_0x55fd6c['attributes'][_0x2d22('0x39')]?_0x55fd6c['attributes']:_0x27a38d[_0x2d22('0x32')];if(!_0x4d5bb9[_0x2d22('0x33')][_0x2d22('0x3a')](_0x2d22('0x3b'))){_0x55fd6c[_0x2d22('0x1f')]=qs[_0x2d22('0x1f')](_0x4d5bb9[_0x2d22('0x33')][_0x2d22('0x1f')]);_0x55fd6c['offset']=qs[_0x2d22('0x1d')](_0x4d5bb9['query'][_0x2d22('0x1d')]);}_0x55fd6c[_0x2d22('0x3c')]=qs[_0x2d22('0x3d')](_0x4d5bb9[_0x2d22('0x33')][_0x2d22('0x3d')]);_0x55fd6c[_0x2d22('0x3e')]=qs[_0x2d22('0x35')](_[_0x2d22('0x3f')](_0x4d5bb9[_0x2d22('0x33')],_0x27a38d[_0x2d22('0x35')]));_0x55fd6c[_0x2d22('0x3e')]['ChatWebsiteId']=_0x45b3c8['id'];if(_0x4d5bb9[_0x2d22('0x33')]['filter']){_0x55fd6c[_0x2d22('0x3e')]=_[_0x2d22('0x43')](_0x55fd6c[_0x2d22('0x3e')],{'$or':_['map'](_0x55fd6c['attributes'],function(_0x514742){var _0x629dff={};_0x629dff[_0x514742]={'$like':'%'+_0x4d5bb9[_0x2d22('0x33')]['filter']+'%'};return _0x629dff;})});}_0x55fd6c=_['merge']({},_0x55fd6c,_0x4d5bb9[_0x2d22('0x49')]);return db['CannedAnswer'][_0x2d22('0x20')]({'where':_0x55fd6c[_0x2d22('0x3e')]})[_0x2d22('0x25')](function(_0x5978e6){_0x39853c[_0x2d22('0x20')]=_0x5978e6;if(_0x4d5bb9[_0x2d22('0x33')]['includeAll']){_0x55fd6c[_0x2d22('0x48')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2d22('0x57')](_0x55fd6c);})['then'](function(_0x4ae916){_0x39853c[_0x2d22('0x45')]=_0x4ae916;return _0x39853c;});}})[_0x2d22('0x25')](respondWithFilteredResult(_0x115cc8,_0x55fd6c))[_0x2d22('0x1a')](handleError(_0x115cc8,null));};exports[_0x2d22('0x5c')]=function(_0x283d8e,_0x32d9de){return db[_0x2d22('0x2f')][_0x2d22('0x4a')]({'where':{'id':_0x283d8e[_0x2d22('0x53')]['id']}})[_0x2d22('0x25')](handleEntityNotFound(_0x32d9de,null))[_0x2d22('0x25')](function(_0x2e8a13){if(_0x2e8a13){return _0x2e8a13[_0x2d22('0x5c')](_0x283d8e[_0x2d22('0x33')]['ids']);}})[_0x2d22('0x25')](respondWithStatusCode(_0x32d9de,null))[_0x2d22('0x1a')](handleError(_0x32d9de,null));};exports[_0x2d22('0x5d')]=function(_0x48b07c,_0x1f88bb){_0x48b07c['body'][_0x2d22('0x5e')]=_0x48b07c[_0x2d22('0x5f')][_0x2d22('0x60')];return db['ChatWebsite'][_0x2d22('0x4a')]({'where':{'id':_0x48b07c[_0x2d22('0x53')]['id']}})[_0x2d22('0x25')](handleEntityNotFound(_0x1f88bb,null))[_0x2d22('0x25')](saveUpdates(_0x48b07c['body'],null))['then'](respondWithResult(_0x1f88bb,null))['catch'](handleError(_0x1f88bb,null));};exports['addAvatar']=function(_0x3e7ba9,_0x3cbd09){_0x3e7ba9[_0x2d22('0x4c')]['agentAvatar']=_0x3e7ba9[_0x2d22('0x5f')][_0x2d22('0x60')];return db[_0x2d22('0x2f')]['find']({'where':{'id':_0x3e7ba9[_0x2d22('0x53')]['id']}})['then'](handleEntityNotFound(_0x3cbd09,null))[_0x2d22('0x25')](saveUpdates(_0x3e7ba9['body'],null))[_0x2d22('0x25')](respondWithResult(_0x3cbd09,null))[_0x2d22('0x1a')](handleError(_0x3cbd09,null));};exports['addCustomerAvatar']=function(_0x294f5f,_0x5bb648){_0x294f5f[_0x2d22('0x4c')][_0x2d22('0x61')]=_0x294f5f['file']['filename'];return db[_0x2d22('0x2f')]['find']({'where':{'id':_0x294f5f['params']['id']}})[_0x2d22('0x25')](handleEntityNotFound(_0x5bb648,null))[_0x2d22('0x25')](saveUpdates(_0x294f5f['body'],null))[_0x2d22('0x25')](respondWithResult(_0x5bb648,null))[_0x2d22('0x1a')](handleError(_0x5bb648,null));};exports['addSystemAvatar']=function(_0x505bfa,_0x20f7a5){_0x505bfa[_0x2d22('0x4c')][_0x2d22('0x62')]=_0x505bfa[_0x2d22('0x5f')]['filename'];return db[_0x2d22('0x2f')][_0x2d22('0x4a')]({'where':{'id':_0x505bfa['params']['id']}})[_0x2d22('0x25')](handleEntityNotFound(_0x20f7a5,null))[_0x2d22('0x25')](saveUpdates(_0x505bfa[_0x2d22('0x4c')],null))['then'](respondWithResult(_0x20f7a5,null))[_0x2d22('0x1a')](handleError(_0x20f7a5,null));};exports['getLogo']=function(_0xe7bad8,_0x4e419e){var _0x36f0c5=path[_0x2d22('0x63')](config[_0x2d22('0x64')],_0x2d22('0x65'));var _0x4e673d={'where':{'id':_0xe7bad8[_0x2d22('0x53')]['id']},'attributes':['id',_0x2d22('0x5e')],'raw':!![]};var _0x12f702=![];return require(_0x2d22('0x66'))[_0x2d22('0x67')]()[_0x2d22('0x25')](function(_0x47c7d7){if(_0x47c7d7){_0x12f702=_0x47c7d7['custom'];}})['then'](function(){return db['ChatWebsite'][_0x2d22('0x4a')](_0x4e673d);})[_0x2d22('0x25')](handleEntityNotFound(_0x4e419e,null))[_0x2d22('0x25')](function(_0x26b4fa){if(_0x26b4fa){if(!_[_0x2d22('0x68')](_0x26b4fa[_0x2d22('0x5e')])){if(fs[_0x2d22('0x69')](path[_0x2d22('0x63')](config[_0x2d22('0x64')],_0x2d22('0x6a'),_0x26b4fa[_0x2d22('0x5e')]))&&_0x12f702){_0x36f0c5=path[_0x2d22('0x63')](config[_0x2d22('0x64')],_0x2d22('0x6a'),_0x26b4fa[_0x2d22('0x5e')]);}}return _0x4e419e[_0x2d22('0x6b')](_0x36f0c5);}})[_0x2d22('0x1a')](handleError(_0x4e419e,null));};exports[_0x2d22('0x6c')]=function(_0x508d6b,_0x1f3fcc){var _0x52670b=path[_0x2d22('0x63')](config['root'],_0x2d22('0x6d'));var _0x376f2c={'where':{'id':_0x508d6b[_0x2d22('0x53')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x2d22('0x2f')][_0x2d22('0x4a')](_0x376f2c)['then'](handleEntityNotFound(_0x1f3fcc,null))[_0x2d22('0x25')](function(_0x44cd36){if(_0x44cd36){if(!_[_0x2d22('0x68')](_0x44cd36['agentAvatar'])){if(fs['existsSync'](path[_0x2d22('0x63')](config['root'],_0x2d22('0x6e'),_0x44cd36['agentAvatar']))){_0x52670b=path[_0x2d22('0x63')](config[_0x2d22('0x64')],_0x2d22('0x6e'),_0x44cd36[_0x2d22('0x6f')]);}}return _0x1f3fcc[_0x2d22('0x6b')](_0x52670b);}})['catch'](handleError(_0x1f3fcc,null));};exports['getCustomerAvatar']=function(_0x166617,_0x554163){var _0x5658ac=path[_0x2d22('0x63')](config[_0x2d22('0x64')],_0x2d22('0x70'));var _0x2219a5={'where':{'id':_0x166617[_0x2d22('0x53')]['id']},'attributes':['id',_0x2d22('0x61'),_0x2d22('0x71')],'raw':!![]};return db[_0x2d22('0x2f')]['find'](_0x2219a5)[_0x2d22('0x25')](handleEntityNotFound(_0x554163,null))['then'](function(_0x186ba0){if(_0x186ba0){if(!_[_0x2d22('0x68')](_0x186ba0[_0x2d22('0x61')])){if(fs[_0x2d22('0x69')](path[_0x2d22('0x63')](config[_0x2d22('0x64')],_0x2d22('0x6e'),_0x186ba0[_0x2d22('0x61')]))&&_0x186ba0[_0x2d22('0x71')]){_0x5658ac=path[_0x2d22('0x63')](config[_0x2d22('0x64')],'server/files/images/avatars/',_0x186ba0[_0x2d22('0x61')]);}}return _0x554163[_0x2d22('0x6b')](_0x5658ac);}})['catch'](handleError(_0x554163,null));};exports['getSystemAvatar']=function(_0x1a1fc8,_0x550e83){var _0x2ff7e6=path['join'](config[_0x2d22('0x64')],'server/files/images/avatars/system_avatar.png');var _0x28bfbd={'where':{'id':_0x1a1fc8[_0x2d22('0x53')]['id']},'attributes':['id',_0x2d22('0x62')],'raw':!![]};return db['ChatWebsite'][_0x2d22('0x4a')](_0x28bfbd)[_0x2d22('0x25')](handleEntityNotFound(_0x550e83,null))[_0x2d22('0x25')](function(_0x1a9bfe){if(_0x1a9bfe){if(!_[_0x2d22('0x68')](_0x1a9bfe[_0x2d22('0x62')])){if(fs[_0x2d22('0x69')](path[_0x2d22('0x63')](config[_0x2d22('0x64')],'server/files/images/avatars/',_0x1a9bfe[_0x2d22('0x62')]))){_0x2ff7e6=path[_0x2d22('0x63')](config[_0x2d22('0x64')],_0x2d22('0x6e'),_0x1a9bfe[_0x2d22('0x62')]);}}return _0x550e83[_0x2d22('0x6b')](_0x2ff7e6);}})[_0x2d22('0x1a')](handleError(_0x550e83,null));};exports[_0x2d22('0x72')]=function(_0xcd7d44,_0x3aef6b){var _0x302adf=require(_0x2d22('0x73'));var _0x19da3d=new _0x302adf();var _0x2a5c11=_0x19da3d['setUA'](_0xcd7d44['headers'][_0x2d22('0x74')])[_0x2d22('0x75')]();var _0x931205={'body':_0xcd7d44['body'],'channel':_0x2d22('0x76')};var _0x1ac1ac=[];var _0x539035=[];var _0x29a789={};var _0x13e8ba=![];return db[_0x2d22('0x77')][_0x2d22('0x54')]()[_0x2d22('0x25')](function(_0x5726a0){if(!_0x5726a0){throw new db[(_0x2d22('0x78'))][(_0x2d22('0x79'))](_0x2d22('0x7a'));}_0x1ac1ac=_[_0x2d22('0x7b')](_[_0x2d22('0x34')](_0x5726a0),[_0x2d22('0x7c'),_0x2d22('0x7d')]);_0x539035=_[_0x2d22('0x7b')](_[_0x2d22('0x34')](_0x5726a0),[_0x2d22('0x7c'),_0x2d22('0x7d'),_0x2d22('0x7e'),_0x2d22('0x7f')]);if(_0xcd7d44[_0x2d22('0x4c')]['id']){delete _0xcd7d44[_0x2d22('0x4c')]['id'];}if(_[_0x2d22('0x68')](_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0x80')])){throw new db['Sequelize']['ValidationError'](_0x2d22('0x81'));}if(_[_0x2d22('0x68')](_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0x4c')])||_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0x4c')]===''){throw new db[(_0x2d22('0x78'))][(_0x2d22('0x79'))](_0x2d22('0x82'));}if(_[_0x2d22('0x68')](_0xcd7d44['body'][_0x2d22('0x83')])){throw new db[(_0x2d22('0x78'))][(_0x2d22('0x79'))](_0x2d22('0x84')+_0x539035);}if(!_[_0x2d22('0x85')](_0x539035,_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0x83')])){throw new db[(_0x2d22('0x78'))][(_0x2d22('0x79'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x539035);}_0x29a789[_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0x83')]]=_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0x80')];})[_0x2d22('0x25')](function(){return db['ChatWebsite']['find']({'where':{'id':_0xcd7d44[_0x2d22('0x53')]['id']},'include':[{'model':db[_0x2d22('0x86')],'as':'List','include':[{'model':db[_0x2d22('0x77')],'as':'Contacts','where':_0x29a789,'limit':0x1,'order':[[_0x2d22('0x7d'),_0x2d22('0x87')]]}]},{'model':db[_0x2d22('0x88')],'as':_0x2d22('0x89')}]});})[_0x2d22('0x25')](handleEntityNotFound(_0x3aef6b,null))[_0x2d22('0x25')](function(_0x4ff564){if(_0x4ff564&&_0x4ff564[_0x2d22('0x8a')]){_0x931205['account']=_0x4ff564;_0x931205[_0x2d22('0x8b')]=_0x4ff564[_0x2d22('0x89')];_0x931205[_0x2d22('0x8c')]=_0x4ff564[_0x2d22('0x8a')];_0x931205[_0x2d22('0x8b')]=_[_0x2d22('0x8d')](_0x931205[_0x2d22('0x8b')],[_0x2d22('0x8e')],['asc']);if(_0x931205[_0x2d22('0x8f')][_0x2d22('0x89')]){delete _0x931205['account']['Applications'];}if(_0x931205[_0x2d22('0x8f')]['List']&&_0x931205[_0x2d22('0x8f')]['List'][_0x2d22('0x90')]['length']){return _0x931205['account']['List']['Contacts'][0x0];}var _0x1d2dcc=_['defaults'](_0xcd7d44['body'],{'firstName':_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0x80')],'ListId':_0x4ff564[_0x2d22('0x7f')]});_0x1d2dcc[_0xcd7d44[_0x2d22('0x4c')]['mapKey']]=_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0x80')];return db[_0x2d22('0x77')][_0x2d22('0x4b')](_0x1d2dcc,{'fields':_0x1ac1ac,'raw':!![]});}})[_0x2d22('0x25')](handleEntityNotFound(_0x3aef6b,null))['then'](function(_0x5be97b){_0x931205[_0x2d22('0x91')]=_0x5be97b;var _0x2d3d17=_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0x92')];if(_0xcd7d44['headers'][_0x2d22('0x93')]){_0x2d3d17=_0xcd7d44[_0x2d22('0x94')]['cf-connecting-ip'];}else if(_0xcd7d44[_0x2d22('0x94')][_0x2d22('0x95')]){_0x2d3d17=_['first'](_0xcd7d44[_0x2d22('0x94')]['x-forwarded-for'][_0x2d22('0x96')](','));}if(_0x5be97b){var _0x5976ef={'ContactId':_0x5be97b['id'],'ChatWebsiteId':_0xcd7d44[_0x2d22('0x53')]['id'],'from':(_0x5be97b[_0x2d22('0x97')]||'')+'\x20'+(_0x5be97b[_0x2d22('0x98')]||''),'customerIp':_0x2d3d17,'customerPort':_0xcd7d44[_0x2d22('0x94')][_0x2d22('0x99')]?_0xcd7d44['headers'][_0x2d22('0x99')]:null,'referer':_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0x9a')],'browserName':_0x2a5c11[_0x2d22('0x9b')]['name']&&_0x2a5c11[_0x2d22('0x9b')][_0x2d22('0x9c')]?util[_0x2d22('0x9d')](_0x2d22('0x9e'),_0x2a5c11[_0x2d22('0x9b')]['name'],_0x2a5c11['browser'][_0x2d22('0x9c')]):_0x2d22('0x9f'),'browserVersion':_0x2a5c11[_0x2d22('0x9b')]['version']||_0x2d22('0x9f'),'osName':util[_0x2d22('0x9d')](_0x2d22('0x9e'),_0x2a5c11['os'][_0x2d22('0x2a')],_0x2a5c11['os'][_0x2d22('0x9c')]),'osVersion':_0x2a5c11['os'][_0x2d22('0x9c')],'deviceModel':_0x2a5c11[_0x2d22('0xa0')][_0x2d22('0x32')]&&_0x2a5c11['device'][_0x2d22('0xa1')]?util[_0x2d22('0x9d')](_0x2d22('0xa2'),_0x2a5c11[_0x2d22('0xa0')][_0x2d22('0x32')],_0x2a5c11['device'][_0x2d22('0xa1')],_0x2a5c11['device'][_0x2d22('0x41')]):null,'deviceVendor':_0x2a5c11[_0x2d22('0xa0')]['vendor'],'deviceType':_0x2a5c11[_0x2d22('0xa0')]['type'],'formData':JSON[_0x2d22('0x15')](_0xcd7d44['body'])};var _0x1a36e7={'ChatWebsiteId':_0xcd7d44[_0x2d22('0x53')]['id'],'closed':![]};if(_0xcd7d44['body']['threadId']){_0x1a36e7['threadId']=_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0xa3')];return db['ChatInteraction'][_0x2d22('0x4a')]({'where':_0x1a36e7})['then'](function(_0x9a5a9b){if(_0x9a5a9b){return[_0x9a5a9b,![]];}_0x5976ef[_0x2d22('0xa3')]=_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0xa3')];_0x5976ef['externalUrl']=_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0xa4')];return db[_0x2d22('0xa5')]['create'](_0x5976ef)[_0x2d22('0x25')](function(_0x5ce467){return[_0x5ce467,!![]];});});}_0x1a36e7[_0x2d22('0xa6')]=_0x5be97b['id'];if(_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0xa7')]&&_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0xa7')]['id']){_0x1a36e7['id']=_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0xa7')]['id'];return db[_0x2d22('0xa5')][_0x2d22('0x4a')]({'where':_0x1a36e7})[_0x2d22('0x25')](function(_0x5e1502){if(_0x5e1502){return[_0x5e1502,![]];}return db[_0x2d22('0xa5')][_0x2d22('0x4b')](_0x5976ef)['then'](function(_0x12bffd){return[_0x12bffd,!![]];});});}return db['ChatInteraction'][_0x2d22('0x4b')](_0x5976ef)[_0x2d22('0x25')](function(_0x1f1297){return[_0x1f1297,!![]];});}})[_0x2d22('0xa8')](function(_0xb9be6a,_0x70352e){if(_0xb9be6a){_0x13e8ba=_0x70352e;if(!_0x70352e){var _0x256135={'from':(_0x931205['contact'][_0x2d22('0x97')]||'')+'\x20'+(_0x931205[_0x2d22('0x91')]['lastName']||'')};if(_0xcd7d44['body']['threadId']&&_0xcd7d44['body'][_0x2d22('0xa9')]&&_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0xa3')]!=_0xcd7d44[_0x2d22('0x4c')][_0x2d22('0xa9')]){_0x256135[_0x2d22('0xa3')]=_0xcd7d44['body'][_0x2d22('0xa9')];}return _0xb9be6a[_0x2d22('0x24')](_0x256135);}else{return _0xb9be6a;}}})['then'](function(_0x2730c8){_0x931205['interaction']=_0x2730c8[_0x2d22('0x27')]({'plain':!![]});_0x931205[_0x2d22('0xa7')]['created']=_0x13e8ba;if(_0x931205['interaction'][_0x2d22('0xaa')]){if(_0x931205[_0x2d22('0x8f')][_0x2d22('0xab')]){_0x931205[_0x2d22('0x8b')][_0x2d22('0xac')]({'id':0x0,'priority':_0x931205[_0x2d22('0x8b')][_0x2d22('0x39')]+0x1,'app':_0x2d22('0xad'),'appdata':_0x2d22('0xae'),'interval':'*,*,*,*'});}}return db[_0x2d22('0xaf')][_0x2d22('0x4b')]({'body':_0xcd7d44[_0x2d22('0x4c')]['body'],'ChatWebsiteId':_0xcd7d44[_0x2d22('0x53')]['id'],'ChatInteractionId':_0x2730c8['id'],'direction':'in','ContactId':_0x931205[_0x2d22('0x91')]['id'],'AttachmentId':_0xcd7d44[_0x2d22('0x4c')]['AttachmentId']});})[_0x2d22('0x25')](function(_0x130f27){_0x931205['message']=_0x130f27;if(_0x931205[_0x2d22('0xa7')][_0x2d22('0xb0')]){return db[_0x2d22('0xb1')][_0x2d22('0x4a')]({'attributes':['id',_0x2d22('0x2a')],'where':{'id':_0x931205[_0x2d22('0xa7')][_0x2d22('0xb0')]}})[_0x2d22('0x25')](function(_0x15d8fd){if(_0x15d8fd){_0x931205[_0x2d22('0x8b')][_0x2d22('0xb2')]({'id':0x0,'priority':0x0,'app':_0x2d22('0xb3'),'appdata':_0x15d8fd[_0x2d22('0x2a')]+','+(_0x931205[_0x2d22('0x8f')][_0x2d22('0xb4')]||0xa),'interval':'*,*,*,*'});_0x931205[_0x2d22('0xb5')]=!![];}return respondWithRpcPromise(_0x2d22('0xb6'),_0x2d22('0xb7'),_0x931205);});}return respondWithRpcPromise(_0x2d22('0xb6'),_0x2d22('0xb7'),_0x931205);})[_0x2d22('0x25')](function(_0x32f296){respondWithRpcPromise(_0x2d22('0xb8'),_0x2d22('0xb8'),{'event':'notify','message':_0x32f296},client9002);return _0x32f296;})[_0x2d22('0x25')](respondWithResult(_0x3aef6b,null))[_0x2d22('0x1a')](handleError(_0x3aef6b,null));};exports[_0x2d22('0xb9')]=function(_0x31ceca,_0x56a2fb){var _0x13e94a,_0x31f08b,_0x17cc09;var _0xbd8ca7=[];var _0x21cec0={};var _0x472a62=_0x31ceca[_0x2d22('0xba')]||[];var _0x3d30cf=[];var _0x1f5812;return db[_0x2d22('0x77')][_0x2d22('0x54')]()[_0x2d22('0x25')](function(_0x565258){if(!_0x565258){throw new db[(_0x2d22('0x78'))]['ValidationError'](_0x2d22('0x7a'));}_0xbd8ca7=_[_0x2d22('0x7b')](_[_0x2d22('0x34')](_0x565258),[_0x2d22('0x7c'),_0x2d22('0x7d'),_0x2d22('0x7e'),_0x2d22('0x7f')]);if(_0x31ceca[_0x2d22('0x4c')]['id']){delete _0x31ceca[_0x2d22('0x4c')]['id'];}if(_[_0x2d22('0x68')](_0x31ceca[_0x2d22('0x4c')]['from'])){throw _0x56a2fb[_0x2d22('0x1b')](0x1f4)[_0x2d22('0x2b')](new db[(_0x2d22('0x78'))][(_0x2d22('0x79'))]('from\x20is\x20mandatory'));}if(_[_0x2d22('0x68')](_0x31ceca[_0x2d22('0x4c')][_0x2d22('0x4c')])||_0x31ceca[_0x2d22('0x4c')][_0x2d22('0x4c')]===''){throw _0x56a2fb['status'](0x1f4)[_0x2d22('0x2b')](new db[(_0x2d22('0x78'))][(_0x2d22('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x2d22('0x68')](_0x31ceca['body'][_0x2d22('0xbb')])){throw _0x56a2fb[_0x2d22('0x1b')](0x1f4)['send'](new db[(_0x2d22('0x78'))]['ValidationError'](_0x2d22('0xbc')+_0xbd8ca7));}if(!_['includes'](_0xbd8ca7,_0x31ceca[_0x2d22('0x4c')]['mapKeyOffline'])){throw _0x56a2fb[_0x2d22('0x1b')](0x1f4)[_0x2d22('0x2b')](new db[(_0x2d22('0x78'))][(_0x2d22('0x79'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xbd8ca7));}_0x21cec0[_0x31ceca[_0x2d22('0x4c')][_0x2d22('0xbb')]]=_0x31ceca[_0x2d22('0x4c')]['from'];})[_0x2d22('0x25')](function(){return db[_0x2d22('0x2f')][_0x2d22('0x4a')]({'where':{'id':_0x31ceca[_0x2d22('0x53')]['id']},'include':[{'model':db[_0x2d22('0x86')],'as':_0x2d22('0x8a')},{'model':db[_0x2d22('0xbd')],'as':'MailAccount'}]});})[_0x2d22('0x25')](handleEntityNotFound(_0x56a2fb,null))[_0x2d22('0x25')](function(_0x2ff789){if(_0x2ff789&&_0x2ff789[_0x2d22('0x8a')]){_0x31f08b=_0x2ff789;var _0x237873=_[_0x2d22('0xbe')](_0x31ceca[_0x2d22('0x4c')],{'firstName':_0x31ceca['body'][_0x2d22('0x80')],'phone':_0x31ceca[_0x2d22('0x4c')][_0x2d22('0x80')],'ListId':_0x2ff789[_0x2d22('0x7f')]});_0x237873[_0x31ceca[_0x2d22('0x4c')][_0x2d22('0xbb')]]=_0x31ceca[_0x2d22('0x4c')][_0x2d22('0x80')];return db[_0x2d22('0x77')]['findOrCreate']({'where':_0x21cec0,'defaults':_0x237873});}})[_0x2d22('0xa8')](function(_0x1bd1b8){if(_0x1bd1b8){_0x17cc09=_0x1bd1b8;var _0x1cd47a=fs[_0x2d22('0xbf')](path['join'](config[_0x2d22('0x64')],_0x2d22('0xc0')),_0x2d22('0xc1'));var _0x40bbf4=ejs[_0x2d22('0xc2')](_0x1cd47a,{'body':_[_0x2d22('0xc3')](_0x31ceca[_0x2d22('0x4c')]['body']),'bodyTitle':_0x31f08b[_0x2d22('0xc4')]});return db[_0x2d22('0xc5')][_0x2d22('0x4b')]({'body':_0x40bbf4,'plainBody':htmlToText[_0x2d22('0xc6')](_0x40bbf4),'ContactId':_0x1bd1b8['id'],'ChatWebsiteId':_0x31f08b['id']});}})[_0x2d22('0x25')](function(_0x11e286){_0x1f5812=_0x11e286;if(_0x472a62[_0x2d22('0x39')]){var _0x41db88=_0x472a62[_0x2d22('0x2e')](function(_0x337e04){return{'name':_0x337e04[_0x2d22('0xc7')],'basename':_0x337e04['filename'],'type':_0x337e04['mimetype'],'ChatOfflineMessageId':_0x11e286['id']};});_0x3d30cf=_0x41db88[_0x2d22('0x2e')](_0xa1571e=>{var _0x13895b={'filename':_0xa1571e[_0x2d22('0x2a')],'path':path[_0x2d22('0x63')](config[_0x2d22('0x64')],_0x2d22('0xc8'),_0x2d22('0xba'),_0x2d22('0xc9'),_0x2d22('0xca'),_0xa1571e[_0x2d22('0xcb')])};return _0x13895b;});if(!_0x31f08b[_0x2d22('0xcc')]){return db[_0x2d22('0xcd')][_0x2d22('0xce')](function(_0x18ffc6){return db[_0x2d22('0xcf')][_0x2d22('0xd0')](_0x41db88,{'transaction':_0x18ffc6});});}}})['then'](function(){if(_0x1f5812){_0x13e94a=_0x1f5812;return db[_0x2d22('0xbd')][_0x2d22('0x5b')]({'where':{'service':!![]},'include':[{'model':db[_0x2d22('0xd1')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x2d22('0xd2')],'as':_0x2d22('0xd2'),'raw':!![]}]}]});}})['then'](function(_0x8d279b){if(_0x8d279b&&_0x8d279b[_0x2d22('0xd3')]&&_0x31f08b[_0x2d22('0xd4')]&&_0x31f08b[_0x2d22('0xd5')]){var _0xfca859=_0x8d279b[_0x2d22('0xd6')]();return respondWithRpcPromise(_0x2d22('0xd7'),'sendMail',{'account':_0xfca859,'message':{'from':util[_0x2d22('0x9d')](_0x2d22('0xd8'),_0x8d279b[_0x2d22('0x2a')],_0x8d279b['email']||_0x8d279b[_0x2d22('0xd3')][_0x2d22('0x4d')]),'to':_0x31f08b[_0x2d22('0xd5')],'subject':_0x31f08b[_0x2d22('0xd9')],'html':_0x13e94a[_0x2d22('0x4c')],'attachments':_0x3d30cf}},client9003)[_0x2d22('0x25')](function(){return _0x13e94a;})[_0x2d22('0x1a')](function(_0x1f178b){logger[_0x2d22('0x16')](_0x1f178b);});}})[_0x2d22('0x25')](function(){if(_0x31f08b&&_0x31f08b[_0x2d22('0xcc')]&&_0x31f08b['MailAccountId']){var _0x3a10f9=[];if(_0x472a62[_0x2d22('0x39')]){_0x3a10f9=_0x472a62[_0x2d22('0x2e')](function(_0x5b77bd){return{'name':_0x5b77bd[_0x2d22('0xc7')],'basename':_0x5b77bd['filename'],'type':_0x5b77bd[_0x2d22('0xda')],'ChatOfflineMessageId':_0x1f5812['id']};});}var _0x146dc4;if(!_[_0x2d22('0x68')](_0x31f08b['subjectOffline'])){var _0x2078aa=_[_0x2d22('0x2e')](_0x31ceca['body'],function(_0x527d2e){return _0x527d2e;});var _0x86b768=_['toPairsIn'](_0x2078aa)[0x0];var _0x406485=_['mapValues'](_0x86b768,function(_0x3c2039){return _0x3c2039;});_0x146dc4=_0x406485[0x1][_0x31f08b[_0x2d22('0xdb')]];}var _0x1b31fd={'from':_0x17cc09[_0x2d22('0xdc')],'firstName':_0x17cc09[_0x2d22('0x97')],'lastName':_0x17cc09[_0x2d22('0x98')],'mapKey':'email','message':{'from':_0x17cc09[_0x2d22('0xdc')],'to':_0x31f08b['MailAccount']['email'],'cc':'','subject':_[_0x2d22('0x68')](_0x146dc4)?_0x31f08b[_0x2d22('0xd9')]:_0x146dc4,'messageId':'','sentAt':new Date(),'attach':_0x3a10f9[_0x2d22('0x39')],'attachments':_0x3a10f9,'originChannel':_0x2d22('0xdd'),'ChatWebsiteId':_0x31f08b['id'],'ChatOfflineMessageId':_0x13e94a['id'],'originTo':_0x31f08b[_0x2d22('0xbd')][_0x2d22('0xdc')]},'body':_0x13e94a[_0x2d22('0x4c')]};var _0x547f3a={'account':{'id':_0x31f08b[_0x2d22('0xde')]},'body':_0x1b31fd,'log':_0x2d22('0xdf')};return respondWithRpcPromise(_0x2d22('0xdf'),_0x2d22('0xe0'),_0x547f3a,client9001)[_0x2d22('0x25')](function(){return _0x13e94a;})[_0x2d22('0x1a')](function(_0x2b7e28){logger[_0x2d22('0x16')](_0x2b7e28);});}return;})[_0x2d22('0x25')](function(){if(_0x13e94a){return _0x13e94a;}})['then'](respondWithResult(_0x56a2fb,null))[_0x2d22('0x1a')](function(_0x8fe31e){logger[_0x2d22('0x16')](_0x2d22('0x1a'),_0x8fe31e);for(var _0xa1f2b9 of _0x472a62){var _0x5b3e46=path[_0x2d22('0x63')](config[_0x2d22('0x64')],_0x2d22('0xc8'),_0x2d22('0xba'),'attachments',_0x2d22('0xca'),_0xa1f2b9[_0x2d22('0x60')]);fs_extra[_0x2d22('0xe1')](_0x5b3e46)['catch'](function(_0xab486d){logger[_0x2d22('0x16')]('Could\x20not\x20remove\x20attachment\x20file',_0x5b3e46,_0xab486d);});}});};exports[_0x2d22('0xe2')]=function(_0x2e6570,_0x33e14f){return db[_0x2d22('0xa5')]['find']({'where':{'id':_0x2e6570[_0x2d22('0x53')]['id']}})['then'](handleEntityNotFound(_0x33e14f,null))[_0x2d22('0x25')](function(_0x18ca66){if(_0x18ca66){return _0x18ca66[_0x2d22('0xe2')](_0x2e6570['body']['ids'],_[_0x2d22('0xe3')](_0x2e6570[_0x2d22('0x4c')],[_0x2d22('0xe4'),'id'])||{});}})[_0x2d22('0x25')](respondWithResult(_0x33e14f,null))[_0x2d22('0x1a')](handleError(_0x33e14f,null));};exports['getInteractions']=function(_0x8e7cec,_0x252dba){var _0x28a094={'raw':![],'where':{}};var _0x1f6b0f={};var _0x4ae24e={'count':0x0,'rows':[]};return db[_0x2d22('0x2f')]['findOne']({'where':{'id':_0x8e7cec[_0x2d22('0x53')]['id']}})['then'](handleEntityNotFound(_0x252dba,null))[_0x2d22('0x25')](function(_0x120d8c){if(_0x120d8c){_0x1f6b0f['model']=_[_0x2d22('0x34')](db[_0x2d22('0xa5')][_0x2d22('0x30')]);_0x1f6b0f[_0x2d22('0x33')]=_['keys'](_0x8e7cec[_0x2d22('0x33')]);_0x1f6b0f[_0x2d22('0x35')]=_[_0x2d22('0x37')](_0x1f6b0f['model'],_0x1f6b0f[_0x2d22('0x33')]);_0x28a094['attributes']=_[_0x2d22('0x37')](_0x1f6b0f[_0x2d22('0x32')],qs['fields'](_0x8e7cec[_0x2d22('0x33')][_0x2d22('0x38')]));_0x28a094['attributes']=_0x28a094['attributes'][_0x2d22('0x39')]?_0x28a094['attributes']:_0x1f6b0f[_0x2d22('0x32')];if(!_0x8e7cec[_0x2d22('0x33')][_0x2d22('0x3a')]('nolimit')){_0x28a094[_0x2d22('0x1f')]=qs[_0x2d22('0x1f')](_0x8e7cec['query'][_0x2d22('0x1f')]);_0x28a094[_0x2d22('0x1d')]=qs[_0x2d22('0x1d')](_0x8e7cec[_0x2d22('0x33')][_0x2d22('0x1d')]);}_0x28a094[_0x2d22('0x3c')]=qs['sort'](_0x8e7cec[_0x2d22('0x33')][_0x2d22('0x3d')]);_0x28a094[_0x2d22('0x3e')]=qs[_0x2d22('0x35')](_['pick'](_0x8e7cec[_0x2d22('0x33')],_0x1f6b0f['filters']));_0x28a094['where'][_0x2d22('0x55')]=_0x120d8c['id'];if(_0x8e7cec[_0x2d22('0x33')][_0x2d22('0x40')]){_0x28a094['where']=_[_0x2d22('0x43')](_0x28a094[_0x2d22('0x3e')],{'$or':_['map'](_0x28a094['attributes'],function(_0x45855d){var _0x1ab4c5={};_0x1ab4c5[_0x45855d]={'$like':'%'+_0x8e7cec['query']['filter']+'%'};return _0x1ab4c5;})});}_0x28a094=_['merge']({},_0x28a094,_0x8e7cec[_0x2d22('0x49')]);return db[_0x2d22('0xa5')][_0x2d22('0x20')]({'where':_0x28a094[_0x2d22('0x3e')]})[_0x2d22('0x25')](function(_0x1d2e78){_0x4ae24e[_0x2d22('0x20')]=_0x1d2e78;if(_0x8e7cec[_0x2d22('0x33')][_0x2d22('0x44')]){_0x28a094['include']=[{'model':db['CmContact'],'as':_0x2d22('0xe5'),'required':![]},{'model':db[_0x2d22('0xb1')],'as':_0x2d22('0xe6'),'attributes':[_0x2d22('0x2a'),_0x2d22('0xe7'),_0x2d22('0xe8')],'required':![]},{'model':db[_0x2d22('0xe9')],'as':_0x2d22('0xea'),'attributes':['id',_0x2d22('0x2a'),'color'],'where':_0x8e7cec[_0x2d22('0x33')][_0x2d22('0xeb')]?{'id':_0x8e7cec[_0x2d22('0x33')][_0x2d22('0xeb')]}:undefined,'required':_0x8e7cec[_0x2d22('0x33')][_0x2d22('0xeb')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x28a094);})[_0x2d22('0x25')](function(_0xead5e7){_0x4ae24e[_0x2d22('0x45')]=_0xead5e7;return _0x4ae24e;});}})[_0x2d22('0x25')](respondWithFilteredResult(_0x252dba,_0x28a094))['catch'](handleError(_0x252dba,null));};function iftimePromise(_0x2d6eb3,_0x3f6cd2){return respondWithRpcPromise(_0x2d22('0xec'),'getSnippet',{'command':_0x3f6cd2['timezone']?util[_0x2d22('0x9d')](_0x2d22('0xed'),_0x2d6eb3[_0x2d22('0xee')],_0x3f6cd2[_0x2d22('0xef')]):util[_0x2d22('0x9d')](_0x2d22('0xf0'),_0x2d6eb3[_0x2d22('0xee')])},client9002)['then'](function(_0x1504bc){var _0x2adda8=_0x1504bc&&_0x1504bc[_0x2d22('0xf1')]('true')>=0x0?!![]:![];logger['info'](_0x2d22('0xf2'),_0x3f6cd2['id'],_0x2d6eb3['id'],_0x2d6eb3[_0x2d22('0xee')],_0x2adda8?_0x2d22('0xf3'):'OFFLINE',_0x3f6cd2[_0x2d22('0xef')]?_0x3f6cd2[_0x2d22('0xef')]:_0x2d22('0xf4'));return _0x2adda8;})[_0x2d22('0x1a')](function(_0x4fe8d4){logger[_0x2d22('0x16')](_0x2d22('0xf2'),_0x3f6cd2['id'],_0x2d6eb3['id'],_0x2d6eb3[_0x2d22('0xee')],util[_0x2d22('0xf5')](_0x4fe8d4,{'showHidden':![],'depth':null}),_0x3f6cd2[_0x2d22('0xef')]?_0x3f6cd2[_0x2d22('0xef')]:_0x2d22('0xf4'));return![];});}exports['getSnippet']=function(_0x2f16d3,_0x3a951b){var _0x2c78a5=0x0;var _0x4254ea=0x0;var _0x9d6e=![];var _0xd54ff9;var _0x381e1c;return db[_0x2d22('0x2f')]['find']({'where':{'id':_0x2f16d3[_0x2d22('0x53')]['id']},'include':[{'model':db[_0x2d22('0xf6')],'as':_0x2d22('0xf6'),'include':[{'model':db[_0x2d22('0xf6')],'as':'Intervals','attributes':['id',_0x2d22('0xee')],'raw':!![]}]}]})[_0x2d22('0x25')](handleEntityNotFound(_0x3a951b,null))[_0x2d22('0x25')](function(_0x1f397b){if(_0x1f397b){_0xd54ff9=_0x1f397b;return _0x1f397b[_0x2d22('0xf7')]({'raw':!![]});}})[_0x2d22('0x25')](function(_0x3cc4bd){if(_0xd54ff9){if(_0x3cc4bd){_0x381e1c=_0x3cc4bd;}}return require(_0x2d22('0x66'))[_0x2d22('0x67')]();})[_0x2d22('0x25')](function(_0x2cd5d6){if(_0x2cd5d6){_0x4254ea=_0x2cd5d6[_0x2d22('0xf8')];_0x9d6e=_0x2cd5d6[_0x2d22('0xf9')];}})[_0x2d22('0x25')](function(){return db[_0x2d22('0xa5')][_0x2d22('0x20')]({'where':{'closed':![]}});})[_0x2d22('0x25')](function(_0x101b57){_0x2c78a5=_0x101b57;if(_0x4254ea&&_0x101b57>_0x4254ea){return db[_0x2d22('0xfa')][_0x2d22('0x5b')]({'where':{'id':0x1}})[_0x2d22('0x25')](function(_0x4db765){if(_0x4db765){_0x4db765[_0x2d22('0xfb')](_0x2d22('0xfc'));}});}})[_0x2d22('0x25')](function(){if(_0xd54ff9[_0x2d22('0xf6')]&&_0xd54ff9[_0x2d22('0xf6')][_0x2d22('0xfd')]){var _0x426576=[];for(var _0x95ecdf=0x0;_0x95ecdf<_0xd54ff9[_0x2d22('0xf6')][_0x2d22('0xfd')][_0x2d22('0x39')];_0x95ecdf++){var _0x27e890=_0xd54ff9[_0x2d22('0xf6')]['Intervals'][_0x95ecdf][_0x2d22('0x27')]({'plain':!![]});_0x426576[_0x2d22('0xac')](iftimePromise(_0x27e890,_0xd54ff9));}return BPromise[_0x2d22('0xfe')](_0x426576)[_0x2d22('0x25')](function(_0x2d72c4){return _[_0x2d22('0xff')](_0x2d72c4);});}else{return!![];}})['then'](function(_0x17a72a){var _0xced008=fs['readFileSync'](path[_0x2d22('0x63')](config[_0x2d22('0x64')],_0x2d22('0x100')),_0x2d22('0xc1'));var _0x566823={'remote':_0xd54ff9['remote'],'query':querystring[_0x2d22('0x15')](_[_0x2d22('0x43')](_0xd54ff9[_0x2d22('0x27')]({'plain':!![]}),{'customerIp':_0x2f16d3[_0x2d22('0x94')]['x-forwarded-for']||_0x2f16d3[_0x2d22('0x94')][_0x2d22('0x101')]||_0x2f16d3[_0x2d22('0x102')][_0x2d22('0x103')]||_0x2f16d3['ip'],'referer':_0x2f16d3[_0x2d22('0x94')][_0x2d22('0x9a')],'openedInteractions':_0x2c78a5,'maxInteractions':_0x4254ea,'virtual':_0x9d6e[_0x2d22('0xf8')],'online':_0x17a72a,'custom':_0x9d6e}))[_0x2d22('0x104')](/'/g,'\x5c\x27')};_0x3a951b[_0x2d22('0x2b')](ejs[_0x2d22('0xc2')](Mustache[_0x2d22('0xc2')](_0xced008,_0x566823),{'proactiveActions':_0x381e1c,'alignment':_0xd54ff9[_0x2d22('0x105')],'verticalAlignment':_0xd54ff9[_0x2d22('0x106')],'div_color':_0xd54ff9['color'],'labelText':_0xd54ff9['labelText'],'text_color':_0xd54ff9[_0x2d22('0x107')],'text_button_color':_0xd54ff9[_0x2d22('0x108')],'button_color':_0xd54ff9['color_button'],'background_color':_0xd54ff9[_0x2d22('0x109')],'hideWhenOffline':_0xd54ff9[_0x2d22('0x10a')],'interval':_0xd54ff9[_0x2d22('0x10b')]}));})[_0x2d22('0x1a')](handleError(_0x3a951b,null));};exports[_0x2d22('0x10c')]=function(_0x378150,_0x1f3413){var _0x1e9803=_0x378150[_0x2d22('0x53')]['id'];var _0x249b51=_0x378150[_0x2d22('0x4c')];var _0x5703de=0xc8;var _0x50f9f0=null;return db['sequelize'][_0x2d22('0xce')]({'isolationLevel':db[_0x2d22('0xcd')]['Transaction'][_0x2d22('0x10d')][_0x2d22('0x10e')]},function(_0x13ad08){return db[_0x2d22('0x2f')]['findOne']({'where':{'id':_0x1e9803},'transaction':_0x13ad08})[_0x2d22('0x25')](function(_0x598176){if(_0x598176){return db[_0x2d22('0x88')]['destroy']({'where':{'ChatWebsiteId':_0x1e9803},'transaction':_0x13ad08})['then'](function(){var _0x5818d1=_[_0x2d22('0x2e')](_0x249b51,function(_0x52e47a){_0x52e47a['ChatWebsiteId']=_0x1e9803;return _0x52e47a;});return db['ChatApplication'][_0x2d22('0xd0')](_0x5818d1,{'transaction':_0x13ad08});});}else{_0x5703de=0x194;_0x50f9f0=[];}});})[_0x2d22('0x25')](function(){if(_0x5703de!==0x194){return db[_0x2d22('0x88')][_0x2d22('0x10f')]({'where':{'ChatWebsiteId':_0x1e9803},'order':_0x2d22('0x8e')})[_0x2d22('0x25')](function(_0x1733a9){_0x50f9f0=_0x1733a9;});}})[_0x2d22('0x1a')](function(_0x4bc955){_0x5703de=0x1f4;logger[_0x2d22('0x16')](_0x4bc955[_0x2d22('0x29')]);if(_0x4bc955[_0x2d22('0x2a')]){delete _0x4bc955['name'];}_0x50f9f0=_0x4bc955;})[_0x2d22('0x110')](function(){if(_0x50f9f0===null){_0x1f3413[_0x2d22('0x111')](_0x5703de);}else{if(_0x5703de===0x1f4){_0x1f3413['status'](_0x5703de)[_0x2d22('0x2b')](_0x50f9f0);}else{_0x1f3413['status'](_0x5703de)[_0x2d22('0x23')](_0x50f9f0);}}});};exports['getApplications']=function(_0x5cf576,_0x517f4f){var _0x5bca99={};var _0x9de26f={};var _0x2fc384;var _0xea71c9;return db[_0x2d22('0x2f')][_0x2d22('0x5b')]({'where':{'id':_0x5cf576[_0x2d22('0x53')]['id']}})[_0x2d22('0x25')](handleEntityNotFound(_0x517f4f,null))['then'](function(_0x973e56){if(_0x973e56){_0x2fc384=_0x973e56;_0x9de26f[_0x2d22('0x32')]=_[_0x2d22('0x34')](db[_0x2d22('0x88')]['rawAttributes']);_0x9de26f[_0x2d22('0x33')]=_['keys'](_0x5cf576[_0x2d22('0x33')]);_0x9de26f['filters']=_[_0x2d22('0x37')](_0x9de26f[_0x2d22('0x32')],_0x9de26f[_0x2d22('0x33')]);_0x5bca99[_0x2d22('0x36')]=_['intersection'](_0x9de26f['model'],qs[_0x2d22('0x38')](_0x5cf576['query']['fields']));_0x5bca99[_0x2d22('0x36')]=_0x5bca99[_0x2d22('0x36')]['length']?_0x5bca99[_0x2d22('0x36')]:_0x9de26f['model'];_0x5bca99['order']=qs[_0x2d22('0x3d')](_0x5cf576['query']['sort']);_0x5bca99[_0x2d22('0x3e')]=qs['filters'](_['pick'](_0x5cf576['query'],_0x9de26f[_0x2d22('0x35')]));if(_0x5cf576[_0x2d22('0x33')]['filter']){_0x5bca99[_0x2d22('0x3e')]=_[_0x2d22('0x43')](_0x5bca99[_0x2d22('0x3e')],{'$or':_[_0x2d22('0x2e')](_0x5bca99['attributes'],function(_0xad64bd){var _0x4206dc={};_0x4206dc[_0xad64bd]={'$like':'%'+_0x5cf576[_0x2d22('0x33')]['filter']+'%'};return _0x4206dc;})});}_0x5bca99=_['merge']({},_0x5bca99,_0x5cf576[_0x2d22('0x49')]);return _0x2fc384[_0x2d22('0x112')](_0x5bca99);}})[_0x2d22('0x25')](function(_0x247129){if(_0x247129){_0xea71c9=_0x247129['length'];if(!_0x5cf576[_0x2d22('0x33')][_0x2d22('0x3a')](_0x2d22('0x3b'))){_0x5bca99[_0x2d22('0x1f')]=qs[_0x2d22('0x1f')](_0x5cf576['query'][_0x2d22('0x1f')]);_0x5bca99[_0x2d22('0x1d')]=qs[_0x2d22('0x1d')](_0x5cf576[_0x2d22('0x33')]['offset']);}return _0x2fc384[_0x2d22('0x112')](_0x5bca99);}})[_0x2d22('0x25')](function(_0x17393a){if(_0x17393a){return _0x17393a?{'count':_0xea71c9,'rows':_0x17393a}:null;}})[_0x2d22('0x25')](respondWithResult(_0x517f4f,null))[_0x2d22('0x1a')](handleError(_0x517f4f,null));};exports['addProactiveActions']=function(_0x375d9d,_0x223bff){return db[_0x2d22('0x113')]['find']({'where':{'id':_0x375d9d[_0x2d22('0x53')]['id']}})[_0x2d22('0x25')](handleEntityNotFound(_0x223bff,null))[_0x2d22('0x25')](function(_0x4a6d0e){if(_0x4a6d0e){return _0x4a6d0e[_0x2d22('0x114')](_0x375d9d['body']['ids'],_[_0x2d22('0xe3')](_0x375d9d[_0x2d22('0x4c')],[_0x2d22('0xe4'),'id'])||{});}})[_0x2d22('0x25')](respondWithResult(_0x223bff,null))['catch'](handleError(_0x223bff,null));};exports[_0x2d22('0xf7')]=function(_0x5d28e8,_0x2b8ca0){var _0x28dd38={};var _0x3551b2={};var _0xcf1dc5;var _0x4578eb;return db['ChatWebsite']['findOne']({'where':{'id':_0x5d28e8[_0x2d22('0x53')]['id']}})['then'](handleEntityNotFound(_0x2b8ca0,null))[_0x2d22('0x25')](function(_0x1774be){if(_0x1774be){_0xcf1dc5=_0x1774be;_0x3551b2[_0x2d22('0x32')]=_[_0x2d22('0x34')](db['ChatProactiveAction'][_0x2d22('0x30')]);_0x3551b2[_0x2d22('0x33')]=_[_0x2d22('0x34')](_0x5d28e8['query']);_0x3551b2[_0x2d22('0x35')]=_[_0x2d22('0x37')](_0x3551b2['model'],_0x3551b2[_0x2d22('0x33')]);_0x28dd38['attributes']=_[_0x2d22('0x37')](_0x3551b2['model'],qs[_0x2d22('0x38')](_0x5d28e8[_0x2d22('0x33')]['fields']));_0x28dd38[_0x2d22('0x36')]=_0x28dd38[_0x2d22('0x36')][_0x2d22('0x39')]?_0x28dd38[_0x2d22('0x36')]:_0x3551b2[_0x2d22('0x32')];_0x28dd38['order']=qs['sort'](_0x5d28e8['query'][_0x2d22('0x3d')]);_0x28dd38[_0x2d22('0x3e')]=qs[_0x2d22('0x35')](_[_0x2d22('0x3f')](_0x5d28e8[_0x2d22('0x33')],_0x3551b2[_0x2d22('0x35')]));if(_0x5d28e8[_0x2d22('0x33')]['filter']){_0x28dd38['where']=_[_0x2d22('0x43')](_0x28dd38[_0x2d22('0x3e')],{'$or':_[_0x2d22('0x2e')](_0x28dd38[_0x2d22('0x36')],function(_0x1afdf7){var _0x2dc1f4={};_0x2dc1f4[_0x1afdf7]={'$like':'%'+_0x5d28e8[_0x2d22('0x33')][_0x2d22('0x40')]+'%'};return _0x2dc1f4;})});}_0x28dd38=_[_0x2d22('0x43')]({},_0x28dd38,_0x5d28e8[_0x2d22('0x49')]);return _0xcf1dc5[_0x2d22('0xf7')](_0x28dd38);}})[_0x2d22('0x25')](function(_0x4fbd7f){if(_0x4fbd7f){_0x4578eb=_0x4fbd7f['length'];if(!_0x5d28e8[_0x2d22('0x33')][_0x2d22('0x3a')]('nolimit')){_0x28dd38['limit']=qs[_0x2d22('0x1f')](_0x5d28e8[_0x2d22('0x33')][_0x2d22('0x1f')]);_0x28dd38[_0x2d22('0x1d')]=qs[_0x2d22('0x1d')](_0x5d28e8['query'][_0x2d22('0x1d')]);}return _0xcf1dc5[_0x2d22('0xf7')](_0x28dd38);}})[_0x2d22('0x25')](function(_0x336118){if(_0x336118){return _0x336118?{'count':_0x4578eb,'rows':_0x336118}:null;}})[_0x2d22('0x25')](respondWithResult(_0x2b8ca0,null))[_0x2d22('0x1a')](handleError(_0x2b8ca0,null));};exports[_0x2d22('0x115')]=function(_0x359e5e,_0x2ae754){var _0x522cad=_0x359e5e[_0x2d22('0x33')]['online']===_0x2d22('0x116')?_0x2d22('0x117'):'onlineForm';return db[_0x2d22('0x2f')]['find']({'attributes':['id',_0x522cad],'where':{'id':_0x359e5e[_0x2d22('0x53')]['id']}})[_0x2d22('0x25')](handleEntityNotFound(_0x2ae754,null))[_0x2d22('0x25')](function(_0x9d10af){if(_0x9d10af){var _0x2f8a25=_0x9d10af[_0x522cad];var _0x9a0d2e=_0x2f8a25&&_0x2f8a25['items']?_0x2f8a25[_0x2d22('0x118')]:[];_0x2ae754[_0x2d22('0x2b')]({'fromKey':_[_0x2d22('0x68')](_0x2f8a25[_0x2d22('0x119')])?undefined:_0x2f8a25['fromKey'],'count':_0x9a0d2e[_0x2d22('0x39')],'rows':_0x9a0d2e});}})[_0x2d22('0x1a')](handleError(_0x2ae754,null));};exports[_0x2d22('0x11a')]=function(_0x84ff5e,_0x50a532){var _0x466341={'raw':![],'where':{}};var _0x5e72cf={};var _0x3120d7={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2d22('0x5b')]({'where':{'id':_0x84ff5e['params']['id']}})['then'](handleEntityNotFound(_0x50a532,null))[_0x2d22('0x25')](function(_0x451b9b){if(_0x451b9b){_0x5e72cf[_0x2d22('0x32')]=_[_0x2d22('0x34')](db[_0x2d22('0xc5')][_0x2d22('0x30')]);_0x5e72cf['query']=_[_0x2d22('0x34')](_0x84ff5e[_0x2d22('0x33')]);_0x5e72cf[_0x2d22('0x35')]=_['intersection'](_0x5e72cf[_0x2d22('0x32')],_0x5e72cf[_0x2d22('0x33')]);_0x466341[_0x2d22('0x36')]=_[_0x2d22('0x37')](_0x5e72cf['model'],qs[_0x2d22('0x38')](_0x84ff5e[_0x2d22('0x33')]['fields']));_0x466341[_0x2d22('0x36')]=_0x466341[_0x2d22('0x36')][_0x2d22('0x39')]?_0x466341[_0x2d22('0x36')]:_0x5e72cf['model'];if(!_0x84ff5e[_0x2d22('0x33')]['hasOwnProperty'](_0x2d22('0x3b'))){_0x466341[_0x2d22('0x1f')]=qs[_0x2d22('0x1f')](_0x84ff5e[_0x2d22('0x33')]['limit']);_0x466341[_0x2d22('0x1d')]=qs[_0x2d22('0x1d')](_0x84ff5e['query'][_0x2d22('0x1d')]);}_0x466341[_0x2d22('0x3c')]=qs[_0x2d22('0x3d')](_0x84ff5e[_0x2d22('0x33')][_0x2d22('0x3d')]);_0x466341[_0x2d22('0x3e')]=qs[_0x2d22('0x35')](_[_0x2d22('0x3f')](_0x84ff5e[_0x2d22('0x33')],_0x5e72cf[_0x2d22('0x35')]));_0x466341[_0x2d22('0x3e')][_0x2d22('0x55')]=_0x451b9b['id'];if(_0x84ff5e['query'][_0x2d22('0x40')]){_0x466341[_0x2d22('0x3e')]=_[_0x2d22('0x43')](_0x466341[_0x2d22('0x3e')],{'$or':_['map'](_0x466341[_0x2d22('0x36')],function(_0xf07d0e){var _0x1ebc89={};_0x1ebc89[_0xf07d0e]={'$like':'%'+_0x84ff5e[_0x2d22('0x33')]['filter']+'%'};return _0x1ebc89;})});}_0x466341=_['merge']({},_0x466341,_0x84ff5e[_0x2d22('0x49')]);return db[_0x2d22('0xc5')][_0x2d22('0x20')]({'where':_0x466341['where']})['then'](function(_0x1f4946){_0x3120d7[_0x2d22('0x20')]=_0x1f4946;if(_0x84ff5e['query']['includeAll']){_0x466341[_0x2d22('0x48')]=[{'all':!![]}];}else{_0x466341['include']=[{'model':db[_0x2d22('0x77')],'as':_0x2d22('0xe5'),'required':![]},{'model':db[_0x2d22('0xcf')],'as':_0x2d22('0x11b'),'required':![]}];}return db[_0x2d22('0xc5')][_0x2d22('0x57')](_0x466341);})[_0x2d22('0x25')](function(_0x395be0){_0x3120d7[_0x2d22('0x45')]=_0x395be0;return _0x3120d7;});}})[_0x2d22('0x25')](respondWithFilteredResult(_0x50a532,_0x466341))[_0x2d22('0x1a')](handleError(_0x50a532,null));};exports['addAgents']=function(_0x4ce8e3,_0x359074){return db[_0x2d22('0x2f')][_0x2d22('0x4a')]({'where':{'id':_0x4ce8e3[_0x2d22('0x53')]['id']}})[_0x2d22('0x25')](handleEntityNotFound(_0x359074,null))[_0x2d22('0x25')](function(_0xe09f0a){if(_0xe09f0a){return _0xe09f0a[_0x2d22('0x11c')](_0x4ce8e3[_0x2d22('0x4c')][_0x2d22('0xe4')],_[_0x2d22('0xe3')](_0x4ce8e3[_0x2d22('0x4c')],[_0x2d22('0xe4'),'id'])||{})[_0x2d22('0xa8')](function(_0x4dfc84){for(var _0x5096c8=0x0;_0x5096c8<_0x4ce8e3[_0x2d22('0x4c')][_0x2d22('0xe4')][_0x2d22('0x39')];_0x5096c8+=0x1){socket[_0x2d22('0x11d')](_0x2d22('0x11e'),{'UserId':Number(_0x4ce8e3['body'][_0x2d22('0xe4')][_0x5096c8]),'ChatWebsiteId':Number(_0x4ce8e3[_0x2d22('0x53')]['id'])});}return _0x4dfc84;});}})[_0x2d22('0x25')](respondWithResult(_0x359074,null))[_0x2d22('0x1a')](handleError(_0x359074,null));};exports['removeAgents']=function(_0x19d6b5,_0x49cca7){return db[_0x2d22('0x2f')][_0x2d22('0x4a')]({'where':{'id':_0x19d6b5[_0x2d22('0x53')]['id']}})[_0x2d22('0x25')](handleEntityNotFound(_0x49cca7,null))['then'](function(_0x340216){if(_0x340216){return _0x340216[_0x2d22('0x11f')](_0x19d6b5['query'][_0x2d22('0xe4')])[_0x2d22('0x25')](function(){if(_[_0x2d22('0x120')](_0x19d6b5[_0x2d22('0x33')][_0x2d22('0xe4')])){for(var _0x38274b=0x0;_0x38274b<_0x19d6b5[_0x2d22('0x33')][_0x2d22('0xe4')][_0x2d22('0x39')];_0x38274b+=0x1){socket[_0x2d22('0x11d')]('userChatWebsite:remove',{'UserId':Number(_0x19d6b5[_0x2d22('0x33')][_0x2d22('0xe4')][_0x38274b]),'ChatWebsiteId':Number(_0x19d6b5[_0x2d22('0x53')]['id'])});}}else{socket[_0x2d22('0x11d')](_0x2d22('0x121'),{'UserId':Number(_0x19d6b5[_0x2d22('0x33')][_0x2d22('0xe4')]),'ChatWebsiteId':Number(_0x19d6b5[_0x2d22('0x53')]['id'])});}});}})[_0x2d22('0x25')](respondWithStatusCode(_0x49cca7,null))[_0x2d22('0x1a')](handleError(_0x49cca7,null));};exports[_0x2d22('0x122')]=function(_0x31fc13,_0x561cd2){var _0xbaa559={};var _0x35bafd={};var _0x22098c;var _0x55e958;return db[_0x2d22('0x2f')][_0x2d22('0x5b')]({'where':{'id':_0x31fc13[_0x2d22('0x53')]['id']}})[_0x2d22('0x25')](handleEntityNotFound(_0x561cd2,null))[_0x2d22('0x25')](function(_0x29e428){if(_0x29e428){_0x22098c=_0x29e428;_0x35bafd['model']=_[_0x2d22('0x34')](db[_0x2d22('0xb1')][_0x2d22('0x30')]);_0x35bafd[_0x2d22('0x33')]=_[_0x2d22('0x34')](_0x31fc13[_0x2d22('0x33')]);_0x35bafd[_0x2d22('0x35')]=_['intersection'](_0x35bafd[_0x2d22('0x32')],_0x35bafd[_0x2d22('0x33')]);_0xbaa559[_0x2d22('0x36')]=_['intersection'](_0x35bafd['model'],qs[_0x2d22('0x38')](_0x31fc13[_0x2d22('0x33')][_0x2d22('0x38')]));_0xbaa559[_0x2d22('0x36')]=_0xbaa559['attributes'][_0x2d22('0x39')]?_0xbaa559['attributes']:_0x35bafd[_0x2d22('0x32')];_0xbaa559[_0x2d22('0x3c')]=qs[_0x2d22('0x3d')](_0x31fc13[_0x2d22('0x33')][_0x2d22('0x3d')]);_0xbaa559[_0x2d22('0x3e')]=qs[_0x2d22('0x35')](_['pick'](_0x31fc13[_0x2d22('0x33')],_0x35bafd[_0x2d22('0x35')]));if(_0x31fc13[_0x2d22('0x33')][_0x2d22('0x40')]){_0xbaa559[_0x2d22('0x3e')]=_[_0x2d22('0x43')](_0xbaa559[_0x2d22('0x3e')],{'$or':_[_0x2d22('0x2e')](_0xbaa559[_0x2d22('0x36')],function(_0x8ba63b){var _0xc91eaa={};_0xc91eaa[_0x8ba63b]={'$like':'%'+_0x31fc13[_0x2d22('0x33')][_0x2d22('0x40')]+'%'};return _0xc91eaa;})});}_0xbaa559=_[_0x2d22('0x43')]({},_0xbaa559,_0x31fc13[_0x2d22('0x49')]);return _0x22098c['getAgents'](_0xbaa559);}})[_0x2d22('0x25')](function(_0x2ba4ba){if(_0x2ba4ba){_0x55e958=_0x2ba4ba[_0x2d22('0x39')];if(!_0x31fc13[_0x2d22('0x33')][_0x2d22('0x3a')](_0x2d22('0x3b'))){_0xbaa559[_0x2d22('0x1f')]=qs[_0x2d22('0x1f')](_0x31fc13[_0x2d22('0x33')]['limit']);_0xbaa559['offset']=qs['offset'](_0x31fc13[_0x2d22('0x33')][_0x2d22('0x1d')]);}return _0x22098c[_0x2d22('0x122')](_0xbaa559);}})[_0x2d22('0x25')](function(_0xcffb5a){if(_0xcffb5a){return _0xcffb5a?{'count':_0x55e958,'rows':_0xcffb5a}:null;}})[_0x2d22('0x25')](respondWithResult(_0x561cd2,null))[_0x2d22('0x1a')](handleError(_0x561cd2,null));};
\ No newline at end of file
index b60bc10..724736e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f75=['setMaxListeners','remove','emit','exports','events','ChatWebsite'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0x9f75,0x15a));var _0x59f7=function(_0xcabc9f,_0x260c38){_0xcabc9f=_0xcabc9f-0x0;var _0x540652=_0x9f75[_0xcabc9f];return _0x540652;};'use strict';var EventEmitter=require(_0x59f7('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x59f7('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x59f7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x59f7('0x3')};function emitEvent(_0x455b84){return function(_0x3b92a2,_0x33128b,_0x4b5ea6){ChatWebsiteEvents[_0x59f7('0x4')](_0x455b84+':'+_0x3b92a2['id'],_0x3b92a2);ChatWebsiteEvents[_0x59f7('0x4')](_0x455b84,_0x3b92a2);_0x4b5ea6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x59f7('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x8388=['exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update','remove','emit','hook'];(function(_0x59076e,_0xf93c80){var _0xf0c9c5=function(_0x10ba5a){while(--_0x10ba5a){_0x59076e['push'](_0x59076e['shift']());}};_0xf0c9c5(++_0xf93c80);}(_0x8388,0x18d));var _0x8838=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0x8388[_0x5678b5];return _0x4c09a5;};'use strict';var EventEmitter=require(_0x8838('0x0'));var ChatWebsite=require(_0x8838('0x1'))['db'][_0x8838('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8838('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8838('0x4'),'afterDestroy':_0x8838('0x5')};function emitEvent(_0x316297){return function(_0x20a813,_0xd474f2,_0x5036bd){ChatWebsiteEvents[_0x8838('0x6')](_0x316297+':'+_0x20a813['id'],_0x20a813);ChatWebsiteEvents[_0x8838('0x6')](_0x316297,_0x20a813);_0x5036bd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x8838('0x7')](e,emitEvent(event));}}module[_0x8838('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
index f17b115..7d49bb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdee0=['../../config/logger','moment','request-promise','path','./chatWebsite.attributes','define','ChatWebsite','lodash','util'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0xdee0,0x14b));var _0x0dee=function(_0x41342e,_0x427f74){_0x41342e=_0x41342e-0x0;var _0x5155e6=_0xdee0[_0x41342e];return _0x5155e6;};'use strict';var _=require(_0x0dee('0x0'));var util=require(_0x0dee('0x1'));var logger=require(_0x0dee('0x2'))('api');var moment=require(_0x0dee('0x3'));var BPromise=require('bluebird');var rp=require(_0x0dee('0x4'));var fs=require('fs');var path=require(_0x0dee('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0dee('0x6'));module['exports']=function(_0x57ab58,_0x3df09f){return _0x57ab58[_0x0dee('0x7')](_0x0dee('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x23cb=['moment','bluebird','rimraf','../../config/environment','./chatWebsite.attributes','exports','chat_websites','util','../../config/logger'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x23cb,0x1ed));var _0xb23c=function(_0x15449d,_0x537b1d){_0x15449d=_0x15449d-0x0;var _0x55cf8c=_0x23cb[_0x15449d];return _0x55cf8c;};'use strict';var _=require('lodash');var util=require(_0xb23c('0x0'));var logger=require(_0xb23c('0x1'))('api');var moment=require(_0xb23c('0x2'));var BPromise=require(_0xb23c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb23c('0x4'));var config=require(_0xb23c('0x5'));var attributes=require(_0xb23c('0x6'));module[_0xb23c('0x7')]=function(_0x4eb266,_0x411fe8){return _0x4eb266['define']('ChatWebsite',attributes,{'tableName':_0xb23c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 26288de..81a1d8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b18=['socket.io-emitter','./chatWebsite.socket','request','then','ChatWebsite,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','localhost'];(function(_0x8fe20c,_0x520033){var _0x497ab7=function(_0x209d5a){while(--_0x209d5a){_0x8fe20c['push'](_0x8fe20c['shift']());}};_0x497ab7(++_0x520033);}(_0x8b18,0x1d7));var _0x88b1=function(_0x1001b5,_0x5db1d7){_0x1001b5=_0x1001b5-0x0;var _0x395e34=_0x8b18[_0x1001b5];return _0x395e34;};'use strict';var _=require(_0x88b1('0x0'));var util=require(_0x88b1('0x1'));var moment=require(_0x88b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x88b1('0x3'));var fs=require('fs');var Redis=require(_0x88b1('0x4'));var db=require(_0x88b1('0x5'))['db'];var utils=require(_0x88b1('0x6'));var logger=require(_0x88b1('0x7'))(_0x88b1('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x88b1('0x9')]({'port':0x232a});config[_0x88b1('0xa')]=_['defaults'](config[_0x88b1('0xa')],{'host':_0x88b1('0xb'),'port':0x18eb});var socket=require(_0x88b1('0xc'))(new Redis(config[_0x88b1('0xa')]));require(_0x88b1('0xd'))['register'](socket);function respondWithRpcPromise(_0x4fbe17,_0x308bda,_0x1e1c4b){return new BPromise(function(_0x5cecd9,_0x426be1){return client[_0x88b1('0xe')](_0x4fbe17,_0x1e1c4b)[_0x88b1('0xf')](function(_0x81ed2b){logger['info'](_0x88b1('0x10'),_0x308bda,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x308bda,'request\x20sent',JSON[_0x88b1('0x11')](_0x81ed2b));if(_0x81ed2b[_0x88b1('0x12')]){if(_0x81ed2b[_0x88b1('0x12')][_0x88b1('0x13')]===0x1f4){logger[_0x88b1('0x12')](_0x88b1('0x10'),_0x308bda,_0x81ed2b[_0x88b1('0x12')][_0x88b1('0x14')]);return _0x426be1(_0x81ed2b['error'][_0x88b1('0x14')]);}logger[_0x88b1('0x12')](_0x88b1('0x10'),_0x308bda,_0x81ed2b['error'][_0x88b1('0x14')]);return _0x5cecd9(_0x81ed2b['error'][_0x88b1('0x14')]);}else{logger[_0x88b1('0x15')](_0x88b1('0x10'),_0x308bda,_0x88b1('0x16'));_0x5cecd9(_0x81ed2b['result'][_0x88b1('0x14')]);}})['catch'](function(_0x40e6d1){logger[_0x88b1('0x12')](_0x88b1('0x10'),_0x308bda,_0x40e6d1);_0x426be1(_0x40e6d1);});});}
\ No newline at end of file
+var _0x1b31=['./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x1b31,0xf6));var _0x11b3=function(_0x193d4f,_0xd0bec0){_0x193d4f=_0x193d4f-0x0;var _0x454047=_0x1b31[_0x193d4f];return _0x454047;};'use strict';var _=require(_0x11b3('0x0'));var util=require(_0x11b3('0x1'));var moment=require(_0x11b3('0x2'));var BPromise=require(_0x11b3('0x3'));var rs=require(_0x11b3('0x4'));var fs=require('fs');var Redis=require(_0x11b3('0x5'));var db=require(_0x11b3('0x6'))['db'];var utils=require(_0x11b3('0x7'));var logger=require('../../config/logger')(_0x11b3('0x8'));var config=require(_0x11b3('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x11b3('0xa')]({'port':0x232a});config[_0x11b3('0xb')]=_[_0x11b3('0xc')](config[_0x11b3('0xb')],{'host':_0x11b3('0xd'),'port':0x18eb});var socket=require(_0x11b3('0xe'))(new Redis(config[_0x11b3('0xb')]));require(_0x11b3('0xf'))[_0x11b3('0x10')](socket);function respondWithRpcPromise(_0x4208e0,_0x43f6cf,_0xf78d31){return new BPromise(function(_0x24ac83,_0xf8e138){return client[_0x11b3('0x11')](_0x4208e0,_0xf78d31)[_0x11b3('0x12')](function(_0x5eadaa){logger[_0x11b3('0x13')](_0x11b3('0x14'),_0x43f6cf,_0x11b3('0x15'));logger[_0x11b3('0x16')](_0x11b3('0x17'),_0x43f6cf,_0x11b3('0x15'),JSON[_0x11b3('0x18')](_0x5eadaa));if(_0x5eadaa[_0x11b3('0x19')]){if(_0x5eadaa[_0x11b3('0x19')][_0x11b3('0x1a')]===0x1f4){logger[_0x11b3('0x19')](_0x11b3('0x14'),_0x43f6cf,_0x5eadaa['error']['message']);return _0xf8e138(_0x5eadaa[_0x11b3('0x19')][_0x11b3('0x1b')]);}logger['error'](_0x11b3('0x14'),_0x43f6cf,_0x5eadaa[_0x11b3('0x19')][_0x11b3('0x1b')]);return _0x24ac83(_0x5eadaa['error'][_0x11b3('0x1b')]);}else{logger[_0x11b3('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x43f6cf,'request\x20sent');_0x24ac83(_0x5eadaa['result']['message']);}})[_0x11b3('0x1c')](function(_0x3a0d4a){logger[_0x11b3('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x43f6cf,_0x3a0d4a);_0xf8e138(_0x3a0d4a);});});}
\ No newline at end of file
index 4a40442..48dc8b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cdf=['./chatWebsite.events','remove','emit','removeListener','register','chatWebsite:'];(function(_0x18f6b2,_0x183360){var _0x25da3b=function(_0x4d342f){while(--_0x4d342f){_0x18f6b2['push'](_0x18f6b2['shift']());}};_0x25da3b(++_0x183360);}(_0x9cdf,0xba));var _0xf9cd=function(_0x4c4d73,_0x5c373d){_0x4c4d73=_0x4c4d73-0x0;var _0x3d67e1=_0x9cdf[_0x4c4d73];return _0x3d67e1;};'use strict';var ChatWebsiteEvents=require(_0xf9cd('0x0'));var events=['save',_0xf9cd('0x1'),'update'];function createListener(_0x223ed1,_0x3761ef){return function(_0x1ad2e4){_0x3761ef[_0xf9cd('0x2')](_0x223ed1,_0x1ad2e4);};}function removeListener(_0x1c1b40,_0x191ac2){return function(){ChatWebsiteEvents[_0xf9cd('0x3')](_0x1c1b40,_0x191ac2);};}exports[_0xf9cd('0x4')]=function(_0x115a9c){for(var _0x4ae2a9=0x0,_0x4e4532=events['length'];_0x4ae2a9<_0x4e4532;_0x4ae2a9++){var _0x1c25d6=events[_0x4ae2a9];var _0x5847fe=createListener(_0xf9cd('0x5')+_0x1c25d6,_0x115a9c);ChatWebsiteEvents['on'](_0x1c25d6,_0x5847fe);}};
\ No newline at end of file
+var _0xfda2=['register','chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfda2,0x175));var _0x2fda=function(_0x4f9c10,_0x24ebfe){_0x4f9c10=_0x4f9c10-0x0;var _0x5a6dcb=_0xfda2[_0x4f9c10];return _0x5a6dcb;};'use strict';var ChatWebsiteEvents=require(_0x2fda('0x0'));var events=[_0x2fda('0x1'),_0x2fda('0x2'),'update'];function createListener(_0x3cb173,_0xb04d9f){return function(_0x2667b3){_0xb04d9f[_0x2fda('0x3')](_0x3cb173,_0x2667b3);};}function removeListener(_0x5aabeb,_0x564400){return function(){ChatWebsiteEvents[_0x2fda('0x4')](_0x5aabeb,_0x564400);};}exports[_0x2fda('0x5')]=function(_0x6e14c0){for(var _0x1eade7=0x0,_0x58337f=events['length'];_0x1eade7<_0x58337f;_0x1eade7++){var _0x239152=events[_0x1eade7];var _0x198298=createListener(_0x2fda('0x6')+_0x239152,_0x6e14c0);ChatWebsiteEvents['on'](_0x239152,_0x198298);}};
\ No newline at end of file
index e764cdb..fa1cdb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0970=['getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','diskStorage','join','root','originalname','single','addLogo','server/files/images/avatars/','format','%s-%s','now','file','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','addApplications','addAgents','update','delete','removeDispositions','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/applications'];(function(_0x1647a3,_0x267788){var _0x271443=function(_0x2df32d){while(--_0x2df32d){_0x1647a3['push'](_0x1647a3['shift']());}};_0x271443(++_0x267788);}(_0x0970,0x6b));var _0x0097=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0970[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x0097('0x0'));var util=require('util');var path=require(_0x0097('0x1'));var timeout=require(_0x0097('0x2'));var express=require(_0x0097('0x3'));var router=express[_0x0097('0x4')]();var fs_extra=require(_0x0097('0x5'));var auth=require(_0x0097('0x6'));var interaction=require(_0x0097('0x7'));var config=require('../../config/environment');var controller=require(_0x0097('0x8'));router[_0x0097('0x9')]('/',auth[_0x0097('0xa')](),controller[_0x0097('0xb')]);router[_0x0097('0x9')](_0x0097('0xc'),auth[_0x0097('0xa')](),controller[_0x0097('0xd')]);router[_0x0097('0x9')](_0x0097('0xe'),auth['isAuthenticated'](),controller[_0x0097('0xf')]);router['get']('/:id/dispositions',auth[_0x0097('0xa')](),controller['getDispositions']);router[_0x0097('0x9')](_0x0097('0x10'),auth[_0x0097('0xa')](),controller[_0x0097('0x11')]);router[_0x0097('0x9')](_0x0097('0x12'),controller['getLogo']);router[_0x0097('0x9')](_0x0097('0x13'),controller[_0x0097('0x14')]);router[_0x0097('0x9')](_0x0097('0x15'),controller[_0x0097('0x16')]);router[_0x0097('0x9')]('/:id/system_avatar',controller[_0x0097('0x17')]);router[_0x0097('0x9')](_0x0097('0x18'),auth[_0x0097('0xa')](),controller[_0x0097('0x19')]);router[_0x0097('0x9')]('/:id/snippet',controller['getSnippet']);router[_0x0097('0x9')](_0x0097('0x1a'),auth[_0x0097('0xa')](),controller[_0x0097('0x1b')]);router[_0x0097('0x9')](_0x0097('0x1c'),auth['isAuthenticated'](),controller[_0x0097('0x1d')]);router[_0x0097('0x9')]('/:id/fields',controller[_0x0097('0x1e')]);router[_0x0097('0x9')]('/:id/offline_messages',auth[_0x0097('0xa')](),controller[_0x0097('0x1f')]);router[_0x0097('0x9')](_0x0097('0x20'),auth['isAuthenticated'](),controller[_0x0097('0x21')]);router[_0x0097('0x22')]('/',auth[_0x0097('0xa')](),controller[_0x0097('0x23')]);router[_0x0097('0x22')](_0x0097('0x24'),auth['isAuthenticated'](),controller[_0x0097('0x25')]);router['post'](_0x0097('0x10'),auth[_0x0097('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x0097('0x26')]({'destination':function(_0x299651,_0xd5c87d,_0x244cd2){_0x244cd2(null,path[_0x0097('0x27')](config[_0x0097('0x28')],'server/files/images/logos/'));},'filename':function(_0x18dbd0,_0x22ca17,_0x294367){_0x294367(null,util['format']('%s-%s',Date['now'](),_0x22ca17[_0x0097('0x29')]));}})});router['post']('/:id/logo',upload[_0x0097('0x2a')]('file'),controller[_0x0097('0x2b')]);var upload=multer({'storage':multer[_0x0097('0x26')]({'destination':function(_0x34b2da,_0x139b50,_0xc1f343){_0xc1f343(null,path[_0x0097('0x27')](config['root'],_0x0097('0x2c')));},'filename':function(_0x5bbe39,_0x4c92af,_0x1ff389){_0x1ff389(null,util[_0x0097('0x2d')](_0x0097('0x2e'),Date[_0x0097('0x2f')](),_0x4c92af[_0x0097('0x29')]));}})});router[_0x0097('0x22')]('/:id/avatar',upload[_0x0097('0x2a')](_0x0097('0x30')),controller['addAvatar']);var upload=multer({'storage':multer[_0x0097('0x26')]({'destination':function(_0x1c5c59,_0x76a561,_0x17dc58){_0x17dc58(null,path[_0x0097('0x27')](config[_0x0097('0x28')],_0x0097('0x2c')));},'filename':function(_0x144594,_0x4b426a,_0x4abfb1){_0x4abfb1(null,util[_0x0097('0x2d')](_0x0097('0x2e'),Date[_0x0097('0x2f')](),_0x4b426a[_0x0097('0x29')]));}})});router[_0x0097('0x22')](_0x0097('0x15'),upload['single'](_0x0097('0x30')),controller[_0x0097('0x31')]);var upload=multer({'storage':multer[_0x0097('0x26')]({'destination':function(_0x2be8ac,_0x2fb835,_0x346299){_0x346299(null,path[_0x0097('0x27')](config[_0x0097('0x28')],_0x0097('0x2c')));},'filename':function(_0x1f00dc,_0xafe4eb,_0x1ec511){_0x1ec511(null,util[_0x0097('0x2d')](_0x0097('0x2e'),Date[_0x0097('0x2f')](),_0xafe4eb[_0x0097('0x29')]));}})});router[_0x0097('0x22')](_0x0097('0x32'),upload['single'](_0x0097('0x30')),controller[_0x0097('0x33')]);router[_0x0097('0x22')](_0x0097('0x34'),controller[_0x0097('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x0097('0x26')]({'destination':function(_0x57dae0,_0x572877,_0x1b0593){const _0x25ef87=path[_0x0097('0x27')](config['root'],_0x0097('0x36'),'attachments',_0x0097('0x37'));fs_extra[_0x0097('0x38')](_0x25ef87,function(){_0x1b0593(null,_0x25ef87);});},'filename':function(_0x1faca4,_0x150a04,_0x29594f){const _0x123597=_0x150a04['originalname'][_0x0097('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5b1bd9=path[_0x0097('0x3a')](_0x123597);const _0x30dea2=Date[_0x0097('0x2f')]()+'-'+_0x123597[_0x0097('0x39')](_0x5b1bd9,'')+_0x5b1bd9;_0x29594f(null,_0x30dea2);}})});router[_0x0097('0x22')]('/:id/offline',offlineUploadMulter[_0x0097('0x3b')](),controller[_0x0097('0x3c')]);router[_0x0097('0x22')](_0x0097('0x18'),auth[_0x0097('0xa')](),controller[_0x0097('0x3d')]);router[_0x0097('0x22')](_0x0097('0x1a'),auth[_0x0097('0xa')](),controller[_0x0097('0x3e')]);router[_0x0097('0x22')]('/:id/proactive_actions',auth[_0x0097('0xa')](),controller['addProactiveActions']);router[_0x0097('0x22')]('/:id/users',auth[_0x0097('0xa')](),controller[_0x0097('0x3f')]);router['put'](_0x0097('0xe'),auth[_0x0097('0xa')](),controller[_0x0097('0x40')]);router[_0x0097('0x41')](_0x0097('0xe'),auth[_0x0097('0xa')](),controller['destroy']);router[_0x0097('0x41')]('/:id/dispositions',auth[_0x0097('0xa')](),controller[_0x0097('0x42')]);router['delete'](_0x0097('0x10'),auth[_0x0097('0xa')](),controller['removeAnswers']);router['delete'](_0x0097('0x20'),auth[_0x0097('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x713e=['/describe','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','originalname','single','file','addLogo','format','/:id/avatar','%s-%s','now','/:id/customer_avatar','addCustomerAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','/:id/users','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','get','isAuthenticated','index'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x713e,0xd9));var _0xe713=function(_0x266e80,_0xc5183a){_0x266e80=_0x266e80-0x0;var _0x26cbaa=_0x713e[_0x266e80];return _0x26cbaa;};'use strict';var multer=require(_0xe713('0x0'));var util=require(_0xe713('0x1'));var path=require('path');var timeout=require(_0xe713('0x2'));var express=require(_0xe713('0x3'));var router=express['Router']();var fs_extra=require(_0xe713('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router[_0xe713('0x5')]('/',auth[_0xe713('0x6')](),controller[_0xe713('0x7')]);router[_0xe713('0x5')](_0xe713('0x8'),auth[_0xe713('0x6')](),controller[_0xe713('0x9')]);router['get']('/:id',auth[_0xe713('0x6')](),controller['show']);router['get'](_0xe713('0xa'),auth[_0xe713('0x6')](),controller[_0xe713('0xb')]);router[_0xe713('0x5')](_0xe713('0xc'),auth['isAuthenticated'](),controller[_0xe713('0xd')]);router[_0xe713('0x5')](_0xe713('0xe'),controller[_0xe713('0xf')]);router['get']('/:id/avatar',controller[_0xe713('0x10')]);router[_0xe713('0x5')]('/:id/customer_avatar',controller[_0xe713('0x11')]);router[_0xe713('0x5')](_0xe713('0x12'),controller[_0xe713('0x13')]);router[_0xe713('0x5')](_0xe713('0x14'),auth[_0xe713('0x6')](),controller[_0xe713('0x15')]);router[_0xe713('0x5')](_0xe713('0x16'),controller[_0xe713('0x17')]);router['get']('/:id/applications',auth[_0xe713('0x6')](),controller[_0xe713('0x18')]);router[_0xe713('0x5')](_0xe713('0x19'),auth[_0xe713('0x6')](),controller[_0xe713('0x1a')]);router[_0xe713('0x5')](_0xe713('0x1b'),controller['getFields']);router['get'](_0xe713('0x1c'),auth[_0xe713('0x6')](),controller[_0xe713('0x1d')]);router['get']('/:id/users',auth[_0xe713('0x6')](),controller[_0xe713('0x1e')]);router[_0xe713('0x1f')]('/',auth[_0xe713('0x6')](),controller[_0xe713('0x20')]);router[_0xe713('0x1f')](_0xe713('0xa'),auth[_0xe713('0x6')](),controller[_0xe713('0x21')]);router[_0xe713('0x1f')](_0xe713('0xc'),auth['isAuthenticated'](),controller[_0xe713('0x22')]);var upload=multer({'storage':multer[_0xe713('0x23')]({'destination':function(_0x44837a,_0x3ac756,_0x469cb0){_0x469cb0(null,path[_0xe713('0x24')](config[_0xe713('0x25')],_0xe713('0x26')));},'filename':function(_0x11b78b,_0x3bf0c3,_0x1e5fbd){_0x1e5fbd(null,util['format']('%s-%s',Date['now'](),_0x3bf0c3[_0xe713('0x27')]));}})});router[_0xe713('0x1f')](_0xe713('0xe'),upload[_0xe713('0x28')](_0xe713('0x29')),controller[_0xe713('0x2a')]);var upload=multer({'storage':multer[_0xe713('0x23')]({'destination':function(_0x42f136,_0x46f3a1,_0xe30416){_0xe30416(null,path[_0xe713('0x24')](config[_0xe713('0x25')],'server/files/images/avatars/'));},'filename':function(_0x222d30,_0x5560dc,_0x445265){_0x445265(null,util[_0xe713('0x2b')]('%s-%s',Date['now'](),_0x5560dc[_0xe713('0x27')]));}})});router['post'](_0xe713('0x2c'),upload[_0xe713('0x28')](_0xe713('0x29')),controller['addAvatar']);var upload=multer({'storage':multer[_0xe713('0x23')]({'destination':function(_0x3490aa,_0x1efd00,_0x40b639){_0x40b639(null,path[_0xe713('0x24')](config[_0xe713('0x25')],'server/files/images/avatars/'));},'filename':function(_0x437b32,_0x133f21,_0xe38046){_0xe38046(null,util[_0xe713('0x2b')](_0xe713('0x2d'),Date[_0xe713('0x2e')](),_0x133f21[_0xe713('0x27')]));}})});router['post'](_0xe713('0x2f'),upload[_0xe713('0x28')](_0xe713('0x29')),controller[_0xe713('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4c823f,_0x437370,_0xffa256){_0xffa256(null,path[_0xe713('0x24')](config['root'],_0xe713('0x31')));},'filename':function(_0x8a6914,_0x4894dc,_0xfcc7aa){_0xfcc7aa(null,util[_0xe713('0x2b')](_0xe713('0x2d'),Date[_0xe713('0x2e')](),_0x4894dc[_0xe713('0x27')]));}})});router[_0xe713('0x1f')](_0xe713('0x12'),upload['single'](_0xe713('0x29')),controller[_0xe713('0x32')]);router[_0xe713('0x1f')](_0xe713('0x33'),controller[_0xe713('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0xe713('0x23')]({'destination':function(_0x248156,_0x6866cb,_0x8b4a92){const _0x145e77=path[_0xe713('0x24')](config[_0xe713('0x25')],_0xe713('0x35'),_0xe713('0x36'),_0xe713('0x37'));fs_extra[_0xe713('0x38')](_0x145e77,function(){_0x8b4a92(null,_0x145e77);});},'filename':function(_0x4f91a8,_0x230993,_0x18a416){const _0x40fb8b=_0x230993[_0xe713('0x27')][_0xe713('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x36c823=path[_0xe713('0x3a')](_0x40fb8b);const _0x1499d9=Date['now']()+'-'+_0x40fb8b[_0xe713('0x39')](_0x36c823,'')+_0x36c823;_0x18a416(null,_0x1499d9);}})});router[_0xe713('0x1f')](_0xe713('0x3b'),offlineUploadMulter['any'](),controller[_0xe713('0x3c')]);router[_0xe713('0x1f')](_0xe713('0x14'),auth['isAuthenticated'](),controller[_0xe713('0x3d')]);router['post'](_0xe713('0x3e'),auth[_0xe713('0x6')](),controller[_0xe713('0x3f')]);router[_0xe713('0x1f')](_0xe713('0x19'),auth[_0xe713('0x6')](),controller[_0xe713('0x40')]);router[_0xe713('0x1f')](_0xe713('0x41'),auth[_0xe713('0x6')](),controller[_0xe713('0x42')]);router[_0xe713('0x43')](_0xe713('0x44'),auth[_0xe713('0x6')](),controller[_0xe713('0x45')]);router[_0xe713('0x46')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xe713('0x46')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe713('0x47')]);router[_0xe713('0x46')](_0xe713('0xc'),auth[_0xe713('0x6')](),controller[_0xe713('0x48')]);router[_0xe713('0x46')](_0xe713('0x41'),auth['isAuthenticated'](),controller[_0xe713('0x49')]);module[_0xe713('0x4a')]=router;
\ No newline at end of file
index d9c1fad..86ab986 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6567=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','express','../components/auth/service','Router','env','get'];(function(_0x5da384,_0x361070){var _0x2ea042=function(_0x8c698b){while(--_0x8c698b){_0x5da384['push'](_0x5da384['shift']());}};_0x2ea042(++_0x361070);}(_0x6567,0x8a));var _0x7656=function(_0x30d55d,_0x26c1ca){_0x30d55d=_0x30d55d-0x0;var _0x451cb4=_0x6567[_0x30d55d];return _0x451cb4;};var beaverLogger=require('beaver-logger/server');var express=require(_0x7656('0x0'));var auth=require(_0x7656('0x1'));var config=require('../config/environment');var router=express[_0x7656('0x2')]();var isProduction=config[_0x7656('0x3')]==='production'||![];function clientSideLogs(_0x45c1fa,_0xd555c6,_0x1aa51c){var _0x53ebd2=_0x45c1fa['app'][_0x7656('0x4')]('client-side-logger');if(!_0x53ebd2){throw new Error(_0x7656('0x5'));}return beaverLogger[_0x7656('0x6')]({'uri':_0x7656('0x7'),'logger':_0x53ebd2,'enableCors':!isProduction})(_0x45c1fa,_0xd555c6,_0x1aa51c);}router[_0x7656('0x8')](auth[_0x7656('0x9')](),clientSideLogs);module[_0x7656('0xa')]=router;
\ No newline at end of file
+var _0xe108=['production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','express','../components/auth/service','../config/environment','Router'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xe108,0x134));var _0x8e10=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xe108[_0x7e2eb0];return _0xd92de4;};var beaverLogger=require('beaver-logger/server');var express=require(_0x8e10('0x0'));var auth=require(_0x8e10('0x1'));var config=require(_0x8e10('0x2'));var router=express[_0x8e10('0x3')]();var isProduction=config['env']===_0x8e10('0x4')||![];function clientSideLogs(_0x5df7ba,_0x569e4e,_0x30e4df){var _0x5601d6=_0x5df7ba[_0x8e10('0x5')]['get'](_0x8e10('0x6'));if(!_0x5601d6){throw new Error(_0x8e10('0x7'));}return beaverLogger[_0x8e10('0x8')]({'uri':_0x8e10('0x9'),'logger':_0x5601d6,'enableCors':!isProduction})(_0x5df7ba,_0x569e4e,_0x30e4df);}router[_0x8e10('0xa')](auth[_0x8e10('0xb')](),clientSideLogs);module[_0x8e10('0xc')]=router;
\ No newline at end of file
index e975c8a..302406b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e57=['STRING','ENUM','AmazonAWS','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0x5e57,0x8f));var _0x75e5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5e57[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x75e5('0x0'));module['exports']={'name':{'type':Sequelize[_0x75e5('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x75e5('0x2')](_0x75e5('0x3'),'Google',_0x75e5('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x75e5('0x2')]('Outlook365',_0x75e5('0x5'))},'data1':{'type':Sequelize['STRING'],'comment':_0x75e5('0x6')},'data2':{'type':Sequelize[_0x75e5('0x1')],'comment':_0x75e5('0x7')},'data3':{'type':Sequelize[_0x75e5('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x75e5('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x75e5('0x8')],'comment':_0x75e5('0x9')},'data6':{'type':Sequelize['TEXT'],'comment':_0x75e5('0xa')},'data7':{'type':Sequelize[_0x75e5('0x8')],'comment':_0x75e5('0xb')}};
\ No newline at end of file
+var _0x6d4a=['MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x2e50a2,_0x27f31e){var _0x47e5de=function(_0x4e1f70){while(--_0x4e1f70){_0x2e50a2['push'](_0x2e50a2['shift']());}};_0x47e5de(++_0x27f31e);}(_0x6d4a,0x1c6));var _0xa6d4=function(_0x16ce69,_0x495633){_0x16ce69=_0x16ce69-0x0;var _0x248f25=_0x6d4a[_0x16ce69];return _0x248f25;};'use strict';var Sequelize=require('sequelize');module[_0xa6d4('0x0')]={'name':{'type':Sequelize[_0xa6d4('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa6d4('0x2')](_0xa6d4('0x3'),_0xa6d4('0x4'),_0xa6d4('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xa6d4('0x2')](_0xa6d4('0x6'),_0xa6d4('0x7'))},'data1':{'type':Sequelize[_0xa6d4('0x1')],'comment':_0xa6d4('0x8')},'data2':{'type':Sequelize['STRING'],'comment':_0xa6d4('0x9')},'data3':{'type':Sequelize[_0xa6d4('0x1')],'comment':_0xa6d4('0xa')},'data4':{'type':Sequelize[_0xa6d4('0x1')],'comment':_0xa6d4('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':_0xa6d4('0xc')},'data6':{'type':Sequelize[_0xa6d4('0xd')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xa6d4('0xd')],'comment':_0xa6d4('0xe')}};
\ No newline at end of file
index 263fb9a..1751a01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce8d=['map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','merge','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','find','create','body','Name\x20parameter\x20not\x20specified','values','join','encryptString','destroy','user','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','parse','base64','toString','ascii','isValidIdToken','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:error','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','limit','undefined','count','set','json','update','then','stack','name','padEnd','CloudProvider','rawAttributes','model'];(function(_0x35835e,_0x440a2c){var _0x819142=function(_0x428879){while(--_0x428879){_0x35835e['push'](_0x35835e['shift']());}};_0x819142(++_0x440a2c);}(_0xce8d,0xf0));var _0xdce8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce8d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0xdce8('0x0'));var config=require(_0xdce8('0x1'));var logger=require(_0xdce8('0x2'))(_0xdce8('0x3'));var db=require(_0xdce8('0x4'))['db'];var oauth=require(_0xdce8('0x5'));config[_0xdce8('0x6')]=_[_0xdce8('0x7')](config[_0xdce8('0x6')],{'host':_0xdce8('0x8'),'port':0x18eb});var socket=require(_0xdce8('0x9'))(new Redis(config[_0xdce8('0x6')]));var redis=new Redis(config[_0xdce8('0x6')]);function respondWithStatusCode(_0x3d71b9,_0x292360){_0x292360=_0x292360||0xcc;return function(_0x1c0ce4){if(_0x1c0ce4){return _0x3d71b9[_0xdce8('0xa')](_0x292360);}return _0x3d71b9[_0xdce8('0xb')](_0x292360)[_0xdce8('0xc')]();};}function respondWithResult(_0x52b22f,_0x36d8a2){_0x36d8a2=_0x36d8a2||0xc8;return function(_0xa5873){if(_0xa5873){return _0x52b22f[_0xdce8('0xb')](_0x36d8a2)['json'](_0xa5873);}};}function respondWithFilteredResult(_0x3ce9a9,_0xde0a38){return function(_0x55572f){if(_0x55572f){var _0x48aa4e=typeof _0xde0a38[_0xdce8('0xd')]==='undefined'&&typeof _0xde0a38[_0xdce8('0xe')]===_0xdce8('0xf');var _0x109a1d=_0x55572f[_0xdce8('0x10')];var _0x3fcfd7=_0x48aa4e?0x0:_0xde0a38['offset'];var _0x54e903=_0x48aa4e?_0x55572f[_0xdce8('0x10')]:_0xde0a38['offset']+_0xde0a38['limit'];var _0xfc028;if(_0x54e903>=_0x109a1d){_0x54e903=_0x109a1d;_0xfc028=0xc8;}else{_0xfc028=0xce;}_0x3ce9a9[_0xdce8('0xb')](_0xfc028);return _0x3ce9a9[_0xdce8('0x11')]('Content-Range',_0x3fcfd7+'-'+_0x54e903+'/'+_0x109a1d)[_0xdce8('0x12')](_0x55572f);}return null;};}function saveUpdates(_0x4c8487){return function(_0x2c40b3){if(_0x2c40b3){return _0x2c40b3[_0xdce8('0x13')](_0x4c8487)['then'](function(_0x85ad9d){return _0x85ad9d;});}return null;};}function removeEntity(_0xbb5f4){return function(_0x1743ee){if(_0x1743ee){return _0x1743ee['destroy']()[_0xdce8('0x14')](function(){_0xbb5f4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3194ff){return function(_0x3e794f){if(!_0x3e794f){_0x3194ff[_0xdce8('0xa')](0x194);}return _0x3e794f;};}function handleError(_0x141663,_0x40f2ab){_0x40f2ab=_0x40f2ab||0x1f4;return function(_0xd61d7f){logger['error'](_0xd61d7f[_0xdce8('0x15')]);if(_0xd61d7f[_0xdce8('0x16')]){delete _0xd61d7f[_0xdce8('0x16')];}_0x141663[_0xdce8('0xb')](_0x40f2ab)['send'](_0xd61d7f);};}function maskClientSecret(_0x508c84){return _[_0xdce8('0x17')](_0x508c84['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0xc0e7f5,_0x5878f5){var _0x7b8ae4={},_0x33507e={},_0x67ebe6={'count':0x0,'rows':[]};var _0xffcab7=_['map'](db[_0xdce8('0x18')][_0xdce8('0x19')],function(_0xce74b0){return{'name':_0xce74b0['fieldName'],'type':_0xce74b0['type']['key']};});_0x33507e[_0xdce8('0x1a')]=_[_0xdce8('0x1b')](_0xffcab7,'name');_0x33507e[_0xdce8('0x1c')]=_[_0xdce8('0x1d')](_0xc0e7f5[_0xdce8('0x1c')]);_0x33507e[_0xdce8('0x1e')]=_[_0xdce8('0x1f')](_0x33507e[_0xdce8('0x1a')],_0x33507e[_0xdce8('0x1c')]);_0x7b8ae4[_0xdce8('0x20')]=_[_0xdce8('0x1f')](_0x33507e[_0xdce8('0x1a')],qs['fields'](_0xc0e7f5[_0xdce8('0x1c')][_0xdce8('0x21')]));_0x7b8ae4['attributes']=_0x7b8ae4[_0xdce8('0x20')][_0xdce8('0x22')]?_0x7b8ae4[_0xdce8('0x20')]:_0x33507e['model'];if(!_0xc0e7f5[_0xdce8('0x1c')][_0xdce8('0x23')](_0xdce8('0x24'))){_0x7b8ae4[_0xdce8('0xe')]=qs['limit'](_0xc0e7f5[_0xdce8('0x1c')][_0xdce8('0xe')]);_0x7b8ae4['offset']=qs[_0xdce8('0xd')](_0xc0e7f5[_0xdce8('0x1c')][_0xdce8('0xd')]);}_0x7b8ae4[_0xdce8('0x25')]=qs[_0xdce8('0x26')](_0xc0e7f5[_0xdce8('0x1c')]['sort']);_0x7b8ae4['where']=qs[_0xdce8('0x1e')](_[_0xdce8('0x27')](_0xc0e7f5[_0xdce8('0x1c')],_0x33507e['filters']),_0xffcab7);if(_0xc0e7f5[_0xdce8('0x1c')][_0xdce8('0x28')]){_0x7b8ae4[_0xdce8('0x29')]=_['merge'](_0x7b8ae4[_0xdce8('0x29')],{'$or':_['map'](_0xffcab7,function(_0x44eeab){if(_0x44eeab[_0xdce8('0x2a')]!=='VIRTUAL'){var _0x429e01={};_0x429e01[_0x44eeab[_0xdce8('0x16')]]={'$like':'%'+_0xc0e7f5[_0xdce8('0x1c')][_0xdce8('0x28')]+'%'};return _0x429e01;}})});}_0x7b8ae4=_[_0xdce8('0x2b')]({},_0x7b8ae4,_0xc0e7f5[_0xdce8('0x2c')]);var _0x16b197={'where':_0x7b8ae4[_0xdce8('0x29')]};return db['CloudProvider'][_0xdce8('0x10')](_0x16b197)['then'](function(_0x5bf010){_0x67ebe6['count']=_0x5bf010;if(_0xc0e7f5[_0xdce8('0x1c')][_0xdce8('0x2d')]){_0x7b8ae4[_0xdce8('0x2e')]=[{'all':!![]}];}return db[_0xdce8('0x18')][_0xdce8('0x2f')](_0x7b8ae4);})['then'](function(_0x2cb6db){_0x67ebe6[_0xdce8('0x30')]=_[_0xdce8('0x1b')](_0x2cb6db,function(_0x437d77){if(_0x437d77[_0xdce8('0x31')]===_0xdce8('0x32')){var _0x3b27eb=encryptor[_0xdce8('0x33')](_0x437d77['data3']);_0x437d77[_0xdce8('0x34')]=maskClientSecret(_0x3b27eb);}return _0x437d77;});return _0x67ebe6;})[_0xdce8('0x14')](respondWithFilteredResult(_0x5878f5,_0x7b8ae4))[_0xdce8('0x35')](handleError(_0x5878f5,null));};exports[_0xdce8('0x36')]=function(_0x258bff,_0x17727b){var _0xcf2949={'raw':!![],'where':{'id':_0x258bff[_0xdce8('0x37')]['id']}},_0x223f1b={};_0x223f1b[_0xdce8('0x1a')]=_['keys'](db['CloudProvider'][_0xdce8('0x19')]);_0x223f1b['query']=_[_0xdce8('0x1d')](_0x258bff[_0xdce8('0x1c')]);_0x223f1b[_0xdce8('0x1e')]=_[_0xdce8('0x1f')](_0x223f1b[_0xdce8('0x1a')],_0x223f1b['query']);_0xcf2949['attributes']=_[_0xdce8('0x1f')](_0x223f1b[_0xdce8('0x1a')],qs[_0xdce8('0x21')](_0x258bff[_0xdce8('0x1c')]['fields']));_0xcf2949[_0xdce8('0x20')]=_0xcf2949[_0xdce8('0x20')]['length']?_0xcf2949[_0xdce8('0x20')]:_0x223f1b[_0xdce8('0x1a')];if(_0x258bff[_0xdce8('0x1c')][_0xdce8('0x2d')]){_0xcf2949[_0xdce8('0x2e')]=[{'all':!![]}];}_0xcf2949=_['merge']({},_0xcf2949,_0x258bff[_0xdce8('0x2c')]);return db[_0xdce8('0x18')][_0xdce8('0x38')](_0xcf2949)['then'](handleEntityNotFound(_0x17727b,null))[_0xdce8('0x14')](function(_0x478f78){if(_0x478f78['service']==='MicrosoftAzure'){var _0x438b96=encryptor[_0xdce8('0x33')](_0x478f78[_0xdce8('0x34')]);_0x478f78[_0xdce8('0x34')]=maskClientSecret(_0x438b96);}return _0x478f78;})[_0xdce8('0x14')](respondWithResult(_0x17727b,null))[_0xdce8('0x35')](handleError(_0x17727b,null));};exports[_0xdce8('0x39')]=function(_0x354171,_0x2d82f0){if(!_0x354171[_0xdce8('0x3a')]['name'])throw new Error(_0xdce8('0x3b'));if(!_0x354171[_0xdce8('0x3a')][_0xdce8('0x31')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x53c1b8=db['CloudProvider'][_0xdce8('0x19')]['service'][_0xdce8('0x3c')];if(!_0x53c1b8['includes'](_0x354171[_0xdce8('0x3a')][_0xdce8('0x31')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x53c1b8[_0xdce8('0x3d')](',\x20'));if(_0x354171['body']['service']==='MicrosoftAzure'&&_0x354171[_0xdce8('0x3a')]['data3']){_0x354171[_0xdce8('0x3a')][_0xdce8('0x34')]=encryptor[_0xdce8('0x3e')](_0x354171[_0xdce8('0x3a')][_0xdce8('0x34')]);}return db[_0xdce8('0x18')]['create'](_0x354171[_0xdce8('0x3a')],{})[_0xdce8('0x14')](respondWithResult(_0x2d82f0,0xc9))['catch'](handleError(_0x2d82f0,null));};exports[_0xdce8('0x13')]=function(_0x2cedcb,_0x3a1e2c){if(_0x2cedcb[_0xdce8('0x3a')]['id']){delete _0x2cedcb[_0xdce8('0x3a')]['id'];}return db[_0xdce8('0x18')][_0xdce8('0x38')]({'where':{'id':_0x2cedcb[_0xdce8('0x37')]['id']}})[_0xdce8('0x14')](handleEntityNotFound(_0x3a1e2c,null))[_0xdce8('0x14')](function(_0x3ea75b){if(_0x3ea75b['service']===_0xdce8('0x32')&&_0x2cedcb[_0xdce8('0x3a')][_0xdce8('0x34')]){_0x2cedcb[_0xdce8('0x3a')][_0xdce8('0x34')]=encryptor[_0xdce8('0x3e')](_0x2cedcb['body'][_0xdce8('0x34')]);}return _0x3ea75b;})['then'](saveUpdates(_0x2cedcb[_0xdce8('0x3a')],null))[_0xdce8('0x14')](respondWithResult(_0x3a1e2c,null))[_0xdce8('0x35')](handleError(_0x3a1e2c,null));};exports[_0xdce8('0x3f')]=function(_0x3e5dc0,_0x555561){return db[_0xdce8('0x18')][_0xdce8('0x38')]({'where':{'id':_0x3e5dc0['params']['id']}})[_0xdce8('0x14')](handleEntityNotFound(_0x555561,null))[_0xdce8('0x14')](removeEntity(_0x555561,null))[_0xdce8('0x35')](handleError(_0x555561,null));};exports['oauth2MicrosoftAuthorize']=function(_0x5d1d65,_0x55779b){return db[_0xdce8('0x18')]['findOne']({'where':{'id':_0x5d1d65[_0xdce8('0x37')]['id']},'raw':!![]})[_0xdce8('0x14')](function(_0x33580d){if(!_0x33580d)return _0x55779b[_0xdce8('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x33580d,_0x5d1d65[_0xdce8('0x40')]['id'])};})[_0xdce8('0x14')](respondWithResult(_0x55779b,null))[_0xdce8('0x35')](handleError(_0x55779b,null));};exports[_0xdce8('0x41')]=function(_0x8780fc,_0x1c56ae){var _0x58a14b=_0x8780fc[_0xdce8('0x3a')];var _0x260ed7;var _0x2ecf7a;if(_0x58a14b[_0xdce8('0x42')])throw _0x58a14b;redis[_0xdce8('0x43')](_0x58a14b[_0xdce8('0x44')])[_0xdce8('0x14')](function(_0xd377da){if(!_0xd377da)throw new Error(_0xdce8('0x45'));_0x260ed7=JSON[_0xdce8('0x46')](_0xd377da);var _0x44b6c1=Buffer['from'](_0x58a14b[_0xdce8('0x44')],_0xdce8('0x47'))[_0xdce8('0x48')](_0xdce8('0x49'));_0x2ecf7a=JSON[_0xdce8('0x46')](_0x44b6c1);if(!oauth[_0xdce8('0x4a')](_0x58a14b['id_token'],_0x260ed7[_0xdce8('0x4b')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xdce8('0x4c')](_0x58a14b[_0xdce8('0x44')]);return oauth[_0xdce8('0x4d')](_0x58a14b[_0xdce8('0x4e')],_0x260ed7);})['then'](function(_0x2d8686){_0x260ed7[_0xdce8('0x4f')]=_0x2d8686[_0xdce8('0x50')];_0x260ed7[_0xdce8('0x51')]=_0x2d8686['refresh_token'];return db[_0xdce8('0x18')][_0xdce8('0x13')]({'data5':_0x260ed7[_0xdce8('0x4f')],'data6':_0x260ed7[_0xdce8('0x51')]},{'where':{'id':_0x260ed7['id']}});})[_0xdce8('0x14')](function(){oauth[_0xdce8('0x52')](_0x260ed7);socket[_0xdce8('0x53')]('microsoftAuthorization:success',{'id':_0x2ecf7a['id']});return;})['then'](respondWithStatusCode(_0x1c56ae,null))[_0xdce8('0x35')](function(_0x46e98d){if(_0x2ecf7a){socket[_0xdce8('0x53')](_0xdce8('0x54'),{'id':_0x2ecf7a['id']});}if(!_0x260ed7){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x46e98d);return _0x1c56ae[_0xdce8('0xb')](0x1f4)[_0xdce8('0x55')](_0x46e98d[_0xdce8('0x56')]);}logger[_0xdce8('0x42')](_0xdce8('0x57'),_0x260ed7['id'],JSON[_0xdce8('0x58')](_0x46e98d));});};
\ No newline at end of file
+var _0x84d2=['padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','keys','length','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','error','state','from','ascii','isValidIdToken','oauth2Claims','del','getOauth2MicrosoftAccessToken','access_token','data6','refresh_token','data5','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','update','destroy','stack','name','send'];(function(_0xc85c23,_0x368f18){var _0x9f61e2=function(_0x26e484){while(--_0x26e484){_0xc85c23['push'](_0xc85c23['shift']());}};_0x9f61e2(++_0x368f18);}(_0x84d2,0x167));var _0x284d=function(_0x3f186d,_0x3ac45f){_0x3f186d=_0x3f186d-0x0;var _0x355f1d=_0x84d2[_0x3f186d];return _0x355f1d;};'use strict';var _=require('lodash');var Redis=require(_0x284d('0x0'));var qs=require(_0x284d('0x1'));var encryptor=require(_0x284d('0x2'));var config=require(_0x284d('0x3'));var logger=require(_0x284d('0x4'))('api');var db=require(_0x284d('0x5'))['db'];var oauth=require(_0x284d('0x6'));config[_0x284d('0x7')]=_[_0x284d('0x8')](config[_0x284d('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x284d('0x9'))(new Redis(config[_0x284d('0x7')]));var redis=new Redis(config[_0x284d('0x7')]);function respondWithStatusCode(_0x2776ce,_0x342eb5){_0x342eb5=_0x342eb5||0xcc;return function(_0x2d6b37){if(_0x2d6b37){return _0x2776ce[_0x284d('0xa')](_0x342eb5);}return _0x2776ce['status'](_0x342eb5)[_0x284d('0xb')]();};}function respondWithResult(_0x75e627,_0x3912f1){_0x3912f1=_0x3912f1||0xc8;return function(_0x359990){if(_0x359990){return _0x75e627[_0x284d('0xc')](_0x3912f1)['json'](_0x359990);}};}function respondWithFilteredResult(_0x3d508b,_0x5f0c0a){return function(_0x1db8bb){if(_0x1db8bb){var _0x174f15=typeof _0x5f0c0a[_0x284d('0xd')]==='undefined'&&typeof _0x5f0c0a['limit']===_0x284d('0xe');var _0x306e52=_0x1db8bb[_0x284d('0xf')];var _0x56d950=_0x174f15?0x0:_0x5f0c0a['offset'];var _0x316538=_0x174f15?_0x1db8bb[_0x284d('0xf')]:_0x5f0c0a[_0x284d('0xd')]+_0x5f0c0a[_0x284d('0x10')];var _0x4d6218;if(_0x316538>=_0x306e52){_0x316538=_0x306e52;_0x4d6218=0xc8;}else{_0x4d6218=0xce;}_0x3d508b[_0x284d('0xc')](_0x4d6218);return _0x3d508b[_0x284d('0x11')](_0x284d('0x12'),_0x56d950+'-'+_0x316538+'/'+_0x306e52)[_0x284d('0x13')](_0x1db8bb);}return null;};}function saveUpdates(_0x33980e){return function(_0x27875e){if(_0x27875e){return _0x27875e[_0x284d('0x14')](_0x33980e)['then'](function(_0x222985){return _0x222985;});}return null;};}function removeEntity(_0x28bbc0){return function(_0x319a88){if(_0x319a88){return _0x319a88[_0x284d('0x15')]()['then'](function(){_0x28bbc0['status'](0xcc)[_0x284d('0xb')]();});}};}function handleEntityNotFound(_0x26d420){return function(_0x20dd95){if(!_0x20dd95){_0x26d420[_0x284d('0xa')](0x194);}return _0x20dd95;};}function handleError(_0x5a009f,_0x38c926){_0x38c926=_0x38c926||0x1f4;return function(_0x5dc2a7){logger['error'](_0x5dc2a7[_0x284d('0x16')]);if(_0x5dc2a7[_0x284d('0x17')]){delete _0x5dc2a7['name'];}_0x5a009f[_0x284d('0xc')](_0x38c926)[_0x284d('0x18')](_0x5dc2a7);};}function maskClientSecret(_0x6f0029){return _[_0x284d('0x19')](_0x6f0029[_0x284d('0x1a')](0x0,0x3),0x14,'*');}exports[_0x284d('0x1b')]=function(_0x125346,_0x26708a){var _0x56c881={},_0x146fef={},_0x485737={'count':0x0,'rows':[]};var _0x26efa3=_[_0x284d('0x1c')](db[_0x284d('0x1d')][_0x284d('0x1e')],function(_0x491b04){return{'name':_0x491b04[_0x284d('0x1f')],'type':_0x491b04[_0x284d('0x20')][_0x284d('0x21')]};});_0x146fef['model']=_[_0x284d('0x1c')](_0x26efa3,_0x284d('0x17'));_0x146fef[_0x284d('0x22')]=_['keys'](_0x125346[_0x284d('0x22')]);_0x146fef[_0x284d('0x23')]=_[_0x284d('0x24')](_0x146fef['model'],_0x146fef[_0x284d('0x22')]);_0x56c881['attributes']=_['intersection'](_0x146fef[_0x284d('0x25')],qs[_0x284d('0x26')](_0x125346[_0x284d('0x22')][_0x284d('0x26')]));_0x56c881['attributes']=_0x56c881[_0x284d('0x27')]['length']?_0x56c881[_0x284d('0x27')]:_0x146fef[_0x284d('0x25')];if(!_0x125346[_0x284d('0x22')][_0x284d('0x28')](_0x284d('0x29'))){_0x56c881[_0x284d('0x10')]=qs['limit'](_0x125346[_0x284d('0x22')]['limit']);_0x56c881[_0x284d('0xd')]=qs[_0x284d('0xd')](_0x125346[_0x284d('0x22')][_0x284d('0xd')]);}_0x56c881[_0x284d('0x2a')]=qs[_0x284d('0x2b')](_0x125346[_0x284d('0x22')][_0x284d('0x2b')]);_0x56c881[_0x284d('0x2c')]=qs[_0x284d('0x23')](_['pick'](_0x125346['query'],_0x146fef[_0x284d('0x23')]),_0x26efa3);if(_0x125346[_0x284d('0x22')]['filter']){_0x56c881['where']=_[_0x284d('0x2d')](_0x56c881['where'],{'$or':_[_0x284d('0x1c')](_0x26efa3,function(_0x203afb){if(_0x203afb['type']!==_0x284d('0x2e')){var _0x1ffaef={};_0x1ffaef[_0x203afb[_0x284d('0x17')]]={'$like':'%'+_0x125346[_0x284d('0x22')][_0x284d('0x2f')]+'%'};return _0x1ffaef;}})});}_0x56c881=_['merge']({},_0x56c881,_0x125346[_0x284d('0x30')]);var _0x2dc38b={'where':_0x56c881['where']};return db[_0x284d('0x1d')][_0x284d('0xf')](_0x2dc38b)[_0x284d('0x31')](function(_0x4a4751){_0x485737[_0x284d('0xf')]=_0x4a4751;if(_0x125346[_0x284d('0x22')][_0x284d('0x32')]){_0x56c881[_0x284d('0x33')]=[{'all':!![]}];}return db[_0x284d('0x1d')][_0x284d('0x34')](_0x56c881);})[_0x284d('0x31')](function(_0x40cb3a){_0x485737[_0x284d('0x35')]=_['map'](_0x40cb3a,function(_0x1d4e20){if(_0x1d4e20[_0x284d('0x36')]===_0x284d('0x37')){var _0x4b4666=encryptor[_0x284d('0x38')](_0x1d4e20[_0x284d('0x39')]);_0x1d4e20[_0x284d('0x39')]=maskClientSecret(_0x4b4666);}return _0x1d4e20;});return _0x485737;})[_0x284d('0x31')](respondWithFilteredResult(_0x26708a,_0x56c881))[_0x284d('0x3a')](handleError(_0x26708a,null));};exports[_0x284d('0x3b')]=function(_0x543532,_0x2bc29b){var _0x4e2bc5={'raw':!![],'where':{'id':_0x543532[_0x284d('0x3c')]['id']}},_0x19e52c={};_0x19e52c[_0x284d('0x25')]=_[_0x284d('0x3d')](db[_0x284d('0x1d')][_0x284d('0x1e')]);_0x19e52c['query']=_[_0x284d('0x3d')](_0x543532['query']);_0x19e52c[_0x284d('0x23')]=_[_0x284d('0x24')](_0x19e52c[_0x284d('0x25')],_0x19e52c[_0x284d('0x22')]);_0x4e2bc5[_0x284d('0x27')]=_[_0x284d('0x24')](_0x19e52c[_0x284d('0x25')],qs['fields'](_0x543532[_0x284d('0x22')]['fields']));_0x4e2bc5[_0x284d('0x27')]=_0x4e2bc5['attributes'][_0x284d('0x3e')]?_0x4e2bc5[_0x284d('0x27')]:_0x19e52c['model'];if(_0x543532['query'][_0x284d('0x32')]){_0x4e2bc5['include']=[{'all':!![]}];}_0x4e2bc5=_[_0x284d('0x2d')]({},_0x4e2bc5,_0x543532[_0x284d('0x30')]);return db[_0x284d('0x1d')][_0x284d('0x3f')](_0x4e2bc5)['then'](handleEntityNotFound(_0x2bc29b,null))[_0x284d('0x31')](function(_0x416dd0){if(_0x416dd0[_0x284d('0x36')]===_0x284d('0x37')){var _0x59df10=encryptor['decryptString'](_0x416dd0[_0x284d('0x39')]);_0x416dd0[_0x284d('0x39')]=maskClientSecret(_0x59df10);}return _0x416dd0;})[_0x284d('0x31')](respondWithResult(_0x2bc29b,null))[_0x284d('0x3a')](handleError(_0x2bc29b,null));};exports[_0x284d('0x40')]=function(_0x16ceb4,_0x1b57eb){if(!_0x16ceb4[_0x284d('0x41')][_0x284d('0x17')])throw new Error(_0x284d('0x42'));if(!_0x16ceb4[_0x284d('0x41')][_0x284d('0x36')])throw new Error(_0x284d('0x43'));var _0x251b03=db[_0x284d('0x1d')]['rawAttributes']['service'][_0x284d('0x44')];if(!_0x251b03[_0x284d('0x45')](_0x16ceb4[_0x284d('0x41')][_0x284d('0x36')]))throw new Error(_0x284d('0x46')+_0x251b03['join'](',\x20'));if(_0x16ceb4[_0x284d('0x41')][_0x284d('0x36')]===_0x284d('0x37')&&_0x16ceb4[_0x284d('0x41')][_0x284d('0x39')]){_0x16ceb4[_0x284d('0x41')][_0x284d('0x39')]=encryptor[_0x284d('0x47')](_0x16ceb4[_0x284d('0x41')]['data3']);}return db[_0x284d('0x1d')][_0x284d('0x40')](_0x16ceb4['body'],{})[_0x284d('0x31')](respondWithResult(_0x1b57eb,0xc9))[_0x284d('0x3a')](handleError(_0x1b57eb,null));};exports[_0x284d('0x14')]=function(_0x2470c3,_0x385cf3){if(_0x2470c3[_0x284d('0x41')]['id']){delete _0x2470c3[_0x284d('0x41')]['id'];}return db[_0x284d('0x1d')][_0x284d('0x3f')]({'where':{'id':_0x2470c3[_0x284d('0x3c')]['id']}})[_0x284d('0x31')](handleEntityNotFound(_0x385cf3,null))[_0x284d('0x31')](function(_0x111c35){if(_0x111c35[_0x284d('0x36')]===_0x284d('0x37')&&_0x2470c3[_0x284d('0x41')][_0x284d('0x39')]){_0x2470c3['body']['data3']=encryptor[_0x284d('0x47')](_0x2470c3[_0x284d('0x41')][_0x284d('0x39')]);}return _0x111c35;})['then'](saveUpdates(_0x2470c3['body'],null))[_0x284d('0x31')](respondWithResult(_0x385cf3,null))['catch'](handleError(_0x385cf3,null));};exports[_0x284d('0x15')]=function(_0x283568,_0x25b4cc){return db[_0x284d('0x1d')]['find']({'where':{'id':_0x283568[_0x284d('0x3c')]['id']}})[_0x284d('0x31')](handleEntityNotFound(_0x25b4cc,null))[_0x284d('0x31')](removeEntity(_0x25b4cc,null))[_0x284d('0x3a')](handleError(_0x25b4cc,null));};exports[_0x284d('0x48')]=function(_0x1e96e1,_0x61fccf){return db[_0x284d('0x1d')][_0x284d('0x49')]({'where':{'id':_0x1e96e1[_0x284d('0x3c')]['id']},'raw':!![]})[_0x284d('0x31')](function(_0x168a65){if(!_0x168a65)return _0x61fccf[_0x284d('0xa')](0x194);return{'url':oauth[_0x284d('0x4a')](_0x168a65,_0x1e96e1['user']['id'])};})['then'](respondWithResult(_0x61fccf,null))[_0x284d('0x3a')](handleError(_0x61fccf,null));};exports[_0x284d('0x4b')]=function(_0x3706d9,_0x3598df){var _0x2e5f45=_0x3706d9[_0x284d('0x41')];var _0x510d8d;var _0xc1b862;if(_0x2e5f45[_0x284d('0x4c')])throw _0x2e5f45;redis['get'](_0x2e5f45[_0x284d('0x4d')])[_0x284d('0x31')](function(_0x3a0497){if(!_0x3a0497)throw new Error('Invalid\x20state\x20parameter');_0x510d8d=JSON['parse'](_0x3a0497);var _0x1f01ff=Buffer[_0x284d('0x4e')](_0x2e5f45['state'],'base64')['toString'](_0x284d('0x4f'));_0xc1b862=JSON['parse'](_0x1f01ff);if(!oauth[_0x284d('0x50')](_0x2e5f45['id_token'],_0x510d8d[_0x284d('0x51')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x284d('0x52')](_0x2e5f45[_0x284d('0x4d')]);return oauth[_0x284d('0x53')](_0x2e5f45['code'],_0x510d8d);})['then'](function(_0x2c58a4){_0x510d8d['data5']=_0x2c58a4[_0x284d('0x54')];_0x510d8d[_0x284d('0x55')]=_0x2c58a4[_0x284d('0x56')];return db[_0x284d('0x1d')][_0x284d('0x14')]({'data5':_0x510d8d[_0x284d('0x57')],'data6':_0x510d8d[_0x284d('0x55')]},{'where':{'id':_0x510d8d['id']}});})[_0x284d('0x31')](function(){oauth[_0x284d('0x58')](_0x510d8d);socket['emit'](_0x284d('0x59'),{'id':_0xc1b862['id']});return;})[_0x284d('0x31')](respondWithStatusCode(_0x3598df,null))[_0x284d('0x3a')](function(_0x5d066f){if(_0xc1b862){socket[_0x284d('0x5a')](_0x284d('0x5b'),{'id':_0xc1b862['id']});}if(!_0x510d8d){logger[_0x284d('0x4c')](_0x284d('0x5c'),_0x5d066f);return _0x3598df['status'](0x1f4)[_0x284d('0x18')](_0x5d066f[_0x284d('0x5d')]);}logger[_0x284d('0x4c')](_0x284d('0x5e'),_0x510d8d['id'],JSON[_0x284d('0x5f')](_0x5d066f));});};
\ No newline at end of file
index 257390e..512990e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd32b=['bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util','api'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xd32b,0x1dd));var _0xbd32=function(_0x34ba3a,_0x3cedd7){_0x34ba3a=_0x34ba3a-0x0;var _0x4f0f79=_0xd32b[_0x34ba3a];return _0x4f0f79;};'use strict';var _=require(_0xbd32('0x0'));var util=require(_0xbd32('0x1'));var logger=require('../../config/logger')(_0xbd32('0x2'));var moment=require('moment');var BPromise=require(_0xbd32('0x3'));var rp=require(_0xbd32('0x4'));var fs=require('fs');var path=require(_0xbd32('0x5'));var rimraf=require(_0xbd32('0x6'));var config=require(_0xbd32('0x7'));var attributes=require(_0xbd32('0x8'));module[_0xbd32('0x9')]=function(_0x47c46c,_0x40e695){return _0x47c46c['define'](_0xbd32('0xa'),attributes,{'tableName':_0xbd32('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9123=['moment','bluebird','path','rimraf','../../config/environment','exports','define','CloudProvider','lodash','../../config/logger'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x9123,0x8a));var _0x3912=function(_0x311128,_0x38c430){_0x311128=_0x311128-0x0;var _0x4c7d04=_0x9123[_0x311128];return _0x4c7d04;};'use strict';var _=require(_0x3912('0x0'));var util=require('util');var logger=require(_0x3912('0x1'))('api');var moment=require(_0x3912('0x2'));var BPromise=require(_0x3912('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3912('0x4'));var rimraf=require(_0x3912('0x5'));var config=require(_0x3912('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x3912('0x7')]=function(_0x5e9660,_0x38420d){return _0x5e9660[_0x3912('0x8')](_0x3912('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 73fd84e..123bcc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c2a=['../../config/environment','../../config/logger','api','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','type','Dynamics365','push','/.default','Outlook365','data7','replace','code','id_token','toString','base64','client_id','response_type','join','redirect_uri','data4','response_mode','state','nonce','prompt','login','map','key','value','oauth2Claims','data1','set','stringify','decode','iss','issuer','audience','isAfter','unix','exp','resolve','data3','findOne','then','refresh_token','decryptString','POST','{TENANT_ID}','data2','data5','access_token','data6','CloudProvider','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','moment','ioredis','request-promise','util','../../components/encryptor'];(function(_0xfd3bee,_0x2ae8ef){var _0x43c708=function(_0x508386){while(--_0x508386){_0xfd3bee['push'](_0xfd3bee['shift']());}};_0x43c708(++_0x2ae8ef);}(_0x1c2a,0x1c3));var _0xa1c2=function(_0x5f272c,_0x12425c){_0x5f272c=_0x5f272c-0x0;var _0x175d9a=_0x1c2a[_0x5f272c];return _0x175d9a;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xa1c2('0x0'));var Redis=require(_0xa1c2('0x1'));var rp=require(_0xa1c2('0x2'));var util=require(_0xa1c2('0x3'));var encryptor=require(_0xa1c2('0x4'));var config=require(_0xa1c2('0x5'));var logger=require(_0xa1c2('0x6'))(_0xa1c2('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xa1c2('0x8'))['db'];config[_0xa1c2('0x9')]=_['defaults'](config[_0xa1c2('0x9')],{'host':_0xa1c2('0xa'),'port':0x18eb});var redis=new Redis(config[_0xa1c2('0x9')]);var MICROSOFT_AUTH_URL=_0xa1c2('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xa1c2('0xc'),_0xa1c2('0xd'),_0xa1c2('0xe'),'offline_access',_0xa1c2('0xf'),'https://outlook.office.com/POP.AccessAsUser.All',_0xa1c2('0x10')],'Dynamics365':['openid',_0xa1c2('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xa1c2('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xa1c2('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x30a37f){var _0x49c116=_['map'](AZURE_AUTH_SCOPES[_0x30a37f[_0xa1c2('0x14')]]);if(_0x30a37f[_0xa1c2('0x14')]===_0xa1c2('0x15'))_0x49c116[_0xa1c2('0x16')](_0x30a37f['data7']+_0xa1c2('0x17'));return _0x49c116['join']('\x20');}function getAccessTokenScope(_0xb05ee1){if(_0xb05ee1['type']===_0xa1c2('0x18'))return _0xa1c2('0xf');if(_0xb05ee1['type']===_0xa1c2('0x15'))return _0xb05ee1[_0xa1c2('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x46b531,_0x1b350f){var _0x5684f8=MICROSOFT_AUTH_URL[_0xa1c2('0x1a')]('{TENANT_ID}',_0x46b531['data2']);var _0x419879=[_0xa1c2('0x1b'),_0xa1c2('0x1c')];var _0x29c77c=Buffer['from'](JSON['stringify']({'id':_0x1b350f}))[_0xa1c2('0x1d')](_0xa1c2('0x1e'));var _0x45ab19=crypto['randomBytes'](0x10)[_0xa1c2('0x1d')]('hex');var _0x8812c9=getAuthorizationScopes(_0x46b531);var _0x563e6c=[{'key':_0xa1c2('0x1f'),'value':_0x46b531['data1']},{'key':_0xa1c2('0x20'),'value':encodeURIComponent(_0x419879[_0xa1c2('0x21')]('\x20'))},{'key':_0xa1c2('0x22'),'value':_0x46b531[_0xa1c2('0x23')]},{'key':_0xa1c2('0x24'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x8812c9)},{'key':_0xa1c2('0x25'),'value':_0x29c77c},{'key':_0xa1c2('0x26'),'value':_0x45ab19},{'key':_0xa1c2('0x27'),'value':_0xa1c2('0x28')}];var _0x592e2b=_0x5684f8+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa1c2('0x29')](_0x563e6c,function(_0x39014e){return _0x39014e[_0xa1c2('0x2a')]+'='+_0x39014e[_0xa1c2('0x2b')];})['join']('&');_0x46b531[_0xa1c2('0x2c')]={'issuer':_0x5684f8[_0xa1c2('0x1a')]('oauth2/',''),'audience':_0x46b531[_0xa1c2('0x2d')],'state':_0x29c77c,'nonce':_0x45ab19};redis[_0xa1c2('0x2e')](_0x29c77c,JSON[_0xa1c2('0x2f')](_0x46b531));return _0x592e2b;}function isValidIdToken(_0xc83ac4,_0x214b4b){try{var _0x1130cb=jwt[_0xa1c2('0x30')](_0xc83ac4,{'complete':!![]});var _0x381b06=_0x1130cb['payload'];if(_0x381b06[_0xa1c2('0x31')]!==_0x214b4b[_0xa1c2('0x32')])return![];if(_0x381b06['aud']!==_0x214b4b[_0xa1c2('0x33')])return![];if(_0x381b06[_0xa1c2('0x26')]!==_0x214b4b[_0xa1c2('0x26')])return![];if(moment()[_0xa1c2('0x34')](moment[_0xa1c2('0x35')](_0x381b06[_0xa1c2('0x36')])))return![];return!![];}catch(_0x86c73){throw _0x86c73;}}function refreshOauth2MicrosoftAccessToken(_0xbe4934){return Promise[_0xa1c2('0x37')]()['then'](function(){if(_0xbe4934[_0xa1c2('0x38')])return _0xbe4934;return db['CloudProvider'][_0xa1c2('0x39')]({'where':{'id':_0xbe4934['id']},'raw':!![]});})[_0xa1c2('0x3a')](function(_0x1cc4a2){var _0x508d3c={'grant_type':_0xa1c2('0x3b'),'refresh_token':_0x1cc4a2['data6'],'scope':getAccessTokenScope(_0x1cc4a2),'redirect_uri':_0x1cc4a2[_0xa1c2('0x23')],'client_id':_0x1cc4a2[_0xa1c2('0x2d')],'client_secret':encryptor[_0xa1c2('0x3c')](_0x1cc4a2['data3'])};var _0xb3d5d3={'method':_0xa1c2('0x3d'),'uri':MICROSOFT_AUTH_URL['replace'](_0xa1c2('0x3e'),_0x1cc4a2[_0xa1c2('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x508d3c,'json':!![]};return rp(_0xb3d5d3);})['then'](function(_0x3cbfa4){_0xbe4934[_0xa1c2('0x40')]=_0x3cbfa4[_0xa1c2('0x41')];_0xbe4934[_0xa1c2('0x42')]=_0x3cbfa4[_0xa1c2('0x3b')];return db[_0xa1c2('0x43')]['update']({'data5':_0xbe4934[_0xa1c2('0x40')],'data6':_0xbe4934[_0xa1c2('0x42')]},{'where':{'id':_0xbe4934['id']}});})[_0xa1c2('0x3a')](function(){return _0xbe4934;})[_0xa1c2('0x44')](function(_0x3cca14){logger[_0xa1c2('0x45')](_0xa1c2('0x46'),_0xbe4934['id'],_0x3cca14);});}function getOauth2MicrosoftAccessToken(_0x309d5a,_0x1a1a35){var _0x497ce4={'grant_type':_0xa1c2('0x47'),'code':_0x309d5a,'scope':getAccessTokenScope(_0x1a1a35),'redirect_uri':_0x1a1a35[_0xa1c2('0x23')],'client_id':_0x1a1a35[_0xa1c2('0x2d')],'client_secret':encryptor[_0xa1c2('0x3c')](_0x1a1a35[_0xa1c2('0x38')])};var _0x1ae3dc={'method':_0xa1c2('0x3d'),'uri':MICROSOFT_AUTH_URL[_0xa1c2('0x1a')](_0xa1c2('0x3e'),_0x1a1a35[_0xa1c2('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x497ce4,'json':!![]};return rp(_0x1ae3dc);}function startRefreshInterval(_0xdd7a0f){var _0x3e880c=schedule[_0xa1c2('0x48')];if(_0x3e880c[_0xdd7a0f['id']])clearInterval(_0x3e880c[_0xdd7a0f['id']]);_0x3e880c[_0xdd7a0f['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0xdd7a0f['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x3e880c;}function startAllRefreshIntervals(){return db[_0xa1c2('0x43')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa1c2('0x3a')](function(_0x480708){var _0x161493=_0x480708[_0xa1c2('0x29')](function(_0x249838){return refreshOauth2MicrosoftAccessToken(_0x249838)[_0xa1c2('0x3a')](function(_0x4267e0){startRefreshInterval(_0x4267e0);});});return Promise[_0xa1c2('0x49')](_0x161493);})['catch'](function(_0x4d785e){var _0x47ca62=_0x4d785e?util[_0xa1c2('0x4a')](_0x4d785e,{'showHidden':![],'depth':null}):'';logger[_0xa1c2('0x45')](_0xa1c2('0x4b'),_0x47ca62);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x5455=['then','data3','CloudProvider','findOne','refresh_token','data4','decryptString','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','api','../../config/schedule/cloud-provider','defaults','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','map','type','push','data7','join','Outlook365','Dynamics365','/.default','replace','{TENANT_ID}','data2','code','randomBytes','toString','client_id','data1','redirect_uri','form_post','scope','state','prompt','login','key','value','oauth2/','stringify','decode','iss','issuer','aud','audience','nonce','isAfter','unix','resolve'];(function(_0x3b2aac,_0x2804c2){var _0x3f9a47=function(_0x3e177f){while(--_0x3e177f){_0x3b2aac['push'](_0x3b2aac['shift']());}};_0x3f9a47(++_0x2804c2);}(_0x5455,0x197));var _0x5545=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5455[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var crypto=require(_0x5545('0x0'));var jwt=require(_0x5545('0x1'));var moment=require(_0x5545('0x2'));var Redis=require(_0x5545('0x3'));var rp=require(_0x5545('0x4'));var util=require(_0x5545('0x5'));var encryptor=require(_0x5545('0x6'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x5545('0x7'));var schedule=require(_0x5545('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5545('0x9')](config[_0x5545('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x5545('0xa')]);var MICROSOFT_AUTH_URL=_0x5545('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x5545('0xc'),_0x5545('0xd'),_0x5545('0xe'),_0x5545('0xf'),_0x5545('0x10'),_0x5545('0x11')],'Dynamics365':[_0x5545('0x12'),_0x5545('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0x5545('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x48e6f9){var _0x936185=_[_0x5545('0x14')](AZURE_AUTH_SCOPES[_0x48e6f9[_0x5545('0x15')]]);if(_0x48e6f9[_0x5545('0x15')]==='Dynamics365')_0x936185[_0x5545('0x16')](_0x48e6f9[_0x5545('0x17')]+'/.default');return _0x936185[_0x5545('0x18')]('\x20');}function getAccessTokenScope(_0x167f3d){if(_0x167f3d[_0x5545('0x15')]===_0x5545('0x19'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x167f3d[_0x5545('0x15')]===_0x5545('0x1a'))return _0x167f3d[_0x5545('0x17')]+_0x5545('0x1b');}function generateMicrosoftAuthorizationUrl(_0x3d95f5,_0x30eedc){var _0xf9256c=MICROSOFT_AUTH_URL[_0x5545('0x1c')](_0x5545('0x1d'),_0x3d95f5[_0x5545('0x1e')]);var _0x3a012e=[_0x5545('0x1f'),'id_token'];var _0x3a288d=Buffer['from'](JSON['stringify']({'id':_0x30eedc}))['toString']('base64');var _0x406fe8=crypto[_0x5545('0x20')](0x10)[_0x5545('0x21')]('hex');var _0x3c0a2e=getAuthorizationScopes(_0x3d95f5);var _0x3d7ee6=[{'key':_0x5545('0x22'),'value':_0x3d95f5[_0x5545('0x23')]},{'key':'response_type','value':encodeURIComponent(_0x3a012e[_0x5545('0x18')]('\x20'))},{'key':_0x5545('0x24'),'value':_0x3d95f5['data4']},{'key':'response_mode','value':_0x5545('0x25')},{'key':_0x5545('0x26'),'value':encodeURIComponent(_0x3c0a2e)},{'key':_0x5545('0x27'),'value':_0x3a288d},{'key':'nonce','value':_0x406fe8},{'key':_0x5545('0x28'),'value':_0x5545('0x29')}];var _0x3ae9f1=_0xf9256c+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x5545('0x14')](_0x3d7ee6,function(_0x187a13){return _0x187a13[_0x5545('0x2a')]+'='+_0x187a13[_0x5545('0x2b')];})['join']('&');_0x3d95f5['oauth2Claims']={'issuer':_0xf9256c[_0x5545('0x1c')](_0x5545('0x2c'),''),'audience':_0x3d95f5[_0x5545('0x23')],'state':_0x3a288d,'nonce':_0x406fe8};redis['set'](_0x3a288d,JSON[_0x5545('0x2d')](_0x3d95f5));return _0x3ae9f1;}function isValidIdToken(_0x5a7f7e,_0x3a4504){try{var _0x13c799=jwt[_0x5545('0x2e')](_0x5a7f7e,{'complete':!![]});var _0x44f293=_0x13c799['payload'];if(_0x44f293[_0x5545('0x2f')]!==_0x3a4504[_0x5545('0x30')])return![];if(_0x44f293[_0x5545('0x31')]!==_0x3a4504[_0x5545('0x32')])return![];if(_0x44f293[_0x5545('0x33')]!==_0x3a4504['nonce'])return![];if(moment()[_0x5545('0x34')](moment[_0x5545('0x35')](_0x44f293['exp'])))return![];return!![];}catch(_0x1fc4d1){throw _0x1fc4d1;}}function refreshOauth2MicrosoftAccessToken(_0x3f57d8){return Promise[_0x5545('0x36')]()[_0x5545('0x37')](function(){if(_0x3f57d8[_0x5545('0x38')])return _0x3f57d8;return db[_0x5545('0x39')][_0x5545('0x3a')]({'where':{'id':_0x3f57d8['id']},'raw':!![]});})[_0x5545('0x37')](function(_0x356519){var _0x5f096f={'grant_type':_0x5545('0x3b'),'refresh_token':_0x356519['data6'],'scope':getAccessTokenScope(_0x356519),'redirect_uri':_0x356519[_0x5545('0x3c')],'client_id':_0x356519[_0x5545('0x23')],'client_secret':encryptor[_0x5545('0x3d')](_0x356519[_0x5545('0x38')])};var _0x386727={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x5545('0x1c')](_0x5545('0x1d'),_0x356519['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5f096f,'json':!![]};return rp(_0x386727);})[_0x5545('0x37')](function(_0x47bded){_0x3f57d8[_0x5545('0x3e')]=_0x47bded[_0x5545('0x3f')];_0x3f57d8['data6']=_0x47bded[_0x5545('0x3b')];return db['CloudProvider'][_0x5545('0x40')]({'data5':_0x3f57d8['data5'],'data6':_0x3f57d8['data6']},{'where':{'id':_0x3f57d8['id']}});})[_0x5545('0x37')](function(){return _0x3f57d8;})[_0x5545('0x41')](function(_0x96c67d){logger['error'](_0x5545('0x42'),_0x3f57d8['id'],_0x96c67d);});}function getOauth2MicrosoftAccessToken(_0xa8d51b,_0x3b3197){var _0x50fe66={'grant_type':_0x5545('0x43'),'code':_0xa8d51b,'scope':getAccessTokenScope(_0x3b3197),'redirect_uri':_0x3b3197[_0x5545('0x3c')],'client_id':_0x3b3197[_0x5545('0x23')],'client_secret':encryptor['decryptString'](_0x3b3197[_0x5545('0x38')])};var _0x14480b={'method':_0x5545('0x44'),'uri':MICROSOFT_AUTH_URL[_0x5545('0x1c')](_0x5545('0x1d'),_0x3b3197[_0x5545('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x50fe66,'json':!![]};return rp(_0x14480b);}function startRefreshInterval(_0x18aefc){var _0x27738c=schedule[_0x5545('0x45')];if(_0x27738c[_0x18aefc['id']])clearInterval(_0x27738c[_0x18aefc['id']]);_0x27738c[_0x18aefc['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x5545('0x46')](this,{'id':_0x18aefc['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x5545('0x45')]=_0x27738c;}function startAllRefreshIntervals(){return db[_0x5545('0x39')][_0x5545('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x5545('0x37')](function(_0x3932f5){var _0x70662c=_0x3932f5['map'](function(_0x4c2f18){return refreshOauth2MicrosoftAccessToken(_0x4c2f18)[_0x5545('0x37')](function(_0x506a33){startRefreshInterval(_0x506a33);});});return Promise[_0x5545('0x48')](_0x70662c);})[_0x5545('0x41')](function(_0xfd6c50){var _0x1e86e0=_0xfd6c50?util[_0x5545('0x49')](_0xfd6c50,{'showHidden':![],'depth':null}):'';logger[_0x5545('0x4a')](_0x5545('0x4b'),_0x1e86e0);});}module[_0x5545('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
index e41d986..4bb4aa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1516=['../../config/environment','client','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x1516,0xb0));var _0x6151=function(_0x3a59f8,_0x120f9d){_0x3a59f8=_0x3a59f8-0x0;var _0x114b92=_0x1516[_0x3a59f8];return _0x114b92;};'use strict';var _=require(_0x6151('0x0'));var util=require(_0x6151('0x1'));var moment=require(_0x6151('0x2'));var BPromise=require('bluebird');var rs=require(_0x6151('0x3'));var fs=require('fs');var Redis=require(_0x6151('0x4'));var db=require(_0x6151('0x5'))['db'];var utils=require(_0x6151('0x6'));var logger=require(_0x6151('0x7'))('rpc');var config=require(_0x6151('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6151('0x9')][_0x6151('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x319164,_0x3fa962,_0x46e22f){return new BPromise(function(_0x43513c,_0x44cc85){return client[_0x6151('0xb')](_0x319164,_0x46e22f)[_0x6151('0xc')](function(_0x5c5b55){logger['info'](_0x6151('0xd'),_0x3fa962,_0x6151('0xe'));logger[_0x6151('0xf')](_0x6151('0x10'),_0x3fa962,_0x6151('0xe'),JSON[_0x6151('0x11')](_0x5c5b55));if(_0x5c5b55[_0x6151('0x12')]){if(_0x5c5b55[_0x6151('0x12')][_0x6151('0x13')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x3fa962,_0x5c5b55[_0x6151('0x12')][_0x6151('0x14')]);return _0x44cc85(_0x5c5b55[_0x6151('0x12')]['message']);}logger[_0x6151('0x12')](_0x6151('0xd'),_0x3fa962,_0x5c5b55[_0x6151('0x12')][_0x6151('0x14')]);return _0x43513c(_0x5c5b55['error'][_0x6151('0x14')]);}else{logger['info'](_0x6151('0xd'),_0x3fa962,_0x6151('0xe'));_0x43513c(_0x5c5b55[_0x6151('0x15')][_0x6151('0x14')]);}})[_0x6151('0x16')](function(_0x12524a){logger[_0x6151('0x12')](_0x6151('0xd'),_0x3fa962,_0x12524a);_0x44cc85(_0x12524a);});});}
\ No newline at end of file
+var _0x1267=['../../config/environment','client','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3fd086,_0x4b6e5e){var _0x1147b8=function(_0x5da69b){while(--_0x5da69b){_0x3fd086['push'](_0x3fd086['shift']());}};_0x1147b8(++_0x4b6e5e);}(_0x1267,0xb5));var _0x7126=function(_0x2ddcda,_0x2833ac){_0x2ddcda=_0x2ddcda-0x0;var _0x3f1c78=_0x1267[_0x2ddcda];return _0x3f1c78;};'use strict';var _=require(_0x7126('0x0'));var util=require(_0x7126('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7126('0x2'));var fs=require('fs');var Redis=require(_0x7126('0x3'));var db=require(_0x7126('0x4'))['db'];var utils=require(_0x7126('0x5'));var logger=require(_0x7126('0x6'))(_0x7126('0x7'));var config=require(_0x7126('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7126('0x9')][_0x7126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5175bf,_0x3c6f51,_0x4f4607){return new BPromise(function(_0x1605ba,_0x4f1e7f){return client[_0x7126('0xb')](_0x5175bf,_0x4f4607)['then'](function(_0x26f0fa){logger[_0x7126('0xc')](_0x7126('0xd'),_0x3c6f51,_0x7126('0xe'));logger[_0x7126('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3c6f51,'request\x20sent',JSON[_0x7126('0x10')](_0x26f0fa));if(_0x26f0fa[_0x7126('0x11')]){if(_0x26f0fa[_0x7126('0x11')][_0x7126('0x12')]===0x1f4){logger[_0x7126('0x11')](_0x7126('0xd'),_0x3c6f51,_0x26f0fa['error']['message']);return _0x4f1e7f(_0x26f0fa[_0x7126('0x11')][_0x7126('0x13')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x3c6f51,_0x26f0fa[_0x7126('0x11')][_0x7126('0x13')]);return _0x1605ba(_0x26f0fa['error'][_0x7126('0x13')]);}else{logger['info'](_0x7126('0xd'),_0x3c6f51,_0x7126('0xe'));_0x1605ba(_0x26f0fa['result']['message']);}})[_0x7126('0x14')](function(_0x4bd126){logger[_0x7126('0x11')](_0x7126('0xd'),_0x3c6f51,_0x4bd126);_0x4f1e7f(_0x4bd126);});});}
\ No newline at end of file
index 9a29279..e8524e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x2f9862,_0x4fed42){var _0x55cb61=function(_0x4df2da){while(--_0x4df2da){_0x2f9862['push'](_0x2f9862['shift']());}};_0x55cb61(++_0x4fed42);}(_0x2ef3,0xba));var _0x32ef=function(_0x356a9a,_0xc932a0){_0x356a9a=_0x356a9a-0x0;var _0x2a4823=_0x2ef3[_0x356a9a];return _0x2a4823;};'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
+var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0x1261,0x144));var _0x1126=function(_0x442ede,_0x2c3376){_0x442ede=_0x442ede-0x0;var _0x3b7c68=_0x1261[_0x442ede];return _0x3b7c68;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
index 994dba6..b118d13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28e9=['STRING','name','exports'];(function(_0x5c60cc,_0x15e927){var _0x5a3fbe=function(_0x500256){while(--_0x500256){_0x5c60cc['push'](_0x5c60cc['shift']());}};_0x5a3fbe(++_0x15e927);}(_0x28e9,0x197));var _0x928e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x28e9[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0x928e('0x0')]={'name':{'type':Sequelize[_0x928e('0x1')],'unique':_0x928e('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x928e('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x928e('0x1')]},'phone':{'type':Sequelize[_0x928e('0x1')]},'fax':{'type':Sequelize[_0x928e('0x1')]},'type':{'type':Sequelize[_0x928e('0x1')]},'street':{'type':Sequelize[_0x928e('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x928e('0x1')]},'country':{'type':Sequelize[_0x928e('0x1')]},'email':{'type':Sequelize[_0x928e('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x928e('0x1')]},'sStreet':{'type':Sequelize[_0x928e('0x1')]},'sPostalCode':{'type':Sequelize[_0x928e('0x1')]},'sCity':{'type':Sequelize[_0x928e('0x1')]},'sCountry':{'type':Sequelize[_0x928e('0x1')]},'description':{'type':Sequelize[_0x928e('0x1')]}};
\ No newline at end of file
+var _0xb790=['name','exports','STRING'];(function(_0x528575,_0x2e067d){var _0x3063b7=function(_0x1ee183){while(--_0x1ee183){_0x528575['push'](_0x528575['shift']());}};_0x3063b7(++_0x2e067d);}(_0xb790,0x1ae));var _0x0b79=function(_0x347b96,_0x18ba98){_0x347b96=_0x347b96-0x0;var _0x19c17e=_0xb790[_0x347b96];return _0x19c17e;};'use strict';var Sequelize=require('sequelize');module[_0x0b79('0x0')]={'name':{'type':Sequelize[_0x0b79('0x1')],'unique':_0x0b79('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0b79('0x1')]},'companyId':{'type':Sequelize[_0x0b79('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0b79('0x1')]},'fax':{'type':Sequelize[_0x0b79('0x1')]},'type':{'type':Sequelize[_0x0b79('0x1')]},'street':{'type':Sequelize[_0x0b79('0x1')]},'postalCode':{'type':Sequelize[_0x0b79('0x1')]},'city':{'type':Sequelize[_0x0b79('0x1')]},'country':{'type':Sequelize[_0x0b79('0x1')]},'email':{'type':Sequelize[_0x0b79('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0b79('0x1')]},'sStreet':{'type':Sequelize[_0x0b79('0x1')]},'sPostalCode':{'type':Sequelize[_0x0b79('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x0b79('0x1')]},'description':{'type':Sequelize[_0x0b79('0x1')]}};
\ No newline at end of file
index a1e3135..f8db800 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92d0=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','destroy','UserProfileResource','then','error','name','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','user','get','Companies','UserProfileSection','userProfileId','autoAssociation'];(function(_0x35450e,_0x1ad7b3){var _0xfbb741=function(_0x254135){while(--_0x254135){_0x35450e['push'](_0x35450e['shift']());}};_0xfbb741(++_0x1ad7b3);}(_0x92d0,0x10b));var _0x092d=function(_0x1253ea,_0x4b7824){_0x1253ea=_0x1253ea-0x0;var _0x223dc2=_0x92d0[_0x1253ea];return _0x223dc2;};'use strict';var emlformat=require(_0x092d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x092d('0x1'));var jsonpatch=require(_0x092d('0x2'));var rp=require(_0x092d('0x3'));var moment=require(_0x092d('0x4'));var BPromise=require(_0x092d('0x5'));var Mustache=require(_0x092d('0x6'));var util=require('util');var path=require(_0x092d('0x7'));var sox=require(_0x092d('0x8'));var csv=require(_0x092d('0x9'));var ejs=require(_0x092d('0xa'));var fs=require('fs');var fs_extra=require(_0x092d('0xb'));var _=require(_0x092d('0xc'));var squel=require(_0x092d('0xd'));var crypto=require(_0x092d('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x092d('0xf'));var Redis=require(_0x092d('0x10'));var authService=require(_0x092d('0x11'));var qs=require(_0x092d('0x12'));var as=require(_0x092d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x092d('0x14'))(_0x092d('0x15'));var utils=require(_0x092d('0x16'));var config=require(_0x092d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x092d('0x18'))['db'];function respondWithStatusCode(_0x83fa0e,_0x306a15){_0x306a15=_0x306a15||0xcc;return function(_0x130506){if(_0x130506){return _0x83fa0e[_0x092d('0x19')](_0x306a15);}return _0x83fa0e[_0x092d('0x1a')](_0x306a15)[_0x092d('0x1b')]();};}function respondWithResult(_0x41ace0,_0x261cf9){_0x261cf9=_0x261cf9||0xc8;return function(_0x4799c4){if(_0x4799c4){return _0x41ace0[_0x092d('0x1a')](_0x261cf9)[_0x092d('0x1c')](_0x4799c4);}};}function respondWithFilteredResult(_0x25f74a,_0xff233c){return function(_0xcd594e){if(_0xcd594e){var _0x30356e=typeof _0xff233c[_0x092d('0x1d')]===_0x092d('0x1e')&&typeof _0xff233c[_0x092d('0x1f')]===_0x092d('0x1e');var _0x500ca7=_0xcd594e[_0x092d('0x20')];var _0x5736aa=_0x30356e?0x0:_0xff233c[_0x092d('0x1d')];var _0x40234d=_0x30356e?_0xcd594e[_0x092d('0x20')]:_0xff233c[_0x092d('0x1d')]+_0xff233c[_0x092d('0x1f')];var _0x2d01f1;if(_0x40234d>=_0x500ca7){_0x40234d=_0x500ca7;_0x2d01f1=0xc8;}else{_0x2d01f1=0xce;}_0x25f74a[_0x092d('0x1a')](_0x2d01f1);return _0x25f74a[_0x092d('0x21')]('Content-Range',_0x5736aa+'-'+_0x40234d+'/'+_0x500ca7)[_0x092d('0x1c')](_0xcd594e);}return null;};}function patchUpdates(_0x5da083){return function(_0x446219){try{jsonpatch[_0x092d('0x22')](_0x446219,_0x5da083,!![]);}catch(_0x1c8d4b){return BPromise[_0x092d('0x23')](_0x1c8d4b);}return _0x446219['save']();};}function saveUpdates(_0x5e3a48,_0x20a548){return function(_0x36bf95){if(_0x36bf95){return _0x36bf95['update'](_0x5e3a48)['then'](function(_0x251a5f){return _0x251a5f;});}return null;};}function removeEntity(_0x375575,_0x57e491){return function(_0x81daa5){if(_0x81daa5){return _0x81daa5[_0x092d('0x24')]()['then'](function(){var _0x5f0855=_0x81daa5['get']({'plain':!![]});var _0x1f40f0='Companies';return db[_0x092d('0x25')][_0x092d('0x24')]({'where':{'type':_0x1f40f0,'resourceId':_0x5f0855['id']}})[_0x092d('0x26')](function(){return _0x81daa5;});})['then'](function(){_0x375575[_0x092d('0x1a')](0xcc)[_0x092d('0x1b')]();});}};}function handleEntityNotFound(_0x75024e,_0x278ccb){return function(_0x3e80e2){if(!_0x3e80e2){_0x75024e['sendStatus'](0x194);}return _0x3e80e2;};}function handleError(_0x5ce66a,_0x56b3e7){_0x56b3e7=_0x56b3e7||0x1f4;return function(_0x1f9bac){logger[_0x092d('0x27')](_0x1f9bac['stack']);if(_0x1f9bac[_0x092d('0x28')]){delete _0x1f9bac['name'];}_0x5ce66a[_0x092d('0x1a')](_0x56b3e7)['send'](_0x1f9bac);};}exports[_0x092d('0x29')]=function(_0x1be3cd,_0x43fbcc){var _0x3a468c={},_0x4156c8={},_0x3d3850={'count':0x0,'rows':[]};return db[_0x092d('0x2a')][_0x092d('0x2b')]()[_0x092d('0x26')](function(_0x390696){_0x4156c8[_0x092d('0x2c')]=_[_0x092d('0x2d')](_0x390696);_0x4156c8[_0x092d('0x2e')]=_[_0x092d('0x2d')](_0x1be3cd['query']);_0x4156c8[_0x092d('0x2f')]=_[_0x092d('0x30')](_0x4156c8[_0x092d('0x2c')],_0x4156c8[_0x092d('0x2e')]);_0x3a468c[_0x092d('0x31')]=_[_0x092d('0x30')](_0x4156c8['model'],qs[_0x092d('0x32')](_0x1be3cd['query'][_0x092d('0x32')]));_0x3a468c['attributes']=_0x3a468c[_0x092d('0x31')]['length']?_0x3a468c['attributes']:_0x4156c8[_0x092d('0x2c')];if(!_0x1be3cd[_0x092d('0x2e')][_0x092d('0x33')](_0x092d('0x34'))){_0x3a468c[_0x092d('0x1f')]=qs['limit'](_0x1be3cd[_0x092d('0x2e')]['limit']);_0x3a468c['offset']=qs[_0x092d('0x1d')](_0x1be3cd['query']['offset']);}_0x3a468c[_0x092d('0x35')]=qs[_0x092d('0x36')](_0x1be3cd[_0x092d('0x2e')]['sort']);_0x3a468c[_0x092d('0x37')]=qs[_0x092d('0x2f')](_[_0x092d('0x38')](_0x1be3cd[_0x092d('0x2e')],_0x4156c8[_0x092d('0x2f')]),_0x390696);if(_0x1be3cd['query'][_0x092d('0x39')]){_0x3a468c[_0x092d('0x37')]=_[_0x092d('0x3a')](_0x3a468c[_0x092d('0x37')],{'$or':_[_0x092d('0x3b')](_0x3a468c['attributes'],function(_0x4cb464){var _0x260300={};_0x260300[_0x4cb464]={'$like':'%'+_0x1be3cd['query'][_0x092d('0x39')]+'%'};return _0x260300;})});}_0x3a468c=_[_0x092d('0x3a')]({},_0x3a468c,_0x1be3cd[_0x092d('0x3c')]);var _0x48070e={'where':_0x3a468c[_0x092d('0x37')]};return db[_0x092d('0x2a')]['count'](_0x48070e)[_0x092d('0x26')](function(_0x16ced5){_0x3d3850[_0x092d('0x20')]=_0x16ced5;if(_0x1be3cd[_0x092d('0x2e')][_0x092d('0x3d')]){_0x3a468c[_0x092d('0x3e')]=[{'all':!![]}];}return db['CmCompany'][_0x092d('0x3f')](_0x3a468c);})['then'](function(_0x46b442){_0x3d3850['rows']=_0x46b442;return _0x3d3850;})['then'](respondWithFilteredResult(_0x43fbcc,_0x3a468c))[_0x092d('0x40')](handleError(_0x43fbcc,null));})['catch'](handleError(_0x43fbcc,null));};exports[_0x092d('0x41')]=function(_0x3000ed,_0x3e17e9){var _0x7dcb35={'raw':![],'where':{'id':_0x3000ed[_0x092d('0x42')]['id']}},_0x755909={};_0x755909[_0x092d('0x2c')]=_['keys'](db[_0x092d('0x2a')][_0x092d('0x43')]);_0x755909[_0x092d('0x2e')]=_[_0x092d('0x2d')](_0x3000ed[_0x092d('0x2e')]);_0x755909[_0x092d('0x2f')]=_['intersection'](_0x755909[_0x092d('0x2c')],_0x755909[_0x092d('0x2e')]);_0x7dcb35[_0x092d('0x31')]=_[_0x092d('0x30')](_0x755909['model'],qs[_0x092d('0x32')](_0x3000ed[_0x092d('0x2e')][_0x092d('0x32')]));_0x7dcb35[_0x092d('0x31')]=_0x7dcb35['attributes'][_0x092d('0x44')]?_0x7dcb35[_0x092d('0x31')]:_0x755909[_0x092d('0x2c')];if(_0x3000ed[_0x092d('0x2e')][_0x092d('0x3d')]){_0x7dcb35['include']=[{'all':!![]}];}_0x7dcb35=_[_0x092d('0x3a')]({},_0x7dcb35,_0x3000ed[_0x092d('0x3c')]);return db[_0x092d('0x2a')][_0x092d('0x45')](_0x7dcb35)[_0x092d('0x26')](handleEntityNotFound(_0x3e17e9,null))[_0x092d('0x26')](respondWithResult(_0x3e17e9,null))['catch'](handleError(_0x3e17e9,null));};exports['create']=function(_0x2d1d89,_0x58be8e){return db[_0x092d('0x2a')][_0x092d('0x46')](_0x2d1d89['body'],{})['then'](function(_0x18834f){var _0x3fe76b=_0x2d1d89[_0x092d('0x47')]['get']({'plain':!![]});if(!_0x3fe76b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fe76b['role']==='user'){var _0x277913=_0x18834f[_0x092d('0x48')]({'plain':!![]});var _0x4e78dd=_0x092d('0x49');return db[_0x092d('0x4a')][_0x092d('0x45')]({'where':{'name':_0x4e78dd,'userProfileId':_0x3fe76b[_0x092d('0x4b')]},'raw':!![]})['then'](function(_0x123849){if(_0x123849&&_0x123849[_0x092d('0x4c')]===0x0){return db[_0x092d('0x25')]['create']({'name':_0x277913['name'],'resourceId':_0x277913['id'],'type':_0x123849['name'],'sectionId':_0x123849['id']},{})[_0x092d('0x26')](function(){return _0x18834f;});}else{return _0x18834f;}})[_0x092d('0x40')](function(_0x1606d6){logger[_0x092d('0x27')](_0x092d('0x4d'),_0x1606d6);throw _0x1606d6;});}return _0x18834f;})[_0x092d('0x26')](respondWithResult(_0x58be8e,0xc9))[_0x092d('0x40')](handleError(_0x58be8e,null));};exports[_0x092d('0x4e')]=function(_0x340fc2,_0x398efb){if(_0x340fc2[_0x092d('0x4f')]['id']){delete _0x340fc2['body']['id'];}return db['CmCompany'][_0x092d('0x45')]({'where':{'id':_0x340fc2[_0x092d('0x42')]['id']}})[_0x092d('0x26')](handleEntityNotFound(_0x398efb,null))[_0x092d('0x26')](saveUpdates(_0x340fc2['body'],null))[_0x092d('0x26')](respondWithResult(_0x398efb,null))[_0x092d('0x40')](handleError(_0x398efb,null));};exports['destroy']=function(_0x21b037,_0x543130){return db[_0x092d('0x2a')][_0x092d('0x45')]({'where':{'id':_0x21b037[_0x092d('0x42')]['id']}})[_0x092d('0x26')](handleEntityNotFound(_0x543130,null))[_0x092d('0x26')](removeEntity(_0x543130,null))[_0x092d('0x40')](handleError(_0x543130,null));};exports[_0x092d('0x2b')]=function(_0x47acc2,_0x24ee97){return db[_0x092d('0x2a')]['describe']()['then'](respondWithResult(_0x24ee97,null))[_0x092d('0x40')](handleError(_0x24ee97,null));};exports[_0x092d('0x50')]=function(_0x3fae88,_0x5b4ed3,_0x3aede7){return db[_0x092d('0x51')][_0x092d('0x45')]({'where':{'id':_0x3fae88[_0x092d('0x42')]['id']}})[_0x092d('0x26')](handleEntityNotFound(_0x5b4ed3,null))['then'](function(_0x16a0ab){if(_0x16a0ab){return _0x16a0ab[_0x092d('0x50')](_0x3fae88[_0x092d('0x4f')][_0x092d('0x52')],_[_0x092d('0x53')](_0x3fae88[_0x092d('0x4f')],[_0x092d('0x52'),'id'])||{});}})['then'](respondWithResult(_0x5b4ed3,null))['catch'](handleError(_0x5b4ed3,null));};exports[_0x092d('0x54')]=function(_0x206209,_0x29063b,_0x1d08ba){var _0x251236={};var _0x11e319={};var _0x449e63;var _0x17f29b;return db[_0x092d('0x2a')][_0x092d('0x55')]({'where':{'id':_0x206209[_0x092d('0x42')]['id']}})[_0x092d('0x26')](handleEntityNotFound(_0x29063b,null))['then'](function(_0x48c4bd){if(_0x48c4bd){_0x449e63=_0x48c4bd;_0x11e319[_0x092d('0x2c')]=_[_0x092d('0x2d')](db[_0x092d('0x51')]['rawAttributes']);_0x11e319[_0x092d('0x2e')]=_[_0x092d('0x2d')](_0x206209[_0x092d('0x2e')]);_0x11e319[_0x092d('0x2f')]=_[_0x092d('0x30')](_0x11e319[_0x092d('0x2c')],_0x11e319[_0x092d('0x2e')]);_0x251236[_0x092d('0x31')]=_[_0x092d('0x30')](_0x11e319[_0x092d('0x2c')],qs[_0x092d('0x32')](_0x206209[_0x092d('0x2e')][_0x092d('0x32')]));_0x251236[_0x092d('0x31')]=_0x251236[_0x092d('0x31')][_0x092d('0x44')]?_0x251236[_0x092d('0x31')]:_0x11e319[_0x092d('0x2c')];_0x251236[_0x092d('0x35')]=qs[_0x092d('0x36')](_0x206209[_0x092d('0x2e')][_0x092d('0x36')]);_0x251236[_0x092d('0x37')]=qs[_0x092d('0x2f')](_['pick'](_0x206209['query'],_0x11e319[_0x092d('0x2f')]));if(_0x206209['query'][_0x092d('0x39')]){_0x251236['where']=_[_0x092d('0x3a')](_0x251236[_0x092d('0x37')],{'$or':_['map'](_0x251236[_0x092d('0x31')],function(_0x58a49f){var _0x430ca6={};_0x430ca6[_0x58a49f]={'$like':'%'+_0x206209[_0x092d('0x2e')]['filter']+'%'};return _0x430ca6;})});}_0x251236=_[_0x092d('0x3a')]({},_0x251236,_0x206209['options']);return _0x449e63[_0x092d('0x54')](_0x251236);}})[_0x092d('0x26')](function(_0x2eeb3a){if(_0x2eeb3a){_0x17f29b=_0x2eeb3a[_0x092d('0x44')];if(!_0x206209[_0x092d('0x2e')]['hasOwnProperty'](_0x092d('0x34'))){_0x251236[_0x092d('0x1f')]=qs[_0x092d('0x1f')](_0x206209[_0x092d('0x2e')][_0x092d('0x1f')]);_0x251236[_0x092d('0x1d')]=qs[_0x092d('0x1d')](_0x206209[_0x092d('0x2e')][_0x092d('0x1d')]);}return _0x449e63[_0x092d('0x54')](_0x251236);}})[_0x092d('0x26')](function(_0x1d7b34){if(_0x1d7b34){return _0x1d7b34?{'count':_0x17f29b,'rows':_0x1d7b34}:null;}})[_0x092d('0x26')](respondWithResult(_0x29063b,null))['catch'](handleError(_0x29063b,null));};
\ No newline at end of file
+var _0xd54a=['merge','options','CmCompany','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','catch','error','CmContact','addContacts','ids','getContacts','findOne','rimraf','zip-dir','fast-json-patch','moment','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','stack','name','send','index','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map'];(function(_0x370658,_0x3a8018){var _0x3ee190=function(_0xba25cb){while(--_0xba25cb){_0x370658['push'](_0x370658['shift']());}};_0x3ee190(++_0x3a8018);}(_0xd54a,0x15c));var _0xad54=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xd54a[_0x209941];return _0x1e8729;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad54('0x0'));var zipdir=require(_0xad54('0x1'));var jsonpatch=require(_0xad54('0x2'));var rp=require('request-promise');var moment=require(_0xad54('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xad54('0x4'));var sox=require('sox');var csv=require(_0xad54('0x5'));var ejs=require(_0xad54('0x6'));var fs=require('fs');var fs_extra=require(_0xad54('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xad54('0x8'));var deskjs=require(_0xad54('0x9'));var toCsv=require(_0xad54('0x5'));var querystring=require(_0xad54('0xa'));var Papa=require(_0xad54('0xb'));var Redis=require('ioredis');var authService=require(_0xad54('0xc'));var qs=require(_0xad54('0xd'));var as=require(_0xad54('0xe'));var hardwareService=require(_0xad54('0xf'));var logger=require(_0xad54('0x10'))('api');var utils=require(_0xad54('0x11'));var config=require(_0xad54('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c7cf4,_0x509a3a){_0x509a3a=_0x509a3a||0xcc;return function(_0x5e23d8){if(_0x5e23d8){return _0x1c7cf4[_0xad54('0x13')](_0x509a3a);}return _0x1c7cf4[_0xad54('0x14')](_0x509a3a)[_0xad54('0x15')]();};}function respondWithResult(_0x306b8a,_0x2efe7b){_0x2efe7b=_0x2efe7b||0xc8;return function(_0x4f12a9){if(_0x4f12a9){return _0x306b8a['status'](_0x2efe7b)[_0xad54('0x16')](_0x4f12a9);}};}function respondWithFilteredResult(_0x1db3bc,_0x209cf7){return function(_0x395da6){if(_0x395da6){var _0x1c2659=typeof _0x209cf7[_0xad54('0x17')]===_0xad54('0x18')&&typeof _0x209cf7[_0xad54('0x19')]==='undefined';var _0x15b6c0=_0x395da6[_0xad54('0x1a')];var _0x2865e6=_0x1c2659?0x0:_0x209cf7[_0xad54('0x17')];var _0x1b1654=_0x1c2659?_0x395da6[_0xad54('0x1a')]:_0x209cf7[_0xad54('0x17')]+_0x209cf7[_0xad54('0x19')];var _0x325061;if(_0x1b1654>=_0x15b6c0){_0x1b1654=_0x15b6c0;_0x325061=0xc8;}else{_0x325061=0xce;}_0x1db3bc['status'](_0x325061);return _0x1db3bc[_0xad54('0x1b')](_0xad54('0x1c'),_0x2865e6+'-'+_0x1b1654+'/'+_0x15b6c0)[_0xad54('0x16')](_0x395da6);}return null;};}function patchUpdates(_0x4f88a1){return function(_0x34fd50){try{jsonpatch['apply'](_0x34fd50,_0x4f88a1,!![]);}catch(_0x594f11){return BPromise[_0xad54('0x1d')](_0x594f11);}return _0x34fd50[_0xad54('0x1e')]();};}function saveUpdates(_0x554a1a,_0x744cd){return function(_0x21b4de){if(_0x21b4de){return _0x21b4de[_0xad54('0x1f')](_0x554a1a)['then'](function(_0x4c910f){return _0x4c910f;});}return null;};}function removeEntity(_0x59d244,_0x23b1fe){return function(_0x17faf8){if(_0x17faf8){return _0x17faf8['destroy']()[_0xad54('0x20')](function(){var _0x51933a=_0x17faf8[_0xad54('0x21')]({'plain':!![]});var _0x57df0e='Companies';return db[_0xad54('0x22')][_0xad54('0x23')]({'where':{'type':_0x57df0e,'resourceId':_0x51933a['id']}})[_0xad54('0x20')](function(){return _0x17faf8;});})[_0xad54('0x20')](function(){_0x59d244['status'](0xcc)[_0xad54('0x15')]();});}};}function handleEntityNotFound(_0xfa5cf,_0x2068a7){return function(_0x3305b9){if(!_0x3305b9){_0xfa5cf[_0xad54('0x13')](0x194);}return _0x3305b9;};}function handleError(_0xb212e1,_0x59638c){_0x59638c=_0x59638c||0x1f4;return function(_0x29280f){logger['error'](_0x29280f[_0xad54('0x24')]);if(_0x29280f[_0xad54('0x25')]){delete _0x29280f[_0xad54('0x25')];}_0xb212e1['status'](_0x59638c)[_0xad54('0x26')](_0x29280f);};}exports[_0xad54('0x27')]=function(_0xb66188,_0x31c1b2){var _0x41387a={},_0xe463ea={},_0x29faa2={'count':0x0,'rows':[]};return db['CmCompany'][_0xad54('0x28')]()['then'](function(_0x33d0f8){_0xe463ea[_0xad54('0x29')]=_[_0xad54('0x2a')](_0x33d0f8);_0xe463ea[_0xad54('0x2b')]=_[_0xad54('0x2a')](_0xb66188[_0xad54('0x2b')]);_0xe463ea['filters']=_[_0xad54('0x2c')](_0xe463ea[_0xad54('0x29')],_0xe463ea['query']);_0x41387a[_0xad54('0x2d')]=_['intersection'](_0xe463ea[_0xad54('0x29')],qs['fields'](_0xb66188[_0xad54('0x2b')][_0xad54('0x2e')]));_0x41387a[_0xad54('0x2d')]=_0x41387a[_0xad54('0x2d')][_0xad54('0x2f')]?_0x41387a[_0xad54('0x2d')]:_0xe463ea['model'];if(!_0xb66188[_0xad54('0x2b')][_0xad54('0x30')](_0xad54('0x31'))){_0x41387a['limit']=qs[_0xad54('0x19')](_0xb66188[_0xad54('0x2b')][_0xad54('0x19')]);_0x41387a['offset']=qs[_0xad54('0x17')](_0xb66188['query']['offset']);}_0x41387a[_0xad54('0x32')]=qs[_0xad54('0x33')](_0xb66188[_0xad54('0x2b')]['sort']);_0x41387a[_0xad54('0x34')]=qs[_0xad54('0x35')](_[_0xad54('0x36')](_0xb66188['query'],_0xe463ea[_0xad54('0x35')]),_0x33d0f8);if(_0xb66188[_0xad54('0x2b')][_0xad54('0x37')]){_0x41387a[_0xad54('0x34')]=_['merge'](_0x41387a[_0xad54('0x34')],{'$or':_[_0xad54('0x38')](_0x41387a[_0xad54('0x2d')],function(_0x5cf341){var _0xfb7912={};_0xfb7912[_0x5cf341]={'$like':'%'+_0xb66188[_0xad54('0x2b')]['filter']+'%'};return _0xfb7912;})});}_0x41387a=_[_0xad54('0x39')]({},_0x41387a,_0xb66188[_0xad54('0x3a')]);var _0x74f391={'where':_0x41387a['where']};return db[_0xad54('0x3b')][_0xad54('0x1a')](_0x74f391)[_0xad54('0x20')](function(_0x1f6600){_0x29faa2[_0xad54('0x1a')]=_0x1f6600;if(_0xb66188[_0xad54('0x2b')][_0xad54('0x3c')]){_0x41387a[_0xad54('0x3d')]=[{'all':!![]}];}return db['CmCompany'][_0xad54('0x3e')](_0x41387a);})[_0xad54('0x20')](function(_0x335289){_0x29faa2[_0xad54('0x3f')]=_0x335289;return _0x29faa2;})[_0xad54('0x20')](respondWithFilteredResult(_0x31c1b2,_0x41387a))['catch'](handleError(_0x31c1b2,null));})['catch'](handleError(_0x31c1b2,null));};exports['show']=function(_0x1be818,_0x86e01a){var _0x332274={'raw':![],'where':{'id':_0x1be818[_0xad54('0x40')]['id']}},_0x550023={};_0x550023['model']=_['keys'](db[_0xad54('0x3b')][_0xad54('0x41')]);_0x550023[_0xad54('0x2b')]=_[_0xad54('0x2a')](_0x1be818[_0xad54('0x2b')]);_0x550023[_0xad54('0x35')]=_[_0xad54('0x2c')](_0x550023[_0xad54('0x29')],_0x550023['query']);_0x332274[_0xad54('0x2d')]=_['intersection'](_0x550023[_0xad54('0x29')],qs[_0xad54('0x2e')](_0x1be818[_0xad54('0x2b')][_0xad54('0x2e')]));_0x332274[_0xad54('0x2d')]=_0x332274[_0xad54('0x2d')]['length']?_0x332274[_0xad54('0x2d')]:_0x550023[_0xad54('0x29')];if(_0x1be818[_0xad54('0x2b')][_0xad54('0x3c')]){_0x332274[_0xad54('0x3d')]=[{'all':!![]}];}_0x332274=_['merge']({},_0x332274,_0x1be818[_0xad54('0x3a')]);return db[_0xad54('0x3b')][_0xad54('0x42')](_0x332274)['then'](handleEntityNotFound(_0x86e01a,null))[_0xad54('0x20')](respondWithResult(_0x86e01a,null))['catch'](handleError(_0x86e01a,null));};exports[_0xad54('0x43')]=function(_0xbc264,_0x24fa3d){return db[_0xad54('0x3b')][_0xad54('0x43')](_0xbc264[_0xad54('0x44')],{})[_0xad54('0x20')](function(_0xdbbf60){var _0x59d6bb=_0xbc264[_0xad54('0x45')]['get']({'plain':!![]});if(!_0x59d6bb)throw new Error(_0xad54('0x46'));if(_0x59d6bb[_0xad54('0x47')]===_0xad54('0x45')){var _0x452f2f=_0xdbbf60[_0xad54('0x21')]({'plain':!![]});var _0x45f79a='Companies';return db['UserProfileSection'][_0xad54('0x42')]({'where':{'name':_0x45f79a,'userProfileId':_0x59d6bb[_0xad54('0x48')]},'raw':!![]})[_0xad54('0x20')](function(_0x4d81c2){if(_0x4d81c2&&_0x4d81c2[_0xad54('0x49')]===0x0){return db[_0xad54('0x22')][_0xad54('0x43')]({'name':_0x452f2f[_0xad54('0x25')],'resourceId':_0x452f2f['id'],'type':_0x4d81c2[_0xad54('0x25')],'sectionId':_0x4d81c2['id']},{})['then'](function(){return _0xdbbf60;});}else{return _0xdbbf60;}})[_0xad54('0x4a')](function(_0x52b727){logger[_0xad54('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52b727);throw _0x52b727;});}return _0xdbbf60;})[_0xad54('0x20')](respondWithResult(_0x24fa3d,0xc9))['catch'](handleError(_0x24fa3d,null));};exports[_0xad54('0x1f')]=function(_0x1afa34,_0x4448cb){if(_0x1afa34[_0xad54('0x44')]['id']){delete _0x1afa34[_0xad54('0x44')]['id'];}return db['CmCompany'][_0xad54('0x42')]({'where':{'id':_0x1afa34[_0xad54('0x40')]['id']}})['then'](handleEntityNotFound(_0x4448cb,null))[_0xad54('0x20')](saveUpdates(_0x1afa34[_0xad54('0x44')],null))['then'](respondWithResult(_0x4448cb,null))[_0xad54('0x4a')](handleError(_0x4448cb,null));};exports[_0xad54('0x23')]=function(_0x5f5049,_0x3bdc2d){return db[_0xad54('0x3b')][_0xad54('0x42')]({'where':{'id':_0x5f5049[_0xad54('0x40')]['id']}})[_0xad54('0x20')](handleEntityNotFound(_0x3bdc2d,null))[_0xad54('0x20')](removeEntity(_0x3bdc2d,null))[_0xad54('0x4a')](handleError(_0x3bdc2d,null));};exports[_0xad54('0x28')]=function(_0x509f33,_0x40eb69){return db[_0xad54('0x3b')][_0xad54('0x28')]()[_0xad54('0x20')](respondWithResult(_0x40eb69,null))[_0xad54('0x4a')](handleError(_0x40eb69,null));};exports['addContacts']=function(_0x5c646a,_0xda637b,_0x13b421){return db[_0xad54('0x4c')][_0xad54('0x42')]({'where':{'id':_0x5c646a[_0xad54('0x40')]['id']}})[_0xad54('0x20')](handleEntityNotFound(_0xda637b,null))[_0xad54('0x20')](function(_0x1f2afc){if(_0x1f2afc){return _0x1f2afc[_0xad54('0x4d')](_0x5c646a['body'][_0xad54('0x4e')],_['omit'](_0x5c646a[_0xad54('0x44')],[_0xad54('0x4e'),'id'])||{});}})[_0xad54('0x20')](respondWithResult(_0xda637b,null))['catch'](handleError(_0xda637b,null));};exports[_0xad54('0x4f')]=function(_0x3b463a,_0x63b5cb,_0x31e86d){var _0x3cf663={};var _0x385458={};var _0xe00d6d;var _0x26579d;return db['CmCompany'][_0xad54('0x50')]({'where':{'id':_0x3b463a[_0xad54('0x40')]['id']}})[_0xad54('0x20')](handleEntityNotFound(_0x63b5cb,null))[_0xad54('0x20')](function(_0x2d1654){if(_0x2d1654){_0xe00d6d=_0x2d1654;_0x385458['model']=_[_0xad54('0x2a')](db[_0xad54('0x4c')][_0xad54('0x41')]);_0x385458[_0xad54('0x2b')]=_[_0xad54('0x2a')](_0x3b463a[_0xad54('0x2b')]);_0x385458[_0xad54('0x35')]=_['intersection'](_0x385458[_0xad54('0x29')],_0x385458['query']);_0x3cf663['attributes']=_[_0xad54('0x2c')](_0x385458[_0xad54('0x29')],qs[_0xad54('0x2e')](_0x3b463a[_0xad54('0x2b')][_0xad54('0x2e')]));_0x3cf663[_0xad54('0x2d')]=_0x3cf663[_0xad54('0x2d')][_0xad54('0x2f')]?_0x3cf663[_0xad54('0x2d')]:_0x385458[_0xad54('0x29')];_0x3cf663[_0xad54('0x32')]=qs[_0xad54('0x33')](_0x3b463a[_0xad54('0x2b')][_0xad54('0x33')]);_0x3cf663[_0xad54('0x34')]=qs[_0xad54('0x35')](_[_0xad54('0x36')](_0x3b463a[_0xad54('0x2b')],_0x385458[_0xad54('0x35')]));if(_0x3b463a[_0xad54('0x2b')][_0xad54('0x37')]){_0x3cf663[_0xad54('0x34')]=_[_0xad54('0x39')](_0x3cf663[_0xad54('0x34')],{'$or':_['map'](_0x3cf663['attributes'],function(_0x28c4c4){var _0x32cc8c={};_0x32cc8c[_0x28c4c4]={'$like':'%'+_0x3b463a[_0xad54('0x2b')][_0xad54('0x37')]+'%'};return _0x32cc8c;})});}_0x3cf663=_['merge']({},_0x3cf663,_0x3b463a[_0xad54('0x3a')]);return _0xe00d6d[_0xad54('0x4f')](_0x3cf663);}})['then'](function(_0x1b5dcf){if(_0x1b5dcf){_0x26579d=_0x1b5dcf[_0xad54('0x2f')];if(!_0x3b463a[_0xad54('0x2b')][_0xad54('0x30')](_0xad54('0x31'))){_0x3cf663[_0xad54('0x19')]=qs['limit'](_0x3b463a[_0xad54('0x2b')]['limit']);_0x3cf663[_0xad54('0x17')]=qs[_0xad54('0x17')](_0x3b463a['query'][_0xad54('0x17')]);}return _0xe00d6d[_0xad54('0x4f')](_0x3cf663);}})[_0xad54('0x20')](function(_0x404e00){if(_0x404e00){return _0x404e00?{'count':_0x26579d,'rows':_0x404e00}:null;}})[_0xad54('0x20')](respondWithResult(_0x63b5cb,null))[_0xad54('0x4a')](handleError(_0x63b5cb,null));};
\ No newline at end of file
index 002fca0..1396603 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf73a=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x193990,_0x4d9881){var _0x843416=function(_0x5c2ed7){while(--_0x5c2ed7){_0x193990['push'](_0x193990['shift']());}};_0x843416(++_0x4d9881);}(_0xf73a,0x1cc));var _0xaf73=function(_0x5c7656,_0x41ed9f){_0x5c7656=_0x5c7656-0x0;var _0x3a3031=_0xf73a[_0x5c7656];return _0x3a3031;};'use strict';var _=require(_0xaf73('0x0'));var util=require(_0xaf73('0x1'));var logger=require(_0xaf73('0x2'))('api');var moment=require(_0xaf73('0x3'));var BPromise=require(_0xaf73('0x4'));var rp=require(_0xaf73('0x5'));var fs=require('fs');var path=require(_0xaf73('0x6'));var rimraf=require(_0xaf73('0x7'));var config=require(_0xaf73('0x8'));var attributes=require(_0xaf73('0x9'));module[_0xaf73('0xa')]=function(_0x130fdc,_0x4adb69){return _0x130fdc[_0xaf73('0xb')](_0xaf73('0xc'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf347=['util','../../config/logger','request-promise','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash'];(function(_0x1c3281,_0x5c69a0){var _0x27588d=function(_0x47114c){while(--_0x47114c){_0x1c3281['push'](_0x1c3281['shift']());}};_0x27588d(++_0x5c69a0);}(_0xf347,0x1df));var _0x7f34=function(_0x48a2c8,_0xa4380d){_0x48a2c8=_0x48a2c8-0x0;var _0x109974=_0xf347[_0x48a2c8];return _0x109974;};'use strict';var _=require(_0x7f34('0x0'));var util=require(_0x7f34('0x1'));var logger=require(_0x7f34('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7f34('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f34('0x4'));var config=require(_0x7f34('0x5'));var attributes=require(_0x7f34('0x6'));module['exports']=function(_0xaa89ce,_0x3f74c2){return _0xaa89ce[_0x7f34('0x7')](_0x7f34('0x8'),attributes,{'tableName':_0x7f34('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 855eb13..962b1ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcf8=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x4a0801,_0x55b298){var _0x47306d=function(_0x415a91){while(--_0x415a91){_0x4a0801['push'](_0x4a0801['shift']());}};_0x47306d(++_0x55b298);}(_0xfcf8,0x1b0));var _0x8fcf=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xfcf8[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require('lodash');var util=require(_0x8fcf('0x0'));var moment=require(_0x8fcf('0x1'));var BPromise=require(_0x8fcf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8fcf('0x3'));var db=require(_0x8fcf('0x4'))['db'];var utils=require(_0x8fcf('0x5'));var logger=require(_0x8fcf('0x6'))(_0x8fcf('0x7'));var config=require(_0x8fcf('0x8'));var jayson=require(_0x8fcf('0x9'));var client=jayson[_0x8fcf('0xa')][_0x8fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50d033,_0x181f2f,_0x4581c5){return new BPromise(function(_0x541d8a,_0x1fbe43){return client[_0x8fcf('0xc')](_0x50d033,_0x4581c5)[_0x8fcf('0xd')](function(_0x2e7ec1){logger[_0x8fcf('0xe')](_0x8fcf('0xf'),_0x181f2f,_0x8fcf('0x10'));logger[_0x8fcf('0x11')](_0x8fcf('0x12'),_0x181f2f,_0x8fcf('0x10'),JSON[_0x8fcf('0x13')](_0x2e7ec1));if(_0x2e7ec1[_0x8fcf('0x14')]){if(_0x2e7ec1['error'][_0x8fcf('0x15')]===0x1f4){logger[_0x8fcf('0x14')]('CmCompany,\x20%s,\x20%s',_0x181f2f,_0x2e7ec1[_0x8fcf('0x14')]['message']);return _0x1fbe43(_0x2e7ec1[_0x8fcf('0x14')][_0x8fcf('0x16')]);}logger[_0x8fcf('0x14')](_0x8fcf('0xf'),_0x181f2f,_0x2e7ec1[_0x8fcf('0x14')]['message']);return _0x541d8a(_0x2e7ec1[_0x8fcf('0x14')]['message']);}else{logger[_0x8fcf('0xe')]('CmCompany,\x20%s,\x20%s',_0x181f2f,_0x8fcf('0x10'));_0x541d8a(_0x2e7ec1['result'][_0x8fcf('0x16')]);}})[_0x8fcf('0x17')](function(_0x47ec0a){logger[_0x8fcf('0x14')](_0x8fcf('0xf'),_0x181f2f,_0x47ec0a);_0x1fbe43(_0x47ec0a);});});}
\ No newline at end of file
+var _0x083e=['CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x083e,0x1b8));var _0xe083=function(_0x419560,_0x16a92c){_0x419560=_0x419560-0x0;var _0x52a0a9=_0x083e[_0x419560];return _0x52a0a9;};'use strict';var _=require(_0xe083('0x0'));var util=require(_0xe083('0x1'));var moment=require(_0xe083('0x2'));var BPromise=require('bluebird');var rs=require(_0xe083('0x3'));var fs=require('fs');var Redis=require(_0xe083('0x4'));var db=require(_0xe083('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe083('0x6'))(_0xe083('0x7'));var config=require(_0xe083('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe083('0x9')][_0xe083('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x231c8d,_0x3bdb4d,_0x3e14d9){return new BPromise(function(_0x2d5821,_0x586a54){return client[_0xe083('0xb')](_0x231c8d,_0x3e14d9)[_0xe083('0xc')](function(_0x2b8eee){logger[_0xe083('0xd')]('CmCompany,\x20%s,\x20%s',_0x3bdb4d,_0xe083('0xe'));logger[_0xe083('0xf')](_0xe083('0x10'),_0x3bdb4d,_0xe083('0xe'),JSON[_0xe083('0x11')](_0x2b8eee));if(_0x2b8eee['error']){if(_0x2b8eee[_0xe083('0x12')][_0xe083('0x13')]===0x1f4){logger['error'](_0xe083('0x14'),_0x3bdb4d,_0x2b8eee[_0xe083('0x12')][_0xe083('0x15')]);return _0x586a54(_0x2b8eee['error']['message']);}logger['error'](_0xe083('0x14'),_0x3bdb4d,_0x2b8eee[_0xe083('0x12')][_0xe083('0x15')]);return _0x2d5821(_0x2b8eee[_0xe083('0x12')][_0xe083('0x15')]);}else{logger[_0xe083('0xd')](_0xe083('0x14'),_0x3bdb4d,_0xe083('0xe'));_0x2d5821(_0x2b8eee[_0xe083('0x16')][_0xe083('0x15')]);}})[_0xe083('0x17')](function(_0x4363f5){logger[_0xe083('0x12')](_0xe083('0x14'),_0x3bdb4d,_0x4363f5);_0x586a54(_0x4363f5);});});}
\ No newline at end of file
index b269b20..6ed8b2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2dd=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','show','getContacts','post','create','/:id/contacts','addContacts','put','/:id','update','delete','destroy','exports'];(function(_0x361cc0,_0x40ea36){var _0x1bf3cd=function(_0x295fbd){while(--_0x295fbd){_0x361cc0['push'](_0x361cc0['shift']());}};_0x1bf3cd(++_0x40ea36);}(_0xf2dd,0xcf));var _0xdf2d=function(_0x2daef6,_0xcac228){_0x2daef6=_0x2daef6-0x0;var _0x62d030=_0xf2dd[_0x2daef6];return _0x62d030;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdf2d('0x0'));var express=require(_0xdf2d('0x1'));var router=express['Router']();var fs_extra=require(_0xdf2d('0x2'));var auth=require(_0xdf2d('0x3'));var interaction=require(_0xdf2d('0x4'));var config=require(_0xdf2d('0x5'));var controller=require(_0xdf2d('0x6'));router[_0xdf2d('0x7')]('/',auth[_0xdf2d('0x8')](),controller[_0xdf2d('0x9')]);router['get'](_0xdf2d('0xa'),auth[_0xdf2d('0x8')](),controller['describe']);router[_0xdf2d('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xdf2d('0xb')]);router[_0xdf2d('0x7')]('/:id/contacts',auth[_0xdf2d('0x8')](),controller[_0xdf2d('0xc')]);router[_0xdf2d('0xd')]('/',auth[_0xdf2d('0x8')](),controller[_0xdf2d('0xe')]);router[_0xdf2d('0xd')](_0xdf2d('0xf'),auth['isAuthenticated'](),controller[_0xdf2d('0x10')]);router[_0xdf2d('0x11')](_0xdf2d('0x12'),auth[_0xdf2d('0x8')](),controller[_0xdf2d('0x13')]);router[_0xdf2d('0x14')](_0xdf2d('0x12'),auth[_0xdf2d('0x8')](),controller[_0xdf2d('0x15')]);module[_0xdf2d('0x16')]=router;
\ No newline at end of file
+var _0x1f2e=['multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/contacts','getContacts','post','addContacts','update','destroy','exports'];(function(_0x2865dd,_0x30a409){var _0x2142cf=function(_0x301f1f){while(--_0x301f1f){_0x2865dd['push'](_0x2865dd['shift']());}};_0x2142cf(++_0x30a409);}(_0x1f2e,0x17c));var _0xe1f2=function(_0x50cc4f,_0x5449f5){_0x50cc4f=_0x50cc4f-0x0;var _0x3d9204=_0x1f2e[_0x50cc4f];return _0x3d9204;};'use strict';var multer=require(_0xe1f2('0x0'));var util=require('util');var path=require(_0xe1f2('0x1'));var timeout=require(_0xe1f2('0x2'));var express=require('express');var router=express[_0xe1f2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe1f2('0x4'));var config=require(_0xe1f2('0x5'));var controller=require(_0xe1f2('0x6'));router['get']('/',auth[_0xe1f2('0x7')](),controller[_0xe1f2('0x8')]);router[_0xe1f2('0x9')](_0xe1f2('0xa'),auth[_0xe1f2('0x7')](),controller[_0xe1f2('0xb')]);router['get'](_0xe1f2('0xc'),auth[_0xe1f2('0x7')](),controller['show']);router[_0xe1f2('0x9')](_0xe1f2('0xd'),auth[_0xe1f2('0x7')](),controller[_0xe1f2('0xe')]);router[_0xe1f2('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe1f2('0xf')](_0xe1f2('0xd'),auth['isAuthenticated'](),controller[_0xe1f2('0x10')]);router['put'](_0xe1f2('0xc'),auth['isAuthenticated'](),controller[_0xe1f2('0x11')]);router['delete'](_0xe1f2('0xc'),auth[_0xe1f2('0x7')](),controller[_0xe1f2('0x12')]);module[_0xe1f2('0x13')]=router;
\ No newline at end of file
index cf96718..d4e2368 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb23d=['NOW','sequelize','STRING','INTEGER','UNSIGNED'];(function(_0x123b2a,_0x3e43fd){var _0x464776=function(_0x40f662){while(--_0x40f662){_0x123b2a['push'](_0x123b2a['shift']());}};_0x464776(++_0x3e43fd);}(_0xb23d,0x12d));var _0xdb23=function(_0x5550b3,_0x2d0ee0){_0x5550b3=_0x5550b3-0x0;var _0x4b8fc4=_0xb23d[_0x5550b3];return _0x4b8fc4;};'use strict';var _=require('lodash');var Sequelize=require(_0xdb23('0x0'));module['exports']={'firstName':{'type':Sequelize[_0xdb23('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0xdb23('0x1')]},'street':{'type':Sequelize[_0xdb23('0x1')]},'postalCode':{'type':Sequelize[_0xdb23('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xdb23('0x1')]},'dateOfBirth':{'type':Sequelize[_0xdb23('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xdb23('0x1')]},'mobile':{'type':Sequelize[_0xdb23('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xdb23('0x1')]},'facebook':{'type':Sequelize[_0xdb23('0x1')]},'fb_data':{'type':Sequelize[_0xdb23('0x1')]},'twitter':{'type':Sequelize[_0xdb23('0x1')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xdb23('0x1')]},'viber':{'type':Sequelize[_0xdb23('0x1')]},'line':{'type':Sequelize[_0xdb23('0x1')]},'wechat':{'type':Sequelize[_0xdb23('0x1')]},'telegram':{'type':Sequelize[_0xdb23('0x1')]},'UserId':{'type':Sequelize[_0xdb23('0x2')]},'AdditionalPhones':{'type':Sequelize[_0xdb23('0x1')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xdb23('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xdb23('0x4')]},'dialTimezone':{'type':Sequelize[_0xdb23('0x1')]},'utcOffset':{'type':Sequelize[_0xdb23('0x2')]}};
\ No newline at end of file
+var _0xd9fa=['TEXT','INTEGER','UNSIGNED','DATE','lodash','exports','STRING'];(function(_0x308658,_0x286bf5){var _0x2feffc=function(_0x382fc2){while(--_0x382fc2){_0x308658['push'](_0x308658['shift']());}};_0x2feffc(++_0x286bf5);}(_0xd9fa,0xd6));var _0xad9f=function(_0x5629e9,_0x21d125){_0x5629e9=_0x5629e9-0x0;var _0x5ec492=_0xd9fa[_0x5629e9];return _0x5ec492;};'use strict';var _=require(_0xad9f('0x0'));var Sequelize=require('sequelize');module[_0xad9f('0x1')]={'firstName':{'type':Sequelize[_0xad9f('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xad9f('0x2')]},'street':{'type':Sequelize[_0xad9f('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xad9f('0x2')]},'country':{'type':Sequelize[_0xad9f('0x2')]},'dateOfBirth':{'type':Sequelize[_0xad9f('0x2')]},'description':{'type':Sequelize[_0xad9f('0x3')]},'phone':{'type':Sequelize[_0xad9f('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xad9f('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xad9f('0x2')]},'twitter':{'type':Sequelize[_0xad9f('0x2')]},'skype':{'type':Sequelize[_0xad9f('0x2')]},'teams':{'type':Sequelize[_0xad9f('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xad9f('0x2')]},'wechat':{'type':Sequelize[_0xad9f('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xad9f('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xad9f('0x2')]},'priority':{'type':Sequelize[_0xad9f('0x4')](0x2)[_0xad9f('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xad9f('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xad9f('0x2')]},'utcOffset':{'type':Sequelize[_0xad9f('0x4')]}};
\ No newline at end of file
index 050319b..698dd1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d9d=['params','ItemType','literal','Phones.OrderBy','format','dialTimezone','timezones','$and','findAll','omit','pickBy','cf_%d','table','setFields','id\x20=\x20?','toParam','phone','CmHopper','getTags','options','nolimit','setTags','findOne','ids','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','`ItemType`.OrderBy','CmHopperId','bulkCreate','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','ContactId','include','getHopperHistories','includeAll','CmHopperFinal','rawAttributes','uploadCsv','No\x20ListId\x20specified','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','0777','child_process','fork','../../components/import/cm/csv','binding_keys','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','import','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','binding','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','duration','note','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','createdAt','DESC','alias','startCase','Website','Account','closed','closedAt','disposition','thirdDisposition','Owner','browserName','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','Interaction','findAndCountAll','flatten','reverse','slice','moment','bluebird','path','lodash','squel','papaparse','../../components/parsers/advancedSearch','api','../../config/environment','../../config/environment/shared','redis','defaults','socket.io-emitter','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','trimStart','all','fieldType','type','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','select','field','color','tools_tags','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','value','split','map','forEach','and','uc.UserId\x20=\x20?','datetime','castTo','DATE','buildExpression','text','start','filter','isNil','Contact','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','replace','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','having','t.id\x20IN\x20?','resolve','user','role','agent','some','User','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','c.firstName','c.phone','c.mobile','c.fax','c.email','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','tags','columnName','displayName','custom','values','body','get','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopperBlack','create','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','join','utcOffset','additionalPhones','each','duplicates','$or','findOrCreate','spread','contact','show','Tag','CmContactHasItem','Phones'];(function(_0x144616,_0x1188de){var _0x100e2f=function(_0x35d543){while(--_0x35d543){_0x144616['push'](_0x144616['shift']());}};_0x100e2f(++_0x1188de);}(_0x3d9d,0x88));var _0xd3d9=function(_0x1f23c9,_0x27aaf8){_0x1f23c9=_0x1f23c9-0x0;var _0x1f0fdd=_0x3d9d[_0x1f23c9];return _0x1f0fdd;};'use strict';var moment=require(_0xd3d9('0x0'));var BPromise=require(_0xd3d9('0x1'));var util=require('util');var path=require(_0xd3d9('0x2'));var fs=require('fs');var _=require(_0xd3d9('0x3'));var squel=require(_0xd3d9('0x4'));var Papa=require(_0xd3d9('0x5'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0xd3d9('0x6'));var logger=require('../../config/logger')(_0xd3d9('0x7'));var config=require(_0xd3d9('0x8'));var shared=require(_0xd3d9('0x9'));var db=require('../../mysqldb')['db'];config[_0xd3d9('0xa')]=_[_0xd3d9('0xb')](config[_0xd3d9('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd3d9('0xc'))(new Redis(config[_0xd3d9('0xa')]));require('./cmContact.socket')['register'](socket);function respondWithResult(_0x4be05a,_0x1ea07c){_0x1ea07c=_0x1ea07c||0xc8;return function(_0x389da7){if(_0x389da7){return _0x4be05a[_0xd3d9('0xd')](_0x1ea07c)[_0xd3d9('0xe')](_0x389da7);}};}function respondWithFilteredResult(_0x12c6fe,_0x63e30){return function(_0x3675a5){if(_0x3675a5){var _0x15d149=typeof _0x63e30[_0xd3d9('0xf')]===_0xd3d9('0x10')&&typeof _0x63e30[_0xd3d9('0x11')]===_0xd3d9('0x10');var _0xee8256=_0x3675a5[_0xd3d9('0x12')];var _0x56e4f4=_0x15d149?0x0:_0x63e30[_0xd3d9('0xf')];var _0x2de884=_0x15d149?_0x3675a5[_0xd3d9('0x12')]:_0x63e30[_0xd3d9('0xf')]+_0x63e30[_0xd3d9('0x11')];var _0x411a8e;if(_0x2de884>=_0xee8256){_0x2de884=_0xee8256;_0x411a8e=0xc8;}else{_0x411a8e=0xce;}_0x12c6fe['status'](_0x411a8e);return _0x12c6fe[_0xd3d9('0x13')](_0xd3d9('0x14'),_0x56e4f4+'-'+_0x2de884+'/'+_0xee8256)['json'](_0x3675a5);}return null;};}function saveUpdates(_0x58da3f){return function(_0x59ecd3){if(_0x59ecd3){return _0x59ecd3[_0xd3d9('0x15')](_0x58da3f)[_0xd3d9('0x16')](function(_0x9df3ab){return _0x9df3ab;});}return null;};}function removeEntity(_0xb845f7){return function(_0x510d70){if(_0x510d70){return _0x510d70[_0xd3d9('0x17')]()[_0xd3d9('0x16')](function(){_0xb845f7[_0xd3d9('0xd')](0xcc)[_0xd3d9('0x18')]();});}};}function handleEntityNotFound(_0x1b6bea){return function(_0x503ba7){if(!_0x503ba7){_0x1b6bea[_0xd3d9('0x19')](0x194);}return _0x503ba7;};}function handleError(_0x3915d2,_0x4e6d2a){_0x4e6d2a=_0x4e6d2a||0x1f4;return function(_0x4dac7f){logger[_0xd3d9('0x1a')](_0x4dac7f[_0xd3d9('0x1b')]);if(_0x4dac7f[_0xd3d9('0x1c')]){delete _0x4dac7f['name'];}_0x3915d2[_0xd3d9('0xd')](_0x4e6d2a)[_0xd3d9('0x1d')](_0x4dac7f);};}exports[_0xd3d9('0x1e')]=function(_0x1e0dd2,_0x205c57){var _0x38c5ce={},_0x2a666b={},_0xa5441d={'count':0x0,'rows':[]};return db[_0xd3d9('0x1f')][_0xd3d9('0x20')]()[_0xd3d9('0x16')](function(_0x521b01){var _0x51cb77=[];for(var _0x22ff9b=0x0;_0x22ff9b<Object[_0xd3d9('0x21')](_0x521b01)[_0xd3d9('0x22')];_0x22ff9b++){var _0x108d57=Object[_0xd3d9('0x21')](_0x521b01)[_0x22ff9b];if(_[_0xd3d9('0x23')](_0x108d57,_0xd3d9('0x24'))){_0x51cb77[_0xd3d9('0x25')](db[_0xd3d9('0x26')]['findOne']({'where':{'id':_[_0xd3d9('0x27')](_0x108d57,_0xd3d9('0x24'))},'raw':!![]}));}}return BPromise[_0xd3d9('0x28')](_0x51cb77)[_0xd3d9('0x16')](function(_0x3c1217){for(var _0x357b60=0x0;_0x357b60<_0x3c1217['length'];_0x357b60++){if(_0x3c1217[_0x357b60]){var _0x2b27ef='cf_'+_0x3c1217[_0x357b60]['id'];var _0x57784e=_0x521b01[_0x2b27ef];_0x57784e[_0xd3d9('0x29')]=_0x3c1217[_0x357b60][_0xd3d9('0x2a')];}}return _0x521b01;});})[_0xd3d9('0x16')](function(_0x2507ec){_0x2a666b['model']=_['keys'](_0x2507ec);_0x2a666b[_0xd3d9('0x2b')]=_[_0xd3d9('0x21')](_0x1e0dd2[_0xd3d9('0x2b')]);_0x2a666b[_0xd3d9('0x2c')]=_[_0xd3d9('0x2d')](_0x2a666b[_0xd3d9('0x2e')],_0x2a666b[_0xd3d9('0x2b')]);_0x38c5ce['attributes']=_[_0xd3d9('0x2d')](_0x2a666b[_0xd3d9('0x2e')],qs[_0xd3d9('0x2f')](_0x1e0dd2['query'][_0xd3d9('0x2f')]));_0x38c5ce[_0xd3d9('0x30')]=_0x38c5ce[_0xd3d9('0x30')]['length']?_0x38c5ce[_0xd3d9('0x30')]:_0x2a666b[_0xd3d9('0x2e')];if(!_0x1e0dd2[_0xd3d9('0x2b')][_0xd3d9('0x31')]('nolimit')){_0x38c5ce[_0xd3d9('0x11')]=qs['limit'](_0x1e0dd2[_0xd3d9('0x2b')]['limit']);_0x38c5ce[_0xd3d9('0xf')]=qs[_0xd3d9('0xf')](_0x1e0dd2[_0xd3d9('0x2b')]['offset']);}_0x38c5ce[_0xd3d9('0x32')]=qs[_0xd3d9('0x33')](_0x1e0dd2[_0xd3d9('0x2b')]['sort']);_0x38c5ce[_0xd3d9('0x34')]=qs[_0xd3d9('0x2c')](_[_0xd3d9('0x35')](_0x1e0dd2[_0xd3d9('0x2b')],_0x2a666b['filters']),_0x2507ec);var _0x19cc1c=[];var _0x3b0e8f=squel[_0xd3d9('0x36')]()[_0xd3d9('0x37')]('id')['field'](_0xd3d9('0x1c'))[_0xd3d9('0x37')](_0xd3d9('0x38'))['from'](_0xd3d9('0x39'));var _0x1a418f=squel[_0xd3d9('0x36')]()[_0xd3d9('0x3a')](_0xd3d9('0x3b'),'c')[_0xd3d9('0x3c')](_0xd3d9('0x3d'),'uc',_0xd3d9('0x3e'))[_0xd3d9('0x3c')](_0xd3d9('0x3f'),'ct',_0xd3d9('0x40'))[_0xd3d9('0x3c')](_0xd3d9('0x39'),'t',_0xd3d9('0x41'))[_0xd3d9('0x34')](_0xd3d9('0x42'));var _0x421a81=squel[_0xd3d9('0x43')]();var _0xffda7f=[];var _0x2bf935=squel[_0xd3d9('0x43')]();var _0x1e5221;if(_0x1e0dd2['query'][_0xd3d9('0x44')]){_0x1e5221=as['parseSearch'](_0x1e0dd2['query']['search']);var _0xa32996=_0x1e5221[_0xd3d9('0x45')];for(var _0x1cc7e1=0x0;_0x1cc7e1<_0x1e5221[_0xd3d9('0x46')][_0xd3d9('0x22')];_0x1cc7e1++){var _0x184365=_0x1e5221[_0xd3d9('0x46')][_0x1cc7e1];var _0x2772f8='c';var _0x17596f=_(_0x2507ec)[_0xd3d9('0x21')]()[_0xd3d9('0x47')](function(_0x415dc7){return _0x415dc7===_0x184365[_0xd3d9('0x37')];});if(_0x17596f)_0x17596f=_0x2507ec[_0x184365[_0xd3d9('0x37')]];if(!_0x17596f){if(_0x184365[_0xd3d9('0x37')]==='Tag'){var _0x203371=_0x184365[_0xd3d9('0x48')][_0xd3d9('0x49')](',')[_0xd3d9('0x4a')](function(_0x286114){return Number(_0x286114);});_0x203371[_0xd3d9('0x4b')](function(_0x437c64){_0x2bf935['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x437c64+',%');});_0xffda7f=_['union'](_0xffda7f,_0x203371);}else if(_0x184365['field']==='User'){_0x421a81[_0xd3d9('0x4c')](_0xd3d9('0x4d'),_0x184365[_0xd3d9('0x48')]);}}else{if(_0x184365['field']==='dateOfBirth'||_0x17596f[_0xd3d9('0x29')]===_0xd3d9('0x4e'))_0x184365[_0xd3d9('0x4f')]=_0xd3d9('0x50');var _0x131503=as[_0xd3d9('0x51')](_0x2772f8,_0x17596f['type'],_0x184365);_0x421a81[_0xa32996](_0x131503[_0xd3d9('0x52')],_0x131503[_0xd3d9('0x48')][_0xd3d9('0x53')],_0x131503[_0xd3d9('0x48')][_0xd3d9('0x18')]);}}}else{var _0x405d03=_(Object['keys'](_0x1e0dd2[_0xd3d9('0x2b')]))[_0xd3d9('0x4a')](function(_0x136cc1){return _0x2507ec['hasOwnProperty'](_0x136cc1)?_0x136cc1:undefined;})[_0xd3d9('0x54')](function(_0x8c3c7f){return!_[_0xd3d9('0x55')](_0x8c3c7f);})[_0xd3d9('0x48')]();if(_0x1e0dd2['query'][_0xd3d9('0x56')])_0x405d03['push'](_0xd3d9('0x56'));if(!_['isEmpty'](_0x405d03)){_0x405d03[_0xd3d9('0x4b')](function(_0x3d721c){if(_0x3d721c===_0xd3d9('0x57')){_0x1a418f['where'](_0xd3d9('0x58'),[][_0xd3d9('0x59')](_0x1e0dd2[_0xd3d9('0x2b')][_0x3d721c]));}else if(_0x3d721c===_0xd3d9('0x56')){var _0x351f94='%'+_0x1e0dd2['query'][_0x3d721c]+'%';_0x1a418f[_0xd3d9('0x34')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x351f94);}else{_0x1a418f[_0xd3d9('0x34')]('c.'+_0x3d721c+_0xd3d9('0x5a'),_0x1e0dd2[_0xd3d9('0x2b')][_0x3d721c]);}});}if(_0x1e0dd2[_0xd3d9('0x2b')][_0xd3d9('0x5b')]){_0xffda7f=_[_0xd3d9('0x5c')](_0x1e0dd2[_0xd3d9('0x2b')][_0xd3d9('0x5b')])?_0x1e0dd2[_0xd3d9('0x2b')]['tag']:new Array(_0x1e0dd2['query']['tag']);_0xffda7f[_0xd3d9('0x4b')](function(_0x57b484){_0x2bf935['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x57b484+',%');});}if(_0x1e0dd2[_0xd3d9('0x2b')][_0xd3d9('0x54')]){var _0xd78e59=_0x1e0dd2['query']['filter'][_0xd3d9('0x5d')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0xd78e59[_0xd3d9('0x49')]('\x20')[_0xd3d9('0x22')]>0x1){_0x421a81['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xd78e59),null);}else{if(qs[_0xd3d9('0x5e')](_0xd78e59)){_0x421a81['or'](_0xd3d9('0x5f'),_0xd78e59+'%');_0x421a81['or'](_0xd3d9('0x60'),_0xd78e59+'%');_0x421a81['or']('c.mobile\x20LIKE\x20?',_0xd78e59+'%');_0x421a81['or'](_0xd3d9('0x61'),_0xd78e59+'%');}else if(qs[_0xd3d9('0x62')](_0xd78e59)){_0x421a81['or']('c.email\x20LIKE\x20?',_0xd78e59+'%');}else{_0x421a81['or']('c.firstName\x20LIKE\x20?','%'+_0xd78e59+'%');_0x421a81['or'](_0xd3d9('0x63'),'%'+_0xd78e59+'%');_0x421a81['or'](_0xd3d9('0x64'),'%'+_0xd78e59+'%');}}}}_0x1a418f['where'](_0x421a81);_0x1a418f[_0xd3d9('0x65')](_0xd3d9('0x66'));var _0x31280f={'type':db[_0xd3d9('0x67')][_0xd3d9('0x68')][_0xd3d9('0x69')],'raw':!![]};var _0x15f233=_0x1a418f[_0xd3d9('0x6a')]()[_0xd3d9('0x37')](_0xd3d9('0x66'));if(_0x38c5ce[_0xd3d9('0x32')]){_0x38c5ce[_0xd3d9('0x32')][_0xd3d9('0x4b')](function(_0x2ee324){_0x1a418f[_0xd3d9('0x32')]('c.'+_0x2ee324[0x0],_0x2ee324[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0xffda7f)){_0x1a418f[_0xd3d9('0x6b')](_0x2bf935);_0x15f233[_0xd3d9('0x34')](_0xd3d9('0x6c'),_0xffda7f);}BPromise[_0xd3d9('0x6d')]()['then'](function(){if(!_0x1e5221)return;if(_0x1e0dd2[_0xd3d9('0x6e')][_0xd3d9('0x6f')]!==_0xd3d9('0x70'))return;if(!_[_0xd3d9('0x71')](_0x1e5221['conditions'],[_0xd3d9('0x37'),_0xd3d9('0x72')])){return _0x1e0dd2[_0xd3d9('0x6e')]['getLists']({'attributes':['id'],'raw':!![]})[_0xd3d9('0x16')](function(_0x192db4){if(_['isEmpty'](_0x192db4)){_0x15f233[_0xd3d9('0x34')](_0xd3d9('0x73'));_0x1a418f['where'](_0xd3d9('0x73'));}else{_0x15f233['where'](_0xd3d9('0x58'),_['map'](_0x192db4,'id'));_0x1a418f[_0xd3d9('0x34')](_0xd3d9('0x58'),_[_0xd3d9('0x4a')](_0x192db4,'id'));}});}})['then'](function(){if(_0x1e0dd2[_0xd3d9('0x6e')][_0xd3d9('0x6f')]===_0xd3d9('0x70')&&!_0x1e5221&&!_0x1e0dd2[_0xd3d9('0x2b')][_0xd3d9('0x57')])return[];return db[_0xd3d9('0x74')][_0xd3d9('0x2b')](_0x15f233[_0xd3d9('0x75')](),_0x31280f);})['then'](function(_0x5659d9){_0xa5441d[_0xd3d9('0x12')]=_0x5659d9['length'];if(_0xa5441d['count']===0x0)return[];return db[_0xd3d9('0x74')]['query'](_0x3b0e8f[_0xd3d9('0x75')](),_0x31280f)[_0xd3d9('0x16')](function(_0x41eafd){_0x19cc1c=_[_0xd3d9('0x76')](_0x41eafd,'id');_0x31280f=_[_0xd3d9('0x77')](_0x31280f,{'model':db[_0xd3d9('0x1f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1e0dd2[_0xd3d9('0x2b')]['fields']){_0x38c5ce[_0xd3d9('0x30')][_0xd3d9('0x4b')](function(_0x4b5f10){_0x1a418f[_0xd3d9('0x37')]('c.'+_0x4b5f10);});}else{_0x1a418f[_0xd3d9('0x37')](_0xd3d9('0x66'));_0x1a418f[_0xd3d9('0x37')](_0xd3d9('0x78'));_0x1a418f[_0xd3d9('0x37')]('c.lastName');_0x1a418f['field'](_0xd3d9('0x79'));_0x1a418f[_0xd3d9('0x37')](_0xd3d9('0x7a'));_0x1a418f[_0xd3d9('0x37')](_0xd3d9('0x7b'));_0x1a418f['field'](_0xd3d9('0x7c'));_0x1a418f[_0xd3d9('0x37')]('c.ListId');_0x1a418f['field'](_0xd3d9('0x7d'));_0x1a418f['field']('c.deletedAt');_0x1a418f[_0xd3d9('0x37')](_0xd3d9('0x7e'));_0x1a418f['field'](_0xd3d9('0x7f'),_0xd3d9('0x80'));}if(_0x38c5ce[_0xd3d9('0x11')])_0x1a418f[_0xd3d9('0x11')](_0x38c5ce[_0xd3d9('0x11')]);if(_0x38c5ce[_0xd3d9('0xf')])_0x1a418f[_0xd3d9('0xf')](_0x38c5ce[_0xd3d9('0xf')]);return db[_0xd3d9('0x74')]['query'](_0x1a418f[_0xd3d9('0x75')](),_0x31280f);});})[_0xd3d9('0x16')](function(_0x273ffe){_0x273ffe[_0xd3d9('0x4b')](function(_0x464f52){if(_0x464f52[_0xd3d9('0x80')]){_0x464f52[_0xd3d9('0x81')]=[];_0x464f52['TagIds']['split'](',')[_0xd3d9('0x4b')](function(_0x4676ea){_0x464f52[_0xd3d9('0x81')]['push'](_0x19cc1c[_0x4676ea]);});}delete _0x464f52['TagIds'];});_0xa5441d[_0xd3d9('0x82')]=_0x273ffe;return _0xa5441d;})[_0xd3d9('0x16')](respondWithFilteredResult(_0x205c57,_0x38c5ce));})[_0xd3d9('0x83')](handleError(_0x205c57,null));};exports[_0xd3d9('0x17')]=function(_0x2fdc12,_0x3639d5){return db[_0xd3d9('0x1f')][_0xd3d9('0x47')]({'where':{'id':_0x2fdc12['params']['id']}})[_0xd3d9('0x16')](handleEntityNotFound(_0x3639d5,null))['then'](removeEntity(_0x3639d5,null))[_0xd3d9('0x83')](handleError(_0x3639d5,null));};exports[_0xd3d9('0x20')]=function(_0x3657b7,_0x4d094f){return db[_0xd3d9('0x1f')]['describe']()['then'](function(_0x511b50){delete _0x511b50[_0xd3d9('0x84')];for(var _0x4d9a4a=0x0;_0x4d9a4a<Object['keys'](_0x511b50)[_0xd3d9('0x22')];_0x4d9a4a++){var _0x44a015=Object[_0xd3d9('0x21')](_0x511b50)[_0x4d9a4a];if(!_[_0xd3d9('0x23')](_0x44a015,'cf_')){_0x511b50[_0x44a015][_0xd3d9('0x85')]=_0x44a015;_0x511b50[_0x44a015][_0xd3d9('0x86')]=_0x44a015;}}return _0x511b50;})['then'](function(_0x33a1ef){var _0x5ecdfa={'where':Boolean(_0x3657b7[_0xd3d9('0x2b')]['analytics'])===!![]?undefined:{'$or':[{'ListId':_0x3657b7['query']['id']},{'ListId':null}]},'raw':!![]};return db[_0xd3d9('0x26')]['findAll'](_0x5ecdfa)[_0xd3d9('0x16')](function(_0x84e12c){for(var _0x32068b=0x0;_0x32068b<_0x84e12c[_0xd3d9('0x22')];_0x32068b++){var _0x1e38c8=_0xd3d9('0x24')+_0x84e12c[_0x32068b]['id'];_0x33a1ef[_0x1e38c8][_0xd3d9('0x85')]=_0x1e38c8;_0x33a1ef[_0x1e38c8]['displayName']=_0x84e12c[_0x32068b]['alias'];_0x33a1ef[_0x1e38c8][_0xd3d9('0x87')]={'type':_0x84e12c[_0x32068b]['type'],'values':_0x84e12c[_0x32068b][_0xd3d9('0x88')]};}Object[_0xd3d9('0x21')](_0x33a1ef)[_0xd3d9('0x4b')](function(_0xf20801){if(!_0x33a1ef[_0xf20801][_0xd3d9('0x31')](_0xd3d9('0x85'))){delete _0x33a1ef[_0xf20801];}});return _0x33a1ef;});})[_0xd3d9('0x16')](respondWithResult(_0x4d094f,null))[_0xd3d9('0x83')](handleError(_0x4d094f,null));};exports[_0xd3d9('0x77')]=function(_0x57de51,_0x4d7188){var _0x2ba1bf;var _0x42270b;var _0x30c6de;if(_0x57de51[_0xd3d9('0x89')]['id']){delete _0x57de51[_0xd3d9('0x89')]['id'];}return db['CmContact']['findAll']({'where':{'id':[_0x57de51[_0xd3d9('0x89')]['to'],_0x57de51[_0xd3d9('0x89')][_0xd3d9('0x3a')]]}})[_0xd3d9('0x16')](function(_0xc11d79){if(_0xc11d79){if(_0xc11d79[_0xd3d9('0x22')]!==0x2){return null;}_0xc11d79[0x0]=_0xc11d79[0x0][_0xd3d9('0x8a')]({'plain':!![]});_0xc11d79[0x1]=_0xc11d79[0x1][_0xd3d9('0x8a')]({'plain':!![]});delete _0xc11d79[0x0]['id'];delete _0xc11d79[0x1]['id'];return _['mergeWith'](_0xc11d79[0x0],_0xc11d79[0x1],function(_0x3c2faf,_0x3e8a12){if(Array[_0xd3d9('0x5c')](_0x3e8a12)&&!_0x3e8a12[_0xd3d9('0x22')]){return _0x3c2faf;}else if(!_0x3e8a12){return _0x3c2faf;}});}})[_0xd3d9('0x16')](handleEntityNotFound(_0x4d7188,null))[_0xd3d9('0x16')](function(_0x3b9642){if(_0x3b9642){if(_0x3b9642[_0xd3d9('0x84')]&&_['isArray'](_0x3b9642['tags'])){_0x3b9642[_0xd3d9('0x84')]=_0x3b9642[_0xd3d9('0x84')]['join']();}logger[_0xd3d9('0x8b')](_0xd3d9('0x8c'),_0x57de51[_0xd3d9('0x89')]['to'],_0x57de51[_0xd3d9('0x89')][_0xd3d9('0x3a')]);return db['CmHopper'][_0xd3d9('0x17')]({'where':{'ContactId':[_0x57de51[_0xd3d9('0x89')]['to'],_0x57de51[_0xd3d9('0x89')][_0xd3d9('0x3a')]]}})[_0xd3d9('0x16')](function(_0x9dbbfb){logger[_0xd3d9('0x8b')]('[CmContact][merge][destroy][CmHopper],\x20%s',_0x9dbbfb);return db[_0xd3d9('0x8d')]['destroy']({'where':{'ContactId':[_0x57de51[_0xd3d9('0x89')]['to'],_0x57de51[_0xd3d9('0x89')]['from']]}})[_0xd3d9('0x16')](function(_0x2fcf36){logger[_0xd3d9('0x8b')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x2fcf36);return db['CmContact'][_0xd3d9('0x8e')](_0x3b9642);});});}})[_0xd3d9('0x16')](function(_0x8d311c){if(_0x8d311c){_0x2ba1bf=_0x8d311c;_0x42270b={'ContactId':_0x2ba1bf['id']};_0x30c6de={'where':{'ContactId':[_0x57de51['body']['to'],_0x57de51['body']['from']]}};return db['ChatInteraction'][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})['then'](function(){if(_0x2ba1bf){return db[_0xd3d9('0x8f')][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db['ChatOfflineMessage'][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})['then'](function(){if(_0x2ba1bf){return db[_0xd3d9('0x90')]['update'](_0x42270b,_0x30c6de);}})['then'](function(){if(_0x2ba1bf){return db[_0xd3d9('0x91')][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})['then'](function(){if(_0x2ba1bf){return db['MailInteraction'][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db[_0xd3d9('0x91')][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db[_0xd3d9('0x92')][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db[_0xd3d9('0x93')][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db[_0xd3d9('0x94')]['update'](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db[_0xd3d9('0x95')][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db[_0xd3d9('0x96')][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db[_0xd3d9('0x97')][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db['CmContactHasItem']['update']({'CmContactId':_0x2ba1bf['id']},{'where':{'CmContactId':[_0x57de51[_0xd3d9('0x89')]['to'],_0x57de51['body'][_0xd3d9('0x3a')]]}});}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db['CmHopperFinal']['update'](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db[_0xd3d9('0x98')][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db['ReportAgentPreview']['update'](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db[_0xd3d9('0x99')][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})['then'](function(){if(_0x2ba1bf){return db[_0xd3d9('0x9a')][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db[_0xd3d9('0x9b')]['update'](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db[_0xd3d9('0x9c')][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db[_0xd3d9('0x9d')][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db[_0xd3d9('0x9e')][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})['then'](function(){if(_0x2ba1bf){return db[_0xd3d9('0x9f')][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db[_0xd3d9('0xa0')]['update'](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db['WhatsappMessage']['update'](_0x42270b,_0x30c6de);}})['then'](function(){if(_0x2ba1bf){return db['WhatsappQueueReport'][_0xd3d9('0x15')](_0x42270b,_0x30c6de);}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return db['CmContact'][_0xd3d9('0x17')]({'where':{'id':[_0x57de51[_0xd3d9('0x89')]['to'],_0x57de51['body'][_0xd3d9('0x3a')]]}});}})[_0xd3d9('0x16')](function(){if(_0x2ba1bf){return _0x2ba1bf;}})['then'](respondWithResult(_0x4d7188,null))[_0xd3d9('0x83')](handleError(_0x4d7188,null));};exports[_0xd3d9('0x8e')]=function(_0x29bc38,_0x54b428){return db[_0xd3d9('0x1f')][_0xd3d9('0x20')]()[_0xd3d9('0x16')](function(_0x19851c){if(_0x29bc38['body']['tags']&&_[_0xd3d9('0x5c')](_0x29bc38['body'][_0xd3d9('0x84')])){if(_0x29bc38[_0xd3d9('0x89')][_0xd3d9('0x84')][_0xd3d9('0x22')]){_0x29bc38[_0xd3d9('0x89')][_0xd3d9('0x84')]=_0x29bc38[_0xd3d9('0x89')][_0xd3d9('0x84')][_0xd3d9('0xa1')](';')+';';}else{_0x29bc38[_0xd3d9('0x89')][_0xd3d9('0x84')]=null;}}else{_0x29bc38['body'][_0xd3d9('0x84')]=null;}if(!_['isNil'](_0x29bc38['body']['dialTimezone'])){var _0x4c2849=_0x29bc38[_0xd3d9('0x89')]['dialTimezone'];if(!_[_0xd3d9('0x55')](shared['timezones'][_0x4c2849]))_0x29bc38['body'][_0xd3d9('0xa2')]=shared['timezones'][_0x4c2849][_0xd3d9('0xa2')];}return db[_0xd3d9('0x1f')]['create'](_0x29bc38[_0xd3d9('0x89')],{'fields':_[_0xd3d9('0x21')](_0x19851c),'raw':!![]});})[_0xd3d9('0x16')](function(_0x565fa7){if(_0x29bc38['body'][_0xd3d9('0xa3')]){return insertAdditionalPhones(_0x565fa7,_0x29bc38[_0xd3d9('0x89')][_0xd3d9('0xa3')]);}else{return _0x565fa7;}})[_0xd3d9('0x16')](respondWithResult(_0x54b428,0xc9))[_0xd3d9('0x83')](handleError(_0x54b428,null));};exports['bulkCreate']=function(_0x1383f2,_0x2c9883){var _0x57bdc9=0x0;var _0x269e6e=0x0;var _0x3cc66d=0x0;var _0x5abf37=[];return db['CmContact']['describe']()[_0xd3d9('0x16')](function(_0x42676e){return BPromise[_0xd3d9('0xa4')](_0x1383f2[_0xd3d9('0x89')],function(_0x54503d){var _0x345f6b={'where':{'$or':[]},'defaults':_0x54503d,'fields':_[_0xd3d9('0x21')](_0x42676e),'raw':!![]};if(_0x54503d['duplicates']){for(var _0x5a8519=0x0;_0x5a8519<_0x54503d['duplicates'][_0xd3d9('0x22')];_0x5a8519++){var _0x294f70={};_0x294f70[_0x54503d[_0xd3d9('0xa5')][_0x5a8519]]=_0x54503d[_0x54503d[_0xd3d9('0xa5')][_0x5a8519]];_0x345f6b[_0xd3d9('0x34')][_0xd3d9('0xa6')][_0xd3d9('0x25')](_0x294f70);}_0x345f6b[_0xd3d9('0x34')][_0xd3d9('0x57')]=_0x54503d['ListId'];}return db['CmContact'][_0xd3d9('0xa7')](_0x345f6b)[_0xd3d9('0xa8')](function(_0x499040,_0x237694){if(_0x237694){if(_0x54503d[_0xd3d9('0x31')]('additionalPhones')){_0x5abf37['push']({'contact':_0x499040,'additionalPhones':_0x54503d['additionalPhones']});}_0x57bdc9++;}else{_0x3cc66d++;}})['catch'](function(){_0x269e6e++;});});})[_0xd3d9('0x16')](function(_0x23c22d){if(_0x23c22d){if(_0x5abf37[_0xd3d9('0x22')]>0x0){return new Promise(function(_0x38569c,_0xe9579b){var _0x278fac=[];for(var _0x3e9431=0x0;_0x3e9431<_0x5abf37[_0xd3d9('0x22')];_0x3e9431++){_0x278fac['push'](insertAdditionalPhones(_0x5abf37[_0x3e9431][_0xd3d9('0xa9')],_0x5abf37[_0x3e9431][_0xd3d9('0xa3')]));}Promise[_0xd3d9('0x28')](_0x278fac)['then'](function(){_0x38569c(0x1);});})[_0xd3d9('0x16')](function(){return{'success':_0x57bdc9,'failure':_0x269e6e,'duplicates':_0x3cc66d};});}else{return{'success':_0x57bdc9,'failure':_0x269e6e,'duplicates':_0x3cc66d};}}})['then'](respondWithResult(_0x2c9883,0xc9))[_0xd3d9('0x83')](handleError(_0x2c9883,null));};exports[_0xd3d9('0xaa')]=function(_0x29a9a4,_0x2b6288){var _0x24ac23;return db[_0xd3d9('0x1f')]['describe']()[_0xd3d9('0x16')](function(_0x15560d){return db[_0xd3d9('0x1f')][_0xd3d9('0x47')]({'where':{'id':_0x29a9a4['params']['id']},'include':[{'model':db[_0xd3d9('0xab')],'as':_0xd3d9('0x81'),'attributes':['id',_0xd3d9('0x1c'),_0xd3d9('0x38')],'required':_0x29a9a4[_0xd3d9('0x2b')][_0xd3d9('0x5b')]?!![]:![]},{'model':db[_0xd3d9('0xac')],'as':_0xd3d9('0xad'),'where':{'CmContactId':_0x29a9a4[_0xd3d9('0xae')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0xd3d9('0xaf')}]}],'order':[db['sequelize'][_0xd3d9('0xb0')](_0xd3d9('0xb1'))],'attributes':_[_0xd3d9('0x21')](_0x15560d)});})[_0xd3d9('0x16')](function(_0xc19493){if(!_[_0xd3d9('0x55')](_0xc19493)){_0x24ac23=_0xc19493['get']({'plain':!![]});var _0x577ece={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xc19493&&_0xc19493[_0xd3d9('0x57')]){if(_0xc19493[_0xd3d9('0x57')]){_0x577ece[_0xd3d9('0x34')]['$and'][_0xd3d9('0x25')]({'ListId':{'$ne':_0xc19493[_0xd3d9('0x57')]}});}}return db[_0xd3d9('0x26')]['findAll'](_0x577ece);}})[_0xd3d9('0x16')](function(_0x50494d){if(!_[_0xd3d9('0x55')](_0x50494d)){return _['omit'](_0x24ac23,_[_0xd3d9('0x4a')](_0x50494d,function(_0x405e24){return util[_0xd3d9('0xb2')]('cf_%d',_0x405e24['id']);}));}})[_0xd3d9('0x16')](handleEntityNotFound(_0x2b6288,null))[_0xd3d9('0x16')](respondWithResult(_0x2b6288,null))[_0xd3d9('0x83')](handleError(_0x2b6288,null));};exports[_0xd3d9('0x15')]=function(_0x556441,_0x4a5820){var _0x566522;if(_0x556441[_0xd3d9('0x89')]['id']){delete _0x556441['body']['id'];}if(!_[_0xd3d9('0x55')](_0x556441['body'][_0xd3d9('0xb3')])){var _0x17ff94=_0x556441[_0xd3d9('0x89')][_0xd3d9('0xb3')];if(!_[_0xd3d9('0x55')](shared[_0xd3d9('0xb4')][_0x17ff94]))_0x556441[_0xd3d9('0x89')][_0xd3d9('0xa2')]=shared[_0xd3d9('0xb4')][_0x17ff94]['utcOffset'];}return db['CmContact'][_0xd3d9('0x47')]({'where':{'id':_0x556441[_0xd3d9('0xae')]['id']}})['then'](handleEntityNotFound(_0x4a5820,null))[_0xd3d9('0x16')](saveUpdates(_0x556441[_0xd3d9('0x89')],null))['then'](function(_0x5460c1){_0x566522=_0x5460c1;var _0x2046aa={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x5460c1&&_0x5460c1['ListId']){if(_0x5460c1[_0xd3d9('0x57')]){_0x2046aa['where'][_0xd3d9('0xb5')][_0xd3d9('0x25')]({'ListId':{'$ne':_0x5460c1['ListId']}});}}return db[_0xd3d9('0x26')][_0xd3d9('0xb6')](_0x2046aa);})[_0xd3d9('0x16')](function(_0x2174e8){if(_0x2174e8){return _[_0xd3d9('0xb7')](_[_0xd3d9('0xb8')](_0x556441[_0xd3d9('0x89')],function(_0x5b79eb,_0x19d6e3){return _[_0xd3d9('0x23')](_0x19d6e3,'cf_');}),_['map'](_0x2174e8,function(_0x2edef9){return util[_0xd3d9('0xb2')](_0xd3d9('0xb9'),_0x2edef9['id']);}));}})[_0xd3d9('0x16')](function(_0x4a2c17){if(_0x4a2c17&&!_['isEmpty'](_0x4a2c17)){var _0x46868b=squel[_0xd3d9('0x15')]()[_0xd3d9('0xba')](_0xd3d9('0x3b'))[_0xd3d9('0xbb')](_0x4a2c17)[_0xd3d9('0x34')](_0xd3d9('0xbc'),_0x556441[_0xd3d9('0xae')]['id'])[_0xd3d9('0xbd')]();return db['sequelize'][_0xd3d9('0x2b')](_0x46868b[_0xd3d9('0x52')],{'replacements':_0x46868b['values']});}})['then'](function(){if(_0x556441['body'][_0xd3d9('0xbe')]&&_0x566522){return db[_0xd3d9('0xbf')]['update']({'phone':_0x556441[_0xd3d9('0x89')]['phone'],'OrderBy':0x0},{'where':{'ContactId':_0x566522['id']}});}})['then'](function(){return _0x566522;})[_0xd3d9('0x16')](respondWithResult(_0x4a5820,null))['catch'](handleError(_0x4a5820,null));};exports[_0xd3d9('0xc0')]=function(_0x2fd811,_0x3716dd){var _0x12b0bf={};var _0x1dbe33={};var _0x50fdcc;var _0x4a15e1;return db[_0xd3d9('0x1f')]['findOne']({'where':{'id':_0x2fd811[_0xd3d9('0xae')]['id']}})[_0xd3d9('0x16')](handleEntityNotFound(_0x3716dd,null))[_0xd3d9('0x16')](function(_0x261459){if(_0x261459){_0x50fdcc=_0x261459;_0x1dbe33['model']=_['keys'](db[_0xd3d9('0xab')]['rawAttributes']);_0x1dbe33[_0xd3d9('0x2b')]=_[_0xd3d9('0x21')](_0x2fd811[_0xd3d9('0x2b')]);_0x1dbe33[_0xd3d9('0x2c')]=_[_0xd3d9('0x2d')](_0x1dbe33[_0xd3d9('0x2e')],_0x1dbe33[_0xd3d9('0x2b')]);_0x12b0bf[_0xd3d9('0x30')]=_['intersection'](_0x1dbe33['model'],qs[_0xd3d9('0x2f')](_0x2fd811[_0xd3d9('0x2b')][_0xd3d9('0x2f')]));_0x12b0bf[_0xd3d9('0x30')]=_0x12b0bf[_0xd3d9('0x30')][_0xd3d9('0x22')]?_0x12b0bf[_0xd3d9('0x30')]:_0x1dbe33[_0xd3d9('0x2e')];_0x12b0bf['order']=qs['sort'](_0x2fd811[_0xd3d9('0x2b')][_0xd3d9('0x33')]);_0x12b0bf[_0xd3d9('0x34')]=qs['filters'](_[_0xd3d9('0x35')](_0x2fd811[_0xd3d9('0x2b')],_0x1dbe33['filters']));if(_0x2fd811[_0xd3d9('0x2b')][_0xd3d9('0x54')]){_0x12b0bf['where']=_['merge'](_0x12b0bf['where'],{'$or':_[_0xd3d9('0x4a')](_0x12b0bf[_0xd3d9('0x30')],function(_0x33487c){var _0x467017={};_0x467017[_0x33487c]={'$like':'%'+_0x2fd811['query'][_0xd3d9('0x54')]+'%'};return _0x467017;})});}_0x12b0bf=_[_0xd3d9('0x77')]({},_0x12b0bf,_0x2fd811[_0xd3d9('0xc1')]);return _0x50fdcc[_0xd3d9('0xc0')](_0x12b0bf);}})[_0xd3d9('0x16')](function(_0x3ef246){if(_0x3ef246){_0x4a15e1=_0x3ef246[_0xd3d9('0x22')];if(!_0x2fd811['query'][_0xd3d9('0x31')](_0xd3d9('0xc2'))){_0x12b0bf['limit']=qs[_0xd3d9('0x11')](_0x2fd811[_0xd3d9('0x2b')][_0xd3d9('0x11')]);_0x12b0bf[_0xd3d9('0xf')]=qs[_0xd3d9('0xf')](_0x2fd811[_0xd3d9('0x2b')][_0xd3d9('0xf')]);}return _0x50fdcc[_0xd3d9('0xc0')](_0x12b0bf);}})[_0xd3d9('0x16')](function(_0x4e2f36){if(_0x4e2f36){return _0x4e2f36?{'count':_0x4a15e1,'rows':_0x4e2f36}:null;}})[_0xd3d9('0x16')](respondWithResult(_0x3716dd,null))[_0xd3d9('0x83')](handleError(_0x3716dd,null));};exports[_0xd3d9('0xc3')]=function(_0x11273f,_0x2ac1dd){if(_0x11273f[_0xd3d9('0x89')]['id']){delete _0x11273f[_0xd3d9('0x89')]['id'];}return db['CmContact'][_0xd3d9('0xc4')]({'where':{'id':_0x11273f['params']['id']}})['then'](handleEntityNotFound(_0x2ac1dd,null))[_0xd3d9('0x16')](function(_0x1fca58){if(_0x1fca58){return _0x1fca58['setTags'](_0x11273f[_0xd3d9('0x89')][_0xd3d9('0xc5')]||[]);}return null;})[_0xd3d9('0x16')](respondWithResult(_0x2ac1dd,null))[_0xd3d9('0x83')](handleError(_0x2ac1dd,null));};exports['setAdditionalPhones']=function(_0x477e5f,_0x1d9807){var _0x208bb9=[];_0x208bb9['push'](addAdditionalPhones(_0x477e5f['body']));Promise['all'](_0x208bb9)['then'](function(){_0x208bb9=[];_0x208bb9[_0xd3d9('0x25')](deleteCmHopperPhones(_0x477e5f[_0xd3d9('0x89')]['id']));_0x208bb9[_0xd3d9('0x25')](addCmHopperPhones(_0x477e5f[_0xd3d9('0x89')]['id']));Promise[_0xd3d9('0x28')](_0x208bb9)['then'](function(){return[0x1];})[_0xd3d9('0x16')](respondWithResult(_0x1d9807,null));});};function addAdditionalPhones(_0x49addd){var _0x134fed;return new Promise(function(_0x26cf45,_0xd2ce50){return db[_0xd3d9('0xac')][_0xd3d9('0x17')]({'where':{'CmContactId':_0x49addd['id']}})[_0xd3d9('0x16')](function(){db[_0xd3d9('0xc6')][_0xd3d9('0xb6')]({'raw':!![],'attributes':['id',_0xd3d9('0xc7')]})['then'](function(_0x3079cd){var _0x1ef341=[];for(var _0x292a49=0x0;_0x292a49<_0x49addd[_0xd3d9('0xc8')][_0xd3d9('0x22')];_0x292a49++){var _0x2b8e49=_0x49addd[_0xd3d9('0xc9')]?_[_0xd3d9('0x55')](_0x49addd[_0xd3d9('0xc9')][_0x292a49])?'':_0x49addd['item_types'][_0x292a49]:_0x49addd['items'][_0x292a49]['ItemTypeId']?_0x49addd['items'][_0x292a49][_0xd3d9('0xca')]:'';var _0x50c1fc=_[_0xd3d9('0x55')](_0x49addd[_0xd3d9('0xc8')][_0x292a49]['description'])?'':_0x49addd[_0xd3d9('0xc8')][_0x292a49][_0xd3d9('0xcb')];var _0x484395=_0x2b8e49+':'+_0x49addd[_0xd3d9('0xc8')][_0x292a49][_0xd3d9('0xbe')]+'§'+_0x50c1fc;if(_[_0xd3d9('0x55')](_0x134fed))_0x134fed=_0x484395;else _0x134fed+=';'+_0x484395;var _0x197897=null;if(_0x49addd['item_types']){if(!_[_0xd3d9('0x55')](_0x49addd['item_types'][_0x292a49])){var _0x1eaf41=_[_0xd3d9('0x47')](_0x3079cd,function(_0x33b214){return _0x33b214['id']===_0x49addd[_0xd3d9('0xc9')][_0x292a49];});if(!_[_0xd3d9('0x55')](_0x1eaf41)){_0x197897=_0x1eaf41[_0xd3d9('0xc7')];}}}else{if(!_['isNil'](_0x49addd[_0xd3d9('0xc8')][_0x292a49])){var _0x1eaf41=_[_0xd3d9('0x47')](_0x3079cd,function(_0x53e93d){return _0x53e93d['id']===_0x49addd[_0xd3d9('0xc8')][_0x292a49][_0xd3d9('0xca')];});if(!_['isNil'](_0x1eaf41)){_0x197897=_0x292a49;}}}if(_[_0xd3d9('0x55')](_0x197897)){_0x197897=0x64;}_0x1ef341[_0xd3d9('0x25')](addAdditionalPhone(_0x49addd['id'],_0x49addd['items'][_0x292a49][_0xd3d9('0xbe')],_0x49addd[_0xd3d9('0xc9')]?_['isNil'](_0x49addd[_0xd3d9('0xc9')][_0x292a49])?null:_0x49addd[_0xd3d9('0xc9')][_0x292a49]:_0x49addd[_0xd3d9('0xc8')][_0x292a49][_0xd3d9('0xca')]?_0x49addd['items'][_0x292a49][_0xd3d9('0xca')]:null,_0x197897,_0x50c1fc));}Promise[_0xd3d9('0x28')](_0x1ef341)[_0xd3d9('0x16')](function(){db[_0xd3d9('0x1f')]['update']({'AdditionalPhones':_0x134fed},{'where':{'id':_0x49addd['id']}})[_0xd3d9('0x16')](function(){_0x26cf45(0x1);});});});});});}function addAdditionalPhone(_0x3728f6,_0xa10802,_0x3ef5cf,_0x2b6bcb,_0x4a9f50){return db['CmContactHasItem'][_0xd3d9('0x47')]({'where':{'CmContactId':_0x3728f6,'item':_0xa10802}})['then'](function(_0x40b240){if(_0x40b240)logger[_0xd3d9('0x8b')](_0xd3d9('0xcc'),_0x40b240);else{db[_0xd3d9('0xac')][_0xd3d9('0x8e')]({'CmContactId':_0x3728f6,'item':_0xa10802,'ItemTypeId':_0x3ef5cf,'OrderBy':_0x2b6bcb,'ItemClass':_0xd3d9('0xcd'),'description':_0x4a9f50});}});}function deletePhones(_0x3a3414){return db[_0xd3d9('0xac')][_0xd3d9('0x17')]({'where':{'CmContactId':_0x3a3414}});}function deleteCmHopperPhones(_0x1e1578){return new Promise(function(_0x3826c4,_0x59c73b){return db[_0xd3d9('0xbf')][_0xd3d9('0xb6')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1e1578}})[_0xd3d9('0x16')](function(_0x5bab3a){db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':{'$in':_[_0xd3d9('0x4a')](_0x5bab3a,'id')}}});})[_0xd3d9('0x16')](function(){_0x3826c4(0x1);});});}function addCmHopperPhones(_0x68fe93){return new Promise(function(_0x15d27b,_0x5631ee){return db[_0xd3d9('0xbf')][_0xd3d9('0xb6')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x68fe93}})['then'](function(_0x15a266){var _0x27690f=[];_[_0xd3d9('0x4a')](_0x15a266,function(_0x117bbd){_0x27690f[_0xd3d9('0x25')](createCmHopperPhone(_0x68fe93,_0x117bbd['id']));});Promise[_0xd3d9('0x28')](_0x27690f)[_0xd3d9('0x16')](function(){_0x15d27b(0x1);});});});}function createCmHopperPhone(_0x225e1b,_0x47e428){return new Promise(function(_0x565fe5,_0x3dd1c4){db[_0xd3d9('0xac')]['findAll']({'raw':!![],'attributes':['item',_0xd3d9('0xc7')],'where':{'CmContactId':_0x225e1b,'ItemClass':_0xd3d9('0xcd')},'include':[{'model':db[_0xd3d9('0xc6')],'attributes':[_0xd3d9('0xc7')],'as':_0xd3d9('0xaf')}],'order':[_0xd3d9('0xc7'),db[_0xd3d9('0x74')]['literal'](_0xd3d9('0xce'))]})[_0xd3d9('0x16')](function(_0x268644){var _0xae7e28=0x1;var _0x4d52dc=_[_0xd3d9('0x4a')](_0x268644,function(_0x3aca46){_0x3aca46[_0xd3d9('0xcf')]=_0x47e428;_0x3aca46[_0xd3d9('0xbe')]=_0x3aca46['item'];_0x3aca46[_0xd3d9('0xc7')]=_0xae7e28;delete _0x3aca46['ItemType.OrderBy'];_0xae7e28=_0xae7e28+0x1;return _0x3aca46;});return db['CmHopperAdditionalPhone'][_0xd3d9('0xd0')](_0x4d52dc,{});})[_0xd3d9('0x16')](function(){_0x565fe5(0x1);});});}function insertAdditionalPhones(_0xe83d35,_0x5535b1){return new Promise(function(_0x55b754,_0x36808e){var _0x445bef=[];for(var _0x4dc3d5=0x0;_0x4dc3d5<_0x5535b1[_0xd3d9('0x22')];_0x4dc3d5++){var _0x2075b8=_0x5535b1[_0x4dc3d5];_0x445bef[_0xd3d9('0x25')](parseContactItemType(_0x2075b8));}Promise[_0xd3d9('0x28')](_0x445bef)[_0xd3d9('0x16')](function(){var _0x37a031={'id':_0xe83d35['id'],'items':_0x5535b1};return addAdditionalPhones(_0x37a031)[_0xd3d9('0x16')](function(_0x3aa06d){return addCmHopperPhones(_0xe83d35['id']);});})[_0xd3d9('0x16')](function(){_0x55b754(_0xe83d35);});});}function parseContactItemType(_0x24e44b){return new Promise(function(_0x32e6c0,_0x187713){if(_0x24e44b['hasOwnProperty']('ItemTypeId')){_0x32e6c0(_0x24e44b);}else{return db['ContactItemType'][_0xd3d9('0x47')]({'where':{'name':_0x24e44b[_0xd3d9('0xaf')]}})[_0xd3d9('0x16')](function(_0x2fd79b){if(_[_0xd3d9('0x55')](_0x2fd79b))_0x24e44b[_0xd3d9('0xca')]=null;else _0x24e44b[_0xd3d9('0xca')]=_0x2fd79b['id'];_0x32e6c0(_0x24e44b);});}});}exports[_0xd3d9('0xd1')]=function(_0x5c17ed,_0x655239){return db[_0xd3d9('0xac')][_0xd3d9('0xb6')]({'raw':!![],'where':{'CmContactId':_0x5c17ed[_0xd3d9('0xae')]['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0xd3d9('0xc6')],'as':_0xd3d9('0xaf')}],'order':[[_0xd3d9('0xc7')],[db[_0xd3d9('0x74')][_0xd3d9('0xb0')](_0xd3d9('0xce'))]]})[_0xd3d9('0x16')](function(_0x267d8a){return _0x267d8a;})[_0xd3d9('0x16')](respondWithResult(_0x655239,null))[_0xd3d9('0x83')](handleError(_0x655239,null));};exports[_0xd3d9('0xd2')]=function(_0x323a39,_0x478fe4){return db['CmContactHasItem'][_0xd3d9('0xb6')]({'raw':!![],'where':{'CmContactId':_0x323a39['body'][_0xd3d9('0xd3')]}})['then'](function(_0x35f2ed){var _0x440a12=_[_0xd3d9('0x4a')](_0x35f2ed,function(_0x5cffbf){_0x5cffbf['CmContactId']=_0x323a39[_0xd3d9('0x89')][_0xd3d9('0xd4')];return _0x5cffbf;});return db[_0xd3d9('0xac')][_0xd3d9('0xd0')](_0x440a12,{});})[_0xd3d9('0x16')](function(_0x1d27f8){return addCmHopperPhones(_0x323a39['body'][_0xd3d9('0xd4')]);})['then'](function(_0x36ae70){return['ok'];})[_0xd3d9('0x16')](respondWithResult(_0x478fe4,null))[_0xd3d9('0x83')](handleError(_0x478fe4,null));};exports[_0xd3d9('0xd5')]=function(_0x23e192,_0x165bb4){var _0x5322a1=[];_0x5322a1[_0xd3d9('0x25')](createCmHopperPhone(_0x23e192[_0xd3d9('0x89')]['id'],_0x23e192[_0xd3d9('0x89')][_0xd3d9('0xd6')]));Promise['all'](_0x5322a1)[_0xd3d9('0x16')](function(){return[0x1];})[_0xd3d9('0x16')](respondWithResult(_0x165bb4,null));};exports[_0xd3d9('0xd7')]=function(_0x3852db,_0xe3fdd0){var _0x3699c0={'raw':![],'where':{}};var _0x35a9c5={};var _0x361f0f={'count':0x0,'rows':[]};return db[_0xd3d9('0x1f')][_0xd3d9('0xc4')]({'where':{'id':_0x3852db[_0xd3d9('0xae')]['id']}})[_0xd3d9('0x16')](handleEntityNotFound(_0xe3fdd0,null))['then'](function(_0x4978a8){if(_0x4978a8){_0x35a9c5[_0xd3d9('0x2e')]=_[_0xd3d9('0x21')](db[_0xd3d9('0xbf')]['rawAttributes']);_0x35a9c5['query']=_[_0xd3d9('0x21')](_0x3852db[_0xd3d9('0x2b')]);_0x35a9c5['filters']=_[_0xd3d9('0x2d')](_0x35a9c5['model'],_0x35a9c5['query']);_0x3699c0[_0xd3d9('0x30')]=_[_0xd3d9('0x2d')](_0x35a9c5['model'],qs[_0xd3d9('0x2f')](_0x3852db[_0xd3d9('0x2b')]['fields']));_0x3699c0[_0xd3d9('0x30')]=_0x3699c0[_0xd3d9('0x30')][_0xd3d9('0x22')]?_0x3699c0[_0xd3d9('0x30')]:_0x35a9c5[_0xd3d9('0x2e')];if(!_0x3852db[_0xd3d9('0x2b')][_0xd3d9('0x31')](_0xd3d9('0xc2'))){_0x3699c0[_0xd3d9('0x11')]=qs[_0xd3d9('0x11')](_0x3852db[_0xd3d9('0x2b')][_0xd3d9('0x11')]);_0x3699c0[_0xd3d9('0xf')]=qs[_0xd3d9('0xf')](_0x3852db[_0xd3d9('0x2b')]['offset']);}_0x3699c0[_0xd3d9('0x32')]=qs[_0xd3d9('0x33')](_0x3852db[_0xd3d9('0x2b')]['sort']);_0x3699c0[_0xd3d9('0x34')]=qs[_0xd3d9('0x2c')](_[_0xd3d9('0x35')](_0x3852db[_0xd3d9('0x2b')],_0x35a9c5[_0xd3d9('0x2c')]));_0x3699c0[_0xd3d9('0x34')][_0xd3d9('0xd8')]=_0x4978a8['id'];if(_0x3852db[_0xd3d9('0x2b')][_0xd3d9('0x54')]){_0x3699c0[_0xd3d9('0x34')]=_[_0xd3d9('0x77')](_0x3699c0[_0xd3d9('0x34')],{'$or':_[_0xd3d9('0x4a')](_0x3699c0[_0xd3d9('0x30')],function(_0x30a8b7){var _0x288ca2={};_0x288ca2[_0x30a8b7]={'$like':'%'+_0x3852db[_0xd3d9('0x2b')][_0xd3d9('0x54')]+'%'};return _0x288ca2;})});}_0x3699c0=_[_0xd3d9('0x77')]({},_0x3699c0,_0x3852db[_0xd3d9('0xc1')]);return db[_0xd3d9('0xbf')][_0xd3d9('0x12')]({'where':_0x3699c0['where']})['then'](function(_0x34b5eb){_0x361f0f[_0xd3d9('0x12')]=_0x34b5eb;if(_0x3852db[_0xd3d9('0x2b')]['includeAll']){_0x3699c0[_0xd3d9('0xd9')]=[{'all':!![]}];}return db[_0xd3d9('0xbf')]['findAll'](_0x3699c0);})[_0xd3d9('0x16')](function(_0x59a767){_0x361f0f['rows']=_0x59a767;return _0x361f0f;});}})[_0xd3d9('0x16')](respondWithFilteredResult(_0xe3fdd0,_0x3699c0))[_0xd3d9('0x83')](handleError(_0xe3fdd0,null));};exports[_0xd3d9('0xda')]=function(_0x19b0c7,_0x5ec2ca){var _0x1354f2={'raw':!![],'where':{}};var _0x425e3a={};var _0xb5773e={'count':0x0,'rows':[]};return db[_0xd3d9('0x1f')][_0xd3d9('0xc4')]({'where':{'id':_0x19b0c7[_0xd3d9('0xae')]['id']}})['then'](handleEntityNotFound(_0x5ec2ca,null))[_0xd3d9('0x16')](function(_0x25beb7){if(_0x25beb7){_0x425e3a['model']=_[_0xd3d9('0x21')](db[_0xd3d9('0x98')]['rawAttributes']);_0x425e3a[_0xd3d9('0x2b')]=_[_0xd3d9('0x21')](_0x19b0c7['query']);_0x425e3a[_0xd3d9('0x2c')]=_[_0xd3d9('0x2d')](_0x425e3a[_0xd3d9('0x2e')],_0x425e3a[_0xd3d9('0x2b')]);_0x1354f2[_0xd3d9('0x30')]=_[_0xd3d9('0x2d')](_0x425e3a['model'],qs[_0xd3d9('0x2f')](_0x19b0c7[_0xd3d9('0x2b')][_0xd3d9('0x2f')]));_0x1354f2[_0xd3d9('0x30')]=_0x1354f2[_0xd3d9('0x30')][_0xd3d9('0x22')]?_0x1354f2[_0xd3d9('0x30')]:_0x425e3a[_0xd3d9('0x2e')];if(!_0x19b0c7[_0xd3d9('0x2b')][_0xd3d9('0x31')](_0xd3d9('0xc2'))){_0x1354f2[_0xd3d9('0x11')]=qs[_0xd3d9('0x11')](_0x19b0c7['query'][_0xd3d9('0x11')]);_0x1354f2[_0xd3d9('0xf')]=qs[_0xd3d9('0xf')](_0x19b0c7[_0xd3d9('0x2b')][_0xd3d9('0xf')]);}_0x1354f2[_0xd3d9('0x32')]=qs['sort'](_0x19b0c7[_0xd3d9('0x2b')][_0xd3d9('0x33')]);_0x1354f2[_0xd3d9('0x34')]=qs[_0xd3d9('0x2c')](_[_0xd3d9('0x35')](_0x19b0c7['query'],_0x425e3a['filters']));_0x1354f2['where'][_0xd3d9('0xd8')]=_0x25beb7['id'];if(_0x19b0c7['query']['filter']){_0x1354f2[_0xd3d9('0x34')]=_[_0xd3d9('0x77')](_0x1354f2[_0xd3d9('0x34')],{'$or':_['map'](_0x1354f2[_0xd3d9('0x30')],function(_0x32571b){var _0xeaa5ca={};_0xeaa5ca[_0x32571b]={'$like':'%'+_0x19b0c7[_0xd3d9('0x2b')][_0xd3d9('0x54')]+'%'};return _0xeaa5ca;})});}_0x1354f2=_[_0xd3d9('0x77')]({},_0x1354f2,_0x19b0c7['options']);return db[_0xd3d9('0x98')][_0xd3d9('0x12')]({'where':_0x1354f2['where']})[_0xd3d9('0x16')](function(_0x29505d){_0xb5773e[_0xd3d9('0x12')]=_0x29505d;if(_0x19b0c7['query'][_0xd3d9('0xdb')]){_0x1354f2[_0xd3d9('0xd9')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x1354f2);})[_0xd3d9('0x16')](function(_0x4d3888){_0xb5773e['rows']=_0x4d3888;return _0xb5773e;});}})['then'](respondWithFilteredResult(_0x5ec2ca,_0x1354f2))[_0xd3d9('0x83')](handleError(_0x5ec2ca,null));};exports['getHopperFinals']=function(_0xaffea3,_0x3661fc){var _0x246d8d={'raw':!![],'where':{}};var _0x3b55f9={};var _0x2dc702={'count':0x0,'rows':[]};return db[_0xd3d9('0x1f')][_0xd3d9('0xc4')]({'where':{'id':_0xaffea3['params']['id']}})[_0xd3d9('0x16')](handleEntityNotFound(_0x3661fc,null))[_0xd3d9('0x16')](function(_0x175bf6){if(_0x175bf6){_0x3b55f9[_0xd3d9('0x2e')]=_['keys'](db[_0xd3d9('0xdc')][_0xd3d9('0xdd')]);_0x3b55f9[_0xd3d9('0x2b')]=_[_0xd3d9('0x21')](_0xaffea3[_0xd3d9('0x2b')]);_0x3b55f9[_0xd3d9('0x2c')]=_[_0xd3d9('0x2d')](_0x3b55f9[_0xd3d9('0x2e')],_0x3b55f9[_0xd3d9('0x2b')]);_0x246d8d['attributes']=_[_0xd3d9('0x2d')](_0x3b55f9[_0xd3d9('0x2e')],qs[_0xd3d9('0x2f')](_0xaffea3[_0xd3d9('0x2b')][_0xd3d9('0x2f')]));_0x246d8d['attributes']=_0x246d8d[_0xd3d9('0x30')]['length']?_0x246d8d['attributes']:_0x3b55f9['model'];if(!_0xaffea3['query']['hasOwnProperty'](_0xd3d9('0xc2'))){_0x246d8d[_0xd3d9('0x11')]=qs[_0xd3d9('0x11')](_0xaffea3[_0xd3d9('0x2b')][_0xd3d9('0x11')]);_0x246d8d['offset']=qs['offset'](_0xaffea3[_0xd3d9('0x2b')]['offset']);}_0x246d8d[_0xd3d9('0x32')]=qs[_0xd3d9('0x33')](_0xaffea3[_0xd3d9('0x2b')]['sort']);_0x246d8d['where']=qs[_0xd3d9('0x2c')](_[_0xd3d9('0x35')](_0xaffea3[_0xd3d9('0x2b')],_0x3b55f9[_0xd3d9('0x2c')]));_0x246d8d[_0xd3d9('0x34')][_0xd3d9('0xd8')]=_0x175bf6['id'];if(_0xaffea3[_0xd3d9('0x2b')][_0xd3d9('0x54')]){_0x246d8d[_0xd3d9('0x34')]=_[_0xd3d9('0x77')](_0x246d8d[_0xd3d9('0x34')],{'$or':_[_0xd3d9('0x4a')](_0x246d8d['attributes'],function(_0x351688){var _0x228885={};_0x228885[_0x351688]={'$like':'%'+_0xaffea3[_0xd3d9('0x2b')][_0xd3d9('0x54')]+'%'};return _0x228885;})});}_0x246d8d=_[_0xd3d9('0x77')]({},_0x246d8d,_0xaffea3[_0xd3d9('0xc1')]);return db[_0xd3d9('0xdc')]['count']({'where':_0x246d8d[_0xd3d9('0x34')]})[_0xd3d9('0x16')](function(_0x461a8c){_0x2dc702[_0xd3d9('0x12')]=_0x461a8c;if(_0xaffea3[_0xd3d9('0x2b')]['includeAll']){_0x246d8d[_0xd3d9('0xd9')]=[{'all':!![]}];}return db[_0xd3d9('0xdc')][_0xd3d9('0xb6')](_0x246d8d);})[_0xd3d9('0x16')](function(_0x275d3f){_0x2dc702[_0xd3d9('0x82')]=_0x275d3f;return _0x2dc702;});}})[_0xd3d9('0x16')](respondWithFilteredResult(_0x3661fc,_0x246d8d))[_0xd3d9('0x83')](handleError(_0x3661fc,null));};exports['getJscriptySessions']=function(_0x271bf3,_0x2c0a71){var _0x19979a={'raw':!![],'where':{}};var _0x18fb67={};var _0x1a65a8={'count':0x0,'rows':[]};return db[_0xd3d9('0x1f')][_0xd3d9('0xc4')]({'where':{'id':_0x271bf3[_0xd3d9('0xae')]['id']}})[_0xd3d9('0x16')](handleEntityNotFound(_0x2c0a71,null))[_0xd3d9('0x16')](function(_0x5e1d95){if(_0x5e1d95){_0x18fb67['model']=_[_0xd3d9('0x21')](db[_0xd3d9('0x9f')]['rawAttributes']);_0x18fb67[_0xd3d9('0x2b')]=_['keys'](_0x271bf3[_0xd3d9('0x2b')]);_0x18fb67[_0xd3d9('0x2c')]=_[_0xd3d9('0x2d')](_0x18fb67['model'],_0x18fb67['query']);_0x19979a['attributes']=_[_0xd3d9('0x2d')](_0x18fb67[_0xd3d9('0x2e')],qs[_0xd3d9('0x2f')](_0x271bf3[_0xd3d9('0x2b')][_0xd3d9('0x2f')]));_0x19979a[_0xd3d9('0x30')]=_0x19979a['attributes'][_0xd3d9('0x22')]?_0x19979a['attributes']:_0x18fb67[_0xd3d9('0x2e')];if(!_0x271bf3[_0xd3d9('0x2b')][_0xd3d9('0x31')]('nolimit')){_0x19979a[_0xd3d9('0x11')]=qs['limit'](_0x271bf3[_0xd3d9('0x2b')][_0xd3d9('0x11')]);_0x19979a['offset']=qs[_0xd3d9('0xf')](_0x271bf3[_0xd3d9('0x2b')][_0xd3d9('0xf')]);}_0x19979a[_0xd3d9('0x32')]=qs[_0xd3d9('0x33')](_0x271bf3['query'][_0xd3d9('0x33')]);_0x19979a[_0xd3d9('0x34')]=qs[_0xd3d9('0x2c')](_[_0xd3d9('0x35')](_0x271bf3[_0xd3d9('0x2b')],_0x18fb67[_0xd3d9('0x2c')]));_0x19979a[_0xd3d9('0x34')]['ContactId']=_0x5e1d95['id'];if(_0x271bf3[_0xd3d9('0x2b')][_0xd3d9('0x54')]){_0x19979a[_0xd3d9('0x34')]=_['merge'](_0x19979a[_0xd3d9('0x34')],{'$or':_[_0xd3d9('0x4a')](_0x19979a['attributes'],function(_0x2ef877){var _0x537bc0={};_0x537bc0[_0x2ef877]={'$like':'%'+_0x271bf3[_0xd3d9('0x2b')][_0xd3d9('0x54')]+'%'};return _0x537bc0;})});}_0x19979a=_[_0xd3d9('0x77')]({},_0x19979a,_0x271bf3['options']);return db[_0xd3d9('0x9f')]['count']({'where':_0x19979a[_0xd3d9('0x34')]})[_0xd3d9('0x16')](function(_0xfec9c1){_0x1a65a8[_0xd3d9('0x12')]=_0xfec9c1;if(_0x271bf3[_0xd3d9('0x2b')]['includeAll']){_0x19979a[_0xd3d9('0xd9')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xd3d9('0xb6')](_0x19979a);})[_0xd3d9('0x16')](function(_0x170167){_0x1a65a8[_0xd3d9('0x82')]=_0x170167;return _0x1a65a8;});}})[_0xd3d9('0x16')](respondWithFilteredResult(_0x2c0a71,_0x19979a))['catch'](handleError(_0x2c0a71,null));};exports[_0xd3d9('0xde')]=function(_0x3e6d0f,_0x4e846b){try{if(!_0x3e6d0f['body'][_0xd3d9('0x57')]){throw new Error(_0xd3d9('0xdf'));}if(!_0x3e6d0f[_0xd3d9('0x89')]['binding_keys']){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x3e6d0f[_0xd3d9('0x89')][_0xd3d9('0xe0')]){throw new Error(_0xd3d9('0xe1'));}if(!_0x3e6d0f[_0xd3d9('0x89')][_0xd3d9('0xe2')]){throw new Error(_0xd3d9('0xe3'));}var _0x13d5c8=_0x3e6d0f[_0xd3d9('0x89')]['binding_keys'][_0xd3d9('0x49')](',');var _0x5857d4=_0x3e6d0f['body'][_0xd3d9('0xe0')][_0xd3d9('0x49')](',');if(!_0x13d5c8['length']||!_0x5857d4[_0xd3d9('0x22')]||_0x13d5c8[_0xd3d9('0x22')]!==_0x5857d4[_0xd3d9('0x22')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x3e6d0f['body'][_0xd3d9('0x2f')]=_[_0xd3d9('0xe4')](_0x13d5c8,_0x5857d4);if(!_0x3e6d0f[_0xd3d9('0x89')]['fields'][_0xd3d9('0xbe')]){throw new Error(_0xd3d9('0xe5'));}if(!_0x3e6d0f['body'][_0xd3d9('0x2f')][_0xd3d9('0xe6')]){throw new Error(_0xd3d9('0xe7'));}var _0x3f054e=path[_0xd3d9('0xa1')](config['root'],_0xd3d9('0xe8'),_0x3e6d0f[_0xd3d9('0xe9')][_0xd3d9('0xea')]);fs['chmodSync'](_0x3f054e,parseInt(_0xd3d9('0xeb'),0x8));var _0x2d2160=require(_0xd3d9('0xec'))[_0xd3d9('0xed')](path[_0xd3d9('0xa1')](__dirname,_0xd3d9('0xee')),[_0x3f054e,_0x3e6d0f['body'][_0xd3d9('0xef')],_0x3e6d0f[_0xd3d9('0x89')][_0xd3d9('0xe0')],_0x3e6d0f[_0xd3d9('0x89')][_0xd3d9('0x57')],_0x3e6d0f[_0xd3d9('0x89')][_0xd3d9('0xf0')],_0x3e6d0f[_0xd3d9('0x89')][_0xd3d9('0xa5')],_0x3e6d0f[_0xd3d9('0x89')]['socket_timestamp']]);return _0x4e846b[_0xd3d9('0xd')](0xc8)[_0xd3d9('0xe')]({'message':_0xd3d9('0xf1'),'pid':_0x2d2160[_0xd3d9('0xf2')]});}catch(_0x11eb52){return _0x4e846b[_0xd3d9('0xd')](0x1f4)[_0xd3d9('0x1d')](_0x11eb52);}};exports[_0xd3d9('0xf3')]=function(_0x92ef7e,_0x3627c3){var _0x4f10e9=fs[_0xd3d9('0xf4')](_0x92ef7e[_0xd3d9('0xe9')][_0xd3d9('0x2')]);Papa[_0xd3d9('0xf5')](_0x4f10e9,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x23e9f6){return _0x3627c3[_0xd3d9('0xd')](0xc8)['json']({'file':_0x92ef7e[_0xd3d9('0xe9')],'fields':_0x23e9f6['meta'][_0xd3d9('0x2f')]});}});};exports[_0xd3d9('0xf6')]=function(_0x1c43a0,_0x445f71){return db[_0xd3d9('0x72')][_0xd3d9('0xb6')]({'raw':!![],'attributes':['id'],'where':{'role':_0xd3d9('0x70')}})[_0xd3d9('0x16')](function(_0x49beff){var _0x3515c9=![];if(!_0x1c43a0[_0xd3d9('0x89')][_0xd3d9('0x57')]){throw new Error(_0xd3d9('0xdf'));}if(!_0x1c43a0[_0xd3d9('0x89')]['binding'][_0xd3d9('0xbe')]){throw new Error(_0xd3d9('0xe5'));}if(!_0x1c43a0[_0xd3d9('0x89')]['binding'][_0xd3d9('0xe6')]){throw new Error(_0xd3d9('0xe7'));}if(!_0x1c43a0[_0xd3d9('0x89')][_0xd3d9('0xe2')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x3e50b7=require('child_process')[_0xd3d9('0xed')](path[_0xd3d9('0xa1')](__dirname,_0xd3d9('0xf7')),[_0x1c43a0[_0xd3d9('0xae')]['id'],JSON[_0xd3d9('0xf8')](_0x1c43a0[_0xd3d9('0x89')]),JSON[_0xd3d9('0xf8')](_0x49beff)]);_0x3e50b7['on'](_0xd3d9('0xf9'),function(){_0x3515c9=!![];return _0x445f71[_0xd3d9('0xd')](0xc8)[_0xd3d9('0xe')]({'message':_0xd3d9('0xfa'),'pid':_0x3e50b7[_0xd3d9('0xf2')]});});_0x3e50b7['on'](_0xd3d9('0xfb'),function(_0x52f991){if(_0x52f991&&!_0x3515c9){return _0x445f71[_0xd3d9('0xd')](0x1f4)[_0xd3d9('0xe')]({'message':_0xd3d9('0xfc'),'pid':_0x3e50b7[_0xd3d9('0xf2')]});}});})[_0xd3d9('0x83')](handleError(_0x445f71,null));};exports[_0xd3d9('0xfd')]=function(_0x3caee3,_0x23b061,_0x41fa01){return db[_0xd3d9('0x72')][_0xd3d9('0xb6')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0xd3d9('0x16')](function(_0x307794){var _0x221060=![];if(!_0x3caee3[_0xd3d9('0x89')]['ListId']){throw new Error(_0xd3d9('0xdf'));}if(!_0x3caee3[_0xd3d9('0x89')][_0xd3d9('0xfe')][_0xd3d9('0xbe')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x3caee3[_0xd3d9('0x89')][_0xd3d9('0xfe')][_0xd3d9('0xe6')]){throw new Error(_0xd3d9('0xe7'));}if(!_0x3caee3[_0xd3d9('0x89')][_0xd3d9('0xe2')]){throw new Error(_0xd3d9('0xe3'));}var _0x39b601=require(_0xd3d9('0xec'))[_0xd3d9('0xed')](path[_0xd3d9('0xa1')](__dirname,_0xd3d9('0xff')),[_0x3caee3[_0xd3d9('0xae')]['id'],JSON[_0xd3d9('0xf8')](_0x3caee3[_0xd3d9('0x89')]),JSON[_0xd3d9('0xf8')](_0x307794)]);_0x39b601['on'](_0xd3d9('0xf9'),function(_0x3c88d7){_0x221060=!![];return _0x23b061[_0xd3d9('0xd')](0xc8)[_0xd3d9('0xe')]({'message':_0xd3d9('0xfa'),'pid':_0x39b601[_0xd3d9('0xf2')]});});_0x39b601['on'](_0xd3d9('0xfb'),function(_0x2b3180){if(_0x2b3180&&!_0x221060){return _0x23b061['status'](0x1f4)[_0xd3d9('0xe')]({'message':'error\x20child\x20process','pid':_0x39b601['pid']});}});})[_0xd3d9('0x83')](handleError(_0x23b061,null));};exports[_0xd3d9('0x100')]=function(_0x309bfe,_0xdbcfdf){var _0x64148=[_0xd3d9('0x101'),_0xd3d9('0x102'),_0xd3d9('0x103'),_0xd3d9('0x104'),'fax',_0xd3d9('0x105'),_0xd3d9('0x106')];var _0x22371d={'offset':0x0,'order':qs[_0xd3d9('0x33')](_0xd3d9('0x107'))},_0x57bb31={'count':0x0,'rows':[]};Promise[_0xd3d9('0x6d')]()[_0xd3d9('0x16')](function(){if(_0x309bfe[_0xd3d9('0x2b')][_0xd3d9('0x108')]){if(!_[_0xd3d9('0x109')](_0x64148,_0x309bfe[_0xd3d9('0x2b')][_0xd3d9('0x108')]['toLowerCase']())){throw new Error(_0xd3d9('0x10a'));}_0x64148=[_0x309bfe[_0xd3d9('0x2b')][_0xd3d9('0x108')][_0xd3d9('0x10b')]()];}if(_0x309bfe[_0xd3d9('0x2b')][_0xd3d9('0x10c')]){try{var _0x52defd=JSON[_0xd3d9('0xf5')](_0x309bfe[_0xd3d9('0x2b')][_0xd3d9('0x10c')]);if(!moment(_0x52defd['from'])[_0xd3d9('0x10d')]()){throw new Error(_0xd3d9('0x10e'));}if(!moment(_0x52defd['to'])['isValid']()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x5761f1){throw new Error(_0xd3d9('0x10f'));}}if(!_0x309bfe[_0xd3d9('0x2b')][_0xd3d9('0x31')](_0xd3d9('0xc2'))){_0x22371d[_0xd3d9('0x11')]=qs[_0xd3d9('0x11')](_0x309bfe['query'][_0xd3d9('0x11')]||0xa);_0x22371d[_0xd3d9('0xf')]=qs['offset'](_0x309bfe[_0xd3d9('0x2b')][_0xd3d9('0xf')]);}var _0x10814f=_0x64148[_0xd3d9('0x4a')](function(_0x2f159c){if(_0x2f159c===_0xd3d9('0x106')){var _0x398ed9={'attributes':['id',_0xd3d9('0x110'),'type',_0xd3d9('0x111'),_0xd3d9('0x112'),_0xd3d9('0x113'),'starttime','endtime',_0xd3d9('0x114'),_0xd3d9('0x115'),'createdAt',_0xd3d9('0x116'),_0xd3d9('0x117'),_0xd3d9('0x118'),_0xd3d9('0x119')],'where':{'ContactId':_0x309bfe['params']['id']},'include':[{'model':db[_0xd3d9('0x72')],'as':'User','attributes':['id',_0xd3d9('0x1c'),_0xd3d9('0x11a'),'alias']}],'order':[[_0xd3d9('0x11b'),_0xd3d9('0x11c')]]};if(_0x309bfe[_0xd3d9('0x2b')][_0xd3d9('0x10c')]){_0x398ed9[_0xd3d9('0x34')]['createdAt']={'$gte':_0x52defd['from'],'$lte':_0x52defd['to']};}return db[_0xd3d9('0x99')]['findAndCountAll'](_0x398ed9)[_0xd3d9('0x16')](function(_0x3450a0){_0x57bb31[_0xd3d9('0x12')]+=_0x3450a0[_0xd3d9('0x12')];return _[_0xd3d9('0x4a')](_0x3450a0[_0xd3d9('0x82')],function(_0x191ffd){var _0x43d7a3=_0x191ffd['get']({'plain':!![]});_0x43d7a3[_0xd3d9('0x108')]=_0x2f159c;if(_0x43d7a3[_0xd3d9('0x72')]){_0x43d7a3[_0xd3d9('0x72')]={'id':_0x43d7a3['User']['id'],'name':_0x43d7a3[_0xd3d9('0x72')][_0xd3d9('0x1c')],'fullname':_0x43d7a3[_0xd3d9('0x72')][_0xd3d9('0x11a')],'alias':_0x43d7a3[_0xd3d9('0x72')][_0xd3d9('0x11d')]};}return _0x43d7a3;});});}else{var _0x23817b=_[_0xd3d9('0x11e')](_0x2f159c)+(_0x2f159c===_0xd3d9('0x102')?_0xd3d9('0x11f'):_0xd3d9('0x120'));var _0x5a4317={'attributes':['id',_0xd3d9('0x121'),_0xd3d9('0x122'),_0xd3d9('0x11b'),_0xd3d9('0x115'),_0xd3d9('0x123'),'secondDisposition',_0xd3d9('0x124'),_0xd3d9('0x119'),_0x23817b+'Id'],'where':{'ContactId':_0x309bfe['params']['id']},'include':[{'model':db[_0x23817b],'as':'Account','attributes':['id','name','key']},{'model':db[_0xd3d9('0x72')],'as':_0xd3d9('0x125'),'attributes':['id','name','fullname']},{'model':db[_0xd3d9('0xab')],'as':'Tags','attributes':['id',_0xd3d9('0x1c'),'color'],'through':{'attributes':[]}}],'order':[[_0xd3d9('0x11b'),'DESC']]};if(_0x309bfe['query'][_0xd3d9('0x10c')]){_0x5a4317['where'][_0xd3d9('0x11b')]={'$gte':_0x52defd[_0xd3d9('0x3a')],'$lte':_0x52defd['to']};}switch(_0x2f159c){case'chat':_0x5a4317[_0xd3d9('0x30')]['push'](_0xd3d9('0x126'),'customerIp','customerPort',_0xd3d9('0x127'),_0xd3d9('0x128'),_0xd3d9('0x129'),_0xd3d9('0x12a'),_0xd3d9('0x12b'),_0xd3d9('0x12c'));break;case _0xd3d9('0x101'):_0x5a4317[_0xd3d9('0x30')]['push'](_0xd3d9('0x12d'),_0xd3d9('0x12e'));break;case _0xd3d9('0x104'):_0x5a4317[_0xd3d9('0x30')][_0xd3d9('0x25')](_0xd3d9('0x12f'),_0xd3d9('0x130'));break;}return db[_[_0xd3d9('0x11e')](_0x2f159c)+_0xd3d9('0x131')][_0xd3d9('0x132')](_0x5a4317)[_0xd3d9('0x16')](function(_0x7d42b0){_0x57bb31[_0xd3d9('0x12')]+=_0x7d42b0[_0xd3d9('0x12')];return _['map'](_0x7d42b0[_0xd3d9('0x82')],function(_0x3ed900){var _0xa1e8af=_0x3ed900[_0xd3d9('0x8a')]({'plain':!![]});_0xa1e8af[_0xd3d9('0x108')]=_0x2f159c;if(_0xa1e8af[_0xd3d9('0x125')]){_0xa1e8af[_0xd3d9('0x125')]={'id':_0xa1e8af[_0xd3d9('0x125')]['id'],'name':_0xa1e8af[_0xd3d9('0x125')][_0xd3d9('0x1c')],'fullname':_0xa1e8af['Owner'][_0xd3d9('0x11a')]};}return _0xa1e8af;});});}});return Promise['all'](_0x10814f);})['then'](function(_0x48dbc8){return _(_0x48dbc8)[_0xd3d9('0x133')]()['sortBy'](_0xd3d9('0x11b'))[_0xd3d9('0x134')]()[_0xd3d9('0x48')]();})[_0xd3d9('0x16')](function(_0x323834){_0x57bb31[_0xd3d9('0x82')]=_0x22371d['limit']?_0x323834[_0xd3d9('0x135')](_0x22371d[_0xd3d9('0xf')],_0x22371d[_0xd3d9('0xf')]+_0x22371d[_0xd3d9('0x11')]):_0x323834;return _0x57bb31;})[_0xd3d9('0x16')](respondWithFilteredResult(_0xdbcfdf,_0x22371d))[_0xd3d9('0x83')](handleError(_0xdbcfdf,null));};
\ No newline at end of file
+var _0x3a09=['fieldType','type','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','tools_tags','cm_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','expr','search','parseSearch','sqlOperator','conditions','find','split','map','forEach','union','User','and','uc.UserId\x20=\x20?','value','dateOfBirth','datetime','castTo','buildExpression','text','start','end','isNil','Contact','isEmpty','ListId','\x20=\x20?','tag','filter','replace','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','group','Sequelize','QueryTypes','c.id','having','t.id\x20IN\x20?','resolve','role','agent','some','user','getLists','c.ListId\x20IN\x20?','sequelize','toString','keyBy','merge','CmContact','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','displayName','CmCustomField','findAll','columnName','custom','values','body','get','mergeWith','isArray','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','OpenchannelMessage','CmHopperFinal','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','join','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','findOrCreate','spread','contact','show','Phones','ItemType','literal','$and','format','cf_%d','omit','pickBy','table','toParam','phone','CmHopper','getTags','model','Tag','rawAttributes','pick','options','setTags','ids','setAdditionalPhones','CmContactHasItem','ContactItemType','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','CmContactId','toContactId','getHoppers','ContactId','includeAll','include','CmHopperHistory','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','pid','file','parse','meta','No\x20phone\x20column\x20specified','binding','../../components/import/cm/csv2','stringify','message','error\x20child\x20process','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','exit','getJourney','mail','sms','openchannel','whatsapp','-createdAt','channel','includes','toLowerCase','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20createdAt\x20filter','voice','uniqueid','source','destination','callerid','starttime','duration','createdAt','userDisposition','userThirdDisposition','fullname','alias','range','VoiceCallReport','findAndCountAll','startCase','chat','Website','closed','closedAt','note','disposition','secondDisposition','thirdDisposition','UserId','Account','key','Owner','customerIp','customerPort','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','threadId','Interaction','flatten','sortBy','reverse','slice','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','register','json','undefined','limit','count','offset','status','set','Content-Range','update','then','destroy','error','stack','name','send','index','describe','keys','length','startsWith','push','findOne','cf_','all'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x3a09,0x10f));var _0x93a0=function(_0x192ffa,_0x4e33e4){_0x192ffa=_0x192ffa-0x0;var _0x41ac1f=_0x3a09[_0x192ffa];return _0x41ac1f;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0x93a0('0x0'));var fs=require('fs');var _=require(_0x93a0('0x1'));var squel=require(_0x93a0('0x2'));var Papa=require(_0x93a0('0x3'));var Redis=require(_0x93a0('0x4'));var qs=require(_0x93a0('0x5'));var as=require(_0x93a0('0x6'));var logger=require(_0x93a0('0x7'))(_0x93a0('0x8'));var config=require(_0x93a0('0x9'));var shared=require(_0x93a0('0xa'));var db=require('../../mysqldb')['db'];config[_0x93a0('0xb')]=_[_0x93a0('0xc')](config['redis'],{'host':_0x93a0('0xd'),'port':0x18eb});var socket=require(_0x93a0('0xe'))(new Redis(config['redis']));require('./cmContact.socket')[_0x93a0('0xf')](socket);function respondWithResult(_0x4dfe5a,_0x4c0049){_0x4c0049=_0x4c0049||0xc8;return function(_0x3d2d5b){if(_0x3d2d5b){return _0x4dfe5a['status'](_0x4c0049)[_0x93a0('0x10')](_0x3d2d5b);}};}function respondWithFilteredResult(_0x490d27,_0x378509){return function(_0x5509d3){if(_0x5509d3){var _0x453e6d=typeof _0x378509['offset']===_0x93a0('0x11')&&typeof _0x378509[_0x93a0('0x12')]===_0x93a0('0x11');var _0xe4cbf2=_0x5509d3[_0x93a0('0x13')];var _0x4a52a9=_0x453e6d?0x0:_0x378509[_0x93a0('0x14')];var _0x30a327=_0x453e6d?_0x5509d3[_0x93a0('0x13')]:_0x378509['offset']+_0x378509[_0x93a0('0x12')];var _0x470156;if(_0x30a327>=_0xe4cbf2){_0x30a327=_0xe4cbf2;_0x470156=0xc8;}else{_0x470156=0xce;}_0x490d27[_0x93a0('0x15')](_0x470156);return _0x490d27[_0x93a0('0x16')](_0x93a0('0x17'),_0x4a52a9+'-'+_0x30a327+'/'+_0xe4cbf2)[_0x93a0('0x10')](_0x5509d3);}return null;};}function saveUpdates(_0x252487){return function(_0x96a320){if(_0x96a320){return _0x96a320[_0x93a0('0x18')](_0x252487)[_0x93a0('0x19')](function(_0x365a6e){return _0x365a6e;});}return null;};}function removeEntity(_0x2a99e1){return function(_0x5b56f9){if(_0x5b56f9){return _0x5b56f9[_0x93a0('0x1a')]()[_0x93a0('0x19')](function(){_0x2a99e1[_0x93a0('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1501e9){return function(_0x3e9378){if(!_0x3e9378){_0x1501e9['sendStatus'](0x194);}return _0x3e9378;};}function handleError(_0x385575,_0x16ecc6){_0x16ecc6=_0x16ecc6||0x1f4;return function(_0x5a13fc){logger[_0x93a0('0x1b')](_0x5a13fc[_0x93a0('0x1c')]);if(_0x5a13fc[_0x93a0('0x1d')]){delete _0x5a13fc[_0x93a0('0x1d')];}_0x385575['status'](_0x16ecc6)[_0x93a0('0x1e')](_0x5a13fc);};}exports[_0x93a0('0x1f')]=function(_0x4e560f,_0x2ff28c){var _0x5a0c58={},_0x128e72={},_0x4a3442={'count':0x0,'rows':[]};return db['CmContact'][_0x93a0('0x20')]()[_0x93a0('0x19')](function(_0x31d629){var _0x3f8811=[];for(var _0x516d36=0x0;_0x516d36<Object[_0x93a0('0x21')](_0x31d629)[_0x93a0('0x22')];_0x516d36++){var _0x532ff1=Object[_0x93a0('0x21')](_0x31d629)[_0x516d36];if(_[_0x93a0('0x23')](_0x532ff1,'cf_')){_0x3f8811[_0x93a0('0x24')](db['CmCustomField'][_0x93a0('0x25')]({'where':{'id':_['trimStart'](_0x532ff1,_0x93a0('0x26'))},'raw':!![]}));}}return BPromise[_0x93a0('0x27')](_0x3f8811)[_0x93a0('0x19')](function(_0x18cd43){for(var _0x6b8136=0x0;_0x6b8136<_0x18cd43[_0x93a0('0x22')];_0x6b8136++){if(_0x18cd43[_0x6b8136]){var _0x1d1194='cf_'+_0x18cd43[_0x6b8136]['id'];var _0x5a6831=_0x31d629[_0x1d1194];_0x5a6831[_0x93a0('0x28')]=_0x18cd43[_0x6b8136][_0x93a0('0x29')];}}return _0x31d629;});})[_0x93a0('0x19')](function(_0xd793a7){_0x128e72['model']=_[_0x93a0('0x21')](_0xd793a7);_0x128e72[_0x93a0('0x2a')]=_[_0x93a0('0x21')](_0x4e560f['query']);_0x128e72[_0x93a0('0x2b')]=_[_0x93a0('0x2c')](_0x128e72['model'],_0x128e72[_0x93a0('0x2a')]);_0x5a0c58['attributes']=_[_0x93a0('0x2c')](_0x128e72['model'],qs[_0x93a0('0x2d')](_0x4e560f['query'][_0x93a0('0x2d')]));_0x5a0c58[_0x93a0('0x2e')]=_0x5a0c58['attributes'][_0x93a0('0x22')]?_0x5a0c58[_0x93a0('0x2e')]:_0x128e72['model'];if(!_0x4e560f[_0x93a0('0x2a')][_0x93a0('0x2f')](_0x93a0('0x30'))){_0x5a0c58['limit']=qs[_0x93a0('0x12')](_0x4e560f[_0x93a0('0x2a')][_0x93a0('0x12')]);_0x5a0c58[_0x93a0('0x14')]=qs[_0x93a0('0x14')](_0x4e560f['query'][_0x93a0('0x14')]);}_0x5a0c58[_0x93a0('0x31')]=qs[_0x93a0('0x32')](_0x4e560f[_0x93a0('0x2a')][_0x93a0('0x32')]);_0x5a0c58[_0x93a0('0x33')]=qs[_0x93a0('0x2b')](_['pick'](_0x4e560f['query'],_0x128e72[_0x93a0('0x2b')]),_0xd793a7);var _0x3ff6f1=[];var _0x4a5580=squel[_0x93a0('0x34')]()[_0x93a0('0x35')]('id')['field'](_0x93a0('0x1d'))[_0x93a0('0x35')](_0x93a0('0x36'))[_0x93a0('0x37')](_0x93a0('0x38'));var _0x5791ab=squel[_0x93a0('0x34')]()[_0x93a0('0x37')](_0x93a0('0x39'),'c')['left_join']('cm_user_has_contacts','uc',_0x93a0('0x3a'))[_0x93a0('0x3b')](_0x93a0('0x3c'),'ct',_0x93a0('0x3d'))[_0x93a0('0x3b')](_0x93a0('0x38'),'t',_0x93a0('0x3e'))[_0x93a0('0x33')]('c.deletedAt\x20IS\x20NULL');var _0x5cd7e8=squel[_0x93a0('0x3f')]();var _0x598cd4=[];var _0x589d76=squel['expr']();var _0x2478c6;if(_0x4e560f[_0x93a0('0x2a')][_0x93a0('0x40')]){_0x2478c6=as[_0x93a0('0x41')](_0x4e560f[_0x93a0('0x2a')]['search']);var _0x3481a1=_0x2478c6[_0x93a0('0x42')];for(var _0x2d9e13=0x0;_0x2d9e13<_0x2478c6[_0x93a0('0x43')][_0x93a0('0x22')];_0x2d9e13++){var _0x1b820a=_0x2478c6[_0x93a0('0x43')][_0x2d9e13];var _0x5aeb9c='c';var _0x2d36b5=_(_0xd793a7)[_0x93a0('0x21')]()[_0x93a0('0x44')](function(_0x588530){return _0x588530===_0x1b820a[_0x93a0('0x35')];});if(_0x2d36b5)_0x2d36b5=_0xd793a7[_0x1b820a['field']];if(!_0x2d36b5){if(_0x1b820a[_0x93a0('0x35')]==='Tag'){var _0xcd58c4=_0x1b820a['value'][_0x93a0('0x45')](',')[_0x93a0('0x46')](function(_0x5b541e){return Number(_0x5b541e);});_0xcd58c4[_0x93a0('0x47')](function(_0x2046d9){_0x589d76['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2046d9+',%');});_0x598cd4=_[_0x93a0('0x48')](_0x598cd4,_0xcd58c4);}else if(_0x1b820a['field']===_0x93a0('0x49')){_0x5cd7e8[_0x93a0('0x4a')](_0x93a0('0x4b'),_0x1b820a[_0x93a0('0x4c')]);}}else{if(_0x1b820a['field']===_0x93a0('0x4d')||_0x2d36b5['fieldType']===_0x93a0('0x4e'))_0x1b820a[_0x93a0('0x4f')]='DATE';var _0x431291=as[_0x93a0('0x50')](_0x5aeb9c,_0x2d36b5[_0x93a0('0x29')],_0x1b820a);_0x5cd7e8[_0x3481a1](_0x431291[_0x93a0('0x51')],_0x431291['value'][_0x93a0('0x52')],_0x431291['value'][_0x93a0('0x53')]);}}}else{var _0x19302a=_(Object[_0x93a0('0x21')](_0x4e560f[_0x93a0('0x2a')]))[_0x93a0('0x46')](function(_0x125ac0){return _0xd793a7[_0x93a0('0x2f')](_0x125ac0)?_0x125ac0:undefined;})['filter'](function(_0x337af2){return!_[_0x93a0('0x54')](_0x337af2);})[_0x93a0('0x4c')]();if(_0x4e560f[_0x93a0('0x2a')][_0x93a0('0x55')])_0x19302a[_0x93a0('0x24')](_0x93a0('0x55'));if(!_[_0x93a0('0x56')](_0x19302a)){_0x19302a[_0x93a0('0x47')](function(_0x457141){if(_0x457141===_0x93a0('0x57')){_0x5791ab[_0x93a0('0x33')]('c.ListId\x20IN\x20?',[]['concat'](_0x4e560f[_0x93a0('0x2a')][_0x457141]));}else if(_0x457141===_0x93a0('0x55')){var _0x31afba='%'+_0x4e560f[_0x93a0('0x2a')][_0x457141]+'%';_0x5791ab['where']('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x31afba);}else{_0x5791ab[_0x93a0('0x33')]('c.'+_0x457141+_0x93a0('0x58'),_0x4e560f['query'][_0x457141]);}});}if(_0x4e560f['query'][_0x93a0('0x59')]){_0x598cd4=_['isArray'](_0x4e560f[_0x93a0('0x2a')][_0x93a0('0x59')])?_0x4e560f['query'][_0x93a0('0x59')]:new Array(_0x4e560f[_0x93a0('0x2a')]['tag']);_0x598cd4[_0x93a0('0x47')](function(_0x1743ef){_0x589d76['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1743ef+',%');});}if(_0x4e560f[_0x93a0('0x2a')]['filter']){var _0xa79fed=_0x4e560f['query'][_0x93a0('0x5a')]['replace']('\x5c','\x5c\x5c')[_0x93a0('0x5b')](/'/g,'\x27\x27');if(_0xa79fed['split']('\x20')[_0x93a0('0x22')]>0x1){_0x5cd7e8['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xa79fed),null);}else{if(qs[_0x93a0('0x5c')](_0xa79fed)){_0x5cd7e8['or'](_0x93a0('0x5d'),_0xa79fed+'%');_0x5cd7e8['or'](_0x93a0('0x5e'),_0xa79fed+'%');_0x5cd7e8['or'](_0x93a0('0x5f'),_0xa79fed+'%');_0x5cd7e8['or']('c.fax\x20LIKE\x20?',_0xa79fed+'%');}else if(qs[_0x93a0('0x60')](_0xa79fed)){_0x5cd7e8['or']('c.email\x20LIKE\x20?',_0xa79fed+'%');}else{_0x5cd7e8['or'](_0x93a0('0x61'),'%'+_0xa79fed+'%');_0x5cd7e8['or']('c.lastName\x20LIKE\x20?','%'+_0xa79fed+'%');_0x5cd7e8['or']('c.email\x20LIKE\x20?','%'+_0xa79fed+'%');}}}}_0x5791ab[_0x93a0('0x33')](_0x5cd7e8);_0x5791ab[_0x93a0('0x62')]('c.id');var _0x90da4f={'type':db[_0x93a0('0x63')][_0x93a0('0x64')]['SELECT'],'raw':!![]};var _0x56f890=_0x5791ab['clone']()[_0x93a0('0x35')](_0x93a0('0x65'));if(_0x5a0c58['order']){_0x5a0c58['order'][_0x93a0('0x47')](function(_0x1bef36){_0x5791ab['order']('c.'+_0x1bef36[0x0],_0x1bef36[0x1]==='DESC'?![]:!![]);});}if(!_[_0x93a0('0x56')](_0x598cd4)){_0x5791ab[_0x93a0('0x66')](_0x589d76);_0x56f890[_0x93a0('0x33')](_0x93a0('0x67'),_0x598cd4);}BPromise[_0x93a0('0x68')]()['then'](function(){if(!_0x2478c6)return;if(_0x4e560f['user'][_0x93a0('0x69')]!==_0x93a0('0x6a'))return;if(!_[_0x93a0('0x6b')](_0x2478c6[_0x93a0('0x43')],[_0x93a0('0x35'),'User'])){return _0x4e560f[_0x93a0('0x6c')][_0x93a0('0x6d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3b4f40){if(_[_0x93a0('0x56')](_0x3b4f40)){_0x56f890[_0x93a0('0x33')]('c.ListId\x20IS\x20NULL');_0x5791ab['where']('c.ListId\x20IS\x20NULL');}else{_0x56f890[_0x93a0('0x33')](_0x93a0('0x6e'),_[_0x93a0('0x46')](_0x3b4f40,'id'));_0x5791ab['where'](_0x93a0('0x6e'),_[_0x93a0('0x46')](_0x3b4f40,'id'));}});}})[_0x93a0('0x19')](function(){if(_0x4e560f['user'][_0x93a0('0x69')]===_0x93a0('0x6a')&&!_0x2478c6&&!_0x4e560f[_0x93a0('0x2a')][_0x93a0('0x57')])return[];return db[_0x93a0('0x6f')]['query'](_0x56f890[_0x93a0('0x70')](),_0x90da4f);})[_0x93a0('0x19')](function(_0x1edeea){_0x4a3442[_0x93a0('0x13')]=_0x1edeea[_0x93a0('0x22')];if(_0x4a3442['count']===0x0)return[];return db[_0x93a0('0x6f')][_0x93a0('0x2a')](_0x4a5580[_0x93a0('0x70')](),_0x90da4f)[_0x93a0('0x19')](function(_0x1b9a2f){_0x3ff6f1=_[_0x93a0('0x71')](_0x1b9a2f,'id');_0x90da4f=_[_0x93a0('0x72')](_0x90da4f,{'model':db[_0x93a0('0x73')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4e560f[_0x93a0('0x2a')]['fields']){_0x5a0c58[_0x93a0('0x2e')][_0x93a0('0x47')](function(_0x2432da){_0x5791ab[_0x93a0('0x35')]('c.'+_0x2432da);});}else{_0x5791ab['field'](_0x93a0('0x65'));_0x5791ab[_0x93a0('0x35')]('c.firstName');_0x5791ab['field'](_0x93a0('0x74'));_0x5791ab[_0x93a0('0x35')](_0x93a0('0x75'));_0x5791ab['field'](_0x93a0('0x76'));_0x5791ab['field'](_0x93a0('0x77'));_0x5791ab[_0x93a0('0x35')](_0x93a0('0x78'));_0x5791ab[_0x93a0('0x35')](_0x93a0('0x79'));_0x5791ab['field'](_0x93a0('0x7a'));_0x5791ab[_0x93a0('0x35')](_0x93a0('0x7b'));_0x5791ab[_0x93a0('0x35')](_0x93a0('0x7c'));_0x5791ab[_0x93a0('0x35')](_0x93a0('0x7d'),_0x93a0('0x7e'));}if(_0x5a0c58[_0x93a0('0x12')])_0x5791ab[_0x93a0('0x12')](_0x5a0c58[_0x93a0('0x12')]);if(_0x5a0c58[_0x93a0('0x14')])_0x5791ab[_0x93a0('0x14')](_0x5a0c58[_0x93a0('0x14')]);return db[_0x93a0('0x6f')][_0x93a0('0x2a')](_0x5791ab[_0x93a0('0x70')](),_0x90da4f);});})[_0x93a0('0x19')](function(_0x499376){_0x499376[_0x93a0('0x47')](function(_0xcbafd6){if(_0xcbafd6[_0x93a0('0x7e')]){_0xcbafd6['Tags']=[];_0xcbafd6[_0x93a0('0x7e')][_0x93a0('0x45')](',')[_0x93a0('0x47')](function(_0x39f085){_0xcbafd6[_0x93a0('0x7f')][_0x93a0('0x24')](_0x3ff6f1[_0x39f085]);});}delete _0xcbafd6[_0x93a0('0x7e')];});_0x4a3442[_0x93a0('0x80')]=_0x499376;return _0x4a3442;})[_0x93a0('0x19')](respondWithFilteredResult(_0x2ff28c,_0x5a0c58));})[_0x93a0('0x81')](handleError(_0x2ff28c,null));};exports[_0x93a0('0x1a')]=function(_0x333d7d,_0x10c6a6){return db[_0x93a0('0x73')][_0x93a0('0x44')]({'where':{'id':_0x333d7d[_0x93a0('0x82')]['id']}})[_0x93a0('0x19')](handleEntityNotFound(_0x10c6a6,null))[_0x93a0('0x19')](removeEntity(_0x10c6a6,null))[_0x93a0('0x81')](handleError(_0x10c6a6,null));};exports['describe']=function(_0x3fb0a3,_0x3166d6){return db[_0x93a0('0x73')][_0x93a0('0x20')]()[_0x93a0('0x19')](function(_0xbce856){delete _0xbce856[_0x93a0('0x83')];for(var _0x259a2f=0x0;_0x259a2f<Object[_0x93a0('0x21')](_0xbce856)[_0x93a0('0x22')];_0x259a2f++){var _0x1213d7=Object['keys'](_0xbce856)[_0x259a2f];if(!_['startsWith'](_0x1213d7,_0x93a0('0x26'))){_0xbce856[_0x1213d7]['columnName']=_0x1213d7;_0xbce856[_0x1213d7][_0x93a0('0x84')]=_0x1213d7;}}return _0xbce856;})[_0x93a0('0x19')](function(_0x244a79){var _0x28df56={'where':Boolean(_0x3fb0a3[_0x93a0('0x2a')]['analytics'])===!![]?undefined:{'$or':[{'ListId':_0x3fb0a3['query']['id']},{'ListId':null}]},'raw':!![]};return db[_0x93a0('0x85')][_0x93a0('0x86')](_0x28df56)[_0x93a0('0x19')](function(_0x46882f){for(var _0x3dd651=0x0;_0x3dd651<_0x46882f[_0x93a0('0x22')];_0x3dd651++){var _0x499cdd=_0x93a0('0x26')+_0x46882f[_0x3dd651]['id'];_0x244a79[_0x499cdd][_0x93a0('0x87')]=_0x499cdd;_0x244a79[_0x499cdd][_0x93a0('0x84')]=_0x46882f[_0x3dd651]['alias'];_0x244a79[_0x499cdd][_0x93a0('0x88')]={'type':_0x46882f[_0x3dd651][_0x93a0('0x29')],'values':_0x46882f[_0x3dd651][_0x93a0('0x89')]};}Object['keys'](_0x244a79)[_0x93a0('0x47')](function(_0x4ebac1){if(!_0x244a79[_0x4ebac1][_0x93a0('0x2f')]('columnName')){delete _0x244a79[_0x4ebac1];}});return _0x244a79;});})[_0x93a0('0x19')](respondWithResult(_0x3166d6,null))[_0x93a0('0x81')](handleError(_0x3166d6,null));};exports[_0x93a0('0x72')]=function(_0x126463,_0x14f65d){var _0x4cf72e;var _0x5bd3dd;var _0x165bf5;if(_0x126463[_0x93a0('0x8a')]['id']){delete _0x126463[_0x93a0('0x8a')]['id'];}return db[_0x93a0('0x73')][_0x93a0('0x86')]({'where':{'id':[_0x126463[_0x93a0('0x8a')]['to'],_0x126463[_0x93a0('0x8a')][_0x93a0('0x37')]]}})['then'](function(_0x3571af){if(_0x3571af){if(_0x3571af[_0x93a0('0x22')]!==0x2){return null;}_0x3571af[0x0]=_0x3571af[0x0][_0x93a0('0x8b')]({'plain':!![]});_0x3571af[0x1]=_0x3571af[0x1][_0x93a0('0x8b')]({'plain':!![]});delete _0x3571af[0x0]['id'];delete _0x3571af[0x1]['id'];return _[_0x93a0('0x8c')](_0x3571af[0x0],_0x3571af[0x1],function(_0x47595a,_0x28c1f7){if(Array[_0x93a0('0x8d')](_0x28c1f7)&&!_0x28c1f7[_0x93a0('0x22')]){return _0x47595a;}else if(!_0x28c1f7){return _0x47595a;}});}})[_0x93a0('0x19')](handleEntityNotFound(_0x14f65d,null))[_0x93a0('0x19')](function(_0x42bf20){if(_0x42bf20){if(_0x42bf20[_0x93a0('0x83')]&&_[_0x93a0('0x8d')](_0x42bf20[_0x93a0('0x83')])){_0x42bf20['tags']=_0x42bf20[_0x93a0('0x83')]['join']();}logger[_0x93a0('0x8e')](_0x93a0('0x8f'),_0x126463[_0x93a0('0x8a')]['to'],_0x126463[_0x93a0('0x8a')][_0x93a0('0x37')]);return db['CmHopper'][_0x93a0('0x1a')]({'where':{'ContactId':[_0x126463[_0x93a0('0x8a')]['to'],_0x126463['body'][_0x93a0('0x37')]]}})[_0x93a0('0x19')](function(_0xa39615){logger[_0x93a0('0x8e')](_0x93a0('0x90'),_0xa39615);return db[_0x93a0('0x91')][_0x93a0('0x1a')]({'where':{'ContactId':[_0x126463[_0x93a0('0x8a')]['to'],_0x126463[_0x93a0('0x8a')][_0x93a0('0x37')]]}})[_0x93a0('0x19')](function(_0x5b547f){logger[_0x93a0('0x8e')](_0x93a0('0x92'),_0x5b547f);return db[_0x93a0('0x73')][_0x93a0('0x93')](_0x42bf20);});});}})['then'](function(_0x2a8d97){if(_0x2a8d97){_0x4cf72e=_0x2a8d97;_0x5bd3dd={'ContactId':_0x4cf72e['id']};_0x165bf5={'where':{'ContactId':[_0x126463[_0x93a0('0x8a')]['to'],_0x126463[_0x93a0('0x8a')][_0x93a0('0x37')]]}};return db[_0x93a0('0x94')]['update'](_0x5bd3dd,_0x165bf5);}})[_0x93a0('0x19')](function(){if(_0x4cf72e){return db[_0x93a0('0x95')][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})['then'](function(){if(_0x4cf72e){return db[_0x93a0('0x96')][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})[_0x93a0('0x19')](function(){if(_0x4cf72e){return db[_0x93a0('0x97')][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})['then'](function(){if(_0x4cf72e){return db[_0x93a0('0x98')][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})[_0x93a0('0x19')](function(){if(_0x4cf72e){return db[_0x93a0('0x97')][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})['then'](function(){if(_0x4cf72e){return db[_0x93a0('0x98')][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})['then'](function(){if(_0x4cf72e){return db['SmsInteraction'][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})['then'](function(){if(_0x4cf72e){return db[_0x93a0('0x99')][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})[_0x93a0('0x19')](function(){if(_0x4cf72e){return db[_0x93a0('0x9a')][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})[_0x93a0('0x19')](function(){if(_0x4cf72e){return db['FaxMessage']['update'](_0x5bd3dd,_0x165bf5);}})['then'](function(){if(_0x4cf72e){return db['OpenchannelInteraction'][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})[_0x93a0('0x19')](function(){if(_0x4cf72e){return db[_0x93a0('0x9b')][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})['then'](function(){if(_0x4cf72e){return db['CmContactHasItem'][_0x93a0('0x18')]({'CmContactId':_0x4cf72e['id']},{'where':{'CmContactId':[_0x126463[_0x93a0('0x8a')]['to'],_0x126463[_0x93a0('0x8a')]['from']]}});}})['then'](function(){if(_0x4cf72e){return db[_0x93a0('0x9c')]['update'](_0x5bd3dd,_0x165bf5);}})['then'](function(){if(_0x4cf72e){return db['CmHopperHistory'][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})['then'](function(){if(_0x4cf72e){return db['ReportAgentPreview'][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})[_0x93a0('0x19')](function(){if(_0x4cf72e){return db['VoiceCallReport'][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})['then'](function(){if(_0x4cf72e){return db[_0x93a0('0x9d')][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})[_0x93a0('0x19')](function(){if(_0x4cf72e){return db[_0x93a0('0x9e')]['update'](_0x5bd3dd,_0x165bf5);}})['then'](function(){if(_0x4cf72e){return db[_0x93a0('0x9f')][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})[_0x93a0('0x19')](function(){if(_0x4cf72e){return db[_0x93a0('0xa0')][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})[_0x93a0('0x19')](function(){if(_0x4cf72e){return db[_0x93a0('0xa1')][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})['then'](function(){if(_0x4cf72e){return db['JscriptySessionReport'][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})[_0x93a0('0x19')](function(){if(_0x4cf72e){return db[_0x93a0('0xa2')][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})[_0x93a0('0x19')](function(){if(_0x4cf72e){return db[_0x93a0('0xa3')][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})[_0x93a0('0x19')](function(){if(_0x4cf72e){return db[_0x93a0('0xa4')][_0x93a0('0x18')](_0x5bd3dd,_0x165bf5);}})[_0x93a0('0x19')](function(){if(_0x4cf72e){return db['CmContact'][_0x93a0('0x1a')]({'where':{'id':[_0x126463[_0x93a0('0x8a')]['to'],_0x126463[_0x93a0('0x8a')]['from']]}});}})[_0x93a0('0x19')](function(){if(_0x4cf72e){return _0x4cf72e;}})['then'](respondWithResult(_0x14f65d,null))['catch'](handleError(_0x14f65d,null));};exports[_0x93a0('0x93')]=function(_0x24aee6,_0x1cd1c4){return db['CmContact'][_0x93a0('0x20')]()[_0x93a0('0x19')](function(_0xd3c8f0){if(_0x24aee6['body'][_0x93a0('0x83')]&&_[_0x93a0('0x8d')](_0x24aee6[_0x93a0('0x8a')][_0x93a0('0x83')])){if(_0x24aee6[_0x93a0('0x8a')][_0x93a0('0x83')]['length']){_0x24aee6[_0x93a0('0x8a')]['tags']=_0x24aee6[_0x93a0('0x8a')][_0x93a0('0x83')][_0x93a0('0xa5')](';')+';';}else{_0x24aee6['body'][_0x93a0('0x83')]=null;}}else{_0x24aee6[_0x93a0('0x8a')][_0x93a0('0x83')]=null;}if(!_[_0x93a0('0x54')](_0x24aee6[_0x93a0('0x8a')][_0x93a0('0xa6')])){var _0x1231f8=_0x24aee6[_0x93a0('0x8a')][_0x93a0('0xa6')];if(!_[_0x93a0('0x54')](shared[_0x93a0('0xa7')][_0x1231f8]))_0x24aee6[_0x93a0('0x8a')][_0x93a0('0xa8')]=shared[_0x93a0('0xa7')][_0x1231f8][_0x93a0('0xa8')];}return db[_0x93a0('0x73')][_0x93a0('0x93')](_0x24aee6[_0x93a0('0x8a')],{'fields':_[_0x93a0('0x21')](_0xd3c8f0),'raw':!![]});})[_0x93a0('0x19')](function(_0x5b41b1){if(_0x24aee6['body']['additionalPhones']){return insertAdditionalPhones(_0x5b41b1,_0x24aee6[_0x93a0('0x8a')][_0x93a0('0xa9')]);}else{return _0x5b41b1;}})[_0x93a0('0x19')](respondWithResult(_0x1cd1c4,0xc9))['catch'](handleError(_0x1cd1c4,null));};exports[_0x93a0('0xaa')]=function(_0x195696,_0x3e8cb7){var _0x516c03=0x0;var _0x2de5f9=0x0;var _0x452130=0x0;var _0x3cd2bf=[];return db['CmContact']['describe']()[_0x93a0('0x19')](function(_0x2ebc26){return BPromise[_0x93a0('0xab')](_0x195696[_0x93a0('0x8a')],function(_0x3abc9b){var _0x4faec8={'where':{'$or':[]},'defaults':_0x3abc9b,'fields':_['keys'](_0x2ebc26),'raw':!![]};if(_0x3abc9b[_0x93a0('0xac')]){for(var _0x276c01=0x0;_0x276c01<_0x3abc9b[_0x93a0('0xac')][_0x93a0('0x22')];_0x276c01++){var _0x2a1152={};_0x2a1152[_0x3abc9b[_0x93a0('0xac')][_0x276c01]]=_0x3abc9b[_0x3abc9b['duplicates'][_0x276c01]];_0x4faec8[_0x93a0('0x33')][_0x93a0('0xad')]['push'](_0x2a1152);}_0x4faec8['where'][_0x93a0('0x57')]=_0x3abc9b[_0x93a0('0x57')];}return db['CmContact'][_0x93a0('0xae')](_0x4faec8)[_0x93a0('0xaf')](function(_0x5a641e,_0x4541bb){if(_0x4541bb){if(_0x3abc9b['hasOwnProperty']('additionalPhones')){_0x3cd2bf[_0x93a0('0x24')]({'contact':_0x5a641e,'additionalPhones':_0x3abc9b[_0x93a0('0xa9')]});}_0x516c03++;}else{_0x452130++;}})[_0x93a0('0x81')](function(){_0x2de5f9++;});});})[_0x93a0('0x19')](function(_0x4141a3){if(_0x4141a3){if(_0x3cd2bf[_0x93a0('0x22')]>0x0){return new Promise(function(_0x25f042,_0x15592d){var _0x5867ce=[];for(var _0x31bebd=0x0;_0x31bebd<_0x3cd2bf[_0x93a0('0x22')];_0x31bebd++){_0x5867ce[_0x93a0('0x24')](insertAdditionalPhones(_0x3cd2bf[_0x31bebd][_0x93a0('0xb0')],_0x3cd2bf[_0x31bebd][_0x93a0('0xa9')]));}Promise['all'](_0x5867ce)['then'](function(){_0x25f042(0x1);});})[_0x93a0('0x19')](function(){return{'success':_0x516c03,'failure':_0x2de5f9,'duplicates':_0x452130};});}else{return{'success':_0x516c03,'failure':_0x2de5f9,'duplicates':_0x452130};}}})[_0x93a0('0x19')](respondWithResult(_0x3e8cb7,0xc9))[_0x93a0('0x81')](handleError(_0x3e8cb7,null));};exports[_0x93a0('0xb1')]=function(_0x1c29af,_0x58fd10){var _0x49b880;return db[_0x93a0('0x73')][_0x93a0('0x20')]()[_0x93a0('0x19')](function(_0x21d3b3){return db['CmContact']['find']({'where':{'id':_0x1c29af[_0x93a0('0x82')]['id']},'include':[{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x93a0('0x36')],'required':_0x1c29af[_0x93a0('0x2a')][_0x93a0('0x59')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x93a0('0xb2'),'where':{'CmContactId':_0x1c29af['params']['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0x93a0('0xb3')}]}],'order':[db[_0x93a0('0x6f')][_0x93a0('0xb4')]('Phones.OrderBy')],'attributes':_[_0x93a0('0x21')](_0x21d3b3)});})[_0x93a0('0x19')](function(_0x45d747){if(!_[_0x93a0('0x54')](_0x45d747)){_0x49b880=_0x45d747[_0x93a0('0x8b')]({'plain':!![]});var _0x39e78e={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x45d747&&_0x45d747['ListId']){if(_0x45d747['ListId']){_0x39e78e['where'][_0x93a0('0xb5')][_0x93a0('0x24')]({'ListId':{'$ne':_0x45d747['ListId']}});}}return db[_0x93a0('0x85')][_0x93a0('0x86')](_0x39e78e);}})[_0x93a0('0x19')](function(_0x18ccd){if(!_[_0x93a0('0x54')](_0x18ccd)){return _['omit'](_0x49b880,_[_0x93a0('0x46')](_0x18ccd,function(_0x5cb711){return util[_0x93a0('0xb6')](_0x93a0('0xb7'),_0x5cb711['id']);}));}})[_0x93a0('0x19')](handleEntityNotFound(_0x58fd10,null))[_0x93a0('0x19')](respondWithResult(_0x58fd10,null))[_0x93a0('0x81')](handleError(_0x58fd10,null));};exports[_0x93a0('0x18')]=function(_0x2eab91,_0x5db86d){var _0x56875f;if(_0x2eab91[_0x93a0('0x8a')]['id']){delete _0x2eab91[_0x93a0('0x8a')]['id'];}if(!_['isNil'](_0x2eab91[_0x93a0('0x8a')][_0x93a0('0xa6')])){var _0x4865dc=_0x2eab91[_0x93a0('0x8a')]['dialTimezone'];if(!_[_0x93a0('0x54')](shared[_0x93a0('0xa7')][_0x4865dc]))_0x2eab91['body'][_0x93a0('0xa8')]=shared[_0x93a0('0xa7')][_0x4865dc][_0x93a0('0xa8')];}return db['CmContact'][_0x93a0('0x44')]({'where':{'id':_0x2eab91[_0x93a0('0x82')]['id']}})[_0x93a0('0x19')](handleEntityNotFound(_0x5db86d,null))['then'](saveUpdates(_0x2eab91[_0x93a0('0x8a')],null))[_0x93a0('0x19')](function(_0x436e61){_0x56875f=_0x436e61;var _0x69ba0={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x436e61&&_0x436e61[_0x93a0('0x57')]){if(_0x436e61[_0x93a0('0x57')]){_0x69ba0[_0x93a0('0x33')][_0x93a0('0xb5')][_0x93a0('0x24')]({'ListId':{'$ne':_0x436e61[_0x93a0('0x57')]}});}}return db['CmCustomField'][_0x93a0('0x86')](_0x69ba0);})[_0x93a0('0x19')](function(_0x13bc85){if(_0x13bc85){return _[_0x93a0('0xb8')](_[_0x93a0('0xb9')](_0x2eab91[_0x93a0('0x8a')],function(_0x5e648d,_0x58ece5){return _[_0x93a0('0x23')](_0x58ece5,_0x93a0('0x26'));}),_[_0x93a0('0x46')](_0x13bc85,function(_0x357bf8){return util[_0x93a0('0xb6')](_0x93a0('0xb7'),_0x357bf8['id']);}));}})[_0x93a0('0x19')](function(_0x166892){if(_0x166892&&!_[_0x93a0('0x56')](_0x166892)){var _0x976fbf=squel[_0x93a0('0x18')]()[_0x93a0('0xba')]('cm_contacts')['setFields'](_0x166892)[_0x93a0('0x33')]('id\x20=\x20?',_0x2eab91[_0x93a0('0x82')]['id'])[_0x93a0('0xbb')]();return db[_0x93a0('0x6f')][_0x93a0('0x2a')](_0x976fbf[_0x93a0('0x51')],{'replacements':_0x976fbf[_0x93a0('0x89')]});}})[_0x93a0('0x19')](function(){if(_0x2eab91[_0x93a0('0x8a')][_0x93a0('0xbc')]&&_0x56875f){return db[_0x93a0('0xbd')][_0x93a0('0x18')]({'phone':_0x2eab91[_0x93a0('0x8a')][_0x93a0('0xbc')],'OrderBy':0x0},{'where':{'ContactId':_0x56875f['id']}});}})[_0x93a0('0x19')](function(){return _0x56875f;})['then'](respondWithResult(_0x5db86d,null))[_0x93a0('0x81')](handleError(_0x5db86d,null));};exports[_0x93a0('0xbe')]=function(_0x238351,_0x46cec2){var _0x529cc8={};var _0x211a9c={};var _0x1daf44;var _0x51ff71;return db[_0x93a0('0x73')]['findOne']({'where':{'id':_0x238351[_0x93a0('0x82')]['id']}})[_0x93a0('0x19')](handleEntityNotFound(_0x46cec2,null))[_0x93a0('0x19')](function(_0x1a9968){if(_0x1a9968){_0x1daf44=_0x1a9968;_0x211a9c[_0x93a0('0xbf')]=_[_0x93a0('0x21')](db[_0x93a0('0xc0')][_0x93a0('0xc1')]);_0x211a9c['query']=_[_0x93a0('0x21')](_0x238351[_0x93a0('0x2a')]);_0x211a9c[_0x93a0('0x2b')]=_[_0x93a0('0x2c')](_0x211a9c[_0x93a0('0xbf')],_0x211a9c['query']);_0x529cc8['attributes']=_['intersection'](_0x211a9c[_0x93a0('0xbf')],qs['fields'](_0x238351[_0x93a0('0x2a')][_0x93a0('0x2d')]));_0x529cc8[_0x93a0('0x2e')]=_0x529cc8[_0x93a0('0x2e')]['length']?_0x529cc8[_0x93a0('0x2e')]:_0x211a9c[_0x93a0('0xbf')];_0x529cc8['order']=qs[_0x93a0('0x32')](_0x238351[_0x93a0('0x2a')][_0x93a0('0x32')]);_0x529cc8[_0x93a0('0x33')]=qs[_0x93a0('0x2b')](_[_0x93a0('0xc2')](_0x238351[_0x93a0('0x2a')],_0x211a9c[_0x93a0('0x2b')]));if(_0x238351['query'][_0x93a0('0x5a')]){_0x529cc8[_0x93a0('0x33')]=_[_0x93a0('0x72')](_0x529cc8[_0x93a0('0x33')],{'$or':_[_0x93a0('0x46')](_0x529cc8[_0x93a0('0x2e')],function(_0x1a81ad){var _0x2bf150={};_0x2bf150[_0x1a81ad]={'$like':'%'+_0x238351[_0x93a0('0x2a')][_0x93a0('0x5a')]+'%'};return _0x2bf150;})});}_0x529cc8=_[_0x93a0('0x72')]({},_0x529cc8,_0x238351[_0x93a0('0xc3')]);return _0x1daf44[_0x93a0('0xbe')](_0x529cc8);}})[_0x93a0('0x19')](function(_0x1342fa){if(_0x1342fa){_0x51ff71=_0x1342fa[_0x93a0('0x22')];if(!_0x238351[_0x93a0('0x2a')][_0x93a0('0x2f')](_0x93a0('0x30'))){_0x529cc8[_0x93a0('0x12')]=qs[_0x93a0('0x12')](_0x238351[_0x93a0('0x2a')][_0x93a0('0x12')]);_0x529cc8[_0x93a0('0x14')]=qs[_0x93a0('0x14')](_0x238351[_0x93a0('0x2a')][_0x93a0('0x14')]);}return _0x1daf44[_0x93a0('0xbe')](_0x529cc8);}})[_0x93a0('0x19')](function(_0x3f78d8){if(_0x3f78d8){return _0x3f78d8?{'count':_0x51ff71,'rows':_0x3f78d8}:null;}})[_0x93a0('0x19')](respondWithResult(_0x46cec2,null))[_0x93a0('0x81')](handleError(_0x46cec2,null));};exports['setTags']=function(_0x3a3212,_0x45d512){if(_0x3a3212['body']['id']){delete _0x3a3212[_0x93a0('0x8a')]['id'];}return db[_0x93a0('0x73')]['findOne']({'where':{'id':_0x3a3212['params']['id']}})[_0x93a0('0x19')](handleEntityNotFound(_0x45d512,null))[_0x93a0('0x19')](function(_0x119daa){if(_0x119daa){return _0x119daa[_0x93a0('0xc4')](_0x3a3212[_0x93a0('0x8a')][_0x93a0('0xc5')]||[]);}return null;})[_0x93a0('0x19')](respondWithResult(_0x45d512,null))[_0x93a0('0x81')](handleError(_0x45d512,null));};exports[_0x93a0('0xc6')]=function(_0xa9853,_0x490c17){var _0x342ad4=[];_0x342ad4[_0x93a0('0x24')](addAdditionalPhones(_0xa9853['body']));Promise[_0x93a0('0x27')](_0x342ad4)['then'](function(){_0x342ad4=[];_0x342ad4[_0x93a0('0x24')](deleteCmHopperPhones(_0xa9853[_0x93a0('0x8a')]['id']));_0x342ad4[_0x93a0('0x24')](addCmHopperPhones(_0xa9853[_0x93a0('0x8a')]['id']));Promise[_0x93a0('0x27')](_0x342ad4)[_0x93a0('0x19')](function(){return[0x1];})[_0x93a0('0x19')](respondWithResult(_0x490c17,null));});};function addAdditionalPhones(_0x2b67fb){var _0x3da731;return new Promise(function(_0x569fa3,_0x4a3f46){return db[_0x93a0('0xc7')][_0x93a0('0x1a')]({'where':{'CmContactId':_0x2b67fb['id']}})['then'](function(){db[_0x93a0('0xc8')][_0x93a0('0x86')]({'raw':!![],'attributes':['id','OrderBy']})[_0x93a0('0x19')](function(_0x243022){var _0x3f4ca6=[];for(var _0x12b5fc=0x0;_0x12b5fc<_0x2b67fb[_0x93a0('0xc9')][_0x93a0('0x22')];_0x12b5fc++){var _0x30ce60=_0x2b67fb['item_types']?_[_0x93a0('0x54')](_0x2b67fb[_0x93a0('0xca')][_0x12b5fc])?'':_0x2b67fb['item_types'][_0x12b5fc]:_0x2b67fb[_0x93a0('0xc9')][_0x12b5fc][_0x93a0('0xcb')]?_0x2b67fb['items'][_0x12b5fc][_0x93a0('0xcb')]:'';var _0x50d264=_[_0x93a0('0x54')](_0x2b67fb[_0x93a0('0xc9')][_0x12b5fc][_0x93a0('0xcc')])?'':_0x2b67fb[_0x93a0('0xc9')][_0x12b5fc][_0x93a0('0xcc')];var _0x211d6f=_0x30ce60+':'+_0x2b67fb[_0x93a0('0xc9')][_0x12b5fc][_0x93a0('0xbc')]+'§'+_0x50d264;if(_[_0x93a0('0x54')](_0x3da731))_0x3da731=_0x211d6f;else _0x3da731+=';'+_0x211d6f;var _0x282d0a=null;if(_0x2b67fb['item_types']){if(!_['isNil'](_0x2b67fb[_0x93a0('0xca')][_0x12b5fc])){var _0x24f391=_[_0x93a0('0x44')](_0x243022,function(_0x2a72e1){return _0x2a72e1['id']===_0x2b67fb[_0x93a0('0xca')][_0x12b5fc];});if(!_[_0x93a0('0x54')](_0x24f391)){_0x282d0a=_0x24f391['OrderBy'];}}}else{if(!_['isNil'](_0x2b67fb[_0x93a0('0xc9')][_0x12b5fc])){var _0x24f391=_['find'](_0x243022,function(_0x3480db){return _0x3480db['id']===_0x2b67fb[_0x93a0('0xc9')][_0x12b5fc][_0x93a0('0xcb')];});if(!_[_0x93a0('0x54')](_0x24f391)){_0x282d0a=_0x12b5fc;}}}if(_[_0x93a0('0x54')](_0x282d0a)){_0x282d0a=0x64;}_0x3f4ca6['push'](addAdditionalPhone(_0x2b67fb['id'],_0x2b67fb[_0x93a0('0xc9')][_0x12b5fc]['phone'],_0x2b67fb[_0x93a0('0xca')]?_[_0x93a0('0x54')](_0x2b67fb[_0x93a0('0xca')][_0x12b5fc])?null:_0x2b67fb[_0x93a0('0xca')][_0x12b5fc]:_0x2b67fb[_0x93a0('0xc9')][_0x12b5fc]['ItemTypeId']?_0x2b67fb[_0x93a0('0xc9')][_0x12b5fc][_0x93a0('0xcb')]:null,_0x282d0a,_0x50d264));}Promise[_0x93a0('0x27')](_0x3f4ca6)[_0x93a0('0x19')](function(){db[_0x93a0('0x73')][_0x93a0('0x18')]({'AdditionalPhones':_0x3da731},{'where':{'id':_0x2b67fb['id']}})[_0x93a0('0x19')](function(){_0x569fa3(0x1);});});});});});}function addAdditionalPhone(_0x1fbd6d,_0x333ca4,_0x25da6d,_0x47511e,_0x37d6ab){return db[_0x93a0('0xc7')][_0x93a0('0x44')]({'where':{'CmContactId':_0x1fbd6d,'item':_0x333ca4}})[_0x93a0('0x19')](function(_0x925c1a){if(_0x925c1a)logger[_0x93a0('0x8e')](_0x93a0('0xcd'),_0x925c1a);else{db[_0x93a0('0xc7')]['create']({'CmContactId':_0x1fbd6d,'item':_0x333ca4,'ItemTypeId':_0x25da6d,'OrderBy':_0x47511e,'ItemClass':_0x93a0('0xce'),'description':_0x37d6ab});}});}function deletePhones(_0x2ca2a8){return db[_0x93a0('0xc7')]['destroy']({'where':{'CmContactId':_0x2ca2a8}});}function deleteCmHopperPhones(_0x13fce9){return new Promise(function(_0x3f3dc8,_0x3f3071){return db[_0x93a0('0xbd')][_0x93a0('0x86')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x13fce9}})[_0x93a0('0x19')](function(_0x101103){db[_0x93a0('0xcf')][_0x93a0('0x1a')]({'where':{'CmHopperId':{'$in':_[_0x93a0('0x46')](_0x101103,'id')}}});})[_0x93a0('0x19')](function(){_0x3f3dc8(0x1);});});}function addCmHopperPhones(_0x50b91e){return new Promise(function(_0x598d0a,_0x47e92e){return db[_0x93a0('0xbd')][_0x93a0('0x86')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x50b91e}})[_0x93a0('0x19')](function(_0x4259b9){var _0x58aa3e=[];_[_0x93a0('0x46')](_0x4259b9,function(_0x10c73b){_0x58aa3e[_0x93a0('0x24')](createCmHopperPhone(_0x50b91e,_0x10c73b['id']));});Promise[_0x93a0('0x27')](_0x58aa3e)[_0x93a0('0x19')](function(){_0x598d0a(0x1);});});});}function createCmHopperPhone(_0x579eec,_0x81d62d){return new Promise(function(_0x52f7de,_0x3083de){db[_0x93a0('0xc7')][_0x93a0('0x86')]({'raw':!![],'attributes':[_0x93a0('0xd0'),_0x93a0('0xd1')],'where':{'CmContactId':_0x579eec,'ItemClass':'PHONE'},'include':[{'model':db[_0x93a0('0xc8')],'attributes':[_0x93a0('0xd1')],'as':_0x93a0('0xb3')}],'order':['OrderBy',db[_0x93a0('0x6f')][_0x93a0('0xb4')]('`ItemType`.OrderBy')]})[_0x93a0('0x19')](function(_0x22fa8c){var _0x2aa65e=0x1;var _0x4fb45b=_[_0x93a0('0x46')](_0x22fa8c,function(_0xd5436a){_0xd5436a[_0x93a0('0xd2')]=_0x81d62d;_0xd5436a[_0x93a0('0xbc')]=_0xd5436a[_0x93a0('0xd0')];_0xd5436a[_0x93a0('0xd1')]=_0x2aa65e;delete _0xd5436a[_0x93a0('0xd3')];_0x2aa65e=_0x2aa65e+0x1;return _0xd5436a;});return db['CmHopperAdditionalPhone'][_0x93a0('0xaa')](_0x4fb45b,{});})[_0x93a0('0x19')](function(){_0x52f7de(0x1);});});}function insertAdditionalPhones(_0xaa998,_0xebb687){return new Promise(function(_0xbe0044,_0x4a9ebf){var _0x5ccc0f=[];for(var _0x7b00b8=0x0;_0x7b00b8<_0xebb687[_0x93a0('0x22')];_0x7b00b8++){var _0x561923=_0xebb687[_0x7b00b8];_0x5ccc0f[_0x93a0('0x24')](parseContactItemType(_0x561923));}Promise['all'](_0x5ccc0f)[_0x93a0('0x19')](function(){var _0xf37b5e={'id':_0xaa998['id'],'items':_0xebb687};return addAdditionalPhones(_0xf37b5e)[_0x93a0('0x19')](function(_0xf0c2a9){return addCmHopperPhones(_0xaa998['id']);});})['then'](function(){_0xbe0044(_0xaa998);});});}function parseContactItemType(_0xb26282){return new Promise(function(_0x32ad36,_0x13be39){if(_0xb26282[_0x93a0('0x2f')]('ItemTypeId')){_0x32ad36(_0xb26282);}else{return db[_0x93a0('0xc8')][_0x93a0('0x44')]({'where':{'name':_0xb26282[_0x93a0('0xb3')]}})[_0x93a0('0x19')](function(_0x532178){if(_['isNil'](_0x532178))_0xb26282[_0x93a0('0xcb')]=null;else _0xb26282[_0x93a0('0xcb')]=_0x532178['id'];_0x32ad36(_0xb26282);});}});}exports[_0x93a0('0xd4')]=function(_0x1d9b37,_0x3e8eab){return db['CmContactHasItem'][_0x93a0('0x86')]({'raw':!![],'where':{'CmContactId':_0x1d9b37[_0x93a0('0x82')]['id'],'ItemClass':'PHONE'},'include':[{'model':db['ContactItemType'],'as':_0x93a0('0xb3')}],'order':[[_0x93a0('0xd1')],[db[_0x93a0('0x6f')][_0x93a0('0xb4')](_0x93a0('0xd5'))]]})['then'](function(_0x16bffa){return _0x16bffa;})[_0x93a0('0x19')](respondWithResult(_0x3e8eab,null))[_0x93a0('0x81')](handleError(_0x3e8eab,null));};exports[_0x93a0('0xd6')]=function(_0x475683,_0x4ce22b){return db[_0x93a0('0xc7')][_0x93a0('0x86')]({'raw':!![],'where':{'CmContactId':_0x475683[_0x93a0('0x8a')]['fromContactId']}})[_0x93a0('0x19')](function(_0x35bb31){var _0x422357=_[_0x93a0('0x46')](_0x35bb31,function(_0x37a572){_0x37a572[_0x93a0('0xd7')]=_0x475683['body'][_0x93a0('0xd8')];return _0x37a572;});return db[_0x93a0('0xc7')][_0x93a0('0xaa')](_0x422357,{});})[_0x93a0('0x19')](function(_0x2927c0){return addCmHopperPhones(_0x475683[_0x93a0('0x8a')][_0x93a0('0xd8')]);})[_0x93a0('0x19')](function(_0x3687bc){return['ok'];})[_0x93a0('0x19')](respondWithResult(_0x4ce22b,null))[_0x93a0('0x81')](handleError(_0x4ce22b,null));};exports['rescheduleAdditionalPhones']=function(_0x291aa7,_0x44c06b){var _0x3f8da3=[];_0x3f8da3['push'](createCmHopperPhone(_0x291aa7['body']['id'],_0x291aa7[_0x93a0('0x8a')]['hopperId']));Promise['all'](_0x3f8da3)[_0x93a0('0x19')](function(){return[0x1];})[_0x93a0('0x19')](respondWithResult(_0x44c06b,null));};exports[_0x93a0('0xd9')]=function(_0x1d6e31,_0x20aaa9){var _0x4c13f0={'raw':![],'where':{}};var _0x56b3c3={};var _0x43522c={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x1d6e31[_0x93a0('0x82')]['id']}})['then'](handleEntityNotFound(_0x20aaa9,null))[_0x93a0('0x19')](function(_0x327f9a){if(_0x327f9a){_0x56b3c3[_0x93a0('0xbf')]=_['keys'](db[_0x93a0('0xbd')][_0x93a0('0xc1')]);_0x56b3c3[_0x93a0('0x2a')]=_['keys'](_0x1d6e31[_0x93a0('0x2a')]);_0x56b3c3['filters']=_['intersection'](_0x56b3c3[_0x93a0('0xbf')],_0x56b3c3[_0x93a0('0x2a')]);_0x4c13f0['attributes']=_[_0x93a0('0x2c')](_0x56b3c3['model'],qs[_0x93a0('0x2d')](_0x1d6e31[_0x93a0('0x2a')]['fields']));_0x4c13f0['attributes']=_0x4c13f0['attributes'][_0x93a0('0x22')]?_0x4c13f0[_0x93a0('0x2e')]:_0x56b3c3[_0x93a0('0xbf')];if(!_0x1d6e31['query'][_0x93a0('0x2f')](_0x93a0('0x30'))){_0x4c13f0[_0x93a0('0x12')]=qs['limit'](_0x1d6e31[_0x93a0('0x2a')]['limit']);_0x4c13f0[_0x93a0('0x14')]=qs[_0x93a0('0x14')](_0x1d6e31['query']['offset']);}_0x4c13f0[_0x93a0('0x31')]=qs['sort'](_0x1d6e31[_0x93a0('0x2a')][_0x93a0('0x32')]);_0x4c13f0['where']=qs[_0x93a0('0x2b')](_['pick'](_0x1d6e31['query'],_0x56b3c3[_0x93a0('0x2b')]));_0x4c13f0['where'][_0x93a0('0xda')]=_0x327f9a['id'];if(_0x1d6e31[_0x93a0('0x2a')][_0x93a0('0x5a')]){_0x4c13f0[_0x93a0('0x33')]=_[_0x93a0('0x72')](_0x4c13f0[_0x93a0('0x33')],{'$or':_[_0x93a0('0x46')](_0x4c13f0[_0x93a0('0x2e')],function(_0x248e95){var _0x19cc71={};_0x19cc71[_0x248e95]={'$like':'%'+_0x1d6e31[_0x93a0('0x2a')][_0x93a0('0x5a')]+'%'};return _0x19cc71;})});}_0x4c13f0=_['merge']({},_0x4c13f0,_0x1d6e31[_0x93a0('0xc3')]);return db[_0x93a0('0xbd')][_0x93a0('0x13')]({'where':_0x4c13f0[_0x93a0('0x33')]})['then'](function(_0x232cf6){_0x43522c[_0x93a0('0x13')]=_0x232cf6;if(_0x1d6e31[_0x93a0('0x2a')][_0x93a0('0xdb')]){_0x4c13f0[_0x93a0('0xdc')]=[{'all':!![]}];}return db[_0x93a0('0xbd')][_0x93a0('0x86')](_0x4c13f0);})[_0x93a0('0x19')](function(_0x1ffb41){_0x43522c['rows']=_0x1ffb41;return _0x43522c;});}})[_0x93a0('0x19')](respondWithFilteredResult(_0x20aaa9,_0x4c13f0))[_0x93a0('0x81')](handleError(_0x20aaa9,null));};exports['getHopperHistories']=function(_0x1c973a,_0x4ae38a){var _0x38bb5c={'raw':!![],'where':{}};var _0x26fc32={};var _0x20a0f8={'count':0x0,'rows':[]};return db[_0x93a0('0x73')][_0x93a0('0x25')]({'where':{'id':_0x1c973a[_0x93a0('0x82')]['id']}})[_0x93a0('0x19')](handleEntityNotFound(_0x4ae38a,null))[_0x93a0('0x19')](function(_0x2ec5cf){if(_0x2ec5cf){_0x26fc32[_0x93a0('0xbf')]=_['keys'](db[_0x93a0('0xdd')]['rawAttributes']);_0x26fc32[_0x93a0('0x2a')]=_[_0x93a0('0x21')](_0x1c973a['query']);_0x26fc32['filters']=_[_0x93a0('0x2c')](_0x26fc32[_0x93a0('0xbf')],_0x26fc32[_0x93a0('0x2a')]);_0x38bb5c[_0x93a0('0x2e')]=_[_0x93a0('0x2c')](_0x26fc32[_0x93a0('0xbf')],qs[_0x93a0('0x2d')](_0x1c973a['query'][_0x93a0('0x2d')]));_0x38bb5c['attributes']=_0x38bb5c[_0x93a0('0x2e')][_0x93a0('0x22')]?_0x38bb5c[_0x93a0('0x2e')]:_0x26fc32['model'];if(!_0x1c973a[_0x93a0('0x2a')]['hasOwnProperty']('nolimit')){_0x38bb5c[_0x93a0('0x12')]=qs[_0x93a0('0x12')](_0x1c973a['query'][_0x93a0('0x12')]);_0x38bb5c[_0x93a0('0x14')]=qs[_0x93a0('0x14')](_0x1c973a[_0x93a0('0x2a')][_0x93a0('0x14')]);}_0x38bb5c[_0x93a0('0x31')]=qs['sort'](_0x1c973a[_0x93a0('0x2a')][_0x93a0('0x32')]);_0x38bb5c[_0x93a0('0x33')]=qs['filters'](_[_0x93a0('0xc2')](_0x1c973a[_0x93a0('0x2a')],_0x26fc32[_0x93a0('0x2b')]));_0x38bb5c[_0x93a0('0x33')][_0x93a0('0xda')]=_0x2ec5cf['id'];if(_0x1c973a[_0x93a0('0x2a')][_0x93a0('0x5a')]){_0x38bb5c[_0x93a0('0x33')]=_['merge'](_0x38bb5c['where'],{'$or':_[_0x93a0('0x46')](_0x38bb5c['attributes'],function(_0x57b7f5){var _0x5568a3={};_0x5568a3[_0x57b7f5]={'$like':'%'+_0x1c973a[_0x93a0('0x2a')][_0x93a0('0x5a')]+'%'};return _0x5568a3;})});}_0x38bb5c=_[_0x93a0('0x72')]({},_0x38bb5c,_0x1c973a['options']);return db[_0x93a0('0xdd')][_0x93a0('0x13')]({'where':_0x38bb5c[_0x93a0('0x33')]})[_0x93a0('0x19')](function(_0x243e6d){_0x20a0f8['count']=_0x243e6d;if(_0x1c973a[_0x93a0('0x2a')][_0x93a0('0xdb')]){_0x38bb5c[_0x93a0('0xdc')]=[{'all':!![]}];}return db[_0x93a0('0xdd')][_0x93a0('0x86')](_0x38bb5c);})[_0x93a0('0x19')](function(_0x5f1ce8){_0x20a0f8[_0x93a0('0x80')]=_0x5f1ce8;return _0x20a0f8;});}})[_0x93a0('0x19')](respondWithFilteredResult(_0x4ae38a,_0x38bb5c))[_0x93a0('0x81')](handleError(_0x4ae38a,null));};exports['getHopperFinals']=function(_0x1ba5e5,_0x297450){var _0x3d73d7={'raw':!![],'where':{}};var _0x267fe6={};var _0x4c3d1e={'count':0x0,'rows':[]};return db[_0x93a0('0x73')]['findOne']({'where':{'id':_0x1ba5e5['params']['id']}})['then'](handleEntityNotFound(_0x297450,null))[_0x93a0('0x19')](function(_0x35d096){if(_0x35d096){_0x267fe6['model']=_[_0x93a0('0x21')](db[_0x93a0('0x9c')][_0x93a0('0xc1')]);_0x267fe6['query']=_[_0x93a0('0x21')](_0x1ba5e5[_0x93a0('0x2a')]);_0x267fe6[_0x93a0('0x2b')]=_['intersection'](_0x267fe6[_0x93a0('0xbf')],_0x267fe6[_0x93a0('0x2a')]);_0x3d73d7[_0x93a0('0x2e')]=_[_0x93a0('0x2c')](_0x267fe6[_0x93a0('0xbf')],qs['fields'](_0x1ba5e5[_0x93a0('0x2a')][_0x93a0('0x2d')]));_0x3d73d7['attributes']=_0x3d73d7['attributes'][_0x93a0('0x22')]?_0x3d73d7[_0x93a0('0x2e')]:_0x267fe6[_0x93a0('0xbf')];if(!_0x1ba5e5[_0x93a0('0x2a')][_0x93a0('0x2f')](_0x93a0('0x30'))){_0x3d73d7[_0x93a0('0x12')]=qs[_0x93a0('0x12')](_0x1ba5e5[_0x93a0('0x2a')][_0x93a0('0x12')]);_0x3d73d7[_0x93a0('0x14')]=qs['offset'](_0x1ba5e5['query'][_0x93a0('0x14')]);}_0x3d73d7[_0x93a0('0x31')]=qs[_0x93a0('0x32')](_0x1ba5e5[_0x93a0('0x2a')][_0x93a0('0x32')]);_0x3d73d7['where']=qs[_0x93a0('0x2b')](_[_0x93a0('0xc2')](_0x1ba5e5[_0x93a0('0x2a')],_0x267fe6[_0x93a0('0x2b')]));_0x3d73d7[_0x93a0('0x33')][_0x93a0('0xda')]=_0x35d096['id'];if(_0x1ba5e5[_0x93a0('0x2a')][_0x93a0('0x5a')]){_0x3d73d7[_0x93a0('0x33')]=_[_0x93a0('0x72')](_0x3d73d7['where'],{'$or':_[_0x93a0('0x46')](_0x3d73d7[_0x93a0('0x2e')],function(_0x1ae397){var _0x293f5d={};_0x293f5d[_0x1ae397]={'$like':'%'+_0x1ba5e5[_0x93a0('0x2a')][_0x93a0('0x5a')]+'%'};return _0x293f5d;})});}_0x3d73d7=_[_0x93a0('0x72')]({},_0x3d73d7,_0x1ba5e5['options']);return db['CmHopperFinal'][_0x93a0('0x13')]({'where':_0x3d73d7[_0x93a0('0x33')]})[_0x93a0('0x19')](function(_0x237252){_0x4c3d1e['count']=_0x237252;if(_0x1ba5e5[_0x93a0('0x2a')][_0x93a0('0xdb')]){_0x3d73d7[_0x93a0('0xdc')]=[{'all':!![]}];}return db[_0x93a0('0x9c')][_0x93a0('0x86')](_0x3d73d7);})[_0x93a0('0x19')](function(_0x2c17b9){_0x4c3d1e['rows']=_0x2c17b9;return _0x4c3d1e;});}})['then'](respondWithFilteredResult(_0x297450,_0x3d73d7))[_0x93a0('0x81')](handleError(_0x297450,null));};exports[_0x93a0('0xde')]=function(_0x1fdc00,_0x1b24f8){var _0x26b2f9={'raw':!![],'where':{}};var _0x26f05d={};var _0x5d216c={'count':0x0,'rows':[]};return db['CmContact'][_0x93a0('0x25')]({'where':{'id':_0x1fdc00['params']['id']}})[_0x93a0('0x19')](handleEntityNotFound(_0x1b24f8,null))['then'](function(_0x296e77){if(_0x296e77){_0x26f05d[_0x93a0('0xbf')]=_[_0x93a0('0x21')](db[_0x93a0('0xdf')]['rawAttributes']);_0x26f05d['query']=_[_0x93a0('0x21')](_0x1fdc00['query']);_0x26f05d['filters']=_[_0x93a0('0x2c')](_0x26f05d['model'],_0x26f05d['query']);_0x26b2f9[_0x93a0('0x2e')]=_[_0x93a0('0x2c')](_0x26f05d[_0x93a0('0xbf')],qs[_0x93a0('0x2d')](_0x1fdc00[_0x93a0('0x2a')]['fields']));_0x26b2f9[_0x93a0('0x2e')]=_0x26b2f9['attributes'][_0x93a0('0x22')]?_0x26b2f9['attributes']:_0x26f05d[_0x93a0('0xbf')];if(!_0x1fdc00[_0x93a0('0x2a')][_0x93a0('0x2f')](_0x93a0('0x30'))){_0x26b2f9['limit']=qs[_0x93a0('0x12')](_0x1fdc00['query'][_0x93a0('0x12')]);_0x26b2f9[_0x93a0('0x14')]=qs[_0x93a0('0x14')](_0x1fdc00['query']['offset']);}_0x26b2f9[_0x93a0('0x31')]=qs[_0x93a0('0x32')](_0x1fdc00['query'][_0x93a0('0x32')]);_0x26b2f9[_0x93a0('0x33')]=qs['filters'](_[_0x93a0('0xc2')](_0x1fdc00[_0x93a0('0x2a')],_0x26f05d['filters']));_0x26b2f9[_0x93a0('0x33')][_0x93a0('0xda')]=_0x296e77['id'];if(_0x1fdc00['query'][_0x93a0('0x5a')]){_0x26b2f9[_0x93a0('0x33')]=_['merge'](_0x26b2f9[_0x93a0('0x33')],{'$or':_[_0x93a0('0x46')](_0x26b2f9['attributes'],function(_0x3d0201){var _0x150e0d={};_0x150e0d[_0x3d0201]={'$like':'%'+_0x1fdc00[_0x93a0('0x2a')][_0x93a0('0x5a')]+'%'};return _0x150e0d;})});}_0x26b2f9=_[_0x93a0('0x72')]({},_0x26b2f9,_0x1fdc00[_0x93a0('0xc3')]);return db[_0x93a0('0xdf')][_0x93a0('0x13')]({'where':_0x26b2f9['where']})[_0x93a0('0x19')](function(_0x76236d){_0x5d216c[_0x93a0('0x13')]=_0x76236d;if(_0x1fdc00['query'][_0x93a0('0xdb')]){_0x26b2f9[_0x93a0('0xdc')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x26b2f9);})['then'](function(_0x11507b){_0x5d216c[_0x93a0('0x80')]=_0x11507b;return _0x5d216c;});}})[_0x93a0('0x19')](respondWithFilteredResult(_0x1b24f8,_0x26b2f9))[_0x93a0('0x81')](handleError(_0x1b24f8,null));};exports[_0x93a0('0xe0')]=function(_0x286ed8,_0x57082c){try{if(!_0x286ed8[_0x93a0('0x8a')]['ListId']){throw new Error(_0x93a0('0xe1'));}if(!_0x286ed8[_0x93a0('0x8a')][_0x93a0('0xe2')]){throw new Error(_0x93a0('0xe3'));}if(!_0x286ed8[_0x93a0('0x8a')][_0x93a0('0xe4')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x286ed8[_0x93a0('0x8a')]['socket_timestamp']){throw new Error(_0x93a0('0xe5'));}var _0x118318=_0x286ed8[_0x93a0('0x8a')][_0x93a0('0xe2')][_0x93a0('0x45')](',');var _0x5bb178=_0x286ed8[_0x93a0('0x8a')]['binding_values']['split'](',');if(!_0x118318[_0x93a0('0x22')]||!_0x5bb178['length']||_0x118318['length']!==_0x5bb178[_0x93a0('0x22')]){throw new Error(_0x93a0('0xe6'));}_0x286ed8[_0x93a0('0x8a')][_0x93a0('0x2d')]=_['zipObject'](_0x118318,_0x5bb178);if(!_0x286ed8[_0x93a0('0x8a')][_0x93a0('0x2d')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x286ed8[_0x93a0('0x8a')][_0x93a0('0x2d')][_0x93a0('0xe7')]){throw new Error(_0x93a0('0xe8'));}var _0x49ac26=path['join'](config[_0x93a0('0xe9')],_0x93a0('0xea'),_0x286ed8['file'][_0x93a0('0xeb')]);fs[_0x93a0('0xec')](_0x49ac26,parseInt(_0x93a0('0xed'),0x8));var _0x6a524d=require(_0x93a0('0xee'))[_0x93a0('0xef')](path[_0x93a0('0xa5')](__dirname,_0x93a0('0xf0')),[_0x49ac26,_0x286ed8[_0x93a0('0x8a')][_0x93a0('0xe2')],_0x286ed8[_0x93a0('0x8a')][_0x93a0('0xe4')],_0x286ed8[_0x93a0('0x8a')][_0x93a0('0x57')],_0x286ed8[_0x93a0('0x8a')][_0x93a0('0xf1')],_0x286ed8[_0x93a0('0x8a')][_0x93a0('0xac')],_0x286ed8[_0x93a0('0x8a')][_0x93a0('0xf2')]]);return _0x57082c['status'](0xc8)[_0x93a0('0x10')]({'message':'File\x20uploaded\x20correctly!','pid':_0x6a524d[_0x93a0('0xf3')]});}catch(_0x35294d){return _0x57082c[_0x93a0('0x15')](0x1f4)['send'](_0x35294d);}};exports['upload']=function(_0x198507,_0x21b846){var _0x2817cc=fs['createReadStream'](_0x198507[_0x93a0('0xf4')][_0x93a0('0x0')]);Papa[_0x93a0('0xf5')](_0x2817cc,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x2d5307){return _0x21b846[_0x93a0('0x15')](0xc8)[_0x93a0('0x10')]({'file':_0x198507[_0x93a0('0xf4')],'fields':_0x2d5307[_0x93a0('0xf6')]['fields']});}});};exports['import']=function(_0x186d9d,_0x30ae2c){return db[_0x93a0('0x49')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x93a0('0x6a')}})[_0x93a0('0x19')](function(_0x5a4ca9){var _0x1ace54=![];if(!_0x186d9d[_0x93a0('0x8a')][_0x93a0('0x57')]){throw new Error(_0x93a0('0xe1'));}if(!_0x186d9d[_0x93a0('0x8a')]['binding'][_0x93a0('0xbc')]){throw new Error(_0x93a0('0xf7'));}if(!_0x186d9d['body'][_0x93a0('0xf8')]['firstName']){throw new Error(_0x93a0('0xe8'));}if(!_0x186d9d['body'][_0x93a0('0xf2')]){throw new Error(_0x93a0('0xe5'));}var _0x4cd814=require(_0x93a0('0xee'))[_0x93a0('0xef')](path['join'](__dirname,_0x93a0('0xf9')),[_0x186d9d[_0x93a0('0x82')]['id'],JSON[_0x93a0('0xfa')](_0x186d9d[_0x93a0('0x8a')]),JSON[_0x93a0('0xfa')](_0x5a4ca9)]);_0x4cd814['on'](_0x93a0('0xfb'),function(){_0x1ace54=!![];return _0x30ae2c['status'](0xc8)[_0x93a0('0x10')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x4cd814[_0x93a0('0xf3')]});});_0x4cd814['on']('exit',function(_0x53bb92){if(_0x53bb92&&!_0x1ace54){return _0x30ae2c[_0x93a0('0x15')](0x1f4)[_0x93a0('0x10')]({'message':_0x93a0('0xfc'),'pid':_0x4cd814[_0x93a0('0xf3')]});}});})['catch'](handleError(_0x30ae2c,null));};exports['importUpdates']=function(_0x557650,_0x480a3b,_0x43c7fc){return db[_0x93a0('0x49')][_0x93a0('0x86')]({'raw':!![],'attributes':['id'],'where':{'role':_0x93a0('0x6a')}})[_0x93a0('0x19')](function(_0x43228e){var _0x3f1c7c=![];if(!_0x557650[_0x93a0('0x8a')][_0x93a0('0x57')]){throw new Error(_0x93a0('0xe1'));}if(!_0x557650[_0x93a0('0x8a')][_0x93a0('0xf8')]['phone']){throw new Error(_0x93a0('0xf7'));}if(!_0x557650[_0x93a0('0x8a')]['binding'][_0x93a0('0xe7')]){throw new Error(_0x93a0('0xe8'));}if(!_0x557650['body'][_0x93a0('0xf2')]){throw new Error(_0x93a0('0xe5'));}var _0x99bd84=require(_0x93a0('0xee'))[_0x93a0('0xef')](path['join'](__dirname,_0x93a0('0xfd')),[_0x557650[_0x93a0('0x82')]['id'],JSON[_0x93a0('0xfa')](_0x557650['body']),JSON[_0x93a0('0xfa')](_0x43228e)]);_0x99bd84['on'](_0x93a0('0xfb'),function(_0x1786e2){_0x3f1c7c=!![];return _0x480a3b[_0x93a0('0x15')](0xc8)[_0x93a0('0x10')]({'message':_0x93a0('0xfe'),'pid':_0x99bd84['pid']});});_0x99bd84['on'](_0x93a0('0xff'),function(_0x589757){if(_0x589757&&!_0x3f1c7c){return _0x480a3b[_0x93a0('0x15')](0x1f4)[_0x93a0('0x10')]({'message':_0x93a0('0xfc'),'pid':_0x99bd84['pid']});}});})[_0x93a0('0x81')](handleError(_0x480a3b,null));};exports[_0x93a0('0x100')]=function(_0xb03895,_0x5545bb){var _0x57a07d=[_0x93a0('0x101'),'chat',_0x93a0('0x102'),_0x93a0('0x103'),'fax',_0x93a0('0x104'),'voice'];var _0x360d6d={'offset':0x0,'order':qs[_0x93a0('0x32')](_0x93a0('0x105'))},_0x182ee3={'count':0x0,'rows':[]};Promise[_0x93a0('0x68')]()['then'](function(){if(_0xb03895[_0x93a0('0x2a')][_0x93a0('0x106')]){if(!_[_0x93a0('0x107')](_0x57a07d,_0xb03895[_0x93a0('0x2a')][_0x93a0('0x106')][_0x93a0('0x108')]())){throw new Error('Invalid\x20channel');}_0x57a07d=[_0xb03895['query']['channel'][_0x93a0('0x108')]()];}if(_0xb03895[_0x93a0('0x2a')]['range']){try{var _0x272e0d=JSON[_0x93a0('0xf5')](_0xb03895[_0x93a0('0x2a')]['range']);if(!moment(_0x272e0d[_0x93a0('0x37')])['isValid']()){throw new Error(_0x93a0('0x109'));}if(!moment(_0x272e0d['to'])[_0x93a0('0x10a')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x529e82){throw new Error(_0x93a0('0x10b'));}}if(!_0xb03895[_0x93a0('0x2a')][_0x93a0('0x2f')]('nolimit')){_0x360d6d[_0x93a0('0x12')]=qs[_0x93a0('0x12')](_0xb03895[_0x93a0('0x2a')]['limit']||0xa);_0x360d6d[_0x93a0('0x14')]=qs[_0x93a0('0x14')](_0xb03895[_0x93a0('0x2a')][_0x93a0('0x14')]);}var _0x126472=_0x57a07d['map'](function(_0x1382e6){if(_0x1382e6===_0x93a0('0x10c')){var _0x402ea0={'attributes':['id',_0x93a0('0x10d'),_0x93a0('0x29'),_0x93a0('0x10e'),_0x93a0('0x10f'),_0x93a0('0x110'),_0x93a0('0x111'),'endtime',_0x93a0('0x112'),'note',_0x93a0('0x113'),_0x93a0('0x114'),'userSecondDisposition',_0x93a0('0x115'),'UserId'],'where':{'ContactId':_0xb03895[_0x93a0('0x82')]['id']},'include':[{'model':db[_0x93a0('0x49')],'as':_0x93a0('0x49'),'attributes':['id',_0x93a0('0x1d'),_0x93a0('0x116'),_0x93a0('0x117')]}],'order':[['createdAt','DESC']]};if(_0xb03895[_0x93a0('0x2a')][_0x93a0('0x118')]){_0x402ea0[_0x93a0('0x33')]['createdAt']={'$gte':_0x272e0d[_0x93a0('0x37')],'$lte':_0x272e0d['to']};}return db[_0x93a0('0x119')][_0x93a0('0x11a')](_0x402ea0)[_0x93a0('0x19')](function(_0x239221){_0x182ee3[_0x93a0('0x13')]+=_0x239221[_0x93a0('0x13')];return _[_0x93a0('0x46')](_0x239221['rows'],function(_0x18779e){var _0x205639=_0x18779e[_0x93a0('0x8b')]({'plain':!![]});_0x205639[_0x93a0('0x106')]=_0x1382e6;if(_0x205639[_0x93a0('0x49')]){_0x205639[_0x93a0('0x49')]={'id':_0x205639[_0x93a0('0x49')]['id'],'name':_0x205639[_0x93a0('0x49')][_0x93a0('0x1d')],'fullname':_0x205639[_0x93a0('0x49')][_0x93a0('0x116')],'alias':_0x205639[_0x93a0('0x49')][_0x93a0('0x117')]};}return _0x205639;});});}else{var _0x487d7a=_[_0x93a0('0x11b')](_0x1382e6)+(_0x1382e6===_0x93a0('0x11c')?_0x93a0('0x11d'):'Account');var _0x4875f9={'attributes':['id',_0x93a0('0x11e'),_0x93a0('0x11f'),_0x93a0('0x113'),_0x93a0('0x120'),_0x93a0('0x121'),_0x93a0('0x122'),_0x93a0('0x123'),_0x93a0('0x124'),_0x487d7a+'Id'],'where':{'ContactId':_0xb03895['params']['id']},'include':[{'model':db[_0x487d7a],'as':_0x93a0('0x125'),'attributes':['id',_0x93a0('0x1d'),_0x93a0('0x126')]},{'model':db[_0x93a0('0x49')],'as':_0x93a0('0x127'),'attributes':['id',_0x93a0('0x1d'),_0x93a0('0x116')]},{'model':db[_0x93a0('0xc0')],'as':_0x93a0('0x7f'),'attributes':['id',_0x93a0('0x1d'),_0x93a0('0x36')],'through':{'attributes':[]}}],'order':[[_0x93a0('0x113'),'DESC']]};if(_0xb03895['query'][_0x93a0('0x118')]){_0x4875f9[_0x93a0('0x33')][_0x93a0('0x113')]={'$gte':_0x272e0d[_0x93a0('0x37')],'$lte':_0x272e0d['to']};}switch(_0x1382e6){case'chat':_0x4875f9[_0x93a0('0x2e')]['push']('browserName',_0x93a0('0x128'),_0x93a0('0x129'),'deviceModel',_0x93a0('0x12a'),_0x93a0('0x12b'),_0x93a0('0x12c'),_0x93a0('0x12d'),_0x93a0('0x12e'));break;case _0x93a0('0x101'):_0x4875f9[_0x93a0('0x2e')]['push'](_0x93a0('0x12f'),_0x93a0('0x130'));break;case'openchannel':_0x4875f9[_0x93a0('0x2e')][_0x93a0('0x24')]('externalUrl',_0x93a0('0x131'));break;}return db[_[_0x93a0('0x11b')](_0x1382e6)+_0x93a0('0x132')][_0x93a0('0x11a')](_0x4875f9)[_0x93a0('0x19')](function(_0x560919){_0x182ee3[_0x93a0('0x13')]+=_0x560919[_0x93a0('0x13')];return _[_0x93a0('0x46')](_0x560919[_0x93a0('0x80')],function(_0x419ff8){var _0x148d9a=_0x419ff8[_0x93a0('0x8b')]({'plain':!![]});_0x148d9a[_0x93a0('0x106')]=_0x1382e6;if(_0x148d9a[_0x93a0('0x127')]){_0x148d9a[_0x93a0('0x127')]={'id':_0x148d9a[_0x93a0('0x127')]['id'],'name':_0x148d9a['Owner']['name'],'fullname':_0x148d9a[_0x93a0('0x127')][_0x93a0('0x116')]};}return _0x148d9a;});});}});return Promise['all'](_0x126472);})[_0x93a0('0x19')](function(_0x5fd7f7){return _(_0x5fd7f7)[_0x93a0('0x133')]()[_0x93a0('0x134')](_0x93a0('0x113'))[_0x93a0('0x135')]()[_0x93a0('0x4c')]();})[_0x93a0('0x19')](function(_0x2e2cd8){_0x182ee3['rows']=_0x360d6d[_0x93a0('0x12')]?_0x2e2cd8[_0x93a0('0x136')](_0x360d6d['offset'],_0x360d6d[_0x93a0('0x14')]+_0x360d6d[_0x93a0('0x12')]):_0x2e2cd8;return _0x182ee3;})['then'](respondWithFilteredResult(_0x5545bb,_0x360d6d))[_0x93a0('0x81')](handleError(_0x5545bb,null));};
\ No newline at end of file
index b0d8569..0a48175 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb601=['hook','exports','../../mysqldb','CmContact','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x3b11d3,_0x1c9fe2){var _0x10cd45=function(_0x242141){while(--_0x242141){_0x3b11d3['push'](_0x3b11d3['shift']());}};_0x10cd45(++_0x1c9fe2);}(_0xb601,0x173));var _0x1b60=function(_0x36154a,_0x2cf98c){_0x36154a=_0x36154a-0x0;var _0x61104e=_0xb601[_0x36154a];return _0x61104e;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x1b60('0x0'))['db'][_0x1b60('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x1b60('0x2')](0x0);var events={'afterCreate':_0x1b60('0x3'),'afterUpdate':'update','afterDestroy':_0x1b60('0x4')};function emitEvent(_0x2d590b){return function(_0x3b750b,_0x47e473,_0x2018ec){CmContactEvents[_0x1b60('0x5')](_0x2d590b+':'+_0x3b750b['id'],_0x3b750b);CmContactEvents[_0x1b60('0x5')](_0x2d590b,_0x3b750b);_0x2018ec(null);};}for(var e in events){if(events[_0x1b60('0x6')](e)){var event=events[e];CmContact[_0x1b60('0x7')](e,emitEvent(event));}}module[_0x1b60('0x8')]=CmContactEvents;
\ No newline at end of file
+var _0xc12c=['events','CmContact','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x6942e0,_0x131e6d){var _0xb86490=function(_0x2fd5d7){while(--_0x2fd5d7){_0x6942e0['push'](_0x6942e0['shift']());}};_0xb86490(++_0x131e6d);}(_0xc12c,0x19a));var _0xcc12=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xc12c[_0x43d11d];return _0x38cd08;};'use strict';var EventEmitter=require(_0xcc12('0x0'));var CmContact=require('../../mysqldb')['db'][_0xcc12('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xcc12('0x2')](0x0);var events={'afterCreate':_0xcc12('0x3'),'afterUpdate':_0xcc12('0x4'),'afterDestroy':_0xcc12('0x5')};function emitEvent(_0x552c49){return function(_0x5df3e1,_0x25e725,_0x2ddf26){CmContactEvents[_0xcc12('0x6')](_0x552c49+':'+_0x5df3e1['id'],_0x5df3e1);CmContactEvents['emit'](_0x552c49,_0x5df3e1);_0x2ddf26(null);};}for(var e in events){if(events[_0xcc12('0x7')](e)){var event=events[e];CmContact[_0xcc12('0x8')](e,emitEvent(event));}}module[_0xcc12('0x9')]=CmContactEvents;
\ No newline at end of file
index 0a41f41..6f7d75e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16ab=['CmHopper','create','ListId','priority','format','callbackUniqueid','ret','cmContact,\x20afterCreate\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','catch','Campaign','\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','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','dialCheckDuplicateType','CmList','length','always','onlyIfOpen','findAll','outbound','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','error','List\x20not\x20found','models','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','fax','email','FULLTEXT','utf8mb4','get','cmContact','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'];(function(_0x4e99e0,_0xd87512){var _0x2378d5=function(_0x3abd12){while(--_0x3abd12){_0x4e99e0['push'](_0x4e99e0['shift']());}};_0x2378d5(++_0xd87512);}(_0x16ab,0x152));var _0xb16a=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x16ab[_0x2642cb];return _0xe6e41;};'use strict';var _=require('lodash');var util=require(_0xb16a('0x0'));var logger=require(_0xb16a('0x1'))(_0xb16a('0x2'));var moment=require(_0xb16a('0x3'));var BPromise=require('bluebird');var rp=require(_0xb16a('0x4'));var fs=require('fs');var path=require(_0xb16a('0x5'));var rimraf=require(_0xb16a('0x6'));var config=require('../../config/environment');var shared=require(_0xb16a('0x7'));var attributes=require(_0xb16a('0x8'));module[_0xb16a('0x9')]=function(_0x1dd9a3,_0x1bcbdb){return _0x1dd9a3[_0xb16a('0xa')](_0xb16a('0xb'),attributes,{'tableName':_0xb16a('0xc'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0xb16a('0xd')]},{'name':_0xb16a('0xe'),'fields':[_0xb16a('0xf'),_0xb16a('0x10'),_0xb16a('0xd'),'mobile',_0xb16a('0x11'),_0xb16a('0x12')],'type':_0xb16a('0x13')}],'timestamps':!![],'charset':_0xb16a('0x14'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x31d231,_0x45c5c4,_0x9546b0){var _0x5b978c=_0x1dd9a3['models'];var _0x2535b4=_0x31d231[_0xb16a('0x15')]({'plain':!![]});function _0x2a2ce8(){return function(_0x5b4631){logger['error'](_0xb16a('0x16'),_0xb16a('0x17'),util[_0xb16a('0x18')](_0x5b4631,{'showHidden':![],'depth':null}));};}function _0x166e05(_0x334588,_0x522510){var _0x17c036=_0x522510[_0xb16a('0x19')]?_0x522510[_0xb16a('0x19')]:moment()['format'](_0xb16a('0x1a'));return new BPromise(function(_0x3a353b,_0x5f1480){if(_[_0xb16a('0x1b')](_0x522510[_0xb16a('0x1c')])){_0x3a353b({'ret':_0x17c036});}else{_0x5b978c[_0xb16a('0x1d')][_0xb16a('0x1e')]({'where':{'id':_0x334588['id']}})[_0xb16a('0x1f')](function(_0x3763ea){if(!_['isNil'](_0x3763ea)){var _0x462778=_0x3763ea['dialTimezone'];if(!_[_0xb16a('0x1b')](_0x462778)){var _0x285c46=shared[_0xb16a('0x20')];var _0x5cf40d=_0x285c46[_0x462778];var _0x14da38=_0x285c46[_0x522510[_0xb16a('0x1c')]];if(!_[_0xb16a('0x1b')](_0x5cf40d)&&!_[_0xb16a('0x1b')](_0x14da38)){var _0x5b00b1=_0x5cf40d['utcOffset']-_0x14da38[_0xb16a('0x21')];_0x17c036=_0x522510[_0xb16a('0x19')]?_0x522510[_0xb16a('0x19')]:moment();var _0x56f3d7=moment(_0x17c036)[_0xb16a('0x22')](_0x5b00b1,_0xb16a('0x23'));_0x3a353b({'ret':_0x56f3d7['format'](_0xb16a('0x1a'))});}else _0x3a353b({'ret':_0x17c036});}else _0x3a353b({'ret':_0x17c036});}else{_0x3a353b({'ret':_0x17c036});}});}});return 0xa;}var _0x5bdc43=function(_0x535b39){return new BPromise(function(_0x12a253,_0x22843b){_0x166e05(_0x535b39,_0x2535b4)['then'](function(_0x26d514){_0x2535b4[_0xb16a('0x19')]=_0x26d514['ret'];_0x5b978c['CmHopper'][_0xb16a('0x1e')]({'where':{'phone':_0x2535b4[_0xb16a('0xd')],'VoiceQueueId':_0x535b39['id']}})[_0xb16a('0x1f')](function(_0x35dba3){if(!_[_0xb16a('0x1b')](_0x35dba3)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2535b4[_0xb16a('0xd')]+_0xb16a('0x24')+_0x535b39['id']);}return _0x5b978c[_0xb16a('0x25')][_0xb16a('0x26')]({'phone':_0x2535b4['phone'],'ContactId':_0x2535b4['id'],'ListId':_0x2535b4[_0xb16a('0x27')],'priority':_0x2535b4[_0xb16a('0x28')]?_0x2535b4[_0xb16a('0x28')]:0x2,'scheduledat':_0x2535b4[_0xb16a('0x19')]?_0x2535b4[_0xb16a('0x19')]:moment()[_0xb16a('0x29')](_0xb16a('0x1a')),'callback':_0x2535b4[_0xb16a('0x2a')]?!![]:![],'callbackuniqueid':_0x2535b4[_0xb16a('0x2a')]?_0x2535b4['callbackUniqueid']:undefined,'callbackat':_0x2535b4[_0xb16a('0x2a')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x535b39['id']});})['catch'](function(_0xcb1760){_0x22843b(_0xcb1760);});});});};var _0x8950=function(_0x233930){return new BPromise(function(_0x298358,_0x1daa32){_0x166e05(_0x233930,_0x2535b4)[_0xb16a('0x1f')](function(_0x2a5f7e){_0x2535b4['scheduledat']=_0x2a5f7e[_0xb16a('0x2b')];_0x5b978c[_0xb16a('0x25')][_0xb16a('0x1e')]({'where':{'phone':_0x2535b4[_0xb16a('0xd')],'VoiceQueueId':_0x233930['id']}})['then'](function(_0x5e09f4){if(!_[_0xb16a('0x1b')](_0x5e09f4)){throw new Error(_0xb16a('0x2c')+_0x2535b4['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x233930['id']);}return _0x5b978c[_0xb16a('0x2d')][_0xb16a('0x1e')]({'where':{'calleridnum':_0x2535b4[_0xb16a('0xd')],'VoiceQueueId':_0x233930['id']}});})[_0xb16a('0x1f')](function(_0x365304){if(!_[_0xb16a('0x1b')](_0x365304)){throw new Error(_0xb16a('0x2e')+_0x2535b4[_0xb16a('0xd')]+_0xb16a('0x2f')+_0x233930['id']);}return _0x5b978c[_0xb16a('0x25')]['create']({'phone':_0x2535b4[_0xb16a('0xd')],'ContactId':_0x2535b4['id'],'ListId':_0x2535b4['ListId'],'priority':_0x2535b4[_0xb16a('0x28')]?_0x2535b4[_0xb16a('0x28')]:0x2,'scheduledat':_0x2535b4[_0xb16a('0x19')]?_0x2535b4['scheduledat']:moment()['format'](_0xb16a('0x1a')),'callback':_0x2535b4[_0xb16a('0x2a')]?!![]:![],'callbackuniqueid':_0x2535b4[_0xb16a('0x2a')]?_0x2535b4[_0xb16a('0x2a')]:undefined,'callbackat':_0x2535b4[_0xb16a('0x2a')]?moment()[_0xb16a('0x29')](_0xb16a('0x1a')):undefined,'VoiceQueueId':_0x233930['id']});})[_0xb16a('0x30')](function(_0x2ea49f){_0x1daa32(_0x2ea49f);});});});};function _0xe6f3e0(){return function(_0x363105){logger['error'](_0xb16a('0x16'),'afterCreate',util['inspect'](_0x363105,{'showHidden':![],'depth':null}));};}function _0x4284f8(_0x295658,_0x3168c9){var _0x24aaa4=_0x3168c9[_0xb16a('0x19')]?_0x3168c9[_0xb16a('0x19')]:moment()[_0xb16a('0x29')](_0xb16a('0x1a'));return new BPromise(function(_0x1c926d,_0x33aedf){if(_[_0xb16a('0x1b')](_0x3168c9[_0xb16a('0x1c')])){_0x1c926d({'ret':_0x24aaa4});}else{_0x5b978c[_0xb16a('0x31')]['findOne']({'where':{'id':_0x295658['id']}})[_0xb16a('0x1f')](function(_0x30521d){if(!_[_0xb16a('0x1b')](_0x30521d)){var _0x2604fc=_0x30521d['dialTimezone'];if(!_['isNil'](_0x2604fc)){var _0x1a0a66=shared[_0xb16a('0x20')];var _0x26df50=_0x1a0a66[_0x2604fc];var _0x18e1b=_0x1a0a66[_0x3168c9[_0xb16a('0x1c')]];if(!_['isNil'](_0x26df50)&&!_[_0xb16a('0x1b')](_0x18e1b)){var _0x4629d5=_0x26df50[_0xb16a('0x21')]-_0x18e1b[_0xb16a('0x21')];_0x24aaa4=_0x3168c9['scheduledat']?_0x3168c9[_0xb16a('0x19')]:moment();var _0x5a2eee=moment(_0x24aaa4)[_0xb16a('0x22')](_0x4629d5,_0xb16a('0x23'));_0x1c926d({'ret':_0x5a2eee[_0xb16a('0x29')](_0xb16a('0x1a'))});}else _0x1c926d({'ret':_0x24aaa4});}else _0x1c926d({'ret':_0x24aaa4});}else{_0x1c926d({'ret':_0x24aaa4});}});}});return 0xa;}var _0x40a3e5=function(_0x4b4bcf){return new BPromise(function(_0x19a10f,_0x1438a1){_0x4284f8(_0x4b4bcf,_0x2535b4)[_0xb16a('0x1f')](function(_0x1af5c7){_0x2535b4[_0xb16a('0x19')]=_0x1af5c7[_0xb16a('0x2b')];_0x5b978c[_0xb16a('0x25')]['findOne']({'where':{'phone':_0x2535b4[_0xb16a('0xd')],'CampaignId':_0x4b4bcf['id']}})[_0xb16a('0x1f')](function(_0x4cc635){if(!_[_0xb16a('0x1b')](_0x4cc635)){throw new Error(_0xb16a('0x2c')+_0x2535b4[_0xb16a('0xd')]+_0xb16a('0x32')+_0x4b4bcf['id']);}return _0x5b978c['CmHopper']['create']({'phone':_0x2535b4[_0xb16a('0xd')],'ContactId':_0x2535b4['id'],'ListId':_0x2535b4['ListId'],'priority':_0x2535b4['priority']?_0x2535b4['priority']:0x2,'scheduledat':_0x2535b4[_0xb16a('0x19')]?_0x2535b4['scheduledat']:moment()['format'](_0xb16a('0x1a')),'callback':_0x2535b4['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2535b4['callbackUniqueid']?_0x2535b4[_0xb16a('0x2a')]:undefined,'callbackat':_0x2535b4[_0xb16a('0x2a')]?moment()[_0xb16a('0x29')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x4b4bcf['id']});})['catch'](function(_0xadcb8f){_0x1438a1(_0xadcb8f);});});});};var _0x1b1006=function(_0x4374c6){return new BPromise(function(_0x479207,_0x5cd6cd){_0x4284f8(_0x4374c6,_0x2535b4)['then'](function(_0xeb0929){_0x2535b4[_0xb16a('0x19')]=_0xeb0929['ret'];_0x5b978c[_0xb16a('0x25')]['findOne']({'where':{'phone':_0x2535b4[_0xb16a('0xd')],'CampaignId':_0x4374c6['id']}})[_0xb16a('0x1f')](function(_0x2f84df){if(!_[_0xb16a('0x1b')](_0x2f84df)){throw new Error(_0xb16a('0x2c')+_0x2535b4[_0xb16a('0xd')]+_0xb16a('0x33')+_0x4374c6['id']);}return _0x5b978c[_0xb16a('0x2d')][_0xb16a('0x1e')]({'where':{'calleridnum':_0x2535b4[_0xb16a('0xd')],'CampaignId':_0x4374c6['id']}});})[_0xb16a('0x1f')](function(_0x32c039){if(!_[_0xb16a('0x1b')](_0x32c039)){throw new Error(_0xb16a('0x2e')+_0x2535b4[_0xb16a('0xd')]+_0xb16a('0x34')+_0x4374c6['id']);}return _0x5b978c['CmHopper'][_0xb16a('0x26')]({'phone':_0x2535b4[_0xb16a('0xd')],'ContactId':_0x2535b4['id'],'ListId':_0x2535b4['ListId'],'priority':_0x2535b4[_0xb16a('0x28')]?_0x2535b4[_0xb16a('0x28')]:0x2,'scheduledat':_0x2535b4[_0xb16a('0x19')]?_0x2535b4[_0xb16a('0x19')]:moment()['format'](_0xb16a('0x1a')),'callback':_0x2535b4[_0xb16a('0x2a')]?!![]:![],'callbackuniqueid':_0x2535b4[_0xb16a('0x2a')]?_0x2535b4['callbackUniqueid']:undefined,'callbackat':_0x2535b4[_0xb16a('0x2a')]?moment()[_0xb16a('0x29')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x4374c6['id']});})[_0xb16a('0x30')](function(_0x45cd93){_0x5cd6cd(_0x45cd93);});});});};if(_0x2535b4['ListId']){_0x5b978c[_0xb16a('0x1d')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0xb16a('0x35'),_0xb16a('0x1c')],'include':[{'model':_0x5b978c[_0xb16a('0x36')],'as':'Lists','where':{'id':_0x2535b4[_0xb16a('0x27')]}}]})[_0xb16a('0x1f')](function(_0x170fea){if(_0x170fea){var _0x33afa5=[];for(var _0x1cb0b9=0x0,_0x1abf93;_0x1cb0b9<_0x170fea[_0xb16a('0x37')];_0x1cb0b9+=0x1){_0x1abf93=_0x170fea[_0x1cb0b9][_0xb16a('0x15')]({'plain':!![]});switch(_0x1abf93[_0xb16a('0x35')]){case _0xb16a('0x38'):_0x8950(_0x1abf93)['catch'](_0x2a2ce8());break;case _0xb16a('0x39'):_0x5bdc43(_0x1abf93)[_0xb16a('0x30')](_0x2a2ce8());break;default:_0x4284f8(_0x1abf93,_0x2535b4)['then'](function(_0xd82f99){_0x2535b4[_0xb16a('0x19')]=_0xd82f99['ret'];_0x5b978c[_0xb16a('0x25')][_0xb16a('0x26')]({'phone':_0x2535b4['phone'],'ContactId':_0x2535b4['id'],'ListId':_0x2535b4['ListId'],'scheduledat':_0x2535b4[_0xb16a('0x19')]?_0x2535b4[_0xb16a('0x19')]:moment()[_0xb16a('0x29')](_0xb16a('0x1a')),'priority':_0x2535b4[_0xb16a('0x28')]?_0x2535b4[_0xb16a('0x28')]:0x2,'callback':_0x2535b4[_0xb16a('0x2a')]?!![]:![],'callbackuniqueid':_0x2535b4['callbackUniqueid']?_0x2535b4['callbackUniqueid']:undefined,'callbackat':_0x2535b4[_0xb16a('0x2a')]?moment()[_0xb16a('0x29')](_0xb16a('0x1a')):undefined,'VoiceQueueId':_0x1abf93['id']})[_0xb16a('0x30')](_0x2a2ce8());});}}}})[_0xb16a('0x1f')](function(){return _0x5b978c[_0xb16a('0x1d')][_0xb16a('0x3a')]({'where':{'type':_0xb16a('0x3b')},'attributes':['id'],'include':[{'model':_0x5b978c[_0xb16a('0x36')],'as':_0xb16a('0x3c'),'where':{'id':_0x2535b4[_0xb16a('0x27')]}}]})['then'](function(_0x1649f2){if(_0x1649f2){var _0x5a904c=[];for(var _0x1bde15=0x0,_0x2dd6a7;_0x1bde15<_0x1649f2[_0xb16a('0x37')];_0x1bde15+=0x1){_0x2dd6a7=_0x1649f2[_0x1bde15]['get']({'plain':!![]});_0x5b978c[_0xb16a('0x3d')][_0xb16a('0x26')]({'phone':_0x2535b4['phone'],'ContactId':_0x2535b4['id'],'ListId':_0x2535b4[_0xb16a('0x27')],'VoiceQueueId':_0x2dd6a7['id']})[_0xb16a('0x30')](function(_0x5aa0cf){logger['error'](_0xb16a('0x3e'),_0xb16a('0x17'),_0x5aa0cf[_0xb16a('0x3f')]);});}}});})[_0xb16a('0x1f')](function(){return _0x5b978c[_0xb16a('0x31')]['findAll']({'attributes':['id',_0xb16a('0x35'),_0xb16a('0x1c')],'include':[{'model':_0x5b978c[_0xb16a('0x36')],'as':'Lists','where':{'id':_0x2535b4[_0xb16a('0x27')]}}]})[_0xb16a('0x1f')](function(_0x455b45){if(_0x455b45){var _0xd7e421=[];for(var _0x4502f9=0x0,_0x85b867;_0x4502f9<_0x455b45[_0xb16a('0x37')];_0x4502f9+=0x1){_0x85b867=_0x455b45[_0x4502f9][_0xb16a('0x15')]({'plain':!![]});switch(_0x85b867[_0xb16a('0x35')]){case _0xb16a('0x38'):_0x1b1006(_0x85b867)[_0xb16a('0x30')](_0xe6f3e0());break;case _0xb16a('0x39'):_0x40a3e5(_0x85b867)[_0xb16a('0x30')](_0xe6f3e0());break;default:_0x5b978c[_0xb16a('0x25')][_0xb16a('0x26')]({'phone':_0x2535b4[_0xb16a('0xd')],'ContactId':_0x2535b4['id'],'ListId':_0x2535b4['ListId'],'scheduledat':_0x2535b4[_0xb16a('0x19')]?_0x2535b4[_0xb16a('0x19')]:moment()[_0xb16a('0x29')](_0xb16a('0x1a')),'priority':_0x2535b4[_0xb16a('0x28')]?_0x2535b4[_0xb16a('0x28')]:0x2,'callback':_0x2535b4['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2535b4[_0xb16a('0x2a')]?_0x2535b4[_0xb16a('0x2a')]:undefined,'callbackat':_0x2535b4[_0xb16a('0x2a')]?moment()[_0xb16a('0x29')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x85b867['id']})[_0xb16a('0x30')](_0xe6f3e0());}}}});})[_0xb16a('0x1f')](function(){return _0x5b978c[_0xb16a('0x31')][_0xb16a('0x3a')]({'attributes':['id'],'include':[{'model':_0x5b978c[_0xb16a('0x36')],'as':_0xb16a('0x3c'),'where':{'id':_0x2535b4[_0xb16a('0x27')]}}]})[_0xb16a('0x1f')](function(_0x4415fc){if(_0x4415fc){var _0x4018c2=[];for(var _0x503215=0x0,_0x1a0dcb;_0x503215<_0x4415fc[_0xb16a('0x37')];_0x503215+=0x1){_0x1a0dcb=_0x4415fc[_0x503215][_0xb16a('0x15')]({'plain':!![]});_0x5b978c[_0xb16a('0x3d')][_0xb16a('0x26')]({'phone':_0x2535b4[_0xb16a('0xd')],'ContactId':_0x2535b4['id'],'ListId':_0x2535b4[_0xb16a('0x27')],'CampaignId':_0x1a0dcb['id']})['catch'](function(_0x4e5d2d){logger[_0xb16a('0x40')](_0xb16a('0x3e'),_0xb16a('0x17'),_0x4e5d2d['message']);});}}});})[_0xb16a('0x1f')](function(){_0x9546b0();})[_0xb16a('0x30')](function(_0x513d1e){logger[_0xb16a('0x40')](_0xb16a('0x3e'),_0xb16a('0x17'),_0x513d1e[_0xb16a('0x3f')]);_0x9546b0(_0x513d1e);});}else{_0x9546b0(new Error(_0xb16a('0x41')));}},'afterDestroy':function(_0x15b814,_0x34befd,_0x38c8c7){var _0x14ac2f=_0x1dd9a3[_0xb16a('0x42')];var _0x3d660e=_0x15b814[_0xb16a('0x15')]({'plain':!![]});return _0x14ac2f['CmHopper'][_0xb16a('0x3a')]({'raw':!![],'where':{'ListId':_0x3d660e[_0xb16a('0x27')],'ContactId':_0x3d660e['id']}})['then'](function(_0x389d84){if(!_[_0xb16a('0x43')](_0x389d84)){var _0x46055=[];for(var _0x163a99=0x0;_0x163a99<_0x389d84[_0xb16a('0x37')];_0x163a99+=0x1){var _0x1a0144=_0x14ac2f[_0xb16a('0x25')][_0xb16a('0x44')]({'where':{'ListId':_0x389d84[_0x163a99][_0xb16a('0x27')],'ContactId':_0x389d84[_0x163a99][_0xb16a('0x45')],'VoiceQueueId':_0x389d84[_0x163a99][_0xb16a('0x46')],'CampaignId':_0x389d84[_0x163a99][_0xb16a('0x47')]}});_0x46055['push'](_0x1a0144);}return BPromise['all'](_0x46055);}})[_0xb16a('0x1f')](function(_0x3c10ba){logger[_0xb16a('0x48')](_0xb16a('0x49'),util['inspect'](_0x3c10ba,{'showHidden':![],'depth':null}));_0x38c8c7();})[_0xb16a('0x30')](function(_0xe0a544){logger[_0xb16a('0x40')](_0xb16a('0x4a'),util['inspect'](_0xe0a544,{'showHidden':![],'depth':null}));_0x38c8c7(_0xe0a544);});}}});};
\ No newline at end of file
+var _0xa17d=['scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','minutes','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','ListId','priority','callbackUniqueid','catch','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','\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','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','List\x20not\x20found','destroy','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect'];(function(_0x550691,_0x19fe04){var _0x25f1e2=function(_0xe2eebd){while(--_0xe2eebd){_0x550691['push'](_0x550691['shift']());}};_0x25f1e2(++_0x19fe04);}(_0xa17d,0x116));var _0xda17=function(_0x6c0123,_0x4c8d3b){_0x6c0123=_0x6c0123-0x0;var _0x5a87d2=_0xa17d[_0x6c0123];return _0x5a87d2;};'use strict';var _=require(_0xda17('0x0'));var util=require(_0xda17('0x1'));var logger=require('../../config/logger')(_0xda17('0x2'));var moment=require('moment');var BPromise=require(_0xda17('0x3'));var rp=require(_0xda17('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xda17('0x5'));var config=require('../../config/environment');var shared=require(_0xda17('0x6'));var attributes=require(_0xda17('0x7'));module[_0xda17('0x8')]=function(_0x5a214e,_0x57f715){return _0x5a214e[_0xda17('0x9')](_0xda17('0xa'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0xda17('0xb'),'fields':[_0xda17('0xb')]},{'name':_0xda17('0xc'),'fields':[_0xda17('0xd'),_0xda17('0xe'),_0xda17('0xb'),_0xda17('0xf'),_0xda17('0x10'),_0xda17('0x11')],'type':_0xda17('0x12')}],'timestamps':!![],'charset':'utf8mb4','collate':_0xda17('0x13'),'hooks':{'afterCreate':function(_0x6d3a5b,_0xa15168,_0x4c8981){var _0x24beec=_0x5a214e[_0xda17('0x14')];var _0x95ee08=_0x6d3a5b[_0xda17('0x15')]({'plain':!![]});function _0x784502(){return function(_0x4bdb1c){logger[_0xda17('0x16')](_0xda17('0x17'),_0xda17('0x18'),util[_0xda17('0x19')](_0x4bdb1c,{'showHidden':![],'depth':null}));};}function _0x5f5049(_0x40c8c3,_0x1cce96){var _0x514ddf=_0x1cce96[_0xda17('0x1a')]?_0x1cce96[_0xda17('0x1a')]:moment()[_0xda17('0x1b')](_0xda17('0x1c'));return new BPromise(function(_0x175a77,_0x81cd08){if(_[_0xda17('0x1d')](_0x1cce96[_0xda17('0x1e')])){_0x175a77({'ret':_0x514ddf});}else{_0x24beec[_0xda17('0x1f')][_0xda17('0x20')]({'where':{'id':_0x40c8c3['id']}})[_0xda17('0x21')](function(_0x43da98){if(!_[_0xda17('0x1d')](_0x43da98)){var _0x599f5a=_0x43da98[_0xda17('0x1e')];if(!_[_0xda17('0x1d')](_0x599f5a)){var _0x211b62=shared[_0xda17('0x22')];var _0x1a1f19=_0x211b62[_0x599f5a];var _0x330b95=_0x211b62[_0x1cce96['dialTimezone']];if(!_[_0xda17('0x1d')](_0x1a1f19)&&!_['isNil'](_0x330b95)){var _0x4661f4=_0x1a1f19[_0xda17('0x23')]-_0x330b95['utcOffset'];_0x514ddf=_0x1cce96['scheduledat']?_0x1cce96[_0xda17('0x1a')]:moment();var _0x5a7ab0=moment(_0x514ddf)[_0xda17('0x24')](_0x4661f4,_0xda17('0x25'));_0x175a77({'ret':_0x5a7ab0[_0xda17('0x1b')](_0xda17('0x1c'))});}else _0x175a77({'ret':_0x514ddf});}else _0x175a77({'ret':_0x514ddf});}else{_0x175a77({'ret':_0x514ddf});}});}});return 0xa;}var _0x257043=function(_0x492657){return new BPromise(function(_0x1f3177,_0x3a29d2){_0x5f5049(_0x492657,_0x95ee08)[_0xda17('0x21')](function(_0x328a25){_0x95ee08['scheduledat']=_0x328a25[_0xda17('0x26')];_0x24beec['CmHopper'][_0xda17('0x20')]({'where':{'phone':_0x95ee08['phone'],'VoiceQueueId':_0x492657['id']}})[_0xda17('0x21')](function(_0x1c1eb7){if(!_[_0xda17('0x1d')](_0x1c1eb7)){throw new Error(_0xda17('0x27')+_0x95ee08['phone']+_0xda17('0x28')+_0x492657['id']);}return _0x24beec[_0xda17('0x29')][_0xda17('0x2a')]({'phone':_0x95ee08[_0xda17('0xb')],'ContactId':_0x95ee08['id'],'ListId':_0x95ee08[_0xda17('0x2b')],'priority':_0x95ee08[_0xda17('0x2c')]?_0x95ee08[_0xda17('0x2c')]:0x2,'scheduledat':_0x95ee08[_0xda17('0x1a')]?_0x95ee08[_0xda17('0x1a')]:moment()[_0xda17('0x1b')](_0xda17('0x1c')),'callback':_0x95ee08[_0xda17('0x2d')]?!![]:![],'callbackuniqueid':_0x95ee08[_0xda17('0x2d')]?_0x95ee08[_0xda17('0x2d')]:undefined,'callbackat':_0x95ee08[_0xda17('0x2d')]?moment()[_0xda17('0x1b')](_0xda17('0x1c')):undefined,'VoiceQueueId':_0x492657['id']});})[_0xda17('0x2e')](function(_0x25235f){_0x3a29d2(_0x25235f);});});});};var _0x9782cd=function(_0x1a5768){return new BPromise(function(_0x5bf0cb,_0x1da2d6){_0x5f5049(_0x1a5768,_0x95ee08)[_0xda17('0x21')](function(_0x276472){_0x95ee08['scheduledat']=_0x276472['ret'];_0x24beec[_0xda17('0x29')]['findOne']({'where':{'phone':_0x95ee08[_0xda17('0xb')],'VoiceQueueId':_0x1a5768['id']}})[_0xda17('0x21')](function(_0x28fe98){if(!_[_0xda17('0x1d')](_0x28fe98)){throw new Error('cmContact,\x20afterCreate\x20'+_0x95ee08[_0xda17('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x1a5768['id']);}return _0x24beec[_0xda17('0x2f')][_0xda17('0x20')]({'where':{'calleridnum':_0x95ee08[_0xda17('0xb')],'VoiceQueueId':_0x1a5768['id']}});})[_0xda17('0x21')](function(_0x1a5b46){if(!_['isNil'](_0x1a5b46)){throw new Error(_0xda17('0x30')+_0x95ee08[_0xda17('0xb')]+_0xda17('0x31')+_0x1a5768['id']);}return _0x24beec[_0xda17('0x29')][_0xda17('0x2a')]({'phone':_0x95ee08['phone'],'ContactId':_0x95ee08['id'],'ListId':_0x95ee08[_0xda17('0x2b')],'priority':_0x95ee08[_0xda17('0x2c')]?_0x95ee08[_0xda17('0x2c')]:0x2,'scheduledat':_0x95ee08['scheduledat']?_0x95ee08[_0xda17('0x1a')]:moment()[_0xda17('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x95ee08[_0xda17('0x2d')]?!![]:![],'callbackuniqueid':_0x95ee08['callbackUniqueid']?_0x95ee08[_0xda17('0x2d')]:undefined,'callbackat':_0x95ee08['callbackUniqueid']?moment()[_0xda17('0x1b')](_0xda17('0x1c')):undefined,'VoiceQueueId':_0x1a5768['id']});})['catch'](function(_0xb6a34){_0x1da2d6(_0xb6a34);});});});};function _0x50f3ff(){return function(_0x3323ec){logger['error']('cmContact',_0xda17('0x18'),util[_0xda17('0x19')](_0x3323ec,{'showHidden':![],'depth':null}));};}function _0x4347e6(_0x546098,_0x20b899){var _0x55a7cf=_0x20b899['scheduledat']?_0x20b899['scheduledat']:moment()['format'](_0xda17('0x1c'));return new BPromise(function(_0x585b1e,_0x976df7){if(_[_0xda17('0x1d')](_0x20b899[_0xda17('0x1e')])){_0x585b1e({'ret':_0x55a7cf});}else{_0x24beec['Campaign'][_0xda17('0x20')]({'where':{'id':_0x546098['id']}})[_0xda17('0x21')](function(_0x416b5a){if(!_[_0xda17('0x1d')](_0x416b5a)){var _0x30db41=_0x416b5a[_0xda17('0x1e')];if(!_[_0xda17('0x1d')](_0x30db41)){var _0x4daedb=shared['timezones'];var _0x5ad4e4=_0x4daedb[_0x30db41];var _0x1b362b=_0x4daedb[_0x20b899['dialTimezone']];if(!_[_0xda17('0x1d')](_0x5ad4e4)&&!_[_0xda17('0x1d')](_0x1b362b)){var _0x198875=_0x5ad4e4[_0xda17('0x23')]-_0x1b362b[_0xda17('0x23')];_0x55a7cf=_0x20b899[_0xda17('0x1a')]?_0x20b899['scheduledat']:moment();var _0x45bd00=moment(_0x55a7cf)[_0xda17('0x24')](_0x198875,_0xda17('0x25'));_0x585b1e({'ret':_0x45bd00['format'](_0xda17('0x1c'))});}else _0x585b1e({'ret':_0x55a7cf});}else _0x585b1e({'ret':_0x55a7cf});}else{_0x585b1e({'ret':_0x55a7cf});}});}});return 0xa;}var _0x316c94=function(_0x1d1718){return new BPromise(function(_0x4661da,_0x13ae2a){_0x4347e6(_0x1d1718,_0x95ee08)[_0xda17('0x21')](function(_0x3a72ec){_0x95ee08[_0xda17('0x1a')]=_0x3a72ec[_0xda17('0x26')];_0x24beec['CmHopper']['findOne']({'where':{'phone':_0x95ee08[_0xda17('0xb')],'CampaignId':_0x1d1718['id']}})[_0xda17('0x21')](function(_0x324ab3){if(!_['isNil'](_0x324ab3)){throw new Error('cmContact,\x20afterCreate\x20'+_0x95ee08[_0xda17('0xb')]+_0xda17('0x32')+_0x1d1718['id']);}return _0x24beec[_0xda17('0x29')][_0xda17('0x2a')]({'phone':_0x95ee08[_0xda17('0xb')],'ContactId':_0x95ee08['id'],'ListId':_0x95ee08[_0xda17('0x2b')],'priority':_0x95ee08[_0xda17('0x2c')]?_0x95ee08[_0xda17('0x2c')]:0x2,'scheduledat':_0x95ee08['scheduledat']?_0x95ee08[_0xda17('0x1a')]:moment()[_0xda17('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x95ee08['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x95ee08[_0xda17('0x2d')]?_0x95ee08[_0xda17('0x2d')]:undefined,'callbackat':_0x95ee08[_0xda17('0x2d')]?moment()[_0xda17('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x1d1718['id']});})[_0xda17('0x2e')](function(_0x25bfd5){_0x13ae2a(_0x25bfd5);});});});};var _0x4fcb32=function(_0x47a18b){return new BPromise(function(_0xe7cb1,_0x434745){_0x4347e6(_0x47a18b,_0x95ee08)[_0xda17('0x21')](function(_0xe2c47a){_0x95ee08['scheduledat']=_0xe2c47a[_0xda17('0x26')];_0x24beec[_0xda17('0x29')][_0xda17('0x20')]({'where':{'phone':_0x95ee08[_0xda17('0xb')],'CampaignId':_0x47a18b['id']}})[_0xda17('0x21')](function(_0x1673cb){if(!_[_0xda17('0x1d')](_0x1673cb)){throw new Error(_0xda17('0x27')+_0x95ee08['phone']+_0xda17('0x33')+_0x47a18b['id']);}return _0x24beec[_0xda17('0x2f')]['findOne']({'where':{'calleridnum':_0x95ee08[_0xda17('0xb')],'CampaignId':_0x47a18b['id']}});})[_0xda17('0x21')](function(_0x76ab05){if(!_[_0xda17('0x1d')](_0x76ab05)){throw new Error(_0xda17('0x30')+_0x95ee08['phone']+_0xda17('0x34')+_0x47a18b['id']);}return _0x24beec['CmHopper'][_0xda17('0x2a')]({'phone':_0x95ee08[_0xda17('0xb')],'ContactId':_0x95ee08['id'],'ListId':_0x95ee08[_0xda17('0x2b')],'priority':_0x95ee08['priority']?_0x95ee08[_0xda17('0x2c')]:0x2,'scheduledat':_0x95ee08[_0xda17('0x1a')]?_0x95ee08['scheduledat']:moment()[_0xda17('0x1b')](_0xda17('0x1c')),'callback':_0x95ee08['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x95ee08[_0xda17('0x2d')]?_0x95ee08['callbackUniqueid']:undefined,'callbackat':_0x95ee08[_0xda17('0x2d')]?moment()['format'](_0xda17('0x1c')):undefined,'CampaignId':_0x47a18b['id']});})[_0xda17('0x2e')](function(_0x590723){_0x434745(_0x590723);});});});};if(_0x95ee08[_0xda17('0x2b')]){_0x24beec[_0xda17('0x1f')][_0xda17('0x35')]({'where':{'type':_0xda17('0x36')},'attributes':['id',_0xda17('0x37'),_0xda17('0x1e')],'include':[{'model':_0x24beec[_0xda17('0x38')],'as':_0xda17('0x39'),'where':{'id':_0x95ee08['ListId']}}]})[_0xda17('0x21')](function(_0x2820f7){if(_0x2820f7){var _0x34b030=[];for(var _0x19016d=0x0,_0x39285d;_0x19016d<_0x2820f7[_0xda17('0x3a')];_0x19016d+=0x1){_0x39285d=_0x2820f7[_0x19016d][_0xda17('0x15')]({'plain':!![]});switch(_0x39285d[_0xda17('0x37')]){case _0xda17('0x3b'):_0x9782cd(_0x39285d)[_0xda17('0x2e')](_0x784502());break;case _0xda17('0x3c'):_0x257043(_0x39285d)[_0xda17('0x2e')](_0x784502());break;default:_0x4347e6(_0x39285d,_0x95ee08)[_0xda17('0x21')](function(_0x1131ca){_0x95ee08[_0xda17('0x1a')]=_0x1131ca[_0xda17('0x26')];_0x24beec[_0xda17('0x29')][_0xda17('0x2a')]({'phone':_0x95ee08[_0xda17('0xb')],'ContactId':_0x95ee08['id'],'ListId':_0x95ee08['ListId'],'scheduledat':_0x95ee08['scheduledat']?_0x95ee08[_0xda17('0x1a')]:moment()[_0xda17('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x95ee08[_0xda17('0x2c')]?_0x95ee08['priority']:0x2,'callback':_0x95ee08[_0xda17('0x2d')]?!![]:![],'callbackuniqueid':_0x95ee08[_0xda17('0x2d')]?_0x95ee08[_0xda17('0x2d')]:undefined,'callbackat':_0x95ee08['callbackUniqueid']?moment()[_0xda17('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x39285d['id']})[_0xda17('0x2e')](_0x784502());});}}}})[_0xda17('0x21')](function(){return _0x24beec[_0xda17('0x1f')][_0xda17('0x35')]({'where':{'type':_0xda17('0x36')},'attributes':['id'],'include':[{'model':_0x24beec[_0xda17('0x38')],'as':_0xda17('0x3d'),'where':{'id':_0x95ee08[_0xda17('0x2b')]}}]})[_0xda17('0x21')](function(_0x17d26e){if(_0x17d26e){var _0x129436=[];for(var _0x118d06=0x0,_0x19c07c;_0x118d06<_0x17d26e['length'];_0x118d06+=0x1){_0x19c07c=_0x17d26e[_0x118d06][_0xda17('0x15')]({'plain':!![]});_0x24beec[_0xda17('0x3e')]['create']({'phone':_0x95ee08['phone'],'ContactId':_0x95ee08['id'],'ListId':_0x95ee08[_0xda17('0x2b')],'VoiceQueueId':_0x19c07c['id']})[_0xda17('0x2e')](function(_0x374e54){logger[_0xda17('0x16')](_0xda17('0x3f'),_0xda17('0x18'),_0x374e54[_0xda17('0x40')]);});}}});})[_0xda17('0x21')](function(){return _0x24beec[_0xda17('0x41')][_0xda17('0x35')]({'attributes':['id','dialCheckDuplicateType',_0xda17('0x1e')],'include':[{'model':_0x24beec['CmList'],'as':'Lists','where':{'id':_0x95ee08['ListId']}}]})['then'](function(_0x1fd2cc){if(_0x1fd2cc){var _0x4e2fad=[];for(var _0x4b8e76=0x0,_0x3bb09e;_0x4b8e76<_0x1fd2cc[_0xda17('0x3a')];_0x4b8e76+=0x1){_0x3bb09e=_0x1fd2cc[_0x4b8e76][_0xda17('0x15')]({'plain':!![]});switch(_0x3bb09e[_0xda17('0x37')]){case _0xda17('0x3b'):_0x4fcb32(_0x3bb09e)[_0xda17('0x2e')](_0x50f3ff());break;case _0xda17('0x3c'):_0x316c94(_0x3bb09e)['catch'](_0x50f3ff());break;default:_0x24beec[_0xda17('0x29')][_0xda17('0x2a')]({'phone':_0x95ee08['phone'],'ContactId':_0x95ee08['id'],'ListId':_0x95ee08['ListId'],'scheduledat':_0x95ee08[_0xda17('0x1a')]?_0x95ee08[_0xda17('0x1a')]:moment()[_0xda17('0x1b')](_0xda17('0x1c')),'priority':_0x95ee08['priority']?_0x95ee08[_0xda17('0x2c')]:0x2,'callback':_0x95ee08[_0xda17('0x2d')]?!![]:![],'callbackuniqueid':_0x95ee08['callbackUniqueid']?_0x95ee08[_0xda17('0x2d')]:undefined,'callbackat':_0x95ee08[_0xda17('0x2d')]?moment()['format'](_0xda17('0x1c')):undefined,'CampaignId':_0x3bb09e['id']})[_0xda17('0x2e')](_0x50f3ff());}}}});})[_0xda17('0x21')](function(){return _0x24beec[_0xda17('0x41')][_0xda17('0x35')]({'attributes':['id'],'include':[{'model':_0x24beec[_0xda17('0x38')],'as':_0xda17('0x3d'),'where':{'id':_0x95ee08[_0xda17('0x2b')]}}]})[_0xda17('0x21')](function(_0x5c0756){if(_0x5c0756){var _0x5bb7c9=[];for(var _0x36842f=0x0,_0x25aa7d;_0x36842f<_0x5c0756['length'];_0x36842f+=0x1){_0x25aa7d=_0x5c0756[_0x36842f][_0xda17('0x15')]({'plain':!![]});_0x24beec['CmHopperBlack'][_0xda17('0x2a')]({'phone':_0x95ee08['phone'],'ContactId':_0x95ee08['id'],'ListId':_0x95ee08[_0xda17('0x2b')],'CampaignId':_0x25aa7d['id']})[_0xda17('0x2e')](function(_0x50c208){logger[_0xda17('0x16')]('cmContact,\x20%s,\x20%s',_0xda17('0x18'),_0x50c208['message']);});}}});})['then'](function(){_0x4c8981();})[_0xda17('0x2e')](function(_0x3cc3f8){logger['error'](_0xda17('0x3f'),_0xda17('0x18'),_0x3cc3f8['message']);_0x4c8981(_0x3cc3f8);});}else{_0x4c8981(new Error(_0xda17('0x42')));}},'afterDestroy':function(_0x542169,_0x5e58a4,_0x4eb55a){var _0xfeb06=_0x5a214e[_0xda17('0x14')];var _0x415049=_0x542169['get']({'plain':!![]});return _0xfeb06[_0xda17('0x29')][_0xda17('0x35')]({'raw':!![],'where':{'ListId':_0x415049['ListId'],'ContactId':_0x415049['id']}})[_0xda17('0x21')](function(_0x22dd29){if(!_['isEmpty'](_0x22dd29)){var _0x577be4=[];for(var _0x2352d4=0x0;_0x2352d4<_0x22dd29[_0xda17('0x3a')];_0x2352d4+=0x1){var _0x203743=_0xfeb06[_0xda17('0x29')][_0xda17('0x43')]({'where':{'ListId':_0x22dd29[_0x2352d4][_0xda17('0x2b')],'ContactId':_0x22dd29[_0x2352d4][_0xda17('0x44')],'VoiceQueueId':_0x22dd29[_0x2352d4][_0xda17('0x45')],'CampaignId':_0x22dd29[_0x2352d4][_0xda17('0x46')]}});_0x577be4[_0xda17('0x47')](_0x203743);}return BPromise[_0xda17('0x48')](_0x577be4);}})['then'](function(_0x35a81f){logger[_0xda17('0x49')](_0xda17('0x4a'),util[_0xda17('0x19')](_0x35a81f,{'showHidden':![],'depth':null}));_0x4eb55a();})[_0xda17('0x2e')](function(_0x3c97c8){logger[_0xda17('0x16')](_0xda17('0x4b'),util[_0xda17('0x19')](_0x3c97c8,{'showHidden':![],'depth':null}));_0x4eb55a(_0x3c97c8);});}}});};
\ No newline at end of file
index 940da90..cbe41a3 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(_0x4ac9f8,_0x4d62ff){var _0x27193a=function(_0x3dd106){while(--_0x3dd106){_0x4ac9f8['push'](_0x4ac9f8['shift']());}};_0x27193a(++_0x4d62ff);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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(_0x218625,_0x1ca426){var _0x12f715=function(_0x3dec91){while(--_0x3dec91){_0x218625['push'](_0x218625['shift']());}};_0x12f715(++_0x1ca426);}(_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 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 f198ffa..69c3dfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 a1243e8..7023233 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(_0x21de31,_0x438a0f){var _0x40eeb0=function(_0x3d40ab){while(--_0x3d40ab){_0x21de31['push'](_0x21de31['shift']());}};_0x40eeb0(++_0x438a0f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x5b9187,_0x23fa04){var _0x2c7bc1=function(_0x473d53){while(--_0x473d53){_0x5b9187['push'](_0x5b9187['shift']());}};_0x2c7bc1(++_0x23fa04);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 c4e3001..2f3c9e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3b0=['INTEGER','STRING','PHONE','sequelize','exports'];(function(_0x4ce3d6,_0x4ccc6c){var _0x409e4d=function(_0x1d75f3){while(--_0x1d75f3){_0x4ce3d6['push'](_0x4ce3d6['shift']());}};_0x409e4d(++_0x4ccc6c);}(_0xc3b0,0x166));var _0x0c3b=function(_0x16d48f,_0x252bc1){_0x16d48f=_0x16d48f-0x0;var _0x5a7268=_0xc3b0[_0x16d48f];return _0x5a7268;};'use strict';var Sequelize=require(_0x0c3b('0x0'));module[_0x0c3b('0x1')]={'CmContactId':{'type':Sequelize[_0x0c3b('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x0c3b('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x0c3b('0x4')},'OrderBy':{'type':Sequelize[_0x0c3b('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}};
\ No newline at end of file
+var _0x6c96=['PHONE','sequelize','INTEGER','STRING'];(function(_0xb7b1b5,_0x201bc3){var _0x5e6fd4=function(_0x376d4b){while(--_0x376d4b){_0xb7b1b5['push'](_0xb7b1b5['shift']());}};_0x5e6fd4(++_0x201bc3);}(_0x6c96,0x1c1));var _0x66c9=function(_0x386338,_0x125e92){_0x386338=_0x386338-0x0;var _0xb48872=_0x6c96[_0x386338];return _0xb48872;};'use strict';var Sequelize=require(_0x66c9('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0x66c9('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x66c9('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x66c9('0x2')],'defaultValue':_0x66c9('0x3')},'OrderBy':{'type':Sequelize[_0x66c9('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0x66c9('0x2')],'defaultValue':null}};
\ No newline at end of file
index b1bacb9..e5aef60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12b7=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','get','CmContactHasItems','then','error','stack','name','send','index','map','CmContactHasItem','fieldName','key','query','keys','model','attributes','intersection','fields','nolimit','order','sort','where','filters','pick','merge','type','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user'];(function(_0x44623b,_0x3da7be){var _0x47b245=function(_0x340e8a){while(--_0x340e8a){_0x44623b['push'](_0x44623b['shift']());}};_0x47b245(++_0x3da7be);}(_0x12b7,0x1e0));var _0x712b=function(_0x3e39b0,_0x5a9014){_0x3e39b0=_0x3e39b0-0x0;var _0x227a69=_0x12b7[_0x3e39b0];return _0x227a69;};'use strict';var emlformat=require(_0x712b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x712b('0x1'));var jsonpatch=require(_0x712b('0x2'));var rp=require(_0x712b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x712b('0x4'));var util=require(_0x712b('0x5'));var path=require(_0x712b('0x6'));var sox=require(_0x712b('0x7'));var csv=require(_0x712b('0x8'));var ejs=require(_0x712b('0x9'));var fs=require('fs');var fs_extra=require(_0x712b('0xa'));var _=require(_0x712b('0xb'));var squel=require(_0x712b('0xc'));var crypto=require(_0x712b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x712b('0xe'));var toCsv=require(_0x712b('0x8'));var querystring=require(_0x712b('0xf'));var Papa=require(_0x712b('0x10'));var Redis=require(_0x712b('0x11'));var authService=require(_0x712b('0x12'));var qs=require(_0x712b('0x13'));var as=require(_0x712b('0x14'));var hardwareService=require(_0x712b('0x15'));var logger=require('../../config/logger')(_0x712b('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x712b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17c366,_0x514860){_0x514860=_0x514860||0xcc;return function(_0x2815c0){if(_0x2815c0){return _0x17c366['sendStatus'](_0x514860);}return _0x17c366['status'](_0x514860)[_0x712b('0x18')]();};}function respondWithResult(_0x189ae2,_0xd48d2f){_0xd48d2f=_0xd48d2f||0xc8;return function(_0x6a0fd2){if(_0x6a0fd2){return _0x189ae2[_0x712b('0x19')](_0xd48d2f)[_0x712b('0x1a')](_0x6a0fd2);}};}function respondWithFilteredResult(_0x5cf134,_0x155ef8){return function(_0x4545d7){if(_0x4545d7){var _0x51c985=typeof _0x155ef8[_0x712b('0x1b')]===_0x712b('0x1c')&&typeof _0x155ef8[_0x712b('0x1d')]==='undefined';var _0x310b7b=_0x4545d7[_0x712b('0x1e')];var _0x3e3d32=_0x51c985?0x0:_0x155ef8['offset'];var _0x34ef62=_0x51c985?_0x4545d7[_0x712b('0x1e')]:_0x155ef8[_0x712b('0x1b')]+_0x155ef8['limit'];var _0x42e886;if(_0x34ef62>=_0x310b7b){_0x34ef62=_0x310b7b;_0x42e886=0xc8;}else{_0x42e886=0xce;}_0x5cf134[_0x712b('0x19')](_0x42e886);return _0x5cf134[_0x712b('0x1f')](_0x712b('0x20'),_0x3e3d32+'-'+_0x34ef62+'/'+_0x310b7b)['json'](_0x4545d7);}return null;};}function patchUpdates(_0x11fc9c){return function(_0x2198b1){try{jsonpatch[_0x712b('0x21')](_0x2198b1,_0x11fc9c,!![]);}catch(_0x2cbf5f){return BPromise['reject'](_0x2cbf5f);}return _0x2198b1['save']();};}function saveUpdates(_0x1f20ae,_0x1d595f){return function(_0x4de227){if(_0x4de227){return _0x4de227['update'](_0x1f20ae)['then'](function(_0x279c95){return _0x279c95;});}return null;};}function removeEntity(_0x57be3d,_0x3edc95){return function(_0x932244){if(_0x932244){return _0x932244[_0x712b('0x22')]()['then'](function(){var _0xd487d1=_0x932244[_0x712b('0x23')]({'plain':!![]});var _0xbfbffb=_0x712b('0x24');return db['UserProfileResource'][_0x712b('0x22')]({'where':{'type':_0xbfbffb,'resourceId':_0xd487d1['id']}})[_0x712b('0x25')](function(){return _0x932244;});})['then'](function(){_0x57be3d[_0x712b('0x19')](0xcc)[_0x712b('0x18')]();});}};}function handleEntityNotFound(_0x184717,_0x3633c1){return function(_0x1c7b23){if(!_0x1c7b23){_0x184717['sendStatus'](0x194);}return _0x1c7b23;};}function handleError(_0x1e468b,_0x38ef33){_0x38ef33=_0x38ef33||0x1f4;return function(_0x43646f){logger[_0x712b('0x26')](_0x43646f[_0x712b('0x27')]);if(_0x43646f[_0x712b('0x28')]){delete _0x43646f[_0x712b('0x28')];}_0x1e468b[_0x712b('0x19')](_0x38ef33)[_0x712b('0x29')](_0x43646f);};}exports[_0x712b('0x2a')]=function(_0x470927,_0x20fbce){var _0x297765={},_0x2c3a86={},_0x6edaed={'count':0x0,'rows':[]};var _0xad1f21=_[_0x712b('0x2b')](db[_0x712b('0x2c')]['rawAttributes'],function(_0x38ff61){return{'name':_0x38ff61[_0x712b('0x2d')],'type':_0x38ff61['type'][_0x712b('0x2e')]};});_0x2c3a86['model']=_[_0x712b('0x2b')](_0xad1f21,_0x712b('0x28'));_0x2c3a86[_0x712b('0x2f')]=_[_0x712b('0x30')](_0x470927['query']);_0x2c3a86['filters']=_['intersection'](_0x2c3a86[_0x712b('0x31')],_0x2c3a86[_0x712b('0x2f')]);_0x297765[_0x712b('0x32')]=_[_0x712b('0x33')](_0x2c3a86[_0x712b('0x31')],qs[_0x712b('0x34')](_0x470927[_0x712b('0x2f')]['fields']));_0x297765[_0x712b('0x32')]=_0x297765[_0x712b('0x32')]['length']?_0x297765[_0x712b('0x32')]:_0x2c3a86['model'];if(!_0x470927[_0x712b('0x2f')]['hasOwnProperty'](_0x712b('0x35'))){_0x297765[_0x712b('0x1d')]=qs[_0x712b('0x1d')](_0x470927[_0x712b('0x2f')][_0x712b('0x1d')]);_0x297765[_0x712b('0x1b')]=qs['offset'](_0x470927['query'][_0x712b('0x1b')]);}_0x297765[_0x712b('0x36')]=qs[_0x712b('0x37')](_0x470927[_0x712b('0x2f')][_0x712b('0x37')]);_0x297765[_0x712b('0x38')]=qs[_0x712b('0x39')](_[_0x712b('0x3a')](_0x470927[_0x712b('0x2f')],_0x2c3a86[_0x712b('0x39')]),_0xad1f21);if(_0x470927[_0x712b('0x2f')]['filter']){_0x297765[_0x712b('0x38')]=_[_0x712b('0x3b')](_0x297765['where'],{'$or':_[_0x712b('0x2b')](_0xad1f21,function(_0x602b55){if(_0x602b55[_0x712b('0x3c')]!=='VIRTUAL'){var _0x147b72={};_0x147b72[_0x602b55[_0x712b('0x28')]]={'$like':'%'+_0x470927[_0x712b('0x2f')][_0x712b('0x3d')]+'%'};return _0x147b72;}})});}_0x297765=_[_0x712b('0x3b')]({},_0x297765,_0x470927['options']);var _0x44c50c={'where':_0x297765['where']};return db['CmContactHasItem'][_0x712b('0x1e')](_0x44c50c)[_0x712b('0x25')](function(_0x74c531){_0x6edaed[_0x712b('0x1e')]=_0x74c531;if(_0x470927[_0x712b('0x2f')][_0x712b('0x3e')]){_0x297765[_0x712b('0x3f')]=[{'all':!![]}];}return db[_0x712b('0x2c')][_0x712b('0x40')](_0x297765);})[_0x712b('0x25')](function(_0x35e6df){_0x6edaed[_0x712b('0x41')]=_0x35e6df;return _0x6edaed;})[_0x712b('0x25')](respondWithFilteredResult(_0x20fbce,_0x297765))[_0x712b('0x42')](handleError(_0x20fbce,null));};exports[_0x712b('0x43')]=function(_0x288142,_0x5299ff){var _0x2f0faa={'raw':!![],'where':{'id':_0x288142[_0x712b('0x44')]['id']}},_0x466acd={};_0x466acd['model']=_[_0x712b('0x30')](db[_0x712b('0x2c')][_0x712b('0x45')]);_0x466acd[_0x712b('0x2f')]=_[_0x712b('0x30')](_0x288142[_0x712b('0x2f')]);_0x466acd['filters']=_[_0x712b('0x33')](_0x466acd[_0x712b('0x31')],_0x466acd['query']);_0x2f0faa[_0x712b('0x32')]=_[_0x712b('0x33')](_0x466acd[_0x712b('0x31')],qs[_0x712b('0x34')](_0x288142[_0x712b('0x2f')][_0x712b('0x34')]));_0x2f0faa[_0x712b('0x32')]=_0x2f0faa[_0x712b('0x32')]['length']?_0x2f0faa[_0x712b('0x32')]:_0x466acd[_0x712b('0x31')];if(_0x288142[_0x712b('0x2f')][_0x712b('0x3e')]){_0x2f0faa['include']=[{'all':!![]}];}_0x2f0faa=_['merge']({},_0x2f0faa,_0x288142['options']);return db[_0x712b('0x2c')][_0x712b('0x46')](_0x2f0faa)[_0x712b('0x25')](handleEntityNotFound(_0x5299ff,null))[_0x712b('0x25')](respondWithResult(_0x5299ff,null))[_0x712b('0x42')](handleError(_0x5299ff,null));};exports['create']=function(_0x3c48a4,_0x28cbf7){return db[_0x712b('0x2c')][_0x712b('0x47')](_0x3c48a4['body'],{})[_0x712b('0x25')](function(_0x4dab7d){var _0x555e86=_0x3c48a4[_0x712b('0x48')][_0x712b('0x23')]({'plain':!![]});if(!_0x555e86)throw new Error(_0x712b('0x49'));if(_0x555e86[_0x712b('0x4a')]===_0x712b('0x48')){var _0x2ac56e=_0x4dab7d[_0x712b('0x23')]({'plain':!![]});var _0x3bd379=_0x712b('0x24');return db[_0x712b('0x4b')]['find']({'where':{'name':_0x3bd379,'userProfileId':_0x555e86[_0x712b('0x4c')]},'raw':!![]})[_0x712b('0x25')](function(_0xf54df4){if(_0xf54df4&&_0xf54df4['autoAssociation']===0x0){return db[_0x712b('0x4d')][_0x712b('0x47')]({'name':_0x2ac56e[_0x712b('0x28')],'resourceId':_0x2ac56e['id'],'type':_0xf54df4[_0x712b('0x28')],'sectionId':_0xf54df4['id']},{})['then'](function(){return _0x4dab7d;});}else{return _0x4dab7d;}})[_0x712b('0x42')](function(_0x35e2b8){logger[_0x712b('0x26')](_0x712b('0x4e'),_0x35e2b8);throw _0x35e2b8;});}return _0x4dab7d;})[_0x712b('0x25')](respondWithResult(_0x28cbf7,0xc9))[_0x712b('0x42')](handleError(_0x28cbf7,null));};exports['update']=function(_0x3dd75b,_0x30084b){if(_0x3dd75b['body']['id']){delete _0x3dd75b['body']['id'];}return db['CmContactHasItem'][_0x712b('0x46')]({'where':{'id':_0x3dd75b[_0x712b('0x44')]['id']}})[_0x712b('0x25')](handleEntityNotFound(_0x30084b,null))[_0x712b('0x25')](saveUpdates(_0x3dd75b['body'],null))[_0x712b('0x25')](respondWithResult(_0x30084b,null))['catch'](handleError(_0x30084b,null));};exports['destroy']=function(_0x3f425d,_0x5987d8){return db[_0x712b('0x2c')]['find']({'where':{'id':_0x3f425d[_0x712b('0x44')]['id']}})[_0x712b('0x25')](handleEntityNotFound(_0x5987d8,null))[_0x712b('0x25')](removeEntity(_0x5987d8,null))[_0x712b('0x42')](handleError(_0x5987d8,null));};
\ No newline at end of file
+var _0xf89e=['name','send','index','CmContactHasItem','rawAttributes','type','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','catch','show','keys','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','CmContactHasItems','UserProfileResource','error','stack'];(function(_0x58e9c6,_0x5a0779){var _0x7bed7f=function(_0xc517d){while(--_0xc517d){_0x58e9c6['push'](_0x58e9c6['shift']());}};_0x7bed7f(++_0x5a0779);}(_0xf89e,0x7d));var _0xef89=function(_0x5711df,_0x514b3b){_0x5711df=_0x5711df-0x0;var _0x29680d=_0xf89e[_0x5711df];return _0x29680d;};'use strict';var emlformat=require(_0xef89('0x0'));var rimraf=require(_0xef89('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xef89('0x2'));var Mustache=require(_0xef89('0x3'));var util=require(_0xef89('0x4'));var path=require(_0xef89('0x5'));var sox=require(_0xef89('0x6'));var csv=require(_0xef89('0x7'));var ejs=require(_0xef89('0x8'));var fs=require('fs');var fs_extra=require(_0xef89('0x9'));var _=require('lodash');var squel=require(_0xef89('0xa'));var crypto=require('crypto');var jsforce=require(_0xef89('0xb'));var deskjs=require(_0xef89('0xc'));var toCsv=require(_0xef89('0x7'));var querystring=require(_0xef89('0xd'));var Papa=require(_0xef89('0xe'));var Redis=require(_0xef89('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xef89('0x10'));var as=require(_0xef89('0x11'));var hardwareService=require(_0xef89('0x12'));var logger=require(_0xef89('0x13'))(_0xef89('0x14'));var utils=require(_0xef89('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xef89('0x16'));var db=require(_0xef89('0x17'))['db'];function respondWithStatusCode(_0x3a818e,_0x5554b6){_0x5554b6=_0x5554b6||0xcc;return function(_0x4d5d95){if(_0x4d5d95){return _0x3a818e[_0xef89('0x18')](_0x5554b6);}return _0x3a818e[_0xef89('0x19')](_0x5554b6)[_0xef89('0x1a')]();};}function respondWithResult(_0x123f3c,_0x1d89ea){_0x1d89ea=_0x1d89ea||0xc8;return function(_0x1927bd){if(_0x1927bd){return _0x123f3c['status'](_0x1d89ea)['json'](_0x1927bd);}};}function respondWithFilteredResult(_0x9d5094,_0x29bf8f){return function(_0x197667){if(_0x197667){var _0x56abc5=typeof _0x29bf8f[_0xef89('0x1b')]===_0xef89('0x1c')&&typeof _0x29bf8f[_0xef89('0x1d')]===_0xef89('0x1c');var _0x39fb4b=_0x197667[_0xef89('0x1e')];var _0x121433=_0x56abc5?0x0:_0x29bf8f['offset'];var _0x3b818b=_0x56abc5?_0x197667['count']:_0x29bf8f[_0xef89('0x1b')]+_0x29bf8f[_0xef89('0x1d')];var _0x46831a;if(_0x3b818b>=_0x39fb4b){_0x3b818b=_0x39fb4b;_0x46831a=0xc8;}else{_0x46831a=0xce;}_0x9d5094['status'](_0x46831a);return _0x9d5094['set'](_0xef89('0x1f'),_0x121433+'-'+_0x3b818b+'/'+_0x39fb4b)[_0xef89('0x20')](_0x197667);}return null;};}function patchUpdates(_0x2f7f1b){return function(_0xebf56d){try{jsonpatch[_0xef89('0x21')](_0xebf56d,_0x2f7f1b,!![]);}catch(_0x29a8ec){return BPromise[_0xef89('0x22')](_0x29a8ec);}return _0xebf56d[_0xef89('0x23')]();};}function saveUpdates(_0x47011d,_0x4a3976){return function(_0x8b22f9){if(_0x8b22f9){return _0x8b22f9[_0xef89('0x24')](_0x47011d)[_0xef89('0x25')](function(_0xead7f1){return _0xead7f1;});}return null;};}function removeEntity(_0x1cca41,_0x390222){return function(_0x405c81){if(_0x405c81){return _0x405c81[_0xef89('0x26')]()['then'](function(){var _0x146add=_0x405c81['get']({'plain':!![]});var _0x3b63a2=_0xef89('0x27');return db[_0xef89('0x28')]['destroy']({'where':{'type':_0x3b63a2,'resourceId':_0x146add['id']}})[_0xef89('0x25')](function(){return _0x405c81;});})[_0xef89('0x25')](function(){_0x1cca41[_0xef89('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a0333,_0x1fe825){return function(_0x5002f9){if(!_0x5002f9){_0x2a0333['sendStatus'](0x194);}return _0x5002f9;};}function handleError(_0x5bc297,_0x580cb7){_0x580cb7=_0x580cb7||0x1f4;return function(_0x33c1f4){logger[_0xef89('0x29')](_0x33c1f4[_0xef89('0x2a')]);if(_0x33c1f4[_0xef89('0x2b')]){delete _0x33c1f4[_0xef89('0x2b')];}_0x5bc297[_0xef89('0x19')](_0x580cb7)[_0xef89('0x2c')](_0x33c1f4);};}exports[_0xef89('0x2d')]=function(_0x20c04b,_0x4dd628){var _0x2cc3d8={},_0x4bf006={},_0x8c02ca={'count':0x0,'rows':[]};var _0x501286=_['map'](db[_0xef89('0x2e')][_0xef89('0x2f')],function(_0xa34b67){return{'name':_0xa34b67['fieldName'],'type':_0xa34b67[_0xef89('0x30')]['key']};});_0x4bf006[_0xef89('0x31')]=_[_0xef89('0x32')](_0x501286,_0xef89('0x2b'));_0x4bf006[_0xef89('0x33')]=_['keys'](_0x20c04b[_0xef89('0x33')]);_0x4bf006['filters']=_[_0xef89('0x34')](_0x4bf006[_0xef89('0x31')],_0x4bf006[_0xef89('0x33')]);_0x2cc3d8[_0xef89('0x35')]=_[_0xef89('0x34')](_0x4bf006[_0xef89('0x31')],qs[_0xef89('0x36')](_0x20c04b[_0xef89('0x33')][_0xef89('0x36')]));_0x2cc3d8[_0xef89('0x35')]=_0x2cc3d8[_0xef89('0x35')][_0xef89('0x37')]?_0x2cc3d8[_0xef89('0x35')]:_0x4bf006[_0xef89('0x31')];if(!_0x20c04b['query'][_0xef89('0x38')](_0xef89('0x39'))){_0x2cc3d8[_0xef89('0x1d')]=qs[_0xef89('0x1d')](_0x20c04b['query']['limit']);_0x2cc3d8[_0xef89('0x1b')]=qs[_0xef89('0x1b')](_0x20c04b['query'][_0xef89('0x1b')]);}_0x2cc3d8[_0xef89('0x3a')]=qs[_0xef89('0x3b')](_0x20c04b[_0xef89('0x33')]['sort']);_0x2cc3d8[_0xef89('0x3c')]=qs[_0xef89('0x3d')](_[_0xef89('0x3e')](_0x20c04b['query'],_0x4bf006[_0xef89('0x3d')]),_0x501286);if(_0x20c04b[_0xef89('0x33')]['filter']){_0x2cc3d8['where']=_['merge'](_0x2cc3d8[_0xef89('0x3c')],{'$or':_['map'](_0x501286,function(_0x50ee9d){if(_0x50ee9d[_0xef89('0x30')]!=='VIRTUAL'){var _0x19944b={};_0x19944b[_0x50ee9d[_0xef89('0x2b')]]={'$like':'%'+_0x20c04b['query'][_0xef89('0x3f')]+'%'};return _0x19944b;}})});}_0x2cc3d8=_[_0xef89('0x40')]({},_0x2cc3d8,_0x20c04b[_0xef89('0x41')]);var _0xcfa3a0={'where':_0x2cc3d8['where']};return db[_0xef89('0x2e')][_0xef89('0x1e')](_0xcfa3a0)[_0xef89('0x25')](function(_0x4140a9){_0x8c02ca[_0xef89('0x1e')]=_0x4140a9;if(_0x20c04b[_0xef89('0x33')][_0xef89('0x42')]){_0x2cc3d8['include']=[{'all':!![]}];}return db[_0xef89('0x2e')][_0xef89('0x43')](_0x2cc3d8);})[_0xef89('0x25')](function(_0x1a3c5b){_0x8c02ca['rows']=_0x1a3c5b;return _0x8c02ca;})[_0xef89('0x25')](respondWithFilteredResult(_0x4dd628,_0x2cc3d8))[_0xef89('0x44')](handleError(_0x4dd628,null));};exports[_0xef89('0x45')]=function(_0x51eeb1,_0x6aa6c4){var _0x13332b={'raw':!![],'where':{'id':_0x51eeb1['params']['id']}},_0x4d3fd3={};_0x4d3fd3[_0xef89('0x31')]=_[_0xef89('0x46')](db['CmContactHasItem']['rawAttributes']);_0x4d3fd3[_0xef89('0x33')]=_[_0xef89('0x46')](_0x51eeb1[_0xef89('0x33')]);_0x4d3fd3[_0xef89('0x3d')]=_[_0xef89('0x34')](_0x4d3fd3['model'],_0x4d3fd3['query']);_0x13332b[_0xef89('0x35')]=_[_0xef89('0x34')](_0x4d3fd3[_0xef89('0x31')],qs[_0xef89('0x36')](_0x51eeb1['query']['fields']));_0x13332b['attributes']=_0x13332b['attributes']['length']?_0x13332b[_0xef89('0x35')]:_0x4d3fd3['model'];if(_0x51eeb1[_0xef89('0x33')][_0xef89('0x42')]){_0x13332b[_0xef89('0x47')]=[{'all':!![]}];}_0x13332b=_['merge']({},_0x13332b,_0x51eeb1[_0xef89('0x41')]);return db['CmContactHasItem'][_0xef89('0x48')](_0x13332b)[_0xef89('0x25')](handleEntityNotFound(_0x6aa6c4,null))['then'](respondWithResult(_0x6aa6c4,null))[_0xef89('0x44')](handleError(_0x6aa6c4,null));};exports[_0xef89('0x49')]=function(_0x12c141,_0x287a65){return db[_0xef89('0x2e')][_0xef89('0x49')](_0x12c141[_0xef89('0x4a')],{})[_0xef89('0x25')](function(_0x268767){var _0xb79c8f=_0x12c141[_0xef89('0x4b')][_0xef89('0x4c')]({'plain':!![]});if(!_0xb79c8f)throw new Error(_0xef89('0x4d'));if(_0xb79c8f[_0xef89('0x4e')]===_0xef89('0x4b')){var _0xca77c=_0x268767[_0xef89('0x4c')]({'plain':!![]});var _0x1cabf1=_0xef89('0x27');return db[_0xef89('0x4f')]['find']({'where':{'name':_0x1cabf1,'userProfileId':_0xb79c8f[_0xef89('0x50')]},'raw':!![]})[_0xef89('0x25')](function(_0x3bd391){if(_0x3bd391&&_0x3bd391[_0xef89('0x51')]===0x0){return db[_0xef89('0x28')]['create']({'name':_0xca77c[_0xef89('0x2b')],'resourceId':_0xca77c['id'],'type':_0x3bd391[_0xef89('0x2b')],'sectionId':_0x3bd391['id']},{})['then'](function(){return _0x268767;});}else{return _0x268767;}})[_0xef89('0x44')](function(_0x3406df){logger[_0xef89('0x29')](_0xef89('0x52'),_0x3406df);throw _0x3406df;});}return _0x268767;})[_0xef89('0x25')](respondWithResult(_0x287a65,0xc9))[_0xef89('0x44')](handleError(_0x287a65,null));};exports[_0xef89('0x24')]=function(_0xa32b02,_0x590463){if(_0xa32b02[_0xef89('0x4a')]['id']){delete _0xa32b02[_0xef89('0x4a')]['id'];}return db['CmContactHasItem'][_0xef89('0x48')]({'where':{'id':_0xa32b02[_0xef89('0x53')]['id']}})[_0xef89('0x25')](handleEntityNotFound(_0x590463,null))[_0xef89('0x25')](saveUpdates(_0xa32b02['body'],null))[_0xef89('0x25')](respondWithResult(_0x590463,null))[_0xef89('0x44')](handleError(_0x590463,null));};exports['destroy']=function(_0x381739,_0x31a156){return db[_0xef89('0x2e')]['find']({'where':{'id':_0x381739[_0xef89('0x53')]['id']}})[_0xef89('0x25')](handleEntityNotFound(_0x31a156,null))['then'](removeEntity(_0x31a156,null))[_0xef89('0x44')](handleError(_0x31a156,null));};
\ No newline at end of file
index 723e457..039bca1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa1f=['rimraf','./cmContactHasItem.attributes','define','CmContactHasItem','lodash','util','api','bluebird','path'];(function(_0x5c68b1,_0x210d5a){var _0x42dcef=function(_0x196a31){while(--_0x196a31){_0x5c68b1['push'](_0x5c68b1['shift']());}};_0x42dcef(++_0x210d5a);}(_0xfa1f,0x136));var _0xffa1=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0xfa1f[_0xbc4560];return _0x298cfb;};'use strict';var _=require(_0xffa1('0x0'));var util=require(_0xffa1('0x1'));var logger=require('../../config/logger')(_0xffa1('0x2'));var moment=require('moment');var BPromise=require(_0xffa1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xffa1('0x4'));var rimraf=require(_0xffa1('0x5'));var config=require('../../config/environment');var attributes=require(_0xffa1('0x6'));module['exports']=function(_0x1f509c,_0xb93165){return _0x1f509c[_0xffa1('0x7')](_0xffa1('0x8'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f74=['./cmContactHasItem.attributes','define','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x69e6e4,_0x31bca3){var _0x1ee39d=function(_0x28c887){while(--_0x28c887){_0x69e6e4['push'](_0x69e6e4['shift']());}};_0x1ee39d(++_0x31bca3);}(_0x9f74,0x110));var _0x49f7=function(_0x16892,_0x3808ad){_0x16892=_0x16892-0x0;var _0x4fcbb2=_0x9f74[_0x16892];return _0x4fcbb2;};'use strict';var _=require(_0x49f7('0x0'));var util=require('util');var logger=require(_0x49f7('0x1'))(_0x49f7('0x2'));var moment=require(_0x49f7('0x3'));var BPromise=require(_0x49f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x49f7('0x5'));var rimraf=require(_0x49f7('0x6'));var config=require(_0x49f7('0x7'));var attributes=require(_0x49f7('0x8'));module['exports']=function(_0x3d84ec,_0x310c8d){return _0x3d84ec[_0x49f7('0x9')]('CmContactHasItem',attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fc163c3..a6f384f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x457b=['info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2ac5c7,_0x21a0a5){var _0x1bd226=function(_0x9a4f69){while(--_0x9a4f69){_0x2ac5c7['push'](_0x2ac5c7['shift']());}};_0x1bd226(++_0x21a0a5);}(_0x457b,0x11d));var _0xb457=function(_0x2847d0,_0x10a787){_0x2847d0=_0x2847d0-0x0;var _0x1cc209=_0x457b[_0x2847d0];return _0x1cc209;};'use strict';var _=require(_0xb457('0x0'));var util=require('util');var moment=require(_0xb457('0x1'));var BPromise=require(_0xb457('0x2'));var rs=require(_0xb457('0x3'));var fs=require('fs');var Redis=require(_0xb457('0x4'));var db=require(_0xb457('0x5'))['db'];var utils=require(_0xb457('0x6'));var logger=require(_0xb457('0x7'))('rpc');var config=require(_0xb457('0x8'));var jayson=require(_0xb457('0x9'));var client=jayson[_0xb457('0xa')][_0xb457('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bc1fe,_0x2cc961,_0x1163a0){return new BPromise(function(_0x40da17,_0x129a70){return client[_0xb457('0xc')](_0x5bc1fe,_0x1163a0)[_0xb457('0xd')](function(_0x2dcf4b){logger[_0xb457('0xe')](_0xb457('0xf'),_0x2cc961,_0xb457('0x10'));logger[_0xb457('0x11')](_0xb457('0x12'),_0x2cc961,_0xb457('0x10'),JSON['stringify'](_0x2dcf4b));if(_0x2dcf4b[_0xb457('0x13')]){if(_0x2dcf4b[_0xb457('0x13')][_0xb457('0x14')]===0x1f4){logger[_0xb457('0x13')](_0xb457('0xf'),_0x2cc961,_0x2dcf4b['error'][_0xb457('0x15')]);return _0x129a70(_0x2dcf4b[_0xb457('0x13')][_0xb457('0x15')]);}logger[_0xb457('0x13')]('CmContactHasItem,\x20%s,\x20%s',_0x2cc961,_0x2dcf4b[_0xb457('0x13')][_0xb457('0x15')]);return _0x40da17(_0x2dcf4b['error'][_0xb457('0x15')]);}else{logger[_0xb457('0xe')](_0xb457('0xf'),_0x2cc961,_0xb457('0x10'));_0x40da17(_0x2dcf4b[_0xb457('0x16')]['message']);}})['catch'](function(_0xa64862){logger[_0xb457('0x13')](_0xb457('0xf'),_0x2cc961,_0xa64862);_0x129a70(_0xa64862);});});}
\ No newline at end of file
+var _0xba44=['CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info'];(function(_0x34c085,_0x237aac){var _0x168511=function(_0x47610d){while(--_0x47610d){_0x34c085['push'](_0x34c085['shift']());}};_0x168511(++_0x237aac);}(_0xba44,0x12d));var _0x4ba4=function(_0x2e0fca,_0x336a9f){_0x2e0fca=_0x2e0fca-0x0;var _0x31a245=_0xba44[_0x2e0fca];return _0x31a245;};'use strict';var _=require(_0x4ba4('0x0'));var util=require(_0x4ba4('0x1'));var moment=require(_0x4ba4('0x2'));var BPromise=require(_0x4ba4('0x3'));var rs=require(_0x4ba4('0x4'));var fs=require('fs');var Redis=require(_0x4ba4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ba4('0x6'));var logger=require('../../config/logger')(_0x4ba4('0x7'));var config=require('../../config/environment');var jayson=require(_0x4ba4('0x8'));var client=jayson[_0x4ba4('0x9')][_0x4ba4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10942b,_0x2b5bfe,_0x241159){return new BPromise(function(_0xa373eb,_0xf03dfa){return client[_0x4ba4('0xb')](_0x10942b,_0x241159)[_0x4ba4('0xc')](function(_0x22849c){logger[_0x4ba4('0xd')](_0x4ba4('0xe'),_0x2b5bfe,_0x4ba4('0xf'));logger[_0x4ba4('0x10')](_0x4ba4('0x11'),_0x2b5bfe,_0x4ba4('0xf'),JSON['stringify'](_0x22849c));if(_0x22849c[_0x4ba4('0x12')]){if(_0x22849c[_0x4ba4('0x12')]['code']===0x1f4){logger[_0x4ba4('0x12')](_0x4ba4('0xe'),_0x2b5bfe,_0x22849c['error']['message']);return _0xf03dfa(_0x22849c[_0x4ba4('0x12')][_0x4ba4('0x13')]);}logger[_0x4ba4('0x12')](_0x4ba4('0xe'),_0x2b5bfe,_0x22849c['error'][_0x4ba4('0x13')]);return _0xa373eb(_0x22849c['error'][_0x4ba4('0x13')]);}else{logger[_0x4ba4('0xd')]('CmContactHasItem,\x20%s,\x20%s',_0x2b5bfe,_0x4ba4('0xf'));_0xa373eb(_0x22849c[_0x4ba4('0x14')][_0x4ba4('0x13')]);}})['catch'](function(_0x4a5683){logger['error'](_0x4ba4('0xe'),_0x2b5bfe,_0x4a5683);_0xf03dfa(_0x4a5683);});});}
\ No newline at end of file
index 3633834..fb4ef97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4fb=['fs-extra','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','index','/:id','show','isAuthenticated','create','delete','destroy','exports','multer','path','Router'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0xf4fb,0x12d));var _0xbf4f=function(_0xacbf57,_0x2fd3c2){_0xacbf57=_0xacbf57-0x0;var _0x5a5101=_0xf4fb[_0xacbf57];return _0x5a5101;};'use strict';var multer=require(_0xbf4f('0x0'));var util=require('util');var path=require(_0xbf4f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4f('0x2')]();var fs_extra=require(_0xbf4f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xbf4f('0x4'));var config=require(_0xbf4f('0x5'));var controller=require(_0xbf4f('0x6'));router[_0xbf4f('0x7')]('/',auth['isAuthenticated'](),controller[_0xbf4f('0x8')]);router[_0xbf4f('0x7')](_0xbf4f('0x9'),auth['isAuthenticated'](),controller[_0xbf4f('0xa')]);router['post']('/',auth[_0xbf4f('0xb')](),controller[_0xbf4f('0xc')]);router['put'](_0xbf4f('0x9'),auth[_0xbf4f('0xb')](),controller['update']);router[_0xbf4f('0xd')](_0xbf4f('0x9'),auth[_0xbf4f('0xb')](),controller[_0xbf4f('0xe')]);module[_0xbf4f('0xf')]=router;
\ No newline at end of file
+var _0xbb27=['index','/:id','show','post','create','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','get','isAuthenticated'];(function(_0x403601,_0xf4ce22){var _0x24a37d=function(_0x1509e3){while(--_0x1509e3){_0x403601['push'](_0x403601['shift']());}};_0x24a37d(++_0xf4ce22);}(_0xbb27,0x146));var _0x7bb2=function(_0x1bf3b0,_0x294ec4){_0x1bf3b0=_0x1bf3b0-0x0;var _0x2fa297=_0xbb27[_0x1bf3b0];return _0x2fa297;};'use strict';var multer=require(_0x7bb2('0x0'));var util=require(_0x7bb2('0x1'));var path=require(_0x7bb2('0x2'));var timeout=require('connect-timeout');var express=require(_0x7bb2('0x3'));var router=express[_0x7bb2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7bb2('0x5'));var interaction=require(_0x7bb2('0x6'));var config=require('../../config/environment');var controller=require(_0x7bb2('0x7'));router[_0x7bb2('0x8')]('/',auth[_0x7bb2('0x9')](),controller[_0x7bb2('0xa')]);router[_0x7bb2('0x8')](_0x7bb2('0xb'),auth[_0x7bb2('0x9')](),controller[_0x7bb2('0xc')]);router[_0x7bb2('0xd')]('/',auth[_0x7bb2('0x9')](),controller[_0x7bb2('0xe')]);router['put'](_0x7bb2('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7bb2('0xb'),auth[_0x7bb2('0x9')](),controller['destroy']);module[_0x7bb2('0xf')]=router;
\ No newline at end of file
index b654196..c3dcbb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89d6=['sequelize','lodash','exports','getDataValue','alias','STRING','setDataValue','name','long','select','parse','values','isArray','stringify','BOOLEAN','ENUM','voice'];(function(_0x13afbd,_0x267aee){var _0x67a24=function(_0x1a14c2){while(--_0x1a14c2){_0x13afbd['push'](_0x13afbd['shift']());}};_0x67a24(++_0x267aee);}(_0x89d6,0x121));var _0x689d=function(_0x1ab8ce,_0x4aac2d){_0x1ab8ce=_0x1ab8ce-0x0;var _0x403d2f=_0x89d6[_0x1ab8ce];return _0x403d2f;};'use strict';var Sequelize=require(_0x689d('0x0'));var _=require(_0x689d('0x1'));module[_0x689d('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x45f208){return this[_0x689d('0x3')](_0x689d('0x4'));}},'alias':{'type':Sequelize[_0x689d('0x5')],'allowNull':![],'set':function(_0x4b1790){this[_0x689d('0x6')]('alias',_0x4b1790?_0x4b1790:this['getDataValue'](_0x689d('0x7')));}},'type':{'type':Sequelize[_0x689d('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x689d('0x8')),'get':function(){if(this[_0x689d('0x3')]('type')===_0x689d('0x9')){return JSON[_0x689d('0xa')](this[_0x689d('0x3')](_0x689d('0xb')));}else{return this[_0x689d('0x3')](_0x689d('0xb'));}},'set':function(_0x169615){if(Array[_0x689d('0xc')](_0x169615)){this[_0x689d('0x6')]('values',JSON[_0x689d('0xd')](_0x169615));}else{this['setDataValue'](_0x689d('0xb'),_0x169615);}}},'required':{'type':Sequelize[_0x689d('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x689d('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x689d('0xf')](_0x689d('0x10'))}};
\ No newline at end of file
+var _0xd321=['type','select','parse','values','isArray','ENUM','voice','sequelize','exports','VIRTUAL','getDataValue','STRING','setDataValue','TEXT','long'];(function(_0x1de87f,_0x1639ad){var _0x34a523=function(_0x1c340c){while(--_0x1c340c){_0x1de87f['push'](_0x1de87f['shift']());}};_0x34a523(++_0x1639ad);}(_0xd321,0x17e));var _0x1d32=function(_0x4b5198,_0x1f768d){_0x4b5198=_0x4b5198-0x0;var _0x4c1d1d=_0xd321[_0x4b5198];return _0x4c1d1d;};'use strict';var Sequelize=require(_0x1d32('0x0'));var _=require('lodash');module[_0x1d32('0x1')]={'name':{'type':Sequelize[_0x1d32('0x2')],'get':function(_0x41ac02){return this[_0x1d32('0x3')]('alias');}},'alias':{'type':Sequelize[_0x1d32('0x4')],'allowNull':![],'set':function(_0x3dbeb9){this[_0x1d32('0x5')]('alias',_0x3dbeb9?_0x3dbeb9:this[_0x1d32('0x3')]('name'));}},'type':{'type':Sequelize[_0x1d32('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x1d32('0x6')](_0x1d32('0x7')),'get':function(){if(this[_0x1d32('0x3')](_0x1d32('0x8'))===_0x1d32('0x9')){return JSON[_0x1d32('0xa')](this['getDataValue']('values'));}else{return this[_0x1d32('0x3')](_0x1d32('0xb'));}},'set':function(_0x5aba5b){if(Array[_0x1d32('0xc')](_0x5aba5b)){this[_0x1d32('0x5')]('values',JSON['stringify'](_0x5aba5b));}else{this[_0x1d32('0x5')](_0x1d32('0xb'),_0x5aba5b);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x1d32('0xd')](_0x1d32('0xe'))}};
\ No newline at end of file
index eb42828..12624b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6680=['cf_%d','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','rawAttributes','fieldName','type','key','model','differenceBy','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','CmCustomField','include','findAll','rows','show','params','includeAll','merge','update','body','find','catch','create','sequelize','transaction','Sequelize','TEXT','text','number','switch','defaultValue','queryInterface','addColumn','cm_contacts','format'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x6680,0x17d));var _0x0668=function(_0x42a571,_0x57321c){_0x42a571=_0x42a571-0x0;var _0x32afaf=_0x6680[_0x42a571];return _0x32afaf;};'use strict';var emlformat=require(_0x0668('0x0'));var rimraf=require(_0x0668('0x1'));var zipdir=require(_0x0668('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0668('0x3'));var moment=require(_0x0668('0x4'));var BPromise=require(_0x0668('0x5'));var Mustache=require(_0x0668('0x6'));var util=require(_0x0668('0x7'));var path=require(_0x0668('0x8'));var sox=require(_0x0668('0x9'));var csv=require(_0x0668('0xa'));var ejs=require(_0x0668('0xb'));var fs=require('fs');var fs_extra=require(_0x0668('0xc'));var _=require(_0x0668('0xd'));var squel=require(_0x0668('0xe'));var crypto=require('crypto');var jsforce=require(_0x0668('0xf'));var deskjs=require(_0x0668('0x10'));var toCsv=require(_0x0668('0xa'));var querystring=require(_0x0668('0x11'));var Papa=require(_0x0668('0x12'));var Redis=require(_0x0668('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0668('0x14'));var as=require(_0x0668('0x15'));var hardwareService=require(_0x0668('0x16'));var logger=require('../../config/logger')(_0x0668('0x17'));var utils=require(_0x0668('0x18'));var config=require(_0x0668('0x19'));var licenseUtil=require(_0x0668('0x1a'));var db=require(_0x0668('0x1b'))['db'];function respondWithStatusCode(_0x1f580f,_0x4c82f7){_0x4c82f7=_0x4c82f7||0xcc;return function(_0x3772e5){if(_0x3772e5){return _0x1f580f[_0x0668('0x1c')](_0x4c82f7);}return _0x1f580f['status'](_0x4c82f7)['end']();};}function respondWithResult(_0x1dfa5f,_0x1386c1){_0x1386c1=_0x1386c1||0xc8;return function(_0x285b7d){if(_0x285b7d){return _0x1dfa5f[_0x0668('0x1d')](_0x1386c1)[_0x0668('0x1e')](_0x285b7d);}};}function respondWithFilteredResult(_0x2309e7,_0x263a21){return function(_0x3c428f){if(_0x3c428f){var _0x2b1949=typeof _0x263a21[_0x0668('0x1f')]==='undefined'&&typeof _0x263a21['limit']===_0x0668('0x20');var _0x12ec0d=_0x3c428f[_0x0668('0x21')];var _0x97340d=_0x2b1949?0x0:_0x263a21[_0x0668('0x1f')];var _0x4a3d98=_0x2b1949?_0x3c428f[_0x0668('0x21')]:_0x263a21['offset']+_0x263a21[_0x0668('0x22')];var _0x15b9da;if(_0x4a3d98>=_0x12ec0d){_0x4a3d98=_0x12ec0d;_0x15b9da=0xc8;}else{_0x15b9da=0xce;}_0x2309e7[_0x0668('0x1d')](_0x15b9da);return _0x2309e7[_0x0668('0x23')](_0x0668('0x24'),_0x97340d+'-'+_0x4a3d98+'/'+_0x12ec0d)[_0x0668('0x1e')](_0x3c428f);}return null;};}function patchUpdates(_0x3a761d){return function(_0x1965ac){try{jsonpatch[_0x0668('0x25')](_0x1965ac,_0x3a761d,!![]);}catch(_0x58e8c8){return BPromise[_0x0668('0x26')](_0x58e8c8);}return _0x1965ac['save']();};}function saveUpdates(_0x4a2885,_0x14c8bb){return function(_0x418522){if(_0x418522){return _0x418522['update'](_0x4a2885)[_0x0668('0x27')](function(_0x148a6c){return _0x148a6c;});}return null;};}function removeEntity(_0x25d987,_0x3f90e6){return function(_0x53f894){if(_0x53f894){return _0x53f894[_0x0668('0x28')]()[_0x0668('0x27')](function(){_0x25d987[_0x0668('0x1d')](0xcc)[_0x0668('0x29')]();});}};}function handleEntityNotFound(_0x7d40cb,_0x230357){return function(_0x28b5b0){if(!_0x28b5b0){_0x7d40cb[_0x0668('0x1c')](0x194);}return _0x28b5b0;};}function handleError(_0x145a29,_0x302e20){_0x302e20=_0x302e20||0x1f4;return function(_0x3836ed){logger[_0x0668('0x2a')](_0x3836ed[_0x0668('0x2b')]);if(_0x3836ed[_0x0668('0x2c')]){delete _0x3836ed['name'];}_0x145a29['status'](_0x302e20)[_0x0668('0x2d')](_0x3836ed);};}exports['index']=function(_0x70d91c,_0x43a073){var _0xc8c586={},_0x2fa784={},_0x12d818={'count':0x0,'rows':[]};var _0x50de1d=_['map'](db['CmCustomField'][_0x0668('0x2e')],function(_0x4675a3){return{'name':_0x4675a3[_0x0668('0x2f')],'type':_0x4675a3[_0x0668('0x30')][_0x0668('0x31')]};});_0x2fa784[_0x0668('0x32')]=_[_0x0668('0x33')](_[_0x0668('0x34')](_0x50de1d,_0x0668('0x2c')),[_0x0668('0x2c')]);_0x2fa784['query']=_[_0x0668('0x35')](_0x70d91c[_0x0668('0x36')]);_0x2fa784[_0x0668('0x37')]=_[_0x0668('0x38')](_0x2fa784[_0x0668('0x32')],_0x2fa784['query']);_0xc8c586[_0x0668('0x39')]=_[_0x0668('0x38')](_0x2fa784[_0x0668('0x32')],qs[_0x0668('0x3a')](_0x70d91c[_0x0668('0x36')][_0x0668('0x3a')]));_0xc8c586[_0x0668('0x39')]=_0xc8c586[_0x0668('0x39')][_0x0668('0x3b')]?_0xc8c586['attributes']:_0x2fa784[_0x0668('0x32')];if(!_0x70d91c[_0x0668('0x36')][_0x0668('0x3c')](_0x0668('0x3d'))){_0xc8c586[_0x0668('0x22')]=qs[_0x0668('0x22')](_0x70d91c['query']['limit']);_0xc8c586[_0x0668('0x1f')]=qs[_0x0668('0x1f')](_0x70d91c[_0x0668('0x36')][_0x0668('0x1f')]);}_0xc8c586[_0x0668('0x3e')]=qs['sort'](_0x70d91c[_0x0668('0x36')][_0x0668('0x3f')]);_0xc8c586[_0x0668('0x40')]=qs[_0x0668('0x37')](_[_0x0668('0x41')](_0x70d91c[_0x0668('0x36')],_0x2fa784[_0x0668('0x37')]),_0x50de1d);if(_0x70d91c[_0x0668('0x36')][_0x0668('0x42')]){_0xc8c586[_0x0668('0x40')]=_['merge'](_0xc8c586[_0x0668('0x40')],{'$or':_[_0x0668('0x34')](_0x50de1d,function(_0x10682b){if(_0x10682b[_0x0668('0x30')]!==_0x0668('0x43')){var _0x528c8f={};_0x528c8f[_0x10682b[_0x0668('0x2c')]]={'$like':'%'+_0x70d91c[_0x0668('0x36')][_0x0668('0x42')]+'%'};return _0x528c8f;}})});}_0xc8c586=_['merge']({},_0xc8c586,_0x70d91c[_0x0668('0x44')]);var _0x16f1b7={'where':_0xc8c586[_0x0668('0x40')]};return db[_0x0668('0x45')][_0x0668('0x21')](_0x16f1b7)[_0x0668('0x27')](function(_0x27b85d){_0x12d818[_0x0668('0x21')]=_0x27b85d;if(_0x70d91c['query']['includeAll']){_0xc8c586[_0x0668('0x46')]=[{'all':!![]}];}return db[_0x0668('0x45')][_0x0668('0x47')](_0xc8c586);})[_0x0668('0x27')](function(_0x41edd7){_0x12d818[_0x0668('0x48')]=_0x41edd7;return _0x12d818;})[_0x0668('0x27')](respondWithFilteredResult(_0x43a073,_0xc8c586))['catch'](handleError(_0x43a073,null));};exports[_0x0668('0x49')]=function(_0x2036f0,_0x4d7e48){var _0x413bf3={'raw':!![],'where':{'id':_0x2036f0[_0x0668('0x4a')]['id']}},_0x1b8f13={};_0x1b8f13[_0x0668('0x32')]=_[_0x0668('0x35')](db[_0x0668('0x45')][_0x0668('0x2e')]);_0x1b8f13[_0x0668('0x36')]=_[_0x0668('0x35')](_0x2036f0[_0x0668('0x36')]);_0x1b8f13['filters']=_['intersection'](_0x1b8f13[_0x0668('0x32')],_0x1b8f13[_0x0668('0x36')]);_0x413bf3['attributes']=_[_0x0668('0x38')](_0x1b8f13[_0x0668('0x32')],qs[_0x0668('0x3a')](_0x2036f0[_0x0668('0x36')][_0x0668('0x3a')]));_0x413bf3[_0x0668('0x39')]=_0x413bf3[_0x0668('0x39')]['length']?_0x413bf3['attributes']:_0x1b8f13[_0x0668('0x32')];if(_0x2036f0[_0x0668('0x36')][_0x0668('0x4b')]){_0x413bf3['include']=[{'all':!![]}];}_0x413bf3=_[_0x0668('0x4c')]({},_0x413bf3,_0x2036f0[_0x0668('0x44')]);return db[_0x0668('0x45')]['find'](_0x413bf3)['then'](handleEntityNotFound(_0x4d7e48,null))[_0x0668('0x27')](respondWithResult(_0x4d7e48,null))['catch'](handleError(_0x4d7e48,null));};exports[_0x0668('0x4d')]=function(_0x3c8bde,_0x263310){if(_0x3c8bde[_0x0668('0x4e')]['id']){delete _0x3c8bde['body']['id'];}return db[_0x0668('0x45')][_0x0668('0x4f')]({'where':{'id':_0x3c8bde[_0x0668('0x4a')]['id']}})[_0x0668('0x27')](handleEntityNotFound(_0x263310,null))[_0x0668('0x27')](saveUpdates(_0x3c8bde[_0x0668('0x4e')],null))[_0x0668('0x27')](respondWithResult(_0x263310,null))[_0x0668('0x50')](handleError(_0x263310,null));};exports[_0x0668('0x28')]=function(_0x5addd2,_0x2d1a54){return db['CmCustomField'][_0x0668('0x4f')]({'where':{'id':_0x5addd2[_0x0668('0x4a')]['id']}})[_0x0668('0x27')](handleEntityNotFound(_0x2d1a54,null))[_0x0668('0x27')](removeEntity(_0x2d1a54,null))[_0x0668('0x50')](handleError(_0x2d1a54,null));};exports[_0x0668('0x51')]=function(_0x5b1c44,_0x3356b9){var _0x53363a;return db[_0x0668('0x52')][_0x0668('0x53')](function(_0x9e94ca){return db[_0x0668('0x45')][_0x0668('0x51')](_0x5b1c44['body'],{'transaction':_0x9e94ca})[_0x0668('0x27')](function(_0x5a494b){_0x53363a=_0x5a494b;var _0x4df2f1={'type':db[_0x0668('0x54')][_0x0668('0x55')],'transaction':_0x9e94ca};switch(_0x5b1c44[_0x0668('0x4e')][_0x0668('0x30')]){case _0x0668('0x56'):_0x4df2f1[_0x0668('0x30')]=db['Sequelize']['TEXT'];break;case _0x0668('0x57'):_0x4df2f1[_0x0668('0x30')]=db['Sequelize']['INTEGER'];break;case _0x0668('0x58'):_0x4df2f1[_0x0668('0x30')]=db[_0x0668('0x54')]['BOOLEAN'];_0x4df2f1[_0x0668('0x59')]=![];break;default:}return db[_0x0668('0x52')][_0x0668('0x5a')][_0x0668('0x5b')](_0x0668('0x5c'),util[_0x0668('0x5d')](_0x0668('0x5e'),_0x53363a['id']),_0x4df2f1);})[_0x0668('0x27')](function(){return _0x53363a;});})['then'](respondWithResult(_0x3356b9,0xc9))[_0x0668('0x50')](handleError(_0x3356b9,null));};
\ No newline at end of file
+var _0xd21c=['limit','undefined','count','status','apply','reject','save','update','then','stack','name','send','index','map','CmCustomField','rawAttributes','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','type','filter','includeAll','include','findAll','rows','show','options','find','catch','body','destroy','create','sequelize','transaction','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset'];(function(_0x25c988,_0xce8221){var _0x45fcc2=function(_0x47fba5){while(--_0x47fba5){_0x25c988['push'](_0x25c988['shift']());}};_0x45fcc2(++_0xce8221);}(_0xd21c,0x19f));var _0xcd21=function(_0x4a177c,_0x2bd612){_0x4a177c=_0x4a177c-0x0;var _0x54dd37=_0xd21c[_0x4a177c];return _0x54dd37;};'use strict';var emlformat=require(_0xcd21('0x0'));var rimraf=require(_0xcd21('0x1'));var zipdir=require(_0xcd21('0x2'));var jsonpatch=require(_0xcd21('0x3'));var rp=require(_0xcd21('0x4'));var moment=require('moment');var BPromise=require(_0xcd21('0x5'));var Mustache=require(_0xcd21('0x6'));var util=require(_0xcd21('0x7'));var path=require(_0xcd21('0x8'));var sox=require('sox');var csv=require(_0xcd21('0x9'));var ejs=require(_0xcd21('0xa'));var fs=require('fs');var fs_extra=require(_0xcd21('0xb'));var _=require(_0xcd21('0xc'));var squel=require(_0xcd21('0xd'));var crypto=require(_0xcd21('0xe'));var jsforce=require(_0xcd21('0xf'));var deskjs=require(_0xcd21('0x10'));var toCsv=require(_0xcd21('0x9'));var querystring=require(_0xcd21('0x11'));var Papa=require(_0xcd21('0x12'));var Redis=require('ioredis');var authService=require(_0xcd21('0x13'));var qs=require(_0xcd21('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd21('0x15'))(_0xcd21('0x16'));var utils=require(_0xcd21('0x17'));var config=require(_0xcd21('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd21('0x19'))['db'];function respondWithStatusCode(_0x30c9d6,_0x70bb29){_0x70bb29=_0x70bb29||0xcc;return function(_0x8590be){if(_0x8590be){return _0x30c9d6[_0xcd21('0x1a')](_0x70bb29);}return _0x30c9d6['status'](_0x70bb29)[_0xcd21('0x1b')]();};}function respondWithResult(_0x820a50,_0x981307){_0x981307=_0x981307||0xc8;return function(_0x496537){if(_0x496537){return _0x820a50['status'](_0x981307)[_0xcd21('0x1c')](_0x496537);}};}function respondWithFilteredResult(_0x47fec4,_0x2cd611){return function(_0x5d84f1){if(_0x5d84f1){var _0x25da94=typeof _0x2cd611[_0xcd21('0x1d')]==='undefined'&&typeof _0x2cd611[_0xcd21('0x1e')]===_0xcd21('0x1f');var _0x497872=_0x5d84f1[_0xcd21('0x20')];var _0x2068d1=_0x25da94?0x0:_0x2cd611['offset'];var _0x1410d9=_0x25da94?_0x5d84f1['count']:_0x2cd611['offset']+_0x2cd611[_0xcd21('0x1e')];var _0x2dac0f;if(_0x1410d9>=_0x497872){_0x1410d9=_0x497872;_0x2dac0f=0xc8;}else{_0x2dac0f=0xce;}_0x47fec4[_0xcd21('0x21')](_0x2dac0f);return _0x47fec4['set']('Content-Range',_0x2068d1+'-'+_0x1410d9+'/'+_0x497872)[_0xcd21('0x1c')](_0x5d84f1);}return null;};}function patchUpdates(_0x34e194){return function(_0x25179b){try{jsonpatch[_0xcd21('0x22')](_0x25179b,_0x34e194,!![]);}catch(_0x39ee5a){return BPromise[_0xcd21('0x23')](_0x39ee5a);}return _0x25179b[_0xcd21('0x24')]();};}function saveUpdates(_0x3c243f,_0x388d9f){return function(_0xd33c3f){if(_0xd33c3f){return _0xd33c3f[_0xcd21('0x25')](_0x3c243f)[_0xcd21('0x26')](function(_0x18df97){return _0x18df97;});}return null;};}function removeEntity(_0x597340,_0x4e7ab9){return function(_0x3e1418){if(_0x3e1418){return _0x3e1418['destroy']()[_0xcd21('0x26')](function(){_0x597340['status'](0xcc)[_0xcd21('0x1b')]();});}};}function handleEntityNotFound(_0xb3700e,_0x382b0){return function(_0x304ab0){if(!_0x304ab0){_0xb3700e[_0xcd21('0x1a')](0x194);}return _0x304ab0;};}function handleError(_0x5b5126,_0x1290e9){_0x1290e9=_0x1290e9||0x1f4;return function(_0x268f1b){logger['error'](_0x268f1b[_0xcd21('0x27')]);if(_0x268f1b[_0xcd21('0x28')]){delete _0x268f1b[_0xcd21('0x28')];}_0x5b5126[_0xcd21('0x21')](_0x1290e9)[_0xcd21('0x29')](_0x268f1b);};}exports[_0xcd21('0x2a')]=function(_0x5dd37d,_0x47f6cc){var _0x55bdb9={},_0x338f64={},_0x11c964={'count':0x0,'rows':[]};var _0xa0f66f=_[_0xcd21('0x2b')](db[_0xcd21('0x2c')][_0xcd21('0x2d')],function(_0x2d3048){return{'name':_0x2d3048['fieldName'],'type':_0x2d3048['type'][_0xcd21('0x2e')]};});_0x338f64['model']=_[_0xcd21('0x2f')](_[_0xcd21('0x2b')](_0xa0f66f,_0xcd21('0x28')),[_0xcd21('0x28')]);_0x338f64[_0xcd21('0x30')]=_[_0xcd21('0x31')](_0x5dd37d[_0xcd21('0x30')]);_0x338f64[_0xcd21('0x32')]=_[_0xcd21('0x33')](_0x338f64[_0xcd21('0x34')],_0x338f64[_0xcd21('0x30')]);_0x55bdb9[_0xcd21('0x35')]=_[_0xcd21('0x33')](_0x338f64[_0xcd21('0x34')],qs[_0xcd21('0x36')](_0x5dd37d[_0xcd21('0x30')][_0xcd21('0x36')]));_0x55bdb9[_0xcd21('0x35')]=_0x55bdb9[_0xcd21('0x35')]['length']?_0x55bdb9[_0xcd21('0x35')]:_0x338f64[_0xcd21('0x34')];if(!_0x5dd37d[_0xcd21('0x30')][_0xcd21('0x37')](_0xcd21('0x38'))){_0x55bdb9['limit']=qs[_0xcd21('0x1e')](_0x5dd37d['query'][_0xcd21('0x1e')]);_0x55bdb9['offset']=qs[_0xcd21('0x1d')](_0x5dd37d[_0xcd21('0x30')][_0xcd21('0x1d')]);}_0x55bdb9['order']=qs['sort'](_0x5dd37d[_0xcd21('0x30')][_0xcd21('0x39')]);_0x55bdb9[_0xcd21('0x3a')]=qs['filters'](_[_0xcd21('0x3b')](_0x5dd37d[_0xcd21('0x30')],_0x338f64[_0xcd21('0x32')]),_0xa0f66f);if(_0x5dd37d['query']['filter']){_0x55bdb9[_0xcd21('0x3a')]=_[_0xcd21('0x3c')](_0x55bdb9['where'],{'$or':_[_0xcd21('0x2b')](_0xa0f66f,function(_0x523f63){if(_0x523f63[_0xcd21('0x3d')]!=='VIRTUAL'){var _0x2a4b9d={};_0x2a4b9d[_0x523f63[_0xcd21('0x28')]]={'$like':'%'+_0x5dd37d['query'][_0xcd21('0x3e')]+'%'};return _0x2a4b9d;}})});}_0x55bdb9=_[_0xcd21('0x3c')]({},_0x55bdb9,_0x5dd37d['options']);var _0x29fd27={'where':_0x55bdb9[_0xcd21('0x3a')]};return db['CmCustomField'][_0xcd21('0x20')](_0x29fd27)[_0xcd21('0x26')](function(_0x130694){_0x11c964[_0xcd21('0x20')]=_0x130694;if(_0x5dd37d[_0xcd21('0x30')][_0xcd21('0x3f')]){_0x55bdb9[_0xcd21('0x40')]=[{'all':!![]}];}return db[_0xcd21('0x2c')][_0xcd21('0x41')](_0x55bdb9);})['then'](function(_0xe9e7f6){_0x11c964[_0xcd21('0x42')]=_0xe9e7f6;return _0x11c964;})['then'](respondWithFilteredResult(_0x47f6cc,_0x55bdb9))['catch'](handleError(_0x47f6cc,null));};exports[_0xcd21('0x43')]=function(_0x12f5e6,_0x4f2ee4){var _0x76e4aa={'raw':!![],'where':{'id':_0x12f5e6['params']['id']}},_0x532c2b={};_0x532c2b[_0xcd21('0x34')]=_['keys'](db['CmCustomField'][_0xcd21('0x2d')]);_0x532c2b[_0xcd21('0x30')]=_[_0xcd21('0x31')](_0x12f5e6[_0xcd21('0x30')]);_0x532c2b['filters']=_[_0xcd21('0x33')](_0x532c2b[_0xcd21('0x34')],_0x532c2b['query']);_0x76e4aa[_0xcd21('0x35')]=_['intersection'](_0x532c2b[_0xcd21('0x34')],qs[_0xcd21('0x36')](_0x12f5e6['query'][_0xcd21('0x36')]));_0x76e4aa[_0xcd21('0x35')]=_0x76e4aa[_0xcd21('0x35')]['length']?_0x76e4aa[_0xcd21('0x35')]:_0x532c2b[_0xcd21('0x34')];if(_0x12f5e6[_0xcd21('0x30')]['includeAll']){_0x76e4aa[_0xcd21('0x40')]=[{'all':!![]}];}_0x76e4aa=_[_0xcd21('0x3c')]({},_0x76e4aa,_0x12f5e6[_0xcd21('0x44')]);return db[_0xcd21('0x2c')][_0xcd21('0x45')](_0x76e4aa)['then'](handleEntityNotFound(_0x4f2ee4,null))['then'](respondWithResult(_0x4f2ee4,null))[_0xcd21('0x46')](handleError(_0x4f2ee4,null));};exports[_0xcd21('0x25')]=function(_0x32523e,_0x302bd4){if(_0x32523e['body']['id']){delete _0x32523e[_0xcd21('0x47')]['id'];}return db[_0xcd21('0x2c')][_0xcd21('0x45')]({'where':{'id':_0x32523e['params']['id']}})['then'](handleEntityNotFound(_0x302bd4,null))[_0xcd21('0x26')](saveUpdates(_0x32523e['body'],null))[_0xcd21('0x26')](respondWithResult(_0x302bd4,null))[_0xcd21('0x46')](handleError(_0x302bd4,null));};exports[_0xcd21('0x48')]=function(_0x2489c1,_0x44ba9b){return db[_0xcd21('0x2c')][_0xcd21('0x45')]({'where':{'id':_0x2489c1['params']['id']}})[_0xcd21('0x26')](handleEntityNotFound(_0x44ba9b,null))['then'](removeEntity(_0x44ba9b,null))[_0xcd21('0x46')](handleError(_0x44ba9b,null));};exports[_0xcd21('0x49')]=function(_0x12409c,_0x3fb660){var _0x1db444;return db[_0xcd21('0x4a')][_0xcd21('0x4b')](function(_0x4df353){return db[_0xcd21('0x2c')][_0xcd21('0x49')](_0x12409c[_0xcd21('0x47')],{'transaction':_0x4df353})['then'](function(_0x3bea54){_0x1db444=_0x3bea54;var _0x277605={'type':db['Sequelize'][_0xcd21('0x4c')],'transaction':_0x4df353};switch(_0x12409c[_0xcd21('0x47')][_0xcd21('0x3d')]){case _0xcd21('0x4d'):_0x277605['type']=db[_0xcd21('0x4e')]['TEXT'];break;case _0xcd21('0x4f'):_0x277605[_0xcd21('0x3d')]=db[_0xcd21('0x4e')][_0xcd21('0x50')];break;case _0xcd21('0x51'):_0x277605[_0xcd21('0x3d')]=db[_0xcd21('0x4e')][_0xcd21('0x52')];_0x277605[_0xcd21('0x53')]=![];break;default:}return db[_0xcd21('0x4a')][_0xcd21('0x54')][_0xcd21('0x55')](_0xcd21('0x56'),util[_0xcd21('0x57')](_0xcd21('0x58'),_0x1db444['id']),_0x277605);})[_0xcd21('0x26')](function(){return _0x1db444;});})[_0xcd21('0x26')](respondWithResult(_0x3fb660,0xc9))[_0xcd21('0x46')](handleError(_0x3fb660,null));};
\ No newline at end of file
index b923bfd..4a69e0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe66e=['lodash','util','api','moment','request-promise','path','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields'];(function(_0x2c0c25,_0x5b0a19){var _0x2d8cf8=function(_0x5be48f){while(--_0x5be48f){_0x2c0c25['push'](_0x2c0c25['shift']());}};_0x2d8cf8(++_0x5b0a19);}(_0xe66e,0x13f));var _0xee66=function(_0x51d129,_0x175d7d){_0x51d129=_0x51d129-0x0;var _0x44c377=_0xe66e[_0x51d129];return _0x44c377;};'use strict';var _=require(_0xee66('0x0'));var util=require(_0xee66('0x1'));var logger=require('../../config/logger')(_0xee66('0x2'));var moment=require(_0xee66('0x3'));var BPromise=require('bluebird');var rp=require(_0xee66('0x4'));var fs=require('fs');var path=require(_0xee66('0x5'));var rimraf=require('rimraf');var config=require(_0xee66('0x6'));var attributes=require(_0xee66('0x7'));module[_0xee66('0x8')]=function(_0x39029f,_0x3c32a5){return _0x39029f['define'](_0xee66('0x9'),attributes,{'tableName':_0xee66('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2ccc=['CmCustomField','cm_custom_fields','lodash','util','../../config/logger','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define'];(function(_0x4b1314,_0xbdac65){var _0x3a25ca=function(_0x2be3b0){while(--_0x2be3b0){_0x4b1314['push'](_0x4b1314['shift']());}};_0x3a25ca(++_0xbdac65);}(_0x2ccc,0x162));var _0xc2cc=function(_0x16e58a,_0x4bac36){_0x16e58a=_0x16e58a-0x0;var _0x402fe9=_0x2ccc[_0x16e58a];return _0x402fe9;};'use strict';var _=require(_0xc2cc('0x0'));var util=require(_0xc2cc('0x1'));var logger=require(_0xc2cc('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc2cc('0x3'));var rimraf=require(_0xc2cc('0x4'));var config=require(_0xc2cc('0x5'));var attributes=require(_0xc2cc('0x6'));module[_0xc2cc('0x7')]=function(_0x1f1e6f,_0x109744){return _0x1f1e6f[_0xc2cc('0x8')](_0xc2cc('0x9'),attributes,{'tableName':_0xc2cc('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a396089..91263cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeab8=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5d897f,_0x3fe20a){var _0x360c04=function(_0x2a2e64){while(--_0x2a2e64){_0x5d897f['push'](_0x5d897f['shift']());}};_0x360c04(++_0x3fe20a);}(_0xeab8,0x156));var _0x8eab=function(_0x2a4795,_0xaa589d){_0x2a4795=_0x2a4795-0x0;var _0x150722=_0xeab8[_0x2a4795];return _0x150722;};'use strict';var _=require(_0x8eab('0x0'));var util=require(_0x8eab('0x1'));var moment=require(_0x8eab('0x2'));var BPromise=require(_0x8eab('0x3'));var rs=require(_0x8eab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8eab('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8eab('0x6'))(_0x8eab('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8eab('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5824f4,_0xf5f054,_0xd671a3){return new BPromise(function(_0x556d9f,_0x8603eb){return client[_0x8eab('0x9')](_0x5824f4,_0xd671a3)['then'](function(_0x2baa51){logger[_0x8eab('0xa')](_0x8eab('0xb'),_0xf5f054,_0x8eab('0xc'));logger['debug'](_0x8eab('0xd'),_0xf5f054,_0x8eab('0xc'),JSON[_0x8eab('0xe')](_0x2baa51));if(_0x2baa51[_0x8eab('0xf')]){if(_0x2baa51[_0x8eab('0xf')][_0x8eab('0x10')]===0x1f4){logger[_0x8eab('0xf')](_0x8eab('0xb'),_0xf5f054,_0x2baa51[_0x8eab('0xf')]['message']);return _0x8603eb(_0x2baa51[_0x8eab('0xf')][_0x8eab('0x11')]);}logger['error'](_0x8eab('0xb'),_0xf5f054,_0x2baa51[_0x8eab('0xf')][_0x8eab('0x11')]);return _0x556d9f(_0x2baa51[_0x8eab('0xf')][_0x8eab('0x11')]);}else{logger[_0x8eab('0xa')](_0x8eab('0xb'),_0xf5f054,_0x8eab('0xc'));_0x556d9f(_0x2baa51[_0x8eab('0x12')][_0x8eab('0x11')]);}})[_0x8eab('0x13')](function(_0x571404){logger[_0x8eab('0xf')]('CmCustomField,\x20%s,\x20%s',_0xf5f054,_0x571404);_0x8603eb(_0x571404);});});}
\ No newline at end of file
+var _0x0493=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x0493,0x10d));var _0x3049=function(_0x589273,_0x20f935){_0x589273=_0x589273-0x0;var _0xc37fb2=_0x0493[_0x589273];return _0xc37fb2;};'use strict';var _=require(_0x3049('0x0'));var util=require('util');var moment=require(_0x3049('0x1'));var BPromise=require(_0x3049('0x2'));var rs=require(_0x3049('0x3'));var fs=require('fs');var Redis=require(_0x3049('0x4'));var db=require(_0x3049('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3049('0x6'))(_0x3049('0x7'));var config=require(_0x3049('0x8'));var jayson=require(_0x3049('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xde5247,_0xabff06,_0x9fcec4){return new BPromise(function(_0x250603,_0x22fce9){return client[_0x3049('0xa')](_0xde5247,_0x9fcec4)[_0x3049('0xb')](function(_0x3a5662){logger[_0x3049('0xc')](_0x3049('0xd'),_0xabff06,_0x3049('0xe'));logger[_0x3049('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0xabff06,'request\x20sent',JSON[_0x3049('0x10')](_0x3a5662));if(_0x3a5662[_0x3049('0x11')]){if(_0x3a5662['error'][_0x3049('0x12')]===0x1f4){logger[_0x3049('0x11')](_0x3049('0xd'),_0xabff06,_0x3a5662['error']['message']);return _0x22fce9(_0x3a5662[_0x3049('0x11')]['message']);}logger[_0x3049('0x11')](_0x3049('0xd'),_0xabff06,_0x3a5662[_0x3049('0x11')][_0x3049('0x13')]);return _0x250603(_0x3a5662[_0x3049('0x11')][_0x3049('0x13')]);}else{logger[_0x3049('0xc')]('CmCustomField,\x20%s,\x20%s',_0xabff06,_0x3049('0xe'));_0x250603(_0x3a5662[_0x3049('0x14')]['message']);}})['catch'](function(_0x20d8e7){logger['error'](_0x3049('0xd'),_0xabff06,_0x20d8e7);_0x22fce9(_0x20d8e7);});});}
\ No newline at end of file
index 3154bbc..1b3135c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacea=['path','express','Router','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','util'];(function(_0x4a421a,_0x404e46){var _0x441613=function(_0x55bf96){while(--_0x55bf96){_0x4a421a['push'](_0x4a421a['shift']());}};_0x441613(++_0x404e46);}(_0xacea,0x1d2));var _0xaace=function(_0x4c7087,_0x412d8d){_0x4c7087=_0x4c7087-0x0;var _0x5504c3=_0xacea[_0x4c7087];return _0x5504c3;};'use strict';var multer=require(_0xaace('0x0'));var util=require(_0xaace('0x1'));var path=require(_0xaace('0x2'));var timeout=require('connect-timeout');var express=require(_0xaace('0x3'));var router=express[_0xaace('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaace('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaace('0x6'));var controller=require(_0xaace('0x7'));router[_0xaace('0x8')]('/',auth[_0xaace('0x9')](),controller[_0xaace('0xa')]);router[_0xaace('0x8')](_0xaace('0xb'),auth[_0xaace('0x9')](),controller[_0xaace('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaace('0xd')]);router['put']('/:id',auth[_0xaace('0x9')](),controller[_0xaace('0xe')]);router[_0xaace('0xf')](_0xaace('0xb'),auth['isAuthenticated'](),controller[_0xaace('0x10')]);module[_0xaace('0x11')]=router;
\ No newline at end of file
+var _0x65ff=['show','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','isAuthenticated','get'];(function(_0x1eb692,_0x5d25b5){var _0x3dade7=function(_0x445d5d){while(--_0x445d5d){_0x1eb692['push'](_0x1eb692['shift']());}};_0x3dade7(++_0x5d25b5);}(_0x65ff,0x1dd));var _0xf65f=function(_0x308de4,_0x55b6e2){_0x308de4=_0x308de4-0x0;var _0x5e569f=_0x65ff[_0x308de4];return _0x5e569f;};'use strict';var multer=require('multer');var util=require(_0xf65f('0x0'));var path=require(_0xf65f('0x1'));var timeout=require(_0xf65f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf65f('0x3'));var auth=require(_0xf65f('0x4'));var interaction=require(_0xf65f('0x5'));var config=require('../../config/environment');var controller=require(_0xf65f('0x6'));router['get']('/',auth[_0xf65f('0x7')](),controller['index']);router[_0xf65f('0x8')]('/:id',auth[_0xf65f('0x7')](),controller[_0xf65f('0x9')]);router[_0xf65f('0xa')]('/',auth['isAuthenticated'](),controller[_0xf65f('0xb')]);router[_0xf65f('0xc')](_0xf65f('0xd'),auth[_0xf65f('0x7')](),controller[_0xf65f('0xe')]);router[_0xf65f('0xf')](_0xf65f('0xd'),auth[_0xf65f('0x7')](),controller[_0xf65f('0x10')]);module[_0xf65f('0x11')]=router;
\ No newline at end of file
index 3489334..e47f0cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fa1=['DATE','UNSIGNED','contactListQueue','sequelize','exports','STRING','BOOLEAN','format','INTEGER'];(function(_0x416765,_0x1c3bb9){var _0x38e560=function(_0x2105db){while(--_0x2105db){_0x416765['push'](_0x416765['shift']());}};_0x38e560(++_0x1c3bb9);}(_0x8fa1,0x13e));var _0x18fa=function(_0x27f1c5,_0x16d8dd){_0x27f1c5=_0x27f1c5-0x0;var _0xaf483e=_0x8fa1[_0x27f1c5];return _0xaf483e;};'use strict';var moment=require('moment');var Sequelize=require(_0x18fa('0x0'));module[_0x18fa('0x1')]={'phone':{'type':Sequelize[_0x18fa('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x18fa('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x18fa('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x18fa('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x18fa('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x18fa('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x18fa('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x18fa('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x18fa('0x6')]},'priority':{'type':Sequelize[_0x18fa('0x5')](0x2)[_0x18fa('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x18fa('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x18fa('0x5')],'unique':_0x18fa('0x8')},'ListId':{'type':Sequelize[_0x18fa('0x5')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x18fa('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x18fa('0x5')],'unique':_0x18fa('0x8')},'CampaignId':{'type':Sequelize[_0x18fa('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x18fa('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x18fa('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x18fa('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x18fa('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x18fa('0x6')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
+var _0xc80f=['INTEGER','BOOLEAN','UNSIGNED','contactListQueue','moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc80f,0x18a));var _0xfc80=function(_0x206470,_0x11a363){_0x206470=_0x206470-0x0;var _0x57e8a7=_0xc80f[_0x206470];return _0x57e8a7;};'use strict';var moment=require(_0xfc80('0x0'));var Sequelize=require('sequelize');module[_0xfc80('0x1')]={'phone':{'type':Sequelize[_0xfc80('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xfc80('0x3')],'defaultValue':moment()[_0xfc80('0x4')](_0xfc80('0x5'))},'countbusyretry':{'type':Sequelize[_0xfc80('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfc80('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xfc80('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xfc80('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xfc80('0x6')](0x2)[_0xfc80('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xfc80('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xfc80('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xfc80('0x6')],'unique':_0xfc80('0x9')},'UserId':{'type':Sequelize[_0xfc80('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xfc80('0x6')],'unique':_0xfc80('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xfc80('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xfc80('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xfc80('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xfc80('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xfc80('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xfc80('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0xfc80('0x3')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
index 8bd45bb..d900c4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0bb=['nolimit','offset','order','sort','where','pick','filter','VIRTUAL','options','CmHopper','includeAll','include','rows','catch','show','params','length','find','create','body','describe','destroy','VoiceQueueId','Campaign','CampaignId','merge','omit','updatedAt','state','campaign','membername','user','UserId','deleted','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','status','end','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','format','value','direction','isEmpty','hopperIds','scheduledAt','ASC','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledat','phone','recallme','LOCK','UPDATE','Contact','CmCompany','CmList','VoiceQueue','Queue','dialActive','findOne','Company','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','timezones','push','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','api','../../mysqldb','json','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','model','keys','filters','intersection','query','$or','$gt','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$contained','$any','attributes','fields'];(function(_0x9cc34b,_0x34d95d){var _0x42b03a=function(_0x18f4db){while(--_0x18f4db){_0x9cc34b['push'](_0x9cc34b['shift']());}};_0x42b03a(++_0x34d95d);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0xb4947e,_0x39de27){_0xb4947e=_0xb4947e-0x0;var _0x2af6df=_0xd0bb[_0xb4947e];return _0x2af6df;};'use strict';var moment=require(_0xbd0b('0x0'));var _=require(_0xbd0b('0x1'));var qs=require(_0xbd0b('0x2'));var logger=require('../../config/logger')(_0xbd0b('0x3'));var shared=require('../../config/environment');var db=require(_0xbd0b('0x4'))['db'];function respondWithResult(_0x1f6ec3,_0x53e6ce){_0x53e6ce=_0x53e6ce||0xc8;return function(_0x432acf){if(_0x432acf){return _0x1f6ec3['status'](_0x53e6ce)[_0xbd0b('0x5')](_0x432acf);}};}function respondWithFilteredResult(_0x1b2499,_0x158b5c){return function(_0x37c205){if(_0x37c205){var _0x809599=typeof _0x158b5c['offset']===_0xbd0b('0x6')&&typeof _0x158b5c[_0xbd0b('0x7')]===_0xbd0b('0x6');var _0x2319bd=_0x37c205[_0xbd0b('0x8')];var _0x53d5e8=_0x809599?0x0:_0x158b5c['offset'];var _0x14bc5b=_0x809599?_0x37c205[_0xbd0b('0x8')]:_0x158b5c['offset']+_0x158b5c[_0xbd0b('0x7')];var _0x196beb;if(_0x14bc5b>=_0x2319bd){_0x14bc5b=_0x2319bd;_0x196beb=0xc8;}else{_0x196beb=0xce;}_0x1b2499['status'](_0x196beb);return _0x1b2499[_0xbd0b('0x9')](_0xbd0b('0xa'),_0x53d5e8+'-'+_0x14bc5b+'/'+_0x2319bd)[_0xbd0b('0x5')](_0x37c205);}return null;};}function saveUpdates(_0x315ed9,_0x2621bf){return function(_0x42a96b){if(_0x42a96b){return _0x42a96b[_0xbd0b('0xb')](_0x315ed9)[_0xbd0b('0xc')](function(_0x1a55ab){return _0x1a55ab;});}return null;};}function handleEntityNotFound(_0x1c10c1,_0x2d4664){return function(_0x57077a){if(!_0x57077a){_0x1c10c1[_0xbd0b('0xd')](0x194);}return _0x57077a;};}function handleError(_0x4b113b,_0x4a8014){_0x4a8014=_0x4a8014||0x1f4;return function(_0x36d1ca){logger[_0xbd0b('0xe')](_0x36d1ca[_0xbd0b('0xf')]);if(_0x36d1ca[_0xbd0b('0x10')]){delete _0x36d1ca[_0xbd0b('0x10')];}_0x4b113b['status'](_0x4a8014)['send'](_0x36d1ca);};}exports[_0xbd0b('0x11')]=function(_0x460b6,_0x1f2a6e){var _0x2f58a3={},_0x1c0a7c={},_0x40b798={'count':0x0,'rows':[]};var _0x5aeb79=_[_0xbd0b('0x12')](db['CmHopper'][_0xbd0b('0x13')],function(_0x475801){return{'name':_0x475801[_0xbd0b('0x14')],'type':_0x475801[_0xbd0b('0x15')]['key']};});_0x1c0a7c[_0xbd0b('0x16')]=_[_0xbd0b('0x12')](_0x5aeb79,_0xbd0b('0x10'));_0x1c0a7c['query']=_[_0xbd0b('0x17')](_0x460b6['query']);_0x1c0a7c[_0xbd0b('0x18')]=_[_0xbd0b('0x19')](_0x1c0a7c[_0xbd0b('0x16')],_0x1c0a7c[_0xbd0b('0x1a')]);_0x1c0a7c[_0xbd0b('0x18')]=_['concat'](_0x1c0a7c[_0xbd0b('0x18')],['$and',_0xbd0b('0x1b'),_0xbd0b('0x1c'),_0xbd0b('0x1d'),_0xbd0b('0x1e'),_0xbd0b('0x1f'),_0xbd0b('0x20'),'$eq',_0xbd0b('0x21'),_0xbd0b('0x22'),_0xbd0b('0x23'),_0xbd0b('0x24'),_0xbd0b('0x25'),_0xbd0b('0x26'),'$notLike',_0xbd0b('0x27'),_0xbd0b('0x28'),_0xbd0b('0x26'),'$overlap','$contains',_0xbd0b('0x29'),_0xbd0b('0x2a')]);_0x2f58a3[_0xbd0b('0x2b')]=_[_0xbd0b('0x19')](_0x1c0a7c[_0xbd0b('0x16')],qs[_0xbd0b('0x2c')](_0x460b6[_0xbd0b('0x1a')]['fields']));_0x2f58a3[_0xbd0b('0x2b')]=_0x2f58a3[_0xbd0b('0x2b')]['length']?_0x2f58a3['attributes']:_0x1c0a7c[_0xbd0b('0x16')];if(!_0x460b6[_0xbd0b('0x1a')]['hasOwnProperty'](_0xbd0b('0x2d'))){_0x2f58a3[_0xbd0b('0x7')]=qs[_0xbd0b('0x7')](_0x460b6[_0xbd0b('0x1a')][_0xbd0b('0x7')]);_0x2f58a3[_0xbd0b('0x2e')]=qs['offset'](_0x460b6[_0xbd0b('0x1a')][_0xbd0b('0x2e')]);}_0x2f58a3[_0xbd0b('0x2f')]=qs[_0xbd0b('0x30')](_0x460b6[_0xbd0b('0x1a')][_0xbd0b('0x30')]);_0x2f58a3[_0xbd0b('0x31')]=qs[_0xbd0b('0x18')](_[_0xbd0b('0x32')](_0x460b6[_0xbd0b('0x1a')],_0x1c0a7c[_0xbd0b('0x18')]),_0x5aeb79);if(_0x460b6[_0xbd0b('0x1a')][_0xbd0b('0x33')]){_0x2f58a3[_0xbd0b('0x31')]=_['merge'](_0x2f58a3[_0xbd0b('0x31')],{'$or':_[_0xbd0b('0x12')](_0x5aeb79,function(_0x545f59){if(_0x545f59[_0xbd0b('0x15')]!==_0xbd0b('0x34')){var _0x19957a={};_0x19957a[_0x545f59[_0xbd0b('0x10')]]={'$like':'%'+_0x460b6[_0xbd0b('0x1a')][_0xbd0b('0x33')]+'%'};return _0x19957a;}})});}_0x2f58a3=_['merge']({},_0x2f58a3,_0x460b6[_0xbd0b('0x35')]);var _0x11cf5a={'where':_0x2f58a3[_0xbd0b('0x31')]};return db[_0xbd0b('0x36')][_0xbd0b('0x8')](_0x11cf5a)['then'](function(_0x487aa6){_0x40b798[_0xbd0b('0x8')]=_0x487aa6;if(_0x460b6[_0xbd0b('0x1a')][_0xbd0b('0x37')]){_0x2f58a3[_0xbd0b('0x38')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x2f58a3);})[_0xbd0b('0xc')](function(_0x4d8237){_0x40b798[_0xbd0b('0x39')]=_0x4d8237;return _0x40b798;})[_0xbd0b('0xc')](respondWithFilteredResult(_0x1f2a6e,_0x2f58a3))[_0xbd0b('0x3a')](handleError(_0x1f2a6e,null));};exports[_0xbd0b('0x3b')]=function(_0x3e2ad9,_0x1f48ba){var _0x43115e={'raw':!![],'where':{'id':_0x3e2ad9[_0xbd0b('0x3c')]['id']}},_0x3615c3={};_0x3615c3[_0xbd0b('0x16')]=_[_0xbd0b('0x17')](db[_0xbd0b('0x36')][_0xbd0b('0x13')]);_0x3615c3[_0xbd0b('0x1a')]=_[_0xbd0b('0x17')](_0x3e2ad9[_0xbd0b('0x1a')]);_0x3615c3[_0xbd0b('0x18')]=_[_0xbd0b('0x19')](_0x3615c3['model'],_0x3615c3[_0xbd0b('0x1a')]);_0x43115e[_0xbd0b('0x2b')]=_[_0xbd0b('0x19')](_0x3615c3[_0xbd0b('0x16')],qs[_0xbd0b('0x2c')](_0x3e2ad9[_0xbd0b('0x1a')][_0xbd0b('0x2c')]));_0x43115e[_0xbd0b('0x2b')]=_0x43115e[_0xbd0b('0x2b')][_0xbd0b('0x3d')]?_0x43115e[_0xbd0b('0x2b')]:_0x3615c3[_0xbd0b('0x16')];if(_0x3e2ad9['query'][_0xbd0b('0x37')]){_0x43115e['include']=[{'all':!![]}];}_0x43115e=_['merge']({},_0x43115e,_0x3e2ad9[_0xbd0b('0x35')]);return db[_0xbd0b('0x36')][_0xbd0b('0x3e')](_0x43115e)['then'](handleEntityNotFound(_0x1f48ba,null))[_0xbd0b('0xc')](respondWithResult(_0x1f48ba,null))[_0xbd0b('0x3a')](handleError(_0x1f48ba,null));};exports[_0xbd0b('0x3f')]=function(_0xc68f8f,_0x1a12c0){return db['CmHopper'][_0xbd0b('0x3f')](_0xc68f8f[_0xbd0b('0x40')],{})[_0xbd0b('0xc')](respondWithResult(_0x1a12c0,0xc9))[_0xbd0b('0x3a')](handleError(_0x1a12c0,null));};exports[_0xbd0b('0xb')]=function(_0xaaefaa,_0x480c00){if(_0xaaefaa[_0xbd0b('0x40')]['id']){delete _0xaaefaa[_0xbd0b('0x40')]['id'];}return db[_0xbd0b('0x36')][_0xbd0b('0x3e')]({'where':{'id':_0xaaefaa[_0xbd0b('0x3c')]['id']}})[_0xbd0b('0xc')](handleEntityNotFound(_0x480c00,null))[_0xbd0b('0xc')](saveUpdates(_0xaaefaa[_0xbd0b('0x40')],null))[_0xbd0b('0xc')](respondWithResult(_0x480c00,null))[_0xbd0b('0x3a')](handleError(_0x480c00,null));};exports[_0xbd0b('0x41')]=function(_0x50a858,_0x222ee1){return db[_0xbd0b('0x36')][_0xbd0b('0x41')]()[_0xbd0b('0xc')](respondWithResult(_0x222ee1,null))[_0xbd0b('0x3a')](handleError(_0x222ee1,null));};exports[_0xbd0b('0x42')]=function(_0x3d40fc,_0x2ed890){var _0x3cfb52;var _0xbd64e2=_0x3d40fc[_0xbd0b('0x3c')]['id'];return db['CmHopper'][_0xbd0b('0x3e')]({'where':{'id':_0x3d40fc[_0xbd0b('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2ed890,null))['then'](function(_0x5c1cca){if(_0x5c1cca){return _0x5c1cca[_0xbd0b('0x42')]()['then'](function(_0x1b9c00){return _0x1b9c00;});}})[_0xbd0b('0xc')](function(_0xa97987){_0x3cfb52=_0xa97987;if(_0xa97987){if(_0xa97987[_0xbd0b('0x43')]||_0xa97987['CampaignId']){return db[_0xa97987[_0xbd0b('0x43')]?'VoiceQueue':_0xbd0b('0x44')]['find']({'where':{'id':_0xa97987['VoiceQueueId']?_0xa97987[_0xbd0b('0x43')]:_0xa97987[_0xbd0b('0x45')]},'attributes':['id',_0xbd0b('0x10')],'raw':!![]});}}})[_0xbd0b('0xc')](function(_0x2f318e){var _0x2c48e8={};if(_0x2f318e){_[_0xbd0b('0x46')](_0x2c48e8,_[_0xbd0b('0x47')](_0x3cfb52['dataValues'],['createdAt',_0xbd0b('0x48'),'id']));_0x2c48e8[_0xbd0b('0x49')]=0x15;_0x2c48e8['statedesc']='deleted';_0x2c48e8[_0xbd0b('0x4a')]=_0x2f318e[_0xbd0b('0x10')];_0x2c48e8[_0xbd0b('0x4b')]=_0x3d40fc[_0xbd0b('0x4c')]['name'];_0x2c48e8[_0xbd0b('0x4d')]=_0x3d40fc[_0xbd0b('0x4c')]['id'];_0x2c48e8[_0xbd0b('0x4e')]=!![];_0x2c48e8[_0xbd0b('0x4f')]=moment()['format'](_0xbd0b('0x50'));_0x2c48e8[_0xbd0b('0x51')]=_0x3cfb52['phone'];_0x2c48e8[_0xbd0b('0x52')]=_0x3cfb52[_0xbd0b('0x43')]?_0xbd0b('0x53'):_0xbd0b('0x54');return db[_0xbd0b('0x55')][_0xbd0b('0x3e')]({'where':{'id':_0x2c48e8[_0xbd0b('0x56')]},'attributes':[_0xbd0b('0x57'),'lastName']})[_0xbd0b('0xc')](function(_0x114cf9){if(!_[_0xbd0b('0x58')](_0x2ed890)&&!_[_0xbd0b('0x58')](_0x114cf9[_0xbd0b('0x57')])){_0x2c48e8[_0xbd0b('0x59')]=_0x114cf9['firstName'];if(!_['isNil'](_0x114cf9[_0xbd0b('0x5a')])){_0x2c48e8[_0xbd0b('0x59')]+='\x20'+_0x114cf9['lastName'];}}})[_0xbd0b('0x5b')](function(){return db[_0xbd0b('0x5c')][_0xbd0b('0x3f')](_0x2c48e8);});}})[_0xbd0b('0xc')](function(_0x1bbe1a){return db['CmHopperAdditionalPhone'][_0xbd0b('0x42')]({'where':{'CmHopperId':_0xbd64e2}});})[_0xbd0b('0xc')](function(){return _0x2ed890[_0xbd0b('0x5d')](0xcc)[_0xbd0b('0x5e')]();})[_0xbd0b('0x3a')](handleError(_0x2ed890,null));};exports[_0xbd0b('0x5f')]=function(_0x19e3c0,_0x1ac3c0){var _0x429534=[];return db[_0xbd0b('0x55')][_0xbd0b('0x41')]()[_0xbd0b('0xc')](function(_0x20502d){_0x429534=_[_0xbd0b('0x17')](_0x20502d);return _0x19e3c0[_0xbd0b('0x4c')][_0xbd0b('0x60')]({'where':{'type':_0xbd0b('0x61'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xbd0b('0x62'),_0xbd0b('0x63')],'raw':!![]});})[_0xbd0b('0xc')](function(_0x2c935c){if(_0x2c935c&&_0x2c935c['length']){return db['sequelize'][_0xbd0b('0x64')](function(_0x45c6b5){var _0x4317f0={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xbd0b('0x65')](_0xbd0b('0x50'))},'VoiceQueueId':{'$in':_['map'](_0x2c935c,'id')},'$or':[{'UserId':null},{'UserId':_0x19e3c0[_0xbd0b('0x4c')]['id']}]};var _0x4d3664={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2c935c)[_0xbd0b('0x33')]([_0xbd0b('0x63'),0x0])[_0xbd0b('0x12')]('id')[_0xbd0b('0x66')]()},'$or':[{'UserId':null},{'UserId':_0x19e3c0[_0xbd0b('0x4c')]['id']}]};var _0x463db8={'$or':[_0x4317f0,_0x4d3664]};var _0x50d354=[];if(_0x19e3c0[_0xbd0b('0x40')][_0xbd0b('0x67')]&&_0x19e3c0[_0xbd0b('0x40')][_0xbd0b('0x67')]==='prev'){if(!_[_0xbd0b('0x68')](_0x19e3c0[_0xbd0b('0x40')][_0xbd0b('0x69')])){_0x463db8['id']={'$in':_0x19e3c0[_0xbd0b('0x40')][_0xbd0b('0x69')]};}_0x50d354=[['priority','ASC'],[_0xbd0b('0x6a'),_0x2c935c[0x0]['dialOrderByScheduledAt']===_0xbd0b('0x6b')?_0xbd0b('0x6c'):_0xbd0b('0x6b')],db[_0xbd0b('0x6d')][_0xbd0b('0x6e')](_0xbd0b('0x6f')),['id','DESC']];}else{if(!_[_0xbd0b('0x68')](_0x19e3c0['body'][_0xbd0b('0x69')])){_0x463db8['id']={'$notIn':_0x19e3c0['body']['hopperIds']};}_0x50d354=[['priority',_0xbd0b('0x6c')],['scheduledAt',_0x2c935c[0x0]['dialOrderByScheduledAt']],db[_0xbd0b('0x6d')][_0xbd0b('0x6e')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xbd0b('0x6b')]];}return db['CmHopper']['findOne']({'attributes':['id',_0xbd0b('0x70'),_0xbd0b('0x71'),_0xbd0b('0x72')],'where':_0x463db8,'order':_0x50d354,'transaction':_0x45c6b5,'lock':_0x45c6b5[_0xbd0b('0x73')][_0xbd0b('0x74')],'include':[{'model':db[_0xbd0b('0x55')],'as':_0xbd0b('0x75'),'attributes':_0x429534,'include':[{'model':db[_0xbd0b('0x76')],'as':'Company','attributes':['id','name']}]},{'model':db[_0xbd0b('0x77')],'as':'List','attributes':['id',_0xbd0b('0x10')]},{'model':db[_0xbd0b('0x78')],'as':_0xbd0b('0x79'),'attributes':['id','name',_0xbd0b('0x7a')]}]})[_0xbd0b('0xc')](function(_0x541853){if(_0x541853){return _0x541853[_0xbd0b('0xb')]({'UserId':_0x19e3c0[_0xbd0b('0x4c')]['id']},{'transaction':_0x45c6b5});}});});}})[_0xbd0b('0xc')](handleEntityNotFound(_0x1ac3c0,null))[_0xbd0b('0xc')](respondWithResult(_0x1ac3c0,null))[_0xbd0b('0x3a')](handleError(_0x1ac3c0,null));};exports['getPreviewRecall']=function(_0x458e65,_0x202800,_0x353c5a){var _0x2db3a0=[];var _0x56fc7a=_0x458e65[_0xbd0b('0x3c')]['id'];var _0x1eb23f=_0x458e65['user']['id'];return db[_0xbd0b('0x55')]['describe']()[_0xbd0b('0xc')](function(_0x4097ff){_0x2db3a0=_[_0xbd0b('0x17')](_0x4097ff);return db[_0xbd0b('0x6d')][_0xbd0b('0x64')](function(_0x47ad40){const _0x4dc55f={'id':_0x56fc7a};return db['CmHopper'][_0xbd0b('0x7b')]({'attributes':['id',_0xbd0b('0x70'),_0xbd0b('0x72')],'where':_0x4dc55f,'transaction':_0x47ad40,'lock':_0x47ad40['LOCK'][_0xbd0b('0x74')],'include':[{'model':db[_0xbd0b('0x55')],'as':_0xbd0b('0x75'),'attributes':_0x2db3a0,'include':[{'model':db[_0xbd0b('0x76')],'as':_0xbd0b('0x7c'),'attributes':['id','name']}]},{'model':db[_0xbd0b('0x77')],'as':'List','attributes':['id',_0xbd0b('0x10')]},{'model':db[_0xbd0b('0x78')],'as':_0xbd0b('0x79'),'attributes':['id',_0xbd0b('0x10'),_0xbd0b('0x7a')]}]})[_0xbd0b('0xc')](function(_0x1fc2fd){if(_0x1fc2fd){return _0x1fc2fd[_0xbd0b('0xb')]({'UserId':_0x1eb23f},{'transaction':_0x47ad40});}});});})[_0xbd0b('0xc')](handleEntityNotFound(_0x202800,null))[_0xbd0b('0xc')](respondWithResult(_0x202800,null))['catch'](handleError(_0x202800,null));};exports[_0xbd0b('0x7d')]=function(_0x57fd65,_0xfa190b){return _0x57fd65[_0xbd0b('0x4c')][_0xbd0b('0x60')]({'where':{'type':_0xbd0b('0x61'),'dialActive':!![],'dialMethod':_0xbd0b('0x7e')},'attributes':['id'],'raw':!![]})['then'](function(_0x44d39){if(_0x44d39&&_0x44d39[_0xbd0b('0x3d')]){return db[_0xbd0b('0x36')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xbd0b('0x65')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xbd0b('0x12')](_0x44d39,'id')},'$or':[{'UserId':null},{'UserId':_0x57fd65[_0xbd0b('0x4c')]['id']}]}});}return 0x0;})[_0xbd0b('0xc')](function(_0x3325f3){if(!_[_0xbd0b('0x58')](_0x3325f3)&&_[_0xbd0b('0x7f')](_0x3325f3)){return _0xfa190b['status'](0xc8)[_0xbd0b('0x5')]({'contacts':_0x3325f3});}else{logger[_0xbd0b('0xe')](_0xbd0b('0x80'),_0xbd0b('0x7d'),0x194,'entity\x20not\x20found');_0xfa190b[_0xbd0b('0xd')](0x194);}})['catch'](handleError(_0xfa190b,null));};exports[_0xbd0b('0x81')]=function(_0x34cacd,_0x27c561){var _0x8a9a15=shared[_0xbd0b('0x82')];var _0x1b582f=[];_[_0xbd0b('0x12')](_0x8a9a15,function(_0x1e230f){_0x1b582f[_0xbd0b('0x83')]({'id':_0x1e230f[_0xbd0b('0x10')],'name':_0x1e230f[_0xbd0b('0x10')],'utcOffset':_0x1e230f[_0xbd0b('0x84')]});});return _0x27c561[_0xbd0b('0x5d')](0xc8)['json']({'tz':_0x1b582f});};exports[_0xbd0b('0x85')]=function(_0x2a86f5,_0x2dc361){var _0x6fecbe=shared[_0xbd0b('0x82')];var _0x336993={};if(!_[_0xbd0b('0x58')](_0x6fecbe[_0x2a86f5[_0xbd0b('0x40')]['id']]))_0x336993=_0x6fecbe[_0x2a86f5[_0xbd0b('0x40')]['id']];return _0x2dc361[_0xbd0b('0x5d')](0xc8)[_0xbd0b('0x5')](_0x336993);};
\ No newline at end of file
+var _0xf873=['campaigntype','ContactId','lastName','isNil','firstName','calleridname','CmHopperFinal','CmHopperAdditionalPhone','end','CmContact','user','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','CmCompany','CmList','List','Queue','dialActive','getPreviewRecall','recallme','Contact','Company','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','timezones','utcOffset','getTimezone','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','then','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','concat','$and','$or','$gt','$gte','$lt','$ne','$eq','$not','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','CmHopper','include','findAll','rows','catch','params','includeAll','find','create','update','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xf873,0xb2));var _0x3f87=function(_0x28531e,_0x368c16){_0x28531e=_0x28531e-0x0;var _0x3970cf=_0xf873[_0x28531e];return _0x3970cf;};'use strict';var moment=require('moment');var _=require(_0x3f87('0x0'));var qs=require(_0x3f87('0x1'));var logger=require(_0x3f87('0x2'))(_0x3f87('0x3'));var shared=require(_0x3f87('0x4'));var db=require(_0x3f87('0x5'))['db'];function respondWithResult(_0x2fbb4f,_0x1d68dd){_0x1d68dd=_0x1d68dd||0xc8;return function(_0x3c80d6){if(_0x3c80d6){return _0x2fbb4f['status'](_0x1d68dd)[_0x3f87('0x6')](_0x3c80d6);}};}function respondWithFilteredResult(_0x43c8e4,_0x27c03e){return function(_0x5a5e37){if(_0x5a5e37){var _0x8bf89b=typeof _0x27c03e[_0x3f87('0x7')]===_0x3f87('0x8')&&typeof _0x27c03e[_0x3f87('0x9')]===_0x3f87('0x8');var _0xf9513e=_0x5a5e37['count'];var _0x1405ca=_0x8bf89b?0x0:_0x27c03e[_0x3f87('0x7')];var _0x32e236=_0x8bf89b?_0x5a5e37[_0x3f87('0xa')]:_0x27c03e[_0x3f87('0x7')]+_0x27c03e[_0x3f87('0x9')];var _0x2aa592;if(_0x32e236>=_0xf9513e){_0x32e236=_0xf9513e;_0x2aa592=0xc8;}else{_0x2aa592=0xce;}_0x43c8e4[_0x3f87('0xb')](_0x2aa592);return _0x43c8e4[_0x3f87('0xc')](_0x3f87('0xd'),_0x1405ca+'-'+_0x32e236+'/'+_0xf9513e)[_0x3f87('0x6')](_0x5a5e37);}return null;};}function saveUpdates(_0x593e9,_0xfd5b65){return function(_0x160861){if(_0x160861){return _0x160861['update'](_0x593e9)[_0x3f87('0xe')](function(_0x1da47f){return _0x1da47f;});}return null;};}function handleEntityNotFound(_0x4ea5c1,_0x1cfba3){return function(_0x14324f){if(!_0x14324f){_0x4ea5c1[_0x3f87('0xf')](0x194);}return _0x14324f;};}function handleError(_0x28cb47,_0x3f192a){_0x3f192a=_0x3f192a||0x1f4;return function(_0x1c8fb0){logger[_0x3f87('0x10')](_0x1c8fb0[_0x3f87('0x11')]);if(_0x1c8fb0['name']){delete _0x1c8fb0[_0x3f87('0x12')];}_0x28cb47[_0x3f87('0xb')](_0x3f192a)[_0x3f87('0x13')](_0x1c8fb0);};}exports['index']=function(_0x3c6fbe,_0x56d79e){var _0x190d7d={},_0x13550c={},_0x285b2c={'count':0x0,'rows':[]};var _0x279eba=_[_0x3f87('0x14')](db['CmHopper'][_0x3f87('0x15')],function(_0x2372d3){return{'name':_0x2372d3[_0x3f87('0x16')],'type':_0x2372d3[_0x3f87('0x17')]['key']};});_0x13550c['model']=_['map'](_0x279eba,_0x3f87('0x12'));_0x13550c[_0x3f87('0x18')]=_[_0x3f87('0x19')](_0x3c6fbe['query']);_0x13550c[_0x3f87('0x1a')]=_[_0x3f87('0x1b')](_0x13550c[_0x3f87('0x1c')],_0x13550c[_0x3f87('0x18')]);_0x13550c[_0x3f87('0x1a')]=_[_0x3f87('0x1d')](_0x13550c[_0x3f87('0x1a')],[_0x3f87('0x1e'),_0x3f87('0x1f'),_0x3f87('0x20'),_0x3f87('0x21'),_0x3f87('0x22'),'$lte',_0x3f87('0x23'),_0x3f87('0x24'),_0x3f87('0x25'),'$between','$notBetween',_0x3f87('0x26'),_0x3f87('0x27'),_0x3f87('0x28'),_0x3f87('0x29'),_0x3f87('0x2a'),_0x3f87('0x2b'),_0x3f87('0x28'),_0x3f87('0x2c'),_0x3f87('0x2d'),_0x3f87('0x2e'),_0x3f87('0x2f')]);_0x190d7d[_0x3f87('0x30')]=_[_0x3f87('0x1b')](_0x13550c[_0x3f87('0x1c')],qs[_0x3f87('0x31')](_0x3c6fbe[_0x3f87('0x18')]['fields']));_0x190d7d[_0x3f87('0x30')]=_0x190d7d[_0x3f87('0x30')][_0x3f87('0x32')]?_0x190d7d[_0x3f87('0x30')]:_0x13550c['model'];if(!_0x3c6fbe['query']['hasOwnProperty'](_0x3f87('0x33'))){_0x190d7d[_0x3f87('0x9')]=qs[_0x3f87('0x9')](_0x3c6fbe[_0x3f87('0x18')][_0x3f87('0x9')]);_0x190d7d['offset']=qs[_0x3f87('0x7')](_0x3c6fbe['query'][_0x3f87('0x7')]);}_0x190d7d[_0x3f87('0x34')]=qs[_0x3f87('0x35')](_0x3c6fbe[_0x3f87('0x18')][_0x3f87('0x35')]);_0x190d7d[_0x3f87('0x36')]=qs[_0x3f87('0x1a')](_['pick'](_0x3c6fbe['query'],_0x13550c[_0x3f87('0x1a')]),_0x279eba);if(_0x3c6fbe[_0x3f87('0x18')][_0x3f87('0x37')]){_0x190d7d[_0x3f87('0x36')]=_[_0x3f87('0x38')](_0x190d7d[_0x3f87('0x36')],{'$or':_[_0x3f87('0x14')](_0x279eba,function(_0x4bc0bf){if(_0x4bc0bf[_0x3f87('0x17')]!=='VIRTUAL'){var _0x328946={};_0x328946[_0x4bc0bf[_0x3f87('0x12')]]={'$like':'%'+_0x3c6fbe[_0x3f87('0x18')][_0x3f87('0x37')]+'%'};return _0x328946;}})});}_0x190d7d=_['merge']({},_0x190d7d,_0x3c6fbe[_0x3f87('0x39')]);var _0x54fe61={'where':_0x190d7d[_0x3f87('0x36')]};return db[_0x3f87('0x3a')][_0x3f87('0xa')](_0x54fe61)[_0x3f87('0xe')](function(_0x116900){_0x285b2c['count']=_0x116900;if(_0x3c6fbe['query']['includeAll']){_0x190d7d[_0x3f87('0x3b')]=[{'all':!![]}];}return db[_0x3f87('0x3a')][_0x3f87('0x3c')](_0x190d7d);})[_0x3f87('0xe')](function(_0x11352f){_0x285b2c[_0x3f87('0x3d')]=_0x11352f;return _0x285b2c;})['then'](respondWithFilteredResult(_0x56d79e,_0x190d7d))[_0x3f87('0x3e')](handleError(_0x56d79e,null));};exports['show']=function(_0x46a806,_0xe66e09){var _0x4cd683={'raw':!![],'where':{'id':_0x46a806[_0x3f87('0x3f')]['id']}},_0x456b22={};_0x456b22[_0x3f87('0x1c')]=_['keys'](db[_0x3f87('0x3a')]['rawAttributes']);_0x456b22['query']=_[_0x3f87('0x19')](_0x46a806[_0x3f87('0x18')]);_0x456b22[_0x3f87('0x1a')]=_[_0x3f87('0x1b')](_0x456b22[_0x3f87('0x1c')],_0x456b22['query']);_0x4cd683[_0x3f87('0x30')]=_[_0x3f87('0x1b')](_0x456b22[_0x3f87('0x1c')],qs[_0x3f87('0x31')](_0x46a806['query'][_0x3f87('0x31')]));_0x4cd683[_0x3f87('0x30')]=_0x4cd683[_0x3f87('0x30')][_0x3f87('0x32')]?_0x4cd683[_0x3f87('0x30')]:_0x456b22[_0x3f87('0x1c')];if(_0x46a806[_0x3f87('0x18')][_0x3f87('0x40')]){_0x4cd683['include']=[{'all':!![]}];}_0x4cd683=_['merge']({},_0x4cd683,_0x46a806[_0x3f87('0x39')]);return db[_0x3f87('0x3a')][_0x3f87('0x41')](_0x4cd683)[_0x3f87('0xe')](handleEntityNotFound(_0xe66e09,null))[_0x3f87('0xe')](respondWithResult(_0xe66e09,null))[_0x3f87('0x3e')](handleError(_0xe66e09,null));};exports[_0x3f87('0x42')]=function(_0x4334fa,_0x3f3a0f){return db[_0x3f87('0x3a')][_0x3f87('0x42')](_0x4334fa['body'],{})[_0x3f87('0xe')](respondWithResult(_0x3f3a0f,0xc9))[_0x3f87('0x3e')](handleError(_0x3f3a0f,null));};exports[_0x3f87('0x43')]=function(_0x2fec6b,_0x2bec12){if(_0x2fec6b[_0x3f87('0x44')]['id']){delete _0x2fec6b[_0x3f87('0x44')]['id'];}return db[_0x3f87('0x3a')][_0x3f87('0x41')]({'where':{'id':_0x2fec6b[_0x3f87('0x3f')]['id']}})[_0x3f87('0xe')](handleEntityNotFound(_0x2bec12,null))['then'](saveUpdates(_0x2fec6b[_0x3f87('0x44')],null))[_0x3f87('0xe')](respondWithResult(_0x2bec12,null))[_0x3f87('0x3e')](handleError(_0x2bec12,null));};exports['describe']=function(_0x19d928,_0x3b55f4){return db[_0x3f87('0x3a')][_0x3f87('0x45')]()[_0x3f87('0xe')](respondWithResult(_0x3b55f4,null))[_0x3f87('0x3e')](handleError(_0x3b55f4,null));};exports[_0x3f87('0x46')]=function(_0x5799eb,_0x163ebf){var _0x5e1240;var _0x1b8ea3=_0x5799eb[_0x3f87('0x3f')]['id'];return db[_0x3f87('0x3a')][_0x3f87('0x41')]({'where':{'id':_0x5799eb[_0x3f87('0x3f')]['id']}})[_0x3f87('0xe')](handleEntityNotFound(_0x163ebf,null))[_0x3f87('0xe')](function(_0x2c9647){if(_0x2c9647){return _0x2c9647[_0x3f87('0x46')]()[_0x3f87('0xe')](function(_0x53783f){return _0x53783f;});}})[_0x3f87('0xe')](function(_0x5d3df0){_0x5e1240=_0x5d3df0;if(_0x5d3df0){if(_0x5d3df0[_0x3f87('0x47')]||_0x5d3df0[_0x3f87('0x48')]){return db[_0x5d3df0[_0x3f87('0x47')]?_0x3f87('0x49'):_0x3f87('0x4a')][_0x3f87('0x41')]({'where':{'id':_0x5d3df0['VoiceQueueId']?_0x5d3df0[_0x3f87('0x47')]:_0x5d3df0[_0x3f87('0x48')]},'attributes':['id',_0x3f87('0x12')],'raw':!![]});}}})[_0x3f87('0xe')](function(_0x331ce9){var _0x46377d={};if(_0x331ce9){_[_0x3f87('0x38')](_0x46377d,_[_0x3f87('0x4b')](_0x5e1240[_0x3f87('0x4c')],[_0x3f87('0x4d'),_0x3f87('0x4e'),'id']));_0x46377d[_0x3f87('0x4f')]=0x15;_0x46377d[_0x3f87('0x50')]=_0x3f87('0x51');_0x46377d[_0x3f87('0x52')]=_0x331ce9[_0x3f87('0x12')];_0x46377d['membername']=_0x5799eb['user']['name'];_0x46377d[_0x3f87('0x53')]=_0x5799eb['user']['id'];_0x46377d[_0x3f87('0x51')]=!![];_0x46377d[_0x3f87('0x54')]=moment()[_0x3f87('0x55')](_0x3f87('0x56'));_0x46377d['calleridnum']=_0x5e1240[_0x3f87('0x57')];_0x46377d[_0x3f87('0x58')]=_0x5e1240[_0x3f87('0x47')]?'queue':'ivr';return db['CmContact'][_0x3f87('0x41')]({'where':{'id':_0x46377d[_0x3f87('0x59')]},'attributes':['firstName',_0x3f87('0x5a')]})[_0x3f87('0xe')](function(_0x18e3bd){if(!_[_0x3f87('0x5b')](_0x163ebf)&&!_[_0x3f87('0x5b')](_0x18e3bd[_0x3f87('0x5c')])){_0x46377d[_0x3f87('0x5d')]=_0x18e3bd[_0x3f87('0x5c')];if(!_[_0x3f87('0x5b')](_0x18e3bd[_0x3f87('0x5a')])){_0x46377d[_0x3f87('0x5d')]+='\x20'+_0x18e3bd[_0x3f87('0x5a')];}}})['finally'](function(){return db[_0x3f87('0x5e')][_0x3f87('0x42')](_0x46377d);});}})[_0x3f87('0xe')](function(_0x1d1156){return db[_0x3f87('0x5f')][_0x3f87('0x46')]({'where':{'CmHopperId':_0x1b8ea3}});})[_0x3f87('0xe')](function(){return _0x163ebf[_0x3f87('0xb')](0xcc)[_0x3f87('0x60')]();})[_0x3f87('0x3e')](handleError(_0x163ebf,null));};exports['getPreview']=function(_0x415766,_0x55a797){var _0x32b0f5=[];return db[_0x3f87('0x61')][_0x3f87('0x45')]()[_0x3f87('0xe')](function(_0x4b2960){_0x32b0f5=_['keys'](_0x4b2960);return _0x415766[_0x3f87('0x62')][_0x3f87('0x63')]({'where':{'type':_0x3f87('0x64'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x3f87('0x65'),_0x3f87('0x66')],'raw':!![]});})[_0x3f87('0xe')](function(_0x4b3573){if(_0x4b3573&&_0x4b3573[_0x3f87('0x32')]){return db[_0x3f87('0x67')][_0x3f87('0x68')](function(_0x4bd24a){var _0x54241d={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3f87('0x55')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x3f87('0x14')](_0x4b3573,'id')},'$or':[{'UserId':null},{'UserId':_0x415766[_0x3f87('0x62')]['id']}]};var _0x5a48b9={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4b3573)[_0x3f87('0x37')]([_0x3f87('0x66'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x415766[_0x3f87('0x62')]['id']}]};var _0x4631e7={'$or':[_0x54241d,_0x5a48b9]};var _0x1415a9=[];if(_0x415766[_0x3f87('0x44')][_0x3f87('0x69')]&&_0x415766[_0x3f87('0x44')][_0x3f87('0x69')]===_0x3f87('0x6a')){if(!_[_0x3f87('0x6b')](_0x415766[_0x3f87('0x44')][_0x3f87('0x6c')])){_0x4631e7['id']={'$in':_0x415766[_0x3f87('0x44')][_0x3f87('0x6c')]};}_0x1415a9=[[_0x3f87('0x6d'),_0x3f87('0x6e')],[_0x3f87('0x6f'),_0x4b3573[0x0]['dialOrderByScheduledAt']===_0x3f87('0x6e')?_0x3f87('0x70'):_0x3f87('0x6e')],db[_0x3f87('0x67')]['literal'](_0x3f87('0x71')),['id',_0x3f87('0x70')]];}else{if(!_[_0x3f87('0x6b')](_0x415766[_0x3f87('0x44')][_0x3f87('0x6c')])){_0x4631e7['id']={'$notIn':_0x415766[_0x3f87('0x44')][_0x3f87('0x6c')]};}_0x1415a9=[['priority','DESC'],[_0x3f87('0x6f'),_0x4b3573[0x0][_0x3f87('0x65')]],db['sequelize']['literal'](_0x3f87('0x72')),['id',_0x3f87('0x6e')]];}return db['CmHopper'][_0x3f87('0x73')]({'attributes':['id',_0x3f87('0x74'),'phone','recallme'],'where':_0x4631e7,'order':_0x1415a9,'transaction':_0x4bd24a,'lock':_0x4bd24a[_0x3f87('0x75')][_0x3f87('0x76')],'include':[{'model':db[_0x3f87('0x61')],'as':'Contact','attributes':_0x32b0f5,'include':[{'model':db[_0x3f87('0x77')],'as':'Company','attributes':['id',_0x3f87('0x12')]}]},{'model':db[_0x3f87('0x78')],'as':_0x3f87('0x79'),'attributes':['id',_0x3f87('0x12')]},{'model':db[_0x3f87('0x49')],'as':_0x3f87('0x7a'),'attributes':['id','name',_0x3f87('0x7b')]}]})[_0x3f87('0xe')](function(_0x374007){if(_0x374007){return _0x374007[_0x3f87('0x43')]({'UserId':_0x415766[_0x3f87('0x62')]['id']},{'transaction':_0x4bd24a});}});});}})[_0x3f87('0xe')](handleEntityNotFound(_0x55a797,null))[_0x3f87('0xe')](respondWithResult(_0x55a797,null))['catch'](handleError(_0x55a797,null));};exports[_0x3f87('0x7c')]=function(_0x23569b,_0x35faf7,_0x14392d){var _0x5e23d8=[];var _0x3e8390=_0x23569b[_0x3f87('0x3f')]['id'];var _0x19158e=_0x23569b[_0x3f87('0x62')]['id'];return db[_0x3f87('0x61')]['describe']()['then'](function(_0x32ea0c){_0x5e23d8=_['keys'](_0x32ea0c);return db[_0x3f87('0x67')][_0x3f87('0x68')](function(_0x475a4d){const _0xd38b40={'id':_0x3e8390};return db[_0x3f87('0x3a')][_0x3f87('0x73')]({'attributes':['id',_0x3f87('0x74'),_0x3f87('0x7d')],'where':_0xd38b40,'transaction':_0x475a4d,'lock':_0x475a4d[_0x3f87('0x75')]['UPDATE'],'include':[{'model':db[_0x3f87('0x61')],'as':_0x3f87('0x7e'),'attributes':_0x5e23d8,'include':[{'model':db['CmCompany'],'as':_0x3f87('0x7f'),'attributes':['id',_0x3f87('0x12')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x3f87('0x12')]},{'model':db[_0x3f87('0x49')],'as':_0x3f87('0x7a'),'attributes':['id',_0x3f87('0x12'),_0x3f87('0x7b')]}]})[_0x3f87('0xe')](function(_0x112634){if(_0x112634){return _0x112634[_0x3f87('0x43')]({'UserId':_0x19158e},{'transaction':_0x475a4d});}});});})[_0x3f87('0xe')](handleEntityNotFound(_0x35faf7,null))[_0x3f87('0xe')](respondWithResult(_0x35faf7,null))[_0x3f87('0x3e')](handleError(_0x35faf7,null));};exports[_0x3f87('0x80')]=function(_0x175e8c,_0x580919){return _0x175e8c[_0x3f87('0x62')][_0x3f87('0x63')]({'where':{'type':_0x3f87('0x64'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x3f87('0xe')](function(_0x41b5d0){if(_0x41b5d0&&_0x41b5d0['length']){return db[_0x3f87('0x3a')][_0x3f87('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3f87('0x55')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x3f87('0x14')](_0x41b5d0,'id')},'$or':[{'UserId':null},{'UserId':_0x175e8c[_0x3f87('0x62')]['id']}]}});}return 0x0;})['then'](function(_0x182484){if(!_[_0x3f87('0x5b')](_0x182484)&&_['isNumber'](_0x182484)){return _0x580919[_0x3f87('0xb')](0xc8)[_0x3f87('0x6')]({'contacts':_0x182484});}else{logger[_0x3f87('0x10')](_0x3f87('0x81'),_0x3f87('0x80'),0x194,'entity\x20not\x20found');_0x580919['sendStatus'](0x194);}})[_0x3f87('0x3e')](handleError(_0x580919,null));};exports['getTimezones']=function(_0x4dae45,_0x46dd17){var _0x49c4c1=shared[_0x3f87('0x82')];var _0x3d037c=[];_['map'](_0x49c4c1,function(_0x39c7f2){_0x3d037c['push']({'id':_0x39c7f2[_0x3f87('0x12')],'name':_0x39c7f2['name'],'utcOffset':_0x39c7f2[_0x3f87('0x83')]});});return _0x46dd17[_0x3f87('0xb')](0xc8)[_0x3f87('0x6')]({'tz':_0x3d037c});};exports[_0x3f87('0x84')]=function(_0x3e6185,_0x1d217b){var _0x2b5d8a=shared[_0x3f87('0x82')];var _0x3d8846={};if(!_[_0x3f87('0x5b')](_0x2b5d8a[_0x3e6185[_0x3f87('0x44')]['id']]))_0x3d8846=_0x2b5d8a[_0x3e6185[_0x3f87('0x44')]['id']];return _0x1d217b[_0x3f87('0xb')](0xc8)['json'](_0x3d8846);};
\ No newline at end of file
index 642d80b..30b5f8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeda8=['exports','define','cm_hopper','scheduledat','phone','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x3aac82,_0x116e4c){var _0x4d2147=function(_0x43e4dc){while(--_0x43e4dc){_0x3aac82['push'](_0x3aac82['shift']());}};_0x4d2147(++_0x116e4c);}(_0xeda8,0x104));var _0x8eda=function(_0x49c690,_0x348906){_0x49c690=_0x49c690-0x0;var _0x5564bc=_0xeda8[_0x49c690];return _0x5564bc;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('CmHopper',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[{'name':_0x8eda('0xd'),'fields':[_0x8eda('0xd')]},{'name':_0x8eda('0xe'),'fields':['phone']},{'name':'priority','fields':['priority']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x814b=['phone','priority','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat'];(function(_0x28b077,_0xe071ed){var _0x43b3d3=function(_0x597b0a){while(--_0x597b0a){_0x28b077['push'](_0x28b077['shift']());}};_0x43b3d3(++_0xe071ed);}(_0x814b,0x1a2));var _0xb814=function(_0xc8a02c,_0x4809d3){_0xc8a02c=_0xc8a02c-0x0;var _0x3d89da=_0x814b[_0xc8a02c];return _0x3d89da;};'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':'cm_hopper','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]},{'name':_0xb814('0xe'),'fields':[_0xb814('0xe')]},{'name':_0xb814('0xf'),'fields':[_0xb814('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 9bb8423..d39dd1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6478=['User','voicePause','length','UserId','push','update','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','ContactId','dataValues','active','GetContactDialer','sequelize','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','\x22%s\x22','format','contactsRescheduled','GetContactRecallMe','LOCK','keys','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','Agent','name','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCmHopper','CmHopper','findAll','options','where','attributes','limit','include','map','model','catch','ShowCmHopper','find','raw','create','CreateCmHopper','body','UpdateCmHopper','DestroyCmHopper','destroy','CmContact','describe','transaction','order','UPDATE','Contact'];(function(_0xce4b46,_0xbe3d59){var _0x4decca=function(_0x1212bd){while(--_0x1212bd){_0xce4b46['push'](_0xce4b46['shift']());}};_0x4decca(++_0xbe3d59);}(_0x6478,0x1e7));var _0x8647=function(_0x404a11,_0x5d5647){_0x404a11=_0x404a11-0x0;var _0x471865=_0x6478[_0x404a11];return _0x471865;};'use strict';var _=require(_0x8647('0x0'));var util=require(_0x8647('0x1'));var moment=require(_0x8647('0x2'));var BPromise=require(_0x8647('0x3'));var db=require(_0x8647('0x4'))['db'];var logger=require(_0x8647('0x5'))('rpc');var jayson=require(_0x8647('0x6'));var client=jayson[_0x8647('0x7')][_0x8647('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x131957,_0x539d1c,_0x4df3e5){return new BPromise(function(_0x5308e8,_0x5ef3f8){return client[_0x8647('0x9')](_0x131957,_0x4df3e5)[_0x8647('0xa')](function(_0x3abf85){logger[_0x8647('0xb')](_0x8647('0xc'),_0x539d1c,_0x8647('0xd'));logger[_0x8647('0xe')](_0x8647('0xf'),_0x539d1c,_0x8647('0xd'),JSON[_0x8647('0x10')](_0x3abf85));if(_0x3abf85[_0x8647('0x11')]){if(_0x3abf85[_0x8647('0x11')][_0x8647('0x12')]===0x1f4){logger[_0x8647('0x11')](_0x8647('0xc'),_0x539d1c,_0x3abf85[_0x8647('0x11')][_0x8647('0x13')]);return _0x5ef3f8(_0x3abf85['error'][_0x8647('0x13')]);}logger['error'](_0x8647('0xc'),_0x539d1c,_0x3abf85[_0x8647('0x11')][_0x8647('0x13')]);return _0x5308e8(_0x3abf85[_0x8647('0x11')][_0x8647('0x13')]);}else{logger['info'](_0x8647('0xc'),_0x539d1c,_0x8647('0xd'));_0x5308e8(_0x3abf85[_0x8647('0x14')][_0x8647('0x13')]);}})['catch'](function(_0x4bf5af){logger[_0x8647('0x11')](_0x8647('0xc'),_0x539d1c,_0x4bf5af);_0x5ef3f8(_0x4bf5af);});});}exports[_0x8647('0x15')]=function(_0x390d4d){var _0x590eb9=this;return new Promise(function(_0x5caa10,_0x1b02db){return db[_0x8647('0x16')][_0x8647('0x17')]({'raw':_0x390d4d['options']?_0x390d4d[_0x8647('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x390d4d['options']?_0x390d4d['options'][_0x8647('0x19')]||null:null,'attributes':_0x390d4d['options']?_0x390d4d[_0x8647('0x18')][_0x8647('0x1a')]||null:null,'limit':_0x390d4d[_0x8647('0x18')]?_0x390d4d[_0x8647('0x18')][_0x8647('0x1b')]||null:null,'include':_0x390d4d[_0x8647('0x18')]?_0x390d4d[_0x8647('0x18')][_0x8647('0x1c')]?_[_0x8647('0x1d')](_0x390d4d[_0x8647('0x18')][_0x8647('0x1c')],function(_0x229b20){return{'model':db[_0x229b20['model']],'as':_0x229b20['as'],'attributes':_0x229b20[_0x8647('0x1a')],'include':_0x229b20[_0x8647('0x1c')]?_[_0x8647('0x1d')](_0x229b20['include'],function(_0x5670e3){return{'model':db[_0x5670e3[_0x8647('0x1e')]],'as':_0x5670e3['as'],'attributes':_0x5670e3[_0x8647('0x1a')],'include':_0x5670e3[_0x8647('0x1c')]?_['map'](_0x5670e3[_0x8647('0x1c')],function(_0x1d9cc3){return{'model':db[_0x1d9cc3['model']],'as':_0x1d9cc3['as'],'attributes':_0x1d9cc3[_0x8647('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8647('0xa')](function(_0x491e5){logger['info']('GetCmHopper',_0x390d4d);logger[_0x8647('0xe')](_0x8647('0x15'),_0x390d4d,JSON[_0x8647('0x10')](_0x491e5));_0x5caa10(_0x491e5);})[_0x8647('0x1f')](function(_0x412f97){logger[_0x8647('0x11')](_0x8647('0x15'),_0x412f97[_0x8647('0x13')],_0x390d4d);_0x1b02db(_0x590eb9['error'](0x1f4,_0x412f97[_0x8647('0x13')]));});});};exports[_0x8647('0x20')]=function(_0x439599){var _0x340416=this;return new Promise(function(_0x50c178,_0x1a3066){return db['CmHopper'][_0x8647('0x21')]({'raw':_0x439599[_0x8647('0x18')]?_0x439599[_0x8647('0x18')][_0x8647('0x22')]===undefined?!![]:![]:!![],'where':_0x439599[_0x8647('0x18')]?_0x439599[_0x8647('0x18')][_0x8647('0x19')]||null:null,'attributes':_0x439599[_0x8647('0x18')]?_0x439599[_0x8647('0x18')]['attributes']||null:null,'include':_0x439599[_0x8647('0x18')]?_0x439599[_0x8647('0x18')][_0x8647('0x1c')]?_[_0x8647('0x1d')](_0x439599[_0x8647('0x18')]['include'],function(_0x16b73f){return{'model':db[_0x16b73f[_0x8647('0x1e')]],'as':_0x16b73f['as'],'attributes':_0x16b73f[_0x8647('0x1a')],'include':_0x16b73f[_0x8647('0x1c')]?_[_0x8647('0x1d')](_0x16b73f[_0x8647('0x1c')],function(_0x1201b0){return{'model':db[_0x1201b0[_0x8647('0x1e')]],'as':_0x1201b0['as'],'attributes':_0x1201b0['attributes'],'include':_0x1201b0[_0x8647('0x1c')]?_[_0x8647('0x1d')](_0x1201b0[_0x8647('0x1c')],function(_0x92f00c){return{'model':db[_0x92f00c[_0x8647('0x1e')]],'as':_0x92f00c['as'],'attributes':_0x92f00c[_0x8647('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8647('0xa')](function(_0x5ba7f6){logger['info'](_0x8647('0x20'),_0x439599);logger[_0x8647('0xe')](_0x8647('0x20'),_0x439599,JSON['stringify'](_0x5ba7f6));_0x50c178(_0x5ba7f6);})[_0x8647('0x1f')](function(_0x161b4b){logger[_0x8647('0x11')](_0x8647('0x20'),_0x161b4b[_0x8647('0x13')],_0x439599);_0x1a3066(_0x340416[_0x8647('0x11')](0x1f4,_0x161b4b[_0x8647('0x13')]));});});};exports['CreateCmHopper']=function(_0xc09195){var _0x3298ef=this;return new Promise(function(_0x2c7c64,_0x56f5a4){return db[_0x8647('0x16')][_0x8647('0x23')](_0xc09195['body'],{'raw':_0xc09195[_0x8647('0x18')]?_0xc09195[_0x8647('0x18')][_0x8647('0x22')]===undefined?!![]:![]:!![]})[_0x8647('0xa')](function(_0xd54bad){logger[_0x8647('0xb')](_0x8647('0x24'),_0xc09195);logger[_0x8647('0xe')](_0x8647('0x24'),_0xc09195,JSON[_0x8647('0x10')](_0xd54bad));_0x2c7c64(_0xd54bad);})[_0x8647('0x1f')](function(_0x49b023){logger[_0x8647('0x11')](_0x8647('0x24'),_0x49b023['message'],_0xc09195);_0x56f5a4(_0x3298ef[_0x8647('0x11')](0x1f4,_0x49b023[_0x8647('0x13')]));});});};exports['UpdateCmHopper']=function(_0x5a5e71){var _0x1f626f=this;return new Promise(function(_0x5eedf2,_0x4698c0){return db[_0x8647('0x16')]['update'](_0x5a5e71[_0x8647('0x25')],{'raw':_0x5a5e71[_0x8647('0x18')]?_0x5a5e71[_0x8647('0x18')][_0x8647('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a5e71[_0x8647('0x18')]?_0x5a5e71[_0x8647('0x18')]['where']||null:null,'attributes':_0x5a5e71['options']?_0x5a5e71[_0x8647('0x18')][_0x8647('0x1a')]||null:null,'limit':_0x5a5e71[_0x8647('0x18')]?_0x5a5e71[_0x8647('0x18')][_0x8647('0x1b')]||null:null})[_0x8647('0xa')](function(_0x3749de){logger[_0x8647('0xb')]('UpdateCmHopper',_0x5a5e71);logger[_0x8647('0xb')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x8647('0x10')](_0x5a5e71['options'][_0x8647('0x19')]),_0x5a5e71['body']['active']);logger[_0x8647('0xe')](_0x8647('0x26'),_0x5a5e71,JSON[_0x8647('0x10')](_0x3749de));_0x5eedf2(_0x3749de);})['catch'](function(_0xaa5a33){logger[_0x8647('0x11')](_0x8647('0x26'),_0xaa5a33[_0x8647('0x13')],_0x5a5e71);_0x4698c0(_0x1f626f[_0x8647('0x11')](0x1f4,_0xaa5a33[_0x8647('0x13')]));});});};exports[_0x8647('0x27')]=function(_0x2c3d51){var _0xc13f2d=this;return new Promise(function(_0xdbb785,_0x3bdaea){return db[_0x8647('0x16')][_0x8647('0x28')]({'where':_0x2c3d51[_0x8647('0x18')]?_0x2c3d51['options'][_0x8647('0x19')]||null:null})[_0x8647('0xa')](function(_0x42527f){logger[_0x8647('0xb')](_0x8647('0x27'),_0x2c3d51);logger[_0x8647('0xe')]('DestroyCmHopper',_0x2c3d51,JSON[_0x8647('0x10')](_0x42527f));_0xdbb785(_0x42527f);})['catch'](function(_0x38346c){logger[_0x8647('0x11')](_0x8647('0x27'),_0x38346c[_0x8647('0x13')],_0x2c3d51);_0x3bdaea(_0xc13f2d[_0x8647('0x11')](0x1f4,_0x38346c[_0x8647('0x13')]));});});};exports['GetContactDialer']=function(_0x470b06){var _0x368384=this;return new Promise(function(_0x182f47,_0xc9d92e){return db[_0x8647('0x29')][_0x8647('0x2a')]()[_0x8647('0xa')](function(_0x13cb06){return db['sequelize'][_0x8647('0x2b')](function(_0xc652a8){return db[_0x8647('0x16')]['findAll']({'where':_0x470b06[_0x8647('0x18')]?_0x470b06[_0x8647('0x18')][_0x8647('0x19')]||null:null,'attributes':_0x470b06['options']?_0x470b06[_0x8647('0x18')][_0x8647('0x1a')]||null:null,'limit':_0x470b06[_0x8647('0x18')]?_0x470b06[_0x8647('0x18')][_0x8647('0x1b')]||null:null,'order':_0x470b06['options']?_0x470b06[_0x8647('0x18')][_0x8647('0x2c')]||null:null,'transaction':_0xc652a8,'lock':_0xc652a8['LOCK'][_0x8647('0x2d')],'include':[{'model':db[_0x8647('0x29')],'as':_0x8647('0x2e'),'attributes':_['keys'](_0x13cb06)},{'model':db[_0x8647('0x2f')],'as':'Agent','attributes':['id','name',_0x8647('0x30')]}]})[_0x8647('0xa')](function(_0xa8cbf0){var _0x13e99e=[];var _0x31550b=[];for(var _0x50e3b1=0x0;_0x50e3b1<_0xa8cbf0[_0x8647('0x31')];_0x50e3b1+=0x1){var _0x1220c0=_0xa8cbf0[_0x50e3b1][_0x8647('0x32')];if(_0x1220c0===null){_0x13e99e[_0x8647('0x33')](_0xa8cbf0[_0x50e3b1][_0x8647('0x34')](_0x470b06[_0x8647('0x25')],{'transaction':_0xc652a8}));}else if(!_0x31550b['includes'](_0x1220c0)){_0x31550b['push'](_0x1220c0);_0x13e99e[_0x8647('0x33')](_0xa8cbf0[_0x50e3b1][_0x8647('0x34')](_0x470b06[_0x8647('0x25')],{'transaction':_0xc652a8}));}}return BPromise[_0x8647('0x35')](_0x13e99e);});})[_0x8647('0xa')](function(_0x5eefda){logger[_0x8647('0xb')]('GetContactDialer',_0x470b06);if(_0x5eefda[_0x8647('0x31')]>0x0){logger[_0x8647('0xb')](_0x8647('0x36'),_0x5eefda[0x0]['dataValues']['id'],_0x5eefda[0x0]['dataValues'][_0x8647('0x37')],_0x5eefda[0x0][_0x8647('0x38')][_0x8647('0x39')]);}logger[_0x8647('0xe')](_0x8647('0x3a'),_0x470b06,JSON[_0x8647('0x10')](_0x5eefda));_0x182f47(_0x5eefda);})['catch'](function(_0x2dab62){logger[_0x8647('0x11')]('GetContactDialer',_0x2dab62[_0x8647('0x13')],_0x470b06);_0xc9d92e(_0x368384[_0x8647('0x11')](0x1f4,_0x2dab62[_0x8647('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x4fad46){var _0x4e8569=this;return new Promise(function(_0xfdb158,_0xdd8231){return db[_0x8647('0x3b')][_0x8647('0x2b')](function(_0x4ca2d5){return db['CmHopperFinal'][_0x8647('0x23')](_0x4fad46['body'],{'raw':_0x4fad46['options']?_0x4fad46[_0x8647('0x18')][_0x8647('0x22')]===undefined?!![]:![]:!![],'transaction':_0x4ca2d5})['then'](function(){logger[_0x8647('0xb')](_0x8647('0x3c'),JSON[_0x8647('0x10')](_0x4fad46['options'][_0x8647('0x19')]),_0x4fad46['options'][_0x8647('0x19')][_0x8647('0x39')]);return db[_0x8647('0x16')]['destroy']({'where':_0x4fad46['options']?_0x4fad46[_0x8647('0x18')]['where']||null:null,'transaction':_0x4ca2d5});});})[_0x8647('0xa')](function(_0x465b15){logger['info'](_0x8647('0x3d'),_0x4fad46);logger[_0x8647('0xe')](_0x8647('0x3d'),_0x4fad46,JSON[_0x8647('0x10')](_0x465b15));_0xfdb158(_0x465b15);})[_0x8647('0x1f')](function(_0x200dd3){logger['error'](_0x8647('0x3d'),_0x200dd3[_0x8647('0x13')],_0x4fad46);_0xdd8231(_0x4e8569[_0x8647('0x11')](0x1f4,_0x200dd3['message']));});});};exports[_0x8647('0x3e')]=function(_0xa0a827){var _0x3d5611=this;return new Promise(function(_0x5c822a,_0x1170b6){return db['CmHopper'][_0x8647('0x17')]({'raw':_0xa0a827[_0x8647('0x18')]?_0xa0a827['options'][_0x8647('0x22')]===undefined?!![]:![]:!![],'where':_0xa0a827[_0x8647('0x18')]?_0xa0a827[_0x8647('0x18')][_0x8647('0x19')]||null:null,'attributes':[[db[_0x8647('0x3b')]['fn'](_0x8647('0x3f'),db['sequelize']['fn']('IF',db[_0x8647('0x3b')][_0x8647('0x40')]('`scheduledat`\x20>=\x20'+util['format'](_0x8647('0x41'),moment()[_0x8647('0x42')]('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0x8647('0x43')]]})[_0x8647('0xa')](function(_0xa6f8b5){logger[_0x8647('0xb')](_0x8647('0x3e'),_0xa0a827);logger[_0x8647('0xe')]('CountReScheduled',_0xa0a827,JSON[_0x8647('0x10')](_0xa6f8b5));_0x5c822a(_0xa6f8b5);})[_0x8647('0x1f')](function(_0x5323e1){logger['error'](_0x8647('0x3e'),_0x5323e1['message'],_0xa0a827);_0x1170b6(_0x3d5611[_0x8647('0x11')](0x1f4,_0x5323e1[_0x8647('0x13')]));});});};exports[_0x8647('0x44')]=function(_0x1b39df){var _0x5bc15b=this;return new Promise(function(_0x52526a,_0x3be618){return db[_0x8647('0x29')]['describe']()[_0x8647('0xa')](function(_0x4f3042){return db['sequelize'][_0x8647('0x2b')](function(_0x4954a4){return db['CmHopper'][_0x8647('0x17')]({'where':_0x1b39df[_0x8647('0x18')]?_0x1b39df[_0x8647('0x18')][_0x8647('0x19')]||null:null,'attributes':_0x1b39df[_0x8647('0x18')]?_0x1b39df['options']['attributes']||null:null,'limit':0x1,'order':_0x1b39df['options']?_0x1b39df[_0x8647('0x18')][_0x8647('0x2c')]||null:null,'group':db[_0x8647('0x16')]['UserId'],'transaction':_0x4954a4,'lock':_0x4954a4[_0x8647('0x45')][_0x8647('0x2d')],'include':_0x1b39df['options']?_0x1b39df[_0x8647('0x18')]['include']?_[_0x8647('0x1d')](_0x1b39df[_0x8647('0x18')][_0x8647('0x1c')],function(_0x11b8ff){return{'model':db[_0x11b8ff[_0x8647('0x1e')]],'as':_0x11b8ff['as'],'attributes':_0x11b8ff[_0x8647('0x1a')],'include':_0x11b8ff[_0x8647('0x1c')]?_[_0x8647('0x1d')](_0x11b8ff['include'],function(_0x2ff082){return{'model':db[_0x2ff082[_0x8647('0x1e')]],'as':_0x2ff082['as'],'attributes':_0x2ff082['attributes'],'include':_0x2ff082[_0x8647('0x1c')]?_['map'](_0x2ff082[_0x8647('0x1c')],function(_0x5318c3){return{'model':db[_0x5318c3[_0x8647('0x1e')]],'as':_0x5318c3['as'],'attributes':_0x5318c3[_0x8647('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ab655){var _0x43b37f=[];for(var _0x60a0a6=0x0;_0x60a0a6<_0x4ab655['length'];_0x60a0a6+=0x1){_0x43b37f[_0x8647('0x33')](_0x4ab655[_0x60a0a6][_0x8647('0x34')](_0x1b39df[_0x8647('0x25')],{'transaction':_0x4954a4}));}return BPromise['all'](_0x43b37f);});})[_0x8647('0xa')](function(_0x5032d4){logger[_0x8647('0xb')](_0x8647('0x44'),_0x1b39df);logger[_0x8647('0xe')](_0x8647('0x44'),_0x1b39df,JSON[_0x8647('0x10')](_0x5032d4));_0x52526a(_0x5032d4);})[_0x8647('0x1f')](function(_0x1f42a5){logger[_0x8647('0x11')](_0x8647('0x44'),_0x1f42a5[_0x8647('0x13')],_0x1b39df);_0x3be618(_0x5bc15b[_0x8647('0x11')](0x1f4,_0x1f42a5[_0x8647('0x13')]));});});});};exports['GetCmHopperPreview']=function(_0x26b17d){var _0x4b2abf=this;return new Promise(function(_0x3829f3,_0x2796a5){db[_0x8647('0x29')][_0x8647('0x2a')]()['then'](function(_0x3cc7e7){return db[_0x8647('0x16')][_0x8647('0x17')]({'raw':_0x26b17d['options']?_0x26b17d['options']['raw']===undefined?!![]:![]:!![],'where':_0x26b17d[_0x8647('0x18')]?_0x26b17d[_0x8647('0x18')][_0x8647('0x19')]||null:null,'attributes':_0x26b17d[_0x8647('0x18')]?_0x26b17d['options'][_0x8647('0x1a')]||null:null,'limit':_0x26b17d['options']?_0x26b17d['options']['limit']||null:null,'include':_0x26b17d['options']?_0x26b17d['options']['include']?_[_0x8647('0x1d')](_0x26b17d[_0x8647('0x18')][_0x8647('0x1c')],function(_0x5be3e7){return{'model':db[_0x5be3e7[_0x8647('0x1e')]],'as':_0x5be3e7['as'],'attributes':_0x5be3e7['as']===_0x8647('0x2e')?_[_0x8647('0x46')](_0x3cc7e7):_0x5be3e7['attributes'],'include':_0x5be3e7['include']?_[_0x8647('0x1d')](_0x5be3e7[_0x8647('0x1c')],function(_0x4dc155){return{'model':db[_0x4dc155['model']],'as':_0x4dc155['as'],'attributes':_0x4dc155[_0x8647('0x1a')],'include':_0x4dc155[_0x8647('0x1c')]?_['map'](_0x4dc155[_0x8647('0x1c')],function(_0x2481fb){return{'model':db[_0x2481fb[_0x8647('0x1e')]],'as':_0x2481fb['as'],'attributes':_0x2481fb[_0x8647('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8647('0xa')](function(_0x3e84bb){logger[_0x8647('0xb')](_0x8647('0x15'),_0x26b17d);logger[_0x8647('0xe')](_0x8647('0x15'),_0x26b17d,JSON[_0x8647('0x10')](_0x3e84bb));_0x3829f3(_0x3e84bb);})[_0x8647('0x1f')](function(_0x55311f){logger[_0x8647('0x11')](_0x8647('0x15'),_0x55311f[_0x8647('0x13')],_0x26b17d);_0x2796a5(_0x4b2abf[_0x8647('0x11')](0x1f4,_0x55311f[_0x8647('0x13')]));});});});};exports[_0x8647('0x47')]=function(_0x31cdf0){var _0x37f2d5=this;return new Promise(function(_0x8c9027,_0x3f2320){return db['CmContact'][_0x8647('0x48')]({'raw':!![],'where':{'phone':_0x31cdf0[_0x8647('0x18')]['where'][_0x8647('0x49')]},'attributes':['id',_0x8647('0x4a')],'order':[['id',_0x8647('0x4b')]]})[_0x8647('0xa')](function(_0x1df108){logger[_0x8647('0xb')]('getContactByPhone',_0x31cdf0);logger['debug'](_0x8647('0x4c'),_0x31cdf0,JSON['stringify'](_0x1df108));_0x8c9027(_0x1df108);})[_0x8647('0x1f')](function(_0x178865){logger['error'](_0x8647('0x4c'),_0x178865[_0x8647('0x13')],_0x31cdf0);_0x3f2320(_0x37f2d5[_0x8647('0x11')](0x1f4,_0x178865[_0x8647('0x13')]));});});};exports[_0x8647('0x4d')]=function(_0xe345f2){var _0x4f5e63=this;return new Promise(function(_0x2ea60e,_0x1a4f0f){return db['sequelize'][_0x8647('0x2b')](function(_0x352a06){return db[_0x8647('0x16')][_0x8647('0x34')]({'active':![]},{'where':{},'transaction':_0x352a06})['then'](function(_0x30e645){logger[_0x8647('0xb')]('ResetActiveCalls',_0xe345f2);logger[_0x8647('0xe')](_0x8647('0x4d'),_0xe345f2,JSON[_0x8647('0x10')](_0x30e645));_0x2ea60e(_0x30e645);})['catch'](function(_0x25cc22){logger[_0x8647('0x11')]('ResetActiveCalls',_0x25cc22['message'],_0xe345f2);_0x1a4f0f(_0x4f5e63[_0x8647('0x11')](0x1f4,_0x25cc22[_0x8647('0x13')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x5ee444){var _0x2fb001=this;var _0x410d02=_0x5ee444[_0x8647('0x25')][_0x8647('0x19')][_0x8647('0x4e')];var _0xfb289e=_0x5ee444[_0x8647('0x25')]['where'][_0x8647('0x4f')];var _0xfd3b4a=_0x5ee444[_0x8647('0x25')]['where'][_0x8647('0x50')];return new Promise(function(_0x7001e6,_0x20fb2d){return db[_0x8647('0x16')][_0x8647('0x17')]({'where':{'voiceQueueId':{'$in':_0x410d02},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x8647('0x3b')][_0x8647('0x40')](_0x8647('0x51')+_0xfb289e+_0x8647('0x52')),'$gt':db[_0x8647('0x3b')]['literal'](_0x8647('0x53'))}},'UserId':{'$in':_0xfd3b4a}},'include':[{'model':db[_0x8647('0x29')],'as':_0x8647('0x2e')},{'model':db[_0x8647('0x2f')],'as':_0x8647('0x54'),'attributes':['id',_0x8647('0x55'),_0x8647('0x30')]},{'model':db[_0x8647('0x56')],'as':_0x8647('0x57')}]})[_0x8647('0xa')](function(_0xb7e7c4){if(_0xb7e7c4[_0x8647('0x31')]>0x0){return db['sequelize']['transaction'](function(_0x2984f0){return db[_0x8647('0x16')][_0x8647('0x34')]({'recallmeNotifiedDate':db['sequelize'][_0x8647('0x40')]('NOW()')},{'where':{'id':{'$in':_[_0x8647('0x1d')](_0xb7e7c4,'id')}},'transaction':_0x2984f0})['then'](function(){_0x7001e6(_0xb7e7c4);})[_0x8647('0x1f')](function(_0x44987a){logger[_0x8647('0x11')](_0x8647('0x58'),_0x44987a['message'],_0x5ee444);_0x20fb2d(_0x2fb001['error'](0x1f4,_0x44987a[_0x8647('0x13')]));});})['catch'](function(_0x4e4995){logger[_0x8647('0x11')]('CmHopperHandlePreviewRecallNotifications',_0x4e4995['message'],_0x5ee444);_0x20fb2d(_0x2fb001[_0x8647('0x11')](0x1f4,_0x4e4995[_0x8647('0x13')]));});}else{_0x7001e6(_0xb7e7c4);}});});};
\ No newline at end of file
+var _0x4eb8=['message','result','catch','GetCmHopper','options','raw','where','attributes','limit','include','model','map','stringify','ShowCmHopper','CmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','findAll','COUNT','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','GetContactByPhone','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','literal','NOW()','CmList','List','lodash','util','moment','bluebird','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x41b495,_0x4628b7){var _0x48d855=function(_0x251e72){while(--_0x251e72){_0x41b495['push'](_0x41b495['shift']());}};_0x48d855(++_0x4628b7);}(_0x4eb8,0x1b5));var _0x84eb=function(_0x57d00d,_0x3bb282){_0x57d00d=_0x57d00d-0x0;var _0x2d2b37=_0x4eb8[_0x57d00d];return _0x2d2b37;};'use strict';var _=require(_0x84eb('0x0'));var util=require(_0x84eb('0x1'));var moment=require(_0x84eb('0x2'));var BPromise=require(_0x84eb('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x84eb('0x4'))(_0x84eb('0x5'));var jayson=require(_0x84eb('0x6'));var client=jayson[_0x84eb('0x7')][_0x84eb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d86af,_0x745fa,_0x23b3fc){return new BPromise(function(_0x3a8e37,_0x594e38){return client[_0x84eb('0x9')](_0x2d86af,_0x23b3fc)[_0x84eb('0xa')](function(_0x12b996){logger[_0x84eb('0xb')](_0x84eb('0xc'),_0x745fa,_0x84eb('0xd'));logger[_0x84eb('0xe')](_0x84eb('0xf'),_0x745fa,_0x84eb('0xd'),JSON['stringify'](_0x12b996));if(_0x12b996[_0x84eb('0x10')]){if(_0x12b996[_0x84eb('0x10')][_0x84eb('0x11')]===0x1f4){logger[_0x84eb('0x10')]('CmHopper,\x20%s,\x20%s',_0x745fa,_0x12b996[_0x84eb('0x10')][_0x84eb('0x12')]);return _0x594e38(_0x12b996[_0x84eb('0x10')][_0x84eb('0x12')]);}logger[_0x84eb('0x10')]('CmHopper,\x20%s,\x20%s',_0x745fa,_0x12b996[_0x84eb('0x10')][_0x84eb('0x12')]);return _0x3a8e37(_0x12b996[_0x84eb('0x10')][_0x84eb('0x12')]);}else{logger[_0x84eb('0xb')](_0x84eb('0xc'),_0x745fa,_0x84eb('0xd'));_0x3a8e37(_0x12b996[_0x84eb('0x13')][_0x84eb('0x12')]);}})[_0x84eb('0x14')](function(_0x264565){logger[_0x84eb('0x10')]('CmHopper,\x20%s,\x20%s',_0x745fa,_0x264565);_0x594e38(_0x264565);});});}exports[_0x84eb('0x15')]=function(_0x1dcafc){var _0xccd816=this;return new Promise(function(_0x522e7e,_0x52b44d){return db['CmHopper']['findAll']({'raw':_0x1dcafc['options']?_0x1dcafc[_0x84eb('0x16')][_0x84eb('0x17')]===undefined?!![]:![]:!![],'where':_0x1dcafc[_0x84eb('0x16')]?_0x1dcafc['options'][_0x84eb('0x18')]||null:null,'attributes':_0x1dcafc[_0x84eb('0x16')]?_0x1dcafc[_0x84eb('0x16')][_0x84eb('0x19')]||null:null,'limit':_0x1dcafc[_0x84eb('0x16')]?_0x1dcafc[_0x84eb('0x16')][_0x84eb('0x1a')]||null:null,'include':_0x1dcafc['options']?_0x1dcafc[_0x84eb('0x16')][_0x84eb('0x1b')]?_['map'](_0x1dcafc[_0x84eb('0x16')]['include'],function(_0x32740d){return{'model':db[_0x32740d[_0x84eb('0x1c')]],'as':_0x32740d['as'],'attributes':_0x32740d['attributes'],'include':_0x32740d[_0x84eb('0x1b')]?_[_0x84eb('0x1d')](_0x32740d[_0x84eb('0x1b')],function(_0x29d547){return{'model':db[_0x29d547[_0x84eb('0x1c')]],'as':_0x29d547['as'],'attributes':_0x29d547[_0x84eb('0x19')],'include':_0x29d547[_0x84eb('0x1b')]?_[_0x84eb('0x1d')](_0x29d547['include'],function(_0x1e71f7){return{'model':db[_0x1e71f7[_0x84eb('0x1c')]],'as':_0x1e71f7['as'],'attributes':_0x1e71f7[_0x84eb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x84eb('0xa')](function(_0xb13f7){logger[_0x84eb('0xb')](_0x84eb('0x15'),_0x1dcafc);logger[_0x84eb('0xe')](_0x84eb('0x15'),_0x1dcafc,JSON[_0x84eb('0x1e')](_0xb13f7));_0x522e7e(_0xb13f7);})[_0x84eb('0x14')](function(_0x1bfdec){logger[_0x84eb('0x10')](_0x84eb('0x15'),_0x1bfdec['message'],_0x1dcafc);_0x52b44d(_0xccd816[_0x84eb('0x10')](0x1f4,_0x1bfdec[_0x84eb('0x12')]));});});};exports[_0x84eb('0x1f')]=function(_0x4aec10){var _0x729cf8=this;return new Promise(function(_0x543d89,_0x430920){return db[_0x84eb('0x20')][_0x84eb('0x21')]({'raw':_0x4aec10['options']?_0x4aec10[_0x84eb('0x16')][_0x84eb('0x17')]===undefined?!![]:![]:!![],'where':_0x4aec10[_0x84eb('0x16')]?_0x4aec10['options'][_0x84eb('0x18')]||null:null,'attributes':_0x4aec10['options']?_0x4aec10[_0x84eb('0x16')][_0x84eb('0x19')]||null:null,'include':_0x4aec10[_0x84eb('0x16')]?_0x4aec10[_0x84eb('0x16')][_0x84eb('0x1b')]?_[_0x84eb('0x1d')](_0x4aec10[_0x84eb('0x16')][_0x84eb('0x1b')],function(_0x5f2d3c){return{'model':db[_0x5f2d3c[_0x84eb('0x1c')]],'as':_0x5f2d3c['as'],'attributes':_0x5f2d3c[_0x84eb('0x19')],'include':_0x5f2d3c['include']?_[_0x84eb('0x1d')](_0x5f2d3c[_0x84eb('0x1b')],function(_0x238232){return{'model':db[_0x238232[_0x84eb('0x1c')]],'as':_0x238232['as'],'attributes':_0x238232[_0x84eb('0x19')],'include':_0x238232['include']?_[_0x84eb('0x1d')](_0x238232[_0x84eb('0x1b')],function(_0x3759c8){return{'model':db[_0x3759c8[_0x84eb('0x1c')]],'as':_0x3759c8['as'],'attributes':_0x3759c8[_0x84eb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x84eb('0xa')](function(_0x594726){logger['info']('ShowCmHopper',_0x4aec10);logger[_0x84eb('0xe')]('ShowCmHopper',_0x4aec10,JSON[_0x84eb('0x1e')](_0x594726));_0x543d89(_0x594726);})[_0x84eb('0x14')](function(_0x3a2a61){logger['error'](_0x84eb('0x1f'),_0x3a2a61[_0x84eb('0x12')],_0x4aec10);_0x430920(_0x729cf8['error'](0x1f4,_0x3a2a61[_0x84eb('0x12')]));});});};exports[_0x84eb('0x22')]=function(_0x494cc1){var _0x5835d8=this;return new Promise(function(_0x41fb42,_0x24d1aa){return db[_0x84eb('0x20')][_0x84eb('0x23')](_0x494cc1[_0x84eb('0x24')],{'raw':_0x494cc1[_0x84eb('0x16')]?_0x494cc1[_0x84eb('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x84eb('0xa')](function(_0x35e6e9){logger['info']('CreateCmHopper',_0x494cc1);logger['debug'](_0x84eb('0x22'),_0x494cc1,JSON[_0x84eb('0x1e')](_0x35e6e9));_0x41fb42(_0x35e6e9);})[_0x84eb('0x14')](function(_0x531747){logger[_0x84eb('0x10')](_0x84eb('0x22'),_0x531747[_0x84eb('0x12')],_0x494cc1);_0x24d1aa(_0x5835d8[_0x84eb('0x10')](0x1f4,_0x531747['message']));});});};exports[_0x84eb('0x25')]=function(_0x200454){var _0x4b527d=this;return new Promise(function(_0x24a0f9,_0x51b25b){return db[_0x84eb('0x20')][_0x84eb('0x26')](_0x200454[_0x84eb('0x24')],{'raw':_0x200454['options']?_0x200454['options'][_0x84eb('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x200454[_0x84eb('0x16')]?_0x200454['options'][_0x84eb('0x18')]||null:null,'attributes':_0x200454[_0x84eb('0x16')]?_0x200454[_0x84eb('0x16')]['attributes']||null:null,'limit':_0x200454[_0x84eb('0x16')]?_0x200454[_0x84eb('0x16')][_0x84eb('0x1a')]||null:null})['then'](function(_0x17c077){logger['info'](_0x84eb('0x25'),_0x200454);logger['info'](_0x84eb('0x27'),JSON[_0x84eb('0x1e')](_0x200454[_0x84eb('0x16')][_0x84eb('0x18')]),_0x200454['body'][_0x84eb('0x28')]);logger['debug'](_0x84eb('0x25'),_0x200454,JSON[_0x84eb('0x1e')](_0x17c077));_0x24a0f9(_0x17c077);})[_0x84eb('0x14')](function(_0x39d399){logger[_0x84eb('0x10')](_0x84eb('0x25'),_0x39d399[_0x84eb('0x12')],_0x200454);_0x51b25b(_0x4b527d[_0x84eb('0x10')](0x1f4,_0x39d399['message']));});});};exports['DestroyCmHopper']=function(_0x38fc67){var _0xbbfdb=this;return new Promise(function(_0x41be86,_0x58dd2b){return db['CmHopper']['destroy']({'where':_0x38fc67[_0x84eb('0x16')]?_0x38fc67[_0x84eb('0x16')][_0x84eb('0x18')]||null:null})[_0x84eb('0xa')](function(_0x2600f2){logger['info']('DestroyCmHopper',_0x38fc67);logger['debug'](_0x84eb('0x29'),_0x38fc67,JSON[_0x84eb('0x1e')](_0x2600f2));_0x41be86(_0x2600f2);})[_0x84eb('0x14')](function(_0x30e33a){logger[_0x84eb('0x10')](_0x84eb('0x29'),_0x30e33a[_0x84eb('0x12')],_0x38fc67);_0x58dd2b(_0xbbfdb[_0x84eb('0x10')](0x1f4,_0x30e33a[_0x84eb('0x12')]));});});};exports[_0x84eb('0x2a')]=function(_0x1f14b3){var _0x155003=this;return new Promise(function(_0x2a0d96,_0x7e0759){return db[_0x84eb('0x2b')][_0x84eb('0x2c')]()[_0x84eb('0xa')](function(_0x87f03d){return db[_0x84eb('0x2d')][_0x84eb('0x2e')](function(_0x176cb6){return db['CmHopper']['findAll']({'where':_0x1f14b3[_0x84eb('0x16')]?_0x1f14b3[_0x84eb('0x16')][_0x84eb('0x18')]||null:null,'attributes':_0x1f14b3[_0x84eb('0x16')]?_0x1f14b3[_0x84eb('0x16')]['attributes']||null:null,'limit':_0x1f14b3[_0x84eb('0x16')]?_0x1f14b3['options'][_0x84eb('0x1a')]||null:null,'order':_0x1f14b3[_0x84eb('0x16')]?_0x1f14b3[_0x84eb('0x16')][_0x84eb('0x2f')]||null:null,'transaction':_0x176cb6,'lock':_0x176cb6[_0x84eb('0x30')][_0x84eb('0x31')],'include':[{'model':db[_0x84eb('0x2b')],'as':_0x84eb('0x32'),'attributes':_[_0x84eb('0x33')](_0x87f03d)},{'model':db[_0x84eb('0x34')],'as':_0x84eb('0x35'),'attributes':['id',_0x84eb('0x36'),_0x84eb('0x37')]}]})[_0x84eb('0xa')](function(_0x4961d6){var _0x28e37c=[];var _0x4efa27=[];for(var _0xe3d960=0x0;_0xe3d960<_0x4961d6[_0x84eb('0x38')];_0xe3d960+=0x1){var _0x583e67=_0x4961d6[_0xe3d960][_0x84eb('0x39')];if(_0x583e67===null){_0x28e37c[_0x84eb('0x3a')](_0x4961d6[_0xe3d960][_0x84eb('0x26')](_0x1f14b3[_0x84eb('0x24')],{'transaction':_0x176cb6}));}else if(!_0x4efa27[_0x84eb('0x3b')](_0x583e67)){_0x4efa27[_0x84eb('0x3a')](_0x583e67);_0x28e37c['push'](_0x4961d6[_0xe3d960][_0x84eb('0x26')](_0x1f14b3[_0x84eb('0x24')],{'transaction':_0x176cb6}));}}return BPromise[_0x84eb('0x3c')](_0x28e37c);});})[_0x84eb('0xa')](function(_0xf29951){logger[_0x84eb('0xb')]('GetContactDialer',_0x1f14b3);if(_0xf29951['length']>0x0){logger['info'](_0x84eb('0x3d'),_0xf29951[0x0][_0x84eb('0x3e')]['id'],_0xf29951[0x0][_0x84eb('0x3e')][_0x84eb('0x3f')],_0xf29951[0x0][_0x84eb('0x3e')][_0x84eb('0x28')]);}logger[_0x84eb('0xe')]('GetContactDialer',_0x1f14b3,JSON[_0x84eb('0x1e')](_0xf29951));_0x2a0d96(_0xf29951);})[_0x84eb('0x14')](function(_0x37e90a){logger[_0x84eb('0x10')]('GetContactDialer',_0x37e90a['message'],_0x1f14b3);_0x7e0759(_0x155003[_0x84eb('0x10')](0x1f4,_0x37e90a[_0x84eb('0x12')]));});});});};exports[_0x84eb('0x40')]=function(_0x187730){var _0x56a75c=this;return new Promise(function(_0x509334,_0x26f899){return db[_0x84eb('0x2d')][_0x84eb('0x2e')](function(_0x17f7ba){return db[_0x84eb('0x41')][_0x84eb('0x23')](_0x187730[_0x84eb('0x24')],{'raw':_0x187730[_0x84eb('0x16')]?_0x187730[_0x84eb('0x16')][_0x84eb('0x17')]===undefined?!![]:![]:!![],'transaction':_0x17f7ba})[_0x84eb('0xa')](function(){logger[_0x84eb('0xb')](_0x84eb('0x42'),JSON['stringify'](_0x187730[_0x84eb('0x16')][_0x84eb('0x18')]),_0x187730[_0x84eb('0x16')][_0x84eb('0x18')][_0x84eb('0x28')]);return db[_0x84eb('0x20')][_0x84eb('0x43')]({'where':_0x187730[_0x84eb('0x16')]?_0x187730[_0x84eb('0x16')][_0x84eb('0x18')]||null:null,'transaction':_0x17f7ba});});})[_0x84eb('0xa')](function(_0x49a942){logger['info'](_0x84eb('0x40'),_0x187730);logger[_0x84eb('0xe')](_0x84eb('0x40'),_0x187730,JSON[_0x84eb('0x1e')](_0x49a942));_0x509334(_0x49a942);})[_0x84eb('0x14')](function(_0x2cb511){logger[_0x84eb('0x10')](_0x84eb('0x40'),_0x2cb511[_0x84eb('0x12')],_0x187730);_0x26f899(_0x56a75c[_0x84eb('0x10')](0x1f4,_0x2cb511[_0x84eb('0x12')]));});});};exports[_0x84eb('0x44')]=function(_0x293bca){var _0x2ba589=this;return new Promise(function(_0x19de9b,_0x54559c){return db[_0x84eb('0x20')][_0x84eb('0x45')]({'raw':_0x293bca[_0x84eb('0x16')]?_0x293bca['options'][_0x84eb('0x17')]===undefined?!![]:![]:!![],'where':_0x293bca[_0x84eb('0x16')]?_0x293bca['options']['where']||null:null,'attributes':[[db[_0x84eb('0x2d')]['fn'](_0x84eb('0x46'),db[_0x84eb('0x2d')]['fn']('IF',db[_0x84eb('0x2d')]['literal'](_0x84eb('0x47')+util['format']('\x22%s\x22',moment()[_0x84eb('0x48')](_0x84eb('0x49')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0x84eb('0xa')](function(_0x3d8139){logger['info']('CountReScheduled',_0x293bca);logger[_0x84eb('0xe')](_0x84eb('0x44'),_0x293bca,JSON[_0x84eb('0x1e')](_0x3d8139));_0x19de9b(_0x3d8139);})[_0x84eb('0x14')](function(_0x4d88a4){logger[_0x84eb('0x10')](_0x84eb('0x44'),_0x4d88a4[_0x84eb('0x12')],_0x293bca);_0x54559c(_0x2ba589['error'](0x1f4,_0x4d88a4[_0x84eb('0x12')]));});});};exports['GetContactRecallMe']=function(_0x20c5a6){var _0x3c92e4=this;return new Promise(function(_0x3d283c,_0xd8a564){return db[_0x84eb('0x2b')][_0x84eb('0x2c')]()[_0x84eb('0xa')](function(_0x415319){return db[_0x84eb('0x2d')][_0x84eb('0x2e')](function(_0xa97579){return db['CmHopper'][_0x84eb('0x45')]({'where':_0x20c5a6[_0x84eb('0x16')]?_0x20c5a6[_0x84eb('0x16')][_0x84eb('0x18')]||null:null,'attributes':_0x20c5a6['options']?_0x20c5a6[_0x84eb('0x16')][_0x84eb('0x19')]||null:null,'limit':0x1,'order':_0x20c5a6[_0x84eb('0x16')]?_0x20c5a6[_0x84eb('0x16')]['order']||null:null,'group':db[_0x84eb('0x20')][_0x84eb('0x39')],'transaction':_0xa97579,'lock':_0xa97579[_0x84eb('0x30')][_0x84eb('0x31')],'include':_0x20c5a6[_0x84eb('0x16')]?_0x20c5a6[_0x84eb('0x16')][_0x84eb('0x1b')]?_[_0x84eb('0x1d')](_0x20c5a6[_0x84eb('0x16')][_0x84eb('0x1b')],function(_0xb61f95){return{'model':db[_0xb61f95[_0x84eb('0x1c')]],'as':_0xb61f95['as'],'attributes':_0xb61f95[_0x84eb('0x19')],'include':_0xb61f95[_0x84eb('0x1b')]?_[_0x84eb('0x1d')](_0xb61f95[_0x84eb('0x1b')],function(_0x64d6d2){return{'model':db[_0x64d6d2[_0x84eb('0x1c')]],'as':_0x64d6d2['as'],'attributes':_0x64d6d2[_0x84eb('0x19')],'include':_0x64d6d2[_0x84eb('0x1b')]?_['map'](_0x64d6d2['include'],function(_0x35d654){return{'model':db[_0x35d654[_0x84eb('0x1c')]],'as':_0x35d654['as'],'attributes':_0x35d654[_0x84eb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x84eb('0xa')](function(_0x369106){var _0xb278e6=[];for(var _0x1ef33b=0x0;_0x1ef33b<_0x369106[_0x84eb('0x38')];_0x1ef33b+=0x1){_0xb278e6['push'](_0x369106[_0x1ef33b][_0x84eb('0x26')](_0x20c5a6[_0x84eb('0x24')],{'transaction':_0xa97579}));}return BPromise[_0x84eb('0x3c')](_0xb278e6);});})[_0x84eb('0xa')](function(_0x468f66){logger[_0x84eb('0xb')](_0x84eb('0x4a'),_0x20c5a6);logger[_0x84eb('0xe')]('GetContactRecallMe',_0x20c5a6,JSON[_0x84eb('0x1e')](_0x468f66));_0x3d283c(_0x468f66);})[_0x84eb('0x14')](function(_0x3b2f69){logger[_0x84eb('0x10')](_0x84eb('0x4a'),_0x3b2f69[_0x84eb('0x12')],_0x20c5a6);_0xd8a564(_0x3c92e4['error'](0x1f4,_0x3b2f69[_0x84eb('0x12')]));});});});};exports['GetCmHopperPreview']=function(_0x4f12e8){var _0x1a4423=this;return new Promise(function(_0xa719c2,_0x48d2d0){db['CmContact']['describe']()[_0x84eb('0xa')](function(_0x448fe8){return db[_0x84eb('0x20')][_0x84eb('0x45')]({'raw':_0x4f12e8['options']?_0x4f12e8[_0x84eb('0x16')][_0x84eb('0x17')]===undefined?!![]:![]:!![],'where':_0x4f12e8[_0x84eb('0x16')]?_0x4f12e8['options'][_0x84eb('0x18')]||null:null,'attributes':_0x4f12e8[_0x84eb('0x16')]?_0x4f12e8[_0x84eb('0x16')][_0x84eb('0x19')]||null:null,'limit':_0x4f12e8[_0x84eb('0x16')]?_0x4f12e8[_0x84eb('0x16')][_0x84eb('0x1a')]||null:null,'include':_0x4f12e8[_0x84eb('0x16')]?_0x4f12e8[_0x84eb('0x16')][_0x84eb('0x1b')]?_[_0x84eb('0x1d')](_0x4f12e8[_0x84eb('0x16')][_0x84eb('0x1b')],function(_0x12f7c7){return{'model':db[_0x12f7c7[_0x84eb('0x1c')]],'as':_0x12f7c7['as'],'attributes':_0x12f7c7['as']===_0x84eb('0x32')?_[_0x84eb('0x33')](_0x448fe8):_0x12f7c7[_0x84eb('0x19')],'include':_0x12f7c7[_0x84eb('0x1b')]?_['map'](_0x12f7c7[_0x84eb('0x1b')],function(_0x44350f){return{'model':db[_0x44350f[_0x84eb('0x1c')]],'as':_0x44350f['as'],'attributes':_0x44350f[_0x84eb('0x19')],'include':_0x44350f[_0x84eb('0x1b')]?_[_0x84eb('0x1d')](_0x44350f['include'],function(_0x10756e){return{'model':db[_0x10756e[_0x84eb('0x1c')]],'as':_0x10756e['as'],'attributes':_0x10756e[_0x84eb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x84eb('0xa')](function(_0x11d267){logger[_0x84eb('0xb')](_0x84eb('0x15'),_0x4f12e8);logger[_0x84eb('0xe')](_0x84eb('0x15'),_0x4f12e8,JSON[_0x84eb('0x1e')](_0x11d267));_0xa719c2(_0x11d267);})[_0x84eb('0x14')](function(_0x343491){logger[_0x84eb('0x10')](_0x84eb('0x15'),_0x343491[_0x84eb('0x12')],_0x4f12e8);_0x48d2d0(_0x1a4423['error'](0x1f4,_0x343491[_0x84eb('0x12')]));});});});};exports[_0x84eb('0x4b')]=function(_0x1eeb46){var _0x16bfee=this;return new Promise(function(_0x3c4f20,_0x3de905){return db[_0x84eb('0x2b')]['findOne']({'raw':!![],'where':{'phone':_0x1eeb46[_0x84eb('0x16')][_0x84eb('0x18')][_0x84eb('0x4c')]},'attributes':['id',_0x84eb('0x4d')],'order':[['id',_0x84eb('0x4e')]]})['then'](function(_0x1df4c0){logger[_0x84eb('0xb')](_0x84eb('0x4f'),_0x1eeb46);logger[_0x84eb('0xe')](_0x84eb('0x4f'),_0x1eeb46,JSON['stringify'](_0x1df4c0));_0x3c4f20(_0x1df4c0);})[_0x84eb('0x14')](function(_0x47851a){logger[_0x84eb('0x10')]('getContactByPhone',_0x47851a['message'],_0x1eeb46);_0x3de905(_0x16bfee[_0x84eb('0x10')](0x1f4,_0x47851a[_0x84eb('0x12')]));});});};exports[_0x84eb('0x50')]=function(_0x3c63dc){var _0x528a03=this;return new Promise(function(_0x34230f,_0x56b87d){return db[_0x84eb('0x2d')][_0x84eb('0x2e')](function(_0x16a9bb){return db[_0x84eb('0x20')]['update']({'active':![]},{'where':{},'transaction':_0x16a9bb})[_0x84eb('0xa')](function(_0x5720c0){logger[_0x84eb('0xb')](_0x84eb('0x50'),_0x3c63dc);logger['debug'](_0x84eb('0x50'),_0x3c63dc,JSON['stringify'](_0x5720c0));_0x34230f(_0x5720c0);})[_0x84eb('0x14')](function(_0xaef202){logger[_0x84eb('0x10')](_0x84eb('0x50'),_0xaef202[_0x84eb('0x12')],_0x3c63dc);_0x56b87d(_0x528a03[_0x84eb('0x10')](0x1f4,_0xaef202[_0x84eb('0x12')]));});});});};exports[_0x84eb('0x51')]=function(_0x5dff29){var _0x669a2d=this;var _0x299aa5=_0x5dff29[_0x84eb('0x24')]['where'][_0x84eb('0x52')];var _0x3d0d49=_0x5dff29[_0x84eb('0x24')]['where'][_0x84eb('0x53')];var _0x49ce10=_0x5dff29['body'][_0x84eb('0x18')][_0x84eb('0x54')];return new Promise(function(_0x32e9e7,_0x4895d6){return db[_0x84eb('0x20')][_0x84eb('0x45')]({'where':{'voiceQueueId':{'$in':_0x299aa5},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x84eb('0x2d')]['literal'](_0x84eb('0x55')+_0x3d0d49+_0x84eb('0x56')),'$gt':db[_0x84eb('0x2d')][_0x84eb('0x57')](_0x84eb('0x58'))}},'UserId':{'$in':_0x49ce10}},'include':[{'model':db['CmContact'],'as':'Contact'},{'model':db['User'],'as':_0x84eb('0x35'),'attributes':['id',_0x84eb('0x36'),_0x84eb('0x37')]},{'model':db[_0x84eb('0x59')],'as':_0x84eb('0x5a')}]})[_0x84eb('0xa')](function(_0x309e33){if(_0x309e33[_0x84eb('0x38')]>0x0){return db[_0x84eb('0x2d')]['transaction'](function(_0x3100c9){return db[_0x84eb('0x20')]['update']({'recallmeNotifiedDate':db['sequelize'][_0x84eb('0x57')]('NOW()')},{'where':{'id':{'$in':_[_0x84eb('0x1d')](_0x309e33,'id')}},'transaction':_0x3100c9})['then'](function(){_0x32e9e7(_0x309e33);})['catch'](function(_0x279db0){logger[_0x84eb('0x10')](_0x84eb('0x51'),_0x279db0[_0x84eb('0x12')],_0x5dff29);_0x4895d6(_0x669a2d[_0x84eb('0x10')](0x1f4,_0x279db0[_0x84eb('0x12')]));});})[_0x84eb('0x14')](function(_0x55080a){logger[_0x84eb('0x10')](_0x84eb('0x51'),_0x55080a[_0x84eb('0x12')],_0x5dff29);_0x4895d6(_0x669a2d[_0x84eb('0x10')](0x1f4,_0x55080a[_0x84eb('0x12')]));});}else{_0x32e9e7(_0x309e33);}});});};
\ No newline at end of file
index 16500fb..dc3afdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09b6=['getPreview','getTimezone','put','update','delete','express','Router','get','isAuthenticated','index','/describe','describe','getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','post','create','/preview'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x09b6,0xd7));var _0x609b=function(_0x246f0c,_0x39f734){_0x246f0c=_0x246f0c-0x0;var _0x30fe50=_0x09b6[_0x246f0c];return _0x30fe50;};'use strict';var express=require(_0x609b('0x0'));var router=express[_0x609b('0x1')]();var auth=require('../../components/auth/service');var controller=require('./cmHopper.controller');router[_0x609b('0x2')]('/',auth[_0x609b('0x3')](),controller[_0x609b('0x4')]);router[_0x609b('0x2')](_0x609b('0x5'),auth[_0x609b('0x3')](),controller[_0x609b('0x6')]);router['get']('/opencontacts',auth[_0x609b('0x3')](),controller[_0x609b('0x7')]);router[_0x609b('0x2')](_0x609b('0x8'),auth[_0x609b('0x3')](),controller[_0x609b('0x9')]);router[_0x609b('0x2')](_0x609b('0xa'),auth[_0x609b('0x3')](),controller[_0x609b('0xb')]);router[_0x609b('0x2')](_0x609b('0xc'),auth[_0x609b('0x3')](),controller['getPreviewRecall']);router[_0x609b('0xd')]('/',auth[_0x609b('0x3')](),controller[_0x609b('0xe')]);router[_0x609b('0xd')](_0x609b('0xf'),auth['isAuthenticated'](),controller[_0x609b('0x10')]);router[_0x609b('0xd')]('/timezone',auth[_0x609b('0x3')](),controller[_0x609b('0x11')]);router[_0x609b('0x12')](_0x609b('0xa'),auth[_0x609b('0x3')](),controller[_0x609b('0x13')]);router[_0x609b('0x14')]('/:id',auth[_0x609b('0x3')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xdbee=['getOpenContacts','/timezones','getTimezones','show','/:id/previewrecall','getPreviewRecall','post','getPreview','/timezone','getTimezone','put','/:id','delete','exports','express','../../components/auth/service','index','get','/describe','isAuthenticated','describe'];(function(_0x19e77b,_0x11b71b){var _0x1dd531=function(_0x1f7401){while(--_0x1f7401){_0x19e77b['push'](_0x19e77b['shift']());}};_0x1dd531(++_0x11b71b);}(_0xdbee,0xa1));var _0xedbe=function(_0x1974c1,_0x51d8e7){_0x1974c1=_0x1974c1-0x0;var _0x389536=_0xdbee[_0x1974c1];return _0x389536;};'use strict';var express=require(_0xedbe('0x0'));var router=express['Router']();var auth=require(_0xedbe('0x1'));var controller=require('./cmHopper.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xedbe('0x2')]);router[_0xedbe('0x3')](_0xedbe('0x4'),auth[_0xedbe('0x5')](),controller[_0xedbe('0x6')]);router[_0xedbe('0x3')]('/opencontacts',auth[_0xedbe('0x5')](),controller[_0xedbe('0x7')]);router['get'](_0xedbe('0x8'),auth[_0xedbe('0x5')](),controller[_0xedbe('0x9')]);router[_0xedbe('0x3')]('/:id',auth[_0xedbe('0x5')](),controller[_0xedbe('0xa')]);router[_0xedbe('0x3')](_0xedbe('0xb'),auth[_0xedbe('0x5')](),controller[_0xedbe('0xc')]);router[_0xedbe('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xedbe('0xd')]('/preview',auth[_0xedbe('0x5')](),controller[_0xedbe('0xe')]);router['post'](_0xedbe('0xf'),auth[_0xedbe('0x5')](),controller[_0xedbe('0x10')]);router[_0xedbe('0x11')](_0xedbe('0x12'),auth[_0xedbe('0x5')](),controller['update']);router[_0xedbe('0x13')]('/:id',auth[_0xedbe('0x5')](),controller['destroy']);module[_0xedbe('0x14')]=router;
\ No newline at end of file
index bf94b99..7dca958 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacaf=['STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','INTEGER'];(function(_0x20b8b6,_0x29a14c){var _0x22c341=function(_0x13b0ef){while(--_0x13b0ef){_0x20b8b6['push'](_0x20b8b6['shift']());}};_0x22c341(++_0x29a14c);}(_0xacaf,0x12f));var _0xfaca=function(_0x87506e,_0x5680ec){_0x87506e=_0x87506e-0x0;var _0x5496a4=_0xacaf[_0x87506e];return _0x5496a4;};'use strict';var moment=require('moment');var Sequelize=require(_0xfaca('0x0'));module['exports']={'CmHopperId':{'type':Sequelize[_0xfaca('0x1')]},'phone':{'type':Sequelize[_0xfaca('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xfaca('0x1')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xfaca('0x3')],'defaultValue':moment()['format'](_0xfaca('0x4'))},'countbusyretry':{'type':Sequelize[_0xfaca('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xfaca('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfaca('0x1')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xfaca('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4199=['exports','STRING','INTEGER','DATE','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x36d3a4,_0x32875e){var _0x4ab04c=function(_0x42137f){while(--_0x42137f){_0x36d3a4['push'](_0x36d3a4['shift']());}};_0x4ab04c(++_0x32875e);}(_0x4199,0x185));var _0x9419=function(_0x4b689a,_0x2ca57e){_0x4b689a=_0x4b689a-0x0;var _0x3a8753=_0x4199[_0x4b689a];return _0x3a8753;};'use strict';var moment=require(_0x9419('0x0'));var Sequelize=require('sequelize');module[_0x9419('0x1')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x9419('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x9419('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x9419('0x4')],'defaultValue':moment()['format'](_0x9419('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9419('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9419('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9419('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9419('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9419('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 473a43e..99d4e8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x750c=['pick','filter','merge','options','CmHopperAdditionalPhone','count','includeAll','findAll','catch','show','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','undefined','limit','offset','Content-Range','json','apply','reject','save','update','destroy','then','get','CmHopperAdditionalPhones','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where'];(function(_0x53652b,_0x1bbe08){var _0x122d48=function(_0x10082a){while(--_0x10082a){_0x53652b['push'](_0x53652b['shift']());}};_0x122d48(++_0x1bbe08);}(_0x750c,0xb3));var _0xc750=function(_0x40c630,_0x1e74c3){_0x40c630=_0x40c630-0x0;var _0x5ae98e=_0x750c[_0x40c630];return _0x5ae98e;};'use strict';var emlformat=require(_0xc750('0x0'));var rimraf=require(_0xc750('0x1'));var zipdir=require(_0xc750('0x2'));var jsonpatch=require(_0xc750('0x3'));var rp=require('request-promise');var moment=require(_0xc750('0x4'));var BPromise=require(_0xc750('0x5'));var Mustache=require(_0xc750('0x6'));var util=require(_0xc750('0x7'));var path=require('path');var sox=require(_0xc750('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc750('0x9'));var _=require('lodash');var squel=require(_0xc750('0xa'));var crypto=require(_0xc750('0xb'));var jsforce=require(_0xc750('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc750('0xd'));var querystring=require(_0xc750('0xe'));var Papa=require('papaparse');var Redis=require(_0xc750('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc750('0x10'));var as=require(_0xc750('0x11'));var hardwareService=require(_0xc750('0x12'));var logger=require('../../config/logger')(_0xc750('0x13'));var utils=require(_0xc750('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc750('0x15'))['db'];function respondWithStatusCode(_0xe7fe5,_0x4f03bd){_0x4f03bd=_0x4f03bd||0xcc;return function(_0x57b1c9){if(_0x57b1c9){return _0xe7fe5[_0xc750('0x16')](_0x4f03bd);}return _0xe7fe5['status'](_0x4f03bd)[_0xc750('0x17')]();};}function respondWithResult(_0x5e918a,_0x4b2702){_0x4b2702=_0x4b2702||0xc8;return function(_0x35b232){if(_0x35b232){return _0x5e918a[_0xc750('0x18')](_0x4b2702)['json'](_0x35b232);}};}function respondWithFilteredResult(_0x36e939,_0xe2d10e){return function(_0x418eec){if(_0x418eec){var _0x488af4=typeof _0xe2d10e['offset']===_0xc750('0x19')&&typeof _0xe2d10e[_0xc750('0x1a')]===_0xc750('0x19');var _0x449a7f=_0x418eec['count'];var _0x228459=_0x488af4?0x0:_0xe2d10e[_0xc750('0x1b')];var _0x1abe63=_0x488af4?_0x418eec['count']:_0xe2d10e[_0xc750('0x1b')]+_0xe2d10e[_0xc750('0x1a')];var _0x51bc6b;if(_0x1abe63>=_0x449a7f){_0x1abe63=_0x449a7f;_0x51bc6b=0xc8;}else{_0x51bc6b=0xce;}_0x36e939[_0xc750('0x18')](_0x51bc6b);return _0x36e939['set'](_0xc750('0x1c'),_0x228459+'-'+_0x1abe63+'/'+_0x449a7f)[_0xc750('0x1d')](_0x418eec);}return null;};}function patchUpdates(_0x482004){return function(_0x15f11d){try{jsonpatch[_0xc750('0x1e')](_0x15f11d,_0x482004,!![]);}catch(_0x5c7919){return BPromise[_0xc750('0x1f')](_0x5c7919);}return _0x15f11d[_0xc750('0x20')]();};}function saveUpdates(_0x92a14e,_0x37e414){return function(_0x363466){if(_0x363466){return _0x363466[_0xc750('0x21')](_0x92a14e)['then'](function(_0x4983ed){return _0x4983ed;});}return null;};}function removeEntity(_0x5327ed,_0x1f522e){return function(_0x3ec80c){if(_0x3ec80c){return _0x3ec80c[_0xc750('0x22')]()[_0xc750('0x23')](function(){var _0x15a48e=_0x3ec80c[_0xc750('0x24')]({'plain':!![]});var _0x3c744c=_0xc750('0x25');return db['UserProfileResource'][_0xc750('0x22')]({'where':{'type':_0x3c744c,'resourceId':_0x15a48e['id']}})[_0xc750('0x23')](function(){return _0x3ec80c;});})[_0xc750('0x23')](function(){_0x5327ed[_0xc750('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11a988,_0x120d31){return function(_0x14e2e2){if(!_0x14e2e2){_0x11a988['sendStatus'](0x194);}return _0x14e2e2;};}function handleError(_0x6f4447,_0x324964){_0x324964=_0x324964||0x1f4;return function(_0x35522a){logger[_0xc750('0x26')](_0x35522a[_0xc750('0x27')]);if(_0x35522a['name']){delete _0x35522a[_0xc750('0x28')];}_0x6f4447[_0xc750('0x18')](_0x324964)[_0xc750('0x29')](_0x35522a);};}exports[_0xc750('0x2a')]=function(_0x5a8308,_0x35bfae){var _0x303fd9={},_0x386a26={},_0x2c9874={'count':0x0,'rows':[]};var _0x44bb09=_[_0xc750('0x2b')](db['CmHopperAdditionalPhone'][_0xc750('0x2c')],function(_0x5d85ba){return{'name':_0x5d85ba[_0xc750('0x2d')],'type':_0x5d85ba[_0xc750('0x2e')][_0xc750('0x2f')]};});_0x386a26[_0xc750('0x30')]=_[_0xc750('0x2b')](_0x44bb09,_0xc750('0x28'));_0x386a26[_0xc750('0x31')]=_[_0xc750('0x32')](_0x5a8308[_0xc750('0x31')]);_0x386a26[_0xc750('0x33')]=_[_0xc750('0x34')](_0x386a26[_0xc750('0x30')],_0x386a26[_0xc750('0x31')]);_0x303fd9[_0xc750('0x35')]=_[_0xc750('0x34')](_0x386a26['model'],qs[_0xc750('0x36')](_0x5a8308[_0xc750('0x31')][_0xc750('0x36')]));_0x303fd9[_0xc750('0x35')]=_0x303fd9[_0xc750('0x35')]['length']?_0x303fd9['attributes']:_0x386a26['model'];if(!_0x5a8308['query'][_0xc750('0x37')]('nolimit')){_0x303fd9[_0xc750('0x1a')]=qs[_0xc750('0x1a')](_0x5a8308['query'][_0xc750('0x1a')]);_0x303fd9['offset']=qs[_0xc750('0x1b')](_0x5a8308[_0xc750('0x31')][_0xc750('0x1b')]);}_0x303fd9['order']=qs[_0xc750('0x38')](_0x5a8308['query']['sort']);_0x303fd9[_0xc750('0x39')]=qs[_0xc750('0x33')](_[_0xc750('0x3a')](_0x5a8308['query'],_0x386a26[_0xc750('0x33')]),_0x44bb09);if(_0x5a8308[_0xc750('0x31')][_0xc750('0x3b')]){_0x303fd9[_0xc750('0x39')]=_[_0xc750('0x3c')](_0x303fd9[_0xc750('0x39')],{'$or':_[_0xc750('0x2b')](_0x44bb09,function(_0x1e421e){if(_0x1e421e[_0xc750('0x2e')]!=='VIRTUAL'){var _0x1f25c3={};_0x1f25c3[_0x1e421e[_0xc750('0x28')]]={'$like':'%'+_0x5a8308[_0xc750('0x31')][_0xc750('0x3b')]+'%'};return _0x1f25c3;}})});}_0x303fd9=_[_0xc750('0x3c')]({},_0x303fd9,_0x5a8308[_0xc750('0x3d')]);var _0xe645de={'where':_0x303fd9[_0xc750('0x39')]};return db[_0xc750('0x3e')][_0xc750('0x3f')](_0xe645de)[_0xc750('0x23')](function(_0x45e107){_0x2c9874[_0xc750('0x3f')]=_0x45e107;if(_0x5a8308[_0xc750('0x31')][_0xc750('0x40')]){_0x303fd9['include']=[{'all':!![]}];}return db[_0xc750('0x3e')][_0xc750('0x41')](_0x303fd9);})[_0xc750('0x23')](function(_0x34fe8b){_0x2c9874['rows']=_0x34fe8b;return _0x2c9874;})[_0xc750('0x23')](respondWithFilteredResult(_0x35bfae,_0x303fd9))[_0xc750('0x42')](handleError(_0x35bfae,null));};exports[_0xc750('0x43')]=function(_0x191034,_0x99148){var _0x4d94e6={'raw':!![],'where':{'id':_0x191034[_0xc750('0x44')]['id']}},_0x1602ce={};_0x1602ce['model']=_['keys'](db[_0xc750('0x3e')][_0xc750('0x2c')]);_0x1602ce[_0xc750('0x31')]=_[_0xc750('0x32')](_0x191034[_0xc750('0x31')]);_0x1602ce[_0xc750('0x33')]=_['intersection'](_0x1602ce[_0xc750('0x30')],_0x1602ce['query']);_0x4d94e6[_0xc750('0x35')]=_[_0xc750('0x34')](_0x1602ce[_0xc750('0x30')],qs[_0xc750('0x36')](_0x191034[_0xc750('0x31')][_0xc750('0x36')]));_0x4d94e6[_0xc750('0x35')]=_0x4d94e6[_0xc750('0x35')][_0xc750('0x45')]?_0x4d94e6[_0xc750('0x35')]:_0x1602ce[_0xc750('0x30')];if(_0x191034[_0xc750('0x31')][_0xc750('0x40')]){_0x4d94e6[_0xc750('0x46')]=[{'all':!![]}];}_0x4d94e6=_[_0xc750('0x3c')]({},_0x4d94e6,_0x191034['options']);return db[_0xc750('0x3e')][_0xc750('0x47')](_0x4d94e6)[_0xc750('0x23')](handleEntityNotFound(_0x99148,null))[_0xc750('0x23')](respondWithResult(_0x99148,null))[_0xc750('0x42')](handleError(_0x99148,null));};exports[_0xc750('0x48')]=function(_0x4c8683,_0x304505){return db[_0xc750('0x3e')][_0xc750('0x48')](_0x4c8683[_0xc750('0x49')],{})[_0xc750('0x23')](function(_0x29cbec){var _0xfc7433=_0x4c8683[_0xc750('0x4a')][_0xc750('0x24')]({'plain':!![]});if(!_0xfc7433)throw new Error(_0xc750('0x4b'));if(_0xfc7433['role']==='user'){var _0xbec646=_0x29cbec['get']({'plain':!![]});var _0x4ffb76='CmHopperAdditionalPhones';return db[_0xc750('0x4c')][_0xc750('0x47')]({'where':{'name':_0x4ffb76,'userProfileId':_0xfc7433['userProfileId']},'raw':!![]})[_0xc750('0x23')](function(_0x49e498){if(_0x49e498&&_0x49e498[_0xc750('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0xbec646[_0xc750('0x28')],'resourceId':_0xbec646['id'],'type':_0x49e498['name'],'sectionId':_0x49e498['id']},{})[_0xc750('0x23')](function(){return _0x29cbec;});}else{return _0x29cbec;}})['catch'](function(_0x5da241){logger[_0xc750('0x26')](_0xc750('0x4e'),_0x5da241);throw _0x5da241;});}return _0x29cbec;})[_0xc750('0x23')](respondWithResult(_0x304505,0xc9))[_0xc750('0x42')](handleError(_0x304505,null));};exports[_0xc750('0x21')]=function(_0x160d6a,_0x2e887f){if(_0x160d6a[_0xc750('0x49')]['id']){delete _0x160d6a[_0xc750('0x49')]['id'];}return db['CmHopperAdditionalPhone'][_0xc750('0x47')]({'where':{'id':_0x160d6a[_0xc750('0x44')]['id']}})[_0xc750('0x23')](handleEntityNotFound(_0x2e887f,null))[_0xc750('0x23')](saveUpdates(_0x160d6a[_0xc750('0x49')],null))[_0xc750('0x23')](respondWithResult(_0x2e887f,null))[_0xc750('0x42')](handleError(_0x2e887f,null));};exports['destroy']=function(_0x2b3f25,_0x423ce5){return db[_0xc750('0x3e')][_0xc750('0x47')]({'where':{'id':_0x2b3f25[_0xc750('0x44')]['id']}})[_0xc750('0x23')](handleEntityNotFound(_0x423ce5,null))[_0xc750('0x23')](removeEntity(_0x423ce5,null))[_0xc750('0x42')](handleError(_0x423ce5,null));};
\ No newline at end of file
+var _0x4169=['lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','count','Content-Range','json','apply','save','then','get','CmHopperAdditionalPhones','destroy','error','name','send','index','map','CmHopperAdditionalPhone','fieldName','type','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','query','merge','VIRTUAL','filter','include','rows','show','params','rawAttributes','intersection','includeAll','options','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','catch','update','rimraf','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra'];(function(_0x5b3aca,_0x3d0d08){var _0x3c93b1=function(_0x11a2f5){while(--_0x11a2f5){_0x5b3aca['push'](_0x5b3aca['shift']());}};_0x3c93b1(++_0x3d0d08);}(_0x4169,0x1d8));var _0x9416=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4169[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9416('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9416('0x1'));var rp=require(_0x9416('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9416('0x3'));var path=require('path');var sox=require(_0x9416('0x4'));var csv=require(_0x9416('0x5'));var ejs=require(_0x9416('0x6'));var fs=require('fs');var fs_extra=require(_0x9416('0x7'));var _=require(_0x9416('0x8'));var squel=require('squel');var crypto=require(_0x9416('0x9'));var jsforce=require(_0x9416('0xa'));var deskjs=require(_0x9416('0xb'));var toCsv=require(_0x9416('0x5'));var querystring=require(_0x9416('0xc'));var Papa=require(_0x9416('0xd'));var Redis=require(_0x9416('0xe'));var authService=require(_0x9416('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9416('0x10'));var hardwareService=require(_0x9416('0x11'));var logger=require(_0x9416('0x12'))(_0x9416('0x13'));var utils=require(_0x9416('0x14'));var config=require(_0x9416('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f3834,_0x28239a){_0x28239a=_0x28239a||0xcc;return function(_0x4d5bb6){if(_0x4d5bb6){return _0x4f3834[_0x9416('0x16')](_0x28239a);}return _0x4f3834[_0x9416('0x17')](_0x28239a)[_0x9416('0x18')]();};}function respondWithResult(_0x43e9ba,_0x3abb4f){_0x3abb4f=_0x3abb4f||0xc8;return function(_0x4e2ccc){if(_0x4e2ccc){return _0x43e9ba['status'](_0x3abb4f)['json'](_0x4e2ccc);}};}function respondWithFilteredResult(_0x5781ef,_0x3edb41){return function(_0x49bbc8){if(_0x49bbc8){var _0x1f2c0a=typeof _0x3edb41[_0x9416('0x19')]==='undefined'&&typeof _0x3edb41['limit']==='undefined';var _0x5261da=_0x49bbc8[_0x9416('0x1a')];var _0x26dce3=_0x1f2c0a?0x0:_0x3edb41[_0x9416('0x19')];var _0x523dde=_0x1f2c0a?_0x49bbc8[_0x9416('0x1a')]:_0x3edb41[_0x9416('0x19')]+_0x3edb41['limit'];var _0x4a064d;if(_0x523dde>=_0x5261da){_0x523dde=_0x5261da;_0x4a064d=0xc8;}else{_0x4a064d=0xce;}_0x5781ef['status'](_0x4a064d);return _0x5781ef['set'](_0x9416('0x1b'),_0x26dce3+'-'+_0x523dde+'/'+_0x5261da)[_0x9416('0x1c')](_0x49bbc8);}return null;};}function patchUpdates(_0x259c87){return function(_0x4f5a6a){try{jsonpatch[_0x9416('0x1d')](_0x4f5a6a,_0x259c87,!![]);}catch(_0x28aeb5){return BPromise['reject'](_0x28aeb5);}return _0x4f5a6a[_0x9416('0x1e')]();};}function saveUpdates(_0x43b9f8,_0x4b4c4e){return function(_0x361e07){if(_0x361e07){return _0x361e07['update'](_0x43b9f8)[_0x9416('0x1f')](function(_0x5f51fd){return _0x5f51fd;});}return null;};}function removeEntity(_0x582894,_0x2590a9){return function(_0x2e3d2f){if(_0x2e3d2f){return _0x2e3d2f['destroy']()[_0x9416('0x1f')](function(){var _0x2c6008=_0x2e3d2f[_0x9416('0x20')]({'plain':!![]});var _0x22d34d=_0x9416('0x21');return db['UserProfileResource'][_0x9416('0x22')]({'where':{'type':_0x22d34d,'resourceId':_0x2c6008['id']}})['then'](function(){return _0x2e3d2f;});})[_0x9416('0x1f')](function(){_0x582894[_0x9416('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dd3b6,_0x9cdcb0){return function(_0x5d809b){if(!_0x5d809b){_0x2dd3b6[_0x9416('0x16')](0x194);}return _0x5d809b;};}function handleError(_0x126db6,_0x46d685){_0x46d685=_0x46d685||0x1f4;return function(_0x1ab6c3){logger[_0x9416('0x23')](_0x1ab6c3['stack']);if(_0x1ab6c3[_0x9416('0x24')]){delete _0x1ab6c3[_0x9416('0x24')];}_0x126db6[_0x9416('0x17')](_0x46d685)[_0x9416('0x25')](_0x1ab6c3);};}exports[_0x9416('0x26')]=function(_0x5db557,_0xeda63d){var _0x22ddb7={},_0x36b4f7={},_0x5f205e={'count':0x0,'rows':[]};var _0x522147=_[_0x9416('0x27')](db[_0x9416('0x28')]['rawAttributes'],function(_0xd9edb0){return{'name':_0xd9edb0[_0x9416('0x29')],'type':_0xd9edb0[_0x9416('0x2a')]['key']};});_0x36b4f7['model']=_[_0x9416('0x27')](_0x522147,'name');_0x36b4f7['query']=_[_0x9416('0x2b')](_0x5db557['query']);_0x36b4f7[_0x9416('0x2c')]=_['intersection'](_0x36b4f7[_0x9416('0x2d')],_0x36b4f7['query']);_0x22ddb7['attributes']=_['intersection'](_0x36b4f7[_0x9416('0x2d')],qs[_0x9416('0x2e')](_0x5db557['query'][_0x9416('0x2e')]));_0x22ddb7[_0x9416('0x2f')]=_0x22ddb7[_0x9416('0x2f')][_0x9416('0x30')]?_0x22ddb7[_0x9416('0x2f')]:_0x36b4f7[_0x9416('0x2d')];if(!_0x5db557['query'][_0x9416('0x31')](_0x9416('0x32'))){_0x22ddb7[_0x9416('0x33')]=qs[_0x9416('0x33')](_0x5db557['query']['limit']);_0x22ddb7['offset']=qs[_0x9416('0x19')](_0x5db557['query'][_0x9416('0x19')]);}_0x22ddb7[_0x9416('0x34')]=qs[_0x9416('0x35')](_0x5db557['query'][_0x9416('0x35')]);_0x22ddb7[_0x9416('0x36')]=qs[_0x9416('0x2c')](_['pick'](_0x5db557[_0x9416('0x37')],_0x36b4f7[_0x9416('0x2c')]),_0x522147);if(_0x5db557['query']['filter']){_0x22ddb7[_0x9416('0x36')]=_[_0x9416('0x38')](_0x22ddb7[_0x9416('0x36')],{'$or':_[_0x9416('0x27')](_0x522147,function(_0x1d0a95){if(_0x1d0a95[_0x9416('0x2a')]!==_0x9416('0x39')){var _0x407d8a={};_0x407d8a[_0x1d0a95[_0x9416('0x24')]]={'$like':'%'+_0x5db557[_0x9416('0x37')][_0x9416('0x3a')]+'%'};return _0x407d8a;}})});}_0x22ddb7=_[_0x9416('0x38')]({},_0x22ddb7,_0x5db557['options']);var _0x3cd022={'where':_0x22ddb7[_0x9416('0x36')]};return db[_0x9416('0x28')]['count'](_0x3cd022)['then'](function(_0x294df5){_0x5f205e[_0x9416('0x1a')]=_0x294df5;if(_0x5db557[_0x9416('0x37')]['includeAll']){_0x22ddb7[_0x9416('0x3b')]=[{'all':!![]}];}return db[_0x9416('0x28')]['findAll'](_0x22ddb7);})[_0x9416('0x1f')](function(_0x31088b){_0x5f205e[_0x9416('0x3c')]=_0x31088b;return _0x5f205e;})[_0x9416('0x1f')](respondWithFilteredResult(_0xeda63d,_0x22ddb7))['catch'](handleError(_0xeda63d,null));};exports[_0x9416('0x3d')]=function(_0xfd58a9,_0x1773c4){var _0x4522a0={'raw':!![],'where':{'id':_0xfd58a9[_0x9416('0x3e')]['id']}},_0x1be493={};_0x1be493[_0x9416('0x2d')]=_[_0x9416('0x2b')](db[_0x9416('0x28')][_0x9416('0x3f')]);_0x1be493[_0x9416('0x37')]=_[_0x9416('0x2b')](_0xfd58a9['query']);_0x1be493[_0x9416('0x2c')]=_['intersection'](_0x1be493[_0x9416('0x2d')],_0x1be493[_0x9416('0x37')]);_0x4522a0[_0x9416('0x2f')]=_[_0x9416('0x40')](_0x1be493['model'],qs[_0x9416('0x2e')](_0xfd58a9['query']['fields']));_0x4522a0['attributes']=_0x4522a0[_0x9416('0x2f')]['length']?_0x4522a0[_0x9416('0x2f')]:_0x1be493[_0x9416('0x2d')];if(_0xfd58a9[_0x9416('0x37')][_0x9416('0x41')]){_0x4522a0[_0x9416('0x3b')]=[{'all':!![]}];}_0x4522a0=_[_0x9416('0x38')]({},_0x4522a0,_0xfd58a9[_0x9416('0x42')]);return db[_0x9416('0x28')]['find'](_0x4522a0)[_0x9416('0x1f')](handleEntityNotFound(_0x1773c4,null))[_0x9416('0x1f')](respondWithResult(_0x1773c4,null))['catch'](handleError(_0x1773c4,null));};exports[_0x9416('0x43')]=function(_0x410dbe,_0x360bf4){return db[_0x9416('0x28')][_0x9416('0x43')](_0x410dbe[_0x9416('0x44')],{})[_0x9416('0x1f')](function(_0x443de7){var _0x311608=_0x410dbe[_0x9416('0x45')][_0x9416('0x20')]({'plain':!![]});if(!_0x311608)throw new Error(_0x9416('0x46'));if(_0x311608[_0x9416('0x47')]===_0x9416('0x45')){var _0x316938=_0x443de7[_0x9416('0x20')]({'plain':!![]});var _0x4e0731=_0x9416('0x21');return db[_0x9416('0x48')][_0x9416('0x49')]({'where':{'name':_0x4e0731,'userProfileId':_0x311608[_0x9416('0x4a')]},'raw':!![]})[_0x9416('0x1f')](function(_0x4c88ab){if(_0x4c88ab&&_0x4c88ab[_0x9416('0x4b')]===0x0){return db[_0x9416('0x4c')][_0x9416('0x43')]({'name':_0x316938[_0x9416('0x24')],'resourceId':_0x316938['id'],'type':_0x4c88ab['name'],'sectionId':_0x4c88ab['id']},{})[_0x9416('0x1f')](function(){return _0x443de7;});}else{return _0x443de7;}})['catch'](function(_0x2a442b){logger[_0x9416('0x23')](_0x9416('0x4d'),_0x2a442b);throw _0x2a442b;});}return _0x443de7;})[_0x9416('0x1f')](respondWithResult(_0x360bf4,0xc9))[_0x9416('0x4e')](handleError(_0x360bf4,null));};exports[_0x9416('0x4f')]=function(_0x1dee04,_0x3b32db){if(_0x1dee04[_0x9416('0x44')]['id']){delete _0x1dee04['body']['id'];}return db[_0x9416('0x28')][_0x9416('0x49')]({'where':{'id':_0x1dee04['params']['id']}})[_0x9416('0x1f')](handleEntityNotFound(_0x3b32db,null))[_0x9416('0x1f')](saveUpdates(_0x1dee04[_0x9416('0x44')],null))[_0x9416('0x1f')](respondWithResult(_0x3b32db,null))[_0x9416('0x4e')](handleError(_0x3b32db,null));};exports[_0x9416('0x22')]=function(_0x312886,_0x27902f){return db[_0x9416('0x28')][_0x9416('0x49')]({'where':{'id':_0x312886[_0x9416('0x3e')]['id']}})[_0x9416('0x1f')](handleEntityNotFound(_0x27902f,null))[_0x9416('0x1f')](removeEntity(_0x27902f,null))[_0x9416('0x4e')](handleError(_0x27902f,null));};
\ No newline at end of file
index a0d0ab4..09e8614 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfb4=['./cmHopperAdditionalPhone.attributes','exports','define','cm_hopper_additional_phones','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x11e791,_0x2969f3){var _0x5d04f0=function(_0x364cb7){while(--_0x364cb7){_0x11e791['push'](_0x11e791['shift']());}};_0x5d04f0(++_0x2969f3);}(_0xbfb4,0x1e8));var _0x4bfb=function(_0xe457df,_0x3e30d3){_0xe457df=_0xe457df-0x0;var _0x4e3d9a=_0xbfb4[_0xe457df];return _0x4e3d9a;};'use strict';var _=require(_0x4bfb('0x0'));var util=require('util');var logger=require(_0x4bfb('0x1'))('api');var moment=require(_0x4bfb('0x2'));var BPromise=require(_0x4bfb('0x3'));var rp=require(_0x4bfb('0x4'));var fs=require('fs');var path=require(_0x4bfb('0x5'));var rimraf=require(_0x4bfb('0x6'));var config=require('../../config/environment');var attributes=require(_0x4bfb('0x7'));module[_0x4bfb('0x8')]=function(_0x23762f,_0x58d52a){return _0x23762f[_0x4bfb('0x9')]('CmHopperAdditionalPhone',attributes,{'tableName':_0x4bfb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x14e4=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones'];(function(_0x2c2e53,_0x4a4149){var _0x427a47=function(_0x555047){while(--_0x555047){_0x2c2e53['push'](_0x2c2e53['shift']());}};_0x427a47(++_0x4a4149);}(_0x14e4,0x8c));var _0x414e=function(_0x1e9215,_0x16f9a1){_0x1e9215=_0x1e9215-0x0;var _0x35e3f8=_0x14e4[_0x1e9215];return _0x35e3f8;};'use strict';var _=require('lodash');var util=require(_0x414e('0x0'));var logger=require(_0x414e('0x1'))(_0x414e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x414e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x414e('0x4'));var config=require(_0x414e('0x5'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x414e('0x6')]=function(_0x56f0a6,_0x39bc48){return _0x56f0a6[_0x414e('0x7')](_0x414e('0x8'),attributes,{'tableName':_0x414e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 77d8f16..59ae238 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee72=['info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','OrderBy','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countcongestionretry','countnoanswerretry','entity','dialGlobalMaxRetry','ASC','duration','waitTime','scheduledat','add','isNil','minutes','updatedAt','phone','createdAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x3eff1f,_0x492e87){var _0x5076ba=function(_0x2c778b){while(--_0x2c778b){_0x3eff1f['push'](_0x3eff1f['shift']());}};_0x5076ba(++_0x492e87);}(_0xee72,0xda));var _0x2ee7=function(_0x51c1ae,_0x2704ca){_0x51c1ae=_0x51c1ae-0x0;var _0x5963ba=_0xee72[_0x51c1ae];return _0x5963ba;};'use strict';var _=require(_0x2ee7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2ee7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ee7('0x2'));var db=require(_0x2ee7('0x3'))['db'];var utils=require(_0x2ee7('0x4'));var logger=require(_0x2ee7('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2ee7('0x6'));var client=jayson[_0x2ee7('0x7')][_0x2ee7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42020e,_0x1bb40b,_0x3f5abc){return new BPromise(function(_0x255795,_0x4096b9){return client[_0x2ee7('0x9')](_0x42020e,_0x3f5abc)['then'](function(_0xacbff7){logger[_0x2ee7('0xa')](_0x2ee7('0xb'),_0x1bb40b,'request\x20sent');logger[_0x2ee7('0xc')](_0x2ee7('0xd'),_0x1bb40b,_0x2ee7('0xe'),JSON[_0x2ee7('0xf')](_0xacbff7));if(_0xacbff7['error']){if(_0xacbff7[_0x2ee7('0x10')][_0x2ee7('0x11')]===0x1f4){logger[_0x2ee7('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1bb40b,_0xacbff7[_0x2ee7('0x10')][_0x2ee7('0x12')]);return _0x4096b9(_0xacbff7[_0x2ee7('0x10')][_0x2ee7('0x12')]);}logger[_0x2ee7('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1bb40b,_0xacbff7['error'][_0x2ee7('0x12')]);return _0x255795(_0xacbff7[_0x2ee7('0x10')][_0x2ee7('0x12')]);}else{logger[_0x2ee7('0xa')](_0x2ee7('0xb'),_0x1bb40b,_0x2ee7('0xe'));_0x255795(_0xacbff7[_0x2ee7('0x13')][_0x2ee7('0x12')]);}})[_0x2ee7('0x14')](function(_0x586ee6){logger[_0x2ee7('0x10')](_0x2ee7('0xb'),_0x1bb40b,_0x586ee6);_0x4096b9(_0x586ee6);});});}exports[_0x2ee7('0x15')]=function(_0x2c2ea4){var _0x1ffdc1=this;return new Promise(function(_0x25fc35,_0x474f03){return db[_0x2ee7('0x16')][_0x2ee7('0x17')]({'raw':!![],'where':{'ContactId':_0x2c2ea4[_0x2ee7('0x18')][_0x2ee7('0x19')],'ListId':_0x2c2ea4[_0x2ee7('0x18')][_0x2ee7('0x1a')],'VoiceQueueId':_0x2c2ea4['body']['VoiceQueueId']===undefined?null:_0x2c2ea4['body'][_0x2ee7('0x1b')],'CampaignId':_0x2c2ea4[_0x2ee7('0x18')][_0x2ee7('0x1c')]===undefined?null:_0x2c2ea4[_0x2ee7('0x18')]['CampaignId']}})[_0x2ee7('0x1d')](function(_0x70ed9c){if(_0x70ed9c!=null){return db[_0x2ee7('0x1e')][_0x2ee7('0x17')]({'raw':!![],'where':{'CmHopperId':_0x70ed9c['id'],'OrderBy':{'$gt':_0x70ed9c['OrderBy']}},'order':[[_0x2ee7('0x1f'),'ASC']]})[_0x2ee7('0x1d')](function(_0x5400ea){var _0x112426=0x0;if(_0x5400ea){if(_0x5400ea['countbusyretry']+_0x5400ea['countcongestionretry']+_0x5400ea['countnoanswerretry']+_0x5400ea[_0x2ee7('0x20')]+_0x5400ea[_0x2ee7('0x21')]+_0x5400ea[_0x2ee7('0x22')]+_0x5400ea[_0x2ee7('0x23')]+_0x5400ea[_0x2ee7('0x24')]<_0x2c2ea4['entity']['dialGlobalMaxRetry'])_0x112426=0x1;_0x25fc35({'additional':_0x112426});}else{return db[_0x2ee7('0x1e')][_0x2ee7('0x17')]({'raw':!![],'where':{'CmHopperId':_0x70ed9c['id']},'order':[[_0x2ee7('0x1f'),'ASC']]})[_0x2ee7('0x1d')](function(_0x5dad1d){var _0x238034=0x0;if(_0x5dad1d){if(_0x5dad1d['countbusyretry']+_0x5dad1d[_0x2ee7('0x25')]+_0x5dad1d[_0x2ee7('0x26')]+_0x5dad1d[_0x2ee7('0x20')]+_0x5dad1d[_0x2ee7('0x21')]+_0x5dad1d[_0x2ee7('0x22')]+_0x5dad1d['countmachineretry']+_0x5dad1d[_0x2ee7('0x24')]<_0x2c2ea4[_0x2ee7('0x27')][_0x2ee7('0x28')])_0x238034=0x1;_0x25fc35({'additional':_0x238034});}else{_0x25fc35({'additional':0x0});}})[_0x2ee7('0x14')](function(_0x4e8bfa){logger[_0x2ee7('0x10')]('VerifyAdditionalPhones',_0x4e8bfa[_0x2ee7('0x12')]);_0x474f03(_0x1ffdc1['error'](0x1f4,_0x4e8bfa['message']));});}})[_0x2ee7('0x14')](function(_0x42548d){logger[_0x2ee7('0x10')]('VerifyAdditionalPhones',_0x42548d['message']);_0x474f03(_0x1ffdc1[_0x2ee7('0x10')](0x1f4,_0x42548d[_0x2ee7('0x12')]));});}else _0x25fc35({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x55fdd8){var _0x20d088=this;return new Promise(function(_0x273845,_0x46f851){return db[_0x2ee7('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0x55fdd8[_0x2ee7('0x18')]['ContactId'],'ListId':_0x55fdd8[_0x2ee7('0x18')][_0x2ee7('0x1a')],'VoiceQueueId':_0x55fdd8[_0x2ee7('0x18')][_0x2ee7('0x1b')]===undefined?null:_0x55fdd8['body'][_0x2ee7('0x1b')],'CampaignId':_0x55fdd8[_0x2ee7('0x18')]['CampaignId']===undefined?null:_0x55fdd8[_0x2ee7('0x18')][_0x2ee7('0x1c')]}})[_0x2ee7('0x1d')](function(_0xebe4de){if(_0xebe4de!=null){return db['CmHopperAdditionalPhone'][_0x2ee7('0x17')]({'raw':!![],'where':{'CmHopperId':_0xebe4de['id'],'OrderBy':{'$gte':_0xebe4de[_0x2ee7('0x1f')]}},'order':[['OrderBy',_0x2ee7('0x29')]]})['then'](function(_0x2e145b){if(_0x2e145b)return activateAdditionalPhone(_0xebe4de,_0x55fdd8['body'],_0x2e145b,_0x55fdd8[_0x2ee7('0x2a')],_0x55fdd8['waitTime'])[_0x2ee7('0x1d')](function(_0x1d7f9f){_0x273845(_0x1d7f9f);});else{return db[_0x2ee7('0x1e')][_0x2ee7('0x17')]({'raw':!![],'where':{'CmHopperId':_0xebe4de['id']},'order':[[_0x2ee7('0x1f'),_0x2ee7('0x29')]]})[_0x2ee7('0x1d')](function(_0x17c4c5){if(_0x17c4c5)return activateAdditionalPhone(_0xebe4de,_0x55fdd8[_0x2ee7('0x18')],_0x17c4c5,_0x55fdd8[_0x2ee7('0x2a')],_0x55fdd8[_0x2ee7('0x2b')])[_0x2ee7('0x1d')](function(_0x1cc359){_0x273845(_0x1cc359);});else{_0x273845({'id':_0xebe4de['id'],'phone':''});}})[_0x2ee7('0x14')](function(_0x4f978c){logger['error'](_0x2ee7('0x15'),_0x4f978c[_0x2ee7('0x12')]);_0x46f851(_0x20d088[_0x2ee7('0x10')](0x1f4,_0x4f978c[_0x2ee7('0x12')]));});}})[_0x2ee7('0x14')](function(_0x3e0e46){logger[_0x2ee7('0x10')](_0x2ee7('0x15'),_0x3e0e46[_0x2ee7('0x12')]);_0x46f851(_0x20d088[_0x2ee7('0x10')](0x1f4,_0x3e0e46['message']));});}else _0x273845(0x1);});});};function activateAdditionalPhone(_0x55d078,_0x32f4c7,_0x45aef6,_0x10154c,_0x48f7ce){return new Promise(function(_0x5433df,_0x45d3fd){var _0x4567d8;if(_['isNil'](_0x45aef6[_0x2ee7('0x2c')])){_0x45aef6[_0x2ee7('0x2c')]=moment();}if(moment()>moment(_0x45aef6[_0x2ee7('0x2c')])){_0x4567d8=moment()['add'](_0x48f7ce||0x3,'minutes');}else{if(_0x45aef6[_0x2ee7('0x1f')]==0x0){_0x4567d8=moment(_0x45aef6[_0x2ee7('0x2c')]);}else{_0x4567d8=moment()[_0x2ee7('0x2d')](_0x48f7ce||0x3,'minutes');}}if(_[_0x2ee7('0x2e')](_0x4567d8)){_0x4567d8=moment()[_0x2ee7('0x2d')](_0x48f7ce||0x3,'minutes');}var _0x57a107={'phone':_0x55d078['phone'],'active':0x0,'OrderBy':_[_0x2ee7('0x2e')](_0x55d078['OrderBy'])?0x0:_0x55d078[_0x2ee7('0x1f')],'scheduledat':moment()['add'](_0x10154c||0x1,_0x2ee7('0x2f')),'countbusyretry':_0x32f4c7['countbusyretry'],'countcongestionretry':_0x32f4c7[_0x2ee7('0x25')],'countnoanswerretry':_0x32f4c7[_0x2ee7('0x26')],'countnosuchnumberretry':_0x32f4c7['countnosuchnumberretry'],'countdropretry':_0x32f4c7[_0x2ee7('0x21')],'countabandonedretry':_0x32f4c7[_0x2ee7('0x22')],'countmachineretry':_0x32f4c7[_0x2ee7('0x23')],'countagentrejectretry':_0x32f4c7[_0x2ee7('0x24')],'createdAt':_0x32f4c7['createdAt'],'updatedAt':_0x32f4c7[_0x2ee7('0x30')]};var _0x298e0d={'CmHopperId':_0x55d078['id'],'phone':_0x45aef6[_0x2ee7('0x31')],'active':0x0,'OrderBy':_[_0x2ee7('0x2e')](_0x45aef6[_0x2ee7('0x1f')])?0x0:_0x45aef6[_0x2ee7('0x1f')],'scheduledat':_0x4567d8,'countbusyretry':_0x45aef6['countbusyretry'],'countcongestionretry':_0x45aef6[_0x2ee7('0x25')],'countnoanswerretry':_0x45aef6[_0x2ee7('0x26')],'countnosuchnumberretry':_0x45aef6[_0x2ee7('0x20')],'countdropretry':_0x45aef6['countdropretry'],'countabandonedretry':_0x45aef6['countabandonedretry'],'countmachineretry':_0x45aef6[_0x2ee7('0x23')],'countagentrejectretry':_0x45aef6[_0x2ee7('0x24')],'createdAt':_0x45aef6[_0x2ee7('0x32')],'updatedAt':_0x45aef6[_0x2ee7('0x30')]};return db[_0x2ee7('0x33')][_0x2ee7('0x34')](function(_0x37ee5d){return db[_0x2ee7('0x1e')][_0x2ee7('0x35')](_0x57a107,{'where':{'id':_0x45aef6['id']}},{'transaction':_0x37ee5d})['then'](function(){return db[_0x2ee7('0x16')][_0x2ee7('0x35')](_0x298e0d,{'where':{'id':_0x55d078['id']}},{'transaction':_0x37ee5d});});})[_0x2ee7('0x1d')](function(_0x3ca486){_0x5433df({'id':_0x55d078['id'],'phone':_0x45aef6[_0x2ee7('0x31')]});})[_0x2ee7('0x14')](function(_0x2805a1){logger[_0x2ee7('0x10')](_0x2ee7('0x36'),_0x2805a1['message']);_0x45d3fd({'error':_0x2805a1[_0x2ee7('0x12')]});});});}exports[_0x2ee7('0x37')]=function(_0x1ac40f){var _0x45690f=this;return new Promise(function(_0x1694ea,_0x11b3d5){return db[_0x2ee7('0x16')][_0x2ee7('0x35')](_0x1ac40f[_0x2ee7('0x18')][_0x2ee7('0x38')],{'where':{'id':_0x1ac40f[_0x2ee7('0x18')]['id']}})['then'](function(_0x37b53d){_0x1694ea(_0x37b53d);})[_0x2ee7('0x14')](function(_0x5d1cfa){logger[_0x2ee7('0x10')](_0x2ee7('0x37'),_0x5d1cfa['message']);_0x11b3d5(_0x45690f[_0x2ee7('0x10')](0x1f4,_0x5d1cfa[_0x2ee7('0x12')]));});});};
\ No newline at end of file
+var _0xeef0=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','code','message','result','VerifyAdditionalPhones','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','ASC','countbusyretry','catch','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','phone','countabandonedretry','updatedAt','createdAt','sequelize','update','CmHopper','activateAdditionalPhone','IncrementPreviewCounters','lodash'];(function(_0x4bc093,_0x36bf1a){var _0x3cc662=function(_0x13fad){while(--_0x13fad){_0x4bc093['push'](_0x4bc093['shift']());}};_0x3cc662(++_0x36bf1a);}(_0xeef0,0x121));var _0x0eef=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xeef0[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require(_0x0eef('0x0'));var util=require(_0x0eef('0x1'));var moment=require(_0x0eef('0x2'));var BPromise=require('bluebird');var rs=require(_0x0eef('0x3'));var fs=require('fs');var Redis=require(_0x0eef('0x4'));var db=require(_0x0eef('0x5'))['db'];var utils=require(_0x0eef('0x6'));var logger=require(_0x0eef('0x7'))('rpc');var config=require(_0x0eef('0x8'));var jayson=require(_0x0eef('0x9'));var client=jayson[_0x0eef('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53a33e,_0x5b6e59,_0x12fa21){return new BPromise(function(_0x586947,_0x458d77){return client[_0x0eef('0xb')](_0x53a33e,_0x12fa21)[_0x0eef('0xc')](function(_0x536e86){logger[_0x0eef('0xd')](_0x0eef('0xe'),_0x5b6e59,_0x0eef('0xf'));logger[_0x0eef('0x10')](_0x0eef('0x11'),_0x5b6e59,_0x0eef('0xf'),JSON['stringify'](_0x536e86));if(_0x536e86[_0x0eef('0x12')]){if(_0x536e86[_0x0eef('0x12')][_0x0eef('0x13')]===0x1f4){logger[_0x0eef('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x5b6e59,_0x536e86[_0x0eef('0x12')]['message']);return _0x458d77(_0x536e86[_0x0eef('0x12')][_0x0eef('0x14')]);}logger[_0x0eef('0x12')](_0x0eef('0xe'),_0x5b6e59,_0x536e86[_0x0eef('0x12')]['message']);return _0x586947(_0x536e86[_0x0eef('0x12')][_0x0eef('0x14')]);}else{logger[_0x0eef('0xd')](_0x0eef('0xe'),_0x5b6e59,_0x0eef('0xf'));_0x586947(_0x536e86[_0x0eef('0x15')][_0x0eef('0x14')]);}})['catch'](function(_0x5dcf8e){logger['error'](_0x0eef('0xe'),_0x5b6e59,_0x5dcf8e);_0x458d77(_0x5dcf8e);});});}exports[_0x0eef('0x16')]=function(_0x2e4c76){var _0xf9aeb7=this;return new Promise(function(_0x4f5323,_0x1faa92){return db['CmHopper'][_0x0eef('0x17')]({'raw':!![],'where':{'ContactId':_0x2e4c76[_0x0eef('0x18')][_0x0eef('0x19')],'ListId':_0x2e4c76['body'][_0x0eef('0x1a')],'VoiceQueueId':_0x2e4c76[_0x0eef('0x18')]['VoiceQueueId']===undefined?null:_0x2e4c76['body'][_0x0eef('0x1b')],'CampaignId':_0x2e4c76['body']['CampaignId']===undefined?null:_0x2e4c76['body'][_0x0eef('0x1c')]}})[_0x0eef('0xc')](function(_0x447219){if(_0x447219!=null){return db[_0x0eef('0x1d')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x447219['id'],'OrderBy':{'$gt':_0x447219[_0x0eef('0x1e')]}},'order':[[_0x0eef('0x1e'),'ASC']]})[_0x0eef('0xc')](function(_0x1941f7){var _0x20010a=0x0;if(_0x1941f7){if(_0x1941f7['countbusyretry']+_0x1941f7[_0x0eef('0x1f')]+_0x1941f7[_0x0eef('0x20')]+_0x1941f7[_0x0eef('0x21')]+_0x1941f7[_0x0eef('0x22')]+_0x1941f7['countabandonedretry']+_0x1941f7[_0x0eef('0x23')]+_0x1941f7[_0x0eef('0x24')]<_0x2e4c76[_0x0eef('0x25')][_0x0eef('0x26')])_0x20010a=0x1;_0x4f5323({'additional':_0x20010a});}else{return db['CmHopperAdditionalPhone'][_0x0eef('0x17')]({'raw':!![],'where':{'CmHopperId':_0x447219['id']},'order':[[_0x0eef('0x1e'),_0x0eef('0x27')]]})['then'](function(_0xd5b993){var _0x3388c8=0x0;if(_0xd5b993){if(_0xd5b993[_0x0eef('0x28')]+_0xd5b993[_0x0eef('0x1f')]+_0xd5b993['countnoanswerretry']+_0xd5b993[_0x0eef('0x21')]+_0xd5b993[_0x0eef('0x22')]+_0xd5b993['countabandonedretry']+_0xd5b993[_0x0eef('0x23')]+_0xd5b993[_0x0eef('0x24')]<_0x2e4c76['entity'][_0x0eef('0x26')])_0x3388c8=0x1;_0x4f5323({'additional':_0x3388c8});}else{_0x4f5323({'additional':0x0});}})[_0x0eef('0x29')](function(_0x1d8a84){logger['error'](_0x0eef('0x16'),_0x1d8a84['message']);_0x1faa92(_0xf9aeb7[_0x0eef('0x12')](0x1f4,_0x1d8a84[_0x0eef('0x14')]));});}})[_0x0eef('0x29')](function(_0x52ac56){logger[_0x0eef('0x12')](_0x0eef('0x16'),_0x52ac56[_0x0eef('0x14')]);_0x1faa92(_0xf9aeb7[_0x0eef('0x12')](0x1f4,_0x52ac56[_0x0eef('0x14')]));});}else _0x4f5323({'additional':0x0});});});};exports[_0x0eef('0x2a')]=function(_0x370b20){var _0x3e6ee0=this;return new Promise(function(_0x308b5f,_0x5f2d20){return db['CmHopper'][_0x0eef('0x17')]({'raw':!![],'where':{'ContactId':_0x370b20[_0x0eef('0x18')][_0x0eef('0x19')],'ListId':_0x370b20['body'][_0x0eef('0x1a')],'VoiceQueueId':_0x370b20[_0x0eef('0x18')]['VoiceQueueId']===undefined?null:_0x370b20[_0x0eef('0x18')][_0x0eef('0x1b')],'CampaignId':_0x370b20[_0x0eef('0x18')][_0x0eef('0x1c')]===undefined?null:_0x370b20['body'][_0x0eef('0x1c')]}})[_0x0eef('0xc')](function(_0x1896f4){if(_0x1896f4!=null){return db[_0x0eef('0x1d')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x1896f4['id'],'OrderBy':{'$gte':_0x1896f4[_0x0eef('0x1e')]}},'order':[[_0x0eef('0x1e'),_0x0eef('0x27')]]})['then'](function(_0x527c4d){if(_0x527c4d)return activateAdditionalPhone(_0x1896f4,_0x370b20[_0x0eef('0x18')],_0x527c4d,_0x370b20[_0x0eef('0x2b')],_0x370b20[_0x0eef('0x2c')])[_0x0eef('0xc')](function(_0x1c13fd){_0x308b5f(_0x1c13fd);});else{return db['CmHopperAdditionalPhone'][_0x0eef('0x17')]({'raw':!![],'where':{'CmHopperId':_0x1896f4['id']},'order':[['OrderBy',_0x0eef('0x27')]]})['then'](function(_0x2abd96){if(_0x2abd96)return activateAdditionalPhone(_0x1896f4,_0x370b20[_0x0eef('0x18')],_0x2abd96,_0x370b20[_0x0eef('0x2b')],_0x370b20['waitTime'])[_0x0eef('0xc')](function(_0x2de4ae){_0x308b5f(_0x2de4ae);});else{_0x308b5f({'id':_0x1896f4['id'],'phone':''});}})['catch'](function(_0x43dcd1){logger[_0x0eef('0x12')](_0x0eef('0x16'),_0x43dcd1[_0x0eef('0x14')]);_0x5f2d20(_0x3e6ee0[_0x0eef('0x12')](0x1f4,_0x43dcd1[_0x0eef('0x14')]));});}})['catch'](function(_0x2242a1){logger[_0x0eef('0x12')](_0x0eef('0x16'),_0x2242a1[_0x0eef('0x14')]);_0x5f2d20(_0x3e6ee0[_0x0eef('0x12')](0x1f4,_0x2242a1[_0x0eef('0x14')]));});}else _0x308b5f(0x1);});});};function activateAdditionalPhone(_0x10dbe0,_0x5a66cd,_0x2dab4e,_0x21f260,_0x5d2547){return new Promise(function(_0x792f82,_0xfe8c17){var _0x55211a;if(_[_0x0eef('0x2d')](_0x2dab4e[_0x0eef('0x2e')])){_0x2dab4e['scheduledat']=moment();}if(moment()>moment(_0x2dab4e[_0x0eef('0x2e')])){_0x55211a=moment()[_0x0eef('0x2f')](_0x5d2547||0x3,_0x0eef('0x30'));}else{if(_0x2dab4e['OrderBy']==0x0){_0x55211a=moment(_0x2dab4e[_0x0eef('0x2e')]);}else{_0x55211a=moment()[_0x0eef('0x2f')](_0x5d2547||0x3,'minutes');}}if(_['isNil'](_0x55211a)){_0x55211a=moment()[_0x0eef('0x2f')](_0x5d2547||0x3,'minutes');}var _0x17b757={'phone':_0x10dbe0[_0x0eef('0x31')],'active':0x0,'OrderBy':_[_0x0eef('0x2d')](_0x10dbe0[_0x0eef('0x1e')])?0x0:_0x10dbe0[_0x0eef('0x1e')],'scheduledat':moment()[_0x0eef('0x2f')](_0x21f260||0x1,_0x0eef('0x30')),'countbusyretry':_0x5a66cd[_0x0eef('0x28')],'countcongestionretry':_0x5a66cd[_0x0eef('0x1f')],'countnoanswerretry':_0x5a66cd['countnoanswerretry'],'countnosuchnumberretry':_0x5a66cd['countnosuchnumberretry'],'countdropretry':_0x5a66cd['countdropretry'],'countabandonedretry':_0x5a66cd[_0x0eef('0x32')],'countmachineretry':_0x5a66cd[_0x0eef('0x23')],'countagentrejectretry':_0x5a66cd['countagentrejectretry'],'createdAt':_0x5a66cd['createdAt'],'updatedAt':_0x5a66cd[_0x0eef('0x33')]};var _0x2febbe={'CmHopperId':_0x10dbe0['id'],'phone':_0x2dab4e['phone'],'active':0x0,'OrderBy':_['isNil'](_0x2dab4e['OrderBy'])?0x0:_0x2dab4e[_0x0eef('0x1e')],'scheduledat':_0x55211a,'countbusyretry':_0x2dab4e[_0x0eef('0x28')],'countcongestionretry':_0x2dab4e['countcongestionretry'],'countnoanswerretry':_0x2dab4e[_0x0eef('0x20')],'countnosuchnumberretry':_0x2dab4e[_0x0eef('0x21')],'countdropretry':_0x2dab4e['countdropretry'],'countabandonedretry':_0x2dab4e[_0x0eef('0x32')],'countmachineretry':_0x2dab4e[_0x0eef('0x23')],'countagentrejectretry':_0x2dab4e[_0x0eef('0x24')],'createdAt':_0x2dab4e[_0x0eef('0x34')],'updatedAt':_0x2dab4e[_0x0eef('0x33')]};return db[_0x0eef('0x35')]['transaction'](function(_0x4f5ff3){return db[_0x0eef('0x1d')][_0x0eef('0x36')](_0x17b757,{'where':{'id':_0x2dab4e['id']}},{'transaction':_0x4f5ff3})[_0x0eef('0xc')](function(){return db[_0x0eef('0x37')][_0x0eef('0x36')](_0x2febbe,{'where':{'id':_0x10dbe0['id']}},{'transaction':_0x4f5ff3});});})[_0x0eef('0xc')](function(_0x269b58){_0x792f82({'id':_0x10dbe0['id'],'phone':_0x2dab4e[_0x0eef('0x31')]});})[_0x0eef('0x29')](function(_0x516f41){logger['error'](_0x0eef('0x38'),_0x516f41[_0x0eef('0x14')]);_0xfe8c17({'error':_0x516f41[_0x0eef('0x14')]});});});}exports[_0x0eef('0x39')]=function(_0x5e00c4){var _0x27b0a9=this;return new Promise(function(_0x588224,_0x3c369e){return db[_0x0eef('0x37')]['update'](_0x5e00c4[_0x0eef('0x18')]['field'],{'where':{'id':_0x5e00c4[_0x0eef('0x18')]['id']}})['then'](function(_0x17ce08){_0x588224(_0x17ce08);})[_0x0eef('0x29')](function(_0x15e8fb){logger[_0x0eef('0x12')](_0x0eef('0x39'),_0x15e8fb[_0x0eef('0x14')]);_0x3c369e(_0x27b0a9[_0x0eef('0x12')](0x1f4,_0x15e8fb[_0x0eef('0x14')]));});});};
\ No newline at end of file
index 30605e8..7d52ff6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c0c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x498910,_0x207085){var _0x585e52=function(_0x2cf8f1){while(--_0x2cf8f1){_0x498910['push'](_0x498910['shift']());}};_0x585e52(++_0x207085);}(_0x8c0c,0x11b));var _0xc8c0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8c0c[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xc8c0('0x0'));var util=require(_0xc8c0('0x1'));var path=require(_0xc8c0('0x2'));var timeout=require(_0xc8c0('0x3'));var express=require(_0xc8c0('0x4'));var router=express[_0xc8c0('0x5')]();var fs_extra=require(_0xc8c0('0x6'));var auth=require(_0xc8c0('0x7'));var interaction=require(_0xc8c0('0x8'));var config=require(_0xc8c0('0x9'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0xc8c0('0xa')]('/',auth[_0xc8c0('0xb')](),controller[_0xc8c0('0xc')]);router[_0xc8c0('0xa')](_0xc8c0('0xd'),auth[_0xc8c0('0xb')](),controller['show']);router['post']('/',auth[_0xc8c0('0xb')](),controller[_0xc8c0('0xe')]);router[_0xc8c0('0xf')](_0xc8c0('0xd'),auth[_0xc8c0('0xb')](),controller[_0xc8c0('0x10')]);router['delete'](_0xc8c0('0xd'),auth[_0xc8c0('0xb')](),controller['destroy']);module[_0xc8c0('0x11')]=router;
\ No newline at end of file
+var _0x3260=['/:id','isAuthenticated','show','create','put','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x382a90,_0x2a8aac){var _0x4c8223=function(_0x81e0d0){while(--_0x81e0d0){_0x382a90['push'](_0x382a90['shift']());}};_0x4c8223(++_0x2a8aac);}(_0x3260,0xd7));var _0x0326=function(_0x866c00,_0x528971){_0x866c00=_0x866c00-0x0;var _0x3b8378=_0x3260[_0x866c00];return _0x3b8378;};'use strict';var multer=require(_0x0326('0x0'));var util=require(_0x0326('0x1'));var path=require(_0x0326('0x2'));var timeout=require(_0x0326('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0326('0x4'));var auth=require(_0x0326('0x5'));var interaction=require(_0x0326('0x6'));var config=require(_0x0326('0x7'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x0326('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0326('0x8')](_0x0326('0x9'),auth[_0x0326('0xa')](),controller[_0x0326('0xb')]);router['post']('/',auth[_0x0326('0xa')](),controller[_0x0326('0xc')]);router[_0x0326('0xd')](_0x0326('0x9'),auth[_0x0326('0xa')](),controller['update']);router[_0x0326('0xe')](_0x0326('0x9'),auth[_0x0326('0xa')](),controller[_0x0326('0xf')]);module['exports']=router;
\ No newline at end of file
index ac270a4..7a4c83e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a5a=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x205e5a,_0x5c19fb){var _0x10da58=function(_0x1ba35d){while(--_0x1ba35d){_0x205e5a['push'](_0x205e5a['shift']());}};_0x10da58(++_0x5c19fb);}(_0x9a5a,0x194));var _0xa9a5=function(_0x21841c,_0x1200d6){_0x21841c=_0x21841c-0x0;var _0x43ff01=_0x9a5a[_0x21841c];return _0x43ff01;};'use strict';var moment=require(_0xa9a5('0x0'));var Sequelize=require(_0xa9a5('0x1'));module[_0xa9a5('0x2')]={'phone':{'type':Sequelize[_0xa9a5('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa9a5('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xa9a5('0x4')],'unique':_0xa9a5('0x5')},'VoiceQueueId':{'type':Sequelize[_0xa9a5('0x4')],'unique':_0xa9a5('0x5')}};
\ No newline at end of file
+var _0x37a7=['sequelize','contactListQueue','INTEGER','moment'];(function(_0x7e1454,_0x3f6b8e){var _0xc55cbb=function(_0x1b44e0){while(--_0x1b44e0){_0x7e1454['push'](_0x7e1454['shift']());}};_0xc55cbb(++_0x3f6b8e);}(_0x37a7,0x6f));var _0x737a=function(_0x87fa51,_0x525e2b){_0x87fa51=_0x87fa51-0x0;var _0x58ba2f=_0x37a7[_0x87fa51];return _0x58ba2f;};'use strict';var moment=require(_0x737a('0x0'));var Sequelize=require(_0x737a('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x737a('0x2')},'ListId':{'type':Sequelize[_0x737a('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}};
\ No newline at end of file
index 250b86d..75f37a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02b6=['stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error'];(function(_0x4f5e79,_0x307728){var _0x2d8391=function(_0x158251){while(--_0x158251){_0x4f5e79['push'](_0x4f5e79['shift']());}};_0x2d8391(++_0x307728);}(_0x02b6,0xfe));var _0x602b=function(_0x2c5f49,_0x5d3788){_0x2c5f49=_0x2c5f49-0x0;var _0x29b756=_0x02b6[_0x2c5f49];return _0x29b756;};'use strict';var emlformat=require(_0x602b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x602b('0x1'));var jsonpatch=require(_0x602b('0x2'));var rp=require(_0x602b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x602b('0x4'));var util=require(_0x602b('0x5'));var path=require(_0x602b('0x6'));var sox=require(_0x602b('0x7'));var csv=require('to-csv');var ejs=require(_0x602b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x602b('0x9'));var squel=require(_0x602b('0xa'));var crypto=require(_0x602b('0xb'));var jsforce=require(_0x602b('0xc'));var deskjs=require(_0x602b('0xd'));var toCsv=require(_0x602b('0xe'));var querystring=require(_0x602b('0xf'));var Papa=require(_0x602b('0x10'));var Redis=require(_0x602b('0x11'));var authService=require(_0x602b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x602b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x602b('0x14'));var utils=require('../../config/utils');var config=require(_0x602b('0x15'));var licenseUtil=require(_0x602b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e7882,_0x41cd15){_0x41cd15=_0x41cd15||0xcc;return function(_0x135847){if(_0x135847){return _0x1e7882['sendStatus'](_0x41cd15);}return _0x1e7882[_0x602b('0x17')](_0x41cd15)[_0x602b('0x18')]();};}function respondWithResult(_0x2c7f9a,_0x3742f1){_0x3742f1=_0x3742f1||0xc8;return function(_0x27eb0a){if(_0x27eb0a){return _0x2c7f9a[_0x602b('0x17')](_0x3742f1)[_0x602b('0x19')](_0x27eb0a);}};}function respondWithFilteredResult(_0x5035b6,_0x505efc){return function(_0xc4711d){if(_0xc4711d){var _0x41f957=typeof _0x505efc[_0x602b('0x1a')]===_0x602b('0x1b')&&typeof _0x505efc[_0x602b('0x1c')]===_0x602b('0x1b');var _0x416f64=_0xc4711d[_0x602b('0x1d')];var _0x46758d=_0x41f957?0x0:_0x505efc['offset'];var _0x48d992=_0x41f957?_0xc4711d[_0x602b('0x1d')]:_0x505efc[_0x602b('0x1a')]+_0x505efc['limit'];var _0x3c991c;if(_0x48d992>=_0x416f64){_0x48d992=_0x416f64;_0x3c991c=0xc8;}else{_0x3c991c=0xce;}_0x5035b6['status'](_0x3c991c);return _0x5035b6['set'](_0x602b('0x1e'),_0x46758d+'-'+_0x48d992+'/'+_0x416f64)['json'](_0xc4711d);}return null;};}function patchUpdates(_0x28eadf){return function(_0x5e0d15){try{jsonpatch[_0x602b('0x1f')](_0x5e0d15,_0x28eadf,!![]);}catch(_0x36cd1b){return BPromise[_0x602b('0x20')](_0x36cd1b);}return _0x5e0d15['save']();};}function saveUpdates(_0x258e11,_0x1264c8){return function(_0x580b66){if(_0x580b66){return _0x580b66[_0x602b('0x21')](_0x258e11)[_0x602b('0x22')](function(_0x2c59f3){return _0x2c59f3;});}return null;};}function removeEntity(_0x1943a0,_0x8510cf){return function(_0xb3beff){if(_0xb3beff){return _0xb3beff[_0x602b('0x23')]()[_0x602b('0x22')](function(){_0x1943a0[_0x602b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43acc3,_0x427bf1){return function(_0x5ce51b){if(!_0x5ce51b){_0x43acc3[_0x602b('0x24')](0x194);}return _0x5ce51b;};}function handleError(_0x469bd9,_0x50e64e){_0x50e64e=_0x50e64e||0x1f4;return function(_0x11dfd5){logger[_0x602b('0x25')](_0x11dfd5[_0x602b('0x26')]);if(_0x11dfd5[_0x602b('0x27')]){delete _0x11dfd5[_0x602b('0x27')];}_0x469bd9[_0x602b('0x17')](_0x50e64e)[_0x602b('0x28')](_0x11dfd5);};}exports[_0x602b('0x29')]=function(_0x3e82bc,_0x1fc94f){var _0x433ad0={},_0x529fa8={},_0x23a7f4={'count':0x0,'rows':[]};var _0x582ccc=_[_0x602b('0x2a')](db[_0x602b('0x2b')][_0x602b('0x2c')],function(_0x3b951b){return{'name':_0x3b951b[_0x602b('0x2d')],'type':_0x3b951b[_0x602b('0x2e')][_0x602b('0x2f')]};});_0x529fa8[_0x602b('0x30')]=_[_0x602b('0x2a')](_0x582ccc,_0x602b('0x27'));_0x529fa8[_0x602b('0x31')]=_['keys'](_0x3e82bc['query']);_0x529fa8[_0x602b('0x32')]=_[_0x602b('0x33')](_0x529fa8[_0x602b('0x30')],_0x529fa8[_0x602b('0x31')]);_0x433ad0['attributes']=_[_0x602b('0x33')](_0x529fa8[_0x602b('0x30')],qs[_0x602b('0x34')](_0x3e82bc['query'][_0x602b('0x34')]));_0x433ad0[_0x602b('0x35')]=_0x433ad0[_0x602b('0x35')][_0x602b('0x36')]?_0x433ad0['attributes']:_0x529fa8[_0x602b('0x30')];if(!_0x3e82bc['query'][_0x602b('0x37')](_0x602b('0x38'))){_0x433ad0[_0x602b('0x1c')]=qs[_0x602b('0x1c')](_0x3e82bc[_0x602b('0x31')][_0x602b('0x1c')]);_0x433ad0['offset']=qs[_0x602b('0x1a')](_0x3e82bc[_0x602b('0x31')][_0x602b('0x1a')]);}_0x433ad0['order']=qs[_0x602b('0x39')](_0x3e82bc['query'][_0x602b('0x39')]);_0x433ad0[_0x602b('0x3a')]=qs['filters'](_['pick'](_0x3e82bc['query'],_0x529fa8[_0x602b('0x32')]),_0x582ccc);if(_0x3e82bc[_0x602b('0x31')][_0x602b('0x3b')]){_0x433ad0[_0x602b('0x3a')]=_[_0x602b('0x3c')](_0x433ad0[_0x602b('0x3a')],{'$or':_[_0x602b('0x2a')](_0x582ccc,function(_0x1ca1e5){if(_0x1ca1e5[_0x602b('0x2e')]!=='VIRTUAL'){var _0x31bb71={};_0x31bb71[_0x1ca1e5[_0x602b('0x27')]]={'$like':'%'+_0x3e82bc[_0x602b('0x31')]['filter']+'%'};return _0x31bb71;}})});}_0x433ad0=_[_0x602b('0x3c')]({},_0x433ad0,_0x3e82bc[_0x602b('0x3d')]);var _0x10529a={'where':_0x433ad0['where']};return db[_0x602b('0x2b')][_0x602b('0x1d')](_0x10529a)[_0x602b('0x22')](function(_0x19376a){_0x23a7f4[_0x602b('0x1d')]=_0x19376a;if(_0x3e82bc['query'][_0x602b('0x3e')]){_0x433ad0[_0x602b('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x602b('0x40')](_0x433ad0);})[_0x602b('0x22')](function(_0x3888f6){_0x23a7f4[_0x602b('0x41')]=_0x3888f6;return _0x23a7f4;})['then'](respondWithFilteredResult(_0x1fc94f,_0x433ad0))['catch'](handleError(_0x1fc94f,null));};exports[_0x602b('0x42')]=function(_0x521cfd,_0x4a68d4){var _0x2ab1cf={'raw':!![],'where':{'id':_0x521cfd[_0x602b('0x43')]['id']}},_0x4bc46a={};_0x4bc46a[_0x602b('0x30')]=_[_0x602b('0x44')](db['CmHopperBlack'][_0x602b('0x2c')]);_0x4bc46a['query']=_['keys'](_0x521cfd[_0x602b('0x31')]);_0x4bc46a[_0x602b('0x32')]=_[_0x602b('0x33')](_0x4bc46a[_0x602b('0x30')],_0x4bc46a[_0x602b('0x31')]);_0x2ab1cf[_0x602b('0x35')]=_[_0x602b('0x33')](_0x4bc46a[_0x602b('0x30')],qs[_0x602b('0x34')](_0x521cfd[_0x602b('0x31')][_0x602b('0x34')]));_0x2ab1cf['attributes']=_0x2ab1cf[_0x602b('0x35')][_0x602b('0x36')]?_0x2ab1cf[_0x602b('0x35')]:_0x4bc46a['model'];if(_0x521cfd[_0x602b('0x31')][_0x602b('0x3e')]){_0x2ab1cf['include']=[{'all':!![]}];}_0x2ab1cf=_[_0x602b('0x3c')]({},_0x2ab1cf,_0x521cfd['options']);return db[_0x602b('0x2b')][_0x602b('0x45')](_0x2ab1cf)[_0x602b('0x22')](handleEntityNotFound(_0x4a68d4,null))[_0x602b('0x22')](respondWithResult(_0x4a68d4,null))[_0x602b('0x46')](handleError(_0x4a68d4,null));};exports[_0x602b('0x21')]=function(_0xec0931,_0x2fb9ad){if(_0xec0931[_0x602b('0x47')]['id']){delete _0xec0931[_0x602b('0x47')]['id'];}return db[_0x602b('0x2b')][_0x602b('0x45')]({'where':{'id':_0xec0931['params']['id']}})['then'](handleEntityNotFound(_0x2fb9ad,null))['then'](saveUpdates(_0xec0931[_0x602b('0x47')],null))[_0x602b('0x22')](respondWithResult(_0x2fb9ad,null))[_0x602b('0x46')](handleError(_0x2fb9ad,null));};exports[_0x602b('0x23')]=function(_0x141a27,_0x3490d1){return db[_0x602b('0x2b')][_0x602b('0x45')]({'where':{'id':_0x141a27['params']['id']}})[_0x602b('0x22')](handleEntityNotFound(_0x3490d1,null))['then'](removeEntity(_0x3490d1,null))[_0x602b('0x46')](handleError(_0x3490d1,null));};exports[_0x602b('0x48')]=function(_0x52677b,_0x3633ba){return db['CmHopperBlack'][_0x602b('0x48')]()[_0x602b('0x22')](respondWithResult(_0x3633ba,null))[_0x602b('0x46')](handleError(_0x3633ba,null));};
\ No newline at end of file
+var _0xf27d=['end','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','error','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','type','key','map','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','body','describe','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x43bd97,_0x4f6297){var _0x3c8229=function(_0x164ecf){while(--_0x164ecf){_0x43bd97['push'](_0x43bd97['shift']());}};_0x3c8229(++_0x4f6297);}(_0xf27d,0xc3));var _0xdf27=function(_0x4a6779,_0x8f505e){_0x4a6779=_0x4a6779-0x0;var _0x17c2c7=_0xf27d[_0x4a6779];return _0x17c2c7;};'use strict';var emlformat=require(_0xdf27('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf27('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf27('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdf27('0x3'));var util=require(_0xdf27('0x4'));var path=require(_0xdf27('0x5'));var sox=require(_0xdf27('0x6'));var csv=require(_0xdf27('0x7'));var ejs=require(_0xdf27('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdf27('0x9'));var squel=require(_0xdf27('0xa'));var crypto=require(_0xdf27('0xb'));var jsforce=require(_0xdf27('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdf27('0xd'));var Papa=require(_0xdf27('0xe'));var Redis=require('ioredis');var authService=require(_0xdf27('0xf'));var qs=require(_0xdf27('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf27('0x11'));var logger=require(_0xdf27('0x12'))(_0xdf27('0x13'));var utils=require(_0xdf27('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdf27('0x15'));var db=require(_0xdf27('0x16'))['db'];function respondWithStatusCode(_0x3f4454,_0x440e0d){_0x440e0d=_0x440e0d||0xcc;return function(_0x23a5c0){if(_0x23a5c0){return _0x3f4454[_0xdf27('0x17')](_0x440e0d);}return _0x3f4454['status'](_0x440e0d)[_0xdf27('0x18')]();};}function respondWithResult(_0x16df03,_0x29fbb2){_0x29fbb2=_0x29fbb2||0xc8;return function(_0xfe234f){if(_0xfe234f){return _0x16df03[_0xdf27('0x19')](_0x29fbb2)[_0xdf27('0x1a')](_0xfe234f);}};}function respondWithFilteredResult(_0x214cb0,_0x599b6e){return function(_0x209acf){if(_0x209acf){var _0x44691f=typeof _0x599b6e['offset']===_0xdf27('0x1b')&&typeof _0x599b6e[_0xdf27('0x1c')]===_0xdf27('0x1b');var _0x2d07a5=_0x209acf[_0xdf27('0x1d')];var _0x1b843c=_0x44691f?0x0:_0x599b6e['offset'];var _0x54e5a9=_0x44691f?_0x209acf[_0xdf27('0x1d')]:_0x599b6e[_0xdf27('0x1e')]+_0x599b6e[_0xdf27('0x1c')];var _0x151935;if(_0x54e5a9>=_0x2d07a5){_0x54e5a9=_0x2d07a5;_0x151935=0xc8;}else{_0x151935=0xce;}_0x214cb0[_0xdf27('0x19')](_0x151935);return _0x214cb0[_0xdf27('0x1f')](_0xdf27('0x20'),_0x1b843c+'-'+_0x54e5a9+'/'+_0x2d07a5)[_0xdf27('0x1a')](_0x209acf);}return null;};}function patchUpdates(_0x24a751){return function(_0x55f08c){try{jsonpatch['apply'](_0x55f08c,_0x24a751,!![]);}catch(_0x509f6f){return BPromise['reject'](_0x509f6f);}return _0x55f08c[_0xdf27('0x21')]();};}function saveUpdates(_0x3e7719,_0x48b081){return function(_0x3001eb){if(_0x3001eb){return _0x3001eb[_0xdf27('0x22')](_0x3e7719)[_0xdf27('0x23')](function(_0x32df4d){return _0x32df4d;});}return null;};}function removeEntity(_0x5be31b,_0x2afb6e){return function(_0x444b5f){if(_0x444b5f){return _0x444b5f['destroy']()['then'](function(){_0x5be31b[_0xdf27('0x19')](0xcc)[_0xdf27('0x18')]();});}};}function handleEntityNotFound(_0x28bfdf,_0x4985a8){return function(_0x3f7605){if(!_0x3f7605){_0x28bfdf['sendStatus'](0x194);}return _0x3f7605;};}function handleError(_0x23dcb6,_0x463f59){_0x463f59=_0x463f59||0x1f4;return function(_0x3e8dd2){logger[_0xdf27('0x24')](_0x3e8dd2[_0xdf27('0x25')]);if(_0x3e8dd2[_0xdf27('0x26')]){delete _0x3e8dd2[_0xdf27('0x26')];}_0x23dcb6[_0xdf27('0x19')](_0x463f59)[_0xdf27('0x27')](_0x3e8dd2);};}exports[_0xdf27('0x28')]=function(_0x561cc3,_0x193788){var _0x5a871={},_0x2abf18={},_0x1e04c2={'count':0x0,'rows':[]};var _0xb0a8c0=_['map'](db[_0xdf27('0x29')][_0xdf27('0x2a')],function(_0x59e926){return{'name':_0x59e926[_0xdf27('0x2b')],'type':_0x59e926[_0xdf27('0x2c')][_0xdf27('0x2d')]};});_0x2abf18['model']=_[_0xdf27('0x2e')](_0xb0a8c0,_0xdf27('0x26'));_0x2abf18[_0xdf27('0x2f')]=_[_0xdf27('0x30')](_0x561cc3[_0xdf27('0x2f')]);_0x2abf18['filters']=_['intersection'](_0x2abf18[_0xdf27('0x31')],_0x2abf18['query']);_0x5a871[_0xdf27('0x32')]=_[_0xdf27('0x33')](_0x2abf18[_0xdf27('0x31')],qs[_0xdf27('0x34')](_0x561cc3[_0xdf27('0x2f')][_0xdf27('0x34')]));_0x5a871[_0xdf27('0x32')]=_0x5a871['attributes'][_0xdf27('0x35')]?_0x5a871[_0xdf27('0x32')]:_0x2abf18[_0xdf27('0x31')];if(!_0x561cc3[_0xdf27('0x2f')][_0xdf27('0x36')](_0xdf27('0x37'))){_0x5a871[_0xdf27('0x1c')]=qs[_0xdf27('0x1c')](_0x561cc3[_0xdf27('0x2f')][_0xdf27('0x1c')]);_0x5a871[_0xdf27('0x1e')]=qs[_0xdf27('0x1e')](_0x561cc3[_0xdf27('0x2f')]['offset']);}_0x5a871['order']=qs['sort'](_0x561cc3[_0xdf27('0x2f')][_0xdf27('0x38')]);_0x5a871[_0xdf27('0x39')]=qs[_0xdf27('0x3a')](_[_0xdf27('0x3b')](_0x561cc3[_0xdf27('0x2f')],_0x2abf18[_0xdf27('0x3a')]),_0xb0a8c0);if(_0x561cc3[_0xdf27('0x2f')][_0xdf27('0x3c')]){_0x5a871[_0xdf27('0x39')]=_[_0xdf27('0x3d')](_0x5a871[_0xdf27('0x39')],{'$or':_[_0xdf27('0x2e')](_0xb0a8c0,function(_0xaf84d0){if(_0xaf84d0['type']!==_0xdf27('0x3e')){var _0x174d59={};_0x174d59[_0xaf84d0[_0xdf27('0x26')]]={'$like':'%'+_0x561cc3[_0xdf27('0x2f')]['filter']+'%'};return _0x174d59;}})});}_0x5a871=_[_0xdf27('0x3d')]({},_0x5a871,_0x561cc3[_0xdf27('0x3f')]);var _0x481c42={'where':_0x5a871[_0xdf27('0x39')]};return db[_0xdf27('0x29')][_0xdf27('0x1d')](_0x481c42)[_0xdf27('0x23')](function(_0x5d50d2){_0x1e04c2[_0xdf27('0x1d')]=_0x5d50d2;if(_0x561cc3['query'][_0xdf27('0x40')]){_0x5a871[_0xdf27('0x41')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x5a871);})[_0xdf27('0x23')](function(_0x3374a6){_0x1e04c2[_0xdf27('0x42')]=_0x3374a6;return _0x1e04c2;})['then'](respondWithFilteredResult(_0x193788,_0x5a871))['catch'](handleError(_0x193788,null));};exports[_0xdf27('0x43')]=function(_0x19699f,_0x2f3a34){var _0x28b4f3={'raw':!![],'where':{'id':_0x19699f[_0xdf27('0x44')]['id']}},_0x12dcae={};_0x12dcae[_0xdf27('0x31')]=_[_0xdf27('0x30')](db[_0xdf27('0x29')][_0xdf27('0x2a')]);_0x12dcae['query']=_[_0xdf27('0x30')](_0x19699f[_0xdf27('0x2f')]);_0x12dcae['filters']=_['intersection'](_0x12dcae[_0xdf27('0x31')],_0x12dcae[_0xdf27('0x2f')]);_0x28b4f3[_0xdf27('0x32')]=_[_0xdf27('0x33')](_0x12dcae['model'],qs['fields'](_0x19699f[_0xdf27('0x2f')][_0xdf27('0x34')]));_0x28b4f3[_0xdf27('0x32')]=_0x28b4f3[_0xdf27('0x32')][_0xdf27('0x35')]?_0x28b4f3[_0xdf27('0x32')]:_0x12dcae[_0xdf27('0x31')];if(_0x19699f[_0xdf27('0x2f')][_0xdf27('0x40')]){_0x28b4f3[_0xdf27('0x41')]=[{'all':!![]}];}_0x28b4f3=_[_0xdf27('0x3d')]({},_0x28b4f3,_0x19699f[_0xdf27('0x3f')]);return db[_0xdf27('0x29')][_0xdf27('0x45')](_0x28b4f3)['then'](handleEntityNotFound(_0x2f3a34,null))[_0xdf27('0x23')](respondWithResult(_0x2f3a34,null))[_0xdf27('0x46')](handleError(_0x2f3a34,null));};exports[_0xdf27('0x22')]=function(_0x28ee8b,_0x424afd){if(_0x28ee8b[_0xdf27('0x47')]['id']){delete _0x28ee8b['body']['id'];}return db[_0xdf27('0x29')]['find']({'where':{'id':_0x28ee8b[_0xdf27('0x44')]['id']}})[_0xdf27('0x23')](handleEntityNotFound(_0x424afd,null))['then'](saveUpdates(_0x28ee8b[_0xdf27('0x47')],null))['then'](respondWithResult(_0x424afd,null))[_0xdf27('0x46')](handleError(_0x424afd,null));};exports['destroy']=function(_0x418573,_0x15c29e){return db[_0xdf27('0x29')]['find']({'where':{'id':_0x418573[_0xdf27('0x44')]['id']}})[_0xdf27('0x23')](handleEntityNotFound(_0x15c29e,null))[_0xdf27('0x23')](removeEntity(_0x15c29e,null))[_0xdf27('0x46')](handleError(_0x15c29e,null));};exports[_0xdf27('0x48')]=function(_0x3e1c7c,_0x2ff281){return db['CmHopperBlack'][_0xdf27('0x48')]()['then'](respondWithResult(_0x2ff281,null))['catch'](handleError(_0x2ff281,null));};
\ No newline at end of file
index ba33a91..83884d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x971c=['CmHopperBlack','cm_hopper_black','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports'];(function(_0x42c4f7,_0x318ed6){var _0x361b80=function(_0x213ce7){while(--_0x213ce7){_0x42c4f7['push'](_0x42c4f7['shift']());}};_0x361b80(++_0x318ed6);}(_0x971c,0xd2));var _0xc971=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x971c[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xc971('0x0'));var util=require(_0xc971('0x1'));var logger=require('../../config/logger')(_0xc971('0x2'));var moment=require(_0xc971('0x3'));var BPromise=require(_0xc971('0x4'));var rp=require(_0xc971('0x5'));var fs=require('fs');var path=require(_0xc971('0x6'));var rimraf=require(_0xc971('0x7'));var config=require(_0xc971('0x8'));var attributes=require(_0xc971('0x9'));module[_0xc971('0xa')]=function(_0x1dba71,_0x5daee3){return _0x1dba71['define'](_0xc971('0xb'),attributes,{'tableName':_0xc971('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x95ab=['rimraf','../../config/environment','define','CmHopperBlack','cm_hopper_black','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2da7d2,_0x3430d3){var _0xdb6b79=function(_0x59db04){while(--_0x59db04){_0x2da7d2['push'](_0x2da7d2['shift']());}};_0xdb6b79(++_0x3430d3);}(_0x95ab,0x191));var _0xb95a=function(_0x1f658f,_0x3e2e8e){_0x1f658f=_0x1f658f-0x0;var _0x4bc762=_0x95ab[_0x1f658f];return _0x4bc762;};'use strict';var _=require(_0xb95a('0x0'));var util=require('util');var logger=require(_0xb95a('0x1'))(_0xb95a('0x2'));var moment=require(_0xb95a('0x3'));var BPromise=require(_0xb95a('0x4'));var rp=require(_0xb95a('0x5'));var fs=require('fs');var path=require(_0xb95a('0x6'));var rimraf=require(_0xb95a('0x7'));var config=require(_0xb95a('0x8'));var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x2c733d,_0x3bcd0a){return _0x2c733d[_0xb95a('0x9')](_0xb95a('0xa'),attributes,{'tableName':_0xb95a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 10dbbc9..caa48e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3804=['CmHopperBlack,\x20%s,\x20%s','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','include','model','attributes','map','UpdateCmHopperBlack','body','DestroyCmHopperBlack','destroy','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x357bdd,_0xae8757){var _0xbeb6b=function(_0x5372f2){while(--_0x5372f2){_0x357bdd['push'](_0x357bdd['shift']());}};_0xbeb6b(++_0xae8757);}(_0x3804,0xcb));var _0x4380=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3804[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4380('0x0'));var util=require(_0x4380('0x1'));var moment=require('moment');var BPromise=require(_0x4380('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4380('0x3'));var db=require(_0x4380('0x4'))['db'];var utils=require(_0x4380('0x5'));var logger=require('../../config/logger')(_0x4380('0x6'));var config=require(_0x4380('0x7'));var jayson=require(_0x4380('0x8'));var client=jayson[_0x4380('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e1a43,_0x1acd20,_0x2be4ef){return new BPromise(function(_0x2b6cdb,_0x528453){return client[_0x4380('0xa')](_0x4e1a43,_0x2be4ef)[_0x4380('0xb')](function(_0x3581fe){logger[_0x4380('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x1acd20,_0x4380('0xd'));logger[_0x4380('0xe')](_0x4380('0xf'),_0x1acd20,_0x4380('0xd'),JSON[_0x4380('0x10')](_0x3581fe));if(_0x3581fe[_0x4380('0x11')]){if(_0x3581fe[_0x4380('0x11')][_0x4380('0x12')]===0x1f4){logger['error'](_0x4380('0x13'),_0x1acd20,_0x3581fe[_0x4380('0x11')][_0x4380('0x14')]);return _0x528453(_0x3581fe[_0x4380('0x11')][_0x4380('0x14')]);}logger[_0x4380('0x11')](_0x4380('0x13'),_0x1acd20,_0x3581fe[_0x4380('0x11')][_0x4380('0x14')]);return _0x2b6cdb(_0x3581fe[_0x4380('0x11')]['message']);}else{logger[_0x4380('0xc')](_0x4380('0x13'),_0x1acd20,_0x4380('0xd'));_0x2b6cdb(_0x3581fe['result'][_0x4380('0x14')]);}})[_0x4380('0x15')](function(_0x36b624){logger[_0x4380('0x11')](_0x4380('0x13'),_0x1acd20,_0x36b624);_0x528453(_0x36b624);});});}exports[_0x4380('0x16')]=function(_0x6456e3){var _0x8081a6=this;return new Promise(function(_0x4f37dd,_0x3dde35){return db[_0x4380('0x17')][_0x4380('0x18')]({'raw':_0x6456e3[_0x4380('0x19')]?_0x6456e3['options'][_0x4380('0x1a')]===undefined?!![]:![]:!![],'where':_0x6456e3[_0x4380('0x19')]?_0x6456e3[_0x4380('0x19')][_0x4380('0x1b')]||null:null,'attributes':_0x6456e3[_0x4380('0x19')]?_0x6456e3[_0x4380('0x19')]['attributes']||null:null,'limit':_0x6456e3[_0x4380('0x19')]?_0x6456e3[_0x4380('0x19')][_0x4380('0x1c')]||null:null,'include':_0x6456e3[_0x4380('0x19')]?_0x6456e3[_0x4380('0x19')][_0x4380('0x1d')]?_['map'](_0x6456e3[_0x4380('0x19')][_0x4380('0x1d')],function(_0x59a153){return{'model':db[_0x59a153[_0x4380('0x1e')]],'as':_0x59a153['as'],'attributes':_0x59a153[_0x4380('0x1f')],'include':_0x59a153[_0x4380('0x1d')]?_[_0x4380('0x20')](_0x59a153[_0x4380('0x1d')],function(_0x272896){return{'model':db[_0x272896[_0x4380('0x1e')]],'as':_0x272896['as'],'attributes':_0x272896[_0x4380('0x1f')],'include':_0x272896[_0x4380('0x1d')]?_[_0x4380('0x20')](_0x272896[_0x4380('0x1d')],function(_0x20d983){return{'model':db[_0x20d983['model']],'as':_0x20d983['as'],'attributes':_0x20d983[_0x4380('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd52a1d){logger[_0x4380('0xc')](_0x4380('0x16'),_0x6456e3);logger[_0x4380('0xe')]('GetCmHopperBlack',_0x6456e3,JSON['stringify'](_0xd52a1d));_0x4f37dd(_0xd52a1d);})['catch'](function(_0x23ec8a){logger[_0x4380('0x11')](_0x4380('0x16'),_0x23ec8a[_0x4380('0x14')],_0x6456e3);_0x3dde35(_0x8081a6[_0x4380('0x11')](0x1f4,_0x23ec8a[_0x4380('0x14')]));});});};exports[_0x4380('0x21')]=function(_0x52cb8c){var _0x1715a4=this;return new Promise(function(_0x4ca236,_0x334ca6){return db[_0x4380('0x17')]['update'](_0x52cb8c[_0x4380('0x22')],{'raw':_0x52cb8c[_0x4380('0x19')]?_0x52cb8c[_0x4380('0x19')][_0x4380('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52cb8c[_0x4380('0x19')]?_0x52cb8c[_0x4380('0x19')]['where']||null:null,'attributes':_0x52cb8c[_0x4380('0x19')]?_0x52cb8c[_0x4380('0x19')][_0x4380('0x1f')]||null:null,'limit':_0x52cb8c[_0x4380('0x19')]?_0x52cb8c[_0x4380('0x19')][_0x4380('0x1c')]||null:null})[_0x4380('0xb')](function(_0x9c95ca){logger['info'](_0x4380('0x21'),_0x52cb8c);logger['debug'](_0x4380('0x21'),_0x52cb8c,JSON[_0x4380('0x10')](_0x9c95ca));_0x4ca236(_0x9c95ca);})[_0x4380('0x15')](function(_0x5c7eef){logger['error'](_0x4380('0x21'),_0x5c7eef[_0x4380('0x14')],_0x52cb8c);_0x334ca6(_0x1715a4['error'](0x1f4,_0x5c7eef[_0x4380('0x14')]));});});};exports[_0x4380('0x23')]=function(_0x2de4d9){var _0x3ae5d4=this;return new Promise(function(_0x229965,_0x55a5ff){return db[_0x4380('0x17')][_0x4380('0x24')]({'where':_0x2de4d9[_0x4380('0x19')]?_0x2de4d9[_0x4380('0x19')]['where']||null:null})['then'](function(_0xa91f16){logger['info'](_0x4380('0x23'),_0x2de4d9);logger['debug']('DestroyCmHopperBlack',_0x2de4d9,JSON[_0x4380('0x10')](_0xa91f16));_0x229965(_0xa91f16);})['catch'](function(_0x5ccf7a){logger[_0x4380('0x11')](_0x4380('0x23'),_0x5ccf7a['message'],_0x2de4d9);_0x55a5ff(_0x3ae5d4[_0x4380('0x11')](0x1f4,_0x5ccf7a[_0x4380('0x14')]));});});};
\ No newline at end of file
+var _0x1d40=['CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','findAll','options','raw','where','attributes','limit','include','map','model','GetCmHopperBlack','catch','CmHopperBlack','update','then','UpdateCmHopperBlack','destroy','DestroyCmHopperBlack','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','CmHopperBlack,\x20%s,\x20%s','debug'];(function(_0x15c35a,_0xb76671){var _0x4a73f1=function(_0x4cccf1){while(--_0x4cccf1){_0x15c35a['push'](_0x15c35a['shift']());}};_0x4a73f1(++_0xb76671);}(_0x1d40,0xa9));var _0x01d4=function(_0x46baa3,_0x286bc8){_0x46baa3=_0x46baa3-0x0;var _0x44731a=_0x1d40[_0x46baa3];return _0x44731a;};'use strict';var _=require('lodash');var util=require(_0x01d4('0x0'));var moment=require(_0x01d4('0x1'));var BPromise=require('bluebird');var rs=require(_0x01d4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01d4('0x3'))['db'];var utils=require(_0x01d4('0x4'));var logger=require(_0x01d4('0x5'))(_0x01d4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x01d4('0x7')][_0x01d4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xddbcb3,_0x63ef87,_0x358731){return new BPromise(function(_0x5cd9fc,_0x4956c8){return client['request'](_0xddbcb3,_0x358731)['then'](function(_0x889710){logger['info'](_0x01d4('0x9'),_0x63ef87,'request\x20sent');logger[_0x01d4('0xa')](_0x01d4('0xb'),_0x63ef87,_0x01d4('0xc'),JSON[_0x01d4('0xd')](_0x889710));if(_0x889710[_0x01d4('0xe')]){if(_0x889710['error'][_0x01d4('0xf')]===0x1f4){logger[_0x01d4('0xe')](_0x01d4('0x9'),_0x63ef87,_0x889710[_0x01d4('0xe')][_0x01d4('0x10')]);return _0x4956c8(_0x889710['error'][_0x01d4('0x10')]);}logger[_0x01d4('0xe')](_0x01d4('0x9'),_0x63ef87,_0x889710[_0x01d4('0xe')]['message']);return _0x5cd9fc(_0x889710[_0x01d4('0xe')][_0x01d4('0x10')]);}else{logger[_0x01d4('0x11')](_0x01d4('0x9'),_0x63ef87,_0x01d4('0xc'));_0x5cd9fc(_0x889710[_0x01d4('0x12')][_0x01d4('0x10')]);}})['catch'](function(_0x4d61ff){logger[_0x01d4('0xe')](_0x01d4('0x9'),_0x63ef87,_0x4d61ff);_0x4956c8(_0x4d61ff);});});}exports['GetCmHopperBlack']=function(_0x43f520){var _0x501ee7=this;return new Promise(function(_0x55d793,_0x367447){return db['CmHopperBlack'][_0x01d4('0x13')]({'raw':_0x43f520[_0x01d4('0x14')]?_0x43f520['options'][_0x01d4('0x15')]===undefined?!![]:![]:!![],'where':_0x43f520[_0x01d4('0x14')]?_0x43f520[_0x01d4('0x14')][_0x01d4('0x16')]||null:null,'attributes':_0x43f520[_0x01d4('0x14')]?_0x43f520[_0x01d4('0x14')][_0x01d4('0x17')]||null:null,'limit':_0x43f520[_0x01d4('0x14')]?_0x43f520[_0x01d4('0x14')][_0x01d4('0x18')]||null:null,'include':_0x43f520[_0x01d4('0x14')]?_0x43f520[_0x01d4('0x14')][_0x01d4('0x19')]?_[_0x01d4('0x1a')](_0x43f520['options'][_0x01d4('0x19')],function(_0x3b978c){return{'model':db[_0x3b978c[_0x01d4('0x1b')]],'as':_0x3b978c['as'],'attributes':_0x3b978c['attributes'],'include':_0x3b978c['include']?_[_0x01d4('0x1a')](_0x3b978c[_0x01d4('0x19')],function(_0x14c804){return{'model':db[_0x14c804[_0x01d4('0x1b')]],'as':_0x14c804['as'],'attributes':_0x14c804[_0x01d4('0x17')],'include':_0x14c804['include']?_[_0x01d4('0x1a')](_0x14c804[_0x01d4('0x19')],function(_0x5ba989){return{'model':db[_0x5ba989[_0x01d4('0x1b')]],'as':_0x5ba989['as'],'attributes':_0x5ba989[_0x01d4('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x518a45){logger[_0x01d4('0x11')](_0x01d4('0x1c'),_0x43f520);logger[_0x01d4('0xa')]('GetCmHopperBlack',_0x43f520,JSON['stringify'](_0x518a45));_0x55d793(_0x518a45);})[_0x01d4('0x1d')](function(_0x3e8a2e){logger[_0x01d4('0xe')](_0x01d4('0x1c'),_0x3e8a2e[_0x01d4('0x10')],_0x43f520);_0x367447(_0x501ee7['error'](0x1f4,_0x3e8a2e['message']));});});};exports['UpdateCmHopperBlack']=function(_0xaed317){var _0x529b63=this;return new Promise(function(_0x12cbdf,_0x3a236d){return db[_0x01d4('0x1e')][_0x01d4('0x1f')](_0xaed317['body'],{'raw':_0xaed317[_0x01d4('0x14')]?_0xaed317[_0x01d4('0x14')][_0x01d4('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xaed317['options']?_0xaed317[_0x01d4('0x14')][_0x01d4('0x16')]||null:null,'attributes':_0xaed317[_0x01d4('0x14')]?_0xaed317[_0x01d4('0x14')][_0x01d4('0x17')]||null:null,'limit':_0xaed317[_0x01d4('0x14')]?_0xaed317['options'][_0x01d4('0x18')]||null:null})[_0x01d4('0x20')](function(_0x3448b4){logger['info'](_0x01d4('0x21'),_0xaed317);logger[_0x01d4('0xa')](_0x01d4('0x21'),_0xaed317,JSON['stringify'](_0x3448b4));_0x12cbdf(_0x3448b4);})['catch'](function(_0x27dd70){logger[_0x01d4('0xe')]('UpdateCmHopperBlack',_0x27dd70['message'],_0xaed317);_0x3a236d(_0x529b63[_0x01d4('0xe')](0x1f4,_0x27dd70['message']));});});};exports['DestroyCmHopperBlack']=function(_0xef2a10){var _0x688e2d=this;return new Promise(function(_0x2a8ee8,_0x4dc0c1){return db[_0x01d4('0x1e')][_0x01d4('0x22')]({'where':_0xef2a10[_0x01d4('0x14')]?_0xef2a10[_0x01d4('0x14')][_0x01d4('0x16')]||null:null})[_0x01d4('0x20')](function(_0xab2e71){logger[_0x01d4('0x11')](_0x01d4('0x23'),_0xef2a10);logger[_0x01d4('0xa')]('DestroyCmHopperBlack',_0xef2a10,JSON[_0x01d4('0xd')](_0xab2e71));_0x2a8ee8(_0xab2e71);})[_0x01d4('0x1d')](function(_0x338a1b){logger[_0x01d4('0xe')](_0x01d4('0x23'),_0x338a1b['message'],_0xef2a10);_0x4dc0c1(_0x688e2d[_0x01d4('0xe')](0x1f4,_0x338a1b[_0x01d4('0x10')]));});});};
\ No newline at end of file
index 586ed73..7632c1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7046=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','show','put','/:id','update','delete'];(function(_0xb0672e,_0x4002ef){var _0x1a2c74=function(_0x2d82c4){while(--_0x2d82c4){_0xb0672e['push'](_0xb0672e['shift']());}};_0x1a2c74(++_0x4002ef);}(_0x7046,0x144));var _0x6704=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7046[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var path=require(_0x6704('0x2'));var timeout=require(_0x6704('0x3'));var express=require('express');var router=express[_0x6704('0x4')]();var fs_extra=require(_0x6704('0x5'));var auth=require(_0x6704('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6704('0x7'));var controller=require(_0x6704('0x8'));router[_0x6704('0x9')]('/',auth[_0x6704('0xa')](),controller[_0x6704('0xb')]);router['get'](_0x6704('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x6704('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6704('0xd')]);router[_0x6704('0xe')](_0x6704('0xf'),auth[_0x6704('0xa')](),controller[_0x6704('0x10')]);router[_0x6704('0x11')](_0x6704('0xf'),auth[_0x6704('0xa')](),controller['destroy']);module[_0x6704('0x12')]=router;
\ No newline at end of file
+var _0x5162=['/:id','show','update','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','/describe','isAuthenticated','describe'];(function(_0x44784f,_0x4a3e84){var _0x223c9c=function(_0xd69e57){while(--_0xd69e57){_0x44784f['push'](_0x44784f['shift']());}};_0x223c9c(++_0x4a3e84);}(_0x5162,0x103));var _0x2516=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x5162[_0x5a776b];return _0xbbef59;};'use strict';var multer=require(_0x2516('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2516('0x1')]();var fs_extra=require(_0x2516('0x2'));var auth=require(_0x2516('0x3'));var interaction=require(_0x2516('0x4'));var config=require(_0x2516('0x5'));var controller=require(_0x2516('0x6'));router[_0x2516('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2516('0x8'),auth[_0x2516('0x9')](),controller[_0x2516('0xa')]);router[_0x2516('0x7')](_0x2516('0xb'),auth[_0x2516('0x9')](),controller[_0x2516('0xc')]);router['put'](_0x2516('0xb'),auth[_0x2516('0x9')](),controller[_0x2516('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2516('0xe')]=router;
\ No newline at end of file
index 26cebbf..8d2f322 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd85c=['diff','seconds','BOOLEAN','sequelize','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime'];(function(_0x20c8ae,_0x1985e1){var _0x2fae2e=function(_0x115011){while(--_0x115011){_0x20c8ae['push'](_0x20c8ae['shift']());}};_0x2fae2e(++_0x1985e1);}(_0xd85c,0xcf));var _0xcd85=function(_0xf0a03f,_0x2c57b9){_0xf0a03f=_0xf0a03f-0x0;var _0x2d18a4=_0xd85c[_0xf0a03f];return _0x2d18a4;};'use strict';var Sequelize=require(_0xcd85('0x0'));var moment=require('moment');module[_0xcd85('0x1')]={'state':{'type':Sequelize[_0xcd85('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xcd85('0x3')]},'scheduledat':{'type':Sequelize[_0xcd85('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xcd85('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xcd85('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xcd85('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xcd85('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xcd85('0x3')]},'originatecalleridname':{'type':Sequelize[_0xcd85('0x3')]},'calleridnum':{'type':Sequelize[_0xcd85('0x3')]},'calleridname':{'type':Sequelize[_0xcd85('0x3')]},'starttime':{'type':Sequelize[_0xcd85('0x4')]},'responsetime':{'type':Sequelize[_0xcd85('0x4')]},'answertime':{'type':Sequelize[_0xcd85('0x4')]},'droptime':{'type':Sequelize[_0xcd85('0x4')]},'endtime':{'type':Sequelize[_0xcd85('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xcd85('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xcd85('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xcd85('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xcd85('0x3')]},'membername':{'type':Sequelize[_0xcd85('0x3')]},'reason':{'type':Sequelize[_0xcd85('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xcd85('0x3')]},'thirdDisposition':{'type':Sequelize[_0xcd85('0x3')]},'dispositionat':{'type':Sequelize[_0xcd85('0x4')],'set':function(_0x12fc54){var _0x217f2e=this[_0xcd85('0x5')](_0xcd85('0x6'));if(_0x217f2e&&_0x12fc54){this[_0xcd85('0x7')](_0xcd85('0x8'),moment(_0x12fc54)[_0xcd85('0x9')](moment(_0x217f2e),_0xcd85('0xa')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xcd85('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xcd85('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xcd85('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xcd85('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xcd85('0x4')]},'deleted':{'type':Sequelize[_0xcd85('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xcd85('0x4')]},'recallme':{'type':Sequelize[_0xcd85('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xcd85('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xcd85('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xcd85('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xcd85('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xcd85('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xcd85('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4bcb=['STRING','DATE','getDataValue','endtime','setDataValue','followuptime','seconds','BOOLEAN','moment','exports','INTEGER'];(function(_0x3e4584,_0x2a7d4c){var _0x6ed905=function(_0x5f06f9){while(--_0x5f06f9){_0x3e4584['push'](_0x3e4584['shift']());}};_0x6ed905(++_0x2a7d4c);}(_0x4bcb,0x76));var _0xb4bc=function(_0x5c4585,_0x3d0eab){_0x5c4585=_0x5c4585-0x0;var _0x21dede=_0x4bcb[_0x5c4585];return _0x21dede;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb4bc('0x0'));module[_0xb4bc('0x1')]={'state':{'type':Sequelize[_0xb4bc('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xb4bc('0x3')]},'scheduledat':{'type':Sequelize[_0xb4bc('0x4')]},'countbusyretry':{'type':Sequelize[_0xb4bc('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb4bc('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xb4bc('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb4bc('0x3')]},'starttime':{'type':Sequelize[_0xb4bc('0x4')]},'responsetime':{'type':Sequelize[_0xb4bc('0x4')]},'answertime':{'type':Sequelize[_0xb4bc('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xb4bc('0x4')]},'ringtime':{'type':Sequelize[_0xb4bc('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb4bc('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb4bc('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb4bc('0x3')]},'campaign':{'type':Sequelize[_0xb4bc('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xb4bc('0x4')],'set':function(_0x5ee164){var _0x34dcf8=this[_0xb4bc('0x5')](_0xb4bc('0x6'));if(_0x34dcf8&&_0x5ee164){this[_0xb4bc('0x7')](_0xb4bc('0x8'),moment(_0x5ee164)['diff'](moment(_0x34dcf8),_0xb4bc('0x9')));}}},'amd':{'type':Sequelize[_0xb4bc('0xa')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb4bc('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb4bc('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xb4bc('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb4bc('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb4bc('0x4')]},'deleted':{'type':Sequelize[_0xb4bc('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb4bc('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb4bc('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb4bc('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb4bc('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 65a7c5b..299c1a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb016=['error','name','send','index','map','CmHopperFinal','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','body','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','moveContactsIvrCampaignHopperFinal','Campaign','into','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','calleridnum','state\x20=\x204','group','checkContactHopper','CmHopper','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end'];(function(_0x36e7f1,_0x361821){var _0x2f8ecb=function(_0x2a768d){while(--_0x2a768d){_0x36e7f1['push'](_0x36e7f1['shift']());}};_0x2f8ecb(++_0x361821);}(_0xb016,0x159));var _0x6b01=function(_0x5868ec,_0x231103){_0x5868ec=_0x5868ec-0x0;var _0x25e23f=_0xb016[_0x5868ec];return _0x25e23f;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':!![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['describe']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['describe']()['then'](respondWithResult(_0x27442e,null))['catch'](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x12160f,_0x518d94){if(_0x12160f[_0x6b01('0x43')]['uniqueid']){delete _0x12160f['body']['uniqueid'];}return db[_0x6b01('0x29')][_0x6b01('0x44')]({'where':{'uniqueid':_0x12160f['params']['id']}})['then'](handleEntityNotFound(_0x518d94,null))[_0x6b01('0x21')](saveUpdates(_0x12160f['body'],null))[_0x6b01('0x21')](respondWithResult(_0x518d94,null))[_0x6b01('0x40')](handleError(_0x518d94,null));};exports[_0x6b01('0x45')]=function(_0x172a56,_0x13f6d7,_0x4d327f){return db[_0x6b01('0x29')][_0x6b01('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x172a56[_0x6b01('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db['sequelize'][_0x6b01('0x48')](_0x6b01('0x49')))),_0x6b01('0x4a')],[db[_0x6b01('0x47')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6b01('0x47')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x6b01('0x4b')],[db[_0x6b01('0x47')]['fn']('COUNT',db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')]['literal'](_0x6b01('0x4c')))),_0x6b01('0x4d')],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db['sequelize'][_0x6b01('0x48')]('`state`\x20=\x208,\x201,\x20null'))),_0x6b01('0x4e')],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db['sequelize']['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x4f')))),_0x6b01('0x50')],[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x6b01('0x51')],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db['sequelize']['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x52')))),'reCallContacts'],[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db['sequelize'][_0x6b01('0x48')](_0x6b01('0x53')))),_0x6b01('0x54')]]})[_0x6b01('0x21')](handleEntityNotFound(_0x13f6d7,null))[_0x6b01('0x21')](respondWithResult(_0x13f6d7,null))[_0x6b01('0x40')](handleError(_0x13f6d7,null));};exports[_0x6b01('0x55')]=function(_0x425d28,_0x132dda,_0x4c1345){return db[_0x6b01('0x29')][_0x6b01('0x3f')]({'raw':![],'where':{'CampaignId':_0x425d28[_0x6b01('0x41')]['id']},'attributes':[[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x49')))),'noSuchContacts'],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x56')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x4c')))),_0x6b01('0x4d')],[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x57')))),_0x6b01('0x4e')],[db[_0x6b01('0x47')]['fn']('COUNT',db[_0x6b01('0x47')]['fn']('IF',db['sequelize'][_0x6b01('0x48')](_0x6b01('0x4f')))),_0x6b01('0x50')],[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x58')))),_0x6b01('0x51')],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x52')))),_0x6b01('0x59')],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x53')))),'answeringMachine']]})[_0x6b01('0x21')](handleEntityNotFound(_0x132dda,null))[_0x6b01('0x21')](respondWithResult(_0x132dda,null))[_0x6b01('0x40')](handleError(_0x132dda,null));};exports[_0x6b01('0x5a')]=function(_0x1c419c,_0x250889,_0x40931a){return db[_0x6b01('0x5b')][_0x6b01('0x44')]({'where':{'id':_0x1c419c[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x250889,null))[_0x6b01('0x21')](function(_0x468a0b){var _0x30171f;if(_0x468a0b){_0x30171f=squel[_0x6b01('0x5c')]()['into'](_0x6b01('0x5d'))[_0x6b01('0x5e')]([_0x6b01('0x5f'),_0x6b01('0x60'),_0x6b01('0x61'),_0x6b01('0x62'),_0x6b01('0x63'),_0x6b01('0x64'),_0x6b01('0x65')],squel[_0x6b01('0x66')]()[_0x6b01('0x67')](_0x6b01('0x68'),_0x6b01('0x5f'))[_0x6b01('0x67')](_0x6b01('0x69'),_0x6b01('0x60'))[_0x6b01('0x67')](_0x6b01('0x6a'),_0x6b01('0x61'))[_0x6b01('0x67')]('ANY_VALUE(ListId)','ListId')['field']('ANY_VALUE(VoiceQueueId)',_0x6b01('0x63'))['field']('NOW()','createdAt')[_0x6b01('0x67')]('NOW()',_0x6b01('0x65'))[_0x6b01('0x6b')](_0x6b01('0x6c'))[_0x6b01('0x37')](_0x6b01('0x6d'),_0x1c419c['params']['id']['toString']())[_0x6b01('0x37')](_0x6b01('0x6e'),_0x1c419c[_0x6b01('0x43')]['state'][_0x6b01('0x6f')]())[_0x6b01('0x37')](_0x6b01('0x70'))[_0x6b01('0x37')](_0x6b01('0x71'),squel['select']()[_0x6b01('0x67')]('phone')[_0x6b01('0x6b')](_0x6b01('0x5d'))[_0x6b01('0x37')](_0x6b01('0x6d'),_0x1c419c[_0x6b01('0x41')]['id']['toString']()))[_0x6b01('0x37')](_0x6b01('0x71'),squel[_0x6b01('0x66')]()[_0x6b01('0x67')]('calleridnum')[_0x6b01('0x6b')](_0x6b01('0x6c'))[_0x6b01('0x37')](_0x6b01('0x6d'),_0x1c419c[_0x6b01('0x41')]['id'][_0x6b01('0x6f')]())['where']('state\x20=\x204'))['group'](_0x6b01('0x61')))[_0x6b01('0x6f')]();return db['sequelize'][_0x6b01('0x2c')](_0x30171f);}return[];})[_0x6b01('0x21')](respondWithResult(_0x250889,null))[_0x6b01('0x40')](handleError(_0x250889,null));};exports[_0x6b01('0x72')]=function(_0x536748,_0x18066a,_0x4ccc00){return db[_0x6b01('0x73')]['find']({'where':{'id':_0x536748[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x18066a,null))[_0x6b01('0x21')](function(_0x3bc182){var _0x410303;if(_0x3bc182){_0x410303=squel[_0x6b01('0x5c')]()[_0x6b01('0x74')](_0x6b01('0x5d'))[_0x6b01('0x5e')](['phone',_0x6b01('0x60'),'ContactId',_0x6b01('0x62'),_0x6b01('0x75'),_0x6b01('0x64'),_0x6b01('0x65')],squel[_0x6b01('0x66')]()[_0x6b01('0x67')](_0x6b01('0x68'),_0x6b01('0x5f'))[_0x6b01('0x67')](_0x6b01('0x69'),_0x6b01('0x60'))['field'](_0x6b01('0x6a'),_0x6b01('0x61'))[_0x6b01('0x67')](_0x6b01('0x76'),'ListId')[_0x6b01('0x67')](_0x6b01('0x77'),_0x6b01('0x75'))[_0x6b01('0x67')](_0x6b01('0x69'),'createdAt')[_0x6b01('0x67')]('NOW()',_0x6b01('0x65'))[_0x6b01('0x6b')](_0x6b01('0x6c'))[_0x6b01('0x37')](_0x6b01('0x78'),_0x536748[_0x6b01('0x41')]['id'][_0x6b01('0x6f')]())[_0x6b01('0x37')](_0x6b01('0x6e'),_0x536748[_0x6b01('0x43')][_0x6b01('0x79')][_0x6b01('0x6f')]())[_0x6b01('0x37')](_0x6b01('0x70'))['where'](_0x6b01('0x71'),squel['select']()['field'](_0x6b01('0x5f'))[_0x6b01('0x6b')](_0x6b01('0x5d'))[_0x6b01('0x37')]('CampaignId\x20=\x20?',_0x536748[_0x6b01('0x41')]['id'][_0x6b01('0x6f')]()))[_0x6b01('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x6b01('0x66')]()[_0x6b01('0x67')](_0x6b01('0x7a'))[_0x6b01('0x6b')](_0x6b01('0x6c'))[_0x6b01('0x37')](_0x6b01('0x78'),_0x536748[_0x6b01('0x41')]['id']['toString']())[_0x6b01('0x37')](_0x6b01('0x7b')))[_0x6b01('0x7c')](_0x6b01('0x61')))['toString']();return db['sequelize'][_0x6b01('0x2c')](_0x410303);}return[];})[_0x6b01('0x21')](respondWithResult(_0x18066a,null))[_0x6b01('0x40')](handleError(_0x18066a,null));};exports[_0x6b01('0x7d')]=function(_0x6a33d7,_0x214f54,_0x1343af){return db[_0x6b01('0x7e')]['findOne']({'where':{'VoiceQueueId':_0x6a33d7[_0x6b01('0x43')][_0x6b01('0x63')],'CampaignId':_0x6a33d7[_0x6b01('0x43')][_0x6b01('0x75')],'ContactId':_0x6a33d7[_0x6b01('0x43')][_0x6b01('0x61')]}})[_0x6b01('0x21')](handleEntityNotFound(_0x214f54,null))['then'](function(_0x5140ba){if(_0x5140ba){return _0x5140ba;}return null;})['then'](respondWithResult(_0x214f54,null))[_0x6b01('0x40')](handleError(_0x214f54,null));};
\ No newline at end of file
+var _0xc2c7=['`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','group','moveContactsIvrCampaignHopperFinal','Campaign','ANY_VALUE(calleridnum)','CampaignId','CampaignId\x20=\x20?','calleridnum','state\x20=\x204','checkContactHopper','CmHopper','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','uniqueid','params','body','countContactsQueueCampaignHopperFinal','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','countContactsIvrCampaignHopperFinal'];(function(_0x101d76,_0x9ea274){var _0x153a3f=function(_0xb8cebd){while(--_0xb8cebd){_0x101d76['push'](_0x101d76['shift']());}};_0x153a3f(++_0x9ea274);}(_0xc2c7,0x134));var _0x7c2c=function(_0x320ea7,_0x1b0922){_0x320ea7=_0x320ea7-0x0;var _0x4f9742=_0xc2c7[_0x320ea7];return _0x4f9742;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':!![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['CmHopperFinal'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['describe']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['describe']()['then'](respondWithResult(_0x3091bd,null))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x39d5af,_0x2b79d5){if(_0x39d5af['body']['uniqueid']){delete _0x39d5af['body'][_0x7c2c('0x48')];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'uniqueid':_0x39d5af[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x2b79d5,null))['then'](saveUpdates(_0x39d5af[_0x7c2c('0x4a')],null))[_0x7c2c('0x26')](respondWithResult(_0x2b79d5,null))['catch'](handleError(_0x2b79d5,null));};exports[_0x7c2c('0x4b')]=function(_0x56e09d,_0xfba6a7,_0x3806f4){return db[_0x7c2c('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x56e09d['params']['id']},'attributes':[[db[_0x7c2c('0x4c')]['fn']('COUNT',db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x4d')))),_0x7c2c('0x4e')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x51')))),_0x7c2c('0x52')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')]('`state`\x20=\x205,\x201,\x20null'))),_0x7c2c('0x53')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x54')))),'congestionContacts'],[db[_0x7c2c('0x4c')]['fn']('COUNT',db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x55')))),_0x7c2c('0x56')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x7c2c('0x57')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x58')))),_0x7c2c('0x59')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x7c2c('0x26')](handleEntityNotFound(_0xfba6a7,null))[_0x7c2c('0x26')](respondWithResult(_0xfba6a7,null))[_0x7c2c('0x45')](handleError(_0xfba6a7,null));};exports[_0x7c2c('0x5a')]=function(_0x44602a,_0x1ad537,_0x2d04da){return db[_0x7c2c('0x2c')]['findAll']({'raw':![],'where':{'CampaignId':_0x44602a['params']['id']},'attributes':[[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x7c2c('0x4e')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x51')))),_0x7c2c('0x52')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x5b')))),'busyContacts'],[db[_0x7c2c('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x7c2c('0x54')))),_0x7c2c('0x5c')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x55')))),_0x7c2c('0x56')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x5d')))),_0x7c2c('0x57')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x58')))),'reCallContacts'],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x5e')))),_0x7c2c('0x5f')]]})['then'](handleEntityNotFound(_0x1ad537,null))[_0x7c2c('0x26')](respondWithResult(_0x1ad537,null))['catch'](handleError(_0x1ad537,null));};exports[_0x7c2c('0x60')]=function(_0x2b597d,_0x20eb63,_0x56f737){return db[_0x7c2c('0x61')][_0x7c2c('0x47')]({'where':{'id':_0x2b597d[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x20eb63,null))['then'](function(_0x158352){var _0x1e711e;if(_0x158352){_0x1e711e=squel[_0x7c2c('0x62')]()[_0x7c2c('0x63')](_0x7c2c('0x64'))[_0x7c2c('0x65')]([_0x7c2c('0x66'),_0x7c2c('0x67'),_0x7c2c('0x68'),'ListId',_0x7c2c('0x69'),_0x7c2c('0x6a'),'updatedAt'],squel[_0x7c2c('0x6b')]()['field']('ANY_VALUE(calleridnum)',_0x7c2c('0x66'))[_0x7c2c('0x6c')](_0x7c2c('0x6d'),'scheduledAt')[_0x7c2c('0x6c')](_0x7c2c('0x6e'),_0x7c2c('0x68'))['field'](_0x7c2c('0x6f'),_0x7c2c('0x70'))[_0x7c2c('0x6c')](_0x7c2c('0x71'),'VoiceQueueId')[_0x7c2c('0x6c')]('NOW()',_0x7c2c('0x6a'))['field'](_0x7c2c('0x6d'),_0x7c2c('0x72'))[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id']['toString']())[_0x7c2c('0x3d')](_0x7c2c('0x76'),_0x2b597d[_0x7c2c('0x4a')][_0x7c2c('0x77')][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x79'))[_0x7c2c('0x3d')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7c2c('0x6b')]()[_0x7c2c('0x6c')](_0x7c2c('0x66'))[_0x7c2c('0x73')](_0x7c2c('0x64'))['where'](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id']['toString']()))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel['select']()[_0x7c2c('0x6c')]('calleridnum')[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')]('state\x20=\x204'))[_0x7c2c('0x7b')](_0x7c2c('0x68')))['toString']();return db[_0x7c2c('0x4c')][_0x7c2c('0x32')](_0x1e711e);}return[];})[_0x7c2c('0x26')](respondWithResult(_0x20eb63,null))[_0x7c2c('0x45')](handleError(_0x20eb63,null));};exports[_0x7c2c('0x7c')]=function(_0x2f249d,_0x136226,_0x354236){return db[_0x7c2c('0x7d')][_0x7c2c('0x47')]({'where':{'id':_0x2f249d[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x136226,null))[_0x7c2c('0x26')](function(_0xb47bf0){var _0x4d0922;if(_0xb47bf0){_0x4d0922=squel[_0x7c2c('0x62')]()[_0x7c2c('0x63')]('cm_hopper')[_0x7c2c('0x65')]([_0x7c2c('0x66'),_0x7c2c('0x67'),_0x7c2c('0x68'),_0x7c2c('0x70'),'CampaignId',_0x7c2c('0x6a'),_0x7c2c('0x72')],squel[_0x7c2c('0x6b')]()['field'](_0x7c2c('0x7e'),_0x7c2c('0x66'))[_0x7c2c('0x6c')]('NOW()',_0x7c2c('0x67'))['field'](_0x7c2c('0x6e'),'ContactId')['field'](_0x7c2c('0x6f'),_0x7c2c('0x70'))[_0x7c2c('0x6c')]('ANY_VALUE(CampaignId)',_0x7c2c('0x7f'))[_0x7c2c('0x6c')](_0x7c2c('0x6d'),_0x7c2c('0x6a'))['field'](_0x7c2c('0x6d'),'updatedAt')['from']('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x2f249d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x76'),_0x2f249d[_0x7c2c('0x4a')]['state'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x79'))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel[_0x7c2c('0x6b')]()['field']('phone')[_0x7c2c('0x73')](_0x7c2c('0x64'))[_0x7c2c('0x3d')](_0x7c2c('0x80'),_0x2f249d['params']['id'][_0x7c2c('0x78')]()))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel[_0x7c2c('0x6b')]()[_0x7c2c('0x6c')](_0x7c2c('0x81'))[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')]('CampaignId\x20=\x20?',_0x2f249d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())['where'](_0x7c2c('0x82')))['group'](_0x7c2c('0x68')))['toString']();return db[_0x7c2c('0x4c')][_0x7c2c('0x32')](_0x4d0922);}return[];})[_0x7c2c('0x26')](respondWithResult(_0x136226,null))[_0x7c2c('0x45')](handleError(_0x136226,null));};exports[_0x7c2c('0x83')]=function(_0x309051,_0x3f8683,_0x1eeb00){return db[_0x7c2c('0x84')]['findOne']({'where':{'VoiceQueueId':_0x309051[_0x7c2c('0x4a')][_0x7c2c('0x69')],'CampaignId':_0x309051[_0x7c2c('0x4a')]['CampaignId'],'ContactId':_0x309051[_0x7c2c('0x4a')][_0x7c2c('0x68')]}})['then'](handleEntityNotFound(_0x3f8683,null))[_0x7c2c('0x26')](function(_0x511158){if(_0x511158){return _0x511158;}return null;})[_0x7c2c('0x26')](respondWithResult(_0x3f8683,null))['catch'](handleError(_0x3f8683,null));};
\ No newline at end of file
index f934ddd..97dd656 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2132=['util','api','moment','bluebird','request-promise','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x2258cf,_0x205979){var _0x19a978=function(_0x407227){while(--_0x407227){_0x2258cf['push'](_0x2258cf['shift']());}};_0x19a978(++_0x205979);}(_0x2132,0x192));var _0x2213=function(_0x2c1a9f,_0x3c6138){_0x2c1a9f=_0x2c1a9f-0x0;var _0x479dc2=_0x2132[_0x2c1a9f];return _0x479dc2;};'use strict';var _=require(_0x2213('0x0'));var util=require(_0x2213('0x1'));var logger=require('../../config/logger')(_0x2213('0x2'));var moment=require(_0x2213('0x3'));var BPromise=require(_0x2213('0x4'));var rp=require(_0x2213('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2213('0x6'));var attributes=require(_0x2213('0x7'));module['exports']=function(_0x147e1e,_0x2c96cb){return _0x147e1e[_0x2213('0x8')](_0x2213('0x9'),attributes,{'tableName':_0x2213('0xa'),'paranoid':![],'indexes':[{'name':_0x2213('0xb'),'fields':[_0x2213('0xb')]},{'name':_0x2213('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4535=['api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','calleridnum','uniqueid','util'];(function(_0x2e123e,_0x516e51){var _0xe9a8e=function(_0x391a70){while(--_0x391a70){_0x2e123e['push'](_0x2e123e['shift']());}};_0xe9a8e(++_0x516e51);}(_0x4535,0x11d));var _0x5453=function(_0x4aa530,_0x315f89){_0x4aa530=_0x4aa530-0x0;var _0x25bc60=_0x4535[_0x4aa530];return _0x25bc60;};'use strict';var _=require('lodash');var util=require(_0x5453('0x0'));var logger=require('../../config/logger')(_0x5453('0x1'));var moment=require(_0x5453('0x2'));var BPromise=require(_0x5453('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5453('0x4'));var rimraf=require(_0x5453('0x5'));var config=require(_0x5453('0x6'));var attributes=require(_0x5453('0x7'));module[_0x5453('0x8')]=function(_0x1c69ab,_0x2d98d3){return _0x1c69ab[_0x5453('0x9')](_0x5453('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x5453('0xb'),'fields':['calleridnum']},{'name':_0x5453('0xc'),'fields':[_0x5453('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 04d44f6..9acd5d2 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(_0x1d5038,_0x1f3f53){var _0x1c9b73=function(_0x1e3dc5){while(--_0x1e3dc5){_0x1d5038['push'](_0x1d5038['shift']());}};_0x1c9b73(++_0x1f3f53);}(_0x7a54,0x106));var _0x47a5=function(_0x1de87a,_0x389c74){_0x1de87a=_0x1de87a-0x0;var _0x21b23d=_0x7a54[_0x1de87a];return _0x21b23d;};'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(_0x35513b,_0x18446b){var _0x344fb5=function(_0x4c97ab){while(--_0x4c97ab){_0x35513b['push'](_0x35513b['shift']());}};_0x344fb5(++_0x18446b);}(_0xb10b,0x12a));var _0xbb10=function(_0x40b0f,_0x3783e5){_0x40b0f=_0x40b0f-0x0;var _0x39a923=_0xb10b[_0x40b0f];return _0x39a923;};'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 6e9c007..1f36a64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf364=['checkContactHopper','put','update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/checkContactHopper'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0xf364,0x170));var _0x4f36=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xf364[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x4f36('0x0'));var util=require('util');var path=require(_0x4f36('0x1'));var timeout=require(_0x4f36('0x2'));var express=require('express');var router=express[_0x4f36('0x3')]();var fs_extra=require(_0x4f36('0x4'));var auth=require(_0x4f36('0x5'));var interaction=require(_0x4f36('0x6'));var config=require(_0x4f36('0x7'));var controller=require('./cmHopperFinal.controller');router[_0x4f36('0x8')]('/',auth[_0x4f36('0x9')](),controller[_0x4f36('0xa')]);router[_0x4f36('0x8')](_0x4f36('0xb'),auth[_0x4f36('0x9')](),controller[_0x4f36('0xc')]);router['get'](_0x4f36('0xd'),auth['isAuthenticated'](),controller[_0x4f36('0xe')]);router[_0x4f36('0x8')](_0x4f36('0xf'),auth[_0x4f36('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x4f36('0x8')](_0x4f36('0x10'),auth[_0x4f36('0x9')](),controller[_0x4f36('0x11')]);router[_0x4f36('0x12')](_0x4f36('0x13'),auth[_0x4f36('0x9')](),controller[_0x4f36('0x14')]);router[_0x4f36('0x12')]('/voice/campaign/moveContacts/:id',auth[_0x4f36('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x4f36('0x12')](_0x4f36('0x15'),auth[_0x4f36('0x9')](),controller[_0x4f36('0x16')]);router[_0x4f36('0x17')](_0x4f36('0xd'),auth[_0x4f36('0x9')](),controller[_0x4f36('0x18')]);module[_0x4f36('0x19')]=router;
\ No newline at end of file
+var _0x49a2=['moveContactsIvrCampaignHopperFinal','update','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id'];(function(_0x20c9ce,_0x4e78a4){var _0x15b5f0=function(_0x11e320){while(--_0x11e320){_0x20c9ce['push'](_0x20c9ce['shift']());}};_0x15b5f0(++_0x4e78a4);}(_0x49a2,0x76));var _0x249a=function(_0x2665a3,_0x3bac99){_0x2665a3=_0x2665a3-0x0;var _0x586de6=_0x49a2[_0x2665a3];return _0x586de6;};'use strict';var multer=require(_0x249a('0x0'));var util=require('util');var path=require(_0x249a('0x1'));var timeout=require(_0x249a('0x2'));var express=require('express');var router=express[_0x249a('0x3')]();var fs_extra=require(_0x249a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x249a('0x5'));var controller=require(_0x249a('0x6'));router[_0x249a('0x7')]('/',auth[_0x249a('0x8')](),controller[_0x249a('0x9')]);router[_0x249a('0x7')](_0x249a('0xa'),auth[_0x249a('0x8')](),controller[_0x249a('0xb')]);router[_0x249a('0x7')](_0x249a('0xc'),auth[_0x249a('0x8')](),controller[_0x249a('0xd')]);router[_0x249a('0x7')](_0x249a('0xe'),auth[_0x249a('0x8')](),controller[_0x249a('0xf')]);router[_0x249a('0x7')](_0x249a('0x10'),auth[_0x249a('0x8')](),controller['countContactsIvrCampaignHopperFinal']);router['post']('/voice/queue/moveContacts/:id',auth[_0x249a('0x8')](),controller[_0x249a('0x11')]);router[_0x249a('0x12')](_0x249a('0x13'),auth['isAuthenticated'](),controller[_0x249a('0x14')]);router['post']('/checkContactHopper',auth['isAuthenticated'](),controller['checkContactHopper']);router['put'](_0x249a('0xc'),auth['isAuthenticated'](),controller[_0x249a('0x15')]);module[_0x249a('0x16')]=router;
\ No newline at end of file
index 13ce656..5c8bb26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x242e=['STRING','DATE','BOOLEAN','sequelize','INTEGER'];(function(_0x1c1225,_0x363c59){var _0x524247=function(_0x3179ae){while(--_0x3179ae){_0x1c1225['push'](_0x1c1225['shift']());}};_0x524247(++_0x363c59);}(_0x242e,0x12f));var _0xe242=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x242e[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xe242('0x0'));module['exports']={'state':{'type':Sequelize[_0xe242('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xe242('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe242('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe242('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe242('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe242('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xe242('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe242('0x2')]},'starttime':{'type':Sequelize[_0xe242('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe242('0x3')]},'droptime':{'type':Sequelize[_0xe242('0x3')]},'endtime':{'type':Sequelize[_0xe242('0x3')]},'ringtime':{'type':Sequelize[_0xe242('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe242('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe242('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe242('0x2')]},'campaign':{'type':Sequelize[_0xe242('0x2')]},'campaigntype':{'type':Sequelize[_0xe242('0x2')]},'membername':{'type':Sequelize[_0xe242('0x2')]},'reason':{'type':Sequelize[_0xe242('0x2')]},'amd':{'type':Sequelize[_0xe242('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xe242('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe242('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe242('0x3')]},'recallme':{'type':Sequelize[_0xe242('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xe242('0x3')]},'edited':{'type':Sequelize[_0xe242('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe242('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe242('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe242('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe242('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x67b1=['STRING','DATE','BOOLEAN','exports','INTEGER'];(function(_0x2cea07,_0x26cb26){var _0x2748f4=function(_0x58fda5){while(--_0x58fda5){_0x2cea07['push'](_0x2cea07['shift']());}};_0x2748f4(++_0x26cb26);}(_0x67b1,0xfd));var _0x167b=function(_0x4a8418,_0x39078a){_0x4a8418=_0x4a8418-0x0;var _0x390174=_0x67b1[_0x4a8418];return _0x390174;};'use strict';var Sequelize=require('sequelize');module[_0x167b('0x0')]={'state':{'type':Sequelize[_0x167b('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x167b('0x2')]},'scheduledat':{'type':Sequelize[_0x167b('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x167b('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x167b('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x167b('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x167b('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x167b('0x2')]},'originatecalleridname':{'type':Sequelize[_0x167b('0x2')]},'calleridnum':{'type':Sequelize[_0x167b('0x2')]},'calleridname':{'type':Sequelize[_0x167b('0x2')]},'starttime':{'type':Sequelize[_0x167b('0x3')]},'responsetime':{'type':Sequelize[_0x167b('0x3')]},'answertime':{'type':Sequelize[_0x167b('0x3')]},'droptime':{'type':Sequelize[_0x167b('0x3')]},'endtime':{'type':Sequelize[_0x167b('0x3')]},'ringtime':{'type':Sequelize[_0x167b('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x167b('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x167b('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x167b('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x167b('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x167b('0x2')]},'membername':{'type':Sequelize[_0x167b('0x2')]},'reason':{'type':Sequelize[_0x167b('0x2')]},'amd':{'type':Sequelize[_0x167b('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x167b('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x167b('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x167b('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x167b('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x167b('0x3')]},'edited':{'type':Sequelize[_0x167b('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x167b('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x167b('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x167b('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x167b('0x2')]}};
\ No newline at end of file
index 54a6e1c..920c734 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e91=['fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','show','params','include','find','create','body','catch','describe','uniqueid','eml-format','zip-dir'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x6e91,0x184));var _0x16e9=function(_0x56007e,_0x14b813){_0x56007e=_0x56007e-0x0;var _0x192962=_0x6e91[_0x56007e];return _0x192962;};'use strict';var emlformat=require(_0x16e9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x16e9('0x1'));var jsonpatch=require(_0x16e9('0x2'));var rp=require(_0x16e9('0x3'));var moment=require('moment');var BPromise=require(_0x16e9('0x4'));var Mustache=require('mustache');var util=require(_0x16e9('0x5'));var path=require(_0x16e9('0x6'));var sox=require(_0x16e9('0x7'));var csv=require(_0x16e9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x16e9('0x9'));var _=require(_0x16e9('0xa'));var squel=require(_0x16e9('0xb'));var crypto=require(_0x16e9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x16e9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x16e9('0xe'));var Papa=require(_0x16e9('0xf'));var Redis=require(_0x16e9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x16e9('0x11'));var as=require(_0x16e9('0x12'));var hardwareService=require(_0x16e9('0x13'));var logger=require(_0x16e9('0x14'))(_0x16e9('0x15'));var utils=require(_0x16e9('0x16'));var config=require(_0x16e9('0x17'));var licenseUtil=require(_0x16e9('0x18'));var db=require(_0x16e9('0x19'))['db'];function respondWithStatusCode(_0x24682d,_0x32328a){_0x32328a=_0x32328a||0xcc;return function(_0x4f09b4){if(_0x4f09b4){return _0x24682d[_0x16e9('0x1a')](_0x32328a);}return _0x24682d['status'](_0x32328a)[_0x16e9('0x1b')]();};}function respondWithResult(_0x230b40,_0x3970ff){_0x3970ff=_0x3970ff||0xc8;return function(_0x42a862){if(_0x42a862){return _0x230b40[_0x16e9('0x1c')](_0x3970ff)[_0x16e9('0x1d')](_0x42a862);}};}function respondWithFilteredResult(_0x3d4a32,_0x49b2c8){return function(_0x20400e){if(_0x20400e){var _0x3eef83=typeof _0x49b2c8['offset']===_0x16e9('0x1e')&&typeof _0x49b2c8['limit']===_0x16e9('0x1e');var _0x2d7d99=_0x20400e[_0x16e9('0x1f')];var _0x2d33da=_0x3eef83?0x0:_0x49b2c8[_0x16e9('0x20')];var _0x5bcb8a=_0x3eef83?_0x20400e[_0x16e9('0x1f')]:_0x49b2c8[_0x16e9('0x20')]+_0x49b2c8[_0x16e9('0x21')];var _0xf0b438;if(_0x5bcb8a>=_0x2d7d99){_0x5bcb8a=_0x2d7d99;_0xf0b438=0xc8;}else{_0xf0b438=0xce;}_0x3d4a32[_0x16e9('0x1c')](_0xf0b438);return _0x3d4a32[_0x16e9('0x22')](_0x16e9('0x23'),_0x2d33da+'-'+_0x5bcb8a+'/'+_0x2d7d99)[_0x16e9('0x1d')](_0x20400e);}return null;};}function patchUpdates(_0x500e77){return function(_0x2dd736){try{jsonpatch[_0x16e9('0x24')](_0x2dd736,_0x500e77,!![]);}catch(_0x1d7775){return BPromise['reject'](_0x1d7775);}return _0x2dd736[_0x16e9('0x25')]();};}function saveUpdates(_0x2509cd,_0x7a0ce1){return function(_0x54a6e5){if(_0x54a6e5){return _0x54a6e5[_0x16e9('0x26')](_0x2509cd)[_0x16e9('0x27')](function(_0x51e707){return _0x51e707;});}return null;};}function removeEntity(_0x22311d,_0xc4f2fb){return function(_0x55d35e){if(_0x55d35e){return _0x55d35e[_0x16e9('0x28')]()[_0x16e9('0x27')](function(){_0x22311d[_0x16e9('0x1c')](0xcc)[_0x16e9('0x1b')]();});}};}function handleEntityNotFound(_0x5fba02,_0x1d9d99){return function(_0xf29ad5){if(!_0xf29ad5){_0x5fba02['sendStatus'](0x194);}return _0xf29ad5;};}function handleError(_0x2ae5c1,_0xa8127c){_0xa8127c=_0xa8127c||0x1f4;return function(_0x8a3196){logger[_0x16e9('0x29')](_0x8a3196['stack']);if(_0x8a3196[_0x16e9('0x2a')]){delete _0x8a3196[_0x16e9('0x2a')];}_0x2ae5c1['status'](_0xa8127c)[_0x16e9('0x2b')](_0x8a3196);};}exports[_0x16e9('0x2c')]=function(_0x5bd79e,_0x16a2f4){var _0x479b78={},_0x242e32={},_0x21d4fe={'count':0x0,'rows':[]};var _0x13f259=_[_0x16e9('0x2d')](db[_0x16e9('0x2e')][_0x16e9('0x2f')],function(_0x21f2ae){return{'name':_0x21f2ae[_0x16e9('0x30')],'type':_0x21f2ae[_0x16e9('0x31')]['key']};});_0x242e32['model']=_[_0x16e9('0x2d')](_0x13f259,_0x16e9('0x2a'));_0x242e32['query']=_[_0x16e9('0x32')](_0x5bd79e[_0x16e9('0x33')]);_0x242e32[_0x16e9('0x34')]=_[_0x16e9('0x35')](_0x242e32[_0x16e9('0x36')],_0x242e32[_0x16e9('0x33')]);_0x479b78[_0x16e9('0x37')]=_[_0x16e9('0x35')](_0x242e32[_0x16e9('0x36')],qs[_0x16e9('0x38')](_0x5bd79e[_0x16e9('0x33')][_0x16e9('0x38')]));_0x479b78['attributes']=_0x479b78[_0x16e9('0x37')][_0x16e9('0x39')]?_0x479b78[_0x16e9('0x37')]:_0x242e32['model'];if(!_0x5bd79e['query'][_0x16e9('0x3a')](_0x16e9('0x3b'))){_0x479b78[_0x16e9('0x21')]=qs[_0x16e9('0x21')](_0x5bd79e[_0x16e9('0x33')]['limit']);_0x479b78['offset']=qs[_0x16e9('0x20')](_0x5bd79e['query'][_0x16e9('0x20')]);}_0x479b78[_0x16e9('0x3c')]=qs[_0x16e9('0x3d')](_0x5bd79e[_0x16e9('0x33')][_0x16e9('0x3d')]);_0x479b78['where']=qs[_0x16e9('0x34')](_[_0x16e9('0x3e')](_0x5bd79e[_0x16e9('0x33')],_0x242e32[_0x16e9('0x34')]),_0x13f259);if(_0x5bd79e[_0x16e9('0x33')][_0x16e9('0x3f')]){_0x479b78[_0x16e9('0x40')]=_[_0x16e9('0x41')](_0x479b78['where'],{'$or':_['map'](_0x13f259,function(_0x2f3ab5){if(_0x2f3ab5['type']!=='VIRTUAL'){var _0x3dec4a={};_0x3dec4a[_0x2f3ab5[_0x16e9('0x2a')]]={'$like':'%'+_0x5bd79e[_0x16e9('0x33')][_0x16e9('0x3f')]+'%'};return _0x3dec4a;}})});}_0x479b78=_['merge']({},_0x479b78,_0x5bd79e[_0x16e9('0x42')]);var _0x1fd34e={'where':_0x479b78['where']};return db[_0x16e9('0x2e')][_0x16e9('0x1f')](_0x1fd34e)[_0x16e9('0x27')](function(_0x779813){_0x21d4fe[_0x16e9('0x1f')]=_0x779813;if(_0x5bd79e[_0x16e9('0x33')][_0x16e9('0x43')]){_0x479b78['include']=[{'all':!![]}];}return db[_0x16e9('0x2e')][_0x16e9('0x44')](_0x479b78);})[_0x16e9('0x27')](function(_0x302fbf){_0x21d4fe['rows']=_0x302fbf;return _0x21d4fe;})[_0x16e9('0x27')](respondWithFilteredResult(_0x16a2f4,_0x479b78))['catch'](handleError(_0x16a2f4,null));};exports[_0x16e9('0x45')]=function(_0x47b522,_0x593336){var _0x35d45a={'raw':!![],'where':{'id':_0x47b522[_0x16e9('0x46')]['id']}},_0x25352d={};_0x25352d['model']=_[_0x16e9('0x32')](db[_0x16e9('0x2e')][_0x16e9('0x2f')]);_0x25352d[_0x16e9('0x33')]=_[_0x16e9('0x32')](_0x47b522[_0x16e9('0x33')]);_0x25352d['filters']=_[_0x16e9('0x35')](_0x25352d[_0x16e9('0x36')],_0x25352d[_0x16e9('0x33')]);_0x35d45a[_0x16e9('0x37')]=_[_0x16e9('0x35')](_0x25352d[_0x16e9('0x36')],qs[_0x16e9('0x38')](_0x47b522[_0x16e9('0x33')]['fields']));_0x35d45a[_0x16e9('0x37')]=_0x35d45a[_0x16e9('0x37')][_0x16e9('0x39')]?_0x35d45a[_0x16e9('0x37')]:_0x25352d[_0x16e9('0x36')];if(_0x47b522['query'][_0x16e9('0x43')]){_0x35d45a[_0x16e9('0x47')]=[{'all':!![]}];}_0x35d45a=_[_0x16e9('0x41')]({},_0x35d45a,_0x47b522['options']);return db[_0x16e9('0x2e')][_0x16e9('0x48')](_0x35d45a)[_0x16e9('0x27')](handleEntityNotFound(_0x593336,null))[_0x16e9('0x27')](respondWithResult(_0x593336,null))['catch'](handleError(_0x593336,null));};exports[_0x16e9('0x49')]=function(_0x2821a8,_0x253990){return db[_0x16e9('0x2e')][_0x16e9('0x49')](_0x2821a8[_0x16e9('0x4a')],{})['then'](respondWithResult(_0x253990,0xc9))[_0x16e9('0x4b')](handleError(_0x253990,null));};exports[_0x16e9('0x4c')]=function(_0x400920,_0x3fb4c5){return db['CmHopperHistory'][_0x16e9('0x4c')]()[_0x16e9('0x27')](respondWithResult(_0x3fb4c5,null))[_0x16e9('0x4b')](handleError(_0x3fb4c5,null));};exports[_0x16e9('0x26')]=function(_0x4cc402,_0x2d6280){if(_0x4cc402[_0x16e9('0x4a')][_0x16e9('0x4d')]){delete _0x4cc402[_0x16e9('0x4a')][_0x16e9('0x4d')];}return db[_0x16e9('0x2e')][_0x16e9('0x48')]({'where':{'uniqueid':_0x4cc402['params']['id']}})['then'](handleEntityNotFound(_0x2d6280,null))['then'](saveUpdates(_0x4cc402[_0x16e9('0x4a')],null))[_0x16e9('0x27')](respondWithResult(_0x2d6280,null))[_0x16e9('0x4b')](handleError(_0x2d6280,null));};
\ No newline at end of file
+var _0x6085=['error','stack','name','send','index','rawAttributes','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','CmHopperHistory','includeAll','include','findAll','rows','catch','show','params','create','body','describe','uniqueid','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','update','destroy','then','end'];(function(_0x316b3e,_0x47b154){var _0x45ba95=function(_0x5e68c4){while(--_0x5e68c4){_0x316b3e['push'](_0x316b3e['shift']());}};_0x45ba95(++_0x47b154);}(_0x6085,0x157));var _0x5608=function(_0x18e735,_0x42a098){_0x18e735=_0x18e735-0x0;var _0x41c291=_0x6085[_0x18e735];return _0x41c291;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5608('0x0'));var zipdir=require(_0x5608('0x1'));var jsonpatch=require(_0x5608('0x2'));var rp=require(_0x5608('0x3'));var moment=require(_0x5608('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5608('0x5'));var util=require(_0x5608('0x6'));var path=require('path');var sox=require(_0x5608('0x7'));var csv=require(_0x5608('0x8'));var ejs=require(_0x5608('0x9'));var fs=require('fs');var fs_extra=require(_0x5608('0xa'));var _=require(_0x5608('0xb'));var squel=require(_0x5608('0xc'));var crypto=require(_0x5608('0xd'));var jsforce=require(_0x5608('0xe'));var deskjs=require(_0x5608('0xf'));var toCsv=require(_0x5608('0x8'));var querystring=require('querystring');var Papa=require(_0x5608('0x10'));var Redis=require('ioredis');var authService=require(_0x5608('0x11'));var qs=require(_0x5608('0x12'));var as=require(_0x5608('0x13'));var hardwareService=require(_0x5608('0x14'));var logger=require('../../config/logger')(_0x5608('0x15'));var utils=require(_0x5608('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bd336,_0x350c1c){_0x350c1c=_0x350c1c||0xcc;return function(_0x219aef){if(_0x219aef){return _0x2bd336[_0x5608('0x17')](_0x350c1c);}return _0x2bd336[_0x5608('0x18')](_0x350c1c)['end']();};}function respondWithResult(_0x39483b,_0x193689){_0x193689=_0x193689||0xc8;return function(_0x205bf5){if(_0x205bf5){return _0x39483b[_0x5608('0x18')](_0x193689)[_0x5608('0x19')](_0x205bf5);}};}function respondWithFilteredResult(_0x359aac,_0x5a72f7){return function(_0x2e0efd){if(_0x2e0efd){var _0x3d91ea=typeof _0x5a72f7[_0x5608('0x1a')]===_0x5608('0x1b')&&typeof _0x5a72f7['limit']===_0x5608('0x1b');var _0x1e4395=_0x2e0efd[_0x5608('0x1c')];var _0x59d17e=_0x3d91ea?0x0:_0x5a72f7[_0x5608('0x1a')];var _0x337658=_0x3d91ea?_0x2e0efd[_0x5608('0x1c')]:_0x5a72f7[_0x5608('0x1a')]+_0x5a72f7[_0x5608('0x1d')];var _0x464e05;if(_0x337658>=_0x1e4395){_0x337658=_0x1e4395;_0x464e05=0xc8;}else{_0x464e05=0xce;}_0x359aac[_0x5608('0x18')](_0x464e05);return _0x359aac[_0x5608('0x1e')]('Content-Range',_0x59d17e+'-'+_0x337658+'/'+_0x1e4395)[_0x5608('0x19')](_0x2e0efd);}return null;};}function patchUpdates(_0x442781){return function(_0x50a331){try{jsonpatch[_0x5608('0x1f')](_0x50a331,_0x442781,!![]);}catch(_0x13ca60){return BPromise[_0x5608('0x20')](_0x13ca60);}return _0x50a331['save']();};}function saveUpdates(_0x4185e5,_0x58cbd1){return function(_0xd599bb){if(_0xd599bb){return _0xd599bb[_0x5608('0x21')](_0x4185e5)['then'](function(_0x59e970){return _0x59e970;});}return null;};}function removeEntity(_0x131102,_0x2223c6){return function(_0x5ceaaa){if(_0x5ceaaa){return _0x5ceaaa[_0x5608('0x22')]()[_0x5608('0x23')](function(){_0x131102[_0x5608('0x18')](0xcc)[_0x5608('0x24')]();});}};}function handleEntityNotFound(_0x1dff46,_0x13c674){return function(_0x2bfd68){if(!_0x2bfd68){_0x1dff46['sendStatus'](0x194);}return _0x2bfd68;};}function handleError(_0x56c437,_0x174110){_0x174110=_0x174110||0x1f4;return function(_0x33957e){logger[_0x5608('0x25')](_0x33957e[_0x5608('0x26')]);if(_0x33957e[_0x5608('0x27')]){delete _0x33957e[_0x5608('0x27')];}_0x56c437[_0x5608('0x18')](_0x174110)[_0x5608('0x28')](_0x33957e);};}exports[_0x5608('0x29')]=function(_0x14e2bb,_0x3da0a5){var _0x278b74={},_0x19b992={},_0x22183b={'count':0x0,'rows':[]};var _0x37a7d4=_['map'](db['CmHopperHistory'][_0x5608('0x2a')],function(_0x55d410){return{'name':_0x55d410['fieldName'],'type':_0x55d410['type'][_0x5608('0x2b')]};});_0x19b992['model']=_[_0x5608('0x2c')](_0x37a7d4,_0x5608('0x27'));_0x19b992[_0x5608('0x2d')]=_[_0x5608('0x2e')](_0x14e2bb[_0x5608('0x2d')]);_0x19b992[_0x5608('0x2f')]=_[_0x5608('0x30')](_0x19b992[_0x5608('0x31')],_0x19b992[_0x5608('0x2d')]);_0x278b74[_0x5608('0x32')]=_['intersection'](_0x19b992[_0x5608('0x31')],qs[_0x5608('0x33')](_0x14e2bb['query']['fields']));_0x278b74[_0x5608('0x32')]=_0x278b74['attributes'][_0x5608('0x34')]?_0x278b74[_0x5608('0x32')]:_0x19b992[_0x5608('0x31')];if(!_0x14e2bb[_0x5608('0x2d')][_0x5608('0x35')](_0x5608('0x36'))){_0x278b74[_0x5608('0x1d')]=qs[_0x5608('0x1d')](_0x14e2bb['query'][_0x5608('0x1d')]);_0x278b74[_0x5608('0x1a')]=qs[_0x5608('0x1a')](_0x14e2bb[_0x5608('0x2d')][_0x5608('0x1a')]);}_0x278b74['order']=qs[_0x5608('0x37')](_0x14e2bb[_0x5608('0x2d')]['sort']);_0x278b74['where']=qs[_0x5608('0x2f')](_[_0x5608('0x38')](_0x14e2bb[_0x5608('0x2d')],_0x19b992['filters']),_0x37a7d4);if(_0x14e2bb[_0x5608('0x2d')][_0x5608('0x39')]){_0x278b74['where']=_[_0x5608('0x3a')](_0x278b74[_0x5608('0x3b')],{'$or':_[_0x5608('0x2c')](_0x37a7d4,function(_0x177c57){if(_0x177c57[_0x5608('0x3c')]!==_0x5608('0x3d')){var _0x484be2={};_0x484be2[_0x177c57[_0x5608('0x27')]]={'$like':'%'+_0x14e2bb[_0x5608('0x2d')][_0x5608('0x39')]+'%'};return _0x484be2;}})});}_0x278b74=_['merge']({},_0x278b74,_0x14e2bb[_0x5608('0x3e')]);var _0x5f3b55={'where':_0x278b74['where']};return db[_0x5608('0x3f')]['count'](_0x5f3b55)['then'](function(_0x341016){_0x22183b['count']=_0x341016;if(_0x14e2bb[_0x5608('0x2d')][_0x5608('0x40')]){_0x278b74[_0x5608('0x41')]=[{'all':!![]}];}return db[_0x5608('0x3f')][_0x5608('0x42')](_0x278b74);})[_0x5608('0x23')](function(_0x17c4ab){_0x22183b[_0x5608('0x43')]=_0x17c4ab;return _0x22183b;})[_0x5608('0x23')](respondWithFilteredResult(_0x3da0a5,_0x278b74))[_0x5608('0x44')](handleError(_0x3da0a5,null));};exports[_0x5608('0x45')]=function(_0x508eb1,_0x18ebd7){var _0x3f2841={'raw':!![],'where':{'id':_0x508eb1[_0x5608('0x46')]['id']}},_0x1cf0f0={};_0x1cf0f0['model']=_[_0x5608('0x2e')](db[_0x5608('0x3f')][_0x5608('0x2a')]);_0x1cf0f0[_0x5608('0x2d')]=_[_0x5608('0x2e')](_0x508eb1[_0x5608('0x2d')]);_0x1cf0f0['filters']=_[_0x5608('0x30')](_0x1cf0f0['model'],_0x1cf0f0['query']);_0x3f2841[_0x5608('0x32')]=_[_0x5608('0x30')](_0x1cf0f0['model'],qs[_0x5608('0x33')](_0x508eb1[_0x5608('0x2d')][_0x5608('0x33')]));_0x3f2841[_0x5608('0x32')]=_0x3f2841[_0x5608('0x32')][_0x5608('0x34')]?_0x3f2841['attributes']:_0x1cf0f0['model'];if(_0x508eb1[_0x5608('0x2d')][_0x5608('0x40')]){_0x3f2841[_0x5608('0x41')]=[{'all':!![]}];}_0x3f2841=_['merge']({},_0x3f2841,_0x508eb1[_0x5608('0x3e')]);return db[_0x5608('0x3f')]['find'](_0x3f2841)[_0x5608('0x23')](handleEntityNotFound(_0x18ebd7,null))[_0x5608('0x23')](respondWithResult(_0x18ebd7,null))['catch'](handleError(_0x18ebd7,null));};exports[_0x5608('0x47')]=function(_0x462039,_0x2037b0){return db['CmHopperHistory'][_0x5608('0x47')](_0x462039[_0x5608('0x48')],{})[_0x5608('0x23')](respondWithResult(_0x2037b0,0xc9))[_0x5608('0x44')](handleError(_0x2037b0,null));};exports[_0x5608('0x49')]=function(_0x8e67be,_0x533058){return db['CmHopperHistory'][_0x5608('0x49')]()[_0x5608('0x23')](respondWithResult(_0x533058,null))['catch'](handleError(_0x533058,null));};exports[_0x5608('0x21')]=function(_0x2a31da,_0x51f996){if(_0x2a31da[_0x5608('0x48')][_0x5608('0x4a')]){delete _0x2a31da[_0x5608('0x48')]['uniqueid'];}return db[_0x5608('0x3f')][_0x5608('0x4b')]({'where':{'uniqueid':_0x2a31da[_0x5608('0x46')]['id']}})[_0x5608('0x23')](handleEntityNotFound(_0x51f996,null))[_0x5608('0x23')](saveUpdates(_0x2a31da['body'],null))[_0x5608('0x23')](respondWithResult(_0x51f996,null))['catch'](handleError(_0x51f996,null));};
\ No newline at end of file
index ceadeca..e3b2541 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6a6=['lodash','util','moment','bluebird','request-promise','path','rimraf','./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','uniqueid'];(function(_0x54645c,_0x399d74){var _0x5dc0fa=function(_0x2c76c8){while(--_0x2c76c8){_0x54645c['push'](_0x54645c['shift']());}};_0x5dc0fa(++_0x399d74);}(_0xb6a6,0x1a0));var _0x6b6a=function(_0x324cd9,_0x4cb1cf){_0x324cd9=_0x324cd9-0x0;var _0x3601d4=_0xb6a6[_0x324cd9];return _0x3601d4;};'use strict';var _=require(_0x6b6a('0x0'));var util=require(_0x6b6a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b6a('0x2'));var BPromise=require(_0x6b6a('0x3'));var rp=require(_0x6b6a('0x4'));var fs=require('fs');var path=require(_0x6b6a('0x5'));var rimraf=require(_0x6b6a('0x6'));var config=require('../../config/environment');var attributes=require(_0x6b6a('0x7'));module[_0x6b6a('0x8')]=function(_0xeb6021,_0x5f4e11){return _0xeb6021[_0x6b6a('0x9')](_0x6b6a('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x6b6a('0xb'),'fields':[_0x6b6a('0xb')]},{'name':'uniqueid','fields':[_0x6b6a('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x341c=['rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3d9efe,_0x2b5200){var _0x4fd5eb=function(_0x3aa1cf){while(--_0x3aa1cf){_0x3d9efe['push'](_0x3d9efe['shift']());}};_0x4fd5eb(++_0x2b5200);}(_0x341c,0xcc));var _0xc341=function(_0x5cdae9,_0x5e30a9){_0x5cdae9=_0x5cdae9-0x0;var _0x417701=_0x341c[_0x5cdae9];return _0x417701;};'use strict';var _=require(_0xc341('0x0'));var util=require('util');var logger=require(_0xc341('0x1'))('api');var moment=require(_0xc341('0x2'));var BPromise=require(_0xc341('0x3'));var rp=require(_0xc341('0x4'));var fs=require('fs');var path=require(_0xc341('0x5'));var rimraf=require(_0xc341('0x6'));var config=require(_0xc341('0x7'));var attributes=require(_0xc341('0x8'));module[_0xc341('0x9')]=function(_0x5226bd,_0xf9fe84){return _0x5226bd[_0xc341('0xa')](_0xc341('0xb'),attributes,{'tableName':_0xc341('0xc'),'paranoid':![],'indexes':[{'name':_0xc341('0xd'),'fields':['endtime']},{'name':_0xc341('0xe'),'fields':[_0xc341('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index b314e06..07b89d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x049e=['`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','col','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','CmHopperHistory,\x20%s,\x20%s','message','info','result','CreateCmHopperHistory','create','body','raw','stringify','findAll','options','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','catch','GetVoiceQueueHopperHistory','CmHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x049e,0x16a));var _0xe049=function(_0x5cbace,_0x33943c){_0x5cbace=_0x5cbace-0x0;var _0x6de5b8=_0x049e[_0x5cbace];return _0x6de5b8;};'use strict';var _=require(_0xe049('0x0'));var util=require(_0xe049('0x1'));var moment=require('moment');var BPromise=require(_0xe049('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe049('0x3'));var db=require(_0xe049('0x4'))['db'];var utils=require(_0xe049('0x5'));var logger=require(_0xe049('0x6'))(_0xe049('0x7'));var config=require('../../config/environment');var jayson=require(_0xe049('0x8'));var client=jayson[_0xe049('0x9')][_0xe049('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x221a5f,_0x1d4fc6,_0x17945b){return new BPromise(function(_0x22abb2,_0x515823){return client[_0xe049('0xb')](_0x221a5f,_0x17945b)[_0xe049('0xc')](function(_0x6d04ed){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x1d4fc6,_0xe049('0xd'));logger[_0xe049('0xe')](_0xe049('0xf'),_0x1d4fc6,'request\x20sent',JSON['stringify'](_0x6d04ed));if(_0x6d04ed['error']){if(_0x6d04ed[_0xe049('0x10')][_0xe049('0x11')]===0x1f4){logger[_0xe049('0x10')](_0xe049('0x12'),_0x1d4fc6,_0x6d04ed[_0xe049('0x10')][_0xe049('0x13')]);return _0x515823(_0x6d04ed[_0xe049('0x10')][_0xe049('0x13')]);}logger['error'](_0xe049('0x12'),_0x1d4fc6,_0x6d04ed[_0xe049('0x10')][_0xe049('0x13')]);return _0x22abb2(_0x6d04ed[_0xe049('0x10')]['message']);}else{logger[_0xe049('0x14')](_0xe049('0x12'),_0x1d4fc6,'request\x20sent');_0x22abb2(_0x6d04ed[_0xe049('0x15')][_0xe049('0x13')]);}})['catch'](function(_0x8b9bfe){logger[_0xe049('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x1d4fc6,_0x8b9bfe);_0x515823(_0x8b9bfe);});});}exports[_0xe049('0x16')]=function(_0x54c303){var _0x520dd9=this;return new Promise(function(_0x3cbbeb,_0x5e617b){return db['CmHopperHistory'][_0xe049('0x17')](_0x54c303[_0xe049('0x18')],{'raw':_0x54c303['options']?_0x54c303['options'][_0xe049('0x19')]===undefined?!![]:![]:!![]})[_0xe049('0xc')](function(_0x1d2f5b){logger[_0xe049('0x14')]('CreateCmHopperHistory',_0x54c303);logger['debug'](_0xe049('0x16'),_0x54c303,JSON[_0xe049('0x1a')](_0x1d2f5b));_0x3cbbeb(_0x1d2f5b);})['catch'](function(_0x36a03b){logger[_0xe049('0x10')](_0xe049('0x16'),_0x36a03b['message'],_0x54c303);_0x5e617b(_0x520dd9[_0xe049('0x10')](0x1f4,_0x36a03b[_0xe049('0x13')]));});});};exports['AvgHandleTime']=function(_0x4848c9){var _0x5663ec=this;return new Promise(function(_0x3d9900,_0x5954c0){return db['CmHopperHistory'][_0xe049('0x1b')]({'raw':_0x4848c9[_0xe049('0x1c')]?_0x4848c9['options'][_0xe049('0x19')]===undefined?!![]:![]:!![],'where':_0x4848c9[_0xe049('0x1c')]?_0x4848c9[_0xe049('0x1c')][_0xe049('0x1d')]||null:null,'attributes':[[db[_0xe049('0x1e')]['fn'](_0xe049('0x1f'),db['sequelize']['col']('id')),_0xe049('0x20')],[db['sequelize']['fn'](_0xe049('0x1f'),db['sequelize']['fn']('IF',db[_0xe049('0x1e')][_0xe049('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0xe049('0x22')],[db[_0xe049('0x1e')]['fn'](_0xe049('0x1f'),db[_0xe049('0x1e')]['fn']('IF',db[_0xe049('0x1e')][_0xe049('0x21')](_0xe049('0x23')))),_0xe049('0x24')],[db[_0xe049('0x1e')]['fn'](_0xe049('0x1f'),db[_0xe049('0x1e')]['fn']('IF',db['sequelize'][_0xe049('0x21')](_0xe049('0x25')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn']('AVG',db['sequelize']['fn']('IF',db[_0xe049('0x1e')][_0xe049('0x21')](_0xe049('0x26')))),_0xe049('0x27')],[db[_0xe049('0x1e')]['fn']('AVG',db[_0xe049('0x1e')]['fn']('IF',db[_0xe049('0x1e')][_0xe049('0x21')](_0xe049('0x28')))),_0xe049('0x29')]]})['then'](function(_0x30e6cd){logger['info'](_0xe049('0x2a'),_0x4848c9);logger['debug'](_0xe049('0x2a'),_0x4848c9,JSON[_0xe049('0x1a')](_0x30e6cd));_0x3d9900(_0x30e6cd);})[_0xe049('0x2b')](function(_0x464c1d){logger[_0xe049('0x10')](_0xe049('0x2a'),_0x464c1d[_0xe049('0x13')],_0x4848c9);_0x5954c0(_0x5663ec[_0xe049('0x10')](0x1f4,_0x464c1d[_0xe049('0x13')]));});});};exports[_0xe049('0x2c')]=function(_0x3e0d22){var _0x5275c5=this;return new Promise(function(_0x3b1c65,_0x1b21d9){return db[_0xe049('0x2d')][_0xe049('0x1b')]({'raw':_0x3e0d22[_0xe049('0x1c')]?_0x3e0d22[_0xe049('0x1c')][_0xe049('0x19')]===undefined?!![]:![]:!![],'where':_0x3e0d22[_0xe049('0x1c')]?_0x3e0d22['options'][_0xe049('0x1d')]||null:null,'attributes':[[_0xe049('0x2e'),_0xe049('0x2f')],[db[_0xe049('0x1e')]['fn'](_0xe049('0x1f'),db[_0xe049('0x1e')]['fn']('IF',db[_0xe049('0x1e')][_0xe049('0x21')](_0xe049('0x30')))),_0xe049('0x31')],[db['sequelize']['fn'](_0xe049('0x1f'),db[_0xe049('0x1e')]['fn']('IF',db[_0xe049('0x1e')]['literal'](_0xe049('0x32')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0xe049('0x1f'),db['sequelize']['fn']('IF',db[_0xe049('0x1e')][_0xe049('0x21')](_0xe049('0x33')))),_0xe049('0x34')],[db[_0xe049('0x1e')]['fn']('COUNT',db[_0xe049('0x1e')]['fn']('IF',db[_0xe049('0x1e')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0xe049('0x35')],[db[_0xe049('0x1e')]['fn'](_0xe049('0x1f'),db[_0xe049('0x1e')]['fn']('IF',db[_0xe049('0x1e')][_0xe049('0x21')]('`state`\x20=\x208,\x201,\x20null'))),_0xe049('0x36')],[db[_0xe049('0x1e')]['fn']('COUNT',db[_0xe049('0x1e')]['fn']('IF',db[_0xe049('0x1e')][_0xe049('0x21')](_0xe049('0x37')))),_0xe049('0x38')],[db['sequelize']['fn']('COUNT',db[_0xe049('0x1e')]['fn']('IF',db[_0xe049('0x1e')][_0xe049('0x21')](_0xe049('0x39')))),_0xe049('0x3a')],[db[_0xe049('0x1e')]['fn']('COUNT',db[_0xe049('0x1e')]['fn']('IF',db[_0xe049('0x1e')]['literal'](_0xe049('0x3b')))),'outboundUnknownCallsDay'],[db[_0xe049('0x1e')]['fn']('COUNT',db[_0xe049('0x1e')]['fn']('IF',db['sequelize'][_0xe049('0x21')](_0xe049('0x3c')))),_0xe049('0x3d')],[db[_0xe049('0x1e')]['fn'](_0xe049('0x1f'),db['sequelize']['fn']('IF',db[_0xe049('0x1e')][_0xe049('0x21')](_0xe049('0x3e')))),_0xe049('0x3f')],[db[_0xe049('0x1e')]['fn'](_0xe049('0x1f'),db[_0xe049('0x1e')]['fn']('IF',db[_0xe049('0x1e')][_0xe049('0x21')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xe049('0x1e')]['fn'](_0xe049('0x1f'),db[_0xe049('0x1e')]['fn']('IF',db[_0xe049('0x1e')][_0xe049('0x21')](_0xe049('0x40')))),_0xe049('0x41')],[db[_0xe049('0x1e')]['fn'](_0xe049('0x1f'),db[_0xe049('0x1e')]['fn']('IF',db[_0xe049('0x1e')]['literal'](_0xe049('0x42')))),_0xe049('0x43')],[db[_0xe049('0x1e')]['fn'](_0xe049('0x1f'),db[_0xe049('0x1e')]['fn']('IF',db[_0xe049('0x1e')][_0xe049('0x21')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':['campaign']})[_0xe049('0xc')](function(_0x2e508e){logger['info'](_0xe049('0x2c'),_0x3e0d22);logger[_0xe049('0xe')](_0xe049('0x2c'),_0x3e0d22,JSON[_0xe049('0x1a')](_0x2e508e));_0x3b1c65(_0x2e508e);})['catch'](function(_0x5b0155){logger[_0xe049('0x10')](_0xe049('0x2c'),_0x5b0155['message'],_0x3e0d22);_0x1b21d9(_0x5275c5['error'](0x1f4,_0x5b0155[_0xe049('0x13')]));});});};exports['GetCampaignHopperHistory']=function(_0x3ef1fa){var _0x2a1e06=this;return new Promise(function(_0x567c52,_0x6b2cf6){return db['CmHopperHistory'][_0xe049('0x1b')]({'raw':_0x3ef1fa[_0xe049('0x1c')]?_0x3ef1fa['options'][_0xe049('0x19')]===undefined?!![]:![]:!![],'where':_0x3ef1fa[_0xe049('0x1c')]?_0x3ef1fa[_0xe049('0x1c')][_0xe049('0x1d')]||null:null,'attributes':[[_0xe049('0x2e'),_0xe049('0x2f')],[db[_0xe049('0x1e')]['fn'](_0xe049('0x1f'),db[_0xe049('0x1e')][_0xe049('0x44')]('id')),'ivrTotalCallsDays'],[db[_0xe049('0x1e')]['fn'](_0xe049('0x1f'),db[_0xe049('0x1e')]['fn']('IF',db['sequelize'][_0xe049('0x21')](_0xe049('0x33')))),_0xe049('0x45')]],'group':[_0xe049('0x2e')]})[_0xe049('0xc')](function(_0x3609ad){logger[_0xe049('0x14')]('GetCampaignHopperHistory',_0x3ef1fa);logger[_0xe049('0xe')]('GetCampaignHopperHistory',_0x3ef1fa,JSON[_0xe049('0x1a')](_0x3609ad));_0x567c52(_0x3609ad);})['catch'](function(_0x3d7c0a){logger[_0xe049('0x10')](_0xe049('0x46'),_0x3d7c0a[_0xe049('0x13')],_0x3ef1fa);_0x6b2cf6(_0x2a1e06[_0xe049('0x10')](0x1f4,_0x3d7c0a['message']));});});};
\ No newline at end of file
+var _0xc116=['`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','AvgHandleTime','findAll','raw','where','sequelize','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','stringify','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null'];(function(_0x2a3417,_0x3b1231){var _0x2cafd0=function(_0x5814cb){while(--_0x5814cb){_0x2a3417['push'](_0x2a3417['shift']());}};_0x2cafd0(++_0x3b1231);}(_0xc116,0x164));var _0x6c11=function(_0x5a346e,_0x2b6650){_0x5a346e=_0x5a346e-0x0;var _0x572f3f=_0xc116[_0x5a346e];return _0x572f3f;};'use strict';var _=require(_0x6c11('0x0'));var util=require(_0x6c11('0x1'));var moment=require(_0x6c11('0x2'));var BPromise=require(_0x6c11('0x3'));var rs=require(_0x6c11('0x4'));var fs=require('fs');var Redis=require(_0x6c11('0x5'));var db=require(_0x6c11('0x6'))['db'];var utils=require(_0x6c11('0x7'));var logger=require('../../config/logger')(_0x6c11('0x8'));var config=require(_0x6c11('0x9'));var jayson=require(_0x6c11('0xa'));var client=jayson[_0x6c11('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a5677,_0x1ab5bc,_0x5c33c3){return new BPromise(function(_0x12b2d0,_0x4b31ec){return client['request'](_0x3a5677,_0x5c33c3)[_0x6c11('0xc')](function(_0x3de3c6){logger[_0x6c11('0xd')](_0x6c11('0xe'),_0x1ab5bc,_0x6c11('0xf'));logger[_0x6c11('0x10')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x1ab5bc,_0x6c11('0xf'),JSON['stringify'](_0x3de3c6));if(_0x3de3c6[_0x6c11('0x11')]){if(_0x3de3c6[_0x6c11('0x11')][_0x6c11('0x12')]===0x1f4){logger['error'](_0x6c11('0xe'),_0x1ab5bc,_0x3de3c6[_0x6c11('0x11')][_0x6c11('0x13')]);return _0x4b31ec(_0x3de3c6['error']['message']);}logger[_0x6c11('0x11')](_0x6c11('0xe'),_0x1ab5bc,_0x3de3c6['error'][_0x6c11('0x13')]);return _0x12b2d0(_0x3de3c6[_0x6c11('0x11')][_0x6c11('0x13')]);}else{logger[_0x6c11('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x1ab5bc,'request\x20sent');_0x12b2d0(_0x3de3c6[_0x6c11('0x14')][_0x6c11('0x13')]);}})[_0x6c11('0x15')](function(_0x4f7432){logger['error'](_0x6c11('0xe'),_0x1ab5bc,_0x4f7432);_0x4b31ec(_0x4f7432);});});}exports[_0x6c11('0x16')]=function(_0x53f629){var _0x33be46=this;return new Promise(function(_0xf9cd25,_0x2956ad){return db[_0x6c11('0x17')][_0x6c11('0x18')](_0x53f629[_0x6c11('0x19')],{'raw':_0x53f629[_0x6c11('0x1a')]?_0x53f629[_0x6c11('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x6c11('0xc')](function(_0x485ef5){logger[_0x6c11('0xd')]('CreateCmHopperHistory',_0x53f629);logger[_0x6c11('0x10')](_0x6c11('0x16'),_0x53f629,JSON['stringify'](_0x485ef5));_0xf9cd25(_0x485ef5);})[_0x6c11('0x15')](function(_0x2b61cc){logger[_0x6c11('0x11')]('CreateCmHopperHistory',_0x2b61cc[_0x6c11('0x13')],_0x53f629);_0x2956ad(_0x33be46['error'](0x1f4,_0x2b61cc[_0x6c11('0x13')]));});});};exports[_0x6c11('0x1b')]=function(_0x5066a1){var _0x4d4fb5=this;return new Promise(function(_0x123b30,_0x3ae988){return db[_0x6c11('0x17')][_0x6c11('0x1c')]({'raw':_0x5066a1[_0x6c11('0x1a')]?_0x5066a1[_0x6c11('0x1a')][_0x6c11('0x1d')]===undefined?!![]:![]:!![],'where':_0x5066a1[_0x6c11('0x1a')]?_0x5066a1[_0x6c11('0x1a')][_0x6c11('0x1e')]||null:null,'attributes':[[db[_0x6c11('0x1f')]['fn'](_0x6c11('0x20'),db['sequelize']['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x6c11('0x1f')]['fn'](_0x6c11('0x20'),db['sequelize']['fn']('IF',db[_0x6c11('0x1f')][_0x6c11('0x21')](_0x6c11('0x22')))),_0x6c11('0x23')],[db[_0x6c11('0x1f')]['fn'](_0x6c11('0x20'),db[_0x6c11('0x1f')]['fn']('IF',db[_0x6c11('0x1f')][_0x6c11('0x21')](_0x6c11('0x24')))),_0x6c11('0x25')],[db[_0x6c11('0x1f')]['fn'](_0x6c11('0x20'),db[_0x6c11('0x1f')]['fn']('IF',db[_0x6c11('0x1f')][_0x6c11('0x21')](_0x6c11('0x26')))),_0x6c11('0x27')],[db[_0x6c11('0x1f')]['fn'](_0x6c11('0x28'),db[_0x6c11('0x1f')]['fn']('IF',db[_0x6c11('0x1f')][_0x6c11('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db['sequelize']['fn'](_0x6c11('0x28'),db[_0x6c11('0x1f')]['fn']('IF',db[_0x6c11('0x1f')][_0x6c11('0x21')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})[_0x6c11('0xc')](function(_0x5931e9){logger['info'](_0x6c11('0x1b'),_0x5066a1);logger[_0x6c11('0x10')](_0x6c11('0x1b'),_0x5066a1,JSON[_0x6c11('0x29')](_0x5931e9));_0x123b30(_0x5931e9);})[_0x6c11('0x15')](function(_0x51c2c5){logger[_0x6c11('0x11')](_0x6c11('0x1b'),_0x51c2c5[_0x6c11('0x13')],_0x5066a1);_0x3ae988(_0x4d4fb5[_0x6c11('0x11')](0x1f4,_0x51c2c5[_0x6c11('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x42edc1){var _0x5486f7=this;return new Promise(function(_0x5817f5,_0x549a4c){return db[_0x6c11('0x17')][_0x6c11('0x1c')]({'raw':_0x42edc1[_0x6c11('0x1a')]?_0x42edc1[_0x6c11('0x1a')][_0x6c11('0x1d')]===undefined?!![]:![]:!![],'where':_0x42edc1['options']?_0x42edc1[_0x6c11('0x1a')][_0x6c11('0x1e')]||null:null,'attributes':[['campaign',_0x6c11('0x2a')],[db[_0x6c11('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6c11('0x1f')][_0x6c11('0x21')](_0x6c11('0x2b')))),_0x6c11('0x2c')],[db['sequelize']['fn']('COUNT',db[_0x6c11('0x1f')]['fn']('IF',db[_0x6c11('0x1f')][_0x6c11('0x21')]('`state`\x20=\x203,\x201,\x20null'))),_0x6c11('0x2d')],[db['sequelize']['fn'](_0x6c11('0x20'),db['sequelize']['fn']('IF',db[_0x6c11('0x1f')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x6c11('0x2e')],[db[_0x6c11('0x1f')]['fn'](_0x6c11('0x20'),db[_0x6c11('0x1f')]['fn']('IF',db[_0x6c11('0x1f')][_0x6c11('0x21')](_0x6c11('0x2f')))),_0x6c11('0x30')],[db[_0x6c11('0x1f')]['fn'](_0x6c11('0x20'),db[_0x6c11('0x1f')]['fn']('IF',db[_0x6c11('0x1f')][_0x6c11('0x21')](_0x6c11('0x31')))),_0x6c11('0x32')],[db['sequelize']['fn'](_0x6c11('0x20'),db[_0x6c11('0x1f')]['fn']('IF',db[_0x6c11('0x1f')][_0x6c11('0x21')](_0x6c11('0x33')))),_0x6c11('0x34')],[db['sequelize']['fn']('COUNT',db[_0x6c11('0x1f')]['fn']('IF',db[_0x6c11('0x1f')][_0x6c11('0x21')](_0x6c11('0x35')))),_0x6c11('0x36')],[db[_0x6c11('0x1f')]['fn'](_0x6c11('0x20'),db['sequelize']['fn']('IF',db[_0x6c11('0x1f')][_0x6c11('0x21')](_0x6c11('0x37')))),'outboundUnknownCallsDay'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6c11('0x1f')][_0x6c11('0x21')](_0x6c11('0x38')))),'outboundBlacklistCallsDay'],[db[_0x6c11('0x1f')]['fn'](_0x6c11('0x20'),db[_0x6c11('0x1f')]['fn']('IF',db[_0x6c11('0x1f')][_0x6c11('0x21')](_0x6c11('0x39')))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0x6c11('0x20'),db['sequelize']['fn']('IF',db[_0x6c11('0x1f')][_0x6c11('0x21')](_0x6c11('0x3a')))),'outboundRejectCallsDay'],[db[_0x6c11('0x1f')]['fn'](_0x6c11('0x20'),db[_0x6c11('0x1f')]['fn']('IF',db[_0x6c11('0x1f')][_0x6c11('0x21')](_0x6c11('0x3b')))),_0x6c11('0x3c')],[db['sequelize']['fn'](_0x6c11('0x20'),db['sequelize']['fn']('IF',db[_0x6c11('0x1f')][_0x6c11('0x21')](_0x6c11('0x3d')))),'outboundRejectCallsDay'],[db[_0x6c11('0x1f')]['fn']('COUNT',db[_0x6c11('0x1f')]['fn']('IF',db[_0x6c11('0x1f')]['literal'](_0x6c11('0x3e')))),'outboundReCallsDay']],'group':[_0x6c11('0x3f')]})['then'](function(_0x41f820){logger[_0x6c11('0xd')](_0x6c11('0x40'),_0x42edc1);logger['debug'](_0x6c11('0x40'),_0x42edc1,JSON['stringify'](_0x41f820));_0x5817f5(_0x41f820);})[_0x6c11('0x15')](function(_0x4e341d){logger['error'](_0x6c11('0x40'),_0x4e341d[_0x6c11('0x13')],_0x42edc1);_0x549a4c(_0x5486f7[_0x6c11('0x11')](0x1f4,_0x4e341d[_0x6c11('0x13')]));});});};exports[_0x6c11('0x41')]=function(_0xfc3b0b){var _0x4bee6e=this;return new Promise(function(_0xfc2f1d,_0x4388e5){return db[_0x6c11('0x17')][_0x6c11('0x1c')]({'raw':_0xfc3b0b[_0x6c11('0x1a')]?_0xfc3b0b[_0x6c11('0x1a')][_0x6c11('0x1d')]===undefined?!![]:![]:!![],'where':_0xfc3b0b['options']?_0xfc3b0b['options'][_0x6c11('0x1e')]||null:null,'attributes':[['campaign',_0x6c11('0x2a')],[db[_0x6c11('0x1f')]['fn'](_0x6c11('0x20'),db[_0x6c11('0x1f')][_0x6c11('0x42')]('id')),_0x6c11('0x43')],[db[_0x6c11('0x1f')]['fn'](_0x6c11('0x20'),db[_0x6c11('0x1f')]['fn']('IF',db[_0x6c11('0x1f')]['literal'](_0x6c11('0x22')))),_0x6c11('0x44')]],'group':['campaign']})['then'](function(_0x9aba37){logger[_0x6c11('0xd')]('GetCampaignHopperHistory',_0xfc3b0b);logger[_0x6c11('0x10')]('GetCampaignHopperHistory',_0xfc3b0b,JSON[_0x6c11('0x29')](_0x9aba37));_0xfc2f1d(_0x9aba37);})[_0x6c11('0x15')](function(_0x2c1f63){logger[_0x6c11('0x11')]('GetCampaignHopperHistory',_0x2c1f63['message'],_0xfc3b0b);_0x4388e5(_0x4bee6e['error'](0x1f4,_0x2c1f63[_0x6c11('0x13')]));});});};
\ No newline at end of file
index de07c3f..0769b66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaca9=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','./cmHopperHistory.controller','index','get','/describe','describe','isAuthenticated','update','exports','multer'];(function(_0xbb7c1e,_0x39172c){var _0x1720cc=function(_0x17f044){while(--_0x17f044){_0xbb7c1e['push'](_0xbb7c1e['shift']());}};_0x1720cc(++_0x39172c);}(_0xaca9,0x125));var _0x9aca=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xaca9[_0x45d55e];return _0x29812a;};'use strict';var multer=require(_0x9aca('0x0'));var util=require('util');var path=require(_0x9aca('0x1'));var timeout=require(_0x9aca('0x2'));var express=require('express');var router=express[_0x9aca('0x3')]();var fs_extra=require(_0x9aca('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9aca('0x5'));var config=require('../../config/environment');var controller=require(_0x9aca('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9aca('0x7')]);router[_0x9aca('0x8')](_0x9aca('0x9'),auth['isAuthenticated'](),controller[_0x9aca('0xa')]);router[_0x9aca('0x8')]('/:id',auth[_0x9aca('0xb')](),controller['show']);router['post']('/',auth[_0x9aca('0xb')](),controller['create']);router['put']('/:id',auth[_0x9aca('0xb')](),controller[_0x9aca('0xc')]);module[_0x9aca('0xd')]=router;
\ No newline at end of file
+var _0xe3c3=['post','create','put','update','exports','multer','util','connect-timeout','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x2ce596,_0x10313b){var _0x2e65a4=function(_0x2f6e17){while(--_0x2f6e17){_0x2ce596['push'](_0x2ce596['shift']());}};_0x2e65a4(++_0x10313b);}(_0xe3c3,0x149));var _0x3e3c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3c3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3e3c('0x0'));var util=require(_0x3e3c('0x1'));var path=require('path');var timeout=require(_0x3e3c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3e3c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3e3c('0x4'));var controller=require(_0x3e3c('0x5'));router[_0x3e3c('0x6')]('/',auth[_0x3e3c('0x7')](),controller[_0x3e3c('0x8')]);router[_0x3e3c('0x6')](_0x3e3c('0x9'),auth['isAuthenticated'](),controller[_0x3e3c('0xa')]);router[_0x3e3c('0x6')](_0x3e3c('0xb'),auth[_0x3e3c('0x7')](),controller[_0x3e3c('0xc')]);router[_0x3e3c('0xd')]('/',auth[_0x3e3c('0x7')](),controller[_0x3e3c('0xe')]);router[_0x3e3c('0xf')]('/:id',auth[_0x3e3c('0x7')](),controller[_0x3e3c('0x10')]);module[_0x3e3c('0x11')]=router;
\ No newline at end of file
index dfde512..9c03bc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68f5=['sequelize','exports','STRING'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x68f5,0x11a));var _0x568f=function(_0x21a248,_0x23e896){_0x21a248=_0x21a248-0x0;var _0x1e2e84=_0x68f5[_0x21a248];return _0x1e2e84;};'use strict';var Sequelize=require(_0x568f('0x0'));module[_0x568f('0x1')]={'name':{'type':Sequelize[_0x568f('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x568f('0x2')]},'dialPrefix':{'type':Sequelize[_0x568f('0x2')]}};
\ No newline at end of file
+var _0x2392=['sequelize','exports','name','STRING'];(function(_0x34d8a2,_0x28099e){var _0x55c6e3=function(_0x3c0314){while(--_0x3c0314){_0x34d8a2['push'](_0x34d8a2['shift']());}};_0x55c6e3(++_0x28099e);}(_0x2392,0xd0));var _0x2239=function(_0x4afd94,_0x4fb7f2){_0x4afd94=_0x4afd94-0x0;var _0x437604=_0x2392[_0x4afd94];return _0x437604;};'use strict';var Sequelize=require(_0x2239('0x0'));module[_0x2239('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2239('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2239('0x3')]},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
index ed8dd45..97a2dc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7156=['model','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','CmList','findAll','catch','show','params','intersection','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','findOne','Disposition','nolimit','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','ListId','push','each','omit','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','getContactsCsv','ContactItemType','OrderBy','select','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','field','c.cf_','alias','item','from','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','sendStatus','addCustomField','sequelize','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','userCmList:save','removeAgents','userCmList:remove','emit','getAgents','User','info','message','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','attributes'];(function(_0x42ebfd,_0x3b82f1){var _0x437246=function(_0xae4a0d){while(--_0xae4a0d){_0x42ebfd['push'](_0x42ebfd['shift']());}};_0x437246(++_0x3b82f1);}(_0x7156,0x6a));var _0x6715=function(_0x51c25f,_0x1c9fc8){_0x51c25f=_0x51c25f-0x0;var _0x2aed2b=_0x7156[_0x51c25f];return _0x2aed2b;};'use strict';var emlformat=require(_0x6715('0x0'));var rimraf=require(_0x6715('0x1'));var zipdir=require(_0x6715('0x2'));var jsonpatch=require(_0x6715('0x3'));var rp=require(_0x6715('0x4'));var moment=require(_0x6715('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6715('0x6'));var util=require(_0x6715('0x7'));var path=require(_0x6715('0x8'));var sox=require(_0x6715('0x9'));var csv=require(_0x6715('0xa'));var ejs=require(_0x6715('0xb'));var fs=require('fs');var fs_extra=require(_0x6715('0xc'));var _=require(_0x6715('0xd'));var squel=require(_0x6715('0xe'));var crypto=require(_0x6715('0xf'));var jsforce=require(_0x6715('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6715('0x11'));var Papa=require(_0x6715('0x12'));var Redis=require(_0x6715('0x13'));var authService=require(_0x6715('0x14'));var qs=require(_0x6715('0x15'));var as=require(_0x6715('0x16'));var hardwareService=require(_0x6715('0x17'));var logger=require(_0x6715('0x18'))(_0x6715('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6715('0x1a'));var db=require(_0x6715('0x1b'))['db'];var csv_results;config[_0x6715('0x1c')]=_['defaults'](config[_0x6715('0x1c')],{'host':_0x6715('0x1d'),'port':0x18eb});var socket=require(_0x6715('0x1e'))(new Redis(config['redis']));require(_0x6715('0x1f'))[_0x6715('0x20')](socket);function respondWithStatusCode(_0x10b02b,_0x1bb73c){_0x1bb73c=_0x1bb73c||0xcc;return function(_0x1eff76){if(_0x1eff76){return _0x10b02b['sendStatus'](_0x1bb73c);}return _0x10b02b[_0x6715('0x21')](_0x1bb73c)[_0x6715('0x22')]();};}function respondWithResult(_0x3d66aa,_0x1e6b55){_0x1e6b55=_0x1e6b55||0xc8;return function(_0x1f92ac){if(_0x1f92ac){return _0x3d66aa[_0x6715('0x21')](_0x1e6b55)[_0x6715('0x23')](_0x1f92ac);}};}function respondWithFilteredResult(_0x126a2b,_0x1f8456){return function(_0x50e552){if(_0x50e552){var _0x4e0a71=typeof _0x1f8456[_0x6715('0x24')]===_0x6715('0x25')&&typeof _0x1f8456[_0x6715('0x26')]===_0x6715('0x25');var _0x3579f3=_0x50e552[_0x6715('0x27')];var _0x4af8ad=_0x4e0a71?0x0:_0x1f8456[_0x6715('0x24')];var _0x2aa15f=_0x4e0a71?_0x50e552[_0x6715('0x27')]:_0x1f8456[_0x6715('0x24')]+_0x1f8456[_0x6715('0x26')];var _0x45f845;if(_0x2aa15f>=_0x3579f3){_0x2aa15f=_0x3579f3;_0x45f845=0xc8;}else{_0x45f845=0xce;}_0x126a2b[_0x6715('0x21')](_0x45f845);return _0x126a2b[_0x6715('0x28')](_0x6715('0x29'),_0x4af8ad+'-'+_0x2aa15f+'/'+_0x3579f3)[_0x6715('0x23')](_0x50e552);}return null;};}function patchUpdates(_0x106b0a){return function(_0x1f4641){try{jsonpatch['apply'](_0x1f4641,_0x106b0a,!![]);}catch(_0x2322a8){return BPromise[_0x6715('0x2a')](_0x2322a8);}return _0x1f4641[_0x6715('0x2b')]();};}function saveUpdates(_0x158e34,_0x32d5c8){return function(_0x4bfbda){if(_0x4bfbda){return _0x4bfbda[_0x6715('0x2c')](_0x158e34)[_0x6715('0x2d')](function(_0x53e230){return _0x53e230;});}return null;};}function removeEntity(_0x329802,_0x40b5ae){return function(_0x5c4349){if(_0x5c4349){return _0x5c4349[_0x6715('0x2e')]()[_0x6715('0x2d')](function(){var _0x3a8c7b=_0x5c4349[_0x6715('0x2f')]({'plain':!![]});var _0xe513d1=_0x6715('0x30');return db[_0x6715('0x31')][_0x6715('0x2e')]({'where':{'type':_0xe513d1,'resourceId':_0x3a8c7b['id']}})['then'](function(){return _0x5c4349;});})[_0x6715('0x2d')](function(){_0x329802[_0x6715('0x21')](0xcc)[_0x6715('0x22')]();});}};}function handleEntityNotFound(_0x1fade5,_0x1a6f8c){return function(_0x28f900){if(!_0x28f900){_0x1fade5['sendStatus'](0x194);}return _0x28f900;};}function handleError(_0x1a331b,_0x459a1a){_0x459a1a=_0x459a1a||0x1f4;return function(_0x3dc96a){logger[_0x6715('0x32')](_0x3dc96a[_0x6715('0x33')]);if(_0x3dc96a['name']){delete _0x3dc96a[_0x6715('0x34')];}_0x1a331b[_0x6715('0x21')](_0x459a1a)[_0x6715('0x35')](_0x3dc96a);};}exports[_0x6715('0x36')]=function(_0x364a0f,_0x20fd33){var _0x3a9ee2={},_0x18bd74={},_0x4f0592={'count':0x0,'rows':[]};var _0x5a7ea4=_['map'](db['CmList'][_0x6715('0x37')],function(_0xcb0c89){return{'name':_0xcb0c89['fieldName'],'type':_0xcb0c89[_0x6715('0x38')][_0x6715('0x39')]};});_0x18bd74['model']=_[_0x6715('0x3a')](_0x5a7ea4,_0x6715('0x34'));_0x18bd74[_0x6715('0x3b')]=_[_0x6715('0x3c')](_0x364a0f['query']);_0x18bd74['filters']=_['intersection'](_0x18bd74['model'],_0x18bd74['query']);_0x3a9ee2[_0x6715('0x3d')]=_['intersection'](_0x18bd74[_0x6715('0x3e')],qs[_0x6715('0x3f')](_0x364a0f['query'][_0x6715('0x3f')]));_0x3a9ee2[_0x6715('0x3d')]=_0x3a9ee2['attributes'][_0x6715('0x40')]?_0x3a9ee2[_0x6715('0x3d')]:_0x18bd74[_0x6715('0x3e')];if(!_0x364a0f[_0x6715('0x3b')][_0x6715('0x41')]('nolimit')){_0x3a9ee2[_0x6715('0x26')]=qs['limit'](_0x364a0f['query'][_0x6715('0x26')]);_0x3a9ee2[_0x6715('0x24')]=qs['offset'](_0x364a0f[_0x6715('0x3b')][_0x6715('0x24')]);}_0x3a9ee2[_0x6715('0x42')]=qs[_0x6715('0x43')](_0x364a0f['query'][_0x6715('0x43')]);_0x3a9ee2['where']=qs[_0x6715('0x44')](_[_0x6715('0x45')](_0x364a0f[_0x6715('0x3b')],_0x18bd74[_0x6715('0x44')]),_0x5a7ea4);if(_0x364a0f[_0x6715('0x3b')][_0x6715('0x46')]){_0x3a9ee2[_0x6715('0x47')]=_[_0x6715('0x48')](_0x3a9ee2['where'],{'$or':_[_0x6715('0x3a')](_0x5a7ea4,function(_0x44e5a8){if(_0x44e5a8['type']!==_0x6715('0x49')){var _0x108070={};_0x108070[_0x44e5a8['name']]={'$like':'%'+_0x364a0f[_0x6715('0x3b')][_0x6715('0x46')]+'%'};return _0x108070;}})});}_0x3a9ee2=_['merge']({},_0x3a9ee2,_0x364a0f[_0x6715('0x4a')]);var _0x3641e9={'where':_0x3a9ee2[_0x6715('0x47')]};return db['CmList']['count'](_0x3641e9)['then'](function(_0x4c7f21){_0x4f0592['count']=_0x4c7f21;if(_0x364a0f[_0x6715('0x3b')][_0x6715('0x4b')]){_0x3a9ee2['include']=[{'all':!![]}];}return db[_0x6715('0x4c')][_0x6715('0x4d')](_0x3a9ee2);})['then'](function(_0x57ef82){_0x4f0592['rows']=_0x57ef82;return _0x4f0592;})['then'](respondWithFilteredResult(_0x20fd33,_0x3a9ee2))[_0x6715('0x4e')](handleError(_0x20fd33,null));};exports[_0x6715('0x4f')]=function(_0x2ea977,_0x4a41bd){var _0x378245={'raw':![],'where':{'id':_0x2ea977[_0x6715('0x50')]['id']}},_0x12e0cf={};_0x12e0cf[_0x6715('0x3e')]=_[_0x6715('0x3c')](db['CmList'][_0x6715('0x37')]);_0x12e0cf[_0x6715('0x3b')]=_[_0x6715('0x3c')](_0x2ea977[_0x6715('0x3b')]);_0x12e0cf[_0x6715('0x44')]=_[_0x6715('0x51')](_0x12e0cf[_0x6715('0x3e')],_0x12e0cf[_0x6715('0x3b')]);_0x378245['attributes']=_[_0x6715('0x51')](_0x12e0cf[_0x6715('0x3e')],qs[_0x6715('0x3f')](_0x2ea977[_0x6715('0x3b')]['fields']));_0x378245[_0x6715('0x3d')]=_0x378245[_0x6715('0x3d')][_0x6715('0x40')]?_0x378245['attributes']:_0x12e0cf[_0x6715('0x3e')];if(_0x2ea977[_0x6715('0x3b')][_0x6715('0x4b')]){_0x378245[_0x6715('0x52')]=[{'all':!![]}];}_0x378245=_['merge']({},_0x378245,_0x2ea977[_0x6715('0x4a')]);return db['CmList']['find'](_0x378245)[_0x6715('0x2d')](handleEntityNotFound(_0x4a41bd,null))['then'](respondWithResult(_0x4a41bd,null))[_0x6715('0x4e')](handleError(_0x4a41bd,null));};exports[_0x6715('0x53')]=function(_0x1e9c22,_0x49fa7b){return db[_0x6715('0x4c')][_0x6715('0x53')](_0x1e9c22[_0x6715('0x54')],{})[_0x6715('0x2d')](function(_0x243326){var _0x2e82c3=_0x1e9c22[_0x6715('0x55')][_0x6715('0x2f')]({'plain':!![]});if(!_0x2e82c3)throw new Error(_0x6715('0x56'));if(_0x2e82c3[_0x6715('0x57')]===_0x6715('0x55')){var _0xcc594c=_0x243326[_0x6715('0x2f')]({'plain':!![]});var _0x38d436=_0x6715('0x30');return db[_0x6715('0x58')]['find']({'where':{'name':_0x38d436,'userProfileId':_0x2e82c3['userProfileId']},'raw':!![]})[_0x6715('0x2d')](function(_0x4c7fb6){if(_0x4c7fb6&&_0x4c7fb6[_0x6715('0x59')]===0x0){return db[_0x6715('0x31')][_0x6715('0x53')]({'name':_0xcc594c[_0x6715('0x34')],'resourceId':_0xcc594c['id'],'type':_0x4c7fb6[_0x6715('0x34')],'sectionId':_0x4c7fb6['id']},{})[_0x6715('0x2d')](function(){return _0x243326;});}else{return _0x243326;}})[_0x6715('0x4e')](function(_0x3f0488){logger[_0x6715('0x32')](_0x6715('0x5a'),_0x3f0488);throw _0x3f0488;});}return _0x243326;})[_0x6715('0x2d')](respondWithResult(_0x49fa7b,0xc9))[_0x6715('0x4e')](handleError(_0x49fa7b,null));};exports[_0x6715('0x2c')]=function(_0x3742e0,_0xea376d){if(_0x3742e0[_0x6715('0x54')]['id']){delete _0x3742e0[_0x6715('0x54')]['id'];}return db['CmList']['find']({'where':{'id':_0x3742e0['params']['id']}})[_0x6715('0x2d')](handleEntityNotFound(_0xea376d,null))['then'](saveUpdates(_0x3742e0['body'],null))[_0x6715('0x2d')](respondWithResult(_0xea376d,null))['catch'](handleError(_0xea376d,null));};exports[_0x6715('0x2e')]=function(_0x229f23,_0x5d8b02){return db[_0x6715('0x4c')][_0x6715('0x5b')]({'where':{'id':_0x229f23[_0x6715('0x50')]['id']}})['then'](handleEntityNotFound(_0x5d8b02,null))[_0x6715('0x2d')](removeEntity(_0x5d8b02,null))[_0x6715('0x4e')](handleError(_0x5d8b02,null));};exports[_0x6715('0x5c')]=function(_0x4bfccd,_0x38354d){return db[_0x6715('0x4c')][_0x6715('0x5c')]()[_0x6715('0x2d')](respondWithResult(_0x38354d,null))['catch'](handleError(_0x38354d,null));};exports['addDisposition']=function(_0x27c28b,_0x1e326a,_0x110eab){if(_0x27c28b[_0x6715('0x54')]['id']){delete _0x27c28b['body']['id'];}return db[_0x6715('0x4c')]['find']({'where':{'id':_0x27c28b[_0x6715('0x50')]['id']}})[_0x6715('0x2d')](handleEntityNotFound(_0x1e326a,null))[_0x6715('0x2d')](function(_0x4c5e77){if(_0x4c5e77){_0x27c28b[_0x6715('0x54')]['ListId']=_0x4c5e77['id'];return db['Disposition'][_0x6715('0x53')](_0x27c28b['body']);}})[_0x6715('0x2d')](respondWithResult(_0x1e326a,null))['catch'](handleError(_0x1e326a,null));};exports['getDispositions']=function(_0x52a885,_0x1b4302,_0x1c263c){var _0x3f9fa2={'raw':![],'where':{}};var _0x324509={};var _0x11cbfd={'count':0x0,'rows':[]};return db[_0x6715('0x4c')][_0x6715('0x5d')]({'where':{'id':_0x52a885[_0x6715('0x50')]['id']}})[_0x6715('0x2d')](handleEntityNotFound(_0x1b4302,null))[_0x6715('0x2d')](function(_0x1df781){if(_0x1df781){_0x324509[_0x6715('0x3e')]=_[_0x6715('0x3c')](db[_0x6715('0x5e')][_0x6715('0x37')]);_0x324509[_0x6715('0x3b')]=_['keys'](_0x52a885[_0x6715('0x3b')]);_0x324509[_0x6715('0x44')]=_[_0x6715('0x51')](_0x324509[_0x6715('0x3e')],_0x324509['query']);_0x3f9fa2[_0x6715('0x3d')]=_[_0x6715('0x51')](_0x324509[_0x6715('0x3e')],qs[_0x6715('0x3f')](_0x52a885[_0x6715('0x3b')][_0x6715('0x3f')]));_0x3f9fa2['attributes']=_0x3f9fa2[_0x6715('0x3d')][_0x6715('0x40')]?_0x3f9fa2[_0x6715('0x3d')]:_0x324509[_0x6715('0x3e')];if(!_0x52a885[_0x6715('0x3b')]['hasOwnProperty'](_0x6715('0x5f'))){_0x3f9fa2['limit']=qs[_0x6715('0x26')](_0x52a885[_0x6715('0x3b')]['limit']);_0x3f9fa2['offset']=qs[_0x6715('0x24')](_0x52a885[_0x6715('0x3b')][_0x6715('0x24')]);}_0x3f9fa2[_0x6715('0x42')]=qs[_0x6715('0x43')](_0x52a885[_0x6715('0x3b')][_0x6715('0x43')]);_0x3f9fa2[_0x6715('0x47')]=qs[_0x6715('0x44')](_[_0x6715('0x45')](_0x52a885[_0x6715('0x3b')],_0x324509[_0x6715('0x44')]));_0x3f9fa2['where']['ListId']=_0x1df781['id'];if(_0x52a885[_0x6715('0x3b')]['filter']){_0x3f9fa2[_0x6715('0x47')]=_[_0x6715('0x48')](_0x3f9fa2['where'],{'$or':_[_0x6715('0x3a')](_0x3f9fa2[_0x6715('0x3d')],function(_0x39b9eb){var _0x1a53da={};_0x1a53da[_0x39b9eb]={'$like':'%'+_0x52a885[_0x6715('0x3b')]['filter']+'%'};return _0x1a53da;})});}_0x3f9fa2=_[_0x6715('0x48')]({},_0x3f9fa2,_0x52a885[_0x6715('0x4a')]);return db[_0x6715('0x5e')]['count']({'where':_0x3f9fa2[_0x6715('0x47')]})[_0x6715('0x2d')](function(_0x32c56c){_0x11cbfd[_0x6715('0x27')]=_0x32c56c;if(_0x52a885[_0x6715('0x3b')][_0x6715('0x4b')]){_0x3f9fa2[_0x6715('0x52')]=[{'all':!![]}];}return db[_0x6715('0x5e')][_0x6715('0x4d')](_0x3f9fa2);})[_0x6715('0x2d')](function(_0x4146cc){_0x11cbfd['rows']=_0x4146cc;return _0x11cbfd;});}})[_0x6715('0x2d')](respondWithFilteredResult(_0x1b4302,_0x3f9fa2))[_0x6715('0x4e')](handleError(_0x1b4302,null));};exports[_0x6715('0x60')]=function(_0x70467e,_0x3fe5eb,_0x415568){return db[_0x6715('0x4c')][_0x6715('0x5b')]({'where':{'id':_0x70467e[_0x6715('0x50')]['id']}})[_0x6715('0x2d')](handleEntityNotFound(_0x3fe5eb,null))[_0x6715('0x2d')](function(_0x429fcf){if(_0x429fcf){return _0x429fcf['removeDispositions'](_0x70467e['query'][_0x6715('0x61')]);}})[_0x6715('0x2d')](respondWithStatusCode(_0x3fe5eb,null))['catch'](handleError(_0x3fe5eb,null));};exports[_0x6715('0x62')]=function(_0xa705b6,_0x547e61,_0x37d556){return db[_0x6715('0x4c')][_0x6715('0x5b')]({'where':{'id':_0xa705b6[_0x6715('0x50')]['id']}})[_0x6715('0x2d')](handleEntityNotFound(_0x547e61,null))[_0x6715('0x2d')](function(_0xb761fd){if(_0xb761fd){var _0x2e799a=[];var _0x473493={'success':[],'errors':[]};return db[_0x6715('0x63')][_0x6715('0x5c')]()['then'](function(_0x4631a6){if(_0xa705b6[_0x6715('0x54')][_0x6715('0x64')]&&_[_0x6715('0x65')](_0xa705b6[_0x6715('0x54')][_0x6715('0x64')])){if(_0xa705b6['body']['tags'][_0x6715('0x40')]){_0xa705b6[_0x6715('0x54')]['tags']=_0xa705b6[_0x6715('0x54')][_0x6715('0x64')][_0x6715('0x66')](';')+';';}else{_0xa705b6[_0x6715('0x54')][_0x6715('0x64')]=null;}}else{_0xa705b6[_0x6715('0x54')]['tags']=null;}if(_0xa705b6[_0x6715('0x54')]&&_[_0x6715('0x65')](_0xa705b6['body'])){for(var _0x5c929c=0x0;_0x5c929c<_0xa705b6[_0x6715('0x54')][_0x6715('0x40')];_0x5c929c+=0x1){_0xa705b6[_0x6715('0x54')][_0x5c929c][_0x6715('0x67')]=_0xa705b6[_0x6715('0x50')]['id'];_0x2e799a[_0x6715('0x68')](_0xa705b6[_0x6715('0x54')][_0x5c929c]);}return BPromise[_0x6715('0x69')](_0x2e799a,function(_0x18c9f3){return db[_0x6715('0x63')][_0x6715('0x53')](_[_0x6715('0x6a')](_0x18c9f3,['ids','id'])||{},{'fields':_['keys'](_0x4631a6),'raw':!![]})[_0x6715('0x2d')](function(_0xd604ba){_0x473493['success'][_0x6715('0x68')](_0xd604ba['dataValues']);})[_0x6715('0x4e')](function(_0x5619c8){_0x473493['errors']['push']({'data':_0x18c9f3,'error':_0x5619c8['message']});});})['then'](function(_0x44ccac){return _0x473493;})[_0x6715('0x4e')](function(_0x132b10){return _0x132b10;});}else{_0x547e61[_0x6715('0x21')](0x190)[_0x6715('0x23')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x6715('0x2d')](respondWithResult(_0x547e61,null))['catch'](handleError(_0x547e61,null));};exports[_0x6715('0x6b')]=function(_0x2e6c80,_0x3a05df,_0x3a0af5){var _0x3de168;return db[_0x6715('0x4c')]['find']({'where':{'id':_0x2e6c80[_0x6715('0x50')]['id']},'include':[{'model':db[_0x6715('0x6c')],'as':_0x6715('0x6d')}]})[_0x6715('0x2d')](handleEntityNotFound(_0x3a05df,null))['then'](function(_0x3ecf0d){if(_0x3ecf0d){_0x3de168=_0x3ecf0d;return db[_0x6715('0x63')][_0x6715('0x37')];}})[_0x6715('0x2d')](function(_0x1b76da){if(_0x1b76da){var _0x1aae4f={};var _0x3ef380={};_0x3ef380[_0x6715('0x3e')]=_[_0x6715('0x6e')](_[_0x6715('0x3c')](_0x1b76da),_[_0x6715('0x3a')](_0x3de168['CustomFields'],function(_0x5bba72){return util[_0x6715('0x6f')](_0x6715('0x70'),_0x5bba72['id']);}));_0x3ef380[_0x6715('0x3b')]=_[_0x6715('0x3c')](_0x2e6c80[_0x6715('0x3b')]);_0x3ef380['filters']=_['intersection'](_0x3ef380[_0x6715('0x3e')],_0x3ef380[_0x6715('0x3b')]);_0x1aae4f['attributes']=_[_0x6715('0x51')](_0x3ef380['model'],qs['fields'](_0x2e6c80[_0x6715('0x3b')]['fields']));_0x1aae4f[_0x6715('0x3d')]=_0x1aae4f[_0x6715('0x3d')][_0x6715('0x40')]?_0x1aae4f[_0x6715('0x3d')]:_0x3ef380[_0x6715('0x3e')];if(!_0x2e6c80[_0x6715('0x3b')][_0x6715('0x41')](_0x6715('0x5f'))){_0x1aae4f['limit']=qs[_0x6715('0x26')](_0x2e6c80[_0x6715('0x3b')][_0x6715('0x26')]);_0x1aae4f[_0x6715('0x24')]=qs[_0x6715('0x24')](_0x2e6c80[_0x6715('0x3b')][_0x6715('0x24')]);}_0x1aae4f[_0x6715('0x42')]=qs['sort'](_0x2e6c80[_0x6715('0x3b')][_0x6715('0x43')]);_0x1aae4f['where']=qs[_0x6715('0x44')](_[_0x6715('0x45')](_0x2e6c80[_0x6715('0x3b')],_0x3ef380[_0x6715('0x44')]));_0x1aae4f['raw']=!![];if(_0x2e6c80['query'][_0x6715('0x46')]){_0x1aae4f[_0x6715('0x47')]=_[_0x6715('0x48')](_0x1aae4f['where'],{'$or':_[_0x6715('0x3a')](_0x1aae4f[_0x6715('0x3d')],function(_0x56940c){var _0x41af11={};_0x41af11[_0x56940c]={'$like':'%'+_0x2e6c80[_0x6715('0x3b')][_0x6715('0x46')]+'%'};return _0x41af11;})});}_0x1aae4f=_[_0x6715('0x48')]({},_0x1aae4f,_0x2e6c80[_0x6715('0x4a')]);return _0x3de168[_0x6715('0x6b')](_0x1aae4f);}})[_0x6715('0x2d')](respondWithResult(_0x3a05df,null))[_0x6715('0x4e')](handleError(_0x3a05df,null));};exports[_0x6715('0x71')]=function(_0x12c761,_0x35c4e8,_0x3a5f29){var _0xa3e479;var _0x3497ca;var _0x18dc45;var _0x47e6dc=_0x12c761[_0x6715('0x50')]['id'];csv_results=[];return db[_0x6715('0x72')]['findAll']({'attributes':['id','name'],'raw':!![],'order':[_0x6715('0x73')]})[_0x6715('0x2d')](function(_0x40b6c7){_0xa3e479=_0x40b6c7;var _0xf62044=_[_0x6715('0x3c')](db[_0x6715('0x63')][_0x6715('0x37')]);return db['CmCustomField'][_0x6715('0x4d')]({'raw':!![],'attributes':['id','alias']})[_0x6715('0x2d')](function(_0x1b07c8){_0x3497ca=_0x1b07c8;var _0x2b57b0=squel[_0x6715('0x74')]()['fields'](_0xf62044)['from']('cm_contacts','c')[_0x6715('0x47')](_0x6715('0x75'),_0x47e6dc)[_0x6715('0x47')](_0x6715('0x76'))['distinct']();for(var _0x46e13a=0x0;_0x46e13a<_0x3497ca[_0x6715('0x40')];_0x46e13a++){_0x2b57b0[_0x6715('0x77')](_0x6715('0x78')+_0x3497ca[_0x46e13a]['id'],'customField_'+_0x3497ca[_0x46e13a][_0x6715('0x79')]);}for(var _0x46e13a=0x0;_0x46e13a<_0xa3e479[_0x6715('0x40')];_0x46e13a++){_0x2b57b0[_0x6715('0x77')](squel[_0x6715('0x74')]()[_0x6715('0x77')](_0x6715('0x7a'))[_0x6715('0x7b')](_0x6715('0x7c'))[_0x6715('0x47')](_0x6715('0x7d'),_0xa3e479[_0x46e13a]['id'])['where'](_0x6715('0x7e')),_0x6715('0x7f')+_0xa3e479[_0x46e13a]['name']);_0x2b57b0[_0x6715('0x77')](squel['select']()[_0x6715('0x77')](_0x6715('0x80'))[_0x6715('0x7b')]('cm_contact_has_items')[_0x6715('0x47')](_0x6715('0x7d'),_0xa3e479[_0x46e13a]['id'])[_0x6715('0x47')]('CmContactId\x20=\x20c.id'),_0x6715('0x81')+_0xa3e479[_0x46e13a][_0x6715('0x34')]);}var _0x32ea25=[];_0x32ea25[_0x6715('0x68')](_0x2b57b0['toString']());BPromise[_0x6715('0x69')](_0x32ea25,handleQuery)[_0x6715('0x2d')](function(_0x256744){handleQuery(_0x2b57b0[_0x6715('0x82')]());var _0x13faa9=csv_results[0x0];if(!_[_0x6715('0x83')](_0x13faa9)){var _0xa9df03=toCsv(_0x13faa9);var _0x7e92a0=Date[_0x6715('0x84')]();fs[_0x6715('0x85')](util[_0x6715('0x6f')](_0x6715('0x86'),_0x47e6dc,_0x7e92a0),_0xa9df03);_0x35c4e8['setHeader'](_0x6715('0x87'),_0x6715('0x88')+util[_0x6715('0x6f')](_0x6715('0x89'),_0x47e6dc,_0x7e92a0));_0x35c4e8['setHeader'](_0x6715('0x8a'),_0x6715('0x8b'));return _0x35c4e8[_0x6715('0x8c')](util[_0x6715('0x6f')](_0x6715('0x86'),_0x47e6dc,_0x7e92a0));}else{return _0x35c4e8[_0x6715('0x8d')](0xcc);}});});});};exports[_0x6715('0x8e')]=function(_0x608e0c,_0x1731c2,_0x424716){var _0x501b99;delete _0x608e0c[_0x6715('0x54')]['id'];return db['CmList'][_0x6715('0x5d')]({'where':{'id':_0x608e0c['params']['id']}})[_0x6715('0x2d')](handleEntityNotFound(_0x1731c2,null))['then'](function(_0x1c7fbf){if(_0x1c7fbf){return db[_0x6715('0x8f')]['transaction'](function(_0x559564){return db[_0x6715('0x6c')][_0x6715('0x53')](_0x608e0c[_0x6715('0x54')],{'transaction':_0x559564})[_0x6715('0x2d')](function(_0x19eeed){_0x501b99=_0x19eeed;return _0x1c7fbf[_0x6715('0x90')](_0x19eeed,{'transaction':_0x559564});})[_0x6715('0x2d')](function(){var _0x43bbba={'type':db[_0x6715('0x91')]['TEXT'],'transaction':_0x559564};switch(_0x608e0c[_0x6715('0x54')][_0x6715('0x38')]){case _0x6715('0x92'):_0x43bbba[_0x6715('0x38')]=db[_0x6715('0x91')][_0x6715('0x93')];break;case _0x6715('0x94'):_0x43bbba[_0x6715('0x38')]=db[_0x6715('0x91')][_0x6715('0x95')];break;case _0x6715('0x96'):_0x43bbba['type']=db[_0x6715('0x91')]['BOOLEAN'];_0x43bbba[_0x6715('0x97')]=![];break;default:}return db[_0x6715('0x8f')][_0x6715('0x98')][_0x6715('0x99')]('cm_contacts',util[_0x6715('0x6f')](_0x6715('0x9a'),_0x501b99['id']),_0x43bbba);})[_0x6715('0x2d')](function(){return _0x501b99;});});}})[_0x6715('0x2d')](respondWithResult(_0x1731c2,null))[_0x6715('0x4e')](handleError(_0x1731c2,null));};exports[_0x6715('0x9b')]=function(_0x23444d,_0x4f68ee,_0x20bc1c){var _0x5ca6c1={};var _0x4ad2a7={};var _0x584a1f;var _0x4dc704;return db[_0x6715('0x4c')]['findOne']({'where':{'id':_0x23444d[_0x6715('0x50')]['id']}})[_0x6715('0x2d')](handleEntityNotFound(_0x4f68ee,null))[_0x6715('0x2d')](function(_0x1b48d5){if(_0x1b48d5){_0x584a1f=_0x1b48d5;_0x4ad2a7[_0x6715('0x3e')]=_[_0x6715('0x3c')](db[_0x6715('0x6c')][_0x6715('0x37')]);_0x4ad2a7['query']=_['keys'](_0x23444d['query']);_0x4ad2a7['filters']=_[_0x6715('0x51')](_0x4ad2a7[_0x6715('0x3e')],_0x4ad2a7[_0x6715('0x3b')]);_0x5ca6c1[_0x6715('0x3d')]=_[_0x6715('0x51')](_0x4ad2a7[_0x6715('0x3e')],qs[_0x6715('0x3f')](_0x23444d[_0x6715('0x3b')]['fields']));_0x5ca6c1['attributes']=_0x5ca6c1[_0x6715('0x3d')][_0x6715('0x40')]?_0x5ca6c1[_0x6715('0x3d')]:_0x4ad2a7[_0x6715('0x3e')];_0x5ca6c1[_0x6715('0x42')]=qs[_0x6715('0x43')](_0x23444d[_0x6715('0x3b')][_0x6715('0x43')]);_0x5ca6c1[_0x6715('0x47')]=qs[_0x6715('0x44')](_[_0x6715('0x45')](_0x23444d[_0x6715('0x3b')],_0x4ad2a7['filters']));_0x5ca6c1[_0x6715('0x47')]=_[_0x6715('0x48')](_0x5ca6c1[_0x6715('0x47')],{'$or':[{'ListId':_0x1b48d5['id']},{'ListId':null}]});if(_0x23444d[_0x6715('0x3b')][_0x6715('0x46')]){_0x5ca6c1['where']=_[_0x6715('0x48')](_0x5ca6c1['where'],{'$or':_[_0x6715('0x3a')](_0x5ca6c1[_0x6715('0x3d')],function(_0x175000){var _0x326343={};_0x326343[_0x175000]={'$like':'%'+_0x23444d['query']['filter']+'%'};return _0x326343;})});}_0x5ca6c1=_[_0x6715('0x48')]({},_0x5ca6c1,_0x23444d[_0x6715('0x4a')]);return db[_0x6715('0x6c')][_0x6715('0x9c')](_0x5ca6c1);}})[_0x6715('0x2d')](respondWithResult(_0x4f68ee,null))[_0x6715('0x4e')](handleError(_0x4f68ee,null));};exports[_0x6715('0x9d')]=function(_0x168a86,_0x809fea){return db[_0x6715('0x6c')][_0x6715('0x9c')]({'where':{'ListId':null}})[_0x6715('0x2d')](handleEntityNotFound(_0x809fea,null))['then'](function(_0x42d7b5){return _0x42d7b5;})['then'](respondWithResult(_0x809fea,null))[_0x6715('0x4e')](handleError(_0x809fea,null));};exports[_0x6715('0x9e')]=function(_0x227e95,_0x3a5124,_0x1ef052){return db[_0x6715('0x4c')][_0x6715('0x5b')]({'where':{'id':_0x227e95[_0x6715('0x50')]['id']}})['then'](handleEntityNotFound(_0x3a5124,null))[_0x6715('0x2d')](function(_0x1b66fa){if(_0x1b66fa){return _0x1b66fa[_0x6715('0x9e')](_0x227e95[_0x6715('0x54')][_0x6715('0x61')],_[_0x6715('0x6a')](_0x227e95[_0x6715('0x54')],[_0x6715('0x61'),'id'])||{})[_0x6715('0x9f')](function(_0x1cc738){for(var _0x1a249e=0x0;_0x1a249e<_0x227e95['body']['ids']['length'];_0x1a249e+=0x1){socket['emit'](_0x6715('0xa0'),{'UserId':Number(_0x227e95[_0x6715('0x54')][_0x6715('0x61')][_0x1a249e]),'CmListId':Number(_0x227e95[_0x6715('0x50')]['id'])});}return _0x1cc738;});}})[_0x6715('0x2d')](respondWithResult(_0x3a5124,null))[_0x6715('0x4e')](handleError(_0x3a5124,null));};exports[_0x6715('0xa1')]=function(_0x3ac29a,_0x113b1b,_0x16a006){return db[_0x6715('0x4c')][_0x6715('0x5b')]({'where':{'id':_0x3ac29a[_0x6715('0x50')]['id']}})[_0x6715('0x2d')](handleEntityNotFound(_0x113b1b,null))[_0x6715('0x2d')](function(_0x9afd7){if(_0x9afd7){return _0x9afd7['removeAgents'](_0x3ac29a[_0x6715('0x3b')][_0x6715('0x61')])['then'](function(){if(_['isArray'](_0x3ac29a[_0x6715('0x3b')][_0x6715('0x61')])){for(var _0x4a5f80=0x0;_0x4a5f80<_0x3ac29a[_0x6715('0x3b')]['ids']['length'];_0x4a5f80+=0x1){socket['emit'](_0x6715('0xa2'),{'UserId':Number(_0x3ac29a[_0x6715('0x3b')][_0x6715('0x61')][_0x4a5f80]),'CmListId':Number(_0x3ac29a[_0x6715('0x50')]['id'])});}}else{socket[_0x6715('0xa3')](_0x6715('0xa2'),{'UserId':Number(_0x3ac29a[_0x6715('0x3b')][_0x6715('0x61')]),'CmListId':Number(_0x3ac29a[_0x6715('0x50')]['id'])});}});}})[_0x6715('0x2d')](respondWithStatusCode(_0x113b1b,null))[_0x6715('0x4e')](handleError(_0x113b1b,null));};exports[_0x6715('0xa4')]=function(_0x146eed,_0x33f00b,_0x575e7b){var _0x288ac8={};var _0x5db15f={};var _0x4a6ae0;var _0xfe2d0;return db[_0x6715('0x4c')][_0x6715('0x5d')]({'where':{'id':_0x146eed[_0x6715('0x50')]['id']}})[_0x6715('0x2d')](handleEntityNotFound(_0x33f00b,null))[_0x6715('0x2d')](function(_0x3a0cf4){if(_0x3a0cf4){_0x4a6ae0=_0x3a0cf4;_0x5db15f[_0x6715('0x3e')]=_[_0x6715('0x3c')](db[_0x6715('0xa5')][_0x6715('0x37')]);_0x5db15f[_0x6715('0x3b')]=_['keys'](_0x146eed[_0x6715('0x3b')]);_0x5db15f[_0x6715('0x44')]=_[_0x6715('0x51')](_0x5db15f[_0x6715('0x3e')],_0x5db15f[_0x6715('0x3b')]);_0x288ac8[_0x6715('0x3d')]=_[_0x6715('0x51')](_0x5db15f['model'],qs['fields'](_0x146eed[_0x6715('0x3b')][_0x6715('0x3f')]));_0x288ac8[_0x6715('0x3d')]=_0x288ac8[_0x6715('0x3d')][_0x6715('0x40')]?_0x288ac8[_0x6715('0x3d')]:_0x5db15f[_0x6715('0x3e')];_0x288ac8[_0x6715('0x42')]=qs[_0x6715('0x43')](_0x146eed['query'][_0x6715('0x43')]);_0x288ac8[_0x6715('0x47')]=qs['filters'](_[_0x6715('0x45')](_0x146eed[_0x6715('0x3b')],_0x5db15f[_0x6715('0x44')]));if(_0x146eed[_0x6715('0x3b')][_0x6715('0x46')]){_0x288ac8[_0x6715('0x47')]=_[_0x6715('0x48')](_0x288ac8['where'],{'$or':_['map'](_0x288ac8[_0x6715('0x3d')],function(_0x4891a2){var _0x3c51a0={};_0x3c51a0[_0x4891a2]={'$like':'%'+_0x146eed[_0x6715('0x3b')]['filter']+'%'};return _0x3c51a0;})});}_0x288ac8=_[_0x6715('0x48')]({},_0x288ac8,_0x146eed['options']);return _0x4a6ae0[_0x6715('0xa4')](_0x288ac8);}})[_0x6715('0x2d')](function(_0x440514){if(_0x440514){_0xfe2d0=_0x440514[_0x6715('0x40')];if(!_0x146eed[_0x6715('0x3b')][_0x6715('0x41')]('nolimit')){_0x288ac8[_0x6715('0x26')]=qs[_0x6715('0x26')](_0x146eed[_0x6715('0x3b')][_0x6715('0x26')]);_0x288ac8[_0x6715('0x24')]=qs['offset'](_0x146eed[_0x6715('0x3b')]['offset']);}return _0x4a6ae0[_0x6715('0xa4')](_0x288ac8);}})[_0x6715('0x2d')](function(_0x58a4da){if(_0x58a4da){return _0x58a4da?{'count':_0xfe2d0,'rows':_0x58a4da}:null;}})[_0x6715('0x2d')](respondWithResult(_0x33f00b,null))['catch'](handleError(_0x33f00b,null));};function handleQuery(_0x353420){logger[_0x6715('0xa6')](_0x353420);return db['sequelize'][_0x6715('0x3b')](_0x353420)['spread'](function(_0x28d9c3){csv_results[_0x6715('0x68')](_0x28d9c3);})[_0x6715('0x4e')](function(_0x1d021f){logger[_0x6715('0x32')](_0x1d021f[_0x6715('0xa7')]);});}
\ No newline at end of file
+var _0x6006=['CustomFields','concat','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','distinct','field','c.cf_','customField_','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','now','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','text/csv','addCustomField','sequelize','transaction','CmCustomField','addCustomFields','TEXT','text','Sequelize','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','info','message','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','offset','limit','set','json','apply','reject','save','update','then','get','Lists','UserProfileResource','destroy','error','stack','name','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','show','params','rawAttributes','catch','create','CmList','body','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','getContacts'];(function(_0x5e6251,_0xaa9803){var _0x7d2a42=function(_0x5e7523){while(--_0x5e7523){_0x5e6251['push'](_0x5e6251['shift']());}};_0x7d2a42(++_0xaa9803);}(_0x6006,0xdf));var _0x6600=function(_0x98b1f1,_0x4b1d03){_0x98b1f1=_0x98b1f1-0x0;var _0x531b7b=_0x6006[_0x98b1f1];return _0x531b7b;};'use strict';var emlformat=require(_0x6600('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6600('0x1'));var rp=require('request-promise');var moment=require(_0x6600('0x2'));var BPromise=require(_0x6600('0x3'));var Mustache=require(_0x6600('0x4'));var util=require(_0x6600('0x5'));var path=require(_0x6600('0x6'));var sox=require(_0x6600('0x7'));var csv=require('to-csv');var ejs=require(_0x6600('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6600('0x9'));var squel=require(_0x6600('0xa'));var crypto=require('crypto');var jsforce=require(_0x6600('0xb'));var deskjs=require(_0x6600('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6600('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6600('0xe'));var as=require(_0x6600('0xf'));var hardwareService=require(_0x6600('0x10'));var logger=require(_0x6600('0x11'))(_0x6600('0x12'));var utils=require(_0x6600('0x13'));var config=require(_0x6600('0x14'));var licenseUtil=require(_0x6600('0x15'));var db=require(_0x6600('0x16'))['db'];var csv_results;config['redis']=_[_0x6600('0x17')](config[_0x6600('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6600('0x19'))(new Redis(config[_0x6600('0x18')]));require(_0x6600('0x1a'))[_0x6600('0x1b')](socket);function respondWithStatusCode(_0x3e096c,_0x5e9e9f){_0x5e9e9f=_0x5e9e9f||0xcc;return function(_0x52700d){if(_0x52700d){return _0x3e096c[_0x6600('0x1c')](_0x5e9e9f);}return _0x3e096c[_0x6600('0x1d')](_0x5e9e9f)[_0x6600('0x1e')]();};}function respondWithResult(_0x5d33fa,_0x3d20c0){_0x3d20c0=_0x3d20c0||0xc8;return function(_0x5ed33d){if(_0x5ed33d){return _0x5d33fa['status'](_0x3d20c0)['json'](_0x5ed33d);}};}function respondWithFilteredResult(_0x5dee0a,_0x295d88){return function(_0x213d7b){if(_0x213d7b){var _0x2650c9=typeof _0x295d88[_0x6600('0x1f')]==='undefined'&&typeof _0x295d88[_0x6600('0x20')]==='undefined';var _0x3cf0b7=_0x213d7b['count'];var _0x334535=_0x2650c9?0x0:_0x295d88[_0x6600('0x1f')];var _0x2cd1aa=_0x2650c9?_0x213d7b['count']:_0x295d88[_0x6600('0x1f')]+_0x295d88['limit'];var _0x45ba9b;if(_0x2cd1aa>=_0x3cf0b7){_0x2cd1aa=_0x3cf0b7;_0x45ba9b=0xc8;}else{_0x45ba9b=0xce;}_0x5dee0a['status'](_0x45ba9b);return _0x5dee0a[_0x6600('0x21')]('Content-Range',_0x334535+'-'+_0x2cd1aa+'/'+_0x3cf0b7)[_0x6600('0x22')](_0x213d7b);}return null;};}function patchUpdates(_0x3c90d7){return function(_0x3ea23b){try{jsonpatch[_0x6600('0x23')](_0x3ea23b,_0x3c90d7,!![]);}catch(_0x262016){return BPromise[_0x6600('0x24')](_0x262016);}return _0x3ea23b[_0x6600('0x25')]();};}function saveUpdates(_0x3a0bf6,_0x14dff1){return function(_0x3d1883){if(_0x3d1883){return _0x3d1883[_0x6600('0x26')](_0x3a0bf6)[_0x6600('0x27')](function(_0x3aa086){return _0x3aa086;});}return null;};}function removeEntity(_0x39852d,_0x16bb59){return function(_0x4b1c0a){if(_0x4b1c0a){return _0x4b1c0a['destroy']()[_0x6600('0x27')](function(){var _0x4abce3=_0x4b1c0a[_0x6600('0x28')]({'plain':!![]});var _0x36d09c=_0x6600('0x29');return db[_0x6600('0x2a')][_0x6600('0x2b')]({'where':{'type':_0x36d09c,'resourceId':_0x4abce3['id']}})[_0x6600('0x27')](function(){return _0x4b1c0a;});})['then'](function(){_0x39852d[_0x6600('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38b152,_0x465612){return function(_0x5df9ff){if(!_0x5df9ff){_0x38b152['sendStatus'](0x194);}return _0x5df9ff;};}function handleError(_0x3bf881,_0xaf35a7){_0xaf35a7=_0xaf35a7||0x1f4;return function(_0x56e8c0){logger[_0x6600('0x2c')](_0x56e8c0[_0x6600('0x2d')]);if(_0x56e8c0[_0x6600('0x2e')]){delete _0x56e8c0[_0x6600('0x2e')];}_0x3bf881[_0x6600('0x1d')](_0xaf35a7)['send'](_0x56e8c0);};}exports[_0x6600('0x2f')]=function(_0x4cf76c,_0x2d29de){var _0x953fa={},_0x46cb42={},_0x2085bb={'count':0x0,'rows':[]};var _0x5a129e=_[_0x6600('0x30')](db['CmList']['rawAttributes'],function(_0x13af72){return{'name':_0x13af72[_0x6600('0x31')],'type':_0x13af72[_0x6600('0x32')][_0x6600('0x33')]};});_0x46cb42[_0x6600('0x34')]=_[_0x6600('0x30')](_0x5a129e,_0x6600('0x2e'));_0x46cb42['query']=_[_0x6600('0x35')](_0x4cf76c[_0x6600('0x36')]);_0x46cb42[_0x6600('0x37')]=_[_0x6600('0x38')](_0x46cb42[_0x6600('0x34')],_0x46cb42['query']);_0x953fa[_0x6600('0x39')]=_['intersection'](_0x46cb42[_0x6600('0x34')],qs['fields'](_0x4cf76c[_0x6600('0x36')][_0x6600('0x3a')]));_0x953fa['attributes']=_0x953fa['attributes'][_0x6600('0x3b')]?_0x953fa[_0x6600('0x39')]:_0x46cb42[_0x6600('0x34')];if(!_0x4cf76c[_0x6600('0x36')]['hasOwnProperty'](_0x6600('0x3c'))){_0x953fa[_0x6600('0x20')]=qs[_0x6600('0x20')](_0x4cf76c[_0x6600('0x36')][_0x6600('0x20')]);_0x953fa['offset']=qs['offset'](_0x4cf76c[_0x6600('0x36')][_0x6600('0x1f')]);}_0x953fa[_0x6600('0x3d')]=qs[_0x6600('0x3e')](_0x4cf76c[_0x6600('0x36')][_0x6600('0x3e')]);_0x953fa[_0x6600('0x3f')]=qs[_0x6600('0x37')](_[_0x6600('0x40')](_0x4cf76c['query'],_0x46cb42[_0x6600('0x37')]),_0x5a129e);if(_0x4cf76c[_0x6600('0x36')][_0x6600('0x41')]){_0x953fa[_0x6600('0x3f')]=_[_0x6600('0x42')](_0x953fa[_0x6600('0x3f')],{'$or':_[_0x6600('0x30')](_0x5a129e,function(_0x5410f0){if(_0x5410f0[_0x6600('0x32')]!=='VIRTUAL'){var _0x19652b={};_0x19652b[_0x5410f0['name']]={'$like':'%'+_0x4cf76c[_0x6600('0x36')]['filter']+'%'};return _0x19652b;}})});}_0x953fa=_['merge']({},_0x953fa,_0x4cf76c[_0x6600('0x43')]);var _0x5b9287={'where':_0x953fa[_0x6600('0x3f')]};return db['CmList'][_0x6600('0x44')](_0x5b9287)[_0x6600('0x27')](function(_0x31505f){_0x2085bb[_0x6600('0x44')]=_0x31505f;if(_0x4cf76c[_0x6600('0x36')][_0x6600('0x45')]){_0x953fa[_0x6600('0x46')]=[{'all':!![]}];}return db['CmList'][_0x6600('0x47')](_0x953fa);})[_0x6600('0x27')](function(_0x163e39){_0x2085bb['rows']=_0x163e39;return _0x2085bb;})['then'](respondWithFilteredResult(_0x2d29de,_0x953fa))['catch'](handleError(_0x2d29de,null));};exports[_0x6600('0x48')]=function(_0x4cfaf5,_0x3d9340){var _0x9486c4={'raw':![],'where':{'id':_0x4cfaf5[_0x6600('0x49')]['id']}},_0x3cb82a={};_0x3cb82a[_0x6600('0x34')]=_[_0x6600('0x35')](db['CmList'][_0x6600('0x4a')]);_0x3cb82a['query']=_[_0x6600('0x35')](_0x4cfaf5[_0x6600('0x36')]);_0x3cb82a[_0x6600('0x37')]=_[_0x6600('0x38')](_0x3cb82a[_0x6600('0x34')],_0x3cb82a[_0x6600('0x36')]);_0x9486c4[_0x6600('0x39')]=_[_0x6600('0x38')](_0x3cb82a['model'],qs[_0x6600('0x3a')](_0x4cfaf5[_0x6600('0x36')][_0x6600('0x3a')]));_0x9486c4[_0x6600('0x39')]=_0x9486c4[_0x6600('0x39')][_0x6600('0x3b')]?_0x9486c4[_0x6600('0x39')]:_0x3cb82a[_0x6600('0x34')];if(_0x4cfaf5[_0x6600('0x36')][_0x6600('0x45')]){_0x9486c4[_0x6600('0x46')]=[{'all':!![]}];}_0x9486c4=_[_0x6600('0x42')]({},_0x9486c4,_0x4cfaf5['options']);return db['CmList']['find'](_0x9486c4)[_0x6600('0x27')](handleEntityNotFound(_0x3d9340,null))['then'](respondWithResult(_0x3d9340,null))[_0x6600('0x4b')](handleError(_0x3d9340,null));};exports[_0x6600('0x4c')]=function(_0x11f88,_0xe9b513){return db[_0x6600('0x4d')][_0x6600('0x4c')](_0x11f88[_0x6600('0x4e')],{})[_0x6600('0x27')](function(_0x1e5750){var _0x51474f=_0x11f88[_0x6600('0x4f')]['get']({'plain':!![]});if(!_0x51474f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51474f['role']===_0x6600('0x4f')){var _0x5b63bc=_0x1e5750[_0x6600('0x28')]({'plain':!![]});var _0x4874f2=_0x6600('0x29');return db[_0x6600('0x50')][_0x6600('0x51')]({'where':{'name':_0x4874f2,'userProfileId':_0x51474f[_0x6600('0x52')]},'raw':!![]})[_0x6600('0x27')](function(_0x14d01c){if(_0x14d01c&&_0x14d01c['autoAssociation']===0x0){return db['UserProfileResource'][_0x6600('0x4c')]({'name':_0x5b63bc[_0x6600('0x2e')],'resourceId':_0x5b63bc['id'],'type':_0x14d01c[_0x6600('0x2e')],'sectionId':_0x14d01c['id']},{})[_0x6600('0x27')](function(){return _0x1e5750;});}else{return _0x1e5750;}})[_0x6600('0x4b')](function(_0x3fc477){logger[_0x6600('0x2c')](_0x6600('0x53'),_0x3fc477);throw _0x3fc477;});}return _0x1e5750;})[_0x6600('0x27')](respondWithResult(_0xe9b513,0xc9))[_0x6600('0x4b')](handleError(_0xe9b513,null));};exports[_0x6600('0x26')]=function(_0x1d74ea,_0x3bba04){if(_0x1d74ea[_0x6600('0x4e')]['id']){delete _0x1d74ea[_0x6600('0x4e')]['id'];}return db[_0x6600('0x4d')][_0x6600('0x51')]({'where':{'id':_0x1d74ea[_0x6600('0x49')]['id']}})[_0x6600('0x27')](handleEntityNotFound(_0x3bba04,null))[_0x6600('0x27')](saveUpdates(_0x1d74ea['body'],null))[_0x6600('0x27')](respondWithResult(_0x3bba04,null))[_0x6600('0x4b')](handleError(_0x3bba04,null));};exports[_0x6600('0x2b')]=function(_0xb43dec,_0x5d10e2){return db['CmList'][_0x6600('0x51')]({'where':{'id':_0xb43dec[_0x6600('0x49')]['id']}})['then'](handleEntityNotFound(_0x5d10e2,null))[_0x6600('0x27')](removeEntity(_0x5d10e2,null))[_0x6600('0x4b')](handleError(_0x5d10e2,null));};exports[_0x6600('0x54')]=function(_0x21197b,_0x5d85e2){return db[_0x6600('0x4d')]['describe']()[_0x6600('0x27')](respondWithResult(_0x5d85e2,null))[_0x6600('0x4b')](handleError(_0x5d85e2,null));};exports[_0x6600('0x55')]=function(_0x4d11ec,_0x4fd921,_0x2a3576){if(_0x4d11ec[_0x6600('0x4e')]['id']){delete _0x4d11ec['body']['id'];}return db[_0x6600('0x4d')][_0x6600('0x51')]({'where':{'id':_0x4d11ec[_0x6600('0x49')]['id']}})[_0x6600('0x27')](handleEntityNotFound(_0x4fd921,null))['then'](function(_0x34c141){if(_0x34c141){_0x4d11ec[_0x6600('0x4e')][_0x6600('0x56')]=_0x34c141['id'];return db[_0x6600('0x57')][_0x6600('0x4c')](_0x4d11ec['body']);}})[_0x6600('0x27')](respondWithResult(_0x4fd921,null))[_0x6600('0x4b')](handleError(_0x4fd921,null));};exports[_0x6600('0x58')]=function(_0x405c9d,_0x104ff3,_0x1c50ca){var _0x144c3b={'raw':![],'where':{}};var _0x50a0ba={};var _0x7f7889={'count':0x0,'rows':[]};return db['CmList'][_0x6600('0x59')]({'where':{'id':_0x405c9d[_0x6600('0x49')]['id']}})['then'](handleEntityNotFound(_0x104ff3,null))[_0x6600('0x27')](function(_0xa5bcd6){if(_0xa5bcd6){_0x50a0ba[_0x6600('0x34')]=_[_0x6600('0x35')](db[_0x6600('0x57')]['rawAttributes']);_0x50a0ba[_0x6600('0x36')]=_[_0x6600('0x35')](_0x405c9d[_0x6600('0x36')]);_0x50a0ba[_0x6600('0x37')]=_[_0x6600('0x38')](_0x50a0ba[_0x6600('0x34')],_0x50a0ba[_0x6600('0x36')]);_0x144c3b[_0x6600('0x39')]=_[_0x6600('0x38')](_0x50a0ba[_0x6600('0x34')],qs['fields'](_0x405c9d[_0x6600('0x36')][_0x6600('0x3a')]));_0x144c3b[_0x6600('0x39')]=_0x144c3b[_0x6600('0x39')][_0x6600('0x3b')]?_0x144c3b[_0x6600('0x39')]:_0x50a0ba[_0x6600('0x34')];if(!_0x405c9d[_0x6600('0x36')][_0x6600('0x5a')](_0x6600('0x3c'))){_0x144c3b[_0x6600('0x20')]=qs['limit'](_0x405c9d[_0x6600('0x36')][_0x6600('0x20')]);_0x144c3b[_0x6600('0x1f')]=qs[_0x6600('0x1f')](_0x405c9d[_0x6600('0x36')][_0x6600('0x1f')]);}_0x144c3b[_0x6600('0x3d')]=qs[_0x6600('0x3e')](_0x405c9d[_0x6600('0x36')]['sort']);_0x144c3b[_0x6600('0x3f')]=qs[_0x6600('0x37')](_[_0x6600('0x40')](_0x405c9d['query'],_0x50a0ba[_0x6600('0x37')]));_0x144c3b[_0x6600('0x3f')][_0x6600('0x56')]=_0xa5bcd6['id'];if(_0x405c9d[_0x6600('0x36')][_0x6600('0x41')]){_0x144c3b[_0x6600('0x3f')]=_['merge'](_0x144c3b[_0x6600('0x3f')],{'$or':_[_0x6600('0x30')](_0x144c3b[_0x6600('0x39')],function(_0x42ea26){var _0x3f6c41={};_0x3f6c41[_0x42ea26]={'$like':'%'+_0x405c9d[_0x6600('0x36')][_0x6600('0x41')]+'%'};return _0x3f6c41;})});}_0x144c3b=_[_0x6600('0x42')]({},_0x144c3b,_0x405c9d['options']);return db[_0x6600('0x57')][_0x6600('0x44')]({'where':_0x144c3b[_0x6600('0x3f')]})[_0x6600('0x27')](function(_0x1b91f2){_0x7f7889[_0x6600('0x44')]=_0x1b91f2;if(_0x405c9d[_0x6600('0x36')][_0x6600('0x45')]){_0x144c3b[_0x6600('0x46')]=[{'all':!![]}];}return db[_0x6600('0x57')][_0x6600('0x47')](_0x144c3b);})[_0x6600('0x27')](function(_0x52ee37){_0x7f7889['rows']=_0x52ee37;return _0x7f7889;});}})[_0x6600('0x27')](respondWithFilteredResult(_0x104ff3,_0x144c3b))[_0x6600('0x4b')](handleError(_0x104ff3,null));};exports[_0x6600('0x5b')]=function(_0x30ca9b,_0x346c1c,_0x18a5a5){return db[_0x6600('0x4d')][_0x6600('0x51')]({'where':{'id':_0x30ca9b[_0x6600('0x49')]['id']}})['then'](handleEntityNotFound(_0x346c1c,null))['then'](function(_0x170ee7){if(_0x170ee7){return _0x170ee7[_0x6600('0x5b')](_0x30ca9b[_0x6600('0x36')][_0x6600('0x5c')]);}})[_0x6600('0x27')](respondWithStatusCode(_0x346c1c,null))[_0x6600('0x4b')](handleError(_0x346c1c,null));};exports[_0x6600('0x5d')]=function(_0x40d38b,_0x4f4a21,_0x264550){return db['CmList'][_0x6600('0x51')]({'where':{'id':_0x40d38b[_0x6600('0x49')]['id']}})[_0x6600('0x27')](handleEntityNotFound(_0x4f4a21,null))[_0x6600('0x27')](function(_0x510e59){if(_0x510e59){var _0x465bb3=[];var _0x2b42e6={'success':[],'errors':[]};return db[_0x6600('0x5e')][_0x6600('0x54')]()['then'](function(_0x178091){if(_0x40d38b[_0x6600('0x4e')][_0x6600('0x5f')]&&_[_0x6600('0x60')](_0x40d38b['body']['tags'])){if(_0x40d38b['body'][_0x6600('0x5f')]['length']){_0x40d38b[_0x6600('0x4e')][_0x6600('0x5f')]=_0x40d38b[_0x6600('0x4e')]['tags'][_0x6600('0x61')](';')+';';}else{_0x40d38b[_0x6600('0x4e')][_0x6600('0x5f')]=null;}}else{_0x40d38b[_0x6600('0x4e')][_0x6600('0x5f')]=null;}if(_0x40d38b[_0x6600('0x4e')]&&_[_0x6600('0x60')](_0x40d38b[_0x6600('0x4e')])){for(var _0x28ab52=0x0;_0x28ab52<_0x40d38b[_0x6600('0x4e')][_0x6600('0x3b')];_0x28ab52+=0x1){_0x40d38b['body'][_0x28ab52][_0x6600('0x56')]=_0x40d38b[_0x6600('0x49')]['id'];_0x465bb3[_0x6600('0x62')](_0x40d38b[_0x6600('0x4e')][_0x28ab52]);}return BPromise[_0x6600('0x63')](_0x465bb3,function(_0x57141f){return db[_0x6600('0x5e')]['create'](_[_0x6600('0x64')](_0x57141f,[_0x6600('0x5c'),'id'])||{},{'fields':_[_0x6600('0x35')](_0x178091),'raw':!![]})[_0x6600('0x27')](function(_0x2809ac){_0x2b42e6[_0x6600('0x65')][_0x6600('0x62')](_0x2809ac[_0x6600('0x66')]);})[_0x6600('0x4b')](function(_0x3e8f7f){_0x2b42e6[_0x6600('0x67')][_0x6600('0x62')]({'data':_0x57141f,'error':_0x3e8f7f['message']});});})['then'](function(_0x945e24){return _0x2b42e6;})[_0x6600('0x4b')](function(_0x45fc83){return _0x45fc83;});}else{_0x4f4a21['status'](0x190)[_0x6600('0x22')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x6600('0x27')](respondWithResult(_0x4f4a21,null))[_0x6600('0x4b')](handleError(_0x4f4a21,null));};exports[_0x6600('0x68')]=function(_0x43847d,_0x54ff2b,_0x5a5fc6){var _0x2b69cf;return db[_0x6600('0x4d')][_0x6600('0x51')]({'where':{'id':_0x43847d[_0x6600('0x49')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x6600('0x69')}]})['then'](handleEntityNotFound(_0x54ff2b,null))[_0x6600('0x27')](function(_0x512559){if(_0x512559){_0x2b69cf=_0x512559;return db[_0x6600('0x5e')]['rawAttributes'];}})[_0x6600('0x27')](function(_0x1cc003){if(_0x1cc003){var _0x31736c={};var _0x2e067c={};_0x2e067c['model']=_[_0x6600('0x6a')](_[_0x6600('0x35')](_0x1cc003),_[_0x6600('0x30')](_0x2b69cf[_0x6600('0x69')],function(_0x2f85cb){return util['format'](_0x6600('0x6b'),_0x2f85cb['id']);}));_0x2e067c[_0x6600('0x36')]=_[_0x6600('0x35')](_0x43847d[_0x6600('0x36')]);_0x2e067c[_0x6600('0x37')]=_['intersection'](_0x2e067c[_0x6600('0x34')],_0x2e067c[_0x6600('0x36')]);_0x31736c['attributes']=_[_0x6600('0x38')](_0x2e067c['model'],qs[_0x6600('0x3a')](_0x43847d[_0x6600('0x36')][_0x6600('0x3a')]));_0x31736c['attributes']=_0x31736c[_0x6600('0x39')][_0x6600('0x3b')]?_0x31736c[_0x6600('0x39')]:_0x2e067c[_0x6600('0x34')];if(!_0x43847d[_0x6600('0x36')][_0x6600('0x5a')](_0x6600('0x3c'))){_0x31736c[_0x6600('0x20')]=qs[_0x6600('0x20')](_0x43847d[_0x6600('0x36')][_0x6600('0x20')]);_0x31736c[_0x6600('0x1f')]=qs[_0x6600('0x1f')](_0x43847d[_0x6600('0x36')]['offset']);}_0x31736c['order']=qs[_0x6600('0x3e')](_0x43847d[_0x6600('0x36')][_0x6600('0x3e')]);_0x31736c[_0x6600('0x3f')]=qs[_0x6600('0x37')](_['pick'](_0x43847d[_0x6600('0x36')],_0x2e067c[_0x6600('0x37')]));_0x31736c[_0x6600('0x6c')]=!![];if(_0x43847d[_0x6600('0x36')][_0x6600('0x41')]){_0x31736c['where']=_[_0x6600('0x42')](_0x31736c[_0x6600('0x3f')],{'$or':_[_0x6600('0x30')](_0x31736c[_0x6600('0x39')],function(_0x481b5a){var _0x5a8c22={};_0x5a8c22[_0x481b5a]={'$like':'%'+_0x43847d[_0x6600('0x36')][_0x6600('0x41')]+'%'};return _0x5a8c22;})});}_0x31736c=_[_0x6600('0x42')]({},_0x31736c,_0x43847d[_0x6600('0x43')]);return _0x2b69cf[_0x6600('0x68')](_0x31736c);}})['then'](respondWithResult(_0x54ff2b,null))[_0x6600('0x4b')](handleError(_0x54ff2b,null));};exports[_0x6600('0x6d')]=function(_0x282b5c,_0x55d017,_0x482ecf){var _0x34726c;var _0x13e770;var _0x337f67;var _0x58f840=_0x282b5c[_0x6600('0x49')]['id'];csv_results=[];return db[_0x6600('0x6e')][_0x6600('0x47')]({'attributes':['id',_0x6600('0x2e')],'raw':!![],'order':[_0x6600('0x6f')]})[_0x6600('0x27')](function(_0x1a15ac){_0x34726c=_0x1a15ac;var _0x10adb0=_[_0x6600('0x35')](db[_0x6600('0x5e')]['rawAttributes']);return db['CmCustomField'][_0x6600('0x47')]({'raw':!![],'attributes':['id',_0x6600('0x70')]})['then'](function(_0x689458){_0x13e770=_0x689458;var _0x5398c7=squel[_0x6600('0x71')]()[_0x6600('0x3a')](_0x10adb0)[_0x6600('0x72')](_0x6600('0x73'),'c')['where'](_0x6600('0x74'),_0x58f840)[_0x6600('0x3f')]('c.deletedAt\x20is\x20null')[_0x6600('0x75')]();for(var _0x2b6cba=0x0;_0x2b6cba<_0x13e770[_0x6600('0x3b')];_0x2b6cba++){_0x5398c7[_0x6600('0x76')](_0x6600('0x77')+_0x13e770[_0x2b6cba]['id'],_0x6600('0x78')+_0x13e770[_0x2b6cba][_0x6600('0x70')]);}for(var _0x2b6cba=0x0;_0x2b6cba<_0x34726c[_0x6600('0x3b')];_0x2b6cba++){_0x5398c7[_0x6600('0x76')](squel[_0x6600('0x71')]()[_0x6600('0x76')](_0x6600('0x79'))[_0x6600('0x72')](_0x6600('0x7a'))[_0x6600('0x3f')]('ItemTypeId\x20=\x20?',_0x34726c[_0x2b6cba]['id'])[_0x6600('0x3f')](_0x6600('0x7b')),_0x6600('0x7c')+_0x34726c[_0x2b6cba]['name']);_0x5398c7['field'](squel[_0x6600('0x71')]()[_0x6600('0x76')](_0x6600('0x7d'))[_0x6600('0x72')](_0x6600('0x7a'))[_0x6600('0x3f')](_0x6600('0x7e'),_0x34726c[_0x2b6cba]['id'])[_0x6600('0x3f')]('CmContactId\x20=\x20c.id'),_0x6600('0x7f')+_0x34726c[_0x2b6cba][_0x6600('0x2e')]);}var _0x1670bd=[];_0x1670bd[_0x6600('0x62')](_0x5398c7['toString']());BPromise[_0x6600('0x63')](_0x1670bd,handleQuery)[_0x6600('0x27')](function(_0x573449){handleQuery(_0x5398c7[_0x6600('0x80')]());var _0x5b41ea=csv_results[0x0];if(!_['isEmpty'](_0x5b41ea)){var _0x57b32a=toCsv(_0x5b41ea);var _0x493f0a=Date[_0x6600('0x81')]();fs[_0x6600('0x82')](util[_0x6600('0x83')](_0x6600('0x84'),_0x58f840,_0x493f0a),_0x57b32a);_0x55d017[_0x6600('0x85')]('Content-disposition',_0x6600('0x86')+util[_0x6600('0x83')](_0x6600('0x87'),_0x58f840,_0x493f0a));_0x55d017[_0x6600('0x85')]('Content-type',_0x6600('0x88'));return _0x55d017['download'](util[_0x6600('0x83')](_0x6600('0x84'),_0x58f840,_0x493f0a));}else{return _0x55d017[_0x6600('0x1c')](0xcc);}});});});};exports[_0x6600('0x89')]=function(_0x5cbb46,_0x30a0a0,_0x2187e2){var _0x45b30d;delete _0x5cbb46['body']['id'];return db[_0x6600('0x4d')][_0x6600('0x59')]({'where':{'id':_0x5cbb46['params']['id']}})[_0x6600('0x27')](handleEntityNotFound(_0x30a0a0,null))[_0x6600('0x27')](function(_0x407291){if(_0x407291){return db[_0x6600('0x8a')][_0x6600('0x8b')](function(_0x17f98b){return db[_0x6600('0x8c')]['create'](_0x5cbb46[_0x6600('0x4e')],{'transaction':_0x17f98b})[_0x6600('0x27')](function(_0x9f66a){_0x45b30d=_0x9f66a;return _0x407291[_0x6600('0x8d')](_0x9f66a,{'transaction':_0x17f98b});})[_0x6600('0x27')](function(){var _0x4e40d6={'type':db['Sequelize'][_0x6600('0x8e')],'transaction':_0x17f98b};switch(_0x5cbb46[_0x6600('0x4e')][_0x6600('0x32')]){case _0x6600('0x8f'):_0x4e40d6[_0x6600('0x32')]=db[_0x6600('0x90')][_0x6600('0x8e')];break;case _0x6600('0x91'):_0x4e40d6[_0x6600('0x32')]=db[_0x6600('0x90')]['INTEGER'];break;case _0x6600('0x92'):_0x4e40d6['type']=db[_0x6600('0x90')][_0x6600('0x93')];_0x4e40d6[_0x6600('0x94')]=![];break;default:}return db[_0x6600('0x8a')][_0x6600('0x95')][_0x6600('0x96')](_0x6600('0x73'),util['format'](_0x6600('0x97'),_0x45b30d['id']),_0x4e40d6);})['then'](function(){return _0x45b30d;});});}})[_0x6600('0x27')](respondWithResult(_0x30a0a0,null))['catch'](handleError(_0x30a0a0,null));};exports[_0x6600('0x98')]=function(_0x1453f4,_0x269081,_0x3e41e4){var _0x1abe98={};var _0x5f01a8={};var _0x4a99ad;var _0x485e86;return db[_0x6600('0x4d')]['findOne']({'where':{'id':_0x1453f4['params']['id']}})['then'](handleEntityNotFound(_0x269081,null))[_0x6600('0x27')](function(_0x27629f){if(_0x27629f){_0x4a99ad=_0x27629f;_0x5f01a8[_0x6600('0x34')]=_[_0x6600('0x35')](db['CmCustomField'][_0x6600('0x4a')]);_0x5f01a8[_0x6600('0x36')]=_[_0x6600('0x35')](_0x1453f4['query']);_0x5f01a8['filters']=_[_0x6600('0x38')](_0x5f01a8[_0x6600('0x34')],_0x5f01a8[_0x6600('0x36')]);_0x1abe98['attributes']=_[_0x6600('0x38')](_0x5f01a8[_0x6600('0x34')],qs[_0x6600('0x3a')](_0x1453f4[_0x6600('0x36')][_0x6600('0x3a')]));_0x1abe98[_0x6600('0x39')]=_0x1abe98[_0x6600('0x39')][_0x6600('0x3b')]?_0x1abe98[_0x6600('0x39')]:_0x5f01a8[_0x6600('0x34')];_0x1abe98[_0x6600('0x3d')]=qs[_0x6600('0x3e')](_0x1453f4[_0x6600('0x36')]['sort']);_0x1abe98[_0x6600('0x3f')]=qs['filters'](_[_0x6600('0x40')](_0x1453f4[_0x6600('0x36')],_0x5f01a8[_0x6600('0x37')]));_0x1abe98[_0x6600('0x3f')]=_[_0x6600('0x42')](_0x1abe98[_0x6600('0x3f')],{'$or':[{'ListId':_0x27629f['id']},{'ListId':null}]});if(_0x1453f4[_0x6600('0x36')][_0x6600('0x41')]){_0x1abe98[_0x6600('0x3f')]=_[_0x6600('0x42')](_0x1abe98[_0x6600('0x3f')],{'$or':_['map'](_0x1abe98[_0x6600('0x39')],function(_0x22ba39){var _0x4c6955={};_0x4c6955[_0x22ba39]={'$like':'%'+_0x1453f4['query']['filter']+'%'};return _0x4c6955;})});}_0x1abe98=_[_0x6600('0x42')]({},_0x1abe98,_0x1453f4['options']);return db[_0x6600('0x8c')][_0x6600('0x99')](_0x1abe98);}})[_0x6600('0x27')](respondWithResult(_0x269081,null))[_0x6600('0x4b')](handleError(_0x269081,null));};exports['getGlobalCustomFields']=function(_0x39a6b2,_0x37f7c3){return db['CmCustomField'][_0x6600('0x99')]({'where':{'ListId':null}})[_0x6600('0x27')](handleEntityNotFound(_0x37f7c3,null))[_0x6600('0x27')](function(_0xb0efc2){return _0xb0efc2;})[_0x6600('0x27')](respondWithResult(_0x37f7c3,null))[_0x6600('0x4b')](handleError(_0x37f7c3,null));};exports[_0x6600('0x9a')]=function(_0x16e50b,_0x2aa2ff,_0x49b571){return db['CmList'][_0x6600('0x51')]({'where':{'id':_0x16e50b[_0x6600('0x49')]['id']}})[_0x6600('0x27')](handleEntityNotFound(_0x2aa2ff,null))[_0x6600('0x27')](function(_0x681c){if(_0x681c){return _0x681c['addAgents'](_0x16e50b['body'][_0x6600('0x5c')],_[_0x6600('0x64')](_0x16e50b[_0x6600('0x4e')],['ids','id'])||{})[_0x6600('0x9b')](function(_0x1d14da){for(var _0x2375f5=0x0;_0x2375f5<_0x16e50b[_0x6600('0x4e')][_0x6600('0x5c')][_0x6600('0x3b')];_0x2375f5+=0x1){socket[_0x6600('0x9c')](_0x6600('0x9d'),{'UserId':Number(_0x16e50b['body'][_0x6600('0x5c')][_0x2375f5]),'CmListId':Number(_0x16e50b[_0x6600('0x49')]['id'])});}return _0x1d14da;});}})[_0x6600('0x27')](respondWithResult(_0x2aa2ff,null))['catch'](handleError(_0x2aa2ff,null));};exports[_0x6600('0x9e')]=function(_0x147155,_0x2b026d,_0x40928c){return db['CmList']['find']({'where':{'id':_0x147155[_0x6600('0x49')]['id']}})[_0x6600('0x27')](handleEntityNotFound(_0x2b026d,null))[_0x6600('0x27')](function(_0x4965eb){if(_0x4965eb){return _0x4965eb[_0x6600('0x9e')](_0x147155[_0x6600('0x36')][_0x6600('0x5c')])[_0x6600('0x27')](function(){if(_[_0x6600('0x60')](_0x147155['query'][_0x6600('0x5c')])){for(var _0x125b16=0x0;_0x125b16<_0x147155[_0x6600('0x36')][_0x6600('0x5c')][_0x6600('0x3b')];_0x125b16+=0x1){socket[_0x6600('0x9c')](_0x6600('0x9f'),{'UserId':Number(_0x147155[_0x6600('0x36')]['ids'][_0x125b16]),'CmListId':Number(_0x147155['params']['id'])});}}else{socket[_0x6600('0x9c')]('userCmList:remove',{'UserId':Number(_0x147155[_0x6600('0x36')][_0x6600('0x5c')]),'CmListId':Number(_0x147155[_0x6600('0x49')]['id'])});}});}})[_0x6600('0x27')](respondWithStatusCode(_0x2b026d,null))[_0x6600('0x4b')](handleError(_0x2b026d,null));};exports['getAgents']=function(_0x2c2230,_0x51668d,_0x21e8a8){var _0x3da8c6={};var _0x4869ee={};var _0xe33092;var _0x5ad5e0;return db[_0x6600('0x4d')][_0x6600('0x59')]({'where':{'id':_0x2c2230[_0x6600('0x49')]['id']}})[_0x6600('0x27')](handleEntityNotFound(_0x51668d,null))[_0x6600('0x27')](function(_0x16d1d2){if(_0x16d1d2){_0xe33092=_0x16d1d2;_0x4869ee[_0x6600('0x34')]=_[_0x6600('0x35')](db[_0x6600('0xa0')][_0x6600('0x4a')]);_0x4869ee[_0x6600('0x36')]=_[_0x6600('0x35')](_0x2c2230['query']);_0x4869ee[_0x6600('0x37')]=_[_0x6600('0x38')](_0x4869ee['model'],_0x4869ee[_0x6600('0x36')]);_0x3da8c6[_0x6600('0x39')]=_['intersection'](_0x4869ee[_0x6600('0x34')],qs['fields'](_0x2c2230['query'][_0x6600('0x3a')]));_0x3da8c6['attributes']=_0x3da8c6[_0x6600('0x39')]['length']?_0x3da8c6[_0x6600('0x39')]:_0x4869ee[_0x6600('0x34')];_0x3da8c6['order']=qs[_0x6600('0x3e')](_0x2c2230['query']['sort']);_0x3da8c6[_0x6600('0x3f')]=qs[_0x6600('0x37')](_['pick'](_0x2c2230[_0x6600('0x36')],_0x4869ee[_0x6600('0x37')]));if(_0x2c2230['query'][_0x6600('0x41')]){_0x3da8c6[_0x6600('0x3f')]=_[_0x6600('0x42')](_0x3da8c6[_0x6600('0x3f')],{'$or':_[_0x6600('0x30')](_0x3da8c6['attributes'],function(_0x1c0b75){var _0x51a7c6={};_0x51a7c6[_0x1c0b75]={'$like':'%'+_0x2c2230[_0x6600('0x36')][_0x6600('0x41')]+'%'};return _0x51a7c6;})});}_0x3da8c6=_[_0x6600('0x42')]({},_0x3da8c6,_0x2c2230['options']);return _0xe33092[_0x6600('0xa1')](_0x3da8c6);}})['then'](function(_0x8f09fb){if(_0x8f09fb){_0x5ad5e0=_0x8f09fb['length'];if(!_0x2c2230['query'][_0x6600('0x5a')](_0x6600('0x3c'))){_0x3da8c6[_0x6600('0x20')]=qs[_0x6600('0x20')](_0x2c2230[_0x6600('0x36')][_0x6600('0x20')]);_0x3da8c6[_0x6600('0x1f')]=qs[_0x6600('0x1f')](_0x2c2230[_0x6600('0x36')][_0x6600('0x1f')]);}return _0xe33092[_0x6600('0xa1')](_0x3da8c6);}})['then'](function(_0x5c9192){if(_0x5c9192){return _0x5c9192?{'count':_0x5ad5e0,'rows':_0x5c9192}:null;}})[_0x6600('0x27')](respondWithResult(_0x51668d,null))[_0x6600('0x4b')](handleError(_0x51668d,null));};function handleQuery(_0x29abfc){logger[_0x6600('0xa2')](_0x29abfc);return db[_0x6600('0x8a')]['query'](_0x29abfc)['spread'](function(_0xac6c1e){csv_results[_0x6600('0x62')](_0xac6c1e);})['catch'](function(_0x151d3b){logger[_0x6600('0x2c')](_0x151d3b[_0x6600('0xa3')]);});}
\ No newline at end of file
index f77fbb7..5328a3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0xe4957,_0x4532de){_0xe4957=_0xe4957-0x0;var _0x41e100=_0x326f[_0xe4957];return _0x41e100;};'use strict';var EventEmitter=require(_0xf326('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){CmListEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);CmListEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=CmListEvents;
\ No newline at end of file
+var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x55057d,_0x3fadf1){_0x55057d=_0x55057d-0x0;var _0x5f174e=_0x3e74[_0x55057d];return _0x5f174e;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents;
\ No newline at end of file
index fa67475..2165d1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd28=['rimraf','./cmList.attributes','exports','define','util','../../config/logger','moment','request-promise','path'];(function(_0x2f9043,_0x25fb0c){var _0x32e274=function(_0x5a4e8a){while(--_0x5a4e8a){_0x2f9043['push'](_0x2f9043['shift']());}};_0x32e274(++_0x25fb0c);}(_0xfd28,0x148));var _0x8fd2=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0xfd28[_0x5d860f];return _0x236490;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var logger=require(_0x8fd2('0x1'))('api');var moment=require(_0x8fd2('0x2'));var BPromise=require('bluebird');var rp=require(_0x8fd2('0x3'));var fs=require('fs');var path=require(_0x8fd2('0x4'));var rimraf=require(_0x8fd2('0x5'));var config=require('../../config/environment');var attributes=require(_0x8fd2('0x6'));module[_0x8fd2('0x7')]=function(_0x2ee87e,_0x36178a){return _0x2ee87e[_0x8fd2('0x8')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2750=['rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x40a0e5,_0x57e428){var _0x2db48a=function(_0x5c5124){while(--_0x5c5124){_0x40a0e5['push'](_0x40a0e5['shift']());}};_0x2db48a(++_0x57e428);}(_0x2750,0x13b));var _0x0275=function(_0x37f4b1,_0x46c52f){_0x37f4b1=_0x37f4b1-0x0;var _0x174868=_0x2750[_0x37f4b1];return _0x174868;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var moment=require(_0x0275('0x3'));var BPromise=require(_0x0275('0x4'));var rp=require(_0x0275('0x5'));var fs=require('fs');var path=require(_0x0275('0x6'));var rimraf=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var attributes=require(_0x0275('0x9'));module[_0x0275('0xa')]=function(_0x5953f9,_0x3f645f){return _0x5953f9[_0x0275('0xb')](_0x0275('0xc'),attributes,{'tableName':_0x0275('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ce925f9..a194f60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaab2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xaab2,0x89));var _0x2aab=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xaab2[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x2aab('0x0'));var util=require(_0x2aab('0x1'));var moment=require(_0x2aab('0x2'));var BPromise=require(_0x2aab('0x3'));var rs=require(_0x2aab('0x4'));var fs=require('fs');var Redis=require(_0x2aab('0x5'));var db=require(_0x2aab('0x6'))['db'];var utils=require(_0x2aab('0x7'));var logger=require(_0x2aab('0x8'))(_0x2aab('0x9'));var config=require(_0x2aab('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2aab('0xb')]({'port':0x232a});config[_0x2aab('0xc')]=_[_0x2aab('0xd')](config[_0x2aab('0xc')],{'host':_0x2aab('0xe'),'port':0x18eb});var socket=require(_0x2aab('0xf'))(new Redis(config[_0x2aab('0xc')]));require(_0x2aab('0x10'))['register'](socket);function respondWithRpcPromise(_0x106125,_0x20d770,_0x31cd2d){return new BPromise(function(_0x2f70c9,_0xaf0638){return client[_0x2aab('0x11')](_0x106125,_0x31cd2d)[_0x2aab('0x12')](function(_0x1b132c){logger['info'](_0x2aab('0x13'),_0x20d770,_0x2aab('0x14'));logger[_0x2aab('0x15')]('CmList,\x20%s,\x20%s,\x20%s',_0x20d770,_0x2aab('0x14'),JSON[_0x2aab('0x16')](_0x1b132c));if(_0x1b132c['error']){if(_0x1b132c[_0x2aab('0x17')][_0x2aab('0x18')]===0x1f4){logger[_0x2aab('0x17')]('CmList,\x20%s,\x20%s',_0x20d770,_0x1b132c[_0x2aab('0x17')][_0x2aab('0x19')]);return _0xaf0638(_0x1b132c[_0x2aab('0x17')][_0x2aab('0x19')]);}logger[_0x2aab('0x17')]('CmList,\x20%s,\x20%s',_0x20d770,_0x1b132c[_0x2aab('0x17')][_0x2aab('0x19')]);return _0x2f70c9(_0x1b132c[_0x2aab('0x17')]['message']);}else{logger['info'](_0x2aab('0x13'),_0x20d770,_0x2aab('0x14'));_0x2f70c9(_0x1b132c[_0x2aab('0x1a')]['message']);}})[_0x2aab('0x1b')](function(_0x55e49c){logger[_0x2aab('0x17')](_0x2aab('0x13'),_0x20d770,_0x55e49c);_0xaf0638(_0x55e49c);});});}
\ No newline at end of file
+var _0xd96f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','socket.io-emitter','./cmList.socket','register','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x51d499,_0x59d568){var _0x342e2b=function(_0x22a728){while(--_0x22a728){_0x51d499['push'](_0x51d499['shift']());}};_0x342e2b(++_0x59d568);}(_0xd96f,0xff));var _0xfd96=function(_0x1a89fd,_0x4e645d){_0x1a89fd=_0x1a89fd-0x0;var _0x325a14=_0xd96f[_0x1a89fd];return _0x325a14;};'use strict';var _=require(_0xfd96('0x0'));var util=require(_0xfd96('0x1'));var moment=require(_0xfd96('0x2'));var BPromise=require(_0xfd96('0x3'));var rs=require(_0xfd96('0x4'));var fs=require('fs');var Redis=require(_0xfd96('0x5'));var db=require(_0xfd96('0x6'))['db'];var utils=require(_0xfd96('0x7'));var logger=require(_0xfd96('0x8'))('rpc');var config=require(_0xfd96('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfd96('0xa')]({'port':0x232a});config[_0xfd96('0xb')]=_['defaults'](config[_0xfd96('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xfd96('0xc'))(new Redis(config['redis']));require(_0xfd96('0xd'))[_0xfd96('0xe')](socket);function respondWithRpcPromise(_0x45620f,_0x53409d,_0x2c4913){return new BPromise(function(_0x5a1fe4,_0x42b252){return client['request'](_0x45620f,_0x2c4913)[_0xfd96('0xf')](function(_0x5a298c){logger[_0xfd96('0x10')](_0xfd96('0x11'),_0x53409d,_0xfd96('0x12'));logger[_0xfd96('0x13')](_0xfd96('0x14'),_0x53409d,'request\x20sent',JSON['stringify'](_0x5a298c));if(_0x5a298c[_0xfd96('0x15')]){if(_0x5a298c[_0xfd96('0x15')][_0xfd96('0x16')]===0x1f4){logger[_0xfd96('0x15')](_0xfd96('0x11'),_0x53409d,_0x5a298c[_0xfd96('0x15')][_0xfd96('0x17')]);return _0x42b252(_0x5a298c[_0xfd96('0x15')]['message']);}logger[_0xfd96('0x15')]('CmList,\x20%s,\x20%s',_0x53409d,_0x5a298c['error']['message']);return _0x5a1fe4(_0x5a298c[_0xfd96('0x15')][_0xfd96('0x17')]);}else{logger[_0xfd96('0x10')](_0xfd96('0x11'),_0x53409d,'request\x20sent');_0x5a1fe4(_0x5a298c[_0xfd96('0x18')][_0xfd96('0x17')]);}})[_0xfd96('0x19')](function(_0x3b3884){logger[_0xfd96('0x15')]('CmList,\x20%s,\x20%s',_0x53409d,_0x3b3884);_0x42b252(_0x3b3884);});});}
\ No newline at end of file
index 726e7ff..8187aab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3f1=['length','cmList:','./cmList.events','save','update','emit','removeListener','register'];(function(_0x264b69,_0x52b041){var _0x42746e=function(_0x3855a2){while(--_0x3855a2){_0x264b69['push'](_0x264b69['shift']());}};_0x42746e(++_0x52b041);}(_0xb3f1,0xda));var _0x1b3f=function(_0x271eec,_0x3a32c6){_0x271eec=_0x271eec-0x0;var _0x2aca74=_0xb3f1[_0x271eec];return _0x2aca74;};'use strict';var CmListEvents=require(_0x1b3f('0x0'));var events=[_0x1b3f('0x1'),'remove',_0x1b3f('0x2')];function createListener(_0x5ba0b1,_0x32562a){return function(_0x228b32){_0x32562a[_0x1b3f('0x3')](_0x5ba0b1,_0x228b32);};}function removeListener(_0xf6ce88,_0x1467bf){return function(){CmListEvents[_0x1b3f('0x4')](_0xf6ce88,_0x1467bf);};}exports[_0x1b3f('0x5')]=function(_0x559f67){for(var _0x20ba83=0x0,_0x57a5a5=events[_0x1b3f('0x6')];_0x20ba83<_0x57a5a5;_0x20ba83++){var _0x358928=events[_0x20ba83];var _0x56157b=createListener(_0x1b3f('0x7')+_0x358928,_0x559f67);CmListEvents['on'](_0x358928,_0x56157b);}};
\ No newline at end of file
+var _0x7bee=['length','cmList:','save','remove','update','emit','removeListener'];(function(_0x510794,_0x120e85){var _0x3bd818=function(_0x34fab5){while(--_0x34fab5){_0x510794['push'](_0x510794['shift']());}};_0x3bd818(++_0x120e85);}(_0x7bee,0x13d));var _0xe7be=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7bee[_0x321bb2];return _0x9c12ed;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xe7be('0x0'),_0xe7be('0x1'),_0xe7be('0x2')];function createListener(_0x30cc00,_0x3d4282){return function(_0x590b88){_0x3d4282[_0xe7be('0x3')](_0x30cc00,_0x590b88);};}function removeListener(_0xdb373e,_0x47a88e){return function(){CmListEvents[_0xe7be('0x4')](_0xdb373e,_0x47a88e);};}exports['register']=function(_0x4d8520){for(var _0x16eab1=0x0,_0x554764=events[_0xe7be('0x5')];_0x16eab1<_0x554764;_0x16eab1++){var _0x595be3=events[_0x16eab1];var _0x1d5cff=createListener(_0xe7be('0x6')+_0x595be3,_0x4d8520);CmListEvents['on'](_0x595be3,_0x1d5cff);}};
\ No newline at end of file
index aa5ecc5..c1655d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb1a=['getCustomFields','/:id/users','getAgents','post','addDisposition','addContacts','addCustomField','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','index','isAuthenticated','describe','/global_fields','getGlobalCustomFields','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv'];(function(_0x478c71,_0x256526){var _0x50c512=function(_0x358f69){while(--_0x358f69){_0x478c71['push'](_0x478c71['shift']());}};_0x50c512(++_0x256526);}(_0xeb1a,0x102));var _0xaeb1=function(_0x56d20e,_0x217c31){_0x56d20e=_0x56d20e-0x0;var _0x18b27a=_0xeb1a[_0x56d20e];return _0x18b27a;};'use strict';var multer=require(_0xaeb1('0x0'));var util=require(_0xaeb1('0x1'));var path=require(_0xaeb1('0x2'));var timeout=require(_0xaeb1('0x3'));var express=require(_0xaeb1('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaeb1('0x5'));var interaction=require(_0xaeb1('0x6'));var config=require(_0xaeb1('0x7'));var controller=require(_0xaeb1('0x8'));router[_0xaeb1('0x9')]('/',auth['isAuthenticated'](),controller[_0xaeb1('0xa')]);router[_0xaeb1('0x9')]('/describe',auth[_0xaeb1('0xb')](),controller[_0xaeb1('0xc')]);router[_0xaeb1('0x9')](_0xaeb1('0xd'),auth[_0xaeb1('0xb')](),controller[_0xaeb1('0xe')]);router[_0xaeb1('0x9')](_0xaeb1('0xf'),auth[_0xaeb1('0xb')](),controller['show']);router[_0xaeb1('0x9')](_0xaeb1('0x10'),auth[_0xaeb1('0xb')](),controller[_0xaeb1('0x11')]);router[_0xaeb1('0x9')](_0xaeb1('0x12'),auth['isAuthenticated'](),controller[_0xaeb1('0x13')]);router['get'](_0xaeb1('0x14'),auth[_0xaeb1('0xb')](),controller[_0xaeb1('0x15')]);router[_0xaeb1('0x9')]('/:id/fields',auth[_0xaeb1('0xb')](),controller[_0xaeb1('0x16')]);router[_0xaeb1('0x9')](_0xaeb1('0x17'),auth[_0xaeb1('0xb')](),controller[_0xaeb1('0x18')]);router[_0xaeb1('0x19')]('/',auth[_0xaeb1('0xb')](),controller['create']);router[_0xaeb1('0x19')]('/:id/dispositions',auth[_0xaeb1('0xb')](),controller[_0xaeb1('0x1a')]);router['post'](_0xaeb1('0x12'),auth[_0xaeb1('0xb')](),controller[_0xaeb1('0x1b')]);router[_0xaeb1('0x19')]('/:id/fields',auth[_0xaeb1('0xb')](),controller[_0xaeb1('0x1c')]);router[_0xaeb1('0x19')](_0xaeb1('0x17'),auth[_0xaeb1('0xb')](),controller['addAgents']);router['put'](_0xaeb1('0xf'),auth[_0xaeb1('0xb')](),controller[_0xaeb1('0x1d')]);router[_0xaeb1('0x1e')]('/:id',auth[_0xaeb1('0xb')](),controller[_0xaeb1('0x1f')]);router[_0xaeb1('0x1e')](_0xaeb1('0x10'),auth[_0xaeb1('0xb')](),controller[_0xaeb1('0x20')]);router[_0xaeb1('0x1e')](_0xaeb1('0x17'),auth[_0xaeb1('0xb')](),controller[_0xaeb1('0x21')]);module[_0xaeb1('0x22')]=router;
\ No newline at end of file
+var _0x7576=['get','isAuthenticated','index','/global_fields','getGlobalCustomFields','show','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/users','getAgents','post','addDisposition','/:id/contacts','addContacts','addCustomField','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller'];(function(_0x19f538,_0x33b08a){var _0x18411b=function(_0x559f7f){while(--_0x559f7f){_0x19f538['push'](_0x19f538['shift']());}};_0x18411b(++_0x33b08a);}(_0x7576,0x1d8));var _0x6757=function(_0x79345f,_0x3846b9){_0x79345f=_0x79345f-0x0;var _0x478924=_0x7576[_0x79345f];return _0x478924;};'use strict';var multer=require(_0x6757('0x0'));var util=require('util');var path=require(_0x6757('0x1'));var timeout=require('connect-timeout');var express=require(_0x6757('0x2'));var router=express[_0x6757('0x3')]();var fs_extra=require(_0x6757('0x4'));var auth=require(_0x6757('0x5'));var interaction=require(_0x6757('0x6'));var config=require('../../config/environment');var controller=require(_0x6757('0x7'));router[_0x6757('0x8')]('/',auth[_0x6757('0x9')](),controller[_0x6757('0xa')]);router['get']('/describe',auth[_0x6757('0x9')](),controller['describe']);router['get'](_0x6757('0xb'),auth[_0x6757('0x9')](),controller[_0x6757('0xc')]);router[_0x6757('0x8')]('/:id',auth[_0x6757('0x9')](),controller[_0x6757('0xd')]);router['get']('/:id/dispositions',auth[_0x6757('0x9')](),controller[_0x6757('0xe')]);router[_0x6757('0x8')]('/:id/contacts',auth[_0x6757('0x9')](),controller[_0x6757('0xf')]);router['get'](_0x6757('0x10'),auth[_0x6757('0x9')](),controller[_0x6757('0x11')]);router[_0x6757('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getCustomFields']);router[_0x6757('0x8')](_0x6757('0x12'),auth[_0x6757('0x9')](),controller[_0x6757('0x13')]);router[_0x6757('0x14')]('/',auth[_0x6757('0x9')](),controller['create']);router[_0x6757('0x14')]('/:id/dispositions',auth[_0x6757('0x9')](),controller[_0x6757('0x15')]);router[_0x6757('0x14')](_0x6757('0x16'),auth[_0x6757('0x9')](),controller[_0x6757('0x17')]);router[_0x6757('0x14')]('/:id/fields',auth[_0x6757('0x9')](),controller[_0x6757('0x18')]);router[_0x6757('0x14')](_0x6757('0x12'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x6757('0x19'),auth[_0x6757('0x9')](),controller[_0x6757('0x1a')]);router[_0x6757('0x1b')](_0x6757('0x19'),auth[_0x6757('0x9')](),controller[_0x6757('0x1c')]);router[_0x6757('0x1b')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x6757('0x1d')]);router[_0x6757('0x1b')](_0x6757('0x12'),auth[_0x6757('0x9')](),controller[_0x6757('0x1e')]);module[_0x6757('0x1f')]=router;
\ No newline at end of file
index 6748e67..21eacec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x829b=['VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x497077,_0x98d60e){var _0x2c0f12=function(_0x5a1b8b){while(--_0x5a1b8b){_0x497077['push'](_0x497077['shift']());}};_0x2c0f12(++_0x98d60e);}(_0x829b,0xf4));var _0xb829=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x829b[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0xb829('0x0'));module['exports']={'name':{'type':Sequelize[_0xb829('0x1')],'get':function(_0x534f28){return this[_0xb829('0x2')](_0xb829('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xb829('0x4')],'allowNull':![]}};
\ No newline at end of file
+var _0xd006=['getDataValue','STRING','sequelize','exports','VIRTUAL'];(function(_0x801bdb,_0x261b61){var _0xfe915c=function(_0x5ad212){while(--_0x5ad212){_0x801bdb['push'](_0x801bdb['shift']());}};_0xfe915c(++_0x261b61);}(_0xd006,0x75));var _0x6d00=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xd006[_0x176329];return _0x31997c;};'use strict';var Sequelize=require(_0x6d00('0x0'));module[_0x6d00('0x1')]={'name':{'type':Sequelize[_0x6d00('0x2')],'get':function(_0x38e716){return this[_0x6d00('0x3')]('field');}},'field':{'type':Sequelize[_0x6d00('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x6d00('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x6d00('0x4')],'allowNull':![]}};
\ No newline at end of file
index 54e07c5..72a2042 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(_0x4c8da2,_0x315a0a){var _0x3f28b7=function(_0xdc95bc){while(--_0xdc95bc){_0x4c8da2['push'](_0x4c8da2['shift']());}};_0x3f28b7(++_0x315a0a);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
+var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x525831,_0x413d68){var _0x48d66e=function(_0x405617){while(--_0x405617){_0x525831['push'](_0x525831['shift']());}};_0x48d66e(++_0x413d68);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
index 53125ef..5980991 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ddb=['bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','util','../../config/logger'];(function(_0x489aa9,_0x178277){var _0x590137=function(_0x2d3798){while(--_0x2d3798){_0x489aa9['push'](_0x489aa9['shift']());}};_0x590137(++_0x178277);}(_0x5ddb,0x12a));var _0xb5dd=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5ddb[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0xb5dd('0x0'));var logger=require(_0xb5dd('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb5dd('0x2'));var rp=require(_0xb5dd('0x3'));var fs=require('fs');var path=require(_0xb5dd('0x4'));var rimraf=require(_0xb5dd('0x5'));var config=require(_0xb5dd('0x6'));var attributes=require(_0xb5dd('0x7'));module[_0xb5dd('0x8')]=function(_0x48f8be,_0x7a8339){return _0x48f8be[_0xb5dd('0x9')](_0xb5dd('0xa'),attributes,{'tableName':_0xb5dd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x746c=['util','api','bluebird','path','rimraf','./condition.attributes','Condition','tools_conditions'];(function(_0xb044f5,_0x1ba185){var _0x2f9624=function(_0xa8dae){while(--_0xa8dae){_0xb044f5['push'](_0xb044f5['shift']());}};_0x2f9624(++_0x1ba185);}(_0x746c,0x170));var _0xc746=function(_0x44f333,_0x2ef3a3){_0x44f333=_0x44f333-0x0;var _0x3d1fe2=_0x746c[_0x44f333];return _0x3d1fe2;};'use strict';var _=require('lodash');var util=require(_0xc746('0x0'));var logger=require('../../config/logger')(_0xc746('0x1'));var moment=require('moment');var BPromise=require(_0xc746('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc746('0x3'));var rimraf=require(_0xc746('0x4'));var config=require('../../config/environment');var attributes=require(_0xc746('0x5'));module['exports']=function(_0x2b8845,_0x15f58e){return _0x2b8845['define'](_0xc746('0x6'),attributes,{'tableName':_0xc746('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9f1ed31..5a9b8d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50b9=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','catch','util'];(function(_0x1ab683,_0x27030b){var _0x357546=function(_0x29a6b0){while(--_0x29a6b0){_0x1ab683['push'](_0x1ab683['shift']());}};_0x357546(++_0x27030b);}(_0x50b9,0x117));var _0x950b=function(_0x2064c8,_0x168039){_0x2064c8=_0x2064c8-0x0;var _0x23af73=_0x50b9[_0x2064c8];return _0x23af73;};'use strict';var _=require('lodash');var util=require(_0x950b('0x0'));var moment=require(_0x950b('0x1'));var BPromise=require(_0x950b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x950b('0x3'));var db=require(_0x950b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x950b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x950b('0x6'));var client=jayson[_0x950b('0x7')][_0x950b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1401db,_0xbd124,_0x5169b9){return new BPromise(function(_0x4263a6,_0x13b163){return client[_0x950b('0x9')](_0x1401db,_0x5169b9)[_0x950b('0xa')](function(_0x548cdf){logger[_0x950b('0xb')]('Condition,\x20%s,\x20%s',_0xbd124,_0x950b('0xc'));logger['debug'](_0x950b('0xd'),_0xbd124,_0x950b('0xc'),JSON[_0x950b('0xe')](_0x548cdf));if(_0x548cdf[_0x950b('0xf')]){if(_0x548cdf[_0x950b('0xf')][_0x950b('0x10')]===0x1f4){logger[_0x950b('0xf')](_0x950b('0x11'),_0xbd124,_0x548cdf[_0x950b('0xf')][_0x950b('0x12')]);return _0x13b163(_0x548cdf[_0x950b('0xf')][_0x950b('0x12')]);}logger[_0x950b('0xf')](_0x950b('0x11'),_0xbd124,_0x548cdf[_0x950b('0xf')]['message']);return _0x4263a6(_0x548cdf[_0x950b('0xf')]['message']);}else{logger['info'](_0x950b('0x11'),_0xbd124,_0x950b('0xc'));_0x4263a6(_0x548cdf['result']['message']);}})[_0x950b('0x13')](function(_0x1f183e){logger[_0x950b('0xf')](_0x950b('0x11'),_0xbd124,_0x1f183e);_0x13b163(_0x1f183e);});});}
\ No newline at end of file
+var _0x182d=['util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash'];(function(_0x9c00aa,_0x17dd0a){var _0xb3dbda=function(_0x359e75){while(--_0x359e75){_0x9c00aa['push'](_0x9c00aa['shift']());}};_0xb3dbda(++_0x17dd0a);}(_0x182d,0x1cd));var _0xd182=function(_0x31a827,_0x193483){_0x31a827=_0x31a827-0x0;var _0x4cfdda=_0x182d[_0x31a827];return _0x4cfdda;};'use strict';var _=require(_0xd182('0x0'));var util=require(_0xd182('0x1'));var moment=require(_0xd182('0x2'));var BPromise=require('bluebird');var rs=require(_0xd182('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd182('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd182('0x5'))(_0xd182('0x6'));var config=require(_0xd182('0x7'));var jayson=require(_0xd182('0x8'));var client=jayson[_0xd182('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3608aa,_0x186662,_0x133d24){return new BPromise(function(_0xbdd4cd,_0x517d4c){return client[_0xd182('0xa')](_0x3608aa,_0x133d24)['then'](function(_0x36f0fd){logger['info'](_0xd182('0xb'),_0x186662,_0xd182('0xc'));logger[_0xd182('0xd')](_0xd182('0xe'),_0x186662,_0xd182('0xc'),JSON[_0xd182('0xf')](_0x36f0fd));if(_0x36f0fd[_0xd182('0x10')]){if(_0x36f0fd['error']['code']===0x1f4){logger[_0xd182('0x10')](_0xd182('0xb'),_0x186662,_0x36f0fd[_0xd182('0x10')][_0xd182('0x11')]);return _0x517d4c(_0x36f0fd[_0xd182('0x10')][_0xd182('0x11')]);}logger[_0xd182('0x10')](_0xd182('0xb'),_0x186662,_0x36f0fd[_0xd182('0x10')][_0xd182('0x11')]);return _0xbdd4cd(_0x36f0fd[_0xd182('0x10')]['message']);}else{logger[_0xd182('0x12')]('Condition,\x20%s,\x20%s',_0x186662,_0xd182('0xc'));_0xbdd4cd(_0x36f0fd[_0xd182('0x13')][_0xd182('0x11')]);}})[_0xd182('0x14')](function(_0x300488){logger[_0xd182('0x10')](_0xd182('0xb'),_0x186662,_0x300488);_0x517d4c(_0x300488);});});}
\ No newline at end of file
index 376a349..90afce8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88d7=['put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./condition.controller'];(function(_0x224f2e,_0x46fc46){var _0x33c0ed=function(_0xbc2183){while(--_0xbc2183){_0x224f2e['push'](_0x224f2e['shift']());}};_0x33c0ed(++_0x46fc46);}(_0x88d7,0x70));var _0x788d=function(_0x12201f,_0x5979c1){_0x12201f=_0x12201f-0x0;var _0x31fa74=_0x88d7[_0x12201f];return _0x31fa74;};'use strict';var multer=require(_0x788d('0x0'));var util=require(_0x788d('0x1'));var path=require(_0x788d('0x2'));var timeout=require('connect-timeout');var express=require(_0x788d('0x3'));var router=express[_0x788d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x788d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x788d('0x6'));var controller=require(_0x788d('0x7'));router[_0x788d('0x8')](_0x788d('0x9'),auth[_0x788d('0xa')](),controller[_0x788d('0xb')]);router[_0x788d('0xc')]('/:id',auth[_0x788d('0xa')](),controller[_0x788d('0xd')]);module[_0x788d('0xe')]=router;
\ No newline at end of file
+var _0x05c6=['../../config/environment','put','/:id','isAuthenticated','update','destroy','exports','util','express','../../components/auth/service'];(function(_0x2718b8,_0x2268e3){var _0xc9c5e1=function(_0x3b7e51){while(--_0x3b7e51){_0x2718b8['push'](_0x2718b8['shift']());}};_0xc9c5e1(++_0x2268e3);}(_0x05c6,0xb1));var _0x605c=function(_0x5b18f0,_0x1479e2){_0x5b18f0=_0x5b18f0-0x0;var _0x4a3a5c=_0x05c6[_0x5b18f0];return _0x4a3a5c;};'use strict';var multer=require('multer');var util=require(_0x605c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x605c('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x605c('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x605c('0x3'));var controller=require('./condition.controller');router[_0x605c('0x4')](_0x605c('0x5'),auth[_0x605c('0x6')](),controller[_0x605c('0x7')]);router['delete'](_0x605c('0x5'),auth[_0x605c('0x6')](),controller[_0x605c('0x8')]);module[_0x605c('0x9')]=router;
\ No newline at end of file
index 0e2eaf1..c95c5bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82cf=['exports','STRING'];(function(_0x6e89c,_0x293c05){var _0x407123=function(_0x25dd06){while(--_0x25dd06){_0x6e89c['push'](_0x6e89c['shift']());}};_0x407123(++_0x293c05);}(_0x82cf,0xc8));var _0xf82c=function(_0x2cd1fb,_0x291f55){_0x2cd1fb=_0x2cd1fb-0x0;var _0x48fd2b=_0x82cf[_0x2cd1fb];return _0x48fd2b;};'use strict';var Sequelize=require('sequelize');module[_0xf82c('0x0')]={'name':{'type':Sequelize[_0xf82c('0x1')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xf82c('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0x1dbb=['STRING','name','INTEGER','sequelize','exports'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x1dbb,0x102));var _0xb1db=function(_0x3ecfc1,_0x5f1788){_0x3ecfc1=_0x3ecfc1-0x0;var _0x21c0ce=_0x1dbb[_0x3ecfc1];return _0x21c0ce;};'use strict';var Sequelize=require(_0xb1db('0x0'));module[_0xb1db('0x1')]={'name':{'type':Sequelize[_0xb1db('0x2')],'allowNull':![],'unique':_0xb1db('0x3')},'OrderBy':{'type':Sequelize[_0xb1db('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index 689ece5..07f0c57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda2d=['sort','where','filter','map','options','includeAll','rows','catch','rawAttributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','stack','name','send','index','ContactItemType','type','model','keys','query','filters','intersection','attributes','fields','length','order'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xda2d,0x102));var _0xdda2=function(_0x26ddeb,_0x42e2f6){_0x26ddeb=_0x26ddeb-0x0;var _0xe15e78=_0xda2d[_0x26ddeb];return _0xe15e78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdda2('0x0'));var zipdir=require(_0xdda2('0x1'));var jsonpatch=require(_0xdda2('0x2'));var rp=require(_0xdda2('0x3'));var moment=require(_0xdda2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdda2('0x5'));var sox=require(_0xdda2('0x6'));var csv=require(_0xdda2('0x7'));var ejs=require(_0xdda2('0x8'));var fs=require('fs');var fs_extra=require(_0xdda2('0x9'));var _=require(_0xdda2('0xa'));var squel=require(_0xdda2('0xb'));var crypto=require(_0xdda2('0xc'));var jsforce=require(_0xdda2('0xd'));var deskjs=require(_0xdda2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdda2('0xf'));var Papa=require(_0xdda2('0x10'));var Redis=require('ioredis');var authService=require(_0xdda2('0x11'));var qs=require(_0xdda2('0x12'));var as=require(_0xdda2('0x13'));var hardwareService=require(_0xdda2('0x14'));var logger=require(_0xdda2('0x15'))(_0xdda2('0x16'));var utils=require(_0xdda2('0x17'));var config=require(_0xdda2('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56d25d,_0xa6446b){_0xa6446b=_0xa6446b||0xcc;return function(_0x320f73){if(_0x320f73){return _0x56d25d[_0xdda2('0x19')](_0xa6446b);}return _0x56d25d[_0xdda2('0x1a')](_0xa6446b)[_0xdda2('0x1b')]();};}function respondWithResult(_0x475222,_0x3490f1){_0x3490f1=_0x3490f1||0xc8;return function(_0x4df902){if(_0x4df902){return _0x475222[_0xdda2('0x1a')](_0x3490f1)['json'](_0x4df902);}};}function respondWithFilteredResult(_0xbef148,_0xb6b01e){return function(_0x3553d5){if(_0x3553d5){var _0x457764=typeof _0xb6b01e[_0xdda2('0x1c')]==='undefined'&&typeof _0xb6b01e['limit']===_0xdda2('0x1d');var _0x518c6d=_0x3553d5[_0xdda2('0x1e')];var _0x1a3b35=_0x457764?0x0:_0xb6b01e[_0xdda2('0x1c')];var _0x2b6ee8=_0x457764?_0x3553d5[_0xdda2('0x1e')]:_0xb6b01e[_0xdda2('0x1c')]+_0xb6b01e[_0xdda2('0x1f')];var _0x351151;if(_0x2b6ee8>=_0x518c6d){_0x2b6ee8=_0x518c6d;_0x351151=0xc8;}else{_0x351151=0xce;}_0xbef148[_0xdda2('0x1a')](_0x351151);return _0xbef148[_0xdda2('0x20')](_0xdda2('0x21'),_0x1a3b35+'-'+_0x2b6ee8+'/'+_0x518c6d)[_0xdda2('0x22')](_0x3553d5);}return null;};}function patchUpdates(_0x4eed30){return function(_0x41fe7d){try{jsonpatch['apply'](_0x41fe7d,_0x4eed30,!![]);}catch(_0xc4567c){return BPromise[_0xdda2('0x23')](_0xc4567c);}return _0x41fe7d[_0xdda2('0x24')]();};}function saveUpdates(_0x4c5226,_0x347ee6){return function(_0x5a9bb8){if(_0x5a9bb8){return _0x5a9bb8[_0xdda2('0x25')](_0x4c5226)[_0xdda2('0x26')](function(_0x4ac3eb){return _0x4ac3eb;});}return null;};}function removeEntity(_0x144f1e,_0xfda248){return function(_0x2528d7){if(_0x2528d7){return _0x2528d7[_0xdda2('0x27')]()[_0xdda2('0x26')](function(){var _0x5739ad=_0x2528d7[_0xdda2('0x28')]({'plain':!![]});var _0x4be5ea=_0xdda2('0x29');return db[_0xdda2('0x2a')]['destroy']({'where':{'type':_0x4be5ea,'resourceId':_0x5739ad['id']}})['then'](function(){return _0x2528d7;});})[_0xdda2('0x26')](function(){_0x144f1e[_0xdda2('0x1a')](0xcc)[_0xdda2('0x1b')]();});}};}function handleEntityNotFound(_0x5e9e74,_0x90d919){return function(_0x5d26ae){if(!_0x5d26ae){_0x5e9e74[_0xdda2('0x19')](0x194);}return _0x5d26ae;};}function handleError(_0xe53dee,_0xe16ec7){_0xe16ec7=_0xe16ec7||0x1f4;return function(_0x91b41a){logger['error'](_0x91b41a[_0xdda2('0x2b')]);if(_0x91b41a[_0xdda2('0x2c')]){delete _0x91b41a['name'];}_0xe53dee[_0xdda2('0x1a')](_0xe16ec7)[_0xdda2('0x2d')](_0x91b41a);};}exports[_0xdda2('0x2e')]=function(_0x15e511,_0x5540e5){var _0x129eba={},_0x5e107f={},_0x4b19b7={'count':0x0,'rows':[]};var _0x1ca9f3=_['map'](db[_0xdda2('0x2f')]['rawAttributes'],function(_0x53ff76){return{'name':_0x53ff76['fieldName'],'type':_0x53ff76[_0xdda2('0x30')]['key']};});_0x5e107f[_0xdda2('0x31')]=_['map'](_0x1ca9f3,'name');_0x5e107f['query']=_[_0xdda2('0x32')](_0x15e511[_0xdda2('0x33')]);_0x5e107f[_0xdda2('0x34')]=_[_0xdda2('0x35')](_0x5e107f[_0xdda2('0x31')],_0x5e107f[_0xdda2('0x33')]);_0x129eba[_0xdda2('0x36')]=_[_0xdda2('0x35')](_0x5e107f[_0xdda2('0x31')],qs[_0xdda2('0x37')](_0x15e511['query'][_0xdda2('0x37')]));_0x129eba[_0xdda2('0x36')]=_0x129eba[_0xdda2('0x36')][_0xdda2('0x38')]?_0x129eba[_0xdda2('0x36')]:_0x5e107f[_0xdda2('0x31')];if(!_0x15e511[_0xdda2('0x33')]['hasOwnProperty']('nolimit')){_0x129eba[_0xdda2('0x1f')]=qs[_0xdda2('0x1f')](_0x15e511[_0xdda2('0x33')]['limit']);_0x129eba['offset']=qs[_0xdda2('0x1c')](_0x15e511[_0xdda2('0x33')][_0xdda2('0x1c')]);}_0x129eba[_0xdda2('0x39')]=qs[_0xdda2('0x3a')](_0x15e511['query'][_0xdda2('0x3a')]);_0x129eba[_0xdda2('0x3b')]=qs['filters'](_['pick'](_0x15e511[_0xdda2('0x33')],_0x5e107f[_0xdda2('0x34')]),_0x1ca9f3);if(_0x15e511[_0xdda2('0x33')][_0xdda2('0x3c')]){_0x129eba[_0xdda2('0x3b')]=_['merge'](_0x129eba[_0xdda2('0x3b')],{'$or':_[_0xdda2('0x3d')](_0x1ca9f3,function(_0x7dac2c){if(_0x7dac2c[_0xdda2('0x30')]!=='VIRTUAL'){var _0x4dc38f={};_0x4dc38f[_0x7dac2c[_0xdda2('0x2c')]]={'$like':'%'+_0x15e511[_0xdda2('0x33')][_0xdda2('0x3c')]+'%'};return _0x4dc38f;}})});}_0x129eba=_['merge']({},_0x129eba,_0x15e511[_0xdda2('0x3e')]);var _0x542ceb={'where':_0x129eba[_0xdda2('0x3b')]};return db['ContactItemType'][_0xdda2('0x1e')](_0x542ceb)[_0xdda2('0x26')](function(_0x1db762){_0x4b19b7[_0xdda2('0x1e')]=_0x1db762;if(_0x15e511['query'][_0xdda2('0x3f')]){_0x129eba['include']=[{'all':!![]}];}return db[_0xdda2('0x2f')]['findAll'](_0x129eba);})[_0xdda2('0x26')](function(_0x12589b){_0x4b19b7[_0xdda2('0x40')]=_0x12589b;return _0x4b19b7;})[_0xdda2('0x26')](respondWithFilteredResult(_0x5540e5,_0x129eba))[_0xdda2('0x41')](handleError(_0x5540e5,null));};exports['show']=function(_0x1e29dc,_0x15a616){var _0x54735b={'raw':!![],'where':{'id':_0x1e29dc['params']['id']}},_0x2caced={};_0x2caced[_0xdda2('0x31')]=_[_0xdda2('0x32')](db[_0xdda2('0x2f')][_0xdda2('0x42')]);_0x2caced[_0xdda2('0x33')]=_[_0xdda2('0x32')](_0x1e29dc[_0xdda2('0x33')]);_0x2caced[_0xdda2('0x34')]=_[_0xdda2('0x35')](_0x2caced[_0xdda2('0x31')],_0x2caced[_0xdda2('0x33')]);_0x54735b[_0xdda2('0x36')]=_[_0xdda2('0x35')](_0x2caced['model'],qs['fields'](_0x1e29dc['query'][_0xdda2('0x37')]));_0x54735b[_0xdda2('0x36')]=_0x54735b['attributes'][_0xdda2('0x38')]?_0x54735b[_0xdda2('0x36')]:_0x2caced[_0xdda2('0x31')];if(_0x1e29dc['query'][_0xdda2('0x3f')]){_0x54735b[_0xdda2('0x43')]=[{'all':!![]}];}_0x54735b=_['merge']({},_0x54735b,_0x1e29dc['options']);return db[_0xdda2('0x2f')]['find'](_0x54735b)[_0xdda2('0x26')](handleEntityNotFound(_0x15a616,null))['then'](respondWithResult(_0x15a616,null))[_0xdda2('0x41')](handleError(_0x15a616,null));};exports[_0xdda2('0x44')]=function(_0x50bd88,_0x585665){return db[_0xdda2('0x2f')][_0xdda2('0x44')](_0x50bd88[_0xdda2('0x45')],{})[_0xdda2('0x26')](function(_0x578a6c){var _0x1edbc6=_0x50bd88[_0xdda2('0x46')][_0xdda2('0x28')]({'plain':!![]});if(!_0x1edbc6)throw new Error(_0xdda2('0x47'));if(_0x1edbc6[_0xdda2('0x48')]==='user'){var _0x1a56cc=_0x578a6c[_0xdda2('0x28')]({'plain':!![]});var _0x51f2b6=_0xdda2('0x29');return db[_0xdda2('0x49')][_0xdda2('0x4a')]({'where':{'name':_0x51f2b6,'userProfileId':_0x1edbc6[_0xdda2('0x4b')]},'raw':!![]})[_0xdda2('0x26')](function(_0x265169){if(_0x265169&&_0x265169['autoAssociation']===0x0){return db[_0xdda2('0x2a')]['create']({'name':_0x1a56cc[_0xdda2('0x2c')],'resourceId':_0x1a56cc['id'],'type':_0x265169['name'],'sectionId':_0x265169['id']},{})[_0xdda2('0x26')](function(){return _0x578a6c;});}else{return _0x578a6c;}})['catch'](function(_0x3b5bbf){logger[_0xdda2('0x4c')](_0xdda2('0x4d'),_0x3b5bbf);throw _0x3b5bbf;});}return _0x578a6c;})[_0xdda2('0x26')](respondWithResult(_0x585665,0xc9))[_0xdda2('0x41')](handleError(_0x585665,null));};exports[_0xdda2('0x25')]=function(_0x471b86,_0x40655d){if(_0x471b86['body']['id']){delete _0x471b86[_0xdda2('0x45')]['id'];}return db[_0xdda2('0x2f')][_0xdda2('0x4a')]({'where':{'id':_0x471b86['params']['id']}})[_0xdda2('0x26')](handleEntityNotFound(_0x40655d,null))[_0xdda2('0x26')](saveUpdates(_0x471b86['body'],null))[_0xdda2('0x26')](respondWithResult(_0x40655d,null))['catch'](handleError(_0x40655d,null));};exports[_0xdda2('0x27')]=function(_0x10fbac,_0x378704){return db[_0xdda2('0x2f')][_0xdda2('0x4a')]({'where':{'id':_0x10fbac['params']['id']}})['then'](handleEntityNotFound(_0x378704,null))['then'](db[_0xdda2('0x4e')][_0xdda2('0x25')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x10fbac['params']['id']}}))[_0xdda2('0x26')](removeEntity(_0x378704,null))[_0xdda2('0x41')](handleError(_0x378704,null));};
\ No newline at end of file
+var _0xea28=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','ContactItemTypes','sendStatus','stack','name','send','index','map','ContactItemType','fieldName','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','intersection','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','UserProfileResource','body','params','destroy','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel'];(function(_0x482aa5,_0x4bffc6){var _0xf5d3a7=function(_0x1b5af2){while(--_0x1b5af2){_0x482aa5['push'](_0x482aa5['shift']());}};_0xf5d3a7(++_0x4bffc6);}(_0xea28,0x13a));var _0x8ea2=function(_0x476a48,_0x7391a5){_0x476a48=_0x476a48-0x0;var _0x44a787=_0xea28[_0x476a48];return _0x44a787;};'use strict';var emlformat=require(_0x8ea2('0x0'));var rimraf=require(_0x8ea2('0x1'));var zipdir=require(_0x8ea2('0x2'));var jsonpatch=require(_0x8ea2('0x3'));var rp=require(_0x8ea2('0x4'));var moment=require(_0x8ea2('0x5'));var BPromise=require(_0x8ea2('0x6'));var Mustache=require(_0x8ea2('0x7'));var util=require('util');var path=require(_0x8ea2('0x8'));var sox=require(_0x8ea2('0x9'));var csv=require(_0x8ea2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ea2('0xb'));var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0xa'));var querystring=require(_0x8ea2('0x11'));var Papa=require(_0x8ea2('0x12'));var Redis=require(_0x8ea2('0x13'));var authService=require(_0x8ea2('0x14'));var qs=require(_0x8ea2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ea2('0x16'))(_0x8ea2('0x17'));var utils=require(_0x8ea2('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8ea2('0x19'));var db=require(_0x8ea2('0x1a'))['db'];function respondWithStatusCode(_0x1dfb6e,_0x10aead){_0x10aead=_0x10aead||0xcc;return function(_0xe47c0e){if(_0xe47c0e){return _0x1dfb6e['sendStatus'](_0x10aead);}return _0x1dfb6e[_0x8ea2('0x1b')](_0x10aead)['end']();};}function respondWithResult(_0x4b2192,_0x772bad){_0x772bad=_0x772bad||0xc8;return function(_0x4726a7){if(_0x4726a7){return _0x4b2192[_0x8ea2('0x1b')](_0x772bad)[_0x8ea2('0x1c')](_0x4726a7);}};}function respondWithFilteredResult(_0x393faf,_0xbb9bd1){return function(_0x3cff96){if(_0x3cff96){var _0x11f5e8=typeof _0xbb9bd1[_0x8ea2('0x1d')]===_0x8ea2('0x1e')&&typeof _0xbb9bd1[_0x8ea2('0x1f')]===_0x8ea2('0x1e');var _0x3bc774=_0x3cff96[_0x8ea2('0x20')];var _0x1b64cf=_0x11f5e8?0x0:_0xbb9bd1[_0x8ea2('0x1d')];var _0x467045=_0x11f5e8?_0x3cff96[_0x8ea2('0x20')]:_0xbb9bd1[_0x8ea2('0x1d')]+_0xbb9bd1[_0x8ea2('0x1f')];var _0x134cbe;if(_0x467045>=_0x3bc774){_0x467045=_0x3bc774;_0x134cbe=0xc8;}else{_0x134cbe=0xce;}_0x393faf[_0x8ea2('0x1b')](_0x134cbe);return _0x393faf['set']('Content-Range',_0x1b64cf+'-'+_0x467045+'/'+_0x3bc774)[_0x8ea2('0x1c')](_0x3cff96);}return null;};}function patchUpdates(_0x248c18){return function(_0x29151a){try{jsonpatch['apply'](_0x29151a,_0x248c18,!![]);}catch(_0x46f4fe){return BPromise[_0x8ea2('0x21')](_0x46f4fe);}return _0x29151a['save']();};}function saveUpdates(_0x3d593b,_0x283f00){return function(_0x37229a){if(_0x37229a){return _0x37229a[_0x8ea2('0x22')](_0x3d593b)[_0x8ea2('0x23')](function(_0xe5c943){return _0xe5c943;});}return null;};}function removeEntity(_0x199417,_0x1e4cc9){return function(_0x18ec34){if(_0x18ec34){return _0x18ec34['destroy']()[_0x8ea2('0x23')](function(){var _0x4f48bd=_0x18ec34[_0x8ea2('0x24')]({'plain':!![]});var _0x42bec8=_0x8ea2('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x42bec8,'resourceId':_0x4f48bd['id']}})[_0x8ea2('0x23')](function(){return _0x18ec34;});})['then'](function(){_0x199417[_0x8ea2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3be291,_0x12fa37){return function(_0x21c526){if(!_0x21c526){_0x3be291[_0x8ea2('0x26')](0x194);}return _0x21c526;};}function handleError(_0x4e1b90,_0x5ce1d4){_0x5ce1d4=_0x5ce1d4||0x1f4;return function(_0xacaa6c){logger['error'](_0xacaa6c[_0x8ea2('0x27')]);if(_0xacaa6c[_0x8ea2('0x28')]){delete _0xacaa6c[_0x8ea2('0x28')];}_0x4e1b90[_0x8ea2('0x1b')](_0x5ce1d4)[_0x8ea2('0x29')](_0xacaa6c);};}exports[_0x8ea2('0x2a')]=function(_0x32e225,_0x316707){var _0x19e868={},_0x9c5fac={},_0x56d914={'count':0x0,'rows':[]};var _0x5b7ff9=_[_0x8ea2('0x2b')](db[_0x8ea2('0x2c')]['rawAttributes'],function(_0x4a110f){return{'name':_0x4a110f[_0x8ea2('0x2d')],'type':_0x4a110f['type'][_0x8ea2('0x2e')]};});_0x9c5fac[_0x8ea2('0x2f')]=_['map'](_0x5b7ff9,_0x8ea2('0x28'));_0x9c5fac[_0x8ea2('0x30')]=_[_0x8ea2('0x31')](_0x32e225['query']);_0x9c5fac['filters']=_['intersection'](_0x9c5fac[_0x8ea2('0x2f')],_0x9c5fac[_0x8ea2('0x30')]);_0x19e868[_0x8ea2('0x32')]=_['intersection'](_0x9c5fac[_0x8ea2('0x2f')],qs[_0x8ea2('0x33')](_0x32e225[_0x8ea2('0x30')][_0x8ea2('0x33')]));_0x19e868[_0x8ea2('0x32')]=_0x19e868[_0x8ea2('0x32')][_0x8ea2('0x34')]?_0x19e868[_0x8ea2('0x32')]:_0x9c5fac['model'];if(!_0x32e225[_0x8ea2('0x30')][_0x8ea2('0x35')](_0x8ea2('0x36'))){_0x19e868[_0x8ea2('0x1f')]=qs['limit'](_0x32e225[_0x8ea2('0x30')]['limit']);_0x19e868[_0x8ea2('0x1d')]=qs[_0x8ea2('0x1d')](_0x32e225[_0x8ea2('0x30')][_0x8ea2('0x1d')]);}_0x19e868['order']=qs[_0x8ea2('0x37')](_0x32e225['query']['sort']);_0x19e868[_0x8ea2('0x38')]=qs['filters'](_[_0x8ea2('0x39')](_0x32e225[_0x8ea2('0x30')],_0x9c5fac[_0x8ea2('0x3a')]),_0x5b7ff9);if(_0x32e225[_0x8ea2('0x30')][_0x8ea2('0x3b')]){_0x19e868['where']=_[_0x8ea2('0x3c')](_0x19e868['where'],{'$or':_[_0x8ea2('0x2b')](_0x5b7ff9,function(_0x282f00){if(_0x282f00[_0x8ea2('0x3d')]!==_0x8ea2('0x3e')){var _0x4f9a8c={};_0x4f9a8c[_0x282f00[_0x8ea2('0x28')]]={'$like':'%'+_0x32e225['query'][_0x8ea2('0x3b')]+'%'};return _0x4f9a8c;}})});}_0x19e868=_['merge']({},_0x19e868,_0x32e225[_0x8ea2('0x3f')]);var _0x450e8f={'where':_0x19e868[_0x8ea2('0x38')]};return db[_0x8ea2('0x2c')][_0x8ea2('0x20')](_0x450e8f)[_0x8ea2('0x23')](function(_0x2f4fa8){_0x56d914['count']=_0x2f4fa8;if(_0x32e225['query'][_0x8ea2('0x40')]){_0x19e868['include']=[{'all':!![]}];}return db['ContactItemType']['findAll'](_0x19e868);})[_0x8ea2('0x23')](function(_0x5d9ba0){_0x56d914[_0x8ea2('0x41')]=_0x5d9ba0;return _0x56d914;})[_0x8ea2('0x23')](respondWithFilteredResult(_0x316707,_0x19e868))[_0x8ea2('0x42')](handleError(_0x316707,null));};exports[_0x8ea2('0x43')]=function(_0x989d9b,_0x8f700f){var _0x3b2219={'raw':!![],'where':{'id':_0x989d9b['params']['id']}},_0x348b17={};_0x348b17[_0x8ea2('0x2f')]=_[_0x8ea2('0x31')](db[_0x8ea2('0x2c')]['rawAttributes']);_0x348b17[_0x8ea2('0x30')]=_[_0x8ea2('0x31')](_0x989d9b[_0x8ea2('0x30')]);_0x348b17[_0x8ea2('0x3a')]=_[_0x8ea2('0x44')](_0x348b17['model'],_0x348b17[_0x8ea2('0x30')]);_0x3b2219[_0x8ea2('0x32')]=_[_0x8ea2('0x44')](_0x348b17['model'],qs[_0x8ea2('0x33')](_0x989d9b[_0x8ea2('0x30')][_0x8ea2('0x33')]));_0x3b2219[_0x8ea2('0x32')]=_0x3b2219[_0x8ea2('0x32')][_0x8ea2('0x34')]?_0x3b2219[_0x8ea2('0x32')]:_0x348b17[_0x8ea2('0x2f')];if(_0x989d9b[_0x8ea2('0x30')][_0x8ea2('0x40')]){_0x3b2219[_0x8ea2('0x45')]=[{'all':!![]}];}_0x3b2219=_[_0x8ea2('0x3c')]({},_0x3b2219,_0x989d9b[_0x8ea2('0x3f')]);return db[_0x8ea2('0x2c')]['find'](_0x3b2219)[_0x8ea2('0x23')](handleEntityNotFound(_0x8f700f,null))[_0x8ea2('0x23')](respondWithResult(_0x8f700f,null))[_0x8ea2('0x42')](handleError(_0x8f700f,null));};exports[_0x8ea2('0x46')]=function(_0x182a46,_0x1daa25){return db[_0x8ea2('0x2c')][_0x8ea2('0x46')](_0x182a46['body'],{})[_0x8ea2('0x23')](function(_0x37a1cf){var _0x24dddb=_0x182a46['user']['get']({'plain':!![]});if(!_0x24dddb)throw new Error(_0x8ea2('0x47'));if(_0x24dddb[_0x8ea2('0x48')]===_0x8ea2('0x49')){var _0x5e5c37=_0x37a1cf[_0x8ea2('0x24')]({'plain':!![]});var _0x315b5d=_0x8ea2('0x25');return db[_0x8ea2('0x4a')][_0x8ea2('0x4b')]({'where':{'name':_0x315b5d,'userProfileId':_0x24dddb['userProfileId']},'raw':!![]})['then'](function(_0x24a22a){if(_0x24a22a&&_0x24a22a[_0x8ea2('0x4c')]===0x0){return db[_0x8ea2('0x4d')]['create']({'name':_0x5e5c37[_0x8ea2('0x28')],'resourceId':_0x5e5c37['id'],'type':_0x24a22a[_0x8ea2('0x28')],'sectionId':_0x24a22a['id']},{})[_0x8ea2('0x23')](function(){return _0x37a1cf;});}else{return _0x37a1cf;}})['catch'](function(_0x5c6524){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c6524);throw _0x5c6524;});}return _0x37a1cf;})['then'](respondWithResult(_0x1daa25,0xc9))[_0x8ea2('0x42')](handleError(_0x1daa25,null));};exports[_0x8ea2('0x22')]=function(_0x5f56f8,_0x49cf11){if(_0x5f56f8[_0x8ea2('0x4e')]['id']){delete _0x5f56f8[_0x8ea2('0x4e')]['id'];}return db[_0x8ea2('0x2c')]['find']({'where':{'id':_0x5f56f8[_0x8ea2('0x4f')]['id']}})[_0x8ea2('0x23')](handleEntityNotFound(_0x49cf11,null))['then'](saveUpdates(_0x5f56f8[_0x8ea2('0x4e')],null))[_0x8ea2('0x23')](respondWithResult(_0x49cf11,null))[_0x8ea2('0x42')](handleError(_0x49cf11,null));};exports[_0x8ea2('0x50')]=function(_0x4728b4,_0x58674d){return db['ContactItemType']['find']({'where':{'id':_0x4728b4[_0x8ea2('0x4f')]['id']}})[_0x8ea2('0x23')](handleEntityNotFound(_0x58674d,null))[_0x8ea2('0x23')](db[_0x8ea2('0x51')][_0x8ea2('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4728b4[_0x8ea2('0x4f')]['id']}}))[_0x8ea2('0x23')](removeEntity(_0x58674d,null))['catch'](handleError(_0x58674d,null));};
\ No newline at end of file
index 2aabf50..e8e3b30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9463=['../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','util','api','moment','bluebird','request-promise'];(function(_0x45bf92,_0x3b38c2){var _0x7145c0=function(_0x41ad50){while(--_0x41ad50){_0x45bf92['push'](_0x45bf92['shift']());}};_0x7145c0(++_0x3b38c2);}(_0x9463,0x192));var _0x3946=function(_0xf95936,_0x2b59af){_0xf95936=_0xf95936-0x0;var _0x30e145=_0x9463[_0xf95936];return _0x30e145;};'use strict';var _=require(_0x3946('0x0'));var util=require(_0x3946('0x1'));var logger=require('../../config/logger')(_0x3946('0x2'));var moment=require(_0x3946('0x3'));var BPromise=require(_0x3946('0x4'));var rp=require(_0x3946('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3946('0x6'));var attributes=require(_0x3946('0x7'));module[_0x3946('0x8')]=function(_0x1eeda9,_0x429ef6){return _0x1eeda9[_0x3946('0x9')](_0x3946('0xa'),attributes,{'tableName':_0x3946('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x47fb=['bluebird','request-promise','path','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','lodash','../../config/logger','moment'];(function(_0x4e76f2,_0xfe0a53){var _0x348348=function(_0x336f9d){while(--_0x336f9d){_0x4e76f2['push'](_0x4e76f2['shift']());}};_0x348348(++_0xfe0a53);}(_0x47fb,0x1cb));var _0xb47f=function(_0x59aedd,_0x47b7b1){_0x59aedd=_0x59aedd-0x0;var _0x5f141c=_0x47fb[_0x59aedd];return _0x5f141c;};'use strict';var _=require(_0xb47f('0x0'));var util=require('util');var logger=require(_0xb47f('0x1'))('api');var moment=require(_0xb47f('0x2'));var BPromise=require(_0xb47f('0x3'));var rp=require(_0xb47f('0x4'));var fs=require('fs');var path=require(_0xb47f('0x5'));var rimraf=require('rimraf');var config=require(_0xb47f('0x6'));var attributes=require(_0xb47f('0x7'));module[_0xb47f('0x8')]=function(_0x314890,_0xac1305){return _0x314890[_0xb47f('0x9')](_0xb47f('0xa'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d125950..a708f01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0ec=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','debug','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ContactItemType,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xc0ec,0x81));var _0xcc0e=function(_0x208393,_0x3c8431){_0x208393=_0x208393-0x0;var _0xbb423=_0xc0ec[_0x208393];return _0xbb423;};'use strict';var _=require(_0xcc0e('0x0'));var util=require(_0xcc0e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcc0e('0x2'));var fs=require('fs');var Redis=require(_0xcc0e('0x3'));var db=require(_0xcc0e('0x4'))['db'];var utils=require(_0xcc0e('0x5'));var logger=require(_0xcc0e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcc0e('0x7'));var client=jayson[_0xcc0e('0x8')][_0xcc0e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4540be,_0x194889,_0x54d77a){return new BPromise(function(_0xfae54d,_0x4a373f){return client['request'](_0x4540be,_0x54d77a)[_0xcc0e('0xa')](function(_0x93151a){logger[_0xcc0e('0xb')]('ContactItemType,\x20%s,\x20%s',_0x194889,'request\x20sent');logger[_0xcc0e('0xc')](_0xcc0e('0xd'),_0x194889,_0xcc0e('0xe'),JSON[_0xcc0e('0xf')](_0x93151a));if(_0x93151a[_0xcc0e('0x10')]){if(_0x93151a[_0xcc0e('0x10')][_0xcc0e('0x11')]===0x1f4){logger[_0xcc0e('0x10')](_0xcc0e('0x12'),_0x194889,_0x93151a[_0xcc0e('0x10')][_0xcc0e('0x13')]);return _0x4a373f(_0x93151a[_0xcc0e('0x10')][_0xcc0e('0x13')]);}logger[_0xcc0e('0x10')](_0xcc0e('0x12'),_0x194889,_0x93151a[_0xcc0e('0x10')]['message']);return _0xfae54d(_0x93151a[_0xcc0e('0x10')][_0xcc0e('0x13')]);}else{logger[_0xcc0e('0xb')](_0xcc0e('0x12'),_0x194889,_0xcc0e('0xe'));_0xfae54d(_0x93151a[_0xcc0e('0x14')][_0xcc0e('0x13')]);}})[_0xcc0e('0x15')](function(_0x787194){logger[_0xcc0e('0x10')](_0xcc0e('0x12'),_0x194889,_0x787194);_0x4a373f(_0x787194);});});}
\ No newline at end of file
+var _0x678e=['moment','bluebird','../../config/logger','../../config/environment','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0xb60c05,_0x203993){var _0x4411a3=function(_0x129478){while(--_0x129478){_0xb60c05['push'](_0xb60c05['shift']());}};_0x4411a3(++_0x203993);}(_0x678e,0xe0));var _0xe678=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x678e[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xe678('0x0'));var util=require('util');var moment=require(_0xe678('0x1'));var BPromise=require(_0xe678('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe678('0x3'))('rpc');var config=require(_0xe678('0x4'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35d46d,_0x2f5d9c,_0x37f17d){return new BPromise(function(_0x45056d,_0x1c181a){return client['request'](_0x35d46d,_0x37f17d)[_0xe678('0x5')](function(_0xd05ada){logger[_0xe678('0x6')](_0xe678('0x7'),_0x2f5d9c,_0xe678('0x8'));logger['debug'](_0xe678('0x9'),_0x2f5d9c,_0xe678('0x8'),JSON[_0xe678('0xa')](_0xd05ada));if(_0xd05ada[_0xe678('0xb')]){if(_0xd05ada['error']['code']===0x1f4){logger[_0xe678('0xb')]('ContactItemType,\x20%s,\x20%s',_0x2f5d9c,_0xd05ada['error'][_0xe678('0xc')]);return _0x1c181a(_0xd05ada[_0xe678('0xb')][_0xe678('0xc')]);}logger[_0xe678('0xb')](_0xe678('0x7'),_0x2f5d9c,_0xd05ada[_0xe678('0xb')][_0xe678('0xc')]);return _0x45056d(_0xd05ada[_0xe678('0xb')]['message']);}else{logger['info'](_0xe678('0x7'),_0x2f5d9c,_0xe678('0x8'));_0x45056d(_0xd05ada[_0xe678('0xd')][_0xe678('0xc')]);}})[_0xe678('0xe')](function(_0x5e656d){logger[_0xe678('0xb')](_0xe678('0x7'),_0x2f5d9c,_0x5e656d);_0x1c181a(_0x5e656d);});});}
\ No newline at end of file
index de2ef93..beb23ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b71=['../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0x7b71,0xf6));var _0x17b7=function(_0x143cfd,_0x1a336e){_0x143cfd=_0x143cfd-0x0;var _0x2cb5f5=_0x7b71[_0x143cfd];return _0x2cb5f5;};'use strict';var multer=require(_0x17b7('0x0'));var util=require(_0x17b7('0x1'));var path=require(_0x17b7('0x2'));var timeout=require('connect-timeout');var express=require(_0x17b7('0x3'));var router=express[_0x17b7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x17b7('0x5'));var interaction=require(_0x17b7('0x6'));var config=require(_0x17b7('0x7'));var controller=require(_0x17b7('0x8'));router[_0x17b7('0x9')]('/',auth[_0x17b7('0xa')](),controller[_0x17b7('0xb')]);router[_0x17b7('0x9')](_0x17b7('0xc'),auth['isAuthenticated'](),controller[_0x17b7('0xd')]);router[_0x17b7('0xe')]('/',auth[_0x17b7('0xa')](),controller[_0x17b7('0xf')]);router[_0x17b7('0x10')]('/:id',auth[_0x17b7('0xa')](),controller[_0x17b7('0x11')]);router[_0x17b7('0x12')](_0x17b7('0xc'),auth['isAuthenticated'](),controller[_0x17b7('0x13')]);module[_0x17b7('0x14')]=router;
\ No newline at end of file
+var _0x8bb3=['./contactItemType.controller','isAuthenticated','index','get','post','create','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5aaccc,_0x34e9df){var _0x25b174=function(_0x3061f9){while(--_0x3061f9){_0x5aaccc['push'](_0x5aaccc['shift']());}};_0x25b174(++_0x34e9df);}(_0x8bb3,0xa4));var _0x38bb=function(_0x4a605f,_0x4e0548){_0x4a605f=_0x4a605f-0x0;var _0x453254=_0x8bb3[_0x4a605f];return _0x453254;};'use strict';var multer=require(_0x38bb('0x0'));var util=require(_0x38bb('0x1'));var path=require('path');var timeout=require(_0x38bb('0x2'));var express=require('express');var router=express[_0x38bb('0x3')]();var fs_extra=require(_0x38bb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x38bb('0x5'));var config=require(_0x38bb('0x6'));var controller=require(_0x38bb('0x7'));router['get']('/',auth[_0x38bb('0x8')](),controller[_0x38bb('0x9')]);router[_0x38bb('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x38bb('0xb')]('/',auth[_0x38bb('0x8')](),controller[_0x38bb('0xc')]);router[_0x38bb('0xd')]('/:id',auth[_0x38bb('0x8')](),controller[_0x38bb('0xe')]);router[_0x38bb('0xf')](_0x38bb('0x10'),auth[_0x38bb('0x8')](),controller[_0x38bb('0x11')]);module[_0x38bb('0x12')]=router;
\ No newline at end of file
index bd0084a..b0fbf54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['name','exports','STRING'];(function(_0x237cec,_0x50db0d){var _0x255562=function(_0x55747d){while(--_0x55747d){_0x237cec['push'](_0x237cec['shift']());}};_0x255562(++_0x50db0d);}(_0x2032,0xd9));var _0x2203=function(_0x225531,_0x153024){_0x225531=_0x225531-0x0;var _0x43b312=_0x2032[_0x225531];return _0x43b312;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x2a376b,_0x5391fe){var _0x536f5d=function(_0x511e7d){while(--_0x511e7d){_0x2a376b['push'](_0x2a376b['shift']());}};_0x536f5d(++_0x5391fe);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 044fded..1a76066 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b61=['addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','get','UserProfileResource','end','error','name','send','map','Dashboard','type','model','query','keys','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','rawAttributes','intersection','length','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','body','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrEmailAccounts','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0x9b61,0x89));var _0x19b6=function(_0x35084d,_0xc64cf){_0x35084d=_0x35084d-0x0;var _0x2195bf=_0x9b61[_0x35084d];return _0x2195bf;};'use strict';var emlformat=require(_0x19b6('0x0'));var rimraf=require(_0x19b6('0x1'));var zipdir=require(_0x19b6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x19b6('0x3'));var moment=require(_0x19b6('0x4'));var BPromise=require(_0x19b6('0x5'));var Mustache=require(_0x19b6('0x6'));var util=require(_0x19b6('0x7'));var path=require(_0x19b6('0x8'));var sox=require(_0x19b6('0x9'));var csv=require(_0x19b6('0xa'));var ejs=require(_0x19b6('0xb'));var fs=require('fs');var fs_extra=require(_0x19b6('0xc'));var _=require(_0x19b6('0xd'));var squel=require(_0x19b6('0xe'));var crypto=require(_0x19b6('0xf'));var jsforce=require(_0x19b6('0x10'));var deskjs=require(_0x19b6('0x11'));var toCsv=require(_0x19b6('0xa'));var querystring=require(_0x19b6('0x12'));var Papa=require('papaparse');var Redis=require(_0x19b6('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x19b6('0x14'));var as=require(_0x19b6('0x15'));var hardwareService=require(_0x19b6('0x16'));var logger=require('../../config/logger')(_0x19b6('0x17'));var utils=require(_0x19b6('0x18'));var config=require(_0x19b6('0x19'));var licenseUtil=require(_0x19b6('0x1a'));var db=require(_0x19b6('0x1b'))['db'];config['redis']=_['defaults'](config[_0x19b6('0x1c')],{'host':_0x19b6('0x1d'),'port':0x18eb});var socket=require(_0x19b6('0x1e'))(new Redis(config['redis']));require(_0x19b6('0x1f'))[_0x19b6('0x20')](socket);function respondWithStatusCode(_0x1126b1,_0x13068c){_0x13068c=_0x13068c||0xcc;return function(_0x343a5e){if(_0x343a5e){return _0x1126b1[_0x19b6('0x21')](_0x13068c);}return _0x1126b1[_0x19b6('0x22')](_0x13068c)['end']();};}function respondWithResult(_0x3dc074,_0x7edd43){_0x7edd43=_0x7edd43||0xc8;return function(_0x40125d){if(_0x40125d){return _0x3dc074[_0x19b6('0x22')](_0x7edd43)['json'](_0x40125d);}};}function respondWithFilteredResult(_0x38f2d4,_0x5bb399){return function(_0x2984d5){if(_0x2984d5){var _0x293724=typeof _0x5bb399[_0x19b6('0x23')]===_0x19b6('0x24')&&typeof _0x5bb399[_0x19b6('0x25')]===_0x19b6('0x24');var _0x40a666=_0x2984d5[_0x19b6('0x26')];var _0x5c69a9=_0x293724?0x0:_0x5bb399[_0x19b6('0x23')];var _0x24bdb4=_0x293724?_0x2984d5[_0x19b6('0x26')]:_0x5bb399[_0x19b6('0x23')]+_0x5bb399[_0x19b6('0x25')];var _0x2397cd;if(_0x24bdb4>=_0x40a666){_0x24bdb4=_0x40a666;_0x2397cd=0xc8;}else{_0x2397cd=0xce;}_0x38f2d4[_0x19b6('0x22')](_0x2397cd);return _0x38f2d4[_0x19b6('0x27')]('Content-Range',_0x5c69a9+'-'+_0x24bdb4+'/'+_0x40a666)[_0x19b6('0x28')](_0x2984d5);}return null;};}function patchUpdates(_0x14f93d){return function(_0x2922fb){try{jsonpatch['apply'](_0x2922fb,_0x14f93d,!![]);}catch(_0x1b9322){return BPromise[_0x19b6('0x29')](_0x1b9322);}return _0x2922fb[_0x19b6('0x2a')]();};}function saveUpdates(_0x30fd40,_0x1be5bf){return function(_0x272b3d){if(_0x272b3d){return _0x272b3d[_0x19b6('0x2b')](_0x30fd40)[_0x19b6('0x2c')](function(_0x7f3dd3){return _0x7f3dd3;});}return null;};}function removeEntity(_0x5783a7,_0x38c69b){return function(_0x5f0bdb){if(_0x5f0bdb){return _0x5f0bdb[_0x19b6('0x2d')]()['then'](function(){var _0x2ed8b7=_0x5f0bdb[_0x19b6('0x2e')]({'plain':!![]});var _0x4bc932='CustomDashboards';return db[_0x19b6('0x2f')][_0x19b6('0x2d')]({'where':{'type':_0x4bc932,'resourceId':_0x2ed8b7['id']}})['then'](function(){return _0x5f0bdb;});})[_0x19b6('0x2c')](function(){_0x5783a7[_0x19b6('0x22')](0xcc)[_0x19b6('0x30')]();});}};}function handleEntityNotFound(_0x2d305e,_0x2e734a){return function(_0x2187b1){if(!_0x2187b1){_0x2d305e['sendStatus'](0x194);}return _0x2187b1;};}function handleError(_0x37486c,_0x4a9878){_0x4a9878=_0x4a9878||0x1f4;return function(_0x3f13df){logger[_0x19b6('0x31')](_0x3f13df['stack']);if(_0x3f13df[_0x19b6('0x32')]){delete _0x3f13df[_0x19b6('0x32')];}_0x37486c[_0x19b6('0x22')](_0x4a9878)[_0x19b6('0x33')](_0x3f13df);};}exports['index']=function(_0xeb2699,_0x4d902d){var _0x3ef5c6={},_0x1938f4={},_0x14da2f={'count':0x0,'rows':[]};var _0x5f10a8=_[_0x19b6('0x34')](db[_0x19b6('0x35')]['rawAttributes'],function(_0x1d2177){return{'name':_0x1d2177['fieldName'],'type':_0x1d2177[_0x19b6('0x36')]['key']};});_0x1938f4[_0x19b6('0x37')]=_[_0x19b6('0x34')](_0x5f10a8,_0x19b6('0x32'));_0x1938f4[_0x19b6('0x38')]=_[_0x19b6('0x39')](_0xeb2699['query']);_0x1938f4['filters']=_['intersection'](_0x1938f4['model'],_0x1938f4[_0x19b6('0x38')]);_0x3ef5c6[_0x19b6('0x3a')]=_['intersection'](_0x1938f4['model'],qs['fields'](_0xeb2699['query'][_0x19b6('0x3b')]));_0x3ef5c6[_0x19b6('0x3a')]=_0x3ef5c6['attributes']['length']?_0x3ef5c6['attributes']:_0x1938f4[_0x19b6('0x37')];if(!_0xeb2699[_0x19b6('0x38')][_0x19b6('0x3c')](_0x19b6('0x3d'))){_0x3ef5c6['limit']=qs['limit'](_0xeb2699[_0x19b6('0x38')][_0x19b6('0x25')]);_0x3ef5c6[_0x19b6('0x23')]=qs[_0x19b6('0x23')](_0xeb2699[_0x19b6('0x38')][_0x19b6('0x23')]);}_0x3ef5c6[_0x19b6('0x3e')]=qs['sort'](_0xeb2699[_0x19b6('0x38')][_0x19b6('0x3f')]);_0x3ef5c6[_0x19b6('0x40')]=qs[_0x19b6('0x41')](_[_0x19b6('0x42')](_0xeb2699[_0x19b6('0x38')],_0x1938f4[_0x19b6('0x41')]),_0x5f10a8);if(_0xeb2699[_0x19b6('0x38')]['filter']){_0x3ef5c6[_0x19b6('0x40')]=_[_0x19b6('0x43')](_0x3ef5c6['where'],{'$or':_['map'](_0x5f10a8,function(_0x405e6e){if(_0x405e6e[_0x19b6('0x36')]!==_0x19b6('0x44')){var _0x38af2b={};_0x38af2b[_0x405e6e[_0x19b6('0x32')]]={'$like':'%'+_0xeb2699[_0x19b6('0x38')][_0x19b6('0x45')]+'%'};return _0x38af2b;}})});}_0x3ef5c6=_[_0x19b6('0x43')]({},_0x3ef5c6,_0xeb2699[_0x19b6('0x46')]);var _0xf63197={'where':_0x3ef5c6[_0x19b6('0x40')]};return db['Dashboard']['count'](_0xf63197)['then'](function(_0x3584a3){_0x14da2f[_0x19b6('0x26')]=_0x3584a3;if(_0xeb2699[_0x19b6('0x38')][_0x19b6('0x47')]){_0x3ef5c6[_0x19b6('0x48')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x3ef5c6);})[_0x19b6('0x2c')](function(_0x36d371){_0x14da2f[_0x19b6('0x49')]=_0x36d371;return _0x14da2f;})[_0x19b6('0x2c')](respondWithFilteredResult(_0x4d902d,_0x3ef5c6))['catch'](handleError(_0x4d902d,null));};exports[_0x19b6('0x4a')]=function(_0x90b80a,_0x71c74e){var _0x4655bb={'raw':![],'where':{'id':_0x90b80a[_0x19b6('0x4b')]['id']}},_0x13d8fd={};_0x13d8fd['model']=_['keys'](db[_0x19b6('0x35')][_0x19b6('0x4c')]);_0x13d8fd[_0x19b6('0x38')]=_[_0x19b6('0x39')](_0x90b80a[_0x19b6('0x38')]);_0x13d8fd[_0x19b6('0x41')]=_['intersection'](_0x13d8fd[_0x19b6('0x37')],_0x13d8fd[_0x19b6('0x38')]);_0x4655bb[_0x19b6('0x3a')]=_[_0x19b6('0x4d')](_0x13d8fd['model'],qs[_0x19b6('0x3b')](_0x90b80a[_0x19b6('0x38')][_0x19b6('0x3b')]));_0x4655bb[_0x19b6('0x3a')]=_0x4655bb[_0x19b6('0x3a')][_0x19b6('0x4e')]?_0x4655bb['attributes']:_0x13d8fd[_0x19b6('0x37')];if(_0x90b80a[_0x19b6('0x38')][_0x19b6('0x47')]){_0x4655bb[_0x19b6('0x48')]=[{'all':!![]}];}_0x4655bb=_[_0x19b6('0x43')]({},_0x4655bb,_0x90b80a[_0x19b6('0x46')]);return db[_0x19b6('0x35')][_0x19b6('0x4f')](_0x4655bb)[_0x19b6('0x2c')](handleEntityNotFound(_0x71c74e,null))[_0x19b6('0x2c')](respondWithResult(_0x71c74e,null))['catch'](handleError(_0x71c74e,null));};exports['create']=function(_0x49180b,_0x3374da){return db['Dashboard'][_0x19b6('0x50')](_0x49180b['body'],{})['then'](function(_0x1fdce6){var _0x1f9993=_0x49180b[_0x19b6('0x51')]['get']({'plain':!![]});if(!_0x1f9993)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f9993[_0x19b6('0x52')]===_0x19b6('0x51')){var _0x2c9bd0=_0x1fdce6[_0x19b6('0x2e')]({'plain':!![]});var _0x1d8dcd='CustomDashboards';return db[_0x19b6('0x53')][_0x19b6('0x4f')]({'where':{'name':_0x1d8dcd,'userProfileId':_0x1f9993[_0x19b6('0x54')]},'raw':!![]})[_0x19b6('0x2c')](function(_0x2117d8){if(_0x2117d8&&_0x2117d8[_0x19b6('0x55')]===0x0){return db[_0x19b6('0x2f')][_0x19b6('0x50')]({'name':_0x2c9bd0['name'],'resourceId':_0x2c9bd0['id'],'type':_0x2117d8['name'],'sectionId':_0x2117d8['id']},{})[_0x19b6('0x2c')](function(){return _0x1fdce6;});}else{return _0x1fdce6;}})[_0x19b6('0x56')](function(_0x1d6952){logger[_0x19b6('0x31')](_0x19b6('0x57'),_0x1d6952);throw _0x1d6952;});}return _0x1fdce6;})[_0x19b6('0x2c')](respondWithResult(_0x3374da,0xc9))[_0x19b6('0x56')](handleError(_0x3374da,null));};exports['clone']=function(_0x5b498b,_0x233272){var _0x140c25={'where':{'id':_0x5b498b[_0x19b6('0x4b')]['id']}},_0x43f4d5={};_0x43f4d5[_0x19b6('0x37')]=_['keys'](db['Dashboard'][_0x19b6('0x4c')]);_0x140c25['attributes']=_[_0x19b6('0x4d')](_0x43f4d5[_0x19b6('0x37')],qs[_0x19b6('0x3b')](_0x5b498b[_0x19b6('0x38')][_0x19b6('0x3b')]));_0x140c25[_0x19b6('0x3a')]=_0x140c25['attributes']['length']?_0x140c25['attributes']:_0x43f4d5['model'];if(_0x5b498b[_0x19b6('0x38')]['includeAll']){_0x140c25[_0x19b6('0x48')]=[{'all':!![]}];}_0x140c25=_[_0x19b6('0x43')]({},_0x140c25,_0x5b498b['options']);return db[_0x19b6('0x35')]['find'](_0x140c25)[_0x19b6('0x2c')](handleEntityNotFound(_0x233272,null))[_0x19b6('0x2c')](function(_0x12ecaf){if(_0x12ecaf){var _0xaac279=_0x12ecaf[_0x19b6('0x2e')]({'plain':!![]});_0xaac279=qs['omit'](_0xaac279,['id',_0x19b6('0x58'),_0x19b6('0x59')]);_0x5b498b[_0x19b6('0x5a')]=_[_0x19b6('0x5b')](_0x5b498b['body'],['id',_0x19b6('0x58'),_0x19b6('0x59')]);return db['Dashboard'][_0x19b6('0x50')](_[_0x19b6('0x43')](_0xaac279,_0x5b498b['body']),{'include':_0x5b498b[_0x19b6('0x38')]['includeAll']?[{'all':!![]}]:undefined})[_0x19b6('0x2c')](function(_0x4579f2){var _0x7e8cc7=_0x5b498b[_0x19b6('0x51')][_0x19b6('0x2e')]({'plain':!![]});if(!_0x7e8cc7)throw new Error(_0x19b6('0x5c'));if(_0x7e8cc7[_0x19b6('0x52')]===_0x19b6('0x51')){var _0x5dce64=_0x4579f2[_0x19b6('0x2e')]({'plain':!![]});var _0xeac82a=_0x19b6('0x5d');return db['UserProfileSection'][_0x19b6('0x4f')]({'where':{'name':_0xeac82a,'userProfileId':_0x7e8cc7[_0x19b6('0x54')]},'raw':!![]})[_0x19b6('0x2c')](function(_0x30c6b2){if(_0x30c6b2&&_0x30c6b2['autoAssociation']===0x0){return db[_0x19b6('0x2f')][_0x19b6('0x50')]({'name':_0x5dce64['name'],'resourceId':_0x5dce64['id'],'type':_0x30c6b2[_0x19b6('0x32')],'sectionId':_0x30c6b2['id']},{})['then'](function(){return _0x4579f2;});}else{return _0x4579f2;}})[_0x19b6('0x56')](function(_0x2b9c26){logger[_0x19b6('0x31')](_0x19b6('0x57'),_0x2b9c26);throw _0x2b9c26;});}return _0x4579f2;});}})['then'](respondWithResult(_0x233272,0xc9))['catch'](handleError(_0x233272,null));};exports[_0x19b6('0x2b')]=function(_0x59ca6a,_0x33b978){if(_0x59ca6a[_0x19b6('0x5a')]['id']){delete _0x59ca6a[_0x19b6('0x5a')]['id'];}return db[_0x19b6('0x35')][_0x19b6('0x4f')]({'where':{'id':_0x59ca6a['params']['id']}})['then'](handleEntityNotFound(_0x33b978,null))['then'](saveUpdates(_0x59ca6a[_0x19b6('0x5a')],null))['then'](respondWithResult(_0x33b978,null))['catch'](handleError(_0x33b978,null));};exports[_0x19b6('0x2d')]=function(_0x4e9a32,_0x3bbdc7){return db[_0x19b6('0x35')][_0x19b6('0x4f')]({'where':{'id':_0x4e9a32[_0x19b6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3bbdc7,null))[_0x19b6('0x2c')](removeEntity(_0x3bbdc7,null))[_0x19b6('0x56')](handleError(_0x3bbdc7,null));};function widgetAttributes(_0x2ebc7f){try{switch(_0x2ebc7f[_0x19b6('0x36')]){case'iframe':return[{'name':_0x19b6('0x5e'),'value':_0x2ebc7f[_0x19b6('0x5e')]||(_0x2ebc7f['attrs']&&_0x2ebc7f[_0x19b6('0x5f')][0x0]?_0x2ebc7f[_0x19b6('0x5f')][0x0][_0x19b6('0x60')]:undefined)||_0x19b6('0x61')}];case _0x19b6('0x62'):return[{'name':_0x19b6('0x63'),'value':_0x2ebc7f[_0x19b6('0x63')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x0]?_0x2ebc7f[_0x19b6('0x5f')][0x0]['value']:undefined)||''}];case _0x19b6('0x64'):return[{'name':_0x19b6('0x65'),'value':_0x2ebc7f['attrHourFormat']||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x0]?_0x2ebc7f[_0x19b6('0x5f')][0x0][_0x19b6('0x60')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x2ebc7f[_0x19b6('0x66')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x1]?_0x2ebc7f[_0x19b6('0x5f')][0x1][_0x19b6('0x60')]:undefined)||_0x19b6('0x67')},{'name':_0x19b6('0x68'),'value':_0x2ebc7f['attrFontSize']||(_0x2ebc7f['attrs']&&_0x2ebc7f['attrs'][0x2]?_0x2ebc7f[_0x19b6('0x5f')][0x2][_0x19b6('0x60')]:undefined)||0xc}];case _0x19b6('0x69'):return[{'name':_0x19b6('0x6a'),'value':_0x2ebc7f[_0x19b6('0x6a')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x0]?_0x2ebc7f[_0x19b6('0x5f')][0x0][_0x19b6('0x60')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x2ebc7f[_0x19b6('0x6b')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f['attrs'][0x1]?_0x2ebc7f[_0x19b6('0x5f')][0x1][_0x19b6('0x60')]:undefined)||[]},{'name':_0x19b6('0x68'),'value':_0x2ebc7f[_0x19b6('0x68')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x2]?_0x2ebc7f[_0x19b6('0x5f')][0x2][_0x19b6('0x60')]:undefined)||0x14},{'name':_0x19b6('0x6c'),'value':_0x2ebc7f['attrChannel']||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x3]?_0x2ebc7f[_0x19b6('0x5f')][0x3][_0x19b6('0x60')]:undefined)||_0x19b6('0x6d')},{'name':'attrEmailAccounts','value':_0x2ebc7f['attrEmailAccounts']||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x4]?_0x2ebc7f[_0x19b6('0x5f')][0x4]['value']:undefined)||''},{'name':_0x19b6('0x6e'),'value':_0x2ebc7f[_0x19b6('0x6e')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x5]?_0x2ebc7f[_0x19b6('0x5f')][0x5][_0x19b6('0x60')]:undefined)||''},{'name':_0x19b6('0x6f'),'value':_0x2ebc7f[_0x19b6('0x6f')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x6]?_0x2ebc7f['attrs'][0x6][_0x19b6('0x60')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2ebc7f[_0x19b6('0x70')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x7]?_0x2ebc7f['attrs'][0x7][_0x19b6('0x60')]:undefined)||''},{'name':_0x19b6('0x71'),'value':_0x2ebc7f['attrWhatsappAccounts']||(_0x2ebc7f['attrs']&&_0x2ebc7f['attrs'][0x8]?_0x2ebc7f[_0x19b6('0x5f')][0x8]['value']:undefined)||''},{'name':_0x19b6('0x72'),'value':_0x2ebc7f[_0x19b6('0x72')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f['attrs'][0x9]?_0x2ebc7f[_0x19b6('0x5f')][0x9]['value']:undefined)||''}];case _0x19b6('0x73'):case _0x19b6('0x74'):return[{'name':_0x19b6('0x75'),'value':_0x2ebc7f[_0x19b6('0x75')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x0]?_0x2ebc7f[_0x19b6('0x5f')][0x0][_0x19b6('0x60')]:undefined)||_0x19b6('0x76')},{'name':_0x19b6('0x77'),'value':_0x2ebc7f[_0x19b6('0x77')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x1]?_0x2ebc7f[_0x19b6('0x5f')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x2ebc7f[_0x19b6('0x78')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x2]?_0x2ebc7f[_0x19b6('0x5f')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x2ebc7f[_0x19b6('0x6b')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f['attrs'][0x3]?_0x2ebc7f[_0x19b6('0x5f')][0x3][_0x19b6('0x60')]:undefined)||[]},{'name':_0x19b6('0x6c'),'value':_0x2ebc7f[_0x19b6('0x6c')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f['attrs'][0x4]?_0x2ebc7f[_0x19b6('0x5f')][0x4]['value']:undefined)||_0x19b6('0x6d')},{'name':_0x19b6('0x79'),'value':_0x2ebc7f[_0x19b6('0x79')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x5]?_0x2ebc7f[_0x19b6('0x5f')][0x5][_0x19b6('0x60')]:undefined)||''},{'name':_0x19b6('0x6e'),'value':_0x2ebc7f['attrFaxAccounts']||(_0x2ebc7f['attrs']&&_0x2ebc7f[_0x19b6('0x5f')][0x6]?_0x2ebc7f[_0x19b6('0x5f')][0x6][_0x19b6('0x60')]:undefined)||''},{'name':_0x19b6('0x6f'),'value':_0x2ebc7f['attrSmsAccounts']||(_0x2ebc7f['attrs']&&_0x2ebc7f[_0x19b6('0x5f')][0x7]?_0x2ebc7f[_0x19b6('0x5f')][0x7][_0x19b6('0x60')]:undefined)||''},{'name':_0x19b6('0x70'),'value':_0x2ebc7f[_0x19b6('0x70')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x8]?_0x2ebc7f[_0x19b6('0x5f')][0x8]['value']:undefined)||''},{'name':_0x19b6('0x71'),'value':_0x2ebc7f[_0x19b6('0x71')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f['attrs'][0x9]?_0x2ebc7f[_0x19b6('0x5f')][0x9][_0x19b6('0x60')]:undefined)||''},{'name':_0x19b6('0x72'),'value':_0x2ebc7f[_0x19b6('0x72')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0xa]?_0x2ebc7f['attrs'][0xa][_0x19b6('0x60')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x2ebc7f[_0x19b6('0x7a')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x0]?_0x2ebc7f[_0x19b6('0x5f')][0x0]['type']:undefined)||null,'value':_0x2ebc7f[_0x19b6('0x7b')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x0]?_0x2ebc7f[_0x19b6('0x5f')][0x0][_0x19b6('0x60')]:undefined)||null},{'name':_0x19b6('0x7c'),'value':_0x2ebc7f[_0x19b6('0x7c')]||(_0x2ebc7f[_0x19b6('0x5f')]&&_0x2ebc7f[_0x19b6('0x5f')][0x1]?_0x2ebc7f['attrs'][0x1][_0x19b6('0x60')]:undefined)||0x0}];default:return[];}}catch(_0xb2923c){logger[_0x19b6('0x31')](_0x19b6('0x7d'),JSON[_0x19b6('0x7e')](_0xb2923c));return[];}}exports[_0x19b6('0x7f')]=function(_0x312b08,_0x4715f7,_0x46129f){if(_0x312b08[_0x19b6('0x5a')]['id']){delete _0x312b08[_0x19b6('0x5a')]['id'];}return db[_0x19b6('0x35')]['find']({'where':{'id':_0x312b08['params']['id']}})[_0x19b6('0x2c')](handleEntityNotFound(_0x4715f7,null))[_0x19b6('0x2c')](function(_0x286de0){if(_0x286de0){_0x312b08[_0x19b6('0x5a')][_0x19b6('0x80')]=_0x286de0['id'];_0x312b08['body'][_0x19b6('0x5f')]=widgetAttributes(_0x312b08[_0x19b6('0x5a')]);return db[_0x19b6('0x81')][_0x19b6('0x50')](_0x312b08['body']);}})[_0x19b6('0x2c')](respondWithResult(_0x4715f7,null))[_0x19b6('0x56')](handleError(_0x4715f7,null));};exports[_0x19b6('0x82')]=function(_0x45a9b7,_0x1e4be4,_0x18dd3c){var _0x47ae09={};var _0x14aea1={};var _0x408228;var _0x5264dd;return db[_0x19b6('0x35')][_0x19b6('0x83')]({'where':{'id':_0x45a9b7['params']['id']}})[_0x19b6('0x2c')](handleEntityNotFound(_0x1e4be4,null))[_0x19b6('0x2c')](function(_0x1f972d){if(_0x1f972d){_0x408228=_0x1f972d;_0x14aea1[_0x19b6('0x37')]=_['keys'](db[_0x19b6('0x81')][_0x19b6('0x4c')]);_0x14aea1[_0x19b6('0x38')]=_[_0x19b6('0x39')](_0x45a9b7[_0x19b6('0x38')]);_0x14aea1[_0x19b6('0x41')]=_[_0x19b6('0x4d')](_0x14aea1[_0x19b6('0x37')],_0x14aea1[_0x19b6('0x38')]);_0x47ae09[_0x19b6('0x3a')]=_[_0x19b6('0x4d')](_0x14aea1[_0x19b6('0x37')],qs[_0x19b6('0x3b')](_0x45a9b7[_0x19b6('0x38')][_0x19b6('0x3b')]));_0x47ae09[_0x19b6('0x3a')]=_0x47ae09[_0x19b6('0x3a')]['length']?_0x47ae09[_0x19b6('0x3a')]:_0x14aea1[_0x19b6('0x37')];_0x47ae09[_0x19b6('0x3e')]=qs[_0x19b6('0x3f')](_0x45a9b7[_0x19b6('0x38')][_0x19b6('0x3f')]);_0x47ae09['where']=qs['filters'](_[_0x19b6('0x42')](_0x45a9b7[_0x19b6('0x38')],_0x14aea1['filters']));if(_0x45a9b7[_0x19b6('0x38')]['filter']){_0x47ae09[_0x19b6('0x40')]=_[_0x19b6('0x43')](_0x47ae09[_0x19b6('0x40')],{'$or':_['map'](_0x47ae09[_0x19b6('0x3a')],function(_0x25d1cf){var _0x41763a={};_0x41763a[_0x25d1cf]={'$like':'%'+_0x45a9b7['query'][_0x19b6('0x45')]+'%'};return _0x41763a;})});}_0x47ae09=_['merge']({},_0x47ae09,_0x45a9b7['options']);return _0x408228[_0x19b6('0x82')](_0x47ae09);}})['then'](function(_0x14cd0f){if(_0x14cd0f){_0x5264dd=_0x14cd0f[_0x19b6('0x4e')];if(!_0x45a9b7['query'][_0x19b6('0x3c')]('nolimit')){_0x47ae09[_0x19b6('0x25')]=qs['limit'](_0x45a9b7[_0x19b6('0x38')][_0x19b6('0x25')]);_0x47ae09[_0x19b6('0x23')]=qs['offset'](_0x45a9b7[_0x19b6('0x38')]['offset']);}return _0x408228[_0x19b6('0x82')](_0x47ae09);}})[_0x19b6('0x2c')](function(_0x2a7fc3){if(_0x2a7fc3){return _0x2a7fc3?{'count':_0x5264dd,'rows':_0x2a7fc3}:null;}})[_0x19b6('0x2c')](respondWithResult(_0x1e4be4,null))[_0x19b6('0x56')](handleError(_0x1e4be4,null));};
\ No newline at end of file
+var _0xf41a=['undefined','count','json','apply','save','update','then','get','UserProfileResource','destroy','stack','index','map','Dashboard','rawAttributes','fieldName','type','model','name','query','filters','fields','attributes','length','order','filter','where','merge','findAll','rows','catch','show','params','keys','intersection','includeAll','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','UserProfileSection','autoAssociation','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','getItems','findOne','DashboardItem','sort','pick','hasOwnProperty','nolimit','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','offset','limit'];(function(_0x3462ef,_0x51cafe){var _0x5d0ff0=function(_0x560b2f){while(--_0x560b2f){_0x3462ef['push'](_0x3462ef['shift']());}};_0x5d0ff0(++_0x51cafe);}(_0xf41a,0x1e3));var _0xaf41=function(_0x30f63d,_0xf0902b){_0x30f63d=_0x30f63d-0x0;var _0x4f59f4=_0xf41a[_0x30f63d];return _0x4f59f4;};'use strict';var emlformat=require(_0xaf41('0x0'));var rimraf=require(_0xaf41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xaf41('0x2'));var moment=require('moment');var BPromise=require(_0xaf41('0x3'));var Mustache=require(_0xaf41('0x4'));var util=require(_0xaf41('0x5'));var path=require('path');var sox=require(_0xaf41('0x6'));var csv=require(_0xaf41('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf41('0x8'));var _=require('lodash');var squel=require(_0xaf41('0x9'));var crypto=require(_0xaf41('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xaf41('0x7'));var querystring=require(_0xaf41('0xb'));var Papa=require(_0xaf41('0xc'));var Redis=require(_0xaf41('0xd'));var authService=require(_0xaf41('0xe'));var qs=require(_0xaf41('0xf'));var as=require(_0xaf41('0x10'));var hardwareService=require(_0xaf41('0x11'));var logger=require(_0xaf41('0x12'))(_0xaf41('0x13'));var utils=require(_0xaf41('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xaf41('0x15'));var db=require(_0xaf41('0x16'))['db'];config[_0xaf41('0x17')]=_['defaults'](config[_0xaf41('0x17')],{'host':_0xaf41('0x18'),'port':0x18eb});var socket=require(_0xaf41('0x19'))(new Redis(config[_0xaf41('0x17')]));require(_0xaf41('0x1a'))[_0xaf41('0x1b')](socket);function respondWithStatusCode(_0x33e1ae,_0x36d6be){_0x36d6be=_0x36d6be||0xcc;return function(_0x1fd8ff){if(_0x1fd8ff){return _0x33e1ae[_0xaf41('0x1c')](_0x36d6be);}return _0x33e1ae[_0xaf41('0x1d')](_0x36d6be)[_0xaf41('0x1e')]();};}function respondWithResult(_0x5afe35,_0x436646){_0x436646=_0x436646||0xc8;return function(_0x2275bc){if(_0x2275bc){return _0x5afe35[_0xaf41('0x1d')](_0x436646)['json'](_0x2275bc);}};}function respondWithFilteredResult(_0x38c073,_0x3feb19){return function(_0x1b5d53){if(_0x1b5d53){var _0x497c31=typeof _0x3feb19[_0xaf41('0x1f')]==='undefined'&&typeof _0x3feb19[_0xaf41('0x20')]===_0xaf41('0x21');var _0x20d7a6=_0x1b5d53['count'];var _0x5892bb=_0x497c31?0x0:_0x3feb19['offset'];var _0x418247=_0x497c31?_0x1b5d53[_0xaf41('0x22')]:_0x3feb19[_0xaf41('0x1f')]+_0x3feb19[_0xaf41('0x20')];var _0x1d701f;if(_0x418247>=_0x20d7a6){_0x418247=_0x20d7a6;_0x1d701f=0xc8;}else{_0x1d701f=0xce;}_0x38c073[_0xaf41('0x1d')](_0x1d701f);return _0x38c073['set']('Content-Range',_0x5892bb+'-'+_0x418247+'/'+_0x20d7a6)[_0xaf41('0x23')](_0x1b5d53);}return null;};}function patchUpdates(_0x2d6dd1){return function(_0x18d915){try{jsonpatch[_0xaf41('0x24')](_0x18d915,_0x2d6dd1,!![]);}catch(_0x226337){return BPromise['reject'](_0x226337);}return _0x18d915[_0xaf41('0x25')]();};}function saveUpdates(_0x35372e,_0x4f1d4a){return function(_0xdedab4){if(_0xdedab4){return _0xdedab4[_0xaf41('0x26')](_0x35372e)[_0xaf41('0x27')](function(_0x229075){return _0x229075;});}return null;};}function removeEntity(_0x15ab1e,_0xda6a0d){return function(_0x57f364){if(_0x57f364){return _0x57f364['destroy']()[_0xaf41('0x27')](function(){var _0xe304ea=_0x57f364[_0xaf41('0x28')]({'plain':!![]});var _0x14230d='CustomDashboards';return db[_0xaf41('0x29')][_0xaf41('0x2a')]({'where':{'type':_0x14230d,'resourceId':_0xe304ea['id']}})[_0xaf41('0x27')](function(){return _0x57f364;});})[_0xaf41('0x27')](function(){_0x15ab1e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x291505,_0x88be75){return function(_0x9fa473){if(!_0x9fa473){_0x291505['sendStatus'](0x194);}return _0x9fa473;};}function handleError(_0x2c624c,_0x233b60){_0x233b60=_0x233b60||0x1f4;return function(_0x2b82d3){logger['error'](_0x2b82d3[_0xaf41('0x2b')]);if(_0x2b82d3['name']){delete _0x2b82d3['name'];}_0x2c624c['status'](_0x233b60)['send'](_0x2b82d3);};}exports[_0xaf41('0x2c')]=function(_0x502097,_0x10b2e6){var _0x2bb3a5={},_0x33e0fa={},_0x4a76e9={'count':0x0,'rows':[]};var _0x2586f3=_[_0xaf41('0x2d')](db[_0xaf41('0x2e')][_0xaf41('0x2f')],function(_0x3caf82){return{'name':_0x3caf82[_0xaf41('0x30')],'type':_0x3caf82[_0xaf41('0x31')]['key']};});_0x33e0fa[_0xaf41('0x32')]=_[_0xaf41('0x2d')](_0x2586f3,_0xaf41('0x33'));_0x33e0fa[_0xaf41('0x34')]=_['keys'](_0x502097[_0xaf41('0x34')]);_0x33e0fa[_0xaf41('0x35')]=_['intersection'](_0x33e0fa[_0xaf41('0x32')],_0x33e0fa[_0xaf41('0x34')]);_0x2bb3a5['attributes']=_['intersection'](_0x33e0fa[_0xaf41('0x32')],qs[_0xaf41('0x36')](_0x502097[_0xaf41('0x34')][_0xaf41('0x36')]));_0x2bb3a5['attributes']=_0x2bb3a5[_0xaf41('0x37')][_0xaf41('0x38')]?_0x2bb3a5['attributes']:_0x33e0fa[_0xaf41('0x32')];if(!_0x502097[_0xaf41('0x34')]['hasOwnProperty']('nolimit')){_0x2bb3a5[_0xaf41('0x20')]=qs['limit'](_0x502097['query'][_0xaf41('0x20')]);_0x2bb3a5[_0xaf41('0x1f')]=qs[_0xaf41('0x1f')](_0x502097[_0xaf41('0x34')][_0xaf41('0x1f')]);}_0x2bb3a5[_0xaf41('0x39')]=qs['sort'](_0x502097[_0xaf41('0x34')]['sort']);_0x2bb3a5['where']=qs[_0xaf41('0x35')](_['pick'](_0x502097['query'],_0x33e0fa[_0xaf41('0x35')]),_0x2586f3);if(_0x502097[_0xaf41('0x34')][_0xaf41('0x3a')]){_0x2bb3a5[_0xaf41('0x3b')]=_[_0xaf41('0x3c')](_0x2bb3a5[_0xaf41('0x3b')],{'$or':_[_0xaf41('0x2d')](_0x2586f3,function(_0x36a02c){if(_0x36a02c[_0xaf41('0x31')]!=='VIRTUAL'){var _0x322dc1={};_0x322dc1[_0x36a02c['name']]={'$like':'%'+_0x502097['query'][_0xaf41('0x3a')]+'%'};return _0x322dc1;}})});}_0x2bb3a5=_[_0xaf41('0x3c')]({},_0x2bb3a5,_0x502097['options']);var _0x1bbd26={'where':_0x2bb3a5[_0xaf41('0x3b')]};return db['Dashboard'][_0xaf41('0x22')](_0x1bbd26)[_0xaf41('0x27')](function(_0x10bef4){_0x4a76e9['count']=_0x10bef4;if(_0x502097[_0xaf41('0x34')]['includeAll']){_0x2bb3a5['include']=[{'all':!![]}];}return db[_0xaf41('0x2e')][_0xaf41('0x3d')](_0x2bb3a5);})[_0xaf41('0x27')](function(_0x554e84){_0x4a76e9[_0xaf41('0x3e')]=_0x554e84;return _0x4a76e9;})['then'](respondWithFilteredResult(_0x10b2e6,_0x2bb3a5))[_0xaf41('0x3f')](handleError(_0x10b2e6,null));};exports[_0xaf41('0x40')]=function(_0x18e131,_0x1e96df){var _0x5b94af={'raw':![],'where':{'id':_0x18e131[_0xaf41('0x41')]['id']}},_0x1d55d3={};_0x1d55d3['model']=_[_0xaf41('0x42')](db['Dashboard'][_0xaf41('0x2f')]);_0x1d55d3[_0xaf41('0x34')]=_[_0xaf41('0x42')](_0x18e131[_0xaf41('0x34')]);_0x1d55d3[_0xaf41('0x35')]=_['intersection'](_0x1d55d3['model'],_0x1d55d3[_0xaf41('0x34')]);_0x5b94af['attributes']=_[_0xaf41('0x43')](_0x1d55d3[_0xaf41('0x32')],qs[_0xaf41('0x36')](_0x18e131[_0xaf41('0x34')][_0xaf41('0x36')]));_0x5b94af[_0xaf41('0x37')]=_0x5b94af['attributes'][_0xaf41('0x38')]?_0x5b94af[_0xaf41('0x37')]:_0x1d55d3['model'];if(_0x18e131[_0xaf41('0x34')][_0xaf41('0x44')]){_0x5b94af[_0xaf41('0x45')]=[{'all':!![]}];}_0x5b94af=_[_0xaf41('0x3c')]({},_0x5b94af,_0x18e131[_0xaf41('0x46')]);return db[_0xaf41('0x2e')][_0xaf41('0x47')](_0x5b94af)[_0xaf41('0x27')](handleEntityNotFound(_0x1e96df,null))[_0xaf41('0x27')](respondWithResult(_0x1e96df,null))[_0xaf41('0x3f')](handleError(_0x1e96df,null));};exports[_0xaf41('0x48')]=function(_0x1b7465,_0x5856bf){return db[_0xaf41('0x2e')][_0xaf41('0x48')](_0x1b7465[_0xaf41('0x49')],{})[_0xaf41('0x27')](function(_0x4c930e){var _0x22caa9=_0x1b7465[_0xaf41('0x4a')]['get']({'plain':!![]});if(!_0x22caa9)throw new Error(_0xaf41('0x4b'));if(_0x22caa9[_0xaf41('0x4c')]===_0xaf41('0x4a')){var _0xafaa7=_0x4c930e[_0xaf41('0x28')]({'plain':!![]});var _0x1cca0=_0xaf41('0x4d');return db['UserProfileSection'][_0xaf41('0x47')]({'where':{'name':_0x1cca0,'userProfileId':_0x22caa9[_0xaf41('0x4e')]},'raw':!![]})['then'](function(_0x5e5201){if(_0x5e5201&&_0x5e5201['autoAssociation']===0x0){return db[_0xaf41('0x29')][_0xaf41('0x48')]({'name':_0xafaa7[_0xaf41('0x33')],'resourceId':_0xafaa7['id'],'type':_0x5e5201[_0xaf41('0x33')],'sectionId':_0x5e5201['id']},{})[_0xaf41('0x27')](function(){return _0x4c930e;});}else{return _0x4c930e;}})['catch'](function(_0x410d04){logger[_0xaf41('0x4f')](_0xaf41('0x50'),_0x410d04);throw _0x410d04;});}return _0x4c930e;})[_0xaf41('0x27')](respondWithResult(_0x5856bf,0xc9))['catch'](handleError(_0x5856bf,null));};exports[_0xaf41('0x51')]=function(_0x9d2c32,_0x3074d2){var _0x1601ac={'where':{'id':_0x9d2c32[_0xaf41('0x41')]['id']}},_0x5b380b={};_0x5b380b[_0xaf41('0x32')]=_['keys'](db[_0xaf41('0x2e')][_0xaf41('0x2f')]);_0x1601ac[_0xaf41('0x37')]=_['intersection'](_0x5b380b[_0xaf41('0x32')],qs[_0xaf41('0x36')](_0x9d2c32[_0xaf41('0x34')][_0xaf41('0x36')]));_0x1601ac[_0xaf41('0x37')]=_0x1601ac[_0xaf41('0x37')][_0xaf41('0x38')]?_0x1601ac['attributes']:_0x5b380b[_0xaf41('0x32')];if(_0x9d2c32[_0xaf41('0x34')]['includeAll']){_0x1601ac[_0xaf41('0x45')]=[{'all':!![]}];}_0x1601ac=_[_0xaf41('0x3c')]({},_0x1601ac,_0x9d2c32[_0xaf41('0x46')]);return db[_0xaf41('0x2e')][_0xaf41('0x47')](_0x1601ac)['then'](handleEntityNotFound(_0x3074d2,null))['then'](function(_0x425caa){if(_0x425caa){var _0x3f3814=_0x425caa[_0xaf41('0x28')]({'plain':!![]});_0x3f3814=qs['omit'](_0x3f3814,['id',_0xaf41('0x52'),_0xaf41('0x53')]);_0x9d2c32['body']=_[_0xaf41('0x54')](_0x9d2c32['body'],['id','createdAt',_0xaf41('0x53')]);return db[_0xaf41('0x2e')][_0xaf41('0x48')](_[_0xaf41('0x3c')](_0x3f3814,_0x9d2c32['body']),{'include':_0x9d2c32[_0xaf41('0x34')][_0xaf41('0x44')]?[{'all':!![]}]:undefined})[_0xaf41('0x27')](function(_0x3a121b){var _0x5b0c71=_0x9d2c32['user'][_0xaf41('0x28')]({'plain':!![]});if(!_0x5b0c71)throw new Error(_0xaf41('0x4b'));if(_0x5b0c71[_0xaf41('0x4c')]===_0xaf41('0x4a')){var _0x417058=_0x3a121b[_0xaf41('0x28')]({'plain':!![]});var _0x25473f='CustomDashboards';return db[_0xaf41('0x55')][_0xaf41('0x47')]({'where':{'name':_0x25473f,'userProfileId':_0x5b0c71[_0xaf41('0x4e')]},'raw':!![]})[_0xaf41('0x27')](function(_0x96b3c2){if(_0x96b3c2&&_0x96b3c2[_0xaf41('0x56')]===0x0){return db[_0xaf41('0x29')][_0xaf41('0x48')]({'name':_0x417058[_0xaf41('0x33')],'resourceId':_0x417058['id'],'type':_0x96b3c2[_0xaf41('0x33')],'sectionId':_0x96b3c2['id']},{})[_0xaf41('0x27')](function(){return _0x3a121b;});}else{return _0x3a121b;}})[_0xaf41('0x3f')](function(_0x39c379){logger[_0xaf41('0x4f')](_0xaf41('0x50'),_0x39c379);throw _0x39c379;});}return _0x3a121b;});}})[_0xaf41('0x27')](respondWithResult(_0x3074d2,0xc9))[_0xaf41('0x3f')](handleError(_0x3074d2,null));};exports[_0xaf41('0x26')]=function(_0x6f929c,_0x4486a8){if(_0x6f929c['body']['id']){delete _0x6f929c[_0xaf41('0x49')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x6f929c['params']['id']}})[_0xaf41('0x27')](handleEntityNotFound(_0x4486a8,null))[_0xaf41('0x27')](saveUpdates(_0x6f929c[_0xaf41('0x49')],null))['then'](respondWithResult(_0x4486a8,null))[_0xaf41('0x3f')](handleError(_0x4486a8,null));};exports['destroy']=function(_0x4ddcad,_0x2a8578){return db['Dashboard'][_0xaf41('0x47')]({'where':{'id':_0x4ddcad[_0xaf41('0x41')]['id']}})[_0xaf41('0x27')](handleEntityNotFound(_0x2a8578,null))['then'](removeEntity(_0x2a8578,null))[_0xaf41('0x3f')](handleError(_0x2a8578,null));};function widgetAttributes(_0x1ea3ef){try{switch(_0x1ea3ef['type']){case'iframe':return[{'name':_0xaf41('0x57'),'value':_0x1ea3ef['attrUrl']||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0x0]?_0x1ea3ef[_0xaf41('0x58')][0x0][_0xaf41('0x59')]:undefined)||_0xaf41('0x5a')}];case _0xaf41('0x5b'):return[{'name':'attrPath','value':_0x1ea3ef[_0xaf41('0x5c')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0x0]?_0x1ea3ef[_0xaf41('0x58')][0x0][_0xaf41('0x59')]:undefined)||''}];case _0xaf41('0x5d'):return[{'name':_0xaf41('0x5e'),'value':_0x1ea3ef[_0xaf41('0x5e')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef['attrs'][0x0]?_0x1ea3ef[_0xaf41('0x58')][0x0]['value']:undefined)||_0xaf41('0x5f')},{'name':_0xaf41('0x60'),'value':_0x1ea3ef['attrTimezone']||(_0x1ea3ef['attrs']&&_0x1ea3ef[_0xaf41('0x58')][0x1]?_0x1ea3ef[_0xaf41('0x58')][0x1]['value']:undefined)||_0xaf41('0x61')},{'name':_0xaf41('0x62'),'value':_0x1ea3ef[_0xaf41('0x62')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0x2]?_0x1ea3ef[_0xaf41('0x58')][0x2]['value']:undefined)||0xc}];case _0xaf41('0x63'):return[{'name':_0xaf41('0x64'),'value':_0x1ea3ef[_0xaf41('0x64')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0x0]?_0x1ea3ef[_0xaf41('0x58')][0x0][_0xaf41('0x59')]:undefined)||_0xaf41('0x65')},{'name':_0xaf41('0x66'),'value':_0x1ea3ef[_0xaf41('0x66')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0x1]?_0x1ea3ef['attrs'][0x1][_0xaf41('0x59')]:undefined)||[]},{'name':_0xaf41('0x62'),'value':_0x1ea3ef[_0xaf41('0x62')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0x2]?_0x1ea3ef[_0xaf41('0x58')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x1ea3ef[_0xaf41('0x67')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0x3]?_0x1ea3ef[_0xaf41('0x58')][0x3][_0xaf41('0x59')]:undefined)||_0xaf41('0x68')},{'name':_0xaf41('0x69'),'value':_0x1ea3ef[_0xaf41('0x69')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0x4]?_0x1ea3ef[_0xaf41('0x58')][0x4][_0xaf41('0x59')]:undefined)||''},{'name':_0xaf41('0x6a'),'value':_0x1ea3ef[_0xaf41('0x6a')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef['attrs'][0x5]?_0x1ea3ef[_0xaf41('0x58')][0x5][_0xaf41('0x59')]:undefined)||''},{'name':_0xaf41('0x6b'),'value':_0x1ea3ef[_0xaf41('0x6b')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0x6]?_0x1ea3ef[_0xaf41('0x58')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1ea3ef[_0xaf41('0x6c')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0x7]?_0x1ea3ef['attrs'][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1ea3ef[_0xaf41('0x6d')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef['attrs'][0x8]?_0x1ea3ef['attrs'][0x8][_0xaf41('0x59')]:undefined)||''},{'name':_0xaf41('0x6e'),'value':_0x1ea3ef[_0xaf41('0x6e')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0x9]?_0x1ea3ef[_0xaf41('0x58')][0x9][_0xaf41('0x59')]:undefined)||''}];case'multibar-chart':case _0xaf41('0x6f'):return[{'name':_0xaf41('0x70'),'value':_0x1ea3ef[_0xaf41('0x70')]||(_0x1ea3ef['attrs']&&_0x1ea3ef['attrs'][0x0]?_0x1ea3ef[_0xaf41('0x58')][0x0]['value']:undefined)||'total'},{'name':'attrSerie2','value':_0x1ea3ef[_0xaf41('0x71')]||(_0x1ea3ef['attrs']&&_0x1ea3ef[_0xaf41('0x58')][0x1]?_0x1ea3ef[_0xaf41('0x58')][0x1][_0xaf41('0x59')]:undefined)||null},{'name':_0xaf41('0x72'),'value':_0x1ea3ef[_0xaf41('0x72')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef['attrs'][0x2]?_0x1ea3ef[_0xaf41('0x58')][0x2]['value']:undefined)||null},{'name':_0xaf41('0x66'),'value':_0x1ea3ef['attrVoiceQueues']||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0x3]?_0x1ea3ef[_0xaf41('0x58')][0x3]['value']:undefined)||[]},{'name':_0xaf41('0x67'),'value':_0x1ea3ef[_0xaf41('0x67')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0x4]?_0x1ea3ef[_0xaf41('0x58')][0x4][_0xaf41('0x59')]:undefined)||_0xaf41('0x68')},{'name':'attrEmailAccounts','value':_0x1ea3ef[_0xaf41('0x69')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0x5]?_0x1ea3ef['attrs'][0x5][_0xaf41('0x59')]:undefined)||''},{'name':_0xaf41('0x6a'),'value':_0x1ea3ef[_0xaf41('0x6a')]||(_0x1ea3ef['attrs']&&_0x1ea3ef['attrs'][0x6]?_0x1ea3ef[_0xaf41('0x58')][0x6][_0xaf41('0x59')]:undefined)||''},{'name':_0xaf41('0x6b'),'value':_0x1ea3ef['attrSmsAccounts']||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0x7]?_0x1ea3ef[_0xaf41('0x58')][0x7][_0xaf41('0x59')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1ea3ef[_0xaf41('0x6c')]||(_0x1ea3ef['attrs']&&_0x1ea3ef[_0xaf41('0x58')][0x8]?_0x1ea3ef[_0xaf41('0x58')][0x8]['value']:undefined)||''},{'name':_0xaf41('0x6d'),'value':_0x1ea3ef[_0xaf41('0x6d')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0x9]?_0x1ea3ef[_0xaf41('0x58')][0x9]['value']:undefined)||''},{'name':_0xaf41('0x6e'),'value':_0x1ea3ef['attrChatWebsites']||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0xa]?_0x1ea3ef[_0xaf41('0x58')][0xa][_0xaf41('0x59')]:undefined)||''}];case _0xaf41('0x73'):return[{'name':_0xaf41('0x74'),'type':_0x1ea3ef[_0xaf41('0x75')]||(_0x1ea3ef['attrs']&&_0x1ea3ef[_0xaf41('0x58')][0x0]?_0x1ea3ef[_0xaf41('0x58')][0x0]['type']:undefined)||null,'value':_0x1ea3ef[_0xaf41('0x74')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef[_0xaf41('0x58')][0x0]?_0x1ea3ef['attrs'][0x0][_0xaf41('0x59')]:undefined)||null},{'name':_0xaf41('0x76'),'value':_0x1ea3ef[_0xaf41('0x76')]||(_0x1ea3ef[_0xaf41('0x58')]&&_0x1ea3ef['attrs'][0x1]?_0x1ea3ef[_0xaf41('0x58')][0x1][_0xaf41('0x59')]:undefined)||0x0}];default:return[];}}catch(_0x4e4186){logger[_0xaf41('0x4f')](_0xaf41('0x77'),JSON[_0xaf41('0x78')](_0x4e4186));return[];}}exports['addItem']=function(_0x28cd4e,_0x66c3ec,_0x326f3f){if(_0x28cd4e[_0xaf41('0x49')]['id']){delete _0x28cd4e[_0xaf41('0x49')]['id'];}return db['Dashboard'][_0xaf41('0x47')]({'where':{'id':_0x28cd4e[_0xaf41('0x41')]['id']}})['then'](handleEntityNotFound(_0x66c3ec,null))[_0xaf41('0x27')](function(_0x2dcfa6){if(_0x2dcfa6){_0x28cd4e['body'][_0xaf41('0x79')]=_0x2dcfa6['id'];_0x28cd4e[_0xaf41('0x49')][_0xaf41('0x58')]=widgetAttributes(_0x28cd4e['body']);return db['DashboardItem']['create'](_0x28cd4e[_0xaf41('0x49')]);}})[_0xaf41('0x27')](respondWithResult(_0x66c3ec,null))['catch'](handleError(_0x66c3ec,null));};exports[_0xaf41('0x7a')]=function(_0x3aea33,_0x35f568,_0x5216da){var _0x4e1049={};var _0xb34dc3={};var _0x30f223;var _0x47e02c;return db[_0xaf41('0x2e')][_0xaf41('0x7b')]({'where':{'id':_0x3aea33[_0xaf41('0x41')]['id']}})[_0xaf41('0x27')](handleEntityNotFound(_0x35f568,null))[_0xaf41('0x27')](function(_0x33ab90){if(_0x33ab90){_0x30f223=_0x33ab90;_0xb34dc3[_0xaf41('0x32')]=_[_0xaf41('0x42')](db[_0xaf41('0x7c')]['rawAttributes']);_0xb34dc3[_0xaf41('0x34')]=_[_0xaf41('0x42')](_0x3aea33[_0xaf41('0x34')]);_0xb34dc3[_0xaf41('0x35')]=_[_0xaf41('0x43')](_0xb34dc3[_0xaf41('0x32')],_0xb34dc3[_0xaf41('0x34')]);_0x4e1049[_0xaf41('0x37')]=_[_0xaf41('0x43')](_0xb34dc3[_0xaf41('0x32')],qs[_0xaf41('0x36')](_0x3aea33[_0xaf41('0x34')][_0xaf41('0x36')]));_0x4e1049[_0xaf41('0x37')]=_0x4e1049[_0xaf41('0x37')][_0xaf41('0x38')]?_0x4e1049[_0xaf41('0x37')]:_0xb34dc3[_0xaf41('0x32')];_0x4e1049[_0xaf41('0x39')]=qs[_0xaf41('0x7d')](_0x3aea33[_0xaf41('0x34')][_0xaf41('0x7d')]);_0x4e1049[_0xaf41('0x3b')]=qs[_0xaf41('0x35')](_[_0xaf41('0x7e')](_0x3aea33[_0xaf41('0x34')],_0xb34dc3[_0xaf41('0x35')]));if(_0x3aea33[_0xaf41('0x34')][_0xaf41('0x3a')]){_0x4e1049[_0xaf41('0x3b')]=_[_0xaf41('0x3c')](_0x4e1049[_0xaf41('0x3b')],{'$or':_[_0xaf41('0x2d')](_0x4e1049[_0xaf41('0x37')],function(_0x34cf32){var _0x153a8d={};_0x153a8d[_0x34cf32]={'$like':'%'+_0x3aea33[_0xaf41('0x34')]['filter']+'%'};return _0x153a8d;})});}_0x4e1049=_['merge']({},_0x4e1049,_0x3aea33[_0xaf41('0x46')]);return _0x30f223[_0xaf41('0x7a')](_0x4e1049);}})[_0xaf41('0x27')](function(_0x47a0bf){if(_0x47a0bf){_0x47e02c=_0x47a0bf[_0xaf41('0x38')];if(!_0x3aea33[_0xaf41('0x34')][_0xaf41('0x7f')](_0xaf41('0x80'))){_0x4e1049[_0xaf41('0x20')]=qs[_0xaf41('0x20')](_0x3aea33[_0xaf41('0x34')]['limit']);_0x4e1049['offset']=qs['offset'](_0x3aea33['query'][_0xaf41('0x1f')]);}return _0x30f223['getItems'](_0x4e1049);}})[_0xaf41('0x27')](function(_0x5272bc){if(_0x5272bc){return _0x5272bc?{'count':_0x47e02c,'rows':_0x5272bc}:null;}})[_0xaf41('0x27')](respondWithResult(_0x35f568,null))[_0xaf41('0x3f')](handleError(_0x35f568,null));};
\ No newline at end of file
index 0851ccd..7e0982c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7961=['events','Dashboard','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x12b97a,_0x21d79a){var _0x1c61ca=function(_0x3c3361){while(--_0x3c3361){_0x12b97a['push'](_0x12b97a['shift']());}};_0x1c61ca(++_0x21d79a);}(_0x7961,0x88));var _0x1796=function(_0x55d652,_0xc45bdb){_0x55d652=_0x55d652-0x0;var _0x1371f3=_0x7961[_0x55d652];return _0x1371f3;};'use strict';var EventEmitter=require(_0x1796('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x1796('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x1796('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1796('0x3'),'afterDestroy':_0x1796('0x4')};function emitEvent(_0x4c3469){return function(_0x2b4aaa,_0x5077ec,_0x3558e8){DashboardEvents[_0x1796('0x5')](_0x4c3469+':'+_0x2b4aaa['id'],_0x2b4aaa);DashboardEvents[_0x1796('0x5')](_0x4c3469,_0x2b4aaa);_0x3558e8(null);};}for(var e in events){if(events[_0x1796('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x1796('0x7')]=DashboardEvents;
\ No newline at end of file
+var _0x3338=['events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1d5eb5,_0x110fc2){var _0x15a66c=function(_0x4f77f4){while(--_0x4f77f4){_0x1d5eb5['push'](_0x1d5eb5['shift']());}};_0x15a66c(++_0x110fc2);}(_0x3338,0xb0));var _0x8333=function(_0x212bf5,_0x165cbd){_0x212bf5=_0x212bf5-0x0;var _0xfcad21=_0x3338[_0x212bf5];return _0xfcad21;};'use strict';var EventEmitter=require(_0x8333('0x0'));var Dashboard=require(_0x8333('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8333('0x2'),'afterUpdate':_0x8333('0x3'),'afterDestroy':_0x8333('0x4')};function emitEvent(_0x191dac){return function(_0x124758,_0x366ac1,_0x37841c){DashboardEvents[_0x8333('0x5')](_0x191dac+':'+_0x124758['id'],_0x124758);DashboardEvents[_0x8333('0x5')](_0x191dac,_0x124758);_0x37841c(null);};}for(var e in events){if(events[_0x8333('0x6')](e)){var event=events[e];Dashboard[_0x8333('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents;
\ No newline at end of file
index 15b764c..e083d3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa81e=['../../config/environment','./dashboard.attributes','exports','Dashboard','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xf9c730,_0x5a0268){var _0x19f986=function(_0x3ef98e){while(--_0x3ef98e){_0xf9c730['push'](_0xf9c730['shift']());}};_0x19f986(++_0x5a0268);}(_0xa81e,0x13c));var _0xea81=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xa81e[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0xea81('0x0'));var util=require(_0xea81('0x1'));var logger=require(_0xea81('0x2'))('api');var moment=require(_0xea81('0x3'));var BPromise=require(_0xea81('0x4'));var rp=require(_0xea81('0x5'));var fs=require('fs');var path=require(_0xea81('0x6'));var rimraf=require(_0xea81('0x7'));var config=require(_0xea81('0x8'));var attributes=require(_0xea81('0x9'));module[_0xea81('0xa')]=function(_0x2c0cbf,_0x352b8b){return _0x2c0cbf['define'](_0xea81('0xb'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbc5f=['request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x572e34,_0x585ed7){var _0x72b3ec=function(_0xa672ae){while(--_0xa672ae){_0x572e34['push'](_0x572e34['shift']());}};_0x72b3ec(++_0x585ed7);}(_0xbc5f,0x120));var _0xfbc5=function(_0x4e80d7,_0x2a5a16){_0x4e80d7=_0x4e80d7-0x0;var _0x13056d=_0xbc5f[_0x4e80d7];return _0x13056d;};'use strict';var _=require(_0xfbc5('0x0'));var util=require(_0xfbc5('0x1'));var logger=require(_0xfbc5('0x2'))(_0xfbc5('0x3'));var moment=require(_0xfbc5('0x4'));var BPromise=require(_0xfbc5('0x5'));var rp=require(_0xfbc5('0x6'));var fs=require('fs');var path=require(_0xfbc5('0x7'));var rimraf=require(_0xfbc5('0x8'));var config=require(_0xfbc5('0x9'));var attributes=require(_0xfbc5('0xa'));module[_0xfbc5('0xb')]=function(_0x5543a3,_0x596e9d){return _0x5543a3['define'](_0xfbc5('0xc'),attributes,{'tableName':_0xfbc5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 831f127..00c0e58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbda4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xdc0a2e,_0x48da81){var _0x3fc758=function(_0x4cb962){while(--_0x4cb962){_0xdc0a2e['push'](_0xdc0a2e['shift']());}};_0x3fc758(++_0x48da81);}(_0xbda4,0x9b));var _0x4bda=function(_0x41db07,_0x57027e){_0x41db07=_0x41db07-0x0;var _0x4949c4=_0xbda4[_0x41db07];return _0x4949c4;};'use strict';var _=require(_0x4bda('0x0'));var util=require(_0x4bda('0x1'));var moment=require(_0x4bda('0x2'));var BPromise=require(_0x4bda('0x3'));var rs=require(_0x4bda('0x4'));var fs=require('fs');var Redis=require(_0x4bda('0x5'));var db=require(_0x4bda('0x6'))['db'];var utils=require(_0x4bda('0x7'));var logger=require(_0x4bda('0x8'))(_0x4bda('0x9'));var config=require(_0x4bda('0xa'));var jayson=require(_0x4bda('0xb'));var client=jayson[_0x4bda('0xc')][_0x4bda('0xd')]({'port':0x232a});config[_0x4bda('0xe')]=_[_0x4bda('0xf')](config[_0x4bda('0xe')],{'host':_0x4bda('0x10'),'port':0x18eb});var socket=require(_0x4bda('0x11'))(new Redis(config[_0x4bda('0xe')]));require(_0x4bda('0x12'))[_0x4bda('0x13')](socket);function respondWithRpcPromise(_0x3a3ef8,_0x5e3e99,_0x1539a7){return new BPromise(function(_0x3d51ce,_0x1e4ef5){return client[_0x4bda('0x14')](_0x3a3ef8,_0x1539a7)[_0x4bda('0x15')](function(_0x343024){logger[_0x4bda('0x16')](_0x4bda('0x17'),_0x5e3e99,_0x4bda('0x18'));logger[_0x4bda('0x19')](_0x4bda('0x1a'),_0x5e3e99,_0x4bda('0x18'),JSON[_0x4bda('0x1b')](_0x343024));if(_0x343024[_0x4bda('0x1c')]){if(_0x343024[_0x4bda('0x1c')][_0x4bda('0x1d')]===0x1f4){logger['error'](_0x4bda('0x17'),_0x5e3e99,_0x343024[_0x4bda('0x1c')][_0x4bda('0x1e')]);return _0x1e4ef5(_0x343024[_0x4bda('0x1c')][_0x4bda('0x1e')]);}logger[_0x4bda('0x1c')](_0x4bda('0x17'),_0x5e3e99,_0x343024[_0x4bda('0x1c')][_0x4bda('0x1e')]);return _0x3d51ce(_0x343024[_0x4bda('0x1c')][_0x4bda('0x1e')]);}else{logger[_0x4bda('0x16')](_0x4bda('0x17'),_0x5e3e99,_0x4bda('0x18'));_0x3d51ce(_0x343024['result']['message']);}})[_0x4bda('0x1f')](function(_0x3390e4){logger[_0x4bda('0x1c')](_0x4bda('0x17'),_0x5e3e99,_0x3390e4);_0x1e4ef5(_0x3390e4);});});}
\ No newline at end of file
+var _0x5e4b=['error','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','defaults','localhost','socket.io-emitter','redis','./dashboard.socket','request','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x30ae7f,_0x3a31d2){var _0x67fffd=function(_0x3bce4d){while(--_0x3bce4d){_0x30ae7f['push'](_0x30ae7f['shift']());}};_0x67fffd(++_0x3a31d2);}(_0x5e4b,0x15d));var _0xb5e4=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x5e4b[_0x50007c];return _0x5c1ec7;};'use strict';var _=require('lodash');var util=require(_0xb5e4('0x0'));var moment=require(_0xb5e4('0x1'));var BPromise=require(_0xb5e4('0x2'));var rs=require(_0xb5e4('0x3'));var fs=require('fs');var Redis=require(_0xb5e4('0x4'));var db=require(_0xb5e4('0x5'))['db'];var utils=require(_0xb5e4('0x6'));var logger=require('../../config/logger')(_0xb5e4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb5e4('0x8')]['http']({'port':0x232a});config['redis']=_[_0xb5e4('0x9')](config['redis'],{'host':_0xb5e4('0xa'),'port':0x18eb});var socket=require(_0xb5e4('0xb'))(new Redis(config[_0xb5e4('0xc')]));require(_0xb5e4('0xd'))['register'](socket);function respondWithRpcPromise(_0x4fc698,_0x43546d,_0x2eba20){return new BPromise(function(_0x41618f,_0x329833){return client[_0xb5e4('0xe')](_0x4fc698,_0x2eba20)['then'](function(_0x399a2e){logger['info'](_0xb5e4('0xf'),_0x43546d,_0xb5e4('0x10'));logger[_0xb5e4('0x11')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x43546d,'request\x20sent',JSON[_0xb5e4('0x12')](_0x399a2e));if(_0x399a2e[_0xb5e4('0x13')]){if(_0x399a2e[_0xb5e4('0x13')]['code']===0x1f4){logger['error'](_0xb5e4('0xf'),_0x43546d,_0x399a2e[_0xb5e4('0x13')][_0xb5e4('0x14')]);return _0x329833(_0x399a2e[_0xb5e4('0x13')]['message']);}logger[_0xb5e4('0x13')](_0xb5e4('0xf'),_0x43546d,_0x399a2e[_0xb5e4('0x13')][_0xb5e4('0x14')]);return _0x41618f(_0x399a2e[_0xb5e4('0x13')]['message']);}else{logger[_0xb5e4('0x15')](_0xb5e4('0xf'),_0x43546d,_0xb5e4('0x10'));_0x41618f(_0x399a2e['result'][_0xb5e4('0x14')]);}})[_0xb5e4('0x16')](function(_0x2c5a79){logger[_0xb5e4('0x13')](_0xb5e4('0xf'),_0x43546d,_0x2c5a79);_0x329833(_0x2c5a79);});});}
\ No newline at end of file
index 8cead51..fbdb921 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dc7=['length','update','emit','removeListener','register'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x4dc7,0x146));var _0x74dc=function(_0x25f4b1,_0x5615c1){_0x25f4b1=_0x25f4b1-0x0;var _0x29541c=_0x4dc7[_0x25f4b1];return _0x29541c;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save','remove',_0x74dc('0x0')];function createListener(_0x13943f,_0x29e101){return function(_0x1fce26){_0x29e101[_0x74dc('0x1')](_0x13943f,_0x1fce26);};}function removeListener(_0x2de721,_0x155b66){return function(){DashboardEvents[_0x74dc('0x2')](_0x2de721,_0x155b66);};}exports[_0x74dc('0x3')]=function(_0x51a549){for(var _0x4ece0e=0x0,_0x579088=events[_0x74dc('0x4')];_0x4ece0e<_0x579088;_0x4ece0e++){var _0x3ceb33=events[_0x4ece0e];var _0x3c411e=createListener('dashboard:'+_0x3ceb33,_0x51a549);DashboardEvents['on'](_0x3ceb33,_0x3c411e);}};
\ No newline at end of file
+var _0x0dc9=['./dashboard.events','save','remove','emit','register','length','dashboard:'];(function(_0x48e712,_0x15300e){var _0x16d356=function(_0x51c005){while(--_0x51c005){_0x48e712['push'](_0x48e712['shift']());}};_0x16d356(++_0x15300e);}(_0x0dc9,0x150));var _0x90dc=function(_0x3c9741,_0x557e3d){_0x3c9741=_0x3c9741-0x0;var _0x72aa01=_0x0dc9[_0x3c9741];return _0x72aa01;};'use strict';var DashboardEvents=require(_0x90dc('0x0'));var events=[_0x90dc('0x1'),_0x90dc('0x2'),'update'];function createListener(_0x53ad18,_0x470c84){return function(_0x587fb0){_0x470c84[_0x90dc('0x3')](_0x53ad18,_0x587fb0);};}function removeListener(_0x1248e9,_0x2c3258){return function(){DashboardEvents['removeListener'](_0x1248e9,_0x2c3258);};}exports[_0x90dc('0x4')]=function(_0x20c833){for(var _0x2a1275=0x0,_0x255ad7=events[_0x90dc('0x5')];_0x2a1275<_0x255ad7;_0x2a1275++){var _0x3fdd2b=events[_0x2a1275];var _0x6089a6=createListener(_0x90dc('0x6')+_0x3fdd2b,_0x20c833);DashboardEvents['on'](_0x3fdd2b,_0x6089a6);}};
\ No newline at end of file
index 48f64cc..569ebb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2633=['destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','/:id','show','/:id/items','create','post','/:id/clone','clone','addItem','put','update','delete'];(function(_0x34102c,_0x4ffa86){var _0xbb05e2=function(_0x1d27ad){while(--_0x1d27ad){_0x34102c['push'](_0x34102c['shift']());}};_0xbb05e2(++_0x4ffa86);}(_0x2633,0xff));var _0x3263=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x2633[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require('multer');var util=require(_0x3263('0x0'));var path=require(_0x3263('0x1'));var timeout=require(_0x3263('0x2'));var express=require('express');var router=express[_0x3263('0x3')]();var fs_extra=require(_0x3263('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3263('0x5'));var config=require(_0x3263('0x6'));var controller=require(_0x3263('0x7'));router[_0x3263('0x8')]('/',auth[_0x3263('0x9')](),controller['index']);router[_0x3263('0x8')](_0x3263('0xa'),auth[_0x3263('0x9')](),controller[_0x3263('0xb')]);router[_0x3263('0x8')](_0x3263('0xc'),auth[_0x3263('0x9')](),controller['getItems']);router['post']('/',auth[_0x3263('0x9')](),controller[_0x3263('0xd')]);router[_0x3263('0xe')](_0x3263('0xf'),auth['isAuthenticated'](),controller[_0x3263('0x10')]);router[_0x3263('0xe')]('/:id/items',auth[_0x3263('0x9')](),controller[_0x3263('0x11')]);router[_0x3263('0x12')](_0x3263('0xa'),auth[_0x3263('0x9')](),controller[_0x3263('0x13')]);router[_0x3263('0x14')](_0x3263('0xa'),auth['isAuthenticated'](),controller[_0x3263('0x15')]);module[_0x3263('0x16')]=router;
\ No newline at end of file
+var _0x3c55=['/:id/items','getItems','post','isAuthenticated','create','/:id/clone','addItem','put','/:id','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c55,0x138));var _0x53c5=function(_0x2bb787,_0x41bf02){_0x2bb787=_0x2bb787-0x0;var _0x425b33=_0x3c55[_0x2bb787];return _0x425b33;};'use strict';var multer=require('multer');var util=require(_0x53c5('0x0'));var path=require(_0x53c5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x53c5('0x2')]();var fs_extra=require(_0x53c5('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x53c5('0x4'));var config=require(_0x53c5('0x5'));var controller=require(_0x53c5('0x6'));router[_0x53c5('0x7')]('/',auth['isAuthenticated'](),controller[_0x53c5('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x53c5('0x9')]);router['get'](_0x53c5('0xa'),auth['isAuthenticated'](),controller[_0x53c5('0xb')]);router[_0x53c5('0xc')]('/',auth[_0x53c5('0xd')](),controller[_0x53c5('0xe')]);router['post'](_0x53c5('0xf'),auth[_0x53c5('0xd')](),controller['clone']);router[_0x53c5('0xc')]('/:id/items',auth[_0x53c5('0xd')](),controller[_0x53c5('0x10')]);router[_0x53c5('0x11')](_0x53c5('0x12'),auth[_0x53c5('0xd')](),controller[_0x53c5('0x13')]);router[_0x53c5('0x14')](_0x53c5('0x12'),auth[_0x53c5('0xd')](),controller[_0x53c5('0x15')]);module[_0x53c5('0x16')]=router;
\ No newline at end of file
index 3bf64ac..b3ea282 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbf5=['squel','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff'];(function(_0x4e36f8,_0x26fe50){var _0x44a9bb=function(_0x1b36fa){while(--_0x1b36fa){_0x4e36f8['push'](_0x4e36f8['shift']());}};_0x44a9bb(++_0x26fe50);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x26d39f,_0x30ae0b){_0x26d39f=_0x26d39f-0x0;var _0x14471c=_0xdbf5[_0x26d39f];return _0x14471c;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x5dbf('0x0'));var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5dbf('0x1')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5dbf('0x2')](_0x5dbf('0x3')),'get':function(){try{return JSON[_0x5dbf('0x4')](this[_0x5dbf('0x5')](_0x5dbf('0x6')));}catch(_0x1decd2){return[];}},'set':function(_0x3f8628){try{this[_0x5dbf('0x7')](_0x5dbf('0x6'),JSON[_0x5dbf('0x8')](_0x3f8628));}catch(_0x93e657){this['setDataValue'](_0x5dbf('0x6'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x5dbf('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x5dbf('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5dbf('0x9')]},'col':{'type':Sequelize[_0x5dbf('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5dbf('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5dbf('0x1')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}};
\ No newline at end of file
+var _0xeda8=['TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','#ffffff','sequelize','squel','exports','STRING'];(function(_0x881f89,_0x1c1916){var _0x1cb389=function(_0x3fdcc9){while(--_0x3fdcc9){_0x881f89['push'](_0x881f89['shift']());}};_0x1cb389(++_0x1c1916);}(_0xeda8,0x104));var _0x8eda=function(_0x28edf4,_0x1f60ff){_0x28edf4=_0x28edf4-0x0;var _0x21b0f3=_0xeda8[_0x28edf4];return _0x21b0f3;};'use strict';var Sequelize=require(_0x8eda('0x0'));var squel=require(_0x8eda('0x1'));var _=require('lodash');module[_0x8eda('0x2')]={'title':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8eda('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x8eda('0x4')](_0x8eda('0x5')),'get':function(){try{return JSON[_0x8eda('0x6')](this[_0x8eda('0x7')](_0x8eda('0x8')));}catch(_0x22dee9){return[];}},'set':function(_0x1f3556){try{this[_0x8eda('0x9')](_0x8eda('0x8'),JSON['stringify'](_0x1f3556));}catch(_0x28b721){this[_0x8eda('0x9')](_0x8eda('0x8'),JSON[_0x8eda('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![],'defaultValue':_0x8eda('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x8eda('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}};
\ No newline at end of file
index 5596c34..fc34f47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacf4=['show','params','model','keys','rawAttributes','query','intersection','fields','attributes','length','catch','DashboardItem','find','type','attrUrl','attrs','value','https://','custom','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrChannel','web-report','attrReport','reportType','attrRefresh','stringify','body','create','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send'];(function(_0x1c8a5c,_0x1a3ee6){var _0x442cfc=function(_0x16ce22){while(--_0x16ce22){_0x1c8a5c['push'](_0x1c8a5c['shift']());}};_0x442cfc(++_0x1a3ee6);}(_0xacf4,0xe7));var _0x4acf=function(_0x12177f,_0x13a3d){_0x12177f=_0x12177f-0x0;var _0x8b1b58=_0xacf4[_0x12177f];return _0x8b1b58;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4acf('0x0'));var jsonpatch=require(_0x4acf('0x1'));var rp=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var BPromise=require(_0x4acf('0x4'));var Mustache=require(_0x4acf('0x5'));var util=require(_0x4acf('0x6'));var path=require('path');var sox=require(_0x4acf('0x7'));var csv=require(_0x4acf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4acf('0x9'));var _=require(_0x4acf('0xa'));var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require(_0x4acf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4acf('0xf'));var authService=require(_0x4acf('0x10'));var qs=require(_0x4acf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4acf('0x12'));var logger=require(_0x4acf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4acf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4acf('0x15')]=_[_0x4acf('0x16')](config[_0x4acf('0x15')],{'host':_0x4acf('0x17'),'port':0x18eb});var socket=require(_0x4acf('0x18'))(new Redis(config[_0x4acf('0x15')]));require(_0x4acf('0x19'))[_0x4acf('0x1a')](socket);function respondWithStatusCode(_0x2025ca,_0x312bb5){_0x312bb5=_0x312bb5||0xcc;return function(_0x2741d3){if(_0x2741d3){return _0x2025ca['sendStatus'](_0x312bb5);}return _0x2025ca[_0x4acf('0x1b')](_0x312bb5)['end']();};}function respondWithResult(_0x34cec1,_0x4041c8){_0x4041c8=_0x4041c8||0xc8;return function(_0xccf970){if(_0xccf970){return _0x34cec1['status'](_0x4041c8)['json'](_0xccf970);}};}function respondWithFilteredResult(_0x13d10e,_0x40cb8d){return function(_0x240c00){if(_0x240c00){var _0x4b1d93=typeof _0x40cb8d[_0x4acf('0x1c')]===_0x4acf('0x1d')&&typeof _0x40cb8d[_0x4acf('0x1e')]===_0x4acf('0x1d');var _0x2f0cec=_0x240c00[_0x4acf('0x1f')];var _0x2049ba=_0x4b1d93?0x0:_0x40cb8d[_0x4acf('0x1c')];var _0x130647=_0x4b1d93?_0x240c00[_0x4acf('0x1f')]:_0x40cb8d[_0x4acf('0x1c')]+_0x40cb8d['limit'];var _0x28d698;if(_0x130647>=_0x2f0cec){_0x130647=_0x2f0cec;_0x28d698=0xc8;}else{_0x28d698=0xce;}_0x13d10e[_0x4acf('0x1b')](_0x28d698);return _0x13d10e['set'](_0x4acf('0x20'),_0x2049ba+'-'+_0x130647+'/'+_0x2f0cec)[_0x4acf('0x21')](_0x240c00);}return null;};}function patchUpdates(_0x569d9e){return function(_0x3b26ac){try{jsonpatch[_0x4acf('0x22')](_0x3b26ac,_0x569d9e,!![]);}catch(_0x433b7a){return BPromise[_0x4acf('0x23')](_0x433b7a);}return _0x3b26ac['save']();};}function saveUpdates(_0x1a2286,_0x12e717){return function(_0x57e595){if(_0x57e595){return _0x57e595[_0x4acf('0x24')](_0x1a2286)[_0x4acf('0x25')](function(_0x52a84a){return _0x52a84a;});}return null;};}function removeEntity(_0x126522,_0x7ebb){return function(_0x38152c){if(_0x38152c){return _0x38152c[_0x4acf('0x26')]()['then'](function(){_0x126522['status'](0xcc)[_0x4acf('0x27')]();});}};}function handleEntityNotFound(_0x3f548a,_0x355799){return function(_0x42c90c){if(!_0x42c90c){_0x3f548a[_0x4acf('0x28')](0x194);}return _0x42c90c;};}function handleError(_0x1b4da6,_0xb83274){_0xb83274=_0xb83274||0x1f4;return function(_0x7a1e79){logger[_0x4acf('0x29')](_0x7a1e79[_0x4acf('0x2a')]);if(_0x7a1e79['name']){delete _0x7a1e79[_0x4acf('0x2b')];}_0x1b4da6[_0x4acf('0x1b')](_0xb83274)[_0x4acf('0x2c')](_0x7a1e79);};}exports[_0x4acf('0x2d')]=function(_0x252cf1,_0x28570f){var _0x27384c={'raw':![],'where':{'id':_0x252cf1[_0x4acf('0x2e')]['id']}},_0x5d862f={};_0x5d862f[_0x4acf('0x2f')]=_[_0x4acf('0x30')](db['DashboardItem'][_0x4acf('0x31')]);_0x5d862f[_0x4acf('0x32')]=_[_0x4acf('0x30')](_0x252cf1[_0x4acf('0x32')]);_0x5d862f['filters']=_[_0x4acf('0x33')](_0x5d862f[_0x4acf('0x2f')],_0x5d862f[_0x4acf('0x32')]);_0x27384c['attributes']=_[_0x4acf('0x33')](_0x5d862f[_0x4acf('0x2f')],qs[_0x4acf('0x34')](_0x252cf1[_0x4acf('0x32')][_0x4acf('0x34')]));_0x27384c[_0x4acf('0x35')]=_0x27384c['attributes'][_0x4acf('0x36')]?_0x27384c[_0x4acf('0x35')]:_0x5d862f['model'];if(_0x252cf1[_0x4acf('0x32')]['includeAll']){_0x27384c['include']=[{'all':!![]}];}_0x27384c=_['merge']({},_0x27384c,_0x252cf1['options']);return db['DashboardItem']['find'](_0x27384c)['then'](handleEntityNotFound(_0x28570f,null))[_0x4acf('0x25')](respondWithResult(_0x28570f,null))[_0x4acf('0x37')](handleError(_0x28570f,null));};exports['destroy']=function(_0x13a10e,_0xbd0f92){return db[_0x4acf('0x38')][_0x4acf('0x39')]({'where':{'id':_0x13a10e[_0x4acf('0x2e')]['id']}})[_0x4acf('0x25')](handleEntityNotFound(_0xbd0f92,null))[_0x4acf('0x25')](removeEntity(_0xbd0f92,null))[_0x4acf('0x37')](handleError(_0xbd0f92,null));};function widgetAttributes(_0x24465b){try{switch(_0x24465b[_0x4acf('0x3a')]){case'iframe':return[{'name':'attrUrl','value':_0x24465b[_0x4acf('0x3b')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b['attrs'][0x0]?_0x24465b[_0x4acf('0x3c')][0x0][_0x4acf('0x3d')]:undefined)||_0x4acf('0x3e')}];case _0x4acf('0x3f'):return[{'name':'attrPath','value':_0x24465b['attrPath']||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0x0]?_0x24465b[_0x4acf('0x3c')][0x0][_0x4acf('0x3d')]:undefined)||''}];case'clock':return[{'name':_0x4acf('0x40'),'value':_0x24465b[_0x4acf('0x40')]||(_0x24465b['attrs']&&_0x24465b['attrs'][0x0]?_0x24465b['attrs'][0x0]['value']:undefined)||_0x4acf('0x41')},{'name':_0x4acf('0x42'),'value':_0x24465b[_0x4acf('0x42')]||(_0x24465b['attrs']&&_0x24465b[_0x4acf('0x3c')][0x1]?_0x24465b[_0x4acf('0x3c')][0x1][_0x4acf('0x3d')]:undefined)||_0x4acf('0x43')},{'name':_0x4acf('0x44'),'value':_0x24465b[_0x4acf('0x44')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0x2]?_0x24465b[_0x4acf('0x3c')][0x2][_0x4acf('0x3d')]:undefined)||0xc}];case _0x4acf('0x45'):return[{'name':'attrMetric','value':_0x24465b[_0x4acf('0x46')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0x0]?_0x24465b[_0x4acf('0x3c')][0x0][_0x4acf('0x3d')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x24465b[_0x4acf('0x47')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0x1]?_0x24465b[_0x4acf('0x3c')][0x1][_0x4acf('0x3d')]:undefined)||[]},{'name':_0x4acf('0x44'),'value':_0x24465b['attrFontSize']||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b['attrs'][0x2]?_0x24465b[_0x4acf('0x3c')][0x2][_0x4acf('0x3d')]:undefined)||0x14},{'name':'attrChannel','value':_0x24465b['attrChannel']||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0x3]?_0x24465b[_0x4acf('0x3c')][0x3][_0x4acf('0x3d')]:undefined)||'voice'},{'name':_0x4acf('0x48'),'value':_0x24465b[_0x4acf('0x48')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0x4]?_0x24465b[_0x4acf('0x3c')][0x4][_0x4acf('0x3d')]:undefined)||''},{'name':_0x4acf('0x49'),'value':_0x24465b[_0x4acf('0x49')]||(_0x24465b['attrs']&&_0x24465b['attrs'][0x5]?_0x24465b[_0x4acf('0x3c')][0x5][_0x4acf('0x3d')]:undefined)||''},{'name':_0x4acf('0x4a'),'value':_0x24465b[_0x4acf('0x4a')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0x6]?_0x24465b[_0x4acf('0x3c')][0x6][_0x4acf('0x3d')]:undefined)||''},{'name':_0x4acf('0x4b'),'value':_0x24465b[_0x4acf('0x4b')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0x7]?_0x24465b['attrs'][0x7][_0x4acf('0x3d')]:undefined)||''},{'name':_0x4acf('0x4c'),'value':_0x24465b[_0x4acf('0x4c')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0x8]?_0x24465b[_0x4acf('0x3c')][0x8][_0x4acf('0x3d')]:undefined)||''},{'name':_0x4acf('0x4d'),'value':_0x24465b[_0x4acf('0x4d')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0x9]?_0x24465b[_0x4acf('0x3c')][0x9][_0x4acf('0x3d')]:undefined)||''}];case _0x4acf('0x4e'):case _0x4acf('0x4f'):return[{'name':_0x4acf('0x50'),'value':_0x24465b['attrSerie1']||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0x0]?_0x24465b[_0x4acf('0x3c')][0x0]['value']:undefined)||_0x4acf('0x51')},{'name':_0x4acf('0x52'),'value':_0x24465b[_0x4acf('0x52')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b['attrs'][0x1]?_0x24465b['attrs'][0x1]['value']:undefined)||null},{'name':_0x4acf('0x53'),'value':_0x24465b[_0x4acf('0x53')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b['attrs'][0x2]?_0x24465b[_0x4acf('0x3c')][0x2][_0x4acf('0x3d')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x24465b[_0x4acf('0x47')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0x3]?_0x24465b[_0x4acf('0x3c')][0x3]['value']:undefined)||[]},{'name':_0x4acf('0x54'),'value':_0x24465b[_0x4acf('0x54')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0x4]?_0x24465b['attrs'][0x4][_0x4acf('0x3d')]:undefined)||'voice'},{'name':_0x4acf('0x48'),'value':_0x24465b['attrEmailAccounts']||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0x5]?_0x24465b[_0x4acf('0x3c')][0x5][_0x4acf('0x3d')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x24465b['attrFaxAccounts']||(_0x24465b['attrs']&&_0x24465b[_0x4acf('0x3c')][0x6]?_0x24465b[_0x4acf('0x3c')][0x6]['value']:undefined)||''},{'name':_0x4acf('0x4a'),'value':_0x24465b[_0x4acf('0x4a')]||(_0x24465b['attrs']&&_0x24465b[_0x4acf('0x3c')][0x7]?_0x24465b[_0x4acf('0x3c')][0x7]['value']:undefined)||''},{'name':_0x4acf('0x4b'),'value':_0x24465b[_0x4acf('0x4b')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b['attrs'][0x8]?_0x24465b[_0x4acf('0x3c')][0x8][_0x4acf('0x3d')]:undefined)||''},{'name':_0x4acf('0x4c'),'value':_0x24465b[_0x4acf('0x4c')]||(_0x24465b['attrs']&&_0x24465b[_0x4acf('0x3c')][0x9]?_0x24465b[_0x4acf('0x3c')][0x9][_0x4acf('0x3d')]:undefined)||''},{'name':'attrChatWebsites','value':_0x24465b[_0x4acf('0x4d')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0xa]?_0x24465b[_0x4acf('0x3c')][0xa][_0x4acf('0x3d')]:undefined)||''}];case _0x4acf('0x55'):return[{'name':_0x4acf('0x56'),'type':_0x24465b[_0x4acf('0x57')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0x0]?_0x24465b[_0x4acf('0x3c')][0x0][_0x4acf('0x3a')]:undefined)||null,'value':_0x24465b[_0x4acf('0x56')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0x0]?_0x24465b['attrs'][0x0][_0x4acf('0x3d')]:undefined)||null},{'name':_0x4acf('0x58'),'value':_0x24465b[_0x4acf('0x58')]||(_0x24465b[_0x4acf('0x3c')]&&_0x24465b[_0x4acf('0x3c')][0x1]?_0x24465b[_0x4acf('0x3c')][0x1][_0x4acf('0x3d')]:undefined)||0x0}];default:return[];}}catch(_0x2845b5){logger['error']('widgetAttributes:\x20%s',JSON[_0x4acf('0x59')](_0x2845b5));return[];}}exports['create']=function(_0x379fb3,_0x4bfd3c){if(_0x379fb3['body']){_0x379fb3['body'][_0x4acf('0x3c')]=widgetAttributes(_0x379fb3[_0x4acf('0x5a')]);}return db[_0x4acf('0x38')][_0x4acf('0x5b')](_0x379fb3[_0x4acf('0x5a')],{})[_0x4acf('0x25')](respondWithResult(_0x4bfd3c,0xc9))['catch'](handleError(_0x4bfd3c,null));};exports['update']=function(_0x4c8e90,_0xd4d4c6){if(_0x4c8e90[_0x4acf('0x5a')]['id']){delete _0x4c8e90[_0x4acf('0x5a')]['id'];}_0x4c8e90['body'][_0x4acf('0x3c')]=widgetAttributes(_0x4c8e90[_0x4acf('0x5a')]);return db[_0x4acf('0x38')][_0x4acf('0x39')]({'where':{'id':_0x4c8e90[_0x4acf('0x2e')]['id']}})[_0x4acf('0x25')](handleEntityNotFound(_0xd4d4c6,null))['then'](saveUpdates(_0x4c8e90[_0x4acf('0x5a')],null))['then'](respondWithResult(_0xd4d4c6,null))[_0x4acf('0x37')](handleError(_0xd4d4c6,null));};
\ No newline at end of file
+var _0x0958=['attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','create','body','eml-format','rimraf','zip-dir','request-promise','moment','util','path','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','show','params','model','query','filters','intersection','fields','attributes','includeAll','include','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','value','https://','custom'];(function(_0x1b999f,_0xada878){var _0x51d27a=function(_0x1ba354){while(--_0x1ba354){_0x1b999f['push'](_0x1b999f['shift']());}};_0x51d27a(++_0xada878);}(_0x0958,0x7c));var _0x8095=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0958[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x8095('0x0'));var rimraf=require(_0x8095('0x1'));var zipdir=require(_0x8095('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8095('0x3'));var moment=require(_0x8095('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8095('0x5'));var path=require(_0x8095('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8095('0x7'));var fs=require('fs');var fs_extra=require(_0x8095('0x8'));var _=require(_0x8095('0x9'));var squel=require(_0x8095('0xa'));var crypto=require(_0x8095('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8095('0xc'));var querystring=require(_0x8095('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8095('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8095('0xf'));var hardwareService=require(_0x8095('0x10'));var logger=require(_0x8095('0x11'))(_0x8095('0x12'));var utils=require(_0x8095('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8095('0x14'));var db=require('../../mysqldb')['db'];config[_0x8095('0x15')]=_[_0x8095('0x16')](config[_0x8095('0x15')],{'host':_0x8095('0x17'),'port':0x18eb});var socket=require(_0x8095('0x18'))(new Redis(config[_0x8095('0x15')]));require('./dashboardItem.socket')[_0x8095('0x19')](socket);function respondWithStatusCode(_0x2f75a4,_0x43f30f){_0x43f30f=_0x43f30f||0xcc;return function(_0x492aa8){if(_0x492aa8){return _0x2f75a4[_0x8095('0x1a')](_0x43f30f);}return _0x2f75a4[_0x8095('0x1b')](_0x43f30f)[_0x8095('0x1c')]();};}function respondWithResult(_0xb7c487,_0x466ac9){_0x466ac9=_0x466ac9||0xc8;return function(_0x5ae78f){if(_0x5ae78f){return _0xb7c487[_0x8095('0x1b')](_0x466ac9)[_0x8095('0x1d')](_0x5ae78f);}};}function respondWithFilteredResult(_0x4a1d27,_0x569278){return function(_0x13ff41){if(_0x13ff41){var _0x51c65a=typeof _0x569278[_0x8095('0x1e')]===_0x8095('0x1f')&&typeof _0x569278[_0x8095('0x20')]==='undefined';var _0x2e5b38=_0x13ff41[_0x8095('0x21')];var _0x220b38=_0x51c65a?0x0:_0x569278['offset'];var _0x160e67=_0x51c65a?_0x13ff41[_0x8095('0x21')]:_0x569278[_0x8095('0x1e')]+_0x569278['limit'];var _0x176ba9;if(_0x160e67>=_0x2e5b38){_0x160e67=_0x2e5b38;_0x176ba9=0xc8;}else{_0x176ba9=0xce;}_0x4a1d27['status'](_0x176ba9);return _0x4a1d27[_0x8095('0x22')](_0x8095('0x23'),_0x220b38+'-'+_0x160e67+'/'+_0x2e5b38)[_0x8095('0x1d')](_0x13ff41);}return null;};}function patchUpdates(_0x1c97c4){return function(_0x23ac15){try{jsonpatch[_0x8095('0x24')](_0x23ac15,_0x1c97c4,!![]);}catch(_0x2a7bb6){return BPromise[_0x8095('0x25')](_0x2a7bb6);}return _0x23ac15[_0x8095('0x26')]();};}function saveUpdates(_0x441fbf,_0x163727){return function(_0x3846f9){if(_0x3846f9){return _0x3846f9[_0x8095('0x27')](_0x441fbf)[_0x8095('0x28')](function(_0x5896f4){return _0x5896f4;});}return null;};}function removeEntity(_0x499138,_0x1b2939){return function(_0x190b0a){if(_0x190b0a){return _0x190b0a[_0x8095('0x29')]()[_0x8095('0x28')](function(){_0x499138[_0x8095('0x1b')](0xcc)[_0x8095('0x1c')]();});}};}function handleEntityNotFound(_0x320f4f,_0xe39b50){return function(_0x440975){if(!_0x440975){_0x320f4f[_0x8095('0x1a')](0x194);}return _0x440975;};}function handleError(_0x46a76d,_0x6e94ab){_0x6e94ab=_0x6e94ab||0x1f4;return function(_0x223ade){logger[_0x8095('0x2a')](_0x223ade[_0x8095('0x2b')]);if(_0x223ade[_0x8095('0x2c')]){delete _0x223ade[_0x8095('0x2c')];}_0x46a76d[_0x8095('0x1b')](_0x6e94ab)['send'](_0x223ade);};}exports[_0x8095('0x2d')]=function(_0x24caa2,_0x45843c){var _0x3cba01={'raw':![],'where':{'id':_0x24caa2[_0x8095('0x2e')]['id']}},_0x21c8e8={};_0x21c8e8[_0x8095('0x2f')]=_['keys'](db['DashboardItem']['rawAttributes']);_0x21c8e8[_0x8095('0x30')]=_['keys'](_0x24caa2[_0x8095('0x30')]);_0x21c8e8[_0x8095('0x31')]=_[_0x8095('0x32')](_0x21c8e8[_0x8095('0x2f')],_0x21c8e8[_0x8095('0x30')]);_0x3cba01['attributes']=_['intersection'](_0x21c8e8['model'],qs[_0x8095('0x33')](_0x24caa2[_0x8095('0x30')][_0x8095('0x33')]));_0x3cba01[_0x8095('0x34')]=_0x3cba01[_0x8095('0x34')]['length']?_0x3cba01[_0x8095('0x34')]:_0x21c8e8[_0x8095('0x2f')];if(_0x24caa2['query'][_0x8095('0x35')]){_0x3cba01[_0x8095('0x36')]=[{'all':!![]}];}_0x3cba01=_['merge']({},_0x3cba01,_0x24caa2[_0x8095('0x37')]);return db[_0x8095('0x38')][_0x8095('0x39')](_0x3cba01)[_0x8095('0x28')](handleEntityNotFound(_0x45843c,null))['then'](respondWithResult(_0x45843c,null))[_0x8095('0x3a')](handleError(_0x45843c,null));};exports[_0x8095('0x29')]=function(_0x26004e,_0x4147cf){return db[_0x8095('0x38')][_0x8095('0x39')]({'where':{'id':_0x26004e[_0x8095('0x2e')]['id']}})['then'](handleEntityNotFound(_0x4147cf,null))[_0x8095('0x28')](removeEntity(_0x4147cf,null))[_0x8095('0x3a')](handleError(_0x4147cf,null));};function widgetAttributes(_0x5510a6){try{switch(_0x5510a6[_0x8095('0x3b')]){case _0x8095('0x3c'):return[{'name':_0x8095('0x3d'),'value':_0x5510a6['attrUrl']||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6[_0x8095('0x3e')][0x0]?_0x5510a6['attrs'][0x0][_0x8095('0x3f')]:undefined)||_0x8095('0x40')}];case _0x8095('0x41'):return[{'name':_0x8095('0x42'),'value':_0x5510a6['attrPath']||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6[_0x8095('0x3e')][0x0]?_0x5510a6[_0x8095('0x3e')][0x0][_0x8095('0x3f')]:undefined)||''}];case _0x8095('0x43'):return[{'name':_0x8095('0x44'),'value':_0x5510a6[_0x8095('0x44')]||(_0x5510a6['attrs']&&_0x5510a6[_0x8095('0x3e')][0x0]?_0x5510a6[_0x8095('0x3e')][0x0][_0x8095('0x3f')]:undefined)||_0x8095('0x45')},{'name':'attrTimezone','value':_0x5510a6[_0x8095('0x46')]||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6['attrs'][0x1]?_0x5510a6[_0x8095('0x3e')][0x1]['value']:undefined)||_0x8095('0x47')},{'name':_0x8095('0x48'),'value':_0x5510a6[_0x8095('0x48')]||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6[_0x8095('0x3e')][0x2]?_0x5510a6['attrs'][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x8095('0x49'),'value':_0x5510a6[_0x8095('0x49')]||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6[_0x8095('0x3e')][0x0]?_0x5510a6[_0x8095('0x3e')][0x0][_0x8095('0x3f')]:undefined)||_0x8095('0x4a')},{'name':_0x8095('0x4b'),'value':_0x5510a6[_0x8095('0x4b')]||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6[_0x8095('0x3e')][0x1]?_0x5510a6[_0x8095('0x3e')][0x1][_0x8095('0x3f')]:undefined)||[]},{'name':'attrFontSize','value':_0x5510a6[_0x8095('0x48')]||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6['attrs'][0x2]?_0x5510a6[_0x8095('0x3e')][0x2]['value']:undefined)||0x14},{'name':_0x8095('0x4c'),'value':_0x5510a6[_0x8095('0x4c')]||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6[_0x8095('0x3e')][0x3]?_0x5510a6[_0x8095('0x3e')][0x3][_0x8095('0x3f')]:undefined)||_0x8095('0x4d')},{'name':_0x8095('0x4e'),'value':_0x5510a6['attrEmailAccounts']||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6[_0x8095('0x3e')][0x4]?_0x5510a6[_0x8095('0x3e')][0x4][_0x8095('0x3f')]:undefined)||''},{'name':_0x8095('0x4f'),'value':_0x5510a6[_0x8095('0x4f')]||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6[_0x8095('0x3e')][0x5]?_0x5510a6[_0x8095('0x3e')][0x5][_0x8095('0x3f')]:undefined)||''},{'name':_0x8095('0x50'),'value':_0x5510a6[_0x8095('0x50')]||(_0x5510a6['attrs']&&_0x5510a6[_0x8095('0x3e')][0x6]?_0x5510a6['attrs'][0x6]['value']:undefined)||''},{'name':_0x8095('0x51'),'value':_0x5510a6[_0x8095('0x51')]||(_0x5510a6['attrs']&&_0x5510a6['attrs'][0x7]?_0x5510a6[_0x8095('0x3e')][0x7][_0x8095('0x3f')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x5510a6[_0x8095('0x52')]||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6[_0x8095('0x3e')][0x8]?_0x5510a6[_0x8095('0x3e')][0x8][_0x8095('0x3f')]:undefined)||''},{'name':_0x8095('0x53'),'value':_0x5510a6[_0x8095('0x53')]||(_0x5510a6['attrs']&&_0x5510a6['attrs'][0x9]?_0x5510a6[_0x8095('0x3e')][0x9]['value']:undefined)||''}];case _0x8095('0x54'):case'pie-chart':return[{'name':_0x8095('0x55'),'value':_0x5510a6[_0x8095('0x55')]||(_0x5510a6['attrs']&&_0x5510a6[_0x8095('0x3e')][0x0]?_0x5510a6[_0x8095('0x3e')][0x0]['value']:undefined)||_0x8095('0x4a')},{'name':'attrSerie2','value':_0x5510a6[_0x8095('0x56')]||(_0x5510a6['attrs']&&_0x5510a6[_0x8095('0x3e')][0x1]?_0x5510a6[_0x8095('0x3e')][0x1][_0x8095('0x3f')]:undefined)||null},{'name':_0x8095('0x57'),'value':_0x5510a6[_0x8095('0x57')]||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6['attrs'][0x2]?_0x5510a6[_0x8095('0x3e')][0x2][_0x8095('0x3f')]:undefined)||null},{'name':_0x8095('0x4b'),'value':_0x5510a6[_0x8095('0x4b')]||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6['attrs'][0x3]?_0x5510a6[_0x8095('0x3e')][0x3][_0x8095('0x3f')]:undefined)||[]},{'name':_0x8095('0x4c'),'value':_0x5510a6[_0x8095('0x4c')]||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6['attrs'][0x4]?_0x5510a6[_0x8095('0x3e')][0x4]['value']:undefined)||_0x8095('0x4d')},{'name':'attrEmailAccounts','value':_0x5510a6['attrEmailAccounts']||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6[_0x8095('0x3e')][0x5]?_0x5510a6[_0x8095('0x3e')][0x5][_0x8095('0x3f')]:undefined)||''},{'name':_0x8095('0x4f'),'value':_0x5510a6[_0x8095('0x4f')]||(_0x5510a6['attrs']&&_0x5510a6[_0x8095('0x3e')][0x6]?_0x5510a6[_0x8095('0x3e')][0x6][_0x8095('0x3f')]:undefined)||''},{'name':_0x8095('0x50'),'value':_0x5510a6['attrSmsAccounts']||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6[_0x8095('0x3e')][0x7]?_0x5510a6['attrs'][0x7][_0x8095('0x3f')]:undefined)||''},{'name':_0x8095('0x51'),'value':_0x5510a6[_0x8095('0x51')]||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6[_0x8095('0x3e')][0x8]?_0x5510a6[_0x8095('0x3e')][0x8][_0x8095('0x3f')]:undefined)||''},{'name':_0x8095('0x52'),'value':_0x5510a6[_0x8095('0x52')]||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6[_0x8095('0x3e')][0x9]?_0x5510a6[_0x8095('0x3e')][0x9][_0x8095('0x3f')]:undefined)||''},{'name':_0x8095('0x53'),'value':_0x5510a6[_0x8095('0x53')]||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6[_0x8095('0x3e')][0xa]?_0x5510a6[_0x8095('0x3e')][0xa][_0x8095('0x3f')]:undefined)||''}];case _0x8095('0x58'):return[{'name':_0x8095('0x59'),'type':_0x5510a6[_0x8095('0x5a')]||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6[_0x8095('0x3e')][0x0]?_0x5510a6[_0x8095('0x3e')][0x0]['type']:undefined)||null,'value':_0x5510a6[_0x8095('0x59')]||(_0x5510a6['attrs']&&_0x5510a6[_0x8095('0x3e')][0x0]?_0x5510a6[_0x8095('0x3e')][0x0][_0x8095('0x3f')]:undefined)||null},{'name':'attrRefresh','value':_0x5510a6[_0x8095('0x5b')]||(_0x5510a6[_0x8095('0x3e')]&&_0x5510a6['attrs'][0x1]?_0x5510a6[_0x8095('0x3e')][0x1][_0x8095('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x28432f){logger[_0x8095('0x2a')]('widgetAttributes:\x20%s',JSON[_0x8095('0x5c')](_0x28432f));return[];}}exports[_0x8095('0x5d')]=function(_0x4fa3bd,_0x3533c3){if(_0x4fa3bd[_0x8095('0x5e')]){_0x4fa3bd[_0x8095('0x5e')]['attrs']=widgetAttributes(_0x4fa3bd['body']);}return db['DashboardItem'][_0x8095('0x5d')](_0x4fa3bd[_0x8095('0x5e')],{})[_0x8095('0x28')](respondWithResult(_0x3533c3,0xc9))['catch'](handleError(_0x3533c3,null));};exports[_0x8095('0x27')]=function(_0x4015ed,_0x57a72d){if(_0x4015ed[_0x8095('0x5e')]['id']){delete _0x4015ed[_0x8095('0x5e')]['id'];}_0x4015ed['body'][_0x8095('0x3e')]=widgetAttributes(_0x4015ed['body']);return db[_0x8095('0x38')][_0x8095('0x39')]({'where':{'id':_0x4015ed[_0x8095('0x2e')]['id']}})[_0x8095('0x28')](handleEntityNotFound(_0x57a72d,null))[_0x8095('0x28')](saveUpdates(_0x4015ed[_0x8095('0x5e')],null))['then'](respondWithResult(_0x57a72d,null))['catch'](handleError(_0x57a72d,null));};
\ No newline at end of file
index ba2ea80..e3dfa5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3294=['hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','save','update','remove','emit'];(function(_0x1bc90c,_0x556e50){var _0x43fe49=function(_0x24c7f3){while(--_0x24c7f3){_0x1bc90c['push'](_0x1bc90c['shift']());}};_0x43fe49(++_0x556e50);}(_0x3294,0x8f));var _0x4329=function(_0x494e49,_0x3aa0d2){_0x494e49=_0x494e49-0x0;var _0x298bb6=_0x3294[_0x494e49];return _0x298bb6;};'use strict';var EventEmitter=require(_0x4329('0x0'));var DashboardItem=require(_0x4329('0x1'))['db'][_0x4329('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4329('0x3'),'afterUpdate':_0x4329('0x4'),'afterDestroy':_0x4329('0x5')};function emitEvent(_0x262af7){return function(_0x120c7d,_0xff4804,_0x3c374){DashboardItemEvents[_0x4329('0x6')](_0x262af7+':'+_0x120c7d['id'],_0x120c7d);DashboardItemEvents['emit'](_0x262af7,_0x120c7d);_0x3c374(null);};}for(var e in events){if(events[_0x4329('0x7')](e)){var event=events[e];DashboardItem[_0x4329('0x8')](e,emitEvent(event));}}module[_0x4329('0x9')]=DashboardItemEvents;
\ No newline at end of file
+var _0xeb1d=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x4b3a81,_0x40454a){var _0x3d7af6=function(_0x2b05e4){while(--_0x2b05e4){_0x4b3a81['push'](_0x4b3a81['shift']());}};_0x3d7af6(++_0x40454a);}(_0xeb1d,0x1e9));var _0xdeb1=function(_0x2dcb7e,_0x57f902){_0x2dcb7e=_0x2dcb7e-0x0;var _0x20e604=_0xeb1d[_0x2dcb7e];return _0x20e604;};'use strict';var EventEmitter=require(_0xdeb1('0x0'));var DashboardItem=require(_0xdeb1('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdeb1('0x2'),'afterUpdate':_0xdeb1('0x3'),'afterDestroy':_0xdeb1('0x4')};function emitEvent(_0xf120){return function(_0x471977,_0x35ca77,_0x52664c){DashboardItemEvents['emit'](_0xf120+':'+_0x471977['id'],_0x471977);DashboardItemEvents[_0xdeb1('0x5')](_0xf120,_0x471977);_0x52664c(null);};}for(var e in events){if(events[_0xdeb1('0x6')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xdeb1('0x7')]=DashboardItemEvents;
\ No newline at end of file
index 60c31c1..1b5eb87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb09=['bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','dashboard_items','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb09,0xa3));var _0x9fb0=function(_0x362e2d,_0x250557){_0x362e2d=_0x362e2d-0x0;var _0x379655=_0xfb09[_0x362e2d];return _0x379655;};'use strict';var _=require(_0x9fb0('0x0'));var util=require(_0x9fb0('0x1'));var logger=require(_0x9fb0('0x2'))(_0x9fb0('0x3'));var moment=require(_0x9fb0('0x4'));var BPromise=require(_0x9fb0('0x5'));var rp=require(_0x9fb0('0x6'));var fs=require('fs');var path=require(_0x9fb0('0x7'));var rimraf=require(_0x9fb0('0x8'));var config=require(_0x9fb0('0x9'));var attributes=require(_0x9fb0('0xa'));module[_0x9fb0('0xb')]=function(_0x49d0e5,_0xb5d812){return _0x49d0e5[_0x9fb0('0xc')]('DashboardItem',attributes,{'tableName':_0x9fb0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x34ee=['exports','define','DashboardItem','dashboard_items','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0x4a6992,_0x15fed3){var _0x5cbaee=function(_0x40e075){while(--_0x40e075){_0x4a6992['push'](_0x4a6992['shift']());}};_0x5cbaee(++_0x15fed3);}(_0x34ee,0x144));var _0xe34e=function(_0x128188,_0x418a16){_0x128188=_0x128188-0x0;var _0x4bc209=_0x34ee[_0x128188];return _0x4bc209;};'use strict';var _=require(_0xe34e('0x0'));var util=require('util');var logger=require(_0xe34e('0x1'))('api');var moment=require(_0xe34e('0x2'));var BPromise=require('bluebird');var rp=require(_0xe34e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe34e('0x4'));var config=require(_0xe34e('0x5'));var attributes=require('./dashboardItem.attributes');module[_0xe34e('0x6')]=function(_0x14930d,_0x42aff0){return _0x14930d[_0xe34e('0x7')](_0xe34e('0x8'),attributes,{'tableName':_0xe34e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 35c3825..6702ea3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc647=['DashboardItem,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x35bb58,_0x37bdef){var _0x29e3e9=function(_0x51ffe5){while(--_0x51ffe5){_0x35bb58['push'](_0x35bb58['shift']());}};_0x29e3e9(++_0x37bdef);}(_0xc647,0x109));var _0x7c64=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xc647[_0x934425];return _0x31d596;};'use strict';var _=require('lodash');var util=require(_0x7c64('0x0'));var moment=require(_0x7c64('0x1'));var BPromise=require(_0x7c64('0x2'));var rs=require(_0x7c64('0x3'));var fs=require('fs');var Redis=require(_0x7c64('0x4'));var db=require(_0x7c64('0x5'))['db'];var utils=require(_0x7c64('0x6'));var logger=require(_0x7c64('0x7'))('rpc');var config=require(_0x7c64('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7c64('0x9')]['http']({'port':0x232a});config[_0x7c64('0xa')]=_[_0x7c64('0xb')](config[_0x7c64('0xa')],{'host':_0x7c64('0xc'),'port':0x18eb});var socket=require(_0x7c64('0xd'))(new Redis(config[_0x7c64('0xa')]));require(_0x7c64('0xe'))[_0x7c64('0xf')](socket);function respondWithRpcPromise(_0x1ef798,_0x14d99c,_0x5912a1){return new BPromise(function(_0x211a8a,_0xdbdde2){return client[_0x7c64('0x10')](_0x1ef798,_0x5912a1)[_0x7c64('0x11')](function(_0x5262c1){logger[_0x7c64('0x12')]('DashboardItem,\x20%s,\x20%s',_0x14d99c,_0x7c64('0x13'));logger[_0x7c64('0x14')](_0x7c64('0x15'),_0x14d99c,'request\x20sent',JSON[_0x7c64('0x16')](_0x5262c1));if(_0x5262c1[_0x7c64('0x17')]){if(_0x5262c1['error'][_0x7c64('0x18')]===0x1f4){logger['error'](_0x7c64('0x19'),_0x14d99c,_0x5262c1[_0x7c64('0x17')][_0x7c64('0x1a')]);return _0xdbdde2(_0x5262c1['error'][_0x7c64('0x1a')]);}logger[_0x7c64('0x17')](_0x7c64('0x19'),_0x14d99c,_0x5262c1[_0x7c64('0x17')][_0x7c64('0x1a')]);return _0x211a8a(_0x5262c1[_0x7c64('0x17')]['message']);}else{logger['info'](_0x7c64('0x19'),_0x14d99c,'request\x20sent');_0x211a8a(_0x5262c1[_0x7c64('0x1b')][_0x7c64('0x1a')]);}})[_0x7c64('0x1c')](function(_0x413bf0){logger[_0x7c64('0x17')](_0x7c64('0x19'),_0x14d99c,_0x413bf0);_0xdbdde2(_0x413bf0);});});}
\ No newline at end of file
+var _0x60a9=['DashboardItem,\x20%s,\x20%s,\x20%s','error','code','result','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x60a9,0x1e1));var _0x960a=function(_0x1db9bb,_0x4c5f9d){_0x1db9bb=_0x1db9bb-0x0;var _0x272bc0=_0x60a9[_0x1db9bb];return _0x272bc0;};'use strict';var _=require(_0x960a('0x0'));var util=require(_0x960a('0x1'));var moment=require(_0x960a('0x2'));var BPromise=require('bluebird');var rs=require(_0x960a('0x3'));var fs=require('fs');var Redis=require(_0x960a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x960a('0x5'));var logger=require(_0x960a('0x6'))(_0x960a('0x7'));var config=require(_0x960a('0x8'));var jayson=require(_0x960a('0x9'));var client=jayson[_0x960a('0xa')][_0x960a('0xb')]({'port':0x232a});config[_0x960a('0xc')]=_['defaults'](config[_0x960a('0xc')],{'host':_0x960a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x36ca67,_0x150912,_0x2cb353){return new BPromise(function(_0x3bc531,_0x104beb){return client[_0x960a('0xe')](_0x36ca67,_0x2cb353)['then'](function(_0x30490d){logger[_0x960a('0xf')](_0x960a('0x10'),_0x150912,_0x960a('0x11'));logger[_0x960a('0x12')](_0x960a('0x13'),_0x150912,_0x960a('0x11'),JSON['stringify'](_0x30490d));if(_0x30490d['error']){if(_0x30490d[_0x960a('0x14')][_0x960a('0x15')]===0x1f4){logger[_0x960a('0x14')](_0x960a('0x10'),_0x150912,_0x30490d[_0x960a('0x14')]['message']);return _0x104beb(_0x30490d['error']['message']);}logger['error'](_0x960a('0x10'),_0x150912,_0x30490d[_0x960a('0x14')]['message']);return _0x3bc531(_0x30490d[_0x960a('0x14')]['message']);}else{logger[_0x960a('0xf')](_0x960a('0x10'),_0x150912,_0x960a('0x11'));_0x3bc531(_0x30490d[_0x960a('0x16')][_0x960a('0x17')]);}})[_0x960a('0x18')](function(_0xc1a890){logger[_0x960a('0x14')](_0x960a('0x10'),_0x150912,_0xc1a890);_0x104beb(_0xc1a890);});});}
\ No newline at end of file
index 25794fc..d66012a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3df4=['length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener','register'];(function(_0xe5f0ad,_0x3e0f92){var _0x2d4162=function(_0x4aed38){while(--_0x4aed38){_0xe5f0ad['push'](_0xe5f0ad['shift']());}};_0x2d4162(++_0x3e0f92);}(_0x3df4,0x122));var _0x43df=function(_0x30c5ee,_0x12a0af){_0x30c5ee=_0x30c5ee-0x0;var _0x55f290=_0x3df4[_0x30c5ee];return _0x55f290;};'use strict';var DashboardItemEvents=require(_0x43df('0x0'));var events=[_0x43df('0x1'),_0x43df('0x2'),_0x43df('0x3')];function createListener(_0xdace9b,_0x110112){return function(_0x1e3b5d){_0x110112[_0x43df('0x4')](_0xdace9b,_0x1e3b5d);};}function removeListener(_0x4d1448,_0x2d9734){return function(){DashboardItemEvents[_0x43df('0x5')](_0x4d1448,_0x2d9734);};}exports[_0x43df('0x6')]=function(_0x55fd01){for(var _0x15b7cd=0x0,_0x30d2fd=events[_0x43df('0x7')];_0x15b7cd<_0x30d2fd;_0x15b7cd++){var _0x3d59c9=events[_0x15b7cd];var _0x332245=createListener(_0x43df('0x8')+_0x3d59c9,_0x55fd01);DashboardItemEvents['on'](_0x3d59c9,_0x332245);}};
\ No newline at end of file
+var _0x6a8e=['./dashboardItem.events','remove','emit','register','dashboardItem:'];(function(_0x47da8d,_0x517e13){var _0x5aabef=function(_0x2528d7){while(--_0x2528d7){_0x47da8d['push'](_0x47da8d['shift']());}};_0x5aabef(++_0x517e13);}(_0x6a8e,0x1e5));var _0xe6a8=function(_0x8a8a5,_0x440238){_0x8a8a5=_0x8a8a5-0x0;var _0x2e4ab9=_0x6a8e[_0x8a8a5];return _0x2e4ab9;};'use strict';var DashboardItemEvents=require(_0xe6a8('0x0'));var events=['save',_0xe6a8('0x1'),'update'];function createListener(_0x262cab,_0x55019b){return function(_0x5c5252){_0x55019b[_0xe6a8('0x2')](_0x262cab,_0x5c5252);};}function removeListener(_0x5c0531,_0x1a3185){return function(){DashboardItemEvents['removeListener'](_0x5c0531,_0x1a3185);};}exports[_0xe6a8('0x3')]=function(_0x2d4903){for(var _0x3dcc24=0x0,_0x26c2a3=events['length'];_0x3dcc24<_0x26c2a3;_0x3dcc24++){var _0xcf99d=events[_0x3dcc24];var _0x4a7ac2=createListener(_0xe6a8('0x4')+_0xcf99d,_0x2d4903);DashboardItemEvents['on'](_0xcf99d,_0x4a7ac2);}};
\ No newline at end of file
index 241aca3..f3ea807 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f66=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','show','post','create','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f66,0x162));var _0x63f6=function(_0x32e058,_0x46897b){_0x32e058=_0x32e058-0x0;var _0x1beccf=_0x3f66[_0x32e058];return _0x1beccf;};'use strict';var multer=require(_0x63f6('0x0'));var util=require(_0x63f6('0x1'));var path=require(_0x63f6('0x2'));var timeout=require(_0x63f6('0x3'));var express=require(_0x63f6('0x4'));var router=express[_0x63f6('0x5')]();var fs_extra=require(_0x63f6('0x6'));var auth=require(_0x63f6('0x7'));var interaction=require(_0x63f6('0x8'));var config=require(_0x63f6('0x9'));var controller=require(_0x63f6('0xa'));router[_0x63f6('0xb')](_0x63f6('0xc'),auth['isAuthenticated'](),controller[_0x63f6('0xd')]);router[_0x63f6('0xe')]('/',auth['isAuthenticated'](),controller[_0x63f6('0xf')]);router['put']('/:id',auth[_0x63f6('0x10')](),controller[_0x63f6('0x11')]);router['delete'](_0x63f6('0xc'),auth[_0x63f6('0x10')](),controller['destroy']);module[_0x63f6('0x12')]=router;
\ No newline at end of file
+var _0x12d2=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','put','update','destroy','exports','util','path','connect-timeout','Router'];(function(_0x2b30b1,_0xd8e9cd){var _0x3106a8=function(_0x1195b7){while(--_0x1195b7){_0x2b30b1['push'](_0x2b30b1['shift']());}};_0x3106a8(++_0xd8e9cd);}(_0x12d2,0x7a));var _0x212d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x12d2[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x212d('0x0'));var path=require(_0x212d('0x1'));var timeout=require(_0x212d('0x2'));var express=require('express');var router=express[_0x212d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x212d('0x4'));var interaction=require(_0x212d('0x5'));var config=require(_0x212d('0x6'));var controller=require('./dashboardItem.controller');router[_0x212d('0x7')](_0x212d('0x8'),auth[_0x212d('0x9')](),controller['show']);router['post']('/',auth[_0x212d('0x9')](),controller['create']);router[_0x212d('0xa')](_0x212d('0x8'),auth[_0x212d('0x9')](),controller[_0x212d('0xb')]);router['delete'](_0x212d('0x8'),auth[_0x212d('0x9')](),controller[_0x212d('0xc')]);module[_0x212d('0xd')]=router;
\ No newline at end of file
index 9d55f78..cdebb61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9307=['first','second','third','sequelize','STRING','ENUM'];(function(_0x4ccdb9,_0x37e124){var _0x583543=function(_0x1460d3){while(--_0x1460d3){_0x4ccdb9['push'](_0x4ccdb9['shift']());}};_0x583543(++_0x37e124);}(_0x9307,0x153));var _0x7930=function(_0x216fbe,_0x5a3acb){_0x216fbe=_0x216fbe-0x0;var _0x19bd4a=_0x9307[_0x216fbe];return _0x19bd4a;};'use strict';var Sequelize=require(_0x7930('0x0'));module['exports']={'name':{'type':Sequelize[_0x7930('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x7930('0x2')](_0x7930('0x3'),_0x7930('0x4'),_0x7930('0x5')),'allowNull':![],'defaultValue':_0x7930('0x3')},'description':{'type':Sequelize[_0x7930('0x1')]}};
\ No newline at end of file
+var _0x40a8=['exports','STRING','ENUM','first','second','sequelize'];(function(_0x19fe68,_0x1ce12e){var _0x500ac9=function(_0x5a460c){while(--_0x5a460c){_0x19fe68['push'](_0x19fe68['shift']());}};_0x500ac9(++_0x1ce12e);}(_0x40a8,0x1d9));var _0x840a=function(_0x212fcc,_0x1a8867){_0x212fcc=_0x212fcc-0x0;var _0x4d8190=_0x40a8[_0x212fcc];return _0x4d8190;};'use strict';var Sequelize=require(_0x840a('0x0'));module[_0x840a('0x1')]={'name':{'type':Sequelize[_0x840a('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x840a('0x3')](_0x840a('0x4'),_0x840a('0x5'),'third'),'allowNull':![],'defaultValue':_0x840a('0x4')},'description':{'type':Sequelize[_0x840a('0x2')]}};
\ No newline at end of file
index de1dbb7..85e613a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a5e=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','update','then','Dispositions','destroy','error','name','send','index','map','Disposition','rawAttributes','fieldName','type','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','intersection','options','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x3ed4c1,_0x1af122){var _0x1c72d1=function(_0x453a63){while(--_0x453a63){_0x3ed4c1['push'](_0x3ed4c1['shift']());}};_0x1c72d1(++_0x1af122);}(_0x9a5e,0xee));var _0xe9a5=function(_0x22d961,_0x33277a){_0x22d961=_0x22d961-0x0;var _0x362663=_0x9a5e[_0x22d961];return _0x362663;};'use strict';var emlformat=require(_0xe9a5('0x0'));var rimraf=require(_0xe9a5('0x1'));var zipdir=require(_0xe9a5('0x2'));var jsonpatch=require(_0xe9a5('0x3'));var rp=require(_0xe9a5('0x4'));var moment=require(_0xe9a5('0x5'));var BPromise=require(_0xe9a5('0x6'));var Mustache=require(_0xe9a5('0x7'));var util=require(_0xe9a5('0x8'));var path=require('path');var sox=require(_0xe9a5('0x9'));var csv=require(_0xe9a5('0xa'));var ejs=require(_0xe9a5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe9a5('0xc'));var crypto=require('crypto');var jsforce=require(_0xe9a5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe9a5('0xa'));var querystring=require(_0xe9a5('0xe'));var Papa=require(_0xe9a5('0xf'));var Redis=require(_0xe9a5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe9a5('0x11'));var as=require(_0xe9a5('0x12'));var hardwareService=require(_0xe9a5('0x13'));var logger=require('../../config/logger')(_0xe9a5('0x14'));var utils=require('../../config/utils');var config=require(_0xe9a5('0x15'));var licenseUtil=require(_0xe9a5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe9c060,_0x3263bf){_0x3263bf=_0x3263bf||0xcc;return function(_0x3d4b57){if(_0x3d4b57){return _0xe9c060[_0xe9a5('0x17')](_0x3263bf);}return _0xe9c060['status'](_0x3263bf)[_0xe9a5('0x18')]();};}function respondWithResult(_0x56350a,_0x242aea){_0x242aea=_0x242aea||0xc8;return function(_0x38dc39){if(_0x38dc39){return _0x56350a[_0xe9a5('0x19')](_0x242aea)[_0xe9a5('0x1a')](_0x38dc39);}};}function respondWithFilteredResult(_0x1ec762,_0x105b25){return function(_0x592689){if(_0x592689){var _0x3302f2=typeof _0x105b25[_0xe9a5('0x1b')]===_0xe9a5('0x1c')&&typeof _0x105b25[_0xe9a5('0x1d')]==='undefined';var _0xaf8e1c=_0x592689['count'];var _0x53aea8=_0x3302f2?0x0:_0x105b25[_0xe9a5('0x1b')];var _0x5e362e=_0x3302f2?_0x592689[_0xe9a5('0x1e')]:_0x105b25[_0xe9a5('0x1b')]+_0x105b25[_0xe9a5('0x1d')];var _0x163199;if(_0x5e362e>=_0xaf8e1c){_0x5e362e=_0xaf8e1c;_0x163199=0xc8;}else{_0x163199=0xce;}_0x1ec762[_0xe9a5('0x19')](_0x163199);return _0x1ec762['set'](_0xe9a5('0x1f'),_0x53aea8+'-'+_0x5e362e+'/'+_0xaf8e1c)[_0xe9a5('0x1a')](_0x592689);}return null;};}function patchUpdates(_0x23865c){return function(_0x158d40){try{jsonpatch[_0xe9a5('0x20')](_0x158d40,_0x23865c,!![]);}catch(_0x97dd4c){return BPromise['reject'](_0x97dd4c);}return _0x158d40['save']();};}function saveUpdates(_0x50c44e,_0x100b75){return function(_0x55d3ee){if(_0x55d3ee){return _0x55d3ee[_0xe9a5('0x21')](_0x50c44e)['then'](function(_0x50c18b){return _0x50c18b;});}return null;};}function removeEntity(_0x4a28b6,_0x554a96){return function(_0x446182){if(_0x446182){return _0x446182['destroy']()[_0xe9a5('0x22')](function(){var _0x4d7ce9=_0x446182['get']({'plain':!![]});var _0x5d6390=_0xe9a5('0x23');return db['UserProfileResource'][_0xe9a5('0x24')]({'where':{'type':_0x5d6390,'resourceId':_0x4d7ce9['id']}})[_0xe9a5('0x22')](function(){return _0x446182;});})[_0xe9a5('0x22')](function(){_0x4a28b6[_0xe9a5('0x19')](0xcc)[_0xe9a5('0x18')]();});}};}function handleEntityNotFound(_0x42d217,_0x5c12df){return function(_0x49da1b){if(!_0x49da1b){_0x42d217[_0xe9a5('0x17')](0x194);}return _0x49da1b;};}function handleError(_0x13d748,_0x413b8c){_0x413b8c=_0x413b8c||0x1f4;return function(_0x18bedc){logger[_0xe9a5('0x25')](_0x18bedc['stack']);if(_0x18bedc[_0xe9a5('0x26')]){delete _0x18bedc[_0xe9a5('0x26')];}_0x13d748['status'](_0x413b8c)[_0xe9a5('0x27')](_0x18bedc);};}exports[_0xe9a5('0x28')]=function(_0x504982,_0x35866e){var _0x4869c8={},_0x21d28a={},_0x1e22f5={'count':0x0,'rows':[]};var _0x51e979=_[_0xe9a5('0x29')](db[_0xe9a5('0x2a')][_0xe9a5('0x2b')],function(_0x5ee5ae){return{'name':_0x5ee5ae[_0xe9a5('0x2c')],'type':_0x5ee5ae[_0xe9a5('0x2d')]['key']};});_0x21d28a[_0xe9a5('0x2e')]=_['map'](_0x51e979,_0xe9a5('0x26'));_0x21d28a['query']=_[_0xe9a5('0x2f')](_0x504982[_0xe9a5('0x30')]);_0x21d28a['filters']=_['intersection'](_0x21d28a['model'],_0x21d28a[_0xe9a5('0x30')]);_0x4869c8[_0xe9a5('0x31')]=_['intersection'](_0x21d28a[_0xe9a5('0x2e')],qs['fields'](_0x504982[_0xe9a5('0x30')][_0xe9a5('0x32')]));_0x4869c8[_0xe9a5('0x31')]=_0x4869c8[_0xe9a5('0x31')][_0xe9a5('0x33')]?_0x4869c8[_0xe9a5('0x31')]:_0x21d28a[_0xe9a5('0x2e')];if(!_0x504982[_0xe9a5('0x30')][_0xe9a5('0x34')](_0xe9a5('0x35'))){_0x4869c8['limit']=qs[_0xe9a5('0x1d')](_0x504982[_0xe9a5('0x30')][_0xe9a5('0x1d')]);_0x4869c8[_0xe9a5('0x1b')]=qs[_0xe9a5('0x1b')](_0x504982[_0xe9a5('0x30')][_0xe9a5('0x1b')]);}_0x4869c8[_0xe9a5('0x36')]=qs[_0xe9a5('0x37')](_0x504982['query'][_0xe9a5('0x37')]);_0x4869c8['where']=qs[_0xe9a5('0x38')](_['pick'](_0x504982[_0xe9a5('0x30')],_0x21d28a[_0xe9a5('0x38')]),_0x51e979);if(_0x504982[_0xe9a5('0x30')]['filter']){_0x4869c8['where']=_['merge'](_0x4869c8[_0xe9a5('0x39')],{'$or':_[_0xe9a5('0x29')](_0x51e979,function(_0x2e1e53){if(_0x2e1e53['type']!=='VIRTUAL'){var _0x196992={};_0x196992[_0x2e1e53[_0xe9a5('0x26')]]={'$like':'%'+_0x504982['query'][_0xe9a5('0x3a')]+'%'};return _0x196992;}})});}_0x4869c8=_[_0xe9a5('0x3b')]({},_0x4869c8,_0x504982['options']);var _0x121110={'where':_0x4869c8[_0xe9a5('0x39')]};return db['Disposition'][_0xe9a5('0x1e')](_0x121110)[_0xe9a5('0x22')](function(_0x365f8b){_0x1e22f5[_0xe9a5('0x1e')]=_0x365f8b;if(_0x504982[_0xe9a5('0x30')][_0xe9a5('0x3c')]){_0x4869c8[_0xe9a5('0x3d')]=[{'all':!![]}];}return db[_0xe9a5('0x2a')][_0xe9a5('0x3e')](_0x4869c8);})[_0xe9a5('0x22')](function(_0x2ee89a){_0x1e22f5[_0xe9a5('0x3f')]=_0x2ee89a;return _0x1e22f5;})[_0xe9a5('0x22')](respondWithFilteredResult(_0x35866e,_0x4869c8))[_0xe9a5('0x40')](handleError(_0x35866e,null));};exports[_0xe9a5('0x41')]=function(_0x2541cf,_0x1949d6){var _0x2971ad={'raw':!![],'where':{'id':_0x2541cf[_0xe9a5('0x42')]['id']}},_0x3840f7={};_0x3840f7[_0xe9a5('0x2e')]=_['keys'](db[_0xe9a5('0x2a')][_0xe9a5('0x2b')]);_0x3840f7[_0xe9a5('0x30')]=_['keys'](_0x2541cf[_0xe9a5('0x30')]);_0x3840f7[_0xe9a5('0x38')]=_[_0xe9a5('0x43')](_0x3840f7[_0xe9a5('0x2e')],_0x3840f7[_0xe9a5('0x30')]);_0x2971ad[_0xe9a5('0x31')]=_[_0xe9a5('0x43')](_0x3840f7['model'],qs[_0xe9a5('0x32')](_0x2541cf[_0xe9a5('0x30')][_0xe9a5('0x32')]));_0x2971ad[_0xe9a5('0x31')]=_0x2971ad['attributes'][_0xe9a5('0x33')]?_0x2971ad[_0xe9a5('0x31')]:_0x3840f7[_0xe9a5('0x2e')];if(_0x2541cf[_0xe9a5('0x30')][_0xe9a5('0x3c')]){_0x2971ad[_0xe9a5('0x3d')]=[{'all':!![]}];}_0x2971ad=_[_0xe9a5('0x3b')]({},_0x2971ad,_0x2541cf[_0xe9a5('0x44')]);return db['Disposition'][_0xe9a5('0x45')](_0x2971ad)['then'](handleEntityNotFound(_0x1949d6,null))[_0xe9a5('0x22')](respondWithResult(_0x1949d6,null))[_0xe9a5('0x40')](handleError(_0x1949d6,null));};exports[_0xe9a5('0x46')]=function(_0x5868eb,_0xc8004e){return db[_0xe9a5('0x2a')][_0xe9a5('0x46')](_0x5868eb[_0xe9a5('0x47')],{})[_0xe9a5('0x22')](function(_0x1790f4){var _0x1a7a06=_0x5868eb[_0xe9a5('0x48')][_0xe9a5('0x49')]({'plain':!![]});if(!_0x1a7a06)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a7a06[_0xe9a5('0x4a')]===_0xe9a5('0x48')){var _0x3b1ed2=_0x1790f4[_0xe9a5('0x49')]({'plain':!![]});var _0xea8e34=_0xe9a5('0x23');return db[_0xe9a5('0x4b')][_0xe9a5('0x45')]({'where':{'name':_0xea8e34,'userProfileId':_0x1a7a06[_0xe9a5('0x4c')]},'raw':!![]})[_0xe9a5('0x22')](function(_0x2f9f4a){if(_0x2f9f4a&&_0x2f9f4a[_0xe9a5('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x3b1ed2['name'],'resourceId':_0x3b1ed2['id'],'type':_0x2f9f4a['name'],'sectionId':_0x2f9f4a['id']},{})[_0xe9a5('0x22')](function(){return _0x1790f4;});}else{return _0x1790f4;}})['catch'](function(_0x3d4afd){logger['error'](_0xe9a5('0x4e'),_0x3d4afd);throw _0x3d4afd;});}return _0x1790f4;})[_0xe9a5('0x22')](respondWithResult(_0xc8004e,0xc9))[_0xe9a5('0x40')](handleError(_0xc8004e,null));};exports[_0xe9a5('0x21')]=function(_0x1054d2,_0x377aea){if(_0x1054d2[_0xe9a5('0x47')]['id']){delete _0x1054d2[_0xe9a5('0x47')]['id'];}return db[_0xe9a5('0x2a')][_0xe9a5('0x45')]({'where':{'id':_0x1054d2[_0xe9a5('0x42')]['id']}})['then'](handleEntityNotFound(_0x377aea,null))[_0xe9a5('0x22')](saveUpdates(_0x1054d2[_0xe9a5('0x47')],null))[_0xe9a5('0x22')](respondWithResult(_0x377aea,null))[_0xe9a5('0x40')](handleError(_0x377aea,null));};exports[_0xe9a5('0x24')]=function(_0x2bb342,_0x28bf2e){return db['Disposition'][_0xe9a5('0x45')]({'where':{'id':_0x2bb342['params']['id']}})[_0xe9a5('0x22')](handleEntityNotFound(_0x28bf2e,null))[_0xe9a5('0x22')](removeEntity(_0x28bf2e,null))[_0xe9a5('0x40')](handleError(_0x28bf2e,null));};
\ No newline at end of file
+var _0xbc61=['findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','limit','offset','count','status','set','Content-Range','reject','save','update','then','destroy','get','Dispositions','end','error','stack','name','send','Disposition','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include'];(function(_0x1ed198,_0x27f904){var _0x42507d=function(_0x105311){while(--_0x105311){_0x1ed198['push'](_0x1ed198['shift']());}};_0x42507d(++_0x27f904);}(_0xbc61,0x1b2));var _0x1bc6=function(_0xdc58d0,_0x4f6feb){_0xdc58d0=_0xdc58d0-0x0;var _0x1e57f3=_0xbc61[_0xdc58d0];return _0x1e57f3;};'use strict';var emlformat=require(_0x1bc6('0x0'));var rimraf=require(_0x1bc6('0x1'));var zipdir=require(_0x1bc6('0x2'));var jsonpatch=require(_0x1bc6('0x3'));var rp=require('request-promise');var moment=require(_0x1bc6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1bc6('0x5'));var util=require(_0x1bc6('0x6'));var path=require('path');var sox=require(_0x1bc6('0x7'));var csv=require(_0x1bc6('0x8'));var ejs=require(_0x1bc6('0x9'));var fs=require('fs');var fs_extra=require(_0x1bc6('0xa'));var _=require('lodash');var squel=require(_0x1bc6('0xb'));var crypto=require(_0x1bc6('0xc'));var jsforce=require(_0x1bc6('0xd'));var deskjs=require(_0x1bc6('0xe'));var toCsv=require(_0x1bc6('0x8'));var querystring=require(_0x1bc6('0xf'));var Papa=require(_0x1bc6('0x10'));var Redis=require('ioredis');var authService=require(_0x1bc6('0x11'));var qs=require(_0x1bc6('0x12'));var as=require(_0x1bc6('0x13'));var hardwareService=require(_0x1bc6('0x14'));var logger=require(_0x1bc6('0x15'))(_0x1bc6('0x16'));var utils=require(_0x1bc6('0x17'));var config=require(_0x1bc6('0x18'));var licenseUtil=require(_0x1bc6('0x19'));var db=require(_0x1bc6('0x1a'))['db'];function respondWithStatusCode(_0x2b3e33,_0x3542f9){_0x3542f9=_0x3542f9||0xcc;return function(_0x4b9c45){if(_0x4b9c45){return _0x2b3e33[_0x1bc6('0x1b')](_0x3542f9);}return _0x2b3e33['status'](_0x3542f9)['end']();};}function respondWithResult(_0x50b83a,_0x8cce54){_0x8cce54=_0x8cce54||0xc8;return function(_0x381f65){if(_0x381f65){return _0x50b83a['status'](_0x8cce54)[_0x1bc6('0x1c')](_0x381f65);}};}function respondWithFilteredResult(_0x513e22,_0x380669){return function(_0x1f19cd){if(_0x1f19cd){var _0x3cd869=typeof _0x380669['offset']===_0x1bc6('0x1d')&&typeof _0x380669[_0x1bc6('0x1e')]===_0x1bc6('0x1d');var _0x12e28c=_0x1f19cd['count'];var _0x41ae00=_0x3cd869?0x0:_0x380669[_0x1bc6('0x1f')];var _0x4502df=_0x3cd869?_0x1f19cd[_0x1bc6('0x20')]:_0x380669[_0x1bc6('0x1f')]+_0x380669['limit'];var _0x413ebc;if(_0x4502df>=_0x12e28c){_0x4502df=_0x12e28c;_0x413ebc=0xc8;}else{_0x413ebc=0xce;}_0x513e22[_0x1bc6('0x21')](_0x413ebc);return _0x513e22[_0x1bc6('0x22')](_0x1bc6('0x23'),_0x41ae00+'-'+_0x4502df+'/'+_0x12e28c)[_0x1bc6('0x1c')](_0x1f19cd);}return null;};}function patchUpdates(_0x3dc017){return function(_0x792243){try{jsonpatch['apply'](_0x792243,_0x3dc017,!![]);}catch(_0x4af871){return BPromise[_0x1bc6('0x24')](_0x4af871);}return _0x792243[_0x1bc6('0x25')]();};}function saveUpdates(_0x178d08,_0x560dea){return function(_0x446af8){if(_0x446af8){return _0x446af8[_0x1bc6('0x26')](_0x178d08)[_0x1bc6('0x27')](function(_0x22aac0){return _0x22aac0;});}return null;};}function removeEntity(_0x25a37b,_0x14363a){return function(_0x3e0e35){if(_0x3e0e35){return _0x3e0e35[_0x1bc6('0x28')]()[_0x1bc6('0x27')](function(){var _0x1ffb45=_0x3e0e35[_0x1bc6('0x29')]({'plain':!![]});var _0x469187=_0x1bc6('0x2a');return db['UserProfileResource'][_0x1bc6('0x28')]({'where':{'type':_0x469187,'resourceId':_0x1ffb45['id']}})[_0x1bc6('0x27')](function(){return _0x3e0e35;});})[_0x1bc6('0x27')](function(){_0x25a37b['status'](0xcc)[_0x1bc6('0x2b')]();});}};}function handleEntityNotFound(_0x37323,_0x8b6ff7){return function(_0x547d1d){if(!_0x547d1d){_0x37323[_0x1bc6('0x1b')](0x194);}return _0x547d1d;};}function handleError(_0x49d5e6,_0x467824){_0x467824=_0x467824||0x1f4;return function(_0x16e7f9){logger[_0x1bc6('0x2c')](_0x16e7f9[_0x1bc6('0x2d')]);if(_0x16e7f9[_0x1bc6('0x2e')]){delete _0x16e7f9[_0x1bc6('0x2e')];}_0x49d5e6['status'](_0x467824)[_0x1bc6('0x2f')](_0x16e7f9);};}exports['index']=function(_0x3765f8,_0x648a20){var _0x5d496e={},_0x1a020c={},_0x119845={'count':0x0,'rows':[]};var _0x2b4a05=_['map'](db[_0x1bc6('0x30')]['rawAttributes'],function(_0x3c8dbf){return{'name':_0x3c8dbf[_0x1bc6('0x31')],'type':_0x3c8dbf[_0x1bc6('0x32')]['key']};});_0x1a020c[_0x1bc6('0x33')]=_[_0x1bc6('0x34')](_0x2b4a05,_0x1bc6('0x2e'));_0x1a020c[_0x1bc6('0x35')]=_[_0x1bc6('0x36')](_0x3765f8[_0x1bc6('0x35')]);_0x1a020c[_0x1bc6('0x37')]=_[_0x1bc6('0x38')](_0x1a020c[_0x1bc6('0x33')],_0x1a020c[_0x1bc6('0x35')]);_0x5d496e[_0x1bc6('0x39')]=_[_0x1bc6('0x38')](_0x1a020c[_0x1bc6('0x33')],qs['fields'](_0x3765f8[_0x1bc6('0x35')][_0x1bc6('0x3a')]));_0x5d496e[_0x1bc6('0x39')]=_0x5d496e[_0x1bc6('0x39')][_0x1bc6('0x3b')]?_0x5d496e['attributes']:_0x1a020c[_0x1bc6('0x33')];if(!_0x3765f8[_0x1bc6('0x35')][_0x1bc6('0x3c')](_0x1bc6('0x3d'))){_0x5d496e[_0x1bc6('0x1e')]=qs['limit'](_0x3765f8[_0x1bc6('0x35')][_0x1bc6('0x1e')]);_0x5d496e[_0x1bc6('0x1f')]=qs[_0x1bc6('0x1f')](_0x3765f8[_0x1bc6('0x35')][_0x1bc6('0x1f')]);}_0x5d496e[_0x1bc6('0x3e')]=qs[_0x1bc6('0x3f')](_0x3765f8[_0x1bc6('0x35')][_0x1bc6('0x3f')]);_0x5d496e[_0x1bc6('0x40')]=qs[_0x1bc6('0x37')](_['pick'](_0x3765f8[_0x1bc6('0x35')],_0x1a020c[_0x1bc6('0x37')]),_0x2b4a05);if(_0x3765f8['query'][_0x1bc6('0x41')]){_0x5d496e['where']=_['merge'](_0x5d496e[_0x1bc6('0x40')],{'$or':_['map'](_0x2b4a05,function(_0xf3ebab){if(_0xf3ebab[_0x1bc6('0x32')]!==_0x1bc6('0x42')){var _0x55b010={};_0x55b010[_0xf3ebab[_0x1bc6('0x2e')]]={'$like':'%'+_0x3765f8[_0x1bc6('0x35')][_0x1bc6('0x41')]+'%'};return _0x55b010;}})});}_0x5d496e=_[_0x1bc6('0x43')]({},_0x5d496e,_0x3765f8[_0x1bc6('0x44')]);var _0x1dfbbe={'where':_0x5d496e[_0x1bc6('0x40')]};return db['Disposition'][_0x1bc6('0x20')](_0x1dfbbe)[_0x1bc6('0x27')](function(_0x1b9609){_0x119845['count']=_0x1b9609;if(_0x3765f8[_0x1bc6('0x35')]['includeAll']){_0x5d496e[_0x1bc6('0x45')]=[{'all':!![]}];}return db[_0x1bc6('0x30')][_0x1bc6('0x46')](_0x5d496e);})[_0x1bc6('0x27')](function(_0x1e60e6){_0x119845[_0x1bc6('0x47')]=_0x1e60e6;return _0x119845;})[_0x1bc6('0x27')](respondWithFilteredResult(_0x648a20,_0x5d496e))[_0x1bc6('0x48')](handleError(_0x648a20,null));};exports[_0x1bc6('0x49')]=function(_0x337564,_0x2baae9){var _0xcf56e={'raw':!![],'where':{'id':_0x337564[_0x1bc6('0x4a')]['id']}},_0x1fdd8c={};_0x1fdd8c[_0x1bc6('0x33')]=_[_0x1bc6('0x36')](db[_0x1bc6('0x30')]['rawAttributes']);_0x1fdd8c['query']=_['keys'](_0x337564[_0x1bc6('0x35')]);_0x1fdd8c[_0x1bc6('0x37')]=_['intersection'](_0x1fdd8c[_0x1bc6('0x33')],_0x1fdd8c[_0x1bc6('0x35')]);_0xcf56e[_0x1bc6('0x39')]=_[_0x1bc6('0x38')](_0x1fdd8c['model'],qs['fields'](_0x337564[_0x1bc6('0x35')]['fields']));_0xcf56e[_0x1bc6('0x39')]=_0xcf56e[_0x1bc6('0x39')]['length']?_0xcf56e[_0x1bc6('0x39')]:_0x1fdd8c[_0x1bc6('0x33')];if(_0x337564[_0x1bc6('0x35')][_0x1bc6('0x4b')]){_0xcf56e[_0x1bc6('0x45')]=[{'all':!![]}];}_0xcf56e=_['merge']({},_0xcf56e,_0x337564[_0x1bc6('0x44')]);return db[_0x1bc6('0x30')][_0x1bc6('0x4c')](_0xcf56e)['then'](handleEntityNotFound(_0x2baae9,null))[_0x1bc6('0x27')](respondWithResult(_0x2baae9,null))[_0x1bc6('0x48')](handleError(_0x2baae9,null));};exports[_0x1bc6('0x4d')]=function(_0x54f86e,_0x48914b){return db['Disposition'][_0x1bc6('0x4d')](_0x54f86e['body'],{})['then'](function(_0x3c3c28){var _0x47c43d=_0x54f86e[_0x1bc6('0x4e')]['get']({'plain':!![]});if(!_0x47c43d)throw new Error(_0x1bc6('0x4f'));if(_0x47c43d[_0x1bc6('0x50')]==='user'){var _0x444f08=_0x3c3c28[_0x1bc6('0x29')]({'plain':!![]});var _0x4dd1b4='Dispositions';return db['UserProfileSection']['find']({'where':{'name':_0x4dd1b4,'userProfileId':_0x47c43d['userProfileId']},'raw':!![]})['then'](function(_0x52145f){if(_0x52145f&&_0x52145f[_0x1bc6('0x51')]===0x0){return db[_0x1bc6('0x52')][_0x1bc6('0x4d')]({'name':_0x444f08[_0x1bc6('0x2e')],'resourceId':_0x444f08['id'],'type':_0x52145f[_0x1bc6('0x2e')],'sectionId':_0x52145f['id']},{})[_0x1bc6('0x27')](function(){return _0x3c3c28;});}else{return _0x3c3c28;}})[_0x1bc6('0x48')](function(_0x2d0aa4){logger[_0x1bc6('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d0aa4);throw _0x2d0aa4;});}return _0x3c3c28;})[_0x1bc6('0x27')](respondWithResult(_0x48914b,0xc9))[_0x1bc6('0x48')](handleError(_0x48914b,null));};exports[_0x1bc6('0x26')]=function(_0x2840ba,_0x3e236e){if(_0x2840ba[_0x1bc6('0x53')]['id']){delete _0x2840ba[_0x1bc6('0x53')]['id'];}return db[_0x1bc6('0x30')][_0x1bc6('0x4c')]({'where':{'id':_0x2840ba[_0x1bc6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3e236e,null))['then'](saveUpdates(_0x2840ba[_0x1bc6('0x53')],null))[_0x1bc6('0x27')](respondWithResult(_0x3e236e,null))['catch'](handleError(_0x3e236e,null));};exports['destroy']=function(_0x2c151c,_0x4f3317){return db['Disposition'][_0x1bc6('0x4c')]({'where':{'id':_0x2c151c[_0x1bc6('0x4a')]['id']}})[_0x1bc6('0x27')](handleEntityNotFound(_0x4f3317,null))[_0x1bc6('0x27')](removeEntity(_0x4f3317,null))['catch'](handleError(_0x4f3317,null));};
\ No newline at end of file
index 4a81f31..33e180e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d6f=['name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./disposition.attributes','exports','define','Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId'];(function(_0x31752d,_0x2efff8){var _0x29da67=function(_0x296d74){while(--_0x296d74){_0x31752d['push'](_0x31752d['shift']());}};_0x29da67(++_0x2efff8);}(_0x5d6f,0x182));var _0xf5d6=function(_0x52980f,_0x47b3b0){_0x52980f=_0x52980f-0x0;var _0x1f52a1=_0x5d6f[_0x52980f];return _0x1f52a1;};'use strict';var _=require(_0xf5d6('0x0'));var util=require(_0xf5d6('0x1'));var logger=require(_0xf5d6('0x2'))('api');var moment=require(_0xf5d6('0x3'));var BPromise=require('bluebird');var rp=require(_0xf5d6('0x4'));var fs=require('fs');var path=require(_0xf5d6('0x5'));var rimraf=require(_0xf5d6('0x6'));var config=require('../../config/environment');var attributes=require(_0xf5d6('0x7'));module[_0xf5d6('0x8')]=function(_0x2fe20a,_0xed4f6e){return _0x2fe20a[_0xf5d6('0x9')](_0xf5d6('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xf5d6('0xb'),'fields':[_0xf5d6('0xc'),_0xf5d6('0xd')]},{'unique':!![],'name':_0xf5d6('0xe'),'fields':[_0xf5d6('0xc'),_0xf5d6('0xf')]},{'unique':!![],'name':_0xf5d6('0x10'),'fields':[_0xf5d6('0xc'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':['name',_0xf5d6('0x11')]},{'unique':!![],'name':_0xf5d6('0x12'),'fields':['name',_0xf5d6('0x13')]},{'unique':!![],'name':_0xf5d6('0x14'),'fields':[_0xf5d6('0xc'),_0xf5d6('0x15')]},{'unique':!![],'name':_0xf5d6('0x16'),'fields':[_0xf5d6('0xc'),_0xf5d6('0x17')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2cc7=['name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./disposition.attributes','exports','define','name_voice','name','ListId','ChatWebsiteId'];(function(_0x118f63,_0x401fdb){var _0x1bff1c=function(_0x1ad578){while(--_0x1ad578){_0x118f63['push'](_0x118f63['shift']());}};_0x1bff1c(++_0x401fdb);}(_0x2cc7,0xef));var _0x72cc=function(_0x219926,_0x3f4b71){_0x219926=_0x219926-0x0;var _0x440dc6=_0x2cc7[_0x219926];return _0x440dc6;};'use strict';var _=require(_0x72cc('0x0'));var util=require('util');var logger=require(_0x72cc('0x1'))('api');var moment=require(_0x72cc('0x2'));var BPromise=require(_0x72cc('0x3'));var rp=require(_0x72cc('0x4'));var fs=require('fs');var path=require(_0x72cc('0x5'));var rimraf=require(_0x72cc('0x6'));var config=require('../../config/environment');var attributes=require(_0x72cc('0x7'));module[_0x72cc('0x8')]=function(_0x324856,_0x191d93){return _0x324856[_0x72cc('0x9')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x72cc('0xa'),'fields':[_0x72cc('0xb'),_0x72cc('0xc')]},{'unique':!![],'name':'name_chat','fields':[_0x72cc('0xb'),_0x72cc('0xd')]},{'unique':!![],'name':_0x72cc('0xe'),'fields':[_0x72cc('0xb'),_0x72cc('0xf')]},{'unique':!![],'name':_0x72cc('0x10'),'fields':[_0x72cc('0xb'),_0x72cc('0x11')]},{'unique':!![],'name':_0x72cc('0x12'),'fields':[_0x72cc('0xb'),_0x72cc('0x13')]},{'unique':!![],'name':_0x72cc('0x14'),'fields':[_0x72cc('0xb'),_0x72cc('0x15')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x72cc('0xb'),_0x72cc('0x16')]}],'timestamps':!![]});};
\ No newline at end of file
index ef103f3..29700a5 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(_0x24dc46,_0x626b71){var _0xa6d6df=function(_0xc235b9){while(--_0xc235b9){_0x24dc46['push'](_0x24dc46['shift']());}};_0xa6d6df(++_0x626b71);}(_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 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(_0x234dde,_0xcce532){var _0x28c11c=function(_0x1e104c){while(--_0x1e104c){_0x234dde['push'](_0x234dde['shift']());}};_0x28c11c(++_0xcce532);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
index 49309ef..ad99b32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaed2=['index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaed2,0x1ea));var _0x2aed=function(_0x59cc9b,_0x1a49b4){_0x59cc9b=_0x59cc9b-0x0;var _0x4b5371=_0xaed2[_0x59cc9b];return _0x4b5371;};'use strict';var multer=require(_0x2aed('0x0'));var util=require('util');var path=require(_0x2aed('0x1'));var timeout=require(_0x2aed('0x2'));var express=require(_0x2aed('0x3'));var router=express['Router']();var fs_extra=require(_0x2aed('0x4'));var auth=require(_0x2aed('0x5'));var interaction=require(_0x2aed('0x6'));var config=require(_0x2aed('0x7'));var controller=require(_0x2aed('0x8'));router[_0x2aed('0x9')]('/',auth['isAuthenticated'](),controller[_0x2aed('0xa')]);router[_0x2aed('0x9')](_0x2aed('0xb'),auth['isAuthenticated'](),controller[_0x2aed('0xc')]);router[_0x2aed('0xd')]('/',auth[_0x2aed('0xe')](),controller[_0x2aed('0xf')]);router[_0x2aed('0x10')](_0x2aed('0xb'),auth[_0x2aed('0xe')](),controller[_0x2aed('0x11')]);router[_0x2aed('0x12')](_0x2aed('0xb'),auth[_0x2aed('0xe')](),controller[_0x2aed('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x29e3=['/:id','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','post','create','put'];(function(_0x4950cc,_0x31284b){var _0x135262=function(_0x1c3796){while(--_0x1c3796){_0x4950cc['push'](_0x4950cc['shift']());}};_0x135262(++_0x31284b);}(_0x29e3,0xee));var _0x329e=function(_0x3a41e5,_0x1f9776){_0x3a41e5=_0x3a41e5-0x0;var _0x40fbf7=_0x29e3[_0x3a41e5];return _0x40fbf7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x329e('0x0'));var timeout=require(_0x329e('0x1'));var express=require(_0x329e('0x2'));var router=express[_0x329e('0x3')]();var fs_extra=require(_0x329e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x329e('0x5'));var config=require(_0x329e('0x6'));var controller=require(_0x329e('0x7'));router[_0x329e('0x8')]('/',auth[_0x329e('0x9')](),controller[_0x329e('0xa')]);router['get']('/:id',auth[_0x329e('0x9')](),controller['show']);router[_0x329e('0xb')]('/',auth[_0x329e('0x9')](),controller[_0x329e('0xc')]);router[_0x329e('0xd')](_0x329e('0xe'),auth[_0x329e('0x9')](),controller[_0x329e('0xf')]);router[_0x329e('0x10')](_0x329e('0xe'),auth[_0x329e('0x9')](),controller[_0x329e('0x11')]);module['exports']=router;
\ No newline at end of file
index f2080f2..a622848 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4e5=['4800','9600','12000','14400','7200','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400'];(function(_0x271e0f,_0x5456a4){var _0x4d518a=function(_0x3e517a){while(--_0x3e517a){_0x271e0f['push'](_0x271e0f['shift']());}};_0x4d518a(++_0x5456a4);}(_0xc4e5,0x157));var _0x5c4e=function(_0x53f964,_0x3b52b8){_0x53f964=_0x53f964-0x0;var _0x17be6c=_0xc4e5[_0x53f964];return _0x17be6c;};'use strict';var Sequelize=require(_0x5c4e('0x0'));module[_0x5c4e('0x1')]={'name':{'type':Sequelize[_0x5c4e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5c4e('0x2')]},'ecm':{'type':Sequelize[_0x5c4e('0x3')]('yes','no'),'defaultValue':_0x5c4e('0x4')},'headerinfo':{'type':Sequelize[_0x5c4e('0x2')],'defaultValue':_0x5c4e('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x5c4e('0x6')},'minrate':{'type':Sequelize[_0x5c4e('0x3')](_0x5c4e('0x7'),_0x5c4e('0x8'),'7200',_0x5c4e('0x9'),_0x5c4e('0xa'),_0x5c4e('0xb')),'defaultValue':_0x5c4e('0x8')},'maxrate':{'type':Sequelize[_0x5c4e('0x3')](_0x5c4e('0x7'),_0x5c4e('0x8'),_0x5c4e('0xc'),_0x5c4e('0x9'),_0x5c4e('0xa'),'14400'),'defaultValue':_0x5c4e('0xb')},'modem':{'type':Sequelize[_0x5c4e('0x2')],'defaultValue':_0x5c4e('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x5c4e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x5c4e('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5c4e('0x3')](_0x5c4e('0xf'),_0x5c4e('0x10'),_0x5c4e('0x11'),_0x5c4e('0x12')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5c4e('0x13')],'defaultValue':function(){return _0x5c4e('0x14');}},'notificationSound':{'type':Sequelize[_0x5c4e('0x15')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5c4e('0x15')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5c4e('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5c4e('0x15')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5c4e('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5c4e('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5c4e('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0x5c4e('0x16')},'mandatoryDisposition':{'type':Sequelize[_0x5c4e('0x15')],'defaultValue':![],'comment':_0x5c4e('0x17'),'set':function(_0x4fb06f){if(!_0x4fb06f)this['setDataValue'](_0x5c4e('0x18'),null);this[_0x5c4e('0x19')](_0x5c4e('0x1a'),_0x4fb06f);}}};
\ No newline at end of file
+var _0xfe63=['SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','4800','7200','9600','14400','12000','v17,v27,v29'];(function(_0x8e7300,_0x3b9a1e){var _0x51fe2d=function(_0xc8d8e6){while(--_0xc8d8e6){_0x8e7300['push'](_0x8e7300['shift']());}};_0x51fe2d(++_0x3b9a1e);}(_0xfe63,0x1ee));var _0x3fe6=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xfe63[_0x819464];return _0x49dcc0;};'use strict';var Sequelize=require(_0x3fe6('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fe6('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3fe6('0x1')]},'ecm':{'type':Sequelize[_0x3fe6('0x2')](_0x3fe6('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x3fe6('0x4')},'localstationid':{'type':Sequelize[_0x3fe6('0x1')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x3fe6('0x2')](_0x3fe6('0x5'),_0x3fe6('0x6'),_0x3fe6('0x7'),_0x3fe6('0x8'),'12000',_0x3fe6('0x9')),'defaultValue':_0x3fe6('0x6')},'maxrate':{'type':Sequelize[_0x3fe6('0x2')]('2400',_0x3fe6('0x6'),_0x3fe6('0x7'),_0x3fe6('0x8'),_0x3fe6('0xa'),'14400'),'defaultValue':_0x3fe6('0x9')},'modem':{'type':Sequelize[_0x3fe6('0x1')],'defaultValue':_0x3fe6('0xb')},'gateway':{'type':Sequelize[_0x3fe6('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x3fe6('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x3fe6('0xc'),_0x3fe6('0xd'),'DADHI',_0x3fe6('0xe')),'defaultValue':_0x3fe6('0xc')},'key':{'type':Sequelize[_0x3fe6('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3fe6('0xf')],'defaultValue':function(){return _0x3fe6('0x10');}},'notificationSound':{'type':Sequelize[_0x3fe6('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3fe6('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3fe6('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3fe6('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3fe6('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3fe6('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3fe6('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3fe6('0x12')],'allowNull':!![],'defaultValue':null,'comment':_0x3fe6('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x3fe6('0x11')],'defaultValue':![],'comment':_0x3fe6('0x14'),'set':function(_0x5c377d){if(!_0x5c377d)this[_0x3fe6('0x15')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x5c377d);}}};
\ No newline at end of file
index eb37f9b..43b0a1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41a4=['findAndCountAll','priority','stack','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','omit','tech','createdAt','updatedAt','findById','FaxMessage','$gte','split','format','CmList','CmContact','Contacts','DESC','attachments','join','server/files/attachments','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List','ListId','List\x20not\x20found','Send\x20Fax\x20failed','user','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','register','client','http','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','FaxAccount,\x20%s,\x20%s','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','get','FaxAccounts','UserProfileResource','destroy','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','findOne','Disposition','FaxAccountId','removeDispositions','addAnswer','CannedAnswer','getAnswers','pick','findAll','removeAnswers','ids','addInteraction','FaxInteraction','getInteractions','User','Owner','internal','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41a4,0x1d9));var _0x441a=function(_0x4a7338,_0xb3b080){_0x4a7338=_0x4a7338-0x0;var _0x52a5c5=_0x41a4[_0x4a7338];return _0x52a5c5;};'use strict';var emlformat=require(_0x441a('0x0'));var rimraf=require(_0x441a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x441a('0x2'));var rp=require(_0x441a('0x3'));var moment=require('moment');var BPromise=require(_0x441a('0x4'));var Mustache=require(_0x441a('0x5'));var util=require(_0x441a('0x6'));var path=require('path');var sox=require(_0x441a('0x7'));var csv=require('to-csv');var ejs=require(_0x441a('0x8'));var fs=require('fs');var fs_extra=require(_0x441a('0x9'));var _=require(_0x441a('0xa'));var squel=require(_0x441a('0xb'));var crypto=require(_0x441a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x441a('0xd'));var toCsv=require(_0x441a('0xe'));var querystring=require(_0x441a('0xf'));var Papa=require('papaparse');var Redis=require(_0x441a('0x10'));var authService=require(_0x441a('0x11'));var qs=require(_0x441a('0x12'));var as=require(_0x441a('0x13'));var hardwareService=require(_0x441a('0x14'));var logger=require(_0x441a('0x15'))(_0x441a('0x16'));var utils=require(_0x441a('0x17'));var config=require(_0x441a('0x18'));var licenseUtil=require(_0x441a('0x19'));var db=require(_0x441a('0x1a'))['db'];config[_0x441a('0x1b')]=_[_0x441a('0x1c')](config[_0x441a('0x1b')],{'host':_0x441a('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x441a('0x1e'))[_0x441a('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x441a('0x20')][_0x441a('0x21')]({'port':0x232c});var client9002=jayson[_0x441a('0x20')][_0x441a('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1d2720,_0x4e15db,_0x2580d3,_0x15105a){return new BPromise(function(_0x5c99ff,_0x40534f){var _0x543f2e=_0x15105a||client;return _0x543f2e['request'](_0x1d2720,_0x2580d3)['then'](function(_0xb7e0fb){logger[_0x441a('0x22')]('FaxAccount,\x20%s,\x20%s',_0x4e15db,_0x441a('0x23'));logger[_0x441a('0x24')](_0x441a('0x25'),_0x4e15db,'request\x20sent',JSON['stringify'](_0xb7e0fb));if(_0xb7e0fb['error']){if(_0xb7e0fb[_0x441a('0x26')][_0x441a('0x27')]===0x1f4){logger[_0x441a('0x26')]('FaxAccount,\x20%s,\x20%s',_0x4e15db,_0xb7e0fb[_0x441a('0x26')][_0x441a('0x28')]);return _0x40534f(_0xb7e0fb[_0x441a('0x26')][_0x441a('0x28')]);}logger[_0x441a('0x26')]('FaxAccount,\x20%s,\x20%s',_0x4e15db,_0xb7e0fb[_0x441a('0x26')][_0x441a('0x28')]);return _0x5c99ff(_0xb7e0fb[_0x441a('0x26')]['message']);}else{logger[_0x441a('0x22')]('FaxAccount,\x20%s,\x20%s',_0x4e15db,_0x441a('0x23'));_0x5c99ff(_0xb7e0fb[_0x441a('0x29')]['message']);}})[_0x441a('0x2a')](function(_0x40603f){logger['error'](_0x441a('0x2b'),_0x4e15db,_0x40603f);_0x40534f(_0x40603f);});});}function respondWithStatusCode(_0x43c559,_0x4d4e6d){_0x4d4e6d=_0x4d4e6d||0xcc;return function(_0x5f4955){if(_0x5f4955){return _0x43c559[_0x441a('0x2c')](_0x4d4e6d);}return _0x43c559['status'](_0x4d4e6d)[_0x441a('0x2d')]();};}function respondWithResult(_0xb16e3f,_0x32a75b){_0x32a75b=_0x32a75b||0xc8;return function(_0x70dc36){if(_0x70dc36){return _0xb16e3f[_0x441a('0x2e')](_0x32a75b)[_0x441a('0x2f')](_0x70dc36);}};}function respondWithFilteredResult(_0x1a0791,_0x1e1b90){return function(_0x24c2b7){if(_0x24c2b7){var _0x3e113c=typeof _0x1e1b90[_0x441a('0x30')]==='undefined'&&typeof _0x1e1b90[_0x441a('0x31')]===_0x441a('0x32');var _0x4663e9=_0x24c2b7['count'];var _0x44b153=_0x3e113c?0x0:_0x1e1b90[_0x441a('0x30')];var _0x246f80=_0x3e113c?_0x24c2b7[_0x441a('0x33')]:_0x1e1b90[_0x441a('0x30')]+_0x1e1b90['limit'];var _0x165e9b;if(_0x246f80>=_0x4663e9){_0x246f80=_0x4663e9;_0x165e9b=0xc8;}else{_0x165e9b=0xce;}_0x1a0791[_0x441a('0x2e')](_0x165e9b);return _0x1a0791[_0x441a('0x34')](_0x441a('0x35'),_0x44b153+'-'+_0x246f80+'/'+_0x4663e9)['json'](_0x24c2b7);}return null;};}function patchUpdates(_0x9fa0f0){return function(_0x4bbf04){try{jsonpatch[_0x441a('0x36')](_0x4bbf04,_0x9fa0f0,!![]);}catch(_0x278573){return BPromise[_0x441a('0x37')](_0x278573);}return _0x4bbf04[_0x441a('0x38')]();};}function saveUpdates(_0x1abe33,_0x2009c7){return function(_0x1e45ff){if(_0x1e45ff){return _0x1e45ff['update'](_0x1abe33)[_0x441a('0x39')](function(_0x42af12){return _0x42af12;});}return null;};}function removeEntity(_0x5b9c2e,_0x50d482){return function(_0x19dbe9){if(_0x19dbe9){return _0x19dbe9['destroy']()[_0x441a('0x39')](function(){var _0x7c5c72=_0x19dbe9[_0x441a('0x3a')]({'plain':!![]});var _0x519304=_0x441a('0x3b');return db[_0x441a('0x3c')][_0x441a('0x3d')]({'where':{'type':_0x519304,'resourceId':_0x7c5c72['id']}})[_0x441a('0x39')](function(){return _0x19dbe9;});})[_0x441a('0x39')](function(){_0x5b9c2e[_0x441a('0x2e')](0xcc)[_0x441a('0x2d')]();});}};}function handleEntityNotFound(_0x535af1,_0x2c303b){return function(_0x402ebd){if(!_0x402ebd){_0x535af1[_0x441a('0x2c')](0x194);}return _0x402ebd;};}function handleError(_0x36801e,_0x10d5ea){_0x10d5ea=_0x10d5ea||0x1f4;return function(_0x2f96dd){logger[_0x441a('0x26')](_0x2f96dd['stack']);if(_0x2f96dd[_0x441a('0x3e')]){delete _0x2f96dd['name'];}_0x36801e[_0x441a('0x2e')](_0x10d5ea)[_0x441a('0x3f')](_0x2f96dd);};}exports[_0x441a('0x40')]=function(_0x39280a,_0x5f1e60){var _0x11d69e={'include':[{'model':db[_0x441a('0x41')],'as':_0x441a('0x42')}]},_0x4cba0c={},_0x54a107={'count':0x0,'rows':[]};var _0x45658e=_[_0x441a('0x43')](db[_0x441a('0x44')][_0x441a('0x45')],function(_0xf184fa){return{'name':_0xf184fa[_0x441a('0x46')],'type':_0xf184fa[_0x441a('0x47')][_0x441a('0x48')]};});_0x4cba0c['model']=_['map'](_0x45658e,'name');_0x4cba0c[_0x441a('0x49')]=_['keys'](_0x39280a[_0x441a('0x49')]);_0x4cba0c['filters']=_[_0x441a('0x4a')](_0x4cba0c[_0x441a('0x4b')],_0x4cba0c[_0x441a('0x49')]);_0x11d69e[_0x441a('0x4c')]=_['intersection'](_0x4cba0c[_0x441a('0x4b')],qs['fields'](_0x39280a[_0x441a('0x49')][_0x441a('0x4d')]));_0x11d69e[_0x441a('0x4c')]=_0x11d69e['attributes'][_0x441a('0x4e')]?_0x11d69e['attributes']:_0x4cba0c[_0x441a('0x4b')];if(!_0x39280a[_0x441a('0x49')][_0x441a('0x4f')](_0x441a('0x50'))){_0x11d69e[_0x441a('0x31')]=qs['limit'](_0x39280a[_0x441a('0x49')][_0x441a('0x31')]);_0x11d69e[_0x441a('0x30')]=qs[_0x441a('0x30')](_0x39280a[_0x441a('0x49')][_0x441a('0x30')]);}_0x11d69e[_0x441a('0x51')]=qs['sort'](_0x39280a[_0x441a('0x49')][_0x441a('0x52')]);_0x11d69e['where']=qs[_0x441a('0x53')](_['pick'](_0x39280a[_0x441a('0x49')],_0x4cba0c[_0x441a('0x53')]),_0x45658e);if(_0x39280a[_0x441a('0x49')][_0x441a('0x54')]){_0x11d69e[_0x441a('0x55')]=_[_0x441a('0x56')](_0x11d69e['where'],{'$or':_[_0x441a('0x43')](_0x45658e,function(_0x3c26c6){if(_0x3c26c6['type']!==_0x441a('0x57')){var _0xfa5547={};_0xfa5547[_0x3c26c6[_0x441a('0x3e')]]={'$like':'%'+_0x39280a[_0x441a('0x49')][_0x441a('0x54')]+'%'};return _0xfa5547;}})});}_0x11d69e=_['merge']({},_0x11d69e,_0x39280a[_0x441a('0x58')]);var _0x157b09={'where':_0x11d69e[_0x441a('0x55')]};return db[_0x441a('0x44')][_0x441a('0x33')](_0x157b09)['then'](function(_0x5a1634){_0x54a107[_0x441a('0x33')]=_0x5a1634;if(_0x39280a['query'][_0x441a('0x59')]){_0x11d69e[_0x441a('0x5a')]=[{'all':!![]}];}return db[_0x441a('0x44')]['findAll'](_0x11d69e);})['then'](function(_0x4ef86a){_0x54a107[_0x441a('0x5b')]=_0x4ef86a;return _0x54a107;})[_0x441a('0x39')](respondWithFilteredResult(_0x5f1e60,_0x11d69e))[_0x441a('0x2a')](handleError(_0x5f1e60,null));};exports[_0x441a('0x5c')]=function(_0x30705d,_0x538572){var _0x475423={'raw':![],'where':{'id':_0x30705d[_0x441a('0x5d')]['id']},'include':[{'model':db[_0x441a('0x41')],'as':_0x441a('0x42')}]},_0x3c71ec={};_0x3c71ec['model']=_['keys'](db[_0x441a('0x44')][_0x441a('0x45')]);_0x3c71ec[_0x441a('0x49')]=_[_0x441a('0x5e')](_0x30705d['query']);_0x3c71ec['filters']=_[_0x441a('0x4a')](_0x3c71ec[_0x441a('0x4b')],_0x3c71ec[_0x441a('0x49')]);_0x475423[_0x441a('0x4c')]=_[_0x441a('0x4a')](_0x3c71ec['model'],qs[_0x441a('0x4d')](_0x30705d[_0x441a('0x49')][_0x441a('0x4d')]));_0x475423['attributes']=_0x475423['attributes']['length']?_0x475423[_0x441a('0x4c')]:_0x3c71ec['model'];if(_0x30705d[_0x441a('0x49')]['includeAll']){_0x475423[_0x441a('0x5a')]=[{'all':!![]}];}_0x475423=_[_0x441a('0x56')]({},_0x475423,_0x30705d[_0x441a('0x58')]);return db['FaxAccount']['find'](_0x475423)[_0x441a('0x39')](handleEntityNotFound(_0x538572,null))[_0x441a('0x39')](respondWithResult(_0x538572,null))[_0x441a('0x2a')](handleError(_0x538572,null));};exports[_0x441a('0x5f')]=function(_0x5c57d7,_0x173727){return db['FaxAccount'][_0x441a('0x5f')](_0x5c57d7['body'],{})[_0x441a('0x39')](function(_0x2e0058){var _0x2f20fa=_0x5c57d7['user'][_0x441a('0x3a')]({'plain':!![]});if(!_0x2f20fa)throw new Error(_0x441a('0x60'));if(_0x2f20fa['role']==='user'){var _0x5a15ae=_0x2e0058['get']({'plain':!![]});var _0x3c8dfc=_0x441a('0x3b');return db['UserProfileSection'][_0x441a('0x61')]({'where':{'name':_0x3c8dfc,'userProfileId':_0x2f20fa['userProfileId']},'raw':!![]})[_0x441a('0x39')](function(_0x3589b2){if(_0x3589b2&&_0x3589b2[_0x441a('0x62')]===0x0){return db[_0x441a('0x3c')]['create']({'name':_0x5a15ae[_0x441a('0x3e')],'resourceId':_0x5a15ae['id'],'type':_0x3589b2[_0x441a('0x3e')],'sectionId':_0x3589b2['id']},{})[_0x441a('0x39')](function(){return _0x2e0058;});}else{return _0x2e0058;}})[_0x441a('0x2a')](function(_0x39ba37){logger[_0x441a('0x26')](_0x441a('0x63'),_0x39ba37);throw _0x39ba37;});}return _0x2e0058;})[_0x441a('0x39')](respondWithResult(_0x173727,0xc9))[_0x441a('0x2a')](handleError(_0x173727,null));};exports['update']=function(_0x10d4e1,_0x1a6281){if(_0x10d4e1[_0x441a('0x64')]['id']){delete _0x10d4e1[_0x441a('0x64')]['id'];}return db[_0x441a('0x44')]['find']({'where':{'id':_0x10d4e1['params']['id']},'include':[{'model':db[_0x441a('0x41')],'as':_0x441a('0x42')}]})[_0x441a('0x39')](handleEntityNotFound(_0x1a6281,null))[_0x441a('0x39')](saveUpdates(_0x10d4e1[_0x441a('0x64')],null))['then'](respondWithResult(_0x1a6281,null))[_0x441a('0x2a')](handleError(_0x1a6281,null));};exports[_0x441a('0x3d')]=function(_0x4072ba,_0x42fad9){return db[_0x441a('0x44')][_0x441a('0x61')]({'where':{'id':_0x4072ba[_0x441a('0x5d')]['id']}})[_0x441a('0x39')](handleEntityNotFound(_0x42fad9,null))[_0x441a('0x39')](removeEntity(_0x42fad9,null))[_0x441a('0x2a')](handleError(_0x42fad9,null));};exports[_0x441a('0x65')]=function(_0xf4290a,_0xf4eb8f){return db[_0x441a('0x44')][_0x441a('0x65')]()['then'](respondWithResult(_0xf4eb8f,null))[_0x441a('0x2a')](handleError(_0xf4eb8f,null));};exports[_0x441a('0x66')]=function(_0x2d5e9d,_0x1b21b2,_0x55e8a8){if(_0x2d5e9d[_0x441a('0x64')]['id']){delete _0x2d5e9d[_0x441a('0x64')]['id'];}return db[_0x441a('0x44')][_0x441a('0x61')]({'where':{'id':_0x2d5e9d['params']['id']}})[_0x441a('0x39')](handleEntityNotFound(_0x1b21b2,null))[_0x441a('0x39')](function(_0x492ebb){if(_0x492ebb){_0x2d5e9d[_0x441a('0x64')]['FaxAccountId']=_0x492ebb['id'];return db['Disposition']['create'](_0x2d5e9d[_0x441a('0x64')]);}})[_0x441a('0x39')](respondWithResult(_0x1b21b2,null))[_0x441a('0x2a')](handleError(_0x1b21b2,null));};exports['getDispositions']=function(_0x415a7a,_0x35832e,_0x583118){var _0x326ef3={'raw':![],'where':{}};var _0x407d13={};var _0x54d4f6={'count':0x0,'rows':[]};return db['FaxAccount'][_0x441a('0x67')]({'where':{'id':_0x415a7a[_0x441a('0x5d')]['id']}})[_0x441a('0x39')](handleEntityNotFound(_0x35832e,null))['then'](function(_0x715678){if(_0x715678){_0x407d13[_0x441a('0x4b')]=_[_0x441a('0x5e')](db[_0x441a('0x68')]['rawAttributes']);_0x407d13[_0x441a('0x49')]=_[_0x441a('0x5e')](_0x415a7a[_0x441a('0x49')]);_0x407d13[_0x441a('0x53')]=_[_0x441a('0x4a')](_0x407d13[_0x441a('0x4b')],_0x407d13[_0x441a('0x49')]);_0x326ef3['attributes']=_[_0x441a('0x4a')](_0x407d13['model'],qs[_0x441a('0x4d')](_0x415a7a[_0x441a('0x49')][_0x441a('0x4d')]));_0x326ef3[_0x441a('0x4c')]=_0x326ef3[_0x441a('0x4c')][_0x441a('0x4e')]?_0x326ef3['attributes']:_0x407d13['model'];if(!_0x415a7a[_0x441a('0x49')]['hasOwnProperty'](_0x441a('0x50'))){_0x326ef3[_0x441a('0x31')]=qs[_0x441a('0x31')](_0x415a7a[_0x441a('0x49')][_0x441a('0x31')]);_0x326ef3[_0x441a('0x30')]=qs[_0x441a('0x30')](_0x415a7a['query'][_0x441a('0x30')]);}_0x326ef3['order']=qs[_0x441a('0x52')](_0x415a7a['query'][_0x441a('0x52')]);_0x326ef3[_0x441a('0x55')]=qs['filters'](_['pick'](_0x415a7a[_0x441a('0x49')],_0x407d13[_0x441a('0x53')]));_0x326ef3[_0x441a('0x55')][_0x441a('0x69')]=_0x715678['id'];if(_0x415a7a[_0x441a('0x49')]['filter']){_0x326ef3['where']=_['merge'](_0x326ef3['where'],{'$or':_['map'](_0x326ef3[_0x441a('0x4c')],function(_0x354390){var _0x4deb1a={};_0x4deb1a[_0x354390]={'$like':'%'+_0x415a7a['query'][_0x441a('0x54')]+'%'};return _0x4deb1a;})});}_0x326ef3=_[_0x441a('0x56')]({},_0x326ef3,_0x415a7a[_0x441a('0x58')]);return db[_0x441a('0x68')][_0x441a('0x33')]({'where':_0x326ef3[_0x441a('0x55')]})[_0x441a('0x39')](function(_0x1d08ae){_0x54d4f6['count']=_0x1d08ae;if(_0x415a7a[_0x441a('0x49')][_0x441a('0x59')]){_0x326ef3[_0x441a('0x5a')]=[{'all':!![]}];}return db[_0x441a('0x68')]['findAll'](_0x326ef3);})[_0x441a('0x39')](function(_0x3c0b8c){_0x54d4f6[_0x441a('0x5b')]=_0x3c0b8c;return _0x54d4f6;});}})[_0x441a('0x39')](respondWithFilteredResult(_0x35832e,_0x326ef3))[_0x441a('0x2a')](handleError(_0x35832e,null));};exports['removeDispositions']=function(_0x3083ba,_0x2da942,_0x4a0d9b){return db['FaxAccount'][_0x441a('0x61')]({'where':{'id':_0x3083ba[_0x441a('0x5d')]['id']}})[_0x441a('0x39')](handleEntityNotFound(_0x2da942,null))[_0x441a('0x39')](function(_0x2bfe48){if(_0x2bfe48){return _0x2bfe48[_0x441a('0x6a')](_0x3083ba[_0x441a('0x49')]['ids']);}})['then'](respondWithStatusCode(_0x2da942,null))[_0x441a('0x2a')](handleError(_0x2da942,null));};exports[_0x441a('0x6b')]=function(_0x3514f8,_0x2ace6e,_0x5f123a){if(_0x3514f8[_0x441a('0x64')]['id']){delete _0x3514f8['body']['id'];}return db[_0x441a('0x44')][_0x441a('0x61')]({'where':{'id':_0x3514f8[_0x441a('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2ace6e,null))['then'](function(_0x112817){if(_0x112817){_0x3514f8['body']['FaxAccountId']=_0x112817['id'];return db[_0x441a('0x6c')][_0x441a('0x5f')](_0x3514f8[_0x441a('0x64')]);}})['then'](respondWithResult(_0x2ace6e,null))['catch'](handleError(_0x2ace6e,null));};exports[_0x441a('0x6d')]=function(_0x19f8b0,_0x43f729,_0x49c625){var _0x13ec99={'raw':![],'where':{}};var _0x166941={};var _0x1e5899={'count':0x0,'rows':[]};return db[_0x441a('0x44')][_0x441a('0x67')]({'where':{'id':_0x19f8b0[_0x441a('0x5d')]['id']}})[_0x441a('0x39')](handleEntityNotFound(_0x43f729,null))['then'](function(_0x11edd9){if(_0x11edd9){_0x166941[_0x441a('0x4b')]=_['keys'](db[_0x441a('0x6c')][_0x441a('0x45')]);_0x166941['query']=_[_0x441a('0x5e')](_0x19f8b0[_0x441a('0x49')]);_0x166941[_0x441a('0x53')]=_[_0x441a('0x4a')](_0x166941[_0x441a('0x4b')],_0x166941[_0x441a('0x49')]);_0x13ec99[_0x441a('0x4c')]=_[_0x441a('0x4a')](_0x166941['model'],qs['fields'](_0x19f8b0['query']['fields']));_0x13ec99[_0x441a('0x4c')]=_0x13ec99[_0x441a('0x4c')][_0x441a('0x4e')]?_0x13ec99[_0x441a('0x4c')]:_0x166941[_0x441a('0x4b')];if(!_0x19f8b0[_0x441a('0x49')][_0x441a('0x4f')](_0x441a('0x50'))){_0x13ec99[_0x441a('0x31')]=qs['limit'](_0x19f8b0['query'][_0x441a('0x31')]);_0x13ec99[_0x441a('0x30')]=qs[_0x441a('0x30')](_0x19f8b0[_0x441a('0x49')]['offset']);}_0x13ec99[_0x441a('0x51')]=qs['sort'](_0x19f8b0['query'][_0x441a('0x52')]);_0x13ec99['where']=qs['filters'](_[_0x441a('0x6e')](_0x19f8b0[_0x441a('0x49')],_0x166941['filters']));_0x13ec99[_0x441a('0x55')][_0x441a('0x69')]=_0x11edd9['id'];if(_0x19f8b0['query'][_0x441a('0x54')]){_0x13ec99['where']=_[_0x441a('0x56')](_0x13ec99[_0x441a('0x55')],{'$or':_['map'](_0x13ec99[_0x441a('0x4c')],function(_0x1126d2){var _0x4ece24={};_0x4ece24[_0x1126d2]={'$like':'%'+_0x19f8b0[_0x441a('0x49')][_0x441a('0x54')]+'%'};return _0x4ece24;})});}_0x13ec99=_['merge']({},_0x13ec99,_0x19f8b0[_0x441a('0x58')]);return db['CannedAnswer'][_0x441a('0x33')]({'where':_0x13ec99[_0x441a('0x55')]})['then'](function(_0x9d442f){_0x1e5899[_0x441a('0x33')]=_0x9d442f;if(_0x19f8b0[_0x441a('0x49')][_0x441a('0x59')]){_0x13ec99[_0x441a('0x5a')]=[{'all':!![]}];}return db[_0x441a('0x6c')][_0x441a('0x6f')](_0x13ec99);})['then'](function(_0x27e833){_0x1e5899[_0x441a('0x5b')]=_0x27e833;return _0x1e5899;});}})['then'](respondWithFilteredResult(_0x43f729,_0x13ec99))['catch'](handleError(_0x43f729,null));};exports['removeAnswers']=function(_0x57f082,_0x4e4bc1,_0x1d4b91){return db[_0x441a('0x44')][_0x441a('0x61')]({'where':{'id':_0x57f082[_0x441a('0x5d')]['id']}})[_0x441a('0x39')](handleEntityNotFound(_0x4e4bc1,null))[_0x441a('0x39')](function(_0x52b65b){if(_0x52b65b){return _0x52b65b[_0x441a('0x70')](_0x57f082[_0x441a('0x49')][_0x441a('0x71')]);}})[_0x441a('0x39')](respondWithStatusCode(_0x4e4bc1,null))[_0x441a('0x2a')](handleError(_0x4e4bc1,null));};exports[_0x441a('0x72')]=function(_0x11dc73,_0xde6567,_0x51d6a1){return db[_0x441a('0x73')][_0x441a('0x61')]({'where':{'id':_0x11dc73[_0x441a('0x5d')]['id']}})[_0x441a('0x39')](handleEntityNotFound(_0xde6567,null))[_0x441a('0x39')](function(_0x1a6e12){if(_0x1a6e12){return _0x1a6e12[_0x441a('0x72')](_0x11dc73[_0x441a('0x64')]['ids'],_['omit'](_0x11dc73['body'],[_0x441a('0x71'),'id'])||{});}})[_0x441a('0x39')](respondWithResult(_0xde6567,null))[_0x441a('0x2a')](handleError(_0xde6567,null));};exports[_0x441a('0x74')]=function(_0x43e93d,_0x2a0e6c,_0x2a391a){var _0x1ed687={'raw':![],'where':{}};var _0x3b8903={};var _0x48ad8b={'count':0x0,'rows':[]};return db[_0x441a('0x44')][_0x441a('0x67')]({'where':{'id':_0x43e93d[_0x441a('0x5d')]['id']}})[_0x441a('0x39')](handleEntityNotFound(_0x2a0e6c,null))[_0x441a('0x39')](function(_0x102c85){if(_0x102c85){_0x3b8903[_0x441a('0x4b')]=_[_0x441a('0x5e')](db['FaxInteraction'][_0x441a('0x45')]);_0x3b8903[_0x441a('0x49')]=_['keys'](_0x43e93d[_0x441a('0x49')]);_0x3b8903[_0x441a('0x53')]=_[_0x441a('0x4a')](_0x3b8903[_0x441a('0x4b')],_0x3b8903['query']);_0x1ed687[_0x441a('0x4c')]=_[_0x441a('0x4a')](_0x3b8903['model'],qs[_0x441a('0x4d')](_0x43e93d[_0x441a('0x49')][_0x441a('0x4d')]));_0x1ed687[_0x441a('0x4c')]=_0x1ed687[_0x441a('0x4c')]['length']?_0x1ed687['attributes']:_0x3b8903['model'];if(!_0x43e93d[_0x441a('0x49')][_0x441a('0x4f')]('nolimit')){_0x1ed687['limit']=qs[_0x441a('0x31')](_0x43e93d[_0x441a('0x49')][_0x441a('0x31')]);_0x1ed687[_0x441a('0x30')]=qs[_0x441a('0x30')](_0x43e93d[_0x441a('0x49')]['offset']);}_0x1ed687[_0x441a('0x51')]=qs[_0x441a('0x52')](_0x43e93d[_0x441a('0x49')][_0x441a('0x52')]);_0x1ed687[_0x441a('0x55')]=qs['filters'](_['pick'](_0x43e93d['query'],_0x3b8903[_0x441a('0x53')]));_0x1ed687['where'][_0x441a('0x69')]=_0x102c85['id'];if(_0x43e93d[_0x441a('0x49')]['filter']){_0x1ed687[_0x441a('0x55')]=_[_0x441a('0x56')](_0x1ed687[_0x441a('0x55')],{'$or':_[_0x441a('0x43')](_0x1ed687[_0x441a('0x4c')],function(_0xd899b2){var _0x2942f0={};_0x2942f0[_0xd899b2]={'$like':'%'+_0x43e93d[_0x441a('0x49')][_0x441a('0x54')]+'%'};return _0x2942f0;})});}_0x1ed687=_[_0x441a('0x56')]({},_0x1ed687,_0x43e93d[_0x441a('0x58')]);return db[_0x441a('0x73')][_0x441a('0x33')]({'where':_0x1ed687[_0x441a('0x55')]})['then'](function(_0xddc41b){_0x48ad8b[_0x441a('0x33')]=_0xddc41b;if(_0x43e93d[_0x441a('0x49')][_0x441a('0x59')]){_0x1ed687['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x441a('0x75')],'as':_0x441a('0x76'),'attributes':[_0x441a('0x3e'),'fullname',_0x441a('0x77')],'required':![]},{'model':db['Tag'],'as':_0x441a('0x78'),'attributes':['id','name',_0x441a('0x79')],'where':_0x43e93d[_0x441a('0x49')][_0x441a('0x7a')]?{'id':_0x43e93d[_0x441a('0x49')][_0x441a('0x7a')]}:undefined,'required':_0x43e93d[_0x441a('0x49')][_0x441a('0x7a')]?!![]:![]}];}return db['FaxInteraction'][_0x441a('0x6f')](_0x1ed687);})[_0x441a('0x39')](function(_0x242642){_0x48ad8b['rows']=_0x242642;return _0x48ad8b;});}})['then'](respondWithFilteredResult(_0x2a0e6c,_0x1ed687))[_0x441a('0x2a')](handleError(_0x2a0e6c,null));};exports['addApplications']=function(_0x1680a6,_0x1817b9){var _0x2e9814=_0x1680a6[_0x441a('0x5d')]['id'];var _0x31e306=_0x1680a6[_0x441a('0x64')];var _0x173e28=0xc8;var _0x3a2054=null;return db[_0x441a('0x7b')][_0x441a('0x7c')]({'isolationLevel':db[_0x441a('0x7b')][_0x441a('0x7d')][_0x441a('0x7e')][_0x441a('0x7f')]},function(_0x155dfc){return db[_0x441a('0x44')][_0x441a('0x67')]({'where':{'id':_0x2e9814},'transaction':_0x155dfc})[_0x441a('0x39')](function(_0x33f038){if(_0x33f038){return db[_0x441a('0x80')]['destroy']({'where':{'FaxAccountId':_0x2e9814},'transaction':_0x155dfc})[_0x441a('0x39')](function(){var _0x1484b4=_[_0x441a('0x43')](_0x31e306,function(_0x5408c9){_0x5408c9['FaxAccountId']=_0x2e9814;return _0x5408c9;});return db['FaxApplication'][_0x441a('0x81')](_0x1484b4,{'transaction':_0x155dfc});});}else{_0x173e28=0x194;_0x3a2054=[];}});})[_0x441a('0x39')](function(){if(_0x173e28!==0x194){return db[_0x441a('0x80')][_0x441a('0x82')]({'where':{'FaxAccountId':_0x2e9814},'order':_0x441a('0x83')})[_0x441a('0x39')](function(_0xc72e4d){_0x3a2054=_0xc72e4d;});}})['catch'](function(_0x3b5fac){_0x173e28=0x1f4;logger['error'](_0x3b5fac[_0x441a('0x84')]);if(_0x3b5fac['name']){delete _0x3b5fac[_0x441a('0x3e')];}_0x3a2054=_0x3b5fac;})['finally'](function(){if(_0x3a2054===null){_0x1817b9[_0x441a('0x2c')](_0x173e28);}else{if(_0x173e28===0x1f4){_0x1817b9[_0x441a('0x2e')](_0x173e28)[_0x441a('0x3f')](_0x3a2054);}else{_0x1817b9['status'](_0x173e28)[_0x441a('0x2f')](_0x3a2054);}}});};exports[_0x441a('0x85')]=function(_0x5dc56c,_0x253ede,_0x3c9b00){var _0x4e136b={};var _0x55e26e={};var _0x23e951;var _0x59418c;return db[_0x441a('0x44')][_0x441a('0x67')]({'where':{'id':_0x5dc56c[_0x441a('0x5d')]['id']}})[_0x441a('0x39')](handleEntityNotFound(_0x253ede,null))[_0x441a('0x39')](function(_0x36b27c){if(_0x36b27c){_0x23e951=_0x36b27c;_0x55e26e[_0x441a('0x4b')]=_[_0x441a('0x5e')](db['FaxApplication'][_0x441a('0x45')]);_0x55e26e[_0x441a('0x49')]=_[_0x441a('0x5e')](_0x5dc56c[_0x441a('0x49')]);_0x55e26e['filters']=_[_0x441a('0x4a')](_0x55e26e['model'],_0x55e26e[_0x441a('0x49')]);_0x4e136b['attributes']=_[_0x441a('0x4a')](_0x55e26e[_0x441a('0x4b')],qs['fields'](_0x5dc56c[_0x441a('0x49')][_0x441a('0x4d')]));_0x4e136b[_0x441a('0x4c')]=_0x4e136b[_0x441a('0x4c')][_0x441a('0x4e')]?_0x4e136b[_0x441a('0x4c')]:_0x55e26e[_0x441a('0x4b')];_0x4e136b[_0x441a('0x51')]=qs[_0x441a('0x52')](_0x5dc56c['query'][_0x441a('0x52')]);_0x4e136b[_0x441a('0x55')]=qs['filters'](_['pick'](_0x5dc56c[_0x441a('0x49')],_0x55e26e[_0x441a('0x53')]));if(_0x5dc56c[_0x441a('0x49')][_0x441a('0x54')]){_0x4e136b[_0x441a('0x55')]=_['merge'](_0x4e136b[_0x441a('0x55')],{'$or':_[_0x441a('0x43')](_0x4e136b[_0x441a('0x4c')],function(_0x9d1fc8){var _0x3a7849={};_0x3a7849[_0x9d1fc8]={'$like':'%'+_0x5dc56c[_0x441a('0x49')][_0x441a('0x54')]+'%'};return _0x3a7849;})});}_0x4e136b=_[_0x441a('0x56')]({},_0x4e136b,_0x5dc56c[_0x441a('0x58')]);return _0x23e951[_0x441a('0x85')](_0x4e136b);}})[_0x441a('0x39')](function(_0x4a1170){if(_0x4a1170){_0x59418c=_0x4a1170[_0x441a('0x4e')];if(!_0x5dc56c[_0x441a('0x49')][_0x441a('0x4f')](_0x441a('0x50'))){_0x4e136b['limit']=qs['limit'](_0x5dc56c[_0x441a('0x49')][_0x441a('0x31')]);_0x4e136b[_0x441a('0x30')]=qs['offset'](_0x5dc56c[_0x441a('0x49')][_0x441a('0x30')]);}return _0x23e951[_0x441a('0x85')](_0x4e136b);}})[_0x441a('0x39')](function(_0x18aa9e){if(_0x18aa9e){return _0x18aa9e?{'count':_0x59418c,'rows':_0x18aa9e}:null;}})[_0x441a('0x39')](respondWithResult(_0x253ede,null))['catch'](handleError(_0x253ede,null));};function Extension(_0x582caf,_0x120346,_0x34ef8c,_0x5abca5){this[_0x441a('0x86')]=_0x441a('0x87');this[_0x441a('0x88')]=_0x582caf[_0x441a('0x89')];this[_0x441a('0x8a')]=_0x5abca5;this['type']='system';this[_0x441a('0x8b')]=_0x441a('0x8c');this[_0x441a('0x69')]=_0x582caf['id'];this[_0x441a('0x83')]=_0x120346;this[_0x441a('0x8d')]=_0x34ef8c;}function createExtensionsReciveFax(_0x3b11f0){var _0x33e1a3=0x1;var _0x4cd151=[];_0x4cd151[_0x441a('0x8e')](new Extension(_0x3b11f0,_0x33e1a3,'',_0x441a('0x8f')));_0x33e1a3+=0x1;_0x4cd151['push'](new Extension(_0x3b11f0,_0x33e1a3,_0x441a('0x90'),_0x441a('0x91')));_0x33e1a3+=0x1;for(var _0x4843e6 in _0x3b11f0){if(_0x3b11f0[_0x441a('0x4f')](_0x4843e6)&&(_0x4843e6===_0x441a('0x92')||_0x4843e6===_0x441a('0x89')||_0x4843e6===_0x441a('0x93')||_0x4843e6===_0x441a('0x94')||_0x4843e6===_0x441a('0x95')||_0x4843e6===_0x441a('0x96')||_0x4843e6===_0x441a('0x97')||_0x4843e6===_0x441a('0x98')||_0x4843e6==='t38timeout')){_0x4cd151[_0x441a('0x8e')](new Extension(_0x3b11f0,_0x33e1a3,_0x441a('0x99')+_0x4843e6+')='+_0x3b11f0[_0x4843e6],_0x441a('0x91')));_0x33e1a3+=0x1;}}_0x4cd151[_0x441a('0x8e')](new Extension(_0x3b11f0,_0x33e1a3,'6','Wait'));_0x33e1a3+=0x1;_0x4cd151['push'](new Extension(_0x3b11f0,_0x33e1a3,_0x441a('0x9a'),_0x441a('0x9b')));_0x33e1a3=0x0;return _0x4cd151;}exports[_0x441a('0x9c')]=function(_0x2b1a49,_0x105a7f,_0x26f7ac){var _0x34f211;return db[_0x441a('0x7b')][_0x441a('0x7c')](function(_0x3ace5e){return db[_0x441a('0x44')][_0x441a('0x5f')](_0x2b1a49[_0x441a('0x64')],{'transaction':_0x3ace5e})['then'](function(_0x25b2d0){_0x34f211=_0x25b2d0[_0x441a('0x3a')]({'plain':!![]});return db[_0x441a('0x9d')][_0x441a('0x81')](createExtensionsReciveFax(_0x34f211),{'transaction':_0x3ace5e});});})[_0x441a('0x39')](function(){return _0x34f211;})[_0x441a('0x39')](respondWithResult(_0x105a7f,null))[_0x441a('0x2a')](handleError(_0x105a7f,null));};exports[_0x441a('0x9e')]=function(_0x4c92d7,_0x9a5235,_0x5d736a){var _0xcc01c4;return db[_0x441a('0x7b')][_0x441a('0x7c')](function(_0x179d00){return db[_0x441a('0x44')]['update'](_0x4c92d7[_0x441a('0x64')],{'where':{'id':_0x4c92d7['body']['id']},'transaction':_0x179d00})[_0x441a('0x39')](function(_0x39185e){return db[_0x441a('0x9d')][_0x441a('0x3d')]({'where':{'FaxAccountId':_0x4c92d7[_0x441a('0x64')]['id']},'transaction':_0x179d00})[_0x441a('0x39')](function(_0x52c2a){return db[_0x441a('0x9d')][_0x441a('0x81')](createExtensionsReciveFax(_[_0x441a('0x9f')](_0x4c92d7[_0x441a('0x64')],[_0x441a('0xa0'),_0x441a('0x48'),_0x441a('0xa1'),_0x441a('0xa2'),'TrunkId','ListId'])),{'transaction':_0x179d00});});});})[_0x441a('0x39')](function(){return db[_0x441a('0x44')][_0x441a('0xa3')](_0x4c92d7['body']['id']);})['then'](respondWithResult(_0x9a5235,null))[_0x441a('0x2a')](handleError(_0x9a5235,null));};exports['getMessages']=function(_0x4c27e6,_0x578aa8,_0x50bdbc){var _0x58890b={'raw':!![],'where':{}};var _0x206dad={};var _0x662e99={'count':0x0,'rows':[]};return db['FaxAccount'][_0x441a('0x67')]({'where':{'id':_0x4c27e6[_0x441a('0x5d')]['id']}})[_0x441a('0x39')](handleEntityNotFound(_0x578aa8,null))[_0x441a('0x39')](function(_0x54e686){if(_0x54e686){_0x206dad[_0x441a('0x4b')]=_['keys'](db[_0x441a('0xa4')][_0x441a('0x45')]);_0x206dad['query']=_[_0x441a('0x5e')](_0x4c27e6[_0x441a('0x49')]);_0x206dad[_0x441a('0x53')]=_[_0x441a('0x4a')](_0x206dad[_0x441a('0x4b')],_0x206dad['query']);_0x58890b['attributes']=_[_0x441a('0x4a')](_0x206dad[_0x441a('0x4b')],qs[_0x441a('0x4d')](_0x4c27e6[_0x441a('0x49')][_0x441a('0x4d')]));_0x58890b[_0x441a('0x4c')]=_0x58890b[_0x441a('0x4c')][_0x441a('0x4e')]?_0x58890b['attributes']:_0x206dad[_0x441a('0x4b')];if(!_0x4c27e6[_0x441a('0x49')][_0x441a('0x4f')](_0x441a('0x50'))){_0x58890b[_0x441a('0x31')]=qs[_0x441a('0x31')](_0x4c27e6[_0x441a('0x49')]['limit']);_0x58890b['offset']=qs[_0x441a('0x30')](_0x4c27e6[_0x441a('0x49')][_0x441a('0x30')]);}_0x58890b['order']=qs[_0x441a('0x52')](_0x4c27e6[_0x441a('0x49')][_0x441a('0x52')]);_0x58890b[_0x441a('0x55')]=qs[_0x441a('0x53')](_[_0x441a('0x6e')](_0x4c27e6[_0x441a('0x49')],_0x206dad[_0x441a('0x53')]));_0x58890b[_0x441a('0x55')]['FaxAccountId']=_0x54e686['id'];if(_0x4c27e6[_0x441a('0x49')][_0x441a('0x54')]){_0x58890b['where']=_[_0x441a('0x56')](_0x58890b['where'],{'$or':_['map'](_0x58890b['attributes'],function(_0x5933fc){var _0x5c18fb={};_0x5c18fb[_0x5933fc]={'$like':'%'+_0x4c27e6[_0x441a('0x49')][_0x441a('0x54')]+'%'};return _0x5c18fb;})});}if(_0x4c27e6['query'][_0x441a('0xa5')]){var _0x136438=_0x4c27e6[_0x441a('0x49')][_0x441a('0xa5')][_0x441a('0xa6')](',');var _0x54a020={};_0x54a020[_0x136438[0x0]]={'$gte':moment(_0x136438[0x1])[_0x441a('0xa7')]('YYYY-MM-DD\x20HH:mm:ss')};_0x58890b['where']=_[_0x441a('0x56')](_0x58890b[_0x441a('0x55')],_0x54a020);}_0x58890b=_[_0x441a('0x56')]({},_0x58890b,_0x4c27e6['options']);return db[_0x441a('0xa4')][_0x441a('0x33')]({'where':_0x58890b[_0x441a('0x55')]})[_0x441a('0x39')](function(_0x5332d5){_0x662e99[_0x441a('0x33')]=_0x5332d5;if(_0x4c27e6['query'][_0x441a('0x59')]){_0x58890b[_0x441a('0x5a')]=[{'all':!![]}];}return db[_0x441a('0xa4')]['findAll'](_0x58890b);})[_0x441a('0x39')](function(_0x4f33fd){_0x662e99[_0x441a('0x5b')]=_0x4f33fd;return _0x662e99;});}})[_0x441a('0x39')](respondWithFilteredResult(_0x578aa8,_0x58890b))['catch'](handleError(_0x578aa8,null));};exports[_0x441a('0x3f')]=function(_0x3549dd,_0xae9b4b,_0x59fd29){var _0x1f11ef,_0x42fb45={},_0x1f3b77;if(_0x3549dd['body']['to']){_0x1f3b77=_0x3549dd[_0x441a('0x64')]['to'][0x0];}return db[_0x441a('0x44')][_0x441a('0x61')]({'where':{'id':_0x3549dd[_0x441a('0x5d')]['id']},'include':[{'model':db[_0x441a('0xa8')],'as':'List','include':[{'model':db[_0x441a('0xa9')],'as':_0x441a('0xaa'),'where':{'fax':_0x1f3b77},'limit':0x1,'order':[[_0x441a('0xa2'),_0x441a('0xab')]]}]}]})[_0x441a('0x39')](handleEntityNotFound(_0xae9b4b,null))[_0x441a('0x39')](function(_0x51c188){_0x1f11ef=_0x51c188;if(_0x3549dd[_0x441a('0x64')]['attachments']&&_0x3549dd['body'][_0x441a('0xac')][_0x441a('0x4e')]){for(var _0x4f1014=0x0;_0x4f1014<_0x3549dd[_0x441a('0x64')][_0x441a('0xac')][_0x441a('0x4e')];_0x4f1014+=0x1){_0x3549dd[_0x441a('0x64')][_0x441a('0xac')][_0x4f1014]={'filename':_0x3549dd[_0x441a('0x64')][_0x441a('0xac')][_0x4f1014][_0x441a('0x3e')],'id':_0x3549dd[_0x441a('0x64')][_0x441a('0xac')][_0x4f1014]['id'],'path':path[_0x441a('0xad')](config['root'],_0x441a('0xae'),_0x3549dd[_0x441a('0x64')]['attachments'][_0x4f1014]['basename'])};}}return respondWithRpcPromise(_0x441a('0xaf'),'CheckAfterSend',{'FaxAccountId':_[_0x441a('0xb0')](_0x3549dd[_0x441a('0x5d')]['id'])?undefined:_0x3549dd[_0x441a('0x5d')]['id'],'path':_[_0x441a('0xb0')](_0x3549dd[_0x441a('0x64')][_0x441a('0xac')][0x0][_0x441a('0xb1')])?undefined:_0x3549dd[_0x441a('0x64')]['attachments'][0x0][_0x441a('0xb1')],'fax':_[_0x441a('0xb0')](_0x3549dd[_0x441a('0x64')]['to'][0x0])?undefined:_0x3549dd[_0x441a('0x64')]['to'][0x0]},client9002);})[_0x441a('0x39')](function(){if(_0x1f11ef){if(_['isNil'](_0x3549dd[_0x441a('0x64')][_0x441a('0xb2')])){_0x3549dd[_0x441a('0x64')][_0x441a('0xb2')]=util[_0x441a('0xa7')](_0x441a('0xb3'),_0x1f11ef[_0x441a('0x3e')],_0x1f11ef[_0x441a('0xb4')]);}if(_0x1f11ef[_0x441a('0xb5')]){if(_0x1f11ef[_0x441a('0xb5')][_0x441a('0xaa')][_0x441a('0x4e')]){return _0x1f11ef[_0x441a('0xb5')][_0x441a('0xaa')][0x0];}else{return db[_0x441a('0xa9')]['create'](_[_0x441a('0x1c')](_0x3549dd[_0x441a('0x64')],{'firstName':_0x3549dd[_0x441a('0x64')]['to'][0x0],'phone':_0x3549dd[_0x441a('0x64')]['to'][0x0],'fax':_0x3549dd[_0x441a('0x64')]['to'][0x0],'ListId':_0x1f11ef[_0x441a('0xb6')]}));}}else{throw new Error(_0x441a('0xb7'));}}else{throw new Error(_0x441a('0xb8'));}})[_0x441a('0x39')](function(_0xef5023){if(_0xef5023){return db[_0x441a('0x73')][_0x441a('0x61')]({'where':{'ContactId':_0xef5023['id'],'closed':![],'FaxAccountId':_0x1f11ef['id']}})[_0x441a('0x39')](function(_0x32f2db){if(_0x32f2db){return[_0x32f2db,![]];}return db[_0x441a('0x73')][_0x441a('0x5f')]({'UserId':_0x3549dd[_0x441a('0xb9')]['id'],'ContactId':_0xef5023['id'],'FaxAccountId':_0x1f11ef['id'],'fax':_0x3549dd[_0x441a('0x64')]['to'][0x0],'firstMsgDirection':_0x441a('0xba'),'Messages':[_[_0x441a('0x56')](_0x3549dd[_0x441a('0x64')],{'read':![],'body':_0x3549dd[_0x441a('0x64')]['attachments'][0x0][_0x441a('0xbb')],'FaxAccountId':_0x1f11ef['id'],'UserId':_0x3549dd[_0x441a('0xb9')]['id'],'ContactId':_0xef5023['id'],'AttachmentId':_0x3549dd[_0x441a('0x64')][_0x441a('0xac')][0x0]['id']})]},{'include':[{'model':db[_0x441a('0xa4')],'as':_0x441a('0xbc')}]})[_0x441a('0x39')](function(_0x2bba32){return[_0x2bba32,!![]];});});}else{throw new Error(_0x441a('0xbd'));}})[_0x441a('0xbe')](function(_0x4c681e,_0x51732c){if(_0x51732c){return _0x4c681e;}return db[_0x441a('0xa4')][_0x441a('0x5f')]({'direction':_0x441a('0xba'),'read':![],'body':_0x3549dd['body'][_0x441a('0xac')][0x0]['filename'],'FaxAccountId':_0x1f11ef['id'],'FaxInteractionId':_0x4c681e['id'],'UserId':_0x3549dd[_0x441a('0xb9')]['id'],'ContactId':_0x4c681e[_0x441a('0xbf')],'AttachmentId':_0x3549dd[_0x441a('0x64')][_0x441a('0xac')][0x0]['id']})['then'](function(_0xc8ab50){_0x4c681e[_0x441a('0xc0')][_0x441a('0xbc')]=[];_0x4c681e['dataValues'][_0x441a('0xbc')][_0x441a('0x8e')](_0xc8ab50[_0x441a('0xc0')]);return _0x4c681e;});})[_0x441a('0x39')](function(_0x419111){respondWithRpcPromise(_0x441a('0xc1'),_0x441a('0xc1'),{'FaxAccountId':_[_0x441a('0xb0')](_0x3549dd['params']['id'])?undefined:_0x3549dd[_0x441a('0x5d')]['id'],'path':_[_0x441a('0xb0')](_0x3549dd[_0x441a('0x64')]['attachments'][0x0][_0x441a('0xb1')])?undefined:_0x3549dd[_0x441a('0x64')][_0x441a('0xac')][0x0]['path'],'fax':_['isNil'](_0x3549dd['body']['to'][0x0])?undefined:_0x3549dd[_0x441a('0x64')]['to'][0x0],'AttachmentId':_0x3549dd[_0x441a('0x64')]['attachments'][0x0]['id']},client9002)['then'](function(_0x54641c){logger['info'](_0x441a('0xc2'),_0x54641c);})['catch'](function(_0x27b688){logger['info'](_0x441a('0xc2'),_0x27b688);});return _0x419111;})[_0x441a('0x39')](respondWithResult(_0xae9b4b,null))[_0x441a('0x2a')](handleError(_0xae9b4b,null));};exports[_0x441a('0xc3')]=function(_0x1a18c1,_0x19afd1,_0x1276ab){return db['FaxAccount'][_0x441a('0x61')]({'where':{'id':_0x1a18c1[_0x441a('0x5d')]['id']}})[_0x441a('0x39')](handleEntityNotFound(_0x19afd1,null))[_0x441a('0x39')](function(_0x38615b){if(_0x38615b){return _0x38615b[_0x441a('0xc3')](_0x1a18c1[_0x441a('0x64')][_0x441a('0x71')],_[_0x441a('0x9f')](_0x1a18c1[_0x441a('0x64')],[_0x441a('0x71'),'id'])||{})[_0x441a('0xbe')](function(_0x10a7a2){for(var _0x56e971=0x0;_0x56e971<_0x1a18c1[_0x441a('0x64')][_0x441a('0x71')][_0x441a('0x4e')];_0x56e971+=0x1){socket[_0x441a('0xc4')](_0x441a('0xc5'),{'UserId':Number(_0x1a18c1['body'][_0x441a('0x71')][_0x56e971]),'FaxAccountId':Number(_0x1a18c1['params']['id'])});}return _0x10a7a2;});}})[_0x441a('0x39')](respondWithResult(_0x19afd1,null))[_0x441a('0x2a')](handleError(_0x19afd1,null));};exports[_0x441a('0xc6')]=function(_0x295f45,_0x55a24f,_0x597c6d){return db[_0x441a('0x44')][_0x441a('0x61')]({'where':{'id':_0x295f45[_0x441a('0x5d')]['id']}})['then'](handleEntityNotFound(_0x55a24f,null))[_0x441a('0x39')](function(_0x139616){if(_0x139616){return _0x139616[_0x441a('0xc6')](_0x295f45[_0x441a('0x49')]['ids'])[_0x441a('0x39')](function(){if(_['isArray'](_0x295f45[_0x441a('0x49')]['ids'])){for(var _0x113a29=0x0;_0x113a29<_0x295f45[_0x441a('0x49')][_0x441a('0x71')][_0x441a('0x4e')];_0x113a29+=0x1){socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x295f45['query'][_0x441a('0x71')][_0x113a29]),'FaxAccountId':Number(_0x295f45[_0x441a('0x5d')]['id'])});}}else{socket[_0x441a('0xc4')](_0x441a('0xc7'),{'UserId':Number(_0x295f45[_0x441a('0x49')][_0x441a('0x71')]),'FaxAccountId':Number(_0x295f45['params']['id'])});}});}})['then'](respondWithStatusCode(_0x55a24f,null))[_0x441a('0x2a')](handleError(_0x55a24f,null));};exports[_0x441a('0xc8')]=function(_0x1994f6,_0xb7bbee,_0x378ab0){var _0x139001={};var _0x26babc={};var _0xc7d77;var _0x3ecb39;return db[_0x441a('0x44')][_0x441a('0x67')]({'where':{'id':_0x1994f6[_0x441a('0x5d')]['id']}})[_0x441a('0x39')](handleEntityNotFound(_0xb7bbee,null))['then'](function(_0x2c97ad){if(_0x2c97ad){_0xc7d77=_0x2c97ad;_0x26babc[_0x441a('0x4b')]=_[_0x441a('0x5e')](db[_0x441a('0x75')][_0x441a('0x45')]);_0x26babc[_0x441a('0x49')]=_[_0x441a('0x5e')](_0x1994f6[_0x441a('0x49')]);_0x26babc[_0x441a('0x53')]=_[_0x441a('0x4a')](_0x26babc[_0x441a('0x4b')],_0x26babc[_0x441a('0x49')]);_0x139001[_0x441a('0x4c')]=_['intersection'](_0x26babc['model'],qs['fields'](_0x1994f6['query'][_0x441a('0x4d')]));_0x139001['attributes']=_0x139001[_0x441a('0x4c')]['length']?_0x139001['attributes']:_0x26babc['model'];_0x139001[_0x441a('0x51')]=qs[_0x441a('0x52')](_0x1994f6[_0x441a('0x49')][_0x441a('0x52')]);_0x139001['where']=qs[_0x441a('0x53')](_[_0x441a('0x6e')](_0x1994f6['query'],_0x26babc[_0x441a('0x53')]));if(_0x1994f6['query'][_0x441a('0x54')]){_0x139001[_0x441a('0x55')]=_['merge'](_0x139001[_0x441a('0x55')],{'$or':_[_0x441a('0x43')](_0x139001[_0x441a('0x4c')],function(_0x4a328d){var _0x21cb44={};_0x21cb44[_0x4a328d]={'$like':'%'+_0x1994f6[_0x441a('0x49')][_0x441a('0x54')]+'%'};return _0x21cb44;})});}_0x139001=_[_0x441a('0x56')]({},_0x139001,_0x1994f6['options']);return _0xc7d77[_0x441a('0xc8')](_0x139001);}})[_0x441a('0x39')](function(_0x3b2b12){if(_0x3b2b12){_0x3ecb39=_0x3b2b12['length'];if(!_0x1994f6[_0x441a('0x49')][_0x441a('0x4f')](_0x441a('0x50'))){_0x139001[_0x441a('0x31')]=qs['limit'](_0x1994f6['query'][_0x441a('0x31')]);_0x139001[_0x441a('0x30')]=qs[_0x441a('0x30')](_0x1994f6['query']['offset']);}return _0xc7d77[_0x441a('0xc8')](_0x139001);}})[_0x441a('0x39')](function(_0x2a7304){if(_0x2a7304){return _0x2a7304?{'count':_0x3ecb39,'rows':_0x2a7304}:null;}})['then'](respondWithResult(_0xb7bbee,null))[_0x441a('0x2a')](handleError(_0xb7bbee,null));};
\ No newline at end of file
+var _0xb736=['from-voip-provider','app','system','description','Fax\x20Extension','push','Set','ecm','localstationid','faxdetect','maxrate','minrate','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','updateAccountApplications','VoiceExtension','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','DESC','attachments','join','basename','CheckAfterSend','isNil','from','fax','Contacts','ListId','Send\x20Fax\x20failed','out','filename','Messages','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','User','getAgents','rimraf','zip-dir','request-promise','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','count','Content-Range','apply','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','show','params','rawAttributes','length','include','find','create','body','user','role','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','order','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','Owner','fullname','internal','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xb736,0x1c0));var _0x6b73=function(_0xd3ccaf,_0xf14925){_0xd3ccaf=_0xd3ccaf-0x0;var _0x430972=_0xb736[_0xd3ccaf];return _0x430972;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b73('0x0'));var zipdir=require(_0x6b73('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b73('0x2'));var moment=require('moment');var BPromise=require(_0x6b73('0x3'));var Mustache=require(_0x6b73('0x4'));var util=require(_0x6b73('0x5'));var path=require(_0x6b73('0x6'));var sox=require(_0x6b73('0x7'));var csv=require(_0x6b73('0x8'));var ejs=require(_0x6b73('0x9'));var fs=require('fs');var fs_extra=require(_0x6b73('0xa'));var _=require(_0x6b73('0xb'));var squel=require(_0x6b73('0xc'));var crypto=require(_0x6b73('0xd'));var jsforce=require(_0x6b73('0xe'));var deskjs=require(_0x6b73('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6b73('0x10'));var Redis=require(_0x6b73('0x11'));var authService=require(_0x6b73('0x12'));var qs=require(_0x6b73('0x13'));var as=require(_0x6b73('0x14'));var hardwareService=require(_0x6b73('0x15'));var logger=require(_0x6b73('0x16'))(_0x6b73('0x17'));var utils=require(_0x6b73('0x18'));var config=require(_0x6b73('0x19'));var licenseUtil=require(_0x6b73('0x1a'));var db=require(_0x6b73('0x1b'))['db'];config[_0x6b73('0x1c')]=_[_0x6b73('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6b73('0x1e'))(new Redis(config['redis']));require(_0x6b73('0x1f'))[_0x6b73('0x20')](socket);var jayson=require(_0x6b73('0x21'));var client=jayson[_0x6b73('0x22')]['http']({'port':0x232c});var client9002=jayson[_0x6b73('0x22')][_0x6b73('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x1ac631,_0x51155d,_0x285003,_0x163f12){return new BPromise(function(_0x57b750,_0x1a82f6){var _0x2643b5=_0x163f12||client;return _0x2643b5[_0x6b73('0x24')](_0x1ac631,_0x285003)[_0x6b73('0x25')](function(_0x1bf4a3){logger[_0x6b73('0x26')](_0x6b73('0x27'),_0x51155d,'request\x20sent');logger[_0x6b73('0x28')](_0x6b73('0x29'),_0x51155d,_0x6b73('0x2a'),JSON['stringify'](_0x1bf4a3));if(_0x1bf4a3[_0x6b73('0x2b')]){if(_0x1bf4a3['error'][_0x6b73('0x2c')]===0x1f4){logger[_0x6b73('0x2b')]('FaxAccount,\x20%s,\x20%s',_0x51155d,_0x1bf4a3[_0x6b73('0x2b')][_0x6b73('0x2d')]);return _0x1a82f6(_0x1bf4a3[_0x6b73('0x2b')][_0x6b73('0x2d')]);}logger['error'](_0x6b73('0x27'),_0x51155d,_0x1bf4a3[_0x6b73('0x2b')][_0x6b73('0x2d')]);return _0x57b750(_0x1bf4a3[_0x6b73('0x2b')][_0x6b73('0x2d')]);}else{logger['info'](_0x6b73('0x27'),_0x51155d,_0x6b73('0x2a'));_0x57b750(_0x1bf4a3[_0x6b73('0x2e')]['message']);}})[_0x6b73('0x2f')](function(_0x18ec74){logger[_0x6b73('0x2b')](_0x6b73('0x27'),_0x51155d,_0x18ec74);_0x1a82f6(_0x18ec74);});});}function respondWithStatusCode(_0x4be73f,_0x5d40d5){_0x5d40d5=_0x5d40d5||0xcc;return function(_0x3e96dd){if(_0x3e96dd){return _0x4be73f[_0x6b73('0x30')](_0x5d40d5);}return _0x4be73f['status'](_0x5d40d5)[_0x6b73('0x31')]();};}function respondWithResult(_0xb7b47a,_0x1609fe){_0x1609fe=_0x1609fe||0xc8;return function(_0x5a19b3){if(_0x5a19b3){return _0xb7b47a[_0x6b73('0x32')](_0x1609fe)[_0x6b73('0x33')](_0x5a19b3);}};}function respondWithFilteredResult(_0x25e3c1,_0x4de509){return function(_0xbad0a1){if(_0xbad0a1){var _0x52841c=typeof _0x4de509[_0x6b73('0x34')]==='undefined'&&typeof _0x4de509[_0x6b73('0x35')]==='undefined';var _0x1346c9=_0xbad0a1['count'];var _0xe0d87b=_0x52841c?0x0:_0x4de509[_0x6b73('0x34')];var _0x1c4e40=_0x52841c?_0xbad0a1[_0x6b73('0x36')]:_0x4de509['offset']+_0x4de509['limit'];var _0x45de5d;if(_0x1c4e40>=_0x1346c9){_0x1c4e40=_0x1346c9;_0x45de5d=0xc8;}else{_0x45de5d=0xce;}_0x25e3c1[_0x6b73('0x32')](_0x45de5d);return _0x25e3c1['set'](_0x6b73('0x37'),_0xe0d87b+'-'+_0x1c4e40+'/'+_0x1346c9)[_0x6b73('0x33')](_0xbad0a1);}return null;};}function patchUpdates(_0x3be624){return function(_0x2c0fd4){try{jsonpatch[_0x6b73('0x38')](_0x2c0fd4,_0x3be624,!![]);}catch(_0x55b6b8){return BPromise['reject'](_0x55b6b8);}return _0x2c0fd4[_0x6b73('0x39')]();};}function saveUpdates(_0x6ef204,_0x283d69){return function(_0x1eab32){if(_0x1eab32){return _0x1eab32[_0x6b73('0x3a')](_0x6ef204)['then'](function(_0x56a1f4){return _0x56a1f4;});}return null;};}function removeEntity(_0x12fd1c,_0x20cd19){return function(_0x8abde8){if(_0x8abde8){return _0x8abde8[_0x6b73('0x3b')]()[_0x6b73('0x25')](function(){var _0x2070ae=_0x8abde8[_0x6b73('0x3c')]({'plain':!![]});var _0x5f44da='FaxAccounts';return db[_0x6b73('0x3d')][_0x6b73('0x3b')]({'where':{'type':_0x5f44da,'resourceId':_0x2070ae['id']}})[_0x6b73('0x25')](function(){return _0x8abde8;});})[_0x6b73('0x25')](function(){_0x12fd1c[_0x6b73('0x32')](0xcc)[_0x6b73('0x31')]();});}};}function handleEntityNotFound(_0x320f0,_0x5c85f9){return function(_0x11aeb8){if(!_0x11aeb8){_0x320f0['sendStatus'](0x194);}return _0x11aeb8;};}function handleError(_0x526efc,_0x5ea0f1){_0x5ea0f1=_0x5ea0f1||0x1f4;return function(_0x5bcefb){logger[_0x6b73('0x2b')](_0x5bcefb[_0x6b73('0x3e')]);if(_0x5bcefb[_0x6b73('0x3f')]){delete _0x5bcefb['name'];}_0x526efc['status'](_0x5ea0f1)[_0x6b73('0x40')](_0x5bcefb);};}exports[_0x6b73('0x41')]=function(_0x4db15d,_0x5eba7d){var _0x17ddb6={'include':[{'model':db[_0x6b73('0x42')],'as':_0x6b73('0x43')}]},_0x45c913={},_0xee09ec={'count':0x0,'rows':[]};var _0x2aaa37=_[_0x6b73('0x44')](db[_0x6b73('0x45')]['rawAttributes'],function(_0xc0ed2a){return{'name':_0xc0ed2a['fieldName'],'type':_0xc0ed2a['type'][_0x6b73('0x46')]};});_0x45c913['model']=_[_0x6b73('0x44')](_0x2aaa37,_0x6b73('0x3f'));_0x45c913[_0x6b73('0x47')]=_[_0x6b73('0x48')](_0x4db15d[_0x6b73('0x47')]);_0x45c913[_0x6b73('0x49')]=_[_0x6b73('0x4a')](_0x45c913[_0x6b73('0x4b')],_0x45c913['query']);_0x17ddb6['attributes']=_[_0x6b73('0x4a')](_0x45c913[_0x6b73('0x4b')],qs[_0x6b73('0x4c')](_0x4db15d[_0x6b73('0x47')]['fields']));_0x17ddb6[_0x6b73('0x4d')]=_0x17ddb6[_0x6b73('0x4d')]['length']?_0x17ddb6[_0x6b73('0x4d')]:_0x45c913[_0x6b73('0x4b')];if(!_0x4db15d['query'][_0x6b73('0x4e')](_0x6b73('0x4f'))){_0x17ddb6['limit']=qs[_0x6b73('0x35')](_0x4db15d[_0x6b73('0x47')][_0x6b73('0x35')]);_0x17ddb6[_0x6b73('0x34')]=qs[_0x6b73('0x34')](_0x4db15d[_0x6b73('0x47')][_0x6b73('0x34')]);}_0x17ddb6['order']=qs[_0x6b73('0x50')](_0x4db15d[_0x6b73('0x47')][_0x6b73('0x50')]);_0x17ddb6[_0x6b73('0x51')]=qs[_0x6b73('0x49')](_[_0x6b73('0x52')](_0x4db15d['query'],_0x45c913['filters']),_0x2aaa37);if(_0x4db15d['query'][_0x6b73('0x53')]){_0x17ddb6['where']=_[_0x6b73('0x54')](_0x17ddb6[_0x6b73('0x51')],{'$or':_[_0x6b73('0x44')](_0x2aaa37,function(_0x245d18){if(_0x245d18[_0x6b73('0x55')]!==_0x6b73('0x56')){var _0x26c49c={};_0x26c49c[_0x245d18[_0x6b73('0x3f')]]={'$like':'%'+_0x4db15d[_0x6b73('0x47')]['filter']+'%'};return _0x26c49c;}})});}_0x17ddb6=_[_0x6b73('0x54')]({},_0x17ddb6,_0x4db15d[_0x6b73('0x57')]);var _0x35381b={'where':_0x17ddb6[_0x6b73('0x51')]};return db[_0x6b73('0x45')][_0x6b73('0x36')](_0x35381b)[_0x6b73('0x25')](function(_0x42d1a6){_0xee09ec[_0x6b73('0x36')]=_0x42d1a6;if(_0x4db15d['query'][_0x6b73('0x58')]){_0x17ddb6['include']=[{'all':!![]}];}return db[_0x6b73('0x45')][_0x6b73('0x59')](_0x17ddb6);})[_0x6b73('0x25')](function(_0x2cc933){_0xee09ec['rows']=_0x2cc933;return _0xee09ec;})[_0x6b73('0x25')](respondWithFilteredResult(_0x5eba7d,_0x17ddb6))[_0x6b73('0x2f')](handleError(_0x5eba7d,null));};exports[_0x6b73('0x5a')]=function(_0x480d09,_0x253e77){var _0x291a17={'raw':![],'where':{'id':_0x480d09[_0x6b73('0x5b')]['id']},'include':[{'model':db[_0x6b73('0x42')],'as':_0x6b73('0x43')}]},_0x267657={};_0x267657[_0x6b73('0x4b')]=_['keys'](db[_0x6b73('0x45')][_0x6b73('0x5c')]);_0x267657['query']=_[_0x6b73('0x48')](_0x480d09[_0x6b73('0x47')]);_0x267657[_0x6b73('0x49')]=_['intersection'](_0x267657[_0x6b73('0x4b')],_0x267657['query']);_0x291a17[_0x6b73('0x4d')]=_['intersection'](_0x267657[_0x6b73('0x4b')],qs[_0x6b73('0x4c')](_0x480d09['query'][_0x6b73('0x4c')]));_0x291a17['attributes']=_0x291a17[_0x6b73('0x4d')][_0x6b73('0x5d')]?_0x291a17[_0x6b73('0x4d')]:_0x267657[_0x6b73('0x4b')];if(_0x480d09[_0x6b73('0x47')][_0x6b73('0x58')]){_0x291a17[_0x6b73('0x5e')]=[{'all':!![]}];}_0x291a17=_['merge']({},_0x291a17,_0x480d09[_0x6b73('0x57')]);return db['FaxAccount'][_0x6b73('0x5f')](_0x291a17)[_0x6b73('0x25')](handleEntityNotFound(_0x253e77,null))[_0x6b73('0x25')](respondWithResult(_0x253e77,null))[_0x6b73('0x2f')](handleError(_0x253e77,null));};exports[_0x6b73('0x60')]=function(_0x36b5a6,_0x38f920){return db[_0x6b73('0x45')]['create'](_0x36b5a6[_0x6b73('0x61')],{})[_0x6b73('0x25')](function(_0x898096){var _0x4bbe65=_0x36b5a6[_0x6b73('0x62')][_0x6b73('0x3c')]({'plain':!![]});if(!_0x4bbe65)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bbe65[_0x6b73('0x63')]===_0x6b73('0x62')){var _0x5d5249=_0x898096[_0x6b73('0x3c')]({'plain':!![]});var _0x3a713a=_0x6b73('0x64');return db[_0x6b73('0x65')]['find']({'where':{'name':_0x3a713a,'userProfileId':_0x4bbe65[_0x6b73('0x66')]},'raw':!![]})[_0x6b73('0x25')](function(_0x290098){if(_0x290098&&_0x290098[_0x6b73('0x67')]===0x0){return db['UserProfileResource'][_0x6b73('0x60')]({'name':_0x5d5249['name'],'resourceId':_0x5d5249['id'],'type':_0x290098['name'],'sectionId':_0x290098['id']},{})[_0x6b73('0x25')](function(){return _0x898096;});}else{return _0x898096;}})['catch'](function(_0x4b33a0){logger[_0x6b73('0x2b')](_0x6b73('0x68'),_0x4b33a0);throw _0x4b33a0;});}return _0x898096;})['then'](respondWithResult(_0x38f920,0xc9))[_0x6b73('0x2f')](handleError(_0x38f920,null));};exports[_0x6b73('0x3a')]=function(_0x51936f,_0x1d192b){if(_0x51936f[_0x6b73('0x61')]['id']){delete _0x51936f['body']['id'];}return db[_0x6b73('0x45')][_0x6b73('0x5f')]({'where':{'id':_0x51936f[_0x6b73('0x5b')]['id']},'include':[{'model':db[_0x6b73('0x42')],'as':_0x6b73('0x43')}]})[_0x6b73('0x25')](handleEntityNotFound(_0x1d192b,null))['then'](saveUpdates(_0x51936f['body'],null))[_0x6b73('0x25')](respondWithResult(_0x1d192b,null))['catch'](handleError(_0x1d192b,null));};exports[_0x6b73('0x3b')]=function(_0x50067f,_0x198d90){return db[_0x6b73('0x45')][_0x6b73('0x5f')]({'where':{'id':_0x50067f['params']['id']}})[_0x6b73('0x25')](handleEntityNotFound(_0x198d90,null))['then'](removeEntity(_0x198d90,null))[_0x6b73('0x2f')](handleError(_0x198d90,null));};exports[_0x6b73('0x69')]=function(_0x2aa326,_0x228b32){return db[_0x6b73('0x45')]['describe']()[_0x6b73('0x25')](respondWithResult(_0x228b32,null))[_0x6b73('0x2f')](handleError(_0x228b32,null));};exports[_0x6b73('0x6a')]=function(_0x1bb0fb,_0x164458,_0x1c6574){if(_0x1bb0fb[_0x6b73('0x61')]['id']){delete _0x1bb0fb[_0x6b73('0x61')]['id'];}return db[_0x6b73('0x45')][_0x6b73('0x5f')]({'where':{'id':_0x1bb0fb[_0x6b73('0x5b')]['id']}})[_0x6b73('0x25')](handleEntityNotFound(_0x164458,null))['then'](function(_0x125956){if(_0x125956){_0x1bb0fb['body'][_0x6b73('0x6b')]=_0x125956['id'];return db['Disposition'][_0x6b73('0x60')](_0x1bb0fb[_0x6b73('0x61')]);}})[_0x6b73('0x25')](respondWithResult(_0x164458,null))[_0x6b73('0x2f')](handleError(_0x164458,null));};exports['getDispositions']=function(_0x1697d2,_0x19c6ad,_0x17088c){var _0x64086b={'raw':![],'where':{}};var _0x47975c={};var _0x359a55={'count':0x0,'rows':[]};return db[_0x6b73('0x45')]['findOne']({'where':{'id':_0x1697d2[_0x6b73('0x5b')]['id']}})[_0x6b73('0x25')](handleEntityNotFound(_0x19c6ad,null))[_0x6b73('0x25')](function(_0xca1539){if(_0xca1539){_0x47975c[_0x6b73('0x4b')]=_[_0x6b73('0x48')](db[_0x6b73('0x6c')]['rawAttributes']);_0x47975c[_0x6b73('0x47')]=_[_0x6b73('0x48')](_0x1697d2[_0x6b73('0x47')]);_0x47975c['filters']=_[_0x6b73('0x4a')](_0x47975c[_0x6b73('0x4b')],_0x47975c[_0x6b73('0x47')]);_0x64086b['attributes']=_[_0x6b73('0x4a')](_0x47975c[_0x6b73('0x4b')],qs[_0x6b73('0x4c')](_0x1697d2[_0x6b73('0x47')]['fields']));_0x64086b[_0x6b73('0x4d')]=_0x64086b[_0x6b73('0x4d')][_0x6b73('0x5d')]?_0x64086b[_0x6b73('0x4d')]:_0x47975c[_0x6b73('0x4b')];if(!_0x1697d2['query'][_0x6b73('0x4e')](_0x6b73('0x4f'))){_0x64086b[_0x6b73('0x35')]=qs[_0x6b73('0x35')](_0x1697d2['query']['limit']);_0x64086b['offset']=qs[_0x6b73('0x34')](_0x1697d2[_0x6b73('0x47')][_0x6b73('0x34')]);}_0x64086b['order']=qs[_0x6b73('0x50')](_0x1697d2[_0x6b73('0x47')][_0x6b73('0x50')]);_0x64086b[_0x6b73('0x51')]=qs[_0x6b73('0x49')](_[_0x6b73('0x52')](_0x1697d2[_0x6b73('0x47')],_0x47975c[_0x6b73('0x49')]));_0x64086b[_0x6b73('0x51')]['FaxAccountId']=_0xca1539['id'];if(_0x1697d2['query'][_0x6b73('0x53')]){_0x64086b[_0x6b73('0x51')]=_[_0x6b73('0x54')](_0x64086b[_0x6b73('0x51')],{'$or':_['map'](_0x64086b[_0x6b73('0x4d')],function(_0x1638d2){var _0x56d7be={};_0x56d7be[_0x1638d2]={'$like':'%'+_0x1697d2[_0x6b73('0x47')]['filter']+'%'};return _0x56d7be;})});}_0x64086b=_['merge']({},_0x64086b,_0x1697d2[_0x6b73('0x57')]);return db[_0x6b73('0x6c')][_0x6b73('0x36')]({'where':_0x64086b[_0x6b73('0x51')]})['then'](function(_0x2aa90b){_0x359a55['count']=_0x2aa90b;if(_0x1697d2[_0x6b73('0x47')][_0x6b73('0x58')]){_0x64086b[_0x6b73('0x5e')]=[{'all':!![]}];}return db[_0x6b73('0x6c')][_0x6b73('0x59')](_0x64086b);})['then'](function(_0x411966){_0x359a55[_0x6b73('0x6d')]=_0x411966;return _0x359a55;});}})[_0x6b73('0x25')](respondWithFilteredResult(_0x19c6ad,_0x64086b))[_0x6b73('0x2f')](handleError(_0x19c6ad,null));};exports['removeDispositions']=function(_0x8f36ce,_0x486da5,_0x123a34){return db[_0x6b73('0x45')][_0x6b73('0x5f')]({'where':{'id':_0x8f36ce[_0x6b73('0x5b')]['id']}})['then'](handleEntityNotFound(_0x486da5,null))['then'](function(_0x54d22a){if(_0x54d22a){return _0x54d22a[_0x6b73('0x6e')](_0x8f36ce['query']['ids']);}})[_0x6b73('0x25')](respondWithStatusCode(_0x486da5,null))[_0x6b73('0x2f')](handleError(_0x486da5,null));};exports[_0x6b73('0x6f')]=function(_0xa560a2,_0x5c8d31,_0x533578){if(_0xa560a2[_0x6b73('0x61')]['id']){delete _0xa560a2[_0x6b73('0x61')]['id'];}return db[_0x6b73('0x45')][_0x6b73('0x5f')]({'where':{'id':_0xa560a2[_0x6b73('0x5b')]['id']}})[_0x6b73('0x25')](handleEntityNotFound(_0x5c8d31,null))[_0x6b73('0x25')](function(_0x1cfef4){if(_0x1cfef4){_0xa560a2['body']['FaxAccountId']=_0x1cfef4['id'];return db[_0x6b73('0x70')][_0x6b73('0x60')](_0xa560a2[_0x6b73('0x61')]);}})[_0x6b73('0x25')](respondWithResult(_0x5c8d31,null))[_0x6b73('0x2f')](handleError(_0x5c8d31,null));};exports[_0x6b73('0x71')]=function(_0x580b20,_0xd30f37,_0x4a99fa){var _0x1ab87d={'raw':![],'where':{}};var _0x3a6130={};var _0x70851f={'count':0x0,'rows':[]};return db['FaxAccount'][_0x6b73('0x72')]({'where':{'id':_0x580b20[_0x6b73('0x5b')]['id']}})[_0x6b73('0x25')](handleEntityNotFound(_0xd30f37,null))[_0x6b73('0x25')](function(_0x41c0c4){if(_0x41c0c4){_0x3a6130[_0x6b73('0x4b')]=_['keys'](db[_0x6b73('0x70')]['rawAttributes']);_0x3a6130[_0x6b73('0x47')]=_[_0x6b73('0x48')](_0x580b20[_0x6b73('0x47')]);_0x3a6130[_0x6b73('0x49')]=_['intersection'](_0x3a6130['model'],_0x3a6130['query']);_0x1ab87d[_0x6b73('0x4d')]=_[_0x6b73('0x4a')](_0x3a6130['model'],qs['fields'](_0x580b20[_0x6b73('0x47')][_0x6b73('0x4c')]));_0x1ab87d[_0x6b73('0x4d')]=_0x1ab87d['attributes']['length']?_0x1ab87d[_0x6b73('0x4d')]:_0x3a6130[_0x6b73('0x4b')];if(!_0x580b20[_0x6b73('0x47')]['hasOwnProperty']('nolimit')){_0x1ab87d[_0x6b73('0x35')]=qs[_0x6b73('0x35')](_0x580b20[_0x6b73('0x47')][_0x6b73('0x35')]);_0x1ab87d[_0x6b73('0x34')]=qs[_0x6b73('0x34')](_0x580b20[_0x6b73('0x47')][_0x6b73('0x34')]);}_0x1ab87d[_0x6b73('0x73')]=qs[_0x6b73('0x50')](_0x580b20['query'][_0x6b73('0x50')]);_0x1ab87d[_0x6b73('0x51')]=qs[_0x6b73('0x49')](_[_0x6b73('0x52')](_0x580b20[_0x6b73('0x47')],_0x3a6130['filters']));_0x1ab87d['where'][_0x6b73('0x6b')]=_0x41c0c4['id'];if(_0x580b20[_0x6b73('0x47')][_0x6b73('0x53')]){_0x1ab87d['where']=_[_0x6b73('0x54')](_0x1ab87d[_0x6b73('0x51')],{'$or':_[_0x6b73('0x44')](_0x1ab87d[_0x6b73('0x4d')],function(_0x3a322f){var _0x42d628={};_0x42d628[_0x3a322f]={'$like':'%'+_0x580b20[_0x6b73('0x47')][_0x6b73('0x53')]+'%'};return _0x42d628;})});}_0x1ab87d=_[_0x6b73('0x54')]({},_0x1ab87d,_0x580b20[_0x6b73('0x57')]);return db[_0x6b73('0x70')][_0x6b73('0x36')]({'where':_0x1ab87d[_0x6b73('0x51')]})[_0x6b73('0x25')](function(_0x4b6c15){_0x70851f[_0x6b73('0x36')]=_0x4b6c15;if(_0x580b20[_0x6b73('0x47')][_0x6b73('0x58')]){_0x1ab87d[_0x6b73('0x5e')]=[{'all':!![]}];}return db[_0x6b73('0x70')][_0x6b73('0x59')](_0x1ab87d);})[_0x6b73('0x25')](function(_0x423e44){_0x70851f[_0x6b73('0x6d')]=_0x423e44;return _0x70851f;});}})['then'](respondWithFilteredResult(_0xd30f37,_0x1ab87d))[_0x6b73('0x2f')](handleError(_0xd30f37,null));};exports[_0x6b73('0x74')]=function(_0x32ffde,_0x5a43d3,_0x56df80){return db[_0x6b73('0x45')][_0x6b73('0x5f')]({'where':{'id':_0x32ffde[_0x6b73('0x5b')]['id']}})[_0x6b73('0x25')](handleEntityNotFound(_0x5a43d3,null))[_0x6b73('0x25')](function(_0x1f2091){if(_0x1f2091){return _0x1f2091[_0x6b73('0x74')](_0x32ffde['query'][_0x6b73('0x75')]);}})[_0x6b73('0x25')](respondWithStatusCode(_0x5a43d3,null))[_0x6b73('0x2f')](handleError(_0x5a43d3,null));};exports[_0x6b73('0x76')]=function(_0x4f83c1,_0x587243,_0x5df639){return db[_0x6b73('0x77')][_0x6b73('0x5f')]({'where':{'id':_0x4f83c1[_0x6b73('0x5b')]['id']}})[_0x6b73('0x25')](handleEntityNotFound(_0x587243,null))[_0x6b73('0x25')](function(_0x568a65){if(_0x568a65){return _0x568a65[_0x6b73('0x76')](_0x4f83c1[_0x6b73('0x61')]['ids'],_[_0x6b73('0x78')](_0x4f83c1['body'],['ids','id'])||{});}})[_0x6b73('0x25')](respondWithResult(_0x587243,null))[_0x6b73('0x2f')](handleError(_0x587243,null));};exports[_0x6b73('0x79')]=function(_0x155cfa,_0x32d77d,_0x2c1b4e){var _0x1ff2d0={'raw':![],'where':{}};var _0x367d81={};var _0x2840a7={'count':0x0,'rows':[]};return db[_0x6b73('0x45')][_0x6b73('0x72')]({'where':{'id':_0x155cfa['params']['id']}})[_0x6b73('0x25')](handleEntityNotFound(_0x32d77d,null))[_0x6b73('0x25')](function(_0x1cc24a){if(_0x1cc24a){_0x367d81[_0x6b73('0x4b')]=_['keys'](db['FaxInteraction'][_0x6b73('0x5c')]);_0x367d81['query']=_[_0x6b73('0x48')](_0x155cfa['query']);_0x367d81[_0x6b73('0x49')]=_[_0x6b73('0x4a')](_0x367d81[_0x6b73('0x4b')],_0x367d81[_0x6b73('0x47')]);_0x1ff2d0[_0x6b73('0x4d')]=_[_0x6b73('0x4a')](_0x367d81[_0x6b73('0x4b')],qs[_0x6b73('0x4c')](_0x155cfa[_0x6b73('0x47')][_0x6b73('0x4c')]));_0x1ff2d0[_0x6b73('0x4d')]=_0x1ff2d0[_0x6b73('0x4d')][_0x6b73('0x5d')]?_0x1ff2d0[_0x6b73('0x4d')]:_0x367d81[_0x6b73('0x4b')];if(!_0x155cfa[_0x6b73('0x47')]['hasOwnProperty'](_0x6b73('0x4f'))){_0x1ff2d0[_0x6b73('0x35')]=qs[_0x6b73('0x35')](_0x155cfa[_0x6b73('0x47')][_0x6b73('0x35')]);_0x1ff2d0[_0x6b73('0x34')]=qs[_0x6b73('0x34')](_0x155cfa[_0x6b73('0x47')][_0x6b73('0x34')]);}_0x1ff2d0[_0x6b73('0x73')]=qs[_0x6b73('0x50')](_0x155cfa[_0x6b73('0x47')][_0x6b73('0x50')]);_0x1ff2d0[_0x6b73('0x51')]=qs[_0x6b73('0x49')](_['pick'](_0x155cfa['query'],_0x367d81[_0x6b73('0x49')]));_0x1ff2d0[_0x6b73('0x51')]['FaxAccountId']=_0x1cc24a['id'];if(_0x155cfa[_0x6b73('0x47')][_0x6b73('0x53')]){_0x1ff2d0['where']=_[_0x6b73('0x54')](_0x1ff2d0[_0x6b73('0x51')],{'$or':_[_0x6b73('0x44')](_0x1ff2d0[_0x6b73('0x4d')],function(_0xf969f7){var _0x4973c4={};_0x4973c4[_0xf969f7]={'$like':'%'+_0x155cfa[_0x6b73('0x47')][_0x6b73('0x53')]+'%'};return _0x4973c4;})});}_0x1ff2d0=_[_0x6b73('0x54')]({},_0x1ff2d0,_0x155cfa[_0x6b73('0x57')]);return db[_0x6b73('0x77')][_0x6b73('0x36')]({'where':_0x1ff2d0['where']})['then'](function(_0x2d6236){_0x2840a7[_0x6b73('0x36')]=_0x2d6236;if(_0x155cfa[_0x6b73('0x47')][_0x6b73('0x58')]){_0x1ff2d0[_0x6b73('0x5e')]=[{'model':db[_0x6b73('0x7a')],'as':_0x6b73('0x7b'),'required':![]},{'model':db['User'],'as':_0x6b73('0x7c'),'attributes':[_0x6b73('0x3f'),_0x6b73('0x7d'),_0x6b73('0x7e')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x6b73('0x7f')],'where':_0x155cfa['query'][_0x6b73('0x80')]?{'id':_0x155cfa[_0x6b73('0x47')][_0x6b73('0x80')]}:undefined,'required':_0x155cfa[_0x6b73('0x47')][_0x6b73('0x80')]?!![]:![]}];}return db[_0x6b73('0x77')]['findAll'](_0x1ff2d0);})[_0x6b73('0x25')](function(_0x2befc8){_0x2840a7[_0x6b73('0x6d')]=_0x2befc8;return _0x2840a7;});}})[_0x6b73('0x25')](respondWithFilteredResult(_0x32d77d,_0x1ff2d0))[_0x6b73('0x2f')](handleError(_0x32d77d,null));};exports[_0x6b73('0x81')]=function(_0x2b345e,_0x5f4062){var _0x58b213=_0x2b345e['params']['id'];var _0x513f57=_0x2b345e[_0x6b73('0x61')];var _0x5dac05=0xc8;var _0x3459ef=null;return db[_0x6b73('0x82')][_0x6b73('0x83')]({'isolationLevel':db['sequelize']['Transaction'][_0x6b73('0x84')][_0x6b73('0x85')]},function(_0x589680){return db['FaxAccount'][_0x6b73('0x72')]({'where':{'id':_0x58b213},'transaction':_0x589680})[_0x6b73('0x25')](function(_0x275d88){if(_0x275d88){return db[_0x6b73('0x86')]['destroy']({'where':{'FaxAccountId':_0x58b213},'transaction':_0x589680})[_0x6b73('0x25')](function(){var _0x22fb90=_[_0x6b73('0x44')](_0x513f57,function(_0x158b6f){_0x158b6f[_0x6b73('0x6b')]=_0x58b213;return _0x158b6f;});return db[_0x6b73('0x86')][_0x6b73('0x87')](_0x22fb90,{'transaction':_0x589680});});}else{_0x5dac05=0x194;_0x3459ef=[];}});})[_0x6b73('0x25')](function(){if(_0x5dac05!==0x194){return db[_0x6b73('0x86')][_0x6b73('0x88')]({'where':{'FaxAccountId':_0x58b213},'order':_0x6b73('0x89')})['then'](function(_0xcf8ae0){_0x3459ef=_0xcf8ae0;});}})[_0x6b73('0x2f')](function(_0x3df972){_0x5dac05=0x1f4;logger['error'](_0x3df972[_0x6b73('0x3e')]);if(_0x3df972[_0x6b73('0x3f')]){delete _0x3df972[_0x6b73('0x3f')];}_0x3459ef=_0x3df972;})[_0x6b73('0x8a')](function(){if(_0x3459ef===null){_0x5f4062[_0x6b73('0x30')](_0x5dac05);}else{if(_0x5dac05===0x1f4){_0x5f4062['status'](_0x5dac05)['send'](_0x3459ef);}else{_0x5f4062['status'](_0x5dac05)['json'](_0x3459ef);}}});};exports['getApplications']=function(_0x2617a7,_0x5c1bc3,_0x32ef5e){var _0xa7dd03={};var _0x8325a0={};var _0x223bc4;var _0x1dfaf8;return db[_0x6b73('0x45')]['findOne']({'where':{'id':_0x2617a7[_0x6b73('0x5b')]['id']}})[_0x6b73('0x25')](handleEntityNotFound(_0x5c1bc3,null))[_0x6b73('0x25')](function(_0xf8aeb8){if(_0xf8aeb8){_0x223bc4=_0xf8aeb8;_0x8325a0['model']=_[_0x6b73('0x48')](db[_0x6b73('0x86')][_0x6b73('0x5c')]);_0x8325a0[_0x6b73('0x47')]=_[_0x6b73('0x48')](_0x2617a7[_0x6b73('0x47')]);_0x8325a0[_0x6b73('0x49')]=_[_0x6b73('0x4a')](_0x8325a0[_0x6b73('0x4b')],_0x8325a0['query']);_0xa7dd03['attributes']=_[_0x6b73('0x4a')](_0x8325a0['model'],qs['fields'](_0x2617a7['query'][_0x6b73('0x4c')]));_0xa7dd03[_0x6b73('0x4d')]=_0xa7dd03[_0x6b73('0x4d')][_0x6b73('0x5d')]?_0xa7dd03[_0x6b73('0x4d')]:_0x8325a0[_0x6b73('0x4b')];_0xa7dd03['order']=qs[_0x6b73('0x50')](_0x2617a7[_0x6b73('0x47')][_0x6b73('0x50')]);_0xa7dd03[_0x6b73('0x51')]=qs[_0x6b73('0x49')](_['pick'](_0x2617a7['query'],_0x8325a0['filters']));if(_0x2617a7[_0x6b73('0x47')]['filter']){_0xa7dd03[_0x6b73('0x51')]=_[_0x6b73('0x54')](_0xa7dd03['where'],{'$or':_[_0x6b73('0x44')](_0xa7dd03[_0x6b73('0x4d')],function(_0xa85416){var _0x38388a={};_0x38388a[_0xa85416]={'$like':'%'+_0x2617a7[_0x6b73('0x47')][_0x6b73('0x53')]+'%'};return _0x38388a;})});}_0xa7dd03=_[_0x6b73('0x54')]({},_0xa7dd03,_0x2617a7[_0x6b73('0x57')]);return _0x223bc4[_0x6b73('0x8b')](_0xa7dd03);}})[_0x6b73('0x25')](function(_0x4372e7){if(_0x4372e7){_0x1dfaf8=_0x4372e7[_0x6b73('0x5d')];if(!_0x2617a7[_0x6b73('0x47')][_0x6b73('0x4e')]('nolimit')){_0xa7dd03[_0x6b73('0x35')]=qs['limit'](_0x2617a7['query'][_0x6b73('0x35')]);_0xa7dd03[_0x6b73('0x34')]=qs[_0x6b73('0x34')](_0x2617a7[_0x6b73('0x47')][_0x6b73('0x34')]);}return _0x223bc4[_0x6b73('0x8b')](_0xa7dd03);}})[_0x6b73('0x25')](function(_0x124319){if(_0x124319){return _0x124319?{'count':_0x1dfaf8,'rows':_0x124319}:null;}})[_0x6b73('0x25')](respondWithResult(_0x5c1bc3,null))[_0x6b73('0x2f')](handleError(_0x5c1bc3,null));};function Extension(_0x1f5626,_0x3cf68c,_0x31de60,_0x221e73){this['context']=_0x6b73('0x8c');this['exten']=_0x1f5626['localstationid'];this[_0x6b73('0x8d')]=_0x221e73;this[_0x6b73('0x55')]=_0x6b73('0x8e');this[_0x6b73('0x8f')]=_0x6b73('0x90');this[_0x6b73('0x6b')]=_0x1f5626['id'];this['priority']=_0x3cf68c;this['appdata']=_0x31de60;}function createExtensionsReciveFax(_0x4d6f1b){var _0x5de784=0x1;var _0x1b2460=[];_0x1b2460[_0x6b73('0x91')](new Extension(_0x4d6f1b,_0x5de784,'','Answer'));_0x5de784+=0x1;_0x1b2460[_0x6b73('0x91')](new Extension(_0x4d6f1b,_0x5de784,'CDR(type)=inbound-fax',_0x6b73('0x92')));_0x5de784+=0x1;for(var _0xd04735 in _0x4d6f1b){if(_0x4d6f1b['hasOwnProperty'](_0xd04735)&&(_0xd04735===_0x6b73('0x93')||_0xd04735===_0x6b73('0x94')||_0xd04735==='gateway'||_0xd04735===_0x6b73('0x95')||_0xd04735==='headerinfo'||_0xd04735===_0x6b73('0x96')||_0xd04735===_0x6b73('0x97')||_0xd04735===_0x6b73('0x98')||_0xd04735===_0x6b73('0x99'))){_0x1b2460[_0x6b73('0x91')](new Extension(_0x4d6f1b,_0x5de784,_0x6b73('0x9a')+_0xd04735+')='+_0x4d6f1b[_0xd04735],_0x6b73('0x92')));_0x5de784+=0x1;}}_0x1b2460[_0x6b73('0x91')](new Extension(_0x4d6f1b,_0x5de784,'6',_0x6b73('0x9b')));_0x5de784+=0x1;_0x1b2460[_0x6b73('0x91')](new Extension(_0x4d6f1b,_0x5de784,_0x6b73('0x9c'),_0x6b73('0x9d')));_0x5de784=0x0;return _0x1b2460;}exports['addAccountApplications']=function(_0x46f2bb,_0x1d5e83,_0x431a82){var _0x258e61;return db['sequelize']['transaction'](function(_0x4171c2){return db[_0x6b73('0x45')]['create'](_0x46f2bb[_0x6b73('0x61')],{'transaction':_0x4171c2})[_0x6b73('0x25')](function(_0x980fad){_0x258e61=_0x980fad['get']({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x258e61),{'transaction':_0x4171c2});});})['then'](function(){return _0x258e61;})[_0x6b73('0x25')](respondWithResult(_0x1d5e83,null))[_0x6b73('0x2f')](handleError(_0x1d5e83,null));};exports[_0x6b73('0x9e')]=function(_0x414a99,_0x1e3684,_0x505b11){var _0xc0a8c5;return db[_0x6b73('0x82')][_0x6b73('0x83')](function(_0x216f13){return db[_0x6b73('0x45')][_0x6b73('0x3a')](_0x414a99[_0x6b73('0x61')],{'where':{'id':_0x414a99[_0x6b73('0x61')]['id']},'transaction':_0x216f13})[_0x6b73('0x25')](function(_0x141fd4){return db[_0x6b73('0x9f')][_0x6b73('0x3b')]({'where':{'FaxAccountId':_0x414a99[_0x6b73('0x61')]['id']},'transaction':_0x216f13})[_0x6b73('0x25')](function(_0x257d0c){return db[_0x6b73('0x9f')][_0x6b73('0x87')](createExtensionsReciveFax(_[_0x6b73('0x78')](_0x414a99[_0x6b73('0x61')],['tech',_0x6b73('0x46'),'createdAt',_0x6b73('0xa0'),_0x6b73('0xa1'),'ListId'])),{'transaction':_0x216f13});});});})['then'](function(){return db[_0x6b73('0x45')][_0x6b73('0xa2')](_0x414a99[_0x6b73('0x61')]['id']);})['then'](respondWithResult(_0x1e3684,null))['catch'](handleError(_0x1e3684,null));};exports[_0x6b73('0xa3')]=function(_0x5b7be1,_0x235451,_0x323ef2){var _0x254fc5={'raw':!![],'where':{}};var _0x3599f1={};var _0x3244c={'count':0x0,'rows':[]};return db['FaxAccount'][_0x6b73('0x72')]({'where':{'id':_0x5b7be1[_0x6b73('0x5b')]['id']}})[_0x6b73('0x25')](handleEntityNotFound(_0x235451,null))[_0x6b73('0x25')](function(_0x579dec){if(_0x579dec){_0x3599f1[_0x6b73('0x4b')]=_[_0x6b73('0x48')](db[_0x6b73('0xa4')][_0x6b73('0x5c')]);_0x3599f1[_0x6b73('0x47')]=_[_0x6b73('0x48')](_0x5b7be1[_0x6b73('0x47')]);_0x3599f1[_0x6b73('0x49')]=_[_0x6b73('0x4a')](_0x3599f1['model'],_0x3599f1[_0x6b73('0x47')]);_0x254fc5[_0x6b73('0x4d')]=_['intersection'](_0x3599f1['model'],qs[_0x6b73('0x4c')](_0x5b7be1[_0x6b73('0x47')]['fields']));_0x254fc5[_0x6b73('0x4d')]=_0x254fc5[_0x6b73('0x4d')][_0x6b73('0x5d')]?_0x254fc5[_0x6b73('0x4d')]:_0x3599f1[_0x6b73('0x4b')];if(!_0x5b7be1[_0x6b73('0x47')][_0x6b73('0x4e')]('nolimit')){_0x254fc5[_0x6b73('0x35')]=qs[_0x6b73('0x35')](_0x5b7be1[_0x6b73('0x47')]['limit']);_0x254fc5[_0x6b73('0x34')]=qs['offset'](_0x5b7be1[_0x6b73('0x47')][_0x6b73('0x34')]);}_0x254fc5[_0x6b73('0x73')]=qs[_0x6b73('0x50')](_0x5b7be1[_0x6b73('0x47')][_0x6b73('0x50')]);_0x254fc5['where']=qs[_0x6b73('0x49')](_[_0x6b73('0x52')](_0x5b7be1['query'],_0x3599f1[_0x6b73('0x49')]));_0x254fc5[_0x6b73('0x51')][_0x6b73('0x6b')]=_0x579dec['id'];if(_0x5b7be1[_0x6b73('0x47')][_0x6b73('0x53')]){_0x254fc5['where']=_[_0x6b73('0x54')](_0x254fc5['where'],{'$or':_[_0x6b73('0x44')](_0x254fc5['attributes'],function(_0x1bc6f7){var _0xc509ca={};_0xc509ca[_0x1bc6f7]={'$like':'%'+_0x5b7be1[_0x6b73('0x47')]['filter']+'%'};return _0xc509ca;})});}if(_0x5b7be1[_0x6b73('0x47')][_0x6b73('0xa5')]){var _0x2f6f73=_0x5b7be1['query'][_0x6b73('0xa5')][_0x6b73('0xa6')](',');var _0x33903e={};_0x33903e[_0x2f6f73[0x0]]={'$gte':moment(_0x2f6f73[0x1])[_0x6b73('0xa7')](_0x6b73('0xa8'))};_0x254fc5['where']=_[_0x6b73('0x54')](_0x254fc5[_0x6b73('0x51')],_0x33903e);}_0x254fc5=_['merge']({},_0x254fc5,_0x5b7be1[_0x6b73('0x57')]);return db['FaxMessage'][_0x6b73('0x36')]({'where':_0x254fc5['where']})['then'](function(_0x2d34c2){_0x3244c['count']=_0x2d34c2;if(_0x5b7be1[_0x6b73('0x47')][_0x6b73('0x58')]){_0x254fc5['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x254fc5);})['then'](function(_0x4ad807){_0x3244c[_0x6b73('0x6d')]=_0x4ad807;return _0x3244c;});}})[_0x6b73('0x25')](respondWithFilteredResult(_0x235451,_0x254fc5))[_0x6b73('0x2f')](handleError(_0x235451,null));};exports[_0x6b73('0x40')]=function(_0x54c118,_0x3a1ab4,_0x5c9421){var _0x427c57,_0x417cd9={},_0x5616e4;if(_0x54c118[_0x6b73('0x61')]['to']){_0x5616e4=_0x54c118[_0x6b73('0x61')]['to'][0x0];}return db[_0x6b73('0x45')][_0x6b73('0x5f')]({'where':{'id':_0x54c118[_0x6b73('0x5b')]['id']},'include':[{'model':db['CmList'],'as':_0x6b73('0xa9'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x5616e4},'limit':0x1,'order':[[_0x6b73('0xa0'),_0x6b73('0xaa')]]}]}]})[_0x6b73('0x25')](handleEntityNotFound(_0x3a1ab4,null))['then'](function(_0x307a29){_0x427c57=_0x307a29;if(_0x54c118[_0x6b73('0x61')]['attachments']&&_0x54c118[_0x6b73('0x61')][_0x6b73('0xab')][_0x6b73('0x5d')]){for(var _0x152112=0x0;_0x152112<_0x54c118[_0x6b73('0x61')][_0x6b73('0xab')][_0x6b73('0x5d')];_0x152112+=0x1){_0x54c118[_0x6b73('0x61')][_0x6b73('0xab')][_0x152112]={'filename':_0x54c118[_0x6b73('0x61')][_0x6b73('0xab')][_0x152112]['name'],'id':_0x54c118[_0x6b73('0x61')]['attachments'][_0x152112]['id'],'path':path[_0x6b73('0xac')](config['root'],'server/files/attachments',_0x54c118[_0x6b73('0x61')][_0x6b73('0xab')][_0x152112][_0x6b73('0xad')])};}}return respondWithRpcPromise(_0x6b73('0xae'),_0x6b73('0xae'),{'FaxAccountId':_[_0x6b73('0xaf')](_0x54c118['params']['id'])?undefined:_0x54c118[_0x6b73('0x5b')]['id'],'path':_[_0x6b73('0xaf')](_0x54c118[_0x6b73('0x61')]['attachments'][0x0][_0x6b73('0x6')])?undefined:_0x54c118[_0x6b73('0x61')][_0x6b73('0xab')][0x0][_0x6b73('0x6')],'fax':_[_0x6b73('0xaf')](_0x54c118[_0x6b73('0x61')]['to'][0x0])?undefined:_0x54c118[_0x6b73('0x61')]['to'][0x0]},client9002);})[_0x6b73('0x25')](function(){if(_0x427c57){if(_[_0x6b73('0xaf')](_0x54c118[_0x6b73('0x61')][_0x6b73('0xb0')])){_0x54c118[_0x6b73('0x61')]['from']=util['format']('\x22%s\x22\x20<%s>',_0x427c57[_0x6b73('0x3f')],_0x427c57[_0x6b73('0xb1')]);}if(_0x427c57[_0x6b73('0xa9')]){if(_0x427c57['List'][_0x6b73('0xb2')][_0x6b73('0x5d')]){return _0x427c57[_0x6b73('0xa9')]['Contacts'][0x0];}else{return db[_0x6b73('0x7a')][_0x6b73('0x60')](_['defaults'](_0x54c118[_0x6b73('0x61')],{'firstName':_0x54c118['body']['to'][0x0],'phone':_0x54c118[_0x6b73('0x61')]['to'][0x0],'fax':_0x54c118['body']['to'][0x0],'ListId':_0x427c57[_0x6b73('0xb3')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x6b73('0xb4'));}})[_0x6b73('0x25')](function(_0x2da2bf){if(_0x2da2bf){return db[_0x6b73('0x77')]['find']({'where':{'ContactId':_0x2da2bf['id'],'closed':![],'FaxAccountId':_0x427c57['id']}})[_0x6b73('0x25')](function(_0x1e999f){if(_0x1e999f){return[_0x1e999f,![]];}return db[_0x6b73('0x77')][_0x6b73('0x60')]({'UserId':_0x54c118[_0x6b73('0x62')]['id'],'ContactId':_0x2da2bf['id'],'FaxAccountId':_0x427c57['id'],'fax':_0x54c118['body']['to'][0x0],'firstMsgDirection':_0x6b73('0xb5'),'Messages':[_[_0x6b73('0x54')](_0x54c118['body'],{'read':![],'body':_0x54c118[_0x6b73('0x61')][_0x6b73('0xab')][0x0][_0x6b73('0xb6')],'FaxAccountId':_0x427c57['id'],'UserId':_0x54c118[_0x6b73('0x62')]['id'],'ContactId':_0x2da2bf['id'],'AttachmentId':_0x54c118[_0x6b73('0x61')][_0x6b73('0xab')][0x0]['id']})]},{'include':[{'model':db[_0x6b73('0xa4')],'as':_0x6b73('0xb7')}]})[_0x6b73('0x25')](function(_0x539302){return[_0x539302,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0xc09963,_0x2bb425){if(_0x2bb425){return _0xc09963;}return db[_0x6b73('0xa4')][_0x6b73('0x60')]({'direction':_0x6b73('0xb5'),'read':![],'body':_0x54c118[_0x6b73('0x61')][_0x6b73('0xab')][0x0][_0x6b73('0xb6')],'FaxAccountId':_0x427c57['id'],'FaxInteractionId':_0xc09963['id'],'UserId':_0x54c118['user']['id'],'ContactId':_0xc09963[_0x6b73('0xb8')],'AttachmentId':_0x54c118[_0x6b73('0x61')][_0x6b73('0xab')][0x0]['id']})[_0x6b73('0x25')](function(_0x127f32){_0xc09963[_0x6b73('0xb9')][_0x6b73('0xb7')]=[];_0xc09963[_0x6b73('0xb9')][_0x6b73('0xb7')][_0x6b73('0x91')](_0x127f32[_0x6b73('0xb9')]);return _0xc09963;});})[_0x6b73('0x25')](function(_0x6fa006){respondWithRpcPromise('SendFax',_0x6b73('0xba'),{'FaxAccountId':_[_0x6b73('0xaf')](_0x54c118[_0x6b73('0x5b')]['id'])?undefined:_0x54c118[_0x6b73('0x5b')]['id'],'path':_[_0x6b73('0xaf')](_0x54c118[_0x6b73('0x61')][_0x6b73('0xab')][0x0][_0x6b73('0x6')])?undefined:_0x54c118[_0x6b73('0x61')][_0x6b73('0xab')][0x0][_0x6b73('0x6')],'fax':_['isNil'](_0x54c118[_0x6b73('0x61')]['to'][0x0])?undefined:_0x54c118[_0x6b73('0x61')]['to'][0x0],'AttachmentId':_0x54c118['body']['attachments'][0x0]['id']},client9002)[_0x6b73('0x25')](function(_0x3d9ded){logger[_0x6b73('0x26')](_0x6b73('0xbb'),_0x3d9ded);})[_0x6b73('0x2f')](function(_0x90ce0b){logger[_0x6b73('0x26')](_0x6b73('0xbb'),_0x90ce0b);});return _0x6fa006;})[_0x6b73('0x25')](respondWithResult(_0x3a1ab4,null))['catch'](handleError(_0x3a1ab4,null));};exports[_0x6b73('0xbc')]=function(_0x4efd64,_0x1a0ffa,_0xe3d08e){return db[_0x6b73('0x45')][_0x6b73('0x5f')]({'where':{'id':_0x4efd64['params']['id']}})[_0x6b73('0x25')](handleEntityNotFound(_0x1a0ffa,null))[_0x6b73('0x25')](function(_0x444cc6){if(_0x444cc6){return _0x444cc6[_0x6b73('0xbc')](_0x4efd64[_0x6b73('0x61')][_0x6b73('0x75')],_[_0x6b73('0x78')](_0x4efd64[_0x6b73('0x61')],[_0x6b73('0x75'),'id'])||{})['spread'](function(_0x3a0970){for(var _0x304bf0=0x0;_0x304bf0<_0x4efd64[_0x6b73('0x61')][_0x6b73('0x75')][_0x6b73('0x5d')];_0x304bf0+=0x1){socket['emit'](_0x6b73('0xbd'),{'UserId':Number(_0x4efd64[_0x6b73('0x61')][_0x6b73('0x75')][_0x304bf0]),'FaxAccountId':Number(_0x4efd64[_0x6b73('0x5b')]['id'])});}return _0x3a0970;});}})['then'](respondWithResult(_0x1a0ffa,null))[_0x6b73('0x2f')](handleError(_0x1a0ffa,null));};exports[_0x6b73('0xbe')]=function(_0x595764,_0x35822c,_0x5ca881){return db[_0x6b73('0x45')][_0x6b73('0x5f')]({'where':{'id':_0x595764[_0x6b73('0x5b')]['id']}})[_0x6b73('0x25')](handleEntityNotFound(_0x35822c,null))['then'](function(_0x1383d2){if(_0x1383d2){return _0x1383d2[_0x6b73('0xbe')](_0x595764['query'][_0x6b73('0x75')])['then'](function(){if(_[_0x6b73('0xbf')](_0x595764['query'][_0x6b73('0x75')])){for(var _0x340304=0x0;_0x340304<_0x595764[_0x6b73('0x47')]['ids'][_0x6b73('0x5d')];_0x340304+=0x1){socket[_0x6b73('0xc0')](_0x6b73('0xc1'),{'UserId':Number(_0x595764['query'][_0x6b73('0x75')][_0x340304]),'FaxAccountId':Number(_0x595764['params']['id'])});}}else{socket[_0x6b73('0xc0')]('userFaxAccount:remove',{'UserId':Number(_0x595764['query'][_0x6b73('0x75')]),'FaxAccountId':Number(_0x595764['params']['id'])});}});}})[_0x6b73('0x25')](respondWithStatusCode(_0x35822c,null))['catch'](handleError(_0x35822c,null));};exports['getAgents']=function(_0x2b5463,_0x48e2e3,_0x3d16b6){var _0x795629={};var _0x5eb249={};var _0x328984;var _0x3cf71e;return db[_0x6b73('0x45')][_0x6b73('0x72')]({'where':{'id':_0x2b5463[_0x6b73('0x5b')]['id']}})['then'](handleEntityNotFound(_0x48e2e3,null))[_0x6b73('0x25')](function(_0x2cc827){if(_0x2cc827){_0x328984=_0x2cc827;_0x5eb249[_0x6b73('0x4b')]=_['keys'](db[_0x6b73('0xc2')][_0x6b73('0x5c')]);_0x5eb249[_0x6b73('0x47')]=_['keys'](_0x2b5463[_0x6b73('0x47')]);_0x5eb249[_0x6b73('0x49')]=_['intersection'](_0x5eb249[_0x6b73('0x4b')],_0x5eb249[_0x6b73('0x47')]);_0x795629[_0x6b73('0x4d')]=_[_0x6b73('0x4a')](_0x5eb249[_0x6b73('0x4b')],qs[_0x6b73('0x4c')](_0x2b5463[_0x6b73('0x47')][_0x6b73('0x4c')]));_0x795629[_0x6b73('0x4d')]=_0x795629['attributes'][_0x6b73('0x5d')]?_0x795629[_0x6b73('0x4d')]:_0x5eb249['model'];_0x795629[_0x6b73('0x73')]=qs[_0x6b73('0x50')](_0x2b5463[_0x6b73('0x47')][_0x6b73('0x50')]);_0x795629['where']=qs[_0x6b73('0x49')](_['pick'](_0x2b5463[_0x6b73('0x47')],_0x5eb249['filters']));if(_0x2b5463[_0x6b73('0x47')]['filter']){_0x795629[_0x6b73('0x51')]=_[_0x6b73('0x54')](_0x795629[_0x6b73('0x51')],{'$or':_[_0x6b73('0x44')](_0x795629[_0x6b73('0x4d')],function(_0x4c6621){var _0x3b88da={};_0x3b88da[_0x4c6621]={'$like':'%'+_0x2b5463[_0x6b73('0x47')][_0x6b73('0x53')]+'%'};return _0x3b88da;})});}_0x795629=_['merge']({},_0x795629,_0x2b5463[_0x6b73('0x57')]);return _0x328984[_0x6b73('0xc3')](_0x795629);}})['then'](function(_0x8dce4a){if(_0x8dce4a){_0x3cf71e=_0x8dce4a[_0x6b73('0x5d')];if(!_0x2b5463['query'][_0x6b73('0x4e')]('nolimit')){_0x795629[_0x6b73('0x35')]=qs['limit'](_0x2b5463[_0x6b73('0x47')][_0x6b73('0x35')]);_0x795629[_0x6b73('0x34')]=qs['offset'](_0x2b5463[_0x6b73('0x47')]['offset']);}return _0x328984[_0x6b73('0xc3')](_0x795629);}})[_0x6b73('0x25')](function(_0x2c4d9b){if(_0x2c4d9b){return _0x2c4d9b?{'count':_0x3cf71e,'rows':_0x2c4d9b}:null;}})[_0x6b73('0x25')](respondWithResult(_0x48e2e3,null))[_0x6b73('0x2f')](handleError(_0x48e2e3,null));};
\ No newline at end of file
index 1e1a76a..09ff06e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb23d=['setMaxListeners','save','update','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x1c0058,_0x25d0cf){var _0x480919=function(_0x25c458){while(--_0x25c458){_0x1c0058['push'](_0x1c0058['shift']());}};_0x480919(++_0x25d0cf);}(_0xb23d,0x194));var _0xdb23=function(_0x3e25c1,_0x1d15f9){_0x3e25c1=_0x3e25c1-0x0;var _0x52e7f2=_0xb23d[_0x3e25c1];return _0x52e7f2;};'use strict';var EventEmitter=require(_0xdb23('0x0'));var FaxAccount=require(_0xdb23('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xdb23('0x2')](0x0);var events={'afterCreate':_0xdb23('0x3'),'afterUpdate':_0xdb23('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5754cd){return function(_0x593255,_0x56f280,_0x3a760d){FaxAccountEvents[_0xdb23('0x5')](_0x5754cd+':'+_0x593255['id'],_0x593255);FaxAccountEvents[_0xdb23('0x5')](_0x5754cd,_0x593255);_0x3a760d(null);};}for(var e in events){if(events[_0xdb23('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module['exports']=FaxAccountEvents;
\ No newline at end of file
+var _0x1e4c=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','save'];(function(_0x3f157e,_0x2780f2){var _0x39079e=function(_0x2aa235){while(--_0x2aa235){_0x3f157e['push'](_0x3f157e['shift']());}};_0x39079e(++_0x2780f2);}(_0x1e4c,0x1bc));var _0xc1e4=function(_0x4bd6ac,_0x4a69aa){_0x4bd6ac=_0x4bd6ac-0x0;var _0x108328=_0x1e4c[_0x4bd6ac];return _0x108328;};'use strict';var EventEmitter=require(_0xc1e4('0x0'));var FaxAccount=require(_0xc1e4('0x1'))['db'][_0xc1e4('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc1e4('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3f9d49){return function(_0xc7626b,_0x40d6fe,_0x510359){FaxAccountEvents[_0xc1e4('0x4')](_0x3f9d49+':'+_0xc7626b['id'],_0xc7626b);FaxAccountEvents[_0xc1e4('0x4')](_0x3f9d49,_0xc7626b);_0x510359(null);};}for(var e in events){if(events[_0xc1e4('0x5')](e)){var event=events[e];FaxAccount[_0xc1e4('0x6')](e,emitEvent(event));}}module[_0xc1e4('0x7')]=FaxAccountEvents;
\ No newline at end of file
index 28d517f..16dec8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d77=['util','../../config/logger','moment','path','rimraf','../../config/environment','./faxAccount.attributes','lodash'];(function(_0x192915,_0x1f24a8){var _0x2fd9f6=function(_0x32a975){while(--_0x32a975){_0x192915['push'](_0x192915['shift']());}};_0x2fd9f6(++_0x1f24a8);}(_0x5d77,0xdf));var _0x75d7=function(_0x30d096,_0x292caf){_0x30d096=_0x30d096-0x0;var _0x6802b6=_0x5d77[_0x30d096];return _0x6802b6;};'use strict';var _=require(_0x75d7('0x0'));var util=require(_0x75d7('0x1'));var logger=require(_0x75d7('0x2'))('api');var moment=require(_0x75d7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x75d7('0x4'));var rimraf=require(_0x75d7('0x5'));var config=require(_0x75d7('0x6'));var attributes=require(_0x75d7('0x7'));module['exports']=function(_0x145513,_0x1bdcf4){return _0x145513['define']('FaxAccount',attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5016=['exports','define','FaxAccount','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes'];(function(_0x6780a0,_0x523c59){var _0x3bcd86=function(_0x1bc40e){while(--_0x1bc40e){_0x6780a0['push'](_0x6780a0['shift']());}};_0x3bcd86(++_0x523c59);}(_0x5016,0xdb));var _0x6501=function(_0x55fb83,_0x1d3856){_0x55fb83=_0x55fb83-0x0;var _0x59a87a=_0x5016[_0x55fb83];return _0x59a87a;};'use strict';var _=require(_0x6501('0x0'));var util=require('util');var logger=require(_0x6501('0x1'))('api');var moment=require(_0x6501('0x2'));var BPromise=require(_0x6501('0x3'));var rp=require(_0x6501('0x4'));var fs=require('fs');var path=require(_0x6501('0x5'));var rimraf=require(_0x6501('0x6'));var config=require(_0x6501('0x7'));var attributes=require(_0x6501('0x8'));module[_0x6501('0x9')]=function(_0x1fb002,_0x553936){return _0x1fb002[_0x6501('0xa')](_0x6501('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b13264f..4c22ae5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9542=['account','applications','priority','asc','ListId','create','contact','FaxInteraction','find','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','FaxAccount','findAll','options','raw','attributes','include','map','model','GetFaxAccount','debug','NotifyFaxAccount','fax','Sequelize','no\x20available\x20attributes','keys','createdAt','updatedAt','difference','CompanyId','body','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','List','CmContact','Contacts','DESC','FaxApplication','Applications','get'];(function(_0x413df6,_0x1d3c6e){var _0x37b1f3=function(_0x699a16){while(--_0x699a16){_0x413df6['push'](_0x413df6['shift']());}};_0x37b1f3(++_0x1d3c6e);}(_0x9542,0xcc));var _0x2954=function(_0x2a7b65,_0x4ba52c){_0x2a7b65=_0x2a7b65-0x0;var _0x265ccb=_0x9542[_0x2a7b65];return _0x265ccb;};'use strict';var _=require(_0x2954('0x0'));var util=require(_0x2954('0x1'));var moment=require(_0x2954('0x2'));var BPromise=require(_0x2954('0x3'));var rs=require(_0x2954('0x4'));var fs=require('fs');var Redis=require(_0x2954('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2954('0x6'));var logger=require('../../config/logger')(_0x2954('0x7'));var config=require(_0x2954('0x8'));var jayson=require(_0x2954('0x9'));var client=jayson[_0x2954('0xa')][_0x2954('0xb')]({'port':0x232c});config['redis']=_['defaults'](config[_0x2954('0xc')],{'host':_0x2954('0xd'),'port':0x18eb});var socket=require(_0x2954('0xe'))(new Redis(config[_0x2954('0xc')]));require(_0x2954('0xf'))[_0x2954('0x10')](socket);function respondWithRpcPromise(_0x376bdc,_0x5c0de0,_0x2d1ee9){return new BPromise(function(_0x1fd518,_0x5002dc){return client['request'](_0x376bdc,_0x2d1ee9)[_0x2954('0x11')](function(_0x4b8e25){logger[_0x2954('0x12')](_0x2954('0x13'),_0x5c0de0,_0x2954('0x14'));logger['debug'](_0x2954('0x15'),_0x5c0de0,_0x2954('0x14'),JSON[_0x2954('0x16')](_0x4b8e25));if(_0x4b8e25[_0x2954('0x17')]){if(_0x4b8e25['error']['code']===0x1f4){logger[_0x2954('0x17')]('FaxAccount,\x20%s,\x20%s',_0x5c0de0,_0x4b8e25['error'][_0x2954('0x18')]);return _0x5002dc(_0x4b8e25[_0x2954('0x17')][_0x2954('0x18')]);}logger[_0x2954('0x17')](_0x2954('0x13'),_0x5c0de0,_0x4b8e25[_0x2954('0x17')][_0x2954('0x18')]);return _0x1fd518(_0x4b8e25[_0x2954('0x17')]['message']);}else{logger[_0x2954('0x12')](_0x2954('0x13'),_0x5c0de0,_0x2954('0x14'));_0x1fd518(_0x4b8e25['result']['message']);}})[_0x2954('0x19')](function(_0x53b8aa){logger[_0x2954('0x17')](_0x2954('0x13'),_0x5c0de0,_0x53b8aa);_0x5002dc(_0x53b8aa);});});}exports['GetFaxAccount']=function(_0x157253){var _0x2fd81b=this;return new Promise(function(_0x3ef1c0,_0x172c2a){return db[_0x2954('0x1a')][_0x2954('0x1b')]({'raw':_0x157253['options']?_0x157253[_0x2954('0x1c')][_0x2954('0x1d')]===undefined?!![]:![]:!![],'where':_0x157253[_0x2954('0x1c')]?_0x157253[_0x2954('0x1c')]['where']||null:null,'attributes':_0x157253['options']?_0x157253[_0x2954('0x1c')][_0x2954('0x1e')]||null:null,'limit':_0x157253[_0x2954('0x1c')]?_0x157253['options']['limit']||null:null,'include':_0x157253[_0x2954('0x1c')]?_0x157253['options'][_0x2954('0x1f')]?_[_0x2954('0x20')](_0x157253[_0x2954('0x1c')][_0x2954('0x1f')],function(_0x151d7a){return{'model':db[_0x151d7a[_0x2954('0x21')]],'as':_0x151d7a['as'],'attributes':_0x151d7a[_0x2954('0x1e')],'include':_0x151d7a['include']?_[_0x2954('0x20')](_0x151d7a[_0x2954('0x1f')],function(_0x4a1459){return{'model':db[_0x4a1459['model']],'as':_0x4a1459['as'],'attributes':_0x4a1459[_0x2954('0x1e')],'include':_0x4a1459[_0x2954('0x1f')]?_[_0x2954('0x20')](_0x4a1459[_0x2954('0x1f')],function(_0x26f35d){return{'model':db[_0x26f35d['model']],'as':_0x26f35d['as'],'attributes':_0x26f35d[_0x2954('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2954('0x11')](function(_0x370895){logger[_0x2954('0x12')](_0x2954('0x22'),_0x157253);logger[_0x2954('0x23')](_0x2954('0x22'),_0x157253,JSON[_0x2954('0x16')](_0x370895));_0x3ef1c0(_0x370895);})[_0x2954('0x19')](function(_0xf5609){logger[_0x2954('0x17')]('GetFaxAccount',_0xf5609[_0x2954('0x18')],_0x157253);_0x172c2a(_0x2fd81b[_0x2954('0x17')](0x1f4,_0xf5609[_0x2954('0x18')]));});});};exports[_0x2954('0x24')]=function(_0x3acce2,_0x3a5597,_0x33742b){var _0x16b5e6=this;return new Promise(function(_0x1111e8,_0xe193db){var _0x507a58={'body':_0x3acce2['body'],'channel':_0x2954('0x25')};var _0x39110c=[];var _0x370f44=[];var _0x3e58b1={};return db['CmContact']['describe']()[_0x2954('0x11')](function(_0x5f263f){if(!_0x5f263f){throw new db[(_0x2954('0x26'))]['ValidationError'](_0x2954('0x27'));}_0x39110c=_['difference'](_[_0x2954('0x28')](_0x5f263f),[_0x2954('0x29'),_0x2954('0x2a')]);_0x370f44=_[_0x2954('0x2b')](_[_0x2954('0x28')](_0x5f263f),[_0x2954('0x29'),_0x2954('0x2a'),_0x2954('0x2c'),'ListId']);if(_0x3acce2[_0x2954('0x2d')]['id']){delete _0x3acce2['body']['id'];}if(_[_0x2954('0x2e')](_0x3acce2[_0x2954('0x2d')]['from'])){throw new db[(_0x2954('0x26'))][(_0x2954('0x2f'))]('from\x20is\x20mandatory');}if(_[_0x2954('0x2e')](_0x3acce2[_0x2954('0x2d')][_0x2954('0x2d')])||_0x3acce2[_0x2954('0x2d')][_0x2954('0x2d')]===''){throw new db[(_0x2954('0x26'))][(_0x2954('0x2f'))](_0x2954('0x30'));}if(_[_0x2954('0x2e')](_0x3acce2[_0x2954('0x2d')][_0x2954('0x31')])){throw new db[(_0x2954('0x26'))][(_0x2954('0x2f'))](_0x2954('0x32')+_0x370f44);}if(!_[_0x2954('0x33')](_0x370f44,_0x3acce2[_0x2954('0x2d')][_0x2954('0x31')])){throw new db[(_0x2954('0x26'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x370f44);}_0x3e58b1[_0x3acce2[_0x2954('0x2d')][_0x2954('0x31')]]=_0x3acce2['body'][_0x2954('0x34')];})[_0x2954('0x11')](function(){return db[_0x2954('0x1a')]['find']({'where':{'id':_0x3acce2['account']['id']},'include':[{'model':db['CmList'],'as':_0x2954('0x35'),'include':[{'model':db[_0x2954('0x36')],'as':_0x2954('0x37'),'where':_0x3e58b1,'limit':0x1,'order':[[_0x2954('0x2a'),_0x2954('0x38')]]}]},{'model':db[_0x2954('0x39')],'as':_0x2954('0x3a')}]});})[_0x2954('0x11')](function(_0x23423d){if(_0x23423d&&_0x23423d[_0x2954('0x35')]){var _0x3c4bf1=_0x23423d[_0x2954('0x3b')]({'plain':!![]});_0x507a58[_0x2954('0x3c')]=_0x3c4bf1;_0x507a58[_0x2954('0x3d')]=_0x3c4bf1[_0x2954('0x3a')];_0x507a58['list']=_0x3c4bf1[_0x2954('0x35')];_0x507a58['applications']=_['orderBy'](_0x507a58[_0x2954('0x3d')],[_0x2954('0x3e')],[_0x2954('0x3f')]);if(_0x507a58[_0x2954('0x3c')]['Applications']){delete _0x507a58['account'][_0x2954('0x3a')];}if(_0x507a58[_0x2954('0x3c')][_0x2954('0x35')]&&_0x507a58[_0x2954('0x3c')][_0x2954('0x35')][_0x2954('0x37')]['length']){return _0x507a58[_0x2954('0x3c')]['List']['Contacts'][0x0];}var _0xc7bc46=_['defaults'](_0x3acce2['body'],{'firstName':_0x3acce2[_0x2954('0x2d')][_0x2954('0x34')],'ListId':_0x3c4bf1[_0x2954('0x40')]});_0xc7bc46[_0x3acce2['body'][_0x2954('0x31')]]=_0x3acce2['body'][_0x2954('0x34')];return db[_0x2954('0x36')][_0x2954('0x41')](_0xc7bc46,{'fields':_0x39110c,'raw':!![]});}})['then'](function(_0x3e8770){_0x507a58[_0x2954('0x42')]=_0x3e8770;if(_0x3e8770){var _0x3b1641={'ContactId':_0x3e8770['id'],'FaxAccountId':_0x3acce2[_0x2954('0x3c')]['id'],'fax':_0x3e8770[_0x2954('0x25')]};return db[_0x2954('0x43')][_0x2954('0x44')]({'where':{'ContactId':_0x3e8770['id'],'closed':![],'FaxAccountId':_0x3acce2[_0x2954('0x3c')]['id']}})[_0x2954('0x11')](function(_0x24e4c4){if(_0x24e4c4){return[_0x24e4c4,![]];}return db[_0x2954('0x43')]['create'](_0x3b1641)[_0x2954('0x11')](function(_0x53d60c){return[_0x53d60c,!![]];});});}else{throw new Error(_0x2954('0x45'));}})[_0x2954('0x46')](function(_0x1c133c,_0x29a820){var _0x3fda8a=_0x1c133c[_0x2954('0x3b')]({'plain':!![]});if(_0x29a820){if(_0x507a58[_0x2954('0x3c')][_0x2954('0x47')]){_0x507a58['applications'][_0x2954('0x48')]({'id':0x0,'priority':_0x507a58[_0x2954('0x3d')]['length']+0x1,'app':_0x2954('0x49'),'appdata':_0x2954('0x4a'),'interval':_0x2954('0x4b')});}_0x3fda8a[_0x2954('0x4c')]=!![];}else{_0x3fda8a['created']=![];}_0x507a58[_0x2954('0x4d')]=_0x3fda8a;return db[_0x2954('0x4e')][_0x2954('0x41')]({'body':_0x3acce2['body'][_0x2954('0x2d')],'FaxAccountId':_0x3acce2[_0x2954('0x3c')]['id'],'FaxInteractionId':_0x1c133c['id'],'direction':'in','ContactId':_0x1c133c[_0x2954('0x4f')],'AttachmentId':_0x3acce2['body'][_0x2954('0x50')]});})['then'](function(_0x3905a3){_0x507a58[_0x2954('0x18')]=_0x3905a3;if(_0x507a58[_0x2954('0x4d')]['UserId']){return db[_0x2954('0x51')][_0x2954('0x44')]({'attributes':['id','name'],'where':{'id':_0x507a58[_0x2954('0x4d')]['UserId']}})[_0x2954('0x11')](function(_0x57386d){if(_0x57386d){_0x507a58[_0x2954('0x3d')][_0x2954('0x52')]({'id':0x0,'priority':0x0,'app':_0x2954('0x53'),'appdata':_0x57386d[_0x2954('0x54')]+','+(_0x507a58[_0x2954('0x3c')][_0x2954('0x55')]||0xa),'interval':_0x2954('0x4b')});}return respondWithRpcPromise(_0x2954('0x56'),_0x2954('0x57'),_0x507a58);});}return respondWithRpcPromise('Start',_0x2954('0x57'),_0x507a58);})[_0x2954('0x11')](function(_0x197a0a){_0x1111e8(_0x197a0a);})['catch'](function(_0x19239d){_0xe193db(_0x16b5e6[_0x2954('0x17')](0x1f4,_0x19239d[_0x2954('0x18')]));});});};
\ No newline at end of file
+var _0x4911=['redis','localhost','socket.io-emitter','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','findAll','options','raw','where','attributes','limit','map','include','model','body','fax','describe','ValidationError','no\x20available\x20attributes','createdAt','keys','updatedAt','CompanyId','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','FaxAccount','account','CmList','CmContact','Contacts','DESC','FaxApplication','Applications','List','get','applications','list','priority','asc','length','ListId','create','contact','FaxInteraction','find','Contact\x20not\x20found','spread','autoclose','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x4a0066,_0x16fb7e){var _0x611761=function(_0x4c040d){while(--_0x4c040d){_0x4a0066['push'](_0x4a0066['shift']());}};_0x611761(++_0x16fb7e);}(_0x4911,0x10d));var _0x1491=function(_0x455150,_0x274121){_0x455150=_0x455150-0x0;var _0x12ca9c=_0x4911[_0x455150];return _0x12ca9c;};'use strict';var _=require(_0x1491('0x0'));var util=require('util');var moment=require(_0x1491('0x1'));var BPromise=require(_0x1491('0x2'));var rs=require(_0x1491('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1491('0x4'))['db'];var utils=require(_0x1491('0x5'));var logger=require(_0x1491('0x6'))(_0x1491('0x7'));var config=require(_0x1491('0x8'));var jayson=require(_0x1491('0x9'));var client=jayson[_0x1491('0xa')][_0x1491('0xb')]({'port':0x232c});config['redis']=_[_0x1491('0xc')](config[_0x1491('0xd')],{'host':_0x1491('0xe'),'port':0x18eb});var socket=require(_0x1491('0xf'))(new Redis(config[_0x1491('0xd')]));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0xfa032,_0x2b6721,_0x39a21b){return new BPromise(function(_0x151303,_0x522ece){return client[_0x1491('0x10')](_0xfa032,_0x39a21b)[_0x1491('0x11')](function(_0xb02ad){logger[_0x1491('0x12')](_0x1491('0x13'),_0x2b6721,_0x1491('0x14'));logger[_0x1491('0x15')](_0x1491('0x16'),_0x2b6721,_0x1491('0x14'),JSON[_0x1491('0x17')](_0xb02ad));if(_0xb02ad['error']){if(_0xb02ad[_0x1491('0x18')][_0x1491('0x19')]===0x1f4){logger[_0x1491('0x18')](_0x1491('0x13'),_0x2b6721,_0xb02ad['error'][_0x1491('0x1a')]);return _0x522ece(_0xb02ad[_0x1491('0x18')][_0x1491('0x1a')]);}logger[_0x1491('0x18')](_0x1491('0x13'),_0x2b6721,_0xb02ad['error'][_0x1491('0x1a')]);return _0x151303(_0xb02ad['error'][_0x1491('0x1a')]);}else{logger[_0x1491('0x12')]('FaxAccount,\x20%s,\x20%s',_0x2b6721,_0x1491('0x14'));_0x151303(_0xb02ad[_0x1491('0x1b')]['message']);}})[_0x1491('0x1c')](function(_0x5a880f){logger[_0x1491('0x18')](_0x1491('0x13'),_0x2b6721,_0x5a880f);_0x522ece(_0x5a880f);});});}exports[_0x1491('0x1d')]=function(_0x35c017){var _0x1f7b03=this;return new Promise(function(_0x5f0abe,_0x512a57){return db['FaxAccount'][_0x1491('0x1e')]({'raw':_0x35c017[_0x1491('0x1f')]?_0x35c017[_0x1491('0x1f')][_0x1491('0x20')]===undefined?!![]:![]:!![],'where':_0x35c017[_0x1491('0x1f')]?_0x35c017[_0x1491('0x1f')][_0x1491('0x21')]||null:null,'attributes':_0x35c017[_0x1491('0x1f')]?_0x35c017[_0x1491('0x1f')][_0x1491('0x22')]||null:null,'limit':_0x35c017['options']?_0x35c017[_0x1491('0x1f')][_0x1491('0x23')]||null:null,'include':_0x35c017['options']?_0x35c017[_0x1491('0x1f')]['include']?_[_0x1491('0x24')](_0x35c017[_0x1491('0x1f')][_0x1491('0x25')],function(_0x5d4494){return{'model':db[_0x5d4494['model']],'as':_0x5d4494['as'],'attributes':_0x5d4494[_0x1491('0x22')],'include':_0x5d4494[_0x1491('0x25')]?_[_0x1491('0x24')](_0x5d4494[_0x1491('0x25')],function(_0x27c276){return{'model':db[_0x27c276[_0x1491('0x26')]],'as':_0x27c276['as'],'attributes':_0x27c276[_0x1491('0x22')],'include':_0x27c276[_0x1491('0x25')]?_[_0x1491('0x24')](_0x27c276[_0x1491('0x25')],function(_0x3e6fba){return{'model':db[_0x3e6fba[_0x1491('0x26')]],'as':_0x3e6fba['as'],'attributes':_0x3e6fba[_0x1491('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3309e1){logger[_0x1491('0x12')](_0x1491('0x1d'),_0x35c017);logger[_0x1491('0x15')](_0x1491('0x1d'),_0x35c017,JSON[_0x1491('0x17')](_0x3309e1));_0x5f0abe(_0x3309e1);})[_0x1491('0x1c')](function(_0x4500b5){logger[_0x1491('0x18')](_0x1491('0x1d'),_0x4500b5[_0x1491('0x1a')],_0x35c017);_0x512a57(_0x1f7b03['error'](0x1f4,_0x4500b5[_0x1491('0x1a')]));});});};exports['NotifyFaxAccount']=function(_0x5c2b21,_0x4b7afb,_0x4e84f0){var _0x56f6e9=this;return new Promise(function(_0x4da298,_0x1a5ee3){var _0x44934e={'body':_0x5c2b21[_0x1491('0x27')],'channel':_0x1491('0x28')};var _0xdff796=[];var _0x536132=[];var _0x2ce558={};return db['CmContact'][_0x1491('0x29')]()['then'](function(_0x1407c8){if(!_0x1407c8){throw new db['Sequelize'][(_0x1491('0x2a'))](_0x1491('0x2b'));}_0xdff796=_['difference'](_['keys'](_0x1407c8),[_0x1491('0x2c'),'updatedAt']);_0x536132=_['difference'](_[_0x1491('0x2d')](_0x1407c8),[_0x1491('0x2c'),_0x1491('0x2e'),_0x1491('0x2f'),'ListId']);if(_0x5c2b21[_0x1491('0x27')]['id']){delete _0x5c2b21[_0x1491('0x27')]['id'];}if(_[_0x1491('0x30')](_0x5c2b21[_0x1491('0x27')]['from'])){throw new db['Sequelize'][(_0x1491('0x2a'))]('from\x20is\x20mandatory');}if(_[_0x1491('0x30')](_0x5c2b21[_0x1491('0x27')][_0x1491('0x27')])||_0x5c2b21[_0x1491('0x27')][_0x1491('0x27')]===''){throw new db[(_0x1491('0x31'))][(_0x1491('0x2a'))](_0x1491('0x32'));}if(_[_0x1491('0x30')](_0x5c2b21[_0x1491('0x27')][_0x1491('0x33')])){throw new db['Sequelize']['ValidationError'](_0x1491('0x34')+_0x536132);}if(!_[_0x1491('0x35')](_0x536132,_0x5c2b21['body']['mapKey'])){throw new db[(_0x1491('0x31'))][(_0x1491('0x2a'))](_0x1491('0x36')+_0x536132);}_0x2ce558[_0x5c2b21[_0x1491('0x27')][_0x1491('0x33')]]=_0x5c2b21['body'][_0x1491('0x37')];})['then'](function(){return db[_0x1491('0x38')]['find']({'where':{'id':_0x5c2b21[_0x1491('0x39')]['id']},'include':[{'model':db[_0x1491('0x3a')],'as':'List','include':[{'model':db[_0x1491('0x3b')],'as':_0x1491('0x3c'),'where':_0x2ce558,'limit':0x1,'order':[['updatedAt',_0x1491('0x3d')]]}]},{'model':db[_0x1491('0x3e')],'as':_0x1491('0x3f')}]});})[_0x1491('0x11')](function(_0x18765a){if(_0x18765a&&_0x18765a[_0x1491('0x40')]){var _0x5f9fb7=_0x18765a[_0x1491('0x41')]({'plain':!![]});_0x44934e['account']=_0x5f9fb7;_0x44934e[_0x1491('0x42')]=_0x5f9fb7[_0x1491('0x3f')];_0x44934e[_0x1491('0x43')]=_0x5f9fb7[_0x1491('0x40')];_0x44934e[_0x1491('0x42')]=_['orderBy'](_0x44934e[_0x1491('0x42')],[_0x1491('0x44')],[_0x1491('0x45')]);if(_0x44934e[_0x1491('0x39')][_0x1491('0x3f')]){delete _0x44934e[_0x1491('0x39')][_0x1491('0x3f')];}if(_0x44934e[_0x1491('0x39')][_0x1491('0x40')]&&_0x44934e[_0x1491('0x39')][_0x1491('0x40')][_0x1491('0x3c')][_0x1491('0x46')]){return _0x44934e[_0x1491('0x39')][_0x1491('0x40')][_0x1491('0x3c')][0x0];}var _0x59560e=_[_0x1491('0xc')](_0x5c2b21[_0x1491('0x27')],{'firstName':_0x5c2b21[_0x1491('0x27')][_0x1491('0x37')],'ListId':_0x5f9fb7[_0x1491('0x47')]});_0x59560e[_0x5c2b21[_0x1491('0x27')][_0x1491('0x33')]]=_0x5c2b21['body'][_0x1491('0x37')];return db['CmContact'][_0x1491('0x48')](_0x59560e,{'fields':_0xdff796,'raw':!![]});}})['then'](function(_0x30315f){_0x44934e[_0x1491('0x49')]=_0x30315f;if(_0x30315f){var _0x101687={'ContactId':_0x30315f['id'],'FaxAccountId':_0x5c2b21['account']['id'],'fax':_0x30315f[_0x1491('0x28')]};return db[_0x1491('0x4a')][_0x1491('0x4b')]({'where':{'ContactId':_0x30315f['id'],'closed':![],'FaxAccountId':_0x5c2b21[_0x1491('0x39')]['id']}})[_0x1491('0x11')](function(_0x4d1c65){if(_0x4d1c65){return[_0x4d1c65,![]];}return db[_0x1491('0x4a')][_0x1491('0x48')](_0x101687)[_0x1491('0x11')](function(_0xf2c039){return[_0xf2c039,!![]];});});}else{throw new Error(_0x1491('0x4c'));}})[_0x1491('0x4d')](function(_0x4c07b8,_0x3be3dc){var _0x5f3a7a=_0x4c07b8['get']({'plain':!![]});if(_0x3be3dc){if(_0x44934e['account'][_0x1491('0x4e')]){_0x44934e[_0x1491('0x42')]['push']({'id':0x0,'priority':_0x44934e[_0x1491('0x42')]['length']+0x1,'app':'close','appdata':_0x1491('0x4f'),'interval':_0x1491('0x50')});}_0x5f3a7a[_0x1491('0x51')]=!![];}else{_0x5f3a7a[_0x1491('0x51')]=![];}_0x44934e[_0x1491('0x52')]=_0x5f3a7a;return db[_0x1491('0x53')][_0x1491('0x48')]({'body':_0x5c2b21[_0x1491('0x27')][_0x1491('0x27')],'FaxAccountId':_0x5c2b21[_0x1491('0x39')]['id'],'FaxInteractionId':_0x4c07b8['id'],'direction':'in','ContactId':_0x4c07b8[_0x1491('0x54')],'AttachmentId':_0x5c2b21[_0x1491('0x27')][_0x1491('0x55')]});})[_0x1491('0x11')](function(_0x50d17b){_0x44934e[_0x1491('0x1a')]=_0x50d17b;if(_0x44934e['interaction']['UserId']){return db[_0x1491('0x56')][_0x1491('0x4b')]({'attributes':['id',_0x1491('0x57')],'where':{'id':_0x44934e[_0x1491('0x52')][_0x1491('0x58')]}})[_0x1491('0x11')](function(_0x4830cc){if(_0x4830cc){_0x44934e[_0x1491('0x42')][_0x1491('0x59')]({'id':0x0,'priority':0x0,'app':_0x1491('0x5a'),'appdata':_0x4830cc[_0x1491('0x57')]+','+(_0x44934e[_0x1491('0x39')][_0x1491('0x5b')]||0xa),'interval':_0x1491('0x50')});}return respondWithRpcPromise(_0x1491('0x5c'),_0x1491('0x5d'),_0x44934e);});}return respondWithRpcPromise(_0x1491('0x5c'),_0x1491('0x5d'),_0x44934e);})[_0x1491('0x11')](function(_0x5b04e5){_0x4da298(_0x5b04e5);})[_0x1491('0x1c')](function(_0x4a98d1){_0x1a5ee3(_0x56f6e9[_0x1491('0x18')](0x1f4,_0x4a98d1['message']));});});};
\ No newline at end of file
index 92fb634..f294242 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x204a=['update','emit','removeListener','length','./faxAccount.events','remove'];(function(_0x3f9bdd,_0x3936){var _0x26b9ae=function(_0x3d74a1){while(--_0x3d74a1){_0x3f9bdd['push'](_0x3f9bdd['shift']());}};_0x26b9ae(++_0x3936);}(_0x204a,0x19c));var _0xa204=function(_0x5e9622,_0xeb354b){_0x5e9622=_0x5e9622-0x0;var _0x306287=_0x204a[_0x5e9622];return _0x306287;};'use strict';var FaxAccountEvents=require(_0xa204('0x0'));var events=['save',_0xa204('0x1'),_0xa204('0x2')];function createListener(_0x5718a9,_0x3b9df3){return function(_0x821e69){_0x3b9df3[_0xa204('0x3')](_0x5718a9,_0x821e69);};}function removeListener(_0x3142d1,_0x12c076){return function(){FaxAccountEvents[_0xa204('0x4')](_0x3142d1,_0x12c076);};}exports['register']=function(_0x342fde){for(var _0x5b1c0a=0x0,_0x351bad=events[_0xa204('0x5')];_0x5b1c0a<_0x351bad;_0x5b1c0a++){var _0x5b0c50=events[_0x5b1c0a];var _0x2978b3=createListener('faxAccount:'+_0x5b0c50,_0x342fde);FaxAccountEvents['on'](_0x5b0c50,_0x2978b3);}};
\ No newline at end of file
+var _0x8559=['update','emit','removeListener','register','length','faxAccount:','./faxAccount.events','save','remove'];(function(_0xeaa8a3,_0x436de6){var _0x15f104=function(_0x3c21e5){while(--_0x3c21e5){_0xeaa8a3['push'](_0xeaa8a3['shift']());}};_0x15f104(++_0x436de6);}(_0x8559,0x9f));var _0x9855=function(_0x2044f4,_0x38cc12){_0x2044f4=_0x2044f4-0x0;var _0x80509=_0x8559[_0x2044f4];return _0x80509;};'use strict';var FaxAccountEvents=require(_0x9855('0x0'));var events=[_0x9855('0x1'),_0x9855('0x2'),_0x9855('0x3')];function createListener(_0x1ee02c,_0x238f71){return function(_0x468063){_0x238f71[_0x9855('0x4')](_0x1ee02c,_0x468063);};}function removeListener(_0x16e3cb,_0x2728b8){return function(){FaxAccountEvents[_0x9855('0x5')](_0x16e3cb,_0x2728b8);};}exports[_0x9855('0x6')]=function(_0xa3184b){for(var _0x23c588=0x0,_0x251001=events[_0x9855('0x7')];_0x23c588<_0x251001;_0x23c588++){var _0x4c864d=events[_0x23c588];var _0x2df743=createListener(_0x9855('0x8')+_0x4c864d,_0xa3184b);FaxAccountEvents['on'](_0x4c864d,_0x2df743);}};
\ No newline at end of file
index 050dd32..b5cf2a7 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(_0x2ccc6f,_0x31db36){var _0x1c6714=function(_0x4b55d0){while(--_0x4b55d0){_0x2ccc6f['push'](_0x2ccc6f['shift']());}};_0x1c6714(++_0x31db36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x283db7,_0x1b6f1b){var _0x6ef4b8=function(_0x2b8d61){while(--_0x2b8d61){_0x283db7['push'](_0x283db7['shift']());}};_0x6ef4b8(++_0x1b6f1b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 c58bbd4..f4ba8dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x228f=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x370f29,_0x577811){var _0x4399b9=function(_0x56b5f0){while(--_0x56b5f0){_0x370f29['push'](_0x370f29['shift']());}};_0x4399b9(++_0x577811);}(_0x228f,0x1e8));var _0xf228=function(_0x35daf4,_0x146dd6){_0x35daf4=_0x35daf4-0x0;var _0x4d6e0a=_0x228f[_0x35daf4];return _0x4d6e0a;};'use strict';var Sequelize=require('sequelize');module[_0xf228('0x0')]={'priority':{'type':Sequelize[_0xf228('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf228('0x2')],'allowNull':![],'defaultValue':_0xf228('0x3')},'appdata':{'type':Sequelize[_0xf228('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf228('0x5')}};
\ No newline at end of file
+var _0x0cc7=['*,*,*,*','sequelize','INTEGER','STRING','TEXT'];(function(_0x439d06,_0x366529){var _0x1e384f=function(_0x5e24b9){while(--_0x5e24b9){_0x439d06['push'](_0x439d06['shift']());}};_0x1e384f(++_0x366529);}(_0x0cc7,0x1b9));var _0x70cc=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x0cc7[_0xc8a931];return _0x28bd27;};'use strict';var Sequelize=require(_0x70cc('0x0'));module['exports']={'priority':{'type':Sequelize[_0x70cc('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x70cc('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x70cc('0x3')]()},'description':{'type':Sequelize[_0x70cc('0x2')]},'interval':{'type':Sequelize[_0x70cc('0x2')],'defaultValue':_0x70cc('0x4')}};
\ No newline at end of file
index ec42ad6..5dc51c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4ab=['sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','FaxApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x30fb53,_0xb7e79e){var _0x3c3aad=function(_0x147fe8){while(--_0x147fe8){_0x30fb53['push'](_0x30fb53['shift']());}};_0x3c3aad(++_0xb7e79e);}(_0xf4ab,0xdf));var _0xbf4a=function(_0x4c1ec2,_0x4f42b7){_0x4c1ec2=_0x4c1ec2-0x0;var _0x3f6f1c=_0xf4ab[_0x4c1ec2];return _0x3f6f1c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf4a('0x0'));var zipdir=require(_0xbf4a('0x1'));var jsonpatch=require(_0xbf4a('0x2'));var rp=require(_0xbf4a('0x3'));var moment=require(_0xbf4a('0x4'));var BPromise=require(_0xbf4a('0x5'));var Mustache=require(_0xbf4a('0x6'));var util=require(_0xbf4a('0x7'));var path=require('path');var sox=require(_0xbf4a('0x8'));var csv=require(_0xbf4a('0x9'));var ejs=require(_0xbf4a('0xa'));var fs=require('fs');var fs_extra=require(_0xbf4a('0xb'));var _=require(_0xbf4a('0xc'));var squel=require(_0xbf4a('0xd'));var crypto=require('crypto');var jsforce=require(_0xbf4a('0xe'));var deskjs=require(_0xbf4a('0xf'));var toCsv=require(_0xbf4a('0x9'));var querystring=require(_0xbf4a('0x10'));var Papa=require(_0xbf4a('0x11'));var Redis=require('ioredis');var authService=require(_0xbf4a('0x12'));var qs=require(_0xbf4a('0x13'));var as=require(_0xbf4a('0x14'));var hardwareService=require(_0xbf4a('0x15'));var logger=require('../../config/logger')(_0xbf4a('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbf4a('0x17'));var db=require(_0xbf4a('0x18'))['db'];function respondWithStatusCode(_0x5c3022,_0x1139f5){_0x1139f5=_0x1139f5||0xcc;return function(_0x46b361){if(_0x46b361){return _0x5c3022[_0xbf4a('0x19')](_0x1139f5);}return _0x5c3022[_0xbf4a('0x1a')](_0x1139f5)[_0xbf4a('0x1b')]();};}function respondWithResult(_0x2a6927,_0x37d9c0){_0x37d9c0=_0x37d9c0||0xc8;return function(_0x5d4823){if(_0x5d4823){return _0x2a6927[_0xbf4a('0x1a')](_0x37d9c0)[_0xbf4a('0x1c')](_0x5d4823);}};}function respondWithFilteredResult(_0x3a3e52,_0x2bb44d){return function(_0x22e5df){if(_0x22e5df){var _0x2a646e=typeof _0x2bb44d[_0xbf4a('0x1d')]===_0xbf4a('0x1e')&&typeof _0x2bb44d[_0xbf4a('0x1f')]==='undefined';var _0x592679=_0x22e5df[_0xbf4a('0x20')];var _0x1e8d09=_0x2a646e?0x0:_0x2bb44d[_0xbf4a('0x1d')];var _0x4b9957=_0x2a646e?_0x22e5df['count']:_0x2bb44d[_0xbf4a('0x1d')]+_0x2bb44d[_0xbf4a('0x1f')];var _0x104ef8;if(_0x4b9957>=_0x592679){_0x4b9957=_0x592679;_0x104ef8=0xc8;}else{_0x104ef8=0xce;}_0x3a3e52[_0xbf4a('0x1a')](_0x104ef8);return _0x3a3e52['set'](_0xbf4a('0x21'),_0x1e8d09+'-'+_0x4b9957+'/'+_0x592679)['json'](_0x22e5df);}return null;};}function patchUpdates(_0x11c47b){return function(_0x25ed3a){try{jsonpatch['apply'](_0x25ed3a,_0x11c47b,!![]);}catch(_0x4d1d9a){return BPromise[_0xbf4a('0x22')](_0x4d1d9a);}return _0x25ed3a[_0xbf4a('0x23')]();};}function saveUpdates(_0x5ef72c,_0x5c0026){return function(_0x3ef36f){if(_0x3ef36f){return _0x3ef36f[_0xbf4a('0x24')](_0x5ef72c)[_0xbf4a('0x25')](function(_0x199281){return _0x199281;});}return null;};}function removeEntity(_0x5d3a42,_0x496abb){return function(_0x41d8cc){if(_0x41d8cc){return _0x41d8cc[_0xbf4a('0x26')]()[_0xbf4a('0x25')](function(){_0x5d3a42[_0xbf4a('0x1a')](0xcc)[_0xbf4a('0x1b')]();});}};}function handleEntityNotFound(_0x5185b1,_0x54d816){return function(_0x41ee6b){if(!_0x41ee6b){_0x5185b1[_0xbf4a('0x19')](0x194);}return _0x41ee6b;};}function handleError(_0x1f90e3,_0x556644){_0x556644=_0x556644||0x1f4;return function(_0x5898c5){logger[_0xbf4a('0x27')](_0x5898c5[_0xbf4a('0x28')]);if(_0x5898c5[_0xbf4a('0x29')]){delete _0x5898c5['name'];}_0x1f90e3[_0xbf4a('0x1a')](_0x556644)[_0xbf4a('0x2a')](_0x5898c5);};}exports[_0xbf4a('0x2b')]=function(_0x22403d,_0x10bb78){var _0x2e4a45={},_0x37d086={},_0x1b3e5e={'count':0x0,'rows':[]};var _0x3bfc5c=_[_0xbf4a('0x2c')](db[_0xbf4a('0x2d')]['rawAttributes'],function(_0x37564b){return{'name':_0x37564b[_0xbf4a('0x2e')],'type':_0x37564b[_0xbf4a('0x2f')][_0xbf4a('0x30')]};});_0x37d086[_0xbf4a('0x31')]=_[_0xbf4a('0x2c')](_0x3bfc5c,_0xbf4a('0x29'));_0x37d086[_0xbf4a('0x32')]=_[_0xbf4a('0x33')](_0x22403d['query']);_0x37d086[_0xbf4a('0x34')]=_[_0xbf4a('0x35')](_0x37d086[_0xbf4a('0x31')],_0x37d086[_0xbf4a('0x32')]);_0x2e4a45[_0xbf4a('0x36')]=_[_0xbf4a('0x35')](_0x37d086['model'],qs[_0xbf4a('0x37')](_0x22403d[_0xbf4a('0x32')][_0xbf4a('0x37')]));_0x2e4a45[_0xbf4a('0x36')]=_0x2e4a45[_0xbf4a('0x36')][_0xbf4a('0x38')]?_0x2e4a45[_0xbf4a('0x36')]:_0x37d086[_0xbf4a('0x31')];if(!_0x22403d[_0xbf4a('0x32')][_0xbf4a('0x39')](_0xbf4a('0x3a'))){_0x2e4a45[_0xbf4a('0x1f')]=qs['limit'](_0x22403d[_0xbf4a('0x32')][_0xbf4a('0x1f')]);_0x2e4a45[_0xbf4a('0x1d')]=qs['offset'](_0x22403d[_0xbf4a('0x32')]['offset']);}_0x2e4a45[_0xbf4a('0x3b')]=qs[_0xbf4a('0x3c')](_0x22403d['query'][_0xbf4a('0x3c')]);_0x2e4a45[_0xbf4a('0x3d')]=qs[_0xbf4a('0x34')](_[_0xbf4a('0x3e')](_0x22403d[_0xbf4a('0x32')],_0x37d086[_0xbf4a('0x34')]),_0x3bfc5c);if(_0x22403d[_0xbf4a('0x32')]['filter']){_0x2e4a45[_0xbf4a('0x3d')]=_[_0xbf4a('0x3f')](_0x2e4a45['where'],{'$or':_['map'](_0x3bfc5c,function(_0xb08612){if(_0xb08612[_0xbf4a('0x2f')]!==_0xbf4a('0x40')){var _0xea8f62={};_0xea8f62[_0xb08612[_0xbf4a('0x29')]]={'$like':'%'+_0x22403d[_0xbf4a('0x32')]['filter']+'%'};return _0xea8f62;}})});}_0x2e4a45=_[_0xbf4a('0x3f')]({},_0x2e4a45,_0x22403d[_0xbf4a('0x41')]);var _0x1640f2={'where':_0x2e4a45['where']};return db['FaxApplication'][_0xbf4a('0x20')](_0x1640f2)[_0xbf4a('0x25')](function(_0x427da8){_0x1b3e5e[_0xbf4a('0x20')]=_0x427da8;if(_0x22403d['query'][_0xbf4a('0x42')]){_0x2e4a45[_0xbf4a('0x43')]=[{'all':!![]}];}return db[_0xbf4a('0x2d')][_0xbf4a('0x44')](_0x2e4a45);})[_0xbf4a('0x25')](function(_0x4163c7){_0x1b3e5e[_0xbf4a('0x45')]=_0x4163c7;return _0x1b3e5e;})[_0xbf4a('0x25')](respondWithFilteredResult(_0x10bb78,_0x2e4a45))['catch'](handleError(_0x10bb78,null));};exports[_0xbf4a('0x46')]=function(_0x30531c,_0x3f8815){var _0xa943d9={'raw':!![],'where':{'id':_0x30531c[_0xbf4a('0x47')]['id']}},_0x2b3e5b={};_0x2b3e5b[_0xbf4a('0x31')]=_['keys'](db[_0xbf4a('0x2d')][_0xbf4a('0x48')]);_0x2b3e5b[_0xbf4a('0x32')]=_[_0xbf4a('0x33')](_0x30531c[_0xbf4a('0x32')]);_0x2b3e5b[_0xbf4a('0x34')]=_[_0xbf4a('0x35')](_0x2b3e5b['model'],_0x2b3e5b[_0xbf4a('0x32')]);_0xa943d9['attributes']=_[_0xbf4a('0x35')](_0x2b3e5b[_0xbf4a('0x31')],qs[_0xbf4a('0x37')](_0x30531c[_0xbf4a('0x32')][_0xbf4a('0x37')]));_0xa943d9[_0xbf4a('0x36')]=_0xa943d9[_0xbf4a('0x36')][_0xbf4a('0x38')]?_0xa943d9[_0xbf4a('0x36')]:_0x2b3e5b[_0xbf4a('0x31')];if(_0x30531c[_0xbf4a('0x32')]['includeAll']){_0xa943d9[_0xbf4a('0x43')]=[{'all':!![]}];}_0xa943d9=_[_0xbf4a('0x3f')]({},_0xa943d9,_0x30531c['options']);return db[_0xbf4a('0x2d')][_0xbf4a('0x49')](_0xa943d9)[_0xbf4a('0x25')](handleEntityNotFound(_0x3f8815,null))[_0xbf4a('0x25')](respondWithResult(_0x3f8815,null))[_0xbf4a('0x4a')](handleError(_0x3f8815,null));};exports[_0xbf4a('0x4b')]=function(_0x10dadf,_0x3cd3d5){return db[_0xbf4a('0x2d')]['create'](_0x10dadf[_0xbf4a('0x4c')],{})[_0xbf4a('0x25')](respondWithResult(_0x3cd3d5,0xc9))[_0xbf4a('0x4a')](handleError(_0x3cd3d5,null));};exports[_0xbf4a('0x24')]=function(_0x2755b7,_0x1ca4e4){if(_0x2755b7['body']['id']){delete _0x2755b7['body']['id'];}return db['FaxApplication']['find']({'where':{'id':_0x2755b7[_0xbf4a('0x47')]['id']}})[_0xbf4a('0x25')](handleEntityNotFound(_0x1ca4e4,null))['then'](saveUpdates(_0x2755b7[_0xbf4a('0x4c')],null))[_0xbf4a('0x25')](respondWithResult(_0x1ca4e4,null))[_0xbf4a('0x4a')](handleError(_0x1ca4e4,null));};exports['destroy']=function(_0x2de1be,_0x379f12){return db[_0xbf4a('0x2d')][_0xbf4a('0x49')]({'where':{'id':_0x2de1be[_0xbf4a('0x47')]['id']}})['then'](handleEntityNotFound(_0x379f12,null))[_0xbf4a('0x25')](removeEntity(_0x379f12,null))[_0xbf4a('0x4a')](handleError(_0x379f12,null));};
\ No newline at end of file
+var _0xdb01=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xcf2163,_0x1ee072){var _0x221468=function(_0x2d9d4f){while(--_0x2d9d4f){_0xcf2163['push'](_0xcf2163['shift']());}};_0x221468(++_0x1ee072);}(_0xdb01,0x156));var _0x1db0=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0xdb01[_0x15cdcb];return _0x37b069;};'use strict';var emlformat=require(_0x1db0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1db0('0x1'));var jsonpatch=require(_0x1db0('0x2'));var rp=require(_0x1db0('0x3'));var moment=require(_0x1db0('0x4'));var BPromise=require(_0x1db0('0x5'));var Mustache=require('mustache');var util=require(_0x1db0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1db0('0x7'));var ejs=require(_0x1db0('0x8'));var fs=require('fs');var fs_extra=require(_0x1db0('0x9'));var _=require(_0x1db0('0xa'));var squel=require(_0x1db0('0xb'));var crypto=require(_0x1db0('0xc'));var jsforce=require(_0x1db0('0xd'));var deskjs=require(_0x1db0('0xe'));var toCsv=require(_0x1db0('0x7'));var querystring=require('querystring');var Papa=require(_0x1db0('0xf'));var Redis=require(_0x1db0('0x10'));var authService=require(_0x1db0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1db0('0x12'));var hardwareService=require(_0x1db0('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x1db0('0x14'));var config=require(_0x1db0('0x15'));var licenseUtil=require(_0x1db0('0x16'));var db=require(_0x1db0('0x17'))['db'];function respondWithStatusCode(_0x2be872,_0x5877dc){_0x5877dc=_0x5877dc||0xcc;return function(_0x598fdc){if(_0x598fdc){return _0x2be872[_0x1db0('0x18')](_0x5877dc);}return _0x2be872[_0x1db0('0x19')](_0x5877dc)['end']();};}function respondWithResult(_0x6b52f3,_0x702e36){_0x702e36=_0x702e36||0xc8;return function(_0x37e948){if(_0x37e948){return _0x6b52f3['status'](_0x702e36)[_0x1db0('0x1a')](_0x37e948);}};}function respondWithFilteredResult(_0x17f7ea,_0x20ce1b){return function(_0x158819){if(_0x158819){var _0x54b2ac=typeof _0x20ce1b[_0x1db0('0x1b')]===_0x1db0('0x1c')&&typeof _0x20ce1b[_0x1db0('0x1d')]===_0x1db0('0x1c');var _0x10f60b=_0x158819['count'];var _0x391375=_0x54b2ac?0x0:_0x20ce1b['offset'];var _0x56642c=_0x54b2ac?_0x158819[_0x1db0('0x1e')]:_0x20ce1b[_0x1db0('0x1b')]+_0x20ce1b[_0x1db0('0x1d')];var _0xf932e;if(_0x56642c>=_0x10f60b){_0x56642c=_0x10f60b;_0xf932e=0xc8;}else{_0xf932e=0xce;}_0x17f7ea[_0x1db0('0x19')](_0xf932e);return _0x17f7ea[_0x1db0('0x1f')](_0x1db0('0x20'),_0x391375+'-'+_0x56642c+'/'+_0x10f60b)[_0x1db0('0x1a')](_0x158819);}return null;};}function patchUpdates(_0x38e19a){return function(_0x50563f){try{jsonpatch['apply'](_0x50563f,_0x38e19a,!![]);}catch(_0x37b371){return BPromise[_0x1db0('0x21')](_0x37b371);}return _0x50563f['save']();};}function saveUpdates(_0xf8cb38,_0x206240){return function(_0x452312){if(_0x452312){return _0x452312[_0x1db0('0x22')](_0xf8cb38)[_0x1db0('0x23')](function(_0x4019ac){return _0x4019ac;});}return null;};}function removeEntity(_0x2a83bd,_0x1ad7a2){return function(_0x2a742a){if(_0x2a742a){return _0x2a742a[_0x1db0('0x24')]()[_0x1db0('0x23')](function(){_0x2a83bd[_0x1db0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x220d22,_0x5301ee){return function(_0x7d5c05){if(!_0x7d5c05){_0x220d22['sendStatus'](0x194);}return _0x7d5c05;};}function handleError(_0x288108,_0x50be63){_0x50be63=_0x50be63||0x1f4;return function(_0xfe7360){logger[_0x1db0('0x25')](_0xfe7360[_0x1db0('0x26')]);if(_0xfe7360[_0x1db0('0x27')]){delete _0xfe7360[_0x1db0('0x27')];}_0x288108[_0x1db0('0x19')](_0x50be63)[_0x1db0('0x28')](_0xfe7360);};}exports[_0x1db0('0x29')]=function(_0x4d38b2,_0x1baed4){var _0x1a8dc6={},_0x3ff24c={},_0x28af5d={'count':0x0,'rows':[]};var _0x5e6c1f=_[_0x1db0('0x2a')](db[_0x1db0('0x2b')][_0x1db0('0x2c')],function(_0x3ff889){return{'name':_0x3ff889['fieldName'],'type':_0x3ff889[_0x1db0('0x2d')][_0x1db0('0x2e')]};});_0x3ff24c[_0x1db0('0x2f')]=_['map'](_0x5e6c1f,'name');_0x3ff24c[_0x1db0('0x30')]=_[_0x1db0('0x31')](_0x4d38b2[_0x1db0('0x30')]);_0x3ff24c[_0x1db0('0x32')]=_[_0x1db0('0x33')](_0x3ff24c['model'],_0x3ff24c[_0x1db0('0x30')]);_0x1a8dc6['attributes']=_['intersection'](_0x3ff24c[_0x1db0('0x2f')],qs[_0x1db0('0x34')](_0x4d38b2[_0x1db0('0x30')][_0x1db0('0x34')]));_0x1a8dc6[_0x1db0('0x35')]=_0x1a8dc6[_0x1db0('0x35')][_0x1db0('0x36')]?_0x1a8dc6['attributes']:_0x3ff24c[_0x1db0('0x2f')];if(!_0x4d38b2[_0x1db0('0x30')]['hasOwnProperty'](_0x1db0('0x37'))){_0x1a8dc6['limit']=qs[_0x1db0('0x1d')](_0x4d38b2[_0x1db0('0x30')]['limit']);_0x1a8dc6['offset']=qs[_0x1db0('0x1b')](_0x4d38b2['query'][_0x1db0('0x1b')]);}_0x1a8dc6[_0x1db0('0x38')]=qs[_0x1db0('0x39')](_0x4d38b2[_0x1db0('0x30')][_0x1db0('0x39')]);_0x1a8dc6[_0x1db0('0x3a')]=qs[_0x1db0('0x32')](_[_0x1db0('0x3b')](_0x4d38b2[_0x1db0('0x30')],_0x3ff24c['filters']),_0x5e6c1f);if(_0x4d38b2[_0x1db0('0x30')][_0x1db0('0x3c')]){_0x1a8dc6[_0x1db0('0x3a')]=_[_0x1db0('0x3d')](_0x1a8dc6['where'],{'$or':_['map'](_0x5e6c1f,function(_0x561f90){if(_0x561f90['type']!=='VIRTUAL'){var _0x44a5da={};_0x44a5da[_0x561f90[_0x1db0('0x27')]]={'$like':'%'+_0x4d38b2[_0x1db0('0x30')][_0x1db0('0x3c')]+'%'};return _0x44a5da;}})});}_0x1a8dc6=_[_0x1db0('0x3d')]({},_0x1a8dc6,_0x4d38b2[_0x1db0('0x3e')]);var _0xfda9b6={'where':_0x1a8dc6[_0x1db0('0x3a')]};return db[_0x1db0('0x2b')][_0x1db0('0x1e')](_0xfda9b6)['then'](function(_0x56f835){_0x28af5d[_0x1db0('0x1e')]=_0x56f835;if(_0x4d38b2[_0x1db0('0x30')][_0x1db0('0x3f')]){_0x1a8dc6[_0x1db0('0x40')]=[{'all':!![]}];}return db['FaxApplication'][_0x1db0('0x41')](_0x1a8dc6);})[_0x1db0('0x23')](function(_0x4544d5){_0x28af5d[_0x1db0('0x42')]=_0x4544d5;return _0x28af5d;})['then'](respondWithFilteredResult(_0x1baed4,_0x1a8dc6))[_0x1db0('0x43')](handleError(_0x1baed4,null));};exports[_0x1db0('0x44')]=function(_0x56c7cb,_0x33799a){var _0x40bdb2={'raw':!![],'where':{'id':_0x56c7cb['params']['id']}},_0x39b51f={};_0x39b51f['model']=_['keys'](db[_0x1db0('0x2b')][_0x1db0('0x2c')]);_0x39b51f[_0x1db0('0x30')]=_['keys'](_0x56c7cb['query']);_0x39b51f[_0x1db0('0x32')]=_[_0x1db0('0x33')](_0x39b51f[_0x1db0('0x2f')],_0x39b51f[_0x1db0('0x30')]);_0x40bdb2[_0x1db0('0x35')]=_[_0x1db0('0x33')](_0x39b51f['model'],qs[_0x1db0('0x34')](_0x56c7cb[_0x1db0('0x30')]['fields']));_0x40bdb2[_0x1db0('0x35')]=_0x40bdb2[_0x1db0('0x35')]['length']?_0x40bdb2[_0x1db0('0x35')]:_0x39b51f[_0x1db0('0x2f')];if(_0x56c7cb[_0x1db0('0x30')][_0x1db0('0x3f')]){_0x40bdb2[_0x1db0('0x40')]=[{'all':!![]}];}_0x40bdb2=_[_0x1db0('0x3d')]({},_0x40bdb2,_0x56c7cb['options']);return db[_0x1db0('0x2b')][_0x1db0('0x45')](_0x40bdb2)[_0x1db0('0x23')](handleEntityNotFound(_0x33799a,null))[_0x1db0('0x23')](respondWithResult(_0x33799a,null))[_0x1db0('0x43')](handleError(_0x33799a,null));};exports['create']=function(_0xae5076,_0x22537c){return db[_0x1db0('0x2b')][_0x1db0('0x46')](_0xae5076[_0x1db0('0x47')],{})[_0x1db0('0x23')](respondWithResult(_0x22537c,0xc9))[_0x1db0('0x43')](handleError(_0x22537c,null));};exports[_0x1db0('0x22')]=function(_0x18c867,_0x10f57d){if(_0x18c867['body']['id']){delete _0x18c867['body']['id'];}return db[_0x1db0('0x2b')]['find']({'where':{'id':_0x18c867[_0x1db0('0x48')]['id']}})[_0x1db0('0x23')](handleEntityNotFound(_0x10f57d,null))['then'](saveUpdates(_0x18c867['body'],null))[_0x1db0('0x23')](respondWithResult(_0x10f57d,null))['catch'](handleError(_0x10f57d,null));};exports['destroy']=function(_0x3845ea,_0x5dfb94){return db[_0x1db0('0x2b')][_0x1db0('0x45')]({'where':{'id':_0x3845ea[_0x1db0('0x48')]['id']}})[_0x1db0('0x23')](handleEntityNotFound(_0x5dfb94,null))[_0x1db0('0x23')](removeEntity(_0x5dfb94,null))['catch'](handleError(_0x5dfb94,null));};
\ No newline at end of file
index 73a7966..7498173 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d93=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','fax_applications','utf8mb4_unicode_ci'];(function(_0x44eff,_0x1a8216){var _0x10caf4=function(_0x379d5c){while(--_0x379d5c){_0x44eff['push'](_0x44eff['shift']());}};_0x10caf4(++_0x1a8216);}(_0x4d93,0x12b));var _0x34d9=function(_0x3fb19f,_0x28bb89){_0x3fb19f=_0x3fb19f-0x0;var _0x4607d2=_0x4d93[_0x3fb19f];return _0x4607d2;};'use strict';var _=require(_0x34d9('0x0'));var util=require(_0x34d9('0x1'));var logger=require(_0x34d9('0x2'))(_0x34d9('0x3'));var moment=require(_0x34d9('0x4'));var BPromise=require(_0x34d9('0x5'));var rp=require(_0x34d9('0x6'));var fs=require('fs');var path=require(_0x34d9('0x7'));var rimraf=require(_0x34d9('0x8'));var config=require(_0x34d9('0x9'));var attributes=require(_0x34d9('0xa'));module['exports']=function(_0x15db53,_0x44c657){return _0x15db53['define']('FaxApplication',attributes,{'tableName':_0x34d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x34d9('0xc')});};
\ No newline at end of file
+var _0x351a=['exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes'];(function(_0x547e20,_0x284545){var _0x359171=function(_0x590250){while(--_0x590250){_0x547e20['push'](_0x547e20['shift']());}};_0x359171(++_0x284545);}(_0x351a,0x19b));var _0xa351=function(_0x2064b6,_0x49272f){_0x2064b6=_0x2064b6-0x0;var _0x1ad489=_0x351a[_0x2064b6];return _0x1ad489;};'use strict';var _=require(_0xa351('0x0'));var util=require(_0xa351('0x1'));var logger=require(_0xa351('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa351('0x3'));var rp=require(_0xa351('0x4'));var fs=require('fs');var path=require(_0xa351('0x5'));var rimraf=require(_0xa351('0x6'));var config=require(_0xa351('0x7'));var attributes=require(_0xa351('0x8'));module[_0xa351('0x9')]=function(_0xb98fe,_0x553bec){return _0xb98fe[_0xa351('0xa')](_0xa351('0xb'),attributes,{'tableName':_0xa351('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa351('0xd'),'collate':_0xa351('0xe')});};
\ No newline at end of file
index 1b1aabb..d81dac9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5719=['request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','FaxApplication,\x20%s,\x20%s','message','result','body','options','raw','where','limit','UpdateFaxApplication','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info'];(function(_0x1a2438,_0x5938bc){var _0x851991=function(_0x1e7f66){while(--_0x1e7f66){_0x1a2438['push'](_0x1a2438['shift']());}};_0x851991(++_0x5938bc);}(_0x5719,0x101));var _0x9571=function(_0x569295,_0xddb09b){_0x569295=_0x569295-0x0;var _0x2fde13=_0x5719[_0x569295];return _0x2fde13;};'use strict';var _=require('lodash');var util=require(_0x9571('0x0'));var moment=require(_0x9571('0x1'));var BPromise=require(_0x9571('0x2'));var rs=require(_0x9571('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9571('0x4'))['db'];var utils=require(_0x9571('0x5'));var logger=require('../../config/logger')(_0x9571('0x6'));var config=require('../../config/environment');var jayson=require(_0x9571('0x7'));var client=jayson[_0x9571('0x8')][_0x9571('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x351558,_0x2f369b,_0x185f62){return new BPromise(function(_0x244612,_0x4d071d){return client[_0x9571('0xa')](_0x351558,_0x185f62)[_0x9571('0xb')](function(_0x1f8a7e){logger[_0x9571('0xc')]('FaxApplication,\x20%s,\x20%s',_0x2f369b,_0x9571('0xd'));logger[_0x9571('0xe')](_0x9571('0xf'),_0x2f369b,'request\x20sent',JSON[_0x9571('0x10')](_0x1f8a7e));if(_0x1f8a7e[_0x9571('0x11')]){if(_0x1f8a7e[_0x9571('0x11')]['code']===0x1f4){logger[_0x9571('0x11')](_0x9571('0x12'),_0x2f369b,_0x1f8a7e[_0x9571('0x11')]['message']);return _0x4d071d(_0x1f8a7e[_0x9571('0x11')][_0x9571('0x13')]);}logger[_0x9571('0x11')](_0x9571('0x12'),_0x2f369b,_0x1f8a7e['error']['message']);return _0x244612(_0x1f8a7e['error']['message']);}else{logger['info'](_0x9571('0x12'),_0x2f369b,'request\x20sent');_0x244612(_0x1f8a7e[_0x9571('0x14')][_0x9571('0x13')]);}})['catch'](function(_0x3f3f06){logger[_0x9571('0x11')](_0x9571('0x12'),_0x2f369b,_0x3f3f06);_0x4d071d(_0x3f3f06);});});}exports['UpdateFaxApplication']=function(_0x41a738){var _0x4005da=this;return new Promise(function(_0x3df693,_0x30bc9b){return db['FaxApplication']['update'](_0x41a738[_0x9571('0x15')],{'raw':_0x41a738[_0x9571('0x16')]?_0x41a738[_0x9571('0x16')][_0x9571('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41a738[_0x9571('0x16')]?_0x41a738[_0x9571('0x16')][_0x9571('0x18')]||null:null,'attributes':_0x41a738[_0x9571('0x16')]?_0x41a738['options']['attributes']||null:null,'limit':_0x41a738[_0x9571('0x16')]?_0x41a738[_0x9571('0x16')][_0x9571('0x19')]||null:null})[_0x9571('0xb')](function(_0x230e90){logger[_0x9571('0xc')](_0x9571('0x1a'),_0x41a738);logger[_0x9571('0xe')](_0x9571('0x1a'),_0x41a738,JSON[_0x9571('0x10')](_0x230e90));_0x3df693(_0x230e90);})['catch'](function(_0x3b192f){logger[_0x9571('0x11')](_0x9571('0x1a'),_0x3b192f[_0x9571('0x13')],_0x41a738);_0x30bc9b(_0x4005da[_0x9571('0x11')](0x1f4,_0x3b192f[_0x9571('0x13')]));});});};
\ No newline at end of file
+var _0x939d=['then','info','FaxApplication,\x20%s,\x20%s','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','where','attributes','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x939d,0xcc));var _0xd939=function(_0x14328f,_0x396cf7){_0x14328f=_0x14328f-0x0;var _0x53aaab=_0x939d[_0x14328f];return _0x53aaab;};'use strict';var _=require(_0xd939('0x0'));var util=require(_0xd939('0x1'));var moment=require('moment');var BPromise=require(_0xd939('0x2'));var rs=require(_0xd939('0x3'));var fs=require('fs');var Redis=require(_0xd939('0x4'));var db=require(_0xd939('0x5'))['db'];var utils=require(_0xd939('0x6'));var logger=require(_0xd939('0x7'))(_0xd939('0x8'));var config=require(_0xd939('0x9'));var jayson=require(_0xd939('0xa'));var client=jayson[_0xd939('0xb')][_0xd939('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x51f38f,_0x6db92c,_0x559294){return new BPromise(function(_0x451a54,_0x2c8e98){return client['request'](_0x51f38f,_0x559294)[_0xd939('0xd')](function(_0x39e302){logger[_0xd939('0xe')](_0xd939('0xf'),_0x6db92c,'request\x20sent');logger['debug'](_0xd939('0x10'),_0x6db92c,_0xd939('0x11'),JSON[_0xd939('0x12')](_0x39e302));if(_0x39e302[_0xd939('0x13')]){if(_0x39e302[_0xd939('0x13')]['code']===0x1f4){logger[_0xd939('0x13')](_0xd939('0xf'),_0x6db92c,_0x39e302[_0xd939('0x13')][_0xd939('0x14')]);return _0x2c8e98(_0x39e302[_0xd939('0x13')][_0xd939('0x14')]);}logger['error'](_0xd939('0xf'),_0x6db92c,_0x39e302[_0xd939('0x13')]['message']);return _0x451a54(_0x39e302[_0xd939('0x13')]['message']);}else{logger[_0xd939('0xe')]('FaxApplication,\x20%s,\x20%s',_0x6db92c,_0xd939('0x11'));_0x451a54(_0x39e302[_0xd939('0x15')][_0xd939('0x14')]);}})[_0xd939('0x16')](function(_0x32b16c){logger['error'](_0xd939('0xf'),_0x6db92c,_0x32b16c);_0x2c8e98(_0x32b16c);});});}exports[_0xd939('0x17')]=function(_0x422259){var _0xf498c6=this;return new Promise(function(_0xefc62a,_0x8cfcc6){return db[_0xd939('0x18')][_0xd939('0x19')](_0x422259[_0xd939('0x1a')],{'raw':_0x422259[_0xd939('0x1b')]?_0x422259[_0xd939('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x422259['options']?_0x422259[_0xd939('0x1b')][_0xd939('0x1c')]||null:null,'attributes':_0x422259[_0xd939('0x1b')]?_0x422259[_0xd939('0x1b')][_0xd939('0x1d')]||null:null,'limit':_0x422259[_0xd939('0x1b')]?_0x422259[_0xd939('0x1b')]['limit']||null:null})['then'](function(_0x455bfe){logger[_0xd939('0xe')](_0xd939('0x17'),_0x422259);logger[_0xd939('0x1e')](_0xd939('0x17'),_0x422259,JSON[_0xd939('0x12')](_0x455bfe));_0xefc62a(_0x455bfe);})['catch'](function(_0x105fc4){logger[_0xd939('0x13')](_0xd939('0x17'),_0x105fc4[_0xd939('0x14')],_0x422259);_0x8cfcc6(_0xf498c6[_0xd939('0x13')](0x1f4,_0x105fc4[_0xd939('0x14')]));});});};
\ No newline at end of file
index 09e6e91..64fcd44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x3d4c66,_0x2bce69){var _0x3c89d3=function(_0x1b3d34){while(--_0x1b3d34){_0x3d4c66['push'](_0x3d4c66['shift']());}};_0x3c89d3(++_0x2bce69);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0xd')]('/',auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);module[_0x0baf('0x13')]=router;
\ No newline at end of file
+var _0x8603=['../../components/interaction/service','./faxApplication.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x45ee03,_0x2f5319){var _0x13d535=function(_0x391904){while(--_0x391904){_0x45ee03['push'](_0x45ee03['shift']());}};_0x13d535(++_0x2f5319);}(_0x8603,0x190));var _0x3860=function(_0x2abb22,_0x29bcd0){_0x2abb22=_0x2abb22-0x0;var _0x569662=_0x8603[_0x2abb22];return _0x569662;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router;
\ No newline at end of file
index faeb24d..fb1fa26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd763=['ENUM','out','DATE','STRING'];(function(_0x5b04c0,_0x59d28f){var _0x32fe29=function(_0x2560a7){while(--_0x2560a7){_0x5b04c0['push'](_0x5b04c0['shift']());}};_0x32fe29(++_0x59d28f);}(_0xd763,0x17e));var _0x3d76=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xd763[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3d76('0x0')]},'disposition':{'type':Sequelize[_0x3d76('0x1')]},'secondDisposition':{'type':Sequelize[_0x3d76('0x1')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3d76('0x1')]},'read1stAt':{'type':Sequelize[_0x3d76('0x0')]},'fax':{'type':Sequelize[_0x3d76('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x3d76('0x2')]('in',_0x3d76('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3d76('0x0')]},'lastMsgDirection':{'type':Sequelize[_0x3d76('0x2')]('in',_0x3d76('0x3')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xa7be=['DATE','STRING','ENUM','out'];(function(_0x2fd343,_0x3ce90e){var _0x46e25e=function(_0x19fd7f){while(--_0x19fd7f){_0x2fd343['push'](_0x2fd343['shift']());}};_0x46e25e(++_0x3ce90e);}(_0xa7be,0xfc));var _0xea7b=function(_0x2c333a,_0x143247){_0x2c333a=_0x2c333a-0x0;var _0x590547=_0xa7be[_0x2c333a];return _0x590547;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xea7b('0x0')]},'disposition':{'type':Sequelize[_0xea7b('0x1')]},'secondDisposition':{'type':Sequelize[_0xea7b('0x1')]},'thirdDisposition':{'type':Sequelize[_0xea7b('0x1')]},'note':{'type':Sequelize[_0xea7b('0x1')]},'read1stAt':{'type':Sequelize[_0xea7b('0x0')]},'fax':{'type':Sequelize[_0xea7b('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xea7b('0x2')]('in',_0xea7b('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xea7b('0x3')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 0f40d4c..d732116 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb955=['agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','merge','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','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','all','rows','show','params','includeAll','create','describe','addMessage','ids','omit','getMessages','FaxMessage','nolimit','FaxInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','removeTags','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','push','Attachment','Messages','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','log','err','sendStatus','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./faxInteraction.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','send','Users','map','fullname','TagIds','Tags','forEach','catch','waiting','talking','closed','UserId','answered','unmanaged','total','index','FaxInteraction','rawAttributes','fieldName','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','select','field','color','from','tools_tags','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','isEmpty','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role'];(function(_0x528171,_0x1922d9){var _0x3a75ef=function(_0x145efb){while(--_0x145efb){_0x528171['push'](_0x528171['shift']());}};_0x3a75ef(++_0x1922d9);}(_0xb955,0x123));var _0x5b95=function(_0x19536e,_0x4fc086){_0x19536e=_0x19536e-0x0;var _0x36aeed=_0xb955[_0x19536e];return _0x36aeed;};'use strict';var emlformat=require(_0x5b95('0x0'));var rimraf=require(_0x5b95('0x1'));var zipdir=require(_0x5b95('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5b95('0x3'));var BPromise=require(_0x5b95('0x4'));var Mustache=require(_0x5b95('0x5'));var util=require(_0x5b95('0x6'));var path=require(_0x5b95('0x7'));var sox=require(_0x5b95('0x8'));var csv=require(_0x5b95('0x9'));var ejs=require(_0x5b95('0xa'));var fs=require('fs');var fs_extra=require(_0x5b95('0xb'));var _=require(_0x5b95('0xc'));var squel=require('squel');var crypto=require(_0x5b95('0xd'));var jsforce=require(_0x5b95('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5b95('0xf'));var Papa=require(_0x5b95('0x10'));var Redis=require(_0x5b95('0x11'));var authService=require(_0x5b95('0x12'));var qs=require(_0x5b95('0x13'));var as=require(_0x5b95('0x14'));var hardwareService=require(_0x5b95('0x15'));var logger=require('../../config/logger')(_0x5b95('0x16'));var utils=require('../../config/utils');var config=require(_0x5b95('0x17'));var licenseUtil=require(_0x5b95('0x18'));var db=require(_0x5b95('0x19'))['db'];config['redis']=_[_0x5b95('0x1a')](config[_0x5b95('0x1b')],{'host':_0x5b95('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5b95('0x1b')]));require(_0x5b95('0x1d'))[_0x5b95('0x1e')](socket);function respondWithStatusCode(_0x51b465,_0x248bc1){_0x248bc1=_0x248bc1||0xcc;return function(_0x16f6c7){if(_0x16f6c7){return _0x51b465['sendStatus'](_0x248bc1);}return _0x51b465['status'](_0x248bc1)[_0x5b95('0x1f')]();};}function respondWithResult(_0x4f614b,_0x363a31){_0x363a31=_0x363a31||0xc8;return function(_0x1d38e8){if(_0x1d38e8){return _0x4f614b[_0x5b95('0x20')](_0x363a31)[_0x5b95('0x21')](_0x1d38e8);}};}function respondWithFilteredResult(_0x461859,_0x4ce42d){return function(_0x47e7f8){if(_0x47e7f8){var _0x1be1fe=typeof _0x4ce42d[_0x5b95('0x22')]===_0x5b95('0x23')&&typeof _0x4ce42d[_0x5b95('0x24')]==='undefined';var _0x33424b=_0x47e7f8['count'];var _0x933041=_0x1be1fe?0x0:_0x4ce42d[_0x5b95('0x22')];var _0x49c4d7=_0x1be1fe?_0x47e7f8[_0x5b95('0x25')]:_0x4ce42d[_0x5b95('0x22')]+_0x4ce42d[_0x5b95('0x24')];var _0x2c5814;if(_0x49c4d7>=_0x33424b){_0x49c4d7=_0x33424b;_0x2c5814=0xc8;}else{_0x2c5814=0xce;}_0x461859['status'](_0x2c5814);return _0x461859[_0x5b95('0x26')](_0x5b95('0x27'),_0x933041+'-'+_0x49c4d7+'/'+_0x33424b)['json'](_0x47e7f8);}return null;};}function patchUpdates(_0x5d4a8e){return function(_0x278cb6){try{jsonpatch[_0x5b95('0x28')](_0x278cb6,_0x5d4a8e,!![]);}catch(_0x11b9d1){return BPromise[_0x5b95('0x29')](_0x11b9d1);}return _0x278cb6[_0x5b95('0x2a')]();};}function saveUpdates(_0x358bcf,_0x141a47){return function(_0x15e530){if(_0x15e530){return _0x15e530[_0x5b95('0x2b')](_0x358bcf)['then'](function(_0x533aa4){return _0x533aa4;});}return null;};}function removeEntity(_0x1e083a,_0x2b060){return function(_0x202331){if(_0x202331){return _0x202331[_0x5b95('0x2c')]()[_0x5b95('0x2d')](function(){_0x1e083a[_0x5b95('0x20')](0xcc)[_0x5b95('0x1f')]();});}};}function handleEntityNotFound(_0x1e277a,_0x58433c){return function(_0x3b2aaa){if(!_0x3b2aaa){_0x1e277a['sendStatus'](0x194);}return _0x3b2aaa;};}function handleError(_0x11406b,_0x3d8afc){_0x3d8afc=_0x3d8afc||0x1f4;return function(_0x533d70){logger[_0x5b95('0x2e')](_0x533d70[_0x5b95('0x2f')]);if(_0x533d70['name']){delete _0x533d70['name'];}_0x11406b[_0x5b95('0x20')](_0x3d8afc)[_0x5b95('0x30')](_0x533d70);};}function getInteractionUsers(_0x11c879,_0x4f8001){return new BPromise(function(_0x3c5264,_0xc7ccf8){try{if(_0x4f8001[_0x11c879['id']]){_0x11c879[_0x5b95('0x31')]=_[_0x5b95('0x32')](_0x4f8001[_0x11c879['id']],function(_0x476f46){return{'id':_0x476f46['id'],'fullname':_0x476f46[_0x5b95('0x33')]};});}}catch(_0x588d08){_0xc7ccf8(_0x588d08);}_0x3c5264(_0x11c879);});}function getInteractionTags(_0x453644,_0x2a91bc){return new BPromise(function(_0x64afdd,_0x2e796c){try{if(_0x453644[_0x5b95('0x34')]){_0x453644[_0x5b95('0x35')]=[];_0x453644[_0x5b95('0x34')]['split'](',')[_0x5b95('0x36')](function(_0x58d62b){_0x453644[_0x5b95('0x35')]['push'](_0x2a91bc[_0x58d62b]);});}delete _0x453644[_0x5b95('0x34')];}catch(_0x1a491d){_0x2e796c(_0x1a491d);}_0x64afdd(_0x453644);});}function updateFaxInteraction(_0x43e336,_0x4babcc,_0x2f673d){return new BPromise(function(_0x11ca8e,_0x46d5d5){return getInteractionUsers(_0x43e336,_0x2f673d)[_0x5b95('0x2d')](function(_0x2003a3){return getInteractionTags(_0x2003a3,_0x4babcc);})[_0x5b95('0x2d')](function(_0x2a440f){return getStateInteraction(_0x2a440f);})['then'](function(_0x309869){_0x11ca8e(_0x309869);})[_0x5b95('0x37')](function(_0x4cf916){_0x46d5d5(_0x4cf916);});});}function getStateInteraction(_0xe451da){return new BPromise(function(_0x1f5c10){_0xe451da[_0x5b95('0x38')]=0x0;_0xe451da[_0x5b95('0x39')]=0x0;_0xe451da['answered']=0x0;_0xe451da['unmanaged']=0x0;_0xe451da['total']=0x0;if(!_0xe451da[_0x5b95('0x3a')]&&!_0xe451da['UserId']){_0xe451da[_0x5b95('0x38')]+=0x1;}if(!_0xe451da[_0x5b95('0x3a')]&&_0xe451da[_0x5b95('0x3b')]){_0xe451da[_0x5b95('0x39')]+=0x1;if(_0xe451da[_0x5b95('0x38')]){_0xe451da['waiting']-=0x1;}}if(_0xe451da['closed']&&_0xe451da[_0x5b95('0x3b')]){_0xe451da[_0x5b95('0x3c')]+=0x1;if(_0xe451da[_0x5b95('0x39')]){_0xe451da[_0x5b95('0x39')]-=0x1;}}if(_0xe451da[_0x5b95('0x3a')]&&!_0xe451da[_0x5b95('0x3b')]){_0xe451da[_0x5b95('0x3d')]+=0x1;if(_0xe451da[_0x5b95('0x38')]){_0xe451da[_0x5b95('0x38')]-=0x1;}}_0xe451da[_0x5b95('0x3e')]+=0x1;_0x1f5c10(_0xe451da);});}exports[_0x5b95('0x3f')]=function(_0x209fdb,_0x4ed972){var _0x2ffcc9={},_0x1fe2f8={},_0x3f5bee={'count':0x0,'rows':[]};var _0x2ff088=_[_0x5b95('0x32')](db[_0x5b95('0x40')][_0x5b95('0x41')],function(_0x57d535){return{'name':_0x57d535[_0x5b95('0x42')],'type':_0x57d535['type'][_0x5b95('0x43')]};});_0x1fe2f8[_0x5b95('0x44')]=_[_0x5b95('0x32')](_0x2ff088,_0x5b95('0x45'));_0x1fe2f8[_0x5b95('0x46')]=_[_0x5b95('0x47')](_0x209fdb['query']);_0x1fe2f8['filters']=_[_0x5b95('0x48')](_0x1fe2f8[_0x5b95('0x44')],_0x1fe2f8[_0x5b95('0x46')]);_0x2ffcc9[_0x5b95('0x49')]=_[_0x5b95('0x48')](_0x1fe2f8[_0x5b95('0x44')],qs['fields'](_0x209fdb[_0x5b95('0x46')][_0x5b95('0x4a')]));_0x2ffcc9['attributes']=_0x2ffcc9[_0x5b95('0x49')][_0x5b95('0x4b')]?_0x2ffcc9[_0x5b95('0x49')]:_0x1fe2f8[_0x5b95('0x44')];if(!_0x209fdb[_0x5b95('0x46')][_0x5b95('0x4c')]('nolimit')){_0x2ffcc9[_0x5b95('0x24')]=qs[_0x5b95('0x24')](_0x209fdb[_0x5b95('0x46')][_0x5b95('0x24')]);_0x2ffcc9[_0x5b95('0x22')]=qs[_0x5b95('0x22')](_0x209fdb[_0x5b95('0x46')][_0x5b95('0x22')]);}_0x2ffcc9[_0x5b95('0x4d')]=qs[_0x5b95('0x4e')](_0x209fdb[_0x5b95('0x46')][_0x5b95('0x4e')]);_0x2ffcc9['where']=qs['filters'](_[_0x5b95('0x4f')](_0x209fdb[_0x5b95('0x46')],_0x1fe2f8[_0x5b95('0x50')]),_0x2ff088);var _0x46d971=[];var _0x69468c=squel[_0x5b95('0x51')]()[_0x5b95('0x52')]('id')['field']('name')[_0x5b95('0x52')](_0x5b95('0x53'))[_0x5b95('0x54')](_0x5b95('0x55'));var _0x2bf2db=squel[_0x5b95('0x51')]()['field'](_0x5b95('0x56'))[_0x5b95('0x52')]('u.fullname')[_0x5b95('0x52')](_0x5b95('0x57'))[_0x5b95('0x54')](_0x5b95('0x58'),'ui')[_0x5b95('0x59')](_0x5b95('0x5a'),'u',_0x5b95('0x5b'));var _0x55bdab=squel[_0x5b95('0x51')]()[_0x5b95('0x54')]('fax_interactions','i')[_0x5b95('0x59')](_0x5b95('0x5c'),'c',_0x5b95('0x5d'))['left_join'](_0x5b95('0x5a'),'o',_0x5b95('0x5e'))['left_join'](_0x5b95('0x5f'),'a',_0x5b95('0x60'))['left_join'](_0x5b95('0x61'),'me',_0x5b95('0x62'))[_0x5b95('0x59')]('fax_interaction_has_tags','it',_0x5b95('0x63'))[_0x5b95('0x59')](_0x5b95('0x55'),'t',_0x5b95('0x64'));var _0x1e0538=squel[_0x5b95('0x65')]();var _0x11e36d=[];var _0x131377=squel[_0x5b95('0x65')]();var _0x4664a5;if(_0x209fdb['query'][_0x5b95('0x66')]){_0x4664a5=as[_0x5b95('0x67')](_0x209fdb[_0x5b95('0x46')]['search']);var _0x36d20c=_0x4664a5[_0x5b95('0x68')];for(var _0x55c0be=0x0;_0x55c0be<_0x4664a5[_0x5b95('0x69')][_0x5b95('0x4b')];_0x55c0be++){var _0x537deb=_0x4664a5[_0x5b95('0x69')][_0x55c0be];var _0x9208a8='i';var _0x5acd11=_[_0x5b95('0x6a')](_0x2ff088,[_0x5b95('0x45'),_0x537deb[_0x5b95('0x52')]]);if(!_0x5acd11){switch(_0x537deb[_0x5b95('0x52')]){case _0x5b95('0x6b'):if(_0x537deb[_0x5b95('0x6c')]==0x1){_0x55bdab[_0x5b95('0x6d')]('`'+_0x537deb['field']+'`\x20=\x200');}else{_0x55bdab[_0x5b95('0x6d')]('`'+_0x537deb[_0x5b95('0x52')]+_0x5b95('0x6e'));}break;case _0x5b95('0x6f'):if(_0x537deb[_0x5b95('0x70')]==='$substring'){if(_0x537deb[_0x5b95('0x6c')]['split']('\x20')['length']>0x1){_0x1e0538[_0x36d20c](_0x5b95('0x71'),qs[_0x5b95('0x72')](_0x537deb[_0x5b95('0x6c')]),null);}else{var _0x43099f='%'+_0x537deb[_0x5b95('0x6c')]+'%';_0x1e0538[_0x36d20c](_0x5b95('0x73'),_0x43099f,_0x43099f,_0x43099f);}}else{_0x5acd11=_[_0x5b95('0x6a')](_0x2ff088,[_0x5b95('0x45'),_0x5b95('0x74')]);_0x537deb[_0x5b95('0x52')]=_0x5b95('0x74');_0x1b6fbf=as[_0x5b95('0x75')](_0x9208a8,_0x5acd11[_0x5b95('0x76')],_0x537deb);_0x1e0538[_0x36d20c](_0x1b6fbf[_0x5b95('0x77')],_0x1b6fbf[_0x5b95('0x6c')][_0x5b95('0x78')],_0x1b6fbf[_0x5b95('0x6c')][_0x5b95('0x1f')]);}break;case _0x5b95('0x79'):var _0x21cdd8=_0x537deb[_0x5b95('0x6c')]['split'](',')[_0x5b95('0x32')](function(_0x228c6e){return Number(_0x228c6e);});_0x21cdd8['forEach'](function(_0x20d956){_0x131377['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20d956+',%');});_0x11e36d=_['union'](_0x11e36d,_0x21cdd8);break;case _0x5b95('0x7a'):if(_0x537deb['operator']==='$substring'){_0x1e0538[_0x36d20c](_0x5b95('0x7b'),'%'+_0x537deb['value']+'%',null);}else{_0x5acd11=_[_0x5b95('0x6a')](_0x2ff088,[_0x5b95('0x45'),_0x5b95('0x3b')]);_0x537deb[_0x5b95('0x52')]=_0x5b95('0x3b');_0x1b6fbf=as[_0x5b95('0x75')](_0x9208a8,_0x5acd11[_0x5b95('0x76')],_0x537deb);_0x1e0538[_0x36d20c](_0x1b6fbf['text'],_0x1b6fbf[_0x5b95('0x6c')][_0x5b95('0x78')],_0x1b6fbf[_0x5b95('0x6c')][_0x5b95('0x1f')]);}break;case _0x5b95('0x7c'):_0x1b6fbf=as['buildExpression']('me',null,_0x537deb);_0x1e0538[_0x36d20c](_0x1b6fbf[_0x5b95('0x77')],_0x1b6fbf[_0x5b95('0x6c')]['start'],_0x1b6fbf['value'][_0x5b95('0x1f')]);break;}}else{var _0x1b6fbf=as[_0x5b95('0x75')](_0x9208a8,_0x5acd11[_0x5b95('0x76')],_0x537deb);_0x1e0538[_0x36d20c](_0x1b6fbf[_0x5b95('0x77')],_0x1b6fbf[_0x5b95('0x6c')][_0x5b95('0x78')],_0x1b6fbf[_0x5b95('0x6c')]['end']);}}}else{var _0x5d5b1e=_(_0x209fdb['query'])[_0x5b95('0x47')]()['map'](function(_0x432033){return _[_0x5b95('0x7d')](_0x2ff088,['name',_0x432033])?_0x432033:undefined;})['compact']()[_0x5b95('0x6c')]();if(!_['isEmpty'](_0x5d5b1e)){_0x5d5b1e[_0x5b95('0x36')](function(_0xcd589e){if(_0xcd589e==='FaxAccountId'){_0x55bdab['where'](_0x5b95('0x7e'),[][_0x5b95('0x7f')](_0x209fdb[_0x5b95('0x46')][_0xcd589e]));}else if(_0xcd589e===_0x5b95('0x80')){var _0x24b582=JSON[_0x5b95('0x81')](_0x209fdb[_0x5b95('0x46')][_0xcd589e])[_0x5b95('0x82')];var _0x4e6b9a=JSON[_0x5b95('0x81')](_0x209fdb[_0x5b95('0x46')][_0xcd589e])[_0x5b95('0x83')];_0x55bdab[_0x5b95('0x84')](_0x5b95('0x85'),_0x24b582,_0x4e6b9a);}else{if(_0x209fdb[_0x5b95('0x46')][_0xcd589e]==='null'){_0x55bdab[_0x5b95('0x84')]('i.'+_0xcd589e+_0x5b95('0x86'));}else{_0x55bdab['where']('i.'+_0xcd589e+_0x5b95('0x87'),_0x209fdb[_0x5b95('0x46')][_0xcd589e]);}}});}if(_0x209fdb[_0x5b95('0x46')][_0x5b95('0x88')]){if(_0x209fdb[_0x5b95('0x46')][_0x5b95('0x88')]==0x1){_0x55bdab['having'](_0x5b95('0x89'));}else{_0x55bdab[_0x5b95('0x6d')](_0x5b95('0x8a'));}}if(_0x209fdb[_0x5b95('0x46')]['tag']){_0x11e36d=_[_0x5b95('0x8b')](_0x209fdb['query']['tag'])?_0x209fdb[_0x5b95('0x46')][_0x5b95('0x8c')]:new Array(_0x209fdb[_0x5b95('0x46')][_0x5b95('0x8c')]);_0x11e36d[_0x5b95('0x36')](function(_0x276e86){_0x131377['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x276e86+',%');});}if(_0x209fdb['query'][_0x5b95('0x8d')]){var _0x3c2b1d=_0x209fdb['query'][_0x5b95('0x8d')][_0x5b95('0x8e')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3c2b1d)){_0x1e0538['or']('i.id\x20LIKE\x20?',_0x3c2b1d+'%')['or'](_0x5b95('0x8f'),_0x3c2b1d+'%');}_0x1e0538['or'](_0x5b95('0x90'),_0x3c2b1d+'%');}}_0x55bdab[_0x5b95('0x84')](_0x1e0538);_0x55bdab[_0x5b95('0x91')]('i.id');var _0x305498={'type':db['Sequelize'][_0x5b95('0x92')][_0x5b95('0x93')],'raw':!![]};var _0x45e239=_0x55bdab[_0x5b95('0x94')]();_0x45e239[_0x5b95('0x52')]('i.id');_0x45e239[_0x5b95('0x52')](_0x5b95('0x95'),_0x5b95('0x6b'));if(_0x2ffcc9['order']){_0x2ffcc9[_0x5b95('0x4d')]['forEach'](function(_0x25246f){var _0x5636df=_0x25246f[0x0]===_0x5b95('0x96')?_0x25246f[0x0]:'i.'+_0x25246f[0x0];_0x55bdab['order'](_0x5636df,_0x25246f[0x1]==='DESC'?![]:!![]);});}if(!_[_0x5b95('0x97')](_0x11e36d)){_0x55bdab[_0x5b95('0x6d')](_0x131377);_0x45e239[_0x5b95('0x84')]('t.id\x20IN\x20?',_0x11e36d);}BPromise[_0x5b95('0x98')]()[_0x5b95('0x2d')](function(){if(!_0x4664a5){if(_0x209fdb[_0x5b95('0x46')][_0x5b95('0x99')])return;_0x45e239[_0x5b95('0x84')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x55bdab[_0x5b95('0x84')](_0x5b95('0x9a'));return;}if(_0x209fdb[_0x5b95('0x9b')][_0x5b95('0x9c')]!==_0x5b95('0x9d'))return;return _0x209fdb[_0x5b95('0x9b')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x5b95('0x2d')](function(_0x555a31){if(_['isEmpty'](_0x555a31)){_0x45e239[_0x5b95('0x84')](_0x5b95('0x9e'));_0x55bdab[_0x5b95('0x84')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x45e239[_0x5b95('0x84')](_0x5b95('0x7e'),_[_0x5b95('0x32')](_0x555a31,'id'));_0x55bdab[_0x5b95('0x84')]('i.FaxAccountId\x20IN\x20?',_[_0x5b95('0x32')](_0x555a31,'id'));}});})[_0x5b95('0x2d')](function(){if(_0x209fdb[_0x5b95('0x9b')][_0x5b95('0x9c')]===_0x5b95('0x9d')&&!_0x4664a5&&!_0x209fdb[_0x5b95('0x46')][_0x5b95('0x99')])return[];return db[_0x5b95('0x9f')][_0x5b95('0x46')](_0x45e239[_0x5b95('0xa0')](),_0x305498);})[_0x5b95('0x2d')](function(_0x5ca40e){_0x3f5bee[_0x5b95('0x25')]=_0x5ca40e['length'];if(_0x3f5bee[_0x5b95('0x25')]===0x0)return[];return db[_0x5b95('0x9f')]['query'](_0x69468c['toString'](),_0x305498)['then'](function(_0x3812e2){_0x46d971=_['keyBy'](_0x3812e2,'id');_0x305498=_[_0x5b95('0xa1')](_0x305498,{'model':db[_0x5b95('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x209fdb[_0x5b95('0x46')]['fields']){_0x2ffcc9[_0x5b95('0x49')][_0x5b95('0x36')](function(_0x247a9d){_0x55bdab[_0x5b95('0x52')]('i.'+_0x247a9d);});}else{_0x55bdab[_0x5b95('0x52')](_0x5b95('0x95'),_0x5b95('0x6b'));_0x55bdab[_0x5b95('0x52')]('a.key','Account.key');_0x55bdab['field'](_0x5b95('0xa2'),_0x5b95('0xa3'));_0x55bdab['field'](_0x5b95('0xa4'),_0x5b95('0x96'));_0x55bdab[_0x5b95('0x52')](_0x5b95('0xa5'));_0x55bdab[_0x5b95('0x52')](_0x5b95('0xa6'),_0x5b95('0xa7'));_0x55bdab[_0x5b95('0x52')](_0x5b95('0xa8'),_0x5b95('0xa9'));_0x55bdab[_0x5b95('0x52')](_0x5b95('0xaa'),_0x5b95('0xab'));_0x55bdab[_0x5b95('0x52')](_0x5b95('0xac'),_0x5b95('0xad'));_0x55bdab[_0x5b95('0x52')](_0x5b95('0xae'),'Contact.mobile');_0x55bdab[_0x5b95('0x52')](_0x5b95('0xaf'),_0x5b95('0xb0'));_0x55bdab[_0x5b95('0x52')]('o.fullname',_0x5b95('0xb1'));_0x55bdab[_0x5b95('0x52')](_0x5b95('0xb2'),_0x5b95('0xb3'));_0x55bdab[_0x5b95('0x52')](_0x5b95('0xb4'),_0x5b95('0x34'));}if(_0x2ffcc9[_0x5b95('0x24')])_0x55bdab['limit'](_0x2ffcc9['limit']);if(_0x2ffcc9[_0x5b95('0x22')])_0x55bdab[_0x5b95('0x22')](_0x2ffcc9['offset']);return db[_0x5b95('0x9f')]['query'](_0x55bdab[_0x5b95('0xa0')](),_0x305498);})[_0x5b95('0x2d')](function(_0xcd4d31){if(_0xcd4d31['length']>0x0)_0x2bf2db[_0x5b95('0x84')](_0x5b95('0xb5'),_[_0x5b95('0x32')](_0xcd4d31,'id'));return db[_0x5b95('0x9f')][_0x5b95('0x46')](_0x2bf2db[_0x5b95('0xa0')](),_0x305498)[_0x5b95('0x2d')](function(_0x1e060c){var _0x412c51=_['groupBy'](_0x1e060c,'FaxInteractionId');var _0xd56622=[];_0xcd4d31[_0x5b95('0x36')](function(_0x272309){_0xd56622['push'](updateFaxInteraction(_0x272309,_0x46d971,_0x412c51));});return BPromise[_0x5b95('0xb6')](_0xd56622);});});})[_0x5b95('0x2d')](function(_0x524a80){_0x3f5bee[_0x5b95('0xb7')]=_0x524a80;return _0x3f5bee;})[_0x5b95('0x2d')](respondWithFilteredResult(_0x4ed972,_0x2ffcc9))['catch'](handleError(_0x4ed972,null));};exports[_0x5b95('0xb8')]=function(_0x51bf47,_0x848a7){var _0x408437={'raw':![],'where':{'id':_0x51bf47[_0x5b95('0xb9')]['id']}},_0x109487={};_0x109487[_0x5b95('0x44')]=_[_0x5b95('0x47')](db[_0x5b95('0x40')][_0x5b95('0x41')]);_0x109487['query']=_['keys'](_0x51bf47[_0x5b95('0x46')]);_0x109487[_0x5b95('0x50')]=_[_0x5b95('0x48')](_0x109487['model'],_0x109487[_0x5b95('0x46')]);_0x408437[_0x5b95('0x49')]=_['intersection'](_0x109487['model'],qs[_0x5b95('0x4a')](_0x51bf47[_0x5b95('0x46')]['fields']));_0x408437['attributes']=_0x408437[_0x5b95('0x49')][_0x5b95('0x4b')]?_0x408437[_0x5b95('0x49')]:_0x109487['model'];if(_0x51bf47[_0x5b95('0x46')][_0x5b95('0xba')]){_0x408437['include']=[{'all':!![]}];}_0x408437=_[_0x5b95('0xa1')]({},_0x408437,_0x51bf47['options']);return db[_0x5b95('0x40')][_0x5b95('0x6a')](_0x408437)[_0x5b95('0x2d')](handleEntityNotFound(_0x848a7,null))[_0x5b95('0x2d')](respondWithResult(_0x848a7,null))['catch'](handleError(_0x848a7,null));};exports[_0x5b95('0xbb')]=function(_0x57ab11,_0x19bf88){return db['FaxInteraction']['create'](_0x57ab11[_0x5b95('0x7c')],{})['then'](respondWithResult(_0x19bf88,0xc9))[_0x5b95('0x37')](handleError(_0x19bf88,null));};exports['update']=function(_0x7ef63c,_0x42ecbf){if(_0x7ef63c[_0x5b95('0x7c')]['id']){delete _0x7ef63c[_0x5b95('0x7c')]['id'];}return db[_0x5b95('0x40')][_0x5b95('0x6a')]({'where':{'id':_0x7ef63c[_0x5b95('0xb9')]['id']}})['then'](handleEntityNotFound(_0x42ecbf,null))[_0x5b95('0x2d')](saveUpdates(_0x7ef63c['body'],null))[_0x5b95('0x2d')](respondWithResult(_0x42ecbf,null))[_0x5b95('0x37')](handleError(_0x42ecbf,null));};exports[_0x5b95('0x2c')]=function(_0x4b085e,_0x8cf0e1){return db[_0x5b95('0x40')]['find']({'where':{'id':_0x4b085e[_0x5b95('0xb9')]['id']}})[_0x5b95('0x2d')](handleEntityNotFound(_0x8cf0e1,null))[_0x5b95('0x2d')](removeEntity(_0x8cf0e1,null))[_0x5b95('0x37')](handleError(_0x8cf0e1,null));};exports[_0x5b95('0xbc')]=function(_0x4a155d,_0x33e389){return db[_0x5b95('0x40')][_0x5b95('0xbc')]()[_0x5b95('0x2d')](respondWithResult(_0x33e389,null))['catch'](handleError(_0x33e389,null));};exports[_0x5b95('0xbd')]=function(_0x13aa9f,_0x4d2f6e,_0x2a3884){return db['FaxMessage'][_0x5b95('0x6a')]({'where':{'id':_0x13aa9f[_0x5b95('0xb9')]['id']}})['then'](handleEntityNotFound(_0x4d2f6e,null))[_0x5b95('0x2d')](function(_0x45b910){if(_0x45b910){return _0x45b910[_0x5b95('0xbd')](_0x13aa9f[_0x5b95('0x7c')][_0x5b95('0xbe')],_[_0x5b95('0xbf')](_0x13aa9f['body'],[_0x5b95('0xbe'),'id'])||{});}})[_0x5b95('0x2d')](respondWithResult(_0x4d2f6e,null))['catch'](handleError(_0x4d2f6e,null));};exports[_0x5b95('0xc0')]=function(_0x14ca1d,_0x36c089,_0x191815){var _0x5ec28d={'raw':![],'where':{}};var _0x2e71ca={};var _0x303a62={'count':0x0,'rows':[]};return db[_0x5b95('0x40')]['findOne']({'where':{'id':_0x14ca1d[_0x5b95('0xb9')]['id']}})[_0x5b95('0x2d')](handleEntityNotFound(_0x36c089,null))[_0x5b95('0x2d')](function(_0x59f123){if(_0x59f123){_0x2e71ca[_0x5b95('0x44')]=_[_0x5b95('0x47')](db[_0x5b95('0xc1')][_0x5b95('0x41')]);_0x2e71ca['query']=_[_0x5b95('0x47')](_0x14ca1d[_0x5b95('0x46')]);_0x2e71ca[_0x5b95('0x50')]=_['intersection'](_0x2e71ca[_0x5b95('0x44')],_0x2e71ca[_0x5b95('0x46')]);_0x5ec28d[_0x5b95('0x49')]=_[_0x5b95('0x48')](_0x2e71ca[_0x5b95('0x44')],qs[_0x5b95('0x4a')](_0x14ca1d[_0x5b95('0x46')][_0x5b95('0x4a')]));_0x5ec28d[_0x5b95('0x49')]=_0x5ec28d[_0x5b95('0x49')][_0x5b95('0x4b')]?_0x5ec28d['attributes']:_0x2e71ca['model'];if(!_0x14ca1d['query'][_0x5b95('0x4c')](_0x5b95('0xc2'))){_0x5ec28d[_0x5b95('0x24')]=qs['limit'](_0x14ca1d['query']['limit']);_0x5ec28d['offset']=qs[_0x5b95('0x22')](_0x14ca1d[_0x5b95('0x46')][_0x5b95('0x22')]);}_0x5ec28d[_0x5b95('0x4d')]=qs['sort'](_0x14ca1d[_0x5b95('0x46')][_0x5b95('0x4e')]);_0x5ec28d[_0x5b95('0x84')]=qs[_0x5b95('0x50')](_['pick'](_0x14ca1d[_0x5b95('0x46')],_0x2e71ca[_0x5b95('0x50')]));_0x5ec28d[_0x5b95('0x84')][_0x5b95('0xc3')]=_0x59f123['id'];if(_0x14ca1d[_0x5b95('0x46')][_0x5b95('0x8d')]){_0x5ec28d[_0x5b95('0x84')]=_[_0x5b95('0xa1')](_0x5ec28d[_0x5b95('0x84')],{'$or':_[_0x5b95('0x32')](_0x5ec28d[_0x5b95('0x49')],function(_0x22668f){var _0x4252f6={};_0x4252f6[_0x22668f]={'$like':'%'+_0x14ca1d['query'][_0x5b95('0x8d')]+'%'};return _0x4252f6;})});}if(_0x14ca1d[_0x5b95('0x46')][_0x5b95('0x82')]){var _0x2ec02f=_0x14ca1d[_0x5b95('0x46')][_0x5b95('0x82')]['split'](',');var _0x5e6a8d={};_0x5e6a8d[_0x2ec02f[0x0]]={'$gte':moment(_0x2ec02f[0x1])[_0x5b95('0xc4')](_0x5b95('0xc5'))};_0x5ec28d['where']=_[_0x5b95('0xa1')](_0x5ec28d['where'],_0x5e6a8d);}_0x5ec28d=_[_0x5b95('0xa1')]({},_0x5ec28d,_0x14ca1d['options']);return db[_0x5b95('0xc1')][_0x5b95('0x25')]({'where':_0x5ec28d[_0x5b95('0x84')]})[_0x5b95('0x2d')](function(_0x5536db){_0x303a62[_0x5b95('0x25')]=_0x5536db;if(_0x14ca1d[_0x5b95('0x46')][_0x5b95('0xba')]){_0x5ec28d['include']=[{'all':!![]}];}return db['FaxMessage'][_0x5b95('0xc6')](_0x5ec28d);})[_0x5b95('0x2d')](function(_0x31c522){_0x303a62[_0x5b95('0xb7')]=_0x31c522;return _0x303a62;});}})[_0x5b95('0x2d')](respondWithFilteredResult(_0x36c089,_0x5ec28d))['catch'](handleError(_0x36c089,null));};exports[_0x5b95('0xc7')]=function(_0x117562,_0xba11c,_0x14e5e3){return db[_0x5b95('0x40')][_0x5b95('0x6a')]({'where':{'id':_0x117562[_0x5b95('0xb9')]['id']}})[_0x5b95('0x2d')](handleEntityNotFound(_0xba11c,null))[_0x5b95('0x2d')](function(_0x290f20){if(_0x290f20){return _0x290f20['setTags'](_0x117562[_0x5b95('0x7c')][_0x5b95('0xbe')],_[_0x5b95('0xbf')](_0x117562[_0x5b95('0x7c')],[_0x5b95('0xbe'),'id'])||{})[_0x5b95('0xc8')](function(){return db[_0x5b95('0x79')][_0x5b95('0xc6')]({'attributes':['id',_0x5b95('0x45'),_0x5b95('0x53')],'where':{'id':_0x117562[_0x5b95('0x7c')][_0x5b95('0xbe')]}});})[_0x5b95('0x2d')](function(_0x1d659b){socket[_0x5b95('0xc9')]('faxInteractionTags:save',{'id':Number(_0x117562[_0x5b95('0xb9')]['id']),'tags':_0x1d659b||[]});return{'id':Number(_0x117562[_0x5b95('0xb9')]['id']),'tags':_0x1d659b||[]};});}})['then'](respondWithResult(_0xba11c,null))[_0x5b95('0x37')](handleError(_0xba11c,null));};exports[_0x5b95('0xca')]=function(_0x391937,_0x326c3f,_0x4a58f2){return db[_0x5b95('0x40')][_0x5b95('0x6a')]({'where':{'id':_0x391937[_0x5b95('0xb9')]['id']}})[_0x5b95('0x2d')](handleEntityNotFound(_0x326c3f,null))['then'](function(_0xa4204d){if(_0xa4204d){return _0xa4204d[_0x5b95('0xca')](_0x391937[_0x5b95('0x46')][_0x5b95('0xbe')]);}})['then'](respondWithStatusCode(_0x326c3f,null))[_0x5b95('0x37')](handleError(_0x326c3f,null));};exports[_0x5b95('0xcb')]=function(_0x494834,_0x3bccc9){var _0x390f45=moment()[_0x5b95('0xcc')]()[_0x5b95('0xa0')]();var _0x14bf9e=path[_0x5b95('0xcd')](config[_0x5b95('0xce')],_0x5b95('0xcf'),'files',_0x5b95('0xd0'));var _0x46d033=path[_0x5b95('0xcd')](config['root'],_0x5b95('0xcf'),_0x5b95('0xd1'),_0x5b95('0xd2'));var _0x5d2c14=path[_0x5b95('0xcd')](_0x14bf9e,_0x390f45);var _0x37115e=util['format'](_0x5b95('0xd3'),_0x494834[_0x5b95('0xb9')]['id'],_0x390f45);var _0x1baba6=path[_0x5b95('0xcd')](_0x14bf9e,_0x37115e);var _0x537f0f=[];_0x537f0f[_0x5b95('0xd4')]({'model':db[_0x5b95('0xd5')],'as':_0x5b95('0xd5'),'raw':!![]});var _0x4260d1=[{'model':db[_0x5b95('0xc1')],'as':_0x5b95('0xd6'),'attributes':['id',_0x5b95('0x7c'),'createdAt'],'include':_0x537f0f}];return db[_0x5b95('0x40')][_0x5b95('0x6a')]({'where':{'id':_0x494834[_0x5b95('0xb9')]['id']},'include':_0x4260d1})['then'](handleEntityNotFound(_0x3bccc9,null))[_0x5b95('0x2d')](function(_0x107088){if(_0x107088&&_0x107088['Messages']){var _0x42c51f=_0x107088[_0x5b95('0xd7')]({'plain':!![]});fs[_0x5b95('0xd8')](_0x5d2c14);for(var _0x21f666=0x0;_0x21f666<_0x42c51f[_0x5b95('0xd6')][_0x5b95('0x4b')];_0x21f666++){var _0x19dc33=_0x42c51f[_0x5b95('0xd6')][_0x21f666]['Attachment'];if(_0x19dc33){var _0xe3ebd5=path[_0x5b95('0xcd')](_0x46d033,_0x19dc33[_0x5b95('0xd9')]);if(fs['existsSync'](_0xe3ebd5)){fs[_0x5b95('0xda')](_0xe3ebd5)[_0x5b95('0xdb')](fs[_0x5b95('0xdc')](path[_0x5b95('0xcd')](_0x5d2c14,_0x19dc33['basename'])));}}}return BPromise[_0x5b95('0x98')]()[_0x5b95('0x2d')](function(){return new BPromise(function(_0x42c91b,_0x438acc){zipdir(_0x5d2c14,{'saveTo':_0x1baba6},function(_0x30b6fa,_0x282e25){if(_0x30b6fa)return _0x438acc(_0x30b6fa);return _0x42c91b(_0x282e25);});})[_0x5b95('0x2d')](function(){return new BPromise(function(_0x549825,_0xcf0891){rimraf(_0x5d2c14,function(_0x1d85e3){if(_0x1d85e3)_0xcf0891(_0x1d85e3);return _0x549825();});});})[_0x5b95('0x2d')](function(){return _0x3bccc9[_0x5b95('0xcb')](_0x1baba6,_0x37115e,function(_0x24840a){if(_0x24840a){console[_0x5b95('0xdd')](_0x5b95('0xde'),_0x24840a);}else{fs['unlinkSync'](_0x1baba6);}});});});}else{return _0x3bccc9[_0x5b95('0xdf')](0xc8);}})[_0x5b95('0x37')](handleError(_0x3bccc9,null));};
\ No newline at end of file
+var _0x15ec=['update','then','destroy','sendStatus','error','stack','name','send','Users','fullname','TagIds','split','forEach','push','catch','waiting','talking','total','closed','answered','UserId','unmanaged','index','FaxInteraction','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','users','fax_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','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','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','findOne','FaxMessage','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','transcript-%d-%s.zip','Attachment','Messages','get','basename','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x15ec,0x198));var _0xc15e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x15ec[_0x32d457];return _0x338386;};'use strict';var emlformat=require(_0xc15e('0x0'));var rimraf=require(_0xc15e('0x1'));var zipdir=require(_0xc15e('0x2'));var jsonpatch=require(_0xc15e('0x3'));var rp=require(_0xc15e('0x4'));var moment=require(_0xc15e('0x5'));var BPromise=require(_0xc15e('0x6'));var Mustache=require(_0xc15e('0x7'));var util=require('util');var path=require(_0xc15e('0x8'));var sox=require(_0xc15e('0x9'));var csv=require(_0xc15e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc15e('0xb'));var _=require(_0xc15e('0xc'));var squel=require(_0xc15e('0xd'));var crypto=require(_0xc15e('0xe'));var jsforce=require(_0xc15e('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc15e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc15e('0x11'));var as=require(_0xc15e('0x12'));var hardwareService=require(_0xc15e('0x13'));var logger=require(_0xc15e('0x14'))(_0xc15e('0x15'));var utils=require(_0xc15e('0x16'));var config=require(_0xc15e('0x17'));var licenseUtil=require(_0xc15e('0x18'));var db=require(_0xc15e('0x19'))['db'];config[_0xc15e('0x1a')]=_[_0xc15e('0x1b')](config['redis'],{'host':_0xc15e('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc15e('0x1a')]));require(_0xc15e('0x1d'))[_0xc15e('0x1e')](socket);function respondWithStatusCode(_0x578e4f,_0x888e00){_0x888e00=_0x888e00||0xcc;return function(_0x7ac1a5){if(_0x7ac1a5){return _0x578e4f['sendStatus'](_0x888e00);}return _0x578e4f[_0xc15e('0x1f')](_0x888e00)[_0xc15e('0x20')]();};}function respondWithResult(_0x488624,_0xa99f6){_0xa99f6=_0xa99f6||0xc8;return function(_0x40edae){if(_0x40edae){return _0x488624['status'](_0xa99f6)[_0xc15e('0x21')](_0x40edae);}};}function respondWithFilteredResult(_0x2ace8a,_0x467f0d){return function(_0xa8a47){if(_0xa8a47){var _0x5e8400=typeof _0x467f0d[_0xc15e('0x22')]===_0xc15e('0x23')&&typeof _0x467f0d[_0xc15e('0x24')]==='undefined';var _0xf06bef=_0xa8a47['count'];var _0x1b1b59=_0x5e8400?0x0:_0x467f0d[_0xc15e('0x22')];var _0x433f05=_0x5e8400?_0xa8a47[_0xc15e('0x25')]:_0x467f0d[_0xc15e('0x22')]+_0x467f0d[_0xc15e('0x24')];var _0x165cca;if(_0x433f05>=_0xf06bef){_0x433f05=_0xf06bef;_0x165cca=0xc8;}else{_0x165cca=0xce;}_0x2ace8a['status'](_0x165cca);return _0x2ace8a[_0xc15e('0x26')](_0xc15e('0x27'),_0x1b1b59+'-'+_0x433f05+'/'+_0xf06bef)['json'](_0xa8a47);}return null;};}function patchUpdates(_0x2d97ff){return function(_0x4c2a35){try{jsonpatch[_0xc15e('0x28')](_0x4c2a35,_0x2d97ff,!![]);}catch(_0x4d9dd7){return BPromise['reject'](_0x4d9dd7);}return _0x4c2a35[_0xc15e('0x29')]();};}function saveUpdates(_0x449cd4,_0x3b2688){return function(_0x5b7114){if(_0x5b7114){return _0x5b7114[_0xc15e('0x2a')](_0x449cd4)[_0xc15e('0x2b')](function(_0x1bffc6){return _0x1bffc6;});}return null;};}function removeEntity(_0x38cfb0,_0x3d0861){return function(_0x555afa){if(_0x555afa){return _0x555afa[_0xc15e('0x2c')]()[_0xc15e('0x2b')](function(){_0x38cfb0[_0xc15e('0x1f')](0xcc)[_0xc15e('0x20')]();});}};}function handleEntityNotFound(_0x34fd24,_0x1549f1){return function(_0x2f5724){if(!_0x2f5724){_0x34fd24[_0xc15e('0x2d')](0x194);}return _0x2f5724;};}function handleError(_0x5735cd,_0x2541d3){_0x2541d3=_0x2541d3||0x1f4;return function(_0x48aaf2){logger[_0xc15e('0x2e')](_0x48aaf2[_0xc15e('0x2f')]);if(_0x48aaf2[_0xc15e('0x30')]){delete _0x48aaf2[_0xc15e('0x30')];}_0x5735cd[_0xc15e('0x1f')](_0x2541d3)[_0xc15e('0x31')](_0x48aaf2);};}function getInteractionUsers(_0x1d5224,_0x518252){return new BPromise(function(_0x256117,_0x73fdec){try{if(_0x518252[_0x1d5224['id']]){_0x1d5224[_0xc15e('0x32')]=_['map'](_0x518252[_0x1d5224['id']],function(_0x146440){return{'id':_0x146440['id'],'fullname':_0x146440[_0xc15e('0x33')]};});}}catch(_0x1266ad){_0x73fdec(_0x1266ad);}_0x256117(_0x1d5224);});}function getInteractionTags(_0x28bfef,_0x3bae8b){return new BPromise(function(_0x219b7d,_0x5d31f1){try{if(_0x28bfef['TagIds']){_0x28bfef['Tags']=[];_0x28bfef[_0xc15e('0x34')][_0xc15e('0x35')](',')[_0xc15e('0x36')](function(_0x4af024){_0x28bfef['Tags'][_0xc15e('0x37')](_0x3bae8b[_0x4af024]);});}delete _0x28bfef['TagIds'];}catch(_0x257ea3){_0x5d31f1(_0x257ea3);}_0x219b7d(_0x28bfef);});}function updateFaxInteraction(_0x4b3f3f,_0x1108f2,_0x4e8fb1){return new BPromise(function(_0x70fa47,_0x1bc693){return getInteractionUsers(_0x4b3f3f,_0x4e8fb1)['then'](function(_0x3b3dbe){return getInteractionTags(_0x3b3dbe,_0x1108f2);})['then'](function(_0x4c4db5){return getStateInteraction(_0x4c4db5);})['then'](function(_0x30ae76){_0x70fa47(_0x30ae76);})[_0xc15e('0x38')](function(_0x592f3f){_0x1bc693(_0x592f3f);});});}function getStateInteraction(_0x530dc5){return new BPromise(function(_0x413b83){_0x530dc5[_0xc15e('0x39')]=0x0;_0x530dc5[_0xc15e('0x3a')]=0x0;_0x530dc5['answered']=0x0;_0x530dc5['unmanaged']=0x0;_0x530dc5[_0xc15e('0x3b')]=0x0;if(!_0x530dc5['closed']&&!_0x530dc5['UserId']){_0x530dc5['waiting']+=0x1;}if(!_0x530dc5[_0xc15e('0x3c')]&&_0x530dc5['UserId']){_0x530dc5[_0xc15e('0x3a')]+=0x1;if(_0x530dc5[_0xc15e('0x39')]){_0x530dc5['waiting']-=0x1;}}if(_0x530dc5[_0xc15e('0x3c')]&&_0x530dc5['UserId']){_0x530dc5[_0xc15e('0x3d')]+=0x1;if(_0x530dc5[_0xc15e('0x3a')]){_0x530dc5[_0xc15e('0x3a')]-=0x1;}}if(_0x530dc5[_0xc15e('0x3c')]&&!_0x530dc5[_0xc15e('0x3e')]){_0x530dc5[_0xc15e('0x3f')]+=0x1;if(_0x530dc5['waiting']){_0x530dc5[_0xc15e('0x39')]-=0x1;}}_0x530dc5[_0xc15e('0x3b')]+=0x1;_0x413b83(_0x530dc5);});}exports[_0xc15e('0x40')]=function(_0x19bd56,_0x3e3d20){var _0x55617f={},_0x1bea7e={},_0x315b29={'count':0x0,'rows':[]};var _0x2fa4a4=_['map'](db[_0xc15e('0x41')][_0xc15e('0x42')],function(_0x5d2275){return{'name':_0x5d2275['fieldName'],'type':_0x5d2275[_0xc15e('0x43')][_0xc15e('0x44')]};});_0x1bea7e[_0xc15e('0x45')]=_['map'](_0x2fa4a4,_0xc15e('0x30'));_0x1bea7e[_0xc15e('0x46')]=_[_0xc15e('0x47')](_0x19bd56[_0xc15e('0x46')]);_0x1bea7e['filters']=_[_0xc15e('0x48')](_0x1bea7e[_0xc15e('0x45')],_0x1bea7e[_0xc15e('0x46')]);_0x55617f[_0xc15e('0x49')]=_[_0xc15e('0x48')](_0x1bea7e[_0xc15e('0x45')],qs[_0xc15e('0x4a')](_0x19bd56['query'][_0xc15e('0x4a')]));_0x55617f[_0xc15e('0x49')]=_0x55617f[_0xc15e('0x49')][_0xc15e('0x4b')]?_0x55617f[_0xc15e('0x49')]:_0x1bea7e[_0xc15e('0x45')];if(!_0x19bd56['query'][_0xc15e('0x4c')]('nolimit')){_0x55617f[_0xc15e('0x24')]=qs[_0xc15e('0x24')](_0x19bd56[_0xc15e('0x46')][_0xc15e('0x24')]);_0x55617f[_0xc15e('0x22')]=qs[_0xc15e('0x22')](_0x19bd56[_0xc15e('0x46')][_0xc15e('0x22')]);}_0x55617f[_0xc15e('0x4d')]=qs['sort'](_0x19bd56['query'][_0xc15e('0x4e')]);_0x55617f[_0xc15e('0x4f')]=qs[_0xc15e('0x50')](_[_0xc15e('0x51')](_0x19bd56[_0xc15e('0x46')],_0x1bea7e[_0xc15e('0x50')]),_0x2fa4a4);var _0x5406dd=[];var _0x4212c6=squel[_0xc15e('0x52')]()['field']('id')['field'](_0xc15e('0x30'))[_0xc15e('0x53')](_0xc15e('0x54'))[_0xc15e('0x55')](_0xc15e('0x56'));var _0x1187b7=squel[_0xc15e('0x52')]()[_0xc15e('0x53')](_0xc15e('0x57'))[_0xc15e('0x53')](_0xc15e('0x58'))[_0xc15e('0x53')](_0xc15e('0x59'))[_0xc15e('0x55')](_0xc15e('0x5a'),'ui')['left_join'](_0xc15e('0x5b'),'u','u.id\x20=\x20ui.UserId');var _0x4552e8=squel[_0xc15e('0x52')]()[_0xc15e('0x55')](_0xc15e('0x5c'),'i')[_0xc15e('0x5d')]('cm_contacts','c',_0xc15e('0x5e'))['left_join'](_0xc15e('0x5b'),'o',_0xc15e('0x5f'))[_0xc15e('0x5d')](_0xc15e('0x60'),'a',_0xc15e('0x61'))['left_join']('fax_messages','me',_0xc15e('0x62'))[_0xc15e('0x5d')](_0xc15e('0x63'),'it',_0xc15e('0x64'))[_0xc15e('0x5d')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x390eab=squel[_0xc15e('0x65')]();var _0x48a3bd=[];var _0x400e48=squel['expr']();var _0x42298c;if(_0x19bd56[_0xc15e('0x46')][_0xc15e('0x66')]){_0x42298c=as[_0xc15e('0x67')](_0x19bd56['query'][_0xc15e('0x66')]);var _0x3f85a3=_0x42298c['sqlOperator'];for(var _0xbea9eb=0x0;_0xbea9eb<_0x42298c[_0xc15e('0x68')]['length'];_0xbea9eb++){var _0x2ddfbb=_0x42298c[_0xc15e('0x68')][_0xbea9eb];var _0x339546='i';var _0xe11c46=_[_0xc15e('0x69')](_0x2fa4a4,[_0xc15e('0x30'),_0x2ddfbb['field']]);if(!_0xe11c46){switch(_0x2ddfbb[_0xc15e('0x53')]){case _0xc15e('0x6a'):if(_0x2ddfbb[_0xc15e('0x6b')]==0x1){_0x4552e8[_0xc15e('0x6c')]('`'+_0x2ddfbb[_0xc15e('0x53')]+_0xc15e('0x6d'));}else{_0x4552e8['having']('`'+_0x2ddfbb[_0xc15e('0x53')]+_0xc15e('0x6e'));}break;case _0xc15e('0x6f'):if(_0x2ddfbb[_0xc15e('0x70')]===_0xc15e('0x71')){if(_0x2ddfbb[_0xc15e('0x6b')][_0xc15e('0x35')]('\x20')[_0xc15e('0x4b')]>0x1){_0x390eab[_0x3f85a3](_0xc15e('0x72'),qs['getFullTextValue'](_0x2ddfbb['value']),null);}else{var _0x27e87c='%'+_0x2ddfbb[_0xc15e('0x6b')]+'%';_0x390eab[_0x3f85a3](_0xc15e('0x73'),_0x27e87c,_0x27e87c,_0x27e87c);}}else{_0xe11c46=_[_0xc15e('0x69')](_0x2fa4a4,['name',_0xc15e('0x74')]);_0x2ddfbb[_0xc15e('0x53')]=_0xc15e('0x74');_0x2d4716=as[_0xc15e('0x75')](_0x339546,_0xe11c46['type'],_0x2ddfbb);_0x390eab[_0x3f85a3](_0x2d4716[_0xc15e('0x76')],_0x2d4716[_0xc15e('0x6b')]['start'],_0x2d4716[_0xc15e('0x6b')][_0xc15e('0x20')]);}break;case _0xc15e('0x77'):var _0xab8c47=_0x2ddfbb[_0xc15e('0x6b')][_0xc15e('0x35')](',')[_0xc15e('0x78')](function(_0x3a993c){return Number(_0x3a993c);});_0xab8c47[_0xc15e('0x36')](function(_0x3f5558){_0x400e48['or'](_0xc15e('0x79'),'%,'+_0x3f5558+',%');});_0x48a3bd=_[_0xc15e('0x7a')](_0x48a3bd,_0xab8c47);break;case _0xc15e('0x7b'):if(_0x2ddfbb[_0xc15e('0x70')]===_0xc15e('0x71')){_0x390eab[_0x3f85a3](_0xc15e('0x7c'),'%'+_0x2ddfbb['value']+'%',null);}else{_0xe11c46=_[_0xc15e('0x69')](_0x2fa4a4,[_0xc15e('0x30'),_0xc15e('0x3e')]);_0x2ddfbb[_0xc15e('0x53')]=_0xc15e('0x3e');_0x2d4716=as[_0xc15e('0x75')](_0x339546,_0xe11c46['type'],_0x2ddfbb);_0x390eab[_0x3f85a3](_0x2d4716['text'],_0x2d4716[_0xc15e('0x6b')]['start'],_0x2d4716[_0xc15e('0x6b')][_0xc15e('0x20')]);}break;case'body':_0x2d4716=as[_0xc15e('0x75')]('me',null,_0x2ddfbb);_0x390eab[_0x3f85a3](_0x2d4716[_0xc15e('0x76')],_0x2d4716[_0xc15e('0x6b')]['start'],_0x2d4716[_0xc15e('0x6b')][_0xc15e('0x20')]);break;}}else{var _0x2d4716=as['buildExpression'](_0x339546,_0xe11c46[_0xc15e('0x43')],_0x2ddfbb);_0x390eab[_0x3f85a3](_0x2d4716[_0xc15e('0x76')],_0x2d4716[_0xc15e('0x6b')]['start'],_0x2d4716[_0xc15e('0x6b')][_0xc15e('0x20')]);}}}else{var _0x42869a=_(_0x19bd56[_0xc15e('0x46')])[_0xc15e('0x47')]()[_0xc15e('0x78')](function(_0x1183c1){return _[_0xc15e('0x7d')](_0x2fa4a4,['name',_0x1183c1])?_0x1183c1:undefined;})['compact']()['value']();if(!_[_0xc15e('0x7e')](_0x42869a)){_0x42869a[_0xc15e('0x36')](function(_0x53bd69){if(_0x53bd69==='FaxAccountId'){_0x4552e8[_0xc15e('0x4f')](_0xc15e('0x7f'),[][_0xc15e('0x80')](_0x19bd56[_0xc15e('0x46')][_0x53bd69]));}else if(_0x53bd69===_0xc15e('0x81')){var _0x127dfb=JSON[_0xc15e('0x82')](_0x19bd56['query'][_0x53bd69])[_0xc15e('0x83')];var _0x16b568=JSON[_0xc15e('0x82')](_0x19bd56[_0xc15e('0x46')][_0x53bd69])['$lte'];_0x4552e8[_0xc15e('0x4f')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x127dfb,_0x16b568);}else{if(_0x19bd56[_0xc15e('0x46')][_0x53bd69]===_0xc15e('0x84')){_0x4552e8[_0xc15e('0x4f')]('i.'+_0x53bd69+_0xc15e('0x85'));}else{_0x4552e8[_0xc15e('0x4f')]('i.'+_0x53bd69+_0xc15e('0x86'),_0x19bd56[_0xc15e('0x46')][_0x53bd69]);}}});}if(_0x19bd56[_0xc15e('0x46')][_0xc15e('0x87')]){if(_0x19bd56[_0xc15e('0x46')][_0xc15e('0x87')]==0x1){_0x4552e8[_0xc15e('0x6c')](_0xc15e('0x88'));}else{_0x4552e8['having'](_0xc15e('0x89'));}}if(_0x19bd56['query'][_0xc15e('0x8a')]){_0x48a3bd=_[_0xc15e('0x8b')](_0x19bd56[_0xc15e('0x46')][_0xc15e('0x8a')])?_0x19bd56[_0xc15e('0x46')][_0xc15e('0x8a')]:new Array(_0x19bd56['query']['tag']);_0x48a3bd[_0xc15e('0x36')](function(_0xf3015a){_0x400e48['or'](_0xc15e('0x79'),'%,'+_0xf3015a+',%');});}if(_0x19bd56['query'][_0xc15e('0x8c')]){var _0x4ad397=_0x19bd56['query'][_0xc15e('0x8c')][_0xc15e('0x8d')]('\x5c','\x5c\x5c')[_0xc15e('0x8d')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4ad397)){_0x390eab['or']('i.id\x20LIKE\x20?',_0x4ad397+'%')['or'](_0xc15e('0x8e'),_0x4ad397+'%');}_0x390eab['or'](_0xc15e('0x8f'),_0x4ad397+'%');}}_0x4552e8[_0xc15e('0x4f')](_0x390eab);_0x4552e8[_0xc15e('0x90')](_0xc15e('0x91'));var _0x1f5507={'type':db[_0xc15e('0x92')][_0xc15e('0x93')][_0xc15e('0x94')],'raw':!![]};var _0x10beac=_0x4552e8[_0xc15e('0x95')]();_0x10beac[_0xc15e('0x53')](_0xc15e('0x91'));_0x10beac[_0xc15e('0x53')](_0xc15e('0x96'),_0xc15e('0x6a'));if(_0x55617f[_0xc15e('0x4d')]){_0x55617f[_0xc15e('0x4d')][_0xc15e('0x36')](function(_0x3e72eb){var _0x3fdf1c=_0x3e72eb[0x0]===_0xc15e('0x97')?_0x3e72eb[0x0]:'i.'+_0x3e72eb[0x0];_0x4552e8[_0xc15e('0x4d')](_0x3fdf1c,_0x3e72eb[0x1]===_0xc15e('0x98')?![]:!![]);});}if(!_['isEmpty'](_0x48a3bd)){_0x4552e8[_0xc15e('0x6c')](_0x400e48);_0x10beac[_0xc15e('0x4f')](_0xc15e('0x99'),_0x48a3bd);}BPromise[_0xc15e('0x9a')]()[_0xc15e('0x2b')](function(){if(!_0x42298c){if(_0x19bd56[_0xc15e('0x46')][_0xc15e('0x9b')])return;_0x10beac[_0xc15e('0x4f')](_0xc15e('0x9c'));_0x4552e8[_0xc15e('0x4f')](_0xc15e('0x9c'));return;}if(_0x19bd56[_0xc15e('0x9d')][_0xc15e('0x9e')]!==_0xc15e('0x9f'))return;return _0x19bd56[_0xc15e('0x9d')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xc15e('0x2b')](function(_0x268d3e){if(_['isEmpty'](_0x268d3e)){_0x10beac[_0xc15e('0x4f')](_0xc15e('0xa0'));_0x4552e8['where'](_0xc15e('0xa0'));}else{_0x10beac[_0xc15e('0x4f')](_0xc15e('0x7f'),_['map'](_0x268d3e,'id'));_0x4552e8[_0xc15e('0x4f')](_0xc15e('0x7f'),_[_0xc15e('0x78')](_0x268d3e,'id'));}});})[_0xc15e('0x2b')](function(){if(_0x19bd56[_0xc15e('0x9d')]['role']===_0xc15e('0x9f')&&!_0x42298c&&!_0x19bd56['query'][_0xc15e('0x9b')])return[];return db[_0xc15e('0xa1')][_0xc15e('0x46')](_0x10beac[_0xc15e('0xa2')](),_0x1f5507);})[_0xc15e('0x2b')](function(_0xba3d50){_0x315b29['count']=_0xba3d50[_0xc15e('0x4b')];if(_0x315b29[_0xc15e('0x25')]===0x0)return[];return db['sequelize'][_0xc15e('0x46')](_0x4212c6['toString'](),_0x1f5507)[_0xc15e('0x2b')](function(_0x2424bb){_0x5406dd=_[_0xc15e('0xa3')](_0x2424bb,'id');_0x1f5507=_['merge'](_0x1f5507,{'model':db[_0xc15e('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x19bd56[_0xc15e('0x46')]['fields']){_0x55617f[_0xc15e('0x49')][_0xc15e('0x36')](function(_0x5159d4){_0x4552e8[_0xc15e('0x53')]('i.'+_0x5159d4);});}else{_0x4552e8[_0xc15e('0x53')](_0xc15e('0x96'),_0xc15e('0x6a'));_0x4552e8[_0xc15e('0x53')]('a.key',_0xc15e('0xa4'));_0x4552e8[_0xc15e('0x53')](_0xc15e('0xa5'),_0xc15e('0xa6'));_0x4552e8[_0xc15e('0x53')](_0xc15e('0xa7'),_0xc15e('0x97'));_0x4552e8['field']('i.*');_0x4552e8[_0xc15e('0x53')](_0xc15e('0xa8'),_0xc15e('0xa9'));_0x4552e8['field'](_0xc15e('0xaa'),'Contact.lastName');_0x4552e8[_0xc15e('0x53')](_0xc15e('0xab'),_0xc15e('0xac'));_0x4552e8[_0xc15e('0x53')](_0xc15e('0xad'),_0xc15e('0xae'));_0x4552e8[_0xc15e('0x53')](_0xc15e('0xaf'),_0xc15e('0xb0'));_0x4552e8[_0xc15e('0x53')](_0xc15e('0xb1'),_0xc15e('0xb2'));_0x4552e8['field']('o.fullname',_0xc15e('0xb3'));_0x4552e8['field'](_0xc15e('0xb4'),_0xc15e('0xb5'));_0x4552e8['field'](_0xc15e('0xb6'),'TagIds');}if(_0x55617f['limit'])_0x4552e8['limit'](_0x55617f[_0xc15e('0x24')]);if(_0x55617f['offset'])_0x4552e8[_0xc15e('0x22')](_0x55617f[_0xc15e('0x22')]);return db[_0xc15e('0xa1')][_0xc15e('0x46')](_0x4552e8[_0xc15e('0xa2')](),_0x1f5507);})['then'](function(_0x5a58fc){if(_0x5a58fc['length']>0x0)_0x1187b7[_0xc15e('0x4f')](_0xc15e('0xb7'),_[_0xc15e('0x78')](_0x5a58fc,'id'));return db[_0xc15e('0xa1')][_0xc15e('0x46')](_0x1187b7[_0xc15e('0xa2')](),_0x1f5507)['then'](function(_0x4593a4){var _0x217a68=_[_0xc15e('0xb8')](_0x4593a4,_0xc15e('0xb9'));var _0x5815b8=[];_0x5a58fc[_0xc15e('0x36')](function(_0x3c38b0){_0x5815b8[_0xc15e('0x37')](updateFaxInteraction(_0x3c38b0,_0x5406dd,_0x217a68));});return BPromise[_0xc15e('0xba')](_0x5815b8);});});})['then'](function(_0x45b44e){_0x315b29[_0xc15e('0xbb')]=_0x45b44e;return _0x315b29;})['then'](respondWithFilteredResult(_0x3e3d20,_0x55617f))['catch'](handleError(_0x3e3d20,null));};exports[_0xc15e('0xbc')]=function(_0x3d6118,_0x1f84e9){var _0x25c5a1={'raw':![],'where':{'id':_0x3d6118[_0xc15e('0xbd')]['id']}},_0x366161={};_0x366161[_0xc15e('0x45')]=_[_0xc15e('0x47')](db['FaxInteraction']['rawAttributes']);_0x366161[_0xc15e('0x46')]=_[_0xc15e('0x47')](_0x3d6118[_0xc15e('0x46')]);_0x366161[_0xc15e('0x50')]=_[_0xc15e('0x48')](_0x366161[_0xc15e('0x45')],_0x366161['query']);_0x25c5a1[_0xc15e('0x49')]=_[_0xc15e('0x48')](_0x366161[_0xc15e('0x45')],qs[_0xc15e('0x4a')](_0x3d6118['query'][_0xc15e('0x4a')]));_0x25c5a1['attributes']=_0x25c5a1[_0xc15e('0x49')][_0xc15e('0x4b')]?_0x25c5a1[_0xc15e('0x49')]:_0x366161[_0xc15e('0x45')];if(_0x3d6118[_0xc15e('0x46')][_0xc15e('0xbe')]){_0x25c5a1[_0xc15e('0xbf')]=[{'all':!![]}];}_0x25c5a1=_[_0xc15e('0xc0')]({},_0x25c5a1,_0x3d6118[_0xc15e('0xc1')]);return db[_0xc15e('0x41')][_0xc15e('0x69')](_0x25c5a1)[_0xc15e('0x2b')](handleEntityNotFound(_0x1f84e9,null))['then'](respondWithResult(_0x1f84e9,null))[_0xc15e('0x38')](handleError(_0x1f84e9,null));};exports[_0xc15e('0xc2')]=function(_0x3f601c,_0x1560cd){return db[_0xc15e('0x41')][_0xc15e('0xc2')](_0x3f601c[_0xc15e('0xc3')],{})[_0xc15e('0x2b')](respondWithResult(_0x1560cd,0xc9))[_0xc15e('0x38')](handleError(_0x1560cd,null));};exports[_0xc15e('0x2a')]=function(_0x253614,_0x1a7ca9){if(_0x253614[_0xc15e('0xc3')]['id']){delete _0x253614[_0xc15e('0xc3')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x253614[_0xc15e('0xbd')]['id']}})[_0xc15e('0x2b')](handleEntityNotFound(_0x1a7ca9,null))['then'](saveUpdates(_0x253614[_0xc15e('0xc3')],null))[_0xc15e('0x2b')](respondWithResult(_0x1a7ca9,null))[_0xc15e('0x38')](handleError(_0x1a7ca9,null));};exports[_0xc15e('0x2c')]=function(_0x3904fe,_0x557d25){return db[_0xc15e('0x41')][_0xc15e('0x69')]({'where':{'id':_0x3904fe[_0xc15e('0xbd')]['id']}})['then'](handleEntityNotFound(_0x557d25,null))[_0xc15e('0x2b')](removeEntity(_0x557d25,null))[_0xc15e('0x38')](handleError(_0x557d25,null));};exports[_0xc15e('0xc4')]=function(_0x16bdd3,_0x59e3bd){return db[_0xc15e('0x41')]['describe']()['then'](respondWithResult(_0x59e3bd,null))[_0xc15e('0x38')](handleError(_0x59e3bd,null));};exports[_0xc15e('0xc5')]=function(_0x563100,_0x270cc3,_0x1c21d0){return db['FaxMessage']['find']({'where':{'id':_0x563100[_0xc15e('0xbd')]['id']}})[_0xc15e('0x2b')](handleEntityNotFound(_0x270cc3,null))[_0xc15e('0x2b')](function(_0x540a2d){if(_0x540a2d){return _0x540a2d[_0xc15e('0xc5')](_0x563100[_0xc15e('0xc3')][_0xc15e('0xc6')],_[_0xc15e('0xc7')](_0x563100[_0xc15e('0xc3')],[_0xc15e('0xc6'),'id'])||{});}})[_0xc15e('0x2b')](respondWithResult(_0x270cc3,null))[_0xc15e('0x38')](handleError(_0x270cc3,null));};exports['getMessages']=function(_0x3c25b1,_0x134b0b,_0x367253){var _0x411856={'raw':![],'where':{}};var _0x227c92={};var _0x2ae73c={'count':0x0,'rows':[]};return db[_0xc15e('0x41')][_0xc15e('0xc8')]({'where':{'id':_0x3c25b1[_0xc15e('0xbd')]['id']}})[_0xc15e('0x2b')](handleEntityNotFound(_0x134b0b,null))[_0xc15e('0x2b')](function(_0x127f4c){if(_0x127f4c){_0x227c92[_0xc15e('0x45')]=_[_0xc15e('0x47')](db[_0xc15e('0xc9')][_0xc15e('0x42')]);_0x227c92[_0xc15e('0x46')]=_[_0xc15e('0x47')](_0x3c25b1[_0xc15e('0x46')]);_0x227c92[_0xc15e('0x50')]=_['intersection'](_0x227c92[_0xc15e('0x45')],_0x227c92[_0xc15e('0x46')]);_0x411856[_0xc15e('0x49')]=_[_0xc15e('0x48')](_0x227c92[_0xc15e('0x45')],qs[_0xc15e('0x4a')](_0x3c25b1[_0xc15e('0x46')]['fields']));_0x411856[_0xc15e('0x49')]=_0x411856[_0xc15e('0x49')][_0xc15e('0x4b')]?_0x411856['attributes']:_0x227c92[_0xc15e('0x45')];if(!_0x3c25b1['query']['hasOwnProperty'](_0xc15e('0xca'))){_0x411856['limit']=qs[_0xc15e('0x24')](_0x3c25b1['query'][_0xc15e('0x24')]);_0x411856[_0xc15e('0x22')]=qs[_0xc15e('0x22')](_0x3c25b1[_0xc15e('0x46')]['offset']);}_0x411856[_0xc15e('0x4d')]=qs['sort'](_0x3c25b1[_0xc15e('0x46')][_0xc15e('0x4e')]);_0x411856[_0xc15e('0x4f')]=qs['filters'](_[_0xc15e('0x51')](_0x3c25b1['query'],_0x227c92[_0xc15e('0x50')]));_0x411856[_0xc15e('0x4f')][_0xc15e('0xb9')]=_0x127f4c['id'];if(_0x3c25b1[_0xc15e('0x46')][_0xc15e('0x8c')]){_0x411856[_0xc15e('0x4f')]=_[_0xc15e('0xc0')](_0x411856[_0xc15e('0x4f')],{'$or':_[_0xc15e('0x78')](_0x411856[_0xc15e('0x49')],function(_0x2563bf){var _0x28cf27={};_0x28cf27[_0x2563bf]={'$like':'%'+_0x3c25b1['query'][_0xc15e('0x8c')]+'%'};return _0x28cf27;})});}if(_0x3c25b1[_0xc15e('0x46')]['$gte']){var _0x1bfd4d=_0x3c25b1['query']['$gte'][_0xc15e('0x35')](',');var _0x3996be={};_0x3996be[_0x1bfd4d[0x0]]={'$gte':moment(_0x1bfd4d[0x1])[_0xc15e('0xcb')](_0xc15e('0xcc'))};_0x411856['where']=_['merge'](_0x411856[_0xc15e('0x4f')],_0x3996be);}_0x411856=_[_0xc15e('0xc0')]({},_0x411856,_0x3c25b1['options']);return db['FaxMessage'][_0xc15e('0x25')]({'where':_0x411856[_0xc15e('0x4f')]})[_0xc15e('0x2b')](function(_0x5179e2){_0x2ae73c[_0xc15e('0x25')]=_0x5179e2;if(_0x3c25b1[_0xc15e('0x46')][_0xc15e('0xbe')]){_0x411856['include']=[{'all':!![]}];}return db[_0xc15e('0xc9')][_0xc15e('0xcd')](_0x411856);})[_0xc15e('0x2b')](function(_0x41a7c0){_0x2ae73c[_0xc15e('0xbb')]=_0x41a7c0;return _0x2ae73c;});}})[_0xc15e('0x2b')](respondWithFilteredResult(_0x134b0b,_0x411856))[_0xc15e('0x38')](handleError(_0x134b0b,null));};exports[_0xc15e('0xce')]=function(_0x52aa2f,_0x1187cd,_0x3cca0b){return db[_0xc15e('0x41')][_0xc15e('0x69')]({'where':{'id':_0x52aa2f[_0xc15e('0xbd')]['id']}})[_0xc15e('0x2b')](handleEntityNotFound(_0x1187cd,null))[_0xc15e('0x2b')](function(_0x51e3b9){if(_0x51e3b9){return _0x51e3b9[_0xc15e('0xcf')](_0x52aa2f[_0xc15e('0xc3')]['ids'],_['omit'](_0x52aa2f['body'],[_0xc15e('0xc6'),'id'])||{})[_0xc15e('0xd0')](function(){return db[_0xc15e('0x77')][_0xc15e('0xcd')]({'attributes':['id',_0xc15e('0x30'),_0xc15e('0x54')],'where':{'id':_0x52aa2f[_0xc15e('0xc3')]['ids']}});})[_0xc15e('0x2b')](function(_0x4d40c9){socket[_0xc15e('0xd1')](_0xc15e('0xd2'),{'id':Number(_0x52aa2f[_0xc15e('0xbd')]['id']),'tags':_0x4d40c9||[]});return{'id':Number(_0x52aa2f['params']['id']),'tags':_0x4d40c9||[]};});}})['then'](respondWithResult(_0x1187cd,null))['catch'](handleError(_0x1187cd,null));};exports['removeTags']=function(_0x421657,_0x390900,_0x5a212f){return db[_0xc15e('0x41')][_0xc15e('0x69')]({'where':{'id':_0x421657[_0xc15e('0xbd')]['id']}})['then'](handleEntityNotFound(_0x390900,null))[_0xc15e('0x2b')](function(_0x557947){if(_0x557947){return _0x557947[_0xc15e('0xd3')](_0x421657['query'][_0xc15e('0xc6')]);}})[_0xc15e('0x2b')](respondWithStatusCode(_0x390900,null))[_0xc15e('0x38')](handleError(_0x390900,null));};exports[_0xc15e('0xd4')]=function(_0x3cc8e1,_0x5ab9ca){var _0x513092=moment()[_0xc15e('0xd5')]()['toString']();var _0x1a2a5c=path[_0xc15e('0xd6')](config[_0xc15e('0xd7')],_0xc15e('0xd8'),_0xc15e('0xd9'),'tmp');var _0x53d119=path[_0xc15e('0xd6')](config[_0xc15e('0xd7')],_0xc15e('0xd8'),'files','attachments');var _0x5061df=path[_0xc15e('0xd6')](_0x1a2a5c,_0x513092);var _0x303f9b=util[_0xc15e('0xcb')](_0xc15e('0xda'),_0x3cc8e1['params']['id'],_0x513092);var _0x430142=path[_0xc15e('0xd6')](_0x1a2a5c,_0x303f9b);var _0x24a28e=[];_0x24a28e[_0xc15e('0x37')]({'model':db[_0xc15e('0xdb')],'as':'Attachment','raw':!![]});var _0x186c00=[{'model':db[_0xc15e('0xc9')],'as':_0xc15e('0xdc'),'attributes':['id',_0xc15e('0xc3'),'createdAt'],'include':_0x24a28e}];return db[_0xc15e('0x41')][_0xc15e('0x69')]({'where':{'id':_0x3cc8e1[_0xc15e('0xbd')]['id']},'include':_0x186c00})[_0xc15e('0x2b')](handleEntityNotFound(_0x5ab9ca,null))[_0xc15e('0x2b')](function(_0x5239b5){if(_0x5239b5&&_0x5239b5[_0xc15e('0xdc')]){var _0x2a5271=_0x5239b5[_0xc15e('0xdd')]({'plain':!![]});fs['mkdirSync'](_0x5061df);for(var _0x1983ac=0x0;_0x1983ac<_0x2a5271['Messages']['length'];_0x1983ac++){var _0x72784=_0x2a5271[_0xc15e('0xdc')][_0x1983ac][_0xc15e('0xdb')];if(_0x72784){var _0x91b9bb=path[_0xc15e('0xd6')](_0x53d119,_0x72784[_0xc15e('0xde')]);if(fs['existsSync'](_0x91b9bb)){fs['createReadStream'](_0x91b9bb)['pipe'](fs['createWriteStream'](path[_0xc15e('0xd6')](_0x5061df,_0x72784['basename'])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x486ffd,_0x4759bb){zipdir(_0x5061df,{'saveTo':_0x430142},function(_0x55f96a,_0x31be8d){if(_0x55f96a)return _0x4759bb(_0x55f96a);return _0x486ffd(_0x31be8d);});})[_0xc15e('0x2b')](function(){return new BPromise(function(_0x123611,_0x5812ff){rimraf(_0x5061df,function(_0x562ade){if(_0x562ade)_0x5812ff(_0x562ade);return _0x123611();});});})[_0xc15e('0x2b')](function(){return _0x5ab9ca[_0xc15e('0xd4')](_0x430142,_0x303f9b,function(_0x51ee90){if(_0x51ee90){console[_0xc15e('0xdf')](_0xc15e('0xe0'),_0x51ee90);}else{fs['unlinkSync'](_0x430142);}});});});}else{return _0x5ab9ca[_0xc15e('0x2d')](0xc8);}})['catch'](handleError(_0x5ab9ca,null));};
\ No newline at end of file
index 04131fc..bd65e8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x642d=['getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove'];(function(_0x2cf35d,_0x584467){var _0x56deae=function(_0x266298){while(--_0x266298){_0x2cf35d['push'](_0x2cf35d['shift']());}};_0x56deae(++_0x584467);}(_0x642d,0x19b));var _0xd642=function(_0x3d0846,_0x5b7abc){_0x3d0846=_0x3d0846-0x0;var _0xa4697e=_0x642d[_0x3d0846];return _0xa4697e;};'use strict';var EventEmitter=require(_0xd642('0x0'));var FaxInteraction=require(_0xd642('0x1'))['db'][_0xd642('0x2')];var FaxMessage=require(_0xd642('0x1'))['db'][_0xd642('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xd642('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd642('0x5'),'afterDestroy':_0xd642('0x6')};function emitEvent(_0x155fff){return function(_0x4e9d09,_0x7b35c,_0x4ffd81){_0x4e9d09[_0xd642('0x7')]({'attributes':['id'],'raw':!![]})[_0xd642('0x8')](function(_0x2ded13){_0x4e9d09[_0xd642('0x9')](_0xd642('0xa'),_0x2ded13[_0xd642('0xb')](function(_0x360acf){return{'id':_0x360acf['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x4e9d09['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x198d14){_0x4e9d09[_0xd642('0x9')](_0xd642('0xc'),_0x198d14[_0xd642('0xd')]);FaxInteractionEvents[_0xd642('0xe')](_0x155fff+':'+_0x4e9d09['id'],_0x4e9d09);FaxInteractionEvents[_0xd642('0xe')](_0x155fff,_0x4e9d09);_0x4ffd81(null);})[_0xd642('0xf')](_0x4ffd81(null));};}for(var e in events){if(events[_0xd642('0x10')](e)){var event=events[e];FaxInteraction[_0xd642('0x11')](e,emitEvent(event));}}module[_0xd642('0x12')]=FaxInteractionEvents;
\ No newline at end of file
+var _0xe74f=['catch','hasOwnProperty','hook','exports','../../mysqldb','FaxMessage','setMaxListeners','save','update','getUsers','Users','map','findAll','then','setDataValue','unreadMessages','emit'];(function(_0x35f3eb,_0x495f8a){var _0x1d4fbf=function(_0x1a541f){while(--_0x1a541f){_0x35f3eb['push'](_0x35f3eb['shift']());}};_0x1d4fbf(++_0x495f8a);}(_0xe74f,0x1e0));var _0xfe74=function(_0x36f47c,_0x38ef4d){_0x36f47c=_0x36f47c-0x0;var _0x296c55=_0xe74f[_0x36f47c];return _0x296c55;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xfe74('0x0'))['db']['FaxInteraction'];var FaxMessage=require(_0xfe74('0x0'))['db'][_0xfe74('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xfe74('0x2')](0x0);var events={'afterCreate':_0xfe74('0x3'),'afterUpdate':_0xfe74('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5b144e){return function(_0x4e7868,_0x5e57d0,_0x468362){_0x4e7868[_0xfe74('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x25f013){_0x4e7868['setDataValue'](_0xfe74('0x6'),_0x25f013[_0xfe74('0x7')](function(_0x3bd8df){return{'id':_0x3bd8df['id']};}));return FaxMessage[_0xfe74('0x8')]({'where':{'FaxInteractionId':_0x4e7868['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfe74('0x9')](function(_0x49946a){_0x4e7868[_0xfe74('0xa')](_0xfe74('0xb'),_0x49946a['length']);FaxInteractionEvents[_0xfe74('0xc')](_0x5b144e+':'+_0x4e7868['id'],_0x4e7868);FaxInteractionEvents[_0xfe74('0xc')](_0x5b144e,_0x4e7868);_0x468362(null);})[_0xfe74('0xd')](_0x468362(null));};}for(var e in events){if(events[_0xfe74('0xe')](e)){var event=events[e];FaxInteraction[_0xfe74('0xf')](e,emitEvent(event));}}module[_0xfe74('0x10')]=FaxInteractionEvents;
\ No newline at end of file
index 467df57..396c287 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf56c=['exports','define','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes'];(function(_0xf6512f,_0x672e9e){var _0x2adc18=function(_0x1a0b87){while(--_0x1a0b87){_0xf6512f['push'](_0xf6512f['shift']());}};_0x2adc18(++_0x672e9e);}(_0xf56c,0x67));var _0xcf56=function(_0x3ee336,_0x1f1230){_0x3ee336=_0x3ee336-0x0;var _0x4aa413=_0xf56c[_0x3ee336];return _0x4aa413;};'use strict';var _=require('lodash');var util=require(_0xcf56('0x0'));var logger=require(_0xcf56('0x1'))(_0xcf56('0x2'));var moment=require(_0xcf56('0x3'));var BPromise=require('bluebird');var rp=require(_0xcf56('0x4'));var fs=require('fs');var path=require(_0xcf56('0x5'));var rimraf=require(_0xcf56('0x6'));var config=require(_0xcf56('0x7'));var attributes=require(_0xcf56('0x8'));module[_0xcf56('0x9')]=function(_0x33ce84,_0x503792){return _0x33ce84[_0xcf56('0xa')]('FaxInteraction',attributes,{'tableName':_0xcf56('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x27032f,_0x2bfc1f,_0x3cbf1){if(_0x27032f[_0xcf56('0xc')]('closed')){_0x27032f[_0xcf56('0xd')]=moment()[_0xcf56('0xe')](_0xcf56('0xf'));}_0x3cbf1(null,_0x27032f);}}});};
\ No newline at end of file
+var _0x7490=['fax_interactions','changed','closed','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','FaxInteraction'];(function(_0x2a0bb0,_0x1fa696){var _0x5552c9=function(_0x1bc803){while(--_0x1bc803){_0x2a0bb0['push'](_0x2a0bb0['shift']());}};_0x5552c9(++_0x1fa696);}(_0x7490,0xc5));var _0x0749=function(_0x1633d1,_0x594d4a){_0x1633d1=_0x1633d1-0x0;var _0x1da611=_0x7490[_0x1633d1];return _0x1da611;};'use strict';var _=require(_0x0749('0x0'));var util=require(_0x0749('0x1'));var logger=require(_0x0749('0x2'))(_0x0749('0x3'));var moment=require(_0x0749('0x4'));var BPromise=require(_0x0749('0x5'));var rp=require(_0x0749('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0749('0x7'));var config=require(_0x0749('0x8'));var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x4f9ed9,_0x2fea25){return _0x4f9ed9[_0x0749('0x9')](_0x0749('0xa'),attributes,{'tableName':_0x0749('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2cf119,_0x31acf1,_0x258fe2){if(_0x2cf119[_0x0749('0xc')](_0x0749('0xd'))){_0x2cf119[_0x0749('0xe')]=moment()[_0x0749('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x258fe2(null,_0x2cf119);}}});};
\ No newline at end of file
index 10c2d47..2a2a782 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc052=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./faxInteraction.socket','register','then','request\x20sent','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateFaxInteraction','options','raw','where','attributes','limit','debug','FaxInteraction','find','addTags','body','ids','omit','AddTags','util','moment','bluebird'];(function(_0x55352a,_0x3f67b6){var _0x240bda=function(_0xf9a4bf){while(--_0xf9a4bf){_0x55352a['push'](_0x55352a['shift']());}};_0x240bda(++_0x3f67b6);}(_0xc052,0x1b5));var _0x2c05=function(_0x360262,_0x1d4af8){_0x360262=_0x360262-0x0;var _0x42db18=_0xc052[_0x360262];return _0x42db18;};'use strict';var _=require('lodash');var util=require(_0x2c05('0x0'));var moment=require(_0x2c05('0x1'));var BPromise=require(_0x2c05('0x2'));var rs=require(_0x2c05('0x3'));var fs=require('fs');var Redis=require(_0x2c05('0x4'));var db=require(_0x2c05('0x5'))['db'];var utils=require(_0x2c05('0x6'));var logger=require('../../config/logger')(_0x2c05('0x7'));var config=require(_0x2c05('0x8'));var jayson=require(_0x2c05('0x9'));var client=jayson[_0x2c05('0xa')]['http']({'port':0x232a});config[_0x2c05('0xb')]=_[_0x2c05('0xc')](config[_0x2c05('0xb')],{'host':_0x2c05('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2c05('0xb')]));require(_0x2c05('0xe'))[_0x2c05('0xf')](socket);function respondWithRpcPromise(_0x150673,_0xb34856,_0x58f2ad){return new BPromise(function(_0x71e835,_0x523252){return client['request'](_0x150673,_0x58f2ad)[_0x2c05('0x10')](function(_0x118b88){logger['info']('FaxInteraction,\x20%s,\x20%s',_0xb34856,_0x2c05('0x11'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0xb34856,_0x2c05('0x11'),JSON[_0x2c05('0x12')](_0x118b88));if(_0x118b88[_0x2c05('0x13')]){if(_0x118b88[_0x2c05('0x13')][_0x2c05('0x14')]===0x1f4){logger[_0x2c05('0x13')](_0x2c05('0x15'),_0xb34856,_0x118b88[_0x2c05('0x13')][_0x2c05('0x16')]);return _0x523252(_0x118b88['error'][_0x2c05('0x16')]);}logger[_0x2c05('0x13')](_0x2c05('0x15'),_0xb34856,_0x118b88[_0x2c05('0x13')]['message']);return _0x71e835(_0x118b88[_0x2c05('0x13')][_0x2c05('0x16')]);}else{logger[_0x2c05('0x17')](_0x2c05('0x15'),_0xb34856,_0x2c05('0x11'));_0x71e835(_0x118b88[_0x2c05('0x18')][_0x2c05('0x16')]);}})[_0x2c05('0x19')](function(_0x124cb7){logger[_0x2c05('0x13')](_0x2c05('0x15'),_0xb34856,_0x124cb7);_0x523252(_0x124cb7);});});}exports[_0x2c05('0x1a')]=function(_0x20303e){var _0x4089f9=this;return new Promise(function(_0x35ec13,_0x428bc3){return db['FaxInteraction']['update'](_0x20303e['body'],{'raw':_0x20303e[_0x2c05('0x1b')]?_0x20303e[_0x2c05('0x1b')][_0x2c05('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20303e[_0x2c05('0x1b')]?_0x20303e[_0x2c05('0x1b')][_0x2c05('0x1d')]||null:null,'attributes':_0x20303e[_0x2c05('0x1b')]?_0x20303e[_0x2c05('0x1b')][_0x2c05('0x1e')]||null:null,'limit':_0x20303e[_0x2c05('0x1b')]?_0x20303e[_0x2c05('0x1b')][_0x2c05('0x1f')]||null:null})[_0x2c05('0x10')](function(_0x583d1d){logger[_0x2c05('0x17')](_0x2c05('0x1a'),_0x20303e);logger[_0x2c05('0x20')](_0x2c05('0x1a'),_0x20303e,JSON[_0x2c05('0x12')](_0x583d1d));_0x35ec13(_0x583d1d);})[_0x2c05('0x19')](function(_0x5d7278){logger[_0x2c05('0x13')]('UpdateFaxInteraction',_0x5d7278['message'],_0x20303e);_0x428bc3(_0x4089f9[_0x2c05('0x13')](0x1f4,_0x5d7278[_0x2c05('0x16')]));});});};exports['AddTagsToFaxInteraction']=function(_0x2e9ef2){return new Promise(function(_0x556524,_0x5f22b6){return db[_0x2c05('0x21')][_0x2c05('0x22')]({'where':_0x2e9ef2[_0x2c05('0x1b')]?_0x2e9ef2[_0x2c05('0x1b')][_0x2c05('0x1d')]||null:null})[_0x2c05('0x10')](function(_0x1e2a7f){if(_0x1e2a7f){return _0x1e2a7f[_0x2c05('0x23')](_0x2e9ef2[_0x2c05('0x24')][_0x2c05('0x25')],_[_0x2c05('0x26')](_0x2e9ef2[_0x2c05('0x24')],[_0x2c05('0x25'),'id'])||{});}})['spread'](function(_0x501372){logger[_0x2c05('0x17')](_0x2c05('0x27'),_0x2e9ef2);logger[_0x2c05('0x20')]('AddTags',_0x2e9ef2,JSON[_0x2c05('0x12')](_0x501372));_0x556524(_0x501372);})[_0x2c05('0x19')](function(_0x4dea60){logger[_0x2c05('0x13')](_0x2c05('0x27'),_0x4dea60[_0x2c05('0x16')],_0x2e9ef2);_0x5f22b6(_this[_0x2c05('0x13')](0x1f4,_0x4dea60[_0x2c05('0x16')]));});});};
\ No newline at end of file
+var _0xa1a5=['request','then','info','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','ids','omit','spread','AddTags','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x253a54,_0x262408){var _0x3e2a9b=function(_0x20d8fe){while(--_0x20d8fe){_0x253a54['push'](_0x253a54['shift']());}};_0x3e2a9b(++_0x262408);}(_0xa1a5,0x14f));var _0x5a1a=function(_0x3c4e59,_0x3af01a){_0x3c4e59=_0x3c4e59-0x0;var _0x4eb7e4=_0xa1a5[_0x3c4e59];return _0x4eb7e4;};'use strict';var _=require(_0x5a1a('0x0'));var util=require(_0x5a1a('0x1'));var moment=require(_0x5a1a('0x2'));var BPromise=require(_0x5a1a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a1a('0x4'));var db=require(_0x5a1a('0x5'))['db'];var utils=require(_0x5a1a('0x6'));var logger=require(_0x5a1a('0x7'))(_0x5a1a('0x8'));var config=require(_0x5a1a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5a1a('0xa')][_0x5a1a('0xb')]({'port':0x232a});config[_0x5a1a('0xc')]=_[_0x5a1a('0xd')](config[_0x5a1a('0xc')],{'host':_0x5a1a('0xe'),'port':0x18eb});var socket=require(_0x5a1a('0xf'))(new Redis(config[_0x5a1a('0xc')]));require('./faxInteraction.socket')[_0x5a1a('0x10')](socket);function respondWithRpcPromise(_0x560025,_0x4a3f69,_0x5fc806){return new BPromise(function(_0x110f5e,_0x15d577){return client[_0x5a1a('0x11')](_0x560025,_0x5fc806)[_0x5a1a('0x12')](function(_0x36ef85){logger[_0x5a1a('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x4a3f69,_0x5a1a('0x14'));logger['debug'](_0x5a1a('0x15'),_0x4a3f69,_0x5a1a('0x14'),JSON[_0x5a1a('0x16')](_0x36ef85));if(_0x36ef85[_0x5a1a('0x17')]){if(_0x36ef85[_0x5a1a('0x17')]['code']===0x1f4){logger[_0x5a1a('0x17')](_0x5a1a('0x18'),_0x4a3f69,_0x36ef85[_0x5a1a('0x17')][_0x5a1a('0x19')]);return _0x15d577(_0x36ef85['error'][_0x5a1a('0x19')]);}logger[_0x5a1a('0x17')](_0x5a1a('0x18'),_0x4a3f69,_0x36ef85[_0x5a1a('0x17')][_0x5a1a('0x19')]);return _0x110f5e(_0x36ef85[_0x5a1a('0x17')]['message']);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x4a3f69,'request\x20sent');_0x110f5e(_0x36ef85[_0x5a1a('0x1a')][_0x5a1a('0x19')]);}})[_0x5a1a('0x1b')](function(_0x2acac0){logger[_0x5a1a('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x4a3f69,_0x2acac0);_0x15d577(_0x2acac0);});});}exports[_0x5a1a('0x1c')]=function(_0x15dfd9){var _0x8808e6=this;return new Promise(function(_0x306495,_0x1f71ae){return db[_0x5a1a('0x1d')][_0x5a1a('0x1e')](_0x15dfd9[_0x5a1a('0x1f')],{'raw':_0x15dfd9[_0x5a1a('0x20')]?_0x15dfd9[_0x5a1a('0x20')][_0x5a1a('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15dfd9['options']?_0x15dfd9[_0x5a1a('0x20')][_0x5a1a('0x22')]||null:null,'attributes':_0x15dfd9[_0x5a1a('0x20')]?_0x15dfd9['options'][_0x5a1a('0x23')]||null:null,'limit':_0x15dfd9[_0x5a1a('0x20')]?_0x15dfd9[_0x5a1a('0x20')][_0x5a1a('0x24')]||null:null})[_0x5a1a('0x12')](function(_0x2fe933){logger['info'](_0x5a1a('0x1c'),_0x15dfd9);logger['debug'](_0x5a1a('0x1c'),_0x15dfd9,JSON[_0x5a1a('0x16')](_0x2fe933));_0x306495(_0x2fe933);})[_0x5a1a('0x1b')](function(_0x34243d){logger['error'](_0x5a1a('0x1c'),_0x34243d[_0x5a1a('0x19')],_0x15dfd9);_0x1f71ae(_0x8808e6['error'](0x1f4,_0x34243d[_0x5a1a('0x19')]));});});};exports[_0x5a1a('0x25')]=function(_0xb641c7){return new Promise(function(_0x134ba6,_0x41ddfb){return db[_0x5a1a('0x1d')][_0x5a1a('0x26')]({'where':_0xb641c7[_0x5a1a('0x20')]?_0xb641c7[_0x5a1a('0x20')][_0x5a1a('0x22')]||null:null})[_0x5a1a('0x12')](function(_0x1e22f3){if(_0x1e22f3){return _0x1e22f3['addTags'](_0xb641c7[_0x5a1a('0x1f')][_0x5a1a('0x27')],_[_0x5a1a('0x28')](_0xb641c7['body'],[_0x5a1a('0x27'),'id'])||{});}})[_0x5a1a('0x29')](function(_0x306f6c){logger[_0x5a1a('0x13')](_0x5a1a('0x2a'),_0xb641c7);logger[_0x5a1a('0x2b')](_0x5a1a('0x2a'),_0xb641c7,JSON['stringify'](_0x306f6c));_0x134ba6(_0x306f6c);})[_0x5a1a('0x1b')](function(_0x2cd00f){logger[_0x5a1a('0x17')](_0x5a1a('0x2a'),_0x2cd00f['message'],_0xb641c7);_0x41ddfb(_this[_0x5a1a('0x17')](0x1f4,_0x2cd00f['message']));});});};
\ No newline at end of file
index 6e28393..692dc2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07ed=['faxInteraction:','./faxInteraction.events','save','remove','update','register','length'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0x07ed,0x1c1));var _0xd07e=function(_0x2f6167,_0x194b1b){_0x2f6167=_0x2f6167-0x0;var _0x51ed92=_0x07ed[_0x2f6167];return _0x51ed92;};'use strict';var FaxInteractionEvents=require(_0xd07e('0x0'));var events=[_0xd07e('0x1'),_0xd07e('0x2'),_0xd07e('0x3')];function createListener(_0x142066,_0x44ecc6){return function(_0x43f5dd){_0x44ecc6['emit'](_0x142066,_0x43f5dd);};}function removeListener(_0x204b0e,_0xebb2a0){return function(){FaxInteractionEvents['removeListener'](_0x204b0e,_0xebb2a0);};}exports[_0xd07e('0x4')]=function(_0x2d8cb2){for(var _0x517b03=0x0,_0x10f0d5=events[_0xd07e('0x5')];_0x517b03<_0x10f0d5;_0x517b03++){var _0x4c8262=events[_0x517b03];var _0x59ff22=createListener(_0xd07e('0x6')+_0x4c8262,_0x2d8cb2);FaxInteractionEvents['on'](_0x4c8262,_0x59ff22);}};
\ No newline at end of file
+var _0xa86e=['emit','length','faxInteraction:','./faxInteraction.events','remove','update'];(function(_0x2265d6,_0x2a385d){var _0x1fc6b8=function(_0x5e84f6){while(--_0x5e84f6){_0x2265d6['push'](_0x2265d6['shift']());}};_0x1fc6b8(++_0x2a385d);}(_0xa86e,0x18f));var _0xea86=function(_0xd50ec2,_0x13008b){_0xd50ec2=_0xd50ec2-0x0;var _0x4bd744=_0xa86e[_0xd50ec2];return _0x4bd744;};'use strict';var FaxInteractionEvents=require(_0xea86('0x0'));var events=['save',_0xea86('0x1'),_0xea86('0x2')];function createListener(_0x2ea3b5,_0x47e7a0){return function(_0x5764c0){_0x47e7a0[_0xea86('0x3')](_0x2ea3b5,_0x5764c0);};}function removeListener(_0x3bf9b7,_0x579c5d){return function(){FaxInteractionEvents['removeListener'](_0x3bf9b7,_0x579c5d);};}exports['register']=function(_0x7c8c2a){for(var _0x435208=0x0,_0x25219b=events[_0xea86('0x4')];_0x435208<_0x25219b;_0x435208++){var _0x2c27a2=events[_0x435208];var _0x5151ac=createListener(_0xea86('0x5')+_0x2c27a2,_0x7c8c2a);FaxInteractionEvents['on'](_0x2c27a2,_0x5151ac);}};
\ No newline at end of file
index 89d3efb..6acd9bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdce3=['addMessage','post','/:id/tags','tracked','fax','faxinteraction:addtags','put','faxinteraction:update','update','delete','/:id','faxinteraction:destroy','destroy','removeTags','exports','multer','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','show','/:id/messages','getMessages','create'];(function(_0x457b64,_0x49a219){var _0x437111=function(_0x3dad3d){while(--_0x3dad3d){_0x457b64['push'](_0x457b64['shift']());}};_0x437111(++_0x49a219);}(_0xdce3,0xd3));var _0x3dce=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdce3[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x3dce('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3dce('0x1')]();var fs_extra=require(_0x3dce('0x2'));var auth=require(_0x3dce('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3dce('0x4'));var controller=require(_0x3dce('0x5'));router[_0x3dce('0x6')]('/',auth[_0x3dce('0x7')](),controller[_0x3dce('0x8')]);router[_0x3dce('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x3dce('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x3dce('0x9')]);router[_0x3dce('0x6')](_0x3dce('0xa'),auth[_0x3dce('0x7')](),controller[_0x3dce('0xb')]);router[_0x3dce('0x6')]('/:id/download',auth[_0x3dce('0x7')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x3dce('0xc')]);router['post'](_0x3dce('0xa'),auth['isAuthenticated'](),controller[_0x3dce('0xd')]);router[_0x3dce('0xe')](_0x3dce('0xf'),auth[_0x3dce('0x7')](),interaction[_0x3dce('0x10')](_0x3dce('0x11'),_0x3dce('0x12')),controller['addTags']);router[_0x3dce('0x13')]('/:id',auth[_0x3dce('0x7')](),interaction[_0x3dce('0x10')](_0x3dce('0x11'),_0x3dce('0x14')),controller[_0x3dce('0x15')]);router[_0x3dce('0x16')](_0x3dce('0x17'),auth[_0x3dce('0x7')](),interaction[_0x3dce('0x10')](_0x3dce('0x11'),_0x3dce('0x18')),controller[_0x3dce('0x19')]);router['delete'](_0x3dce('0xf'),auth[_0x3dce('0x7')](),controller[_0x3dce('0x1a')]);module[_0x3dce('0x1b')]=router;
\ No newline at end of file
+var _0x5541=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','describe','/:id','isAuthenticated','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','faxinteraction:addtags','addTags','tracked','fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5541,0x1df));var _0x1554=function(_0x1e8b1e,_0x407bbd){_0x1e8b1e=_0x1e8b1e-0x0;var _0x4a0fde=_0x5541[_0x1e8b1e];return _0x4a0fde;};'use strict';var multer=require(_0x1554('0x0'));var util=require('util');var path=require(_0x1554('0x1'));var timeout=require(_0x1554('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1554('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1554('0x4'));var config=require(_0x1554('0x5'));var controller=require(_0x1554('0x6'));router[_0x1554('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1554('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x1554('0x8')]);router[_0x1554('0x7')](_0x1554('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x1554('0x7')]('/:id/messages',auth[_0x1554('0xa')](),controller[_0x1554('0xb')]);router[_0x1554('0x7')](_0x1554('0xc'),auth[_0x1554('0xa')](),controller[_0x1554('0xd')]);router[_0x1554('0xe')]('/',auth['isAuthenticated'](),controller[_0x1554('0xf')]);router[_0x1554('0xe')](_0x1554('0x10'),auth[_0x1554('0xa')](),controller[_0x1554('0x11')]);router['post'](_0x1554('0x12'),auth[_0x1554('0xa')](),interaction['tracked']('fax',_0x1554('0x13')),controller[_0x1554('0x14')]);router['put'](_0x1554('0x9'),auth[_0x1554('0xa')](),interaction[_0x1554('0x15')](_0x1554('0x16'),_0x1554('0x17')),controller[_0x1554('0x18')]);router[_0x1554('0x19')](_0x1554('0x9'),auth[_0x1554('0xa')](),interaction[_0x1554('0x15')](_0x1554('0x16'),_0x1554('0x1a')),controller[_0x1554('0x1b')]);router['delete'](_0x1554('0x12'),auth[_0x1554('0xa')](),controller[_0x1554('0x1c')]);module[_0x1554('0x1d')]=router;
\ No newline at end of file
index 3f1bae8..94d1ec4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf120=['TEXT','medium','ENUM','out','DATE','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf120,0x179));var _0x0f12=function(_0x500501,_0x1ab89e){_0x500501=_0x500501-0x0;var _0x487b31=_0xf120[_0x500501];return _0x487b31;};'use strict';var Sequelize=require('sequelize');module[_0x0f12('0x0')]={'body':{'type':Sequelize[_0x0f12('0x1')](_0x0f12('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0f12('0x3')]('in',_0x0f12('0x4')),'defaultValue':_0x0f12('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x0f12('0x5')]}};
\ No newline at end of file
+var _0x8664=['ENUM','out','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x23bfbb,_0x3b0fa2){var _0x383576=function(_0x116419){while(--_0x116419){_0x23bfbb['push'](_0x23bfbb['shift']());}};_0x383576(++_0x3b0fa2);}(_0x8664,0x11a));var _0x4866=function(_0x2b1612,_0x463a28){_0x2b1612=_0x2b1612-0x0;var _0x17e919=_0x8664[_0x2b1612];return _0x17e919;};'use strict';var Sequelize=require(_0x4866('0x0'));module[_0x4866('0x1')]={'body':{'type':Sequelize[_0x4866('0x2')](_0x4866('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4866('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4866('0x5')]('in',_0x4866('0x6')),'defaultValue':_0x4866('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x4866('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index 671a4e1..92d2dd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb58=['rejectMessage','ContactId','QueryTypes','User','motionChannel','rejectmessage','create','CmContact','findOne','SendFax','FaxAccountId','basename','download','join','root','server','files','attachments','Attachment','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','FaxMessage','fieldName','type','key','map','query','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','includeAll','include','findAll','params','rawAttributes','length','options','find','body','describe','../../config/logger','fax-interactions','accept','read','readAt','format','UserId','get','FaxInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','fullname','email','internal','agent','manual','interface','SIP/%s','channel','event','EventManager','fax','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfb58,0x12b));var _0x8fb5=function(_0x167ed1,_0x293290){_0x167ed1=_0x167ed1-0x0;var _0x373386=_0xfb58[_0x167ed1];return _0x373386;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8fb5('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8fb5('0x1'));var moment=require('moment');var BPromise=require(_0x8fb5('0x2'));var Mustache=require(_0x8fb5('0x3'));var util=require(_0x8fb5('0x4'));var path=require(_0x8fb5('0x5'));var sox=require(_0x8fb5('0x6'));var csv=require(_0x8fb5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8fb5('0x8'));var squel=require(_0x8fb5('0x9'));var crypto=require('crypto');var jsforce=require(_0x8fb5('0xa'));var deskjs=require(_0x8fb5('0xb'));var toCsv=require(_0x8fb5('0x7'));var querystring=require(_0x8fb5('0xc'));var Papa=require(_0x8fb5('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8fb5('0xe'));var as=require(_0x8fb5('0xf'));var hardwareService=require(_0x8fb5('0x10'));var logger=require('../../config/logger')(_0x8fb5('0x11'));var utils=require(_0x8fb5('0x12'));var config=require(_0x8fb5('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x8fb5('0x14'))['db'];config['redis']=_['defaults'](config[_0x8fb5('0x15')],{'host':_0x8fb5('0x16'),'port':0x18eb});var socket=require(_0x8fb5('0x17'))(new Redis(config[_0x8fb5('0x15')]));require(_0x8fb5('0x18'))[_0x8fb5('0x19')](socket);var jayson=require(_0x8fb5('0x1a'));var client=jayson[_0x8fb5('0x1b')][_0x8fb5('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a02ac,_0x3432f1,_0x5a5654,_0x2c5cf4){return new BPromise(function(_0x4ae92a,_0x505b6a){var _0x345568=_0x2c5cf4||client;return _0x345568['request'](_0x2a02ac,_0x5a5654)[_0x8fb5('0x1d')](function(_0x540450){logger[_0x8fb5('0x1e')](_0x8fb5('0x1f'),_0x3432f1,_0x8fb5('0x20'));logger['debug'](_0x8fb5('0x21'),_0x3432f1,'request\x20sent',JSON['stringify'](_0x540450));if(_0x540450[_0x8fb5('0x22')]){if(_0x540450[_0x8fb5('0x22')]['code']===0x1f4){logger[_0x8fb5('0x22')](_0x8fb5('0x1f'),_0x3432f1,_0x540450['error'][_0x8fb5('0x23')]);return _0x505b6a(_0x540450[_0x8fb5('0x22')][_0x8fb5('0x23')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x3432f1,_0x540450[_0x8fb5('0x22')][_0x8fb5('0x23')]);return _0x4ae92a(_0x540450[_0x8fb5('0x22')][_0x8fb5('0x23')]);}else{logger[_0x8fb5('0x1e')]('FaxMessage,\x20%s,\x20%s',_0x3432f1,_0x8fb5('0x20'));_0x4ae92a(_0x540450['result'][_0x8fb5('0x23')]);}})[_0x8fb5('0x24')](function(_0x2e7d05){logger['error'](_0x8fb5('0x1f'),_0x3432f1,_0x2e7d05);_0x505b6a(_0x2e7d05);});});}function respondWithStatusCode(_0x39e728,_0x1615ed){_0x1615ed=_0x1615ed||0xcc;return function(_0x336b5f){if(_0x336b5f){return _0x39e728[_0x8fb5('0x25')](_0x1615ed);}return _0x39e728[_0x8fb5('0x26')](_0x1615ed)[_0x8fb5('0x27')]();};}function respondWithResult(_0x5e4696,_0x165852){_0x165852=_0x165852||0xc8;return function(_0x153f69){if(_0x153f69){return _0x5e4696[_0x8fb5('0x26')](_0x165852)[_0x8fb5('0x28')](_0x153f69);}};}function respondWithFilteredResult(_0xf9b1d0,_0x5045cf){return function(_0x2819a7){if(_0x2819a7){var _0x22586c=typeof _0x5045cf['offset']===_0x8fb5('0x29')&&typeof _0x5045cf['limit']===_0x8fb5('0x29');var _0x2085f1=_0x2819a7[_0x8fb5('0x2a')];var _0x3ba42e=_0x22586c?0x0:_0x5045cf[_0x8fb5('0x2b')];var _0x30b271=_0x22586c?_0x2819a7[_0x8fb5('0x2a')]:_0x5045cf[_0x8fb5('0x2b')]+_0x5045cf[_0x8fb5('0x2c')];var _0x128094;if(_0x30b271>=_0x2085f1){_0x30b271=_0x2085f1;_0x128094=0xc8;}else{_0x128094=0xce;}_0xf9b1d0[_0x8fb5('0x26')](_0x128094);return _0xf9b1d0[_0x8fb5('0x2d')](_0x8fb5('0x2e'),_0x3ba42e+'-'+_0x30b271+'/'+_0x2085f1)[_0x8fb5('0x28')](_0x2819a7);}return null;};}function patchUpdates(_0x2620f6){return function(_0x18ae6e){try{jsonpatch[_0x8fb5('0x2f')](_0x18ae6e,_0x2620f6,!![]);}catch(_0x3ef559){return BPromise[_0x8fb5('0x30')](_0x3ef559);}return _0x18ae6e[_0x8fb5('0x31')]();};}function saveUpdates(_0x1982e5,_0x2730f7){return function(_0x53cda5){if(_0x53cda5){return _0x53cda5[_0x8fb5('0x32')](_0x1982e5)[_0x8fb5('0x1d')](function(_0x54cf90){return _0x54cf90;});}return null;};}function removeEntity(_0x3139c4,_0x436f29){return function(_0x2d69f1){if(_0x2d69f1){return _0x2d69f1[_0x8fb5('0x33')]()[_0x8fb5('0x1d')](function(){_0x3139c4['status'](0xcc)[_0x8fb5('0x27')]();});}};}function handleEntityNotFound(_0x27e7e1,_0x547a45){return function(_0x569fd2){if(!_0x569fd2){_0x27e7e1[_0x8fb5('0x25')](0x194);}return _0x569fd2;};}function handleError(_0x15246a,_0x25ca3a){_0x25ca3a=_0x25ca3a||0x1f4;return function(_0xd65d6c){logger[_0x8fb5('0x22')](_0xd65d6c['stack']);if(_0xd65d6c[_0x8fb5('0x34')]){delete _0xd65d6c[_0x8fb5('0x34')];}_0x15246a['status'](_0x25ca3a)[_0x8fb5('0x35')](_0xd65d6c);};}exports[_0x8fb5('0x36')]=function(_0x1af8d3,_0xd684bb){var _0x37b70a={},_0x56e3cd={},_0x54b589={'count':0x0,'rows':[]};var _0x5348cd=_['map'](db[_0x8fb5('0x37')]['rawAttributes'],function(_0x971f52){return{'name':_0x971f52[_0x8fb5('0x38')],'type':_0x971f52[_0x8fb5('0x39')][_0x8fb5('0x3a')]};});_0x56e3cd['model']=_[_0x8fb5('0x3b')](_0x5348cd,_0x8fb5('0x34'));_0x56e3cd[_0x8fb5('0x3c')]=_['keys'](_0x1af8d3[_0x8fb5('0x3c')]);_0x56e3cd['filters']=_['intersection'](_0x56e3cd[_0x8fb5('0x3d')],_0x56e3cd[_0x8fb5('0x3c')]);_0x37b70a[_0x8fb5('0x3e')]=_[_0x8fb5('0x3f')](_0x56e3cd[_0x8fb5('0x3d')],qs[_0x8fb5('0x40')](_0x1af8d3[_0x8fb5('0x3c')]['fields']));_0x37b70a[_0x8fb5('0x3e')]=_0x37b70a[_0x8fb5('0x3e')]['length']?_0x37b70a[_0x8fb5('0x3e')]:_0x56e3cd[_0x8fb5('0x3d')];if(!_0x1af8d3[_0x8fb5('0x3c')][_0x8fb5('0x41')](_0x8fb5('0x42'))){_0x37b70a[_0x8fb5('0x2c')]=qs[_0x8fb5('0x2c')](_0x1af8d3[_0x8fb5('0x3c')]['limit']);_0x37b70a[_0x8fb5('0x2b')]=qs['offset'](_0x1af8d3[_0x8fb5('0x3c')][_0x8fb5('0x2b')]);}_0x37b70a['order']=qs[_0x8fb5('0x43')](_0x1af8d3['query'][_0x8fb5('0x43')]);_0x37b70a[_0x8fb5('0x44')]=qs[_0x8fb5('0x45')](_[_0x8fb5('0x46')](_0x1af8d3[_0x8fb5('0x3c')],_0x56e3cd['filters']),_0x5348cd);if(_0x1af8d3[_0x8fb5('0x3c')][_0x8fb5('0x47')]){_0x37b70a['where']=_['merge'](_0x37b70a[_0x8fb5('0x44')],{'$or':_[_0x8fb5('0x3b')](_0x5348cd,function(_0x12c036){if(_0x12c036[_0x8fb5('0x39')]!=='VIRTUAL'){var _0x2ed5c7={};_0x2ed5c7[_0x12c036[_0x8fb5('0x34')]]={'$like':'%'+_0x1af8d3[_0x8fb5('0x3c')][_0x8fb5('0x47')]+'%'};return _0x2ed5c7;}})});}_0x37b70a=_[_0x8fb5('0x48')]({},_0x37b70a,_0x1af8d3['options']);var _0x37f7db={'where':_0x37b70a['where']};return db['FaxMessage'][_0x8fb5('0x2a')](_0x37f7db)['then'](function(_0x34a0e8){_0x54b589['count']=_0x34a0e8;if(_0x1af8d3['query'][_0x8fb5('0x49')]){_0x37b70a[_0x8fb5('0x4a')]=[{'all':!![]}];}return db[_0x8fb5('0x37')][_0x8fb5('0x4b')](_0x37b70a);})[_0x8fb5('0x1d')](function(_0x35be8a){_0x54b589['rows']=_0x35be8a;return _0x54b589;})['then'](respondWithFilteredResult(_0xd684bb,_0x37b70a))['catch'](handleError(_0xd684bb,null));};exports['show']=function(_0x1afc3d,_0x596a66){var _0x374095={'raw':!![],'where':{'id':_0x1afc3d[_0x8fb5('0x4c')]['id']}},_0x3bd1fb={};_0x3bd1fb[_0x8fb5('0x3d')]=_['keys'](db['FaxMessage'][_0x8fb5('0x4d')]);_0x3bd1fb[_0x8fb5('0x3c')]=_['keys'](_0x1afc3d[_0x8fb5('0x3c')]);_0x3bd1fb['filters']=_[_0x8fb5('0x3f')](_0x3bd1fb[_0x8fb5('0x3d')],_0x3bd1fb[_0x8fb5('0x3c')]);_0x374095[_0x8fb5('0x3e')]=_[_0x8fb5('0x3f')](_0x3bd1fb['model'],qs[_0x8fb5('0x40')](_0x1afc3d['query'][_0x8fb5('0x40')]));_0x374095[_0x8fb5('0x3e')]=_0x374095[_0x8fb5('0x3e')][_0x8fb5('0x4e')]?_0x374095[_0x8fb5('0x3e')]:_0x3bd1fb[_0x8fb5('0x3d')];if(_0x1afc3d['query']['includeAll']){_0x374095[_0x8fb5('0x4a')]=[{'all':!![]}];}_0x374095=_[_0x8fb5('0x48')]({},_0x374095,_0x1afc3d[_0x8fb5('0x4f')]);return db['FaxMessage'][_0x8fb5('0x50')](_0x374095)['then'](handleEntityNotFound(_0x596a66,null))[_0x8fb5('0x1d')](respondWithResult(_0x596a66,null))[_0x8fb5('0x24')](handleError(_0x596a66,null));};exports[_0x8fb5('0x32')]=function(_0x54e62b,_0x2669e2){if(_0x54e62b['body']['id']){delete _0x54e62b[_0x8fb5('0x51')]['id'];}return db[_0x8fb5('0x37')][_0x8fb5('0x50')]({'where':{'id':_0x54e62b['params']['id']}})[_0x8fb5('0x1d')](handleEntityNotFound(_0x2669e2,null))[_0x8fb5('0x1d')](saveUpdates(_0x54e62b[_0x8fb5('0x51')],null))[_0x8fb5('0x1d')](respondWithResult(_0x2669e2,null))[_0x8fb5('0x24')](handleError(_0x2669e2,null));};exports[_0x8fb5('0x33')]=function(_0x537d71,_0x2e11a3){return db[_0x8fb5('0x37')][_0x8fb5('0x50')]({'where':{'id':_0x537d71[_0x8fb5('0x4c')]['id']}})[_0x8fb5('0x1d')](handleEntityNotFound(_0x2e11a3,null))[_0x8fb5('0x1d')](removeEntity(_0x2e11a3,null))[_0x8fb5('0x24')](handleError(_0x2e11a3,null));};exports['describe']=function(_0xe176ca,_0x26b87e){return db['FaxMessage'][_0x8fb5('0x52')]()[_0x8fb5('0x1d')](respondWithResult(_0x26b87e,null))['catch'](handleError(_0x26b87e,null));};var interaction_log=require(_0x8fb5('0x53'))(_0x8fb5('0x54'));exports[_0x8fb5('0x55')]=function(_0x465e4a,_0x2de1a0,_0x4aacfc){var _0x2de4ce={'agent':{},'channel':'fax'};if(_0x465e4a[_0x8fb5('0x51')]['id']){delete _0x465e4a[_0x8fb5('0x51')]['id'];}_0x465e4a[_0x8fb5('0x51')][_0x8fb5('0x56')]=!![];_0x465e4a[_0x8fb5('0x51')][_0x8fb5('0x57')]=moment()[_0x8fb5('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x465e4a[_0x8fb5('0x51')][_0x8fb5('0x59')]=_0x465e4a[_0x8fb5('0x51')][_0x8fb5('0x59')]||_0x465e4a['user']['id'];_0x2de4ce['agent']['id']=_0x465e4a[_0x8fb5('0x51')]['UserId'];return db[_0x8fb5('0x37')][_0x8fb5('0x50')]({'where':{'id':_0x465e4a[_0x8fb5('0x4c')]['id'],'UserId':null}})[_0x8fb5('0x1d')](handleEntityNotFound(_0x2de1a0,null))[_0x8fb5('0x1d')](saveUpdates(_0x465e4a['body'],null))['then'](function(_0xae6608){if(_0xae6608){_0x2de4ce[_0x8fb5('0x23')]=_0xae6608[_0x8fb5('0x5a')]({'plain':!![]});return db[_0x8fb5('0x5b')][_0x8fb5('0x50')]({'where':{'id':_0xae6608['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2de1a0,null))[_0x8fb5('0x1d')](function(_0x41f0b8){if(_0x41f0b8){return _0x41f0b8[_0x8fb5('0x32')]({'UserId':_0x465e4a['body']['UserId'],'read1stAt':_[_0x8fb5('0x5c')](_0x41f0b8[_0x8fb5('0x5d')])?moment()[_0x8fb5('0x58')](_0x8fb5('0x5e')):undefined});}return null;})['then'](function(_0x37f7ab){if(_0x37f7ab){_0x2de4ce[_0x8fb5('0x5f')]=_0x37f7ab['get']({'plain':!![]});interaction_log[_0x8fb5('0x1e')](_0x8fb5('0x60'),_0x465e4a[_0x8fb5('0x61')]['id'],_0x465e4a['user'][_0x8fb5('0x34')],_0x465e4a['user'][_0x8fb5('0x62')],_0x2de4ce[_0x8fb5('0x5f')]['id'],_0x465e4a[_0x8fb5('0x51')]?JSON['stringify'](_0x465e4a['body']):_0x8fb5('0x63'));return respondWithRpcPromise('AcceptMessage',_0x8fb5('0x64'),_0x2de4ce);}return null;})['then'](function(_0x2df231){var _0x27b726=_0x8fb5('0x65')+_0x2df231[_0x8fb5('0x23')]['ContactId'];return db[_0x8fb5('0x66')][_0x8fb5('0x3c')](_0x27b726,{'type':db[_0x8fb5('0x67')]['QueryTypes'][_0x8fb5('0x68')],'raw':!![]})[_0x8fb5('0x1d')](function(_0x3ce4fb){return _0x3ce4fb;});})[_0x8fb5('0x1d')](function(_0x37bb2e){if(_0x37bb2e){_0x2de4ce[_0x8fb5('0x23')][_0x8fb5('0x69')]=_0x37bb2e[0x0];if(!_0x465e4a['body'][_0x8fb5('0x59')])return;return db['User']['find']({'where':{'id':_0x465e4a['body'][_0x8fb5('0x59')],'role':'agent'},'attributes':['id',_0x8fb5('0x34'),_0x8fb5('0x6a'),_0x8fb5('0x6b'),_0x8fb5('0x6c')],'raw':!![]});}return null;})['then'](function(_0x1abdc5){if(!_0x1abdc5)return null;_0x2de4ce['message'][_0x8fb5('0x6d')]=_0x1abdc5;return _0x2de4ce;})[_0x8fb5('0x1d')](function(_0x272bcd){if(_0x272bcd){if(_0x465e4a[_0x8fb5('0x51')][_0x8fb5('0x6e')]){_0x2de4ce[_0x8fb5('0x23')][_0x8fb5('0x6f')]=util[_0x8fb5('0x58')](_0x8fb5('0x70'),_0x465e4a[_0x8fb5('0x61')]['name']);_0x2de4ce['message']['channel']=_0x2de4ce['channel'];_0x2de4ce[_0x8fb5('0x23')]['motionChannel']=_0x2de4ce[_0x8fb5('0x71')];_0x2de4ce[_0x8fb5('0x23')][_0x8fb5('0x72')]='accept';return respondWithRpcPromise(_0x8fb5('0x73'),_0x8fb5('0x73'),{'event':'acceptmessage','message':_0x2de4ce[_0x8fb5('0x23')]},client9002)[_0x8fb5('0x1d')](function(){return _0x2de4ce;});}return _0x2de4ce;}return null;})['then'](respondWithResult(_0x2de1a0,null))[_0x8fb5('0x24')](handleError(_0x2de1a0,null));};var interaction_log=require(_0x8fb5('0x53'))(_0x8fb5('0x54'));exports[_0x8fb5('0x30')]=function(_0x4001ae,_0x4f433e,_0x26e8b4){var _0x47a4ad={'agent':{},'channel':_0x8fb5('0x74')};if(_0x4001ae[_0x8fb5('0x51')]['id']){delete _0x4001ae[_0x8fb5('0x51')]['id'];}_0x4001ae['body'][_0x8fb5('0x59')]=_0x4001ae[_0x8fb5('0x51')]['UserId']||_0x4001ae[_0x8fb5('0x61')]['id'];_0x47a4ad[_0x8fb5('0x6d')]['id']=_0x4001ae['body'][_0x8fb5('0x59')];return db[_0x8fb5('0x37')][_0x8fb5('0x50')]({'where':{'id':_0x4001ae['params']['id'],'UserId':null}})[_0x8fb5('0x1d')](handleEntityNotFound(_0x4f433e,null))[_0x8fb5('0x1d')](function(_0x566bd9){if(_0x566bd9){_0x47a4ad[_0x8fb5('0x23')]=_0x566bd9[_0x8fb5('0x5a')]({'plain':!![]});return db[_0x8fb5('0x5b')][_0x8fb5('0x50')]({'where':{'id':_0x566bd9[_0x8fb5('0x75')]}});}return null;})[_0x8fb5('0x1d')](handleEntityNotFound(_0x4f433e,null))[_0x8fb5('0x1d')](function(_0x410772){if(_0x410772){_0x47a4ad['interaction']=_0x410772[_0x8fb5('0x5a')]({'plain':!![]});interaction_log['info'](_0x8fb5('0x76'),_0x4001ae[_0x8fb5('0x61')]['id'],_0x4001ae[_0x8fb5('0x61')][_0x8fb5('0x34')],_0x4001ae['user']['role'],_0x47a4ad[_0x8fb5('0x5f')]['id'],_0x4001ae[_0x8fb5('0x51')]?JSON[_0x8fb5('0x77')](_0x4001ae[_0x8fb5('0x51')]):_0x8fb5('0x63'));return respondWithRpcPromise(_0x8fb5('0x78'),_0x8fb5('0x79'),_0x47a4ad);}return null;})[_0x8fb5('0x1d')](function(_0x1c50aa){var _0x353278=_0x8fb5('0x65')+_0x1c50aa['message'][_0x8fb5('0x7a')];return db[_0x8fb5('0x66')][_0x8fb5('0x3c')](_0x353278,{'type':db[_0x8fb5('0x67')][_0x8fb5('0x7b')]['SELECT'],'raw':!![]})['then'](function(_0x429741){return _0x429741;});})[_0x8fb5('0x1d')](function(_0x2b830f){if(_0x2b830f){_0x47a4ad[_0x8fb5('0x23')][_0x8fb5('0x69')]=_0x2b830f[0x0];if(!_0x4001ae[_0x8fb5('0x51')][_0x8fb5('0x59')])return;return db[_0x8fb5('0x7c')][_0x8fb5('0x50')]({'where':{'id':_0x4001ae[_0x8fb5('0x51')][_0x8fb5('0x59')],'role':_0x8fb5('0x6d')},'attributes':['id',_0x8fb5('0x34'),_0x8fb5('0x6a'),_0x8fb5('0x6b'),_0x8fb5('0x6c')],'raw':!![]});}return null;})[_0x8fb5('0x1d')](function(_0x184da2){if(!_0x184da2)return null;_0x47a4ad['message'][_0x8fb5('0x6d')]=_0x184da2;return _0x47a4ad;})[_0x8fb5('0x1d')](function(_0x47bb99){if(_0x47bb99){_0x47bb99[_0x8fb5('0x23')][_0x8fb5('0x6f')]=util[_0x8fb5('0x58')](_0x8fb5('0x70'),_0x4001ae[_0x8fb5('0x61')][_0x8fb5('0x34')]);_0x47bb99[_0x8fb5('0x23')][_0x8fb5('0x71')]=_0x47a4ad[_0x8fb5('0x71')];_0x47bb99[_0x8fb5('0x23')][_0x8fb5('0x7d')]=_0x47a4ad['channel'];_0x47bb99['message'][_0x8fb5('0x72')]=_0x8fb5('0x30');respondWithRpcPromise(_0x8fb5('0x73'),'EventManager',{'event':_0x8fb5('0x7e'),'message':_0x47bb99[_0x8fb5('0x23')]},client9002);return _0x47a4ad;}return null;})[_0x8fb5('0x1d')](respondWithResult(_0x4f433e,null))[_0x8fb5('0x24')](handleError(_0x4f433e,null));};exports['create']=function(_0x481283,_0x5efc4f){var _0x11b0da;return db[_0x8fb5('0x37')][_0x8fb5('0x7f')](_0x481283[_0x8fb5('0x51')],{})[_0x8fb5('0x1d')](function(_0x5f5356){_0x11b0da=_0x5f5356;return db[_0x8fb5('0x80')]['findOne']({'where':{'id':_0x11b0da[_0x8fb5('0x7a')]}});})[_0x8fb5('0x1d')](function(_0x5783f7){if(_[_0x8fb5('0x5c')](_0x5783f7)){return;}else{_0x11b0da[_0x8fb5('0x74')]=_0x5783f7[_0x8fb5('0x74')];return db['Attachment'][_0x8fb5('0x81')]({'where':{'id':_0x11b0da['AttachmentId']}});}})[_0x8fb5('0x1d')](function(_0x154f51){return respondWithRpcPromise(_0x8fb5('0x82'),_0x8fb5('0x82'),{'FaxAccountId':_[_0x8fb5('0x5c')](_0x481283[_0x8fb5('0x51')])?undefined:_0x481283[_0x8fb5('0x51')][_0x8fb5('0x83')],'path':_[_0x8fb5('0x5c')](_0x154f51)?undefined:util[_0x8fb5('0x58')]('/var/opt/motion2/server/files/attachments/%s',_0x154f51[_0x8fb5('0x84')]),'fax':_[_0x8fb5('0x5c')](_0x11b0da['fax'])?undefined:_0x11b0da['fax'],'AttachmentId':_0x11b0da['AttachmentId']},client9002);})[_0x8fb5('0x1d')](respondWithResult(_0x5efc4f,0xc9))['catch'](handleError(_0x5efc4f,null));};exports[_0x8fb5('0x85')]=function(_0x100987,_0x591d3f){var _0x3add51=path[_0x8fb5('0x86')](config[_0x8fb5('0x87')],_0x8fb5('0x88'),_0x8fb5('0x89'),_0x8fb5('0x8a'));return db[_0x8fb5('0x37')]['find']({'where':{'id':_0x100987['params']['id']},'include':[{'model':db[_0x8fb5('0x8b')],'as':_0x8fb5('0x8b')}]})[_0x8fb5('0x1d')](handleEntityNotFound(_0x591d3f,null))[_0x8fb5('0x1d')](function(_0x5479ab){if(_0x5479ab){return _0x591d3f['download'](path[_0x8fb5('0x86')](_0x3add51,_0x5479ab['Attachment'][_0x8fb5('0x84')]));}})['catch'](handleError(_0x591d3f,null));};
\ No newline at end of file
+var _0x9cb4=['json','offset','limit','undefined','count','set','apply','save','update','destroy','stack','name','send','FaxMessage','rawAttributes','type','key','model','map','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','options','find','body','params','describe','fax-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','sequelize','rejectmessage','create','findOne','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','basename','download','root','files','join','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','end','status'];(function(_0x378c4b,_0x483e15){var _0x53a6d0=function(_0x32e2b1){while(--_0x32e2b1){_0x378c4b['push'](_0x378c4b['shift']());}};_0x53a6d0(++_0x483e15);}(_0x9cb4,0xe7));var _0x49cb=function(_0x132ba6,_0x327572){_0x132ba6=_0x132ba6-0x0;var _0x25c67f=_0x9cb4[_0x132ba6];return _0x25c67f;};'use strict';var emlformat=require(_0x49cb('0x0'));var rimraf=require(_0x49cb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x49cb('0x2'));var rp=require(_0x49cb('0x3'));var moment=require(_0x49cb('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x49cb('0x5'));var path=require(_0x49cb('0x6'));var sox=require(_0x49cb('0x7'));var csv=require(_0x49cb('0x8'));var ejs=require(_0x49cb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x49cb('0xa'));var squel=require(_0x49cb('0xb'));var crypto=require(_0x49cb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x49cb('0xd'));var toCsv=require(_0x49cb('0x8'));var querystring=require(_0x49cb('0xe'));var Papa=require(_0x49cb('0xf'));var Redis=require(_0x49cb('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49cb('0x11'));var logger=require(_0x49cb('0x12'))('api');var utils=require(_0x49cb('0x13'));var config=require(_0x49cb('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x49cb('0x15')]=_[_0x49cb('0x16')](config[_0x49cb('0x15')],{'host':_0x49cb('0x17'),'port':0x18eb});var socket=require(_0x49cb('0x18'))(new Redis(config[_0x49cb('0x15')]));require(_0x49cb('0x19'))[_0x49cb('0x1a')](socket);var jayson=require(_0x49cb('0x1b'));var client=jayson[_0x49cb('0x1c')][_0x49cb('0x1d')]({'port':0x232c});var client9002=jayson[_0x49cb('0x1c')][_0x49cb('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x66670e,_0x2c5511,_0x2ccea8,_0x836f4a){return new BPromise(function(_0x54725a,_0x174a7b){var _0x1f2432=_0x836f4a||client;return _0x1f2432['request'](_0x66670e,_0x2ccea8)[_0x49cb('0x1e')](function(_0x548cfa){logger[_0x49cb('0x1f')](_0x49cb('0x20'),_0x2c5511,'request\x20sent');logger[_0x49cb('0x21')](_0x49cb('0x22'),_0x2c5511,_0x49cb('0x23'),JSON[_0x49cb('0x24')](_0x548cfa));if(_0x548cfa[_0x49cb('0x25')]){if(_0x548cfa[_0x49cb('0x25')]['code']===0x1f4){logger[_0x49cb('0x25')](_0x49cb('0x20'),_0x2c5511,_0x548cfa['error'][_0x49cb('0x26')]);return _0x174a7b(_0x548cfa[_0x49cb('0x25')][_0x49cb('0x26')]);}logger[_0x49cb('0x25')]('FaxMessage,\x20%s,\x20%s',_0x2c5511,_0x548cfa['error'][_0x49cb('0x26')]);return _0x54725a(_0x548cfa['error']['message']);}else{logger['info'](_0x49cb('0x20'),_0x2c5511,_0x49cb('0x23'));_0x54725a(_0x548cfa[_0x49cb('0x27')][_0x49cb('0x26')]);}})['catch'](function(_0x20fcf7){logger[_0x49cb('0x25')](_0x49cb('0x20'),_0x2c5511,_0x20fcf7);_0x174a7b(_0x20fcf7);});});}function respondWithStatusCode(_0x1b7f1d,_0x4c9400){_0x4c9400=_0x4c9400||0xcc;return function(_0xb33536){if(_0xb33536){return _0x1b7f1d[_0x49cb('0x28')](_0x4c9400);}return _0x1b7f1d['status'](_0x4c9400)[_0x49cb('0x29')]();};}function respondWithResult(_0x2f164c,_0x2dd522){_0x2dd522=_0x2dd522||0xc8;return function(_0x4812b5){if(_0x4812b5){return _0x2f164c[_0x49cb('0x2a')](_0x2dd522)[_0x49cb('0x2b')](_0x4812b5);}};}function respondWithFilteredResult(_0x292ff9,_0x48057a){return function(_0x4b528c){if(_0x4b528c){var _0x531c4e=typeof _0x48057a[_0x49cb('0x2c')]==='undefined'&&typeof _0x48057a[_0x49cb('0x2d')]===_0x49cb('0x2e');var _0x8589d7=_0x4b528c[_0x49cb('0x2f')];var _0x59dab0=_0x531c4e?0x0:_0x48057a[_0x49cb('0x2c')];var _0x349fe9=_0x531c4e?_0x4b528c[_0x49cb('0x2f')]:_0x48057a[_0x49cb('0x2c')]+_0x48057a[_0x49cb('0x2d')];var _0xf09654;if(_0x349fe9>=_0x8589d7){_0x349fe9=_0x8589d7;_0xf09654=0xc8;}else{_0xf09654=0xce;}_0x292ff9[_0x49cb('0x2a')](_0xf09654);return _0x292ff9[_0x49cb('0x30')]('Content-Range',_0x59dab0+'-'+_0x349fe9+'/'+_0x8589d7)[_0x49cb('0x2b')](_0x4b528c);}return null;};}function patchUpdates(_0x1dae23){return function(_0x31563c){try{jsonpatch[_0x49cb('0x31')](_0x31563c,_0x1dae23,!![]);}catch(_0xf336b6){return BPromise['reject'](_0xf336b6);}return _0x31563c[_0x49cb('0x32')]();};}function saveUpdates(_0x4204e2,_0x40228a){return function(_0x21a352){if(_0x21a352){return _0x21a352[_0x49cb('0x33')](_0x4204e2)[_0x49cb('0x1e')](function(_0x216bce){return _0x216bce;});}return null;};}function removeEntity(_0x529a2e,_0x3443aa){return function(_0x2b99bb){if(_0x2b99bb){return _0x2b99bb[_0x49cb('0x34')]()[_0x49cb('0x1e')](function(){_0x529a2e[_0x49cb('0x2a')](0xcc)[_0x49cb('0x29')]();});}};}function handleEntityNotFound(_0xcfb692,_0x76defc){return function(_0x3c8146){if(!_0x3c8146){_0xcfb692[_0x49cb('0x28')](0x194);}return _0x3c8146;};}function handleError(_0x1baab4,_0x41e2ee){_0x41e2ee=_0x41e2ee||0x1f4;return function(_0x430e6c){logger[_0x49cb('0x25')](_0x430e6c[_0x49cb('0x35')]);if(_0x430e6c[_0x49cb('0x36')]){delete _0x430e6c[_0x49cb('0x36')];}_0x1baab4[_0x49cb('0x2a')](_0x41e2ee)[_0x49cb('0x37')](_0x430e6c);};}exports['index']=function(_0x44a0bf,_0x3dc41d){var _0x2e475b={},_0x2ee5b4={},_0x359beb={'count':0x0,'rows':[]};var _0x170e2d=_['map'](db[_0x49cb('0x38')][_0x49cb('0x39')],function(_0x30f659){return{'name':_0x30f659['fieldName'],'type':_0x30f659[_0x49cb('0x3a')][_0x49cb('0x3b')]};});_0x2ee5b4[_0x49cb('0x3c')]=_[_0x49cb('0x3d')](_0x170e2d,_0x49cb('0x36'));_0x2ee5b4['query']=_[_0x49cb('0x3e')](_0x44a0bf['query']);_0x2ee5b4[_0x49cb('0x3f')]=_[_0x49cb('0x40')](_0x2ee5b4[_0x49cb('0x3c')],_0x2ee5b4[_0x49cb('0x41')]);_0x2e475b['attributes']=_['intersection'](_0x2ee5b4[_0x49cb('0x3c')],qs[_0x49cb('0x42')](_0x44a0bf['query']['fields']));_0x2e475b[_0x49cb('0x43')]=_0x2e475b[_0x49cb('0x43')][_0x49cb('0x44')]?_0x2e475b[_0x49cb('0x43')]:_0x2ee5b4[_0x49cb('0x3c')];if(!_0x44a0bf[_0x49cb('0x41')][_0x49cb('0x45')](_0x49cb('0x46'))){_0x2e475b[_0x49cb('0x2d')]=qs['limit'](_0x44a0bf['query'][_0x49cb('0x2d')]);_0x2e475b['offset']=qs[_0x49cb('0x2c')](_0x44a0bf[_0x49cb('0x41')][_0x49cb('0x2c')]);}_0x2e475b[_0x49cb('0x47')]=qs[_0x49cb('0x48')](_0x44a0bf[_0x49cb('0x41')][_0x49cb('0x48')]);_0x2e475b[_0x49cb('0x49')]=qs[_0x49cb('0x3f')](_['pick'](_0x44a0bf[_0x49cb('0x41')],_0x2ee5b4[_0x49cb('0x3f')]),_0x170e2d);if(_0x44a0bf[_0x49cb('0x41')][_0x49cb('0x4a')]){_0x2e475b[_0x49cb('0x49')]=_[_0x49cb('0x4b')](_0x2e475b[_0x49cb('0x49')],{'$or':_[_0x49cb('0x3d')](_0x170e2d,function(_0x5e6ce7){if(_0x5e6ce7['type']!==_0x49cb('0x4c')){var _0x651961={};_0x651961[_0x5e6ce7[_0x49cb('0x36')]]={'$like':'%'+_0x44a0bf['query']['filter']+'%'};return _0x651961;}})});}_0x2e475b=_[_0x49cb('0x4b')]({},_0x2e475b,_0x44a0bf['options']);var _0x3c1157={'where':_0x2e475b['where']};return db['FaxMessage'][_0x49cb('0x2f')](_0x3c1157)[_0x49cb('0x1e')](function(_0x16e52b){_0x359beb[_0x49cb('0x2f')]=_0x16e52b;if(_0x44a0bf['query'][_0x49cb('0x4d')]){_0x2e475b[_0x49cb('0x4e')]=[{'all':!![]}];}return db[_0x49cb('0x38')][_0x49cb('0x4f')](_0x2e475b);})[_0x49cb('0x1e')](function(_0x11c972){_0x359beb[_0x49cb('0x50')]=_0x11c972;return _0x359beb;})[_0x49cb('0x1e')](respondWithFilteredResult(_0x3dc41d,_0x2e475b))[_0x49cb('0x51')](handleError(_0x3dc41d,null));};exports['show']=function(_0x2e98f8,_0x4663a2){var _0x2f246b={'raw':!![],'where':{'id':_0x2e98f8['params']['id']}},_0xec33a8={};_0xec33a8[_0x49cb('0x3c')]=_['keys'](db[_0x49cb('0x38')]['rawAttributes']);_0xec33a8[_0x49cb('0x41')]=_[_0x49cb('0x3e')](_0x2e98f8[_0x49cb('0x41')]);_0xec33a8[_0x49cb('0x3f')]=_[_0x49cb('0x40')](_0xec33a8[_0x49cb('0x3c')],_0xec33a8['query']);_0x2f246b[_0x49cb('0x43')]=_[_0x49cb('0x40')](_0xec33a8[_0x49cb('0x3c')],qs[_0x49cb('0x42')](_0x2e98f8[_0x49cb('0x41')]['fields']));_0x2f246b[_0x49cb('0x43')]=_0x2f246b[_0x49cb('0x43')][_0x49cb('0x44')]?_0x2f246b[_0x49cb('0x43')]:_0xec33a8['model'];if(_0x2e98f8[_0x49cb('0x41')][_0x49cb('0x4d')]){_0x2f246b[_0x49cb('0x4e')]=[{'all':!![]}];}_0x2f246b=_[_0x49cb('0x4b')]({},_0x2f246b,_0x2e98f8[_0x49cb('0x52')]);return db[_0x49cb('0x38')][_0x49cb('0x53')](_0x2f246b)[_0x49cb('0x1e')](handleEntityNotFound(_0x4663a2,null))[_0x49cb('0x1e')](respondWithResult(_0x4663a2,null))['catch'](handleError(_0x4663a2,null));};exports[_0x49cb('0x33')]=function(_0xf9e9f4,_0x1d580e){if(_0xf9e9f4[_0x49cb('0x54')]['id']){delete _0xf9e9f4[_0x49cb('0x54')]['id'];}return db[_0x49cb('0x38')][_0x49cb('0x53')]({'where':{'id':_0xf9e9f4['params']['id']}})[_0x49cb('0x1e')](handleEntityNotFound(_0x1d580e,null))[_0x49cb('0x1e')](saveUpdates(_0xf9e9f4['body'],null))[_0x49cb('0x1e')](respondWithResult(_0x1d580e,null))[_0x49cb('0x51')](handleError(_0x1d580e,null));};exports['destroy']=function(_0x37bb8c,_0x4883d7){return db[_0x49cb('0x38')][_0x49cb('0x53')]({'where':{'id':_0x37bb8c[_0x49cb('0x55')]['id']}})[_0x49cb('0x1e')](handleEntityNotFound(_0x4883d7,null))[_0x49cb('0x1e')](removeEntity(_0x4883d7,null))['catch'](handleError(_0x4883d7,null));};exports[_0x49cb('0x56')]=function(_0x462071,_0x362bf3){return db['FaxMessage'][_0x49cb('0x56')]()[_0x49cb('0x1e')](respondWithResult(_0x362bf3,null))[_0x49cb('0x51')](handleError(_0x362bf3,null));};var interaction_log=require(_0x49cb('0x12'))(_0x49cb('0x57'));exports[_0x49cb('0x58')]=function(_0x5ab982,_0x4eb67f,_0x45aab9){var _0xc672ad={'agent':{},'channel':'fax'};if(_0x5ab982[_0x49cb('0x54')]['id']){delete _0x5ab982[_0x49cb('0x54')]['id'];}_0x5ab982[_0x49cb('0x54')]['read']=!![];_0x5ab982[_0x49cb('0x54')][_0x49cb('0x59')]=moment()[_0x49cb('0x5a')](_0x49cb('0x5b'));_0x5ab982[_0x49cb('0x54')][_0x49cb('0x5c')]=_0x5ab982['body'][_0x49cb('0x5c')]||_0x5ab982[_0x49cb('0x5d')]['id'];_0xc672ad[_0x49cb('0x5e')]['id']=_0x5ab982[_0x49cb('0x54')]['UserId'];return db[_0x49cb('0x38')][_0x49cb('0x53')]({'where':{'id':_0x5ab982[_0x49cb('0x55')]['id'],'UserId':null}})[_0x49cb('0x1e')](handleEntityNotFound(_0x4eb67f,null))[_0x49cb('0x1e')](saveUpdates(_0x5ab982['body'],null))['then'](function(_0x52a0d4){if(_0x52a0d4){_0xc672ad[_0x49cb('0x26')]=_0x52a0d4[_0x49cb('0x5f')]({'plain':!![]});return db[_0x49cb('0x60')]['find']({'where':{'id':_0x52a0d4[_0x49cb('0x61')]}});}return null;})[_0x49cb('0x1e')](handleEntityNotFound(_0x4eb67f,null))[_0x49cb('0x1e')](function(_0x304d65){if(_0x304d65){return _0x304d65['update']({'UserId':_0x5ab982[_0x49cb('0x54')][_0x49cb('0x5c')],'read1stAt':_['isNil'](_0x304d65['read1stAt'])?moment()[_0x49cb('0x5a')](_0x49cb('0x5b')):undefined});}return null;})['then'](function(_0x2b4a35){if(_0x2b4a35){_0xc672ad['interaction']=_0x2b4a35[_0x49cb('0x5f')]({'plain':!![]});interaction_log['info'](_0x49cb('0x62'),_0x5ab982[_0x49cb('0x5d')]['id'],_0x5ab982['user'][_0x49cb('0x36')],_0x5ab982[_0x49cb('0x5d')][_0x49cb('0x63')],_0xc672ad[_0x49cb('0x64')]['id'],_0x5ab982['body']?JSON[_0x49cb('0x24')](_0x5ab982[_0x49cb('0x54')]):_0x49cb('0x65'));return respondWithRpcPromise('AcceptMessage',_0x49cb('0x66'),_0xc672ad);}return null;})[_0x49cb('0x1e')](function(_0x1d0839){var _0x2afffe=_0x49cb('0x67')+_0x1d0839['message'][_0x49cb('0x68')];return db['sequelize'][_0x49cb('0x41')](_0x2afffe,{'type':db[_0x49cb('0x69')][_0x49cb('0x6a')][_0x49cb('0x6b')],'raw':!![]})[_0x49cb('0x1e')](function(_0x334af4){return _0x334af4;});})['then'](function(_0x51f238){if(_0x51f238){_0xc672ad[_0x49cb('0x26')][_0x49cb('0x6c')]=_0x51f238[0x0];if(!_0x5ab982[_0x49cb('0x54')][_0x49cb('0x5c')])return;return db[_0x49cb('0x6d')][_0x49cb('0x53')]({'where':{'id':_0x5ab982['body'][_0x49cb('0x5c')],'role':_0x49cb('0x5e')},'attributes':['id','name','fullname',_0x49cb('0x6e'),_0x49cb('0x6f')],'raw':!![]});}return null;})[_0x49cb('0x1e')](function(_0x4409e8){if(!_0x4409e8)return null;_0xc672ad[_0x49cb('0x26')][_0x49cb('0x5e')]=_0x4409e8;return _0xc672ad;})[_0x49cb('0x1e')](function(_0xf97ce2){if(_0xf97ce2){if(_0x5ab982[_0x49cb('0x54')][_0x49cb('0x70')]){_0xc672ad['message'][_0x49cb('0x71')]=util[_0x49cb('0x5a')](_0x49cb('0x72'),_0x5ab982[_0x49cb('0x5d')][_0x49cb('0x36')]);_0xc672ad[_0x49cb('0x26')][_0x49cb('0x73')]=_0xc672ad[_0x49cb('0x73')];_0xc672ad[_0x49cb('0x26')][_0x49cb('0x74')]=_0xc672ad[_0x49cb('0x73')];_0xc672ad['message'][_0x49cb('0x75')]=_0x49cb('0x58');return respondWithRpcPromise(_0x49cb('0x76'),_0x49cb('0x76'),{'event':_0x49cb('0x77'),'message':_0xc672ad['message']},client9002)[_0x49cb('0x1e')](function(){return _0xc672ad;});}return _0xc672ad;}return null;})[_0x49cb('0x1e')](respondWithResult(_0x4eb67f,null))['catch'](handleError(_0x4eb67f,null));};var interaction_log=require(_0x49cb('0x12'))(_0x49cb('0x57'));exports[_0x49cb('0x78')]=function(_0x14ef35,_0x2bbbaf,_0x3ae5cb){var _0x851692={'agent':{},'channel':_0x49cb('0x79')};if(_0x14ef35['body']['id']){delete _0x14ef35['body']['id'];}_0x14ef35['body'][_0x49cb('0x5c')]=_0x14ef35['body']['UserId']||_0x14ef35[_0x49cb('0x5d')]['id'];_0x851692[_0x49cb('0x5e')]['id']=_0x14ef35[_0x49cb('0x54')][_0x49cb('0x5c')];return db[_0x49cb('0x38')][_0x49cb('0x53')]({'where':{'id':_0x14ef35[_0x49cb('0x55')]['id'],'UserId':null}})[_0x49cb('0x1e')](handleEntityNotFound(_0x2bbbaf,null))[_0x49cb('0x1e')](function(_0x34c4c6){if(_0x34c4c6){_0x851692[_0x49cb('0x26')]=_0x34c4c6[_0x49cb('0x5f')]({'plain':!![]});return db[_0x49cb('0x60')][_0x49cb('0x53')]({'where':{'id':_0x34c4c6['FaxInteractionId']}});}return null;})[_0x49cb('0x1e')](handleEntityNotFound(_0x2bbbaf,null))[_0x49cb('0x1e')](function(_0x304a0c){if(_0x304a0c){_0x851692[_0x49cb('0x64')]=_0x304a0c[_0x49cb('0x5f')]({'plain':!![]});interaction_log[_0x49cb('0x1f')](_0x49cb('0x7a'),_0x14ef35[_0x49cb('0x5d')]['id'],_0x14ef35[_0x49cb('0x5d')][_0x49cb('0x36')],_0x14ef35[_0x49cb('0x5d')][_0x49cb('0x63')],_0x851692['interaction']['id'],_0x14ef35[_0x49cb('0x54')]?JSON[_0x49cb('0x24')](_0x14ef35['body']):_0x49cb('0x65'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x851692);}return null;})[_0x49cb('0x1e')](function(_0x50d74e){var _0x254709=_0x49cb('0x67')+_0x50d74e[_0x49cb('0x26')][_0x49cb('0x68')];return db[_0x49cb('0x7b')][_0x49cb('0x41')](_0x254709,{'type':db[_0x49cb('0x69')][_0x49cb('0x6a')][_0x49cb('0x6b')],'raw':!![]})[_0x49cb('0x1e')](function(_0x2956dc){return _0x2956dc;});})[_0x49cb('0x1e')](function(_0x28d601){if(_0x28d601){_0x851692['message']['contact']=_0x28d601[0x0];if(!_0x14ef35[_0x49cb('0x54')][_0x49cb('0x5c')])return;return db[_0x49cb('0x6d')][_0x49cb('0x53')]({'where':{'id':_0x14ef35[_0x49cb('0x54')][_0x49cb('0x5c')],'role':_0x49cb('0x5e')},'attributes':['id',_0x49cb('0x36'),'fullname',_0x49cb('0x6e'),_0x49cb('0x6f')],'raw':!![]});}return null;})[_0x49cb('0x1e')](function(_0x3729ee){if(!_0x3729ee)return null;_0x851692['message']['agent']=_0x3729ee;return _0x851692;})[_0x49cb('0x1e')](function(_0x3777a8){if(_0x3777a8){_0x3777a8[_0x49cb('0x26')][_0x49cb('0x71')]=util[_0x49cb('0x5a')](_0x49cb('0x72'),_0x14ef35[_0x49cb('0x5d')]['name']);_0x3777a8['message'][_0x49cb('0x73')]=_0x851692[_0x49cb('0x73')];_0x3777a8['message'][_0x49cb('0x74')]=_0x851692[_0x49cb('0x73')];_0x3777a8[_0x49cb('0x26')]['event']=_0x49cb('0x78');respondWithRpcPromise(_0x49cb('0x76'),'EventManager',{'event':_0x49cb('0x7c'),'message':_0x3777a8['message']},client9002);return _0x851692;}return null;})[_0x49cb('0x1e')](respondWithResult(_0x2bbbaf,null))[_0x49cb('0x51')](handleError(_0x2bbbaf,null));};exports[_0x49cb('0x7d')]=function(_0x55a09f,_0x1a0b2d){var _0x26b956;return db[_0x49cb('0x38')][_0x49cb('0x7d')](_0x55a09f[_0x49cb('0x54')],{})[_0x49cb('0x1e')](function(_0x3ee7bc){_0x26b956=_0x3ee7bc;return db['CmContact'][_0x49cb('0x7e')]({'where':{'id':_0x26b956['ContactId']}});})[_0x49cb('0x1e')](function(_0x11d69e){if(_[_0x49cb('0x7f')](_0x11d69e)){return;}else{_0x26b956[_0x49cb('0x79')]=_0x11d69e[_0x49cb('0x79')];return db[_0x49cb('0x80')]['findOne']({'where':{'id':_0x26b956[_0x49cb('0x81')]}});}})[_0x49cb('0x1e')](function(_0x465b1e){return respondWithRpcPromise(_0x49cb('0x82'),'SendFax',{'FaxAccountId':_[_0x49cb('0x7f')](_0x55a09f[_0x49cb('0x54')])?undefined:_0x55a09f[_0x49cb('0x54')][_0x49cb('0x83')],'path':_[_0x49cb('0x7f')](_0x465b1e)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x465b1e[_0x49cb('0x84')]),'fax':_['isNil'](_0x26b956[_0x49cb('0x79')])?undefined:_0x26b956[_0x49cb('0x79')],'AttachmentId':_0x26b956['AttachmentId']},client9002);})['then'](respondWithResult(_0x1a0b2d,0xc9))[_0x49cb('0x51')](handleError(_0x1a0b2d,null));};exports[_0x49cb('0x85')]=function(_0x11f3a5,_0x3a30e6){var _0x54727c=path['join'](config[_0x49cb('0x86')],'server',_0x49cb('0x87'),'attachments');return db[_0x49cb('0x38')][_0x49cb('0x53')]({'where':{'id':_0x11f3a5[_0x49cb('0x55')]['id']},'include':[{'model':db[_0x49cb('0x80')],'as':_0x49cb('0x80')}]})['then'](handleEntityNotFound(_0x3a30e6,null))[_0x49cb('0x1e')](function(_0x3f6b72){if(_0x3f6b72){return _0x3a30e6[_0x49cb('0x85')](path[_0x49cb('0x88')](_0x54727c,_0x3f6b72[_0x49cb('0x80')][_0x49cb('0x84')]));}})[_0x49cb('0x51')](handleError(_0x3a30e6,null));};
\ No newline at end of file
index 1c02e54..b5c8def 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf11=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage'];(function(_0x2ac77a,_0x725583){var _0x45134e=function(_0x296156){while(--_0x296156){_0x2ac77a['push'](_0x2ac77a['shift']());}};_0x45134e(++_0x725583);}(_0xaf11,0x12f));var _0x1af1=function(_0x4e5943,_0x39a66e){_0x4e5943=_0x4e5943-0x0;var _0x3a2e7f=_0xaf11[_0x4e5943];return _0x3a2e7f;};'use strict';var EventEmitter=require(_0x1af1('0x0'));var FaxMessage=require(_0x1af1('0x1'))['db'][_0x1af1('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1af1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1af1('0x4'),'afterDestroy':_0x1af1('0x5')};function emitEvent(_0x28842d){return function(_0x53af48,_0xb0ace,_0x12eead){FaxMessageEvents[_0x1af1('0x6')](_0x28842d+':'+_0x53af48['id'],_0x53af48);FaxMessageEvents['emit'](_0x28842d,_0x53af48);_0x12eead(null);};}for(var e in events){if(events[_0x1af1('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x1af1('0x8')]=FaxMessageEvents;
\ No newline at end of file
+var _0x5581=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','FaxMessage'];(function(_0x2c5935,_0x1eeabb){var _0x45935b=function(_0x39f44c){while(--_0x39f44c){_0x2c5935['push'](_0x2c5935['shift']());}};_0x45935b(++_0x1eeabb);}(_0x5581,0x115));var _0x1558=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x5581[_0x485b5a];return _0xd2b34d;};'use strict';var EventEmitter=require(_0x1558('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x1558('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1558('0x2')](0x0);var events={'afterCreate':_0x1558('0x3'),'afterUpdate':_0x1558('0x4'),'afterDestroy':_0x1558('0x5')};function emitEvent(_0x325c21){return function(_0x48c6fa,_0x113434,_0xa09e11){FaxMessageEvents['emit'](_0x325c21+':'+_0x48c6fa['id'],_0x48c6fa);FaxMessageEvents[_0x1558('0x6')](_0x325c21,_0x48c6fa);_0xa09e11(null);};}for(var e in events){if(events[_0x1558('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x1558('0x8')]=FaxMessageEvents;
\ No newline at end of file
index 6d7e888..205ecc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4ec=['path','rimraf','../../config/environment','define','FaxMessage','fax_messages','fti_fax_messages','body','models','get','direction','toLowerCase','out','secret','isNil','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4d7379,_0x4b4e63){var _0x46d7cf=function(_0x53f5f0){while(--_0x53f5f0){_0x4d7379['push'](_0x4d7379['shift']());}};_0x46d7cf(++_0x4b4e63);}(_0xf4ec,0x126));var _0xcf4e=function(_0x4b92b9,_0x1bd47d){_0x4b92b9=_0x4b92b9-0x0;var _0x157b9d=_0xf4ec[_0x4b92b9];return _0x157b9d;};'use strict';var _=require(_0xcf4e('0x0'));var util=require(_0xcf4e('0x1'));var logger=require(_0xcf4e('0x2'))(_0xcf4e('0x3'));var moment=require(_0xcf4e('0x4'));var BPromise=require('bluebird');var rp=require(_0xcf4e('0x5'));var fs=require('fs');var path=require(_0xcf4e('0x6'));var rimraf=require(_0xcf4e('0x7'));var config=require(_0xcf4e('0x8'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x4e181b,_0x2ff154){return _0x4e181b[_0xcf4e('0x9')](_0xcf4e('0xa'),attributes,{'tableName':_0xcf4e('0xb'),'paranoid':![],'indexes':[{'name':_0xcf4e('0xc'),'fields':[_0xcf4e('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xe86944,_0xc3f92a,_0x51db27){var _0x22bdc3=_0x4e181b[_0xcf4e('0xe')];var _0x56992a=_0xe86944[_0xcf4e('0xf')]({'plain':!![]});if(_0x56992a[_0xcf4e('0x10')]['toLowerCase']()==='in'||_0x56992a['direction'][_0xcf4e('0x11')]()===_0xcf4e('0x12')&&!_0x56992a[_0xcf4e('0x13')]&&!_[_0xcf4e('0x14')](_0x56992a['UserId'])){_0x22bdc3['FaxInteraction'][_0xcf4e('0x15')]({'where':{'id':_0x56992a[_0xcf4e('0x16')]}})[_0xcf4e('0x17')](function(_0x48748b){if(_0x48748b){_0x48748b[_0xcf4e('0x18')]({'lastMsgAt':_0x56992a[_0xcf4e('0x19')],'lastMsgDirection':_0x56992a[_0xcf4e('0x10')][_0xcf4e('0x11')]()});}})[_0xcf4e('0x1a')](function(_0x4c4410){console[_0xcf4e('0x1b')](_0x4c4410);});}_0x51db27();}},'charset':_0xcf4e('0x1c'),'collate':_0xcf4e('0x1d')});};
\ No newline at end of file
+var _0xf431=['toLowerCase','secret','isNil','UserId','FaxInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./faxMessage.attributes','define','fax_messages','fti_fax_messages','body','models','direction'];(function(_0x387dc1,_0x3ba649){var _0x17567c=function(_0x4690aa){while(--_0x4690aa){_0x387dc1['push'](_0x387dc1['shift']());}};_0x17567c(++_0x3ba649);}(_0xf431,0x1bb));var _0x1f43=function(_0xd89fde,_0x4d2417){_0xd89fde=_0xd89fde-0x0;var _0xe67f58=_0xf431[_0xd89fde];return _0xe67f58;};'use strict';var _=require(_0x1f43('0x0'));var util=require('util');var logger=require(_0x1f43('0x1'))(_0x1f43('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1f43('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f43('0x4'));var config=require(_0x1f43('0x5'));var attributes=require(_0x1f43('0x6'));module['exports']=function(_0x27c2db,_0x4e4325){return _0x27c2db[_0x1f43('0x7')]('FaxMessage',attributes,{'tableName':_0x1f43('0x8'),'paranoid':![],'indexes':[{'name':_0x1f43('0x9'),'fields':[_0x1f43('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2028e2,_0x49c2e2,_0x33d9b2){var _0x24c477=_0x27c2db[_0x1f43('0xb')];var _0x201803=_0x2028e2['get']({'plain':!![]});if(_0x201803[_0x1f43('0xc')][_0x1f43('0xd')]()==='in'||_0x201803[_0x1f43('0xc')][_0x1f43('0xd')]()==='out'&&!_0x201803[_0x1f43('0xe')]&&!_[_0x1f43('0xf')](_0x201803[_0x1f43('0x10')])){_0x24c477['FaxInteraction']['findOne']({'where':{'id':_0x201803[_0x1f43('0x11')]}})[_0x1f43('0x12')](function(_0x3ccf00){if(_0x3ccf00){_0x3ccf00[_0x1f43('0x13')]({'lastMsgAt':_0x201803[_0x1f43('0x14')],'lastMsgDirection':_0x201803['direction'][_0x1f43('0xd')]()});}})['catch'](function(_0x3138e8){console[_0x1f43('0x15')](_0x3138e8);});}_0x33d9b2();}},'charset':_0x1f43('0x16'),'collate':_0x1f43('0x17')});};
\ No newline at end of file
index 65941b4..b30a1a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','body','options','raw','CreateFaxMessage','catch','UpdateFaxMessage','FaxMessage','where','attributes','lodash'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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});config[_0x7995('0xc')]=_[_0x7995('0xd')](config['redis'],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require(_0x7995('0xf'))(new Redis(config['redis']));require(_0x7995('0x10'))[_0x7995('0x11')](socket);function respondWithRpcPromise(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){return client['request'](_0x18c8a3,_0x3c1d19)[_0x7995('0x12')](function(_0x41c652){logger['info'](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));logger[_0x7995('0x15')](_0x7995('0x16'),_0x35b5fe,_0x7995('0x14'),JSON[_0x7995('0x17')](_0x41c652));if(_0x41c652[_0x7995('0x18')]){if(_0x41c652['error']['code']===0x1f4){logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);return _0x341672(_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);}logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652['error'][_0x7995('0x19')]);return _0x1e400a(_0x41c652['error'][_0x7995('0x19')]);}else{logger[_0x7995('0x1a')](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));_0x1e400a(_0x41c652[_0x7995('0x1b')][_0x7995('0x19')]);}})['catch'](function(_0x54c9ae){logger[_0x7995('0x18')]('FaxMessage,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});}exports['CreateFaxMessage']=function(_0x3ec178){var _0x3d463e=this;return new Promise(function(_0x4cbe10,_0x3a9b54){return db['FaxMessage']['create'](_0x3ec178[_0x7995('0x1c')],{'raw':_0x3ec178[_0x7995('0x1d')]?_0x3ec178[_0x7995('0x1d')][_0x7995('0x1e')]===undefined?!![]:![]:!![]})[_0x7995('0x12')](function(_0x1c278a){logger['info'](_0x7995('0x1f'),_0x3ec178);logger[_0x7995('0x15')](_0x7995('0x1f'),_0x3ec178,JSON[_0x7995('0x17')](_0x1c278a));_0x4cbe10(_0x1c278a);})[_0x7995('0x20')](function(_0x13bc35){logger[_0x7995('0x18')](_0x7995('0x1f'),_0x13bc35['message'],_0x3ec178);_0x3a9b54(_0x3d463e[_0x7995('0x18')](0x1f4,_0x13bc35[_0x7995('0x19')]));});});};exports[_0x7995('0x21')]=function(_0x268ce7){var _0x3a3fcf=this;return new Promise(function(_0x2a307e,_0x56691a){return db[_0x7995('0x22')]['update'](_0x268ce7[_0x7995('0x1c')],{'raw':_0x268ce7[_0x7995('0x1d')]?_0x268ce7[_0x7995('0x1d')][_0x7995('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x268ce7[_0x7995('0x1d')]?_0x268ce7['options'][_0x7995('0x23')]||null:null,'attributes':_0x268ce7['options']?_0x268ce7[_0x7995('0x1d')][_0x7995('0x24')]||null:null,'limit':_0x268ce7[_0x7995('0x1d')]?_0x268ce7['options']['limit']||null:null})['then'](function(_0x3573be){logger[_0x7995('0x1a')](_0x7995('0x21'),_0x268ce7);logger[_0x7995('0x15')](_0x7995('0x21'),_0x268ce7,JSON[_0x7995('0x17')](_0x3573be));_0x2a307e(_0x3573be);})['catch'](function(_0x481c74){logger[_0x7995('0x18')]('UpdateFaxMessage',_0x481c74[_0x7995('0x19')],_0x268ce7);_0x56691a(_0x3a3fcf[_0x7995('0x18')](0x1f4,_0x481c74[_0x7995('0x19')]));});});};
\ No newline at end of file
+var _0x0a9a=['error','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','CreateFaxMessage','debug','UpdateFaxMessage','update','raw','where','attributes','limit','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./faxMessage.socket','register','request','then','info','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x14af83,_0x3a3500){var _0x3cfd9e=function(_0x4ed9df){while(--_0x4ed9df){_0x14af83['push'](_0x14af83['shift']());}};_0x3cfd9e(++_0x3a3500);}(_0x0a9a,0x183));var _0xa0a9=function(_0x34708f,_0x11822c){_0x34708f=_0x34708f-0x0;var _0x19cf5b=_0x0a9a[_0x34708f];return _0x19cf5b;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});config[_0xa0a9('0xa')]=_['defaults'](config[_0xa0a9('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa0a9('0xb'))(new Redis(config[_0xa0a9('0xa')]));require(_0xa0a9('0xc'))[_0xa0a9('0xd')](socket);function respondWithRpcPromise(_0x4b9b93,_0x2ba0ac,_0x1b5bfb){return new BPromise(function(_0x5ce7e9,_0x5909cf){return client[_0xa0a9('0xe')](_0x4b9b93,_0x1b5bfb)[_0xa0a9('0xf')](function(_0x51d5a5){logger[_0xa0a9('0x10')]('FaxMessage,\x20%s,\x20%s',_0x2ba0ac,_0xa0a9('0x11'));logger['debug'](_0xa0a9('0x12'),_0x2ba0ac,_0xa0a9('0x11'),JSON[_0xa0a9('0x13')](_0x51d5a5));if(_0x51d5a5[_0xa0a9('0x14')]){if(_0x51d5a5[_0xa0a9('0x14')]['code']===0x1f4){logger[_0xa0a9('0x14')](_0xa0a9('0x15'),_0x2ba0ac,_0x51d5a5[_0xa0a9('0x14')][_0xa0a9('0x16')]);return _0x5909cf(_0x51d5a5[_0xa0a9('0x14')][_0xa0a9('0x16')]);}logger['error'](_0xa0a9('0x15'),_0x2ba0ac,_0x51d5a5['error']['message']);return _0x5ce7e9(_0x51d5a5[_0xa0a9('0x14')][_0xa0a9('0x16')]);}else{logger[_0xa0a9('0x10')](_0xa0a9('0x15'),_0x2ba0ac,'request\x20sent');_0x5ce7e9(_0x51d5a5[_0xa0a9('0x17')][_0xa0a9('0x16')]);}})[_0xa0a9('0x18')](function(_0x27f8d4){logger[_0xa0a9('0x14')](_0xa0a9('0x15'),_0x2ba0ac,_0x27f8d4);_0x5909cf(_0x27f8d4);});});}exports['CreateFaxMessage']=function(_0x3cdd8c){var _0x3107ce=this;return new Promise(function(_0x4a8e80,_0x53b99d){return db[_0xa0a9('0x19')][_0xa0a9('0x1a')](_0x3cdd8c[_0xa0a9('0x1b')],{'raw':_0x3cdd8c['options']?_0x3cdd8c[_0xa0a9('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xa0a9('0xf')](function(_0x5e6148){logger[_0xa0a9('0x10')](_0xa0a9('0x1d'),_0x3cdd8c);logger[_0xa0a9('0x1e')](_0xa0a9('0x1d'),_0x3cdd8c,JSON['stringify'](_0x5e6148));_0x4a8e80(_0x5e6148);})[_0xa0a9('0x18')](function(_0x4fb909){logger[_0xa0a9('0x14')](_0xa0a9('0x1d'),_0x4fb909[_0xa0a9('0x16')],_0x3cdd8c);_0x53b99d(_0x3107ce[_0xa0a9('0x14')](0x1f4,_0x4fb909['message']));});});};exports[_0xa0a9('0x1f')]=function(_0xe49d3b){var _0x384cd5=this;return new Promise(function(_0x3f4bea,_0x526dd1){return db[_0xa0a9('0x19')][_0xa0a9('0x20')](_0xe49d3b[_0xa0a9('0x1b')],{'raw':_0xe49d3b['options']?_0xe49d3b['options'][_0xa0a9('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe49d3b[_0xa0a9('0x1c')]?_0xe49d3b[_0xa0a9('0x1c')][_0xa0a9('0x22')]||null:null,'attributes':_0xe49d3b[_0xa0a9('0x1c')]?_0xe49d3b[_0xa0a9('0x1c')][_0xa0a9('0x23')]||null:null,'limit':_0xe49d3b[_0xa0a9('0x1c')]?_0xe49d3b[_0xa0a9('0x1c')][_0xa0a9('0x24')]||null:null})[_0xa0a9('0xf')](function(_0x554191){logger[_0xa0a9('0x10')](_0xa0a9('0x1f'),_0xe49d3b);logger['debug'](_0xa0a9('0x1f'),_0xe49d3b,JSON[_0xa0a9('0x13')](_0x554191));_0x3f4bea(_0x554191);})['catch'](function(_0x47c19b){logger[_0xa0a9('0x14')]('UpdateFaxMessage',_0x47c19b['message'],_0xe49d3b);_0x526dd1(_0x384cd5[_0xa0a9('0x14')](0x1f4,_0x47c19b[_0xa0a9('0x16')]));});});};
\ No newline at end of file
index 838fbb8..3ec127c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1784=['save','remove','update','emit','length','faxMessage:','./faxMessage.events'];(function(_0x1e9287,_0x37f584){var _0x44342e=function(_0x2f559e){while(--_0x2f559e){_0x1e9287['push'](_0x1e9287['shift']());}};_0x44342e(++_0x37f584);}(_0x1784,0x14f));var _0x4178=function(_0x3d5db9,_0x2dbe0a){_0x3d5db9=_0x3d5db9-0x0;var _0x3c114c=_0x1784[_0x3d5db9];return _0x3c114c;};'use strict';var FaxMessageEvents=require(_0x4178('0x0'));var events=[_0x4178('0x1'),_0x4178('0x2'),_0x4178('0x3')];function createListener(_0x3626a8,_0x3f1868){return function(_0xe0f97b){_0x3f1868[_0x4178('0x4')](_0x3626a8,_0xe0f97b);};}function removeListener(_0x46cf0b,_0x2485d9){return function(){FaxMessageEvents['removeListener'](_0x46cf0b,_0x2485d9);};}exports['register']=function(_0x33d0ba){for(var _0x4c785c=0x0,_0x420d0c=events[_0x4178('0x5')];_0x4c785c<_0x420d0c;_0x4c785c++){var _0x1cdc75=events[_0x4c785c];var _0x17bf10=createListener(_0x4178('0x6')+_0x1cdc75,_0x33d0ba);FaxMessageEvents['on'](_0x1cdc75,_0x17bf10);}};
\ No newline at end of file
+var _0x55ff=['./faxMessage.events','save','remove','update','emit','removeListener','register','length','faxMessage:'];(function(_0x35af6d,_0x48afc4){var _0x1fd188=function(_0x5a0587){while(--_0x5a0587){_0x35af6d['push'](_0x35af6d['shift']());}};_0x1fd188(++_0x48afc4);}(_0x55ff,0xc6));var _0xf55f=function(_0x2ed7df,_0x322394){_0x2ed7df=_0x2ed7df-0x0;var _0xd2b472=_0x55ff[_0x2ed7df];return _0xd2b472;};'use strict';var FaxMessageEvents=require(_0xf55f('0x0'));var events=[_0xf55f('0x1'),_0xf55f('0x2'),_0xf55f('0x3')];function createListener(_0x3c6d4a,_0x4772b5){return function(_0x54cd37){_0x4772b5[_0xf55f('0x4')](_0x3c6d4a,_0x54cd37);};}function removeListener(_0x442849,_0x3b4047){return function(){FaxMessageEvents[_0xf55f('0x5')](_0x442849,_0x3b4047);};}exports[_0xf55f('0x6')]=function(_0x1f6614){for(var _0xf0c0c5=0x0,_0x5114ec=events[_0xf55f('0x7')];_0xf0c0c5<_0x5114ec;_0xf0c0c5++){var _0x3074a4=events[_0xf0c0c5];var _0x4c0d27=createListener(_0xf55f('0x8')+_0x3074a4,_0x1f6614);FaxMessageEvents['on'](_0x3074a4,_0x4c0d27);}};
\ No newline at end of file
index e416bf2..906563c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['faxmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','index','isAuthenticated','describe','/:id','/:id/download','download','post','tracked','fax'];(function(_0x49ac8c,_0xe0dc79){var _0x48ba25=function(_0x3855be){while(--_0x3855be){_0x49ac8c['push'](_0x49ac8c['shift']());}};_0x48ba25(++_0xe0dc79);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0xcb91[_0x4067ac];return _0x53d74d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0x7')](_0x1cb9('0xc'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')]('/',auth['isAuthenticated'](),interaction[_0x1cb9('0xf')](_0x1cb9('0x10'),_0x1cb9('0x11')),controller[_0x1cb9('0x12')]);router[_0x1cb9('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1cb9('0x13')](_0x1cb9('0x14'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x15')]);router['put'](_0x1cb9('0x16'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x17')]);router[_0x1cb9('0x18')](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x1cb9('0x19')]=router;
\ No newline at end of file
+var _0x5b02=['put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','show','download','post','tracked','fax','faxmessage:create','create'];(function(_0x83b7f7,_0x565adc){var _0x317c7b=function(_0x5a4973){while(--_0x5a4973){_0x83b7f7['push'](_0x83b7f7['shift']());}};_0x317c7b(++_0x565adc);}(_0x5b02,0xe9));var _0x25b0=function(_0x289806,_0x18a319){_0x289806=_0x289806-0x0;var _0x2004be=_0x5b02[_0x289806];return _0x2004be;};'use strict';var multer=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var path=require(_0x25b0('0x2'));var timeout=require(_0x25b0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x25b0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var controller=require(_0x25b0('0x7'));router[_0x25b0('0x8')]('/',auth[_0x25b0('0x9')](),controller['index']);router[_0x25b0('0x8')](_0x25b0('0xa'),auth['isAuthenticated'](),controller[_0x25b0('0xb')]);router['get']('/:id',auth[_0x25b0('0x9')](),controller[_0x25b0('0xc')]);router[_0x25b0('0x8')]('/:id/download',auth[_0x25b0('0x9')](),controller[_0x25b0('0xd')]);router[_0x25b0('0xe')]('/',auth[_0x25b0('0x9')](),interaction[_0x25b0('0xf')](_0x25b0('0x10'),_0x25b0('0x11')),controller[_0x25b0('0x12')]);router[_0x25b0('0x13')](_0x25b0('0x14'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x15')]);router[_0x25b0('0x13')](_0x25b0('0x16'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x17')]);router[_0x25b0('0x13')](_0x25b0('0x18'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x19')]);router[_0x25b0('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x25b0('0x1b')]);module['exports']=router;
\ No newline at end of file
index 2fd5dc5..5fbcede 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf375=['beepall','roundrobin','name','STRING','INTEGER','ENUM','rrmemory'];(function(_0x49160f,_0x2ba488){var _0x5315b7=function(_0x4f0c85){while(--_0x4f0c85){_0x49160f['push'](_0x49160f['shift']());}};_0x5315b7(++_0x2ba488);}(_0xf375,0x19f));var _0x5f37=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf375[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5f37('0x0'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5f37('0x1')]},'timeout':{'type':Sequelize[_0x5f37('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5f37('0x3')](_0x5f37('0x4'),_0x5f37('0x5'),_0x5f37('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x5f37('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x336e=['ENUM','rrmemory','beepall','roundrobin','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x336e,0xad));var _0xe336=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x336e[_0x1a7846];return _0x48049;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe336('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe336('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe336('0x1')](_0xe336('0x2'),_0xe336('0x3'),_0xe336('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xe336('0x5')],'defaultValue':0x0}};
\ No newline at end of file
index ca1c894..f7011df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd431=['includes','union','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray','emit','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','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','redis','localhost','socket.io-emitter','./faxQueue.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','save','then','destroy','get','FaxQueues','sendStatus','stack','name','send','FaxQueue','rawAttributes','fieldName','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','keys','intersection','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','FaxQueueId','map','UserFaxQueue','User','UserId','agent','faxPause','createdAt','SIP','updatedAt','getTeams','addTeams','Team','Agents','voicePause','flatMap','sequelize','transaction','each','forEach','removeTeams','ids','select','tq.TeamId','from','join','user_has_teams','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','every'];(function(_0xad5eb6,_0xd540c4){var _0x52a0f6=function(_0xc1149c){while(--_0xc1149c){_0xad5eb6['push'](_0xad5eb6['shift']());}};_0x52a0f6(++_0xd540c4);}(_0xd431,0x117));var _0x1d43=function(_0x49fc28,_0x523dfd){_0x49fc28=_0x49fc28-0x0;var _0x5d79a6=_0xd431[_0x49fc28];return _0x5d79a6;};'use strict';var emlformat=require(_0x1d43('0x0'));var rimraf=require(_0x1d43('0x1'));var zipdir=require(_0x1d43('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1d43('0x3'));var BPromise=require(_0x1d43('0x4'));var Mustache=require(_0x1d43('0x5'));var util=require(_0x1d43('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1d43('0x7'));var ejs=require(_0x1d43('0x8'));var fs=require('fs');var fs_extra=require(_0x1d43('0x9'));var _=require('lodash');var squel=require(_0x1d43('0xa'));var crypto=require(_0x1d43('0xb'));var jsforce=require(_0x1d43('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1d43('0x7'));var querystring=require(_0x1d43('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1d43('0xe'));var qs=require(_0x1d43('0xf'));var as=require(_0x1d43('0x10'));var hardwareService=require(_0x1d43('0x11'));var logger=require(_0x1d43('0x12'))(_0x1d43('0x13'));var utils=require(_0x1d43('0x14'));var config=require(_0x1d43('0x15'));var licenseUtil=require(_0x1d43('0x16'));var db=require('../../mysqldb')['db'];config[_0x1d43('0x17')]=_['defaults'](config[_0x1d43('0x17')],{'host':_0x1d43('0x18'),'port':0x18eb});var socket=require(_0x1d43('0x19'))(new Redis(config[_0x1d43('0x17')]));require(_0x1d43('0x1a'))[_0x1d43('0x1b')](socket);function respondWithStatusCode(_0x13f9ef,_0x547d17){_0x547d17=_0x547d17||0xcc;return function(_0x315dfd){if(_0x315dfd){return _0x13f9ef['sendStatus'](_0x547d17);}return _0x13f9ef[_0x1d43('0x1c')](_0x547d17)[_0x1d43('0x1d')]();};}function respondWithResult(_0x55412e,_0x1f60ce){_0x1f60ce=_0x1f60ce||0xc8;return function(_0x40414c){if(_0x40414c){return _0x55412e[_0x1d43('0x1c')](_0x1f60ce)['json'](_0x40414c);}};}function respondWithFilteredResult(_0x18e7a8,_0x354437){return function(_0xfda99c){if(_0xfda99c){var _0x21ff8c=typeof _0x354437[_0x1d43('0x1e')]===_0x1d43('0x1f')&&typeof _0x354437[_0x1d43('0x20')]===_0x1d43('0x1f');var _0x486e88=_0xfda99c[_0x1d43('0x21')];var _0x432c2b=_0x21ff8c?0x0:_0x354437['offset'];var _0x2c2692=_0x21ff8c?_0xfda99c[_0x1d43('0x21')]:_0x354437[_0x1d43('0x1e')]+_0x354437['limit'];var _0x130e00;if(_0x2c2692>=_0x486e88){_0x2c2692=_0x486e88;_0x130e00=0xc8;}else{_0x130e00=0xce;}_0x18e7a8[_0x1d43('0x1c')](_0x130e00);return _0x18e7a8[_0x1d43('0x22')](_0x1d43('0x23'),_0x432c2b+'-'+_0x2c2692+'/'+_0x486e88)[_0x1d43('0x24')](_0xfda99c);}return null;};}function patchUpdates(_0x137186){return function(_0x252f67){try{jsonpatch['apply'](_0x252f67,_0x137186,!![]);}catch(_0x52e931){return BPromise['reject'](_0x52e931);}return _0x252f67[_0x1d43('0x25')]();};}function saveUpdates(_0x2a17e4,_0x44dc2b){return function(_0x5c983c){if(_0x5c983c){return _0x5c983c['update'](_0x2a17e4)[_0x1d43('0x26')](function(_0x5d0ef8){return _0x5d0ef8;});}return null;};}function removeEntity(_0x5676ae,_0x1e241e){return function(_0x534146){if(_0x534146){return _0x534146[_0x1d43('0x27')]()[_0x1d43('0x26')](function(){var _0x4cd4ff=_0x534146[_0x1d43('0x28')]({'plain':!![]});var _0x43f45c=_0x1d43('0x29');return db['UserProfileResource'][_0x1d43('0x27')]({'where':{'type':_0x43f45c,'resourceId':_0x4cd4ff['id']}})[_0x1d43('0x26')](function(){return _0x534146;});})[_0x1d43('0x26')](function(){_0x5676ae['status'](0xcc)[_0x1d43('0x1d')]();});}};}function handleEntityNotFound(_0x12a60d,_0x38a16e){return function(_0x348c0d){if(!_0x348c0d){_0x12a60d[_0x1d43('0x2a')](0x194);}return _0x348c0d;};}function handleError(_0x5255a2,_0x377b63){_0x377b63=_0x377b63||0x1f4;return function(_0x156e56){logger['error'](_0x156e56[_0x1d43('0x2b')]);if(_0x156e56['name']){delete _0x156e56[_0x1d43('0x2c')];}_0x5255a2[_0x1d43('0x1c')](_0x377b63)[_0x1d43('0x2d')](_0x156e56);};}exports['index']=function(_0x13b8a3,_0x13c414){var _0x2a75d3={},_0x274e61={},_0x52a6f2={'count':0x0,'rows':[]};var _0x76f800=_['map'](db[_0x1d43('0x2e')][_0x1d43('0x2f')],function(_0x8360eb){return{'name':_0x8360eb[_0x1d43('0x30')],'type':_0x8360eb['type'][_0x1d43('0x31')]};});_0x274e61[_0x1d43('0x32')]=_['map'](_0x76f800,'name');_0x274e61[_0x1d43('0x33')]=_['keys'](_0x13b8a3[_0x1d43('0x33')]);_0x274e61[_0x1d43('0x34')]=_['intersection'](_0x274e61[_0x1d43('0x32')],_0x274e61[_0x1d43('0x33')]);_0x2a75d3['attributes']=_['intersection'](_0x274e61[_0x1d43('0x32')],qs[_0x1d43('0x35')](_0x13b8a3[_0x1d43('0x33')][_0x1d43('0x35')]));_0x2a75d3[_0x1d43('0x36')]=_0x2a75d3[_0x1d43('0x36')][_0x1d43('0x37')]?_0x2a75d3[_0x1d43('0x36')]:_0x274e61[_0x1d43('0x32')];if(!_0x13b8a3[_0x1d43('0x33')][_0x1d43('0x38')](_0x1d43('0x39'))){_0x2a75d3['limit']=qs[_0x1d43('0x20')](_0x13b8a3['query'][_0x1d43('0x20')]);_0x2a75d3[_0x1d43('0x1e')]=qs[_0x1d43('0x1e')](_0x13b8a3['query'][_0x1d43('0x1e')]);}_0x2a75d3[_0x1d43('0x3a')]=qs['sort'](_0x13b8a3[_0x1d43('0x33')][_0x1d43('0x3b')]);_0x2a75d3[_0x1d43('0x3c')]=qs[_0x1d43('0x34')](_[_0x1d43('0x3d')](_0x13b8a3[_0x1d43('0x33')],_0x274e61[_0x1d43('0x34')]),_0x76f800);if(_0x13b8a3[_0x1d43('0x33')][_0x1d43('0x3e')]){_0x2a75d3[_0x1d43('0x3c')]=_[_0x1d43('0x3f')](_0x2a75d3['where'],{'$or':_['map'](_0x76f800,function(_0x3972ba){if(_0x3972ba[_0x1d43('0x40')]!==_0x1d43('0x41')){var _0x6e1a2f={};_0x6e1a2f[_0x3972ba[_0x1d43('0x2c')]]={'$like':'%'+_0x13b8a3[_0x1d43('0x33')]['filter']+'%'};return _0x6e1a2f;}})});}_0x2a75d3=_[_0x1d43('0x3f')]({},_0x2a75d3,_0x13b8a3[_0x1d43('0x42')]);var _0x22cc18={'where':_0x2a75d3[_0x1d43('0x3c')]};return db[_0x1d43('0x2e')][_0x1d43('0x21')](_0x22cc18)[_0x1d43('0x26')](function(_0x5765b5){_0x52a6f2['count']=_0x5765b5;if(_0x13b8a3[_0x1d43('0x33')]['includeAll']){_0x2a75d3[_0x1d43('0x43')]=[{'all':!![]}];}return db[_0x1d43('0x2e')][_0x1d43('0x44')](_0x2a75d3);})['then'](function(_0x568282){_0x52a6f2[_0x1d43('0x45')]=_0x568282;return _0x52a6f2;})['then'](respondWithFilteredResult(_0x13c414,_0x2a75d3))['catch'](handleError(_0x13c414,null));};exports[_0x1d43('0x46')]=function(_0x127cbd,_0xc9c567){var _0x33db5b={'raw':!![],'where':{'id':_0x127cbd[_0x1d43('0x47')]['id']}},_0x3f53e1={};_0x3f53e1['model']=_['keys'](db['FaxQueue'][_0x1d43('0x2f')]);_0x3f53e1[_0x1d43('0x33')]=_[_0x1d43('0x48')](_0x127cbd[_0x1d43('0x33')]);_0x3f53e1[_0x1d43('0x34')]=_[_0x1d43('0x49')](_0x3f53e1[_0x1d43('0x32')],_0x3f53e1['query']);_0x33db5b[_0x1d43('0x36')]=_['intersection'](_0x3f53e1['model'],qs[_0x1d43('0x35')](_0x127cbd['query']['fields']));_0x33db5b[_0x1d43('0x36')]=_0x33db5b['attributes'][_0x1d43('0x37')]?_0x33db5b['attributes']:_0x3f53e1['model'];if(_0x127cbd[_0x1d43('0x33')][_0x1d43('0x4a')]){_0x33db5b[_0x1d43('0x43')]=[{'all':!![]}];}_0x33db5b=_['merge']({},_0x33db5b,_0x127cbd['options']);return db[_0x1d43('0x2e')]['find'](_0x33db5b)['then'](handleEntityNotFound(_0xc9c567,null))[_0x1d43('0x26')](respondWithResult(_0xc9c567,null))[_0x1d43('0x4b')](handleError(_0xc9c567,null));};exports[_0x1d43('0x4c')]=function(_0xea800c,_0x4a5ad9){return db[_0x1d43('0x2e')][_0x1d43('0x4c')](_0xea800c[_0x1d43('0x4d')],{})[_0x1d43('0x26')](function(_0x1f7839){var _0x2df1fc=_0xea800c[_0x1d43('0x4e')][_0x1d43('0x28')]({'plain':!![]});if(!_0x2df1fc)throw new Error(_0x1d43('0x4f'));if(_0x2df1fc['role']===_0x1d43('0x4e')){var _0x201011=_0x1f7839[_0x1d43('0x28')]({'plain':!![]});var _0x1fa5ee='FaxQueues';return db[_0x1d43('0x50')]['find']({'where':{'name':_0x1fa5ee,'userProfileId':_0x2df1fc[_0x1d43('0x51')]},'raw':!![]})[_0x1d43('0x26')](function(_0x81dbfe){if(_0x81dbfe&&_0x81dbfe['autoAssociation']===0x0){return db[_0x1d43('0x52')][_0x1d43('0x4c')]({'name':_0x201011[_0x1d43('0x2c')],'resourceId':_0x201011['id'],'type':_0x81dbfe[_0x1d43('0x2c')],'sectionId':_0x81dbfe['id']},{})[_0x1d43('0x26')](function(){return _0x1f7839;});}else{return _0x1f7839;}})[_0x1d43('0x4b')](function(_0x1f22ee){logger['error'](_0x1d43('0x53'),_0x1f22ee);throw _0x1f22ee;});}return _0x1f7839;})[_0x1d43('0x26')](respondWithResult(_0x4a5ad9,0xc9))[_0x1d43('0x4b')](handleError(_0x4a5ad9,null));};exports['update']=function(_0x442f52,_0x3de5a5){if(_0x442f52[_0x1d43('0x4d')]['id']){delete _0x442f52[_0x1d43('0x4d')]['id'];}return db[_0x1d43('0x2e')][_0x1d43('0x54')]({'where':{'id':_0x442f52[_0x1d43('0x47')]['id']}})[_0x1d43('0x26')](handleEntityNotFound(_0x3de5a5,null))[_0x1d43('0x26')](saveUpdates(_0x442f52[_0x1d43('0x4d')],null))['then'](respondWithResult(_0x3de5a5,null))[_0x1d43('0x4b')](handleError(_0x3de5a5,null));};exports[_0x1d43('0x27')]=function(_0x32dc7a,_0x3d2de2){return db[_0x1d43('0x2e')][_0x1d43('0x54')]({'where':{'id':_0x32dc7a[_0x1d43('0x47')]['id']}})[_0x1d43('0x26')](handleEntityNotFound(_0x3d2de2,null))[_0x1d43('0x26')](removeEntity(_0x3d2de2,null))[_0x1d43('0x4b')](handleError(_0x3d2de2,null));};exports[_0x1d43('0x55')]=function(_0x4f8521,_0x56df40){return db[_0x1d43('0x2e')]['describe']()[_0x1d43('0x26')](respondWithResult(_0x56df40,null))['catch'](handleError(_0x56df40,null));};exports[_0x1d43('0x56')]=function(_0x195489,_0x58da07,_0x11420a){var _0x4f2cb9={'raw':!![],'where':{}},_0x29e725={},_0x59b41d;return db[_0x1d43('0x2e')][_0x1d43('0x57')]({'where':{'id':_0x195489[_0x1d43('0x47')]['id']}})['then'](handleEntityNotFound(_0x58da07,null))[_0x1d43('0x26')](function(_0x475349){if(_0x475349){_0x59b41d=_0x475349['get']({'plain':!![]});_0x29e725[_0x1d43('0x32')]=_[_0x1d43('0x48')](db['UserFaxQueue']['rawAttributes']);_0x29e725[_0x1d43('0x33')]=_[_0x1d43('0x48')](_0x195489[_0x1d43('0x33')]);_0x29e725[_0x1d43('0x34')]=_[_0x1d43('0x49')](_0x29e725[_0x1d43('0x32')],_0x29e725[_0x1d43('0x33')]);_0x4f2cb9['attributes']=_['intersection'](_0x29e725[_0x1d43('0x32')],qs[_0x1d43('0x35')](_0x195489[_0x1d43('0x33')][_0x1d43('0x35')]));_0x4f2cb9[_0x1d43('0x36')]=_0x4f2cb9[_0x1d43('0x36')][_0x1d43('0x37')]?_0x4f2cb9['attributes']:_0x29e725['model'];if(!_0x195489[_0x1d43('0x33')]['hasOwnProperty'](_0x1d43('0x39'))){_0x4f2cb9['limit']=qs['limit'](_0x195489[_0x1d43('0x33')][_0x1d43('0x20')]);_0x4f2cb9['offset']=qs[_0x1d43('0x1e')](_0x195489['query'][_0x1d43('0x1e')]);}_0x4f2cb9[_0x1d43('0x3a')]=qs[_0x1d43('0x3b')](_0x195489['query'][_0x1d43('0x3b')]);_0x4f2cb9[_0x1d43('0x3c')]=qs['filters'](_[_0x1d43('0x3d')](_0x195489[_0x1d43('0x33')],_0x29e725[_0x1d43('0x34')]));_0x4f2cb9[_0x1d43('0x3c')][_0x1d43('0x58')]=_0x475349['id'];if(_0x195489[_0x1d43('0x33')][_0x1d43('0x3e')]){_0x4f2cb9[_0x1d43('0x3c')]=_[_0x1d43('0x3f')](_0x4f2cb9['where'],{'$or':_[_0x1d43('0x59')](_0x4f2cb9['attributes'],function(_0x2c9377){var _0x3b7bb6={};_0x3b7bb6[_0x2c9377]={'$like':'%'+_0x195489['query'][_0x1d43('0x3e')]+'%'};return _0x3b7bb6;})});}_0x4f2cb9=_[_0x1d43('0x3f')]({},_0x4f2cb9,_0x195489[_0x1d43('0x42')]);return db[_0x1d43('0x5a')]['findAll'](_0x4f2cb9);}})[_0x1d43('0x26')](function(_0x33cd0a){if(_0x33cd0a){return db[_0x1d43('0x5b')]['findAndCountAll']({'where':{'id':_['map'](_0x33cd0a,_0x1d43('0x5c')),'role':_0x1d43('0x5d')},'attributes':['id','name',_0x1d43('0x5e'),'updatedAt',_0x1d43('0x5f')]});}})['then'](function(_0x50f90e){if(_0x50f90e){return{'count':_0x50f90e['count'],'rows':_[_0x1d43('0x59')](_0x50f90e[_0x1d43('0x45')],function(_0x342cdb){return{'membername':_0x342cdb['name'],'UserId':_0x342cdb['id'],'queue_name':_0x59b41d[_0x1d43('0x2c')],'FaxQueueId':_0x59b41d['id'],'interface':util['format']('%s/%s',_0x1d43('0x60'),_0x342cdb[_0x1d43('0x2c')]),'penalty':0x0,'paused':_0x342cdb['faxPause'],'createdAt':_0x342cdb[_0x1d43('0x5f')],'updatedAt':_0x342cdb[_0x1d43('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1d43('0x26')](respondWithFilteredResult(_0x58da07,_0x4f2cb9))[_0x1d43('0x4b')](handleError(_0x58da07,null));};exports[_0x1d43('0x62')]=function(_0x33d333,_0x43a88d,_0x448228){var _0xf19f4a={};var _0x18f5f2={};var _0x1d8972;var _0x1fd9de;return db[_0x1d43('0x2e')][_0x1d43('0x57')]({'where':{'id':_0x33d333['params']['id']}})[_0x1d43('0x26')](handleEntityNotFound(_0x43a88d,null))[_0x1d43('0x26')](function(_0x2596c5){if(_0x2596c5){_0x1d8972=_0x2596c5;_0x18f5f2['model']=_[_0x1d43('0x48')](db['Team'][_0x1d43('0x2f')]);_0x18f5f2[_0x1d43('0x33')]=_[_0x1d43('0x48')](_0x33d333[_0x1d43('0x33')]);_0x18f5f2['filters']=_[_0x1d43('0x49')](_0x18f5f2[_0x1d43('0x32')],_0x18f5f2[_0x1d43('0x33')]);_0xf19f4a['attributes']=_[_0x1d43('0x49')](_0x18f5f2[_0x1d43('0x32')],qs[_0x1d43('0x35')](_0x33d333['query'][_0x1d43('0x35')]));_0xf19f4a[_0x1d43('0x36')]=_0xf19f4a[_0x1d43('0x36')]['length']?_0xf19f4a['attributes']:_0x18f5f2[_0x1d43('0x32')];_0xf19f4a[_0x1d43('0x3a')]=qs['sort'](_0x33d333[_0x1d43('0x33')][_0x1d43('0x3b')]);_0xf19f4a[_0x1d43('0x3c')]=qs[_0x1d43('0x34')](_[_0x1d43('0x3d')](_0x33d333[_0x1d43('0x33')],_0x18f5f2[_0x1d43('0x34')]));if(_0x33d333[_0x1d43('0x33')][_0x1d43('0x3e')]){_0xf19f4a[_0x1d43('0x3c')]=_[_0x1d43('0x3f')](_0xf19f4a[_0x1d43('0x3c')],{'$or':_['map'](_0xf19f4a['attributes'],function(_0x59ff87){var _0x545dd1={};_0x545dd1[_0x59ff87]={'$like':'%'+_0x33d333[_0x1d43('0x33')][_0x1d43('0x3e')]+'%'};return _0x545dd1;})});}_0xf19f4a=_[_0x1d43('0x3f')]({},_0xf19f4a,_0x33d333[_0x1d43('0x42')]);return _0x1d8972[_0x1d43('0x62')](_0xf19f4a);}})[_0x1d43('0x26')](function(_0xf7672f){if(_0xf7672f){_0x1fd9de=_0xf7672f[_0x1d43('0x37')];if(!_0x33d333[_0x1d43('0x33')][_0x1d43('0x38')](_0x1d43('0x39'))){_0xf19f4a[_0x1d43('0x20')]=qs[_0x1d43('0x20')](_0x33d333[_0x1d43('0x33')][_0x1d43('0x20')]);_0xf19f4a['offset']=qs[_0x1d43('0x1e')](_0x33d333[_0x1d43('0x33')]['offset']);}return _0x1d8972[_0x1d43('0x62')](_0xf19f4a);}})[_0x1d43('0x26')](function(_0x426ee5){if(_0x426ee5){return _0x426ee5?{'count':_0x1fd9de,'rows':_0x426ee5}:null;}})[_0x1d43('0x26')](respondWithResult(_0x43a88d,null))['catch'](handleError(_0x43a88d,null));};exports[_0x1d43('0x63')]=function(_0x4ab8a0,_0x5699b7,_0x1a87d6){var _0x5cf001=_0x4ab8a0[_0x1d43('0x4d')]['ids'];return db[_0x1d43('0x64')]['findAll']({'where':{'id':_0x5cf001},'attributes':['id'],'include':[{'model':db[_0x1d43('0x5b')],'as':_0x1d43('0x65'),'attributes':['id','name','online',_0x1d43('0x66'),'interface'],'raw':!![]}]})['then'](function(_0x36f265){if(_0x36f265){var _0x58de8f=_[_0x1d43('0x67')](_0x36f265,function(_0x3843fe){var _0xa10837=_0x3843fe['get']({'plain':!![]});return _0xa10837[_0x1d43('0x65')];});return db[_0x1d43('0x2e')]['find']({'where':{'id':_0x4ab8a0[_0x1d43('0x47')]['id']}})[_0x1d43('0x26')](function(_0x109e83){return db[_0x1d43('0x68')][_0x1d43('0x69')](function(_0x4a989a){return _0x109e83[_0x1d43('0x63')](_0x5cf001,{'transaction':_0x4a989a})[_0x1d43('0x26')](function(){return BPromise[_0x1d43('0x6a')](_0x58de8f,function(_0xaa4356){return db[_0x1d43('0x5a')]['findOrCreate']({'where':{'UserId':_0xaa4356['id'],'FaxQueueId':_0x4ab8a0[_0x1d43('0x47')]['id']},'transaction':_0x4a989a});});})['then'](function(){_0x58de8f[_0x1d43('0x6b')](function(_0x12b2d5){socket['emit']('userFaxQueue:save',{'UserId':_0x12b2d5['id'],'FaxQueueId':_0x109e83['id']});});});});});}})[_0x1d43('0x26')](respondWithStatusCode(_0x5699b7,null))[_0x1d43('0x4b')](handleError(_0x5699b7,null));};exports[_0x1d43('0x6c')]=function(_0x8e18,_0x3db9f9,_0x3ea4b0){return db['Team'][_0x1d43('0x44')]({'where':{'id':_0x8e18[_0x1d43('0x33')][_0x1d43('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x1d43('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1d43('0x26')](handleEntityNotFound(_0x3db9f9,null))[_0x1d43('0x26')](function(_0x455f1b){var _0x2dfa0c=_[_0x1d43('0x59')](_0x455f1b,'id');var _0x2541a6=[];var _0x1c2a79=[];var _0xec1c3b=squel[_0x1d43('0x6e')]();_0xec1c3b['field'](_0x1d43('0x6f'))[_0x1d43('0x70')]('team_has_fax_queues','tq')[_0x1d43('0x71')](_0x1d43('0x72'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x1d43('0x73'),_0x8e18['params']['id']);for(var _0x496053=0x0;_0x496053<_0x455f1b['length'];_0x496053+=0x1){let _0x10385b=_0x455f1b[_0x496053];for(var _0x360c96=0x0;_0x360c96<_0x10385b['Agents'][_0x1d43('0x37')];_0x360c96+=0x1){let _0x54fe4e=_0x10385b[_0x1d43('0x65')][_0x360c96];var _0x4838a9=_0xec1c3b['clone']();_0x4838a9[_0x1d43('0x3c')](_0x1d43('0x74'),_0x54fe4e['id']);_0x1c2a79[_0x1d43('0x75')](db[_0x1d43('0x68')]['query'](_0x4838a9['toString'](),{'type':db[_0x1d43('0x68')][_0x1d43('0x76')]['SELECT']})[_0x1d43('0x26')](function(_0x425201){if(_0x425201[_0x1d43('0x37')]===0x1){return _0x54fe4e['id'];}else{var _0x19b35e=_[_0x1d43('0x77')](_['map'](_0x425201,'TeamId'),function(_0x4323b0){return _[_0x1d43('0x78')](_0x2dfa0c,_0x4323b0);});if(_0x19b35e){return _0x54fe4e['id'];}}}));}}return BPromise['all'](_0x1c2a79)['then'](function(_0x171afb){_0x2541a6=_(_0x2541a6)[_0x1d43('0x79')](_0x171afb)['compact']()[_0x1d43('0x7a')]();return db[_0x1d43('0x2e')]['find']({'where':{'id':_0x8e18[_0x1d43('0x47')]['id']}})[_0x1d43('0x26')](function(_0x4f4d0f){return db[_0x1d43('0x68')][_0x1d43('0x69')](function(_0x35d166){return _0x4f4d0f[_0x1d43('0x6c')](_0x8e18[_0x1d43('0x33')][_0x1d43('0x6d')],{'transaction':_0x35d166})[_0x1d43('0x26')](function(){if(!_[_0x1d43('0x7b')](_0x2541a6)){return _0x4f4d0f[_0x1d43('0x7c')](_0x2541a6,{'transaction':_0x35d166});}})[_0x1d43('0x26')](function(){_0x2541a6[_0x1d43('0x6b')](function(_0x228e1b){socket['emit'](_0x1d43('0x7d'),{'UserId':_0x228e1b,'FaxQueueId':_0x4f4d0f['id']});});});});});});})[_0x1d43('0x26')](respondWithStatusCode(_0x3db9f9,null))[_0x1d43('0x4b')](handleError(_0x3db9f9,null));};exports[_0x1d43('0x7e')]=function(_0x51b178,_0x17c257,_0x41cf41){return db[_0x1d43('0x2e')][_0x1d43('0x54')]({'where':{'id':_0x51b178[_0x1d43('0x47')]['id']}})[_0x1d43('0x26')](handleEntityNotFound(_0x17c257,null))[_0x1d43('0x26')](function(_0x2ac69b){if(_0x2ac69b){return _0x2ac69b['addAgents'](_0x51b178['body'][_0x1d43('0x6d')],_[_0x1d43('0x7f')](_0x51b178[_0x1d43('0x4d')],[_0x1d43('0x6d'),'id'])||{})[_0x1d43('0x80')](function(_0x14d1d2){for(var _0x1c212c=0x0;_0x1c212c<_0x51b178['body'][_0x1d43('0x6d')][_0x1d43('0x37')];_0x1c212c+=0x1){socket['emit'](_0x1d43('0x81'),{'UserId':Number(_0x51b178['body'][_0x1d43('0x6d')][_0x1c212c]),'FaxQueueId':Number(_0x51b178[_0x1d43('0x47')]['id'])});}return _0x14d1d2;});}})[_0x1d43('0x26')](respondWithResult(_0x17c257,null))[_0x1d43('0x4b')](handleError(_0x17c257,null));};exports[_0x1d43('0x7c')]=function(_0x22e5da,_0x46d70e,_0x298b76){return db['FaxQueue'][_0x1d43('0x54')]({'where':{'id':_0x22e5da['params']['id']}})[_0x1d43('0x26')](handleEntityNotFound(_0x46d70e,null))[_0x1d43('0x26')](function(_0x2492a1){if(_0x2492a1){return _0x2492a1[_0x1d43('0x7c')](_0x22e5da[_0x1d43('0x33')][_0x1d43('0x6d')])[_0x1d43('0x26')](function(){if(_[_0x1d43('0x82')](_0x22e5da[_0x1d43('0x33')][_0x1d43('0x6d')])){for(var _0x476606=0x0;_0x476606<_0x22e5da['query'][_0x1d43('0x6d')][_0x1d43('0x37')];_0x476606+=0x1){socket[_0x1d43('0x83')](_0x1d43('0x7d'),{'UserId':Number(_0x22e5da[_0x1d43('0x33')][_0x1d43('0x6d')][_0x476606]),'FaxQueueId':Number(_0x22e5da[_0x1d43('0x47')]['id'])});}}else{socket[_0x1d43('0x83')](_0x1d43('0x7d'),{'UserId':Number(_0x22e5da[_0x1d43('0x33')][_0x1d43('0x6d')]),'FaxQueueId':Number(_0x22e5da[_0x1d43('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x46d70e,null))[_0x1d43('0x4b')](handleError(_0x46d70e,null));};exports[_0x1d43('0x84')]=function(_0x544568,_0x3d07b1,_0x1fdaad){var _0x5e31e8={};var _0x3d65bf={};var _0x4a40b2;var _0x3d4991;return db[_0x1d43('0x2e')][_0x1d43('0x57')]({'where':{'id':_0x544568[_0x1d43('0x47')]['id']}})[_0x1d43('0x26')](handleEntityNotFound(_0x3d07b1,null))[_0x1d43('0x26')](function(_0x1f3d30){if(_0x1f3d30){_0x4a40b2=_0x1f3d30;_0x3d65bf[_0x1d43('0x32')]=_[_0x1d43('0x48')](db['User'][_0x1d43('0x2f')]);_0x3d65bf[_0x1d43('0x33')]=_[_0x1d43('0x48')](_0x544568[_0x1d43('0x33')]);_0x3d65bf['filters']=_['intersection'](_0x3d65bf[_0x1d43('0x32')],_0x3d65bf[_0x1d43('0x33')]);_0x5e31e8[_0x1d43('0x36')]=_[_0x1d43('0x49')](_0x3d65bf['model'],qs[_0x1d43('0x35')](_0x544568['query']['fields']));_0x5e31e8[_0x1d43('0x36')]=_0x5e31e8[_0x1d43('0x36')][_0x1d43('0x37')]?_0x5e31e8[_0x1d43('0x36')]:_0x3d65bf['model'];_0x5e31e8[_0x1d43('0x3a')]=qs['sort'](_0x544568['query'][_0x1d43('0x3b')]);_0x5e31e8['where']=qs['filters'](_[_0x1d43('0x3d')](_0x544568[_0x1d43('0x33')],_0x3d65bf[_0x1d43('0x34')]));if(_0x544568[_0x1d43('0x33')][_0x1d43('0x3e')]){_0x5e31e8[_0x1d43('0x3c')]=_['merge'](_0x5e31e8['where'],{'$or':_[_0x1d43('0x59')](_0x5e31e8[_0x1d43('0x36')],function(_0x5dc829){var _0x57c9da={};_0x57c9da[_0x5dc829]={'$like':'%'+_0x544568[_0x1d43('0x33')][_0x1d43('0x3e')]+'%'};return _0x57c9da;})});}_0x5e31e8=_['merge']({},_0x5e31e8,_0x544568[_0x1d43('0x42')]);return _0x4a40b2['getAgents'](_0x5e31e8);}})[_0x1d43('0x26')](function(_0x47a9e8){if(_0x47a9e8){_0x3d4991=_0x47a9e8[_0x1d43('0x37')];if(!_0x544568[_0x1d43('0x33')]['hasOwnProperty'](_0x1d43('0x39'))){_0x5e31e8[_0x1d43('0x20')]=qs[_0x1d43('0x20')](_0x544568[_0x1d43('0x33')][_0x1d43('0x20')]);_0x5e31e8[_0x1d43('0x1e')]=qs[_0x1d43('0x1e')](_0x544568['query'][_0x1d43('0x1e')]);}return _0x4a40b2[_0x1d43('0x84')](_0x5e31e8);}})[_0x1d43('0x26')](function(_0x1129a3){if(_0x1129a3){return _0x1129a3?{'count':_0x3d4991,'rows':_0x1129a3}:null;}})[_0x1d43('0x26')](respondWithResult(_0x3d07b1,null))['catch'](handleError(_0x3d07b1,null));};
\ No newline at end of file
+var _0xf5a6=['findOrCreate','forEach','emit','removeTeams','ids','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','QueryTypes','TeamId','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','getAgents','findOne','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./faxQueue.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getMembers','UserFaxQueue','hasOwnProperty','nolimit','order','User','UserId','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','flatMap','sequelize','transaction'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xf5a6,0x1bb));var _0x6f5a=function(_0x4c5f3e,_0xbab028){_0x4c5f3e=_0x4c5f3e-0x0;var _0x39f263=_0xf5a6[_0x4c5f3e];return _0x39f263;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f5a('0x0'));var zipdir=require(_0x6f5a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6f5a('0x2'));var BPromise=require(_0x6f5a('0x3'));var Mustache=require('mustache');var util=require(_0x6f5a('0x4'));var path=require(_0x6f5a('0x5'));var sox=require(_0x6f5a('0x6'));var csv=require(_0x6f5a('0x7'));var ejs=require(_0x6f5a('0x8'));var fs=require('fs');var fs_extra=require(_0x6f5a('0x9'));var _=require('lodash');var squel=require(_0x6f5a('0xa'));var crypto=require(_0x6f5a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6f5a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6f5a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6f5a('0xe'));var qs=require(_0x6f5a('0xf'));var as=require(_0x6f5a('0x10'));var hardwareService=require(_0x6f5a('0x11'));var logger=require(_0x6f5a('0x12'))(_0x6f5a('0x13'));var utils=require(_0x6f5a('0x14'));var config=require(_0x6f5a('0x15'));var licenseUtil=require(_0x6f5a('0x16'));var db=require(_0x6f5a('0x17'))['db'];config['redis']=_['defaults'](config[_0x6f5a('0x18')],{'host':_0x6f5a('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6f5a('0x18')]));require(_0x6f5a('0x1a'))[_0x6f5a('0x1b')](socket);function respondWithStatusCode(_0x3b5670,_0x58ee76){_0x58ee76=_0x58ee76||0xcc;return function(_0x125b66){if(_0x125b66){return _0x3b5670[_0x6f5a('0x1c')](_0x58ee76);}return _0x3b5670[_0x6f5a('0x1d')](_0x58ee76)[_0x6f5a('0x1e')]();};}function respondWithResult(_0x58108c,_0xdf0e74){_0xdf0e74=_0xdf0e74||0xc8;return function(_0x2da963){if(_0x2da963){return _0x58108c['status'](_0xdf0e74)[_0x6f5a('0x1f')](_0x2da963);}};}function respondWithFilteredResult(_0x5aa327,_0x3ce91b){return function(_0xbc9197){if(_0xbc9197){var _0x3c89f9=typeof _0x3ce91b['offset']===_0x6f5a('0x20')&&typeof _0x3ce91b[_0x6f5a('0x21')]===_0x6f5a('0x20');var _0x195f0f=_0xbc9197['count'];var _0x3cdef3=_0x3c89f9?0x0:_0x3ce91b[_0x6f5a('0x22')];var _0x3e4d35=_0x3c89f9?_0xbc9197[_0x6f5a('0x23')]:_0x3ce91b[_0x6f5a('0x22')]+_0x3ce91b[_0x6f5a('0x21')];var _0x304fff;if(_0x3e4d35>=_0x195f0f){_0x3e4d35=_0x195f0f;_0x304fff=0xc8;}else{_0x304fff=0xce;}_0x5aa327[_0x6f5a('0x1d')](_0x304fff);return _0x5aa327[_0x6f5a('0x24')](_0x6f5a('0x25'),_0x3cdef3+'-'+_0x3e4d35+'/'+_0x195f0f)[_0x6f5a('0x1f')](_0xbc9197);}return null;};}function patchUpdates(_0x31991f){return function(_0x1919cb){try{jsonpatch[_0x6f5a('0x26')](_0x1919cb,_0x31991f,!![]);}catch(_0x1c045f){return BPromise[_0x6f5a('0x27')](_0x1c045f);}return _0x1919cb['save']();};}function saveUpdates(_0x1c6e0a,_0x3050cd){return function(_0x27bf4d){if(_0x27bf4d){return _0x27bf4d['update'](_0x1c6e0a)[_0x6f5a('0x28')](function(_0x1db08c){return _0x1db08c;});}return null;};}function removeEntity(_0x39090b,_0x29b736){return function(_0x4a94c8){if(_0x4a94c8){return _0x4a94c8[_0x6f5a('0x29')]()[_0x6f5a('0x28')](function(){var _0x16b25a=_0x4a94c8[_0x6f5a('0x2a')]({'plain':!![]});var _0x2d00af=_0x6f5a('0x2b');return db[_0x6f5a('0x2c')][_0x6f5a('0x29')]({'where':{'type':_0x2d00af,'resourceId':_0x16b25a['id']}})[_0x6f5a('0x28')](function(){return _0x4a94c8;});})[_0x6f5a('0x28')](function(){_0x39090b[_0x6f5a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a6fe6,_0x254bd2){return function(_0x59be5a){if(!_0x59be5a){_0x4a6fe6[_0x6f5a('0x1c')](0x194);}return _0x59be5a;};}function handleError(_0x2a2b7b,_0x420dab){_0x420dab=_0x420dab||0x1f4;return function(_0x9417ce){logger[_0x6f5a('0x2d')](_0x9417ce[_0x6f5a('0x2e')]);if(_0x9417ce[_0x6f5a('0x2f')]){delete _0x9417ce[_0x6f5a('0x2f')];}_0x2a2b7b[_0x6f5a('0x1d')](_0x420dab)[_0x6f5a('0x30')](_0x9417ce);};}exports[_0x6f5a('0x31')]=function(_0x6275dd,_0x44bd91){var _0x359911={},_0x4e3f4b={},_0x14262a={'count':0x0,'rows':[]};var _0x2cb528=_[_0x6f5a('0x32')](db[_0x6f5a('0x33')][_0x6f5a('0x34')],function(_0x5202a3){return{'name':_0x5202a3[_0x6f5a('0x35')],'type':_0x5202a3['type'][_0x6f5a('0x36')]};});_0x4e3f4b[_0x6f5a('0x37')]=_[_0x6f5a('0x32')](_0x2cb528,_0x6f5a('0x2f'));_0x4e3f4b[_0x6f5a('0x38')]=_['keys'](_0x6275dd[_0x6f5a('0x38')]);_0x4e3f4b[_0x6f5a('0x39')]=_[_0x6f5a('0x3a')](_0x4e3f4b['model'],_0x4e3f4b[_0x6f5a('0x38')]);_0x359911[_0x6f5a('0x3b')]=_[_0x6f5a('0x3a')](_0x4e3f4b[_0x6f5a('0x37')],qs['fields'](_0x6275dd['query'][_0x6f5a('0x3c')]));_0x359911[_0x6f5a('0x3b')]=_0x359911[_0x6f5a('0x3b')][_0x6f5a('0x3d')]?_0x359911['attributes']:_0x4e3f4b[_0x6f5a('0x37')];if(!_0x6275dd[_0x6f5a('0x38')]['hasOwnProperty']('nolimit')){_0x359911[_0x6f5a('0x21')]=qs[_0x6f5a('0x21')](_0x6275dd[_0x6f5a('0x38')][_0x6f5a('0x21')]);_0x359911['offset']=qs[_0x6f5a('0x22')](_0x6275dd[_0x6f5a('0x38')][_0x6f5a('0x22')]);}_0x359911['order']=qs[_0x6f5a('0x3e')](_0x6275dd[_0x6f5a('0x38')][_0x6f5a('0x3e')]);_0x359911[_0x6f5a('0x3f')]=qs[_0x6f5a('0x39')](_[_0x6f5a('0x40')](_0x6275dd[_0x6f5a('0x38')],_0x4e3f4b['filters']),_0x2cb528);if(_0x6275dd[_0x6f5a('0x38')][_0x6f5a('0x41')]){_0x359911[_0x6f5a('0x3f')]=_[_0x6f5a('0x42')](_0x359911[_0x6f5a('0x3f')],{'$or':_[_0x6f5a('0x32')](_0x2cb528,function(_0x1cd0fb){if(_0x1cd0fb[_0x6f5a('0x43')]!=='VIRTUAL'){var _0x4e6125={};_0x4e6125[_0x1cd0fb[_0x6f5a('0x2f')]]={'$like':'%'+_0x6275dd['query'][_0x6f5a('0x41')]+'%'};return _0x4e6125;}})});}_0x359911=_[_0x6f5a('0x42')]({},_0x359911,_0x6275dd[_0x6f5a('0x44')]);var _0x14124b={'where':_0x359911[_0x6f5a('0x3f')]};return db[_0x6f5a('0x33')]['count'](_0x14124b)[_0x6f5a('0x28')](function(_0x9c21e7){_0x14262a[_0x6f5a('0x23')]=_0x9c21e7;if(_0x6275dd[_0x6f5a('0x38')][_0x6f5a('0x45')]){_0x359911[_0x6f5a('0x46')]=[{'all':!![]}];}return db[_0x6f5a('0x33')][_0x6f5a('0x47')](_0x359911);})[_0x6f5a('0x28')](function(_0x2c8a23){_0x14262a[_0x6f5a('0x48')]=_0x2c8a23;return _0x14262a;})[_0x6f5a('0x28')](respondWithFilteredResult(_0x44bd91,_0x359911))[_0x6f5a('0x49')](handleError(_0x44bd91,null));};exports[_0x6f5a('0x4a')]=function(_0x11a19f,_0x3df442){var _0xdb9f30={'raw':!![],'where':{'id':_0x11a19f['params']['id']}},_0x107a18={};_0x107a18[_0x6f5a('0x37')]=_['keys'](db[_0x6f5a('0x33')]['rawAttributes']);_0x107a18[_0x6f5a('0x38')]=_[_0x6f5a('0x4b')](_0x11a19f[_0x6f5a('0x38')]);_0x107a18['filters']=_[_0x6f5a('0x3a')](_0x107a18[_0x6f5a('0x37')],_0x107a18['query']);_0xdb9f30['attributes']=_[_0x6f5a('0x3a')](_0x107a18[_0x6f5a('0x37')],qs[_0x6f5a('0x3c')](_0x11a19f['query'][_0x6f5a('0x3c')]));_0xdb9f30['attributes']=_0xdb9f30[_0x6f5a('0x3b')][_0x6f5a('0x3d')]?_0xdb9f30[_0x6f5a('0x3b')]:_0x107a18['model'];if(_0x11a19f[_0x6f5a('0x38')]['includeAll']){_0xdb9f30[_0x6f5a('0x46')]=[{'all':!![]}];}_0xdb9f30=_['merge']({},_0xdb9f30,_0x11a19f[_0x6f5a('0x44')]);return db[_0x6f5a('0x33')][_0x6f5a('0x4c')](_0xdb9f30)['then'](handleEntityNotFound(_0x3df442,null))[_0x6f5a('0x28')](respondWithResult(_0x3df442,null))['catch'](handleError(_0x3df442,null));};exports[_0x6f5a('0x4d')]=function(_0x49064b,_0x5c783a){return db[_0x6f5a('0x33')][_0x6f5a('0x4d')](_0x49064b[_0x6f5a('0x4e')],{})[_0x6f5a('0x28')](function(_0x98ff51){var _0x528bf1=_0x49064b[_0x6f5a('0x4f')][_0x6f5a('0x2a')]({'plain':!![]});if(!_0x528bf1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x528bf1[_0x6f5a('0x50')]===_0x6f5a('0x4f')){var _0x4f5f5b=_0x98ff51[_0x6f5a('0x2a')]({'plain':!![]});var _0x347512=_0x6f5a('0x2b');return db[_0x6f5a('0x51')][_0x6f5a('0x4c')]({'where':{'name':_0x347512,'userProfileId':_0x528bf1[_0x6f5a('0x52')]},'raw':!![]})[_0x6f5a('0x28')](function(_0x3d1114){if(_0x3d1114&&_0x3d1114[_0x6f5a('0x53')]===0x0){return db[_0x6f5a('0x2c')][_0x6f5a('0x4d')]({'name':_0x4f5f5b[_0x6f5a('0x2f')],'resourceId':_0x4f5f5b['id'],'type':_0x3d1114[_0x6f5a('0x2f')],'sectionId':_0x3d1114['id']},{})[_0x6f5a('0x28')](function(){return _0x98ff51;});}else{return _0x98ff51;}})['catch'](function(_0xa6fd72){logger[_0x6f5a('0x2d')](_0x6f5a('0x54'),_0xa6fd72);throw _0xa6fd72;});}return _0x98ff51;})[_0x6f5a('0x28')](respondWithResult(_0x5c783a,0xc9))['catch'](handleError(_0x5c783a,null));};exports[_0x6f5a('0x55')]=function(_0x4d6582,_0x53687d){if(_0x4d6582[_0x6f5a('0x4e')]['id']){delete _0x4d6582[_0x6f5a('0x4e')]['id'];}return db[_0x6f5a('0x33')]['find']({'where':{'id':_0x4d6582[_0x6f5a('0x56')]['id']}})['then'](handleEntityNotFound(_0x53687d,null))[_0x6f5a('0x28')](saveUpdates(_0x4d6582[_0x6f5a('0x4e')],null))['then'](respondWithResult(_0x53687d,null))[_0x6f5a('0x49')](handleError(_0x53687d,null));};exports['destroy']=function(_0x2ac156,_0x534544){return db['FaxQueue'][_0x6f5a('0x4c')]({'where':{'id':_0x2ac156[_0x6f5a('0x56')]['id']}})['then'](handleEntityNotFound(_0x534544,null))[_0x6f5a('0x28')](removeEntity(_0x534544,null))[_0x6f5a('0x49')](handleError(_0x534544,null));};exports['describe']=function(_0x440da0,_0x92d8e3){return db['FaxQueue']['describe']()[_0x6f5a('0x28')](respondWithResult(_0x92d8e3,null))[_0x6f5a('0x49')](handleError(_0x92d8e3,null));};exports[_0x6f5a('0x57')]=function(_0x386977,_0x23af29,_0x5ccf2f){var _0x49bb28={'raw':!![],'where':{}},_0x1ae21c={},_0x10772b;return db[_0x6f5a('0x33')]['findOne']({'where':{'id':_0x386977[_0x6f5a('0x56')]['id']}})[_0x6f5a('0x28')](handleEntityNotFound(_0x23af29,null))[_0x6f5a('0x28')](function(_0x34917e){if(_0x34917e){_0x10772b=_0x34917e[_0x6f5a('0x2a')]({'plain':!![]});_0x1ae21c[_0x6f5a('0x37')]=_['keys'](db[_0x6f5a('0x58')]['rawAttributes']);_0x1ae21c[_0x6f5a('0x38')]=_['keys'](_0x386977[_0x6f5a('0x38')]);_0x1ae21c[_0x6f5a('0x39')]=_['intersection'](_0x1ae21c[_0x6f5a('0x37')],_0x1ae21c[_0x6f5a('0x38')]);_0x49bb28[_0x6f5a('0x3b')]=_[_0x6f5a('0x3a')](_0x1ae21c[_0x6f5a('0x37')],qs[_0x6f5a('0x3c')](_0x386977[_0x6f5a('0x38')][_0x6f5a('0x3c')]));_0x49bb28['attributes']=_0x49bb28[_0x6f5a('0x3b')][_0x6f5a('0x3d')]?_0x49bb28['attributes']:_0x1ae21c[_0x6f5a('0x37')];if(!_0x386977[_0x6f5a('0x38')][_0x6f5a('0x59')](_0x6f5a('0x5a'))){_0x49bb28[_0x6f5a('0x21')]=qs['limit'](_0x386977[_0x6f5a('0x38')][_0x6f5a('0x21')]);_0x49bb28['offset']=qs[_0x6f5a('0x22')](_0x386977[_0x6f5a('0x38')][_0x6f5a('0x22')]);}_0x49bb28[_0x6f5a('0x5b')]=qs['sort'](_0x386977[_0x6f5a('0x38')]['sort']);_0x49bb28[_0x6f5a('0x3f')]=qs[_0x6f5a('0x39')](_[_0x6f5a('0x40')](_0x386977[_0x6f5a('0x38')],_0x1ae21c[_0x6f5a('0x39')]));_0x49bb28['where']['FaxQueueId']=_0x34917e['id'];if(_0x386977['query'][_0x6f5a('0x41')]){_0x49bb28['where']=_[_0x6f5a('0x42')](_0x49bb28[_0x6f5a('0x3f')],{'$or':_[_0x6f5a('0x32')](_0x49bb28['attributes'],function(_0x47d217){var _0x36283d={};_0x36283d[_0x47d217]={'$like':'%'+_0x386977[_0x6f5a('0x38')][_0x6f5a('0x41')]+'%'};return _0x36283d;})});}_0x49bb28=_[_0x6f5a('0x42')]({},_0x49bb28,_0x386977[_0x6f5a('0x44')]);return db[_0x6f5a('0x58')][_0x6f5a('0x47')](_0x49bb28);}})[_0x6f5a('0x28')](function(_0x56d28f){if(_0x56d28f){return db[_0x6f5a('0x5c')]['findAndCountAll']({'where':{'id':_[_0x6f5a('0x32')](_0x56d28f,_0x6f5a('0x5d')),'role':'agent'},'attributes':['id',_0x6f5a('0x2f'),_0x6f5a('0x5e'),_0x6f5a('0x5f'),_0x6f5a('0x60')]});}})[_0x6f5a('0x28')](function(_0x25357e){if(_0x25357e){return{'count':_0x25357e[_0x6f5a('0x23')],'rows':_[_0x6f5a('0x32')](_0x25357e[_0x6f5a('0x48')],function(_0x34dcb9){return{'membername':_0x34dcb9[_0x6f5a('0x2f')],'UserId':_0x34dcb9['id'],'queue_name':_0x10772b[_0x6f5a('0x2f')],'FaxQueueId':_0x10772b['id'],'interface':util[_0x6f5a('0x61')](_0x6f5a('0x62'),_0x6f5a('0x63'),_0x34dcb9[_0x6f5a('0x2f')]),'penalty':0x0,'paused':_0x34dcb9[_0x6f5a('0x5e')],'createdAt':_0x34dcb9[_0x6f5a('0x60')],'updatedAt':_0x34dcb9[_0x6f5a('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6f5a('0x28')](respondWithFilteredResult(_0x23af29,_0x49bb28))[_0x6f5a('0x49')](handleError(_0x23af29,null));};exports[_0x6f5a('0x64')]=function(_0x33e031,_0xfbebe9,_0x39f323){var _0x1c40d3={};var _0x374c73={};var _0x3ccccf;var _0x5c6591;return db[_0x6f5a('0x33')]['findOne']({'where':{'id':_0x33e031[_0x6f5a('0x56')]['id']}})[_0x6f5a('0x28')](handleEntityNotFound(_0xfbebe9,null))[_0x6f5a('0x28')](function(_0x151de7){if(_0x151de7){_0x3ccccf=_0x151de7;_0x374c73[_0x6f5a('0x37')]=_[_0x6f5a('0x4b')](db[_0x6f5a('0x65')]['rawAttributes']);_0x374c73[_0x6f5a('0x38')]=_['keys'](_0x33e031[_0x6f5a('0x38')]);_0x374c73['filters']=_[_0x6f5a('0x3a')](_0x374c73['model'],_0x374c73['query']);_0x1c40d3[_0x6f5a('0x3b')]=_['intersection'](_0x374c73[_0x6f5a('0x37')],qs['fields'](_0x33e031[_0x6f5a('0x38')][_0x6f5a('0x3c')]));_0x1c40d3[_0x6f5a('0x3b')]=_0x1c40d3[_0x6f5a('0x3b')][_0x6f5a('0x3d')]?_0x1c40d3[_0x6f5a('0x3b')]:_0x374c73[_0x6f5a('0x37')];_0x1c40d3['order']=qs[_0x6f5a('0x3e')](_0x33e031[_0x6f5a('0x38')]['sort']);_0x1c40d3[_0x6f5a('0x3f')]=qs[_0x6f5a('0x39')](_[_0x6f5a('0x40')](_0x33e031[_0x6f5a('0x38')],_0x374c73[_0x6f5a('0x39')]));if(_0x33e031[_0x6f5a('0x38')][_0x6f5a('0x41')]){_0x1c40d3[_0x6f5a('0x3f')]=_[_0x6f5a('0x42')](_0x1c40d3[_0x6f5a('0x3f')],{'$or':_[_0x6f5a('0x32')](_0x1c40d3[_0x6f5a('0x3b')],function(_0x268d46){var _0x4cf675={};_0x4cf675[_0x268d46]={'$like':'%'+_0x33e031[_0x6f5a('0x38')]['filter']+'%'};return _0x4cf675;})});}_0x1c40d3=_[_0x6f5a('0x42')]({},_0x1c40d3,_0x33e031['options']);return _0x3ccccf[_0x6f5a('0x64')](_0x1c40d3);}})['then'](function(_0x2b0c1e){if(_0x2b0c1e){_0x5c6591=_0x2b0c1e['length'];if(!_0x33e031[_0x6f5a('0x38')][_0x6f5a('0x59')](_0x6f5a('0x5a'))){_0x1c40d3[_0x6f5a('0x21')]=qs[_0x6f5a('0x21')](_0x33e031[_0x6f5a('0x38')][_0x6f5a('0x21')]);_0x1c40d3[_0x6f5a('0x22')]=qs['offset'](_0x33e031[_0x6f5a('0x38')]['offset']);}return _0x3ccccf[_0x6f5a('0x64')](_0x1c40d3);}})[_0x6f5a('0x28')](function(_0x35f2f3){if(_0x35f2f3){return _0x35f2f3?{'count':_0x5c6591,'rows':_0x35f2f3}:null;}})[_0x6f5a('0x28')](respondWithResult(_0xfbebe9,null))['catch'](handleError(_0xfbebe9,null));};exports[_0x6f5a('0x66')]=function(_0xf12c5b,_0x3792b2,_0x382906){var _0x5958d7=_0xf12c5b[_0x6f5a('0x4e')]['ids'];return db[_0x6f5a('0x65')][_0x6f5a('0x47')]({'where':{'id':_0x5958d7},'attributes':['id'],'include':[{'model':db[_0x6f5a('0x5c')],'as':_0x6f5a('0x67'),'attributes':['id',_0x6f5a('0x2f'),_0x6f5a('0x68'),_0x6f5a('0x69'),'interface'],'raw':!![]}]})[_0x6f5a('0x28')](function(_0x3b593d){if(_0x3b593d){var _0x4240f9=_[_0x6f5a('0x6a')](_0x3b593d,function(_0xaa7a7){var _0x44b638=_0xaa7a7[_0x6f5a('0x2a')]({'plain':!![]});return _0x44b638['Agents'];});return db['FaxQueue'][_0x6f5a('0x4c')]({'where':{'id':_0xf12c5b['params']['id']}})[_0x6f5a('0x28')](function(_0x2322e0){return db[_0x6f5a('0x6b')][_0x6f5a('0x6c')](function(_0x160ce2){return _0x2322e0[_0x6f5a('0x66')](_0x5958d7,{'transaction':_0x160ce2})[_0x6f5a('0x28')](function(){return BPromise['each'](_0x4240f9,function(_0x27b69a){return db[_0x6f5a('0x58')][_0x6f5a('0x6d')]({'where':{'UserId':_0x27b69a['id'],'FaxQueueId':_0xf12c5b[_0x6f5a('0x56')]['id']},'transaction':_0x160ce2});});})['then'](function(){_0x4240f9[_0x6f5a('0x6e')](function(_0x5b96e1){socket[_0x6f5a('0x6f')]('userFaxQueue:save',{'UserId':_0x5b96e1['id'],'FaxQueueId':_0x2322e0['id']});});});});});}})[_0x6f5a('0x28')](respondWithStatusCode(_0x3792b2,null))['catch'](handleError(_0x3792b2,null));};exports[_0x6f5a('0x70')]=function(_0x13c7f7,_0x5e765d,_0x35d875){return db[_0x6f5a('0x65')][_0x6f5a('0x47')]({'where':{'id':_0x13c7f7[_0x6f5a('0x38')][_0x6f5a('0x71')]},'attributes':['id'],'include':[{'model':db[_0x6f5a('0x5c')],'as':_0x6f5a('0x67'),'attributes':['id'],'raw':!![]}]})[_0x6f5a('0x28')](handleEntityNotFound(_0x5e765d,null))[_0x6f5a('0x28')](function(_0x253f46){var _0x2fbf9d=_[_0x6f5a('0x32')](_0x253f46,'id');var _0x40ba31=[];var _0x2a80d6=[];var _0x3233a9=squel[_0x6f5a('0x72')]();_0x3233a9[_0x6f5a('0x73')](_0x6f5a('0x74'))[_0x6f5a('0x75')](_0x6f5a('0x76'),'tq')[_0x6f5a('0x77')](_0x6f5a('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6f5a('0x3f')]('FaxQueueId\x20=\x20?',_0x13c7f7['params']['id']);for(var _0x54f679=0x0;_0x54f679<_0x253f46['length'];_0x54f679+=0x1){let _0x134659=_0x253f46[_0x54f679];for(var _0x2c56d5=0x0;_0x2c56d5<_0x134659['Agents'][_0x6f5a('0x3d')];_0x2c56d5+=0x1){let _0x4ca5ac=_0x134659['Agents'][_0x2c56d5];var _0x190e44=_0x3233a9[_0x6f5a('0x79')]();_0x190e44[_0x6f5a('0x3f')](_0x6f5a('0x7a'),_0x4ca5ac['id']);_0x2a80d6['push'](db['sequelize']['query'](_0x190e44['toString'](),{'type':db[_0x6f5a('0x6b')][_0x6f5a('0x7b')]['SELECT']})[_0x6f5a('0x28')](function(_0x1054af){if(_0x1054af[_0x6f5a('0x3d')]===0x1){return _0x4ca5ac['id'];}else{var _0x219887=_['every'](_['map'](_0x1054af,_0x6f5a('0x7c')),function(_0x1a5faf){return _['includes'](_0x2fbf9d,_0x1a5faf);});if(_0x219887){return _0x4ca5ac['id'];}}}));}}return BPromise[_0x6f5a('0x7d')](_0x2a80d6)[_0x6f5a('0x28')](function(_0x2a2e8c){_0x40ba31=_(_0x40ba31)[_0x6f5a('0x7e')](_0x2a2e8c)[_0x6f5a('0x7f')]()[_0x6f5a('0x80')]();return db['FaxQueue'][_0x6f5a('0x4c')]({'where':{'id':_0x13c7f7[_0x6f5a('0x56')]['id']}})[_0x6f5a('0x28')](function(_0x775071){return db[_0x6f5a('0x6b')][_0x6f5a('0x6c')](function(_0x48ad8c){return _0x775071['removeTeams'](_0x13c7f7['query'][_0x6f5a('0x71')],{'transaction':_0x48ad8c})[_0x6f5a('0x28')](function(){if(!_[_0x6f5a('0x81')](_0x40ba31)){return _0x775071[_0x6f5a('0x82')](_0x40ba31,{'transaction':_0x48ad8c});}})['then'](function(){_0x40ba31['forEach'](function(_0x5a9302){socket[_0x6f5a('0x6f')](_0x6f5a('0x83'),{'UserId':_0x5a9302,'FaxQueueId':_0x775071['id']});});});});});});})['then'](respondWithStatusCode(_0x5e765d,null))[_0x6f5a('0x49')](handleError(_0x5e765d,null));};exports[_0x6f5a('0x84')]=function(_0x2c7892,_0x514164,_0x15ac3c){return db['FaxQueue'][_0x6f5a('0x4c')]({'where':{'id':_0x2c7892[_0x6f5a('0x56')]['id']}})[_0x6f5a('0x28')](handleEntityNotFound(_0x514164,null))[_0x6f5a('0x28')](function(_0x4a6d50){if(_0x4a6d50){return _0x4a6d50[_0x6f5a('0x84')](_0x2c7892[_0x6f5a('0x4e')]['ids'],_[_0x6f5a('0x85')](_0x2c7892['body'],[_0x6f5a('0x71'),'id'])||{})[_0x6f5a('0x86')](function(_0x308241){for(var _0x5b05dc=0x0;_0x5b05dc<_0x2c7892[_0x6f5a('0x4e')]['ids'][_0x6f5a('0x3d')];_0x5b05dc+=0x1){socket[_0x6f5a('0x6f')](_0x6f5a('0x87'),{'UserId':Number(_0x2c7892[_0x6f5a('0x4e')][_0x6f5a('0x71')][_0x5b05dc]),'FaxQueueId':Number(_0x2c7892[_0x6f5a('0x56')]['id'])});}return _0x308241;});}})[_0x6f5a('0x28')](respondWithResult(_0x514164,null))[_0x6f5a('0x49')](handleError(_0x514164,null));};exports[_0x6f5a('0x82')]=function(_0x10d4c3,_0x1c0182,_0x28f8e4){return db['FaxQueue'][_0x6f5a('0x4c')]({'where':{'id':_0x10d4c3[_0x6f5a('0x56')]['id']}})[_0x6f5a('0x28')](handleEntityNotFound(_0x1c0182,null))[_0x6f5a('0x28')](function(_0x44604a){if(_0x44604a){return _0x44604a[_0x6f5a('0x82')](_0x10d4c3['query'][_0x6f5a('0x71')])['then'](function(){if(_['isArray'](_0x10d4c3[_0x6f5a('0x38')][_0x6f5a('0x71')])){for(var _0x2e77b5=0x0;_0x2e77b5<_0x10d4c3[_0x6f5a('0x38')][_0x6f5a('0x71')][_0x6f5a('0x3d')];_0x2e77b5+=0x1){socket[_0x6f5a('0x6f')]('userFaxQueue:remove',{'UserId':Number(_0x10d4c3[_0x6f5a('0x38')][_0x6f5a('0x71')][_0x2e77b5]),'FaxQueueId':Number(_0x10d4c3[_0x6f5a('0x56')]['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x10d4c3[_0x6f5a('0x38')][_0x6f5a('0x71')]),'FaxQueueId':Number(_0x10d4c3[_0x6f5a('0x56')]['id'])});}});}})[_0x6f5a('0x28')](respondWithStatusCode(_0x1c0182,null))[_0x6f5a('0x49')](handleError(_0x1c0182,null));};exports[_0x6f5a('0x88')]=function(_0x7f4456,_0x23b75b,_0x2b3fc3){var _0x45dada={};var _0x45fcf9={};var _0x56e89b;var _0x2744e7;return db[_0x6f5a('0x33')][_0x6f5a('0x89')]({'where':{'id':_0x7f4456['params']['id']}})[_0x6f5a('0x28')](handleEntityNotFound(_0x23b75b,null))['then'](function(_0x3b73e5){if(_0x3b73e5){_0x56e89b=_0x3b73e5;_0x45fcf9[_0x6f5a('0x37')]=_[_0x6f5a('0x4b')](db['User'][_0x6f5a('0x34')]);_0x45fcf9[_0x6f5a('0x38')]=_['keys'](_0x7f4456[_0x6f5a('0x38')]);_0x45fcf9[_0x6f5a('0x39')]=_[_0x6f5a('0x3a')](_0x45fcf9[_0x6f5a('0x37')],_0x45fcf9[_0x6f5a('0x38')]);_0x45dada['attributes']=_[_0x6f5a('0x3a')](_0x45fcf9[_0x6f5a('0x37')],qs[_0x6f5a('0x3c')](_0x7f4456[_0x6f5a('0x38')][_0x6f5a('0x3c')]));_0x45dada[_0x6f5a('0x3b')]=_0x45dada[_0x6f5a('0x3b')][_0x6f5a('0x3d')]?_0x45dada[_0x6f5a('0x3b')]:_0x45fcf9[_0x6f5a('0x37')];_0x45dada[_0x6f5a('0x5b')]=qs[_0x6f5a('0x3e')](_0x7f4456[_0x6f5a('0x38')]['sort']);_0x45dada['where']=qs[_0x6f5a('0x39')](_[_0x6f5a('0x40')](_0x7f4456[_0x6f5a('0x38')],_0x45fcf9['filters']));if(_0x7f4456[_0x6f5a('0x38')][_0x6f5a('0x41')]){_0x45dada['where']=_[_0x6f5a('0x42')](_0x45dada[_0x6f5a('0x3f')],{'$or':_[_0x6f5a('0x32')](_0x45dada[_0x6f5a('0x3b')],function(_0x445d54){var _0x52fde9={};_0x52fde9[_0x445d54]={'$like':'%'+_0x7f4456['query'][_0x6f5a('0x41')]+'%'};return _0x52fde9;})});}_0x45dada=_[_0x6f5a('0x42')]({},_0x45dada,_0x7f4456[_0x6f5a('0x44')]);return _0x56e89b[_0x6f5a('0x88')](_0x45dada);}})['then'](function(_0x210c37){if(_0x210c37){_0x2744e7=_0x210c37['length'];if(!_0x7f4456[_0x6f5a('0x38')]['hasOwnProperty'](_0x6f5a('0x5a'))){_0x45dada['limit']=qs['limit'](_0x7f4456[_0x6f5a('0x38')]['limit']);_0x45dada['offset']=qs[_0x6f5a('0x22')](_0x7f4456[_0x6f5a('0x38')][_0x6f5a('0x22')]);}return _0x56e89b[_0x6f5a('0x88')](_0x45dada);}})['then'](function(_0x40a3d1){if(_0x40a3d1){return _0x40a3d1?{'count':_0x2744e7,'rows':_0x40a3d1}:null;}})[_0x6f5a('0x28')](respondWithResult(_0x23b75b,null))[_0x6f5a('0x49')](handleError(_0x23b75b,null));};
\ No newline at end of file
index 9bc16f1..ef6dc62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d56=['update','remove','emit','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save'];(function(_0x1c8c07,_0x2579af){var _0x4aa88f=function(_0x2ad13d){while(--_0x2ad13d){_0x1c8c07['push'](_0x1c8c07['shift']());}};_0x4aa88f(++_0x2579af);}(_0x6d56,0x11d));var _0x66d5=function(_0x473898,_0x13fe84){_0x473898=_0x473898-0x0;var _0x3d9a17=_0x6d56[_0x473898];return _0x3d9a17;};'use strict';var EventEmitter=require(_0x66d5('0x0'));var FaxQueue=require(_0x66d5('0x1'))['db'][_0x66d5('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x66d5('0x3')](0x0);var events={'afterCreate':_0x66d5('0x4'),'afterUpdate':_0x66d5('0x5'),'afterDestroy':_0x66d5('0x6')};function emitEvent(_0x73e327){return function(_0x50fc0d,_0x59abf9,_0x18b3cc){FaxQueueEvents[_0x66d5('0x7')](_0x73e327+':'+_0x50fc0d['id'],_0x50fc0d);FaxQueueEvents[_0x66d5('0x7')](_0x73e327,_0x50fc0d);_0x18b3cc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x66d5('0x8')](e,emitEvent(event));}}module[_0x66d5('0x9')]=FaxQueueEvents;
\ No newline at end of file
+var _0xab44=['hasOwnProperty','hook','events','save','update','emit'];(function(_0x61a7b2,_0x1ebc7f){var _0xfe0901=function(_0x1e2ea7){while(--_0x1e2ea7){_0x61a7b2['push'](_0x61a7b2['shift']());}};_0xfe0901(++_0x1ebc7f);}(_0xab44,0x1c4));var _0x4ab4=function(_0x164015,_0x3f8448){_0x164015=_0x164015-0x0;var _0x3e71e3=_0xab44[_0x164015];return _0x3e71e3;};'use strict';var EventEmitter=require(_0x4ab4('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4ab4('0x1'),'afterUpdate':_0x4ab4('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2f5c8c){return function(_0xaf5b7a,_0x66354,_0x2181fd){FaxQueueEvents['emit'](_0x2f5c8c+':'+_0xaf5b7a['id'],_0xaf5b7a);FaxQueueEvents[_0x4ab4('0x3')](_0x2f5c8c,_0xaf5b7a);_0x2181fd(null);};}for(var e in events){if(events[_0x4ab4('0x4')](e)){var event=events[e];FaxQueue[_0x4ab4('0x5')](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
index 4ea63cb..77745fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x946f=['./faxQueue.attributes','define','FaxQueue','fax_queues','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x3da707,_0x30c36d){var _0x342ee7=function(_0x175135){while(--_0x175135){_0x3da707['push'](_0x3da707['shift']());}};_0x342ee7(++_0x30c36d);}(_0x946f,0x94));var _0xf946=function(_0x2cc939,_0x2e534c){_0x2cc939=_0x2cc939-0x0;var _0xb3ed89=_0x946f[_0x2cc939];return _0xb3ed89;};'use strict';var _=require('lodash');var util=require(_0xf946('0x0'));var logger=require(_0xf946('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf946('0x2'));var rp=require(_0xf946('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf946('0x4'));var config=require('../../config/environment');var attributes=require(_0xf946('0x5'));module['exports']=function(_0x288b97,_0x36de8c){return _0x288b97[_0xf946('0x6')](_0xf946('0x7'),attributes,{'tableName':_0xf946('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x848c=['./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x3f864b,_0x48572a){var _0x2bdeda=function(_0x5a57e5){while(--_0x5a57e5){_0x3f864b['push'](_0x3f864b['shift']());}};_0x2bdeda(++_0x48572a);}(_0x848c,0x130));var _0xc848=function(_0x474d6d,_0x3ff90d){_0x474d6d=_0x474d6d-0x0;var _0x2b511d=_0x848c[_0x474d6d];return _0x2b511d;};'use strict';var _=require(_0xc848('0x0'));var util=require(_0xc848('0x1'));var logger=require(_0xc848('0x2'))(_0xc848('0x3'));var moment=require('moment');var BPromise=require(_0xc848('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc848('0x5'));var rimraf=require(_0xc848('0x6'));var config=require(_0xc848('0x7'));var attributes=require(_0xc848('0x8'));module[_0xc848('0x9')]=function(_0x590ff2,_0x4db189){return _0x590ff2[_0xc848('0xa')](_0xc848('0xb'),attributes,{'tableName':_0xc848('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5853eb9..65aae32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f09=['request','then','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','FaxQueue,\x20%s,\x20%s','message','info','result','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','limit','map','model','include','find','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost'];(function(_0x3086c6,_0x5b9833){var _0x1b0c99=function(_0x594ff1){while(--_0x594ff1){_0x3086c6['push'](_0x3086c6['shift']());}};_0x1b0c99(++_0x5b9833);}(_0x3f09,0x11b));var _0x93f0=function(_0x2690d4,_0x59ec42){_0x2690d4=_0x2690d4-0x0;var _0x16e7ce=_0x3f09[_0x2690d4];return _0x16e7ce;};'use strict';var _=require(_0x93f0('0x0'));var util=require(_0x93f0('0x1'));var moment=require(_0x93f0('0x2'));var BPromise=require(_0x93f0('0x3'));var rs=require(_0x93f0('0x4'));var fs=require('fs');var Redis=require(_0x93f0('0x5'));var db=require(_0x93f0('0x6'))['db'];var utils=require(_0x93f0('0x7'));var logger=require(_0x93f0('0x8'))('rpc');var config=require(_0x93f0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x93f0('0xa')]['http']({'port':0x232a});config[_0x93f0('0xb')]=_['defaults'](config[_0x93f0('0xb')],{'host':_0x93f0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x93f0('0xb')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2fb87a,_0x52ebc3,_0x4906b5){return new BPromise(function(_0x2f28e3,_0x59f3c3){return client[_0x93f0('0xd')](_0x2fb87a,_0x4906b5)[_0x93f0('0xe')](function(_0x4e5c7f){logger['info']('FaxQueue,\x20%s,\x20%s',_0x52ebc3,_0x93f0('0xf'));logger[_0x93f0('0x10')](_0x93f0('0x11'),_0x52ebc3,_0x93f0('0xf'),JSON[_0x93f0('0x12')](_0x4e5c7f));if(_0x4e5c7f[_0x93f0('0x13')]){if(_0x4e5c7f[_0x93f0('0x13')]['code']===0x1f4){logger[_0x93f0('0x13')](_0x93f0('0x14'),_0x52ebc3,_0x4e5c7f['error']['message']);return _0x59f3c3(_0x4e5c7f[_0x93f0('0x13')][_0x93f0('0x15')]);}logger['error'](_0x93f0('0x14'),_0x52ebc3,_0x4e5c7f['error'][_0x93f0('0x15')]);return _0x2f28e3(_0x4e5c7f[_0x93f0('0x13')][_0x93f0('0x15')]);}else{logger[_0x93f0('0x16')]('FaxQueue,\x20%s,\x20%s',_0x52ebc3,_0x93f0('0xf'));_0x2f28e3(_0x4e5c7f[_0x93f0('0x17')][_0x93f0('0x15')]);}})[_0x93f0('0x18')](function(_0x24b3aa){logger[_0x93f0('0x13')](_0x93f0('0x14'),_0x52ebc3,_0x24b3aa);_0x59f3c3(_0x24b3aa);});});}exports[_0x93f0('0x19')]=function(_0x9a8a0e){var _0x493c9f=this;return new Promise(function(_0x33555e,_0x135aea){return db[_0x93f0('0x1a')]['findAll']({'raw':_0x9a8a0e[_0x93f0('0x1b')]?_0x9a8a0e[_0x93f0('0x1b')][_0x93f0('0x1c')]===undefined?!![]:![]:!![],'where':_0x9a8a0e[_0x93f0('0x1b')]?_0x9a8a0e[_0x93f0('0x1b')][_0x93f0('0x1d')]||null:null,'attributes':_0x9a8a0e[_0x93f0('0x1b')]?_0x9a8a0e[_0x93f0('0x1b')][_0x93f0('0x1e')]||null:null,'limit':_0x9a8a0e[_0x93f0('0x1b')]?_0x9a8a0e[_0x93f0('0x1b')][_0x93f0('0x1f')]||null:null,'include':_0x9a8a0e[_0x93f0('0x1b')]?_0x9a8a0e[_0x93f0('0x1b')]['include']?_[_0x93f0('0x20')](_0x9a8a0e['options']['include'],function(_0x3e18ba){return{'model':db[_0x3e18ba[_0x93f0('0x21')]],'as':_0x3e18ba['as'],'attributes':_0x3e18ba[_0x93f0('0x1e')],'include':_0x3e18ba[_0x93f0('0x22')]?_[_0x93f0('0x20')](_0x3e18ba[_0x93f0('0x22')],function(_0x4fcd64){return{'model':db[_0x4fcd64[_0x93f0('0x21')]],'as':_0x4fcd64['as'],'attributes':_0x4fcd64[_0x93f0('0x1e')],'include':_0x4fcd64[_0x93f0('0x22')]?_[_0x93f0('0x20')](_0x4fcd64[_0x93f0('0x22')],function(_0x2e6033){return{'model':db[_0x2e6033[_0x93f0('0x21')]],'as':_0x2e6033['as'],'attributes':_0x2e6033[_0x93f0('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb801f9){logger[_0x93f0('0x16')](_0x93f0('0x19'),_0x9a8a0e);logger[_0x93f0('0x10')](_0x93f0('0x19'),_0x9a8a0e,JSON['stringify'](_0xb801f9));_0x33555e(_0xb801f9);})['catch'](function(_0x10b533){logger[_0x93f0('0x13')](_0x93f0('0x19'),_0x10b533[_0x93f0('0x15')],_0x9a8a0e);_0x135aea(_0x493c9f[_0x93f0('0x13')](0x1f4,_0x10b533[_0x93f0('0x15')]));});});};exports['ShowFaxQueue']=function(_0x46d9cd){var _0x3b3061=this;return new Promise(function(_0x5648d7,_0x3d8628){return db[_0x93f0('0x1a')][_0x93f0('0x23')]({'raw':_0x46d9cd[_0x93f0('0x1b')]?_0x46d9cd[_0x93f0('0x1b')][_0x93f0('0x1c')]===undefined?!![]:![]:!![],'where':_0x46d9cd['options']?_0x46d9cd[_0x93f0('0x1b')]['where']||null:null,'attributes':_0x46d9cd[_0x93f0('0x1b')]?_0x46d9cd[_0x93f0('0x1b')][_0x93f0('0x1e')]||null:null,'include':_0x46d9cd[_0x93f0('0x1b')]?_0x46d9cd[_0x93f0('0x1b')][_0x93f0('0x22')]?_[_0x93f0('0x20')](_0x46d9cd[_0x93f0('0x1b')][_0x93f0('0x22')],function(_0x2eca38){return{'model':db[_0x2eca38[_0x93f0('0x21')]],'as':_0x2eca38['as'],'attributes':_0x2eca38[_0x93f0('0x1e')],'include':_0x2eca38['include']?_[_0x93f0('0x20')](_0x2eca38[_0x93f0('0x22')],function(_0x30910d){return{'model':db[_0x30910d[_0x93f0('0x21')]],'as':_0x30910d['as'],'attributes':_0x30910d[_0x93f0('0x1e')],'include':_0x30910d[_0x93f0('0x22')]?_[_0x93f0('0x20')](_0x30910d[_0x93f0('0x22')],function(_0x24b81f){return{'model':db[_0x24b81f['model']],'as':_0x24b81f['as'],'attributes':_0x24b81f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x584d73){logger[_0x93f0('0x16')](_0x93f0('0x24'),_0x46d9cd);logger['debug'](_0x93f0('0x24'),_0x46d9cd,JSON[_0x93f0('0x12')](_0x584d73));_0x5648d7(_0x584d73);})['catch'](function(_0x3ba4eb){logger['error']('ShowFaxQueue',_0x3ba4eb['message'],_0x46d9cd);_0x3d8628(_0x3b3061['error'](0x1f4,_0x3ba4eb['message']));});});};
\ No newline at end of file
+var _0x0dea=['then','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','options','raw','where','attributes','limit','include','map','model','info','GetFaxQueue','find','ShowFaxQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./faxQueue.socket','register','request'];(function(_0x34bbd5,_0x3c810a){var _0x46244f=function(_0x5884b9){while(--_0x5884b9){_0x34bbd5['push'](_0x34bbd5['shift']());}};_0x46244f(++_0x3c810a);}(_0x0dea,0xbb));var _0xa0de=function(_0x295771,_0x11e035){_0x295771=_0x295771-0x0;var _0x5130ee=_0x0dea[_0x295771];return _0x5130ee;};'use strict';var _=require(_0xa0de('0x0'));var util=require(_0xa0de('0x1'));var moment=require(_0xa0de('0x2'));var BPromise=require('bluebird');var rs=require(_0xa0de('0x3'));var fs=require('fs');var Redis=require(_0xa0de('0x4'));var db=require(_0xa0de('0x5'))['db'];var utils=require(_0xa0de('0x6'));var logger=require(_0xa0de('0x7'))(_0xa0de('0x8'));var config=require(_0xa0de('0x9'));var jayson=require(_0xa0de('0xa'));var client=jayson[_0xa0de('0xb')][_0xa0de('0xc')]({'port':0x232a});config[_0xa0de('0xd')]=_['defaults'](config[_0xa0de('0xd')],{'host':_0xa0de('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa0de('0xf'))[_0xa0de('0x10')](socket);function respondWithRpcPromise(_0x254286,_0x573f91,_0x2415bd){return new BPromise(function(_0xf08a6e,_0x138d7c){return client[_0xa0de('0x11')](_0x254286,_0x2415bd)[_0xa0de('0x12')](function(_0x312e36){logger['info']('FaxQueue,\x20%s,\x20%s',_0x573f91,_0xa0de('0x13'));logger[_0xa0de('0x14')](_0xa0de('0x15'),_0x573f91,_0xa0de('0x13'),JSON[_0xa0de('0x16')](_0x312e36));if(_0x312e36['error']){if(_0x312e36[_0xa0de('0x17')][_0xa0de('0x18')]===0x1f4){logger[_0xa0de('0x17')](_0xa0de('0x19'),_0x573f91,_0x312e36[_0xa0de('0x17')]['message']);return _0x138d7c(_0x312e36[_0xa0de('0x17')][_0xa0de('0x1a')]);}logger[_0xa0de('0x17')](_0xa0de('0x19'),_0x573f91,_0x312e36[_0xa0de('0x17')]['message']);return _0xf08a6e(_0x312e36[_0xa0de('0x17')][_0xa0de('0x1a')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x573f91,_0xa0de('0x13'));_0xf08a6e(_0x312e36[_0xa0de('0x1b')][_0xa0de('0x1a')]);}})[_0xa0de('0x1c')](function(_0x3cc93c){logger[_0xa0de('0x17')](_0xa0de('0x19'),_0x573f91,_0x3cc93c);_0x138d7c(_0x3cc93c);});});}exports['GetFaxQueue']=function(_0x3db015){var _0x4016ca=this;return new Promise(function(_0x5299c8,_0xb8bfa){return db['FaxQueue']['findAll']({'raw':_0x3db015['options']?_0x3db015[_0xa0de('0x1d')][_0xa0de('0x1e')]===undefined?!![]:![]:!![],'where':_0x3db015[_0xa0de('0x1d')]?_0x3db015[_0xa0de('0x1d')][_0xa0de('0x1f')]||null:null,'attributes':_0x3db015[_0xa0de('0x1d')]?_0x3db015[_0xa0de('0x1d')][_0xa0de('0x20')]||null:null,'limit':_0x3db015[_0xa0de('0x1d')]?_0x3db015['options'][_0xa0de('0x21')]||null:null,'include':_0x3db015[_0xa0de('0x1d')]?_0x3db015[_0xa0de('0x1d')][_0xa0de('0x22')]?_[_0xa0de('0x23')](_0x3db015['options'][_0xa0de('0x22')],function(_0x479f4a){return{'model':db[_0x479f4a[_0xa0de('0x24')]],'as':_0x479f4a['as'],'attributes':_0x479f4a[_0xa0de('0x20')],'include':_0x479f4a[_0xa0de('0x22')]?_['map'](_0x479f4a[_0xa0de('0x22')],function(_0x31cec4){return{'model':db[_0x31cec4['model']],'as':_0x31cec4['as'],'attributes':_0x31cec4[_0xa0de('0x20')],'include':_0x31cec4[_0xa0de('0x22')]?_[_0xa0de('0x23')](_0x31cec4[_0xa0de('0x22')],function(_0xccd80e){return{'model':db[_0xccd80e[_0xa0de('0x24')]],'as':_0xccd80e['as'],'attributes':_0xccd80e[_0xa0de('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa0de('0x12')](function(_0x240713){logger[_0xa0de('0x25')]('GetFaxQueue',_0x3db015);logger[_0xa0de('0x14')]('GetFaxQueue',_0x3db015,JSON[_0xa0de('0x16')](_0x240713));_0x5299c8(_0x240713);})[_0xa0de('0x1c')](function(_0x3f4008){logger['error'](_0xa0de('0x26'),_0x3f4008[_0xa0de('0x1a')],_0x3db015);_0xb8bfa(_0x4016ca['error'](0x1f4,_0x3f4008['message']));});});};exports['ShowFaxQueue']=function(_0x525951){var _0x5730ba=this;return new Promise(function(_0x581dae,_0x50e161){return db['FaxQueue'][_0xa0de('0x27')]({'raw':_0x525951[_0xa0de('0x1d')]?_0x525951[_0xa0de('0x1d')][_0xa0de('0x1e')]===undefined?!![]:![]:!![],'where':_0x525951['options']?_0x525951[_0xa0de('0x1d')][_0xa0de('0x1f')]||null:null,'attributes':_0x525951[_0xa0de('0x1d')]?_0x525951['options'][_0xa0de('0x20')]||null:null,'include':_0x525951[_0xa0de('0x1d')]?_0x525951['options']['include']?_['map'](_0x525951[_0xa0de('0x1d')][_0xa0de('0x22')],function(_0x10db31){return{'model':db[_0x10db31[_0xa0de('0x24')]],'as':_0x10db31['as'],'attributes':_0x10db31[_0xa0de('0x20')],'include':_0x10db31[_0xa0de('0x22')]?_['map'](_0x10db31['include'],function(_0x2117f7){return{'model':db[_0x2117f7['model']],'as':_0x2117f7['as'],'attributes':_0x2117f7['attributes'],'include':_0x2117f7[_0xa0de('0x22')]?_[_0xa0de('0x23')](_0x2117f7[_0xa0de('0x22')],function(_0x16a828){return{'model':db[_0x16a828[_0xa0de('0x24')]],'as':_0x16a828['as'],'attributes':_0x16a828['attributes']};}):[]};}):[]};}):[]:[]})[_0xa0de('0x12')](function(_0x56765f){logger[_0xa0de('0x25')](_0xa0de('0x28'),_0x525951);logger[_0xa0de('0x14')](_0xa0de('0x28'),_0x525951,JSON[_0xa0de('0x16')](_0x56765f));_0x581dae(_0x56765f);})[_0xa0de('0x1c')](function(_0x524a87){logger[_0xa0de('0x17')]('ShowFaxQueue',_0x524a87[_0xa0de('0x1a')],_0x525951);_0x50e161(_0x5730ba['error'](0x1f4,_0x524a87[_0xa0de('0x1a')]));});});};
\ No newline at end of file
index 766983d..6ce21c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd285=['save','remove','emit','removeListener','length','faxQueue:'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd285,0x132));var _0x5d28=function(_0x5179a5,_0x419746){_0x5179a5=_0x5179a5-0x0;var _0x15c8ce=_0xd285[_0x5179a5];return _0x15c8ce;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x5d28('0x0'),_0x5d28('0x1'),'update'];function createListener(_0xfa4cc8,_0x36c25e){return function(_0x1ac5a1){_0x36c25e[_0x5d28('0x2')](_0xfa4cc8,_0x1ac5a1);};}function removeListener(_0x1bfd0e,_0x1c988c){return function(){FaxQueueEvents[_0x5d28('0x3')](_0x1bfd0e,_0x1c988c);};}exports['register']=function(_0x9f67c){for(var _0x1bdfa0=0x0,_0xa79e3=events[_0x5d28('0x4')];_0x1bdfa0<_0xa79e3;_0x1bdfa0++){var _0x1ba71b=events[_0x1bdfa0];var _0x131766=createListener(_0x5d28('0x5')+_0x1ba71b,_0x9f67c);FaxQueueEvents['on'](_0x1ba71b,_0x131766);}};
\ No newline at end of file
+var _0x264f=['faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x264f,0x184));var _0xf264=function(_0x45e992,_0x4431bc){_0x45e992=_0x45e992-0x0;var _0x474fac=_0x264f[_0x45e992];return _0x474fac;};'use strict';var FaxQueueEvents=require(_0xf264('0x0'));var events=[_0xf264('0x1'),_0xf264('0x2'),_0xf264('0x3')];function createListener(_0x8c0b28,_0x6ef358){return function(_0x33c77e){_0x6ef358[_0xf264('0x4')](_0x8c0b28,_0x33c77e);};}function removeListener(_0xf54633,_0x1a8b8a){return function(){FaxQueueEvents[_0xf264('0x5')](_0xf54633,_0x1a8b8a);};}exports[_0xf264('0x6')]=function(_0x1b6f6c){for(var _0x9cabda=0x0,_0x2afeaa=events[_0xf264('0x7')];_0x9cabda<_0x2afeaa;_0x9cabda++){var _0x37e496=events[_0x9cabda];var _0x4533fd=createListener(_0xf264('0x8')+_0x37e496,_0x1b6f6c);FaxQueueEvents['on'](_0x37e496,_0x4533fd);}};
\ No newline at end of file
index 6c50b88..b563836 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8fb=['addTeams','addAgents','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','isAuthenticated','create','/:id/teams'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xd8fb,0x99));var _0xbd8f=function(_0xbbbca0,_0x219e6f){_0xbbbca0=_0xbbbca0-0x0;var _0x45fc29=_0xd8fb[_0xbbbca0];return _0x45fc29;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0x8')]);router['get'](_0xbd8f('0x9'),auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xb')]);router[_0xbd8f('0x7')](_0xbd8f('0xc'),auth['isAuthenticated'](),controller[_0xbd8f('0xd')]);router[_0xbd8f('0x7')]('/:id/teams',auth['isAuthenticated'](),controller[_0xbd8f('0xe')]);router[_0xbd8f('0x7')](_0xbd8f('0xf'),auth['isAuthenticated'](),controller[_0xbd8f('0x10')]);router[_0xbd8f('0x11')]('/',auth[_0xbd8f('0x12')](),controller[_0xbd8f('0x13')]);router[_0xbd8f('0x11')](_0xbd8f('0x14'),auth[_0xbd8f('0x12')](),controller[_0xbd8f('0x15')]);router[_0xbd8f('0x11')]('/:id/users',auth[_0xbd8f('0x12')](),controller[_0xbd8f('0x16')]);router[_0xbd8f('0x17')](_0xbd8f('0x18'),auth['isAuthenticated'](),controller[_0xbd8f('0x19')]);router[_0xbd8f('0x1a')]('/:id',auth[_0xbd8f('0x12')](),controller[_0xbd8f('0x1b')]);router['delete'](_0xbd8f('0x14'),auth[_0xbd8f('0x12')](),controller['removeTeams']);router['delete'](_0xbd8f('0xf'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xbd8f('0x1c')]=router;
\ No newline at end of file
+var _0x1893=['describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','post','create','/:id/teams','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x19c64a,_0x398876){var _0x3762ec=function(_0x4699e6){while(--_0x4699e6){_0x19c64a['push'](_0x19c64a['shift']());}};_0x3762ec(++_0x398876);}(_0x1893,0xa2));var _0x3189=function(_0x35ebae,_0x4f86c4){_0x35ebae=_0x35ebae-0x0;var _0x1924cf=_0x1893[_0x35ebae];return _0x1924cf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3189('0x0'));var timeout=require(_0x3189('0x1'));var express=require(_0x3189('0x2'));var router=express[_0x3189('0x3')]();var fs_extra=require(_0x3189('0x4'));var auth=require(_0x3189('0x5'));var interaction=require(_0x3189('0x6'));var config=require('../../config/environment');var controller=require(_0x3189('0x7'));router[_0x3189('0x8')]('/',auth[_0x3189('0x9')](),controller[_0x3189('0xa')]);router[_0x3189('0x8')](_0x3189('0xb'),auth[_0x3189('0x9')](),controller[_0x3189('0xc')]);router['get'](_0x3189('0xd'),auth['isAuthenticated'](),controller[_0x3189('0xe')]);router['get'](_0x3189('0xf'),auth[_0x3189('0x9')](),controller[_0x3189('0x10')]);router[_0x3189('0x8')]('/:id/teams',auth[_0x3189('0x9')](),controller[_0x3189('0x11')]);router[_0x3189('0x8')](_0x3189('0x12'),auth[_0x3189('0x9')](),controller['getAgents']);router[_0x3189('0x13')]('/',auth[_0x3189('0x9')](),controller[_0x3189('0x14')]);router[_0x3189('0x13')](_0x3189('0x15'),auth[_0x3189('0x9')](),controller[_0x3189('0x16')]);router[_0x3189('0x13')]('/:id/users',auth[_0x3189('0x9')](),controller[_0x3189('0x17')]);router[_0x3189('0x18')](_0x3189('0xd'),auth['isAuthenticated'](),controller[_0x3189('0x19')]);router['delete']('/:id',auth[_0x3189('0x9')](),controller['destroy']);router[_0x3189('0x1a')](_0x3189('0x15'),auth[_0x3189('0x9')](),controller[_0x3189('0x1b')]);router['delete'](_0x3189('0x12'),auth[_0x3189('0x9')](),controller[_0x3189('0x1c')]);module['exports']=router;
\ No newline at end of file
index 9cb68f0..baf9bc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5740=['STRING','DATE','moment','sequelize'];(function(_0x3e3d3d,_0x4f0d79){var _0x1a9a40=function(_0x17fc13){while(--_0x17fc13){_0x3e3d3d['push'](_0x3e3d3d['shift']());}};_0x1a9a40(++_0x4f0d79);}(_0x5740,0x8e));var _0x0574=function(_0x57b7ca,_0x14a349){_0x57b7ca=_0x57b7ca-0x0;var _0x418563=_0x5740[_0x57b7ca];return _0x418563;};'use strict';var moment=require(_0x0574('0x0'));var Sequelize=require(_0x0574('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x0574('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0574('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0574('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xee66=['sequelize','STRING','DATE','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xee66,0xa3));var _0x6ee6=function(_0x3d18af,_0x5b4fa0){_0x3d18af=_0x3d18af-0x0;var _0x2ef919=_0xee66[_0x3d18af];return _0x2ef919;};'use strict';var moment=require(_0x6ee6('0x0'));var Sequelize=require(_0x6ee6('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x6ee6('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6ee6('0x2')]},'joinAt':{'type':Sequelize[_0x6ee6('0x3')]},'leaveAt':{'type':Sequelize[_0x6ee6('0x3')]},'acceptAt':{'type':Sequelize[_0x6ee6('0x3')]},'exitAt':{'type':Sequelize[_0x6ee6('0x3')]},'reason':{'type':Sequelize[_0x6ee6('0x2')]}};
\ No newline at end of file
index 357ae6c..7da622c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44f8=['where','filter','merge','type','VIRTUAL','options','includeAll','catch','show','params','rawAttributes','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','update','then','end','sendStatus','error','stack','name','send','index','FaxQueueReport','fieldName','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort'];(function(_0x1209f5,_0xf6de74){var _0x4c65eb=function(_0x37992e){while(--_0x37992e){_0x1209f5['push'](_0x1209f5['shift']());}};_0x4c65eb(++_0xf6de74);}(_0x44f8,0x1de));var _0x844f=function(_0x3895a6,_0x2717a0){_0x3895a6=_0x3895a6-0x0;var _0x5db0bc=_0x44f8[_0x3895a6];return _0x5db0bc;};'use strict';var emlformat=require(_0x844f('0x0'));var rimraf=require(_0x844f('0x1'));var zipdir=require(_0x844f('0x2'));var jsonpatch=require(_0x844f('0x3'));var rp=require(_0x844f('0x4'));var moment=require(_0x844f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x844f('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x844f('0x7'));var fs=require('fs');var fs_extra=require(_0x844f('0x8'));var _=require(_0x844f('0x9'));var squel=require(_0x844f('0xa'));var crypto=require(_0x844f('0xb'));var jsforce=require(_0x844f('0xc'));var deskjs=require(_0x844f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x844f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x844f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x844f('0x10'));var config=require(_0x844f('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x844f('0x12'))['db'];function respondWithStatusCode(_0x110dc2,_0x2320fc){_0x2320fc=_0x2320fc||0xcc;return function(_0x5ea542){if(_0x5ea542){return _0x110dc2['sendStatus'](_0x2320fc);}return _0x110dc2[_0x844f('0x13')](_0x2320fc)['end']();};}function respondWithResult(_0x3137c1,_0x31a0d9){_0x31a0d9=_0x31a0d9||0xc8;return function(_0x449887){if(_0x449887){return _0x3137c1[_0x844f('0x13')](_0x31a0d9)[_0x844f('0x14')](_0x449887);}};}function respondWithFilteredResult(_0x486fa0,_0x5da4ab){return function(_0x1b04a9){if(_0x1b04a9){var _0x149f21=typeof _0x5da4ab[_0x844f('0x15')]===_0x844f('0x16')&&typeof _0x5da4ab['limit']===_0x844f('0x16');var _0x547881=_0x1b04a9['count'];var _0x1f96d0=_0x149f21?0x0:_0x5da4ab[_0x844f('0x15')];var _0x5cc55c=_0x149f21?_0x1b04a9[_0x844f('0x17')]:_0x5da4ab['offset']+_0x5da4ab['limit'];var _0x31431e;if(_0x5cc55c>=_0x547881){_0x5cc55c=_0x547881;_0x31431e=0xc8;}else{_0x31431e=0xce;}_0x486fa0['status'](_0x31431e);return _0x486fa0[_0x844f('0x18')](_0x844f('0x19'),_0x1f96d0+'-'+_0x5cc55c+'/'+_0x547881)[_0x844f('0x14')](_0x1b04a9);}return null;};}function patchUpdates(_0x38e732){return function(_0x3f5060){try{jsonpatch['apply'](_0x3f5060,_0x38e732,!![]);}catch(_0x270be6){return BPromise['reject'](_0x270be6);}return _0x3f5060['save']();};}function saveUpdates(_0x3f83cd,_0x4261b6){return function(_0x1b2037){if(_0x1b2037){return _0x1b2037[_0x844f('0x1a')](_0x3f83cd)[_0x844f('0x1b')](function(_0x523f49){return _0x523f49;});}return null;};}function removeEntity(_0x189523,_0x4bd66d){return function(_0x22c055){if(_0x22c055){return _0x22c055['destroy']()[_0x844f('0x1b')](function(){_0x189523[_0x844f('0x13')](0xcc)[_0x844f('0x1c')]();});}};}function handleEntityNotFound(_0x7dc0c9,_0x46bf96){return function(_0x1e66c0){if(!_0x1e66c0){_0x7dc0c9[_0x844f('0x1d')](0x194);}return _0x1e66c0;};}function handleError(_0x5c9892,_0xba1365){_0xba1365=_0xba1365||0x1f4;return function(_0x16d7ad){logger[_0x844f('0x1e')](_0x16d7ad[_0x844f('0x1f')]);if(_0x16d7ad[_0x844f('0x20')]){delete _0x16d7ad[_0x844f('0x20')];}_0x5c9892['status'](_0xba1365)[_0x844f('0x21')](_0x16d7ad);};}exports[_0x844f('0x22')]=function(_0x3f62f1,_0x4d3abd){var _0x520102={},_0x1e243c={},_0x444e51={'count':0x0,'rows':[]};var _0x28a4b6=_['map'](db[_0x844f('0x23')]['rawAttributes'],function(_0x2a0dc9){return{'name':_0x2a0dc9[_0x844f('0x24')],'type':_0x2a0dc9['type']['key']};});_0x1e243c[_0x844f('0x25')]=_[_0x844f('0x26')](_0x28a4b6,'name');_0x1e243c['query']=_[_0x844f('0x27')](_0x3f62f1[_0x844f('0x28')]);_0x1e243c[_0x844f('0x29')]=_['intersection'](_0x1e243c[_0x844f('0x25')],_0x1e243c[_0x844f('0x28')]);_0x520102[_0x844f('0x2a')]=_[_0x844f('0x2b')](_0x1e243c['model'],qs[_0x844f('0x2c')](_0x3f62f1[_0x844f('0x28')][_0x844f('0x2c')]));_0x520102[_0x844f('0x2a')]=_0x520102[_0x844f('0x2a')][_0x844f('0x2d')]?_0x520102[_0x844f('0x2a')]:_0x1e243c[_0x844f('0x25')];if(!_0x3f62f1['query'][_0x844f('0x2e')]('nolimit')){_0x520102[_0x844f('0x2f')]=qs[_0x844f('0x2f')](_0x3f62f1[_0x844f('0x28')][_0x844f('0x2f')]);_0x520102['offset']=qs[_0x844f('0x15')](_0x3f62f1[_0x844f('0x28')]['offset']);}_0x520102[_0x844f('0x30')]=qs[_0x844f('0x31')](_0x3f62f1[_0x844f('0x28')][_0x844f('0x31')]);_0x520102[_0x844f('0x32')]=qs[_0x844f('0x29')](_['pick'](_0x3f62f1[_0x844f('0x28')],_0x1e243c['filters']),_0x28a4b6);if(_0x3f62f1['query'][_0x844f('0x33')]){_0x520102['where']=_[_0x844f('0x34')](_0x520102[_0x844f('0x32')],{'$or':_[_0x844f('0x26')](_0x28a4b6,function(_0x3b1e6e){if(_0x3b1e6e[_0x844f('0x35')]!==_0x844f('0x36')){var _0x249b2d={};_0x249b2d[_0x3b1e6e[_0x844f('0x20')]]={'$like':'%'+_0x3f62f1[_0x844f('0x28')][_0x844f('0x33')]+'%'};return _0x249b2d;}})});}_0x520102=_[_0x844f('0x34')]({},_0x520102,_0x3f62f1[_0x844f('0x37')]);var _0x151149={'where':_0x520102[_0x844f('0x32')]};return db[_0x844f('0x23')]['count'](_0x151149)['then'](function(_0x19b516){_0x444e51['count']=_0x19b516;if(_0x3f62f1[_0x844f('0x28')][_0x844f('0x38')]){_0x520102['include']=[{'all':!![]}];}return db[_0x844f('0x23')]['findAll'](_0x520102);})['then'](function(_0x2b3b4d){_0x444e51['rows']=_0x2b3b4d;return _0x444e51;})['then'](respondWithFilteredResult(_0x4d3abd,_0x520102))[_0x844f('0x39')](handleError(_0x4d3abd,null));};exports[_0x844f('0x3a')]=function(_0x17957a,_0x15ef61){var _0x4c5216={'raw':!![],'where':{'id':_0x17957a[_0x844f('0x3b')]['id']}},_0x1df697={};_0x1df697[_0x844f('0x25')]=_[_0x844f('0x27')](db['FaxQueueReport'][_0x844f('0x3c')]);_0x1df697['query']=_['keys'](_0x17957a[_0x844f('0x28')]);_0x1df697[_0x844f('0x29')]=_[_0x844f('0x2b')](_0x1df697[_0x844f('0x25')],_0x1df697[_0x844f('0x28')]);_0x4c5216['attributes']=_[_0x844f('0x2b')](_0x1df697[_0x844f('0x25')],qs['fields'](_0x17957a[_0x844f('0x28')][_0x844f('0x2c')]));_0x4c5216[_0x844f('0x2a')]=_0x4c5216[_0x844f('0x2a')][_0x844f('0x2d')]?_0x4c5216[_0x844f('0x2a')]:_0x1df697[_0x844f('0x25')];if(_0x17957a[_0x844f('0x28')][_0x844f('0x38')]){_0x4c5216[_0x844f('0x3d')]=[{'all':!![]}];}_0x4c5216=_[_0x844f('0x34')]({},_0x4c5216,_0x17957a['options']);return db[_0x844f('0x23')]['find'](_0x4c5216)[_0x844f('0x1b')](handleEntityNotFound(_0x15ef61,null))[_0x844f('0x1b')](respondWithResult(_0x15ef61,null))['catch'](handleError(_0x15ef61,null));};exports[_0x844f('0x3e')]=function(_0x2e0fe3,_0x31a921){return db[_0x844f('0x23')][_0x844f('0x3e')](_0x2e0fe3['body'],{})[_0x844f('0x1b')](respondWithResult(_0x31a921,0xc9))['catch'](handleError(_0x31a921,null));};exports[_0x844f('0x1a')]=function(_0xa8d0cb,_0x2c28d3){if(_0xa8d0cb['body']['id']){delete _0xa8d0cb[_0x844f('0x3f')]['id'];}return db[_0x844f('0x23')][_0x844f('0x40')]({'where':{'id':_0xa8d0cb['params']['id']}})[_0x844f('0x1b')](handleEntityNotFound(_0x2c28d3,null))[_0x844f('0x1b')](saveUpdates(_0xa8d0cb[_0x844f('0x3f')],null))[_0x844f('0x1b')](respondWithResult(_0x2c28d3,null))[_0x844f('0x39')](handleError(_0x2c28d3,null));};exports['destroy']=function(_0x1518d7,_0x168643){return db[_0x844f('0x23')][_0x844f('0x40')]({'where':{'id':_0x1518d7['params']['id']}})[_0x844f('0x1b')](handleEntityNotFound(_0x168643,null))[_0x844f('0x1b')](removeEntity(_0x168643,null))[_0x844f('0x39')](handleError(_0x168643,null));};exports[_0x844f('0x41')]=function(_0x46fab0,_0x25ffa3){return db['FaxQueueReport']['describe']()[_0x844f('0x1b')](respondWithResult(_0x25ffa3,null))[_0x844f('0x39')](handleError(_0x25ffa3,null));};
\ No newline at end of file
+var _0x3667=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','index','map','FaxQueueReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','options','includeAll','findAll','catch','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4d8bf0,_0xdfa6d9){var _0x405703=function(_0xb6fbf7){while(--_0xb6fbf7){_0x4d8bf0['push'](_0x4d8bf0['shift']());}};_0x405703(++_0xdfa6d9);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7366('0x0'));var rimraf=require(_0x7366('0x1'));var zipdir=require(_0x7366('0x2'));var jsonpatch=require(_0x7366('0x3'));var rp=require(_0x7366('0x4'));var moment=require('moment');var BPromise=require(_0x7366('0x5'));var Mustache=require(_0x7366('0x6'));var util=require('util');var path=require(_0x7366('0x7'));var sox=require(_0x7366('0x8'));var csv=require(_0x7366('0x9'));var ejs=require(_0x7366('0xa'));var fs=require('fs');var fs_extra=require(_0x7366('0xb'));var _=require('lodash');var squel=require(_0x7366('0xc'));var crypto=require(_0x7366('0xd'));var jsforce=require(_0x7366('0xe'));var deskjs=require(_0x7366('0xf'));var toCsv=require(_0x7366('0x9'));var querystring=require(_0x7366('0x10'));var Papa=require(_0x7366('0x11'));var Redis=require(_0x7366('0x12'));var authService=require(_0x7366('0x13'));var qs=require(_0x7366('0x14'));var as=require(_0x7366('0x15'));var hardwareService=require(_0x7366('0x16'));var logger=require(_0x7366('0x17'))(_0x7366('0x18'));var utils=require(_0x7366('0x19'));var config=require(_0x7366('0x1a'));var licenseUtil=require(_0x7366('0x1b'));var db=require(_0x7366('0x1c'))['db'];function respondWithStatusCode(_0xd5bac8,_0x3e3a73){_0x3e3a73=_0x3e3a73||0xcc;return function(_0x262659){if(_0x262659){return _0xd5bac8[_0x7366('0x1d')](_0x3e3a73);}return _0xd5bac8[_0x7366('0x1e')](_0x3e3a73)[_0x7366('0x1f')]();};}function respondWithResult(_0x308253,_0x27500c){_0x27500c=_0x27500c||0xc8;return function(_0x22562f){if(_0x22562f){return _0x308253[_0x7366('0x1e')](_0x27500c)['json'](_0x22562f);}};}function respondWithFilteredResult(_0x23e763,_0x308752){return function(_0x338719){if(_0x338719){var _0x2c0422=typeof _0x308752[_0x7366('0x20')]===_0x7366('0x21')&&typeof _0x308752[_0x7366('0x22')]===_0x7366('0x21');var _0x83e5d5=_0x338719[_0x7366('0x23')];var _0x1a71f5=_0x2c0422?0x0:_0x308752['offset'];var _0x208ac8=_0x2c0422?_0x338719['count']:_0x308752[_0x7366('0x20')]+_0x308752[_0x7366('0x22')];var _0x3f23cd;if(_0x208ac8>=_0x83e5d5){_0x208ac8=_0x83e5d5;_0x3f23cd=0xc8;}else{_0x3f23cd=0xce;}_0x23e763['status'](_0x3f23cd);return _0x23e763[_0x7366('0x24')](_0x7366('0x25'),_0x1a71f5+'-'+_0x208ac8+'/'+_0x83e5d5)[_0x7366('0x26')](_0x338719);}return null;};}function patchUpdates(_0x532ce2){return function(_0x16e038){try{jsonpatch[_0x7366('0x27')](_0x16e038,_0x532ce2,!![]);}catch(_0x482946){return BPromise[_0x7366('0x28')](_0x482946);}return _0x16e038[_0x7366('0x29')]();};}function saveUpdates(_0xaab659,_0x1a12d2){return function(_0x3c30a2){if(_0x3c30a2){return _0x3c30a2[_0x7366('0x2a')](_0xaab659)[_0x7366('0x2b')](function(_0x22ed7e){return _0x22ed7e;});}return null;};}function removeEntity(_0x2095a1,_0x301220){return function(_0x12aed6){if(_0x12aed6){return _0x12aed6[_0x7366('0x2c')]()[_0x7366('0x2b')](function(){_0x2095a1['status'](0xcc)[_0x7366('0x1f')]();});}};}function handleEntityNotFound(_0x4fe7cf,_0x379146){return function(_0x4ab987){if(!_0x4ab987){_0x4fe7cf['sendStatus'](0x194);}return _0x4ab987;};}function handleError(_0x383055,_0x4d4cb5){_0x4d4cb5=_0x4d4cb5||0x1f4;return function(_0x254374){logger['error'](_0x254374[_0x7366('0x2d')]);if(_0x254374[_0x7366('0x2e')]){delete _0x254374['name'];}_0x383055[_0x7366('0x1e')](_0x4d4cb5)['send'](_0x254374);};}exports[_0x7366('0x2f')]=function(_0x2b61af,_0x4a4e67){var _0x3cef4a={},_0x507baf={},_0xc58ac7={'count':0x0,'rows':[]};var _0x46f80f=_[_0x7366('0x30')](db[_0x7366('0x31')][_0x7366('0x32')],function(_0x5e075c){return{'name':_0x5e075c[_0x7366('0x33')],'type':_0x5e075c[_0x7366('0x34')]['key']};});_0x507baf['model']=_['map'](_0x46f80f,'name');_0x507baf[_0x7366('0x35')]=_[_0x7366('0x36')](_0x2b61af[_0x7366('0x35')]);_0x507baf[_0x7366('0x37')]=_['intersection'](_0x507baf[_0x7366('0x38')],_0x507baf[_0x7366('0x35')]);_0x3cef4a[_0x7366('0x39')]=_[_0x7366('0x3a')](_0x507baf['model'],qs[_0x7366('0x3b')](_0x2b61af[_0x7366('0x35')]['fields']));_0x3cef4a[_0x7366('0x39')]=_0x3cef4a[_0x7366('0x39')][_0x7366('0x3c')]?_0x3cef4a[_0x7366('0x39')]:_0x507baf[_0x7366('0x38')];if(!_0x2b61af[_0x7366('0x35')][_0x7366('0x3d')](_0x7366('0x3e'))){_0x3cef4a[_0x7366('0x22')]=qs['limit'](_0x2b61af[_0x7366('0x35')][_0x7366('0x22')]);_0x3cef4a['offset']=qs[_0x7366('0x20')](_0x2b61af[_0x7366('0x35')][_0x7366('0x20')]);}_0x3cef4a['order']=qs[_0x7366('0x3f')](_0x2b61af['query'][_0x7366('0x3f')]);_0x3cef4a['where']=qs['filters'](_[_0x7366('0x40')](_0x2b61af['query'],_0x507baf[_0x7366('0x37')]),_0x46f80f);if(_0x2b61af[_0x7366('0x35')]['filter']){_0x3cef4a[_0x7366('0x41')]=_['merge'](_0x3cef4a[_0x7366('0x41')],{'$or':_[_0x7366('0x30')](_0x46f80f,function(_0x5e58c5){if(_0x5e58c5[_0x7366('0x34')]!=='VIRTUAL'){var _0x8ed827={};_0x8ed827[_0x5e58c5[_0x7366('0x2e')]]={'$like':'%'+_0x2b61af[_0x7366('0x35')]['filter']+'%'};return _0x8ed827;}})});}_0x3cef4a=_[_0x7366('0x42')]({},_0x3cef4a,_0x2b61af[_0x7366('0x43')]);var _0x14ec01={'where':_0x3cef4a[_0x7366('0x41')]};return db[_0x7366('0x31')][_0x7366('0x23')](_0x14ec01)[_0x7366('0x2b')](function(_0x4d45dd){_0xc58ac7['count']=_0x4d45dd;if(_0x2b61af[_0x7366('0x35')][_0x7366('0x44')]){_0x3cef4a['include']=[{'all':!![]}];}return db[_0x7366('0x31')][_0x7366('0x45')](_0x3cef4a);})['then'](function(_0x432f79){_0xc58ac7['rows']=_0x432f79;return _0xc58ac7;})[_0x7366('0x2b')](respondWithFilteredResult(_0x4a4e67,_0x3cef4a))[_0x7366('0x46')](handleError(_0x4a4e67,null));};exports['show']=function(_0x5b5a95,_0x3bc879){var _0xedc3c7={'raw':!![],'where':{'id':_0x5b5a95[_0x7366('0x47')]['id']}},_0x2ac2e6={};_0x2ac2e6['model']=_[_0x7366('0x36')](db[_0x7366('0x31')][_0x7366('0x32')]);_0x2ac2e6[_0x7366('0x35')]=_[_0x7366('0x36')](_0x5b5a95[_0x7366('0x35')]);_0x2ac2e6[_0x7366('0x37')]=_['intersection'](_0x2ac2e6[_0x7366('0x38')],_0x2ac2e6[_0x7366('0x35')]);_0xedc3c7[_0x7366('0x39')]=_['intersection'](_0x2ac2e6[_0x7366('0x38')],qs[_0x7366('0x3b')](_0x5b5a95['query'][_0x7366('0x3b')]));_0xedc3c7[_0x7366('0x39')]=_0xedc3c7[_0x7366('0x39')]['length']?_0xedc3c7[_0x7366('0x39')]:_0x2ac2e6[_0x7366('0x38')];if(_0x5b5a95[_0x7366('0x35')]['includeAll']){_0xedc3c7[_0x7366('0x48')]=[{'all':!![]}];}_0xedc3c7=_[_0x7366('0x42')]({},_0xedc3c7,_0x5b5a95[_0x7366('0x43')]);return db['FaxQueueReport'][_0x7366('0x49')](_0xedc3c7)[_0x7366('0x2b')](handleEntityNotFound(_0x3bc879,null))[_0x7366('0x2b')](respondWithResult(_0x3bc879,null))[_0x7366('0x46')](handleError(_0x3bc879,null));};exports['create']=function(_0x3725aa,_0x2d1c52){return db[_0x7366('0x31')][_0x7366('0x4a')](_0x3725aa[_0x7366('0x4b')],{})[_0x7366('0x2b')](respondWithResult(_0x2d1c52,0xc9))[_0x7366('0x46')](handleError(_0x2d1c52,null));};exports[_0x7366('0x2a')]=function(_0x2ad8bf,_0x59f078){if(_0x2ad8bf[_0x7366('0x4b')]['id']){delete _0x2ad8bf[_0x7366('0x4b')]['id'];}return db['FaxQueueReport'][_0x7366('0x49')]({'where':{'id':_0x2ad8bf[_0x7366('0x47')]['id']}})['then'](handleEntityNotFound(_0x59f078,null))[_0x7366('0x2b')](saveUpdates(_0x2ad8bf['body'],null))[_0x7366('0x2b')](respondWithResult(_0x59f078,null))[_0x7366('0x46')](handleError(_0x59f078,null));};exports[_0x7366('0x2c')]=function(_0x22026a,_0x588b31){return db[_0x7366('0x31')][_0x7366('0x49')]({'where':{'id':_0x22026a[_0x7366('0x47')]['id']}})[_0x7366('0x2b')](handleEntityNotFound(_0x588b31,null))[_0x7366('0x2b')](removeEntity(_0x588b31,null))[_0x7366('0x46')](handleError(_0x588b31,null));};exports[_0x7366('0x4c')]=function(_0x3faff8,_0x30a533){return db[_0x7366('0x31')][_0x7366('0x4c')]()[_0x7366('0x2b')](respondWithResult(_0x30a533,null))['catch'](handleError(_0x30a533,null));};
\ No newline at end of file
index c0161a5..a19d164 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4a4d2b,_0x19f4e8){_0x4a4d2b=_0x4a4d2b-0x0;var _0x1566af=_0x1cb9[_0x4a4d2b];return _0x1566af;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x5d4eb3,_0x2311ad){var _0xfd2513=function(_0x1aae2e){while(--_0x1aae2e){_0x5d4eb3['push'](_0x5d4eb3['shift']());}};_0xfd2513(++_0x2311ad);}(_0xabce,0x103));var _0xeabc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xabce[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index ea86cee..007d029 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dda=['catch','update','options','where','attributes','then','UpdateFaxQueueReport','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateFaxQueueReport','FaxQueueReport','create','body','raw'];(function(_0xf1d8aa,_0x4fc760){var _0x192093=function(_0x1d95ce){while(--_0x1d95ce){_0xf1d8aa['push'](_0xf1d8aa['shift']());}};_0x192093(++_0x4fc760);}(_0x8dda,0x188));var _0xa8dd=function(_0x483295,_0x59f963){_0x483295=_0x483295-0x0;var _0x399ec2=_0x8dda[_0x483295];return _0x399ec2;};'use strict';var _=require(_0xa8dd('0x0'));var util=require(_0xa8dd('0x1'));var moment=require('moment');var BPromise=require(_0xa8dd('0x2'));var rs=require(_0xa8dd('0x3'));var fs=require('fs');var Redis=require(_0xa8dd('0x4'));var db=require(_0xa8dd('0x5'))['db'];var utils=require(_0xa8dd('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa8dd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa8dd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b5d1e,_0x313478,_0x3179a2){return new BPromise(function(_0x3c4124,_0x1d54c5){return client[_0xa8dd('0x9')](_0x4b5d1e,_0x3179a2)['then'](function(_0x3c0f29){logger[_0xa8dd('0xa')](_0xa8dd('0xb'),_0x313478,_0xa8dd('0xc'));logger[_0xa8dd('0xd')](_0xa8dd('0xe'),_0x313478,'request\x20sent',JSON['stringify'](_0x3c0f29));if(_0x3c0f29[_0xa8dd('0xf')]){if(_0x3c0f29[_0xa8dd('0xf')][_0xa8dd('0x10')]===0x1f4){logger['error'](_0xa8dd('0xb'),_0x313478,_0x3c0f29[_0xa8dd('0xf')][_0xa8dd('0x11')]);return _0x1d54c5(_0x3c0f29['error'][_0xa8dd('0x11')]);}logger[_0xa8dd('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x313478,_0x3c0f29[_0xa8dd('0xf')]['message']);return _0x3c4124(_0x3c0f29['error'][_0xa8dd('0x11')]);}else{logger[_0xa8dd('0xa')](_0xa8dd('0xb'),_0x313478,'request\x20sent');_0x3c4124(_0x3c0f29[_0xa8dd('0x12')][_0xa8dd('0x11')]);}})['catch'](function(_0x440e9d){logger[_0xa8dd('0xf')](_0xa8dd('0xb'),_0x313478,_0x440e9d);_0x1d54c5(_0x440e9d);});});}exports[_0xa8dd('0x13')]=function(_0x4f3c1f){var _0x46f340=this;return new Promise(function(_0x1f743b,_0x3ac7d8){return db[_0xa8dd('0x14')][_0xa8dd('0x15')](_0x4f3c1f[_0xa8dd('0x16')],{'raw':_0x4f3c1f['options']?_0x4f3c1f['options'][_0xa8dd('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x5c754c){logger[_0xa8dd('0xa')](_0xa8dd('0x13'),_0x4f3c1f);logger[_0xa8dd('0xd')]('CreateFaxQueueReport',_0x4f3c1f,JSON['stringify'](_0x5c754c));_0x1f743b(_0x5c754c);})[_0xa8dd('0x18')](function(_0x42809f){logger[_0xa8dd('0xf')]('CreateFaxQueueReport',_0x42809f[_0xa8dd('0x11')],_0x4f3c1f);_0x3ac7d8(_0x46f340[_0xa8dd('0xf')](0x1f4,_0x42809f[_0xa8dd('0x11')]));});});};exports['UpdateFaxQueueReport']=function(_0x100129){var _0x71005e=this;return new Promise(function(_0xfc1390,_0x3165c4){return db['FaxQueueReport'][_0xa8dd('0x19')](_0x100129[_0xa8dd('0x16')],{'raw':_0x100129[_0xa8dd('0x1a')]?_0x100129['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x100129[_0xa8dd('0x1a')]?_0x100129[_0xa8dd('0x1a')][_0xa8dd('0x1b')]||null:null,'attributes':_0x100129[_0xa8dd('0x1a')]?_0x100129[_0xa8dd('0x1a')][_0xa8dd('0x1c')]||null:null,'limit':_0x100129['options']?_0x100129[_0xa8dd('0x1a')]['limit']||null:null})[_0xa8dd('0x1d')](function(_0x401118){logger[_0xa8dd('0xa')]('UpdateFaxQueueReport',_0x100129);logger[_0xa8dd('0xd')](_0xa8dd('0x1e'),_0x100129,JSON[_0xa8dd('0x1f')](_0x401118));_0xfc1390(_0x401118);})[_0xa8dd('0x18')](function(_0x434bcc){logger['error'](_0xa8dd('0x1e'),_0x434bcc[_0xa8dd('0x11')],_0x100129);_0x3165c4(_0x71005e[_0xa8dd('0xf')](0x1f4,_0x434bcc[_0xa8dd('0x11')]));});});};
\ No newline at end of file
+var _0x4136=['UpdateFaxQueueReport','FaxQueueReport','update','where','limit','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','CreateFaxQueueReport','create','body','options','raw','stringify'];(function(_0x2f8245,_0x586e38){var _0x1c6c8a=function(_0x1f768c){while(--_0x1f768c){_0x2f8245['push'](_0x2f8245['shift']());}};_0x1c6c8a(++_0x586e38);}(_0x4136,0x161));var _0x6413=function(_0x4e6463,_0x2a67a9){_0x4e6463=_0x4e6463-0x0;var _0x5e645a=_0x4136[_0x4e6463];return _0x5e645a;};'use strict';var _=require('lodash');var util=require(_0x6413('0x0'));var moment=require('moment');var BPromise=require(_0x6413('0x1'));var rs=require(_0x6413('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6413('0x3'));var logger=require(_0x6413('0x4'))(_0x6413('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6413('0x6')][_0x6413('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x462c7e,_0x62d00,_0x43d115){return new BPromise(function(_0x557e2f,_0x5803d7){return client[_0x6413('0x8')](_0x462c7e,_0x43d115)[_0x6413('0x9')](function(_0x3308a7){logger[_0x6413('0xa')](_0x6413('0xb'),_0x62d00,'request\x20sent');logger[_0x6413('0xc')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x62d00,_0x6413('0xd'),JSON['stringify'](_0x3308a7));if(_0x3308a7['error']){if(_0x3308a7[_0x6413('0xe')][_0x6413('0xf')]===0x1f4){logger[_0x6413('0xe')](_0x6413('0xb'),_0x62d00,_0x3308a7[_0x6413('0xe')][_0x6413('0x10')]);return _0x5803d7(_0x3308a7[_0x6413('0xe')][_0x6413('0x10')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x62d00,_0x3308a7[_0x6413('0xe')][_0x6413('0x10')]);return _0x557e2f(_0x3308a7[_0x6413('0xe')][_0x6413('0x10')]);}else{logger[_0x6413('0xa')](_0x6413('0xb'),_0x62d00,_0x6413('0xd'));_0x557e2f(_0x3308a7['result']['message']);}})[_0x6413('0x11')](function(_0x1b5b56){logger[_0x6413('0xe')](_0x6413('0xb'),_0x62d00,_0x1b5b56);_0x5803d7(_0x1b5b56);});});}exports[_0x6413('0x12')]=function(_0x249367){var _0x1d44ab=this;return new Promise(function(_0x84d396,_0x3144fd){return db['FaxQueueReport'][_0x6413('0x13')](_0x249367[_0x6413('0x14')],{'raw':_0x249367['options']?_0x249367[_0x6413('0x15')][_0x6413('0x16')]===undefined?!![]:![]:!![]})[_0x6413('0x9')](function(_0x753755){logger['info'](_0x6413('0x12'),_0x249367);logger['debug']('CreateFaxQueueReport',_0x249367,JSON[_0x6413('0x17')](_0x753755));_0x84d396(_0x753755);})[_0x6413('0x11')](function(_0x10279d){logger['error']('CreateFaxQueueReport',_0x10279d['message'],_0x249367);_0x3144fd(_0x1d44ab['error'](0x1f4,_0x10279d[_0x6413('0x10')]));});});};exports[_0x6413('0x18')]=function(_0x5e5f0e){var _0x9ce232=this;return new Promise(function(_0x7beb80,_0x494786){return db[_0x6413('0x19')][_0x6413('0x1a')](_0x5e5f0e[_0x6413('0x14')],{'raw':_0x5e5f0e[_0x6413('0x15')]?_0x5e5f0e[_0x6413('0x15')][_0x6413('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e5f0e[_0x6413('0x15')]?_0x5e5f0e[_0x6413('0x15')][_0x6413('0x1b')]||null:null,'attributes':_0x5e5f0e['options']?_0x5e5f0e[_0x6413('0x15')]['attributes']||null:null,'limit':_0x5e5f0e[_0x6413('0x15')]?_0x5e5f0e[_0x6413('0x15')][_0x6413('0x1c')]||null:null})[_0x6413('0x9')](function(_0x5a1238){logger[_0x6413('0xa')](_0x6413('0x18'),_0x5e5f0e);logger['debug'](_0x6413('0x18'),_0x5e5f0e,JSON[_0x6413('0x17')](_0x5a1238));_0x7beb80(_0x5a1238);})[_0x6413('0x11')](function(_0x2e0f0f){logger[_0x6413('0xe')](_0x6413('0x18'),_0x2e0f0f['message'],_0x5e5f0e);_0x494786(_0x9ce232[_0x6413('0xe')](0x1f4,_0x2e0f0f[_0x6413('0x10')]));});});};
\ No newline at end of file
index 0471a1b..fde5437 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58ad=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete','destroy','exports','util','path'];(function(_0x181959,_0x307fbe){var _0x477fa9=function(_0x24167d){while(--_0x24167d){_0x181959['push'](_0x181959['shift']());}};_0x477fa9(++_0x307fbe);}(_0x58ad,0x139));var _0xd58a=function(_0x231a96,_0x1b8d47){_0x231a96=_0x231a96-0x0;var _0x52b387=_0x58ad[_0x231a96];return _0x52b387;};'use strict';var multer=require('multer');var util=require(_0xd58a('0x0'));var path=require(_0xd58a('0x1'));var timeout=require('connect-timeout');var express=require(_0xd58a('0x2'));var router=express[_0xd58a('0x3')]();var fs_extra=require(_0xd58a('0x4'));var auth=require(_0xd58a('0x5'));var interaction=require(_0xd58a('0x6'));var config=require(_0xd58a('0x7'));var controller=require(_0xd58a('0x8'));router[_0xd58a('0x9')]('/',auth[_0xd58a('0xa')](),controller[_0xd58a('0xb')]);router[_0xd58a('0x9')](_0xd58a('0xc'),auth[_0xd58a('0xa')](),controller['describe']);router[_0xd58a('0x9')](_0xd58a('0xd'),auth['isAuthenticated'](),controller[_0xd58a('0xe')]);router[_0xd58a('0xf')]('/',auth[_0xd58a('0xa')](),controller[_0xd58a('0x10')]);router['put'](_0xd58a('0xd'),auth[_0xd58a('0xa')](),controller[_0xd58a('0x11')]);router[_0xd58a('0x12')](_0xd58a('0xd'),auth[_0xd58a('0xa')](),controller[_0xd58a('0x13')]);module[_0xd58a('0x14')]=router;
\ No newline at end of file
+var _0xcdb7=['./faxQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','update','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1d45af,_0x1299fe){var _0x329afc=function(_0x296a79){while(--_0x296a79){_0x1d45af['push'](_0x1d45af['shift']());}};_0x329afc(++_0x1299fe);}(_0xcdb7,0x161));var _0x7cdb=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xcdb7[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x7cdb('0x0'));var path=require(_0x7cdb('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7cdb('0x2')]();var fs_extra=require(_0x7cdb('0x3'));var auth=require(_0x7cdb('0x4'));var interaction=require(_0x7cdb('0x5'));var config=require(_0x7cdb('0x6'));var controller=require(_0x7cdb('0x7'));router[_0x7cdb('0x8')]('/',auth[_0x7cdb('0x9')](),controller[_0x7cdb('0xa')]);router[_0x7cdb('0x8')]('/describe',auth[_0x7cdb('0x9')](),controller[_0x7cdb('0xb')]);router[_0x7cdb('0x8')](_0x7cdb('0xc'),auth[_0x7cdb('0x9')](),controller[_0x7cdb('0xd')]);router[_0x7cdb('0xe')]('/',auth[_0x7cdb('0x9')](),controller[_0x7cdb('0xf')]);router['put'](_0x7cdb('0xc'),auth[_0x7cdb('0x9')](),controller[_0x7cdb('0x10')]);router['delete'](_0x7cdb('0xc'),auth[_0x7cdb('0x9')](),controller['destroy']);module[_0x7cdb('0x11')]=router;
\ No newline at end of file
index 8d0ac3a..694f755 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x503d19,_0xf21fc2){var _0xae9f5e=function(_0x478950){while(--_0x478950){_0x503d19['push'](_0x503d19['shift']());}};_0xae9f5e(++_0xf21fc2);}(_0x70e0,0x17b));var _0x070e=function(_0x2de258,_0x331534){_0x2de258=_0x2de258-0x0;var _0x5f13b2=_0x70e0[_0x2de258];return _0x5f13b2;};'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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x563a0a,_0x4b27fc){var _0x3dfc91=function(_0x2599f9){while(--_0x2599f9){_0x563a0a['push'](_0x563a0a['shift']());}};_0x3dfc91(++_0x4b27fc);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4ed1d4,_0x512d9a){_0x4ed1d4=_0x4ed1d4-0x0;var _0x28e363=_0xf3cd[_0x4ed1d4];return _0x28e363;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
index e912e29..a0660ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x822f=['create','body','catch','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','order','sort','where','filters','filter','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','merge'];(function(_0x47f7ec,_0x369f9d){var _0x415101=function(_0x41317a){while(--_0x41317a){_0x47f7ec['push'](_0x47f7ec['shift']());}};_0x415101(++_0x369f9d);}(_0x822f,0xd9));var _0xf822=function(_0x5d7aed,_0x4bc67d){_0x5d7aed=_0x5d7aed-0x0;var _0x3f9a54=_0x822f[_0x5d7aed];return _0x3f9a54;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf822('0x0'));var zipdir=require(_0xf822('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf822('0x2'));var moment=require(_0xf822('0x3'));var BPromise=require(_0xf822('0x4'));var Mustache=require(_0xf822('0x5'));var util=require(_0xf822('0x6'));var path=require(_0xf822('0x7'));var sox=require(_0xf822('0x8'));var csv=require(_0xf822('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf822('0xa'));var _=require(_0xf822('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf822('0xc'));var deskjs=require(_0xf822('0xd'));var toCsv=require(_0xf822('0x9'));var querystring=require(_0xf822('0xe'));var Papa=require(_0xf822('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf822('0x10'));var as=require(_0xf822('0x11'));var hardwareService=require(_0xf822('0x12'));var logger=require(_0xf822('0x13'))(_0xf822('0x14'));var utils=require(_0xf822('0x15'));var config=require(_0xf822('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1aaf21,_0xc6aad1){_0xc6aad1=_0xc6aad1||0xcc;return function(_0x463c84){if(_0x463c84){return _0x1aaf21[_0xf822('0x17')](_0xc6aad1);}return _0x1aaf21[_0xf822('0x18')](_0xc6aad1)[_0xf822('0x19')]();};}function respondWithResult(_0x1f8c91,_0x4267bf){_0x4267bf=_0x4267bf||0xc8;return function(_0x4e9325){if(_0x4e9325){return _0x1f8c91[_0xf822('0x18')](_0x4267bf)[_0xf822('0x1a')](_0x4e9325);}};}function respondWithFilteredResult(_0x25c7f9,_0x49b795){return function(_0x21b691){if(_0x21b691){var _0x5cfed6=typeof _0x49b795[_0xf822('0x1b')]===_0xf822('0x1c')&&typeof _0x49b795[_0xf822('0x1d')]===_0xf822('0x1c');var _0x1e2019=_0x21b691['count'];var _0x57d00d=_0x5cfed6?0x0:_0x49b795[_0xf822('0x1b')];var _0x1406ad=_0x5cfed6?_0x21b691[_0xf822('0x1e')]:_0x49b795[_0xf822('0x1b')]+_0x49b795[_0xf822('0x1d')];var _0x482c6c;if(_0x1406ad>=_0x1e2019){_0x1406ad=_0x1e2019;_0x482c6c=0xc8;}else{_0x482c6c=0xce;}_0x25c7f9[_0xf822('0x18')](_0x482c6c);return _0x25c7f9[_0xf822('0x1f')](_0xf822('0x20'),_0x57d00d+'-'+_0x1406ad+'/'+_0x1e2019)[_0xf822('0x1a')](_0x21b691);}return null;};}function patchUpdates(_0xa456e6){return function(_0x2bf949){try{jsonpatch['apply'](_0x2bf949,_0xa456e6,!![]);}catch(_0x4a0537){return BPromise[_0xf822('0x21')](_0x4a0537);}return _0x2bf949[_0xf822('0x22')]();};}function saveUpdates(_0x25bb9e,_0x54f8ed){return function(_0x292414){if(_0x292414){return _0x292414[_0xf822('0x23')](_0x25bb9e)['then'](function(_0x25e133){return _0x25e133;});}return null;};}function removeEntity(_0x13ed0d,_0x595246){return function(_0x4716d9){if(_0x4716d9){return _0x4716d9[_0xf822('0x24')]()[_0xf822('0x25')](function(){_0x13ed0d['status'](0xcc)[_0xf822('0x19')]();});}};}function handleEntityNotFound(_0x3b4f46,_0x17afb1){return function(_0x2a44b3){if(!_0x2a44b3){_0x3b4f46[_0xf822('0x17')](0x194);}return _0x2a44b3;};}function handleError(_0x32e81d,_0x390f32){_0x390f32=_0x390f32||0x1f4;return function(_0x2755e1){logger[_0xf822('0x26')](_0x2755e1['stack']);if(_0x2755e1['name']){delete _0x2755e1[_0xf822('0x27')];}_0x32e81d[_0xf822('0x18')](_0x390f32)[_0xf822('0x28')](_0x2755e1);};}exports[_0xf822('0x29')]=function(_0x156acd,_0x514113){var _0x12c1d2={},_0x289312={},_0x5e231f={'count':0x0,'rows':[]};var _0x4f97d7=_[_0xf822('0x2a')](db[_0xf822('0x2b')][_0xf822('0x2c')],function(_0x8b5ee6){return{'name':_0x8b5ee6[_0xf822('0x2d')],'type':_0x8b5ee6[_0xf822('0x2e')]['key']};});_0x289312[_0xf822('0x2f')]=_[_0xf822('0x2a')](_0x4f97d7,_0xf822('0x27'));_0x289312[_0xf822('0x30')]=_['keys'](_0x156acd[_0xf822('0x30')]);_0x289312['filters']=_[_0xf822('0x31')](_0x289312['model'],_0x289312[_0xf822('0x30')]);_0x12c1d2['attributes']=_['intersection'](_0x289312[_0xf822('0x2f')],qs[_0xf822('0x32')](_0x156acd[_0xf822('0x30')][_0xf822('0x32')]));_0x12c1d2[_0xf822('0x33')]=_0x12c1d2['attributes'][_0xf822('0x34')]?_0x12c1d2[_0xf822('0x33')]:_0x289312[_0xf822('0x2f')];if(!_0x156acd['query']['hasOwnProperty']('nolimit')){_0x12c1d2['limit']=qs[_0xf822('0x1d')](_0x156acd[_0xf822('0x30')][_0xf822('0x1d')]);_0x12c1d2[_0xf822('0x1b')]=qs['offset'](_0x156acd[_0xf822('0x30')][_0xf822('0x1b')]);}_0x12c1d2[_0xf822('0x35')]=qs[_0xf822('0x36')](_0x156acd[_0xf822('0x30')]['sort']);_0x12c1d2[_0xf822('0x37')]=qs[_0xf822('0x38')](_['pick'](_0x156acd['query'],_0x289312[_0xf822('0x38')]),_0x4f97d7);if(_0x156acd[_0xf822('0x30')][_0xf822('0x39')]){_0x12c1d2['where']=_['merge'](_0x12c1d2[_0xf822('0x37')],{'$or':_[_0xf822('0x2a')](_0x4f97d7,function(_0x4862d1){if(_0x4862d1['type']!==_0xf822('0x3a')){var _0x5f1d9a={};_0x5f1d9a[_0x4862d1['name']]={'$like':'%'+_0x156acd[_0xf822('0x30')]['filter']+'%'};return _0x5f1d9a;}})});}_0x12c1d2=_['merge']({},_0x12c1d2,_0x156acd[_0xf822('0x3b')]);var _0x5062d6={'where':_0x12c1d2[_0xf822('0x37')]};return db[_0xf822('0x2b')][_0xf822('0x1e')](_0x5062d6)['then'](function(_0x1bb3a9){_0x5e231f[_0xf822('0x1e')]=_0x1bb3a9;if(_0x156acd['query'][_0xf822('0x3c')]){_0x12c1d2[_0xf822('0x3d')]=[{'all':!![]}];}return db[_0xf822('0x2b')][_0xf822('0x3e')](_0x12c1d2);})[_0xf822('0x25')](function(_0x1d3ace){_0x5e231f[_0xf822('0x3f')]=_0x1d3ace;return _0x5e231f;})[_0xf822('0x25')](respondWithFilteredResult(_0x514113,_0x12c1d2))['catch'](handleError(_0x514113,null));};exports['show']=function(_0x7952f6,_0x32c1c5){var _0x45245f={'raw':!![],'where':{'id':_0x7952f6[_0xf822('0x40')]['id']}},_0x4dbd05={};_0x4dbd05[_0xf822('0x2f')]=_[_0xf822('0x41')](db[_0xf822('0x2b')][_0xf822('0x2c')]);_0x4dbd05[_0xf822('0x30')]=_[_0xf822('0x41')](_0x7952f6['query']);_0x4dbd05[_0xf822('0x38')]=_[_0xf822('0x31')](_0x4dbd05[_0xf822('0x2f')],_0x4dbd05[_0xf822('0x30')]);_0x45245f[_0xf822('0x33')]=_[_0xf822('0x31')](_0x4dbd05[_0xf822('0x2f')],qs[_0xf822('0x32')](_0x7952f6[_0xf822('0x30')][_0xf822('0x32')]));_0x45245f[_0xf822('0x33')]=_0x45245f[_0xf822('0x33')][_0xf822('0x34')]?_0x45245f[_0xf822('0x33')]:_0x4dbd05[_0xf822('0x2f')];if(_0x7952f6['query'][_0xf822('0x3c')]){_0x45245f['include']=[{'all':!![]}];}_0x45245f=_[_0xf822('0x42')]({},_0x45245f,_0x7952f6[_0xf822('0x3b')]);return db['FaxTransferReport']['find'](_0x45245f)[_0xf822('0x25')](handleEntityNotFound(_0x32c1c5,null))[_0xf822('0x25')](respondWithResult(_0x32c1c5,null))['catch'](handleError(_0x32c1c5,null));};exports['create']=function(_0x1ff7da,_0x447a03){return db['FaxTransferReport'][_0xf822('0x43')](_0x1ff7da[_0xf822('0x44')],{})['then'](respondWithResult(_0x447a03,0xc9))[_0xf822('0x45')](handleError(_0x447a03,null));};exports[_0xf822('0x23')]=function(_0x5c48af,_0x5f51e4){if(_0x5c48af['body']['id']){delete _0x5c48af[_0xf822('0x44')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x5c48af[_0xf822('0x40')]['id']}})[_0xf822('0x25')](handleEntityNotFound(_0x5f51e4,null))[_0xf822('0x25')](saveUpdates(_0x5c48af[_0xf822('0x44')],null))[_0xf822('0x25')](respondWithResult(_0x5f51e4,null))['catch'](handleError(_0x5f51e4,null));};exports[_0xf822('0x24')]=function(_0x61bdfa,_0x6cdf0e){return db[_0xf822('0x2b')]['find']({'where':{'id':_0x61bdfa[_0xf822('0x40')]['id']}})[_0xf822('0x25')](handleEntityNotFound(_0x6cdf0e,null))[_0xf822('0x25')](removeEntity(_0x6cdf0e,null))[_0xf822('0x45')](handleError(_0x6cdf0e,null));};exports['describe']=function(_0x31e08d,_0x3013ad){return db[_0xf822('0x2b')][_0xf822('0x46')]()['then'](respondWithResult(_0x3013ad,null))[_0xf822('0x45')](handleError(_0x3013ad,null));};
\ No newline at end of file
+var _0x6be3=['stack','name','send','index','map','FaxTransferReport','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','options','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error'];(function(_0x3ce945,_0x849fa2){var _0x53222d=function(_0x4af739){while(--_0x4af739){_0x3ce945['push'](_0x3ce945['shift']());}};_0x53222d(++_0x849fa2);}(_0x6be3,0x76));var _0x36be=function(_0x1eb786,_0x1b5f72){_0x1eb786=_0x1eb786-0x0;var _0x460cad=_0x6be3[_0x1eb786];return _0x460cad;};'use strict';var emlformat=require(_0x36be('0x0'));var rimraf=require(_0x36be('0x1'));var zipdir=require(_0x36be('0x2'));var jsonpatch=require(_0x36be('0x3'));var rp=require(_0x36be('0x4'));var moment=require(_0x36be('0x5'));var BPromise=require(_0x36be('0x6'));var Mustache=require(_0x36be('0x7'));var util=require(_0x36be('0x8'));var path=require(_0x36be('0x9'));var sox=require(_0x36be('0xa'));var csv=require('to-csv');var ejs=require(_0x36be('0xb'));var fs=require('fs');var fs_extra=require(_0x36be('0xc'));var _=require(_0x36be('0xd'));var squel=require('squel');var crypto=require(_0x36be('0xe'));var jsforce=require(_0x36be('0xf'));var deskjs=require(_0x36be('0x10'));var toCsv=require(_0x36be('0x11'));var querystring=require(_0x36be('0x12'));var Papa=require(_0x36be('0x13'));var Redis=require(_0x36be('0x14'));var authService=require(_0x36be('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x36be('0x16'));var hardwareService=require(_0x36be('0x17'));var logger=require(_0x36be('0x18'))(_0x36be('0x19'));var utils=require('../../config/utils');var config=require(_0x36be('0x1a'));var licenseUtil=require(_0x36be('0x1b'));var db=require(_0x36be('0x1c'))['db'];function respondWithStatusCode(_0x3fb70d,_0x238d73){_0x238d73=_0x238d73||0xcc;return function(_0x144c8c){if(_0x144c8c){return _0x3fb70d['sendStatus'](_0x238d73);}return _0x3fb70d[_0x36be('0x1d')](_0x238d73)['end']();};}function respondWithResult(_0xb480c9,_0x1c9430){_0x1c9430=_0x1c9430||0xc8;return function(_0x27bf4b){if(_0x27bf4b){return _0xb480c9[_0x36be('0x1d')](_0x1c9430)[_0x36be('0x1e')](_0x27bf4b);}};}function respondWithFilteredResult(_0x14b822,_0x244fc5){return function(_0x399163){if(_0x399163){var _0x3aa67d=typeof _0x244fc5[_0x36be('0x1f')]===_0x36be('0x20')&&typeof _0x244fc5[_0x36be('0x21')]===_0x36be('0x20');var _0x35a802=_0x399163[_0x36be('0x22')];var _0x1ea931=_0x3aa67d?0x0:_0x244fc5[_0x36be('0x1f')];var _0x3297ec=_0x3aa67d?_0x399163[_0x36be('0x22')]:_0x244fc5[_0x36be('0x1f')]+_0x244fc5['limit'];var _0x4e64dd;if(_0x3297ec>=_0x35a802){_0x3297ec=_0x35a802;_0x4e64dd=0xc8;}else{_0x4e64dd=0xce;}_0x14b822[_0x36be('0x1d')](_0x4e64dd);return _0x14b822[_0x36be('0x23')](_0x36be('0x24'),_0x1ea931+'-'+_0x3297ec+'/'+_0x35a802)[_0x36be('0x1e')](_0x399163);}return null;};}function patchUpdates(_0x3f1903){return function(_0x52be3a){try{jsonpatch[_0x36be('0x25')](_0x52be3a,_0x3f1903,!![]);}catch(_0x44784b){return BPromise[_0x36be('0x26')](_0x44784b);}return _0x52be3a[_0x36be('0x27')]();};}function saveUpdates(_0x1832ad,_0x31fa89){return function(_0x26a46b){if(_0x26a46b){return _0x26a46b[_0x36be('0x28')](_0x1832ad)[_0x36be('0x29')](function(_0x45c4b9){return _0x45c4b9;});}return null;};}function removeEntity(_0x3bef0b,_0x29b385){return function(_0x308b3f){if(_0x308b3f){return _0x308b3f['destroy']()[_0x36be('0x29')](function(){_0x3bef0b[_0x36be('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b0585,_0x48d20d){return function(_0x514d2d){if(!_0x514d2d){_0x9b0585[_0x36be('0x2a')](0x194);}return _0x514d2d;};}function handleError(_0x22f8c4,_0x2315e2){_0x2315e2=_0x2315e2||0x1f4;return function(_0x3ad362){logger[_0x36be('0x2b')](_0x3ad362[_0x36be('0x2c')]);if(_0x3ad362['name']){delete _0x3ad362[_0x36be('0x2d')];}_0x22f8c4['status'](_0x2315e2)[_0x36be('0x2e')](_0x3ad362);};}exports[_0x36be('0x2f')]=function(_0x5ebbf2,_0x53f28c){var _0xe7a524={},_0x5a1b59={},_0x59e2c9={'count':0x0,'rows':[]};var _0x258d37=_[_0x36be('0x30')](db[_0x36be('0x31')]['rawAttributes'],function(_0x580aea){return{'name':_0x580aea[_0x36be('0x32')],'type':_0x580aea[_0x36be('0x33')][_0x36be('0x34')]};});_0x5a1b59['model']=_['map'](_0x258d37,_0x36be('0x2d'));_0x5a1b59['query']=_[_0x36be('0x35')](_0x5ebbf2[_0x36be('0x36')]);_0x5a1b59[_0x36be('0x37')]=_[_0x36be('0x38')](_0x5a1b59[_0x36be('0x39')],_0x5a1b59[_0x36be('0x36')]);_0xe7a524['attributes']=_['intersection'](_0x5a1b59[_0x36be('0x39')],qs[_0x36be('0x3a')](_0x5ebbf2[_0x36be('0x36')][_0x36be('0x3a')]));_0xe7a524[_0x36be('0x3b')]=_0xe7a524['attributes'][_0x36be('0x3c')]?_0xe7a524[_0x36be('0x3b')]:_0x5a1b59[_0x36be('0x39')];if(!_0x5ebbf2['query']['hasOwnProperty'](_0x36be('0x3d'))){_0xe7a524[_0x36be('0x21')]=qs['limit'](_0x5ebbf2['query'][_0x36be('0x21')]);_0xe7a524['offset']=qs[_0x36be('0x1f')](_0x5ebbf2[_0x36be('0x36')][_0x36be('0x1f')]);}_0xe7a524[_0x36be('0x3e')]=qs[_0x36be('0x3f')](_0x5ebbf2[_0x36be('0x36')]['sort']);_0xe7a524[_0x36be('0x40')]=qs[_0x36be('0x37')](_[_0x36be('0x41')](_0x5ebbf2['query'],_0x5a1b59[_0x36be('0x37')]),_0x258d37);if(_0x5ebbf2[_0x36be('0x36')][_0x36be('0x42')]){_0xe7a524[_0x36be('0x40')]=_[_0x36be('0x43')](_0xe7a524[_0x36be('0x40')],{'$or':_[_0x36be('0x30')](_0x258d37,function(_0x30b390){if(_0x30b390[_0x36be('0x33')]!==_0x36be('0x44')){var _0x582e4f={};_0x582e4f[_0x30b390['name']]={'$like':'%'+_0x5ebbf2[_0x36be('0x36')]['filter']+'%'};return _0x582e4f;}})});}_0xe7a524=_[_0x36be('0x43')]({},_0xe7a524,_0x5ebbf2['options']);var _0x3c66fe={'where':_0xe7a524[_0x36be('0x40')]};return db[_0x36be('0x31')]['count'](_0x3c66fe)[_0x36be('0x29')](function(_0x406cca){_0x59e2c9[_0x36be('0x22')]=_0x406cca;if(_0x5ebbf2[_0x36be('0x36')][_0x36be('0x45')]){_0xe7a524[_0x36be('0x46')]=[{'all':!![]}];}return db[_0x36be('0x31')][_0x36be('0x47')](_0xe7a524);})['then'](function(_0x3f13e7){_0x59e2c9['rows']=_0x3f13e7;return _0x59e2c9;})[_0x36be('0x29')](respondWithFilteredResult(_0x53f28c,_0xe7a524))['catch'](handleError(_0x53f28c,null));};exports[_0x36be('0x48')]=function(_0x2e1a53,_0x24f116){var _0x57796c={'raw':!![],'where':{'id':_0x2e1a53[_0x36be('0x49')]['id']}},_0x143be7={};_0x143be7['model']=_[_0x36be('0x35')](db[_0x36be('0x31')]['rawAttributes']);_0x143be7[_0x36be('0x36')]=_['keys'](_0x2e1a53[_0x36be('0x36')]);_0x143be7['filters']=_[_0x36be('0x38')](_0x143be7[_0x36be('0x39')],_0x143be7[_0x36be('0x36')]);_0x57796c[_0x36be('0x3b')]=_[_0x36be('0x38')](_0x143be7[_0x36be('0x39')],qs[_0x36be('0x3a')](_0x2e1a53[_0x36be('0x36')][_0x36be('0x3a')]));_0x57796c[_0x36be('0x3b')]=_0x57796c['attributes']['length']?_0x57796c[_0x36be('0x3b')]:_0x143be7[_0x36be('0x39')];if(_0x2e1a53[_0x36be('0x36')][_0x36be('0x45')]){_0x57796c[_0x36be('0x46')]=[{'all':!![]}];}_0x57796c=_[_0x36be('0x43')]({},_0x57796c,_0x2e1a53[_0x36be('0x4a')]);return db[_0x36be('0x31')][_0x36be('0x4b')](_0x57796c)[_0x36be('0x29')](handleEntityNotFound(_0x24f116,null))[_0x36be('0x29')](respondWithResult(_0x24f116,null))[_0x36be('0x4c')](handleError(_0x24f116,null));};exports['create']=function(_0x599b4c,_0x23ffe7){return db[_0x36be('0x31')][_0x36be('0x4d')](_0x599b4c[_0x36be('0x4e')],{})[_0x36be('0x29')](respondWithResult(_0x23ffe7,0xc9))[_0x36be('0x4c')](handleError(_0x23ffe7,null));};exports[_0x36be('0x28')]=function(_0x326eea,_0x294b7d){if(_0x326eea['body']['id']){delete _0x326eea['body']['id'];}return db[_0x36be('0x31')][_0x36be('0x4b')]({'where':{'id':_0x326eea['params']['id']}})[_0x36be('0x29')](handleEntityNotFound(_0x294b7d,null))['then'](saveUpdates(_0x326eea[_0x36be('0x4e')],null))[_0x36be('0x29')](respondWithResult(_0x294b7d,null))[_0x36be('0x4c')](handleError(_0x294b7d,null));};exports[_0x36be('0x4f')]=function(_0x14fc7e,_0x2a2826){return db[_0x36be('0x31')][_0x36be('0x4b')]({'where':{'id':_0x14fc7e[_0x36be('0x49')]['id']}})['then'](handleEntityNotFound(_0x2a2826,null))['then'](removeEntity(_0x2a2826,null))[_0x36be('0x4c')](handleError(_0x2a2826,null));};exports[_0x36be('0x50')]=function(_0x54486f,_0x1d8fb7){return db[_0x36be('0x31')][_0x36be('0x50')]()['then'](respondWithResult(_0x1d8fb7,null))[_0x36be('0x4c')](handleError(_0x1d8fb7,null));};
\ No newline at end of file
index 7e6a142..fe4fd47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21c9=['define','FaxTransferReport','report_fax_transfer','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','exports'];(function(_0xc141c4,_0x2f6dc7){var _0x2817d5=function(_0x271810){while(--_0x271810){_0xc141c4['push'](_0xc141c4['shift']());}};_0x2817d5(++_0x2f6dc7);}(_0x21c9,0xea));var _0x921c=function(_0x134706,_0x953c4f){_0x134706=_0x134706-0x0;var _0x20ee8a=_0x21c9[_0x134706];return _0x20ee8a;};'use strict';var _=require(_0x921c('0x0'));var util=require(_0x921c('0x1'));var logger=require(_0x921c('0x2'))(_0x921c('0x3'));var moment=require('moment');var BPromise=require(_0x921c('0x4'));var rp=require(_0x921c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x921c('0x6'));var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module[_0x921c('0x7')]=function(_0xf27a50,_0xbd5685){return _0xf27a50[_0x921c('0x8')](_0x921c('0x9'),attributes,{'tableName':_0x921c('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0362=['uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0362,0x15d));var _0x2036=function(_0x2fafa8,_0x74b04c){_0x2fafa8=_0x2fafa8-0x0;var _0x214532=_0x0362[_0x2fafa8];return _0x214532;};'use strict';var _=require(_0x2036('0x0'));var util=require('util');var logger=require(_0x2036('0x1'))('api');var moment=require(_0x2036('0x2'));var BPromise=require(_0x2036('0x3'));var rp=require(_0x2036('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2036('0x5'));var config=require(_0x2036('0x6'));var attributes=require(_0x2036('0x7'));module[_0x2036('0x8')]=function(_0x102ef5,_0x4f0552){return _0x102ef5[_0x2036('0x9')](_0x2036('0xa'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2036('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 8f5fb88..b2f14b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb764=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x49b3ad,_0xdbf073){var _0x5c7bef=function(_0x2d49c7){while(--_0x2d49c7){_0x49b3ad['push'](_0x49b3ad['shift']());}};_0x5c7bef(++_0xdbf073);}(_0xb764,0xa2));var _0x4b76=function(_0x42f3df,_0x40277b){_0x42f3df=_0x42f3df-0x0;var _0x1f724d=_0xb764[_0x42f3df];return _0x1f724d;};'use strict';var _=require(_0x4b76('0x0'));var util=require(_0x4b76('0x1'));var moment=require(_0x4b76('0x2'));var BPromise=require(_0x4b76('0x3'));var rs=require(_0x4b76('0x4'));var fs=require('fs');var Redis=require(_0x4b76('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4b76('0x6'));var logger=require(_0x4b76('0x7'))(_0x4b76('0x8'));var config=require(_0x4b76('0x9'));var jayson=require(_0x4b76('0xa'));var client=jayson[_0x4b76('0xb')][_0x4b76('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x8cf4e,_0x32183b,_0x10129a){return new BPromise(function(_0x6094ed,_0x1d07c7){return client[_0x4b76('0xd')](_0x8cf4e,_0x10129a)[_0x4b76('0xe')](function(_0x45ab56){logger[_0x4b76('0xf')](_0x4b76('0x10'),_0x32183b,_0x4b76('0x11'));logger[_0x4b76('0x12')](_0x4b76('0x13'),_0x32183b,'request\x20sent',JSON['stringify'](_0x45ab56));if(_0x45ab56['error']){if(_0x45ab56[_0x4b76('0x14')][_0x4b76('0x15')]===0x1f4){logger['error'](_0x4b76('0x10'),_0x32183b,_0x45ab56[_0x4b76('0x14')][_0x4b76('0x16')]);return _0x1d07c7(_0x45ab56[_0x4b76('0x14')][_0x4b76('0x16')]);}logger[_0x4b76('0x14')](_0x4b76('0x10'),_0x32183b,_0x45ab56[_0x4b76('0x14')][_0x4b76('0x16')]);return _0x6094ed(_0x45ab56['error'][_0x4b76('0x16')]);}else{logger[_0x4b76('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x32183b,'request\x20sent');_0x6094ed(_0x45ab56['result']['message']);}})[_0x4b76('0x17')](function(_0x507677){logger[_0x4b76('0x14')](_0x4b76('0x10'),_0x32183b,_0x507677);_0x1d07c7(_0x507677);});});}
\ No newline at end of file
+var _0xdd4b=['catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x588d29,_0x31383c){var _0x337c7b=function(_0x2b157c){while(--_0x2b157c){_0x588d29['push'](_0x588d29['shift']());}};_0x337c7b(++_0x31383c);}(_0xdd4b,0x109));var _0xbdd4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xdd4b[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xbdd4('0x0'));var util=require(_0xbdd4('0x1'));var moment=require(_0xbdd4('0x2'));var BPromise=require(_0xbdd4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbdd4('0x4'));var logger=require(_0xbdd4('0x5'))('rpc');var config=require(_0xbdd4('0x6'));var jayson=require(_0xbdd4('0x7'));var client=jayson[_0xbdd4('0x8')][_0xbdd4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1099c7,_0x79d0aa,_0x10915e){return new BPromise(function(_0x59e165,_0x234c4c){return client['request'](_0x1099c7,_0x10915e)[_0xbdd4('0xa')](function(_0x5ca8ef){logger['info'](_0xbdd4('0xb'),_0x79d0aa,_0xbdd4('0xc'));logger[_0xbdd4('0xd')](_0xbdd4('0xe'),_0x79d0aa,'request\x20sent',JSON[_0xbdd4('0xf')](_0x5ca8ef));if(_0x5ca8ef[_0xbdd4('0x10')]){if(_0x5ca8ef[_0xbdd4('0x10')][_0xbdd4('0x11')]===0x1f4){logger[_0xbdd4('0x10')](_0xbdd4('0xb'),_0x79d0aa,_0x5ca8ef['error']['message']);return _0x234c4c(_0x5ca8ef[_0xbdd4('0x10')][_0xbdd4('0x12')]);}logger[_0xbdd4('0x10')](_0xbdd4('0xb'),_0x79d0aa,_0x5ca8ef[_0xbdd4('0x10')][_0xbdd4('0x12')]);return _0x59e165(_0x5ca8ef[_0xbdd4('0x10')][_0xbdd4('0x12')]);}else{logger[_0xbdd4('0x13')](_0xbdd4('0xb'),_0x79d0aa,_0xbdd4('0xc'));_0x59e165(_0x5ca8ef[_0xbdd4('0x14')][_0xbdd4('0x12')]);}})[_0xbdd4('0x15')](function(_0x2987f1){logger[_0xbdd4('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x79d0aa,_0x2987f1);_0x234c4c(_0x2987f1);});});}
\ No newline at end of file
index db44e4e..82fbe7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97f1=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','update','delete','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x3343e2,_0x36ded0){var _0x4d82ca=function(_0x37123c){while(--_0x37123c){_0x3343e2['push'](_0x3343e2['shift']());}};_0x4d82ca(++_0x36ded0);}(_0x97f1,0x93));var _0x197f=function(_0x34bd61,_0x50216c){_0x34bd61=_0x34bd61-0x0;var _0x5c7dc8=_0x97f1[_0x34bd61];return _0x5c7dc8;};'use strict';var multer=require('multer');var util=require(_0x197f('0x0'));var path=require(_0x197f('0x1'));var timeout=require(_0x197f('0x2'));var express=require('express');var router=express[_0x197f('0x3')]();var fs_extra=require(_0x197f('0x4'));var auth=require(_0x197f('0x5'));var interaction=require(_0x197f('0x6'));var config=require(_0x197f('0x7'));var controller=require(_0x197f('0x8'));router[_0x197f('0x9')]('/',auth[_0x197f('0xa')](),controller[_0x197f('0xb')]);router[_0x197f('0x9')](_0x197f('0xc'),auth[_0x197f('0xa')](),controller['describe']);router[_0x197f('0x9')](_0x197f('0xd'),auth[_0x197f('0xa')](),controller['show']);router[_0x197f('0xe')]('/',auth[_0x197f('0xa')](),controller[_0x197f('0xf')]);router['put'](_0x197f('0xd'),auth[_0x197f('0xa')](),controller[_0x197f('0x10')]);router[_0x197f('0x11')](_0x197f('0xd'),auth[_0x197f('0xa')](),controller['destroy']);module[_0x197f('0x12')]=router;
\ No newline at end of file
+var _0x811f=['get','isAuthenticated','index','/describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxTransferReport.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x811f,0x182));var _0xf811=function(_0x2652ef,_0x234230){_0x2652ef=_0x2652ef-0x0;var _0x2db578=_0x811f[_0x2652ef];return _0x2db578;};'use strict';var multer=require(_0xf811('0x0'));var util=require(_0xf811('0x1'));var path=require(_0xf811('0x2'));var timeout=require(_0xf811('0x3'));var express=require(_0xf811('0x4'));var router=express[_0xf811('0x5')]();var fs_extra=require(_0xf811('0x6'));var auth=require(_0xf811('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf811('0x8'));var controller=require(_0xf811('0x9'));router[_0xf811('0xa')]('/',auth[_0xf811('0xb')](),controller[_0xf811('0xc')]);router[_0xf811('0xa')](_0xf811('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xf811('0xa')](_0xf811('0xe'),auth[_0xf811('0xb')](),controller['show']);router[_0xf811('0xf')]('/',auth[_0xf811('0xb')](),controller[_0xf811('0x10')]);router[_0xf811('0x11')](_0xf811('0xe'),auth['isAuthenticated'](),controller[_0xf811('0x12')]);router[_0xf811('0x13')](_0xf811('0xe'),auth[_0xf811('0xb')](),controller[_0xf811('0x14')]);module[_0xf811('0x15')]=router;
\ No newline at end of file
index 55454ea..87984ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6ff=['addConfiguration','put','update','destroy','exports','multer','path','express','Router','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','getFields','post','create','/:id/configurations'];(function(_0x31fe79,_0x366ddd){var _0x589948=function(_0x2477fa){while(--_0x2477fa){_0x31fe79['push'](_0x31fe79['shift']());}};_0x589948(++_0x366ddd);}(_0xa6ff,0xfc));var _0xfa6f=function(_0x4423a6,_0x3539c5){_0x4423a6=_0x4423a6-0x0;var _0x45adf4=_0xa6ff[_0x4423a6];return _0x45adf4;};'use strict';var multer=require(_0xfa6f('0x0'));var util=require('util');var path=require(_0xfa6f('0x1'));var timeout=require('connect-timeout');var express=require(_0xfa6f('0x2'));var router=express[_0xfa6f('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfa6f('0x4'));var controller=require(_0xfa6f('0x5'));router[_0xfa6f('0x6')]('/',auth[_0xfa6f('0x7')](),controller[_0xfa6f('0x8')]);router[_0xfa6f('0x6')](_0xfa6f('0x9'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/configurations',auth[_0xfa6f('0x7')](),controller['getConfigurations']);router[_0xfa6f('0x6')]('/:id/fields',auth['isAuthenticated'](),controller[_0xfa6f('0xa')]);router[_0xfa6f('0xb')]('/',auth[_0xfa6f('0x7')](),controller[_0xfa6f('0xc')]);router['post'](_0xfa6f('0xd'),auth[_0xfa6f('0x7')](),controller[_0xfa6f('0xe')]);router[_0xfa6f('0xf')](_0xfa6f('0x9'),auth[_0xfa6f('0x7')](),controller[_0xfa6f('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xfa6f('0x11')]);module[_0xfa6f('0x12')]=router;
\ No newline at end of file
+var _0xd728=['/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','get','show','/:id/fields','getFields','post','create'];(function(_0x4d0387,_0x43837a){var _0x352f36=function(_0x421c88){while(--_0x421c88){_0x4d0387['push'](_0x4d0387['shift']());}};_0x352f36(++_0x43837a);}(_0xd728,0x16c));var _0x8d72=function(_0x49c6a0,_0x50298d){_0x49c6a0=_0x49c6a0-0x0;var _0x1ea826=_0xd728[_0x49c6a0];return _0x1ea826;};'use strict';var multer=require('multer');var util=require(_0x8d72('0x0'));var path=require(_0x8d72('0x1'));var timeout=require(_0x8d72('0x2'));var express=require(_0x8d72('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8d72('0x4'));var config=require(_0x8d72('0x5'));var controller=require(_0x8d72('0x6'));router['get']('/',auth[_0x8d72('0x7')](),controller['index']);router[_0x8d72('0x8')]('/:id',auth[_0x8d72('0x7')](),controller[_0x8d72('0x9')]);router[_0x8d72('0x8')]('/:id/configurations',auth[_0x8d72('0x7')](),controller['getConfigurations']);router[_0x8d72('0x8')](_0x8d72('0xa'),auth[_0x8d72('0x7')](),controller[_0x8d72('0xb')]);router[_0x8d72('0xc')]('/',auth[_0x8d72('0x7')](),controller[_0x8d72('0xd')]);router[_0x8d72('0xc')](_0x8d72('0xe'),auth[_0x8d72('0x7')](),controller[_0x8d72('0xf')]);router[_0x8d72('0x10')]('/:id',auth[_0x8d72('0x7')](),controller[_0x8d72('0x11')]);router[_0x8d72('0x12')]('/:id',auth[_0x8d72('0x7')](),controller[_0x8d72('0x13')]);module[_0x8d72('0x14')]=router;
\ No newline at end of file
index 86f4aca..1b78ef3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc188=['exports','STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x1b4ef0,_0x412484){var _0x45bd51=function(_0x831f31){while(--_0x831f31){_0x1b4ef0['push'](_0x1b4ef0['shift']());}};_0x45bd51(++_0x412484);}(_0xc188,0x76));var _0x8c18=function(_0x400ad4,_0x25ab92){_0x400ad4=_0x400ad4-0x0;var _0x48f28c=_0xc188[_0x400ad4];return _0x48f28c;};'use strict';var Sequelize=require(_0x8c18('0x0'));module[_0x8c18('0x1')]={'name':{'type':Sequelize[_0x8c18('0x2')]},'description':{'type':Sequelize[_0x8c18('0x2')]},'username':{'type':Sequelize[_0x8c18('0x2')]},'remoteUri':{'type':Sequelize[_0x8c18('0x2')]},'authType':{'type':Sequelize[_0x8c18('0x3')](_0x8c18('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x8c18('0x2')]},'consumerKey':{'type':Sequelize[_0x8c18('0x2')]},'consumerSecret':{'type':Sequelize[_0x8c18('0x2')]},'token':{'type':Sequelize[_0x8c18('0x2')]},'tokenSecret':{'type':Sequelize[_0x8c18('0x2')]},'serverUrl':{'type':Sequelize[_0x8c18('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8c18('0x5'),_0x8c18('0x6')),'defaultValue':_0x8c18('0x5')}};
\ No newline at end of file
+var _0xa142=['STRING','ENUM','basic','integrationTab','sequelize'];(function(_0x2450c2,_0x4e1e60){var _0x2a143b=function(_0x14bb3f){while(--_0x14bb3f){_0x2450c2['push'](_0x2450c2['shift']());}};_0x2a143b(++_0x4e1e60);}(_0xa142,0xf9));var _0x2a14=function(_0x132659,_0x486e0c){_0x132659=_0x132659-0x0;var _0x215fc3=_0xa142[_0x132659];return _0x215fc3;};'use strict';var Sequelize=require(_0x2a14('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2a14('0x1')]},'username':{'type':Sequelize[_0x2a14('0x1')]},'remoteUri':{'type':Sequelize[_0x2a14('0x1')]},'authType':{'type':Sequelize[_0x2a14('0x2')](_0x2a14('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x2a14('0x1')]},'consumerKey':{'type':Sequelize[_0x2a14('0x1')]},'consumerSecret':{'type':Sequelize[_0x2a14('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x2a14('0x1')]},'serverUrl':{'type':Sequelize[_0x2a14('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x2a14('0x2')]('integrationTab','newTab'),'defaultValue':_0x2a14('0x4')}};
\ No newline at end of file
index 0e0d6a5..14cecd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadaf=['end','json','limit','undefined','count','offset','set','apply','reject','update','then','destroy','error','stack','name','index','map','DeskAccount','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','catch','length','find','create','body','params','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','toString','concat','_embedded','active','label','statusCode','send','test','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','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'];(function(_0x1f1c17,_0x4ed89e){var _0x59109b=function(_0x43142d){while(--_0x43142d){_0x1f1c17['push'](_0x1f1c17['shift']());}};_0x59109b(++_0x4ed89e);}(_0xadaf,0x1a3));var _0xfada=function(_0xb47fce,_0x4abd1d){_0xb47fce=_0xb47fce-0x0;var _0x2f07d0=_0xadaf[_0xb47fce];return _0x2f07d0;};'use strict';var emlformat=require(_0xfada('0x0'));var rimraf=require(_0xfada('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfada('0x2'));var rp=require(_0xfada('0x3'));var moment=require(_0xfada('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfada('0x5'));var path=require(_0xfada('0x6'));var sox=require(_0xfada('0x7'));var csv=require('to-csv');var ejs=require(_0xfada('0x8'));var fs=require('fs');var fs_extra=require(_0xfada('0x9'));var _=require(_0xfada('0xa'));var squel=require(_0xfada('0xb'));var crypto=require(_0xfada('0xc'));var jsforce=require(_0xfada('0xd'));var deskjs=require(_0xfada('0xe'));var toCsv=require('to-csv');var querystring=require(_0xfada('0xf'));var Papa=require(_0xfada('0x10'));var Redis=require(_0xfada('0x11'));var authService=require(_0xfada('0x12'));var qs=require(_0xfada('0x13'));var as=require(_0xfada('0x14'));var hardwareService=require(_0xfada('0x15'));var logger=require(_0xfada('0x16'))(_0xfada('0x17'));var utils=require(_0xfada('0x18'));var config=require(_0xfada('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xfada('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5cbc7b,_0x50165c){_0x50165c=_0x50165c||0xcc;return function(_0x3ef907){if(_0x3ef907){return _0x5cbc7b[_0xfada('0x1b')](_0x50165c);}return _0x5cbc7b[_0xfada('0x1c')](_0x50165c)[_0xfada('0x1d')]();};}function respondWithResult(_0x45f1e1,_0x2035ab){_0x2035ab=_0x2035ab||0xc8;return function(_0x554d3a){if(_0x554d3a){return _0x45f1e1[_0xfada('0x1c')](_0x2035ab)[_0xfada('0x1e')](_0x554d3a);}};}function respondWithFilteredResult(_0x13634c,_0xa4a059){return function(_0x2aa2c0){if(_0x2aa2c0){var _0x4e81a4=typeof _0xa4a059['offset']==='undefined'&&typeof _0xa4a059[_0xfada('0x1f')]===_0xfada('0x20');var _0x1cbd31=_0x2aa2c0[_0xfada('0x21')];var _0x147925=_0x4e81a4?0x0:_0xa4a059['offset'];var _0x1f7fd6=_0x4e81a4?_0x2aa2c0[_0xfada('0x21')]:_0xa4a059[_0xfada('0x22')]+_0xa4a059['limit'];var _0x3f2d16;if(_0x1f7fd6>=_0x1cbd31){_0x1f7fd6=_0x1cbd31;_0x3f2d16=0xc8;}else{_0x3f2d16=0xce;}_0x13634c['status'](_0x3f2d16);return _0x13634c[_0xfada('0x23')]('Content-Range',_0x147925+'-'+_0x1f7fd6+'/'+_0x1cbd31)['json'](_0x2aa2c0);}return null;};}function patchUpdates(_0x197abe){return function(_0x32776f){try{jsonpatch[_0xfada('0x24')](_0x32776f,_0x197abe,!![]);}catch(_0x3d4a6b){return BPromise[_0xfada('0x25')](_0x3d4a6b);}return _0x32776f['save']();};}function saveUpdates(_0x2f550f,_0x52b143){return function(_0x4c48dd){if(_0x4c48dd){return _0x4c48dd[_0xfada('0x26')](_0x2f550f)[_0xfada('0x27')](function(_0x273981){return _0x273981;});}return null;};}function removeEntity(_0x59fb37,_0x55e28d){return function(_0x5a6a96){if(_0x5a6a96){return _0x5a6a96[_0xfada('0x28')]()[_0xfada('0x27')](function(){_0x59fb37[_0xfada('0x1c')](0xcc)[_0xfada('0x1d')]();});}};}function handleEntityNotFound(_0x171b62,_0x499d98){return function(_0x4b22e7){if(!_0x4b22e7){_0x171b62[_0xfada('0x1b')](0x194);}return _0x4b22e7;};}function handleError(_0x4b4176,_0x2cfe65){_0x2cfe65=_0x2cfe65||0x1f4;return function(_0x2004d9){logger[_0xfada('0x29')](_0x2004d9[_0xfada('0x2a')]);if(_0x2004d9[_0xfada('0x2b')]){delete _0x2004d9[_0xfada('0x2b')];}_0x4b4176[_0xfada('0x1c')](_0x2cfe65)['send'](_0x2004d9);};}exports[_0xfada('0x2c')]=function(_0x339d5a,_0x3518c7){var _0x24e732={},_0xbff9e0={},_0xae670c={'count':0x0,'rows':[]};var _0x3411c2=_[_0xfada('0x2d')](db[_0xfada('0x2e')][_0xfada('0x2f')],function(_0x598457){return{'name':_0x598457[_0xfada('0x30')],'type':_0x598457[_0xfada('0x31')][_0xfada('0x32')]};});_0xbff9e0['model']=_[_0xfada('0x2d')](_0x3411c2,_0xfada('0x2b'));_0xbff9e0[_0xfada('0x33')]=_[_0xfada('0x34')](_0x339d5a[_0xfada('0x33')]);_0xbff9e0['filters']=_['intersection'](_0xbff9e0[_0xfada('0x35')],_0xbff9e0['query']);_0x24e732[_0xfada('0x36')]=_[_0xfada('0x37')](_0xbff9e0[_0xfada('0x35')],qs[_0xfada('0x38')](_0x339d5a[_0xfada('0x33')][_0xfada('0x38')]));_0x24e732['attributes']=_0x24e732[_0xfada('0x36')]['length']?_0x24e732[_0xfada('0x36')]:_0xbff9e0['model'];if(!_0x339d5a[_0xfada('0x33')][_0xfada('0x39')](_0xfada('0x3a'))){_0x24e732['limit']=qs[_0xfada('0x1f')](_0x339d5a[_0xfada('0x33')][_0xfada('0x1f')]);_0x24e732['offset']=qs[_0xfada('0x22')](_0x339d5a['query'][_0xfada('0x22')]);}_0x24e732[_0xfada('0x3b')]=qs[_0xfada('0x3c')](_0x339d5a[_0xfada('0x33')][_0xfada('0x3c')]);_0x24e732['where']=qs[_0xfada('0x3d')](_[_0xfada('0x3e')](_0x339d5a['query'],_0xbff9e0[_0xfada('0x3d')]),_0x3411c2);if(_0x339d5a[_0xfada('0x33')][_0xfada('0x3f')]){_0x24e732[_0xfada('0x40')]=_[_0xfada('0x41')](_0x24e732[_0xfada('0x40')],{'$or':_[_0xfada('0x2d')](_0x3411c2,function(_0x14aaaf){if(_0x14aaaf[_0xfada('0x31')]!=='VIRTUAL'){var _0x224d1b={};_0x224d1b[_0x14aaaf[_0xfada('0x2b')]]={'$like':'%'+_0x339d5a[_0xfada('0x33')]['filter']+'%'};return _0x224d1b;}})});}_0x24e732=_[_0xfada('0x41')]({},_0x24e732,_0x339d5a[_0xfada('0x42')]);var _0x54799d={'where':_0x24e732[_0xfada('0x40')]};return db[_0xfada('0x2e')][_0xfada('0x21')](_0x54799d)['then'](function(_0x1a53d4){_0xae670c[_0xfada('0x21')]=_0x1a53d4;if(_0x339d5a[_0xfada('0x33')][_0xfada('0x43')]){_0x24e732['include']=[{'all':!![]}];}return db[_0xfada('0x2e')]['findAll'](_0x24e732);})[_0xfada('0x27')](function(_0x192e93){_0xae670c['rows']=_0x192e93;return _0xae670c;})['then'](respondWithFilteredResult(_0x3518c7,_0x24e732))[_0xfada('0x44')](handleError(_0x3518c7,null));};exports['show']=function(_0x3242d4,_0x183e0c){var _0x2ce44e={'raw':![],'where':{'id':_0x3242d4['params']['id']}},_0x1a07dc={};_0x1a07dc[_0xfada('0x35')]=_['keys'](db[_0xfada('0x2e')][_0xfada('0x2f')]);_0x1a07dc[_0xfada('0x33')]=_['keys'](_0x3242d4[_0xfada('0x33')]);_0x1a07dc[_0xfada('0x3d')]=_['intersection'](_0x1a07dc[_0xfada('0x35')],_0x1a07dc[_0xfada('0x33')]);_0x2ce44e[_0xfada('0x36')]=_['intersection'](_0x1a07dc[_0xfada('0x35')],qs[_0xfada('0x38')](_0x3242d4[_0xfada('0x33')][_0xfada('0x38')]));_0x2ce44e[_0xfada('0x36')]=_0x2ce44e[_0xfada('0x36')][_0xfada('0x45')]?_0x2ce44e[_0xfada('0x36')]:_0x1a07dc[_0xfada('0x35')];if(_0x3242d4[_0xfada('0x33')]['includeAll']){_0x2ce44e['include']=[{'all':!![]}];}_0x2ce44e=_[_0xfada('0x41')]({},_0x2ce44e,_0x3242d4[_0xfada('0x42')]);return db['DeskAccount'][_0xfada('0x46')](_0x2ce44e)[_0xfada('0x27')](handleEntityNotFound(_0x183e0c,null))[_0xfada('0x27')](respondWithResult(_0x183e0c,null))['catch'](handleError(_0x183e0c,null));};exports['create']=function(_0x310882,_0x2ef850){return db['DeskAccount'][_0xfada('0x47')](_0x310882['body'],{})[_0xfada('0x27')](respondWithResult(_0x2ef850,0xc9))[_0xfada('0x44')](handleError(_0x2ef850,null));};exports[_0xfada('0x26')]=function(_0x1804a5,_0x31d03c){if(_0x1804a5[_0xfada('0x48')]['id']){delete _0x1804a5[_0xfada('0x48')]['id'];}return db[_0xfada('0x2e')]['find']({'where':{'id':_0x1804a5[_0xfada('0x49')]['id']}})['then'](handleEntityNotFound(_0x31d03c,null))[_0xfada('0x27')](saveUpdates(_0x1804a5['body'],null))[_0xfada('0x27')](respondWithResult(_0x31d03c,null))['catch'](handleError(_0x31d03c,null));};exports[_0xfada('0x28')]=function(_0x4d9ad2,_0x3175f4){return db[_0xfada('0x2e')][_0xfada('0x46')]({'where':{'id':_0x4d9ad2['params']['id']}})[_0xfada('0x27')](handleEntityNotFound(_0x3175f4,null))[_0xfada('0x27')](removeEntity(_0x3175f4,null))['catch'](handleError(_0x3175f4,null));};exports[_0xfada('0x4a')]=function(_0x20af6e,_0x5ca46e,_0x1620f1){var _0x17b0c4={};var _0xdaa085={};var _0x674965;var _0x5597f2;return db[_0xfada('0x2e')][_0xfada('0x4b')]({'where':{'id':_0x20af6e[_0xfada('0x49')]['id']}})[_0xfada('0x27')](handleEntityNotFound(_0x5ca46e,null))['then'](function(_0xbd28c8){if(_0xbd28c8){_0x674965=_0xbd28c8;_0xdaa085[_0xfada('0x35')]=_[_0xfada('0x34')](db[_0xfada('0x4c')][_0xfada('0x2f')]);_0xdaa085[_0xfada('0x33')]=_['keys'](_0x20af6e[_0xfada('0x33')]);_0xdaa085['filters']=_[_0xfada('0x37')](_0xdaa085['model'],_0xdaa085[_0xfada('0x33')]);_0x17b0c4['attributes']=_[_0xfada('0x37')](_0xdaa085[_0xfada('0x35')],qs[_0xfada('0x38')](_0x20af6e[_0xfada('0x33')][_0xfada('0x38')]));_0x17b0c4[_0xfada('0x36')]=_0x17b0c4[_0xfada('0x36')][_0xfada('0x45')]?_0x17b0c4[_0xfada('0x36')]:_0xdaa085[_0xfada('0x35')];_0x17b0c4[_0xfada('0x3b')]=qs[_0xfada('0x3c')](_0x20af6e['query'][_0xfada('0x3c')]);_0x17b0c4[_0xfada('0x40')]=qs['filters'](_[_0xfada('0x3e')](_0x20af6e[_0xfada('0x33')],_0xdaa085['filters']));if(_0x20af6e['query'][_0xfada('0x3f')]){_0x17b0c4[_0xfada('0x40')]=_['merge'](_0x17b0c4['where'],{'$or':_['map'](_0x17b0c4[_0xfada('0x36')],function(_0x3d0f99){var _0x5b7d8f={};_0x5b7d8f[_0x3d0f99]={'$like':'%'+_0x20af6e[_0xfada('0x33')]['filter']+'%'};return _0x5b7d8f;})});}_0x17b0c4=_['merge']({},_0x17b0c4,_0x20af6e['options']);return _0x674965[_0xfada('0x4a')](_0x17b0c4);}})[_0xfada('0x27')](function(_0x45b01f){if(_0x45b01f){_0x5597f2=_0x45b01f[_0xfada('0x45')];if(!_0x20af6e[_0xfada('0x33')][_0xfada('0x39')]('nolimit')){_0x17b0c4['limit']=qs['limit'](_0x20af6e[_0xfada('0x33')][_0xfada('0x1f')]);_0x17b0c4[_0xfada('0x22')]=qs[_0xfada('0x22')](_0x20af6e['query'][_0xfada('0x22')]);}return _0x674965[_0xfada('0x4a')](_0x17b0c4);}})['then'](function(_0x5e0950){if(_0x5e0950){return _0x5e0950?{'count':_0x5597f2,'rows':_0x5e0950}:null;}})['then'](respondWithResult(_0x5ca46e,null))[_0xfada('0x44')](handleError(_0x5ca46e,null));};exports[_0xfada('0x4d')]=function(_0x3a2dde,_0x1324e6,_0x5bda48){if(_0x3a2dde[_0xfada('0x48')]['id']){delete _0x3a2dde[_0xfada('0x48')]['id'];}return db['DeskAccount'][_0xfada('0x4b')]({'where':{'id':_0x3a2dde[_0xfada('0x49')]['id']}})[_0xfada('0x27')](handleEntityNotFound(_0x1324e6,null))[_0xfada('0x27')](function(_0x26ba8b){if(_0x26ba8b){_0x3a2dde[_0xfada('0x48')][_0xfada('0x4e')]=_0x26ba8b['id'];_0x3a2dde['body'][_0xfada('0x4f')]=integrations[_0xfada('0x50')](_0x3a2dde[_0xfada('0x48')][_0xfada('0x51')],_0x3a2dde[_0xfada('0x48')]['type']);_0x3a2dde[_0xfada('0x48')][_0xfada('0x52')]=integrations[_0xfada('0x53')](_0x3a2dde[_0xfada('0x48')][_0xfada('0x51')],_0x3a2dde['body'][_0xfada('0x31')]);return db[_0xfada('0x4c')][_0xfada('0x47')](_0x3a2dde[_0xfada('0x48')],{'include':[{'model':db[_0xfada('0x54')],'as':_0xfada('0x4f')},{'model':db[_0xfada('0x54')],'as':'Descriptions'}]});}return null;})[_0xfada('0x27')](respondWithResult(_0x1324e6,null))[_0xfada('0x44')](handleError(_0x1324e6,null));};exports[_0xfada('0x55')]=function(_0x1ecf2d,_0x1bc62f,_0x213017){var _0x5cb3d0=[{'name':'priority','label':_0xfada('0x56'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x576adb='';return db[_0xfada('0x2e')][_0xfada('0x4b')]({'where':{'id':_0x1ecf2d[_0xfada('0x49')]['id']},'attributes':['id',_0xfada('0x57'),_0xfada('0x58'),_0xfada('0x59'),_0xfada('0x5a'),_0xfada('0x5b'),_0xfada('0x5c'),_0xfada('0x5d'),'tokenSecret']})[_0xfada('0x27')](handleEntityNotFound(_0x1bc62f,null))[_0xfada('0x27')](function(_0x224a06){if(_0x224a06){_0x576adb=_0x224a06[_0xfada('0x57')];var _0x3120d4=_0x576adb['slice'](-0x1);if(_0x3120d4==='/'){_0x576adb=_0x576adb[_0xfada('0x5e')](0x0,_0x576adb[_0xfada('0x5f')](_0x3120d4));}var _0x1ab585={'method':_0xfada('0x60'),'uri':util[_0xfada('0x61')](_0xfada('0x62'),_0x576adb),'headers':{'Content-Type':_0xfada('0x63'),'Accept':_0xfada('0x63')},'json':!![]};if(_0x224a06[_0xfada('0x58')]===_0xfada('0x64')){_0x1ab585[_0xfada('0x65')][_0xfada('0x66')]=util['format'](_0xfada('0x67'),new Buffer(util['format']('%s:%s',_0x224a06[_0xfada('0x59')],_0x224a06[_0xfada('0x5a')]))[_0xfada('0x68')]('base64'));}return rp(_0x1ab585)[_0xfada('0x27')](function(_0x37461a){return _0x5cb3d0[_0xfada('0x69')](_['map'](_0x37461a[_0xfada('0x6a')]['entries'],function(_0x5dd4e6){return{'id':_0x5dd4e6[_0xfada('0x2b')],'name':_0x5dd4e6[_0xfada('0x2b')],'type':_0x5dd4e6['type'],'active':_0x5dd4e6[_0xfada('0x6b')],'label':_0x5dd4e6[_0xfada('0x6c')],'custom':!![]};}));});}})[_0xfada('0x27')](function(_0x31f4c3){return{'count':_0x31f4c3['length'],'rows':_0x31f4c3};})[_0xfada('0x27')](respondWithResult(_0x1bc62f,null))[_0xfada('0x44')](function(_0x3c5ae6){var _0x2e9dc5=_0x1ecf2d[_0xfada('0x33')]['test']?0x1f4:_0x3c5ae6[_0xfada('0x6d')]||0x1f4;logger[_0xfada('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0xfada('0x55'),_0x2e9dc5,JSON['stringify'](_0x3c5ae6));delete _0x3c5ae6[_0xfada('0x2b')];if(_0x2e9dc5===0x191){_0x2e9dc5=0x190;}_0x1bc62f[_0xfada('0x1c')](_0x2e9dc5)[_0xfada('0x6e')](_0x1ecf2d['query'][_0xfada('0x6f')]?{'message':'Wrong\x20credentials','statusCode':_0x3c5ae6[_0xfada('0x6d')]}:_0x3c5ae6);});};
\ No newline at end of file
+var _0xbd43=['Basic\x20%s','format','%s:%s','password','toString','base64','concat','entries','active','statusCode','getFields','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','DeskAccount','fieldName','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','includeAll','find','body','getConfigurations','DeskConfiguration','rawAttributes','addConfiguration','findOne','AccountId','getSubjects','channel','type','getDescriptions','DeskField','Descriptions','priority','authType','consumerKey','tokenSecret','remoteUri','substring','GET','%s/custom_fields','application/json','basic','headers','Authorization'];(function(_0x40ece3,_0x48abb7){var _0x5ac45b=function(_0xe47868){while(--_0xe47868){_0x40ece3['push'](_0x40ece3['shift']());}};_0x5ac45b(++_0x48abb7);}(_0xbd43,0x155));var _0x3bd4=function(_0x19ca16,_0x3e3ec8){_0x19ca16=_0x19ca16-0x0;var _0x1fa0ff=_0xbd43[_0x19ca16];return _0x1fa0ff;};'use strict';var emlformat=require(_0x3bd4('0x0'));var rimraf=require(_0x3bd4('0x1'));var zipdir=require(_0x3bd4('0x2'));var jsonpatch=require(_0x3bd4('0x3'));var rp=require('request-promise');var moment=require(_0x3bd4('0x4'));var BPromise=require(_0x3bd4('0x5'));var Mustache=require(_0x3bd4('0x6'));var util=require(_0x3bd4('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3bd4('0x8'));var ejs=require(_0x3bd4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3bd4('0xa'));var crypto=require(_0x3bd4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3bd4('0xc'));var toCsv=require(_0x3bd4('0x8'));var querystring=require(_0x3bd4('0xd'));var Papa=require('papaparse');var Redis=require(_0x3bd4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3bd4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3bd4('0x10'));var logger=require(_0x3bd4('0x11'))('api');var utils=require(_0x3bd4('0x12'));var config=require(_0x3bd4('0x13'));var licenseUtil=require(_0x3bd4('0x14'));var db=require(_0x3bd4('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xc12e99,_0x5e9899){_0x5e9899=_0x5e9899||0xcc;return function(_0x2464f7){if(_0x2464f7){return _0xc12e99['sendStatus'](_0x5e9899);}return _0xc12e99[_0x3bd4('0x16')](_0x5e9899)[_0x3bd4('0x17')]();};}function respondWithResult(_0x4b0a5c,_0x3e9278){_0x3e9278=_0x3e9278||0xc8;return function(_0x2c7708){if(_0x2c7708){return _0x4b0a5c['status'](_0x3e9278)[_0x3bd4('0x18')](_0x2c7708);}};}function respondWithFilteredResult(_0x42c68d,_0x538f1d){return function(_0x10898a){if(_0x10898a){var _0x500ed0=typeof _0x538f1d[_0x3bd4('0x19')]==='undefined'&&typeof _0x538f1d['limit']===_0x3bd4('0x1a');var _0x2fa299=_0x10898a[_0x3bd4('0x1b')];var _0x32a804=_0x500ed0?0x0:_0x538f1d['offset'];var _0x1e55aa=_0x500ed0?_0x10898a[_0x3bd4('0x1b')]:_0x538f1d[_0x3bd4('0x19')]+_0x538f1d['limit'];var _0x934818;if(_0x1e55aa>=_0x2fa299){_0x1e55aa=_0x2fa299;_0x934818=0xc8;}else{_0x934818=0xce;}_0x42c68d['status'](_0x934818);return _0x42c68d[_0x3bd4('0x1c')](_0x3bd4('0x1d'),_0x32a804+'-'+_0x1e55aa+'/'+_0x2fa299)[_0x3bd4('0x18')](_0x10898a);}return null;};}function patchUpdates(_0x217725){return function(_0x530df5){try{jsonpatch[_0x3bd4('0x1e')](_0x530df5,_0x217725,!![]);}catch(_0x45a709){return BPromise[_0x3bd4('0x1f')](_0x45a709);}return _0x530df5['save']();};}function saveUpdates(_0x105fd9,_0x3e7bf1){return function(_0x31a30f){if(_0x31a30f){return _0x31a30f[_0x3bd4('0x20')](_0x105fd9)[_0x3bd4('0x21')](function(_0x20ec7c){return _0x20ec7c;});}return null;};}function removeEntity(_0x4b1b92,_0x1cf44c){return function(_0x173dc1){if(_0x173dc1){return _0x173dc1[_0x3bd4('0x22')]()[_0x3bd4('0x21')](function(){_0x4b1b92[_0x3bd4('0x16')](0xcc)[_0x3bd4('0x17')]();});}};}function handleEntityNotFound(_0x25b7c6,_0x3c0766){return function(_0x529e08){if(!_0x529e08){_0x25b7c6['sendStatus'](0x194);}return _0x529e08;};}function handleError(_0x4e5ede,_0x306d97){_0x306d97=_0x306d97||0x1f4;return function(_0xa746db){logger[_0x3bd4('0x23')](_0xa746db[_0x3bd4('0x24')]);if(_0xa746db[_0x3bd4('0x25')]){delete _0xa746db[_0x3bd4('0x25')];}_0x4e5ede['status'](_0x306d97)[_0x3bd4('0x26')](_0xa746db);};}exports[_0x3bd4('0x27')]=function(_0x3d17f5,_0x2d865c){var _0x2ac1b5={},_0x30201e={},_0x2837b5={'count':0x0,'rows':[]};var _0x30473a=_['map'](db[_0x3bd4('0x28')]['rawAttributes'],function(_0x56c67e){return{'name':_0x56c67e[_0x3bd4('0x29')],'type':_0x56c67e['type'][_0x3bd4('0x2a')]};});_0x30201e[_0x3bd4('0x2b')]=_[_0x3bd4('0x2c')](_0x30473a,_0x3bd4('0x25'));_0x30201e[_0x3bd4('0x2d')]=_['keys'](_0x3d17f5[_0x3bd4('0x2d')]);_0x30201e[_0x3bd4('0x2e')]=_['intersection'](_0x30201e['model'],_0x30201e['query']);_0x2ac1b5[_0x3bd4('0x2f')]=_[_0x3bd4('0x30')](_0x30201e['model'],qs[_0x3bd4('0x31')](_0x3d17f5[_0x3bd4('0x2d')]['fields']));_0x2ac1b5[_0x3bd4('0x2f')]=_0x2ac1b5[_0x3bd4('0x2f')][_0x3bd4('0x32')]?_0x2ac1b5[_0x3bd4('0x2f')]:_0x30201e[_0x3bd4('0x2b')];if(!_0x3d17f5[_0x3bd4('0x2d')][_0x3bd4('0x33')](_0x3bd4('0x34'))){_0x2ac1b5[_0x3bd4('0x35')]=qs[_0x3bd4('0x35')](_0x3d17f5['query'][_0x3bd4('0x35')]);_0x2ac1b5[_0x3bd4('0x19')]=qs[_0x3bd4('0x19')](_0x3d17f5[_0x3bd4('0x2d')][_0x3bd4('0x19')]);}_0x2ac1b5[_0x3bd4('0x36')]=qs[_0x3bd4('0x37')](_0x3d17f5[_0x3bd4('0x2d')][_0x3bd4('0x37')]);_0x2ac1b5[_0x3bd4('0x38')]=qs[_0x3bd4('0x2e')](_[_0x3bd4('0x39')](_0x3d17f5[_0x3bd4('0x2d')],_0x30201e[_0x3bd4('0x2e')]),_0x30473a);if(_0x3d17f5[_0x3bd4('0x2d')][_0x3bd4('0x3a')]){_0x2ac1b5[_0x3bd4('0x38')]=_[_0x3bd4('0x3b')](_0x2ac1b5[_0x3bd4('0x38')],{'$or':_[_0x3bd4('0x2c')](_0x30473a,function(_0x2a00fa){if(_0x2a00fa['type']!==_0x3bd4('0x3c')){var _0x5ad3c2={};_0x5ad3c2[_0x2a00fa[_0x3bd4('0x25')]]={'$like':'%'+_0x3d17f5[_0x3bd4('0x2d')]['filter']+'%'};return _0x5ad3c2;}})});}_0x2ac1b5=_[_0x3bd4('0x3b')]({},_0x2ac1b5,_0x3d17f5[_0x3bd4('0x3d')]);var _0x4c4f20={'where':_0x2ac1b5[_0x3bd4('0x38')]};return db['DeskAccount'][_0x3bd4('0x1b')](_0x4c4f20)[_0x3bd4('0x21')](function(_0x4fcad7){_0x2837b5['count']=_0x4fcad7;if(_0x3d17f5[_0x3bd4('0x2d')]['includeAll']){_0x2ac1b5[_0x3bd4('0x3e')]=[{'all':!![]}];}return db[_0x3bd4('0x28')][_0x3bd4('0x3f')](_0x2ac1b5);})['then'](function(_0x5795e9){_0x2837b5[_0x3bd4('0x40')]=_0x5795e9;return _0x2837b5;})[_0x3bd4('0x21')](respondWithFilteredResult(_0x2d865c,_0x2ac1b5))[_0x3bd4('0x41')](handleError(_0x2d865c,null));};exports['show']=function(_0x15d7d3,_0x7b5574){var _0x5d7226={'raw':![],'where':{'id':_0x15d7d3[_0x3bd4('0x42')]['id']}},_0x26276d={};_0x26276d[_0x3bd4('0x2b')]=_[_0x3bd4('0x43')](db[_0x3bd4('0x28')]['rawAttributes']);_0x26276d[_0x3bd4('0x2d')]=_[_0x3bd4('0x43')](_0x15d7d3[_0x3bd4('0x2d')]);_0x26276d[_0x3bd4('0x2e')]=_[_0x3bd4('0x30')](_0x26276d['model'],_0x26276d[_0x3bd4('0x2d')]);_0x5d7226[_0x3bd4('0x2f')]=_[_0x3bd4('0x30')](_0x26276d[_0x3bd4('0x2b')],qs[_0x3bd4('0x31')](_0x15d7d3[_0x3bd4('0x2d')][_0x3bd4('0x31')]));_0x5d7226['attributes']=_0x5d7226[_0x3bd4('0x2f')][_0x3bd4('0x32')]?_0x5d7226['attributes']:_0x26276d['model'];if(_0x15d7d3[_0x3bd4('0x2d')][_0x3bd4('0x44')]){_0x5d7226[_0x3bd4('0x3e')]=[{'all':!![]}];}_0x5d7226=_[_0x3bd4('0x3b')]({},_0x5d7226,_0x15d7d3[_0x3bd4('0x3d')]);return db[_0x3bd4('0x28')][_0x3bd4('0x45')](_0x5d7226)[_0x3bd4('0x21')](handleEntityNotFound(_0x7b5574,null))[_0x3bd4('0x21')](respondWithResult(_0x7b5574,null))[_0x3bd4('0x41')](handleError(_0x7b5574,null));};exports['create']=function(_0xa8d9a8,_0x24041f){return db['DeskAccount']['create'](_0xa8d9a8[_0x3bd4('0x46')],{})['then'](respondWithResult(_0x24041f,0xc9))[_0x3bd4('0x41')](handleError(_0x24041f,null));};exports[_0x3bd4('0x20')]=function(_0x199d10,_0x4dc2c4){if(_0x199d10[_0x3bd4('0x46')]['id']){delete _0x199d10['body']['id'];}return db[_0x3bd4('0x28')][_0x3bd4('0x45')]({'where':{'id':_0x199d10['params']['id']}})[_0x3bd4('0x21')](handleEntityNotFound(_0x4dc2c4,null))[_0x3bd4('0x21')](saveUpdates(_0x199d10[_0x3bd4('0x46')],null))['then'](respondWithResult(_0x4dc2c4,null))[_0x3bd4('0x41')](handleError(_0x4dc2c4,null));};exports[_0x3bd4('0x22')]=function(_0x4fd066,_0x25727b){return db[_0x3bd4('0x28')][_0x3bd4('0x45')]({'where':{'id':_0x4fd066['params']['id']}})['then'](handleEntityNotFound(_0x25727b,null))['then'](removeEntity(_0x25727b,null))['catch'](handleError(_0x25727b,null));};exports[_0x3bd4('0x47')]=function(_0x5ace40,_0x4c785a,_0x40af37){var _0x234d2f={};var _0x283eb0={};var _0x43f67b;var _0x3ed97a;return db[_0x3bd4('0x28')]['findOne']({'where':{'id':_0x5ace40[_0x3bd4('0x42')]['id']}})['then'](handleEntityNotFound(_0x4c785a,null))[_0x3bd4('0x21')](function(_0x4589e2){if(_0x4589e2){_0x43f67b=_0x4589e2;_0x283eb0['model']=_['keys'](db[_0x3bd4('0x48')][_0x3bd4('0x49')]);_0x283eb0[_0x3bd4('0x2d')]=_['keys'](_0x5ace40['query']);_0x283eb0[_0x3bd4('0x2e')]=_[_0x3bd4('0x30')](_0x283eb0[_0x3bd4('0x2b')],_0x283eb0[_0x3bd4('0x2d')]);_0x234d2f[_0x3bd4('0x2f')]=_['intersection'](_0x283eb0[_0x3bd4('0x2b')],qs[_0x3bd4('0x31')](_0x5ace40[_0x3bd4('0x2d')][_0x3bd4('0x31')]));_0x234d2f['attributes']=_0x234d2f['attributes']['length']?_0x234d2f[_0x3bd4('0x2f')]:_0x283eb0[_0x3bd4('0x2b')];_0x234d2f[_0x3bd4('0x36')]=qs[_0x3bd4('0x37')](_0x5ace40[_0x3bd4('0x2d')][_0x3bd4('0x37')]);_0x234d2f[_0x3bd4('0x38')]=qs[_0x3bd4('0x2e')](_[_0x3bd4('0x39')](_0x5ace40[_0x3bd4('0x2d')],_0x283eb0['filters']));if(_0x5ace40[_0x3bd4('0x2d')]['filter']){_0x234d2f['where']=_[_0x3bd4('0x3b')](_0x234d2f['where'],{'$or':_[_0x3bd4('0x2c')](_0x234d2f[_0x3bd4('0x2f')],function(_0x1306d5){var _0x367b66={};_0x367b66[_0x1306d5]={'$like':'%'+_0x5ace40['query'][_0x3bd4('0x3a')]+'%'};return _0x367b66;})});}_0x234d2f=_[_0x3bd4('0x3b')]({},_0x234d2f,_0x5ace40[_0x3bd4('0x3d')]);return _0x43f67b[_0x3bd4('0x47')](_0x234d2f);}})['then'](function(_0x15c158){if(_0x15c158){_0x3ed97a=_0x15c158['length'];if(!_0x5ace40['query'][_0x3bd4('0x33')](_0x3bd4('0x34'))){_0x234d2f[_0x3bd4('0x35')]=qs[_0x3bd4('0x35')](_0x5ace40[_0x3bd4('0x2d')]['limit']);_0x234d2f[_0x3bd4('0x19')]=qs[_0x3bd4('0x19')](_0x5ace40['query']['offset']);}return _0x43f67b['getConfigurations'](_0x234d2f);}})[_0x3bd4('0x21')](function(_0x393468){if(_0x393468){return _0x393468?{'count':_0x3ed97a,'rows':_0x393468}:null;}})[_0x3bd4('0x21')](respondWithResult(_0x4c785a,null))[_0x3bd4('0x41')](handleError(_0x4c785a,null));};exports[_0x3bd4('0x4a')]=function(_0x9ed915,_0x3a808d,_0xc6b5f7){if(_0x9ed915[_0x3bd4('0x46')]['id']){delete _0x9ed915[_0x3bd4('0x46')]['id'];}return db[_0x3bd4('0x28')][_0x3bd4('0x4b')]({'where':{'id':_0x9ed915[_0x3bd4('0x42')]['id']}})['then'](handleEntityNotFound(_0x3a808d,null))[_0x3bd4('0x21')](function(_0x1d165f){if(_0x1d165f){_0x9ed915[_0x3bd4('0x46')][_0x3bd4('0x4c')]=_0x1d165f['id'];_0x9ed915[_0x3bd4('0x46')]['Subjects']=integrations[_0x3bd4('0x4d')](_0x9ed915[_0x3bd4('0x46')][_0x3bd4('0x4e')],_0x9ed915[_0x3bd4('0x46')][_0x3bd4('0x4f')]);_0x9ed915['body']['Descriptions']=integrations[_0x3bd4('0x50')](_0x9ed915[_0x3bd4('0x46')][_0x3bd4('0x4e')],_0x9ed915[_0x3bd4('0x46')]['type']);return db['DeskConfiguration']['create'](_0x9ed915['body'],{'include':[{'model':db[_0x3bd4('0x51')],'as':'Subjects'},{'model':db[_0x3bd4('0x51')],'as':_0x3bd4('0x52')}]});}return null;})[_0x3bd4('0x21')](respondWithResult(_0x3a808d,null))[_0x3bd4('0x41')](handleError(_0x3a808d,null));};exports['getFields']=function(_0x44b7cc,_0x49a0af,_0x2c7474){var _0x1629da=[{'name':'priority','label':_0x3bd4('0x53'),'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 _0x389b79='';return db[_0x3bd4('0x28')]['findOne']({'where':{'id':_0x44b7cc[_0x3bd4('0x42')]['id']},'attributes':['id','remoteUri',_0x3bd4('0x54'),'username','password',_0x3bd4('0x55'),'consumerSecret','token',_0x3bd4('0x56')]})[_0x3bd4('0x21')](handleEntityNotFound(_0x49a0af,null))[_0x3bd4('0x21')](function(_0x53d10c){if(_0x53d10c){_0x389b79=_0x53d10c[_0x3bd4('0x57')];var _0x2d884e=_0x389b79['slice'](-0x1);if(_0x2d884e==='/'){_0x389b79=_0x389b79[_0x3bd4('0x58')](0x0,_0x389b79['lastIndexOf'](_0x2d884e));}var _0x361172={'method':_0x3bd4('0x59'),'uri':util['format'](_0x3bd4('0x5a'),_0x389b79),'headers':{'Content-Type':'application/json','Accept':_0x3bd4('0x5b')},'json':!![]};if(_0x53d10c[_0x3bd4('0x54')]===_0x3bd4('0x5c')){_0x361172[_0x3bd4('0x5d')][_0x3bd4('0x5e')]=util['format'](_0x3bd4('0x5f'),new Buffer(util[_0x3bd4('0x60')](_0x3bd4('0x61'),_0x53d10c['username'],_0x53d10c[_0x3bd4('0x62')]))[_0x3bd4('0x63')](_0x3bd4('0x64')));}return rp(_0x361172)[_0x3bd4('0x21')](function(_0x542ad1){return _0x1629da[_0x3bd4('0x65')](_[_0x3bd4('0x2c')](_0x542ad1['_embedded'][_0x3bd4('0x66')],function(_0x1fa4aa){return{'id':_0x1fa4aa[_0x3bd4('0x25')],'name':_0x1fa4aa[_0x3bd4('0x25')],'type':_0x1fa4aa[_0x3bd4('0x4f')],'active':_0x1fa4aa[_0x3bd4('0x67')],'label':_0x1fa4aa['label'],'custom':!![]};}));});}})['then'](function(_0x5373d4){return{'count':_0x5373d4[_0x3bd4('0x32')],'rows':_0x5373d4};})[_0x3bd4('0x21')](respondWithResult(_0x49a0af,null))[_0x3bd4('0x41')](function(_0x335ca8){var _0x16dd28=_0x44b7cc[_0x3bd4('0x2d')]['test']?0x1f4:_0x335ca8[_0x3bd4('0x68')]||0x1f4;logger[_0x3bd4('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0x3bd4('0x69'),_0x16dd28,JSON[_0x3bd4('0x6a')](_0x335ca8));delete _0x335ca8[_0x3bd4('0x25')];if(_0x16dd28===0x191){_0x16dd28=0x190;}_0x49a0af[_0x3bd4('0x16')](_0x16dd28)['send'](_0x44b7cc[_0x3bd4('0x2d')][_0x3bd4('0x6b')]?{'message':_0x3bd4('0x6c'),'statusCode':_0x335ca8['statusCode']}:_0x335ca8);});};
\ No newline at end of file
index 8b2ac6d..ac13706 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7795=['../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7795,0x172));var _0x5779=function(_0x223e7d,_0x4b59cf){_0x223e7d=_0x223e7d-0x0;var _0x50c9da=_0x7795[_0x223e7d];return _0x50c9da;};'use strict';var _=require(_0x5779('0x0'));var util=require(_0x5779('0x1'));var logger=require(_0x5779('0x2'))(_0x5779('0x3'));var moment=require('moment');var BPromise=require(_0x5779('0x4'));var rp=require(_0x5779('0x5'));var fs=require('fs');var path=require(_0x5779('0x6'));var rimraf=require(_0x5779('0x7'));var config=require(_0x5779('0x8'));var attributes=require(_0x5779('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x5779('0xa')]=function(_0x34b1a3,_0xdca8f2){return _0x34b1a3[_0x5779('0xb')](_0x5779('0xc'),attributes,{'tableName':_0x5779('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5169=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','util'];(function(_0x306163,_0x2fa605){var _0x32e3ca=function(_0x1ab9ac){while(--_0x1ab9ac){_0x306163['push'](_0x306163['shift']());}};_0x32e3ca(++_0x2fa605);}(_0x5169,0xfb));var _0x9516=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x5169[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var util=require(_0x9516('0x0'));var logger=require(_0x9516('0x1'))(_0x9516('0x2'));var moment=require('moment');var BPromise=require(_0x9516('0x3'));var rp=require(_0x9516('0x4'));var fs=require('fs');var path=require(_0x9516('0x5'));var rimraf=require('rimraf');var config=require(_0x9516('0x6'));var attributes=require(_0x9516('0x7'));var integrations=require(_0x9516('0x8'));module[_0x9516('0x9')]=function(_0x208f1d,_0x3bfd08){return _0x208f1d['define'](_0x9516('0xa'),attributes,{'tableName':_0x9516('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bcd6514..439f2e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x044f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','include','model','map','debug','ShowDeskAccount','util'];(function(_0x5d0818,_0x188411){var _0x37fcdb=function(_0x10c95a){while(--_0x10c95a){_0x5d0818['push'](_0x5d0818['shift']());}};_0x37fcdb(++_0x188411);}(_0x044f,0x13a));var _0xf044=function(_0x224dda,_0x16d0f9){_0x224dda=_0x224dda-0x0;var _0x2987ac=_0x044f[_0x224dda];return _0x2987ac;};'use strict';var _=require('lodash');var util=require(_0xf044('0x0'));var moment=require(_0xf044('0x1'));var BPromise=require(_0xf044('0x2'));var rs=require(_0xf044('0x3'));var fs=require('fs');var Redis=require(_0xf044('0x4'));var db=require(_0xf044('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf044('0x6'))(_0xf044('0x7'));var config=require(_0xf044('0x8'));var jayson=require(_0xf044('0x9'));var client=jayson[_0xf044('0xa')][_0xf044('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7ab7a9,_0x380816,_0x1007fb){return new BPromise(function(_0x247cbc,_0x33f982){return client[_0xf044('0xc')](_0x7ab7a9,_0x1007fb)[_0xf044('0xd')](function(_0x6f4497){logger['info'](_0xf044('0xe'),_0x380816,_0xf044('0xf'));logger['debug'](_0xf044('0x10'),_0x380816,_0xf044('0xf'),JSON[_0xf044('0x11')](_0x6f4497));if(_0x6f4497[_0xf044('0x12')]){if(_0x6f4497[_0xf044('0x12')][_0xf044('0x13')]===0x1f4){logger[_0xf044('0x12')]('DeskAccount,\x20%s,\x20%s',_0x380816,_0x6f4497[_0xf044('0x12')]['message']);return _0x33f982(_0x6f4497['error']['message']);}logger[_0xf044('0x12')]('DeskAccount,\x20%s,\x20%s',_0x380816,_0x6f4497[_0xf044('0x12')][_0xf044('0x14')]);return _0x247cbc(_0x6f4497[_0xf044('0x12')][_0xf044('0x14')]);}else{logger[_0xf044('0x15')](_0xf044('0xe'),_0x380816,_0xf044('0xf'));_0x247cbc(_0x6f4497['result']['message']);}})[_0xf044('0x16')](function(_0x5cab11){logger[_0xf044('0x12')]('DeskAccount,\x20%s,\x20%s',_0x380816,_0x5cab11);_0x33f982(_0x5cab11);});});}exports[_0xf044('0x17')]=function(_0x4412e1){var _0x17a64a=this;return new Promise(function(_0x42c441,_0x3cef0f){return db[_0xf044('0x18')][_0xf044('0x19')]({'raw':_0x4412e1[_0xf044('0x1a')]?_0x4412e1[_0xf044('0x1a')][_0xf044('0x1b')]===undefined?!![]:![]:!![],'where':_0x4412e1[_0xf044('0x1a')]?_0x4412e1[_0xf044('0x1a')][_0xf044('0x1c')]||null:null,'attributes':_0x4412e1['options']?_0x4412e1['options'][_0xf044('0x1d')]||null:null,'limit':_0x4412e1[_0xf044('0x1a')]?_0x4412e1[_0xf044('0x1a')]['limit']||null:null,'include':_0x4412e1[_0xf044('0x1a')]?_0x4412e1['options'][_0xf044('0x1e')]?_['map'](_0x4412e1[_0xf044('0x1a')][_0xf044('0x1e')],function(_0x3c9aad){return{'model':db[_0x3c9aad[_0xf044('0x1f')]],'as':_0x3c9aad['as'],'attributes':_0x3c9aad['attributes'],'include':_0x3c9aad['include']?_[_0xf044('0x20')](_0x3c9aad[_0xf044('0x1e')],function(_0x31fb36){return{'model':db[_0x31fb36[_0xf044('0x1f')]],'as':_0x31fb36['as'],'attributes':_0x31fb36['attributes'],'include':_0x31fb36[_0xf044('0x1e')]?_[_0xf044('0x20')](_0x31fb36['include'],function(_0x3cf119){return{'model':db[_0x3cf119['model']],'as':_0x3cf119['as'],'attributes':_0x3cf119['attributes']};}):[]};}):[]};}):[]:[]})[_0xf044('0xd')](function(_0x20e2df){logger[_0xf044('0x15')](_0xf044('0x17'),_0x4412e1);logger[_0xf044('0x21')](_0xf044('0x17'),_0x4412e1,JSON['stringify'](_0x20e2df));_0x42c441(_0x20e2df);})[_0xf044('0x16')](function(_0x5dc9d9){logger[_0xf044('0x12')](_0xf044('0x17'),_0x5dc9d9['message'],_0x4412e1);_0x3cef0f(_0x17a64a[_0xf044('0x12')](0x1f4,_0x5dc9d9[_0xf044('0x14')]));});});};exports[_0xf044('0x22')]=function(_0x26593d){var _0x34cbdb=this;return new Promise(function(_0x1c0ed8,_0x4a29cb){return db[_0xf044('0x18')]['find']({'raw':_0x26593d['options']?_0x26593d[_0xf044('0x1a')][_0xf044('0x1b')]===undefined?!![]:![]:!![],'where':_0x26593d[_0xf044('0x1a')]?_0x26593d[_0xf044('0x1a')][_0xf044('0x1c')]||null:null,'attributes':_0x26593d[_0xf044('0x1a')]?_0x26593d['options'][_0xf044('0x1d')]||null:null,'include':_0x26593d[_0xf044('0x1a')]?_0x26593d[_0xf044('0x1a')][_0xf044('0x1e')]?_[_0xf044('0x20')](_0x26593d[_0xf044('0x1a')][_0xf044('0x1e')],function(_0x48d40c){return{'model':db[_0x48d40c['model']],'as':_0x48d40c['as'],'attributes':_0x48d40c['attributes'],'include':_0x48d40c[_0xf044('0x1e')]?_[_0xf044('0x20')](_0x48d40c[_0xf044('0x1e')],function(_0x42ed12){return{'model':db[_0x42ed12[_0xf044('0x1f')]],'as':_0x42ed12['as'],'attributes':_0x42ed12[_0xf044('0x1d')],'include':_0x42ed12[_0xf044('0x1e')]?_['map'](_0x42ed12[_0xf044('0x1e')],function(_0x508389){return{'model':db[_0x508389[_0xf044('0x1f')]],'as':_0x508389['as'],'attributes':_0x508389[_0xf044('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf044('0xd')](function(_0x4c6863){logger['info']('ShowDeskAccount',_0x26593d);logger[_0xf044('0x21')](_0xf044('0x22'),_0x26593d,JSON[_0xf044('0x11')](_0x4c6863));_0x1c0ed8(_0x4c6863);})[_0xf044('0x16')](function(_0x100aa7){logger[_0xf044('0x12')](_0xf044('0x22'),_0x100aa7[_0xf044('0x14')],_0x26593d);_0x4a29cb(_0x34cbdb[_0xf044('0x12')](0x1f4,_0x100aa7[_0xf044('0x14')]));});});};
\ No newline at end of file
+var _0x89d8=['DeskAccount','options','where','attributes','limit','map','include','model','ShowDeskAccount','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x89d8,0x182));var _0x889d=function(_0x245c9f,_0x1d9e8c){_0x245c9f=_0x245c9f-0x0;var _0x276b79=_0x89d8[_0x245c9f];return _0x276b79;};'use strict';var _=require(_0x889d('0x0'));var util=require(_0x889d('0x1'));var moment=require(_0x889d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x889d('0x3'))['db'];var utils=require(_0x889d('0x4'));var logger=require(_0x889d('0x5'))(_0x889d('0x6'));var config=require('../../config/environment');var jayson=require(_0x889d('0x7'));var client=jayson['client'][_0x889d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x218212,_0x39912c,_0x52589e){return new BPromise(function(_0x4d0f70,_0x3db846){return client[_0x889d('0x9')](_0x218212,_0x52589e)[_0x889d('0xa')](function(_0x3317a4){logger[_0x889d('0xb')](_0x889d('0xc'),_0x39912c,_0x889d('0xd'));logger[_0x889d('0xe')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x39912c,_0x889d('0xd'),JSON[_0x889d('0xf')](_0x3317a4));if(_0x3317a4[_0x889d('0x10')]){if(_0x3317a4[_0x889d('0x10')][_0x889d('0x11')]===0x1f4){logger[_0x889d('0x10')](_0x889d('0xc'),_0x39912c,_0x3317a4['error'][_0x889d('0x12')]);return _0x3db846(_0x3317a4[_0x889d('0x10')]['message']);}logger['error'](_0x889d('0xc'),_0x39912c,_0x3317a4['error'][_0x889d('0x12')]);return _0x4d0f70(_0x3317a4[_0x889d('0x10')][_0x889d('0x12')]);}else{logger['info'](_0x889d('0xc'),_0x39912c,'request\x20sent');_0x4d0f70(_0x3317a4['result']['message']);}})[_0x889d('0x13')](function(_0x479f44){logger['error'](_0x889d('0xc'),_0x39912c,_0x479f44);_0x3db846(_0x479f44);});});}exports['GetDeskAccount']=function(_0x12a3eb){var _0x1b6348=this;return new Promise(function(_0x4da8d0,_0x5f201c){return db[_0x889d('0x14')]['findAll']({'raw':_0x12a3eb[_0x889d('0x15')]?_0x12a3eb[_0x889d('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x12a3eb[_0x889d('0x15')]?_0x12a3eb[_0x889d('0x15')][_0x889d('0x16')]||null:null,'attributes':_0x12a3eb[_0x889d('0x15')]?_0x12a3eb[_0x889d('0x15')][_0x889d('0x17')]||null:null,'limit':_0x12a3eb[_0x889d('0x15')]?_0x12a3eb[_0x889d('0x15')][_0x889d('0x18')]||null:null,'include':_0x12a3eb[_0x889d('0x15')]?_0x12a3eb['options']['include']?_[_0x889d('0x19')](_0x12a3eb[_0x889d('0x15')]['include'],function(_0x450434){return{'model':db[_0x450434['model']],'as':_0x450434['as'],'attributes':_0x450434[_0x889d('0x17')],'include':_0x450434[_0x889d('0x1a')]?_[_0x889d('0x19')](_0x450434[_0x889d('0x1a')],function(_0x2d38c0){return{'model':db[_0x2d38c0[_0x889d('0x1b')]],'as':_0x2d38c0['as'],'attributes':_0x2d38c0[_0x889d('0x17')],'include':_0x2d38c0[_0x889d('0x1a')]?_[_0x889d('0x19')](_0x2d38c0[_0x889d('0x1a')],function(_0x353a7c){return{'model':db[_0x353a7c['model']],'as':_0x353a7c['as'],'attributes':_0x353a7c[_0x889d('0x17')]};}):[]};}):[]};}):[]:[]})[_0x889d('0xa')](function(_0x2902a1){logger[_0x889d('0xb')]('GetDeskAccount',_0x12a3eb);logger['debug']('GetDeskAccount',_0x12a3eb,JSON[_0x889d('0xf')](_0x2902a1));_0x4da8d0(_0x2902a1);})[_0x889d('0x13')](function(_0x5fb6cd){logger['error']('GetDeskAccount',_0x5fb6cd[_0x889d('0x12')],_0x12a3eb);_0x5f201c(_0x1b6348[_0x889d('0x10')](0x1f4,_0x5fb6cd[_0x889d('0x12')]));});});};exports[_0x889d('0x1c')]=function(_0x5254a6){var _0x1c6035=this;return new Promise(function(_0x3ad35d,_0x365522){return db[_0x889d('0x14')]['find']({'raw':_0x5254a6[_0x889d('0x15')]?_0x5254a6['options']['raw']===undefined?!![]:![]:!![],'where':_0x5254a6[_0x889d('0x15')]?_0x5254a6[_0x889d('0x15')][_0x889d('0x16')]||null:null,'attributes':_0x5254a6[_0x889d('0x15')]?_0x5254a6[_0x889d('0x15')][_0x889d('0x17')]||null:null,'include':_0x5254a6[_0x889d('0x15')]?_0x5254a6[_0x889d('0x15')][_0x889d('0x1a')]?_['map'](_0x5254a6[_0x889d('0x15')][_0x889d('0x1a')],function(_0x260c54){return{'model':db[_0x260c54['model']],'as':_0x260c54['as'],'attributes':_0x260c54[_0x889d('0x17')],'include':_0x260c54['include']?_[_0x889d('0x19')](_0x260c54[_0x889d('0x1a')],function(_0x4123de){return{'model':db[_0x4123de[_0x889d('0x1b')]],'as':_0x4123de['as'],'attributes':_0x4123de[_0x889d('0x17')],'include':_0x4123de['include']?_[_0x889d('0x19')](_0x4123de['include'],function(_0x3bbace){return{'model':db[_0x3bbace[_0x889d('0x1b')]],'as':_0x3bbace['as'],'attributes':_0x3bbace['attributes']};}):[]};}):[]};}):[]:[]})[_0x889d('0xa')](function(_0x139db1){logger['info'](_0x889d('0x1c'),_0x5254a6);logger[_0x889d('0xe')](_0x889d('0x1c'),_0x5254a6,JSON[_0x889d('0xf')](_0x139db1));_0x3ad35d(_0x139db1);})[_0x889d('0x13')](function(_0x1bae34){logger[_0x889d('0x10')](_0x889d('0x1c'),_0x1bae34['message'],_0x5254a6);_0x365522(_0x1c6035['error'](0x1f4,_0x1bae34['message']));});});};
\ No newline at end of file
index fa3bee0..a393a82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x41f97a,_0x15674b){var _0xf13b43=function(_0x8917a6){while(--_0x8917a6){_0x41f97a['push'](_0x41f97a['shift']());}};_0xf13b43(++_0x15674b);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',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/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router;
\ No newline at end of file
+var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xf7a7c2,_0x37c23f){var _0x51199f=function(_0x3bc911){while(--_0x3bc911){_0xf7a7c2['push'](_0xf7a7c2['shift']());}};_0x51199f(++_0x37c23f);}(_0x008c,0x188));var _0xc008=function(_0x4060b4,_0x82eb25){_0x4060b4=_0x4060b4-0x0;var _0x32aaa1=_0x008c[_0x4060b4];return _0x32aaa1;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router;
\ No newline at end of file
index bfcc082..3697c08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b6e=['sequelize','exports','STRING'];(function(_0x2a8cd1,_0x25c003){var _0x4c46b9=function(_0x22829e){while(--_0x22829e){_0x2a8cd1['push'](_0x2a8cd1['shift']());}};_0x4c46b9(++_0x25c003);}(_0x1b6e,0xc0));var _0xe1b6=function(_0x568eb3,_0x1e2fd9){_0x568eb3=_0x568eb3-0x0;var _0x321917=_0x1b6e[_0x568eb3];return _0x321917;};'use strict';var Sequelize=require(_0xe1b6('0x0'));module[_0xe1b6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe1b6('0x2')]}};
\ No newline at end of file
+var _0xe12f=['sequelize','exports','STRING'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xe12f,0x1e9));var _0xfe12=function(_0x5f14e6,_0xebfe8e){_0x5f14e6=_0x5f14e6-0x0;var _0x17fd70=_0xe12f[_0x5f14e6];return _0x17fd70;};'use strict';var Sequelize=require(_0xfe12('0x0'));module[_0xfe12('0x1')]={'name':{'type':Sequelize[_0xfe12('0x2')]},'description':{'type':Sequelize[_0xfe12('0x2')]}};
\ No newline at end of file
index b184c56..047f8f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd310=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','include','catch','params','includeAll','create','body','update','find','getFields','findOne','DeskField','pick','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','apply','then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model'];(function(_0xcfe8cc,_0xb83aeb){var _0x55ac53=function(_0x4067d4){while(--_0x4067d4){_0xcfe8cc['push'](_0xcfe8cc['shift']());}};_0x55ac53(++_0xb83aeb);}(_0xd310,0x1de));var _0x0d31=function(_0xda16bb,_0xf59b46){_0xda16bb=_0xda16bb-0x0;var _0x549aee=_0xd310[_0xda16bb];return _0x549aee;};'use strict';var emlformat=require(_0x0d31('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0d31('0x1'));var rp=require(_0x0d31('0x2'));var moment=require(_0x0d31('0x3'));var BPromise=require(_0x0d31('0x4'));var Mustache=require(_0x0d31('0x5'));var util=require(_0x0d31('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('fs-extra');var _=require(_0x0d31('0x7'));var squel=require('squel');var crypto=require(_0x0d31('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0d31('0x9'));var Papa=require(_0x0d31('0xa'));var Redis=require(_0x0d31('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x0d31('0xc'));var as=require(_0x0d31('0xd'));var hardwareService=require(_0x0d31('0xe'));var logger=require('../../config/logger')(_0x0d31('0xf'));var utils=require(_0x0d31('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0d31('0x11'))['db'];function respondWithStatusCode(_0x49bff8,_0x378eff){_0x378eff=_0x378eff||0xcc;return function(_0x17b8b0){if(_0x17b8b0){return _0x49bff8[_0x0d31('0x12')](_0x378eff);}return _0x49bff8[_0x0d31('0x13')](_0x378eff)[_0x0d31('0x14')]();};}function respondWithResult(_0x58d00b,_0x1e1082){_0x1e1082=_0x1e1082||0xc8;return function(_0x1d61a0){if(_0x1d61a0){return _0x58d00b['status'](_0x1e1082)[_0x0d31('0x15')](_0x1d61a0);}};}function respondWithFilteredResult(_0xd8c03,_0x3cc6c1){return function(_0x32dc96){if(_0x32dc96){var _0x29a324=typeof _0x3cc6c1[_0x0d31('0x16')]===_0x0d31('0x17')&&typeof _0x3cc6c1[_0x0d31('0x18')]==='undefined';var _0x40a08d=_0x32dc96['count'];var _0x3e951d=_0x29a324?0x0:_0x3cc6c1['offset'];var _0x4cb86c=_0x29a324?_0x32dc96['count']:_0x3cc6c1[_0x0d31('0x16')]+_0x3cc6c1[_0x0d31('0x18')];var _0x48df10;if(_0x4cb86c>=_0x40a08d){_0x4cb86c=_0x40a08d;_0x48df10=0xc8;}else{_0x48df10=0xce;}_0xd8c03[_0x0d31('0x13')](_0x48df10);return _0xd8c03['set']('Content-Range',_0x3e951d+'-'+_0x4cb86c+'/'+_0x40a08d)[_0x0d31('0x15')](_0x32dc96);}return null;};}function patchUpdates(_0x78c30b){return function(_0x1cf4c9){try{jsonpatch[_0x0d31('0x19')](_0x1cf4c9,_0x78c30b,!![]);}catch(_0x539b07){return BPromise['reject'](_0x539b07);}return _0x1cf4c9['save']();};}function saveUpdates(_0x3861ca,_0xd22aa3){return function(_0x15e802){if(_0x15e802){return _0x15e802['update'](_0x3861ca)[_0x0d31('0x1a')](function(_0x2461c5){return _0x2461c5;});}return null;};}function removeEntity(_0x4c56a3,_0x556e16){return function(_0x1a4c20){if(_0x1a4c20){return _0x1a4c20[_0x0d31('0x1b')]()[_0x0d31('0x1a')](function(){_0x4c56a3[_0x0d31('0x13')](0xcc)[_0x0d31('0x14')]();});}};}function handleEntityNotFound(_0x408114,_0x244b9b){return function(_0x402332){if(!_0x402332){_0x408114[_0x0d31('0x12')](0x194);}return _0x402332;};}function handleError(_0x1b2fe3,_0x367935){_0x367935=_0x367935||0x1f4;return function(_0x46af07){logger[_0x0d31('0x1c')](_0x46af07[_0x0d31('0x1d')]);if(_0x46af07[_0x0d31('0x1e')]){delete _0x46af07['name'];}_0x1b2fe3[_0x0d31('0x13')](_0x367935)[_0x0d31('0x1f')](_0x46af07);};}exports[_0x0d31('0x20')]=function(_0x5b0772,_0x495b6c){var _0xa89807={},_0x353e31={},_0x91270c={'count':0x0,'rows':[]};var _0x5d431b=_[_0x0d31('0x21')](db[_0x0d31('0x22')][_0x0d31('0x23')],function(_0x2ca57e){return{'name':_0x2ca57e[_0x0d31('0x24')],'type':_0x2ca57e[_0x0d31('0x25')][_0x0d31('0x26')]};});_0x353e31[_0x0d31('0x27')]=_[_0x0d31('0x21')](_0x5d431b,'name');_0x353e31[_0x0d31('0x28')]=_[_0x0d31('0x29')](_0x5b0772[_0x0d31('0x28')]);_0x353e31[_0x0d31('0x2a')]=_[_0x0d31('0x2b')](_0x353e31['model'],_0x353e31[_0x0d31('0x28')]);_0xa89807[_0x0d31('0x2c')]=_[_0x0d31('0x2b')](_0x353e31[_0x0d31('0x27')],qs[_0x0d31('0x2d')](_0x5b0772[_0x0d31('0x28')][_0x0d31('0x2d')]));_0xa89807['attributes']=_0xa89807[_0x0d31('0x2c')][_0x0d31('0x2e')]?_0xa89807['attributes']:_0x353e31[_0x0d31('0x27')];if(!_0x5b0772[_0x0d31('0x28')][_0x0d31('0x2f')](_0x0d31('0x30'))){_0xa89807[_0x0d31('0x18')]=qs['limit'](_0x5b0772[_0x0d31('0x28')]['limit']);_0xa89807[_0x0d31('0x16')]=qs[_0x0d31('0x16')](_0x5b0772['query'][_0x0d31('0x16')]);}_0xa89807[_0x0d31('0x31')]=qs[_0x0d31('0x32')](_0x5b0772['query']['sort']);_0xa89807[_0x0d31('0x33')]=qs['filters'](_['pick'](_0x5b0772[_0x0d31('0x28')],_0x353e31[_0x0d31('0x2a')]),_0x5d431b);if(_0x5b0772[_0x0d31('0x28')][_0x0d31('0x34')]){_0xa89807[_0x0d31('0x33')]=_[_0x0d31('0x35')](_0xa89807['where'],{'$or':_['map'](_0x5d431b,function(_0x15090c){if(_0x15090c['type']!=='VIRTUAL'){var _0x3804a3={};_0x3804a3[_0x15090c[_0x0d31('0x1e')]]={'$like':'%'+_0x5b0772['query'][_0x0d31('0x34')]+'%'};return _0x3804a3;}})});}_0xa89807=_[_0x0d31('0x35')]({},_0xa89807,_0x5b0772[_0x0d31('0x36')]);var _0x4ae475={'where':_0xa89807[_0x0d31('0x33')]};return db[_0x0d31('0x22')][_0x0d31('0x37')](_0x4ae475)[_0x0d31('0x1a')](function(_0x52a940){_0x91270c[_0x0d31('0x37')]=_0x52a940;if(_0x5b0772[_0x0d31('0x28')]['includeAll']){_0xa89807[_0x0d31('0x38')]=[{'all':!![]}];}return db[_0x0d31('0x22')]['findAll'](_0xa89807);})['then'](function(_0x1bd485){_0x91270c['rows']=_0x1bd485;return _0x91270c;})[_0x0d31('0x1a')](respondWithFilteredResult(_0x495b6c,_0xa89807))[_0x0d31('0x39')](handleError(_0x495b6c,null));};exports['show']=function(_0x26f5f3,_0x319fbc){var _0x3644f9={'raw':![],'where':{'id':_0x26f5f3[_0x0d31('0x3a')]['id']}},_0x3ea67a={};_0x3ea67a['model']=_[_0x0d31('0x29')](db[_0x0d31('0x22')][_0x0d31('0x23')]);_0x3ea67a[_0x0d31('0x28')]=_[_0x0d31('0x29')](_0x26f5f3[_0x0d31('0x28')]);_0x3ea67a[_0x0d31('0x2a')]=_[_0x0d31('0x2b')](_0x3ea67a['model'],_0x3ea67a[_0x0d31('0x28')]);_0x3644f9[_0x0d31('0x2c')]=_[_0x0d31('0x2b')](_0x3ea67a[_0x0d31('0x27')],qs['fields'](_0x26f5f3[_0x0d31('0x28')][_0x0d31('0x2d')]));_0x3644f9[_0x0d31('0x2c')]=_0x3644f9['attributes'][_0x0d31('0x2e')]?_0x3644f9[_0x0d31('0x2c')]:_0x3ea67a[_0x0d31('0x27')];if(_0x26f5f3[_0x0d31('0x28')][_0x0d31('0x3b')]){_0x3644f9[_0x0d31('0x38')]=[{'all':!![]}];}_0x3644f9=_[_0x0d31('0x35')]({},_0x3644f9,_0x26f5f3[_0x0d31('0x36')]);return db[_0x0d31('0x22')]['find'](_0x3644f9)[_0x0d31('0x1a')](handleEntityNotFound(_0x319fbc,null))[_0x0d31('0x1a')](respondWithResult(_0x319fbc,null))[_0x0d31('0x39')](handleError(_0x319fbc,null));};exports[_0x0d31('0x3c')]=function(_0x1a6b40,_0x216ca8){return db['DeskConfiguration'][_0x0d31('0x3c')](_0x1a6b40[_0x0d31('0x3d')],{})[_0x0d31('0x1a')](respondWithResult(_0x216ca8,0xc9))[_0x0d31('0x39')](handleError(_0x216ca8,null));};exports[_0x0d31('0x3e')]=function(_0x3f62b7,_0x2ed19d){if(_0x3f62b7[_0x0d31('0x3d')]['id']){delete _0x3f62b7['body']['id'];}return db[_0x0d31('0x22')][_0x0d31('0x3f')]({'where':{'id':_0x3f62b7[_0x0d31('0x3a')]['id']}})[_0x0d31('0x1a')](handleEntityNotFound(_0x2ed19d,null))[_0x0d31('0x1a')](saveUpdates(_0x3f62b7[_0x0d31('0x3d')],null))[_0x0d31('0x1a')](respondWithResult(_0x2ed19d,null))['catch'](handleError(_0x2ed19d,null));};exports[_0x0d31('0x1b')]=function(_0x159947,_0x3cbe73){return db[_0x0d31('0x22')][_0x0d31('0x3f')]({'where':{'id':_0x159947[_0x0d31('0x3a')]['id']}})[_0x0d31('0x1a')](handleEntityNotFound(_0x3cbe73,null))[_0x0d31('0x1a')](removeEntity(_0x3cbe73,null))[_0x0d31('0x39')](handleError(_0x3cbe73,null));};exports[_0x0d31('0x40')]=function(_0x63a0b5,_0x36cb5b,_0x24a74a){var _0x35eccf={};var _0x11b44a={};var _0x3f0db7;var _0x4262a3;return db[_0x0d31('0x22')][_0x0d31('0x41')]({'where':{'id':_0x63a0b5[_0x0d31('0x3a')]['id']}})['then'](handleEntityNotFound(_0x36cb5b,null))[_0x0d31('0x1a')](function(_0x3257e3){if(_0x3257e3){_0x3f0db7=_0x3257e3;_0x11b44a[_0x0d31('0x27')]=_[_0x0d31('0x29')](db[_0x0d31('0x42')][_0x0d31('0x23')]);_0x11b44a[_0x0d31('0x28')]=_[_0x0d31('0x29')](_0x63a0b5[_0x0d31('0x28')]);_0x11b44a['filters']=_[_0x0d31('0x2b')](_0x11b44a[_0x0d31('0x27')],_0x11b44a[_0x0d31('0x28')]);_0x35eccf['attributes']=_[_0x0d31('0x2b')](_0x11b44a['model'],qs['fields'](_0x63a0b5['query'][_0x0d31('0x2d')]));_0x35eccf[_0x0d31('0x2c')]=_0x35eccf[_0x0d31('0x2c')][_0x0d31('0x2e')]?_0x35eccf[_0x0d31('0x2c')]:_0x11b44a[_0x0d31('0x27')];_0x35eccf[_0x0d31('0x31')]=qs[_0x0d31('0x32')](_0x63a0b5[_0x0d31('0x28')][_0x0d31('0x32')]);_0x35eccf[_0x0d31('0x33')]=qs[_0x0d31('0x2a')](_[_0x0d31('0x43')](_0x63a0b5[_0x0d31('0x28')],_0x11b44a[_0x0d31('0x2a')]));if(_0x63a0b5[_0x0d31('0x28')][_0x0d31('0x34')]){_0x35eccf[_0x0d31('0x33')]=_[_0x0d31('0x35')](_0x35eccf['where'],{'$or':_[_0x0d31('0x21')](_0x35eccf['attributes'],function(_0x45d46b){var _0x20b306={};_0x20b306[_0x45d46b]={'$like':'%'+_0x63a0b5[_0x0d31('0x28')]['filter']+'%'};return _0x20b306;})});}_0x35eccf=_[_0x0d31('0x35')]({},_0x35eccf,_0x63a0b5['options']);return _0x3f0db7[_0x0d31('0x40')](_0x35eccf);}})['then'](function(_0x47a2cb){if(_0x47a2cb){_0x4262a3=_0x47a2cb[_0x0d31('0x2e')];if(!_0x63a0b5[_0x0d31('0x28')][_0x0d31('0x2f')](_0x0d31('0x30'))){_0x35eccf[_0x0d31('0x18')]=qs[_0x0d31('0x18')](_0x63a0b5[_0x0d31('0x28')][_0x0d31('0x18')]);_0x35eccf['offset']=qs['offset'](_0x63a0b5[_0x0d31('0x28')][_0x0d31('0x16')]);}return _0x3f0db7[_0x0d31('0x40')](_0x35eccf);}})['then'](function(_0x43bf70){if(_0x43bf70){return _0x43bf70?{'count':_0x4262a3,'rows':_0x43bf70}:null;}})['then'](respondWithResult(_0x36cb5b,null))[_0x0d31('0x39')](handleError(_0x36cb5b,null));};exports[_0x0d31('0x44')]=function(_0x43a8a5,_0x4e266b,_0x33f3f1){var _0x1c6179={};var _0x49ae45={};var _0x15e197;var _0x5d1c5c;return db['DeskConfiguration'][_0x0d31('0x41')]({'where':{'id':_0x43a8a5[_0x0d31('0x3a')]['id']}})[_0x0d31('0x1a')](handleEntityNotFound(_0x4e266b,null))['then'](function(_0x2bef57){if(_0x2bef57){_0x15e197=_0x2bef57;_0x49ae45[_0x0d31('0x27')]=_['keys'](db[_0x0d31('0x42')][_0x0d31('0x23')]);_0x49ae45[_0x0d31('0x28')]=_[_0x0d31('0x29')](_0x43a8a5[_0x0d31('0x28')]);_0x49ae45[_0x0d31('0x2a')]=_[_0x0d31('0x2b')](_0x49ae45[_0x0d31('0x27')],_0x49ae45[_0x0d31('0x28')]);_0x1c6179[_0x0d31('0x2c')]=_['intersection'](_0x49ae45[_0x0d31('0x27')],qs[_0x0d31('0x2d')](_0x43a8a5['query']['fields']));_0x1c6179[_0x0d31('0x2c')]=_0x1c6179[_0x0d31('0x2c')][_0x0d31('0x2e')]?_0x1c6179[_0x0d31('0x2c')]:_0x49ae45['model'];_0x1c6179[_0x0d31('0x31')]=qs['sort'](_0x43a8a5[_0x0d31('0x28')][_0x0d31('0x32')]);_0x1c6179[_0x0d31('0x33')]=qs[_0x0d31('0x2a')](_[_0x0d31('0x43')](_0x43a8a5[_0x0d31('0x28')],_0x49ae45[_0x0d31('0x2a')]));if(_0x43a8a5[_0x0d31('0x28')]['filter']){_0x1c6179[_0x0d31('0x33')]=_[_0x0d31('0x35')](_0x1c6179[_0x0d31('0x33')],{'$or':_['map'](_0x1c6179[_0x0d31('0x2c')],function(_0x421434){var _0x201520={};_0x201520[_0x421434]={'$like':'%'+_0x43a8a5[_0x0d31('0x28')][_0x0d31('0x34')]+'%'};return _0x201520;})});}_0x1c6179=_[_0x0d31('0x35')]({},_0x1c6179,_0x43a8a5[_0x0d31('0x36')]);return _0x15e197[_0x0d31('0x44')](_0x1c6179);}})[_0x0d31('0x1a')](function(_0x7326b2){if(_0x7326b2){_0x5d1c5c=_0x7326b2['length'];if(!_0x43a8a5[_0x0d31('0x28')][_0x0d31('0x2f')](_0x0d31('0x30'))){_0x1c6179[_0x0d31('0x18')]=qs[_0x0d31('0x18')](_0x43a8a5['query'][_0x0d31('0x18')]);_0x1c6179['offset']=qs[_0x0d31('0x16')](_0x43a8a5['query'][_0x0d31('0x16')]);}return _0x15e197['getSubjects'](_0x1c6179);}})['then'](function(_0x348d5b){if(_0x348d5b){return _0x348d5b?{'count':_0x5d1c5c,'rows':_0x348d5b}:null;}})[_0x0d31('0x1a')](respondWithResult(_0x4e266b,null))[_0x0d31('0x39')](handleError(_0x4e266b,null));};exports[_0x0d31('0x45')]=function(_0x40c693,_0x417157,_0x3143ef){var _0x5c9800={};var _0x21d1b0={};var _0x4361a4;var _0x1654c1;return db['DeskConfiguration'][_0x0d31('0x41')]({'where':{'id':_0x40c693['params']['id']}})['then'](handleEntityNotFound(_0x417157,null))['then'](function(_0x5b0aef){if(_0x5b0aef){_0x4361a4=_0x5b0aef;_0x21d1b0[_0x0d31('0x27')]=_[_0x0d31('0x29')](db[_0x0d31('0x42')][_0x0d31('0x23')]);_0x21d1b0[_0x0d31('0x28')]=_[_0x0d31('0x29')](_0x40c693[_0x0d31('0x28')]);_0x21d1b0[_0x0d31('0x2a')]=_[_0x0d31('0x2b')](_0x21d1b0['model'],_0x21d1b0[_0x0d31('0x28')]);_0x5c9800[_0x0d31('0x2c')]=_['intersection'](_0x21d1b0['model'],qs[_0x0d31('0x2d')](_0x40c693['query'][_0x0d31('0x2d')]));_0x5c9800[_0x0d31('0x2c')]=_0x5c9800[_0x0d31('0x2c')][_0x0d31('0x2e')]?_0x5c9800[_0x0d31('0x2c')]:_0x21d1b0[_0x0d31('0x27')];_0x5c9800[_0x0d31('0x31')]=qs[_0x0d31('0x32')](_0x40c693['query'][_0x0d31('0x32')]);_0x5c9800[_0x0d31('0x33')]=qs['filters'](_[_0x0d31('0x43')](_0x40c693[_0x0d31('0x28')],_0x21d1b0[_0x0d31('0x2a')]));if(_0x40c693['query'][_0x0d31('0x34')]){_0x5c9800['where']=_[_0x0d31('0x35')](_0x5c9800[_0x0d31('0x33')],{'$or':_[_0x0d31('0x21')](_0x5c9800[_0x0d31('0x2c')],function(_0x127569){var _0x49d9f4={};_0x49d9f4[_0x127569]={'$like':'%'+_0x40c693[_0x0d31('0x28')][_0x0d31('0x34')]+'%'};return _0x49d9f4;})});}_0x5c9800=_[_0x0d31('0x35')]({},_0x5c9800,_0x40c693[_0x0d31('0x36')]);return _0x4361a4['getDescriptions'](_0x5c9800);}})[_0x0d31('0x1a')](function(_0x69f58c){if(_0x69f58c){_0x1654c1=_0x69f58c['length'];if(!_0x40c693['query'][_0x0d31('0x2f')]('nolimit')){_0x5c9800[_0x0d31('0x18')]=qs['limit'](_0x40c693[_0x0d31('0x28')][_0x0d31('0x18')]);_0x5c9800['offset']=qs[_0x0d31('0x16')](_0x40c693[_0x0d31('0x28')][_0x0d31('0x16')]);}return _0x4361a4[_0x0d31('0x45')](_0x5c9800);}})[_0x0d31('0x1a')](function(_0x29517c){if(_0x29517c){return _0x29517c?{'count':_0x1654c1,'rows':_0x29517c}:null;}})[_0x0d31('0x1a')](respondWithResult(_0x417157,null))[_0x0d31('0x39')](handleError(_0x417157,null));};exports['getTags']=function(_0x573123,_0x468f94,_0x2e0564){var _0x26333c={};var _0x3b87aa={};var _0x627afe;var _0x404f75;return db['DeskConfiguration']['findOne']({'where':{'id':_0x573123[_0x0d31('0x3a')]['id']}})[_0x0d31('0x1a')](handleEntityNotFound(_0x468f94,null))['then'](function(_0x4f3bb5){if(_0x4f3bb5){_0x627afe=_0x4f3bb5;_0x3b87aa[_0x0d31('0x27')]=_['keys'](db[_0x0d31('0x46')][_0x0d31('0x23')]);_0x3b87aa['query']=_['keys'](_0x573123[_0x0d31('0x28')]);_0x3b87aa[_0x0d31('0x2a')]=_['intersection'](_0x3b87aa[_0x0d31('0x27')],_0x3b87aa['query']);_0x26333c[_0x0d31('0x2c')]=_[_0x0d31('0x2b')](_0x3b87aa['model'],qs[_0x0d31('0x2d')](_0x573123[_0x0d31('0x28')][_0x0d31('0x2d')]));_0x26333c[_0x0d31('0x2c')]=_0x26333c['attributes'][_0x0d31('0x2e')]?_0x26333c[_0x0d31('0x2c')]:_0x3b87aa[_0x0d31('0x27')];_0x26333c[_0x0d31('0x31')]=qs[_0x0d31('0x32')](_0x573123[_0x0d31('0x28')][_0x0d31('0x32')]);_0x26333c[_0x0d31('0x33')]=qs[_0x0d31('0x2a')](_['pick'](_0x573123[_0x0d31('0x28')],_0x3b87aa['filters']));if(_0x573123[_0x0d31('0x28')][_0x0d31('0x34')]){_0x26333c[_0x0d31('0x33')]=_[_0x0d31('0x35')](_0x26333c[_0x0d31('0x33')],{'$or':_[_0x0d31('0x21')](_0x26333c[_0x0d31('0x2c')],function(_0xa52313){var _0x17005b={};_0x17005b[_0xa52313]={'$like':'%'+_0x573123[_0x0d31('0x28')][_0x0d31('0x34')]+'%'};return _0x17005b;})});}_0x26333c=_[_0x0d31('0x35')]({},_0x26333c,_0x573123[_0x0d31('0x36')]);return _0x627afe[_0x0d31('0x47')](_0x26333c);}})[_0x0d31('0x1a')](function(_0x33846e){if(_0x33846e){_0x404f75=_0x33846e[_0x0d31('0x2e')];if(!_0x573123[_0x0d31('0x28')]['hasOwnProperty']('nolimit')){_0x26333c['limit']=qs['limit'](_0x573123['query']['limit']);_0x26333c[_0x0d31('0x16')]=qs['offset'](_0x573123['query'][_0x0d31('0x16')]);}return _0x627afe[_0x0d31('0x47')](_0x26333c);}})[_0x0d31('0x1a')](function(_0x5449c7){if(_0x5449c7){return _0x5449c7?{'count':_0x404f75,'rows':_0x5449c7}:null;}})[_0x0d31('0x1a')](respondWithResult(_0x468f94,null))[_0x0d31('0x39')](handleError(_0x468f94,null));};exports['setTags']=function(_0xc99548,_0x13babb,_0xfabc57){if(_0xc99548['body']['id']){delete _0xc99548[_0x0d31('0x3d')]['id'];}return db[_0x0d31('0x22')][_0x0d31('0x41')]({'where':{'id':_0xc99548[_0x0d31('0x3a')]['id']}})[_0x0d31('0x1a')](handleEntityNotFound(_0x13babb,null))[_0x0d31('0x1a')](function(_0xe5669b){if(_0xe5669b){return _0xe5669b[_0x0d31('0x48')](_0xc99548[_0x0d31('0x3d')][_0x0d31('0x49')]||[]);}return null;})[_0x0d31('0x1a')](respondWithResult(_0x13babb,null))[_0x0d31('0x39')](handleError(_0x13babb,null));};
\ No newline at end of file
+var _0x97f4=['order','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','status','end','name','DeskConfiguration','rawAttributes','key','map','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','include','rows','catch','show','params','keys','fields','includeAll','merge','options','find','create','body','getFields','findOne','DeskField'];(function(_0x2401fc,_0xbc7845){var _0x23bb42=function(_0x45a8e9){while(--_0x45a8e9){_0x2401fc['push'](_0x2401fc['shift']());}};_0x23bb42(++_0xbc7845);}(_0x97f4,0xad));var _0x497f=function(_0x4279a8,_0x5114f1){_0x4279a8=_0x4279a8-0x0;var _0x2487c1=_0x97f4[_0x4279a8];return _0x2487c1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x497f('0x0'));var zipdir=require(_0x497f('0x1'));var jsonpatch=require(_0x497f('0x2'));var rp=require('request-promise');var moment=require(_0x497f('0x3'));var BPromise=require(_0x497f('0x4'));var Mustache=require(_0x497f('0x5'));var util=require(_0x497f('0x6'));var path=require(_0x497f('0x7'));var sox=require(_0x497f('0x8'));var csv=require(_0x497f('0x9'));var ejs=require(_0x497f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x497f('0xb'));var squel=require(_0x497f('0xc'));var crypto=require(_0x497f('0xd'));var jsforce=require(_0x497f('0xe'));var deskjs=require(_0x497f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x497f('0x10'));var Papa=require('papaparse');var Redis=require(_0x497f('0x11'));var authService=require(_0x497f('0x12'));var qs=require(_0x497f('0x13'));var as=require(_0x497f('0x14'));var hardwareService=require(_0x497f('0x15'));var logger=require(_0x497f('0x16'))(_0x497f('0x17'));var utils=require(_0x497f('0x18'));var config=require(_0x497f('0x19'));var licenseUtil=require(_0x497f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x584642,_0x3ac0f4){_0x3ac0f4=_0x3ac0f4||0xcc;return function(_0x3a0da2){if(_0x3a0da2){return _0x584642[_0x497f('0x1b')](_0x3ac0f4);}return _0x584642['status'](_0x3ac0f4)['end']();};}function respondWithResult(_0x543055,_0x4092c4){_0x4092c4=_0x4092c4||0xc8;return function(_0x4a3de9){if(_0x4a3de9){return _0x543055['status'](_0x4092c4)[_0x497f('0x1c')](_0x4a3de9);}};}function respondWithFilteredResult(_0x144efe,_0x20af1d){return function(_0x4ca8f5){if(_0x4ca8f5){var _0x54fbbe=typeof _0x20af1d[_0x497f('0x1d')]===_0x497f('0x1e')&&typeof _0x20af1d[_0x497f('0x1f')]==='undefined';var _0x171aa9=_0x4ca8f5[_0x497f('0x20')];var _0x3b6957=_0x54fbbe?0x0:_0x20af1d['offset'];var _0x22e988=_0x54fbbe?_0x4ca8f5[_0x497f('0x20')]:_0x20af1d[_0x497f('0x1d')]+_0x20af1d[_0x497f('0x1f')];var _0x2195bb;if(_0x22e988>=_0x171aa9){_0x22e988=_0x171aa9;_0x2195bb=0xc8;}else{_0x2195bb=0xce;}_0x144efe['status'](_0x2195bb);return _0x144efe[_0x497f('0x21')]('Content-Range',_0x3b6957+'-'+_0x22e988+'/'+_0x171aa9)[_0x497f('0x1c')](_0x4ca8f5);}return null;};}function patchUpdates(_0x23c19e){return function(_0x5e92c5){try{jsonpatch[_0x497f('0x22')](_0x5e92c5,_0x23c19e,!![]);}catch(_0x550d05){return BPromise[_0x497f('0x23')](_0x550d05);}return _0x5e92c5[_0x497f('0x24')]();};}function saveUpdates(_0x3e186b,_0x47f2a9){return function(_0x2d9f45){if(_0x2d9f45){return _0x2d9f45[_0x497f('0x25')](_0x3e186b)[_0x497f('0x26')](function(_0x3ff55b){return _0x3ff55b;});}return null;};}function removeEntity(_0x4e9d07,_0x4d7956){return function(_0x4a689c){if(_0x4a689c){return _0x4a689c[_0x497f('0x27')]()['then'](function(){_0x4e9d07[_0x497f('0x28')](0xcc)[_0x497f('0x29')]();});}};}function handleEntityNotFound(_0x255dbf,_0x597485){return function(_0x25f196){if(!_0x25f196){_0x255dbf[_0x497f('0x1b')](0x194);}return _0x25f196;};}function handleError(_0x236d80,_0x5a30c){_0x5a30c=_0x5a30c||0x1f4;return function(_0x5e7084){logger['error'](_0x5e7084['stack']);if(_0x5e7084[_0x497f('0x2a')]){delete _0x5e7084[_0x497f('0x2a')];}_0x236d80[_0x497f('0x28')](_0x5a30c)['send'](_0x5e7084);};}exports['index']=function(_0x520a4a,_0x182de3){var _0x33725f={},_0x5348c9={},_0x9d7353={'count':0x0,'rows':[]};var _0x4df051=_['map'](db[_0x497f('0x2b')][_0x497f('0x2c')],function(_0xb7d4e4){return{'name':_0xb7d4e4['fieldName'],'type':_0xb7d4e4['type'][_0x497f('0x2d')]};});_0x5348c9['model']=_[_0x497f('0x2e')](_0x4df051,'name');_0x5348c9[_0x497f('0x2f')]=_['keys'](_0x520a4a[_0x497f('0x2f')]);_0x5348c9[_0x497f('0x30')]=_[_0x497f('0x31')](_0x5348c9[_0x497f('0x32')],_0x5348c9[_0x497f('0x2f')]);_0x33725f['attributes']=_['intersection'](_0x5348c9[_0x497f('0x32')],qs['fields'](_0x520a4a[_0x497f('0x2f')]['fields']));_0x33725f[_0x497f('0x33')]=_0x33725f[_0x497f('0x33')][_0x497f('0x34')]?_0x33725f['attributes']:_0x5348c9[_0x497f('0x32')];if(!_0x520a4a[_0x497f('0x2f')][_0x497f('0x35')](_0x497f('0x36'))){_0x33725f[_0x497f('0x1f')]=qs[_0x497f('0x1f')](_0x520a4a[_0x497f('0x2f')][_0x497f('0x1f')]);_0x33725f[_0x497f('0x1d')]=qs[_0x497f('0x1d')](_0x520a4a['query'][_0x497f('0x1d')]);}_0x33725f['order']=qs['sort'](_0x520a4a['query'][_0x497f('0x37')]);_0x33725f[_0x497f('0x38')]=qs[_0x497f('0x30')](_[_0x497f('0x39')](_0x520a4a[_0x497f('0x2f')],_0x5348c9[_0x497f('0x30')]),_0x4df051);if(_0x520a4a['query'][_0x497f('0x3a')]){_0x33725f[_0x497f('0x38')]=_['merge'](_0x33725f[_0x497f('0x38')],{'$or':_[_0x497f('0x2e')](_0x4df051,function(_0x25a448){if(_0x25a448[_0x497f('0x3b')]!=='VIRTUAL'){var _0x37f0f1={};_0x37f0f1[_0x25a448[_0x497f('0x2a')]]={'$like':'%'+_0x520a4a[_0x497f('0x2f')][_0x497f('0x3a')]+'%'};return _0x37f0f1;}})});}_0x33725f=_['merge']({},_0x33725f,_0x520a4a['options']);var _0x56b2b4={'where':_0x33725f['where']};return db['DeskConfiguration'][_0x497f('0x20')](_0x56b2b4)[_0x497f('0x26')](function(_0x541555){_0x9d7353[_0x497f('0x20')]=_0x541555;if(_0x520a4a[_0x497f('0x2f')]['includeAll']){_0x33725f[_0x497f('0x3c')]=[{'all':!![]}];}return db[_0x497f('0x2b')]['findAll'](_0x33725f);})[_0x497f('0x26')](function(_0x5bc06f){_0x9d7353[_0x497f('0x3d')]=_0x5bc06f;return _0x9d7353;})['then'](respondWithFilteredResult(_0x182de3,_0x33725f))[_0x497f('0x3e')](handleError(_0x182de3,null));};exports[_0x497f('0x3f')]=function(_0x5736c5,_0x15bd80){var _0x4588ef={'raw':![],'where':{'id':_0x5736c5[_0x497f('0x40')]['id']}},_0x511eb8={};_0x511eb8[_0x497f('0x32')]=_['keys'](db[_0x497f('0x2b')][_0x497f('0x2c')]);_0x511eb8[_0x497f('0x2f')]=_[_0x497f('0x41')](_0x5736c5[_0x497f('0x2f')]);_0x511eb8['filters']=_[_0x497f('0x31')](_0x511eb8['model'],_0x511eb8[_0x497f('0x2f')]);_0x4588ef['attributes']=_[_0x497f('0x31')](_0x511eb8[_0x497f('0x32')],qs[_0x497f('0x42')](_0x5736c5[_0x497f('0x2f')][_0x497f('0x42')]));_0x4588ef['attributes']=_0x4588ef[_0x497f('0x33')][_0x497f('0x34')]?_0x4588ef[_0x497f('0x33')]:_0x511eb8['model'];if(_0x5736c5[_0x497f('0x2f')][_0x497f('0x43')]){_0x4588ef['include']=[{'all':!![]}];}_0x4588ef=_[_0x497f('0x44')]({},_0x4588ef,_0x5736c5[_0x497f('0x45')]);return db[_0x497f('0x2b')][_0x497f('0x46')](_0x4588ef)['then'](handleEntityNotFound(_0x15bd80,null))[_0x497f('0x26')](respondWithResult(_0x15bd80,null))['catch'](handleError(_0x15bd80,null));};exports[_0x497f('0x47')]=function(_0x3b3ee7,_0x16d279){return db[_0x497f('0x2b')][_0x497f('0x47')](_0x3b3ee7['body'],{})[_0x497f('0x26')](respondWithResult(_0x16d279,0xc9))[_0x497f('0x3e')](handleError(_0x16d279,null));};exports[_0x497f('0x25')]=function(_0x42f7ea,_0xb4fb29){if(_0x42f7ea['body']['id']){delete _0x42f7ea[_0x497f('0x48')]['id'];}return db[_0x497f('0x2b')][_0x497f('0x46')]({'where':{'id':_0x42f7ea['params']['id']}})[_0x497f('0x26')](handleEntityNotFound(_0xb4fb29,null))[_0x497f('0x26')](saveUpdates(_0x42f7ea['body'],null))['then'](respondWithResult(_0xb4fb29,null))[_0x497f('0x3e')](handleError(_0xb4fb29,null));};exports[_0x497f('0x27')]=function(_0x3fe5f0,_0x53d94f){return db[_0x497f('0x2b')][_0x497f('0x46')]({'where':{'id':_0x3fe5f0[_0x497f('0x40')]['id']}})[_0x497f('0x26')](handleEntityNotFound(_0x53d94f,null))[_0x497f('0x26')](removeEntity(_0x53d94f,null))[_0x497f('0x3e')](handleError(_0x53d94f,null));};exports[_0x497f('0x49')]=function(_0x25d4a1,_0x2439ee,_0x3d6257){var _0x36c19b={};var _0x66df7={};var _0x43717a;var _0x30c681;return db[_0x497f('0x2b')][_0x497f('0x4a')]({'where':{'id':_0x25d4a1[_0x497f('0x40')]['id']}})[_0x497f('0x26')](handleEntityNotFound(_0x2439ee,null))[_0x497f('0x26')](function(_0x3994a7){if(_0x3994a7){_0x43717a=_0x3994a7;_0x66df7['model']=_[_0x497f('0x41')](db[_0x497f('0x4b')][_0x497f('0x2c')]);_0x66df7[_0x497f('0x2f')]=_['keys'](_0x25d4a1[_0x497f('0x2f')]);_0x66df7['filters']=_['intersection'](_0x66df7['model'],_0x66df7[_0x497f('0x2f')]);_0x36c19b[_0x497f('0x33')]=_[_0x497f('0x31')](_0x66df7[_0x497f('0x32')],qs[_0x497f('0x42')](_0x25d4a1[_0x497f('0x2f')]['fields']));_0x36c19b['attributes']=_0x36c19b[_0x497f('0x33')][_0x497f('0x34')]?_0x36c19b['attributes']:_0x66df7[_0x497f('0x32')];_0x36c19b[_0x497f('0x4c')]=qs['sort'](_0x25d4a1[_0x497f('0x2f')][_0x497f('0x37')]);_0x36c19b[_0x497f('0x38')]=qs[_0x497f('0x30')](_[_0x497f('0x39')](_0x25d4a1[_0x497f('0x2f')],_0x66df7[_0x497f('0x30')]));if(_0x25d4a1['query']['filter']){_0x36c19b['where']=_['merge'](_0x36c19b[_0x497f('0x38')],{'$or':_[_0x497f('0x2e')](_0x36c19b[_0x497f('0x33')],function(_0x42f153){var _0x2c61c3={};_0x2c61c3[_0x42f153]={'$like':'%'+_0x25d4a1[_0x497f('0x2f')][_0x497f('0x3a')]+'%'};return _0x2c61c3;})});}_0x36c19b=_[_0x497f('0x44')]({},_0x36c19b,_0x25d4a1[_0x497f('0x45')]);return _0x43717a[_0x497f('0x49')](_0x36c19b);}})['then'](function(_0x58e1e0){if(_0x58e1e0){_0x30c681=_0x58e1e0['length'];if(!_0x25d4a1[_0x497f('0x2f')][_0x497f('0x35')]('nolimit')){_0x36c19b[_0x497f('0x1f')]=qs[_0x497f('0x1f')](_0x25d4a1['query'][_0x497f('0x1f')]);_0x36c19b[_0x497f('0x1d')]=qs[_0x497f('0x1d')](_0x25d4a1[_0x497f('0x2f')][_0x497f('0x1d')]);}return _0x43717a['getFields'](_0x36c19b);}})['then'](function(_0x13bc7c){if(_0x13bc7c){return _0x13bc7c?{'count':_0x30c681,'rows':_0x13bc7c}:null;}})[_0x497f('0x26')](respondWithResult(_0x2439ee,null))[_0x497f('0x3e')](handleError(_0x2439ee,null));};exports['getSubjects']=function(_0x3794bf,_0x243f4a,_0x2e4979){var _0x479410={};var _0x28a3d1={};var _0x454aaa;var _0x3a4f98;return db[_0x497f('0x2b')][_0x497f('0x4a')]({'where':{'id':_0x3794bf[_0x497f('0x40')]['id']}})['then'](handleEntityNotFound(_0x243f4a,null))[_0x497f('0x26')](function(_0x37464d){if(_0x37464d){_0x454aaa=_0x37464d;_0x28a3d1[_0x497f('0x32')]=_[_0x497f('0x41')](db[_0x497f('0x4b')][_0x497f('0x2c')]);_0x28a3d1[_0x497f('0x2f')]=_[_0x497f('0x41')](_0x3794bf['query']);_0x28a3d1[_0x497f('0x30')]=_[_0x497f('0x31')](_0x28a3d1[_0x497f('0x32')],_0x28a3d1['query']);_0x479410[_0x497f('0x33')]=_[_0x497f('0x31')](_0x28a3d1[_0x497f('0x32')],qs['fields'](_0x3794bf['query']['fields']));_0x479410[_0x497f('0x33')]=_0x479410[_0x497f('0x33')][_0x497f('0x34')]?_0x479410['attributes']:_0x28a3d1[_0x497f('0x32')];_0x479410['order']=qs[_0x497f('0x37')](_0x3794bf[_0x497f('0x2f')][_0x497f('0x37')]);_0x479410[_0x497f('0x38')]=qs['filters'](_['pick'](_0x3794bf['query'],_0x28a3d1[_0x497f('0x30')]));if(_0x3794bf[_0x497f('0x2f')][_0x497f('0x3a')]){_0x479410[_0x497f('0x38')]=_[_0x497f('0x44')](_0x479410[_0x497f('0x38')],{'$or':_[_0x497f('0x2e')](_0x479410[_0x497f('0x33')],function(_0x3e8125){var _0x387602={};_0x387602[_0x3e8125]={'$like':'%'+_0x3794bf[_0x497f('0x2f')][_0x497f('0x3a')]+'%'};return _0x387602;})});}_0x479410=_[_0x497f('0x44')]({},_0x479410,_0x3794bf[_0x497f('0x45')]);return _0x454aaa[_0x497f('0x4d')](_0x479410);}})[_0x497f('0x26')](function(_0x6ed162){if(_0x6ed162){_0x3a4f98=_0x6ed162[_0x497f('0x34')];if(!_0x3794bf['query'][_0x497f('0x35')](_0x497f('0x36'))){_0x479410[_0x497f('0x1f')]=qs['limit'](_0x3794bf[_0x497f('0x2f')][_0x497f('0x1f')]);_0x479410[_0x497f('0x1d')]=qs[_0x497f('0x1d')](_0x3794bf[_0x497f('0x2f')][_0x497f('0x1d')]);}return _0x454aaa[_0x497f('0x4d')](_0x479410);}})[_0x497f('0x26')](function(_0x1de194){if(_0x1de194){return _0x1de194?{'count':_0x3a4f98,'rows':_0x1de194}:null;}})[_0x497f('0x26')](respondWithResult(_0x243f4a,null))[_0x497f('0x3e')](handleError(_0x243f4a,null));};exports[_0x497f('0x4e')]=function(_0x3aee19,_0x2507b7,_0x62d73){var _0x4c932e={};var _0x8d5233={};var _0x6704a8;var _0x579393;return db[_0x497f('0x2b')][_0x497f('0x4a')]({'where':{'id':_0x3aee19[_0x497f('0x40')]['id']}})[_0x497f('0x26')](handleEntityNotFound(_0x2507b7,null))[_0x497f('0x26')](function(_0x4edca6){if(_0x4edca6){_0x6704a8=_0x4edca6;_0x8d5233[_0x497f('0x32')]=_[_0x497f('0x41')](db[_0x497f('0x4b')][_0x497f('0x2c')]);_0x8d5233['query']=_[_0x497f('0x41')](_0x3aee19[_0x497f('0x2f')]);_0x8d5233[_0x497f('0x30')]=_[_0x497f('0x31')](_0x8d5233[_0x497f('0x32')],_0x8d5233['query']);_0x4c932e[_0x497f('0x33')]=_[_0x497f('0x31')](_0x8d5233['model'],qs[_0x497f('0x42')](_0x3aee19['query'][_0x497f('0x42')]));_0x4c932e[_0x497f('0x33')]=_0x4c932e[_0x497f('0x33')][_0x497f('0x34')]?_0x4c932e[_0x497f('0x33')]:_0x8d5233[_0x497f('0x32')];_0x4c932e[_0x497f('0x4c')]=qs['sort'](_0x3aee19[_0x497f('0x2f')][_0x497f('0x37')]);_0x4c932e[_0x497f('0x38')]=qs['filters'](_[_0x497f('0x39')](_0x3aee19[_0x497f('0x2f')],_0x8d5233[_0x497f('0x30')]));if(_0x3aee19['query'][_0x497f('0x3a')]){_0x4c932e[_0x497f('0x38')]=_[_0x497f('0x44')](_0x4c932e[_0x497f('0x38')],{'$or':_[_0x497f('0x2e')](_0x4c932e[_0x497f('0x33')],function(_0x16be8b){var _0x5b1d6e={};_0x5b1d6e[_0x16be8b]={'$like':'%'+_0x3aee19[_0x497f('0x2f')][_0x497f('0x3a')]+'%'};return _0x5b1d6e;})});}_0x4c932e=_['merge']({},_0x4c932e,_0x3aee19[_0x497f('0x45')]);return _0x6704a8['getDescriptions'](_0x4c932e);}})[_0x497f('0x26')](function(_0x1147cd){if(_0x1147cd){_0x579393=_0x1147cd[_0x497f('0x34')];if(!_0x3aee19[_0x497f('0x2f')][_0x497f('0x35')](_0x497f('0x36'))){_0x4c932e['limit']=qs[_0x497f('0x1f')](_0x3aee19[_0x497f('0x2f')][_0x497f('0x1f')]);_0x4c932e[_0x497f('0x1d')]=qs['offset'](_0x3aee19['query'][_0x497f('0x1d')]);}return _0x6704a8[_0x497f('0x4e')](_0x4c932e);}})[_0x497f('0x26')](function(_0x42d808){if(_0x42d808){return _0x42d808?{'count':_0x579393,'rows':_0x42d808}:null;}})[_0x497f('0x26')](respondWithResult(_0x2507b7,null))['catch'](handleError(_0x2507b7,null));};exports[_0x497f('0x4f')]=function(_0xd90546,_0x5306e0,_0x5e999d){var _0x50a403={};var _0x9a0793={};var _0x1db223;var _0x44fa81;return db[_0x497f('0x2b')]['findOne']({'where':{'id':_0xd90546[_0x497f('0x40')]['id']}})[_0x497f('0x26')](handleEntityNotFound(_0x5306e0,null))[_0x497f('0x26')](function(_0x42a5ee){if(_0x42a5ee){_0x1db223=_0x42a5ee;_0x9a0793['model']=_[_0x497f('0x41')](db[_0x497f('0x50')][_0x497f('0x2c')]);_0x9a0793[_0x497f('0x2f')]=_[_0x497f('0x41')](_0xd90546[_0x497f('0x2f')]);_0x9a0793[_0x497f('0x30')]=_[_0x497f('0x31')](_0x9a0793[_0x497f('0x32')],_0x9a0793['query']);_0x50a403['attributes']=_[_0x497f('0x31')](_0x9a0793[_0x497f('0x32')],qs[_0x497f('0x42')](_0xd90546[_0x497f('0x2f')][_0x497f('0x42')]));_0x50a403[_0x497f('0x33')]=_0x50a403[_0x497f('0x33')][_0x497f('0x34')]?_0x50a403[_0x497f('0x33')]:_0x9a0793[_0x497f('0x32')];_0x50a403['order']=qs[_0x497f('0x37')](_0xd90546[_0x497f('0x2f')][_0x497f('0x37')]);_0x50a403[_0x497f('0x38')]=qs[_0x497f('0x30')](_[_0x497f('0x39')](_0xd90546[_0x497f('0x2f')],_0x9a0793[_0x497f('0x30')]));if(_0xd90546[_0x497f('0x2f')][_0x497f('0x3a')]){_0x50a403['where']=_[_0x497f('0x44')](_0x50a403['where'],{'$or':_[_0x497f('0x2e')](_0x50a403['attributes'],function(_0x46d420){var _0x18be8d={};_0x18be8d[_0x46d420]={'$like':'%'+_0xd90546[_0x497f('0x2f')][_0x497f('0x3a')]+'%'};return _0x18be8d;})});}_0x50a403=_['merge']({},_0x50a403,_0xd90546[_0x497f('0x45')]);return _0x1db223[_0x497f('0x4f')](_0x50a403);}})['then'](function(_0x2a62c9){if(_0x2a62c9){_0x44fa81=_0x2a62c9['length'];if(!_0xd90546[_0x497f('0x2f')][_0x497f('0x35')](_0x497f('0x36'))){_0x50a403[_0x497f('0x1f')]=qs[_0x497f('0x1f')](_0xd90546[_0x497f('0x2f')][_0x497f('0x1f')]);_0x50a403[_0x497f('0x1d')]=qs[_0x497f('0x1d')](_0xd90546['query'][_0x497f('0x1d')]);}return _0x1db223[_0x497f('0x4f')](_0x50a403);}})[_0x497f('0x26')](function(_0x3fc257){if(_0x3fc257){return _0x3fc257?{'count':_0x44fa81,'rows':_0x3fc257}:null;}})['then'](respondWithResult(_0x5306e0,null))['catch'](handleError(_0x5306e0,null));};exports[_0x497f('0x51')]=function(_0x4f8329,_0x2f5608,_0x5e4b63){if(_0x4f8329[_0x497f('0x48')]['id']){delete _0x4f8329[_0x497f('0x48')]['id'];}return db[_0x497f('0x2b')]['findOne']({'where':{'id':_0x4f8329[_0x497f('0x40')]['id']}})[_0x497f('0x26')](handleEntityNotFound(_0x2f5608,null))[_0x497f('0x26')](function(_0x343870){if(_0x343870){return _0x343870[_0x497f('0x51')](_0x4f8329[_0x497f('0x48')][_0x497f('0x52')]||[]);}return null;})[_0x497f('0x26')](respondWithResult(_0x2f5608,null))[_0x497f('0x3e')](handleError(_0x2f5608,null));};
\ No newline at end of file
index 676f7b5..bc43b5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xada7=['DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x211f66,_0x6d409f){var _0x324240=function(_0x5b0c0e){while(--_0x5b0c0e){_0x211f66['push'](_0x211f66['shift']());}};_0x324240(++_0x6d409f);}(_0xada7,0x1ee));var _0x7ada=function(_0xb7ee51,_0x3c0943){_0xb7ee51=_0xb7ee51-0x0;var _0x156daf=_0xada7[_0xb7ee51];return _0x156daf;};'use strict';var _=require(_0x7ada('0x0'));var util=require(_0x7ada('0x1'));var logger=require(_0x7ada('0x2'))(_0x7ada('0x3'));var moment=require('moment');var BPromise=require(_0x7ada('0x4'));var rp=require(_0x7ada('0x5'));var fs=require('fs');var path=require(_0x7ada('0x6'));var rimraf=require(_0x7ada('0x7'));var config=require(_0x7ada('0x8'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0xdd89f4,_0x55584a){return _0xdd89f4[_0x7ada('0x9')](_0x7ada('0xa'),attributes,{'tableName':_0x7ada('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xef44=['path','rimraf','exports','define','DeskConfiguration','int_desk_configurations','lodash','api','moment','bluebird','request-promise'];(function(_0x536c66,_0x570b6b){var _0x221d57=function(_0x34af51){while(--_0x34af51){_0x536c66['push'](_0x536c66['shift']());}};_0x221d57(++_0x570b6b);}(_0xef44,0x74));var _0x4ef4=function(_0xded5e5,_0x12476e){_0xded5e5=_0xded5e5-0x0;var _0x5e5bc7=_0xef44[_0xded5e5];return _0x5e5bc7;};'use strict';var _=require(_0x4ef4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4ef4('0x1'));var moment=require(_0x4ef4('0x2'));var BPromise=require(_0x4ef4('0x3'));var rp=require(_0x4ef4('0x4'));var fs=require('fs');var path=require(_0x4ef4('0x5'));var rimraf=require(_0x4ef4('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskConfiguration.attributes');module[_0x4ef4('0x7')]=function(_0x2c58e5,_0x46cd6e){return _0x2c58e5[_0x4ef4('0x8')](_0x4ef4('0x9'),attributes,{'tableName':_0x4ef4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 76b8d48..9c81d61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0a6=['../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x576cbd,_0x5b7dc0){var _0x3980ef=function(_0x3dca24){while(--_0x3dca24){_0x576cbd['push'](_0x576cbd['shift']());}};_0x3980ef(++_0x5b7dc0);}(_0xc0a6,0xcb));var _0x6c0a=function(_0x2017e7,_0x162b36){_0x2017e7=_0x2017e7-0x0;var _0xf24239=_0xc0a6[_0x2017e7];return _0xf24239;};'use strict';var _=require(_0x6c0a('0x0'));var util=require(_0x6c0a('0x1'));var moment=require('moment');var BPromise=require(_0x6c0a('0x2'));var rs=require(_0x6c0a('0x3'));var fs=require('fs');var Redis=require(_0x6c0a('0x4'));var db=require(_0x6c0a('0x5'))['db'];var utils=require(_0x6c0a('0x6'));var logger=require(_0x6c0a('0x7'))(_0x6c0a('0x8'));var config=require(_0x6c0a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6c0a('0xa')][_0x6c0a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x416ceb,_0x415ded,_0x48695b){return new BPromise(function(_0x344873,_0x40098b){return client['request'](_0x416ceb,_0x48695b)[_0x6c0a('0xc')](function(_0x4f133c){logger[_0x6c0a('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x415ded,'request\x20sent');logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x415ded,_0x6c0a('0xe'),JSON['stringify'](_0x4f133c));if(_0x4f133c[_0x6c0a('0xf')]){if(_0x4f133c[_0x6c0a('0xf')][_0x6c0a('0x10')]===0x1f4){logger['error'](_0x6c0a('0x11'),_0x415ded,_0x4f133c[_0x6c0a('0xf')][_0x6c0a('0x12')]);return _0x40098b(_0x4f133c[_0x6c0a('0xf')][_0x6c0a('0x12')]);}logger[_0x6c0a('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x415ded,_0x4f133c[_0x6c0a('0xf')][_0x6c0a('0x12')]);return _0x344873(_0x4f133c[_0x6c0a('0xf')][_0x6c0a('0x12')]);}else{logger[_0x6c0a('0xd')](_0x6c0a('0x11'),_0x415ded,_0x6c0a('0xe'));_0x344873(_0x4f133c[_0x6c0a('0x13')][_0x6c0a('0x12')]);}})[_0x6c0a('0x14')](function(_0x140803){logger[_0x6c0a('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x415ded,_0x140803);_0x40098b(_0x140803);});});}
\ No newline at end of file
+var _0x3ce9=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','DeskConfiguration,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x28868f,_0x23d430){var _0x5b1ec5=function(_0x23c909){while(--_0x23c909){_0x28868f['push'](_0x28868f['shift']());}};_0x5b1ec5(++_0x23d430);}(_0x3ce9,0x85));var _0x93ce=function(_0x16bb39,_0x293e15){_0x16bb39=_0x16bb39-0x0;var _0x3daba8=_0x3ce9[_0x16bb39];return _0x3daba8;};'use strict';var _=require(_0x93ce('0x0'));var util=require('util');var moment=require(_0x93ce('0x1'));var BPromise=require(_0x93ce('0x2'));var rs=require(_0x93ce('0x3'));var fs=require('fs');var Redis=require(_0x93ce('0x4'));var db=require(_0x93ce('0x5'))['db'];var utils=require(_0x93ce('0x6'));var logger=require('../../config/logger')(_0x93ce('0x7'));var config=require(_0x93ce('0x8'));var jayson=require(_0x93ce('0x9'));var client=jayson[_0x93ce('0xa')][_0x93ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55bf0f,_0x2f183d,_0xf3f61){return new BPromise(function(_0x4a112a,_0x5605fe){return client['request'](_0x55bf0f,_0xf3f61)[_0x93ce('0xc')](function(_0x5e3f70){logger[_0x93ce('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x2f183d,_0x93ce('0xe'));logger['debug'](_0x93ce('0xf'),_0x2f183d,'request\x20sent',JSON['stringify'](_0x5e3f70));if(_0x5e3f70['error']){if(_0x5e3f70['error']['code']===0x1f4){logger[_0x93ce('0x10')](_0x93ce('0x11'),_0x2f183d,_0x5e3f70[_0x93ce('0x10')]['message']);return _0x5605fe(_0x5e3f70[_0x93ce('0x10')]['message']);}logger[_0x93ce('0x10')](_0x93ce('0x11'),_0x2f183d,_0x5e3f70['error']['message']);return _0x4a112a(_0x5e3f70[_0x93ce('0x10')]['message']);}else{logger[_0x93ce('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x2f183d,_0x93ce('0xe'));_0x4a112a(_0x5e3f70['result'][_0x93ce('0x12')]);}})[_0x93ce('0x13')](function(_0x991fb){logger[_0x93ce('0x10')](_0x93ce('0x11'),_0x2f183d,_0x991fb);_0x5605fe(_0x991fb);});});}
\ No newline at end of file
index 212e897..a2fd1a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x058b=['update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','show','post','create','put','/:id'];(function(_0x6207ee,_0xad583){var _0x5924cd=function(_0x21b7cf){while(--_0x21b7cf){_0x6207ee['push'](_0x6207ee['shift']());}};_0x5924cd(++_0xad583);}(_0x058b,0x148));var _0xb058=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x058b[_0x279d37];return _0x530173;};'use strict';var multer=require(_0xb058('0x0'));var util=require(_0xb058('0x1'));var path=require(_0xb058('0x2'));var timeout=require(_0xb058('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb058('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb058('0x5'));var config=require('../../config/environment');var controller=require(_0xb058('0x6'));router[_0xb058('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xb058('0x8')](),controller[_0xb058('0x9')]);router[_0xb058('0xa')]('/',auth[_0xb058('0x8')](),controller[_0xb058('0xb')]);router[_0xb058('0xc')](_0xb058('0xd'),auth[_0xb058('0x8')](),controller[_0xb058('0xe')]);router[_0xb058('0xf')](_0xb058('0xd'),auth[_0xb058('0x8')](),controller[_0xb058('0x10')]);module[_0xb058('0x11')]=router;
\ No newline at end of file
+var _0xe0e8=['../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','show','post','put','/:id','update','destroy','multer','path','express','Router','fs-extra'];(function(_0x14fe35,_0x1e9d16){var _0x3c0e11=function(_0x58b28b){while(--_0x58b28b){_0x14fe35['push'](_0x14fe35['shift']());}};_0x3c0e11(++_0x1e9d16);}(_0xe0e8,0xe9));var _0x8e0e=function(_0x19ea20,_0x499329){_0x19ea20=_0x19ea20-0x0;var _0x2c724c=_0xe0e8[_0x19ea20];return _0x2c724c;};'use strict';var multer=require(_0x8e0e('0x0'));var util=require('util');var path=require(_0x8e0e('0x1'));var timeout=require('connect-timeout');var express=require(_0x8e0e('0x2'));var router=express[_0x8e0e('0x3')]();var fs_extra=require(_0x8e0e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8e0e('0x5'));var config=require(_0x8e0e('0x6'));var controller=require(_0x8e0e('0x7'));router[_0x8e0e('0x8')]('/',auth[_0x8e0e('0x9')](),controller[_0x8e0e('0xa')]);router[_0x8e0e('0x8')]('/:id',auth[_0x8e0e('0x9')](),controller[_0x8e0e('0xb')]);router[_0x8e0e('0xc')]('/',auth[_0x8e0e('0x9')](),controller['create']);router[_0x8e0e('0xd')](_0x8e0e('0xe'),auth['isAuthenticated'](),controller[_0x8e0e('0xf')]);router['delete'](_0x8e0e('0xe'),auth[_0x8e0e('0x9')](),controller[_0x8e0e('0x10')]);module['exports']=router;
\ No newline at end of file
index 90845c0..ca40106 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dad=['STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x31e58e,_0x407db4){var _0x26de26=function(_0x479974){while(--_0x479974){_0x31e58e['push'](_0x31e58e['shift']());}};_0x26de26(++_0x407db4);}(_0x4dad,0x173));var _0xd4da=function(_0x523ebe,_0x3e66aa){_0x523ebe=_0x523ebe-0x0;var _0xcab428=_0x4dad[_0x523ebe];return _0xcab428;};'use strict';var Sequelize=require(_0xd4da('0x0'));module['exports']={'type':{'type':Sequelize[_0xd4da('0x1')](_0xd4da('0x2'),_0xd4da('0x3'),_0xd4da('0x4'),_0xd4da('0x5'),_0xd4da('0x6')),'defaultValue':_0xd4da('0x2')},'content':{'type':Sequelize[_0xd4da('0x7')]},'key':{'type':Sequelize[_0xd4da('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xd4da('0x2'),_0xd4da('0x3'),_0xd4da('0x4'))},'keyContent':{'type':Sequelize[_0xd4da('0x7')]},'idField':{'type':Sequelize[_0xd4da('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd4da('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x56d3=['picklist','STRING','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0x5436e7,_0x4d6a4b){var _0x60863d=function(_0x46f81d){while(--_0x46f81d){_0x5436e7['push'](_0x5436e7['shift']());}};_0x60863d(++_0x4d6a4b);}(_0x56d3,0x92));var _0x356d=function(_0x25a536,_0x3d172a){_0x25a536=_0x25a536-0x0;var _0x55c706=_0x56d3[_0x25a536];return _0x55c706;};'use strict';var Sequelize=require(_0x356d('0x0'));module[_0x356d('0x1')]={'type':{'type':Sequelize[_0x356d('0x2')](_0x356d('0x3'),_0x356d('0x4'),'customVariable',_0x356d('0x5'),_0x356d('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x356d('0x7')]},'key':{'type':Sequelize[_0x356d('0x7')]},'keyType':{'type':Sequelize[_0x356d('0x2')](_0x356d('0x3'),_0x356d('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x356d('0x7')]},'idField':{'type':Sequelize[_0x356d('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index b950cbc..46b0f5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd33=['params','rawAttributes','includeAll','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','then','destroy','error','stack','name','send','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','DeskField','include','findAll','catch'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xbd33,0x13b));var _0x3bd3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbd33[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x3bd3('0x0'));var rimraf=require(_0x3bd3('0x1'));var zipdir=require(_0x3bd3('0x2'));var jsonpatch=require(_0x3bd3('0x3'));var rp=require('request-promise');var moment=require(_0x3bd3('0x4'));var BPromise=require(_0x3bd3('0x5'));var Mustache=require(_0x3bd3('0x6'));var util=require(_0x3bd3('0x7'));var path=require('path');var sox=require(_0x3bd3('0x8'));var csv=require('to-csv');var ejs=require(_0x3bd3('0x9'));var fs=require('fs');var fs_extra=require(_0x3bd3('0xa'));var _=require(_0x3bd3('0xb'));var squel=require(_0x3bd3('0xc'));var crypto=require(_0x3bd3('0xd'));var jsforce=require(_0x3bd3('0xe'));var deskjs=require(_0x3bd3('0xf'));var toCsv=require(_0x3bd3('0x10'));var querystring=require(_0x3bd3('0x11'));var Papa=require(_0x3bd3('0x12'));var Redis=require(_0x3bd3('0x13'));var authService=require(_0x3bd3('0x14'));var qs=require(_0x3bd3('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3bd3('0x16'));var logger=require('../../config/logger')(_0x3bd3('0x17'));var utils=require(_0x3bd3('0x18'));var config=require(_0x3bd3('0x19'));var licenseUtil=require(_0x3bd3('0x1a'));var db=require(_0x3bd3('0x1b'))['db'];function respondWithStatusCode(_0x2330d0,_0x252372){_0x252372=_0x252372||0xcc;return function(_0x50d458){if(_0x50d458){return _0x2330d0[_0x3bd3('0x1c')](_0x252372);}return _0x2330d0[_0x3bd3('0x1d')](_0x252372)[_0x3bd3('0x1e')]();};}function respondWithResult(_0x3da957,_0x5634ce){_0x5634ce=_0x5634ce||0xc8;return function(_0x3ef9c5){if(_0x3ef9c5){return _0x3da957[_0x3bd3('0x1d')](_0x5634ce)[_0x3bd3('0x1f')](_0x3ef9c5);}};}function respondWithFilteredResult(_0x504bf7,_0x4e33fa){return function(_0x83b347){if(_0x83b347){var _0x3fb916=typeof _0x4e33fa[_0x3bd3('0x20')]==='undefined'&&typeof _0x4e33fa[_0x3bd3('0x21')]===_0x3bd3('0x22');var _0x4d5e0d=_0x83b347['count'];var _0x490982=_0x3fb916?0x0:_0x4e33fa[_0x3bd3('0x20')];var _0x192a6c=_0x3fb916?_0x83b347[_0x3bd3('0x23')]:_0x4e33fa[_0x3bd3('0x20')]+_0x4e33fa[_0x3bd3('0x21')];var _0x1172d9;if(_0x192a6c>=_0x4d5e0d){_0x192a6c=_0x4d5e0d;_0x1172d9=0xc8;}else{_0x1172d9=0xce;}_0x504bf7[_0x3bd3('0x1d')](_0x1172d9);return _0x504bf7[_0x3bd3('0x24')]('Content-Range',_0x490982+'-'+_0x192a6c+'/'+_0x4d5e0d)[_0x3bd3('0x1f')](_0x83b347);}return null;};}function patchUpdates(_0x3cab78){return function(_0x3d84a2){try{jsonpatch[_0x3bd3('0x25')](_0x3d84a2,_0x3cab78,!![]);}catch(_0xb93021){return BPromise[_0x3bd3('0x26')](_0xb93021);}return _0x3d84a2['save']();};}function saveUpdates(_0x48c711,_0x1f6841){return function(_0x44efcf){if(_0x44efcf){return _0x44efcf['update'](_0x48c711)[_0x3bd3('0x27')](function(_0x52f7d2){return _0x52f7d2;});}return null;};}function removeEntity(_0x13a8d3,_0x4664b9){return function(_0x53f289){if(_0x53f289){return _0x53f289[_0x3bd3('0x28')]()['then'](function(){_0x13a8d3['status'](0xcc)[_0x3bd3('0x1e')]();});}};}function handleEntityNotFound(_0x411f91,_0xc80dee){return function(_0x26916f){if(!_0x26916f){_0x411f91['sendStatus'](0x194);}return _0x26916f;};}function handleError(_0xaf0338,_0x27024b){_0x27024b=_0x27024b||0x1f4;return function(_0x409144){logger[_0x3bd3('0x29')](_0x409144[_0x3bd3('0x2a')]);if(_0x409144['name']){delete _0x409144[_0x3bd3('0x2b')];}_0xaf0338['status'](_0x27024b)[_0x3bd3('0x2c')](_0x409144);};}exports['index']=function(_0x1637c4,_0x9f3366){var _0x3c0199={},_0x24d757={},_0x3cef23={'count':0x0,'rows':[]};var _0x4fc91b=_[_0x3bd3('0x2d')](db['DeskField']['rawAttributes'],function(_0x13b808){return{'name':_0x13b808[_0x3bd3('0x2e')],'type':_0x13b808[_0x3bd3('0x2f')][_0x3bd3('0x30')]};});_0x24d757['model']=_['map'](_0x4fc91b,_0x3bd3('0x2b'));_0x24d757[_0x3bd3('0x31')]=_[_0x3bd3('0x32')](_0x1637c4['query']);_0x24d757[_0x3bd3('0x33')]=_[_0x3bd3('0x34')](_0x24d757['model'],_0x24d757[_0x3bd3('0x31')]);_0x3c0199['attributes']=_['intersection'](_0x24d757[_0x3bd3('0x35')],qs[_0x3bd3('0x36')](_0x1637c4[_0x3bd3('0x31')][_0x3bd3('0x36')]));_0x3c0199[_0x3bd3('0x37')]=_0x3c0199['attributes'][_0x3bd3('0x38')]?_0x3c0199[_0x3bd3('0x37')]:_0x24d757[_0x3bd3('0x35')];if(!_0x1637c4[_0x3bd3('0x31')][_0x3bd3('0x39')](_0x3bd3('0x3a'))){_0x3c0199[_0x3bd3('0x21')]=qs[_0x3bd3('0x21')](_0x1637c4['query']['limit']);_0x3c0199['offset']=qs['offset'](_0x1637c4[_0x3bd3('0x31')][_0x3bd3('0x20')]);}_0x3c0199[_0x3bd3('0x3b')]=qs[_0x3bd3('0x3c')](_0x1637c4[_0x3bd3('0x31')]['sort']);_0x3c0199[_0x3bd3('0x3d')]=qs[_0x3bd3('0x33')](_['pick'](_0x1637c4[_0x3bd3('0x31')],_0x24d757['filters']),_0x4fc91b);if(_0x1637c4[_0x3bd3('0x31')][_0x3bd3('0x3e')]){_0x3c0199[_0x3bd3('0x3d')]=_['merge'](_0x3c0199[_0x3bd3('0x3d')],{'$or':_[_0x3bd3('0x2d')](_0x4fc91b,function(_0x1540a2){if(_0x1540a2[_0x3bd3('0x2f')]!==_0x3bd3('0x3f')){var _0x37d9a0={};_0x37d9a0[_0x1540a2[_0x3bd3('0x2b')]]={'$like':'%'+_0x1637c4['query'][_0x3bd3('0x3e')]+'%'};return _0x37d9a0;}})});}_0x3c0199=_[_0x3bd3('0x40')]({},_0x3c0199,_0x1637c4[_0x3bd3('0x41')]);var _0x18a622={'where':_0x3c0199[_0x3bd3('0x3d')]};return db[_0x3bd3('0x42')][_0x3bd3('0x23')](_0x18a622)[_0x3bd3('0x27')](function(_0x2f6231){_0x3cef23['count']=_0x2f6231;if(_0x1637c4[_0x3bd3('0x31')]['includeAll']){_0x3c0199[_0x3bd3('0x43')]=[{'all':!![]}];}return db[_0x3bd3('0x42')][_0x3bd3('0x44')](_0x3c0199);})[_0x3bd3('0x27')](function(_0x24a0c6){_0x3cef23['rows']=_0x24a0c6;return _0x3cef23;})[_0x3bd3('0x27')](respondWithFilteredResult(_0x9f3366,_0x3c0199))[_0x3bd3('0x45')](handleError(_0x9f3366,null));};exports['show']=function(_0x4614fa,_0xe1317){var _0x57a59f={'raw':!![],'where':{'id':_0x4614fa[_0x3bd3('0x46')]['id']}},_0x1eb143={};_0x1eb143[_0x3bd3('0x35')]=_[_0x3bd3('0x32')](db[_0x3bd3('0x42')][_0x3bd3('0x47')]);_0x1eb143[_0x3bd3('0x31')]=_[_0x3bd3('0x32')](_0x4614fa[_0x3bd3('0x31')]);_0x1eb143[_0x3bd3('0x33')]=_[_0x3bd3('0x34')](_0x1eb143[_0x3bd3('0x35')],_0x1eb143['query']);_0x57a59f['attributes']=_['intersection'](_0x1eb143[_0x3bd3('0x35')],qs['fields'](_0x4614fa[_0x3bd3('0x31')][_0x3bd3('0x36')]));_0x57a59f[_0x3bd3('0x37')]=_0x57a59f[_0x3bd3('0x37')]['length']?_0x57a59f[_0x3bd3('0x37')]:_0x1eb143[_0x3bd3('0x35')];if(_0x4614fa[_0x3bd3('0x31')][_0x3bd3('0x48')]){_0x57a59f[_0x3bd3('0x43')]=[{'all':!![]}];}_0x57a59f=_[_0x3bd3('0x40')]({},_0x57a59f,_0x4614fa[_0x3bd3('0x41')]);return db[_0x3bd3('0x42')][_0x3bd3('0x49')](_0x57a59f)[_0x3bd3('0x27')](handleEntityNotFound(_0xe1317,null))['then'](respondWithResult(_0xe1317,null))[_0x3bd3('0x45')](handleError(_0xe1317,null));};exports[_0x3bd3('0x4a')]=function(_0x6055f1,_0xdd7b8){return db[_0x3bd3('0x42')][_0x3bd3('0x4a')](_0x6055f1[_0x3bd3('0x4b')],{})[_0x3bd3('0x27')](respondWithResult(_0xdd7b8,0xc9))[_0x3bd3('0x45')](handleError(_0xdd7b8,null));};exports[_0x3bd3('0x4c')]=function(_0x3b6270,_0x48151b){if(_0x3b6270['body']['id']){delete _0x3b6270[_0x3bd3('0x4b')]['id'];}return db[_0x3bd3('0x42')]['find']({'where':{'id':_0x3b6270[_0x3bd3('0x46')]['id']}})[_0x3bd3('0x27')](handleEntityNotFound(_0x48151b,null))[_0x3bd3('0x27')](saveUpdates(_0x3b6270[_0x3bd3('0x4b')],null))[_0x3bd3('0x27')](respondWithResult(_0x48151b,null))['catch'](handleError(_0x48151b,null));};exports[_0x3bd3('0x28')]=function(_0x300c33,_0x4469db){return db['DeskField'][_0x3bd3('0x49')]({'where':{'id':_0x300c33[_0x3bd3('0x46')]['id']}})[_0x3bd3('0x27')](handleEntityNotFound(_0x4469db,null))[_0x3bd3('0x27')](removeEntity(_0x4469db,null))[_0x3bd3('0x45')](handleError(_0x4469db,null));};
\ No newline at end of file
+var _0x19d0=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply','then','destroy','end','error','stack','name','send','index','map','DeskField','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','show','params','filters','length','includeAll','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x19d0,0xd9));var _0x019d=function(_0x981201,_0x2e8c36){_0x981201=_0x981201-0x0;var _0x252b8c=_0x19d0[_0x981201];return _0x252b8c;};'use strict';var emlformat=require(_0x019d('0x0'));var rimraf=require(_0x019d('0x1'));var zipdir=require(_0x019d('0x2'));var jsonpatch=require(_0x019d('0x3'));var rp=require(_0x019d('0x4'));var moment=require(_0x019d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x019d('0x6'));var util=require(_0x019d('0x7'));var path=require(_0x019d('0x8'));var sox=require(_0x019d('0x9'));var csv=require(_0x019d('0xa'));var ejs=require(_0x019d('0xb'));var fs=require('fs');var fs_extra=require(_0x019d('0xc'));var _=require(_0x019d('0xd'));var squel=require(_0x019d('0xe'));var crypto=require(_0x019d('0xf'));var jsforce=require(_0x019d('0x10'));var deskjs=require(_0x019d('0x11'));var toCsv=require(_0x019d('0xa'));var querystring=require(_0x019d('0x12'));var Papa=require(_0x019d('0x13'));var Redis=require(_0x019d('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x019d('0x15'));var as=require(_0x019d('0x16'));var hardwareService=require(_0x019d('0x17'));var logger=require(_0x019d('0x18'))(_0x019d('0x19'));var utils=require(_0x019d('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x019d('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2be9b6,_0x567bdb){_0x567bdb=_0x567bdb||0xcc;return function(_0x2f5a54){if(_0x2f5a54){return _0x2be9b6[_0x019d('0x1c')](_0x567bdb);}return _0x2be9b6[_0x019d('0x1d')](_0x567bdb)['end']();};}function respondWithResult(_0x5d20ac,_0x9d1131){_0x9d1131=_0x9d1131||0xc8;return function(_0xa3fb88){if(_0xa3fb88){return _0x5d20ac['status'](_0x9d1131)[_0x019d('0x1e')](_0xa3fb88);}};}function respondWithFilteredResult(_0x554384,_0x5d0e2b){return function(_0x1ebd56){if(_0x1ebd56){var _0x4a449e=typeof _0x5d0e2b['offset']===_0x019d('0x1f')&&typeof _0x5d0e2b[_0x019d('0x20')]==='undefined';var _0x19951a=_0x1ebd56['count'];var _0x1af39f=_0x4a449e?0x0:_0x5d0e2b[_0x019d('0x21')];var _0x27bb54=_0x4a449e?_0x1ebd56['count']:_0x5d0e2b[_0x019d('0x21')]+_0x5d0e2b[_0x019d('0x20')];var _0x1ffe29;if(_0x27bb54>=_0x19951a){_0x27bb54=_0x19951a;_0x1ffe29=0xc8;}else{_0x1ffe29=0xce;}_0x554384['status'](_0x1ffe29);return _0x554384[_0x019d('0x22')](_0x019d('0x23'),_0x1af39f+'-'+_0x27bb54+'/'+_0x19951a)[_0x019d('0x1e')](_0x1ebd56);}return null;};}function patchUpdates(_0x2d518a){return function(_0xefe9d2){try{jsonpatch[_0x019d('0x24')](_0xefe9d2,_0x2d518a,!![]);}catch(_0xca54fe){return BPromise['reject'](_0xca54fe);}return _0xefe9d2['save']();};}function saveUpdates(_0x4c9ee9,_0x3c3761){return function(_0x54f2da){if(_0x54f2da){return _0x54f2da['update'](_0x4c9ee9)[_0x019d('0x25')](function(_0x5d5577){return _0x5d5577;});}return null;};}function removeEntity(_0x519f43,_0x1b8756){return function(_0x3f80a8){if(_0x3f80a8){return _0x3f80a8[_0x019d('0x26')]()['then'](function(){_0x519f43['status'](0xcc)[_0x019d('0x27')]();});}};}function handleEntityNotFound(_0x1b3644,_0x552331){return function(_0x422d5a){if(!_0x422d5a){_0x1b3644['sendStatus'](0x194);}return _0x422d5a;};}function handleError(_0x331327,_0x3027ed){_0x3027ed=_0x3027ed||0x1f4;return function(_0x409fa7){logger[_0x019d('0x28')](_0x409fa7[_0x019d('0x29')]);if(_0x409fa7[_0x019d('0x2a')]){delete _0x409fa7[_0x019d('0x2a')];}_0x331327[_0x019d('0x1d')](_0x3027ed)[_0x019d('0x2b')](_0x409fa7);};}exports[_0x019d('0x2c')]=function(_0x1db0a1,_0x4be13e){var _0x53186c={},_0x2cae7a={},_0x451c09={'count':0x0,'rows':[]};var _0x327bf1=_[_0x019d('0x2d')](db[_0x019d('0x2e')][_0x019d('0x2f')],function(_0xa15a5c){return{'name':_0xa15a5c['fieldName'],'type':_0xa15a5c[_0x019d('0x30')][_0x019d('0x31')]};});_0x2cae7a[_0x019d('0x32')]=_[_0x019d('0x2d')](_0x327bf1,_0x019d('0x2a'));_0x2cae7a['query']=_[_0x019d('0x33')](_0x1db0a1[_0x019d('0x34')]);_0x2cae7a['filters']=_[_0x019d('0x35')](_0x2cae7a['model'],_0x2cae7a[_0x019d('0x34')]);_0x53186c[_0x019d('0x36')]=_[_0x019d('0x35')](_0x2cae7a[_0x019d('0x32')],qs[_0x019d('0x37')](_0x1db0a1[_0x019d('0x34')]['fields']));_0x53186c[_0x019d('0x36')]=_0x53186c[_0x019d('0x36')]['length']?_0x53186c[_0x019d('0x36')]:_0x2cae7a['model'];if(!_0x1db0a1[_0x019d('0x34')][_0x019d('0x38')](_0x019d('0x39'))){_0x53186c[_0x019d('0x20')]=qs[_0x019d('0x20')](_0x1db0a1[_0x019d('0x34')]['limit']);_0x53186c[_0x019d('0x21')]=qs['offset'](_0x1db0a1[_0x019d('0x34')][_0x019d('0x21')]);}_0x53186c[_0x019d('0x3a')]=qs[_0x019d('0x3b')](_0x1db0a1['query'][_0x019d('0x3b')]);_0x53186c[_0x019d('0x3c')]=qs['filters'](_[_0x019d('0x3d')](_0x1db0a1[_0x019d('0x34')],_0x2cae7a['filters']),_0x327bf1);if(_0x1db0a1['query'][_0x019d('0x3e')]){_0x53186c[_0x019d('0x3c')]=_[_0x019d('0x3f')](_0x53186c[_0x019d('0x3c')],{'$or':_[_0x019d('0x2d')](_0x327bf1,function(_0x321a8b){if(_0x321a8b[_0x019d('0x30')]!==_0x019d('0x40')){var _0x1fb259={};_0x1fb259[_0x321a8b[_0x019d('0x2a')]]={'$like':'%'+_0x1db0a1['query'][_0x019d('0x3e')]+'%'};return _0x1fb259;}})});}_0x53186c=_['merge']({},_0x53186c,_0x1db0a1[_0x019d('0x41')]);var _0x3b2d90={'where':_0x53186c['where']};return db[_0x019d('0x2e')]['count'](_0x3b2d90)['then'](function(_0x10a644){_0x451c09[_0x019d('0x42')]=_0x10a644;if(_0x1db0a1['query']['includeAll']){_0x53186c[_0x019d('0x43')]=[{'all':!![]}];}return db[_0x019d('0x2e')]['findAll'](_0x53186c);})[_0x019d('0x25')](function(_0x519150){_0x451c09['rows']=_0x519150;return _0x451c09;})[_0x019d('0x25')](respondWithFilteredResult(_0x4be13e,_0x53186c))['catch'](handleError(_0x4be13e,null));};exports[_0x019d('0x44')]=function(_0x1e0bae,_0x49b8ee){var _0xa2906a={'raw':!![],'where':{'id':_0x1e0bae[_0x019d('0x45')]['id']}},_0x58a17f={};_0x58a17f[_0x019d('0x32')]=_[_0x019d('0x33')](db[_0x019d('0x2e')]['rawAttributes']);_0x58a17f['query']=_[_0x019d('0x33')](_0x1e0bae['query']);_0x58a17f[_0x019d('0x46')]=_[_0x019d('0x35')](_0x58a17f[_0x019d('0x32')],_0x58a17f['query']);_0xa2906a[_0x019d('0x36')]=_[_0x019d('0x35')](_0x58a17f[_0x019d('0x32')],qs[_0x019d('0x37')](_0x1e0bae[_0x019d('0x34')]['fields']));_0xa2906a[_0x019d('0x36')]=_0xa2906a[_0x019d('0x36')][_0x019d('0x47')]?_0xa2906a[_0x019d('0x36')]:_0x58a17f['model'];if(_0x1e0bae['query'][_0x019d('0x48')]){_0xa2906a[_0x019d('0x43')]=[{'all':!![]}];}_0xa2906a=_[_0x019d('0x3f')]({},_0xa2906a,_0x1e0bae[_0x019d('0x41')]);return db['DeskField'][_0x019d('0x49')](_0xa2906a)['then'](handleEntityNotFound(_0x49b8ee,null))[_0x019d('0x25')](respondWithResult(_0x49b8ee,null))[_0x019d('0x4a')](handleError(_0x49b8ee,null));};exports[_0x019d('0x4b')]=function(_0x3d31b8,_0x2dd9f6){return db[_0x019d('0x2e')][_0x019d('0x4b')](_0x3d31b8[_0x019d('0x4c')],{})[_0x019d('0x25')](respondWithResult(_0x2dd9f6,0xc9))[_0x019d('0x4a')](handleError(_0x2dd9f6,null));};exports[_0x019d('0x4d')]=function(_0x138c50,_0x51a148){if(_0x138c50[_0x019d('0x4c')]['id']){delete _0x138c50['body']['id'];}return db[_0x019d('0x2e')][_0x019d('0x49')]({'where':{'id':_0x138c50[_0x019d('0x45')]['id']}})[_0x019d('0x25')](handleEntityNotFound(_0x51a148,null))[_0x019d('0x25')](saveUpdates(_0x138c50[_0x019d('0x4c')],null))[_0x019d('0x25')](respondWithResult(_0x51a148,null))[_0x019d('0x4a')](handleError(_0x51a148,null));};exports[_0x019d('0x26')]=function(_0x1e8032,_0xb0e45a){return db[_0x019d('0x2e')][_0x019d('0x49')]({'where':{'id':_0x1e8032['params']['id']}})[_0x019d('0x25')](handleEntityNotFound(_0xb0e45a,null))[_0x019d('0x25')](removeEntity(_0xb0e45a,null))[_0x019d('0x4a')](handleError(_0xb0e45a,null));};
\ No newline at end of file
index 588e6a6..2b57e06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf97=['moment','request-promise','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x5f36b2,_0x10edc8){var _0x3b9115=function(_0x1b29ce){while(--_0x1b29ce){_0x5f36b2['push'](_0x5f36b2['shift']());}};_0x3b9115(++_0x10edc8);}(_0xbf97,0x1dc));var _0x7bf9=function(_0x3f07d6,_0x1a362f){_0x3f07d6=_0x3f07d6-0x0;var _0x481226=_0xbf97[_0x3f07d6];return _0x481226;};'use strict';var _=require(_0x7bf9('0x0'));var util=require(_0x7bf9('0x1'));var logger=require(_0x7bf9('0x2'))(_0x7bf9('0x3'));var moment=require(_0x7bf9('0x4'));var BPromise=require('bluebird');var rp=require(_0x7bf9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7bf9('0x6'));var config=require(_0x7bf9('0x7'));var attributes=require(_0x7bf9('0x8'));module[_0x7bf9('0x9')]=function(_0x2c664d,_0x15146f){return _0x2c664d[_0x7bf9('0xa')](_0x7bf9('0xb'),attributes,{'tableName':_0x7bf9('0xc'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x7bf9('0xd'),_0x7bf9('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x438b=['int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','DeskField'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x438b,0x9a));var _0xb438=function(_0x300faf,_0x50a800){_0x300faf=_0x300faf-0x0;var _0x2d557e=_0x438b[_0x300faf];return _0x2d557e;};'use strict';var _=require(_0xb438('0x0'));var util=require(_0xb438('0x1'));var logger=require('../../config/logger')(_0xb438('0x2'));var moment=require(_0xb438('0x3'));var BPromise=require(_0xb438('0x4'));var rp=require(_0xb438('0x5'));var fs=require('fs');var path=require(_0xb438('0x6'));var rimraf=require('rimraf');var config=require(_0xb438('0x7'));var attributes=require('./intDeskField.attributes');module[_0xb438('0x8')]=function(_0x1b017b,_0x14cb9f){return _0x1b017b[_0xb438('0x9')](_0xb438('0xa'),attributes,{'tableName':_0xb438('0xb'),'paranoid':![],'indexes':[{'name':_0xb438('0xc'),'fields':[_0xb438('0xd'),_0xb438('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 7deb3fe..15bbd4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bfe=['../../config/environment','client','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','rpc'];(function(_0x363968,_0x122f44){var _0x5ab2c9=function(_0x4e6aa2){while(--_0x4e6aa2){_0x363968['push'](_0x363968['shift']());}};_0x5ab2c9(++_0x122f44);}(_0x2bfe,0x14e));var _0xe2bf=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x2bfe[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0xe2bf('0x0'));var util=require(_0xe2bf('0x1'));var moment=require(_0xe2bf('0x2'));var BPromise=require('bluebird');var rs=require(_0xe2bf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe2bf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe2bf('0x5'));var config=require(_0xe2bf('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe2bf('0x7')][_0xe2bf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2033fd,_0x2c2255,_0x21100c){return new BPromise(function(_0x552162,_0x436a7c){return client[_0xe2bf('0x9')](_0x2033fd,_0x21100c)['then'](function(_0xdf29f9){logger[_0xe2bf('0xa')](_0xe2bf('0xb'),_0x2c2255,_0xe2bf('0xc'));logger[_0xe2bf('0xd')]('DeskField,\x20%s,\x20%s,\x20%s',_0x2c2255,_0xe2bf('0xc'),JSON[_0xe2bf('0xe')](_0xdf29f9));if(_0xdf29f9['error']){if(_0xdf29f9[_0xe2bf('0xf')][_0xe2bf('0x10')]===0x1f4){logger[_0xe2bf('0xf')](_0xe2bf('0xb'),_0x2c2255,_0xdf29f9['error']['message']);return _0x436a7c(_0xdf29f9[_0xe2bf('0xf')][_0xe2bf('0x11')]);}logger[_0xe2bf('0xf')](_0xe2bf('0xb'),_0x2c2255,_0xdf29f9[_0xe2bf('0xf')][_0xe2bf('0x11')]);return _0x552162(_0xdf29f9['error'][_0xe2bf('0x11')]);}else{logger[_0xe2bf('0xa')]('DeskField,\x20%s,\x20%s',_0x2c2255,_0xe2bf('0xc'));_0x552162(_0xdf29f9[_0xe2bf('0x12')][_0xe2bf('0x11')]);}})[_0xe2bf('0x13')](function(_0x390d5b){logger['error']('DeskField,\x20%s,\x20%s',_0x2c2255,_0x390d5b);_0x436a7c(_0x390d5b);});});}
\ No newline at end of file
+var _0xacdb=['code','DeskField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error'];(function(_0x118491,_0x5122d6){var _0x5aa83f=function(_0x1ed44b){while(--_0x1ed44b){_0x118491['push'](_0x118491['shift']());}};_0x5aa83f(++_0x5122d6);}(_0xacdb,0x190));var _0xbacd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xacdb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbacd('0x0'));var util=require(_0xbacd('0x1'));var moment=require(_0xbacd('0x2'));var BPromise=require(_0xbacd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbacd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbacd('0x5'));var logger=require(_0xbacd('0x6'))(_0xbacd('0x7'));var config=require(_0xbacd('0x8'));var jayson=require(_0xbacd('0x9'));var client=jayson['client'][_0xbacd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x349f8e,_0x603a93,_0x106f74){return new BPromise(function(_0x5a0f70,_0x5e2292){return client[_0xbacd('0xb')](_0x349f8e,_0x106f74)[_0xbacd('0xc')](function(_0x3c9d6a){logger[_0xbacd('0xd')]('DeskField,\x20%s,\x20%s',_0x603a93,_0xbacd('0xe'));logger[_0xbacd('0xf')](_0xbacd('0x10'),_0x603a93,_0xbacd('0xe'),JSON['stringify'](_0x3c9d6a));if(_0x3c9d6a[_0xbacd('0x11')]){if(_0x3c9d6a[_0xbacd('0x11')][_0xbacd('0x12')]===0x1f4){logger[_0xbacd('0x11')](_0xbacd('0x13'),_0x603a93,_0x3c9d6a[_0xbacd('0x11')][_0xbacd('0x14')]);return _0x5e2292(_0x3c9d6a[_0xbacd('0x11')][_0xbacd('0x14')]);}logger[_0xbacd('0x11')]('DeskField,\x20%s,\x20%s',_0x603a93,_0x3c9d6a[_0xbacd('0x11')][_0xbacd('0x14')]);return _0x5a0f70(_0x3c9d6a[_0xbacd('0x11')][_0xbacd('0x14')]);}else{logger[_0xbacd('0xd')](_0xbacd('0x13'),_0x603a93,_0xbacd('0xe'));_0x5a0f70(_0x3c9d6a[_0xbacd('0x15')][_0xbacd('0x14')]);}})['catch'](function(_0x2173b0){logger['error'](_0xbacd('0x13'),_0x603a93,_0x2173b0);_0x5e2292(_0x2173b0);});});}
\ No newline at end of file
index cb84c14..bcce95f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd082=['/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x315928,_0x443808){var _0x3e1288=function(_0x1c9d67){while(--_0x1c9d67){_0x315928['push'](_0x315928['shift']());}};_0x3e1288(++_0x443808);}(_0xd082,0x1d1));var _0x2d08=function(_0x2e7740,_0x342f06){_0x2e7740=_0x2e7740-0x0;var _0x36b08e=_0xd082[_0x2e7740];return _0x36b08e;};'use strict';var multer=require(_0x2d08('0x0'));var util=require(_0x2d08('0x1'));var path=require(_0x2d08('0x2'));var timeout=require('connect-timeout');var express=require(_0x2d08('0x3'));var router=express[_0x2d08('0x4')]();var fs_extra=require(_0x2d08('0x5'));var auth=require(_0x2d08('0x6'));var interaction=require(_0x2d08('0x7'));var config=require('../../config/environment');var controller=require(_0x2d08('0x8'));router[_0x2d08('0x9')]('/',auth[_0x2d08('0xa')](),controller[_0x2d08('0xb')]);router[_0x2d08('0x9')](_0x2d08('0xc'),auth[_0x2d08('0xa')](),controller[_0x2d08('0xd')]);router['get'](_0x2d08('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x2d08('0xf'),auth[_0x2d08('0xa')](),controller[_0x2d08('0x10')]);router[_0x2d08('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2d08('0x11')](_0x2d08('0xe'),auth[_0x2d08('0xa')](),controller[_0x2d08('0x12')]);router[_0x2d08('0x13')](_0x2d08('0xc'),auth[_0x2d08('0xa')](),controller[_0x2d08('0x14')]);router[_0x2d08('0x15')](_0x2d08('0xc'),auth['isAuthenticated'](),controller[_0x2d08('0x16')]);module[_0x2d08('0x17')]=router;
\ No newline at end of file
+var _0x3ab3=['get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Account.controller'];(function(_0x199475,_0x4e32d9){var _0x138c17=function(_0x40f3e4){while(--_0x40f3e4){_0x199475['push'](_0x199475['shift']());}};_0x138c17(++_0x4e32d9);}(_0x3ab3,0x159));var _0x33ab=function(_0x32e264,_0x41cee8){_0x32e264=_0x32e264-0x0;var _0x1d7175=_0x3ab3[_0x32e264];return _0x1d7175;};'use strict';var multer=require('multer');var util=require(_0x33ab('0x0'));var path=require(_0x33ab('0x1'));var timeout=require('connect-timeout');var express=require(_0x33ab('0x2'));var router=express[_0x33ab('0x3')]();var fs_extra=require(_0x33ab('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x33ab('0x5'));var config=require('../../config/environment');var controller=require(_0x33ab('0x6'));router[_0x33ab('0x7')]('/',auth[_0x33ab('0x8')](),controller['index']);router[_0x33ab('0x7')](_0x33ab('0x9'),auth[_0x33ab('0x8')](),controller[_0x33ab('0xa')]);router[_0x33ab('0x7')](_0x33ab('0xb'),auth[_0x33ab('0x8')](),controller['getConfigurations']);router[_0x33ab('0x7')](_0x33ab('0xc'),auth['isAuthenticated'](),controller[_0x33ab('0xd')]);router[_0x33ab('0xe')]('/',auth[_0x33ab('0x8')](),controller[_0x33ab('0xf')]);router[_0x33ab('0xe')](_0x33ab('0xb'),auth[_0x33ab('0x8')](),controller[_0x33ab('0x10')]);router[_0x33ab('0x11')](_0x33ab('0x9'),auth[_0x33ab('0x8')](),controller[_0x33ab('0x12')]);router[_0x33ab('0x13')]('/:id',auth[_0x33ab('0x8')](),controller[_0x33ab('0x14')]);module[_0x33ab('0x15')]=router;
\ No newline at end of file
index 90a771b..d3f065f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1224=['BOOLEAN','sequelize','exports','STRING'];(function(_0x1c6de2,_0xe99545){var _0xada087=function(_0x218577){while(--_0x218577){_0x1c6de2['push'](_0x1c6de2['shift']());}};_0xada087(++_0xe99545);}(_0x1224,0x10d));var _0x4122=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x1224[_0x521929];return _0x632436;};'use strict';var Sequelize=require(_0x4122('0x0'));module[_0x4122('0x1')]={'name':{'type':Sequelize[_0x4122('0x2')]},'username':{'type':Sequelize[_0x4122('0x2')]},'password':{'type':Sequelize[_0x4122('0x2')]},'remoteUri':{'type':Sequelize[_0x4122('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x4122('0x2')]},'clientSecret':{'type':Sequelize[_0x4122('0x2')]},'serverUrl':{'type':Sequelize[_0x4122('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x4122('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xbbbd=['STRING','BOOLEAN','sequelize','exports'];(function(_0x43f16f,_0x5b99e5){var _0x66db51=function(_0x1b017b){while(--_0x1b017b){_0x43f16f['push'](_0x43f16f['shift']());}};_0x66db51(++_0x5b99e5);}(_0xbbbd,0x86));var _0xdbbb=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xbbbd[_0x4ed520];return _0x4415a6;};'use strict';var Sequelize=require(_0xdbbb('0x0'));module[_0xdbbb('0x1')]={'name':{'type':Sequelize[_0xdbbb('0x2')]},'username':{'type':Sequelize[_0xdbbb('0x2')]},'password':{'type':Sequelize[_0xdbbb('0x2')]},'remoteUri':{'type':Sequelize[_0xdbbb('0x2')]},'tenantId':{'type':Sequelize[_0xdbbb('0x2')]},'clientId':{'type':Sequelize[_0xdbbb('0x2')]},'clientSecret':{'type':Sequelize[_0xdbbb('0x2')]},'serverUrl':{'type':Sequelize[_0xdbbb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdbbb('0x2')]},'modernAuthentication':{'type':Sequelize[_0xdbbb('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 797ca93..e753950 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f13=['api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','status','set','Content-Range','destroy','then','end','stack','name','map','Dynamics365Account','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','catch','show','params','options','find','body','update','getConfigurations','findOne','Dynamics365Configuration','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','create','Dynamics365Field','slice','substring','lastIndexOf','format','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','socialprofileidname','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','https://login.microsoftonline.com/','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','push','all','StringAttributeMetadata','DoubleAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','error','Wrong\x20credentials','statusCode',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','OptionSet','FalseOption',')/Microsoft.Dynamics.CRM.','request-promise','util','lodash','../../config/logger'];(function(_0x47483f,_0x1c8c82){var _0x1d32a8=function(_0x7cd2c2){while(--_0x7cd2c2){_0x47483f['push'](_0x47483f['shift']());}};_0x1d32a8(++_0x1c8c82);}(_0x0f13,0x16a));var _0x30f1=function(_0x357048,_0x30f2a2){_0x357048=_0x357048-0x0;var _0x17cd63=_0x0f13[_0x357048];return _0x17cd63;};'use strict';var rp=require(_0x30f1('0x0'));var util=require(_0x30f1('0x1'));var _=require(_0x30f1('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x30f1('0x3'))(_0x30f1('0x4'));var db=require(_0x30f1('0x5'))['db'];var integrations=require(_0x30f1('0x6'));function respondWithResult(_0x1d35eb,_0x34d9b5){_0x34d9b5=_0x34d9b5||0xc8;return function(_0x1caa1d){if(_0x1caa1d){return _0x1d35eb['status'](_0x34d9b5)[_0x30f1('0x7')](_0x1caa1d);}};}function respondWithFilteredResult(_0x4a99f0,_0x2355fa){return function(_0x316ec1){if(_0x316ec1){var _0x3194ab=typeof _0x2355fa[_0x30f1('0x8')]===_0x30f1('0x9')&&typeof _0x2355fa[_0x30f1('0xa')]===_0x30f1('0x9');var _0x5560e8=_0x316ec1[_0x30f1('0xb')];var _0x482f58=_0x3194ab?0x0:_0x2355fa[_0x30f1('0x8')];var _0x12a875=_0x3194ab?_0x316ec1[_0x30f1('0xb')]:_0x2355fa[_0x30f1('0x8')]+_0x2355fa[_0x30f1('0xa')];var _0x1c72c4;if(_0x12a875>=_0x5560e8){_0x12a875=_0x5560e8;_0x1c72c4=0xc8;}else{_0x1c72c4=0xce;}_0x4a99f0[_0x30f1('0xc')](_0x1c72c4);return _0x4a99f0[_0x30f1('0xd')](_0x30f1('0xe'),_0x482f58+'-'+_0x12a875+'/'+_0x5560e8)[_0x30f1('0x7')](_0x316ec1);}return null;};}function saveUpdates(_0x329d32){return function(_0x5e7cee){if(_0x5e7cee){return _0x5e7cee['update'](_0x329d32)['then'](function(_0x3eea82){return _0x3eea82;});}return null;};}function removeEntity(_0x36795e){return function(_0x55b9db){if(_0x55b9db){return _0x55b9db[_0x30f1('0xf')]()[_0x30f1('0x10')](function(){_0x36795e[_0x30f1('0xc')](0xcc)[_0x30f1('0x11')]();});}};}function handleEntityNotFound(_0x332cec){return function(_0x1eeb73){if(!_0x1eeb73){_0x332cec['sendStatus'](0x194);}return _0x1eeb73;};}function handleError(_0x54bc84,_0x229b39){_0x229b39=_0x229b39||0x1f4;return function(_0x4d85ae){logger['error'](_0x4d85ae[_0x30f1('0x12')]);if(_0x4d85ae[_0x30f1('0x13')]){delete _0x4d85ae[_0x30f1('0x13')];}_0x54bc84[_0x30f1('0xc')](_0x229b39)['send'](_0x4d85ae);};}exports['index']=function(_0x2c29c7,_0x52938c){var _0x866f25={},_0xe42d39={},_0x54f2c8={'count':0x0,'rows':[]};var _0x12cd67=_[_0x30f1('0x14')](db[_0x30f1('0x15')][_0x30f1('0x16')],function(_0x550e97){return{'name':_0x550e97[_0x30f1('0x17')],'type':_0x550e97[_0x30f1('0x18')]['key']};});_0xe42d39[_0x30f1('0x19')]=_[_0x30f1('0x14')](_0x12cd67,_0x30f1('0x13'));_0xe42d39[_0x30f1('0x1a')]=_[_0x30f1('0x1b')](_0x2c29c7[_0x30f1('0x1a')]);_0xe42d39[_0x30f1('0x1c')]=_['intersection'](_0xe42d39[_0x30f1('0x19')],_0xe42d39[_0x30f1('0x1a')]);_0x866f25[_0x30f1('0x1d')]=_[_0x30f1('0x1e')](_0xe42d39[_0x30f1('0x19')],qs[_0x30f1('0x1f')](_0x2c29c7[_0x30f1('0x1a')]['fields']));_0x866f25['attributes']=_0x866f25['attributes'][_0x30f1('0x20')]?_0x866f25[_0x30f1('0x1d')]:_0xe42d39[_0x30f1('0x19')];if(!_0x2c29c7[_0x30f1('0x1a')]['hasOwnProperty'](_0x30f1('0x21'))){_0x866f25[_0x30f1('0xa')]=qs[_0x30f1('0xa')](_0x2c29c7['query'][_0x30f1('0xa')]);_0x866f25['offset']=qs['offset'](_0x2c29c7[_0x30f1('0x1a')][_0x30f1('0x8')]);}_0x866f25[_0x30f1('0x22')]=qs[_0x30f1('0x23')](_0x2c29c7['query']['sort']);_0x866f25['where']=qs[_0x30f1('0x1c')](_[_0x30f1('0x24')](_0x2c29c7[_0x30f1('0x1a')],_0xe42d39['filters']),_0x12cd67);if(_0x2c29c7[_0x30f1('0x1a')][_0x30f1('0x25')]){_0x866f25[_0x30f1('0x26')]=_[_0x30f1('0x27')](_0x866f25[_0x30f1('0x26')],{'$or':_['map'](_0x12cd67,function(_0x3a49f1){if(_0x3a49f1[_0x30f1('0x18')]!==_0x30f1('0x28')){var _0x52c4c5={};_0x52c4c5[_0x3a49f1[_0x30f1('0x13')]]={'$like':'%'+_0x2c29c7['query'][_0x30f1('0x25')]+'%'};return _0x52c4c5;}})});}_0x866f25=_[_0x30f1('0x27')]({},_0x866f25,_0x2c29c7['options']);var _0x1a0de5={'where':_0x866f25['where']};return db[_0x30f1('0x15')][_0x30f1('0xb')](_0x1a0de5)[_0x30f1('0x10')](function(_0x53dcaf){_0x54f2c8[_0x30f1('0xb')]=_0x53dcaf;if(_0x2c29c7['query'][_0x30f1('0x29')]){_0x866f25[_0x30f1('0x2a')]=[{'all':!![]}];}return db[_0x30f1('0x15')]['findAll'](_0x866f25);})[_0x30f1('0x10')](function(_0xc152ab){_0x54f2c8['rows']=_0xc152ab;return _0x54f2c8;})[_0x30f1('0x10')](respondWithFilteredResult(_0x52938c,_0x866f25))[_0x30f1('0x2b')](handleError(_0x52938c,null));};exports[_0x30f1('0x2c')]=function(_0xa3d380,_0x28929d){var _0x2babec={'raw':![],'where':{'id':_0xa3d380[_0x30f1('0x2d')]['id']}},_0x125330={};_0x125330[_0x30f1('0x19')]=_[_0x30f1('0x1b')](db['Dynamics365Account'][_0x30f1('0x16')]);_0x125330[_0x30f1('0x1a')]=_['keys'](_0xa3d380['query']);_0x125330[_0x30f1('0x1c')]=_['intersection'](_0x125330['model'],_0x125330[_0x30f1('0x1a')]);_0x2babec['attributes']=_[_0x30f1('0x1e')](_0x125330[_0x30f1('0x19')],qs[_0x30f1('0x1f')](_0xa3d380['query'][_0x30f1('0x1f')]));_0x2babec[_0x30f1('0x1d')]=_0x2babec['attributes']['length']?_0x2babec['attributes']:_0x125330[_0x30f1('0x19')];if(_0xa3d380[_0x30f1('0x1a')][_0x30f1('0x29')]){_0x2babec[_0x30f1('0x2a')]=[{'all':!![]}];}_0x2babec=_[_0x30f1('0x27')]({},_0x2babec,_0xa3d380[_0x30f1('0x2e')]);return db['Dynamics365Account'][_0x30f1('0x2f')](_0x2babec)[_0x30f1('0x10')](handleEntityNotFound(_0x28929d,null))['then'](respondWithResult(_0x28929d,null))[_0x30f1('0x2b')](handleError(_0x28929d,null));};exports['create']=function(_0x12eab4,_0x1f1d9b){return db['Dynamics365Account']['create'](_0x12eab4[_0x30f1('0x30')],{})[_0x30f1('0x10')](respondWithResult(_0x1f1d9b,0xc9))[_0x30f1('0x2b')](handleError(_0x1f1d9b,null));};exports[_0x30f1('0x31')]=function(_0x266eda,_0x3adc6a){if(_0x266eda[_0x30f1('0x30')]['id']){delete _0x266eda[_0x30f1('0x30')]['id'];}return db['Dynamics365Account'][_0x30f1('0x2f')]({'where':{'id':_0x266eda['params']['id']}})['then'](handleEntityNotFound(_0x3adc6a,null))[_0x30f1('0x10')](saveUpdates(_0x266eda['body'],null))['then'](respondWithResult(_0x3adc6a,null))[_0x30f1('0x2b')](handleError(_0x3adc6a,null));};exports['destroy']=function(_0x37912d,_0x368424){return db[_0x30f1('0x15')][_0x30f1('0x2f')]({'where':{'id':_0x37912d[_0x30f1('0x2d')]['id']}})['then'](handleEntityNotFound(_0x368424,null))['then'](removeEntity(_0x368424,null))['catch'](handleError(_0x368424,null));};exports[_0x30f1('0x32')]=function(_0x50cf70,_0x578143){var _0x25d30d={};var _0x56b4a4={};var _0x521c7f;var _0x6d1342;return db[_0x30f1('0x15')][_0x30f1('0x33')]({'where':{'id':_0x50cf70['params']['id']}})[_0x30f1('0x10')](handleEntityNotFound(_0x578143,null))[_0x30f1('0x10')](function(_0x122a76){if(_0x122a76){_0x521c7f=_0x122a76;_0x56b4a4[_0x30f1('0x19')]=_[_0x30f1('0x1b')](db[_0x30f1('0x34')][_0x30f1('0x16')]);_0x56b4a4[_0x30f1('0x1a')]=_[_0x30f1('0x1b')](_0x50cf70[_0x30f1('0x1a')]);_0x56b4a4[_0x30f1('0x1c')]=_[_0x30f1('0x1e')](_0x56b4a4[_0x30f1('0x19')],_0x56b4a4[_0x30f1('0x1a')]);_0x25d30d['attributes']=_[_0x30f1('0x1e')](_0x56b4a4[_0x30f1('0x19')],qs[_0x30f1('0x1f')](_0x50cf70[_0x30f1('0x1a')][_0x30f1('0x1f')]));_0x25d30d[_0x30f1('0x1d')]=_0x25d30d[_0x30f1('0x1d')][_0x30f1('0x20')]?_0x25d30d['attributes']:_0x56b4a4[_0x30f1('0x19')];_0x25d30d[_0x30f1('0x22')]=qs[_0x30f1('0x23')](_0x50cf70['query'][_0x30f1('0x23')]);_0x25d30d['where']=qs[_0x30f1('0x1c')](_[_0x30f1('0x24')](_0x50cf70[_0x30f1('0x1a')],_0x56b4a4[_0x30f1('0x1c')]));if(_0x50cf70[_0x30f1('0x1a')][_0x30f1('0x25')]){_0x25d30d[_0x30f1('0x26')]=_[_0x30f1('0x27')](_0x25d30d[_0x30f1('0x26')],{'$or':_[_0x30f1('0x14')](_0x25d30d[_0x30f1('0x1d')],function(_0x1c04be){var _0x3ea760={};_0x3ea760[_0x1c04be]={'$like':'%'+_0x50cf70[_0x30f1('0x1a')][_0x30f1('0x25')]+'%'};return _0x3ea760;})});}_0x25d30d=_[_0x30f1('0x27')]({},_0x25d30d,_0x50cf70[_0x30f1('0x2e')]);return _0x521c7f[_0x30f1('0x32')](_0x25d30d);}})['then'](function(_0x3fd9ab){if(_0x3fd9ab){_0x6d1342=_0x3fd9ab[_0x30f1('0x20')];if(!_0x50cf70['query'][_0x30f1('0x35')](_0x30f1('0x21'))){_0x25d30d[_0x30f1('0xa')]=qs[_0x30f1('0xa')](_0x50cf70['query'][_0x30f1('0xa')]);_0x25d30d[_0x30f1('0x8')]=qs[_0x30f1('0x8')](_0x50cf70['query'][_0x30f1('0x8')]);}return _0x521c7f['getConfigurations'](_0x25d30d);}})['then'](function(_0x244454){if(_0x244454){return _0x244454?{'count':_0x6d1342,'rows':_0x244454}:null;}})['then'](respondWithResult(_0x578143,null))[_0x30f1('0x2b')](handleError(_0x578143,null));};exports[_0x30f1('0x36')]=function(_0x35fb2f,_0x5b5188){if(_0x35fb2f['body']['id']){delete _0x35fb2f[_0x30f1('0x30')]['id'];}return db[_0x30f1('0x15')][_0x30f1('0x33')]({'where':{'id':_0x35fb2f['params']['id']}})[_0x30f1('0x10')](handleEntityNotFound(_0x5b5188,null))[_0x30f1('0x10')](function(_0x1698be){if(_0x1698be){_0x35fb2f[_0x30f1('0x30')][_0x30f1('0x37')]=_0x1698be['id'];_0x35fb2f['body'][_0x30f1('0x38')]=integrations['getSubjects'](_0x35fb2f[_0x30f1('0x30')][_0x30f1('0x39')],_0x35fb2f['body']['type']);_0x35fb2f[_0x30f1('0x30')][_0x30f1('0x3a')]=integrations[_0x30f1('0x3b')](_0x35fb2f[_0x30f1('0x30')]['channel'],_0x35fb2f[_0x30f1('0x30')]['type']);return db[_0x30f1('0x34')][_0x30f1('0x3c')](_0x35fb2f[_0x30f1('0x30')],{'include':[{'model':db['Dynamics365Field'],'as':_0x30f1('0x38')},{'model':db[_0x30f1('0x3d')],'as':_0x30f1('0x3a')}]});}return null;})[_0x30f1('0x10')](respondWithResult(_0x5b5188,null))['catch'](handleError(_0x5b5188,null));};function sanitizeRemoteUri(_0x28bc52){var _0x4112a3=_0x28bc52[_0x30f1('0x3e')](-0x1);if(_0x4112a3==='/')return _0x28bc52[_0x30f1('0x3f')](0x0,_0x28bc52[_0x30f1('0x40')](_0x4112a3));return _0x28bc52;}function getWebApiUrl(_0xcc4b0c){return util[_0x30f1('0x41')]('%s/api/data/v9.0/',_0xcc4b0c);}exports[_0x30f1('0x42')]=function(_0x3544c9,_0x24b746){var _0xab4e9f=_0x3544c9[_0x30f1('0x1a')][_0x30f1('0x43')];var _0x2effbf=_0xab4e9f===_0x30f1('0x44')?_0x30f1('0x45'):_0x30f1('0x46');var _0x29ea4e='';var _0x4cde77='';var _0x1efd6b='';var _0x1cf8a0='';var _0x52daa1='';var _0x18dfd5='';var _0x385f22='';var _0x59b1a3='';var _0x255417=[_0x30f1('0x47'),'description',_0x30f1('0x48'),_0x30f1('0x49'),_0x30f1('0x4a'),_0x30f1('0x4b'),'phonenumber',_0x30f1('0x4c'),_0x30f1('0x4d'),_0x30f1('0x4e')];var _0x43d3f1=['accountidname',_0x30f1('0x4f'),_0x30f1('0x50'),_0x30f1('0x51'),'contactidname',_0x30f1('0x52'),'contractdetailidname',_0x30f1('0x53'),_0x30f1('0x54'),'createdbyexternalpartyyominame',_0x30f1('0x55'),_0x30f1('0x56'),_0x30f1('0x57'),_0x30f1('0x58'),_0x30f1('0x59'),_0x30f1('0x5a'),_0x30f1('0x5b'),_0x30f1('0x5c'),_0x30f1('0x5d'),_0x30f1('0x5e'),_0x30f1('0x5f'),'entityimage_url',_0x30f1('0x60'),'exchangerate',_0x30f1('0x61'),_0x30f1('0x62'),_0x30f1('0x63'),_0x30f1('0x64'),_0x30f1('0x65'),_0x30f1('0x66'),_0x30f1('0x67'),'modifiedbyexternalpartyname',_0x30f1('0x68'),_0x30f1('0x69'),'modifiedbyyominame',_0x30f1('0x6a'),_0x30f1('0x6b'),_0x30f1('0x6c'),_0x30f1('0x6d'),_0x30f1('0x6e'),_0x30f1('0x6f'),'onholdtime',_0x30f1('0x70'),'owneridname',_0x30f1('0x71'),_0x30f1('0x72'),'parentcaseidname',_0x30f1('0x73'),_0x30f1('0x74'),_0x30f1('0x75'),'productidname',_0x30f1('0x76'),_0x30f1('0x77'),_0x30f1('0x78'),_0x30f1('0x79'),_0x30f1('0x7a'),_0x30f1('0x7b'),'sentimentvalue',_0x30f1('0x7c'),'slaname',_0x30f1('0x7d'),'statecode','statuscode',_0x30f1('0x7e'),_0x30f1('0x7f'),_0x30f1('0x80'),'transactioncurrencyidname',_0x30f1('0x81'),_0x30f1('0x82'),_0x30f1('0x83')];var _0x3cf163=_0x255417[_0x30f1('0x84')](_0x43d3f1);return db['Dynamics365Account'][_0x30f1('0x33')]({'where':{'id':_0x3544c9['params']['id']},'attributes':['id',_0x30f1('0x85'),_0x30f1('0x86'),_0x30f1('0x87'),_0x30f1('0x88'),_0x30f1('0x89'),_0x30f1('0x8a'),_0x30f1('0x8b')],'include':[{'model':db[_0x30f1('0x8c')],'as':_0x30f1('0x8c'),'attributes':['id',_0x30f1('0x8d'),'data7']}]})[_0x30f1('0x10')](handleEntityNotFound(_0x24b746,null))[_0x30f1('0x10')](function(_0x586f35){if(_0x586f35){if(_0x586f35[_0x30f1('0x8b')]){_0x586f35['access_token']=_0x586f35[_0x30f1('0x8c')]['data5'];_0x59b1a3=sanitizeRemoteUri(_0x586f35[_0x30f1('0x8c')][_0x30f1('0x8e')]);_0x385f22=getWebApiUrl(_0x59b1a3);return _0x586f35;}_0x59b1a3=sanitizeRemoteUri(_0x586f35[_0x30f1('0x87')]);_0x385f22=getWebApiUrl(_0x59b1a3);var _0x2e94ec={'method':_0x30f1('0x8f'),'uri':_0x30f1('0x90')+_0x586f35['tenantId']+'/oauth2/token','form':{'client_id':_0x586f35[_0x30f1('0x89')],'resource':_0x59b1a3,'username':_0x586f35[_0x30f1('0x85')],'password':_0x586f35[_0x30f1('0x86')],'grant_type':_0x30f1('0x86'),'client_secret':_0x586f35['clientSecret']},'json':!![]};return rp(_0x2e94ec);}})[_0x30f1('0x10')](function(_0x53efc0){_0x18dfd5=_0x53efc0['access_token'];var _0x35b9e7={'method':_0x30f1('0x91'),'uri':encodeURI(_0x385f22+_0x30f1('0x92')+_0x2effbf+'\x27'),'headers':{'Authorization':_0x30f1('0x93')+_0x18dfd5,'If-None-Match':null,'OData-Version':_0x30f1('0x94')},'json':!![]};return rp(_0x35b9e7);})[_0x30f1('0x10')](function(_0x3e423c){var _0x40dc3f=_0x3e423c[_0x30f1('0x95')][0x0];var _0x58b04f=_0x40dc3f[_0x30f1('0x96')];var _0xbe3858={'method':_0x30f1('0x91'),'uri':_0x385f22+_0x30f1('0x97')+_0x58b04f+_0x30f1('0x98'),'headers':{'Authorization':_0x30f1('0x93')+_0x18dfd5,'If-None-Match':null,'OData-Version':_0x30f1('0x94')},'json':!![]};return rp(_0xbe3858);})['then'](function(_0x4d9866){_0x29ea4e=_0x4d9866;_0x4cde77=_0x29ea4e[_0x30f1('0x99')];_0x4cde77=_['remove'](_0x4cde77,function(_0x77bfed){return!_0x3cf163[_0x30f1('0x9a')](_0x77bfed[_0x30f1('0x9b')]);});var _0x92be7c=[];var _0x3745f9=[];_0x4cde77[_0x30f1('0x9c')](function(_0x321df3){if(_0x321df3[_0x30f1('0x9d')]){var _0x59f380=_0x321df3[_0x30f1('0x9d')][_0x30f1('0x3f')](_0x321df3['@odata.type'][_0x30f1('0x40')]('.')+0x1);if(_0x59f380==='PicklistAttributeMetadata'){_0x92be7c[_0x30f1('0x9e')](getSelectList(_0x385f22,_0xab4e9f,_0x3745f9,_0x29ea4e[_0x30f1('0x96')],_0x321df3['MetadataId'],_0x18dfd5));}}});return Promise[_0x30f1('0x9f')](_0x92be7c);})['then'](function(_0x55069e){_0x1efd6b=_0x55069e[0x0];var _0xfcc049=[];var _0x295313=[];_0x4cde77['forEach'](function(_0xeda18d){if(!_['isNil'](_0xeda18d[_0x30f1('0x9d')])){var _0x3ea5f3=_0xeda18d[_0x30f1('0x9d')]['substring'](_0xeda18d[_0x30f1('0x9d')][_0x30f1('0x40')]('.')+0x1);if(_0x3ea5f3==='BooleanAttributeMetadata'){_0xfcc049[_0x30f1('0x9e')](getBooleanList(_0x385f22,_0xab4e9f,_0x295313,_0x29ea4e[_0x30f1('0x96')],_0xeda18d[_0x30f1('0x96')],_0x18dfd5));}}});return Promise['all'](_0xfcc049);})[_0x30f1('0x10')](function(_0x56260c){_0x1cf8a0=_0x56260c[0x0];var _0x2374d2=[];var _0x382209=[];_0x4cde77[_0x30f1('0x9c')](function(_0x5325b5){if(_0x5325b5[_0x30f1('0x9d')]){var _0x59c909=_0x5325b5['@odata.type'][_0x30f1('0x3f')](_0x5325b5[_0x30f1('0x9d')]['lastIndexOf']('.')+0x1);if(_0x59c909===_0x30f1('0xa0')||_0x59c909===_0x30f1('0xa1')||_0x59c909==='BigIntAttributeMetadata'||_0x59c909==='IntegerAttributeMetadata'||_0x59c909==='MemoAttributeMetadata'||_0x59c909===_0x30f1('0xa2')||_0x59c909===_0x30f1('0xa3')||_0x59c909===_0x30f1('0xa4')||_0x59c909===_0x30f1('0xa5')||_0x59c909===_0x30f1('0xa6')){_0x2374d2[_0x30f1('0x9e')](getInputList(_0x385f22,_0xab4e9f,_0x59c909,_0x382209,_0x29ea4e[_0x30f1('0x96')],_0x5325b5[_0x30f1('0x96')],_0x18dfd5));}}});return Promise[_0x30f1('0x9f')](_0x2374d2);})[_0x30f1('0x10')](function(_0x2827ae){_0x52daa1=_0x2827ae[0x0];var _0x3d64ea=_0x1efd6b[_0x30f1('0x84')](_0x1cf8a0)['concat'](_0x52daa1);var _0x38a6c2={'count':_0x3d64ea[_0x30f1('0x20')],'rows':_0x3d64ea};return _0x38a6c2;})[_0x30f1('0x10')](respondWithResult(_0x24b746,null))[_0x30f1('0x2b')](function(_0x15e454){var _0x22facd=_0x3544c9['query'][_0x30f1('0xa7')]?0x1f4:_0x15e454['statusCode']||0x1f4;logger[_0x30f1('0xa8')](_0x15e454[_0x30f1('0x12')]);delete _0x15e454['name'];if(_0x22facd===0x191){_0x22facd=0x190;}_0x24b746[_0x30f1('0xc')](_0x22facd)['send'](_0x3544c9[_0x30f1('0x1a')][_0x30f1('0xa7')]?{'message':_0x30f1('0xa9'),'statusCode':_0x15e454[_0x30f1('0xaa')]}:_0x15e454);});};function getSelectList(_0x17cc0c,_0x379649,_0x49fb2d,_0x15b5b5,_0x2c7c22,_0x1ccd6e){var _0x27be78={'method':_0x30f1('0x91'),'uri':_0x17cc0c+_0x30f1('0x97')+_0x15b5b5+_0x30f1('0xab')+_0x2c7c22+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x30f1('0xac'),'headers':{'Authorization':_0x30f1('0x93')+_0x1ccd6e,'If-None-Match':null,'OData-Version':_0x30f1('0x94')},'json':!![]};return rp(_0x27be78)[_0x30f1('0x10')](function(_0x1954db){var _0x3cabf7=[];var _0x5762ad=_0x1954db['OptionSet'][_0x30f1('0xad')];_0x5762ad[_0x30f1('0x9c')](function(_0x3fde56){_0x3cabf7[_0x30f1('0x9e')]({'name':_0x3fde56[_0x30f1('0xae')][_0x30f1('0xaf')][_0x30f1('0xae')],'value':String(_0x3fde56[_0x30f1('0xb0')])});});var _0xd05581={'id':_0x379649+'_'+_0x1954db[_0x30f1('0x9b')],'name':_0x1954db[_0x30f1('0xb1')][_0x30f1('0xaf')][_0x30f1('0xae')],'custom':![],'options':_0x3cabf7};_0x49fb2d[_0x30f1('0x9e')](_0xd05581);return _0x49fb2d;});}function getBooleanList(_0x353d60,_0x2ebc55,_0x370f62,_0xe612cf,_0x2ad976,_0x5f112e){var _0x201298={'method':_0x30f1('0x91'),'uri':_0x353d60+'EntityDefinitions('+_0xe612cf+')/Attributes('+_0x2ad976+_0x30f1('0xb2'),'headers':{'Authorization':'Bearer\x20'+_0x5f112e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x201298)[_0x30f1('0x10')](function(_0x6cf558){var _0xb08f9e=[];_0xb08f9e['push']({'name':_0x6cf558['OptionSet'][_0x30f1('0xb3')][_0x30f1('0xae')][_0x30f1('0xaf')]['Label'],'value':'true'},{'name':_0x6cf558[_0x30f1('0xb4')][_0x30f1('0xb5')]['Label'][_0x30f1('0xaf')]['Label'],'value':'false'});var _0x105465={'id':_0x2ebc55+'_'+_0x6cf558[_0x30f1('0x9b')],'name':_0x6cf558[_0x30f1('0xb1')]['UserLocalizedLabel'][_0x30f1('0xae')],'custom':![],'options':_0xb08f9e};_0x370f62['push'](_0x105465);return _0x370f62;});}function getInputList(_0x53d543,_0x7576d0,_0x44748c,_0x130ebb,_0x2fe8e7,_0x32b1f2,_0x128a80){var _0x50a2ac={'method':'GET','uri':_0x53d543+_0x30f1('0x97')+_0x2fe8e7+_0x30f1('0xab')+_0x32b1f2+_0x30f1('0xb6')+_0x44748c+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x30f1('0x93')+_0x128a80,'If-None-Match':null,'OData-Version':_0x30f1('0x94')},'json':!![]};return rp(_0x50a2ac)[_0x30f1('0x10')](function(_0x19292a){var _0x72d833={'id':_0x7576d0+'_'+_0x19292a['LogicalName'],'name':_0x19292a['DisplayName'][_0x30f1('0xaf')]?_0x19292a[_0x30f1('0xb1')]['UserLocalizedLabel']['Label']:_0x19292a['LogicalName'],'custom':![],'options':[]};_0x130ebb[_0x30f1('0x9e')](_0x72d833);return _0x130ebb;});}
\ No newline at end of file
+var _0xbf31=['masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientId','clientSecret','CloudProvider','data7','modernAuthentication','data5','POST','/oauth2/token','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','LogicalName','forEach','@odata.type','substring','lastIndexOf','PicklistAttributeMetadata','all','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','push','UserLocalizedLabel','Label','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','false',')/Attributes(','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','limit','count','set','Content-Range','json','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Dynamics365Account','includeAll','findAll','rows','catch','show','length','create','body','find','params','getConfigurations','findOne','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Configuration','Dynamics365Field','slice','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','title','description','caseorigincode','subject','phonenumber','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractidname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname'];(function(_0x52a867,_0x1a69d9){var _0x581670=function(_0x55dccb){while(--_0x55dccb){_0x52a867['push'](_0x52a867['shift']());}};_0x581670(++_0x1a69d9);}(_0xbf31,0x10a));var _0x1bf3=function(_0x534f8f,_0x341204){_0x534f8f=_0x534f8f-0x0;var _0x448c7e=_0xbf31[_0x534f8f];return _0x448c7e;};'use strict';var rp=require(_0x1bf3('0x0'));var util=require(_0x1bf3('0x1'));var _=require(_0x1bf3('0x2'));var qs=require(_0x1bf3('0x3'));var logger=require(_0x1bf3('0x4'))(_0x1bf3('0x5'));var db=require(_0x1bf3('0x6'))['db'];var integrations=require(_0x1bf3('0x7'));function respondWithResult(_0x1983a8,_0x71cade){_0x71cade=_0x71cade||0xc8;return function(_0x4f40e2){if(_0x4f40e2){return _0x1983a8[_0x1bf3('0x8')](_0x71cade)['json'](_0x4f40e2);}};}function respondWithFilteredResult(_0x41ec3c,_0x10d834){return function(_0x571b24){if(_0x571b24){var _0x34e2e3=typeof _0x10d834[_0x1bf3('0x9')]===_0x1bf3('0xa')&&typeof _0x10d834[_0x1bf3('0xb')]===_0x1bf3('0xa');var _0xb271d6=_0x571b24[_0x1bf3('0xc')];var _0xf6cc13=_0x34e2e3?0x0:_0x10d834['offset'];var _0x5daf09=_0x34e2e3?_0x571b24[_0x1bf3('0xc')]:_0x10d834['offset']+_0x10d834[_0x1bf3('0xb')];var _0x2dc945;if(_0x5daf09>=_0xb271d6){_0x5daf09=_0xb271d6;_0x2dc945=0xc8;}else{_0x2dc945=0xce;}_0x41ec3c[_0x1bf3('0x8')](_0x2dc945);return _0x41ec3c[_0x1bf3('0xd')](_0x1bf3('0xe'),_0xf6cc13+'-'+_0x5daf09+'/'+_0xb271d6)[_0x1bf3('0xf')](_0x571b24);}return null;};}function saveUpdates(_0xdb49e5){return function(_0x51221a){if(_0x51221a){return _0x51221a['update'](_0xdb49e5)[_0x1bf3('0x10')](function(_0x11cbae){return _0x11cbae;});}return null;};}function removeEntity(_0x46b950){return function(_0x3a8583){if(_0x3a8583){return _0x3a8583[_0x1bf3('0x11')]()[_0x1bf3('0x10')](function(){_0x46b950[_0x1bf3('0x8')](0xcc)[_0x1bf3('0x12')]();});}};}function handleEntityNotFound(_0x6d7a9e){return function(_0x4c5ce2){if(!_0x4c5ce2){_0x6d7a9e['sendStatus'](0x194);}return _0x4c5ce2;};}function handleError(_0x453801,_0x4edb32){_0x4edb32=_0x4edb32||0x1f4;return function(_0x4e8458){logger[_0x1bf3('0x13')](_0x4e8458[_0x1bf3('0x14')]);if(_0x4e8458[_0x1bf3('0x15')]){delete _0x4e8458[_0x1bf3('0x15')];}_0x453801[_0x1bf3('0x8')](_0x4edb32)['send'](_0x4e8458);};}exports['index']=function(_0x54371c,_0x3c3f91){var _0x1c18fa={},_0xede15d={},_0x4e60d4={'count':0x0,'rows':[]};var _0x40e29b=_[_0x1bf3('0x16')](db['Dynamics365Account'][_0x1bf3('0x17')],function(_0x1f503a){return{'name':_0x1f503a[_0x1bf3('0x18')],'type':_0x1f503a[_0x1bf3('0x19')][_0x1bf3('0x1a')]};});_0xede15d['model']=_[_0x1bf3('0x16')](_0x40e29b,_0x1bf3('0x15'));_0xede15d[_0x1bf3('0x1b')]=_[_0x1bf3('0x1c')](_0x54371c[_0x1bf3('0x1b')]);_0xede15d['filters']=_['intersection'](_0xede15d['model'],_0xede15d[_0x1bf3('0x1b')]);_0x1c18fa['attributes']=_[_0x1bf3('0x1d')](_0xede15d[_0x1bf3('0x1e')],qs['fields'](_0x54371c[_0x1bf3('0x1b')][_0x1bf3('0x1f')]));_0x1c18fa[_0x1bf3('0x20')]=_0x1c18fa['attributes']['length']?_0x1c18fa[_0x1bf3('0x20')]:_0xede15d['model'];if(!_0x54371c[_0x1bf3('0x1b')][_0x1bf3('0x21')](_0x1bf3('0x22'))){_0x1c18fa[_0x1bf3('0xb')]=qs['limit'](_0x54371c[_0x1bf3('0x1b')]['limit']);_0x1c18fa[_0x1bf3('0x9')]=qs['offset'](_0x54371c[_0x1bf3('0x1b')][_0x1bf3('0x9')]);}_0x1c18fa[_0x1bf3('0x23')]=qs[_0x1bf3('0x24')](_0x54371c['query']['sort']);_0x1c18fa[_0x1bf3('0x25')]=qs[_0x1bf3('0x26')](_[_0x1bf3('0x27')](_0x54371c[_0x1bf3('0x1b')],_0xede15d[_0x1bf3('0x26')]),_0x40e29b);if(_0x54371c[_0x1bf3('0x1b')][_0x1bf3('0x28')]){_0x1c18fa[_0x1bf3('0x25')]=_[_0x1bf3('0x29')](_0x1c18fa['where'],{'$or':_['map'](_0x40e29b,function(_0x45d71a){if(_0x45d71a[_0x1bf3('0x19')]!==_0x1bf3('0x2a')){var _0x91806c={};_0x91806c[_0x45d71a[_0x1bf3('0x15')]]={'$like':'%'+_0x54371c[_0x1bf3('0x1b')][_0x1bf3('0x28')]+'%'};return _0x91806c;}})});}_0x1c18fa=_['merge']({},_0x1c18fa,_0x54371c[_0x1bf3('0x2b')]);var _0x366126={'where':_0x1c18fa[_0x1bf3('0x25')]};return db[_0x1bf3('0x2c')][_0x1bf3('0xc')](_0x366126)[_0x1bf3('0x10')](function(_0x5426fa){_0x4e60d4[_0x1bf3('0xc')]=_0x5426fa;if(_0x54371c[_0x1bf3('0x1b')][_0x1bf3('0x2d')]){_0x1c18fa['include']=[{'all':!![]}];}return db[_0x1bf3('0x2c')][_0x1bf3('0x2e')](_0x1c18fa);})[_0x1bf3('0x10')](function(_0x351cf7){_0x4e60d4[_0x1bf3('0x2f')]=_0x351cf7;return _0x4e60d4;})['then'](respondWithFilteredResult(_0x3c3f91,_0x1c18fa))[_0x1bf3('0x30')](handleError(_0x3c3f91,null));};exports[_0x1bf3('0x31')]=function(_0x32d823,_0x4f2366){var _0x25cf3b={'raw':![],'where':{'id':_0x32d823['params']['id']}},_0x51f0a2={};_0x51f0a2[_0x1bf3('0x1e')]=_[_0x1bf3('0x1c')](db['Dynamics365Account'][_0x1bf3('0x17')]);_0x51f0a2[_0x1bf3('0x1b')]=_['keys'](_0x32d823[_0x1bf3('0x1b')]);_0x51f0a2[_0x1bf3('0x26')]=_[_0x1bf3('0x1d')](_0x51f0a2[_0x1bf3('0x1e')],_0x51f0a2[_0x1bf3('0x1b')]);_0x25cf3b[_0x1bf3('0x20')]=_[_0x1bf3('0x1d')](_0x51f0a2['model'],qs['fields'](_0x32d823[_0x1bf3('0x1b')][_0x1bf3('0x1f')]));_0x25cf3b[_0x1bf3('0x20')]=_0x25cf3b[_0x1bf3('0x20')][_0x1bf3('0x32')]?_0x25cf3b[_0x1bf3('0x20')]:_0x51f0a2[_0x1bf3('0x1e')];if(_0x32d823['query']['includeAll']){_0x25cf3b['include']=[{'all':!![]}];}_0x25cf3b=_[_0x1bf3('0x29')]({},_0x25cf3b,_0x32d823[_0x1bf3('0x2b')]);return db[_0x1bf3('0x2c')]['find'](_0x25cf3b)['then'](handleEntityNotFound(_0x4f2366,null))[_0x1bf3('0x10')](respondWithResult(_0x4f2366,null))[_0x1bf3('0x30')](handleError(_0x4f2366,null));};exports[_0x1bf3('0x33')]=function(_0x323a9c,_0xc41568){return db['Dynamics365Account']['create'](_0x323a9c['body'],{})[_0x1bf3('0x10')](respondWithResult(_0xc41568,0xc9))[_0x1bf3('0x30')](handleError(_0xc41568,null));};exports['update']=function(_0x2ffebc,_0x2652b5){if(_0x2ffebc[_0x1bf3('0x34')]['id']){delete _0x2ffebc[_0x1bf3('0x34')]['id'];}return db[_0x1bf3('0x2c')][_0x1bf3('0x35')]({'where':{'id':_0x2ffebc[_0x1bf3('0x36')]['id']}})[_0x1bf3('0x10')](handleEntityNotFound(_0x2652b5,null))[_0x1bf3('0x10')](saveUpdates(_0x2ffebc[_0x1bf3('0x34')],null))[_0x1bf3('0x10')](respondWithResult(_0x2652b5,null))[_0x1bf3('0x30')](handleError(_0x2652b5,null));};exports[_0x1bf3('0x11')]=function(_0x4af415,_0x39f138){return db[_0x1bf3('0x2c')][_0x1bf3('0x35')]({'where':{'id':_0x4af415['params']['id']}})[_0x1bf3('0x10')](handleEntityNotFound(_0x39f138,null))[_0x1bf3('0x10')](removeEntity(_0x39f138,null))['catch'](handleError(_0x39f138,null));};exports[_0x1bf3('0x37')]=function(_0x4635cf,_0x4e4455){var _0x247a69={};var _0x22b12c={};var _0x3b1b7f;var _0x3777dc;return db[_0x1bf3('0x2c')][_0x1bf3('0x38')]({'where':{'id':_0x4635cf['params']['id']}})[_0x1bf3('0x10')](handleEntityNotFound(_0x4e4455,null))[_0x1bf3('0x10')](function(_0x22d263){if(_0x22d263){_0x3b1b7f=_0x22d263;_0x22b12c[_0x1bf3('0x1e')]=_['keys'](db['Dynamics365Configuration'][_0x1bf3('0x17')]);_0x22b12c[_0x1bf3('0x1b')]=_[_0x1bf3('0x1c')](_0x4635cf[_0x1bf3('0x1b')]);_0x22b12c['filters']=_[_0x1bf3('0x1d')](_0x22b12c['model'],_0x22b12c['query']);_0x247a69[_0x1bf3('0x20')]=_[_0x1bf3('0x1d')](_0x22b12c[_0x1bf3('0x1e')],qs[_0x1bf3('0x1f')](_0x4635cf['query'][_0x1bf3('0x1f')]));_0x247a69['attributes']=_0x247a69[_0x1bf3('0x20')][_0x1bf3('0x32')]?_0x247a69[_0x1bf3('0x20')]:_0x22b12c[_0x1bf3('0x1e')];_0x247a69[_0x1bf3('0x23')]=qs[_0x1bf3('0x24')](_0x4635cf[_0x1bf3('0x1b')][_0x1bf3('0x24')]);_0x247a69['where']=qs[_0x1bf3('0x26')](_['pick'](_0x4635cf[_0x1bf3('0x1b')],_0x22b12c[_0x1bf3('0x26')]));if(_0x4635cf[_0x1bf3('0x1b')][_0x1bf3('0x28')]){_0x247a69['where']=_[_0x1bf3('0x29')](_0x247a69[_0x1bf3('0x25')],{'$or':_[_0x1bf3('0x16')](_0x247a69[_0x1bf3('0x20')],function(_0x1561e3){var _0x4db774={};_0x4db774[_0x1561e3]={'$like':'%'+_0x4635cf[_0x1bf3('0x1b')][_0x1bf3('0x28')]+'%'};return _0x4db774;})});}_0x247a69=_[_0x1bf3('0x29')]({},_0x247a69,_0x4635cf[_0x1bf3('0x2b')]);return _0x3b1b7f['getConfigurations'](_0x247a69);}})['then'](function(_0x14f031){if(_0x14f031){_0x3777dc=_0x14f031['length'];if(!_0x4635cf[_0x1bf3('0x1b')][_0x1bf3('0x21')](_0x1bf3('0x22'))){_0x247a69[_0x1bf3('0xb')]=qs[_0x1bf3('0xb')](_0x4635cf['query'][_0x1bf3('0xb')]);_0x247a69['offset']=qs[_0x1bf3('0x9')](_0x4635cf['query'][_0x1bf3('0x9')]);}return _0x3b1b7f[_0x1bf3('0x37')](_0x247a69);}})[_0x1bf3('0x10')](function(_0x2c7199){if(_0x2c7199){return _0x2c7199?{'count':_0x3777dc,'rows':_0x2c7199}:null;}})[_0x1bf3('0x10')](respondWithResult(_0x4e4455,null))[_0x1bf3('0x30')](handleError(_0x4e4455,null));};exports[_0x1bf3('0x39')]=function(_0x52a68b,_0x4a3677){if(_0x52a68b['body']['id']){delete _0x52a68b[_0x1bf3('0x34')]['id'];}return db['Dynamics365Account'][_0x1bf3('0x38')]({'where':{'id':_0x52a68b['params']['id']}})[_0x1bf3('0x10')](handleEntityNotFound(_0x4a3677,null))[_0x1bf3('0x10')](function(_0x10aff2){if(_0x10aff2){_0x52a68b[_0x1bf3('0x34')]['AccountId']=_0x10aff2['id'];_0x52a68b['body'][_0x1bf3('0x3a')]=integrations[_0x1bf3('0x3b')](_0x52a68b[_0x1bf3('0x34')]['channel'],_0x52a68b[_0x1bf3('0x34')][_0x1bf3('0x19')]);_0x52a68b[_0x1bf3('0x34')][_0x1bf3('0x3c')]=integrations[_0x1bf3('0x3d')](_0x52a68b[_0x1bf3('0x34')][_0x1bf3('0x3e')],_0x52a68b['body']['type']);return db[_0x1bf3('0x3f')][_0x1bf3('0x33')](_0x52a68b[_0x1bf3('0x34')],{'include':[{'model':db[_0x1bf3('0x40')],'as':'Subjects'},{'model':db[_0x1bf3('0x40')],'as':_0x1bf3('0x3c')}]});}return null;})[_0x1bf3('0x10')](respondWithResult(_0x4a3677,null))[_0x1bf3('0x30')](handleError(_0x4a3677,null));};function sanitizeRemoteUri(_0x58c39f){var _0x845f7e=_0x58c39f[_0x1bf3('0x41')](-0x1);if(_0x845f7e==='/')return _0x58c39f['substring'](0x0,_0x58c39f['lastIndexOf'](_0x845f7e));return _0x58c39f;}function getWebApiUrl(_0x2a3ef0){return util['format'](_0x1bf3('0x42'),_0x2a3ef0);}exports[_0x1bf3('0x43')]=function(_0x300c58,_0x4195dc){var _0x2124d8=_0x300c58[_0x1bf3('0x1b')][_0x1bf3('0x44')];var _0xb522df=_0x2124d8===_0x1bf3('0x45')?_0x1bf3('0x46'):'PhoneCall';var _0x5f5500='';var _0x4700ad='';var _0x4bbb0c='';var _0x469efc='';var _0x2d4e72='';var _0x4c09e4='';var _0x45d82b='';var _0x4a1bb9='';var _0x538ff4=[_0x1bf3('0x47'),_0x1bf3('0x48'),'customerid','ownerid',_0x1bf3('0x49'),_0x1bf3('0x4a'),_0x1bf3('0x4b'),'regardingobjectid',_0x1bf3('0x4c'),_0x1bf3('0x4d')];var _0x4f07c8=[_0x1bf3('0x4e'),_0x1bf3('0x4f'),_0x1bf3('0x50'),'billedserviceunits',_0x1bf3('0x51'),_0x1bf3('0x52'),'contractdetailidname',_0x1bf3('0x53'),'createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname',_0x1bf3('0x54'),'createdon',_0x1bf3('0x55'),_0x1bf3('0x56'),'customeridname','customeridtype',_0x1bf3('0x57'),'emailaddress',_0x1bf3('0x58'),_0x1bf3('0x59'),_0x1bf3('0x5a'),_0x1bf3('0x5b'),_0x1bf3('0x5c'),_0x1bf3('0x5d'),_0x1bf3('0x5e'),_0x1bf3('0x5f'),_0x1bf3('0x60'),_0x1bf3('0x61'),'lastonholdtime',_0x1bf3('0x62'),_0x1bf3('0x63'),_0x1bf3('0x64'),'modifiedbyname',_0x1bf3('0x65'),_0x1bf3('0x66'),_0x1bf3('0x67'),_0x1bf3('0x68'),_0x1bf3('0x69'),'msdyn_iotalertname',_0x1bf3('0x6a'),_0x1bf3('0x6b'),_0x1bf3('0x6c'),'owneridname','owneridtype',_0x1bf3('0x6d'),_0x1bf3('0x6e'),_0x1bf3('0x6f'),_0x1bf3('0x70'),'prioritycodename',_0x1bf3('0x71'),'productserialnumber',_0x1bf3('0x72'),_0x1bf3('0x73'),_0x1bf3('0x74'),_0x1bf3('0x75'),_0x1bf3('0x76'),'sentimentvalue',_0x1bf3('0x77'),_0x1bf3('0x78'),_0x1bf3('0x79'),'statecode',_0x1bf3('0x7a'),'subjectidname',_0x1bf3('0x7b'),_0x1bf3('0x7c'),_0x1bf3('0x7d'),_0x1bf3('0x7e'),_0x1bf3('0x7f'),_0x1bf3('0x80')];var _0x528d1a=_0x538ff4[_0x1bf3('0x81')](_0x4f07c8);return db[_0x1bf3('0x2c')]['findOne']({'where':{'id':_0x300c58['params']['id']},'attributes':['id',_0x1bf3('0x82'),'password',_0x1bf3('0x83'),_0x1bf3('0x84'),_0x1bf3('0x85'),_0x1bf3('0x86'),'modernAuthentication'],'include':[{'model':db[_0x1bf3('0x87')],'as':_0x1bf3('0x87'),'attributes':['id','data5',_0x1bf3('0x88')]}]})['then'](handleEntityNotFound(_0x4195dc,null))['then'](function(_0x170ee3){if(_0x170ee3){if(_0x170ee3[_0x1bf3('0x89')]){_0x170ee3['access_token']=_0x170ee3[_0x1bf3('0x87')][_0x1bf3('0x8a')];_0x4a1bb9=sanitizeRemoteUri(_0x170ee3[_0x1bf3('0x87')][_0x1bf3('0x88')]);_0x45d82b=getWebApiUrl(_0x4a1bb9);return _0x170ee3;}_0x4a1bb9=sanitizeRemoteUri(_0x170ee3[_0x1bf3('0x83')]);_0x45d82b=getWebApiUrl(_0x4a1bb9);var _0x53c4da={'method':_0x1bf3('0x8b'),'uri':'https://login.microsoftonline.com/'+_0x170ee3[_0x1bf3('0x84')]+_0x1bf3('0x8c'),'form':{'client_id':_0x170ee3[_0x1bf3('0x85')],'resource':_0x4a1bb9,'username':_0x170ee3[_0x1bf3('0x82')],'password':_0x170ee3[_0x1bf3('0x8d')],'grant_type':_0x1bf3('0x8d'),'client_secret':_0x170ee3[_0x1bf3('0x86')]},'json':!![]};return rp(_0x53c4da);}})[_0x1bf3('0x10')](function(_0x305a17){_0x4c09e4=_0x305a17['access_token'];var _0x2bff26={'method':_0x1bf3('0x8e'),'uri':encodeURI(_0x45d82b+_0x1bf3('0x8f')+_0xb522df+'\x27'),'headers':{'Authorization':_0x1bf3('0x90')+_0x4c09e4,'If-None-Match':null,'OData-Version':_0x1bf3('0x91')},'json':!![]};return rp(_0x2bff26);})[_0x1bf3('0x10')](function(_0x3d2dba){var _0x1de762=_0x3d2dba[_0x1bf3('0x92')][0x0];var _0x28f534=_0x1de762[_0x1bf3('0x93')];var _0x377809={'method':_0x1bf3('0x8e'),'uri':_0x45d82b+_0x1bf3('0x94')+_0x28f534+_0x1bf3('0x95'),'headers':{'Authorization':_0x1bf3('0x90')+_0x4c09e4,'If-None-Match':null,'OData-Version':_0x1bf3('0x91')},'json':!![]};return rp(_0x377809);})[_0x1bf3('0x10')](function(_0x58be9a){_0x5f5500=_0x58be9a;_0x4700ad=_0x5f5500[_0x1bf3('0x96')];_0x4700ad=_['remove'](_0x4700ad,function(_0x4943b2){return!_0x528d1a['includes'](_0x4943b2[_0x1bf3('0x97')]);});var _0x41cc51=[];var _0x3bdcd0=[];_0x4700ad[_0x1bf3('0x98')](function(_0x4daa29){if(_0x4daa29[_0x1bf3('0x99')]){var _0xfd014f=_0x4daa29[_0x1bf3('0x99')][_0x1bf3('0x9a')](_0x4daa29[_0x1bf3('0x99')][_0x1bf3('0x9b')]('.')+0x1);if(_0xfd014f===_0x1bf3('0x9c')){_0x41cc51['push'](getSelectList(_0x45d82b,_0x2124d8,_0x3bdcd0,_0x5f5500[_0x1bf3('0x93')],_0x4daa29[_0x1bf3('0x93')],_0x4c09e4));}}});return Promise[_0x1bf3('0x9d')](_0x41cc51);})['then'](function(_0x5f459e){_0x4bbb0c=_0x5f459e[0x0];var _0x45e96c=[];var _0x5d171f=[];_0x4700ad['forEach'](function(_0x160126){if(!_['isNil'](_0x160126[_0x1bf3('0x99')])){var _0x4d2b2e=_0x160126[_0x1bf3('0x99')][_0x1bf3('0x9a')](_0x160126[_0x1bf3('0x99')][_0x1bf3('0x9b')]('.')+0x1);if(_0x4d2b2e===_0x1bf3('0x9e')){_0x45e96c['push'](getBooleanList(_0x45d82b,_0x2124d8,_0x5d171f,_0x5f5500['MetadataId'],_0x160126[_0x1bf3('0x93')],_0x4c09e4));}}});return Promise[_0x1bf3('0x9d')](_0x45e96c);})[_0x1bf3('0x10')](function(_0x3e6129){_0x469efc=_0x3e6129[0x0];var _0x37b903=[];var _0x557a36=[];_0x4700ad['forEach'](function(_0x5b65ae){if(_0x5b65ae[_0x1bf3('0x99')]){var _0x5415aa=_0x5b65ae[_0x1bf3('0x99')][_0x1bf3('0x9a')](_0x5b65ae['@odata.type'][_0x1bf3('0x9b')]('.')+0x1);if(_0x5415aa===_0x1bf3('0x9f')||_0x5415aa===_0x1bf3('0xa0')||_0x5415aa===_0x1bf3('0xa1')||_0x5415aa===_0x1bf3('0xa2')||_0x5415aa===_0x1bf3('0xa3')||_0x5415aa==='DateTimeAttributeMetadata'||_0x5415aa===_0x1bf3('0xa4')||_0x5415aa===_0x1bf3('0xa5')||_0x5415aa==='StateAttributeMetadata'||_0x5415aa===_0x1bf3('0xa6')){_0x37b903['push'](getInputList(_0x45d82b,_0x2124d8,_0x5415aa,_0x557a36,_0x5f5500[_0x1bf3('0x93')],_0x5b65ae['MetadataId'],_0x4c09e4));}}});return Promise[_0x1bf3('0x9d')](_0x37b903);})[_0x1bf3('0x10')](function(_0x53b880){_0x2d4e72=_0x53b880[0x0];var _0x211c9f=_0x4bbb0c[_0x1bf3('0x81')](_0x469efc)[_0x1bf3('0x81')](_0x2d4e72);var _0x2043b7={'count':_0x211c9f[_0x1bf3('0x32')],'rows':_0x211c9f};return _0x2043b7;})[_0x1bf3('0x10')](respondWithResult(_0x4195dc,null))['catch'](function(_0x4a75ff){var _0x46937e=_0x300c58['query'][_0x1bf3('0xa7')]?0x1f4:_0x4a75ff[_0x1bf3('0xa8')]||0x1f4;logger[_0x1bf3('0x13')](_0x4a75ff['stack']);delete _0x4a75ff[_0x1bf3('0x15')];if(_0x46937e===0x191){_0x46937e=0x190;}_0x4195dc[_0x1bf3('0x8')](_0x46937e)['send'](_0x300c58[_0x1bf3('0x1b')]['test']?{'message':_0x1bf3('0xa9'),'statusCode':_0x4a75ff[_0x1bf3('0xa8')]}:_0x4a75ff);});};function getSelectList(_0x1aaf00,_0x2a294f,_0x3a184f,_0xae11a2,_0x5c4f96,_0x12433d){var _0x25fcd0={'method':'GET','uri':_0x1aaf00+_0x1bf3('0x94')+_0xae11a2+')/Attributes('+_0x5c4f96+_0x1bf3('0xaa')+_0x1bf3('0xab'),'headers':{'Authorization':_0x1bf3('0x90')+_0x12433d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x25fcd0)[_0x1bf3('0x10')](function(_0x30701e){var _0xca2aca=[];var _0x4af0ba=_0x30701e[_0x1bf3('0xac')]['Options'];_0x4af0ba[_0x1bf3('0x98')](function(_0x44c281){_0xca2aca[_0x1bf3('0xad')]({'name':_0x44c281['Label'][_0x1bf3('0xae')][_0x1bf3('0xaf')],'value':String(_0x44c281['Value'])});});var _0x5d14d1={'id':_0x2a294f+'_'+_0x30701e['LogicalName'],'name':_0x30701e[_0x1bf3('0xb0')][_0x1bf3('0xae')][_0x1bf3('0xaf')],'custom':![],'options':_0xca2aca};_0x3a184f[_0x1bf3('0xad')](_0x5d14d1);return _0x3a184f;});}function getBooleanList(_0x4d44bd,_0x514321,_0x218aab,_0x367e72,_0x24d5db,_0x2fb5d4){var _0x437276={'method':'GET','uri':_0x4d44bd+_0x1bf3('0x94')+_0x367e72+')/Attributes('+_0x24d5db+_0x1bf3('0xb1'),'headers':{'Authorization':_0x1bf3('0x90')+_0x2fb5d4,'If-None-Match':null,'OData-Version':_0x1bf3('0x91')},'json':!![]};return rp(_0x437276)[_0x1bf3('0x10')](function(_0x6503dc){var _0x1b2eb0=[];_0x1b2eb0['push']({'name':_0x6503dc[_0x1bf3('0xac')]['TrueOption'][_0x1bf3('0xaf')][_0x1bf3('0xae')][_0x1bf3('0xaf')],'value':_0x1bf3('0xb2')},{'name':_0x6503dc[_0x1bf3('0xac')]['FalseOption'][_0x1bf3('0xaf')][_0x1bf3('0xae')][_0x1bf3('0xaf')],'value':_0x1bf3('0xb3')});var _0x52e0da={'id':_0x514321+'_'+_0x6503dc['LogicalName'],'name':_0x6503dc[_0x1bf3('0xb0')][_0x1bf3('0xae')]['Label'],'custom':![],'options':_0x1b2eb0};_0x218aab[_0x1bf3('0xad')](_0x52e0da);return _0x218aab;});}function getInputList(_0xd80d4,_0x4a3917,_0x5abdd6,_0x3ce96a,_0xb5b806,_0x594a7b,_0x32604d){var _0x13d411={'method':_0x1bf3('0x8e'),'uri':_0xd80d4+_0x1bf3('0x94')+_0xb5b806+_0x1bf3('0xb4')+_0x594a7b+')/Microsoft.Dynamics.CRM.'+_0x5abdd6+_0x1bf3('0xb5'),'headers':{'Authorization':_0x1bf3('0x90')+_0x32604d,'If-None-Match':null,'OData-Version':_0x1bf3('0x91')},'json':!![]};return rp(_0x13d411)[_0x1bf3('0x10')](function(_0x28e97f){var _0x50cbe6={'id':_0x4a3917+'_'+_0x28e97f[_0x1bf3('0x97')],'name':_0x28e97f['DisplayName'][_0x1bf3('0xae')]?_0x28e97f[_0x1bf3('0xb0')]['UserLocalizedLabel']['Label']:_0x28e97f[_0x1bf3('0x97')],'custom':![],'options':[]};_0x3ce96a[_0x1bf3('0xad')](_0x50cbe6);return _0x3ce96a;});}
\ No newline at end of file
index c3b3e7f..f85e399 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x5bb404,_0x33bd15){var _0x46fbc6=function(_0x480f01){while(--_0x480f01){_0x5bb404['push'](_0x5bb404['shift']());}};_0x46fbc6(++_0x33bd15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x95882f,_0x388649){var _0x16b282=function(_0x254a5b){while(--_0x254a5b){_0x95882f['push'](_0x95882f['shift']());}};_0x16b282(++_0x388649);}(_0xbaf0,0x12a));var _0x0baf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbaf0[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b56b910..9aae677 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe226=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','attributes','limit','include','map','model','debug','find','ShowDynamics365Account'];(function(_0x352d24,_0x3dfd43){var _0x2f9aac=function(_0x29431e){while(--_0x29431e){_0x352d24['push'](_0x352d24['shift']());}};_0x2f9aac(++_0x3dfd43);}(_0xe226,0x14a));var _0x6e22=function(_0x2ed6cb,_0x3b4294){_0x2ed6cb=_0x2ed6cb-0x0;var _0x398783=_0xe226[_0x2ed6cb];return _0x398783;};'use strict';var _=require('lodash');var util=require(_0x6e22('0x0'));var moment=require(_0x6e22('0x1'));var BPromise=require(_0x6e22('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e22('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e22('0x4'));var logger=require(_0x6e22('0x5'))(_0x6e22('0x6'));var config=require(_0x6e22('0x7'));var jayson=require(_0x6e22('0x8'));var client=jayson[_0x6e22('0x9')][_0x6e22('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32186e,_0x2d4d47,_0x623f9){return new BPromise(function(_0x50625c,_0x413562){return client[_0x6e22('0xb')](_0x32186e,_0x623f9)[_0x6e22('0xc')](function(_0x3fa754){logger[_0x6e22('0xd')](_0x6e22('0xe'),_0x2d4d47,_0x6e22('0xf'));logger['debug'](_0x6e22('0x10'),_0x2d4d47,_0x6e22('0xf'),JSON['stringify'](_0x3fa754));if(_0x3fa754[_0x6e22('0x11')]){if(_0x3fa754[_0x6e22('0x11')]['code']===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x2d4d47,_0x3fa754[_0x6e22('0x11')][_0x6e22('0x12')]);return _0x413562(_0x3fa754[_0x6e22('0x11')][_0x6e22('0x12')]);}logger[_0x6e22('0x11')](_0x6e22('0xe'),_0x2d4d47,_0x3fa754[_0x6e22('0x11')]['message']);return _0x50625c(_0x3fa754[_0x6e22('0x11')][_0x6e22('0x12')]);}else{logger[_0x6e22('0xd')](_0x6e22('0xe'),_0x2d4d47,_0x6e22('0xf'));_0x50625c(_0x3fa754['result'][_0x6e22('0x12')]);}})[_0x6e22('0x13')](function(_0x32b7e1){logger['error'](_0x6e22('0xe'),_0x2d4d47,_0x32b7e1);_0x413562(_0x32b7e1);});});}exports[_0x6e22('0x14')]=function(_0x5a200b){var _0x3c37e6=this;return new Promise(function(_0x4541ca,_0x3c90d9){return db[_0x6e22('0x15')]['findAll']({'raw':_0x5a200b[_0x6e22('0x16')]?_0x5a200b[_0x6e22('0x16')][_0x6e22('0x17')]===undefined?!![]:![]:!![],'where':_0x5a200b[_0x6e22('0x16')]?_0x5a200b['options'][_0x6e22('0x18')]||null:null,'attributes':_0x5a200b[_0x6e22('0x16')]?_0x5a200b['options'][_0x6e22('0x19')]||null:null,'limit':_0x5a200b[_0x6e22('0x16')]?_0x5a200b[_0x6e22('0x16')][_0x6e22('0x1a')]||null:null,'include':_0x5a200b[_0x6e22('0x16')]?_0x5a200b['options'][_0x6e22('0x1b')]?_[_0x6e22('0x1c')](_0x5a200b[_0x6e22('0x16')][_0x6e22('0x1b')],function(_0x20c02f){return{'model':db[_0x20c02f[_0x6e22('0x1d')]],'as':_0x20c02f['as'],'attributes':_0x20c02f[_0x6e22('0x19')],'include':_0x20c02f[_0x6e22('0x1b')]?_[_0x6e22('0x1c')](_0x20c02f[_0x6e22('0x1b')],function(_0x5a5b73){return{'model':db[_0x5a5b73[_0x6e22('0x1d')]],'as':_0x5a5b73['as'],'attributes':_0x5a5b73[_0x6e22('0x19')],'include':_0x5a5b73[_0x6e22('0x1b')]?_['map'](_0x5a5b73[_0x6e22('0x1b')],function(_0x43e0c0){return{'model':db[_0x43e0c0[_0x6e22('0x1d')]],'as':_0x43e0c0['as'],'attributes':_0x43e0c0[_0x6e22('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15cbf2){logger['info'](_0x6e22('0x14'),_0x5a200b);logger[_0x6e22('0x1e')](_0x6e22('0x14'),_0x5a200b,JSON['stringify'](_0x15cbf2));_0x4541ca(_0x15cbf2);})[_0x6e22('0x13')](function(_0xb9fff5){logger['error']('GetDynamics365Account',_0xb9fff5[_0x6e22('0x12')],_0x5a200b);_0x3c90d9(_0x3c37e6[_0x6e22('0x11')](0x1f4,_0xb9fff5[_0x6e22('0x12')]));});});};exports['ShowDynamics365Account']=function(_0x5387db){var _0x446916=this;return new Promise(function(_0xd76e57,_0x53f601){return db[_0x6e22('0x15')][_0x6e22('0x1f')]({'raw':_0x5387db[_0x6e22('0x16')]?_0x5387db[_0x6e22('0x16')][_0x6e22('0x17')]===undefined?!![]:![]:!![],'where':_0x5387db['options']?_0x5387db['options'][_0x6e22('0x18')]||null:null,'attributes':_0x5387db[_0x6e22('0x16')]?_0x5387db[_0x6e22('0x16')][_0x6e22('0x19')]||null:null,'include':_0x5387db['options']?_0x5387db['options'][_0x6e22('0x1b')]?_[_0x6e22('0x1c')](_0x5387db[_0x6e22('0x16')][_0x6e22('0x1b')],function(_0x52770b){return{'model':db[_0x52770b[_0x6e22('0x1d')]],'as':_0x52770b['as'],'attributes':_0x52770b[_0x6e22('0x19')],'include':_0x52770b[_0x6e22('0x1b')]?_[_0x6e22('0x1c')](_0x52770b['include'],function(_0x185d4c){return{'model':db[_0x185d4c[_0x6e22('0x1d')]],'as':_0x185d4c['as'],'attributes':_0x185d4c[_0x6e22('0x19')],'include':_0x185d4c['include']?_[_0x6e22('0x1c')](_0x185d4c[_0x6e22('0x1b')],function(_0x2caf1a){return{'model':db[_0x2caf1a[_0x6e22('0x1d')]],'as':_0x2caf1a['as'],'attributes':_0x2caf1a['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e22('0xc')](function(_0x508ff3){logger['info']('ShowDynamics365Account',_0x5387db);logger['debug'](_0x6e22('0x20'),_0x5387db,JSON['stringify'](_0x508ff3));_0xd76e57(_0x508ff3);})[_0x6e22('0x13')](function(_0x2917c2){logger[_0x6e22('0x11')](_0x6e22('0x20'),_0x2917c2[_0x6e22('0x12')],_0x5387db);_0x53f601(_0x446916[_0x6e22('0x11')](0x1f4,_0x2917c2[_0x6e22('0x12')]));});});};
\ No newline at end of file
+var _0xf820=['client','http','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetDynamics365Account','Dynamics365Account','findAll','options','where','attributes','limit','include','map','model','info','catch','find','raw','ShowDynamics365Account','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x44da09,_0x1b8cd9){var _0x31990e=function(_0x3e8026){while(--_0x3e8026){_0x44da09['push'](_0x44da09['shift']());}};_0x31990e(++_0x1b8cd9);}(_0xf820,0x86));var _0x0f82=function(_0x73d328,_0x51b2fd){_0x73d328=_0x73d328-0x0;var _0x1a889b=_0xf820[_0x73d328];return _0x1a889b;};'use strict';var _=require(_0x0f82('0x0'));var util=require(_0x0f82('0x1'));var moment=require(_0x0f82('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f82('0x3'));var fs=require('fs');var Redis=require(_0x0f82('0x4'));var db=require(_0x0f82('0x5'))['db'];var utils=require(_0x0f82('0x6'));var logger=require(_0x0f82('0x7'))(_0x0f82('0x8'));var config=require(_0x0f82('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0f82('0xa')][_0x0f82('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28df65,_0x40f244,_0x552403){return new BPromise(function(_0x4be7cb,_0x41675f){return client['request'](_0x28df65,_0x552403)[_0x0f82('0xc')](function(_0x22a121){logger['info'](_0x0f82('0xd'),_0x40f244,_0x0f82('0xe'));logger[_0x0f82('0xf')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x40f244,_0x0f82('0xe'),JSON[_0x0f82('0x10')](_0x22a121));if(_0x22a121[_0x0f82('0x11')]){if(_0x22a121['error'][_0x0f82('0x12')]===0x1f4){logger[_0x0f82('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x40f244,_0x22a121[_0x0f82('0x11')]['message']);return _0x41675f(_0x22a121['error'][_0x0f82('0x13')]);}logger[_0x0f82('0x11')](_0x0f82('0xd'),_0x40f244,_0x22a121[_0x0f82('0x11')]['message']);return _0x4be7cb(_0x22a121[_0x0f82('0x11')][_0x0f82('0x13')]);}else{logger['info'](_0x0f82('0xd'),_0x40f244,'request\x20sent');_0x4be7cb(_0x22a121[_0x0f82('0x14')]['message']);}})['catch'](function(_0x3df176){logger['error'](_0x0f82('0xd'),_0x40f244,_0x3df176);_0x41675f(_0x3df176);});});}exports[_0x0f82('0x15')]=function(_0x3e4daf){var _0x2979d3=this;return new Promise(function(_0x365f31,_0x3817df){return db[_0x0f82('0x16')][_0x0f82('0x17')]({'raw':_0x3e4daf[_0x0f82('0x18')]?_0x3e4daf['options']['raw']===undefined?!![]:![]:!![],'where':_0x3e4daf['options']?_0x3e4daf[_0x0f82('0x18')][_0x0f82('0x19')]||null:null,'attributes':_0x3e4daf[_0x0f82('0x18')]?_0x3e4daf[_0x0f82('0x18')][_0x0f82('0x1a')]||null:null,'limit':_0x3e4daf['options']?_0x3e4daf[_0x0f82('0x18')][_0x0f82('0x1b')]||null:null,'include':_0x3e4daf[_0x0f82('0x18')]?_0x3e4daf[_0x0f82('0x18')][_0x0f82('0x1c')]?_[_0x0f82('0x1d')](_0x3e4daf[_0x0f82('0x18')][_0x0f82('0x1c')],function(_0x26b414){return{'model':db[_0x26b414[_0x0f82('0x1e')]],'as':_0x26b414['as'],'attributes':_0x26b414[_0x0f82('0x1a')],'include':_0x26b414[_0x0f82('0x1c')]?_[_0x0f82('0x1d')](_0x26b414[_0x0f82('0x1c')],function(_0x115290){return{'model':db[_0x115290[_0x0f82('0x1e')]],'as':_0x115290['as'],'attributes':_0x115290[_0x0f82('0x1a')],'include':_0x115290[_0x0f82('0x1c')]?_[_0x0f82('0x1d')](_0x115290[_0x0f82('0x1c')],function(_0x47b356){return{'model':db[_0x47b356[_0x0f82('0x1e')]],'as':_0x47b356['as'],'attributes':_0x47b356[_0x0f82('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5085b4){logger[_0x0f82('0x1f')]('GetDynamics365Account',_0x3e4daf);logger[_0x0f82('0xf')](_0x0f82('0x15'),_0x3e4daf,JSON[_0x0f82('0x10')](_0x5085b4));_0x365f31(_0x5085b4);})[_0x0f82('0x20')](function(_0x27bf3f){logger[_0x0f82('0x11')](_0x0f82('0x15'),_0x27bf3f['message'],_0x3e4daf);_0x3817df(_0x2979d3[_0x0f82('0x11')](0x1f4,_0x27bf3f[_0x0f82('0x13')]));});});};exports['ShowDynamics365Account']=function(_0x3390a2){var _0x3e40cd=this;return new Promise(function(_0x47378a,_0x1a1760){return db[_0x0f82('0x16')][_0x0f82('0x21')]({'raw':_0x3390a2[_0x0f82('0x18')]?_0x3390a2[_0x0f82('0x18')][_0x0f82('0x22')]===undefined?!![]:![]:!![],'where':_0x3390a2[_0x0f82('0x18')]?_0x3390a2['options'][_0x0f82('0x19')]||null:null,'attributes':_0x3390a2[_0x0f82('0x18')]?_0x3390a2[_0x0f82('0x18')][_0x0f82('0x1a')]||null:null,'include':_0x3390a2[_0x0f82('0x18')]?_0x3390a2[_0x0f82('0x18')][_0x0f82('0x1c')]?_[_0x0f82('0x1d')](_0x3390a2['options']['include'],function(_0x4433da){return{'model':db[_0x4433da[_0x0f82('0x1e')]],'as':_0x4433da['as'],'attributes':_0x4433da[_0x0f82('0x1a')],'include':_0x4433da['include']?_[_0x0f82('0x1d')](_0x4433da[_0x0f82('0x1c')],function(_0x32ce39){return{'model':db[_0x32ce39[_0x0f82('0x1e')]],'as':_0x32ce39['as'],'attributes':_0x32ce39['attributes'],'include':_0x32ce39[_0x0f82('0x1c')]?_[_0x0f82('0x1d')](_0x32ce39[_0x0f82('0x1c')],function(_0xa85071){return{'model':db[_0xa85071[_0x0f82('0x1e')]],'as':_0xa85071['as'],'attributes':_0xa85071['attributes']};}):[]};}):[]};}):[]:[]})[_0x0f82('0xc')](function(_0x39e9b6){logger[_0x0f82('0x1f')](_0x0f82('0x23'),_0x3390a2);logger[_0x0f82('0xf')](_0x0f82('0x23'),_0x3390a2,JSON[_0x0f82('0x10')](_0x39e9b6));_0x47378a(_0x39e9b6);})[_0x0f82('0x20')](function(_0x3ab181){logger[_0x0f82('0x11')]('ShowDynamics365Account',_0x3ab181[_0x0f82('0x13')],_0x3390a2);_0x1a1760(_0x3e40cd[_0x0f82('0x11')](0x1f4,_0x3ab181[_0x0f82('0x13')]));});});};
\ No newline at end of file
index a93ebf3..2117ec7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5942=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','multer','util'];(function(_0x2a2ef0,_0x5b7152){var _0x23cc5f=function(_0x17d050){while(--_0x17d050){_0x2a2ef0['push'](_0x2a2ef0['shift']());}};_0x23cc5f(++_0x5b7152);}(_0x5942,0x16a));var _0x2594=function(_0x5b0991,_0x5ab093){_0x5b0991=_0x5b0991-0x0;var _0x244229=_0x5942[_0x5b0991];return _0x244229;};'use strict';var multer=require(_0x2594('0x0'));var util=require(_0x2594('0x1'));var path=require(_0x2594('0x2'));var timeout=require(_0x2594('0x3'));var express=require(_0x2594('0x4'));var router=express[_0x2594('0x5')]();var fs_extra=require(_0x2594('0x6'));var auth=require(_0x2594('0x7'));var interaction=require(_0x2594('0x8'));var config=require(_0x2594('0x9'));var controller=require(_0x2594('0xa'));router[_0x2594('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2594('0xb')](_0x2594('0xc'),auth[_0x2594('0xd')](),controller['show']);router[_0x2594('0xb')](_0x2594('0xe'),auth['isAuthenticated'](),controller[_0x2594('0xf')]);router['get'](_0x2594('0x10'),auth[_0x2594('0xd')](),controller[_0x2594('0x11')]);router['get'](_0x2594('0x12'),auth[_0x2594('0xd')](),controller[_0x2594('0x13')]);router[_0x2594('0x14')]('/',auth['isAuthenticated'](),controller[_0x2594('0x15')]);router[_0x2594('0x16')](_0x2594('0xc'),auth[_0x2594('0xd')](),controller[_0x2594('0x17')]);router[_0x2594('0x18')](_0x2594('0xc'),auth[_0x2594('0xd')](),controller[_0x2594('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x3bd3=['/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','show'];(function(_0x369b77,_0xb99863){var _0x37d7fa=function(_0x4c8818){while(--_0x4c8818){_0x369b77['push'](_0x369b77['shift']());}};_0x37d7fa(++_0xb99863);}(_0x3bd3,0x110));var _0x33bd=function(_0x5ec7f8,_0x5d5978){_0x5ec7f8=_0x5ec7f8-0x0;var _0x4cd2e1=_0x3bd3[_0x5ec7f8];return _0x4cd2e1;};'use strict';var multer=require(_0x33bd('0x0'));var util=require(_0x33bd('0x1'));var path=require(_0x33bd('0x2'));var timeout=require(_0x33bd('0x3'));var express=require(_0x33bd('0x4'));var router=express[_0x33bd('0x5')]();var fs_extra=require(_0x33bd('0x6'));var auth=require(_0x33bd('0x7'));var interaction=require(_0x33bd('0x8'));var config=require('../../config/environment');var controller=require(_0x33bd('0x9'));router[_0x33bd('0xa')]('/',auth[_0x33bd('0xb')](),controller[_0x33bd('0xc')]);router['get']('/:id',auth[_0x33bd('0xb')](),controller[_0x33bd('0xd')]);router[_0x33bd('0xa')](_0x33bd('0xe'),auth[_0x33bd('0xb')](),controller[_0x33bd('0xf')]);router[_0x33bd('0xa')]('/:id/subjects',auth[_0x33bd('0xb')](),controller[_0x33bd('0x10')]);router['get'](_0x33bd('0x11'),auth[_0x33bd('0xb')](),controller[_0x33bd('0x12')]);router[_0x33bd('0x13')]('/',auth[_0x33bd('0xb')](),controller[_0x33bd('0x14')]);router[_0x33bd('0x15')](_0x33bd('0x16'),auth[_0x33bd('0xb')](),controller[_0x33bd('0x17')]);router[_0x33bd('0x18')](_0x33bd('0x16'),auth['isAuthenticated'](),controller[_0x33bd('0x19')]);module['exports']=router;
\ No newline at end of file
index 11ca030..f356ecf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7db7=['sequelize','exports','STRING','ENUM','incident','phonecall','nothing','contact'];(function(_0x190c49,_0x103457){var _0x475b9a=function(_0x44f13c){while(--_0x44f13c){_0x190c49['push'](_0x190c49['shift']());}};_0x475b9a(++_0x103457);}(_0x7db7,0x198));var _0x77db=function(_0x577e97,_0x47e12f){_0x577e97=_0x577e97-0x0;var _0x1b116d=_0x7db7[_0x577e97];return _0x1b116d;};'use strict';var Sequelize=require(_0x77db('0x0'));module[_0x77db('0x1')]={'name':{'type':Sequelize[_0x77db('0x2')]},'description':{'type':Sequelize[_0x77db('0x2')]},'ticketType':{'type':Sequelize[_0x77db('0x3')](_0x77db('0x4'),_0x77db('0x5')),'defaultValue':_0x77db('0x4')},'moduleCreate':{'type':Sequelize[_0x77db('0x3')]('contact',_0x77db('0x6')),'defaultValue':_0x77db('0x7'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x989b=['nothing','contact','exports','STRING','ENUM','incident','phonecall'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x989b,0x80));var _0xb989=function(_0x3a782b,_0xb80aba){_0x3a782b=_0x3a782b-0x0;var _0x18b6db=_0x989b[_0x3a782b];return _0x18b6db;};'use strict';var Sequelize=require('sequelize');module[_0xb989('0x0')]={'name':{'type':Sequelize[_0xb989('0x1')]},'description':{'type':Sequelize[_0xb989('0x1')]},'ticketType':{'type':Sequelize[_0xb989('0x2')](_0xb989('0x3'),_0xb989('0x4')),'defaultValue':_0xb989('0x3')},'moduleCreate':{'type':Sequelize[_0xb989('0x2')]('contact',_0xb989('0x5')),'defaultValue':_0xb989('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xb989('0x1')],'allowNull':!![]}};
\ No newline at end of file
index ac09d61..caee0ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadff=['end','offset','limit','set','Content-Range','json','reject','save','then','sendStatus','error','name','index','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','update','getFields','findOne','length','getSubjects','Dynamics365Field','pick','getDescriptions','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','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/license/util','status'];(function(_0x52a857,_0xc99fa1){var _0x4e2aae=function(_0x5410d9){while(--_0x5410d9){_0x52a857['push'](_0x52a857['shift']());}};_0x4e2aae(++_0xc99fa1);}(_0xadff,0x11c));var _0xfadf=function(_0x911353,_0x1648ed){_0x911353=_0x911353-0x0;var _0x2f05fa=_0xadff[_0x911353];return _0x2f05fa;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfadf('0x0'));var rp=require(_0xfadf('0x1'));var moment=require(_0xfadf('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfadf('0x3'));var util=require('util');var path=require(_0xfadf('0x4'));var sox=require(_0xfadf('0x5'));var csv=require(_0xfadf('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfadf('0x7'));var _=require(_0xfadf('0x8'));var squel=require(_0xfadf('0x9'));var crypto=require(_0xfadf('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfadf('0xb'));var toCsv=require(_0xfadf('0x6'));var querystring=require(_0xfadf('0xc'));var Papa=require(_0xfadf('0xd'));var Redis=require(_0xfadf('0xe'));var authService=require(_0xfadf('0xf'));var qs=require(_0xfadf('0x10'));var as=require(_0xfadf('0x11'));var hardwareService=require(_0xfadf('0x12'));var logger=require(_0xfadf('0x13'))(_0xfadf('0x14'));var utils=require(_0xfadf('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfadf('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x582584,_0x5d64a9){_0x5d64a9=_0x5d64a9||0xcc;return function(_0x2b04c9){if(_0x2b04c9){return _0x582584['sendStatus'](_0x5d64a9);}return _0x582584[_0xfadf('0x17')](_0x5d64a9)[_0xfadf('0x18')]();};}function respondWithResult(_0x51aa66,_0x4113a4){_0x4113a4=_0x4113a4||0xc8;return function(_0x3c1000){if(_0x3c1000){return _0x51aa66[_0xfadf('0x17')](_0x4113a4)['json'](_0x3c1000);}};}function respondWithFilteredResult(_0x53808a,_0x2adf90){return function(_0x317ab5){if(_0x317ab5){var _0x263496=typeof _0x2adf90[_0xfadf('0x19')]==='undefined'&&typeof _0x2adf90[_0xfadf('0x1a')]==='undefined';var _0x162d06=_0x317ab5['count'];var _0x334509=_0x263496?0x0:_0x2adf90[_0xfadf('0x19')];var _0x494a2c=_0x263496?_0x317ab5['count']:_0x2adf90[_0xfadf('0x19')]+_0x2adf90[_0xfadf('0x1a')];var _0x1db4cd;if(_0x494a2c>=_0x162d06){_0x494a2c=_0x162d06;_0x1db4cd=0xc8;}else{_0x1db4cd=0xce;}_0x53808a[_0xfadf('0x17')](_0x1db4cd);return _0x53808a[_0xfadf('0x1b')](_0xfadf('0x1c'),_0x334509+'-'+_0x494a2c+'/'+_0x162d06)[_0xfadf('0x1d')](_0x317ab5);}return null;};}function patchUpdates(_0x577e24){return function(_0x38b737){try{jsonpatch['apply'](_0x38b737,_0x577e24,!![]);}catch(_0x2e28c8){return BPromise[_0xfadf('0x1e')](_0x2e28c8);}return _0x38b737[_0xfadf('0x1f')]();};}function saveUpdates(_0x451a58,_0x192fe0){return function(_0x2cf4d3){if(_0x2cf4d3){return _0x2cf4d3['update'](_0x451a58)[_0xfadf('0x20')](function(_0x8cf5b6){return _0x8cf5b6;});}return null;};}function removeEntity(_0x408385,_0x308158){return function(_0x594e42){if(_0x594e42){return _0x594e42['destroy']()[_0xfadf('0x20')](function(){_0x408385[_0xfadf('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c9acd,_0x5ad98e){return function(_0xa53884){if(!_0xa53884){_0x1c9acd[_0xfadf('0x21')](0x194);}return _0xa53884;};}function handleError(_0x2dac1a,_0x59d020){_0x59d020=_0x59d020||0x1f4;return function(_0x21351c){logger[_0xfadf('0x22')](_0x21351c['stack']);if(_0x21351c[_0xfadf('0x23')]){delete _0x21351c[_0xfadf('0x23')];}_0x2dac1a['status'](_0x59d020)['send'](_0x21351c);};}exports[_0xfadf('0x24')]=function(_0x539d34,_0xb078ce){var _0x325f2b={},_0xedc4cb={},_0x282cec={'count':0x0,'rows':[]};var _0x1e0a25=_['map'](db['Dynamics365Configuration']['rawAttributes'],function(_0x42e3fe){return{'name':_0x42e3fe[_0xfadf('0x25')],'type':_0x42e3fe[_0xfadf('0x26')][_0xfadf('0x27')]};});_0xedc4cb[_0xfadf('0x28')]=_[_0xfadf('0x29')](_0x1e0a25,'name');_0xedc4cb[_0xfadf('0x2a')]=_[_0xfadf('0x2b')](_0x539d34[_0xfadf('0x2a')]);_0xedc4cb[_0xfadf('0x2c')]=_['intersection'](_0xedc4cb['model'],_0xedc4cb[_0xfadf('0x2a')]);_0x325f2b[_0xfadf('0x2d')]=_[_0xfadf('0x2e')](_0xedc4cb[_0xfadf('0x28')],qs[_0xfadf('0x2f')](_0x539d34[_0xfadf('0x2a')][_0xfadf('0x2f')]));_0x325f2b[_0xfadf('0x2d')]=_0x325f2b[_0xfadf('0x2d')]['length']?_0x325f2b[_0xfadf('0x2d')]:_0xedc4cb[_0xfadf('0x28')];if(!_0x539d34[_0xfadf('0x2a')][_0xfadf('0x30')](_0xfadf('0x31'))){_0x325f2b[_0xfadf('0x1a')]=qs[_0xfadf('0x1a')](_0x539d34['query'][_0xfadf('0x1a')]);_0x325f2b[_0xfadf('0x19')]=qs['offset'](_0x539d34[_0xfadf('0x2a')][_0xfadf('0x19')]);}_0x325f2b[_0xfadf('0x32')]=qs[_0xfadf('0x33')](_0x539d34[_0xfadf('0x2a')][_0xfadf('0x33')]);_0x325f2b[_0xfadf('0x34')]=qs['filters'](_['pick'](_0x539d34[_0xfadf('0x2a')],_0xedc4cb[_0xfadf('0x2c')]),_0x1e0a25);if(_0x539d34[_0xfadf('0x2a')][_0xfadf('0x35')]){_0x325f2b[_0xfadf('0x34')]=_[_0xfadf('0x36')](_0x325f2b[_0xfadf('0x34')],{'$or':_[_0xfadf('0x29')](_0x1e0a25,function(_0xf3646d){if(_0xf3646d['type']!==_0xfadf('0x37')){var _0x14b4e6={};_0x14b4e6[_0xf3646d['name']]={'$like':'%'+_0x539d34[_0xfadf('0x2a')]['filter']+'%'};return _0x14b4e6;}})});}_0x325f2b=_[_0xfadf('0x36')]({},_0x325f2b,_0x539d34[_0xfadf('0x38')]);var _0x1bb36e={'where':_0x325f2b[_0xfadf('0x34')]};return db[_0xfadf('0x39')]['count'](_0x1bb36e)[_0xfadf('0x20')](function(_0x276d09){_0x282cec['count']=_0x276d09;if(_0x539d34[_0xfadf('0x2a')][_0xfadf('0x3a')]){_0x325f2b['include']=[{'all':!![]}];}return db[_0xfadf('0x39')][_0xfadf('0x3b')](_0x325f2b);})[_0xfadf('0x20')](function(_0x5af92d){_0x282cec[_0xfadf('0x3c')]=_0x5af92d;return _0x282cec;})['then'](respondWithFilteredResult(_0xb078ce,_0x325f2b))[_0xfadf('0x3d')](handleError(_0xb078ce,null));};exports[_0xfadf('0x3e')]=function(_0x188903,_0x32d614){var _0x50f047={'raw':![],'where':{'id':_0x188903[_0xfadf('0x3f')]['id']}},_0x599a74={};_0x599a74[_0xfadf('0x28')]=_[_0xfadf('0x2b')](db['Dynamics365Configuration'][_0xfadf('0x40')]);_0x599a74[_0xfadf('0x2a')]=_['keys'](_0x188903[_0xfadf('0x2a')]);_0x599a74['filters']=_[_0xfadf('0x2e')](_0x599a74[_0xfadf('0x28')],_0x599a74[_0xfadf('0x2a')]);_0x50f047[_0xfadf('0x2d')]=_[_0xfadf('0x2e')](_0x599a74[_0xfadf('0x28')],qs['fields'](_0x188903[_0xfadf('0x2a')]['fields']));_0x50f047[_0xfadf('0x2d')]=_0x50f047[_0xfadf('0x2d')]['length']?_0x50f047['attributes']:_0x599a74[_0xfadf('0x28')];if(_0x188903[_0xfadf('0x2a')][_0xfadf('0x3a')]){_0x50f047[_0xfadf('0x41')]=[{'all':!![]}];}_0x50f047=_['merge']({},_0x50f047,_0x188903[_0xfadf('0x38')]);return db[_0xfadf('0x39')][_0xfadf('0x42')](_0x50f047)[_0xfadf('0x20')](handleEntityNotFound(_0x32d614,null))['then'](respondWithResult(_0x32d614,null))['catch'](handleError(_0x32d614,null));};exports[_0xfadf('0x43')]=function(_0x42defd,_0x4c6392){return db[_0xfadf('0x39')]['create'](_0x42defd[_0xfadf('0x44')],{})[_0xfadf('0x20')](respondWithResult(_0x4c6392,0xc9))[_0xfadf('0x3d')](handleError(_0x4c6392,null));};exports[_0xfadf('0x45')]=function(_0x4e0186,_0x46a1ba){if(_0x4e0186['body']['id']){delete _0x4e0186[_0xfadf('0x44')]['id'];}return db[_0xfadf('0x39')][_0xfadf('0x42')]({'where':{'id':_0x4e0186['params']['id']}})['then'](handleEntityNotFound(_0x46a1ba,null))[_0xfadf('0x20')](saveUpdates(_0x4e0186[_0xfadf('0x44')],null))[_0xfadf('0x20')](respondWithResult(_0x46a1ba,null))[_0xfadf('0x3d')](handleError(_0x46a1ba,null));};exports['destroy']=function(_0x4da79b,_0x9464dc){return db[_0xfadf('0x39')]['find']({'where':{'id':_0x4da79b[_0xfadf('0x3f')]['id']}})[_0xfadf('0x20')](handleEntityNotFound(_0x9464dc,null))['then'](removeEntity(_0x9464dc,null))[_0xfadf('0x3d')](handleError(_0x9464dc,null));};exports[_0xfadf('0x46')]=function(_0x14e8a2,_0x3277ce,_0x2a6832){var _0x398a92={};var _0x20b8a9={};var _0x4e32ec;var _0x3542ff;return db[_0xfadf('0x39')][_0xfadf('0x47')]({'where':{'id':_0x14e8a2[_0xfadf('0x3f')]['id']}})[_0xfadf('0x20')](handleEntityNotFound(_0x3277ce,null))[_0xfadf('0x20')](function(_0xe698e9){if(_0xe698e9){_0x4e32ec=_0xe698e9;_0x20b8a9[_0xfadf('0x28')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x20b8a9[_0xfadf('0x2a')]=_['keys'](_0x14e8a2[_0xfadf('0x2a')]);_0x20b8a9[_0xfadf('0x2c')]=_[_0xfadf('0x2e')](_0x20b8a9[_0xfadf('0x28')],_0x20b8a9[_0xfadf('0x2a')]);_0x398a92[_0xfadf('0x2d')]=_[_0xfadf('0x2e')](_0x20b8a9[_0xfadf('0x28')],qs['fields'](_0x14e8a2[_0xfadf('0x2a')][_0xfadf('0x2f')]));_0x398a92[_0xfadf('0x2d')]=_0x398a92[_0xfadf('0x2d')]['length']?_0x398a92[_0xfadf('0x2d')]:_0x20b8a9[_0xfadf('0x28')];_0x398a92['order']=qs[_0xfadf('0x33')](_0x14e8a2[_0xfadf('0x2a')][_0xfadf('0x33')]);_0x398a92[_0xfadf('0x34')]=qs['filters'](_['pick'](_0x14e8a2[_0xfadf('0x2a')],_0x20b8a9[_0xfadf('0x2c')]));if(_0x14e8a2['query']['filter']){_0x398a92[_0xfadf('0x34')]=_[_0xfadf('0x36')](_0x398a92[_0xfadf('0x34')],{'$or':_[_0xfadf('0x29')](_0x398a92['attributes'],function(_0x2d609a){var _0x1e6af5={};_0x1e6af5[_0x2d609a]={'$like':'%'+_0x14e8a2[_0xfadf('0x2a')][_0xfadf('0x35')]+'%'};return _0x1e6af5;})});}_0x398a92=_['merge']({},_0x398a92,_0x14e8a2[_0xfadf('0x38')]);return _0x4e32ec['getFields'](_0x398a92);}})[_0xfadf('0x20')](function(_0x31b580){if(_0x31b580){_0x3542ff=_0x31b580[_0xfadf('0x48')];if(!_0x14e8a2[_0xfadf('0x2a')]['hasOwnProperty']('nolimit')){_0x398a92['limit']=qs[_0xfadf('0x1a')](_0x14e8a2[_0xfadf('0x2a')]['limit']);_0x398a92[_0xfadf('0x19')]=qs['offset'](_0x14e8a2[_0xfadf('0x2a')]['offset']);}return _0x4e32ec[_0xfadf('0x46')](_0x398a92);}})['then'](function(_0x27fa44){if(_0x27fa44){return _0x27fa44?{'count':_0x3542ff,'rows':_0x27fa44}:null;}})['then'](respondWithResult(_0x3277ce,null))[_0xfadf('0x3d')](handleError(_0x3277ce,null));};exports[_0xfadf('0x49')]=function(_0xe86e14,_0x2e9126,_0x350457){var _0x3ab5c7={};var _0x1198c8={};var _0xd143d8;var _0x54bfcb;return db[_0xfadf('0x39')]['findOne']({'where':{'id':_0xe86e14[_0xfadf('0x3f')]['id']}})[_0xfadf('0x20')](handleEntityNotFound(_0x2e9126,null))[_0xfadf('0x20')](function(_0x452ed6){if(_0x452ed6){_0xd143d8=_0x452ed6;_0x1198c8[_0xfadf('0x28')]=_[_0xfadf('0x2b')](db[_0xfadf('0x4a')][_0xfadf('0x40')]);_0x1198c8[_0xfadf('0x2a')]=_[_0xfadf('0x2b')](_0xe86e14[_0xfadf('0x2a')]);_0x1198c8[_0xfadf('0x2c')]=_['intersection'](_0x1198c8[_0xfadf('0x28')],_0x1198c8[_0xfadf('0x2a')]);_0x3ab5c7[_0xfadf('0x2d')]=_[_0xfadf('0x2e')](_0x1198c8[_0xfadf('0x28')],qs[_0xfadf('0x2f')](_0xe86e14[_0xfadf('0x2a')][_0xfadf('0x2f')]));_0x3ab5c7[_0xfadf('0x2d')]=_0x3ab5c7['attributes'][_0xfadf('0x48')]?_0x3ab5c7[_0xfadf('0x2d')]:_0x1198c8[_0xfadf('0x28')];_0x3ab5c7[_0xfadf('0x32')]=qs['sort'](_0xe86e14[_0xfadf('0x2a')][_0xfadf('0x33')]);_0x3ab5c7[_0xfadf('0x34')]=qs[_0xfadf('0x2c')](_[_0xfadf('0x4b')](_0xe86e14[_0xfadf('0x2a')],_0x1198c8[_0xfadf('0x2c')]));if(_0xe86e14[_0xfadf('0x2a')][_0xfadf('0x35')]){_0x3ab5c7[_0xfadf('0x34')]=_[_0xfadf('0x36')](_0x3ab5c7[_0xfadf('0x34')],{'$or':_['map'](_0x3ab5c7[_0xfadf('0x2d')],function(_0x50aab0){var _0x3c1a6d={};_0x3c1a6d[_0x50aab0]={'$like':'%'+_0xe86e14[_0xfadf('0x2a')]['filter']+'%'};return _0x3c1a6d;})});}_0x3ab5c7=_[_0xfadf('0x36')]({},_0x3ab5c7,_0xe86e14[_0xfadf('0x38')]);return _0xd143d8[_0xfadf('0x49')](_0x3ab5c7);}})['then'](function(_0x69468f){if(_0x69468f){_0x54bfcb=_0x69468f[_0xfadf('0x48')];if(!_0xe86e14[_0xfadf('0x2a')]['hasOwnProperty'](_0xfadf('0x31'))){_0x3ab5c7[_0xfadf('0x1a')]=qs[_0xfadf('0x1a')](_0xe86e14[_0xfadf('0x2a')][_0xfadf('0x1a')]);_0x3ab5c7[_0xfadf('0x19')]=qs[_0xfadf('0x19')](_0xe86e14[_0xfadf('0x2a')]['offset']);}return _0xd143d8[_0xfadf('0x49')](_0x3ab5c7);}})[_0xfadf('0x20')](function(_0x453934){if(_0x453934){return _0x453934?{'count':_0x54bfcb,'rows':_0x453934}:null;}})[_0xfadf('0x20')](respondWithResult(_0x2e9126,null))['catch'](handleError(_0x2e9126,null));};exports[_0xfadf('0x4c')]=function(_0x1de3a1,_0x1e7f46,_0x59c770){var _0x1e3d9b={};var _0x566e79={};var _0x58d4fc;var _0xd35a47;return db[_0xfadf('0x39')]['findOne']({'where':{'id':_0x1de3a1[_0xfadf('0x3f')]['id']}})[_0xfadf('0x20')](handleEntityNotFound(_0x1e7f46,null))[_0xfadf('0x20')](function(_0x135c44){if(_0x135c44){_0x58d4fc=_0x135c44;_0x566e79[_0xfadf('0x28')]=_[_0xfadf('0x2b')](db['Dynamics365Field'][_0xfadf('0x40')]);_0x566e79['query']=_['keys'](_0x1de3a1[_0xfadf('0x2a')]);_0x566e79['filters']=_[_0xfadf('0x2e')](_0x566e79[_0xfadf('0x28')],_0x566e79[_0xfadf('0x2a')]);_0x1e3d9b['attributes']=_[_0xfadf('0x2e')](_0x566e79['model'],qs[_0xfadf('0x2f')](_0x1de3a1['query'][_0xfadf('0x2f')]));_0x1e3d9b[_0xfadf('0x2d')]=_0x1e3d9b['attributes'][_0xfadf('0x48')]?_0x1e3d9b[_0xfadf('0x2d')]:_0x566e79[_0xfadf('0x28')];_0x1e3d9b['order']=qs['sort'](_0x1de3a1['query']['sort']);_0x1e3d9b[_0xfadf('0x34')]=qs[_0xfadf('0x2c')](_[_0xfadf('0x4b')](_0x1de3a1[_0xfadf('0x2a')],_0x566e79['filters']));if(_0x1de3a1[_0xfadf('0x2a')][_0xfadf('0x35')]){_0x1e3d9b[_0xfadf('0x34')]=_['merge'](_0x1e3d9b[_0xfadf('0x34')],{'$or':_[_0xfadf('0x29')](_0x1e3d9b[_0xfadf('0x2d')],function(_0x4e4da8){var _0x2c8b1e={};_0x2c8b1e[_0x4e4da8]={'$like':'%'+_0x1de3a1[_0xfadf('0x2a')][_0xfadf('0x35')]+'%'};return _0x2c8b1e;})});}_0x1e3d9b=_[_0xfadf('0x36')]({},_0x1e3d9b,_0x1de3a1[_0xfadf('0x38')]);return _0x58d4fc['getDescriptions'](_0x1e3d9b);}})['then'](function(_0x2d89ea){if(_0x2d89ea){_0xd35a47=_0x2d89ea[_0xfadf('0x48')];if(!_0x1de3a1[_0xfadf('0x2a')][_0xfadf('0x30')](_0xfadf('0x31'))){_0x1e3d9b[_0xfadf('0x1a')]=qs[_0xfadf('0x1a')](_0x1de3a1[_0xfadf('0x2a')][_0xfadf('0x1a')]);_0x1e3d9b[_0xfadf('0x19')]=qs[_0xfadf('0x19')](_0x1de3a1['query']['offset']);}return _0x58d4fc[_0xfadf('0x4c')](_0x1e3d9b);}})['then'](function(_0x10055a){if(_0x10055a){return _0x10055a?{'count':_0xd35a47,'rows':_0x10055a}:null;}})['then'](respondWithResult(_0x1e7f46,null))[_0xfadf('0x3d')](handleError(_0x1e7f46,null));};
\ No newline at end of file
+var _0x6abd=['where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','params','include','options','catch','create','body','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort'];(function(_0x224dda,_0x16d0f9){var _0x2987ac=function(_0x3b1033){while(--_0x3b1033){_0x224dda['push'](_0x224dda['shift']());}};_0x2987ac(++_0x16d0f9);}(_0x6abd,0x153));var _0xd6ab=function(_0x130cbf,_0x3f5ea2){_0x130cbf=_0x130cbf-0x0;var _0xe3d51c=_0x6abd[_0x130cbf];return _0xe3d51c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6ab('0x0'));var zipdir=require(_0xd6ab('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd6ab('0x2'));var moment=require(_0xd6ab('0x3'));var BPromise=require(_0xd6ab('0x4'));var Mustache=require(_0xd6ab('0x5'));var util=require('util');var path=require(_0xd6ab('0x6'));var sox=require(_0xd6ab('0x7'));var csv=require('to-csv');var ejs=require(_0xd6ab('0x8'));var fs=require('fs');var fs_extra=require(_0xd6ab('0x9'));var _=require(_0xd6ab('0xa'));var squel=require('squel');var crypto=require(_0xd6ab('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd6ab('0xc'));var toCsv=require(_0xd6ab('0xd'));var querystring=require(_0xd6ab('0xe'));var Papa=require(_0xd6ab('0xf'));var Redis=require(_0xd6ab('0x10'));var authService=require(_0xd6ab('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6ab('0x12'));var logger=require(_0xd6ab('0x13'))(_0xd6ab('0x14'));var utils=require(_0xd6ab('0x15'));var config=require(_0xd6ab('0x16'));var licenseUtil=require(_0xd6ab('0x17'));var db=require(_0xd6ab('0x18'))['db'];function respondWithStatusCode(_0x31c514,_0x2e0eb6){_0x2e0eb6=_0x2e0eb6||0xcc;return function(_0x1b3fb7){if(_0x1b3fb7){return _0x31c514['sendStatus'](_0x2e0eb6);}return _0x31c514[_0xd6ab('0x19')](_0x2e0eb6)['end']();};}function respondWithResult(_0x305cb6,_0x314240){_0x314240=_0x314240||0xc8;return function(_0x8a12e7){if(_0x8a12e7){return _0x305cb6[_0xd6ab('0x19')](_0x314240)[_0xd6ab('0x1a')](_0x8a12e7);}};}function respondWithFilteredResult(_0x157fb8,_0x279224){return function(_0x33f20c){if(_0x33f20c){var _0x3b9e82=typeof _0x279224[_0xd6ab('0x1b')]==='undefined'&&typeof _0x279224[_0xd6ab('0x1c')]===_0xd6ab('0x1d');var _0x40d92e=_0x33f20c[_0xd6ab('0x1e')];var _0x4ef230=_0x3b9e82?0x0:_0x279224[_0xd6ab('0x1b')];var _0x548e8d=_0x3b9e82?_0x33f20c['count']:_0x279224['offset']+_0x279224[_0xd6ab('0x1c')];var _0x5b190f;if(_0x548e8d>=_0x40d92e){_0x548e8d=_0x40d92e;_0x5b190f=0xc8;}else{_0x5b190f=0xce;}_0x157fb8[_0xd6ab('0x19')](_0x5b190f);return _0x157fb8[_0xd6ab('0x1f')](_0xd6ab('0x20'),_0x4ef230+'-'+_0x548e8d+'/'+_0x40d92e)[_0xd6ab('0x1a')](_0x33f20c);}return null;};}function patchUpdates(_0x28b235){return function(_0x2aeeb9){try{jsonpatch[_0xd6ab('0x21')](_0x2aeeb9,_0x28b235,!![]);}catch(_0x397395){return BPromise[_0xd6ab('0x22')](_0x397395);}return _0x2aeeb9[_0xd6ab('0x23')]();};}function saveUpdates(_0x5d4409,_0x192571){return function(_0x41d367){if(_0x41d367){return _0x41d367[_0xd6ab('0x24')](_0x5d4409)[_0xd6ab('0x25')](function(_0x200a70){return _0x200a70;});}return null;};}function removeEntity(_0x7f8c4,_0x291269){return function(_0x2a25e6){if(_0x2a25e6){return _0x2a25e6[_0xd6ab('0x26')]()[_0xd6ab('0x25')](function(){_0x7f8c4[_0xd6ab('0x19')](0xcc)[_0xd6ab('0x27')]();});}};}function handleEntityNotFound(_0x36084f,_0x1fee72){return function(_0x54abb9){if(!_0x54abb9){_0x36084f[_0xd6ab('0x28')](0x194);}return _0x54abb9;};}function handleError(_0x55a765,_0x560f87){_0x560f87=_0x560f87||0x1f4;return function(_0x524b1b){logger['error'](_0x524b1b[_0xd6ab('0x29')]);if(_0x524b1b[_0xd6ab('0x2a')]){delete _0x524b1b[_0xd6ab('0x2a')];}_0x55a765[_0xd6ab('0x19')](_0x560f87)[_0xd6ab('0x2b')](_0x524b1b);};}exports[_0xd6ab('0x2c')]=function(_0x3e4cc6,_0x4a999c){var _0xd9a3d9={},_0x59a4b7={},_0x1e6f47={'count':0x0,'rows':[]};var _0x16a5b9=_['map'](db[_0xd6ab('0x2d')][_0xd6ab('0x2e')],function(_0x4b5927){return{'name':_0x4b5927[_0xd6ab('0x2f')],'type':_0x4b5927[_0xd6ab('0x30')][_0xd6ab('0x31')]};});_0x59a4b7[_0xd6ab('0x32')]=_['map'](_0x16a5b9,'name');_0x59a4b7[_0xd6ab('0x33')]=_[_0xd6ab('0x34')](_0x3e4cc6[_0xd6ab('0x33')]);_0x59a4b7[_0xd6ab('0x35')]=_[_0xd6ab('0x36')](_0x59a4b7[_0xd6ab('0x32')],_0x59a4b7['query']);_0xd9a3d9['attributes']=_[_0xd6ab('0x36')](_0x59a4b7[_0xd6ab('0x32')],qs[_0xd6ab('0x37')](_0x3e4cc6['query'][_0xd6ab('0x37')]));_0xd9a3d9[_0xd6ab('0x38')]=_0xd9a3d9[_0xd6ab('0x38')][_0xd6ab('0x39')]?_0xd9a3d9[_0xd6ab('0x38')]:_0x59a4b7[_0xd6ab('0x32')];if(!_0x3e4cc6[_0xd6ab('0x33')][_0xd6ab('0x3a')](_0xd6ab('0x3b'))){_0xd9a3d9[_0xd6ab('0x1c')]=qs[_0xd6ab('0x1c')](_0x3e4cc6['query'][_0xd6ab('0x1c')]);_0xd9a3d9[_0xd6ab('0x1b')]=qs['offset'](_0x3e4cc6['query'][_0xd6ab('0x1b')]);}_0xd9a3d9['order']=qs[_0xd6ab('0x3c')](_0x3e4cc6['query'][_0xd6ab('0x3c')]);_0xd9a3d9[_0xd6ab('0x3d')]=qs['filters'](_[_0xd6ab('0x3e')](_0x3e4cc6[_0xd6ab('0x33')],_0x59a4b7['filters']),_0x16a5b9);if(_0x3e4cc6['query'][_0xd6ab('0x3f')]){_0xd9a3d9['where']=_[_0xd6ab('0x40')](_0xd9a3d9[_0xd6ab('0x3d')],{'$or':_[_0xd6ab('0x41')](_0x16a5b9,function(_0x200ad9){if(_0x200ad9[_0xd6ab('0x30')]!==_0xd6ab('0x42')){var _0x1733d2={};_0x1733d2[_0x200ad9[_0xd6ab('0x2a')]]={'$like':'%'+_0x3e4cc6[_0xd6ab('0x33')][_0xd6ab('0x3f')]+'%'};return _0x1733d2;}})});}_0xd9a3d9=_[_0xd6ab('0x40')]({},_0xd9a3d9,_0x3e4cc6['options']);var _0x1e851d={'where':_0xd9a3d9[_0xd6ab('0x3d')]};return db['Dynamics365Configuration']['count'](_0x1e851d)[_0xd6ab('0x25')](function(_0x1520b0){_0x1e6f47[_0xd6ab('0x1e')]=_0x1520b0;if(_0x3e4cc6[_0xd6ab('0x33')][_0xd6ab('0x43')]){_0xd9a3d9['include']=[{'all':!![]}];}return db[_0xd6ab('0x2d')][_0xd6ab('0x44')](_0xd9a3d9);})[_0xd6ab('0x25')](function(_0x3cfffb){_0x1e6f47['rows']=_0x3cfffb;return _0x1e6f47;})[_0xd6ab('0x25')](respondWithFilteredResult(_0x4a999c,_0xd9a3d9))['catch'](handleError(_0x4a999c,null));};exports['show']=function(_0x4fc209,_0x128864){var _0x3aa820={'raw':![],'where':{'id':_0x4fc209[_0xd6ab('0x45')]['id']}},_0x3cdff9={};_0x3cdff9[_0xd6ab('0x32')]=_[_0xd6ab('0x34')](db[_0xd6ab('0x2d')][_0xd6ab('0x2e')]);_0x3cdff9[_0xd6ab('0x33')]=_[_0xd6ab('0x34')](_0x4fc209[_0xd6ab('0x33')]);_0x3cdff9[_0xd6ab('0x35')]=_['intersection'](_0x3cdff9[_0xd6ab('0x32')],_0x3cdff9[_0xd6ab('0x33')]);_0x3aa820['attributes']=_['intersection'](_0x3cdff9[_0xd6ab('0x32')],qs['fields'](_0x4fc209[_0xd6ab('0x33')]['fields']));_0x3aa820[_0xd6ab('0x38')]=_0x3aa820[_0xd6ab('0x38')][_0xd6ab('0x39')]?_0x3aa820[_0xd6ab('0x38')]:_0x3cdff9[_0xd6ab('0x32')];if(_0x4fc209[_0xd6ab('0x33')][_0xd6ab('0x43')]){_0x3aa820[_0xd6ab('0x46')]=[{'all':!![]}];}_0x3aa820=_[_0xd6ab('0x40')]({},_0x3aa820,_0x4fc209[_0xd6ab('0x47')]);return db[_0xd6ab('0x2d')]['find'](_0x3aa820)[_0xd6ab('0x25')](handleEntityNotFound(_0x128864,null))[_0xd6ab('0x25')](respondWithResult(_0x128864,null))[_0xd6ab('0x48')](handleError(_0x128864,null));};exports['create']=function(_0x1bc951,_0x485d4e){return db[_0xd6ab('0x2d')][_0xd6ab('0x49')](_0x1bc951[_0xd6ab('0x4a')],{})[_0xd6ab('0x25')](respondWithResult(_0x485d4e,0xc9))[_0xd6ab('0x48')](handleError(_0x485d4e,null));};exports[_0xd6ab('0x24')]=function(_0x56cd6b,_0x1e9937){if(_0x56cd6b[_0xd6ab('0x4a')]['id']){delete _0x56cd6b[_0xd6ab('0x4a')]['id'];}return db[_0xd6ab('0x2d')]['find']({'where':{'id':_0x56cd6b['params']['id']}})[_0xd6ab('0x25')](handleEntityNotFound(_0x1e9937,null))['then'](saveUpdates(_0x56cd6b[_0xd6ab('0x4a')],null))[_0xd6ab('0x25')](respondWithResult(_0x1e9937,null))[_0xd6ab('0x48')](handleError(_0x1e9937,null));};exports['destroy']=function(_0x34e21d,_0x183ced){return db[_0xd6ab('0x2d')]['find']({'where':{'id':_0x34e21d[_0xd6ab('0x45')]['id']}})[_0xd6ab('0x25')](handleEntityNotFound(_0x183ced,null))[_0xd6ab('0x25')](removeEntity(_0x183ced,null))[_0xd6ab('0x48')](handleError(_0x183ced,null));};exports[_0xd6ab('0x4b')]=function(_0x57b692,_0x29011d,_0x4ea78e){var _0x3d35d7={};var _0x786f66={};var _0x379499;var _0x26c0fd;return db['Dynamics365Configuration'][_0xd6ab('0x4c')]({'where':{'id':_0x57b692['params']['id']}})['then'](handleEntityNotFound(_0x29011d,null))[_0xd6ab('0x25')](function(_0x4a0e2b){if(_0x4a0e2b){_0x379499=_0x4a0e2b;_0x786f66[_0xd6ab('0x32')]=_['keys'](db['Dynamics365Field'][_0xd6ab('0x2e')]);_0x786f66[_0xd6ab('0x33')]=_['keys'](_0x57b692[_0xd6ab('0x33')]);_0x786f66[_0xd6ab('0x35')]=_['intersection'](_0x786f66[_0xd6ab('0x32')],_0x786f66['query']);_0x3d35d7[_0xd6ab('0x38')]=_['intersection'](_0x786f66[_0xd6ab('0x32')],qs[_0xd6ab('0x37')](_0x57b692[_0xd6ab('0x33')]['fields']));_0x3d35d7['attributes']=_0x3d35d7[_0xd6ab('0x38')][_0xd6ab('0x39')]?_0x3d35d7['attributes']:_0x786f66['model'];_0x3d35d7['order']=qs[_0xd6ab('0x3c')](_0x57b692['query'][_0xd6ab('0x3c')]);_0x3d35d7[_0xd6ab('0x3d')]=qs[_0xd6ab('0x35')](_[_0xd6ab('0x3e')](_0x57b692[_0xd6ab('0x33')],_0x786f66[_0xd6ab('0x35')]));if(_0x57b692[_0xd6ab('0x33')]['filter']){_0x3d35d7[_0xd6ab('0x3d')]=_[_0xd6ab('0x40')](_0x3d35d7[_0xd6ab('0x3d')],{'$or':_[_0xd6ab('0x41')](_0x3d35d7[_0xd6ab('0x38')],function(_0x5d383a){var _0xa9e41a={};_0xa9e41a[_0x5d383a]={'$like':'%'+_0x57b692[_0xd6ab('0x33')][_0xd6ab('0x3f')]+'%'};return _0xa9e41a;})});}_0x3d35d7=_['merge']({},_0x3d35d7,_0x57b692[_0xd6ab('0x47')]);return _0x379499['getFields'](_0x3d35d7);}})['then'](function(_0xcaacd6){if(_0xcaacd6){_0x26c0fd=_0xcaacd6[_0xd6ab('0x39')];if(!_0x57b692['query'][_0xd6ab('0x3a')]('nolimit')){_0x3d35d7['limit']=qs[_0xd6ab('0x1c')](_0x57b692[_0xd6ab('0x33')][_0xd6ab('0x1c')]);_0x3d35d7[_0xd6ab('0x1b')]=qs[_0xd6ab('0x1b')](_0x57b692[_0xd6ab('0x33')][_0xd6ab('0x1b')]);}return _0x379499['getFields'](_0x3d35d7);}})[_0xd6ab('0x25')](function(_0xc650fb){if(_0xc650fb){return _0xc650fb?{'count':_0x26c0fd,'rows':_0xc650fb}:null;}})[_0xd6ab('0x25')](respondWithResult(_0x29011d,null))[_0xd6ab('0x48')](handleError(_0x29011d,null));};exports['getSubjects']=function(_0x409098,_0x2aa9f8,_0x339d26){var _0x4c0b08={};var _0x30a2e8={};var _0x53e6d5;var _0x51d430;return db[_0xd6ab('0x2d')]['findOne']({'where':{'id':_0x409098['params']['id']}})[_0xd6ab('0x25')](handleEntityNotFound(_0x2aa9f8,null))['then'](function(_0x10c116){if(_0x10c116){_0x53e6d5=_0x10c116;_0x30a2e8['model']=_['keys'](db[_0xd6ab('0x4d')][_0xd6ab('0x2e')]);_0x30a2e8[_0xd6ab('0x33')]=_[_0xd6ab('0x34')](_0x409098[_0xd6ab('0x33')]);_0x30a2e8['filters']=_[_0xd6ab('0x36')](_0x30a2e8[_0xd6ab('0x32')],_0x30a2e8[_0xd6ab('0x33')]);_0x4c0b08['attributes']=_[_0xd6ab('0x36')](_0x30a2e8[_0xd6ab('0x32')],qs[_0xd6ab('0x37')](_0x409098[_0xd6ab('0x33')][_0xd6ab('0x37')]));_0x4c0b08[_0xd6ab('0x38')]=_0x4c0b08[_0xd6ab('0x38')][_0xd6ab('0x39')]?_0x4c0b08[_0xd6ab('0x38')]:_0x30a2e8[_0xd6ab('0x32')];_0x4c0b08['order']=qs['sort'](_0x409098['query']['sort']);_0x4c0b08[_0xd6ab('0x3d')]=qs[_0xd6ab('0x35')](_[_0xd6ab('0x3e')](_0x409098[_0xd6ab('0x33')],_0x30a2e8[_0xd6ab('0x35')]));if(_0x409098[_0xd6ab('0x33')]['filter']){_0x4c0b08[_0xd6ab('0x3d')]=_['merge'](_0x4c0b08['where'],{'$or':_['map'](_0x4c0b08[_0xd6ab('0x38')],function(_0x4a775e){var _0x51927b={};_0x51927b[_0x4a775e]={'$like':'%'+_0x409098[_0xd6ab('0x33')][_0xd6ab('0x3f')]+'%'};return _0x51927b;})});}_0x4c0b08=_[_0xd6ab('0x40')]({},_0x4c0b08,_0x409098[_0xd6ab('0x47')]);return _0x53e6d5[_0xd6ab('0x4e')](_0x4c0b08);}})[_0xd6ab('0x25')](function(_0x1d0644){if(_0x1d0644){_0x51d430=_0x1d0644[_0xd6ab('0x39')];if(!_0x409098[_0xd6ab('0x33')]['hasOwnProperty'](_0xd6ab('0x3b'))){_0x4c0b08[_0xd6ab('0x1c')]=qs[_0xd6ab('0x1c')](_0x409098['query']['limit']);_0x4c0b08['offset']=qs[_0xd6ab('0x1b')](_0x409098[_0xd6ab('0x33')][_0xd6ab('0x1b')]);}return _0x53e6d5[_0xd6ab('0x4e')](_0x4c0b08);}})[_0xd6ab('0x25')](function(_0x1a4fea){if(_0x1a4fea){return _0x1a4fea?{'count':_0x51d430,'rows':_0x1a4fea}:null;}})[_0xd6ab('0x25')](respondWithResult(_0x2aa9f8,null))[_0xd6ab('0x48')](handleError(_0x2aa9f8,null));};exports[_0xd6ab('0x4f')]=function(_0x3f22a7,_0x340615,_0x3806a7){var _0x157eb3={};var _0x21b374={};var _0x1bb88f;var _0x4d2b3;return db[_0xd6ab('0x2d')][_0xd6ab('0x4c')]({'where':{'id':_0x3f22a7[_0xd6ab('0x45')]['id']}})['then'](handleEntityNotFound(_0x340615,null))[_0xd6ab('0x25')](function(_0x573027){if(_0x573027){_0x1bb88f=_0x573027;_0x21b374[_0xd6ab('0x32')]=_[_0xd6ab('0x34')](db[_0xd6ab('0x4d')][_0xd6ab('0x2e')]);_0x21b374[_0xd6ab('0x33')]=_[_0xd6ab('0x34')](_0x3f22a7[_0xd6ab('0x33')]);_0x21b374[_0xd6ab('0x35')]=_[_0xd6ab('0x36')](_0x21b374[_0xd6ab('0x32')],_0x21b374[_0xd6ab('0x33')]);_0x157eb3[_0xd6ab('0x38')]=_[_0xd6ab('0x36')](_0x21b374[_0xd6ab('0x32')],qs[_0xd6ab('0x37')](_0x3f22a7[_0xd6ab('0x33')][_0xd6ab('0x37')]));_0x157eb3[_0xd6ab('0x38')]=_0x157eb3[_0xd6ab('0x38')][_0xd6ab('0x39')]?_0x157eb3['attributes']:_0x21b374[_0xd6ab('0x32')];_0x157eb3['order']=qs['sort'](_0x3f22a7[_0xd6ab('0x33')][_0xd6ab('0x3c')]);_0x157eb3[_0xd6ab('0x3d')]=qs[_0xd6ab('0x35')](_[_0xd6ab('0x3e')](_0x3f22a7[_0xd6ab('0x33')],_0x21b374['filters']));if(_0x3f22a7['query'][_0xd6ab('0x3f')]){_0x157eb3[_0xd6ab('0x3d')]=_[_0xd6ab('0x40')](_0x157eb3['where'],{'$or':_['map'](_0x157eb3[_0xd6ab('0x38')],function(_0x1432bd){var _0x41223f={};_0x41223f[_0x1432bd]={'$like':'%'+_0x3f22a7[_0xd6ab('0x33')][_0xd6ab('0x3f')]+'%'};return _0x41223f;})});}_0x157eb3=_[_0xd6ab('0x40')]({},_0x157eb3,_0x3f22a7['options']);return _0x1bb88f[_0xd6ab('0x4f')](_0x157eb3);}})['then'](function(_0x24bba4){if(_0x24bba4){_0x4d2b3=_0x24bba4['length'];if(!_0x3f22a7['query']['hasOwnProperty']('nolimit')){_0x157eb3[_0xd6ab('0x1c')]=qs['limit'](_0x3f22a7[_0xd6ab('0x33')][_0xd6ab('0x1c')]);_0x157eb3[_0xd6ab('0x1b')]=qs[_0xd6ab('0x1b')](_0x3f22a7[_0xd6ab('0x33')][_0xd6ab('0x1b')]);}return _0x1bb88f[_0xd6ab('0x4f')](_0x157eb3);}})[_0xd6ab('0x25')](function(_0x3a8990){if(_0x3a8990){return _0x3a8990?{'count':_0x4d2b3,'rows':_0x3a8990}:null;}})['then'](respondWithResult(_0x340615,null))[_0xd6ab('0x48')](handleError(_0x340615,null));};
\ No newline at end of file
index 2ca6031..7a1f21a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d6=['path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5d8676,_0x2a60e8){var _0x10e67c=function(_0x52d3f6){while(--_0x52d3f6){_0x5d8676['push'](_0x5d8676['shift']());}};_0x10e67c(++_0x2a60e8);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x3f1cdb,_0x3f7860){_0x3f1cdb=_0x3f1cdb-0x0;var _0x474c72=_0xd6d6[_0x3f1cdb];return _0x474c72;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var logger=require(_0x6d6d('0x2'))(_0x6d6d('0x3'));var moment=require('moment');var BPromise=require(_0x6d6d('0x4'));var rp=require(_0x6d6d('0x5'));var fs=require('fs');var path=require(_0x6d6d('0x6'));var rimraf=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var attributes=require(_0x6d6d('0x9'));module[_0x6d6d('0xa')]=function(_0x5702dc,_0x210ff7){return _0x5702dc[_0x6d6d('0xb')](_0x6d6d('0xc'),attributes,{'tableName':_0x6d6d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb43b=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird','path'];(function(_0x3bb86c,_0x4be0d4){var _0x1677b2=function(_0x27a871){while(--_0x27a871){_0x3bb86c['push'](_0x3bb86c['shift']());}};_0x1677b2(++_0x4be0d4);}(_0xb43b,0x1b2));var _0xbb43=function(_0x18d6c7,_0x58d160){_0x18d6c7=_0x18d6c7-0x0;var _0x5a23e0=_0xb43b[_0x18d6c7];return _0x5a23e0;};'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 f73917e..7039ddf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52b0=['http','request','then','info','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','client'];(function(_0x20f80d,_0x5c0bbe){var _0x26af33=function(_0x170c79){while(--_0x170c79){_0x20f80d['push'](_0x20f80d['shift']());}};_0x26af33(++_0x5c0bbe);}(_0x52b0,0x6b));var _0x052b=function(_0x418f40,_0x268ba6){_0x418f40=_0x418f40-0x0;var _0xf236df=_0x52b0[_0x418f40];return _0xf236df;};'use strict';var _=require('lodash');var util=require(_0x052b('0x0'));var moment=require(_0x052b('0x1'));var BPromise=require(_0x052b('0x2'));var rs=require(_0x052b('0x3'));var fs=require('fs');var Redis=require(_0x052b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x052b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x052b('0x6')][_0x052b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x57f07c,_0x51f5c0,_0x3ca6e2){return new BPromise(function(_0x2fc5f3,_0xebec39){return client[_0x052b('0x8')](_0x57f07c,_0x3ca6e2)[_0x052b('0x9')](function(_0x2f6f3d){logger[_0x052b('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0x51f5c0,_0x052b('0xb'));logger['debug'](_0x052b('0xc'),_0x51f5c0,_0x052b('0xb'),JSON['stringify'](_0x2f6f3d));if(_0x2f6f3d[_0x052b('0xd')]){if(_0x2f6f3d[_0x052b('0xd')][_0x052b('0xe')]===0x1f4){logger[_0x052b('0xd')](_0x052b('0xf'),_0x51f5c0,_0x2f6f3d['error'][_0x052b('0x10')]);return _0xebec39(_0x2f6f3d[_0x052b('0xd')]['message']);}logger['error'](_0x052b('0xf'),_0x51f5c0,_0x2f6f3d[_0x052b('0xd')][_0x052b('0x10')]);return _0x2fc5f3(_0x2f6f3d['error'][_0x052b('0x10')]);}else{logger[_0x052b('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0x51f5c0,_0x052b('0xb'));_0x2fc5f3(_0x2f6f3d[_0x052b('0x11')]['message']);}})[_0x052b('0x12')](function(_0x436cca){logger[_0x052b('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x51f5c0,_0x436cca);_0xebec39(_0x436cca);});});}
\ No newline at end of file
+var _0x567e=['then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','request'];(function(_0x5912b2,_0x227589){var _0x44b48e=function(_0x442be0){while(--_0x442be0){_0x5912b2['push'](_0x5912b2['shift']());}};_0x44b48e(++_0x227589);}(_0x567e,0x155));var _0xe567=function(_0x1efed0,_0x58d584){_0x1efed0=_0x1efed0-0x0;var _0x17115e=_0x567e[_0x1efed0];return _0x17115e;};'use strict';var _=require(_0xe567('0x0'));var util=require(_0xe567('0x1'));var moment=require(_0xe567('0x2'));var BPromise=require(_0xe567('0x3'));var rs=require(_0xe567('0x4'));var fs=require('fs');var Redis=require(_0xe567('0x5'));var db=require(_0xe567('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe567('0x7'));var jayson=require(_0xe567('0x8'));var client=jayson['client'][_0xe567('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13efa5,_0x3d7354,_0x2eae9a){return new BPromise(function(_0x170031,_0x5083ce){return client[_0xe567('0xa')](_0x13efa5,_0x2eae9a)[_0xe567('0xb')](function(_0x53f2d2){logger[_0xe567('0xc')](_0xe567('0xd'),_0x3d7354,_0xe567('0xe'));logger[_0xe567('0xf')](_0xe567('0x10'),_0x3d7354,_0xe567('0xe'),JSON['stringify'](_0x53f2d2));if(_0x53f2d2[_0xe567('0x11')]){if(_0x53f2d2['error'][_0xe567('0x12')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x3d7354,_0x53f2d2[_0xe567('0x11')][_0xe567('0x13')]);return _0x5083ce(_0x53f2d2['error'][_0xe567('0x13')]);}logger[_0xe567('0x11')](_0xe567('0xd'),_0x3d7354,_0x53f2d2[_0xe567('0x11')][_0xe567('0x13')]);return _0x170031(_0x53f2d2['error']['message']);}else{logger[_0xe567('0xc')](_0xe567('0xd'),_0x3d7354,_0xe567('0xe'));_0x170031(_0x53f2d2[_0xe567('0x14')][_0xe567('0x13')]);}})[_0xe567('0x15')](function(_0x292d5f){logger[_0xe567('0x11')](_0xe567('0xd'),_0x3d7354,_0x292d5f);_0x5083ce(_0x292d5f);});});}
\ No newline at end of file
index fae8e77..f4dc8b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f49=['exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy'];(function(_0x4271f0,_0x298337){var _0x1d4f5a=function(_0x418f9f){while(--_0x418f9f){_0x4271f0['push'](_0x4271f0['shift']());}};_0x1d4f5a(++_0x298337);}(_0x6f49,0x131));var _0x96f4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6f49[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x96f4('0x0'));var path=require('path');var timeout=require(_0x96f4('0x1'));var express=require(_0x96f4('0x2'));var router=express['Router']();var fs_extra=require(_0x96f4('0x3'));var auth=require(_0x96f4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x96f4('0x5'));var controller=require(_0x96f4('0x6'));router[_0x96f4('0x7')]('/',auth[_0x96f4('0x8')](),controller[_0x96f4('0x9')]);router[_0x96f4('0x7')](_0x96f4('0xa'),auth[_0x96f4('0x8')](),controller[_0x96f4('0xb')]);router[_0x96f4('0xc')]('/',auth[_0x96f4('0x8')](),controller[_0x96f4('0xd')]);router[_0x96f4('0xe')](_0x96f4('0xa'),auth['isAuthenticated'](),controller[_0x96f4('0xf')]);router[_0x96f4('0x10')](_0x96f4('0xa'),auth[_0x96f4('0x8')](),controller[_0x96f4('0x11')]);module[_0x96f4('0x12')]=router;
\ No newline at end of file
+var _0x3e2f=['show','post','create','/:id','update','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index'];(function(_0x766402,_0x3d765f){var _0x2a8c45=function(_0x44405d){while(--_0x44405d){_0x766402['push'](_0x766402['shift']());}};_0x2a8c45(++_0x3d765f);}(_0x3e2f,0x66));var _0xf3e2=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x3e2f[_0x5a776b];return _0xbbef59;};'use strict';var multer=require('multer');var util=require(_0xf3e2('0x0'));var path=require(_0xf3e2('0x1'));var timeout=require(_0xf3e2('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf3e2('0x3'));var interaction=require(_0xf3e2('0x4'));var config=require(_0xf3e2('0x5'));var controller=require(_0xf3e2('0x6'));router[_0xf3e2('0x7')]('/',auth[_0xf3e2('0x8')](),controller[_0xf3e2('0x9')]);router['get']('/:id',auth[_0xf3e2('0x8')](),controller[_0xf3e2('0xa')]);router[_0xf3e2('0xb')]('/',auth[_0xf3e2('0x8')](),controller[_0xf3e2('0xc')]);router['put'](_0xf3e2('0xd'),auth[_0xf3e2('0x8')](),controller[_0xf3e2('0xe')]);router['delete'](_0xf3e2('0xd'),auth[_0xf3e2('0x8')](),controller['destroy']);module[_0xf3e2('0xf')]=router;
\ No newline at end of file
index f0202aa..ff0bc3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaca3=['STRING','BOOLEAN','exports','string','variable','customVariable','keyValue','picklist','ENUM'];(function(_0x2967c1,_0x202a72){var _0x103397=function(_0x14b5cc){while(--_0x14b5cc){_0x2967c1['push'](_0x2967c1['shift']());}};_0x103397(++_0x202a72);}(_0xaca3,0x80));var _0x3aca=function(_0x52c55e,_0x45493f){_0x52c55e=_0x52c55e-0x0;var _0x35b09e=_0xaca3[_0x52c55e];return _0x35b09e;};'use strict';var Sequelize=require('sequelize');module[_0x3aca('0x0')]={'type':{'type':Sequelize['ENUM'](_0x3aca('0x1'),_0x3aca('0x2'),_0x3aca('0x3'),_0x3aca('0x4'),_0x3aca('0x5')),'defaultValue':_0x3aca('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3aca('0x6')](_0x3aca('0x1'),'variable',_0x3aca('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3aca('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3aca('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3aca('0x7')]}};
\ No newline at end of file
+var _0xf458=['string','variable','customVariable','picklist','STRING','ENUM','BOOLEAN','sequelize','exports'];(function(_0x3f9fb8,_0x23e413){var _0x55c0f3=function(_0x3626fe){while(--_0x3626fe){_0x3f9fb8['push'](_0x3f9fb8['shift']());}};_0x55c0f3(++_0x23e413);}(_0xf458,0xb2));var _0x8f45=function(_0x3115be,_0x318549){_0x3115be=_0x3115be-0x0;var _0x2b5e5b=_0xf458[_0x3115be];return _0x2b5e5b;};'use strict';var Sequelize=require(_0x8f45('0x0'));module[_0x8f45('0x1')]={'type':{'type':Sequelize['ENUM'](_0x8f45('0x2'),_0x8f45('0x3'),_0x8f45('0x4'),'keyValue',_0x8f45('0x5')),'defaultValue':_0x8f45('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8f45('0x6')]},'keyType':{'type':Sequelize[_0x8f45('0x7')]('string',_0x8f45('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x8f45('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8f45('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8f45('0x6')]}};
\ No newline at end of file
index dc860fa..f6bb3ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf760=['util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','index','map','Dynamics365Field','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','merge','options','rows','catch','show','keys','find','create','body','params','rimraf','fast-json-patch','moment','mustache'];(function(_0x24de69,_0x231508){var _0x515066=function(_0x3a1a78){while(--_0x3a1a78){_0x24de69['push'](_0x24de69['shift']());}};_0x515066(++_0x231508);}(_0xf760,0x194));var _0x0f76=function(_0x354ef9,_0x5ae1f1){_0x354ef9=_0x354ef9-0x0;var _0x31da7e=_0xf760[_0x354ef9];return _0x31da7e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f76('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f76('0x1'));var rp=require('request-promise');var moment=require(_0x0f76('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0f76('0x3'));var util=require(_0x0f76('0x4'));var path=require(_0x0f76('0x5'));var sox=require(_0x0f76('0x6'));var csv=require(_0x0f76('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f76('0x8'));var squel=require(_0x0f76('0x9'));var crypto=require(_0x0f76('0xa'));var jsforce=require(_0x0f76('0xb'));var deskjs=require(_0x0f76('0xc'));var toCsv=require(_0x0f76('0x7'));var querystring=require(_0x0f76('0xd'));var Papa=require('papaparse');var Redis=require(_0x0f76('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0f76('0xf'));var as=require(_0x0f76('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f76('0x11'))(_0x0f76('0x12'));var utils=require(_0x0f76('0x13'));var config=require(_0x0f76('0x14'));var licenseUtil=require(_0x0f76('0x15'));var db=require(_0x0f76('0x16'))['db'];function respondWithStatusCode(_0x3c769e,_0x4f873c){_0x4f873c=_0x4f873c||0xcc;return function(_0x1a78f3){if(_0x1a78f3){return _0x3c769e['sendStatus'](_0x4f873c);}return _0x3c769e['status'](_0x4f873c)[_0x0f76('0x17')]();};}function respondWithResult(_0x6b84c4,_0x46e090){_0x46e090=_0x46e090||0xc8;return function(_0x28028d){if(_0x28028d){return _0x6b84c4[_0x0f76('0x18')](_0x46e090)[_0x0f76('0x19')](_0x28028d);}};}function respondWithFilteredResult(_0x1c7fa8,_0xa95bdb){return function(_0x10dffc){if(_0x10dffc){var _0x31abaf=typeof _0xa95bdb['offset']===_0x0f76('0x1a')&&typeof _0xa95bdb[_0x0f76('0x1b')]==='undefined';var _0x189855=_0x10dffc['count'];var _0x43b888=_0x31abaf?0x0:_0xa95bdb[_0x0f76('0x1c')];var _0x4c6355=_0x31abaf?_0x10dffc[_0x0f76('0x1d')]:_0xa95bdb[_0x0f76('0x1c')]+_0xa95bdb[_0x0f76('0x1b')];var _0xf10c9f;if(_0x4c6355>=_0x189855){_0x4c6355=_0x189855;_0xf10c9f=0xc8;}else{_0xf10c9f=0xce;}_0x1c7fa8[_0x0f76('0x18')](_0xf10c9f);return _0x1c7fa8[_0x0f76('0x1e')](_0x0f76('0x1f'),_0x43b888+'-'+_0x4c6355+'/'+_0x189855)['json'](_0x10dffc);}return null;};}function patchUpdates(_0x665812){return function(_0x420ad0){try{jsonpatch[_0x0f76('0x20')](_0x420ad0,_0x665812,!![]);}catch(_0x3396d3){return BPromise['reject'](_0x3396d3);}return _0x420ad0[_0x0f76('0x21')]();};}function saveUpdates(_0x39681a,_0xa32a90){return function(_0x4817ae){if(_0x4817ae){return _0x4817ae[_0x0f76('0x22')](_0x39681a)[_0x0f76('0x23')](function(_0x2d2811){return _0x2d2811;});}return null;};}function removeEntity(_0x1fea57,_0x3ab695){return function(_0x19f088){if(_0x19f088){return _0x19f088[_0x0f76('0x24')]()[_0x0f76('0x23')](function(){_0x1fea57['status'](0xcc)[_0x0f76('0x17')]();});}};}function handleEntityNotFound(_0x5f079c,_0x5478b8){return function(_0x301f58){if(!_0x301f58){_0x5f079c[_0x0f76('0x25')](0x194);}return _0x301f58;};}function handleError(_0x157cab,_0x5dbd95){_0x5dbd95=_0x5dbd95||0x1f4;return function(_0x21e6b7){logger[_0x0f76('0x26')](_0x21e6b7['stack']);if(_0x21e6b7[_0x0f76('0x27')]){delete _0x21e6b7['name'];}_0x157cab[_0x0f76('0x18')](_0x5dbd95)['send'](_0x21e6b7);};}exports[_0x0f76('0x28')]=function(_0x433876,_0x173d89){var _0x50b8a0={},_0x2d1688={},_0x2100de={'count':0x0,'rows':[]};var _0x3ad9b2=_[_0x0f76('0x29')](db[_0x0f76('0x2a')][_0x0f76('0x2b')],function(_0x4fe46b){return{'name':_0x4fe46b[_0x0f76('0x2c')],'type':_0x4fe46b[_0x0f76('0x2d')]['key']};});_0x2d1688['model']=_[_0x0f76('0x29')](_0x3ad9b2,_0x0f76('0x27'));_0x2d1688[_0x0f76('0x2e')]=_['keys'](_0x433876['query']);_0x2d1688[_0x0f76('0x2f')]=_[_0x0f76('0x30')](_0x2d1688['model'],_0x2d1688[_0x0f76('0x2e')]);_0x50b8a0[_0x0f76('0x31')]=_[_0x0f76('0x30')](_0x2d1688[_0x0f76('0x32')],qs['fields'](_0x433876[_0x0f76('0x2e')][_0x0f76('0x33')]));_0x50b8a0[_0x0f76('0x31')]=_0x50b8a0[_0x0f76('0x31')][_0x0f76('0x34')]?_0x50b8a0['attributes']:_0x2d1688[_0x0f76('0x32')];if(!_0x433876['query'][_0x0f76('0x35')]('nolimit')){_0x50b8a0['limit']=qs[_0x0f76('0x1b')](_0x433876[_0x0f76('0x2e')]['limit']);_0x50b8a0[_0x0f76('0x1c')]=qs[_0x0f76('0x1c')](_0x433876[_0x0f76('0x2e')]['offset']);}_0x50b8a0[_0x0f76('0x36')]=qs[_0x0f76('0x37')](_0x433876[_0x0f76('0x2e')][_0x0f76('0x37')]);_0x50b8a0[_0x0f76('0x38')]=qs['filters'](_[_0x0f76('0x39')](_0x433876[_0x0f76('0x2e')],_0x2d1688[_0x0f76('0x2f')]),_0x3ad9b2);if(_0x433876[_0x0f76('0x2e')]['filter']){_0x50b8a0[_0x0f76('0x38')]=_[_0x0f76('0x3a')](_0x50b8a0[_0x0f76('0x38')],{'$or':_[_0x0f76('0x29')](_0x3ad9b2,function(_0xccf0d8){if(_0xccf0d8[_0x0f76('0x2d')]!=='VIRTUAL'){var _0x478ffe={};_0x478ffe[_0xccf0d8[_0x0f76('0x27')]]={'$like':'%'+_0x433876[_0x0f76('0x2e')]['filter']+'%'};return _0x478ffe;}})});}_0x50b8a0=_[_0x0f76('0x3a')]({},_0x50b8a0,_0x433876[_0x0f76('0x3b')]);var _0x21dc86={'where':_0x50b8a0[_0x0f76('0x38')]};return db['Dynamics365Field'][_0x0f76('0x1d')](_0x21dc86)['then'](function(_0x1bcfb7){_0x2100de['count']=_0x1bcfb7;if(_0x433876[_0x0f76('0x2e')]['includeAll']){_0x50b8a0['include']=[{'all':!![]}];}return db[_0x0f76('0x2a')]['findAll'](_0x50b8a0);})[_0x0f76('0x23')](function(_0x322aee){_0x2100de[_0x0f76('0x3c')]=_0x322aee;return _0x2100de;})['then'](respondWithFilteredResult(_0x173d89,_0x50b8a0))[_0x0f76('0x3d')](handleError(_0x173d89,null));};exports[_0x0f76('0x3e')]=function(_0xee2427,_0x3b0d0a){var _0x313d7b={'raw':!![],'where':{'id':_0xee2427['params']['id']}},_0x121a98={};_0x121a98[_0x0f76('0x32')]=_['keys'](db[_0x0f76('0x2a')][_0x0f76('0x2b')]);_0x121a98[_0x0f76('0x2e')]=_[_0x0f76('0x3f')](_0xee2427[_0x0f76('0x2e')]);_0x121a98['filters']=_[_0x0f76('0x30')](_0x121a98[_0x0f76('0x32')],_0x121a98[_0x0f76('0x2e')]);_0x313d7b[_0x0f76('0x31')]=_[_0x0f76('0x30')](_0x121a98['model'],qs[_0x0f76('0x33')](_0xee2427[_0x0f76('0x2e')][_0x0f76('0x33')]));_0x313d7b[_0x0f76('0x31')]=_0x313d7b[_0x0f76('0x31')][_0x0f76('0x34')]?_0x313d7b['attributes']:_0x121a98[_0x0f76('0x32')];if(_0xee2427[_0x0f76('0x2e')]['includeAll']){_0x313d7b['include']=[{'all':!![]}];}_0x313d7b=_[_0x0f76('0x3a')]({},_0x313d7b,_0xee2427[_0x0f76('0x3b')]);return db[_0x0f76('0x2a')][_0x0f76('0x40')](_0x313d7b)[_0x0f76('0x23')](handleEntityNotFound(_0x3b0d0a,null))[_0x0f76('0x23')](respondWithResult(_0x3b0d0a,null))[_0x0f76('0x3d')](handleError(_0x3b0d0a,null));};exports['create']=function(_0x28b9d9,_0x270eab){return db[_0x0f76('0x2a')][_0x0f76('0x41')](_0x28b9d9[_0x0f76('0x42')],{})['then'](respondWithResult(_0x270eab,0xc9))[_0x0f76('0x3d')](handleError(_0x270eab,null));};exports[_0x0f76('0x22')]=function(_0x45bc81,_0xd0393c){if(_0x45bc81[_0x0f76('0x42')]['id']){delete _0x45bc81[_0x0f76('0x42')]['id'];}return db[_0x0f76('0x2a')][_0x0f76('0x40')]({'where':{'id':_0x45bc81[_0x0f76('0x43')]['id']}})[_0x0f76('0x23')](handleEntityNotFound(_0xd0393c,null))[_0x0f76('0x23')](saveUpdates(_0x45bc81[_0x0f76('0x42')],null))['then'](respondWithResult(_0xd0393c,null))[_0x0f76('0x3d')](handleError(_0xd0393c,null));};exports[_0x0f76('0x24')]=function(_0x2ff0b1,_0x42618e){return db[_0x0f76('0x2a')][_0x0f76('0x40')]({'where':{'id':_0x2ff0b1['params']['id']}})[_0x0f76('0x23')](handleEntityNotFound(_0x42618e,null))[_0x0f76('0x23')](removeEntity(_0x42618e,null))[_0x0f76('0x3d')](handleError(_0x42618e,null));};
\ No newline at end of file
+var _0x5f4a=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','params','length','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x14f386,_0x201f09){var _0x3c46a1=function(_0x320d87){while(--_0x320d87){_0x14f386['push'](_0x14f386['shift']());}};_0x3c46a1(++_0x201f09);}(_0x5f4a,0x84));var _0xa5f4=function(_0x343298,_0x4f6583){_0x343298=_0x343298-0x0;var _0x5c2acf=_0x5f4a[_0x343298];return _0x5c2acf;};'use strict';var emlformat=require(_0xa5f4('0x0'));var rimraf=require(_0xa5f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa5f4('0x2'));var rp=require(_0xa5f4('0x3'));var moment=require(_0xa5f4('0x4'));var BPromise=require(_0xa5f4('0x5'));var Mustache=require(_0xa5f4('0x6'));var util=require(_0xa5f4('0x7'));var path=require(_0xa5f4('0x8'));var sox=require(_0xa5f4('0x9'));var csv=require(_0xa5f4('0xa'));var ejs=require(_0xa5f4('0xb'));var fs=require('fs');var fs_extra=require(_0xa5f4('0xc'));var _=require(_0xa5f4('0xd'));var squel=require(_0xa5f4('0xe'));var crypto=require('crypto');var jsforce=require(_0xa5f4('0xf'));var deskjs=require(_0xa5f4('0x10'));var toCsv=require(_0xa5f4('0xa'));var querystring=require('querystring');var Papa=require(_0xa5f4('0x11'));var Redis=require(_0xa5f4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa5f4('0x13'));var as=require(_0xa5f4('0x14'));var hardwareService=require(_0xa5f4('0x15'));var logger=require(_0xa5f4('0x16'))('api');var utils=require(_0xa5f4('0x17'));var config=require(_0xa5f4('0x18'));var licenseUtil=require(_0xa5f4('0x19'));var db=require(_0xa5f4('0x1a'))['db'];function respondWithStatusCode(_0xcb245c,_0x35b0d3){_0x35b0d3=_0x35b0d3||0xcc;return function(_0x2ef62b){if(_0x2ef62b){return _0xcb245c[_0xa5f4('0x1b')](_0x35b0d3);}return _0xcb245c['status'](_0x35b0d3)['end']();};}function respondWithResult(_0x594c58,_0x5eb6f4){_0x5eb6f4=_0x5eb6f4||0xc8;return function(_0x12a50b){if(_0x12a50b){return _0x594c58[_0xa5f4('0x1c')](_0x5eb6f4)[_0xa5f4('0x1d')](_0x12a50b);}};}function respondWithFilteredResult(_0x672db3,_0x1d6696){return function(_0x576a6f){if(_0x576a6f){var _0x3af1f0=typeof _0x1d6696['offset']===_0xa5f4('0x1e')&&typeof _0x1d6696[_0xa5f4('0x1f')]===_0xa5f4('0x1e');var _0x4d2bb5=_0x576a6f[_0xa5f4('0x20')];var _0x3e4d14=_0x3af1f0?0x0:_0x1d6696['offset'];var _0x4e44fe=_0x3af1f0?_0x576a6f[_0xa5f4('0x20')]:_0x1d6696[_0xa5f4('0x21')]+_0x1d6696[_0xa5f4('0x1f')];var _0x3c6dda;if(_0x4e44fe>=_0x4d2bb5){_0x4e44fe=_0x4d2bb5;_0x3c6dda=0xc8;}else{_0x3c6dda=0xce;}_0x672db3[_0xa5f4('0x1c')](_0x3c6dda);return _0x672db3['set'](_0xa5f4('0x22'),_0x3e4d14+'-'+_0x4e44fe+'/'+_0x4d2bb5)[_0xa5f4('0x1d')](_0x576a6f);}return null;};}function patchUpdates(_0x2b34d9){return function(_0x3e6d77){try{jsonpatch[_0xa5f4('0x23')](_0x3e6d77,_0x2b34d9,!![]);}catch(_0x52e858){return BPromise[_0xa5f4('0x24')](_0x52e858);}return _0x3e6d77[_0xa5f4('0x25')]();};}function saveUpdates(_0x333813,_0x1985b6){return function(_0x1029c8){if(_0x1029c8){return _0x1029c8['update'](_0x333813)[_0xa5f4('0x26')](function(_0x14a2fe){return _0x14a2fe;});}return null;};}function removeEntity(_0x26c18e,_0x4d22ff){return function(_0x5785f2){if(_0x5785f2){return _0x5785f2[_0xa5f4('0x27')]()[_0xa5f4('0x26')](function(){_0x26c18e[_0xa5f4('0x1c')](0xcc)[_0xa5f4('0x28')]();});}};}function handleEntityNotFound(_0x332408,_0x1a1115){return function(_0x3bf69e){if(!_0x3bf69e){_0x332408[_0xa5f4('0x1b')](0x194);}return _0x3bf69e;};}function handleError(_0x48783d,_0xae8931){_0xae8931=_0xae8931||0x1f4;return function(_0x5bb3e8){logger[_0xa5f4('0x29')](_0x5bb3e8[_0xa5f4('0x2a')]);if(_0x5bb3e8[_0xa5f4('0x2b')]){delete _0x5bb3e8[_0xa5f4('0x2b')];}_0x48783d[_0xa5f4('0x1c')](_0xae8931)[_0xa5f4('0x2c')](_0x5bb3e8);};}exports[_0xa5f4('0x2d')]=function(_0x1b40bd,_0xb1c18f){var _0x34e16b={},_0x58143d={},_0x36c2d9={'count':0x0,'rows':[]};var _0x32d9a1=_[_0xa5f4('0x2e')](db[_0xa5f4('0x2f')][_0xa5f4('0x30')],function(_0x42391d){return{'name':_0x42391d['fieldName'],'type':_0x42391d[_0xa5f4('0x31')][_0xa5f4('0x32')]};});_0x58143d[_0xa5f4('0x33')]=_[_0xa5f4('0x2e')](_0x32d9a1,_0xa5f4('0x2b'));_0x58143d[_0xa5f4('0x34')]=_[_0xa5f4('0x35')](_0x1b40bd[_0xa5f4('0x34')]);_0x58143d['filters']=_['intersection'](_0x58143d['model'],_0x58143d[_0xa5f4('0x34')]);_0x34e16b[_0xa5f4('0x36')]=_[_0xa5f4('0x37')](_0x58143d['model'],qs['fields'](_0x1b40bd['query'][_0xa5f4('0x38')]));_0x34e16b['attributes']=_0x34e16b[_0xa5f4('0x36')]['length']?_0x34e16b[_0xa5f4('0x36')]:_0x58143d[_0xa5f4('0x33')];if(!_0x1b40bd[_0xa5f4('0x34')][_0xa5f4('0x39')](_0xa5f4('0x3a'))){_0x34e16b[_0xa5f4('0x1f')]=qs[_0xa5f4('0x1f')](_0x1b40bd['query'][_0xa5f4('0x1f')]);_0x34e16b[_0xa5f4('0x21')]=qs[_0xa5f4('0x21')](_0x1b40bd[_0xa5f4('0x34')][_0xa5f4('0x21')]);}_0x34e16b[_0xa5f4('0x3b')]=qs[_0xa5f4('0x3c')](_0x1b40bd[_0xa5f4('0x34')][_0xa5f4('0x3c')]);_0x34e16b['where']=qs[_0xa5f4('0x3d')](_[_0xa5f4('0x3e')](_0x1b40bd[_0xa5f4('0x34')],_0x58143d['filters']),_0x32d9a1);if(_0x1b40bd[_0xa5f4('0x34')][_0xa5f4('0x3f')]){_0x34e16b[_0xa5f4('0x40')]=_[_0xa5f4('0x41')](_0x34e16b[_0xa5f4('0x40')],{'$or':_['map'](_0x32d9a1,function(_0x5be0ac){if(_0x5be0ac[_0xa5f4('0x31')]!==_0xa5f4('0x42')){var _0x1083ab={};_0x1083ab[_0x5be0ac['name']]={'$like':'%'+_0x1b40bd[_0xa5f4('0x34')]['filter']+'%'};return _0x1083ab;}})});}_0x34e16b=_[_0xa5f4('0x41')]({},_0x34e16b,_0x1b40bd[_0xa5f4('0x43')]);var _0xe5ae89={'where':_0x34e16b[_0xa5f4('0x40')]};return db['Dynamics365Field'][_0xa5f4('0x20')](_0xe5ae89)[_0xa5f4('0x26')](function(_0x8b6a6f){_0x36c2d9['count']=_0x8b6a6f;if(_0x1b40bd[_0xa5f4('0x34')][_0xa5f4('0x44')]){_0x34e16b['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0xa5f4('0x45')](_0x34e16b);})[_0xa5f4('0x26')](function(_0x59fa7e){_0x36c2d9['rows']=_0x59fa7e;return _0x36c2d9;})[_0xa5f4('0x26')](respondWithFilteredResult(_0xb1c18f,_0x34e16b))[_0xa5f4('0x46')](handleError(_0xb1c18f,null));};exports['show']=function(_0x35f1a1,_0x67a579){var _0x547361={'raw':!![],'where':{'id':_0x35f1a1[_0xa5f4('0x47')]['id']}},_0x233333={};_0x233333['model']=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x233333[_0xa5f4('0x34')]=_[_0xa5f4('0x35')](_0x35f1a1[_0xa5f4('0x34')]);_0x233333[_0xa5f4('0x3d')]=_[_0xa5f4('0x37')](_0x233333[_0xa5f4('0x33')],_0x233333['query']);_0x547361[_0xa5f4('0x36')]=_['intersection'](_0x233333['model'],qs['fields'](_0x35f1a1[_0xa5f4('0x34')][_0xa5f4('0x38')]));_0x547361[_0xa5f4('0x36')]=_0x547361[_0xa5f4('0x36')][_0xa5f4('0x48')]?_0x547361[_0xa5f4('0x36')]:_0x233333['model'];if(_0x35f1a1[_0xa5f4('0x34')][_0xa5f4('0x44')]){_0x547361[_0xa5f4('0x49')]=[{'all':!![]}];}_0x547361=_[_0xa5f4('0x41')]({},_0x547361,_0x35f1a1[_0xa5f4('0x43')]);return db['Dynamics365Field'][_0xa5f4('0x4a')](_0x547361)[_0xa5f4('0x26')](handleEntityNotFound(_0x67a579,null))[_0xa5f4('0x26')](respondWithResult(_0x67a579,null))[_0xa5f4('0x46')](handleError(_0x67a579,null));};exports['create']=function(_0x161e65,_0x1c7911){return db[_0xa5f4('0x2f')][_0xa5f4('0x4b')](_0x161e65[_0xa5f4('0x4c')],{})[_0xa5f4('0x26')](respondWithResult(_0x1c7911,0xc9))[_0xa5f4('0x46')](handleError(_0x1c7911,null));};exports['update']=function(_0x358890,_0x32745f){if(_0x358890[_0xa5f4('0x4c')]['id']){delete _0x358890[_0xa5f4('0x4c')]['id'];}return db[_0xa5f4('0x2f')]['find']({'where':{'id':_0x358890[_0xa5f4('0x47')]['id']}})[_0xa5f4('0x26')](handleEntityNotFound(_0x32745f,null))[_0xa5f4('0x26')](saveUpdates(_0x358890[_0xa5f4('0x4c')],null))['then'](respondWithResult(_0x32745f,null))['catch'](handleError(_0x32745f,null));};exports[_0xa5f4('0x27')]=function(_0x132011,_0x2d16a2){return db[_0xa5f4('0x2f')][_0xa5f4('0x4a')]({'where':{'id':_0x132011[_0xa5f4('0x47')]['id']}})['then'](handleEntityNotFound(_0x2d16a2,null))[_0xa5f4('0x26')](removeEntity(_0x2d16a2,null))['catch'](handleError(_0x2d16a2,null));};
\ No newline at end of file
index 8aa1f37..b5e1d71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x231d=['./intDynamics365Field.attributes','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x231d,0x95));var _0xd231=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x231d[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xd231('0x0'));var util=require(_0xd231('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd231('0x2'));var BPromise=require(_0xd231('0x3'));var rp=require(_0xd231('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd231('0x5'));var config=require(_0xd231('0x6'));var attributes=require(_0xd231('0x7'));module['exports']=function(_0x5cd154,_0x15c21e){return _0x5cd154[_0xd231('0x8')]('Dynamics365Field',attributes,{'tableName':_0xd231('0x9'),'paranoid':![],'indexes':[{'name':_0xd231('0xa'),'fields':[_0xd231('0xb'),_0xd231('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x15cb=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash'];(function(_0x765fb5,_0x49bed2){var _0x3a315f=function(_0x52a36b){while(--_0x52a36b){_0x765fb5['push'](_0x765fb5['shift']());}};_0x3a315f(++_0x49bed2);}(_0x15cb,0xef));var _0xb15c=function(_0x2c6e07,_0x5052ac){_0x2c6e07=_0x2c6e07-0x0;var _0x5e1983=_0x15cb[_0x2c6e07];return _0x5e1983;};'use strict';var _=require(_0xb15c('0x0'));var util=require(_0xb15c('0x1'));var logger=require(_0xb15c('0x2'))(_0xb15c('0x3'));var moment=require(_0xb15c('0x4'));var BPromise=require(_0xb15c('0x5'));var rp=require(_0xb15c('0x6'));var fs=require('fs');var path=require(_0xb15c('0x7'));var rimraf=require(_0xb15c('0x8'));var config=require(_0xb15c('0x9'));var attributes=require(_0xb15c('0xa'));module['exports']=function(_0x378e11,_0x4b7b83){return _0x378e11[_0xb15c('0xb')](_0xb15c('0xc'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xb15c('0xd'),'fields':[_0xb15c('0xe'),_0xb15c('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 6ad1dae..fe18b11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6f7=['jayson/promise','client','http','request','then','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Field,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc'];(function(_0x5df61d,_0x158640){var _0x24cc4c=function(_0x2de006){while(--_0x2de006){_0x5df61d['push'](_0x5df61d['shift']());}};_0x24cc4c(++_0x158640);}(_0xc6f7,0xd5));var _0x7c6f=function(_0x5b5190,_0x394ec9){_0x5b5190=_0x5b5190-0x0;var _0x5b3f14=_0xc6f7[_0x5b5190];return _0x5b3f14;};'use strict';var _=require(_0x7c6f('0x0'));var util=require(_0x7c6f('0x1'));var moment=require(_0x7c6f('0x2'));var BPromise=require(_0x7c6f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c6f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c6f('0x5'));var logger=require('../../config/logger')(_0x7c6f('0x6'));var config=require('../../config/environment');var jayson=require(_0x7c6f('0x7'));var client=jayson[_0x7c6f('0x8')][_0x7c6f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e4f3d,_0x17cf93,_0x4d0ebd){return new BPromise(function(_0xbbfff4,_0x261551){return client[_0x7c6f('0xa')](_0x3e4f3d,_0x4d0ebd)[_0x7c6f('0xb')](function(_0x4c3450){logger[_0x7c6f('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x17cf93,_0x7c6f('0xd'));logger[_0x7c6f('0xe')](_0x7c6f('0xf'),_0x17cf93,_0x7c6f('0xd'),JSON[_0x7c6f('0x10')](_0x4c3450));if(_0x4c3450[_0x7c6f('0x11')]){if(_0x4c3450[_0x7c6f('0x11')][_0x7c6f('0x12')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x17cf93,_0x4c3450['error'][_0x7c6f('0x13')]);return _0x261551(_0x4c3450[_0x7c6f('0x11')][_0x7c6f('0x13')]);}logger[_0x7c6f('0x11')](_0x7c6f('0x14'),_0x17cf93,_0x4c3450['error'][_0x7c6f('0x13')]);return _0xbbfff4(_0x4c3450[_0x7c6f('0x11')][_0x7c6f('0x13')]);}else{logger[_0x7c6f('0xc')](_0x7c6f('0x14'),_0x17cf93,_0x7c6f('0xd'));_0xbbfff4(_0x4c3450['result']['message']);}})[_0x7c6f('0x15')](function(_0xcf6d65){logger[_0x7c6f('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x17cf93,_0xcf6d65);_0x261551(_0xcf6d65);});});}
\ No newline at end of file
+var _0x06f4=['Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','then','info'];(function(_0x52dfbd,_0x23fcac){var _0x422793=function(_0x421d36){while(--_0x421d36){_0x52dfbd['push'](_0x52dfbd['shift']());}};_0x422793(++_0x23fcac);}(_0x06f4,0x17e));var _0x406f=function(_0x2de22d,_0x1f25cf){_0x2de22d=_0x2de22d-0x0;var _0x389a49=_0x06f4[_0x2de22d];return _0x389a49;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x406f('0x0'));var rs=require(_0x406f('0x1'));var fs=require('fs');var Redis=require(_0x406f('0x2'));var db=require(_0x406f('0x3'))['db'];var utils=require(_0x406f('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x406f('0x5'));var client=jayson['client'][_0x406f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x577ff6,_0x55e4e0,_0x59f615){return new BPromise(function(_0x5f6142,_0x3fcd09){return client['request'](_0x577ff6,_0x59f615)[_0x406f('0x7')](function(_0x2031ed){logger[_0x406f('0x8')](_0x406f('0x9'),_0x55e4e0,'request\x20sent');logger['debug'](_0x406f('0xa'),_0x55e4e0,_0x406f('0xb'),JSON['stringify'](_0x2031ed));if(_0x2031ed[_0x406f('0xc')]){if(_0x2031ed[_0x406f('0xc')][_0x406f('0xd')]===0x1f4){logger[_0x406f('0xc')](_0x406f('0x9'),_0x55e4e0,_0x2031ed[_0x406f('0xc')]['message']);return _0x3fcd09(_0x2031ed[_0x406f('0xc')][_0x406f('0xe')]);}logger[_0x406f('0xc')](_0x406f('0x9'),_0x55e4e0,_0x2031ed[_0x406f('0xc')][_0x406f('0xe')]);return _0x5f6142(_0x2031ed[_0x406f('0xc')]['message']);}else{logger[_0x406f('0x8')]('Dynamics365Field,\x20%s,\x20%s',_0x55e4e0,_0x406f('0xb'));_0x5f6142(_0x2031ed[_0x406f('0xf')][_0x406f('0xe')]);}})[_0x406f('0x10')](function(_0x51fb97){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x55e4e0,_0x51fb97);_0x3fcd09(_0x51fb97);});});}
\ No newline at end of file
index 6212bde..34f46e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8561=['getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x1876b2,_0x5d0225){var _0x9fb1e0=function(_0x29b099){while(--_0x29b099){_0x1876b2['push'](_0x1876b2['shift']());}};_0x9fb1e0(++_0x5d0225);}(_0x8561,0x92));var _0x1856=function(_0x40a443,_0x340329){_0x40a443=_0x40a443-0x0;var _0x522176=_0x8561[_0x40a443];return _0x522176;};'use strict';var multer=require(_0x1856('0x0'));var util=require('util');var path=require(_0x1856('0x1'));var timeout=require(_0x1856('0x2'));var express=require(_0x1856('0x3'));var router=express['Router']();var fs_extra=require(_0x1856('0x4'));var auth=require(_0x1856('0x5'));var interaction=require(_0x1856('0x6'));var config=require(_0x1856('0x7'));var controller=require(_0x1856('0x8'));router[_0x1856('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1856('0x9')](_0x1856('0xa'),auth[_0x1856('0xb')](),controller['show']);router['get'](_0x1856('0xc'),auth[_0x1856('0xb')](),controller[_0x1856('0xd')]);router['get'](_0x1856('0xe'),auth[_0x1856('0xb')](),controller[_0x1856('0xf')]);router['post']('/',auth[_0x1856('0xb')](),controller['create']);router[_0x1856('0x10')](_0x1856('0xc'),auth[_0x1856('0xb')](),controller[_0x1856('0x11')]);router[_0x1856('0x12')](_0x1856('0xa'),auth['isAuthenticated'](),controller[_0x1856('0x13')]);router[_0x1856('0x14')](_0x1856('0xa'),auth[_0x1856('0xb')](),controller[_0x1856('0x15')]);module[_0x1856('0x16')]=router;
\ No newline at end of file
+var _0xec4a=['post','create','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xec4a,0x1b8));var _0xaec4=function(_0x355264,_0x7e8090){_0x355264=_0x355264-0x0;var _0x492e77=_0xec4a[_0x355264];return _0x492e77;};'use strict';var multer=require('multer');var util=require(_0xaec4('0x0'));var path=require(_0xaec4('0x1'));var timeout=require(_0xaec4('0x2'));var express=require(_0xaec4('0x3'));var router=express[_0xaec4('0x4')]();var fs_extra=require(_0xaec4('0x5'));var auth=require(_0xaec4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xaec4('0x7'));var controller=require(_0xaec4('0x8'));router[_0xaec4('0x9')]('/',auth[_0xaec4('0xa')](),controller['index']);router[_0xaec4('0x9')](_0xaec4('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xaec4('0x9')](_0xaec4('0xc'),auth[_0xaec4('0xa')](),controller[_0xaec4('0xd')]);router[_0xaec4('0x9')](_0xaec4('0xe'),auth['isAuthenticated'](),controller[_0xaec4('0xf')]);router[_0xaec4('0x10')]('/',auth['isAuthenticated'](),controller[_0xaec4('0x11')]);router[_0xaec4('0x10')]('/:id/configurations',auth[_0xaec4('0xa')](),controller[_0xaec4('0x12')]);router[_0xaec4('0x13')](_0xaec4('0xb'),auth[_0xaec4('0xa')](),controller[_0xaec4('0x14')]);router[_0xaec4('0x15')](_0xaec4('0xb'),auth[_0xaec4('0xa')](),controller[_0xaec4('0x16')]);module[_0xaec4('0x17')]=router;
\ No newline at end of file
index cd0332a..050818a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bd3=['sequelize','STRING','remoteUri'];(function(_0x47ab21,_0x3907b6){var _0x1104e3=function(_0x49bfda){while(--_0x49bfda){_0x47ab21['push'](_0x47ab21['shift']());}};_0x1104e3(++_0x3907b6);}(_0x4bd3,0x174));var _0x34bd=function(_0x3abbcd,_0x5933cf){_0x3abbcd=_0x3abbcd-0x0;var _0x389944=_0x4bd3[_0x3abbcd];return _0x389944;};'use strict';var Sequelize=require(_0x34bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x34bd('0x1')]},'description':{'type':Sequelize[_0x34bd('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x34bd('0x1')],'unique':_0x34bd('0x2')},'serverUrl':{'type':Sequelize[_0x34bd('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xf61e=['remoteUri','sequelize','exports','STRING','username'];(function(_0x4103af,_0x2e6b02){var _0x225bf1=function(_0x1eadcb){while(--_0x1eadcb){_0x4103af['push'](_0x4103af['shift']());}};_0x225bf1(++_0x2e6b02);}(_0xf61e,0x191));var _0xef61=function(_0x5056e0,_0x28603c){_0x5056e0=_0x5056e0-0x0;var _0x13c20f=_0xf61e[_0x5056e0];return _0x13c20f;};'use strict';var Sequelize=require(_0xef61('0x0'));module[_0xef61('0x1')]={'name':{'type':Sequelize[_0xef61('0x2')]},'description':{'type':Sequelize[_0xef61('0x2')]},'username':{'type':Sequelize[_0xef61('0x2')],'unique':_0xef61('0x3')},'apiKey':{'type':Sequelize[_0xef61('0x2')]},'remoteUri':{'type':Sequelize[_0xef61('0x2')],'unique':_0xef61('0x4')},'serverUrl':{'type':Sequelize[_0xef61('0x2')],'allowNull':![]}};
\ No newline at end of file
index 705dcb3..be8dc83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c71=['crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','map','FreshdeskAccount','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','keys','rawAttributes','includeAll','create','body','params','find','findOne','getConfigurations','addConfiguration','channel','Descriptions','FreshdeskConfiguration','FreshdeskField','apiKey','remoteUri','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','requester','agent','description','group','source','ticket_type','default','custom_text','custom_dropdown','choices','test','statusCode','getFields','stringify','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0x4c71,0x12b));var _0x14c7=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x4c71[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x14c7('0x0'));var rimraf=require(_0x14c7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x14c7('0x2'));var rp=require(_0x14c7('0x3'));var moment=require(_0x14c7('0x4'));var BPromise=require(_0x14c7('0x5'));var Mustache=require(_0x14c7('0x6'));var util=require('util');var path=require(_0x14c7('0x7'));var sox=require(_0x14c7('0x8'));var csv=require(_0x14c7('0x9'));var ejs=require(_0x14c7('0xa'));var fs=require('fs');var fs_extra=require(_0x14c7('0xb'));var _=require('lodash');var squel=require(_0x14c7('0xc'));var crypto=require(_0x14c7('0xd'));var jsforce=require(_0x14c7('0xe'));var deskjs=require(_0x14c7('0xf'));var toCsv=require(_0x14c7('0x9'));var querystring=require('querystring');var Papa=require(_0x14c7('0x10'));var Redis=require('ioredis');var authService=require(_0x14c7('0x11'));var qs=require(_0x14c7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14c7('0x13'));var logger=require(_0x14c7('0x14'))(_0x14c7('0x15'));var utils=require(_0x14c7('0x16'));var config=require(_0x14c7('0x17'));var licenseUtil=require(_0x14c7('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2bef86,_0x651044){_0x651044=_0x651044||0xcc;return function(_0x2f47c2){if(_0x2f47c2){return _0x2bef86[_0x14c7('0x19')](_0x651044);}return _0x2bef86[_0x14c7('0x1a')](_0x651044)[_0x14c7('0x1b')]();};}function respondWithResult(_0x4b8f41,_0x4e9856){_0x4e9856=_0x4e9856||0xc8;return function(_0x2428bc){if(_0x2428bc){return _0x4b8f41[_0x14c7('0x1a')](_0x4e9856)['json'](_0x2428bc);}};}function respondWithFilteredResult(_0x5bb4de,_0x39c742){return function(_0x2929bc){if(_0x2929bc){var _0x1eff6b=typeof _0x39c742[_0x14c7('0x1c')]===_0x14c7('0x1d')&&typeof _0x39c742[_0x14c7('0x1e')]==='undefined';var _0x3ebb85=_0x2929bc[_0x14c7('0x1f')];var _0x885f2f=_0x1eff6b?0x0:_0x39c742[_0x14c7('0x1c')];var _0x57d383=_0x1eff6b?_0x2929bc['count']:_0x39c742[_0x14c7('0x1c')]+_0x39c742[_0x14c7('0x1e')];var _0x44a561;if(_0x57d383>=_0x3ebb85){_0x57d383=_0x3ebb85;_0x44a561=0xc8;}else{_0x44a561=0xce;}_0x5bb4de['status'](_0x44a561);return _0x5bb4de[_0x14c7('0x20')](_0x14c7('0x21'),_0x885f2f+'-'+_0x57d383+'/'+_0x3ebb85)[_0x14c7('0x22')](_0x2929bc);}return null;};}function patchUpdates(_0x345bac){return function(_0x541f96){try{jsonpatch['apply'](_0x541f96,_0x345bac,!![]);}catch(_0x504790){return BPromise[_0x14c7('0x23')](_0x504790);}return _0x541f96['save']();};}function saveUpdates(_0x5be2e5,_0x39c8ee){return function(_0x14a38d){if(_0x14a38d){return _0x14a38d[_0x14c7('0x24')](_0x5be2e5)[_0x14c7('0x25')](function(_0x24a93b){return _0x24a93b;});}return null;};}function removeEntity(_0x4db89a,_0x5d0f51){return function(_0x5a5349){if(_0x5a5349){return _0x5a5349[_0x14c7('0x26')]()[_0x14c7('0x25')](function(){_0x4db89a[_0x14c7('0x1a')](0xcc)[_0x14c7('0x1b')]();});}};}function handleEntityNotFound(_0x45726b,_0x313042){return function(_0xb50129){if(!_0xb50129){_0x45726b['sendStatus'](0x194);}return _0xb50129;};}function handleError(_0xa96879,_0x21be43){_0x21be43=_0x21be43||0x1f4;return function(_0x17b2e5){logger[_0x14c7('0x27')](_0x17b2e5[_0x14c7('0x28')]);if(_0x17b2e5['name']){delete _0x17b2e5[_0x14c7('0x29')];}_0xa96879[_0x14c7('0x1a')](_0x21be43)[_0x14c7('0x2a')](_0x17b2e5);};}exports['index']=function(_0x576de4,_0x4d0f87){var _0x4c0556={},_0x52dcbc={},_0x21656e={'count':0x0,'rows':[]};var _0x29fa60=_[_0x14c7('0x2b')](db[_0x14c7('0x2c')]['rawAttributes'],function(_0x4f8482){return{'name':_0x4f8482['fieldName'],'type':_0x4f8482[_0x14c7('0x2d')][_0x14c7('0x2e')]};});_0x52dcbc[_0x14c7('0x2f')]=_[_0x14c7('0x2b')](_0x29fa60,_0x14c7('0x29'));_0x52dcbc[_0x14c7('0x30')]=_['keys'](_0x576de4[_0x14c7('0x30')]);_0x52dcbc[_0x14c7('0x31')]=_[_0x14c7('0x32')](_0x52dcbc['model'],_0x52dcbc['query']);_0x4c0556[_0x14c7('0x33')]=_[_0x14c7('0x32')](_0x52dcbc['model'],qs[_0x14c7('0x34')](_0x576de4['query'][_0x14c7('0x34')]));_0x4c0556[_0x14c7('0x33')]=_0x4c0556[_0x14c7('0x33')][_0x14c7('0x35')]?_0x4c0556[_0x14c7('0x33')]:_0x52dcbc['model'];if(!_0x576de4[_0x14c7('0x30')][_0x14c7('0x36')](_0x14c7('0x37'))){_0x4c0556['limit']=qs['limit'](_0x576de4['query'][_0x14c7('0x1e')]);_0x4c0556['offset']=qs[_0x14c7('0x1c')](_0x576de4[_0x14c7('0x30')][_0x14c7('0x1c')]);}_0x4c0556[_0x14c7('0x38')]=qs['sort'](_0x576de4[_0x14c7('0x30')][_0x14c7('0x39')]);_0x4c0556[_0x14c7('0x3a')]=qs[_0x14c7('0x31')](_['pick'](_0x576de4['query'],_0x52dcbc[_0x14c7('0x31')]),_0x29fa60);if(_0x576de4[_0x14c7('0x30')][_0x14c7('0x3b')]){_0x4c0556[_0x14c7('0x3a')]=_[_0x14c7('0x3c')](_0x4c0556[_0x14c7('0x3a')],{'$or':_[_0x14c7('0x2b')](_0x29fa60,function(_0x4a71b3){if(_0x4a71b3[_0x14c7('0x2d')]!=='VIRTUAL'){var _0x56e90f={};_0x56e90f[_0x4a71b3[_0x14c7('0x29')]]={'$like':'%'+_0x576de4['query'][_0x14c7('0x3b')]+'%'};return _0x56e90f;}})});}_0x4c0556=_[_0x14c7('0x3c')]({},_0x4c0556,_0x576de4[_0x14c7('0x3d')]);var _0x3224bc={'where':_0x4c0556[_0x14c7('0x3a')]};return db[_0x14c7('0x2c')]['count'](_0x3224bc)[_0x14c7('0x25')](function(_0x2690a6){_0x21656e[_0x14c7('0x1f')]=_0x2690a6;if(_0x576de4[_0x14c7('0x30')]['includeAll']){_0x4c0556[_0x14c7('0x3e')]=[{'all':!![]}];}return db[_0x14c7('0x2c')][_0x14c7('0x3f')](_0x4c0556);})['then'](function(_0x476c1f){_0x21656e[_0x14c7('0x40')]=_0x476c1f;return _0x21656e;})[_0x14c7('0x25')](respondWithFilteredResult(_0x4d0f87,_0x4c0556))[_0x14c7('0x41')](handleError(_0x4d0f87,null));};exports['show']=function(_0x1d9cbc,_0x514105){var _0x5246d6={'raw':![],'where':{'id':_0x1d9cbc['params']['id']}},_0x961bdf={};_0x961bdf[_0x14c7('0x2f')]=_[_0x14c7('0x42')](db[_0x14c7('0x2c')][_0x14c7('0x43')]);_0x961bdf[_0x14c7('0x30')]=_['keys'](_0x1d9cbc['query']);_0x961bdf[_0x14c7('0x31')]=_[_0x14c7('0x32')](_0x961bdf[_0x14c7('0x2f')],_0x961bdf[_0x14c7('0x30')]);_0x5246d6[_0x14c7('0x33')]=_[_0x14c7('0x32')](_0x961bdf[_0x14c7('0x2f')],qs[_0x14c7('0x34')](_0x1d9cbc[_0x14c7('0x30')]['fields']));_0x5246d6[_0x14c7('0x33')]=_0x5246d6['attributes'][_0x14c7('0x35')]?_0x5246d6[_0x14c7('0x33')]:_0x961bdf[_0x14c7('0x2f')];if(_0x1d9cbc[_0x14c7('0x30')][_0x14c7('0x44')]){_0x5246d6['include']=[{'all':!![]}];}_0x5246d6=_['merge']({},_0x5246d6,_0x1d9cbc['options']);return db[_0x14c7('0x2c')]['find'](_0x5246d6)[_0x14c7('0x25')](handleEntityNotFound(_0x514105,null))[_0x14c7('0x25')](respondWithResult(_0x514105,null))['catch'](handleError(_0x514105,null));};exports[_0x14c7('0x45')]=function(_0x1aff64,_0x1d746d){return db[_0x14c7('0x2c')]['create'](_0x1aff64[_0x14c7('0x46')],{})[_0x14c7('0x25')](respondWithResult(_0x1d746d,0xc9))[_0x14c7('0x41')](handleError(_0x1d746d,null));};exports[_0x14c7('0x24')]=function(_0x3ca42c,_0x13c2dc){if(_0x3ca42c['body']['id']){delete _0x3ca42c[_0x14c7('0x46')]['id'];}return db[_0x14c7('0x2c')]['find']({'where':{'id':_0x3ca42c[_0x14c7('0x47')]['id']}})[_0x14c7('0x25')](handleEntityNotFound(_0x13c2dc,null))[_0x14c7('0x25')](saveUpdates(_0x3ca42c[_0x14c7('0x46')],null))[_0x14c7('0x25')](respondWithResult(_0x13c2dc,null))[_0x14c7('0x41')](handleError(_0x13c2dc,null));};exports[_0x14c7('0x26')]=function(_0x6a748,_0x58bd01){return db[_0x14c7('0x2c')][_0x14c7('0x48')]({'where':{'id':_0x6a748[_0x14c7('0x47')]['id']}})[_0x14c7('0x25')](handleEntityNotFound(_0x58bd01,null))[_0x14c7('0x25')](removeEntity(_0x58bd01,null))['catch'](handleError(_0x58bd01,null));};exports['getConfigurations']=function(_0x101be,_0x4b6840,_0x17d223){var _0x582dcb={};var _0x4f1d70={};var _0x36be9e;var _0x4013d7;return db['FreshdeskAccount'][_0x14c7('0x49')]({'where':{'id':_0x101be[_0x14c7('0x47')]['id']}})[_0x14c7('0x25')](handleEntityNotFound(_0x4b6840,null))[_0x14c7('0x25')](function(_0x29f55a){if(_0x29f55a){_0x36be9e=_0x29f55a;_0x4f1d70[_0x14c7('0x2f')]=_['keys'](db['FreshdeskConfiguration'][_0x14c7('0x43')]);_0x4f1d70[_0x14c7('0x30')]=_[_0x14c7('0x42')](_0x101be[_0x14c7('0x30')]);_0x4f1d70['filters']=_[_0x14c7('0x32')](_0x4f1d70[_0x14c7('0x2f')],_0x4f1d70[_0x14c7('0x30')]);_0x582dcb[_0x14c7('0x33')]=_['intersection'](_0x4f1d70[_0x14c7('0x2f')],qs['fields'](_0x101be[_0x14c7('0x30')][_0x14c7('0x34')]));_0x582dcb['attributes']=_0x582dcb['attributes'][_0x14c7('0x35')]?_0x582dcb[_0x14c7('0x33')]:_0x4f1d70[_0x14c7('0x2f')];_0x582dcb[_0x14c7('0x38')]=qs[_0x14c7('0x39')](_0x101be['query'][_0x14c7('0x39')]);_0x582dcb['where']=qs['filters'](_['pick'](_0x101be[_0x14c7('0x30')],_0x4f1d70['filters']));if(_0x101be['query']['filter']){_0x582dcb[_0x14c7('0x3a')]=_[_0x14c7('0x3c')](_0x582dcb['where'],{'$or':_['map'](_0x582dcb[_0x14c7('0x33')],function(_0x7a2e3){var _0x79dea={};_0x79dea[_0x7a2e3]={'$like':'%'+_0x101be[_0x14c7('0x30')][_0x14c7('0x3b')]+'%'};return _0x79dea;})});}_0x582dcb=_[_0x14c7('0x3c')]({},_0x582dcb,_0x101be['options']);return _0x36be9e[_0x14c7('0x4a')](_0x582dcb);}})[_0x14c7('0x25')](function(_0x2c959a){if(_0x2c959a){_0x4013d7=_0x2c959a[_0x14c7('0x35')];if(!_0x101be[_0x14c7('0x30')][_0x14c7('0x36')](_0x14c7('0x37'))){_0x582dcb[_0x14c7('0x1e')]=qs[_0x14c7('0x1e')](_0x101be['query'][_0x14c7('0x1e')]);_0x582dcb[_0x14c7('0x1c')]=qs[_0x14c7('0x1c')](_0x101be[_0x14c7('0x30')][_0x14c7('0x1c')]);}return _0x36be9e[_0x14c7('0x4a')](_0x582dcb);}})[_0x14c7('0x25')](function(_0x4cdc3d){if(_0x4cdc3d){return _0x4cdc3d?{'count':_0x4013d7,'rows':_0x4cdc3d}:null;}})[_0x14c7('0x25')](respondWithResult(_0x4b6840,null))[_0x14c7('0x41')](handleError(_0x4b6840,null));};exports[_0x14c7('0x4b')]=function(_0x3fe7f3,_0x3b552b,_0x4d9c5b){if(_0x3fe7f3[_0x14c7('0x46')]['id']){delete _0x3fe7f3[_0x14c7('0x46')]['id'];}return db['FreshdeskAccount'][_0x14c7('0x49')]({'where':{'id':_0x3fe7f3[_0x14c7('0x47')]['id']}})['then'](handleEntityNotFound(_0x3b552b,null))[_0x14c7('0x25')](function(_0x84f4b1){if(_0x84f4b1){_0x3fe7f3['body']['AccountId']=_0x84f4b1['id'];_0x3fe7f3[_0x14c7('0x46')]['Subjects']=integrations['getSubjects'](_0x3fe7f3['body'][_0x14c7('0x4c')],_0x3fe7f3[_0x14c7('0x46')][_0x14c7('0x2d')]);_0x3fe7f3[_0x14c7('0x46')][_0x14c7('0x4d')]=integrations['getDescriptions'](_0x3fe7f3[_0x14c7('0x46')][_0x14c7('0x4c')],_0x3fe7f3['body']['type']);return db[_0x14c7('0x4e')][_0x14c7('0x45')](_0x3fe7f3[_0x14c7('0x46')],{'include':[{'model':db[_0x14c7('0x4f')],'as':'Subjects'},{'model':db[_0x14c7('0x4f')],'as':_0x14c7('0x4d')}]});}return null;})[_0x14c7('0x25')](respondWithResult(_0x3b552b,null))['catch'](handleError(_0x3b552b,null));};exports['getFields']=function(_0x3f0406,_0x39a48e,_0x28c640){var _0x47a1e3='';return db[_0x14c7('0x2c')][_0x14c7('0x49')]({'where':{'id':_0x3f0406[_0x14c7('0x47')]['id']},'attributes':['id','remoteUri',_0x14c7('0x50')]})['then'](handleEntityNotFound(_0x39a48e,null))['then'](function(_0x1e59cc){if(_0x1e59cc){_0x47a1e3=_0x1e59cc[_0x14c7('0x51')];var _0xd5994d=_0x47a1e3[_0x14c7('0x52')](-0x1);if(_0xd5994d==='/'){_0x47a1e3=_0x47a1e3[_0x14c7('0x53')](0x0,_0x47a1e3['lastIndexOf'](_0xd5994d));}return rp({'method':_0x14c7('0x54'),'uri':util[_0x14c7('0x55')](_0x14c7('0x56'),_0x47a1e3,_0x14c7('0x57')),'headers':{'Authorization':util[_0x14c7('0x55')]('Basic\x20%s',new Buffer(util['format'](_0x14c7('0x58'),_0x1e59cc[_0x14c7('0x50')]))[_0x14c7('0x59')]('base64'))},'json':!![]});}})[_0x14c7('0x25')](function(_0x585086){if(_0x585086){var _0x527d3c=[_0x14c7('0x5a'),'subject',_0x14c7('0x5b'),_0x14c7('0x5c'),_0x14c7('0x1a'),'priority',_0x14c7('0x5d'),_0x14c7('0x5e'),_0x14c7('0x5f'),'group','company'];_['remove'](_0x585086,function(_0x5ee87c){return _0x527d3c['includes'](_0x5ee87c[_0x14c7('0x29')])||!_0x5ee87c[_0x14c7('0x60')]&&_0x5ee87c[_0x14c7('0x2d')]!==_0x14c7('0x61')&&_0x5ee87c['type']!==_0x14c7('0x62');});return{'count':_0x585086[_0x14c7('0x35')],'rows':_[_0x14c7('0x2b')](_0x585086,function(_0x1529a8){return{'id':_0x1529a8['name'],'name':_0x1529a8['label'],'custom':!_0x1529a8[_0x14c7('0x60')],'options':_0x1529a8['choices']?_[_0x14c7('0x2b')](_0x1529a8[_0x14c7('0x63')],function(_0x1bbbc4){return{'name':_['capitalize'](_0x1bbbc4),'value':_0x1bbbc4};}):[]};})};}})[_0x14c7('0x25')](respondWithResult(_0x39a48e,null))['catch'](function(_0x34dcbd){var _0x297833=_0x3f0406['query'][_0x14c7('0x64')]?0x1f4:_0x34dcbd[_0x14c7('0x65')]||0x1f4;logger[_0x14c7('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x14c7('0x66'),_0x297833,JSON[_0x14c7('0x67')](_0x34dcbd));delete _0x34dcbd[_0x14c7('0x29')];if(_0x297833===0x191){_0x297833=0x190;}_0x39a48e[_0x14c7('0x1a')](_0x297833)[_0x14c7('0x2a')](_0x3f0406[_0x14c7('0x30')][_0x14c7('0x64')]?{'message':'Wrong\x20credentials','statusCode':_0x34dcbd['statusCode']}:_0x34dcbd);});};
\ No newline at end of file
+var _0x1cc3=['pick','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','remove','includes','default','custom_text','custom_dropdown','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','error','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','merge','options','then','includeAll','include','findAll','rows','show','params','catch','create','body','find','getConfigurations','FreshdeskConfiguration','length'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x1cc3,0x11b));var _0x31cc=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x1cc3[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require(_0x31cc('0x0'));var rimraf=require(_0x31cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x31cc('0x2'));var rp=require('request-promise');var moment=require(_0x31cc('0x3'));var BPromise=require(_0x31cc('0x4'));var Mustache=require(_0x31cc('0x5'));var util=require('util');var path=require(_0x31cc('0x6'));var sox=require(_0x31cc('0x7'));var csv=require(_0x31cc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31cc('0x9'));var _=require(_0x31cc('0xa'));var squel=require(_0x31cc('0xb'));var crypto=require(_0x31cc('0xc'));var jsforce=require(_0x31cc('0xd'));var deskjs=require(_0x31cc('0xe'));var toCsv=require(_0x31cc('0x8'));var querystring=require(_0x31cc('0xf'));var Papa=require(_0x31cc('0x10'));var Redis=require('ioredis');var authService=require(_0x31cc('0x11'));var qs=require(_0x31cc('0x12'));var as=require(_0x31cc('0x13'));var hardwareService=require(_0x31cc('0x14'));var logger=require(_0x31cc('0x15'))(_0x31cc('0x16'));var utils=require(_0x31cc('0x17'));var config=require(_0x31cc('0x18'));var licenseUtil=require(_0x31cc('0x19'));var db=require(_0x31cc('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x11ce41,_0x1b939e){_0x1b939e=_0x1b939e||0xcc;return function(_0x4a26dc){if(_0x4a26dc){return _0x11ce41[_0x31cc('0x1b')](_0x1b939e);}return _0x11ce41[_0x31cc('0x1c')](_0x1b939e)[_0x31cc('0x1d')]();};}function respondWithResult(_0x34b164,_0x10738a){_0x10738a=_0x10738a||0xc8;return function(_0x118bb0){if(_0x118bb0){return _0x34b164[_0x31cc('0x1c')](_0x10738a)[_0x31cc('0x1e')](_0x118bb0);}};}function respondWithFilteredResult(_0x1227ad,_0xc22d83){return function(_0x171917){if(_0x171917){var _0x5b970e=typeof _0xc22d83[_0x31cc('0x1f')]===_0x31cc('0x20')&&typeof _0xc22d83[_0x31cc('0x21')]==='undefined';var _0x2908cd=_0x171917[_0x31cc('0x22')];var _0x56f18e=_0x5b970e?0x0:_0xc22d83[_0x31cc('0x1f')];var _0x3a9a53=_0x5b970e?_0x171917[_0x31cc('0x22')]:_0xc22d83[_0x31cc('0x1f')]+_0xc22d83[_0x31cc('0x21')];var _0x4a5d34;if(_0x3a9a53>=_0x2908cd){_0x3a9a53=_0x2908cd;_0x4a5d34=0xc8;}else{_0x4a5d34=0xce;}_0x1227ad[_0x31cc('0x1c')](_0x4a5d34);return _0x1227ad[_0x31cc('0x23')](_0x31cc('0x24'),_0x56f18e+'-'+_0x3a9a53+'/'+_0x2908cd)[_0x31cc('0x1e')](_0x171917);}return null;};}function patchUpdates(_0x1e3039){return function(_0x3c0db5){try{jsonpatch[_0x31cc('0x25')](_0x3c0db5,_0x1e3039,!![]);}catch(_0x43c769){return BPromise['reject'](_0x43c769);}return _0x3c0db5[_0x31cc('0x26')]();};}function saveUpdates(_0x34dccf,_0xbe2be8){return function(_0x5c2248){if(_0x5c2248){return _0x5c2248[_0x31cc('0x27')](_0x34dccf)['then'](function(_0x408c4d){return _0x408c4d;});}return null;};}function removeEntity(_0x5c86da,_0x39dd8e){return function(_0x4ebeb7){if(_0x4ebeb7){return _0x4ebeb7[_0x31cc('0x28')]()['then'](function(){_0x5c86da[_0x31cc('0x1c')](0xcc)[_0x31cc('0x1d')]();});}};}function handleEntityNotFound(_0x482e67,_0x1c48ef){return function(_0x57862d){if(!_0x57862d){_0x482e67[_0x31cc('0x1b')](0x194);}return _0x57862d;};}function handleError(_0x4da7ee,_0x2edaff){_0x2edaff=_0x2edaff||0x1f4;return function(_0x5a51ff){logger[_0x31cc('0x29')](_0x5a51ff[_0x31cc('0x2a')]);if(_0x5a51ff[_0x31cc('0x2b')]){delete _0x5a51ff[_0x31cc('0x2b')];}_0x4da7ee[_0x31cc('0x1c')](_0x2edaff)[_0x31cc('0x2c')](_0x5a51ff);};}exports[_0x31cc('0x2d')]=function(_0x485a64,_0x56d618){var _0x1c21ea={},_0x3ea677={},_0x1c897e={'count':0x0,'rows':[]};var _0xca940f=_['map'](db[_0x31cc('0x2e')][_0x31cc('0x2f')],function(_0xd8108d){return{'name':_0xd8108d[_0x31cc('0x30')],'type':_0xd8108d[_0x31cc('0x31')][_0x31cc('0x32')]};});_0x3ea677[_0x31cc('0x33')]=_[_0x31cc('0x34')](_0xca940f,_0x31cc('0x2b'));_0x3ea677[_0x31cc('0x35')]=_[_0x31cc('0x36')](_0x485a64[_0x31cc('0x35')]);_0x3ea677['filters']=_[_0x31cc('0x37')](_0x3ea677[_0x31cc('0x33')],_0x3ea677['query']);_0x1c21ea[_0x31cc('0x38')]=_[_0x31cc('0x37')](_0x3ea677[_0x31cc('0x33')],qs['fields'](_0x485a64[_0x31cc('0x35')][_0x31cc('0x39')]));_0x1c21ea[_0x31cc('0x38')]=_0x1c21ea[_0x31cc('0x38')]['length']?_0x1c21ea[_0x31cc('0x38')]:_0x3ea677[_0x31cc('0x33')];if(!_0x485a64['query']['hasOwnProperty'](_0x31cc('0x3a'))){_0x1c21ea[_0x31cc('0x21')]=qs[_0x31cc('0x21')](_0x485a64['query']['limit']);_0x1c21ea[_0x31cc('0x1f')]=qs[_0x31cc('0x1f')](_0x485a64[_0x31cc('0x35')]['offset']);}_0x1c21ea[_0x31cc('0x3b')]=qs[_0x31cc('0x3c')](_0x485a64[_0x31cc('0x35')][_0x31cc('0x3c')]);_0x1c21ea[_0x31cc('0x3d')]=qs['filters'](_['pick'](_0x485a64[_0x31cc('0x35')],_0x3ea677[_0x31cc('0x3e')]),_0xca940f);if(_0x485a64[_0x31cc('0x35')][_0x31cc('0x3f')]){_0x1c21ea[_0x31cc('0x3d')]=_[_0x31cc('0x40')](_0x1c21ea[_0x31cc('0x3d')],{'$or':_[_0x31cc('0x34')](_0xca940f,function(_0x3e3202){if(_0x3e3202[_0x31cc('0x31')]!=='VIRTUAL'){var _0x1d3e42={};_0x1d3e42[_0x3e3202['name']]={'$like':'%'+_0x485a64['query'][_0x31cc('0x3f')]+'%'};return _0x1d3e42;}})});}_0x1c21ea=_[_0x31cc('0x40')]({},_0x1c21ea,_0x485a64[_0x31cc('0x41')]);var _0x233c00={'where':_0x1c21ea[_0x31cc('0x3d')]};return db['FreshdeskAccount']['count'](_0x233c00)[_0x31cc('0x42')](function(_0x378d35){_0x1c897e[_0x31cc('0x22')]=_0x378d35;if(_0x485a64[_0x31cc('0x35')][_0x31cc('0x43')]){_0x1c21ea[_0x31cc('0x44')]=[{'all':!![]}];}return db[_0x31cc('0x2e')][_0x31cc('0x45')](_0x1c21ea);})[_0x31cc('0x42')](function(_0x3cdcdf){_0x1c897e[_0x31cc('0x46')]=_0x3cdcdf;return _0x1c897e;})[_0x31cc('0x42')](respondWithFilteredResult(_0x56d618,_0x1c21ea))['catch'](handleError(_0x56d618,null));};exports[_0x31cc('0x47')]=function(_0x337756,_0x4ec973){var _0x2ef3c8={'raw':![],'where':{'id':_0x337756[_0x31cc('0x48')]['id']}},_0x4cd149={};_0x4cd149[_0x31cc('0x33')]=_[_0x31cc('0x36')](db[_0x31cc('0x2e')][_0x31cc('0x2f')]);_0x4cd149[_0x31cc('0x35')]=_[_0x31cc('0x36')](_0x337756[_0x31cc('0x35')]);_0x4cd149[_0x31cc('0x3e')]=_['intersection'](_0x4cd149[_0x31cc('0x33')],_0x4cd149[_0x31cc('0x35')]);_0x2ef3c8['attributes']=_[_0x31cc('0x37')](_0x4cd149[_0x31cc('0x33')],qs[_0x31cc('0x39')](_0x337756['query'][_0x31cc('0x39')]));_0x2ef3c8['attributes']=_0x2ef3c8['attributes']['length']?_0x2ef3c8[_0x31cc('0x38')]:_0x4cd149[_0x31cc('0x33')];if(_0x337756[_0x31cc('0x35')][_0x31cc('0x43')]){_0x2ef3c8[_0x31cc('0x44')]=[{'all':!![]}];}_0x2ef3c8=_[_0x31cc('0x40')]({},_0x2ef3c8,_0x337756[_0x31cc('0x41')]);return db[_0x31cc('0x2e')]['find'](_0x2ef3c8)[_0x31cc('0x42')](handleEntityNotFound(_0x4ec973,null))['then'](respondWithResult(_0x4ec973,null))[_0x31cc('0x49')](handleError(_0x4ec973,null));};exports[_0x31cc('0x4a')]=function(_0x3bf96d,_0x2e16f2){return db['FreshdeskAccount'][_0x31cc('0x4a')](_0x3bf96d[_0x31cc('0x4b')],{})[_0x31cc('0x42')](respondWithResult(_0x2e16f2,0xc9))[_0x31cc('0x49')](handleError(_0x2e16f2,null));};exports['update']=function(_0x23aff5,_0x4a6eab){if(_0x23aff5[_0x31cc('0x4b')]['id']){delete _0x23aff5[_0x31cc('0x4b')]['id'];}return db[_0x31cc('0x2e')][_0x31cc('0x4c')]({'where':{'id':_0x23aff5[_0x31cc('0x48')]['id']}})['then'](handleEntityNotFound(_0x4a6eab,null))[_0x31cc('0x42')](saveUpdates(_0x23aff5[_0x31cc('0x4b')],null))[_0x31cc('0x42')](respondWithResult(_0x4a6eab,null))[_0x31cc('0x49')](handleError(_0x4a6eab,null));};exports[_0x31cc('0x28')]=function(_0x3eb77b,_0x438a0b){return db[_0x31cc('0x2e')]['find']({'where':{'id':_0x3eb77b[_0x31cc('0x48')]['id']}})[_0x31cc('0x42')](handleEntityNotFound(_0x438a0b,null))['then'](removeEntity(_0x438a0b,null))[_0x31cc('0x49')](handleError(_0x438a0b,null));};exports[_0x31cc('0x4d')]=function(_0x2117e7,_0xd47299,_0x136b9a){var _0x5a3418={};var _0x19835b={};var _0x20cbe4;var _0x5ed0cd;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x2117e7[_0x31cc('0x48')]['id']}})['then'](handleEntityNotFound(_0xd47299,null))[_0x31cc('0x42')](function(_0x6ccb1){if(_0x6ccb1){_0x20cbe4=_0x6ccb1;_0x19835b['model']=_[_0x31cc('0x36')](db[_0x31cc('0x4e')]['rawAttributes']);_0x19835b[_0x31cc('0x35')]=_[_0x31cc('0x36')](_0x2117e7[_0x31cc('0x35')]);_0x19835b[_0x31cc('0x3e')]=_[_0x31cc('0x37')](_0x19835b[_0x31cc('0x33')],_0x19835b[_0x31cc('0x35')]);_0x5a3418[_0x31cc('0x38')]=_[_0x31cc('0x37')](_0x19835b[_0x31cc('0x33')],qs[_0x31cc('0x39')](_0x2117e7[_0x31cc('0x35')][_0x31cc('0x39')]));_0x5a3418['attributes']=_0x5a3418[_0x31cc('0x38')][_0x31cc('0x4f')]?_0x5a3418['attributes']:_0x19835b[_0x31cc('0x33')];_0x5a3418[_0x31cc('0x3b')]=qs[_0x31cc('0x3c')](_0x2117e7[_0x31cc('0x35')][_0x31cc('0x3c')]);_0x5a3418[_0x31cc('0x3d')]=qs[_0x31cc('0x3e')](_[_0x31cc('0x50')](_0x2117e7[_0x31cc('0x35')],_0x19835b['filters']));if(_0x2117e7[_0x31cc('0x35')][_0x31cc('0x3f')]){_0x5a3418[_0x31cc('0x3d')]=_[_0x31cc('0x40')](_0x5a3418[_0x31cc('0x3d')],{'$or':_[_0x31cc('0x34')](_0x5a3418[_0x31cc('0x38')],function(_0x36df68){var _0x14c68c={};_0x14c68c[_0x36df68]={'$like':'%'+_0x2117e7['query']['filter']+'%'};return _0x14c68c;})});}_0x5a3418=_[_0x31cc('0x40')]({},_0x5a3418,_0x2117e7[_0x31cc('0x41')]);return _0x20cbe4['getConfigurations'](_0x5a3418);}})[_0x31cc('0x42')](function(_0x265493){if(_0x265493){_0x5ed0cd=_0x265493[_0x31cc('0x4f')];if(!_0x2117e7['query'][_0x31cc('0x51')](_0x31cc('0x3a'))){_0x5a3418[_0x31cc('0x21')]=qs['limit'](_0x2117e7[_0x31cc('0x35')][_0x31cc('0x21')]);_0x5a3418['offset']=qs['offset'](_0x2117e7[_0x31cc('0x35')][_0x31cc('0x1f')]);}return _0x20cbe4[_0x31cc('0x4d')](_0x5a3418);}})[_0x31cc('0x42')](function(_0x196f51){if(_0x196f51){return _0x196f51?{'count':_0x5ed0cd,'rows':_0x196f51}:null;}})[_0x31cc('0x42')](respondWithResult(_0xd47299,null))['catch'](handleError(_0xd47299,null));};exports[_0x31cc('0x52')]=function(_0x6114e8,_0x36a055,_0xe22a0d){if(_0x6114e8[_0x31cc('0x4b')]['id']){delete _0x6114e8[_0x31cc('0x4b')]['id'];}return db['FreshdeskAccount'][_0x31cc('0x53')]({'where':{'id':_0x6114e8[_0x31cc('0x48')]['id']}})[_0x31cc('0x42')](handleEntityNotFound(_0x36a055,null))['then'](function(_0x200a4f){if(_0x200a4f){_0x6114e8[_0x31cc('0x4b')][_0x31cc('0x54')]=_0x200a4f['id'];_0x6114e8['body'][_0x31cc('0x55')]=integrations[_0x31cc('0x56')](_0x6114e8[_0x31cc('0x4b')]['channel'],_0x6114e8[_0x31cc('0x4b')][_0x31cc('0x31')]);_0x6114e8[_0x31cc('0x4b')][_0x31cc('0x57')]=integrations[_0x31cc('0x58')](_0x6114e8['body'][_0x31cc('0x59')],_0x6114e8['body'][_0x31cc('0x31')]);return db['FreshdeskConfiguration'][_0x31cc('0x4a')](_0x6114e8[_0x31cc('0x4b')],{'include':[{'model':db[_0x31cc('0x5a')],'as':_0x31cc('0x55')},{'model':db[_0x31cc('0x5a')],'as':_0x31cc('0x57')}]});}return null;})[_0x31cc('0x42')](respondWithResult(_0x36a055,null))['catch'](handleError(_0x36a055,null));};exports['getFields']=function(_0x7b6d6f,_0x2bf513,_0x128c33){var _0x204a34='';return db[_0x31cc('0x2e')]['findOne']({'where':{'id':_0x7b6d6f[_0x31cc('0x48')]['id']},'attributes':['id',_0x31cc('0x5b'),_0x31cc('0x5c')]})[_0x31cc('0x42')](handleEntityNotFound(_0x2bf513,null))['then'](function(_0x5c0e0c){if(_0x5c0e0c){_0x204a34=_0x5c0e0c[_0x31cc('0x5b')];var _0x22acbe=_0x204a34[_0x31cc('0x5d')](-0x1);if(_0x22acbe==='/'){_0x204a34=_0x204a34[_0x31cc('0x5e')](0x0,_0x204a34[_0x31cc('0x5f')](_0x22acbe));}return rp({'method':_0x31cc('0x60'),'uri':util[_0x31cc('0x61')]('%s/%s',_0x204a34,_0x31cc('0x62')),'headers':{'Authorization':util[_0x31cc('0x61')](_0x31cc('0x63'),new Buffer(util[_0x31cc('0x61')](_0x31cc('0x64'),_0x5c0e0c['apiKey']))[_0x31cc('0x65')](_0x31cc('0x66')))},'json':!![]});}})[_0x31cc('0x42')](function(_0x22f064){if(_0x22f064){var _0x1bea57=[_0x31cc('0x67'),_0x31cc('0x68'),_0x31cc('0x69'),_0x31cc('0x6a'),_0x31cc('0x1c'),_0x31cc('0x6b'),_0x31cc('0x6c'),_0x31cc('0x6d'),'ticket_type',_0x31cc('0x6c'),'company'];_[_0x31cc('0x6e')](_0x22f064,function(_0x39b3ae){return _0x1bea57[_0x31cc('0x6f')](_0x39b3ae[_0x31cc('0x2b')])||!_0x39b3ae[_0x31cc('0x70')]&&_0x39b3ae['type']!==_0x31cc('0x71')&&_0x39b3ae[_0x31cc('0x31')]!==_0x31cc('0x72');});return{'count':_0x22f064[_0x31cc('0x4f')],'rows':_['map'](_0x22f064,function(_0xec392){return{'id':_0xec392[_0x31cc('0x2b')],'name':_0xec392['label'],'custom':!_0xec392[_0x31cc('0x70')],'options':_0xec392[_0x31cc('0x73')]?_[_0x31cc('0x34')](_0xec392[_0x31cc('0x73')],function(_0xed1228){return{'name':_['capitalize'](_0xed1228),'value':_0xed1228};}):[]};})};}})['then'](respondWithResult(_0x2bf513,null))[_0x31cc('0x49')](function(_0x5b9f3e){var _0x15f60e=_0x7b6d6f[_0x31cc('0x35')][_0x31cc('0x74')]?0x1f4:_0x5b9f3e[_0x31cc('0x75')]||0x1f4;logger[_0x31cc('0x29')](_0x31cc('0x76'),'getFields',_0x15f60e,JSON[_0x31cc('0x77')](_0x5b9f3e));delete _0x5b9f3e[_0x31cc('0x2b')];if(_0x15f60e===0x191){_0x15f60e=0x190;}_0x2bf513[_0x31cc('0x1c')](_0x15f60e)['send'](_0x7b6d6f[_0x31cc('0x35')][_0x31cc('0x74')]?{'message':_0x31cc('0x78'),'statusCode':_0x5b9f3e['statusCode']}:_0x5b9f3e);});};
\ No newline at end of file
index 4a2cd37..5b28a21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa16d=['api','moment','bluebird','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','lodash','../../config/logger'];(function(_0x58a1a6,_0x385e32){var _0x2a748d=function(_0x3dfc8f){while(--_0x3dfc8f){_0x58a1a6['push'](_0x58a1a6['shift']());}};_0x2a748d(++_0x385e32);}(_0xa16d,0xdf));var _0xda16=function(_0x121d9e,_0x11b966){_0x121d9e=_0x121d9e-0x0;var _0x5df466=_0xa16d[_0x121d9e];return _0x5df466;};'use strict';var _=require(_0xda16('0x0'));var util=require('util');var logger=require(_0xda16('0x1'))(_0xda16('0x2'));var moment=require(_0xda16('0x3'));var BPromise=require(_0xda16('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(_0xda16('0x5'));var integrations=require('../../components/integrations/configuration');module[_0xda16('0x6')]=function(_0x10ae6a,_0x35db1d){return _0x10ae6a[_0xda16('0x7')](_0xda16('0x8'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9135=['bluebird','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x4db481,_0x4546c2){var _0x35780f=function(_0x584a74){while(--_0x584a74){_0x4db481['push'](_0x4db481['shift']());}};_0x35780f(++_0x4546c2);}(_0x9135,0x1b7));var _0x5913=function(_0x48d73c,_0x4a1404){_0x48d73c=_0x48d73c-0x0;var _0x2a6dd0=_0x9135[_0x48d73c];return _0x2a6dd0;};'use strict';var _=require(_0x5913('0x0'));var util=require(_0x5913('0x1'));var logger=require(_0x5913('0x2'))(_0x5913('0x3'));var moment=require(_0x5913('0x4'));var BPromise=require(_0x5913('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5913('0x6'));var attributes=require(_0x5913('0x7'));var integrations=require(_0x5913('0x8'));module['exports']=function(_0x29ec46,_0x46ce20){return _0x29ec46[_0x5913('0x9')](_0x5913('0xa'),attributes,{'tableName':_0x5913('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b4978f4..053080a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93aa=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','attributes','limit','include','model','map','ShowFreshdeskAccount','find','raw','where','lodash','util','moment'];(function(_0x32dd49,_0x5b4945){var _0x10ca49=function(_0x18f47c){while(--_0x18f47c){_0x32dd49['push'](_0x32dd49['shift']());}};_0x10ca49(++_0x5b4945);}(_0x93aa,0xe1));var _0xa93a=function(_0x3eaa5f,_0x397970){_0x3eaa5f=_0x3eaa5f-0x0;var _0x42082a=_0x93aa[_0x3eaa5f];return _0x42082a;};'use strict';var _=require(_0xa93a('0x0'));var util=require(_0xa93a('0x1'));var moment=require(_0xa93a('0x2'));var BPromise=require(_0xa93a('0x3'));var rs=require(_0xa93a('0x4'));var fs=require('fs');var Redis=require(_0xa93a('0x5'));var db=require(_0xa93a('0x6'))['db'];var utils=require(_0xa93a('0x7'));var logger=require(_0xa93a('0x8'))(_0xa93a('0x9'));var config=require(_0xa93a('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa93a('0xb')][_0xa93a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1fca33,_0x268152,_0x472019){return new BPromise(function(_0x37c6dc,_0x513d63){return client['request'](_0x1fca33,_0x472019)[_0xa93a('0xd')](function(_0x579618){logger['info'](_0xa93a('0xe'),_0x268152,_0xa93a('0xf'));logger[_0xa93a('0x10')](_0xa93a('0x11'),_0x268152,_0xa93a('0xf'),JSON[_0xa93a('0x12')](_0x579618));if(_0x579618[_0xa93a('0x13')]){if(_0x579618[_0xa93a('0x13')][_0xa93a('0x14')]===0x1f4){logger['error'](_0xa93a('0xe'),_0x268152,_0x579618[_0xa93a('0x13')][_0xa93a('0x15')]);return _0x513d63(_0x579618[_0xa93a('0x13')][_0xa93a('0x15')]);}logger[_0xa93a('0x13')](_0xa93a('0xe'),_0x268152,_0x579618['error'][_0xa93a('0x15')]);return _0x37c6dc(_0x579618[_0xa93a('0x13')][_0xa93a('0x15')]);}else{logger[_0xa93a('0x16')](_0xa93a('0xe'),_0x268152,_0xa93a('0xf'));_0x37c6dc(_0x579618[_0xa93a('0x17')][_0xa93a('0x15')]);}})[_0xa93a('0x18')](function(_0x4f1659){logger['error'](_0xa93a('0xe'),_0x268152,_0x4f1659);_0x513d63(_0x4f1659);});});}exports[_0xa93a('0x19')]=function(_0x8308f3){var _0x383293=this;return new Promise(function(_0x4d2ea4,_0x20eeb3){return db[_0xa93a('0x1a')][_0xa93a('0x1b')]({'raw':_0x8308f3[_0xa93a('0x1c')]?_0x8308f3[_0xa93a('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x8308f3['options']?_0x8308f3[_0xa93a('0x1c')]['where']||null:null,'attributes':_0x8308f3['options']?_0x8308f3[_0xa93a('0x1c')][_0xa93a('0x1d')]||null:null,'limit':_0x8308f3[_0xa93a('0x1c')]?_0x8308f3[_0xa93a('0x1c')][_0xa93a('0x1e')]||null:null,'include':_0x8308f3['options']?_0x8308f3[_0xa93a('0x1c')][_0xa93a('0x1f')]?_['map'](_0x8308f3['options'][_0xa93a('0x1f')],function(_0x261637){return{'model':db[_0x261637[_0xa93a('0x20')]],'as':_0x261637['as'],'attributes':_0x261637['attributes'],'include':_0x261637[_0xa93a('0x1f')]?_[_0xa93a('0x21')](_0x261637[_0xa93a('0x1f')],function(_0x4ebd45){return{'model':db[_0x4ebd45[_0xa93a('0x20')]],'as':_0x4ebd45['as'],'attributes':_0x4ebd45['attributes'],'include':_0x4ebd45[_0xa93a('0x1f')]?_[_0xa93a('0x21')](_0x4ebd45[_0xa93a('0x1f')],function(_0x1328bf){return{'model':db[_0x1328bf[_0xa93a('0x20')]],'as':_0x1328bf['as'],'attributes':_0x1328bf[_0xa93a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa93a('0xd')](function(_0x169661){logger[_0xa93a('0x16')](_0xa93a('0x19'),_0x8308f3);logger['debug'](_0xa93a('0x19'),_0x8308f3,JSON[_0xa93a('0x12')](_0x169661));_0x4d2ea4(_0x169661);})[_0xa93a('0x18')](function(_0x355919){logger[_0xa93a('0x13')]('GetFreshdeskAccount',_0x355919[_0xa93a('0x15')],_0x8308f3);_0x20eeb3(_0x383293[_0xa93a('0x13')](0x1f4,_0x355919[_0xa93a('0x15')]));});});};exports[_0xa93a('0x22')]=function(_0x1139e2){var _0x1a407d=this;return new Promise(function(_0x15cee0,_0x4c5cdc){return db[_0xa93a('0x1a')][_0xa93a('0x23')]({'raw':_0x1139e2[_0xa93a('0x1c')]?_0x1139e2[_0xa93a('0x1c')][_0xa93a('0x24')]===undefined?!![]:![]:!![],'where':_0x1139e2[_0xa93a('0x1c')]?_0x1139e2['options'][_0xa93a('0x25')]||null:null,'attributes':_0x1139e2[_0xa93a('0x1c')]?_0x1139e2[_0xa93a('0x1c')]['attributes']||null:null,'include':_0x1139e2[_0xa93a('0x1c')]?_0x1139e2['options'][_0xa93a('0x1f')]?_[_0xa93a('0x21')](_0x1139e2[_0xa93a('0x1c')][_0xa93a('0x1f')],function(_0x2220ac){return{'model':db[_0x2220ac[_0xa93a('0x20')]],'as':_0x2220ac['as'],'attributes':_0x2220ac[_0xa93a('0x1d')],'include':_0x2220ac[_0xa93a('0x1f')]?_['map'](_0x2220ac['include'],function(_0x3fb05c){return{'model':db[_0x3fb05c[_0xa93a('0x20')]],'as':_0x3fb05c['as'],'attributes':_0x3fb05c[_0xa93a('0x1d')],'include':_0x3fb05c['include']?_['map'](_0x3fb05c[_0xa93a('0x1f')],function(_0x2c1af6){return{'model':db[_0x2c1af6[_0xa93a('0x20')]],'as':_0x2c1af6['as'],'attributes':_0x2c1af6[_0xa93a('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x255633){logger[_0xa93a('0x16')](_0xa93a('0x22'),_0x1139e2);logger[_0xa93a('0x10')](_0xa93a('0x22'),_0x1139e2,JSON[_0xa93a('0x12')](_0x255633));_0x15cee0(_0x255633);})[_0xa93a('0x18')](function(_0x4f1964){logger['error'](_0xa93a('0x22'),_0x4f1964['message'],_0x1139e2);_0x4c5cdc(_0x1a407d[_0xa93a('0x13')](0x1f4,_0x4f1964[_0xa93a('0x15')]));});});};
\ No newline at end of file
+var _0x9658=['find','raw','where','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','findAll','options','attributes','limit','include','map','model','ShowFreshdeskAccount','FreshdeskAccount'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9658,0x6f));var _0x8965=function(_0x1dd82f,_0x52acb7){_0x1dd82f=_0x1dd82f-0x0;var _0x353ca4=_0x9658[_0x1dd82f];return _0x353ca4;};'use strict';var _=require(_0x8965('0x0'));var util=require('util');var moment=require(_0x8965('0x1'));var BPromise=require(_0x8965('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8965('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8965('0x4'));var logger=require(_0x8965('0x5'))(_0x8965('0x6'));var config=require('../../config/environment');var jayson=require(_0x8965('0x7'));var client=jayson[_0x8965('0x8')][_0x8965('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x290f30,_0x271060,_0x27b334){return new BPromise(function(_0x1e7d61,_0xe14503){return client[_0x8965('0xa')](_0x290f30,_0x27b334)[_0x8965('0xb')](function(_0x214249){logger[_0x8965('0xc')](_0x8965('0xd'),_0x271060,_0x8965('0xe'));logger[_0x8965('0xf')](_0x8965('0x10'),_0x271060,_0x8965('0xe'),JSON[_0x8965('0x11')](_0x214249));if(_0x214249[_0x8965('0x12')]){if(_0x214249['error'][_0x8965('0x13')]===0x1f4){logger[_0x8965('0x12')](_0x8965('0xd'),_0x271060,_0x214249[_0x8965('0x12')][_0x8965('0x14')]);return _0xe14503(_0x214249[_0x8965('0x12')][_0x8965('0x14')]);}logger[_0x8965('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x271060,_0x214249[_0x8965('0x12')][_0x8965('0x14')]);return _0x1e7d61(_0x214249[_0x8965('0x12')][_0x8965('0x14')]);}else{logger[_0x8965('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x271060,_0x8965('0xe'));_0x1e7d61(_0x214249[_0x8965('0x15')][_0x8965('0x14')]);}})[_0x8965('0x16')](function(_0x5c7d55){logger[_0x8965('0x12')](_0x8965('0xd'),_0x271060,_0x5c7d55);_0xe14503(_0x5c7d55);});});}exports[_0x8965('0x17')]=function(_0x2e6851){var _0x2b4f64=this;return new Promise(function(_0x927a0a,_0x579fe6){return db['FreshdeskAccount'][_0x8965('0x18')]({'raw':_0x2e6851[_0x8965('0x19')]?_0x2e6851['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e6851['options']?_0x2e6851['options']['where']||null:null,'attributes':_0x2e6851[_0x8965('0x19')]?_0x2e6851['options'][_0x8965('0x1a')]||null:null,'limit':_0x2e6851[_0x8965('0x19')]?_0x2e6851[_0x8965('0x19')][_0x8965('0x1b')]||null:null,'include':_0x2e6851['options']?_0x2e6851[_0x8965('0x19')][_0x8965('0x1c')]?_[_0x8965('0x1d')](_0x2e6851[_0x8965('0x19')][_0x8965('0x1c')],function(_0x33c208){return{'model':db[_0x33c208[_0x8965('0x1e')]],'as':_0x33c208['as'],'attributes':_0x33c208[_0x8965('0x1a')],'include':_0x33c208[_0x8965('0x1c')]?_[_0x8965('0x1d')](_0x33c208['include'],function(_0x279402){return{'model':db[_0x279402[_0x8965('0x1e')]],'as':_0x279402['as'],'attributes':_0x279402['attributes'],'include':_0x279402[_0x8965('0x1c')]?_['map'](_0x279402['include'],function(_0x1955c1){return{'model':db[_0x1955c1[_0x8965('0x1e')]],'as':_0x1955c1['as'],'attributes':_0x1955c1[_0x8965('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8965('0xb')](function(_0x5abd14){logger['info'](_0x8965('0x17'),_0x2e6851);logger[_0x8965('0xf')](_0x8965('0x17'),_0x2e6851,JSON[_0x8965('0x11')](_0x5abd14));_0x927a0a(_0x5abd14);})[_0x8965('0x16')](function(_0x454748){logger['error']('GetFreshdeskAccount',_0x454748[_0x8965('0x14')],_0x2e6851);_0x579fe6(_0x2b4f64['error'](0x1f4,_0x454748['message']));});});};exports[_0x8965('0x1f')]=function(_0x58df71){var _0x5d169=this;return new Promise(function(_0x4c6c05,_0x4ad940){return db[_0x8965('0x20')][_0x8965('0x21')]({'raw':_0x58df71[_0x8965('0x19')]?_0x58df71[_0x8965('0x19')][_0x8965('0x22')]===undefined?!![]:![]:!![],'where':_0x58df71[_0x8965('0x19')]?_0x58df71['options'][_0x8965('0x23')]||null:null,'attributes':_0x58df71[_0x8965('0x19')]?_0x58df71[_0x8965('0x19')]['attributes']||null:null,'include':_0x58df71[_0x8965('0x19')]?_0x58df71[_0x8965('0x19')][_0x8965('0x1c')]?_[_0x8965('0x1d')](_0x58df71[_0x8965('0x19')][_0x8965('0x1c')],function(_0x30ce7d){return{'model':db[_0x30ce7d[_0x8965('0x1e')]],'as':_0x30ce7d['as'],'attributes':_0x30ce7d[_0x8965('0x1a')],'include':_0x30ce7d[_0x8965('0x1c')]?_[_0x8965('0x1d')](_0x30ce7d[_0x8965('0x1c')],function(_0x333f70){return{'model':db[_0x333f70['model']],'as':_0x333f70['as'],'attributes':_0x333f70[_0x8965('0x1a')],'include':_0x333f70[_0x8965('0x1c')]?_['map'](_0x333f70['include'],function(_0x4149f1){return{'model':db[_0x4149f1[_0x8965('0x1e')]],'as':_0x4149f1['as'],'attributes':_0x4149f1[_0x8965('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8965('0xb')](function(_0x584e46){logger['info'](_0x8965('0x1f'),_0x58df71);logger['debug'](_0x8965('0x1f'),_0x58df71,JSON[_0x8965('0x11')](_0x584e46));_0x4c6c05(_0x584e46);})[_0x8965('0x16')](function(_0x5eac49){logger[_0x8965('0x12')]('ShowFreshdeskAccount',_0x5eac49[_0x8965('0x14')],_0x58df71);_0x4ad940(_0x5d169['error'](0x1f4,_0x5eac49[_0x8965('0x14')]));});});};
\ No newline at end of file
index 656be0b..af24af8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fe6=['/:id/descriptions','isAuthenticated','getDescriptions','getTags','post','create','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','/:id','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x443e9e,_0x3c1baf){var _0x5db340=function(_0x201893){while(--_0x201893){_0x443e9e['push'](_0x443e9e['shift']());}};_0x5db340(++_0x3c1baf);}(_0x2fe6,0x11d));var _0x62fe=function(_0x35084d,_0x195954){_0x35084d=_0x35084d-0x0;var _0x4cfe59=_0x2fe6[_0x35084d];return _0x4cfe59;};'use strict';var multer=require(_0x62fe('0x0'));var util=require(_0x62fe('0x1'));var path=require(_0x62fe('0x2'));var timeout=require('connect-timeout');var express=require(_0x62fe('0x3'));var router=express[_0x62fe('0x4')]();var fs_extra=require(_0x62fe('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x62fe('0x6'));var config=require(_0x62fe('0x7'));var controller=require(_0x62fe('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x62fe('0x9')](_0x62fe('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x62fe('0xb'),auth['isAuthenticated'](),controller[_0x62fe('0xc')]);router[_0x62fe('0x9')](_0x62fe('0xd'),auth['isAuthenticated'](),controller[_0x62fe('0xe')]);router[_0x62fe('0x9')](_0x62fe('0xf'),auth[_0x62fe('0x10')](),controller[_0x62fe('0x11')]);router[_0x62fe('0x9')]('/:id/tags',auth[_0x62fe('0x10')](),controller[_0x62fe('0x12')]);router[_0x62fe('0x13')]('/',auth[_0x62fe('0x10')](),controller[_0x62fe('0x14')]);router['post']('/:id/tags',auth[_0x62fe('0x10')](),controller['setTags']);router[_0x62fe('0x15')](_0x62fe('0xa'),auth[_0x62fe('0x10')](),controller['update']);router[_0x62fe('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x62fe('0x17')]);module[_0x62fe('0x18')]=router;
\ No newline at end of file
+var _0x58f5=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','/:id','update','delete','exports','util','path','connect-timeout','express','./intFreshdeskConfiguration.controller','index','get','isAuthenticated'];(function(_0x25ec2b,_0x1a0b12){var _0x2eea15=function(_0xb3e456){while(--_0xb3e456){_0x25ec2b['push'](_0x25ec2b['shift']());}};_0x2eea15(++_0x1a0b12);}(_0x58f5,0x1f2));var _0x558f=function(_0x56c018,_0x485ba5){_0x56c018=_0x56c018-0x0;var _0x2cb33a=_0x58f5[_0x56c018];return _0x2cb33a;};'use strict';var multer=require('multer');var util=require(_0x558f('0x0'));var path=require(_0x558f('0x1'));var timeout=require(_0x558f('0x2'));var express=require(_0x558f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x558f('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x558f('0x5')]);router[_0x558f('0x6')]('/:id',auth[_0x558f('0x7')](),controller[_0x558f('0x8')]);router[_0x558f('0x6')](_0x558f('0x9'),auth['isAuthenticated'](),controller[_0x558f('0xa')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x558f('0xb')]);router[_0x558f('0x6')](_0x558f('0xc'),auth[_0x558f('0x7')](),controller[_0x558f('0xd')]);router[_0x558f('0x6')](_0x558f('0xe'),auth[_0x558f('0x7')](),controller[_0x558f('0xf')]);router['post']('/',auth[_0x558f('0x7')](),controller[_0x558f('0x10')]);router[_0x558f('0x11')](_0x558f('0xe'),auth[_0x558f('0x7')](),controller[_0x558f('0x12')]);router['put'](_0x558f('0x13'),auth['isAuthenticated'](),controller[_0x558f('0x14')]);router[_0x558f('0x15')](_0x558f('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x558f('0x16')]=router;
\ No newline at end of file
index ef4ba5b..a561b2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8ab=['exports','STRING','sequelize'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xb8ab,0x107));var _0xbb8a=function(_0x1a04c6,_0xcd252f){_0x1a04c6=_0x1a04c6-0x0;var _0x3727e2=_0xb8ab[_0x1a04c6];return _0x3727e2;};'use strict';var Sequelize=require(_0xbb8a('0x0'));module[_0xbb8a('0x1')]={'name':{'type':Sequelize[_0xbb8a('0x2')]},'description':{'type':Sequelize[_0xbb8a('0x2')]}};
\ No newline at end of file
+var _0xde64=['STRING','sequelize'];(function(_0x22f327,_0x43035f){var _0x2c42f0=function(_0x21c8fc){while(--_0x21c8fc){_0x22f327['push'](_0x22f327['shift']());}};_0x2c42f0(++_0x43035f);}(_0xde64,0xbf));var _0x4de6=function(_0x1a9425,_0x1e6c1b){_0x1a9425=_0x1a9425-0x0;var _0x44023d=_0xde64[_0x1a9425];return _0x44023d;};'use strict';var Sequelize=require(_0x4de6('0x0'));module['exports']={'name':{'type':Sequelize[_0x4de6('0x1')]},'description':{'type':Sequelize[_0x4de6('0x1')]}};
\ No newline at end of file
index 3232847..b1a7f22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b5c=['getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','end','offset','undefined','limit','count','status','set','apply','reject','save','update','then','stack','name','send','FreshdeskConfiguration','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','catch','params','keys','includeAll','include','find','create','body','destroy','getFields','findOne','FreshdeskField'];(function(_0x3135ce,_0x1ee0a1){var _0x40add1=function(_0x13217d){while(--_0x13217d){_0x3135ce['push'](_0x3135ce['shift']());}};_0x40add1(++_0x1ee0a1);}(_0x4b5c,0xf6));var _0xc4b5=function(_0x230a35,_0x479ac3){_0x230a35=_0x230a35-0x0;var _0x355391=_0x4b5c[_0x230a35];return _0x355391;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc4b5('0x0'));var zipdir=require(_0xc4b5('0x1'));var jsonpatch=require(_0xc4b5('0x2'));var rp=require(_0xc4b5('0x3'));var moment=require(_0xc4b5('0x4'));var BPromise=require(_0xc4b5('0x5'));var Mustache=require(_0xc4b5('0x6'));var util=require(_0xc4b5('0x7'));var path=require(_0xc4b5('0x8'));var sox=require(_0xc4b5('0x9'));var csv=require(_0xc4b5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc4b5('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc4b5('0xc'));var jsforce=require(_0xc4b5('0xd'));var deskjs=require(_0xc4b5('0xe'));var toCsv=require(_0xc4b5('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc4b5('0xf'));var authService=require(_0xc4b5('0x10'));var qs=require(_0xc4b5('0x11'));var as=require(_0xc4b5('0x12'));var hardwareService=require(_0xc4b5('0x13'));var logger=require(_0xc4b5('0x14'))(_0xc4b5('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc4b5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5de52a,_0x25951b){_0x25951b=_0x25951b||0xcc;return function(_0x49c922){if(_0x49c922){return _0x5de52a[_0xc4b5('0x17')](_0x25951b);}return _0x5de52a['status'](_0x25951b)[_0xc4b5('0x18')]();};}function respondWithResult(_0x265170,_0x20f60d){_0x20f60d=_0x20f60d||0xc8;return function(_0xa96cea){if(_0xa96cea){return _0x265170['status'](_0x20f60d)['json'](_0xa96cea);}};}function respondWithFilteredResult(_0x3e62e2,_0x10387d){return function(_0x39acdc){if(_0x39acdc){var _0xc23cf9=typeof _0x10387d[_0xc4b5('0x19')]===_0xc4b5('0x1a')&&typeof _0x10387d[_0xc4b5('0x1b')]===_0xc4b5('0x1a');var _0x34810b=_0x39acdc[_0xc4b5('0x1c')];var _0x1e3f86=_0xc23cf9?0x0:_0x10387d[_0xc4b5('0x19')];var _0x28586b=_0xc23cf9?_0x39acdc[_0xc4b5('0x1c')]:_0x10387d[_0xc4b5('0x19')]+_0x10387d['limit'];var _0x5aeeb3;if(_0x28586b>=_0x34810b){_0x28586b=_0x34810b;_0x5aeeb3=0xc8;}else{_0x5aeeb3=0xce;}_0x3e62e2[_0xc4b5('0x1d')](_0x5aeeb3);return _0x3e62e2[_0xc4b5('0x1e')]('Content-Range',_0x1e3f86+'-'+_0x28586b+'/'+_0x34810b)['json'](_0x39acdc);}return null;};}function patchUpdates(_0x508ebe){return function(_0xab0ffa){try{jsonpatch[_0xc4b5('0x1f')](_0xab0ffa,_0x508ebe,!![]);}catch(_0xf497c5){return BPromise[_0xc4b5('0x20')](_0xf497c5);}return _0xab0ffa[_0xc4b5('0x21')]();};}function saveUpdates(_0x34ceb9,_0xb1d588){return function(_0x3b3be0){if(_0x3b3be0){return _0x3b3be0[_0xc4b5('0x22')](_0x34ceb9)[_0xc4b5('0x23')](function(_0x5eaefe){return _0x5eaefe;});}return null;};}function removeEntity(_0x2f3f33,_0xfe90f1){return function(_0x545e1a){if(_0x545e1a){return _0x545e1a['destroy']()[_0xc4b5('0x23')](function(){_0x2f3f33[_0xc4b5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2927a6,_0x3a29f8){return function(_0x3816a5){if(!_0x3816a5){_0x2927a6[_0xc4b5('0x17')](0x194);}return _0x3816a5;};}function handleError(_0x1511e4,_0x3a49b8){_0x3a49b8=_0x3a49b8||0x1f4;return function(_0x103ed6){logger['error'](_0x103ed6[_0xc4b5('0x24')]);if(_0x103ed6['name']){delete _0x103ed6[_0xc4b5('0x25')];}_0x1511e4[_0xc4b5('0x1d')](_0x3a49b8)[_0xc4b5('0x26')](_0x103ed6);};}exports['index']=function(_0x30149a,_0x3f4a86){var _0x3c23a9={},_0x44ad5c={},_0x470dd1={'count':0x0,'rows':[]};var _0x1542ed=_['map'](db[_0xc4b5('0x27')][_0xc4b5('0x28')],function(_0x461f6e){return{'name':_0x461f6e[_0xc4b5('0x29')],'type':_0x461f6e[_0xc4b5('0x2a')]['key']};});_0x44ad5c[_0xc4b5('0x2b')]=_[_0xc4b5('0x2c')](_0x1542ed,_0xc4b5('0x25'));_0x44ad5c['query']=_['keys'](_0x30149a[_0xc4b5('0x2d')]);_0x44ad5c[_0xc4b5('0x2e')]=_[_0xc4b5('0x2f')](_0x44ad5c[_0xc4b5('0x2b')],_0x44ad5c[_0xc4b5('0x2d')]);_0x3c23a9['attributes']=_[_0xc4b5('0x2f')](_0x44ad5c[_0xc4b5('0x2b')],qs[_0xc4b5('0x30')](_0x30149a['query'][_0xc4b5('0x30')]));_0x3c23a9['attributes']=_0x3c23a9[_0xc4b5('0x31')][_0xc4b5('0x32')]?_0x3c23a9[_0xc4b5('0x31')]:_0x44ad5c[_0xc4b5('0x2b')];if(!_0x30149a[_0xc4b5('0x2d')][_0xc4b5('0x33')](_0xc4b5('0x34'))){_0x3c23a9[_0xc4b5('0x1b')]=qs[_0xc4b5('0x1b')](_0x30149a[_0xc4b5('0x2d')]['limit']);_0x3c23a9[_0xc4b5('0x19')]=qs[_0xc4b5('0x19')](_0x30149a[_0xc4b5('0x2d')]['offset']);}_0x3c23a9[_0xc4b5('0x35')]=qs[_0xc4b5('0x36')](_0x30149a[_0xc4b5('0x2d')][_0xc4b5('0x36')]);_0x3c23a9[_0xc4b5('0x37')]=qs[_0xc4b5('0x2e')](_[_0xc4b5('0x38')](_0x30149a[_0xc4b5('0x2d')],_0x44ad5c['filters']),_0x1542ed);if(_0x30149a[_0xc4b5('0x2d')][_0xc4b5('0x39')]){_0x3c23a9[_0xc4b5('0x37')]=_['merge'](_0x3c23a9[_0xc4b5('0x37')],{'$or':_['map'](_0x1542ed,function(_0x2e6526){if(_0x2e6526[_0xc4b5('0x2a')]!==_0xc4b5('0x3a')){var _0x1f9c58={};_0x1f9c58[_0x2e6526[_0xc4b5('0x25')]]={'$like':'%'+_0x30149a[_0xc4b5('0x2d')]['filter']+'%'};return _0x1f9c58;}})});}_0x3c23a9=_[_0xc4b5('0x3b')]({},_0x3c23a9,_0x30149a[_0xc4b5('0x3c')]);var _0x44e560={'where':_0x3c23a9[_0xc4b5('0x37')]};return db['FreshdeskConfiguration'][_0xc4b5('0x1c')](_0x44e560)['then'](function(_0x1ddd3a){_0x470dd1['count']=_0x1ddd3a;if(_0x30149a[_0xc4b5('0x2d')]['includeAll']){_0x3c23a9['include']=[{'all':!![]}];}return db[_0xc4b5('0x27')][_0xc4b5('0x3d')](_0x3c23a9);})[_0xc4b5('0x23')](function(_0x2987c0){_0x470dd1['rows']=_0x2987c0;return _0x470dd1;})['then'](respondWithFilteredResult(_0x3f4a86,_0x3c23a9))[_0xc4b5('0x3e')](handleError(_0x3f4a86,null));};exports['show']=function(_0x5dfadc,_0x3a7cca){var _0x45fd76={'raw':![],'where':{'id':_0x5dfadc[_0xc4b5('0x3f')]['id']}},_0xaa2b17={};_0xaa2b17[_0xc4b5('0x2b')]=_[_0xc4b5('0x40')](db['FreshdeskConfiguration'][_0xc4b5('0x28')]);_0xaa2b17[_0xc4b5('0x2d')]=_[_0xc4b5('0x40')](_0x5dfadc[_0xc4b5('0x2d')]);_0xaa2b17[_0xc4b5('0x2e')]=_[_0xc4b5('0x2f')](_0xaa2b17[_0xc4b5('0x2b')],_0xaa2b17['query']);_0x45fd76[_0xc4b5('0x31')]=_[_0xc4b5('0x2f')](_0xaa2b17['model'],qs['fields'](_0x5dfadc[_0xc4b5('0x2d')][_0xc4b5('0x30')]));_0x45fd76[_0xc4b5('0x31')]=_0x45fd76[_0xc4b5('0x31')]['length']?_0x45fd76[_0xc4b5('0x31')]:_0xaa2b17['model'];if(_0x5dfadc[_0xc4b5('0x2d')][_0xc4b5('0x41')]){_0x45fd76[_0xc4b5('0x42')]=[{'all':!![]}];}_0x45fd76=_[_0xc4b5('0x3b')]({},_0x45fd76,_0x5dfadc[_0xc4b5('0x3c')]);return db[_0xc4b5('0x27')][_0xc4b5('0x43')](_0x45fd76)[_0xc4b5('0x23')](handleEntityNotFound(_0x3a7cca,null))[_0xc4b5('0x23')](respondWithResult(_0x3a7cca,null))[_0xc4b5('0x3e')](handleError(_0x3a7cca,null));};exports[_0xc4b5('0x44')]=function(_0x3dab07,_0x30981e){return db['FreshdeskConfiguration'][_0xc4b5('0x44')](_0x3dab07[_0xc4b5('0x45')],{})[_0xc4b5('0x23')](respondWithResult(_0x30981e,0xc9))['catch'](handleError(_0x30981e,null));};exports[_0xc4b5('0x22')]=function(_0x3d1285,_0xeef771){if(_0x3d1285[_0xc4b5('0x45')]['id']){delete _0x3d1285[_0xc4b5('0x45')]['id'];}return db['FreshdeskConfiguration'][_0xc4b5('0x43')]({'where':{'id':_0x3d1285[_0xc4b5('0x3f')]['id']}})['then'](handleEntityNotFound(_0xeef771,null))[_0xc4b5('0x23')](saveUpdates(_0x3d1285[_0xc4b5('0x45')],null))['then'](respondWithResult(_0xeef771,null))[_0xc4b5('0x3e')](handleError(_0xeef771,null));};exports[_0xc4b5('0x46')]=function(_0x234978,_0xbd87b){return db['FreshdeskConfiguration'][_0xc4b5('0x43')]({'where':{'id':_0x234978[_0xc4b5('0x3f')]['id']}})[_0xc4b5('0x23')](handleEntityNotFound(_0xbd87b,null))[_0xc4b5('0x23')](removeEntity(_0xbd87b,null))[_0xc4b5('0x3e')](handleError(_0xbd87b,null));};exports[_0xc4b5('0x47')]=function(_0x53d4a0,_0x4ad4de,_0x76b213){var _0x354da3={};var _0x422a09={};var _0x1c659c;var _0x311fc5;return db[_0xc4b5('0x27')][_0xc4b5('0x48')]({'where':{'id':_0x53d4a0[_0xc4b5('0x3f')]['id']}})[_0xc4b5('0x23')](handleEntityNotFound(_0x4ad4de,null))[_0xc4b5('0x23')](function(_0x55b778){if(_0x55b778){_0x1c659c=_0x55b778;_0x422a09[_0xc4b5('0x2b')]=_[_0xc4b5('0x40')](db[_0xc4b5('0x49')]['rawAttributes']);_0x422a09[_0xc4b5('0x2d')]=_['keys'](_0x53d4a0[_0xc4b5('0x2d')]);_0x422a09[_0xc4b5('0x2e')]=_[_0xc4b5('0x2f')](_0x422a09['model'],_0x422a09[_0xc4b5('0x2d')]);_0x354da3['attributes']=_['intersection'](_0x422a09[_0xc4b5('0x2b')],qs[_0xc4b5('0x30')](_0x53d4a0[_0xc4b5('0x2d')][_0xc4b5('0x30')]));_0x354da3[_0xc4b5('0x31')]=_0x354da3[_0xc4b5('0x31')][_0xc4b5('0x32')]?_0x354da3[_0xc4b5('0x31')]:_0x422a09[_0xc4b5('0x2b')];_0x354da3['order']=qs[_0xc4b5('0x36')](_0x53d4a0[_0xc4b5('0x2d')]['sort']);_0x354da3[_0xc4b5('0x37')]=qs[_0xc4b5('0x2e')](_[_0xc4b5('0x38')](_0x53d4a0[_0xc4b5('0x2d')],_0x422a09[_0xc4b5('0x2e')]));if(_0x53d4a0[_0xc4b5('0x2d')][_0xc4b5('0x39')]){_0x354da3['where']=_[_0xc4b5('0x3b')](_0x354da3[_0xc4b5('0x37')],{'$or':_[_0xc4b5('0x2c')](_0x354da3['attributes'],function(_0x22dc19){var _0x55865a={};_0x55865a[_0x22dc19]={'$like':'%'+_0x53d4a0[_0xc4b5('0x2d')][_0xc4b5('0x39')]+'%'};return _0x55865a;})});}_0x354da3=_[_0xc4b5('0x3b')]({},_0x354da3,_0x53d4a0[_0xc4b5('0x3c')]);return _0x1c659c[_0xc4b5('0x47')](_0x354da3);}})[_0xc4b5('0x23')](function(_0x55f85b){if(_0x55f85b){_0x311fc5=_0x55f85b['length'];if(!_0x53d4a0[_0xc4b5('0x2d')][_0xc4b5('0x33')](_0xc4b5('0x34'))){_0x354da3[_0xc4b5('0x1b')]=qs[_0xc4b5('0x1b')](_0x53d4a0[_0xc4b5('0x2d')][_0xc4b5('0x1b')]);_0x354da3[_0xc4b5('0x19')]=qs[_0xc4b5('0x19')](_0x53d4a0[_0xc4b5('0x2d')][_0xc4b5('0x19')]);}return _0x1c659c[_0xc4b5('0x47')](_0x354da3);}})[_0xc4b5('0x23')](function(_0x33671d){if(_0x33671d){return _0x33671d?{'count':_0x311fc5,'rows':_0x33671d}:null;}})[_0xc4b5('0x23')](respondWithResult(_0x4ad4de,null))[_0xc4b5('0x3e')](handleError(_0x4ad4de,null));};exports['getSubjects']=function(_0x5de6b6,_0xcfea7c,_0x270dca){var _0x2ee375={};var _0x228883={};var _0x4901bc;var _0x253d9b;return db['FreshdeskConfiguration'][_0xc4b5('0x48')]({'where':{'id':_0x5de6b6[_0xc4b5('0x3f')]['id']}})[_0xc4b5('0x23')](handleEntityNotFound(_0xcfea7c,null))[_0xc4b5('0x23')](function(_0x11df77){if(_0x11df77){_0x4901bc=_0x11df77;_0x228883['model']=_[_0xc4b5('0x40')](db[_0xc4b5('0x49')][_0xc4b5('0x28')]);_0x228883[_0xc4b5('0x2d')]=_[_0xc4b5('0x40')](_0x5de6b6['query']);_0x228883['filters']=_[_0xc4b5('0x2f')](_0x228883[_0xc4b5('0x2b')],_0x228883[_0xc4b5('0x2d')]);_0x2ee375[_0xc4b5('0x31')]=_['intersection'](_0x228883[_0xc4b5('0x2b')],qs[_0xc4b5('0x30')](_0x5de6b6['query'][_0xc4b5('0x30')]));_0x2ee375[_0xc4b5('0x31')]=_0x2ee375[_0xc4b5('0x31')][_0xc4b5('0x32')]?_0x2ee375['attributes']:_0x228883[_0xc4b5('0x2b')];_0x2ee375[_0xc4b5('0x35')]=qs[_0xc4b5('0x36')](_0x5de6b6[_0xc4b5('0x2d')][_0xc4b5('0x36')]);_0x2ee375[_0xc4b5('0x37')]=qs[_0xc4b5('0x2e')](_[_0xc4b5('0x38')](_0x5de6b6['query'],_0x228883[_0xc4b5('0x2e')]));if(_0x5de6b6[_0xc4b5('0x2d')]['filter']){_0x2ee375[_0xc4b5('0x37')]=_[_0xc4b5('0x3b')](_0x2ee375[_0xc4b5('0x37')],{'$or':_[_0xc4b5('0x2c')](_0x2ee375[_0xc4b5('0x31')],function(_0x3b8039){var _0x396b1f={};_0x396b1f[_0x3b8039]={'$like':'%'+_0x5de6b6[_0xc4b5('0x2d')][_0xc4b5('0x39')]+'%'};return _0x396b1f;})});}_0x2ee375=_[_0xc4b5('0x3b')]({},_0x2ee375,_0x5de6b6[_0xc4b5('0x3c')]);return _0x4901bc[_0xc4b5('0x4a')](_0x2ee375);}})[_0xc4b5('0x23')](function(_0x1d6e51){if(_0x1d6e51){_0x253d9b=_0x1d6e51[_0xc4b5('0x32')];if(!_0x5de6b6[_0xc4b5('0x2d')][_0xc4b5('0x33')](_0xc4b5('0x34'))){_0x2ee375['limit']=qs[_0xc4b5('0x1b')](_0x5de6b6[_0xc4b5('0x2d')][_0xc4b5('0x1b')]);_0x2ee375['offset']=qs[_0xc4b5('0x19')](_0x5de6b6[_0xc4b5('0x2d')][_0xc4b5('0x19')]);}return _0x4901bc[_0xc4b5('0x4a')](_0x2ee375);}})['then'](function(_0x1c36b0){if(_0x1c36b0){return _0x1c36b0?{'count':_0x253d9b,'rows':_0x1c36b0}:null;}})[_0xc4b5('0x23')](respondWithResult(_0xcfea7c,null))[_0xc4b5('0x3e')](handleError(_0xcfea7c,null));};exports['getDescriptions']=function(_0x1fbd33,_0x130faf,_0x55dca3){var _0x4ac6da={};var _0x214109={};var _0x3e3f4e;var _0x3b574f;return db[_0xc4b5('0x27')][_0xc4b5('0x48')]({'where':{'id':_0x1fbd33['params']['id']}})[_0xc4b5('0x23')](handleEntityNotFound(_0x130faf,null))[_0xc4b5('0x23')](function(_0xb67e20){if(_0xb67e20){_0x3e3f4e=_0xb67e20;_0x214109['model']=_[_0xc4b5('0x40')](db['FreshdeskField'][_0xc4b5('0x28')]);_0x214109['query']=_[_0xc4b5('0x40')](_0x1fbd33['query']);_0x214109['filters']=_[_0xc4b5('0x2f')](_0x214109['model'],_0x214109[_0xc4b5('0x2d')]);_0x4ac6da[_0xc4b5('0x31')]=_['intersection'](_0x214109[_0xc4b5('0x2b')],qs['fields'](_0x1fbd33[_0xc4b5('0x2d')][_0xc4b5('0x30')]));_0x4ac6da[_0xc4b5('0x31')]=_0x4ac6da['attributes'][_0xc4b5('0x32')]?_0x4ac6da[_0xc4b5('0x31')]:_0x214109[_0xc4b5('0x2b')];_0x4ac6da[_0xc4b5('0x35')]=qs[_0xc4b5('0x36')](_0x1fbd33['query']['sort']);_0x4ac6da['where']=qs[_0xc4b5('0x2e')](_[_0xc4b5('0x38')](_0x1fbd33[_0xc4b5('0x2d')],_0x214109[_0xc4b5('0x2e')]));if(_0x1fbd33[_0xc4b5('0x2d')][_0xc4b5('0x39')]){_0x4ac6da[_0xc4b5('0x37')]=_[_0xc4b5('0x3b')](_0x4ac6da[_0xc4b5('0x37')],{'$or':_[_0xc4b5('0x2c')](_0x4ac6da[_0xc4b5('0x31')],function(_0x39d41b){var _0x132c70={};_0x132c70[_0x39d41b]={'$like':'%'+_0x1fbd33[_0xc4b5('0x2d')][_0xc4b5('0x39')]+'%'};return _0x132c70;})});}_0x4ac6da=_['merge']({},_0x4ac6da,_0x1fbd33[_0xc4b5('0x3c')]);return _0x3e3f4e[_0xc4b5('0x4b')](_0x4ac6da);}})[_0xc4b5('0x23')](function(_0x23bbc1){if(_0x23bbc1){_0x3b574f=_0x23bbc1[_0xc4b5('0x32')];if(!_0x1fbd33[_0xc4b5('0x2d')][_0xc4b5('0x33')](_0xc4b5('0x34'))){_0x4ac6da[_0xc4b5('0x1b')]=qs[_0xc4b5('0x1b')](_0x1fbd33[_0xc4b5('0x2d')][_0xc4b5('0x1b')]);_0x4ac6da[_0xc4b5('0x19')]=qs[_0xc4b5('0x19')](_0x1fbd33[_0xc4b5('0x2d')][_0xc4b5('0x19')]);}return _0x3e3f4e['getDescriptions'](_0x4ac6da);}})[_0xc4b5('0x23')](function(_0xf9830a){if(_0xf9830a){return _0xf9830a?{'count':_0x3b574f,'rows':_0xf9830a}:null;}})[_0xc4b5('0x23')](respondWithResult(_0x130faf,null))[_0xc4b5('0x3e')](handleError(_0x130faf,null));};exports[_0xc4b5('0x4c')]=function(_0x1233a0,_0x1177c9,_0x8234c4){var _0x2f6a97={};var _0x138521={};var _0x524d5a;var _0x126f1f;return db[_0xc4b5('0x27')]['findOne']({'where':{'id':_0x1233a0[_0xc4b5('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1177c9,null))[_0xc4b5('0x23')](function(_0x52cfdd){if(_0x52cfdd){_0x524d5a=_0x52cfdd;_0x138521[_0xc4b5('0x2b')]=_[_0xc4b5('0x40')](db[_0xc4b5('0x4d')][_0xc4b5('0x28')]);_0x138521[_0xc4b5('0x2d')]=_[_0xc4b5('0x40')](_0x1233a0[_0xc4b5('0x2d')]);_0x138521['filters']=_[_0xc4b5('0x2f')](_0x138521[_0xc4b5('0x2b')],_0x138521[_0xc4b5('0x2d')]);_0x2f6a97[_0xc4b5('0x31')]=_[_0xc4b5('0x2f')](_0x138521[_0xc4b5('0x2b')],qs[_0xc4b5('0x30')](_0x1233a0[_0xc4b5('0x2d')][_0xc4b5('0x30')]));_0x2f6a97[_0xc4b5('0x31')]=_0x2f6a97[_0xc4b5('0x31')][_0xc4b5('0x32')]?_0x2f6a97['attributes']:_0x138521[_0xc4b5('0x2b')];_0x2f6a97[_0xc4b5('0x35')]=qs[_0xc4b5('0x36')](_0x1233a0[_0xc4b5('0x2d')]['sort']);_0x2f6a97['where']=qs[_0xc4b5('0x2e')](_['pick'](_0x1233a0[_0xc4b5('0x2d')],_0x138521[_0xc4b5('0x2e')]));if(_0x1233a0[_0xc4b5('0x2d')][_0xc4b5('0x39')]){_0x2f6a97[_0xc4b5('0x37')]=_['merge'](_0x2f6a97[_0xc4b5('0x37')],{'$or':_[_0xc4b5('0x2c')](_0x2f6a97['attributes'],function(_0x132561){var _0x503a65={};_0x503a65[_0x132561]={'$like':'%'+_0x1233a0[_0xc4b5('0x2d')]['filter']+'%'};return _0x503a65;})});}_0x2f6a97=_[_0xc4b5('0x3b')]({},_0x2f6a97,_0x1233a0['options']);return _0x524d5a[_0xc4b5('0x4c')](_0x2f6a97);}})[_0xc4b5('0x23')](function(_0x4aff29){if(_0x4aff29){_0x126f1f=_0x4aff29[_0xc4b5('0x32')];if(!_0x1233a0[_0xc4b5('0x2d')][_0xc4b5('0x33')](_0xc4b5('0x34'))){_0x2f6a97['limit']=qs[_0xc4b5('0x1b')](_0x1233a0[_0xc4b5('0x2d')]['limit']);_0x2f6a97[_0xc4b5('0x19')]=qs[_0xc4b5('0x19')](_0x1233a0[_0xc4b5('0x2d')][_0xc4b5('0x19')]);}return _0x524d5a[_0xc4b5('0x4c')](_0x2f6a97);}})['then'](function(_0x5a1972){if(_0x5a1972){return _0x5a1972?{'count':_0x126f1f,'rows':_0x5a1972}:null;}})[_0xc4b5('0x23')](respondWithResult(_0x1177c9,null))[_0xc4b5('0x3e')](handleError(_0x1177c9,null));};exports[_0xc4b5('0x4e')]=function(_0x36bfb1,_0x28db54,_0x5e040d){if(_0x36bfb1['body']['id']){delete _0x36bfb1[_0xc4b5('0x45')]['id'];}return db[_0xc4b5('0x27')]['findOne']({'where':{'id':_0x36bfb1[_0xc4b5('0x3f')]['id']}})[_0xc4b5('0x23')](handleEntityNotFound(_0x28db54,null))[_0xc4b5('0x23')](function(_0x540e97){if(_0x540e97){return _0x540e97[_0xc4b5('0x4e')](_0x36bfb1[_0xc4b5('0x45')][_0xc4b5('0x4f')]||[]);}return null;})[_0xc4b5('0x23')](respondWithResult(_0x28db54,null))[_0xc4b5('0x3e')](handleError(_0x28db54,null));};
\ No newline at end of file
+var _0xb02c=['key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','include','findAll','catch','show','params','length','includeAll','find','create','body','getFields','FreshdeskField','order','hasOwnProperty','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','map','FreshdeskConfiguration','rawAttributes','fieldName','type'];(function(_0x22eb5d,_0x2e519d){var _0x4a39ad=function(_0x4a1206){while(--_0x4a1206){_0x22eb5d['push'](_0x22eb5d['shift']());}};_0x4a39ad(++_0x2e519d);}(_0xb02c,0x126));var _0xcb02=function(_0x3f58db,_0x3af061){_0x3f58db=_0x3f58db-0x0;var _0x2221f3=_0xb02c[_0x3f58db];return _0x2221f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcb02('0x0'));var zipdir=require(_0xcb02('0x1'));var jsonpatch=require(_0xcb02('0x2'));var rp=require(_0xcb02('0x3'));var moment=require(_0xcb02('0x4'));var BPromise=require(_0xcb02('0x5'));var Mustache=require(_0xcb02('0x6'));var util=require(_0xcb02('0x7'));var path=require(_0xcb02('0x8'));var sox=require(_0xcb02('0x9'));var csv=require(_0xcb02('0xa'));var ejs=require(_0xcb02('0xb'));var fs=require('fs');var fs_extra=require(_0xcb02('0xc'));var _=require(_0xcb02('0xd'));var squel=require(_0xcb02('0xe'));var crypto=require('crypto');var jsforce=require(_0xcb02('0xf'));var deskjs=require(_0xcb02('0x10'));var toCsv=require(_0xcb02('0xa'));var querystring=require(_0xcb02('0x11'));var Papa=require(_0xcb02('0x12'));var Redis=require(_0xcb02('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xcb02('0x14'));var as=require(_0xcb02('0x15'));var hardwareService=require(_0xcb02('0x16'));var logger=require(_0xcb02('0x17'))(_0xcb02('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcb02('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cf0ef,_0x2ce970){_0x2ce970=_0x2ce970||0xcc;return function(_0x14b15a){if(_0x14b15a){return _0x3cf0ef[_0xcb02('0x1a')](_0x2ce970);}return _0x3cf0ef[_0xcb02('0x1b')](_0x2ce970)[_0xcb02('0x1c')]();};}function respondWithResult(_0x5228d6,_0x11e335){_0x11e335=_0x11e335||0xc8;return function(_0x588a19){if(_0x588a19){return _0x5228d6[_0xcb02('0x1b')](_0x11e335)[_0xcb02('0x1d')](_0x588a19);}};}function respondWithFilteredResult(_0x21c019,_0x5416f6){return function(_0x3f2d6c){if(_0x3f2d6c){var _0x57a1be=typeof _0x5416f6[_0xcb02('0x1e')]===_0xcb02('0x1f')&&typeof _0x5416f6[_0xcb02('0x20')]==='undefined';var _0x31aabe=_0x3f2d6c['count'];var _0x2c258a=_0x57a1be?0x0:_0x5416f6[_0xcb02('0x1e')];var _0x292143=_0x57a1be?_0x3f2d6c[_0xcb02('0x21')]:_0x5416f6[_0xcb02('0x1e')]+_0x5416f6[_0xcb02('0x20')];var _0x50feed;if(_0x292143>=_0x31aabe){_0x292143=_0x31aabe;_0x50feed=0xc8;}else{_0x50feed=0xce;}_0x21c019[_0xcb02('0x1b')](_0x50feed);return _0x21c019[_0xcb02('0x22')](_0xcb02('0x23'),_0x2c258a+'-'+_0x292143+'/'+_0x31aabe)[_0xcb02('0x1d')](_0x3f2d6c);}return null;};}function patchUpdates(_0x35452f){return function(_0x2cddc0){try{jsonpatch[_0xcb02('0x24')](_0x2cddc0,_0x35452f,!![]);}catch(_0x5a5402){return BPromise['reject'](_0x5a5402);}return _0x2cddc0[_0xcb02('0x25')]();};}function saveUpdates(_0x519961,_0x2cd556){return function(_0x395aa0){if(_0x395aa0){return _0x395aa0[_0xcb02('0x26')](_0x519961)['then'](function(_0x253979){return _0x253979;});}return null;};}function removeEntity(_0x17e51e,_0x34cd4a){return function(_0x474fab){if(_0x474fab){return _0x474fab[_0xcb02('0x27')]()[_0xcb02('0x28')](function(){_0x17e51e[_0xcb02('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x559341,_0x26383b){return function(_0x52bba6){if(!_0x52bba6){_0x559341[_0xcb02('0x1a')](0x194);}return _0x52bba6;};}function handleError(_0x54e6fb,_0x5b8509){_0x5b8509=_0x5b8509||0x1f4;return function(_0x5990f7){logger[_0xcb02('0x29')](_0x5990f7[_0xcb02('0x2a')]);if(_0x5990f7[_0xcb02('0x2b')]){delete _0x5990f7[_0xcb02('0x2b')];}_0x54e6fb[_0xcb02('0x1b')](_0x5b8509)[_0xcb02('0x2c')](_0x5990f7);};}exports['index']=function(_0x568920,_0x51a162){var _0x2d178e={},_0x2168f9={},_0x138428={'count':0x0,'rows':[]};var _0x1f98c6=_[_0xcb02('0x2d')](db[_0xcb02('0x2e')][_0xcb02('0x2f')],function(_0x44ccdf){return{'name':_0x44ccdf[_0xcb02('0x30')],'type':_0x44ccdf[_0xcb02('0x31')][_0xcb02('0x32')]};});_0x2168f9[_0xcb02('0x33')]=_['map'](_0x1f98c6,_0xcb02('0x2b'));_0x2168f9[_0xcb02('0x34')]=_[_0xcb02('0x35')](_0x568920[_0xcb02('0x34')]);_0x2168f9[_0xcb02('0x36')]=_['intersection'](_0x2168f9[_0xcb02('0x33')],_0x2168f9['query']);_0x2d178e[_0xcb02('0x37')]=_[_0xcb02('0x38')](_0x2168f9[_0xcb02('0x33')],qs[_0xcb02('0x39')](_0x568920[_0xcb02('0x34')][_0xcb02('0x39')]));_0x2d178e['attributes']=_0x2d178e[_0xcb02('0x37')]['length']?_0x2d178e['attributes']:_0x2168f9[_0xcb02('0x33')];if(!_0x568920[_0xcb02('0x34')]['hasOwnProperty'](_0xcb02('0x3a'))){_0x2d178e[_0xcb02('0x20')]=qs[_0xcb02('0x20')](_0x568920[_0xcb02('0x34')][_0xcb02('0x20')]);_0x2d178e[_0xcb02('0x1e')]=qs[_0xcb02('0x1e')](_0x568920['query'][_0xcb02('0x1e')]);}_0x2d178e['order']=qs[_0xcb02('0x3b')](_0x568920[_0xcb02('0x34')][_0xcb02('0x3b')]);_0x2d178e[_0xcb02('0x3c')]=qs[_0xcb02('0x36')](_[_0xcb02('0x3d')](_0x568920[_0xcb02('0x34')],_0x2168f9[_0xcb02('0x36')]),_0x1f98c6);if(_0x568920['query']['filter']){_0x2d178e[_0xcb02('0x3c')]=_['merge'](_0x2d178e[_0xcb02('0x3c')],{'$or':_[_0xcb02('0x2d')](_0x1f98c6,function(_0x4f587f){if(_0x4f587f[_0xcb02('0x31')]!==_0xcb02('0x3e')){var _0x56e2b8={};_0x56e2b8[_0x4f587f[_0xcb02('0x2b')]]={'$like':'%'+_0x568920[_0xcb02('0x34')][_0xcb02('0x3f')]+'%'};return _0x56e2b8;}})});}_0x2d178e=_[_0xcb02('0x40')]({},_0x2d178e,_0x568920[_0xcb02('0x41')]);var _0x2f142f={'where':_0x2d178e[_0xcb02('0x3c')]};return db[_0xcb02('0x2e')]['count'](_0x2f142f)[_0xcb02('0x28')](function(_0x2318c9){_0x138428['count']=_0x2318c9;if(_0x568920[_0xcb02('0x34')]['includeAll']){_0x2d178e[_0xcb02('0x42')]=[{'all':!![]}];}return db[_0xcb02('0x2e')][_0xcb02('0x43')](_0x2d178e);})[_0xcb02('0x28')](function(_0xad1e11){_0x138428['rows']=_0xad1e11;return _0x138428;})[_0xcb02('0x28')](respondWithFilteredResult(_0x51a162,_0x2d178e))[_0xcb02('0x44')](handleError(_0x51a162,null));};exports[_0xcb02('0x45')]=function(_0x77fe16,_0x114e3a){var _0x353283={'raw':![],'where':{'id':_0x77fe16[_0xcb02('0x46')]['id']}},_0x4ddaaa={};_0x4ddaaa[_0xcb02('0x33')]=_[_0xcb02('0x35')](db[_0xcb02('0x2e')][_0xcb02('0x2f')]);_0x4ddaaa[_0xcb02('0x34')]=_[_0xcb02('0x35')](_0x77fe16[_0xcb02('0x34')]);_0x4ddaaa['filters']=_[_0xcb02('0x38')](_0x4ddaaa[_0xcb02('0x33')],_0x4ddaaa[_0xcb02('0x34')]);_0x353283[_0xcb02('0x37')]=_[_0xcb02('0x38')](_0x4ddaaa[_0xcb02('0x33')],qs[_0xcb02('0x39')](_0x77fe16['query'][_0xcb02('0x39')]));_0x353283['attributes']=_0x353283['attributes'][_0xcb02('0x47')]?_0x353283[_0xcb02('0x37')]:_0x4ddaaa[_0xcb02('0x33')];if(_0x77fe16[_0xcb02('0x34')][_0xcb02('0x48')]){_0x353283[_0xcb02('0x42')]=[{'all':!![]}];}_0x353283=_[_0xcb02('0x40')]({},_0x353283,_0x77fe16['options']);return db['FreshdeskConfiguration'][_0xcb02('0x49')](_0x353283)[_0xcb02('0x28')](handleEntityNotFound(_0x114e3a,null))[_0xcb02('0x28')](respondWithResult(_0x114e3a,null))['catch'](handleError(_0x114e3a,null));};exports[_0xcb02('0x4a')]=function(_0x528f8f,_0x4f88cd){return db['FreshdeskConfiguration']['create'](_0x528f8f[_0xcb02('0x4b')],{})[_0xcb02('0x28')](respondWithResult(_0x4f88cd,0xc9))[_0xcb02('0x44')](handleError(_0x4f88cd,null));};exports[_0xcb02('0x26')]=function(_0x1c4b5a,_0x94fa63){if(_0x1c4b5a['body']['id']){delete _0x1c4b5a[_0xcb02('0x4b')]['id'];}return db[_0xcb02('0x2e')][_0xcb02('0x49')]({'where':{'id':_0x1c4b5a[_0xcb02('0x46')]['id']}})[_0xcb02('0x28')](handleEntityNotFound(_0x94fa63,null))[_0xcb02('0x28')](saveUpdates(_0x1c4b5a['body'],null))['then'](respondWithResult(_0x94fa63,null))[_0xcb02('0x44')](handleError(_0x94fa63,null));};exports[_0xcb02('0x27')]=function(_0x4e020d,_0x4e7d66){return db[_0xcb02('0x2e')][_0xcb02('0x49')]({'where':{'id':_0x4e020d[_0xcb02('0x46')]['id']}})[_0xcb02('0x28')](handleEntityNotFound(_0x4e7d66,null))[_0xcb02('0x28')](removeEntity(_0x4e7d66,null))[_0xcb02('0x44')](handleError(_0x4e7d66,null));};exports[_0xcb02('0x4c')]=function(_0x4b9d6d,_0x4f18bd,_0x2d8f07){var _0x48d076={};var _0x2709c8={};var _0x1c54f8;var _0x330320;return db[_0xcb02('0x2e')]['findOne']({'where':{'id':_0x4b9d6d[_0xcb02('0x46')]['id']}})[_0xcb02('0x28')](handleEntityNotFound(_0x4f18bd,null))[_0xcb02('0x28')](function(_0xd327e9){if(_0xd327e9){_0x1c54f8=_0xd327e9;_0x2709c8[_0xcb02('0x33')]=_[_0xcb02('0x35')](db[_0xcb02('0x4d')][_0xcb02('0x2f')]);_0x2709c8[_0xcb02('0x34')]=_['keys'](_0x4b9d6d[_0xcb02('0x34')]);_0x2709c8['filters']=_[_0xcb02('0x38')](_0x2709c8[_0xcb02('0x33')],_0x2709c8['query']);_0x48d076[_0xcb02('0x37')]=_[_0xcb02('0x38')](_0x2709c8[_0xcb02('0x33')],qs[_0xcb02('0x39')](_0x4b9d6d['query']['fields']));_0x48d076['attributes']=_0x48d076['attributes'][_0xcb02('0x47')]?_0x48d076[_0xcb02('0x37')]:_0x2709c8[_0xcb02('0x33')];_0x48d076[_0xcb02('0x4e')]=qs[_0xcb02('0x3b')](_0x4b9d6d[_0xcb02('0x34')][_0xcb02('0x3b')]);_0x48d076[_0xcb02('0x3c')]=qs['filters'](_[_0xcb02('0x3d')](_0x4b9d6d[_0xcb02('0x34')],_0x2709c8['filters']));if(_0x4b9d6d[_0xcb02('0x34')][_0xcb02('0x3f')]){_0x48d076[_0xcb02('0x3c')]=_[_0xcb02('0x40')](_0x48d076[_0xcb02('0x3c')],{'$or':_[_0xcb02('0x2d')](_0x48d076[_0xcb02('0x37')],function(_0x25ac02){var _0x544062={};_0x544062[_0x25ac02]={'$like':'%'+_0x4b9d6d['query']['filter']+'%'};return _0x544062;})});}_0x48d076=_[_0xcb02('0x40')]({},_0x48d076,_0x4b9d6d['options']);return _0x1c54f8['getFields'](_0x48d076);}})[_0xcb02('0x28')](function(_0x4ed6ca){if(_0x4ed6ca){_0x330320=_0x4ed6ca[_0xcb02('0x47')];if(!_0x4b9d6d[_0xcb02('0x34')][_0xcb02('0x4f')](_0xcb02('0x3a'))){_0x48d076[_0xcb02('0x20')]=qs[_0xcb02('0x20')](_0x4b9d6d['query'][_0xcb02('0x20')]);_0x48d076[_0xcb02('0x1e')]=qs[_0xcb02('0x1e')](_0x4b9d6d[_0xcb02('0x34')]['offset']);}return _0x1c54f8[_0xcb02('0x4c')](_0x48d076);}})[_0xcb02('0x28')](function(_0x532099){if(_0x532099){return _0x532099?{'count':_0x330320,'rows':_0x532099}:null;}})[_0xcb02('0x28')](respondWithResult(_0x4f18bd,null))[_0xcb02('0x44')](handleError(_0x4f18bd,null));};exports[_0xcb02('0x50')]=function(_0x2ecc34,_0x240745,_0x36f75c){var _0x440cbc={};var _0x241468={};var _0x4fec1e;var _0x53165a;return db[_0xcb02('0x2e')][_0xcb02('0x51')]({'where':{'id':_0x2ecc34[_0xcb02('0x46')]['id']}})['then'](handleEntityNotFound(_0x240745,null))[_0xcb02('0x28')](function(_0x16385e){if(_0x16385e){_0x4fec1e=_0x16385e;_0x241468[_0xcb02('0x33')]=_[_0xcb02('0x35')](db['FreshdeskField']['rawAttributes']);_0x241468[_0xcb02('0x34')]=_['keys'](_0x2ecc34['query']);_0x241468[_0xcb02('0x36')]=_[_0xcb02('0x38')](_0x241468['model'],_0x241468[_0xcb02('0x34')]);_0x440cbc[_0xcb02('0x37')]=_['intersection'](_0x241468[_0xcb02('0x33')],qs[_0xcb02('0x39')](_0x2ecc34[_0xcb02('0x34')]['fields']));_0x440cbc[_0xcb02('0x37')]=_0x440cbc[_0xcb02('0x37')][_0xcb02('0x47')]?_0x440cbc['attributes']:_0x241468[_0xcb02('0x33')];_0x440cbc['order']=qs['sort'](_0x2ecc34[_0xcb02('0x34')][_0xcb02('0x3b')]);_0x440cbc['where']=qs[_0xcb02('0x36')](_[_0xcb02('0x3d')](_0x2ecc34['query'],_0x241468[_0xcb02('0x36')]));if(_0x2ecc34[_0xcb02('0x34')]['filter']){_0x440cbc[_0xcb02('0x3c')]=_['merge'](_0x440cbc['where'],{'$or':_['map'](_0x440cbc[_0xcb02('0x37')],function(_0x492552){var _0x3ff0be={};_0x3ff0be[_0x492552]={'$like':'%'+_0x2ecc34[_0xcb02('0x34')][_0xcb02('0x3f')]+'%'};return _0x3ff0be;})});}_0x440cbc=_[_0xcb02('0x40')]({},_0x440cbc,_0x2ecc34[_0xcb02('0x41')]);return _0x4fec1e[_0xcb02('0x50')](_0x440cbc);}})['then'](function(_0x2da9a4){if(_0x2da9a4){_0x53165a=_0x2da9a4[_0xcb02('0x47')];if(!_0x2ecc34[_0xcb02('0x34')][_0xcb02('0x4f')](_0xcb02('0x3a'))){_0x440cbc['limit']=qs[_0xcb02('0x20')](_0x2ecc34[_0xcb02('0x34')][_0xcb02('0x20')]);_0x440cbc[_0xcb02('0x1e')]=qs[_0xcb02('0x1e')](_0x2ecc34[_0xcb02('0x34')][_0xcb02('0x1e')]);}return _0x4fec1e[_0xcb02('0x50')](_0x440cbc);}})[_0xcb02('0x28')](function(_0x1bdfdb){if(_0x1bdfdb){return _0x1bdfdb?{'count':_0x53165a,'rows':_0x1bdfdb}:null;}})[_0xcb02('0x28')](respondWithResult(_0x240745,null))[_0xcb02('0x44')](handleError(_0x240745,null));};exports['getDescriptions']=function(_0x30bc86,_0x3d63ce,_0x4dfe17){var _0x148c88={};var _0x4ae0d0={};var _0x2f5426;var _0x152298;return db[_0xcb02('0x2e')][_0xcb02('0x51')]({'where':{'id':_0x30bc86['params']['id']}})['then'](handleEntityNotFound(_0x3d63ce,null))[_0xcb02('0x28')](function(_0x49dbd3){if(_0x49dbd3){_0x2f5426=_0x49dbd3;_0x4ae0d0[_0xcb02('0x33')]=_[_0xcb02('0x35')](db[_0xcb02('0x4d')][_0xcb02('0x2f')]);_0x4ae0d0[_0xcb02('0x34')]=_[_0xcb02('0x35')](_0x30bc86[_0xcb02('0x34')]);_0x4ae0d0[_0xcb02('0x36')]=_[_0xcb02('0x38')](_0x4ae0d0[_0xcb02('0x33')],_0x4ae0d0[_0xcb02('0x34')]);_0x148c88[_0xcb02('0x37')]=_[_0xcb02('0x38')](_0x4ae0d0[_0xcb02('0x33')],qs[_0xcb02('0x39')](_0x30bc86[_0xcb02('0x34')]['fields']));_0x148c88[_0xcb02('0x37')]=_0x148c88[_0xcb02('0x37')][_0xcb02('0x47')]?_0x148c88[_0xcb02('0x37')]:_0x4ae0d0[_0xcb02('0x33')];_0x148c88[_0xcb02('0x4e')]=qs[_0xcb02('0x3b')](_0x30bc86['query'][_0xcb02('0x3b')]);_0x148c88['where']=qs['filters'](_[_0xcb02('0x3d')](_0x30bc86['query'],_0x4ae0d0[_0xcb02('0x36')]));if(_0x30bc86[_0xcb02('0x34')][_0xcb02('0x3f')]){_0x148c88[_0xcb02('0x3c')]=_['merge'](_0x148c88['where'],{'$or':_[_0xcb02('0x2d')](_0x148c88[_0xcb02('0x37')],function(_0xfb3264){var _0x36c632={};_0x36c632[_0xfb3264]={'$like':'%'+_0x30bc86[_0xcb02('0x34')][_0xcb02('0x3f')]+'%'};return _0x36c632;})});}_0x148c88=_[_0xcb02('0x40')]({},_0x148c88,_0x30bc86['options']);return _0x2f5426[_0xcb02('0x52')](_0x148c88);}})['then'](function(_0x5102b0){if(_0x5102b0){_0x152298=_0x5102b0[_0xcb02('0x47')];if(!_0x30bc86[_0xcb02('0x34')][_0xcb02('0x4f')]('nolimit')){_0x148c88['limit']=qs[_0xcb02('0x20')](_0x30bc86[_0xcb02('0x34')][_0xcb02('0x20')]);_0x148c88[_0xcb02('0x1e')]=qs[_0xcb02('0x1e')](_0x30bc86[_0xcb02('0x34')][_0xcb02('0x1e')]);}return _0x2f5426[_0xcb02('0x52')](_0x148c88);}})[_0xcb02('0x28')](function(_0x5408f3){if(_0x5408f3){return _0x5408f3?{'count':_0x152298,'rows':_0x5408f3}:null;}})[_0xcb02('0x28')](respondWithResult(_0x3d63ce,null))[_0xcb02('0x44')](handleError(_0x3d63ce,null));};exports[_0xcb02('0x53')]=function(_0x843b4a,_0xf00124,_0x1c650f){var _0x17fb68={};var _0x4e0f17={};var _0x36e0a5;var _0x2fecc7;return db[_0xcb02('0x2e')][_0xcb02('0x51')]({'where':{'id':_0x843b4a['params']['id']}})[_0xcb02('0x28')](handleEntityNotFound(_0xf00124,null))[_0xcb02('0x28')](function(_0x46324f){if(_0x46324f){_0x36e0a5=_0x46324f;_0x4e0f17[_0xcb02('0x33')]=_[_0xcb02('0x35')](db[_0xcb02('0x54')][_0xcb02('0x2f')]);_0x4e0f17[_0xcb02('0x34')]=_[_0xcb02('0x35')](_0x843b4a['query']);_0x4e0f17['filters']=_[_0xcb02('0x38')](_0x4e0f17['model'],_0x4e0f17[_0xcb02('0x34')]);_0x17fb68[_0xcb02('0x37')]=_['intersection'](_0x4e0f17[_0xcb02('0x33')],qs[_0xcb02('0x39')](_0x843b4a['query']['fields']));_0x17fb68['attributes']=_0x17fb68[_0xcb02('0x37')][_0xcb02('0x47')]?_0x17fb68[_0xcb02('0x37')]:_0x4e0f17[_0xcb02('0x33')];_0x17fb68[_0xcb02('0x4e')]=qs[_0xcb02('0x3b')](_0x843b4a[_0xcb02('0x34')][_0xcb02('0x3b')]);_0x17fb68[_0xcb02('0x3c')]=qs[_0xcb02('0x36')](_[_0xcb02('0x3d')](_0x843b4a[_0xcb02('0x34')],_0x4e0f17[_0xcb02('0x36')]));if(_0x843b4a[_0xcb02('0x34')][_0xcb02('0x3f')]){_0x17fb68[_0xcb02('0x3c')]=_[_0xcb02('0x40')](_0x17fb68[_0xcb02('0x3c')],{'$or':_[_0xcb02('0x2d')](_0x17fb68[_0xcb02('0x37')],function(_0x300d47){var _0x2b3de7={};_0x2b3de7[_0x300d47]={'$like':'%'+_0x843b4a[_0xcb02('0x34')][_0xcb02('0x3f')]+'%'};return _0x2b3de7;})});}_0x17fb68=_[_0xcb02('0x40')]({},_0x17fb68,_0x843b4a[_0xcb02('0x41')]);return _0x36e0a5[_0xcb02('0x53')](_0x17fb68);}})['then'](function(_0x2ae993){if(_0x2ae993){_0x2fecc7=_0x2ae993['length'];if(!_0x843b4a[_0xcb02('0x34')][_0xcb02('0x4f')](_0xcb02('0x3a'))){_0x17fb68[_0xcb02('0x20')]=qs['limit'](_0x843b4a['query'][_0xcb02('0x20')]);_0x17fb68['offset']=qs['offset'](_0x843b4a[_0xcb02('0x34')][_0xcb02('0x1e')]);}return _0x36e0a5['getTags'](_0x17fb68);}})[_0xcb02('0x28')](function(_0x42b7d3){if(_0x42b7d3){return _0x42b7d3?{'count':_0x2fecc7,'rows':_0x42b7d3}:null;}})[_0xcb02('0x28')](respondWithResult(_0xf00124,null))[_0xcb02('0x44')](handleError(_0xf00124,null));};exports[_0xcb02('0x55')]=function(_0x4734c4,_0x4671d0,_0x579432){if(_0x4734c4[_0xcb02('0x4b')]['id']){delete _0x4734c4[_0xcb02('0x4b')]['id'];}return db[_0xcb02('0x2e')][_0xcb02('0x51')]({'where':{'id':_0x4734c4[_0xcb02('0x46')]['id']}})['then'](handleEntityNotFound(_0x4671d0,null))['then'](function(_0x3f10b2){if(_0x3f10b2){return _0x3f10b2[_0xcb02('0x55')](_0x4734c4[_0xcb02('0x4b')]['ids']||[]);}return null;})[_0xcb02('0x28')](respondWithResult(_0x4671d0,null))[_0xcb02('0x44')](handleError(_0x4671d0,null));};
\ No newline at end of file
index c50466a..447314a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf84=['exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x47794f,_0x12c9b3){var _0x2ca51d=function(_0x43deb3){while(--_0x43deb3){_0x47794f['push'](_0x47794f['shift']());}};_0x2ca51d(++_0x12c9b3);}(_0xaf84,0x148));var _0x4af8=function(_0xc1a4cf,_0x17141b){_0xc1a4cf=_0xc1a4cf-0x0;var _0x2930d1=_0xaf84[_0xc1a4cf];return _0x2930d1;};'use strict';var _=require('lodash');var util=require(_0x4af8('0x0'));var logger=require(_0x4af8('0x1'))(_0x4af8('0x2'));var moment=require('moment');var BPromise=require(_0x4af8('0x3'));var rp=require(_0x4af8('0x4'));var fs=require('fs');var path=require(_0x4af8('0x5'));var rimraf=require('rimraf');var config=require(_0x4af8('0x6'));var attributes=require(_0x4af8('0x7'));module[_0x4af8('0x8')]=function(_0x59cc47,_0x180169){return _0x59cc47[_0x4af8('0x9')](_0x4af8('0xa'),attributes,{'tableName':_0x4af8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xceb3=['./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0xb92859,_0x2d173f){var _0x28d3ad=function(_0x2f9a6f){while(--_0x2f9a6f){_0xb92859['push'](_0xb92859['shift']());}};_0x28d3ad(++_0x2d173f);}(_0xceb3,0x157));var _0x3ceb=function(_0x5f25b3,_0x35481a){_0x5f25b3=_0x5f25b3-0x0;var _0x4ab9bf=_0xceb3[_0x5f25b3];return _0x4ab9bf;};'use strict';var _=require(_0x3ceb('0x0'));var util=require(_0x3ceb('0x1'));var logger=require(_0x3ceb('0x2'))(_0x3ceb('0x3'));var moment=require(_0x3ceb('0x4'));var BPromise=require('bluebird');var rp=require(_0x3ceb('0x5'));var fs=require('fs');var path=require(_0x3ceb('0x6'));var rimraf=require('rimraf');var config=require(_0x3ceb('0x7'));var attributes=require(_0x3ceb('0x8'));module[_0x3ceb('0x9')]=function(_0x1a6eab,_0x24d8a8){return _0x1a6eab[_0x3ceb('0xa')](_0x3ceb('0xb'),attributes,{'tableName':_0x3ceb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f9bf22c..52306d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff82=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1e72a3,_0x57df6b){var _0x8306=function(_0x1a2333){while(--_0x1a2333){_0x1e72a3['push'](_0x1e72a3['shift']());}};_0x8306(++_0x57df6b);}(_0xff82,0x6b));var _0x2ff8=function(_0x3f9011,_0x4b1e6e){_0x3f9011=_0x3f9011-0x0;var _0x5df91a=_0xff82[_0x3f9011];return _0x5df91a;};'use strict';var _=require(_0x2ff8('0x0'));var util=require(_0x2ff8('0x1'));var moment=require(_0x2ff8('0x2'));var BPromise=require(_0x2ff8('0x3'));var rs=require(_0x2ff8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ff8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2ff8('0x6'));var config=require(_0x2ff8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2ff8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39ad00,_0x1d4bdb,_0x21850c){return new BPromise(function(_0x473746,_0x85c0c3){return client['request'](_0x39ad00,_0x21850c)[_0x2ff8('0x9')](function(_0x322902){logger[_0x2ff8('0xa')](_0x2ff8('0xb'),_0x1d4bdb,'request\x20sent');logger[_0x2ff8('0xc')](_0x2ff8('0xd'),_0x1d4bdb,_0x2ff8('0xe'),JSON[_0x2ff8('0xf')](_0x322902));if(_0x322902[_0x2ff8('0x10')]){if(_0x322902[_0x2ff8('0x10')][_0x2ff8('0x11')]===0x1f4){logger[_0x2ff8('0x10')](_0x2ff8('0xb'),_0x1d4bdb,_0x322902[_0x2ff8('0x10')][_0x2ff8('0x12')]);return _0x85c0c3(_0x322902[_0x2ff8('0x10')][_0x2ff8('0x12')]);}logger['error'](_0x2ff8('0xb'),_0x1d4bdb,_0x322902['error']['message']);return _0x473746(_0x322902[_0x2ff8('0x10')]['message']);}else{logger[_0x2ff8('0xa')](_0x2ff8('0xb'),_0x1d4bdb,_0x2ff8('0xe'));_0x473746(_0x322902[_0x2ff8('0x13')][_0x2ff8('0x12')]);}})[_0x2ff8('0x14')](function(_0x22f68b){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x1d4bdb,_0x22f68b);_0x85c0c3(_0x22f68b);});});}
\ No newline at end of file
+var _0x2ae5=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2ae5,0x133));var _0x52ae=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x2ae5[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x52ae('0x0'));var util=require('util');var moment=require(_0x52ae('0x1'));var BPromise=require('bluebird');var rs=require(_0x52ae('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x52ae('0x3'))['db'];var utils=require(_0x52ae('0x4'));var logger=require(_0x52ae('0x5'))(_0x52ae('0x6'));var config=require('../../config/environment');var jayson=require(_0x52ae('0x7'));var client=jayson[_0x52ae('0x8')][_0x52ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10b603,_0x1a1409,_0x1bdf53){return new BPromise(function(_0x1a7ed8,_0x41d195){return client[_0x52ae('0xa')](_0x10b603,_0x1bdf53)[_0x52ae('0xb')](function(_0x42a468){logger[_0x52ae('0xc')](_0x52ae('0xd'),_0x1a1409,_0x52ae('0xe'));logger[_0x52ae('0xf')](_0x52ae('0x10'),_0x1a1409,_0x52ae('0xe'),JSON[_0x52ae('0x11')](_0x42a468));if(_0x42a468[_0x52ae('0x12')]){if(_0x42a468[_0x52ae('0x12')]['code']===0x1f4){logger['error'](_0x52ae('0xd'),_0x1a1409,_0x42a468[_0x52ae('0x12')][_0x52ae('0x13')]);return _0x41d195(_0x42a468[_0x52ae('0x12')][_0x52ae('0x13')]);}logger[_0x52ae('0x12')](_0x52ae('0xd'),_0x1a1409,_0x42a468[_0x52ae('0x12')][_0x52ae('0x13')]);return _0x1a7ed8(_0x42a468[_0x52ae('0x12')]['message']);}else{logger['info'](_0x52ae('0xd'),_0x1a1409,_0x52ae('0xe'));_0x1a7ed8(_0x42a468[_0x52ae('0x14')][_0x52ae('0x13')]);}})[_0x52ae('0x15')](function(_0x3fb3e6){logger[_0x52ae('0x12')](_0x52ae('0xd'),_0x1a1409,_0x3fb3e6);_0x41d195(_0x3fb3e6);});});}
\ No newline at end of file
index 36d0add..f6dfaa4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf168=['/:id','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','isAuthenticated','get'];(function(_0xc48ed5,_0x2c6589){var _0x54d38a=function(_0x4c0ed7){while(--_0x4c0ed7){_0xc48ed5['push'](_0xc48ed5['shift']());}};_0x54d38a(++_0x2c6589);}(_0xf168,0x1ed));var _0x8f16=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0xf168[_0x581af1];return _0x54c22e;};'use strict';var multer=require(_0x8f16('0x0'));var util=require(_0x8f16('0x1'));var path=require('path');var timeout=require(_0x8f16('0x2'));var express=require(_0x8f16('0x3'));var router=express[_0x8f16('0x4')]();var fs_extra=require(_0x8f16('0x5'));var auth=require(_0x8f16('0x6'));var interaction=require(_0x8f16('0x7'));var config=require('../../config/environment');var controller=require(_0x8f16('0x8'));router['get']('/',auth[_0x8f16('0x9')](),controller['index']);router[_0x8f16('0xa')](_0x8f16('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x8f16('0xc')]('/',auth[_0x8f16('0x9')](),controller[_0x8f16('0xd')]);router[_0x8f16('0xe')](_0x8f16('0xb'),auth[_0x8f16('0x9')](),controller['update']);router[_0x8f16('0xf')](_0x8f16('0xb'),auth['isAuthenticated'](),controller[_0x8f16('0x10')]);module[_0x8f16('0x11')]=router;
\ No newline at end of file
+var _0x067a=['show','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x067a,0x9e));var _0xa067=function(_0x552ad1,_0x1d8ee3){_0x552ad1=_0x552ad1-0x0;var _0x55508b=_0x067a[_0x552ad1];return _0x55508b;};'use strict';var multer=require(_0xa067('0x0'));var util=require(_0xa067('0x1'));var path=require('path');var timeout=require(_0xa067('0x2'));var express=require(_0xa067('0x3'));var router=express[_0xa067('0x4')]();var fs_extra=require(_0xa067('0x5'));var auth=require(_0xa067('0x6'));var interaction=require(_0xa067('0x7'));var config=require(_0xa067('0x8'));var controller=require('./intFreshdeskField.controller');router[_0xa067('0x9')]('/',auth[_0xa067('0xa')](),controller['index']);router[_0xa067('0x9')](_0xa067('0xb'),auth[_0xa067('0xa')](),controller[_0xa067('0xc')]);router['post']('/',auth[_0xa067('0xa')](),controller[_0xa067('0xd')]);router[_0xa067('0xe')]('/:id',auth[_0xa067('0xa')](),controller[_0xa067('0xf')]);router['delete']('/:id',auth[_0xa067('0xa')](),controller[_0xa067('0x10')]);module['exports']=router;
\ No newline at end of file
index 1d293ae..1594198 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b7e=['variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','string'];(function(_0x487bdb,_0x533811){var _0x446ddb=function(_0x530a3a){while(--_0x530a3a){_0x487bdb['push'](_0x487bdb['shift']());}};_0x446ddb(++_0x533811);}(_0x7b7e,0x165));var _0xe7b7=function(_0x430459,_0x58519c){_0x430459=_0x430459-0x0;var _0x3a2439=_0x7b7e[_0x430459];return _0x3a2439;};'use strict';var Sequelize=require(_0xe7b7('0x0'));module[_0xe7b7('0x1')]={'type':{'type':Sequelize['ENUM'](_0xe7b7('0x2'),_0xe7b7('0x3'),'customVariable',_0xe7b7('0x4'),_0xe7b7('0x5')),'defaultValue':_0xe7b7('0x2')},'content':{'type':Sequelize[_0xe7b7('0x6')]},'key':{'type':Sequelize[_0xe7b7('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xe7b7('0x2'),_0xe7b7('0x3'),_0xe7b7('0x7'))},'keyContent':{'type':Sequelize[_0xe7b7('0x6')]},'idField':{'type':Sequelize[_0xe7b7('0x6')]},'nameField':{'type':Sequelize[_0xe7b7('0x6')]},'customField':{'type':Sequelize[_0xe7b7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xdfac=['variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string'];(function(_0x2ccf75,_0x165210){var _0x51b28c=function(_0x18cc30){while(--_0x18cc30){_0x2ccf75['push'](_0x2ccf75['shift']());}};_0x51b28c(++_0x165210);}(_0xdfac,0x1dd));var _0xcdfa=function(_0x22591f,_0x28399c){_0x22591f=_0x22591f-0x0;var _0x23146e=_0xdfac[_0x22591f];return _0x23146e;};'use strict';var Sequelize=require(_0xcdfa('0x0'));module[_0xcdfa('0x1')]={'type':{'type':Sequelize['ENUM'](_0xcdfa('0x2'),_0xcdfa('0x3'),_0xcdfa('0x4'),_0xcdfa('0x5'),_0xcdfa('0x6')),'defaultValue':_0xcdfa('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xcdfa('0x7')]},'keyType':{'type':Sequelize[_0xcdfa('0x8')]('string',_0xcdfa('0x3'),_0xcdfa('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xcdfa('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xcdfa('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcdfa('0x7')]}};
\ No newline at end of file
index 39a79b3..73c6979 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb921=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','index','FreshdeskField','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','show','params','include','options','create','body','catch','find','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'];(function(_0x120afe,_0x2f3e42){var _0x3e9e95=function(_0x3792cc){while(--_0x3792cc){_0x120afe['push'](_0x120afe['shift']());}};_0x3e9e95(++_0x2f3e42);}(_0xb921,0x16a));var _0x1b92=function(_0x397f4f,_0x131f3b){_0x397f4f=_0x397f4f-0x0;var _0x3e6fef=_0xb921[_0x397f4f];return _0x3e6fef;};'use strict';var emlformat=require(_0x1b92('0x0'));var rimraf=require(_0x1b92('0x1'));var zipdir=require(_0x1b92('0x2'));var jsonpatch=require(_0x1b92('0x3'));var rp=require(_0x1b92('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1b92('0x5'));var util=require(_0x1b92('0x6'));var path=require(_0x1b92('0x7'));var sox=require(_0x1b92('0x8'));var csv=require(_0x1b92('0x9'));var ejs=require(_0x1b92('0xa'));var fs=require('fs');var fs_extra=require(_0x1b92('0xb'));var _=require(_0x1b92('0xc'));var squel=require(_0x1b92('0xd'));var crypto=require(_0x1b92('0xe'));var jsforce=require(_0x1b92('0xf'));var deskjs=require(_0x1b92('0x10'));var toCsv=require(_0x1b92('0x9'));var querystring=require(_0x1b92('0x11'));var Papa=require(_0x1b92('0x12'));var Redis=require('ioredis');var authService=require(_0x1b92('0x13'));var qs=require(_0x1b92('0x14'));var as=require(_0x1b92('0x15'));var hardwareService=require(_0x1b92('0x16'));var logger=require(_0x1b92('0x17'))(_0x1b92('0x18'));var utils=require(_0x1b92('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x1b92('0x1a'));var db=require(_0x1b92('0x1b'))['db'];function respondWithStatusCode(_0x5a1ca5,_0x81cbe0){_0x81cbe0=_0x81cbe0||0xcc;return function(_0x29a7ed){if(_0x29a7ed){return _0x5a1ca5[_0x1b92('0x1c')](_0x81cbe0);}return _0x5a1ca5[_0x1b92('0x1d')](_0x81cbe0)[_0x1b92('0x1e')]();};}function respondWithResult(_0x290be6,_0x1d33bf){_0x1d33bf=_0x1d33bf||0xc8;return function(_0x4bbb76){if(_0x4bbb76){return _0x290be6[_0x1b92('0x1d')](_0x1d33bf)['json'](_0x4bbb76);}};}function respondWithFilteredResult(_0x1a559b,_0x511a97){return function(_0x694d4f){if(_0x694d4f){var _0x523285=typeof _0x511a97[_0x1b92('0x1f')]===_0x1b92('0x20')&&typeof _0x511a97[_0x1b92('0x21')]==='undefined';var _0x2d171f=_0x694d4f[_0x1b92('0x22')];var _0x289523=_0x523285?0x0:_0x511a97[_0x1b92('0x1f')];var _0x4368dc=_0x523285?_0x694d4f['count']:_0x511a97[_0x1b92('0x1f')]+_0x511a97[_0x1b92('0x21')];var _0x30b0d8;if(_0x4368dc>=_0x2d171f){_0x4368dc=_0x2d171f;_0x30b0d8=0xc8;}else{_0x30b0d8=0xce;}_0x1a559b['status'](_0x30b0d8);return _0x1a559b[_0x1b92('0x23')](_0x1b92('0x24'),_0x289523+'-'+_0x4368dc+'/'+_0x2d171f)[_0x1b92('0x25')](_0x694d4f);}return null;};}function patchUpdates(_0x4bfc51){return function(_0x1d9d28){try{jsonpatch['apply'](_0x1d9d28,_0x4bfc51,!![]);}catch(_0x39ef4e){return BPromise[_0x1b92('0x26')](_0x39ef4e);}return _0x1d9d28['save']();};}function saveUpdates(_0x4ea25f,_0x34c5c9){return function(_0x311487){if(_0x311487){return _0x311487[_0x1b92('0x27')](_0x4ea25f)[_0x1b92('0x28')](function(_0x41fc82){return _0x41fc82;});}return null;};}function removeEntity(_0x186030,_0x48cdf1){return function(_0x3be220){if(_0x3be220){return _0x3be220[_0x1b92('0x29')]()[_0x1b92('0x28')](function(){_0x186030[_0x1b92('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f0e1b,_0x53025e){return function(_0x4369e2){if(!_0x4369e2){_0x3f0e1b[_0x1b92('0x1c')](0x194);}return _0x4369e2;};}function handleError(_0x1abb9a,_0x3c1fa1){_0x3c1fa1=_0x3c1fa1||0x1f4;return function(_0x3e353){logger[_0x1b92('0x2a')](_0x3e353[_0x1b92('0x2b')]);if(_0x3e353[_0x1b92('0x2c')]){delete _0x3e353['name'];}_0x1abb9a['status'](_0x3c1fa1)['send'](_0x3e353);};}exports[_0x1b92('0x2d')]=function(_0x525d05,_0x2c4e02){var _0x5d006b={},_0x462949={},_0x4656aa={'count':0x0,'rows':[]};var _0x26f832=_['map'](db[_0x1b92('0x2e')][_0x1b92('0x2f')],function(_0x55eafd){return{'name':_0x55eafd['fieldName'],'type':_0x55eafd[_0x1b92('0x30')][_0x1b92('0x31')]};});_0x462949[_0x1b92('0x32')]=_[_0x1b92('0x33')](_0x26f832,_0x1b92('0x2c'));_0x462949['query']=_[_0x1b92('0x34')](_0x525d05[_0x1b92('0x35')]);_0x462949[_0x1b92('0x36')]=_[_0x1b92('0x37')](_0x462949[_0x1b92('0x32')],_0x462949[_0x1b92('0x35')]);_0x5d006b[_0x1b92('0x38')]=_['intersection'](_0x462949[_0x1b92('0x32')],qs[_0x1b92('0x39')](_0x525d05['query'][_0x1b92('0x39')]));_0x5d006b[_0x1b92('0x38')]=_0x5d006b[_0x1b92('0x38')]['length']?_0x5d006b[_0x1b92('0x38')]:_0x462949[_0x1b92('0x32')];if(!_0x525d05['query']['hasOwnProperty'](_0x1b92('0x3a'))){_0x5d006b[_0x1b92('0x21')]=qs[_0x1b92('0x21')](_0x525d05[_0x1b92('0x35')]['limit']);_0x5d006b['offset']=qs['offset'](_0x525d05[_0x1b92('0x35')][_0x1b92('0x1f')]);}_0x5d006b[_0x1b92('0x3b')]=qs[_0x1b92('0x3c')](_0x525d05[_0x1b92('0x35')][_0x1b92('0x3c')]);_0x5d006b[_0x1b92('0x3d')]=qs['filters'](_[_0x1b92('0x3e')](_0x525d05[_0x1b92('0x35')],_0x462949['filters']),_0x26f832);if(_0x525d05[_0x1b92('0x35')][_0x1b92('0x3f')]){_0x5d006b[_0x1b92('0x3d')]=_[_0x1b92('0x40')](_0x5d006b[_0x1b92('0x3d')],{'$or':_[_0x1b92('0x33')](_0x26f832,function(_0x115e5f){if(_0x115e5f[_0x1b92('0x30')]!==_0x1b92('0x41')){var _0x14571e={};_0x14571e[_0x115e5f['name']]={'$like':'%'+_0x525d05[_0x1b92('0x35')]['filter']+'%'};return _0x14571e;}})});}_0x5d006b=_[_0x1b92('0x40')]({},_0x5d006b,_0x525d05['options']);var _0x4589fb={'where':_0x5d006b[_0x1b92('0x3d')]};return db[_0x1b92('0x2e')][_0x1b92('0x22')](_0x4589fb)[_0x1b92('0x28')](function(_0x29cda5){_0x4656aa[_0x1b92('0x22')]=_0x29cda5;if(_0x525d05[_0x1b92('0x35')][_0x1b92('0x42')]){_0x5d006b['include']=[{'all':!![]}];}return db[_0x1b92('0x2e')]['findAll'](_0x5d006b);})[_0x1b92('0x28')](function(_0x1e945){_0x4656aa[_0x1b92('0x43')]=_0x1e945;return _0x4656aa;})[_0x1b92('0x28')](respondWithFilteredResult(_0x2c4e02,_0x5d006b))['catch'](handleError(_0x2c4e02,null));};exports[_0x1b92('0x44')]=function(_0xfb5b49,_0x133500){var _0x469a88={'raw':!![],'where':{'id':_0xfb5b49[_0x1b92('0x45')]['id']}},_0xd3f7b0={};_0xd3f7b0['model']=_[_0x1b92('0x34')](db[_0x1b92('0x2e')][_0x1b92('0x2f')]);_0xd3f7b0[_0x1b92('0x35')]=_[_0x1b92('0x34')](_0xfb5b49[_0x1b92('0x35')]);_0xd3f7b0['filters']=_[_0x1b92('0x37')](_0xd3f7b0[_0x1b92('0x32')],_0xd3f7b0['query']);_0x469a88[_0x1b92('0x38')]=_['intersection'](_0xd3f7b0[_0x1b92('0x32')],qs[_0x1b92('0x39')](_0xfb5b49[_0x1b92('0x35')]['fields']));_0x469a88[_0x1b92('0x38')]=_0x469a88[_0x1b92('0x38')]['length']?_0x469a88['attributes']:_0xd3f7b0['model'];if(_0xfb5b49[_0x1b92('0x35')][_0x1b92('0x42')]){_0x469a88[_0x1b92('0x46')]=[{'all':!![]}];}_0x469a88=_[_0x1b92('0x40')]({},_0x469a88,_0xfb5b49[_0x1b92('0x47')]);return db[_0x1b92('0x2e')]['find'](_0x469a88)[_0x1b92('0x28')](handleEntityNotFound(_0x133500,null))[_0x1b92('0x28')](respondWithResult(_0x133500,null))['catch'](handleError(_0x133500,null));};exports[_0x1b92('0x48')]=function(_0x30dbb0,_0x121be9){return db['FreshdeskField'][_0x1b92('0x48')](_0x30dbb0[_0x1b92('0x49')],{})[_0x1b92('0x28')](respondWithResult(_0x121be9,0xc9))[_0x1b92('0x4a')](handleError(_0x121be9,null));};exports[_0x1b92('0x27')]=function(_0x5ac096,_0x142d28){if(_0x5ac096[_0x1b92('0x49')]['id']){delete _0x5ac096[_0x1b92('0x49')]['id'];}return db[_0x1b92('0x2e')][_0x1b92('0x4b')]({'where':{'id':_0x5ac096['params']['id']}})['then'](handleEntityNotFound(_0x142d28,null))[_0x1b92('0x28')](saveUpdates(_0x5ac096[_0x1b92('0x49')],null))[_0x1b92('0x28')](respondWithResult(_0x142d28,null))[_0x1b92('0x4a')](handleError(_0x142d28,null));};exports['destroy']=function(_0x4e0954,_0xfdae28){return db['FreshdeskField'][_0x1b92('0x4b')]({'where':{'id':_0x4e0954[_0x1b92('0x45')]['id']}})[_0x1b92('0x28')](handleEntityNotFound(_0xfdae28,null))['then'](removeEntity(_0xfdae28,null))[_0x1b92('0x4a')](handleError(_0xfdae28,null));};
\ No newline at end of file
+var _0x0c5d=['index','map','FreshdeskField','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','filters','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send'];(function(_0x3093fe,_0x5a0cff){var _0x31517d=function(_0x4a6eba){while(--_0x4a6eba){_0x3093fe['push'](_0x3093fe['shift']());}};_0x31517d(++_0x5a0cff);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x18cccb,_0x26cc74){_0x18cccb=_0x18cccb-0x0;var _0x3eddcb=_0x0c5d[_0x18cccb];return _0x3eddcb;};'use strict';var emlformat=require(_0xd0c5('0x0'));var rimraf=require(_0xd0c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd0c5('0x2'));var rp=require('request-promise');var moment=require(_0xd0c5('0x3'));var BPromise=require(_0xd0c5('0x4'));var Mustache=require(_0xd0c5('0x5'));var util=require(_0xd0c5('0x6'));var path=require(_0xd0c5('0x7'));var sox=require(_0xd0c5('0x8'));var csv=require(_0xd0c5('0x9'));var ejs=require(_0xd0c5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0c5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd0c5('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd0c5('0xd'));var Papa=require(_0xd0c5('0xe'));var Redis=require('ioredis');var authService=require(_0xd0c5('0xf'));var qs=require(_0xd0c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0c5('0x11'));var logger=require(_0xd0c5('0x12'))(_0xd0c5('0x13'));var utils=require(_0xd0c5('0x14'));var config=require(_0xd0c5('0x15'));var licenseUtil=require(_0xd0c5('0x16'));var db=require(_0xd0c5('0x17'))['db'];function respondWithStatusCode(_0x46db00,_0x1e5ac4){_0x1e5ac4=_0x1e5ac4||0xcc;return function(_0x125470){if(_0x125470){return _0x46db00[_0xd0c5('0x18')](_0x1e5ac4);}return _0x46db00[_0xd0c5('0x19')](_0x1e5ac4)['end']();};}function respondWithResult(_0x11511d,_0x1c1cc8){_0x1c1cc8=_0x1c1cc8||0xc8;return function(_0x1fc98d){if(_0x1fc98d){return _0x11511d[_0xd0c5('0x19')](_0x1c1cc8)['json'](_0x1fc98d);}};}function respondWithFilteredResult(_0x280e22,_0x23d941){return function(_0x242615){if(_0x242615){var _0x639e72=typeof _0x23d941['offset']===_0xd0c5('0x1a')&&typeof _0x23d941['limit']===_0xd0c5('0x1a');var _0x57c76a=_0x242615[_0xd0c5('0x1b')];var _0x692aeb=_0x639e72?0x0:_0x23d941[_0xd0c5('0x1c')];var _0x1cfe05=_0x639e72?_0x242615[_0xd0c5('0x1b')]:_0x23d941[_0xd0c5('0x1c')]+_0x23d941[_0xd0c5('0x1d')];var _0x287961;if(_0x1cfe05>=_0x57c76a){_0x1cfe05=_0x57c76a;_0x287961=0xc8;}else{_0x287961=0xce;}_0x280e22['status'](_0x287961);return _0x280e22[_0xd0c5('0x1e')](_0xd0c5('0x1f'),_0x692aeb+'-'+_0x1cfe05+'/'+_0x57c76a)['json'](_0x242615);}return null;};}function patchUpdates(_0x835e8d){return function(_0x30f548){try{jsonpatch[_0xd0c5('0x20')](_0x30f548,_0x835e8d,!![]);}catch(_0x6febb1){return BPromise[_0xd0c5('0x21')](_0x6febb1);}return _0x30f548[_0xd0c5('0x22')]();};}function saveUpdates(_0x331849,_0x49db81){return function(_0x4ac41c){if(_0x4ac41c){return _0x4ac41c[_0xd0c5('0x23')](_0x331849)[_0xd0c5('0x24')](function(_0x439dd5){return _0x439dd5;});}return null;};}function removeEntity(_0x6ce082,_0x5eb093){return function(_0x185e33){if(_0x185e33){return _0x185e33['destroy']()['then'](function(){_0x6ce082[_0xd0c5('0x19')](0xcc)[_0xd0c5('0x25')]();});}};}function handleEntityNotFound(_0x364963,_0x73f292){return function(_0x3a5edf){if(!_0x3a5edf){_0x364963[_0xd0c5('0x18')](0x194);}return _0x3a5edf;};}function handleError(_0xbcef61,_0x17443b){_0x17443b=_0x17443b||0x1f4;return function(_0x19b9ec){logger[_0xd0c5('0x26')](_0x19b9ec[_0xd0c5('0x27')]);if(_0x19b9ec[_0xd0c5('0x28')]){delete _0x19b9ec[_0xd0c5('0x28')];}_0xbcef61[_0xd0c5('0x19')](_0x17443b)[_0xd0c5('0x29')](_0x19b9ec);};}exports[_0xd0c5('0x2a')]=function(_0x24d35f,_0x572e66){var _0x39284e={},_0x36415f={},_0x16298d={'count':0x0,'rows':[]};var _0x21ed42=_[_0xd0c5('0x2b')](db[_0xd0c5('0x2c')][_0xd0c5('0x2d')],function(_0x571410){return{'name':_0x571410[_0xd0c5('0x2e')],'type':_0x571410['type'][_0xd0c5('0x2f')]};});_0x36415f[_0xd0c5('0x30')]=_[_0xd0c5('0x2b')](_0x21ed42,_0xd0c5('0x28'));_0x36415f[_0xd0c5('0x31')]=_[_0xd0c5('0x32')](_0x24d35f[_0xd0c5('0x31')]);_0x36415f['filters']=_['intersection'](_0x36415f[_0xd0c5('0x30')],_0x36415f['query']);_0x39284e[_0xd0c5('0x33')]=_[_0xd0c5('0x34')](_0x36415f[_0xd0c5('0x30')],qs[_0xd0c5('0x35')](_0x24d35f['query'][_0xd0c5('0x35')]));_0x39284e[_0xd0c5('0x33')]=_0x39284e['attributes'][_0xd0c5('0x36')]?_0x39284e['attributes']:_0x36415f[_0xd0c5('0x30')];if(!_0x24d35f[_0xd0c5('0x31')][_0xd0c5('0x37')]('nolimit')){_0x39284e[_0xd0c5('0x1d')]=qs[_0xd0c5('0x1d')](_0x24d35f[_0xd0c5('0x31')][_0xd0c5('0x1d')]);_0x39284e[_0xd0c5('0x1c')]=qs[_0xd0c5('0x1c')](_0x24d35f[_0xd0c5('0x31')][_0xd0c5('0x1c')]);}_0x39284e[_0xd0c5('0x38')]=qs[_0xd0c5('0x39')](_0x24d35f[_0xd0c5('0x31')][_0xd0c5('0x39')]);_0x39284e[_0xd0c5('0x3a')]=qs['filters'](_['pick'](_0x24d35f[_0xd0c5('0x31')],_0x36415f['filters']),_0x21ed42);if(_0x24d35f[_0xd0c5('0x31')][_0xd0c5('0x3b')]){_0x39284e['where']=_[_0xd0c5('0x3c')](_0x39284e[_0xd0c5('0x3a')],{'$or':_['map'](_0x21ed42,function(_0x2cc844){if(_0x2cc844[_0xd0c5('0x3d')]!==_0xd0c5('0x3e')){var _0x444a21={};_0x444a21[_0x2cc844[_0xd0c5('0x28')]]={'$like':'%'+_0x24d35f[_0xd0c5('0x31')][_0xd0c5('0x3b')]+'%'};return _0x444a21;}})});}_0x39284e=_[_0xd0c5('0x3c')]({},_0x39284e,_0x24d35f[_0xd0c5('0x3f')]);var _0x12b1f1={'where':_0x39284e[_0xd0c5('0x3a')]};return db[_0xd0c5('0x2c')][_0xd0c5('0x1b')](_0x12b1f1)['then'](function(_0x1df4be){_0x16298d[_0xd0c5('0x1b')]=_0x1df4be;if(_0x24d35f[_0xd0c5('0x31')][_0xd0c5('0x40')]){_0x39284e[_0xd0c5('0x41')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x39284e);})[_0xd0c5('0x24')](function(_0x2c51c1){_0x16298d[_0xd0c5('0x42')]=_0x2c51c1;return _0x16298d;})[_0xd0c5('0x24')](respondWithFilteredResult(_0x572e66,_0x39284e))['catch'](handleError(_0x572e66,null));};exports[_0xd0c5('0x43')]=function(_0x3aaa50,_0x1d5b9d){var _0x3ca2a3={'raw':!![],'where':{'id':_0x3aaa50[_0xd0c5('0x44')]['id']}},_0x25a2d2={};_0x25a2d2[_0xd0c5('0x30')]=_['keys'](db[_0xd0c5('0x2c')][_0xd0c5('0x2d')]);_0x25a2d2['query']=_[_0xd0c5('0x32')](_0x3aaa50[_0xd0c5('0x31')]);_0x25a2d2[_0xd0c5('0x45')]=_['intersection'](_0x25a2d2['model'],_0x25a2d2['query']);_0x3ca2a3['attributes']=_[_0xd0c5('0x34')](_0x25a2d2['model'],qs[_0xd0c5('0x35')](_0x3aaa50['query'][_0xd0c5('0x35')]));_0x3ca2a3['attributes']=_0x3ca2a3[_0xd0c5('0x33')][_0xd0c5('0x36')]?_0x3ca2a3[_0xd0c5('0x33')]:_0x25a2d2[_0xd0c5('0x30')];if(_0x3aaa50[_0xd0c5('0x31')]['includeAll']){_0x3ca2a3[_0xd0c5('0x41')]=[{'all':!![]}];}_0x3ca2a3=_[_0xd0c5('0x3c')]({},_0x3ca2a3,_0x3aaa50[_0xd0c5('0x3f')]);return db[_0xd0c5('0x2c')][_0xd0c5('0x46')](_0x3ca2a3)[_0xd0c5('0x24')](handleEntityNotFound(_0x1d5b9d,null))['then'](respondWithResult(_0x1d5b9d,null))[_0xd0c5('0x47')](handleError(_0x1d5b9d,null));};exports[_0xd0c5('0x48')]=function(_0xca2e1f,_0x38324c){return db['FreshdeskField'][_0xd0c5('0x48')](_0xca2e1f[_0xd0c5('0x49')],{})[_0xd0c5('0x24')](respondWithResult(_0x38324c,0xc9))[_0xd0c5('0x47')](handleError(_0x38324c,null));};exports[_0xd0c5('0x23')]=function(_0x43d0ad,_0x17d71c){if(_0x43d0ad[_0xd0c5('0x49')]['id']){delete _0x43d0ad[_0xd0c5('0x49')]['id'];}return db[_0xd0c5('0x2c')][_0xd0c5('0x46')]({'where':{'id':_0x43d0ad[_0xd0c5('0x44')]['id']}})['then'](handleEntityNotFound(_0x17d71c,null))['then'](saveUpdates(_0x43d0ad[_0xd0c5('0x49')],null))[_0xd0c5('0x24')](respondWithResult(_0x17d71c,null))[_0xd0c5('0x47')](handleError(_0x17d71c,null));};exports[_0xd0c5('0x4a')]=function(_0x46134,_0x24588){return db['FreshdeskField'][_0xd0c5('0x46')]({'where':{'id':_0x46134[_0xd0c5('0x44')]['id']}})[_0xd0c5('0x24')](handleEntityNotFound(_0x24588,null))[_0xd0c5('0x24')](removeEntity(_0x24588,null))[_0xd0c5('0x47')](handleError(_0x24588,null));};
\ No newline at end of file
index 6a06bf3..b9f12d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed64=['idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','exports','define','freshdesk_unique_index'];(function(_0x2ad912,_0x9ccfa6){var _0x324cd0=function(_0x425fd1){while(--_0x425fd1){_0x2ad912['push'](_0x2ad912['shift']());}};_0x324cd0(++_0x9ccfa6);}(_0xed64,0xc2));var _0x4ed6=function(_0x3f994d,_0x249d72){_0x3f994d=_0x3f994d-0x0;var _0x5309b4=_0xed64[_0x3f994d];return _0x5309b4;};'use strict';var _=require(_0x4ed6('0x0'));var util=require(_0x4ed6('0x1'));var logger=require(_0x4ed6('0x2'))('api');var moment=require(_0x4ed6('0x3'));var BPromise=require(_0x4ed6('0x4'));var rp=require(_0x4ed6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4ed6('0x6'));var attributes=require('./intFreshdeskField.attributes');module[_0x4ed6('0x7')]=function(_0x2d2c5b,_0x3a176c){return _0x2d2c5b[_0x4ed6('0x8')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x4ed6('0x9'),'fields':[_0x4ed6('0xa'),_0x4ed6('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa44a=['moment','bluebird','request-promise','path','rimraf','exports','define','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','api'];(function(_0x3c2212,_0x432ed8){var _0x51018c=function(_0x228660){while(--_0x228660){_0x3c2212['push'](_0x3c2212['shift']());}};_0x51018c(++_0x432ed8);}(_0xa44a,0x9a));var _0xaa44=function(_0x21ef1d,_0xbfa6e){_0x21ef1d=_0x21ef1d-0x0;var _0x2dcdf0=_0xa44a[_0x21ef1d];return _0x2dcdf0;};'use strict';var _=require(_0xaa44('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaa44('0x1'));var moment=require(_0xaa44('0x2'));var BPromise=require(_0xaa44('0x3'));var rp=require(_0xaa44('0x4'));var fs=require('fs');var path=require(_0xaa44('0x5'));var rimraf=require(_0xaa44('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module[_0xaa44('0x7')]=function(_0x39a3f6,_0x4979e3){return _0x39a3f6[_0xaa44('0x8')]('FreshdeskField',attributes,{'tableName':_0xaa44('0x9'),'paranoid':![],'indexes':[{'name':_0xaa44('0xa'),'fields':['idField',_0xaa44('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 8510e96..d9ae88f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8b3=['error','code','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x9c27f3,_0x1522c4){var _0x46c1b6=function(_0x2501f4){while(--_0x2501f4){_0x9c27f3['push'](_0x9c27f3['shift']());}};_0x46c1b6(++_0x1522c4);}(_0xe8b3,0x102));var _0x3e8b=function(_0x3f25ee,_0x9c86df){_0x3f25ee=_0x3f25ee-0x0;var _0x2523fd=_0xe8b3[_0x3f25ee];return _0x2523fd;};'use strict';var _=require(_0x3e8b('0x0'));var util=require('util');var moment=require(_0x3e8b('0x1'));var BPromise=require(_0x3e8b('0x2'));var rs=require(_0x3e8b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e8b('0x4'))['db'];var utils=require(_0x3e8b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3e8b('0x6'));var jayson=require(_0x3e8b('0x7'));var client=jayson[_0x3e8b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43884b,_0x31b781,_0x5c1ba5){return new BPromise(function(_0x4edda0,_0x4f3f72){return client[_0x3e8b('0x9')](_0x43884b,_0x5c1ba5)['then'](function(_0x44cf7c){logger[_0x3e8b('0xa')]('FreshdeskField,\x20%s,\x20%s',_0x31b781,_0x3e8b('0xb'));logger[_0x3e8b('0xc')](_0x3e8b('0xd'),_0x31b781,_0x3e8b('0xb'),JSON[_0x3e8b('0xe')](_0x44cf7c));if(_0x44cf7c[_0x3e8b('0xf')]){if(_0x44cf7c['error'][_0x3e8b('0x10')]===0x1f4){logger['error'](_0x3e8b('0x11'),_0x31b781,_0x44cf7c[_0x3e8b('0xf')]['message']);return _0x4f3f72(_0x44cf7c['error'][_0x3e8b('0x12')]);}logger[_0x3e8b('0xf')](_0x3e8b('0x11'),_0x31b781,_0x44cf7c[_0x3e8b('0xf')][_0x3e8b('0x12')]);return _0x4edda0(_0x44cf7c[_0x3e8b('0xf')][_0x3e8b('0x12')]);}else{logger['info'](_0x3e8b('0x11'),_0x31b781,_0x3e8b('0xb'));_0x4edda0(_0x44cf7c[_0x3e8b('0x13')]['message']);}})[_0x3e8b('0x14')](function(_0x5a065f){logger[_0x3e8b('0xf')](_0x3e8b('0x11'),_0x31b781,_0x5a065f);_0x4f3f72(_0x5a065f);});});}
\ No newline at end of file
+var _0xd81d=['rpc','../../config/environment','jayson/promise','client','http','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x4628c6,_0x212c5e){var _0x181ddc=function(_0x36280a){while(--_0x36280a){_0x4628c6['push'](_0x4628c6['shift']());}};_0x181ddc(++_0x212c5e);}(_0xd81d,0x9b));var _0xdd81=function(_0x53b256,_0x1c3168){_0x53b256=_0x53b256-0x0;var _0x41273c=_0xd81d[_0x53b256];return _0x41273c;};'use strict';var _=require(_0xdd81('0x0'));var util=require('util');var moment=require(_0xdd81('0x1'));var BPromise=require(_0xdd81('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd81('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd81('0x4'))(_0xdd81('0x5'));var config=require(_0xdd81('0x6'));var jayson=require(_0xdd81('0x7'));var client=jayson[_0xdd81('0x8')][_0xdd81('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56b8e1,_0x494e4b,_0x25cb87){return new BPromise(function(_0x1a3ece,_0x5c8d1b){return client['request'](_0x56b8e1,_0x25cb87)['then'](function(_0xd919ae){logger[_0xdd81('0xa')](_0xdd81('0xb'),_0x494e4b,_0xdd81('0xc'));logger[_0xdd81('0xd')](_0xdd81('0xe'),_0x494e4b,_0xdd81('0xc'),JSON[_0xdd81('0xf')](_0xd919ae));if(_0xd919ae[_0xdd81('0x10')]){if(_0xd919ae[_0xdd81('0x10')]['code']===0x1f4){logger[_0xdd81('0x10')](_0xdd81('0xb'),_0x494e4b,_0xd919ae[_0xdd81('0x10')]['message']);return _0x5c8d1b(_0xd919ae[_0xdd81('0x10')][_0xdd81('0x11')]);}logger[_0xdd81('0x10')](_0xdd81('0xb'),_0x494e4b,_0xd919ae[_0xdd81('0x10')][_0xdd81('0x11')]);return _0x1a3ece(_0xd919ae['error'][_0xdd81('0x11')]);}else{logger[_0xdd81('0xa')](_0xdd81('0xb'),_0x494e4b,_0xdd81('0xc'));_0x1a3ece(_0xd919ae[_0xdd81('0x12')][_0xdd81('0x11')]);}})[_0xdd81('0x13')](function(_0x1c675a){logger[_0xdd81('0x10')](_0xdd81('0xb'),_0x494e4b,_0x1c675a);_0x5c8d1b(_0x1c675a);});});}
\ No newline at end of file
index 7c18b7a..8215f84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa571=['/:id','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index'];(function(_0x227b93,_0x41c5df){var _0x58b4a7=function(_0x1ac62c){while(--_0x1ac62c){_0x227b93['push'](_0x227b93['shift']());}};_0x58b4a7(++_0x41c5df);}(_0xa571,0x107));var _0x1a57=function(_0xb66f7c,_0x5109ec){_0xb66f7c=_0xb66f7c-0x0;var _0x57c91a=_0xa571[_0xb66f7c];return _0x57c91a;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./intFreshsalesAccount.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['getConfigurations']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0xe')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router[_0x1a57('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')](_0x1a57('0xa'),auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x13')]('/:id',auth[_0x1a57('0x8')](),controller['destroy']);module[_0x1a57('0x14')]=router;
\ No newline at end of file
+var _0x9354=['addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x538afd,_0x8a95f1){var _0x5c1a7f=function(_0x2b5103){while(--_0x2b5103){_0x538afd['push'](_0x538afd['shift']());}};_0x5c1a7f(++_0x8a95f1);}(_0x9354,0x96));var _0x4935=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0x9354[_0x34e752];return _0x7c6347;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var fs_extra=require(_0x4935('0x4'));var auth=require(_0x4935('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4935('0x6'));var controller=require(_0x4935('0x7'));router[_0x4935('0x8')]('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router[_0x4935('0x8')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router['get'](_0x4935('0xd'),auth['isAuthenticated'](),controller[_0x4935('0xe')]);router[_0x4935('0x8')](_0x4935('0xf'),auth[_0x4935('0x9')](),controller[_0x4935('0x10')]);router[_0x4935('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4935('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x4935('0x12')]);router[_0x4935('0x13')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0x14')]);router[_0x4935('0x15')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0x16')]);module[_0x4935('0x17')]=router;
\ No newline at end of file
index 7b75626..c013232 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2da6=['username','sequelize','exports','STRING'];(function(_0xd75361,_0x3ca738){var _0x2231c2=function(_0x5e4a7e){while(--_0x5e4a7e){_0xd75361['push'](_0xd75361['shift']());}};_0x2231c2(++_0x3ca738);}(_0x2da6,0x1dd));var _0x62da=function(_0x26e1b1,_0xd14312){_0x26e1b1=_0x26e1b1-0x0;var _0xced2db=_0x2da6[_0x26e1b1];return _0xced2db;};'use strict';var Sequelize=require(_0x62da('0x0'));module[_0x62da('0x1')]={'name':{'type':Sequelize[_0x62da('0x2')]},'description':{'type':Sequelize[_0x62da('0x2')]},'username':{'type':Sequelize[_0x62da('0x2')],'unique':_0x62da('0x3')},'apiKey':{'type':Sequelize[_0x62da('0x2')]},'remoteUri':{'type':Sequelize[_0x62da('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x781d=['sequelize','exports','STRING','username','remoteUri'];(function(_0x4c8833,_0x14e755){var _0x30df54=function(_0x197811){while(--_0x197811){_0x4c8833['push'](_0x4c8833['shift']());}};_0x30df54(++_0x14e755);}(_0x781d,0x14a));var _0xd781=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x781d[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0xd781('0x0'));module[_0xd781('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd781('0x2')],'unique':_0xd781('0x3')},'apiKey':{'type':Sequelize[_0xd781('0x2')]},'remoteUri':{'type':Sequelize[_0xd781('0x2')],'unique':_0xd781('0x4')},'serverUrl':{'type':Sequelize[_0xd781('0x2')],'allowNull':![]}};
\ No newline at end of file
index 5dac85a..5a3bc66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b50=['slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','mustache','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','include','findAll','rows','show','catch','create','body','find','params','findOne','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','apiKey','remoteUri'];(function(_0x5f4793,_0x57db3b){var _0x535465=function(_0x2894a7){while(--_0x2894a7){_0x5f4793['push'](_0x5f4793['shift']());}};_0x535465(++_0x57db3b);}(_0x6b50,0x79));var _0x06b5=function(_0x5573a7,_0x4e948c){_0x5573a7=_0x5573a7-0x0;var _0x130808=_0x6b50[_0x5573a7];return _0x130808;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x06b5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06b5('0x1'));var rp=require(_0x06b5('0x2'));var moment=require(_0x06b5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x06b5('0x4'));var util=require('util');var path=require(_0x06b5('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x06b5('0x6'));var fs=require('fs');var fs_extra=require(_0x06b5('0x7'));var _=require('lodash');var squel=require(_0x06b5('0x8'));var crypto=require(_0x06b5('0x9'));var jsforce=require(_0x06b5('0xa'));var deskjs=require(_0x06b5('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x06b5('0xc'));var authService=require(_0x06b5('0xd'));var qs=require(_0x06b5('0xe'));var as=require(_0x06b5('0xf'));var hardwareService=require(_0x06b5('0x10'));var logger=require('../../config/logger')(_0x06b5('0x11'));var utils=require(_0x06b5('0x12'));var config=require(_0x06b5('0x13'));var licenseUtil=require(_0x06b5('0x14'));var db=require(_0x06b5('0x15'))['db'];var integrations=require(_0x06b5('0x16'));function respondWithStatusCode(_0x41c76c,_0x36dd14){_0x36dd14=_0x36dd14||0xcc;return function(_0x5e318f){if(_0x5e318f){return _0x41c76c['sendStatus'](_0x36dd14);}return _0x41c76c[_0x06b5('0x17')](_0x36dd14)[_0x06b5('0x18')]();};}function respondWithResult(_0x69593b,_0x158786){_0x158786=_0x158786||0xc8;return function(_0x57a9b5){if(_0x57a9b5){return _0x69593b[_0x06b5('0x17')](_0x158786)['json'](_0x57a9b5);}};}function respondWithFilteredResult(_0x2c9d3e,_0x37a70e){return function(_0x38c17f){if(_0x38c17f){var _0x45789a=typeof _0x37a70e[_0x06b5('0x19')]===_0x06b5('0x1a')&&typeof _0x37a70e[_0x06b5('0x1b')]===_0x06b5('0x1a');var _0x942503=_0x38c17f['count'];var _0x28c00a=_0x45789a?0x0:_0x37a70e[_0x06b5('0x19')];var _0xb09ee2=_0x45789a?_0x38c17f['count']:_0x37a70e[_0x06b5('0x19')]+_0x37a70e[_0x06b5('0x1b')];var _0xd4cba3;if(_0xb09ee2>=_0x942503){_0xb09ee2=_0x942503;_0xd4cba3=0xc8;}else{_0xd4cba3=0xce;}_0x2c9d3e['status'](_0xd4cba3);return _0x2c9d3e[_0x06b5('0x1c')](_0x06b5('0x1d'),_0x28c00a+'-'+_0xb09ee2+'/'+_0x942503)[_0x06b5('0x1e')](_0x38c17f);}return null;};}function patchUpdates(_0x398498){return function(_0x2f9fe0){try{jsonpatch[_0x06b5('0x1f')](_0x2f9fe0,_0x398498,!![]);}catch(_0x15ee62){return BPromise[_0x06b5('0x20')](_0x15ee62);}return _0x2f9fe0[_0x06b5('0x21')]();};}function saveUpdates(_0x1f7a61,_0x1d1fab){return function(_0x442a03){if(_0x442a03){return _0x442a03[_0x06b5('0x22')](_0x1f7a61)[_0x06b5('0x23')](function(_0x5e465e){return _0x5e465e;});}return null;};}function removeEntity(_0x5180fb,_0x567989){return function(_0x404e11){if(_0x404e11){return _0x404e11[_0x06b5('0x24')]()['then'](function(){_0x5180fb[_0x06b5('0x17')](0xcc)[_0x06b5('0x18')]();});}};}function handleEntityNotFound(_0x51430c,_0xbed8fe){return function(_0x14694b){if(!_0x14694b){_0x51430c['sendStatus'](0x194);}return _0x14694b;};}function handleError(_0x5c1ac7,_0xfaa215){_0xfaa215=_0xfaa215||0x1f4;return function(_0x3466fb){logger['error'](_0x3466fb[_0x06b5('0x25')]);if(_0x3466fb[_0x06b5('0x26')]){delete _0x3466fb[_0x06b5('0x26')];}_0x5c1ac7[_0x06b5('0x17')](_0xfaa215)[_0x06b5('0x27')](_0x3466fb);};}exports[_0x06b5('0x28')]=function(_0x655611,_0x2bb118){var _0x4569af={},_0x4936e8={},_0x4c8e8b={'count':0x0,'rows':[]};var _0x523c90=_[_0x06b5('0x29')](db[_0x06b5('0x2a')][_0x06b5('0x2b')],function(_0x406c4d){return{'name':_0x406c4d[_0x06b5('0x2c')],'type':_0x406c4d[_0x06b5('0x2d')][_0x06b5('0x2e')]};});_0x4936e8[_0x06b5('0x2f')]=_['map'](_0x523c90,_0x06b5('0x26'));_0x4936e8[_0x06b5('0x30')]=_[_0x06b5('0x31')](_0x655611[_0x06b5('0x30')]);_0x4936e8[_0x06b5('0x32')]=_['intersection'](_0x4936e8[_0x06b5('0x2f')],_0x4936e8[_0x06b5('0x30')]);_0x4569af[_0x06b5('0x33')]=_[_0x06b5('0x34')](_0x4936e8['model'],qs[_0x06b5('0x35')](_0x655611[_0x06b5('0x30')][_0x06b5('0x35')]));_0x4569af[_0x06b5('0x33')]=_0x4569af['attributes'][_0x06b5('0x36')]?_0x4569af[_0x06b5('0x33')]:_0x4936e8[_0x06b5('0x2f')];if(!_0x655611[_0x06b5('0x30')][_0x06b5('0x37')](_0x06b5('0x38'))){_0x4569af[_0x06b5('0x1b')]=qs[_0x06b5('0x1b')](_0x655611[_0x06b5('0x30')][_0x06b5('0x1b')]);_0x4569af[_0x06b5('0x19')]=qs[_0x06b5('0x19')](_0x655611[_0x06b5('0x30')][_0x06b5('0x19')]);}_0x4569af[_0x06b5('0x39')]=qs[_0x06b5('0x3a')](_0x655611[_0x06b5('0x30')][_0x06b5('0x3a')]);_0x4569af[_0x06b5('0x3b')]=qs['filters'](_[_0x06b5('0x3c')](_0x655611['query'],_0x4936e8[_0x06b5('0x32')]),_0x523c90);if(_0x655611[_0x06b5('0x30')][_0x06b5('0x3d')]){_0x4569af[_0x06b5('0x3b')]=_[_0x06b5('0x3e')](_0x4569af['where'],{'$or':_[_0x06b5('0x29')](_0x523c90,function(_0x5726e8){if(_0x5726e8['type']!=='VIRTUAL'){var _0x2bf206={};_0x2bf206[_0x5726e8[_0x06b5('0x26')]]={'$like':'%'+_0x655611[_0x06b5('0x30')][_0x06b5('0x3d')]+'%'};return _0x2bf206;}})});}_0x4569af=_[_0x06b5('0x3e')]({},_0x4569af,_0x655611[_0x06b5('0x3f')]);var _0x4ead6c={'where':_0x4569af[_0x06b5('0x3b')]};return db[_0x06b5('0x2a')][_0x06b5('0x40')](_0x4ead6c)[_0x06b5('0x23')](function(_0x4bd72c){_0x4c8e8b[_0x06b5('0x40')]=_0x4bd72c;if(_0x655611[_0x06b5('0x30')]['includeAll']){_0x4569af[_0x06b5('0x41')]=[{'all':!![]}];}return db[_0x06b5('0x2a')][_0x06b5('0x42')](_0x4569af);})[_0x06b5('0x23')](function(_0x437b14){_0x4c8e8b[_0x06b5('0x43')]=_0x437b14;return _0x4c8e8b;})[_0x06b5('0x23')](respondWithFilteredResult(_0x2bb118,_0x4569af))['catch'](handleError(_0x2bb118,null));};exports[_0x06b5('0x44')]=function(_0x1422d2,_0x1561a9){var _0x4d1a7b={'raw':![],'where':{'id':_0x1422d2['params']['id']}},_0x503267={};_0x503267[_0x06b5('0x2f')]=_[_0x06b5('0x31')](db[_0x06b5('0x2a')]['rawAttributes']);_0x503267['query']=_['keys'](_0x1422d2['query']);_0x503267['filters']=_[_0x06b5('0x34')](_0x503267[_0x06b5('0x2f')],_0x503267[_0x06b5('0x30')]);_0x4d1a7b[_0x06b5('0x33')]=_[_0x06b5('0x34')](_0x503267[_0x06b5('0x2f')],qs[_0x06b5('0x35')](_0x1422d2[_0x06b5('0x30')][_0x06b5('0x35')]));_0x4d1a7b['attributes']=_0x4d1a7b['attributes'][_0x06b5('0x36')]?_0x4d1a7b['attributes']:_0x503267[_0x06b5('0x2f')];if(_0x1422d2[_0x06b5('0x30')]['includeAll']){_0x4d1a7b['include']=[{'all':!![]}];}_0x4d1a7b=_['merge']({},_0x4d1a7b,_0x1422d2['options']);return db[_0x06b5('0x2a')]['find'](_0x4d1a7b)[_0x06b5('0x23')](handleEntityNotFound(_0x1561a9,null))['then'](respondWithResult(_0x1561a9,null))[_0x06b5('0x45')](handleError(_0x1561a9,null));};exports[_0x06b5('0x46')]=function(_0x47e070,_0x19dbf4){return db[_0x06b5('0x2a')][_0x06b5('0x46')](_0x47e070[_0x06b5('0x47')],{})[_0x06b5('0x23')](respondWithResult(_0x19dbf4,0xc9))[_0x06b5('0x45')](handleError(_0x19dbf4,null));};exports[_0x06b5('0x22')]=function(_0x374ebb,_0x3b24be){if(_0x374ebb[_0x06b5('0x47')]['id']){delete _0x374ebb[_0x06b5('0x47')]['id'];}return db['FreshsalesAccount'][_0x06b5('0x48')]({'where':{'id':_0x374ebb[_0x06b5('0x49')]['id']}})[_0x06b5('0x23')](handleEntityNotFound(_0x3b24be,null))[_0x06b5('0x23')](saveUpdates(_0x374ebb[_0x06b5('0x47')],null))[_0x06b5('0x23')](respondWithResult(_0x3b24be,null))[_0x06b5('0x45')](handleError(_0x3b24be,null));};exports[_0x06b5('0x24')]=function(_0x1f6670,_0x899de){return db[_0x06b5('0x2a')][_0x06b5('0x48')]({'where':{'id':_0x1f6670[_0x06b5('0x49')]['id']}})[_0x06b5('0x23')](handleEntityNotFound(_0x899de,null))['then'](removeEntity(_0x899de,null))['catch'](handleError(_0x899de,null));};exports['getConfigurations']=function(_0x37e3db,_0x4f11f6,_0x3ee542){var _0xe7e3fd={};var _0x5283bc={};var _0x1b47b4;var _0x176955;return db[_0x06b5('0x2a')][_0x06b5('0x4a')]({'where':{'id':_0x37e3db[_0x06b5('0x49')]['id']}})['then'](handleEntityNotFound(_0x4f11f6,null))[_0x06b5('0x23')](function(_0x2fa0ab){if(_0x2fa0ab){_0x1b47b4=_0x2fa0ab;_0x5283bc[_0x06b5('0x2f')]=_['keys'](db['FreshsalesConfiguration'][_0x06b5('0x2b')]);_0x5283bc[_0x06b5('0x30')]=_[_0x06b5('0x31')](_0x37e3db[_0x06b5('0x30')]);_0x5283bc['filters']=_[_0x06b5('0x34')](_0x5283bc[_0x06b5('0x2f')],_0x5283bc['query']);_0xe7e3fd[_0x06b5('0x33')]=_[_0x06b5('0x34')](_0x5283bc[_0x06b5('0x2f')],qs[_0x06b5('0x35')](_0x37e3db[_0x06b5('0x30')][_0x06b5('0x35')]));_0xe7e3fd[_0x06b5('0x33')]=_0xe7e3fd['attributes'][_0x06b5('0x36')]?_0xe7e3fd[_0x06b5('0x33')]:_0x5283bc[_0x06b5('0x2f')];_0xe7e3fd[_0x06b5('0x39')]=qs['sort'](_0x37e3db[_0x06b5('0x30')][_0x06b5('0x3a')]);_0xe7e3fd['where']=qs[_0x06b5('0x32')](_['pick'](_0x37e3db['query'],_0x5283bc[_0x06b5('0x32')]));if(_0x37e3db[_0x06b5('0x30')]['filter']){_0xe7e3fd[_0x06b5('0x3b')]=_[_0x06b5('0x3e')](_0xe7e3fd[_0x06b5('0x3b')],{'$or':_[_0x06b5('0x29')](_0xe7e3fd[_0x06b5('0x33')],function(_0x1effc9){var _0x486386={};_0x486386[_0x1effc9]={'$like':'%'+_0x37e3db['query'][_0x06b5('0x3d')]+'%'};return _0x486386;})});}_0xe7e3fd=_[_0x06b5('0x3e')]({},_0xe7e3fd,_0x37e3db[_0x06b5('0x3f')]);return _0x1b47b4[_0x06b5('0x4b')](_0xe7e3fd);}})['then'](function(_0x3ba761){if(_0x3ba761){_0x176955=_0x3ba761[_0x06b5('0x36')];if(!_0x37e3db[_0x06b5('0x30')][_0x06b5('0x37')](_0x06b5('0x38'))){_0xe7e3fd[_0x06b5('0x1b')]=qs[_0x06b5('0x1b')](_0x37e3db['query'][_0x06b5('0x1b')]);_0xe7e3fd[_0x06b5('0x19')]=qs[_0x06b5('0x19')](_0x37e3db[_0x06b5('0x30')][_0x06b5('0x19')]);}return _0x1b47b4[_0x06b5('0x4b')](_0xe7e3fd);}})['then'](function(_0x59c302){if(_0x59c302){return _0x59c302?{'count':_0x176955,'rows':_0x59c302}:null;}})['then'](respondWithResult(_0x4f11f6,null))[_0x06b5('0x45')](handleError(_0x4f11f6,null));};exports[_0x06b5('0x4c')]=function(_0x59500b,_0x2ca7df,_0x292439){if(_0x59500b[_0x06b5('0x47')]['id']){delete _0x59500b[_0x06b5('0x47')]['id'];}return db[_0x06b5('0x2a')]['findOne']({'where':{'id':_0x59500b[_0x06b5('0x49')]['id']}})[_0x06b5('0x23')](handleEntityNotFound(_0x2ca7df,null))[_0x06b5('0x23')](function(_0x3d7395){if(_0x3d7395){_0x59500b[_0x06b5('0x47')][_0x06b5('0x4d')]=_0x3d7395['id'];_0x59500b[_0x06b5('0x47')][_0x06b5('0x4e')]=integrations[_0x06b5('0x4f')](_0x59500b[_0x06b5('0x47')][_0x06b5('0x50')],_0x59500b[_0x06b5('0x47')][_0x06b5('0x2d')]);_0x59500b[_0x06b5('0x47')][_0x06b5('0x51')]=integrations[_0x06b5('0x52')](_0x59500b['body'][_0x06b5('0x50')],_0x59500b[_0x06b5('0x47')][_0x06b5('0x2d')]);return db[_0x06b5('0x53')]['create'](_0x59500b[_0x06b5('0x47')],{'include':[{'model':db[_0x06b5('0x54')],'as':_0x06b5('0x4e')},{'model':db['FreshsalesField'],'as':_0x06b5('0x51')}]});}return null;})['then'](respondWithResult(_0x2ca7df,null))[_0x06b5('0x45')](handleError(_0x2ca7df,null));};exports[_0x06b5('0x55')]=function(_0x5c3afc,_0x306cda,_0x1f67b5){var _0x21aa07='';var _0x383ebe='';return db[_0x06b5('0x2a')]['findOne']({'where':{'id':_0x5c3afc['params']['id']},'attributes':['id',_0x06b5('0x56'),'remoteUri',_0x06b5('0x57')]})[_0x06b5('0x23')](handleEntityNotFound(_0x306cda,null))[_0x06b5('0x23')](function(_0x5a77e1){if(_0x5a77e1){_0x383ebe=_0x5a77e1['username'];_0x21aa07=_0x5a77e1[_0x06b5('0x58')];var _0x269b59=_0x5a77e1[_0x06b5('0x58')][_0x06b5('0x59')](-0x1);if(_0x269b59==='/'){_0x21aa07=_0x21aa07[_0x06b5('0x5a')](0x0,_0x21aa07[_0x06b5('0x5b')](_0x269b59));}return rp({'method':_0x06b5('0x5c'),'uri':util[_0x06b5('0x5d')](_0x06b5('0x5e'),_0x21aa07,_0x06b5('0x5f')),'headers':{'Authorization':_0x06b5('0x60')+_0x5a77e1[_0x06b5('0x57')]},'json':!![]});}})[_0x06b5('0x23')](function(_0x5d3abc){if(_0x5d3abc){var _0x3283b9=_0x5d3abc[_0x06b5('0x61')];var _0x122069=![];var _0x549444=null;for(_0x549444=0x0;_0x549444<_0x3283b9[_0x06b5('0x36')];_0x549444++){if(_0x3283b9[_0x549444][_0x06b5('0x62')]===_0x383ebe){_0x122069=!![];}}if(_0x122069){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x06b5('0x63')});}}})[_0x06b5('0x23')](respondWithResult(_0x306cda,null))[_0x06b5('0x45')](function(_0x539c16){var _0x2d6bb1=_0x5c3afc[_0x06b5('0x30')][_0x06b5('0x64')]?0x1f4:_0x539c16[_0x06b5('0x65')]||0x1f4;logger[_0x06b5('0x66')]('getFields,\x20%s,\x20%s,\x20%s',_0x06b5('0x55'),_0x2d6bb1,JSON[_0x06b5('0x67')](_0x539c16));delete _0x539c16[_0x06b5('0x26')];if(_0x2d6bb1===0x191){_0x2d6bb1=0x190;}_0x306cda['status'](_0x2d6bb1)[_0x06b5('0x27')](_0x5c3afc[_0x06b5('0x30')]['test']?{'message':_0x06b5('0x68'),'statusCode':_0x539c16[_0x06b5('0x65')]}:_0x539c16);});};
\ No newline at end of file
+var _0x1714=['keys','filters','attributes','intersection','fields','length','model','nolimit','limit','sort','pick','where','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','body','getConfigurations','findOne','order','filter','options','addConfiguration','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','username','remoteUri','apiKey','slice','substring','GET','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','eml-format','rimraf','zip-dir','request-promise','bluebird','util','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','index','FreshsalesAccount','rawAttributes','fieldName','query'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1714,0x1c6));var _0x4171=function(_0x4fc349,_0x3fe555){_0x4fc349=_0x4fc349-0x0;var _0x1e71bc=_0x1714[_0x4fc349];return _0x1e71bc;};'use strict';var emlformat=require(_0x4171('0x0'));var rimraf=require(_0x4171('0x1'));var zipdir=require(_0x4171('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4171('0x3'));var moment=require('moment');var BPromise=require(_0x4171('0x4'));var Mustache=require('mustache');var util=require(_0x4171('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4171('0x6'));var fs=require('fs');var fs_extra=require(_0x4171('0x7'));var _=require('lodash');var squel=require(_0x4171('0x8'));var crypto=require(_0x4171('0x9'));var jsforce=require(_0x4171('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4171('0xb'));var querystring=require(_0x4171('0xc'));var Papa=require(_0x4171('0xd'));var Redis=require(_0x4171('0xe'));var authService=require(_0x4171('0xf'));var qs=require(_0x4171('0x10'));var as=require(_0x4171('0x11'));var hardwareService=require(_0x4171('0x12'));var logger=require('../../config/logger')(_0x4171('0x13'));var utils=require(_0x4171('0x14'));var config=require(_0x4171('0x15'));var licenseUtil=require(_0x4171('0x16'));var db=require(_0x4171('0x17'))['db'];var integrations=require(_0x4171('0x18'));function respondWithStatusCode(_0x2f70e3,_0x379af2){_0x379af2=_0x379af2||0xcc;return function(_0x44af03){if(_0x44af03){return _0x2f70e3['sendStatus'](_0x379af2);}return _0x2f70e3[_0x4171('0x19')](_0x379af2)[_0x4171('0x1a')]();};}function respondWithResult(_0x34fc55,_0x28d9c1){_0x28d9c1=_0x28d9c1||0xc8;return function(_0x40b1d5){if(_0x40b1d5){return _0x34fc55[_0x4171('0x19')](_0x28d9c1)[_0x4171('0x1b')](_0x40b1d5);}};}function respondWithFilteredResult(_0x2b4996,_0x25a7d3){return function(_0x5852be){if(_0x5852be){var _0x27c21f=typeof _0x25a7d3['offset']===_0x4171('0x1c')&&typeof _0x25a7d3['limit']===_0x4171('0x1c');var _0x548334=_0x5852be[_0x4171('0x1d')];var _0x419c7c=_0x27c21f?0x0:_0x25a7d3[_0x4171('0x1e')];var _0x38fcf5=_0x27c21f?_0x5852be[_0x4171('0x1d')]:_0x25a7d3[_0x4171('0x1e')]+_0x25a7d3['limit'];var _0x4b92d4;if(_0x38fcf5>=_0x548334){_0x38fcf5=_0x548334;_0x4b92d4=0xc8;}else{_0x4b92d4=0xce;}_0x2b4996[_0x4171('0x19')](_0x4b92d4);return _0x2b4996[_0x4171('0x1f')](_0x4171('0x20'),_0x419c7c+'-'+_0x38fcf5+'/'+_0x548334)[_0x4171('0x1b')](_0x5852be);}return null;};}function patchUpdates(_0x2ff4d2){return function(_0x42fd39){try{jsonpatch['apply'](_0x42fd39,_0x2ff4d2,!![]);}catch(_0x35c1e0){return BPromise[_0x4171('0x21')](_0x35c1e0);}return _0x42fd39[_0x4171('0x22')]();};}function saveUpdates(_0x4cc0d6,_0x357334){return function(_0x2266a3){if(_0x2266a3){return _0x2266a3[_0x4171('0x23')](_0x4cc0d6)[_0x4171('0x24')](function(_0x3fd96a){return _0x3fd96a;});}return null;};}function removeEntity(_0x29d474,_0x5ee5b2){return function(_0x3c647d){if(_0x3c647d){return _0x3c647d[_0x4171('0x25')]()[_0x4171('0x24')](function(){_0x29d474[_0x4171('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x136e0c,_0x32f9e1){return function(_0x332fba){if(!_0x332fba){_0x136e0c[_0x4171('0x26')](0x194);}return _0x332fba;};}function handleError(_0x358be1,_0x46aadc){_0x46aadc=_0x46aadc||0x1f4;return function(_0x231481){logger['error'](_0x231481[_0x4171('0x27')]);if(_0x231481[_0x4171('0x28')]){delete _0x231481['name'];}_0x358be1[_0x4171('0x19')](_0x46aadc)['send'](_0x231481);};}exports[_0x4171('0x29')]=function(_0x1edbad,_0x2ee392){var _0x5b66d7={},_0x2c455c={},_0xac8ef5={'count':0x0,'rows':[]};var _0x725e7a=_['map'](db[_0x4171('0x2a')][_0x4171('0x2b')],function(_0x595b59){return{'name':_0x595b59[_0x4171('0x2c')],'type':_0x595b59['type']['key']};});_0x2c455c['model']=_['map'](_0x725e7a,_0x4171('0x28'));_0x2c455c[_0x4171('0x2d')]=_[_0x4171('0x2e')](_0x1edbad[_0x4171('0x2d')]);_0x2c455c[_0x4171('0x2f')]=_['intersection'](_0x2c455c['model'],_0x2c455c[_0x4171('0x2d')]);_0x5b66d7[_0x4171('0x30')]=_[_0x4171('0x31')](_0x2c455c['model'],qs[_0x4171('0x32')](_0x1edbad[_0x4171('0x2d')][_0x4171('0x32')]));_0x5b66d7['attributes']=_0x5b66d7['attributes'][_0x4171('0x33')]?_0x5b66d7[_0x4171('0x30')]:_0x2c455c[_0x4171('0x34')];if(!_0x1edbad[_0x4171('0x2d')]['hasOwnProperty'](_0x4171('0x35'))){_0x5b66d7[_0x4171('0x36')]=qs[_0x4171('0x36')](_0x1edbad[_0x4171('0x2d')][_0x4171('0x36')]);_0x5b66d7['offset']=qs[_0x4171('0x1e')](_0x1edbad[_0x4171('0x2d')][_0x4171('0x1e')]);}_0x5b66d7['order']=qs[_0x4171('0x37')](_0x1edbad[_0x4171('0x2d')]['sort']);_0x5b66d7['where']=qs[_0x4171('0x2f')](_[_0x4171('0x38')](_0x1edbad['query'],_0x2c455c['filters']),_0x725e7a);if(_0x1edbad['query']['filter']){_0x5b66d7[_0x4171('0x39')]=_[_0x4171('0x3a')](_0x5b66d7[_0x4171('0x39')],{'$or':_[_0x4171('0x3b')](_0x725e7a,function(_0x3b4f6c){if(_0x3b4f6c['type']!==_0x4171('0x3c')){var _0x5e7570={};_0x5e7570[_0x3b4f6c[_0x4171('0x28')]]={'$like':'%'+_0x1edbad['query']['filter']+'%'};return _0x5e7570;}})});}_0x5b66d7=_[_0x4171('0x3a')]({},_0x5b66d7,_0x1edbad['options']);var _0x2de53c={'where':_0x5b66d7[_0x4171('0x39')]};return db[_0x4171('0x2a')][_0x4171('0x1d')](_0x2de53c)['then'](function(_0x9b6574){_0xac8ef5[_0x4171('0x1d')]=_0x9b6574;if(_0x1edbad['query'][_0x4171('0x3d')]){_0x5b66d7[_0x4171('0x3e')]=[{'all':!![]}];}return db[_0x4171('0x2a')][_0x4171('0x3f')](_0x5b66d7);})[_0x4171('0x24')](function(_0x3fb15c){_0xac8ef5[_0x4171('0x40')]=_0x3fb15c;return _0xac8ef5;})['then'](respondWithFilteredResult(_0x2ee392,_0x5b66d7))[_0x4171('0x41')](handleError(_0x2ee392,null));};exports[_0x4171('0x42')]=function(_0x3213b1,_0x27a9a9){var _0x47a26c={'raw':![],'where':{'id':_0x3213b1[_0x4171('0x43')]['id']}},_0x274f87={};_0x274f87[_0x4171('0x34')]=_[_0x4171('0x2e')](db['FreshsalesAccount'][_0x4171('0x2b')]);_0x274f87['query']=_[_0x4171('0x2e')](_0x3213b1['query']);_0x274f87[_0x4171('0x2f')]=_[_0x4171('0x31')](_0x274f87[_0x4171('0x34')],_0x274f87['query']);_0x47a26c[_0x4171('0x30')]=_['intersection'](_0x274f87[_0x4171('0x34')],qs[_0x4171('0x32')](_0x3213b1[_0x4171('0x2d')]['fields']));_0x47a26c['attributes']=_0x47a26c[_0x4171('0x30')][_0x4171('0x33')]?_0x47a26c[_0x4171('0x30')]:_0x274f87[_0x4171('0x34')];if(_0x3213b1['query'][_0x4171('0x3d')]){_0x47a26c[_0x4171('0x3e')]=[{'all':!![]}];}_0x47a26c=_[_0x4171('0x3a')]({},_0x47a26c,_0x3213b1['options']);return db[_0x4171('0x2a')][_0x4171('0x44')](_0x47a26c)['then'](handleEntityNotFound(_0x27a9a9,null))[_0x4171('0x24')](respondWithResult(_0x27a9a9,null))['catch'](handleError(_0x27a9a9,null));};exports['create']=function(_0x3678ee,_0x4e7971){return db['FreshsalesAccount']['create'](_0x3678ee[_0x4171('0x45')],{})['then'](respondWithResult(_0x4e7971,0xc9))['catch'](handleError(_0x4e7971,null));};exports[_0x4171('0x23')]=function(_0x5bd5d6,_0x56dbbf){if(_0x5bd5d6[_0x4171('0x45')]['id']){delete _0x5bd5d6[_0x4171('0x45')]['id'];}return db['FreshsalesAccount'][_0x4171('0x44')]({'where':{'id':_0x5bd5d6[_0x4171('0x43')]['id']}})['then'](handleEntityNotFound(_0x56dbbf,null))[_0x4171('0x24')](saveUpdates(_0x5bd5d6['body'],null))['then'](respondWithResult(_0x56dbbf,null))[_0x4171('0x41')](handleError(_0x56dbbf,null));};exports['destroy']=function(_0x22a8f1,_0x554960){return db[_0x4171('0x2a')][_0x4171('0x44')]({'where':{'id':_0x22a8f1['params']['id']}})[_0x4171('0x24')](handleEntityNotFound(_0x554960,null))[_0x4171('0x24')](removeEntity(_0x554960,null))[_0x4171('0x41')](handleError(_0x554960,null));};exports[_0x4171('0x46')]=function(_0x2e47b3,_0x1c5bc6,_0x5e155b){var _0x2f8e97={};var _0x45c019={};var _0x19f4ed;var _0x39d7fe;return db['FreshsalesAccount'][_0x4171('0x47')]({'where':{'id':_0x2e47b3[_0x4171('0x43')]['id']}})[_0x4171('0x24')](handleEntityNotFound(_0x1c5bc6,null))[_0x4171('0x24')](function(_0x27a896){if(_0x27a896){_0x19f4ed=_0x27a896;_0x45c019[_0x4171('0x34')]=_[_0x4171('0x2e')](db['FreshsalesConfiguration'][_0x4171('0x2b')]);_0x45c019[_0x4171('0x2d')]=_[_0x4171('0x2e')](_0x2e47b3['query']);_0x45c019[_0x4171('0x2f')]=_['intersection'](_0x45c019[_0x4171('0x34')],_0x45c019[_0x4171('0x2d')]);_0x2f8e97[_0x4171('0x30')]=_[_0x4171('0x31')](_0x45c019[_0x4171('0x34')],qs[_0x4171('0x32')](_0x2e47b3[_0x4171('0x2d')]['fields']));_0x2f8e97[_0x4171('0x30')]=_0x2f8e97[_0x4171('0x30')][_0x4171('0x33')]?_0x2f8e97[_0x4171('0x30')]:_0x45c019[_0x4171('0x34')];_0x2f8e97[_0x4171('0x48')]=qs[_0x4171('0x37')](_0x2e47b3[_0x4171('0x2d')][_0x4171('0x37')]);_0x2f8e97['where']=qs[_0x4171('0x2f')](_[_0x4171('0x38')](_0x2e47b3[_0x4171('0x2d')],_0x45c019[_0x4171('0x2f')]));if(_0x2e47b3[_0x4171('0x2d')]['filter']){_0x2f8e97[_0x4171('0x39')]=_[_0x4171('0x3a')](_0x2f8e97['where'],{'$or':_[_0x4171('0x3b')](_0x2f8e97['attributes'],function(_0x37b308){var _0x59f70f={};_0x59f70f[_0x37b308]={'$like':'%'+_0x2e47b3[_0x4171('0x2d')][_0x4171('0x49')]+'%'};return _0x59f70f;})});}_0x2f8e97=_[_0x4171('0x3a')]({},_0x2f8e97,_0x2e47b3[_0x4171('0x4a')]);return _0x19f4ed[_0x4171('0x46')](_0x2f8e97);}})['then'](function(_0x182b00){if(_0x182b00){_0x39d7fe=_0x182b00['length'];if(!_0x2e47b3['query']['hasOwnProperty'](_0x4171('0x35'))){_0x2f8e97['limit']=qs['limit'](_0x2e47b3[_0x4171('0x2d')][_0x4171('0x36')]);_0x2f8e97[_0x4171('0x1e')]=qs[_0x4171('0x1e')](_0x2e47b3[_0x4171('0x2d')][_0x4171('0x1e')]);}return _0x19f4ed[_0x4171('0x46')](_0x2f8e97);}})[_0x4171('0x24')](function(_0xcaef1e){if(_0xcaef1e){return _0xcaef1e?{'count':_0x39d7fe,'rows':_0xcaef1e}:null;}})[_0x4171('0x24')](respondWithResult(_0x1c5bc6,null))[_0x4171('0x41')](handleError(_0x1c5bc6,null));};exports[_0x4171('0x4b')]=function(_0x206537,_0x2497c7,_0x56b06e){if(_0x206537['body']['id']){delete _0x206537[_0x4171('0x45')]['id'];}return db['FreshsalesAccount'][_0x4171('0x47')]({'where':{'id':_0x206537[_0x4171('0x43')]['id']}})[_0x4171('0x24')](handleEntityNotFound(_0x2497c7,null))[_0x4171('0x24')](function(_0x5b0e9f){if(_0x5b0e9f){_0x206537[_0x4171('0x45')]['AccountId']=_0x5b0e9f['id'];_0x206537['body'][_0x4171('0x4c')]=integrations[_0x4171('0x4d')](_0x206537['body'][_0x4171('0x4e')],_0x206537[_0x4171('0x45')][_0x4171('0x4f')]);_0x206537[_0x4171('0x45')][_0x4171('0x50')]=integrations[_0x4171('0x51')](_0x206537[_0x4171('0x45')]['channel'],_0x206537[_0x4171('0x45')][_0x4171('0x4f')]);return db[_0x4171('0x52')]['create'](_0x206537[_0x4171('0x45')],{'include':[{'model':db[_0x4171('0x53')],'as':_0x4171('0x4c')},{'model':db[_0x4171('0x53')],'as':_0x4171('0x50')}]});}return null;})['then'](respondWithResult(_0x2497c7,null))[_0x4171('0x41')](handleError(_0x2497c7,null));};exports['getFields']=function(_0x37acf9,_0x2117c0,_0x447c6e){var _0x3954bb='';var _0x33a576='';return db[_0x4171('0x2a')][_0x4171('0x47')]({'where':{'id':_0x37acf9['params']['id']},'attributes':['id',_0x4171('0x54'),_0x4171('0x55'),_0x4171('0x56')]})[_0x4171('0x24')](handleEntityNotFound(_0x2117c0,null))[_0x4171('0x24')](function(_0x360ba6){if(_0x360ba6){_0x33a576=_0x360ba6[_0x4171('0x54')];_0x3954bb=_0x360ba6[_0x4171('0x55')];var _0x5e6477=_0x360ba6['remoteUri'][_0x4171('0x57')](-0x1);if(_0x5e6477==='/'){_0x3954bb=_0x3954bb[_0x4171('0x58')](0x0,_0x3954bb['lastIndexOf'](_0x5e6477));}return rp({'method':_0x4171('0x59'),'uri':util['format'](_0x4171('0x5a'),_0x3954bb,_0x4171('0x5b')),'headers':{'Authorization':_0x4171('0x5c')+_0x360ba6[_0x4171('0x56')]},'json':!![]});}})[_0x4171('0x24')](function(_0x301641){if(_0x301641){var _0x1bee9c=_0x301641[_0x4171('0x5d')];var _0x5e6687=![];var _0x35c60e=null;for(_0x35c60e=0x0;_0x35c60e<_0x1bee9c['length'];_0x35c60e++){if(_0x1bee9c[_0x35c60e][_0x4171('0x5e')]===_0x33a576){_0x5e6687=!![];}}if(_0x5e6687){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x4171('0x5f')});}}})[_0x4171('0x24')](respondWithResult(_0x2117c0,null))[_0x4171('0x41')](function(_0x5c5a04){var _0x2da6d9=_0x37acf9[_0x4171('0x2d')][_0x4171('0x60')]?0x1f4:_0x5c5a04[_0x4171('0x61')]||0x1f4;logger['error'](_0x4171('0x62'),_0x4171('0x63'),_0x2da6d9,JSON['stringify'](_0x5c5a04));delete _0x5c5a04[_0x4171('0x28')];if(_0x2da6d9===0x191){_0x2da6d9=0x190;}_0x2117c0[_0x4171('0x19')](_0x2da6d9)['send'](_0x37acf9[_0x4171('0x2d')][_0x4171('0x60')]?{'message':'Wrong\x20credentials','statusCode':_0x5c5a04[_0x4171('0x61')]}:_0x5c5a04);});};
\ No newline at end of file
index 4d12115..506cd9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0424=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','../../config/logger','api','moment','bluebird','path'];(function(_0x124bee,_0x2dea64){var _0x9d4d62=function(_0x49c5d9){while(--_0x49c5d9){_0x124bee['push'](_0x124bee['shift']());}};_0x9d4d62(++_0x2dea64);}(_0x0424,0x159));var _0x4042=function(_0x459a0a,_0x25c46f){_0x459a0a=_0x459a0a-0x0;var _0x4ab46c=_0x0424[_0x459a0a];return _0x4ab46c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4042('0x0'))(_0x4042('0x1'));var moment=require(_0x4042('0x2'));var BPromise=require(_0x4042('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4042('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4042('0x5'));var integrations=require(_0x4042('0x6'));module[_0x4042('0x7')]=function(_0xc0fba0,_0x3abaf1){return _0xc0fba0[_0x4042('0x8')](_0x4042('0x9'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5d58=['request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','bluebird'];(function(_0x81f000,_0x15df85){var _0x337aa2=function(_0x37f6a4){while(--_0x37f6a4){_0x81f000['push'](_0x81f000['shift']());}};_0x337aa2(++_0x15df85);}(_0x5d58,0x187));var _0x85d5=function(_0x1792ce,_0x209e4f){_0x1792ce=_0x1792ce-0x0;var _0x5acb22=_0x5d58[_0x1792ce];return _0x5acb22;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x85d5('0x4'));module[_0x85d5('0x5')]=function(_0x578fad,_0x46e7b4){return _0x578fad['define'](_0x85d5('0x6'),attributes,{'tableName':_0x85d5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ac02bcd..74309d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x3387c8,_0x54cc53){var _0x78ae0c=function(_0x4be1bf){while(--_0x4be1bf){_0x3387c8['push'](_0x3387c8['shift']());}};_0x78ae0c(++_0x54cc53);}(_0x524e,0x15e));var _0xe524=function(_0x20d70,_0x599e9d){_0x20d70=_0x20d70-0x0;var _0x5ad07d=_0x524e[_0x20d70];return _0x5ad07d;};'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
+var _0x0424=['info','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit','include','model','map','ShowFreshsalesAccount','find','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x36ba4d,_0x243b6d){var _0x50e8b7=function(_0x1f52a9){while(--_0x1f52a9){_0x36ba4d['push'](_0x36ba4d['shift']());}};_0x50e8b7(++_0x243b6d);}(_0x0424,0x159));var _0x4042=function(_0x20008a,_0x362490){_0x20008a=_0x20008a-0x0;var _0x5d0f1c=_0x0424[_0x20008a];return _0x5d0f1c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4042('0x0'));var BPromise=require(_0x4042('0x1'));var rs=require(_0x4042('0x2'));var fs=require('fs');var Redis=require(_0x4042('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4042('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4042('0x5'));var jayson=require(_0x4042('0x6'));var client=jayson[_0x4042('0x7')][_0x4042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3abaf1,_0xa5310f,_0x10ec07){return new BPromise(function(_0x5d11bf,_0x509772){return client[_0x4042('0x9')](_0x3abaf1,_0x10ec07)[_0x4042('0xa')](function(_0x103e4a){logger['info'](_0x4042('0xb'),_0xa5310f,_0x4042('0xc'));logger[_0x4042('0xd')](_0x4042('0xe'),_0xa5310f,_0x4042('0xc'),JSON[_0x4042('0xf')](_0x103e4a));if(_0x103e4a[_0x4042('0x10')]){if(_0x103e4a[_0x4042('0x10')]['code']===0x1f4){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a['error'][_0x4042('0x11')]);return _0x509772(_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);}logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);return _0x5d11bf(_0x103e4a['error'][_0x4042('0x11')]);}else{logger[_0x4042('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0xa5310f,_0x4042('0xc'));_0x5d11bf(_0x103e4a[_0x4042('0x13')][_0x4042('0x11')]);}})[_0x4042('0x14')](function(_0x31e765){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x31e765);_0x509772(_0x31e765);});});}exports[_0x4042('0x15')]=function(_0x466077){var _0x4b02d4=this;return new Promise(function(_0xe5c1ec,_0x4fe024){return db[_0x4042('0x16')]['findAll']({'raw':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x18')]===undefined?!![]:![]:!![],'where':_0x466077[_0x4042('0x17')]?_0x466077['options'][_0x4042('0x19')]||null:null,'attributes':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x1a')]||null:null,'limit':_0x466077['options']?_0x466077[_0x4042('0x17')][_0x4042('0x1b')]||null:null,'include':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x1c')]?_['map'](_0x466077[_0x4042('0x17')][_0x4042('0x1c')],function(_0x519f2c){return{'model':db[_0x519f2c[_0x4042('0x1d')]],'as':_0x519f2c['as'],'attributes':_0x519f2c['attributes'],'include':_0x519f2c[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x519f2c[_0x4042('0x1c')],function(_0x5d5c6d){return{'model':db[_0x5d5c6d[_0x4042('0x1d')]],'as':_0x5d5c6d['as'],'attributes':_0x5d5c6d[_0x4042('0x1a')],'include':_0x5d5c6d[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x5d5c6d[_0x4042('0x1c')],function(_0x52e575){return{'model':db[_0x52e575['model']],'as':_0x52e575['as'],'attributes':_0x52e575[_0x4042('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4042('0xa')](function(_0x26542c){logger[_0x4042('0x12')](_0x4042('0x15'),_0x466077);logger[_0x4042('0xd')]('GetFreshsalesAccount',_0x466077,JSON[_0x4042('0xf')](_0x26542c));_0xe5c1ec(_0x26542c);})[_0x4042('0x14')](function(_0x4a6a6e){logger[_0x4042('0x10')](_0x4042('0x15'),_0x4a6a6e[_0x4042('0x11')],_0x466077);_0x4fe024(_0x4b02d4['error'](0x1f4,_0x4a6a6e['message']));});});};exports[_0x4042('0x1f')]=function(_0x43bd1c){var _0x59773f=this;return new Promise(function(_0x3e9304,_0xc42d70){return db[_0x4042('0x16')][_0x4042('0x20')]({'raw':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')][_0x4042('0x18')]===undefined?!![]:![]:!![],'where':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['where']||null:null,'attributes':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['attributes']||null:null,'include':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['include']?_[_0x4042('0x1e')](_0x43bd1c[_0x4042('0x17')][_0x4042('0x1c')],function(_0xaa7c99){return{'model':db[_0xaa7c99[_0x4042('0x1d')]],'as':_0xaa7c99['as'],'attributes':_0xaa7c99[_0x4042('0x1a')],'include':_0xaa7c99[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0xaa7c99[_0x4042('0x1c')],function(_0x37195b){return{'model':db[_0x37195b[_0x4042('0x1d')]],'as':_0x37195b['as'],'attributes':_0x37195b[_0x4042('0x1a')],'include':_0x37195b[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x37195b[_0x4042('0x1c')],function(_0x2b5f5e){return{'model':db[_0x2b5f5e[_0x4042('0x1d')]],'as':_0x2b5f5e['as'],'attributes':_0x2b5f5e[_0x4042('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4042('0xa')](function(_0x26b7b0){logger[_0x4042('0x12')]('ShowFreshsalesAccount',_0x43bd1c);logger[_0x4042('0xd')](_0x4042('0x1f'),_0x43bd1c,JSON[_0x4042('0xf')](_0x26b7b0));_0x3e9304(_0x26b7b0);})[_0x4042('0x14')](function(_0x588932){logger[_0x4042('0x10')](_0x4042('0x1f'),_0x588932[_0x4042('0x11')],_0x43bd1c);_0xc42d70(_0x59773f[_0x4042('0x10')](0x1f4,_0x588932[_0x4042('0x11')]));});});};
\ No newline at end of file
index 78bcc7c..bd9eb89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0497=['multer','path','express','Router','fs-extra','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','getSubjects','getDescriptions','/:id/fields','post','create','put','update','delete','destroy','exports'];(function(_0x12b188,_0x37209c){var _0x8dfd31=function(_0x3d26ec){while(--_0x3d26ec){_0x12b188['push'](_0x12b188['shift']());}};_0x8dfd31(++_0x37209c);}(_0x0497,0x126));var _0x7049=function(_0x36e557,_0x582535){_0x36e557=_0x36e557-0x0;var _0x4072f7=_0x0497[_0x36e557];return _0x4072f7;};'use strict';var multer=require(_0x7049('0x0'));var util=require('util');var path=require(_0x7049('0x1'));var timeout=require('connect-timeout');var express=require(_0x7049('0x2'));var router=express[_0x7049('0x3')]();var fs_extra=require(_0x7049('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7049('0x5'));router[_0x7049('0x6')]('/',auth[_0x7049('0x7')](),controller[_0x7049('0x8')]);router['get'](_0x7049('0x9'),auth[_0x7049('0x7')](),controller[_0x7049('0xa')]);router[_0x7049('0x6')]('/:id/subjects',auth[_0x7049('0x7')](),controller[_0x7049('0xb')]);router[_0x7049('0x6')]('/:id/descriptions',auth[_0x7049('0x7')](),controller[_0x7049('0xc')]);router[_0x7049('0x6')](_0x7049('0xd'),auth[_0x7049('0x7')](),controller['getFields']);router[_0x7049('0xe')]('/',auth[_0x7049('0x7')](),controller[_0x7049('0xf')]);router[_0x7049('0x10')](_0x7049('0x9'),auth[_0x7049('0x7')](),controller[_0x7049('0x11')]);router[_0x7049('0x12')]('/:id',auth[_0x7049('0x7')](),controller[_0x7049('0x13')]);module[_0x7049('0x14')]=router;
\ No newline at end of file
+var _0xcbfc=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','/:id','get','/:id/subjects','getSubjects','getDescriptions','/:id/fields','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x1474fe,_0x467dd1){var _0x2f2839=function(_0x33ab3f){while(--_0x33ab3f){_0x1474fe['push'](_0x1474fe['shift']());}};_0x2f2839(++_0x467dd1);}(_0xcbfc,0xe0));var _0xccbf=function(_0x3c5997,_0x2b0de2){_0x3c5997=_0x3c5997-0x0;var _0x2d457d=_0xcbfc[_0x3c5997];return _0x2d457d;};'use strict';var multer=require(_0xccbf('0x0'));var util=require(_0xccbf('0x1'));var path=require(_0xccbf('0x2'));var timeout=require(_0xccbf('0x3'));var express=require(_0xccbf('0x4'));var router=express[_0xccbf('0x5')]();var fs_extra=require(_0xccbf('0x6'));var auth=require(_0xccbf('0x7'));var interaction=require(_0xccbf('0x8'));var config=require(_0xccbf('0x9'));var controller=require(_0xccbf('0xa'));router['get']('/',auth[_0xccbf('0xb')](),controller['index']);router['get'](_0xccbf('0xc'),auth[_0xccbf('0xb')](),controller['show']);router[_0xccbf('0xd')](_0xccbf('0xe'),auth['isAuthenticated'](),controller[_0xccbf('0xf')]);router[_0xccbf('0xd')]('/:id/descriptions',auth[_0xccbf('0xb')](),controller[_0xccbf('0x10')]);router[_0xccbf('0xd')](_0xccbf('0x11'),auth[_0xccbf('0xb')](),controller['getFields']);router['post']('/',auth[_0xccbf('0xb')](),controller[_0xccbf('0x12')]);router[_0xccbf('0x13')](_0xccbf('0xc'),auth[_0xccbf('0xb')](),controller[_0xccbf('0x14')]);router[_0xccbf('0x15')](_0xccbf('0xc'),auth[_0xccbf('0xb')](),controller[_0xccbf('0x16')]);module['exports']=router;
\ No newline at end of file
index e723013..bfbc6f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce6a=['exports','STRING','sequelize'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xce6a,0xad));var _0xace6=function(_0x23ae1f,_0x7f423c){_0x23ae1f=_0x23ae1f-0x0;var _0x1bb7cc=_0xce6a[_0x23ae1f];return _0x1bb7cc;};'use strict';var Sequelize=require(_0xace6('0x0'));module[_0xace6('0x1')]={'name':{'type':Sequelize[_0xace6('0x2')]},'description':{'type':Sequelize[_0xace6('0x2')]}};
\ No newline at end of file
+var _0xf9d8=['exports','STRING'];(function(_0x5aba33,_0xcdfc75){var _0x1ebf0d=function(_0x28a549){while(--_0x28a549){_0x5aba33['push'](_0x5aba33['shift']());}};_0x1ebf0d(++_0xcdfc75);}(_0xf9d8,0x120));var _0x8f9d=function(_0x1c138a,_0x33fd13){_0x1c138a=_0x1c138a-0x0;var _0xd22ce8=_0xf9d8[_0x1c138a];return _0xd22ce8;};'use strict';var Sequelize=require('sequelize');module[_0x8f9d('0x0')]={'name':{'type':Sequelize[_0x8f9d('0x1')]},'description':{'type':Sequelize[_0x8f9d('0x1')]}};
\ No newline at end of file
index ca890f5..fe02459 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb40f=['sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','FreshsalesConfiguration','includeAll','include','findAll','show','params','length','find','catch','create','body','update','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xb40f,0x89));var _0xfb40=function(_0x10d0f0,_0x1eba3d){_0x10d0f0=_0x10d0f0-0x0;var _0x93e308=_0xb40f[_0x10d0f0];return _0x93e308;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfb40('0x0'));var rp=require(_0xfb40('0x1'));var moment=require(_0xfb40('0x2'));var BPromise=require(_0xfb40('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xfb40('0x4'));var csv=require(_0xfb40('0x5'));var ejs=require(_0xfb40('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb40('0x7'));var squel=require(_0xfb40('0x8'));var crypto=require('crypto');var jsforce=require(_0xfb40('0x9'));var deskjs=require(_0xfb40('0xa'));var toCsv=require(_0xfb40('0x5'));var querystring=require(_0xfb40('0xb'));var Papa=require(_0xfb40('0xc'));var Redis=require(_0xfb40('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb40('0xe'));var logger=require(_0xfb40('0xf'))(_0xfb40('0x10'));var utils=require(_0xfb40('0x11'));var config=require(_0xfb40('0x12'));var licenseUtil=require(_0xfb40('0x13'));var db=require(_0xfb40('0x14'))['db'];function respondWithStatusCode(_0x5ee30a,_0x43bead){_0x43bead=_0x43bead||0xcc;return function(_0x498da2){if(_0x498da2){return _0x5ee30a[_0xfb40('0x15')](_0x43bead);}return _0x5ee30a[_0xfb40('0x16')](_0x43bead)[_0xfb40('0x17')]();};}function respondWithResult(_0x2d9e90,_0x17fccd){_0x17fccd=_0x17fccd||0xc8;return function(_0x445d79){if(_0x445d79){return _0x2d9e90[_0xfb40('0x16')](_0x17fccd)['json'](_0x445d79);}};}function respondWithFilteredResult(_0x44b70b,_0x207529){return function(_0xebc45e){if(_0xebc45e){var _0x1feac9=typeof _0x207529[_0xfb40('0x18')]===_0xfb40('0x19')&&typeof _0x207529['limit']===_0xfb40('0x19');var _0x5818bd=_0xebc45e[_0xfb40('0x1a')];var _0xc42d14=_0x1feac9?0x0:_0x207529[_0xfb40('0x18')];var _0x486159=_0x1feac9?_0xebc45e['count']:_0x207529['offset']+_0x207529[_0xfb40('0x1b')];var _0x3ffe87;if(_0x486159>=_0x5818bd){_0x486159=_0x5818bd;_0x3ffe87=0xc8;}else{_0x3ffe87=0xce;}_0x44b70b[_0xfb40('0x16')](_0x3ffe87);return _0x44b70b[_0xfb40('0x1c')](_0xfb40('0x1d'),_0xc42d14+'-'+_0x486159+'/'+_0x5818bd)[_0xfb40('0x1e')](_0xebc45e);}return null;};}function patchUpdates(_0x2eb787){return function(_0x333c88){try{jsonpatch[_0xfb40('0x1f')](_0x333c88,_0x2eb787,!![]);}catch(_0x102ae1){return BPromise[_0xfb40('0x20')](_0x102ae1);}return _0x333c88[_0xfb40('0x21')]();};}function saveUpdates(_0x2e9a6b,_0x3ce2a2){return function(_0x3a4c09){if(_0x3a4c09){return _0x3a4c09['update'](_0x2e9a6b)[_0xfb40('0x22')](function(_0x477bec){return _0x477bec;});}return null;};}function removeEntity(_0xfc423b,_0x5aa3bd){return function(_0x57579f){if(_0x57579f){return _0x57579f[_0xfb40('0x23')]()['then'](function(){_0xfc423b[_0xfb40('0x16')](0xcc)[_0xfb40('0x17')]();});}};}function handleEntityNotFound(_0x4b51b8,_0x140d2c){return function(_0x47ab03){if(!_0x47ab03){_0x4b51b8[_0xfb40('0x15')](0x194);}return _0x47ab03;};}function handleError(_0x169c60,_0x104efb){_0x104efb=_0x104efb||0x1f4;return function(_0x318246){logger[_0xfb40('0x24')](_0x318246['stack']);if(_0x318246['name']){delete _0x318246[_0xfb40('0x25')];}_0x169c60[_0xfb40('0x16')](_0x104efb)[_0xfb40('0x26')](_0x318246);};}exports[_0xfb40('0x27')]=function(_0x45a832,_0x30fd49){var _0x40b34f={},_0x5da976={},_0x4fe9d1={'count':0x0,'rows':[]};var _0x3b8a71=_[_0xfb40('0x28')](db['FreshsalesConfiguration'][_0xfb40('0x29')],function(_0x470bd7){return{'name':_0x470bd7[_0xfb40('0x2a')],'type':_0x470bd7[_0xfb40('0x2b')][_0xfb40('0x2c')]};});_0x5da976['model']=_[_0xfb40('0x28')](_0x3b8a71,_0xfb40('0x25'));_0x5da976['query']=_[_0xfb40('0x2d')](_0x45a832[_0xfb40('0x2e')]);_0x5da976[_0xfb40('0x2f')]=_['intersection'](_0x5da976['model'],_0x5da976[_0xfb40('0x2e')]);_0x40b34f[_0xfb40('0x30')]=_[_0xfb40('0x31')](_0x5da976[_0xfb40('0x32')],qs[_0xfb40('0x33')](_0x45a832[_0xfb40('0x2e')]['fields']));_0x40b34f[_0xfb40('0x30')]=_0x40b34f['attributes']['length']?_0x40b34f[_0xfb40('0x30')]:_0x5da976['model'];if(!_0x45a832[_0xfb40('0x2e')][_0xfb40('0x34')](_0xfb40('0x35'))){_0x40b34f['limit']=qs[_0xfb40('0x1b')](_0x45a832[_0xfb40('0x2e')]['limit']);_0x40b34f[_0xfb40('0x18')]=qs[_0xfb40('0x18')](_0x45a832[_0xfb40('0x2e')]['offset']);}_0x40b34f[_0xfb40('0x36')]=qs[_0xfb40('0x37')](_0x45a832[_0xfb40('0x2e')]['sort']);_0x40b34f['where']=qs[_0xfb40('0x2f')](_[_0xfb40('0x38')](_0x45a832[_0xfb40('0x2e')],_0x5da976['filters']),_0x3b8a71);if(_0x45a832['query'][_0xfb40('0x39')]){_0x40b34f[_0xfb40('0x3a')]=_['merge'](_0x40b34f[_0xfb40('0x3a')],{'$or':_[_0xfb40('0x28')](_0x3b8a71,function(_0x355569){if(_0x355569['type']!==_0xfb40('0x3b')){var _0x5d4e72={};_0x5d4e72[_0x355569[_0xfb40('0x25')]]={'$like':'%'+_0x45a832[_0xfb40('0x2e')][_0xfb40('0x39')]+'%'};return _0x5d4e72;}})});}_0x40b34f=_[_0xfb40('0x3c')]({},_0x40b34f,_0x45a832[_0xfb40('0x3d')]);var _0x57e5ea={'where':_0x40b34f['where']};return db[_0xfb40('0x3e')][_0xfb40('0x1a')](_0x57e5ea)[_0xfb40('0x22')](function(_0xf36231){_0x4fe9d1['count']=_0xf36231;if(_0x45a832[_0xfb40('0x2e')][_0xfb40('0x3f')]){_0x40b34f[_0xfb40('0x40')]=[{'all':!![]}];}return db[_0xfb40('0x3e')][_0xfb40('0x41')](_0x40b34f);})[_0xfb40('0x22')](function(_0x56ec8c){_0x4fe9d1['rows']=_0x56ec8c;return _0x4fe9d1;})[_0xfb40('0x22')](respondWithFilteredResult(_0x30fd49,_0x40b34f))['catch'](handleError(_0x30fd49,null));};exports[_0xfb40('0x42')]=function(_0x393f2c,_0x381cb1){var _0x22b4a0={'raw':![],'where':{'id':_0x393f2c[_0xfb40('0x43')]['id']}},_0x5eef25={};_0x5eef25[_0xfb40('0x32')]=_[_0xfb40('0x2d')](db[_0xfb40('0x3e')][_0xfb40('0x29')]);_0x5eef25[_0xfb40('0x2e')]=_[_0xfb40('0x2d')](_0x393f2c[_0xfb40('0x2e')]);_0x5eef25[_0xfb40('0x2f')]=_['intersection'](_0x5eef25[_0xfb40('0x32')],_0x5eef25[_0xfb40('0x2e')]);_0x22b4a0['attributes']=_['intersection'](_0x5eef25[_0xfb40('0x32')],qs['fields'](_0x393f2c[_0xfb40('0x2e')][_0xfb40('0x33')]));_0x22b4a0[_0xfb40('0x30')]=_0x22b4a0[_0xfb40('0x30')][_0xfb40('0x44')]?_0x22b4a0['attributes']:_0x5eef25[_0xfb40('0x32')];if(_0x393f2c[_0xfb40('0x2e')][_0xfb40('0x3f')]){_0x22b4a0[_0xfb40('0x40')]=[{'all':!![]}];}_0x22b4a0=_[_0xfb40('0x3c')]({},_0x22b4a0,_0x393f2c[_0xfb40('0x3d')]);return db['FreshsalesConfiguration'][_0xfb40('0x45')](_0x22b4a0)[_0xfb40('0x22')](handleEntityNotFound(_0x381cb1,null))['then'](respondWithResult(_0x381cb1,null))[_0xfb40('0x46')](handleError(_0x381cb1,null));};exports[_0xfb40('0x47')]=function(_0xcbb65d,_0x5e82cb){return db['FreshsalesConfiguration'][_0xfb40('0x47')](_0xcbb65d[_0xfb40('0x48')],{})[_0xfb40('0x22')](respondWithResult(_0x5e82cb,0xc9))[_0xfb40('0x46')](handleError(_0x5e82cb,null));};exports[_0xfb40('0x49')]=function(_0x4f4a6d,_0x4dedd6){if(_0x4f4a6d[_0xfb40('0x48')]['id']){delete _0x4f4a6d[_0xfb40('0x48')]['id'];}return db[_0xfb40('0x3e')][_0xfb40('0x45')]({'where':{'id':_0x4f4a6d[_0xfb40('0x43')]['id']}})[_0xfb40('0x22')](handleEntityNotFound(_0x4dedd6,null))[_0xfb40('0x22')](saveUpdates(_0x4f4a6d[_0xfb40('0x48')],null))[_0xfb40('0x22')](respondWithResult(_0x4dedd6,null))[_0xfb40('0x46')](handleError(_0x4dedd6,null));};exports[_0xfb40('0x23')]=function(_0x1f7591,_0x1d803a){return db[_0xfb40('0x3e')][_0xfb40('0x45')]({'where':{'id':_0x1f7591[_0xfb40('0x43')]['id']}})[_0xfb40('0x22')](handleEntityNotFound(_0x1d803a,null))['then'](removeEntity(_0x1d803a,null))[_0xfb40('0x46')](handleError(_0x1d803a,null));};exports[_0xfb40('0x4a')]=function(_0x413af7,_0x3aec73,_0x28b46d){var _0x1f348e={};var _0x2e0762={};var _0x160957;var _0x19dd5f;return db[_0xfb40('0x3e')][_0xfb40('0x4b')]({'where':{'id':_0x413af7['params']['id']}})[_0xfb40('0x22')](handleEntityNotFound(_0x3aec73,null))[_0xfb40('0x22')](function(_0x2c0f0b){if(_0x2c0f0b){_0x160957=_0x2c0f0b;_0x2e0762[_0xfb40('0x32')]=_['keys'](db[_0xfb40('0x4c')][_0xfb40('0x29')]);_0x2e0762['query']=_['keys'](_0x413af7[_0xfb40('0x2e')]);_0x2e0762[_0xfb40('0x2f')]=_['intersection'](_0x2e0762[_0xfb40('0x32')],_0x2e0762[_0xfb40('0x2e')]);_0x1f348e[_0xfb40('0x30')]=_[_0xfb40('0x31')](_0x2e0762['model'],qs[_0xfb40('0x33')](_0x413af7[_0xfb40('0x2e')][_0xfb40('0x33')]));_0x1f348e[_0xfb40('0x30')]=_0x1f348e['attributes']['length']?_0x1f348e['attributes']:_0x2e0762['model'];_0x1f348e[_0xfb40('0x36')]=qs[_0xfb40('0x37')](_0x413af7[_0xfb40('0x2e')][_0xfb40('0x37')]);_0x1f348e['where']=qs['filters'](_[_0xfb40('0x38')](_0x413af7[_0xfb40('0x2e')],_0x2e0762[_0xfb40('0x2f')]));if(_0x413af7[_0xfb40('0x2e')]['filter']){_0x1f348e[_0xfb40('0x3a')]=_['merge'](_0x1f348e['where'],{'$or':_[_0xfb40('0x28')](_0x1f348e['attributes'],function(_0x17b5ff){var _0x51e5ce={};_0x51e5ce[_0x17b5ff]={'$like':'%'+_0x413af7[_0xfb40('0x2e')][_0xfb40('0x39')]+'%'};return _0x51e5ce;})});}_0x1f348e=_[_0xfb40('0x3c')]({},_0x1f348e,_0x413af7['options']);return _0x160957[_0xfb40('0x4a')](_0x1f348e);}})[_0xfb40('0x22')](function(_0x45f21b){if(_0x45f21b){_0x19dd5f=_0x45f21b['length'];if(!_0x413af7[_0xfb40('0x2e')]['hasOwnProperty'](_0xfb40('0x35'))){_0x1f348e[_0xfb40('0x1b')]=qs[_0xfb40('0x1b')](_0x413af7[_0xfb40('0x2e')][_0xfb40('0x1b')]);_0x1f348e[_0xfb40('0x18')]=qs['offset'](_0x413af7['query'][_0xfb40('0x18')]);}return _0x160957[_0xfb40('0x4a')](_0x1f348e);}})[_0xfb40('0x22')](function(_0x54fffc){if(_0x54fffc){return _0x54fffc?{'count':_0x19dd5f,'rows':_0x54fffc}:null;}})['then'](respondWithResult(_0x3aec73,null))['catch'](handleError(_0x3aec73,null));};exports[_0xfb40('0x4d')]=function(_0x4391e9,_0x36bda6,_0x328be1){var _0x152864={};var _0x4026c4={};var _0x39363d;var _0x1f0b7d;return db[_0xfb40('0x3e')][_0xfb40('0x4b')]({'where':{'id':_0x4391e9[_0xfb40('0x43')]['id']}})['then'](handleEntityNotFound(_0x36bda6,null))[_0xfb40('0x22')](function(_0x491e8f){if(_0x491e8f){_0x39363d=_0x491e8f;_0x4026c4[_0xfb40('0x32')]=_[_0xfb40('0x2d')](db[_0xfb40('0x4c')]['rawAttributes']);_0x4026c4[_0xfb40('0x2e')]=_[_0xfb40('0x2d')](_0x4391e9[_0xfb40('0x2e')]);_0x4026c4[_0xfb40('0x2f')]=_[_0xfb40('0x31')](_0x4026c4['model'],_0x4026c4['query']);_0x152864[_0xfb40('0x30')]=_[_0xfb40('0x31')](_0x4026c4[_0xfb40('0x32')],qs[_0xfb40('0x33')](_0x4391e9[_0xfb40('0x2e')]['fields']));_0x152864[_0xfb40('0x30')]=_0x152864[_0xfb40('0x30')][_0xfb40('0x44')]?_0x152864[_0xfb40('0x30')]:_0x4026c4[_0xfb40('0x32')];_0x152864[_0xfb40('0x36')]=qs[_0xfb40('0x37')](_0x4391e9[_0xfb40('0x2e')][_0xfb40('0x37')]);_0x152864[_0xfb40('0x3a')]=qs[_0xfb40('0x2f')](_['pick'](_0x4391e9[_0xfb40('0x2e')],_0x4026c4[_0xfb40('0x2f')]));if(_0x4391e9['query'][_0xfb40('0x39')]){_0x152864['where']=_[_0xfb40('0x3c')](_0x152864[_0xfb40('0x3a')],{'$or':_['map'](_0x152864[_0xfb40('0x30')],function(_0x405652){var _0x30bd02={};_0x30bd02[_0x405652]={'$like':'%'+_0x4391e9[_0xfb40('0x2e')][_0xfb40('0x39')]+'%'};return _0x30bd02;})});}_0x152864=_[_0xfb40('0x3c')]({},_0x152864,_0x4391e9['options']);return _0x39363d[_0xfb40('0x4d')](_0x152864);}})[_0xfb40('0x22')](function(_0x5a5594){if(_0x5a5594){_0x1f0b7d=_0x5a5594[_0xfb40('0x44')];if(!_0x4391e9['query']['hasOwnProperty']('nolimit')){_0x152864['limit']=qs[_0xfb40('0x1b')](_0x4391e9[_0xfb40('0x2e')][_0xfb40('0x1b')]);_0x152864[_0xfb40('0x18')]=qs[_0xfb40('0x18')](_0x4391e9[_0xfb40('0x2e')][_0xfb40('0x18')]);}return _0x39363d[_0xfb40('0x4d')](_0x152864);}})['then'](function(_0x40cdfa){if(_0x40cdfa){return _0x40cdfa?{'count':_0x1f0b7d,'rows':_0x40cdfa}:null;}})[_0xfb40('0x22')](respondWithResult(_0x36bda6,null))['catch'](handleError(_0x36bda6,null));};exports[_0xfb40('0x4e')]=function(_0x4f6b19,_0x4eb4c6,_0x3ef429){var _0xf16f={};var _0x55fd8b={};var _0x14f63e;var _0x2f7d62;return db[_0xfb40('0x3e')]['findOne']({'where':{'id':_0x4f6b19[_0xfb40('0x43')]['id']}})[_0xfb40('0x22')](handleEntityNotFound(_0x4eb4c6,null))[_0xfb40('0x22')](function(_0x174538){if(_0x174538){_0x14f63e=_0x174538;_0x55fd8b['model']=_[_0xfb40('0x2d')](db['FreshsalesField']['rawAttributes']);_0x55fd8b[_0xfb40('0x2e')]=_[_0xfb40('0x2d')](_0x4f6b19[_0xfb40('0x2e')]);_0x55fd8b[_0xfb40('0x2f')]=_[_0xfb40('0x31')](_0x55fd8b[_0xfb40('0x32')],_0x55fd8b[_0xfb40('0x2e')]);_0xf16f[_0xfb40('0x30')]=_[_0xfb40('0x31')](_0x55fd8b[_0xfb40('0x32')],qs[_0xfb40('0x33')](_0x4f6b19[_0xfb40('0x2e')]['fields']));_0xf16f['attributes']=_0xf16f[_0xfb40('0x30')][_0xfb40('0x44')]?_0xf16f[_0xfb40('0x30')]:_0x55fd8b['model'];_0xf16f[_0xfb40('0x36')]=qs[_0xfb40('0x37')](_0x4f6b19[_0xfb40('0x2e')][_0xfb40('0x37')]);_0xf16f[_0xfb40('0x3a')]=qs['filters'](_[_0xfb40('0x38')](_0x4f6b19[_0xfb40('0x2e')],_0x55fd8b['filters']));if(_0x4f6b19[_0xfb40('0x2e')][_0xfb40('0x39')]){_0xf16f['where']=_[_0xfb40('0x3c')](_0xf16f[_0xfb40('0x3a')],{'$or':_[_0xfb40('0x28')](_0xf16f['attributes'],function(_0x542ebf){var _0x3427ec={};_0x3427ec[_0x542ebf]={'$like':'%'+_0x4f6b19['query'][_0xfb40('0x39')]+'%'};return _0x3427ec;})});}_0xf16f=_['merge']({},_0xf16f,_0x4f6b19[_0xfb40('0x3d')]);return _0x14f63e[_0xfb40('0x4e')](_0xf16f);}})[_0xfb40('0x22')](function(_0x2ebf6e){if(_0x2ebf6e){_0x2f7d62=_0x2ebf6e['length'];if(!_0x4f6b19[_0xfb40('0x2e')][_0xfb40('0x34')](_0xfb40('0x35'))){_0xf16f[_0xfb40('0x1b')]=qs['limit'](_0x4f6b19[_0xfb40('0x2e')][_0xfb40('0x1b')]);_0xf16f[_0xfb40('0x18')]=qs[_0xfb40('0x18')](_0x4f6b19[_0xfb40('0x2e')][_0xfb40('0x18')]);}return _0x14f63e[_0xfb40('0x4e')](_0xf16f);}})['then'](function(_0x210e74){if(_0x210e74){return _0x210e74?{'count':_0x2f7d62,'rows':_0x210e74}:null;}})['then'](respondWithResult(_0x4eb4c6,null))[_0xfb40('0x46')](handleError(_0x4eb4c6,null));};
\ No newline at end of file
+var _0x40a4=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','name','index','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','body','getSubjects','findOne','FreshsalesField','sort','getDescriptions','pick','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x40a4,0x12c));var _0x440a=function(_0x44d22f,_0xc2db67){_0x44d22f=_0x44d22f-0x0;var _0x2851d9=_0x40a4[_0x44d22f];return _0x2851d9;};'use strict';var emlformat=require(_0x440a('0x0'));var rimraf=require(_0x440a('0x1'));var zipdir=require(_0x440a('0x2'));var jsonpatch=require(_0x440a('0x3'));var rp=require(_0x440a('0x4'));var moment=require(_0x440a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x440a('0x6'));var util=require(_0x440a('0x7'));var path=require('path');var sox=require(_0x440a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x440a('0x9'));var squel=require(_0x440a('0xa'));var crypto=require('crypto');var jsforce=require(_0x440a('0xb'));var deskjs=require(_0x440a('0xc'));var toCsv=require(_0x440a('0xd'));var querystring=require(_0x440a('0xe'));var Papa=require(_0x440a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x440a('0x10'));var as=require(_0x440a('0x11'));var hardwareService=require(_0x440a('0x12'));var logger=require(_0x440a('0x13'))(_0x440a('0x14'));var utils=require(_0x440a('0x15'));var config=require(_0x440a('0x16'));var licenseUtil=require(_0x440a('0x17'));var db=require(_0x440a('0x18'))['db'];function respondWithStatusCode(_0x293fbe,_0x3d5bb1){_0x3d5bb1=_0x3d5bb1||0xcc;return function(_0x8cdb37){if(_0x8cdb37){return _0x293fbe[_0x440a('0x19')](_0x3d5bb1);}return _0x293fbe[_0x440a('0x1a')](_0x3d5bb1)[_0x440a('0x1b')]();};}function respondWithResult(_0x11f86b,_0x22b57f){_0x22b57f=_0x22b57f||0xc8;return function(_0x190463){if(_0x190463){return _0x11f86b[_0x440a('0x1a')](_0x22b57f)['json'](_0x190463);}};}function respondWithFilteredResult(_0x1b7f90,_0x308045){return function(_0x3acc3a){if(_0x3acc3a){var _0x1478d0=typeof _0x308045[_0x440a('0x1c')]===_0x440a('0x1d')&&typeof _0x308045['limit']===_0x440a('0x1d');var _0x2df1db=_0x3acc3a['count'];var _0x508959=_0x1478d0?0x0:_0x308045['offset'];var _0x3c0408=_0x1478d0?_0x3acc3a[_0x440a('0x1e')]:_0x308045[_0x440a('0x1c')]+_0x308045[_0x440a('0x1f')];var _0x5741c9;if(_0x3c0408>=_0x2df1db){_0x3c0408=_0x2df1db;_0x5741c9=0xc8;}else{_0x5741c9=0xce;}_0x1b7f90[_0x440a('0x1a')](_0x5741c9);return _0x1b7f90[_0x440a('0x20')](_0x440a('0x21'),_0x508959+'-'+_0x3c0408+'/'+_0x2df1db)['json'](_0x3acc3a);}return null;};}function patchUpdates(_0x277d78){return function(_0x1f871c){try{jsonpatch['apply'](_0x1f871c,_0x277d78,!![]);}catch(_0x4840e2){return BPromise[_0x440a('0x22')](_0x4840e2);}return _0x1f871c['save']();};}function saveUpdates(_0x6ecba1,_0x42f5a7){return function(_0x10d845){if(_0x10d845){return _0x10d845[_0x440a('0x23')](_0x6ecba1)[_0x440a('0x24')](function(_0x5a3481){return _0x5a3481;});}return null;};}function removeEntity(_0x1efdc0,_0x22e786){return function(_0x40394c){if(_0x40394c){return _0x40394c[_0x440a('0x25')]()[_0x440a('0x24')](function(){_0x1efdc0[_0x440a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3829a7,_0x350add){return function(_0x581b0d){if(!_0x581b0d){_0x3829a7['sendStatus'](0x194);}return _0x581b0d;};}function handleError(_0x49628a,_0x2a3fa7){_0x2a3fa7=_0x2a3fa7||0x1f4;return function(_0x1d3316){logger[_0x440a('0x26')](_0x1d3316['stack']);if(_0x1d3316['name']){delete _0x1d3316[_0x440a('0x27')];}_0x49628a[_0x440a('0x1a')](_0x2a3fa7)['send'](_0x1d3316);};}exports[_0x440a('0x28')]=function(_0xa31285,_0x14a794){var _0xc7e608={},_0x40ed5b={},_0x5edc7d={'count':0x0,'rows':[]};var _0x4781e3=_['map'](db[_0x440a('0x29')][_0x440a('0x2a')],function(_0x5423cf){return{'name':_0x5423cf[_0x440a('0x2b')],'type':_0x5423cf[_0x440a('0x2c')][_0x440a('0x2d')]};});_0x40ed5b[_0x440a('0x2e')]=_[_0x440a('0x2f')](_0x4781e3,_0x440a('0x27'));_0x40ed5b[_0x440a('0x30')]=_[_0x440a('0x31')](_0xa31285[_0x440a('0x30')]);_0x40ed5b[_0x440a('0x32')]=_[_0x440a('0x33')](_0x40ed5b['model'],_0x40ed5b['query']);_0xc7e608[_0x440a('0x34')]=_[_0x440a('0x33')](_0x40ed5b[_0x440a('0x2e')],qs[_0x440a('0x35')](_0xa31285[_0x440a('0x30')][_0x440a('0x35')]));_0xc7e608[_0x440a('0x34')]=_0xc7e608[_0x440a('0x34')]['length']?_0xc7e608[_0x440a('0x34')]:_0x40ed5b[_0x440a('0x2e')];if(!_0xa31285['query'][_0x440a('0x36')](_0x440a('0x37'))){_0xc7e608[_0x440a('0x1f')]=qs['limit'](_0xa31285['query'][_0x440a('0x1f')]);_0xc7e608[_0x440a('0x1c')]=qs[_0x440a('0x1c')](_0xa31285[_0x440a('0x30')]['offset']);}_0xc7e608[_0x440a('0x38')]=qs['sort'](_0xa31285[_0x440a('0x30')]['sort']);_0xc7e608['where']=qs['filters'](_['pick'](_0xa31285[_0x440a('0x30')],_0x40ed5b[_0x440a('0x32')]),_0x4781e3);if(_0xa31285[_0x440a('0x30')][_0x440a('0x39')]){_0xc7e608[_0x440a('0x3a')]=_[_0x440a('0x3b')](_0xc7e608[_0x440a('0x3a')],{'$or':_[_0x440a('0x2f')](_0x4781e3,function(_0x3a4def){if(_0x3a4def[_0x440a('0x2c')]!==_0x440a('0x3c')){var _0x529a76={};_0x529a76[_0x3a4def[_0x440a('0x27')]]={'$like':'%'+_0xa31285[_0x440a('0x30')][_0x440a('0x39')]+'%'};return _0x529a76;}})});}_0xc7e608=_[_0x440a('0x3b')]({},_0xc7e608,_0xa31285[_0x440a('0x3d')]);var _0xf667bd={'where':_0xc7e608[_0x440a('0x3a')]};return db[_0x440a('0x29')][_0x440a('0x1e')](_0xf667bd)[_0x440a('0x24')](function(_0xba268b){_0x5edc7d[_0x440a('0x1e')]=_0xba268b;if(_0xa31285['query'][_0x440a('0x3e')]){_0xc7e608[_0x440a('0x3f')]=[{'all':!![]}];}return db[_0x440a('0x29')]['findAll'](_0xc7e608);})[_0x440a('0x24')](function(_0x27f528){_0x5edc7d[_0x440a('0x40')]=_0x27f528;return _0x5edc7d;})[_0x440a('0x24')](respondWithFilteredResult(_0x14a794,_0xc7e608))[_0x440a('0x41')](handleError(_0x14a794,null));};exports[_0x440a('0x42')]=function(_0x5d4beb,_0x1b29ad){var _0x2eb7ac={'raw':![],'where':{'id':_0x5d4beb[_0x440a('0x43')]['id']}},_0x1ecfc5={};_0x1ecfc5[_0x440a('0x2e')]=_[_0x440a('0x31')](db['FreshsalesConfiguration'][_0x440a('0x2a')]);_0x1ecfc5[_0x440a('0x30')]=_[_0x440a('0x31')](_0x5d4beb['query']);_0x1ecfc5[_0x440a('0x32')]=_[_0x440a('0x33')](_0x1ecfc5['model'],_0x1ecfc5['query']);_0x2eb7ac['attributes']=_[_0x440a('0x33')](_0x1ecfc5['model'],qs[_0x440a('0x35')](_0x5d4beb[_0x440a('0x30')][_0x440a('0x35')]));_0x2eb7ac['attributes']=_0x2eb7ac['attributes'][_0x440a('0x44')]?_0x2eb7ac[_0x440a('0x34')]:_0x1ecfc5[_0x440a('0x2e')];if(_0x5d4beb[_0x440a('0x30')][_0x440a('0x3e')]){_0x2eb7ac[_0x440a('0x3f')]=[{'all':!![]}];}_0x2eb7ac=_['merge']({},_0x2eb7ac,_0x5d4beb[_0x440a('0x3d')]);return db[_0x440a('0x29')][_0x440a('0x45')](_0x2eb7ac)[_0x440a('0x24')](handleEntityNotFound(_0x1b29ad,null))[_0x440a('0x24')](respondWithResult(_0x1b29ad,null))['catch'](handleError(_0x1b29ad,null));};exports['create']=function(_0x1c03ed,_0x3e254c){return db[_0x440a('0x29')][_0x440a('0x46')](_0x1c03ed[_0x440a('0x47')],{})[_0x440a('0x24')](respondWithResult(_0x3e254c,0xc9))['catch'](handleError(_0x3e254c,null));};exports[_0x440a('0x23')]=function(_0x29d83f,_0x923f0){if(_0x29d83f[_0x440a('0x47')]['id']){delete _0x29d83f[_0x440a('0x47')]['id'];}return db['FreshsalesConfiguration'][_0x440a('0x45')]({'where':{'id':_0x29d83f[_0x440a('0x43')]['id']}})[_0x440a('0x24')](handleEntityNotFound(_0x923f0,null))[_0x440a('0x24')](saveUpdates(_0x29d83f[_0x440a('0x47')],null))[_0x440a('0x24')](respondWithResult(_0x923f0,null))['catch'](handleError(_0x923f0,null));};exports['destroy']=function(_0x1d6eef,_0x7126bb){return db[_0x440a('0x29')][_0x440a('0x45')]({'where':{'id':_0x1d6eef[_0x440a('0x43')]['id']}})[_0x440a('0x24')](handleEntityNotFound(_0x7126bb,null))[_0x440a('0x24')](removeEntity(_0x7126bb,null))[_0x440a('0x41')](handleError(_0x7126bb,null));};exports[_0x440a('0x48')]=function(_0x3becc5,_0x1b0f9e,_0xcf226f){var _0x1f681d={};var _0x3e1f6c={};var _0x9e8128;var _0x3e41b1;return db['FreshsalesConfiguration'][_0x440a('0x49')]({'where':{'id':_0x3becc5['params']['id']}})[_0x440a('0x24')](handleEntityNotFound(_0x1b0f9e,null))[_0x440a('0x24')](function(_0x371696){if(_0x371696){_0x9e8128=_0x371696;_0x3e1f6c[_0x440a('0x2e')]=_[_0x440a('0x31')](db[_0x440a('0x4a')][_0x440a('0x2a')]);_0x3e1f6c[_0x440a('0x30')]=_['keys'](_0x3becc5[_0x440a('0x30')]);_0x3e1f6c[_0x440a('0x32')]=_['intersection'](_0x3e1f6c[_0x440a('0x2e')],_0x3e1f6c[_0x440a('0x30')]);_0x1f681d[_0x440a('0x34')]=_[_0x440a('0x33')](_0x3e1f6c['model'],qs[_0x440a('0x35')](_0x3becc5[_0x440a('0x30')][_0x440a('0x35')]));_0x1f681d[_0x440a('0x34')]=_0x1f681d['attributes']['length']?_0x1f681d[_0x440a('0x34')]:_0x3e1f6c[_0x440a('0x2e')];_0x1f681d[_0x440a('0x38')]=qs[_0x440a('0x4b')](_0x3becc5[_0x440a('0x30')]['sort']);_0x1f681d[_0x440a('0x3a')]=qs['filters'](_['pick'](_0x3becc5[_0x440a('0x30')],_0x3e1f6c[_0x440a('0x32')]));if(_0x3becc5[_0x440a('0x30')][_0x440a('0x39')]){_0x1f681d[_0x440a('0x3a')]=_[_0x440a('0x3b')](_0x1f681d[_0x440a('0x3a')],{'$or':_[_0x440a('0x2f')](_0x1f681d[_0x440a('0x34')],function(_0x5929de){var _0x1a4616={};_0x1a4616[_0x5929de]={'$like':'%'+_0x3becc5[_0x440a('0x30')][_0x440a('0x39')]+'%'};return _0x1a4616;})});}_0x1f681d=_[_0x440a('0x3b')]({},_0x1f681d,_0x3becc5[_0x440a('0x3d')]);return _0x9e8128['getSubjects'](_0x1f681d);}})[_0x440a('0x24')](function(_0x46a600){if(_0x46a600){_0x3e41b1=_0x46a600['length'];if(!_0x3becc5[_0x440a('0x30')][_0x440a('0x36')]('nolimit')){_0x1f681d['limit']=qs['limit'](_0x3becc5[_0x440a('0x30')][_0x440a('0x1f')]);_0x1f681d[_0x440a('0x1c')]=qs[_0x440a('0x1c')](_0x3becc5[_0x440a('0x30')][_0x440a('0x1c')]);}return _0x9e8128['getSubjects'](_0x1f681d);}})[_0x440a('0x24')](function(_0x288730){if(_0x288730){return _0x288730?{'count':_0x3e41b1,'rows':_0x288730}:null;}})[_0x440a('0x24')](respondWithResult(_0x1b0f9e,null))['catch'](handleError(_0x1b0f9e,null));};exports[_0x440a('0x4c')]=function(_0x401009,_0x146335,_0x8d4836){var _0x25f3d7={};var _0x5e9bf0={};var _0x25179c;var _0x1a0513;return db[_0x440a('0x29')][_0x440a('0x49')]({'where':{'id':_0x401009['params']['id']}})[_0x440a('0x24')](handleEntityNotFound(_0x146335,null))[_0x440a('0x24')](function(_0x22e535){if(_0x22e535){_0x25179c=_0x22e535;_0x5e9bf0[_0x440a('0x2e')]=_[_0x440a('0x31')](db[_0x440a('0x4a')][_0x440a('0x2a')]);_0x5e9bf0[_0x440a('0x30')]=_[_0x440a('0x31')](_0x401009[_0x440a('0x30')]);_0x5e9bf0[_0x440a('0x32')]=_['intersection'](_0x5e9bf0['model'],_0x5e9bf0[_0x440a('0x30')]);_0x25f3d7['attributes']=_[_0x440a('0x33')](_0x5e9bf0[_0x440a('0x2e')],qs[_0x440a('0x35')](_0x401009[_0x440a('0x30')][_0x440a('0x35')]));_0x25f3d7[_0x440a('0x34')]=_0x25f3d7['attributes'][_0x440a('0x44')]?_0x25f3d7[_0x440a('0x34')]:_0x5e9bf0['model'];_0x25f3d7[_0x440a('0x38')]=qs['sort'](_0x401009[_0x440a('0x30')][_0x440a('0x4b')]);_0x25f3d7[_0x440a('0x3a')]=qs[_0x440a('0x32')](_[_0x440a('0x4d')](_0x401009['query'],_0x5e9bf0['filters']));if(_0x401009[_0x440a('0x30')][_0x440a('0x39')]){_0x25f3d7[_0x440a('0x3a')]=_['merge'](_0x25f3d7[_0x440a('0x3a')],{'$or':_[_0x440a('0x2f')](_0x25f3d7[_0x440a('0x34')],function(_0x11e8c8){var _0x4f14ed={};_0x4f14ed[_0x11e8c8]={'$like':'%'+_0x401009[_0x440a('0x30')][_0x440a('0x39')]+'%'};return _0x4f14ed;})});}_0x25f3d7=_[_0x440a('0x3b')]({},_0x25f3d7,_0x401009[_0x440a('0x3d')]);return _0x25179c[_0x440a('0x4c')](_0x25f3d7);}})[_0x440a('0x24')](function(_0x532a1c){if(_0x532a1c){_0x1a0513=_0x532a1c[_0x440a('0x44')];if(!_0x401009[_0x440a('0x30')][_0x440a('0x36')](_0x440a('0x37'))){_0x25f3d7['limit']=qs[_0x440a('0x1f')](_0x401009[_0x440a('0x30')][_0x440a('0x1f')]);_0x25f3d7[_0x440a('0x1c')]=qs[_0x440a('0x1c')](_0x401009[_0x440a('0x30')]['offset']);}return _0x25179c[_0x440a('0x4c')](_0x25f3d7);}})[_0x440a('0x24')](function(_0x3bbbce){if(_0x3bbbce){return _0x3bbbce?{'count':_0x1a0513,'rows':_0x3bbbce}:null;}})[_0x440a('0x24')](respondWithResult(_0x146335,null))[_0x440a('0x41')](handleError(_0x146335,null));};exports[_0x440a('0x4e')]=function(_0x32a2f6,_0x59fc47,_0x4749d8){var _0x18f45b={};var _0x4f2a00={};var _0x4b4795;var _0x424a82;return db[_0x440a('0x29')][_0x440a('0x49')]({'where':{'id':_0x32a2f6['params']['id']}})[_0x440a('0x24')](handleEntityNotFound(_0x59fc47,null))['then'](function(_0x192f72){if(_0x192f72){_0x4b4795=_0x192f72;_0x4f2a00[_0x440a('0x2e')]=_[_0x440a('0x31')](db[_0x440a('0x4a')][_0x440a('0x2a')]);_0x4f2a00[_0x440a('0x30')]=_[_0x440a('0x31')](_0x32a2f6[_0x440a('0x30')]);_0x4f2a00['filters']=_[_0x440a('0x33')](_0x4f2a00['model'],_0x4f2a00['query']);_0x18f45b[_0x440a('0x34')]=_[_0x440a('0x33')](_0x4f2a00[_0x440a('0x2e')],qs['fields'](_0x32a2f6[_0x440a('0x30')][_0x440a('0x35')]));_0x18f45b[_0x440a('0x34')]=_0x18f45b['attributes'][_0x440a('0x44')]?_0x18f45b['attributes']:_0x4f2a00[_0x440a('0x2e')];_0x18f45b['order']=qs[_0x440a('0x4b')](_0x32a2f6[_0x440a('0x30')][_0x440a('0x4b')]);_0x18f45b['where']=qs[_0x440a('0x32')](_['pick'](_0x32a2f6[_0x440a('0x30')],_0x4f2a00['filters']));if(_0x32a2f6[_0x440a('0x30')][_0x440a('0x39')]){_0x18f45b['where']=_[_0x440a('0x3b')](_0x18f45b[_0x440a('0x3a')],{'$or':_['map'](_0x18f45b[_0x440a('0x34')],function(_0x428ac3){var _0x8d4bcc={};_0x8d4bcc[_0x428ac3]={'$like':'%'+_0x32a2f6['query'][_0x440a('0x39')]+'%'};return _0x8d4bcc;})});}_0x18f45b=_[_0x440a('0x3b')]({},_0x18f45b,_0x32a2f6['options']);return _0x4b4795[_0x440a('0x4e')](_0x18f45b);}})[_0x440a('0x24')](function(_0x73b5b6){if(_0x73b5b6){_0x424a82=_0x73b5b6['length'];if(!_0x32a2f6['query'][_0x440a('0x36')](_0x440a('0x37'))){_0x18f45b['limit']=qs['limit'](_0x32a2f6[_0x440a('0x30')][_0x440a('0x1f')]);_0x18f45b[_0x440a('0x1c')]=qs['offset'](_0x32a2f6[_0x440a('0x30')][_0x440a('0x1c')]);}return _0x4b4795[_0x440a('0x4e')](_0x18f45b);}})[_0x440a('0x24')](function(_0x3519aa){if(_0x3519aa){return _0x3519aa?{'count':_0x424a82,'rows':_0x3519aa}:null;}})[_0x440a('0x24')](respondWithResult(_0x59fc47,null))['catch'](handleError(_0x59fc47,null));};
\ No newline at end of file
index 3324d8e..cec1557 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x042b=['api','bluebird','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','lodash','util','../../config/logger'];(function(_0x1ce92b,_0x12fe42){var _0x3ff61a=function(_0xb5acf7){while(--_0xb5acf7){_0x1ce92b['push'](_0x1ce92b['shift']());}};_0x3ff61a(++_0x12fe42);}(_0x042b,0x165));var _0xb042=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x042b[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xb042('0x0'));var util=require(_0xb042('0x1'));var logger=require(_0xb042('0x2'))(_0xb042('0x3'));var moment=require('moment');var BPromise=require(_0xb042('0x4'));var rp=require(_0xb042('0x5'));var fs=require('fs');var path=require(_0xb042('0x6'));var rimraf=require(_0xb042('0x7'));var config=require('../../config/environment');var attributes=require(_0xb042('0x8'));module[_0xb042('0x9')]=function(_0x545bb4,_0xbb6bab){return _0x545bb4[_0xb042('0xa')](_0xb042('0xb'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x08b5=['path','rimraf','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5e668f,_0x4a2f8d){var _0x23444c=function(_0x4f2a64){while(--_0x4f2a64){_0x5e668f['push'](_0x5e668f['shift']());}};_0x23444c(++_0x4a2f8d);}(_0x08b5,0xb9));var _0x508b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x08b5[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x508b('0x0'));var util=require('util');var logger=require(_0x508b('0x1'))(_0x508b('0x2'));var moment=require(_0x508b('0x3'));var BPromise=require(_0x508b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x508b('0x5'));var rimraf=require(_0x508b('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module['exports']=function(_0x53a729,_0x29856b){return _0x53a729[_0x508b('0x7')](_0x508b('0x8'),attributes,{'tableName':_0x508b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b770f10..9fc06ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xace0=['../../config/environment','jayson/promise','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x12dc31,_0x337050){var _0x15f0a2=function(_0xba0b9c){while(--_0xba0b9c){_0x12dc31['push'](_0x12dc31['shift']());}};_0x15f0a2(++_0x337050);}(_0xace0,0x67));var _0x0ace=function(_0x3046d8,_0x19af5e){_0x3046d8=_0x3046d8-0x0;var _0x56ecb6=_0xace0[_0x3046d8];return _0x56ecb6;};'use strict';var _=require('lodash');var util=require(_0x0ace('0x0'));var moment=require(_0x0ace('0x1'));var BPromise=require(_0x0ace('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ace('0x3'));var db=require(_0x0ace('0x4'))['db'];var utils=require(_0x0ace('0x5'));var logger=require(_0x0ace('0x6'))('rpc');var config=require(_0x0ace('0x7'));var jayson=require(_0x0ace('0x8'));var client=jayson['client'][_0x0ace('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ccb86,_0x34048f,_0x4e96ff){return new BPromise(function(_0x3ed8bc,_0x41effb){return client[_0x0ace('0xa')](_0x3ccb86,_0x4e96ff)[_0x0ace('0xb')](function(_0x2003fa){logger[_0x0ace('0xc')](_0x0ace('0xd'),_0x34048f,'request\x20sent');logger['debug'](_0x0ace('0xe'),_0x34048f,_0x0ace('0xf'),JSON[_0x0ace('0x10')](_0x2003fa));if(_0x2003fa[_0x0ace('0x11')]){if(_0x2003fa['error'][_0x0ace('0x12')]===0x1f4){logger[_0x0ace('0x11')](_0x0ace('0xd'),_0x34048f,_0x2003fa['error']['message']);return _0x41effb(_0x2003fa[_0x0ace('0x11')][_0x0ace('0x13')]);}logger[_0x0ace('0x11')](_0x0ace('0xd'),_0x34048f,_0x2003fa[_0x0ace('0x11')]['message']);return _0x3ed8bc(_0x2003fa[_0x0ace('0x11')]['message']);}else{logger['info'](_0x0ace('0xd'),_0x34048f,_0x0ace('0xf'));_0x3ed8bc(_0x2003fa[_0x0ace('0x14')][_0x0ace('0x13')]);}})[_0x0ace('0x15')](function(_0x2b4f39){logger[_0x0ace('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x34048f,_0x2b4f39);_0x41effb(_0x2b4f39);});});}
\ No newline at end of file
+var _0xfe0f=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x57474e,_0x4178b8){var _0xfaae8c=function(_0x2e34d1){while(--_0x2e34d1){_0x57474e['push'](_0x57474e['shift']());}};_0xfaae8c(++_0x4178b8);}(_0xfe0f,0x16c));var _0xffe0=function(_0x1274f5,_0x3ddb6b){_0x1274f5=_0x1274f5-0x0;var _0x5542db=_0xfe0f[_0x1274f5];return _0x5542db;};'use strict';var _=require(_0xffe0('0x0'));var util=require(_0xffe0('0x1'));var moment=require(_0xffe0('0x2'));var BPromise=require(_0xffe0('0x3'));var rs=require(_0xffe0('0x4'));var fs=require('fs');var Redis=require(_0xffe0('0x5'));var db=require(_0xffe0('0x6'))['db'];var utils=require(_0xffe0('0x7'));var logger=require(_0xffe0('0x8'))(_0xffe0('0x9'));var config=require(_0xffe0('0xa'));var jayson=require(_0xffe0('0xb'));var client=jayson[_0xffe0('0xc')][_0xffe0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x314f37,_0x2763a5,_0x78ee81){return new BPromise(function(_0x21499d,_0x2e19bb){return client[_0xffe0('0xe')](_0x314f37,_0x78ee81)['then'](function(_0x3a8229){logger[_0xffe0('0xf')](_0xffe0('0x10'),_0x2763a5,'request\x20sent');logger['debug'](_0xffe0('0x11'),_0x2763a5,_0xffe0('0x12'),JSON[_0xffe0('0x13')](_0x3a8229));if(_0x3a8229[_0xffe0('0x14')]){if(_0x3a8229['error'][_0xffe0('0x15')]===0x1f4){logger[_0xffe0('0x14')](_0xffe0('0x10'),_0x2763a5,_0x3a8229[_0xffe0('0x14')][_0xffe0('0x16')]);return _0x2e19bb(_0x3a8229[_0xffe0('0x14')][_0xffe0('0x16')]);}logger[_0xffe0('0x14')](_0xffe0('0x10'),_0x2763a5,_0x3a8229[_0xffe0('0x14')]['message']);return _0x21499d(_0x3a8229[_0xffe0('0x14')][_0xffe0('0x16')]);}else{logger[_0xffe0('0xf')](_0xffe0('0x10'),_0x2763a5,_0xffe0('0x12'));_0x21499d(_0x3a8229['result']['message']);}})[_0xffe0('0x17')](function(_0x43bf47){logger[_0xffe0('0x14')](_0xffe0('0x10'),_0x2763a5,_0x43bf47);_0x2e19bb(_0x43bf47);});});}
\ No newline at end of file
index 26321a3..6621552 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6b1=['update','delete','/:id','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','post','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0xb6b1[_0x513545];return _0x18b7c5;};'use strict';var multer=require(_0x1b6b('0x0'));var util=require('util');var path=require(_0x1b6b('0x1'));var timeout=require('connect-timeout');var express=require(_0x1b6b('0x2'));var router=express[_0x1b6b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1b6b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1b6b('0x5'));var controller=require(_0x1b6b('0x6'));router[_0x1b6b('0x7')]('/',auth[_0x1b6b('0x8')](),controller['index']);router[_0x1b6b('0x7')]('/:id',auth[_0x1b6b('0x8')](),controller['show']);router[_0x1b6b('0x9')]('/',auth[_0x1b6b('0x8')](),controller[_0x1b6b('0xa')]);router[_0x1b6b('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x1b6b('0xc')]);router[_0x1b6b('0xd')](_0x1b6b('0xe'),auth[_0x1b6b('0x8')](),controller[_0x1b6b('0xf')]);module[_0x1b6b('0x10')]=router;
\ No newline at end of file
+var _0xb2ff=['show','post','create','update','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id'];(function(_0x25df80,_0xa2aec5){var _0x17b6d0=function(_0x446155){while(--_0x446155){_0x25df80['push'](_0x25df80['shift']());}};_0x17b6d0(++_0xa2aec5);}(_0xb2ff,0x123));var _0xfb2f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb2ff[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0xfb2f('0x0'));var util=require(_0xfb2f('0x1'));var path=require('path');var timeout=require(_0xfb2f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfb2f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfb2f('0x4'));var controller=require(_0xfb2f('0x5'));router[_0xfb2f('0x6')]('/',auth[_0xfb2f('0x7')](),controller['index']);router['get'](_0xfb2f('0x8'),auth['isAuthenticated'](),controller[_0xfb2f('0x9')]);router[_0xfb2f('0xa')]('/',auth[_0xfb2f('0x7')](),controller[_0xfb2f('0xb')]);router['put'](_0xfb2f('0x8'),auth['isAuthenticated'](),controller[_0xfb2f('0xc')]);router['delete'](_0xfb2f('0x8'),auth[_0xfb2f('0x7')](),controller[_0xfb2f('0xd')]);module[_0xfb2f('0xe')]=router;
\ No newline at end of file
index 1e66670..a027868 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd61e=['ENUM','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN'];(function(_0x5423a0,_0xc480ba){var _0x1b6dd0=function(_0x12e635){while(--_0x12e635){_0x5423a0['push'](_0x5423a0['shift']());}};_0x1b6dd0(++_0xc480ba);}(_0xd61e,0xe8));var _0xed61=function(_0x2ca9fe,_0x27c36c){_0x2ca9fe=_0x2ca9fe-0x0;var _0x562f30=_0xd61e[_0x2ca9fe];return _0x562f30;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xed61('0x0')](_0xed61('0x1'),'variable',_0xed61('0x2'),_0xed61('0x3'),_0xed61('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xed61('0x5')]},'key':{'type':Sequelize[_0xed61('0x5')]},'keyType':{'type':Sequelize[_0xed61('0x0')]('string',_0xed61('0x6'),_0xed61('0x2'))},'keyContent':{'type':Sequelize[_0xed61('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xed61('0x5')]},'customField':{'type':Sequelize[_0xed61('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xed61('0x5')]}};
\ No newline at end of file
+var _0x1f1f=['BOOLEAN','sequelize','exports','variable','customVariable','keyValue','picklist','string','STRING'];(function(_0x35adc2,_0x2e9379){var _0xdbe485=function(_0xe92555){while(--_0xe92555){_0x35adc2['push'](_0x35adc2['shift']());}};_0xdbe485(++_0x2e9379);}(_0x1f1f,0xa3));var _0xf1f1=function(_0x5a26f5,_0x196300){_0x5a26f5=_0x5a26f5-0x0;var _0x2e9ef7=_0x1f1f[_0x5a26f5];return _0x2e9ef7;};'use strict';var Sequelize=require(_0xf1f1('0x0'));module[_0xf1f1('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xf1f1('0x2'),_0xf1f1('0x3'),_0xf1f1('0x4'),_0xf1f1('0x5')),'defaultValue':_0xf1f1('0x6')},'content':{'type':Sequelize[_0xf1f1('0x7')]},'key':{'type':Sequelize[_0xf1f1('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0xf1f1('0x2'),_0xf1f1('0x3'))},'keyContent':{'type':Sequelize[_0xf1f1('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf1f1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 438b847..8c39fab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb20=['sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','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','error','stack','name','send','index','FreshsalesField','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','fields','length','create','body','find','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x31f3a2,_0x526826){var _0x32fcc7=function(_0x4df386){while(--_0x4df386){_0x31f3a2['push'](_0x31f3a2['shift']());}};_0x32fcc7(++_0x526826);}(_0xcb20,0x17a));var _0x0cb2=function(_0x86f4b5,_0x380631){_0x86f4b5=_0x86f4b5-0x0;var _0xe9025d=_0xcb20[_0x86f4b5];return _0xe9025d;};'use strict';var emlformat=require(_0x0cb2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0cb2('0x1'));var rp=require(_0x0cb2('0x2'));var moment=require(_0x0cb2('0x3'));var BPromise=require(_0x0cb2('0x4'));var Mustache=require(_0x0cb2('0x5'));var util=require('util');var path=require(_0x0cb2('0x6'));var sox=require(_0x0cb2('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cb2('0x8'));var _=require(_0x0cb2('0x9'));var squel=require(_0x0cb2('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0cb2('0xb'));var toCsv=require(_0x0cb2('0xc'));var querystring=require(_0x0cb2('0xd'));var Papa=require('papaparse');var Redis=require(_0x0cb2('0xe'));var authService=require(_0x0cb2('0xf'));var qs=require(_0x0cb2('0x10'));var as=require(_0x0cb2('0x11'));var hardwareService=require(_0x0cb2('0x12'));var logger=require(_0x0cb2('0x13'))('api');var utils=require(_0x0cb2('0x14'));var config=require(_0x0cb2('0x15'));var licenseUtil=require(_0x0cb2('0x16'));var db=require(_0x0cb2('0x17'))['db'];function respondWithStatusCode(_0x2a4856,_0x2ed6a0){_0x2ed6a0=_0x2ed6a0||0xcc;return function(_0x2ba712){if(_0x2ba712){return _0x2a4856['sendStatus'](_0x2ed6a0);}return _0x2a4856[_0x0cb2('0x18')](_0x2ed6a0)[_0x0cb2('0x19')]();};}function respondWithResult(_0x3a7539,_0x24b1f1){_0x24b1f1=_0x24b1f1||0xc8;return function(_0x14dbdb){if(_0x14dbdb){return _0x3a7539[_0x0cb2('0x18')](_0x24b1f1)[_0x0cb2('0x1a')](_0x14dbdb);}};}function respondWithFilteredResult(_0x373837,_0x494866){return function(_0x4a4ad8){if(_0x4a4ad8){var _0x11143f=typeof _0x494866[_0x0cb2('0x1b')]===_0x0cb2('0x1c')&&typeof _0x494866[_0x0cb2('0x1d')]===_0x0cb2('0x1c');var _0xd3bb0c=_0x4a4ad8[_0x0cb2('0x1e')];var _0x49e560=_0x11143f?0x0:_0x494866[_0x0cb2('0x1b')];var _0x48d1a6=_0x11143f?_0x4a4ad8['count']:_0x494866[_0x0cb2('0x1b')]+_0x494866[_0x0cb2('0x1d')];var _0x363146;if(_0x48d1a6>=_0xd3bb0c){_0x48d1a6=_0xd3bb0c;_0x363146=0xc8;}else{_0x363146=0xce;}_0x373837[_0x0cb2('0x18')](_0x363146);return _0x373837[_0x0cb2('0x1f')]('Content-Range',_0x49e560+'-'+_0x48d1a6+'/'+_0xd3bb0c)[_0x0cb2('0x1a')](_0x4a4ad8);}return null;};}function patchUpdates(_0x2b4d8d){return function(_0x2ad9f5){try{jsonpatch[_0x0cb2('0x20')](_0x2ad9f5,_0x2b4d8d,!![]);}catch(_0x3f1a1c){return BPromise[_0x0cb2('0x21')](_0x3f1a1c);}return _0x2ad9f5[_0x0cb2('0x22')]();};}function saveUpdates(_0x32954c,_0x3a88e1){return function(_0x3641bf){if(_0x3641bf){return _0x3641bf[_0x0cb2('0x23')](_0x32954c)[_0x0cb2('0x24')](function(_0x31d4ea){return _0x31d4ea;});}return null;};}function removeEntity(_0x46b133,_0x443dd7){return function(_0x23cbdd){if(_0x23cbdd){return _0x23cbdd['destroy']()[_0x0cb2('0x24')](function(){_0x46b133['status'](0xcc)[_0x0cb2('0x19')]();});}};}function handleEntityNotFound(_0x214847,_0x475984){return function(_0x1ebdbd){if(!_0x1ebdbd){_0x214847[_0x0cb2('0x25')](0x194);}return _0x1ebdbd;};}function handleError(_0x54e51f,_0x1eef76){_0x1eef76=_0x1eef76||0x1f4;return function(_0x3a242a){logger[_0x0cb2('0x26')](_0x3a242a[_0x0cb2('0x27')]);if(_0x3a242a[_0x0cb2('0x28')]){delete _0x3a242a['name'];}_0x54e51f[_0x0cb2('0x18')](_0x1eef76)[_0x0cb2('0x29')](_0x3a242a);};}exports[_0x0cb2('0x2a')]=function(_0x394553,_0x879cda){var _0x2a6362={},_0x4b8bc3={},_0xa361e5={'count':0x0,'rows':[]};var _0x53a3f6=_['map'](db[_0x0cb2('0x2b')][_0x0cb2('0x2c')],function(_0x254790){return{'name':_0x254790[_0x0cb2('0x2d')],'type':_0x254790[_0x0cb2('0x2e')][_0x0cb2('0x2f')]};});_0x4b8bc3[_0x0cb2('0x30')]=_[_0x0cb2('0x31')](_0x53a3f6,_0x0cb2('0x28'));_0x4b8bc3[_0x0cb2('0x32')]=_['keys'](_0x394553[_0x0cb2('0x32')]);_0x4b8bc3[_0x0cb2('0x33')]=_['intersection'](_0x4b8bc3[_0x0cb2('0x30')],_0x4b8bc3[_0x0cb2('0x32')]);_0x2a6362[_0x0cb2('0x34')]=_['intersection'](_0x4b8bc3['model'],qs['fields'](_0x394553[_0x0cb2('0x32')]['fields']));_0x2a6362[_0x0cb2('0x34')]=_0x2a6362[_0x0cb2('0x34')]['length']?_0x2a6362[_0x0cb2('0x34')]:_0x4b8bc3['model'];if(!_0x394553[_0x0cb2('0x32')][_0x0cb2('0x35')](_0x0cb2('0x36'))){_0x2a6362['limit']=qs[_0x0cb2('0x1d')](_0x394553[_0x0cb2('0x32')][_0x0cb2('0x1d')]);_0x2a6362[_0x0cb2('0x1b')]=qs[_0x0cb2('0x1b')](_0x394553['query']['offset']);}_0x2a6362[_0x0cb2('0x37')]=qs['sort'](_0x394553[_0x0cb2('0x32')][_0x0cb2('0x38')]);_0x2a6362[_0x0cb2('0x39')]=qs[_0x0cb2('0x33')](_[_0x0cb2('0x3a')](_0x394553[_0x0cb2('0x32')],_0x4b8bc3['filters']),_0x53a3f6);if(_0x394553[_0x0cb2('0x32')][_0x0cb2('0x3b')]){_0x2a6362[_0x0cb2('0x39')]=_[_0x0cb2('0x3c')](_0x2a6362[_0x0cb2('0x39')],{'$or':_[_0x0cb2('0x31')](_0x53a3f6,function(_0x2f827c){if(_0x2f827c[_0x0cb2('0x2e')]!=='VIRTUAL'){var _0xd8712c={};_0xd8712c[_0x2f827c['name']]={'$like':'%'+_0x394553[_0x0cb2('0x32')][_0x0cb2('0x3b')]+'%'};return _0xd8712c;}})});}_0x2a6362=_['merge']({},_0x2a6362,_0x394553[_0x0cb2('0x3d')]);var _0x19b896={'where':_0x2a6362['where']};return db['FreshsalesField'][_0x0cb2('0x1e')](_0x19b896)['then'](function(_0x1b4d3d){_0xa361e5['count']=_0x1b4d3d;if(_0x394553[_0x0cb2('0x32')][_0x0cb2('0x3e')]){_0x2a6362[_0x0cb2('0x3f')]=[{'all':!![]}];}return db[_0x0cb2('0x2b')][_0x0cb2('0x40')](_0x2a6362);})['then'](function(_0x3e99b1){_0xa361e5[_0x0cb2('0x41')]=_0x3e99b1;return _0xa361e5;})[_0x0cb2('0x24')](respondWithFilteredResult(_0x879cda,_0x2a6362))[_0x0cb2('0x42')](handleError(_0x879cda,null));};exports[_0x0cb2('0x43')]=function(_0x25d1f3,_0x41cba9){var _0x40a4aa={'raw':!![],'where':{'id':_0x25d1f3[_0x0cb2('0x44')]['id']}},_0x51f438={};_0x51f438[_0x0cb2('0x30')]=_[_0x0cb2('0x45')](db[_0x0cb2('0x2b')][_0x0cb2('0x2c')]);_0x51f438[_0x0cb2('0x32')]=_['keys'](_0x25d1f3['query']);_0x51f438[_0x0cb2('0x33')]=_[_0x0cb2('0x46')](_0x51f438[_0x0cb2('0x30')],_0x51f438[_0x0cb2('0x32')]);_0x40a4aa[_0x0cb2('0x34')]=_[_0x0cb2('0x46')](_0x51f438[_0x0cb2('0x30')],qs[_0x0cb2('0x47')](_0x25d1f3['query'][_0x0cb2('0x47')]));_0x40a4aa['attributes']=_0x40a4aa['attributes'][_0x0cb2('0x48')]?_0x40a4aa[_0x0cb2('0x34')]:_0x51f438[_0x0cb2('0x30')];if(_0x25d1f3['query'][_0x0cb2('0x3e')]){_0x40a4aa[_0x0cb2('0x3f')]=[{'all':!![]}];}_0x40a4aa=_[_0x0cb2('0x3c')]({},_0x40a4aa,_0x25d1f3['options']);return db[_0x0cb2('0x2b')]['find'](_0x40a4aa)['then'](handleEntityNotFound(_0x41cba9,null))['then'](respondWithResult(_0x41cba9,null))[_0x0cb2('0x42')](handleError(_0x41cba9,null));};exports[_0x0cb2('0x49')]=function(_0x3440c0,_0x326af6){return db['FreshsalesField'][_0x0cb2('0x49')](_0x3440c0[_0x0cb2('0x4a')],{})[_0x0cb2('0x24')](respondWithResult(_0x326af6,0xc9))['catch'](handleError(_0x326af6,null));};exports['update']=function(_0x95fca2,_0x24a972){if(_0x95fca2[_0x0cb2('0x4a')]['id']){delete _0x95fca2[_0x0cb2('0x4a')]['id'];}return db[_0x0cb2('0x2b')][_0x0cb2('0x4b')]({'where':{'id':_0x95fca2[_0x0cb2('0x44')]['id']}})[_0x0cb2('0x24')](handleEntityNotFound(_0x24a972,null))[_0x0cb2('0x24')](saveUpdates(_0x95fca2[_0x0cb2('0x4a')],null))[_0x0cb2('0x24')](respondWithResult(_0x24a972,null))[_0x0cb2('0x42')](handleError(_0x24a972,null));};exports[_0x0cb2('0x4c')]=function(_0x5bd633,_0x340e4e){return db[_0x0cb2('0x2b')][_0x0cb2('0x4b')]({'where':{'id':_0x5bd633[_0x0cb2('0x44')]['id']}})[_0x0cb2('0x24')](handleEntityNotFound(_0x340e4e,null))[_0x0cb2('0x24')](removeEntity(_0x340e4e,null))['catch'](handleError(_0x340e4e,null));};
\ No newline at end of file
+var _0x11ab=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','FreshsalesField','model','keys','filters','attributes','fields','query','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','catch','show','params','intersection','includeAll','options','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x11ab,0x115));var _0xb11a=function(_0x44b07b,_0x6f6789){_0x44b07b=_0x44b07b-0x0;var _0x21a23d=_0x11ab[_0x44b07b];return _0x21a23d;};'use strict';var emlformat=require(_0xb11a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb11a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb11a('0x2'));var moment=require(_0xb11a('0x3'));var BPromise=require(_0xb11a('0x4'));var Mustache=require(_0xb11a('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb11a('0x6'));var csv=require(_0xb11a('0x7'));var ejs=require(_0xb11a('0x8'));var fs=require('fs');var fs_extra=require(_0xb11a('0x9'));var _=require(_0xb11a('0xa'));var squel=require('squel');var crypto=require(_0xb11a('0xb'));var jsforce=require(_0xb11a('0xc'));var deskjs=require(_0xb11a('0xd'));var toCsv=require(_0xb11a('0x7'));var querystring=require(_0xb11a('0xe'));var Papa=require(_0xb11a('0xf'));var Redis=require(_0xb11a('0x10'));var authService=require(_0xb11a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb11a('0x12'));var hardwareService=require(_0xb11a('0x13'));var logger=require(_0xb11a('0x14'))(_0xb11a('0x15'));var utils=require(_0xb11a('0x16'));var config=require(_0xb11a('0x17'));var licenseUtil=require(_0xb11a('0x18'));var db=require(_0xb11a('0x19'))['db'];function respondWithStatusCode(_0xd0de36,_0x34dd0e){_0x34dd0e=_0x34dd0e||0xcc;return function(_0x3117eb){if(_0x3117eb){return _0xd0de36[_0xb11a('0x1a')](_0x34dd0e);}return _0xd0de36['status'](_0x34dd0e)[_0xb11a('0x1b')]();};}function respondWithResult(_0x18b6c4,_0x1c61ef){_0x1c61ef=_0x1c61ef||0xc8;return function(_0x5af31e){if(_0x5af31e){return _0x18b6c4[_0xb11a('0x1c')](_0x1c61ef)[_0xb11a('0x1d')](_0x5af31e);}};}function respondWithFilteredResult(_0x2884ac,_0x1e5a71){return function(_0x1948e1){if(_0x1948e1){var _0x1f31ba=typeof _0x1e5a71[_0xb11a('0x1e')]===_0xb11a('0x1f')&&typeof _0x1e5a71[_0xb11a('0x20')]===_0xb11a('0x1f');var _0x2885d1=_0x1948e1[_0xb11a('0x21')];var _0x5628ba=_0x1f31ba?0x0:_0x1e5a71[_0xb11a('0x1e')];var _0x3ad3c1=_0x1f31ba?_0x1948e1[_0xb11a('0x21')]:_0x1e5a71['offset']+_0x1e5a71[_0xb11a('0x20')];var _0x21e595;if(_0x3ad3c1>=_0x2885d1){_0x3ad3c1=_0x2885d1;_0x21e595=0xc8;}else{_0x21e595=0xce;}_0x2884ac['status'](_0x21e595);return _0x2884ac[_0xb11a('0x22')](_0xb11a('0x23'),_0x5628ba+'-'+_0x3ad3c1+'/'+_0x2885d1)[_0xb11a('0x1d')](_0x1948e1);}return null;};}function patchUpdates(_0x3baed4){return function(_0x1f0305){try{jsonpatch[_0xb11a('0x24')](_0x1f0305,_0x3baed4,!![]);}catch(_0x27da09){return BPromise['reject'](_0x27da09);}return _0x1f0305[_0xb11a('0x25')]();};}function saveUpdates(_0x48fa8a,_0x256ac6){return function(_0x4e6706){if(_0x4e6706){return _0x4e6706[_0xb11a('0x26')](_0x48fa8a)[_0xb11a('0x27')](function(_0x2367aa){return _0x2367aa;});}return null;};}function removeEntity(_0x48bedc,_0x386d44){return function(_0x14f6f8){if(_0x14f6f8){return _0x14f6f8[_0xb11a('0x28')]()['then'](function(){_0x48bedc[_0xb11a('0x1c')](0xcc)[_0xb11a('0x1b')]();});}};}function handleEntityNotFound(_0x49e3ba,_0x315d31){return function(_0x50c62d){if(!_0x50c62d){_0x49e3ba[_0xb11a('0x1a')](0x194);}return _0x50c62d;};}function handleError(_0x454cdd,_0x1e4b45){_0x1e4b45=_0x1e4b45||0x1f4;return function(_0x25870a){logger[_0xb11a('0x29')](_0x25870a[_0xb11a('0x2a')]);if(_0x25870a['name']){delete _0x25870a[_0xb11a('0x2b')];}_0x454cdd[_0xb11a('0x1c')](_0x1e4b45)[_0xb11a('0x2c')](_0x25870a);};}exports[_0xb11a('0x2d')]=function(_0x42a5fd,_0x4e3d17){var _0x38d310={},_0xe3b66a={},_0x2dbdad={'count':0x0,'rows':[]};var _0x3c7865=_['map'](db[_0xb11a('0x2e')]['rawAttributes'],function(_0xd57502){return{'name':_0xd57502['fieldName'],'type':_0xd57502['type']['key']};});_0xe3b66a[_0xb11a('0x2f')]=_['map'](_0x3c7865,_0xb11a('0x2b'));_0xe3b66a['query']=_[_0xb11a('0x30')](_0x42a5fd['query']);_0xe3b66a[_0xb11a('0x31')]=_['intersection'](_0xe3b66a[_0xb11a('0x2f')],_0xe3b66a['query']);_0x38d310[_0xb11a('0x32')]=_['intersection'](_0xe3b66a['model'],qs[_0xb11a('0x33')](_0x42a5fd[_0xb11a('0x34')][_0xb11a('0x33')]));_0x38d310[_0xb11a('0x32')]=_0x38d310['attributes'][_0xb11a('0x35')]?_0x38d310[_0xb11a('0x32')]:_0xe3b66a[_0xb11a('0x2f')];if(!_0x42a5fd['query']['hasOwnProperty'](_0xb11a('0x36'))){_0x38d310['limit']=qs[_0xb11a('0x20')](_0x42a5fd[_0xb11a('0x34')][_0xb11a('0x20')]);_0x38d310[_0xb11a('0x1e')]=qs['offset'](_0x42a5fd[_0xb11a('0x34')]['offset']);}_0x38d310[_0xb11a('0x37')]=qs['sort'](_0x42a5fd[_0xb11a('0x34')][_0xb11a('0x38')]);_0x38d310[_0xb11a('0x39')]=qs['filters'](_[_0xb11a('0x3a')](_0x42a5fd[_0xb11a('0x34')],_0xe3b66a[_0xb11a('0x31')]),_0x3c7865);if(_0x42a5fd[_0xb11a('0x34')][_0xb11a('0x3b')]){_0x38d310[_0xb11a('0x39')]=_[_0xb11a('0x3c')](_0x38d310[_0xb11a('0x39')],{'$or':_['map'](_0x3c7865,function(_0x3d3486){if(_0x3d3486['type']!==_0xb11a('0x3d')){var _0x1d3a74={};_0x1d3a74[_0x3d3486['name']]={'$like':'%'+_0x42a5fd[_0xb11a('0x34')][_0xb11a('0x3b')]+'%'};return _0x1d3a74;}})});}_0x38d310=_[_0xb11a('0x3c')]({},_0x38d310,_0x42a5fd['options']);var _0x530e5c={'where':_0x38d310[_0xb11a('0x39')]};return db[_0xb11a('0x2e')][_0xb11a('0x21')](_0x530e5c)['then'](function(_0x1e653d){_0x2dbdad[_0xb11a('0x21')]=_0x1e653d;if(_0x42a5fd[_0xb11a('0x34')]['includeAll']){_0x38d310[_0xb11a('0x3e')]=[{'all':!![]}];}return db[_0xb11a('0x2e')]['findAll'](_0x38d310);})['then'](function(_0x367461){_0x2dbdad['rows']=_0x367461;return _0x2dbdad;})[_0xb11a('0x27')](respondWithFilteredResult(_0x4e3d17,_0x38d310))[_0xb11a('0x3f')](handleError(_0x4e3d17,null));};exports[_0xb11a('0x40')]=function(_0x6e0b50,_0x5a0bb6){var _0x558d8a={'raw':!![],'where':{'id':_0x6e0b50[_0xb11a('0x41')]['id']}},_0x2be7c8={};_0x2be7c8[_0xb11a('0x2f')]=_[_0xb11a('0x30')](db[_0xb11a('0x2e')]['rawAttributes']);_0x2be7c8[_0xb11a('0x34')]=_['keys'](_0x6e0b50['query']);_0x2be7c8['filters']=_[_0xb11a('0x42')](_0x2be7c8[_0xb11a('0x2f')],_0x2be7c8[_0xb11a('0x34')]);_0x558d8a[_0xb11a('0x32')]=_[_0xb11a('0x42')](_0x2be7c8['model'],qs[_0xb11a('0x33')](_0x6e0b50[_0xb11a('0x34')][_0xb11a('0x33')]));_0x558d8a[_0xb11a('0x32')]=_0x558d8a[_0xb11a('0x32')][_0xb11a('0x35')]?_0x558d8a[_0xb11a('0x32')]:_0x2be7c8['model'];if(_0x6e0b50['query'][_0xb11a('0x43')]){_0x558d8a['include']=[{'all':!![]}];}_0x558d8a=_['merge']({},_0x558d8a,_0x6e0b50[_0xb11a('0x44')]);return db['FreshsalesField'][_0xb11a('0x45')](_0x558d8a)[_0xb11a('0x27')](handleEntityNotFound(_0x5a0bb6,null))[_0xb11a('0x27')](respondWithResult(_0x5a0bb6,null))[_0xb11a('0x3f')](handleError(_0x5a0bb6,null));};exports[_0xb11a('0x46')]=function(_0x163ace,_0xf9c8e8){return db[_0xb11a('0x2e')]['create'](_0x163ace['body'],{})[_0xb11a('0x27')](respondWithResult(_0xf9c8e8,0xc9))[_0xb11a('0x3f')](handleError(_0xf9c8e8,null));};exports[_0xb11a('0x26')]=function(_0x2ebbde,_0x5a5b94){if(_0x2ebbde[_0xb11a('0x47')]['id']){delete _0x2ebbde[_0xb11a('0x47')]['id'];}return db[_0xb11a('0x2e')][_0xb11a('0x45')]({'where':{'id':_0x2ebbde['params']['id']}})[_0xb11a('0x27')](handleEntityNotFound(_0x5a5b94,null))[_0xb11a('0x27')](saveUpdates(_0x2ebbde['body'],null))[_0xb11a('0x27')](respondWithResult(_0x5a5b94,null))[_0xb11a('0x3f')](handleError(_0x5a5b94,null));};exports[_0xb11a('0x28')]=function(_0x461d32,_0xb37b96){return db[_0xb11a('0x2e')][_0xb11a('0x45')]({'where':{'id':_0x461d32[_0xb11a('0x41')]['id']}})[_0xb11a('0x27')](handleEntityNotFound(_0xb37b96,null))[_0xb11a('0x27')](removeEntity(_0xb37b96,null))[_0xb11a('0x3f')](handleError(_0xb37b96,null));};
\ No newline at end of file
index 2ddf500..ff7b83d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7031=['../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash','util','api','moment','request-promise','path'];(function(_0x3a5bab,_0x2dc4c9){var _0x46041d=function(_0x2a82bc){while(--_0x2a82bc){_0x3a5bab['push'](_0x3a5bab['shift']());}};_0x46041d(++_0x2dc4c9);}(_0x7031,0x19a));var _0x1703=function(_0x290a56,_0x5c540a){_0x290a56=_0x290a56-0x0;var _0x89610=_0x7031[_0x290a56];return _0x89610;};'use strict';var _=require(_0x1703('0x0'));var util=require(_0x1703('0x1'));var logger=require('../../config/logger')(_0x1703('0x2'));var moment=require(_0x1703('0x3'));var BPromise=require('bluebird');var rp=require(_0x1703('0x4'));var fs=require('fs');var path=require(_0x1703('0x5'));var rimraf=require('rimraf');var config=require(_0x1703('0x6'));var attributes=require(_0x1703('0x7'));module['exports']=function(_0x9222f3,_0x5a31df){return _0x9222f3[_0x1703('0x8')](_0x1703('0x9'),attributes,{'tableName':_0x1703('0xa'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x1703('0xb'),_0x1703('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x07a2=['path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1cf9fc,_0x11bc77){var _0x21a4aa=function(_0x575a6a){while(--_0x575a6a){_0x1cf9fc['push'](_0x1cf9fc['shift']());}};_0x21a4aa(++_0x11bc77);}(_0x07a2,0x12c));var _0x207a=function(_0x35b195,_0x8893d5){_0x35b195=_0x35b195-0x0;var _0x2433bf=_0x07a2[_0x35b195];return _0x2433bf;};'use strict';var _=require(_0x207a('0x0'));var util=require(_0x207a('0x1'));var logger=require('../../config/logger')(_0x207a('0x2'));var moment=require(_0x207a('0x3'));var BPromise=require(_0x207a('0x4'));var rp=require(_0x207a('0x5'));var fs=require('fs');var path=require(_0x207a('0x6'));var rimraf=require(_0x207a('0x7'));var config=require(_0x207a('0x8'));var attributes=require(_0x207a('0x9'));module[_0x207a('0xa')]=function(_0x47dbbf,_0x5b1fa9){return _0x47dbbf[_0x207a('0xb')](_0x207a('0xc'),attributes,{'tableName':_0x207a('0xd'),'paranoid':![],'indexes':[{'name':_0x207a('0xe'),'fields':[_0x207a('0xf'),_0x207a('0x10')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 91a5894..7e64a5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x44606e,_0x2bf244){var _0xe68388=function(_0x488a30){while(--_0x488a30){_0x44606e['push'](_0x44606e['shift']());}};_0xe68388(++_0x2bf244);}(_0x2ef3,0xba));var _0x32ef=function(_0x3da6f6,_0x30af17){_0x3da6f6=_0x3da6f6-0x0;var _0x350686=_0x2ef3[_0x3da6f6];return _0x350686;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _0x90b1=['message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x58b766,_0x4c2199){var _0x3d20e0=function(_0x436475){while(--_0x436475){_0x58b766['push'](_0x58b766['shift']());}};_0x3d20e0(++_0x4c2199);}(_0x90b1,0x1bb));var _0x190b=function(_0x3c2e4e,_0x357207){_0x3c2e4e=_0x3c2e4e-0x0;var _0x773c58=_0x90b1[_0x3c2e4e];return _0x773c58;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190b('0x3'));var db=require(_0x190b('0x4'))['db'];var utils=require(_0x190b('0x5'));var logger=require(_0x190b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x190b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34a689,_0x3b57f7,_0x626aa1){return new BPromise(function(_0x311161,_0x802924){return client[_0x190b('0x8')](_0x34a689,_0x626aa1)['then'](function(_0x14b93d){logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));logger[_0x190b('0xc')](_0x190b('0xd'),_0x3b57f7,_0x190b('0xb'),JSON[_0x190b('0xe')](_0x14b93d));if(_0x14b93d['error']){if(_0x14b93d[_0x190b('0xf')][_0x190b('0x10')]===0x1f4){logger['error'](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x802924(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}logger[_0x190b('0xf')](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x311161(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}else{logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));_0x311161(_0x14b93d[_0x190b('0x12')][_0x190b('0x11')]);}})[_0x190b('0x13')](function(_0x5c63d9){logger[_0x190b('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x3b57f7,_0x5c63d9);_0x802924(_0x5c63d9);});});}
\ No newline at end of file
index 76eb3dd..3126c36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3e93c7,_0x9d5904){var _0xdba5b6=function(_0x3aadaa){while(--_0x3aadaa){_0x3e93c7['push'](_0x3e93c7['shift']());}};_0xdba5b6(++_0x9d5904);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x538169,_0x2ef2ca){var _0x321e69=function(_0x3637c2){while(--_0x3637c2){_0x538169['push'](_0x538169['shift']());}};_0x321e69(++_0x2ef2ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 07b5ad7..4dc4968 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f75=['exports','STRING','username','newTab','integrationTab','sequelize'];(function(_0x1c0c7c,_0x2ede87){var _0x1eeae0=function(_0x6d671b){while(--_0x6d671b){_0x1c0c7c['push'](_0x1c0c7c['shift']());}};_0x1eeae0(++_0x2ede87);}(_0x6f75,0x71));var _0x56f7=function(_0xfafb79,_0x5657ca){_0xfafb79=_0xfafb79-0x0;var _0x2a2c0a=_0x6f75[_0xfafb79];return _0x2a2c0a;};'use strict';var Sequelize=require(_0x56f7('0x0'));module[_0x56f7('0x1')]={'name':{'type':Sequelize[_0x56f7('0x2')]},'description':{'type':Sequelize[_0x56f7('0x2')]},'username':{'type':Sequelize[_0x56f7('0x2')],'unique':_0x56f7('0x3')},'remoteUri':{'type':Sequelize[_0x56f7('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x56f7('0x2')]},'clientSecret':{'type':Sequelize[_0x56f7('0x2')]},'securityToken':{'type':Sequelize[_0x56f7('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x56f7('0x4')),'defaultValue':_0x56f7('0x5')}};
\ No newline at end of file
+var _0xe9ef=['integrationTab','sequelize','STRING','username','ENUM'];(function(_0x562677,_0x30bd87){var _0x36f32f=function(_0x4e7657){while(--_0x4e7657){_0x562677['push'](_0x562677['shift']());}};_0x36f32f(++_0x30bd87);}(_0xe9ef,0x16e));var _0xfe9e=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0xe9ef[_0x3203a1];return _0x24215e;};'use strict';var Sequelize=require(_0xfe9e('0x0'));module['exports']={'name':{'type':Sequelize[_0xfe9e('0x1')]},'description':{'type':Sequelize[_0xfe9e('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xfe9e('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xfe9e('0x1')]},'clientId':{'type':Sequelize[_0xfe9e('0x1')]},'clientSecret':{'type':Sequelize[_0xfe9e('0x1')]},'securityToken':{'type':Sequelize[_0xfe9e('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xfe9e('0x3')](_0xfe9e('0x4'),'newTab'),'defaultValue':'integrationTab'}};
\ No newline at end of file
index 3b92a65..d476627 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbb5=['Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SalesforceAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','find','findOne','SalesforceConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','Subject','Description','string','int','picklist','email','textarea','phone','includes','label','picklistValues','value','True','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfbb5,0x1db));var _0x5fbb=function(_0x460c5d,_0x2f0ffb){_0x460c5d=_0x460c5d-0x0;var _0x1d6555=_0xfbb5[_0x460c5d];return _0x1d6555;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5fbb('0x0'));var jsonpatch=require(_0x5fbb('0x1'));var rp=require('request-promise');var moment=require(_0x5fbb('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5fbb('0x3'));var util=require(_0x5fbb('0x4'));var path=require(_0x5fbb('0x5'));var sox=require(_0x5fbb('0x6'));var csv=require('to-csv');var ejs=require(_0x5fbb('0x7'));var fs=require('fs');var fs_extra=require(_0x5fbb('0x8'));var _=require('lodash');var squel=require(_0x5fbb('0x9'));var crypto=require(_0x5fbb('0xa'));var jsforce=require(_0x5fbb('0xb'));var deskjs=require(_0x5fbb('0xc'));var toCsv=require(_0x5fbb('0xd'));var querystring=require(_0x5fbb('0xe'));var Papa=require('papaparse');var Redis=require(_0x5fbb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5fbb('0x10'));var as=require(_0x5fbb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5fbb('0x12'))('api');var utils=require(_0x5fbb('0x13'));var config=require(_0x5fbb('0x14'));var licenseUtil=require(_0x5fbb('0x15'));var db=require(_0x5fbb('0x16'))['db'];var integrations=require(_0x5fbb('0x17'));function respondWithStatusCode(_0x38a50a,_0x58985f){_0x58985f=_0x58985f||0xcc;return function(_0x2a4f38){if(_0x2a4f38){return _0x38a50a[_0x5fbb('0x18')](_0x58985f);}return _0x38a50a[_0x5fbb('0x19')](_0x58985f)[_0x5fbb('0x1a')]();};}function respondWithResult(_0x5b556a,_0x1d6b90){_0x1d6b90=_0x1d6b90||0xc8;return function(_0x2a7ce2){if(_0x2a7ce2){return _0x5b556a[_0x5fbb('0x19')](_0x1d6b90)[_0x5fbb('0x1b')](_0x2a7ce2);}};}function respondWithFilteredResult(_0x388166,_0xc83c39){return function(_0x1f9c64){if(_0x1f9c64){var _0x4ca27d=typeof _0xc83c39[_0x5fbb('0x1c')]===_0x5fbb('0x1d')&&typeof _0xc83c39[_0x5fbb('0x1e')]===_0x5fbb('0x1d');var _0x19de0a=_0x1f9c64[_0x5fbb('0x1f')];var _0x55c459=_0x4ca27d?0x0:_0xc83c39[_0x5fbb('0x1c')];var _0x4657d6=_0x4ca27d?_0x1f9c64['count']:_0xc83c39['offset']+_0xc83c39[_0x5fbb('0x1e')];var _0x96e832;if(_0x4657d6>=_0x19de0a){_0x4657d6=_0x19de0a;_0x96e832=0xc8;}else{_0x96e832=0xce;}_0x388166[_0x5fbb('0x19')](_0x96e832);return _0x388166[_0x5fbb('0x20')](_0x5fbb('0x21'),_0x55c459+'-'+_0x4657d6+'/'+_0x19de0a)[_0x5fbb('0x1b')](_0x1f9c64);}return null;};}function patchUpdates(_0x4e656e){return function(_0x3c6874){try{jsonpatch[_0x5fbb('0x22')](_0x3c6874,_0x4e656e,!![]);}catch(_0x18c19b){return BPromise[_0x5fbb('0x23')](_0x18c19b);}return _0x3c6874['save']();};}function saveUpdates(_0x189589,_0x3a7b12){return function(_0x2c9d9a){if(_0x2c9d9a){return _0x2c9d9a[_0x5fbb('0x24')](_0x189589)[_0x5fbb('0x25')](function(_0x18afd2){return _0x18afd2;});}return null;};}function removeEntity(_0x567772,_0x205ffd){return function(_0x24122e){if(_0x24122e){return _0x24122e[_0x5fbb('0x26')]()['then'](function(){_0x567772[_0x5fbb('0x19')](0xcc)[_0x5fbb('0x1a')]();});}};}function handleEntityNotFound(_0x3ae575,_0x4e94b6){return function(_0x343b17){if(!_0x343b17){_0x3ae575[_0x5fbb('0x18')](0x194);}return _0x343b17;};}function handleError(_0x552a27,_0x21a7eb){_0x21a7eb=_0x21a7eb||0x1f4;return function(_0xfbb157){logger[_0x5fbb('0x27')](_0xfbb157[_0x5fbb('0x28')]);if(_0xfbb157[_0x5fbb('0x29')]){delete _0xfbb157[_0x5fbb('0x29')];}_0x552a27[_0x5fbb('0x19')](_0x21a7eb)[_0x5fbb('0x2a')](_0xfbb157);};}exports[_0x5fbb('0x2b')]=function(_0x4e7f3a,_0x2940be){var _0x58c962={},_0x38853d={},_0x3132e9={'count':0x0,'rows':[]};var _0x25ca2c=_[_0x5fbb('0x2c')](db[_0x5fbb('0x2d')]['rawAttributes'],function(_0x9d8dc){return{'name':_0x9d8dc[_0x5fbb('0x2e')],'type':_0x9d8dc[_0x5fbb('0x2f')][_0x5fbb('0x30')]};});_0x38853d[_0x5fbb('0x31')]=_[_0x5fbb('0x2c')](_0x25ca2c,_0x5fbb('0x29'));_0x38853d[_0x5fbb('0x32')]=_[_0x5fbb('0x33')](_0x4e7f3a[_0x5fbb('0x32')]);_0x38853d[_0x5fbb('0x34')]=_[_0x5fbb('0x35')](_0x38853d[_0x5fbb('0x31')],_0x38853d[_0x5fbb('0x32')]);_0x58c962[_0x5fbb('0x36')]=_[_0x5fbb('0x35')](_0x38853d[_0x5fbb('0x31')],qs[_0x5fbb('0x37')](_0x4e7f3a['query']['fields']));_0x58c962['attributes']=_0x58c962['attributes'][_0x5fbb('0x38')]?_0x58c962[_0x5fbb('0x36')]:_0x38853d[_0x5fbb('0x31')];if(!_0x4e7f3a['query'][_0x5fbb('0x39')](_0x5fbb('0x3a'))){_0x58c962[_0x5fbb('0x1e')]=qs['limit'](_0x4e7f3a['query'][_0x5fbb('0x1e')]);_0x58c962['offset']=qs[_0x5fbb('0x1c')](_0x4e7f3a[_0x5fbb('0x32')][_0x5fbb('0x1c')]);}_0x58c962[_0x5fbb('0x3b')]=qs[_0x5fbb('0x3c')](_0x4e7f3a['query'][_0x5fbb('0x3c')]);_0x58c962[_0x5fbb('0x3d')]=qs['filters'](_['pick'](_0x4e7f3a['query'],_0x38853d[_0x5fbb('0x34')]),_0x25ca2c);if(_0x4e7f3a[_0x5fbb('0x32')][_0x5fbb('0x3e')]){_0x58c962[_0x5fbb('0x3d')]=_[_0x5fbb('0x3f')](_0x58c962[_0x5fbb('0x3d')],{'$or':_['map'](_0x25ca2c,function(_0x2d1d7d){if(_0x2d1d7d[_0x5fbb('0x2f')]!==_0x5fbb('0x40')){var _0x43a46a={};_0x43a46a[_0x2d1d7d['name']]={'$like':'%'+_0x4e7f3a[_0x5fbb('0x32')][_0x5fbb('0x3e')]+'%'};return _0x43a46a;}})});}_0x58c962=_[_0x5fbb('0x3f')]({},_0x58c962,_0x4e7f3a[_0x5fbb('0x41')]);var _0x32732a={'where':_0x58c962[_0x5fbb('0x3d')]};return db['SalesforceAccount']['count'](_0x32732a)[_0x5fbb('0x25')](function(_0x5a4538){_0x3132e9[_0x5fbb('0x1f')]=_0x5a4538;if(_0x4e7f3a[_0x5fbb('0x32')][_0x5fbb('0x42')]){_0x58c962[_0x5fbb('0x43')]=[{'all':!![]}];}return db[_0x5fbb('0x2d')][_0x5fbb('0x44')](_0x58c962);})[_0x5fbb('0x25')](function(_0x54ecd8){_0x3132e9[_0x5fbb('0x45')]=_0x54ecd8;return _0x3132e9;})['then'](respondWithFilteredResult(_0x2940be,_0x58c962))[_0x5fbb('0x46')](handleError(_0x2940be,null));};exports['show']=function(_0x36a827,_0x2a1a6a){var _0x5559bb={'raw':![],'where':{'id':_0x36a827[_0x5fbb('0x47')]['id']}},_0x357f7a={};_0x357f7a[_0x5fbb('0x31')]=_[_0x5fbb('0x33')](db['SalesforceAccount'][_0x5fbb('0x48')]);_0x357f7a[_0x5fbb('0x32')]=_[_0x5fbb('0x33')](_0x36a827[_0x5fbb('0x32')]);_0x357f7a[_0x5fbb('0x34')]=_[_0x5fbb('0x35')](_0x357f7a['model'],_0x357f7a['query']);_0x5559bb[_0x5fbb('0x36')]=_[_0x5fbb('0x35')](_0x357f7a[_0x5fbb('0x31')],qs[_0x5fbb('0x37')](_0x36a827[_0x5fbb('0x32')][_0x5fbb('0x37')]));_0x5559bb[_0x5fbb('0x36')]=_0x5559bb[_0x5fbb('0x36')]['length']?_0x5559bb[_0x5fbb('0x36')]:_0x357f7a[_0x5fbb('0x31')];if(_0x36a827['query'][_0x5fbb('0x42')]){_0x5559bb[_0x5fbb('0x43')]=[{'all':!![]}];}_0x5559bb=_[_0x5fbb('0x3f')]({},_0x5559bb,_0x36a827[_0x5fbb('0x41')]);return db[_0x5fbb('0x2d')]['find'](_0x5559bb)[_0x5fbb('0x25')](handleEntityNotFound(_0x2a1a6a,null))[_0x5fbb('0x25')](respondWithResult(_0x2a1a6a,null))[_0x5fbb('0x46')](handleError(_0x2a1a6a,null));};exports[_0x5fbb('0x49')]=function(_0x26ef70,_0xa8fd0f){return db[_0x5fbb('0x2d')][_0x5fbb('0x49')](_0x26ef70['body'],{})['then'](respondWithResult(_0xa8fd0f,0xc9))['catch'](handleError(_0xa8fd0f,null));};exports[_0x5fbb('0x24')]=function(_0x525476,_0x1d92e7){if(_0x525476[_0x5fbb('0x4a')]['id']){delete _0x525476['body']['id'];}return db[_0x5fbb('0x2d')]['find']({'where':{'id':_0x525476[_0x5fbb('0x47')]['id']}})[_0x5fbb('0x25')](handleEntityNotFound(_0x1d92e7,null))[_0x5fbb('0x25')](saveUpdates(_0x525476[_0x5fbb('0x4a')],null))[_0x5fbb('0x25')](respondWithResult(_0x1d92e7,null))[_0x5fbb('0x46')](handleError(_0x1d92e7,null));};exports[_0x5fbb('0x26')]=function(_0x1de651,_0x31e2a4){return db[_0x5fbb('0x2d')][_0x5fbb('0x4b')]({'where':{'id':_0x1de651[_0x5fbb('0x47')]['id']}})[_0x5fbb('0x25')](handleEntityNotFound(_0x31e2a4,null))[_0x5fbb('0x25')](removeEntity(_0x31e2a4,null))['catch'](handleError(_0x31e2a4,null));};exports['getConfigurations']=function(_0xff8c2c,_0x2f226e,_0x22a7b7){var _0x50baa3={};var _0x2d0bea={};var _0x3d9d6b;var _0x42ed17;return db[_0x5fbb('0x2d')][_0x5fbb('0x4c')]({'where':{'id':_0xff8c2c[_0x5fbb('0x47')]['id']}})[_0x5fbb('0x25')](handleEntityNotFound(_0x2f226e,null))[_0x5fbb('0x25')](function(_0x4a772d){if(_0x4a772d){_0x3d9d6b=_0x4a772d;_0x2d0bea[_0x5fbb('0x31')]=_[_0x5fbb('0x33')](db[_0x5fbb('0x4d')]['rawAttributes']);_0x2d0bea[_0x5fbb('0x32')]=_['keys'](_0xff8c2c[_0x5fbb('0x32')]);_0x2d0bea[_0x5fbb('0x34')]=_[_0x5fbb('0x35')](_0x2d0bea[_0x5fbb('0x31')],_0x2d0bea[_0x5fbb('0x32')]);_0x50baa3['attributes']=_['intersection'](_0x2d0bea[_0x5fbb('0x31')],qs[_0x5fbb('0x37')](_0xff8c2c['query']['fields']));_0x50baa3[_0x5fbb('0x36')]=_0x50baa3[_0x5fbb('0x36')][_0x5fbb('0x38')]?_0x50baa3[_0x5fbb('0x36')]:_0x2d0bea[_0x5fbb('0x31')];_0x50baa3[_0x5fbb('0x3b')]=qs['sort'](_0xff8c2c[_0x5fbb('0x32')]['sort']);_0x50baa3[_0x5fbb('0x3d')]=qs[_0x5fbb('0x34')](_['pick'](_0xff8c2c['query'],_0x2d0bea[_0x5fbb('0x34')]));if(_0xff8c2c[_0x5fbb('0x32')][_0x5fbb('0x3e')]){_0x50baa3[_0x5fbb('0x3d')]=_[_0x5fbb('0x3f')](_0x50baa3[_0x5fbb('0x3d')],{'$or':_[_0x5fbb('0x2c')](_0x50baa3[_0x5fbb('0x36')],function(_0x5bc752){var _0x5daddf={};_0x5daddf[_0x5bc752]={'$like':'%'+_0xff8c2c[_0x5fbb('0x32')][_0x5fbb('0x3e')]+'%'};return _0x5daddf;})});}_0x50baa3=_[_0x5fbb('0x3f')]({},_0x50baa3,_0xff8c2c['options']);return _0x3d9d6b['getConfigurations'](_0x50baa3);}})['then'](function(_0x105d25){if(_0x105d25){_0x42ed17=_0x105d25[_0x5fbb('0x38')];if(!_0xff8c2c[_0x5fbb('0x32')][_0x5fbb('0x39')]('nolimit')){_0x50baa3['limit']=qs[_0x5fbb('0x1e')](_0xff8c2c['query'][_0x5fbb('0x1e')]);_0x50baa3[_0x5fbb('0x1c')]=qs[_0x5fbb('0x1c')](_0xff8c2c[_0x5fbb('0x32')][_0x5fbb('0x1c')]);}return _0x3d9d6b[_0x5fbb('0x4e')](_0x50baa3);}})['then'](function(_0x2abfb2){if(_0x2abfb2){return _0x2abfb2?{'count':_0x42ed17,'rows':_0x2abfb2}:null;}})['then'](respondWithResult(_0x2f226e,null))[_0x5fbb('0x46')](handleError(_0x2f226e,null));};exports[_0x5fbb('0x4f')]=function(_0x1e5c60,_0x12bdfa,_0x4ea2e0){if(_0x1e5c60[_0x5fbb('0x4a')]['id']){delete _0x1e5c60[_0x5fbb('0x4a')]['id'];}return db[_0x5fbb('0x2d')][_0x5fbb('0x4c')]({'where':{'id':_0x1e5c60[_0x5fbb('0x47')]['id']}})[_0x5fbb('0x25')](handleEntityNotFound(_0x12bdfa,null))['then'](function(_0x2d9314){if(_0x2d9314){_0x1e5c60[_0x5fbb('0x4a')][_0x5fbb('0x50')]=_0x2d9314['id'];_0x1e5c60[_0x5fbb('0x4a')][_0x5fbb('0x51')]=integrations[_0x5fbb('0x52')](_0x1e5c60[_0x5fbb('0x4a')][_0x5fbb('0x53')],_0x1e5c60[_0x5fbb('0x4a')][_0x5fbb('0x2f')]);_0x1e5c60[_0x5fbb('0x4a')][_0x5fbb('0x54')]=integrations[_0x5fbb('0x55')](_0x1e5c60[_0x5fbb('0x4a')][_0x5fbb('0x53')],_0x1e5c60['body'][_0x5fbb('0x2f')]);return db[_0x5fbb('0x4d')][_0x5fbb('0x49')](_0x1e5c60[_0x5fbb('0x4a')],{'include':[{'model':db[_0x5fbb('0x56')],'as':'Subjects'},{'model':db[_0x5fbb('0x56')],'as':_0x5fbb('0x54')}]});}return null;})['then'](respondWithResult(_0x12bdfa,null))[_0x5fbb('0x46')](handleError(_0x12bdfa,null));};exports[_0x5fbb('0x57')]=function(_0x1aef9f,_0x3c2326,_0x37b6e6){var _0x362cb6;var _0x33d49f='';var _0x58fb18=_0x5fbb('0x58');return db[_0x5fbb('0x2d')]['findOne']({'where':{'id':_0x1aef9f[_0x5fbb('0x47')]['id']},'attributes':['id',_0x5fbb('0x59'),_0x5fbb('0x5a'),_0x5fbb('0x5b'),_0x5fbb('0x5c'),_0x5fbb('0x5d'),_0x5fbb('0x5e')]})['then'](handleEntityNotFound(_0x3c2326,null))[_0x5fbb('0x25')](function(_0x317516){if(_0x317516){_0x33d49f=_0x317516[_0x5fbb('0x59')];var _0x28f959=_0x33d49f[_0x5fbb('0x5f')](-0x1);if(_0x28f959==='/'){_0x33d49f=_0x33d49f[_0x5fbb('0x60')](0x0,_0x33d49f[_0x5fbb('0x61')](_0x28f959));}_0x362cb6=new jsforce[(_0x5fbb('0x62'))]({'oauth2':{'loginUrl':_0x33d49f,'clientId':_0x317516[_0x5fbb('0x5a')],'clientSecret':_0x317516[_0x5fbb('0x5b')]}});return _0x362cb6[_0x5fbb('0x63')](_0x317516[_0x5fbb('0x5c')],_0x317516[_0x5fbb('0x5d')][_0x5fbb('0x64')](_0x317516['securityToken']));}})['then'](function(_0x2fb696){if(_0x2fb696){if(!_[_0x5fbb('0x65')](_0x1aef9f[_0x5fbb('0x32')][_0x5fbb('0x66')])){_0x58fb18=_0x1aef9f[_0x5fbb('0x32')][_0x5fbb('0x66')];}return _0x362cb6[_0x5fbb('0x67')](_0x58fb18)[_0x5fbb('0x68')]();}})[_0x5fbb('0x25')](function(_0x1b272c){var _0x312638=[_0x5fbb('0x69'),_0x5fbb('0x6a'),'IsReminderSet','IsRecurrence',_0x5fbb('0x6b'),_0x5fbb('0x6c')];var _0x304413=[_0x5fbb('0x6d'),_0x5fbb('0x6e'),_0x5fbb('0x6f'),'boolean',_0x5fbb('0x70'),_0x5fbb('0x71'),_0x5fbb('0x72')];if(_0x1b272c){_['remove'](_0x1b272c['fields'],function(_0x3711ab){return _0x312638['includes'](_0x3711ab[_0x5fbb('0x29')])||!_0x304413[_0x5fbb('0x73')](_0x3711ab[_0x5fbb('0x2f')]);});return{'count':_0x1b272c[_0x5fbb('0x37')][_0x5fbb('0x38')],'rows':_[_0x5fbb('0x2c')](_0x1b272c[_0x5fbb('0x37')],function(_0x275718){return{'id':_0x275718[_0x5fbb('0x29')],'name':_0x275718[_0x5fbb('0x74')],'custom':_0x275718['custom'],'options':_0x275718[_0x5fbb('0x75')][_0x5fbb('0x38')]>0x0?_[_0x5fbb('0x2c')](_0x275718['picklistValues'],function(_0x44ad90){return{'name':_0x44ad90[_0x5fbb('0x74')],'value':_0x44ad90[_0x5fbb('0x76')]};}):_0x275718['type']=='boolean'?[{'name':_0x5fbb('0x77'),'value':'true'},{'name':_0x5fbb('0x78'),'value':_0x5fbb('0x79')}]:[]};})};}})[_0x5fbb('0x25')](respondWithResult(_0x3c2326,null))[_0x5fbb('0x46')](function(_0x586a44){var _0x5b951d=_0x1aef9f[_0x5fbb('0x32')][_0x5fbb('0x7a')]?0x1f4:_0x586a44[_0x5fbb('0x7b')]||0x1f4;logger[_0x5fbb('0x27')](_0x5fbb('0x7c'),_0x5fbb('0x57'),_0x5b951d,JSON[_0x5fbb('0x7d')](_0x586a44));delete _0x586a44['name'];if(_0x5b951d===0x191){_0x5b951d=0x190;}_0x3c2326['status'](_0x5b951d)[_0x5fbb('0x2a')](_0x1aef9f['query'][_0x5fbb('0x7a')]?{'message':_0x5fbb('0x7e'),'statusCode':_0x586a44[_0x5fbb('0x7b')]}:_0x586a44);});};
\ No newline at end of file
+var _0x7d26=['merge','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','SalesforceConfiguration','length','options','addConfiguration','findOne','Subjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','password','slice','lastIndexOf','concat','securityToken','ticketType','sobject','describe','OwnerId','IsReminderSet','IsRecurrence','Subject','string','int','picklist','boolean','textarea','remove','custom','picklistValues','label','value','True','true','False','false','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','error','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter'];(function(_0x4fb55a,_0x35b72c){var _0x533821=function(_0x4e20ea){while(--_0x4e20ea){_0x4fb55a['push'](_0x4fb55a['shift']());}};_0x533821(++_0x35b72c);}(_0x7d26,0x199));var _0x67d2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7d26[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x67d2('0x0'));var rimraf=require(_0x67d2('0x1'));var zipdir=require(_0x67d2('0x2'));var jsonpatch=require(_0x67d2('0x3'));var rp=require('request-promise');var moment=require(_0x67d2('0x4'));var BPromise=require(_0x67d2('0x5'));var Mustache=require(_0x67d2('0x6'));var util=require(_0x67d2('0x7'));var path=require(_0x67d2('0x8'));var sox=require(_0x67d2('0x9'));var csv=require(_0x67d2('0xa'));var ejs=require(_0x67d2('0xb'));var fs=require('fs');var fs_extra=require(_0x67d2('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x67d2('0xd'));var deskjs=require(_0x67d2('0xe'));var toCsv=require(_0x67d2('0xa'));var querystring=require(_0x67d2('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x67d2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x67d2('0x11'))(_0x67d2('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x67d2('0x13'))['db'];var integrations=require(_0x67d2('0x14'));function respondWithStatusCode(_0x4a73d9,_0x56c0fd){_0x56c0fd=_0x56c0fd||0xcc;return function(_0x476735){if(_0x476735){return _0x4a73d9[_0x67d2('0x15')](_0x56c0fd);}return _0x4a73d9[_0x67d2('0x16')](_0x56c0fd)['end']();};}function respondWithResult(_0x60b2c,_0x43667f){_0x43667f=_0x43667f||0xc8;return function(_0x37d72e){if(_0x37d72e){return _0x60b2c['status'](_0x43667f)[_0x67d2('0x17')](_0x37d72e);}};}function respondWithFilteredResult(_0x5e5245,_0x518769){return function(_0x548857){if(_0x548857){var _0x37a5ed=typeof _0x518769[_0x67d2('0x18')]===_0x67d2('0x19')&&typeof _0x518769[_0x67d2('0x1a')]===_0x67d2('0x19');var _0x279b37=_0x548857[_0x67d2('0x1b')];var _0x5219a7=_0x37a5ed?0x0:_0x518769[_0x67d2('0x18')];var _0x32816e=_0x37a5ed?_0x548857['count']:_0x518769[_0x67d2('0x18')]+_0x518769['limit'];var _0x40ab43;if(_0x32816e>=_0x279b37){_0x32816e=_0x279b37;_0x40ab43=0xc8;}else{_0x40ab43=0xce;}_0x5e5245[_0x67d2('0x16')](_0x40ab43);return _0x5e5245[_0x67d2('0x1c')]('Content-Range',_0x5219a7+'-'+_0x32816e+'/'+_0x279b37)[_0x67d2('0x17')](_0x548857);}return null;};}function patchUpdates(_0x1bf66b){return function(_0x5e3a38){try{jsonpatch[_0x67d2('0x1d')](_0x5e3a38,_0x1bf66b,!![]);}catch(_0x559741){return BPromise[_0x67d2('0x1e')](_0x559741);}return _0x5e3a38[_0x67d2('0x1f')]();};}function saveUpdates(_0x2cb505,_0x55c7ce){return function(_0x3172ab){if(_0x3172ab){return _0x3172ab[_0x67d2('0x20')](_0x2cb505)['then'](function(_0x43ea77){return _0x43ea77;});}return null;};}function removeEntity(_0x1d02ff,_0x25932a){return function(_0x26d75c){if(_0x26d75c){return _0x26d75c[_0x67d2('0x21')]()[_0x67d2('0x22')](function(){_0x1d02ff[_0x67d2('0x16')](0xcc)[_0x67d2('0x23')]();});}};}function handleEntityNotFound(_0x4b018b,_0x14b9a9){return function(_0x33aa80){if(!_0x33aa80){_0x4b018b['sendStatus'](0x194);}return _0x33aa80;};}function handleError(_0x41097c,_0x3a4f4d){_0x3a4f4d=_0x3a4f4d||0x1f4;return function(_0xb9e1c5){logger[_0x67d2('0x24')](_0xb9e1c5['stack']);if(_0xb9e1c5[_0x67d2('0x25')]){delete _0xb9e1c5['name'];}_0x41097c[_0x67d2('0x16')](_0x3a4f4d)[_0x67d2('0x26')](_0xb9e1c5);};}exports[_0x67d2('0x27')]=function(_0x3a8de9,_0x197dc0){var _0x2a087d={},_0x2f0a59={},_0x44cd91={'count':0x0,'rows':[]};var _0x189928=_[_0x67d2('0x28')](db[_0x67d2('0x29')][_0x67d2('0x2a')],function(_0x5a6859){return{'name':_0x5a6859[_0x67d2('0x2b')],'type':_0x5a6859[_0x67d2('0x2c')]['key']};});_0x2f0a59[_0x67d2('0x2d')]=_['map'](_0x189928,'name');_0x2f0a59[_0x67d2('0x2e')]=_[_0x67d2('0x2f')](_0x3a8de9['query']);_0x2f0a59['filters']=_['intersection'](_0x2f0a59[_0x67d2('0x2d')],_0x2f0a59[_0x67d2('0x2e')]);_0x2a087d[_0x67d2('0x30')]=_[_0x67d2('0x31')](_0x2f0a59[_0x67d2('0x2d')],qs[_0x67d2('0x32')](_0x3a8de9[_0x67d2('0x2e')][_0x67d2('0x32')]));_0x2a087d['attributes']=_0x2a087d[_0x67d2('0x30')]['length']?_0x2a087d[_0x67d2('0x30')]:_0x2f0a59[_0x67d2('0x2d')];if(!_0x3a8de9[_0x67d2('0x2e')][_0x67d2('0x33')](_0x67d2('0x34'))){_0x2a087d[_0x67d2('0x1a')]=qs[_0x67d2('0x1a')](_0x3a8de9[_0x67d2('0x2e')][_0x67d2('0x1a')]);_0x2a087d[_0x67d2('0x18')]=qs[_0x67d2('0x18')](_0x3a8de9[_0x67d2('0x2e')][_0x67d2('0x18')]);}_0x2a087d[_0x67d2('0x35')]=qs[_0x67d2('0x36')](_0x3a8de9['query'][_0x67d2('0x36')]);_0x2a087d[_0x67d2('0x37')]=qs[_0x67d2('0x38')](_[_0x67d2('0x39')](_0x3a8de9[_0x67d2('0x2e')],_0x2f0a59[_0x67d2('0x38')]),_0x189928);if(_0x3a8de9[_0x67d2('0x2e')][_0x67d2('0x3a')]){_0x2a087d['where']=_[_0x67d2('0x3b')](_0x2a087d[_0x67d2('0x37')],{'$or':_[_0x67d2('0x28')](_0x189928,function(_0x472f34){if(_0x472f34[_0x67d2('0x2c')]!=='VIRTUAL'){var _0xbbddbb={};_0xbbddbb[_0x472f34['name']]={'$like':'%'+_0x3a8de9[_0x67d2('0x2e')]['filter']+'%'};return _0xbbddbb;}})});}_0x2a087d=_['merge']({},_0x2a087d,_0x3a8de9['options']);var _0x32fffb={'where':_0x2a087d[_0x67d2('0x37')]};return db['SalesforceAccount'][_0x67d2('0x1b')](_0x32fffb)[_0x67d2('0x22')](function(_0xb7426b){_0x44cd91[_0x67d2('0x1b')]=_0xb7426b;if(_0x3a8de9['query'][_0x67d2('0x3c')]){_0x2a087d[_0x67d2('0x3d')]=[{'all':!![]}];}return db[_0x67d2('0x29')][_0x67d2('0x3e')](_0x2a087d);})[_0x67d2('0x22')](function(_0x28d53c){_0x44cd91[_0x67d2('0x3f')]=_0x28d53c;return _0x44cd91;})[_0x67d2('0x22')](respondWithFilteredResult(_0x197dc0,_0x2a087d))[_0x67d2('0x40')](handleError(_0x197dc0,null));};exports[_0x67d2('0x41')]=function(_0x5d6559,_0x560412){var _0x466ff8={'raw':![],'where':{'id':_0x5d6559[_0x67d2('0x42')]['id']}},_0x527aba={};_0x527aba[_0x67d2('0x2d')]=_['keys'](db['SalesforceAccount'][_0x67d2('0x2a')]);_0x527aba['query']=_[_0x67d2('0x2f')](_0x5d6559[_0x67d2('0x2e')]);_0x527aba['filters']=_['intersection'](_0x527aba[_0x67d2('0x2d')],_0x527aba[_0x67d2('0x2e')]);_0x466ff8[_0x67d2('0x30')]=_['intersection'](_0x527aba[_0x67d2('0x2d')],qs[_0x67d2('0x32')](_0x5d6559['query']['fields']));_0x466ff8[_0x67d2('0x30')]=_0x466ff8['attributes']['length']?_0x466ff8['attributes']:_0x527aba[_0x67d2('0x2d')];if(_0x5d6559[_0x67d2('0x2e')][_0x67d2('0x3c')]){_0x466ff8[_0x67d2('0x3d')]=[{'all':!![]}];}_0x466ff8=_[_0x67d2('0x3b')]({},_0x466ff8,_0x5d6559['options']);return db[_0x67d2('0x29')][_0x67d2('0x43')](_0x466ff8)[_0x67d2('0x22')](handleEntityNotFound(_0x560412,null))[_0x67d2('0x22')](respondWithResult(_0x560412,null))[_0x67d2('0x40')](handleError(_0x560412,null));};exports['create']=function(_0x3937fe,_0x5144ff){return db[_0x67d2('0x29')][_0x67d2('0x44')](_0x3937fe[_0x67d2('0x45')],{})[_0x67d2('0x22')](respondWithResult(_0x5144ff,0xc9))[_0x67d2('0x40')](handleError(_0x5144ff,null));};exports[_0x67d2('0x20')]=function(_0x36a61e,_0x2bc095){if(_0x36a61e[_0x67d2('0x45')]['id']){delete _0x36a61e[_0x67d2('0x45')]['id'];}return db[_0x67d2('0x29')][_0x67d2('0x43')]({'where':{'id':_0x36a61e[_0x67d2('0x42')]['id']}})[_0x67d2('0x22')](handleEntityNotFound(_0x2bc095,null))[_0x67d2('0x22')](saveUpdates(_0x36a61e[_0x67d2('0x45')],null))['then'](respondWithResult(_0x2bc095,null))[_0x67d2('0x40')](handleError(_0x2bc095,null));};exports[_0x67d2('0x21')]=function(_0x12b9b7,_0x1de153){return db[_0x67d2('0x29')][_0x67d2('0x43')]({'where':{'id':_0x12b9b7['params']['id']}})['then'](handleEntityNotFound(_0x1de153,null))[_0x67d2('0x22')](removeEntity(_0x1de153,null))[_0x67d2('0x40')](handleError(_0x1de153,null));};exports[_0x67d2('0x46')]=function(_0x38a80a,_0x44470a,_0x5c69bb){var _0x411c2d={};var _0x453530={};var _0x192096;var _0xf99b4b;return db[_0x67d2('0x29')]['findOne']({'where':{'id':_0x38a80a[_0x67d2('0x42')]['id']}})[_0x67d2('0x22')](handleEntityNotFound(_0x44470a,null))['then'](function(_0x5aa45e){if(_0x5aa45e){_0x192096=_0x5aa45e;_0x453530[_0x67d2('0x2d')]=_[_0x67d2('0x2f')](db[_0x67d2('0x47')][_0x67d2('0x2a')]);_0x453530['query']=_[_0x67d2('0x2f')](_0x38a80a[_0x67d2('0x2e')]);_0x453530['filters']=_[_0x67d2('0x31')](_0x453530['model'],_0x453530[_0x67d2('0x2e')]);_0x411c2d[_0x67d2('0x30')]=_['intersection'](_0x453530[_0x67d2('0x2d')],qs['fields'](_0x38a80a[_0x67d2('0x2e')][_0x67d2('0x32')]));_0x411c2d[_0x67d2('0x30')]=_0x411c2d[_0x67d2('0x30')][_0x67d2('0x48')]?_0x411c2d[_0x67d2('0x30')]:_0x453530[_0x67d2('0x2d')];_0x411c2d[_0x67d2('0x35')]=qs[_0x67d2('0x36')](_0x38a80a[_0x67d2('0x2e')][_0x67d2('0x36')]);_0x411c2d['where']=qs[_0x67d2('0x38')](_[_0x67d2('0x39')](_0x38a80a['query'],_0x453530[_0x67d2('0x38')]));if(_0x38a80a[_0x67d2('0x2e')][_0x67d2('0x3a')]){_0x411c2d[_0x67d2('0x37')]=_[_0x67d2('0x3b')](_0x411c2d[_0x67d2('0x37')],{'$or':_[_0x67d2('0x28')](_0x411c2d[_0x67d2('0x30')],function(_0x5d8b7b){var _0x58a329={};_0x58a329[_0x5d8b7b]={'$like':'%'+_0x38a80a[_0x67d2('0x2e')]['filter']+'%'};return _0x58a329;})});}_0x411c2d=_[_0x67d2('0x3b')]({},_0x411c2d,_0x38a80a[_0x67d2('0x49')]);return _0x192096['getConfigurations'](_0x411c2d);}})[_0x67d2('0x22')](function(_0x2ffe68){if(_0x2ffe68){_0xf99b4b=_0x2ffe68[_0x67d2('0x48')];if(!_0x38a80a[_0x67d2('0x2e')][_0x67d2('0x33')](_0x67d2('0x34'))){_0x411c2d['limit']=qs[_0x67d2('0x1a')](_0x38a80a[_0x67d2('0x2e')][_0x67d2('0x1a')]);_0x411c2d[_0x67d2('0x18')]=qs[_0x67d2('0x18')](_0x38a80a['query'][_0x67d2('0x18')]);}return _0x192096[_0x67d2('0x46')](_0x411c2d);}})[_0x67d2('0x22')](function(_0x48ca6d){if(_0x48ca6d){return _0x48ca6d?{'count':_0xf99b4b,'rows':_0x48ca6d}:null;}})[_0x67d2('0x22')](respondWithResult(_0x44470a,null))[_0x67d2('0x40')](handleError(_0x44470a,null));};exports[_0x67d2('0x4a')]=function(_0x3af17f,_0x27634b,_0x7b6bc9){if(_0x3af17f['body']['id']){delete _0x3af17f[_0x67d2('0x45')]['id'];}return db[_0x67d2('0x29')][_0x67d2('0x4b')]({'where':{'id':_0x3af17f['params']['id']}})[_0x67d2('0x22')](handleEntityNotFound(_0x27634b,null))[_0x67d2('0x22')](function(_0x2f4f6a){if(_0x2f4f6a){_0x3af17f['body']['AccountId']=_0x2f4f6a['id'];_0x3af17f[_0x67d2('0x45')][_0x67d2('0x4c')]=integrations['getSubjects'](_0x3af17f[_0x67d2('0x45')][_0x67d2('0x4d')],_0x3af17f[_0x67d2('0x45')][_0x67d2('0x2c')]);_0x3af17f[_0x67d2('0x45')][_0x67d2('0x4e')]=integrations[_0x67d2('0x4f')](_0x3af17f[_0x67d2('0x45')][_0x67d2('0x4d')],_0x3af17f['body']['type']);return db[_0x67d2('0x47')][_0x67d2('0x44')](_0x3af17f['body'],{'include':[{'model':db[_0x67d2('0x50')],'as':_0x67d2('0x4c')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0x67d2('0x22')](respondWithResult(_0x27634b,null))['catch'](handleError(_0x27634b,null));};exports[_0x67d2('0x51')]=function(_0x8b2c05,_0x4f0c82,_0x100d38){var _0x4d74b5;var _0x5bccfe='';var _0x144e80=_0x67d2('0x52');return db[_0x67d2('0x29')][_0x67d2('0x4b')]({'where':{'id':_0x8b2c05[_0x67d2('0x42')]['id']},'attributes':['id',_0x67d2('0x53'),_0x67d2('0x54'),_0x67d2('0x55'),'username',_0x67d2('0x56'),'securityToken']})[_0x67d2('0x22')](handleEntityNotFound(_0x4f0c82,null))[_0x67d2('0x22')](function(_0x35a1af){if(_0x35a1af){_0x5bccfe=_0x35a1af[_0x67d2('0x53')];var _0x4a7aa8=_0x5bccfe[_0x67d2('0x57')](-0x1);if(_0x4a7aa8==='/'){_0x5bccfe=_0x5bccfe['substring'](0x0,_0x5bccfe[_0x67d2('0x58')](_0x4a7aa8));}_0x4d74b5=new jsforce['Connection']({'oauth2':{'loginUrl':_0x5bccfe,'clientId':_0x35a1af[_0x67d2('0x54')],'clientSecret':_0x35a1af['clientSecret']}});return _0x4d74b5['login'](_0x35a1af['username'],_0x35a1af[_0x67d2('0x56')][_0x67d2('0x59')](_0x35a1af[_0x67d2('0x5a')]));}})[_0x67d2('0x22')](function(_0x24bc37){if(_0x24bc37){if(!_['isNil'](_0x8b2c05[_0x67d2('0x2e')][_0x67d2('0x5b')])){_0x144e80=_0x8b2c05[_0x67d2('0x2e')][_0x67d2('0x5b')];}return _0x4d74b5[_0x67d2('0x5c')](_0x144e80)[_0x67d2('0x5d')]();}})[_0x67d2('0x22')](function(_0x447ddc){var _0x10ca2e=[_0x67d2('0x5e'),'ActivityDate',_0x67d2('0x5f'),_0x67d2('0x60'),_0x67d2('0x61'),'Description'];var _0x282865=[_0x67d2('0x62'),_0x67d2('0x63'),_0x67d2('0x64'),_0x67d2('0x65'),'email',_0x67d2('0x66'),'phone'];if(_0x447ddc){_[_0x67d2('0x67')](_0x447ddc['fields'],function(_0x2788c4){return _0x10ca2e['includes'](_0x2788c4['name'])||!_0x282865['includes'](_0x2788c4[_0x67d2('0x2c')]);});return{'count':_0x447ddc[_0x67d2('0x32')][_0x67d2('0x48')],'rows':_['map'](_0x447ddc[_0x67d2('0x32')],function(_0x26cf4f){return{'id':_0x26cf4f[_0x67d2('0x25')],'name':_0x26cf4f['label'],'custom':_0x26cf4f[_0x67d2('0x68')],'options':_0x26cf4f[_0x67d2('0x69')][_0x67d2('0x48')]>0x0?_['map'](_0x26cf4f['picklistValues'],function(_0x2b720a){return{'name':_0x2b720a[_0x67d2('0x6a')],'value':_0x2b720a[_0x67d2('0x6b')]};}):_0x26cf4f[_0x67d2('0x2c')]==_0x67d2('0x65')?[{'name':_0x67d2('0x6c'),'value':_0x67d2('0x6d')},{'name':_0x67d2('0x6e'),'value':_0x67d2('0x6f')}]:[]};})};}})[_0x67d2('0x22')](respondWithResult(_0x4f0c82,null))[_0x67d2('0x40')](function(_0x40ab0b){var _0x3d848f=_0x8b2c05[_0x67d2('0x2e')][_0x67d2('0x70')]?0x1f4:_0x40ab0b['statusCode']||0x1f4;logger[_0x67d2('0x24')](_0x67d2('0x71'),'getFields',_0x3d848f,JSON[_0x67d2('0x72')](_0x40ab0b));delete _0x40ab0b['name'];if(_0x3d848f===0x191){_0x3d848f=0x190;}_0x4f0c82[_0x67d2('0x16')](_0x3d848f)['send'](_0x8b2c05['query'][_0x67d2('0x70')]?{'message':_0x67d2('0x73'),'statusCode':_0x40ab0b[_0x67d2('0x74')]}:_0x40ab0b);});};
\ No newline at end of file
index c944dcd..456c029 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f08=['SalesforceAccount','int_salesforce_accounts','lodash','util','api','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports'];(function(_0xde9846,_0x191f4e){var _0x303757=function(_0x1cad2d){while(--_0x1cad2d){_0xde9846['push'](_0xde9846['shift']());}};_0x303757(++_0x191f4e);}(_0x4f08,0xaa));var _0x84f0=function(_0x18db6f,_0x32d5a7){_0x18db6f=_0x18db6f-0x0;var _0x427db2=_0x4f08[_0x18db6f];return _0x427db2;};'use strict';var _=require(_0x84f0('0x0'));var util=require(_0x84f0('0x1'));var logger=require('../../config/logger')(_0x84f0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x84f0('0x3'));var fs=require('fs');var path=require(_0x84f0('0x4'));var rimraf=require(_0x84f0('0x5'));var config=require(_0x84f0('0x6'));var attributes=require(_0x84f0('0x7'));var integrations=require(_0x84f0('0x8'));module[_0x84f0('0x9')]=function(_0x94c8b,_0x26bd5d){return _0x94c8b['define'](_0x84f0('0xa'),attributes,{'tableName':_0x84f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2bc1=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','SalesforceAccount','int_salesforce_accounts'];(function(_0x306a25,_0x44986b){var _0x3bc9e0=function(_0xb8ce87){while(--_0xb8ce87){_0x306a25['push'](_0x306a25['shift']());}};_0x3bc9e0(++_0x44986b);}(_0x2bc1,0x11e));var _0x12bc=function(_0x5d475e,_0x539bbc){_0x5d475e=_0x5d475e-0x0;var _0x2720a5=_0x2bc1[_0x5d475e];return _0x2720a5;};'use strict';var _=require('lodash');var util=require(_0x12bc('0x0'));var logger=require(_0x12bc('0x1'))('api');var moment=require(_0x12bc('0x2'));var BPromise=require('bluebird');var rp=require(_0x12bc('0x3'));var fs=require('fs');var path=require(_0x12bc('0x4'));var rimraf=require(_0x12bc('0x5'));var config=require(_0x12bc('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x12bc('0x7')]=function(_0x28b14e,_0x31f56e){return _0x28b14e[_0x12bc('0x8')](_0x12bc('0x9'),attributes,{'tableName':_0x12bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1b02aa6..e940ff3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd0c=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','options','raw','attributes','include','map','model','find','where'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0xdd0c,0x1ad));var _0xcdd0=function(_0x530b84,_0x10ab14){_0x530b84=_0x530b84-0x0;var _0x4a1b95=_0xdd0c[_0x530b84];return _0x4a1b95;};'use strict';var _=require(_0xcdd0('0x0'));var util=require(_0xcdd0('0x1'));var moment=require(_0xcdd0('0x2'));var BPromise=require(_0xcdd0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdd0('0x4'));var db=require(_0xcdd0('0x5'))['db'];var utils=require(_0xcdd0('0x6'));var logger=require(_0xcdd0('0x7'))(_0xcdd0('0x8'));var config=require('../../config/environment');var jayson=require(_0xcdd0('0x9'));var client=jayson[_0xcdd0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x94394b,_0x288539,_0x2214c7){return new BPromise(function(_0x13e27d,_0x1e0482){return client[_0xcdd0('0xb')](_0x94394b,_0x2214c7)[_0xcdd0('0xc')](function(_0xcbc640){logger[_0xcdd0('0xd')](_0xcdd0('0xe'),_0x288539,_0xcdd0('0xf'));logger[_0xcdd0('0x10')](_0xcdd0('0x11'),_0x288539,_0xcdd0('0xf'),JSON[_0xcdd0('0x12')](_0xcbc640));if(_0xcbc640[_0xcdd0('0x13')]){if(_0xcbc640[_0xcdd0('0x13')][_0xcdd0('0x14')]===0x1f4){logger[_0xcdd0('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x288539,_0xcbc640[_0xcdd0('0x13')][_0xcdd0('0x15')]);return _0x1e0482(_0xcbc640['error'][_0xcdd0('0x15')]);}logger[_0xcdd0('0x13')](_0xcdd0('0xe'),_0x288539,_0xcbc640[_0xcdd0('0x13')]['message']);return _0x13e27d(_0xcbc640[_0xcdd0('0x13')][_0xcdd0('0x15')]);}else{logger[_0xcdd0('0xd')](_0xcdd0('0xe'),_0x288539,_0xcdd0('0xf'));_0x13e27d(_0xcbc640[_0xcdd0('0x16')][_0xcdd0('0x15')]);}})[_0xcdd0('0x17')](function(_0x2bf86e){logger[_0xcdd0('0x13')](_0xcdd0('0xe'),_0x288539,_0x2bf86e);_0x1e0482(_0x2bf86e);});});}exports[_0xcdd0('0x18')]=function(_0x1376a8){var _0x11f5be=this;return new Promise(function(_0x3b32cc,_0x2bcdcb){return db['SalesforceAccount']['findAll']({'raw':_0x1376a8[_0xcdd0('0x19')]?_0x1376a8[_0xcdd0('0x19')][_0xcdd0('0x1a')]===undefined?!![]:![]:!![],'where':_0x1376a8[_0xcdd0('0x19')]?_0x1376a8[_0xcdd0('0x19')]['where']||null:null,'attributes':_0x1376a8[_0xcdd0('0x19')]?_0x1376a8[_0xcdd0('0x19')][_0xcdd0('0x1b')]||null:null,'limit':_0x1376a8[_0xcdd0('0x19')]?_0x1376a8[_0xcdd0('0x19')]['limit']||null:null,'include':_0x1376a8['options']?_0x1376a8[_0xcdd0('0x19')][_0xcdd0('0x1c')]?_[_0xcdd0('0x1d')](_0x1376a8['options']['include'],function(_0x5d2f58){return{'model':db[_0x5d2f58[_0xcdd0('0x1e')]],'as':_0x5d2f58['as'],'attributes':_0x5d2f58[_0xcdd0('0x1b')],'include':_0x5d2f58['include']?_['map'](_0x5d2f58[_0xcdd0('0x1c')],function(_0x50017a){return{'model':db[_0x50017a['model']],'as':_0x50017a['as'],'attributes':_0x50017a[_0xcdd0('0x1b')],'include':_0x50017a[_0xcdd0('0x1c')]?_[_0xcdd0('0x1d')](_0x50017a[_0xcdd0('0x1c')],function(_0x4c5c1d){return{'model':db[_0x4c5c1d[_0xcdd0('0x1e')]],'as':_0x4c5c1d['as'],'attributes':_0x4c5c1d['attributes']};}):[]};}):[]};}):[]:[]})[_0xcdd0('0xc')](function(_0x5dad94){logger[_0xcdd0('0xd')](_0xcdd0('0x18'),_0x1376a8);logger[_0xcdd0('0x10')](_0xcdd0('0x18'),_0x1376a8,JSON[_0xcdd0('0x12')](_0x5dad94));_0x3b32cc(_0x5dad94);})[_0xcdd0('0x17')](function(_0x33eb6f){logger[_0xcdd0('0x13')](_0xcdd0('0x18'),_0x33eb6f['message'],_0x1376a8);_0x2bcdcb(_0x11f5be['error'](0x1f4,_0x33eb6f[_0xcdd0('0x15')]));});});};exports['ShowSalesforceAccount']=function(_0x12157e){var _0x2f01f9=this;return new Promise(function(_0x536bda,_0x1876b1){return db['SalesforceAccount'][_0xcdd0('0x1f')]({'raw':_0x12157e[_0xcdd0('0x19')]?_0x12157e[_0xcdd0('0x19')][_0xcdd0('0x1a')]===undefined?!![]:![]:!![],'where':_0x12157e[_0xcdd0('0x19')]?_0x12157e['options'][_0xcdd0('0x20')]||null:null,'attributes':_0x12157e[_0xcdd0('0x19')]?_0x12157e[_0xcdd0('0x19')][_0xcdd0('0x1b')]||null:null,'include':_0x12157e[_0xcdd0('0x19')]?_0x12157e['options'][_0xcdd0('0x1c')]?_[_0xcdd0('0x1d')](_0x12157e['options'][_0xcdd0('0x1c')],function(_0x3cb764){return{'model':db[_0x3cb764['model']],'as':_0x3cb764['as'],'attributes':_0x3cb764['attributes'],'include':_0x3cb764[_0xcdd0('0x1c')]?_[_0xcdd0('0x1d')](_0x3cb764[_0xcdd0('0x1c')],function(_0x3e8034){return{'model':db[_0x3e8034[_0xcdd0('0x1e')]],'as':_0x3e8034['as'],'attributes':_0x3e8034['attributes'],'include':_0x3e8034[_0xcdd0('0x1c')]?_[_0xcdd0('0x1d')](_0x3e8034[_0xcdd0('0x1c')],function(_0x1dc411){return{'model':db[_0x1dc411[_0xcdd0('0x1e')]],'as':_0x1dc411['as'],'attributes':_0x1dc411['attributes']};}):[]};}):[]};}):[]:[]})[_0xcdd0('0xc')](function(_0x5b6aef){logger[_0xcdd0('0xd')]('ShowSalesforceAccount',_0x12157e);logger[_0xcdd0('0x10')]('ShowSalesforceAccount',_0x12157e,JSON[_0xcdd0('0x12')](_0x5b6aef));_0x536bda(_0x5b6aef);})[_0xcdd0('0x17')](function(_0x3fbaac){logger[_0xcdd0('0x13')]('ShowSalesforceAccount',_0x3fbaac[_0xcdd0('0x15')],_0x12157e);_0x1876b1(_0x2f01f9['error'](0x1f4,_0x3fbaac[_0xcdd0('0x15')]));});});};
\ No newline at end of file
+var _0x3cfd=['SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','attributes','limit','include','map','model','catch','ShowSalesforceAccount','find','where','debug','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3cfd,0xe2));var _0xd3cf=function(_0x188b07,_0x44a306){_0x188b07=_0x188b07-0x0;var _0x437aae=_0x3cfd[_0x188b07];return _0x437aae;};'use strict';var _=require(_0xd3cf('0x0'));var util=require(_0xd3cf('0x1'));var moment=require('moment');var BPromise=require(_0xd3cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3cf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd3cf('0x4'));var logger=require(_0xd3cf('0x5'))('rpc');var config=require(_0xd3cf('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd3cf('0x7')][_0xd3cf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53760d,_0x91a581,_0x861627){return new BPromise(function(_0x1027a9,_0x1ca532){return client[_0xd3cf('0x9')](_0x53760d,_0x861627)[_0xd3cf('0xa')](function(_0x189ff2){logger[_0xd3cf('0xb')](_0xd3cf('0xc'),_0x91a581,'request\x20sent');logger['debug'](_0xd3cf('0xd'),_0x91a581,'request\x20sent',JSON[_0xd3cf('0xe')](_0x189ff2));if(_0x189ff2[_0xd3cf('0xf')]){if(_0x189ff2[_0xd3cf('0xf')][_0xd3cf('0x10')]===0x1f4){logger[_0xd3cf('0xf')](_0xd3cf('0xc'),_0x91a581,_0x189ff2['error'][_0xd3cf('0x11')]);return _0x1ca532(_0x189ff2[_0xd3cf('0xf')]['message']);}logger[_0xd3cf('0xf')](_0xd3cf('0xc'),_0x91a581,_0x189ff2['error'][_0xd3cf('0x11')]);return _0x1027a9(_0x189ff2[_0xd3cf('0xf')]['message']);}else{logger[_0xd3cf('0xb')](_0xd3cf('0xc'),_0x91a581,_0xd3cf('0x12'));_0x1027a9(_0x189ff2['result']['message']);}})['catch'](function(_0x29fea7){logger[_0xd3cf('0xf')](_0xd3cf('0xc'),_0x91a581,_0x29fea7);_0x1ca532(_0x29fea7);});});}exports[_0xd3cf('0x13')]=function(_0x1b8a94){var _0xd83869=this;return new Promise(function(_0x3d229e,_0x5cb496){return db[_0xd3cf('0x14')][_0xd3cf('0x15')]({'raw':_0x1b8a94[_0xd3cf('0x16')]?_0x1b8a94[_0xd3cf('0x16')][_0xd3cf('0x17')]===undefined?!![]:![]:!![],'where':_0x1b8a94[_0xd3cf('0x16')]?_0x1b8a94[_0xd3cf('0x16')]['where']||null:null,'attributes':_0x1b8a94['options']?_0x1b8a94[_0xd3cf('0x16')][_0xd3cf('0x18')]||null:null,'limit':_0x1b8a94[_0xd3cf('0x16')]?_0x1b8a94['options'][_0xd3cf('0x19')]||null:null,'include':_0x1b8a94[_0xd3cf('0x16')]?_0x1b8a94[_0xd3cf('0x16')][_0xd3cf('0x1a')]?_[_0xd3cf('0x1b')](_0x1b8a94[_0xd3cf('0x16')][_0xd3cf('0x1a')],function(_0x58bc83){return{'model':db[_0x58bc83[_0xd3cf('0x1c')]],'as':_0x58bc83['as'],'attributes':_0x58bc83[_0xd3cf('0x18')],'include':_0x58bc83[_0xd3cf('0x1a')]?_[_0xd3cf('0x1b')](_0x58bc83['include'],function(_0x3e7517){return{'model':db[_0x3e7517[_0xd3cf('0x1c')]],'as':_0x3e7517['as'],'attributes':_0x3e7517[_0xd3cf('0x18')],'include':_0x3e7517[_0xd3cf('0x1a')]?_[_0xd3cf('0x1b')](_0x3e7517[_0xd3cf('0x1a')],function(_0x534aaf){return{'model':db[_0x534aaf[_0xd3cf('0x1c')]],'as':_0x534aaf['as'],'attributes':_0x534aaf[_0xd3cf('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd3cf('0xa')](function(_0x53e225){logger[_0xd3cf('0xb')](_0xd3cf('0x13'),_0x1b8a94);logger['debug'](_0xd3cf('0x13'),_0x1b8a94,JSON['stringify'](_0x53e225));_0x3d229e(_0x53e225);})[_0xd3cf('0x1d')](function(_0x4f580b){logger[_0xd3cf('0xf')]('GetSalesforceAccount',_0x4f580b[_0xd3cf('0x11')],_0x1b8a94);_0x5cb496(_0xd83869[_0xd3cf('0xf')](0x1f4,_0x4f580b['message']));});});};exports[_0xd3cf('0x1e')]=function(_0x441a78){var _0x4f2d01=this;return new Promise(function(_0x277fea,_0x151b0b){return db[_0xd3cf('0x14')][_0xd3cf('0x1f')]({'raw':_0x441a78[_0xd3cf('0x16')]?_0x441a78[_0xd3cf('0x16')][_0xd3cf('0x17')]===undefined?!![]:![]:!![],'where':_0x441a78[_0xd3cf('0x16')]?_0x441a78['options'][_0xd3cf('0x20')]||null:null,'attributes':_0x441a78[_0xd3cf('0x16')]?_0x441a78[_0xd3cf('0x16')][_0xd3cf('0x18')]||null:null,'include':_0x441a78[_0xd3cf('0x16')]?_0x441a78[_0xd3cf('0x16')][_0xd3cf('0x1a')]?_[_0xd3cf('0x1b')](_0x441a78[_0xd3cf('0x16')][_0xd3cf('0x1a')],function(_0x3f7e63){return{'model':db[_0x3f7e63[_0xd3cf('0x1c')]],'as':_0x3f7e63['as'],'attributes':_0x3f7e63[_0xd3cf('0x18')],'include':_0x3f7e63[_0xd3cf('0x1a')]?_[_0xd3cf('0x1b')](_0x3f7e63[_0xd3cf('0x1a')],function(_0x10cb88){return{'model':db[_0x10cb88[_0xd3cf('0x1c')]],'as':_0x10cb88['as'],'attributes':_0x10cb88[_0xd3cf('0x18')],'include':_0x10cb88[_0xd3cf('0x1a')]?_[_0xd3cf('0x1b')](_0x10cb88[_0xd3cf('0x1a')],function(_0x13456a){return{'model':db[_0x13456a[_0xd3cf('0x1c')]],'as':_0x13456a['as'],'attributes':_0x13456a[_0xd3cf('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x111596){logger[_0xd3cf('0xb')](_0xd3cf('0x1e'),_0x441a78);logger[_0xd3cf('0x21')](_0xd3cf('0x1e'),_0x441a78,JSON[_0xd3cf('0xe')](_0x111596));_0x277fea(_0x111596);})[_0xd3cf('0x1d')](function(_0x26dadc){logger['error'](_0xd3cf('0x1e'),_0x26dadc['message'],_0x441a78);_0x151b0b(_0x4f2d01['error'](0x1f4,_0x26dadc[_0xd3cf('0x11')]));});});};
\ No newline at end of file
index 1c28ed4..83d23ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x4d5a23,_0x370605){var _0x1099a0=function(_0x5e0ba1){while(--_0x5e0ba1){_0x4d5a23['push'](_0x4d5a23['shift']());}};_0x1099a0(++_0x370605);}(_0x7a54,0x106));var _0x47a5=function(_0x372e3c,_0x45b9a4){_0x372e3c=_0x372e3c-0x0;var _0x3b338e=_0x7a54[_0x372e3c];return _0x3b338e;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router;
\ No newline at end of file
+var _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(_0x4e8f62,_0x1e7c5e){var _0x49f4e0=function(_0xce86e1){while(--_0xce86e1){_0x4e8f62['push'](_0x4e8f62['shift']());}};_0x49f4e0(++_0x1e7c5e);}(_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 5cdea1a..056d12d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a48=['Task','Case','ENUM','contact_lead','contact','lead','account_contact_lead','nothing','sequelize','exports','STRING'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x9a48,0xc3));var _0x89a4=function(_0x55bf96,_0x7267a7){_0x55bf96=_0x55bf96-0x0;var _0x5092ef=_0x9a48[_0x55bf96];return _0x5092ef;};'use strict';var Sequelize=require(_0x89a4('0x0'));module[_0x89a4('0x1')]={'name':{'type':Sequelize[_0x89a4('0x2')]},'description':{'type':Sequelize[_0x89a4('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x89a4('0x3'),_0x89a4('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x89a4('0x5')](_0x89a4('0x6'),_0x89a4('0x7'),_0x89a4('0x8'),_0x89a4('0x9'),'account'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x89a4('0x5')](_0x89a4('0xa'),'contact',_0x89a4('0x8'),'account'),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x89a4('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x89a4('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x13cc=['nothing','lead','account','STRING','Task','Case','ENUM','contact_lead','contact','account_contact_lead'];(function(_0x44c4d8,_0x47297d){var _0x536772=function(_0x3465f1){while(--_0x3465f1){_0x44c4d8['push'](_0x44c4d8['shift']());}};_0x536772(++_0x47297d);}(_0x13cc,0x161));var _0xc13c=function(_0x27286c,_0x355474){_0x27286c=_0x27286c-0x0;var _0x4cdfc2=_0x13cc[_0x27286c];return _0x4cdfc2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc13c('0x0')]},'description':{'type':Sequelize[_0xc13c('0x0')]},'ticketType':{'type':Sequelize['ENUM'](_0xc13c('0x1'),_0xc13c('0x2')),'defaultValue':_0xc13c('0x1')},'moduleSearch':{'type':Sequelize[_0xc13c('0x3')](_0xc13c('0x4'),_0xc13c('0x5'),'lead',_0xc13c('0x6'),'account'),'defaultValue':_0xc13c('0x4')},'moduleCreate':{'type':Sequelize[_0xc13c('0x3')](_0xc13c('0x7'),_0xc13c('0x5'),_0xc13c('0x8'),_0xc13c('0x9')),'defaultValue':_0xc13c('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xc13c('0x0')]}};
\ No newline at end of file
index dcaa3ad..3f21888 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc911=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','send','index','map','SalesforceConfiguration','fieldName','type','key','name','query','keys','intersection','attributes','model','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','rawAttributes','fields','options','find','create','body','params','getFields','findOne','SalesforceField','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring'];(function(_0x199749,_0x2e1074){var _0x3149d3=function(_0x1e0b8c){while(--_0x1e0b8c){_0x199749['push'](_0x199749['shift']());}};_0x3149d3(++_0x2e1074);}(_0xc911,0x9a));var _0x1c91=function(_0x8c98fc,_0xb4340d){_0x8c98fc=_0x8c98fc-0x0;var _0x8d5bb0=_0xc911[_0x8c98fc];return _0x8d5bb0;};'use strict';var emlformat=require(_0x1c91('0x0'));var rimraf=require(_0x1c91('0x1'));var zipdir=require(_0x1c91('0x2'));var jsonpatch=require(_0x1c91('0x3'));var rp=require(_0x1c91('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1c91('0x5'));var util=require(_0x1c91('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1c91('0x7'));var ejs=require(_0x1c91('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c91('0x9'));var squel=require(_0x1c91('0xa'));var crypto=require(_0x1c91('0xb'));var jsforce=require(_0x1c91('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1c91('0x7'));var querystring=require(_0x1c91('0xd'));var Papa=require(_0x1c91('0xe'));var Redis=require(_0x1c91('0xf'));var authService=require(_0x1c91('0x10'));var qs=require(_0x1c91('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1c91('0x12'));var logger=require(_0x1c91('0x13'))(_0x1c91('0x14'));var utils=require(_0x1c91('0x15'));var config=require(_0x1c91('0x16'));var licenseUtil=require(_0x1c91('0x17'));var db=require(_0x1c91('0x18'))['db'];function respondWithStatusCode(_0x30921c,_0x5b412c){_0x5b412c=_0x5b412c||0xcc;return function(_0x187f44){if(_0x187f44){return _0x30921c[_0x1c91('0x19')](_0x5b412c);}return _0x30921c['status'](_0x5b412c)[_0x1c91('0x1a')]();};}function respondWithResult(_0x1d4df4,_0x1b14fe){_0x1b14fe=_0x1b14fe||0xc8;return function(_0x11532e){if(_0x11532e){return _0x1d4df4[_0x1c91('0x1b')](_0x1b14fe)[_0x1c91('0x1c')](_0x11532e);}};}function respondWithFilteredResult(_0x2ab3c6,_0x37da15){return function(_0x15777f){if(_0x15777f){var _0x43f9ec=typeof _0x37da15[_0x1c91('0x1d')]==='undefined'&&typeof _0x37da15[_0x1c91('0x1e')]===_0x1c91('0x1f');var _0x494564=_0x15777f[_0x1c91('0x20')];var _0x2d6bd6=_0x43f9ec?0x0:_0x37da15[_0x1c91('0x1d')];var _0x5c38af=_0x43f9ec?_0x15777f[_0x1c91('0x20')]:_0x37da15[_0x1c91('0x1d')]+_0x37da15[_0x1c91('0x1e')];var _0x1e4b3d;if(_0x5c38af>=_0x494564){_0x5c38af=_0x494564;_0x1e4b3d=0xc8;}else{_0x1e4b3d=0xce;}_0x2ab3c6['status'](_0x1e4b3d);return _0x2ab3c6[_0x1c91('0x21')](_0x1c91('0x22'),_0x2d6bd6+'-'+_0x5c38af+'/'+_0x494564)['json'](_0x15777f);}return null;};}function patchUpdates(_0x5672ea){return function(_0x25138d){try{jsonpatch[_0x1c91('0x23')](_0x25138d,_0x5672ea,!![]);}catch(_0x503ecc){return BPromise[_0x1c91('0x24')](_0x503ecc);}return _0x25138d[_0x1c91('0x25')]();};}function saveUpdates(_0x3ad9b0,_0x4b71e0){return function(_0x339311){if(_0x339311){return _0x339311[_0x1c91('0x26')](_0x3ad9b0)['then'](function(_0x3a5f14){return _0x3a5f14;});}return null;};}function removeEntity(_0x13853e,_0x5199f5){return function(_0x3fcec2){if(_0x3fcec2){return _0x3fcec2[_0x1c91('0x27')]()[_0x1c91('0x28')](function(){_0x13853e[_0x1c91('0x1b')](0xcc)[_0x1c91('0x1a')]();});}};}function handleEntityNotFound(_0x27aa0d,_0x3876e3){return function(_0x4340c8){if(!_0x4340c8){_0x27aa0d[_0x1c91('0x19')](0x194);}return _0x4340c8;};}function handleError(_0x56b85c,_0x16e4ed){_0x16e4ed=_0x16e4ed||0x1f4;return function(_0x46b11b){logger[_0x1c91('0x29')](_0x46b11b[_0x1c91('0x2a')]);if(_0x46b11b['name']){delete _0x46b11b['name'];}_0x56b85c['status'](_0x16e4ed)[_0x1c91('0x2b')](_0x46b11b);};}exports[_0x1c91('0x2c')]=function(_0x117fcc,_0x1b79d2){var _0x4b859d={},_0x1ad249={},_0x20770d={'count':0x0,'rows':[]};var _0x556221=_[_0x1c91('0x2d')](db[_0x1c91('0x2e')]['rawAttributes'],function(_0x274a2b){return{'name':_0x274a2b[_0x1c91('0x2f')],'type':_0x274a2b[_0x1c91('0x30')][_0x1c91('0x31')]};});_0x1ad249['model']=_[_0x1c91('0x2d')](_0x556221,_0x1c91('0x32'));_0x1ad249[_0x1c91('0x33')]=_[_0x1c91('0x34')](_0x117fcc['query']);_0x1ad249['filters']=_[_0x1c91('0x35')](_0x1ad249['model'],_0x1ad249[_0x1c91('0x33')]);_0x4b859d[_0x1c91('0x36')]=_[_0x1c91('0x35')](_0x1ad249[_0x1c91('0x37')],qs['fields'](_0x117fcc[_0x1c91('0x33')]['fields']));_0x4b859d['attributes']=_0x4b859d[_0x1c91('0x36')][_0x1c91('0x38')]?_0x4b859d['attributes']:_0x1ad249[_0x1c91('0x37')];if(!_0x117fcc[_0x1c91('0x33')][_0x1c91('0x39')](_0x1c91('0x3a'))){_0x4b859d[_0x1c91('0x1e')]=qs[_0x1c91('0x1e')](_0x117fcc['query'][_0x1c91('0x1e')]);_0x4b859d[_0x1c91('0x1d')]=qs['offset'](_0x117fcc['query'][_0x1c91('0x1d')]);}_0x4b859d['order']=qs['sort'](_0x117fcc[_0x1c91('0x33')][_0x1c91('0x3b')]);_0x4b859d[_0x1c91('0x3c')]=qs[_0x1c91('0x3d')](_[_0x1c91('0x3e')](_0x117fcc[_0x1c91('0x33')],_0x1ad249[_0x1c91('0x3d')]),_0x556221);if(_0x117fcc[_0x1c91('0x33')][_0x1c91('0x3f')]){_0x4b859d[_0x1c91('0x3c')]=_[_0x1c91('0x40')](_0x4b859d[_0x1c91('0x3c')],{'$or':_[_0x1c91('0x2d')](_0x556221,function(_0x3d1783){if(_0x3d1783[_0x1c91('0x30')]!=='VIRTUAL'){var _0x33b162={};_0x33b162[_0x3d1783['name']]={'$like':'%'+_0x117fcc[_0x1c91('0x33')][_0x1c91('0x3f')]+'%'};return _0x33b162;}})});}_0x4b859d=_[_0x1c91('0x40')]({},_0x4b859d,_0x117fcc['options']);var _0x5089b2={'where':_0x4b859d['where']};return db[_0x1c91('0x2e')][_0x1c91('0x20')](_0x5089b2)[_0x1c91('0x28')](function(_0x5f466c){_0x20770d[_0x1c91('0x20')]=_0x5f466c;if(_0x117fcc['query'][_0x1c91('0x41')]){_0x4b859d[_0x1c91('0x42')]=[{'all':!![]}];}return db[_0x1c91('0x2e')][_0x1c91('0x43')](_0x4b859d);})[_0x1c91('0x28')](function(_0x4b07d6){_0x20770d[_0x1c91('0x44')]=_0x4b07d6;return _0x20770d;})[_0x1c91('0x28')](respondWithFilteredResult(_0x1b79d2,_0x4b859d))[_0x1c91('0x45')](handleError(_0x1b79d2,null));};exports[_0x1c91('0x46')]=function(_0x475e59,_0x27d458){var _0x2fb53d={'raw':![],'where':{'id':_0x475e59['params']['id']}},_0x4828d7={};_0x4828d7[_0x1c91('0x37')]=_[_0x1c91('0x34')](db[_0x1c91('0x2e')][_0x1c91('0x47')]);_0x4828d7[_0x1c91('0x33')]=_[_0x1c91('0x34')](_0x475e59['query']);_0x4828d7[_0x1c91('0x3d')]=_[_0x1c91('0x35')](_0x4828d7[_0x1c91('0x37')],_0x4828d7[_0x1c91('0x33')]);_0x2fb53d[_0x1c91('0x36')]=_[_0x1c91('0x35')](_0x4828d7[_0x1c91('0x37')],qs[_0x1c91('0x48')](_0x475e59[_0x1c91('0x33')][_0x1c91('0x48')]));_0x2fb53d[_0x1c91('0x36')]=_0x2fb53d[_0x1c91('0x36')][_0x1c91('0x38')]?_0x2fb53d['attributes']:_0x4828d7[_0x1c91('0x37')];if(_0x475e59['query'][_0x1c91('0x41')]){_0x2fb53d[_0x1c91('0x42')]=[{'all':!![]}];}_0x2fb53d=_[_0x1c91('0x40')]({},_0x2fb53d,_0x475e59[_0x1c91('0x49')]);return db[_0x1c91('0x2e')][_0x1c91('0x4a')](_0x2fb53d)['then'](handleEntityNotFound(_0x27d458,null))['then'](respondWithResult(_0x27d458,null))[_0x1c91('0x45')](handleError(_0x27d458,null));};exports[_0x1c91('0x4b')]=function(_0x29ef7d,_0x596848){return db[_0x1c91('0x2e')][_0x1c91('0x4b')](_0x29ef7d[_0x1c91('0x4c')],{})['then'](respondWithResult(_0x596848,0xc9))[_0x1c91('0x45')](handleError(_0x596848,null));};exports[_0x1c91('0x26')]=function(_0x3cdd54,_0x5ecee0){if(_0x3cdd54[_0x1c91('0x4c')]['id']){delete _0x3cdd54[_0x1c91('0x4c')]['id'];}return db[_0x1c91('0x2e')][_0x1c91('0x4a')]({'where':{'id':_0x3cdd54['params']['id']}})['then'](handleEntityNotFound(_0x5ecee0,null))[_0x1c91('0x28')](saveUpdates(_0x3cdd54['body'],null))[_0x1c91('0x28')](respondWithResult(_0x5ecee0,null))['catch'](handleError(_0x5ecee0,null));};exports[_0x1c91('0x27')]=function(_0x217ffd,_0x44539a){return db['SalesforceConfiguration']['find']({'where':{'id':_0x217ffd[_0x1c91('0x4d')]['id']}})[_0x1c91('0x28')](handleEntityNotFound(_0x44539a,null))[_0x1c91('0x28')](removeEntity(_0x44539a,null))[_0x1c91('0x45')](handleError(_0x44539a,null));};exports[_0x1c91('0x4e')]=function(_0xc89cf6,_0x314a5d,_0x248990){var _0x4a2e11={};var _0x324bf2={};var _0x11b6b8;var _0x2eea8a;return db[_0x1c91('0x2e')][_0x1c91('0x4f')]({'where':{'id':_0xc89cf6[_0x1c91('0x4d')]['id']}})[_0x1c91('0x28')](handleEntityNotFound(_0x314a5d,null))['then'](function(_0x5b6247){if(_0x5b6247){_0x11b6b8=_0x5b6247;_0x324bf2[_0x1c91('0x37')]=_[_0x1c91('0x34')](db[_0x1c91('0x50')][_0x1c91('0x47')]);_0x324bf2[_0x1c91('0x33')]=_['keys'](_0xc89cf6[_0x1c91('0x33')]);_0x324bf2[_0x1c91('0x3d')]=_['intersection'](_0x324bf2[_0x1c91('0x37')],_0x324bf2[_0x1c91('0x33')]);_0x4a2e11[_0x1c91('0x36')]=_['intersection'](_0x324bf2['model'],qs[_0x1c91('0x48')](_0xc89cf6[_0x1c91('0x33')]['fields']));_0x4a2e11[_0x1c91('0x36')]=_0x4a2e11[_0x1c91('0x36')][_0x1c91('0x38')]?_0x4a2e11[_0x1c91('0x36')]:_0x324bf2[_0x1c91('0x37')];_0x4a2e11[_0x1c91('0x51')]=qs[_0x1c91('0x3b')](_0xc89cf6[_0x1c91('0x33')][_0x1c91('0x3b')]);_0x4a2e11['where']=qs['filters'](_[_0x1c91('0x3e')](_0xc89cf6[_0x1c91('0x33')],_0x324bf2['filters']));if(_0xc89cf6[_0x1c91('0x33')][_0x1c91('0x3f')]){_0x4a2e11[_0x1c91('0x3c')]=_[_0x1c91('0x40')](_0x4a2e11['where'],{'$or':_[_0x1c91('0x2d')](_0x4a2e11[_0x1c91('0x36')],function(_0x3a0d6e){var _0x58bea1={};_0x58bea1[_0x3a0d6e]={'$like':'%'+_0xc89cf6[_0x1c91('0x33')][_0x1c91('0x3f')]+'%'};return _0x58bea1;})});}_0x4a2e11=_[_0x1c91('0x40')]({},_0x4a2e11,_0xc89cf6[_0x1c91('0x49')]);return _0x11b6b8['getFields'](_0x4a2e11);}})[_0x1c91('0x28')](function(_0x6497d5){if(_0x6497d5){_0x2eea8a=_0x6497d5[_0x1c91('0x38')];if(!_0xc89cf6[_0x1c91('0x33')]['hasOwnProperty'](_0x1c91('0x3a'))){_0x4a2e11['limit']=qs[_0x1c91('0x1e')](_0xc89cf6[_0x1c91('0x33')][_0x1c91('0x1e')]);_0x4a2e11[_0x1c91('0x1d')]=qs[_0x1c91('0x1d')](_0xc89cf6[_0x1c91('0x33')]['offset']);}return _0x11b6b8[_0x1c91('0x4e')](_0x4a2e11);}})[_0x1c91('0x28')](function(_0x22e174){if(_0x22e174){return _0x22e174?{'count':_0x2eea8a,'rows':_0x22e174}:null;}})['then'](respondWithResult(_0x314a5d,null))[_0x1c91('0x45')](handleError(_0x314a5d,null));};exports[_0x1c91('0x52')]=function(_0x49d930,_0x5f0bdb,_0xeb4940){var _0x5af91f={};var _0x39281a={};var _0x3ac468;var _0xd9f662;return db[_0x1c91('0x2e')]['findOne']({'where':{'id':_0x49d930[_0x1c91('0x4d')]['id']}})[_0x1c91('0x28')](handleEntityNotFound(_0x5f0bdb,null))[_0x1c91('0x28')](function(_0x2a8931){if(_0x2a8931){_0x3ac468=_0x2a8931;_0x39281a['model']=_[_0x1c91('0x34')](db['SalesforceField'][_0x1c91('0x47')]);_0x39281a[_0x1c91('0x33')]=_['keys'](_0x49d930[_0x1c91('0x33')]);_0x39281a[_0x1c91('0x3d')]=_[_0x1c91('0x35')](_0x39281a[_0x1c91('0x37')],_0x39281a[_0x1c91('0x33')]);_0x5af91f[_0x1c91('0x36')]=_[_0x1c91('0x35')](_0x39281a[_0x1c91('0x37')],qs[_0x1c91('0x48')](_0x49d930['query'][_0x1c91('0x48')]));_0x5af91f[_0x1c91('0x36')]=_0x5af91f['attributes'][_0x1c91('0x38')]?_0x5af91f[_0x1c91('0x36')]:_0x39281a[_0x1c91('0x37')];_0x5af91f[_0x1c91('0x51')]=qs[_0x1c91('0x3b')](_0x49d930['query'][_0x1c91('0x3b')]);_0x5af91f['where']=qs['filters'](_['pick'](_0x49d930['query'],_0x39281a[_0x1c91('0x3d')]));if(_0x49d930[_0x1c91('0x33')]['filter']){_0x5af91f['where']=_[_0x1c91('0x40')](_0x5af91f[_0x1c91('0x3c')],{'$or':_[_0x1c91('0x2d')](_0x5af91f[_0x1c91('0x36')],function(_0x3a1fb2){var _0x55878c={};_0x55878c[_0x3a1fb2]={'$like':'%'+_0x49d930[_0x1c91('0x33')]['filter']+'%'};return _0x55878c;})});}_0x5af91f=_[_0x1c91('0x40')]({},_0x5af91f,_0x49d930[_0x1c91('0x49')]);return _0x3ac468['getSubjects'](_0x5af91f);}})[_0x1c91('0x28')](function(_0x17496e){if(_0x17496e){_0xd9f662=_0x17496e['length'];if(!_0x49d930[_0x1c91('0x33')]['hasOwnProperty'](_0x1c91('0x3a'))){_0x5af91f[_0x1c91('0x1e')]=qs[_0x1c91('0x1e')](_0x49d930[_0x1c91('0x33')]['limit']);_0x5af91f[_0x1c91('0x1d')]=qs[_0x1c91('0x1d')](_0x49d930[_0x1c91('0x33')][_0x1c91('0x1d')]);}return _0x3ac468[_0x1c91('0x52')](_0x5af91f);}})['then'](function(_0x3a2b50){if(_0x3a2b50){return _0x3a2b50?{'count':_0xd9f662,'rows':_0x3a2b50}:null;}})[_0x1c91('0x28')](respondWithResult(_0x5f0bdb,null))[_0x1c91('0x45')](handleError(_0x5f0bdb,null));};exports[_0x1c91('0x53')]=function(_0x4c4ad7,_0x54b193,_0x5961ea){var _0x494ecc={};var _0x421cf3={};var _0x1e8b39;var _0x1e3649;return db[_0x1c91('0x2e')][_0x1c91('0x4f')]({'where':{'id':_0x4c4ad7[_0x1c91('0x4d')]['id']}})[_0x1c91('0x28')](handleEntityNotFound(_0x54b193,null))[_0x1c91('0x28')](function(_0x25d2cb){if(_0x25d2cb){_0x1e8b39=_0x25d2cb;_0x421cf3[_0x1c91('0x37')]=_[_0x1c91('0x34')](db['SalesforceField']['rawAttributes']);_0x421cf3[_0x1c91('0x33')]=_[_0x1c91('0x34')](_0x4c4ad7[_0x1c91('0x33')]);_0x421cf3[_0x1c91('0x3d')]=_[_0x1c91('0x35')](_0x421cf3[_0x1c91('0x37')],_0x421cf3[_0x1c91('0x33')]);_0x494ecc[_0x1c91('0x36')]=_[_0x1c91('0x35')](_0x421cf3[_0x1c91('0x37')],qs[_0x1c91('0x48')](_0x4c4ad7[_0x1c91('0x33')]['fields']));_0x494ecc[_0x1c91('0x36')]=_0x494ecc[_0x1c91('0x36')][_0x1c91('0x38')]?_0x494ecc[_0x1c91('0x36')]:_0x421cf3[_0x1c91('0x37')];_0x494ecc[_0x1c91('0x51')]=qs[_0x1c91('0x3b')](_0x4c4ad7[_0x1c91('0x33')][_0x1c91('0x3b')]);_0x494ecc[_0x1c91('0x3c')]=qs[_0x1c91('0x3d')](_[_0x1c91('0x3e')](_0x4c4ad7[_0x1c91('0x33')],_0x421cf3['filters']));if(_0x4c4ad7[_0x1c91('0x33')][_0x1c91('0x3f')]){_0x494ecc['where']=_['merge'](_0x494ecc[_0x1c91('0x3c')],{'$or':_[_0x1c91('0x2d')](_0x494ecc[_0x1c91('0x36')],function(_0x199d8f){var _0x5f9896={};_0x5f9896[_0x199d8f]={'$like':'%'+_0x4c4ad7[_0x1c91('0x33')][_0x1c91('0x3f')]+'%'};return _0x5f9896;})});}_0x494ecc=_['merge']({},_0x494ecc,_0x4c4ad7[_0x1c91('0x49')]);return _0x1e8b39[_0x1c91('0x53')](_0x494ecc);}})[_0x1c91('0x28')](function(_0x104113){if(_0x104113){_0x1e3649=_0x104113[_0x1c91('0x38')];if(!_0x4c4ad7[_0x1c91('0x33')][_0x1c91('0x39')](_0x1c91('0x3a'))){_0x494ecc[_0x1c91('0x1e')]=qs[_0x1c91('0x1e')](_0x4c4ad7[_0x1c91('0x33')][_0x1c91('0x1e')]);_0x494ecc[_0x1c91('0x1d')]=qs[_0x1c91('0x1d')](_0x4c4ad7[_0x1c91('0x33')][_0x1c91('0x1d')]);}return _0x1e8b39['getDescriptions'](_0x494ecc);}})[_0x1c91('0x28')](function(_0x374172){if(_0x374172){return _0x374172?{'count':_0x1e3649,'rows':_0x374172}:null;}})[_0x1c91('0x28')](respondWithResult(_0x54b193,null))[_0x1c91('0x45')](handleError(_0x54b193,null));};
\ No newline at end of file
+var _0x4843=['set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','index','map','SalesforceConfiguration','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','pick','eml-format','rimraf','zip-dir','request-promise','moment','util','path','fs-extra','lodash','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','../../mysqldb','end','status','json','offset','limit','undefined','count'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x4843,0x7e));var _0x3484=function(_0x5adc6c,_0xa61a6d){_0x5adc6c=_0x5adc6c-0x0;var _0x5adb3e=_0x4843[_0x5adc6c];return _0x5adb3e;};'use strict';var emlformat=require(_0x3484('0x0'));var rimraf=require(_0x3484('0x1'));var zipdir=require(_0x3484('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3484('0x3'));var moment=require(_0x3484('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3484('0x5'));var path=require(_0x3484('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3484('0x7'));var _=require(_0x3484('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3484('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x3484('0xa'));var querystring=require(_0x3484('0xb'));var Papa=require(_0x3484('0xc'));var Redis=require(_0x3484('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3484('0xe'));var as=require(_0x3484('0xf'));var hardwareService=require(_0x3484('0x10'));var logger=require(_0x3484('0x11'))(_0x3484('0x12'));var utils=require(_0x3484('0x13'));var config=require(_0x3484('0x14'));var licenseUtil=require(_0x3484('0x15'));var db=require(_0x3484('0x16'))['db'];function respondWithStatusCode(_0x2b2944,_0x148525){_0x148525=_0x148525||0xcc;return function(_0x42733e){if(_0x42733e){return _0x2b2944['sendStatus'](_0x148525);}return _0x2b2944['status'](_0x148525)[_0x3484('0x17')]();};}function respondWithResult(_0x5c8d85,_0x5a7d03){_0x5a7d03=_0x5a7d03||0xc8;return function(_0x3ddc39){if(_0x3ddc39){return _0x5c8d85[_0x3484('0x18')](_0x5a7d03)[_0x3484('0x19')](_0x3ddc39);}};}function respondWithFilteredResult(_0x38fda2,_0x2b88c8){return function(_0x43a0e5){if(_0x43a0e5){var _0x27cde5=typeof _0x2b88c8[_0x3484('0x1a')]==='undefined'&&typeof _0x2b88c8[_0x3484('0x1b')]===_0x3484('0x1c');var _0x4651b8=_0x43a0e5[_0x3484('0x1d')];var _0x126a0c=_0x27cde5?0x0:_0x2b88c8[_0x3484('0x1a')];var _0x4055f7=_0x27cde5?_0x43a0e5['count']:_0x2b88c8[_0x3484('0x1a')]+_0x2b88c8[_0x3484('0x1b')];var _0x3416c4;if(_0x4055f7>=_0x4651b8){_0x4055f7=_0x4651b8;_0x3416c4=0xc8;}else{_0x3416c4=0xce;}_0x38fda2[_0x3484('0x18')](_0x3416c4);return _0x38fda2[_0x3484('0x1e')](_0x3484('0x1f'),_0x126a0c+'-'+_0x4055f7+'/'+_0x4651b8)['json'](_0x43a0e5);}return null;};}function patchUpdates(_0x41584d){return function(_0x848a2f){try{jsonpatch[_0x3484('0x20')](_0x848a2f,_0x41584d,!![]);}catch(_0x3a489f){return BPromise['reject'](_0x3a489f);}return _0x848a2f[_0x3484('0x21')]();};}function saveUpdates(_0x316a45,_0x4f1087){return function(_0x442e33){if(_0x442e33){return _0x442e33['update'](_0x316a45)[_0x3484('0x22')](function(_0x37fa85){return _0x37fa85;});}return null;};}function removeEntity(_0x579f40,_0x621716){return function(_0x593682){if(_0x593682){return _0x593682[_0x3484('0x23')]()['then'](function(){_0x579f40[_0x3484('0x18')](0xcc)[_0x3484('0x17')]();});}};}function handleEntityNotFound(_0x477050,_0x42630a){return function(_0x7defdc){if(!_0x7defdc){_0x477050[_0x3484('0x24')](0x194);}return _0x7defdc;};}function handleError(_0x58a089,_0x1cfe43){_0x1cfe43=_0x1cfe43||0x1f4;return function(_0x22ac6f){logger[_0x3484('0x25')](_0x22ac6f[_0x3484('0x26')]);if(_0x22ac6f[_0x3484('0x27')]){delete _0x22ac6f[_0x3484('0x27')];}_0x58a089[_0x3484('0x18')](_0x1cfe43)['send'](_0x22ac6f);};}exports[_0x3484('0x28')]=function(_0x2f63d2,_0x779c6d){var _0x53fb9c={},_0x11980c={},_0x720aa2={'count':0x0,'rows':[]};var _0x3e4afb=_[_0x3484('0x29')](db[_0x3484('0x2a')]['rawAttributes'],function(_0x18a64d){return{'name':_0x18a64d[_0x3484('0x2b')],'type':_0x18a64d[_0x3484('0x2c')]['key']};});_0x11980c[_0x3484('0x2d')]=_[_0x3484('0x29')](_0x3e4afb,_0x3484('0x27'));_0x11980c[_0x3484('0x2e')]=_[_0x3484('0x2f')](_0x2f63d2[_0x3484('0x2e')]);_0x11980c[_0x3484('0x30')]=_[_0x3484('0x31')](_0x11980c[_0x3484('0x2d')],_0x11980c[_0x3484('0x2e')]);_0x53fb9c[_0x3484('0x32')]=_[_0x3484('0x31')](_0x11980c['model'],qs['fields'](_0x2f63d2[_0x3484('0x2e')][_0x3484('0x33')]));_0x53fb9c[_0x3484('0x32')]=_0x53fb9c[_0x3484('0x32')][_0x3484('0x34')]?_0x53fb9c[_0x3484('0x32')]:_0x11980c[_0x3484('0x2d')];if(!_0x2f63d2[_0x3484('0x2e')][_0x3484('0x35')](_0x3484('0x36'))){_0x53fb9c[_0x3484('0x1b')]=qs['limit'](_0x2f63d2['query'][_0x3484('0x1b')]);_0x53fb9c['offset']=qs[_0x3484('0x1a')](_0x2f63d2[_0x3484('0x2e')][_0x3484('0x1a')]);}_0x53fb9c[_0x3484('0x37')]=qs[_0x3484('0x38')](_0x2f63d2[_0x3484('0x2e')][_0x3484('0x38')]);_0x53fb9c[_0x3484('0x39')]=qs['filters'](_['pick'](_0x2f63d2['query'],_0x11980c[_0x3484('0x30')]),_0x3e4afb);if(_0x2f63d2[_0x3484('0x2e')][_0x3484('0x3a')]){_0x53fb9c[_0x3484('0x39')]=_[_0x3484('0x3b')](_0x53fb9c['where'],{'$or':_[_0x3484('0x29')](_0x3e4afb,function(_0x9fa656){if(_0x9fa656[_0x3484('0x2c')]!==_0x3484('0x3c')){var _0x277b2a={};_0x277b2a[_0x9fa656[_0x3484('0x27')]]={'$like':'%'+_0x2f63d2[_0x3484('0x2e')][_0x3484('0x3a')]+'%'};return _0x277b2a;}})});}_0x53fb9c=_['merge']({},_0x53fb9c,_0x2f63d2[_0x3484('0x3d')]);var _0x81b9d4={'where':_0x53fb9c[_0x3484('0x39')]};return db[_0x3484('0x2a')]['count'](_0x81b9d4)[_0x3484('0x22')](function(_0x2f4ec5){_0x720aa2[_0x3484('0x1d')]=_0x2f4ec5;if(_0x2f63d2['query'][_0x3484('0x3e')]){_0x53fb9c['include']=[{'all':!![]}];}return db[_0x3484('0x2a')][_0x3484('0x3f')](_0x53fb9c);})['then'](function(_0x3f09e3){_0x720aa2[_0x3484('0x40')]=_0x3f09e3;return _0x720aa2;})[_0x3484('0x22')](respondWithFilteredResult(_0x779c6d,_0x53fb9c))[_0x3484('0x41')](handleError(_0x779c6d,null));};exports[_0x3484('0x42')]=function(_0x390c7e,_0x462599){var _0x33ac54={'raw':![],'where':{'id':_0x390c7e[_0x3484('0x43')]['id']}},_0x5a7dfe={};_0x5a7dfe[_0x3484('0x2d')]=_[_0x3484('0x2f')](db[_0x3484('0x2a')][_0x3484('0x44')]);_0x5a7dfe['query']=_[_0x3484('0x2f')](_0x390c7e['query']);_0x5a7dfe['filters']=_[_0x3484('0x31')](_0x5a7dfe[_0x3484('0x2d')],_0x5a7dfe[_0x3484('0x2e')]);_0x33ac54[_0x3484('0x32')]=_[_0x3484('0x31')](_0x5a7dfe[_0x3484('0x2d')],qs[_0x3484('0x33')](_0x390c7e[_0x3484('0x2e')][_0x3484('0x33')]));_0x33ac54[_0x3484('0x32')]=_0x33ac54[_0x3484('0x32')][_0x3484('0x34')]?_0x33ac54[_0x3484('0x32')]:_0x5a7dfe[_0x3484('0x2d')];if(_0x390c7e[_0x3484('0x2e')]['includeAll']){_0x33ac54['include']=[{'all':!![]}];}_0x33ac54=_[_0x3484('0x3b')]({},_0x33ac54,_0x390c7e[_0x3484('0x3d')]);return db['SalesforceConfiguration'][_0x3484('0x45')](_0x33ac54)[_0x3484('0x22')](handleEntityNotFound(_0x462599,null))['then'](respondWithResult(_0x462599,null))[_0x3484('0x41')](handleError(_0x462599,null));};exports[_0x3484('0x46')]=function(_0x172b41,_0x2ffbed){return db[_0x3484('0x2a')][_0x3484('0x46')](_0x172b41[_0x3484('0x47')],{})[_0x3484('0x22')](respondWithResult(_0x2ffbed,0xc9))[_0x3484('0x41')](handleError(_0x2ffbed,null));};exports['update']=function(_0x56c9cf,_0x691ab){if(_0x56c9cf['body']['id']){delete _0x56c9cf[_0x3484('0x47')]['id'];}return db['SalesforceConfiguration'][_0x3484('0x45')]({'where':{'id':_0x56c9cf[_0x3484('0x43')]['id']}})[_0x3484('0x22')](handleEntityNotFound(_0x691ab,null))[_0x3484('0x22')](saveUpdates(_0x56c9cf[_0x3484('0x47')],null))[_0x3484('0x22')](respondWithResult(_0x691ab,null))[_0x3484('0x41')](handleError(_0x691ab,null));};exports[_0x3484('0x23')]=function(_0x2b33c3,_0x3b43a8){return db[_0x3484('0x2a')][_0x3484('0x45')]({'where':{'id':_0x2b33c3[_0x3484('0x43')]['id']}})[_0x3484('0x22')](handleEntityNotFound(_0x3b43a8,null))[_0x3484('0x22')](removeEntity(_0x3b43a8,null))[_0x3484('0x41')](handleError(_0x3b43a8,null));};exports[_0x3484('0x48')]=function(_0x2da83f,_0x1054af,_0x1ab1a4){var _0x2b025c={};var _0x4f1b10={};var _0x25edec;var _0x4d8c20;return db[_0x3484('0x2a')][_0x3484('0x49')]({'where':{'id':_0x2da83f[_0x3484('0x43')]['id']}})[_0x3484('0x22')](handleEntityNotFound(_0x1054af,null))[_0x3484('0x22')](function(_0x508f7c){if(_0x508f7c){_0x25edec=_0x508f7c;_0x4f1b10[_0x3484('0x2d')]=_[_0x3484('0x2f')](db[_0x3484('0x4a')][_0x3484('0x44')]);_0x4f1b10[_0x3484('0x2e')]=_['keys'](_0x2da83f['query']);_0x4f1b10['filters']=_[_0x3484('0x31')](_0x4f1b10[_0x3484('0x2d')],_0x4f1b10[_0x3484('0x2e')]);_0x2b025c[_0x3484('0x32')]=_[_0x3484('0x31')](_0x4f1b10[_0x3484('0x2d')],qs['fields'](_0x2da83f['query'][_0x3484('0x33')]));_0x2b025c[_0x3484('0x32')]=_0x2b025c['attributes'][_0x3484('0x34')]?_0x2b025c[_0x3484('0x32')]:_0x4f1b10[_0x3484('0x2d')];_0x2b025c[_0x3484('0x37')]=qs['sort'](_0x2da83f['query'][_0x3484('0x38')]);_0x2b025c[_0x3484('0x39')]=qs['filters'](_['pick'](_0x2da83f[_0x3484('0x2e')],_0x4f1b10[_0x3484('0x30')]));if(_0x2da83f[_0x3484('0x2e')][_0x3484('0x3a')]){_0x2b025c[_0x3484('0x39')]=_[_0x3484('0x3b')](_0x2b025c[_0x3484('0x39')],{'$or':_['map'](_0x2b025c['attributes'],function(_0x33fe80){var _0x383b4b={};_0x383b4b[_0x33fe80]={'$like':'%'+_0x2da83f[_0x3484('0x2e')][_0x3484('0x3a')]+'%'};return _0x383b4b;})});}_0x2b025c=_[_0x3484('0x3b')]({},_0x2b025c,_0x2da83f['options']);return _0x25edec['getFields'](_0x2b025c);}})[_0x3484('0x22')](function(_0x4711f7){if(_0x4711f7){_0x4d8c20=_0x4711f7[_0x3484('0x34')];if(!_0x2da83f[_0x3484('0x2e')][_0x3484('0x35')](_0x3484('0x36'))){_0x2b025c[_0x3484('0x1b')]=qs[_0x3484('0x1b')](_0x2da83f[_0x3484('0x2e')][_0x3484('0x1b')]);_0x2b025c['offset']=qs[_0x3484('0x1a')](_0x2da83f['query'][_0x3484('0x1a')]);}return _0x25edec[_0x3484('0x48')](_0x2b025c);}})['then'](function(_0x58a0ac){if(_0x58a0ac){return _0x58a0ac?{'count':_0x4d8c20,'rows':_0x58a0ac}:null;}})[_0x3484('0x22')](respondWithResult(_0x1054af,null))[_0x3484('0x41')](handleError(_0x1054af,null));};exports['getSubjects']=function(_0x48034f,_0x430e11,_0x345396){var _0x31795c={};var _0x108d16={};var _0x516646;var _0x1d6f5e;return db[_0x3484('0x2a')][_0x3484('0x49')]({'where':{'id':_0x48034f[_0x3484('0x43')]['id']}})['then'](handleEntityNotFound(_0x430e11,null))['then'](function(_0x127311){if(_0x127311){_0x516646=_0x127311;_0x108d16[_0x3484('0x2d')]=_[_0x3484('0x2f')](db[_0x3484('0x4a')][_0x3484('0x44')]);_0x108d16[_0x3484('0x2e')]=_[_0x3484('0x2f')](_0x48034f[_0x3484('0x2e')]);_0x108d16['filters']=_['intersection'](_0x108d16[_0x3484('0x2d')],_0x108d16[_0x3484('0x2e')]);_0x31795c[_0x3484('0x32')]=_[_0x3484('0x31')](_0x108d16[_0x3484('0x2d')],qs[_0x3484('0x33')](_0x48034f[_0x3484('0x2e')][_0x3484('0x33')]));_0x31795c[_0x3484('0x32')]=_0x31795c[_0x3484('0x32')][_0x3484('0x34')]?_0x31795c[_0x3484('0x32')]:_0x108d16[_0x3484('0x2d')];_0x31795c[_0x3484('0x37')]=qs[_0x3484('0x38')](_0x48034f['query'][_0x3484('0x38')]);_0x31795c[_0x3484('0x39')]=qs[_0x3484('0x30')](_['pick'](_0x48034f['query'],_0x108d16[_0x3484('0x30')]));if(_0x48034f[_0x3484('0x2e')]['filter']){_0x31795c[_0x3484('0x39')]=_['merge'](_0x31795c[_0x3484('0x39')],{'$or':_[_0x3484('0x29')](_0x31795c[_0x3484('0x32')],function(_0x22f37e){var _0x5eda53={};_0x5eda53[_0x22f37e]={'$like':'%'+_0x48034f[_0x3484('0x2e')][_0x3484('0x3a')]+'%'};return _0x5eda53;})});}_0x31795c=_[_0x3484('0x3b')]({},_0x31795c,_0x48034f[_0x3484('0x3d')]);return _0x516646[_0x3484('0x4b')](_0x31795c);}})[_0x3484('0x22')](function(_0x52030d){if(_0x52030d){_0x1d6f5e=_0x52030d['length'];if(!_0x48034f[_0x3484('0x2e')][_0x3484('0x35')](_0x3484('0x36'))){_0x31795c[_0x3484('0x1b')]=qs[_0x3484('0x1b')](_0x48034f[_0x3484('0x2e')][_0x3484('0x1b')]);_0x31795c[_0x3484('0x1a')]=qs[_0x3484('0x1a')](_0x48034f['query'][_0x3484('0x1a')]);}return _0x516646[_0x3484('0x4b')](_0x31795c);}})[_0x3484('0x22')](function(_0x2a24e5){if(_0x2a24e5){return _0x2a24e5?{'count':_0x1d6f5e,'rows':_0x2a24e5}:null;}})[_0x3484('0x22')](respondWithResult(_0x430e11,null))[_0x3484('0x41')](handleError(_0x430e11,null));};exports[_0x3484('0x4c')]=function(_0xe7a425,_0x266a51,_0x1269b7){var _0x2492a9={};var _0x474437={};var _0x915484;var _0x28ce41;return db[_0x3484('0x2a')][_0x3484('0x49')]({'where':{'id':_0xe7a425[_0x3484('0x43')]['id']}})[_0x3484('0x22')](handleEntityNotFound(_0x266a51,null))['then'](function(_0xb3467d){if(_0xb3467d){_0x915484=_0xb3467d;_0x474437[_0x3484('0x2d')]=_['keys'](db['SalesforceField']['rawAttributes']);_0x474437[_0x3484('0x2e')]=_[_0x3484('0x2f')](_0xe7a425[_0x3484('0x2e')]);_0x474437[_0x3484('0x30')]=_[_0x3484('0x31')](_0x474437[_0x3484('0x2d')],_0x474437[_0x3484('0x2e')]);_0x2492a9[_0x3484('0x32')]=_['intersection'](_0x474437[_0x3484('0x2d')],qs[_0x3484('0x33')](_0xe7a425[_0x3484('0x2e')][_0x3484('0x33')]));_0x2492a9[_0x3484('0x32')]=_0x2492a9['attributes']['length']?_0x2492a9[_0x3484('0x32')]:_0x474437['model'];_0x2492a9[_0x3484('0x37')]=qs[_0x3484('0x38')](_0xe7a425[_0x3484('0x2e')][_0x3484('0x38')]);_0x2492a9[_0x3484('0x39')]=qs[_0x3484('0x30')](_[_0x3484('0x4d')](_0xe7a425[_0x3484('0x2e')],_0x474437[_0x3484('0x30')]));if(_0xe7a425['query'][_0x3484('0x3a')]){_0x2492a9['where']=_[_0x3484('0x3b')](_0x2492a9[_0x3484('0x39')],{'$or':_[_0x3484('0x29')](_0x2492a9[_0x3484('0x32')],function(_0x3e6885){var _0x103417={};_0x103417[_0x3e6885]={'$like':'%'+_0xe7a425['query'][_0x3484('0x3a')]+'%'};return _0x103417;})});}_0x2492a9=_[_0x3484('0x3b')]({},_0x2492a9,_0xe7a425[_0x3484('0x3d')]);return _0x915484[_0x3484('0x4c')](_0x2492a9);}})[_0x3484('0x22')](function(_0xebd6fc){if(_0xebd6fc){_0x28ce41=_0xebd6fc[_0x3484('0x34')];if(!_0xe7a425[_0x3484('0x2e')][_0x3484('0x35')]('nolimit')){_0x2492a9[_0x3484('0x1b')]=qs['limit'](_0xe7a425[_0x3484('0x2e')][_0x3484('0x1b')]);_0x2492a9[_0x3484('0x1a')]=qs[_0x3484('0x1a')](_0xe7a425[_0x3484('0x2e')][_0x3484('0x1a')]);}return _0x915484[_0x3484('0x4c')](_0x2492a9);}})['then'](function(_0x4728b4){if(_0x4728b4){return _0x4728b4?{'count':_0x28ce41,'rows':_0x4728b4}:null;}})[_0x3484('0x22')](respondWithResult(_0x266a51,null))[_0x3484('0x41')](handleError(_0x266a51,null));};
\ No newline at end of file
index 5557ac0..cb2cc90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35af=['../../config/logger','moment','request-promise','path','../../config/environment','exports','define','int_salesforce_configurations','lodash','util'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0x35af,0x10c));var _0xf35a=function(_0x4e0d31,_0x463b69){_0x4e0d31=_0x4e0d31-0x0;var _0x2bba51=_0x35af[_0x4e0d31];return _0x2bba51;};'use strict';var _=require(_0xf35a('0x0'));var util=require(_0xf35a('0x1'));var logger=require(_0xf35a('0x2'))('api');var moment=require(_0xf35a('0x3'));var BPromise=require('bluebird');var rp=require(_0xf35a('0x4'));var fs=require('fs');var path=require(_0xf35a('0x5'));var rimraf=require('rimraf');var config=require(_0xf35a('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xf35a('0x7')]=function(_0x4bf220,_0x380926){return _0x4bf220[_0xf35a('0x8')]('SalesforceConfiguration',attributes,{'tableName':_0xf35a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf25b=['request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','SalesforceConfiguration','lodash','api','moment','bluebird'];(function(_0x5196b8,_0x3e8471){var _0xce953f=function(_0x579b3f){while(--_0x579b3f){_0x5196b8['push'](_0x5196b8['shift']());}};_0xce953f(++_0x3e8471);}(_0xf25b,0x11e));var _0xbf25=function(_0x3f6cbd,_0x905b9b){_0x3f6cbd=_0x3f6cbd-0x0;var _0x6a3960=_0xf25b[_0x3f6cbd];return _0x6a3960;};'use strict';var _=require(_0xbf25('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbf25('0x1'));var moment=require(_0xbf25('0x2'));var BPromise=require(_0xbf25('0x3'));var rp=require(_0xbf25('0x4'));var fs=require('fs');var path=require(_0xbf25('0x5'));var rimraf=require(_0xbf25('0x6'));var config=require(_0xbf25('0x7'));var attributes=require(_0xbf25('0x8'));module['exports']=function(_0x268b01,_0x5cbcc5){return _0x268b01['define'](_0xbf25('0x9'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 305d4dc..a62afcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdaa=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result'];(function(_0x1b7874,_0x2aeb07){var _0xd221ed=function(_0x4ef6e7){while(--_0x4ef6e7){_0x1b7874['push'](_0x1b7874['shift']());}};_0xd221ed(++_0x2aeb07);}(_0xcdaa,0x1b5));var _0xacda=function(_0x1fe58e,_0x313679){_0x1fe58e=_0x1fe58e-0x0;var _0x1fc72c=_0xcdaa[_0x1fe58e];return _0x1fc72c;};'use strict';var _=require(_0xacda('0x0'));var util=require(_0xacda('0x1'));var moment=require(_0xacda('0x2'));var BPromise=require(_0xacda('0x3'));var rs=require(_0xacda('0x4'));var fs=require('fs');var Redis=require(_0xacda('0x5'));var db=require(_0xacda('0x6'))['db'];var utils=require(_0xacda('0x7'));var logger=require(_0xacda('0x8'))(_0xacda('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xacda('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x72d936,_0x3333a6,_0x3dfaf2){return new BPromise(function(_0x2977e8,_0x5edbc3){return client[_0xacda('0xb')](_0x72d936,_0x3dfaf2)[_0xacda('0xc')](function(_0x9c71bb){logger[_0xacda('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3333a6,_0xacda('0xe'));logger[_0xacda('0xf')](_0xacda('0x10'),_0x3333a6,_0xacda('0xe'),JSON[_0xacda('0x11')](_0x9c71bb));if(_0x9c71bb['error']){if(_0x9c71bb[_0xacda('0x12')][_0xacda('0x13')]===0x1f4){logger[_0xacda('0x12')](_0xacda('0x14'),_0x3333a6,_0x9c71bb[_0xacda('0x12')][_0xacda('0x15')]);return _0x5edbc3(_0x9c71bb[_0xacda('0x12')]['message']);}logger['error'](_0xacda('0x14'),_0x3333a6,_0x9c71bb[_0xacda('0x12')][_0xacda('0x15')]);return _0x2977e8(_0x9c71bb['error']['message']);}else{logger[_0xacda('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3333a6,_0xacda('0xe'));_0x2977e8(_0x9c71bb[_0xacda('0x16')][_0xacda('0x15')]);}})['catch'](function(_0x86d55b){logger['error'](_0xacda('0x14'),_0x3333a6,_0x86d55b);_0x5edbc3(_0x86d55b);});});}
\ No newline at end of file
+var _0xfd83=['lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch'];(function(_0x279f0b,_0x1e7a35){var _0x1303ae=function(_0x5cd32c){while(--_0x5cd32c){_0x279f0b['push'](_0x279f0b['shift']());}};_0x1303ae(++_0x1e7a35);}(_0xfd83,0x1a2));var _0x3fd8=function(_0x56f3d4,_0xfc65dd){_0x56f3d4=_0x56f3d4-0x0;var _0x2c7ef0=_0xfd83[_0x56f3d4];return _0x2c7ef0;};'use strict';var _=require(_0x3fd8('0x0'));var util=require(_0x3fd8('0x1'));var moment=require(_0x3fd8('0x2'));var BPromise=require(_0x3fd8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3fd8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3fd8('0x5'))(_0x3fd8('0x6'));var config=require(_0x3fd8('0x7'));var jayson=require(_0x3fd8('0x8'));var client=jayson['client'][_0x3fd8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b9e83,_0x3348a6,_0x48fabc){return new BPromise(function(_0x1ee1dc,_0xff7752){return client['request'](_0x3b9e83,_0x48fabc)[_0x3fd8('0xa')](function(_0x3b3416){logger[_0x3fd8('0xb')](_0x3fd8('0xc'),_0x3348a6,'request\x20sent');logger[_0x3fd8('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3348a6,_0x3fd8('0xe'),JSON['stringify'](_0x3b3416));if(_0x3b3416[_0x3fd8('0xf')]){if(_0x3b3416[_0x3fd8('0xf')]['code']===0x1f4){logger[_0x3fd8('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3348a6,_0x3b3416[_0x3fd8('0xf')]['message']);return _0xff7752(_0x3b3416['error'][_0x3fd8('0x10')]);}logger[_0x3fd8('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3348a6,_0x3b3416['error']['message']);return _0x1ee1dc(_0x3b3416[_0x3fd8('0xf')][_0x3fd8('0x10')]);}else{logger['info'](_0x3fd8('0xc'),_0x3348a6,_0x3fd8('0xe'));_0x1ee1dc(_0x3b3416[_0x3fd8('0x11')][_0x3fd8('0x10')]);}})[_0x3fd8('0x12')](function(_0x2b0ad6){logger[_0x3fd8('0xf')](_0x3fd8('0xc'),_0x3348a6,_0x2b0ad6);_0xff7752(_0x2b0ad6);});});}
\ No newline at end of file
index 8de0865..5e2f088 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21f2=['put','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','index','/:id','show','post','create'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0x21f2,0x182));var _0x221f=function(_0x54291b,_0x10ff1a){_0x54291b=_0x54291b-0x0;var _0x35c025=_0x21f2[_0x54291b];return _0x35c025;};'use strict';var multer=require(_0x221f('0x0'));var util=require(_0x221f('0x1'));var path=require(_0x221f('0x2'));var timeout=require(_0x221f('0x3'));var express=require('express');var router=express[_0x221f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x221f('0x5'));var interaction=require(_0x221f('0x6'));var config=require('../../config/environment');var controller=require(_0x221f('0x7'));router[_0x221f('0x8')]('/',auth['isAuthenticated'](),controller[_0x221f('0x9')]);router[_0x221f('0x8')](_0x221f('0xa'),auth['isAuthenticated'](),controller[_0x221f('0xb')]);router[_0x221f('0xc')]('/',auth['isAuthenticated'](),controller[_0x221f('0xd')]);router[_0x221f('0xe')]('/:id',auth[_0x221f('0xf')](),controller[_0x221f('0x10')]);router[_0x221f('0x11')]('/:id',auth[_0x221f('0xf')](),controller[_0x221f('0x12')]);module[_0x221f('0x13')]=router;
\ No newline at end of file
+var _0x2627=['update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show','create','/:id'];(function(_0x1dd612,_0x32ffa4){var _0x51e837=function(_0x349497){while(--_0x349497){_0x1dd612['push'](_0x1dd612['shift']());}};_0x51e837(++_0x32ffa4);}(_0x2627,0xbe));var _0x7262=function(_0x5d7023,_0x293ec7){_0x5d7023=_0x5d7023-0x0;var _0x4cc12f=_0x2627[_0x5d7023];return _0x4cc12f;};'use strict';var multer=require('multer');var util=require(_0x7262('0x0'));var path=require(_0x7262('0x1'));var timeout=require(_0x7262('0x2'));var express=require(_0x7262('0x3'));var router=express['Router']();var fs_extra=require(_0x7262('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7262('0x5'));var config=require(_0x7262('0x6'));var controller=require(_0x7262('0x7'));router[_0x7262('0x8')]('/',auth[_0x7262('0x9')](),controller[_0x7262('0xa')]);router[_0x7262('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7262('0xb')]);router['post']('/',auth[_0x7262('0x9')](),controller[_0x7262('0xc')]);router['put'](_0x7262('0xd'),auth[_0x7262('0x9')](),controller[_0x7262('0xe')]);router[_0x7262('0xf')](_0x7262('0xd'),auth[_0x7262('0x9')](),controller['destroy']);module[_0x7262('0x10')]=router;
\ No newline at end of file
index 5b8a155..ae76800 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcba3=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x18e52b,_0x1fae35){var _0x3d3062=function(_0x133b14){while(--_0x133b14){_0x18e52b['push'](_0x18e52b['shift']());}};_0x3d3062(++_0x1fae35);}(_0xcba3,0xe3));var _0x3cba=function(_0x5c1e44,_0x46878b){_0x5c1e44=_0x5c1e44-0x0;var _0x266cab=_0xcba3[_0x5c1e44];return _0x266cab;};'use strict';var Sequelize=require(_0x3cba('0x0'));module[_0x3cba('0x1')]={'type':{'type':Sequelize[_0x3cba('0x2')](_0x3cba('0x3'),_0x3cba('0x4'),_0x3cba('0x5'),_0x3cba('0x6'),_0x3cba('0x7')),'defaultValue':_0x3cba('0x3')},'content':{'type':Sequelize[_0x3cba('0x8')]},'key':{'type':Sequelize[_0x3cba('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x3cba('0x3'),_0x3cba('0x4'),_0x3cba('0x5'))},'keyContent':{'type':Sequelize[_0x3cba('0x8')]},'idField':{'type':Sequelize[_0x3cba('0x8')]},'variableName':{'type':Sequelize[_0x3cba('0x8')]}};
\ No newline at end of file
+var _0x2a74=['customVariable','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2a74,0xdb));var _0x42a7=function(_0x24875d,_0x4fb24d){_0x24875d=_0x24875d-0x0;var _0x181471=_0x2a74[_0x24875d];return _0x181471;};'use strict';var Sequelize=require(_0x42a7('0x0'));module[_0x42a7('0x1')]={'type':{'type':Sequelize[_0x42a7('0x2')](_0x42a7('0x3'),_0x42a7('0x4'),_0x42a7('0x5'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x42a7('0x6')]},'key':{'type':Sequelize[_0x42a7('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x42a7('0x3'),_0x42a7('0x4'),_0x42a7('0x5'))},'keyContent':{'type':Sequelize[_0x42a7('0x6')]},'idField':{'type':Sequelize[_0x42a7('0x6')]},'variableName':{'type':Sequelize[_0x42a7('0x6')]}};
\ No newline at end of file
index 8e11fda..b6b0a98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x677b=['moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','SalesforceField','fieldName','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','destroy'];(function(_0x1a080a,_0x2802c6){var _0x31ed78=function(_0x1b688c){while(--_0x1b688c){_0x1a080a['push'](_0x1a080a['shift']());}};_0x31ed78(++_0x2802c6);}(_0x677b,0x8e));var _0xb677=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x677b[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb677('0x0'));var BPromise=require('bluebird');var Mustache=require(_0xb677('0x1'));var util=require(_0xb677('0x2'));var path=require(_0xb677('0x3'));var sox=require(_0xb677('0x4'));var csv=require(_0xb677('0x5'));var ejs=require(_0xb677('0x6'));var fs=require('fs');var fs_extra=require(_0xb677('0x7'));var _=require(_0xb677('0x8'));var squel=require(_0xb677('0x9'));var crypto=require(_0xb677('0xa'));var jsforce=require(_0xb677('0xb'));var deskjs=require(_0xb677('0xc'));var toCsv=require(_0xb677('0x5'));var querystring=require('querystring');var Papa=require(_0xb677('0xd'));var Redis=require(_0xb677('0xe'));var authService=require(_0xb677('0xf'));var qs=require(_0xb677('0x10'));var as=require(_0xb677('0x11'));var hardwareService=require(_0xb677('0x12'));var logger=require(_0xb677('0x13'))(_0xb677('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb677('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3066a0,_0x2e542b){_0x2e542b=_0x2e542b||0xcc;return function(_0x5515c5){if(_0x5515c5){return _0x3066a0[_0xb677('0x16')](_0x2e542b);}return _0x3066a0[_0xb677('0x17')](_0x2e542b)[_0xb677('0x18')]();};}function respondWithResult(_0x59373c,_0x17f688){_0x17f688=_0x17f688||0xc8;return function(_0xb41030){if(_0xb41030){return _0x59373c[_0xb677('0x17')](_0x17f688)['json'](_0xb41030);}};}function respondWithFilteredResult(_0x4eca0f,_0x3e43c0){return function(_0x468333){if(_0x468333){var _0x83353=typeof _0x3e43c0['offset']===_0xb677('0x19')&&typeof _0x3e43c0[_0xb677('0x1a')]==='undefined';var _0x3fe7d7=_0x468333[_0xb677('0x1b')];var _0x3b7afc=_0x83353?0x0:_0x3e43c0[_0xb677('0x1c')];var _0x2f1584=_0x83353?_0x468333[_0xb677('0x1b')]:_0x3e43c0[_0xb677('0x1c')]+_0x3e43c0[_0xb677('0x1a')];var _0x35d380;if(_0x2f1584>=_0x3fe7d7){_0x2f1584=_0x3fe7d7;_0x35d380=0xc8;}else{_0x35d380=0xce;}_0x4eca0f[_0xb677('0x17')](_0x35d380);return _0x4eca0f['set'](_0xb677('0x1d'),_0x3b7afc+'-'+_0x2f1584+'/'+_0x3fe7d7)['json'](_0x468333);}return null;};}function patchUpdates(_0x4b6fa8){return function(_0x55503f){try{jsonpatch[_0xb677('0x1e')](_0x55503f,_0x4b6fa8,!![]);}catch(_0x1fd219){return BPromise[_0xb677('0x1f')](_0x1fd219);}return _0x55503f['save']();};}function saveUpdates(_0x1d8ba7,_0x1fdc93){return function(_0x1b17fc){if(_0x1b17fc){return _0x1b17fc[_0xb677('0x20')](_0x1d8ba7)[_0xb677('0x21')](function(_0x211697){return _0x211697;});}return null;};}function removeEntity(_0x108e03,_0x4f1412){return function(_0x504220){if(_0x504220){return _0x504220['destroy']()[_0xb677('0x21')](function(){_0x108e03['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56a7eb,_0x5030d1){return function(_0x2d3562){if(!_0x2d3562){_0x56a7eb[_0xb677('0x16')](0x194);}return _0x2d3562;};}function handleError(_0x3ee5c7,_0x523c7d){_0x523c7d=_0x523c7d||0x1f4;return function(_0x27ada4){logger[_0xb677('0x22')](_0x27ada4[_0xb677('0x23')]);if(_0x27ada4[_0xb677('0x24')]){delete _0x27ada4[_0xb677('0x24')];}_0x3ee5c7[_0xb677('0x17')](_0x523c7d)[_0xb677('0x25')](_0x27ada4);};}exports[_0xb677('0x26')]=function(_0x5ee1ae,_0x553919){var _0x37397d={},_0x4c4045={},_0x56b29d={'count':0x0,'rows':[]};var _0x2a0e54=_[_0xb677('0x27')](db[_0xb677('0x28')]['rawAttributes'],function(_0x283f59){return{'name':_0x283f59[_0xb677('0x29')],'type':_0x283f59['type'][_0xb677('0x2a')]};});_0x4c4045[_0xb677('0x2b')]=_[_0xb677('0x27')](_0x2a0e54,_0xb677('0x24'));_0x4c4045['query']=_[_0xb677('0x2c')](_0x5ee1ae[_0xb677('0x2d')]);_0x4c4045['filters']=_['intersection'](_0x4c4045[_0xb677('0x2b')],_0x4c4045[_0xb677('0x2d')]);_0x37397d[_0xb677('0x2e')]=_[_0xb677('0x2f')](_0x4c4045[_0xb677('0x2b')],qs['fields'](_0x5ee1ae['query'][_0xb677('0x30')]));_0x37397d['attributes']=_0x37397d[_0xb677('0x2e')][_0xb677('0x31')]?_0x37397d[_0xb677('0x2e')]:_0x4c4045[_0xb677('0x2b')];if(!_0x5ee1ae[_0xb677('0x2d')][_0xb677('0x32')](_0xb677('0x33'))){_0x37397d['limit']=qs['limit'](_0x5ee1ae['query']['limit']);_0x37397d[_0xb677('0x1c')]=qs[_0xb677('0x1c')](_0x5ee1ae['query'][_0xb677('0x1c')]);}_0x37397d['order']=qs[_0xb677('0x34')](_0x5ee1ae['query'][_0xb677('0x34')]);_0x37397d['where']=qs[_0xb677('0x35')](_[_0xb677('0x36')](_0x5ee1ae['query'],_0x4c4045[_0xb677('0x35')]),_0x2a0e54);if(_0x5ee1ae[_0xb677('0x2d')][_0xb677('0x37')]){_0x37397d[_0xb677('0x38')]=_[_0xb677('0x39')](_0x37397d['where'],{'$or':_[_0xb677('0x27')](_0x2a0e54,function(_0x3deca3){if(_0x3deca3['type']!==_0xb677('0x3a')){var _0x5710dd={};_0x5710dd[_0x3deca3['name']]={'$like':'%'+_0x5ee1ae['query'][_0xb677('0x37')]+'%'};return _0x5710dd;}})});}_0x37397d=_['merge']({},_0x37397d,_0x5ee1ae[_0xb677('0x3b')]);var _0x41d670={'where':_0x37397d['where']};return db[_0xb677('0x28')][_0xb677('0x1b')](_0x41d670)[_0xb677('0x21')](function(_0x47fe58){_0x56b29d['count']=_0x47fe58;if(_0x5ee1ae[_0xb677('0x2d')][_0xb677('0x3c')]){_0x37397d[_0xb677('0x3d')]=[{'all':!![]}];}return db[_0xb677('0x28')][_0xb677('0x3e')](_0x37397d);})['then'](function(_0x2c5efa){_0x56b29d[_0xb677('0x3f')]=_0x2c5efa;return _0x56b29d;})['then'](respondWithFilteredResult(_0x553919,_0x37397d))[_0xb677('0x40')](handleError(_0x553919,null));};exports['show']=function(_0xd91ec9,_0x3d81d4){var _0x36ecdd={'raw':!![],'where':{'id':_0xd91ec9[_0xb677('0x41')]['id']}},_0x20992b={};_0x20992b[_0xb677('0x2b')]=_[_0xb677('0x2c')](db[_0xb677('0x28')][_0xb677('0x42')]);_0x20992b['query']=_[_0xb677('0x2c')](_0xd91ec9[_0xb677('0x2d')]);_0x20992b[_0xb677('0x35')]=_[_0xb677('0x2f')](_0x20992b[_0xb677('0x2b')],_0x20992b[_0xb677('0x2d')]);_0x36ecdd[_0xb677('0x2e')]=_[_0xb677('0x2f')](_0x20992b[_0xb677('0x2b')],qs[_0xb677('0x30')](_0xd91ec9['query'][_0xb677('0x30')]));_0x36ecdd[_0xb677('0x2e')]=_0x36ecdd[_0xb677('0x2e')][_0xb677('0x31')]?_0x36ecdd['attributes']:_0x20992b[_0xb677('0x2b')];if(_0xd91ec9[_0xb677('0x2d')]['includeAll']){_0x36ecdd[_0xb677('0x3d')]=[{'all':!![]}];}_0x36ecdd=_[_0xb677('0x39')]({},_0x36ecdd,_0xd91ec9[_0xb677('0x3b')]);return db[_0xb677('0x28')][_0xb677('0x43')](_0x36ecdd)[_0xb677('0x21')](handleEntityNotFound(_0x3d81d4,null))[_0xb677('0x21')](respondWithResult(_0x3d81d4,null))['catch'](handleError(_0x3d81d4,null));};exports[_0xb677('0x44')]=function(_0x57e6fa,_0x57df63){return db['SalesforceField'][_0xb677('0x44')](_0x57e6fa[_0xb677('0x45')],{})[_0xb677('0x21')](respondWithResult(_0x57df63,0xc9))[_0xb677('0x40')](handleError(_0x57df63,null));};exports['update']=function(_0x379341,_0x1830a8){if(_0x379341[_0xb677('0x45')]['id']){delete _0x379341[_0xb677('0x45')]['id'];}return db[_0xb677('0x28')][_0xb677('0x43')]({'where':{'id':_0x379341[_0xb677('0x41')]['id']}})['then'](handleEntityNotFound(_0x1830a8,null))[_0xb677('0x21')](saveUpdates(_0x379341['body'],null))[_0xb677('0x21')](respondWithResult(_0x1830a8,null))[_0xb677('0x40')](handleError(_0x1830a8,null));};exports[_0xb677('0x46')]=function(_0x39abb2,_0x77e46b){return db[_0xb677('0x28')][_0xb677('0x43')]({'where':{'id':_0x39abb2[_0xb677('0x41')]['id']}})[_0xb677('0x21')](handleEntityNotFound(_0x77e46b,null))['then'](removeEntity(_0x77e46b,null))['catch'](handleError(_0x77e46b,null));};
\ No newline at end of file
+var _0x715e=['count','offset','set','apply','save','then','stack','name','index','SalesforceField','rawAttributes','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','update','body','destroy','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit'];(function(_0x3f9b7f,_0x45e5d7){var _0x27cae0=function(_0x14711e){while(--_0x14711e){_0x3f9b7f['push'](_0x3f9b7f['shift']());}};_0x27cae0(++_0x45e5d7);}(_0x715e,0xf9));var _0xe715=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x715e[_0x209941];return _0x1e8729;};'use strict';var emlformat=require(_0xe715('0x0'));var rimraf=require(_0xe715('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe715('0x2'));var BPromise=require(_0xe715('0x3'));var Mustache=require(_0xe715('0x4'));var util=require(_0xe715('0x5'));var path=require(_0xe715('0x6'));var sox=require(_0xe715('0x7'));var csv=require('to-csv');var ejs=require(_0xe715('0x8'));var fs=require('fs');var fs_extra=require(_0xe715('0x9'));var _=require(_0xe715('0xa'));var squel=require(_0xe715('0xb'));var crypto=require(_0xe715('0xc'));var jsforce=require(_0xe715('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe715('0xe'));var Redis=require(_0xe715('0xf'));var authService=require(_0xe715('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe715('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xe715('0x12'));var config=require(_0xe715('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xe715('0x14'))['db'];function respondWithStatusCode(_0x19801e,_0x1748e6){_0x1748e6=_0x1748e6||0xcc;return function(_0x36a00a){if(_0x36a00a){return _0x19801e[_0xe715('0x15')](_0x1748e6);}return _0x19801e[_0xe715('0x16')](_0x1748e6)[_0xe715('0x17')]();};}function respondWithResult(_0x41e617,_0x58a5fe){_0x58a5fe=_0x58a5fe||0xc8;return function(_0x1b5d57){if(_0x1b5d57){return _0x41e617[_0xe715('0x16')](_0x58a5fe)[_0xe715('0x18')](_0x1b5d57);}};}function respondWithFilteredResult(_0x1fcf63,_0xe0fc05){return function(_0x16df71){if(_0x16df71){var _0x46858c=typeof _0xe0fc05['offset']===_0xe715('0x19')&&typeof _0xe0fc05[_0xe715('0x1a')]==='undefined';var _0x433b60=_0x16df71[_0xe715('0x1b')];var _0x10049b=_0x46858c?0x0:_0xe0fc05[_0xe715('0x1c')];var _0x3b1a46=_0x46858c?_0x16df71[_0xe715('0x1b')]:_0xe0fc05[_0xe715('0x1c')]+_0xe0fc05[_0xe715('0x1a')];var _0x558fa4;if(_0x3b1a46>=_0x433b60){_0x3b1a46=_0x433b60;_0x558fa4=0xc8;}else{_0x558fa4=0xce;}_0x1fcf63[_0xe715('0x16')](_0x558fa4);return _0x1fcf63[_0xe715('0x1d')]('Content-Range',_0x10049b+'-'+_0x3b1a46+'/'+_0x433b60)[_0xe715('0x18')](_0x16df71);}return null;};}function patchUpdates(_0x52b4a6){return function(_0x2ebb6a){try{jsonpatch[_0xe715('0x1e')](_0x2ebb6a,_0x52b4a6,!![]);}catch(_0x358289){return BPromise['reject'](_0x358289);}return _0x2ebb6a[_0xe715('0x1f')]();};}function saveUpdates(_0x21c3a3,_0x24d111){return function(_0x35cc90){if(_0x35cc90){return _0x35cc90['update'](_0x21c3a3)[_0xe715('0x20')](function(_0x1f8b5a){return _0x1f8b5a;});}return null;};}function removeEntity(_0x187e2d,_0xf1058a){return function(_0x146269){if(_0x146269){return _0x146269['destroy']()[_0xe715('0x20')](function(){_0x187e2d[_0xe715('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48f64b,_0x4988b4){return function(_0x3db7d0){if(!_0x3db7d0){_0x48f64b[_0xe715('0x15')](0x194);}return _0x3db7d0;};}function handleError(_0x42b261,_0x5c1ad5){_0x5c1ad5=_0x5c1ad5||0x1f4;return function(_0x3d81ac){logger['error'](_0x3d81ac[_0xe715('0x21')]);if(_0x3d81ac[_0xe715('0x22')]){delete _0x3d81ac[_0xe715('0x22')];}_0x42b261['status'](_0x5c1ad5)['send'](_0x3d81ac);};}exports[_0xe715('0x23')]=function(_0x4e6b7e,_0xb5ad2){var _0x1450d1={},_0x223539={},_0x1cc712={'count':0x0,'rows':[]};var _0x3cd479=_['map'](db[_0xe715('0x24')][_0xe715('0x25')],function(_0x3dc4e5){return{'name':_0x3dc4e5['fieldName'],'type':_0x3dc4e5['type']['key']};});_0x223539[_0xe715('0x26')]=_[_0xe715('0x27')](_0x3cd479,_0xe715('0x22'));_0x223539[_0xe715('0x28')]=_['keys'](_0x4e6b7e['query']);_0x223539[_0xe715('0x29')]=_[_0xe715('0x2a')](_0x223539[_0xe715('0x26')],_0x223539['query']);_0x1450d1['attributes']=_['intersection'](_0x223539[_0xe715('0x26')],qs[_0xe715('0x2b')](_0x4e6b7e[_0xe715('0x28')][_0xe715('0x2b')]));_0x1450d1[_0xe715('0x2c')]=_0x1450d1['attributes']['length']?_0x1450d1[_0xe715('0x2c')]:_0x223539[_0xe715('0x26')];if(!_0x4e6b7e[_0xe715('0x28')][_0xe715('0x2d')](_0xe715('0x2e'))){_0x1450d1[_0xe715('0x1a')]=qs['limit'](_0x4e6b7e['query'][_0xe715('0x1a')]);_0x1450d1[_0xe715('0x1c')]=qs[_0xe715('0x1c')](_0x4e6b7e[_0xe715('0x28')][_0xe715('0x1c')]);}_0x1450d1[_0xe715('0x2f')]=qs['sort'](_0x4e6b7e[_0xe715('0x28')][_0xe715('0x30')]);_0x1450d1[_0xe715('0x31')]=qs[_0xe715('0x29')](_[_0xe715('0x32')](_0x4e6b7e[_0xe715('0x28')],_0x223539[_0xe715('0x29')]),_0x3cd479);if(_0x4e6b7e[_0xe715('0x28')]['filter']){_0x1450d1['where']=_[_0xe715('0x33')](_0x1450d1[_0xe715('0x31')],{'$or':_['map'](_0x3cd479,function(_0x50a3a9){if(_0x50a3a9[_0xe715('0x34')]!=='VIRTUAL'){var _0x46cc28={};_0x46cc28[_0x50a3a9[_0xe715('0x22')]]={'$like':'%'+_0x4e6b7e[_0xe715('0x28')][_0xe715('0x35')]+'%'};return _0x46cc28;}})});}_0x1450d1=_['merge']({},_0x1450d1,_0x4e6b7e[_0xe715('0x36')]);var _0x12eac0={'where':_0x1450d1['where']};return db[_0xe715('0x24')][_0xe715('0x1b')](_0x12eac0)[_0xe715('0x20')](function(_0x5234a6){_0x1cc712[_0xe715('0x1b')]=_0x5234a6;if(_0x4e6b7e[_0xe715('0x28')][_0xe715('0x37')]){_0x1450d1[_0xe715('0x38')]=[{'all':!![]}];}return db[_0xe715('0x24')][_0xe715('0x39')](_0x1450d1);})['then'](function(_0x5dcd38){_0x1cc712[_0xe715('0x3a')]=_0x5dcd38;return _0x1cc712;})[_0xe715('0x20')](respondWithFilteredResult(_0xb5ad2,_0x1450d1))[_0xe715('0x3b')](handleError(_0xb5ad2,null));};exports[_0xe715('0x3c')]=function(_0x3cc82f,_0x3680e5){var _0xedd315={'raw':!![],'where':{'id':_0x3cc82f[_0xe715('0x3d')]['id']}},_0x205a1c={};_0x205a1c[_0xe715('0x26')]=_[_0xe715('0x3e')](db[_0xe715('0x24')][_0xe715('0x25')]);_0x205a1c[_0xe715('0x28')]=_[_0xe715('0x3e')](_0x3cc82f[_0xe715('0x28')]);_0x205a1c['filters']=_[_0xe715('0x2a')](_0x205a1c[_0xe715('0x26')],_0x205a1c[_0xe715('0x28')]);_0xedd315[_0xe715('0x2c')]=_[_0xe715('0x2a')](_0x205a1c[_0xe715('0x26')],qs[_0xe715('0x2b')](_0x3cc82f[_0xe715('0x28')][_0xe715('0x2b')]));_0xedd315[_0xe715('0x2c')]=_0xedd315[_0xe715('0x2c')][_0xe715('0x3f')]?_0xedd315[_0xe715('0x2c')]:_0x205a1c[_0xe715('0x26')];if(_0x3cc82f[_0xe715('0x28')]['includeAll']){_0xedd315['include']=[{'all':!![]}];}_0xedd315=_[_0xe715('0x33')]({},_0xedd315,_0x3cc82f[_0xe715('0x36')]);return db['SalesforceField'][_0xe715('0x40')](_0xedd315)[_0xe715('0x20')](handleEntityNotFound(_0x3680e5,null))[_0xe715('0x20')](respondWithResult(_0x3680e5,null))[_0xe715('0x3b')](handleError(_0x3680e5,null));};exports[_0xe715('0x41')]=function(_0x19fd4a,_0x57c63a){return db['SalesforceField'][_0xe715('0x41')](_0x19fd4a['body'],{})[_0xe715('0x20')](respondWithResult(_0x57c63a,0xc9))[_0xe715('0x3b')](handleError(_0x57c63a,null));};exports[_0xe715('0x42')]=function(_0x207be6,_0x32f296){if(_0x207be6[_0xe715('0x43')]['id']){delete _0x207be6[_0xe715('0x43')]['id'];}return db[_0xe715('0x24')][_0xe715('0x40')]({'where':{'id':_0x207be6[_0xe715('0x3d')]['id']}})['then'](handleEntityNotFound(_0x32f296,null))[_0xe715('0x20')](saveUpdates(_0x207be6['body'],null))[_0xe715('0x20')](respondWithResult(_0x32f296,null))[_0xe715('0x3b')](handleError(_0x32f296,null));};exports[_0xe715('0x44')]=function(_0x57fc64,_0x427260){return db[_0xe715('0x24')][_0xe715('0x40')]({'where':{'id':_0x57fc64[_0xe715('0x3d')]['id']}})[_0xe715('0x20')](handleEntityNotFound(_0x427260,null))[_0xe715('0x20')](removeEntity(_0x427260,null))[_0xe715('0x3b')](handleError(_0x427260,null));};
\ No newline at end of file
index c7ccf88..df6a9d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3a9=['bluebird','request-promise','rimraf','../../config/environment','exports','define','SalesforceField','salesforce_unique_index','idField','FieldId','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa3a9,0x18b));var _0x9a3a=function(_0xcba989,_0x15669a){_0xcba989=_0xcba989-0x0;var _0x3d86ca=_0xa3a9[_0xcba989];return _0x3d86ca;};'use strict';var _=require('lodash');var util=require(_0x9a3a('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9a3a('0x1'));var rp=require(_0x9a3a('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a3a('0x3'));var config=require(_0x9a3a('0x4'));var attributes=require('./intSalesforceField.attributes');module[_0x9a3a('0x5')]=function(_0xc17500,_0x27a30c){return _0xc17500[_0x9a3a('0x6')](_0x9a3a('0x7'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x9a3a('0x8'),'fields':[_0x9a3a('0x9'),_0x9a3a('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf910=['FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','int_salesforce_fields','salesforce_unique_index'];(function(_0x5a5b7c,_0x4310d1){var _0xdf80e8=function(_0x4bbdcf){while(--_0x4bbdcf){_0x5a5b7c['push'](_0x5a5b7c['shift']());}};_0xdf80e8(++_0x4310d1);}(_0xf910,0x1c3));var _0x0f91=function(_0x3bbb83,_0x584cc4){_0x3bbb83=_0x3bbb83-0x0;var _0x4f297e=_0xf910[_0x3bbb83];return _0x4f297e;};'use strict';var _=require(_0x0f91('0x0'));var util=require(_0x0f91('0x1'));var logger=require(_0x0f91('0x2'))(_0x0f91('0x3'));var moment=require('moment');var BPromise=require(_0x0f91('0x4'));var rp=require(_0x0f91('0x5'));var fs=require('fs');var path=require(_0x0f91('0x6'));var rimraf=require(_0x0f91('0x7'));var config=require(_0x0f91('0x8'));var attributes=require(_0x0f91('0x9'));module[_0x0f91('0xa')]=function(_0x5e1a58,_0x225a45){return _0x5e1a58[_0x0f91('0xb')]('SalesforceField',attributes,{'tableName':_0x0f91('0xc'),'paranoid':![],'indexes':[{'name':_0x0f91('0xd'),'fields':['idField',_0x0f91('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 8e721f8..d5a5f7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x014b=['info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then'];(function(_0x13e274,_0x6f8a35){var _0x2e091d=function(_0x565ccb){while(--_0x565ccb){_0x13e274['push'](_0x13e274['shift']());}};_0x2e091d(++_0x6f8a35);}(_0x014b,0x198));var _0xb014=function(_0x35ab90,_0x1792cd){_0x35ab90=_0x35ab90-0x0;var _0x2d8b12=_0x014b[_0x35ab90];return _0x2d8b12;};'use strict';var _=require('lodash');var util=require(_0xb014('0x0'));var moment=require(_0xb014('0x1'));var BPromise=require('bluebird');var rs=require(_0xb014('0x2'));var fs=require('fs');var Redis=require(_0xb014('0x3'));var db=require(_0xb014('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb014('0x5'))(_0xb014('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb014('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x274c03,_0x47a8df,_0x54c734){return new BPromise(function(_0x230ede,_0x4113ae){return client[_0xb014('0x8')](_0x274c03,_0x54c734)[_0xb014('0x9')](function(_0x9029f2){logger[_0xb014('0xa')](_0xb014('0xb'),_0x47a8df,_0xb014('0xc'));logger[_0xb014('0xd')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x47a8df,'request\x20sent',JSON['stringify'](_0x9029f2));if(_0x9029f2[_0xb014('0xe')]){if(_0x9029f2['error'][_0xb014('0xf')]===0x1f4){logger[_0xb014('0xe')](_0xb014('0xb'),_0x47a8df,_0x9029f2['error'][_0xb014('0x10')]);return _0x4113ae(_0x9029f2[_0xb014('0xe')]['message']);}logger[_0xb014('0xe')]('SalesforceField,\x20%s,\x20%s',_0x47a8df,_0x9029f2['error'][_0xb014('0x10')]);return _0x230ede(_0x9029f2[_0xb014('0xe')][_0xb014('0x10')]);}else{logger[_0xb014('0xa')]('SalesforceField,\x20%s,\x20%s',_0x47a8df,_0xb014('0xc'));_0x230ede(_0x9029f2[_0xb014('0x11')][_0xb014('0x10')]);}})[_0xb014('0x12')](function(_0x77f8c8){logger['error'](_0xb014('0xb'),_0x47a8df,_0x77f8c8);_0x4113ae(_0x77f8c8);});});}
\ No newline at end of file
+var _0xd032=['error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xd032,0xb3));var _0x2d03=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xd032[_0x1a7846];return _0x48049;};'use strict';var _=require('lodash');var util=require(_0x2d03('0x0'));var moment=require(_0x2d03('0x1'));var BPromise=require(_0x2d03('0x2'));var rs=require(_0x2d03('0x3'));var fs=require('fs');var Redis=require(_0x2d03('0x4'));var db=require(_0x2d03('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d03('0x6'))(_0x2d03('0x7'));var config=require(_0x2d03('0x8'));var jayson=require(_0x2d03('0x9'));var client=jayson[_0x2d03('0xa')][_0x2d03('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18566b,_0x5cb6e7,_0xbfec1c){return new BPromise(function(_0x2318bf,_0x3c54ce){return client['request'](_0x18566b,_0xbfec1c)[_0x2d03('0xc')](function(_0x4bb239){logger[_0x2d03('0xd')](_0x2d03('0xe'),_0x5cb6e7,_0x2d03('0xf'));logger[_0x2d03('0x10')](_0x2d03('0x11'),_0x5cb6e7,'request\x20sent',JSON[_0x2d03('0x12')](_0x4bb239));if(_0x4bb239['error']){if(_0x4bb239[_0x2d03('0x13')]['code']===0x1f4){logger[_0x2d03('0x13')](_0x2d03('0xe'),_0x5cb6e7,_0x4bb239[_0x2d03('0x13')][_0x2d03('0x14')]);return _0x3c54ce(_0x4bb239[_0x2d03('0x13')][_0x2d03('0x14')]);}logger[_0x2d03('0x13')](_0x2d03('0xe'),_0x5cb6e7,_0x4bb239[_0x2d03('0x13')][_0x2d03('0x14')]);return _0x2318bf(_0x4bb239['error'][_0x2d03('0x14')]);}else{logger[_0x2d03('0xd')]('SalesforceField,\x20%s,\x20%s',_0x5cb6e7,_0x2d03('0xf'));_0x2318bf(_0x4bb239['result'][_0x2d03('0x14')]);}})[_0x2d03('0x15')](function(_0x286851){logger[_0x2d03('0x13')]('SalesforceField,\x20%s,\x20%s',_0x5cb6e7,_0x286851);_0x3c54ce(_0x286851);});});}
\ No newline at end of file
index b5cc7ff..5393ad0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0431=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','/:id','delete'];(function(_0x59036b,_0x3c42ad){var _0x59404e=function(_0x3bc0e3){while(--_0x3bc0e3){_0x59036b['push'](_0x59036b['shift']());}};_0x59404e(++_0x3c42ad);}(_0x0431,0x11d));var _0x1043=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0x0431[_0x245afe];return _0x4eefde;};'use strict';var multer=require(_0x1043('0x0'));var util=require(_0x1043('0x1'));var path=require(_0x1043('0x2'));var timeout=require(_0x1043('0x3'));var express=require(_0x1043('0x4'));var router=express['Router']();var fs_extra=require(_0x1043('0x5'));var auth=require(_0x1043('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1043('0x7'));var controller=require(_0x1043('0x8'));router[_0x1043('0x9')]('/',auth[_0x1043('0xa')](),controller['index']);router[_0x1043('0x9')]('/:id',auth[_0x1043('0xa')](),controller['show']);router[_0x1043('0x9')]('/:id/configurations',auth[_0x1043('0xa')](),controller[_0x1043('0xb')]);router[_0x1043('0x9')](_0x1043('0xc'),auth[_0x1043('0xa')](),controller[_0x1043('0xd')]);router[_0x1043('0xe')]('/',auth[_0x1043('0xa')](),controller['create']);router[_0x1043('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x1043('0xf')]);router[_0x1043('0x10')](_0x1043('0x11'),auth[_0x1043('0xa')](),controller['update']);router[_0x1043('0x12')](_0x1043('0x11'),auth[_0x1043('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x14a4=['index','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x14a4,0x147));var _0x414a=function(_0x5c8702,_0x39b333){_0x5c8702=_0x5c8702-0x0;var _0x39af18=_0x14a4[_0x5c8702];return _0x39af18;};'use strict';var multer=require(_0x414a('0x0'));var util=require(_0x414a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x414a('0x2')]();var fs_extra=require(_0x414a('0x3'));var auth=require(_0x414a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x414a('0x5'));var controller=require(_0x414a('0x6'));router[_0x414a('0x7')]('/',auth[_0x414a('0x8')](),controller[_0x414a('0x9')]);router[_0x414a('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x414a('0x7')](_0x414a('0xa'),auth[_0x414a('0x8')](),controller[_0x414a('0xb')]);router[_0x414a('0x7')]('/:id/fields',auth[_0x414a('0x8')](),controller[_0x414a('0xc')]);router[_0x414a('0xd')]('/',auth[_0x414a('0x8')](),controller[_0x414a('0xe')]);router[_0x414a('0xd')]('/:id/configurations',auth[_0x414a('0x8')](),controller[_0x414a('0xf')]);router[_0x414a('0x10')]('/:id',auth[_0x414a('0x8')](),controller['update']);router[_0x414a('0x11')](_0x414a('0x12'),auth[_0x414a('0x8')](),controller[_0x414a('0x13')]);module[_0x414a('0x14')]=router;
\ No newline at end of file
index aa22cf3..4d3bb23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f0d=['remoteUri','sequelize','exports','STRING'];(function(_0x590edf,_0x1ae1e7){var _0x2c67e5=function(_0x825ebe){while(--_0x825ebe){_0x590edf['push'](_0x590edf['shift']());}};_0x2c67e5(++_0x1ae1e7);}(_0x9f0d,0x119));var _0xd9f0=function(_0xf49807,_0x4f0cf0){_0xf49807=_0xf49807-0x0;var _0x5aef9=_0x9f0d[_0xf49807];return _0x5aef9;};'use strict';var Sequelize=require(_0xd9f0('0x0'));module[_0xd9f0('0x1')]={'name':{'type':Sequelize[_0xd9f0('0x2')]},'description':{'type':Sequelize[_0xd9f0('0x2')]},'username':{'type':Sequelize[_0xd9f0('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xd9f0('0x2')]},'email':{'type':Sequelize[_0xd9f0('0x2')]},'remoteUri':{'type':Sequelize[_0xd9f0('0x2')],'unique':_0xd9f0('0x3')},'serverUrl':{'type':Sequelize[_0xd9f0('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xea93=['exports','STRING','username','sequelize'];(function(_0x3c1142,_0x17883b){var _0x26e22c=function(_0x499b57){while(--_0x499b57){_0x3c1142['push'](_0x3c1142['shift']());}};_0x26e22c(++_0x17883b);}(_0xea93,0x123));var _0x3ea9=function(_0x19d24c,_0x62bc50){_0x19d24c=_0x19d24c-0x0;var _0x2fae8d=_0xea93[_0x19d24c];return _0x2fae8d;};'use strict';var Sequelize=require(_0x3ea9('0x0'));module[_0x3ea9('0x1')]={'name':{'type':Sequelize[_0x3ea9('0x2')]},'description':{'type':Sequelize[_0x3ea9('0x2')]},'username':{'type':Sequelize[_0x3ea9('0x2')],'unique':_0x3ea9('0x3')},'password':{'type':Sequelize[_0x3ea9('0x2')]},'email':{'type':Sequelize[_0x3ea9('0x2')]},'remoteUri':{'type':Sequelize[_0x3ea9('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index c48a357..433c8cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe857=['update','then','destroy','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','includeAll','include','rows','catch','params','find','create','body','getConfigurations','findOne','ServicenowConfiguration','pick','filter','AccountId','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','Subjects','made_sla','hold_reason','close_code','notify','parent','watch_list','upon_reject','sys_updated_on','child_incidents','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','priority','rfc','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','approval_set','subcategory','work_notes','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','sys_id','contact_type','reopened_by','incident_state','urgency','company','reassignment_count','activity_due','severity','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','GET','incident?sysparm_display_value=all','assign','includes','forEach','label','all','log','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','true','false','sys_choice?sysparm_query=name=incident^element=','result','inactive','value','push','options','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','save'];(function(_0x57dc85,_0x3a6d51){var _0x563a2e=function(_0x5713b2){while(--_0x5713b2){_0x57dc85['push'](_0x57dc85['shift']());}};_0x563a2e(++_0x3a6d51);}(_0xe857,0x13d));var _0x7e85=function(_0x1ae92a,_0x28fead){_0x1ae92a=_0x1ae92a-0x0;var _0xa39e12=_0xe857[_0x1ae92a];return _0xa39e12;};'use strict';var emlformat=require(_0x7e85('0x0'));var rimraf=require(_0x7e85('0x1'));var zipdir=require(_0x7e85('0x2'));var jsonpatch=require(_0x7e85('0x3'));var rp=require(_0x7e85('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7e85('0x5'));var util=require(_0x7e85('0x6'));var path=require(_0x7e85('0x7'));var sox=require(_0x7e85('0x8'));var csv=require(_0x7e85('0x9'));var ejs=require(_0x7e85('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e85('0xb'));var squel=require(_0x7e85('0xc'));var crypto=require(_0x7e85('0xd'));var jsforce=require(_0x7e85('0xe'));var deskjs=require(_0x7e85('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7e85('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7e85('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e85('0x12'));var logger=require('../../config/logger')(_0x7e85('0x13'));var utils=require(_0x7e85('0x14'));var config=require(_0x7e85('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7e85('0x16'))['db'];var integrations=require(_0x7e85('0x17'));function respondWithStatusCode(_0x3b7544,_0x51db21){_0x51db21=_0x51db21||0xcc;return function(_0x4f6652){if(_0x4f6652){return _0x3b7544[_0x7e85('0x18')](_0x51db21);}return _0x3b7544['status'](_0x51db21)[_0x7e85('0x19')]();};}function respondWithResult(_0x3d24e5,_0x85f710){_0x85f710=_0x85f710||0xc8;return function(_0x19d105){if(_0x19d105){return _0x3d24e5[_0x7e85('0x1a')](_0x85f710)[_0x7e85('0x1b')](_0x19d105);}};}function respondWithFilteredResult(_0x446fe5,_0x341935){return function(_0x51e487){if(_0x51e487){var _0x58420e=typeof _0x341935[_0x7e85('0x1c')]==='undefined'&&typeof _0x341935[_0x7e85('0x1d')]===_0x7e85('0x1e');var _0x220919=_0x51e487[_0x7e85('0x1f')];var _0x259b70=_0x58420e?0x0:_0x341935[_0x7e85('0x1c')];var _0x5d9663=_0x58420e?_0x51e487[_0x7e85('0x1f')]:_0x341935[_0x7e85('0x1c')]+_0x341935[_0x7e85('0x1d')];var _0xcd8c7c;if(_0x5d9663>=_0x220919){_0x5d9663=_0x220919;_0xcd8c7c=0xc8;}else{_0xcd8c7c=0xce;}_0x446fe5[_0x7e85('0x1a')](_0xcd8c7c);return _0x446fe5[_0x7e85('0x20')]('Content-Range',_0x259b70+'-'+_0x5d9663+'/'+_0x220919)[_0x7e85('0x1b')](_0x51e487);}return null;};}function patchUpdates(_0x13e6e5){return function(_0xc6b1cd){try{jsonpatch[_0x7e85('0x21')](_0xc6b1cd,_0x13e6e5,!![]);}catch(_0x3536b3){return BPromise['reject'](_0x3536b3);}return _0xc6b1cd[_0x7e85('0x22')]();};}function saveUpdates(_0x38c850,_0x53914b){return function(_0x510969){if(_0x510969){return _0x510969[_0x7e85('0x23')](_0x38c850)[_0x7e85('0x24')](function(_0xbb2393){return _0xbb2393;});}return null;};}function removeEntity(_0x423a22,_0x47de3f){return function(_0x5eab86){if(_0x5eab86){return _0x5eab86[_0x7e85('0x25')]()['then'](function(){_0x423a22['status'](0xcc)[_0x7e85('0x19')]();});}};}function handleEntityNotFound(_0x22306f,_0x43ee16){return function(_0x272d67){if(!_0x272d67){_0x22306f['sendStatus'](0x194);}return _0x272d67;};}function handleError(_0x21206d,_0x41b853){_0x41b853=_0x41b853||0x1f4;return function(_0x5d3438){logger[_0x7e85('0x26')](_0x5d3438[_0x7e85('0x27')]);if(_0x5d3438[_0x7e85('0x28')]){delete _0x5d3438['name'];}_0x21206d[_0x7e85('0x1a')](_0x41b853)[_0x7e85('0x29')](_0x5d3438);};}exports[_0x7e85('0x2a')]=function(_0x240456,_0x1b2078){var _0x5c0d2b={},_0x5a2748={},_0x3dbe35={'count':0x0,'rows':[]};var _0x58f3d3=_[_0x7e85('0x2b')](db[_0x7e85('0x2c')][_0x7e85('0x2d')],function(_0x3a134c){return{'name':_0x3a134c[_0x7e85('0x2e')],'type':_0x3a134c[_0x7e85('0x2f')][_0x7e85('0x30')]};});_0x5a2748[_0x7e85('0x31')]=_['map'](_0x58f3d3,_0x7e85('0x28'));_0x5a2748[_0x7e85('0x32')]=_[_0x7e85('0x33')](_0x240456[_0x7e85('0x32')]);_0x5a2748[_0x7e85('0x34')]=_['intersection'](_0x5a2748[_0x7e85('0x31')],_0x5a2748[_0x7e85('0x32')]);_0x5c0d2b[_0x7e85('0x35')]=_[_0x7e85('0x36')](_0x5a2748[_0x7e85('0x31')],qs[_0x7e85('0x37')](_0x240456[_0x7e85('0x32')][_0x7e85('0x37')]));_0x5c0d2b['attributes']=_0x5c0d2b[_0x7e85('0x35')][_0x7e85('0x38')]?_0x5c0d2b[_0x7e85('0x35')]:_0x5a2748['model'];if(!_0x240456[_0x7e85('0x32')][_0x7e85('0x39')]('nolimit')){_0x5c0d2b[_0x7e85('0x1d')]=qs[_0x7e85('0x1d')](_0x240456[_0x7e85('0x32')][_0x7e85('0x1d')]);_0x5c0d2b[_0x7e85('0x1c')]=qs[_0x7e85('0x1c')](_0x240456[_0x7e85('0x32')]['offset']);}_0x5c0d2b[_0x7e85('0x3a')]=qs['sort'](_0x240456[_0x7e85('0x32')][_0x7e85('0x3b')]);_0x5c0d2b[_0x7e85('0x3c')]=qs[_0x7e85('0x34')](_['pick'](_0x240456[_0x7e85('0x32')],_0x5a2748[_0x7e85('0x34')]),_0x58f3d3);if(_0x240456[_0x7e85('0x32')]['filter']){_0x5c0d2b[_0x7e85('0x3c')]=_['merge'](_0x5c0d2b[_0x7e85('0x3c')],{'$or':_[_0x7e85('0x2b')](_0x58f3d3,function(_0x6d424){if(_0x6d424[_0x7e85('0x2f')]!=='VIRTUAL'){var _0x568324={};_0x568324[_0x6d424[_0x7e85('0x28')]]={'$like':'%'+_0x240456[_0x7e85('0x32')]['filter']+'%'};return _0x568324;}})});}_0x5c0d2b=_[_0x7e85('0x3d')]({},_0x5c0d2b,_0x240456['options']);var _0x45e379={'where':_0x5c0d2b[_0x7e85('0x3c')]};return db[_0x7e85('0x2c')][_0x7e85('0x1f')](_0x45e379)[_0x7e85('0x24')](function(_0x3d8fe8){_0x3dbe35[_0x7e85('0x1f')]=_0x3d8fe8;if(_0x240456[_0x7e85('0x32')][_0x7e85('0x3e')]){_0x5c0d2b[_0x7e85('0x3f')]=[{'all':!![]}];}return db[_0x7e85('0x2c')]['findAll'](_0x5c0d2b);})[_0x7e85('0x24')](function(_0x55302a){_0x3dbe35[_0x7e85('0x40')]=_0x55302a;return _0x3dbe35;})[_0x7e85('0x24')](respondWithFilteredResult(_0x1b2078,_0x5c0d2b))[_0x7e85('0x41')](handleError(_0x1b2078,null));};exports['show']=function(_0x512406,_0x238b0d){var _0x56110b={'raw':![],'where':{'id':_0x512406[_0x7e85('0x42')]['id']}},_0x3fcac0={};_0x3fcac0['model']=_[_0x7e85('0x33')](db[_0x7e85('0x2c')][_0x7e85('0x2d')]);_0x3fcac0[_0x7e85('0x32')]=_[_0x7e85('0x33')](_0x512406[_0x7e85('0x32')]);_0x3fcac0['filters']=_[_0x7e85('0x36')](_0x3fcac0[_0x7e85('0x31')],_0x3fcac0[_0x7e85('0x32')]);_0x56110b['attributes']=_['intersection'](_0x3fcac0[_0x7e85('0x31')],qs[_0x7e85('0x37')](_0x512406[_0x7e85('0x32')]['fields']));_0x56110b[_0x7e85('0x35')]=_0x56110b[_0x7e85('0x35')][_0x7e85('0x38')]?_0x56110b[_0x7e85('0x35')]:_0x3fcac0[_0x7e85('0x31')];if(_0x512406['query']['includeAll']){_0x56110b[_0x7e85('0x3f')]=[{'all':!![]}];}_0x56110b=_[_0x7e85('0x3d')]({},_0x56110b,_0x512406['options']);return db[_0x7e85('0x2c')][_0x7e85('0x43')](_0x56110b)['then'](handleEntityNotFound(_0x238b0d,null))['then'](respondWithResult(_0x238b0d,null))['catch'](handleError(_0x238b0d,null));};exports[_0x7e85('0x44')]=function(_0x2db263,_0x51985e){return db['ServicenowAccount'][_0x7e85('0x44')](_0x2db263[_0x7e85('0x45')],{})[_0x7e85('0x24')](respondWithResult(_0x51985e,0xc9))['catch'](handleError(_0x51985e,null));};exports[_0x7e85('0x23')]=function(_0x3eaa23,_0x52232c){if(_0x3eaa23['body']['id']){delete _0x3eaa23[_0x7e85('0x45')]['id'];}return db[_0x7e85('0x2c')][_0x7e85('0x43')]({'where':{'id':_0x3eaa23['params']['id']}})[_0x7e85('0x24')](handleEntityNotFound(_0x52232c,null))[_0x7e85('0x24')](saveUpdates(_0x3eaa23[_0x7e85('0x45')],null))[_0x7e85('0x24')](respondWithResult(_0x52232c,null))['catch'](handleError(_0x52232c,null));};exports[_0x7e85('0x25')]=function(_0x47f317,_0x44c9ea){return db[_0x7e85('0x2c')]['find']({'where':{'id':_0x47f317[_0x7e85('0x42')]['id']}})['then'](handleEntityNotFound(_0x44c9ea,null))[_0x7e85('0x24')](removeEntity(_0x44c9ea,null))[_0x7e85('0x41')](handleError(_0x44c9ea,null));};exports[_0x7e85('0x46')]=function(_0x465dd2,_0x2dfe50,_0x118f3d){var _0x11cdd0={};var _0x2e4b42={};var _0xc7fd8b;var _0x1088fe;return db[_0x7e85('0x2c')][_0x7e85('0x47')]({'where':{'id':_0x465dd2[_0x7e85('0x42')]['id']}})['then'](handleEntityNotFound(_0x2dfe50,null))[_0x7e85('0x24')](function(_0x4dc54e){if(_0x4dc54e){_0xc7fd8b=_0x4dc54e;_0x2e4b42[_0x7e85('0x31')]=_[_0x7e85('0x33')](db[_0x7e85('0x48')]['rawAttributes']);_0x2e4b42['query']=_['keys'](_0x465dd2['query']);_0x2e4b42[_0x7e85('0x34')]=_[_0x7e85('0x36')](_0x2e4b42[_0x7e85('0x31')],_0x2e4b42[_0x7e85('0x32')]);_0x11cdd0[_0x7e85('0x35')]=_[_0x7e85('0x36')](_0x2e4b42[_0x7e85('0x31')],qs[_0x7e85('0x37')](_0x465dd2[_0x7e85('0x32')]['fields']));_0x11cdd0[_0x7e85('0x35')]=_0x11cdd0['attributes'][_0x7e85('0x38')]?_0x11cdd0[_0x7e85('0x35')]:_0x2e4b42[_0x7e85('0x31')];_0x11cdd0[_0x7e85('0x3a')]=qs[_0x7e85('0x3b')](_0x465dd2[_0x7e85('0x32')][_0x7e85('0x3b')]);_0x11cdd0[_0x7e85('0x3c')]=qs[_0x7e85('0x34')](_[_0x7e85('0x49')](_0x465dd2[_0x7e85('0x32')],_0x2e4b42[_0x7e85('0x34')]));if(_0x465dd2[_0x7e85('0x32')][_0x7e85('0x4a')]){_0x11cdd0[_0x7e85('0x3c')]=_[_0x7e85('0x3d')](_0x11cdd0[_0x7e85('0x3c')],{'$or':_['map'](_0x11cdd0[_0x7e85('0x35')],function(_0x59b769){var _0x5c88c3={};_0x5c88c3[_0x59b769]={'$like':'%'+_0x465dd2[_0x7e85('0x32')][_0x7e85('0x4a')]+'%'};return _0x5c88c3;})});}_0x11cdd0=_[_0x7e85('0x3d')]({},_0x11cdd0,_0x465dd2['options']);return _0xc7fd8b[_0x7e85('0x46')](_0x11cdd0);}})['then'](function(_0x2d6774){if(_0x2d6774){_0x1088fe=_0x2d6774[_0x7e85('0x38')];if(!_0x465dd2['query'][_0x7e85('0x39')]('nolimit')){_0x11cdd0[_0x7e85('0x1d')]=qs['limit'](_0x465dd2[_0x7e85('0x32')][_0x7e85('0x1d')]);_0x11cdd0[_0x7e85('0x1c')]=qs[_0x7e85('0x1c')](_0x465dd2[_0x7e85('0x32')][_0x7e85('0x1c')]);}return _0xc7fd8b[_0x7e85('0x46')](_0x11cdd0);}})[_0x7e85('0x24')](function(_0x1c5141){if(_0x1c5141){return _0x1c5141?{'count':_0x1088fe,'rows':_0x1c5141}:null;}})[_0x7e85('0x24')](respondWithResult(_0x2dfe50,null))[_0x7e85('0x41')](handleError(_0x2dfe50,null));};exports['addConfiguration']=function(_0x1c232e,_0x539f9f,_0x28b8cc){if(_0x1c232e[_0x7e85('0x45')]['id']){delete _0x1c232e[_0x7e85('0x45')]['id'];}return db[_0x7e85('0x2c')]['findOne']({'where':{'id':_0x1c232e['params']['id']}})[_0x7e85('0x24')](handleEntityNotFound(_0x539f9f,null))[_0x7e85('0x24')](function(_0x150f4e){if(_0x150f4e){_0x1c232e[_0x7e85('0x45')][_0x7e85('0x4b')]=_0x150f4e['id'];_0x1c232e[_0x7e85('0x45')]['Subjects']=integrations[_0x7e85('0x4c')](_0x1c232e[_0x7e85('0x45')][_0x7e85('0x4d')],_0x1c232e[_0x7e85('0x45')]['type']);_0x1c232e[_0x7e85('0x45')][_0x7e85('0x4e')]=integrations[_0x7e85('0x4f')](_0x1c232e[_0x7e85('0x45')]['channel'],_0x1c232e['body']['type']);return db[_0x7e85('0x48')][_0x7e85('0x44')](_0x1c232e['body'],{'include':[{'model':db[_0x7e85('0x50')],'as':_0x7e85('0x51')},{'model':db[_0x7e85('0x50')],'as':_0x7e85('0x4e')}]});}return null;})['then'](respondWithResult(_0x539f9f,null))[_0x7e85('0x41')](handleError(_0x539f9f,null));};exports['getFields']=function(_0x560ff4,_0x4932ba,_0xb0fc7){var _0x4d7e84=[_0x7e85('0x52'),_0x7e85('0x53'),'knowledge','subcategory',_0x7e85('0x54'),_0x7e85('0x55'),'incident_state','severity','category'];var _0x5bc025=[_0x7e85('0x56'),_0x7e85('0x52'),'caused_by',_0x7e85('0x57'),_0x7e85('0x58'),_0x7e85('0x59'),_0x7e85('0x5a'),_0x7e85('0x53'),'approval_history','number',_0x7e85('0x5b'),_0x7e85('0x5c'),_0x7e85('0x5d'),_0x7e85('0x5e'),_0x7e85('0x5f'),_0x7e85('0x60'),_0x7e85('0x61'),'sys_created_by',_0x7e85('0x62'),_0x7e85('0x3a'),_0x7e85('0x63'),_0x7e85('0x64'),_0x7e85('0x65'),_0x7e85('0x66'),'impact','active','work_notes_list','business_service',_0x7e85('0x67'),'sys_domain_path',_0x7e85('0x68'),'time_worked',_0x7e85('0x69'),'opened_at',_0x7e85('0x6a'),_0x7e85('0x6b'),_0x7e85('0x6c'),_0x7e85('0x6d'),_0x7e85('0x6e'),'caller_id',_0x7e85('0x6f'),_0x7e85('0x70'),_0x7e85('0x71'),'short_description','close_code',_0x7e85('0x72'),_0x7e85('0x73'),_0x7e85('0x74'),'assignment_group',_0x7e85('0x75'),_0x7e85('0x76'),_0x7e85('0x77'),'calendar_duration','notify',_0x7e85('0x78'),_0x7e85('0x79'),_0x7e85('0x7a'),'follow_up','parent_incident',_0x7e85('0x7b'),_0x7e85('0x7c'),_0x7e85('0x7d'),_0x7e85('0x7e'),_0x7e85('0x7f'),'problem_id',_0x7e85('0x80'),_0x7e85('0x81'),_0x7e85('0x82'),'assigned_to',_0x7e85('0x83'),_0x7e85('0x84'),'sla_due',_0x7e85('0x85'),_0x7e85('0x86'),_0x7e85('0x87'),_0x7e85('0x88'),_0x7e85('0x89'),_0x7e85('0x8a'),_0x7e85('0x8b'),_0x7e85('0x8c'),_0x7e85('0x8d'),'location','category'];var _0x583bba='';var _0x5572d1='';var _0xa30b79=[];var _0x8888df='';var _0x3b7ae0='';var _0x5843c8=[];var _0x42b5e3='';var _0x1b499f='';var _0x4cb8f8={};var _0x26c5b3='';return db[_0x7e85('0x2c')][_0x7e85('0x47')]({'where':{'id':_0x560ff4['params']['id']},'attributes':['id',_0x7e85('0x8e'),_0x7e85('0x8f'),_0x7e85('0x90'),_0x7e85('0x91'),_0x7e85('0x92')]})[_0x7e85('0x24')](handleEntityNotFound(_0x4932ba,null))[_0x7e85('0x24')](function(_0x410304){if(_0x410304){_0x26c5b3=_0x410304['remoteUri'];var _0x224d16=_0x26c5b3[_0x7e85('0x93')](-0x1);if(_0x224d16==='/'){_0x26c5b3=_0x26c5b3[_0x7e85('0x94')](0x0,_0x26c5b3[_0x7e85('0x95')](_0x224d16));}_0x1b499f=util[_0x7e85('0x96')]('%s/api/now/doc/table/schema/',_0x26c5b3);_0x42b5e3=util[_0x7e85('0x96')]('%s/api/now/table/',_0x26c5b3);_0x4cb8f8={'user':_0x410304[_0x7e85('0x8e')],'pass':_0x410304[_0x7e85('0x8f')]};var _0x173615={'method':_0x7e85('0x97'),'uri':_0x1b499f+_0x7e85('0x98'),'auth':_0x4cb8f8,'json':!![]};return rp(_0x173615);}})[_0x7e85('0x24')](function(_0x5eba86){if(_0x5eba86['result'][_0x7e85('0x38')]>0x0){_0x583bba=_0x5eba86['result'];}console['log']('incident\x20table\x20objects',_0x583bba);_0x5843c8=[];_0x5572d1=Object[_0x7e85('0x99')]([],_0x583bba);_['remove'](_0x5572d1,function(_0x41dfb1){return!_0x4d7e84[_0x7e85('0x9a')](_0x41dfb1[_0x7e85('0x28')]);});_0x5572d1[_0x7e85('0x9b')](function(_0x3c4b84){var _0x31f89e=createFieldObject(_0x42b5e3,_0x4cb8f8,_0x3c4b84['internalType'],_0x3c4b84[_0x7e85('0x28')],_0x3c4b84[_0x7e85('0x9c')],![]);_0x5843c8['push'](_0x31f89e);});return Promise[_0x7e85('0x9d')](_0x5843c8);})['then'](function(_0x56eea7){_0xa30b79=_0x56eea7;_0x8888df=Object['assign']([],_0x583bba);console[_0x7e85('0x9e')](_0x7e85('0x9f'),_0x583bba);_[_0x7e85('0xa0')](_0x8888df,function(_0x13a880){return _0x5bc025[_0x7e85('0x9a')](_0x13a880['name']);});console[_0x7e85('0x9e')](_0x7e85('0xa1'),_0x8888df);_0x5843c8=[];_0x8888df['forEach'](function(_0x3375c4){var _0x1d53d1=createFieldObject(_0x42b5e3,_0x4cb8f8,_0x3375c4[_0x7e85('0xa2')],_0x3375c4[_0x7e85('0x28')],_0x3375c4['label'],!![]);_0x5843c8['push'](_0x1d53d1);});return Promise[_0x7e85('0x9d')](_0x5843c8);})[_0x7e85('0x24')](function(_0x34852c){_0x3b7ae0=_0x34852c;var _0x2ece2f=_0xa30b79['concat'](_0x3b7ae0);return{'count':_0x2ece2f[_0x7e85('0x38')],'rows':_0x2ece2f};})['then'](respondWithResult(_0x4932ba,null))[_0x7e85('0x41')](function(_0x3aaa1c){console[_0x7e85('0x9e')](_0x7e85('0xa3')+_0x3aaa1c);var _0x139579=_0x560ff4['query'][_0x7e85('0xa4')]?0x1f4:_0x3aaa1c[_0x7e85('0xa5')]||0x1f4;logger[_0x7e85('0x26')](_0x3aaa1c[_0x7e85('0x27')]);delete _0x3aaa1c[_0x7e85('0x28')];if(_0x139579===0x191){_0x139579=0x190;}_0x4932ba[_0x7e85('0x1a')](_0x139579)['send'](_0x560ff4['query'][_0x7e85('0xa4')]?{'message':_0x7e85('0xa6'),'statusCode':_0x3aaa1c['statusCode']}:_0x3aaa1c);});};function createFieldObject(_0x31b4e7,_0x58ddba,_0x577458,_0x23299b,_0x5d53a1,_0x170ae2){return new Promise(function(_0x295fa2,_0x383a95){var _0x49f7fe={'id':_0x23299b,'name':_0x5d53a1,'custom':_0x170ae2};if(_0x577458===_0x7e85('0xa7')){_0x49f7fe['options']=[{'name':'True','value':_0x7e85('0xa8')},{'name':'False','value':_0x7e85('0xa9')}];_0x295fa2(_0x49f7fe);}else{var _0x3faaa8={'method':_0x7e85('0x97'),'uri':_0x31b4e7+_0x7e85('0xaa')+_0x23299b,'auth':_0x58ddba,'json':!![]};return rp(_0x3faaa8)[_0x7e85('0x24')](function(_0x1f881e){var _0x4e1625=[];if(_0x1f881e['result'][_0x7e85('0x38')]>0x0){_0x1f881e[_0x7e85('0xab')][_0x7e85('0x9b')](function(_0x5d3b25){if(_0x5d3b25[_0x7e85('0xac')]===_0x7e85('0xa9')){var _0x1094fc={'name':_0x5d3b25[_0x7e85('0x9c')],'value':_0x5d3b25[_0x7e85('0xad')]};_0x4e1625[_0x7e85('0xae')](_0x1094fc);}});}_0x49f7fe[_0x7e85('0xaf')]=_0x4e1625;if(_0x49f7fe[_0x7e85('0xaf')][_0x7e85('0x38')]>0x0){_0x295fa2(_0x49f7fe);}else{if(_0x170ae2==![]){_0x295fa2();}else{_0x295fa2(_0x49f7fe);}}});}});}
\ No newline at end of file
+var _0x9dd3=['business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','approval_set','work_notes','short_description','correlation_display','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','company','activity_due','sla_due','approval','comments_and_work_notes','due_date','reopen_count','escalation','upon_approval','correlation_id','location','username','password','remoteUri','serverUrl','slice','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','internalType','label','push','all','TCL:\x20_object','forEach','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','boolean','True','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','count','limit','Content-Range','reject','update','then','status','error','stack','name','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','destroy','getConfigurations','ServicenowConfiguration','sort','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','close_code','notify','severity','category','parent','caused_by','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','impact','work_notes_list'];(function(_0x4b8b81,_0x34f111){var _0xed7d61=function(_0x6363fb){while(--_0x6363fb){_0x4b8b81['push'](_0x4b8b81['shift']());}};_0xed7d61(++_0x34f111);}(_0x9dd3,0x1b4));var _0x39dd=function(_0x420868,_0x537b46){_0x420868=_0x420868-0x0;var _0x1be646=_0x9dd3[_0x420868];return _0x1be646;};'use strict';var emlformat=require(_0x39dd('0x0'));var rimraf=require(_0x39dd('0x1'));var zipdir=require(_0x39dd('0x2'));var jsonpatch=require(_0x39dd('0x3'));var rp=require(_0x39dd('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x39dd('0x5'));var util=require(_0x39dd('0x6'));var path=require(_0x39dd('0x7'));var sox=require(_0x39dd('0x8'));var csv=require(_0x39dd('0x9'));var ejs=require(_0x39dd('0xa'));var fs=require('fs');var fs_extra=require(_0x39dd('0xb'));var _=require(_0x39dd('0xc'));var squel=require(_0x39dd('0xd'));var crypto=require(_0x39dd('0xe'));var jsforce=require(_0x39dd('0xf'));var deskjs=require(_0x39dd('0x10'));var toCsv=require(_0x39dd('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x39dd('0x11'));var authService=require(_0x39dd('0x12'));var qs=require(_0x39dd('0x13'));var as=require(_0x39dd('0x14'));var hardwareService=require(_0x39dd('0x15'));var logger=require(_0x39dd('0x16'))(_0x39dd('0x17'));var utils=require(_0x39dd('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x39dd('0x19'));var db=require(_0x39dd('0x1a'))['db'];var integrations=require(_0x39dd('0x1b'));function respondWithStatusCode(_0x3d2043,_0x4cb6bb){_0x4cb6bb=_0x4cb6bb||0xcc;return function(_0x48df09){if(_0x48df09){return _0x3d2043[_0x39dd('0x1c')](_0x4cb6bb);}return _0x3d2043['status'](_0x4cb6bb)[_0x39dd('0x1d')]();};}function respondWithResult(_0x8ed5c9,_0x2e3acd){_0x2e3acd=_0x2e3acd||0xc8;return function(_0xcd3ab6){if(_0xcd3ab6){return _0x8ed5c9['status'](_0x2e3acd)[_0x39dd('0x1e')](_0xcd3ab6);}};}function respondWithFilteredResult(_0x3c998e,_0x46f775){return function(_0x165941){if(_0x165941){var _0x19e1a3=typeof _0x46f775[_0x39dd('0x1f')]===_0x39dd('0x20')&&typeof _0x46f775['limit']===_0x39dd('0x20');var _0x31c660=_0x165941[_0x39dd('0x21')];var _0x12b2cd=_0x19e1a3?0x0:_0x46f775[_0x39dd('0x1f')];var _0x4ad31a=_0x19e1a3?_0x165941['count']:_0x46f775[_0x39dd('0x1f')]+_0x46f775[_0x39dd('0x22')];var _0x3448ee;if(_0x4ad31a>=_0x31c660){_0x4ad31a=_0x31c660;_0x3448ee=0xc8;}else{_0x3448ee=0xce;}_0x3c998e['status'](_0x3448ee);return _0x3c998e['set'](_0x39dd('0x23'),_0x12b2cd+'-'+_0x4ad31a+'/'+_0x31c660)['json'](_0x165941);}return null;};}function patchUpdates(_0x5a00c1){return function(_0x4a5ada){try{jsonpatch['apply'](_0x4a5ada,_0x5a00c1,!![]);}catch(_0x288368){return BPromise[_0x39dd('0x24')](_0x288368);}return _0x4a5ada['save']();};}function saveUpdates(_0x470c61,_0x43a487){return function(_0x5631cf){if(_0x5631cf){return _0x5631cf[_0x39dd('0x25')](_0x470c61)[_0x39dd('0x26')](function(_0x202cd3){return _0x202cd3;});}return null;};}function removeEntity(_0x3e9951,_0x353f5b){return function(_0x3596fe){if(_0x3596fe){return _0x3596fe['destroy']()[_0x39dd('0x26')](function(){_0x3e9951[_0x39dd('0x27')](0xcc)[_0x39dd('0x1d')]();});}};}function handleEntityNotFound(_0x7404f8,_0x5b6001){return function(_0x33b54f){if(!_0x33b54f){_0x7404f8[_0x39dd('0x1c')](0x194);}return _0x33b54f;};}function handleError(_0x1a0812,_0x378baa){_0x378baa=_0x378baa||0x1f4;return function(_0x567740){logger[_0x39dd('0x28')](_0x567740[_0x39dd('0x29')]);if(_0x567740[_0x39dd('0x2a')]){delete _0x567740['name'];}_0x1a0812[_0x39dd('0x27')](_0x378baa)['send'](_0x567740);};}exports[_0x39dd('0x2b')]=function(_0x48be11,_0x261667){var _0x292ca2={},_0x1d9e4a={},_0x32490e={'count':0x0,'rows':[]};var _0x4df418=_[_0x39dd('0x2c')](db[_0x39dd('0x2d')][_0x39dd('0x2e')],function(_0x573179){return{'name':_0x573179[_0x39dd('0x2f')],'type':_0x573179[_0x39dd('0x30')][_0x39dd('0x31')]};});_0x1d9e4a['model']=_[_0x39dd('0x2c')](_0x4df418,'name');_0x1d9e4a[_0x39dd('0x32')]=_['keys'](_0x48be11[_0x39dd('0x32')]);_0x1d9e4a[_0x39dd('0x33')]=_[_0x39dd('0x34')](_0x1d9e4a[_0x39dd('0x35')],_0x1d9e4a[_0x39dd('0x32')]);_0x292ca2[_0x39dd('0x36')]=_[_0x39dd('0x34')](_0x1d9e4a[_0x39dd('0x35')],qs['fields'](_0x48be11['query'][_0x39dd('0x37')]));_0x292ca2[_0x39dd('0x36')]=_0x292ca2[_0x39dd('0x36')][_0x39dd('0x38')]?_0x292ca2['attributes']:_0x1d9e4a['model'];if(!_0x48be11[_0x39dd('0x32')]['hasOwnProperty'](_0x39dd('0x39'))){_0x292ca2[_0x39dd('0x22')]=qs[_0x39dd('0x22')](_0x48be11[_0x39dd('0x32')]['limit']);_0x292ca2['offset']=qs[_0x39dd('0x1f')](_0x48be11[_0x39dd('0x32')][_0x39dd('0x1f')]);}_0x292ca2[_0x39dd('0x3a')]=qs['sort'](_0x48be11[_0x39dd('0x32')]['sort']);_0x292ca2['where']=qs[_0x39dd('0x33')](_[_0x39dd('0x3b')](_0x48be11[_0x39dd('0x32')],_0x1d9e4a[_0x39dd('0x33')]),_0x4df418);if(_0x48be11[_0x39dd('0x32')][_0x39dd('0x3c')]){_0x292ca2[_0x39dd('0x3d')]=_[_0x39dd('0x3e')](_0x292ca2[_0x39dd('0x3d')],{'$or':_[_0x39dd('0x2c')](_0x4df418,function(_0x2422a9){if(_0x2422a9[_0x39dd('0x30')]!==_0x39dd('0x3f')){var _0x425c8f={};_0x425c8f[_0x2422a9['name']]={'$like':'%'+_0x48be11[_0x39dd('0x32')][_0x39dd('0x3c')]+'%'};return _0x425c8f;}})});}_0x292ca2=_[_0x39dd('0x3e')]({},_0x292ca2,_0x48be11[_0x39dd('0x40')]);var _0x5dae40={'where':_0x292ca2['where']};return db[_0x39dd('0x2d')]['count'](_0x5dae40)['then'](function(_0x4052ff){_0x32490e[_0x39dd('0x21')]=_0x4052ff;if(_0x48be11[_0x39dd('0x32')][_0x39dd('0x41')]){_0x292ca2[_0x39dd('0x42')]=[{'all':!![]}];}return db[_0x39dd('0x2d')][_0x39dd('0x43')](_0x292ca2);})[_0x39dd('0x26')](function(_0x1aafa1){_0x32490e[_0x39dd('0x44')]=_0x1aafa1;return _0x32490e;})[_0x39dd('0x26')](respondWithFilteredResult(_0x261667,_0x292ca2))[_0x39dd('0x45')](handleError(_0x261667,null));};exports['show']=function(_0x1e134a,_0x1c2996){var _0x58bc0b={'raw':![],'where':{'id':_0x1e134a[_0x39dd('0x46')]['id']}},_0xf66879={};_0xf66879[_0x39dd('0x35')]=_[_0x39dd('0x47')](db[_0x39dd('0x2d')][_0x39dd('0x2e')]);_0xf66879[_0x39dd('0x32')]=_[_0x39dd('0x47')](_0x1e134a[_0x39dd('0x32')]);_0xf66879['filters']=_['intersection'](_0xf66879[_0x39dd('0x35')],_0xf66879[_0x39dd('0x32')]);_0x58bc0b[_0x39dd('0x36')]=_[_0x39dd('0x34')](_0xf66879[_0x39dd('0x35')],qs['fields'](_0x1e134a['query'][_0x39dd('0x37')]));_0x58bc0b[_0x39dd('0x36')]=_0x58bc0b[_0x39dd('0x36')]['length']?_0x58bc0b[_0x39dd('0x36')]:_0xf66879[_0x39dd('0x35')];if(_0x1e134a[_0x39dd('0x32')][_0x39dd('0x41')]){_0x58bc0b[_0x39dd('0x42')]=[{'all':!![]}];}_0x58bc0b=_['merge']({},_0x58bc0b,_0x1e134a[_0x39dd('0x40')]);return db[_0x39dd('0x2d')]['find'](_0x58bc0b)[_0x39dd('0x26')](handleEntityNotFound(_0x1c2996,null))[_0x39dd('0x26')](respondWithResult(_0x1c2996,null))[_0x39dd('0x45')](handleError(_0x1c2996,null));};exports[_0x39dd('0x48')]=function(_0x4967d3,_0xd81144){return db[_0x39dd('0x2d')][_0x39dd('0x48')](_0x4967d3['body'],{})['then'](respondWithResult(_0xd81144,0xc9))['catch'](handleError(_0xd81144,null));};exports[_0x39dd('0x25')]=function(_0x27af82,_0x4793ef){if(_0x27af82[_0x39dd('0x49')]['id']){delete _0x27af82[_0x39dd('0x49')]['id'];}return db['ServicenowAccount'][_0x39dd('0x4a')]({'where':{'id':_0x27af82[_0x39dd('0x46')]['id']}})['then'](handleEntityNotFound(_0x4793ef,null))['then'](saveUpdates(_0x27af82[_0x39dd('0x49')],null))[_0x39dd('0x26')](respondWithResult(_0x4793ef,null))[_0x39dd('0x45')](handleError(_0x4793ef,null));};exports[_0x39dd('0x4b')]=function(_0x1a35f1,_0x5885d1){return db[_0x39dd('0x2d')][_0x39dd('0x4a')]({'where':{'id':_0x1a35f1['params']['id']}})[_0x39dd('0x26')](handleEntityNotFound(_0x5885d1,null))[_0x39dd('0x26')](removeEntity(_0x5885d1,null))[_0x39dd('0x45')](handleError(_0x5885d1,null));};exports[_0x39dd('0x4c')]=function(_0x4a8034,_0x51cf16,_0x470c22){var _0x53116f={};var _0x5da0e2={};var _0x13eca6;var _0x103636;return db[_0x39dd('0x2d')]['findOne']({'where':{'id':_0x4a8034['params']['id']}})['then'](handleEntityNotFound(_0x51cf16,null))[_0x39dd('0x26')](function(_0x56d3b3){if(_0x56d3b3){_0x13eca6=_0x56d3b3;_0x5da0e2[_0x39dd('0x35')]=_[_0x39dd('0x47')](db[_0x39dd('0x4d')][_0x39dd('0x2e')]);_0x5da0e2[_0x39dd('0x32')]=_[_0x39dd('0x47')](_0x4a8034[_0x39dd('0x32')]);_0x5da0e2['filters']=_[_0x39dd('0x34')](_0x5da0e2['model'],_0x5da0e2[_0x39dd('0x32')]);_0x53116f[_0x39dd('0x36')]=_['intersection'](_0x5da0e2['model'],qs[_0x39dd('0x37')](_0x4a8034[_0x39dd('0x32')][_0x39dd('0x37')]));_0x53116f[_0x39dd('0x36')]=_0x53116f[_0x39dd('0x36')][_0x39dd('0x38')]?_0x53116f[_0x39dd('0x36')]:_0x5da0e2[_0x39dd('0x35')];_0x53116f[_0x39dd('0x3a')]=qs['sort'](_0x4a8034[_0x39dd('0x32')][_0x39dd('0x4e')]);_0x53116f[_0x39dd('0x3d')]=qs[_0x39dd('0x33')](_['pick'](_0x4a8034['query'],_0x5da0e2['filters']));if(_0x4a8034[_0x39dd('0x32')][_0x39dd('0x3c')]){_0x53116f[_0x39dd('0x3d')]=_[_0x39dd('0x3e')](_0x53116f[_0x39dd('0x3d')],{'$or':_[_0x39dd('0x2c')](_0x53116f[_0x39dd('0x36')],function(_0x324b27){var _0x5e26d6={};_0x5e26d6[_0x324b27]={'$like':'%'+_0x4a8034[_0x39dd('0x32')][_0x39dd('0x3c')]+'%'};return _0x5e26d6;})});}_0x53116f=_[_0x39dd('0x3e')]({},_0x53116f,_0x4a8034[_0x39dd('0x40')]);return _0x13eca6[_0x39dd('0x4c')](_0x53116f);}})[_0x39dd('0x26')](function(_0x959e){if(_0x959e){_0x103636=_0x959e[_0x39dd('0x38')];if(!_0x4a8034['query']['hasOwnProperty'](_0x39dd('0x39'))){_0x53116f[_0x39dd('0x22')]=qs[_0x39dd('0x22')](_0x4a8034[_0x39dd('0x32')][_0x39dd('0x22')]);_0x53116f[_0x39dd('0x1f')]=qs[_0x39dd('0x1f')](_0x4a8034[_0x39dd('0x32')][_0x39dd('0x1f')]);}return _0x13eca6['getConfigurations'](_0x53116f);}})[_0x39dd('0x26')](function(_0x496522){if(_0x496522){return _0x496522?{'count':_0x103636,'rows':_0x496522}:null;}})['then'](respondWithResult(_0x51cf16,null))[_0x39dd('0x45')](handleError(_0x51cf16,null));};exports[_0x39dd('0x4f')]=function(_0x572919,_0x29062f,_0x57ec4a){if(_0x572919['body']['id']){delete _0x572919[_0x39dd('0x49')]['id'];}return db['ServicenowAccount'][_0x39dd('0x50')]({'where':{'id':_0x572919[_0x39dd('0x46')]['id']}})[_0x39dd('0x26')](handleEntityNotFound(_0x29062f,null))[_0x39dd('0x26')](function(_0xd72601){if(_0xd72601){_0x572919[_0x39dd('0x49')][_0x39dd('0x51')]=_0xd72601['id'];_0x572919[_0x39dd('0x49')][_0x39dd('0x52')]=integrations[_0x39dd('0x53')](_0x572919[_0x39dd('0x49')]['channel'],_0x572919[_0x39dd('0x49')]['type']);_0x572919[_0x39dd('0x49')][_0x39dd('0x54')]=integrations[_0x39dd('0x55')](_0x572919[_0x39dd('0x49')][_0x39dd('0x56')],_0x572919[_0x39dd('0x49')][_0x39dd('0x30')]);return db['ServicenowConfiguration'][_0x39dd('0x48')](_0x572919[_0x39dd('0x49')],{'include':[{'model':db['ServicenowField'],'as':_0x39dd('0x52')},{'model':db[_0x39dd('0x57')],'as':'Descriptions'}]});}return null;})[_0x39dd('0x26')](respondWithResult(_0x29062f,null))[_0x39dd('0x45')](handleError(_0x29062f,null));};exports[_0x39dd('0x58')]=function(_0x4a090d,_0x586439,_0x5d724f){var _0x11afd6=[_0x39dd('0x59'),_0x39dd('0x5a'),_0x39dd('0x5b'),'subcategory',_0x39dd('0x5c'),_0x39dd('0x5d'),'incident_state',_0x39dd('0x5e'),_0x39dd('0x5f')];var _0x444843=[_0x39dd('0x60'),'made_sla',_0x39dd('0x61'),'watch_list','upon_reject',_0x39dd('0x62'),_0x39dd('0x63'),_0x39dd('0x5a'),_0x39dd('0x64'),_0x39dd('0x65'),'resolved_by',_0x39dd('0x66'),'opened_by','user_input','sys_created_on',_0x39dd('0x67'),_0x39dd('0x68'),_0x39dd('0x69'),_0x39dd('0x5b'),_0x39dd('0x3a'),_0x39dd('0x6a'),'closed_at',_0x39dd('0x6b'),'delivery_plan',_0x39dd('0x6c'),'active',_0x39dd('0x6d'),_0x39dd('0x6e'),_0x39dd('0x6f'),_0x39dd('0x70'),_0x39dd('0x71'),_0x39dd('0x72'),_0x39dd('0x73'),_0x39dd('0x74'),_0x39dd('0x75'),_0x39dd('0x76'),_0x39dd('0x77'),'reopened_time',_0x39dd('0x78'),'caller_id',_0x39dd('0x79'),'subcategory',_0x39dd('0x7a'),_0x39dd('0x7b'),_0x39dd('0x5c'),_0x39dd('0x7c'),'delivery_task','work_start',_0x39dd('0x7d'),_0x39dd('0x7e'),_0x39dd('0x7f'),'description',_0x39dd('0x80'),_0x39dd('0x5d'),_0x39dd('0x81'),_0x39dd('0x82'),_0x39dd('0x83'),_0x39dd('0x84'),_0x39dd('0x85'),_0x39dd('0x86'),'contact_type',_0x39dd('0x87'),'incident_state',_0x39dd('0x88'),_0x39dd('0x89'),_0x39dd('0x8a'),'reassignment_count',_0x39dd('0x8b'),'assigned_to',_0x39dd('0x5e'),'comments',_0x39dd('0x8c'),_0x39dd('0x8d'),_0x39dd('0x8e'),_0x39dd('0x8f'),'sys_mod_count',_0x39dd('0x90'),'sys_tags',_0x39dd('0x91'),_0x39dd('0x92'),_0x39dd('0x93'),_0x39dd('0x94'),_0x39dd('0x5f')];var _0x3dc46d='';var _0x5d4189='';var _0x57d2b3=[];var _0x2de38f='';var _0x27692e='';var _0x11da26=[];var _0x277a47='';var _0x4a9703='';var _0x1f232f={};var _0x39eade='';return db[_0x39dd('0x2d')]['findOne']({'where':{'id':_0x4a090d['params']['id']},'attributes':['id',_0x39dd('0x95'),_0x39dd('0x96'),'email',_0x39dd('0x97'),_0x39dd('0x98')]})['then'](handleEntityNotFound(_0x586439,null))['then'](function(_0x2cbcee){if(_0x2cbcee){_0x39eade=_0x2cbcee[_0x39dd('0x97')];var _0x3679e1=_0x39eade[_0x39dd('0x99')](-0x1);if(_0x3679e1==='/'){_0x39eade=_0x39eade['substring'](0x0,_0x39eade[_0x39dd('0x9a')](_0x3679e1));}_0x4a9703=util['format'](_0x39dd('0x9b'),_0x39eade);_0x277a47=util[_0x39dd('0x9c')](_0x39dd('0x9d'),_0x39eade);_0x1f232f={'user':_0x2cbcee[_0x39dd('0x95')],'pass':_0x2cbcee[_0x39dd('0x96')]};var _0x31ca34={'method':_0x39dd('0x9e'),'uri':_0x4a9703+_0x39dd('0x9f'),'auth':_0x1f232f,'json':!![]};return rp(_0x31ca34);}})[_0x39dd('0x26')](function(_0x4608f7){if(_0x4608f7[_0x39dd('0xa0')][_0x39dd('0x38')]>0x0){_0x3dc46d=_0x4608f7[_0x39dd('0xa0')];}console[_0x39dd('0xa1')](_0x39dd('0xa2'),_0x3dc46d);_0x11da26=[];_0x5d4189=Object[_0x39dd('0xa3')]([],_0x3dc46d);_[_0x39dd('0xa4')](_0x5d4189,function(_0x4eeff1){return!_0x11afd6[_0x39dd('0xa5')](_0x4eeff1[_0x39dd('0x2a')]);});_0x5d4189['forEach'](function(_0x5e51f0){var _0x364242=createFieldObject(_0x277a47,_0x1f232f,_0x5e51f0[_0x39dd('0xa6')],_0x5e51f0[_0x39dd('0x2a')],_0x5e51f0[_0x39dd('0xa7')],![]);_0x11da26[_0x39dd('0xa8')](_0x364242);});return Promise[_0x39dd('0xa9')](_0x11da26);})[_0x39dd('0x26')](function(_0x396bab){_0x57d2b3=_0x396bab;_0x2de38f=Object[_0x39dd('0xa3')]([],_0x3dc46d);console['log'](_0x39dd('0xaa'),_0x3dc46d);_[_0x39dd('0xa4')](_0x2de38f,function(_0x3bf5ff){return _0x444843['includes'](_0x3bf5ff['name']);});console[_0x39dd('0xa1')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x2de38f);_0x11da26=[];_0x2de38f[_0x39dd('0xab')](function(_0x3d9f13){var _0x484864=createFieldObject(_0x277a47,_0x1f232f,_0x3d9f13[_0x39dd('0xa6')],_0x3d9f13['name'],_0x3d9f13[_0x39dd('0xa7')],!![]);_0x11da26[_0x39dd('0xa8')](_0x484864);});return Promise[_0x39dd('0xa9')](_0x11da26);})[_0x39dd('0x26')](function(_0x518b23){_0x27692e=_0x518b23;var _0x5327c9=_0x57d2b3['concat'](_0x27692e);return{'count':_0x5327c9['length'],'rows':_0x5327c9};})[_0x39dd('0x26')](respondWithResult(_0x586439,null))[_0x39dd('0x45')](function(_0x382f7e){console[_0x39dd('0xa1')](_0x39dd('0xac')+_0x382f7e);var _0x5be9e4=_0x4a090d[_0x39dd('0x32')][_0x39dd('0xad')]?0x1f4:_0x382f7e['statusCode']||0x1f4;logger[_0x39dd('0x28')](_0x382f7e[_0x39dd('0x29')]);delete _0x382f7e[_0x39dd('0x2a')];if(_0x5be9e4===0x191){_0x5be9e4=0x190;}_0x586439['status'](_0x5be9e4)['send'](_0x4a090d['query']['test']?{'message':_0x39dd('0xae'),'statusCode':_0x382f7e[_0x39dd('0xaf')]}:_0x382f7e);});};function createFieldObject(_0x39098c,_0x22811d,_0x5d91c9,_0x3e42e7,_0xf814f3,_0x583d22){return new Promise(function(_0x30c358,_0x15e8f1){var _0x2957fc={'id':_0x3e42e7,'name':_0xf814f3,'custom':_0x583d22};if(_0x5d91c9===_0x39dd('0xb0')){_0x2957fc[_0x39dd('0x40')]=[{'name':_0x39dd('0xb1'),'value':'true'},{'name':'False','value':'false'}];_0x30c358(_0x2957fc);}else{var _0x151b73={'method':'GET','uri':_0x39098c+_0x39dd('0xb2')+_0x3e42e7,'auth':_0x22811d,'json':!![]};return rp(_0x151b73)[_0x39dd('0x26')](function(_0x336a4d){var _0x1df0d4=[];if(_0x336a4d[_0x39dd('0xa0')][_0x39dd('0x38')]>0x0){_0x336a4d['result'][_0x39dd('0xab')](function(_0x2d240e){if(_0x2d240e[_0x39dd('0xb3')]===_0x39dd('0xb4')){var _0xe80564={'name':_0x2d240e['label'],'value':_0x2d240e[_0x39dd('0xb5')]};_0x1df0d4[_0x39dd('0xa8')](_0xe80564);}});}_0x2957fc[_0x39dd('0x40')]=_0x1df0d4;if(_0x2957fc['options'][_0x39dd('0x38')]>0x0){_0x30c358(_0x2957fc);}else{if(_0x583d22==![]){_0x30c358();}else{_0x30c358(_0x2957fc);}}});}});}
\ No newline at end of file
index c9d1401..959c91d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['bluebird','path','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','moment'];(function(_0x2bde6d,_0x1bdee6){var _0x334fcc=function(_0x193ebf){while(--_0x193ebf){_0x2bde6d['push'](_0x2bde6d['shift']());}};_0x334fcc(++_0x1bdee6);}(_0xe14b,0x93));var _0xbe14=function(_0x58850e,_0x57ebc3){_0x58850e=_0x58850e-0x0;var _0x47ffbf=_0xe14b[_0x58850e];return _0x47ffbf;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));var integrations=require(_0xbe14('0x6'));module[_0xbe14('0x7')]=function(_0x1ff100,_0x1d9ade){return _0x1ff100[_0xbe14('0x8')](_0xbe14('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb138=['int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','ServicenowAccount'];(function(_0x1d4c12,_0x5a7a1c){var _0x5aabb8=function(_0x30e090){while(--_0x30e090){_0x1d4c12['push'](_0x1d4c12['shift']());}};_0x5aabb8(++_0x5a7a1c);}(_0xb138,0x1dd));var _0x8b13=function(_0x54c984,_0x5052e3){_0x54c984=_0x54c984-0x0;var _0x4c8d1c=_0xb138[_0x54c984];return _0x4c8d1c;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x8b13('0xa')]=function(_0x13f7bd,_0x5d51b1){return _0x13f7bd[_0x8b13('0xb')](_0x8b13('0xc'),attributes,{'tableName':_0x8b13('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 26d8bc8..d2181b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa126=['../../config/logger','rpc','../../config/environment','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ServicenowAccount','findAll','options','raw','where','attributes','include','map','model','GetServicenowAccount','find','ShowServicenowAccount','debug','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x38854e,_0x23cbc9){var _0x3f8415=function(_0x4e493e){while(--_0x4e493e){_0x38854e['push'](_0x38854e['shift']());}};_0x3f8415(++_0x23cbc9);}(_0xa126,0x186));var _0x6a12=function(_0x2bbfda,_0x5ecf6f){_0x2bbfda=_0x2bbfda-0x0;var _0x131bd4=_0xa126[_0x2bbfda];return _0x131bd4;};'use strict';var _=require(_0x6a12('0x0'));var util=require(_0x6a12('0x1'));var moment=require(_0x6a12('0x2'));var BPromise=require(_0x6a12('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a12('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6a12('0x5'));var logger=require(_0x6a12('0x6'))(_0x6a12('0x7'));var config=require(_0x6a12('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6a12('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a3f31,_0x1bcfd8,_0x4dc6f0){return new BPromise(function(_0x4c7dcd,_0x15e819){return client[_0x6a12('0xa')](_0x5a3f31,_0x4dc6f0)[_0x6a12('0xb')](function(_0x54d10b){logger[_0x6a12('0xc')](_0x6a12('0xd'),_0x1bcfd8,'request\x20sent');logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x1bcfd8,_0x6a12('0xe'),JSON[_0x6a12('0xf')](_0x54d10b));if(_0x54d10b[_0x6a12('0x10')]){if(_0x54d10b[_0x6a12('0x10')]['code']===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x1bcfd8,_0x54d10b[_0x6a12('0x10')][_0x6a12('0x11')]);return _0x15e819(_0x54d10b[_0x6a12('0x10')][_0x6a12('0x11')]);}logger[_0x6a12('0x10')](_0x6a12('0xd'),_0x1bcfd8,_0x54d10b[_0x6a12('0x10')][_0x6a12('0x11')]);return _0x4c7dcd(_0x54d10b['error'][_0x6a12('0x11')]);}else{logger[_0x6a12('0xc')](_0x6a12('0xd'),_0x1bcfd8,_0x6a12('0xe'));_0x4c7dcd(_0x54d10b[_0x6a12('0x12')][_0x6a12('0x11')]);}})[_0x6a12('0x13')](function(_0x4cc8ba){logger[_0x6a12('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x1bcfd8,_0x4cc8ba);_0x15e819(_0x4cc8ba);});});}exports['GetServicenowAccount']=function(_0x52d0a3){var _0x13e193=this;return new Promise(function(_0x19f37e,_0xc12a1d){return db[_0x6a12('0x14')][_0x6a12('0x15')]({'raw':_0x52d0a3[_0x6a12('0x16')]?_0x52d0a3[_0x6a12('0x16')][_0x6a12('0x17')]===undefined?!![]:![]:!![],'where':_0x52d0a3[_0x6a12('0x16')]?_0x52d0a3['options'][_0x6a12('0x18')]||null:null,'attributes':_0x52d0a3[_0x6a12('0x16')]?_0x52d0a3[_0x6a12('0x16')][_0x6a12('0x19')]||null:null,'limit':_0x52d0a3[_0x6a12('0x16')]?_0x52d0a3[_0x6a12('0x16')]['limit']||null:null,'include':_0x52d0a3[_0x6a12('0x16')]?_0x52d0a3[_0x6a12('0x16')][_0x6a12('0x1a')]?_[_0x6a12('0x1b')](_0x52d0a3[_0x6a12('0x16')]['include'],function(_0x38b692){return{'model':db[_0x38b692[_0x6a12('0x1c')]],'as':_0x38b692['as'],'attributes':_0x38b692['attributes'],'include':_0x38b692['include']?_[_0x6a12('0x1b')](_0x38b692[_0x6a12('0x1a')],function(_0x297954){return{'model':db[_0x297954[_0x6a12('0x1c')]],'as':_0x297954['as'],'attributes':_0x297954[_0x6a12('0x19')],'include':_0x297954[_0x6a12('0x1a')]?_['map'](_0x297954[_0x6a12('0x1a')],function(_0x44b8d3){return{'model':db[_0x44b8d3['model']],'as':_0x44b8d3['as'],'attributes':_0x44b8d3[_0x6a12('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6a12('0xb')](function(_0x2f8650){logger[_0x6a12('0xc')](_0x6a12('0x1d'),_0x52d0a3);logger['debug'](_0x6a12('0x1d'),_0x52d0a3,JSON[_0x6a12('0xf')](_0x2f8650));_0x19f37e(_0x2f8650);})[_0x6a12('0x13')](function(_0x33b344){logger[_0x6a12('0x10')](_0x6a12('0x1d'),_0x33b344[_0x6a12('0x11')],_0x52d0a3);_0xc12a1d(_0x13e193[_0x6a12('0x10')](0x1f4,_0x33b344[_0x6a12('0x11')]));});});};exports['ShowServicenowAccount']=function(_0x285af7){var _0x4d8acf=this;return new Promise(function(_0x1be4a4,_0x5d7979){return db[_0x6a12('0x14')][_0x6a12('0x1e')]({'raw':_0x285af7['options']?_0x285af7[_0x6a12('0x16')][_0x6a12('0x17')]===undefined?!![]:![]:!![],'where':_0x285af7[_0x6a12('0x16')]?_0x285af7[_0x6a12('0x16')]['where']||null:null,'attributes':_0x285af7[_0x6a12('0x16')]?_0x285af7[_0x6a12('0x16')][_0x6a12('0x19')]||null:null,'include':_0x285af7[_0x6a12('0x16')]?_0x285af7['options'][_0x6a12('0x1a')]?_['map'](_0x285af7['options']['include'],function(_0x52bab){return{'model':db[_0x52bab[_0x6a12('0x1c')]],'as':_0x52bab['as'],'attributes':_0x52bab[_0x6a12('0x19')],'include':_0x52bab['include']?_['map'](_0x52bab[_0x6a12('0x1a')],function(_0x340247){return{'model':db[_0x340247['model']],'as':_0x340247['as'],'attributes':_0x340247[_0x6a12('0x19')],'include':_0x340247[_0x6a12('0x1a')]?_[_0x6a12('0x1b')](_0x340247['include'],function(_0x2dc218){return{'model':db[_0x2dc218[_0x6a12('0x1c')]],'as':_0x2dc218['as'],'attributes':_0x2dc218['attributes']};}):[]};}):[]};}):[]:[]})[_0x6a12('0xb')](function(_0x1d3c1d){logger[_0x6a12('0xc')](_0x6a12('0x1f'),_0x285af7);logger[_0x6a12('0x20')]('ShowServicenowAccount',_0x285af7,JSON['stringify'](_0x1d3c1d));_0x1be4a4(_0x1d3c1d);})[_0x6a12('0x13')](function(_0x423b4c){logger[_0x6a12('0x10')](_0x6a12('0x1f'),_0x423b4c[_0x6a12('0x11')],_0x285af7);_0x5d7979(_0x4d8acf[_0x6a12('0x10')](0x1f4,_0x423b4c['message']));});});};
\ No newline at end of file
+var _0xa953=['GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','map','include','model','ShowServicenowAccount','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch'];(function(_0x4e0eb6,_0x240784){var _0x46e432=function(_0x24b973){while(--_0x24b973){_0x4e0eb6['push'](_0x4e0eb6['shift']());}};_0x46e432(++_0x240784);}(_0xa953,0xf1));var _0x3a95=function(_0x27dc6f,_0x5dbea8){_0x27dc6f=_0x27dc6f-0x0;var _0x461137=_0xa953[_0x27dc6f];return _0x461137;};'use strict';var _=require(_0x3a95('0x0'));var util=require('util');var moment=require(_0x3a95('0x1'));var BPromise=require(_0x3a95('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a95('0x3'))['db'];var utils=require(_0x3a95('0x4'));var logger=require(_0x3a95('0x5'))(_0x3a95('0x6'));var config=require(_0x3a95('0x7'));var jayson=require(_0x3a95('0x8'));var client=jayson[_0x3a95('0x9')][_0x3a95('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40ab39,_0x573db8,_0x56d733){return new BPromise(function(_0x56899d,_0x590db4){return client[_0x3a95('0xb')](_0x40ab39,_0x56d733)[_0x3a95('0xc')](function(_0x2a82ad){logger[_0x3a95('0xd')](_0x3a95('0xe'),_0x573db8,_0x3a95('0xf'));logger[_0x3a95('0x10')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x573db8,_0x3a95('0xf'),JSON[_0x3a95('0x11')](_0x2a82ad));if(_0x2a82ad['error']){if(_0x2a82ad['error'][_0x3a95('0x12')]===0x1f4){logger[_0x3a95('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x573db8,_0x2a82ad[_0x3a95('0x13')][_0x3a95('0x14')]);return _0x590db4(_0x2a82ad[_0x3a95('0x13')]['message']);}logger['error'](_0x3a95('0xe'),_0x573db8,_0x2a82ad['error']['message']);return _0x56899d(_0x2a82ad[_0x3a95('0x13')]['message']);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x573db8,'request\x20sent');_0x56899d(_0x2a82ad[_0x3a95('0x15')]['message']);}})[_0x3a95('0x16')](function(_0x174cec){logger[_0x3a95('0x13')](_0x3a95('0xe'),_0x573db8,_0x174cec);_0x590db4(_0x174cec);});});}exports[_0x3a95('0x17')]=function(_0x392d21){var _0x539a5c=this;return new Promise(function(_0x2e0b4f,_0x1b3ae3){return db[_0x3a95('0x18')]['findAll']({'raw':_0x392d21['options']?_0x392d21[_0x3a95('0x19')][_0x3a95('0x1a')]===undefined?!![]:![]:!![],'where':_0x392d21[_0x3a95('0x19')]?_0x392d21[_0x3a95('0x19')][_0x3a95('0x1b')]||null:null,'attributes':_0x392d21['options']?_0x392d21[_0x3a95('0x19')][_0x3a95('0x1c')]||null:null,'limit':_0x392d21['options']?_0x392d21[_0x3a95('0x19')]['limit']||null:null,'include':_0x392d21[_0x3a95('0x19')]?_0x392d21[_0x3a95('0x19')]['include']?_[_0x3a95('0x1d')](_0x392d21[_0x3a95('0x19')][_0x3a95('0x1e')],function(_0x58837f){return{'model':db[_0x58837f['model']],'as':_0x58837f['as'],'attributes':_0x58837f[_0x3a95('0x1c')],'include':_0x58837f['include']?_[_0x3a95('0x1d')](_0x58837f['include'],function(_0x24856c){return{'model':db[_0x24856c[_0x3a95('0x1f')]],'as':_0x24856c['as'],'attributes':_0x24856c[_0x3a95('0x1c')],'include':_0x24856c['include']?_[_0x3a95('0x1d')](_0x24856c[_0x3a95('0x1e')],function(_0x1611b3){return{'model':db[_0x1611b3[_0x3a95('0x1f')]],'as':_0x1611b3['as'],'attributes':_0x1611b3[_0x3a95('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3a95('0xc')](function(_0x294bfd){logger[_0x3a95('0xd')](_0x3a95('0x17'),_0x392d21);logger[_0x3a95('0x10')](_0x3a95('0x17'),_0x392d21,JSON['stringify'](_0x294bfd));_0x2e0b4f(_0x294bfd);})[_0x3a95('0x16')](function(_0x3ceafd){logger[_0x3a95('0x13')]('GetServicenowAccount',_0x3ceafd[_0x3a95('0x14')],_0x392d21);_0x1b3ae3(_0x539a5c[_0x3a95('0x13')](0x1f4,_0x3ceafd[_0x3a95('0x14')]));});});};exports[_0x3a95('0x20')]=function(_0x37d7f6){var _0x2e3450=this;return new Promise(function(_0x598539,_0xe8e92e){return db[_0x3a95('0x18')]['find']({'raw':_0x37d7f6[_0x3a95('0x19')]?_0x37d7f6['options'][_0x3a95('0x1a')]===undefined?!![]:![]:!![],'where':_0x37d7f6['options']?_0x37d7f6[_0x3a95('0x19')]['where']||null:null,'attributes':_0x37d7f6[_0x3a95('0x19')]?_0x37d7f6[_0x3a95('0x19')][_0x3a95('0x1c')]||null:null,'include':_0x37d7f6[_0x3a95('0x19')]?_0x37d7f6['options'][_0x3a95('0x1e')]?_[_0x3a95('0x1d')](_0x37d7f6[_0x3a95('0x19')][_0x3a95('0x1e')],function(_0x2f790d){return{'model':db[_0x2f790d[_0x3a95('0x1f')]],'as':_0x2f790d['as'],'attributes':_0x2f790d[_0x3a95('0x1c')],'include':_0x2f790d[_0x3a95('0x1e')]?_[_0x3a95('0x1d')](_0x2f790d['include'],function(_0x972a40){return{'model':db[_0x972a40[_0x3a95('0x1f')]],'as':_0x972a40['as'],'attributes':_0x972a40['attributes'],'include':_0x972a40['include']?_[_0x3a95('0x1d')](_0x972a40[_0x3a95('0x1e')],function(_0xdbdec5){return{'model':db[_0xdbdec5[_0x3a95('0x1f')]],'as':_0xdbdec5['as'],'attributes':_0xdbdec5[_0x3a95('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3a95('0xc')](function(_0xe37a5f){logger[_0x3a95('0xd')](_0x3a95('0x20'),_0x37d7f6);logger[_0x3a95('0x10')](_0x3a95('0x20'),_0x37d7f6,JSON[_0x3a95('0x11')](_0xe37a5f));_0x598539(_0xe37a5f);})[_0x3a95('0x16')](function(_0x54df42){logger['error'](_0x3a95('0x20'),_0x54df42[_0x3a95('0x14')],_0x37d7f6);_0xe8e92e(_0x2e3450[_0x3a95('0x13')](0x1f4,_0x54df42[_0x3a95('0x14')]));});});};
\ No newline at end of file
index ef0501f..1461d31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e5=['show','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','/:id'];(function(_0x347ec9,_0x3b026d){var _0xece2c=function(_0xc0ae44){while(--_0xc0ae44){_0x347ec9['push'](_0x347ec9['shift']());}};_0xece2c(++_0x3b026d);}(_0xa9e5,0xc8));var _0x5a9e=function(_0x25af69,_0x7f841a){_0x25af69=_0x25af69-0x0;var _0xfee91=_0xa9e5[_0x25af69];return _0xfee91;};'use strict';var multer=require(_0x5a9e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5a9e('0x1'));var express=require(_0x5a9e('0x2'));var router=express[_0x5a9e('0x3')]();var fs_extra=require(_0x5a9e('0x4'));var auth=require(_0x5a9e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5a9e('0x6'));var controller=require(_0x5a9e('0x7'));router[_0x5a9e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5a9e('0x8')](_0x5a9e('0x9'),auth['isAuthenticated'](),controller[_0x5a9e('0xa')]);router[_0x5a9e('0x8')]('/:id/fields',auth[_0x5a9e('0xb')](),controller['getFields']);router[_0x5a9e('0x8')](_0x5a9e('0xc'),auth[_0x5a9e('0xb')](),controller[_0x5a9e('0xd')]);router[_0x5a9e('0x8')](_0x5a9e('0xe'),auth['isAuthenticated'](),controller[_0x5a9e('0xf')]);router[_0x5a9e('0x10')]('/',auth['isAuthenticated'](),controller[_0x5a9e('0x11')]);router[_0x5a9e('0x12')]('/:id',auth[_0x5a9e('0xb')](),controller[_0x5a9e('0x13')]);router['delete'](_0x5a9e('0x9'),auth[_0x5a9e('0xb')](),controller[_0x5a9e('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xa8c6=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post'];(function(_0x59b674,_0x3db79e){var _0x3ef91b=function(_0x39d0cc){while(--_0x39d0cc){_0x59b674['push'](_0x59b674['shift']());}};_0x3ef91b(++_0x3db79e);}(_0xa8c6,0x18a));var _0x6a8c=function(_0x38a9cb,_0xfd8b2b){_0x38a9cb=_0x38a9cb-0x0;var _0xfa7687=_0xa8c6[_0x38a9cb];return _0xfa7687;};'use strict';var multer=require(_0x6a8c('0x0'));var util=require(_0x6a8c('0x1'));var path=require(_0x6a8c('0x2'));var timeout=require(_0x6a8c('0x3'));var express=require(_0x6a8c('0x4'));var router=express[_0x6a8c('0x5')]();var fs_extra=require(_0x6a8c('0x6'));var auth=require(_0x6a8c('0x7'));var interaction=require(_0x6a8c('0x8'));var config=require(_0x6a8c('0x9'));var controller=require(_0x6a8c('0xa'));router[_0x6a8c('0xb')]('/',auth[_0x6a8c('0xc')](),controller[_0x6a8c('0xd')]);router[_0x6a8c('0xb')](_0x6a8c('0xe'),auth[_0x6a8c('0xc')](),controller[_0x6a8c('0xf')]);router['get'](_0x6a8c('0x10'),auth[_0x6a8c('0xc')](),controller[_0x6a8c('0x11')]);router[_0x6a8c('0xb')](_0x6a8c('0x12'),auth[_0x6a8c('0xc')](),controller[_0x6a8c('0x13')]);router[_0x6a8c('0xb')](_0x6a8c('0x14'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6a8c('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6a8c('0x16')](_0x6a8c('0xe'),auth[_0x6a8c('0xc')](),controller[_0x6a8c('0x17')]);router[_0x6a8c('0x18')](_0x6a8c('0xe'),auth[_0x6a8c('0xc')](),controller[_0x6a8c('0x19')]);module['exports']=router;
\ No newline at end of file
index 121c6d6..135e74d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9af=['sequelize','exports','STRING'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xa9af,0x1b0));var _0xfa9a=function(_0xbf3522,_0x306da0){_0xbf3522=_0xbf3522-0x0;var _0x47c693=_0xa9af[_0xbf3522];return _0x47c693;};'use strict';var Sequelize=require(_0xfa9a('0x0'));module[_0xfa9a('0x1')]={'name':{'type':Sequelize[_0xfa9a('0x2')]},'description':{'type':Sequelize[_0xfa9a('0x2')]}};
\ No newline at end of file
+var _0x7601=['STRING','sequelize'];(function(_0x2114d6,_0xedfd25){var _0x3e8734=function(_0xd158c6){while(--_0xd158c6){_0x2114d6['push'](_0x2114d6['shift']());}};_0x3e8734(++_0xedfd25);}(_0x7601,0x113));var _0x1760=function(_0x34a284,_0x207084){_0x34a284=_0x34a284-0x0;var _0x2ec13b=_0x7601[_0x34a284];return _0x2ec13b;};'use strict';var Sequelize=require(_0x1760('0x0'));module['exports']={'name':{'type':Sequelize[_0x1760('0x1')]},'description':{'type':Sequelize[_0x1760('0x1')]}};
\ No newline at end of file
index f94e55c..d54d875 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01e8=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','Content-Range','apply','reject','update','then','error','stack','name','send','map','ServicenowConfiguration','key','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','keys','includeAll','find','create','body','getFields','findOne','ServicenowField','order','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0xca48b5,_0x546b5a){var _0xc5390f=function(_0x40a1b7){while(--_0x40a1b7){_0xca48b5['push'](_0xca48b5['shift']());}};_0xc5390f(++_0x546b5a);}(_0x01e8,0xdf));var _0x801e=function(_0x54aff6,_0xc4c096){_0x54aff6=_0x54aff6-0x0;var _0x487a36=_0x01e8[_0x54aff6];return _0x487a36;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x801e('0x0'));var zipdir=require(_0x801e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x801e('0x2'));var BPromise=require(_0x801e('0x3'));var Mustache=require(_0x801e('0x4'));var util=require(_0x801e('0x5'));var path=require('path');var sox=require(_0x801e('0x6'));var csv=require(_0x801e('0x7'));var ejs=require(_0x801e('0x8'));var fs=require('fs');var fs_extra=require(_0x801e('0x9'));var _=require(_0x801e('0xa'));var squel=require(_0x801e('0xb'));var crypto=require(_0x801e('0xc'));var jsforce=require(_0x801e('0xd'));var deskjs=require(_0x801e('0xe'));var toCsv=require(_0x801e('0x7'));var querystring=require(_0x801e('0xf'));var Papa=require('papaparse');var Redis=require(_0x801e('0x10'));var authService=require(_0x801e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x801e('0x12'));var hardwareService=require(_0x801e('0x13'));var logger=require(_0x801e('0x14'))(_0x801e('0x15'));var utils=require('../../config/utils');var config=require(_0x801e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x801e('0x17'))['db'];function respondWithStatusCode(_0x20417d,_0x12290e){_0x12290e=_0x12290e||0xcc;return function(_0x2effab){if(_0x2effab){return _0x20417d[_0x801e('0x18')](_0x12290e);}return _0x20417d['status'](_0x12290e)[_0x801e('0x19')]();};}function respondWithResult(_0xb4138f,_0x1c55e0){_0x1c55e0=_0x1c55e0||0xc8;return function(_0x20254e){if(_0x20254e){return _0xb4138f[_0x801e('0x1a')](_0x1c55e0)[_0x801e('0x1b')](_0x20254e);}};}function respondWithFilteredResult(_0x4be40e,_0x3451c7){return function(_0x525cb7){if(_0x525cb7){var _0x82fae0=typeof _0x3451c7['offset']===_0x801e('0x1c')&&typeof _0x3451c7[_0x801e('0x1d')]===_0x801e('0x1c');var _0x8f9273=_0x525cb7['count'];var _0x51c2d0=_0x82fae0?0x0:_0x3451c7[_0x801e('0x1e')];var _0x3f0dfe=_0x82fae0?_0x525cb7[_0x801e('0x1f')]:_0x3451c7['offset']+_0x3451c7[_0x801e('0x1d')];var _0x36850b;if(_0x3f0dfe>=_0x8f9273){_0x3f0dfe=_0x8f9273;_0x36850b=0xc8;}else{_0x36850b=0xce;}_0x4be40e[_0x801e('0x1a')](_0x36850b);return _0x4be40e['set'](_0x801e('0x20'),_0x51c2d0+'-'+_0x3f0dfe+'/'+_0x8f9273)['json'](_0x525cb7);}return null;};}function patchUpdates(_0x246090){return function(_0x30ff2e){try{jsonpatch[_0x801e('0x21')](_0x30ff2e,_0x246090,!![]);}catch(_0x5dc9ca){return BPromise[_0x801e('0x22')](_0x5dc9ca);}return _0x30ff2e['save']();};}function saveUpdates(_0x4ed7e6,_0x5257bc){return function(_0x549db4){if(_0x549db4){return _0x549db4[_0x801e('0x23')](_0x4ed7e6)[_0x801e('0x24')](function(_0x3f7ed2){return _0x3f7ed2;});}return null;};}function removeEntity(_0x3336ec,_0x5593d5){return function(_0x3191e0){if(_0x3191e0){return _0x3191e0['destroy']()[_0x801e('0x24')](function(){_0x3336ec[_0x801e('0x1a')](0xcc)[_0x801e('0x19')]();});}};}function handleEntityNotFound(_0x1a785d,_0x20526a){return function(_0x58416f){if(!_0x58416f){_0x1a785d[_0x801e('0x18')](0x194);}return _0x58416f;};}function handleError(_0x48f43c,_0x454bc7){_0x454bc7=_0x454bc7||0x1f4;return function(_0x5960d3){logger[_0x801e('0x25')](_0x5960d3[_0x801e('0x26')]);if(_0x5960d3['name']){delete _0x5960d3[_0x801e('0x27')];}_0x48f43c[_0x801e('0x1a')](_0x454bc7)[_0x801e('0x28')](_0x5960d3);};}exports['index']=function(_0x54a6fc,_0x584802){var _0x26702b={},_0x51386e={},_0x39bc8d={'count':0x0,'rows':[]};var _0x2c87b6=_[_0x801e('0x29')](db[_0x801e('0x2a')]['rawAttributes'],function(_0x371b04){return{'name':_0x371b04['fieldName'],'type':_0x371b04['type'][_0x801e('0x2b')]};});_0x51386e[_0x801e('0x2c')]=_['map'](_0x2c87b6,_0x801e('0x27'));_0x51386e['query']=_['keys'](_0x54a6fc[_0x801e('0x2d')]);_0x51386e['filters']=_[_0x801e('0x2e')](_0x51386e[_0x801e('0x2c')],_0x51386e[_0x801e('0x2d')]);_0x26702b[_0x801e('0x2f')]=_['intersection'](_0x51386e[_0x801e('0x2c')],qs[_0x801e('0x30')](_0x54a6fc[_0x801e('0x2d')][_0x801e('0x30')]));_0x26702b[_0x801e('0x2f')]=_0x26702b['attributes'][_0x801e('0x31')]?_0x26702b[_0x801e('0x2f')]:_0x51386e[_0x801e('0x2c')];if(!_0x54a6fc['query'][_0x801e('0x32')]('nolimit')){_0x26702b['limit']=qs['limit'](_0x54a6fc[_0x801e('0x2d')][_0x801e('0x1d')]);_0x26702b[_0x801e('0x1e')]=qs[_0x801e('0x1e')](_0x54a6fc[_0x801e('0x2d')][_0x801e('0x1e')]);}_0x26702b['order']=qs[_0x801e('0x33')](_0x54a6fc['query']['sort']);_0x26702b[_0x801e('0x34')]=qs[_0x801e('0x35')](_[_0x801e('0x36')](_0x54a6fc[_0x801e('0x2d')],_0x51386e[_0x801e('0x35')]),_0x2c87b6);if(_0x54a6fc[_0x801e('0x2d')][_0x801e('0x37')]){_0x26702b['where']=_[_0x801e('0x38')](_0x26702b[_0x801e('0x34')],{'$or':_[_0x801e('0x29')](_0x2c87b6,function(_0x2a8ca3){if(_0x2a8ca3[_0x801e('0x39')]!==_0x801e('0x3a')){var _0x444fb9={};_0x444fb9[_0x2a8ca3[_0x801e('0x27')]]={'$like':'%'+_0x54a6fc[_0x801e('0x2d')][_0x801e('0x37')]+'%'};return _0x444fb9;}})});}_0x26702b=_[_0x801e('0x38')]({},_0x26702b,_0x54a6fc[_0x801e('0x3b')]);var _0x408580={'where':_0x26702b[_0x801e('0x34')]};return db['ServicenowConfiguration']['count'](_0x408580)[_0x801e('0x24')](function(_0x30548c){_0x39bc8d[_0x801e('0x1f')]=_0x30548c;if(_0x54a6fc[_0x801e('0x2d')]['includeAll']){_0x26702b[_0x801e('0x3c')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x801e('0x3d')](_0x26702b);})[_0x801e('0x24')](function(_0xb119){_0x39bc8d['rows']=_0xb119;return _0x39bc8d;})[_0x801e('0x24')](respondWithFilteredResult(_0x584802,_0x26702b))[_0x801e('0x3e')](handleError(_0x584802,null));};exports[_0x801e('0x3f')]=function(_0x504677,_0x4fe7a0){var _0x538a74={'raw':![],'where':{'id':_0x504677[_0x801e('0x40')]['id']}},_0x356011={};_0x356011['model']=_['keys'](db[_0x801e('0x2a')][_0x801e('0x41')]);_0x356011['query']=_[_0x801e('0x42')](_0x504677['query']);_0x356011[_0x801e('0x35')]=_[_0x801e('0x2e')](_0x356011[_0x801e('0x2c')],_0x356011[_0x801e('0x2d')]);_0x538a74[_0x801e('0x2f')]=_[_0x801e('0x2e')](_0x356011[_0x801e('0x2c')],qs['fields'](_0x504677['query'][_0x801e('0x30')]));_0x538a74[_0x801e('0x2f')]=_0x538a74[_0x801e('0x2f')][_0x801e('0x31')]?_0x538a74[_0x801e('0x2f')]:_0x356011[_0x801e('0x2c')];if(_0x504677['query'][_0x801e('0x43')]){_0x538a74['include']=[{'all':!![]}];}_0x538a74=_[_0x801e('0x38')]({},_0x538a74,_0x504677[_0x801e('0x3b')]);return db[_0x801e('0x2a')][_0x801e('0x44')](_0x538a74)[_0x801e('0x24')](handleEntityNotFound(_0x4fe7a0,null))[_0x801e('0x24')](respondWithResult(_0x4fe7a0,null))[_0x801e('0x3e')](handleError(_0x4fe7a0,null));};exports[_0x801e('0x45')]=function(_0x4a27a7,_0x33b7f7){return db[_0x801e('0x2a')][_0x801e('0x45')](_0x4a27a7[_0x801e('0x46')],{})[_0x801e('0x24')](respondWithResult(_0x33b7f7,0xc9))[_0x801e('0x3e')](handleError(_0x33b7f7,null));};exports['update']=function(_0xf3020b,_0x358449){if(_0xf3020b[_0x801e('0x46')]['id']){delete _0xf3020b['body']['id'];}return db['ServicenowConfiguration'][_0x801e('0x44')]({'where':{'id':_0xf3020b[_0x801e('0x40')]['id']}})['then'](handleEntityNotFound(_0x358449,null))[_0x801e('0x24')](saveUpdates(_0xf3020b[_0x801e('0x46')],null))[_0x801e('0x24')](respondWithResult(_0x358449,null))[_0x801e('0x3e')](handleError(_0x358449,null));};exports['destroy']=function(_0x342506,_0x1581f6){return db['ServicenowConfiguration'][_0x801e('0x44')]({'where':{'id':_0x342506[_0x801e('0x40')]['id']}})['then'](handleEntityNotFound(_0x1581f6,null))[_0x801e('0x24')](removeEntity(_0x1581f6,null))[_0x801e('0x3e')](handleError(_0x1581f6,null));};exports[_0x801e('0x47')]=function(_0x345679,_0x190be5,_0xce088b){var _0x34baca={};var _0xb06636={};var _0x233022;var _0x56b513;return db['ServicenowConfiguration'][_0x801e('0x48')]({'where':{'id':_0x345679[_0x801e('0x40')]['id']}})[_0x801e('0x24')](handleEntityNotFound(_0x190be5,null))[_0x801e('0x24')](function(_0x1b27b2){if(_0x1b27b2){_0x233022=_0x1b27b2;_0xb06636[_0x801e('0x2c')]=_[_0x801e('0x42')](db[_0x801e('0x49')]['rawAttributes']);_0xb06636[_0x801e('0x2d')]=_['keys'](_0x345679['query']);_0xb06636[_0x801e('0x35')]=_[_0x801e('0x2e')](_0xb06636[_0x801e('0x2c')],_0xb06636['query']);_0x34baca[_0x801e('0x2f')]=_[_0x801e('0x2e')](_0xb06636['model'],qs[_0x801e('0x30')](_0x345679[_0x801e('0x2d')][_0x801e('0x30')]));_0x34baca['attributes']=_0x34baca['attributes'][_0x801e('0x31')]?_0x34baca[_0x801e('0x2f')]:_0xb06636[_0x801e('0x2c')];_0x34baca[_0x801e('0x4a')]=qs[_0x801e('0x33')](_0x345679[_0x801e('0x2d')][_0x801e('0x33')]);_0x34baca[_0x801e('0x34')]=qs['filters'](_[_0x801e('0x36')](_0x345679[_0x801e('0x2d')],_0xb06636[_0x801e('0x35')]));if(_0x345679['query'][_0x801e('0x37')]){_0x34baca[_0x801e('0x34')]=_[_0x801e('0x38')](_0x34baca[_0x801e('0x34')],{'$or':_['map'](_0x34baca['attributes'],function(_0x1e7e04){var _0x8a49cf={};_0x8a49cf[_0x1e7e04]={'$like':'%'+_0x345679[_0x801e('0x2d')]['filter']+'%'};return _0x8a49cf;})});}_0x34baca=_[_0x801e('0x38')]({},_0x34baca,_0x345679[_0x801e('0x3b')]);return _0x233022[_0x801e('0x47')](_0x34baca);}})[_0x801e('0x24')](function(_0x233021){if(_0x233021){_0x56b513=_0x233021[_0x801e('0x31')];if(!_0x345679['query'][_0x801e('0x32')](_0x801e('0x4b'))){_0x34baca[_0x801e('0x1d')]=qs['limit'](_0x345679[_0x801e('0x2d')][_0x801e('0x1d')]);_0x34baca[_0x801e('0x1e')]=qs[_0x801e('0x1e')](_0x345679['query'][_0x801e('0x1e')]);}return _0x233022[_0x801e('0x47')](_0x34baca);}})[_0x801e('0x24')](function(_0x32c462){if(_0x32c462){return _0x32c462?{'count':_0x56b513,'rows':_0x32c462}:null;}})[_0x801e('0x24')](respondWithResult(_0x190be5,null))[_0x801e('0x3e')](handleError(_0x190be5,null));};exports[_0x801e('0x4c')]=function(_0x4b6194,_0xe9adec,_0x56e21b){var _0x1df5e3={};var _0x372623={};var _0x1a3af9;var _0x226d91;return db[_0x801e('0x2a')][_0x801e('0x48')]({'where':{'id':_0x4b6194[_0x801e('0x40')]['id']}})[_0x801e('0x24')](handleEntityNotFound(_0xe9adec,null))[_0x801e('0x24')](function(_0x367f9c){if(_0x367f9c){_0x1a3af9=_0x367f9c;_0x372623['model']=_[_0x801e('0x42')](db[_0x801e('0x49')][_0x801e('0x41')]);_0x372623[_0x801e('0x2d')]=_[_0x801e('0x42')](_0x4b6194[_0x801e('0x2d')]);_0x372623[_0x801e('0x35')]=_[_0x801e('0x2e')](_0x372623[_0x801e('0x2c')],_0x372623[_0x801e('0x2d')]);_0x1df5e3[_0x801e('0x2f')]=_['intersection'](_0x372623['model'],qs[_0x801e('0x30')](_0x4b6194['query'][_0x801e('0x30')]));_0x1df5e3[_0x801e('0x2f')]=_0x1df5e3['attributes'][_0x801e('0x31')]?_0x1df5e3[_0x801e('0x2f')]:_0x372623[_0x801e('0x2c')];_0x1df5e3[_0x801e('0x4a')]=qs['sort'](_0x4b6194['query'][_0x801e('0x33')]);_0x1df5e3[_0x801e('0x34')]=qs[_0x801e('0x35')](_[_0x801e('0x36')](_0x4b6194[_0x801e('0x2d')],_0x372623['filters']));if(_0x4b6194['query'][_0x801e('0x37')]){_0x1df5e3[_0x801e('0x34')]=_[_0x801e('0x38')](_0x1df5e3[_0x801e('0x34')],{'$or':_[_0x801e('0x29')](_0x1df5e3[_0x801e('0x2f')],function(_0x12fde1){var _0xb7b915={};_0xb7b915[_0x12fde1]={'$like':'%'+_0x4b6194[_0x801e('0x2d')][_0x801e('0x37')]+'%'};return _0xb7b915;})});}_0x1df5e3=_['merge']({},_0x1df5e3,_0x4b6194[_0x801e('0x3b')]);return _0x1a3af9['getSubjects'](_0x1df5e3);}})[_0x801e('0x24')](function(_0x184592){if(_0x184592){_0x226d91=_0x184592[_0x801e('0x31')];if(!_0x4b6194['query'][_0x801e('0x32')](_0x801e('0x4b'))){_0x1df5e3['limit']=qs['limit'](_0x4b6194[_0x801e('0x2d')]['limit']);_0x1df5e3[_0x801e('0x1e')]=qs[_0x801e('0x1e')](_0x4b6194[_0x801e('0x2d')]['offset']);}return _0x1a3af9['getSubjects'](_0x1df5e3);}})['then'](function(_0x1d4675){if(_0x1d4675){return _0x1d4675?{'count':_0x226d91,'rows':_0x1d4675}:null;}})['then'](respondWithResult(_0xe9adec,null))[_0x801e('0x3e')](handleError(_0xe9adec,null));};exports['getDescriptions']=function(_0x215076,_0x52f70d,_0x287da3){var _0x20d3a7={};var _0x4b2e1f={};var _0x3d3613;var _0xce8d7d;return db[_0x801e('0x2a')]['findOne']({'where':{'id':_0x215076['params']['id']}})[_0x801e('0x24')](handleEntityNotFound(_0x52f70d,null))[_0x801e('0x24')](function(_0x38295b){if(_0x38295b){_0x3d3613=_0x38295b;_0x4b2e1f[_0x801e('0x2c')]=_[_0x801e('0x42')](db['ServicenowField'][_0x801e('0x41')]);_0x4b2e1f[_0x801e('0x2d')]=_[_0x801e('0x42')](_0x215076[_0x801e('0x2d')]);_0x4b2e1f[_0x801e('0x35')]=_[_0x801e('0x2e')](_0x4b2e1f[_0x801e('0x2c')],_0x4b2e1f['query']);_0x20d3a7[_0x801e('0x2f')]=_['intersection'](_0x4b2e1f['model'],qs[_0x801e('0x30')](_0x215076[_0x801e('0x2d')][_0x801e('0x30')]));_0x20d3a7[_0x801e('0x2f')]=_0x20d3a7[_0x801e('0x2f')][_0x801e('0x31')]?_0x20d3a7[_0x801e('0x2f')]:_0x4b2e1f[_0x801e('0x2c')];_0x20d3a7[_0x801e('0x4a')]=qs[_0x801e('0x33')](_0x215076[_0x801e('0x2d')]['sort']);_0x20d3a7['where']=qs[_0x801e('0x35')](_[_0x801e('0x36')](_0x215076[_0x801e('0x2d')],_0x4b2e1f['filters']));if(_0x215076[_0x801e('0x2d')][_0x801e('0x37')]){_0x20d3a7['where']=_[_0x801e('0x38')](_0x20d3a7[_0x801e('0x34')],{'$or':_[_0x801e('0x29')](_0x20d3a7[_0x801e('0x2f')],function(_0x4e31ce){var _0x3560e6={};_0x3560e6[_0x4e31ce]={'$like':'%'+_0x215076[_0x801e('0x2d')]['filter']+'%'};return _0x3560e6;})});}_0x20d3a7=_[_0x801e('0x38')]({},_0x20d3a7,_0x215076['options']);return _0x3d3613[_0x801e('0x4d')](_0x20d3a7);}})['then'](function(_0xa5eabe){if(_0xa5eabe){_0xce8d7d=_0xa5eabe[_0x801e('0x31')];if(!_0x215076[_0x801e('0x2d')][_0x801e('0x32')]('nolimit')){_0x20d3a7[_0x801e('0x1d')]=qs[_0x801e('0x1d')](_0x215076[_0x801e('0x2d')][_0x801e('0x1d')]);_0x20d3a7[_0x801e('0x1e')]=qs[_0x801e('0x1e')](_0x215076[_0x801e('0x2d')][_0x801e('0x1e')]);}return _0x3d3613[_0x801e('0x4d')](_0x20d3a7);}})[_0x801e('0x24')](function(_0x46a06e){if(_0x46a06e){return _0x46a06e?{'count':_0xce8d7d,'rows':_0x46a06e}:null;}})[_0x801e('0x24')](respondWithResult(_0x52f70d,null))[_0x801e('0x3e')](handleError(_0x52f70d,null));};
\ No newline at end of file
+var _0x3780=['squel','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','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','ServicenowConfiguration','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','getFields','findOne','options','getSubjects','ServicenowField','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','fs-extra','lodash'];(function(_0x4b2eeb,_0x1a828b){var _0x5374a5=function(_0xd71323){while(--_0xd71323){_0x4b2eeb['push'](_0x4b2eeb['shift']());}};_0x5374a5(++_0x1a828b);}(_0x3780,0xf1));var _0x0378=function(_0x26447e,_0x2e9c94){_0x26447e=_0x26447e-0x0;var _0x38cc1a=_0x3780[_0x26447e];return _0x38cc1a;};'use strict';var emlformat=require(_0x0378('0x0'));var rimraf=require(_0x0378('0x1'));var zipdir=require(_0x0378('0x2'));var jsonpatch=require(_0x0378('0x3'));var rp=require('request-promise');var moment=require(_0x0378('0x4'));var BPromise=require(_0x0378('0x5'));var Mustache=require('mustache');var util=require(_0x0378('0x6'));var path=require('path');var sox=require(_0x0378('0x7'));var csv=require('to-csv');var ejs=require(_0x0378('0x8'));var fs=require('fs');var fs_extra=require(_0x0378('0x9'));var _=require(_0x0378('0xa'));var squel=require(_0x0378('0xb'));var crypto=require('crypto');var jsforce=require(_0x0378('0xc'));var deskjs=require(_0x0378('0xd'));var toCsv=require(_0x0378('0xe'));var querystring=require(_0x0378('0xf'));var Papa=require('papaparse');var Redis=require(_0x0378('0x10'));var authService=require(_0x0378('0x11'));var qs=require(_0x0378('0x12'));var as=require(_0x0378('0x13'));var hardwareService=require(_0x0378('0x14'));var logger=require(_0x0378('0x15'))(_0x0378('0x16'));var utils=require(_0x0378('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0378('0x18'));var db=require(_0x0378('0x19'))['db'];function respondWithStatusCode(_0x39a259,_0x4a1f25){_0x4a1f25=_0x4a1f25||0xcc;return function(_0x5eeb1b){if(_0x5eeb1b){return _0x39a259[_0x0378('0x1a')](_0x4a1f25);}return _0x39a259[_0x0378('0x1b')](_0x4a1f25)[_0x0378('0x1c')]();};}function respondWithResult(_0x2b70a3,_0x3564a0){_0x3564a0=_0x3564a0||0xc8;return function(_0x51d5c8){if(_0x51d5c8){return _0x2b70a3[_0x0378('0x1b')](_0x3564a0)[_0x0378('0x1d')](_0x51d5c8);}};}function respondWithFilteredResult(_0x1b4c9b,_0x1a84f2){return function(_0x25c17f){if(_0x25c17f){var _0x1da51f=typeof _0x1a84f2[_0x0378('0x1e')]===_0x0378('0x1f')&&typeof _0x1a84f2[_0x0378('0x20')]===_0x0378('0x1f');var _0x116e27=_0x25c17f['count'];var _0x3207ab=_0x1da51f?0x0:_0x1a84f2[_0x0378('0x1e')];var _0x5e7c5c=_0x1da51f?_0x25c17f[_0x0378('0x21')]:_0x1a84f2[_0x0378('0x1e')]+_0x1a84f2[_0x0378('0x20')];var _0x311c4b;if(_0x5e7c5c>=_0x116e27){_0x5e7c5c=_0x116e27;_0x311c4b=0xc8;}else{_0x311c4b=0xce;}_0x1b4c9b[_0x0378('0x1b')](_0x311c4b);return _0x1b4c9b[_0x0378('0x22')]('Content-Range',_0x3207ab+'-'+_0x5e7c5c+'/'+_0x116e27)[_0x0378('0x1d')](_0x25c17f);}return null;};}function patchUpdates(_0x1cb9b8){return function(_0xe09cd7){try{jsonpatch[_0x0378('0x23')](_0xe09cd7,_0x1cb9b8,!![]);}catch(_0x15b29a){return BPromise[_0x0378('0x24')](_0x15b29a);}return _0xe09cd7[_0x0378('0x25')]();};}function saveUpdates(_0x16bf1f,_0x2e1caf){return function(_0x25cbba){if(_0x25cbba){return _0x25cbba[_0x0378('0x26')](_0x16bf1f)[_0x0378('0x27')](function(_0x5ed0d7){return _0x5ed0d7;});}return null;};}function removeEntity(_0x3aeb6e,_0x4fadd1){return function(_0x5cb7fd){if(_0x5cb7fd){return _0x5cb7fd[_0x0378('0x28')]()[_0x0378('0x27')](function(){_0x3aeb6e['status'](0xcc)[_0x0378('0x1c')]();});}};}function handleEntityNotFound(_0x457d74,_0x1bee4b){return function(_0x4b6c9d){if(!_0x4b6c9d){_0x457d74[_0x0378('0x1a')](0x194);}return _0x4b6c9d;};}function handleError(_0x482e5a,_0x6129de){_0x6129de=_0x6129de||0x1f4;return function(_0x5b0c73){logger[_0x0378('0x29')](_0x5b0c73['stack']);if(_0x5b0c73[_0x0378('0x2a')]){delete _0x5b0c73[_0x0378('0x2a')];}_0x482e5a[_0x0378('0x1b')](_0x6129de)[_0x0378('0x2b')](_0x5b0c73);};}exports[_0x0378('0x2c')]=function(_0x2e48ca,_0x1a4e6f){var _0x2cd985={},_0x4a2580={},_0x26afa4={'count':0x0,'rows':[]};var _0x3d5466=_[_0x0378('0x2d')](db['ServicenowConfiguration'][_0x0378('0x2e')],function(_0x1b6fcc){return{'name':_0x1b6fcc[_0x0378('0x2f')],'type':_0x1b6fcc[_0x0378('0x30')][_0x0378('0x31')]};});_0x4a2580['model']=_['map'](_0x3d5466,_0x0378('0x2a'));_0x4a2580[_0x0378('0x32')]=_[_0x0378('0x33')](_0x2e48ca[_0x0378('0x32')]);_0x4a2580[_0x0378('0x34')]=_[_0x0378('0x35')](_0x4a2580[_0x0378('0x36')],_0x4a2580['query']);_0x2cd985['attributes']=_[_0x0378('0x35')](_0x4a2580['model'],qs['fields'](_0x2e48ca[_0x0378('0x32')]['fields']));_0x2cd985[_0x0378('0x37')]=_0x2cd985['attributes'][_0x0378('0x38')]?_0x2cd985['attributes']:_0x4a2580[_0x0378('0x36')];if(!_0x2e48ca[_0x0378('0x32')]['hasOwnProperty'](_0x0378('0x39'))){_0x2cd985['limit']=qs[_0x0378('0x20')](_0x2e48ca[_0x0378('0x32')][_0x0378('0x20')]);_0x2cd985[_0x0378('0x1e')]=qs[_0x0378('0x1e')](_0x2e48ca[_0x0378('0x32')][_0x0378('0x1e')]);}_0x2cd985[_0x0378('0x3a')]=qs[_0x0378('0x3b')](_0x2e48ca[_0x0378('0x32')][_0x0378('0x3b')]);_0x2cd985[_0x0378('0x3c')]=qs[_0x0378('0x34')](_[_0x0378('0x3d')](_0x2e48ca['query'],_0x4a2580[_0x0378('0x34')]),_0x3d5466);if(_0x2e48ca[_0x0378('0x32')]['filter']){_0x2cd985[_0x0378('0x3c')]=_[_0x0378('0x3e')](_0x2cd985[_0x0378('0x3c')],{'$or':_['map'](_0x3d5466,function(_0x2dd884){if(_0x2dd884['type']!==_0x0378('0x3f')){var _0x43df7e={};_0x43df7e[_0x2dd884[_0x0378('0x2a')]]={'$like':'%'+_0x2e48ca[_0x0378('0x32')][_0x0378('0x40')]+'%'};return _0x43df7e;}})});}_0x2cd985=_[_0x0378('0x3e')]({},_0x2cd985,_0x2e48ca['options']);var _0x496339={'where':_0x2cd985[_0x0378('0x3c')]};return db[_0x0378('0x41')][_0x0378('0x21')](_0x496339)[_0x0378('0x27')](function(_0x98fd28){_0x26afa4[_0x0378('0x21')]=_0x98fd28;if(_0x2e48ca[_0x0378('0x32')][_0x0378('0x42')]){_0x2cd985[_0x0378('0x43')]=[{'all':!![]}];}return db[_0x0378('0x41')][_0x0378('0x44')](_0x2cd985);})['then'](function(_0x43f38a){_0x26afa4[_0x0378('0x45')]=_0x43f38a;return _0x26afa4;})[_0x0378('0x27')](respondWithFilteredResult(_0x1a4e6f,_0x2cd985))[_0x0378('0x46')](handleError(_0x1a4e6f,null));};exports[_0x0378('0x47')]=function(_0x2de0fb,_0x4b345d){var _0x37595b={'raw':![],'where':{'id':_0x2de0fb[_0x0378('0x48')]['id']}},_0x21305c={};_0x21305c[_0x0378('0x36')]=_[_0x0378('0x33')](db[_0x0378('0x41')][_0x0378('0x2e')]);_0x21305c[_0x0378('0x32')]=_['keys'](_0x2de0fb[_0x0378('0x32')]);_0x21305c['filters']=_[_0x0378('0x35')](_0x21305c[_0x0378('0x36')],_0x21305c[_0x0378('0x32')]);_0x37595b[_0x0378('0x37')]=_['intersection'](_0x21305c[_0x0378('0x36')],qs[_0x0378('0x49')](_0x2de0fb['query'][_0x0378('0x49')]));_0x37595b[_0x0378('0x37')]=_0x37595b[_0x0378('0x37')][_0x0378('0x38')]?_0x37595b[_0x0378('0x37')]:_0x21305c[_0x0378('0x36')];if(_0x2de0fb[_0x0378('0x32')][_0x0378('0x42')]){_0x37595b['include']=[{'all':!![]}];}_0x37595b=_[_0x0378('0x3e')]({},_0x37595b,_0x2de0fb['options']);return db[_0x0378('0x41')][_0x0378('0x4a')](_0x37595b)[_0x0378('0x27')](handleEntityNotFound(_0x4b345d,null))[_0x0378('0x27')](respondWithResult(_0x4b345d,null))['catch'](handleError(_0x4b345d,null));};exports[_0x0378('0x4b')]=function(_0x31b4aa,_0x191244){return db[_0x0378('0x41')][_0x0378('0x4b')](_0x31b4aa[_0x0378('0x4c')],{})['then'](respondWithResult(_0x191244,0xc9))[_0x0378('0x46')](handleError(_0x191244,null));};exports[_0x0378('0x26')]=function(_0x1ea24b,_0x57e99b){if(_0x1ea24b['body']['id']){delete _0x1ea24b[_0x0378('0x4c')]['id'];}return db[_0x0378('0x41')][_0x0378('0x4a')]({'where':{'id':_0x1ea24b[_0x0378('0x48')]['id']}})[_0x0378('0x27')](handleEntityNotFound(_0x57e99b,null))[_0x0378('0x27')](saveUpdates(_0x1ea24b[_0x0378('0x4c')],null))[_0x0378('0x27')](respondWithResult(_0x57e99b,null))[_0x0378('0x46')](handleError(_0x57e99b,null));};exports[_0x0378('0x28')]=function(_0x2fdf92,_0x17132e){return db[_0x0378('0x41')]['find']({'where':{'id':_0x2fdf92[_0x0378('0x48')]['id']}})[_0x0378('0x27')](handleEntityNotFound(_0x17132e,null))[_0x0378('0x27')](removeEntity(_0x17132e,null))[_0x0378('0x46')](handleError(_0x17132e,null));};exports[_0x0378('0x4d')]=function(_0x293d18,_0x5bacb6,_0x330593){var _0xfc138e={};var _0x3ed464={};var _0x3e61a2;var _0x6d95d6;return db[_0x0378('0x41')][_0x0378('0x4e')]({'where':{'id':_0x293d18['params']['id']}})['then'](handleEntityNotFound(_0x5bacb6,null))[_0x0378('0x27')](function(_0x2ade5a){if(_0x2ade5a){_0x3e61a2=_0x2ade5a;_0x3ed464[_0x0378('0x36')]=_['keys'](db['ServicenowField'][_0x0378('0x2e')]);_0x3ed464[_0x0378('0x32')]=_[_0x0378('0x33')](_0x293d18[_0x0378('0x32')]);_0x3ed464['filters']=_[_0x0378('0x35')](_0x3ed464[_0x0378('0x36')],_0x3ed464['query']);_0xfc138e[_0x0378('0x37')]=_[_0x0378('0x35')](_0x3ed464[_0x0378('0x36')],qs[_0x0378('0x49')](_0x293d18[_0x0378('0x32')][_0x0378('0x49')]));_0xfc138e['attributes']=_0xfc138e[_0x0378('0x37')]['length']?_0xfc138e[_0x0378('0x37')]:_0x3ed464[_0x0378('0x36')];_0xfc138e[_0x0378('0x3a')]=qs[_0x0378('0x3b')](_0x293d18[_0x0378('0x32')][_0x0378('0x3b')]);_0xfc138e[_0x0378('0x3c')]=qs[_0x0378('0x34')](_[_0x0378('0x3d')](_0x293d18[_0x0378('0x32')],_0x3ed464['filters']));if(_0x293d18['query'][_0x0378('0x40')]){_0xfc138e[_0x0378('0x3c')]=_['merge'](_0xfc138e[_0x0378('0x3c')],{'$or':_[_0x0378('0x2d')](_0xfc138e['attributes'],function(_0x1fced5){var _0x41b5c8={};_0x41b5c8[_0x1fced5]={'$like':'%'+_0x293d18[_0x0378('0x32')]['filter']+'%'};return _0x41b5c8;})});}_0xfc138e=_[_0x0378('0x3e')]({},_0xfc138e,_0x293d18[_0x0378('0x4f')]);return _0x3e61a2[_0x0378('0x4d')](_0xfc138e);}})[_0x0378('0x27')](function(_0x35f5fe){if(_0x35f5fe){_0x6d95d6=_0x35f5fe[_0x0378('0x38')];if(!_0x293d18[_0x0378('0x32')]['hasOwnProperty'](_0x0378('0x39'))){_0xfc138e[_0x0378('0x20')]=qs[_0x0378('0x20')](_0x293d18[_0x0378('0x32')][_0x0378('0x20')]);_0xfc138e[_0x0378('0x1e')]=qs[_0x0378('0x1e')](_0x293d18[_0x0378('0x32')][_0x0378('0x1e')]);}return _0x3e61a2[_0x0378('0x4d')](_0xfc138e);}})[_0x0378('0x27')](function(_0x36b333){if(_0x36b333){return _0x36b333?{'count':_0x6d95d6,'rows':_0x36b333}:null;}})['then'](respondWithResult(_0x5bacb6,null))['catch'](handleError(_0x5bacb6,null));};exports[_0x0378('0x50')]=function(_0x84cb8a,_0x53b68e,_0x12ac70){var _0x1d81c3={};var _0xef72b={};var _0x567c72;var _0x158898;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x84cb8a['params']['id']}})[_0x0378('0x27')](handleEntityNotFound(_0x53b68e,null))[_0x0378('0x27')](function(_0x33c45b){if(_0x33c45b){_0x567c72=_0x33c45b;_0xef72b[_0x0378('0x36')]=_['keys'](db[_0x0378('0x51')][_0x0378('0x2e')]);_0xef72b[_0x0378('0x32')]=_['keys'](_0x84cb8a[_0x0378('0x32')]);_0xef72b[_0x0378('0x34')]=_['intersection'](_0xef72b['model'],_0xef72b[_0x0378('0x32')]);_0x1d81c3['attributes']=_[_0x0378('0x35')](_0xef72b['model'],qs['fields'](_0x84cb8a['query'][_0x0378('0x49')]));_0x1d81c3[_0x0378('0x37')]=_0x1d81c3[_0x0378('0x37')][_0x0378('0x38')]?_0x1d81c3['attributes']:_0xef72b[_0x0378('0x36')];_0x1d81c3[_0x0378('0x3a')]=qs[_0x0378('0x3b')](_0x84cb8a[_0x0378('0x32')][_0x0378('0x3b')]);_0x1d81c3[_0x0378('0x3c')]=qs[_0x0378('0x34')](_['pick'](_0x84cb8a[_0x0378('0x32')],_0xef72b['filters']));if(_0x84cb8a[_0x0378('0x32')][_0x0378('0x40')]){_0x1d81c3['where']=_[_0x0378('0x3e')](_0x1d81c3['where'],{'$or':_[_0x0378('0x2d')](_0x1d81c3[_0x0378('0x37')],function(_0x2c82a9){var _0x503e0b={};_0x503e0b[_0x2c82a9]={'$like':'%'+_0x84cb8a[_0x0378('0x32')][_0x0378('0x40')]+'%'};return _0x503e0b;})});}_0x1d81c3=_[_0x0378('0x3e')]({},_0x1d81c3,_0x84cb8a['options']);return _0x567c72[_0x0378('0x50')](_0x1d81c3);}})[_0x0378('0x27')](function(_0x109e7a){if(_0x109e7a){_0x158898=_0x109e7a['length'];if(!_0x84cb8a[_0x0378('0x32')][_0x0378('0x52')](_0x0378('0x39'))){_0x1d81c3[_0x0378('0x20')]=qs[_0x0378('0x20')](_0x84cb8a[_0x0378('0x32')][_0x0378('0x20')]);_0x1d81c3['offset']=qs['offset'](_0x84cb8a[_0x0378('0x32')][_0x0378('0x1e')]);}return _0x567c72['getSubjects'](_0x1d81c3);}})[_0x0378('0x27')](function(_0xfc6c1e){if(_0xfc6c1e){return _0xfc6c1e?{'count':_0x158898,'rows':_0xfc6c1e}:null;}})[_0x0378('0x27')](respondWithResult(_0x53b68e,null))[_0x0378('0x46')](handleError(_0x53b68e,null));};exports[_0x0378('0x53')]=function(_0x45a623,_0x13eb6f,_0x164e9b){var _0x2312e7={};var _0x380cee={};var _0xa5bd49;var _0x455b3c;return db['ServicenowConfiguration'][_0x0378('0x4e')]({'where':{'id':_0x45a623[_0x0378('0x48')]['id']}})[_0x0378('0x27')](handleEntityNotFound(_0x13eb6f,null))[_0x0378('0x27')](function(_0x1e9774){if(_0x1e9774){_0xa5bd49=_0x1e9774;_0x380cee['model']=_['keys'](db[_0x0378('0x51')][_0x0378('0x2e')]);_0x380cee['query']=_[_0x0378('0x33')](_0x45a623[_0x0378('0x32')]);_0x380cee['filters']=_[_0x0378('0x35')](_0x380cee[_0x0378('0x36')],_0x380cee[_0x0378('0x32')]);_0x2312e7[_0x0378('0x37')]=_[_0x0378('0x35')](_0x380cee[_0x0378('0x36')],qs[_0x0378('0x49')](_0x45a623[_0x0378('0x32')][_0x0378('0x49')]));_0x2312e7[_0x0378('0x37')]=_0x2312e7[_0x0378('0x37')][_0x0378('0x38')]?_0x2312e7[_0x0378('0x37')]:_0x380cee[_0x0378('0x36')];_0x2312e7[_0x0378('0x3a')]=qs[_0x0378('0x3b')](_0x45a623['query'][_0x0378('0x3b')]);_0x2312e7[_0x0378('0x3c')]=qs[_0x0378('0x34')](_[_0x0378('0x3d')](_0x45a623[_0x0378('0x32')],_0x380cee[_0x0378('0x34')]));if(_0x45a623[_0x0378('0x32')][_0x0378('0x40')]){_0x2312e7['where']=_[_0x0378('0x3e')](_0x2312e7[_0x0378('0x3c')],{'$or':_['map'](_0x2312e7[_0x0378('0x37')],function(_0x4138d6){var _0x55b0df={};_0x55b0df[_0x4138d6]={'$like':'%'+_0x45a623[_0x0378('0x32')][_0x0378('0x40')]+'%'};return _0x55b0df;})});}_0x2312e7=_[_0x0378('0x3e')]({},_0x2312e7,_0x45a623[_0x0378('0x4f')]);return _0xa5bd49[_0x0378('0x53')](_0x2312e7);}})['then'](function(_0x2db303){if(_0x2db303){_0x455b3c=_0x2db303[_0x0378('0x38')];if(!_0x45a623[_0x0378('0x32')][_0x0378('0x52')](_0x0378('0x39'))){_0x2312e7[_0x0378('0x20')]=qs['limit'](_0x45a623['query'][_0x0378('0x20')]);_0x2312e7[_0x0378('0x1e')]=qs['offset'](_0x45a623[_0x0378('0x32')][_0x0378('0x1e')]);}return _0xa5bd49[_0x0378('0x53')](_0x2312e7);}})['then'](function(_0x391a43){if(_0x391a43){return _0x391a43?{'count':_0x455b3c,'rows':_0x391a43}:null;}})['then'](respondWithResult(_0x13eb6f,null))[_0x0378('0x46')](handleError(_0x13eb6f,null));};
\ No newline at end of file
index e4078a0..5c1bbb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbee0=['moment','bluebird','request-promise','path','rimraf','define','ServicenowConfiguration','util','../../config/logger','api'];(function(_0x1b67f3,_0x32c6ae){var _0x433096=function(_0x59e730){while(--_0x59e730){_0x1b67f3['push'](_0x1b67f3['shift']());}};_0x433096(++_0x32c6ae);}(_0xbee0,0x147));var _0x0bee=function(_0x55a58b,_0x172547){_0x55a58b=_0x55a58b-0x0;var _0x1ba6ae=_0xbee0[_0x55a58b];return _0x1ba6ae;};'use strict';var _=require('lodash');var util=require(_0x0bee('0x0'));var logger=require(_0x0bee('0x1'))(_0x0bee('0x2'));var moment=require(_0x0bee('0x3'));var BPromise=require(_0x0bee('0x4'));var rp=require(_0x0bee('0x5'));var fs=require('fs');var path=require(_0x0bee('0x6'));var rimraf=require(_0x0bee('0x7'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0xd0c8f,_0xa3a091){return _0xd0c8f[_0x0bee('0x8')](_0x0bee('0x9'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7fea=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowConfiguration','int_servicenow_configurations','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7fea,0x149));var _0xa7fe=function(_0x30b7b9,_0x4b8758){_0x30b7b9=_0x30b7b9-0x0;var _0x172474=_0x7fea[_0x30b7b9];return _0x172474;};'use strict';var _=require('lodash');var util=require(_0xa7fe('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa7fe('0x1'));var BPromise=require(_0xa7fe('0x2'));var rp=require(_0xa7fe('0x3'));var fs=require('fs');var path=require(_0xa7fe('0x4'));var rimraf=require(_0xa7fe('0x5'));var config=require(_0xa7fe('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xa7fe('0x7')]=function(_0x2bcfad,_0x1fbc99){return _0x2bcfad[_0xa7fe('0x8')](_0xa7fe('0x9'),attributes,{'tableName':_0xa7fe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 511b2da..2d40a84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f0d=['client','request','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x58220b,_0x502089){var _0x2125a6=function(_0x41ab7d){while(--_0x41ab7d){_0x58220b['push'](_0x58220b['shift']());}};_0x2125a6(++_0x502089);}(_0x1f0d,0x165));var _0xd1f0=function(_0x2e658f,_0x384896){_0x2e658f=_0x2e658f-0x0;var _0x52c780=_0x1f0d[_0x2e658f];return _0x52c780;};'use strict';var _=require(_0xd1f0('0x0'));var util=require(_0xd1f0('0x1'));var moment=require(_0xd1f0('0x2'));var BPromise=require(_0xd1f0('0x3'));var rs=require(_0xd1f0('0x4'));var fs=require('fs');var Redis=require(_0xd1f0('0x5'));var db=require(_0xd1f0('0x6'))['db'];var utils=require(_0xd1f0('0x7'));var logger=require(_0xd1f0('0x8'))('rpc');var config=require(_0xd1f0('0x9'));var jayson=require(_0xd1f0('0xa'));var client=jayson[_0xd1f0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2525a4,_0x13e060,_0x4475ac){return new BPromise(function(_0x1acf66,_0x5b74ba){return client[_0xd1f0('0xc')](_0x2525a4,_0x4475ac)['then'](function(_0x33fd81){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x13e060,'request\x20sent');logger[_0xd1f0('0xd')](_0xd1f0('0xe'),_0x13e060,_0xd1f0('0xf'),JSON[_0xd1f0('0x10')](_0x33fd81));if(_0x33fd81[_0xd1f0('0x11')]){if(_0x33fd81[_0xd1f0('0x11')][_0xd1f0('0x12')]===0x1f4){logger[_0xd1f0('0x11')](_0xd1f0('0x13'),_0x13e060,_0x33fd81[_0xd1f0('0x11')]['message']);return _0x5b74ba(_0x33fd81['error'][_0xd1f0('0x14')]);}logger[_0xd1f0('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x13e060,_0x33fd81['error'][_0xd1f0('0x14')]);return _0x1acf66(_0x33fd81[_0xd1f0('0x11')]['message']);}else{logger[_0xd1f0('0x15')](_0xd1f0('0x13'),_0x13e060,_0xd1f0('0xf'));_0x1acf66(_0x33fd81['result']['message']);}})[_0xd1f0('0x16')](function(_0x4988f4){logger['error'](_0xd1f0('0x13'),_0x13e060,_0x4988f4);_0x5b74ba(_0x4988f4);});});}
\ No newline at end of file
+var _0x6f58=['request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x3d9acc,_0x1dc603){var _0x5cfb6c=function(_0x21ac5b){while(--_0x21ac5b){_0x3d9acc['push'](_0x3d9acc['shift']());}};_0x5cfb6c(++_0x1dc603);}(_0x6f58,0xaa));var _0x86f5=function(_0x4e4b4b,_0x3d42d0){_0x4e4b4b=_0x4e4b4b-0x0;var _0x15f6ab=_0x6f58[_0x4e4b4b];return _0x15f6ab;};'use strict';var _=require(_0x86f5('0x0'));var util=require(_0x86f5('0x1'));var moment=require(_0x86f5('0x2'));var BPromise=require(_0x86f5('0x3'));var rs=require(_0x86f5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x86f5('0x5'))(_0x86f5('0x6'));var config=require('../../config/environment');var jayson=require(_0x86f5('0x7'));var client=jayson[_0x86f5('0x8')][_0x86f5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5149ad,_0x407397,_0x11933e){return new BPromise(function(_0x56910b,_0x558eff){return client[_0x86f5('0xa')](_0x5149ad,_0x11933e)[_0x86f5('0xb')](function(_0x26cd28){logger[_0x86f5('0xc')](_0x86f5('0xd'),_0x407397,'request\x20sent');logger[_0x86f5('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x407397,_0x86f5('0xf'),JSON[_0x86f5('0x10')](_0x26cd28));if(_0x26cd28[_0x86f5('0x11')]){if(_0x26cd28[_0x86f5('0x11')][_0x86f5('0x12')]===0x1f4){logger[_0x86f5('0x11')](_0x86f5('0xd'),_0x407397,_0x26cd28[_0x86f5('0x11')]['message']);return _0x558eff(_0x26cd28[_0x86f5('0x11')][_0x86f5('0x13')]);}logger['error'](_0x86f5('0xd'),_0x407397,_0x26cd28[_0x86f5('0x11')][_0x86f5('0x13')]);return _0x56910b(_0x26cd28[_0x86f5('0x11')]['message']);}else{logger[_0x86f5('0xc')](_0x86f5('0xd'),_0x407397,_0x86f5('0xf'));_0x56910b(_0x26cd28['result'][_0x86f5('0x13')]);}})['catch'](function(_0x5dfc92){logger[_0x86f5('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x407397,_0x5dfc92);_0x558eff(_0x5dfc92);});});}
\ No newline at end of file
index 6d3f4e7..744ec9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2eca=['destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2eca,0x1f0));var _0xa2ec=function(_0x4670df,_0x433288){_0x4670df=_0x4670df-0x0;var _0x326082=_0x2eca[_0x4670df];return _0x326082;};'use strict';var multer=require(_0xa2ec('0x0'));var util=require(_0xa2ec('0x1'));var path=require('path');var timeout=require(_0xa2ec('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa2ec('0x3'));var auth=require(_0xa2ec('0x4'));var interaction=require(_0xa2ec('0x5'));var config=require('../../config/environment');var controller=require(_0xa2ec('0x6'));router[_0xa2ec('0x7')]('/',auth['isAuthenticated'](),controller[_0xa2ec('0x8')]);router[_0xa2ec('0x7')](_0xa2ec('0x9'),auth['isAuthenticated'](),controller[_0xa2ec('0xa')]);router[_0xa2ec('0xb')]('/',auth[_0xa2ec('0xc')](),controller[_0xa2ec('0xd')]);router[_0xa2ec('0xe')](_0xa2ec('0x9'),auth[_0xa2ec('0xc')](),controller[_0xa2ec('0xf')]);router[_0xa2ec('0x10')](_0xa2ec('0x9'),auth[_0xa2ec('0xc')](),controller[_0xa2ec('0x11')]);module[_0xa2ec('0x12')]=router;
\ No newline at end of file
+var _0x45f5=['index','/:id','post','isAuthenticated','create','put','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x45f5,0xe6));var _0x545f=function(_0x19bf5f,_0x1ca6b9){_0x19bf5f=_0x19bf5f-0x0;var _0x237efa=_0x45f5[_0x19bf5f];return _0x237efa;};'use strict';var multer=require(_0x545f('0x0'));var util=require(_0x545f('0x1'));var path=require(_0x545f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x545f('0x3')]();var fs_extra=require(_0x545f('0x4'));var auth=require(_0x545f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x545f('0x6'));var controller=require(_0x545f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x545f('0x8')]);router['get'](_0x545f('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x545f('0xa')]('/',auth[_0x545f('0xb')](),controller[_0x545f('0xc')]);router[_0x545f('0xd')](_0x545f('0x9'),auth[_0x545f('0xb')](),controller[_0x545f('0xe')]);router['delete']('/:id',auth[_0x545f('0xb')](),controller[_0x545f('0xf')]);module[_0x545f('0x10')]=router;
\ No newline at end of file
index 0ef0090..adc968e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4570=['picklist','STRING','variable','customVariable','BOOLEAN','ENUM','string'];(function(_0x3ab5bc,_0x18c97c){var _0x1fa5cc=function(_0x11beca){while(--_0x11beca){_0x3ab5bc['push'](_0x3ab5bc['shift']());}};_0x1fa5cc(++_0x18c97c);}(_0x4570,0x7c));var _0x0457=function(_0x3c0c96,_0x449674){_0x3c0c96=_0x3c0c96-0x0;var _0x1780ec=_0x4570[_0x3c0c96];return _0x1780ec;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x0457('0x0')](_0x0457('0x1'),'variable','customVariable','keyValue',_0x0457('0x2')),'defaultValue':_0x0457('0x1')},'content':{'type':Sequelize[_0x0457('0x3')]},'key':{'type':Sequelize[_0x0457('0x3')]},'keyType':{'type':Sequelize['ENUM'](_0x0457('0x1'),_0x0457('0x4'),_0x0457('0x5'))},'keyContent':{'type':Sequelize[_0x0457('0x3')]},'idField':{'type':Sequelize[_0x0457('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0457('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0457('0x3')]}};
\ No newline at end of file
+var _0x06d5=['exports','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x06d5,0x1dc));var _0x506d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x06d5[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x506d('0x0'));module[_0x506d('0x1')]={'type':{'type':Sequelize[_0x506d('0x2')](_0x506d('0x3'),_0x506d('0x4'),_0x506d('0x5'),'keyValue',_0x506d('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x506d('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x506d('0x3'),_0x506d('0x4'),_0x506d('0x5'))},'keyContent':{'type':Sequelize[_0x506d('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x506d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 46ff45d..c5cfc60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b8f=['attributes','order','sort','where','pick','filter','merge','ServicenowField','catch','show','params','rawAttributes','includeAll','include','options','create','update','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','then','error','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields'];(function(_0xfa8fec,_0x1c1fa3){var _0x4f88f8=function(_0x3fef54){while(--_0x3fef54){_0xfa8fec['push'](_0xfa8fec['shift']());}};_0x4f88f8(++_0x1c1fa3);}(_0x1b8f,0xec));var _0xf1b8=function(_0x800a76,_0xae3a37){_0x800a76=_0x800a76-0x0;var _0x52f862=_0x1b8f[_0x800a76];return _0x52f862;};'use strict';var emlformat=require(_0xf1b8('0x0'));var rimraf=require(_0xf1b8('0x1'));var zipdir=require(_0xf1b8('0x2'));var jsonpatch=require(_0xf1b8('0x3'));var rp=require(_0xf1b8('0x4'));var moment=require(_0xf1b8('0x5'));var BPromise=require(_0xf1b8('0x6'));var Mustache=require(_0xf1b8('0x7'));var util=require(_0xf1b8('0x8'));var path=require(_0xf1b8('0x9'));var sox=require(_0xf1b8('0xa'));var csv=require(_0xf1b8('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf1b8('0xc'));var _=require(_0xf1b8('0xd'));var squel=require(_0xf1b8('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf1b8('0xf'));var toCsv=require(_0xf1b8('0xb'));var querystring=require(_0xf1b8('0x10'));var Papa=require(_0xf1b8('0x11'));var Redis=require(_0xf1b8('0x12'));var authService=require(_0xf1b8('0x13'));var qs=require(_0xf1b8('0x14'));var as=require(_0xf1b8('0x15'));var hardwareService=require(_0xf1b8('0x16'));var logger=require(_0xf1b8('0x17'))(_0xf1b8('0x18'));var utils=require(_0xf1b8('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x281eed,_0x3708a0){_0x3708a0=_0x3708a0||0xcc;return function(_0x5d48b0){if(_0x5d48b0){return _0x281eed[_0xf1b8('0x1a')](_0x3708a0);}return _0x281eed['status'](_0x3708a0)[_0xf1b8('0x1b')]();};}function respondWithResult(_0x59d042,_0x3c3c49){_0x3c3c49=_0x3c3c49||0xc8;return function(_0x51787e){if(_0x51787e){return _0x59d042['status'](_0x3c3c49)[_0xf1b8('0x1c')](_0x51787e);}};}function respondWithFilteredResult(_0x16faef,_0x286537){return function(_0x228c94){if(_0x228c94){var _0x3401e4=typeof _0x286537[_0xf1b8('0x1d')]===_0xf1b8('0x1e')&&typeof _0x286537[_0xf1b8('0x1f')]===_0xf1b8('0x1e');var _0x4379df=_0x228c94[_0xf1b8('0x20')];var _0x4f727e=_0x3401e4?0x0:_0x286537[_0xf1b8('0x1d')];var _0x4b63dc=_0x3401e4?_0x228c94[_0xf1b8('0x20')]:_0x286537['offset']+_0x286537[_0xf1b8('0x1f')];var _0x240de9;if(_0x4b63dc>=_0x4379df){_0x4b63dc=_0x4379df;_0x240de9=0xc8;}else{_0x240de9=0xce;}_0x16faef[_0xf1b8('0x21')](_0x240de9);return _0x16faef[_0xf1b8('0x22')](_0xf1b8('0x23'),_0x4f727e+'-'+_0x4b63dc+'/'+_0x4379df)[_0xf1b8('0x1c')](_0x228c94);}return null;};}function patchUpdates(_0x4029a5){return function(_0x1941ba){try{jsonpatch[_0xf1b8('0x24')](_0x1941ba,_0x4029a5,!![]);}catch(_0x5f0bf3){return BPromise[_0xf1b8('0x25')](_0x5f0bf3);}return _0x1941ba['save']();};}function saveUpdates(_0x2aebc1,_0x2808ac){return function(_0x467c01){if(_0x467c01){return _0x467c01['update'](_0x2aebc1)['then'](function(_0x4eb786){return _0x4eb786;});}return null;};}function removeEntity(_0xd725a4,_0xb42cb9){return function(_0x25af6e){if(_0x25af6e){return _0x25af6e['destroy']()[_0xf1b8('0x26')](function(){_0xd725a4[_0xf1b8('0x21')](0xcc)[_0xf1b8('0x1b')]();});}};}function handleEntityNotFound(_0x3e6ef0,_0x425026){return function(_0x108df7){if(!_0x108df7){_0x3e6ef0[_0xf1b8('0x1a')](0x194);}return _0x108df7;};}function handleError(_0x55bd27,_0x4e9116){_0x4e9116=_0x4e9116||0x1f4;return function(_0x2e9750){logger[_0xf1b8('0x27')](_0x2e9750['stack']);if(_0x2e9750[_0xf1b8('0x28')]){delete _0x2e9750[_0xf1b8('0x28')];}_0x55bd27[_0xf1b8('0x21')](_0x4e9116)['send'](_0x2e9750);};}exports[_0xf1b8('0x29')]=function(_0x38d669,_0x1cf44f){var _0x5e3ed={},_0x145845={},_0x2fa88f={'count':0x0,'rows':[]};var _0x2ddc52=_[_0xf1b8('0x2a')](db['ServicenowField']['rawAttributes'],function(_0x5845dc){return{'name':_0x5845dc[_0xf1b8('0x2b')],'type':_0x5845dc[_0xf1b8('0x2c')][_0xf1b8('0x2d')]};});_0x145845[_0xf1b8('0x2e')]=_[_0xf1b8('0x2a')](_0x2ddc52,_0xf1b8('0x28'));_0x145845[_0xf1b8('0x2f')]=_[_0xf1b8('0x30')](_0x38d669[_0xf1b8('0x2f')]);_0x145845[_0xf1b8('0x31')]=_[_0xf1b8('0x32')](_0x145845[_0xf1b8('0x2e')],_0x145845[_0xf1b8('0x2f')]);_0x5e3ed['attributes']=_[_0xf1b8('0x32')](_0x145845[_0xf1b8('0x2e')],qs[_0xf1b8('0x33')](_0x38d669[_0xf1b8('0x2f')][_0xf1b8('0x33')]));_0x5e3ed[_0xf1b8('0x34')]=_0x5e3ed[_0xf1b8('0x34')]['length']?_0x5e3ed[_0xf1b8('0x34')]:_0x145845['model'];if(!_0x38d669['query']['hasOwnProperty']('nolimit')){_0x5e3ed[_0xf1b8('0x1f')]=qs[_0xf1b8('0x1f')](_0x38d669['query']['limit']);_0x5e3ed['offset']=qs[_0xf1b8('0x1d')](_0x38d669[_0xf1b8('0x2f')][_0xf1b8('0x1d')]);}_0x5e3ed[_0xf1b8('0x35')]=qs['sort'](_0x38d669[_0xf1b8('0x2f')][_0xf1b8('0x36')]);_0x5e3ed[_0xf1b8('0x37')]=qs['filters'](_[_0xf1b8('0x38')](_0x38d669[_0xf1b8('0x2f')],_0x145845[_0xf1b8('0x31')]),_0x2ddc52);if(_0x38d669[_0xf1b8('0x2f')][_0xf1b8('0x39')]){_0x5e3ed[_0xf1b8('0x37')]=_['merge'](_0x5e3ed[_0xf1b8('0x37')],{'$or':_[_0xf1b8('0x2a')](_0x2ddc52,function(_0x508e50){if(_0x508e50[_0xf1b8('0x2c')]!=='VIRTUAL'){var _0x123bf4={};_0x123bf4[_0x508e50['name']]={'$like':'%'+_0x38d669[_0xf1b8('0x2f')][_0xf1b8('0x39')]+'%'};return _0x123bf4;}})});}_0x5e3ed=_[_0xf1b8('0x3a')]({},_0x5e3ed,_0x38d669['options']);var _0x565d35={'where':_0x5e3ed['where']};return db[_0xf1b8('0x3b')]['count'](_0x565d35)['then'](function(_0x337af8){_0x2fa88f[_0xf1b8('0x20')]=_0x337af8;if(_0x38d669[_0xf1b8('0x2f')]['includeAll']){_0x5e3ed['include']=[{'all':!![]}];}return db[_0xf1b8('0x3b')]['findAll'](_0x5e3ed);})['then'](function(_0xf3a78e){_0x2fa88f['rows']=_0xf3a78e;return _0x2fa88f;})[_0xf1b8('0x26')](respondWithFilteredResult(_0x1cf44f,_0x5e3ed))[_0xf1b8('0x3c')](handleError(_0x1cf44f,null));};exports[_0xf1b8('0x3d')]=function(_0x329a1d,_0x20f49a){var _0x4f1d3e={'raw':!![],'where':{'id':_0x329a1d[_0xf1b8('0x3e')]['id']}},_0x5b072b={};_0x5b072b['model']=_[_0xf1b8('0x30')](db[_0xf1b8('0x3b')][_0xf1b8('0x3f')]);_0x5b072b[_0xf1b8('0x2f')]=_['keys'](_0x329a1d[_0xf1b8('0x2f')]);_0x5b072b[_0xf1b8('0x31')]=_[_0xf1b8('0x32')](_0x5b072b['model'],_0x5b072b[_0xf1b8('0x2f')]);_0x4f1d3e[_0xf1b8('0x34')]=_[_0xf1b8('0x32')](_0x5b072b['model'],qs[_0xf1b8('0x33')](_0x329a1d['query'][_0xf1b8('0x33')]));_0x4f1d3e[_0xf1b8('0x34')]=_0x4f1d3e[_0xf1b8('0x34')]['length']?_0x4f1d3e[_0xf1b8('0x34')]:_0x5b072b[_0xf1b8('0x2e')];if(_0x329a1d[_0xf1b8('0x2f')][_0xf1b8('0x40')]){_0x4f1d3e[_0xf1b8('0x41')]=[{'all':!![]}];}_0x4f1d3e=_[_0xf1b8('0x3a')]({},_0x4f1d3e,_0x329a1d[_0xf1b8('0x42')]);return db['ServicenowField']['find'](_0x4f1d3e)[_0xf1b8('0x26')](handleEntityNotFound(_0x20f49a,null))['then'](respondWithResult(_0x20f49a,null))[_0xf1b8('0x3c')](handleError(_0x20f49a,null));};exports['create']=function(_0x3b1265,_0x4a77ae){return db[_0xf1b8('0x3b')][_0xf1b8('0x43')](_0x3b1265['body'],{})[_0xf1b8('0x26')](respondWithResult(_0x4a77ae,0xc9))[_0xf1b8('0x3c')](handleError(_0x4a77ae,null));};exports[_0xf1b8('0x44')]=function(_0x21a29c,_0x4a3e76){if(_0x21a29c[_0xf1b8('0x45')]['id']){delete _0x21a29c['body']['id'];}return db[_0xf1b8('0x3b')][_0xf1b8('0x46')]({'where':{'id':_0x21a29c[_0xf1b8('0x3e')]['id']}})[_0xf1b8('0x26')](handleEntityNotFound(_0x4a3e76,null))[_0xf1b8('0x26')](saveUpdates(_0x21a29c[_0xf1b8('0x45')],null))[_0xf1b8('0x26')](respondWithResult(_0x4a3e76,null))[_0xf1b8('0x3c')](handleError(_0x4a3e76,null));};exports[_0xf1b8('0x47')]=function(_0x426d40,_0x53978c){return db['ServicenowField'][_0xf1b8('0x46')]({'where':{'id':_0x426d40[_0xf1b8('0x3e')]['id']}})[_0xf1b8('0x26')](handleEntityNotFound(_0x53978c,null))[_0xf1b8('0x26')](removeEntity(_0x53978c,null))[_0xf1b8('0x3c')](handleError(_0x53978c,null));};
\ No newline at end of file
+var _0xceae=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','ServicenowField','rawAttributes','key','keys','filters','intersection','query','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','params','length','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x1114e9,_0x25323e){var _0x4603d0=function(_0x307041){while(--_0x307041){_0x1114e9['push'](_0x1114e9['shift']());}};_0x4603d0(++_0x25323e);}(_0xceae,0x171));var _0xecea=function(_0x134448,_0x591d7b){_0x134448=_0x134448-0x0;var _0x2d52a1=_0xceae[_0x134448];return _0x2d52a1;};'use strict';var emlformat=require(_0xecea('0x0'));var rimraf=require(_0xecea('0x1'));var zipdir=require(_0xecea('0x2'));var jsonpatch=require(_0xecea('0x3'));var rp=require(_0xecea('0x4'));var moment=require(_0xecea('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xecea('0x6'));var util=require(_0xecea('0x7'));var path=require(_0xecea('0x8'));var sox=require('sox');var csv=require(_0xecea('0x9'));var ejs=require(_0xecea('0xa'));var fs=require('fs');var fs_extra=require(_0xecea('0xb'));var _=require(_0xecea('0xc'));var squel=require(_0xecea('0xd'));var crypto=require(_0xecea('0xe'));var jsforce=require(_0xecea('0xf'));var deskjs=require(_0xecea('0x10'));var toCsv=require(_0xecea('0x9'));var querystring=require(_0xecea('0x11'));var Papa=require(_0xecea('0x12'));var Redis=require(_0xecea('0x13'));var authService=require(_0xecea('0x14'));var qs=require(_0xecea('0x15'));var as=require(_0xecea('0x16'));var hardwareService=require(_0xecea('0x17'));var logger=require('../../config/logger')(_0xecea('0x18'));var utils=require(_0xecea('0x19'));var config=require(_0xecea('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xecea('0x1b'))['db'];function respondWithStatusCode(_0x5c41c1,_0x1976b9){_0x1976b9=_0x1976b9||0xcc;return function(_0x4b14a8){if(_0x4b14a8){return _0x5c41c1['sendStatus'](_0x1976b9);}return _0x5c41c1[_0xecea('0x1c')](_0x1976b9)[_0xecea('0x1d')]();};}function respondWithResult(_0x3aec03,_0xfd994c){_0xfd994c=_0xfd994c||0xc8;return function(_0x22786e){if(_0x22786e){return _0x3aec03['status'](_0xfd994c)[_0xecea('0x1e')](_0x22786e);}};}function respondWithFilteredResult(_0x1e527a,_0x590356){return function(_0x4746de){if(_0x4746de){var _0x573c1e=typeof _0x590356[_0xecea('0x1f')]===_0xecea('0x20')&&typeof _0x590356[_0xecea('0x21')]===_0xecea('0x20');var _0x7aad07=_0x4746de[_0xecea('0x22')];var _0x17bc95=_0x573c1e?0x0:_0x590356[_0xecea('0x1f')];var _0x42e9ee=_0x573c1e?_0x4746de[_0xecea('0x22')]:_0x590356[_0xecea('0x1f')]+_0x590356[_0xecea('0x21')];var _0x560d62;if(_0x42e9ee>=_0x7aad07){_0x42e9ee=_0x7aad07;_0x560d62=0xc8;}else{_0x560d62=0xce;}_0x1e527a[_0xecea('0x1c')](_0x560d62);return _0x1e527a[_0xecea('0x23')](_0xecea('0x24'),_0x17bc95+'-'+_0x42e9ee+'/'+_0x7aad07)[_0xecea('0x1e')](_0x4746de);}return null;};}function patchUpdates(_0x35487d){return function(_0x2dd4f2){try{jsonpatch['apply'](_0x2dd4f2,_0x35487d,!![]);}catch(_0x4e9df1){return BPromise[_0xecea('0x25')](_0x4e9df1);}return _0x2dd4f2[_0xecea('0x26')]();};}function saveUpdates(_0x1287a6,_0x21b042){return function(_0x186ad5){if(_0x186ad5){return _0x186ad5[_0xecea('0x27')](_0x1287a6)['then'](function(_0x3322af){return _0x3322af;});}return null;};}function removeEntity(_0xe59eb4,_0x4f863e){return function(_0x5b5928){if(_0x5b5928){return _0x5b5928[_0xecea('0x28')]()[_0xecea('0x29')](function(){_0xe59eb4['status'](0xcc)[_0xecea('0x1d')]();});}};}function handleEntityNotFound(_0x2f5a28,_0x8471a9){return function(_0x5b8662){if(!_0x5b8662){_0x2f5a28[_0xecea('0x2a')](0x194);}return _0x5b8662;};}function handleError(_0x4939ba,_0x355523){_0x355523=_0x355523||0x1f4;return function(_0x29f7a5){logger['error'](_0x29f7a5[_0xecea('0x2b')]);if(_0x29f7a5[_0xecea('0x2c')]){delete _0x29f7a5[_0xecea('0x2c')];}_0x4939ba['status'](_0x355523)[_0xecea('0x2d')](_0x29f7a5);};}exports[_0xecea('0x2e')]=function(_0x289bad,_0x1dfab4){var _0x5629ee={},_0x16330d={},_0x504f8d={'count':0x0,'rows':[]};var _0x5aadc3=_[_0xecea('0x2f')](db[_0xecea('0x30')][_0xecea('0x31')],function(_0x58ef8e){return{'name':_0x58ef8e['fieldName'],'type':_0x58ef8e['type'][_0xecea('0x32')]};});_0x16330d['model']=_[_0xecea('0x2f')](_0x5aadc3,'name');_0x16330d['query']=_[_0xecea('0x33')](_0x289bad['query']);_0x16330d[_0xecea('0x34')]=_[_0xecea('0x35')](_0x16330d['model'],_0x16330d[_0xecea('0x36')]);_0x5629ee[_0xecea('0x37')]=_['intersection'](_0x16330d[_0xecea('0x38')],qs[_0xecea('0x39')](_0x289bad[_0xecea('0x36')][_0xecea('0x39')]));_0x5629ee[_0xecea('0x37')]=_0x5629ee[_0xecea('0x37')]['length']?_0x5629ee['attributes']:_0x16330d['model'];if(!_0x289bad['query'][_0xecea('0x3a')](_0xecea('0x3b'))){_0x5629ee[_0xecea('0x21')]=qs[_0xecea('0x21')](_0x289bad[_0xecea('0x36')][_0xecea('0x21')]);_0x5629ee[_0xecea('0x1f')]=qs['offset'](_0x289bad['query'][_0xecea('0x1f')]);}_0x5629ee[_0xecea('0x3c')]=qs['sort'](_0x289bad[_0xecea('0x36')][_0xecea('0x3d')]);_0x5629ee[_0xecea('0x3e')]=qs[_0xecea('0x34')](_['pick'](_0x289bad[_0xecea('0x36')],_0x16330d[_0xecea('0x34')]),_0x5aadc3);if(_0x289bad[_0xecea('0x36')]['filter']){_0x5629ee[_0xecea('0x3e')]=_[_0xecea('0x3f')](_0x5629ee['where'],{'$or':_['map'](_0x5aadc3,function(_0x58be98){if(_0x58be98[_0xecea('0x40')]!==_0xecea('0x41')){var _0x7576dc={};_0x7576dc[_0x58be98[_0xecea('0x2c')]]={'$like':'%'+_0x289bad[_0xecea('0x36')][_0xecea('0x42')]+'%'};return _0x7576dc;}})});}_0x5629ee=_[_0xecea('0x3f')]({},_0x5629ee,_0x289bad[_0xecea('0x43')]);var _0x46afb9={'where':_0x5629ee['where']};return db['ServicenowField'][_0xecea('0x22')](_0x46afb9)[_0xecea('0x29')](function(_0x3c595e){_0x504f8d[_0xecea('0x22')]=_0x3c595e;if(_0x289bad['query'][_0xecea('0x44')]){_0x5629ee[_0xecea('0x45')]=[{'all':!![]}];}return db[_0xecea('0x30')][_0xecea('0x46')](_0x5629ee);})['then'](function(_0x1d95b6){_0x504f8d['rows']=_0x1d95b6;return _0x504f8d;})[_0xecea('0x29')](respondWithFilteredResult(_0x1dfab4,_0x5629ee))['catch'](handleError(_0x1dfab4,null));};exports['show']=function(_0x1e6c96,_0x5914d0){var _0x597485={'raw':!![],'where':{'id':_0x1e6c96[_0xecea('0x47')]['id']}},_0x2834a7={};_0x2834a7[_0xecea('0x38')]=_[_0xecea('0x33')](db[_0xecea('0x30')][_0xecea('0x31')]);_0x2834a7['query']=_[_0xecea('0x33')](_0x1e6c96[_0xecea('0x36')]);_0x2834a7['filters']=_[_0xecea('0x35')](_0x2834a7[_0xecea('0x38')],_0x2834a7['query']);_0x597485[_0xecea('0x37')]=_[_0xecea('0x35')](_0x2834a7[_0xecea('0x38')],qs[_0xecea('0x39')](_0x1e6c96[_0xecea('0x36')]['fields']));_0x597485[_0xecea('0x37')]=_0x597485['attributes'][_0xecea('0x48')]?_0x597485[_0xecea('0x37')]:_0x2834a7['model'];if(_0x1e6c96[_0xecea('0x36')][_0xecea('0x44')]){_0x597485[_0xecea('0x45')]=[{'all':!![]}];}_0x597485=_[_0xecea('0x3f')]({},_0x597485,_0x1e6c96['options']);return db[_0xecea('0x30')]['find'](_0x597485)[_0xecea('0x29')](handleEntityNotFound(_0x5914d0,null))['then'](respondWithResult(_0x5914d0,null))[_0xecea('0x49')](handleError(_0x5914d0,null));};exports['create']=function(_0x2408b4,_0x4d3f6b){return db[_0xecea('0x30')][_0xecea('0x4a')](_0x2408b4[_0xecea('0x4b')],{})[_0xecea('0x29')](respondWithResult(_0x4d3f6b,0xc9))[_0xecea('0x49')](handleError(_0x4d3f6b,null));};exports[_0xecea('0x27')]=function(_0x43f180,_0x554fe9){if(_0x43f180[_0xecea('0x4b')]['id']){delete _0x43f180[_0xecea('0x4b')]['id'];}return db[_0xecea('0x30')][_0xecea('0x4c')]({'where':{'id':_0x43f180[_0xecea('0x47')]['id']}})['then'](handleEntityNotFound(_0x554fe9,null))[_0xecea('0x29')](saveUpdates(_0x43f180[_0xecea('0x4b')],null))[_0xecea('0x29')](respondWithResult(_0x554fe9,null))[_0xecea('0x49')](handleError(_0x554fe9,null));};exports[_0xecea('0x28')]=function(_0xdcee3e,_0x4f1b5e){return db[_0xecea('0x30')][_0xecea('0x4c')]({'where':{'id':_0xdcee3e[_0xecea('0x47')]['id']}})[_0xecea('0x29')](handleEntityNotFound(_0x4f1b5e,null))[_0xecea('0x29')](removeEntity(_0x4f1b5e,null))[_0xecea('0x49')](handleError(_0x4f1b5e,null));};
\ No newline at end of file
index 586f0f4..97573bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49da=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','util','../../config/logger','api'];(function(_0x1e1020,_0xd64a27){var _0x464719=function(_0x376ffa){while(--_0x376ffa){_0x1e1020['push'](_0x1e1020['shift']());}};_0x464719(++_0xd64a27);}(_0x49da,0xea));var _0xa49d=function(_0x2be883,_0xe818d5){_0x2be883=_0x2be883-0x0;var _0x1074da=_0x49da[_0x2be883];return _0x1074da;};'use strict';var _=require(_0xa49d('0x0'));var util=require(_0xa49d('0x1'));var logger=require(_0xa49d('0x2'))(_0xa49d('0x3'));var moment=require(_0xa49d('0x4'));var BPromise=require(_0xa49d('0x5'));var rp=require(_0xa49d('0x6'));var fs=require('fs');var path=require(_0xa49d('0x7'));var rimraf=require(_0xa49d('0x8'));var config=require(_0xa49d('0x9'));var attributes=require(_0xa49d('0xa'));module['exports']=function(_0x4dd7d1,_0x22479c){return _0x4dd7d1['define']('ServicenowField',attributes,{'tableName':_0xa49d('0xb'),'paranoid':![],'indexes':[{'name':_0xa49d('0xc'),'fields':['idField',_0xa49d('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0923=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField','lodash'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0923,0x110));var _0x3092=function(_0x503a88,_0x3f2d90){_0x503a88=_0x503a88-0x0;var _0x1c797b=_0x0923[_0x503a88];return _0x1c797b;};'use strict';var _=require(_0x3092('0x0'));var util=require('util');var logger=require(_0x3092('0x1'))(_0x3092('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3092('0x3'));var fs=require('fs');var path=require(_0x3092('0x4'));var rimraf=require(_0x3092('0x5'));var config=require(_0x3092('0x6'));var attributes=require(_0x3092('0x7'));module[_0x3092('0x8')]=function(_0x3f2c5d,_0x462ac6){return _0x3f2c5d[_0x3092('0x9')](_0x3092('0xa'),attributes,{'tableName':_0x3092('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x3092('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 33e6404..a3a790c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x541ea6,_0x51cab6){var _0x3c3e84=function(_0xc06bed){while(--_0xc06bed){_0x541ea6['push'](_0x541ea6['shift']());}};_0x3c3e84(++_0x51cab6);}(_0xda3f,0xec));var _0xfda3=function(_0x39ebb,_0x2f493a){_0x39ebb=_0x39ebb-0x0;var _0x1bc638=_0xda3f[_0x39ebb];return _0x1bc638;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}
\ No newline at end of file
+var _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(_0x4c29e4,_0x5dc161){var _0x18206b=function(_0xbb5956){while(--_0xbb5956){_0x4c29e4['push'](_0x4c29e4['shift']());}};_0x18206b(++_0x5dc161);}(_0xaa88,0x137));var _0x8aa8=function(_0x12a2a6,_0x374ff1){_0x12a2a6=_0x12a2a6-0x0;var _0x1754ae=_0xaa88[_0x12a2a6];return _0x1754ae;};'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 6756eb3..3fa3eb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x6b256c,_0xae3260){var _0x3cfef0=function(_0x3cb9a2){while(--_0x3cb9a2){_0x6b256c['push'](_0x6b256c['shift']());}};_0x3cfef0(++_0xae3260);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3edfe4,_0x3301ef){var _0x44572b=function(_0x33b5a0){while(--_0x33b5a0){_0x3edfe4['push'](_0x3edfe4['shift']());}};_0x44572b(++_0x3301ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 6c000b0..c2d3273 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x303200,_0x110ec1){var _0x569a2c=function(_0x350795){while(--_0x350795){_0x303200['push'](_0x303200['shift']());}};_0x569a2c(++_0x110ec1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x55eb41,_0x48f974){var _0x19c97f=function(_0x2367f0){while(--_0x2367f0){_0x55eb41['push'](_0x55eb41['shift']());}};_0x19c97f(++_0x48f974);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 8ab70a5..38ac4c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f66=['parent_type','parent_name','username','password','remoteUri','slice','substring','POST','format','%s%s','login','JSON','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','stringify','values','remove','includes','label','value','test','statusCode','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','SugarcrmAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','rows','catch','show','params','includeAll','find','create','body','update','findOne','SugarcrmConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','created_by','description','date_start','duration_hours','duration_minutes'];(function(_0x3006b1,_0x5535d7){var _0x3d6be2=function(_0x15eff8){while(--_0x15eff8){_0x3006b1['push'](_0x3006b1['shift']());}};_0x3d6be2(++_0x5535d7);}(_0x8f66,0x182));var _0x68f6=function(_0x20fa63,_0x65c8d3){_0x20fa63=_0x20fa63-0x0;var _0x4c37ae=_0x8f66[_0x20fa63];return _0x4c37ae;};'use strict';var emlformat=require(_0x68f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x68f6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x68f6('0x2'));var moment=require(_0x68f6('0x3'));var BPromise=require(_0x68f6('0x4'));var Mustache=require(_0x68f6('0x5'));var util=require(_0x68f6('0x6'));var path=require(_0x68f6('0x7'));var sox=require(_0x68f6('0x8'));var csv=require(_0x68f6('0x9'));var ejs=require(_0x68f6('0xa'));var fs=require('fs');var fs_extra=require(_0x68f6('0xb'));var _=require(_0x68f6('0xc'));var squel=require(_0x68f6('0xd'));var crypto=require(_0x68f6('0xe'));var jsforce=require(_0x68f6('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x68f6('0x10'));var Papa=require(_0x68f6('0x11'));var Redis=require(_0x68f6('0x12'));var authService=require(_0x68f6('0x13'));var qs=require(_0x68f6('0x14'));var as=require(_0x68f6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x68f6('0x16'))(_0x68f6('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x68f6('0x18'));var db=require(_0x68f6('0x19'))['db'];var integrations=require(_0x68f6('0x1a'));function respondWithStatusCode(_0x26394d,_0x408352){_0x408352=_0x408352||0xcc;return function(_0x4127c0){if(_0x4127c0){return _0x26394d['sendStatus'](_0x408352);}return _0x26394d['status'](_0x408352)[_0x68f6('0x1b')]();};}function respondWithResult(_0x51ce28,_0x111575){_0x111575=_0x111575||0xc8;return function(_0x5dcf39){if(_0x5dcf39){return _0x51ce28[_0x68f6('0x1c')](_0x111575)['json'](_0x5dcf39);}};}function respondWithFilteredResult(_0x5c5018,_0x5669a0){return function(_0x300e6b){if(_0x300e6b){var _0x2340e6=typeof _0x5669a0[_0x68f6('0x1d')]===_0x68f6('0x1e')&&typeof _0x5669a0['limit']===_0x68f6('0x1e');var _0x1dd0c0=_0x300e6b[_0x68f6('0x1f')];var _0x8033d2=_0x2340e6?0x0:_0x5669a0['offset'];var _0x6c1712=_0x2340e6?_0x300e6b[_0x68f6('0x1f')]:_0x5669a0[_0x68f6('0x1d')]+_0x5669a0[_0x68f6('0x20')];var _0xccd00e;if(_0x6c1712>=_0x1dd0c0){_0x6c1712=_0x1dd0c0;_0xccd00e=0xc8;}else{_0xccd00e=0xce;}_0x5c5018[_0x68f6('0x1c')](_0xccd00e);return _0x5c5018[_0x68f6('0x21')](_0x68f6('0x22'),_0x8033d2+'-'+_0x6c1712+'/'+_0x1dd0c0)[_0x68f6('0x23')](_0x300e6b);}return null;};}function patchUpdates(_0xb63611){return function(_0x1ac5ef){try{jsonpatch[_0x68f6('0x24')](_0x1ac5ef,_0xb63611,!![]);}catch(_0x5a2f5c){return BPromise[_0x68f6('0x25')](_0x5a2f5c);}return _0x1ac5ef[_0x68f6('0x26')]();};}function saveUpdates(_0x4d60e2,_0x5746d5){return function(_0x6c4de3){if(_0x6c4de3){return _0x6c4de3['update'](_0x4d60e2)[_0x68f6('0x27')](function(_0x4720f9){return _0x4720f9;});}return null;};}function removeEntity(_0x58fe03,_0x4e52f3){return function(_0x4e5601){if(_0x4e5601){return _0x4e5601[_0x68f6('0x28')]()[_0x68f6('0x27')](function(){_0x58fe03[_0x68f6('0x1c')](0xcc)[_0x68f6('0x1b')]();});}};}function handleEntityNotFound(_0x208569,_0x46c7b1){return function(_0x554d85){if(!_0x554d85){_0x208569[_0x68f6('0x29')](0x194);}return _0x554d85;};}function handleError(_0x5db435,_0xb7ebe9){_0xb7ebe9=_0xb7ebe9||0x1f4;return function(_0x2c2c3d){logger[_0x68f6('0x2a')](_0x2c2c3d[_0x68f6('0x2b')]);if(_0x2c2c3d[_0x68f6('0x2c')]){delete _0x2c2c3d[_0x68f6('0x2c')];}_0x5db435[_0x68f6('0x1c')](_0xb7ebe9)[_0x68f6('0x2d')](_0x2c2c3d);};}exports['index']=function(_0x4499a8,_0x8ea1b9){var _0x328449={},_0x2d81e5={},_0x1d476f={'count':0x0,'rows':[]};var _0x9987c9=_[_0x68f6('0x2e')](db[_0x68f6('0x2f')][_0x68f6('0x30')],function(_0x4eba47){return{'name':_0x4eba47[_0x68f6('0x31')],'type':_0x4eba47[_0x68f6('0x32')]['key']};});_0x2d81e5[_0x68f6('0x33')]=_[_0x68f6('0x2e')](_0x9987c9,'name');_0x2d81e5[_0x68f6('0x34')]=_[_0x68f6('0x35')](_0x4499a8['query']);_0x2d81e5[_0x68f6('0x36')]=_['intersection'](_0x2d81e5[_0x68f6('0x33')],_0x2d81e5['query']);_0x328449['attributes']=_[_0x68f6('0x37')](_0x2d81e5['model'],qs[_0x68f6('0x38')](_0x4499a8[_0x68f6('0x34')]['fields']));_0x328449['attributes']=_0x328449[_0x68f6('0x39')][_0x68f6('0x3a')]?_0x328449[_0x68f6('0x39')]:_0x2d81e5[_0x68f6('0x33')];if(!_0x4499a8[_0x68f6('0x34')][_0x68f6('0x3b')](_0x68f6('0x3c'))){_0x328449[_0x68f6('0x20')]=qs['limit'](_0x4499a8['query']['limit']);_0x328449[_0x68f6('0x1d')]=qs[_0x68f6('0x1d')](_0x4499a8[_0x68f6('0x34')][_0x68f6('0x1d')]);}_0x328449[_0x68f6('0x3d')]=qs[_0x68f6('0x3e')](_0x4499a8[_0x68f6('0x34')][_0x68f6('0x3e')]);_0x328449['where']=qs[_0x68f6('0x36')](_['pick'](_0x4499a8[_0x68f6('0x34')],_0x2d81e5[_0x68f6('0x36')]),_0x9987c9);if(_0x4499a8[_0x68f6('0x34')]['filter']){_0x328449[_0x68f6('0x3f')]=_[_0x68f6('0x40')](_0x328449[_0x68f6('0x3f')],{'$or':_[_0x68f6('0x2e')](_0x9987c9,function(_0x54f1ae){if(_0x54f1ae[_0x68f6('0x32')]!==_0x68f6('0x41')){var _0x1f22b3={};_0x1f22b3[_0x54f1ae[_0x68f6('0x2c')]]={'$like':'%'+_0x4499a8[_0x68f6('0x34')][_0x68f6('0x42')]+'%'};return _0x1f22b3;}})});}_0x328449=_[_0x68f6('0x40')]({},_0x328449,_0x4499a8[_0x68f6('0x43')]);var _0x1b2dba={'where':_0x328449[_0x68f6('0x3f')]};return db[_0x68f6('0x2f')][_0x68f6('0x1f')](_0x1b2dba)['then'](function(_0x462a86){_0x1d476f[_0x68f6('0x1f')]=_0x462a86;if(_0x4499a8[_0x68f6('0x34')]['includeAll']){_0x328449[_0x68f6('0x44')]=[{'all':!![]}];}return db[_0x68f6('0x2f')]['findAll'](_0x328449);})[_0x68f6('0x27')](function(_0x50c273){_0x1d476f[_0x68f6('0x45')]=_0x50c273;return _0x1d476f;})[_0x68f6('0x27')](respondWithFilteredResult(_0x8ea1b9,_0x328449))[_0x68f6('0x46')](handleError(_0x8ea1b9,null));};exports[_0x68f6('0x47')]=function(_0x3abc82,_0x48f20e){var _0x55a846={'raw':![],'where':{'id':_0x3abc82[_0x68f6('0x48')]['id']}},_0x1a720={};_0x1a720['model']=_['keys'](db[_0x68f6('0x2f')][_0x68f6('0x30')]);_0x1a720[_0x68f6('0x34')]=_['keys'](_0x3abc82[_0x68f6('0x34')]);_0x1a720[_0x68f6('0x36')]=_[_0x68f6('0x37')](_0x1a720['model'],_0x1a720[_0x68f6('0x34')]);_0x55a846['attributes']=_['intersection'](_0x1a720[_0x68f6('0x33')],qs[_0x68f6('0x38')](_0x3abc82[_0x68f6('0x34')][_0x68f6('0x38')]));_0x55a846[_0x68f6('0x39')]=_0x55a846[_0x68f6('0x39')][_0x68f6('0x3a')]?_0x55a846[_0x68f6('0x39')]:_0x1a720[_0x68f6('0x33')];if(_0x3abc82['query'][_0x68f6('0x49')]){_0x55a846['include']=[{'all':!![]}];}_0x55a846=_[_0x68f6('0x40')]({},_0x55a846,_0x3abc82[_0x68f6('0x43')]);return db[_0x68f6('0x2f')][_0x68f6('0x4a')](_0x55a846)[_0x68f6('0x27')](handleEntityNotFound(_0x48f20e,null))[_0x68f6('0x27')](respondWithResult(_0x48f20e,null))[_0x68f6('0x46')](handleError(_0x48f20e,null));};exports[_0x68f6('0x4b')]=function(_0x3584eb,_0x3c37ba){return db['SugarcrmAccount'][_0x68f6('0x4b')](_0x3584eb[_0x68f6('0x4c')],{})['then'](respondWithResult(_0x3c37ba,0xc9))[_0x68f6('0x46')](handleError(_0x3c37ba,null));};exports[_0x68f6('0x4d')]=function(_0x35db88,_0x4f7fd8){if(_0x35db88[_0x68f6('0x4c')]['id']){delete _0x35db88[_0x68f6('0x4c')]['id'];}return db['SugarcrmAccount'][_0x68f6('0x4a')]({'where':{'id':_0x35db88[_0x68f6('0x48')]['id']}})[_0x68f6('0x27')](handleEntityNotFound(_0x4f7fd8,null))[_0x68f6('0x27')](saveUpdates(_0x35db88[_0x68f6('0x4c')],null))[_0x68f6('0x27')](respondWithResult(_0x4f7fd8,null))['catch'](handleError(_0x4f7fd8,null));};exports['destroy']=function(_0x5cc553,_0x393eff){return db[_0x68f6('0x2f')]['find']({'where':{'id':_0x5cc553['params']['id']}})[_0x68f6('0x27')](handleEntityNotFound(_0x393eff,null))[_0x68f6('0x27')](removeEntity(_0x393eff,null))['catch'](handleError(_0x393eff,null));};exports['getConfigurations']=function(_0x1988ef,_0x4eef2c,_0x478297){var _0x5275a4={};var _0x2cf131={};var _0x33998a;var _0x1457c6;return db[_0x68f6('0x2f')][_0x68f6('0x4e')]({'where':{'id':_0x1988ef[_0x68f6('0x48')]['id']}})[_0x68f6('0x27')](handleEntityNotFound(_0x4eef2c,null))[_0x68f6('0x27')](function(_0x4b35cf){if(_0x4b35cf){_0x33998a=_0x4b35cf;_0x2cf131['model']=_[_0x68f6('0x35')](db[_0x68f6('0x4f')][_0x68f6('0x30')]);_0x2cf131[_0x68f6('0x34')]=_['keys'](_0x1988ef['query']);_0x2cf131[_0x68f6('0x36')]=_[_0x68f6('0x37')](_0x2cf131[_0x68f6('0x33')],_0x2cf131[_0x68f6('0x34')]);_0x5275a4['attributes']=_[_0x68f6('0x37')](_0x2cf131['model'],qs[_0x68f6('0x38')](_0x1988ef[_0x68f6('0x34')][_0x68f6('0x38')]));_0x5275a4[_0x68f6('0x39')]=_0x5275a4[_0x68f6('0x39')][_0x68f6('0x3a')]?_0x5275a4['attributes']:_0x2cf131[_0x68f6('0x33')];_0x5275a4[_0x68f6('0x3d')]=qs[_0x68f6('0x3e')](_0x1988ef[_0x68f6('0x34')][_0x68f6('0x3e')]);_0x5275a4[_0x68f6('0x3f')]=qs['filters'](_['pick'](_0x1988ef[_0x68f6('0x34')],_0x2cf131[_0x68f6('0x36')]));if(_0x1988ef[_0x68f6('0x34')][_0x68f6('0x42')]){_0x5275a4[_0x68f6('0x3f')]=_[_0x68f6('0x40')](_0x5275a4[_0x68f6('0x3f')],{'$or':_[_0x68f6('0x2e')](_0x5275a4['attributes'],function(_0x6ba3ec){var _0x2d7fe5={};_0x2d7fe5[_0x6ba3ec]={'$like':'%'+_0x1988ef['query'][_0x68f6('0x42')]+'%'};return _0x2d7fe5;})});}_0x5275a4=_[_0x68f6('0x40')]({},_0x5275a4,_0x1988ef[_0x68f6('0x43')]);return _0x33998a[_0x68f6('0x50')](_0x5275a4);}})['then'](function(_0x52ad13){if(_0x52ad13){_0x1457c6=_0x52ad13[_0x68f6('0x3a')];if(!_0x1988ef[_0x68f6('0x34')][_0x68f6('0x3b')]('nolimit')){_0x5275a4[_0x68f6('0x20')]=qs[_0x68f6('0x20')](_0x1988ef[_0x68f6('0x34')][_0x68f6('0x20')]);_0x5275a4['offset']=qs['offset'](_0x1988ef['query'][_0x68f6('0x1d')]);}return _0x33998a[_0x68f6('0x50')](_0x5275a4);}})[_0x68f6('0x27')](function(_0x45bb43){if(_0x45bb43){return _0x45bb43?{'count':_0x1457c6,'rows':_0x45bb43}:null;}})[_0x68f6('0x27')](respondWithResult(_0x4eef2c,null))[_0x68f6('0x46')](handleError(_0x4eef2c,null));};exports[_0x68f6('0x51')]=function(_0xcdad34,_0x2d47da,_0x3959f9){if(_0xcdad34[_0x68f6('0x4c')]['id']){delete _0xcdad34[_0x68f6('0x4c')]['id'];}return db[_0x68f6('0x2f')]['findOne']({'where':{'id':_0xcdad34['params']['id']}})[_0x68f6('0x27')](handleEntityNotFound(_0x2d47da,null))[_0x68f6('0x27')](function(_0x497d5c){if(_0x497d5c){_0xcdad34['body']['AccountId']=_0x497d5c['id'];_0xcdad34[_0x68f6('0x4c')][_0x68f6('0x52')]=integrations[_0x68f6('0x53')](_0xcdad34[_0x68f6('0x4c')][_0x68f6('0x54')],_0xcdad34[_0x68f6('0x4c')]['type']);_0xcdad34[_0x68f6('0x4c')][_0x68f6('0x55')]=integrations[_0x68f6('0x56')](_0xcdad34[_0x68f6('0x4c')][_0x68f6('0x54')],_0xcdad34[_0x68f6('0x4c')][_0x68f6('0x32')]);return db['SugarcrmConfiguration']['create'](_0xcdad34[_0x68f6('0x4c')],{'include':[{'model':db[_0x68f6('0x57')],'as':'Subjects'},{'model':db[_0x68f6('0x57')],'as':_0x68f6('0x55')}]});}return null;})[_0x68f6('0x27')](respondWithResult(_0x2d47da,null))[_0x68f6('0x46')](handleError(_0x2d47da,null));};exports[_0x68f6('0x58')]=function(_0x59fdbc,_0x5a8714,_0x227389){var _0x119ff7='';var _0x19db57=['id',_0x68f6('0x2c'),'assigned_user_id',_0x68f6('0x59'),_0x68f6('0x5a'),_0x68f6('0x5b'),_0x68f6('0x5c'),_0x68f6('0x5d'),'parent_id',_0x68f6('0x5e'),_0x68f6('0x5f'),'direction'];return db[_0x68f6('0x2f')]['findOne']({'where':{'id':_0x59fdbc[_0x68f6('0x48')]['id']},'attributes':['id',_0x68f6('0x60'),_0x68f6('0x61'),_0x68f6('0x62')]})['then'](handleEntityNotFound(_0x5a8714,null))[_0x68f6('0x27')](function(_0x22f4c9){if(_0x22f4c9){_0x119ff7=_0x22f4c9['remoteUri'];var _0x2e004e=_0x119ff7[_0x68f6('0x63')](-0x1);if(_0x2e004e==='/'){_0x119ff7=_0x119ff7[_0x68f6('0x64')](0x0,_0x119ff7['lastIndexOf'](_0x2e004e));}return rp({'method':_0x68f6('0x65'),'uri':util[_0x68f6('0x66')](_0x68f6('0x67'),_0x119ff7,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x68f6('0x68'),'input_type':'JSON','response_type':_0x68f6('0x69'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x22f4c9[_0x68f6('0x60')],'password':_0x22f4c9[_0x68f6('0x61')],'encryption':'PLAIN'},'application':_0x68f6('0x6a')})}});}})[_0x68f6('0x27')](function(_0x17eeab){if(_0x17eeab&&_0x17eeab[_0x68f6('0x2c')]!==_0x68f6('0x6b')&&_0x17eeab[_0x68f6('0x2c')]!==_0x68f6('0x6c')){return rp({'method':_0x68f6('0x65'),'uri':util[_0x68f6('0x66')](_0x68f6('0x67'),_0x119ff7,_0x68f6('0x6d')),'json':!![],'form':{'method':_0x68f6('0x6e'),'input_type':'JSON','response_type':_0x68f6('0x69'),'rest_data':JSON[_0x68f6('0x6f')]({'session':_0x17eeab['id'],'module_name':'Calls'})}})[_0x68f6('0x27')](function(_0x4a159f){if(_0x4a159f){var _0x19b366=_[_0x68f6('0x70')](_0x4a159f['module_fields']);_[_0x68f6('0x71')](_0x19b366,function(_0x47cb09){return _0x19db57[_0x68f6('0x72')](_0x47cb09[_0x68f6('0x2c')]);});return{'count':_0x19b366[_0x68f6('0x3a')],'rows':_[_0x68f6('0x2e')](_0x19b366,function(_0x5ec6dc){return{'id':_0x5ec6dc[_0x68f6('0x2c')],'name':_0x5ec6dc[_0x68f6('0x73')],'custom':_['endsWith'](_0x5ec6dc[_0x68f6('0x2c')],'_c')?!![]:![],'options':_0x5ec6dc['options']?_[_0x68f6('0x2e')](_[_0x68f6('0x70')](_0x5ec6dc['options']),function(_0xc8de95){return{'name':_0xc8de95[_0x68f6('0x74')],'value':_0xc8de95[_0x68f6('0x2c')]};}):[]};})};}})[_0x68f6('0x27')](respondWithResult(_0x5a8714,null))[_0x68f6('0x46')](function(_0x55d3a9){var _0x5a3e2d=_0x59fdbc[_0x68f6('0x34')][_0x68f6('0x75')]?0x1f4:_0x55d3a9[_0x68f6('0x76')]||0x1f4;logger[_0x68f6('0x2a')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5a3e2d,JSON[_0x68f6('0x6f')](_0x55d3a9));delete _0x55d3a9[_0x68f6('0x2c')];if(_0x5a3e2d===0x191){_0x5a3e2d=0x190;}_0x5a8714[_0x68f6('0x1c')](_0x5a3e2d)['send'](_0x59fdbc['query']['test']?{'message':_0x68f6('0x77'),'statusCode':_0x55d3a9[_0x68f6('0x76')]}:_0x55d3a9);});}else{var _0x3e9bf5=0x1f4;_0x5a8714[_0x68f6('0x1c')](_0x3e9bf5)[_0x68f6('0x2d')]({'message':_0x68f6('0x77'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0x9d55=['Subjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','assigned_user_id','created_by','description','date_start','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','xCALLY\x20Motion\x20Integration','format','get_module_fields','Calls','values','module_fields','remove','includes','endsWith','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','json','reject','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','type','VIRTUAL','options','where','includeAll','include','findAll','catch','show','params','find','create','body','getConfigurations','addConfiguration','findOne'];(function(_0x43941d,_0x45fd0d){var _0x27b82a=function(_0x21851e){while(--_0x21851e){_0x43941d['push'](_0x43941d['shift']());}};_0x27b82a(++_0x45fd0d);}(_0x9d55,0x9d));var _0x59d5=function(_0x43aa4a,_0x520a04){_0x43aa4a=_0x43aa4a-0x0;var _0x42cb09=_0x9d55[_0x43aa4a];return _0x42cb09;};'use strict';var emlformat=require(_0x59d5('0x0'));var rimraf=require(_0x59d5('0x1'));var zipdir=require(_0x59d5('0x2'));var jsonpatch=require(_0x59d5('0x3'));var rp=require(_0x59d5('0x4'));var moment=require(_0x59d5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x59d5('0x6'));var util=require(_0x59d5('0x7'));var path=require(_0x59d5('0x8'));var sox=require(_0x59d5('0x9'));var csv=require('to-csv');var ejs=require(_0x59d5('0xa'));var fs=require('fs');var fs_extra=require(_0x59d5('0xb'));var _=require(_0x59d5('0xc'));var squel=require(_0x59d5('0xd'));var crypto=require('crypto');var jsforce=require(_0x59d5('0xe'));var deskjs=require(_0x59d5('0xf'));var toCsv=require(_0x59d5('0x10'));var querystring=require(_0x59d5('0x11'));var Papa=require(_0x59d5('0x12'));var Redis=require(_0x59d5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x59d5('0x14'));var as=require(_0x59d5('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x59d5('0x16'))(_0x59d5('0x17'));var utils=require('../../config/utils');var config=require(_0x59d5('0x18'));var licenseUtil=require(_0x59d5('0x19'));var db=require(_0x59d5('0x1a'))['db'];var integrations=require(_0x59d5('0x1b'));function respondWithStatusCode(_0x28387b,_0x260e79){_0x260e79=_0x260e79||0xcc;return function(_0x2b6b1a){if(_0x2b6b1a){return _0x28387b[_0x59d5('0x1c')](_0x260e79);}return _0x28387b[_0x59d5('0x1d')](_0x260e79)[_0x59d5('0x1e')]();};}function respondWithResult(_0x34939d,_0x51b02d){_0x51b02d=_0x51b02d||0xc8;return function(_0x11ef80){if(_0x11ef80){return _0x34939d[_0x59d5('0x1d')](_0x51b02d)['json'](_0x11ef80);}};}function respondWithFilteredResult(_0x1aafa1,_0x3a9301){return function(_0x20f005){if(_0x20f005){var _0x3ed838=typeof _0x3a9301[_0x59d5('0x1f')]===_0x59d5('0x20')&&typeof _0x3a9301['limit']===_0x59d5('0x20');var _0x29e45d=_0x20f005[_0x59d5('0x21')];var _0x2a5096=_0x3ed838?0x0:_0x3a9301[_0x59d5('0x1f')];var _0x58fdff=_0x3ed838?_0x20f005['count']:_0x3a9301[_0x59d5('0x1f')]+_0x3a9301[_0x59d5('0x22')];var _0x5f1a89;if(_0x58fdff>=_0x29e45d){_0x58fdff=_0x29e45d;_0x5f1a89=0xc8;}else{_0x5f1a89=0xce;}_0x1aafa1['status'](_0x5f1a89);return _0x1aafa1['set']('Content-Range',_0x2a5096+'-'+_0x58fdff+'/'+_0x29e45d)[_0x59d5('0x23')](_0x20f005);}return null;};}function patchUpdates(_0x52baaf){return function(_0x263e97){try{jsonpatch['apply'](_0x263e97,_0x52baaf,!![]);}catch(_0x13e446){return BPromise[_0x59d5('0x24')](_0x13e446);}return _0x263e97[_0x59d5('0x25')]();};}function saveUpdates(_0x2c5a98,_0x24a500){return function(_0x1a8c6b){if(_0x1a8c6b){return _0x1a8c6b[_0x59d5('0x26')](_0x2c5a98)[_0x59d5('0x27')](function(_0x39e7e2){return _0x39e7e2;});}return null;};}function removeEntity(_0x482a24,_0x332283){return function(_0x543286){if(_0x543286){return _0x543286[_0x59d5('0x28')]()[_0x59d5('0x27')](function(){_0x482a24[_0x59d5('0x1d')](0xcc)[_0x59d5('0x1e')]();});}};}function handleEntityNotFound(_0x73ff6a,_0x3e4e52){return function(_0x458ecc){if(!_0x458ecc){_0x73ff6a['sendStatus'](0x194);}return _0x458ecc;};}function handleError(_0x525d12,_0x58d937){_0x58d937=_0x58d937||0x1f4;return function(_0x49afd8){logger[_0x59d5('0x29')](_0x49afd8[_0x59d5('0x2a')]);if(_0x49afd8[_0x59d5('0x2b')]){delete _0x49afd8[_0x59d5('0x2b')];}_0x525d12[_0x59d5('0x1d')](_0x58d937)[_0x59d5('0x2c')](_0x49afd8);};}exports[_0x59d5('0x2d')]=function(_0x2e3bf8,_0x153ca0){var _0x500827={},_0x3af610={},_0x2e7cc7={'count':0x0,'rows':[]};var _0x2baf4c=_[_0x59d5('0x2e')](db[_0x59d5('0x2f')][_0x59d5('0x30')],function(_0x29004d){return{'name':_0x29004d[_0x59d5('0x31')],'type':_0x29004d['type'][_0x59d5('0x32')]};});_0x3af610[_0x59d5('0x33')]=_[_0x59d5('0x2e')](_0x2baf4c,_0x59d5('0x2b'));_0x3af610[_0x59d5('0x34')]=_[_0x59d5('0x35')](_0x2e3bf8['query']);_0x3af610[_0x59d5('0x36')]=_[_0x59d5('0x37')](_0x3af610['model'],_0x3af610[_0x59d5('0x34')]);_0x500827[_0x59d5('0x38')]=_[_0x59d5('0x37')](_0x3af610[_0x59d5('0x33')],qs[_0x59d5('0x39')](_0x2e3bf8[_0x59d5('0x34')][_0x59d5('0x39')]));_0x500827['attributes']=_0x500827[_0x59d5('0x38')][_0x59d5('0x3a')]?_0x500827[_0x59d5('0x38')]:_0x3af610[_0x59d5('0x33')];if(!_0x2e3bf8['query'][_0x59d5('0x3b')](_0x59d5('0x3c'))){_0x500827[_0x59d5('0x22')]=qs[_0x59d5('0x22')](_0x2e3bf8[_0x59d5('0x34')]['limit']);_0x500827[_0x59d5('0x1f')]=qs['offset'](_0x2e3bf8['query']['offset']);}_0x500827['order']=qs[_0x59d5('0x3d')](_0x2e3bf8['query'][_0x59d5('0x3d')]);_0x500827['where']=qs['filters'](_[_0x59d5('0x3e')](_0x2e3bf8[_0x59d5('0x34')],_0x3af610[_0x59d5('0x36')]),_0x2baf4c);if(_0x2e3bf8['query'][_0x59d5('0x3f')]){_0x500827['where']=_[_0x59d5('0x40')](_0x500827['where'],{'$or':_['map'](_0x2baf4c,function(_0x171db5){if(_0x171db5[_0x59d5('0x41')]!==_0x59d5('0x42')){var _0x465359={};_0x465359[_0x171db5[_0x59d5('0x2b')]]={'$like':'%'+_0x2e3bf8[_0x59d5('0x34')][_0x59d5('0x3f')]+'%'};return _0x465359;}})});}_0x500827=_[_0x59d5('0x40')]({},_0x500827,_0x2e3bf8[_0x59d5('0x43')]);var _0x56574a={'where':_0x500827[_0x59d5('0x44')]};return db[_0x59d5('0x2f')][_0x59d5('0x21')](_0x56574a)[_0x59d5('0x27')](function(_0x164f07){_0x2e7cc7[_0x59d5('0x21')]=_0x164f07;if(_0x2e3bf8[_0x59d5('0x34')][_0x59d5('0x45')]){_0x500827[_0x59d5('0x46')]=[{'all':!![]}];}return db[_0x59d5('0x2f')][_0x59d5('0x47')](_0x500827);})[_0x59d5('0x27')](function(_0x3513d9){_0x2e7cc7['rows']=_0x3513d9;return _0x2e7cc7;})[_0x59d5('0x27')](respondWithFilteredResult(_0x153ca0,_0x500827))[_0x59d5('0x48')](handleError(_0x153ca0,null));};exports[_0x59d5('0x49')]=function(_0x3af7db,_0x9a25de){var _0x437a51={'raw':![],'where':{'id':_0x3af7db[_0x59d5('0x4a')]['id']}},_0x230049={};_0x230049[_0x59d5('0x33')]=_[_0x59d5('0x35')](db[_0x59d5('0x2f')]['rawAttributes']);_0x230049[_0x59d5('0x34')]=_['keys'](_0x3af7db[_0x59d5('0x34')]);_0x230049[_0x59d5('0x36')]=_[_0x59d5('0x37')](_0x230049[_0x59d5('0x33')],_0x230049[_0x59d5('0x34')]);_0x437a51[_0x59d5('0x38')]=_['intersection'](_0x230049[_0x59d5('0x33')],qs[_0x59d5('0x39')](_0x3af7db[_0x59d5('0x34')]['fields']));_0x437a51['attributes']=_0x437a51['attributes'][_0x59d5('0x3a')]?_0x437a51[_0x59d5('0x38')]:_0x230049['model'];if(_0x3af7db['query'][_0x59d5('0x45')]){_0x437a51['include']=[{'all':!![]}];}_0x437a51=_['merge']({},_0x437a51,_0x3af7db['options']);return db[_0x59d5('0x2f')][_0x59d5('0x4b')](_0x437a51)['then'](handleEntityNotFound(_0x9a25de,null))[_0x59d5('0x27')](respondWithResult(_0x9a25de,null))[_0x59d5('0x48')](handleError(_0x9a25de,null));};exports[_0x59d5('0x4c')]=function(_0x331b9c,_0x56b5d5){return db[_0x59d5('0x2f')][_0x59d5('0x4c')](_0x331b9c[_0x59d5('0x4d')],{})['then'](respondWithResult(_0x56b5d5,0xc9))[_0x59d5('0x48')](handleError(_0x56b5d5,null));};exports['update']=function(_0x397767,_0x5dbad2){if(_0x397767['body']['id']){delete _0x397767['body']['id'];}return db[_0x59d5('0x2f')][_0x59d5('0x4b')]({'where':{'id':_0x397767[_0x59d5('0x4a')]['id']}})[_0x59d5('0x27')](handleEntityNotFound(_0x5dbad2,null))[_0x59d5('0x27')](saveUpdates(_0x397767[_0x59d5('0x4d')],null))[_0x59d5('0x27')](respondWithResult(_0x5dbad2,null))[_0x59d5('0x48')](handleError(_0x5dbad2,null));};exports['destroy']=function(_0x18f064,_0x31a934){return db['SugarcrmAccount'][_0x59d5('0x4b')]({'where':{'id':_0x18f064['params']['id']}})[_0x59d5('0x27')](handleEntityNotFound(_0x31a934,null))[_0x59d5('0x27')](removeEntity(_0x31a934,null))['catch'](handleError(_0x31a934,null));};exports[_0x59d5('0x4e')]=function(_0x55b642,_0x169997,_0x14bb6c){var _0x3cefca={};var _0x33b916={};var _0x5aae94;var _0x193e2f;return db[_0x59d5('0x2f')]['findOne']({'where':{'id':_0x55b642[_0x59d5('0x4a')]['id']}})[_0x59d5('0x27')](handleEntityNotFound(_0x169997,null))[_0x59d5('0x27')](function(_0x425dda){if(_0x425dda){_0x5aae94=_0x425dda;_0x33b916['model']=_[_0x59d5('0x35')](db['SugarcrmConfiguration'][_0x59d5('0x30')]);_0x33b916['query']=_['keys'](_0x55b642[_0x59d5('0x34')]);_0x33b916[_0x59d5('0x36')]=_[_0x59d5('0x37')](_0x33b916[_0x59d5('0x33')],_0x33b916[_0x59d5('0x34')]);_0x3cefca[_0x59d5('0x38')]=_[_0x59d5('0x37')](_0x33b916['model'],qs['fields'](_0x55b642['query']['fields']));_0x3cefca[_0x59d5('0x38')]=_0x3cefca['attributes'][_0x59d5('0x3a')]?_0x3cefca['attributes']:_0x33b916[_0x59d5('0x33')];_0x3cefca['order']=qs[_0x59d5('0x3d')](_0x55b642[_0x59d5('0x34')][_0x59d5('0x3d')]);_0x3cefca[_0x59d5('0x44')]=qs[_0x59d5('0x36')](_[_0x59d5('0x3e')](_0x55b642[_0x59d5('0x34')],_0x33b916[_0x59d5('0x36')]));if(_0x55b642[_0x59d5('0x34')][_0x59d5('0x3f')]){_0x3cefca[_0x59d5('0x44')]=_[_0x59d5('0x40')](_0x3cefca['where'],{'$or':_[_0x59d5('0x2e')](_0x3cefca['attributes'],function(_0x5c02c0){var _0x340d3d={};_0x340d3d[_0x5c02c0]={'$like':'%'+_0x55b642[_0x59d5('0x34')][_0x59d5('0x3f')]+'%'};return _0x340d3d;})});}_0x3cefca=_['merge']({},_0x3cefca,_0x55b642[_0x59d5('0x43')]);return _0x5aae94[_0x59d5('0x4e')](_0x3cefca);}})[_0x59d5('0x27')](function(_0x274115){if(_0x274115){_0x193e2f=_0x274115['length'];if(!_0x55b642[_0x59d5('0x34')][_0x59d5('0x3b')](_0x59d5('0x3c'))){_0x3cefca['limit']=qs[_0x59d5('0x22')](_0x55b642[_0x59d5('0x34')]['limit']);_0x3cefca['offset']=qs[_0x59d5('0x1f')](_0x55b642[_0x59d5('0x34')]['offset']);}return _0x5aae94['getConfigurations'](_0x3cefca);}})[_0x59d5('0x27')](function(_0x309b43){if(_0x309b43){return _0x309b43?{'count':_0x193e2f,'rows':_0x309b43}:null;}})[_0x59d5('0x27')](respondWithResult(_0x169997,null))[_0x59d5('0x48')](handleError(_0x169997,null));};exports[_0x59d5('0x4f')]=function(_0x5d9093,_0x4223af,_0x475262){if(_0x5d9093[_0x59d5('0x4d')]['id']){delete _0x5d9093[_0x59d5('0x4d')]['id'];}return db[_0x59d5('0x2f')][_0x59d5('0x50')]({'where':{'id':_0x5d9093[_0x59d5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4223af,null))[_0x59d5('0x27')](function(_0x58778f){if(_0x58778f){_0x5d9093['body']['AccountId']=_0x58778f['id'];_0x5d9093[_0x59d5('0x4d')][_0x59d5('0x51')]=integrations['getSubjects'](_0x5d9093[_0x59d5('0x4d')][_0x59d5('0x52')],_0x5d9093[_0x59d5('0x4d')][_0x59d5('0x41')]);_0x5d9093['body'][_0x59d5('0x53')]=integrations[_0x59d5('0x54')](_0x5d9093[_0x59d5('0x4d')]['channel'],_0x5d9093[_0x59d5('0x4d')][_0x59d5('0x41')]);return db[_0x59d5('0x55')][_0x59d5('0x4c')](_0x5d9093['body'],{'include':[{'model':db[_0x59d5('0x56')],'as':_0x59d5('0x51')},{'model':db[_0x59d5('0x56')],'as':_0x59d5('0x53')}]});}return null;})[_0x59d5('0x27')](respondWithResult(_0x4223af,null))[_0x59d5('0x48')](handleError(_0x4223af,null));};exports['getFields']=function(_0x475cd8,_0x401695,_0x4bbcda){var _0x174850='';var _0x894b4e=['id',_0x59d5('0x2b'),_0x59d5('0x57'),_0x59d5('0x58'),_0x59d5('0x59'),_0x59d5('0x5a'),'duration_hours','duration_minutes','parent_id',_0x59d5('0x5b'),_0x59d5('0x5c'),_0x59d5('0x5d')];return db['SugarcrmAccount'][_0x59d5('0x50')]({'where':{'id':_0x475cd8['params']['id']},'attributes':['id',_0x59d5('0x5e'),_0x59d5('0x5f'),_0x59d5('0x60')]})['then'](handleEntityNotFound(_0x401695,null))[_0x59d5('0x27')](function(_0x3dbb1f){if(_0x3dbb1f){_0x174850=_0x3dbb1f[_0x59d5('0x60')];var _0x32c491=_0x174850[_0x59d5('0x61')](-0x1);if(_0x32c491==='/'){_0x174850=_0x174850[_0x59d5('0x62')](0x0,_0x174850[_0x59d5('0x63')](_0x32c491));}return rp({'method':_0x59d5('0x64'),'uri':util['format'](_0x59d5('0x65'),_0x174850,_0x59d5('0x66')),'json':!![],'form':{'method':_0x59d5('0x67'),'input_type':_0x59d5('0x68'),'response_type':_0x59d5('0x68'),'rest_data':JSON[_0x59d5('0x69')]({'user_auth':{'user_name':_0x3dbb1f[_0x59d5('0x5e')],'password':_0x3dbb1f['password'],'encryption':'PLAIN'},'application':_0x59d5('0x6a')})}});}})[_0x59d5('0x27')](function(_0x5b60c1){if(_0x5b60c1&&_0x5b60c1[_0x59d5('0x2b')]!=='Invalid\x20Login'&&_0x5b60c1[_0x59d5('0x2b')]!=='Password\x20Expired'){return rp({'method':_0x59d5('0x64'),'uri':util[_0x59d5('0x6b')](_0x59d5('0x65'),_0x174850,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x59d5('0x6c'),'input_type':_0x59d5('0x68'),'response_type':_0x59d5('0x68'),'rest_data':JSON[_0x59d5('0x69')]({'session':_0x5b60c1['id'],'module_name':_0x59d5('0x6d')})}})[_0x59d5('0x27')](function(_0x9a160e){if(_0x9a160e){var _0x3518cb=_[_0x59d5('0x6e')](_0x9a160e[_0x59d5('0x6f')]);_[_0x59d5('0x70')](_0x3518cb,function(_0x3daed0){return _0x894b4e[_0x59d5('0x71')](_0x3daed0[_0x59d5('0x2b')]);});return{'count':_0x3518cb[_0x59d5('0x3a')],'rows':_['map'](_0x3518cb,function(_0x4fd7c0){return{'id':_0x4fd7c0[_0x59d5('0x2b')],'name':_0x4fd7c0['label'],'custom':_[_0x59d5('0x72')](_0x4fd7c0[_0x59d5('0x2b')],'_c')?!![]:![],'options':_0x4fd7c0[_0x59d5('0x43')]?_['map'](_['values'](_0x4fd7c0['options']),function(_0x1ecca5){return{'name':_0x1ecca5['value'],'value':_0x1ecca5[_0x59d5('0x2b')]};}):[]};})};}})['then'](respondWithResult(_0x401695,null))['catch'](function(_0x1671e4){var _0x54cbdc=_0x475cd8[_0x59d5('0x34')][_0x59d5('0x73')]?0x1f4:_0x1671e4['statusCode']||0x1f4;logger[_0x59d5('0x29')](_0x59d5('0x74'),'getFields',_0x54cbdc,JSON[_0x59d5('0x69')](_0x1671e4));delete _0x1671e4[_0x59d5('0x2b')];if(_0x54cbdc===0x191){_0x54cbdc=0x190;}_0x401695[_0x59d5('0x1d')](_0x54cbdc)[_0x59d5('0x2c')](_0x475cd8[_0x59d5('0x34')][_0x59d5('0x73')]?{'message':_0x59d5('0x75'),'statusCode':_0x1671e4[_0x59d5('0x76')]}:_0x1671e4);});}else{var _0x35b2fb=0x1f4;_0x401695[_0x59d5('0x1d')](_0x35b2fb)[_0x59d5('0x2c')]({'message':_0x59d5('0x75'),'statusCode':0x190});}});};
\ No newline at end of file
index 76c309b..6765d74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d20=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger'];(function(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0x2d20,0x1d1));var _0x02d2=function(_0x4eaafe,_0x2cb1c6){_0x4eaafe=_0x4eaafe-0x0;var _0x2d0d06=_0x2d20[_0x4eaafe];return _0x2d0d06;};'use strict';var _=require(_0x02d2('0x0'));var util=require(_0x02d2('0x1'));var logger=require(_0x02d2('0x2'))('api');var moment=require(_0x02d2('0x3'));var BPromise=require(_0x02d2('0x4'));var rp=require(_0x02d2('0x5'));var fs=require('fs');var path=require(_0x02d2('0x6'));var rimraf=require(_0x02d2('0x7'));var config=require(_0x02d2('0x8'));var attributes=require(_0x02d2('0x9'));var integrations=require(_0x02d2('0xa'));module[_0x02d2('0xb')]=function(_0xac81c8,_0x2e9660){return _0xac81c8[_0x02d2('0xc')]('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x269b=['lodash','../../config/logger','api','moment','bluebird','path','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x1650bb,_0x2a532b){var _0x504cad=function(_0x30dae2){while(--_0x30dae2){_0x1650bb['push'](_0x1650bb['shift']());}};_0x504cad(++_0x2a532b);}(_0x269b,0x9a));var _0xb269=function(_0x215797,_0x49d505){_0x215797=_0x215797-0x0;var _0x4a3697=_0x269b[_0x215797];return _0x4a3697;};'use strict';var _=require(_0xb269('0x0'));var util=require('util');var logger=require(_0xb269('0x1'))(_0xb269('0x2'));var moment=require(_0xb269('0x3'));var BPromise=require(_0xb269('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb269('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xb269('0x6'));module[_0xb269('0x7')]=function(_0x456d40,_0x471542){return _0x456d40[_0xb269('0x8')](_0xb269('0x9'),attributes,{'tableName':_0xb269('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8f87572..de3bd06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60ee=['find','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','include','model','attributes','map','debug','ShowSugarcrmAccount'];(function(_0x5ca2c6,_0x5bb572){var _0x103913=function(_0xe152be){while(--_0xe152be){_0x5ca2c6['push'](_0x5ca2c6['shift']());}};_0x103913(++_0x5bb572);}(_0x60ee,0xbb));var _0xe60e=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0x60ee[_0x3358ba];return _0x296e73;};'use strict';var _=require(_0xe60e('0x0'));var util=require('util');var moment=require(_0xe60e('0x1'));var BPromise=require(_0xe60e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe60e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe60e('0x4'));var logger=require(_0xe60e('0x5'))(_0xe60e('0x6'));var config=require('../../config/environment');var jayson=require(_0xe60e('0x7'));var client=jayson[_0xe60e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x318d12,_0x2aee74,_0x1c8359){return new BPromise(function(_0x43ac16,_0x4904f2){return client['request'](_0x318d12,_0x1c8359)['then'](function(_0x4975e5){logger[_0xe60e('0x9')](_0xe60e('0xa'),_0x2aee74,'request\x20sent');logger['debug'](_0xe60e('0xb'),_0x2aee74,_0xe60e('0xc'),JSON[_0xe60e('0xd')](_0x4975e5));if(_0x4975e5['error']){if(_0x4975e5['error'][_0xe60e('0xe')]===0x1f4){logger[_0xe60e('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x2aee74,_0x4975e5[_0xe60e('0xf')]['message']);return _0x4904f2(_0x4975e5[_0xe60e('0xf')][_0xe60e('0x10')]);}logger['error'](_0xe60e('0xa'),_0x2aee74,_0x4975e5[_0xe60e('0xf')][_0xe60e('0x10')]);return _0x43ac16(_0x4975e5[_0xe60e('0xf')][_0xe60e('0x10')]);}else{logger[_0xe60e('0x9')](_0xe60e('0xa'),_0x2aee74,_0xe60e('0xc'));_0x43ac16(_0x4975e5['result'][_0xe60e('0x10')]);}})[_0xe60e('0x11')](function(_0x38dfc1){logger[_0xe60e('0xf')](_0xe60e('0xa'),_0x2aee74,_0x38dfc1);_0x4904f2(_0x38dfc1);});});}exports[_0xe60e('0x12')]=function(_0x16d0ae){var _0x77e590=this;return new Promise(function(_0x1f76ba,_0x1dd6ba){return db[_0xe60e('0x13')][_0xe60e('0x14')]({'raw':_0x16d0ae[_0xe60e('0x15')]?_0x16d0ae[_0xe60e('0x15')][_0xe60e('0x16')]===undefined?!![]:![]:!![],'where':_0x16d0ae[_0xe60e('0x15')]?_0x16d0ae[_0xe60e('0x15')][_0xe60e('0x17')]||null:null,'attributes':_0x16d0ae[_0xe60e('0x15')]?_0x16d0ae[_0xe60e('0x15')]['attributes']||null:null,'limit':_0x16d0ae[_0xe60e('0x15')]?_0x16d0ae[_0xe60e('0x15')]['limit']||null:null,'include':_0x16d0ae['options']?_0x16d0ae[_0xe60e('0x15')][_0xe60e('0x18')]?_['map'](_0x16d0ae[_0xe60e('0x15')][_0xe60e('0x18')],function(_0xe82070){return{'model':db[_0xe82070[_0xe60e('0x19')]],'as':_0xe82070['as'],'attributes':_0xe82070[_0xe60e('0x1a')],'include':_0xe82070[_0xe60e('0x18')]?_[_0xe60e('0x1b')](_0xe82070['include'],function(_0x20a058){return{'model':db[_0x20a058['model']],'as':_0x20a058['as'],'attributes':_0x20a058[_0xe60e('0x1a')],'include':_0x20a058[_0xe60e('0x18')]?_['map'](_0x20a058[_0xe60e('0x18')],function(_0x37e0c7){return{'model':db[_0x37e0c7[_0xe60e('0x19')]],'as':_0x37e0c7['as'],'attributes':_0x37e0c7[_0xe60e('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f142b){logger['info']('GetSugarcrmAccount',_0x16d0ae);logger[_0xe60e('0x1c')](_0xe60e('0x12'),_0x16d0ae,JSON[_0xe60e('0xd')](_0x3f142b));_0x1f76ba(_0x3f142b);})['catch'](function(_0x16e16c){logger[_0xe60e('0xf')](_0xe60e('0x12'),_0x16e16c['message'],_0x16d0ae);_0x1dd6ba(_0x77e590[_0xe60e('0xf')](0x1f4,_0x16e16c[_0xe60e('0x10')]));});});};exports[_0xe60e('0x1d')]=function(_0x3d35ac){var _0x5061f9=this;return new Promise(function(_0xb9c14b,_0x4acb9f){return db[_0xe60e('0x13')][_0xe60e('0x1e')]({'raw':_0x3d35ac['options']?_0x3d35ac[_0xe60e('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3d35ac[_0xe60e('0x15')]?_0x3d35ac[_0xe60e('0x15')][_0xe60e('0x17')]||null:null,'attributes':_0x3d35ac[_0xe60e('0x15')]?_0x3d35ac['options'][_0xe60e('0x1a')]||null:null,'include':_0x3d35ac[_0xe60e('0x15')]?_0x3d35ac[_0xe60e('0x15')][_0xe60e('0x18')]?_['map'](_0x3d35ac[_0xe60e('0x15')][_0xe60e('0x18')],function(_0x11a538){return{'model':db[_0x11a538['model']],'as':_0x11a538['as'],'attributes':_0x11a538['attributes'],'include':_0x11a538[_0xe60e('0x18')]?_[_0xe60e('0x1b')](_0x11a538['include'],function(_0x246a4d){return{'model':db[_0x246a4d[_0xe60e('0x19')]],'as':_0x246a4d['as'],'attributes':_0x246a4d['attributes'],'include':_0x246a4d[_0xe60e('0x18')]?_[_0xe60e('0x1b')](_0x246a4d[_0xe60e('0x18')],function(_0x4bdbe8){return{'model':db[_0x4bdbe8['model']],'as':_0x4bdbe8['as'],'attributes':_0x4bdbe8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x23b637){logger[_0xe60e('0x9')]('ShowSugarcrmAccount',_0x3d35ac);logger[_0xe60e('0x1c')](_0xe60e('0x1d'),_0x3d35ac,JSON[_0xe60e('0xd')](_0x23b637));_0xb9c14b(_0x23b637);})[_0xe60e('0x11')](function(_0x23c470){logger[_0xe60e('0xf')](_0xe60e('0x1d'),_0x23c470[_0xe60e('0x10')],_0x3d35ac);_0x4acb9f(_0x5061f9[_0xe60e('0xf')](0x1f4,_0x23c470['message']));});});};
\ No newline at end of file
+var _0x576f=['util','moment','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','attributes','include','map','debug','stringify','ShowSugarcrmAccount','find','raw','where','model','lodash'];(function(_0x1b2f3c,_0x5f2cfe){var _0x4de3ea=function(_0x22113b){while(--_0x22113b){_0x1b2f3c['push'](_0x1b2f3c['shift']());}};_0x4de3ea(++_0x5f2cfe);}(_0x576f,0x19f));var _0xf576=function(_0x3c7d5f,_0x14b391){_0x3c7d5f=_0x3c7d5f-0x0;var _0x35dd1b=_0x576f[_0x3c7d5f];return _0x35dd1b;};'use strict';var _=require(_0xf576('0x0'));var util=require(_0xf576('0x1'));var moment=require(_0xf576('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf576('0x3'))['db'];var utils=require(_0xf576('0x4'));var logger=require(_0xf576('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf576('0x6'));var client=jayson['client'][_0xf576('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x24cf8f,_0x5b316e,_0x472a01){return new BPromise(function(_0x1460de,_0x3c57a9){return client[_0xf576('0x8')](_0x24cf8f,_0x472a01)[_0xf576('0x9')](function(_0x70c8ec){logger[_0xf576('0xa')]('SugarcrmAccount,\x20%s,\x20%s',_0x5b316e,'request\x20sent');logger['debug'](_0xf576('0xb'),_0x5b316e,_0xf576('0xc'),JSON['stringify'](_0x70c8ec));if(_0x70c8ec[_0xf576('0xd')]){if(_0x70c8ec[_0xf576('0xd')][_0xf576('0xe')]===0x1f4){logger[_0xf576('0xd')](_0xf576('0xf'),_0x5b316e,_0x70c8ec[_0xf576('0xd')][_0xf576('0x10')]);return _0x3c57a9(_0x70c8ec['error'][_0xf576('0x10')]);}logger[_0xf576('0xd')](_0xf576('0xf'),_0x5b316e,_0x70c8ec[_0xf576('0xd')][_0xf576('0x10')]);return _0x1460de(_0x70c8ec[_0xf576('0xd')]['message']);}else{logger[_0xf576('0xa')](_0xf576('0xf'),_0x5b316e,_0xf576('0xc'));_0x1460de(_0x70c8ec[_0xf576('0x11')]['message']);}})[_0xf576('0x12')](function(_0x243c11){logger[_0xf576('0xd')](_0xf576('0xf'),_0x5b316e,_0x243c11);_0x3c57a9(_0x243c11);});});}exports[_0xf576('0x13')]=function(_0x12bcf2){var _0x292c93=this;return new Promise(function(_0x5561c3,_0x23886f){return db[_0xf576('0x14')]['findAll']({'raw':_0x12bcf2[_0xf576('0x15')]?_0x12bcf2[_0xf576('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x12bcf2['options']?_0x12bcf2['options']['where']||null:null,'attributes':_0x12bcf2[_0xf576('0x15')]?_0x12bcf2['options'][_0xf576('0x16')]||null:null,'limit':_0x12bcf2[_0xf576('0x15')]?_0x12bcf2[_0xf576('0x15')]['limit']||null:null,'include':_0x12bcf2[_0xf576('0x15')]?_0x12bcf2[_0xf576('0x15')][_0xf576('0x17')]?_['map'](_0x12bcf2['options'][_0xf576('0x17')],function(_0x5dc2c1){return{'model':db[_0x5dc2c1['model']],'as':_0x5dc2c1['as'],'attributes':_0x5dc2c1[_0xf576('0x16')],'include':_0x5dc2c1[_0xf576('0x17')]?_[_0xf576('0x18')](_0x5dc2c1['include'],function(_0x32c849){return{'model':db[_0x32c849['model']],'as':_0x32c849['as'],'attributes':_0x32c849[_0xf576('0x16')],'include':_0x32c849['include']?_[_0xf576('0x18')](_0x32c849[_0xf576('0x17')],function(_0x256eb5){return{'model':db[_0x256eb5['model']],'as':_0x256eb5['as'],'attributes':_0x256eb5[_0xf576('0x16')]};}):[]};}):[]};}):[]:[]})[_0xf576('0x9')](function(_0x28f022){logger[_0xf576('0xa')](_0xf576('0x13'),_0x12bcf2);logger[_0xf576('0x19')](_0xf576('0x13'),_0x12bcf2,JSON[_0xf576('0x1a')](_0x28f022));_0x5561c3(_0x28f022);})[_0xf576('0x12')](function(_0x383e4f){logger[_0xf576('0xd')]('GetSugarcrmAccount',_0x383e4f[_0xf576('0x10')],_0x12bcf2);_0x23886f(_0x292c93[_0xf576('0xd')](0x1f4,_0x383e4f['message']));});});};exports[_0xf576('0x1b')]=function(_0x6d31d1){var _0x39bcb8=this;return new Promise(function(_0x57b76d,_0x508d99){return db[_0xf576('0x14')][_0xf576('0x1c')]({'raw':_0x6d31d1[_0xf576('0x15')]?_0x6d31d1[_0xf576('0x15')][_0xf576('0x1d')]===undefined?!![]:![]:!![],'where':_0x6d31d1['options']?_0x6d31d1[_0xf576('0x15')][_0xf576('0x1e')]||null:null,'attributes':_0x6d31d1[_0xf576('0x15')]?_0x6d31d1[_0xf576('0x15')][_0xf576('0x16')]||null:null,'include':_0x6d31d1[_0xf576('0x15')]?_0x6d31d1[_0xf576('0x15')][_0xf576('0x17')]?_[_0xf576('0x18')](_0x6d31d1['options'][_0xf576('0x17')],function(_0x380a7d){return{'model':db[_0x380a7d[_0xf576('0x1f')]],'as':_0x380a7d['as'],'attributes':_0x380a7d[_0xf576('0x16')],'include':_0x380a7d[_0xf576('0x17')]?_[_0xf576('0x18')](_0x380a7d[_0xf576('0x17')],function(_0x180ec9){return{'model':db[_0x180ec9[_0xf576('0x1f')]],'as':_0x180ec9['as'],'attributes':_0x180ec9[_0xf576('0x16')],'include':_0x180ec9['include']?_[_0xf576('0x18')](_0x180ec9[_0xf576('0x17')],function(_0x12c52d){return{'model':db[_0x12c52d['model']],'as':_0x12c52d['as'],'attributes':_0x12c52d['attributes']};}):[]};}):[]};}):[]:[]})[_0xf576('0x9')](function(_0x2355c1){logger[_0xf576('0xa')](_0xf576('0x1b'),_0x6d31d1);logger[_0xf576('0x19')](_0xf576('0x1b'),_0x6d31d1,JSON[_0xf576('0x1a')](_0x2355c1));_0x57b76d(_0x2355c1);})[_0xf576('0x12')](function(_0x48200e){logger[_0xf576('0xd')](_0xf576('0x1b'),_0x48200e[_0xf576('0x10')],_0x6d31d1);_0x508d99(_0x39bcb8[_0xf576('0xd')](0x1f4,_0x48200e[_0xf576('0x10')]));});});};
\ No newline at end of file
index 41371eb..5fbf8aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1407=['getSubjects','/:id/descriptions','getDescriptions','post','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/:id','show','get','/:id/fields','getFields'];(function(_0x3448c5,_0x57d0d0){var _0x8b4435=function(_0x4793bb){while(--_0x4793bb){_0x3448c5['push'](_0x3448c5['shift']());}};_0x8b4435(++_0x57d0d0);}(_0x1407,0xf9));var _0x7140=function(_0x1d4854,_0x36e891){_0x1d4854=_0x1d4854-0x0;var _0x2cf063=_0x1407[_0x1d4854];return _0x2cf063;};'use strict';var multer=require(_0x7140('0x0'));var util=require(_0x7140('0x1'));var path=require(_0x7140('0x2'));var timeout=require('connect-timeout');var express=require(_0x7140('0x3'));var router=express[_0x7140('0x4')]();var fs_extra=require(_0x7140('0x5'));var auth=require(_0x7140('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7140('0x7'));var controller=require('./intSugarcrmConfiguration.controller');router['get']('/',auth[_0x7140('0x8')](),controller[_0x7140('0x9')]);router['get'](_0x7140('0xa'),auth[_0x7140('0x8')](),controller[_0x7140('0xb')]);router[_0x7140('0xc')](_0x7140('0xd'),auth[_0x7140('0x8')](),controller[_0x7140('0xe')]);router[_0x7140('0xc')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x7140('0xf')]);router[_0x7140('0xc')](_0x7140('0x10'),auth['isAuthenticated'](),controller[_0x7140('0x11')]);router[_0x7140('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7140('0x13')](_0x7140('0xa'),auth[_0x7140('0x8')](),controller['update']);router['delete'](_0x7140('0xa'),auth['isAuthenticated'](),controller[_0x7140('0x14')]);module[_0x7140('0x15')]=router;
\ No newline at end of file
+var _0x130d=['/:id/fields','getFields','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x130d,0x66));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd130('0x0'));var util=require('util');var path=require(_0xd130('0x1'));var timeout=require('connect-timeout');var express=require(_0xd130('0x2'));var router=express[_0xd130('0x3')]();var fs_extra=require(_0xd130('0x4'));var auth=require(_0xd130('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd130('0x6'));var controller=require(_0xd130('0x7'));router['get']('/',auth[_0xd130('0x8')](),controller[_0xd130('0x9')]);router[_0xd130('0xa')](_0xd130('0xb'),auth[_0xd130('0x8')](),controller[_0xd130('0xc')]);router[_0xd130('0xa')](_0xd130('0xd'),auth['isAuthenticated'](),controller[_0xd130('0xe')]);router['get']('/:id/subjects',auth[_0xd130('0x8')](),controller['getSubjects']);router[_0xd130('0xa')](_0xd130('0xf'),auth[_0xd130('0x8')](),controller[_0xd130('0x10')]);router[_0xd130('0x11')]('/',auth[_0xd130('0x8')](),controller[_0xd130('0x12')]);router[_0xd130('0x13')](_0xd130('0xb'),auth[_0xd130('0x8')](),controller[_0xd130('0x14')]);router['delete'](_0xd130('0xb'),auth['isAuthenticated'](),controller[_0xd130('0x15')]);module[_0xd130('0x16')]=router;
\ No newline at end of file
index c32706b..98a01e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43ed=['STRING'];(function(_0x1c01e8,_0x2d058d){var _0x456176=function(_0x5c8532){while(--_0x5c8532){_0x1c01e8['push'](_0x1c01e8['shift']());}};_0x456176(++_0x2d058d);}(_0x43ed,0xb6));var _0xd43e=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x43ed[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd43e('0x0')]}};
\ No newline at end of file
+var _0xa504=['STRING','sequelize'];(function(_0x34b35a,_0x21aa02){var _0x1b9e3c=function(_0x3359b2){while(--_0x3359b2){_0x34b35a['push'](_0x34b35a['shift']());}};_0x1b9e3c(++_0x21aa02);}(_0xa504,0x157));var _0x4a50=function(_0x45b852,_0x142ef8){_0x45b852=_0x45b852-0x0;var _0x2ab33d=_0xa504[_0x45b852];return _0x2ab33d;};'use strict';var Sequelize=require(_0x4a50('0x0'));module['exports']={'name':{'type':Sequelize[_0x4a50('0x1')]},'description':{'type':Sequelize[_0x4a50('0x1')]}};
\ No newline at end of file
index caf046b..90f5fd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc733=['model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','find','create','body','getFields','findOne','options','nolimit','getSubjects','SugarcrmField','getDescriptions','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','reject','save','update','destroy','then','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key'];(function(_0x409ea5,_0x55ac2e){var _0x75d918=function(_0x458065){while(--_0x458065){_0x409ea5['push'](_0x409ea5['shift']());}};_0x75d918(++_0x55ac2e);}(_0xc733,0x160));var _0x3c73=function(_0x280722,_0x219c38){_0x280722=_0x280722-0x0;var _0x140f04=_0xc733[_0x280722];return _0x140f04;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3c73('0x0'));var rp=require(_0x3c73('0x1'));var moment=require(_0x3c73('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3c73('0x3'));var util=require('util');var path=require(_0x3c73('0x4'));var sox=require(_0x3c73('0x5'));var csv=require(_0x3c73('0x6'));var ejs=require(_0x3c73('0x7'));var fs=require('fs');var fs_extra=require(_0x3c73('0x8'));var _=require(_0x3c73('0x9'));var squel=require(_0x3c73('0xa'));var crypto=require(_0x3c73('0xb'));var jsforce=require(_0x3c73('0xc'));var deskjs=require(_0x3c73('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3c73('0xe'));var Papa=require('papaparse');var Redis=require(_0x3c73('0xf'));var authService=require(_0x3c73('0x10'));var qs=require(_0x3c73('0x11'));var as=require(_0x3c73('0x12'));var hardwareService=require(_0x3c73('0x13'));var logger=require('../../config/logger')(_0x3c73('0x14'));var utils=require(_0x3c73('0x15'));var config=require(_0x3c73('0x16'));var licenseUtil=require(_0x3c73('0x17'));var db=require(_0x3c73('0x18'))['db'];function respondWithStatusCode(_0x3b531e,_0x4da796){_0x4da796=_0x4da796||0xcc;return function(_0x736ed0){if(_0x736ed0){return _0x3b531e['sendStatus'](_0x4da796);}return _0x3b531e['status'](_0x4da796)[_0x3c73('0x19')]();};}function respondWithResult(_0x222731,_0x4642d7){_0x4642d7=_0x4642d7||0xc8;return function(_0x425b2c){if(_0x425b2c){return _0x222731[_0x3c73('0x1a')](_0x4642d7)[_0x3c73('0x1b')](_0x425b2c);}};}function respondWithFilteredResult(_0x287431,_0x2c5d8a){return function(_0x20a5aa){if(_0x20a5aa){var _0x83d6ba=typeof _0x2c5d8a[_0x3c73('0x1c')]==='undefined'&&typeof _0x2c5d8a[_0x3c73('0x1d')]===_0x3c73('0x1e');var _0x55907e=_0x20a5aa[_0x3c73('0x1f')];var _0x40707f=_0x83d6ba?0x0:_0x2c5d8a[_0x3c73('0x1c')];var _0x3d26de=_0x83d6ba?_0x20a5aa[_0x3c73('0x1f')]:_0x2c5d8a[_0x3c73('0x1c')]+_0x2c5d8a[_0x3c73('0x1d')];var _0x4592b4;if(_0x3d26de>=_0x55907e){_0x3d26de=_0x55907e;_0x4592b4=0xc8;}else{_0x4592b4=0xce;}_0x287431[_0x3c73('0x1a')](_0x4592b4);return _0x287431[_0x3c73('0x20')]('Content-Range',_0x40707f+'-'+_0x3d26de+'/'+_0x55907e)[_0x3c73('0x1b')](_0x20a5aa);}return null;};}function patchUpdates(_0x176f86){return function(_0x41b993){try{jsonpatch['apply'](_0x41b993,_0x176f86,!![]);}catch(_0x5d3e78){return BPromise[_0x3c73('0x21')](_0x5d3e78);}return _0x41b993[_0x3c73('0x22')]();};}function saveUpdates(_0x2e074f,_0x5f0a4){return function(_0x51bf76){if(_0x51bf76){return _0x51bf76[_0x3c73('0x23')](_0x2e074f)['then'](function(_0x2b1856){return _0x2b1856;});}return null;};}function removeEntity(_0x4a7318,_0x421e35){return function(_0x521a66){if(_0x521a66){return _0x521a66[_0x3c73('0x24')]()[_0x3c73('0x25')](function(){_0x4a7318[_0x3c73('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5096c2,_0x1f951f){return function(_0x1e0bb2){if(!_0x1e0bb2){_0x5096c2['sendStatus'](0x194);}return _0x1e0bb2;};}function handleError(_0x21e5f2,_0x32b7ce){_0x32b7ce=_0x32b7ce||0x1f4;return function(_0x1f49f2){logger['error'](_0x1f49f2[_0x3c73('0x26')]);if(_0x1f49f2[_0x3c73('0x27')]){delete _0x1f49f2[_0x3c73('0x27')];}_0x21e5f2['status'](_0x32b7ce)[_0x3c73('0x28')](_0x1f49f2);};}exports[_0x3c73('0x29')]=function(_0xc342,_0x238a19){var _0x478c75={},_0x529b28={},_0xb1ec3b={'count':0x0,'rows':[]};var _0x20eded=_[_0x3c73('0x2a')](db[_0x3c73('0x2b')][_0x3c73('0x2c')],function(_0x2a1d16){return{'name':_0x2a1d16[_0x3c73('0x2d')],'type':_0x2a1d16[_0x3c73('0x2e')][_0x3c73('0x2f')]};});_0x529b28[_0x3c73('0x30')]=_['map'](_0x20eded,_0x3c73('0x27'));_0x529b28[_0x3c73('0x31')]=_[_0x3c73('0x32')](_0xc342[_0x3c73('0x31')]);_0x529b28[_0x3c73('0x33')]=_['intersection'](_0x529b28['model'],_0x529b28[_0x3c73('0x31')]);_0x478c75[_0x3c73('0x34')]=_[_0x3c73('0x35')](_0x529b28['model'],qs[_0x3c73('0x36')](_0xc342[_0x3c73('0x31')]['fields']));_0x478c75['attributes']=_0x478c75['attributes'][_0x3c73('0x37')]?_0x478c75[_0x3c73('0x34')]:_0x529b28['model'];if(!_0xc342[_0x3c73('0x31')][_0x3c73('0x38')]('nolimit')){_0x478c75[_0x3c73('0x1d')]=qs[_0x3c73('0x1d')](_0xc342[_0x3c73('0x31')]['limit']);_0x478c75[_0x3c73('0x1c')]=qs[_0x3c73('0x1c')](_0xc342['query'][_0x3c73('0x1c')]);}_0x478c75[_0x3c73('0x39')]=qs[_0x3c73('0x3a')](_0xc342[_0x3c73('0x31')][_0x3c73('0x3a')]);_0x478c75[_0x3c73('0x3b')]=qs[_0x3c73('0x33')](_[_0x3c73('0x3c')](_0xc342['query'],_0x529b28[_0x3c73('0x33')]),_0x20eded);if(_0xc342[_0x3c73('0x31')][_0x3c73('0x3d')]){_0x478c75[_0x3c73('0x3b')]=_[_0x3c73('0x3e')](_0x478c75[_0x3c73('0x3b')],{'$or':_[_0x3c73('0x2a')](_0x20eded,function(_0x41ec72){if(_0x41ec72['type']!==_0x3c73('0x3f')){var _0x2886ef={};_0x2886ef[_0x41ec72[_0x3c73('0x27')]]={'$like':'%'+_0xc342[_0x3c73('0x31')][_0x3c73('0x3d')]+'%'};return _0x2886ef;}})});}_0x478c75=_[_0x3c73('0x3e')]({},_0x478c75,_0xc342['options']);var _0x4f4c92={'where':_0x478c75[_0x3c73('0x3b')]};return db[_0x3c73('0x2b')][_0x3c73('0x1f')](_0x4f4c92)[_0x3c73('0x25')](function(_0x5b496a){_0xb1ec3b[_0x3c73('0x1f')]=_0x5b496a;if(_0xc342[_0x3c73('0x31')][_0x3c73('0x40')]){_0x478c75[_0x3c73('0x41')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x3c73('0x42')](_0x478c75);})[_0x3c73('0x25')](function(_0x4eff39){_0xb1ec3b['rows']=_0x4eff39;return _0xb1ec3b;})[_0x3c73('0x25')](respondWithFilteredResult(_0x238a19,_0x478c75))[_0x3c73('0x43')](handleError(_0x238a19,null));};exports[_0x3c73('0x44')]=function(_0x2c307d,_0x1e58d4){var _0x54eb2b={'raw':![],'where':{'id':_0x2c307d[_0x3c73('0x45')]['id']}},_0x11b5ae={};_0x11b5ae[_0x3c73('0x30')]=_['keys'](db[_0x3c73('0x2b')]['rawAttributes']);_0x11b5ae[_0x3c73('0x31')]=_[_0x3c73('0x32')](_0x2c307d[_0x3c73('0x31')]);_0x11b5ae['filters']=_[_0x3c73('0x35')](_0x11b5ae[_0x3c73('0x30')],_0x11b5ae[_0x3c73('0x31')]);_0x54eb2b[_0x3c73('0x34')]=_[_0x3c73('0x35')](_0x11b5ae[_0x3c73('0x30')],qs['fields'](_0x2c307d['query'][_0x3c73('0x36')]));_0x54eb2b[_0x3c73('0x34')]=_0x54eb2b[_0x3c73('0x34')][_0x3c73('0x37')]?_0x54eb2b['attributes']:_0x11b5ae[_0x3c73('0x30')];if(_0x2c307d[_0x3c73('0x31')][_0x3c73('0x40')]){_0x54eb2b['include']=[{'all':!![]}];}_0x54eb2b=_['merge']({},_0x54eb2b,_0x2c307d['options']);return db[_0x3c73('0x2b')][_0x3c73('0x46')](_0x54eb2b)['then'](handleEntityNotFound(_0x1e58d4,null))['then'](respondWithResult(_0x1e58d4,null))['catch'](handleError(_0x1e58d4,null));};exports[_0x3c73('0x47')]=function(_0x2fc0c9,_0x32aae2){return db[_0x3c73('0x2b')][_0x3c73('0x47')](_0x2fc0c9['body'],{})[_0x3c73('0x25')](respondWithResult(_0x32aae2,0xc9))[_0x3c73('0x43')](handleError(_0x32aae2,null));};exports['update']=function(_0x378fd2,_0x570dd3){if(_0x378fd2['body']['id']){delete _0x378fd2[_0x3c73('0x48')]['id'];}return db[_0x3c73('0x2b')]['find']({'where':{'id':_0x378fd2[_0x3c73('0x45')]['id']}})[_0x3c73('0x25')](handleEntityNotFound(_0x570dd3,null))[_0x3c73('0x25')](saveUpdates(_0x378fd2[_0x3c73('0x48')],null))[_0x3c73('0x25')](respondWithResult(_0x570dd3,null))[_0x3c73('0x43')](handleError(_0x570dd3,null));};exports[_0x3c73('0x24')]=function(_0x5c0809,_0x529e61){return db['SugarcrmConfiguration'][_0x3c73('0x46')]({'where':{'id':_0x5c0809[_0x3c73('0x45')]['id']}})[_0x3c73('0x25')](handleEntityNotFound(_0x529e61,null))[_0x3c73('0x25')](removeEntity(_0x529e61,null))['catch'](handleError(_0x529e61,null));};exports[_0x3c73('0x49')]=function(_0x4b0739,_0x325c43,_0x210751){var _0x1137dc={};var _0x4aa8cd={};var _0x43a048;var _0x3f6f21;return db[_0x3c73('0x2b')][_0x3c73('0x4a')]({'where':{'id':_0x4b0739[_0x3c73('0x45')]['id']}})[_0x3c73('0x25')](handleEntityNotFound(_0x325c43,null))['then'](function(_0x16539e){if(_0x16539e){_0x43a048=_0x16539e;_0x4aa8cd[_0x3c73('0x30')]=_[_0x3c73('0x32')](db['SugarcrmField']['rawAttributes']);_0x4aa8cd[_0x3c73('0x31')]=_['keys'](_0x4b0739['query']);_0x4aa8cd['filters']=_[_0x3c73('0x35')](_0x4aa8cd[_0x3c73('0x30')],_0x4aa8cd['query']);_0x1137dc[_0x3c73('0x34')]=_[_0x3c73('0x35')](_0x4aa8cd[_0x3c73('0x30')],qs[_0x3c73('0x36')](_0x4b0739[_0x3c73('0x31')][_0x3c73('0x36')]));_0x1137dc['attributes']=_0x1137dc[_0x3c73('0x34')][_0x3c73('0x37')]?_0x1137dc['attributes']:_0x4aa8cd[_0x3c73('0x30')];_0x1137dc[_0x3c73('0x39')]=qs['sort'](_0x4b0739[_0x3c73('0x31')]['sort']);_0x1137dc['where']=qs[_0x3c73('0x33')](_['pick'](_0x4b0739[_0x3c73('0x31')],_0x4aa8cd[_0x3c73('0x33')]));if(_0x4b0739['query'][_0x3c73('0x3d')]){_0x1137dc[_0x3c73('0x3b')]=_[_0x3c73('0x3e')](_0x1137dc[_0x3c73('0x3b')],{'$or':_[_0x3c73('0x2a')](_0x1137dc[_0x3c73('0x34')],function(_0x2057bd){var _0x2a7922={};_0x2a7922[_0x2057bd]={'$like':'%'+_0x4b0739[_0x3c73('0x31')][_0x3c73('0x3d')]+'%'};return _0x2a7922;})});}_0x1137dc=_[_0x3c73('0x3e')]({},_0x1137dc,_0x4b0739[_0x3c73('0x4b')]);return _0x43a048[_0x3c73('0x49')](_0x1137dc);}})[_0x3c73('0x25')](function(_0x2bf5e8){if(_0x2bf5e8){_0x3f6f21=_0x2bf5e8['length'];if(!_0x4b0739[_0x3c73('0x31')][_0x3c73('0x38')](_0x3c73('0x4c'))){_0x1137dc[_0x3c73('0x1d')]=qs[_0x3c73('0x1d')](_0x4b0739[_0x3c73('0x31')][_0x3c73('0x1d')]);_0x1137dc[_0x3c73('0x1c')]=qs[_0x3c73('0x1c')](_0x4b0739[_0x3c73('0x31')][_0x3c73('0x1c')]);}return _0x43a048['getFields'](_0x1137dc);}})[_0x3c73('0x25')](function(_0xd4a273){if(_0xd4a273){return _0xd4a273?{'count':_0x3f6f21,'rows':_0xd4a273}:null;}})[_0x3c73('0x25')](respondWithResult(_0x325c43,null))[_0x3c73('0x43')](handleError(_0x325c43,null));};exports[_0x3c73('0x4d')]=function(_0x4adac5,_0x40b3c0,_0x55853d){var _0x30ae79={};var _0x9e18c={};var _0x17f902;var _0x108d11;return db['SugarcrmConfiguration'][_0x3c73('0x4a')]({'where':{'id':_0x4adac5['params']['id']}})[_0x3c73('0x25')](handleEntityNotFound(_0x40b3c0,null))[_0x3c73('0x25')](function(_0x197613){if(_0x197613){_0x17f902=_0x197613;_0x9e18c[_0x3c73('0x30')]=_[_0x3c73('0x32')](db[_0x3c73('0x4e')]['rawAttributes']);_0x9e18c[_0x3c73('0x31')]=_[_0x3c73('0x32')](_0x4adac5['query']);_0x9e18c['filters']=_[_0x3c73('0x35')](_0x9e18c[_0x3c73('0x30')],_0x9e18c[_0x3c73('0x31')]);_0x30ae79[_0x3c73('0x34')]=_['intersection'](_0x9e18c[_0x3c73('0x30')],qs[_0x3c73('0x36')](_0x4adac5['query'][_0x3c73('0x36')]));_0x30ae79[_0x3c73('0x34')]=_0x30ae79[_0x3c73('0x34')]['length']?_0x30ae79[_0x3c73('0x34')]:_0x9e18c[_0x3c73('0x30')];_0x30ae79[_0x3c73('0x39')]=qs[_0x3c73('0x3a')](_0x4adac5[_0x3c73('0x31')][_0x3c73('0x3a')]);_0x30ae79[_0x3c73('0x3b')]=qs[_0x3c73('0x33')](_[_0x3c73('0x3c')](_0x4adac5[_0x3c73('0x31')],_0x9e18c[_0x3c73('0x33')]));if(_0x4adac5[_0x3c73('0x31')][_0x3c73('0x3d')]){_0x30ae79['where']=_[_0x3c73('0x3e')](_0x30ae79['where'],{'$or':_[_0x3c73('0x2a')](_0x30ae79['attributes'],function(_0x58c15c){var _0x3a2579={};_0x3a2579[_0x58c15c]={'$like':'%'+_0x4adac5['query'][_0x3c73('0x3d')]+'%'};return _0x3a2579;})});}_0x30ae79=_['merge']({},_0x30ae79,_0x4adac5[_0x3c73('0x4b')]);return _0x17f902[_0x3c73('0x4d')](_0x30ae79);}})[_0x3c73('0x25')](function(_0x52fd09){if(_0x52fd09){_0x108d11=_0x52fd09[_0x3c73('0x37')];if(!_0x4adac5[_0x3c73('0x31')][_0x3c73('0x38')](_0x3c73('0x4c'))){_0x30ae79[_0x3c73('0x1d')]=qs[_0x3c73('0x1d')](_0x4adac5[_0x3c73('0x31')][_0x3c73('0x1d')]);_0x30ae79['offset']=qs[_0x3c73('0x1c')](_0x4adac5[_0x3c73('0x31')][_0x3c73('0x1c')]);}return _0x17f902[_0x3c73('0x4d')](_0x30ae79);}})[_0x3c73('0x25')](function(_0x45d5d4){if(_0x45d5d4){return _0x45d5d4?{'count':_0x108d11,'rows':_0x45d5d4}:null;}})['then'](respondWithResult(_0x40b3c0,null))[_0x3c73('0x43')](handleError(_0x40b3c0,null));};exports[_0x3c73('0x4f')]=function(_0x465c4a,_0x25762d,_0x1a356f){var _0x1c54ad={};var _0x3d940b={};var _0x5ebe3e;var _0x8ab025;return db[_0x3c73('0x2b')][_0x3c73('0x4a')]({'where':{'id':_0x465c4a['params']['id']}})['then'](handleEntityNotFound(_0x25762d,null))['then'](function(_0x52fa9c){if(_0x52fa9c){_0x5ebe3e=_0x52fa9c;_0x3d940b[_0x3c73('0x30')]=_[_0x3c73('0x32')](db[_0x3c73('0x4e')][_0x3c73('0x2c')]);_0x3d940b[_0x3c73('0x31')]=_[_0x3c73('0x32')](_0x465c4a[_0x3c73('0x31')]);_0x3d940b[_0x3c73('0x33')]=_[_0x3c73('0x35')](_0x3d940b[_0x3c73('0x30')],_0x3d940b['query']);_0x1c54ad['attributes']=_['intersection'](_0x3d940b[_0x3c73('0x30')],qs[_0x3c73('0x36')](_0x465c4a[_0x3c73('0x31')][_0x3c73('0x36')]));_0x1c54ad[_0x3c73('0x34')]=_0x1c54ad['attributes'][_0x3c73('0x37')]?_0x1c54ad[_0x3c73('0x34')]:_0x3d940b[_0x3c73('0x30')];_0x1c54ad[_0x3c73('0x39')]=qs[_0x3c73('0x3a')](_0x465c4a[_0x3c73('0x31')][_0x3c73('0x3a')]);_0x1c54ad[_0x3c73('0x3b')]=qs['filters'](_[_0x3c73('0x3c')](_0x465c4a[_0x3c73('0x31')],_0x3d940b[_0x3c73('0x33')]));if(_0x465c4a[_0x3c73('0x31')][_0x3c73('0x3d')]){_0x1c54ad[_0x3c73('0x3b')]=_[_0x3c73('0x3e')](_0x1c54ad[_0x3c73('0x3b')],{'$or':_[_0x3c73('0x2a')](_0x1c54ad[_0x3c73('0x34')],function(_0x2f3c5c){var _0xcd7dca={};_0xcd7dca[_0x2f3c5c]={'$like':'%'+_0x465c4a['query'][_0x3c73('0x3d')]+'%'};return _0xcd7dca;})});}_0x1c54ad=_['merge']({},_0x1c54ad,_0x465c4a['options']);return _0x5ebe3e['getDescriptions'](_0x1c54ad);}})['then'](function(_0x2c36ff){if(_0x2c36ff){_0x8ab025=_0x2c36ff['length'];if(!_0x465c4a[_0x3c73('0x31')]['hasOwnProperty'](_0x3c73('0x4c'))){_0x1c54ad[_0x3c73('0x1d')]=qs[_0x3c73('0x1d')](_0x465c4a[_0x3c73('0x31')]['limit']);_0x1c54ad[_0x3c73('0x1c')]=qs['offset'](_0x465c4a['query'][_0x3c73('0x1c')]);}return _0x5ebe3e[_0x3c73('0x4f')](_0x1c54ad);}})[_0x3c73('0x25')](function(_0x5aaaf5){if(_0x5aaaf5){return _0x5aaaf5?{'count':_0x8ab025,'rows':_0x5aaaf5}:null;}})[_0x3c73('0x25')](respondWithResult(_0x25762d,null))[_0x3c73('0x43')](handleError(_0x25762d,null));};
\ No newline at end of file
+var _0x2813=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','merge','options','SugarcrmConfiguration','includeAll','include','rows','show','params','find','catch','create','body','getFields','findOne','SugarcrmField','pick','filter','getSubjects','getDescriptions','eml-format','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','map','rawAttributes','type','model','query','keys','intersection'];(function(_0xaeb19b,_0xd1919e){var _0x197eb6=function(_0x2c191b){while(--_0x2c191b){_0xaeb19b['push'](_0xaeb19b['shift']());}};_0x197eb6(++_0xd1919e);}(_0x2813,0x10d));var _0x3281=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2813[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3281('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3281('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3281('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3281('0x3'));var util=require(_0x3281('0x4'));var path=require('path');var sox=require(_0x3281('0x5'));var csv=require(_0x3281('0x6'));var ejs=require(_0x3281('0x7'));var fs=require('fs');var fs_extra=require(_0x3281('0x8'));var _=require(_0x3281('0x9'));var squel=require(_0x3281('0xa'));var crypto=require(_0x3281('0xb'));var jsforce=require(_0x3281('0xc'));var deskjs=require(_0x3281('0xd'));var toCsv=require(_0x3281('0x6'));var querystring=require(_0x3281('0xe'));var Papa=require(_0x3281('0xf'));var Redis=require(_0x3281('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3281('0x11'));var as=require(_0x3281('0x12'));var hardwareService=require(_0x3281('0x13'));var logger=require(_0x3281('0x14'))(_0x3281('0x15'));var utils=require('../../config/utils');var config=require(_0x3281('0x16'));var licenseUtil=require(_0x3281('0x17'));var db=require(_0x3281('0x18'))['db'];function respondWithStatusCode(_0x465a46,_0x3498bf){_0x3498bf=_0x3498bf||0xcc;return function(_0x25eed8){if(_0x25eed8){return _0x465a46[_0x3281('0x19')](_0x3498bf);}return _0x465a46[_0x3281('0x1a')](_0x3498bf)[_0x3281('0x1b')]();};}function respondWithResult(_0x4f083d,_0x2bcf80){_0x2bcf80=_0x2bcf80||0xc8;return function(_0x4efcf0){if(_0x4efcf0){return _0x4f083d[_0x3281('0x1a')](_0x2bcf80)[_0x3281('0x1c')](_0x4efcf0);}};}function respondWithFilteredResult(_0x540e51,_0x414002){return function(_0x38148f){if(_0x38148f){var _0x1810cf=typeof _0x414002['offset']===_0x3281('0x1d')&&typeof _0x414002[_0x3281('0x1e')]===_0x3281('0x1d');var _0x3505ce=_0x38148f['count'];var _0x3f396e=_0x1810cf?0x0:_0x414002[_0x3281('0x1f')];var _0x407425=_0x1810cf?_0x38148f[_0x3281('0x20')]:_0x414002['offset']+_0x414002[_0x3281('0x1e')];var _0x8bc51;if(_0x407425>=_0x3505ce){_0x407425=_0x3505ce;_0x8bc51=0xc8;}else{_0x8bc51=0xce;}_0x540e51[_0x3281('0x1a')](_0x8bc51);return _0x540e51[_0x3281('0x21')](_0x3281('0x22'),_0x3f396e+'-'+_0x407425+'/'+_0x3505ce)['json'](_0x38148f);}return null;};}function patchUpdates(_0x1d5010){return function(_0x1369dc){try{jsonpatch[_0x3281('0x23')](_0x1369dc,_0x1d5010,!![]);}catch(_0x45d976){return BPromise[_0x3281('0x24')](_0x45d976);}return _0x1369dc['save']();};}function saveUpdates(_0x4960a5,_0x2147a8){return function(_0x20a670){if(_0x20a670){return _0x20a670[_0x3281('0x25')](_0x4960a5)['then'](function(_0x2b7e98){return _0x2b7e98;});}return null;};}function removeEntity(_0x3aa189,_0x290d35){return function(_0x4e0821){if(_0x4e0821){return _0x4e0821[_0x3281('0x26')]()[_0x3281('0x27')](function(){_0x3aa189[_0x3281('0x1a')](0xcc)[_0x3281('0x1b')]();});}};}function handleEntityNotFound(_0x48087f,_0x234ca7){return function(_0x539bdc){if(!_0x539bdc){_0x48087f[_0x3281('0x19')](0x194);}return _0x539bdc;};}function handleError(_0x4fc7ee,_0x5e9499){_0x5e9499=_0x5e9499||0x1f4;return function(_0x582c4d){logger[_0x3281('0x28')](_0x582c4d[_0x3281('0x29')]);if(_0x582c4d[_0x3281('0x2a')]){delete _0x582c4d['name'];}_0x4fc7ee['status'](_0x5e9499)[_0x3281('0x2b')](_0x582c4d);};}exports['index']=function(_0x33c738,_0x505ad9){var _0x19addc={},_0x18e34f={},_0x5511f4={'count':0x0,'rows':[]};var _0x4a9382=_[_0x3281('0x2c')](db['SugarcrmConfiguration'][_0x3281('0x2d')],function(_0x5962e4){return{'name':_0x5962e4['fieldName'],'type':_0x5962e4[_0x3281('0x2e')]['key']};});_0x18e34f[_0x3281('0x2f')]=_[_0x3281('0x2c')](_0x4a9382,_0x3281('0x2a'));_0x18e34f[_0x3281('0x30')]=_[_0x3281('0x31')](_0x33c738['query']);_0x18e34f['filters']=_[_0x3281('0x32')](_0x18e34f[_0x3281('0x2f')],_0x18e34f['query']);_0x19addc[_0x3281('0x33')]=_[_0x3281('0x32')](_0x18e34f['model'],qs[_0x3281('0x34')](_0x33c738['query'][_0x3281('0x34')]));_0x19addc['attributes']=_0x19addc[_0x3281('0x33')][_0x3281('0x35')]?_0x19addc[_0x3281('0x33')]:_0x18e34f[_0x3281('0x2f')];if(!_0x33c738[_0x3281('0x30')][_0x3281('0x36')](_0x3281('0x37'))){_0x19addc[_0x3281('0x1e')]=qs['limit'](_0x33c738[_0x3281('0x30')]['limit']);_0x19addc[_0x3281('0x1f')]=qs[_0x3281('0x1f')](_0x33c738['query']['offset']);}_0x19addc[_0x3281('0x38')]=qs[_0x3281('0x39')](_0x33c738['query'][_0x3281('0x39')]);_0x19addc[_0x3281('0x3a')]=qs['filters'](_['pick'](_0x33c738[_0x3281('0x30')],_0x18e34f[_0x3281('0x3b')]),_0x4a9382);if(_0x33c738[_0x3281('0x30')]['filter']){_0x19addc[_0x3281('0x3a')]=_['merge'](_0x19addc[_0x3281('0x3a')],{'$or':_[_0x3281('0x2c')](_0x4a9382,function(_0x269068){if(_0x269068[_0x3281('0x2e')]!==_0x3281('0x3c')){var _0x2f8800={};_0x2f8800[_0x269068[_0x3281('0x2a')]]={'$like':'%'+_0x33c738[_0x3281('0x30')]['filter']+'%'};return _0x2f8800;}})});}_0x19addc=_[_0x3281('0x3d')]({},_0x19addc,_0x33c738[_0x3281('0x3e')]);var _0x2ad61e={'where':_0x19addc['where']};return db[_0x3281('0x3f')][_0x3281('0x20')](_0x2ad61e)[_0x3281('0x27')](function(_0x248040){_0x5511f4[_0x3281('0x20')]=_0x248040;if(_0x33c738['query'][_0x3281('0x40')]){_0x19addc[_0x3281('0x41')]=[{'all':!![]}];}return db[_0x3281('0x3f')]['findAll'](_0x19addc);})[_0x3281('0x27')](function(_0xf708dc){_0x5511f4[_0x3281('0x42')]=_0xf708dc;return _0x5511f4;})['then'](respondWithFilteredResult(_0x505ad9,_0x19addc))['catch'](handleError(_0x505ad9,null));};exports[_0x3281('0x43')]=function(_0x207e44,_0x44f8d7){var _0x2734c6={'raw':![],'where':{'id':_0x207e44[_0x3281('0x44')]['id']}},_0x352db5={};_0x352db5[_0x3281('0x2f')]=_['keys'](db[_0x3281('0x3f')][_0x3281('0x2d')]);_0x352db5[_0x3281('0x30')]=_[_0x3281('0x31')](_0x207e44['query']);_0x352db5[_0x3281('0x3b')]=_['intersection'](_0x352db5['model'],_0x352db5[_0x3281('0x30')]);_0x2734c6[_0x3281('0x33')]=_[_0x3281('0x32')](_0x352db5[_0x3281('0x2f')],qs[_0x3281('0x34')](_0x207e44[_0x3281('0x30')][_0x3281('0x34')]));_0x2734c6[_0x3281('0x33')]=_0x2734c6['attributes']['length']?_0x2734c6[_0x3281('0x33')]:_0x352db5[_0x3281('0x2f')];if(_0x207e44[_0x3281('0x30')][_0x3281('0x40')]){_0x2734c6[_0x3281('0x41')]=[{'all':!![]}];}_0x2734c6=_['merge']({},_0x2734c6,_0x207e44[_0x3281('0x3e')]);return db[_0x3281('0x3f')][_0x3281('0x45')](_0x2734c6)[_0x3281('0x27')](handleEntityNotFound(_0x44f8d7,null))[_0x3281('0x27')](respondWithResult(_0x44f8d7,null))[_0x3281('0x46')](handleError(_0x44f8d7,null));};exports[_0x3281('0x47')]=function(_0x1a6280,_0x3cf15e){return db[_0x3281('0x3f')][_0x3281('0x47')](_0x1a6280[_0x3281('0x48')],{})[_0x3281('0x27')](respondWithResult(_0x3cf15e,0xc9))[_0x3281('0x46')](handleError(_0x3cf15e,null));};exports['update']=function(_0x1b7ccf,_0x34b1f6){if(_0x1b7ccf[_0x3281('0x48')]['id']){delete _0x1b7ccf['body']['id'];}return db[_0x3281('0x3f')]['find']({'where':{'id':_0x1b7ccf['params']['id']}})[_0x3281('0x27')](handleEntityNotFound(_0x34b1f6,null))[_0x3281('0x27')](saveUpdates(_0x1b7ccf[_0x3281('0x48')],null))[_0x3281('0x27')](respondWithResult(_0x34b1f6,null))[_0x3281('0x46')](handleError(_0x34b1f6,null));};exports[_0x3281('0x26')]=function(_0xd3f16f,_0x392bc1){return db[_0x3281('0x3f')][_0x3281('0x45')]({'where':{'id':_0xd3f16f[_0x3281('0x44')]['id']}})[_0x3281('0x27')](handleEntityNotFound(_0x392bc1,null))[_0x3281('0x27')](removeEntity(_0x392bc1,null))['catch'](handleError(_0x392bc1,null));};exports[_0x3281('0x49')]=function(_0x4486a6,_0x50f0b9,_0x188058){var _0xa2822={};var _0x315d6a={};var _0x5a57d7;var _0x5853a9;return db[_0x3281('0x3f')][_0x3281('0x4a')]({'where':{'id':_0x4486a6[_0x3281('0x44')]['id']}})[_0x3281('0x27')](handleEntityNotFound(_0x50f0b9,null))[_0x3281('0x27')](function(_0x52b2b0){if(_0x52b2b0){_0x5a57d7=_0x52b2b0;_0x315d6a['model']=_['keys'](db[_0x3281('0x4b')]['rawAttributes']);_0x315d6a[_0x3281('0x30')]=_[_0x3281('0x31')](_0x4486a6['query']);_0x315d6a[_0x3281('0x3b')]=_[_0x3281('0x32')](_0x315d6a[_0x3281('0x2f')],_0x315d6a['query']);_0xa2822[_0x3281('0x33')]=_['intersection'](_0x315d6a[_0x3281('0x2f')],qs[_0x3281('0x34')](_0x4486a6[_0x3281('0x30')]['fields']));_0xa2822['attributes']=_0xa2822[_0x3281('0x33')]['length']?_0xa2822[_0x3281('0x33')]:_0x315d6a[_0x3281('0x2f')];_0xa2822[_0x3281('0x38')]=qs[_0x3281('0x39')](_0x4486a6[_0x3281('0x30')][_0x3281('0x39')]);_0xa2822[_0x3281('0x3a')]=qs[_0x3281('0x3b')](_[_0x3281('0x4c')](_0x4486a6[_0x3281('0x30')],_0x315d6a[_0x3281('0x3b')]));if(_0x4486a6[_0x3281('0x30')]['filter']){_0xa2822[_0x3281('0x3a')]=_[_0x3281('0x3d')](_0xa2822['where'],{'$or':_['map'](_0xa2822[_0x3281('0x33')],function(_0xbf3c04){var _0x161b1e={};_0x161b1e[_0xbf3c04]={'$like':'%'+_0x4486a6[_0x3281('0x30')][_0x3281('0x4d')]+'%'};return _0x161b1e;})});}_0xa2822=_[_0x3281('0x3d')]({},_0xa2822,_0x4486a6[_0x3281('0x3e')]);return _0x5a57d7[_0x3281('0x49')](_0xa2822);}})[_0x3281('0x27')](function(_0x393f26){if(_0x393f26){_0x5853a9=_0x393f26['length'];if(!_0x4486a6[_0x3281('0x30')]['hasOwnProperty'](_0x3281('0x37'))){_0xa2822[_0x3281('0x1e')]=qs[_0x3281('0x1e')](_0x4486a6[_0x3281('0x30')][_0x3281('0x1e')]);_0xa2822[_0x3281('0x1f')]=qs[_0x3281('0x1f')](_0x4486a6['query']['offset']);}return _0x5a57d7['getFields'](_0xa2822);}})[_0x3281('0x27')](function(_0x4311a3){if(_0x4311a3){return _0x4311a3?{'count':_0x5853a9,'rows':_0x4311a3}:null;}})['then'](respondWithResult(_0x50f0b9,null))['catch'](handleError(_0x50f0b9,null));};exports[_0x3281('0x4e')]=function(_0x397c4c,_0x1e378a,_0x2454f7){var _0x32cebc={};var _0x2d23da={};var _0x340fb2;var _0x59ac12;return db[_0x3281('0x3f')][_0x3281('0x4a')]({'where':{'id':_0x397c4c[_0x3281('0x44')]['id']}})[_0x3281('0x27')](handleEntityNotFound(_0x1e378a,null))[_0x3281('0x27')](function(_0x43c35a){if(_0x43c35a){_0x340fb2=_0x43c35a;_0x2d23da[_0x3281('0x2f')]=_['keys'](db[_0x3281('0x4b')][_0x3281('0x2d')]);_0x2d23da[_0x3281('0x30')]=_[_0x3281('0x31')](_0x397c4c[_0x3281('0x30')]);_0x2d23da[_0x3281('0x3b')]=_[_0x3281('0x32')](_0x2d23da[_0x3281('0x2f')],_0x2d23da[_0x3281('0x30')]);_0x32cebc[_0x3281('0x33')]=_[_0x3281('0x32')](_0x2d23da[_0x3281('0x2f')],qs[_0x3281('0x34')](_0x397c4c['query'][_0x3281('0x34')]));_0x32cebc[_0x3281('0x33')]=_0x32cebc['attributes'][_0x3281('0x35')]?_0x32cebc[_0x3281('0x33')]:_0x2d23da[_0x3281('0x2f')];_0x32cebc['order']=qs[_0x3281('0x39')](_0x397c4c[_0x3281('0x30')][_0x3281('0x39')]);_0x32cebc[_0x3281('0x3a')]=qs[_0x3281('0x3b')](_[_0x3281('0x4c')](_0x397c4c[_0x3281('0x30')],_0x2d23da[_0x3281('0x3b')]));if(_0x397c4c[_0x3281('0x30')]['filter']){_0x32cebc[_0x3281('0x3a')]=_[_0x3281('0x3d')](_0x32cebc[_0x3281('0x3a')],{'$or':_[_0x3281('0x2c')](_0x32cebc[_0x3281('0x33')],function(_0x323211){var _0x4460a4={};_0x4460a4[_0x323211]={'$like':'%'+_0x397c4c[_0x3281('0x30')][_0x3281('0x4d')]+'%'};return _0x4460a4;})});}_0x32cebc=_[_0x3281('0x3d')]({},_0x32cebc,_0x397c4c[_0x3281('0x3e')]);return _0x340fb2['getSubjects'](_0x32cebc);}})[_0x3281('0x27')](function(_0x2a4146){if(_0x2a4146){_0x59ac12=_0x2a4146['length'];if(!_0x397c4c[_0x3281('0x30')]['hasOwnProperty'](_0x3281('0x37'))){_0x32cebc[_0x3281('0x1e')]=qs[_0x3281('0x1e')](_0x397c4c[_0x3281('0x30')][_0x3281('0x1e')]);_0x32cebc[_0x3281('0x1f')]=qs[_0x3281('0x1f')](_0x397c4c[_0x3281('0x30')]['offset']);}return _0x340fb2[_0x3281('0x4e')](_0x32cebc);}})[_0x3281('0x27')](function(_0x48a881){if(_0x48a881){return _0x48a881?{'count':_0x59ac12,'rows':_0x48a881}:null;}})[_0x3281('0x27')](respondWithResult(_0x1e378a,null))[_0x3281('0x46')](handleError(_0x1e378a,null));};exports[_0x3281('0x4f')]=function(_0x5b4b1d,_0x3bf0e6,_0x31d553){var _0x1bd942={};var _0xbb931a={};var _0x4083cd;var _0x2b3ed6;return db[_0x3281('0x3f')][_0x3281('0x4a')]({'where':{'id':_0x5b4b1d[_0x3281('0x44')]['id']}})[_0x3281('0x27')](handleEntityNotFound(_0x3bf0e6,null))[_0x3281('0x27')](function(_0x19be8d){if(_0x19be8d){_0x4083cd=_0x19be8d;_0xbb931a[_0x3281('0x2f')]=_[_0x3281('0x31')](db[_0x3281('0x4b')][_0x3281('0x2d')]);_0xbb931a[_0x3281('0x30')]=_[_0x3281('0x31')](_0x5b4b1d[_0x3281('0x30')]);_0xbb931a[_0x3281('0x3b')]=_[_0x3281('0x32')](_0xbb931a[_0x3281('0x2f')],_0xbb931a[_0x3281('0x30')]);_0x1bd942['attributes']=_[_0x3281('0x32')](_0xbb931a[_0x3281('0x2f')],qs[_0x3281('0x34')](_0x5b4b1d[_0x3281('0x30')][_0x3281('0x34')]));_0x1bd942[_0x3281('0x33')]=_0x1bd942[_0x3281('0x33')]['length']?_0x1bd942[_0x3281('0x33')]:_0xbb931a[_0x3281('0x2f')];_0x1bd942[_0x3281('0x38')]=qs[_0x3281('0x39')](_0x5b4b1d[_0x3281('0x30')][_0x3281('0x39')]);_0x1bd942[_0x3281('0x3a')]=qs[_0x3281('0x3b')](_[_0x3281('0x4c')](_0x5b4b1d['query'],_0xbb931a['filters']));if(_0x5b4b1d['query']['filter']){_0x1bd942['where']=_[_0x3281('0x3d')](_0x1bd942[_0x3281('0x3a')],{'$or':_[_0x3281('0x2c')](_0x1bd942[_0x3281('0x33')],function(_0x5e6ec4){var _0x26e0a8={};_0x26e0a8[_0x5e6ec4]={'$like':'%'+_0x5b4b1d[_0x3281('0x30')]['filter']+'%'};return _0x26e0a8;})});}_0x1bd942=_['merge']({},_0x1bd942,_0x5b4b1d[_0x3281('0x3e')]);return _0x4083cd[_0x3281('0x4f')](_0x1bd942);}})[_0x3281('0x27')](function(_0x15604d){if(_0x15604d){_0x2b3ed6=_0x15604d[_0x3281('0x35')];if(!_0x5b4b1d['query']['hasOwnProperty'](_0x3281('0x37'))){_0x1bd942[_0x3281('0x1e')]=qs['limit'](_0x5b4b1d['query'][_0x3281('0x1e')]);_0x1bd942[_0x3281('0x1f')]=qs[_0x3281('0x1f')](_0x5b4b1d[_0x3281('0x30')][_0x3281('0x1f')]);}return _0x4083cd['getDescriptions'](_0x1bd942);}})[_0x3281('0x27')](function(_0x5abf55){if(_0x5abf55){return _0x5abf55?{'count':_0x2b3ed6,'rows':_0x5abf55}:null;}})['then'](respondWithResult(_0x3bf0e6,null))[_0x3281('0x46')](handleError(_0x3bf0e6,null));};
\ No newline at end of file
index 8ca026b..f0ac7b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbec5=['bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0xbec5,0xdb));var _0x5bec=function(_0x58efa6,_0x2c00bd){_0x58efa6=_0x58efa6-0x0;var _0x5d643c=_0xbec5[_0x58efa6];return _0x5d643c;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require(_0x5bec('0x2'))(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var rp=require(_0x5bec('0x6'));var fs=require('fs');var path=require(_0x5bec('0x7'));var rimraf=require(_0x5bec('0x8'));var config=require(_0x5bec('0x9'));var attributes=require(_0x5bec('0xa'));module[_0x5bec('0xb')]=function(_0x375faa,_0x5652f3){return _0x375faa[_0x5bec('0xc')](_0x5bec('0xd'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x683b=['moment','bluebird','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','../../config/logger'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x683b,0x1ae));var _0xb683=function(_0x16a71a,_0x2eff15){_0x16a71a=_0x16a71a-0x0;var _0x325325=_0x683b[_0x16a71a];return _0x325325;};'use strict';var _=require(_0xb683('0x0'));var util=require('util');var logger=require(_0xb683('0x1'))('api');var moment=require(_0xb683('0x2'));var BPromise=require(_0xb683('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb683('0x4'));var attributes=require(_0xb683('0x5'));module[_0xb683('0x6')]=function(_0x5f5748,_0x21dd06){return _0x5f5748['define'](_0xb683('0x7'),attributes,{'tableName':_0xb683('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a829324..254ad32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d53=['rpc','../../config/environment','jayson/promise','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x1d19ae,_0x4b6bec){var _0x2de03e=function(_0x510e95){while(--_0x510e95){_0x1d19ae['push'](_0x1d19ae['shift']());}};_0x2de03e(++_0x4b6bec);}(_0x0d53,0x13e));var _0x30d5=function(_0x56616a,_0x434898){_0x56616a=_0x56616a-0x0;var _0x4f9f75=_0x0d53[_0x56616a];return _0x4f9f75;};'use strict';var _=require('lodash');var util=require(_0x30d5('0x0'));var moment=require(_0x30d5('0x1'));var BPromise=require(_0x30d5('0x2'));var rs=require(_0x30d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x30d5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x30d5('0x5'));var config=require(_0x30d5('0x6'));var jayson=require(_0x30d5('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45a841,_0x158e94,_0x350446){return new BPromise(function(_0x1de711,_0x301e72){return client[_0x30d5('0x8')](_0x45a841,_0x350446)[_0x30d5('0x9')](function(_0x4b5b62){logger[_0x30d5('0xa')](_0x30d5('0xb'),_0x158e94,_0x30d5('0xc'));logger[_0x30d5('0xd')](_0x30d5('0xe'),_0x158e94,'request\x20sent',JSON['stringify'](_0x4b5b62));if(_0x4b5b62['error']){if(_0x4b5b62[_0x30d5('0xf')]['code']===0x1f4){logger[_0x30d5('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x158e94,_0x4b5b62['error'][_0x30d5('0x10')]);return _0x301e72(_0x4b5b62[_0x30d5('0xf')]['message']);}logger['error'](_0x30d5('0xb'),_0x158e94,_0x4b5b62[_0x30d5('0xf')][_0x30d5('0x10')]);return _0x1de711(_0x4b5b62[_0x30d5('0xf')][_0x30d5('0x10')]);}else{logger['info'](_0x30d5('0xb'),_0x158e94,'request\x20sent');_0x1de711(_0x4b5b62[_0x30d5('0x11')][_0x30d5('0x10')]);}})[_0x30d5('0x12')](function(_0x4de23d){logger['error'](_0x30d5('0xb'),_0x158e94,_0x4de23d);_0x301e72(_0x4de23d);});});}
\ No newline at end of file
+var _0x83b2=['http','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x83b2,0x106));var _0x283b=function(_0x4cf446,_0x474358){_0x4cf446=_0x4cf446-0x0;var _0x287890=_0x83b2[_0x4cf446];return _0x287890;};'use strict';var _=require(_0x283b('0x0'));var util=require(_0x283b('0x1'));var moment=require('moment');var BPromise=require(_0x283b('0x2'));var rs=require(_0x283b('0x3'));var fs=require('fs');var Redis=require(_0x283b('0x4'));var db=require(_0x283b('0x5'))['db'];var utils=require(_0x283b('0x6'));var logger=require(_0x283b('0x7'))('rpc');var config=require(_0x283b('0x8'));var jayson=require(_0x283b('0x9'));var client=jayson[_0x283b('0xa')][_0x283b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3da5ec,_0xdf4076,_0x1403fd){return new BPromise(function(_0x317097,_0x3b1f05){return client['request'](_0x3da5ec,_0x1403fd)['then'](function(_0x15287a){logger[_0x283b('0xc')](_0x283b('0xd'),_0xdf4076,_0x283b('0xe'));logger[_0x283b('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xdf4076,_0x283b('0xe'),JSON['stringify'](_0x15287a));if(_0x15287a[_0x283b('0x10')]){if(_0x15287a[_0x283b('0x10')][_0x283b('0x11')]===0x1f4){logger[_0x283b('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xdf4076,_0x15287a[_0x283b('0x10')][_0x283b('0x12')]);return _0x3b1f05(_0x15287a[_0x283b('0x10')][_0x283b('0x12')]);}logger[_0x283b('0x10')](_0x283b('0xd'),_0xdf4076,_0x15287a['error']['message']);return _0x317097(_0x15287a['error']['message']);}else{logger[_0x283b('0xc')](_0x283b('0xd'),_0xdf4076,_0x283b('0xe'));_0x317097(_0x15287a[_0x283b('0x13')][_0x283b('0x12')]);}})[_0x283b('0x14')](function(_0x3f0814){logger[_0x283b('0x10')](_0x283b('0xd'),_0xdf4076,_0x3f0814);_0x3b1f05(_0x3f0814);});});}
\ No newline at end of file
index 0eb5c16..9d7878b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x169a=['exports','multer','util','express','Router','fs-extra','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','put'];(function(_0x4d2f00,_0x4e94d5){var _0x2d7b7f=function(_0x18fa08){while(--_0x18fa08){_0x4d2f00['push'](_0x4d2f00['shift']());}};_0x2d7b7f(++_0x4e94d5);}(_0x169a,0x17b));var _0xa169=function(_0x5b3244,_0x5479ba){_0x5b3244=_0x5b3244-0x0;var _0x23732f=_0x169a[_0x5b3244];return _0x23732f;};'use strict';var multer=require(_0xa169('0x0'));var util=require(_0xa169('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa169('0x2'));var router=express[_0xa169('0x3')]();var fs_extra=require(_0xa169('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa169('0x5'));var config=require('../../config/environment');var controller=require(_0xa169('0x6'));router[_0xa169('0x7')]('/',auth[_0xa169('0x8')](),controller[_0xa169('0x9')]);router['get'](_0xa169('0xa'),auth[_0xa169('0x8')](),controller[_0xa169('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa169('0xc')](_0xa169('0xa'),auth[_0xa169('0x8')](),controller['update']);router['delete'](_0xa169('0xa'),auth[_0xa169('0x8')](),controller['destroy']);module[_0xa169('0xd')]=router;
\ No newline at end of file
+var _0x6d23=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','get','show','post','create','put','update','delete','destroy','multer'];(function(_0x45bba6,_0x2aaddc){var _0x53d26c=function(_0x407ef8){while(--_0x407ef8){_0x45bba6['push'](_0x45bba6['shift']());}};_0x53d26c(++_0x2aaddc);}(_0x6d23,0x6b));var _0x36d2=function(_0x3f3a13,_0x742bb6){_0x3f3a13=_0x3f3a13-0x0;var _0x104937=_0x6d23[_0x3f3a13];return _0x104937;};'use strict';var multer=require(_0x36d2('0x0'));var util=require(_0x36d2('0x1'));var path=require('path');var timeout=require(_0x36d2('0x2'));var express=require(_0x36d2('0x3'));var router=express[_0x36d2('0x4')]();var fs_extra=require(_0x36d2('0x5'));var auth=require(_0x36d2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x36d2('0x7'));var controller=require(_0x36d2('0x8'));router['get']('/',auth[_0x36d2('0x9')](),controller['index']);router[_0x36d2('0xa')]('/:id',auth[_0x36d2('0x9')](),controller[_0x36d2('0xb')]);router[_0x36d2('0xc')]('/',auth[_0x36d2('0x9')](),controller[_0x36d2('0xd')]);router[_0x36d2('0xe')]('/:id',auth[_0x36d2('0x9')](),controller[_0x36d2('0xf')]);router[_0x36d2('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x36d2('0x11')]);module['exports']=router;
\ No newline at end of file
index ef6701f..3d957f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc366=['picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue'];(function(_0x135904,_0x1e252b){var _0x1ce7d5=function(_0x25a721){while(--_0x25a721){_0x135904['push'](_0x135904['shift']());}};_0x1ce7d5(++_0x1e252b);}(_0xc366,0xff));var _0x6c36=function(_0x4385c2,_0x89adfb){_0x4385c2=_0x4385c2-0x0;var _0x28a0d9=_0xc366[_0x4385c2];return _0x28a0d9;};'use strict';var Sequelize=require(_0x6c36('0x0'));module['exports']={'type':{'type':Sequelize[_0x6c36('0x1')](_0x6c36('0x2'),_0x6c36('0x3'),_0x6c36('0x4'),_0x6c36('0x5'),_0x6c36('0x6')),'defaultValue':_0x6c36('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6c36('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x6c36('0x2'),'variable',_0x6c36('0x4'))},'keyContent':{'type':Sequelize[_0x6c36('0x7')]},'idField':{'type':Sequelize[_0x6c36('0x7')]},'nameField':{'type':Sequelize[_0x6c36('0x7')]},'customField':{'type':Sequelize[_0x6c36('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6c36('0x7')]}};
\ No newline at end of file
+var _0x3b2b=['customVariable','BOOLEAN','sequelize','exports','ENUM','variable','picklist','string','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3b2b,0xc8));var _0xb3b2=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x3b2b[_0x2160a9];return _0xa88cf7;};'use strict';var Sequelize=require(_0xb3b2('0x0'));module[_0xb3b2('0x1')]={'type':{'type':Sequelize[_0xb3b2('0x2')]('string',_0xb3b2('0x3'),'customVariable','keyValue',_0xb3b2('0x4')),'defaultValue':_0xb3b2('0x5')},'content':{'type':Sequelize[_0xb3b2('0x6')]},'key':{'type':Sequelize[_0xb3b2('0x6')]},'keyType':{'type':Sequelize[_0xb3b2('0x2')](_0xb3b2('0x5'),'variable',_0xb3b2('0x7'))},'keyContent':{'type':Sequelize[_0xb3b2('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb3b2('0x6')]},'customField':{'type':Sequelize[_0xb3b2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb3b2('0x6')]}};
\ No newline at end of file
index e5906d8..207d964 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb654=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','find','body','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x20f72a,_0x42a8d3){var _0x5dc474=function(_0x17500e){while(--_0x17500e){_0x20f72a['push'](_0x20f72a['shift']());}};_0x5dc474(++_0x42a8d3);}(_0xb654,0x116));var _0x4b65=function(_0x1ab396,_0x44f3f7){_0x1ab396=_0x1ab396-0x0;var _0x36ad94=_0xb654[_0x1ab396];return _0x36ad94;};'use strict';var emlformat=require(_0x4b65('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b65('0x1'));var jsonpatch=require(_0x4b65('0x2'));var rp=require(_0x4b65('0x3'));var moment=require('moment');var BPromise=require(_0x4b65('0x4'));var Mustache=require(_0x4b65('0x5'));var util=require('util');var path=require('path');var sox=require(_0x4b65('0x6'));var csv=require(_0x4b65('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b65('0x8'));var _=require(_0x4b65('0x9'));var squel=require(_0x4b65('0xa'));var crypto=require('crypto');var jsforce=require(_0x4b65('0xb'));var deskjs=require(_0x4b65('0xc'));var toCsv=require(_0x4b65('0x7'));var querystring=require(_0x4b65('0xd'));var Papa=require('papaparse');var Redis=require(_0x4b65('0xe'));var authService=require(_0x4b65('0xf'));var qs=require(_0x4b65('0x10'));var as=require(_0x4b65('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b65('0x12'))(_0x4b65('0x13'));var utils=require(_0x4b65('0x14'));var config=require(_0x4b65('0x15'));var licenseUtil=require(_0x4b65('0x16'));var db=require(_0x4b65('0x17'))['db'];function respondWithStatusCode(_0x3ad251,_0x522584){_0x522584=_0x522584||0xcc;return function(_0x562493){if(_0x562493){return _0x3ad251[_0x4b65('0x18')](_0x522584);}return _0x3ad251['status'](_0x522584)[_0x4b65('0x19')]();};}function respondWithResult(_0x20d850,_0x1dc5da){_0x1dc5da=_0x1dc5da||0xc8;return function(_0x1b82de){if(_0x1b82de){return _0x20d850[_0x4b65('0x1a')](_0x1dc5da)[_0x4b65('0x1b')](_0x1b82de);}};}function respondWithFilteredResult(_0x2d619f,_0x3b8be1){return function(_0x25dc88){if(_0x25dc88){var _0x35a8f3=typeof _0x3b8be1[_0x4b65('0x1c')]===_0x4b65('0x1d')&&typeof _0x3b8be1[_0x4b65('0x1e')]==='undefined';var _0x31fa88=_0x25dc88['count'];var _0x5e6678=_0x35a8f3?0x0:_0x3b8be1['offset'];var _0x4ef232=_0x35a8f3?_0x25dc88[_0x4b65('0x1f')]:_0x3b8be1[_0x4b65('0x1c')]+_0x3b8be1[_0x4b65('0x1e')];var _0x5dfe5d;if(_0x4ef232>=_0x31fa88){_0x4ef232=_0x31fa88;_0x5dfe5d=0xc8;}else{_0x5dfe5d=0xce;}_0x2d619f[_0x4b65('0x1a')](_0x5dfe5d);return _0x2d619f[_0x4b65('0x20')](_0x4b65('0x21'),_0x5e6678+'-'+_0x4ef232+'/'+_0x31fa88)[_0x4b65('0x1b')](_0x25dc88);}return null;};}function patchUpdates(_0x272c4c){return function(_0x1fce88){try{jsonpatch[_0x4b65('0x22')](_0x1fce88,_0x272c4c,!![]);}catch(_0x41f3cf){return BPromise['reject'](_0x41f3cf);}return _0x1fce88[_0x4b65('0x23')]();};}function saveUpdates(_0x559064,_0x1402c1){return function(_0x3078a5){if(_0x3078a5){return _0x3078a5[_0x4b65('0x24')](_0x559064)[_0x4b65('0x25')](function(_0x14b30e){return _0x14b30e;});}return null;};}function removeEntity(_0x7c6f57,_0x4751f6){return function(_0x579cb3){if(_0x579cb3){return _0x579cb3[_0x4b65('0x26')]()[_0x4b65('0x25')](function(){_0x7c6f57[_0x4b65('0x1a')](0xcc)[_0x4b65('0x19')]();});}};}function handleEntityNotFound(_0x2ac886,_0x59ec7e){return function(_0x4d939f){if(!_0x4d939f){_0x2ac886['sendStatus'](0x194);}return _0x4d939f;};}function handleError(_0x1c55a0,_0x4560ba){_0x4560ba=_0x4560ba||0x1f4;return function(_0x46c874){logger[_0x4b65('0x27')](_0x46c874[_0x4b65('0x28')]);if(_0x46c874[_0x4b65('0x29')]){delete _0x46c874['name'];}_0x1c55a0[_0x4b65('0x1a')](_0x4560ba)[_0x4b65('0x2a')](_0x46c874);};}exports[_0x4b65('0x2b')]=function(_0x57c00c,_0x2b9206){var _0x10d6f5={},_0x5935cb={},_0x38f60a={'count':0x0,'rows':[]};var _0x5d926d=_[_0x4b65('0x2c')](db[_0x4b65('0x2d')][_0x4b65('0x2e')],function(_0x587c7b){return{'name':_0x587c7b[_0x4b65('0x2f')],'type':_0x587c7b[_0x4b65('0x30')][_0x4b65('0x31')]};});_0x5935cb[_0x4b65('0x32')]=_['map'](_0x5d926d,_0x4b65('0x29'));_0x5935cb['query']=_[_0x4b65('0x33')](_0x57c00c[_0x4b65('0x34')]);_0x5935cb['filters']=_[_0x4b65('0x35')](_0x5935cb[_0x4b65('0x32')],_0x5935cb[_0x4b65('0x34')]);_0x10d6f5[_0x4b65('0x36')]=_[_0x4b65('0x35')](_0x5935cb[_0x4b65('0x32')],qs[_0x4b65('0x37')](_0x57c00c[_0x4b65('0x34')]['fields']));_0x10d6f5[_0x4b65('0x36')]=_0x10d6f5[_0x4b65('0x36')][_0x4b65('0x38')]?_0x10d6f5['attributes']:_0x5935cb[_0x4b65('0x32')];if(!_0x57c00c[_0x4b65('0x34')][_0x4b65('0x39')](_0x4b65('0x3a'))){_0x10d6f5[_0x4b65('0x1e')]=qs['limit'](_0x57c00c[_0x4b65('0x34')][_0x4b65('0x1e')]);_0x10d6f5['offset']=qs[_0x4b65('0x1c')](_0x57c00c['query'][_0x4b65('0x1c')]);}_0x10d6f5['order']=qs[_0x4b65('0x3b')](_0x57c00c['query'][_0x4b65('0x3b')]);_0x10d6f5[_0x4b65('0x3c')]=qs[_0x4b65('0x3d')](_[_0x4b65('0x3e')](_0x57c00c[_0x4b65('0x34')],_0x5935cb['filters']),_0x5d926d);if(_0x57c00c[_0x4b65('0x34')]['filter']){_0x10d6f5['where']=_[_0x4b65('0x3f')](_0x10d6f5[_0x4b65('0x3c')],{'$or':_[_0x4b65('0x2c')](_0x5d926d,function(_0x5b42d7){if(_0x5b42d7[_0x4b65('0x30')]!==_0x4b65('0x40')){var _0x1b45ce={};_0x1b45ce[_0x5b42d7[_0x4b65('0x29')]]={'$like':'%'+_0x57c00c['query'][_0x4b65('0x41')]+'%'};return _0x1b45ce;}})});}_0x10d6f5=_[_0x4b65('0x3f')]({},_0x10d6f5,_0x57c00c[_0x4b65('0x42')]);var _0x546164={'where':_0x10d6f5[_0x4b65('0x3c')]};return db[_0x4b65('0x2d')][_0x4b65('0x1f')](_0x546164)[_0x4b65('0x25')](function(_0x30029d){_0x38f60a['count']=_0x30029d;if(_0x57c00c['query'][_0x4b65('0x43')]){_0x10d6f5[_0x4b65('0x44')]=[{'all':!![]}];}return db[_0x4b65('0x2d')][_0x4b65('0x45')](_0x10d6f5);})[_0x4b65('0x25')](function(_0xdedc89){_0x38f60a[_0x4b65('0x46')]=_0xdedc89;return _0x38f60a;})[_0x4b65('0x25')](respondWithFilteredResult(_0x2b9206,_0x10d6f5))[_0x4b65('0x47')](handleError(_0x2b9206,null));};exports['show']=function(_0x5b023c,_0x1a7fa1){var _0x3ef092={'raw':!![],'where':{'id':_0x5b023c['params']['id']}},_0x1b05bd={};_0x1b05bd[_0x4b65('0x32')]=_[_0x4b65('0x33')](db['SugarcrmField']['rawAttributes']);_0x1b05bd[_0x4b65('0x34')]=_[_0x4b65('0x33')](_0x5b023c[_0x4b65('0x34')]);_0x1b05bd[_0x4b65('0x3d')]=_[_0x4b65('0x35')](_0x1b05bd[_0x4b65('0x32')],_0x1b05bd['query']);_0x3ef092['attributes']=_[_0x4b65('0x35')](_0x1b05bd[_0x4b65('0x32')],qs[_0x4b65('0x37')](_0x5b023c['query'][_0x4b65('0x37')]));_0x3ef092[_0x4b65('0x36')]=_0x3ef092[_0x4b65('0x36')][_0x4b65('0x38')]?_0x3ef092['attributes']:_0x1b05bd[_0x4b65('0x32')];if(_0x5b023c[_0x4b65('0x34')][_0x4b65('0x43')]){_0x3ef092['include']=[{'all':!![]}];}_0x3ef092=_[_0x4b65('0x3f')]({},_0x3ef092,_0x5b023c['options']);return db[_0x4b65('0x2d')][_0x4b65('0x48')](_0x3ef092)[_0x4b65('0x25')](handleEntityNotFound(_0x1a7fa1,null))[_0x4b65('0x25')](respondWithResult(_0x1a7fa1,null))['catch'](handleError(_0x1a7fa1,null));};exports['create']=function(_0x43cea3,_0x478f99){return db[_0x4b65('0x2d')]['create'](_0x43cea3[_0x4b65('0x49')],{})[_0x4b65('0x25')](respondWithResult(_0x478f99,0xc9))[_0x4b65('0x47')](handleError(_0x478f99,null));};exports['update']=function(_0x4fea37,_0x5c8da4){if(_0x4fea37[_0x4b65('0x49')]['id']){delete _0x4fea37[_0x4b65('0x49')]['id'];}return db[_0x4b65('0x2d')]['find']({'where':{'id':_0x4fea37['params']['id']}})['then'](handleEntityNotFound(_0x5c8da4,null))[_0x4b65('0x25')](saveUpdates(_0x4fea37[_0x4b65('0x49')],null))[_0x4b65('0x25')](respondWithResult(_0x5c8da4,null))[_0x4b65('0x47')](handleError(_0x5c8da4,null));};exports[_0x4b65('0x26')]=function(_0xd13a09,_0x3c97ba){return db[_0x4b65('0x2d')]['find']({'where':{'id':_0xd13a09[_0x4b65('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3c97ba,null))[_0x4b65('0x25')](removeEntity(_0x3c97ba,null))['catch'](handleError(_0x3c97ba,null));};
\ No newline at end of file
+var _0x68cb=['fields','nolimit','sort','where','pick','filter','VIRTUAL','merge','findAll','rows','catch','params','intersection','include','options','find','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','destroy','then','error','name','send','index','map','SugarcrmField','rawAttributes','type','key','model','query','keys','filters','attributes'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x68cb,0x1b6));var _0xb68c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x68cb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb68c('0x0'));var rimraf=require(_0xb68c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb68c('0x2'));var rp=require(_0xb68c('0x3'));var moment=require(_0xb68c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb68c('0x5'));var util=require(_0xb68c('0x6'));var path=require('path');var sox=require(_0xb68c('0x7'));var csv=require(_0xb68c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb68c('0x9'));var _=require(_0xb68c('0xa'));var squel=require('squel');var crypto=require(_0xb68c('0xb'));var jsforce=require(_0xb68c('0xc'));var deskjs=require(_0xb68c('0xd'));var toCsv=require(_0xb68c('0x8'));var querystring=require(_0xb68c('0xe'));var Papa=require(_0xb68c('0xf'));var Redis=require(_0xb68c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb68c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb68c('0x12'));var logger=require(_0xb68c('0x13'))(_0xb68c('0x14'));var utils=require(_0xb68c('0x15'));var config=require(_0xb68c('0x16'));var licenseUtil=require(_0xb68c('0x17'));var db=require(_0xb68c('0x18'))['db'];function respondWithStatusCode(_0x16673a,_0x53fad2){_0x53fad2=_0x53fad2||0xcc;return function(_0x3f7e6a){if(_0x3f7e6a){return _0x16673a[_0xb68c('0x19')](_0x53fad2);}return _0x16673a[_0xb68c('0x1a')](_0x53fad2)[_0xb68c('0x1b')]();};}function respondWithResult(_0x4148ac,_0x1281ac){_0x1281ac=_0x1281ac||0xc8;return function(_0xda9724){if(_0xda9724){return _0x4148ac['status'](_0x1281ac)[_0xb68c('0x1c')](_0xda9724);}};}function respondWithFilteredResult(_0x419134,_0x149b19){return function(_0x574e05){if(_0x574e05){var _0x578cec=typeof _0x149b19['offset']===_0xb68c('0x1d')&&typeof _0x149b19[_0xb68c('0x1e')]==='undefined';var _0x43e50b=_0x574e05[_0xb68c('0x1f')];var _0x396437=_0x578cec?0x0:_0x149b19[_0xb68c('0x20')];var _0x25d3c8=_0x578cec?_0x574e05[_0xb68c('0x1f')]:_0x149b19['offset']+_0x149b19['limit'];var _0x50baba;if(_0x25d3c8>=_0x43e50b){_0x25d3c8=_0x43e50b;_0x50baba=0xc8;}else{_0x50baba=0xce;}_0x419134[_0xb68c('0x1a')](_0x50baba);return _0x419134['set'](_0xb68c('0x21'),_0x396437+'-'+_0x25d3c8+'/'+_0x43e50b)[_0xb68c('0x1c')](_0x574e05);}return null;};}function patchUpdates(_0x3fcf97){return function(_0x31b0df){try{jsonpatch['apply'](_0x31b0df,_0x3fcf97,!![]);}catch(_0x159aba){return BPromise[_0xb68c('0x22')](_0x159aba);}return _0x31b0df[_0xb68c('0x23')]();};}function saveUpdates(_0x3f312c,_0x11f83f){return function(_0x5ec588){if(_0x5ec588){return _0x5ec588['update'](_0x3f312c)['then'](function(_0x197fd1){return _0x197fd1;});}return null;};}function removeEntity(_0x98919b,_0x39be84){return function(_0x5c5d3b){if(_0x5c5d3b){return _0x5c5d3b[_0xb68c('0x24')]()[_0xb68c('0x25')](function(){_0x98919b[_0xb68c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9882d,_0x3e41fb){return function(_0x5751e0){if(!_0x5751e0){_0x9882d[_0xb68c('0x19')](0x194);}return _0x5751e0;};}function handleError(_0x3d3e4d,_0x4b94d1){_0x4b94d1=_0x4b94d1||0x1f4;return function(_0x3d71c9){logger[_0xb68c('0x26')](_0x3d71c9['stack']);if(_0x3d71c9[_0xb68c('0x27')]){delete _0x3d71c9[_0xb68c('0x27')];}_0x3d3e4d[_0xb68c('0x1a')](_0x4b94d1)[_0xb68c('0x28')](_0x3d71c9);};}exports[_0xb68c('0x29')]=function(_0x105d5b,_0x2f4283){var _0x143a23={},_0x27f8d4={},_0x2e19d7={'count':0x0,'rows':[]};var _0x13097c=_[_0xb68c('0x2a')](db[_0xb68c('0x2b')][_0xb68c('0x2c')],function(_0x3a0558){return{'name':_0x3a0558['fieldName'],'type':_0x3a0558[_0xb68c('0x2d')][_0xb68c('0x2e')]};});_0x27f8d4[_0xb68c('0x2f')]=_[_0xb68c('0x2a')](_0x13097c,_0xb68c('0x27'));_0x27f8d4[_0xb68c('0x30')]=_[_0xb68c('0x31')](_0x105d5b[_0xb68c('0x30')]);_0x27f8d4[_0xb68c('0x32')]=_['intersection'](_0x27f8d4['model'],_0x27f8d4[_0xb68c('0x30')]);_0x143a23[_0xb68c('0x33')]=_['intersection'](_0x27f8d4[_0xb68c('0x2f')],qs[_0xb68c('0x34')](_0x105d5b['query']['fields']));_0x143a23[_0xb68c('0x33')]=_0x143a23['attributes']['length']?_0x143a23[_0xb68c('0x33')]:_0x27f8d4[_0xb68c('0x2f')];if(!_0x105d5b[_0xb68c('0x30')]['hasOwnProperty'](_0xb68c('0x35'))){_0x143a23[_0xb68c('0x1e')]=qs['limit'](_0x105d5b['query'][_0xb68c('0x1e')]);_0x143a23[_0xb68c('0x20')]=qs['offset'](_0x105d5b[_0xb68c('0x30')][_0xb68c('0x20')]);}_0x143a23['order']=qs[_0xb68c('0x36')](_0x105d5b['query'][_0xb68c('0x36')]);_0x143a23[_0xb68c('0x37')]=qs['filters'](_[_0xb68c('0x38')](_0x105d5b[_0xb68c('0x30')],_0x27f8d4[_0xb68c('0x32')]),_0x13097c);if(_0x105d5b['query'][_0xb68c('0x39')]){_0x143a23[_0xb68c('0x37')]=_['merge'](_0x143a23[_0xb68c('0x37')],{'$or':_[_0xb68c('0x2a')](_0x13097c,function(_0x1f785d){if(_0x1f785d['type']!==_0xb68c('0x3a')){var _0x2e6761={};_0x2e6761[_0x1f785d['name']]={'$like':'%'+_0x105d5b['query'][_0xb68c('0x39')]+'%'};return _0x2e6761;}})});}_0x143a23=_[_0xb68c('0x3b')]({},_0x143a23,_0x105d5b['options']);var _0x471b0f={'where':_0x143a23['where']};return db[_0xb68c('0x2b')][_0xb68c('0x1f')](_0x471b0f)['then'](function(_0x236a37){_0x2e19d7[_0xb68c('0x1f')]=_0x236a37;if(_0x105d5b[_0xb68c('0x30')]['includeAll']){_0x143a23['include']=[{'all':!![]}];}return db[_0xb68c('0x2b')][_0xb68c('0x3c')](_0x143a23);})[_0xb68c('0x25')](function(_0x328539){_0x2e19d7[_0xb68c('0x3d')]=_0x328539;return _0x2e19d7;})['then'](respondWithFilteredResult(_0x2f4283,_0x143a23))[_0xb68c('0x3e')](handleError(_0x2f4283,null));};exports['show']=function(_0x4cee9d,_0x17ff81){var _0x56b8c7={'raw':!![],'where':{'id':_0x4cee9d[_0xb68c('0x3f')]['id']}},_0x1e9f84={};_0x1e9f84[_0xb68c('0x2f')]=_[_0xb68c('0x31')](db[_0xb68c('0x2b')][_0xb68c('0x2c')]);_0x1e9f84['query']=_[_0xb68c('0x31')](_0x4cee9d[_0xb68c('0x30')]);_0x1e9f84[_0xb68c('0x32')]=_[_0xb68c('0x40')](_0x1e9f84[_0xb68c('0x2f')],_0x1e9f84[_0xb68c('0x30')]);_0x56b8c7['attributes']=_['intersection'](_0x1e9f84[_0xb68c('0x2f')],qs[_0xb68c('0x34')](_0x4cee9d[_0xb68c('0x30')][_0xb68c('0x34')]));_0x56b8c7['attributes']=_0x56b8c7[_0xb68c('0x33')]['length']?_0x56b8c7[_0xb68c('0x33')]:_0x1e9f84[_0xb68c('0x2f')];if(_0x4cee9d[_0xb68c('0x30')]['includeAll']){_0x56b8c7[_0xb68c('0x41')]=[{'all':!![]}];}_0x56b8c7=_['merge']({},_0x56b8c7,_0x4cee9d[_0xb68c('0x42')]);return db[_0xb68c('0x2b')][_0xb68c('0x43')](_0x56b8c7)[_0xb68c('0x25')](handleEntityNotFound(_0x17ff81,null))[_0xb68c('0x25')](respondWithResult(_0x17ff81,null))[_0xb68c('0x3e')](handleError(_0x17ff81,null));};exports['create']=function(_0x15f8b6,_0x37ed1d){return db[_0xb68c('0x2b')]['create'](_0x15f8b6[_0xb68c('0x44')],{})['then'](respondWithResult(_0x37ed1d,0xc9))[_0xb68c('0x3e')](handleError(_0x37ed1d,null));};exports[_0xb68c('0x45')]=function(_0xe0cb47,_0x491c76){if(_0xe0cb47[_0xb68c('0x44')]['id']){delete _0xe0cb47[_0xb68c('0x44')]['id'];}return db['SugarcrmField'][_0xb68c('0x43')]({'where':{'id':_0xe0cb47[_0xb68c('0x3f')]['id']}})[_0xb68c('0x25')](handleEntityNotFound(_0x491c76,null))[_0xb68c('0x25')](saveUpdates(_0xe0cb47[_0xb68c('0x44')],null))['then'](respondWithResult(_0x491c76,null))[_0xb68c('0x3e')](handleError(_0x491c76,null));};exports[_0xb68c('0x24')]=function(_0x1f63c3,_0x31a8fe){return db[_0xb68c('0x2b')][_0xb68c('0x43')]({'where':{'id':_0x1f63c3[_0xb68c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x31a8fe,null))['then'](removeEntity(_0x31a8fe,null))[_0xb68c('0x3e')](handleError(_0x31a8fe,null));};
\ No newline at end of file
index ce3b849..4b3dadc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe10=['sugarcrm_unique_index','idField','FieldId','util','../../config/logger','api','moment','path','rimraf','./intSugarcrmField.attributes','exports'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xbe10,0x9d));var _0x0be1=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xbe10[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0x0be1('0x0'));var logger=require(_0x0be1('0x1'))(_0x0be1('0x2'));var moment=require(_0x0be1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0be1('0x4'));var rimraf=require(_0x0be1('0x5'));var config=require('../../config/environment');var attributes=require(_0x0be1('0x6'));module[_0x0be1('0x7')]=function(_0xaeec2,_0xc83bf){return _0xaeec2['define']('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x0be1('0x8'),'fields':[_0x0be1('0x9'),_0x0be1('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x448a=['lodash','../../config/logger','moment','bluebird','path','rimraf','define','SugarcrmField','sugarcrm_unique_index','FieldId'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x448a,0x17c));var _0xa448=function(_0x5cd41f,_0x1c7802){_0x5cd41f=_0x5cd41f-0x0;var _0x3d398f=_0x448a[_0x5cd41f];return _0x3d398f;};'use strict';var _=require(_0xa448('0x0'));var util=require('util');var logger=require(_0xa448('0x1'))('api');var moment=require(_0xa448('0x2'));var BPromise=require(_0xa448('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa448('0x4'));var rimraf=require(_0xa448('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x3aad12,_0x4d3310){return _0x3aad12[_0xa448('0x6')](_0xa448('0x7'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xa448('0x8'),'fields':['idField',_0xa448('0x9')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 48882ca..436a7a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3885=['info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x184800,_0x13f14e){var _0x58e20b=function(_0x481e55){while(--_0x481e55){_0x184800['push'](_0x184800['shift']());}};_0x58e20b(++_0x13f14e);}(_0x3885,0x19a));var _0x5388=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3885[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5388('0x0'));var BPromise=require(_0x5388('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5388('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5388('0x3'));var logger=require(_0x5388('0x4'))('rpc');var config=require(_0x5388('0x5'));var jayson=require(_0x5388('0x6'));var client=jayson[_0x5388('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10e117,_0x3bfcb6,_0x11dd06){return new BPromise(function(_0x38ef0d,_0x5de960){return client[_0x5388('0x8')](_0x10e117,_0x11dd06)[_0x5388('0x9')](function(_0x630d4d){logger[_0x5388('0xa')](_0x5388('0xb'),_0x3bfcb6,_0x5388('0xc'));logger['debug'](_0x5388('0xd'),_0x3bfcb6,_0x5388('0xc'),JSON[_0x5388('0xe')](_0x630d4d));if(_0x630d4d[_0x5388('0xf')]){if(_0x630d4d[_0x5388('0xf')][_0x5388('0x10')]===0x1f4){logger[_0x5388('0xf')](_0x5388('0xb'),_0x3bfcb6,_0x630d4d[_0x5388('0xf')][_0x5388('0x11')]);return _0x5de960(_0x630d4d['error'][_0x5388('0x11')]);}logger[_0x5388('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x3bfcb6,_0x630d4d[_0x5388('0xf')][_0x5388('0x11')]);return _0x38ef0d(_0x630d4d['error']['message']);}else{logger['info'](_0x5388('0xb'),_0x3bfcb6,'request\x20sent');_0x38ef0d(_0x630d4d[_0x5388('0x12')]['message']);}})[_0x5388('0x13')](function(_0x519522){logger[_0x5388('0xf')](_0x5388('0xb'),_0x3bfcb6,_0x519522);_0x5de960(_0x519522);});});}
\ No newline at end of file
+var _0x9d36=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','message','SugarcrmField,\x20%s,\x20%s','info','result','util','moment'];(function(_0x1687c6,_0x181c03){var _0x58dbef=function(_0x1e251d){while(--_0x1e251d){_0x1687c6['push'](_0x1687c6['shift']());}};_0x58dbef(++_0x181c03);}(_0x9d36,0x18a));var _0x69d3=function(_0x184eed,_0x489482){_0x184eed=_0x184eed-0x0;var _0x3bddaf=_0x9d36[_0x184eed];return _0x3bddaf;};'use strict';var _=require('lodash');var util=require(_0x69d3('0x0'));var moment=require(_0x69d3('0x1'));var BPromise=require(_0x69d3('0x2'));var rs=require(_0x69d3('0x3'));var fs=require('fs');var Redis=require(_0x69d3('0x4'));var db=require(_0x69d3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x69d3('0x6'))(_0x69d3('0x7'));var config=require(_0x69d3('0x8'));var jayson=require(_0x69d3('0x9'));var client=jayson[_0x69d3('0xa')][_0x69d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x249f1a,_0x452f0d,_0x53bd82){return new BPromise(function(_0x138f2d,_0x3964f4){return client[_0x69d3('0xc')](_0x249f1a,_0x53bd82)['then'](function(_0x6176f1){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x452f0d,_0x69d3('0xd'));logger[_0x69d3('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x452f0d,'request\x20sent',JSON[_0x69d3('0xf')](_0x6176f1));if(_0x6176f1[_0x69d3('0x10')]){if(_0x6176f1[_0x69d3('0x10')][_0x69d3('0x11')]===0x1f4){logger[_0x69d3('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x452f0d,_0x6176f1[_0x69d3('0x10')][_0x69d3('0x12')]);return _0x3964f4(_0x6176f1[_0x69d3('0x10')][_0x69d3('0x12')]);}logger['error'](_0x69d3('0x13'),_0x452f0d,_0x6176f1[_0x69d3('0x10')]['message']);return _0x138f2d(_0x6176f1['error'][_0x69d3('0x12')]);}else{logger[_0x69d3('0x14')]('SugarcrmField,\x20%s,\x20%s',_0x452f0d,_0x69d3('0xd'));_0x138f2d(_0x6176f1[_0x69d3('0x15')][_0x69d3('0x12')]);}})['catch'](function(_0x510292){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x452f0d,_0x510292);_0x3964f4(_0x510292);});});}
\ No newline at end of file
index bb01627..134cf6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad36=['getFields','post','addConfiguration','put','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x1dd532,_0x36e81c){var _0x3732aa=function(_0x19d50a){while(--_0x19d50a){_0x1dd532['push'](_0x1dd532['shift']());}};_0x3732aa(++_0x36e81c);}(_0xad36,0x11c));var _0x6ad3=function(_0x12ccc1,_0x11f34d){_0x12ccc1=_0x12ccc1-0x0;var _0x6da3be=_0xad36[_0x12ccc1];return _0x6da3be;};'use strict';var multer=require('multer');var util=require(_0x6ad3('0x0'));var path=require(_0x6ad3('0x1'));var timeout=require(_0x6ad3('0x2'));var express=require(_0x6ad3('0x3'));var router=express[_0x6ad3('0x4')]();var fs_extra=require(_0x6ad3('0x5'));var auth=require(_0x6ad3('0x6'));var interaction=require(_0x6ad3('0x7'));var config=require(_0x6ad3('0x8'));var controller=require('./intVtigerAccount.controller');router[_0x6ad3('0x9')]('/',auth[_0x6ad3('0xa')](),controller[_0x6ad3('0xb')]);router[_0x6ad3('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x6ad3('0xc'),auth[_0x6ad3('0xa')](),controller[_0x6ad3('0xd')]);router[_0x6ad3('0x9')](_0x6ad3('0xe'),auth[_0x6ad3('0xa')](),controller[_0x6ad3('0xf')]);router[_0x6ad3('0x10')]('/',auth[_0x6ad3('0xa')](),controller['create']);router[_0x6ad3('0x10')](_0x6ad3('0xc'),auth[_0x6ad3('0xa')](),controller[_0x6ad3('0x11')]);router[_0x6ad3('0x12')](_0x6ad3('0x13'),auth[_0x6ad3('0xa')](),controller[_0x6ad3('0x14')]);router['delete'](_0x6ad3('0x13'),auth['isAuthenticated'](),controller[_0x6ad3('0x15')]);module[_0x6ad3('0x16')]=router;
\ No newline at end of file
+var _0xcea2=['/:id/fields','getFields','post','create','addConfiguration','delete','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations'];(function(_0xe99c6a,_0x3b9278){var _0x56e9ea=function(_0x253061){while(--_0x253061){_0xe99c6a['push'](_0xe99c6a['shift']());}};_0x56e9ea(++_0x3b9278);}(_0xcea2,0x15a));var _0x2cea=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xcea2[_0x13d07a];return _0x5ee0ee;};'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')](),controller[_0x2cea('0x11')]);router['post']('/:id/configurations',auth[_0x2cea('0x8')](),controller[_0x2cea('0x12')]);router['put']('/:id',auth[_0x2cea('0x8')](),controller['update']);router[_0x2cea('0x13')](_0x2cea('0xa'),auth[_0x2cea('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index edc15ad..46e15d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc52=['sequelize','exports','STRING','HelpDesk'];(function(_0x91ebac,_0x28fb95){var _0x56ae13=function(_0xf2c4e7){while(--_0xf2c4e7){_0x91ebac['push'](_0x91ebac['shift']());}};_0x56ae13(++_0x28fb95);}(_0xfc52,0x14c));var _0x2fc5=function(_0x36a236,_0x3cc5fc){_0x36a236=_0x36a236-0x0;var _0xa4ab27=_0xfc52[_0x36a236];return _0xa4ab27;};'use strict';var Sequelize=require(_0x2fc5('0x0'));module[_0x2fc5('0x1')]={'name':{'type':Sequelize[_0x2fc5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2fc5('0x2')]},'username':{'type':Sequelize[_0x2fc5('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2fc5('0x3')},'remoteUri':{'type':Sequelize[_0x2fc5('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x2fc5('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x2fc5('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x079d=['sequelize','exports','STRING','HelpDesk'];(function(_0x3ea49a,_0x3f94b3){var _0x1b60e4=function(_0x51843e){while(--_0x51843e){_0x3ea49a['push'](_0x3ea49a['shift']());}};_0x1b60e4(++_0x3f94b3);}(_0x079d,0xd4));var _0xd079=function(_0x578fe5,_0x147c63){_0x578fe5=_0x578fe5-0x0;var _0x5932de=_0x079d[_0x578fe5];return _0x5932de;};'use strict';var Sequelize=require(_0xd079('0x0'));module[_0xd079('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd079('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xd079('0x2')],'allowNull':![],'defaultValue':_0xd079('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xd079('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xd079('0x2')],'allowNull':![]}};
\ No newline at end of file
index b6051ed..6b784e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc416=['length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','create','body','getConfigurations','findOne','params','VtigerConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','accessKey','substring','lastIndexOf','%s/webservice.php','success','POST','login','result','token','describe','sessionName','reference','owner','remove','includes','editable','false','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','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','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','undefined','limit','count','offset','Content-Range','json','apply','save','update','then','destroy','stack','name','index','map','VtigerAccount','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields'];(function(_0x4d5e52,_0x29b3ea){var _0x30bd34=function(_0x18286a){while(--_0x18286a){_0x4d5e52['push'](_0x4d5e52['shift']());}};_0x30bd34(++_0x29b3ea);}(_0xc416,0xbd));var _0x6c41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc416[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6c41('0x0'));var rimraf=require(_0x6c41('0x1'));var zipdir=require(_0x6c41('0x2'));var jsonpatch=require(_0x6c41('0x3'));var rp=require(_0x6c41('0x4'));var moment=require(_0x6c41('0x5'));var BPromise=require(_0x6c41('0x6'));var Mustache=require(_0x6c41('0x7'));var util=require(_0x6c41('0x8'));var path=require(_0x6c41('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6c41('0xa'));var fs=require('fs');var fs_extra=require(_0x6c41('0xb'));var _=require(_0x6c41('0xc'));var squel=require('squel');var crypto=require(_0x6c41('0xd'));var jsforce=require(_0x6c41('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6c41('0xf'));var querystring=require(_0x6c41('0x10'));var Papa=require(_0x6c41('0x11'));var Redis=require(_0x6c41('0x12'));var authService=require(_0x6c41('0x13'));var qs=require(_0x6c41('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c41('0x15'));var logger=require('../../config/logger')(_0x6c41('0x16'));var utils=require('../../config/utils');var config=require(_0x6c41('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c41('0x18'))['db'];var integrations=require(_0x6c41('0x19'));function respondWithStatusCode(_0x2f0548,_0x78811c){_0x78811c=_0x78811c||0xcc;return function(_0x227072){if(_0x227072){return _0x2f0548['sendStatus'](_0x78811c);}return _0x2f0548[_0x6c41('0x1a')](_0x78811c)[_0x6c41('0x1b')]();};}function respondWithResult(_0xfbd0e1,_0x1ba679){_0x1ba679=_0x1ba679||0xc8;return function(_0x5956ee){if(_0x5956ee){return _0xfbd0e1[_0x6c41('0x1a')](_0x1ba679)['json'](_0x5956ee);}};}function respondWithFilteredResult(_0x3f7ce5,_0x33992f){return function(_0x542569){if(_0x542569){var _0xbbbb81=typeof _0x33992f['offset']===_0x6c41('0x1c')&&typeof _0x33992f[_0x6c41('0x1d')]===_0x6c41('0x1c');var _0x5d0c52=_0x542569[_0x6c41('0x1e')];var _0x50483f=_0xbbbb81?0x0:_0x33992f[_0x6c41('0x1f')];var _0x2a55cb=_0xbbbb81?_0x542569[_0x6c41('0x1e')]:_0x33992f[_0x6c41('0x1f')]+_0x33992f['limit'];var _0x468aaf;if(_0x2a55cb>=_0x5d0c52){_0x2a55cb=_0x5d0c52;_0x468aaf=0xc8;}else{_0x468aaf=0xce;}_0x3f7ce5[_0x6c41('0x1a')](_0x468aaf);return _0x3f7ce5['set'](_0x6c41('0x20'),_0x50483f+'-'+_0x2a55cb+'/'+_0x5d0c52)[_0x6c41('0x21')](_0x542569);}return null;};}function patchUpdates(_0x1ef5a6){return function(_0x1304d3){try{jsonpatch[_0x6c41('0x22')](_0x1304d3,_0x1ef5a6,!![]);}catch(_0x385065){return BPromise['reject'](_0x385065);}return _0x1304d3[_0x6c41('0x23')]();};}function saveUpdates(_0x37b9ca,_0x2ef8a3){return function(_0x2e4834){if(_0x2e4834){return _0x2e4834[_0x6c41('0x24')](_0x37b9ca)[_0x6c41('0x25')](function(_0x20a327){return _0x20a327;});}return null;};}function removeEntity(_0x5814dc,_0x57aa9a){return function(_0x3c07cc){if(_0x3c07cc){return _0x3c07cc[_0x6c41('0x26')]()[_0x6c41('0x25')](function(){_0x5814dc[_0x6c41('0x1a')](0xcc)[_0x6c41('0x1b')]();});}};}function handleEntityNotFound(_0x7b0d92,_0x34ec89){return function(_0xfd0875){if(!_0xfd0875){_0x7b0d92['sendStatus'](0x194);}return _0xfd0875;};}function handleError(_0x46dc67,_0x240253){_0x240253=_0x240253||0x1f4;return function(_0x2135c2){logger['error'](_0x2135c2[_0x6c41('0x27')]);if(_0x2135c2[_0x6c41('0x28')]){delete _0x2135c2[_0x6c41('0x28')];}_0x46dc67['status'](_0x240253)['send'](_0x2135c2);};}exports[_0x6c41('0x29')]=function(_0x5d4461,_0x81f78e){var _0x37b240={},_0xaebee3={},_0x2a2ce5={'count':0x0,'rows':[]};var _0x362090=_[_0x6c41('0x2a')](db[_0x6c41('0x2b')][_0x6c41('0x2c')],function(_0x52ca3c){return{'name':_0x52ca3c[_0x6c41('0x2d')],'type':_0x52ca3c['type'][_0x6c41('0x2e')]};});_0xaebee3[_0x6c41('0x2f')]=_[_0x6c41('0x2a')](_0x362090,_0x6c41('0x28'));_0xaebee3['query']=_[_0x6c41('0x30')](_0x5d4461[_0x6c41('0x31')]);_0xaebee3['filters']=_[_0x6c41('0x32')](_0xaebee3['model'],_0xaebee3[_0x6c41('0x31')]);_0x37b240[_0x6c41('0x33')]=_[_0x6c41('0x32')](_0xaebee3['model'],qs[_0x6c41('0x34')](_0x5d4461[_0x6c41('0x31')]['fields']));_0x37b240['attributes']=_0x37b240[_0x6c41('0x33')][_0x6c41('0x35')]?_0x37b240[_0x6c41('0x33')]:_0xaebee3[_0x6c41('0x2f')];if(!_0x5d4461[_0x6c41('0x31')][_0x6c41('0x36')](_0x6c41('0x37'))){_0x37b240[_0x6c41('0x1d')]=qs[_0x6c41('0x1d')](_0x5d4461['query'][_0x6c41('0x1d')]);_0x37b240[_0x6c41('0x1f')]=qs[_0x6c41('0x1f')](_0x5d4461[_0x6c41('0x31')][_0x6c41('0x1f')]);}_0x37b240[_0x6c41('0x38')]=qs[_0x6c41('0x39')](_0x5d4461[_0x6c41('0x31')]['sort']);_0x37b240[_0x6c41('0x3a')]=qs[_0x6c41('0x3b')](_[_0x6c41('0x3c')](_0x5d4461['query'],_0xaebee3['filters']),_0x362090);if(_0x5d4461[_0x6c41('0x31')][_0x6c41('0x3d')]){_0x37b240[_0x6c41('0x3a')]=_[_0x6c41('0x3e')](_0x37b240[_0x6c41('0x3a')],{'$or':_[_0x6c41('0x2a')](_0x362090,function(_0x29d7c7){if(_0x29d7c7[_0x6c41('0x3f')]!==_0x6c41('0x40')){var _0x1263eb={};_0x1263eb[_0x29d7c7[_0x6c41('0x28')]]={'$like':'%'+_0x5d4461[_0x6c41('0x31')]['filter']+'%'};return _0x1263eb;}})});}_0x37b240=_[_0x6c41('0x3e')]({},_0x37b240,_0x5d4461[_0x6c41('0x41')]);var _0x3715cc={'where':_0x37b240[_0x6c41('0x3a')]};return db[_0x6c41('0x2b')][_0x6c41('0x1e')](_0x3715cc)[_0x6c41('0x25')](function(_0x129729){_0x2a2ce5[_0x6c41('0x1e')]=_0x129729;if(_0x5d4461[_0x6c41('0x31')][_0x6c41('0x42')]){_0x37b240['include']=[{'all':!![]}];}return db[_0x6c41('0x2b')][_0x6c41('0x43')](_0x37b240);})[_0x6c41('0x25')](function(_0x19c67d){_0x2a2ce5[_0x6c41('0x44')]=_0x19c67d;return _0x2a2ce5;})['then'](respondWithFilteredResult(_0x81f78e,_0x37b240))[_0x6c41('0x45')](handleError(_0x81f78e,null));};exports[_0x6c41('0x46')]=function(_0x4004a5,_0x5eec1a){var _0x308fcc={'raw':![],'where':{'id':_0x4004a5['params']['id']}},_0x1f559d={};_0x1f559d[_0x6c41('0x2f')]=_[_0x6c41('0x30')](db[_0x6c41('0x2b')][_0x6c41('0x2c')]);_0x1f559d[_0x6c41('0x31')]=_[_0x6c41('0x30')](_0x4004a5['query']);_0x1f559d[_0x6c41('0x3b')]=_[_0x6c41('0x32')](_0x1f559d['model'],_0x1f559d[_0x6c41('0x31')]);_0x308fcc[_0x6c41('0x33')]=_[_0x6c41('0x32')](_0x1f559d[_0x6c41('0x2f')],qs[_0x6c41('0x34')](_0x4004a5[_0x6c41('0x31')]['fields']));_0x308fcc[_0x6c41('0x33')]=_0x308fcc[_0x6c41('0x33')][_0x6c41('0x35')]?_0x308fcc['attributes']:_0x1f559d[_0x6c41('0x2f')];if(_0x4004a5[_0x6c41('0x31')][_0x6c41('0x42')]){_0x308fcc[_0x6c41('0x47')]=[{'all':!![]}];}_0x308fcc=_[_0x6c41('0x3e')]({},_0x308fcc,_0x4004a5[_0x6c41('0x41')]);return db[_0x6c41('0x2b')]['find'](_0x308fcc)[_0x6c41('0x25')](handleEntityNotFound(_0x5eec1a,null))[_0x6c41('0x25')](respondWithResult(_0x5eec1a,null))[_0x6c41('0x45')](handleError(_0x5eec1a,null));};exports['create']=function(_0x159e23,_0x473b6b){return db[_0x6c41('0x2b')][_0x6c41('0x48')](_0x159e23[_0x6c41('0x49')],{})[_0x6c41('0x25')](respondWithResult(_0x473b6b,0xc9))['catch'](handleError(_0x473b6b,null));};exports[_0x6c41('0x24')]=function(_0x56127f,_0x5415a5){if(_0x56127f[_0x6c41('0x49')]['id']){delete _0x56127f[_0x6c41('0x49')]['id'];}return db[_0x6c41('0x2b')]['find']({'where':{'id':_0x56127f['params']['id']}})[_0x6c41('0x25')](handleEntityNotFound(_0x5415a5,null))[_0x6c41('0x25')](saveUpdates(_0x56127f[_0x6c41('0x49')],null))[_0x6c41('0x25')](respondWithResult(_0x5415a5,null))['catch'](handleError(_0x5415a5,null));};exports[_0x6c41('0x26')]=function(_0x58f7fc,_0x15f3d1){return db[_0x6c41('0x2b')]['find']({'where':{'id':_0x58f7fc['params']['id']}})[_0x6c41('0x25')](handleEntityNotFound(_0x15f3d1,null))[_0x6c41('0x25')](removeEntity(_0x15f3d1,null))[_0x6c41('0x45')](handleError(_0x15f3d1,null));};exports[_0x6c41('0x4a')]=function(_0x1de222,_0x6e650a,_0x79b010){var _0x540e9d={};var _0x1c3d61={};var _0x15f6a4;var _0x1efadb;return db[_0x6c41('0x2b')][_0x6c41('0x4b')]({'where':{'id':_0x1de222[_0x6c41('0x4c')]['id']}})[_0x6c41('0x25')](handleEntityNotFound(_0x6e650a,null))[_0x6c41('0x25')](function(_0x199f3f){if(_0x199f3f){_0x15f6a4=_0x199f3f;_0x1c3d61['model']=_['keys'](db[_0x6c41('0x4d')][_0x6c41('0x2c')]);_0x1c3d61['query']=_[_0x6c41('0x30')](_0x1de222[_0x6c41('0x31')]);_0x1c3d61['filters']=_[_0x6c41('0x32')](_0x1c3d61[_0x6c41('0x2f')],_0x1c3d61[_0x6c41('0x31')]);_0x540e9d[_0x6c41('0x33')]=_[_0x6c41('0x32')](_0x1c3d61[_0x6c41('0x2f')],qs[_0x6c41('0x34')](_0x1de222[_0x6c41('0x31')][_0x6c41('0x34')]));_0x540e9d[_0x6c41('0x33')]=_0x540e9d[_0x6c41('0x33')]['length']?_0x540e9d[_0x6c41('0x33')]:_0x1c3d61[_0x6c41('0x2f')];_0x540e9d[_0x6c41('0x38')]=qs[_0x6c41('0x39')](_0x1de222[_0x6c41('0x31')]['sort']);_0x540e9d[_0x6c41('0x3a')]=qs[_0x6c41('0x3b')](_[_0x6c41('0x3c')](_0x1de222[_0x6c41('0x31')],_0x1c3d61[_0x6c41('0x3b')]));if(_0x1de222[_0x6c41('0x31')][_0x6c41('0x3d')]){_0x540e9d[_0x6c41('0x3a')]=_[_0x6c41('0x3e')](_0x540e9d[_0x6c41('0x3a')],{'$or':_[_0x6c41('0x2a')](_0x540e9d[_0x6c41('0x33')],function(_0x34477e){var _0x20a3a6={};_0x20a3a6[_0x34477e]={'$like':'%'+_0x1de222['query']['filter']+'%'};return _0x20a3a6;})});}_0x540e9d=_[_0x6c41('0x3e')]({},_0x540e9d,_0x1de222['options']);return _0x15f6a4[_0x6c41('0x4a')](_0x540e9d);}})['then'](function(_0x5d05e9){if(_0x5d05e9){_0x1efadb=_0x5d05e9[_0x6c41('0x35')];if(!_0x1de222[_0x6c41('0x31')][_0x6c41('0x36')](_0x6c41('0x37'))){_0x540e9d['limit']=qs[_0x6c41('0x1d')](_0x1de222[_0x6c41('0x31')][_0x6c41('0x1d')]);_0x540e9d[_0x6c41('0x1f')]=qs[_0x6c41('0x1f')](_0x1de222['query'][_0x6c41('0x1f')]);}return _0x15f6a4['getConfigurations'](_0x540e9d);}})[_0x6c41('0x25')](function(_0x2e3332){if(_0x2e3332){return _0x2e3332?{'count':_0x1efadb,'rows':_0x2e3332}:null;}})[_0x6c41('0x25')](respondWithResult(_0x6e650a,null))[_0x6c41('0x45')](handleError(_0x6e650a,null));};exports[_0x6c41('0x4e')]=function(_0x4ad30d,_0x3c061e,_0x14441c){if(_0x4ad30d[_0x6c41('0x49')]['id']){delete _0x4ad30d[_0x6c41('0x49')]['id'];}return db[_0x6c41('0x2b')][_0x6c41('0x4b')]({'where':{'id':_0x4ad30d['params']['id']}})[_0x6c41('0x25')](handleEntityNotFound(_0x3c061e,null))[_0x6c41('0x25')](function(_0x30fc24){if(_0x30fc24){_0x4ad30d[_0x6c41('0x49')][_0x6c41('0x4f')]=_0x30fc24['id'];_0x4ad30d[_0x6c41('0x49')][_0x6c41('0x50')]=integrations[_0x6c41('0x51')](_0x4ad30d[_0x6c41('0x49')][_0x6c41('0x52')],_0x4ad30d['body'][_0x6c41('0x3f')]);_0x4ad30d[_0x6c41('0x49')][_0x6c41('0x53')]=integrations[_0x6c41('0x54')](_0x4ad30d['body'][_0x6c41('0x52')],_0x4ad30d['body']['type']);return db[_0x6c41('0x4d')][_0x6c41('0x48')](_0x4ad30d[_0x6c41('0x49')],{'include':[{'model':db['VtigerField'],'as':_0x6c41('0x50')},{'model':db[_0x6c41('0x55')],'as':_0x6c41('0x53')}]});}return null;})[_0x6c41('0x25')](respondWithResult(_0x3c061e,null))[_0x6c41('0x45')](handleError(_0x3c061e,null));};var md5=require(_0x6c41('0x56'));exports[_0x6c41('0x57')]=function(_0x232c6c,_0xae1036,_0xb91aaf){var _0x440dee=null;var _0x4ae02e=null;var _0x91dff7=null;var _0x2a9dcf=null;var _0x283b0a='';return db[_0x6c41('0x2b')][_0x6c41('0x4b')]({'where':{'id':_0x232c6c[_0x6c41('0x4c')]['id']},'attributes':['id',_0x6c41('0x28'),_0x6c41('0x58'),_0x6c41('0x59'),_0x6c41('0x5a'),_0x6c41('0x5b'),'serverUrl',_0x6c41('0x5c')]})[_0x6c41('0x25')](handleEntityNotFound(_0xae1036,null))['then'](function(_0x14a146){if(_0x14a146){_0x440dee=_0x14a146['username'];_0x4ae02e=_0x14a146[_0x6c41('0x5c')];_0x91dff7=_0x14a146[_0x6c41('0x5a')];_0x283b0a=_0x14a146['remoteUri'];var _0x9a0029=_0x283b0a['slice'](-0x1);if(_0x9a0029==='/'){_0x283b0a=_0x283b0a[_0x6c41('0x5d')](0x0,_0x283b0a[_0x6c41('0x5e')](_0x9a0029));}_0x2a9dcf=util['format'](_0x6c41('0x5f'),_0x283b0a);var _0x47610c={'method':'GET','uri':_0x2a9dcf,'qs':{'operation':'getchallenge','username':_0x14a146[_0x6c41('0x58')]},'json':!![]};return rp(_0x47610c);}})[_0x6c41('0x25')](function(_0x1e2dff){if(_0x1e2dff[_0x6c41('0x60')]){var _0x15a09d={'method':_0x6c41('0x61'),'uri':_0x2a9dcf,'form':{'operation':_0x6c41('0x62'),'username':_0x440dee,'accessKey':md5(_0x1e2dff[_0x6c41('0x63')][_0x6c41('0x64')]+_0x4ae02e)},'json':!![]};return rp(_0x15a09d);}})[_0x6c41('0x25')](function(_0x41a28e){if(_0x41a28e[_0x6c41('0x60')]){var _0x5864ce={'method':'GET','uri':_0x2a9dcf,'qs':{'operation':_0x6c41('0x65'),'username':_0x440dee,'sessionName':_0x41a28e[_0x6c41('0x63')][_0x6c41('0x66')],'elementType':_0x91dff7},'json':!![]};return rp(_0x5864ce);}})['then'](function(_0x40a53b){if(_0x40a53b[_0x6c41('0x60')]){var _0x1ee174=['autogenerated',_0x6c41('0x67'),_0x6c41('0x68')];_[_0x6c41('0x69')](_0x40a53b[_0x6c41('0x63')][_0x6c41('0x34')],function(_0x44a2ef){return _0x1ee174[_0x6c41('0x6a')](_0x44a2ef['type'][_0x6c41('0x28')]);});_['remove'](_0x40a53b[_0x6c41('0x63')][_0x6c41('0x34')],function(_0x2ba8bb){return _0x2ba8bb[_0x6c41('0x6b')]===_0x6c41('0x6c');});return{'count':_0x40a53b[_0x6c41('0x63')][_0x6c41('0x34')][_0x6c41('0x35')],'rows':_[_0x6c41('0x2a')](_0x40a53b[_0x6c41('0x63')][_0x6c41('0x34')],function(_0x3f20d8){return{'id':_0x3f20d8['name'],'name':_0x3f20d8['label'],'custom':_[_0x6c41('0x6d')](_0x3f20d8[_0x6c41('0x28')],'cf_')?!![]:![],'options':_0x3f20d8['type'][_0x6c41('0x28')]===_0x6c41('0x6e')&&_0x3f20d8['type'][_0x6c41('0x6f')][_0x6c41('0x35')]>0x0?_[_0x6c41('0x2a')](_0x3f20d8['type']['picklistValues'],function(_0x1e89cc){return{'name':_0x1e89cc['label'],'value':_0x1e89cc[_0x6c41('0x70')]};}):[]};})};}})['then'](respondWithResult(_0xae1036,null))['catch'](function(_0x59dae8){console[_0x6c41('0x71')](_0x6c41('0x72')+_0x59dae8);var _0x1f5690=_0x232c6c[_0x6c41('0x31')][_0x6c41('0x73')]?0x1f4:_0x59dae8[_0x6c41('0x74')]||0x1f4;logger['error'](_0x6c41('0x75'),_0x6c41('0x57'),_0x1f5690,JSON[_0x6c41('0x76')](_0x59dae8));delete _0x59dae8[_0x6c41('0x28')];if(_0x1f5690===0x191){_0x1f5690=0x190;}_0xae1036[_0x6c41('0x1a')](_0x1f5690)[_0x6c41('0x77')](_0x232c6c['query'][_0x6c41('0x73')]?{'message':_0x6c41('0x78'),'statusCode':_0x59dae8[_0x6c41('0x74')]}:_0x59dae8);});};
\ No newline at end of file
+var _0x7480=['md5','getFields','username','description','moduleName','remoteUri','accessKey','substring','%s/webservice.php','GET','POST','success','result','autogenerated','reference','remove','includes','editable','false','label','startsWith','picklist','picklistValues','value','log','statusCode','error','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','VtigerAccount','findAll','rows','catch','params','rawAttributes','length','includeAll','include','find','create','body','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','VtigerField'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x7480,0x104));var _0x0748=function(_0x504a40,_0x2cbb16){_0x504a40=_0x504a40-0x0;var _0xcaf36d=_0x7480[_0x504a40];return _0xcaf36d;};'use strict';var emlformat=require(_0x0748('0x0'));var rimraf=require(_0x0748('0x1'));var zipdir=require(_0x0748('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0748('0x3'));var moment=require(_0x0748('0x4'));var BPromise=require(_0x0748('0x5'));var Mustache=require(_0x0748('0x6'));var util=require(_0x0748('0x7'));var path=require(_0x0748('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0748('0x9'));var _=require(_0x0748('0xa'));var squel=require(_0x0748('0xb'));var crypto=require(_0x0748('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0748('0xd'));var toCsv=require(_0x0748('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0748('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0748('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0748('0x11'))(_0x0748('0x12'));var utils=require(_0x0748('0x13'));var config=require(_0x0748('0x14'));var licenseUtil=require(_0x0748('0x15'));var db=require(_0x0748('0x16'))['db'];var integrations=require(_0x0748('0x17'));function respondWithStatusCode(_0x1e393f,_0x2c87d8){_0x2c87d8=_0x2c87d8||0xcc;return function(_0x16e064){if(_0x16e064){return _0x1e393f[_0x0748('0x18')](_0x2c87d8);}return _0x1e393f['status'](_0x2c87d8)[_0x0748('0x19')]();};}function respondWithResult(_0x118164,_0x4b24f3){_0x4b24f3=_0x4b24f3||0xc8;return function(_0x21c18c){if(_0x21c18c){return _0x118164[_0x0748('0x1a')](_0x4b24f3)['json'](_0x21c18c);}};}function respondWithFilteredResult(_0xdd0d2c,_0x5b5f98){return function(_0x4fd1ca){if(_0x4fd1ca){var _0x44b3af=typeof _0x5b5f98[_0x0748('0x1b')]===_0x0748('0x1c')&&typeof _0x5b5f98[_0x0748('0x1d')]===_0x0748('0x1c');var _0x202bc5=_0x4fd1ca['count'];var _0x694310=_0x44b3af?0x0:_0x5b5f98[_0x0748('0x1b')];var _0x2e6f35=_0x44b3af?_0x4fd1ca[_0x0748('0x1e')]:_0x5b5f98[_0x0748('0x1b')]+_0x5b5f98[_0x0748('0x1d')];var _0x281920;if(_0x2e6f35>=_0x202bc5){_0x2e6f35=_0x202bc5;_0x281920=0xc8;}else{_0x281920=0xce;}_0xdd0d2c[_0x0748('0x1a')](_0x281920);return _0xdd0d2c[_0x0748('0x1f')](_0x0748('0x20'),_0x694310+'-'+_0x2e6f35+'/'+_0x202bc5)[_0x0748('0x21')](_0x4fd1ca);}return null;};}function patchUpdates(_0x1ae156){return function(_0x10cf4e){try{jsonpatch[_0x0748('0x22')](_0x10cf4e,_0x1ae156,!![]);}catch(_0x19d90f){return BPromise[_0x0748('0x23')](_0x19d90f);}return _0x10cf4e[_0x0748('0x24')]();};}function saveUpdates(_0x2bb3a5,_0x1e240c){return function(_0x3c5b6d){if(_0x3c5b6d){return _0x3c5b6d[_0x0748('0x25')](_0x2bb3a5)['then'](function(_0x24a8c2){return _0x24a8c2;});}return null;};}function removeEntity(_0x2dd257,_0x44873b){return function(_0x38bade){if(_0x38bade){return _0x38bade[_0x0748('0x26')]()[_0x0748('0x27')](function(){_0x2dd257['status'](0xcc)[_0x0748('0x19')]();});}};}function handleEntityNotFound(_0x524f57,_0x278ea8){return function(_0x36b464){if(!_0x36b464){_0x524f57[_0x0748('0x18')](0x194);}return _0x36b464;};}function handleError(_0x26e624,_0x3b4b4d){_0x3b4b4d=_0x3b4b4d||0x1f4;return function(_0x399755){logger['error'](_0x399755[_0x0748('0x28')]);if(_0x399755[_0x0748('0x29')]){delete _0x399755[_0x0748('0x29')];}_0x26e624['status'](_0x3b4b4d)[_0x0748('0x2a')](_0x399755);};}exports[_0x0748('0x2b')]=function(_0x1055a8,_0x4e8fd8){var _0x467027={},_0x4010cc={},_0xa6606a={'count':0x0,'rows':[]};var _0x3bcc39=_[_0x0748('0x2c')](db['VtigerAccount']['rawAttributes'],function(_0x2732d2){return{'name':_0x2732d2[_0x0748('0x2d')],'type':_0x2732d2[_0x0748('0x2e')][_0x0748('0x2f')]};});_0x4010cc[_0x0748('0x30')]=_['map'](_0x3bcc39,'name');_0x4010cc[_0x0748('0x31')]=_[_0x0748('0x32')](_0x1055a8[_0x0748('0x31')]);_0x4010cc[_0x0748('0x33')]=_['intersection'](_0x4010cc[_0x0748('0x30')],_0x4010cc[_0x0748('0x31')]);_0x467027[_0x0748('0x34')]=_[_0x0748('0x35')](_0x4010cc[_0x0748('0x30')],qs[_0x0748('0x36')](_0x1055a8[_0x0748('0x31')][_0x0748('0x36')]));_0x467027['attributes']=_0x467027['attributes']['length']?_0x467027[_0x0748('0x34')]:_0x4010cc[_0x0748('0x30')];if(!_0x1055a8[_0x0748('0x31')][_0x0748('0x37')]('nolimit')){_0x467027[_0x0748('0x1d')]=qs['limit'](_0x1055a8[_0x0748('0x31')]['limit']);_0x467027[_0x0748('0x1b')]=qs['offset'](_0x1055a8[_0x0748('0x31')][_0x0748('0x1b')]);}_0x467027['order']=qs[_0x0748('0x38')](_0x1055a8[_0x0748('0x31')][_0x0748('0x38')]);_0x467027[_0x0748('0x39')]=qs[_0x0748('0x33')](_['pick'](_0x1055a8[_0x0748('0x31')],_0x4010cc[_0x0748('0x33')]),_0x3bcc39);if(_0x1055a8['query'][_0x0748('0x3a')]){_0x467027['where']=_[_0x0748('0x3b')](_0x467027[_0x0748('0x39')],{'$or':_[_0x0748('0x2c')](_0x3bcc39,function(_0x116239){if(_0x116239[_0x0748('0x2e')]!==_0x0748('0x3c')){var _0x1c4f18={};_0x1c4f18[_0x116239[_0x0748('0x29')]]={'$like':'%'+_0x1055a8[_0x0748('0x31')][_0x0748('0x3a')]+'%'};return _0x1c4f18;}})});}_0x467027=_[_0x0748('0x3b')]({},_0x467027,_0x1055a8[_0x0748('0x3d')]);var _0x131259={'where':_0x467027[_0x0748('0x39')]};return db['VtigerAccount'][_0x0748('0x1e')](_0x131259)[_0x0748('0x27')](function(_0x21cdd6){_0xa6606a['count']=_0x21cdd6;if(_0x1055a8[_0x0748('0x31')]['includeAll']){_0x467027['include']=[{'all':!![]}];}return db[_0x0748('0x3e')][_0x0748('0x3f')](_0x467027);})['then'](function(_0x5d9e21){_0xa6606a[_0x0748('0x40')]=_0x5d9e21;return _0xa6606a;})['then'](respondWithFilteredResult(_0x4e8fd8,_0x467027))[_0x0748('0x41')](handleError(_0x4e8fd8,null));};exports['show']=function(_0x38e898,_0x46efd3){var _0x13696e={'raw':![],'where':{'id':_0x38e898[_0x0748('0x42')]['id']}},_0x250149={};_0x250149[_0x0748('0x30')]=_[_0x0748('0x32')](db[_0x0748('0x3e')][_0x0748('0x43')]);_0x250149[_0x0748('0x31')]=_[_0x0748('0x32')](_0x38e898['query']);_0x250149[_0x0748('0x33')]=_[_0x0748('0x35')](_0x250149[_0x0748('0x30')],_0x250149[_0x0748('0x31')]);_0x13696e[_0x0748('0x34')]=_[_0x0748('0x35')](_0x250149[_0x0748('0x30')],qs['fields'](_0x38e898[_0x0748('0x31')][_0x0748('0x36')]));_0x13696e[_0x0748('0x34')]=_0x13696e[_0x0748('0x34')][_0x0748('0x44')]?_0x13696e['attributes']:_0x250149[_0x0748('0x30')];if(_0x38e898[_0x0748('0x31')][_0x0748('0x45')]){_0x13696e[_0x0748('0x46')]=[{'all':!![]}];}_0x13696e=_[_0x0748('0x3b')]({},_0x13696e,_0x38e898['options']);return db['VtigerAccount'][_0x0748('0x47')](_0x13696e)[_0x0748('0x27')](handleEntityNotFound(_0x46efd3,null))['then'](respondWithResult(_0x46efd3,null))[_0x0748('0x41')](handleError(_0x46efd3,null));};exports[_0x0748('0x48')]=function(_0x24c077,_0x71774c){return db['VtigerAccount'][_0x0748('0x48')](_0x24c077[_0x0748('0x49')],{})['then'](respondWithResult(_0x71774c,0xc9))[_0x0748('0x41')](handleError(_0x71774c,null));};exports['update']=function(_0x23e791,_0x6cd170){if(_0x23e791[_0x0748('0x49')]['id']){delete _0x23e791[_0x0748('0x49')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x23e791['params']['id']}})['then'](handleEntityNotFound(_0x6cd170,null))[_0x0748('0x27')](saveUpdates(_0x23e791[_0x0748('0x49')],null))['then'](respondWithResult(_0x6cd170,null))[_0x0748('0x41')](handleError(_0x6cd170,null));};exports[_0x0748('0x26')]=function(_0x2bd1ac,_0x4fc4f3){return db['VtigerAccount']['find']({'where':{'id':_0x2bd1ac[_0x0748('0x42')]['id']}})[_0x0748('0x27')](handleEntityNotFound(_0x4fc4f3,null))[_0x0748('0x27')](removeEntity(_0x4fc4f3,null))[_0x0748('0x41')](handleError(_0x4fc4f3,null));};exports[_0x0748('0x4a')]=function(_0x591726,_0x3d2f07,_0x40bfc6){var _0x4da476={};var _0x4b8e42={};var _0x18ceca;var _0x1cf20f;return db[_0x0748('0x3e')][_0x0748('0x4b')]({'where':{'id':_0x591726[_0x0748('0x42')]['id']}})[_0x0748('0x27')](handleEntityNotFound(_0x3d2f07,null))[_0x0748('0x27')](function(_0x47f9db){if(_0x47f9db){_0x18ceca=_0x47f9db;_0x4b8e42[_0x0748('0x30')]=_[_0x0748('0x32')](db[_0x0748('0x4c')][_0x0748('0x43')]);_0x4b8e42[_0x0748('0x31')]=_[_0x0748('0x32')](_0x591726[_0x0748('0x31')]);_0x4b8e42['filters']=_['intersection'](_0x4b8e42[_0x0748('0x30')],_0x4b8e42['query']);_0x4da476[_0x0748('0x34')]=_['intersection'](_0x4b8e42[_0x0748('0x30')],qs[_0x0748('0x36')](_0x591726['query'][_0x0748('0x36')]));_0x4da476['attributes']=_0x4da476[_0x0748('0x34')]['length']?_0x4da476[_0x0748('0x34')]:_0x4b8e42[_0x0748('0x30')];_0x4da476['order']=qs[_0x0748('0x38')](_0x591726[_0x0748('0x31')][_0x0748('0x38')]);_0x4da476[_0x0748('0x39')]=qs[_0x0748('0x33')](_['pick'](_0x591726[_0x0748('0x31')],_0x4b8e42[_0x0748('0x33')]));if(_0x591726[_0x0748('0x31')][_0x0748('0x3a')]){_0x4da476[_0x0748('0x39')]=_[_0x0748('0x3b')](_0x4da476[_0x0748('0x39')],{'$or':_[_0x0748('0x2c')](_0x4da476[_0x0748('0x34')],function(_0xaa6e96){var _0x18d972={};_0x18d972[_0xaa6e96]={'$like':'%'+_0x591726[_0x0748('0x31')][_0x0748('0x3a')]+'%'};return _0x18d972;})});}_0x4da476=_[_0x0748('0x3b')]({},_0x4da476,_0x591726[_0x0748('0x3d')]);return _0x18ceca[_0x0748('0x4a')](_0x4da476);}})[_0x0748('0x27')](function(_0x2c82f3){if(_0x2c82f3){_0x1cf20f=_0x2c82f3['length'];if(!_0x591726[_0x0748('0x31')][_0x0748('0x37')]('nolimit')){_0x4da476[_0x0748('0x1d')]=qs[_0x0748('0x1d')](_0x591726[_0x0748('0x31')][_0x0748('0x1d')]);_0x4da476[_0x0748('0x1b')]=qs[_0x0748('0x1b')](_0x591726[_0x0748('0x31')]['offset']);}return _0x18ceca[_0x0748('0x4a')](_0x4da476);}})[_0x0748('0x27')](function(_0x48394c){if(_0x48394c){return _0x48394c?{'count':_0x1cf20f,'rows':_0x48394c}:null;}})[_0x0748('0x27')](respondWithResult(_0x3d2f07,null))[_0x0748('0x41')](handleError(_0x3d2f07,null));};exports[_0x0748('0x4d')]=function(_0x40f87e,_0x35d5b0,_0x3ae647){if(_0x40f87e[_0x0748('0x49')]['id']){delete _0x40f87e['body']['id'];}return db['VtigerAccount'][_0x0748('0x4b')]({'where':{'id':_0x40f87e[_0x0748('0x42')]['id']}})['then'](handleEntityNotFound(_0x35d5b0,null))['then'](function(_0x5df579){if(_0x5df579){_0x40f87e[_0x0748('0x49')][_0x0748('0x4e')]=_0x5df579['id'];_0x40f87e[_0x0748('0x49')]['Subjects']=integrations[_0x0748('0x4f')](_0x40f87e[_0x0748('0x49')][_0x0748('0x50')],_0x40f87e[_0x0748('0x49')][_0x0748('0x2e')]);_0x40f87e[_0x0748('0x49')][_0x0748('0x51')]=integrations[_0x0748('0x52')](_0x40f87e[_0x0748('0x49')][_0x0748('0x50')],_0x40f87e[_0x0748('0x49')][_0x0748('0x2e')]);return db[_0x0748('0x4c')][_0x0748('0x48')](_0x40f87e[_0x0748('0x49')],{'include':[{'model':db['VtigerField'],'as':_0x0748('0x53')},{'model':db[_0x0748('0x54')],'as':_0x0748('0x51')}]});}return null;})[_0x0748('0x27')](respondWithResult(_0x35d5b0,null))[_0x0748('0x41')](handleError(_0x35d5b0,null));};var md5=require(_0x0748('0x55'));exports[_0x0748('0x56')]=function(_0x4b4724,_0x2cb2f7,_0x52b670){var _0x1422a9=null;var _0x1bf869=null;var _0x3cc63f=null;var _0x3137b5=null;var _0x1196b1='';return db['VtigerAccount'][_0x0748('0x4b')]({'where':{'id':_0x4b4724['params']['id']},'attributes':['id','name',_0x0748('0x57'),_0x0748('0x58'),_0x0748('0x59'),_0x0748('0x5a'),'serverUrl',_0x0748('0x5b')]})['then'](handleEntityNotFound(_0x2cb2f7,null))[_0x0748('0x27')](function(_0x585258){if(_0x585258){_0x1422a9=_0x585258[_0x0748('0x57')];_0x1bf869=_0x585258[_0x0748('0x5b')];_0x3cc63f=_0x585258[_0x0748('0x59')];_0x1196b1=_0x585258[_0x0748('0x5a')];var _0x445c75=_0x1196b1['slice'](-0x1);if(_0x445c75==='/'){_0x1196b1=_0x1196b1[_0x0748('0x5c')](0x0,_0x1196b1['lastIndexOf'](_0x445c75));}_0x3137b5=util['format'](_0x0748('0x5d'),_0x1196b1);var _0x31a002={'method':_0x0748('0x5e'),'uri':_0x3137b5,'qs':{'operation':'getchallenge','username':_0x585258[_0x0748('0x57')]},'json':!![]};return rp(_0x31a002);}})['then'](function(_0x4dca2a){if(_0x4dca2a['success']){var _0xaa8d70={'method':_0x0748('0x5f'),'uri':_0x3137b5,'form':{'operation':'login','username':_0x1422a9,'accessKey':md5(_0x4dca2a['result']['token']+_0x1bf869)},'json':!![]};return rp(_0xaa8d70);}})[_0x0748('0x27')](function(_0x24ef14){if(_0x24ef14[_0x0748('0x60')]){var _0xbc2ccb={'method':_0x0748('0x5e'),'uri':_0x3137b5,'qs':{'operation':'describe','username':_0x1422a9,'sessionName':_0x24ef14[_0x0748('0x61')]['sessionName'],'elementType':_0x3cc63f},'json':!![]};return rp(_0xbc2ccb);}})['then'](function(_0x250967){if(_0x250967['success']){var _0x4b1034=[_0x0748('0x62'),_0x0748('0x63'),'owner'];_[_0x0748('0x64')](_0x250967[_0x0748('0x61')]['fields'],function(_0x45171a){return _0x4b1034[_0x0748('0x65')](_0x45171a[_0x0748('0x2e')][_0x0748('0x29')]);});_[_0x0748('0x64')](_0x250967[_0x0748('0x61')][_0x0748('0x36')],function(_0x42ca89){return _0x42ca89[_0x0748('0x66')]===_0x0748('0x67');});return{'count':_0x250967[_0x0748('0x61')][_0x0748('0x36')]['length'],'rows':_['map'](_0x250967[_0x0748('0x61')][_0x0748('0x36')],function(_0x417f7e){return{'id':_0x417f7e[_0x0748('0x29')],'name':_0x417f7e[_0x0748('0x68')],'custom':_[_0x0748('0x69')](_0x417f7e['name'],'cf_')?!![]:![],'options':_0x417f7e[_0x0748('0x2e')][_0x0748('0x29')]===_0x0748('0x6a')&&_0x417f7e[_0x0748('0x2e')][_0x0748('0x6b')][_0x0748('0x44')]>0x0?_['map'](_0x417f7e['type'][_0x0748('0x6b')],function(_0x5ae49f){return{'name':_0x5ae49f[_0x0748('0x68')],'value':_0x5ae49f[_0x0748('0x6c')]};}):[]};})};}})[_0x0748('0x27')](respondWithResult(_0x2cb2f7,null))[_0x0748('0x41')](function(_0x50e065){console[_0x0748('0x6d')]('vTiger\x20error:\x20'+_0x50e065);var _0x29a78c=_0x4b4724[_0x0748('0x31')]['test']?0x1f4:_0x50e065[_0x0748('0x6e')]||0x1f4;logger[_0x0748('0x6f')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x29a78c,JSON[_0x0748('0x70')](_0x50e065));delete _0x50e065['name'];if(_0x29a78c===0x191){_0x29a78c=0x190;}_0x2cb2f7[_0x0748('0x1a')](_0x29a78c)[_0x0748('0x2a')](_0x4b4724[_0x0748('0x31')][_0x0748('0x71')]?{'message':_0x0748('0x72'),'statusCode':_0x50e065[_0x0748('0x6e')]}:_0x50e065);});};
\ No newline at end of file
index ec01a9e..566406d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62e9=['../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','util','api','moment','bluebird','rimraf'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x62e9,0x176));var _0x962e=function(_0x1844f1,_0x14d2bd){_0x1844f1=_0x1844f1-0x0;var _0x59f3c3=_0x62e9[_0x1844f1];return _0x59f3c3;};'use strict';var _=require(_0x962e('0x0'));var util=require(_0x962e('0x1'));var logger=require('../../config/logger')(_0x962e('0x2'));var moment=require(_0x962e('0x3'));var BPromise=require(_0x962e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x962e('0x5'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x962e('0x6'));module[_0x962e('0x7')]=function(_0x12ff37,_0x2e2d77){return _0x12ff37[_0x962e('0x8')]('VtigerAccount',attributes,{'tableName':_0x962e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8bc9=['request-promise','path','rimraf','exports','define','util','api'];(function(_0x453d6e,_0x5f355c){var _0x2ed7a2=function(_0x4daa48){while(--_0x4daa48){_0x453d6e['push'](_0x453d6e['shift']());}};_0x2ed7a2(++_0x5f355c);}(_0x8bc9,0x10f));var _0x98bc=function(_0x142ab4,_0x9e2991){_0x142ab4=_0x142ab4-0x0;var _0x4666d3=_0x8bc9[_0x142ab4];return _0x4666d3;};'use strict';var _=require('lodash');var util=require(_0x98bc('0x0'));var logger=require('../../config/logger')(_0x98bc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x98bc('0x2'));var fs=require('fs');var path=require(_0x98bc('0x3'));var rimraf=require(_0x98bc('0x4'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x98bc('0x5')]=function(_0xb9b8a7,_0xb0780e){return _0xb9b8a7[_0x98bc('0x6')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2d14a75..6945ab6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7072=['model','then','ShowVtigerAccount','VtigerAccount','find','map','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','options','raw','where','attributes','limit','include'];(function(_0x4e55a9,_0x241b22){var _0x4a9b67=function(_0x2a3bd1){while(--_0x2a3bd1){_0x4e55a9['push'](_0x4e55a9['shift']());}};_0x4a9b67(++_0x241b22);}(_0x7072,0x138));var _0x2707=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x7072[_0x5f1391];return _0x50ebe3;};'use strict';var _=require('lodash');var util=require(_0x2707('0x0'));var moment=require(_0x2707('0x1'));var BPromise=require(_0x2707('0x2'));var rs=require(_0x2707('0x3'));var fs=require('fs');var Redis=require(_0x2707('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2707('0x5'))('rpc');var config=require(_0x2707('0x6'));var jayson=require(_0x2707('0x7'));var client=jayson[_0x2707('0x8')][_0x2707('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fd8ff,_0x128205,_0x21b0a0){return new BPromise(function(_0x745cfd,_0x4062b6){return client[_0x2707('0xa')](_0x2fd8ff,_0x21b0a0)['then'](function(_0x597ff9){logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));logger[_0x2707('0xe')](_0x2707('0xf'),_0x128205,_0x2707('0xd'),JSON[_0x2707('0x10')](_0x597ff9));if(_0x597ff9[_0x2707('0x11')]){if(_0x597ff9[_0x2707('0x11')][_0x2707('0x12')]===0x1f4){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')]['message']);return _0x4062b6(_0x597ff9[_0x2707('0x11')]['message']);}logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')][_0x2707('0x13')]);return _0x745cfd(_0x597ff9[_0x2707('0x11')]['message']);}else{logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));_0x745cfd(_0x597ff9['result'][_0x2707('0x13')]);}})[_0x2707('0x14')](function(_0x1a979e){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x1a979e);_0x4062b6(_0x1a979e);});});}exports[_0x2707('0x15')]=function(_0x4a8b7f){var _0x119ac4=this;return new Promise(function(_0x449a61,_0x4009f3){return db['VtigerAccount']['findAll']({'raw':_0x4a8b7f['options']?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x17')]===undefined?!![]:![]:!![],'where':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x18')]||null:null,'attributes':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x19')]||null:null,'limit':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x1a')]||null:null,'include':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x1b')]?_['map'](_0x4a8b7f[_0x2707('0x16')][_0x2707('0x1b')],function(_0x46259e){return{'model':db[_0x46259e[_0x2707('0x1c')]],'as':_0x46259e['as'],'attributes':_0x46259e[_0x2707('0x19')],'include':_0x46259e[_0x2707('0x1b')]?_['map'](_0x46259e[_0x2707('0x1b')],function(_0x3f6976){return{'model':db[_0x3f6976[_0x2707('0x1c')]],'as':_0x3f6976['as'],'attributes':_0x3f6976[_0x2707('0x19')],'include':_0x3f6976[_0x2707('0x1b')]?_['map'](_0x3f6976[_0x2707('0x1b')],function(_0x4ca05d){return{'model':db[_0x4ca05d[_0x2707('0x1c')]],'as':_0x4ca05d['as'],'attributes':_0x4ca05d[_0x2707('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2707('0x1d')](function(_0x57da26){logger[_0x2707('0xb')](_0x2707('0x15'),_0x4a8b7f);logger[_0x2707('0xe')]('GetVtigerAccount',_0x4a8b7f,JSON[_0x2707('0x10')](_0x57da26));_0x449a61(_0x57da26);})[_0x2707('0x14')](function(_0x4a99ce){logger[_0x2707('0x11')]('GetVtigerAccount',_0x4a99ce['message'],_0x4a8b7f);_0x4009f3(_0x119ac4[_0x2707('0x11')](0x1f4,_0x4a99ce['message']));});});};exports[_0x2707('0x1e')]=function(_0x3f153d){var _0x417a97=this;return new Promise(function(_0x36b2e9,_0x48832b){return db[_0x2707('0x1f')][_0x2707('0x20')]({'raw':_0x3f153d[_0x2707('0x16')]?_0x3f153d[_0x2707('0x16')][_0x2707('0x17')]===undefined?!![]:![]:!![],'where':_0x3f153d[_0x2707('0x16')]?_0x3f153d[_0x2707('0x16')][_0x2707('0x18')]||null:null,'attributes':_0x3f153d[_0x2707('0x16')]?_0x3f153d['options'][_0x2707('0x19')]||null:null,'include':_0x3f153d[_0x2707('0x16')]?_0x3f153d['options']['include']?_['map'](_0x3f153d['options']['include'],function(_0x137e04){return{'model':db[_0x137e04['model']],'as':_0x137e04['as'],'attributes':_0x137e04['attributes'],'include':_0x137e04[_0x2707('0x1b')]?_[_0x2707('0x21')](_0x137e04['include'],function(_0x473954){return{'model':db[_0x473954[_0x2707('0x1c')]],'as':_0x473954['as'],'attributes':_0x473954['attributes'],'include':_0x473954['include']?_[_0x2707('0x21')](_0x473954[_0x2707('0x1b')],function(_0x521edb){return{'model':db[_0x521edb['model']],'as':_0x521edb['as'],'attributes':_0x521edb[_0x2707('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2707('0x1d')](function(_0x5a18b0){logger[_0x2707('0xb')](_0x2707('0x1e'),_0x3f153d);logger[_0x2707('0xe')](_0x2707('0x1e'),_0x3f153d,JSON[_0x2707('0x10')](_0x5a18b0));_0x36b2e9(_0x5a18b0);})[_0x2707('0x14')](function(_0x5bd2e5){logger[_0x2707('0x11')](_0x2707('0x1e'),_0x5bd2e5[_0x2707('0x13')],_0x3f153d);_0x48832b(_0x417a97[_0x2707('0x11')](0x1f4,_0x5bd2e5[_0x2707('0x13')]));});});};
\ No newline at end of file
+var _0xa902=['include','map','model','ShowVtigerAccount','VtigerAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVtigerAccount','findAll','options','raw','where','attributes'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xa902,0x8d));var _0x2a90=function(_0x2402dd,_0x531e8c){_0x2402dd=_0x2402dd-0x0;var _0x11adb=_0xa902[_0x2402dd];return _0x11adb;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var moment=require(_0x2a90('0x2'));var BPromise=require(_0x2a90('0x3'));var rs=require(_0x2a90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a90('0x6'));var config=require(_0x2a90('0x7'));var jayson=require(_0x2a90('0x8'));var client=jayson[_0x2a90('0x9')][_0x2a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bcfc,_0x58369a,_0x4109e6){return new BPromise(function(_0x570659,_0x5ec2b9){return client[_0x2a90('0xb')](_0x25bcfc,_0x4109e6)[_0x2a90('0xc')](function(_0xe500bc){logger[_0x2a90('0xd')](_0x2a90('0xe'),_0x58369a,'request\x20sent');logger[_0x2a90('0xf')](_0x2a90('0x10'),_0x58369a,_0x2a90('0x11'),JSON[_0x2a90('0x12')](_0xe500bc));if(_0xe500bc['error']){if(_0xe500bc[_0x2a90('0x13')]['code']===0x1f4){logger[_0x2a90('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x58369a,_0xe500bc[_0x2a90('0x13')]['message']);return _0x5ec2b9(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}logger[_0x2a90('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x58369a,_0xe500bc['error']['message']);return _0x570659(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}else{logger['info'](_0x2a90('0xe'),_0x58369a,_0x2a90('0x11'));_0x570659(_0xe500bc[_0x2a90('0x15')][_0x2a90('0x14')]);}})[_0x2a90('0x16')](function(_0x37858e){logger[_0x2a90('0x13')](_0x2a90('0xe'),_0x58369a,_0x37858e);_0x5ec2b9(_0x37858e);});});}exports[_0x2a90('0x17')]=function(_0x5c3e4b){var _0x162f0b=this;return new Promise(function(_0x1d9a28,_0x4190ff){return db['VtigerAccount'][_0x2a90('0x18')]({'raw':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')][_0x2a90('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')][_0x2a90('0x1b')]||null:null,'attributes':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')][_0x2a90('0x1c')]||null:null,'limit':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')]['limit']||null:null,'include':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')][_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0x5c3e4b['options'][_0x2a90('0x1d')],function(_0xd033d){return{'model':db[_0xd033d['model']],'as':_0xd033d['as'],'attributes':_0xd033d[_0x2a90('0x1c')],'include':_0xd033d[_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0xd033d[_0x2a90('0x1d')],function(_0x2a212c){return{'model':db[_0x2a212c[_0x2a90('0x1f')]],'as':_0x2a212c['as'],'attributes':_0x2a212c[_0x2a90('0x1c')],'include':_0x2a212c[_0x2a90('0x1d')]?_['map'](_0x2a212c[_0x2a90('0x1d')],function(_0x17f978){return{'model':db[_0x17f978[_0x2a90('0x1f')]],'as':_0x17f978['as'],'attributes':_0x17f978[_0x2a90('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2a90('0xc')](function(_0x5208d8){logger['info'](_0x2a90('0x17'),_0x5c3e4b);logger['debug']('GetVtigerAccount',_0x5c3e4b,JSON['stringify'](_0x5208d8));_0x1d9a28(_0x5208d8);})[_0x2a90('0x16')](function(_0x3c78f5){logger['error']('GetVtigerAccount',_0x3c78f5[_0x2a90('0x14')],_0x5c3e4b);_0x4190ff(_0x162f0b['error'](0x1f4,_0x3c78f5[_0x2a90('0x14')]));});});};exports[_0x2a90('0x20')]=function(_0x3b580f){var _0x27b6b6=this;return new Promise(function(_0xf18d11,_0x11586c){return db[_0x2a90('0x21')]['find']({'raw':_0x3b580f[_0x2a90('0x19')]?_0x3b580f[_0x2a90('0x19')][_0x2a90('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b580f['options']?_0x3b580f[_0x2a90('0x19')][_0x2a90('0x1b')]||null:null,'attributes':_0x3b580f[_0x2a90('0x19')]?_0x3b580f[_0x2a90('0x19')]['attributes']||null:null,'include':_0x3b580f[_0x2a90('0x19')]?_0x3b580f[_0x2a90('0x19')][_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0x3b580f[_0x2a90('0x19')][_0x2a90('0x1d')],function(_0x4d4149){return{'model':db[_0x4d4149[_0x2a90('0x1f')]],'as':_0x4d4149['as'],'attributes':_0x4d4149[_0x2a90('0x1c')],'include':_0x4d4149[_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0x4d4149['include'],function(_0x1bab1d){return{'model':db[_0x1bab1d[_0x2a90('0x1f')]],'as':_0x1bab1d['as'],'attributes':_0x1bab1d['attributes'],'include':_0x1bab1d[_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0x1bab1d['include'],function(_0x5073a4){return{'model':db[_0x5073a4[_0x2a90('0x1f')]],'as':_0x5073a4['as'],'attributes':_0x5073a4[_0x2a90('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2a90('0xc')](function(_0x4cd36c){logger[_0x2a90('0xd')]('ShowVtigerAccount',_0x3b580f);logger[_0x2a90('0xf')]('ShowVtigerAccount',_0x3b580f,JSON[_0x2a90('0x12')](_0x4cd36c));_0xf18d11(_0x4cd36c);})['catch'](function(_0x5322dc){logger[_0x2a90('0x13')]('ShowVtigerAccount',_0x5322dc[_0x2a90('0x14')],_0x3b580f);_0x11586c(_0x27b6b6[_0x2a90('0x13')](0x1f4,_0x5322dc[_0x2a90('0x14')]));});});};
\ No newline at end of file
index d72933c..8a49478 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x183e=['../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x2ad0d9,_0x29ebca){var _0x27aa31=function(_0x1f6650){while(--_0x1f6650){_0x2ad0d9['push'](_0x2ad0d9['shift']());}};_0x27aa31(++_0x29ebca);}(_0x183e,0xa9));var _0xe183=function(_0x5140ec,_0x128b6f){_0x5140ec=_0x5140ec-0x0;var _0x272f48=_0x183e[_0x5140ec];return _0x272f48;};'use strict';var multer=require(_0xe183('0x0'));var util=require(_0xe183('0x1'));var path=require(_0xe183('0x2'));var timeout=require(_0xe183('0x3'));var express=require(_0xe183('0x4'));var router=express['Router']();var fs_extra=require(_0xe183('0x5'));var auth=require(_0xe183('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe183('0x7'));var controller=require(_0xe183('0x8'));router[_0xe183('0x9')]('/',auth[_0xe183('0xa')](),controller[_0xe183('0xb')]);router[_0xe183('0x9')](_0xe183('0xc'),auth[_0xe183('0xa')](),controller[_0xe183('0xd')]);router[_0xe183('0x9')](_0xe183('0xe'),auth[_0xe183('0xa')](),controller['getFields']);router[_0xe183('0x9')](_0xe183('0xf'),auth[_0xe183('0xa')](),controller[_0xe183('0x10')]);router[_0xe183('0x9')](_0xe183('0x11'),auth[_0xe183('0xa')](),controller[_0xe183('0x12')]);router[_0xe183('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe183('0x14')](_0xe183('0xc'),auth[_0xe183('0xa')](),controller[_0xe183('0x15')]);router[_0xe183('0x16')](_0xe183('0xc'),auth[_0xe183('0xa')](),controller[_0xe183('0x17')]);module[_0xe183('0x18')]=router;
\ No newline at end of file
+var _0x7bd4=['/:id/descriptions','getDescriptions','put','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects'];(function(_0xfbe06e,_0x2fb7ab){var _0x24e5b6=function(_0x48569f){while(--_0x48569f){_0xfbe06e['push'](_0xfbe06e['shift']());}};_0x24e5b6(++_0x2fb7ab);}(_0x7bd4,0x146));var _0x47bd=function(_0x3094e3,_0x2f1d21){_0x3094e3=_0x3094e3-0x0;var _0x3b2aab=_0x7bd4[_0x3094e3];return _0x3b2aab;};'use strict';var multer=require(_0x47bd('0x0'));var util=require(_0x47bd('0x1'));var path=require(_0x47bd('0x2'));var timeout=require(_0x47bd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x47bd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x47bd('0x5'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0x47bd('0x6')]('/',auth[_0x47bd('0x7')](),controller[_0x47bd('0x8')]);router[_0x47bd('0x6')](_0x47bd('0x9'),auth[_0x47bd('0x7')](),controller[_0x47bd('0xa')]);router[_0x47bd('0x6')](_0x47bd('0xb'),auth[_0x47bd('0x7')](),controller['getFields']);router[_0x47bd('0x6')](_0x47bd('0xc'),auth[_0x47bd('0x7')](),controller[_0x47bd('0xd')]);router[_0x47bd('0x6')](_0x47bd('0xe'),auth['isAuthenticated'](),controller[_0x47bd('0xf')]);router['post']('/',auth[_0x47bd('0x7')](),controller['create']);router[_0x47bd('0x10')](_0x47bd('0x9'),auth[_0x47bd('0x7')](),controller[_0x47bd('0x11')]);router['delete'](_0x47bd('0x9'),auth[_0x47bd('0x7')](),controller[_0x47bd('0x12')]);module[_0x47bd('0x13')]=router;
\ No newline at end of file
index 3694f08..3b3d18c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3364=['STRING','sequelize','exports'];(function(_0x2ace42,_0x4c5d89){var _0x4d1657=function(_0x309791){while(--_0x309791){_0x2ace42['push'](_0x2ace42['shift']());}};_0x4d1657(++_0x4c5d89);}(_0x3364,0xb8));var _0x4336=function(_0x480328,_0x50201b){_0x480328=_0x480328-0x0;var _0x31f866=_0x3364[_0x480328];return _0x31f866;};'use strict';var Sequelize=require(_0x4336('0x0'));module[_0x4336('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4336('0x2')]}};
\ No newline at end of file
+var _0x0d2a=['STRING','sequelize','exports'];(function(_0x3db068,_0x48151f){var _0x3a23bd=function(_0x509d7c){while(--_0x509d7c){_0x3db068['push'](_0x3db068['shift']());}};_0x3a23bd(++_0x48151f);}(_0x0d2a,0x19c));var _0xa0d2=function(_0x10b91f,_0x3c4dd3){_0x10b91f=_0x10b91f-0x0;var _0x45ff20=_0x0d2a[_0x10b91f];return _0x45ff20;};'use strict';var Sequelize=require(_0xa0d2('0x0'));module[_0xa0d2('0x1')]={'name':{'type':Sequelize[_0xa0d2('0x2')]},'description':{'type':Sequelize[_0xa0d2('0x2')]}};
\ No newline at end of file
index b1c8fc0..e51e900 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4169=['merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','create','body','find','params','getFields','findOne','pick','getSubjects','VtigerField','getDescriptions','rimraf','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/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x2a5203,_0x42834d){var _0x580809=function(_0x319619){while(--_0x319619){_0x2a5203['push'](_0x2a5203['shift']());}};_0x580809(++_0x42834d);}(_0x4169,0x64));var _0x9416=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4169[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9416('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9416('0x1'));var rp=require(_0x9416('0x2'));var moment=require(_0x9416('0x3'));var BPromise=require(_0x9416('0x4'));var Mustache=require(_0x9416('0x5'));var util=require(_0x9416('0x6'));var path=require('path');var sox=require(_0x9416('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9416('0x8'));var _=require(_0x9416('0x9'));var squel=require(_0x9416('0xa'));var crypto=require(_0x9416('0xb'));var jsforce=require(_0x9416('0xc'));var deskjs=require(_0x9416('0xd'));var toCsv=require(_0x9416('0xe'));var querystring=require(_0x9416('0xf'));var Papa=require('papaparse');var Redis=require(_0x9416('0x10'));var authService=require(_0x9416('0x11'));var qs=require(_0x9416('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9416('0x13'));var logger=require(_0x9416('0x14'))('api');var utils=require(_0x9416('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9416('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x110594,_0x548957){_0x548957=_0x548957||0xcc;return function(_0x1632ce){if(_0x1632ce){return _0x110594[_0x9416('0x17')](_0x548957);}return _0x110594[_0x9416('0x18')](_0x548957)[_0x9416('0x19')]();};}function respondWithResult(_0x3b982f,_0x10ebba){_0x10ebba=_0x10ebba||0xc8;return function(_0x1c298a){if(_0x1c298a){return _0x3b982f['status'](_0x10ebba)['json'](_0x1c298a);}};}function respondWithFilteredResult(_0x304072,_0x59ea43){return function(_0x41f44b){if(_0x41f44b){var _0x24b482=typeof _0x59ea43['offset']===_0x9416('0x1a')&&typeof _0x59ea43[_0x9416('0x1b')]===_0x9416('0x1a');var _0x520cdc=_0x41f44b['count'];var _0x27ca22=_0x24b482?0x0:_0x59ea43[_0x9416('0x1c')];var _0x40908a=_0x24b482?_0x41f44b['count']:_0x59ea43[_0x9416('0x1c')]+_0x59ea43[_0x9416('0x1b')];var _0x5edb80;if(_0x40908a>=_0x520cdc){_0x40908a=_0x520cdc;_0x5edb80=0xc8;}else{_0x5edb80=0xce;}_0x304072[_0x9416('0x18')](_0x5edb80);return _0x304072[_0x9416('0x1d')](_0x9416('0x1e'),_0x27ca22+'-'+_0x40908a+'/'+_0x520cdc)[_0x9416('0x1f')](_0x41f44b);}return null;};}function patchUpdates(_0x2034d9){return function(_0x3d10c3){try{jsonpatch[_0x9416('0x20')](_0x3d10c3,_0x2034d9,!![]);}catch(_0x536064){return BPromise[_0x9416('0x21')](_0x536064);}return _0x3d10c3[_0x9416('0x22')]();};}function saveUpdates(_0x3d24b4,_0x1c393b){return function(_0x2c355c){if(_0x2c355c){return _0x2c355c[_0x9416('0x23')](_0x3d24b4)[_0x9416('0x24')](function(_0x339a5d){return _0x339a5d;});}return null;};}function removeEntity(_0x5a3118,_0x24327e){return function(_0x2a6616){if(_0x2a6616){return _0x2a6616[_0x9416('0x25')]()[_0x9416('0x24')](function(){_0x5a3118[_0x9416('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x251a4c,_0x50ae91){return function(_0x57d0c2){if(!_0x57d0c2){_0x251a4c['sendStatus'](0x194);}return _0x57d0c2;};}function handleError(_0x5e6580,_0x154dd6){_0x154dd6=_0x154dd6||0x1f4;return function(_0x47152f){logger['error'](_0x47152f[_0x9416('0x26')]);if(_0x47152f[_0x9416('0x27')]){delete _0x47152f[_0x9416('0x27')];}_0x5e6580[_0x9416('0x18')](_0x154dd6)['send'](_0x47152f);};}exports['index']=function(_0x4cb1a6,_0x31e3b3){var _0x13acfb={},_0x5740a9={},_0x195cea={'count':0x0,'rows':[]};var _0x189964=_[_0x9416('0x28')](db[_0x9416('0x29')][_0x9416('0x2a')],function(_0x3a611e){return{'name':_0x3a611e[_0x9416('0x2b')],'type':_0x3a611e[_0x9416('0x2c')][_0x9416('0x2d')]};});_0x5740a9[_0x9416('0x2e')]=_[_0x9416('0x28')](_0x189964,_0x9416('0x27'));_0x5740a9[_0x9416('0x2f')]=_[_0x9416('0x30')](_0x4cb1a6[_0x9416('0x2f')]);_0x5740a9[_0x9416('0x31')]=_[_0x9416('0x32')](_0x5740a9[_0x9416('0x2e')],_0x5740a9[_0x9416('0x2f')]);_0x13acfb['attributes']=_[_0x9416('0x32')](_0x5740a9['model'],qs[_0x9416('0x33')](_0x4cb1a6[_0x9416('0x2f')][_0x9416('0x33')]));_0x13acfb[_0x9416('0x34')]=_0x13acfb[_0x9416('0x34')][_0x9416('0x35')]?_0x13acfb['attributes']:_0x5740a9[_0x9416('0x2e')];if(!_0x4cb1a6['query'][_0x9416('0x36')](_0x9416('0x37'))){_0x13acfb[_0x9416('0x1b')]=qs[_0x9416('0x1b')](_0x4cb1a6[_0x9416('0x2f')][_0x9416('0x1b')]);_0x13acfb[_0x9416('0x1c')]=qs[_0x9416('0x1c')](_0x4cb1a6[_0x9416('0x2f')]['offset']);}_0x13acfb[_0x9416('0x38')]=qs[_0x9416('0x39')](_0x4cb1a6['query']['sort']);_0x13acfb['where']=qs['filters'](_['pick'](_0x4cb1a6[_0x9416('0x2f')],_0x5740a9[_0x9416('0x31')]),_0x189964);if(_0x4cb1a6[_0x9416('0x2f')][_0x9416('0x3a')]){_0x13acfb[_0x9416('0x3b')]=_[_0x9416('0x3c')](_0x13acfb[_0x9416('0x3b')],{'$or':_['map'](_0x189964,function(_0x3ac970){if(_0x3ac970[_0x9416('0x2c')]!==_0x9416('0x3d')){var _0x5198b8={};_0x5198b8[_0x3ac970[_0x9416('0x27')]]={'$like':'%'+_0x4cb1a6[_0x9416('0x2f')]['filter']+'%'};return _0x5198b8;}})});}_0x13acfb=_['merge']({},_0x13acfb,_0x4cb1a6[_0x9416('0x3e')]);var _0x27e36b={'where':_0x13acfb[_0x9416('0x3b')]};return db[_0x9416('0x29')][_0x9416('0x3f')](_0x27e36b)[_0x9416('0x24')](function(_0xf00809){_0x195cea[_0x9416('0x3f')]=_0xf00809;if(_0x4cb1a6[_0x9416('0x2f')][_0x9416('0x40')]){_0x13acfb['include']=[{'all':!![]}];}return db[_0x9416('0x29')][_0x9416('0x41')](_0x13acfb);})[_0x9416('0x24')](function(_0x81650c){_0x195cea[_0x9416('0x42')]=_0x81650c;return _0x195cea;})[_0x9416('0x24')](respondWithFilteredResult(_0x31e3b3,_0x13acfb))[_0x9416('0x43')](handleError(_0x31e3b3,null));};exports[_0x9416('0x44')]=function(_0x502eb0,_0x1059f1){var _0x538697={'raw':![],'where':{'id':_0x502eb0['params']['id']}},_0x3d467c={};_0x3d467c['model']=_[_0x9416('0x30')](db[_0x9416('0x29')][_0x9416('0x2a')]);_0x3d467c[_0x9416('0x2f')]=_[_0x9416('0x30')](_0x502eb0[_0x9416('0x2f')]);_0x3d467c[_0x9416('0x31')]=_[_0x9416('0x32')](_0x3d467c[_0x9416('0x2e')],_0x3d467c[_0x9416('0x2f')]);_0x538697[_0x9416('0x34')]=_[_0x9416('0x32')](_0x3d467c[_0x9416('0x2e')],qs['fields'](_0x502eb0['query']['fields']));_0x538697['attributes']=_0x538697[_0x9416('0x34')]['length']?_0x538697[_0x9416('0x34')]:_0x3d467c[_0x9416('0x2e')];if(_0x502eb0[_0x9416('0x2f')][_0x9416('0x40')]){_0x538697[_0x9416('0x45')]=[{'all':!![]}];}_0x538697=_[_0x9416('0x3c')]({},_0x538697,_0x502eb0[_0x9416('0x3e')]);return db[_0x9416('0x29')]['find'](_0x538697)['then'](handleEntityNotFound(_0x1059f1,null))['then'](respondWithResult(_0x1059f1,null))['catch'](handleError(_0x1059f1,null));};exports[_0x9416('0x46')]=function(_0x1b1278,_0x1e8eaf){return db[_0x9416('0x29')][_0x9416('0x46')](_0x1b1278['body'],{})[_0x9416('0x24')](respondWithResult(_0x1e8eaf,0xc9))['catch'](handleError(_0x1e8eaf,null));};exports[_0x9416('0x23')]=function(_0x6b0676,_0x262b3d){if(_0x6b0676[_0x9416('0x47')]['id']){delete _0x6b0676['body']['id'];}return db['VtigerConfiguration'][_0x9416('0x48')]({'where':{'id':_0x6b0676[_0x9416('0x49')]['id']}})['then'](handleEntityNotFound(_0x262b3d,null))[_0x9416('0x24')](saveUpdates(_0x6b0676['body'],null))[_0x9416('0x24')](respondWithResult(_0x262b3d,null))['catch'](handleError(_0x262b3d,null));};exports[_0x9416('0x25')]=function(_0x2af7e9,_0x4fff20){return db['VtigerConfiguration']['find']({'where':{'id':_0x2af7e9[_0x9416('0x49')]['id']}})['then'](handleEntityNotFound(_0x4fff20,null))[_0x9416('0x24')](removeEntity(_0x4fff20,null))['catch'](handleError(_0x4fff20,null));};exports[_0x9416('0x4a')]=function(_0x4e6407,_0x2c4551,_0x19e754){var _0x4ab49a={};var _0x4dcc95={};var _0x3f3474;var _0x44cf43;return db['VtigerConfiguration'][_0x9416('0x4b')]({'where':{'id':_0x4e6407[_0x9416('0x49')]['id']}})[_0x9416('0x24')](handleEntityNotFound(_0x2c4551,null))[_0x9416('0x24')](function(_0x2ac3a7){if(_0x2ac3a7){_0x3f3474=_0x2ac3a7;_0x4dcc95[_0x9416('0x2e')]=_['keys'](db['VtigerField'][_0x9416('0x2a')]);_0x4dcc95[_0x9416('0x2f')]=_[_0x9416('0x30')](_0x4e6407['query']);_0x4dcc95[_0x9416('0x31')]=_['intersection'](_0x4dcc95[_0x9416('0x2e')],_0x4dcc95[_0x9416('0x2f')]);_0x4ab49a[_0x9416('0x34')]=_[_0x9416('0x32')](_0x4dcc95[_0x9416('0x2e')],qs['fields'](_0x4e6407['query'][_0x9416('0x33')]));_0x4ab49a[_0x9416('0x34')]=_0x4ab49a[_0x9416('0x34')][_0x9416('0x35')]?_0x4ab49a[_0x9416('0x34')]:_0x4dcc95['model'];_0x4ab49a[_0x9416('0x38')]=qs[_0x9416('0x39')](_0x4e6407[_0x9416('0x2f')][_0x9416('0x39')]);_0x4ab49a[_0x9416('0x3b')]=qs['filters'](_[_0x9416('0x4c')](_0x4e6407[_0x9416('0x2f')],_0x4dcc95[_0x9416('0x31')]));if(_0x4e6407[_0x9416('0x2f')][_0x9416('0x3a')]){_0x4ab49a[_0x9416('0x3b')]=_['merge'](_0x4ab49a['where'],{'$or':_[_0x9416('0x28')](_0x4ab49a[_0x9416('0x34')],function(_0x4037c5){var _0x477718={};_0x477718[_0x4037c5]={'$like':'%'+_0x4e6407[_0x9416('0x2f')]['filter']+'%'};return _0x477718;})});}_0x4ab49a=_['merge']({},_0x4ab49a,_0x4e6407[_0x9416('0x3e')]);return _0x3f3474['getFields'](_0x4ab49a);}})[_0x9416('0x24')](function(_0x275f9b){if(_0x275f9b){_0x44cf43=_0x275f9b[_0x9416('0x35')];if(!_0x4e6407[_0x9416('0x2f')]['hasOwnProperty'](_0x9416('0x37'))){_0x4ab49a['limit']=qs[_0x9416('0x1b')](_0x4e6407[_0x9416('0x2f')][_0x9416('0x1b')]);_0x4ab49a[_0x9416('0x1c')]=qs['offset'](_0x4e6407[_0x9416('0x2f')][_0x9416('0x1c')]);}return _0x3f3474[_0x9416('0x4a')](_0x4ab49a);}})[_0x9416('0x24')](function(_0x8e7404){if(_0x8e7404){return _0x8e7404?{'count':_0x44cf43,'rows':_0x8e7404}:null;}})['then'](respondWithResult(_0x2c4551,null))[_0x9416('0x43')](handleError(_0x2c4551,null));};exports[_0x9416('0x4d')]=function(_0xb30508,_0x551789,_0x55e3ab){var _0x514075={};var _0xf6acfc={};var _0x294887;var _0x3a84e9;return db[_0x9416('0x29')][_0x9416('0x4b')]({'where':{'id':_0xb30508[_0x9416('0x49')]['id']}})[_0x9416('0x24')](handleEntityNotFound(_0x551789,null))['then'](function(_0x13b2b1){if(_0x13b2b1){_0x294887=_0x13b2b1;_0xf6acfc['model']=_[_0x9416('0x30')](db[_0x9416('0x4e')][_0x9416('0x2a')]);_0xf6acfc[_0x9416('0x2f')]=_[_0x9416('0x30')](_0xb30508['query']);_0xf6acfc[_0x9416('0x31')]=_[_0x9416('0x32')](_0xf6acfc[_0x9416('0x2e')],_0xf6acfc[_0x9416('0x2f')]);_0x514075['attributes']=_[_0x9416('0x32')](_0xf6acfc['model'],qs[_0x9416('0x33')](_0xb30508['query'][_0x9416('0x33')]));_0x514075['attributes']=_0x514075[_0x9416('0x34')][_0x9416('0x35')]?_0x514075['attributes']:_0xf6acfc[_0x9416('0x2e')];_0x514075[_0x9416('0x38')]=qs[_0x9416('0x39')](_0xb30508[_0x9416('0x2f')][_0x9416('0x39')]);_0x514075[_0x9416('0x3b')]=qs[_0x9416('0x31')](_[_0x9416('0x4c')](_0xb30508[_0x9416('0x2f')],_0xf6acfc[_0x9416('0x31')]));if(_0xb30508['query'][_0x9416('0x3a')]){_0x514075['where']=_[_0x9416('0x3c')](_0x514075[_0x9416('0x3b')],{'$or':_['map'](_0x514075['attributes'],function(_0x15ea97){var _0x1dfa93={};_0x1dfa93[_0x15ea97]={'$like':'%'+_0xb30508[_0x9416('0x2f')]['filter']+'%'};return _0x1dfa93;})});}_0x514075=_[_0x9416('0x3c')]({},_0x514075,_0xb30508['options']);return _0x294887[_0x9416('0x4d')](_0x514075);}})['then'](function(_0x5f0c5c){if(_0x5f0c5c){_0x3a84e9=_0x5f0c5c[_0x9416('0x35')];if(!_0xb30508['query'][_0x9416('0x36')](_0x9416('0x37'))){_0x514075[_0x9416('0x1b')]=qs[_0x9416('0x1b')](_0xb30508['query'][_0x9416('0x1b')]);_0x514075[_0x9416('0x1c')]=qs[_0x9416('0x1c')](_0xb30508[_0x9416('0x2f')]['offset']);}return _0x294887[_0x9416('0x4d')](_0x514075);}})[_0x9416('0x24')](function(_0x1d0c4f){if(_0x1d0c4f){return _0x1d0c4f?{'count':_0x3a84e9,'rows':_0x1d0c4f}:null;}})[_0x9416('0x24')](respondWithResult(_0x551789,null))[_0x9416('0x43')](handleError(_0x551789,null));};exports[_0x9416('0x4f')]=function(_0x4c0938,_0x45dc60,_0x552ba5){var _0xcdc4c8={};var _0xe2213b={};var _0x295ee7;var _0x3f184e;return db[_0x9416('0x29')]['findOne']({'where':{'id':_0x4c0938[_0x9416('0x49')]['id']}})['then'](handleEntityNotFound(_0x45dc60,null))[_0x9416('0x24')](function(_0x4b7064){if(_0x4b7064){_0x295ee7=_0x4b7064;_0xe2213b[_0x9416('0x2e')]=_['keys'](db[_0x9416('0x4e')][_0x9416('0x2a')]);_0xe2213b[_0x9416('0x2f')]=_[_0x9416('0x30')](_0x4c0938[_0x9416('0x2f')]);_0xe2213b['filters']=_[_0x9416('0x32')](_0xe2213b[_0x9416('0x2e')],_0xe2213b[_0x9416('0x2f')]);_0xcdc4c8[_0x9416('0x34')]=_[_0x9416('0x32')](_0xe2213b[_0x9416('0x2e')],qs['fields'](_0x4c0938['query'][_0x9416('0x33')]));_0xcdc4c8['attributes']=_0xcdc4c8[_0x9416('0x34')]['length']?_0xcdc4c8['attributes']:_0xe2213b[_0x9416('0x2e')];_0xcdc4c8[_0x9416('0x38')]=qs[_0x9416('0x39')](_0x4c0938[_0x9416('0x2f')][_0x9416('0x39')]);_0xcdc4c8[_0x9416('0x3b')]=qs[_0x9416('0x31')](_[_0x9416('0x4c')](_0x4c0938['query'],_0xe2213b[_0x9416('0x31')]));if(_0x4c0938[_0x9416('0x2f')]['filter']){_0xcdc4c8[_0x9416('0x3b')]=_['merge'](_0xcdc4c8[_0x9416('0x3b')],{'$or':_[_0x9416('0x28')](_0xcdc4c8[_0x9416('0x34')],function(_0x23a289){var _0x5453e2={};_0x5453e2[_0x23a289]={'$like':'%'+_0x4c0938[_0x9416('0x2f')]['filter']+'%'};return _0x5453e2;})});}_0xcdc4c8=_['merge']({},_0xcdc4c8,_0x4c0938['options']);return _0x295ee7[_0x9416('0x4f')](_0xcdc4c8);}})['then'](function(_0x446094){if(_0x446094){_0x3f184e=_0x446094[_0x9416('0x35')];if(!_0x4c0938['query']['hasOwnProperty']('nolimit')){_0xcdc4c8[_0x9416('0x1b')]=qs[_0x9416('0x1b')](_0x4c0938[_0x9416('0x2f')][_0x9416('0x1b')]);_0xcdc4c8[_0x9416('0x1c')]=qs[_0x9416('0x1c')](_0x4c0938[_0x9416('0x2f')][_0x9416('0x1c')]);}return _0x295ee7[_0x9416('0x4f')](_0xcdc4c8);}})[_0x9416('0x24')](function(_0x2f30bc){if(_0x2f30bc){return _0x2f30bc?{'count':_0x3f184e,'rows':_0x2f30bc}:null;}})[_0x9416('0x24')](respondWithResult(_0x45dc60,null))[_0x9416('0x43')](handleError(_0x45dc60,null));};
\ No newline at end of file
+var _0xf882=['rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','then','include','findAll','rows','catch','params','includeAll','options','find','create','body','destroy','findOne','VtigerField','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','error','name','send','index','map','VtigerConfiguration'];(function(_0xb5aa9c,_0xc5a822){var _0x12fd16=function(_0x50fb86){while(--_0x50fb86){_0xb5aa9c['push'](_0xb5aa9c['shift']());}};_0x12fd16(++_0xc5a822);}(_0xf882,0x114));var _0x2f88=function(_0x27cb09,_0x274c1e){_0x27cb09=_0x27cb09-0x0;var _0x21790a=_0xf882[_0x27cb09];return _0x21790a;};'use strict';var emlformat=require(_0x2f88('0x0'));var rimraf=require(_0x2f88('0x1'));var zipdir=require(_0x2f88('0x2'));var jsonpatch=require(_0x2f88('0x3'));var rp=require(_0x2f88('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2f88('0x5'));var sox=require(_0x2f88('0x6'));var csv=require(_0x2f88('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2f88('0x8'));var crypto=require(_0x2f88('0x9'));var jsforce=require(_0x2f88('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2f88('0x7'));var querystring=require(_0x2f88('0xb'));var Papa=require(_0x2f88('0xc'));var Redis=require(_0x2f88('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x2f88('0xe'));var as=require(_0x2f88('0xf'));var hardwareService=require(_0x2f88('0x10'));var logger=require(_0x2f88('0x11'))(_0x2f88('0x12'));var utils=require(_0x2f88('0x13'));var config=require(_0x2f88('0x14'));var licenseUtil=require(_0x2f88('0x15'));var db=require(_0x2f88('0x16'))['db'];function respondWithStatusCode(_0x26442e,_0x31ee78){_0x31ee78=_0x31ee78||0xcc;return function(_0x1bd70d){if(_0x1bd70d){return _0x26442e['sendStatus'](_0x31ee78);}return _0x26442e[_0x2f88('0x17')](_0x31ee78)[_0x2f88('0x18')]();};}function respondWithResult(_0x560329,_0x541ea3){_0x541ea3=_0x541ea3||0xc8;return function(_0x1999b0){if(_0x1999b0){return _0x560329[_0x2f88('0x17')](_0x541ea3)[_0x2f88('0x19')](_0x1999b0);}};}function respondWithFilteredResult(_0x48842c,_0x2eafb7){return function(_0x220cad){if(_0x220cad){var _0x22ae81=typeof _0x2eafb7[_0x2f88('0x1a')]==='undefined'&&typeof _0x2eafb7['limit']===_0x2f88('0x1b');var _0x545163=_0x220cad['count'];var _0x4f5e5b=_0x22ae81?0x0:_0x2eafb7[_0x2f88('0x1a')];var _0x1b661b=_0x22ae81?_0x220cad[_0x2f88('0x1c')]:_0x2eafb7['offset']+_0x2eafb7['limit'];var _0x3e3e53;if(_0x1b661b>=_0x545163){_0x1b661b=_0x545163;_0x3e3e53=0xc8;}else{_0x3e3e53=0xce;}_0x48842c[_0x2f88('0x17')](_0x3e3e53);return _0x48842c[_0x2f88('0x1d')](_0x2f88('0x1e'),_0x4f5e5b+'-'+_0x1b661b+'/'+_0x545163)[_0x2f88('0x19')](_0x220cad);}return null;};}function patchUpdates(_0xd87615){return function(_0x4445a9){try{jsonpatch['apply'](_0x4445a9,_0xd87615,!![]);}catch(_0x12934f){return BPromise[_0x2f88('0x1f')](_0x12934f);}return _0x4445a9[_0x2f88('0x20')]();};}function saveUpdates(_0x38cf65,_0x59b144){return function(_0x1fda0d){if(_0x1fda0d){return _0x1fda0d[_0x2f88('0x21')](_0x38cf65)['then'](function(_0xb63fc5){return _0xb63fc5;});}return null;};}function removeEntity(_0x148c31,_0x59640a){return function(_0x455650){if(_0x455650){return _0x455650['destroy']()['then'](function(){_0x148c31['status'](0xcc)[_0x2f88('0x18')]();});}};}function handleEntityNotFound(_0x4f9709,_0x2b5e89){return function(_0x242149){if(!_0x242149){_0x4f9709['sendStatus'](0x194);}return _0x242149;};}function handleError(_0x1e51c7,_0x367b3f){_0x367b3f=_0x367b3f||0x1f4;return function(_0x5c2297){logger[_0x2f88('0x22')](_0x5c2297['stack']);if(_0x5c2297[_0x2f88('0x23')]){delete _0x5c2297[_0x2f88('0x23')];}_0x1e51c7[_0x2f88('0x17')](_0x367b3f)[_0x2f88('0x24')](_0x5c2297);};}exports[_0x2f88('0x25')]=function(_0x471076,_0x3a75bd){var _0x2083bf={},_0x3e02a2={},_0x2b5aa5={'count':0x0,'rows':[]};var _0x171e4f=_[_0x2f88('0x26')](db[_0x2f88('0x27')][_0x2f88('0x28')],function(_0x427200){return{'name':_0x427200[_0x2f88('0x29')],'type':_0x427200[_0x2f88('0x2a')][_0x2f88('0x2b')]};});_0x3e02a2['model']=_[_0x2f88('0x26')](_0x171e4f,_0x2f88('0x23'));_0x3e02a2[_0x2f88('0x2c')]=_[_0x2f88('0x2d')](_0x471076['query']);_0x3e02a2[_0x2f88('0x2e')]=_[_0x2f88('0x2f')](_0x3e02a2['model'],_0x3e02a2[_0x2f88('0x2c')]);_0x2083bf['attributes']=_[_0x2f88('0x2f')](_0x3e02a2[_0x2f88('0x30')],qs[_0x2f88('0x31')](_0x471076[_0x2f88('0x2c')][_0x2f88('0x31')]));_0x2083bf[_0x2f88('0x32')]=_0x2083bf[_0x2f88('0x32')][_0x2f88('0x33')]?_0x2083bf[_0x2f88('0x32')]:_0x3e02a2[_0x2f88('0x30')];if(!_0x471076[_0x2f88('0x2c')][_0x2f88('0x34')](_0x2f88('0x35'))){_0x2083bf[_0x2f88('0x36')]=qs['limit'](_0x471076[_0x2f88('0x2c')][_0x2f88('0x36')]);_0x2083bf[_0x2f88('0x1a')]=qs[_0x2f88('0x1a')](_0x471076[_0x2f88('0x2c')][_0x2f88('0x1a')]);}_0x2083bf[_0x2f88('0x37')]=qs['sort'](_0x471076[_0x2f88('0x2c')][_0x2f88('0x38')]);_0x2083bf[_0x2f88('0x39')]=qs[_0x2f88('0x2e')](_[_0x2f88('0x3a')](_0x471076[_0x2f88('0x2c')],_0x3e02a2[_0x2f88('0x2e')]),_0x171e4f);if(_0x471076[_0x2f88('0x2c')][_0x2f88('0x3b')]){_0x2083bf[_0x2f88('0x39')]=_['merge'](_0x2083bf['where'],{'$or':_['map'](_0x171e4f,function(_0x134690){if(_0x134690['type']!==_0x2f88('0x3c')){var _0x341984={};_0x341984[_0x134690[_0x2f88('0x23')]]={'$like':'%'+_0x471076[_0x2f88('0x2c')][_0x2f88('0x3b')]+'%'};return _0x341984;}})});}_0x2083bf=_[_0x2f88('0x3d')]({},_0x2083bf,_0x471076['options']);var _0xcb5078={'where':_0x2083bf[_0x2f88('0x39')]};return db[_0x2f88('0x27')][_0x2f88('0x1c')](_0xcb5078)[_0x2f88('0x3e')](function(_0x17abe5){_0x2b5aa5[_0x2f88('0x1c')]=_0x17abe5;if(_0x471076['query']['includeAll']){_0x2083bf[_0x2f88('0x3f')]=[{'all':!![]}];}return db[_0x2f88('0x27')][_0x2f88('0x40')](_0x2083bf);})['then'](function(_0x254e01){_0x2b5aa5[_0x2f88('0x41')]=_0x254e01;return _0x2b5aa5;})[_0x2f88('0x3e')](respondWithFilteredResult(_0x3a75bd,_0x2083bf))[_0x2f88('0x42')](handleError(_0x3a75bd,null));};exports['show']=function(_0x5529d2,_0x27a33f){var _0x4e82ce={'raw':![],'where':{'id':_0x5529d2[_0x2f88('0x43')]['id']}},_0x1b3316={};_0x1b3316[_0x2f88('0x30')]=_[_0x2f88('0x2d')](db[_0x2f88('0x27')][_0x2f88('0x28')]);_0x1b3316[_0x2f88('0x2c')]=_[_0x2f88('0x2d')](_0x5529d2[_0x2f88('0x2c')]);_0x1b3316[_0x2f88('0x2e')]=_['intersection'](_0x1b3316[_0x2f88('0x30')],_0x1b3316[_0x2f88('0x2c')]);_0x4e82ce['attributes']=_[_0x2f88('0x2f')](_0x1b3316[_0x2f88('0x30')],qs[_0x2f88('0x31')](_0x5529d2['query']['fields']));_0x4e82ce[_0x2f88('0x32')]=_0x4e82ce['attributes']['length']?_0x4e82ce[_0x2f88('0x32')]:_0x1b3316['model'];if(_0x5529d2[_0x2f88('0x2c')][_0x2f88('0x44')]){_0x4e82ce[_0x2f88('0x3f')]=[{'all':!![]}];}_0x4e82ce=_[_0x2f88('0x3d')]({},_0x4e82ce,_0x5529d2[_0x2f88('0x45')]);return db[_0x2f88('0x27')][_0x2f88('0x46')](_0x4e82ce)[_0x2f88('0x3e')](handleEntityNotFound(_0x27a33f,null))[_0x2f88('0x3e')](respondWithResult(_0x27a33f,null))['catch'](handleError(_0x27a33f,null));};exports[_0x2f88('0x47')]=function(_0x3e78e2,_0x4cf1d9){return db['VtigerConfiguration'][_0x2f88('0x47')](_0x3e78e2[_0x2f88('0x48')],{})[_0x2f88('0x3e')](respondWithResult(_0x4cf1d9,0xc9))[_0x2f88('0x42')](handleError(_0x4cf1d9,null));};exports[_0x2f88('0x21')]=function(_0x4f5fb2,_0xbc7456){if(_0x4f5fb2[_0x2f88('0x48')]['id']){delete _0x4f5fb2[_0x2f88('0x48')]['id'];}return db['VtigerConfiguration'][_0x2f88('0x46')]({'where':{'id':_0x4f5fb2[_0x2f88('0x43')]['id']}})['then'](handleEntityNotFound(_0xbc7456,null))[_0x2f88('0x3e')](saveUpdates(_0x4f5fb2[_0x2f88('0x48')],null))[_0x2f88('0x3e')](respondWithResult(_0xbc7456,null))[_0x2f88('0x42')](handleError(_0xbc7456,null));};exports[_0x2f88('0x49')]=function(_0x3de679,_0x6050ec){return db[_0x2f88('0x27')][_0x2f88('0x46')]({'where':{'id':_0x3de679['params']['id']}})[_0x2f88('0x3e')](handleEntityNotFound(_0x6050ec,null))[_0x2f88('0x3e')](removeEntity(_0x6050ec,null))[_0x2f88('0x42')](handleError(_0x6050ec,null));};exports['getFields']=function(_0x54899d,_0x40098f,_0x567736){var _0x182aa6={};var _0x1232b6={};var _0x5a3db6;var _0x2f524f;return db[_0x2f88('0x27')][_0x2f88('0x4a')]({'where':{'id':_0x54899d[_0x2f88('0x43')]['id']}})[_0x2f88('0x3e')](handleEntityNotFound(_0x40098f,null))[_0x2f88('0x3e')](function(_0x88164c){if(_0x88164c){_0x5a3db6=_0x88164c;_0x1232b6[_0x2f88('0x30')]=_['keys'](db[_0x2f88('0x4b')][_0x2f88('0x28')]);_0x1232b6[_0x2f88('0x2c')]=_['keys'](_0x54899d['query']);_0x1232b6[_0x2f88('0x2e')]=_[_0x2f88('0x2f')](_0x1232b6[_0x2f88('0x30')],_0x1232b6[_0x2f88('0x2c')]);_0x182aa6[_0x2f88('0x32')]=_[_0x2f88('0x2f')](_0x1232b6[_0x2f88('0x30')],qs[_0x2f88('0x31')](_0x54899d[_0x2f88('0x2c')]['fields']));_0x182aa6[_0x2f88('0x32')]=_0x182aa6[_0x2f88('0x32')][_0x2f88('0x33')]?_0x182aa6['attributes']:_0x1232b6['model'];_0x182aa6['order']=qs['sort'](_0x54899d[_0x2f88('0x2c')]['sort']);_0x182aa6[_0x2f88('0x39')]=qs[_0x2f88('0x2e')](_[_0x2f88('0x3a')](_0x54899d['query'],_0x1232b6['filters']));if(_0x54899d[_0x2f88('0x2c')][_0x2f88('0x3b')]){_0x182aa6['where']=_[_0x2f88('0x3d')](_0x182aa6[_0x2f88('0x39')],{'$or':_[_0x2f88('0x26')](_0x182aa6[_0x2f88('0x32')],function(_0x3929ac){var _0x416e28={};_0x416e28[_0x3929ac]={'$like':'%'+_0x54899d['query'][_0x2f88('0x3b')]+'%'};return _0x416e28;})});}_0x182aa6=_['merge']({},_0x182aa6,_0x54899d[_0x2f88('0x45')]);return _0x5a3db6[_0x2f88('0x4c')](_0x182aa6);}})['then'](function(_0x26f50d){if(_0x26f50d){_0x2f524f=_0x26f50d['length'];if(!_0x54899d[_0x2f88('0x2c')][_0x2f88('0x34')](_0x2f88('0x35'))){_0x182aa6[_0x2f88('0x36')]=qs[_0x2f88('0x36')](_0x54899d['query']['limit']);_0x182aa6[_0x2f88('0x1a')]=qs[_0x2f88('0x1a')](_0x54899d['query'][_0x2f88('0x1a')]);}return _0x5a3db6['getFields'](_0x182aa6);}})[_0x2f88('0x3e')](function(_0x7b14ed){if(_0x7b14ed){return _0x7b14ed?{'count':_0x2f524f,'rows':_0x7b14ed}:null;}})['then'](respondWithResult(_0x40098f,null))[_0x2f88('0x42')](handleError(_0x40098f,null));};exports['getSubjects']=function(_0x229956,_0x41f8fb,_0x348bb1){var _0x12ab83={};var _0x174078={};var _0x1e50f3;var _0x4c5dbe;return db[_0x2f88('0x27')][_0x2f88('0x4a')]({'where':{'id':_0x229956['params']['id']}})[_0x2f88('0x3e')](handleEntityNotFound(_0x41f8fb,null))['then'](function(_0x599b96){if(_0x599b96){_0x1e50f3=_0x599b96;_0x174078[_0x2f88('0x30')]=_[_0x2f88('0x2d')](db[_0x2f88('0x4b')][_0x2f88('0x28')]);_0x174078[_0x2f88('0x2c')]=_['keys'](_0x229956['query']);_0x174078[_0x2f88('0x2e')]=_[_0x2f88('0x2f')](_0x174078[_0x2f88('0x30')],_0x174078[_0x2f88('0x2c')]);_0x12ab83[_0x2f88('0x32')]=_[_0x2f88('0x2f')](_0x174078[_0x2f88('0x30')],qs[_0x2f88('0x31')](_0x229956['query'][_0x2f88('0x31')]));_0x12ab83[_0x2f88('0x32')]=_0x12ab83['attributes'][_0x2f88('0x33')]?_0x12ab83[_0x2f88('0x32')]:_0x174078[_0x2f88('0x30')];_0x12ab83[_0x2f88('0x37')]=qs[_0x2f88('0x38')](_0x229956['query']['sort']);_0x12ab83[_0x2f88('0x39')]=qs[_0x2f88('0x2e')](_[_0x2f88('0x3a')](_0x229956[_0x2f88('0x2c')],_0x174078[_0x2f88('0x2e')]));if(_0x229956[_0x2f88('0x2c')][_0x2f88('0x3b')]){_0x12ab83['where']=_[_0x2f88('0x3d')](_0x12ab83['where'],{'$or':_[_0x2f88('0x26')](_0x12ab83['attributes'],function(_0x2b0028){var _0x39dcb4={};_0x39dcb4[_0x2b0028]={'$like':'%'+_0x229956['query'][_0x2f88('0x3b')]+'%'};return _0x39dcb4;})});}_0x12ab83=_[_0x2f88('0x3d')]({},_0x12ab83,_0x229956['options']);return _0x1e50f3[_0x2f88('0x4d')](_0x12ab83);}})['then'](function(_0x5af8fe){if(_0x5af8fe){_0x4c5dbe=_0x5af8fe['length'];if(!_0x229956['query'][_0x2f88('0x34')](_0x2f88('0x35'))){_0x12ab83['limit']=qs[_0x2f88('0x36')](_0x229956[_0x2f88('0x2c')][_0x2f88('0x36')]);_0x12ab83[_0x2f88('0x1a')]=qs[_0x2f88('0x1a')](_0x229956['query'][_0x2f88('0x1a')]);}return _0x1e50f3[_0x2f88('0x4d')](_0x12ab83);}})[_0x2f88('0x3e')](function(_0x2c09f2){if(_0x2c09f2){return _0x2c09f2?{'count':_0x4c5dbe,'rows':_0x2c09f2}:null;}})[_0x2f88('0x3e')](respondWithResult(_0x41f8fb,null))[_0x2f88('0x42')](handleError(_0x41f8fb,null));};exports['getDescriptions']=function(_0x3ba079,_0xd63948,_0x2fef10){var _0x3dc54a={};var _0xc6565b={};var _0x358909;var _0x3a9d1e;return db[_0x2f88('0x27')][_0x2f88('0x4a')]({'where':{'id':_0x3ba079[_0x2f88('0x43')]['id']}})['then'](handleEntityNotFound(_0xd63948,null))[_0x2f88('0x3e')](function(_0x3eff84){if(_0x3eff84){_0x358909=_0x3eff84;_0xc6565b[_0x2f88('0x30')]=_[_0x2f88('0x2d')](db[_0x2f88('0x4b')][_0x2f88('0x28')]);_0xc6565b[_0x2f88('0x2c')]=_['keys'](_0x3ba079[_0x2f88('0x2c')]);_0xc6565b[_0x2f88('0x2e')]=_[_0x2f88('0x2f')](_0xc6565b[_0x2f88('0x30')],_0xc6565b[_0x2f88('0x2c')]);_0x3dc54a[_0x2f88('0x32')]=_['intersection'](_0xc6565b[_0x2f88('0x30')],qs[_0x2f88('0x31')](_0x3ba079[_0x2f88('0x2c')][_0x2f88('0x31')]));_0x3dc54a[_0x2f88('0x32')]=_0x3dc54a[_0x2f88('0x32')][_0x2f88('0x33')]?_0x3dc54a[_0x2f88('0x32')]:_0xc6565b[_0x2f88('0x30')];_0x3dc54a[_0x2f88('0x37')]=qs['sort'](_0x3ba079[_0x2f88('0x2c')]['sort']);_0x3dc54a['where']=qs[_0x2f88('0x2e')](_[_0x2f88('0x3a')](_0x3ba079[_0x2f88('0x2c')],_0xc6565b['filters']));if(_0x3ba079[_0x2f88('0x2c')][_0x2f88('0x3b')]){_0x3dc54a[_0x2f88('0x39')]=_['merge'](_0x3dc54a['where'],{'$or':_[_0x2f88('0x26')](_0x3dc54a[_0x2f88('0x32')],function(_0x4dfaea){var _0x4794b0={};_0x4794b0[_0x4dfaea]={'$like':'%'+_0x3ba079[_0x2f88('0x2c')][_0x2f88('0x3b')]+'%'};return _0x4794b0;})});}_0x3dc54a=_[_0x2f88('0x3d')]({},_0x3dc54a,_0x3ba079[_0x2f88('0x45')]);return _0x358909[_0x2f88('0x4e')](_0x3dc54a);}})['then'](function(_0x5f5971){if(_0x5f5971){_0x3a9d1e=_0x5f5971['length'];if(!_0x3ba079['query'][_0x2f88('0x34')](_0x2f88('0x35'))){_0x3dc54a[_0x2f88('0x36')]=qs[_0x2f88('0x36')](_0x3ba079[_0x2f88('0x2c')]['limit']);_0x3dc54a[_0x2f88('0x1a')]=qs[_0x2f88('0x1a')](_0x3ba079[_0x2f88('0x2c')][_0x2f88('0x1a')]);}return _0x358909['getDescriptions'](_0x3dc54a);}})[_0x2f88('0x3e')](function(_0x2de3f8){if(_0x2de3f8){return _0x2de3f8?{'count':_0x3a9d1e,'rows':_0x2de3f8}:null;}})[_0x2f88('0x3e')](respondWithResult(_0xd63948,null))[_0x2f88('0x42')](handleError(_0xd63948,null));};
\ No newline at end of file
index 734def3..23ac30e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3caa=['VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intVtigerConfiguration.attributes','exports','define'];(function(_0x1064fa,_0x430f95){var _0xa64b59=function(_0x3c2a6a){while(--_0x3c2a6a){_0x1064fa['push'](_0x1064fa['shift']());}};_0xa64b59(++_0x430f95);}(_0x3caa,0xb8));var _0xa3ca=function(_0x2f5628,_0x41200b){_0x2f5628=_0x2f5628-0x0;var _0x27501e=_0x3caa[_0x2f5628];return _0x27501e;};'use strict';var _=require(_0xa3ca('0x0'));var util=require(_0xa3ca('0x1'));var logger=require(_0xa3ca('0x2'))(_0xa3ca('0x3'));var moment=require('moment');var BPromise=require(_0xa3ca('0x4'));var rp=require(_0xa3ca('0x5'));var fs=require('fs');var path=require(_0xa3ca('0x6'));var rimraf=require(_0xa3ca('0x7'));var config=require('../../config/environment');var attributes=require(_0xa3ca('0x8'));module[_0xa3ca('0x9')]=function(_0x3ac903,_0x2bf83c){return _0x3ac903[_0xa3ca('0xa')](_0xa3ca('0xb'),attributes,{'tableName':_0xa3ca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x48be=['./intVtigerConfiguration.attributes','VtigerConfiguration','int_vtiger_configurations','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x1a2dd7,_0x326d5f){var _0x125505=function(_0x16c395){while(--_0x16c395){_0x1a2dd7['push'](_0x1a2dd7['shift']());}};_0x125505(++_0x326d5f);}(_0x48be,0xad));var _0xe48b=function(_0x41992b,_0x44d24d){_0x41992b=_0x41992b-0x0;var _0x345924=_0x48be[_0x41992b];return _0x345924;};'use strict';var _=require(_0xe48b('0x0'));var util=require(_0xe48b('0x1'));var logger=require('../../config/logger')(_0xe48b('0x2'));var moment=require(_0xe48b('0x3'));var BPromise=require(_0xe48b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe48b('0x5'));var rimraf=require(_0xe48b('0x6'));var config=require('../../config/environment');var attributes=require(_0xe48b('0x7'));module['exports']=function(_0x3e8f08,_0x200c33){return _0x3e8f08['define'](_0xe48b('0x8'),attributes,{'tableName':_0xe48b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 42860a2..10f8e66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5029=['stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4ec6c1,_0x13dc92){var _0x2aca61=function(_0x35bcd0){while(--_0x35bcd0){_0x4ec6c1['push'](_0x4ec6c1['shift']());}};_0x2aca61(++_0x13dc92);}(_0x5029,0x1d3));var _0x9502=function(_0x5cb63c,_0x5d5b1b){_0x5cb63c=_0x5cb63c-0x0;var _0x3f352a=_0x5029[_0x5cb63c];return _0x3f352a;};'use strict';var _=require(_0x9502('0x0'));var util=require(_0x9502('0x1'));var moment=require(_0x9502('0x2'));var BPromise=require(_0x9502('0x3'));var rs=require(_0x9502('0x4'));var fs=require('fs');var Redis=require(_0x9502('0x5'));var db=require(_0x9502('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9502('0x7'));var config=require('../../config/environment');var jayson=require(_0x9502('0x8'));var client=jayson['client'][_0x9502('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35279f,_0x27dc54,_0x36cfd6){return new BPromise(function(_0x41656a,_0x329106){return client[_0x9502('0xa')](_0x35279f,_0x36cfd6)[_0x9502('0xb')](function(_0x3ca0ed){logger[_0x9502('0xc')](_0x9502('0xd'),_0x27dc54,'request\x20sent');logger['debug'](_0x9502('0xe'),_0x27dc54,_0x9502('0xf'),JSON[_0x9502('0x10')](_0x3ca0ed));if(_0x3ca0ed[_0x9502('0x11')]){if(_0x3ca0ed[_0x9502('0x11')][_0x9502('0x12')]===0x1f4){logger[_0x9502('0x11')](_0x9502('0xd'),_0x27dc54,_0x3ca0ed[_0x9502('0x11')]['message']);return _0x329106(_0x3ca0ed['error'][_0x9502('0x13')]);}logger[_0x9502('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x27dc54,_0x3ca0ed[_0x9502('0x11')][_0x9502('0x13')]);return _0x41656a(_0x3ca0ed['error'][_0x9502('0x13')]);}else{logger[_0x9502('0xc')](_0x9502('0xd'),_0x27dc54,_0x9502('0xf'));_0x41656a(_0x3ca0ed['result']['message']);}})[_0x9502('0x14')](function(_0xab68d7){logger[_0x9502('0x11')](_0x9502('0xd'),_0x27dc54,_0xab68d7);_0x329106(_0xab68d7);});});}
\ No newline at end of file
+var _0xe7b7=['VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x2235a6,_0x5016a3){var _0x57110e=function(_0x2b6b96){while(--_0x2b6b96){_0x2235a6['push'](_0x2235a6['shift']());}};_0x57110e(++_0x5016a3);}(_0xe7b7,0xa3));var _0x7e7b=function(_0x5c7efd,_0x246064){_0x5c7efd=_0x5c7efd-0x0;var _0x17002f=_0xe7b7[_0x5c7efd];return _0x17002f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7e7b('0x0'));var BPromise=require(_0x7e7b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e7b('0x2'));var db=require(_0x7e7b('0x3'))['db'];var utils=require(_0x7e7b('0x4'));var logger=require(_0x7e7b('0x5'))(_0x7e7b('0x6'));var config=require(_0x7e7b('0x7'));var jayson=require(_0x7e7b('0x8'));var client=jayson['client'][_0x7e7b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c3eac,_0x1185e0,_0x2da28a){return new BPromise(function(_0x355d75,_0x18dccb){return client[_0x7e7b('0xa')](_0x5c3eac,_0x2da28a)[_0x7e7b('0xb')](function(_0x4421bf){logger[_0x7e7b('0xc')](_0x7e7b('0xd'),_0x1185e0,'request\x20sent');logger[_0x7e7b('0xe')](_0x7e7b('0xf'),_0x1185e0,'request\x20sent',JSON[_0x7e7b('0x10')](_0x4421bf));if(_0x4421bf[_0x7e7b('0x11')]){if(_0x4421bf[_0x7e7b('0x11')][_0x7e7b('0x12')]===0x1f4){logger[_0x7e7b('0x11')](_0x7e7b('0xd'),_0x1185e0,_0x4421bf['error'][_0x7e7b('0x13')]);return _0x18dccb(_0x4421bf['error'][_0x7e7b('0x13')]);}logger['error'](_0x7e7b('0xd'),_0x1185e0,_0x4421bf[_0x7e7b('0x11')]['message']);return _0x355d75(_0x4421bf[_0x7e7b('0x11')][_0x7e7b('0x13')]);}else{logger['info'](_0x7e7b('0xd'),_0x1185e0,_0x7e7b('0x14'));_0x355d75(_0x4421bf['result'][_0x7e7b('0x13')]);}})[_0x7e7b('0x15')](function(_0x1f8b33){logger[_0x7e7b('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x1185e0,_0x1f8b33);_0x18dccb(_0x1f8b33);});});}
\ No newline at end of file
index 6c0d4df..ebd9feb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5b0=['fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','util','path','express','Router'];(function(_0x1e6b92,_0x42240b){var _0x3a7118=function(_0x904e6b){while(--_0x904e6b){_0x1e6b92['push'](_0x1e6b92['shift']());}};_0x3a7118(++_0x42240b);}(_0xa5b0,0xfb));var _0x0a5b=function(_0x342465,_0x3aa51b){_0x342465=_0x342465-0x0;var _0x4a4da7=_0xa5b0[_0x342465];return _0x4a4da7;};'use strict';var multer=require('multer');var util=require(_0x0a5b('0x0'));var path=require(_0x0a5b('0x1'));var timeout=require('connect-timeout');var express=require(_0x0a5b('0x2'));var router=express[_0x0a5b('0x3')]();var fs_extra=require(_0x0a5b('0x4'));var auth=require(_0x0a5b('0x5'));var interaction=require(_0x0a5b('0x6'));var config=require('../../config/environment');var controller=require(_0x0a5b('0x7'));router[_0x0a5b('0x8')]('/',auth[_0x0a5b('0x9')](),controller[_0x0a5b('0xa')]);router[_0x0a5b('0x8')](_0x0a5b('0xb'),auth[_0x0a5b('0x9')](),controller[_0x0a5b('0xc')]);router['post']('/',auth[_0x0a5b('0x9')](),controller[_0x0a5b('0xd')]);router[_0x0a5b('0xe')](_0x0a5b('0xb'),auth[_0x0a5b('0x9')](),controller[_0x0a5b('0xf')]);router['delete'](_0x0a5b('0xb'),auth['isAuthenticated'](),controller[_0x0a5b('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x1e7b=['index','get','post','create','delete','/:id','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','isAuthenticated'];(function(_0x242152,_0x2f7b09){var _0x167a0d=function(_0x569821){while(--_0x569821){_0x242152['push'](_0x242152['shift']());}};_0x167a0d(++_0x2f7b09);}(_0x1e7b,0x1c7));var _0xb1e7=function(_0x7f816c,_0x25f12e){_0x7f816c=_0x7f816c-0x0;var _0x9106ca=_0x1e7b[_0x7f816c];return _0x9106ca;};'use strict';var multer=require(_0xb1e7('0x0'));var util=require('util');var path=require(_0xb1e7('0x1'));var timeout=require('connect-timeout');var express=require(_0xb1e7('0x2'));var router=express[_0xb1e7('0x3')]();var fs_extra=require(_0xb1e7('0x4'));var auth=require(_0xb1e7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router['get']('/',auth[_0xb1e7('0x6')](),controller[_0xb1e7('0x7')]);router[_0xb1e7('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb1e7('0x9')]('/',auth['isAuthenticated'](),controller[_0xb1e7('0xa')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb1e7('0xb')](_0xb1e7('0xc'),auth['isAuthenticated'](),controller[_0xb1e7('0xd')]);module['exports']=router;
\ No newline at end of file
index 7d4e500..7900b7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb496=['ENUM','string','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x336264,_0x32e1d9){var _0x53cf91=function(_0x21026c){while(--_0x21026c){_0x336264['push'](_0x336264['shift']());}};_0x53cf91(++_0x32e1d9);}(_0xb496,0x1a6));var _0x6b49=function(_0x546ce0,_0x9c66e7){_0x546ce0=_0x546ce0-0x0;var _0x9760e7=_0xb496[_0x546ce0];return _0x9760e7;};'use strict';var Sequelize=require(_0x6b49('0x0'));module[_0x6b49('0x1')]={'type':{'type':Sequelize[_0x6b49('0x2')](_0x6b49('0x3'),'variable',_0x6b49('0x4'),_0x6b49('0x5'),'picklist'),'defaultValue':_0x6b49('0x3')},'content':{'type':Sequelize[_0x6b49('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6b49('0x2')]('string','variable',_0x6b49('0x4'))},'keyContent':{'type':Sequelize[_0x6b49('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6b49('0x6')]},'customField':{'type':Sequelize[_0x6b49('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6b49('0x6')]}};
\ No newline at end of file
+var _0xee2b=['keyValue','picklist','STRING','BOOLEAN','exports','string','variable'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0xee2b,0xcf));var _0xbee2=function(_0x1600bc,_0x1da16b){_0x1600bc=_0x1600bc-0x0;var _0x3842ba=_0xee2b[_0x1600bc];return _0x3842ba;};'use strict';var Sequelize=require('sequelize');module[_0xbee2('0x0')]={'type':{'type':Sequelize['ENUM'](_0xbee2('0x1'),_0xbee2('0x2'),'customVariable',_0xbee2('0x3'),_0xbee2('0x4')),'defaultValue':_0xbee2('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xbee2('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xbee2('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xbee2('0x5')]},'customField':{'type':Sequelize[_0xbee2('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 70def40..14b0601 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x911f=['limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','findAll','catch','show','params','includeAll','include','find','create','body','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0x911f,0xbb));var _0xf911=function(_0x23b659,_0xc0d48e){_0x23b659=_0x23b659-0x0;var _0x47ef10=_0x911f[_0x23b659];return _0x47ef10;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf911('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf911('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf911('0x2'));var Mustache=require(_0xf911('0x3'));var util=require(_0xf911('0x4'));var path=require(_0xf911('0x5'));var sox=require('sox');var csv=require(_0xf911('0x6'));var ejs=require(_0xf911('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf911('0x8'));var squel=require(_0xf911('0x9'));var crypto=require(_0xf911('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf911('0x6'));var querystring=require('querystring');var Papa=require(_0xf911('0xb'));var Redis=require(_0xf911('0xc'));var authService=require(_0xf911('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xf911('0xe'));var hardwareService=require(_0xf911('0xf'));var logger=require('../../config/logger')(_0xf911('0x10'));var utils=require(_0xf911('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xf911('0x12'));var db=require(_0xf911('0x13'))['db'];function respondWithStatusCode(_0x18fc1a,_0x365a52){_0x365a52=_0x365a52||0xcc;return function(_0x518bd4){if(_0x518bd4){return _0x18fc1a[_0xf911('0x14')](_0x365a52);}return _0x18fc1a[_0xf911('0x15')](_0x365a52)['end']();};}function respondWithResult(_0x506459,_0x541e9e){_0x541e9e=_0x541e9e||0xc8;return function(_0x438885){if(_0x438885){return _0x506459[_0xf911('0x15')](_0x541e9e)[_0xf911('0x16')](_0x438885);}};}function respondWithFilteredResult(_0x20cd54,_0x15c40b){return function(_0x46a0c8){if(_0x46a0c8){var _0x47246d=typeof _0x15c40b['offset']==='undefined'&&typeof _0x15c40b[_0xf911('0x17')]===_0xf911('0x18');var _0x4938e7=_0x46a0c8[_0xf911('0x19')];var _0x36a14b=_0x47246d?0x0:_0x15c40b[_0xf911('0x1a')];var _0x1986f1=_0x47246d?_0x46a0c8['count']:_0x15c40b['offset']+_0x15c40b[_0xf911('0x17')];var _0x4b17b6;if(_0x1986f1>=_0x4938e7){_0x1986f1=_0x4938e7;_0x4b17b6=0xc8;}else{_0x4b17b6=0xce;}_0x20cd54[_0xf911('0x15')](_0x4b17b6);return _0x20cd54[_0xf911('0x1b')](_0xf911('0x1c'),_0x36a14b+'-'+_0x1986f1+'/'+_0x4938e7)['json'](_0x46a0c8);}return null;};}function patchUpdates(_0x34d426){return function(_0x2fa69d){try{jsonpatch[_0xf911('0x1d')](_0x2fa69d,_0x34d426,!![]);}catch(_0xf65992){return BPromise[_0xf911('0x1e')](_0xf65992);}return _0x2fa69d['save']();};}function saveUpdates(_0x221c95,_0x35b96b){return function(_0x569d52){if(_0x569d52){return _0x569d52[_0xf911('0x1f')](_0x221c95)[_0xf911('0x20')](function(_0x1cdf56){return _0x1cdf56;});}return null;};}function removeEntity(_0x2995fa,_0x428cd9){return function(_0x1bb1d9){if(_0x1bb1d9){return _0x1bb1d9[_0xf911('0x21')]()[_0xf911('0x20')](function(){_0x2995fa[_0xf911('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32ccc8,_0x58f9b6){return function(_0x171fde){if(!_0x171fde){_0x32ccc8[_0xf911('0x14')](0x194);}return _0x171fde;};}function handleError(_0x42a71d,_0x6e508f){_0x6e508f=_0x6e508f||0x1f4;return function(_0x3ef3ed){logger['error'](_0x3ef3ed[_0xf911('0x22')]);if(_0x3ef3ed[_0xf911('0x23')]){delete _0x3ef3ed[_0xf911('0x23')];}_0x42a71d[_0xf911('0x15')](_0x6e508f)[_0xf911('0x24')](_0x3ef3ed);};}exports[_0xf911('0x25')]=function(_0x531c4f,_0x375227){var _0x2df113={},_0x27078f={},_0x2cf284={'count':0x0,'rows':[]};var _0x23983a=_[_0xf911('0x26')](db[_0xf911('0x27')][_0xf911('0x28')],function(_0x283680){return{'name':_0x283680[_0xf911('0x29')],'type':_0x283680[_0xf911('0x2a')][_0xf911('0x2b')]};});_0x27078f['model']=_['map'](_0x23983a,_0xf911('0x23'));_0x27078f[_0xf911('0x2c')]=_[_0xf911('0x2d')](_0x531c4f[_0xf911('0x2c')]);_0x27078f['filters']=_[_0xf911('0x2e')](_0x27078f[_0xf911('0x2f')],_0x27078f['query']);_0x2df113[_0xf911('0x30')]=_['intersection'](_0x27078f[_0xf911('0x2f')],qs[_0xf911('0x31')](_0x531c4f['query'][_0xf911('0x31')]));_0x2df113['attributes']=_0x2df113[_0xf911('0x30')][_0xf911('0x32')]?_0x2df113[_0xf911('0x30')]:_0x27078f[_0xf911('0x2f')];if(!_0x531c4f[_0xf911('0x2c')]['hasOwnProperty'](_0xf911('0x33'))){_0x2df113[_0xf911('0x17')]=qs[_0xf911('0x17')](_0x531c4f['query']['limit']);_0x2df113['offset']=qs['offset'](_0x531c4f[_0xf911('0x2c')][_0xf911('0x1a')]);}_0x2df113[_0xf911('0x34')]=qs[_0xf911('0x35')](_0x531c4f[_0xf911('0x2c')][_0xf911('0x35')]);_0x2df113[_0xf911('0x36')]=qs[_0xf911('0x37')](_[_0xf911('0x38')](_0x531c4f[_0xf911('0x2c')],_0x27078f[_0xf911('0x37')]),_0x23983a);if(_0x531c4f['query']['filter']){_0x2df113[_0xf911('0x36')]=_[_0xf911('0x39')](_0x2df113['where'],{'$or':_['map'](_0x23983a,function(_0x12e786){if(_0x12e786[_0xf911('0x2a')]!==_0xf911('0x3a')){var _0x1a638d={};_0x1a638d[_0x12e786['name']]={'$like':'%'+_0x531c4f[_0xf911('0x2c')][_0xf911('0x3b')]+'%'};return _0x1a638d;}})});}_0x2df113=_['merge']({},_0x2df113,_0x531c4f[_0xf911('0x3c')]);var _0x5ea240={'where':_0x2df113[_0xf911('0x36')]};return db[_0xf911('0x27')]['count'](_0x5ea240)['then'](function(_0x158fdd){_0x2cf284[_0xf911('0x19')]=_0x158fdd;if(_0x531c4f['query']['includeAll']){_0x2df113['include']=[{'all':!![]}];}return db[_0xf911('0x27')][_0xf911('0x3d')](_0x2df113);})[_0xf911('0x20')](function(_0x130b43){_0x2cf284['rows']=_0x130b43;return _0x2cf284;})[_0xf911('0x20')](respondWithFilteredResult(_0x375227,_0x2df113))[_0xf911('0x3e')](handleError(_0x375227,null));};exports[_0xf911('0x3f')]=function(_0x3d34a2,_0x5590ac){var _0x50860f={'raw':!![],'where':{'id':_0x3d34a2[_0xf911('0x40')]['id']}},_0x167cf0={};_0x167cf0[_0xf911('0x2f')]=_[_0xf911('0x2d')](db[_0xf911('0x27')]['rawAttributes']);_0x167cf0[_0xf911('0x2c')]=_[_0xf911('0x2d')](_0x3d34a2['query']);_0x167cf0[_0xf911('0x37')]=_[_0xf911('0x2e')](_0x167cf0[_0xf911('0x2f')],_0x167cf0['query']);_0x50860f['attributes']=_[_0xf911('0x2e')](_0x167cf0[_0xf911('0x2f')],qs[_0xf911('0x31')](_0x3d34a2[_0xf911('0x2c')][_0xf911('0x31')]));_0x50860f[_0xf911('0x30')]=_0x50860f[_0xf911('0x30')][_0xf911('0x32')]?_0x50860f[_0xf911('0x30')]:_0x167cf0[_0xf911('0x2f')];if(_0x3d34a2[_0xf911('0x2c')][_0xf911('0x41')]){_0x50860f[_0xf911('0x42')]=[{'all':!![]}];}_0x50860f=_['merge']({},_0x50860f,_0x3d34a2[_0xf911('0x3c')]);return db[_0xf911('0x27')][_0xf911('0x43')](_0x50860f)['then'](handleEntityNotFound(_0x5590ac,null))['then'](respondWithResult(_0x5590ac,null))[_0xf911('0x3e')](handleError(_0x5590ac,null));};exports[_0xf911('0x44')]=function(_0x30dd9d,_0x5f0fba){return db[_0xf911('0x27')][_0xf911('0x44')](_0x30dd9d[_0xf911('0x45')],{})[_0xf911('0x20')](respondWithResult(_0x5f0fba,0xc9))[_0xf911('0x3e')](handleError(_0x5f0fba,null));};exports['update']=function(_0x13cf93,_0xd983e0){if(_0x13cf93['body']['id']){delete _0x13cf93['body']['id'];}return db[_0xf911('0x27')]['find']({'where':{'id':_0x13cf93['params']['id']}})[_0xf911('0x20')](handleEntityNotFound(_0xd983e0,null))[_0xf911('0x20')](saveUpdates(_0x13cf93[_0xf911('0x45')],null))[_0xf911('0x20')](respondWithResult(_0xd983e0,null))['catch'](handleError(_0xd983e0,null));};exports[_0xf911('0x21')]=function(_0x43e49d,_0x1c9ce6){return db['VtigerField'][_0xf911('0x43')]({'where':{'id':_0x43e49d['params']['id']}})[_0xf911('0x20')](handleEntityNotFound(_0x1c9ce6,null))['then'](removeEntity(_0x1c9ce6,null))[_0xf911('0x3e')](handleError(_0x1c9ce6,null));};
\ No newline at end of file
+var _0xa56d=['filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','params','attributes','merge','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','stack','name','index','map','VtigerField','rawAttributes','fieldName','type','model','query','keys'];(function(_0x1d0e52,_0x22e44f){var _0x5dec08=function(_0x2dacc4){while(--_0x2dacc4){_0x1d0e52['push'](_0x1d0e52['shift']());}};_0x5dec08(++_0x22e44f);}(_0xa56d,0x1e0));var _0xda56=function(_0x1fa22b,_0x3ab9c0){_0x1fa22b=_0x1fa22b-0x0;var _0x50c4d7=_0xa56d[_0x1fa22b];return _0x50c4d7;};'use strict';var emlformat=require(_0xda56('0x0'));var rimraf=require(_0xda56('0x1'));var zipdir=require(_0xda56('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda56('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xda56('0x4'));var util=require(_0xda56('0x5'));var path=require(_0xda56('0x6'));var sox=require(_0xda56('0x7'));var csv=require(_0xda56('0x8'));var ejs=require(_0xda56('0x9'));var fs=require('fs');var fs_extra=require(_0xda56('0xa'));var _=require(_0xda56('0xb'));var squel=require(_0xda56('0xc'));var crypto=require('crypto');var jsforce=require(_0xda56('0xd'));var deskjs=require(_0xda56('0xe'));var toCsv=require(_0xda56('0x8'));var querystring=require(_0xda56('0xf'));var Papa=require(_0xda56('0x10'));var Redis=require(_0xda56('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xda56('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda56('0x13'));var logger=require(_0xda56('0x14'))(_0xda56('0x15'));var utils=require(_0xda56('0x16'));var config=require(_0xda56('0x17'));var licenseUtil=require(_0xda56('0x18'));var db=require(_0xda56('0x19'))['db'];function respondWithStatusCode(_0x393f0b,_0x4df8b7){_0x4df8b7=_0x4df8b7||0xcc;return function(_0x2823d2){if(_0x2823d2){return _0x393f0b[_0xda56('0x1a')](_0x4df8b7);}return _0x393f0b[_0xda56('0x1b')](_0x4df8b7)[_0xda56('0x1c')]();};}function respondWithResult(_0x311546,_0x5645cd){_0x5645cd=_0x5645cd||0xc8;return function(_0x3c47bd){if(_0x3c47bd){return _0x311546[_0xda56('0x1b')](_0x5645cd)[_0xda56('0x1d')](_0x3c47bd);}};}function respondWithFilteredResult(_0x39aa82,_0x3d7454){return function(_0x30a379){if(_0x30a379){var _0x1019e1=typeof _0x3d7454[_0xda56('0x1e')]==='undefined'&&typeof _0x3d7454['limit']===_0xda56('0x1f');var _0x420e22=_0x30a379[_0xda56('0x20')];var _0x4726a5=_0x1019e1?0x0:_0x3d7454[_0xda56('0x1e')];var _0xe7c6f8=_0x1019e1?_0x30a379[_0xda56('0x20')]:_0x3d7454[_0xda56('0x1e')]+_0x3d7454[_0xda56('0x21')];var _0x3dbb08;if(_0xe7c6f8>=_0x420e22){_0xe7c6f8=_0x420e22;_0x3dbb08=0xc8;}else{_0x3dbb08=0xce;}_0x39aa82[_0xda56('0x1b')](_0x3dbb08);return _0x39aa82[_0xda56('0x22')](_0xda56('0x23'),_0x4726a5+'-'+_0xe7c6f8+'/'+_0x420e22)[_0xda56('0x1d')](_0x30a379);}return null;};}function patchUpdates(_0x54e576){return function(_0x36eda8){try{jsonpatch[_0xda56('0x24')](_0x36eda8,_0x54e576,!![]);}catch(_0x1aff93){return BPromise[_0xda56('0x25')](_0x1aff93);}return _0x36eda8['save']();};}function saveUpdates(_0x4292d4,_0x3237c5){return function(_0x2dfc2e){if(_0x2dfc2e){return _0x2dfc2e[_0xda56('0x26')](_0x4292d4)['then'](function(_0x5c3f1e){return _0x5c3f1e;});}return null;};}function removeEntity(_0x4a3ea5,_0x13de4a){return function(_0x1669e2){if(_0x1669e2){return _0x1669e2[_0xda56('0x27')]()[_0xda56('0x28')](function(){_0x4a3ea5[_0xda56('0x1b')](0xcc)[_0xda56('0x1c')]();});}};}function handleEntityNotFound(_0x4670fd,_0x538783){return function(_0x1a6694){if(!_0x1a6694){_0x4670fd['sendStatus'](0x194);}return _0x1a6694;};}function handleError(_0x2a4150,_0x3755f2){_0x3755f2=_0x3755f2||0x1f4;return function(_0x1c45d8){logger['error'](_0x1c45d8[_0xda56('0x29')]);if(_0x1c45d8[_0xda56('0x2a')]){delete _0x1c45d8[_0xda56('0x2a')];}_0x2a4150[_0xda56('0x1b')](_0x3755f2)['send'](_0x1c45d8);};}exports[_0xda56('0x2b')]=function(_0x13b914,_0x5dc8f4){var _0x229927={},_0x2545bf={},_0x4cbf3c={'count':0x0,'rows':[]};var _0x111d60=_[_0xda56('0x2c')](db[_0xda56('0x2d')][_0xda56('0x2e')],function(_0x120df4){return{'name':_0x120df4[_0xda56('0x2f')],'type':_0x120df4[_0xda56('0x30')]['key']};});_0x2545bf[_0xda56('0x31')]=_[_0xda56('0x2c')](_0x111d60,_0xda56('0x2a'));_0x2545bf[_0xda56('0x32')]=_[_0xda56('0x33')](_0x13b914[_0xda56('0x32')]);_0x2545bf[_0xda56('0x34')]=_[_0xda56('0x35')](_0x2545bf[_0xda56('0x31')],_0x2545bf[_0xda56('0x32')]);_0x229927['attributes']=_[_0xda56('0x35')](_0x2545bf[_0xda56('0x31')],qs[_0xda56('0x36')](_0x13b914['query'][_0xda56('0x36')]));_0x229927['attributes']=_0x229927['attributes'][_0xda56('0x37')]?_0x229927['attributes']:_0x2545bf[_0xda56('0x31')];if(!_0x13b914[_0xda56('0x32')][_0xda56('0x38')](_0xda56('0x39'))){_0x229927[_0xda56('0x21')]=qs[_0xda56('0x21')](_0x13b914['query'][_0xda56('0x21')]);_0x229927[_0xda56('0x1e')]=qs[_0xda56('0x1e')](_0x13b914[_0xda56('0x32')][_0xda56('0x1e')]);}_0x229927[_0xda56('0x3a')]=qs['sort'](_0x13b914[_0xda56('0x32')][_0xda56('0x3b')]);_0x229927['where']=qs[_0xda56('0x34')](_[_0xda56('0x3c')](_0x13b914[_0xda56('0x32')],_0x2545bf[_0xda56('0x34')]),_0x111d60);if(_0x13b914[_0xda56('0x32')][_0xda56('0x3d')]){_0x229927[_0xda56('0x3e')]=_['merge'](_0x229927['where'],{'$or':_[_0xda56('0x2c')](_0x111d60,function(_0x3a15b1){if(_0x3a15b1[_0xda56('0x30')]!==_0xda56('0x3f')){var _0x16faae={};_0x16faae[_0x3a15b1[_0xda56('0x2a')]]={'$like':'%'+_0x13b914[_0xda56('0x32')]['filter']+'%'};return _0x16faae;}})});}_0x229927=_['merge']({},_0x229927,_0x13b914[_0xda56('0x40')]);var _0x3cf30f={'where':_0x229927[_0xda56('0x3e')]};return db[_0xda56('0x2d')]['count'](_0x3cf30f)[_0xda56('0x28')](function(_0x509bcb){_0x4cbf3c[_0xda56('0x20')]=_0x509bcb;if(_0x13b914[_0xda56('0x32')][_0xda56('0x41')]){_0x229927[_0xda56('0x42')]=[{'all':!![]}];}return db[_0xda56('0x2d')][_0xda56('0x43')](_0x229927);})[_0xda56('0x28')](function(_0x43c231){_0x4cbf3c[_0xda56('0x44')]=_0x43c231;return _0x4cbf3c;})['then'](respondWithFilteredResult(_0x5dc8f4,_0x229927))['catch'](handleError(_0x5dc8f4,null));};exports['show']=function(_0xa1faca,_0x37a1a3){var _0x10b70b={'raw':!![],'where':{'id':_0xa1faca[_0xda56('0x45')]['id']}},_0x4ae0c5={};_0x4ae0c5[_0xda56('0x31')]=_[_0xda56('0x33')](db[_0xda56('0x2d')][_0xda56('0x2e')]);_0x4ae0c5['query']=_[_0xda56('0x33')](_0xa1faca[_0xda56('0x32')]);_0x4ae0c5[_0xda56('0x34')]=_['intersection'](_0x4ae0c5[_0xda56('0x31')],_0x4ae0c5[_0xda56('0x32')]);_0x10b70b[_0xda56('0x46')]=_[_0xda56('0x35')](_0x4ae0c5[_0xda56('0x31')],qs['fields'](_0xa1faca[_0xda56('0x32')][_0xda56('0x36')]));_0x10b70b[_0xda56('0x46')]=_0x10b70b[_0xda56('0x46')][_0xda56('0x37')]?_0x10b70b['attributes']:_0x4ae0c5[_0xda56('0x31')];if(_0xa1faca['query'][_0xda56('0x41')]){_0x10b70b[_0xda56('0x42')]=[{'all':!![]}];}_0x10b70b=_[_0xda56('0x47')]({},_0x10b70b,_0xa1faca[_0xda56('0x40')]);return db[_0xda56('0x2d')][_0xda56('0x48')](_0x10b70b)['then'](handleEntityNotFound(_0x37a1a3,null))[_0xda56('0x28')](respondWithResult(_0x37a1a3,null))[_0xda56('0x49')](handleError(_0x37a1a3,null));};exports['create']=function(_0x211537,_0x24a79c){return db['VtigerField'][_0xda56('0x4a')](_0x211537['body'],{})['then'](respondWithResult(_0x24a79c,0xc9))[_0xda56('0x49')](handleError(_0x24a79c,null));};exports[_0xda56('0x26')]=function(_0x39354b,_0x574fd8){if(_0x39354b['body']['id']){delete _0x39354b['body']['id'];}return db[_0xda56('0x2d')]['find']({'where':{'id':_0x39354b['params']['id']}})[_0xda56('0x28')](handleEntityNotFound(_0x574fd8,null))['then'](saveUpdates(_0x39354b[_0xda56('0x4b')],null))[_0xda56('0x28')](respondWithResult(_0x574fd8,null))['catch'](handleError(_0x574fd8,null));};exports[_0xda56('0x27')]=function(_0x4ebb5b,_0x5e2eb1){return db[_0xda56('0x2d')][_0xda56('0x48')]({'where':{'id':_0x4ebb5b[_0xda56('0x45')]['id']}})[_0xda56('0x28')](handleEntityNotFound(_0x5e2eb1,null))['then'](removeEntity(_0x5e2eb1,null))[_0xda56('0x49')](handleError(_0x5e2eb1,null));};
\ No newline at end of file
index 3ad0bd5..12991cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02d3=['./intVtigerField.attributes','define','int_vtiger_fields','vtiger_unique_index','FieldId','lodash','util','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x02d3,0xd1));var _0x302d=function(_0x48bab4,_0x8a65bb){_0x48bab4=_0x48bab4-0x0;var _0x3e1ee8=_0x02d3[_0x48bab4];return _0x3e1ee8;};'use strict';var _=require(_0x302d('0x0'));var util=require(_0x302d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x302d('0x2'));var BPromise=require(_0x302d('0x3'));var rp=require(_0x302d('0x4'));var fs=require('fs');var path=require(_0x302d('0x5'));var rimraf=require('rimraf');var config=require(_0x302d('0x6'));var attributes=require(_0x302d('0x7'));module['exports']=function(_0x37d689,_0xe3fe32){return _0x37d689[_0x302d('0x8')]('VtigerField',attributes,{'tableName':_0x302d('0x9'),'paranoid':![],'indexes':[{'name':_0x302d('0xa'),'fields':['idField',_0x302d('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9968=['define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports'];(function(_0x15b399,_0x59db1a){var _0x199f2d=function(_0x3bd31c){while(--_0x3bd31c){_0x15b399['push'](_0x15b399['shift']());}};_0x199f2d(++_0x59db1a);}(_0x9968,0x76));var _0x8996=function(_0x37e1b9,_0x1de4f3){_0x37e1b9=_0x37e1b9-0x0;var _0x236b5f=_0x9968[_0x37e1b9];return _0x236b5f;};'use strict';var _=require(_0x8996('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8996('0x1'));var moment=require(_0x8996('0x2'));var BPromise=require(_0x8996('0x3'));var rp=require(_0x8996('0x4'));var fs=require('fs');var path=require(_0x8996('0x5'));var rimraf=require(_0x8996('0x6'));var config=require(_0x8996('0x7'));var attributes=require(_0x8996('0x8'));module[_0x8996('0x9')]=function(_0x233a2f,_0x1400f6){return _0x233a2f[_0x8996('0xa')](_0x8996('0xb'),attributes,{'tableName':_0x8996('0xc'),'paranoid':![],'indexes':[{'name':_0x8996('0xd'),'fields':[_0x8996('0xe'),_0x8996('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index e06159a..9043405 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0c5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','VtigerField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','randomstring'];(function(_0x3f4315,_0xd6ec89){var _0x5842e3=function(_0x4b12f5){while(--_0x4b12f5){_0x3f4315['push'](_0x3f4315['shift']());}};_0x5842e3(++_0xd6ec89);}(_0xb0c5,0xfa));var _0x5b0c=function(_0x2b7523,_0x2c7858){_0x2b7523=_0x2b7523-0x0;var _0x2e2621=_0xb0c5[_0x2b7523];return _0x2e2621;};'use strict';var _=require(_0x5b0c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5b0c('0x1'));var fs=require('fs');var Redis=require(_0x5b0c('0x2'));var db=require(_0x5b0c('0x3'))['db'];var utils=require(_0x5b0c('0x4'));var logger=require(_0x5b0c('0x5'))(_0x5b0c('0x6'));var config=require(_0x5b0c('0x7'));var jayson=require(_0x5b0c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b84a2,_0x294cf9,_0x28ea40){return new BPromise(function(_0x5162f8,_0x282a90){return client['request'](_0x5b84a2,_0x28ea40)[_0x5b0c('0x9')](function(_0x139649){logger['info'](_0x5b0c('0xa'),_0x294cf9,_0x5b0c('0xb'));logger['debug']('VtigerField,\x20%s,\x20%s,\x20%s',_0x294cf9,_0x5b0c('0xb'),JSON[_0x5b0c('0xc')](_0x139649));if(_0x139649[_0x5b0c('0xd')]){if(_0x139649[_0x5b0c('0xd')][_0x5b0c('0xe')]===0x1f4){logger[_0x5b0c('0xd')](_0x5b0c('0xa'),_0x294cf9,_0x139649[_0x5b0c('0xd')][_0x5b0c('0xf')]);return _0x282a90(_0x139649['error'][_0x5b0c('0xf')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x294cf9,_0x139649[_0x5b0c('0xd')]['message']);return _0x5162f8(_0x139649[_0x5b0c('0xd')][_0x5b0c('0xf')]);}else{logger['info'](_0x5b0c('0xa'),_0x294cf9,_0x5b0c('0xb'));_0x5162f8(_0x139649[_0x5b0c('0x10')][_0x5b0c('0xf')]);}})[_0x5b0c('0x11')](function(_0x2bf76){logger[_0x5b0c('0xd')]('VtigerField,\x20%s,\x20%s',_0x294cf9,_0x2bf76);_0x282a90(_0x2bf76);});});}
\ No newline at end of file
+var _0xff78=['VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x223d34,_0x3e5231){var _0x2a32eb=function(_0xbf7aa){while(--_0xbf7aa){_0x223d34['push'](_0x223d34['shift']());}};_0x2a32eb(++_0x3e5231);}(_0xff78,0xb1));var _0x8ff7=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0xff78[_0x45fc6a];return _0x14bcfd;};'use strict';var _=require(_0x8ff7('0x0'));var util=require('util');var moment=require(_0x8ff7('0x1'));var BPromise=require(_0x8ff7('0x2'));var rs=require(_0x8ff7('0x3'));var fs=require('fs');var Redis=require(_0x8ff7('0x4'));var db=require(_0x8ff7('0x5'))['db'];var utils=require(_0x8ff7('0x6'));var logger=require(_0x8ff7('0x7'))(_0x8ff7('0x8'));var config=require(_0x8ff7('0x9'));var jayson=require(_0x8ff7('0xa'));var client=jayson[_0x8ff7('0xb')][_0x8ff7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd2e8b2,_0x11e8bb,_0x1c58cf){return new BPromise(function(_0x53c4f3,_0x5497bb){return client[_0x8ff7('0xd')](_0xd2e8b2,_0x1c58cf)[_0x8ff7('0xe')](function(_0x40b7d1){logger['info'](_0x8ff7('0xf'),_0x11e8bb,_0x8ff7('0x10'));logger[_0x8ff7('0x11')](_0x8ff7('0x12'),_0x11e8bb,_0x8ff7('0x10'),JSON[_0x8ff7('0x13')](_0x40b7d1));if(_0x40b7d1[_0x8ff7('0x14')]){if(_0x40b7d1['error'][_0x8ff7('0x15')]===0x1f4){logger[_0x8ff7('0x14')](_0x8ff7('0xf'),_0x11e8bb,_0x40b7d1['error'][_0x8ff7('0x16')]);return _0x5497bb(_0x40b7d1['error'][_0x8ff7('0x16')]);}logger['error'](_0x8ff7('0xf'),_0x11e8bb,_0x40b7d1['error'][_0x8ff7('0x16')]);return _0x53c4f3(_0x40b7d1[_0x8ff7('0x14')][_0x8ff7('0x16')]);}else{logger['info'](_0x8ff7('0xf'),_0x11e8bb,_0x8ff7('0x10'));_0x53c4f3(_0x40b7d1[_0x8ff7('0x17')][_0x8ff7('0x16')]);}})['catch'](function(_0x47002a){logger[_0x8ff7('0x14')](_0x8ff7('0xf'),_0x11e8bb,_0x47002a);_0x5497bb(_0x47002a);});});}
\ No newline at end of file
index 21cbfc4..8cb5b45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0cd=['getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show'];(function(_0x35db43,_0x2b8c08){var _0x590d4f=function(_0x5d7108){while(--_0x5d7108){_0x35db43['push'](_0x35db43['shift']());}};_0x590d4f(++_0x2b8c08);}(_0xe0cd,0x12b));var _0xde0c=function(_0x3ddd35,_0x4e7404){_0x3ddd35=_0x3ddd35-0x0;var _0x472b4f=_0xe0cd[_0x3ddd35];return _0x472b4f;};'use strict';var multer=require(_0xde0c('0x0'));var util=require(_0xde0c('0x1'));var path=require(_0xde0c('0x2'));var timeout=require(_0xde0c('0x3'));var express=require(_0xde0c('0x4'));var router=express[_0xde0c('0x5')]();var fs_extra=require(_0xde0c('0x6'));var auth=require(_0xde0c('0x7'));var interaction=require(_0xde0c('0x8'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0xde0c('0x9')]('/',auth[_0xde0c('0xa')](),controller['index']);router['get'](_0xde0c('0xb'),auth[_0xde0c('0xa')](),controller[_0xde0c('0xc')]);router['get']('/:id/configurations',auth[_0xde0c('0xa')](),controller[_0xde0c('0xd')]);router[_0xde0c('0x9')](_0xde0c('0xe'),auth[_0xde0c('0xa')](),controller[_0xde0c('0xf')]);router[_0xde0c('0x10')]('/',auth[_0xde0c('0xa')](),controller[_0xde0c('0x11')]);router[_0xde0c('0x10')](_0xde0c('0x12'),auth[_0xde0c('0xa')](),controller[_0xde0c('0x13')]);router[_0xde0c('0x14')](_0xde0c('0xb'),auth[_0xde0c('0xa')](),controller[_0xde0c('0x15')]);router[_0xde0c('0x16')](_0xde0c('0xb'),auth[_0xde0c('0xa')](),controller[_0xde0c('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xf562=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','getFields','create','addConfiguration','update'];(function(_0x3878f6,_0x536ff5){var _0x481b61=function(_0x1e2994){while(--_0x1e2994){_0x3878f6['push'](_0x3878f6['shift']());}};_0x481b61(++_0x536ff5);}(_0xf562,0x100));var _0x2f56=function(_0x533fdd,_0x18de2b){_0x533fdd=_0x533fdd-0x0;var _0x22606e=_0xf562[_0x533fdd];return _0x22606e;};'use strict';var multer=require(_0x2f56('0x0'));var util=require(_0x2f56('0x1'));var path=require(_0x2f56('0x2'));var timeout=require(_0x2f56('0x3'));var express=require(_0x2f56('0x4'));var router=express[_0x2f56('0x5')]();var fs_extra=require(_0x2f56('0x6'));var auth=require(_0x2f56('0x7'));var interaction=require(_0x2f56('0x8'));var config=require('../../config/environment');var controller=require(_0x2f56('0x9'));router['get']('/',auth[_0x2f56('0xa')](),controller['index']);router[_0x2f56('0xb')](_0x2f56('0xc'),auth[_0x2f56('0xa')](),controller[_0x2f56('0xd')]);router[_0x2f56('0xb')](_0x2f56('0xe'),auth[_0x2f56('0xa')](),controller[_0x2f56('0xf')]);router[_0x2f56('0xb')]('/:id/fields',auth[_0x2f56('0xa')](),controller[_0x2f56('0x10')]);router['post']('/',auth[_0x2f56('0xa')](),controller[_0x2f56('0x11')]);router['post'](_0x2f56('0xe'),auth['isAuthenticated'](),controller[_0x2f56('0x12')]);router['put'](_0x2f56('0xc'),auth[_0x2f56('0xa')](),controller[_0x2f56('0x13')]);router[_0x2f56('0x14')](_0x2f56('0xc'),auth[_0x2f56('0xa')](),controller[_0x2f56('0x15')]);module[_0x2f56('0x16')]=router;
\ No newline at end of file
index 1b32283..0e3721e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc359=['remoteUri','password','integrationTab','newTab','exports','STRING','username'];(function(_0x3a7f93,_0x5d15ca){var _0x50c097=function(_0x58da1a){while(--_0x58da1a){_0x3a7f93['push'](_0x3a7f93['shift']());}};_0x50c097(++_0x5d15ca);}(_0xc359,0x1d9));var _0x9c35=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0xc359[_0x18f152];return _0xa10b34;};'use strict';var Sequelize=require('sequelize');module[_0x9c35('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9c35('0x1')]},'username':{'type':Sequelize[_0x9c35('0x1')],'unique':_0x9c35('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x9c35('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x9c35('0x3')},'authType':{'type':Sequelize['ENUM'](_0x9c35('0x4'),'token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x9c35('0x5'),_0x9c35('0x6')),'defaultValue':_0x9c35('0x5')}};
\ No newline at end of file
+var _0x41ec=['integrationTab','exports','STRING','remoteUri','ENUM','password','token'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x41ec,0x143));var _0xc41e=function(_0x2b7a8e,_0x23d477){_0x2b7a8e=_0x2b7a8e-0x0;var _0x21e0c1=_0x41ec[_0x2b7a8e];return _0x21e0c1;};'use strict';var Sequelize=require('sequelize');module[_0xc41e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc41e('0x1')]},'username':{'type':Sequelize[_0xc41e('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xc41e('0x1')]},'token':{'type':Sequelize[_0xc41e('0x1')]},'remoteUri':{'type':Sequelize[_0xc41e('0x1')],'unique':_0xc41e('0x2')},'authType':{'type':Sequelize[_0xc41e('0x3')](_0xc41e('0x4'),_0xc41e('0x5')),'defaultValue':_0xc41e('0x4')},'serverUrl':{'type':Sequelize[_0xc41e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc41e('0x3')](_0xc41e('0x6'),'newTab'),'defaultValue':_0xc41e('0x6')}};
\ No newline at end of file
index cd14b18..aa44fa5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58a4=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ZendeskAccount','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','getConfigurations','findOne','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','password','token','remoteUri','slice','substring','lastIndexOf','format','authType','headers','Basic\x20%s','%s:%s','username','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','stack','name','send','map','type'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x58a4,0xbf));var _0x458a=function(_0x16fa8d,_0x3a1ca5){_0x16fa8d=_0x16fa8d-0x0;var _0x1948d8=_0x58a4[_0x16fa8d];return _0x1948d8;};'use strict';var emlformat=require(_0x458a('0x0'));var rimraf=require(_0x458a('0x1'));var zipdir=require(_0x458a('0x2'));var jsonpatch=require(_0x458a('0x3'));var rp=require(_0x458a('0x4'));var moment=require(_0x458a('0x5'));var BPromise=require(_0x458a('0x6'));var Mustache=require(_0x458a('0x7'));var util=require(_0x458a('0x8'));var path=require(_0x458a('0x9'));var sox=require(_0x458a('0xa'));var csv=require(_0x458a('0xb'));var ejs=require(_0x458a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x458a('0xd'));var crypto=require(_0x458a('0xe'));var jsforce=require(_0x458a('0xf'));var deskjs=require(_0x458a('0x10'));var toCsv=require(_0x458a('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x458a('0x11'));var authService=require(_0x458a('0x12'));var qs=require(_0x458a('0x13'));var as=require(_0x458a('0x14'));var hardwareService=require(_0x458a('0x15'));var logger=require('../../config/logger')(_0x458a('0x16'));var utils=require(_0x458a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x458a('0x18'));var db=require(_0x458a('0x19'))['db'];var integrations=require(_0x458a('0x1a'));function respondWithStatusCode(_0x2a4934,_0x2e788b){_0x2e788b=_0x2e788b||0xcc;return function(_0x5bd09e){if(_0x5bd09e){return _0x2a4934['sendStatus'](_0x2e788b);}return _0x2a4934[_0x458a('0x1b')](_0x2e788b)['end']();};}function respondWithResult(_0x2c7528,_0x44f683){_0x44f683=_0x44f683||0xc8;return function(_0x10133b){if(_0x10133b){return _0x2c7528[_0x458a('0x1b')](_0x44f683)[_0x458a('0x1c')](_0x10133b);}};}function respondWithFilteredResult(_0x29acee,_0x507b0f){return function(_0x4b26be){if(_0x4b26be){var _0x5c7993=typeof _0x507b0f[_0x458a('0x1d')]===_0x458a('0x1e')&&typeof _0x507b0f[_0x458a('0x1f')]==='undefined';var _0x310569=_0x4b26be[_0x458a('0x20')];var _0x18504d=_0x5c7993?0x0:_0x507b0f[_0x458a('0x1d')];var _0xa91473=_0x5c7993?_0x4b26be['count']:_0x507b0f['offset']+_0x507b0f[_0x458a('0x1f')];var _0x4d07a7;if(_0xa91473>=_0x310569){_0xa91473=_0x310569;_0x4d07a7=0xc8;}else{_0x4d07a7=0xce;}_0x29acee[_0x458a('0x1b')](_0x4d07a7);return _0x29acee[_0x458a('0x21')]('Content-Range',_0x18504d+'-'+_0xa91473+'/'+_0x310569)[_0x458a('0x1c')](_0x4b26be);}return null;};}function patchUpdates(_0x55a588){return function(_0x200213){try{jsonpatch[_0x458a('0x22')](_0x200213,_0x55a588,!![]);}catch(_0x59f44c){return BPromise[_0x458a('0x23')](_0x59f44c);}return _0x200213[_0x458a('0x24')]();};}function saveUpdates(_0x5a2bcb,_0xa6b8ff){return function(_0x5ad95a){if(_0x5ad95a){return _0x5ad95a[_0x458a('0x25')](_0x5a2bcb)['then'](function(_0x4080fc){return _0x4080fc;});}return null;};}function removeEntity(_0x5dfc6c,_0x36b08e){return function(_0x911eaf){if(_0x911eaf){return _0x911eaf[_0x458a('0x26')]()[_0x458a('0x27')](function(){_0x5dfc6c[_0x458a('0x1b')](0xcc)[_0x458a('0x28')]();});}};}function handleEntityNotFound(_0x340375,_0x3012c7){return function(_0x1f2d0){if(!_0x1f2d0){_0x340375[_0x458a('0x29')](0x194);}return _0x1f2d0;};}function handleError(_0x52efed,_0x327fcb){_0x327fcb=_0x327fcb||0x1f4;return function(_0x21ec38){logger['error'](_0x21ec38[_0x458a('0x2a')]);if(_0x21ec38[_0x458a('0x2b')]){delete _0x21ec38['name'];}_0x52efed['status'](_0x327fcb)[_0x458a('0x2c')](_0x21ec38);};}exports['index']=function(_0x33c5d8,_0x29f9b5){var _0x223f73={},_0x4a49e4={},_0xa6fdf={'count':0x0,'rows':[]};var _0x2531f7=_[_0x458a('0x2d')](db['ZendeskAccount']['rawAttributes'],function(_0x18c890){return{'name':_0x18c890['fieldName'],'type':_0x18c890[_0x458a('0x2e')]['key']};});_0x4a49e4[_0x458a('0x2f')]=_[_0x458a('0x2d')](_0x2531f7,'name');_0x4a49e4[_0x458a('0x30')]=_[_0x458a('0x31')](_0x33c5d8[_0x458a('0x30')]);_0x4a49e4['filters']=_[_0x458a('0x32')](_0x4a49e4[_0x458a('0x2f')],_0x4a49e4[_0x458a('0x30')]);_0x223f73[_0x458a('0x33')]=_[_0x458a('0x32')](_0x4a49e4['model'],qs[_0x458a('0x34')](_0x33c5d8[_0x458a('0x30')][_0x458a('0x34')]));_0x223f73[_0x458a('0x33')]=_0x223f73[_0x458a('0x33')][_0x458a('0x35')]?_0x223f73['attributes']:_0x4a49e4[_0x458a('0x2f')];if(!_0x33c5d8[_0x458a('0x30')][_0x458a('0x36')](_0x458a('0x37'))){_0x223f73[_0x458a('0x1f')]=qs[_0x458a('0x1f')](_0x33c5d8[_0x458a('0x30')][_0x458a('0x1f')]);_0x223f73[_0x458a('0x1d')]=qs['offset'](_0x33c5d8[_0x458a('0x30')][_0x458a('0x1d')]);}_0x223f73[_0x458a('0x38')]=qs[_0x458a('0x39')](_0x33c5d8[_0x458a('0x30')][_0x458a('0x39')]);_0x223f73[_0x458a('0x3a')]=qs[_0x458a('0x3b')](_[_0x458a('0x3c')](_0x33c5d8[_0x458a('0x30')],_0x4a49e4[_0x458a('0x3b')]),_0x2531f7);if(_0x33c5d8[_0x458a('0x30')][_0x458a('0x3d')]){_0x223f73[_0x458a('0x3a')]=_[_0x458a('0x3e')](_0x223f73['where'],{'$or':_[_0x458a('0x2d')](_0x2531f7,function(_0x397a41){if(_0x397a41[_0x458a('0x2e')]!==_0x458a('0x3f')){var _0x3c5840={};_0x3c5840[_0x397a41[_0x458a('0x2b')]]={'$like':'%'+_0x33c5d8[_0x458a('0x30')][_0x458a('0x3d')]+'%'};return _0x3c5840;}})});}_0x223f73=_[_0x458a('0x3e')]({},_0x223f73,_0x33c5d8[_0x458a('0x40')]);var _0x20cf10={'where':_0x223f73['where']};return db[_0x458a('0x41')][_0x458a('0x20')](_0x20cf10)['then'](function(_0x430bda){_0xa6fdf[_0x458a('0x20')]=_0x430bda;if(_0x33c5d8[_0x458a('0x30')]['includeAll']){_0x223f73[_0x458a('0x42')]=[{'all':!![]}];}return db[_0x458a('0x41')][_0x458a('0x43')](_0x223f73);})[_0x458a('0x27')](function(_0xbcd632){_0xa6fdf[_0x458a('0x44')]=_0xbcd632;return _0xa6fdf;})[_0x458a('0x27')](respondWithFilteredResult(_0x29f9b5,_0x223f73))[_0x458a('0x45')](handleError(_0x29f9b5,null));};exports['show']=function(_0x296385,_0x145e3c){var _0x2b9030={'raw':![],'where':{'id':_0x296385[_0x458a('0x46')]['id']}},_0x5180ae={};_0x5180ae[_0x458a('0x2f')]=_['keys'](db[_0x458a('0x41')][_0x458a('0x47')]);_0x5180ae[_0x458a('0x30')]=_[_0x458a('0x31')](_0x296385[_0x458a('0x30')]);_0x5180ae['filters']=_['intersection'](_0x5180ae[_0x458a('0x2f')],_0x5180ae[_0x458a('0x30')]);_0x2b9030[_0x458a('0x33')]=_[_0x458a('0x32')](_0x5180ae['model'],qs[_0x458a('0x34')](_0x296385[_0x458a('0x30')]['fields']));_0x2b9030[_0x458a('0x33')]=_0x2b9030['attributes'][_0x458a('0x35')]?_0x2b9030[_0x458a('0x33')]:_0x5180ae[_0x458a('0x2f')];if(_0x296385['query'][_0x458a('0x48')]){_0x2b9030[_0x458a('0x42')]=[{'all':!![]}];}_0x2b9030=_[_0x458a('0x3e')]({},_0x2b9030,_0x296385['options']);return db['ZendeskAccount'][_0x458a('0x49')](_0x2b9030)[_0x458a('0x27')](handleEntityNotFound(_0x145e3c,null))[_0x458a('0x27')](respondWithResult(_0x145e3c,null))['catch'](handleError(_0x145e3c,null));};exports['create']=function(_0x3a7005,_0xf362b5){return db[_0x458a('0x41')][_0x458a('0x4a')](_0x3a7005[_0x458a('0x4b')],{})[_0x458a('0x27')](respondWithResult(_0xf362b5,0xc9))[_0x458a('0x45')](handleError(_0xf362b5,null));};exports[_0x458a('0x25')]=function(_0xb22232,_0x213f86){if(_0xb22232[_0x458a('0x4b')]['id']){delete _0xb22232[_0x458a('0x4b')]['id'];}return db[_0x458a('0x41')][_0x458a('0x49')]({'where':{'id':_0xb22232[_0x458a('0x46')]['id']}})[_0x458a('0x27')](handleEntityNotFound(_0x213f86,null))['then'](saveUpdates(_0xb22232[_0x458a('0x4b')],null))[_0x458a('0x27')](respondWithResult(_0x213f86,null))[_0x458a('0x45')](handleError(_0x213f86,null));};exports[_0x458a('0x26')]=function(_0x44670a,_0x5630cf){return db['ZendeskAccount']['find']({'where':{'id':_0x44670a[_0x458a('0x46')]['id']}})['then'](handleEntityNotFound(_0x5630cf,null))[_0x458a('0x27')](removeEntity(_0x5630cf,null))[_0x458a('0x45')](handleError(_0x5630cf,null));};exports[_0x458a('0x4c')]=function(_0x649553,_0xfa6e65,_0x5f0151){var _0x48f68e={};var _0x3d7616={};var _0x2d8b77;var _0x2587a1;return db[_0x458a('0x41')][_0x458a('0x4d')]({'where':{'id':_0x649553['params']['id']}})[_0x458a('0x27')](handleEntityNotFound(_0xfa6e65,null))['then'](function(_0xa51e28){if(_0xa51e28){_0x2d8b77=_0xa51e28;_0x3d7616['model']=_[_0x458a('0x31')](db['ZendeskConfiguration']['rawAttributes']);_0x3d7616['query']=_[_0x458a('0x31')](_0x649553[_0x458a('0x30')]);_0x3d7616['filters']=_[_0x458a('0x32')](_0x3d7616[_0x458a('0x2f')],_0x3d7616[_0x458a('0x30')]);_0x48f68e['attributes']=_[_0x458a('0x32')](_0x3d7616[_0x458a('0x2f')],qs[_0x458a('0x34')](_0x649553[_0x458a('0x30')][_0x458a('0x34')]));_0x48f68e[_0x458a('0x33')]=_0x48f68e['attributes'][_0x458a('0x35')]?_0x48f68e[_0x458a('0x33')]:_0x3d7616[_0x458a('0x2f')];_0x48f68e[_0x458a('0x38')]=qs[_0x458a('0x39')](_0x649553[_0x458a('0x30')][_0x458a('0x39')]);_0x48f68e[_0x458a('0x3a')]=qs['filters'](_[_0x458a('0x3c')](_0x649553['query'],_0x3d7616[_0x458a('0x3b')]));if(_0x649553[_0x458a('0x30')][_0x458a('0x3d')]){_0x48f68e[_0x458a('0x3a')]=_['merge'](_0x48f68e['where'],{'$or':_[_0x458a('0x2d')](_0x48f68e[_0x458a('0x33')],function(_0x2b9aac){var _0x156a22={};_0x156a22[_0x2b9aac]={'$like':'%'+_0x649553[_0x458a('0x30')][_0x458a('0x3d')]+'%'};return _0x156a22;})});}_0x48f68e=_['merge']({},_0x48f68e,_0x649553[_0x458a('0x40')]);return _0x2d8b77[_0x458a('0x4c')](_0x48f68e);}})['then'](function(_0x18d83a){if(_0x18d83a){_0x2587a1=_0x18d83a['length'];if(!_0x649553[_0x458a('0x30')][_0x458a('0x36')](_0x458a('0x37'))){_0x48f68e[_0x458a('0x1f')]=qs[_0x458a('0x1f')](_0x649553[_0x458a('0x30')][_0x458a('0x1f')]);_0x48f68e[_0x458a('0x1d')]=qs['offset'](_0x649553[_0x458a('0x30')][_0x458a('0x1d')]);}return _0x2d8b77['getConfigurations'](_0x48f68e);}})[_0x458a('0x27')](function(_0x3da617){if(_0x3da617){return _0x3da617?{'count':_0x2587a1,'rows':_0x3da617}:null;}})['then'](respondWithResult(_0xfa6e65,null))[_0x458a('0x45')](handleError(_0xfa6e65,null));};exports[_0x458a('0x4e')]=function(_0x47cbcf,_0x17b611,_0x180df0){if(_0x47cbcf['body']['id']){delete _0x47cbcf[_0x458a('0x4b')]['id'];}return db[_0x458a('0x41')][_0x458a('0x4d')]({'where':{'id':_0x47cbcf[_0x458a('0x46')]['id']}})[_0x458a('0x27')](handleEntityNotFound(_0x17b611,null))[_0x458a('0x27')](function(_0x4199a7){if(_0x4199a7){_0x47cbcf[_0x458a('0x4b')]['AccountId']=_0x4199a7['id'];_0x47cbcf[_0x458a('0x4b')][_0x458a('0x4f')]=integrations[_0x458a('0x50')](_0x47cbcf[_0x458a('0x4b')][_0x458a('0x51')],_0x47cbcf[_0x458a('0x4b')][_0x458a('0x2e')]);_0x47cbcf[_0x458a('0x4b')][_0x458a('0x52')]=integrations[_0x458a('0x53')](_0x47cbcf['body'][_0x458a('0x51')],_0x47cbcf['body'][_0x458a('0x2e')]);return db[_0x458a('0x54')][_0x458a('0x4a')](_0x47cbcf[_0x458a('0x4b')],{'include':[{'model':db[_0x458a('0x55')],'as':_0x458a('0x4f')},{'model':db[_0x458a('0x55')],'as':_0x458a('0x52')}]});}return null;})[_0x458a('0x27')](respondWithResult(_0x17b611,null))[_0x458a('0x45')](handleError(_0x17b611,null));};exports[_0x458a('0x56')]=function(_0x448cbc,_0x11bbba,_0x435884){var _0x3948aa='';return db[_0x458a('0x41')]['findOne']({'where':{'id':_0x448cbc[_0x458a('0x46')]['id']},'attributes':['id','username',_0x458a('0x57'),_0x458a('0x58'),'authType',_0x458a('0x59')]})[_0x458a('0x27')](handleEntityNotFound(_0x11bbba,null))[_0x458a('0x27')](function(_0x494710){if(_0x494710){_0x3948aa=_0x494710[_0x458a('0x59')];var _0xed002=_0x3948aa[_0x458a('0x5a')](-0x1);if(_0xed002==='/'){_0x3948aa=_0x3948aa[_0x458a('0x5b')](0x0,_0x3948aa[_0x458a('0x5c')](_0xed002));}var _0x42f213={'method':'GET','uri':util[_0x458a('0x5d')]('%s/%s',_0x3948aa,'ticket_fields'),'json':!![]};switch(_0x494710[_0x458a('0x5e')]){case _0x458a('0x57'):_0x42f213[_0x458a('0x5f')]={'Authorization':util[_0x458a('0x5d')](_0x458a('0x60'),new Buffer(util[_0x458a('0x5d')](_0x458a('0x61'),_0x494710[_0x458a('0x62')],_0x494710[_0x458a('0x57')]))[_0x458a('0x63')](_0x458a('0x64')))};break;case _0x458a('0x58'):_0x42f213[_0x458a('0x5f')]={'Authorization':util[_0x458a('0x5d')]('Basic\x20%s',new Buffer(util['format']('%s/token:%s',_0x494710[_0x458a('0x62')],_0x494710['token']))[_0x458a('0x63')](_0x458a('0x64')))};break;default:throw new db[(_0x458a('0x65'))][(_0x458a('0x66'))](_0x458a('0x67'));}return rp(_0x42f213);}})[_0x458a('0x27')](function(_0x46df7c){if(_0x46df7c){var _0x49f3ee=[_0x458a('0x68'),_0x458a('0x69'),'group',_0x458a('0x6a')];_['remove'](_0x46df7c[_0x458a('0x6b')],function(_0x58d29d){return _0x49f3ee[_0x458a('0x6c')](_0x58d29d[_0x458a('0x2e')]);});return{'count':_0x46df7c[_0x458a('0x6b')][_0x458a('0x35')],'rows':_['map'](_0x46df7c[_0x458a('0x6b')],function(_0x14b95e){return{'id':_0x14b95e['id'],'name':_0x14b95e[_0x458a('0x6d')]>0x7?_0x14b95e[_0x458a('0x6e')]:_0x14b95e[_0x458a('0x2e')],'custom':_0x14b95e[_0x458a('0x6d')]>0x7?!![]:![],'options':_0x14b95e[_0x458a('0x6f')]?_0x14b95e[_0x458a('0x6f')]:_0x14b95e['custom_field_options']?_0x14b95e[_0x458a('0x70')]:[]};})};}})[_0x458a('0x27')](respondWithResult(_0x11bbba,null))[_0x458a('0x45')](function(_0x4212af){var _0x591dbb=_0x448cbc[_0x458a('0x30')][_0x458a('0x71')]?0x1f4:_0x4212af['statusCode']||0x1f4;logger[_0x458a('0x72')](_0x458a('0x73'),_0x458a('0x56'),_0x591dbb,JSON[_0x458a('0x74')](_0x4212af));delete _0x4212af[_0x458a('0x2b')];if(_0x591dbb===0x191){_0x591dbb=0x190;}_0x11bbba['status'](_0x591dbb)[_0x458a('0x2c')](_0x448cbc[_0x458a('0x30')][_0x458a('0x71')]?{'message':_0x458a('0x75'),'statusCode':_0x4212af[_0x458a('0x76')]}:_0x4212af);});};
\ No newline at end of file
+var _0x7af2=['pick','VIRTUAL','filter','merge','options','includeAll','findAll','params','rawAttributes','include','catch','create','body','find','getConfigurations','findOne','ZendeskConfiguration','length','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','base64','%s/token:%s','Unknown\x20authentication\x20type','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','ZendeskAccount','fieldName','type','key','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters'];(function(_0x22f51c,_0xca9b6e){var _0x475190=function(_0x2c91bd){while(--_0x2c91bd){_0x22f51c['push'](_0x22f51c['shift']());}};_0x475190(++_0xca9b6e);}(_0x7af2,0x119));var _0x27af=function(_0x5a4666,_0x1d496a){_0x5a4666=_0x5a4666-0x0;var _0x54638c=_0x7af2[_0x5a4666];return _0x54638c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27af('0x0'));var zipdir=require(_0x27af('0x1'));var jsonpatch=require(_0x27af('0x2'));var rp=require(_0x27af('0x3'));var moment=require('moment');var BPromise=require(_0x27af('0x4'));var Mustache=require(_0x27af('0x5'));var util=require(_0x27af('0x6'));var path=require(_0x27af('0x7'));var sox=require(_0x27af('0x8'));var csv=require(_0x27af('0x9'));var ejs=require(_0x27af('0xa'));var fs=require('fs');var fs_extra=require(_0x27af('0xb'));var _=require(_0x27af('0xc'));var squel=require('squel');var crypto=require(_0x27af('0xd'));var jsforce=require(_0x27af('0xe'));var deskjs=require(_0x27af('0xf'));var toCsv=require('to-csv');var querystring=require(_0x27af('0x10'));var Papa=require(_0x27af('0x11'));var Redis=require(_0x27af('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x27af('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x27af('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x27af('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x27af('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x406340,_0x203501){_0x203501=_0x203501||0xcc;return function(_0x1fd964){if(_0x1fd964){return _0x406340[_0x27af('0x17')](_0x203501);}return _0x406340[_0x27af('0x18')](_0x203501)[_0x27af('0x19')]();};}function respondWithResult(_0x234825,_0x3da435){_0x3da435=_0x3da435||0xc8;return function(_0x423222){if(_0x423222){return _0x234825[_0x27af('0x18')](_0x3da435)[_0x27af('0x1a')](_0x423222);}};}function respondWithFilteredResult(_0x9c2d4b,_0x2d7800){return function(_0x3102c4){if(_0x3102c4){var _0x2bfc9=typeof _0x2d7800[_0x27af('0x1b')]===_0x27af('0x1c')&&typeof _0x2d7800[_0x27af('0x1d')]==='undefined';var _0x315661=_0x3102c4[_0x27af('0x1e')];var _0x5997ae=_0x2bfc9?0x0:_0x2d7800['offset'];var _0x20a6d7=_0x2bfc9?_0x3102c4[_0x27af('0x1e')]:_0x2d7800[_0x27af('0x1b')]+_0x2d7800[_0x27af('0x1d')];var _0xec699a;if(_0x20a6d7>=_0x315661){_0x20a6d7=_0x315661;_0xec699a=0xc8;}else{_0xec699a=0xce;}_0x9c2d4b['status'](_0xec699a);return _0x9c2d4b[_0x27af('0x1f')](_0x27af('0x20'),_0x5997ae+'-'+_0x20a6d7+'/'+_0x315661)[_0x27af('0x1a')](_0x3102c4);}return null;};}function patchUpdates(_0x5e7c19){return function(_0x19afb1){try{jsonpatch[_0x27af('0x21')](_0x19afb1,_0x5e7c19,!![]);}catch(_0x2ae47e){return BPromise['reject'](_0x2ae47e);}return _0x19afb1[_0x27af('0x22')]();};}function saveUpdates(_0x2460f4,_0x30720b){return function(_0x2af76d){if(_0x2af76d){return _0x2af76d[_0x27af('0x23')](_0x2460f4)[_0x27af('0x24')](function(_0x43dd9e){return _0x43dd9e;});}return null;};}function removeEntity(_0x35b36d,_0x2e1bb0){return function(_0x49780b){if(_0x49780b){return _0x49780b['destroy']()['then'](function(){_0x35b36d[_0x27af('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12625c,_0x396326){return function(_0x4ba49f){if(!_0x4ba49f){_0x12625c[_0x27af('0x17')](0x194);}return _0x4ba49f;};}function handleError(_0x1d9341,_0x463e36){_0x463e36=_0x463e36||0x1f4;return function(_0x424490){logger[_0x27af('0x25')](_0x424490[_0x27af('0x26')]);if(_0x424490[_0x27af('0x27')]){delete _0x424490['name'];}_0x1d9341[_0x27af('0x18')](_0x463e36)[_0x27af('0x28')](_0x424490);};}exports[_0x27af('0x29')]=function(_0xe009a,_0x25d65a){var _0xa08dd9={},_0x42a5b7={},_0x2b26ac={'count':0x0,'rows':[]};var _0x4406e2=_[_0x27af('0x2a')](db[_0x27af('0x2b')]['rawAttributes'],function(_0x15e867){return{'name':_0x15e867[_0x27af('0x2c')],'type':_0x15e867[_0x27af('0x2d')][_0x27af('0x2e')]};});_0x42a5b7[_0x27af('0x2f')]=_[_0x27af('0x2a')](_0x4406e2,'name');_0x42a5b7['query']=_[_0x27af('0x30')](_0xe009a[_0x27af('0x31')]);_0x42a5b7['filters']=_[_0x27af('0x32')](_0x42a5b7[_0x27af('0x2f')],_0x42a5b7[_0x27af('0x31')]);_0xa08dd9[_0x27af('0x33')]=_[_0x27af('0x32')](_0x42a5b7[_0x27af('0x2f')],qs[_0x27af('0x34')](_0xe009a[_0x27af('0x31')][_0x27af('0x34')]));_0xa08dd9[_0x27af('0x33')]=_0xa08dd9[_0x27af('0x33')]['length']?_0xa08dd9['attributes']:_0x42a5b7[_0x27af('0x2f')];if(!_0xe009a[_0x27af('0x31')]['hasOwnProperty'](_0x27af('0x35'))){_0xa08dd9[_0x27af('0x1d')]=qs['limit'](_0xe009a[_0x27af('0x31')][_0x27af('0x1d')]);_0xa08dd9[_0x27af('0x1b')]=qs[_0x27af('0x1b')](_0xe009a[_0x27af('0x31')]['offset']);}_0xa08dd9[_0x27af('0x36')]=qs[_0x27af('0x37')](_0xe009a['query']['sort']);_0xa08dd9[_0x27af('0x38')]=qs[_0x27af('0x39')](_[_0x27af('0x3a')](_0xe009a[_0x27af('0x31')],_0x42a5b7[_0x27af('0x39')]),_0x4406e2);if(_0xe009a[_0x27af('0x31')]['filter']){_0xa08dd9[_0x27af('0x38')]=_['merge'](_0xa08dd9[_0x27af('0x38')],{'$or':_[_0x27af('0x2a')](_0x4406e2,function(_0x2a6b14){if(_0x2a6b14[_0x27af('0x2d')]!==_0x27af('0x3b')){var _0x5f5504={};_0x5f5504[_0x2a6b14[_0x27af('0x27')]]={'$like':'%'+_0xe009a[_0x27af('0x31')][_0x27af('0x3c')]+'%'};return _0x5f5504;}})});}_0xa08dd9=_[_0x27af('0x3d')]({},_0xa08dd9,_0xe009a[_0x27af('0x3e')]);var _0x32b558={'where':_0xa08dd9[_0x27af('0x38')]};return db[_0x27af('0x2b')][_0x27af('0x1e')](_0x32b558)[_0x27af('0x24')](function(_0xda424e){_0x2b26ac[_0x27af('0x1e')]=_0xda424e;if(_0xe009a[_0x27af('0x31')][_0x27af('0x3f')]){_0xa08dd9['include']=[{'all':!![]}];}return db[_0x27af('0x2b')][_0x27af('0x40')](_0xa08dd9);})[_0x27af('0x24')](function(_0x373c05){_0x2b26ac['rows']=_0x373c05;return _0x2b26ac;})[_0x27af('0x24')](respondWithFilteredResult(_0x25d65a,_0xa08dd9))['catch'](handleError(_0x25d65a,null));};exports['show']=function(_0x2425dd,_0x3c9c81){var _0x279f99={'raw':![],'where':{'id':_0x2425dd[_0x27af('0x41')]['id']}},_0x17efd6={};_0x17efd6[_0x27af('0x2f')]=_[_0x27af('0x30')](db[_0x27af('0x2b')][_0x27af('0x42')]);_0x17efd6[_0x27af('0x31')]=_[_0x27af('0x30')](_0x2425dd[_0x27af('0x31')]);_0x17efd6['filters']=_[_0x27af('0x32')](_0x17efd6[_0x27af('0x2f')],_0x17efd6['query']);_0x279f99['attributes']=_[_0x27af('0x32')](_0x17efd6[_0x27af('0x2f')],qs[_0x27af('0x34')](_0x2425dd[_0x27af('0x31')][_0x27af('0x34')]));_0x279f99['attributes']=_0x279f99[_0x27af('0x33')]['length']?_0x279f99[_0x27af('0x33')]:_0x17efd6[_0x27af('0x2f')];if(_0x2425dd[_0x27af('0x31')][_0x27af('0x3f')]){_0x279f99[_0x27af('0x43')]=[{'all':!![]}];}_0x279f99=_[_0x27af('0x3d')]({},_0x279f99,_0x2425dd[_0x27af('0x3e')]);return db['ZendeskAccount']['find'](_0x279f99)[_0x27af('0x24')](handleEntityNotFound(_0x3c9c81,null))['then'](respondWithResult(_0x3c9c81,null))[_0x27af('0x44')](handleError(_0x3c9c81,null));};exports[_0x27af('0x45')]=function(_0x226025,_0x389962){return db[_0x27af('0x2b')][_0x27af('0x45')](_0x226025[_0x27af('0x46')],{})['then'](respondWithResult(_0x389962,0xc9))[_0x27af('0x44')](handleError(_0x389962,null));};exports[_0x27af('0x23')]=function(_0x20e180,_0x3fdc0e){if(_0x20e180[_0x27af('0x46')]['id']){delete _0x20e180['body']['id'];}return db[_0x27af('0x2b')][_0x27af('0x47')]({'where':{'id':_0x20e180[_0x27af('0x41')]['id']}})['then'](handleEntityNotFound(_0x3fdc0e,null))['then'](saveUpdates(_0x20e180[_0x27af('0x46')],null))[_0x27af('0x24')](respondWithResult(_0x3fdc0e,null))[_0x27af('0x44')](handleError(_0x3fdc0e,null));};exports['destroy']=function(_0x495794,_0x2fad23){return db['ZendeskAccount'][_0x27af('0x47')]({'where':{'id':_0x495794[_0x27af('0x41')]['id']}})[_0x27af('0x24')](handleEntityNotFound(_0x2fad23,null))[_0x27af('0x24')](removeEntity(_0x2fad23,null))[_0x27af('0x44')](handleError(_0x2fad23,null));};exports[_0x27af('0x48')]=function(_0x123533,_0x374794,_0x1b6d94){var _0x24d8bf={};var _0x23369a={};var _0x5c02c1;var _0x76ed78;return db[_0x27af('0x2b')][_0x27af('0x49')]({'where':{'id':_0x123533[_0x27af('0x41')]['id']}})[_0x27af('0x24')](handleEntityNotFound(_0x374794,null))[_0x27af('0x24')](function(_0x20c155){if(_0x20c155){_0x5c02c1=_0x20c155;_0x23369a[_0x27af('0x2f')]=_['keys'](db[_0x27af('0x4a')]['rawAttributes']);_0x23369a[_0x27af('0x31')]=_[_0x27af('0x30')](_0x123533[_0x27af('0x31')]);_0x23369a['filters']=_[_0x27af('0x32')](_0x23369a['model'],_0x23369a[_0x27af('0x31')]);_0x24d8bf[_0x27af('0x33')]=_[_0x27af('0x32')](_0x23369a['model'],qs[_0x27af('0x34')](_0x123533['query'][_0x27af('0x34')]));_0x24d8bf['attributes']=_0x24d8bf[_0x27af('0x33')][_0x27af('0x4b')]?_0x24d8bf[_0x27af('0x33')]:_0x23369a['model'];_0x24d8bf['order']=qs[_0x27af('0x37')](_0x123533[_0x27af('0x31')][_0x27af('0x37')]);_0x24d8bf[_0x27af('0x38')]=qs['filters'](_[_0x27af('0x3a')](_0x123533[_0x27af('0x31')],_0x23369a[_0x27af('0x39')]));if(_0x123533[_0x27af('0x31')][_0x27af('0x3c')]){_0x24d8bf[_0x27af('0x38')]=_['merge'](_0x24d8bf[_0x27af('0x38')],{'$or':_[_0x27af('0x2a')](_0x24d8bf[_0x27af('0x33')],function(_0x2401c7){var _0x49eb46={};_0x49eb46[_0x2401c7]={'$like':'%'+_0x123533[_0x27af('0x31')]['filter']+'%'};return _0x49eb46;})});}_0x24d8bf=_[_0x27af('0x3d')]({},_0x24d8bf,_0x123533[_0x27af('0x3e')]);return _0x5c02c1['getConfigurations'](_0x24d8bf);}})[_0x27af('0x24')](function(_0x13a5a8){if(_0x13a5a8){_0x76ed78=_0x13a5a8['length'];if(!_0x123533['query'][_0x27af('0x4c')](_0x27af('0x35'))){_0x24d8bf[_0x27af('0x1d')]=qs['limit'](_0x123533[_0x27af('0x31')][_0x27af('0x1d')]);_0x24d8bf['offset']=qs[_0x27af('0x1b')](_0x123533[_0x27af('0x31')]['offset']);}return _0x5c02c1['getConfigurations'](_0x24d8bf);}})[_0x27af('0x24')](function(_0x1fa50b){if(_0x1fa50b){return _0x1fa50b?{'count':_0x76ed78,'rows':_0x1fa50b}:null;}})['then'](respondWithResult(_0x374794,null))['catch'](handleError(_0x374794,null));};exports[_0x27af('0x4d')]=function(_0xf97695,_0x2a8534,_0x266220){if(_0xf97695[_0x27af('0x46')]['id']){delete _0xf97695[_0x27af('0x46')]['id'];}return db[_0x27af('0x2b')]['findOne']({'where':{'id':_0xf97695['params']['id']}})[_0x27af('0x24')](handleEntityNotFound(_0x2a8534,null))[_0x27af('0x24')](function(_0xa692f6){if(_0xa692f6){_0xf97695[_0x27af('0x46')][_0x27af('0x4e')]=_0xa692f6['id'];_0xf97695[_0x27af('0x46')][_0x27af('0x4f')]=integrations[_0x27af('0x50')](_0xf97695[_0x27af('0x46')][_0x27af('0x51')],_0xf97695[_0x27af('0x46')][_0x27af('0x2d')]);_0xf97695[_0x27af('0x46')][_0x27af('0x52')]=integrations[_0x27af('0x53')](_0xf97695[_0x27af('0x46')][_0x27af('0x51')],_0xf97695['body'][_0x27af('0x2d')]);return db[_0x27af('0x4a')]['create'](_0xf97695[_0x27af('0x46')],{'include':[{'model':db[_0x27af('0x54')],'as':_0x27af('0x4f')},{'model':db[_0x27af('0x54')],'as':_0x27af('0x52')}]});}return null;})[_0x27af('0x24')](respondWithResult(_0x2a8534,null))['catch'](handleError(_0x2a8534,null));};exports[_0x27af('0x55')]=function(_0x31a595,_0x3a2958,_0x4ab463){var _0x5d7af4='';return db[_0x27af('0x2b')]['findOne']({'where':{'id':_0x31a595[_0x27af('0x41')]['id']},'attributes':['id',_0x27af('0x56'),_0x27af('0x57'),_0x27af('0x58'),_0x27af('0x59'),'remoteUri']})[_0x27af('0x24')](handleEntityNotFound(_0x3a2958,null))[_0x27af('0x24')](function(_0x4ac2a3){if(_0x4ac2a3){_0x5d7af4=_0x4ac2a3[_0x27af('0x5a')];var _0xc0a98c=_0x5d7af4['slice'](-0x1);if(_0xc0a98c==='/'){_0x5d7af4=_0x5d7af4['substring'](0x0,_0x5d7af4[_0x27af('0x5b')](_0xc0a98c));}var _0x287f7c={'method':_0x27af('0x5c'),'uri':util[_0x27af('0x5d')](_0x27af('0x5e'),_0x5d7af4,_0x27af('0x5f')),'json':!![]};switch(_0x4ac2a3[_0x27af('0x59')]){case'password':_0x287f7c[_0x27af('0x60')]={'Authorization':util[_0x27af('0x5d')](_0x27af('0x61'),new Buffer(util[_0x27af('0x5d')]('%s:%s',_0x4ac2a3['username'],_0x4ac2a3[_0x27af('0x57')]))[_0x27af('0x62')](_0x27af('0x63')))};break;case _0x27af('0x58'):_0x287f7c['headers']={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x27af('0x5d')](_0x27af('0x64'),_0x4ac2a3[_0x27af('0x56')],_0x4ac2a3[_0x27af('0x58')]))[_0x27af('0x62')](_0x27af('0x63')))};break;default:throw new db['Sequelize']['ValidationError'](_0x27af('0x65'));}return rp(_0x287f7c);}})[_0x27af('0x24')](function(_0x55637f){if(_0x55637f){var _0x2c3d30=['subject','description',_0x27af('0x66'),_0x27af('0x67')];_[_0x27af('0x68')](_0x55637f[_0x27af('0x5f')],function(_0x2b7e18){return _0x2c3d30[_0x27af('0x69')](_0x2b7e18[_0x27af('0x2d')]);});return{'count':_0x55637f[_0x27af('0x5f')][_0x27af('0x4b')],'rows':_[_0x27af('0x2a')](_0x55637f[_0x27af('0x5f')],function(_0x4dd124){return{'id':_0x4dd124['id'],'name':_0x4dd124[_0x27af('0x6a')]>0x7?_0x4dd124[_0x27af('0x6b')]:_0x4dd124[_0x27af('0x2d')],'custom':_0x4dd124['position']>0x7?!![]:![],'options':_0x4dd124[_0x27af('0x6c')]?_0x4dd124[_0x27af('0x6c')]:_0x4dd124[_0x27af('0x6d')]?_0x4dd124['custom_field_options']:[]};})};}})[_0x27af('0x24')](respondWithResult(_0x3a2958,null))['catch'](function(_0x118d06){var _0x9350fa=_0x31a595[_0x27af('0x31')][_0x27af('0x6e')]?0x1f4:_0x118d06[_0x27af('0x6f')]||0x1f4;logger[_0x27af('0x25')](_0x27af('0x70'),_0x27af('0x55'),_0x9350fa,JSON['stringify'](_0x118d06));delete _0x118d06[_0x27af('0x27')];if(_0x9350fa===0x191){_0x9350fa=0x190;}_0x3a2958['status'](_0x9350fa)[_0x27af('0x28')](_0x31a595[_0x27af('0x31')][_0x27af('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x118d06['statusCode']}:_0x118d06);});};
\ No newline at end of file
index 81fd5d1..19fdd63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68d0=['moment','path','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger'];(function(_0x4c6b03,_0x567bf2){var _0x14201c=function(_0x59a4f1){while(--_0x59a4f1){_0x4c6b03['push'](_0x4c6b03['shift']());}};_0x14201c(++_0x567bf2);}(_0x68d0,0x75));var _0x068d=function(_0x589108,_0x118979){_0x589108=_0x589108-0x0;var _0x30bb99=_0x68d0[_0x589108];return _0x30bb99;};'use strict';var _=require(_0x068d('0x0'));var util=require(_0x068d('0x1'));var logger=require(_0x068d('0x2'))('api');var moment=require(_0x068d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x068d('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x068d('0x5'));var integrations=require(_0x068d('0x6'));module[_0x068d('0x7')]=function(_0x4fc0b4,_0x19d88a){return _0x4fc0b4['define'](_0x068d('0x8'),attributes,{'tableName':_0x068d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe171=['../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intZendeskAccount.attributes'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xe171,0x1c5));var _0x1e17=function(_0x147f3f,_0xbdede8){_0x147f3f=_0x147f3f-0x0;var _0x2c7c20=_0xe171[_0x147f3f];return _0x2c7c20;};'use strict';var _=require(_0x1e17('0x0'));var util=require(_0x1e17('0x1'));var logger=require(_0x1e17('0x2'))(_0x1e17('0x3'));var moment=require(_0x1e17('0x4'));var BPromise=require(_0x1e17('0x5'));var rp=require(_0x1e17('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e17('0x7'));var config=require('../../config/environment');var attributes=require(_0x1e17('0x8'));var integrations=require(_0x1e17('0x9'));module[_0x1e17('0xa')]=function(_0x4cf552,_0x25f998){return _0x4cf552[_0x1e17('0xb')](_0x1e17('0xc'),attributes,{'tableName':_0x1e17('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1847859..01661a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7166=['then','request\x20sent','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','info','result','GetZendeskAccount','ZendeskAccount','options','raw','where','attributes','limit','map','include','model','debug','catch','ShowZendeskAccount','find','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x113ed4,_0x4c6fb6){var _0x29047a=function(_0x35ecca){while(--_0x35ecca){_0x113ed4['push'](_0x113ed4['shift']());}};_0x29047a(++_0x4c6fb6);}(_0x7166,0x127));var _0x6716=function(_0x9be28f,_0x231334){_0x9be28f=_0x9be28f-0x0;var _0xa9f52d=_0x7166[_0x9be28f];return _0xa9f52d;};'use strict';var _=require(_0x6716('0x0'));var util=require(_0x6716('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6716('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6716('0x3'))['db'];var utils=require(_0x6716('0x4'));var logger=require(_0x6716('0x5'))(_0x6716('0x6'));var config=require(_0x6716('0x7'));var jayson=require(_0x6716('0x8'));var client=jayson[_0x6716('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a8ea9,_0x13c338,_0x3f5bd2){return new BPromise(function(_0x447a7c,_0x5e90f8){return client[_0x6716('0xa')](_0x1a8ea9,_0x3f5bd2)[_0x6716('0xb')](function(_0x590c94){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x13c338,_0x6716('0xc'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x13c338,'request\x20sent',JSON[_0x6716('0xd')](_0x590c94));if(_0x590c94[_0x6716('0xe')]){if(_0x590c94[_0x6716('0xe')][_0x6716('0xf')]===0x1f4){logger[_0x6716('0xe')](_0x6716('0x10'),_0x13c338,_0x590c94[_0x6716('0xe')][_0x6716('0x11')]);return _0x5e90f8(_0x590c94[_0x6716('0xe')][_0x6716('0x11')]);}logger[_0x6716('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x13c338,_0x590c94[_0x6716('0xe')][_0x6716('0x11')]);return _0x447a7c(_0x590c94[_0x6716('0xe')]['message']);}else{logger[_0x6716('0x12')](_0x6716('0x10'),_0x13c338,'request\x20sent');_0x447a7c(_0x590c94[_0x6716('0x13')]['message']);}})['catch'](function(_0x2c1ea5){logger[_0x6716('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x13c338,_0x2c1ea5);_0x5e90f8(_0x2c1ea5);});});}exports[_0x6716('0x14')]=function(_0x31bdfa){var _0x83fbe8=this;return new Promise(function(_0x1f1da3,_0x354dd1){return db[_0x6716('0x15')]['findAll']({'raw':_0x31bdfa[_0x6716('0x16')]?_0x31bdfa[_0x6716('0x16')][_0x6716('0x17')]===undefined?!![]:![]:!![],'where':_0x31bdfa[_0x6716('0x16')]?_0x31bdfa[_0x6716('0x16')][_0x6716('0x18')]||null:null,'attributes':_0x31bdfa[_0x6716('0x16')]?_0x31bdfa['options'][_0x6716('0x19')]||null:null,'limit':_0x31bdfa[_0x6716('0x16')]?_0x31bdfa[_0x6716('0x16')][_0x6716('0x1a')]||null:null,'include':_0x31bdfa[_0x6716('0x16')]?_0x31bdfa[_0x6716('0x16')]['include']?_[_0x6716('0x1b')](_0x31bdfa['options'][_0x6716('0x1c')],function(_0x2843b8){return{'model':db[_0x2843b8[_0x6716('0x1d')]],'as':_0x2843b8['as'],'attributes':_0x2843b8[_0x6716('0x19')],'include':_0x2843b8[_0x6716('0x1c')]?_[_0x6716('0x1b')](_0x2843b8['include'],function(_0x13f632){return{'model':db[_0x13f632[_0x6716('0x1d')]],'as':_0x13f632['as'],'attributes':_0x13f632[_0x6716('0x19')],'include':_0x13f632[_0x6716('0x1c')]?_[_0x6716('0x1b')](_0x13f632['include'],function(_0x230928){return{'model':db[_0x230928['model']],'as':_0x230928['as'],'attributes':_0x230928[_0x6716('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6716('0xb')](function(_0x33ff9b){logger[_0x6716('0x12')](_0x6716('0x14'),_0x31bdfa);logger[_0x6716('0x1e')](_0x6716('0x14'),_0x31bdfa,JSON['stringify'](_0x33ff9b));_0x1f1da3(_0x33ff9b);})[_0x6716('0x1f')](function(_0x300d54){logger[_0x6716('0xe')](_0x6716('0x14'),_0x300d54[_0x6716('0x11')],_0x31bdfa);_0x354dd1(_0x83fbe8[_0x6716('0xe')](0x1f4,_0x300d54[_0x6716('0x11')]));});});};exports[_0x6716('0x20')]=function(_0x5707a0){var _0xefe1eb=this;return new Promise(function(_0x53d703,_0x3b4d9c){return db[_0x6716('0x15')][_0x6716('0x21')]({'raw':_0x5707a0[_0x6716('0x16')]?_0x5707a0[_0x6716('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5707a0[_0x6716('0x16')]?_0x5707a0['options']['where']||null:null,'attributes':_0x5707a0['options']?_0x5707a0[_0x6716('0x16')][_0x6716('0x19')]||null:null,'include':_0x5707a0['options']?_0x5707a0[_0x6716('0x16')]['include']?_[_0x6716('0x1b')](_0x5707a0[_0x6716('0x16')][_0x6716('0x1c')],function(_0xe2a928){return{'model':db[_0xe2a928[_0x6716('0x1d')]],'as':_0xe2a928['as'],'attributes':_0xe2a928['attributes'],'include':_0xe2a928[_0x6716('0x1c')]?_[_0x6716('0x1b')](_0xe2a928['include'],function(_0xe7e05c){return{'model':db[_0xe7e05c[_0x6716('0x1d')]],'as':_0xe7e05c['as'],'attributes':_0xe7e05c['attributes'],'include':_0xe7e05c[_0x6716('0x1c')]?_[_0x6716('0x1b')](_0xe7e05c[_0x6716('0x1c')],function(_0xf5041e){return{'model':db[_0xf5041e['model']],'as':_0xf5041e['as'],'attributes':_0xf5041e[_0x6716('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6716('0xb')](function(_0x7008ed){logger[_0x6716('0x12')](_0x6716('0x20'),_0x5707a0);logger[_0x6716('0x1e')](_0x6716('0x20'),_0x5707a0,JSON[_0x6716('0xd')](_0x7008ed));_0x53d703(_0x7008ed);})[_0x6716('0x1f')](function(_0x44394a){logger['error'](_0x6716('0x20'),_0x44394a[_0x6716('0x11')],_0x5707a0);_0x3b4d9c(_0xefe1eb[_0x6716('0xe')](0x1f4,_0x44394a[_0x6716('0x11')]));});});};
\ No newline at end of file
+var _0x7449=['where','limit','include','model','attributes','ShowZendeskAccount','ZendeskAccount','raw','map','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','GetZendeskAccount','options'];(function(_0x59eefb,_0x2151ce){var _0x1a49e8=function(_0x5a758c){while(--_0x5a758c){_0x59eefb['push'](_0x59eefb['shift']());}};_0x1a49e8(++_0x2151ce);}(_0x7449,0x120));var _0x9744=function(_0x59f146,_0x55e318){_0x59f146=_0x59f146-0x0;var _0x27157b=_0x7449[_0x59f146];return _0x27157b;};'use strict';var _=require(_0x9744('0x0'));var util=require(_0x9744('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9744('0x2'));var fs=require('fs');var Redis=require(_0x9744('0x3'));var db=require(_0x9744('0x4'))['db'];var utils=require(_0x9744('0x5'));var logger=require('../../config/logger')(_0x9744('0x6'));var config=require('../../config/environment');var jayson=require(_0x9744('0x7'));var client=jayson['client'][_0x9744('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x301b47,_0x250398,_0x12c217){return new BPromise(function(_0x12092a,_0x1e1999){return client['request'](_0x301b47,_0x12c217)[_0x9744('0x9')](function(_0x4ea545){logger[_0x9744('0xa')]('ZendeskAccount,\x20%s,\x20%s',_0x250398,_0x9744('0xb'));logger[_0x9744('0xc')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x250398,'request\x20sent',JSON[_0x9744('0xd')](_0x4ea545));if(_0x4ea545[_0x9744('0xe')]){if(_0x4ea545['error'][_0x9744('0xf')]===0x1f4){logger['error'](_0x9744('0x10'),_0x250398,_0x4ea545['error'][_0x9744('0x11')]);return _0x1e1999(_0x4ea545[_0x9744('0xe')][_0x9744('0x11')]);}logger[_0x9744('0xe')](_0x9744('0x10'),_0x250398,_0x4ea545[_0x9744('0xe')][_0x9744('0x11')]);return _0x12092a(_0x4ea545[_0x9744('0xe')]['message']);}else{logger[_0x9744('0xa')]('ZendeskAccount,\x20%s,\x20%s',_0x250398,_0x9744('0xb'));_0x12092a(_0x4ea545[_0x9744('0x12')][_0x9744('0x11')]);}})[_0x9744('0x13')](function(_0x130e8c){logger[_0x9744('0xe')](_0x9744('0x10'),_0x250398,_0x130e8c);_0x1e1999(_0x130e8c);});});}exports[_0x9744('0x14')]=function(_0x3442f0){var _0x16a0ab=this;return new Promise(function(_0x55cec8,_0x3be4d0){return db['ZendeskAccount']['findAll']({'raw':_0x3442f0[_0x9744('0x15')]?_0x3442f0[_0x9744('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3442f0[_0x9744('0x15')]?_0x3442f0[_0x9744('0x15')][_0x9744('0x16')]||null:null,'attributes':_0x3442f0[_0x9744('0x15')]?_0x3442f0[_0x9744('0x15')]['attributes']||null:null,'limit':_0x3442f0[_0x9744('0x15')]?_0x3442f0['options'][_0x9744('0x17')]||null:null,'include':_0x3442f0[_0x9744('0x15')]?_0x3442f0[_0x9744('0x15')][_0x9744('0x18')]?_['map'](_0x3442f0[_0x9744('0x15')][_0x9744('0x18')],function(_0x397c36){return{'model':db[_0x397c36[_0x9744('0x19')]],'as':_0x397c36['as'],'attributes':_0x397c36[_0x9744('0x1a')],'include':_0x397c36[_0x9744('0x18')]?_['map'](_0x397c36[_0x9744('0x18')],function(_0x4534a4){return{'model':db[_0x4534a4['model']],'as':_0x4534a4['as'],'attributes':_0x4534a4['attributes'],'include':_0x4534a4['include']?_['map'](_0x4534a4[_0x9744('0x18')],function(_0x5a94f6){return{'model':db[_0x5a94f6['model']],'as':_0x5a94f6['as'],'attributes':_0x5a94f6[_0x9744('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9744('0x9')](function(_0x5a3426){logger[_0x9744('0xa')](_0x9744('0x14'),_0x3442f0);logger[_0x9744('0xc')](_0x9744('0x14'),_0x3442f0,JSON[_0x9744('0xd')](_0x5a3426));_0x55cec8(_0x5a3426);})[_0x9744('0x13')](function(_0x5d2c65){logger[_0x9744('0xe')]('GetZendeskAccount',_0x5d2c65[_0x9744('0x11')],_0x3442f0);_0x3be4d0(_0x16a0ab['error'](0x1f4,_0x5d2c65[_0x9744('0x11')]));});});};exports[_0x9744('0x1b')]=function(_0x3576c1){var _0x3ef281=this;return new Promise(function(_0x4c7d38,_0xdcf5d7){return db[_0x9744('0x1c')]['find']({'raw':_0x3576c1[_0x9744('0x15')]?_0x3576c1['options'][_0x9744('0x1d')]===undefined?!![]:![]:!![],'where':_0x3576c1[_0x9744('0x15')]?_0x3576c1[_0x9744('0x15')][_0x9744('0x16')]||null:null,'attributes':_0x3576c1[_0x9744('0x15')]?_0x3576c1['options'][_0x9744('0x1a')]||null:null,'include':_0x3576c1[_0x9744('0x15')]?_0x3576c1[_0x9744('0x15')][_0x9744('0x18')]?_[_0x9744('0x1e')](_0x3576c1[_0x9744('0x15')][_0x9744('0x18')],function(_0x39032f){return{'model':db[_0x39032f['model']],'as':_0x39032f['as'],'attributes':_0x39032f['attributes'],'include':_0x39032f[_0x9744('0x18')]?_['map'](_0x39032f['include'],function(_0x2a906a){return{'model':db[_0x2a906a[_0x9744('0x19')]],'as':_0x2a906a['as'],'attributes':_0x2a906a[_0x9744('0x1a')],'include':_0x2a906a[_0x9744('0x18')]?_[_0x9744('0x1e')](_0x2a906a[_0x9744('0x18')],function(_0x27fbf7){return{'model':db[_0x27fbf7[_0x9744('0x19')]],'as':_0x27fbf7['as'],'attributes':_0x27fbf7[_0x9744('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d684d){logger[_0x9744('0xa')]('ShowZendeskAccount',_0x3576c1);logger[_0x9744('0xc')](_0x9744('0x1b'),_0x3576c1,JSON[_0x9744('0xd')](_0x5d684d));_0x4c7d38(_0x5d684d);})[_0x9744('0x13')](function(_0x124cf1){logger[_0x9744('0xe')](_0x9744('0x1b'),_0x124cf1[_0x9744('0x11')],_0x3576c1);_0xdcf5d7(_0x3ef281[_0x9744('0xe')](0x1f4,_0x124cf1[_0x9744('0x11')]));});});};
\ No newline at end of file
index 74ea442..0bda537 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['getFields','/:id/subjects','/:id/descriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields'];(function(_0x5c76c4,_0x3f406d){var _0x38d792=function(_0x453a97){while(--_0x453a97){_0x5c76c4['push'](_0x5c76c4['shift']());}};_0x38d792(++_0x3f406d);}(_0xb10b,0x12a));var _0xbb10=function(_0xb4603b,_0x17bae3){_0xb4603b=_0xb4603b-0x0;var _0x599e97=_0xb10b[_0xb4603b];return _0x599e97;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getDescriptions']);router[_0xbb10('0x9')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x12')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router[_0xbb10('0x12')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x15')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x18')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x37c07d,_0xdbdb5f){var _0x10dadc=function(_0x2bafb7){while(--_0x2bafb7){_0x37c07d['push'](_0x37c07d['shift']());}};_0x10dadc(++_0xdbdb5f);}(_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('./intZendeskConfiguration.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/descriptions',auth[_0x0d8b('0x7')](),controller['getDescriptions']);router[_0x0d8b('0x9')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller['update']);router[_0x0d8b('0x16')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x17')]);module[_0x0d8b('0x18')]=router;
\ No newline at end of file
index 652803e..db39ed5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95dc=['STRING','sequelize'];(function(_0x46366b,_0x1e4d58){var _0x120017=function(_0x191876){while(--_0x191876){_0x46366b['push'](_0x46366b['shift']());}};_0x120017(++_0x1e4d58);}(_0x95dc,0xed));var _0xc95d=function(_0x26d455,_0x4a97fb){_0x26d455=_0x26d455-0x0;var _0x4ffdf8=_0x95dc[_0x26d455];return _0x4ffdf8;};'use strict';var Sequelize=require(_0xc95d('0x0'));module['exports']={'name':{'type':Sequelize[_0xc95d('0x1')]},'description':{'type':Sequelize[_0xc95d('0x1')]}};
\ No newline at end of file
+var _0x1b5d=['sequelize','STRING'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1b5d,0x14c));var _0xd1b5=function(_0xf670f0,_0x353747){_0xf670f0=_0xf670f0-0x0;var _0x3c21c6=_0x1b5d[_0xf670f0];return _0x3c21c6;};'use strict';var Sequelize=require(_0xd1b5('0x0'));module['exports']={'name':{'type':Sequelize[_0xd1b5('0x1')]},'description':{'type':Sequelize[_0xd1b5('0x1')]}};
\ No newline at end of file
index e8e8e8d..fa71666 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9750=['util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','ZendeskConfiguration','findAll','catch','show','params','keys','options','create','body','find','findOne','ZendeskField','pick','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache'];(function(_0x460666,_0x24bfa0){var _0x555cbf=function(_0x3b4743){while(--_0x3b4743){_0x460666['push'](_0x460666['shift']());}};_0x555cbf(++_0x24bfa0);}(_0x9750,0x142));var _0x0975=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x9750[_0x47a7d0];return _0xb9bd08;};'use strict';var emlformat=require(_0x0975('0x0'));var rimraf=require(_0x0975('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0975('0x2'));var rp=require(_0x0975('0x3'));var moment=require(_0x0975('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0975('0x5'));var util=require(_0x0975('0x6'));var path=require(_0x0975('0x7'));var sox=require(_0x0975('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0975('0x9'));var _=require(_0x0975('0xa'));var squel=require(_0x0975('0xb'));var crypto=require('crypto');var jsforce=require(_0x0975('0xc'));var deskjs=require(_0x0975('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0975('0xe'));var Papa=require(_0x0975('0xf'));var Redis=require('ioredis');var authService=require(_0x0975('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0975('0x11'));var hardwareService=require(_0x0975('0x12'));var logger=require(_0x0975('0x13'))(_0x0975('0x14'));var utils=require(_0x0975('0x15'));var config=require(_0x0975('0x16'));var licenseUtil=require(_0x0975('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x408d0b,_0x1c8b17){_0x1c8b17=_0x1c8b17||0xcc;return function(_0x186d79){if(_0x186d79){return _0x408d0b[_0x0975('0x18')](_0x1c8b17);}return _0x408d0b[_0x0975('0x19')](_0x1c8b17)[_0x0975('0x1a')]();};}function respondWithResult(_0x21ba5c,_0x5b9fc6){_0x5b9fc6=_0x5b9fc6||0xc8;return function(_0x2d352a){if(_0x2d352a){return _0x21ba5c[_0x0975('0x19')](_0x5b9fc6)['json'](_0x2d352a);}};}function respondWithFilteredResult(_0x5a6848,_0x20aeeb){return function(_0x534afe){if(_0x534afe){var _0x244496=typeof _0x20aeeb[_0x0975('0x1b')]===_0x0975('0x1c')&&typeof _0x20aeeb[_0x0975('0x1d')]==='undefined';var _0x116fb8=_0x534afe[_0x0975('0x1e')];var _0x50a7d8=_0x244496?0x0:_0x20aeeb[_0x0975('0x1b')];var _0x4025f1=_0x244496?_0x534afe[_0x0975('0x1e')]:_0x20aeeb['offset']+_0x20aeeb['limit'];var _0x208202;if(_0x4025f1>=_0x116fb8){_0x4025f1=_0x116fb8;_0x208202=0xc8;}else{_0x208202=0xce;}_0x5a6848[_0x0975('0x19')](_0x208202);return _0x5a6848[_0x0975('0x1f')]('Content-Range',_0x50a7d8+'-'+_0x4025f1+'/'+_0x116fb8)['json'](_0x534afe);}return null;};}function patchUpdates(_0x1cc6ef){return function(_0xbaf207){try{jsonpatch[_0x0975('0x20')](_0xbaf207,_0x1cc6ef,!![]);}catch(_0x5e22d0){return BPromise[_0x0975('0x21')](_0x5e22d0);}return _0xbaf207[_0x0975('0x22')]();};}function saveUpdates(_0x4db31e,_0x8be68d){return function(_0x57f7ab){if(_0x57f7ab){return _0x57f7ab[_0x0975('0x23')](_0x4db31e)[_0x0975('0x24')](function(_0xcbb424){return _0xcbb424;});}return null;};}function removeEntity(_0x47fa6d,_0x139d83){return function(_0x22855b){if(_0x22855b){return _0x22855b[_0x0975('0x25')]()[_0x0975('0x24')](function(){_0x47fa6d[_0x0975('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf773e6,_0x1bf162){return function(_0x149a8b){if(!_0x149a8b){_0xf773e6[_0x0975('0x18')](0x194);}return _0x149a8b;};}function handleError(_0x36b58b,_0x3669ef){_0x3669ef=_0x3669ef||0x1f4;return function(_0x2cb6cb){logger['error'](_0x2cb6cb['stack']);if(_0x2cb6cb[_0x0975('0x26')]){delete _0x2cb6cb[_0x0975('0x26')];}_0x36b58b[_0x0975('0x19')](_0x3669ef)[_0x0975('0x27')](_0x2cb6cb);};}exports[_0x0975('0x28')]=function(_0x2845ef,_0x16aa2d){var _0x19be38={},_0x88c1a9={},_0x4b62cb={'count':0x0,'rows':[]};var _0x5c1bd7=_[_0x0975('0x29')](db['ZendeskConfiguration'][_0x0975('0x2a')],function(_0x5c9592){return{'name':_0x5c9592[_0x0975('0x2b')],'type':_0x5c9592[_0x0975('0x2c')][_0x0975('0x2d')]};});_0x88c1a9[_0x0975('0x2e')]=_[_0x0975('0x29')](_0x5c1bd7,'name');_0x88c1a9[_0x0975('0x2f')]=_['keys'](_0x2845ef[_0x0975('0x2f')]);_0x88c1a9[_0x0975('0x30')]=_[_0x0975('0x31')](_0x88c1a9['model'],_0x88c1a9['query']);_0x19be38['attributes']=_[_0x0975('0x31')](_0x88c1a9[_0x0975('0x2e')],qs['fields'](_0x2845ef[_0x0975('0x2f')][_0x0975('0x32')]));_0x19be38['attributes']=_0x19be38[_0x0975('0x33')][_0x0975('0x34')]?_0x19be38[_0x0975('0x33')]:_0x88c1a9[_0x0975('0x2e')];if(!_0x2845ef['query'][_0x0975('0x35')](_0x0975('0x36'))){_0x19be38[_0x0975('0x1d')]=qs[_0x0975('0x1d')](_0x2845ef[_0x0975('0x2f')]['limit']);_0x19be38[_0x0975('0x1b')]=qs[_0x0975('0x1b')](_0x2845ef[_0x0975('0x2f')][_0x0975('0x1b')]);}_0x19be38[_0x0975('0x37')]=qs[_0x0975('0x38')](_0x2845ef[_0x0975('0x2f')][_0x0975('0x38')]);_0x19be38[_0x0975('0x39')]=qs['filters'](_['pick'](_0x2845ef['query'],_0x88c1a9[_0x0975('0x30')]),_0x5c1bd7);if(_0x2845ef[_0x0975('0x2f')][_0x0975('0x3a')]){_0x19be38[_0x0975('0x39')]=_['merge'](_0x19be38['where'],{'$or':_[_0x0975('0x29')](_0x5c1bd7,function(_0x2c6fd3){if(_0x2c6fd3[_0x0975('0x2c')]!==_0x0975('0x3b')){var _0xc2030f={};_0xc2030f[_0x2c6fd3[_0x0975('0x26')]]={'$like':'%'+_0x2845ef[_0x0975('0x2f')][_0x0975('0x3a')]+'%'};return _0xc2030f;}})});}_0x19be38=_[_0x0975('0x3c')]({},_0x19be38,_0x2845ef['options']);var _0x51bb67={'where':_0x19be38[_0x0975('0x39')]};return db['ZendeskConfiguration']['count'](_0x51bb67)[_0x0975('0x24')](function(_0x3db162){_0x4b62cb['count']=_0x3db162;if(_0x2845ef['query'][_0x0975('0x3d')]){_0x19be38[_0x0975('0x3e')]=[{'all':!![]}];}return db[_0x0975('0x3f')][_0x0975('0x40')](_0x19be38);})[_0x0975('0x24')](function(_0x3941d8){_0x4b62cb['rows']=_0x3941d8;return _0x4b62cb;})[_0x0975('0x24')](respondWithFilteredResult(_0x16aa2d,_0x19be38))[_0x0975('0x41')](handleError(_0x16aa2d,null));};exports[_0x0975('0x42')]=function(_0x5c7bb1,_0x437de4){var _0x1bc817={'raw':![],'where':{'id':_0x5c7bb1[_0x0975('0x43')]['id']}},_0x162ba1={};_0x162ba1['model']=_['keys'](db[_0x0975('0x3f')][_0x0975('0x2a')]);_0x162ba1[_0x0975('0x2f')]=_[_0x0975('0x44')](_0x5c7bb1[_0x0975('0x2f')]);_0x162ba1[_0x0975('0x30')]=_['intersection'](_0x162ba1[_0x0975('0x2e')],_0x162ba1[_0x0975('0x2f')]);_0x1bc817[_0x0975('0x33')]=_['intersection'](_0x162ba1[_0x0975('0x2e')],qs[_0x0975('0x32')](_0x5c7bb1['query'][_0x0975('0x32')]));_0x1bc817[_0x0975('0x33')]=_0x1bc817[_0x0975('0x33')]['length']?_0x1bc817['attributes']:_0x162ba1[_0x0975('0x2e')];if(_0x5c7bb1[_0x0975('0x2f')][_0x0975('0x3d')]){_0x1bc817[_0x0975('0x3e')]=[{'all':!![]}];}_0x1bc817=_['merge']({},_0x1bc817,_0x5c7bb1[_0x0975('0x45')]);return db['ZendeskConfiguration']['find'](_0x1bc817)['then'](handleEntityNotFound(_0x437de4,null))[_0x0975('0x24')](respondWithResult(_0x437de4,null))['catch'](handleError(_0x437de4,null));};exports[_0x0975('0x46')]=function(_0x39f0df,_0x3d1481){return db['ZendeskConfiguration'][_0x0975('0x46')](_0x39f0df[_0x0975('0x47')],{})[_0x0975('0x24')](respondWithResult(_0x3d1481,0xc9))['catch'](handleError(_0x3d1481,null));};exports[_0x0975('0x23')]=function(_0x191717,_0x3ce2ea){if(_0x191717[_0x0975('0x47')]['id']){delete _0x191717[_0x0975('0x47')]['id'];}return db[_0x0975('0x3f')][_0x0975('0x48')]({'where':{'id':_0x191717[_0x0975('0x43')]['id']}})['then'](handleEntityNotFound(_0x3ce2ea,null))['then'](saveUpdates(_0x191717[_0x0975('0x47')],null))[_0x0975('0x24')](respondWithResult(_0x3ce2ea,null))[_0x0975('0x41')](handleError(_0x3ce2ea,null));};exports['destroy']=function(_0x43dc24,_0xd47273){return db['ZendeskConfiguration'][_0x0975('0x48')]({'where':{'id':_0x43dc24['params']['id']}})['then'](handleEntityNotFound(_0xd47273,null))[_0x0975('0x24')](removeEntity(_0xd47273,null))[_0x0975('0x41')](handleError(_0xd47273,null));};exports['getFields']=function(_0x84a576,_0x34c676,_0x262ae4){var _0x4ca70a={};var _0x203a68={};var _0x4ecd68;var _0x2e50dc;return db[_0x0975('0x3f')][_0x0975('0x49')]({'where':{'id':_0x84a576[_0x0975('0x43')]['id']}})[_0x0975('0x24')](handleEntityNotFound(_0x34c676,null))[_0x0975('0x24')](function(_0x4193d5){if(_0x4193d5){_0x4ecd68=_0x4193d5;_0x203a68[_0x0975('0x2e')]=_[_0x0975('0x44')](db[_0x0975('0x4a')][_0x0975('0x2a')]);_0x203a68[_0x0975('0x2f')]=_['keys'](_0x84a576['query']);_0x203a68['filters']=_[_0x0975('0x31')](_0x203a68[_0x0975('0x2e')],_0x203a68['query']);_0x4ca70a[_0x0975('0x33')]=_[_0x0975('0x31')](_0x203a68['model'],qs[_0x0975('0x32')](_0x84a576[_0x0975('0x2f')][_0x0975('0x32')]));_0x4ca70a['attributes']=_0x4ca70a[_0x0975('0x33')][_0x0975('0x34')]?_0x4ca70a[_0x0975('0x33')]:_0x203a68['model'];_0x4ca70a[_0x0975('0x37')]=qs[_0x0975('0x38')](_0x84a576['query'][_0x0975('0x38')]);_0x4ca70a[_0x0975('0x39')]=qs['filters'](_[_0x0975('0x4b')](_0x84a576[_0x0975('0x2f')],_0x203a68[_0x0975('0x30')]));if(_0x84a576[_0x0975('0x2f')][_0x0975('0x3a')]){_0x4ca70a['where']=_[_0x0975('0x3c')](_0x4ca70a[_0x0975('0x39')],{'$or':_[_0x0975('0x29')](_0x4ca70a[_0x0975('0x33')],function(_0x33ce46){var _0x5e06ab={};_0x5e06ab[_0x33ce46]={'$like':'%'+_0x84a576[_0x0975('0x2f')]['filter']+'%'};return _0x5e06ab;})});}_0x4ca70a=_[_0x0975('0x3c')]({},_0x4ca70a,_0x84a576[_0x0975('0x45')]);return _0x4ecd68[_0x0975('0x4c')](_0x4ca70a);}})[_0x0975('0x24')](function(_0x38aa90){if(_0x38aa90){_0x2e50dc=_0x38aa90[_0x0975('0x34')];if(!_0x84a576['query'][_0x0975('0x35')](_0x0975('0x36'))){_0x4ca70a[_0x0975('0x1d')]=qs['limit'](_0x84a576[_0x0975('0x2f')][_0x0975('0x1d')]);_0x4ca70a['offset']=qs[_0x0975('0x1b')](_0x84a576[_0x0975('0x2f')][_0x0975('0x1b')]);}return _0x4ecd68[_0x0975('0x4c')](_0x4ca70a);}})[_0x0975('0x24')](function(_0x38f5f5){if(_0x38f5f5){return _0x38f5f5?{'count':_0x2e50dc,'rows':_0x38f5f5}:null;}})[_0x0975('0x24')](respondWithResult(_0x34c676,null))['catch'](handleError(_0x34c676,null));};exports[_0x0975('0x4d')]=function(_0x36c399,_0x3628ba,_0xa39e13){var _0x2f723a={};var _0x426cbd={};var _0x13b2b1;var _0x8f6c28;return db['ZendeskConfiguration'][_0x0975('0x49')]({'where':{'id':_0x36c399['params']['id']}})['then'](handleEntityNotFound(_0x3628ba,null))[_0x0975('0x24')](function(_0x565fcd){if(_0x565fcd){_0x13b2b1=_0x565fcd;_0x426cbd[_0x0975('0x2e')]=_[_0x0975('0x44')](db[_0x0975('0x4a')][_0x0975('0x2a')]);_0x426cbd[_0x0975('0x2f')]=_['keys'](_0x36c399[_0x0975('0x2f')]);_0x426cbd[_0x0975('0x30')]=_['intersection'](_0x426cbd['model'],_0x426cbd[_0x0975('0x2f')]);_0x2f723a[_0x0975('0x33')]=_['intersection'](_0x426cbd['model'],qs['fields'](_0x36c399['query']['fields']));_0x2f723a[_0x0975('0x33')]=_0x2f723a['attributes'][_0x0975('0x34')]?_0x2f723a[_0x0975('0x33')]:_0x426cbd[_0x0975('0x2e')];_0x2f723a[_0x0975('0x37')]=qs[_0x0975('0x38')](_0x36c399[_0x0975('0x2f')]['sort']);_0x2f723a['where']=qs[_0x0975('0x30')](_['pick'](_0x36c399['query'],_0x426cbd[_0x0975('0x30')]));if(_0x36c399['query'][_0x0975('0x3a')]){_0x2f723a['where']=_[_0x0975('0x3c')](_0x2f723a[_0x0975('0x39')],{'$or':_[_0x0975('0x29')](_0x2f723a[_0x0975('0x33')],function(_0x46d883){var _0x19e1a8={};_0x19e1a8[_0x46d883]={'$like':'%'+_0x36c399['query'][_0x0975('0x3a')]+'%'};return _0x19e1a8;})});}_0x2f723a=_['merge']({},_0x2f723a,_0x36c399[_0x0975('0x45')]);return _0x13b2b1[_0x0975('0x4d')](_0x2f723a);}})['then'](function(_0x22c2be){if(_0x22c2be){_0x8f6c28=_0x22c2be['length'];if(!_0x36c399['query']['hasOwnProperty']('nolimit')){_0x2f723a[_0x0975('0x1d')]=qs[_0x0975('0x1d')](_0x36c399[_0x0975('0x2f')][_0x0975('0x1d')]);_0x2f723a['offset']=qs[_0x0975('0x1b')](_0x36c399[_0x0975('0x2f')][_0x0975('0x1b')]);}return _0x13b2b1[_0x0975('0x4d')](_0x2f723a);}})[_0x0975('0x24')](function(_0x3405a1){if(_0x3405a1){return _0x3405a1?{'count':_0x8f6c28,'rows':_0x3405a1}:null;}})[_0x0975('0x24')](respondWithResult(_0x3628ba,null))[_0x0975('0x41')](handleError(_0x3628ba,null));};exports[_0x0975('0x4e')]=function(_0xa70c1d,_0x5537e8,_0x449811){var _0x2109c4={};var _0x2ba897={};var _0x389a28;var _0x57892a;return db[_0x0975('0x3f')][_0x0975('0x49')]({'where':{'id':_0xa70c1d[_0x0975('0x43')]['id']}})[_0x0975('0x24')](handleEntityNotFound(_0x5537e8,null))['then'](function(_0x346117){if(_0x346117){_0x389a28=_0x346117;_0x2ba897['model']=_['keys'](db[_0x0975('0x4a')][_0x0975('0x2a')]);_0x2ba897[_0x0975('0x2f')]=_['keys'](_0xa70c1d[_0x0975('0x2f')]);_0x2ba897[_0x0975('0x30')]=_[_0x0975('0x31')](_0x2ba897['model'],_0x2ba897[_0x0975('0x2f')]);_0x2109c4[_0x0975('0x33')]=_['intersection'](_0x2ba897[_0x0975('0x2e')],qs[_0x0975('0x32')](_0xa70c1d[_0x0975('0x2f')]['fields']));_0x2109c4[_0x0975('0x33')]=_0x2109c4[_0x0975('0x33')]['length']?_0x2109c4[_0x0975('0x33')]:_0x2ba897[_0x0975('0x2e')];_0x2109c4[_0x0975('0x37')]=qs['sort'](_0xa70c1d[_0x0975('0x2f')][_0x0975('0x38')]);_0x2109c4[_0x0975('0x39')]=qs['filters'](_['pick'](_0xa70c1d[_0x0975('0x2f')],_0x2ba897[_0x0975('0x30')]));if(_0xa70c1d[_0x0975('0x2f')]['filter']){_0x2109c4[_0x0975('0x39')]=_[_0x0975('0x3c')](_0x2109c4[_0x0975('0x39')],{'$or':_[_0x0975('0x29')](_0x2109c4[_0x0975('0x33')],function(_0x2db794){var _0xbbb7fc={};_0xbbb7fc[_0x2db794]={'$like':'%'+_0xa70c1d['query'][_0x0975('0x3a')]+'%'};return _0xbbb7fc;})});}_0x2109c4=_['merge']({},_0x2109c4,_0xa70c1d[_0x0975('0x45')]);return _0x389a28[_0x0975('0x4e')](_0x2109c4);}})[_0x0975('0x24')](function(_0x4ab451){if(_0x4ab451){_0x57892a=_0x4ab451[_0x0975('0x34')];if(!_0xa70c1d[_0x0975('0x2f')][_0x0975('0x35')](_0x0975('0x36'))){_0x2109c4[_0x0975('0x1d')]=qs[_0x0975('0x1d')](_0xa70c1d['query'][_0x0975('0x1d')]);_0x2109c4[_0x0975('0x1b')]=qs['offset'](_0xa70c1d[_0x0975('0x2f')]['offset']);}return _0x389a28[_0x0975('0x4e')](_0x2109c4);}})['then'](function(_0x1d68ef){if(_0x1d68ef){return _0x1d68ef?{'count':_0x57892a,'rows':_0x1d68ef}:null;}})[_0x0975('0x24')](respondWithResult(_0x5537e8,null))[_0x0975('0x41')](handleError(_0x5537e8,null));};exports[_0x0975('0x4f')]=function(_0x5005bc,_0x1abfd7,_0x33a109){var _0x5b98a6={};var _0x46b90c={};var _0x4bd629;var _0x1fa15d;return db[_0x0975('0x3f')][_0x0975('0x49')]({'where':{'id':_0x5005bc['params']['id']}})[_0x0975('0x24')](handleEntityNotFound(_0x1abfd7,null))[_0x0975('0x24')](function(_0x4d20b2){if(_0x4d20b2){_0x4bd629=_0x4d20b2;_0x46b90c['model']=_[_0x0975('0x44')](db[_0x0975('0x50')]['rawAttributes']);_0x46b90c[_0x0975('0x2f')]=_[_0x0975('0x44')](_0x5005bc[_0x0975('0x2f')]);_0x46b90c['filters']=_[_0x0975('0x31')](_0x46b90c['model'],_0x46b90c[_0x0975('0x2f')]);_0x5b98a6[_0x0975('0x33')]=_[_0x0975('0x31')](_0x46b90c[_0x0975('0x2e')],qs[_0x0975('0x32')](_0x5005bc[_0x0975('0x2f')][_0x0975('0x32')]));_0x5b98a6['attributes']=_0x5b98a6[_0x0975('0x33')][_0x0975('0x34')]?_0x5b98a6[_0x0975('0x33')]:_0x46b90c[_0x0975('0x2e')];_0x5b98a6['order']=qs[_0x0975('0x38')](_0x5005bc[_0x0975('0x2f')][_0x0975('0x38')]);_0x5b98a6[_0x0975('0x39')]=qs[_0x0975('0x30')](_[_0x0975('0x4b')](_0x5005bc[_0x0975('0x2f')],_0x46b90c[_0x0975('0x30')]));if(_0x5005bc[_0x0975('0x2f')]['filter']){_0x5b98a6[_0x0975('0x39')]=_['merge'](_0x5b98a6[_0x0975('0x39')],{'$or':_[_0x0975('0x29')](_0x5b98a6[_0x0975('0x33')],function(_0xca194a){var _0x372d1d={};_0x372d1d[_0xca194a]={'$like':'%'+_0x5005bc['query'][_0x0975('0x3a')]+'%'};return _0x372d1d;})});}_0x5b98a6=_['merge']({},_0x5b98a6,_0x5005bc[_0x0975('0x45')]);return _0x4bd629[_0x0975('0x4f')](_0x5b98a6);}})[_0x0975('0x24')](function(_0x3bb692){if(_0x3bb692){_0x1fa15d=_0x3bb692[_0x0975('0x34')];if(!_0x5005bc['query'][_0x0975('0x35')](_0x0975('0x36'))){_0x5b98a6[_0x0975('0x1d')]=qs[_0x0975('0x1d')](_0x5005bc['query'][_0x0975('0x1d')]);_0x5b98a6['offset']=qs[_0x0975('0x1b')](_0x5005bc[_0x0975('0x2f')][_0x0975('0x1b')]);}return _0x4bd629[_0x0975('0x4f')](_0x5b98a6);}})[_0x0975('0x24')](function(_0x581cd9){if(_0x581cd9){return _0x581cd9?{'count':_0x1fa15d,'rows':_0x581cd9}:null;}})[_0x0975('0x24')](respondWithResult(_0x1abfd7,null))[_0x0975('0x41')](handleError(_0x1abfd7,null));};exports[_0x0975('0x51')]=function(_0xe1f654,_0x2e59db,_0x20843f){if(_0xe1f654['body']['id']){delete _0xe1f654['body']['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0xe1f654[_0x0975('0x43')]['id']}})['then'](handleEntityNotFound(_0x2e59db,null))[_0x0975('0x24')](function(_0x19fd3a){if(_0x19fd3a){return _0x19fd3a[_0x0975('0x51')](_0xe1f654[_0x0975('0x47')]['ids']||[]);}return null;})['then'](respondWithResult(_0x2e59db,null))[_0x0975('0x41')](handleError(_0x2e59db,null));};
\ No newline at end of file
+var _0x2f1d=['rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','keys','options','create','body','find','destroy','getFields','ZendeskField','order','findOne','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','ZendeskConfiguration'];(function(_0x591cf0,_0x398085){var _0x544f8a=function(_0x1466a2){while(--_0x1466a2){_0x591cf0['push'](_0x591cf0['shift']());}};_0x544f8a(++_0x398085);}(_0x2f1d,0x7c));var _0xd2f1=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x2f1d[_0x456fb1];return _0x4083d6;};'use strict';var emlformat=require(_0xd2f1('0x0'));var rimraf=require(_0xd2f1('0x1'));var zipdir=require(_0xd2f1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd2f1('0x3'));var BPromise=require(_0xd2f1('0x4'));var Mustache=require(_0xd2f1('0x5'));var util=require('util');var path=require(_0xd2f1('0x6'));var sox=require(_0xd2f1('0x7'));var csv=require('to-csv');var ejs=require(_0xd2f1('0x8'));var fs=require('fs');var fs_extra=require(_0xd2f1('0x9'));var _=require(_0xd2f1('0xa'));var squel=require(_0xd2f1('0xb'));var crypto=require(_0xd2f1('0xc'));var jsforce=require(_0xd2f1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd2f1('0xe'));var querystring=require(_0xd2f1('0xf'));var Papa=require('papaparse');var Redis=require(_0xd2f1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd2f1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd2f1('0x12'))(_0xd2f1('0x13'));var utils=require(_0xd2f1('0x14'));var config=require(_0xd2f1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd2f1('0x16'))['db'];function respondWithStatusCode(_0x200dfd,_0x2bc404){_0x2bc404=_0x2bc404||0xcc;return function(_0x4cb7b8){if(_0x4cb7b8){return _0x200dfd['sendStatus'](_0x2bc404);}return _0x200dfd['status'](_0x2bc404)['end']();};}function respondWithResult(_0x49bc2b,_0x104304){_0x104304=_0x104304||0xc8;return function(_0xeed954){if(_0xeed954){return _0x49bc2b[_0xd2f1('0x17')](_0x104304)[_0xd2f1('0x18')](_0xeed954);}};}function respondWithFilteredResult(_0x18e6e0,_0x4fad0a){return function(_0x66f469){if(_0x66f469){var _0x3f4c60=typeof _0x4fad0a[_0xd2f1('0x19')]===_0xd2f1('0x1a')&&typeof _0x4fad0a[_0xd2f1('0x1b')]===_0xd2f1('0x1a');var _0x5413be=_0x66f469['count'];var _0x1b3ecb=_0x3f4c60?0x0:_0x4fad0a[_0xd2f1('0x19')];var _0x42057d=_0x3f4c60?_0x66f469[_0xd2f1('0x1c')]:_0x4fad0a[_0xd2f1('0x19')]+_0x4fad0a[_0xd2f1('0x1b')];var _0x2565cf;if(_0x42057d>=_0x5413be){_0x42057d=_0x5413be;_0x2565cf=0xc8;}else{_0x2565cf=0xce;}_0x18e6e0['status'](_0x2565cf);return _0x18e6e0[_0xd2f1('0x1d')]('Content-Range',_0x1b3ecb+'-'+_0x42057d+'/'+_0x5413be)['json'](_0x66f469);}return null;};}function patchUpdates(_0x9855d2){return function(_0x594713){try{jsonpatch[_0xd2f1('0x1e')](_0x594713,_0x9855d2,!![]);}catch(_0x11d2c2){return BPromise[_0xd2f1('0x1f')](_0x11d2c2);}return _0x594713[_0xd2f1('0x20')]();};}function saveUpdates(_0x3ababc,_0x34e826){return function(_0x5b5034){if(_0x5b5034){return _0x5b5034[_0xd2f1('0x21')](_0x3ababc)[_0xd2f1('0x22')](function(_0x3cf03b){return _0x3cf03b;});}return null;};}function removeEntity(_0x104fd5,_0x4d95ab){return function(_0x19dce3){if(_0x19dce3){return _0x19dce3['destroy']()[_0xd2f1('0x22')](function(){_0x104fd5['status'](0xcc)[_0xd2f1('0x23')]();});}};}function handleEntityNotFound(_0x22b0bb,_0x503a54){return function(_0x4c2d40){if(!_0x4c2d40){_0x22b0bb[_0xd2f1('0x24')](0x194);}return _0x4c2d40;};}function handleError(_0x260262,_0x3fbca0){_0x3fbca0=_0x3fbca0||0x1f4;return function(_0x57c9eb){logger[_0xd2f1('0x25')](_0x57c9eb[_0xd2f1('0x26')]);if(_0x57c9eb[_0xd2f1('0x27')]){delete _0x57c9eb[_0xd2f1('0x27')];}_0x260262[_0xd2f1('0x17')](_0x3fbca0)[_0xd2f1('0x28')](_0x57c9eb);};}exports[_0xd2f1('0x29')]=function(_0x1c2df0,_0x5a82a8){var _0x9f73ce={},_0x5059dc={},_0x2f21f2={'count':0x0,'rows':[]};var _0x3743fc=_[_0xd2f1('0x2a')](db[_0xd2f1('0x2b')][_0xd2f1('0x2c')],function(_0x19d2aa){return{'name':_0x19d2aa[_0xd2f1('0x2d')],'type':_0x19d2aa[_0xd2f1('0x2e')][_0xd2f1('0x2f')]};});_0x5059dc[_0xd2f1('0x30')]=_['map'](_0x3743fc,_0xd2f1('0x27'));_0x5059dc[_0xd2f1('0x31')]=_['keys'](_0x1c2df0[_0xd2f1('0x31')]);_0x5059dc[_0xd2f1('0x32')]=_[_0xd2f1('0x33')](_0x5059dc['model'],_0x5059dc[_0xd2f1('0x31')]);_0x9f73ce[_0xd2f1('0x34')]=_[_0xd2f1('0x33')](_0x5059dc[_0xd2f1('0x30')],qs[_0xd2f1('0x35')](_0x1c2df0[_0xd2f1('0x31')][_0xd2f1('0x35')]));_0x9f73ce[_0xd2f1('0x34')]=_0x9f73ce[_0xd2f1('0x34')][_0xd2f1('0x36')]?_0x9f73ce[_0xd2f1('0x34')]:_0x5059dc['model'];if(!_0x1c2df0[_0xd2f1('0x31')][_0xd2f1('0x37')](_0xd2f1('0x38'))){_0x9f73ce[_0xd2f1('0x1b')]=qs['limit'](_0x1c2df0[_0xd2f1('0x31')][_0xd2f1('0x1b')]);_0x9f73ce['offset']=qs[_0xd2f1('0x19')](_0x1c2df0[_0xd2f1('0x31')][_0xd2f1('0x19')]);}_0x9f73ce['order']=qs[_0xd2f1('0x39')](_0x1c2df0[_0xd2f1('0x31')][_0xd2f1('0x39')]);_0x9f73ce[_0xd2f1('0x3a')]=qs[_0xd2f1('0x32')](_[_0xd2f1('0x3b')](_0x1c2df0['query'],_0x5059dc[_0xd2f1('0x32')]),_0x3743fc);if(_0x1c2df0['query'][_0xd2f1('0x3c')]){_0x9f73ce['where']=_[_0xd2f1('0x3d')](_0x9f73ce[_0xd2f1('0x3a')],{'$or':_[_0xd2f1('0x2a')](_0x3743fc,function(_0x9b5a3b){if(_0x9b5a3b['type']!=='VIRTUAL'){var _0x391559={};_0x391559[_0x9b5a3b['name']]={'$like':'%'+_0x1c2df0[_0xd2f1('0x31')][_0xd2f1('0x3c')]+'%'};return _0x391559;}})});}_0x9f73ce=_[_0xd2f1('0x3d')]({},_0x9f73ce,_0x1c2df0['options']);var _0x23d193={'where':_0x9f73ce[_0xd2f1('0x3a')]};return db[_0xd2f1('0x2b')][_0xd2f1('0x1c')](_0x23d193)[_0xd2f1('0x22')](function(_0x1fc2bd){_0x2f21f2[_0xd2f1('0x1c')]=_0x1fc2bd;if(_0x1c2df0[_0xd2f1('0x31')][_0xd2f1('0x3e')]){_0x9f73ce[_0xd2f1('0x3f')]=[{'all':!![]}];}return db[_0xd2f1('0x2b')][_0xd2f1('0x40')](_0x9f73ce);})[_0xd2f1('0x22')](function(_0x11168b){_0x2f21f2['rows']=_0x11168b;return _0x2f21f2;})[_0xd2f1('0x22')](respondWithFilteredResult(_0x5a82a8,_0x9f73ce))[_0xd2f1('0x41')](handleError(_0x5a82a8,null));};exports[_0xd2f1('0x42')]=function(_0x5e7407,_0x5be992){var _0x4a1339={'raw':![],'where':{'id':_0x5e7407[_0xd2f1('0x43')]['id']}},_0x14701a={};_0x14701a[_0xd2f1('0x30')]=_[_0xd2f1('0x44')](db['ZendeskConfiguration'][_0xd2f1('0x2c')]);_0x14701a[_0xd2f1('0x31')]=_[_0xd2f1('0x44')](_0x5e7407[_0xd2f1('0x31')]);_0x14701a[_0xd2f1('0x32')]=_[_0xd2f1('0x33')](_0x14701a[_0xd2f1('0x30')],_0x14701a[_0xd2f1('0x31')]);_0x4a1339[_0xd2f1('0x34')]=_['intersection'](_0x14701a['model'],qs[_0xd2f1('0x35')](_0x5e7407[_0xd2f1('0x31')][_0xd2f1('0x35')]));_0x4a1339[_0xd2f1('0x34')]=_0x4a1339[_0xd2f1('0x34')][_0xd2f1('0x36')]?_0x4a1339[_0xd2f1('0x34')]:_0x14701a[_0xd2f1('0x30')];if(_0x5e7407['query'][_0xd2f1('0x3e')]){_0x4a1339['include']=[{'all':!![]}];}_0x4a1339=_[_0xd2f1('0x3d')]({},_0x4a1339,_0x5e7407[_0xd2f1('0x45')]);return db[_0xd2f1('0x2b')]['find'](_0x4a1339)['then'](handleEntityNotFound(_0x5be992,null))[_0xd2f1('0x22')](respondWithResult(_0x5be992,null))[_0xd2f1('0x41')](handleError(_0x5be992,null));};exports[_0xd2f1('0x46')]=function(_0x581835,_0x1f9e21){return db[_0xd2f1('0x2b')][_0xd2f1('0x46')](_0x581835[_0xd2f1('0x47')],{})['then'](respondWithResult(_0x1f9e21,0xc9))[_0xd2f1('0x41')](handleError(_0x1f9e21,null));};exports[_0xd2f1('0x21')]=function(_0x5752f6,_0x5db84e){if(_0x5752f6[_0xd2f1('0x47')]['id']){delete _0x5752f6['body']['id'];}return db[_0xd2f1('0x2b')][_0xd2f1('0x48')]({'where':{'id':_0x5752f6['params']['id']}})[_0xd2f1('0x22')](handleEntityNotFound(_0x5db84e,null))['then'](saveUpdates(_0x5752f6[_0xd2f1('0x47')],null))['then'](respondWithResult(_0x5db84e,null))[_0xd2f1('0x41')](handleError(_0x5db84e,null));};exports[_0xd2f1('0x49')]=function(_0x9b6295,_0x2f818d){return db[_0xd2f1('0x2b')][_0xd2f1('0x48')]({'where':{'id':_0x9b6295[_0xd2f1('0x43')]['id']}})[_0xd2f1('0x22')](handleEntityNotFound(_0x2f818d,null))['then'](removeEntity(_0x2f818d,null))[_0xd2f1('0x41')](handleError(_0x2f818d,null));};exports[_0xd2f1('0x4a')]=function(_0x25665e,_0x4314ba,_0x4cf737){var _0x58b977={};var _0x4218f5={};var _0x19cd05;var _0x1ca7a2;return db[_0xd2f1('0x2b')]['findOne']({'where':{'id':_0x25665e[_0xd2f1('0x43')]['id']}})['then'](handleEntityNotFound(_0x4314ba,null))[_0xd2f1('0x22')](function(_0x7dc8a6){if(_0x7dc8a6){_0x19cd05=_0x7dc8a6;_0x4218f5[_0xd2f1('0x30')]=_[_0xd2f1('0x44')](db[_0xd2f1('0x4b')][_0xd2f1('0x2c')]);_0x4218f5['query']=_[_0xd2f1('0x44')](_0x25665e['query']);_0x4218f5['filters']=_[_0xd2f1('0x33')](_0x4218f5['model'],_0x4218f5[_0xd2f1('0x31')]);_0x58b977['attributes']=_[_0xd2f1('0x33')](_0x4218f5[_0xd2f1('0x30')],qs[_0xd2f1('0x35')](_0x25665e[_0xd2f1('0x31')][_0xd2f1('0x35')]));_0x58b977[_0xd2f1('0x34')]=_0x58b977[_0xd2f1('0x34')][_0xd2f1('0x36')]?_0x58b977[_0xd2f1('0x34')]:_0x4218f5[_0xd2f1('0x30')];_0x58b977[_0xd2f1('0x4c')]=qs[_0xd2f1('0x39')](_0x25665e['query'][_0xd2f1('0x39')]);_0x58b977[_0xd2f1('0x3a')]=qs[_0xd2f1('0x32')](_['pick'](_0x25665e[_0xd2f1('0x31')],_0x4218f5[_0xd2f1('0x32')]));if(_0x25665e[_0xd2f1('0x31')][_0xd2f1('0x3c')]){_0x58b977[_0xd2f1('0x3a')]=_[_0xd2f1('0x3d')](_0x58b977[_0xd2f1('0x3a')],{'$or':_[_0xd2f1('0x2a')](_0x58b977[_0xd2f1('0x34')],function(_0x1259e7){var _0x435565={};_0x435565[_0x1259e7]={'$like':'%'+_0x25665e[_0xd2f1('0x31')][_0xd2f1('0x3c')]+'%'};return _0x435565;})});}_0x58b977=_['merge']({},_0x58b977,_0x25665e['options']);return _0x19cd05['getFields'](_0x58b977);}})[_0xd2f1('0x22')](function(_0x41bbdc){if(_0x41bbdc){_0x1ca7a2=_0x41bbdc[_0xd2f1('0x36')];if(!_0x25665e['query'][_0xd2f1('0x37')](_0xd2f1('0x38'))){_0x58b977[_0xd2f1('0x1b')]=qs[_0xd2f1('0x1b')](_0x25665e[_0xd2f1('0x31')][_0xd2f1('0x1b')]);_0x58b977['offset']=qs[_0xd2f1('0x19')](_0x25665e[_0xd2f1('0x31')]['offset']);}return _0x19cd05[_0xd2f1('0x4a')](_0x58b977);}})[_0xd2f1('0x22')](function(_0x4f43f8){if(_0x4f43f8){return _0x4f43f8?{'count':_0x1ca7a2,'rows':_0x4f43f8}:null;}})['then'](respondWithResult(_0x4314ba,null))['catch'](handleError(_0x4314ba,null));};exports['getSubjects']=function(_0x349ced,_0x5e8e59,_0x3f0468){var _0x171f4d={};var _0x31b019={};var _0xd8c7d;var _0x3e2809;return db[_0xd2f1('0x2b')][_0xd2f1('0x4d')]({'where':{'id':_0x349ced[_0xd2f1('0x43')]['id']}})['then'](handleEntityNotFound(_0x5e8e59,null))['then'](function(_0x46c008){if(_0x46c008){_0xd8c7d=_0x46c008;_0x31b019[_0xd2f1('0x30')]=_[_0xd2f1('0x44')](db[_0xd2f1('0x4b')]['rawAttributes']);_0x31b019['query']=_[_0xd2f1('0x44')](_0x349ced[_0xd2f1('0x31')]);_0x31b019[_0xd2f1('0x32')]=_[_0xd2f1('0x33')](_0x31b019['model'],_0x31b019[_0xd2f1('0x31')]);_0x171f4d[_0xd2f1('0x34')]=_[_0xd2f1('0x33')](_0x31b019[_0xd2f1('0x30')],qs['fields'](_0x349ced['query'][_0xd2f1('0x35')]));_0x171f4d[_0xd2f1('0x34')]=_0x171f4d['attributes'][_0xd2f1('0x36')]?_0x171f4d[_0xd2f1('0x34')]:_0x31b019[_0xd2f1('0x30')];_0x171f4d[_0xd2f1('0x4c')]=qs[_0xd2f1('0x39')](_0x349ced[_0xd2f1('0x31')][_0xd2f1('0x39')]);_0x171f4d[_0xd2f1('0x3a')]=qs[_0xd2f1('0x32')](_[_0xd2f1('0x3b')](_0x349ced['query'],_0x31b019[_0xd2f1('0x32')]));if(_0x349ced[_0xd2f1('0x31')]['filter']){_0x171f4d[_0xd2f1('0x3a')]=_['merge'](_0x171f4d['where'],{'$or':_[_0xd2f1('0x2a')](_0x171f4d['attributes'],function(_0x2b9f41){var _0x308677={};_0x308677[_0x2b9f41]={'$like':'%'+_0x349ced[_0xd2f1('0x31')][_0xd2f1('0x3c')]+'%'};return _0x308677;})});}_0x171f4d=_['merge']({},_0x171f4d,_0x349ced[_0xd2f1('0x45')]);return _0xd8c7d[_0xd2f1('0x4e')](_0x171f4d);}})[_0xd2f1('0x22')](function(_0x2fa882){if(_0x2fa882){_0x3e2809=_0x2fa882[_0xd2f1('0x36')];if(!_0x349ced[_0xd2f1('0x31')]['hasOwnProperty']('nolimit')){_0x171f4d['limit']=qs[_0xd2f1('0x1b')](_0x349ced[_0xd2f1('0x31')][_0xd2f1('0x1b')]);_0x171f4d['offset']=qs['offset'](_0x349ced[_0xd2f1('0x31')]['offset']);}return _0xd8c7d[_0xd2f1('0x4e')](_0x171f4d);}})[_0xd2f1('0x22')](function(_0x4b3477){if(_0x4b3477){return _0x4b3477?{'count':_0x3e2809,'rows':_0x4b3477}:null;}})[_0xd2f1('0x22')](respondWithResult(_0x5e8e59,null))[_0xd2f1('0x41')](handleError(_0x5e8e59,null));};exports[_0xd2f1('0x4f')]=function(_0x2bcd2f,_0x5e0e60,_0x4d5b4f){var _0x74a595={};var _0x56c488={};var _0xbefd5d;var _0x5057c6;return db[_0xd2f1('0x2b')][_0xd2f1('0x4d')]({'where':{'id':_0x2bcd2f[_0xd2f1('0x43')]['id']}})[_0xd2f1('0x22')](handleEntityNotFound(_0x5e0e60,null))[_0xd2f1('0x22')](function(_0x4728c3){if(_0x4728c3){_0xbefd5d=_0x4728c3;_0x56c488[_0xd2f1('0x30')]=_[_0xd2f1('0x44')](db[_0xd2f1('0x4b')][_0xd2f1('0x2c')]);_0x56c488[_0xd2f1('0x31')]=_['keys'](_0x2bcd2f['query']);_0x56c488[_0xd2f1('0x32')]=_[_0xd2f1('0x33')](_0x56c488[_0xd2f1('0x30')],_0x56c488[_0xd2f1('0x31')]);_0x74a595[_0xd2f1('0x34')]=_[_0xd2f1('0x33')](_0x56c488[_0xd2f1('0x30')],qs[_0xd2f1('0x35')](_0x2bcd2f[_0xd2f1('0x31')][_0xd2f1('0x35')]));_0x74a595['attributes']=_0x74a595['attributes'][_0xd2f1('0x36')]?_0x74a595[_0xd2f1('0x34')]:_0x56c488[_0xd2f1('0x30')];_0x74a595[_0xd2f1('0x4c')]=qs[_0xd2f1('0x39')](_0x2bcd2f['query']['sort']);_0x74a595['where']=qs[_0xd2f1('0x32')](_['pick'](_0x2bcd2f[_0xd2f1('0x31')],_0x56c488[_0xd2f1('0x32')]));if(_0x2bcd2f[_0xd2f1('0x31')][_0xd2f1('0x3c')]){_0x74a595[_0xd2f1('0x3a')]=_[_0xd2f1('0x3d')](_0x74a595[_0xd2f1('0x3a')],{'$or':_['map'](_0x74a595[_0xd2f1('0x34')],function(_0x407404){var _0x101535={};_0x101535[_0x407404]={'$like':'%'+_0x2bcd2f[_0xd2f1('0x31')]['filter']+'%'};return _0x101535;})});}_0x74a595=_[_0xd2f1('0x3d')]({},_0x74a595,_0x2bcd2f[_0xd2f1('0x45')]);return _0xbefd5d['getDescriptions'](_0x74a595);}})['then'](function(_0x4d22ce){if(_0x4d22ce){_0x5057c6=_0x4d22ce[_0xd2f1('0x36')];if(!_0x2bcd2f[_0xd2f1('0x31')][_0xd2f1('0x37')](_0xd2f1('0x38'))){_0x74a595['limit']=qs[_0xd2f1('0x1b')](_0x2bcd2f[_0xd2f1('0x31')][_0xd2f1('0x1b')]);_0x74a595[_0xd2f1('0x19')]=qs[_0xd2f1('0x19')](_0x2bcd2f[_0xd2f1('0x31')][_0xd2f1('0x19')]);}return _0xbefd5d[_0xd2f1('0x4f')](_0x74a595);}})[_0xd2f1('0x22')](function(_0x2cead2){if(_0x2cead2){return _0x2cead2?{'count':_0x5057c6,'rows':_0x2cead2}:null;}})[_0xd2f1('0x22')](respondWithResult(_0x5e0e60,null))[_0xd2f1('0x41')](handleError(_0x5e0e60,null));};exports[_0xd2f1('0x50')]=function(_0x5f02cc,_0x2fdcd3,_0x3c18cf){var _0x50fd64={};var _0x5e86fb={};var _0x79707a;var _0x1c3f95;return db[_0xd2f1('0x2b')][_0xd2f1('0x4d')]({'where':{'id':_0x5f02cc[_0xd2f1('0x43')]['id']}})['then'](handleEntityNotFound(_0x2fdcd3,null))[_0xd2f1('0x22')](function(_0x383659){if(_0x383659){_0x79707a=_0x383659;_0x5e86fb[_0xd2f1('0x30')]=_[_0xd2f1('0x44')](db[_0xd2f1('0x51')][_0xd2f1('0x2c')]);_0x5e86fb[_0xd2f1('0x31')]=_[_0xd2f1('0x44')](_0x5f02cc[_0xd2f1('0x31')]);_0x5e86fb[_0xd2f1('0x32')]=_['intersection'](_0x5e86fb[_0xd2f1('0x30')],_0x5e86fb[_0xd2f1('0x31')]);_0x50fd64[_0xd2f1('0x34')]=_['intersection'](_0x5e86fb[_0xd2f1('0x30')],qs[_0xd2f1('0x35')](_0x5f02cc[_0xd2f1('0x31')]['fields']));_0x50fd64[_0xd2f1('0x34')]=_0x50fd64[_0xd2f1('0x34')]['length']?_0x50fd64[_0xd2f1('0x34')]:_0x5e86fb[_0xd2f1('0x30')];_0x50fd64[_0xd2f1('0x4c')]=qs[_0xd2f1('0x39')](_0x5f02cc[_0xd2f1('0x31')][_0xd2f1('0x39')]);_0x50fd64[_0xd2f1('0x3a')]=qs[_0xd2f1('0x32')](_['pick'](_0x5f02cc[_0xd2f1('0x31')],_0x5e86fb['filters']));if(_0x5f02cc['query'][_0xd2f1('0x3c')]){_0x50fd64[_0xd2f1('0x3a')]=_[_0xd2f1('0x3d')](_0x50fd64[_0xd2f1('0x3a')],{'$or':_['map'](_0x50fd64['attributes'],function(_0x4db789){var _0x3ce60d={};_0x3ce60d[_0x4db789]={'$like':'%'+_0x5f02cc['query'][_0xd2f1('0x3c')]+'%'};return _0x3ce60d;})});}_0x50fd64=_[_0xd2f1('0x3d')]({},_0x50fd64,_0x5f02cc['options']);return _0x79707a['getTags'](_0x50fd64);}})[_0xd2f1('0x22')](function(_0x15072a){if(_0x15072a){_0x1c3f95=_0x15072a[_0xd2f1('0x36')];if(!_0x5f02cc[_0xd2f1('0x31')][_0xd2f1('0x37')]('nolimit')){_0x50fd64[_0xd2f1('0x1b')]=qs['limit'](_0x5f02cc['query'][_0xd2f1('0x1b')]);_0x50fd64[_0xd2f1('0x19')]=qs[_0xd2f1('0x19')](_0x5f02cc[_0xd2f1('0x31')]['offset']);}return _0x79707a[_0xd2f1('0x50')](_0x50fd64);}})[_0xd2f1('0x22')](function(_0x173cca){if(_0x173cca){return _0x173cca?{'count':_0x1c3f95,'rows':_0x173cca}:null;}})[_0xd2f1('0x22')](respondWithResult(_0x2fdcd3,null))[_0xd2f1('0x41')](handleError(_0x2fdcd3,null));};exports['setTags']=function(_0xf0fbfd,_0x348601,_0x254d22){if(_0xf0fbfd[_0xd2f1('0x47')]['id']){delete _0xf0fbfd[_0xd2f1('0x47')]['id'];}return db[_0xd2f1('0x2b')]['findOne']({'where':{'id':_0xf0fbfd['params']['id']}})[_0xd2f1('0x22')](handleEntityNotFound(_0x348601,null))['then'](function(_0xb6c36b){if(_0xb6c36b){return _0xb6c36b[_0xd2f1('0x52')](_0xf0fbfd[_0xd2f1('0x47')][_0xd2f1('0x53')]||[]);}return null;})[_0xd2f1('0x22')](respondWithResult(_0x348601,null))[_0xd2f1('0x41')](handleError(_0x348601,null));};
\ No newline at end of file
index a1897ae..b247dd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d25=['api','moment','bluebird','request-promise','path','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger'];(function(_0x528fd5,_0x116c22){var _0x43f1f8=function(_0x4e2af8){while(--_0x4e2af8){_0x528fd5['push'](_0x528fd5['shift']());}};_0x43f1f8(++_0x116c22);}(_0x7d25,0x8a));var _0x57d2=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x7d25[_0x486f4a];return _0x135d99;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var logger=require(_0x57d2('0x1'))(_0x57d2('0x2'));var moment=require(_0x57d2('0x3'));var BPromise=require(_0x57d2('0x4'));var rp=require(_0x57d2('0x5'));var fs=require('fs');var path=require(_0x57d2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x3c5511,_0x49cc5f){return _0x3c5511[_0x57d2('0x7')](_0x57d2('0x8'),attributes,{'tableName':_0x57d2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa571=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x2ce7ab,_0x4323ea){var _0x4941c6=function(_0x189b92){while(--_0x189b92){_0x2ce7ab['push'](_0x2ce7ab['shift']());}};_0x4941c6(++_0x4323ea);}(_0xa571,0x107));var _0x1a57=function(_0x104dfa,_0x2112e7){_0x104dfa=_0x104dfa-0x0;var _0x5cb325=_0xa571[_0x104dfa];return _0x5cb325;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var logger=require(_0x1a57('0x2'))(_0x1a57('0x3'));var moment=require('moment');var BPromise=require(_0x1a57('0x4'));var rp=require(_0x1a57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a57('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x1a57('0x7')]=function(_0xd97a33,_0x22ca20){return _0xd97a33[_0x1a57('0x8')](_0x1a57('0x9'),attributes,{'tableName':_0x1a57('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2a2379d..c1687e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02b5=['ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x02b5,0xb1));var _0x502b=function(_0x42a986,_0x4d0f85){_0x42a986=_0x42a986-0x0;var _0x2dbbcf=_0x02b5[_0x42a986];return _0x2dbbcf;};'use strict';var _=require(_0x502b('0x0'));var util=require(_0x502b('0x1'));var moment=require(_0x502b('0x2'));var BPromise=require('bluebird');var rs=require(_0x502b('0x3'));var fs=require('fs');var Redis=require(_0x502b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x502b('0x5'));var logger=require(_0x502b('0x6'))(_0x502b('0x7'));var config=require(_0x502b('0x8'));var jayson=require(_0x502b('0x9'));var client=jayson[_0x502b('0xa')][_0x502b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53a4fb,_0x31b06e,_0x4526be){return new BPromise(function(_0x364ee0,_0x98cd70){return client[_0x502b('0xc')](_0x53a4fb,_0x4526be)[_0x502b('0xd')](function(_0x70e544){logger[_0x502b('0xe')](_0x502b('0xf'),_0x31b06e,_0x502b('0x10'));logger[_0x502b('0x11')](_0x502b('0x12'),_0x31b06e,_0x502b('0x10'),JSON[_0x502b('0x13')](_0x70e544));if(_0x70e544[_0x502b('0x14')]){if(_0x70e544[_0x502b('0x14')][_0x502b('0x15')]===0x1f4){logger[_0x502b('0x14')](_0x502b('0xf'),_0x31b06e,_0x70e544[_0x502b('0x14')][_0x502b('0x16')]);return _0x98cd70(_0x70e544[_0x502b('0x14')][_0x502b('0x16')]);}logger[_0x502b('0x14')]('ZendeskConfiguration,\x20%s,\x20%s',_0x31b06e,_0x70e544[_0x502b('0x14')][_0x502b('0x16')]);return _0x364ee0(_0x70e544[_0x502b('0x14')]['message']);}else{logger['info'](_0x502b('0xf'),_0x31b06e,_0x502b('0x10'));_0x364ee0(_0x70e544[_0x502b('0x17')][_0x502b('0x16')]);}})['catch'](function(_0x4251a4){logger[_0x502b('0x14')](_0x502b('0xf'),_0x31b06e,_0x4251a4);_0x98cd70(_0x4251a4);});});}
\ No newline at end of file
+var _0x4121=['../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x25948f,_0x13d169){var _0x28d63b=function(_0x4f22a3){while(--_0x4f22a3){_0x25948f['push'](_0x25948f['shift']());}};_0x28d63b(++_0x13d169);}(_0x4121,0xe3));var _0x1412=function(_0x2b18da,_0x23f3f3){_0x2b18da=_0x2b18da-0x0;var _0x1bcfa1=_0x4121[_0x2b18da];return _0x1bcfa1;};'use strict';var _=require(_0x1412('0x0'));var util=require('util');var moment=require(_0x1412('0x1'));var BPromise=require(_0x1412('0x2'));var rs=require(_0x1412('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1412('0x4'))['db'];var utils=require(_0x1412('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1412('0x6'));var client=jayson[_0x1412('0x7')][_0x1412('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43e7b1,_0x1cffd5,_0xd5a85f){return new BPromise(function(_0xb536a4,_0x7fe6b2){return client[_0x1412('0x9')](_0x43e7b1,_0xd5a85f)[_0x1412('0xa')](function(_0x1d3643){logger['info'](_0x1412('0xb'),_0x1cffd5,_0x1412('0xc'));logger[_0x1412('0xd')](_0x1412('0xe'),_0x1cffd5,'request\x20sent',JSON['stringify'](_0x1d3643));if(_0x1d3643[_0x1412('0xf')]){if(_0x1d3643[_0x1412('0xf')][_0x1412('0x10')]===0x1f4){logger['error'](_0x1412('0xb'),_0x1cffd5,_0x1d3643[_0x1412('0xf')][_0x1412('0x11')]);return _0x7fe6b2(_0x1d3643[_0x1412('0xf')][_0x1412('0x11')]);}logger['error'](_0x1412('0xb'),_0x1cffd5,_0x1d3643[_0x1412('0xf')][_0x1412('0x11')]);return _0xb536a4(_0x1d3643[_0x1412('0xf')][_0x1412('0x11')]);}else{logger[_0x1412('0x12')](_0x1412('0xb'),_0x1cffd5,'request\x20sent');_0xb536a4(_0x1d3643[_0x1412('0x13')][_0x1412('0x11')]);}})[_0x1412('0x14')](function(_0x2f9c89){logger[_0x1412('0xf')](_0x1412('0xb'),_0x1cffd5,_0x2f9c89);_0x7fe6b2(_0x2f9c89);});});}
\ No newline at end of file
index 81f6823..82de066 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d26=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','/:id','put','update','delete','destroy','exports','multer','util','path'];(function(_0x23e280,_0x394724){var _0x2e33bc=function(_0x3c7289){while(--_0x3c7289){_0x23e280['push'](_0x23e280['shift']());}};_0x2e33bc(++_0x394724);}(_0x7d26,0x85));var _0x67d2=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7d26[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x67d2('0x0'));var util=require(_0x67d2('0x1'));var path=require(_0x67d2('0x2'));var timeout=require(_0x67d2('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x67d2('0x4'));var auth=require(_0x67d2('0x5'));var interaction=require(_0x67d2('0x6'));var config=require(_0x67d2('0x7'));var controller=require(_0x67d2('0x8'));router['get']('/',auth[_0x67d2('0x9')](),controller[_0x67d2('0xa')]);router['get'](_0x67d2('0xb'),auth[_0x67d2('0x9')](),controller['show']);router['post']('/',auth[_0x67d2('0x9')](),controller['create']);router[_0x67d2('0xc')](_0x67d2('0xb'),auth[_0x67d2('0x9')](),controller[_0x67d2('0xd')]);router[_0x67d2('0xe')](_0x67d2('0xb'),auth[_0x67d2('0x9')](),controller[_0x67d2('0xf')]);module[_0x67d2('0x10')]=router;
\ No newline at end of file
+var _0xce03=['/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index'];(function(_0x6f1613,_0x3692f9){var _0xfa5b57=function(_0x5f5ab5){while(--_0x5f5ab5){_0x6f1613['push'](_0x6f1613['shift']());}};_0xfa5b57(++_0x3692f9);}(_0xce03,0x197));var _0x3ce0=function(_0x229781,_0x5c1de5){_0x229781=_0x229781-0x0;var _0x55f64d=_0xce03[_0x229781];return _0x55f64d;};'use strict';var multer=require(_0x3ce0('0x0'));var util=require(_0x3ce0('0x1'));var path=require(_0x3ce0('0x2'));var timeout=require('connect-timeout');var express=require(_0x3ce0('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3ce0('0x4'));var interaction=require(_0x3ce0('0x5'));var config=require(_0x3ce0('0x6'));var controller=require(_0x3ce0('0x7'));router[_0x3ce0('0x8')]('/',auth[_0x3ce0('0x9')](),controller[_0x3ce0('0xa')]);router[_0x3ce0('0x8')](_0x3ce0('0xb'),auth['isAuthenticated'](),controller[_0x3ce0('0xc')]);router['post']('/',auth[_0x3ce0('0x9')](),controller[_0x3ce0('0xd')]);router[_0x3ce0('0xe')]('/:id',auth[_0x3ce0('0x9')](),controller[_0x3ce0('0xf')]);router[_0x3ce0('0x10')](_0x3ce0('0xb'),auth[_0x3ce0('0x9')](),controller[_0x3ce0('0x11')]);module[_0x3ce0('0x12')]=router;
\ No newline at end of file
index 08d0a6a..b9cda10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94da=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x24b5c0,_0x2d80d1){var _0x15ee82=function(_0x3ee65e){while(--_0x3ee65e){_0x24b5c0['push'](_0x24b5c0['shift']());}};_0x15ee82(++_0x2d80d1);}(_0x94da,0x1bc));var _0xa94d=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x94da[_0x342700];return _0x53406f;};'use strict';var Sequelize=require(_0xa94d('0x0'));module[_0xa94d('0x1')]={'type':{'type':Sequelize[_0xa94d('0x2')](_0xa94d('0x3'),_0xa94d('0x4'),_0xa94d('0x5'),'keyValue',_0xa94d('0x6')),'defaultValue':_0xa94d('0x3')},'content':{'type':Sequelize[_0xa94d('0x7')]},'key':{'type':Sequelize[_0xa94d('0x7')]},'keyType':{'type':Sequelize[_0xa94d('0x2')]('string',_0xa94d('0x4'),_0xa94d('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa94d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2e52=['exports','ENUM','string','variable','keyValue','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e52,0x70));var _0x22e5=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x2e52[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require('sequelize');module[_0x22e5('0x0')]={'type':{'type':Sequelize[_0x22e5('0x1')](_0x22e5('0x2'),_0x22e5('0x3'),'customVariable',_0x22e5('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x22e5('0x5')]},'key':{'type':Sequelize[_0x22e5('0x5')]},'keyType':{'type':Sequelize[_0x22e5('0x1')](_0x22e5('0x2'),_0x22e5('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x22e5('0x5')]},'idField':{'type':Sequelize[_0x22e5('0x5')]},'nameField':{'type':Sequelize[_0x22e5('0x5')]},'customField':{'type':Sequelize[_0x22e5('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x22e5('0x5')]}};
\ No newline at end of file
index 2a8800b..bed10b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4435=['error','name','index','map','ZendeskField','rawAttributes','type','keys','intersection','model','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','length','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','then','destroy','end'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4435,0x136));var _0x5443=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x4435[_0x279d37];return _0x530173;};'use strict';var emlformat=require(_0x5443('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5443('0x1'));var jsonpatch=require(_0x5443('0x2'));var rp=require(_0x5443('0x3'));var moment=require(_0x5443('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5443('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5443('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5443('0x7'));var _=require(_0x5443('0x8'));var squel=require(_0x5443('0x9'));var crypto=require(_0x5443('0xa'));var jsforce=require(_0x5443('0xb'));var deskjs=require(_0x5443('0xc'));var toCsv=require(_0x5443('0xd'));var querystring=require(_0x5443('0xe'));var Papa=require(_0x5443('0xf'));var Redis=require(_0x5443('0x10'));var authService=require(_0x5443('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5443('0x12'));var hardwareService=require(_0x5443('0x13'));var logger=require(_0x5443('0x14'))(_0x5443('0x15'));var utils=require(_0x5443('0x16'));var config=require(_0x5443('0x17'));var licenseUtil=require(_0x5443('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a8b82,_0x39d89f){_0x39d89f=_0x39d89f||0xcc;return function(_0x33eb1b){if(_0x33eb1b){return _0x5a8b82[_0x5443('0x19')](_0x39d89f);}return _0x5a8b82[_0x5443('0x1a')](_0x39d89f)['end']();};}function respondWithResult(_0x458653,_0x40f127){_0x40f127=_0x40f127||0xc8;return function(_0x200ab0){if(_0x200ab0){return _0x458653[_0x5443('0x1a')](_0x40f127)[_0x5443('0x1b')](_0x200ab0);}};}function respondWithFilteredResult(_0xa5d866,_0x596ad5){return function(_0x353d5b){if(_0x353d5b){var _0xabf210=typeof _0x596ad5['offset']===_0x5443('0x1c')&&typeof _0x596ad5[_0x5443('0x1d')]===_0x5443('0x1c');var _0x16b4cf=_0x353d5b[_0x5443('0x1e')];var _0x265fd3=_0xabf210?0x0:_0x596ad5[_0x5443('0x1f')];var _0x1cbbc5=_0xabf210?_0x353d5b[_0x5443('0x1e')]:_0x596ad5[_0x5443('0x1f')]+_0x596ad5['limit'];var _0x4ade5e;if(_0x1cbbc5>=_0x16b4cf){_0x1cbbc5=_0x16b4cf;_0x4ade5e=0xc8;}else{_0x4ade5e=0xce;}_0xa5d866['status'](_0x4ade5e);return _0xa5d866['set']('Content-Range',_0x265fd3+'-'+_0x1cbbc5+'/'+_0x16b4cf)[_0x5443('0x1b')](_0x353d5b);}return null;};}function patchUpdates(_0x7b888e){return function(_0x504355){try{jsonpatch['apply'](_0x504355,_0x7b888e,!![]);}catch(_0x317c3d){return BPromise['reject'](_0x317c3d);}return _0x504355['save']();};}function saveUpdates(_0x3b263d,_0x54469a){return function(_0x4f7639){if(_0x4f7639){return _0x4f7639['update'](_0x3b263d)[_0x5443('0x20')](function(_0x3654d6){return _0x3654d6;});}return null;};}function removeEntity(_0x12169d,_0x45c44f){return function(_0x25c872){if(_0x25c872){return _0x25c872[_0x5443('0x21')]()['then'](function(){_0x12169d[_0x5443('0x1a')](0xcc)[_0x5443('0x22')]();});}};}function handleEntityNotFound(_0x3df8e3,_0x2be132){return function(_0x202609){if(!_0x202609){_0x3df8e3[_0x5443('0x19')](0x194);}return _0x202609;};}function handleError(_0x5511ce,_0x22b90b){_0x22b90b=_0x22b90b||0x1f4;return function(_0x39acf5){logger[_0x5443('0x23')](_0x39acf5['stack']);if(_0x39acf5[_0x5443('0x24')]){delete _0x39acf5[_0x5443('0x24')];}_0x5511ce[_0x5443('0x1a')](_0x22b90b)['send'](_0x39acf5);};}exports[_0x5443('0x25')]=function(_0x3ceb79,_0x5cc13c){var _0x40c070={},_0x114818={},_0x10445f={'count':0x0,'rows':[]};var _0x444522=_[_0x5443('0x26')](db[_0x5443('0x27')][_0x5443('0x28')],function(_0x1d3879){return{'name':_0x1d3879['fieldName'],'type':_0x1d3879[_0x5443('0x29')]['key']};});_0x114818['model']=_[_0x5443('0x26')](_0x444522,_0x5443('0x24'));_0x114818['query']=_[_0x5443('0x2a')](_0x3ceb79['query']);_0x114818['filters']=_[_0x5443('0x2b')](_0x114818[_0x5443('0x2c')],_0x114818['query']);_0x40c070['attributes']=_['intersection'](_0x114818['model'],qs['fields'](_0x3ceb79[_0x5443('0x2d')][_0x5443('0x2e')]));_0x40c070[_0x5443('0x2f')]=_0x40c070[_0x5443('0x2f')]['length']?_0x40c070['attributes']:_0x114818['model'];if(!_0x3ceb79['query'][_0x5443('0x30')](_0x5443('0x31'))){_0x40c070[_0x5443('0x1d')]=qs[_0x5443('0x1d')](_0x3ceb79[_0x5443('0x2d')][_0x5443('0x1d')]);_0x40c070[_0x5443('0x1f')]=qs[_0x5443('0x1f')](_0x3ceb79[_0x5443('0x2d')][_0x5443('0x1f')]);}_0x40c070[_0x5443('0x32')]=qs[_0x5443('0x33')](_0x3ceb79[_0x5443('0x2d')][_0x5443('0x33')]);_0x40c070[_0x5443('0x34')]=qs[_0x5443('0x35')](_[_0x5443('0x36')](_0x3ceb79[_0x5443('0x2d')],_0x114818[_0x5443('0x35')]),_0x444522);if(_0x3ceb79[_0x5443('0x2d')]['filter']){_0x40c070['where']=_[_0x5443('0x37')](_0x40c070['where'],{'$or':_[_0x5443('0x26')](_0x444522,function(_0x2988aa){if(_0x2988aa[_0x5443('0x29')]!==_0x5443('0x38')){var _0x274622={};_0x274622[_0x2988aa['name']]={'$like':'%'+_0x3ceb79[_0x5443('0x2d')][_0x5443('0x39')]+'%'};return _0x274622;}})});}_0x40c070=_[_0x5443('0x37')]({},_0x40c070,_0x3ceb79[_0x5443('0x3a')]);var _0x51489={'where':_0x40c070[_0x5443('0x34')]};return db[_0x5443('0x27')]['count'](_0x51489)[_0x5443('0x20')](function(_0x3ac014){_0x10445f[_0x5443('0x1e')]=_0x3ac014;if(_0x3ceb79[_0x5443('0x2d')][_0x5443('0x3b')]){_0x40c070['include']=[{'all':!![]}];}return db[_0x5443('0x27')][_0x5443('0x3c')](_0x40c070);})['then'](function(_0x428f71){_0x10445f[_0x5443('0x3d')]=_0x428f71;return _0x10445f;})[_0x5443('0x20')](respondWithFilteredResult(_0x5cc13c,_0x40c070))[_0x5443('0x3e')](handleError(_0x5cc13c,null));};exports[_0x5443('0x3f')]=function(_0x3e4670,_0xdc44bf){var _0x2ee404={'raw':!![],'where':{'id':_0x3e4670[_0x5443('0x40')]['id']}},_0x1224c0={};_0x1224c0['model']=_[_0x5443('0x2a')](db[_0x5443('0x27')][_0x5443('0x28')]);_0x1224c0[_0x5443('0x2d')]=_[_0x5443('0x2a')](_0x3e4670[_0x5443('0x2d')]);_0x1224c0[_0x5443('0x35')]=_['intersection'](_0x1224c0[_0x5443('0x2c')],_0x1224c0[_0x5443('0x2d')]);_0x2ee404[_0x5443('0x2f')]=_[_0x5443('0x2b')](_0x1224c0[_0x5443('0x2c')],qs[_0x5443('0x2e')](_0x3e4670[_0x5443('0x2d')][_0x5443('0x2e')]));_0x2ee404[_0x5443('0x2f')]=_0x2ee404[_0x5443('0x2f')][_0x5443('0x41')]?_0x2ee404['attributes']:_0x1224c0['model'];if(_0x3e4670[_0x5443('0x2d')]['includeAll']){_0x2ee404['include']=[{'all':!![]}];}_0x2ee404=_[_0x5443('0x37')]({},_0x2ee404,_0x3e4670[_0x5443('0x3a')]);return db['ZendeskField'][_0x5443('0x42')](_0x2ee404)[_0x5443('0x20')](handleEntityNotFound(_0xdc44bf,null))[_0x5443('0x20')](respondWithResult(_0xdc44bf,null))[_0x5443('0x3e')](handleError(_0xdc44bf,null));};exports[_0x5443('0x43')]=function(_0x535081,_0x2ee459){return db[_0x5443('0x27')][_0x5443('0x43')](_0x535081[_0x5443('0x44')],{})[_0x5443('0x20')](respondWithResult(_0x2ee459,0xc9))[_0x5443('0x3e')](handleError(_0x2ee459,null));};exports['update']=function(_0x8f51ac,_0x367de1){if(_0x8f51ac[_0x5443('0x44')]['id']){delete _0x8f51ac[_0x5443('0x44')]['id'];}return db[_0x5443('0x27')]['find']({'where':{'id':_0x8f51ac[_0x5443('0x40')]['id']}})['then'](handleEntityNotFound(_0x367de1,null))[_0x5443('0x20')](saveUpdates(_0x8f51ac[_0x5443('0x44')],null))['then'](respondWithResult(_0x367de1,null))[_0x5443('0x3e')](handleError(_0x367de1,null));};exports[_0x5443('0x21')]=function(_0x5e2499,_0x55eb3b){return db['ZendeskField'][_0x5443('0x42')]({'where':{'id':_0x5e2499[_0x5443('0x40')]['id']}})[_0x5443('0x20')](handleEntityNotFound(_0x55eb3b,null))['then'](removeEntity(_0x55eb3b,null))[_0x5443('0x3e')](handleError(_0x55eb3b,null));};
\ No newline at end of file
+var _0xc298=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','ZendeskField','includeAll','include','findAll','catch','show','params','length','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','error','name','send','index','map','rawAttributes','type','key','query','keys','intersection','model'];(function(_0xe62388,_0x20a8dc){var _0x364a83=function(_0x3c3718){while(--_0x3c3718){_0xe62388['push'](_0xe62388['shift']());}};_0x364a83(++_0x20a8dc);}(_0xc298,0x143));var _0x8c29=function(_0x151b2a,_0x2b88b8){_0x151b2a=_0x151b2a-0x0;var _0x5c2c04=_0xc298[_0x151b2a];return _0x5c2c04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c29('0x0'));var zipdir=require(_0x8c29('0x1'));var jsonpatch=require(_0x8c29('0x2'));var rp=require(_0x8c29('0x3'));var moment=require(_0x8c29('0x4'));var BPromise=require(_0x8c29('0x5'));var Mustache=require('mustache');var util=require(_0x8c29('0x6'));var path=require(_0x8c29('0x7'));var sox=require(_0x8c29('0x8'));var csv=require(_0x8c29('0x9'));var ejs=require(_0x8c29('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8c29('0xb'));var squel=require(_0x8c29('0xc'));var crypto=require(_0x8c29('0xd'));var jsforce=require(_0x8c29('0xe'));var deskjs=require(_0x8c29('0xf'));var toCsv=require(_0x8c29('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8c29('0x10'));var qs=require(_0x8c29('0x11'));var as=require(_0x8c29('0x12'));var hardwareService=require(_0x8c29('0x13'));var logger=require(_0x8c29('0x14'))(_0x8c29('0x15'));var utils=require(_0x8c29('0x16'));var config=require(_0x8c29('0x17'));var licenseUtil=require(_0x8c29('0x18'));var db=require(_0x8c29('0x19'))['db'];function respondWithStatusCode(_0xd82e60,_0x1dc424){_0x1dc424=_0x1dc424||0xcc;return function(_0x3023d2){if(_0x3023d2){return _0xd82e60[_0x8c29('0x1a')](_0x1dc424);}return _0xd82e60[_0x8c29('0x1b')](_0x1dc424)[_0x8c29('0x1c')]();};}function respondWithResult(_0x5a9eb8,_0x3dc480){_0x3dc480=_0x3dc480||0xc8;return function(_0xcdae4d){if(_0xcdae4d){return _0x5a9eb8['status'](_0x3dc480)['json'](_0xcdae4d);}};}function respondWithFilteredResult(_0x17d84b,_0xe87c50){return function(_0x4929b9){if(_0x4929b9){var _0x24add4=typeof _0xe87c50[_0x8c29('0x1d')]===_0x8c29('0x1e')&&typeof _0xe87c50['limit']===_0x8c29('0x1e');var _0x37fc8e=_0x4929b9[_0x8c29('0x1f')];var _0x6324b8=_0x24add4?0x0:_0xe87c50[_0x8c29('0x1d')];var _0x21ada9=_0x24add4?_0x4929b9['count']:_0xe87c50[_0x8c29('0x1d')]+_0xe87c50[_0x8c29('0x20')];var _0x41e389;if(_0x21ada9>=_0x37fc8e){_0x21ada9=_0x37fc8e;_0x41e389=0xc8;}else{_0x41e389=0xce;}_0x17d84b[_0x8c29('0x1b')](_0x41e389);return _0x17d84b[_0x8c29('0x21')](_0x8c29('0x22'),_0x6324b8+'-'+_0x21ada9+'/'+_0x37fc8e)[_0x8c29('0x23')](_0x4929b9);}return null;};}function patchUpdates(_0x10810c){return function(_0x5c62a0){try{jsonpatch['apply'](_0x5c62a0,_0x10810c,!![]);}catch(_0x2702a1){return BPromise[_0x8c29('0x24')](_0x2702a1);}return _0x5c62a0[_0x8c29('0x25')]();};}function saveUpdates(_0x513efd,_0x5a61f3){return function(_0x3fb320){if(_0x3fb320){return _0x3fb320[_0x8c29('0x26')](_0x513efd)[_0x8c29('0x27')](function(_0x157e61){return _0x157e61;});}return null;};}function removeEntity(_0x34cf21,_0x507124){return function(_0x40431d){if(_0x40431d){return _0x40431d['destroy']()[_0x8c29('0x27')](function(){_0x34cf21['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c7979,_0x376297){return function(_0x3a967d){if(!_0x3a967d){_0x2c7979['sendStatus'](0x194);}return _0x3a967d;};}function handleError(_0x38a45c,_0x4e0066){_0x4e0066=_0x4e0066||0x1f4;return function(_0x5cd1e7){logger[_0x8c29('0x28')](_0x5cd1e7['stack']);if(_0x5cd1e7[_0x8c29('0x29')]){delete _0x5cd1e7[_0x8c29('0x29')];}_0x38a45c['status'](_0x4e0066)[_0x8c29('0x2a')](_0x5cd1e7);};}exports[_0x8c29('0x2b')]=function(_0x4eee54,_0x2c6ae1){var _0x5dd93a={},_0x48996c={},_0x25f26a={'count':0x0,'rows':[]};var _0x20e42f=_[_0x8c29('0x2c')](db['ZendeskField'][_0x8c29('0x2d')],function(_0xde770a){return{'name':_0xde770a['fieldName'],'type':_0xde770a[_0x8c29('0x2e')][_0x8c29('0x2f')]};});_0x48996c['model']=_[_0x8c29('0x2c')](_0x20e42f,_0x8c29('0x29'));_0x48996c[_0x8c29('0x30')]=_[_0x8c29('0x31')](_0x4eee54[_0x8c29('0x30')]);_0x48996c['filters']=_[_0x8c29('0x32')](_0x48996c[_0x8c29('0x33')],_0x48996c[_0x8c29('0x30')]);_0x5dd93a[_0x8c29('0x34')]=_[_0x8c29('0x32')](_0x48996c[_0x8c29('0x33')],qs[_0x8c29('0x35')](_0x4eee54['query'][_0x8c29('0x35')]));_0x5dd93a[_0x8c29('0x34')]=_0x5dd93a[_0x8c29('0x34')]['length']?_0x5dd93a[_0x8c29('0x34')]:_0x48996c[_0x8c29('0x33')];if(!_0x4eee54['query'][_0x8c29('0x36')](_0x8c29('0x37'))){_0x5dd93a['limit']=qs[_0x8c29('0x20')](_0x4eee54[_0x8c29('0x30')][_0x8c29('0x20')]);_0x5dd93a[_0x8c29('0x1d')]=qs['offset'](_0x4eee54[_0x8c29('0x30')][_0x8c29('0x1d')]);}_0x5dd93a[_0x8c29('0x38')]=qs[_0x8c29('0x39')](_0x4eee54[_0x8c29('0x30')]['sort']);_0x5dd93a[_0x8c29('0x3a')]=qs[_0x8c29('0x3b')](_[_0x8c29('0x3c')](_0x4eee54[_0x8c29('0x30')],_0x48996c[_0x8c29('0x3b')]),_0x20e42f);if(_0x4eee54[_0x8c29('0x30')][_0x8c29('0x3d')]){_0x5dd93a[_0x8c29('0x3a')]=_[_0x8c29('0x3e')](_0x5dd93a[_0x8c29('0x3a')],{'$or':_['map'](_0x20e42f,function(_0x351628){if(_0x351628[_0x8c29('0x2e')]!=='VIRTUAL'){var _0x426335={};_0x426335[_0x351628[_0x8c29('0x29')]]={'$like':'%'+_0x4eee54[_0x8c29('0x30')]['filter']+'%'};return _0x426335;}})});}_0x5dd93a=_[_0x8c29('0x3e')]({},_0x5dd93a,_0x4eee54[_0x8c29('0x3f')]);var _0x507aea={'where':_0x5dd93a[_0x8c29('0x3a')]};return db[_0x8c29('0x40')][_0x8c29('0x1f')](_0x507aea)[_0x8c29('0x27')](function(_0x313111){_0x25f26a['count']=_0x313111;if(_0x4eee54[_0x8c29('0x30')][_0x8c29('0x41')]){_0x5dd93a[_0x8c29('0x42')]=[{'all':!![]}];}return db[_0x8c29('0x40')][_0x8c29('0x43')](_0x5dd93a);})[_0x8c29('0x27')](function(_0x187da3){_0x25f26a['rows']=_0x187da3;return _0x25f26a;})[_0x8c29('0x27')](respondWithFilteredResult(_0x2c6ae1,_0x5dd93a))[_0x8c29('0x44')](handleError(_0x2c6ae1,null));};exports[_0x8c29('0x45')]=function(_0x258d4e,_0x5910ff){var _0x59faaf={'raw':!![],'where':{'id':_0x258d4e[_0x8c29('0x46')]['id']}},_0x127ad1={};_0x127ad1['model']=_[_0x8c29('0x31')](db[_0x8c29('0x40')][_0x8c29('0x2d')]);_0x127ad1[_0x8c29('0x30')]=_[_0x8c29('0x31')](_0x258d4e['query']);_0x127ad1[_0x8c29('0x3b')]=_['intersection'](_0x127ad1['model'],_0x127ad1['query']);_0x59faaf[_0x8c29('0x34')]=_[_0x8c29('0x32')](_0x127ad1[_0x8c29('0x33')],qs['fields'](_0x258d4e[_0x8c29('0x30')][_0x8c29('0x35')]));_0x59faaf['attributes']=_0x59faaf[_0x8c29('0x34')][_0x8c29('0x47')]?_0x59faaf[_0x8c29('0x34')]:_0x127ad1[_0x8c29('0x33')];if(_0x258d4e['query']['includeAll']){_0x59faaf['include']=[{'all':!![]}];}_0x59faaf=_[_0x8c29('0x3e')]({},_0x59faaf,_0x258d4e[_0x8c29('0x3f')]);return db['ZendeskField']['find'](_0x59faaf)[_0x8c29('0x27')](handleEntityNotFound(_0x5910ff,null))[_0x8c29('0x27')](respondWithResult(_0x5910ff,null))[_0x8c29('0x44')](handleError(_0x5910ff,null));};exports[_0x8c29('0x48')]=function(_0x3d3467,_0x2bb16f){return db[_0x8c29('0x40')]['create'](_0x3d3467[_0x8c29('0x49')],{})[_0x8c29('0x27')](respondWithResult(_0x2bb16f,0xc9))[_0x8c29('0x44')](handleError(_0x2bb16f,null));};exports[_0x8c29('0x26')]=function(_0x1ba6e2,_0x577459){if(_0x1ba6e2[_0x8c29('0x49')]['id']){delete _0x1ba6e2[_0x8c29('0x49')]['id'];}return db[_0x8c29('0x40')]['find']({'where':{'id':_0x1ba6e2[_0x8c29('0x46')]['id']}})[_0x8c29('0x27')](handleEntityNotFound(_0x577459,null))[_0x8c29('0x27')](saveUpdates(_0x1ba6e2[_0x8c29('0x49')],null))[_0x8c29('0x27')](respondWithResult(_0x577459,null))['catch'](handleError(_0x577459,null));};exports[_0x8c29('0x4a')]=function(_0x11b351,_0x4762c1){return db['ZendeskField']['find']({'where':{'id':_0x11b351[_0x8c29('0x46')]['id']}})[_0x8c29('0x27')](handleEntityNotFound(_0x4762c1,null))[_0x8c29('0x27')](removeEntity(_0x4762c1,null))[_0x8c29('0x44')](handleError(_0x4762c1,null));};
\ No newline at end of file
index 9638e18..44f911b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4544=['../../config/environment','define','ZendeskField','int_zendesk_fields','idField','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4544,0x1e5));var _0x4454=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x4544[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x4454('0x0'));var util=require(_0x4454('0x1'));var logger=require(_0x4454('0x2'))(_0x4454('0x3'));var moment=require('moment');var BPromise=require(_0x4454('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4454('0x5'));var rimraf=require(_0x4454('0x6'));var config=require(_0x4454('0x7'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x11c5f3,_0x471f07){return _0x11c5f3[_0x4454('0x8')](_0x4454('0x9'),attributes,{'tableName':_0x4454('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x4454('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb82b=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields'];(function(_0x4279e1,_0x39cda4){var _0x1e33ea=function(_0x5b00ea){while(--_0x5b00ea){_0x4279e1['push'](_0x4279e1['shift']());}};_0x1e33ea(++_0x39cda4);}(_0xb82b,0x13d));var _0xbb82=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb82b[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xbb82('0x0'));var util=require(_0xbb82('0x1'));var logger=require(_0xbb82('0x2'))(_0xbb82('0x3'));var moment=require(_0xbb82('0x4'));var BPromise=require(_0xbb82('0x5'));var rp=require(_0xbb82('0x6'));var fs=require('fs');var path=require(_0xbb82('0x7'));var rimraf=require(_0xbb82('0x8'));var config=require('../../config/environment');var attributes=require(_0xbb82('0x9'));module['exports']=function(_0xed431b,_0x13cbdb){return _0xed431b[_0xbb82('0xa')](_0xbb82('0xb'),attributes,{'tableName':_0xbb82('0xc'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xbb82('0xd'),_0xbb82('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 813e3ba..775be84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8461=['lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x51e947,_0x121e08){var _0x399603=function(_0x5be13d){while(--_0x5be13d){_0x51e947['push'](_0x51e947['shift']());}};_0x399603(++_0x121e08);}(_0x8461,0x1cc));var _0x1846=function(_0x52d9dc,_0x4465ad){_0x52d9dc=_0x52d9dc-0x0;var _0x55dfa8=_0x8461[_0x52d9dc];return _0x55dfa8;};'use strict';var _=require(_0x1846('0x0'));var util=require('util');var moment=require(_0x1846('0x1'));var BPromise=require('bluebird');var rs=require(_0x1846('0x2'));var fs=require('fs');var Redis=require(_0x1846('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1846('0x4'))(_0x1846('0x5'));var config=require(_0x1846('0x6'));var jayson=require(_0x1846('0x7'));var client=jayson['client'][_0x1846('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42648e,_0x58c17f,_0x3fc383){return new BPromise(function(_0x3f0424,_0x1aef09){return client[_0x1846('0x9')](_0x42648e,_0x3fc383)[_0x1846('0xa')](function(_0x7a0b57){logger[_0x1846('0xb')](_0x1846('0xc'),_0x58c17f,'request\x20sent');logger[_0x1846('0xd')](_0x1846('0xe'),_0x58c17f,_0x1846('0xf'),JSON[_0x1846('0x10')](_0x7a0b57));if(_0x7a0b57[_0x1846('0x11')]){if(_0x7a0b57[_0x1846('0x11')][_0x1846('0x12')]===0x1f4){logger[_0x1846('0x11')]('ZendeskField,\x20%s,\x20%s',_0x58c17f,_0x7a0b57['error'][_0x1846('0x13')]);return _0x1aef09(_0x7a0b57[_0x1846('0x11')][_0x1846('0x13')]);}logger[_0x1846('0x11')]('ZendeskField,\x20%s,\x20%s',_0x58c17f,_0x7a0b57[_0x1846('0x11')][_0x1846('0x13')]);return _0x3f0424(_0x7a0b57[_0x1846('0x11')][_0x1846('0x13')]);}else{logger[_0x1846('0xb')](_0x1846('0xc'),_0x58c17f,_0x1846('0xf'));_0x3f0424(_0x7a0b57['result'][_0x1846('0x13')]);}})['catch'](function(_0x384c7e){logger['error'](_0x1846('0xc'),_0x58c17f,_0x384c7e);_0x1aef09(_0x384c7e);});});}
\ No newline at end of file
+var _0xc756=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2ed0a4,_0x1a41e6){var _0x22e433=function(_0x571e43){while(--_0x571e43){_0x2ed0a4['push'](_0x2ed0a4['shift']());}};_0x22e433(++_0x1a41e6);}(_0xc756,0x8f));var _0x6c75=function(_0x3e4d8b,_0x1a7388){_0x3e4d8b=_0x3e4d8b-0x0;var _0x12d424=_0xc756[_0x3e4d8b];return _0x12d424;};'use strict';var _=require(_0x6c75('0x0'));var util=require(_0x6c75('0x1'));var moment=require(_0x6c75('0x2'));var BPromise=require(_0x6c75('0x3'));var rs=require(_0x6c75('0x4'));var fs=require('fs');var Redis=require(_0x6c75('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c75('0x6'));var logger=require('../../config/logger')(_0x6c75('0x7'));var config=require(_0x6c75('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6c75('0x9')][_0x6c75('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c4de7,_0x118698,_0x4934a5){return new BPromise(function(_0x53e0f9,_0x390583){return client[_0x6c75('0xb')](_0x3c4de7,_0x4934a5)['then'](function(_0xf02c18){logger[_0x6c75('0xc')](_0x6c75('0xd'),_0x118698,_0x6c75('0xe'));logger['debug'](_0x6c75('0xf'),_0x118698,_0x6c75('0xe'),JSON[_0x6c75('0x10')](_0xf02c18));if(_0xf02c18['error']){if(_0xf02c18[_0x6c75('0x11')]['code']===0x1f4){logger[_0x6c75('0x11')](_0x6c75('0xd'),_0x118698,_0xf02c18[_0x6c75('0x11')][_0x6c75('0x12')]);return _0x390583(_0xf02c18['error'][_0x6c75('0x12')]);}logger[_0x6c75('0x11')]('ZendeskField,\x20%s,\x20%s',_0x118698,_0xf02c18[_0x6c75('0x11')][_0x6c75('0x12')]);return _0x53e0f9(_0xf02c18[_0x6c75('0x11')][_0x6c75('0x12')]);}else{logger[_0x6c75('0xc')](_0x6c75('0xd'),_0x118698,_0x6c75('0xe'));_0x53e0f9(_0xf02c18[_0x6c75('0x13')][_0x6c75('0x12')]);}})[_0x6c75('0x14')](function(_0x5b1b60){logger['error']('ZendeskField,\x20%s,\x20%s',_0x118698,_0x5b1b60);_0x390583(_0x5b1b60);});});}
\ No newline at end of file
index 36ca90c..0ed0a2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb422=['show','/:id/configurations','getConfigurations','getFields','create','addConfiguration','put','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x891b81,_0xfbb107){var _0x585932=function(_0x18e04d){while(--_0x18e04d){_0x891b81['push'](_0x891b81['shift']());}};_0x585932(++_0xfbb107);}(_0xb422,0x17a));var _0x2b42=function(_0x3b5d0a,_0x35b8cb){_0x3b5d0a=_0x3b5d0a-0x0;var _0x5c9765=_0xb422[_0x3b5d0a];return _0x5c9765;};'use strict';var multer=require(_0x2b42('0x0'));var util=require(_0x2b42('0x1'));var path=require('path');var timeout=require(_0x2b42('0x2'));var express=require('express');var router=express[_0x2b42('0x3')]();var fs_extra=require(_0x2b42('0x4'));var auth=require(_0x2b42('0x5'));var interaction=require(_0x2b42('0x6'));var config=require(_0x2b42('0x7'));var controller=require(_0x2b42('0x8'));router[_0x2b42('0x9')]('/',auth[_0x2b42('0xa')](),controller[_0x2b42('0xb')]);router[_0x2b42('0x9')](_0x2b42('0xc'),auth[_0x2b42('0xa')](),controller[_0x2b42('0xd')]);router['get'](_0x2b42('0xe'),auth[_0x2b42('0xa')](),controller[_0x2b42('0xf')]);router['get']('/:id/fields',auth[_0x2b42('0xa')](),controller[_0x2b42('0x10')]);router['post']('/',auth[_0x2b42('0xa')](),controller[_0x2b42('0x11')]);router['post']('/:id/configurations',auth[_0x2b42('0xa')](),controller[_0x2b42('0x12')]);router[_0x2b42('0x13')](_0x2b42('0xc'),auth[_0x2b42('0xa')](),controller[_0x2b42('0x14')]);router[_0x2b42('0x15')](_0x2b42('0xc'),auth[_0x2b42('0xa')](),controller[_0x2b42('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xbd2c=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete'];(function(_0x4fbbf4,_0x3e9cf1){var _0x2d459c=function(_0x56778e){while(--_0x56778e){_0x4fbbf4['push'](_0x4fbbf4['shift']());}};_0x2d459c(++_0x3e9cf1);}(_0xbd2c,0x1c3));var _0xcbd2=function(_0x517b82,_0x371451){_0x517b82=_0x517b82-0x0;var _0x5bcddd=_0xbd2c[_0x517b82];return _0x5bcddd;};'use strict';var multer=require(_0xcbd2('0x0'));var util=require('util');var path=require(_0xcbd2('0x1'));var timeout=require(_0xcbd2('0x2'));var express=require(_0xcbd2('0x3'));var router=express[_0xcbd2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcbd2('0x5'));var interaction=require(_0xcbd2('0x6'));var config=require(_0xcbd2('0x7'));var controller=require(_0xcbd2('0x8'));router[_0xcbd2('0x9')]('/',auth['isAuthenticated'](),controller[_0xcbd2('0xa')]);router[_0xcbd2('0x9')]('/:id',auth[_0xcbd2('0xb')](),controller[_0xcbd2('0xc')]);router[_0xcbd2('0x9')](_0xcbd2('0xd'),auth[_0xcbd2('0xb')](),controller[_0xcbd2('0xe')]);router[_0xcbd2('0x9')](_0xcbd2('0xf'),auth[_0xcbd2('0xb')](),controller[_0xcbd2('0x10')]);router[_0xcbd2('0x11')]('/',auth[_0xcbd2('0xb')](),controller[_0xcbd2('0x12')]);router[_0xcbd2('0x11')](_0xcbd2('0xd'),auth[_0xcbd2('0xb')](),controller[_0xcbd2('0x13')]);router[_0xcbd2('0x14')](_0xcbd2('0x15'),auth[_0xcbd2('0xb')](),controller[_0xcbd2('0x16')]);router[_0xcbd2('0x17')](_0xcbd2('0x15'),auth['isAuthenticated'](),controller['destroy']);module[_0xcbd2('0x18')]=router;
\ No newline at end of file
index 1b8292e..e24aa8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2750=['STRING','sequelize'];(function(_0x288325,_0x26e4ff){var _0x3b9fd7=function(_0x1f2816){while(--_0x1f2816){_0x288325['push'](_0x288325['shift']());}};_0x3b9fd7(++_0x26e4ff);}(_0x2750,0x13b));var _0x0275=function(_0x51c6ec,_0xaf6019){_0x51c6ec=_0x51c6ec-0x0;var _0x91ce02=_0x2750[_0x51c6ec];return _0x91ce02;};'use strict';var Sequelize=require(_0x0275('0x0'));module['exports']={'name':{'type':Sequelize[_0x0275('0x1')]},'description':{'type':Sequelize[_0x0275('0x1')]},'host':{'type':Sequelize[_0x0275('0x1')]},'zone':{'type':Sequelize[_0x0275('0x1')]},'clientId':{'type':Sequelize[_0x0275('0x1')]},'clientSecret':{'type':Sequelize[_0x0275('0x1')]},'serverUrl':{'type':Sequelize[_0x0275('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x0275('0x1')]},'refreshToken':{'type':Sequelize[_0x0275('0x1')]}};
\ No newline at end of file
+var _0xcb91=['STRING'];(function(_0x3e1135,_0x37278b){var _0xee2d57=function(_0xe42693){while(--_0xe42693){_0x3e1135['push'](_0x3e1135['shift']());}};_0xee2d57(++_0x37278b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0xcb91[_0xcf4569];return _0x7fef;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1cb9('0x0')]},'description':{'type':Sequelize[_0x1cb9('0x0')]},'host':{'type':Sequelize[_0x1cb9('0x0')]},'zone':{'type':Sequelize[_0x1cb9('0x0')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x1cb9('0x0')]},'serverUrl':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x1cb9('0x0')]}};
\ No newline at end of file
index 01329f3..2881e59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb22=['https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','zoho.eu','com','slice','GET','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','includes','system_mandatory','display_label','custom_field','data_type','picklist','statusCode','getFields','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZohoAccount','fieldName','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','fields','find','create','body','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone'];(function(_0x41612b,_0x1a548a){var _0x552d61=function(_0x5186f2){while(--_0x5186f2){_0x41612b['push'](_0x41612b['shift']());}};_0x552d61(++_0x1a548a);}(_0xeb22,0x13a));var _0x2eb2=function(_0x5da877,_0x361726){_0x5da877=_0x5da877-0x0;var _0x3f2c10=_0xeb22[_0x5da877];return _0x3f2c10;};'use strict';var emlformat=require(_0x2eb2('0x0'));var rimraf=require(_0x2eb2('0x1'));var zipdir=require(_0x2eb2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2eb2('0x3'));var moment=require(_0x2eb2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2eb2('0x5'));var util=require(_0x2eb2('0x6'));var path=require(_0x2eb2('0x7'));var sox=require(_0x2eb2('0x8'));var csv=require(_0x2eb2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2eb2('0xa'));var squel=require(_0x2eb2('0xb'));var crypto=require(_0x2eb2('0xc'));var jsforce=require(_0x2eb2('0xd'));var deskjs=require(_0x2eb2('0xe'));var toCsv=require(_0x2eb2('0x9'));var querystring=require(_0x2eb2('0xf'));var Papa=require(_0x2eb2('0x10'));var Redis=require('ioredis');var authService=require(_0x2eb2('0x11'));var qs=require(_0x2eb2('0x12'));var as=require(_0x2eb2('0x13'));var hardwareService=require(_0x2eb2('0x14'));var logger=require(_0x2eb2('0x15'))(_0x2eb2('0x16'));var utils=require(_0x2eb2('0x17'));var config=require(_0x2eb2('0x18'));var licenseUtil=require(_0x2eb2('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2eb2('0x1a'));function respondWithStatusCode(_0x34394c,_0x3874a1){_0x3874a1=_0x3874a1||0xcc;return function(_0x3345ac){if(_0x3345ac){return _0x34394c[_0x2eb2('0x1b')](_0x3874a1);}return _0x34394c[_0x2eb2('0x1c')](_0x3874a1)[_0x2eb2('0x1d')]();};}function respondWithResult(_0x157546,_0x1f4722){_0x1f4722=_0x1f4722||0xc8;return function(_0x2e5136){if(_0x2e5136){return _0x157546[_0x2eb2('0x1c')](_0x1f4722)[_0x2eb2('0x1e')](_0x2e5136);}};}function respondWithFilteredResult(_0x3a7493,_0x38402b){return function(_0x132e65){if(_0x132e65){var _0x2f249e=typeof _0x38402b[_0x2eb2('0x1f')]===_0x2eb2('0x20')&&typeof _0x38402b[_0x2eb2('0x21')]===_0x2eb2('0x20');var _0x49381f=_0x132e65['count'];var _0x10fcb9=_0x2f249e?0x0:_0x38402b[_0x2eb2('0x1f')];var _0x25e97e=_0x2f249e?_0x132e65[_0x2eb2('0x22')]:_0x38402b['offset']+_0x38402b[_0x2eb2('0x21')];var _0x5a910a;if(_0x25e97e>=_0x49381f){_0x25e97e=_0x49381f;_0x5a910a=0xc8;}else{_0x5a910a=0xce;}_0x3a7493[_0x2eb2('0x1c')](_0x5a910a);return _0x3a7493[_0x2eb2('0x23')](_0x2eb2('0x24'),_0x10fcb9+'-'+_0x25e97e+'/'+_0x49381f)[_0x2eb2('0x1e')](_0x132e65);}return null;};}function patchUpdates(_0x4b4afd){return function(_0x47cd68){try{jsonpatch[_0x2eb2('0x25')](_0x47cd68,_0x4b4afd,!![]);}catch(_0x2665fe){return BPromise[_0x2eb2('0x26')](_0x2665fe);}return _0x47cd68[_0x2eb2('0x27')]();};}function saveUpdates(_0x588f0c,_0x3304fc){return function(_0x3f0297){if(_0x3f0297){return _0x3f0297[_0x2eb2('0x28')](_0x588f0c)[_0x2eb2('0x29')](function(_0x4d11b1){return _0x4d11b1;});}return null;};}function removeEntity(_0x142ed0,_0x465f3a){return function(_0x19f984){if(_0x19f984){return _0x19f984[_0x2eb2('0x2a')]()[_0x2eb2('0x29')](function(){_0x142ed0['status'](0xcc)[_0x2eb2('0x1d')]();});}};}function handleEntityNotFound(_0x3cd85a,_0x1daac4){return function(_0x232e81){if(!_0x232e81){_0x3cd85a['sendStatus'](0x194);}return _0x232e81;};}function handleError(_0x417e7f,_0x478f90){_0x478f90=_0x478f90||0x1f4;return function(_0x1eb2aa){logger[_0x2eb2('0x2b')](_0x1eb2aa[_0x2eb2('0x2c')]);if(_0x1eb2aa[_0x2eb2('0x2d')]){delete _0x1eb2aa[_0x2eb2('0x2d')];}_0x417e7f['status'](_0x478f90)[_0x2eb2('0x2e')](_0x1eb2aa);};}exports[_0x2eb2('0x2f')]=function(_0x472496,_0x3008db){var _0x31e163={},_0x17f602={},_0x2c87d5={'count':0x0,'rows':[]};var _0x108a5a=_[_0x2eb2('0x30')](db[_0x2eb2('0x31')]['rawAttributes'],function(_0x445d40){return{'name':_0x445d40[_0x2eb2('0x32')],'type':_0x445d40[_0x2eb2('0x33')][_0x2eb2('0x34')]};});_0x17f602[_0x2eb2('0x35')]=_[_0x2eb2('0x30')](_0x108a5a,'name');_0x17f602[_0x2eb2('0x36')]=_['keys'](_0x472496['query']);_0x17f602['filters']=_[_0x2eb2('0x37')](_0x17f602[_0x2eb2('0x35')],_0x17f602['query']);_0x31e163['attributes']=_[_0x2eb2('0x37')](_0x17f602[_0x2eb2('0x35')],qs['fields'](_0x472496[_0x2eb2('0x36')]['fields']));_0x31e163[_0x2eb2('0x38')]=_0x31e163[_0x2eb2('0x38')][_0x2eb2('0x39')]?_0x31e163[_0x2eb2('0x38')]:_0x17f602[_0x2eb2('0x35')];if(!_0x472496['query'][_0x2eb2('0x3a')](_0x2eb2('0x3b'))){_0x31e163[_0x2eb2('0x21')]=qs[_0x2eb2('0x21')](_0x472496[_0x2eb2('0x36')][_0x2eb2('0x21')]);_0x31e163['offset']=qs[_0x2eb2('0x1f')](_0x472496[_0x2eb2('0x36')][_0x2eb2('0x1f')]);}_0x31e163[_0x2eb2('0x3c')]=qs['sort'](_0x472496[_0x2eb2('0x36')][_0x2eb2('0x3d')]);_0x31e163['where']=qs[_0x2eb2('0x3e')](_[_0x2eb2('0x3f')](_0x472496[_0x2eb2('0x36')],_0x17f602[_0x2eb2('0x3e')]),_0x108a5a);if(_0x472496[_0x2eb2('0x36')][_0x2eb2('0x40')]){_0x31e163[_0x2eb2('0x41')]=_[_0x2eb2('0x42')](_0x31e163[_0x2eb2('0x41')],{'$or':_[_0x2eb2('0x30')](_0x108a5a,function(_0x5b28e0){if(_0x5b28e0[_0x2eb2('0x33')]!==_0x2eb2('0x43')){var _0x4aff93={};_0x4aff93[_0x5b28e0[_0x2eb2('0x2d')]]={'$like':'%'+_0x472496[_0x2eb2('0x36')]['filter']+'%'};return _0x4aff93;}})});}_0x31e163=_[_0x2eb2('0x42')]({},_0x31e163,_0x472496[_0x2eb2('0x44')]);var _0x4018e2={'where':_0x31e163[_0x2eb2('0x41')]};return db[_0x2eb2('0x31')][_0x2eb2('0x22')](_0x4018e2)[_0x2eb2('0x29')](function(_0x25def9){_0x2c87d5['count']=_0x25def9;if(_0x472496[_0x2eb2('0x36')][_0x2eb2('0x45')]){_0x31e163[_0x2eb2('0x46')]=[{'all':!![]}];}return db['ZohoAccount'][_0x2eb2('0x47')](_0x31e163);})[_0x2eb2('0x29')](function(_0x436001){_0x2c87d5[_0x2eb2('0x48')]=_0x436001;return _0x2c87d5;})['then'](respondWithFilteredResult(_0x3008db,_0x31e163))[_0x2eb2('0x49')](handleError(_0x3008db,null));};exports[_0x2eb2('0x4a')]=function(_0x370f8e,_0x3118ff){var _0x40e2a6={'raw':![],'where':{'id':_0x370f8e[_0x2eb2('0x4b')]['id']}},_0x37d7c2={};_0x37d7c2[_0x2eb2('0x35')]=_['keys'](db['ZohoAccount'][_0x2eb2('0x4c')]);_0x37d7c2[_0x2eb2('0x36')]=_[_0x2eb2('0x4d')](_0x370f8e[_0x2eb2('0x36')]);_0x37d7c2[_0x2eb2('0x3e')]=_[_0x2eb2('0x37')](_0x37d7c2['model'],_0x37d7c2[_0x2eb2('0x36')]);_0x40e2a6[_0x2eb2('0x38')]=_[_0x2eb2('0x37')](_0x37d7c2[_0x2eb2('0x35')],qs[_0x2eb2('0x4e')](_0x370f8e[_0x2eb2('0x36')][_0x2eb2('0x4e')]));_0x40e2a6[_0x2eb2('0x38')]=_0x40e2a6[_0x2eb2('0x38')]['length']?_0x40e2a6[_0x2eb2('0x38')]:_0x37d7c2[_0x2eb2('0x35')];if(_0x370f8e['query']['includeAll']){_0x40e2a6[_0x2eb2('0x46')]=[{'all':!![]}];}_0x40e2a6=_[_0x2eb2('0x42')]({},_0x40e2a6,_0x370f8e['options']);return db['ZohoAccount'][_0x2eb2('0x4f')](_0x40e2a6)[_0x2eb2('0x29')](handleEntityNotFound(_0x3118ff,null))[_0x2eb2('0x29')](respondWithResult(_0x3118ff,null))['catch'](handleError(_0x3118ff,null));};exports[_0x2eb2('0x50')]=function(_0x10d4ab,_0x47ba33){return db['ZohoAccount'][_0x2eb2('0x50')](_0x10d4ab['body'],{})['then'](respondWithResult(_0x47ba33,0xc9))['catch'](handleError(_0x47ba33,null));};exports[_0x2eb2('0x28')]=function(_0xaad8bb,_0x513bcf){if(_0xaad8bb[_0x2eb2('0x51')]['id']){delete _0xaad8bb[_0x2eb2('0x51')]['id'];}return db[_0x2eb2('0x31')]['find']({'where':{'id':_0xaad8bb[_0x2eb2('0x4b')]['id']}})[_0x2eb2('0x29')](handleEntityNotFound(_0x513bcf,null))['then'](saveUpdates(_0xaad8bb['body'],null))[_0x2eb2('0x29')](respondWithResult(_0x513bcf,null))[_0x2eb2('0x49')](handleError(_0x513bcf,null));};exports['destroy']=function(_0x2f8581,_0x13ee75){return db[_0x2eb2('0x31')][_0x2eb2('0x4f')]({'where':{'id':_0x2f8581[_0x2eb2('0x4b')]['id']}})[_0x2eb2('0x29')](handleEntityNotFound(_0x13ee75,null))[_0x2eb2('0x29')](removeEntity(_0x13ee75,null))[_0x2eb2('0x49')](handleError(_0x13ee75,null));};exports['getConfigurations']=function(_0x34abd2,_0x2b7de9,_0x48b816){var _0x37da69={};var _0x48443e={};var _0x3f8c4f;var _0x355843;return db[_0x2eb2('0x31')]['findOne']({'where':{'id':_0x34abd2[_0x2eb2('0x4b')]['id']}})[_0x2eb2('0x29')](handleEntityNotFound(_0x2b7de9,null))['then'](function(_0x4dd796){if(_0x4dd796){_0x3f8c4f=_0x4dd796;_0x48443e[_0x2eb2('0x35')]=_[_0x2eb2('0x4d')](db['ZohoConfiguration'][_0x2eb2('0x4c')]);_0x48443e['query']=_['keys'](_0x34abd2['query']);_0x48443e[_0x2eb2('0x3e')]=_[_0x2eb2('0x37')](_0x48443e[_0x2eb2('0x35')],_0x48443e[_0x2eb2('0x36')]);_0x37da69['attributes']=_['intersection'](_0x48443e[_0x2eb2('0x35')],qs[_0x2eb2('0x4e')](_0x34abd2['query'][_0x2eb2('0x4e')]));_0x37da69[_0x2eb2('0x38')]=_0x37da69[_0x2eb2('0x38')]['length']?_0x37da69[_0x2eb2('0x38')]:_0x48443e[_0x2eb2('0x35')];_0x37da69[_0x2eb2('0x3c')]=qs[_0x2eb2('0x3d')](_0x34abd2[_0x2eb2('0x36')][_0x2eb2('0x3d')]);_0x37da69[_0x2eb2('0x41')]=qs[_0x2eb2('0x3e')](_[_0x2eb2('0x3f')](_0x34abd2[_0x2eb2('0x36')],_0x48443e[_0x2eb2('0x3e')]));if(_0x34abd2[_0x2eb2('0x36')][_0x2eb2('0x40')]){_0x37da69[_0x2eb2('0x41')]=_[_0x2eb2('0x42')](_0x37da69[_0x2eb2('0x41')],{'$or':_[_0x2eb2('0x30')](_0x37da69[_0x2eb2('0x38')],function(_0x28c3b2){var _0x60cc81={};_0x60cc81[_0x28c3b2]={'$like':'%'+_0x34abd2['query'][_0x2eb2('0x40')]+'%'};return _0x60cc81;})});}_0x37da69=_[_0x2eb2('0x42')]({},_0x37da69,_0x34abd2['options']);return _0x3f8c4f[_0x2eb2('0x52')](_0x37da69);}})[_0x2eb2('0x29')](function(_0x4ecd92){if(_0x4ecd92){_0x355843=_0x4ecd92[_0x2eb2('0x39')];if(!_0x34abd2[_0x2eb2('0x36')][_0x2eb2('0x3a')](_0x2eb2('0x3b'))){_0x37da69[_0x2eb2('0x21')]=qs[_0x2eb2('0x21')](_0x34abd2[_0x2eb2('0x36')][_0x2eb2('0x21')]);_0x37da69[_0x2eb2('0x1f')]=qs['offset'](_0x34abd2['query'][_0x2eb2('0x1f')]);}return _0x3f8c4f[_0x2eb2('0x52')](_0x37da69);}})[_0x2eb2('0x29')](function(_0x2ce1a9){if(_0x2ce1a9){return _0x2ce1a9?{'count':_0x355843,'rows':_0x2ce1a9}:null;}})[_0x2eb2('0x29')](respondWithResult(_0x2b7de9,null))[_0x2eb2('0x49')](handleError(_0x2b7de9,null));};exports[_0x2eb2('0x53')]=function(_0x27d05e,_0xe7b36e,_0x55fb83){if(_0x27d05e[_0x2eb2('0x51')]['id']){delete _0x27d05e[_0x2eb2('0x51')]['id'];}return db[_0x2eb2('0x31')][_0x2eb2('0x54')]({'where':{'id':_0x27d05e['params']['id']}})[_0x2eb2('0x29')](handleEntityNotFound(_0xe7b36e,null))[_0x2eb2('0x29')](function(_0x13e9e7){if(_0x13e9e7){_0x27d05e[_0x2eb2('0x51')][_0x2eb2('0x55')]=_0x13e9e7['id'];_0x27d05e[_0x2eb2('0x51')][_0x2eb2('0x56')]=integrations[_0x2eb2('0x57')](_0x27d05e[_0x2eb2('0x51')][_0x2eb2('0x58')],_0x27d05e[_0x2eb2('0x51')][_0x2eb2('0x33')]);_0x27d05e[_0x2eb2('0x51')][_0x2eb2('0x59')]=integrations[_0x2eb2('0x5a')](_0x27d05e[_0x2eb2('0x51')][_0x2eb2('0x58')],_0x27d05e[_0x2eb2('0x51')]['type']);return db[_0x2eb2('0x5b')][_0x2eb2('0x50')](_0x27d05e[_0x2eb2('0x51')],{'include':[{'model':db[_0x2eb2('0x5c')],'as':_0x2eb2('0x56')},{'model':db[_0x2eb2('0x5c')],'as':_0x2eb2('0x59')}]});}return null;})['then'](respondWithResult(_0xe7b36e,null))['catch'](handleError(_0xe7b36e,null));};function getAccessToken(_0xf672d3){return new Promise(function(_0x40b799,_0x28a458){var _0x3cd528;switch(_0xf672d3[_0x2eb2('0x5d')]){case'US':_0x3cd528=_0x2eb2('0x5e');break;case'AU':_0x3cd528=_0x2eb2('0x5f');break;case'EU':_0x3cd528=_0x2eb2('0x60');break;case'IN':_0x3cd528=_0x2eb2('0x61');break;case'CN':_0x3cd528=_0x2eb2('0x62');break;default:_0x3cd528='https://accounts.zoho.eu';break;}var _0x7dbbad={'method':_0x2eb2('0x63'),'uri':_0x3cd528+'/oauth/v2/token','qs':{'refresh_token':_0xf672d3[_0x2eb2('0x64')],'client_id':_0xf672d3[_0x2eb2('0x65')],'client_secret':_0xf672d3[_0x2eb2('0x66')],'grant_type':_0x2eb2('0x67')},'json':!![]};return rp(_0x7dbbad)[_0x2eb2('0x29')](function(_0x3aed4e){if(_0x3aed4e['access_token']){_0x40b799(_0x3aed4e[_0x2eb2('0x68')]);}else{_0x28a458(_0x2eb2('0x69'));}})['catch'](function(_0x2e2882){_0x28a458(_0x2e2882);});});}exports['getFields']=function(_0x1a9322,_0x57285f,_0x2bcdf1){var _0x5a7aa1,_0x2e1ba5,_0x346f72,_0x34da05,_0x129443;return db['ZohoAccount'][_0x2eb2('0x54')]({'where':{'id':_0x1a9322[_0x2eb2('0x4b')]['id']},'attributes':['id',_0x2eb2('0x6a'),_0x2eb2('0x5d'),'clientId',_0x2eb2('0x66'),_0x2eb2('0x6b'),_0x2eb2('0x6c'),_0x2eb2('0x64')]})[_0x2eb2('0x29')](handleEntityNotFound(_0x57285f,null))[_0x2eb2('0x29')](function(_0x44b471){_0x129443=_0x44b471;_0x5a7aa1=_0x129443['host'];_0x2e1ba5=_0x5a7aa1===_0x2eb2('0x6d')?'eu':_0x2eb2('0x6e');_0x346f72=_0x129443[_0x2eb2('0x6b')];var _0x5cfeda=_0x346f72[_0x2eb2('0x6f')](-0x1);if(_0x5cfeda==='/'||_0x5cfeda==='\x5c'||_0x5cfeda===':'){_0x346f72=_0x346f72['substring'](0x0,_0x346f72['lastIndexOf'](_0x5cfeda));}if(!_0x129443[_0x2eb2('0x64')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x129443);})[_0x2eb2('0x29')](function(_0x4bd804){if(_0x4bd804){return rp({'method':_0x2eb2('0x70'),'uri':util[_0x2eb2('0x71')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x2e1ba5),'qs':{'module':_0x2eb2('0x72')},'headers':{'Authorization':_0x2eb2('0x73')+_0x4bd804},'json':!![]});}})[_0x2eb2('0x29')](function(_0x4b5c08){if(_0x4b5c08){if(_0x4b5c08['response']&&_0x4b5c08['response'][_0x2eb2('0x2b')]){throw new Error(_0x4b5c08[_0x2eb2('0x74')]['error'][_0x2eb2('0x75')]);}var _0x282840=[];var _0x34d57e=[];var _0xf44c0c=[_0x2eb2('0x76'),_0x2eb2('0x77'),_0x2eb2('0x78'),_0x2eb2('0x79'),_0x2eb2('0x7a'),'Call_Result',_0x2eb2('0x7b'),_0x2eb2('0x7c')];_0x34d57e=_['remove'](_0x4b5c08[_0x2eb2('0x4e')],function(_0x31d5b2){return _0xf44c0c[_0x2eb2('0x7d')](_0x31d5b2['api_name']);});for(var _0x95c96a=0x0;_0x95c96a<_0x34d57e[_0x2eb2('0x39')];_0x95c96a++){if(_0x34d57e[_0x95c96a][_0x2eb2('0x7e')]===![]){_0x282840['push']({'id':_0x34d57e[_0x95c96a]['id'],'name':_0x34d57e[_0x95c96a][_0x2eb2('0x7f')],'custom':_0x34d57e[_0x95c96a][_0x2eb2('0x80')],'options':_0x34d57e[_0x95c96a][_0x2eb2('0x81')]===_0x2eb2('0x82')&&_0x34d57e[_0x95c96a]['pick_list_values'][_0x2eb2('0x39')]>-0x1?_[_0x2eb2('0x30')](_0x34d57e[_0x95c96a]['pick_list_values'],function(_0x5c0fcf){return{'name':_0x5c0fcf,'value':_0x5c0fcf};}):[]});}}return{'count':_0x282840['length'],'rows':_0x282840};}else{return{'count':0x0,'rows':[]};}})[_0x2eb2('0x29')](respondWithResult(_0x57285f,null))[_0x2eb2('0x49')](function(_0x29efe0){var _0x588eb7=_0x1a9322[_0x2eb2('0x36')]['test']?0x1f4:_0x29efe0[_0x2eb2('0x83')]||0x1f4;logger[_0x2eb2('0x2b')]('getFields,\x20%s,\x20%s,\x20%s',_0x2eb2('0x84'),_0x588eb7,JSON[_0x2eb2('0x85')](_0x29efe0));delete _0x29efe0[_0x2eb2('0x2d')];if(_0x588eb7===0x191){_0x588eb7=0x190;}_0x57285f[_0x2eb2('0x1c')](_0x588eb7)['send'](_0x1a9322[_0x2eb2('0x36')][_0x2eb2('0x86')]?{'message':_0x2eb2('0x87'),'statusCode':_0x29efe0[_0x2eb2('0x83')]}:_0x29efe0);});};
\ No newline at end of file
+var _0x466e=['Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','includes','api_name','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','limit','undefined','count','set','reject','save','then','destroy','error','name','send','ZohoAccount','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','ZohoConfiguration','order','pick','hasOwnProperty','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','access_token'];(function(_0x5ec78f,_0x4f821d){var _0x19ea35=function(_0xc313c){while(--_0xc313c){_0x5ec78f['push'](_0x5ec78f['shift']());}};_0x19ea35(++_0x4f821d);}(_0x466e,0x122));var _0xe466=function(_0x25687e,_0x2eed13){_0x25687e=_0x25687e-0x0;var _0x480970=_0x466e[_0x25687e];return _0x480970;};'use strict';var emlformat=require(_0xe466('0x0'));var rimraf=require(_0xe466('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe466('0x2'));var rp=require(_0xe466('0x3'));var moment=require(_0xe466('0x4'));var BPromise=require(_0xe466('0x5'));var Mustache=require(_0xe466('0x6'));var util=require(_0xe466('0x7'));var path=require(_0xe466('0x8'));var sox=require(_0xe466('0x9'));var csv=require('to-csv');var ejs=require(_0xe466('0xa'));var fs=require('fs');var fs_extra=require(_0xe466('0xb'));var _=require(_0xe466('0xc'));var squel=require('squel');var crypto=require(_0xe466('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe466('0xe'));var toCsv=require(_0xe466('0xf'));var querystring=require(_0xe466('0x10'));var Papa=require('papaparse');var Redis=require(_0xe466('0x11'));var authService=require(_0xe466('0x12'));var qs=require(_0xe466('0x13'));var as=require(_0xe466('0x14'));var hardwareService=require(_0xe466('0x15'));var logger=require(_0xe466('0x16'))('api');var utils=require(_0xe466('0x17'));var config=require(_0xe466('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe466('0x19'))['db'];var integrations=require(_0xe466('0x1a'));function respondWithStatusCode(_0x38f809,_0x191bb9){_0x191bb9=_0x191bb9||0xcc;return function(_0x21c0fd){if(_0x21c0fd){return _0x38f809[_0xe466('0x1b')](_0x191bb9);}return _0x38f809['status'](_0x191bb9)[_0xe466('0x1c')]();};}function respondWithResult(_0x2abde7,_0x25bd6d){_0x25bd6d=_0x25bd6d||0xc8;return function(_0x3889ec){if(_0x3889ec){return _0x2abde7[_0xe466('0x1d')](_0x25bd6d)[_0xe466('0x1e')](_0x3889ec);}};}function respondWithFilteredResult(_0x2369bf,_0xeba923){return function(_0x541c5b){if(_0x541c5b){var _0x26f3a2=typeof _0xeba923[_0xe466('0x1f')]==='undefined'&&typeof _0xeba923[_0xe466('0x20')]===_0xe466('0x21');var _0x4d728d=_0x541c5b[_0xe466('0x22')];var _0x5a33f3=_0x26f3a2?0x0:_0xeba923[_0xe466('0x1f')];var _0x1493aa=_0x26f3a2?_0x541c5b['count']:_0xeba923['offset']+_0xeba923[_0xe466('0x20')];var _0x347542;if(_0x1493aa>=_0x4d728d){_0x1493aa=_0x4d728d;_0x347542=0xc8;}else{_0x347542=0xce;}_0x2369bf[_0xe466('0x1d')](_0x347542);return _0x2369bf[_0xe466('0x23')]('Content-Range',_0x5a33f3+'-'+_0x1493aa+'/'+_0x4d728d)[_0xe466('0x1e')](_0x541c5b);}return null;};}function patchUpdates(_0x1fa976){return function(_0x368d8c){try{jsonpatch['apply'](_0x368d8c,_0x1fa976,!![]);}catch(_0x2ead60){return BPromise[_0xe466('0x24')](_0x2ead60);}return _0x368d8c[_0xe466('0x25')]();};}function saveUpdates(_0x1c9f25,_0x2afbd3){return function(_0xa05f10){if(_0xa05f10){return _0xa05f10['update'](_0x1c9f25)[_0xe466('0x26')](function(_0x395df6){return _0x395df6;});}return null;};}function removeEntity(_0xf9d568,_0x5e753a){return function(_0x36d3d0){if(_0x36d3d0){return _0x36d3d0[_0xe466('0x27')]()[_0xe466('0x26')](function(){_0xf9d568[_0xe466('0x1d')](0xcc)[_0xe466('0x1c')]();});}};}function handleEntityNotFound(_0x1037fa,_0x498aa8){return function(_0x44888d){if(!_0x44888d){_0x1037fa['sendStatus'](0x194);}return _0x44888d;};}function handleError(_0x5af20c,_0x52394c){_0x52394c=_0x52394c||0x1f4;return function(_0x3aa320){logger[_0xe466('0x28')](_0x3aa320['stack']);if(_0x3aa320[_0xe466('0x29')]){delete _0x3aa320[_0xe466('0x29')];}_0x5af20c['status'](_0x52394c)[_0xe466('0x2a')](_0x3aa320);};}exports['index']=function(_0x25eaa8,_0x3394cc){var _0xf9da6f={},_0x1c54be={},_0x931a80={'count':0x0,'rows':[]};var _0x42e786=_['map'](db[_0xe466('0x2b')][_0xe466('0x2c')],function(_0x16b646){return{'name':_0x16b646[_0xe466('0x2d')],'type':_0x16b646[_0xe466('0x2e')]['key']};});_0x1c54be[_0xe466('0x2f')]=_[_0xe466('0x30')](_0x42e786,'name');_0x1c54be[_0xe466('0x31')]=_[_0xe466('0x32')](_0x25eaa8[_0xe466('0x31')]);_0x1c54be['filters']=_[_0xe466('0x33')](_0x1c54be[_0xe466('0x2f')],_0x1c54be[_0xe466('0x31')]);_0xf9da6f[_0xe466('0x34')]=_[_0xe466('0x33')](_0x1c54be[_0xe466('0x2f')],qs[_0xe466('0x35')](_0x25eaa8[_0xe466('0x31')][_0xe466('0x35')]));_0xf9da6f[_0xe466('0x34')]=_0xf9da6f[_0xe466('0x34')][_0xe466('0x36')]?_0xf9da6f[_0xe466('0x34')]:_0x1c54be['model'];if(!_0x25eaa8[_0xe466('0x31')]['hasOwnProperty']('nolimit')){_0xf9da6f['limit']=qs['limit'](_0x25eaa8[_0xe466('0x31')][_0xe466('0x20')]);_0xf9da6f[_0xe466('0x1f')]=qs['offset'](_0x25eaa8[_0xe466('0x31')][_0xe466('0x1f')]);}_0xf9da6f['order']=qs['sort'](_0x25eaa8['query'][_0xe466('0x37')]);_0xf9da6f[_0xe466('0x38')]=qs[_0xe466('0x39')](_['pick'](_0x25eaa8[_0xe466('0x31')],_0x1c54be[_0xe466('0x39')]),_0x42e786);if(_0x25eaa8[_0xe466('0x31')][_0xe466('0x3a')]){_0xf9da6f[_0xe466('0x38')]=_[_0xe466('0x3b')](_0xf9da6f[_0xe466('0x38')],{'$or':_[_0xe466('0x30')](_0x42e786,function(_0x55a7b6){if(_0x55a7b6[_0xe466('0x2e')]!=='VIRTUAL'){var _0x38cacc={};_0x38cacc[_0x55a7b6['name']]={'$like':'%'+_0x25eaa8[_0xe466('0x31')][_0xe466('0x3a')]+'%'};return _0x38cacc;}})});}_0xf9da6f=_['merge']({},_0xf9da6f,_0x25eaa8[_0xe466('0x3c')]);var _0x522fb7={'where':_0xf9da6f[_0xe466('0x38')]};return db[_0xe466('0x2b')][_0xe466('0x22')](_0x522fb7)['then'](function(_0x44ae53){_0x931a80['count']=_0x44ae53;if(_0x25eaa8['query'][_0xe466('0x3d')]){_0xf9da6f[_0xe466('0x3e')]=[{'all':!![]}];}return db[_0xe466('0x2b')][_0xe466('0x3f')](_0xf9da6f);})[_0xe466('0x26')](function(_0x4748d7){_0x931a80[_0xe466('0x40')]=_0x4748d7;return _0x931a80;})[_0xe466('0x26')](respondWithFilteredResult(_0x3394cc,_0xf9da6f))[_0xe466('0x41')](handleError(_0x3394cc,null));};exports[_0xe466('0x42')]=function(_0x377a0b,_0x3aab63){var _0x113248={'raw':![],'where':{'id':_0x377a0b[_0xe466('0x43')]['id']}},_0x589e33={};_0x589e33['model']=_[_0xe466('0x32')](db[_0xe466('0x2b')][_0xe466('0x2c')]);_0x589e33[_0xe466('0x31')]=_[_0xe466('0x32')](_0x377a0b[_0xe466('0x31')]);_0x589e33[_0xe466('0x39')]=_['intersection'](_0x589e33[_0xe466('0x2f')],_0x589e33['query']);_0x113248[_0xe466('0x34')]=_[_0xe466('0x33')](_0x589e33[_0xe466('0x2f')],qs[_0xe466('0x35')](_0x377a0b[_0xe466('0x31')][_0xe466('0x35')]));_0x113248[_0xe466('0x34')]=_0x113248[_0xe466('0x34')]['length']?_0x113248[_0xe466('0x34')]:_0x589e33[_0xe466('0x2f')];if(_0x377a0b['query']['includeAll']){_0x113248['include']=[{'all':!![]}];}_0x113248=_[_0xe466('0x3b')]({},_0x113248,_0x377a0b[_0xe466('0x3c')]);return db[_0xe466('0x2b')][_0xe466('0x44')](_0x113248)['then'](handleEntityNotFound(_0x3aab63,null))['then'](respondWithResult(_0x3aab63,null))[_0xe466('0x41')](handleError(_0x3aab63,null));};exports[_0xe466('0x45')]=function(_0x4ce949,_0x3eb3eb){return db[_0xe466('0x2b')]['create'](_0x4ce949['body'],{})[_0xe466('0x26')](respondWithResult(_0x3eb3eb,0xc9))[_0xe466('0x41')](handleError(_0x3eb3eb,null));};exports['update']=function(_0x4ff229,_0x47fb80){if(_0x4ff229['body']['id']){delete _0x4ff229['body']['id'];}return db[_0xe466('0x2b')][_0xe466('0x44')]({'where':{'id':_0x4ff229[_0xe466('0x43')]['id']}})[_0xe466('0x26')](handleEntityNotFound(_0x47fb80,null))[_0xe466('0x26')](saveUpdates(_0x4ff229[_0xe466('0x46')],null))['then'](respondWithResult(_0x47fb80,null))[_0xe466('0x41')](handleError(_0x47fb80,null));};exports['destroy']=function(_0x160b1f,_0x5c547b){return db['ZohoAccount'][_0xe466('0x44')]({'where':{'id':_0x160b1f[_0xe466('0x43')]['id']}})[_0xe466('0x26')](handleEntityNotFound(_0x5c547b,null))[_0xe466('0x26')](removeEntity(_0x5c547b,null))[_0xe466('0x41')](handleError(_0x5c547b,null));};exports[_0xe466('0x47')]=function(_0x13434c,_0x5ea480,_0x5b33e1){var _0x48359f={};var _0x4f23b1={};var _0x525b0d;var _0x44a6ed;return db[_0xe466('0x2b')][_0xe466('0x48')]({'where':{'id':_0x13434c[_0xe466('0x43')]['id']}})[_0xe466('0x26')](handleEntityNotFound(_0x5ea480,null))[_0xe466('0x26')](function(_0x57e9ef){if(_0x57e9ef){_0x525b0d=_0x57e9ef;_0x4f23b1[_0xe466('0x2f')]=_[_0xe466('0x32')](db[_0xe466('0x49')][_0xe466('0x2c')]);_0x4f23b1[_0xe466('0x31')]=_['keys'](_0x13434c[_0xe466('0x31')]);_0x4f23b1[_0xe466('0x39')]=_[_0xe466('0x33')](_0x4f23b1[_0xe466('0x2f')],_0x4f23b1[_0xe466('0x31')]);_0x48359f[_0xe466('0x34')]=_[_0xe466('0x33')](_0x4f23b1[_0xe466('0x2f')],qs[_0xe466('0x35')](_0x13434c[_0xe466('0x31')][_0xe466('0x35')]));_0x48359f[_0xe466('0x34')]=_0x48359f[_0xe466('0x34')][_0xe466('0x36')]?_0x48359f[_0xe466('0x34')]:_0x4f23b1[_0xe466('0x2f')];_0x48359f[_0xe466('0x4a')]=qs[_0xe466('0x37')](_0x13434c[_0xe466('0x31')][_0xe466('0x37')]);_0x48359f[_0xe466('0x38')]=qs[_0xe466('0x39')](_[_0xe466('0x4b')](_0x13434c['query'],_0x4f23b1[_0xe466('0x39')]));if(_0x13434c[_0xe466('0x31')][_0xe466('0x3a')]){_0x48359f[_0xe466('0x38')]=_[_0xe466('0x3b')](_0x48359f['where'],{'$or':_[_0xe466('0x30')](_0x48359f[_0xe466('0x34')],function(_0x45be1b){var _0x346c13={};_0x346c13[_0x45be1b]={'$like':'%'+_0x13434c[_0xe466('0x31')][_0xe466('0x3a')]+'%'};return _0x346c13;})});}_0x48359f=_[_0xe466('0x3b')]({},_0x48359f,_0x13434c[_0xe466('0x3c')]);return _0x525b0d['getConfigurations'](_0x48359f);}})[_0xe466('0x26')](function(_0xaf43d6){if(_0xaf43d6){_0x44a6ed=_0xaf43d6[_0xe466('0x36')];if(!_0x13434c['query'][_0xe466('0x4c')](_0xe466('0x4d'))){_0x48359f[_0xe466('0x20')]=qs[_0xe466('0x20')](_0x13434c[_0xe466('0x31')][_0xe466('0x20')]);_0x48359f[_0xe466('0x1f')]=qs['offset'](_0x13434c[_0xe466('0x31')][_0xe466('0x1f')]);}return _0x525b0d[_0xe466('0x47')](_0x48359f);}})[_0xe466('0x26')](function(_0x1960fd){if(_0x1960fd){return _0x1960fd?{'count':_0x44a6ed,'rows':_0x1960fd}:null;}})[_0xe466('0x26')](respondWithResult(_0x5ea480,null))[_0xe466('0x41')](handleError(_0x5ea480,null));};exports[_0xe466('0x4e')]=function(_0x5b2121,_0x18ca12,_0x447c1c){if(_0x5b2121['body']['id']){delete _0x5b2121[_0xe466('0x46')]['id'];}return db[_0xe466('0x2b')]['findOne']({'where':{'id':_0x5b2121['params']['id']}})[_0xe466('0x26')](handleEntityNotFound(_0x18ca12,null))['then'](function(_0x1c97b0){if(_0x1c97b0){_0x5b2121[_0xe466('0x46')]['AccountId']=_0x1c97b0['id'];_0x5b2121[_0xe466('0x46')][_0xe466('0x4f')]=integrations[_0xe466('0x50')](_0x5b2121[_0xe466('0x46')][_0xe466('0x51')],_0x5b2121[_0xe466('0x46')][_0xe466('0x2e')]);_0x5b2121[_0xe466('0x46')][_0xe466('0x52')]=integrations[_0xe466('0x53')](_0x5b2121[_0xe466('0x46')][_0xe466('0x51')],_0x5b2121['body'][_0xe466('0x2e')]);return db[_0xe466('0x49')][_0xe466('0x45')](_0x5b2121[_0xe466('0x46')],{'include':[{'model':db[_0xe466('0x54')],'as':_0xe466('0x4f')},{'model':db[_0xe466('0x54')],'as':_0xe466('0x52')}]});}return null;})[_0xe466('0x26')](respondWithResult(_0x18ca12,null))[_0xe466('0x41')](handleError(_0x18ca12,null));};function getAccessToken(_0xc1c7f6){return new Promise(function(_0x43f5c5,_0x1142a4){var _0x453be0;switch(_0xc1c7f6['zone']){case'US':_0x453be0=_0xe466('0x55');break;case'AU':_0x453be0=_0xe466('0x56');break;case'EU':_0x453be0=_0xe466('0x57');break;case'IN':_0x453be0='https://accounts.zoho.in';break;case'CN':_0x453be0=_0xe466('0x58');break;default:_0x453be0=_0xe466('0x57');break;}var _0xe2821d={'method':_0xe466('0x59'),'uri':_0x453be0+'/oauth/v2/token','qs':{'refresh_token':_0xc1c7f6[_0xe466('0x5a')],'client_id':_0xc1c7f6[_0xe466('0x5b')],'client_secret':_0xc1c7f6[_0xe466('0x5c')],'grant_type':'refresh_token'},'json':!![]};return rp(_0xe2821d)['then'](function(_0x86fc4f){if(_0x86fc4f[_0xe466('0x5d')]){_0x43f5c5(_0x86fc4f[_0xe466('0x5d')]);}else{_0x1142a4(_0xe466('0x5e'));}})[_0xe466('0x41')](function(_0x547a59){_0x1142a4(_0x547a59);});});}exports[_0xe466('0x5f')]=function(_0x53aa4c,_0x5b081f,_0x24e5ae){var _0x1c5398,_0x225c15,_0x1de8e1,_0x1838d3,_0x3ab528;return db[_0xe466('0x2b')][_0xe466('0x48')]({'where':{'id':_0x53aa4c['params']['id']},'attributes':['id',_0xe466('0x60'),_0xe466('0x61'),_0xe466('0x5b'),_0xe466('0x5c'),_0xe466('0x62'),'code',_0xe466('0x5a')]})['then'](handleEntityNotFound(_0x5b081f,null))['then'](function(_0x4b15ef){_0x3ab528=_0x4b15ef;_0x1c5398=_0x3ab528[_0xe466('0x60')];_0x225c15=_0x1c5398===_0xe466('0x63')?'eu':_0xe466('0x64');_0x1de8e1=_0x3ab528[_0xe466('0x62')];var _0x1630a0=_0x1de8e1[_0xe466('0x65')](-0x1);if(_0x1630a0==='/'||_0x1630a0==='\x5c'||_0x1630a0===':'){_0x1de8e1=_0x1de8e1[_0xe466('0x66')](0x0,_0x1de8e1[_0xe466('0x67')](_0x1630a0));}if(!_0x3ab528[_0xe466('0x5a')]){throw new Error(_0xe466('0x68'));}return getAccessToken(_0x3ab528);})[_0xe466('0x26')](function(_0x4b53d7){if(_0x4b53d7){return rp({'method':'GET','uri':util[_0xe466('0x69')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x225c15),'qs':{'module':_0xe466('0x6a')},'headers':{'Authorization':_0xe466('0x6b')+_0x4b53d7},'json':!![]});}})[_0xe466('0x26')](function(_0x17e23a){if(_0x17e23a){if(_0x17e23a[_0xe466('0x6c')]&&_0x17e23a[_0xe466('0x6c')][_0xe466('0x28')]){throw new Error(_0x17e23a[_0xe466('0x6c')][_0xe466('0x28')][_0xe466('0x6d')]);}var _0x36bd73=[];var _0x22d7b7=[];var _0x11dcf8=[_0xe466('0x6e'),'Subject',_0xe466('0x6f'),_0xe466('0x70'),_0xe466('0x71'),_0xe466('0x72'),_0xe466('0x73'),'Call_Type'];_0x22d7b7=_['remove'](_0x17e23a['fields'],function(_0x24391a){return _0x11dcf8[_0xe466('0x74')](_0x24391a[_0xe466('0x75')]);});for(var _0x2aac4b=0x0;_0x2aac4b<_0x22d7b7['length'];_0x2aac4b++){if(_0x22d7b7[_0x2aac4b][_0xe466('0x76')]===![]){_0x36bd73[_0xe466('0x77')]({'id':_0x22d7b7[_0x2aac4b]['id'],'name':_0x22d7b7[_0x2aac4b]['display_label'],'custom':_0x22d7b7[_0x2aac4b][_0xe466('0x78')],'options':_0x22d7b7[_0x2aac4b][_0xe466('0x79')]===_0xe466('0x7a')&&_0x22d7b7[_0x2aac4b][_0xe466('0x7b')][_0xe466('0x36')]>-0x1?_[_0xe466('0x30')](_0x22d7b7[_0x2aac4b]['pick_list_values'],function(_0x4180ad){return{'name':_0x4180ad,'value':_0x4180ad};}):[]});}}return{'count':_0x36bd73[_0xe466('0x36')],'rows':_0x36bd73};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x5b081f,null))[_0xe466('0x41')](function(_0x4babc3){var _0x5530c9=_0x53aa4c[_0xe466('0x31')][_0xe466('0x7c')]?0x1f4:_0x4babc3[_0xe466('0x7d')]||0x1f4;logger['error'](_0xe466('0x7e'),_0xe466('0x5f'),_0x5530c9,JSON[_0xe466('0x7f')](_0x4babc3));delete _0x4babc3[_0xe466('0x29')];if(_0x5530c9===0x191){_0x5530c9=0x190;}_0x5b081f[_0xe466('0x1d')](_0x5530c9)[_0xe466('0x2a')](_0x53aa4c[_0xe466('0x31')][_0xe466('0x7c')]?{'message':'Wrong\x20credentials','statusCode':_0x4babc3[_0xe466('0x7d')]}:_0x4babc3);});};
\ No newline at end of file
index 734da87..4111be0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf30c=['POST','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','slice','https://accounts.zoho.com.cn','/oauth/v2/token','code','catch','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','host','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.in'];(function(_0x286992,_0x32ede1){var _0x2951c0=function(_0x1f79a8){while(--_0x1f79a8){_0x286992['push'](_0x286992['shift']());}};_0x2951c0(++_0x32ede1);}(_0xf30c,0x1e1));var _0xcf30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf30c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xcf30('0x0'));var logger=require(_0xcf30('0x1'))('api');var moment=require('moment');var BPromise=require(_0xcf30('0x2'));var rp=require(_0xcf30('0x3'));var fs=require('fs');var path=require(_0xcf30('0x4'));var rimraf=require(_0xcf30('0x5'));var config=require(_0xcf30('0x6'));var attributes=require(_0xcf30('0x7'));var integrations=require(_0xcf30('0x8'));module[_0xcf30('0x9')]=function(_0x1ba772,_0x14f64c){return _0x1ba772[_0xcf30('0xa')](_0xcf30('0xb'),attributes,{'tableName':_0xcf30('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x51445a,_0x1c25fc,_0x523b2d){if(_0x51445a[_0xcf30('0xd')]('zone')||_0x51445a[_0xcf30('0xd')](_0xcf30('0xe'))||_0x51445a[_0xcf30('0xd')](_0xcf30('0xf'))||_0x51445a[_0xcf30('0xd')](_0xcf30('0x10'))||_0x51445a[_0xcf30('0xd')]('code')||_0x51445a[_0xcf30('0xd')](_0xcf30('0x11'))){var _0x57caf7,_0x101791;_0x57caf7=_0x51445a[_0xcf30('0xe')];var _0x1df45a=_0x57caf7['slice'](-0x1);if(_0x1df45a==='/'||_0x1df45a==='\x5c'||_0x1df45a===':'){_0x57caf7=_0x57caf7[_0xcf30('0x12')](0x0,_0x57caf7[_0xcf30('0x13')](_0x1df45a));}switch(_0x51445a[_0xcf30('0x14')]){case'US':_0x101791=_0xcf30('0x15');break;case'AU':_0x101791='https://accounts.zoho.com.au';break;case'IN':_0x101791=_0xcf30('0x16');break;case'CN':_0x101791='https://accounts.zoho.com.cn';break;default:_0x101791='https://accounts.zoho.eu';break;}var _0x243809={'method':_0xcf30('0x17'),'uri':_0x101791+'/oauth/v2/token','form':{'grant_type':_0xcf30('0x18'),'client_id':_0x51445a['clientId'],'client_secret':_0x51445a['clientSecret'],'redirect_uri':_0x51445a['serverUrl'],'code':_0x51445a['code']},'headers':{'Content-Type':_0xcf30('0x19')}};return rp(_0x243809)[_0xcf30('0x1a')](function(_0x4f97e6){var _0x2848d7=JSON[_0xcf30('0x1b')](_0x4f97e6);if(_0x2848d7[_0xcf30('0x1c')]){_0x51445a[_0xcf30('0x1d')]=_0x2848d7[_0xcf30('0x1c')];logger[_0xcf30('0x1e')](util[_0xcf30('0x1f')](_0xcf30('0x20'),_0x51445a['name'],_0x51445a['id']));}else{logger[_0xcf30('0x21')](util[_0xcf30('0x1f')](_0xcf30('0x22'),_0x51445a[_0xcf30('0x23')],_0x51445a['id']),util[_0xcf30('0x24')](_0x2848d7,{'showHidden':![],'depth':null}));}return _0x523b2d(null,_0x1c25fc);})['catch'](function(_0x37b07e){logger[_0xcf30('0x21')](util[_0xcf30('0x1f')](_0xcf30('0x22'),_0x51445a[_0xcf30('0x23')],_0x51445a['id']),util[_0xcf30('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x523b2d(_0x37b07e);});}else{return _0x523b2d(null,_0x1c25fc);}},'beforeUpdate':function(_0xb4e1dd,_0x5069e0,_0x36294e){if(_0xb4e1dd[_0xcf30('0xd')](_0xcf30('0x14'))||_0xb4e1dd[_0xcf30('0xd')](_0xcf30('0xe'))||_0xb4e1dd[_0xcf30('0xd')]('clientId')||_0xb4e1dd[_0xcf30('0xd')](_0xcf30('0x10'))||_0xb4e1dd['changed']('code')||_0xb4e1dd[_0xcf30('0xd')](_0xcf30('0x11'))){var _0x4a697d,_0x33bfaa;_0x4a697d=_0xb4e1dd['serverUrl'];var _0x30b363=_0x4a697d[_0xcf30('0x25')](-0x1);if(_0x30b363==='/'||_0x30b363==='\x5c'||_0x30b363===':'){_0x4a697d=_0x4a697d['substring'](0x0,_0x4a697d[_0xcf30('0x13')](_0x30b363));}switch(_0xb4e1dd['zone']){case'US':_0x33bfaa=_0xcf30('0x15');break;case'AU':_0x33bfaa='https://accounts.zoho.com.au';break;case'IN':_0x33bfaa=_0xcf30('0x16');break;case'CN':_0x33bfaa=_0xcf30('0x26');break;default:_0x33bfaa='https://accounts.zoho.eu';break;}var _0x19e554={'method':_0xcf30('0x17'),'uri':_0x33bfaa+_0xcf30('0x27'),'form':{'grant_type':_0xcf30('0x18'),'client_id':_0xb4e1dd[_0xcf30('0xf')],'client_secret':_0xb4e1dd['clientSecret'],'redirect_uri':_0xb4e1dd[_0xcf30('0xe')],'code':_0xb4e1dd[_0xcf30('0x28')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x19e554)[_0xcf30('0x1a')](function(_0x1bccd6){var _0x386bdf=JSON[_0xcf30('0x1b')](_0x1bccd6);if(_0x386bdf['refresh_token']){_0xb4e1dd[_0xcf30('0x1d')]=_0x386bdf[_0xcf30('0x1c')];logger['info'](util[_0xcf30('0x1f')](_0xcf30('0x20'),_0xb4e1dd[_0xcf30('0x23')],_0xb4e1dd['id']));}else{logger[_0xcf30('0x21')](util[_0xcf30('0x1f')](_0xcf30('0x22'),_0xb4e1dd[_0xcf30('0x23')],_0xb4e1dd['id']),util[_0xcf30('0x24')](_0x386bdf,{'showHidden':![],'depth':null}));}return _0x36294e(null,_0x5069e0);})[_0xcf30('0x29')](function(_0x2324f5){logger[_0xcf30('0x21')](util[_0xcf30('0x1f')](_0xcf30('0x22'),_0xb4e1dd[_0xcf30('0x23')],_0xb4e1dd['id']),util[_0xcf30('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x36294e(_0x2324f5);});}else{return _0x36294e(null,_0x5069e0);}}}});};
\ No newline at end of file
+var _0xd6fe=['util','../../config/logger','moment','bluebird','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientSecret','host','slice','substring','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','clientId','code','application/x-www-form-urlencoded','parse','refresh_token','refreshToken','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','catch','inspect','lastIndexOf','https://accounts.zoho.com.cn','info'];(function(_0x1c018f,_0x132d06){var _0x3adfeb=function(_0x2a972b){while(--_0x2a972b){_0x1c018f['push'](_0x1c018f['shift']());}};_0x3adfeb(++_0x132d06);}(_0xd6fe,0x171));var _0xed6f=function(_0x59552e,_0x5d8fad){_0x59552e=_0x59552e-0x0;var _0x487577=_0xd6fe[_0x59552e];return _0x487577;};'use strict';var _=require('lodash');var util=require(_0xed6f('0x0'));var logger=require(_0xed6f('0x1'))('api');var moment=require(_0xed6f('0x2'));var BPromise=require(_0xed6f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed6f('0x4'));var rimraf=require('rimraf');var config=require(_0xed6f('0x5'));var attributes=require(_0xed6f('0x6'));var integrations=require(_0xed6f('0x7'));module[_0xed6f('0x8')]=function(_0x46f7a8,_0x206f6d){return _0x46f7a8[_0xed6f('0x9')](_0xed6f('0xa'),attributes,{'tableName':_0xed6f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xfe4589,_0x34bd92,_0x1f90f6){if(_0xfe4589['changed']('zone')||_0xfe4589[_0xed6f('0xc')](_0xed6f('0xd'))||_0xfe4589['changed']('clientId')||_0xfe4589[_0xed6f('0xc')](_0xed6f('0xe'))||_0xfe4589[_0xed6f('0xc')]('code')||_0xfe4589[_0xed6f('0xc')](_0xed6f('0xf'))){var _0x24dea0,_0x497a22;_0x24dea0=_0xfe4589['serverUrl'];var _0x30d38d=_0x24dea0[_0xed6f('0x10')](-0x1);if(_0x30d38d==='/'||_0x30d38d==='\x5c'||_0x30d38d===':'){_0x24dea0=_0x24dea0[_0xed6f('0x11')](0x0,_0x24dea0['lastIndexOf'](_0x30d38d));}switch(_0xfe4589[_0xed6f('0x12')]){case'US':_0x497a22=_0xed6f('0x13');break;case'AU':_0x497a22=_0xed6f('0x14');break;case'IN':_0x497a22=_0xed6f('0x15');break;case'CN':_0x497a22='https://accounts.zoho.com.cn';break;default:_0x497a22=_0xed6f('0x16');break;}var _0x729fbc={'method':'POST','uri':_0x497a22+_0xed6f('0x17'),'form':{'grant_type':_0xed6f('0x18'),'client_id':_0xfe4589[_0xed6f('0x19')],'client_secret':_0xfe4589[_0xed6f('0xe')],'redirect_uri':_0xfe4589[_0xed6f('0xd')],'code':_0xfe4589[_0xed6f('0x1a')]},'headers':{'Content-Type':_0xed6f('0x1b')}};return rp(_0x729fbc)['then'](function(_0x27530d){var _0x105afd=JSON[_0xed6f('0x1c')](_0x27530d);if(_0x105afd[_0xed6f('0x1d')]){_0xfe4589[_0xed6f('0x1e')]=_0x105afd[_0xed6f('0x1d')];logger['info'](util[_0xed6f('0x1f')](_0xed6f('0x20'),_0xfe4589[_0xed6f('0x21')],_0xfe4589['id']));}else{logger[_0xed6f('0x22')](util[_0xed6f('0x1f')](_0xed6f('0x23'),_0xfe4589[_0xed6f('0x21')],_0xfe4589['id']),util['inspect'](_0x105afd,{'showHidden':![],'depth':null}));}return _0x1f90f6(null,_0x34bd92);})[_0xed6f('0x24')](function(_0x4be099){logger[_0xed6f('0x22')](util[_0xed6f('0x1f')](_0xed6f('0x23'),_0xfe4589[_0xed6f('0x21')],_0xfe4589['id']),util[_0xed6f('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x1f90f6(_0x4be099);});}else{return _0x1f90f6(null,_0x34bd92);}},'beforeUpdate':function(_0x37119e,_0x11a1e4,_0x2dfffc){if(_0x37119e['changed'](_0xed6f('0x12'))||_0x37119e[_0xed6f('0xc')](_0xed6f('0xd'))||_0x37119e[_0xed6f('0xc')](_0xed6f('0x19'))||_0x37119e[_0xed6f('0xc')](_0xed6f('0xe'))||_0x37119e[_0xed6f('0xc')](_0xed6f('0x1a'))||_0x37119e[_0xed6f('0xc')]('host')){var _0x3dd54d,_0x1f1cb6;_0x3dd54d=_0x37119e['serverUrl'];var _0x138bce=_0x3dd54d['slice'](-0x1);if(_0x138bce==='/'||_0x138bce==='\x5c'||_0x138bce===':'){_0x3dd54d=_0x3dd54d[_0xed6f('0x11')](0x0,_0x3dd54d[_0xed6f('0x26')](_0x138bce));}switch(_0x37119e[_0xed6f('0x12')]){case'US':_0x1f1cb6=_0xed6f('0x13');break;case'AU':_0x1f1cb6=_0xed6f('0x14');break;case'IN':_0x1f1cb6=_0xed6f('0x15');break;case'CN':_0x1f1cb6=_0xed6f('0x27');break;default:_0x1f1cb6=_0xed6f('0x16');break;}var _0x578f21={'method':'POST','uri':_0x1f1cb6+_0xed6f('0x17'),'form':{'grant_type':'authorization_code','client_id':_0x37119e[_0xed6f('0x19')],'client_secret':_0x37119e['clientSecret'],'redirect_uri':_0x37119e['serverUrl'],'code':_0x37119e[_0xed6f('0x1a')]},'headers':{'Content-Type':_0xed6f('0x1b')}};return rp(_0x578f21)['then'](function(_0x2155e8){var _0x5b735b=JSON[_0xed6f('0x1c')](_0x2155e8);if(_0x5b735b[_0xed6f('0x1d')]){_0x37119e['refreshToken']=_0x5b735b[_0xed6f('0x1d')];logger[_0xed6f('0x28')](util['format'](_0xed6f('0x20'),_0x37119e['name'],_0x37119e['id']));}else{logger[_0xed6f('0x22')](util[_0xed6f('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x37119e[_0xed6f('0x21')],_0x37119e['id']),util[_0xed6f('0x25')](_0x5b735b,{'showHidden':![],'depth':null}));}return _0x2dfffc(null,_0x11a1e4);})['catch'](function(_0x251439){logger['error'](util[_0xed6f('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x37119e[_0xed6f('0x21')],_0x37119e['id']),util[_0xed6f('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x2dfffc(_0x251439);});}else{return _0x2dfffc(null,_0x11a1e4);}}}});};
\ No newline at end of file
index 328dbd7..bbe2dbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8969=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','request\x20sent','debug','stringify','error','message','ZohoAccount,\x20%s,\x20%s','result','catch','GetZohoAccount','findAll','options','raw','where','limit','map','include','attributes','model','then','ShowZohoAccount','ZohoAccount','find','lodash','moment'];(function(_0x2b91de,_0x54e732){var _0x5ef771=function(_0x40264c){while(--_0x40264c){_0x2b91de['push'](_0x2b91de['shift']());}};_0x5ef771(++_0x54e732);}(_0x8969,0x130));var _0x9896=function(_0x53da95,_0x5be042){_0x53da95=_0x53da95-0x0;var _0xc33e0c=_0x8969[_0x53da95];return _0xc33e0c;};'use strict';var _=require(_0x9896('0x0'));var util=require('util');var moment=require(_0x9896('0x1'));var BPromise=require(_0x9896('0x2'));var rs=require(_0x9896('0x3'));var fs=require('fs');var Redis=require(_0x9896('0x4'));var db=require(_0x9896('0x5'))['db'];var utils=require(_0x9896('0x6'));var logger=require(_0x9896('0x7'))('rpc');var config=require(_0x9896('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9896('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25ea98,_0x260577,_0x4c9c5c){return new BPromise(function(_0x1aa0d1,_0x281745){return client[_0x9896('0xa')](_0x25ea98,_0x4c9c5c)['then'](function(_0xbf6b82){logger[_0x9896('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x260577,_0x9896('0xc'));logger[_0x9896('0xd')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x260577,_0x9896('0xc'),JSON[_0x9896('0xe')](_0xbf6b82));if(_0xbf6b82[_0x9896('0xf')]){if(_0xbf6b82[_0x9896('0xf')]['code']===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x260577,_0xbf6b82[_0x9896('0xf')][_0x9896('0x10')]);return _0x281745(_0xbf6b82[_0x9896('0xf')][_0x9896('0x10')]);}logger[_0x9896('0xf')](_0x9896('0x11'),_0x260577,_0xbf6b82[_0x9896('0xf')][_0x9896('0x10')]);return _0x1aa0d1(_0xbf6b82[_0x9896('0xf')][_0x9896('0x10')]);}else{logger['info'](_0x9896('0x11'),_0x260577,'request\x20sent');_0x1aa0d1(_0xbf6b82[_0x9896('0x12')][_0x9896('0x10')]);}})[_0x9896('0x13')](function(_0x42ccee){logger['error'](_0x9896('0x11'),_0x260577,_0x42ccee);_0x281745(_0x42ccee);});});}exports[_0x9896('0x14')]=function(_0x3f8061){var _0x23bb00=this;return new Promise(function(_0x4f79dc,_0x1a25a8){return db['ZohoAccount'][_0x9896('0x15')]({'raw':_0x3f8061[_0x9896('0x16')]?_0x3f8061['options'][_0x9896('0x17')]===undefined?!![]:![]:!![],'where':_0x3f8061[_0x9896('0x16')]?_0x3f8061[_0x9896('0x16')][_0x9896('0x18')]||null:null,'attributes':_0x3f8061[_0x9896('0x16')]?_0x3f8061[_0x9896('0x16')]['attributes']||null:null,'limit':_0x3f8061[_0x9896('0x16')]?_0x3f8061[_0x9896('0x16')][_0x9896('0x19')]||null:null,'include':_0x3f8061[_0x9896('0x16')]?_0x3f8061[_0x9896('0x16')]['include']?_[_0x9896('0x1a')](_0x3f8061[_0x9896('0x16')][_0x9896('0x1b')],function(_0x550ed9){return{'model':db[_0x550ed9['model']],'as':_0x550ed9['as'],'attributes':_0x550ed9[_0x9896('0x1c')],'include':_0x550ed9[_0x9896('0x1b')]?_[_0x9896('0x1a')](_0x550ed9[_0x9896('0x1b')],function(_0xd33728){return{'model':db[_0xd33728[_0x9896('0x1d')]],'as':_0xd33728['as'],'attributes':_0xd33728['attributes'],'include':_0xd33728['include']?_[_0x9896('0x1a')](_0xd33728['include'],function(_0x2b681e){return{'model':db[_0x2b681e[_0x9896('0x1d')]],'as':_0x2b681e['as'],'attributes':_0x2b681e[_0x9896('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9896('0x1e')](function(_0x3b9ee2){logger[_0x9896('0xb')](_0x9896('0x14'),_0x3f8061);logger[_0x9896('0xd')](_0x9896('0x14'),_0x3f8061,JSON[_0x9896('0xe')](_0x3b9ee2));_0x4f79dc(_0x3b9ee2);})[_0x9896('0x13')](function(_0x45129f){logger[_0x9896('0xf')](_0x9896('0x14'),_0x45129f[_0x9896('0x10')],_0x3f8061);_0x1a25a8(_0x23bb00[_0x9896('0xf')](0x1f4,_0x45129f['message']));});});};exports[_0x9896('0x1f')]=function(_0x503ead){var _0x238e99=this;return new Promise(function(_0x573671,_0x4e9b6a){return db[_0x9896('0x20')][_0x9896('0x21')]({'raw':_0x503ead['options']?_0x503ead[_0x9896('0x16')][_0x9896('0x17')]===undefined?!![]:![]:!![],'where':_0x503ead[_0x9896('0x16')]?_0x503ead['options'][_0x9896('0x18')]||null:null,'attributes':_0x503ead[_0x9896('0x16')]?_0x503ead['options'][_0x9896('0x1c')]||null:null,'include':_0x503ead[_0x9896('0x16')]?_0x503ead[_0x9896('0x16')][_0x9896('0x1b')]?_[_0x9896('0x1a')](_0x503ead[_0x9896('0x16')][_0x9896('0x1b')],function(_0x1d593b){return{'model':db[_0x1d593b[_0x9896('0x1d')]],'as':_0x1d593b['as'],'attributes':_0x1d593b[_0x9896('0x1c')],'include':_0x1d593b[_0x9896('0x1b')]?_[_0x9896('0x1a')](_0x1d593b['include'],function(_0x441048){return{'model':db[_0x441048[_0x9896('0x1d')]],'as':_0x441048['as'],'attributes':_0x441048[_0x9896('0x1c')],'include':_0x441048[_0x9896('0x1b')]?_[_0x9896('0x1a')](_0x441048['include'],function(_0x1fa679){return{'model':db[_0x1fa679[_0x9896('0x1d')]],'as':_0x1fa679['as'],'attributes':_0x1fa679[_0x9896('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9896('0x1e')](function(_0x33fd00){logger[_0x9896('0xb')](_0x9896('0x1f'),_0x503ead);logger[_0x9896('0xd')](_0x9896('0x1f'),_0x503ead,JSON[_0x9896('0xe')](_0x33fd00));_0x573671(_0x33fd00);})[_0x9896('0x13')](function(_0x2b33c4){logger[_0x9896('0xf')]('ShowZohoAccount',_0x2b33c4[_0x9896('0x10')],_0x503ead);_0x4e9b6a(_0x238e99['error'](0x1f4,_0x2b33c4['message']));});});};
\ No newline at end of file
+var _0xc1dc=['ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc1dc,0x84));var _0xcc1d=function(_0x36312f,_0x4036bd){_0x36312f=_0x36312f-0x0;var _0x23400e=_0xc1dc[_0x36312f];return _0x23400e;};'use strict';var _=require(_0xcc1d('0x0'));var util=require(_0xcc1d('0x1'));var moment=require(_0xcc1d('0x2'));var BPromise=require('bluebird');var rs=require(_0xcc1d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc1d('0x4'))['db'];var utils=require(_0xcc1d('0x5'));var logger=require('../../config/logger')(_0xcc1d('0x6'));var config=require(_0xcc1d('0x7'));var jayson=require(_0xcc1d('0x8'));var client=jayson[_0xcc1d('0x9')][_0xcc1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x597eb8,_0x4dc8ee,_0x23e085){return new BPromise(function(_0x24d561,_0x6e9800){return client[_0xcc1d('0xb')](_0x597eb8,_0x23e085)[_0xcc1d('0xc')](function(_0x171592){logger['info'](_0xcc1d('0xd'),_0x4dc8ee,_0xcc1d('0xe'));logger[_0xcc1d('0xf')](_0xcc1d('0x10'),_0x4dc8ee,_0xcc1d('0xe'),JSON[_0xcc1d('0x11')](_0x171592));if(_0x171592['error']){if(_0x171592[_0xcc1d('0x12')][_0xcc1d('0x13')]===0x1f4){logger['error'](_0xcc1d('0xd'),_0x4dc8ee,_0x171592[_0xcc1d('0x12')][_0xcc1d('0x14')]);return _0x6e9800(_0x171592[_0xcc1d('0x12')][_0xcc1d('0x14')]);}logger[_0xcc1d('0x12')](_0xcc1d('0xd'),_0x4dc8ee,_0x171592['error']['message']);return _0x24d561(_0x171592[_0xcc1d('0x12')]['message']);}else{logger[_0xcc1d('0x15')](_0xcc1d('0xd'),_0x4dc8ee,_0xcc1d('0xe'));_0x24d561(_0x171592[_0xcc1d('0x16')][_0xcc1d('0x14')]);}})[_0xcc1d('0x17')](function(_0x1f9737){logger[_0xcc1d('0x12')](_0xcc1d('0xd'),_0x4dc8ee,_0x1f9737);_0x6e9800(_0x1f9737);});});}exports[_0xcc1d('0x18')]=function(_0x483963){var _0x57a551=this;return new Promise(function(_0x2ee388,_0x536641){return db[_0xcc1d('0x19')][_0xcc1d('0x1a')]({'raw':_0x483963[_0xcc1d('0x1b')]?_0x483963[_0xcc1d('0x1b')][_0xcc1d('0x1c')]===undefined?!![]:![]:!![],'where':_0x483963[_0xcc1d('0x1b')]?_0x483963[_0xcc1d('0x1b')][_0xcc1d('0x1d')]||null:null,'attributes':_0x483963[_0xcc1d('0x1b')]?_0x483963['options'][_0xcc1d('0x1e')]||null:null,'limit':_0x483963['options']?_0x483963[_0xcc1d('0x1b')][_0xcc1d('0x1f')]||null:null,'include':_0x483963[_0xcc1d('0x1b')]?_0x483963['options'][_0xcc1d('0x20')]?_[_0xcc1d('0x21')](_0x483963[_0xcc1d('0x1b')][_0xcc1d('0x20')],function(_0xac9e86){return{'model':db[_0xac9e86['model']],'as':_0xac9e86['as'],'attributes':_0xac9e86[_0xcc1d('0x1e')],'include':_0xac9e86['include']?_[_0xcc1d('0x21')](_0xac9e86[_0xcc1d('0x20')],function(_0x3f8b30){return{'model':db[_0x3f8b30[_0xcc1d('0x22')]],'as':_0x3f8b30['as'],'attributes':_0x3f8b30[_0xcc1d('0x1e')],'include':_0x3f8b30['include']?_[_0xcc1d('0x21')](_0x3f8b30[_0xcc1d('0x20')],function(_0xec0667){return{'model':db[_0xec0667['model']],'as':_0xec0667['as'],'attributes':_0xec0667[_0xcc1d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d2b0c){logger['info'](_0xcc1d('0x18'),_0x483963);logger[_0xcc1d('0xf')](_0xcc1d('0x18'),_0x483963,JSON['stringify'](_0x2d2b0c));_0x2ee388(_0x2d2b0c);})[_0xcc1d('0x17')](function(_0x10f5d3){logger[_0xcc1d('0x12')]('GetZohoAccount',_0x10f5d3[_0xcc1d('0x14')],_0x483963);_0x536641(_0x57a551['error'](0x1f4,_0x10f5d3[_0xcc1d('0x14')]));});});};exports[_0xcc1d('0x23')]=function(_0x14a4d4){var _0x380bd2=this;return new Promise(function(_0x5f70cc,_0x5d9163){return db[_0xcc1d('0x19')][_0xcc1d('0x24')]({'raw':_0x14a4d4['options']?_0x14a4d4[_0xcc1d('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x14a4d4[_0xcc1d('0x1b')]?_0x14a4d4['options']['where']||null:null,'attributes':_0x14a4d4[_0xcc1d('0x1b')]?_0x14a4d4['options'][_0xcc1d('0x1e')]||null:null,'include':_0x14a4d4[_0xcc1d('0x1b')]?_0x14a4d4[_0xcc1d('0x1b')][_0xcc1d('0x20')]?_[_0xcc1d('0x21')](_0x14a4d4[_0xcc1d('0x1b')]['include'],function(_0x1610f9){return{'model':db[_0x1610f9['model']],'as':_0x1610f9['as'],'attributes':_0x1610f9[_0xcc1d('0x1e')],'include':_0x1610f9[_0xcc1d('0x20')]?_[_0xcc1d('0x21')](_0x1610f9[_0xcc1d('0x20')],function(_0x5864a9){return{'model':db[_0x5864a9[_0xcc1d('0x22')]],'as':_0x5864a9['as'],'attributes':_0x5864a9[_0xcc1d('0x1e')],'include':_0x5864a9[_0xcc1d('0x20')]?_[_0xcc1d('0x21')](_0x5864a9[_0xcc1d('0x20')],function(_0x26910c){return{'model':db[_0x26910c[_0xcc1d('0x22')]],'as':_0x26910c['as'],'attributes':_0x26910c[_0xcc1d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcc1d('0xc')](function(_0x21af60){logger['info']('ShowZohoAccount',_0x14a4d4);logger[_0xcc1d('0xf')](_0xcc1d('0x23'),_0x14a4d4,JSON['stringify'](_0x21af60));_0x5f70cc(_0x21af60);})['catch'](function(_0x5e2df9){logger[_0xcc1d('0x12')](_0xcc1d('0x23'),_0x5e2df9[_0xcc1d('0x14')],_0x14a4d4);_0x5d9163(_0x380bd2[_0xcc1d('0x12')](0x1f4,_0x5e2df9[_0xcc1d('0x14')]));});});};
\ No newline at end of file
index 2eef5ae..10575a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae5b=['../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','update','destroy','exports','multer','connect-timeout','Router','fs-extra'];(function(_0x226ad1,_0x2858e2){var _0x16b625=function(_0x4dc555){while(--_0x4dc555){_0x226ad1['push'](_0x226ad1['shift']());}};_0x16b625(++_0x2858e2);}(_0xae5b,0xf8));var _0xbae5=function(_0x2902c2,_0x7c2acd){_0x2902c2=_0x2902c2-0x0;var _0x41e50d=_0xae5b[_0x2902c2];return _0x41e50d;};'use strict';var multer=require(_0xbae5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbae5('0x1'));var express=require('express');var router=express[_0xbae5('0x2')]();var fs_extra=require(_0xbae5('0x3'));var auth=require(_0xbae5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbae5('0x5'));var controller=require(_0xbae5('0x6'));router[_0xbae5('0x7')]('/',auth[_0xbae5('0x8')](),controller[_0xbae5('0x9')]);router['get'](_0xbae5('0xa'),auth[_0xbae5('0x8')](),controller['show']);router[_0xbae5('0x7')](_0xbae5('0xb'),auth['isAuthenticated'](),controller[_0xbae5('0xc')]);router[_0xbae5('0x7')](_0xbae5('0xd'),auth[_0xbae5('0x8')](),controller['getSubjects']);router[_0xbae5('0x7')](_0xbae5('0xe'),auth[_0xbae5('0x8')](),controller[_0xbae5('0xf')]);router[_0xbae5('0x10')]('/',auth[_0xbae5('0x8')](),controller[_0xbae5('0x11')]);router['put']('/:id',auth[_0xbae5('0x8')](),controller[_0xbae5('0x12')]);router['delete'](_0xbae5('0xa'),auth[_0xbae5('0x8')](),controller[_0xbae5('0x13')]);module[_0xbae5('0x14')]=router;
\ No newline at end of file
+var _0x7030=['getFields','/:id/subjects','getDescriptions','post','create','put','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields'];(function(_0x187279,_0x26d152){var _0x3da59d=function(_0x41c808){while(--_0x41c808){_0x187279['push'](_0x187279['shift']());}};_0x3da59d(++_0x26d152);}(_0x7030,0xfa));var _0x0703=function(_0x4bf853,_0x1fc141){_0x4bf853=_0x4bf853-0x0;var _0x38994f=_0x7030[_0x4bf853];return _0x38994f;};'use strict';var multer=require(_0x0703('0x0'));var util=require(_0x0703('0x1'));var path=require(_0x0703('0x2'));var timeout=require('connect-timeout');var express=require(_0x0703('0x3'));var router=express[_0x0703('0x4')]();var fs_extra=require(_0x0703('0x5'));var auth=require(_0x0703('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0703('0x7'));var controller=require(_0x0703('0x8'));router[_0x0703('0x9')]('/',auth[_0x0703('0xa')](),controller[_0x0703('0xb')]);router['get'](_0x0703('0xc'),auth[_0x0703('0xa')](),controller['show']);router[_0x0703('0x9')](_0x0703('0xd'),auth[_0x0703('0xa')](),controller[_0x0703('0xe')]);router[_0x0703('0x9')](_0x0703('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x0703('0x9')]('/:id/descriptions',auth[_0x0703('0xa')](),controller[_0x0703('0x10')]);router[_0x0703('0x11')]('/',auth[_0x0703('0xa')](),controller[_0x0703('0x12')]);router[_0x0703('0x13')](_0x0703('0xc'),auth[_0x0703('0xa')](),controller['update']);router[_0x0703('0x14')](_0x0703('0xc'),auth[_0x0703('0xa')](),controller['destroy']);module[_0x0703('0x15')]=router;
\ No newline at end of file
index 6e1088a..93d0275 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb95a=['contact','nothing','contact_lead','sequelize','exports','STRING','ENUM','lead'];(function(_0x5c5d8b,_0x4770b9){var _0x4407b2=function(_0x4fae58){while(--_0x4fae58){_0x5c5d8b['push'](_0x5c5d8b['shift']());}};_0x4407b2(++_0x4770b9);}(_0xb95a,0x13b));var _0xab95=function(_0x179fb1,_0x5a2bbc){_0x179fb1=_0x179fb1-0x0;var _0x4fa3b0=_0xb95a[_0x179fb1];return _0x4fa3b0;};'use strict';var Sequelize=require(_0xab95('0x0'));module[_0xab95('0x1')]={'name':{'type':Sequelize[_0xab95('0x2')]},'moduleCreate':{'type':Sequelize[_0xab95('0x3')](_0xab95('0x4'),_0xab95('0x5'),_0xab95('0x6')),'defaultValue':_0xab95('0x4')},'moduleSearch':{'type':Sequelize[_0xab95('0x3')](_0xab95('0x7'),_0xab95('0x5'),_0xab95('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xab95('0x2')]}};
\ No newline at end of file
+var _0x8db9=['contact','nothing','contact_lead','sequelize','exports','STRING','lead'];(function(_0x1f255b,_0x3d2166){var _0x5496b0=function(_0x22eef0){while(--_0x22eef0){_0x1f255b['push'](_0x1f255b['shift']());}};_0x5496b0(++_0x3d2166);}(_0x8db9,0x1a0));var _0x98db=function(_0xc0247c,_0x61a80a){_0xc0247c=_0xc0247c-0x0;var _0x3698b4=_0x8db9[_0xc0247c];return _0x3698b4;};'use strict';var Sequelize=require(_0x98db('0x0'));module[_0x98db('0x1')]={'name':{'type':Sequelize[_0x98db('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x98db('0x3'),_0x98db('0x4'),_0x98db('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x98db('0x4'),'lead'),'defaultValue':_0x98db('0x6')},'description':{'type':Sequelize[_0x98db('0x2')]}};
\ No newline at end of file
index a90ce37..26c86b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18b8=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','rawAttributes','includeAll','catch','create','body','params','find','getFields','findOne','ZohoField','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','ZohoConfiguration','fieldName','type'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x18b8,0x119));var _0x818b=function(_0x5d2147,_0x52b0dd){_0x5d2147=_0x5d2147-0x0;var _0x33716b=_0x18b8[_0x5d2147];return _0x33716b;};'use strict';var emlformat=require(_0x818b('0x0'));var rimraf=require(_0x818b('0x1'));var zipdir=require(_0x818b('0x2'));var jsonpatch=require(_0x818b('0x3'));var rp=require(_0x818b('0x4'));var moment=require(_0x818b('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x818b('0x6'));var path=require(_0x818b('0x7'));var sox=require('sox');var csv=require(_0x818b('0x8'));var ejs=require(_0x818b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x818b('0xa'));var squel=require(_0x818b('0xb'));var crypto=require(_0x818b('0xc'));var jsforce=require(_0x818b('0xd'));var deskjs=require(_0x818b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x818b('0xf'));var Redis=require(_0x818b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x818b('0x11'));var as=require(_0x818b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x818b('0x13'))('api');var utils=require(_0x818b('0x14'));var config=require(_0x818b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x818b('0x16'))['db'];function respondWithStatusCode(_0x595fce,_0x59007c){_0x59007c=_0x59007c||0xcc;return function(_0x5c78bc){if(_0x5c78bc){return _0x595fce[_0x818b('0x17')](_0x59007c);}return _0x595fce['status'](_0x59007c)[_0x818b('0x18')]();};}function respondWithResult(_0x4dc81f,_0x4c3c41){_0x4c3c41=_0x4c3c41||0xc8;return function(_0x21b994){if(_0x21b994){return _0x4dc81f[_0x818b('0x19')](_0x4c3c41)['json'](_0x21b994);}};}function respondWithFilteredResult(_0x5afdc1,_0x543187){return function(_0x220f26){if(_0x220f26){var _0x5f0601=typeof _0x543187[_0x818b('0x1a')]===_0x818b('0x1b')&&typeof _0x543187[_0x818b('0x1c')]===_0x818b('0x1b');var _0x49682d=_0x220f26[_0x818b('0x1d')];var _0x186713=_0x5f0601?0x0:_0x543187[_0x818b('0x1a')];var _0x273c72=_0x5f0601?_0x220f26[_0x818b('0x1d')]:_0x543187[_0x818b('0x1a')]+_0x543187['limit'];var _0x4e2e27;if(_0x273c72>=_0x49682d){_0x273c72=_0x49682d;_0x4e2e27=0xc8;}else{_0x4e2e27=0xce;}_0x5afdc1[_0x818b('0x19')](_0x4e2e27);return _0x5afdc1[_0x818b('0x1e')](_0x818b('0x1f'),_0x186713+'-'+_0x273c72+'/'+_0x49682d)[_0x818b('0x20')](_0x220f26);}return null;};}function patchUpdates(_0x2ff999){return function(_0x5bb7af){try{jsonpatch[_0x818b('0x21')](_0x5bb7af,_0x2ff999,!![]);}catch(_0x173397){return BPromise[_0x818b('0x22')](_0x173397);}return _0x5bb7af[_0x818b('0x23')]();};}function saveUpdates(_0x31cac3,_0x2523da){return function(_0x36215d){if(_0x36215d){return _0x36215d[_0x818b('0x24')](_0x31cac3)[_0x818b('0x25')](function(_0x3371f7){return _0x3371f7;});}return null;};}function removeEntity(_0x59ce60,_0x555b06){return function(_0x21a85d){if(_0x21a85d){return _0x21a85d[_0x818b('0x26')]()[_0x818b('0x25')](function(){_0x59ce60['status'](0xcc)[_0x818b('0x18')]();});}};}function handleEntityNotFound(_0x533671,_0x53dc90){return function(_0x3ab7af){if(!_0x3ab7af){_0x533671[_0x818b('0x17')](0x194);}return _0x3ab7af;};}function handleError(_0x3f0275,_0x9b7d59){_0x9b7d59=_0x9b7d59||0x1f4;return function(_0x3e78e8){logger[_0x818b('0x27')](_0x3e78e8[_0x818b('0x28')]);if(_0x3e78e8[_0x818b('0x29')]){delete _0x3e78e8[_0x818b('0x29')];}_0x3f0275[_0x818b('0x19')](_0x9b7d59)['send'](_0x3e78e8);};}exports[_0x818b('0x2a')]=function(_0x4513c8,_0x402c80){var _0x2ea7e1={},_0x3b6e4c={},_0x2e9920={'count':0x0,'rows':[]};var _0x4fec7b=_[_0x818b('0x2b')](db[_0x818b('0x2c')]['rawAttributes'],function(_0x4f83c5){return{'name':_0x4f83c5[_0x818b('0x2d')],'type':_0x4f83c5[_0x818b('0x2e')][_0x818b('0x2f')]};});_0x3b6e4c[_0x818b('0x30')]=_['map'](_0x4fec7b,_0x818b('0x29'));_0x3b6e4c[_0x818b('0x31')]=_[_0x818b('0x32')](_0x4513c8[_0x818b('0x31')]);_0x3b6e4c[_0x818b('0x33')]=_[_0x818b('0x34')](_0x3b6e4c[_0x818b('0x30')],_0x3b6e4c[_0x818b('0x31')]);_0x2ea7e1[_0x818b('0x35')]=_[_0x818b('0x34')](_0x3b6e4c[_0x818b('0x30')],qs[_0x818b('0x36')](_0x4513c8[_0x818b('0x31')][_0x818b('0x36')]));_0x2ea7e1[_0x818b('0x35')]=_0x2ea7e1[_0x818b('0x35')][_0x818b('0x37')]?_0x2ea7e1[_0x818b('0x35')]:_0x3b6e4c[_0x818b('0x30')];if(!_0x4513c8[_0x818b('0x31')][_0x818b('0x38')]('nolimit')){_0x2ea7e1[_0x818b('0x1c')]=qs[_0x818b('0x1c')](_0x4513c8[_0x818b('0x31')]['limit']);_0x2ea7e1['offset']=qs[_0x818b('0x1a')](_0x4513c8['query'][_0x818b('0x1a')]);}_0x2ea7e1[_0x818b('0x39')]=qs[_0x818b('0x3a')](_0x4513c8[_0x818b('0x31')]['sort']);_0x2ea7e1[_0x818b('0x3b')]=qs[_0x818b('0x33')](_[_0x818b('0x3c')](_0x4513c8[_0x818b('0x31')],_0x3b6e4c[_0x818b('0x33')]),_0x4fec7b);if(_0x4513c8[_0x818b('0x31')][_0x818b('0x3d')]){_0x2ea7e1['where']=_['merge'](_0x2ea7e1['where'],{'$or':_[_0x818b('0x2b')](_0x4fec7b,function(_0x5f133d){if(_0x5f133d[_0x818b('0x2e')]!==_0x818b('0x3e')){var _0x5a32ff={};_0x5a32ff[_0x5f133d[_0x818b('0x29')]]={'$like':'%'+_0x4513c8[_0x818b('0x31')][_0x818b('0x3d')]+'%'};return _0x5a32ff;}})});}_0x2ea7e1=_[_0x818b('0x3f')]({},_0x2ea7e1,_0x4513c8[_0x818b('0x40')]);var _0x367a11={'where':_0x2ea7e1[_0x818b('0x3b')]};return db['ZohoConfiguration']['count'](_0x367a11)[_0x818b('0x25')](function(_0x40ba3d){_0x2e9920[_0x818b('0x1d')]=_0x40ba3d;if(_0x4513c8[_0x818b('0x31')]['includeAll']){_0x2ea7e1[_0x818b('0x41')]=[{'all':!![]}];}return db[_0x818b('0x2c')][_0x818b('0x42')](_0x2ea7e1);})[_0x818b('0x25')](function(_0x578541){_0x2e9920[_0x818b('0x43')]=_0x578541;return _0x2e9920;})[_0x818b('0x25')](respondWithFilteredResult(_0x402c80,_0x2ea7e1))['catch'](handleError(_0x402c80,null));};exports[_0x818b('0x44')]=function(_0x52637f,_0x134fa4){var _0x1c7238={'raw':![],'where':{'id':_0x52637f['params']['id']}},_0x307c3e={};_0x307c3e['model']=_[_0x818b('0x32')](db[_0x818b('0x2c')][_0x818b('0x45')]);_0x307c3e[_0x818b('0x31')]=_[_0x818b('0x32')](_0x52637f['query']);_0x307c3e[_0x818b('0x33')]=_[_0x818b('0x34')](_0x307c3e[_0x818b('0x30')],_0x307c3e[_0x818b('0x31')]);_0x1c7238[_0x818b('0x35')]=_[_0x818b('0x34')](_0x307c3e[_0x818b('0x30')],qs[_0x818b('0x36')](_0x52637f[_0x818b('0x31')][_0x818b('0x36')]));_0x1c7238['attributes']=_0x1c7238['attributes']['length']?_0x1c7238['attributes']:_0x307c3e[_0x818b('0x30')];if(_0x52637f[_0x818b('0x31')][_0x818b('0x46')]){_0x1c7238[_0x818b('0x41')]=[{'all':!![]}];}_0x1c7238=_[_0x818b('0x3f')]({},_0x1c7238,_0x52637f[_0x818b('0x40')]);return db[_0x818b('0x2c')]['find'](_0x1c7238)[_0x818b('0x25')](handleEntityNotFound(_0x134fa4,null))[_0x818b('0x25')](respondWithResult(_0x134fa4,null))[_0x818b('0x47')](handleError(_0x134fa4,null));};exports[_0x818b('0x48')]=function(_0x55777b,_0x336aaa){return db[_0x818b('0x2c')][_0x818b('0x48')](_0x55777b[_0x818b('0x49')],{})['then'](respondWithResult(_0x336aaa,0xc9))[_0x818b('0x47')](handleError(_0x336aaa,null));};exports[_0x818b('0x24')]=function(_0x1a7359,_0x104165){if(_0x1a7359[_0x818b('0x49')]['id']){delete _0x1a7359[_0x818b('0x49')]['id'];}return db[_0x818b('0x2c')]['find']({'where':{'id':_0x1a7359[_0x818b('0x4a')]['id']}})[_0x818b('0x25')](handleEntityNotFound(_0x104165,null))[_0x818b('0x25')](saveUpdates(_0x1a7359[_0x818b('0x49')],null))['then'](respondWithResult(_0x104165,null))['catch'](handleError(_0x104165,null));};exports[_0x818b('0x26')]=function(_0x26b834,_0x874676){return db[_0x818b('0x2c')][_0x818b('0x4b')]({'where':{'id':_0x26b834[_0x818b('0x4a')]['id']}})[_0x818b('0x25')](handleEntityNotFound(_0x874676,null))[_0x818b('0x25')](removeEntity(_0x874676,null))[_0x818b('0x47')](handleError(_0x874676,null));};exports[_0x818b('0x4c')]=function(_0x5a1762,_0x596dc7,_0x20e082){var _0x391209={};var _0x4cc775={};var _0x3ae148;var _0x466e31;return db[_0x818b('0x2c')][_0x818b('0x4d')]({'where':{'id':_0x5a1762['params']['id']}})[_0x818b('0x25')](handleEntityNotFound(_0x596dc7,null))[_0x818b('0x25')](function(_0x3e90e9){if(_0x3e90e9){_0x3ae148=_0x3e90e9;_0x4cc775['model']=_['keys'](db[_0x818b('0x4e')]['rawAttributes']);_0x4cc775[_0x818b('0x31')]=_[_0x818b('0x32')](_0x5a1762[_0x818b('0x31')]);_0x4cc775[_0x818b('0x33')]=_[_0x818b('0x34')](_0x4cc775[_0x818b('0x30')],_0x4cc775['query']);_0x391209[_0x818b('0x35')]=_[_0x818b('0x34')](_0x4cc775[_0x818b('0x30')],qs[_0x818b('0x36')](_0x5a1762[_0x818b('0x31')][_0x818b('0x36')]));_0x391209[_0x818b('0x35')]=_0x391209['attributes']['length']?_0x391209[_0x818b('0x35')]:_0x4cc775['model'];_0x391209[_0x818b('0x39')]=qs[_0x818b('0x3a')](_0x5a1762[_0x818b('0x31')][_0x818b('0x3a')]);_0x391209[_0x818b('0x3b')]=qs[_0x818b('0x33')](_['pick'](_0x5a1762[_0x818b('0x31')],_0x4cc775['filters']));if(_0x5a1762['query'][_0x818b('0x3d')]){_0x391209[_0x818b('0x3b')]=_[_0x818b('0x3f')](_0x391209[_0x818b('0x3b')],{'$or':_[_0x818b('0x2b')](_0x391209[_0x818b('0x35')],function(_0x3716b7){var _0x342661={};_0x342661[_0x3716b7]={'$like':'%'+_0x5a1762[_0x818b('0x31')][_0x818b('0x3d')]+'%'};return _0x342661;})});}_0x391209=_['merge']({},_0x391209,_0x5a1762[_0x818b('0x40')]);return _0x3ae148[_0x818b('0x4c')](_0x391209);}})[_0x818b('0x25')](function(_0x213fd4){if(_0x213fd4){_0x466e31=_0x213fd4[_0x818b('0x37')];if(!_0x5a1762[_0x818b('0x31')][_0x818b('0x38')]('nolimit')){_0x391209[_0x818b('0x1c')]=qs[_0x818b('0x1c')](_0x5a1762['query'][_0x818b('0x1c')]);_0x391209['offset']=qs['offset'](_0x5a1762[_0x818b('0x31')][_0x818b('0x1a')]);}return _0x3ae148[_0x818b('0x4c')](_0x391209);}})['then'](function(_0x5254dd){if(_0x5254dd){return _0x5254dd?{'count':_0x466e31,'rows':_0x5254dd}:null;}})[_0x818b('0x25')](respondWithResult(_0x596dc7,null))[_0x818b('0x47')](handleError(_0x596dc7,null));};exports[_0x818b('0x4f')]=function(_0x45e977,_0x478601,_0x51e692){var _0x3062a0={};var _0x534a3e={};var _0x5750ab;var _0x422dc3;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x45e977[_0x818b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x478601,null))['then'](function(_0x8ace38){if(_0x8ace38){_0x5750ab=_0x8ace38;_0x534a3e[_0x818b('0x30')]=_[_0x818b('0x32')](db[_0x818b('0x4e')][_0x818b('0x45')]);_0x534a3e[_0x818b('0x31')]=_[_0x818b('0x32')](_0x45e977[_0x818b('0x31')]);_0x534a3e[_0x818b('0x33')]=_['intersection'](_0x534a3e[_0x818b('0x30')],_0x534a3e[_0x818b('0x31')]);_0x3062a0[_0x818b('0x35')]=_[_0x818b('0x34')](_0x534a3e[_0x818b('0x30')],qs['fields'](_0x45e977[_0x818b('0x31')][_0x818b('0x36')]));_0x3062a0[_0x818b('0x35')]=_0x3062a0[_0x818b('0x35')][_0x818b('0x37')]?_0x3062a0[_0x818b('0x35')]:_0x534a3e['model'];_0x3062a0[_0x818b('0x39')]=qs['sort'](_0x45e977[_0x818b('0x31')]['sort']);_0x3062a0[_0x818b('0x3b')]=qs[_0x818b('0x33')](_['pick'](_0x45e977[_0x818b('0x31')],_0x534a3e[_0x818b('0x33')]));if(_0x45e977[_0x818b('0x31')][_0x818b('0x3d')]){_0x3062a0[_0x818b('0x3b')]=_[_0x818b('0x3f')](_0x3062a0[_0x818b('0x3b')],{'$or':_['map'](_0x3062a0[_0x818b('0x35')],function(_0x49e615){var _0x510436={};_0x510436[_0x49e615]={'$like':'%'+_0x45e977[_0x818b('0x31')][_0x818b('0x3d')]+'%'};return _0x510436;})});}_0x3062a0=_[_0x818b('0x3f')]({},_0x3062a0,_0x45e977[_0x818b('0x40')]);return _0x5750ab[_0x818b('0x4f')](_0x3062a0);}})[_0x818b('0x25')](function(_0x45d7d7){if(_0x45d7d7){_0x422dc3=_0x45d7d7[_0x818b('0x37')];if(!_0x45e977[_0x818b('0x31')][_0x818b('0x38')](_0x818b('0x50'))){_0x3062a0['limit']=qs[_0x818b('0x1c')](_0x45e977[_0x818b('0x31')][_0x818b('0x1c')]);_0x3062a0[_0x818b('0x1a')]=qs[_0x818b('0x1a')](_0x45e977[_0x818b('0x31')][_0x818b('0x1a')]);}return _0x5750ab[_0x818b('0x4f')](_0x3062a0);}})[_0x818b('0x25')](function(_0x304370){if(_0x304370){return _0x304370?{'count':_0x422dc3,'rows':_0x304370}:null;}})['then'](respondWithResult(_0x478601,null))[_0x818b('0x47')](handleError(_0x478601,null));};exports[_0x818b('0x51')]=function(_0x32a621,_0x2ba779,_0x1e8463){var _0x18b0ae={};var _0xd46e30={};var _0x1179f7;var _0x4ce685;return db['ZohoConfiguration'][_0x818b('0x4d')]({'where':{'id':_0x32a621[_0x818b('0x4a')]['id']}})[_0x818b('0x25')](handleEntityNotFound(_0x2ba779,null))[_0x818b('0x25')](function(_0x37a1ea){if(_0x37a1ea){_0x1179f7=_0x37a1ea;_0xd46e30[_0x818b('0x30')]=_[_0x818b('0x32')](db['ZohoField'][_0x818b('0x45')]);_0xd46e30['query']=_[_0x818b('0x32')](_0x32a621[_0x818b('0x31')]);_0xd46e30[_0x818b('0x33')]=_[_0x818b('0x34')](_0xd46e30['model'],_0xd46e30[_0x818b('0x31')]);_0x18b0ae[_0x818b('0x35')]=_[_0x818b('0x34')](_0xd46e30['model'],qs['fields'](_0x32a621['query'][_0x818b('0x36')]));_0x18b0ae['attributes']=_0x18b0ae[_0x818b('0x35')][_0x818b('0x37')]?_0x18b0ae[_0x818b('0x35')]:_0xd46e30['model'];_0x18b0ae[_0x818b('0x39')]=qs[_0x818b('0x3a')](_0x32a621['query'][_0x818b('0x3a')]);_0x18b0ae[_0x818b('0x3b')]=qs[_0x818b('0x33')](_[_0x818b('0x3c')](_0x32a621[_0x818b('0x31')],_0xd46e30[_0x818b('0x33')]));if(_0x32a621[_0x818b('0x31')][_0x818b('0x3d')]){_0x18b0ae[_0x818b('0x3b')]=_[_0x818b('0x3f')](_0x18b0ae['where'],{'$or':_['map'](_0x18b0ae[_0x818b('0x35')],function(_0x4abd38){var _0x8a051e={};_0x8a051e[_0x4abd38]={'$like':'%'+_0x32a621['query'][_0x818b('0x3d')]+'%'};return _0x8a051e;})});}_0x18b0ae=_[_0x818b('0x3f')]({},_0x18b0ae,_0x32a621[_0x818b('0x40')]);return _0x1179f7['getDescriptions'](_0x18b0ae);}})[_0x818b('0x25')](function(_0x343cc9){if(_0x343cc9){_0x4ce685=_0x343cc9[_0x818b('0x37')];if(!_0x32a621['query'][_0x818b('0x38')](_0x818b('0x50'))){_0x18b0ae['limit']=qs[_0x818b('0x1c')](_0x32a621['query']['limit']);_0x18b0ae[_0x818b('0x1a')]=qs[_0x818b('0x1a')](_0x32a621[_0x818b('0x31')]['offset']);}return _0x1179f7[_0x818b('0x51')](_0x18b0ae);}})[_0x818b('0x25')](function(_0x5adb13){if(_0x5adb13){return _0x5adb13?{'count':_0x4ce685,'rows':_0x5adb13}:null;}})[_0x818b('0x25')](respondWithResult(_0x2ba779,null))[_0x818b('0x47')](handleError(_0x2ba779,null));};
\ No newline at end of file
+var _0x8c15=['bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','rawAttributes','type','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','ZohoConfiguration','findAll','rows','catch','show','params','includeAll','find','create','body','ZohoField','pick','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x59e1c3,_0x35ab2e){var _0x27e3c9=function(_0x4718cb){while(--_0x4718cb){_0x59e1c3['push'](_0x59e1c3['shift']());}};_0x27e3c9(++_0x35ab2e);}(_0x8c15,0x9f));var _0x58c1=function(_0x20bed2,_0xb65140){_0x20bed2=_0x20bed2-0x0;var _0x26340b=_0x8c15[_0x20bed2];return _0x26340b;};'use strict';var emlformat=require(_0x58c1('0x0'));var rimraf=require(_0x58c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x58c1('0x2'));var rp=require(_0x58c1('0x3'));var moment=require(_0x58c1('0x4'));var BPromise=require(_0x58c1('0x5'));var Mustache=require(_0x58c1('0x6'));var util=require(_0x58c1('0x7'));var path=require('path');var sox=require(_0x58c1('0x8'));var csv=require(_0x58c1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x58c1('0xa'));var _=require(_0x58c1('0xb'));var squel=require(_0x58c1('0xc'));var crypto=require(_0x58c1('0xd'));var jsforce=require(_0x58c1('0xe'));var deskjs=require(_0x58c1('0xf'));var toCsv=require(_0x58c1('0x9'));var querystring=require(_0x58c1('0x10'));var Papa=require('papaparse');var Redis=require(_0x58c1('0x11'));var authService=require(_0x58c1('0x12'));var qs=require(_0x58c1('0x13'));var as=require(_0x58c1('0x14'));var hardwareService=require(_0x58c1('0x15'));var logger=require(_0x58c1('0x16'))(_0x58c1('0x17'));var utils=require(_0x58c1('0x18'));var config=require(_0x58c1('0x19'));var licenseUtil=require(_0x58c1('0x1a'));var db=require(_0x58c1('0x1b'))['db'];function respondWithStatusCode(_0x62fc6a,_0x402278){_0x402278=_0x402278||0xcc;return function(_0x4269a3){if(_0x4269a3){return _0x62fc6a[_0x58c1('0x1c')](_0x402278);}return _0x62fc6a[_0x58c1('0x1d')](_0x402278)['end']();};}function respondWithResult(_0xddb4b,_0xc7b510){_0xc7b510=_0xc7b510||0xc8;return function(_0x272b9c){if(_0x272b9c){return _0xddb4b[_0x58c1('0x1d')](_0xc7b510)[_0x58c1('0x1e')](_0x272b9c);}};}function respondWithFilteredResult(_0x2949fc,_0x4cde61){return function(_0x303484){if(_0x303484){var _0x208b86=typeof _0x4cde61[_0x58c1('0x1f')]===_0x58c1('0x20')&&typeof _0x4cde61[_0x58c1('0x21')]===_0x58c1('0x20');var _0x4b3904=_0x303484[_0x58c1('0x22')];var _0xb961be=_0x208b86?0x0:_0x4cde61[_0x58c1('0x1f')];var _0x110c86=_0x208b86?_0x303484['count']:_0x4cde61['offset']+_0x4cde61[_0x58c1('0x21')];var _0x2ddf09;if(_0x110c86>=_0x4b3904){_0x110c86=_0x4b3904;_0x2ddf09=0xc8;}else{_0x2ddf09=0xce;}_0x2949fc[_0x58c1('0x1d')](_0x2ddf09);return _0x2949fc[_0x58c1('0x23')](_0x58c1('0x24'),_0xb961be+'-'+_0x110c86+'/'+_0x4b3904)[_0x58c1('0x1e')](_0x303484);}return null;};}function patchUpdates(_0xf1d147){return function(_0x245b9d){try{jsonpatch[_0x58c1('0x25')](_0x245b9d,_0xf1d147,!![]);}catch(_0x3598a3){return BPromise[_0x58c1('0x26')](_0x3598a3);}return _0x245b9d['save']();};}function saveUpdates(_0x4369c6,_0x56c132){return function(_0x137320){if(_0x137320){return _0x137320[_0x58c1('0x27')](_0x4369c6)[_0x58c1('0x28')](function(_0x54f8c5){return _0x54f8c5;});}return null;};}function removeEntity(_0x3bbd9c,_0x2a3776){return function(_0x35173d){if(_0x35173d){return _0x35173d[_0x58c1('0x29')]()['then'](function(){_0x3bbd9c['status'](0xcc)[_0x58c1('0x2a')]();});}};}function handleEntityNotFound(_0x45e13f,_0x47f49b){return function(_0x299e9d){if(!_0x299e9d){_0x45e13f[_0x58c1('0x1c')](0x194);}return _0x299e9d;};}function handleError(_0x36777b,_0x3355a9){_0x3355a9=_0x3355a9||0x1f4;return function(_0x842f57){logger[_0x58c1('0x2b')](_0x842f57[_0x58c1('0x2c')]);if(_0x842f57[_0x58c1('0x2d')]){delete _0x842f57[_0x58c1('0x2d')];}_0x36777b[_0x58c1('0x1d')](_0x3355a9)['send'](_0x842f57);};}exports['index']=function(_0x5257b4,_0xb68d0a){var _0x47ac7e={},_0x2846f2={},_0x4889e3={'count':0x0,'rows':[]};var _0x1bd557=_['map'](db['ZohoConfiguration'][_0x58c1('0x2e')],function(_0x515949){return{'name':_0x515949['fieldName'],'type':_0x515949[_0x58c1('0x2f')]['key']};});_0x2846f2['model']=_[_0x58c1('0x30')](_0x1bd557,_0x58c1('0x2d'));_0x2846f2['query']=_[_0x58c1('0x31')](_0x5257b4[_0x58c1('0x32')]);_0x2846f2[_0x58c1('0x33')]=_[_0x58c1('0x34')](_0x2846f2[_0x58c1('0x35')],_0x2846f2[_0x58c1('0x32')]);_0x47ac7e[_0x58c1('0x36')]=_[_0x58c1('0x34')](_0x2846f2[_0x58c1('0x35')],qs[_0x58c1('0x37')](_0x5257b4['query'][_0x58c1('0x37')]));_0x47ac7e['attributes']=_0x47ac7e[_0x58c1('0x36')][_0x58c1('0x38')]?_0x47ac7e['attributes']:_0x2846f2[_0x58c1('0x35')];if(!_0x5257b4[_0x58c1('0x32')][_0x58c1('0x39')](_0x58c1('0x3a'))){_0x47ac7e[_0x58c1('0x21')]=qs[_0x58c1('0x21')](_0x5257b4[_0x58c1('0x32')]['limit']);_0x47ac7e['offset']=qs[_0x58c1('0x1f')](_0x5257b4[_0x58c1('0x32')][_0x58c1('0x1f')]);}_0x47ac7e[_0x58c1('0x3b')]=qs['sort'](_0x5257b4['query'][_0x58c1('0x3c')]);_0x47ac7e[_0x58c1('0x3d')]=qs[_0x58c1('0x33')](_['pick'](_0x5257b4['query'],_0x2846f2[_0x58c1('0x33')]),_0x1bd557);if(_0x5257b4[_0x58c1('0x32')][_0x58c1('0x3e')]){_0x47ac7e[_0x58c1('0x3d')]=_['merge'](_0x47ac7e[_0x58c1('0x3d')],{'$or':_[_0x58c1('0x30')](_0x1bd557,function(_0x4d063a){if(_0x4d063a[_0x58c1('0x2f')]!=='VIRTUAL'){var _0x37f6bb={};_0x37f6bb[_0x4d063a[_0x58c1('0x2d')]]={'$like':'%'+_0x5257b4[_0x58c1('0x32')]['filter']+'%'};return _0x37f6bb;}})});}_0x47ac7e=_[_0x58c1('0x3f')]({},_0x47ac7e,_0x5257b4[_0x58c1('0x40')]);var _0x51a1ec={'where':_0x47ac7e[_0x58c1('0x3d')]};return db['ZohoConfiguration']['count'](_0x51a1ec)[_0x58c1('0x28')](function(_0x3faf21){_0x4889e3[_0x58c1('0x22')]=_0x3faf21;if(_0x5257b4[_0x58c1('0x32')]['includeAll']){_0x47ac7e[_0x58c1('0x41')]=[{'all':!![]}];}return db[_0x58c1('0x42')][_0x58c1('0x43')](_0x47ac7e);})['then'](function(_0x523ea7){_0x4889e3[_0x58c1('0x44')]=_0x523ea7;return _0x4889e3;})[_0x58c1('0x28')](respondWithFilteredResult(_0xb68d0a,_0x47ac7e))[_0x58c1('0x45')](handleError(_0xb68d0a,null));};exports[_0x58c1('0x46')]=function(_0x1cc0a1,_0x341ced){var _0x2bee4d={'raw':![],'where':{'id':_0x1cc0a1[_0x58c1('0x47')]['id']}},_0x4154f4={};_0x4154f4[_0x58c1('0x35')]=_[_0x58c1('0x31')](db['ZohoConfiguration'][_0x58c1('0x2e')]);_0x4154f4['query']=_[_0x58c1('0x31')](_0x1cc0a1[_0x58c1('0x32')]);_0x4154f4[_0x58c1('0x33')]=_[_0x58c1('0x34')](_0x4154f4[_0x58c1('0x35')],_0x4154f4[_0x58c1('0x32')]);_0x2bee4d[_0x58c1('0x36')]=_['intersection'](_0x4154f4[_0x58c1('0x35')],qs['fields'](_0x1cc0a1[_0x58c1('0x32')][_0x58c1('0x37')]));_0x2bee4d[_0x58c1('0x36')]=_0x2bee4d['attributes']['length']?_0x2bee4d[_0x58c1('0x36')]:_0x4154f4['model'];if(_0x1cc0a1[_0x58c1('0x32')][_0x58c1('0x48')]){_0x2bee4d['include']=[{'all':!![]}];}_0x2bee4d=_['merge']({},_0x2bee4d,_0x1cc0a1[_0x58c1('0x40')]);return db[_0x58c1('0x42')][_0x58c1('0x49')](_0x2bee4d)[_0x58c1('0x28')](handleEntityNotFound(_0x341ced,null))[_0x58c1('0x28')](respondWithResult(_0x341ced,null))[_0x58c1('0x45')](handleError(_0x341ced,null));};exports[_0x58c1('0x4a')]=function(_0x162e21,_0x19a7b3){return db['ZohoConfiguration']['create'](_0x162e21[_0x58c1('0x4b')],{})[_0x58c1('0x28')](respondWithResult(_0x19a7b3,0xc9))['catch'](handleError(_0x19a7b3,null));};exports['update']=function(_0x11284d,_0x462e8e){if(_0x11284d[_0x58c1('0x4b')]['id']){delete _0x11284d[_0x58c1('0x4b')]['id'];}return db[_0x58c1('0x42')][_0x58c1('0x49')]({'where':{'id':_0x11284d[_0x58c1('0x47')]['id']}})[_0x58c1('0x28')](handleEntityNotFound(_0x462e8e,null))[_0x58c1('0x28')](saveUpdates(_0x11284d[_0x58c1('0x4b')],null))['then'](respondWithResult(_0x462e8e,null))[_0x58c1('0x45')](handleError(_0x462e8e,null));};exports[_0x58c1('0x29')]=function(_0x4ffa1f,_0xd4d190){return db[_0x58c1('0x42')][_0x58c1('0x49')]({'where':{'id':_0x4ffa1f[_0x58c1('0x47')]['id']}})[_0x58c1('0x28')](handleEntityNotFound(_0xd4d190,null))['then'](removeEntity(_0xd4d190,null))[_0x58c1('0x45')](handleError(_0xd4d190,null));};exports['getFields']=function(_0x44f988,_0x10d5cf,_0x2af1a6){var _0x531bd1={};var _0xf64daa={};var _0x1ed2c3;var _0x175d39;return db[_0x58c1('0x42')]['findOne']({'where':{'id':_0x44f988['params']['id']}})[_0x58c1('0x28')](handleEntityNotFound(_0x10d5cf,null))['then'](function(_0x3719aa){if(_0x3719aa){_0x1ed2c3=_0x3719aa;_0xf64daa[_0x58c1('0x35')]=_['keys'](db[_0x58c1('0x4c')]['rawAttributes']);_0xf64daa[_0x58c1('0x32')]=_['keys'](_0x44f988[_0x58c1('0x32')]);_0xf64daa[_0x58c1('0x33')]=_['intersection'](_0xf64daa['model'],_0xf64daa['query']);_0x531bd1['attributes']=_[_0x58c1('0x34')](_0xf64daa[_0x58c1('0x35')],qs[_0x58c1('0x37')](_0x44f988['query'][_0x58c1('0x37')]));_0x531bd1[_0x58c1('0x36')]=_0x531bd1[_0x58c1('0x36')][_0x58c1('0x38')]?_0x531bd1['attributes']:_0xf64daa[_0x58c1('0x35')];_0x531bd1[_0x58c1('0x3b')]=qs['sort'](_0x44f988[_0x58c1('0x32')][_0x58c1('0x3c')]);_0x531bd1[_0x58c1('0x3d')]=qs[_0x58c1('0x33')](_[_0x58c1('0x4d')](_0x44f988[_0x58c1('0x32')],_0xf64daa[_0x58c1('0x33')]));if(_0x44f988[_0x58c1('0x32')][_0x58c1('0x3e')]){_0x531bd1[_0x58c1('0x3d')]=_['merge'](_0x531bd1[_0x58c1('0x3d')],{'$or':_[_0x58c1('0x30')](_0x531bd1['attributes'],function(_0x59399b){var _0x351582={};_0x351582[_0x59399b]={'$like':'%'+_0x44f988[_0x58c1('0x32')][_0x58c1('0x3e')]+'%'};return _0x351582;})});}_0x531bd1=_['merge']({},_0x531bd1,_0x44f988[_0x58c1('0x40')]);return _0x1ed2c3[_0x58c1('0x4e')](_0x531bd1);}})['then'](function(_0x35b138){if(_0x35b138){_0x175d39=_0x35b138['length'];if(!_0x44f988[_0x58c1('0x32')][_0x58c1('0x39')](_0x58c1('0x3a'))){_0x531bd1[_0x58c1('0x21')]=qs['limit'](_0x44f988['query'][_0x58c1('0x21')]);_0x531bd1[_0x58c1('0x1f')]=qs[_0x58c1('0x1f')](_0x44f988['query']['offset']);}return _0x1ed2c3[_0x58c1('0x4e')](_0x531bd1);}})[_0x58c1('0x28')](function(_0x290781){if(_0x290781){return _0x290781?{'count':_0x175d39,'rows':_0x290781}:null;}})[_0x58c1('0x28')](respondWithResult(_0x10d5cf,null))['catch'](handleError(_0x10d5cf,null));};exports['getSubjects']=function(_0x461a5c,_0x3021c7,_0x1d0b06){var _0xdc1945={};var _0x42862d={};var _0x246fc5;var _0x10829f;return db[_0x58c1('0x42')]['findOne']({'where':{'id':_0x461a5c[_0x58c1('0x47')]['id']}})[_0x58c1('0x28')](handleEntityNotFound(_0x3021c7,null))[_0x58c1('0x28')](function(_0x52d25a){if(_0x52d25a){_0x246fc5=_0x52d25a;_0x42862d['model']=_['keys'](db[_0x58c1('0x4c')][_0x58c1('0x2e')]);_0x42862d['query']=_[_0x58c1('0x31')](_0x461a5c[_0x58c1('0x32')]);_0x42862d[_0x58c1('0x33')]=_[_0x58c1('0x34')](_0x42862d[_0x58c1('0x35')],_0x42862d[_0x58c1('0x32')]);_0xdc1945['attributes']=_[_0x58c1('0x34')](_0x42862d[_0x58c1('0x35')],qs[_0x58c1('0x37')](_0x461a5c['query'][_0x58c1('0x37')]));_0xdc1945[_0x58c1('0x36')]=_0xdc1945[_0x58c1('0x36')][_0x58c1('0x38')]?_0xdc1945[_0x58c1('0x36')]:_0x42862d['model'];_0xdc1945[_0x58c1('0x3b')]=qs[_0x58c1('0x3c')](_0x461a5c[_0x58c1('0x32')][_0x58c1('0x3c')]);_0xdc1945[_0x58c1('0x3d')]=qs[_0x58c1('0x33')](_['pick'](_0x461a5c['query'],_0x42862d[_0x58c1('0x33')]));if(_0x461a5c[_0x58c1('0x32')][_0x58c1('0x3e')]){_0xdc1945[_0x58c1('0x3d')]=_['merge'](_0xdc1945[_0x58c1('0x3d')],{'$or':_[_0x58c1('0x30')](_0xdc1945[_0x58c1('0x36')],function(_0x3bbf0f){var _0x3fb395={};_0x3fb395[_0x3bbf0f]={'$like':'%'+_0x461a5c[_0x58c1('0x32')][_0x58c1('0x3e')]+'%'};return _0x3fb395;})});}_0xdc1945=_[_0x58c1('0x3f')]({},_0xdc1945,_0x461a5c[_0x58c1('0x40')]);return _0x246fc5[_0x58c1('0x4f')](_0xdc1945);}})[_0x58c1('0x28')](function(_0x3ac6be){if(_0x3ac6be){_0x10829f=_0x3ac6be['length'];if(!_0x461a5c['query']['hasOwnProperty']('nolimit')){_0xdc1945[_0x58c1('0x21')]=qs['limit'](_0x461a5c[_0x58c1('0x32')]['limit']);_0xdc1945[_0x58c1('0x1f')]=qs['offset'](_0x461a5c[_0x58c1('0x32')]['offset']);}return _0x246fc5['getSubjects'](_0xdc1945);}})['then'](function(_0x4af0f7){if(_0x4af0f7){return _0x4af0f7?{'count':_0x10829f,'rows':_0x4af0f7}:null;}})[_0x58c1('0x28')](respondWithResult(_0x3021c7,null))[_0x58c1('0x45')](handleError(_0x3021c7,null));};exports['getDescriptions']=function(_0x246b8a,_0x136f32,_0x3d9435){var _0x4f5ca3={};var _0x5f113f={};var _0x2cd698;var _0x337c3f;return db['ZohoConfiguration'][_0x58c1('0x50')]({'where':{'id':_0x246b8a['params']['id']}})[_0x58c1('0x28')](handleEntityNotFound(_0x136f32,null))[_0x58c1('0x28')](function(_0x4aa9cf){if(_0x4aa9cf){_0x2cd698=_0x4aa9cf;_0x5f113f[_0x58c1('0x35')]=_[_0x58c1('0x31')](db[_0x58c1('0x4c')][_0x58c1('0x2e')]);_0x5f113f[_0x58c1('0x32')]=_[_0x58c1('0x31')](_0x246b8a[_0x58c1('0x32')]);_0x5f113f[_0x58c1('0x33')]=_[_0x58c1('0x34')](_0x5f113f[_0x58c1('0x35')],_0x5f113f[_0x58c1('0x32')]);_0x4f5ca3['attributes']=_['intersection'](_0x5f113f['model'],qs[_0x58c1('0x37')](_0x246b8a[_0x58c1('0x32')][_0x58c1('0x37')]));_0x4f5ca3[_0x58c1('0x36')]=_0x4f5ca3[_0x58c1('0x36')][_0x58c1('0x38')]?_0x4f5ca3[_0x58c1('0x36')]:_0x5f113f[_0x58c1('0x35')];_0x4f5ca3[_0x58c1('0x3b')]=qs[_0x58c1('0x3c')](_0x246b8a[_0x58c1('0x32')][_0x58c1('0x3c')]);_0x4f5ca3[_0x58c1('0x3d')]=qs['filters'](_[_0x58c1('0x4d')](_0x246b8a[_0x58c1('0x32')],_0x5f113f[_0x58c1('0x33')]));if(_0x246b8a[_0x58c1('0x32')][_0x58c1('0x3e')]){_0x4f5ca3[_0x58c1('0x3d')]=_[_0x58c1('0x3f')](_0x4f5ca3['where'],{'$or':_[_0x58c1('0x30')](_0x4f5ca3[_0x58c1('0x36')],function(_0x5c9a75){var _0x19d5a4={};_0x19d5a4[_0x5c9a75]={'$like':'%'+_0x246b8a[_0x58c1('0x32')][_0x58c1('0x3e')]+'%'};return _0x19d5a4;})});}_0x4f5ca3=_[_0x58c1('0x3f')]({},_0x4f5ca3,_0x246b8a[_0x58c1('0x40')]);return _0x2cd698[_0x58c1('0x51')](_0x4f5ca3);}})[_0x58c1('0x28')](function(_0x2342d5){if(_0x2342d5){_0x337c3f=_0x2342d5[_0x58c1('0x38')];if(!_0x246b8a[_0x58c1('0x32')][_0x58c1('0x39')](_0x58c1('0x3a'))){_0x4f5ca3[_0x58c1('0x21')]=qs[_0x58c1('0x21')](_0x246b8a[_0x58c1('0x32')][_0x58c1('0x21')]);_0x4f5ca3[_0x58c1('0x1f')]=qs[_0x58c1('0x1f')](_0x246b8a[_0x58c1('0x32')]['offset']);}return _0x2cd698['getDescriptions'](_0x4f5ca3);}})[_0x58c1('0x28')](function(_0x364138){if(_0x364138){return _0x364138?{'count':_0x337c3f,'rows':_0x364138}:null;}})[_0x58c1('0x28')](respondWithResult(_0x136f32,null))[_0x58c1('0x45')](handleError(_0x136f32,null));};
\ No newline at end of file
index f7a2331..e6c2e72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92b9=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','int_zoho_configurations','lodash'];(function(_0x20e375,_0xdc0dde){var _0x55ac5d=function(_0x4a9b96){while(--_0x4a9b96){_0x20e375['push'](_0x20e375['shift']());}};_0x55ac5d(++_0xdc0dde);}(_0x92b9,0x1af));var _0x992b=function(_0x39ce29,_0x10e397){_0x39ce29=_0x39ce29-0x0;var _0x221ab2=_0x92b9[_0x39ce29];return _0x221ab2;};'use strict';var _=require(_0x992b('0x0'));var util=require('util');var logger=require(_0x992b('0x1'))('api');var moment=require(_0x992b('0x2'));var BPromise=require(_0x992b('0x3'));var rp=require(_0x992b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x992b('0x5'));var config=require(_0x992b('0x6'));var attributes=require(_0x992b('0x7'));module['exports']=function(_0x574d2b,_0x5035d8){return _0x574d2b['define']('ZohoConfiguration',attributes,{'tableName':_0x992b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7637=['ZohoConfiguration','int_zoho_configurations','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x566425,_0x1d8a85){var _0x4cc1af=function(_0x4ff665){while(--_0x4ff665){_0x566425['push'](_0x566425['shift']());}};_0x4cc1af(++_0x1d8a85);}(_0x7637,0xde));var _0x7763=function(_0x418c4e,_0x6095cd){_0x418c4e=_0x418c4e-0x0;var _0x5126ac=_0x7637[_0x418c4e];return _0x5126ac;};'use strict';var _=require(_0x7763('0x0'));var util=require(_0x7763('0x1'));var logger=require('../../config/logger')(_0x7763('0x2'));var moment=require(_0x7763('0x3'));var BPromise=require(_0x7763('0x4'));var rp=require(_0x7763('0x5'));var fs=require('fs');var path=require(_0x7763('0x6'));var rimraf=require('rimraf');var config=require(_0x7763('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0x7763('0x8')]=function(_0x461659,_0x54fc8d){return _0x461659['define'](_0x7763('0x9'),attributes,{'tableName':_0x7763('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cd3671b..23ffcd7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x702b=['stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xd8dd1d,_0x1bd656){var _0x4b57b0=function(_0xd1f379){while(--_0xd1f379){_0xd8dd1d['push'](_0xd8dd1d['shift']());}};_0x4b57b0(++_0x1bd656);}(_0x702b,0x1d1));var _0xb702=function(_0x490aaf,_0x47da38){_0x490aaf=_0x490aaf-0x0;var _0x25c449=_0x702b[_0x490aaf];return _0x25c449;};'use strict';var _=require(_0xb702('0x0'));var util=require('util');var moment=require(_0xb702('0x1'));var BPromise=require(_0xb702('0x2'));var rs=require(_0xb702('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb702('0x4'))['db'];var utils=require(_0xb702('0x5'));var logger=require('../../config/logger')(_0xb702('0x6'));var config=require('../../config/environment');var jayson=require(_0xb702('0x7'));var client=jayson[_0xb702('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cad24,_0x45a26d,_0x8f84af){return new BPromise(function(_0x432f27,_0x211d1f){return client[_0xb702('0x9')](_0x3cad24,_0x8f84af)[_0xb702('0xa')](function(_0x5fd8ba){logger[_0xb702('0xb')](_0xb702('0xc'),_0x45a26d,_0xb702('0xd'));logger[_0xb702('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x45a26d,_0xb702('0xd'),JSON[_0xb702('0xf')](_0x5fd8ba));if(_0x5fd8ba[_0xb702('0x10')]){if(_0x5fd8ba[_0xb702('0x10')][_0xb702('0x11')]===0x1f4){logger[_0xb702('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x45a26d,_0x5fd8ba[_0xb702('0x10')][_0xb702('0x12')]);return _0x211d1f(_0x5fd8ba[_0xb702('0x10')]['message']);}logger['error'](_0xb702('0xc'),_0x45a26d,_0x5fd8ba[_0xb702('0x10')][_0xb702('0x12')]);return _0x432f27(_0x5fd8ba[_0xb702('0x10')][_0xb702('0x12')]);}else{logger[_0xb702('0xb')](_0xb702('0xc'),_0x45a26d,_0xb702('0xd'));_0x432f27(_0x5fd8ba[_0xb702('0x13')][_0xb702('0x12')]);}})['catch'](function(_0x2e27dc){logger[_0xb702('0x10')](_0xb702('0xc'),_0x45a26d,_0x2e27dc);_0x211d1f(_0x2e27dc);});});}
\ No newline at end of file
+var _0x606c=['http','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment','randomstring','ioredis','../../config/environment','client'];(function(_0x1f9890,_0x2c4706){var _0x3e798c=function(_0x164f0c){while(--_0x164f0c){_0x1f9890['push'](_0x1f9890['shift']());}};_0x3e798c(++_0x2c4706);}(_0x606c,0x107));var _0xc606=function(_0x1139d0,_0x41e5f8){_0x1139d0=_0x1139d0-0x0;var _0xcc01a6=_0x606c[_0x1139d0];return _0xcc01a6;};'use strict';var _=require(_0xc606('0x0'));var util=require(_0xc606('0x1'));var moment=require(_0xc606('0x2'));var BPromise=require('bluebird');var rs=require(_0xc606('0x3'));var fs=require('fs');var Redis=require(_0xc606('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc606('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xc606('0x6')][_0xc606('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37cf26,_0x5ae560,_0xea0aed){return new BPromise(function(_0x1478fe,_0x28c813){return client['request'](_0x37cf26,_0xea0aed)[_0xc606('0x8')](function(_0x560533){logger['info'](_0xc606('0x9'),_0x5ae560,_0xc606('0xa'));logger[_0xc606('0xb')](_0xc606('0xc'),_0x5ae560,_0xc606('0xa'),JSON[_0xc606('0xd')](_0x560533));if(_0x560533[_0xc606('0xe')]){if(_0x560533['error'][_0xc606('0xf')]===0x1f4){logger[_0xc606('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x5ae560,_0x560533[_0xc606('0xe')][_0xc606('0x10')]);return _0x28c813(_0x560533[_0xc606('0xe')][_0xc606('0x10')]);}logger[_0xc606('0xe')](_0xc606('0x9'),_0x5ae560,_0x560533['error'][_0xc606('0x10')]);return _0x1478fe(_0x560533['error'][_0xc606('0x10')]);}else{logger[_0xc606('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x5ae560,_0xc606('0xa'));_0x1478fe(_0x560533['result']['message']);}})['catch'](function(_0x510e68){logger[_0xc606('0xe')](_0xc606('0x9'),_0x5ae560,_0x510e68);_0x28c813(_0x510e68);});});}
\ No newline at end of file
index 3b092d9..d36db94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce4a=['../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x596c18,_0x5377b3){var _0xd247a0=function(_0x52c746){while(--_0x52c746){_0x596c18['push'](_0x596c18['shift']());}};_0xd247a0(++_0x5377b3);}(_0xce4a,0x78));var _0xace4=function(_0xe64d30,_0xb45d4){_0xe64d30=_0xe64d30-0x0;var _0x4b0858=_0xce4a[_0xe64d30];return _0x4b0858;};'use strict';var multer=require('multer');var util=require(_0xace4('0x0'));var path=require(_0xace4('0x1'));var timeout=require(_0xace4('0x2'));var express=require('express');var router=express[_0xace4('0x3')]();var fs_extra=require(_0xace4('0x4'));var auth=require(_0xace4('0x5'));var interaction=require(_0xace4('0x6'));var config=require(_0xace4('0x7'));var controller=require(_0xace4('0x8'));router[_0xace4('0x9')]('/',auth[_0xace4('0xa')](),controller[_0xace4('0xb')]);router['get'](_0xace4('0xc'),auth[_0xace4('0xa')](),controller[_0xace4('0xd')]);router[_0xace4('0xe')]('/',auth[_0xace4('0xa')](),controller[_0xace4('0xf')]);router[_0xace4('0x10')]('/:id',auth[_0xace4('0xa')](),controller[_0xace4('0x11')]);router[_0xace4('0x12')]('/:id',auth[_0xace4('0xa')](),controller[_0xace4('0x13')]);module[_0xace4('0x14')]=router;
\ No newline at end of file
+var _0x2ea0=['../../config/environment','get','isAuthenticated','show','create','put','/:id','update','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x52a84e,_0x197e55){var _0x1fdd39=function(_0x376f21){while(--_0x376f21){_0x52a84e['push'](_0x52a84e['shift']());}};_0x1fdd39(++_0x197e55);}(_0x2ea0,0xf8));var _0x02ea=function(_0x205a12,_0x5d1d07){_0x205a12=_0x205a12-0x0;var _0x2ae9cc=_0x2ea0[_0x205a12];return _0x2ae9cc;};'use strict';var multer=require(_0x02ea('0x0'));var util=require(_0x02ea('0x1'));var path=require(_0x02ea('0x2'));var timeout=require(_0x02ea('0x3'));var express=require(_0x02ea('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x02ea('0x5'));var interaction=require(_0x02ea('0x6'));var config=require(_0x02ea('0x7'));var controller=require('./intZohoField.controller');router[_0x02ea('0x8')]('/',auth[_0x02ea('0x9')](),controller['index']);router[_0x02ea('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x02ea('0xa')]);router['post']('/',auth[_0x02ea('0x9')](),controller[_0x02ea('0xb')]);router[_0x02ea('0xc')](_0x02ea('0xd'),auth[_0x02ea('0x9')](),controller[_0x02ea('0xe')]);router['delete'](_0x02ea('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index fcfa5ff..4763da5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91bb=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports'];(function(_0x4b2251,_0x393f10){var _0x5d22fb=function(_0x10992c){while(--_0x10992c){_0x4b2251['push'](_0x4b2251['shift']());}};_0x5d22fb(++_0x393f10);}(_0x91bb,0xd6));var _0xb91b=function(_0x33be9d,_0x41618e){_0x33be9d=_0x33be9d-0x0;var _0x4a9267=_0x91bb[_0x33be9d];return _0x4a9267;};'use strict';var Sequelize=require(_0xb91b('0x0'));module[_0xb91b('0x1')]={'type':{'type':Sequelize[_0xb91b('0x2')](_0xb91b('0x3'),_0xb91b('0x4'),_0xb91b('0x5'),_0xb91b('0x6'),_0xb91b('0x7')),'defaultValue':_0xb91b('0x3')},'content':{'type':Sequelize[_0xb91b('0x8')]},'key':{'type':Sequelize[_0xb91b('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xb91b('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb91b('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb91b('0x8')]}};
\ No newline at end of file
+var _0xb237=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x4ca371,_0xc77ddf){var _0x59481b=function(_0x4f8675){while(--_0x4f8675){_0x4ca371['push'](_0x4ca371['shift']());}};_0x59481b(++_0xc77ddf);}(_0xb237,0x12f));var _0x7b23=function(_0x56acd7,_0x19094f){_0x56acd7=_0x56acd7-0x0;var _0x6120e=_0xb237[_0x56acd7];return _0x6120e;};'use strict';var Sequelize=require(_0x7b23('0x0'));module[_0x7b23('0x1')]={'type':{'type':Sequelize[_0x7b23('0x2')](_0x7b23('0x3'),_0x7b23('0x4'),_0x7b23('0x5'),_0x7b23('0x6'),_0x7b23('0x7')),'defaultValue':_0x7b23('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7b23('0x8')]},'keyType':{'type':Sequelize[_0x7b23('0x2')](_0x7b23('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x7b23('0x8')]},'idField':{'type':Sequelize[_0x7b23('0x8')]},'nameField':{'type':Sequelize[_0x7b23('0x8')]},'customField':{'type':Sequelize[_0x7b23('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 26dec1b..4681f7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3703=['count','set','reject','save','update','then','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ZohoField','includeAll','include','findAll','rows','show','params','find','create','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x91d019,_0x5223c4){var _0x19de1f=function(_0x3e1311){while(--_0x3e1311){_0x91d019['push'](_0x91d019['shift']());}};_0x19de1f(++_0x5223c4);}(_0x3703,0x15f));var _0x3370=function(_0x3d8812,_0x24b648){_0x3d8812=_0x3d8812-0x0;var _0x3aa4ee=_0x3703[_0x3d8812];return _0x3aa4ee;};'use strict';var emlformat=require(_0x3370('0x0'));var rimraf=require(_0x3370('0x1'));var zipdir=require(_0x3370('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3370('0x3'));var moment=require(_0x3370('0x4'));var BPromise=require(_0x3370('0x5'));var Mustache=require(_0x3370('0x6'));var util=require(_0x3370('0x7'));var path=require(_0x3370('0x8'));var sox=require(_0x3370('0x9'));var csv=require(_0x3370('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3370('0xb'));var _=require(_0x3370('0xc'));var squel=require(_0x3370('0xd'));var crypto=require(_0x3370('0xe'));var jsforce=require(_0x3370('0xf'));var deskjs=require(_0x3370('0x10'));var toCsv=require(_0x3370('0xa'));var querystring=require(_0x3370('0x11'));var Papa=require(_0x3370('0x12'));var Redis=require(_0x3370('0x13'));var authService=require(_0x3370('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3370('0x15'));var hardwareService=require(_0x3370('0x16'));var logger=require(_0x3370('0x17'))(_0x3370('0x18'));var utils=require('../../config/utils');var config=require(_0x3370('0x19'));var licenseUtil=require(_0x3370('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdc1988,_0x1fa0c0){_0x1fa0c0=_0x1fa0c0||0xcc;return function(_0x225a66){if(_0x225a66){return _0xdc1988[_0x3370('0x1b')](_0x1fa0c0);}return _0xdc1988['status'](_0x1fa0c0)[_0x3370('0x1c')]();};}function respondWithResult(_0x492bad,_0x3c5cd9){_0x3c5cd9=_0x3c5cd9||0xc8;return function(_0x1be4ca){if(_0x1be4ca){return _0x492bad[_0x3370('0x1d')](_0x3c5cd9)[_0x3370('0x1e')](_0x1be4ca);}};}function respondWithFilteredResult(_0xe51c73,_0x17230d){return function(_0x416852){if(_0x416852){var _0x35a3b7=typeof _0x17230d[_0x3370('0x1f')]===_0x3370('0x20')&&typeof _0x17230d[_0x3370('0x21')]==='undefined';var _0x51926a=_0x416852[_0x3370('0x22')];var _0x50410d=_0x35a3b7?0x0:_0x17230d[_0x3370('0x1f')];var _0x154c37=_0x35a3b7?_0x416852['count']:_0x17230d[_0x3370('0x1f')]+_0x17230d[_0x3370('0x21')];var _0x480944;if(_0x154c37>=_0x51926a){_0x154c37=_0x51926a;_0x480944=0xc8;}else{_0x480944=0xce;}_0xe51c73['status'](_0x480944);return _0xe51c73[_0x3370('0x23')]('Content-Range',_0x50410d+'-'+_0x154c37+'/'+_0x51926a)[_0x3370('0x1e')](_0x416852);}return null;};}function patchUpdates(_0x1c905d){return function(_0x2a878f){try{jsonpatch['apply'](_0x2a878f,_0x1c905d,!![]);}catch(_0x20a55e){return BPromise[_0x3370('0x24')](_0x20a55e);}return _0x2a878f[_0x3370('0x25')]();};}function saveUpdates(_0x21da24,_0x44eac3){return function(_0x211a94){if(_0x211a94){return _0x211a94[_0x3370('0x26')](_0x21da24)['then'](function(_0x14f8d5){return _0x14f8d5;});}return null;};}function removeEntity(_0x1a1a38,_0x246431){return function(_0x2287cb){if(_0x2287cb){return _0x2287cb['destroy']()[_0x3370('0x27')](function(){_0x1a1a38[_0x3370('0x1d')](0xcc)[_0x3370('0x1c')]();});}};}function handleEntityNotFound(_0x598596,_0x4ce27e){return function(_0x36b977){if(!_0x36b977){_0x598596[_0x3370('0x1b')](0x194);}return _0x36b977;};}function handleError(_0x18d389,_0x4a1ff4){_0x4a1ff4=_0x4a1ff4||0x1f4;return function(_0x1f408a){logger[_0x3370('0x28')](_0x1f408a['stack']);if(_0x1f408a[_0x3370('0x29')]){delete _0x1f408a[_0x3370('0x29')];}_0x18d389[_0x3370('0x1d')](_0x4a1ff4)[_0x3370('0x2a')](_0x1f408a);};}exports[_0x3370('0x2b')]=function(_0x562ab7,_0x579ccd){var _0x54d7a1={},_0x131512={},_0x476e67={'count':0x0,'rows':[]};var _0xc98a60=_[_0x3370('0x2c')](db['ZohoField'][_0x3370('0x2d')],function(_0x4f57ae){return{'name':_0x4f57ae[_0x3370('0x2e')],'type':_0x4f57ae['type'][_0x3370('0x2f')]};});_0x131512[_0x3370('0x30')]=_[_0x3370('0x2c')](_0xc98a60,_0x3370('0x29'));_0x131512[_0x3370('0x31')]=_[_0x3370('0x32')](_0x562ab7['query']);_0x131512[_0x3370('0x33')]=_[_0x3370('0x34')](_0x131512[_0x3370('0x30')],_0x131512[_0x3370('0x31')]);_0x54d7a1[_0x3370('0x35')]=_[_0x3370('0x34')](_0x131512['model'],qs[_0x3370('0x36')](_0x562ab7[_0x3370('0x31')][_0x3370('0x36')]));_0x54d7a1[_0x3370('0x35')]=_0x54d7a1[_0x3370('0x35')][_0x3370('0x37')]?_0x54d7a1['attributes']:_0x131512[_0x3370('0x30')];if(!_0x562ab7[_0x3370('0x31')][_0x3370('0x38')](_0x3370('0x39'))){_0x54d7a1[_0x3370('0x21')]=qs[_0x3370('0x21')](_0x562ab7[_0x3370('0x31')][_0x3370('0x21')]);_0x54d7a1[_0x3370('0x1f')]=qs[_0x3370('0x1f')](_0x562ab7['query'][_0x3370('0x1f')]);}_0x54d7a1['order']=qs[_0x3370('0x3a')](_0x562ab7[_0x3370('0x31')][_0x3370('0x3a')]);_0x54d7a1[_0x3370('0x3b')]=qs[_0x3370('0x33')](_[_0x3370('0x3c')](_0x562ab7[_0x3370('0x31')],_0x131512[_0x3370('0x33')]),_0xc98a60);if(_0x562ab7[_0x3370('0x31')][_0x3370('0x3d')]){_0x54d7a1['where']=_[_0x3370('0x3e')](_0x54d7a1[_0x3370('0x3b')],{'$or':_['map'](_0xc98a60,function(_0x24c07b){if(_0x24c07b['type']!==_0x3370('0x3f')){var _0x4cb794={};_0x4cb794[_0x24c07b[_0x3370('0x29')]]={'$like':'%'+_0x562ab7['query']['filter']+'%'};return _0x4cb794;}})});}_0x54d7a1=_['merge']({},_0x54d7a1,_0x562ab7[_0x3370('0x40')]);var _0x2d8c5d={'where':_0x54d7a1[_0x3370('0x3b')]};return db[_0x3370('0x41')][_0x3370('0x22')](_0x2d8c5d)[_0x3370('0x27')](function(_0xcfb964){_0x476e67[_0x3370('0x22')]=_0xcfb964;if(_0x562ab7[_0x3370('0x31')][_0x3370('0x42')]){_0x54d7a1[_0x3370('0x43')]=[{'all':!![]}];}return db[_0x3370('0x41')][_0x3370('0x44')](_0x54d7a1);})[_0x3370('0x27')](function(_0x12adbe){_0x476e67[_0x3370('0x45')]=_0x12adbe;return _0x476e67;})[_0x3370('0x27')](respondWithFilteredResult(_0x579ccd,_0x54d7a1))['catch'](handleError(_0x579ccd,null));};exports[_0x3370('0x46')]=function(_0x1edbd1,_0x222020){var _0x275bb5={'raw':!![],'where':{'id':_0x1edbd1[_0x3370('0x47')]['id']}},_0x5884ab={};_0x5884ab[_0x3370('0x30')]=_[_0x3370('0x32')](db[_0x3370('0x41')][_0x3370('0x2d')]);_0x5884ab['query']=_[_0x3370('0x32')](_0x1edbd1[_0x3370('0x31')]);_0x5884ab[_0x3370('0x33')]=_[_0x3370('0x34')](_0x5884ab[_0x3370('0x30')],_0x5884ab[_0x3370('0x31')]);_0x275bb5[_0x3370('0x35')]=_[_0x3370('0x34')](_0x5884ab[_0x3370('0x30')],qs['fields'](_0x1edbd1['query']['fields']));_0x275bb5[_0x3370('0x35')]=_0x275bb5[_0x3370('0x35')][_0x3370('0x37')]?_0x275bb5[_0x3370('0x35')]:_0x5884ab['model'];if(_0x1edbd1[_0x3370('0x31')]['includeAll']){_0x275bb5[_0x3370('0x43')]=[{'all':!![]}];}_0x275bb5=_[_0x3370('0x3e')]({},_0x275bb5,_0x1edbd1['options']);return db[_0x3370('0x41')][_0x3370('0x48')](_0x275bb5)[_0x3370('0x27')](handleEntityNotFound(_0x222020,null))[_0x3370('0x27')](respondWithResult(_0x222020,null))['catch'](handleError(_0x222020,null));};exports[_0x3370('0x49')]=function(_0x488305,_0x571931){return db['ZohoField'][_0x3370('0x49')](_0x488305[_0x3370('0x4a')],{})[_0x3370('0x27')](respondWithResult(_0x571931,0xc9))[_0x3370('0x4b')](handleError(_0x571931,null));};exports[_0x3370('0x26')]=function(_0x17585a,_0x31bcff){if(_0x17585a[_0x3370('0x4a')]['id']){delete _0x17585a['body']['id'];}return db[_0x3370('0x41')][_0x3370('0x48')]({'where':{'id':_0x17585a[_0x3370('0x47')]['id']}})['then'](handleEntityNotFound(_0x31bcff,null))[_0x3370('0x27')](saveUpdates(_0x17585a[_0x3370('0x4a')],null))[_0x3370('0x27')](respondWithResult(_0x31bcff,null))['catch'](handleError(_0x31bcff,null));};exports[_0x3370('0x4c')]=function(_0x3eddd4,_0x1209b7){return db[_0x3370('0x41')][_0x3370('0x48')]({'where':{'id':_0x3eddd4['params']['id']}})[_0x3370('0x27')](handleEntityNotFound(_0x1209b7,null))['then'](removeEntity(_0x1209b7,null))[_0x3370('0x4b')](handleError(_0x1209b7,null));};
\ No newline at end of file
+var _0x61a8=['name','map','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','intersection','length','find','catch','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack'];(function(_0x3ddfaf,_0x3ea732){var _0x352f07=function(_0x374738){while(--_0x374738){_0x3ddfaf['push'](_0x3ddfaf['shift']());}};_0x352f07(++_0x3ea732);}(_0x61a8,0x1ce));var _0x861a=function(_0x7edec1,_0x31f0f0){_0x7edec1=_0x7edec1-0x0;var _0x4c58c0=_0x61a8[_0x7edec1];return _0x4c58c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x861a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x861a('0x1'));var rp=require(_0x861a('0x2'));var moment=require(_0x861a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x861a('0x4'));var util=require('util');var path=require(_0x861a('0x5'));var sox=require(_0x861a('0x6'));var csv=require(_0x861a('0x7'));var ejs=require(_0x861a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x861a('0x9'));var jsforce=require(_0x861a('0xa'));var deskjs=require(_0x861a('0xb'));var toCsv=require(_0x861a('0x7'));var querystring=require('querystring');var Papa=require(_0x861a('0xc'));var Redis=require('ioredis');var authService=require(_0x861a('0xd'));var qs=require(_0x861a('0xe'));var as=require(_0x861a('0xf'));var hardwareService=require(_0x861a('0x10'));var logger=require(_0x861a('0x11'))('api');var utils=require(_0x861a('0x12'));var config=require(_0x861a('0x13'));var licenseUtil=require(_0x861a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x119bac,_0x268362){_0x268362=_0x268362||0xcc;return function(_0x384f37){if(_0x384f37){return _0x119bac['sendStatus'](_0x268362);}return _0x119bac[_0x861a('0x15')](_0x268362)[_0x861a('0x16')]();};}function respondWithResult(_0x211fc9,_0x4f2686){_0x4f2686=_0x4f2686||0xc8;return function(_0x578c10){if(_0x578c10){return _0x211fc9[_0x861a('0x15')](_0x4f2686)[_0x861a('0x17')](_0x578c10);}};}function respondWithFilteredResult(_0x1ecd9e,_0x2ca7b1){return function(_0x25b765){if(_0x25b765){var _0x47f322=typeof _0x2ca7b1[_0x861a('0x18')]===_0x861a('0x19')&&typeof _0x2ca7b1[_0x861a('0x1a')]===_0x861a('0x19');var _0x547741=_0x25b765[_0x861a('0x1b')];var _0x56041e=_0x47f322?0x0:_0x2ca7b1[_0x861a('0x18')];var _0x497044=_0x47f322?_0x25b765[_0x861a('0x1b')]:_0x2ca7b1[_0x861a('0x18')]+_0x2ca7b1[_0x861a('0x1a')];var _0x43477c;if(_0x497044>=_0x547741){_0x497044=_0x547741;_0x43477c=0xc8;}else{_0x43477c=0xce;}_0x1ecd9e[_0x861a('0x15')](_0x43477c);return _0x1ecd9e[_0x861a('0x1c')](_0x861a('0x1d'),_0x56041e+'-'+_0x497044+'/'+_0x547741)[_0x861a('0x17')](_0x25b765);}return null;};}function patchUpdates(_0x27833a){return function(_0xd7e55c){try{jsonpatch[_0x861a('0x1e')](_0xd7e55c,_0x27833a,!![]);}catch(_0x9ab9){return BPromise[_0x861a('0x1f')](_0x9ab9);}return _0xd7e55c['save']();};}function saveUpdates(_0x31d02a,_0x7fb9ea){return function(_0x401a6b){if(_0x401a6b){return _0x401a6b[_0x861a('0x20')](_0x31d02a)[_0x861a('0x21')](function(_0x31a170){return _0x31a170;});}return null;};}function removeEntity(_0x347902,_0x2bd68c){return function(_0x2c258d){if(_0x2c258d){return _0x2c258d['destroy']()['then'](function(){_0x347902['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3df09f,_0x11d3bb){return function(_0x3cb0e0){if(!_0x3cb0e0){_0x3df09f['sendStatus'](0x194);}return _0x3cb0e0;};}function handleError(_0x1fa8d3,_0x533a2e){_0x533a2e=_0x533a2e||0x1f4;return function(_0x2b34ad){logger['error'](_0x2b34ad[_0x861a('0x22')]);if(_0x2b34ad[_0x861a('0x23')]){delete _0x2b34ad[_0x861a('0x23')];}_0x1fa8d3[_0x861a('0x15')](_0x533a2e)['send'](_0x2b34ad);};}exports['index']=function(_0x48f7c6,_0x4af2c2){var _0xb3ff25={},_0x2b69e3={},_0x35c1a9={'count':0x0,'rows':[]};var _0x14dcb6=_[_0x861a('0x24')](db[_0x861a('0x25')][_0x861a('0x26')],function(_0x2859be){return{'name':_0x2859be[_0x861a('0x27')],'type':_0x2859be[_0x861a('0x28')][_0x861a('0x29')]};});_0x2b69e3[_0x861a('0x2a')]=_[_0x861a('0x24')](_0x14dcb6,'name');_0x2b69e3[_0x861a('0x2b')]=_[_0x861a('0x2c')](_0x48f7c6[_0x861a('0x2b')]);_0x2b69e3[_0x861a('0x2d')]=_['intersection'](_0x2b69e3['model'],_0x2b69e3[_0x861a('0x2b')]);_0xb3ff25[_0x861a('0x2e')]=_['intersection'](_0x2b69e3[_0x861a('0x2a')],qs[_0x861a('0x2f')](_0x48f7c6[_0x861a('0x2b')]['fields']));_0xb3ff25[_0x861a('0x2e')]=_0xb3ff25[_0x861a('0x2e')]['length']?_0xb3ff25[_0x861a('0x2e')]:_0x2b69e3[_0x861a('0x2a')];if(!_0x48f7c6[_0x861a('0x2b')][_0x861a('0x30')](_0x861a('0x31'))){_0xb3ff25['limit']=qs['limit'](_0x48f7c6['query']['limit']);_0xb3ff25[_0x861a('0x18')]=qs[_0x861a('0x18')](_0x48f7c6[_0x861a('0x2b')][_0x861a('0x18')]);}_0xb3ff25[_0x861a('0x32')]=qs[_0x861a('0x33')](_0x48f7c6[_0x861a('0x2b')][_0x861a('0x33')]);_0xb3ff25['where']=qs[_0x861a('0x2d')](_[_0x861a('0x34')](_0x48f7c6[_0x861a('0x2b')],_0x2b69e3['filters']),_0x14dcb6);if(_0x48f7c6[_0x861a('0x2b')]['filter']){_0xb3ff25[_0x861a('0x35')]=_[_0x861a('0x36')](_0xb3ff25[_0x861a('0x35')],{'$or':_[_0x861a('0x24')](_0x14dcb6,function(_0x37eaf3){if(_0x37eaf3[_0x861a('0x28')]!==_0x861a('0x37')){var _0x5e6c25={};_0x5e6c25[_0x37eaf3[_0x861a('0x23')]]={'$like':'%'+_0x48f7c6[_0x861a('0x2b')][_0x861a('0x38')]+'%'};return _0x5e6c25;}})});}_0xb3ff25=_['merge']({},_0xb3ff25,_0x48f7c6[_0x861a('0x39')]);var _0x80c8f7={'where':_0xb3ff25[_0x861a('0x35')]};return db[_0x861a('0x25')][_0x861a('0x1b')](_0x80c8f7)[_0x861a('0x21')](function(_0x5d165a){_0x35c1a9['count']=_0x5d165a;if(_0x48f7c6[_0x861a('0x2b')][_0x861a('0x3a')]){_0xb3ff25[_0x861a('0x3b')]=[{'all':!![]}];}return db[_0x861a('0x25')][_0x861a('0x3c')](_0xb3ff25);})[_0x861a('0x21')](function(_0x6f8e79){_0x35c1a9[_0x861a('0x3d')]=_0x6f8e79;return _0x35c1a9;})[_0x861a('0x21')](respondWithFilteredResult(_0x4af2c2,_0xb3ff25))['catch'](handleError(_0x4af2c2,null));};exports[_0x861a('0x3e')]=function(_0x26c2f6,_0x2d5889){var _0x2b137e={'raw':!![],'where':{'id':_0x26c2f6[_0x861a('0x3f')]['id']}},_0x54f55a={};_0x54f55a[_0x861a('0x2a')]=_[_0x861a('0x2c')](db[_0x861a('0x25')][_0x861a('0x26')]);_0x54f55a[_0x861a('0x2b')]=_[_0x861a('0x2c')](_0x26c2f6[_0x861a('0x2b')]);_0x54f55a[_0x861a('0x2d')]=_[_0x861a('0x40')](_0x54f55a[_0x861a('0x2a')],_0x54f55a[_0x861a('0x2b')]);_0x2b137e[_0x861a('0x2e')]=_[_0x861a('0x40')](_0x54f55a[_0x861a('0x2a')],qs['fields'](_0x26c2f6[_0x861a('0x2b')][_0x861a('0x2f')]));_0x2b137e[_0x861a('0x2e')]=_0x2b137e['attributes'][_0x861a('0x41')]?_0x2b137e[_0x861a('0x2e')]:_0x54f55a['model'];if(_0x26c2f6[_0x861a('0x2b')][_0x861a('0x3a')]){_0x2b137e[_0x861a('0x3b')]=[{'all':!![]}];}_0x2b137e=_['merge']({},_0x2b137e,_0x26c2f6[_0x861a('0x39')]);return db[_0x861a('0x25')][_0x861a('0x42')](_0x2b137e)[_0x861a('0x21')](handleEntityNotFound(_0x2d5889,null))[_0x861a('0x21')](respondWithResult(_0x2d5889,null))[_0x861a('0x43')](handleError(_0x2d5889,null));};exports[_0x861a('0x44')]=function(_0x1fc920,_0x22856c){return db['ZohoField'][_0x861a('0x44')](_0x1fc920[_0x861a('0x45')],{})[_0x861a('0x21')](respondWithResult(_0x22856c,0xc9))[_0x861a('0x43')](handleError(_0x22856c,null));};exports[_0x861a('0x20')]=function(_0x3510b2,_0xdfb2aa){if(_0x3510b2[_0x861a('0x45')]['id']){delete _0x3510b2[_0x861a('0x45')]['id'];}return db[_0x861a('0x25')][_0x861a('0x42')]({'where':{'id':_0x3510b2[_0x861a('0x3f')]['id']}})[_0x861a('0x21')](handleEntityNotFound(_0xdfb2aa,null))['then'](saveUpdates(_0x3510b2[_0x861a('0x45')],null))[_0x861a('0x21')](respondWithResult(_0xdfb2aa,null))[_0x861a('0x43')](handleError(_0xdfb2aa,null));};exports[_0x861a('0x46')]=function(_0x42449c,_0x2de5d7){return db[_0x861a('0x25')][_0x861a('0x42')]({'where':{'id':_0x42449c[_0x861a('0x3f')]['id']}})[_0x861a('0x21')](handleEntityNotFound(_0x2de5d7,null))[_0x861a('0x21')](removeEntity(_0x2de5d7,null))['catch'](handleError(_0x2de5d7,null));};
\ No newline at end of file
index fc9f322..175bfae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d04=['request-promise','path','../../config/environment','./intZohoField.attributes','exports','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x768dc6,_0x5dcded){var _0x2787cc=function(_0x11d6f2){while(--_0x11d6f2){_0x768dc6['push'](_0x768dc6['shift']());}};_0x2787cc(++_0x5dcded);}(_0x3d04,0xbe));var _0x43d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d04[_0x2dafbe];return _0x58a45a;};'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'));module[_0x43d0('0xa')]=function(_0x617bf,_0x5e284f){return _0x617bf['define']('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x43d0('0xb'),'fields':[_0x43d0('0xc'),_0x43d0('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7096=['rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','util','api','bluebird','request-promise','path'];(function(_0xe3c1c7,_0x119cfb){var _0x3394b0=function(_0x557543){while(--_0x557543){_0xe3c1c7['push'](_0xe3c1c7['shift']());}};_0x3394b0(++_0x119cfb);}(_0x7096,0x10c));var _0x6709=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x7096[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var logger=require('../../config/logger')(_0x6709('0x1'));var moment=require('moment');var BPromise=require(_0x6709('0x2'));var rp=require(_0x6709('0x3'));var fs=require('fs');var path=require(_0x6709('0x4'));var rimraf=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var attributes=require(_0x6709('0x7'));module[_0x6709('0x8')]=function(_0x9d630f,_0xa35832){return _0x9d630f[_0x6709('0x9')](_0x6709('0xa'),attributes,{'tableName':_0x6709('0xb'),'paranoid':![],'indexes':[{'name':_0x6709('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 07ffd0b..82216a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d03=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','randomstring'];(function(_0x3439d5,_0x678c8d){var _0x38080f=function(_0x3a5cef){while(--_0x3a5cef){_0x3439d5['push'](_0x3439d5['shift']());}};_0x38080f(++_0x678c8d);}(_0x5d03,0x1e0));var _0x35d0=function(_0x415b7a,_0x448627){_0x415b7a=_0x415b7a-0x0;var _0x42869f=_0x5d03[_0x415b7a];return _0x42869f;};'use strict';var _=require(_0x35d0('0x0'));var util=require(_0x35d0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x35d0('0x2'));var fs=require('fs');var Redis=require(_0x35d0('0x3'));var db=require(_0x35d0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x35d0('0x5'))(_0x35d0('0x6'));var config=require(_0x35d0('0x7'));var jayson=require(_0x35d0('0x8'));var client=jayson[_0x35d0('0x9')][_0x35d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44b2d1,_0x41be4a,_0x3c6049){return new BPromise(function(_0x50cf05,_0x162385){return client[_0x35d0('0xb')](_0x44b2d1,_0x3c6049)[_0x35d0('0xc')](function(_0x146b93){logger[_0x35d0('0xd')](_0x35d0('0xe'),_0x41be4a,_0x35d0('0xf'));logger[_0x35d0('0x10')](_0x35d0('0x11'),_0x41be4a,_0x35d0('0xf'),JSON[_0x35d0('0x12')](_0x146b93));if(_0x146b93['error']){if(_0x146b93['error'][_0x35d0('0x13')]===0x1f4){logger[_0x35d0('0x14')](_0x35d0('0xe'),_0x41be4a,_0x146b93[_0x35d0('0x14')]['message']);return _0x162385(_0x146b93[_0x35d0('0x14')][_0x35d0('0x15')]);}logger[_0x35d0('0x14')](_0x35d0('0xe'),_0x41be4a,_0x146b93[_0x35d0('0x14')][_0x35d0('0x15')]);return _0x50cf05(_0x146b93[_0x35d0('0x14')]['message']);}else{logger[_0x35d0('0xd')]('ZohoField,\x20%s,\x20%s',_0x41be4a,_0x35d0('0xf'));_0x50cf05(_0x146b93['result']['message']);}})[_0x35d0('0x16')](function(_0x2a5f35){logger['error'](_0x35d0('0xe'),_0x41be4a,_0x2a5f35);_0x162385(_0x2a5f35);});});}
\ No newline at end of file
+var _0x8ef3=['stringify','error','ZohoField,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s'];(function(_0x2204f4,_0xb9ab01){var _0x5d822a=function(_0x12c52e){while(--_0x12c52e){_0x2204f4['push'](_0x2204f4['shift']());}};_0x5d822a(++_0xb9ab01);}(_0x8ef3,0x1bb));var _0x38ef=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8ef3[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x38ef('0x0'));var util=require(_0x38ef('0x1'));var moment=require(_0x38ef('0x2'));var BPromise=require(_0x38ef('0x3'));var rs=require(_0x38ef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x38ef('0x5'))['db'];var utils=require(_0x38ef('0x6'));var logger=require(_0x38ef('0x7'))(_0x38ef('0x8'));var config=require(_0x38ef('0x9'));var jayson=require(_0x38ef('0xa'));var client=jayson[_0x38ef('0xb')][_0x38ef('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x492bac,_0x28a3d1,_0xcf3077){return new BPromise(function(_0x4554a2,_0x3ac750){return client[_0x38ef('0xd')](_0x492bac,_0xcf3077)['then'](function(_0x5b5cb8){logger['info']('ZohoField,\x20%s,\x20%s',_0x28a3d1,_0x38ef('0xe'));logger[_0x38ef('0xf')](_0x38ef('0x10'),_0x28a3d1,_0x38ef('0xe'),JSON[_0x38ef('0x11')](_0x5b5cb8));if(_0x5b5cb8[_0x38ef('0x12')]){if(_0x5b5cb8[_0x38ef('0x12')]['code']===0x1f4){logger[_0x38ef('0x12')](_0x38ef('0x13'),_0x28a3d1,_0x5b5cb8[_0x38ef('0x12')][_0x38ef('0x14')]);return _0x3ac750(_0x5b5cb8['error'][_0x38ef('0x14')]);}logger[_0x38ef('0x12')]('ZohoField,\x20%s,\x20%s',_0x28a3d1,_0x5b5cb8['error'][_0x38ef('0x14')]);return _0x4554a2(_0x5b5cb8['error']['message']);}else{logger[_0x38ef('0x15')](_0x38ef('0x13'),_0x28a3d1,_0x38ef('0xe'));_0x4554a2(_0x5b5cb8[_0x38ef('0x16')]['message']);}})['catch'](function(_0xe5689f){logger[_0x38ef('0x12')](_0x38ef('0x13'),_0x28a3d1,_0xe5689f);_0x3ac750(_0xe5689f);});});}
\ No newline at end of file
index b3848c7..c3091ca 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(_0x5cb139,_0x1a5f77){var _0x816e2b=function(_0x1ad50f){while(--_0x1ad50f){_0x5cb139['push'](_0x5cb139['shift']());}};_0x816e2b(++_0x1a5f77);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xa16ef8,_0x40cc48){var _0x40ab63=function(_0x2fb788){while(--_0x2fb788){_0xa16ef8['push'](_0xa16ef8['shift']());}};_0x40ab63(++_0x40cc48);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'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 a74a49b..bd62780 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa809=['STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','exports'];(function(_0x460919,_0x1391eb){var _0x8f5776=function(_0x27ce4a){while(--_0x27ce4a){_0x460919['push'](_0x460919['shift']());}};_0x8f5776(++_0x1391eb);}(_0xa809,0x16e));var _0x9a80=function(_0x258694,_0x34ecbb){_0x258694=_0x258694-0x0;var _0x21db2c=_0xa809[_0x258694];return _0x21db2c;};'use strict';var Sequelize=require(_0x9a80('0x0'));module[_0x9a80('0x1')]={'name':{'type':Sequelize[_0x9a80('0x2')],'allowNull':![],'unique':_0x9a80('0x3')},'version':{'type':Sequelize[_0x9a80('0x2')],'allowNull':![],'unique':_0x9a80('0x3')},'main':{'type':Sequelize[_0x9a80('0x2')],'defaultValue':_0x9a80('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x9a80('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x9a80('0x5')]},'active':{'type':Sequelize[_0x9a80('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x9a80('0x2')],'unique':_0x9a80('0x7')},'description':{'type':Sequelize[_0x9a80('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x9a80('0x2')]},'link':{'type':Sequelize[_0x9a80('0x2')],'defaultValue':'#'}};
\ No newline at end of file
+var _0xc16a=['BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0xa211d,_0x253018){var _0x441a84=function(_0x385ac5){while(--_0x385ac5){_0xa211d['push'](_0xa211d['shift']());}};_0x441a84(++_0x253018);}(_0xc16a,0x160));var _0xac16=function(_0x54a626,_0x53f5d4){_0x54a626=_0x54a626-0x0;var _0x550444=_0xc16a[_0x54a626];return _0x550444;};'use strict';var Sequelize=require(_0xac16('0x0'));module[_0xac16('0x1')]={'name':{'type':Sequelize[_0xac16('0x2')],'allowNull':![],'unique':_0xac16('0x3')},'version':{'type':Sequelize[_0xac16('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xac16('0x2')],'defaultValue':_0xac16('0x4')},'filename':{'type':Sequelize[_0xac16('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xac16('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xac16('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xac16('0x2')],'unique':_0xac16('0x6')},'description':{'type':Sequelize[_0xac16('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xac16('0x2')]},'link':{'type':Sequelize[_0xac16('0x2')],'defaultValue':'#'}};
\ No newline at end of file
index e453ee7..ec78104 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d58=['../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','then','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','Integration','include','findAll','rows','show','params','rawAttributes','keys','length','includeAll','merge','create','update','find','catch','destroy','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x21f4ad,_0x280c74){var _0x1e383d=function(_0x111124){while(--_0x111124){_0x21f4ad['push'](_0x21f4ad['shift']());}};_0x1e383d(++_0x280c74);}(_0x5d58,0x187));var _0x85d5=function(_0x5c2d96,_0x579d22){_0x5c2d96=_0x5c2d96-0x0;var _0x919b60=_0x5d58[_0x5c2d96];return _0x919b60;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x85d5('0x0'));var BPromise=require(_0x85d5('0x1'));var Mustache=require('mustache');var util=require(_0x85d5('0x2'));var path=require(_0x85d5('0x3'));var sox=require('sox');var csv=require(_0x85d5('0x4'));var ejs=require(_0x85d5('0x5'));var fs=require('fs');var fs_extra=require(_0x85d5('0x6'));var _=require(_0x85d5('0x7'));var squel=require('squel');var crypto=require(_0x85d5('0x8'));var jsforce=require(_0x85d5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x85d5('0x4'));var querystring=require('querystring');var Papa=require(_0x85d5('0xa'));var Redis=require(_0x85d5('0xb'));var authService=require(_0x85d5('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85d5('0xd'))(_0x85d5('0xe'));var utils=require(_0x85d5('0xf'));var config=require(_0x85d5('0x10'));var licenseUtil=require(_0x85d5('0x11'));var db=require(_0x85d5('0x12'))['db'];function respondWithStatusCode(_0x31409d,_0x5897af){_0x5897af=_0x5897af||0xcc;return function(_0x4bbf2a){if(_0x4bbf2a){return _0x31409d['sendStatus'](_0x5897af);}return _0x31409d[_0x85d5('0x13')](_0x5897af)[_0x85d5('0x14')]();};}function respondWithResult(_0x339d4f,_0x1704f0){_0x1704f0=_0x1704f0||0xc8;return function(_0x18a20c){if(_0x18a20c){return _0x339d4f[_0x85d5('0x13')](_0x1704f0)[_0x85d5('0x15')](_0x18a20c);}};}function respondWithFilteredResult(_0x586382,_0x18e977){return function(_0x2d7c95){if(_0x2d7c95){var _0x1621ed=typeof _0x18e977[_0x85d5('0x16')]===_0x85d5('0x17')&&typeof _0x18e977[_0x85d5('0x18')]===_0x85d5('0x17');var _0x12bef9=_0x2d7c95[_0x85d5('0x19')];var _0x17acb0=_0x1621ed?0x0:_0x18e977[_0x85d5('0x16')];var _0x432bd6=_0x1621ed?_0x2d7c95[_0x85d5('0x19')]:_0x18e977[_0x85d5('0x16')]+_0x18e977[_0x85d5('0x18')];var _0x26981b;if(_0x432bd6>=_0x12bef9){_0x432bd6=_0x12bef9;_0x26981b=0xc8;}else{_0x26981b=0xce;}_0x586382[_0x85d5('0x13')](_0x26981b);return _0x586382[_0x85d5('0x1a')]('Content-Range',_0x17acb0+'-'+_0x432bd6+'/'+_0x12bef9)[_0x85d5('0x15')](_0x2d7c95);}return null;};}function patchUpdates(_0x133fa9){return function(_0x5f5755){try{jsonpatch[_0x85d5('0x1b')](_0x5f5755,_0x133fa9,!![]);}catch(_0x1264ca){return BPromise['reject'](_0x1264ca);}return _0x5f5755['save']();};}function saveUpdates(_0x347337,_0x5a1b9a){return function(_0x2f2bae){if(_0x2f2bae){return _0x2f2bae['update'](_0x347337)[_0x85d5('0x1c')](function(_0x1f8d27){return _0x1f8d27;});}return null;};}function removeEntity(_0x560b3a,_0x4e11c4){return function(_0x4da71b){if(_0x4da71b){return _0x4da71b['destroy']()[_0x85d5('0x1c')](function(){_0x560b3a[_0x85d5('0x13')](0xcc)[_0x85d5('0x14')]();});}};}function handleEntityNotFound(_0x466bbd,_0x12fea3){return function(_0xef2405){if(!_0xef2405){_0x466bbd['sendStatus'](0x194);}return _0xef2405;};}function handleError(_0x7e9a11,_0x4f8c66){_0x4f8c66=_0x4f8c66||0x1f4;return function(_0x1b3fae){logger[_0x85d5('0x1d')](_0x1b3fae[_0x85d5('0x1e')]);if(_0x1b3fae['name']){delete _0x1b3fae[_0x85d5('0x1f')];}_0x7e9a11[_0x85d5('0x13')](_0x4f8c66)[_0x85d5('0x20')](_0x1b3fae);};}exports[_0x85d5('0x21')]=function(_0x4605c5,_0x56031f){var _0x1cbef1={},_0x476c8b={},_0x330f8a={'count':0x0,'rows':[]};var _0x22a961=_[_0x85d5('0x22')](db['Integration']['rawAttributes'],function(_0x2ce7a9){return{'name':_0x2ce7a9[_0x85d5('0x23')],'type':_0x2ce7a9[_0x85d5('0x24')][_0x85d5('0x25')]};});_0x476c8b[_0x85d5('0x26')]=_['map'](_0x22a961,_0x85d5('0x1f'));_0x476c8b[_0x85d5('0x27')]=_['keys'](_0x4605c5['query']);_0x476c8b[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x476c8b['model'],_0x476c8b[_0x85d5('0x27')]);_0x1cbef1['attributes']=_[_0x85d5('0x29')](_0x476c8b[_0x85d5('0x26')],qs['fields'](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x1cbef1[_0x85d5('0x2b')]=_0x1cbef1[_0x85d5('0x2b')]['length']?_0x1cbef1['attributes']:_0x476c8b[_0x85d5('0x26')];if(!_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2c')](_0x85d5('0x2d'))){_0x1cbef1[_0x85d5('0x18')]=qs[_0x85d5('0x18')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x18')]);_0x1cbef1[_0x85d5('0x16')]=qs['offset'](_0x4605c5['query'][_0x85d5('0x16')]);}_0x1cbef1[_0x85d5('0x2e')]=qs[_0x85d5('0x2f')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2f')]);_0x1cbef1[_0x85d5('0x30')]=qs[_0x85d5('0x28')](_[_0x85d5('0x31')](_0x4605c5['query'],_0x476c8b[_0x85d5('0x28')]),_0x22a961);if(_0x4605c5[_0x85d5('0x27')][_0x85d5('0x32')]){_0x1cbef1[_0x85d5('0x30')]=_['merge'](_0x1cbef1[_0x85d5('0x30')],{'$or':_[_0x85d5('0x22')](_0x22a961,function(_0x3282d3){if(_0x3282d3[_0x85d5('0x24')]!=='VIRTUAL'){var _0x34caed={};_0x34caed[_0x3282d3['name']]={'$like':'%'+_0x4605c5['query'][_0x85d5('0x32')]+'%'};return _0x34caed;}})});}_0x1cbef1=_['merge']({},_0x1cbef1,_0x4605c5[_0x85d5('0x33')]);var _0x5ddba7={'where':_0x1cbef1['where']};return db[_0x85d5('0x34')][_0x85d5('0x19')](_0x5ddba7)[_0x85d5('0x1c')](function(_0x1beffc){_0x330f8a[_0x85d5('0x19')]=_0x1beffc;if(_0x4605c5['query']['includeAll']){_0x1cbef1[_0x85d5('0x35')]=[{'all':!![]}];}return db[_0x85d5('0x34')][_0x85d5('0x36')](_0x1cbef1);})[_0x85d5('0x1c')](function(_0xdd8b3e){_0x330f8a[_0x85d5('0x37')]=_0xdd8b3e;return _0x330f8a;})['then'](respondWithFilteredResult(_0x56031f,_0x1cbef1))['catch'](handleError(_0x56031f,null));};exports[_0x85d5('0x38')]=function(_0x52c99b,_0xfbf466){var _0x18e94d={'raw':![],'where':{'id':_0x52c99b[_0x85d5('0x39')]['id']}},_0x7dd430={};_0x7dd430[_0x85d5('0x26')]=_['keys'](db['Integration'][_0x85d5('0x3a')]);_0x7dd430[_0x85d5('0x27')]=_[_0x85d5('0x3b')](_0x52c99b[_0x85d5('0x27')]);_0x7dd430[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],_0x7dd430[_0x85d5('0x27')]);_0x18e94d[_0x85d5('0x2b')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],qs[_0x85d5('0x2a')](_0x52c99b[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x18e94d[_0x85d5('0x2b')]=_0x18e94d[_0x85d5('0x2b')][_0x85d5('0x3c')]?_0x18e94d['attributes']:_0x7dd430['model'];if(_0x52c99b[_0x85d5('0x27')][_0x85d5('0x3d')]){_0x18e94d[_0x85d5('0x35')]=[{'all':!![]}];}_0x18e94d=_[_0x85d5('0x3e')]({},_0x18e94d,_0x52c99b[_0x85d5('0x33')]);return db[_0x85d5('0x34')]['find'](_0x18e94d)[_0x85d5('0x1c')](handleEntityNotFound(_0xfbf466,null))['then'](respondWithResult(_0xfbf466,null))['catch'](handleError(_0xfbf466,null));};exports[_0x85d5('0x3f')]=function(_0x13ab32,_0x12a03){return db[_0x85d5('0x34')][_0x85d5('0x3f')](_0x13ab32['body'],{})[_0x85d5('0x1c')](respondWithResult(_0x12a03,0xc9))['catch'](handleError(_0x12a03,null));};exports[_0x85d5('0x40')]=function(_0xd8db57,_0x219154){if(_0xd8db57['body']['id']){delete _0xd8db57['body']['id'];}return db['Integration'][_0x85d5('0x41')]({'where':{'id':_0xd8db57[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x219154,null))['then'](saveUpdates(_0xd8db57['body'],null))[_0x85d5('0x1c')](respondWithResult(_0x219154,null))[_0x85d5('0x42')](handleError(_0x219154,null));};exports[_0x85d5('0x43')]=function(_0x288b56,_0x4b2dce){return db[_0x85d5('0x34')][_0x85d5('0x41')]({'where':{'id':_0x288b56[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x4b2dce,null))[_0x85d5('0x1c')](removeEntity(_0x4b2dce,null))[_0x85d5('0x42')](handleError(_0x4b2dce,null));};
\ No newline at end of file
+var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','Integration','fieldName','type','key'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xadb5,0xad));var _0x5adb=function(_0x56d3af,_0x1e1753){_0x56d3af=_0x56d3af-0x0;var _0x29d72e=_0xadb5[_0x56d3af];return _0x29d72e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['Integration']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};
\ No newline at end of file
index 3071aa4..94b3c0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x539c=['exports','define','Integration','lodash','api','moment','request-promise','rimraf','../../config/environment'];(function(_0xbd3a05,_0xe6c6b7){var _0x101f90=function(_0x34fbcb){while(--_0x34fbcb){_0xbd3a05['push'](_0xbd3a05['shift']());}};_0x101f90(++_0xe6c6b7);}(_0x539c,0x108));var _0xc539=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x539c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc539('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc539('0x1'));var moment=require(_0xc539('0x2'));var BPromise=require('bluebird');var rp=require(_0xc539('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc539('0x4'));var config=require(_0xc539('0x5'));var attributes=require('./integration.attributes');module[_0xc539('0x6')]=function(_0x736f31,_0x215094){return _0x736f31[_0xc539('0x7')](_0xc539('0x8'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x13ae=['./integration.attributes','exports','define','Integration','integrations','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x59710f,_0x44c7f0){var _0xaae66a=function(_0x1c2397){while(--_0x1c2397){_0x59710f['push'](_0x59710f['shift']());}};_0xaae66a(++_0x44c7f0);}(_0x13ae,0x89));var _0xe13a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x13ae[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xe13a('0x0'));var util=require('util');var logger=require(_0xe13a('0x1'))('api');var moment=require(_0xe13a('0x2'));var BPromise=require(_0xe13a('0x3'));var rp=require(_0xe13a('0x4'));var fs=require('fs');var path=require(_0xe13a('0x5'));var rimraf=require('rimraf');var config=require(_0xe13a('0x6'));var attributes=require(_0xe13a('0x7'));module[_0xe13a('0x8')]=function(_0x440090,_0x570dd0){return _0x440090[_0xe13a('0x9')](_0xe13a('0xa'),attributes,{'tableName':_0xe13a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index abc132c..a10aa42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd943=['info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x136855,_0xd91856){var _0x3d08dc=function(_0x5e17d0){while(--_0x5e17d0){_0x136855['push'](_0x136855['shift']());}};_0x3d08dc(++_0xd91856);}(_0xd943,0x15d));var _0x3d94=function(_0x450e8f,_0x172c4c){_0x450e8f=_0x450e8f-0x0;var _0x1f001d=_0xd943[_0x450e8f];return _0x1f001d;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('Integration,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});}
\ No newline at end of file
+var _0x2542=['info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x2c765c,_0x157997){var _0x431499=function(_0x316524){while(--_0x316524){_0x2c765c['push'](_0x2c765c['shift']());}};_0x431499(++_0x157997);}(_0x2542,0x169));var _0x2254=function(_0x4d954a,_0x44b65e){_0x4d954a=_0x4d954a-0x0;var _0x5de6c0=_0x2542[_0x4d954a];return _0x5de6c0;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});}
\ No newline at end of file
index f98eb7d..ee096c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ac=['./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x42fb42,_0x25bdf1){var _0x38fdd3=function(_0x4fc0f9){while(--_0x4fc0f9){_0x42fb42['push'](_0x42fb42['shift']());}};_0x38fdd3(++_0x25bdf1);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x22fc19,_0x40a533){_0x22fc19=_0x22fc19-0x0;var _0x12d692=_0xc6ac[_0x22fc19];return _0x12d692;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0x12')]('/',auth[_0xcc6a('0xc')](),controller['create']);router[_0xcc6a('0x13')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['update']);router[_0xcc6a('0x14')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x66fa=['index','get','/describe','post','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0xeeb156,_0x5392f4){var _0x4b7c74=function(_0x5705bb){while(--_0x5705bb){_0xeeb156['push'](_0xeeb156['shift']());}};_0x4b7c74(++_0x5392f4);}(_0x66fa,0x117));var _0xa66f=function(_0x4009b7,_0x4f8f0c){_0x4009b7=_0x4009b7-0x0;var _0x1fad17=_0x66fa[_0x4009b7];return _0x1fad17;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xe'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xf')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0x10')]=router;
\ No newline at end of file
index 4c6152b..f882db2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32cd=['exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENT','sequelize'];(function(_0x59df9c,_0x5668b9){var _0x248b8a=function(_0x515013){while(--_0x515013){_0x59df9c['push'](_0x59df9c['shift']());}};_0x248b8a(++_0x5668b9);}(_0x32cd,0x104));var _0xd32c=function(_0x4ea77c,_0x329fb5){_0x4ea77c=_0x4ea77c-0x0;var _0x4e9313=_0x32cd[_0x4ea77c];return _0x4e9313;};'use strict';var Sequelize=require(_0xd32c('0x0'));module[_0xd32c('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xd32c('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd32c('0x2')]},'calleridnum':{'type':Sequelize[_0xd32c('0x2')]},'calleridname':{'type':Sequelize[_0xd32c('0x2')]},'queue':{'type':Sequelize[_0xd32c('0x2')]},'interface':{'type':Sequelize[_0xd32c('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xd32c('0x3')]},'agentconnectAt':{'type':Sequelize[_0xd32c('0x3')]},'holdtime':{'type':Sequelize[_0xd32c('0x4')]},'agentcomplete':{'type':Sequelize[_0xd32c('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xd32c('0x3')]},'talktime':{'type':Sequelize[_0xd32c('0x4')]},'agentacw':{'type':Sequelize[_0xd32c('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd32c('0x4')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xd32c('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xd32c('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xd32c('0x3')]},'lastevent':{'type':Sequelize[_0xd32c('0x2')]},'channel':{'type':Sequelize[_0xd32c('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xd32c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xd32c('0x2')]},'connectedlinename':{'type':Sequelize[_0xd32c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xd32c('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xd32c('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd32c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd32c('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd32c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xd32c('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd32c('0x2')]},'destlanguage':{'type':Sequelize[_0xd32c('0x2')]},'destaccountcode':{'type':Sequelize[_0xd32c('0x2')]},'destcontext':{'type':Sequelize[_0xd32c('0x2')]},'destexten':{'type':Sequelize[_0xd32c('0x2')]},'destpriority':{'type':Sequelize[_0xd32c('0x2')]},'destuniqueid':{'type':Sequelize[_0xd32c('0x2')]},'messageId':{'type':Sequelize[_0xd32c('0x2')]},'inReplyTo':{'type':Sequelize[_0xd32c('0x2')]},'subject':{'type':Sequelize[_0xd32c('0x2')]},'from':{'type':Sequelize[_0xd32c('0x2')]},'to':{'type':Sequelize[_0xd32c('0x2')]},'cc':{'type':Sequelize[_0xd32c('0x2')]},'attachment':{'type':Sequelize[_0xd32c('0x6')]},'html':{'type':Sequelize[_0xd32c('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xd32c('0x7')](_0xd32c('0x8'),'SENDING','RECEIVED','FAILED')},'url':{'type':Sequelize[_0xd32c('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xd32c('0x2')]},'projectId':{'type':Sequelize[_0xd32c('0x4')]}};
\ No newline at end of file
+var _0x58d0=['TEXT','SENT','SENDING','RECEIVED','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x4b32bd,_0x4bffe7){var _0x2e1d19=function(_0x1709fa){while(--_0x1709fa){_0x4b32bd['push'](_0x4b32bd['shift']());}};_0x2e1d19(++_0x4bffe7);}(_0x58d0,0x1db));var _0x058d=function(_0x29e7fa,_0x231b9c){_0x29e7fa=_0x29e7fa-0x0;var _0x93b500=_0x58d0[_0x29e7fa];return _0x93b500;};'use strict';var Sequelize=require('sequelize');module[_0x058d('0x0')]={'integration':{'type':Sequelize[_0x058d('0x1')]},'eventChannel':{'type':Sequelize[_0x058d('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x058d('0x1')]},'integrationId':{'type':Sequelize[_0x058d('0x2')]},'contacts':{'type':Sequelize[_0x058d('0x1')]},'uniqueid':{'type':Sequelize[_0x058d('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x058d('0x1')]},'queue':{'type':Sequelize[_0x058d('0x1')]},'interface':{'type':Sequelize[_0x058d('0x1')]},'membername':{'type':Sequelize[_0x058d('0x1')]},'agentcalledAt':{'type':Sequelize[_0x058d('0x3')]},'agentconnectAt':{'type':Sequelize[_0x058d('0x3')]},'holdtime':{'type':Sequelize[_0x058d('0x2')]},'agentcomplete':{'type':Sequelize[_0x058d('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x058d('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x058d('0x2')]},'reason':{'type':Sequelize[_0x058d('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x058d('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x058d('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x058d('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x058d('0x1')]},'connectedlinenum':{'type':Sequelize[_0x058d('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x058d('0x1')]},'accountcode':{'type':Sequelize[_0x058d('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x058d('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x058d('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x058d('0x1')]},'destcalleridname':{'type':Sequelize[_0x058d('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x058d('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x058d('0x1')]},'destlanguage':{'type':Sequelize[_0x058d('0x1')]},'destaccountcode':{'type':Sequelize[_0x058d('0x1')]},'destcontext':{'type':Sequelize[_0x058d('0x1')]},'destexten':{'type':Sequelize[_0x058d('0x1')]},'destpriority':{'type':Sequelize[_0x058d('0x1')]},'destuniqueid':{'type':Sequelize[_0x058d('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x058d('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x058d('0x1')]},'to':{'type':Sequelize[_0x058d('0x1')]},'cc':{'type':Sequelize[_0x058d('0x1')]},'attachment':{'type':Sequelize[_0x058d('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x058d('0x5')]},'status':{'type':Sequelize['ENUM'](_0x058d('0x6'),_0x058d('0x7'),_0x058d('0x8'),_0x058d('0x9'))},'url':{'type':Sequelize[_0x058d('0x1')]},'app':{'type':Sequelize[_0x058d('0x1')]},'appdata':{'type':Sequelize[_0x058d('0x1')]},'projectId':{'type':Sequelize[_0x058d('0x2')]}};
\ No newline at end of file
index 7894c30..8f5cd34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x523f=['attributes','fields','nolimit','order','sort','where','VIRTUAL','filter','merge','options','count','rows','catch','show','params','keys','rawAttributes','length','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','IntegrationReport','fieldName','type','key','model','query','filters','intersection'];(function(_0x5924e3,_0x22ef59){var _0x17a99e=function(_0x5e9481){while(--_0x5e9481){_0x5924e3['push'](_0x5924e3['shift']());}};_0x17a99e(++_0x22ef59);}(_0x523f,0x18a));var _0xf523=function(_0x5ea79b,_0x913207){_0x5ea79b=_0x5ea79b-0x0;var _0x39cbc6=_0x523f[_0x5ea79b];return _0x39cbc6;};'use strict';var emlformat=require(_0xf523('0x0'));var rimraf=require(_0xf523('0x1'));var zipdir=require(_0xf523('0x2'));var jsonpatch=require(_0xf523('0x3'));var rp=require(_0xf523('0x4'));var moment=require(_0xf523('0x5'));var BPromise=require(_0xf523('0x6'));var Mustache=require('mustache');var util=require(_0xf523('0x7'));var path=require(_0xf523('0x8'));var sox=require(_0xf523('0x9'));var csv=require(_0xf523('0xa'));var ejs=require(_0xf523('0xb'));var fs=require('fs');var fs_extra=require(_0xf523('0xc'));var _=require('lodash');var squel=require(_0xf523('0xd'));var crypto=require('crypto');var jsforce=require(_0xf523('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf523('0xa'));var querystring=require(_0xf523('0xf'));var Papa=require(_0xf523('0x10'));var Redis=require(_0xf523('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf523('0x12'));var as=require(_0xf523('0x13'));var hardwareService=require(_0xf523('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf523('0x15'));var config=require(_0xf523('0x16'));var licenseUtil=require(_0xf523('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53ead3,_0x87991d){_0x87991d=_0x87991d||0xcc;return function(_0x233c48){if(_0x233c48){return _0x53ead3[_0xf523('0x18')](_0x87991d);}return _0x53ead3[_0xf523('0x19')](_0x87991d)[_0xf523('0x1a')]();};}function respondWithResult(_0xcb8712,_0x556f52){_0x556f52=_0x556f52||0xc8;return function(_0x4fec9a){if(_0x4fec9a){return _0xcb8712[_0xf523('0x19')](_0x556f52)[_0xf523('0x1b')](_0x4fec9a);}};}function respondWithFilteredResult(_0x448583,_0xd756a1){return function(_0x153b1e){if(_0x153b1e){var _0x36ab44=typeof _0xd756a1[_0xf523('0x1c')]==='undefined'&&typeof _0xd756a1['limit']===_0xf523('0x1d');var _0x2dc6e2=_0x153b1e['count'];var _0xe7d627=_0x36ab44?0x0:_0xd756a1[_0xf523('0x1c')];var _0x1777f6=_0x36ab44?_0x153b1e['count']:_0xd756a1[_0xf523('0x1c')]+_0xd756a1[_0xf523('0x1e')];var _0x1f2ce3;if(_0x1777f6>=_0x2dc6e2){_0x1777f6=_0x2dc6e2;_0x1f2ce3=0xc8;}else{_0x1f2ce3=0xce;}_0x448583[_0xf523('0x19')](_0x1f2ce3);return _0x448583['set'](_0xf523('0x1f'),_0xe7d627+'-'+_0x1777f6+'/'+_0x2dc6e2)[_0xf523('0x1b')](_0x153b1e);}return null;};}function patchUpdates(_0x456f1d){return function(_0x22b7c4){try{jsonpatch[_0xf523('0x20')](_0x22b7c4,_0x456f1d,!![]);}catch(_0x53323b){return BPromise['reject'](_0x53323b);}return _0x22b7c4[_0xf523('0x21')]();};}function saveUpdates(_0x3e6ce8,_0x7fa285){return function(_0x42569f){if(_0x42569f){return _0x42569f[_0xf523('0x22')](_0x3e6ce8)[_0xf523('0x23')](function(_0xbf5239){return _0xbf5239;});}return null;};}function removeEntity(_0x12e78f,_0x258cb9){return function(_0x1804e2){if(_0x1804e2){return _0x1804e2[_0xf523('0x24')]()['then'](function(){_0x12e78f[_0xf523('0x19')](0xcc)[_0xf523('0x1a')]();});}};}function handleEntityNotFound(_0x3299de,_0x47e948){return function(_0x3c655b){if(!_0x3c655b){_0x3299de['sendStatus'](0x194);}return _0x3c655b;};}function handleError(_0x3cba4e,_0x127472){_0x127472=_0x127472||0x1f4;return function(_0x475bb0){logger[_0xf523('0x25')](_0x475bb0['stack']);if(_0x475bb0[_0xf523('0x26')]){delete _0x475bb0['name'];}_0x3cba4e[_0xf523('0x19')](_0x127472)[_0xf523('0x27')](_0x475bb0);};}exports[_0xf523('0x28')]=function(_0x3559bb,_0x74a326){var _0x15940f={},_0x1af6c2={},_0x4cd2d0={'count':0x0,'rows':[]};var _0x1cf6c3=_[_0xf523('0x29')](db[_0xf523('0x2a')]['rawAttributes'],function(_0x29e0e7){return{'name':_0x29e0e7[_0xf523('0x2b')],'type':_0x29e0e7[_0xf523('0x2c')][_0xf523('0x2d')]};});_0x1af6c2[_0xf523('0x2e')]=_[_0xf523('0x29')](_0x1cf6c3,_0xf523('0x26'));_0x1af6c2[_0xf523('0x2f')]=_['keys'](_0x3559bb[_0xf523('0x2f')]);_0x1af6c2[_0xf523('0x30')]=_[_0xf523('0x31')](_0x1af6c2[_0xf523('0x2e')],_0x1af6c2[_0xf523('0x2f')]);_0x15940f[_0xf523('0x32')]=_[_0xf523('0x31')](_0x1af6c2[_0xf523('0x2e')],qs[_0xf523('0x33')](_0x3559bb[_0xf523('0x2f')][_0xf523('0x33')]));_0x15940f['attributes']=_0x15940f[_0xf523('0x32')]['length']?_0x15940f[_0xf523('0x32')]:_0x1af6c2[_0xf523('0x2e')];if(!_0x3559bb['query']['hasOwnProperty'](_0xf523('0x34'))){_0x15940f[_0xf523('0x1e')]=qs[_0xf523('0x1e')](_0x3559bb[_0xf523('0x2f')][_0xf523('0x1e')]);_0x15940f[_0xf523('0x1c')]=qs[_0xf523('0x1c')](_0x3559bb[_0xf523('0x2f')][_0xf523('0x1c')]);}_0x15940f[_0xf523('0x35')]=qs[_0xf523('0x36')](_0x3559bb[_0xf523('0x2f')][_0xf523('0x36')]);_0x15940f[_0xf523('0x37')]=qs[_0xf523('0x30')](_['pick'](_0x3559bb[_0xf523('0x2f')],_0x1af6c2[_0xf523('0x30')]),_0x1cf6c3);if(_0x3559bb[_0xf523('0x2f')]['filter']){_0x15940f[_0xf523('0x37')]=_['merge'](_0x15940f[_0xf523('0x37')],{'$or':_[_0xf523('0x29')](_0x1cf6c3,function(_0x3f78f0){if(_0x3f78f0['type']!==_0xf523('0x38')){var _0x1f051e={};_0x1f051e[_0x3f78f0['name']]={'$like':'%'+_0x3559bb[_0xf523('0x2f')][_0xf523('0x39')]+'%'};return _0x1f051e;}})});}_0x15940f=_[_0xf523('0x3a')]({},_0x15940f,_0x3559bb[_0xf523('0x3b')]);var _0x458935={'where':_0x15940f[_0xf523('0x37')]};return db[_0xf523('0x2a')][_0xf523('0x3c')](_0x458935)[_0xf523('0x23')](function(_0x47ee67){_0x4cd2d0[_0xf523('0x3c')]=_0x47ee67;if(_0x3559bb[_0xf523('0x2f')]['includeAll']){_0x15940f['include']=[{'all':!![]}];}return db[_0xf523('0x2a')]['findAll'](_0x15940f);})[_0xf523('0x23')](function(_0x23e68c){_0x4cd2d0[_0xf523('0x3d')]=_0x23e68c;return _0x4cd2d0;})[_0xf523('0x23')](respondWithFilteredResult(_0x74a326,_0x15940f))[_0xf523('0x3e')](handleError(_0x74a326,null));};exports[_0xf523('0x3f')]=function(_0x2d9222,_0x158c0b){var _0x327ead={'raw':![],'where':{'id':_0x2d9222[_0xf523('0x40')]['id']}},_0x31f672={};_0x31f672[_0xf523('0x2e')]=_[_0xf523('0x41')](db[_0xf523('0x2a')][_0xf523('0x42')]);_0x31f672['query']=_['keys'](_0x2d9222[_0xf523('0x2f')]);_0x31f672[_0xf523('0x30')]=_[_0xf523('0x31')](_0x31f672[_0xf523('0x2e')],_0x31f672[_0xf523('0x2f')]);_0x327ead[_0xf523('0x32')]=_['intersection'](_0x31f672[_0xf523('0x2e')],qs[_0xf523('0x33')](_0x2d9222['query'][_0xf523('0x33')]));_0x327ead[_0xf523('0x32')]=_0x327ead[_0xf523('0x32')][_0xf523('0x43')]?_0x327ead[_0xf523('0x32')]:_0x31f672[_0xf523('0x2e')];if(_0x2d9222[_0xf523('0x2f')][_0xf523('0x44')]){_0x327ead[_0xf523('0x45')]=[{'all':!![]}];}_0x327ead=_['merge']({},_0x327ead,_0x2d9222[_0xf523('0x3b')]);return db[_0xf523('0x2a')][_0xf523('0x46')](_0x327ead)['then'](handleEntityNotFound(_0x158c0b,null))[_0xf523('0x23')](respondWithResult(_0x158c0b,null))[_0xf523('0x3e')](handleError(_0x158c0b,null));};exports[_0xf523('0x47')]=function(_0x155af2,_0x2e0c7e){return db[_0xf523('0x2a')][_0xf523('0x47')](_0x155af2['body'],{})[_0xf523('0x23')](respondWithResult(_0x2e0c7e,0xc9))[_0xf523('0x3e')](handleError(_0x2e0c7e,null));};exports['update']=function(_0x304523,_0x2000b7){if(_0x304523[_0xf523('0x48')]['id']){delete _0x304523[_0xf523('0x48')]['id'];}return db[_0xf523('0x2a')][_0xf523('0x46')]({'where':{'id':_0x304523[_0xf523('0x40')]['id']}})['then'](handleEntityNotFound(_0x2000b7,null))[_0xf523('0x23')](saveUpdates(_0x304523[_0xf523('0x48')],null))[_0xf523('0x23')](respondWithResult(_0x2000b7,null))['catch'](handleError(_0x2000b7,null));};exports[_0xf523('0x24')]=function(_0x38d80e,_0x2835c8){return db[_0xf523('0x2a')]['find']({'where':{'id':_0x38d80e[_0xf523('0x40')]['id']}})[_0xf523('0x23')](handleEntityNotFound(_0x2835c8,null))[_0xf523('0x23')](removeEntity(_0x2835c8,null))['catch'](handleError(_0x2835c8,null));};exports[_0xf523('0x49')]=function(_0x1d150b,_0x2ad82e){return db[_0xf523('0x2a')][_0xf523('0x49')]()[_0xf523('0x23')](respondWithResult(_0x2ad82e,null))[_0xf523('0x3e')](handleError(_0x2ad82e,null));};
\ No newline at end of file
+var _0x695b=['count','set','Content-Range','apply','reject','then','name','send','index','map','IntegrationReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','where','includeAll','include','catch','options','create','body','params','destroy','find','describe','eml-format','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/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x695b,0x70));var _0xb695=function(_0xcc1faf,_0x3fa85e){_0xcc1faf=_0xcc1faf-0x0;var _0x4e766=_0x695b[_0xcc1faf];return _0x4e766;};'use strict';var emlformat=require(_0xb695('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb695('0x1'));var jsonpatch=require(_0xb695('0x2'));var rp=require('request-promise');var moment=require(_0xb695('0x3'));var BPromise=require(_0xb695('0x4'));var Mustache=require(_0xb695('0x5'));var util=require(_0xb695('0x6'));var path=require(_0xb695('0x7'));var sox=require(_0xb695('0x8'));var csv=require(_0xb695('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb695('0xa'));var _=require(_0xb695('0xb'));var squel=require(_0xb695('0xc'));var crypto=require(_0xb695('0xd'));var jsforce=require(_0xb695('0xe'));var deskjs=require(_0xb695('0xf'));var toCsv=require(_0xb695('0x9'));var querystring=require(_0xb695('0x10'));var Papa=require(_0xb695('0x11'));var Redis=require(_0xb695('0x12'));var authService=require(_0xb695('0x13'));var qs=require(_0xb695('0x14'));var as=require(_0xb695('0x15'));var hardwareService=require(_0xb695('0x16'));var logger=require(_0xb695('0x17'))('api');var utils=require(_0xb695('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb695('0x19'));var db=require(_0xb695('0x1a'))['db'];function respondWithStatusCode(_0x70240,_0x2a7816){_0x2a7816=_0x2a7816||0xcc;return function(_0x831bc6){if(_0x831bc6){return _0x70240[_0xb695('0x1b')](_0x2a7816);}return _0x70240[_0xb695('0x1c')](_0x2a7816)[_0xb695('0x1d')]();};}function respondWithResult(_0x31f459,_0x46b4de){_0x46b4de=_0x46b4de||0xc8;return function(_0x32db42){if(_0x32db42){return _0x31f459['status'](_0x46b4de)[_0xb695('0x1e')](_0x32db42);}};}function respondWithFilteredResult(_0x313a46,_0x1a195d){return function(_0x45fbb9){if(_0x45fbb9){var _0x172d0f=typeof _0x1a195d[_0xb695('0x1f')]===_0xb695('0x20')&&typeof _0x1a195d[_0xb695('0x21')]===_0xb695('0x20');var _0x325831=_0x45fbb9[_0xb695('0x22')];var _0x2c912d=_0x172d0f?0x0:_0x1a195d[_0xb695('0x1f')];var _0x5b95aa=_0x172d0f?_0x45fbb9[_0xb695('0x22')]:_0x1a195d['offset']+_0x1a195d['limit'];var _0x174bdd;if(_0x5b95aa>=_0x325831){_0x5b95aa=_0x325831;_0x174bdd=0xc8;}else{_0x174bdd=0xce;}_0x313a46[_0xb695('0x1c')](_0x174bdd);return _0x313a46[_0xb695('0x23')](_0xb695('0x24'),_0x2c912d+'-'+_0x5b95aa+'/'+_0x325831)['json'](_0x45fbb9);}return null;};}function patchUpdates(_0x2a9d26){return function(_0x3a35ec){try{jsonpatch[_0xb695('0x25')](_0x3a35ec,_0x2a9d26,!![]);}catch(_0x4afae0){return BPromise[_0xb695('0x26')](_0x4afae0);}return _0x3a35ec['save']();};}function saveUpdates(_0xee58b5,_0x1e641a){return function(_0x3db6d6){if(_0x3db6d6){return _0x3db6d6['update'](_0xee58b5)[_0xb695('0x27')](function(_0x394e37){return _0x394e37;});}return null;};}function removeEntity(_0x738af,_0x29bb08){return function(_0xa3c43f){if(_0xa3c43f){return _0xa3c43f['destroy']()[_0xb695('0x27')](function(){_0x738af[_0xb695('0x1c')](0xcc)[_0xb695('0x1d')]();});}};}function handleEntityNotFound(_0x12d3b1,_0x3b505a){return function(_0xff7ce5){if(!_0xff7ce5){_0x12d3b1[_0xb695('0x1b')](0x194);}return _0xff7ce5;};}function handleError(_0x3ae143,_0x2ea4bd){_0x2ea4bd=_0x2ea4bd||0x1f4;return function(_0x42699c){logger['error'](_0x42699c['stack']);if(_0x42699c[_0xb695('0x28')]){delete _0x42699c[_0xb695('0x28')];}_0x3ae143['status'](_0x2ea4bd)[_0xb695('0x29')](_0x42699c);};}exports[_0xb695('0x2a')]=function(_0x4ee6e2,_0x10fecd){var _0x520b4c={},_0x47661a={},_0x5a8cdc={'count':0x0,'rows':[]};var _0x205b78=_[_0xb695('0x2b')](db[_0xb695('0x2c')][_0xb695('0x2d')],function(_0x75899){return{'name':_0x75899['fieldName'],'type':_0x75899['type'][_0xb695('0x2e')]};});_0x47661a[_0xb695('0x2f')]=_[_0xb695('0x2b')](_0x205b78,_0xb695('0x28'));_0x47661a[_0xb695('0x30')]=_[_0xb695('0x31')](_0x4ee6e2[_0xb695('0x30')]);_0x47661a[_0xb695('0x32')]=_[_0xb695('0x33')](_0x47661a[_0xb695('0x2f')],_0x47661a[_0xb695('0x30')]);_0x520b4c['attributes']=_[_0xb695('0x33')](_0x47661a[_0xb695('0x2f')],qs[_0xb695('0x34')](_0x4ee6e2[_0xb695('0x30')][_0xb695('0x34')]));_0x520b4c['attributes']=_0x520b4c[_0xb695('0x35')]['length']?_0x520b4c[_0xb695('0x35')]:_0x47661a[_0xb695('0x2f')];if(!_0x4ee6e2['query'][_0xb695('0x36')](_0xb695('0x37'))){_0x520b4c['limit']=qs[_0xb695('0x21')](_0x4ee6e2[_0xb695('0x30')][_0xb695('0x21')]);_0x520b4c[_0xb695('0x1f')]=qs['offset'](_0x4ee6e2[_0xb695('0x30')][_0xb695('0x1f')]);}_0x520b4c[_0xb695('0x38')]=qs[_0xb695('0x39')](_0x4ee6e2[_0xb695('0x30')]['sort']);_0x520b4c['where']=qs[_0xb695('0x32')](_[_0xb695('0x3a')](_0x4ee6e2[_0xb695('0x30')],_0x47661a[_0xb695('0x32')]),_0x205b78);if(_0x4ee6e2[_0xb695('0x30')][_0xb695('0x3b')]){_0x520b4c['where']=_[_0xb695('0x3c')](_0x520b4c['where'],{'$or':_['map'](_0x205b78,function(_0x127f45){if(_0x127f45[_0xb695('0x3d')]!=='VIRTUAL'){var _0x2ab6b4={};_0x2ab6b4[_0x127f45[_0xb695('0x28')]]={'$like':'%'+_0x4ee6e2[_0xb695('0x30')][_0xb695('0x3b')]+'%'};return _0x2ab6b4;}})});}_0x520b4c=_['merge']({},_0x520b4c,_0x4ee6e2['options']);var _0x43ca68={'where':_0x520b4c[_0xb695('0x3e')]};return db[_0xb695('0x2c')]['count'](_0x43ca68)['then'](function(_0x127518){_0x5a8cdc[_0xb695('0x22')]=_0x127518;if(_0x4ee6e2[_0xb695('0x30')][_0xb695('0x3f')]){_0x520b4c[_0xb695('0x40')]=[{'all':!![]}];}return db[_0xb695('0x2c')]['findAll'](_0x520b4c);})[_0xb695('0x27')](function(_0x1bd4c1){_0x5a8cdc['rows']=_0x1bd4c1;return _0x5a8cdc;})[_0xb695('0x27')](respondWithFilteredResult(_0x10fecd,_0x520b4c))[_0xb695('0x41')](handleError(_0x10fecd,null));};exports['show']=function(_0x3d54d2,_0x5b32d9){var _0x4e0483={'raw':![],'where':{'id':_0x3d54d2['params']['id']}},_0x589efc={};_0x589efc['model']=_['keys'](db['IntegrationReport'][_0xb695('0x2d')]);_0x589efc['query']=_[_0xb695('0x31')](_0x3d54d2[_0xb695('0x30')]);_0x589efc[_0xb695('0x32')]=_[_0xb695('0x33')](_0x589efc[_0xb695('0x2f')],_0x589efc[_0xb695('0x30')]);_0x4e0483['attributes']=_[_0xb695('0x33')](_0x589efc[_0xb695('0x2f')],qs[_0xb695('0x34')](_0x3d54d2[_0xb695('0x30')][_0xb695('0x34')]));_0x4e0483[_0xb695('0x35')]=_0x4e0483['attributes']['length']?_0x4e0483[_0xb695('0x35')]:_0x589efc['model'];if(_0x3d54d2[_0xb695('0x30')][_0xb695('0x3f')]){_0x4e0483[_0xb695('0x40')]=[{'all':!![]}];}_0x4e0483=_[_0xb695('0x3c')]({},_0x4e0483,_0x3d54d2[_0xb695('0x42')]);return db[_0xb695('0x2c')]['find'](_0x4e0483)[_0xb695('0x27')](handleEntityNotFound(_0x5b32d9,null))[_0xb695('0x27')](respondWithResult(_0x5b32d9,null))['catch'](handleError(_0x5b32d9,null));};exports[_0xb695('0x43')]=function(_0x50490b,_0x2943fc){return db[_0xb695('0x2c')][_0xb695('0x43')](_0x50490b['body'],{})[_0xb695('0x27')](respondWithResult(_0x2943fc,0xc9))[_0xb695('0x41')](handleError(_0x2943fc,null));};exports['update']=function(_0x1b729d,_0x125a76){if(_0x1b729d[_0xb695('0x44')]['id']){delete _0x1b729d['body']['id'];}return db[_0xb695('0x2c')]['find']({'where':{'id':_0x1b729d[_0xb695('0x45')]['id']}})[_0xb695('0x27')](handleEntityNotFound(_0x125a76,null))[_0xb695('0x27')](saveUpdates(_0x1b729d[_0xb695('0x44')],null))[_0xb695('0x27')](respondWithResult(_0x125a76,null))[_0xb695('0x41')](handleError(_0x125a76,null));};exports[_0xb695('0x46')]=function(_0x2bb0a3,_0x12f0f4){return db[_0xb695('0x2c')][_0xb695('0x47')]({'where':{'id':_0x2bb0a3['params']['id']}})[_0xb695('0x27')](handleEntityNotFound(_0x12f0f4,null))['then'](removeEntity(_0x12f0f4,null))['catch'](handleError(_0x12f0f4,null));};exports[_0xb695('0x48')]=function(_0x4a1760,_0x4deda0){return db[_0xb695('0x2c')][_0xb695('0x48')]()[_0xb695('0x27')](respondWithResult(_0x4deda0,null))['catch'](handleError(_0x4deda0,null));};
\ No newline at end of file
index b834017..3a1ad54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc94=['exports','define','IntegrationReport','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1b308f,_0x480c71){var _0x4ff955=function(_0x5866a8){while(--_0x5866a8){_0x1b308f['push'](_0x1b308f['shift']());}};_0x4ff955(++_0x480c71);}(_0xbc94,0x92));var _0x4bc9=function(_0x3eb969,_0x11c187){_0x3eb969=_0x3eb969-0x0;var _0x5e62e0=_0xbc94[_0x3eb969];return _0x5e62e0;};'use strict';var _=require(_0x4bc9('0x0'));var util=require(_0x4bc9('0x1'));var logger=require(_0x4bc9('0x2'))('api');var moment=require(_0x4bc9('0x3'));var BPromise=require(_0x4bc9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4bc9('0x5'));var rimraf=require(_0x4bc9('0x6'));var config=require(_0x4bc9('0x7'));var attributes=require('./integrationReport.attributes');module[_0x4bc9('0x8')]=function(_0x223d46,_0x48a95d){return _0x223d46[_0x4bc9('0x9')](_0x4bc9('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc040=['report_integration','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./integrationReport.attributes','exports','define','IntegrationReport'];(function(_0x40e8ba,_0x28346f){var _0x1d7a51=function(_0x251b47){while(--_0x251b47){_0x40e8ba['push'](_0x40e8ba['shift']());}};_0x1d7a51(++_0x28346f);}(_0xc040,0x18d));var _0x0c04=function(_0x30d6ab,_0x1ae71b){_0x30d6ab=_0x30d6ab-0x0;var _0x363ce3=_0xc040[_0x30d6ab];return _0x363ce3;};'use strict';var _=require('lodash');var util=require(_0x0c04('0x0'));var logger=require(_0x0c04('0x1'))('api');var moment=require(_0x0c04('0x2'));var BPromise=require(_0x0c04('0x3'));var rp=require(_0x0c04('0x4'));var fs=require('fs');var path=require(_0x0c04('0x5'));var rimraf=require(_0x0c04('0x6'));var config=require('../../config/environment');var attributes=require(_0x0c04('0x7'));module[_0x0c04('0x8')]=function(_0x14214d,_0x2c85fc){return _0x14214d[_0x0c04('0x9')](_0x0c04('0xa'),attributes,{'tableName':_0x0c04('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d11cdb7..487712e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['client','http','request','info','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','IntegrationReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x190987,_0x418c32){var _0x1f56de=function(_0x3f2c3b){while(--_0x3f2c3b){_0x190987['push'](_0x190987['shift']());}};_0x1f56de(++_0x418c32);}(_0x57ca,0x108));var _0xa57c=function(_0x453363,_0x3ecdec){_0x453363=_0x453363-0x0;var _0x504801=_0x57ca[_0x453363];return _0x504801;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});}
\ No newline at end of file
+var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x53f0db,_0x35c67c){var _0xae0a5c=function(_0x4bd6fb){while(--_0x4bd6fb){_0x53f0db['push'](_0x53f0db['shift']());}};_0xae0a5c(++_0x35c67c);}(_0xf494,0x1c6));var _0x4f49=function(_0x241237,_0xaaabec){_0x241237=_0x241237-0x0;var _0x1bc339=_0xf494[_0x241237];return _0x1bc339;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
index 76bfaaa..ea84fe5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe49a=['getIntervals','post','/:id/sub_intervals/create_many','addIntervals','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals'];(function(_0x5d67c9,_0x490136){var _0x380961=function(_0x33ca11){while(--_0x33ca11){_0x5d67c9['push'](_0x5d67c9['shift']());}};_0x380961(++_0x490136);}(_0xe49a,0xd7));var _0xae49=function(_0x30510a,_0x165b88){_0x30510a=_0x30510a-0x0;var _0x1c0f31=_0xe49a[_0x30510a];return _0x1c0f31;};'use strict';var multer=require('multer');var util=require(_0xae49('0x0'));var path=require(_0xae49('0x1'));var timeout=require(_0xae49('0x2'));var express=require(_0xae49('0x3'));var router=express[_0xae49('0x4')]();var fs_extra=require(_0xae49('0x5'));var auth=require(_0xae49('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xae49('0x7'));var controller=require(_0xae49('0x8'));router[_0xae49('0x9')]('/',auth['isAuthenticated'](),controller[_0xae49('0xa')]);router['get'](_0xae49('0xb'),auth[_0xae49('0xc')](),controller[_0xae49('0xd')]);router[_0xae49('0x9')](_0xae49('0xe'),auth[_0xae49('0xc')](),controller[_0xae49('0xf')]);router['post']('/',auth[_0xae49('0xc')](),controller['create']);router[_0xae49('0x10')](_0xae49('0xe'),auth[_0xae49('0xc')](),controller['addInterval']);router[_0xae49('0x10')](_0xae49('0x11'),auth[_0xae49('0xc')](),controller[_0xae49('0x12')]);router[_0xae49('0x13')](_0xae49('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xae49('0x14')](_0xae49('0xb'),auth[_0xae49('0xc')](),controller[_0xae49('0x15')]);module[_0xae49('0x16')]=router;
\ No newline at end of file
+var _0xc55e=['/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated','index','get','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals'];(function(_0x2df4c1,_0xac2011){var _0x41b102=function(_0x23d27c){while(--_0x23d27c){_0x2df4c1['push'](_0x2df4c1['shift']());}};_0x41b102(++_0xac2011);}(_0xc55e,0x146));var _0xec55=function(_0x58c0cd,_0xc6eb4e){_0x58c0cd=_0x58c0cd-0x0;var _0x143d33=_0xc55e[_0x58c0cd];return _0x143d33;};'use strict';var multer=require(_0xec55('0x0'));var util=require(_0xec55('0x1'));var path=require(_0xec55('0x2'));var timeout=require(_0xec55('0x3'));var express=require(_0xec55('0x4'));var router=express['Router']();var fs_extra=require(_0xec55('0x5'));var auth=require(_0xec55('0x6'));var interaction=require(_0xec55('0x7'));var config=require(_0xec55('0x8'));var controller=require(_0xec55('0x9'));router['get']('/',auth[_0xec55('0xa')](),controller[_0xec55('0xb')]);router[_0xec55('0xc')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xec55('0xc')](_0xec55('0xd'),auth[_0xec55('0xa')](),controller[_0xec55('0xe')]);router[_0xec55('0xf')]('/',auth['isAuthenticated'](),controller[_0xec55('0x10')]);router[_0xec55('0xf')](_0xec55('0xd'),auth['isAuthenticated'](),controller['addInterval']);router['post'](_0xec55('0x11'),auth[_0xec55('0xa')](),controller[_0xec55('0x12')]);router['put'](_0xec55('0x13'),auth[_0xec55('0xa')](),controller[_0xec55('0x14')]);router[_0xec55('0x15')]('/:id',auth[_0xec55('0xa')](),controller['destroy']);module[_0xec55('0x16')]=router;
\ No newline at end of file
index f00f8a3..11f4069 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c17=['STRING','sequelize'];(function(_0x519f09,_0x450d45){var _0x14a4e3=function(_0x4d7197){while(--_0x4d7197){_0x519f09['push'](_0x519f09['shift']());}};_0x14a4e3(++_0x450d45);}(_0x4c17,0x13d));var _0x74c1=function(_0x215c23,_0x1165bc){_0x215c23=_0x215c23-0x0;var _0x5e3914=_0x4c17[_0x215c23];return _0x5e3914;};'use strict';var Sequelize=require(_0x74c1('0x0'));module['exports']={'name':{'type':Sequelize[_0x74c1('0x1')]},'description':{'type':Sequelize[_0x74c1('0x1')]},'interval':{'type':Sequelize[_0x74c1('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0xfc1e=['STRING','sequelize'];(function(_0x5efbc3,_0x196ec6){var _0x7d72ab=function(_0x3f901c){while(--_0x3f901c){_0x5efbc3['push'](_0x5efbc3['shift']());}};_0x7d72ab(++_0x196ec6);}(_0xfc1e,0x1bb));var _0xefc1=function(_0x393d69,_0x3a8c83){_0x393d69=_0x393d69-0x0;var _0x3cee37=_0xfc1e[_0x393d69];return _0x3cee37;};'use strict';var Sequelize=require(_0xefc1('0x0'));module['exports']={'name':{'type':Sequelize[_0xefc1('0x1')]},'description':{'type':Sequelize[_0xefc1('0x1')]},'interval':{'type':Sequelize[_0xefc1('0x1')],'allowNull':!![]}};
\ No newline at end of file
index 13705e3..df04f14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce0c=['count','Content-Range','apply','reject','destroy','then','get','Intervals','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','Interval','includeAll','include','rows','catch','show','params','rawAttributes','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','update','addInterval','IntervalId','getIntervals','findOne','order','pick','addIntervals','sequelize','transaction','findAll','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','status','json','undefined','limit','offset'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xce0c,0xf7));var _0xcce0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xce0c[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xcce0('0x0'));var rimraf=require(_0xcce0('0x1'));var zipdir=require(_0xcce0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcce0('0x3'));var moment=require(_0xcce0('0x4'));var BPromise=require(_0xcce0('0x5'));var Mustache=require('mustache');var util=require(_0xcce0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xcce0('0x7'));var ejs=require(_0xcce0('0x8'));var fs=require('fs');var fs_extra=require(_0xcce0('0x9'));var _=require('lodash');var squel=require(_0xcce0('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcce0('0xb'));var toCsv=require(_0xcce0('0x7'));var querystring=require('querystring');var Papa=require(_0xcce0('0xc'));var Redis=require('ioredis');var authService=require(_0xcce0('0xd'));var qs=require(_0xcce0('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcce0('0xf'));var logger=require('../../config/logger')(_0xcce0('0x10'));var utils=require(_0xcce0('0x11'));var config=require(_0xcce0('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xcce0('0x13'))['db'];var extensions=require(_0xcce0('0x14'));function respondWithStatusCode(_0x47e595,_0x43b605){_0x43b605=_0x43b605||0xcc;return function(_0x2ee4c6){if(_0x2ee4c6){return _0x47e595['sendStatus'](_0x43b605);}return _0x47e595[_0xcce0('0x15')](_0x43b605)['end']();};}function respondWithResult(_0x2d2356,_0x15b0d0){_0x15b0d0=_0x15b0d0||0xc8;return function(_0xb5076a){if(_0xb5076a){return _0x2d2356[_0xcce0('0x15')](_0x15b0d0)[_0xcce0('0x16')](_0xb5076a);}};}function respondWithFilteredResult(_0x3a5d8d,_0x263b04){return function(_0x548b3f){if(_0x548b3f){var _0x5df0af=typeof _0x263b04['offset']===_0xcce0('0x17')&&typeof _0x263b04[_0xcce0('0x18')]===_0xcce0('0x17');var _0x4fee22=_0x548b3f['count'];var _0x304f6e=_0x5df0af?0x0:_0x263b04[_0xcce0('0x19')];var _0x4b4f75=_0x5df0af?_0x548b3f[_0xcce0('0x1a')]:_0x263b04['offset']+_0x263b04[_0xcce0('0x18')];var _0x522d33;if(_0x4b4f75>=_0x4fee22){_0x4b4f75=_0x4fee22;_0x522d33=0xc8;}else{_0x522d33=0xce;}_0x3a5d8d['status'](_0x522d33);return _0x3a5d8d['set'](_0xcce0('0x1b'),_0x304f6e+'-'+_0x4b4f75+'/'+_0x4fee22)['json'](_0x548b3f);}return null;};}function patchUpdates(_0x2f8ec4){return function(_0x1a8acd){try{jsonpatch[_0xcce0('0x1c')](_0x1a8acd,_0x2f8ec4,!![]);}catch(_0xbeabbd){return BPromise[_0xcce0('0x1d')](_0xbeabbd);}return _0x1a8acd['save']();};}function saveUpdates(_0x32f0dd,_0x55e4bc){return function(_0x3ad172){if(_0x3ad172){return _0x3ad172['update'](_0x32f0dd)['then'](function(_0x5202d4){return _0x5202d4;});}return null;};}function removeEntity(_0x15ec15,_0x2a21b4){return function(_0x1bb2cc){if(_0x1bb2cc){return _0x1bb2cc[_0xcce0('0x1e')]()[_0xcce0('0x1f')](function(){var _0x3ae9fd=_0x1bb2cc[_0xcce0('0x20')]({'plain':!![]});var _0xe8ac89=_0xcce0('0x21');return db[_0xcce0('0x22')][_0xcce0('0x1e')]({'where':{'type':_0xe8ac89,'resourceId':_0x3ae9fd['id']}})[_0xcce0('0x1f')](function(){return _0x1bb2cc;});})[_0xcce0('0x1f')](function(){_0x15ec15[_0xcce0('0x15')](0xcc)[_0xcce0('0x23')]();});}};}function handleEntityNotFound(_0x155462,_0x2907a2){return function(_0x592253){if(!_0x592253){_0x155462[_0xcce0('0x24')](0x194);}return _0x592253;};}function handleError(_0x24020d,_0x16b29b){_0x16b29b=_0x16b29b||0x1f4;return function(_0x340c12){logger[_0xcce0('0x25')](_0x340c12[_0xcce0('0x26')]);if(_0x340c12['name']){delete _0x340c12[_0xcce0('0x27')];}_0x24020d[_0xcce0('0x15')](_0x16b29b)[_0xcce0('0x28')](_0x340c12);};}exports[_0xcce0('0x29')]=function(_0x49a6ec,_0x4d5510){var _0x1af242={},_0x10aebc={},_0x59587e={'count':0x0,'rows':[]};var _0x122ff4=_[_0xcce0('0x2a')](db['Interval']['rawAttributes'],function(_0x5a62a0){return{'name':_0x5a62a0[_0xcce0('0x2b')],'type':_0x5a62a0[_0xcce0('0x2c')][_0xcce0('0x2d')]};});_0x10aebc[_0xcce0('0x2e')]=_['map'](_0x122ff4,_0xcce0('0x27'));_0x10aebc[_0xcce0('0x2f')]=_[_0xcce0('0x30')](_0x49a6ec[_0xcce0('0x2f')]);_0x10aebc['filters']=_[_0xcce0('0x31')](_0x10aebc['model'],_0x10aebc[_0xcce0('0x2f')]);_0x1af242['attributes']=_[_0xcce0('0x31')](_0x10aebc['model'],qs[_0xcce0('0x32')](_0x49a6ec['query']['fields']));_0x1af242[_0xcce0('0x33')]=_0x1af242['attributes'][_0xcce0('0x34')]?_0x1af242[_0xcce0('0x33')]:_0x10aebc[_0xcce0('0x2e')];if(!_0x49a6ec[_0xcce0('0x2f')][_0xcce0('0x35')](_0xcce0('0x36'))){_0x1af242[_0xcce0('0x18')]=qs[_0xcce0('0x18')](_0x49a6ec['query'][_0xcce0('0x18')]);_0x1af242[_0xcce0('0x19')]=qs[_0xcce0('0x19')](_0x49a6ec[_0xcce0('0x2f')]['offset']);}_0x1af242['order']=qs[_0xcce0('0x37')](_0x49a6ec[_0xcce0('0x2f')][_0xcce0('0x37')]);_0x1af242[_0xcce0('0x38')]=qs[_0xcce0('0x39')](_['pick'](_0x49a6ec[_0xcce0('0x2f')],_0x10aebc[_0xcce0('0x39')]),_0x122ff4);if(_0x49a6ec[_0xcce0('0x2f')][_0xcce0('0x3a')]){_0x1af242[_0xcce0('0x38')]=_[_0xcce0('0x3b')](_0x1af242[_0xcce0('0x38')],{'$or':_[_0xcce0('0x2a')](_0x122ff4,function(_0x16c92c){if(_0x16c92c[_0xcce0('0x2c')]!==_0xcce0('0x3c')){var _0x221cea={};_0x221cea[_0x16c92c[_0xcce0('0x27')]]={'$like':'%'+_0x49a6ec[_0xcce0('0x2f')][_0xcce0('0x3a')]+'%'};return _0x221cea;}})});}_0x1af242=_[_0xcce0('0x3b')]({},_0x1af242,_0x49a6ec[_0xcce0('0x3d')]);var _0x2cb901={'where':_0x1af242['where']};return db[_0xcce0('0x3e')]['count'](_0x2cb901)[_0xcce0('0x1f')](function(_0x287f4b){_0x59587e['count']=_0x287f4b;if(_0x49a6ec[_0xcce0('0x2f')][_0xcce0('0x3f')]){_0x1af242[_0xcce0('0x40')]=[{'all':!![]}];}return db[_0xcce0('0x3e')]['findAll'](_0x1af242);})[_0xcce0('0x1f')](function(_0x36673e){_0x59587e[_0xcce0('0x41')]=_0x36673e;return _0x59587e;})[_0xcce0('0x1f')](respondWithFilteredResult(_0x4d5510,_0x1af242))[_0xcce0('0x42')](handleError(_0x4d5510,null));};exports[_0xcce0('0x43')]=function(_0xcf077,_0xfe80f4){var _0x505272={'raw':!![],'where':{'id':_0xcf077[_0xcce0('0x44')]['id']}},_0x2cc9bf={};_0x2cc9bf[_0xcce0('0x2e')]=_[_0xcce0('0x30')](db[_0xcce0('0x3e')][_0xcce0('0x45')]);_0x2cc9bf['query']=_[_0xcce0('0x30')](_0xcf077[_0xcce0('0x2f')]);_0x2cc9bf[_0xcce0('0x39')]=_[_0xcce0('0x31')](_0x2cc9bf[_0xcce0('0x2e')],_0x2cc9bf['query']);_0x505272[_0xcce0('0x33')]=_[_0xcce0('0x31')](_0x2cc9bf[_0xcce0('0x2e')],qs['fields'](_0xcf077[_0xcce0('0x2f')][_0xcce0('0x32')]));_0x505272[_0xcce0('0x33')]=_0x505272[_0xcce0('0x33')][_0xcce0('0x34')]?_0x505272[_0xcce0('0x33')]:_0x2cc9bf[_0xcce0('0x2e')];if(_0xcf077[_0xcce0('0x2f')][_0xcce0('0x3f')]){_0x505272[_0xcce0('0x40')]=[{'all':!![]}];}_0x505272=_[_0xcce0('0x3b')]({},_0x505272,_0xcf077[_0xcce0('0x3d')]);return db['Interval'][_0xcce0('0x46')](_0x505272)[_0xcce0('0x1f')](handleEntityNotFound(_0xfe80f4,null))[_0xcce0('0x1f')](respondWithResult(_0xfe80f4,null))[_0xcce0('0x42')](handleError(_0xfe80f4,null));};exports['create']=function(_0x332cf2,_0x1db34e){return db[_0xcce0('0x3e')][_0xcce0('0x47')](_0x332cf2[_0xcce0('0x48')],{})['then'](function(_0x5d995d){var _0xaeb37e=_0x332cf2[_0xcce0('0x49')][_0xcce0('0x20')]({'plain':!![]});if(!_0xaeb37e)throw new Error(_0xcce0('0x4a'));if(_0xaeb37e[_0xcce0('0x4b')]===_0xcce0('0x49')){var _0x2c2963=_0x5d995d[_0xcce0('0x20')]({'plain':!![]});var _0x2b04c7=_0xcce0('0x21');return db[_0xcce0('0x4c')][_0xcce0('0x46')]({'where':{'name':_0x2b04c7,'userProfileId':_0xaeb37e[_0xcce0('0x4d')]},'raw':!![]})['then'](function(_0x5a6778){if(_0x5a6778&&_0x5a6778[_0xcce0('0x4e')]===0x0){return db[_0xcce0('0x22')][_0xcce0('0x47')]({'name':_0x2c2963[_0xcce0('0x27')],'resourceId':_0x2c2963['id'],'type':_0x5a6778['name'],'sectionId':_0x5a6778['id']},{})[_0xcce0('0x1f')](function(){return _0x5d995d;});}else{return _0x5d995d;}})[_0xcce0('0x42')](function(_0xa6a367){logger[_0xcce0('0x25')](_0xcce0('0x4f'),_0xa6a367);throw _0xa6a367;});}return _0x5d995d;})['then'](respondWithResult(_0x1db34e,0xc9))['catch'](handleError(_0x1db34e,null));};exports[_0xcce0('0x50')]=function(_0x2f20a7,_0x130335){if(_0x2f20a7[_0xcce0('0x48')]['id']){delete _0x2f20a7[_0xcce0('0x48')]['id'];}return db['Interval'][_0xcce0('0x46')]({'where':{'id':_0x2f20a7[_0xcce0('0x44')]['id']}})[_0xcce0('0x1f')](handleEntityNotFound(_0x130335,null))[_0xcce0('0x1f')](saveUpdates(_0x2f20a7[_0xcce0('0x48')],null))[_0xcce0('0x1f')](respondWithResult(_0x130335,null))['catch'](handleError(_0x130335,null));};exports['destroy']=function(_0x3ed498,_0x400954){return db[_0xcce0('0x3e')][_0xcce0('0x46')]({'where':{'id':_0x3ed498['params']['id']}})[_0xcce0('0x1f')](handleEntityNotFound(_0x400954,null))['then'](removeEntity(_0x400954,null))[_0xcce0('0x42')](handleError(_0x400954,null));};exports[_0xcce0('0x51')]=function(_0x150716,_0x250124,_0x377ed8){if(_0x150716['body']['id']){delete _0x150716['body']['id'];}return db[_0xcce0('0x3e')]['find']({'where':{'id':_0x150716[_0xcce0('0x44')]['id']}})[_0xcce0('0x1f')](handleEntityNotFound(_0x250124,null))[_0xcce0('0x1f')](function(_0x57a938){if(_0x57a938){_0x150716['body'][_0xcce0('0x52')]=_0x57a938['id'];return db[_0xcce0('0x3e')][_0xcce0('0x47')](_0x150716[_0xcce0('0x48')]);}})[_0xcce0('0x1f')](respondWithResult(_0x250124,null))[_0xcce0('0x42')](handleError(_0x250124,null));};exports[_0xcce0('0x53')]=function(_0x2f94a4,_0x43f937,_0x1e1c4e){var _0x1bcff8={};var _0x535be9={};var _0x4e9bae;var _0x1ea1f2;return db[_0xcce0('0x3e')][_0xcce0('0x54')]({'where':{'id':_0x2f94a4[_0xcce0('0x44')]['id']}})['then'](handleEntityNotFound(_0x43f937,null))[_0xcce0('0x1f')](function(_0x212df5){if(_0x212df5){_0x4e9bae=_0x212df5;_0x535be9[_0xcce0('0x2e')]=_[_0xcce0('0x30')](db[_0xcce0('0x3e')][_0xcce0('0x45')]);_0x535be9['query']=_[_0xcce0('0x30')](_0x2f94a4[_0xcce0('0x2f')]);_0x535be9[_0xcce0('0x39')]=_[_0xcce0('0x31')](_0x535be9[_0xcce0('0x2e')],_0x535be9[_0xcce0('0x2f')]);_0x1bcff8[_0xcce0('0x33')]=_[_0xcce0('0x31')](_0x535be9[_0xcce0('0x2e')],qs[_0xcce0('0x32')](_0x2f94a4['query'][_0xcce0('0x32')]));_0x1bcff8[_0xcce0('0x33')]=_0x1bcff8[_0xcce0('0x33')][_0xcce0('0x34')]?_0x1bcff8['attributes']:_0x535be9[_0xcce0('0x2e')];_0x1bcff8[_0xcce0('0x55')]=qs[_0xcce0('0x37')](_0x2f94a4[_0xcce0('0x2f')]['sort']);_0x1bcff8[_0xcce0('0x38')]=qs[_0xcce0('0x39')](_[_0xcce0('0x56')](_0x2f94a4[_0xcce0('0x2f')],_0x535be9['filters']));if(_0x2f94a4[_0xcce0('0x2f')][_0xcce0('0x3a')]){_0x1bcff8[_0xcce0('0x38')]=_[_0xcce0('0x3b')](_0x1bcff8['where'],{'$or':_[_0xcce0('0x2a')](_0x1bcff8[_0xcce0('0x33')],function(_0x5bd6ce){var _0x1b5cdf={};_0x1b5cdf[_0x5bd6ce]={'$like':'%'+_0x2f94a4[_0xcce0('0x2f')][_0xcce0('0x3a')]+'%'};return _0x1b5cdf;})});}_0x1bcff8=_['merge']({},_0x1bcff8,_0x2f94a4[_0xcce0('0x3d')]);return _0x4e9bae[_0xcce0('0x53')](_0x1bcff8);}})[_0xcce0('0x1f')](function(_0x4f2e85){if(_0x4f2e85){_0x1ea1f2=_0x4f2e85[_0xcce0('0x34')];if(!_0x2f94a4[_0xcce0('0x2f')][_0xcce0('0x35')](_0xcce0('0x36'))){_0x1bcff8[_0xcce0('0x18')]=qs['limit'](_0x2f94a4[_0xcce0('0x2f')][_0xcce0('0x18')]);_0x1bcff8[_0xcce0('0x19')]=qs[_0xcce0('0x19')](_0x2f94a4[_0xcce0('0x2f')][_0xcce0('0x19')]);}return _0x4e9bae[_0xcce0('0x53')](_0x1bcff8);}})[_0xcce0('0x1f')](function(_0x5af07a){if(_0x5af07a){return _0x5af07a?{'count':_0x1ea1f2,'rows':_0x5af07a}:null;}})[_0xcce0('0x1f')](respondWithResult(_0x43f937,null))['catch'](handleError(_0x43f937,null));};exports[_0xcce0('0x57')]=function(_0x596f01,_0x439262,_0x3097c8){return db[_0xcce0('0x3e')][_0xcce0('0x54')]({'where':{'id':_0x596f01['params']['id']}})['then'](handleEntityNotFound(_0x439262,null))[_0xcce0('0x1f')](function(_0x27dad9){if(_0x27dad9){return db[_0xcce0('0x58')][_0xcce0('0x59')](function(_0x1c883a){return db[_0xcce0('0x3e')][_0xcce0('0x1e')]({'where':{'IntervalId':_0x596f01['params']['id']},'transaction':_0x1c883a})[_0xcce0('0x1f')](function(_0x498672){var _0x3ac278=_['map'](_0x596f01['body'],function(_0xd7648c){delete _0xd7648c['id'];_0xd7648c['IntervalId']=_0x596f01[_0xcce0('0x44')]['id'];return _0xd7648c;});return db[_0xcce0('0x3e')]['bulkCreate'](_0x3ac278,{'transaction':_0x1c883a});});})[_0xcce0('0x1f')](function(){return db[_0xcce0('0x3e')][_0xcce0('0x5a')]({'where':{'IntervalId':_0x596f01['params']['id']}});});}})['then'](respondWithResult(_0x439262,null))['catch'](handleError(_0x439262,null));};
\ No newline at end of file
+var _0xeebc=['then','get','Intervals','stack','name','send','map','Interval','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','find','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','addInterval','getIntervals','findOne','addIntervals','sequelize','transaction','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xeebc,0x93));var _0xceeb=function(_0x4b5f72,_0x3109fa){_0x4b5f72=_0x4b5f72-0x0;var _0x4a1a34=_0xeebc[_0x4b5f72];return _0x4a1a34;};'use strict';var emlformat=require(_0xceeb('0x0'));var rimraf=require(_0xceeb('0x1'));var zipdir=require(_0xceeb('0x2'));var jsonpatch=require(_0xceeb('0x3'));var rp=require(_0xceeb('0x4'));var moment=require('moment');var BPromise=require(_0xceeb('0x5'));var Mustache=require('mustache');var util=require(_0xceeb('0x6'));var path=require(_0xceeb('0x7'));var sox=require(_0xceeb('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xceeb('0x9'));var _=require(_0xceeb('0xa'));var squel=require('squel');var crypto=require(_0xceeb('0xb'));var jsforce=require(_0xceeb('0xc'));var deskjs=require(_0xceeb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xceeb('0xe'));var Papa=require('papaparse');var Redis=require(_0xceeb('0xf'));var authService=require(_0xceeb('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xceeb('0x11'));var logger=require(_0xceeb('0x12'))(_0xceeb('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xceeb('0x14'));var db=require('../../mysqldb')['db'];var extensions=require(_0xceeb('0x15'));function respondWithStatusCode(_0x40ad7d,_0x426ef7){_0x426ef7=_0x426ef7||0xcc;return function(_0x23bbeb){if(_0x23bbeb){return _0x40ad7d[_0xceeb('0x16')](_0x426ef7);}return _0x40ad7d[_0xceeb('0x17')](_0x426ef7)[_0xceeb('0x18')]();};}function respondWithResult(_0x116f22,_0x1e457d){_0x1e457d=_0x1e457d||0xc8;return function(_0x2b7597){if(_0x2b7597){return _0x116f22[_0xceeb('0x17')](_0x1e457d)[_0xceeb('0x19')](_0x2b7597);}};}function respondWithFilteredResult(_0x334a51,_0x1ea256){return function(_0x25cc8d){if(_0x25cc8d){var _0x472d1d=typeof _0x1ea256[_0xceeb('0x1a')]===_0xceeb('0x1b')&&typeof _0x1ea256[_0xceeb('0x1c')]===_0xceeb('0x1b');var _0x507736=_0x25cc8d[_0xceeb('0x1d')];var _0x1ff710=_0x472d1d?0x0:_0x1ea256[_0xceeb('0x1a')];var _0xfd6b96=_0x472d1d?_0x25cc8d[_0xceeb('0x1d')]:_0x1ea256[_0xceeb('0x1a')]+_0x1ea256[_0xceeb('0x1c')];var _0x5e61a6;if(_0xfd6b96>=_0x507736){_0xfd6b96=_0x507736;_0x5e61a6=0xc8;}else{_0x5e61a6=0xce;}_0x334a51[_0xceeb('0x17')](_0x5e61a6);return _0x334a51[_0xceeb('0x1e')]('Content-Range',_0x1ff710+'-'+_0xfd6b96+'/'+_0x507736)[_0xceeb('0x19')](_0x25cc8d);}return null;};}function patchUpdates(_0x32a42c){return function(_0x2beb9a){try{jsonpatch['apply'](_0x2beb9a,_0x32a42c,!![]);}catch(_0x4cacc1){return BPromise[_0xceeb('0x1f')](_0x4cacc1);}return _0x2beb9a[_0xceeb('0x20')]();};}function saveUpdates(_0x5e38a0,_0x341910){return function(_0x4471ee){if(_0x4471ee){return _0x4471ee[_0xceeb('0x21')](_0x5e38a0)['then'](function(_0x88aa73){return _0x88aa73;});}return null;};}function removeEntity(_0x189eb5,_0x379b3b){return function(_0x1fdacb){if(_0x1fdacb){return _0x1fdacb[_0xceeb('0x22')]()[_0xceeb('0x23')](function(){var _0x57bff6=_0x1fdacb[_0xceeb('0x24')]({'plain':!![]});var _0x34e3c2=_0xceeb('0x25');return db['UserProfileResource'][_0xceeb('0x22')]({'where':{'type':_0x34e3c2,'resourceId':_0x57bff6['id']}})['then'](function(){return _0x1fdacb;});})[_0xceeb('0x23')](function(){_0x189eb5['status'](0xcc)[_0xceeb('0x18')]();});}};}function handleEntityNotFound(_0x79dcc0,_0x38d024){return function(_0x9e5631){if(!_0x9e5631){_0x79dcc0['sendStatus'](0x194);}return _0x9e5631;};}function handleError(_0xc5ea42,_0x3d176b){_0x3d176b=_0x3d176b||0x1f4;return function(_0x1cdf4e){logger['error'](_0x1cdf4e[_0xceeb('0x26')]);if(_0x1cdf4e[_0xceeb('0x27')]){delete _0x1cdf4e[_0xceeb('0x27')];}_0xc5ea42['status'](_0x3d176b)[_0xceeb('0x28')](_0x1cdf4e);};}exports['index']=function(_0x398c6b,_0x569a19){var _0x48f81a={},_0x41737b={},_0x363540={'count':0x0,'rows':[]};var _0x50184b=_[_0xceeb('0x29')](db[_0xceeb('0x2a')]['rawAttributes'],function(_0x9b7acf){return{'name':_0x9b7acf[_0xceeb('0x2b')],'type':_0x9b7acf[_0xceeb('0x2c')][_0xceeb('0x2d')]};});_0x41737b[_0xceeb('0x2e')]=_[_0xceeb('0x29')](_0x50184b,_0xceeb('0x27'));_0x41737b[_0xceeb('0x2f')]=_[_0xceeb('0x30')](_0x398c6b['query']);_0x41737b[_0xceeb('0x31')]=_['intersection'](_0x41737b[_0xceeb('0x2e')],_0x41737b[_0xceeb('0x2f')]);_0x48f81a[_0xceeb('0x32')]=_['intersection'](_0x41737b['model'],qs[_0xceeb('0x33')](_0x398c6b[_0xceeb('0x2f')][_0xceeb('0x33')]));_0x48f81a[_0xceeb('0x32')]=_0x48f81a[_0xceeb('0x32')][_0xceeb('0x34')]?_0x48f81a[_0xceeb('0x32')]:_0x41737b[_0xceeb('0x2e')];if(!_0x398c6b['query'][_0xceeb('0x35')](_0xceeb('0x36'))){_0x48f81a[_0xceeb('0x1c')]=qs[_0xceeb('0x1c')](_0x398c6b[_0xceeb('0x2f')][_0xceeb('0x1c')]);_0x48f81a[_0xceeb('0x1a')]=qs[_0xceeb('0x1a')](_0x398c6b[_0xceeb('0x2f')][_0xceeb('0x1a')]);}_0x48f81a[_0xceeb('0x37')]=qs[_0xceeb('0x38')](_0x398c6b[_0xceeb('0x2f')][_0xceeb('0x38')]);_0x48f81a['where']=qs[_0xceeb('0x31')](_[_0xceeb('0x39')](_0x398c6b[_0xceeb('0x2f')],_0x41737b[_0xceeb('0x31')]),_0x50184b);if(_0x398c6b[_0xceeb('0x2f')][_0xceeb('0x3a')]){_0x48f81a[_0xceeb('0x3b')]=_[_0xceeb('0x3c')](_0x48f81a[_0xceeb('0x3b')],{'$or':_[_0xceeb('0x29')](_0x50184b,function(_0x2ffbbd){if(_0x2ffbbd[_0xceeb('0x2c')]!==_0xceeb('0x3d')){var _0x3555c2={};_0x3555c2[_0x2ffbbd[_0xceeb('0x27')]]={'$like':'%'+_0x398c6b[_0xceeb('0x2f')][_0xceeb('0x3a')]+'%'};return _0x3555c2;}})});}_0x48f81a=_[_0xceeb('0x3c')]({},_0x48f81a,_0x398c6b[_0xceeb('0x3e')]);var _0xe321ff={'where':_0x48f81a['where']};return db[_0xceeb('0x2a')][_0xceeb('0x1d')](_0xe321ff)['then'](function(_0x2e2e4b){_0x363540[_0xceeb('0x1d')]=_0x2e2e4b;if(_0x398c6b[_0xceeb('0x2f')][_0xceeb('0x3f')]){_0x48f81a[_0xceeb('0x40')]=[{'all':!![]}];}return db[_0xceeb('0x2a')][_0xceeb('0x41')](_0x48f81a);})['then'](function(_0xdb3d17){_0x363540[_0xceeb('0x42')]=_0xdb3d17;return _0x363540;})[_0xceeb('0x23')](respondWithFilteredResult(_0x569a19,_0x48f81a))[_0xceeb('0x43')](handleError(_0x569a19,null));};exports[_0xceeb('0x44')]=function(_0x3fbdb1,_0x708447){var _0x411c9a={'raw':!![],'where':{'id':_0x3fbdb1[_0xceeb('0x45')]['id']}},_0x3ead50={};_0x3ead50[_0xceeb('0x2e')]=_['keys'](db['Interval'][_0xceeb('0x46')]);_0x3ead50[_0xceeb('0x2f')]=_[_0xceeb('0x30')](_0x3fbdb1[_0xceeb('0x2f')]);_0x3ead50[_0xceeb('0x31')]=_['intersection'](_0x3ead50['model'],_0x3ead50[_0xceeb('0x2f')]);_0x411c9a[_0xceeb('0x32')]=_[_0xceeb('0x47')](_0x3ead50[_0xceeb('0x2e')],qs[_0xceeb('0x33')](_0x3fbdb1[_0xceeb('0x2f')][_0xceeb('0x33')]));_0x411c9a[_0xceeb('0x32')]=_0x411c9a['attributes']['length']?_0x411c9a[_0xceeb('0x32')]:_0x3ead50['model'];if(_0x3fbdb1[_0xceeb('0x2f')][_0xceeb('0x3f')]){_0x411c9a[_0xceeb('0x40')]=[{'all':!![]}];}_0x411c9a=_[_0xceeb('0x3c')]({},_0x411c9a,_0x3fbdb1[_0xceeb('0x3e')]);return db['Interval'][_0xceeb('0x48')](_0x411c9a)[_0xceeb('0x23')](handleEntityNotFound(_0x708447,null))[_0xceeb('0x23')](respondWithResult(_0x708447,null))[_0xceeb('0x43')](handleError(_0x708447,null));};exports[_0xceeb('0x49')]=function(_0x3b87e5,_0x39c726){return db['Interval'][_0xceeb('0x49')](_0x3b87e5[_0xceeb('0x4a')],{})[_0xceeb('0x23')](function(_0x4eb9ae){var _0x5782d9=_0x3b87e5[_0xceeb('0x4b')][_0xceeb('0x24')]({'plain':!![]});if(!_0x5782d9)throw new Error(_0xceeb('0x4c'));if(_0x5782d9[_0xceeb('0x4d')]===_0xceeb('0x4b')){var _0x4ce2f0=_0x4eb9ae['get']({'plain':!![]});var _0x341fad='Intervals';return db[_0xceeb('0x4e')][_0xceeb('0x48')]({'where':{'name':_0x341fad,'userProfileId':_0x5782d9[_0xceeb('0x4f')]},'raw':!![]})[_0xceeb('0x23')](function(_0x2f7c3b){if(_0x2f7c3b&&_0x2f7c3b[_0xceeb('0x50')]===0x0){return db['UserProfileResource'][_0xceeb('0x49')]({'name':_0x4ce2f0[_0xceeb('0x27')],'resourceId':_0x4ce2f0['id'],'type':_0x2f7c3b['name'],'sectionId':_0x2f7c3b['id']},{})[_0xceeb('0x23')](function(){return _0x4eb9ae;});}else{return _0x4eb9ae;}})['catch'](function(_0xc0172a){logger[_0xceeb('0x51')](_0xceeb('0x52'),_0xc0172a);throw _0xc0172a;});}return _0x4eb9ae;})[_0xceeb('0x23')](respondWithResult(_0x39c726,0xc9))[_0xceeb('0x43')](handleError(_0x39c726,null));};exports[_0xceeb('0x21')]=function(_0x4b5a57,_0x293e57){if(_0x4b5a57[_0xceeb('0x4a')]['id']){delete _0x4b5a57[_0xceeb('0x4a')]['id'];}return db[_0xceeb('0x2a')][_0xceeb('0x48')]({'where':{'id':_0x4b5a57[_0xceeb('0x45')]['id']}})[_0xceeb('0x23')](handleEntityNotFound(_0x293e57,null))[_0xceeb('0x23')](saveUpdates(_0x4b5a57[_0xceeb('0x4a')],null))[_0xceeb('0x23')](respondWithResult(_0x293e57,null))[_0xceeb('0x43')](handleError(_0x293e57,null));};exports[_0xceeb('0x22')]=function(_0x29f5c9,_0x50b14e){return db[_0xceeb('0x2a')][_0xceeb('0x48')]({'where':{'id':_0x29f5c9[_0xceeb('0x45')]['id']}})['then'](handleEntityNotFound(_0x50b14e,null))[_0xceeb('0x23')](removeEntity(_0x50b14e,null))[_0xceeb('0x43')](handleError(_0x50b14e,null));};exports[_0xceeb('0x53')]=function(_0x10c5ed,_0x175177,_0x1c3a27){if(_0x10c5ed[_0xceeb('0x4a')]['id']){delete _0x10c5ed[_0xceeb('0x4a')]['id'];}return db[_0xceeb('0x2a')][_0xceeb('0x48')]({'where':{'id':_0x10c5ed[_0xceeb('0x45')]['id']}})[_0xceeb('0x23')](handleEntityNotFound(_0x175177,null))[_0xceeb('0x23')](function(_0x4ab6f2){if(_0x4ab6f2){_0x10c5ed[_0xceeb('0x4a')]['IntervalId']=_0x4ab6f2['id'];return db['Interval'][_0xceeb('0x49')](_0x10c5ed[_0xceeb('0x4a')]);}})[_0xceeb('0x23')](respondWithResult(_0x175177,null))[_0xceeb('0x43')](handleError(_0x175177,null));};exports[_0xceeb('0x54')]=function(_0x3c869f,_0x5b3cdc,_0x4dcabb){var _0x46d972={};var _0x3305bc={};var _0x412484;var _0x273da0;return db[_0xceeb('0x2a')][_0xceeb('0x55')]({'where':{'id':_0x3c869f[_0xceeb('0x45')]['id']}})[_0xceeb('0x23')](handleEntityNotFound(_0x5b3cdc,null))[_0xceeb('0x23')](function(_0x15a89a){if(_0x15a89a){_0x412484=_0x15a89a;_0x3305bc[_0xceeb('0x2e')]=_[_0xceeb('0x30')](db[_0xceeb('0x2a')]['rawAttributes']);_0x3305bc[_0xceeb('0x2f')]=_[_0xceeb('0x30')](_0x3c869f['query']);_0x3305bc[_0xceeb('0x31')]=_[_0xceeb('0x47')](_0x3305bc[_0xceeb('0x2e')],_0x3305bc[_0xceeb('0x2f')]);_0x46d972['attributes']=_[_0xceeb('0x47')](_0x3305bc[_0xceeb('0x2e')],qs[_0xceeb('0x33')](_0x3c869f['query'][_0xceeb('0x33')]));_0x46d972[_0xceeb('0x32')]=_0x46d972[_0xceeb('0x32')][_0xceeb('0x34')]?_0x46d972['attributes']:_0x3305bc[_0xceeb('0x2e')];_0x46d972[_0xceeb('0x37')]=qs[_0xceeb('0x38')](_0x3c869f[_0xceeb('0x2f')][_0xceeb('0x38')]);_0x46d972[_0xceeb('0x3b')]=qs[_0xceeb('0x31')](_[_0xceeb('0x39')](_0x3c869f[_0xceeb('0x2f')],_0x3305bc[_0xceeb('0x31')]));if(_0x3c869f['query'][_0xceeb('0x3a')]){_0x46d972['where']=_['merge'](_0x46d972['where'],{'$or':_[_0xceeb('0x29')](_0x46d972[_0xceeb('0x32')],function(_0x43ad37){var _0x22626d={};_0x22626d[_0x43ad37]={'$like':'%'+_0x3c869f[_0xceeb('0x2f')][_0xceeb('0x3a')]+'%'};return _0x22626d;})});}_0x46d972=_[_0xceeb('0x3c')]({},_0x46d972,_0x3c869f[_0xceeb('0x3e')]);return _0x412484[_0xceeb('0x54')](_0x46d972);}})[_0xceeb('0x23')](function(_0x25665e){if(_0x25665e){_0x273da0=_0x25665e[_0xceeb('0x34')];if(!_0x3c869f['query']['hasOwnProperty'](_0xceeb('0x36'))){_0x46d972[_0xceeb('0x1c')]=qs['limit'](_0x3c869f[_0xceeb('0x2f')][_0xceeb('0x1c')]);_0x46d972[_0xceeb('0x1a')]=qs[_0xceeb('0x1a')](_0x3c869f[_0xceeb('0x2f')][_0xceeb('0x1a')]);}return _0x412484[_0xceeb('0x54')](_0x46d972);}})[_0xceeb('0x23')](function(_0x14e0a4){if(_0x14e0a4){return _0x14e0a4?{'count':_0x273da0,'rows':_0x14e0a4}:null;}})[_0xceeb('0x23')](respondWithResult(_0x5b3cdc,null))[_0xceeb('0x43')](handleError(_0x5b3cdc,null));};exports[_0xceeb('0x56')]=function(_0x3a0266,_0x5283ac,_0x1b2df7){return db[_0xceeb('0x2a')][_0xceeb('0x55')]({'where':{'id':_0x3a0266[_0xceeb('0x45')]['id']}})[_0xceeb('0x23')](handleEntityNotFound(_0x5283ac,null))[_0xceeb('0x23')](function(_0x4bed46){if(_0x4bed46){return db[_0xceeb('0x57')][_0xceeb('0x58')](function(_0x260e2a){return db[_0xceeb('0x2a')]['destroy']({'where':{'IntervalId':_0x3a0266[_0xceeb('0x45')]['id']},'transaction':_0x260e2a})[_0xceeb('0x23')](function(_0x293ba7){var _0x1f3e14=_[_0xceeb('0x29')](_0x3a0266['body'],function(_0x122029){delete _0x122029['id'];_0x122029[_0xceeb('0x59')]=_0x3a0266[_0xceeb('0x45')]['id'];return _0x122029;});return db[_0xceeb('0x2a')][_0xceeb('0x5a')](_0x1f3e14,{'transaction':_0x260e2a});});})[_0xceeb('0x23')](function(){return db[_0xceeb('0x2a')][_0xceeb('0x41')]({'where':{'IntervalId':_0x3a0266[_0xceeb('0x45')]['id']}});});}})['then'](respondWithResult(_0x5283ac,null))[_0xceeb('0x43')](handleError(_0x5283ac,null));};
\ No newline at end of file
index 378bd10..6aedc86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48fc=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval','tools_intervals','rewrite'];(function(_0x336390,_0x113032){var _0x15b704=function(_0x5ceb6a){while(--_0x5ceb6a){_0x336390['push'](_0x336390['shift']());}};_0x15b704(++_0x113032);}(_0x48fc,0xa8));var _0xc48f=function(_0x33238b,_0x590ace){_0x33238b=_0x33238b-0x0;var _0xb36666=_0x48fc[_0x33238b];return _0xb36666;};'use strict';var _=require(_0xc48f('0x0'));var util=require(_0xc48f('0x1'));var logger=require('../../config/logger')(_0xc48f('0x2'));var moment=require(_0xc48f('0x3'));var BPromise=require(_0xc48f('0x4'));var rp=require(_0xc48f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc48f('0x6'));var config=require(_0xc48f('0x7'));var attributes=require(_0xc48f('0x8'));var extensions=require(_0xc48f('0x9'));module[_0xc48f('0xa')]=function(_0x582cc0,_0x4ff171){return _0x582cc0['define'](_0xc48f('0xb'),attributes,{'tableName':_0xc48f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e0b5c,_0x3d9eab){extensions['rewrite'](_0x582cc0,_0x5e0b5c);},'afterBulkCreate':function(_0x415411,_0x1209a0,_0x157992){_0x157992();extensions[_0xc48f('0xd')](_0x582cc0,_0x415411[0x0]);},'afterUpdate':function(_0x311ad6,_0x3a3458){extensions[_0xc48f('0xd')](_0x582cc0,_0x311ad6);},'afterDestroy':function(_0x4978fd,_0x28ac50){extensions[_0xc48f('0xd')](_0x582cc0,_0x4978fd);}}});};
\ No newline at end of file
+var _0x3953=['Interval','tools_intervals','rewrite','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','exports'];(function(_0x1e8634,_0xbb9909){var _0x158e39=function(_0x3eb93d){while(--_0x3eb93d){_0x1e8634['push'](_0x1e8634['shift']());}};_0x158e39(++_0xbb9909);}(_0x3953,0x16f));var _0x3395=function(_0x519698,_0x2cc594){_0x519698=_0x519698-0x0;var _0x4131da=_0x3953[_0x519698];return _0x4131da;};'use strict';var _=require(_0x3395('0x0'));var util=require(_0x3395('0x1'));var logger=require(_0x3395('0x2'))('api');var moment=require(_0x3395('0x3'));var BPromise=require(_0x3395('0x4'));var rp=require(_0x3395('0x5'));var fs=require('fs');var path=require(_0x3395('0x6'));var rimraf=require(_0x3395('0x7'));var config=require(_0x3395('0x8'));var attributes=require(_0x3395('0x9'));var extensions=require('../../components/extensions/rewrite');module[_0x3395('0xa')]=function(_0x1e859e,_0xe8a70c){return _0x1e859e['define'](_0x3395('0xb'),attributes,{'tableName':_0x3395('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2cdbd4,_0x302037){extensions[_0x3395('0xd')](_0x1e859e,_0x2cdbd4);},'afterBulkCreate':function(_0x46f18b,_0x2cd8d6,_0x1ada28){_0x1ada28();extensions[_0x3395('0xd')](_0x1e859e,_0x46f18b[0x0]);},'afterUpdate':function(_0x4ed8e2,_0x5973b6){extensions[_0x3395('0xd')](_0x1e859e,_0x4ed8e2);},'afterDestroy':function(_0x57d7ef,_0x24c6be){extensions[_0x3395('0xd')](_0x1e859e,_0x57d7ef);}}});};
\ No newline at end of file
index 8f270f2..70b95b7 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(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0xf2f332,_0x299fbf){var _0x56cce3=function(_0x5f37e0){while(--_0x5f37e0){_0xf2f332['push'](_0xf2f332['shift']());}};_0x56cce3(++_0x299fbf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 d3eb015..eed4f83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x3a8992,_0xaeb0f3){var _0x1efedb=function(_0x12ea6e){while(--_0x12ea6e){_0x3a8992['push'](_0x3a8992['shift']());}};_0x1efedb(++_0xaeb0f3);}(_0xdb28,0x106));var _0x8db2=function(_0x24b5e8,_0x57237d){_0x24b5e8=_0x24b5e8-0x0;var _0x30819c=_0xdb28[_0x24b5e8];return _0x30819c;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router;
\ No newline at end of file
+var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x590844,_0x3c71f4){var _0x4d14b1=function(_0x3eb9cc){while(--_0x3eb9cc){_0x590844['push'](_0x590844['shift']());}};_0x4d14b1(++_0x3c71f4);}(_0xadb5,0xad));var _0x5adb=function(_0x82a544,_0x3dfbc8){_0x82a544=_0x82a544-0x0;var _0x4b1170=_0xadb5[_0x82a544];return _0x4b1170;};'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 20cdc58..d020324 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb87=['Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','connection','remoteAddress','socket','bluebird','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','stringify','issuetype','Bug','customfield_11500','email','fields','oldToken','customfield_11502','reason','customfield_10102','track.xcallymotion.com','Basic\x20','toString','base64','request','setEncoding','data','end','statusCode','json','parse','error','status'];(function(_0x99f958,_0x2bf020){var _0x97632d=function(_0x3f0f02){while(--_0x3f0f02){_0x99f958['push'](_0x99f958['shift']());}};_0x97632d(++_0x2bf020);}(_0xdb87,0x87));var _0x7db8=function(_0x458bb9,_0x275a36){_0x458bb9=_0x458bb9-0x0;var _0x5e44d1=_0xdb87[_0x458bb9];return _0x5e44d1;};'use strict';var BPromise=require(_0x7db8('0x0'));var https=require('https');var logger=require(_0x7db8('0x1'))(_0x7db8('0x2'));var USERNAME=_0x7db8('0x3');var PASSWORD=_0x7db8('0x4');function openIssue(_0x562494,_0x1ff632){var _0x4c138f={'fields':{'project':{'key':_0x562494[_0x7db8('0x5')]||_0x7db8('0x6')},'summary':(_0x562494['summary']||_0x7db8('0x7'))+_0x7db8('0x8')+_0x562494['ip'],'description':_0x562494[_0x7db8('0x9')]||JSON[_0x7db8('0xa')](_0x562494),'issuetype':{'name':_0x562494[_0x7db8('0xb')]||_0x7db8('0xc')}}};_0x4c138f['fields'][_0x7db8('0xd')]=_0x562494[_0x7db8('0xe')];_0x4c138f[_0x7db8('0xf')]['customfield_11501']=_0x562494[_0x7db8('0x10')];_0x4c138f[_0x7db8('0xf')][_0x7db8('0x11')]=_0x562494['newToken'];_0x4c138f[_0x7db8('0xf')]['customfield_11503']=_0x562494['name'];_0x4c138f[_0x7db8('0xf')]['customfield_11504']=_0x562494[_0x7db8('0x12')];_0x4c138f['fields'][_0x7db8('0x13')]=_0x562494['ip'];var _0x5cc041={'host':_0x7db8('0x14'),'port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x7db8('0x15')+new Buffer(USERNAME+':'+PASSWORD)[_0x7db8('0x16')](_0x7db8('0x17'))}};var _0x34a443=JSON['stringify'](_0x4c138f);var _0x1f06e8=https[_0x7db8('0x18')](_0x5cc041,function(_0x4fd8e6){_0x4fd8e6[_0x7db8('0x19')]('utf8');var _0x29d66d='';_0x4fd8e6['on'](_0x7db8('0x1a'),function(_0x54f287){_0x29d66d+=_0x54f287;});_0x4fd8e6['on'](_0x7db8('0x1b'),function(){if(_0x1ff632){return _0x1ff632['status'](_0x4fd8e6[_0x7db8('0x1c')])[_0x7db8('0x1d')](JSON[_0x7db8('0x1e')](_0x29d66d));}});});_0x1f06e8['on'](_0x7db8('0x1f'),function(_0x20f979){if(_0x1ff632){return _0x1ff632[_0x7db8('0x20')](0x1f4)[_0x7db8('0x1d')]({'errors':[{'message':_0x7db8('0x21'),'type':_0x7db8('0x22')}]});}});_0x1f06e8[_0x7db8('0x23')](_0x34a443);_0x1f06e8['end']();}exports[_0x7db8('0x24')]=openIssue;exports['send']=function(_0x3adbf7,_0x2d7da6){_0x3adbf7[_0x7db8('0x25')]['ip']=_0x3adbf7[_0x7db8('0x26')]['x-forwarded-for']||_0x3adbf7[_0x7db8('0x27')][_0x7db8('0x28')]||_0x3adbf7[_0x7db8('0x29')][_0x7db8('0x28')]||_0x3adbf7[_0x7db8('0x27')][_0x7db8('0x29')][_0x7db8('0x28')];return openIssue(_0x3adbf7[_0x7db8('0x25')],_0x2d7da6);};
\ No newline at end of file
+var _0x4728=['POST','Basic\x20','stringify','request','utf8','data','end','status','statusCode','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','connection','remoteAddress','socket','bluebird','https','support','key','MOTGUI','Report','\x20from\x20','description','issuetype','Bug','fields','customfield_11500','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue'];(function(_0x56ddfe,_0x1c2fd6){var _0x98dc40=function(_0x43d7e8){while(--_0x43d7e8){_0x56ddfe['push'](_0x56ddfe['shift']());}};_0x98dc40(++_0x1c2fd6);}(_0x4728,0x13b));var _0x8472=function(_0x2f9ca4,_0xb4209b){_0x2f9ca4=_0x2f9ca4-0x0;var _0x230ddd=_0x4728[_0x2f9ca4];return _0x230ddd;};'use strict';var BPromise=require(_0x8472('0x0'));var https=require(_0x8472('0x1'));var logger=require('../../config/logger')('api');var USERNAME=_0x8472('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x2a3212,_0x649ff4){var _0x136ebc={'fields':{'project':{'key':_0x2a3212[_0x8472('0x3')]||_0x8472('0x4')},'summary':(_0x2a3212['summary']||_0x8472('0x5'))+_0x8472('0x6')+_0x2a3212['ip'],'description':_0x2a3212[_0x8472('0x7')]||JSON['stringify'](_0x2a3212),'issuetype':{'name':_0x2a3212[_0x8472('0x8')]||_0x8472('0x9')}}};_0x136ebc[_0x8472('0xa')][_0x8472('0xb')]=_0x2a3212['email'];_0x136ebc[_0x8472('0xa')]['customfield_11501']=_0x2a3212[_0x8472('0xc')];_0x136ebc[_0x8472('0xa')][_0x8472('0xd')]=_0x2a3212[_0x8472('0xe')];_0x136ebc[_0x8472('0xa')][_0x8472('0xf')]=_0x2a3212[_0x8472('0x10')];_0x136ebc[_0x8472('0xa')][_0x8472('0x11')]=_0x2a3212[_0x8472('0x12')];_0x136ebc[_0x8472('0xa')][_0x8472('0x13')]=_0x2a3212['ip'];var _0x11c029={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x8472('0x14'),'method':_0x8472('0x15'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x8472('0x16')+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x5a200d=JSON[_0x8472('0x17')](_0x136ebc);var _0x1b4b42=https[_0x8472('0x18')](_0x11c029,function(_0x1783ca){_0x1783ca['setEncoding'](_0x8472('0x19'));var _0xf76217='';_0x1783ca['on'](_0x8472('0x1a'),function(_0x4763d8){_0xf76217+=_0x4763d8;});_0x1783ca['on'](_0x8472('0x1b'),function(){if(_0x649ff4){return _0x649ff4[_0x8472('0x1c')](_0x1783ca[_0x8472('0x1d')])[_0x8472('0x1e')](JSON[_0x8472('0x1f')](_0xf76217));}});});_0x1b4b42['on'](_0x8472('0x20'),function(_0x15b995){if(_0x649ff4){return _0x649ff4['status'](0x1f4)['json']({'errors':[{'message':_0x8472('0x21'),'type':_0x8472('0x22')}]});}});_0x1b4b42[_0x8472('0x23')](_0x5a200d);_0x1b4b42[_0x8472('0x1b')]();}exports[_0x8472('0x24')]=openIssue;exports[_0x8472('0x25')]=function(_0x104338,_0x2ac385){_0x104338[_0x8472('0x26')]['ip']=_0x104338['headers']['x-forwarded-for']||_0x104338[_0x8472('0x27')][_0x8472('0x28')]||_0x104338[_0x8472('0x29')][_0x8472('0x28')]||_0x104338[_0x8472('0x27')]['socket']['remoteAddress'];return openIssue(_0x104338[_0x8472('0x26')],_0x2ac385);};
\ No newline at end of file
index 3eb97ca..70c1a62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa74f=['/describe','isAuthenticated','describe','show','post','put','/:id','update','delete','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','index','get'];(function(_0x5b8e5a,_0x2e339e){var _0x21bd97=function(_0x525533){while(--_0x525533){_0x5b8e5a['push'](_0x5b8e5a['shift']());}};_0x21bd97(++_0x2e339e);}(_0xa74f,0x9a));var _0xfa74=function(_0x144b30,_0x77072d){_0x144b30=_0x144b30-0x0;var _0x1bb7bc=_0xa74f[_0x144b30];return _0x1bb7bc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfa74('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa74('0x1')]();var fs_extra=require(_0xfa74('0x2'));var auth=require(_0xfa74('0x3'));var interaction=require(_0xfa74('0x4'));var config=require('../../config/environment');var controller=require(_0xfa74('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xfa74('0x6')]);router[_0xfa74('0x7')](_0xfa74('0x8'),auth[_0xfa74('0x9')](),controller[_0xfa74('0xa')]);router[_0xfa74('0x7')]('/:id',auth[_0xfa74('0x9')](),controller[_0xfa74('0xb')]);router[_0xfa74('0xc')]('/',auth[_0xfa74('0x9')](),controller['create']);router[_0xfa74('0xd')](_0xfa74('0xe'),auth['isAuthenticated'](),controller[_0xfa74('0xf')]);router[_0xfa74('0x10')](_0xfa74('0xe'),auth[_0xfa74('0x9')](),controller['destroy']);module[_0xfa74('0x11')]=router;
\ No newline at end of file
+var _0xf4eb=['./jscriptyAnswerReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','Router','../../components/interaction/service','../../config/environment'];(function(_0x2ee31c,_0x290f9e){var _0x261cba=function(_0x1abf78){while(--_0x1abf78){_0x2ee31c['push'](_0x2ee31c['shift']());}};_0x261cba(++_0x290f9e);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2ef034,_0x2713e2){_0x2ef034=_0x2ef034-0x0;var _0x5153be=_0xf4eb[_0x2ef034];return _0x5153be;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/describe',auth[_0xbf4e('0x6')](),controller['describe']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0xa')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router[_0xbf4e('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['delete'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['destroy']);module[_0xbf4e('0xe')]=router;
\ No newline at end of file
index b53c390..583fc7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a54,0x106));var _0x47a5=function(_0x4d1341,_0x49b096){_0x4d1341=_0x4d1341-0x0;var _0x7628dd=_0x7a54[_0x4d1341];return _0x7628dd;};'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(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x7a54,0x106));var _0x47a5=function(_0x2d5855,_0x5c6e4c){_0x2d5855=_0x2d5855-0x0;var _0x31742a=_0x7a54[_0x2d5855];return _0x31742a;};'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 3290414..47e074c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','JscriptyAnswerReport','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','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'];(function(_0x559902,_0xbfca3f){var _0x36a20a=function(_0x1e5327){while(--_0x1e5327){_0x559902['push'](_0x559902['shift']());}};_0x36a20a(++_0xbfca3f);}(_0x814b,0x1a2));var _0xb814=function(_0x42ebba,_0x4cbf87){_0x42ebba=_0x42ebba-0x0;var _0x3fd2af=_0x814b[_0x42ebba];return _0x3fd2af;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}exports[_0xb814('0x2e')]=function(_0x52ed64,_0x9008b2){var _0x37d24d={},_0x530744={},_0x499f22={'count':0x0,'rows':[]};var _0x20577b=_[_0xb814('0x2f')](db['JscriptyAnswerReport'][_0xb814('0x30')],function(_0x526610){return{'name':_0x526610[_0xb814('0x31')],'type':_0x526610['type']['key']};});_0x530744[_0xb814('0x32')]=_['map'](_0x20577b,_0xb814('0x2c'));_0x530744[_0xb814('0x33')]=_[_0xb814('0x34')](_0x52ed64['query']);_0x530744['filters']=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],_0x530744['query']);_0x37d24d[_0xb814('0x36')]=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],qs[_0xb814('0x37')](_0x52ed64[_0xb814('0x33')][_0xb814('0x37')]));_0x37d24d[_0xb814('0x36')]=_0x37d24d['attributes'][_0xb814('0x38')]?_0x37d24d[_0xb814('0x36')]:_0x530744[_0xb814('0x32')];if(!_0x52ed64[_0xb814('0x33')][_0xb814('0x39')]('nolimit')){_0x37d24d[_0xb814('0x21')]=qs['limit'](_0x52ed64[_0xb814('0x33')][_0xb814('0x21')]);_0x37d24d[_0xb814('0x1f')]=qs['offset'](_0x52ed64[_0xb814('0x33')][_0xb814('0x1f')]);}_0x37d24d['order']=qs[_0xb814('0x3a')](_0x52ed64[_0xb814('0x33')][_0xb814('0x3a')]);_0x37d24d[_0xb814('0x3b')]=qs[_0xb814('0x3c')](_[_0xb814('0x3d')](_0x52ed64['query'],_0x530744[_0xb814('0x3c')]),_0x20577b);if(_0x52ed64['query'][_0xb814('0x3e')]){_0x37d24d['where']=_[_0xb814('0x3f')](_0x37d24d['where'],{'$or':_[_0xb814('0x2f')](_0x20577b,function(_0x26675a){if(_0x26675a['type']!=='VIRTUAL'){var _0x5dd6bc={};_0x5dd6bc[_0x26675a['name']]={'$like':'%'+_0x52ed64[_0xb814('0x33')][_0xb814('0x3e')]+'%'};return _0x5dd6bc;}})});}_0x37d24d=_[_0xb814('0x3f')]({},_0x37d24d,_0x52ed64[_0xb814('0x40')]);var _0x51cdba={'where':_0x37d24d['where']};return db[_0xb814('0x41')]['count'](_0x51cdba)[_0xb814('0x28')](function(_0x1098eb){_0x499f22[_0xb814('0x22')]=_0x1098eb;if(_0x52ed64[_0xb814('0x33')][_0xb814('0x42')]){_0x37d24d[_0xb814('0x43')]=[{'all':!![]}];}return db[_0xb814('0x41')][_0xb814('0x44')](_0x37d24d);})[_0xb814('0x28')](function(_0x4b6ff8){_0x499f22['rows']=_0x4b6ff8;return _0x499f22;})['then'](respondWithFilteredResult(_0x9008b2,_0x37d24d))[_0xb814('0x45')](handleError(_0x9008b2,null));};exports['show']=function(_0x29416a,_0x580171){var _0x411723={'raw':!![],'where':{'id':_0x29416a[_0xb814('0x46')]['id']}},_0x44ff56={};_0x44ff56[_0xb814('0x32')]=_['keys'](db[_0xb814('0x41')][_0xb814('0x30')]);_0x44ff56[_0xb814('0x33')]=_[_0xb814('0x34')](_0x29416a[_0xb814('0x33')]);_0x44ff56[_0xb814('0x3c')]=_['intersection'](_0x44ff56[_0xb814('0x32')],_0x44ff56[_0xb814('0x33')]);_0x411723[_0xb814('0x36')]=_[_0xb814('0x35')](_0x44ff56[_0xb814('0x32')],qs[_0xb814('0x37')](_0x29416a[_0xb814('0x33')]['fields']));_0x411723['attributes']=_0x411723[_0xb814('0x36')][_0xb814('0x38')]?_0x411723[_0xb814('0x36')]:_0x44ff56[_0xb814('0x32')];if(_0x29416a[_0xb814('0x33')][_0xb814('0x42')]){_0x411723[_0xb814('0x43')]=[{'all':!![]}];}_0x411723=_[_0xb814('0x3f')]({},_0x411723,_0x29416a[_0xb814('0x40')]);return db[_0xb814('0x41')][_0xb814('0x47')](_0x411723)['then'](handleEntityNotFound(_0x580171,null))[_0xb814('0x28')](respondWithResult(_0x580171,null))[_0xb814('0x45')](handleError(_0x580171,null));};exports['create']=function(_0x338e80,_0x55234d){return db[_0xb814('0x41')][_0xb814('0x48')](_0x338e80[_0xb814('0x49')],{})[_0xb814('0x28')](respondWithResult(_0x55234d,0xc9))[_0xb814('0x45')](handleError(_0x55234d,null));};exports[_0xb814('0x27')]=function(_0x2cc806,_0x45480e){if(_0x2cc806[_0xb814('0x49')]['id']){delete _0x2cc806[_0xb814('0x49')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x2cc806[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x45480e,null))[_0xb814('0x28')](saveUpdates(_0x2cc806[_0xb814('0x49')],null))[_0xb814('0x28')](respondWithResult(_0x45480e,null))[_0xb814('0x45')](handleError(_0x45480e,null));};exports[_0xb814('0x29')]=function(_0x4a4f9a,_0x26fd0b){return db[_0xb814('0x41')][_0xb814('0x47')]({'where':{'id':_0x4a4f9a['params']['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x26fd0b,null))['then'](removeEntity(_0x26fd0b,null))[_0xb814('0x45')](handleError(_0x26fd0b,null));};exports['describe']=function(_0x403872,_0x3cf8f8){return db['JscriptyAnswerReport'][_0xb814('0x4a')]()[_0xb814('0x28')](respondWithResult(_0x3cf8f8,null))[_0xb814('0x45')](handleError(_0x3cf8f8,null));};
\ No newline at end of file
+var _0xa751=['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','../../mysqldb','end','status','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','rows','catch','show','params','keys','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util'];(function(_0x7b173,_0x539d7f){var _0x1c598c=function(_0xe1e1e0){while(--_0xe1e1e0){_0x7b173['push'](_0x7b173['shift']());}};_0x1c598c(++_0x539d7f);}(_0xa751,0x175));var _0x1a75=function(_0x2ac5f7,_0x108c11){_0x2ac5f7=_0x2ac5f7-0x0;var _0x531f86=_0xa751[_0x2ac5f7];return _0x531f86;};'use strict';var emlformat=require(_0x1a75('0x0'));var rimraf=require(_0x1a75('0x1'));var zipdir=require(_0x1a75('0x2'));var jsonpatch=require(_0x1a75('0x3'));var rp=require('request-promise');var moment=require(_0x1a75('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a75('0x5'));var util=require(_0x1a75('0x6'));var path=require(_0x1a75('0x7'));var sox=require('sox');var csv=require(_0x1a75('0x8'));var ejs=require(_0x1a75('0x9'));var fs=require('fs');var fs_extra=require(_0x1a75('0xa'));var _=require(_0x1a75('0xb'));var squel=require(_0x1a75('0xc'));var crypto=require(_0x1a75('0xd'));var jsforce=require(_0x1a75('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1a75('0xf'));var Redis=require(_0x1a75('0x10'));var authService=require(_0x1a75('0x11'));var qs=require(_0x1a75('0x12'));var as=require(_0x1a75('0x13'));var hardwareService=require(_0x1a75('0x14'));var logger=require(_0x1a75('0x15'))(_0x1a75('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a75('0x17'))['db'];function respondWithStatusCode(_0x24e8dc,_0xae1af0){_0xae1af0=_0xae1af0||0xcc;return function(_0x1220e4){if(_0x1220e4){return _0x24e8dc['sendStatus'](_0xae1af0);}return _0x24e8dc['status'](_0xae1af0)[_0x1a75('0x18')]();};}function respondWithResult(_0xf4a616,_0x48577b){_0x48577b=_0x48577b||0xc8;return function(_0x1c84d3){if(_0x1c84d3){return _0xf4a616[_0x1a75('0x19')](_0x48577b)['json'](_0x1c84d3);}};}function respondWithFilteredResult(_0x1f3c38,_0xb4a245){return function(_0x15a1ec){if(_0x15a1ec){var _0x5883df=typeof _0xb4a245['offset']==='undefined'&&typeof _0xb4a245[_0x1a75('0x1a')]===_0x1a75('0x1b');var _0x2b6f3d=_0x15a1ec[_0x1a75('0x1c')];var _0x1b1af2=_0x5883df?0x0:_0xb4a245[_0x1a75('0x1d')];var _0x47f384=_0x5883df?_0x15a1ec[_0x1a75('0x1c')]:_0xb4a245['offset']+_0xb4a245['limit'];var _0x42df2c;if(_0x47f384>=_0x2b6f3d){_0x47f384=_0x2b6f3d;_0x42df2c=0xc8;}else{_0x42df2c=0xce;}_0x1f3c38[_0x1a75('0x19')](_0x42df2c);return _0x1f3c38['set'](_0x1a75('0x1e'),_0x1b1af2+'-'+_0x47f384+'/'+_0x2b6f3d)['json'](_0x15a1ec);}return null;};}function patchUpdates(_0x4699c9){return function(_0x3e3549){try{jsonpatch[_0x1a75('0x1f')](_0x3e3549,_0x4699c9,!![]);}catch(_0x340750){return BPromise[_0x1a75('0x20')](_0x340750);}return _0x3e3549[_0x1a75('0x21')]();};}function saveUpdates(_0x5a0ad7,_0x3ed5e9){return function(_0x4dc595){if(_0x4dc595){return _0x4dc595[_0x1a75('0x22')](_0x5a0ad7)[_0x1a75('0x23')](function(_0x320413){return _0x320413;});}return null;};}function removeEntity(_0x59e3da,_0x443ff8){return function(_0x5e6617){if(_0x5e6617){return _0x5e6617[_0x1a75('0x24')]()[_0x1a75('0x23')](function(){_0x59e3da[_0x1a75('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9fe9fe,_0x126f40){return function(_0x4dec82){if(!_0x4dec82){_0x9fe9fe[_0x1a75('0x25')](0x194);}return _0x4dec82;};}function handleError(_0x399dae,_0x5a6acc){_0x5a6acc=_0x5a6acc||0x1f4;return function(_0x168e06){logger[_0x1a75('0x26')](_0x168e06[_0x1a75('0x27')]);if(_0x168e06[_0x1a75('0x28')]){delete _0x168e06['name'];}_0x399dae[_0x1a75('0x19')](_0x5a6acc)[_0x1a75('0x29')](_0x168e06);};}exports[_0x1a75('0x2a')]=function(_0x2f5ac9,_0xf33870){var _0x9e66b9={},_0x3b6e1d={},_0x38e885={'count':0x0,'rows':[]};var _0x5518ed=_['map'](db[_0x1a75('0x2b')][_0x1a75('0x2c')],function(_0x1a0359){return{'name':_0x1a0359[_0x1a75('0x2d')],'type':_0x1a0359[_0x1a75('0x2e')][_0x1a75('0x2f')]};});_0x3b6e1d[_0x1a75('0x30')]=_[_0x1a75('0x31')](_0x5518ed,'name');_0x3b6e1d['query']=_['keys'](_0x2f5ac9[_0x1a75('0x32')]);_0x3b6e1d[_0x1a75('0x33')]=_[_0x1a75('0x34')](_0x3b6e1d[_0x1a75('0x30')],_0x3b6e1d['query']);_0x9e66b9['attributes']=_['intersection'](_0x3b6e1d[_0x1a75('0x30')],qs[_0x1a75('0x35')](_0x2f5ac9['query']['fields']));_0x9e66b9[_0x1a75('0x36')]=_0x9e66b9['attributes'][_0x1a75('0x37')]?_0x9e66b9[_0x1a75('0x36')]:_0x3b6e1d[_0x1a75('0x30')];if(!_0x2f5ac9['query']['hasOwnProperty'](_0x1a75('0x38'))){_0x9e66b9[_0x1a75('0x1a')]=qs[_0x1a75('0x1a')](_0x2f5ac9[_0x1a75('0x32')][_0x1a75('0x1a')]);_0x9e66b9[_0x1a75('0x1d')]=qs[_0x1a75('0x1d')](_0x2f5ac9[_0x1a75('0x32')][_0x1a75('0x1d')]);}_0x9e66b9[_0x1a75('0x39')]=qs[_0x1a75('0x3a')](_0x2f5ac9[_0x1a75('0x32')][_0x1a75('0x3a')]);_0x9e66b9[_0x1a75('0x3b')]=qs[_0x1a75('0x33')](_[_0x1a75('0x3c')](_0x2f5ac9['query'],_0x3b6e1d[_0x1a75('0x33')]),_0x5518ed);if(_0x2f5ac9['query']['filter']){_0x9e66b9[_0x1a75('0x3b')]=_[_0x1a75('0x3d')](_0x9e66b9[_0x1a75('0x3b')],{'$or':_[_0x1a75('0x31')](_0x5518ed,function(_0x2842d4){if(_0x2842d4['type']!==_0x1a75('0x3e')){var _0xc88c40={};_0xc88c40[_0x2842d4[_0x1a75('0x28')]]={'$like':'%'+_0x2f5ac9[_0x1a75('0x32')][_0x1a75('0x3f')]+'%'};return _0xc88c40;}})});}_0x9e66b9=_['merge']({},_0x9e66b9,_0x2f5ac9[_0x1a75('0x40')]);var _0x481bfe={'where':_0x9e66b9[_0x1a75('0x3b')]};return db[_0x1a75('0x2b')][_0x1a75('0x1c')](_0x481bfe)[_0x1a75('0x23')](function(_0x269ed6){_0x38e885[_0x1a75('0x1c')]=_0x269ed6;if(_0x2f5ac9[_0x1a75('0x32')]['includeAll']){_0x9e66b9['include']=[{'all':!![]}];}return db[_0x1a75('0x2b')]['findAll'](_0x9e66b9);})[_0x1a75('0x23')](function(_0x14abcf){_0x38e885[_0x1a75('0x41')]=_0x14abcf;return _0x38e885;})['then'](respondWithFilteredResult(_0xf33870,_0x9e66b9))[_0x1a75('0x42')](handleError(_0xf33870,null));};exports[_0x1a75('0x43')]=function(_0x21bfae,_0x5a2c51){var _0x292cbc={'raw':!![],'where':{'id':_0x21bfae[_0x1a75('0x44')]['id']}},_0x15fe49={};_0x15fe49[_0x1a75('0x30')]=_[_0x1a75('0x45')](db[_0x1a75('0x2b')][_0x1a75('0x2c')]);_0x15fe49['query']=_[_0x1a75('0x45')](_0x21bfae[_0x1a75('0x32')]);_0x15fe49[_0x1a75('0x33')]=_[_0x1a75('0x34')](_0x15fe49[_0x1a75('0x30')],_0x15fe49['query']);_0x292cbc[_0x1a75('0x36')]=_[_0x1a75('0x34')](_0x15fe49['model'],qs[_0x1a75('0x35')](_0x21bfae['query'][_0x1a75('0x35')]));_0x292cbc['attributes']=_0x292cbc[_0x1a75('0x36')][_0x1a75('0x37')]?_0x292cbc[_0x1a75('0x36')]:_0x15fe49[_0x1a75('0x30')];if(_0x21bfae[_0x1a75('0x32')][_0x1a75('0x46')]){_0x292cbc[_0x1a75('0x47')]=[{'all':!![]}];}_0x292cbc=_['merge']({},_0x292cbc,_0x21bfae[_0x1a75('0x40')]);return db['JscriptyAnswerReport'][_0x1a75('0x48')](_0x292cbc)[_0x1a75('0x23')](handleEntityNotFound(_0x5a2c51,null))[_0x1a75('0x23')](respondWithResult(_0x5a2c51,null))[_0x1a75('0x42')](handleError(_0x5a2c51,null));};exports[_0x1a75('0x49')]=function(_0x1bf8a0,_0x2cfacf){return db[_0x1a75('0x2b')]['create'](_0x1bf8a0[_0x1a75('0x4a')],{})[_0x1a75('0x23')](respondWithResult(_0x2cfacf,0xc9))[_0x1a75('0x42')](handleError(_0x2cfacf,null));};exports[_0x1a75('0x22')]=function(_0x385382,_0x1b76d){if(_0x385382[_0x1a75('0x4a')]['id']){delete _0x385382[_0x1a75('0x4a')]['id'];}return db[_0x1a75('0x2b')][_0x1a75('0x48')]({'where':{'id':_0x385382[_0x1a75('0x44')]['id']}})[_0x1a75('0x23')](handleEntityNotFound(_0x1b76d,null))[_0x1a75('0x23')](saveUpdates(_0x385382[_0x1a75('0x4a')],null))[_0x1a75('0x23')](respondWithResult(_0x1b76d,null))['catch'](handleError(_0x1b76d,null));};exports[_0x1a75('0x24')]=function(_0xa20c25,_0x1ae0cb){return db[_0x1a75('0x2b')][_0x1a75('0x48')]({'where':{'id':_0xa20c25[_0x1a75('0x44')]['id']}})[_0x1a75('0x23')](handleEntityNotFound(_0x1ae0cb,null))[_0x1a75('0x23')](removeEntity(_0x1ae0cb,null))['catch'](handleError(_0x1ae0cb,null));};exports[_0x1a75('0x4b')]=function(_0x5f44e3,_0x40e643){return db[_0x1a75('0x2b')][_0x1a75('0x4b')]()['then'](respondWithResult(_0x40e643,null))['catch'](handleError(_0x40e643,null));};
\ No newline at end of file
index 6a6cf8f..fa07634 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7137=['./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x2a8860,_0x2da926){var _0x2f47a4=function(_0x3b7f54){while(--_0x3b7f54){_0x2a8860['push'](_0x2a8860['shift']());}};_0x2f47a4(++_0x2da926);}(_0x7137,0x186));var _0x7713=function(_0x2eefa0,_0x4570c2){_0x2eefa0=_0x2eefa0-0x0;var _0x372a2b=_0x7137[_0x2eefa0];return _0x372a2b;};'use strict';var _=require(_0x7713('0x0'));var util=require('util');var logger=require(_0x7713('0x1'))(_0x7713('0x2'));var moment=require('moment');var BPromise=require(_0x7713('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7713('0x4'));var rimraf=require(_0x7713('0x5'));var config=require('../../config/environment');var attributes=require(_0x7713('0x6'));module[_0x7713('0x7')]=function(_0x10a14a,_0x201227){return _0x10a14a['define'](_0x7713('0x8'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeb13=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','report_jscripty_answers','lodash','util','../../config/logger'];(function(_0x177346,_0x5e4024){var _0x155669=function(_0x231ab4){while(--_0x231ab4){_0x177346['push'](_0x177346['shift']());}};_0x155669(++_0x5e4024);}(_0xeb13,0xf9));var _0x3eb1=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0xeb13[_0x1597e2];return _0x4c8c0a;};'use strict';var _=require(_0x3eb1('0x0'));var util=require(_0x3eb1('0x1'));var logger=require(_0x3eb1('0x2'))(_0x3eb1('0x3'));var moment=require(_0x3eb1('0x4'));var BPromise=require(_0x3eb1('0x5'));var rp=require(_0x3eb1('0x6'));var fs=require('fs');var path=require(_0x3eb1('0x7'));var rimraf=require(_0x3eb1('0x8'));var config=require(_0x3eb1('0x9'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x1f41f9,_0x4cc8ea){return _0x1f41f9[_0x3eb1('0xa')]('JscriptyAnswerReport',attributes,{'tableName':_0x3eb1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0a6f965..4b36f5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5234=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x44dba1,_0x270ad5){var _0x2fbd3f=function(_0x5e0865){while(--_0x5e0865){_0x44dba1['push'](_0x44dba1['shift']());}};_0x2fbd3f(++_0x270ad5);}(_0x5234,0x6b));var _0x4523=function(_0x296eb8,_0x10bd16){_0x296eb8=_0x296eb8-0x0;var _0x460824=_0x5234[_0x296eb8];return _0x460824;};'use strict';var _=require(_0x4523('0x0'));var util=require(_0x4523('0x1'));var moment=require(_0x4523('0x2'));var BPromise=require(_0x4523('0x3'));var rs=require(_0x4523('0x4'));var fs=require('fs');var Redis=require(_0x4523('0x5'));var db=require(_0x4523('0x6'))['db'];var utils=require(_0x4523('0x7'));var logger=require('../../config/logger')(_0x4523('0x8'));var config=require(_0x4523('0x9'));var jayson=require(_0x4523('0xa'));var client=jayson[_0x4523('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4aa289,_0x3a16ea,_0x33fb49){return new BPromise(function(_0x500c1a,_0x2f0624){return client['request'](_0x4aa289,_0x33fb49)[_0x4523('0xc')](function(_0x497360){logger[_0x4523('0xd')](_0x4523('0xe'),_0x3a16ea,_0x4523('0xf'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x3a16ea,_0x4523('0xf'),JSON[_0x4523('0x10')](_0x497360));if(_0x497360[_0x4523('0x11')]){if(_0x497360[_0x4523('0x11')][_0x4523('0x12')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x3a16ea,_0x497360[_0x4523('0x11')][_0x4523('0x13')]);return _0x2f0624(_0x497360[_0x4523('0x11')][_0x4523('0x13')]);}logger['error'](_0x4523('0xe'),_0x3a16ea,_0x497360[_0x4523('0x11')][_0x4523('0x13')]);return _0x500c1a(_0x497360[_0x4523('0x11')]['message']);}else{logger[_0x4523('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3a16ea,_0x4523('0xf'));_0x500c1a(_0x497360['result']['message']);}})[_0x4523('0x14')](function(_0x56947b){logger['error'](_0x4523('0xe'),_0x3a16ea,_0x56947b);_0x2f0624(_0x56947b);});});}
\ No newline at end of file
+var _0x518d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x129714,_0x5dbd24){var _0x3d9db3=function(_0x35393a){while(--_0x35393a){_0x129714['push'](_0x129714['shift']());}};_0x3d9db3(++_0x5dbd24);}(_0x518d,0x17e));var _0xd518=function(_0x5d1566,_0x146263){_0x5d1566=_0x5d1566-0x0;var _0x4f3b30=_0x518d[_0x5d1566];return _0x4f3b30;};'use strict';var _=require(_0xd518('0x0'));var util=require(_0xd518('0x1'));var moment=require(_0xd518('0x2'));var BPromise=require(_0xd518('0x3'));var rs=require(_0xd518('0x4'));var fs=require('fs');var Redis=require(_0xd518('0x5'));var db=require(_0xd518('0x6'))['db'];var utils=require(_0xd518('0x7'));var logger=require(_0xd518('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd518('0x9')][_0xd518('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53c59a,_0x5910a3,_0x34cc10){return new BPromise(function(_0x40f283,_0x569d6c){return client[_0xd518('0xb')](_0x53c59a,_0x34cc10)[_0xd518('0xc')](function(_0x6f2267){logger[_0xd518('0xd')](_0xd518('0xe'),_0x5910a3,_0xd518('0xf'));logger[_0xd518('0x10')](_0xd518('0x11'),_0x5910a3,_0xd518('0xf'),JSON[_0xd518('0x12')](_0x6f2267));if(_0x6f2267[_0xd518('0x13')]){if(_0x6f2267[_0xd518('0x13')][_0xd518('0x14')]===0x1f4){logger['error'](_0xd518('0xe'),_0x5910a3,_0x6f2267[_0xd518('0x13')][_0xd518('0x15')]);return _0x569d6c(_0x6f2267['error'][_0xd518('0x15')]);}logger[_0xd518('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5910a3,_0x6f2267[_0xd518('0x13')][_0xd518('0x15')]);return _0x40f283(_0x6f2267[_0xd518('0x13')][_0xd518('0x15')]);}else{logger['info'](_0xd518('0xe'),_0x5910a3,_0xd518('0xf'));_0x40f283(_0x6f2267[_0xd518('0x16')][_0xd518('0x15')]);}})[_0xd518('0x17')](function(_0x20f881){logger['error'](_0xd518('0xe'),_0x5910a3,_0x20f881);_0x569d6c(_0x20f881);});});}
\ No newline at end of file
index 4159194..f3686e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc40=['show','/:id/sessions','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','/:id','delete','exports','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index'];(function(_0x5245bc,_0x55e740){var _0x2acb9a=function(_0x4fd1e6){while(--_0x4fd1e6){_0x5245bc['push'](_0x5245bc['shift']());}};_0x2acb9a(++_0x55e740);}(_0xcc40,0x167));var _0x0cc4=function(_0xf590ec,_0x28a562){_0xf590ec=_0xf590ec-0x0;var _0x46ff04=_0xcc40[_0xf590ec];return _0x46ff04;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0cc4('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0cc4('0x1'));var auth=require(_0x0cc4('0x2'));var interaction=require(_0x0cc4('0x3'));var config=require(_0x0cc4('0x4'));var controller=require(_0x0cc4('0x5'));router[_0x0cc4('0x6')]('/',auth[_0x0cc4('0x7')](),controller[_0x0cc4('0x8')]);router[_0x0cc4('0x6')]('/:id',auth[_0x0cc4('0x7')](),controller[_0x0cc4('0x9')]);router[_0x0cc4('0x6')](_0x0cc4('0xa'),auth['isAuthenticated'](),controller['getSessions']);router[_0x0cc4('0x6')]('/:id/answers',auth[_0x0cc4('0x7')](),controller[_0x0cc4('0xb')]);router[_0x0cc4('0x6')](_0x0cc4('0xc'),auth['isAuthenticated'](),timeout(_0x0cc4('0xd')),controller[_0x0cc4('0xe')]);router[_0x0cc4('0xf')]('/',auth[_0x0cc4('0x7')](),controller[_0x0cc4('0x10')]);router['post'](_0x0cc4('0x11'),auth[_0x0cc4('0x7')](),controller[_0x0cc4('0x12')]);router[_0x0cc4('0x13')](_0x0cc4('0x14'),auth[_0x0cc4('0x7')](),controller['update']);router[_0x0cc4('0x15')](_0x0cc4('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0x0cc4('0x16')]=router;
\ No newline at end of file
+var _0x0dec=['index','get','/:id','isAuthenticated','/:id/sessions','getSessions','getAnswers','/:id/summary','30s','create','post','/:id/clone','clone','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./jscriptyProject.controller'];(function(_0x554430,_0x5433df){var _0x3fda06=function(_0x53eab1){while(--_0x53eab1){_0x554430['push'](_0x554430['shift']());}};_0x3fda06(++_0x5433df);}(_0x0dec,0xa6));var _0xc0de=function(_0x259519,_0x3ba77f){_0x259519=_0x259519-0x0;var _0x46b449=_0x0dec[_0x259519];return _0x46b449;};'use strict';var multer=require(_0xc0de('0x0'));var util=require(_0xc0de('0x1'));var path=require(_0xc0de('0x2'));var timeout=require(_0xc0de('0x3'));var express=require(_0xc0de('0x4'));var router=express[_0xc0de('0x5')]();var fs_extra=require(_0xc0de('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc0de('0x7'));var config=require('../../config/environment');var controller=require(_0xc0de('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc0de('0x9')]);router[_0xc0de('0xa')](_0xc0de('0xb'),auth[_0xc0de('0xc')](),controller['show']);router[_0xc0de('0xa')](_0xc0de('0xd'),auth[_0xc0de('0xc')](),controller[_0xc0de('0xe')]);router[_0xc0de('0xa')]('/:id/answers',auth[_0xc0de('0xc')](),controller[_0xc0de('0xf')]);router['get'](_0xc0de('0x10'),auth[_0xc0de('0xc')](),timeout(_0xc0de('0x11')),controller['getSummary']);router['post']('/',auth[_0xc0de('0xc')](),controller[_0xc0de('0x12')]);router[_0xc0de('0x13')](_0xc0de('0x14'),auth[_0xc0de('0xc')](),controller[_0xc0de('0x15')]);router[_0xc0de('0x16')](_0xc0de('0xb'),auth[_0xc0de('0xc')](),controller['update']);router[_0xc0de('0x17')](_0xc0de('0xb'),auth[_0xc0de('0xc')](),controller['destroy']);module[_0xc0de('0x18')]=router;
\ No newline at end of file
index 914c2c8..369e332 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89e0=['getDataValue','name','description','BOOLEAN','sequelize','lodash','util','exports','STRING','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}'];(function(_0x350ec3,_0x1dcb41){var _0x1eef31=function(_0x388869){while(--_0x388869){_0x350ec3['push'](_0x350ec3['shift']());}};_0x1eef31(++_0x1dcb41);}(_0x89e0,0x147));var _0x089e=function(_0x5254ea,_0x1af3fd){_0x5254ea=_0x5254ea-0x0;var _0x192890=_0x89e0[_0x5254ea];return _0x192890;};'use strict';var Sequelize=require(_0x089e('0x0'));var _=require(_0x089e('0x1'));var util=require(_0x089e('0x2'));module[_0x089e('0x3')]={'name':{'type':Sequelize[_0x089e('0x4')],'unique':'name'},'description':{'type':Sequelize[_0x089e('0x4')]},'formData':{'type':Sequelize[_0x089e('0x5')](_0x089e('0x6')),'set':function(_0xe18745){if(_[_0x089e('0x7')](_0xe18745)){this[_0x089e('0x8')]('formData',JSON[_0x089e('0x9')](_0xe18745));}else if(_[_0x089e('0xa')](_0xe18745)){this['setDataValue'](_0x089e('0xb'),_0xe18745);}else{this[_0x089e('0x8')]('formData',util['format'](_0x089e('0xc'),this[_0x089e('0xd')](_0x089e('0xe'))||'',this[_0x089e('0xd')](_0x089e('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x089e('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x089e('0x10')],'defaultValue':![]}};
\ No newline at end of file
+var _0xcfa7=['stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','description','BOOLEAN','lodash','util','exports','STRING','name','long','isObjectLike','setDataValue','formData'];(function(_0x1abfee,_0x42b5f8){var _0x1c54b5=function(_0x22179e){while(--_0x22179e){_0x1abfee['push'](_0x1abfee['shift']());}};_0x1c54b5(++_0x42b5f8);}(_0xcfa7,0x17d));var _0x7cfa=function(_0x2d56c6,_0x57e3e2){_0x2d56c6=_0x2d56c6-0x0;var _0x544f8d=_0xcfa7[_0x2d56c6];return _0x544f8d;};'use strict';var Sequelize=require('sequelize');var _=require(_0x7cfa('0x0'));var util=require(_0x7cfa('0x1'));module[_0x7cfa('0x2')]={'name':{'type':Sequelize[_0x7cfa('0x3')],'unique':_0x7cfa('0x4')},'description':{'type':Sequelize[_0x7cfa('0x3')]},'formData':{'type':Sequelize['TEXT'](_0x7cfa('0x5')),'set':function(_0x44730b){if(_[_0x7cfa('0x6')](_0x44730b)){this[_0x7cfa('0x7')](_0x7cfa('0x8'),JSON[_0x7cfa('0x9')](_0x44730b));}else if(_[_0x7cfa('0xa')](_0x44730b)){this[_0x7cfa('0x7')](_0x7cfa('0x8'),_0x44730b);}else{this[_0x7cfa('0x7')]('formData',util[_0x7cfa('0xb')](_0x7cfa('0xc'),this['getDataValue'](_0x7cfa('0x4'))||'',this['getDataValue'](_0x7cfa('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x7cfa('0xe')],'defaultValue':![]}};
\ No newline at end of file
index 4859ec0..042fbf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe139=['ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','set','reject','update','then','destroy','get','Projects','sendStatus','error','stack','name','send','index','map','JscriptyProject','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','updatedAt','omit','createdAt','getSessions','findOne','JscriptySessionReport','pick','filter','rows','getAnswers','JscriptyAnswerReport','ProjectId','number','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','questionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Content-type','text/csv','download','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x24618a,_0x2cd0f4){var _0x2e3d64=function(_0x28c59c){while(--_0x28c59c){_0x24618a['push'](_0x24618a['shift']());}};_0x2e3d64(++_0x2cd0f4);}(_0xe139,0x1eb));var _0x9e13=function(_0x2540a3,_0x27926a){_0x2540a3=_0x2540a3-0x0;var _0x402067=_0xe139[_0x2540a3];return _0x402067;};'use strict';var emlformat=require(_0x9e13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e13('0x1'));var jsonpatch=require(_0x9e13('0x2'));var rp=require(_0x9e13('0x3'));var moment=require('moment');var BPromise=require(_0x9e13('0x4'));var Mustache=require(_0x9e13('0x5'));var util=require(_0x9e13('0x6'));var path=require(_0x9e13('0x7'));var sox=require(_0x9e13('0x8'));var csv=require('to-csv');var ejs=require(_0x9e13('0x9'));var fs=require('fs');var fs_extra=require(_0x9e13('0xa'));var _=require(_0x9e13('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9e13('0xc'));var deskjs=require(_0x9e13('0xd'));var toCsv=require(_0x9e13('0xe'));var querystring=require(_0x9e13('0xf'));var Papa=require(_0x9e13('0x10'));var Redis=require(_0x9e13('0x11'));var authService=require(_0x9e13('0x12'));var qs=require(_0x9e13('0x13'));var as=require(_0x9e13('0x14'));var hardwareService=require(_0x9e13('0x15'));var logger=require(_0x9e13('0x16'))(_0x9e13('0x17'));var utils=require(_0x9e13('0x18'));var config=require(_0x9e13('0x19'));var licenseUtil=require(_0x9e13('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17482e,_0x2df0aa){_0x2df0aa=_0x2df0aa||0xcc;return function(_0x4a0df8){if(_0x4a0df8){return _0x17482e['sendStatus'](_0x2df0aa);}return _0x17482e['status'](_0x2df0aa)['end']();};}function respondWithResult(_0x1d6e67,_0xcffeda){_0xcffeda=_0xcffeda||0xc8;return function(_0x5b80f0){if(_0x5b80f0){return _0x1d6e67[_0x9e13('0x1b')](_0xcffeda)[_0x9e13('0x1c')](_0x5b80f0);}};}function respondWithFilteredResult(_0x3dee6f,_0x2365c5){return function(_0x39d728){if(_0x39d728){var _0x21f4c7=typeof _0x2365c5[_0x9e13('0x1d')]==='undefined'&&typeof _0x2365c5['limit']===_0x9e13('0x1e');var _0x445267=_0x39d728[_0x9e13('0x1f')];var _0x453f77=_0x21f4c7?0x0:_0x2365c5['offset'];var _0x31550b=_0x21f4c7?_0x39d728[_0x9e13('0x1f')]:_0x2365c5['offset']+_0x2365c5['limit'];var _0x4c3daf;if(_0x31550b>=_0x445267){_0x31550b=_0x445267;_0x4c3daf=0xc8;}else{_0x4c3daf=0xce;}_0x3dee6f[_0x9e13('0x1b')](_0x4c3daf);return _0x3dee6f[_0x9e13('0x20')]('Content-Range',_0x453f77+'-'+_0x31550b+'/'+_0x445267)['json'](_0x39d728);}return null;};}function patchUpdates(_0x18d7f1){return function(_0x5c6c98){try{jsonpatch['apply'](_0x5c6c98,_0x18d7f1,!![]);}catch(_0x13683f){return BPromise[_0x9e13('0x21')](_0x13683f);}return _0x5c6c98['save']();};}function saveUpdates(_0x2010e1,_0x3fb874){return function(_0x3bb422){if(_0x3bb422){return _0x3bb422[_0x9e13('0x22')](_0x2010e1)[_0x9e13('0x23')](function(_0x528d9c){return _0x528d9c;});}return null;};}function removeEntity(_0x25f731,_0xeac12e){return function(_0x4acefa){if(_0x4acefa){return _0x4acefa[_0x9e13('0x24')]()[_0x9e13('0x23')](function(){var _0x84da85=_0x4acefa[_0x9e13('0x25')]({'plain':!![]});var _0x4a1e2d=_0x9e13('0x26');return db['UserProfileResource'][_0x9e13('0x24')]({'where':{'type':_0x4a1e2d,'resourceId':_0x84da85['id']}})['then'](function(){return _0x4acefa;});})[_0x9e13('0x23')](function(){_0x25f731[_0x9e13('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x203d48,_0x1c982b){return function(_0xfbf595){if(!_0xfbf595){_0x203d48[_0x9e13('0x27')](0x194);}return _0xfbf595;};}function handleError(_0x5d00ab,_0x1a6f1a){_0x1a6f1a=_0x1a6f1a||0x1f4;return function(_0x461dc0){logger[_0x9e13('0x28')](_0x461dc0[_0x9e13('0x29')]);if(_0x461dc0[_0x9e13('0x2a')]){delete _0x461dc0[_0x9e13('0x2a')];}_0x5d00ab[_0x9e13('0x1b')](_0x1a6f1a)[_0x9e13('0x2b')](_0x461dc0);};}exports[_0x9e13('0x2c')]=function(_0x2c8541,_0x541cb1){var _0x3fb688={},_0x1cf9a8={},_0x2a232d={'count':0x0,'rows':[]};var _0x3edb56=_[_0x9e13('0x2d')](db[_0x9e13('0x2e')]['rawAttributes'],function(_0x4e981f){return{'name':_0x4e981f[_0x9e13('0x2f')],'type':_0x4e981f[_0x9e13('0x30')][_0x9e13('0x31')]};});_0x1cf9a8['model']=_['map'](_0x3edb56,_0x9e13('0x2a'));_0x1cf9a8['query']=_['keys'](_0x2c8541[_0x9e13('0x32')]);_0x1cf9a8[_0x9e13('0x33')]=_[_0x9e13('0x34')](_0x1cf9a8['model'],_0x1cf9a8['query']);_0x3fb688[_0x9e13('0x35')]=_['intersection'](_0x1cf9a8[_0x9e13('0x36')],qs[_0x9e13('0x37')](_0x2c8541[_0x9e13('0x32')][_0x9e13('0x37')]));_0x3fb688['attributes']=_0x3fb688['attributes'][_0x9e13('0x38')]?_0x3fb688[_0x9e13('0x35')]:_0x1cf9a8[_0x9e13('0x36')];if(!_0x2c8541['query'][_0x9e13('0x39')](_0x9e13('0x3a'))){_0x3fb688['limit']=qs[_0x9e13('0x3b')](_0x2c8541[_0x9e13('0x32')][_0x9e13('0x3b')]);_0x3fb688[_0x9e13('0x1d')]=qs[_0x9e13('0x1d')](_0x2c8541[_0x9e13('0x32')]['offset']);}_0x3fb688[_0x9e13('0x3c')]=qs[_0x9e13('0x3d')](_0x2c8541['query'][_0x9e13('0x3d')]);_0x3fb688['where']=qs['filters'](_['pick'](_0x2c8541[_0x9e13('0x32')],_0x1cf9a8[_0x9e13('0x33')]),_0x3edb56);if(_0x2c8541[_0x9e13('0x32')]['filter']){_0x3fb688[_0x9e13('0x3e')]=_[_0x9e13('0x3f')](_0x3fb688['where'],{'$or':_[_0x9e13('0x2d')](_0x3edb56,function(_0x55b816){if(_0x55b816[_0x9e13('0x30')]!==_0x9e13('0x40')){var _0x568b9a={};_0x568b9a[_0x55b816['name']]={'$like':'%'+_0x2c8541['query']['filter']+'%'};return _0x568b9a;}})});}_0x3fb688=_[_0x9e13('0x3f')]({},_0x3fb688,_0x2c8541[_0x9e13('0x41')]);var _0x4958f7={'where':_0x3fb688['where']};return db[_0x9e13('0x2e')][_0x9e13('0x1f')](_0x4958f7)[_0x9e13('0x23')](function(_0x2776eb){_0x2a232d[_0x9e13('0x1f')]=_0x2776eb;if(_0x2c8541[_0x9e13('0x32')][_0x9e13('0x42')]){_0x3fb688['include']=[{'all':!![]}];}return db['JscriptyProject'][_0x9e13('0x43')](_0x3fb688);})[_0x9e13('0x23')](function(_0x1f481e){_0x2a232d['rows']=_0x1f481e;return _0x2a232d;})[_0x9e13('0x23')](respondWithFilteredResult(_0x541cb1,_0x3fb688))[_0x9e13('0x44')](handleError(_0x541cb1,null));};exports[_0x9e13('0x45')]=function(_0x4ef08f,_0x186831){var _0x3895a6={'raw':![],'where':{'id':_0x4ef08f[_0x9e13('0x46')]['id']}},_0x29ba65={};_0x29ba65['model']=_[_0x9e13('0x47')](db[_0x9e13('0x2e')][_0x9e13('0x48')]);_0x29ba65[_0x9e13('0x32')]=_[_0x9e13('0x47')](_0x4ef08f[_0x9e13('0x32')]);_0x29ba65[_0x9e13('0x33')]=_[_0x9e13('0x34')](_0x29ba65[_0x9e13('0x36')],_0x29ba65['query']);_0x3895a6['attributes']=_[_0x9e13('0x34')](_0x29ba65[_0x9e13('0x36')],qs['fields'](_0x4ef08f[_0x9e13('0x32')][_0x9e13('0x37')]));_0x3895a6['attributes']=_0x3895a6['attributes'][_0x9e13('0x38')]?_0x3895a6[_0x9e13('0x35')]:_0x29ba65[_0x9e13('0x36')];if(_0x4ef08f[_0x9e13('0x32')][_0x9e13('0x42')]){_0x3895a6[_0x9e13('0x49')]=[{'all':!![]}];}_0x3895a6=_[_0x9e13('0x3f')]({},_0x3895a6,_0x4ef08f[_0x9e13('0x41')]);return db['JscriptyProject'][_0x9e13('0x4a')](_0x3895a6)[_0x9e13('0x23')](handleEntityNotFound(_0x186831,null))[_0x9e13('0x23')](respondWithResult(_0x186831,null))['catch'](handleError(_0x186831,null));};exports[_0x9e13('0x4b')]=function(_0x1f1650,_0xcd2768){return db[_0x9e13('0x2e')][_0x9e13('0x4b')](_0x1f1650[_0x9e13('0x4c')],{})[_0x9e13('0x23')](function(_0x2401c4){var _0x223eef=_0x1f1650['user'][_0x9e13('0x25')]({'plain':!![]});if(!_0x223eef)throw new Error(_0x9e13('0x4d'));if(_0x223eef[_0x9e13('0x4e')]===_0x9e13('0x4f')){var _0x9b23=_0x2401c4[_0x9e13('0x25')]({'plain':!![]});var _0x59734e=_0x9e13('0x26');return db[_0x9e13('0x50')][_0x9e13('0x4a')]({'where':{'name':_0x59734e,'userProfileId':_0x223eef[_0x9e13('0x51')]},'raw':!![]})['then'](function(_0x583a3f){if(_0x583a3f&&_0x583a3f[_0x9e13('0x52')]===0x0){return db[_0x9e13('0x53')][_0x9e13('0x4b')]({'name':_0x9b23[_0x9e13('0x2a')],'resourceId':_0x9b23['id'],'type':_0x583a3f[_0x9e13('0x2a')],'sectionId':_0x583a3f['id']},{})[_0x9e13('0x23')](function(){return _0x2401c4;});}else{return _0x2401c4;}})['catch'](function(_0x2bc5ef){logger['error'](_0x9e13('0x54'),_0x2bc5ef);throw _0x2bc5ef;});}return _0x2401c4;})['then'](respondWithResult(_0xcd2768,0xc9))[_0x9e13('0x44')](handleError(_0xcd2768,null));};exports['clone']=function(_0xc0ed3,_0x10117a){var _0xed3361={'where':{'id':_0xc0ed3[_0x9e13('0x46')]['id']}},_0x3a5224={};_0x3a5224['model']=_[_0x9e13('0x47')](db[_0x9e13('0x2e')][_0x9e13('0x48')]);_0xed3361['attributes']=_['intersection'](_0x3a5224['model'],qs[_0x9e13('0x37')](_0xc0ed3[_0x9e13('0x32')][_0x9e13('0x37')]));_0xed3361[_0x9e13('0x35')]=_0xed3361[_0x9e13('0x35')][_0x9e13('0x38')]?_0xed3361[_0x9e13('0x35')]:_0x3a5224['model'];if(_0xc0ed3[_0x9e13('0x32')][_0x9e13('0x42')]){_0xed3361[_0x9e13('0x49')]=[{'all':!![]}];}_0xed3361=_[_0x9e13('0x3f')]({},_0xed3361,_0xc0ed3[_0x9e13('0x41')]);return db[_0x9e13('0x2e')][_0x9e13('0x4a')](_0xed3361)[_0x9e13('0x23')](handleEntityNotFound(_0x10117a,null))[_0x9e13('0x23')](function(_0xbc5b00){if(_0xbc5b00){var _0x4fb79f=_0xbc5b00[_0x9e13('0x25')]({'plain':!![]});_0x4fb79f=qs['omit'](_0x4fb79f,['id','createdAt',_0x9e13('0x55')]);_0xc0ed3[_0x9e13('0x4c')]=_[_0x9e13('0x56')](_0xc0ed3[_0x9e13('0x4c')],['id',_0x9e13('0x57'),_0x9e13('0x55')]);return db[_0x9e13('0x2e')][_0x9e13('0x4b')](_[_0x9e13('0x3f')](_0x4fb79f,_0xc0ed3[_0x9e13('0x4c')]),{'include':_0xc0ed3[_0x9e13('0x32')][_0x9e13('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x7336f5){var _0x3aa815=_0xc0ed3[_0x9e13('0x4f')]['get']({'plain':!![]});if(!_0x3aa815)throw new Error(_0x9e13('0x4d'));if(_0x3aa815[_0x9e13('0x4e')]===_0x9e13('0x4f')){var _0x37560a=_0x7336f5[_0x9e13('0x25')]({'plain':!![]});var _0x16da11=_0x9e13('0x26');return db['UserProfileSection'][_0x9e13('0x4a')]({'where':{'name':_0x16da11,'userProfileId':_0x3aa815['userProfileId']},'raw':!![]})['then'](function(_0x2508e3){if(_0x2508e3&&_0x2508e3[_0x9e13('0x52')]===0x0){return db[_0x9e13('0x53')][_0x9e13('0x4b')]({'name':_0x37560a[_0x9e13('0x2a')],'resourceId':_0x37560a['id'],'type':_0x2508e3['name'],'sectionId':_0x2508e3['id']},{})[_0x9e13('0x23')](function(){return _0x7336f5;});}else{return _0x7336f5;}})['catch'](function(_0x145095){logger[_0x9e13('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x145095);throw _0x145095;});}return _0x7336f5;});}})[_0x9e13('0x23')](respondWithResult(_0x10117a,0xc9))['catch'](handleError(_0x10117a,null));};exports[_0x9e13('0x22')]=function(_0x5925e2,_0x219485){if(_0x5925e2[_0x9e13('0x4c')]['id']){delete _0x5925e2[_0x9e13('0x4c')]['id'];}return db[_0x9e13('0x2e')][_0x9e13('0x4a')]({'where':{'id':_0x5925e2[_0x9e13('0x46')]['id']}})['then'](handleEntityNotFound(_0x219485,null))[_0x9e13('0x23')](saveUpdates(_0x5925e2['body'],null))[_0x9e13('0x23')](respondWithResult(_0x219485,null))[_0x9e13('0x44')](handleError(_0x219485,null));};exports[_0x9e13('0x24')]=function(_0x3d11b4,_0x18bdda){return db[_0x9e13('0x2e')][_0x9e13('0x4a')]({'where':{'id':_0x3d11b4[_0x9e13('0x46')]['id']}})[_0x9e13('0x23')](handleEntityNotFound(_0x18bdda,null))[_0x9e13('0x23')](removeEntity(_0x18bdda,null))['catch'](handleError(_0x18bdda,null));};exports[_0x9e13('0x58')]=function(_0x3e16f2,_0x92526d,_0x11c77b){var _0x287fdc={'raw':!![],'where':{}};var _0x2244e8={};var _0x16cdf9={'count':0x0,'rows':[]};return db[_0x9e13('0x2e')][_0x9e13('0x59')]({'where':{'id':_0x3e16f2[_0x9e13('0x46')]['id']}})[_0x9e13('0x23')](handleEntityNotFound(_0x92526d,null))[_0x9e13('0x23')](function(_0x244fb0){if(_0x244fb0){_0x2244e8[_0x9e13('0x36')]=_[_0x9e13('0x47')](db[_0x9e13('0x5a')][_0x9e13('0x48')]);_0x2244e8[_0x9e13('0x32')]=_[_0x9e13('0x47')](_0x3e16f2[_0x9e13('0x32')]);_0x2244e8[_0x9e13('0x33')]=_['intersection'](_0x2244e8['model'],_0x2244e8[_0x9e13('0x32')]);_0x287fdc[_0x9e13('0x35')]=_[_0x9e13('0x34')](_0x2244e8[_0x9e13('0x36')],qs['fields'](_0x3e16f2['query'][_0x9e13('0x37')]));_0x287fdc[_0x9e13('0x35')]=_0x287fdc[_0x9e13('0x35')][_0x9e13('0x38')]?_0x287fdc[_0x9e13('0x35')]:_0x2244e8[_0x9e13('0x36')];if(!_0x3e16f2[_0x9e13('0x32')]['hasOwnProperty']('nolimit')){_0x287fdc[_0x9e13('0x3b')]=qs[_0x9e13('0x3b')](_0x3e16f2['query'][_0x9e13('0x3b')]);_0x287fdc[_0x9e13('0x1d')]=qs[_0x9e13('0x1d')](_0x3e16f2[_0x9e13('0x32')][_0x9e13('0x1d')]);}_0x287fdc[_0x9e13('0x3c')]=qs[_0x9e13('0x3d')](_0x3e16f2['query'][_0x9e13('0x3d')]);_0x287fdc[_0x9e13('0x3e')]=qs['filters'](_[_0x9e13('0x5b')](_0x3e16f2[_0x9e13('0x32')],_0x2244e8[_0x9e13('0x33')]));_0x287fdc[_0x9e13('0x3e')]['ProjectId']=_0x244fb0['id'];if(_0x3e16f2[_0x9e13('0x32')][_0x9e13('0x5c')]){_0x287fdc[_0x9e13('0x3e')]=_[_0x9e13('0x3f')](_0x287fdc[_0x9e13('0x3e')],{'$or':_['map'](_0x287fdc[_0x9e13('0x35')],function(_0x38f652){var _0x306b59={};_0x306b59[_0x38f652]={'$like':'%'+_0x3e16f2[_0x9e13('0x32')]['filter']+'%'};return _0x306b59;})});}_0x287fdc=_['merge']({},_0x287fdc,_0x3e16f2[_0x9e13('0x41')]);return db[_0x9e13('0x5a')][_0x9e13('0x1f')]({'where':_0x287fdc[_0x9e13('0x3e')]})[_0x9e13('0x23')](function(_0x1c72cc){_0x16cdf9[_0x9e13('0x1f')]=_0x1c72cc;if(_0x3e16f2['query'][_0x9e13('0x42')]){_0x287fdc['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x9e13('0x43')](_0x287fdc);})['then'](function(_0x4ba5c1){_0x16cdf9[_0x9e13('0x5d')]=_0x4ba5c1;return _0x16cdf9;});}})[_0x9e13('0x23')](respondWithFilteredResult(_0x92526d,_0x287fdc))['catch'](handleError(_0x92526d,null));};exports[_0x9e13('0x5e')]=function(_0x4344d8,_0xb085f6,_0x521ca6){var _0xe5d0bb={'raw':!![],'where':{}};var _0x4baf03={};var _0x16f48b={'count':0x0,'rows':[]};return db[_0x9e13('0x2e')][_0x9e13('0x59')]({'where':{'id':_0x4344d8['params']['id']}})[_0x9e13('0x23')](handleEntityNotFound(_0xb085f6,null))[_0x9e13('0x23')](function(_0x5f0da0){if(_0x5f0da0){_0x4baf03['model']=_['keys'](db[_0x9e13('0x5f')][_0x9e13('0x48')]);_0x4baf03['query']=_[_0x9e13('0x47')](_0x4344d8[_0x9e13('0x32')]);_0x4baf03[_0x9e13('0x33')]=_[_0x9e13('0x34')](_0x4baf03[_0x9e13('0x36')],_0x4baf03[_0x9e13('0x32')]);_0xe5d0bb[_0x9e13('0x35')]=_[_0x9e13('0x34')](_0x4baf03[_0x9e13('0x36')],qs[_0x9e13('0x37')](_0x4344d8[_0x9e13('0x32')][_0x9e13('0x37')]));_0xe5d0bb[_0x9e13('0x35')]=_0xe5d0bb[_0x9e13('0x35')][_0x9e13('0x38')]?_0xe5d0bb[_0x9e13('0x35')]:_0x4baf03[_0x9e13('0x36')];if(!_0x4344d8[_0x9e13('0x32')]['hasOwnProperty'](_0x9e13('0x3a'))){_0xe5d0bb[_0x9e13('0x3b')]=qs['limit'](_0x4344d8[_0x9e13('0x32')][_0x9e13('0x3b')]);_0xe5d0bb['offset']=qs[_0x9e13('0x1d')](_0x4344d8['query'][_0x9e13('0x1d')]);}_0xe5d0bb[_0x9e13('0x3c')]=qs[_0x9e13('0x3d')](_0x4344d8[_0x9e13('0x32')]['sort']);_0xe5d0bb[_0x9e13('0x3e')]=qs[_0x9e13('0x33')](_[_0x9e13('0x5b')](_0x4344d8[_0x9e13('0x32')],_0x4baf03[_0x9e13('0x33')]));_0xe5d0bb[_0x9e13('0x3e')][_0x9e13('0x60')]=_0x5f0da0['id'];if(_0x4344d8[_0x9e13('0x32')]['filter']){_0xe5d0bb[_0x9e13('0x3e')]=_[_0x9e13('0x3f')](_0xe5d0bb[_0x9e13('0x3e')],{'$or':_['map'](_0xe5d0bb[_0x9e13('0x35')],function(_0x5b061e){var _0x35bd41={};_0x35bd41[_0x5b061e]={'$like':'%'+_0x4344d8[_0x9e13('0x32')][_0x9e13('0x5c')]+'%'};return _0x35bd41;})});}_0xe5d0bb=_[_0x9e13('0x3f')]({},_0xe5d0bb,_0x4344d8['options']);return db['JscriptyAnswerReport'][_0x9e13('0x1f')]({'where':_0xe5d0bb[_0x9e13('0x3e')]})[_0x9e13('0x23')](function(_0x7332ea){_0x16f48b[_0x9e13('0x1f')]=_0x7332ea;if(_0x4344d8['query'][_0x9e13('0x42')]){_0xe5d0bb[_0x9e13('0x49')]=[{'all':!![]}];}return db[_0x9e13('0x5f')]['findAll'](_0xe5d0bb);})[_0x9e13('0x23')](function(_0x3529cb){_0x16f48b[_0x9e13('0x5d')]=_0x3529cb;return _0x16f48b;});}})[_0x9e13('0x23')](respondWithFilteredResult(_0xb085f6,_0xe5d0bb))[_0x9e13('0x44')](handleError(_0xb085f6,null));};function char(_0x4d09e1){return _0x9e13('0x61')===typeof _0x4d09e1?String[_0x9e13('0x62')][_0x9e13('0x63')](null,arguments):_0x4d09e1;}function needsEncapsulation(_0x22a1f4){return!!_0x22a1f4&&(_0x22a1f4[_0x9e13('0x64')]()[_0x9e13('0x65')](char(0xd))>=0x0||_0x22a1f4[_0x9e13('0x64')]()['indexOf'](char(0xa))>=0x0||_0x22a1f4[_0x9e13('0x64')]()[_0x9e13('0x65')](char(0x2c))>=0x0||_0x22a1f4['toString']()[_0x9e13('0x65')](char(0x22))>=0x0);}function encapsulate(_0x653d5c){var _0xe01faf=char(0x22),_0x4984f0='\x5c'+char(0x22),_0x5a0d38=_0x653d5c[_0x9e13('0x64')]()[_0x9e13('0x66')](new RegExp(_0xe01faf,'g'),_0x4984f0);return _0xe01faf+_0x5a0d38+_0xe01faf;}exports[_0x9e13('0x67')]=function(_0x9ead71,_0x5f2e4,_0xc30390){var _0x25a099,_0x16a684;var _0x365aeb={'where':{'ProjectId':_0x9ead71[_0x9e13('0x46')]['id']}};if(_0x9ead71[_0x9e13('0x32')][_0x9e13('0x68')]){_0x365aeb[_0x9e13('0x3e')]['starttime']=JSON[_0x9e13('0x69')](_0x9ead71['query']['startTime']);}return db[_0x9e13('0x5a')]['findAll'](_0x365aeb)[_0x9e13('0x23')](handleEntityNotFound(_0x5f2e4,null))[_0x9e13('0x23')](function(_0x252af3){if(_0x252af3){_0x25a099=_0x252af3;return db[_0x9e13('0x6a')][_0x9e13('0x43')]({'where':{'SessionId':{'$in':_[_0x9e13('0x2d')](_0x25a099,'id')},'ProjectId':_0x9ead71[_0x9e13('0x46')]['id']},'order':_0x9e13('0x6b')});}})['then'](handleEntityNotFound(_0x5f2e4,null))['then'](function(_0x4fb245){if(_0x4fb245){_0x16a684=_0x4fb245;var _0x17b45d={};for(var _0x30dc34=0x0,_0x25c287=_0x16a684['length'];_0x30dc34<_0x25c287;_0x30dc34++){if(!_0x17b45d[_0x9e13('0x39')](_0x16a684[_0x30dc34]['questionId'])){_0x17b45d[_0x16a684[_0x30dc34]['questionId']]=needsEncapsulation(_0x16a684[_0x30dc34]['question'])?encapsulate(_0x16a684[_0x30dc34]['question']):_0x16a684[_0x30dc34][_0x9e13('0x6c')];}}var _0x7ade8=[],_0x56a55c={};for(var _0x64cc83=0x0,_0xab1a97=_0x25a099[_0x9e13('0x38')];_0x64cc83<_0xab1a97;_0x64cc83++){_0x56a55c={'ProjectId':_0x9ead71[_0x9e13('0x46')]['id'],'SessionId':_0x25a099[_0x64cc83]['id'],'StartTime':moment(_0x25a099[_0x64cc83][_0x9e13('0x6d')])[_0x9e13('0x6e')](_0x9e13('0x6f'))};for(var _0x17bb1f=0x0,_0x14c4b8=_0x16a684[_0x9e13('0x38')];_0x17bb1f<_0x14c4b8;_0x17bb1f++){if(_0x16a684[_0x17bb1f][_0x9e13('0x70')]==_0x25a099[_0x64cc83]['id']&&_0x17b45d[_0x9e13('0x39')](_0x16a684[_0x17bb1f][_0x9e13('0x71')])){_0x56a55c[_0x17b45d[_0x16a684[_0x17bb1f][_0x9e13('0x71')]]]=_0x16a684[_0x17bb1f][_0x9e13('0x72')];}}for(var _0x105ee2 in _0x17b45d){if(!_0x56a55c[_0x9e13('0x39')](_0x17b45d[_0x105ee2])){_0x56a55c[_0x17b45d[_0x105ee2]]=null;}}_0x7ade8[_0x9e13('0x73')](_0x56a55c);}return _0x7ade8;}})[_0x9e13('0x23')](function(_0x41b88d){if(!_[_0x9e13('0x74')](_0x41b88d)){var _0x237602=toCsv(_0x41b88d);var _0x3c86f8=Date[_0x9e13('0x75')]();fs[_0x9e13('0x76')](util[_0x9e13('0x6e')](_0x9e13('0x77'),_0x9ead71[_0x9e13('0x46')]['id'],_0x3c86f8),_0x237602);_0x5f2e4[_0x9e13('0x78')]('Content-disposition',_0x9e13('0x79')+util[_0x9e13('0x6e')]('Jscripty_Project_%d_Summary_%s.csv',_0x9ead71['params']['id'],_0x3c86f8));_0x5f2e4[_0x9e13('0x78')](_0x9e13('0x7a'),_0x9e13('0x7b'));return _0x5f2e4[_0x9e13('0x7c')](util[_0x9e13('0x6e')](_0x9e13('0x77'),_0x9ead71[_0x9e13('0x46')]['id'],_0x3c86f8));}else{return _0x5f2e4[_0x9e13('0x27')](0xcc);}})[_0x9e13('0x44')](handleError(_0x5f2e4,null));};
\ No newline at end of file
+var _0xe75a=['params','fields','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','omit','updatedAt','getSessions','findOne','JscriptySessionReport','pick','ProjectId','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','download','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','offset','set','Content-Range','json','apply','save','update','destroy','then','get','Projects','UserProfileResource','error','stack','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show'];(function(_0x1f88c5,_0x446d22){var _0x4552e8=function(_0xa09d8b){while(--_0xa09d8b){_0x1f88c5['push'](_0x1f88c5['shift']());}};_0x4552e8(++_0x446d22);}(_0xe75a,0x115));var _0xae75=function(_0x163f58,_0x1c8ae4){_0x163f58=_0x163f58-0x0;var _0x472ed9=_0xe75a[_0x163f58];return _0x472ed9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae75('0x0'));var zipdir=require(_0xae75('0x1'));var jsonpatch=require(_0xae75('0x2'));var rp=require(_0xae75('0x3'));var moment=require('moment');var BPromise=require(_0xae75('0x4'));var Mustache=require(_0xae75('0x5'));var util=require(_0xae75('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xae75('0x7'));var fs=require('fs');var fs_extra=require(_0xae75('0x8'));var _=require(_0xae75('0x9'));var squel=require(_0xae75('0xa'));var crypto=require('crypto');var jsforce=require(_0xae75('0xb'));var deskjs=require(_0xae75('0xc'));var toCsv=require(_0xae75('0xd'));var querystring=require(_0xae75('0xe'));var Papa=require('papaparse');var Redis=require(_0xae75('0xf'));var authService=require(_0xae75('0x10'));var qs=require(_0xae75('0x11'));var as=require(_0xae75('0x12'));var hardwareService=require(_0xae75('0x13'));var logger=require(_0xae75('0x14'))(_0xae75('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xae75('0x16'));var db=require(_0xae75('0x17'))['db'];function respondWithStatusCode(_0x1dd50f,_0x231e71){_0x231e71=_0x231e71||0xcc;return function(_0x5ee4f7){if(_0x5ee4f7){return _0x1dd50f[_0xae75('0x18')](_0x231e71);}return _0x1dd50f['status'](_0x231e71)[_0xae75('0x19')]();};}function respondWithResult(_0x1b1b35,_0x1b7696){_0x1b7696=_0x1b7696||0xc8;return function(_0x21818a){if(_0x21818a){return _0x1b1b35[_0xae75('0x1a')](_0x1b7696)['json'](_0x21818a);}};}function respondWithFilteredResult(_0x244c8c,_0xf27788){return function(_0x24275c){if(_0x24275c){var _0x1a8282=typeof _0xf27788['offset']===_0xae75('0x1b')&&typeof _0xf27788[_0xae75('0x1c')]===_0xae75('0x1b');var _0xc8510c=_0x24275c['count'];var _0x5a8dd6=_0x1a8282?0x0:_0xf27788[_0xae75('0x1d')];var _0x4de3cb=_0x1a8282?_0x24275c['count']:_0xf27788['offset']+_0xf27788['limit'];var _0x3d85c0;if(_0x4de3cb>=_0xc8510c){_0x4de3cb=_0xc8510c;_0x3d85c0=0xc8;}else{_0x3d85c0=0xce;}_0x244c8c['status'](_0x3d85c0);return _0x244c8c[_0xae75('0x1e')](_0xae75('0x1f'),_0x5a8dd6+'-'+_0x4de3cb+'/'+_0xc8510c)[_0xae75('0x20')](_0x24275c);}return null;};}function patchUpdates(_0x5b8df1){return function(_0x147bb9){try{jsonpatch[_0xae75('0x21')](_0x147bb9,_0x5b8df1,!![]);}catch(_0x20ab8c){return BPromise['reject'](_0x20ab8c);}return _0x147bb9[_0xae75('0x22')]();};}function saveUpdates(_0x3e5db6,_0x5d6460){return function(_0x5e50e6){if(_0x5e50e6){return _0x5e50e6[_0xae75('0x23')](_0x3e5db6)['then'](function(_0x2303ad){return _0x2303ad;});}return null;};}function removeEntity(_0x155189,_0x350ff9){return function(_0x4647a7){if(_0x4647a7){return _0x4647a7[_0xae75('0x24')]()[_0xae75('0x25')](function(){var _0x3c0c5c=_0x4647a7[_0xae75('0x26')]({'plain':!![]});var _0x43fdf5=_0xae75('0x27');return db[_0xae75('0x28')][_0xae75('0x24')]({'where':{'type':_0x43fdf5,'resourceId':_0x3c0c5c['id']}})[_0xae75('0x25')](function(){return _0x4647a7;});})['then'](function(){_0x155189[_0xae75('0x1a')](0xcc)[_0xae75('0x19')]();});}};}function handleEntityNotFound(_0x33eb2a,_0x440f45){return function(_0x505c04){if(!_0x505c04){_0x33eb2a['sendStatus'](0x194);}return _0x505c04;};}function handleError(_0x57d022,_0xff8370){_0xff8370=_0xff8370||0x1f4;return function(_0x4f5de0){logger[_0xae75('0x29')](_0x4f5de0[_0xae75('0x2a')]);if(_0x4f5de0[_0xae75('0x2b')]){delete _0x4f5de0[_0xae75('0x2b')];}_0x57d022['status'](_0xff8370)['send'](_0x4f5de0);};}exports[_0xae75('0x2c')]=function(_0x1fd7c0,_0x2be1ca){var _0x10a833={},_0x42f7cb={},_0x2073d2={'count':0x0,'rows':[]};var _0x4b2f09=_[_0xae75('0x2d')](db[_0xae75('0x2e')][_0xae75('0x2f')],function(_0x50286d){return{'name':_0x50286d[_0xae75('0x30')],'type':_0x50286d[_0xae75('0x31')][_0xae75('0x32')]};});_0x42f7cb[_0xae75('0x33')]=_['map'](_0x4b2f09,_0xae75('0x2b'));_0x42f7cb[_0xae75('0x34')]=_[_0xae75('0x35')](_0x1fd7c0[_0xae75('0x34')]);_0x42f7cb[_0xae75('0x36')]=_[_0xae75('0x37')](_0x42f7cb['model'],_0x42f7cb[_0xae75('0x34')]);_0x10a833[_0xae75('0x38')]=_[_0xae75('0x37')](_0x42f7cb[_0xae75('0x33')],qs['fields'](_0x1fd7c0[_0xae75('0x34')]['fields']));_0x10a833[_0xae75('0x38')]=_0x10a833['attributes'][_0xae75('0x39')]?_0x10a833[_0xae75('0x38')]:_0x42f7cb[_0xae75('0x33')];if(!_0x1fd7c0[_0xae75('0x34')][_0xae75('0x3a')](_0xae75('0x3b'))){_0x10a833[_0xae75('0x1c')]=qs[_0xae75('0x1c')](_0x1fd7c0[_0xae75('0x34')][_0xae75('0x1c')]);_0x10a833[_0xae75('0x1d')]=qs[_0xae75('0x1d')](_0x1fd7c0['query'][_0xae75('0x1d')]);}_0x10a833[_0xae75('0x3c')]=qs[_0xae75('0x3d')](_0x1fd7c0['query'][_0xae75('0x3d')]);_0x10a833[_0xae75('0x3e')]=qs[_0xae75('0x36')](_['pick'](_0x1fd7c0[_0xae75('0x34')],_0x42f7cb[_0xae75('0x36')]),_0x4b2f09);if(_0x1fd7c0[_0xae75('0x34')][_0xae75('0x3f')]){_0x10a833[_0xae75('0x3e')]=_['merge'](_0x10a833[_0xae75('0x3e')],{'$or':_[_0xae75('0x2d')](_0x4b2f09,function(_0x31b9fb){if(_0x31b9fb['type']!==_0xae75('0x40')){var _0x5da2c8={};_0x5da2c8[_0x31b9fb[_0xae75('0x2b')]]={'$like':'%'+_0x1fd7c0[_0xae75('0x34')]['filter']+'%'};return _0x5da2c8;}})});}_0x10a833=_[_0xae75('0x41')]({},_0x10a833,_0x1fd7c0[_0xae75('0x42')]);var _0x353cad={'where':_0x10a833[_0xae75('0x3e')]};return db[_0xae75('0x2e')]['count'](_0x353cad)[_0xae75('0x25')](function(_0xd9050f){_0x2073d2[_0xae75('0x43')]=_0xd9050f;if(_0x1fd7c0[_0xae75('0x34')][_0xae75('0x44')]){_0x10a833[_0xae75('0x45')]=[{'all':!![]}];}return db[_0xae75('0x2e')][_0xae75('0x46')](_0x10a833);})[_0xae75('0x25')](function(_0x1bd162){_0x2073d2[_0xae75('0x47')]=_0x1bd162;return _0x2073d2;})[_0xae75('0x25')](respondWithFilteredResult(_0x2be1ca,_0x10a833))[_0xae75('0x48')](handleError(_0x2be1ca,null));};exports[_0xae75('0x49')]=function(_0x4e2e07,_0x1ccc36){var _0x58201a={'raw':![],'where':{'id':_0x4e2e07[_0xae75('0x4a')]['id']}},_0x4f84f8={};_0x4f84f8[_0xae75('0x33')]=_[_0xae75('0x35')](db[_0xae75('0x2e')][_0xae75('0x2f')]);_0x4f84f8['query']=_[_0xae75('0x35')](_0x4e2e07[_0xae75('0x34')]);_0x4f84f8[_0xae75('0x36')]=_[_0xae75('0x37')](_0x4f84f8['model'],_0x4f84f8['query']);_0x58201a[_0xae75('0x38')]=_[_0xae75('0x37')](_0x4f84f8[_0xae75('0x33')],qs[_0xae75('0x4b')](_0x4e2e07['query'][_0xae75('0x4b')]));_0x58201a[_0xae75('0x38')]=_0x58201a[_0xae75('0x38')][_0xae75('0x39')]?_0x58201a[_0xae75('0x38')]:_0x4f84f8['model'];if(_0x4e2e07[_0xae75('0x34')]['includeAll']){_0x58201a[_0xae75('0x45')]=[{'all':!![]}];}_0x58201a=_['merge']({},_0x58201a,_0x4e2e07[_0xae75('0x42')]);return db[_0xae75('0x2e')][_0xae75('0x4c')](_0x58201a)[_0xae75('0x25')](handleEntityNotFound(_0x1ccc36,null))['then'](respondWithResult(_0x1ccc36,null))[_0xae75('0x48')](handleError(_0x1ccc36,null));};exports[_0xae75('0x4d')]=function(_0xc1a676,_0x285242){return db['JscriptyProject'][_0xae75('0x4d')](_0xc1a676[_0xae75('0x4e')],{})['then'](function(_0x58b4c4){var _0x188d13=_0xc1a676[_0xae75('0x4f')][_0xae75('0x26')]({'plain':!![]});if(!_0x188d13)throw new Error(_0xae75('0x50'));if(_0x188d13[_0xae75('0x51')]===_0xae75('0x4f')){var _0x3e33a7=_0x58b4c4['get']({'plain':!![]});var _0x1ff1d5=_0xae75('0x27');return db[_0xae75('0x52')]['find']({'where':{'name':_0x1ff1d5,'userProfileId':_0x188d13[_0xae75('0x53')]},'raw':!![]})[_0xae75('0x25')](function(_0x20fc3c){if(_0x20fc3c&&_0x20fc3c[_0xae75('0x54')]===0x0){return db['UserProfileResource'][_0xae75('0x4d')]({'name':_0x3e33a7[_0xae75('0x2b')],'resourceId':_0x3e33a7['id'],'type':_0x20fc3c['name'],'sectionId':_0x20fc3c['id']},{})['then'](function(){return _0x58b4c4;});}else{return _0x58b4c4;}})['catch'](function(_0x3b5907){logger[_0xae75('0x29')](_0xae75('0x55'),_0x3b5907);throw _0x3b5907;});}return _0x58b4c4;})[_0xae75('0x25')](respondWithResult(_0x285242,0xc9))[_0xae75('0x48')](handleError(_0x285242,null));};exports[_0xae75('0x56')]=function(_0x4348fc,_0x197cea){var _0x209882={'where':{'id':_0x4348fc[_0xae75('0x4a')]['id']}},_0x4b5cee={};_0x4b5cee['model']=_['keys'](db[_0xae75('0x2e')]['rawAttributes']);_0x209882[_0xae75('0x38')]=_[_0xae75('0x37')](_0x4b5cee[_0xae75('0x33')],qs[_0xae75('0x4b')](_0x4348fc[_0xae75('0x34')][_0xae75('0x4b')]));_0x209882['attributes']=_0x209882[_0xae75('0x38')][_0xae75('0x39')]?_0x209882[_0xae75('0x38')]:_0x4b5cee['model'];if(_0x4348fc['query'][_0xae75('0x44')]){_0x209882[_0xae75('0x45')]=[{'all':!![]}];}_0x209882=_[_0xae75('0x41')]({},_0x209882,_0x4348fc[_0xae75('0x42')]);return db[_0xae75('0x2e')][_0xae75('0x4c')](_0x209882)[_0xae75('0x25')](handleEntityNotFound(_0x197cea,null))[_0xae75('0x25')](function(_0xb18710){if(_0xb18710){var _0x476f71=_0xb18710[_0xae75('0x26')]({'plain':!![]});_0x476f71=qs[_0xae75('0x57')](_0x476f71,['id','createdAt',_0xae75('0x58')]);_0x4348fc[_0xae75('0x4e')]=_['omit'](_0x4348fc[_0xae75('0x4e')],['id','createdAt',_0xae75('0x58')]);return db[_0xae75('0x2e')][_0xae75('0x4d')](_['merge'](_0x476f71,_0x4348fc[_0xae75('0x4e')]),{'include':_0x4348fc['query'][_0xae75('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x1099a8){var _0x25afd0=_0x4348fc[_0xae75('0x4f')][_0xae75('0x26')]({'plain':!![]});if(!_0x25afd0)throw new Error(_0xae75('0x50'));if(_0x25afd0[_0xae75('0x51')]==='user'){var _0x5863f7=_0x1099a8['get']({'plain':!![]});var _0x54b54a=_0xae75('0x27');return db[_0xae75('0x52')]['find']({'where':{'name':_0x54b54a,'userProfileId':_0x25afd0[_0xae75('0x53')]},'raw':!![]})['then'](function(_0x513367){if(_0x513367&&_0x513367['autoAssociation']===0x0){return db[_0xae75('0x28')][_0xae75('0x4d')]({'name':_0x5863f7[_0xae75('0x2b')],'resourceId':_0x5863f7['id'],'type':_0x513367['name'],'sectionId':_0x513367['id']},{})[_0xae75('0x25')](function(){return _0x1099a8;});}else{return _0x1099a8;}})[_0xae75('0x48')](function(_0x57eb60){logger['error'](_0xae75('0x55'),_0x57eb60);throw _0x57eb60;});}return _0x1099a8;});}})['then'](respondWithResult(_0x197cea,0xc9))[_0xae75('0x48')](handleError(_0x197cea,null));};exports[_0xae75('0x23')]=function(_0x72de3a,_0x2fe14e){if(_0x72de3a[_0xae75('0x4e')]['id']){delete _0x72de3a[_0xae75('0x4e')]['id'];}return db['JscriptyProject'][_0xae75('0x4c')]({'where':{'id':_0x72de3a[_0xae75('0x4a')]['id']}})[_0xae75('0x25')](handleEntityNotFound(_0x2fe14e,null))['then'](saveUpdates(_0x72de3a[_0xae75('0x4e')],null))[_0xae75('0x25')](respondWithResult(_0x2fe14e,null))[_0xae75('0x48')](handleError(_0x2fe14e,null));};exports[_0xae75('0x24')]=function(_0x605b5b,_0x4ab6a6){return db[_0xae75('0x2e')]['find']({'where':{'id':_0x605b5b[_0xae75('0x4a')]['id']}})[_0xae75('0x25')](handleEntityNotFound(_0x4ab6a6,null))[_0xae75('0x25')](removeEntity(_0x4ab6a6,null))['catch'](handleError(_0x4ab6a6,null));};exports[_0xae75('0x59')]=function(_0x1a9d72,_0x51cac1,_0x8fe51){var _0x1f5b5a={'raw':!![],'where':{}};var _0x2393ae={};var _0x482b5b={'count':0x0,'rows':[]};return db[_0xae75('0x2e')][_0xae75('0x5a')]({'where':{'id':_0x1a9d72[_0xae75('0x4a')]['id']}})['then'](handleEntityNotFound(_0x51cac1,null))['then'](function(_0x5a8bf5){if(_0x5a8bf5){_0x2393ae['model']=_['keys'](db[_0xae75('0x5b')][_0xae75('0x2f')]);_0x2393ae['query']=_[_0xae75('0x35')](_0x1a9d72['query']);_0x2393ae['filters']=_[_0xae75('0x37')](_0x2393ae['model'],_0x2393ae['query']);_0x1f5b5a['attributes']=_[_0xae75('0x37')](_0x2393ae[_0xae75('0x33')],qs[_0xae75('0x4b')](_0x1a9d72['query'][_0xae75('0x4b')]));_0x1f5b5a[_0xae75('0x38')]=_0x1f5b5a['attributes']['length']?_0x1f5b5a[_0xae75('0x38')]:_0x2393ae[_0xae75('0x33')];if(!_0x1a9d72[_0xae75('0x34')][_0xae75('0x3a')](_0xae75('0x3b'))){_0x1f5b5a[_0xae75('0x1c')]=qs[_0xae75('0x1c')](_0x1a9d72[_0xae75('0x34')][_0xae75('0x1c')]);_0x1f5b5a[_0xae75('0x1d')]=qs['offset'](_0x1a9d72['query']['offset']);}_0x1f5b5a[_0xae75('0x3c')]=qs[_0xae75('0x3d')](_0x1a9d72[_0xae75('0x34')][_0xae75('0x3d')]);_0x1f5b5a[_0xae75('0x3e')]=qs['filters'](_[_0xae75('0x5c')](_0x1a9d72[_0xae75('0x34')],_0x2393ae[_0xae75('0x36')]));_0x1f5b5a[_0xae75('0x3e')][_0xae75('0x5d')]=_0x5a8bf5['id'];if(_0x1a9d72[_0xae75('0x34')][_0xae75('0x3f')]){_0x1f5b5a[_0xae75('0x3e')]=_[_0xae75('0x41')](_0x1f5b5a['where'],{'$or':_['map'](_0x1f5b5a[_0xae75('0x38')],function(_0x45c683){var _0x595ade={};_0x595ade[_0x45c683]={'$like':'%'+_0x1a9d72[_0xae75('0x34')]['filter']+'%'};return _0x595ade;})});}_0x1f5b5a=_[_0xae75('0x41')]({},_0x1f5b5a,_0x1a9d72[_0xae75('0x42')]);return db['JscriptySessionReport'][_0xae75('0x43')]({'where':_0x1f5b5a[_0xae75('0x3e')]})[_0xae75('0x25')](function(_0x1aef86){_0x482b5b['count']=_0x1aef86;if(_0x1a9d72['query'][_0xae75('0x44')]){_0x1f5b5a[_0xae75('0x45')]=[{'all':!![]}];}return db[_0xae75('0x5b')]['findAll'](_0x1f5b5a);})['then'](function(_0x1839a3){_0x482b5b[_0xae75('0x47')]=_0x1839a3;return _0x482b5b;});}})[_0xae75('0x25')](respondWithFilteredResult(_0x51cac1,_0x1f5b5a))[_0xae75('0x48')](handleError(_0x51cac1,null));};exports['getAnswers']=function(_0x5f1c80,_0x3217ca,_0x182f2e){var _0x26b68d={'raw':!![],'where':{}};var _0x544b24={};var _0x3c1a9e={'count':0x0,'rows':[]};return db[_0xae75('0x2e')][_0xae75('0x5a')]({'where':{'id':_0x5f1c80['params']['id']}})[_0xae75('0x25')](handleEntityNotFound(_0x3217ca,null))['then'](function(_0x3112c1){if(_0x3112c1){_0x544b24[_0xae75('0x33')]=_['keys'](db[_0xae75('0x5e')][_0xae75('0x2f')]);_0x544b24[_0xae75('0x34')]=_[_0xae75('0x35')](_0x5f1c80[_0xae75('0x34')]);_0x544b24[_0xae75('0x36')]=_[_0xae75('0x37')](_0x544b24[_0xae75('0x33')],_0x544b24[_0xae75('0x34')]);_0x26b68d[_0xae75('0x38')]=_[_0xae75('0x37')](_0x544b24[_0xae75('0x33')],qs[_0xae75('0x4b')](_0x5f1c80[_0xae75('0x34')][_0xae75('0x4b')]));_0x26b68d[_0xae75('0x38')]=_0x26b68d[_0xae75('0x38')][_0xae75('0x39')]?_0x26b68d[_0xae75('0x38')]:_0x544b24[_0xae75('0x33')];if(!_0x5f1c80[_0xae75('0x34')]['hasOwnProperty'](_0xae75('0x3b'))){_0x26b68d[_0xae75('0x1c')]=qs[_0xae75('0x1c')](_0x5f1c80['query']['limit']);_0x26b68d[_0xae75('0x1d')]=qs['offset'](_0x5f1c80[_0xae75('0x34')][_0xae75('0x1d')]);}_0x26b68d[_0xae75('0x3c')]=qs[_0xae75('0x3d')](_0x5f1c80[_0xae75('0x34')][_0xae75('0x3d')]);_0x26b68d[_0xae75('0x3e')]=qs[_0xae75('0x36')](_['pick'](_0x5f1c80['query'],_0x544b24[_0xae75('0x36')]));_0x26b68d[_0xae75('0x3e')][_0xae75('0x5d')]=_0x3112c1['id'];if(_0x5f1c80[_0xae75('0x34')][_0xae75('0x3f')]){_0x26b68d['where']=_[_0xae75('0x41')](_0x26b68d['where'],{'$or':_[_0xae75('0x2d')](_0x26b68d['attributes'],function(_0x27a3a9){var _0x1d3dbd={};_0x1d3dbd[_0x27a3a9]={'$like':'%'+_0x5f1c80['query']['filter']+'%'};return _0x1d3dbd;})});}_0x26b68d=_['merge']({},_0x26b68d,_0x5f1c80[_0xae75('0x42')]);return db[_0xae75('0x5e')][_0xae75('0x43')]({'where':_0x26b68d[_0xae75('0x3e')]})[_0xae75('0x25')](function(_0x1e8476){_0x3c1a9e['count']=_0x1e8476;if(_0x5f1c80['query'][_0xae75('0x44')]){_0x26b68d[_0xae75('0x45')]=[{'all':!![]}];}return db[_0xae75('0x5e')][_0xae75('0x46')](_0x26b68d);})[_0xae75('0x25')](function(_0x19f233){_0x3c1a9e['rows']=_0x19f233;return _0x3c1a9e;});}})[_0xae75('0x25')](respondWithFilteredResult(_0x3217ca,_0x26b68d))[_0xae75('0x48')](handleError(_0x3217ca,null));};function char(_0x2cbc5c){return'number'===typeof _0x2cbc5c?String[_0xae75('0x5f')][_0xae75('0x21')](null,arguments):_0x2cbc5c;}function needsEncapsulation(_0x5965b9){return!!_0x5965b9&&(_0x5965b9[_0xae75('0x60')]()['indexOf'](char(0xd))>=0x0||_0x5965b9['toString']()['indexOf'](char(0xa))>=0x0||_0x5965b9[_0xae75('0x60')]()['indexOf'](char(0x2c))>=0x0||_0x5965b9[_0xae75('0x60')]()[_0xae75('0x61')](char(0x22))>=0x0);}function encapsulate(_0x454f21){var _0x4e53a4=char(0x22),_0x321422='\x5c'+char(0x22),_0x327712=_0x454f21[_0xae75('0x60')]()[_0xae75('0x62')](new RegExp(_0x4e53a4,'g'),_0x321422);return _0x4e53a4+_0x327712+_0x4e53a4;}exports['getSummary']=function(_0x13ce88,_0x53e95d,_0x1cf05d){var _0x441298,_0x4b69a6;var _0x2d856c={'where':{'ProjectId':_0x13ce88['params']['id']}};if(_0x13ce88[_0xae75('0x34')][_0xae75('0x63')]){_0x2d856c[_0xae75('0x3e')][_0xae75('0x64')]=JSON['parse'](_0x13ce88[_0xae75('0x34')][_0xae75('0x63')]);}return db[_0xae75('0x5b')][_0xae75('0x46')](_0x2d856c)[_0xae75('0x25')](handleEntityNotFound(_0x53e95d,null))[_0xae75('0x25')](function(_0x101e6f){if(_0x101e6f){_0x441298=_0x101e6f;return db[_0xae75('0x65')][_0xae75('0x46')]({'where':{'SessionId':{'$in':_[_0xae75('0x2d')](_0x441298,'id')},'ProjectId':_0x13ce88[_0xae75('0x4a')]['id']},'order':_0xae75('0x66')});}})[_0xae75('0x25')](handleEntityNotFound(_0x53e95d,null))[_0xae75('0x25')](function(_0x512755){if(_0x512755){_0x4b69a6=_0x512755;var _0x55ed2d={};for(var _0x596421=0x0,_0x3b6036=_0x4b69a6[_0xae75('0x39')];_0x596421<_0x3b6036;_0x596421++){if(!_0x55ed2d[_0xae75('0x3a')](_0x4b69a6[_0x596421][_0xae75('0x67')])){_0x55ed2d[_0x4b69a6[_0x596421][_0xae75('0x67')]]=needsEncapsulation(_0x4b69a6[_0x596421][_0xae75('0x68')])?encapsulate(_0x4b69a6[_0x596421][_0xae75('0x68')]):_0x4b69a6[_0x596421]['question'];}}var _0x54ebcc=[],_0x3e8979={};for(var _0x1cda7b=0x0,_0x5d8dd4=_0x441298[_0xae75('0x39')];_0x1cda7b<_0x5d8dd4;_0x1cda7b++){_0x3e8979={'ProjectId':_0x13ce88['params']['id'],'SessionId':_0x441298[_0x1cda7b]['id'],'StartTime':moment(_0x441298[_0x1cda7b][_0xae75('0x64')])[_0xae75('0x69')](_0xae75('0x6a'))};for(var _0x2c3a10=0x0,_0x26c741=_0x4b69a6[_0xae75('0x39')];_0x2c3a10<_0x26c741;_0x2c3a10++){if(_0x4b69a6[_0x2c3a10][_0xae75('0x6b')]==_0x441298[_0x1cda7b]['id']&&_0x55ed2d[_0xae75('0x3a')](_0x4b69a6[_0x2c3a10][_0xae75('0x67')])){_0x3e8979[_0x55ed2d[_0x4b69a6[_0x2c3a10]['questionId']]]=_0x4b69a6[_0x2c3a10]['answer'];}}for(var _0x2e2315 in _0x55ed2d){if(!_0x3e8979[_0xae75('0x3a')](_0x55ed2d[_0x2e2315])){_0x3e8979[_0x55ed2d[_0x2e2315]]=null;}}_0x54ebcc[_0xae75('0x6c')](_0x3e8979);}return _0x54ebcc;}})['then'](function(_0x4bfe3e){if(!_[_0xae75('0x6d')](_0x4bfe3e)){var _0x55dae9=toCsv(_0x4bfe3e);var _0x582782=Date[_0xae75('0x6e')]();fs['writeFileSync'](util[_0xae75('0x69')](_0xae75('0x6f'),_0x13ce88['params']['id'],_0x582782),_0x55dae9);_0x53e95d['setHeader'](_0xae75('0x70'),_0xae75('0x71')+util[_0xae75('0x69')](_0xae75('0x72'),_0x13ce88[_0xae75('0x4a')]['id'],_0x582782));_0x53e95d[_0xae75('0x73')]('Content-type','text/csv');return _0x53e95d[_0xae75('0x74')](util['format'](_0xae75('0x6f'),_0x13ce88['params']['id'],_0x582782));}else{return _0x53e95d['sendStatus'](0xcc);}})[_0xae75('0x48')](handleError(_0x53e95d,null));};
\ No newline at end of file
index 8e73430..70a6924 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61b8=['../../config/logger','moment','path','rimraf','../../config/environment','exports','define','JscriptyProject','jscripty_projects','lodash','util'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x61b8,0x169));var _0x861b=function(_0x7528ac,_0x4a88ab){_0x7528ac=_0x7528ac-0x0;var _0x24614a=_0x61b8[_0x7528ac];return _0x24614a;};'use strict';var _=require(_0x861b('0x0'));var util=require(_0x861b('0x1'));var logger=require(_0x861b('0x2'))('api');var moment=require(_0x861b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x861b('0x4'));var rimraf=require(_0x861b('0x5'));var config=require(_0x861b('0x6'));var attributes=require('./jscriptyProject.attributes');module[_0x861b('0x7')]=function(_0x422a5f,_0x1cfc62){return _0x422a5f[_0x861b('0x8')](_0x861b('0x9'),attributes,{'tableName':_0x861b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1d3=['JscriptyProject','jscripty_projects','lodash','moment','bluebird','request-promise','path','../../config/environment','./jscriptyProject.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb1d3,0xe8));var _0x3b1d=function(_0x50599a,_0x529f64){_0x50599a=_0x50599a-0x0;var _0xb9f293=_0xb1d3[_0x50599a];return _0xb9f293;};'use strict';var _=require(_0x3b1d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3b1d('0x1'));var BPromise=require(_0x3b1d('0x2'));var rp=require(_0x3b1d('0x3'));var fs=require('fs');var path=require(_0x3b1d('0x4'));var rimraf=require('rimraf');var config=require(_0x3b1d('0x5'));var attributes=require(_0x3b1d('0x6'));module[_0x3b1d('0x7')]=function(_0x477115,_0x524e93){return _0x477115['define'](_0x3b1d('0x8'),attributes,{'tableName':_0x3b1d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b945fc1..ee9c83a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x3c925d,_0x4fa17d){var _0x480aba=function(_0x54cca6){while(--_0x54cca6){_0x3c925d['push'](_0x3c925d['shift']());}};_0x480aba(++_0x4fa17d);}(_0xb43b,0x1b2));var _0xbb43=function(_0x13bc37,_0x3527ae){_0x13bc37=_0x13bc37-0x0;var _0x3d1b87=_0xb43b[_0x13bc37];return _0x3d1b87;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});}
\ No newline at end of file
+var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x32da80,_0x2ea65e){var _0x50c7c7=function(_0x4ac245){while(--_0x4ac245){_0x32da80['push'](_0x32da80['shift']());}};_0x50c7c7(++_0x2ea65e);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});}
\ No newline at end of file
index b8b8f43..a019d35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb673=['show','create','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','index','get','describe','/:id','isAuthenticated'];(function(_0x4cfc35,_0xb52690){var _0x43a384=function(_0x3d896f){while(--_0x3d896f){_0x4cfc35['push'](_0x4cfc35['shift']());}};_0x43a384(++_0xb52690);}(_0xb673,0x8a));var _0x3b67=function(_0x59aac1,_0xc298de){_0x59aac1=_0x59aac1-0x0;var _0x13d8c8=_0xb673[_0x59aac1];return _0x13d8c8;};'use strict';var multer=require(_0x3b67('0x0'));var util=require(_0x3b67('0x1'));var path=require('path');var timeout=require(_0x3b67('0x2'));var express=require(_0x3b67('0x3'));var router=express[_0x3b67('0x4')]();var fs_extra=require(_0x3b67('0x5'));var auth=require(_0x3b67('0x6'));var interaction=require(_0x3b67('0x7'));var config=require('../../config/environment');var controller=require(_0x3b67('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3b67('0x9')]);router[_0x3b67('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x3b67('0xb')]);router[_0x3b67('0xa')](_0x3b67('0xc'),auth[_0x3b67('0xd')](),controller[_0x3b67('0xe')]);router['post']('/',auth[_0x3b67('0xd')](),controller[_0x3b67('0xf')]);router[_0x3b67('0x10')](_0x3b67('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x3b67('0x11')]('/:id',auth[_0x3b67('0xd')](),controller['destroy']);module[_0x3b67('0x12')]=router;
\ No newline at end of file
+var _0x8a70=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','delete','destroy'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x8a70,0x181));var _0x08a7=function(_0x248296,_0x595244){_0x248296=_0x248296-0x0;var _0x366dd0=_0x8a70[_0x248296];return _0x366dd0;};'use strict';var multer=require(_0x08a7('0x0'));var util=require(_0x08a7('0x1'));var path=require(_0x08a7('0x2'));var timeout=require(_0x08a7('0x3'));var express=require(_0x08a7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x08a7('0x5'));var interaction=require(_0x08a7('0x6'));var config=require(_0x08a7('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0x08a7('0x8')]('/',auth[_0x08a7('0x9')](),controller[_0x08a7('0xa')]);router[_0x08a7('0x8')]('/describe',auth[_0x08a7('0x9')](),controller['describe']);router[_0x08a7('0x8')](_0x08a7('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x08a7('0xc')]('/',auth[_0x08a7('0x9')](),controller['create']);router['put'](_0x08a7('0xb'),auth[_0x08a7('0x9')](),controller['update']);router[_0x08a7('0xd')](_0x08a7('0xb'),auth['isAuthenticated'](),controller[_0x08a7('0xe')]);module[_0x08a7('0xf')]=router;
\ No newline at end of file
index 63239b5..17901ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x7a54,0x106));var _0x47a5=function(_0x44c1ee,_0x5bc68b){_0x44c1ee=_0x44c1ee-0x0;var _0x5834dd=_0x7a54[_0x44c1ee];return _0x5834dd;};'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(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x7a54,0x106));var _0x47a5=function(_0x4a545d,_0x1211bd){_0x4a545d=_0x4a545d-0x0;var _0xb06794=_0x7a54[_0x4a545d];return _0xb06794;};'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 5ef99c9..4478582 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9eab=['to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','JscriptyQuestionReport','include','findAll','rows','catch','show','params','keys','length','includeAll','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0x9eab,0xdb));var _0xb9ea=function(_0x26c6a4,_0x49bf09){_0x26c6a4=_0x26c6a4-0x0;var _0x333fa2=_0x9eab[_0x26c6a4];return _0x333fa2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb9ea('0x0'));var zipdir=require(_0xb9ea('0x1'));var jsonpatch=require(_0xb9ea('0x2'));var rp=require(_0xb9ea('0x3'));var moment=require(_0xb9ea('0x4'));var BPromise=require(_0xb9ea('0x5'));var Mustache=require(_0xb9ea('0x6'));var util=require(_0xb9ea('0x7'));var path=require('path');var sox=require(_0xb9ea('0x8'));var csv=require(_0xb9ea('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb9ea('0xa'));var _=require(_0xb9ea('0xb'));var squel=require(_0xb9ea('0xc'));var crypto=require(_0xb9ea('0xd'));var jsforce=require(_0xb9ea('0xe'));var deskjs=require(_0xb9ea('0xf'));var toCsv=require(_0xb9ea('0x9'));var querystring=require('querystring');var Papa=require(_0xb9ea('0x10'));var Redis=require(_0xb9ea('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb9ea('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb9ea('0x13'));var logger=require(_0xb9ea('0x14'))('api');var utils=require(_0xb9ea('0x15'));var config=require(_0xb9ea('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4658f6,_0x145e02){_0x145e02=_0x145e02||0xcc;return function(_0x1068a3){if(_0x1068a3){return _0x4658f6[_0xb9ea('0x17')](_0x145e02);}return _0x4658f6[_0xb9ea('0x18')](_0x145e02)[_0xb9ea('0x19')]();};}function respondWithResult(_0xaaa560,_0x421580){_0x421580=_0x421580||0xc8;return function(_0x1f09d1){if(_0x1f09d1){return _0xaaa560[_0xb9ea('0x18')](_0x421580)['json'](_0x1f09d1);}};}function respondWithFilteredResult(_0x37abfa,_0x141e4a){return function(_0x14a1a4){if(_0x14a1a4){var _0xe4c9a=typeof _0x141e4a[_0xb9ea('0x1a')]==='undefined'&&typeof _0x141e4a['limit']===_0xb9ea('0x1b');var _0x315c8b=_0x14a1a4[_0xb9ea('0x1c')];var _0x55577c=_0xe4c9a?0x0:_0x141e4a[_0xb9ea('0x1a')];var _0x4151c7=_0xe4c9a?_0x14a1a4[_0xb9ea('0x1c')]:_0x141e4a[_0xb9ea('0x1a')]+_0x141e4a[_0xb9ea('0x1d')];var _0x56bdb5;if(_0x4151c7>=_0x315c8b){_0x4151c7=_0x315c8b;_0x56bdb5=0xc8;}else{_0x56bdb5=0xce;}_0x37abfa[_0xb9ea('0x18')](_0x56bdb5);return _0x37abfa[_0xb9ea('0x1e')](_0xb9ea('0x1f'),_0x55577c+'-'+_0x4151c7+'/'+_0x315c8b)['json'](_0x14a1a4);}return null;};}function patchUpdates(_0x2c8e19){return function(_0x4132a6){try{jsonpatch[_0xb9ea('0x20')](_0x4132a6,_0x2c8e19,!![]);}catch(_0x1013dd){return BPromise['reject'](_0x1013dd);}return _0x4132a6[_0xb9ea('0x21')]();};}function saveUpdates(_0x4a15f0,_0x49ac52){return function(_0x33e9a2){if(_0x33e9a2){return _0x33e9a2[_0xb9ea('0x22')](_0x4a15f0)[_0xb9ea('0x23')](function(_0x5975c2){return _0x5975c2;});}return null;};}function removeEntity(_0x2f46c2,_0x17f2cf){return function(_0x266145){if(_0x266145){return _0x266145['destroy']()[_0xb9ea('0x23')](function(){_0x2f46c2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e4eb5,_0x30696){return function(_0x3930c3){if(!_0x3930c3){_0x4e4eb5[_0xb9ea('0x17')](0x194);}return _0x3930c3;};}function handleError(_0x35166f,_0x18757e){_0x18757e=_0x18757e||0x1f4;return function(_0x548788){logger[_0xb9ea('0x24')](_0x548788['stack']);if(_0x548788['name']){delete _0x548788[_0xb9ea('0x25')];}_0x35166f['status'](_0x18757e)[_0xb9ea('0x26')](_0x548788);};}exports[_0xb9ea('0x27')]=function(_0x5caf21,_0x4def01){var _0x4e3813={},_0x46ea40={},_0x267425={'count':0x0,'rows':[]};var _0x3002a3=_[_0xb9ea('0x28')](db['JscriptyQuestionReport'][_0xb9ea('0x29')],function(_0xab3039){return{'name':_0xab3039[_0xb9ea('0x2a')],'type':_0xab3039[_0xb9ea('0x2b')][_0xb9ea('0x2c')]};});_0x46ea40['model']=_['map'](_0x3002a3,_0xb9ea('0x25'));_0x46ea40[_0xb9ea('0x2d')]=_['keys'](_0x5caf21[_0xb9ea('0x2d')]);_0x46ea40['filters']=_[_0xb9ea('0x2e')](_0x46ea40[_0xb9ea('0x2f')],_0x46ea40[_0xb9ea('0x2d')]);_0x4e3813[_0xb9ea('0x30')]=_[_0xb9ea('0x2e')](_0x46ea40[_0xb9ea('0x2f')],qs[_0xb9ea('0x31')](_0x5caf21['query'][_0xb9ea('0x31')]));_0x4e3813['attributes']=_0x4e3813[_0xb9ea('0x30')]['length']?_0x4e3813[_0xb9ea('0x30')]:_0x46ea40[_0xb9ea('0x2f')];if(!_0x5caf21[_0xb9ea('0x2d')][_0xb9ea('0x32')](_0xb9ea('0x33'))){_0x4e3813[_0xb9ea('0x1d')]=qs['limit'](_0x5caf21[_0xb9ea('0x2d')][_0xb9ea('0x1d')]);_0x4e3813['offset']=qs[_0xb9ea('0x1a')](_0x5caf21['query']['offset']);}_0x4e3813[_0xb9ea('0x34')]=qs['sort'](_0x5caf21[_0xb9ea('0x2d')][_0xb9ea('0x35')]);_0x4e3813['where']=qs[_0xb9ea('0x36')](_[_0xb9ea('0x37')](_0x5caf21[_0xb9ea('0x2d')],_0x46ea40['filters']),_0x3002a3);if(_0x5caf21[_0xb9ea('0x2d')]['filter']){_0x4e3813[_0xb9ea('0x38')]=_[_0xb9ea('0x39')](_0x4e3813[_0xb9ea('0x38')],{'$or':_[_0xb9ea('0x28')](_0x3002a3,function(_0x550b5e){if(_0x550b5e['type']!==_0xb9ea('0x3a')){var _0x2b3cf6={};_0x2b3cf6[_0x550b5e['name']]={'$like':'%'+_0x5caf21[_0xb9ea('0x2d')][_0xb9ea('0x3b')]+'%'};return _0x2b3cf6;}})});}_0x4e3813=_[_0xb9ea('0x39')]({},_0x4e3813,_0x5caf21[_0xb9ea('0x3c')]);var _0x31a58a={'where':_0x4e3813['where']};return db[_0xb9ea('0x3d')][_0xb9ea('0x1c')](_0x31a58a)['then'](function(_0x30551c){_0x267425[_0xb9ea('0x1c')]=_0x30551c;if(_0x5caf21[_0xb9ea('0x2d')]['includeAll']){_0x4e3813[_0xb9ea('0x3e')]=[{'all':!![]}];}return db[_0xb9ea('0x3d')][_0xb9ea('0x3f')](_0x4e3813);})[_0xb9ea('0x23')](function(_0x445ba5){_0x267425[_0xb9ea('0x40')]=_0x445ba5;return _0x267425;})[_0xb9ea('0x23')](respondWithFilteredResult(_0x4def01,_0x4e3813))[_0xb9ea('0x41')](handleError(_0x4def01,null));};exports[_0xb9ea('0x42')]=function(_0x1d31c0,_0x28ca17){var _0x684c44={'raw':!![],'where':{'id':_0x1d31c0[_0xb9ea('0x43')]['id']}},_0x462471={};_0x462471[_0xb9ea('0x2f')]=_[_0xb9ea('0x44')](db['JscriptyQuestionReport']['rawAttributes']);_0x462471[_0xb9ea('0x2d')]=_[_0xb9ea('0x44')](_0x1d31c0[_0xb9ea('0x2d')]);_0x462471[_0xb9ea('0x36')]=_[_0xb9ea('0x2e')](_0x462471[_0xb9ea('0x2f')],_0x462471[_0xb9ea('0x2d')]);_0x684c44[_0xb9ea('0x30')]=_[_0xb9ea('0x2e')](_0x462471[_0xb9ea('0x2f')],qs['fields'](_0x1d31c0[_0xb9ea('0x2d')][_0xb9ea('0x31')]));_0x684c44['attributes']=_0x684c44['attributes'][_0xb9ea('0x45')]?_0x684c44['attributes']:_0x462471[_0xb9ea('0x2f')];if(_0x1d31c0[_0xb9ea('0x2d')][_0xb9ea('0x46')]){_0x684c44[_0xb9ea('0x3e')]=[{'all':!![]}];}_0x684c44=_['merge']({},_0x684c44,_0x1d31c0[_0xb9ea('0x3c')]);return db[_0xb9ea('0x3d')][_0xb9ea('0x47')](_0x684c44)[_0xb9ea('0x23')](handleEntityNotFound(_0x28ca17,null))[_0xb9ea('0x23')](respondWithResult(_0x28ca17,null))['catch'](handleError(_0x28ca17,null));};exports[_0xb9ea('0x48')]=function(_0x846f9a,_0x1a7837){return db[_0xb9ea('0x3d')][_0xb9ea('0x48')](_0x846f9a[_0xb9ea('0x49')],{})[_0xb9ea('0x23')](respondWithResult(_0x1a7837,0xc9))[_0xb9ea('0x41')](handleError(_0x1a7837,null));};exports[_0xb9ea('0x22')]=function(_0x4dff01,_0x2aa437){if(_0x4dff01[_0xb9ea('0x49')]['id']){delete _0x4dff01[_0xb9ea('0x49')]['id'];}return db[_0xb9ea('0x3d')]['find']({'where':{'id':_0x4dff01['params']['id']}})[_0xb9ea('0x23')](handleEntityNotFound(_0x2aa437,null))[_0xb9ea('0x23')](saveUpdates(_0x4dff01['body'],null))['then'](respondWithResult(_0x2aa437,null))['catch'](handleError(_0x2aa437,null));};exports[_0xb9ea('0x4a')]=function(_0x4ce138,_0x13ea34){return db[_0xb9ea('0x3d')][_0xb9ea('0x47')]({'where':{'id':_0x4ce138[_0xb9ea('0x43')]['id']}})['then'](handleEntityNotFound(_0x13ea34,null))[_0xb9ea('0x23')](removeEntity(_0x13ea34,null))['catch'](handleError(_0x13ea34,null));};exports[_0xb9ea('0x4b')]=function(_0xe55929,_0x5e6643){return db[_0xb9ea('0x3d')][_0xb9ea('0x4b')]()['then'](respondWithResult(_0x5e6643,null))['catch'](handleError(_0x5e6643,null));};
\ No newline at end of file
+var _0x28dc=['sendStatus','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','name','status','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','JscriptyQuestionReport','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x31ec7f,_0x46ee86){var _0x26514c=function(_0xcef095){while(--_0xcef095){_0x31ec7f['push'](_0x31ec7f['shift']());}};_0x26514c(++_0x46ee86);}(_0x28dc,0x1a2));var _0xc28d=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0x28dc[_0x424357];return _0x29c68e;};'use strict';var emlformat=require(_0xc28d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc28d('0x1'));var jsonpatch=require(_0xc28d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc28d('0x3'));var path=require('path');var sox=require(_0xc28d('0x4'));var csv=require(_0xc28d('0x5'));var ejs=require(_0xc28d('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc28d('0x7'));var squel=require('squel');var crypto=require(_0xc28d('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xc28d('0x9'));var toCsv=require(_0xc28d('0x5'));var querystring=require(_0xc28d('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc28d('0xb'));var as=require(_0xc28d('0xc'));var hardwareService=require(_0xc28d('0xd'));var logger=require(_0xc28d('0xe'))(_0xc28d('0xf'));var utils=require(_0xc28d('0x10'));var config=require(_0xc28d('0x11'));var licenseUtil=require(_0xc28d('0x12'));var db=require(_0xc28d('0x13'))['db'];function respondWithStatusCode(_0xc4e051,_0x5d3c85){_0x5d3c85=_0x5d3c85||0xcc;return function(_0x54316a){if(_0x54316a){return _0xc4e051[_0xc28d('0x14')](_0x5d3c85);}return _0xc4e051['status'](_0x5d3c85)[_0xc28d('0x15')]();};}function respondWithResult(_0x1bc402,_0x379016){_0x379016=_0x379016||0xc8;return function(_0x1665b5){if(_0x1665b5){return _0x1bc402['status'](_0x379016)[_0xc28d('0x16')](_0x1665b5);}};}function respondWithFilteredResult(_0x599a87,_0x3e2642){return function(_0xdd3888){if(_0xdd3888){var _0x41c443=typeof _0x3e2642[_0xc28d('0x17')]===_0xc28d('0x18')&&typeof _0x3e2642[_0xc28d('0x19')]==='undefined';var _0x347187=_0xdd3888[_0xc28d('0x1a')];var _0x16bc71=_0x41c443?0x0:_0x3e2642[_0xc28d('0x17')];var _0x5c9d27=_0x41c443?_0xdd3888[_0xc28d('0x1a')]:_0x3e2642[_0xc28d('0x17')]+_0x3e2642[_0xc28d('0x19')];var _0x1f0c44;if(_0x5c9d27>=_0x347187){_0x5c9d27=_0x347187;_0x1f0c44=0xc8;}else{_0x1f0c44=0xce;}_0x599a87['status'](_0x1f0c44);return _0x599a87['set'](_0xc28d('0x1b'),_0x16bc71+'-'+_0x5c9d27+'/'+_0x347187)[_0xc28d('0x16')](_0xdd3888);}return null;};}function patchUpdates(_0x49f651){return function(_0x1adcae){try{jsonpatch[_0xc28d('0x1c')](_0x1adcae,_0x49f651,!![]);}catch(_0xa30db8){return BPromise['reject'](_0xa30db8);}return _0x1adcae[_0xc28d('0x1d')]();};}function saveUpdates(_0x2c480f,_0x597d78){return function(_0x3b52de){if(_0x3b52de){return _0x3b52de[_0xc28d('0x1e')](_0x2c480f)['then'](function(_0x124171){return _0x124171;});}return null;};}function removeEntity(_0x347be7,_0x6ff98f){return function(_0x5afdaa){if(_0x5afdaa){return _0x5afdaa[_0xc28d('0x1f')]()[_0xc28d('0x20')](function(){_0x347be7['status'](0xcc)[_0xc28d('0x15')]();});}};}function handleEntityNotFound(_0x938837,_0x32c69e){return function(_0x1a829b){if(!_0x1a829b){_0x938837['sendStatus'](0x194);}return _0x1a829b;};}function handleError(_0x4a15a5,_0x5b1519){_0x5b1519=_0x5b1519||0x1f4;return function(_0x432484){logger[_0xc28d('0x21')](_0x432484[_0xc28d('0x22')]);if(_0x432484[_0xc28d('0x23')]){delete _0x432484[_0xc28d('0x23')];}_0x4a15a5[_0xc28d('0x24')](_0x5b1519)[_0xc28d('0x25')](_0x432484);};}exports[_0xc28d('0x26')]=function(_0x208d74,_0x17af22){var _0x1e231b={},_0x5076a5={},_0x4d403a={'count':0x0,'rows':[]};var _0x36856f=_[_0xc28d('0x27')](db['JscriptyQuestionReport'][_0xc28d('0x28')],function(_0x3bda13){return{'name':_0x3bda13[_0xc28d('0x29')],'type':_0x3bda13[_0xc28d('0x2a')][_0xc28d('0x2b')]};});_0x5076a5[_0xc28d('0x2c')]=_[_0xc28d('0x27')](_0x36856f,'name');_0x5076a5[_0xc28d('0x2d')]=_[_0xc28d('0x2e')](_0x208d74[_0xc28d('0x2d')]);_0x5076a5[_0xc28d('0x2f')]=_[_0xc28d('0x30')](_0x5076a5[_0xc28d('0x2c')],_0x5076a5['query']);_0x1e231b[_0xc28d('0x31')]=_[_0xc28d('0x30')](_0x5076a5[_0xc28d('0x2c')],qs[_0xc28d('0x32')](_0x208d74['query'][_0xc28d('0x32')]));_0x1e231b[_0xc28d('0x31')]=_0x1e231b[_0xc28d('0x31')][_0xc28d('0x33')]?_0x1e231b['attributes']:_0x5076a5[_0xc28d('0x2c')];if(!_0x208d74[_0xc28d('0x2d')][_0xc28d('0x34')](_0xc28d('0x35'))){_0x1e231b[_0xc28d('0x19')]=qs[_0xc28d('0x19')](_0x208d74[_0xc28d('0x2d')]['limit']);_0x1e231b[_0xc28d('0x17')]=qs[_0xc28d('0x17')](_0x208d74[_0xc28d('0x2d')][_0xc28d('0x17')]);}_0x1e231b[_0xc28d('0x36')]=qs['sort'](_0x208d74[_0xc28d('0x2d')][_0xc28d('0x37')]);_0x1e231b[_0xc28d('0x38')]=qs['filters'](_[_0xc28d('0x39')](_0x208d74['query'],_0x5076a5[_0xc28d('0x2f')]),_0x36856f);if(_0x208d74[_0xc28d('0x2d')]['filter']){_0x1e231b['where']=_[_0xc28d('0x3a')](_0x1e231b[_0xc28d('0x38')],{'$or':_[_0xc28d('0x27')](_0x36856f,function(_0x3fd105){if(_0x3fd105[_0xc28d('0x2a')]!=='VIRTUAL'){var _0x1f164e={};_0x1f164e[_0x3fd105[_0xc28d('0x23')]]={'$like':'%'+_0x208d74[_0xc28d('0x2d')][_0xc28d('0x3b')]+'%'};return _0x1f164e;}})});}_0x1e231b=_['merge']({},_0x1e231b,_0x208d74['options']);var _0x2353ef={'where':_0x1e231b[_0xc28d('0x38')]};return db[_0xc28d('0x3c')][_0xc28d('0x1a')](_0x2353ef)[_0xc28d('0x20')](function(_0x4dd639){_0x4d403a['count']=_0x4dd639;if(_0x208d74[_0xc28d('0x2d')][_0xc28d('0x3d')]){_0x1e231b[_0xc28d('0x3e')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xc28d('0x3f')](_0x1e231b);})[_0xc28d('0x20')](function(_0x497f27){_0x4d403a[_0xc28d('0x40')]=_0x497f27;return _0x4d403a;})['then'](respondWithFilteredResult(_0x17af22,_0x1e231b))[_0xc28d('0x41')](handleError(_0x17af22,null));};exports[_0xc28d('0x42')]=function(_0x511a7f,_0x1d1890){var _0x84c4f6={'raw':!![],'where':{'id':_0x511a7f[_0xc28d('0x43')]['id']}},_0x2e6cc7={};_0x2e6cc7['model']=_['keys'](db[_0xc28d('0x3c')][_0xc28d('0x28')]);_0x2e6cc7[_0xc28d('0x2d')]=_['keys'](_0x511a7f[_0xc28d('0x2d')]);_0x2e6cc7[_0xc28d('0x2f')]=_[_0xc28d('0x30')](_0x2e6cc7['model'],_0x2e6cc7[_0xc28d('0x2d')]);_0x84c4f6[_0xc28d('0x31')]=_[_0xc28d('0x30')](_0x2e6cc7[_0xc28d('0x2c')],qs[_0xc28d('0x32')](_0x511a7f[_0xc28d('0x2d')][_0xc28d('0x32')]));_0x84c4f6[_0xc28d('0x31')]=_0x84c4f6[_0xc28d('0x31')][_0xc28d('0x33')]?_0x84c4f6[_0xc28d('0x31')]:_0x2e6cc7['model'];if(_0x511a7f[_0xc28d('0x2d')][_0xc28d('0x3d')]){_0x84c4f6[_0xc28d('0x3e')]=[{'all':!![]}];}_0x84c4f6=_['merge']({},_0x84c4f6,_0x511a7f[_0xc28d('0x44')]);return db[_0xc28d('0x3c')][_0xc28d('0x45')](_0x84c4f6)[_0xc28d('0x20')](handleEntityNotFound(_0x1d1890,null))[_0xc28d('0x20')](respondWithResult(_0x1d1890,null))[_0xc28d('0x41')](handleError(_0x1d1890,null));};exports[_0xc28d('0x46')]=function(_0x32b6e6,_0x49df1a){return db[_0xc28d('0x3c')][_0xc28d('0x46')](_0x32b6e6[_0xc28d('0x47')],{})[_0xc28d('0x20')](respondWithResult(_0x49df1a,0xc9))['catch'](handleError(_0x49df1a,null));};exports[_0xc28d('0x1e')]=function(_0x1662b0,_0x49d488){if(_0x1662b0[_0xc28d('0x47')]['id']){delete _0x1662b0[_0xc28d('0x47')]['id'];}return db['JscriptyQuestionReport'][_0xc28d('0x45')]({'where':{'id':_0x1662b0[_0xc28d('0x43')]['id']}})[_0xc28d('0x20')](handleEntityNotFound(_0x49d488,null))['then'](saveUpdates(_0x1662b0['body'],null))[_0xc28d('0x20')](respondWithResult(_0x49d488,null))[_0xc28d('0x41')](handleError(_0x49d488,null));};exports[_0xc28d('0x1f')]=function(_0x4a7464,_0x2cafb6){return db['JscriptyQuestionReport'][_0xc28d('0x45')]({'where':{'id':_0x4a7464[_0xc28d('0x43')]['id']}})['then'](handleEntityNotFound(_0x2cafb6,null))[_0xc28d('0x20')](removeEntity(_0x2cafb6,null))[_0xc28d('0x41')](handleError(_0x2cafb6,null));};exports[_0xc28d('0x48')]=function(_0x17d571,_0x16abc5){return db[_0xc28d('0x3c')][_0xc28d('0x48')]()[_0xc28d('0x20')](respondWithResult(_0x16abc5,null))[_0xc28d('0x41')](handleError(_0x16abc5,null));};
\ No newline at end of file
index 30144e4..ec2328d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e05=['exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1e05,0x13c));var _0x51e0=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0x1e05[_0x2aee2f];return _0x19337f;};'use strict';var _=require(_0x51e0('0x0'));var util=require('util');var logger=require(_0x51e0('0x1'))(_0x51e0('0x2'));var moment=require(_0x51e0('0x3'));var BPromise=require('bluebird');var rp=require(_0x51e0('0x4'));var fs=require('fs');var path=require(_0x51e0('0x5'));var rimraf=require(_0x51e0('0x6'));var config=require(_0x51e0('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x51e0('0x8')]=function(_0x42d2ee,_0x245333){return _0x42d2ee[_0x51e0('0x9')](_0x51e0('0xa'),attributes,{'tableName':_0x51e0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c83=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c83,0x19c));var _0x35c8=function(_0xe2ebaa,_0x138483){_0xe2ebaa=_0xe2ebaa-0x0;var _0x563838=_0x5c83[_0xe2ebaa];return _0x563838;};'use strict';var _=require(_0x35c8('0x0'));var util=require(_0x35c8('0x1'));var logger=require(_0x35c8('0x2'))(_0x35c8('0x3'));var moment=require(_0x35c8('0x4'));var BPromise=require(_0x35c8('0x5'));var rp=require(_0x35c8('0x6'));var fs=require('fs');var path=require(_0x35c8('0x7'));var rimraf=require(_0x35c8('0x8'));var config=require(_0x35c8('0x9'));var attributes=require(_0x35c8('0xa'));module['exports']=function(_0x2b6197,_0x4414ca){return _0x2b6197['define'](_0x35c8('0xb'),attributes,{'tableName':_0x35c8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 77e631a..4c85e5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b07=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x3c1312,_0x45bfdb){var _0x5b4831=function(_0x53706f){while(--_0x53706f){_0x3c1312['push'](_0x3c1312['shift']());}};_0x5b4831(++_0x45bfdb);}(_0x4b07,0x182));var _0x74b0=function(_0x4ce2d1,_0x4a80f5){_0x4ce2d1=_0x4ce2d1-0x0;var _0x4e5335=_0x4b07[_0x4ce2d1];return _0x4e5335;};'use strict';var _=require(_0x74b0('0x0'));var util=require('util');var moment=require(_0x74b0('0x1'));var BPromise=require(_0x74b0('0x2'));var rs=require(_0x74b0('0x3'));var fs=require('fs');var Redis=require(_0x74b0('0x4'));var db=require(_0x74b0('0x5'))['db'];var utils=require(_0x74b0('0x6'));var logger=require(_0x74b0('0x7'))(_0x74b0('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x74b0('0x9')][_0x74b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bbbbd,_0x409e8d,_0x51199c){return new BPromise(function(_0x1140b8,_0x19cc7b){return client[_0x74b0('0xb')](_0x5bbbbd,_0x51199c)[_0x74b0('0xc')](function(_0x15a726){logger[_0x74b0('0xd')](_0x74b0('0xe'),_0x409e8d,'request\x20sent');logger[_0x74b0('0xf')](_0x74b0('0x10'),_0x409e8d,_0x74b0('0x11'),JSON[_0x74b0('0x12')](_0x15a726));if(_0x15a726[_0x74b0('0x13')]){if(_0x15a726[_0x74b0('0x13')][_0x74b0('0x14')]===0x1f4){logger['error'](_0x74b0('0xe'),_0x409e8d,_0x15a726[_0x74b0('0x13')][_0x74b0('0x15')]);return _0x19cc7b(_0x15a726[_0x74b0('0x13')]['message']);}logger[_0x74b0('0x13')](_0x74b0('0xe'),_0x409e8d,_0x15a726[_0x74b0('0x13')][_0x74b0('0x15')]);return _0x1140b8(_0x15a726[_0x74b0('0x13')][_0x74b0('0x15')]);}else{logger[_0x74b0('0xd')](_0x74b0('0xe'),_0x409e8d,_0x74b0('0x11'));_0x1140b8(_0x15a726['result'][_0x74b0('0x15')]);}})[_0x74b0('0x16')](function(_0x5956ea){logger['error'](_0x74b0('0xe'),_0x409e8d,_0x5956ea);_0x19cc7b(_0x5956ea);});});}
\ No newline at end of file
+var _0x94af=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x4d497b,_0x5df5e6){var _0x3f589f=function(_0x20de83){while(--_0x20de83){_0x4d497b['push'](_0x4d497b['shift']());}};_0x3f589f(++_0x5df5e6);}(_0x94af,0x6f));var _0xf94a=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x94af[_0x37bd26];return _0xe83dc4;};'use strict';var _=require('lodash');var util=require(_0xf94a('0x0'));var moment=require(_0xf94a('0x1'));var BPromise=require(_0xf94a('0x2'));var rs=require(_0xf94a('0x3'));var fs=require('fs');var Redis=require(_0xf94a('0x4'));var db=require(_0xf94a('0x5'))['db'];var utils=require(_0xf94a('0x6'));var logger=require(_0xf94a('0x7'))(_0xf94a('0x8'));var config=require(_0xf94a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf94a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5125df,_0xd1eb5,_0x2363e0){return new BPromise(function(_0x5325b0,_0x1c78ee){return client[_0xf94a('0xb')](_0x5125df,_0x2363e0)[_0xf94a('0xc')](function(_0x31d210){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0xd1eb5,_0xf94a('0xd'));logger[_0xf94a('0xe')](_0xf94a('0xf'),_0xd1eb5,_0xf94a('0xd'),JSON[_0xf94a('0x10')](_0x31d210));if(_0x31d210[_0xf94a('0x11')]){if(_0x31d210[_0xf94a('0x11')][_0xf94a('0x12')]===0x1f4){logger[_0xf94a('0x11')](_0xf94a('0x13'),_0xd1eb5,_0x31d210[_0xf94a('0x11')]['message']);return _0x1c78ee(_0x31d210[_0xf94a('0x11')]['message']);}logger[_0xf94a('0x11')](_0xf94a('0x13'),_0xd1eb5,_0x31d210['error'][_0xf94a('0x14')]);return _0x5325b0(_0x31d210[_0xf94a('0x11')]['message']);}else{logger['info'](_0xf94a('0x13'),_0xd1eb5,_0xf94a('0xd'));_0x5325b0(_0x31d210[_0xf94a('0x15')][_0xf94a('0x14')]);}})[_0xf94a('0x16')](function(_0x4d7a75){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0xd1eb5,_0x4d7a75);_0x1c78ee(_0x4d7a75);});});}
\ No newline at end of file
index f9aa845..66678c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49e2=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','isAuthenticated','index','/describe','describe','/:id','getQuestions','post','create','put','update','delete','destroy','util','path'];(function(_0x258f15,_0x329f04){var _0x20b52f=function(_0x535f6f){while(--_0x535f6f){_0x258f15['push'](_0x258f15['shift']());}};_0x20b52f(++_0x329f04);}(_0x49e2,0x167));var _0x249e=function(_0x532e9e,_0x1faf95){_0x532e9e=_0x532e9e-0x0;var _0x4fa54f=_0x49e2[_0x532e9e];return _0x4fa54f;};'use strict';var multer=require('multer');var util=require(_0x249e('0x0'));var path=require(_0x249e('0x1'));var timeout=require(_0x249e('0x2'));var express=require('express');var router=express[_0x249e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x249e('0x4'));var interaction=require(_0x249e('0x5'));var config=require('../../config/environment');var controller=require(_0x249e('0x6'));router['get']('/',auth[_0x249e('0x7')](),controller[_0x249e('0x8')]);router['get'](_0x249e('0x9'),auth[_0x249e('0x7')](),controller[_0x249e('0xa')]);router['get'](_0x249e('0xb'),auth[_0x249e('0x7')](),controller['show']);router['get']('/:id/questions',auth[_0x249e('0x7')](),controller[_0x249e('0xc')]);router[_0x249e('0xd')]('/',auth[_0x249e('0x7')](),controller[_0x249e('0xe')]);router[_0x249e('0xf')](_0x249e('0xb'),auth[_0x249e('0x7')](),controller[_0x249e('0x10')]);router[_0x249e('0x11')]('/:id',auth[_0x249e('0x7')](),controller[_0x249e('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x2ef4=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','get','describe','/:id','show','getQuestions','post','create','put','update','delete','destroy','multer'];(function(_0x4f7d49,_0xf87749){var _0x27f42b=function(_0x10689e){while(--_0x10689e){_0x4f7d49['push'](_0x4f7d49['shift']());}};_0x27f42b(++_0xf87749);}(_0x2ef4,0xbc));var _0x42ef=function(_0x54b920,_0xebf431){_0x54b920=_0x54b920-0x0;var _0x13c5b1=_0x2ef4[_0x54b920];return _0x13c5b1;};'use strict';var multer=require(_0x42ef('0x0'));var util=require(_0x42ef('0x1'));var path=require(_0x42ef('0x2'));var timeout=require(_0x42ef('0x3'));var express=require(_0x42ef('0x4'));var router=express[_0x42ef('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x42ef('0x6'));var config=require(_0x42ef('0x7'));var controller=require(_0x42ef('0x8'));router['get']('/',auth[_0x42ef('0x9')](),controller['index']);router[_0x42ef('0xa')]('/describe',auth[_0x42ef('0x9')](),controller[_0x42ef('0xb')]);router[_0x42ef('0xa')](_0x42ef('0xc'),auth[_0x42ef('0x9')](),controller[_0x42ef('0xd')]);router[_0x42ef('0xa')]('/:id/questions',auth[_0x42ef('0x9')](),controller[_0x42ef('0xe')]);router[_0x42ef('0xf')]('/',auth[_0x42ef('0x9')](),controller[_0x42ef('0x10')]);router[_0x42ef('0x11')]('/:id',auth[_0x42ef('0x9')](),controller[_0x42ef('0x12')]);router[_0x42ef('0x13')](_0x42ef('0xc'),auth[_0x42ef('0x9')](),controller[_0x42ef('0x14')]);module['exports']=router;
\ No newline at end of file
index 17d795f..e7734d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdd4=['DATE','starttime','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','exports'];(function(_0x2b220d,_0x4e0e6d){var _0x3db40f=function(_0xad88dc){while(--_0xad88dc){_0x2b220d['push'](_0x2b220d['shift']());}};_0x3db40f(++_0x4e0e6d);}(_0xbdd4,0xe6));var _0x4bdd=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xbdd4[_0x491a7f];return _0x3d8f44;};'use strict';var moment=require(_0x4bdd('0x0'));var Sequelize=require('sequelize');module[_0x4bdd('0x1')]={'starttime':{'type':Sequelize[_0x4bdd('0x2')],'set':function(_0x45d766){this['setDataValue'](_0x4bdd('0x3'),_0x45d766);this[_0x4bdd('0x4')](_0x4bdd('0x5'),moment()['format'](_0x4bdd('0x6')));}},'endtime':{'type':Sequelize[_0x4bdd('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x4bdd('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4bdd('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xd8dc=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize','exports','DATE','setDataValue'];(function(_0x5a0d5d,_0x461b11){var _0x3a0aa5=function(_0x3e6820){while(--_0x3e6820){_0x5a0d5d['push'](_0x5a0d5d['shift']());}};_0x3a0aa5(++_0x461b11);}(_0xd8dc,0x1f0));var _0xcd8d=function(_0x31a37b,_0x826249){_0x31a37b=_0x31a37b-0x0;var _0x49ae16=_0xd8dc[_0x31a37b];return _0x49ae16;};'use strict';var moment=require('moment');var Sequelize=require(_0xcd8d('0x0'));module[_0xcd8d('0x1')]={'starttime':{'type':Sequelize[_0xcd8d('0x2')],'set':function(_0x3e4cac){this[_0xcd8d('0x3')](_0xcd8d('0x4'),_0x3e4cac);this['setDataValue'](_0xcd8d('0x5'),moment()[_0xcd8d('0x6')](_0xcd8d('0x7')));}},'endtime':{'type':Sequelize[_0xcd8d('0x2')]},'membername':{'type':Sequelize[_0xcd8d('0x8')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xcd8d('0x8')]},'uniqueid':{'type':Sequelize[_0xcd8d('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xcd8d('0x8')]},'completed':{'type':Sequelize[_0xcd8d('0x9')],'defaultValue':![]}};
\ No newline at end of file
index 3eb9d78..127ed7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1825=['stack','name','status','send','map','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','merge','options','JscriptySessionReport','includeAll','findAll','rows','catch','show','params','keys','include','find','create','update','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','error'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x1825,0xca));var _0x5182=function(_0x5f29a3,_0x26344b){_0x5f29a3=_0x5f29a3-0x0;var _0x338324=_0x1825[_0x5f29a3];return _0x338324;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5182('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5182('0x1'));var rp=require('request-promise');var moment=require(_0x5182('0x2'));var BPromise=require(_0x5182('0x3'));var Mustache=require(_0x5182('0x4'));var util=require(_0x5182('0x5'));var path=require(_0x5182('0x6'));var sox=require('sox');var csv=require(_0x5182('0x7'));var ejs=require(_0x5182('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5182('0x9'));var squel=require(_0x5182('0xa'));var crypto=require('crypto');var jsforce=require(_0x5182('0xb'));var deskjs=require(_0x5182('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5182('0xd'));var Papa=require(_0x5182('0xe'));var Redis=require(_0x5182('0xf'));var authService=require(_0x5182('0x10'));var qs=require(_0x5182('0x11'));var as=require(_0x5182('0x12'));var hardwareService=require(_0x5182('0x13'));var logger=require(_0x5182('0x14'))(_0x5182('0x15'));var utils=require(_0x5182('0x16'));var config=require(_0x5182('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xde74ac,_0x54b770){_0x54b770=_0x54b770||0xcc;return function(_0x13b210){if(_0x13b210){return _0xde74ac[_0x5182('0x18')](_0x54b770);}return _0xde74ac['status'](_0x54b770)[_0x5182('0x19')]();};}function respondWithResult(_0x3a0ad2,_0x75b614){_0x75b614=_0x75b614||0xc8;return function(_0x261a0a){if(_0x261a0a){return _0x3a0ad2['status'](_0x75b614)[_0x5182('0x1a')](_0x261a0a);}};}function respondWithFilteredResult(_0x1538fc,_0x3c9566){return function(_0x56c3af){if(_0x56c3af){var _0x4d2ff5=typeof _0x3c9566['offset']===_0x5182('0x1b')&&typeof _0x3c9566[_0x5182('0x1c')]==='undefined';var _0x220ab5=_0x56c3af[_0x5182('0x1d')];var _0x17d2a7=_0x4d2ff5?0x0:_0x3c9566[_0x5182('0x1e')];var _0xbde042=_0x4d2ff5?_0x56c3af[_0x5182('0x1d')]:_0x3c9566['offset']+_0x3c9566[_0x5182('0x1c')];var _0x40ce65;if(_0xbde042>=_0x220ab5){_0xbde042=_0x220ab5;_0x40ce65=0xc8;}else{_0x40ce65=0xce;}_0x1538fc['status'](_0x40ce65);return _0x1538fc[_0x5182('0x1f')](_0x5182('0x20'),_0x17d2a7+'-'+_0xbde042+'/'+_0x220ab5)[_0x5182('0x1a')](_0x56c3af);}return null;};}function patchUpdates(_0x10088a){return function(_0x14a057){try{jsonpatch['apply'](_0x14a057,_0x10088a,!![]);}catch(_0x1e5729){return BPromise[_0x5182('0x21')](_0x1e5729);}return _0x14a057[_0x5182('0x22')]();};}function saveUpdates(_0x49a7b3,_0x2f5f08){return function(_0x1d49cf){if(_0x1d49cf){return _0x1d49cf['update'](_0x49a7b3)[_0x5182('0x23')](function(_0x373f01){return _0x373f01;});}return null;};}function removeEntity(_0x4a8a8d,_0x564053){return function(_0x5f46af){if(_0x5f46af){return _0x5f46af[_0x5182('0x24')]()['then'](function(){_0x4a8a8d['status'](0xcc)[_0x5182('0x19')]();});}};}function handleEntityNotFound(_0x52e4c7,_0x36b7c2){return function(_0x157dcd){if(!_0x157dcd){_0x52e4c7[_0x5182('0x18')](0x194);}return _0x157dcd;};}function handleError(_0x4d3080,_0x2ee756){_0x2ee756=_0x2ee756||0x1f4;return function(_0x251b8e){logger[_0x5182('0x25')](_0x251b8e[_0x5182('0x26')]);if(_0x251b8e[_0x5182('0x27')]){delete _0x251b8e[_0x5182('0x27')];}_0x4d3080[_0x5182('0x28')](_0x2ee756)[_0x5182('0x29')](_0x251b8e);};}exports['index']=function(_0x84e38f,_0x2dce2b){var _0x3f3a45={},_0x432e20={},_0x527bbf={'count':0x0,'rows':[]};var _0x475fba=_[_0x5182('0x2a')](db['JscriptySessionReport'][_0x5182('0x2b')],function(_0x40db34){return{'name':_0x40db34['fieldName'],'type':_0x40db34[_0x5182('0x2c')][_0x5182('0x2d')]};});_0x432e20[_0x5182('0x2e')]=_['map'](_0x475fba,_0x5182('0x27'));_0x432e20[_0x5182('0x2f')]=_['keys'](_0x84e38f[_0x5182('0x2f')]);_0x432e20['filters']=_[_0x5182('0x30')](_0x432e20['model'],_0x432e20[_0x5182('0x2f')]);_0x3f3a45[_0x5182('0x31')]=_[_0x5182('0x30')](_0x432e20[_0x5182('0x2e')],qs[_0x5182('0x32')](_0x84e38f[_0x5182('0x2f')][_0x5182('0x32')]));_0x3f3a45[_0x5182('0x31')]=_0x3f3a45['attributes'][_0x5182('0x33')]?_0x3f3a45['attributes']:_0x432e20[_0x5182('0x2e')];if(!_0x84e38f['query'][_0x5182('0x34')](_0x5182('0x35'))){_0x3f3a45[_0x5182('0x1c')]=qs[_0x5182('0x1c')](_0x84e38f['query'][_0x5182('0x1c')]);_0x3f3a45[_0x5182('0x1e')]=qs['offset'](_0x84e38f[_0x5182('0x2f')]['offset']);}_0x3f3a45[_0x5182('0x36')]=qs[_0x5182('0x37')](_0x84e38f[_0x5182('0x2f')][_0x5182('0x37')]);_0x3f3a45['where']=qs['filters'](_[_0x5182('0x38')](_0x84e38f[_0x5182('0x2f')],_0x432e20[_0x5182('0x39')]),_0x475fba);if(_0x84e38f[_0x5182('0x2f')][_0x5182('0x3a')]){_0x3f3a45[_0x5182('0x3b')]=_['merge'](_0x3f3a45[_0x5182('0x3b')],{'$or':_[_0x5182('0x2a')](_0x475fba,function(_0x297fb2){if(_0x297fb2[_0x5182('0x2c')]!==_0x5182('0x3c')){var _0x564652={};_0x564652[_0x297fb2[_0x5182('0x27')]]={'$like':'%'+_0x84e38f[_0x5182('0x2f')][_0x5182('0x3a')]+'%'};return _0x564652;}})});}_0x3f3a45=_[_0x5182('0x3d')]({},_0x3f3a45,_0x84e38f[_0x5182('0x3e')]);var _0x2dd499={'where':_0x3f3a45[_0x5182('0x3b')]};return db[_0x5182('0x3f')][_0x5182('0x1d')](_0x2dd499)['then'](function(_0x209ac7){_0x527bbf['count']=_0x209ac7;if(_0x84e38f[_0x5182('0x2f')][_0x5182('0x40')]){_0x3f3a45['include']=[{'all':!![]}];}return db[_0x5182('0x3f')][_0x5182('0x41')](_0x3f3a45);})[_0x5182('0x23')](function(_0x22e381){_0x527bbf[_0x5182('0x42')]=_0x22e381;return _0x527bbf;})['then'](respondWithFilteredResult(_0x2dce2b,_0x3f3a45))[_0x5182('0x43')](handleError(_0x2dce2b,null));};exports[_0x5182('0x44')]=function(_0x184e1c,_0x25746b){var _0x5d9f90={'raw':!![],'where':{'id':_0x184e1c[_0x5182('0x45')]['id']}},_0x42186f={};_0x42186f[_0x5182('0x2e')]=_[_0x5182('0x46')](db[_0x5182('0x3f')][_0x5182('0x2b')]);_0x42186f[_0x5182('0x2f')]=_[_0x5182('0x46')](_0x184e1c[_0x5182('0x2f')]);_0x42186f[_0x5182('0x39')]=_[_0x5182('0x30')](_0x42186f['model'],_0x42186f[_0x5182('0x2f')]);_0x5d9f90[_0x5182('0x31')]=_[_0x5182('0x30')](_0x42186f[_0x5182('0x2e')],qs[_0x5182('0x32')](_0x184e1c[_0x5182('0x2f')][_0x5182('0x32')]));_0x5d9f90[_0x5182('0x31')]=_0x5d9f90[_0x5182('0x31')][_0x5182('0x33')]?_0x5d9f90[_0x5182('0x31')]:_0x42186f[_0x5182('0x2e')];if(_0x184e1c[_0x5182('0x2f')][_0x5182('0x40')]){_0x5d9f90[_0x5182('0x47')]=[{'all':!![]}];}_0x5d9f90=_[_0x5182('0x3d')]({},_0x5d9f90,_0x184e1c[_0x5182('0x3e')]);return db[_0x5182('0x3f')][_0x5182('0x48')](_0x5d9f90)[_0x5182('0x23')](handleEntityNotFound(_0x25746b,null))['then'](respondWithResult(_0x25746b,null))[_0x5182('0x43')](handleError(_0x25746b,null));};exports[_0x5182('0x49')]=function(_0x14f06b,_0x408b90){return db[_0x5182('0x3f')][_0x5182('0x49')](_0x14f06b['body'],{})['then'](respondWithResult(_0x408b90,0xc9))['catch'](handleError(_0x408b90,null));};exports[_0x5182('0x4a')]=function(_0x4c23ce,_0x548d0b){if(_0x4c23ce['body']['id']){delete _0x4c23ce['body']['id'];}return db['JscriptySessionReport'][_0x5182('0x48')]({'where':{'id':_0x4c23ce[_0x5182('0x45')]['id']}})[_0x5182('0x23')](handleEntityNotFound(_0x548d0b,null))[_0x5182('0x23')](saveUpdates(_0x4c23ce['body'],null))[_0x5182('0x23')](respondWithResult(_0x548d0b,null))[_0x5182('0x43')](handleError(_0x548d0b,null));};exports[_0x5182('0x24')]=function(_0xcc7015,_0x5861ef){return db['JscriptySessionReport'][_0x5182('0x48')]({'where':{'id':_0xcc7015[_0x5182('0x45')]['id']}})[_0x5182('0x23')](handleEntityNotFound(_0x5861ef,null))[_0x5182('0x23')](removeEntity(_0x5861ef,null))[_0x5182('0x43')](handleError(_0x5861ef,null));};exports[_0x5182('0x4b')]=function(_0x35e9d4,_0x58a290){return db[_0x5182('0x3f')][_0x5182('0x4b')]()[_0x5182('0x23')](respondWithResult(_0x58a290,null))[_0x5182('0x43')](handleError(_0x58a290,null));};exports[_0x5182('0x4c')]=function(_0x59ce3b,_0x3dd2f4,_0x2836ad){var _0x215d75={'raw':!![],'where':{}};var _0x317610={};var _0x5e278a={'count':0x0,'rows':[]};return db[_0x5182('0x3f')][_0x5182('0x4d')]({'where':{'id':_0x59ce3b[_0x5182('0x45')]['id']}})['then'](handleEntityNotFound(_0x3dd2f4,null))[_0x5182('0x23')](function(_0x3bd757){if(_0x3bd757){_0x317610[_0x5182('0x2e')]=_[_0x5182('0x46')](db[_0x5182('0x4e')]['rawAttributes']);_0x317610[_0x5182('0x2f')]=_[_0x5182('0x46')](_0x59ce3b[_0x5182('0x2f')]);_0x317610[_0x5182('0x39')]=_[_0x5182('0x30')](_0x317610[_0x5182('0x2e')],_0x317610[_0x5182('0x2f')]);_0x215d75[_0x5182('0x31')]=_[_0x5182('0x30')](_0x317610[_0x5182('0x2e')],qs[_0x5182('0x32')](_0x59ce3b['query'][_0x5182('0x32')]));_0x215d75[_0x5182('0x31')]=_0x215d75['attributes'][_0x5182('0x33')]?_0x215d75[_0x5182('0x31')]:_0x317610['model'];if(!_0x59ce3b[_0x5182('0x2f')][_0x5182('0x34')](_0x5182('0x35'))){_0x215d75[_0x5182('0x1c')]=qs[_0x5182('0x1c')](_0x59ce3b[_0x5182('0x2f')][_0x5182('0x1c')]);_0x215d75[_0x5182('0x1e')]=qs['offset'](_0x59ce3b['query'][_0x5182('0x1e')]);}_0x215d75[_0x5182('0x36')]=qs[_0x5182('0x37')](_0x59ce3b['query'][_0x5182('0x37')]);_0x215d75[_0x5182('0x3b')]=qs[_0x5182('0x39')](_[_0x5182('0x38')](_0x59ce3b[_0x5182('0x2f')],_0x317610[_0x5182('0x39')]));_0x215d75[_0x5182('0x3b')][_0x5182('0x4f')]=_0x3bd757['id'];if(_0x59ce3b[_0x5182('0x2f')][_0x5182('0x3a')]){_0x215d75[_0x5182('0x3b')]=_[_0x5182('0x3d')](_0x215d75[_0x5182('0x3b')],{'$or':_[_0x5182('0x2a')](_0x215d75[_0x5182('0x31')],function(_0x43d016){var _0xaae2fd={};_0xaae2fd[_0x43d016]={'$like':'%'+_0x59ce3b['query'][_0x5182('0x3a')]+'%'};return _0xaae2fd;})});}_0x215d75=_[_0x5182('0x3d')]({},_0x215d75,_0x59ce3b[_0x5182('0x3e')]);return db[_0x5182('0x4e')]['count']({'where':_0x215d75[_0x5182('0x3b')]})[_0x5182('0x23')](function(_0x32eea4){_0x5e278a[_0x5182('0x1d')]=_0x32eea4;if(_0x59ce3b[_0x5182('0x2f')][_0x5182('0x40')]){_0x215d75['include']=[{'all':!![]}];}return db[_0x5182('0x4e')][_0x5182('0x41')](_0x215d75);})[_0x5182('0x23')](function(_0x3f7a62){_0x5e278a[_0x5182('0x42')]=_0x3f7a62;return _0x5e278a;});}})[_0x5182('0x23')](respondWithFilteredResult(_0x3dd2f4,_0x215d75))[_0x5182('0x43')](handleError(_0x3dd2f4,null));};
\ No newline at end of file
+var _0xce1b=['body','destroy','params','describe','getQuestions','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index','JscriptySessionReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','length','find','create'];(function(_0x1c7b7f,_0x44283b){var _0x12ee94=function(_0x45bfad){while(--_0x45bfad){_0x1c7b7f['push'](_0x1c7b7f['shift']());}};_0x12ee94(++_0x44283b);}(_0xce1b,0x142));var _0xbce1=function(_0x147ed9,_0x1de81b){_0x147ed9=_0x147ed9-0x0;var _0xab8d90=_0xce1b[_0x147ed9];return _0xab8d90;};'use strict';var emlformat=require(_0xbce1('0x0'));var rimraf=require(_0xbce1('0x1'));var zipdir=require(_0xbce1('0x2'));var jsonpatch=require(_0xbce1('0x3'));var rp=require(_0xbce1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbce1('0x5'));var util=require(_0xbce1('0x6'));var path=require(_0xbce1('0x7'));var sox=require(_0xbce1('0x8'));var csv=require(_0xbce1('0x9'));var ejs=require(_0xbce1('0xa'));var fs=require('fs');var fs_extra=require(_0xbce1('0xb'));var _=require(_0xbce1('0xc'));var squel=require(_0xbce1('0xd'));var crypto=require(_0xbce1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbce1('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbce1('0x10'));var Papa=require('papaparse');var Redis=require(_0xbce1('0x11'));var authService=require(_0xbce1('0x12'));var qs=require(_0xbce1('0x13'));var as=require(_0xbce1('0x14'));var hardwareService=require(_0xbce1('0x15'));var logger=require('../../config/logger')(_0xbce1('0x16'));var utils=require('../../config/utils');var config=require(_0xbce1('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x88074a,_0x22bf36){_0x22bf36=_0x22bf36||0xcc;return function(_0x4650f5){if(_0x4650f5){return _0x88074a[_0xbce1('0x18')](_0x22bf36);}return _0x88074a[_0xbce1('0x19')](_0x22bf36)[_0xbce1('0x1a')]();};}function respondWithResult(_0x3d5027,_0x444a5e){_0x444a5e=_0x444a5e||0xc8;return function(_0x2b26f0){if(_0x2b26f0){return _0x3d5027[_0xbce1('0x19')](_0x444a5e)[_0xbce1('0x1b')](_0x2b26f0);}};}function respondWithFilteredResult(_0xeb8750,_0x46e3d4){return function(_0x2d20fa){if(_0x2d20fa){var _0xb17818=typeof _0x46e3d4[_0xbce1('0x1c')]===_0xbce1('0x1d')&&typeof _0x46e3d4[_0xbce1('0x1e')]===_0xbce1('0x1d');var _0x2fff58=_0x2d20fa['count'];var _0xf392fd=_0xb17818?0x0:_0x46e3d4[_0xbce1('0x1c')];var _0x128de1=_0xb17818?_0x2d20fa['count']:_0x46e3d4[_0xbce1('0x1c')]+_0x46e3d4[_0xbce1('0x1e')];var _0x32f3c6;if(_0x128de1>=_0x2fff58){_0x128de1=_0x2fff58;_0x32f3c6=0xc8;}else{_0x32f3c6=0xce;}_0xeb8750['status'](_0x32f3c6);return _0xeb8750[_0xbce1('0x1f')](_0xbce1('0x20'),_0xf392fd+'-'+_0x128de1+'/'+_0x2fff58)['json'](_0x2d20fa);}return null;};}function patchUpdates(_0x2f1b84){return function(_0x127096){try{jsonpatch[_0xbce1('0x21')](_0x127096,_0x2f1b84,!![]);}catch(_0x328bcc){return BPromise[_0xbce1('0x22')](_0x328bcc);}return _0x127096[_0xbce1('0x23')]();};}function saveUpdates(_0x546cda,_0x381ce4){return function(_0x420a04){if(_0x420a04){return _0x420a04[_0xbce1('0x24')](_0x546cda)[_0xbce1('0x25')](function(_0x3775e3){return _0x3775e3;});}return null;};}function removeEntity(_0x3b9234,_0xb8a6d7){return function(_0x1432bd){if(_0x1432bd){return _0x1432bd['destroy']()[_0xbce1('0x25')](function(){_0x3b9234[_0xbce1('0x19')](0xcc)[_0xbce1('0x1a')]();});}};}function handleEntityNotFound(_0x3eae38,_0x5ceb5a){return function(_0x4355d6){if(!_0x4355d6){_0x3eae38[_0xbce1('0x18')](0x194);}return _0x4355d6;};}function handleError(_0x50ca72,_0x1b74cd){_0x1b74cd=_0x1b74cd||0x1f4;return function(_0x523550){logger[_0xbce1('0x26')](_0x523550['stack']);if(_0x523550[_0xbce1('0x27')]){delete _0x523550['name'];}_0x50ca72[_0xbce1('0x19')](_0x1b74cd)[_0xbce1('0x28')](_0x523550);};}exports[_0xbce1('0x29')]=function(_0x5369b6,_0xbf3b60){var _0x27ba15={},_0x5dffc8={},_0xd7f9d5={'count':0x0,'rows':[]};var _0x1b2a97=_['map'](db[_0xbce1('0x2a')][_0xbce1('0x2b')],function(_0x1483f7){return{'name':_0x1483f7[_0xbce1('0x2c')],'type':_0x1483f7[_0xbce1('0x2d')][_0xbce1('0x2e')]};});_0x5dffc8[_0xbce1('0x2f')]=_[_0xbce1('0x30')](_0x1b2a97,_0xbce1('0x27'));_0x5dffc8['query']=_[_0xbce1('0x31')](_0x5369b6[_0xbce1('0x32')]);_0x5dffc8[_0xbce1('0x33')]=_[_0xbce1('0x34')](_0x5dffc8[_0xbce1('0x2f')],_0x5dffc8[_0xbce1('0x32')]);_0x27ba15[_0xbce1('0x35')]=_[_0xbce1('0x34')](_0x5dffc8[_0xbce1('0x2f')],qs[_0xbce1('0x36')](_0x5369b6[_0xbce1('0x32')][_0xbce1('0x36')]));_0x27ba15['attributes']=_0x27ba15['attributes']['length']?_0x27ba15[_0xbce1('0x35')]:_0x5dffc8['model'];if(!_0x5369b6[_0xbce1('0x32')][_0xbce1('0x37')]('nolimit')){_0x27ba15['limit']=qs[_0xbce1('0x1e')](_0x5369b6['query'][_0xbce1('0x1e')]);_0x27ba15['offset']=qs[_0xbce1('0x1c')](_0x5369b6[_0xbce1('0x32')][_0xbce1('0x1c')]);}_0x27ba15[_0xbce1('0x38')]=qs[_0xbce1('0x39')](_0x5369b6[_0xbce1('0x32')][_0xbce1('0x39')]);_0x27ba15[_0xbce1('0x3a')]=qs[_0xbce1('0x33')](_[_0xbce1('0x3b')](_0x5369b6[_0xbce1('0x32')],_0x5dffc8['filters']),_0x1b2a97);if(_0x5369b6[_0xbce1('0x32')][_0xbce1('0x3c')]){_0x27ba15[_0xbce1('0x3a')]=_[_0xbce1('0x3d')](_0x27ba15[_0xbce1('0x3a')],{'$or':_[_0xbce1('0x30')](_0x1b2a97,function(_0xb4d27b){if(_0xb4d27b[_0xbce1('0x2d')]!==_0xbce1('0x3e')){var _0x5058ad={};_0x5058ad[_0xb4d27b['name']]={'$like':'%'+_0x5369b6[_0xbce1('0x32')]['filter']+'%'};return _0x5058ad;}})});}_0x27ba15=_['merge']({},_0x27ba15,_0x5369b6[_0xbce1('0x3f')]);var _0x5011ca={'where':_0x27ba15[_0xbce1('0x3a')]};return db[_0xbce1('0x2a')][_0xbce1('0x40')](_0x5011ca)[_0xbce1('0x25')](function(_0x87d483){_0xd7f9d5[_0xbce1('0x40')]=_0x87d483;if(_0x5369b6['query'][_0xbce1('0x41')]){_0x27ba15[_0xbce1('0x42')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xbce1('0x43')](_0x27ba15);})['then'](function(_0x46442b){_0xd7f9d5['rows']=_0x46442b;return _0xd7f9d5;})[_0xbce1('0x25')](respondWithFilteredResult(_0xbf3b60,_0x27ba15))[_0xbce1('0x44')](handleError(_0xbf3b60,null));};exports[_0xbce1('0x45')]=function(_0x5c6244,_0x4e1f78){var _0x2a7eba={'raw':!![],'where':{'id':_0x5c6244['params']['id']}},_0x4f9831={};_0x4f9831['model']=_[_0xbce1('0x31')](db[_0xbce1('0x2a')][_0xbce1('0x2b')]);_0x4f9831[_0xbce1('0x32')]=_['keys'](_0x5c6244['query']);_0x4f9831[_0xbce1('0x33')]=_[_0xbce1('0x34')](_0x4f9831[_0xbce1('0x2f')],_0x4f9831[_0xbce1('0x32')]);_0x2a7eba['attributes']=_[_0xbce1('0x34')](_0x4f9831[_0xbce1('0x2f')],qs[_0xbce1('0x36')](_0x5c6244[_0xbce1('0x32')]['fields']));_0x2a7eba['attributes']=_0x2a7eba[_0xbce1('0x35')][_0xbce1('0x46')]?_0x2a7eba[_0xbce1('0x35')]:_0x4f9831[_0xbce1('0x2f')];if(_0x5c6244[_0xbce1('0x32')][_0xbce1('0x41')]){_0x2a7eba['include']=[{'all':!![]}];}_0x2a7eba=_['merge']({},_0x2a7eba,_0x5c6244['options']);return db[_0xbce1('0x2a')][_0xbce1('0x47')](_0x2a7eba)[_0xbce1('0x25')](handleEntityNotFound(_0x4e1f78,null))[_0xbce1('0x25')](respondWithResult(_0x4e1f78,null))['catch'](handleError(_0x4e1f78,null));};exports[_0xbce1('0x48')]=function(_0x4eb410,_0x2e3072){return db['JscriptySessionReport'][_0xbce1('0x48')](_0x4eb410[_0xbce1('0x49')],{})[_0xbce1('0x25')](respondWithResult(_0x2e3072,0xc9))[_0xbce1('0x44')](handleError(_0x2e3072,null));};exports['update']=function(_0x25ff36,_0x334422){if(_0x25ff36['body']['id']){delete _0x25ff36[_0xbce1('0x49')]['id'];}return db[_0xbce1('0x2a')][_0xbce1('0x47')]({'where':{'id':_0x25ff36['params']['id']}})['then'](handleEntityNotFound(_0x334422,null))[_0xbce1('0x25')](saveUpdates(_0x25ff36[_0xbce1('0x49')],null))[_0xbce1('0x25')](respondWithResult(_0x334422,null))[_0xbce1('0x44')](handleError(_0x334422,null));};exports[_0xbce1('0x4a')]=function(_0x47c5ea,_0x467f81){return db['JscriptySessionReport'][_0xbce1('0x47')]({'where':{'id':_0x47c5ea[_0xbce1('0x4b')]['id']}})[_0xbce1('0x25')](handleEntityNotFound(_0x467f81,null))[_0xbce1('0x25')](removeEntity(_0x467f81,null))[_0xbce1('0x44')](handleError(_0x467f81,null));};exports[_0xbce1('0x4c')]=function(_0x2a020b,_0x595a81){return db[_0xbce1('0x2a')][_0xbce1('0x4c')]()[_0xbce1('0x25')](respondWithResult(_0x595a81,null))[_0xbce1('0x44')](handleError(_0x595a81,null));};exports[_0xbce1('0x4d')]=function(_0x492f12,_0x1fd372,_0x1d2782){var _0x98ba9f={'raw':!![],'where':{}};var _0x1dd4ad={};var _0x1dbea7={'count':0x0,'rows':[]};return db[_0xbce1('0x2a')]['findOne']({'where':{'id':_0x492f12[_0xbce1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1fd372,null))['then'](function(_0x5b3730){if(_0x5b3730){_0x1dd4ad[_0xbce1('0x2f')]=_['keys'](db[_0xbce1('0x4e')]['rawAttributes']);_0x1dd4ad['query']=_[_0xbce1('0x31')](_0x492f12[_0xbce1('0x32')]);_0x1dd4ad[_0xbce1('0x33')]=_['intersection'](_0x1dd4ad['model'],_0x1dd4ad[_0xbce1('0x32')]);_0x98ba9f[_0xbce1('0x35')]=_['intersection'](_0x1dd4ad[_0xbce1('0x2f')],qs['fields'](_0x492f12[_0xbce1('0x32')]['fields']));_0x98ba9f[_0xbce1('0x35')]=_0x98ba9f[_0xbce1('0x35')][_0xbce1('0x46')]?_0x98ba9f[_0xbce1('0x35')]:_0x1dd4ad[_0xbce1('0x2f')];if(!_0x492f12[_0xbce1('0x32')][_0xbce1('0x37')]('nolimit')){_0x98ba9f['limit']=qs[_0xbce1('0x1e')](_0x492f12['query'][_0xbce1('0x1e')]);_0x98ba9f[_0xbce1('0x1c')]=qs[_0xbce1('0x1c')](_0x492f12[_0xbce1('0x32')][_0xbce1('0x1c')]);}_0x98ba9f[_0xbce1('0x38')]=qs[_0xbce1('0x39')](_0x492f12[_0xbce1('0x32')]['sort']);_0x98ba9f[_0xbce1('0x3a')]=qs['filters'](_[_0xbce1('0x3b')](_0x492f12[_0xbce1('0x32')],_0x1dd4ad[_0xbce1('0x33')]));_0x98ba9f['where']['SessionId']=_0x5b3730['id'];if(_0x492f12[_0xbce1('0x32')]['filter']){_0x98ba9f[_0xbce1('0x3a')]=_[_0xbce1('0x3d')](_0x98ba9f[_0xbce1('0x3a')],{'$or':_[_0xbce1('0x30')](_0x98ba9f[_0xbce1('0x35')],function(_0x586fcd){var _0x5637eb={};_0x5637eb[_0x586fcd]={'$like':'%'+_0x492f12[_0xbce1('0x32')]['filter']+'%'};return _0x5637eb;})});}_0x98ba9f=_[_0xbce1('0x3d')]({},_0x98ba9f,_0x492f12['options']);return db[_0xbce1('0x4e')][_0xbce1('0x40')]({'where':_0x98ba9f[_0xbce1('0x3a')]})['then'](function(_0x4b94ab){_0x1dbea7[_0xbce1('0x40')]=_0x4b94ab;if(_0x492f12[_0xbce1('0x32')][_0xbce1('0x41')]){_0x98ba9f['include']=[{'all':!![]}];}return db[_0xbce1('0x4e')][_0xbce1('0x43')](_0x98ba9f);})[_0xbce1('0x25')](function(_0x58366c){_0x1dbea7['rows']=_0x58366c;return _0x1dbea7;});}})[_0xbce1('0x25')](respondWithFilteredResult(_0x1fd372,_0x98ba9f))['catch'](handleError(_0x1fd372,null));};
\ No newline at end of file
index 82f39d4..3db6ce2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187d=['define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x29cf60,_0x4385ec){var _0x568a3e=function(_0x33432f){while(--_0x33432f){_0x29cf60['push'](_0x29cf60['shift']());}};_0x568a3e(++_0x4385ec);}(_0x187d,0x93));var _0xd187=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x187d[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf69d=['report_jscripty_sessions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x545a3a,_0x3123aa){var _0x5a5493=function(_0x4e6bce){while(--_0x4e6bce){_0x545a3a['push'](_0x545a3a['shift']());}};_0x5a5493(++_0x3123aa);}(_0xf69d,0xd3));var _0xdf69=function(_0x23fea9,_0x43ae4f){_0x23fea9=_0x23fea9-0x0;var _0x3ba301=_0xf69d[_0x23fea9];return _0x3ba301;};'use strict';var _=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var logger=require(_0xdf69('0x2'))(_0xdf69('0x3'));var moment=require(_0xdf69('0x4'));var BPromise=require('bluebird');var rp=require(_0xdf69('0x5'));var fs=require('fs');var path=require(_0xdf69('0x6'));var rimraf=require(_0xdf69('0x7'));var config=require(_0xdf69('0x8'));var attributes=require(_0xdf69('0x9'));module[_0xdf69('0xa')]=function(_0x2d456f,_0x465b1b){return _0x2d456f[_0xdf69('0xb')](_0xdf69('0xc'),attributes,{'tableName':_0xdf69('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 318e0d3..1850898 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x2865d0,_0x2d01b0){var _0x326eaa=function(_0x527b60){while(--_0x527b60){_0x2865d0['push'](_0x2865d0['shift']());}};_0x326eaa(++_0x2d01b0);}(_0x187d,0x93));var _0xd187=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x187d[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});}
\ No newline at end of file
+var _0x6d38=['request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x615df0,_0x2c4eac){var _0x222912=function(_0x4d99d3){while(--_0x4d99d3){_0x615df0['push'](_0x615df0['shift']());}};_0x222912(++_0x2c4eac);}(_0x6d38,0x1ef));var _0x86d3=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x6d38[_0x297fd3];return _0x2af381;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});}
\ No newline at end of file
index d91cf9a..2229a2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a80=['isAuthenticated','/download_log_file','downloadLogFile','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./license.controller','get','index','put','/:id'];(function(_0x1238e0,_0x16bd9b){var _0x59dfc8=function(_0x3cd547){while(--_0x3cd547){_0x1238e0['push'](_0x1238e0['shift']());}};_0x59dfc8(++_0x16bd9b);}(_0x3a80,0x164));var _0x03a8=function(_0x2e24dc,_0x57a2a6){_0x2e24dc=_0x2e24dc-0x0;var _0x4f782e=_0x3a80[_0x2e24dc];return _0x4f782e;};'use strict';var multer=require('multer');var util=require(_0x03a8('0x0'));var path=require(_0x03a8('0x1'));var timeout=require('connect-timeout');var express=require(_0x03a8('0x2'));var router=express[_0x03a8('0x3')]();var fs_extra=require(_0x03a8('0x4'));var auth=require(_0x03a8('0x5'));var interaction=require(_0x03a8('0x6'));var config=require('../../config/environment');var controller=require(_0x03a8('0x7'));router[_0x03a8('0x8')]('/',controller[_0x03a8('0x9')]);router[_0x03a8('0xa')](_0x03a8('0xb'),auth[_0x03a8('0xc')](),controller['update']);router['get'](_0x03a8('0xd'),auth['isAuthenticated'](),controller[_0x03a8('0xe')]);module[_0x03a8('0xf')]=router;
\ No newline at end of file
+var _0x073f=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','put','/:id','isAuthenticated','update','get','/download_log_file','downloadLogFile','exports'];(function(_0xf46509,_0x20fbc9){var _0x1102ef=function(_0x50da0d){while(--_0x50da0d){_0xf46509['push'](_0xf46509['shift']());}};_0x1102ef(++_0x20fbc9);}(_0x073f,0xd8));var _0xf073=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x073f[_0x38ced4];return _0x547c07;};'use strict';var multer=require(_0xf073('0x0'));var util=require(_0xf073('0x1'));var path=require(_0xf073('0x2'));var timeout=require(_0xf073('0x3'));var express=require(_0xf073('0x4'));var router=express['Router']();var fs_extra=require(_0xf073('0x5'));var auth=require(_0xf073('0x6'));var interaction=require(_0xf073('0x7'));var config=require(_0xf073('0x8'));var controller=require('./license.controller');router['get']('/',controller[_0xf073('0x9')]);router[_0xf073('0xa')](_0xf073('0xb'),auth[_0xf073('0xc')](),controller[_0xf073('0xd')]);router[_0xf073('0xe')](_0xf073('0xf'),auth['isAuthenticated'](),controller[_0xf073('0x10')]);module[_0xf073('0x11')]=router;
\ No newline at end of file
index 2d8a4d7..2566835 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0a0=['exports','TEXT','STRING'];(function(_0x534a2f,_0x42b5a3){var _0x1ad694=function(_0xe5798f){while(--_0xe5798f){_0x534a2f['push'](_0x534a2f['shift']());}};_0x1ad694(++_0x42b5a3);}(_0xf0a0,0x1b0));var _0x0f0a=function(_0x2da7cb,_0x26ef49){_0x2da7cb=_0x2da7cb-0x0;var _0x4e3c53=_0xf0a0[_0x2da7cb];return _0x4e3c53;};'use strict';var Sequelize=require('sequelize');module[_0x0f0a('0x0')]={'license':{'type':Sequelize[_0x0f0a('0x1')]},'data1':{'type':Sequelize[_0x0f0a('0x2')]},'data2':{'type':Sequelize[_0x0f0a('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2991=['TEXT','STRING','INTEGER','exports'];(function(_0x4ceff1,_0x1fdb41){var _0x30f94d=function(_0x2d9109){while(--_0x2d9109){_0x4ceff1['push'](_0x4ceff1['shift']());}};_0x30f94d(++_0x1fdb41);}(_0x2991,0x1cb));var _0x1299=function(_0x5d262e,_0x4b9adf){_0x5d262e=_0x5d262e-0x0;var _0x2c2f22=_0x2991[_0x5d262e];return _0x2c2f22;};'use strict';var Sequelize=require('sequelize');module[_0x1299('0x0')]={'license':{'type':Sequelize[_0x1299('0x1')]},'data1':{'type':Sequelize[_0x1299('0x2')]},'data2':{'type':Sequelize[_0x1299('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x1299('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 6e27b6b..0198c39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fdd=['License','rawAttributes','query','filters','attributes','intersection','fields','length','getLicense','find','get','body','key','downloadLogFile','join','xcally','Content-disposition','Content-Type','download','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','stack','name','index','model','keys'];(function(_0x193641,_0x65f657){var _0x2957b8=function(_0x3dc313){while(--_0x3dc313){_0x193641['push'](_0x193641['shift']());}};_0x2957b8(++_0x65f657);}(_0x7fdd,0x19b));var _0xd7fd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7fdd[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xd7fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd7fd('0x1'));var jsonpatch=require(_0xd7fd('0x2'));var rp=require('request-promise');var moment=require(_0xd7fd('0x3'));var BPromise=require(_0xd7fd('0x4'));var Mustache=require(_0xd7fd('0x5'));var util=require(_0xd7fd('0x6'));var path=require(_0xd7fd('0x7'));var sox=require('sox');var csv=require(_0xd7fd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd7fd('0x9'));var _=require('lodash');var squel=require(_0xd7fd('0xa'));var crypto=require(_0xd7fd('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd7fd('0xc'));var Papa=require(_0xd7fd('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd7fd('0xe'));var as=require(_0xd7fd('0xf'));var hardwareService=require(_0xd7fd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xd7fd('0x11'));var config=require(_0xd7fd('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xd7fd('0x13'))['db'];function respondWithStatusCode(_0x1b4013,_0x46895c){_0x46895c=_0x46895c||0xcc;return function(_0x403c48){if(_0x403c48){return _0x1b4013['sendStatus'](_0x46895c);}return _0x1b4013['status'](_0x46895c)[_0xd7fd('0x14')]();};}function respondWithResult(_0x4259b8,_0x266f50){_0x266f50=_0x266f50||0xc8;return function(_0x38e2c4){if(_0x38e2c4){return _0x4259b8[_0xd7fd('0x15')](_0x266f50)[_0xd7fd('0x16')](_0x38e2c4);}};}function respondWithFilteredResult(_0x382ef8,_0x3c8486){return function(_0x347bfa){if(_0x347bfa){var _0x24f14b=typeof _0x3c8486[_0xd7fd('0x17')]===_0xd7fd('0x18')&&typeof _0x3c8486[_0xd7fd('0x19')]===_0xd7fd('0x18');var _0x107e62=_0x347bfa[_0xd7fd('0x1a')];var _0x2a9455=_0x24f14b?0x0:_0x3c8486[_0xd7fd('0x17')];var _0x16973b=_0x24f14b?_0x347bfa[_0xd7fd('0x1a')]:_0x3c8486[_0xd7fd('0x17')]+_0x3c8486['limit'];var _0x48d5b4;if(_0x16973b>=_0x107e62){_0x16973b=_0x107e62;_0x48d5b4=0xc8;}else{_0x48d5b4=0xce;}_0x382ef8[_0xd7fd('0x15')](_0x48d5b4);return _0x382ef8[_0xd7fd('0x1b')](_0xd7fd('0x1c'),_0x2a9455+'-'+_0x16973b+'/'+_0x107e62)['json'](_0x347bfa);}return null;};}function patchUpdates(_0x50e3fe){return function(_0x2d0bcd){try{jsonpatch[_0xd7fd('0x1d')](_0x2d0bcd,_0x50e3fe,!![]);}catch(_0x33e26d){return BPromise['reject'](_0x33e26d);}return _0x2d0bcd[_0xd7fd('0x1e')]();};}function saveUpdates(_0xc0d55d,_0x802d2){return function(_0x5116c1){if(_0x5116c1){return _0x5116c1['update'](_0xc0d55d)[_0xd7fd('0x1f')](function(_0x86449d){return _0x86449d;});}return null;};}function removeEntity(_0x78ba8b,_0x1ef984){return function(_0x510283){if(_0x510283){return _0x510283['destroy']()[_0xd7fd('0x1f')](function(){_0x78ba8b['status'](0xcc)[_0xd7fd('0x14')]();});}};}function handleEntityNotFound(_0xcea6e8,_0x5a47c0){return function(_0x5deb2f){if(!_0x5deb2f){_0xcea6e8['sendStatus'](0x194);}return _0x5deb2f;};}function handleError(_0x15fbc6,_0x30a028){_0x30a028=_0x30a028||0x1f4;return function(_0x373774){logger['error'](_0x373774[_0xd7fd('0x20')]);if(_0x373774['name']){delete _0x373774[_0xd7fd('0x21')];}_0x15fbc6[_0xd7fd('0x15')](_0x30a028)['send'](_0x373774);};}var utilLicense=require('../../config/license/util');exports[_0xd7fd('0x22')]=function(_0xcf5f1b,_0x2af069){var _0x2746ee={'raw':!![],'where':{'id':0x1}},_0x5c5dd6={};_0x5c5dd6[_0xd7fd('0x23')]=_[_0xd7fd('0x24')](db[_0xd7fd('0x25')][_0xd7fd('0x26')]);_0x5c5dd6[_0xd7fd('0x27')]=_['keys'](_0xcf5f1b[_0xd7fd('0x27')]);_0x5c5dd6[_0xd7fd('0x28')]=_['intersection'](_0x5c5dd6[_0xd7fd('0x23')],_0x5c5dd6[_0xd7fd('0x27')]);_0x2746ee[_0xd7fd('0x29')]=_[_0xd7fd('0x2a')](_0x5c5dd6[_0xd7fd('0x23')],qs['fields'](_0xcf5f1b['query'][_0xd7fd('0x2b')]));_0x2746ee['attributes']=_0x2746ee[_0xd7fd('0x29')][_0xd7fd('0x2c')]?_0x2746ee[_0xd7fd('0x29')]:_0x5c5dd6[_0xd7fd('0x23')];_0x2746ee=_['merge']({},_0x2746ee,_0xcf5f1b['options']);return utilLicense[_0xd7fd('0x2d')](_0x2746ee)[_0xd7fd('0x1f')](respondWithResult(_0x2af069,null))['catch'](handleError(_0x2af069,null));};exports['update']=function(_0x395f3a,_0x3b0094){if(_0x395f3a['body']['id']){delete _0x395f3a['body']['id'];}return db['License'][_0xd7fd('0x2e')]({'where':{'id':_0x395f3a['params']['id']}})['then'](handleEntityNotFound(_0x3b0094,null))[_0xd7fd('0x1f')](function(_0x586a3b){var _0x2a910e=_0x586a3b[_0xd7fd('0x2f')]({'plain':!![]});return utilLicense['checkLicense'](_0x2a910e,_0x395f3a[_0xd7fd('0x30')][_0xd7fd('0x31')]);})[_0xd7fd('0x1f')](function(_0x2e4a0a){if(!_0x2e4a0a['demo']){return saveUpdates(_0x395f3a[_0xd7fd('0x30')],null);}return _0x2e4a0a;})['then'](respondWithResult(_0x3b0094,null))['catch'](handleError(_0x3b0094,null));};exports[_0xd7fd('0x32')]=function(_0x3fcc9a,_0x7802ab){var _0x251ddb='license-info.log';var _0x453823=path[_0xd7fd('0x33')]('/var','log',_0xd7fd('0x34'),_0x251ddb);_0x7802ab['setHeader'](_0xd7fd('0x35'),'attachment;\x20filename='+_0x251ddb);_0x7802ab[_0xd7fd('0x1b')](_0xd7fd('0x36'),'text/plain');_0x7802ab[_0xd7fd('0x37')](_0x453823);};
\ No newline at end of file
+var _0x90b6=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','merge','options','catch','update','body','find','get','checkLicense','downloadLogFile','license-info.log','join','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv'];(function(_0x166bdd,_0x53c53c){var _0x2c1eb8=function(_0x5cb0fa){while(--_0x5cb0fa){_0x166bdd['push'](_0x166bdd['shift']());}};_0x2c1eb8(++_0x53c53c);}(_0x90b6,0x146));var _0x690b=function(_0x11a93f,_0x14ccd1){_0x11a93f=_0x11a93f-0x0;var _0xad55ac=_0x90b6[_0x11a93f];return _0xad55ac;};'use strict';var emlformat=require(_0x690b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x690b('0x1'));var jsonpatch=require(_0x690b('0x2'));var rp=require(_0x690b('0x3'));var moment=require(_0x690b('0x4'));var BPromise=require(_0x690b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x690b('0x6'));var sox=require(_0x690b('0x7'));var csv=require(_0x690b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x690b('0x9'));var _=require(_0x690b('0xa'));var squel=require(_0x690b('0xb'));var crypto=require(_0x690b('0xc'));var jsforce=require(_0x690b('0xd'));var deskjs=require(_0x690b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x690b('0xf'));var Papa=require(_0x690b('0x10'));var Redis=require(_0x690b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x690b('0x12'));var logger=require(_0x690b('0x13'))(_0x690b('0x14'));var utils=require(_0x690b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x690b('0x16'));var db=require(_0x690b('0x17'))['db'];function respondWithStatusCode(_0x314f70,_0x5d9f3b){_0x5d9f3b=_0x5d9f3b||0xcc;return function(_0x159abd){if(_0x159abd){return _0x314f70[_0x690b('0x18')](_0x5d9f3b);}return _0x314f70[_0x690b('0x19')](_0x5d9f3b)[_0x690b('0x1a')]();};}function respondWithResult(_0x2c7d0a,_0x4944c5){_0x4944c5=_0x4944c5||0xc8;return function(_0x16e2c7){if(_0x16e2c7){return _0x2c7d0a[_0x690b('0x19')](_0x4944c5)[_0x690b('0x1b')](_0x16e2c7);}};}function respondWithFilteredResult(_0x1b81f2,_0x159846){return function(_0x2acc54){if(_0x2acc54){var _0xd85f79=typeof _0x159846['offset']===_0x690b('0x1c')&&typeof _0x159846[_0x690b('0x1d')]==='undefined';var _0x289f08=_0x2acc54[_0x690b('0x1e')];var _0x51e734=_0xd85f79?0x0:_0x159846['offset'];var _0x371365=_0xd85f79?_0x2acc54[_0x690b('0x1e')]:_0x159846['offset']+_0x159846['limit'];var _0x5aa23c;if(_0x371365>=_0x289f08){_0x371365=_0x289f08;_0x5aa23c=0xc8;}else{_0x5aa23c=0xce;}_0x1b81f2[_0x690b('0x19')](_0x5aa23c);return _0x1b81f2[_0x690b('0x1f')]('Content-Range',_0x51e734+'-'+_0x371365+'/'+_0x289f08)['json'](_0x2acc54);}return null;};}function patchUpdates(_0x4beda8){return function(_0x3c600d){try{jsonpatch[_0x690b('0x20')](_0x3c600d,_0x4beda8,!![]);}catch(_0x205b7d){return BPromise['reject'](_0x205b7d);}return _0x3c600d[_0x690b('0x21')]();};}function saveUpdates(_0x15cdfe,_0x18dc21){return function(_0x4f3bdc){if(_0x4f3bdc){return _0x4f3bdc['update'](_0x15cdfe)[_0x690b('0x22')](function(_0x9cd0cc){return _0x9cd0cc;});}return null;};}function removeEntity(_0x2f9676,_0x5df894){return function(_0x4453a9){if(_0x4453a9){return _0x4453a9[_0x690b('0x23')]()[_0x690b('0x22')](function(){_0x2f9676[_0x690b('0x19')](0xcc)[_0x690b('0x1a')]();});}};}function handleEntityNotFound(_0x5c9bbb,_0x4f26a1){return function(_0x154847){if(!_0x154847){_0x5c9bbb[_0x690b('0x18')](0x194);}return _0x154847;};}function handleError(_0x409971,_0x2a1a78){_0x2a1a78=_0x2a1a78||0x1f4;return function(_0x45fd27){logger[_0x690b('0x24')](_0x45fd27[_0x690b('0x25')]);if(_0x45fd27['name']){delete _0x45fd27[_0x690b('0x26')];}_0x409971['status'](_0x2a1a78)[_0x690b('0x27')](_0x45fd27);};}var utilLicense=require(_0x690b('0x16'));exports[_0x690b('0x28')]=function(_0x90e8f6,_0x4b4d29){var _0x475293={'raw':!![],'where':{'id':0x1}},_0x342e3e={};_0x342e3e[_0x690b('0x29')]=_[_0x690b('0x2a')](db[_0x690b('0x2b')][_0x690b('0x2c')]);_0x342e3e['query']=_[_0x690b('0x2a')](_0x90e8f6[_0x690b('0x2d')]);_0x342e3e[_0x690b('0x2e')]=_[_0x690b('0x2f')](_0x342e3e[_0x690b('0x29')],_0x342e3e['query']);_0x475293[_0x690b('0x30')]=_[_0x690b('0x2f')](_0x342e3e[_0x690b('0x29')],qs['fields'](_0x90e8f6[_0x690b('0x2d')][_0x690b('0x31')]));_0x475293[_0x690b('0x30')]=_0x475293['attributes']['length']?_0x475293['attributes']:_0x342e3e[_0x690b('0x29')];_0x475293=_[_0x690b('0x32')]({},_0x475293,_0x90e8f6[_0x690b('0x33')]);return utilLicense['getLicense'](_0x475293)['then'](respondWithResult(_0x4b4d29,null))[_0x690b('0x34')](handleError(_0x4b4d29,null));};exports[_0x690b('0x35')]=function(_0x25c514,_0x651115){if(_0x25c514[_0x690b('0x36')]['id']){delete _0x25c514['body']['id'];}return db[_0x690b('0x2b')][_0x690b('0x37')]({'where':{'id':_0x25c514['params']['id']}})[_0x690b('0x22')](handleEntityNotFound(_0x651115,null))[_0x690b('0x22')](function(_0x5aaf55){var _0x43dccc=_0x5aaf55[_0x690b('0x38')]({'plain':!![]});return utilLicense[_0x690b('0x39')](_0x43dccc,_0x25c514[_0x690b('0x36')]['key']);})['then'](function(_0x29195c){if(!_0x29195c['demo']){return saveUpdates(_0x25c514[_0x690b('0x36')],null);}return _0x29195c;})['then'](respondWithResult(_0x651115,null))[_0x690b('0x34')](handleError(_0x651115,null));};exports[_0x690b('0x3a')]=function(_0x38a5b2,_0x514315){var _0x353d9a=_0x690b('0x3b');var _0x3c3237=path[_0x690b('0x3c')]('/var','log',_0x690b('0x3d'),_0x353d9a);_0x514315[_0x690b('0x3e')](_0x690b('0x3f'),_0x690b('0x40')+_0x353d9a);_0x514315[_0x690b('0x1f')](_0x690b('0x41'),_0x690b('0x42'));_0x514315['download'](_0x3c3237);};
\ No newline at end of file
index 19f8c02..2f46883 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2aad=['moment','request-promise','./license.attributes','exports','define','../../config/logger','api'];(function(_0x3a815a,_0x3cc58c){var _0x3ca7c3=function(_0x133f58){while(--_0x133f58){_0x3a815a['push'](_0x3a815a['shift']());}};_0x3ca7c3(++_0x3cc58c);}(_0x2aad,0x140));var _0xd2aa=function(_0x547fcb,_0x8fda67){_0x547fcb=_0x547fcb-0x0;var _0x275d17=_0x2aad[_0x547fcb];return _0x275d17;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd2aa('0x0'))(_0xd2aa('0x1'));var moment=require(_0xd2aa('0x2'));var BPromise=require('bluebird');var rp=require(_0xd2aa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd2aa('0x4'));module[_0xd2aa('0x5')]=function(_0x121ce1,_0x5ab870){return _0x121ce1[_0xd2aa('0x6')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe9b5=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','license'];(function(_0x56b448,_0x19a1df){var _0x547f64=function(_0x7a766d){while(--_0x7a766d){_0x56b448['push'](_0x56b448['shift']());}};_0x547f64(++_0x19a1df);}(_0xe9b5,0x104));var _0x5e9b=function(_0x25b475,_0x388e76){_0x25b475=_0x25b475-0x0;var _0x40e60e=_0xe9b5[_0x25b475];return _0x40e60e;};'use strict';var _=require(_0x5e9b('0x0'));var util=require(_0x5e9b('0x1'));var logger=require(_0x5e9b('0x2'))('api');var moment=require(_0x5e9b('0x3'));var BPromise=require(_0x5e9b('0x4'));var rp=require(_0x5e9b('0x5'));var fs=require('fs');var path=require(_0x5e9b('0x6'));var rimraf=require(_0x5e9b('0x7'));var config=require(_0x5e9b('0x8'));var attributes=require(_0x5e9b('0x9'));module[_0x5e9b('0xa')]=function(_0x41e18e,_0x5bd455){return _0x41e18e[_0x5e9b('0xb')]('License',attributes,{'tableName':_0x5e9b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c4c8615..0c92143 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b8b=['debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','License,\x20%s,\x20%s'];(function(_0x5c2748,_0x564960){var _0x59761d=function(_0x1ccb1a){while(--_0x1ccb1a){_0x5c2748['push'](_0x5c2748['shift']());}};_0x59761d(++_0x564960);}(_0x5b8b,0x9e));var _0xb5b8=function(_0x5c7b94,_0x761646){_0x5c7b94=_0x5c7b94-0x0;var _0x37edb3=_0x5b8b[_0x5c7b94];return _0x37edb3;};'use strict';var _=require(_0xb5b8('0x0'));var util=require('util');var moment=require(_0xb5b8('0x1'));var BPromise=require(_0xb5b8('0x2'));var rs=require(_0xb5b8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb5b8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb5b8('0x5'))(_0xb5b8('0x6'));var config=require('../../config/environment');var jayson=require(_0xb5b8('0x7'));var client=jayson[_0xb5b8('0x8')][_0xb5b8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf69523,_0x42dbec,_0x38a4ba){return new BPromise(function(_0x3ca844,_0x22ae89){return client['request'](_0xf69523,_0x38a4ba)[_0xb5b8('0xa')](function(_0x4945eb){logger[_0xb5b8('0xb')](_0xb5b8('0xc'),_0x42dbec,'request\x20sent');logger[_0xb5b8('0xd')](_0xb5b8('0xe'),_0x42dbec,_0xb5b8('0xf'),JSON[_0xb5b8('0x10')](_0x4945eb));if(_0x4945eb[_0xb5b8('0x11')]){if(_0x4945eb[_0xb5b8('0x11')]['code']===0x1f4){logger['error'](_0xb5b8('0xc'),_0x42dbec,_0x4945eb['error'][_0xb5b8('0x12')]);return _0x22ae89(_0x4945eb[_0xb5b8('0x11')]['message']);}logger[_0xb5b8('0x11')](_0xb5b8('0xc'),_0x42dbec,_0x4945eb['error'][_0xb5b8('0x12')]);return _0x3ca844(_0x4945eb[_0xb5b8('0x11')][_0xb5b8('0x12')]);}else{logger['info'](_0xb5b8('0xc'),_0x42dbec,_0xb5b8('0xf'));_0x3ca844(_0x4945eb['result']['message']);}})['catch'](function(_0x33c597){logger[_0xb5b8('0x11')](_0xb5b8('0xc'),_0x42dbec,_0x33c597);_0x22ae89(_0x33c597);});});}
\ No newline at end of file
+var _0x2840=['jayson/promise','http','request','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','License,\x20%s,\x20%s','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x374ccf,_0xa945c4){var _0x443cde=function(_0x27ff10){while(--_0x27ff10){_0x374ccf['push'](_0x374ccf['shift']());}};_0x443cde(++_0xa945c4);}(_0x2840,0xd4));var _0x0284=function(_0x3d9557,_0x5d09d2){_0x3d9557=_0x3d9557-0x0;var _0x359ff8=_0x2840[_0x3d9557];return _0x359ff8;};'use strict';var _=require(_0x0284('0x0'));var util=require(_0x0284('0x1'));var moment=require(_0x0284('0x2'));var BPromise=require('bluebird');var rs=require(_0x0284('0x3'));var fs=require('fs');var Redis=require(_0x0284('0x4'));var db=require(_0x0284('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0284('0x6'))('rpc');var config=require(_0x0284('0x7'));var jayson=require(_0x0284('0x8'));var client=jayson['client'][_0x0284('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5953c5,_0x3ac6da,_0x2f8302){return new BPromise(function(_0xe0500a,_0xde0132){return client[_0x0284('0xa')](_0x5953c5,_0x2f8302)['then'](function(_0x346a46){logger['info']('License,\x20%s,\x20%s',_0x3ac6da,_0x0284('0xb'));logger[_0x0284('0xc')](_0x0284('0xd'),_0x3ac6da,'request\x20sent',JSON[_0x0284('0xe')](_0x346a46));if(_0x346a46[_0x0284('0xf')]){if(_0x346a46['error']['code']===0x1f4){logger[_0x0284('0xf')](_0x0284('0x10'),_0x3ac6da,_0x346a46['error']['message']);return _0xde0132(_0x346a46[_0x0284('0xf')][_0x0284('0x11')]);}logger[_0x0284('0xf')](_0x0284('0x10'),_0x3ac6da,_0x346a46[_0x0284('0xf')][_0x0284('0x11')]);return _0xe0500a(_0x346a46[_0x0284('0xf')][_0x0284('0x11')]);}else{logger[_0x0284('0x12')](_0x0284('0x10'),_0x3ac6da,_0x0284('0xb'));_0xe0500a(_0x346a46[_0x0284('0x13')]['message']);}})['catch'](function(_0x5096b7){logger[_0x0284('0xf')](_0x0284('0x10'),_0x3ac6da,_0x5096b7);_0xde0132(_0x5096b7);});});}
\ No newline at end of file
index d1d8b1a..db1591a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa466=['multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','getMessages','/:id/verify','verifySmtp','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','addAgents','put','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','/:id/users','removeAgents','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa466,0x93));var _0x6a46=function(_0x5580a2,_0x47a764){_0x5580a2=_0x5580a2-0x0;var _0x4231fd=_0xa466[_0x5580a2];return _0x4231fd;};'use strict';var multer=require(_0x6a46('0x0'));var util=require(_0x6a46('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6a46('0x2'));var router=express[_0x6a46('0x3')]();var fs_extra=require(_0x6a46('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6a46('0x5'));var config=require(_0x6a46('0x6'));var controller=require(_0x6a46('0x7'));router[_0x6a46('0x8')]('/',auth['isAuthenticated'](),controller[_0x6a46('0x9')]);router[_0x6a46('0x8')](_0x6a46('0xa'),auth[_0x6a46('0xb')](),controller[_0x6a46('0xc')]);router['get'](_0x6a46('0xd'),auth[_0x6a46('0xb')](),controller[_0x6a46('0xe')]);router[_0x6a46('0x8')](_0x6a46('0xf'),auth[_0x6a46('0xb')](),controller[_0x6a46('0x10')]);router[_0x6a46('0x8')](_0x6a46('0x11'),auth[_0x6a46('0xb')](),controller[_0x6a46('0x12')]);router['get'](_0x6a46('0x13'),auth[_0x6a46('0xb')](),controller[_0x6a46('0x14')]);router[_0x6a46('0x8')](_0x6a46('0x15'),auth[_0x6a46('0xb')](),controller[_0x6a46('0x16')]);router[_0x6a46('0x8')](_0x6a46('0x17'),auth[_0x6a46('0xb')](),controller[_0x6a46('0x18')]);router[_0x6a46('0x8')]('/:id/applications',auth['isAuthenticated'](),controller[_0x6a46('0x19')]);router[_0x6a46('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6a46('0x1a')]);router['get'](_0x6a46('0x1b'),auth[_0x6a46('0xb')](),controller[_0x6a46('0x1c')]);router[_0x6a46('0x8')]('/:id/users',auth[_0x6a46('0xb')](),controller[_0x6a46('0x1d')]);router[_0x6a46('0x1e')](_0x6a46('0xf'),auth[_0x6a46('0xb')](),controller[_0x6a46('0x1f')]);router[_0x6a46('0x1e')](_0x6a46('0x11'),auth['isAuthenticated'](),controller[_0x6a46('0x20')]);router['post']('/',auth[_0x6a46('0xb')](),controller[_0x6a46('0x21')]);router[_0x6a46('0x1e')]('/:id/in_servers',auth[_0x6a46('0xb')](),controller[_0x6a46('0x22')]);router[_0x6a46('0x1e')](_0x6a46('0x15'),auth[_0x6a46('0xb')](),controller[_0x6a46('0x23')]);router['post'](_0x6a46('0x17'),auth[_0x6a46('0xb')](),controller[_0x6a46('0x24')]);router['post']('/:id/applications',auth[_0x6a46('0xb')](),controller[_0x6a46('0x25')]);router[_0x6a46('0x1e')](_0x6a46('0x26'),auth[_0x6a46('0xb')](),controller['send']);router[_0x6a46('0x1e')]('/:id/users',auth['isAuthenticated'](),controller[_0x6a46('0x27')]);router[_0x6a46('0x28')](_0x6a46('0xd'),auth[_0x6a46('0xb')](),controller['update']);router[_0x6a46('0x29')](_0x6a46('0xf'),auth[_0x6a46('0xb')](),controller[_0x6a46('0x2a')]);router[_0x6a46('0x29')](_0x6a46('0x11'),auth[_0x6a46('0xb')](),controller[_0x6a46('0x2b')]);router[_0x6a46('0x29')](_0x6a46('0x13'),auth[_0x6a46('0xb')](),controller[_0x6a46('0x2c')]);router['delete'](_0x6a46('0x15'),auth[_0x6a46('0xb')](),controller[_0x6a46('0x2d')]);router[_0x6a46('0x29')](_0x6a46('0xd'),auth[_0x6a46('0xb')](),controller['destroy']);router['delete'](_0x6a46('0x2e'),auth[_0x6a46('0xb')](),controller[_0x6a46('0x2f')]);module[_0x6a46('0x30')]=router;
\ No newline at end of file
+var _0xcb3a=['addAnswer','create','addImap','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','update','removeDispositions','removeAnswers','delete','removeSmtp','destroy','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition'];(function(_0x540ce9,_0x18f041){var _0x3e3e1a=function(_0x3b7fd1){while(--_0x3b7fd1){_0x540ce9['push'](_0x540ce9['shift']());}};_0x3e3e1a(++_0x18f041);}(_0xcb3a,0x19a));var _0xacb3=function(_0x349751,_0x1047bf){_0x349751=_0x349751-0x0;var _0x403a1d=_0xcb3a[_0x349751];return _0x403a1d;};'use strict';var multer=require(_0xacb3('0x0'));var util=require('util');var path=require(_0xacb3('0x1'));var timeout=require(_0xacb3('0x2'));var express=require(_0xacb3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xacb3('0x4'));var interaction=require(_0xacb3('0x5'));var config=require(_0xacb3('0x6'));var controller=require('./mailAccount.controller');router['get']('/',auth[_0xacb3('0x7')](),controller[_0xacb3('0x8')]);router[_0xacb3('0x9')](_0xacb3('0xa'),auth[_0xacb3('0x7')](),controller[_0xacb3('0xb')]);router['get'](_0xacb3('0xc'),auth[_0xacb3('0x7')](),controller[_0xacb3('0xd')]);router[_0xacb3('0x9')](_0xacb3('0xe'),auth[_0xacb3('0x7')](),controller[_0xacb3('0xf')]);router[_0xacb3('0x9')](_0xacb3('0x10'),auth[_0xacb3('0x7')](),controller[_0xacb3('0x11')]);router['get'](_0xacb3('0x12'),auth[_0xacb3('0x7')](),controller['getImap']);router[_0xacb3('0x9')]('/:id/out_servers',auth[_0xacb3('0x7')](),controller['getSmtp']);router[_0xacb3('0x9')](_0xacb3('0x13'),auth[_0xacb3('0x7')](),controller[_0xacb3('0x14')]);router['get'](_0xacb3('0x15'),auth[_0xacb3('0x7')](),controller[_0xacb3('0x16')]);router[_0xacb3('0x9')](_0xacb3('0x17'),auth[_0xacb3('0x7')](),controller[_0xacb3('0x18')]);router[_0xacb3('0x9')](_0xacb3('0x19'),auth['isAuthenticated'](),controller[_0xacb3('0x1a')]);router[_0xacb3('0x9')](_0xacb3('0x1b'),auth[_0xacb3('0x7')](),controller[_0xacb3('0x1c')]);router[_0xacb3('0x1d')](_0xacb3('0xe'),auth[_0xacb3('0x7')](),controller[_0xacb3('0x1e')]);router[_0xacb3('0x1d')](_0xacb3('0x10'),auth[_0xacb3('0x7')](),controller[_0xacb3('0x1f')]);router['post']('/',auth[_0xacb3('0x7')](),controller[_0xacb3('0x20')]);router['post'](_0xacb3('0x12'),auth[_0xacb3('0x7')](),controller[_0xacb3('0x21')]);router[_0xacb3('0x1d')](_0xacb3('0x22'),auth['isAuthenticated'](),controller[_0xacb3('0x23')]);router[_0xacb3('0x1d')](_0xacb3('0x13'),auth[_0xacb3('0x7')](),controller[_0xacb3('0x24')]);router[_0xacb3('0x1d')]('/:id/applications',auth[_0xacb3('0x7')](),controller[_0xacb3('0x25')]);router[_0xacb3('0x1d')](_0xacb3('0x26'),auth[_0xacb3('0x7')](),controller[_0xacb3('0x27')]);router['post'](_0xacb3('0x1b'),auth['isAuthenticated'](),controller[_0xacb3('0x28')]);router['put'](_0xacb3('0xc'),auth['isAuthenticated'](),controller[_0xacb3('0x29')]);router['delete'](_0xacb3('0xe'),auth[_0xacb3('0x7')](),controller[_0xacb3('0x2a')]);router['delete'](_0xacb3('0x10'),auth['isAuthenticated'](),controller[_0xacb3('0x2b')]);router[_0xacb3('0x2c')](_0xacb3('0x12'),auth[_0xacb3('0x7')](),controller['removeImap']);router[_0xacb3('0x2c')]('/:id/out_servers',auth[_0xacb3('0x7')](),controller[_0xacb3('0x2d')]);router[_0xacb3('0x2c')](_0xacb3('0xc'),auth['isAuthenticated'](),controller[_0xacb3('0x2e')]);router[_0xacb3('0x2c')](_0xacb3('0x1b'),auth[_0xacb3('0x7')](),controller[_0xacb3('0x2f')]);module[_0xacb3('0x30')]=router;
\ No newline at end of file
index abbbc74..8b99b03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4163=['BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','exports','STRING'];(function(_0x1a1025,_0x18e46a){var _0x85fa2=function(_0x57d225){while(--_0x57d225){_0x1a1025['push'](_0x1a1025['shift']());}};_0x85fa2(++_0x18e46a);}(_0x4163,0x107));var _0x3416=function(_0x2e9685,_0x9ff127){_0x2e9685=_0x2e9685-0x0;var _0x33bbe6=_0x4163[_0x2e9685];return _0x33bbe6;};'use strict';var Sequelize=require(_0x3416('0x0'));module[_0x3416('0x1')]={'description':{'type':Sequelize[_0x3416('0x2')]},'name':{'type':Sequelize[_0x3416('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x3416('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x3416('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x3416('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3416('0x4')},'fontSize':{'type':Sequelize[_0x3416('0x5')](0x2)[_0x3416('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x3416('0x7')],'defaultValue':function(){return _0x3416('0x8');}},'notificationSound':{'type':Sequelize[_0x3416('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3416('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3416('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3416('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3416('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x3416('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x3416('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5c6bde){if(!_0x5c6bde)this[_0x3416('0xa')](_0x3416('0xb'),null);this[_0x3416('0xa')]('mandatoryDisposition',_0x5c6bde);}},'provider':{'type':Sequelize['ENUM'](_0x3416('0xc'),_0x3416('0xd'),_0x3416('0xe'),_0x3416('0xf')),'defaultValue':null,'get':function(){if(!this[_0x3416('0x10')](_0x3416('0x11')))return _0x3416('0x12');return this[_0x3416('0x10')]('provider');},'set':function(_0x524704){if(_0x524704===_0x3416('0x12'))_0x524704=null;return this[_0x3416('0xa')]('provider',_0x524704);}}};
\ No newline at end of file
+var _0xb091=['setDataValue','mandatoryDispositionPauseId','ENUM','gmail','hotmail','outlook365','getDataValue','custom','provider','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x2e10b2,_0x5b8746){var _0xd145ee=function(_0x2aadf2){while(--_0x2aadf2){_0x2e10b2['push'](_0x2e10b2['shift']());}};_0xd145ee(++_0x5b8746);}(_0xb091,0x100));var _0x1b09=function(_0x43bf3c,_0x4dd81f){_0x43bf3c=_0x43bf3c-0x0;var _0x363d42=_0xb091[_0x43bf3c];return _0x363d42;};'use strict';var Sequelize=require(_0x1b09('0x0'));module[_0x1b09('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x1b09('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x1b09('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x1b09('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x1b09('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x1b09('0x4')]},'markAsUnread':{'type':Sequelize[_0x1b09('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x1b09('0x2')],'allowNull':![],'defaultValue':_0x1b09('0x5')},'fontSize':{'type':Sequelize[_0x1b09('0x6')](0x2)[_0x1b09('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x1b09('0x4')],'defaultValue':function(){return _0x1b09('0x8');}},'notificationSound':{'type':Sequelize[_0x1b09('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1b09('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1b09('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1b09('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1b09('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1b09('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1b09('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1b09('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x1b09('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x453fab){if(!_0x453fab)this[_0x1b09('0xa')](_0x1b09('0xb'),null);this['setDataValue']('mandatoryDisposition',_0x453fab);}},'provider':{'type':Sequelize[_0x1b09('0xc')](_0x1b09('0xd'),_0x1b09('0xe'),'yahoo',_0x1b09('0xf')),'defaultValue':null,'get':function(){if(!this[_0x1b09('0x10')]('provider'))return _0x1b09('0x11');return this['getDataValue']('provider');},'set':function(_0x4b25b1){if(_0x4b25b1==='custom')_0x4b25b1=null;return this['setDataValue'](_0x1b09('0x12'),_0x4b25b1);}}};
\ No newline at end of file
index ddc3736..dfab590 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd13=['addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','CmContact','Contact','User','Owner','fullname','Tag','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','send','json','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','split','List','updatedAt','DESC','CloudProvider','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','Contacts','messageId','attach','out','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','util','path','juice','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','register','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','set','Content-Range','get','UserProfileResource','destroy','stack','name','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','username','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','Imap','Smtp','MailServerIn','Pause','map','MailAccount','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','type','options','includeAll','include','findAll','show','params','MailServerOut','mandatoryDispositionPause','rawAttributes','merge','find','update','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','order','rows','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','isNil','description','role','MailAccounts','autoAssociation','getImap'];(function(_0x2a74da,_0x14df2d){var _0x59e644=function(_0x48786d){while(--_0x48786d){_0x2a74da['push'](_0x2a74da['shift']());}};_0x59e644(++_0x14df2d);}(_0xbd13,0x1bb));var _0x3bd1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbd13[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x3bd1('0x0'));var BPromise=require(_0x3bd1('0x1'));var util=require(_0x3bd1('0x2'));var path=require(_0x3bd1('0x3'));var _=require('lodash');var juice=require(_0x3bd1('0x4'));var Redis=require(_0x3bd1('0x5'));var qs=require(_0x3bd1('0x6'));var logger=require('../../config/logger')(_0x3bd1('0x7'));var config=require(_0x3bd1('0x8'));var db=require('../../mysqldb')['db'];config[_0x3bd1('0x9')]=_[_0x3bd1('0xa')](config[_0x3bd1('0x9')],{'host':_0x3bd1('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3bd1('0x9')]));require('./mailAccount.socket')[_0x3bd1('0xc')](socket);var jayson=require(_0x3bd1('0xd'));var client=jayson[_0x3bd1('0xe')][_0x3bd1('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x201cb5,_0x5d530a,_0x1c46a2,_0x1faa44){return new BPromise(function(_0x189010,_0xf3e610){var _0x5e63e1=_0x1faa44||client;return _0x5e63e1[_0x3bd1('0x10')](_0x201cb5,_0x1c46a2)[_0x3bd1('0x11')](function(_0x2b88c9){logger['info'](_0x3bd1('0x12'),_0x5d530a,_0x3bd1('0x13'));logger[_0x3bd1('0x14')](_0x3bd1('0x15'),_0x5d530a,_0x3bd1('0x13'),JSON[_0x3bd1('0x16')](_0x2b88c9));if(_0x2b88c9[_0x3bd1('0x17')]){if(_0x2b88c9[_0x3bd1('0x17')][_0x3bd1('0x18')]===0x1f4){logger[_0x3bd1('0x17')](_0x3bd1('0x12'),_0x5d530a,_0x2b88c9[_0x3bd1('0x17')]['message']);return _0xf3e610(_0x2b88c9[_0x3bd1('0x17')][_0x3bd1('0x19')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x5d530a,_0x2b88c9[_0x3bd1('0x17')]['message']);return _0x189010(_0x2b88c9[_0x3bd1('0x17')][_0x3bd1('0x19')]);}else{logger['info'](_0x3bd1('0x12'),_0x5d530a,_0x3bd1('0x13'));_0x189010(_0x2b88c9[_0x3bd1('0x1a')][_0x3bd1('0x19')]);}})[_0x3bd1('0x1b')](function(_0x51eb4d){logger[_0x3bd1('0x17')](_0x3bd1('0x12'),_0x5d530a,_0x51eb4d);_0xf3e610(_0x51eb4d);});});}function respondWithStatusCode(_0x1078f1,_0x542f50){_0x542f50=_0x542f50||0xcc;return function(_0x43dac6){if(_0x43dac6){return _0x1078f1[_0x3bd1('0x1c')](_0x542f50);}return _0x1078f1[_0x3bd1('0x1d')](_0x542f50)[_0x3bd1('0x1e')]();};}function respondWithResult(_0x52ba2f,_0x384122){_0x384122=_0x384122||0xc8;return function(_0x6fad1d){if(_0x6fad1d){return _0x52ba2f[_0x3bd1('0x1d')](_0x384122)['json'](_0x6fad1d);}};}function respondWithFilteredResult(_0x4d7952,_0x3366f2){return function(_0x25f6ac){if(_0x25f6ac){var _0x53d5b2=typeof _0x3366f2[_0x3bd1('0x1f')]===_0x3bd1('0x20')&&typeof _0x3366f2['limit']===_0x3bd1('0x20');var _0x473d5e=_0x25f6ac['count'];var _0x396b83=_0x53d5b2?0x0:_0x3366f2[_0x3bd1('0x1f')];var _0x30ae65=_0x53d5b2?_0x25f6ac[_0x3bd1('0x21')]:_0x3366f2[_0x3bd1('0x1f')]+_0x3366f2['limit'];var _0x44d791;if(_0x30ae65>=_0x473d5e){_0x30ae65=_0x473d5e;_0x44d791=0xc8;}else{_0x44d791=0xce;}_0x4d7952[_0x3bd1('0x1d')](_0x44d791);return _0x4d7952[_0x3bd1('0x22')](_0x3bd1('0x23'),_0x396b83+'-'+_0x30ae65+'/'+_0x473d5e)['json'](_0x25f6ac);}return null;};}function saveUpdates(_0x35c60e){return function(_0x28b9b7){if(_0x28b9b7){return _0x28b9b7['update'](_0x35c60e)[_0x3bd1('0x11')](function(_0x548842){return _0x548842;});}return null;};}function removeEntity(_0x2d953e){return function(_0x1fcc45){if(_0x1fcc45){return _0x1fcc45['destroy']()['then'](function(){var _0x35fc45=_0x1fcc45[_0x3bd1('0x24')]({'plain':!![]});var _0x44b4c3='MailAccounts';return db[_0x3bd1('0x25')][_0x3bd1('0x26')]({'where':{'type':_0x44b4c3,'resourceId':_0x35fc45['id']}})[_0x3bd1('0x11')](function(){return _0x1fcc45;});})['then'](function(){_0x2d953e['status'](0xcc)[_0x3bd1('0x1e')]();});}};}function handleEntityNotFound(_0x5cfd1f){return function(_0x42a3e0){if(!_0x42a3e0){_0x5cfd1f['sendStatus'](0x194);}return _0x42a3e0;};}function handleError(_0x51940e,_0x509686){_0x509686=_0x509686||0x1f4;return function(_0x3e16b9){logger[_0x3bd1('0x17')](_0x3e16b9[_0x3bd1('0x27')]);if(_0x3e16b9[_0x3bd1('0x28')]){delete _0x3e16b9[_0x3bd1('0x28')];}_0x51940e[_0x3bd1('0x1d')](_0x509686)['send'](_0x3e16b9);};}function getImapHost(_0x50b9f3){switch(_0x50b9f3){case'gmail':return _0x3bd1('0x29');case _0x3bd1('0x2a'):return'imap.mail.yahoo.com';case _0x3bd1('0x2b'):return _0x3bd1('0x2c');case _0x3bd1('0x2d'):return _0x3bd1('0x2e');}throw new Error('Unknown\x20email\x20service\x20provider',_0x50b9f3);}function getSmtpHost(_0x3505de){switch(_0x3505de){case _0x3bd1('0x2f'):return _0x3bd1('0x30');case _0x3bd1('0x2a'):return _0x3bd1('0x31');case'hotmail':return _0x3bd1('0x32');case _0x3bd1('0x2d'):return _0x3bd1('0x33');}throw new Error(_0x3bd1('0x34'),_0x3505de);}function getAuthenticationOptions(_0x10152b,_0x16e2db){var _0xed0ea5={};var _0x54898e={};if(_0x10152b){_0xed0ea5['user']=_0x54898e[_0x3bd1('0x35')]=_0x16e2db[_0x3bd1('0x36')];_0xed0ea5[_0x3bd1('0x37')]=_0x54898e['pass']=_0x16e2db[_0x3bd1('0x37')];if(_0x16e2db['modernAuthentication']){_0xed0ea5[_0x3bd1('0x38')]=_0x54898e[_0x3bd1('0x38')]=!![];_0xed0ea5[_0x3bd1('0x39')]=_0x54898e[_0x3bd1('0x39')]=_0x16e2db[_0x3bd1('0x39')];_0xed0ea5[_0x3bd1('0x37')]=_0x54898e[_0x3bd1('0x3a')]=null;}else{_0xed0ea5[_0x3bd1('0x39')]=_0x54898e['CloudProviderId']=null;}_0xed0ea5[_0x3bd1('0x3b')]=getImapHost(_0x10152b);_0xed0ea5[_0x3bd1('0x3c')]=0x3e1;_0x54898e[_0x3bd1('0x3b')]=getSmtpHost(_0x10152b);_0x54898e[_0x3bd1('0x3c')]=0x24b;_0x54898e[_0x3bd1('0x3d')]=![];_0xed0ea5[_0x3bd1('0x3e')]=_0x54898e[_0x3bd1('0x3e')]=null;}else{if(_0x16e2db[_0x3bd1('0x3f')]){_0xed0ea5[_0x3bd1('0x35')]=_0x54898e[_0x3bd1('0x35')]=_0x16e2db[_0x3bd1('0x36')];_0xed0ea5[_0x3bd1('0x37')]=_0x54898e[_0x3bd1('0x3a')]=_0x16e2db[_0x3bd1('0x37')];}else{_0xed0ea5[_0x3bd1('0x3f')]=_0x54898e['authentication']=![];_0xed0ea5[_0x3bd1('0x35')]=_0x54898e[_0x3bd1('0x35')]=null;_0xed0ea5[_0x3bd1('0x37')]=_0x54898e['pass']=null;}_0xed0ea5[_0x3bd1('0x3b')]=_0x16e2db[_0x3bd1('0x40')][_0x3bd1('0x3b')];_0xed0ea5['port']=_0x16e2db[_0x3bd1('0x40')]['port'];_0x54898e[_0x3bd1('0x3b')]=_0x16e2db[_0x3bd1('0x41')]['host'];_0x54898e['port']=_0x16e2db['Smtp'][_0x3bd1('0x3c')];}return{'Imap':_0xed0ea5,'Smtp':_0x54898e};}exports['index']=function(_0x6175b0,_0x47efcf){var _0x3cef87={'include':[{'model':db[_0x3bd1('0x42')],'as':_0x3bd1('0x40')},{'model':db['MailServerOut'],'as':_0x3bd1('0x41')},{'model':db[_0x3bd1('0x43')],'as':'mandatoryDispositionPause'}]},_0x594ad7={},_0x257d6f={'count':0x0,'rows':[]};var _0x31f043=_[_0x3bd1('0x44')](db[_0x3bd1('0x45')]['rawAttributes'],function(_0xe0076e){return{'name':_0xe0076e[_0x3bd1('0x46')],'type':_0xe0076e['type'][_0x3bd1('0x47')]};});_0x594ad7[_0x3bd1('0x48')]=_[_0x3bd1('0x44')](_0x31f043,_0x3bd1('0x28'));_0x594ad7['query']=_[_0x3bd1('0x49')](_0x6175b0[_0x3bd1('0x4a')]);_0x594ad7[_0x3bd1('0x4b')]=_['intersection'](_0x594ad7[_0x3bd1('0x48')],_0x594ad7['query']);_0x3cef87[_0x3bd1('0x4c')]=_[_0x3bd1('0x4d')](_0x594ad7['model'],qs[_0x3bd1('0x4e')](_0x6175b0[_0x3bd1('0x4a')]['fields']));_0x3cef87[_0x3bd1('0x4c')]=_0x3cef87[_0x3bd1('0x4c')][_0x3bd1('0x4f')]?_0x3cef87[_0x3bd1('0x4c')]:_0x594ad7[_0x3bd1('0x48')];if(!_0x6175b0[_0x3bd1('0x4a')][_0x3bd1('0x50')](_0x3bd1('0x51'))){_0x3cef87['limit']=qs[_0x3bd1('0x52')](_0x6175b0[_0x3bd1('0x4a')][_0x3bd1('0x52')]);_0x3cef87['offset']=qs[_0x3bd1('0x1f')](_0x6175b0[_0x3bd1('0x4a')][_0x3bd1('0x1f')]);}_0x3cef87['order']=qs[_0x3bd1('0x53')](_0x6175b0[_0x3bd1('0x4a')][_0x3bd1('0x53')]);_0x3cef87[_0x3bd1('0x54')]=qs[_0x3bd1('0x4b')](_[_0x3bd1('0x55')](_0x6175b0[_0x3bd1('0x4a')],_0x594ad7['filters']),_0x31f043);if(_0x6175b0[_0x3bd1('0x4a')][_0x3bd1('0x56')]){_0x3cef87['where']=_['merge'](_0x3cef87['where'],{'$or':_[_0x3bd1('0x44')](_0x31f043,function(_0x5710fa){if(_0x5710fa[_0x3bd1('0x57')]!=='VIRTUAL'){var _0x3d47aa={};_0x3d47aa[_0x5710fa[_0x3bd1('0x28')]]={'$like':'%'+_0x6175b0[_0x3bd1('0x4a')][_0x3bd1('0x56')]+'%'};return _0x3d47aa;}})});}_0x3cef87=_['merge']({},_0x3cef87,_0x6175b0[_0x3bd1('0x58')]);var _0x726c96={'where':_0x3cef87[_0x3bd1('0x54')]};return db['MailAccount']['count'](_0x726c96)['then'](function(_0x682e0d){_0x257d6f['count']=_0x682e0d;if(_0x6175b0[_0x3bd1('0x4a')][_0x3bd1('0x59')]){_0x3cef87[_0x3bd1('0x5a')]=[{'all':!![]}];}return db[_0x3bd1('0x45')][_0x3bd1('0x5b')](_0x3cef87);})[_0x3bd1('0x11')](function(_0x2a922f){_0x257d6f['rows']=_0x2a922f;return _0x257d6f;})[_0x3bd1('0x11')](respondWithFilteredResult(_0x47efcf,_0x3cef87))[_0x3bd1('0x1b')](handleError(_0x47efcf,null));};exports[_0x3bd1('0x5c')]=function(_0x3698f5,_0x2a80c3){var _0x2284c5={'raw':![],'where':{'id':_0x3698f5[_0x3bd1('0x5d')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x3bd1('0x5e')],'as':_0x3bd1('0x41')},{'model':db[_0x3bd1('0x43')],'as':_0x3bd1('0x5f')}]},_0x1ca110={};_0x1ca110[_0x3bd1('0x48')]=_[_0x3bd1('0x49')](db['MailAccount'][_0x3bd1('0x60')]);_0x1ca110['query']=_['keys'](_0x3698f5[_0x3bd1('0x4a')]);_0x1ca110[_0x3bd1('0x4b')]=_['intersection'](_0x1ca110['model'],_0x1ca110[_0x3bd1('0x4a')]);_0x2284c5[_0x3bd1('0x4c')]=_[_0x3bd1('0x4d')](_0x1ca110[_0x3bd1('0x48')],qs[_0x3bd1('0x4e')](_0x3698f5[_0x3bd1('0x4a')][_0x3bd1('0x4e')]));_0x2284c5[_0x3bd1('0x4c')]=_0x2284c5[_0x3bd1('0x4c')]['length']?_0x2284c5[_0x3bd1('0x4c')]:_0x1ca110[_0x3bd1('0x48')];if(_0x3698f5[_0x3bd1('0x4a')][_0x3bd1('0x59')]){_0x2284c5['include']=[{'all':!![]}];}_0x2284c5=_[_0x3bd1('0x61')]({},_0x2284c5,_0x3698f5[_0x3bd1('0x58')]);return db[_0x3bd1('0x45')][_0x3bd1('0x62')](_0x2284c5)[_0x3bd1('0x11')](handleEntityNotFound(_0x2a80c3,null))[_0x3bd1('0x11')](respondWithResult(_0x2a80c3,null))[_0x3bd1('0x1b')](handleError(_0x2a80c3,null));};exports[_0x3bd1('0x63')]=function(_0x1efa26,_0x355acd){if(_0x1efa26[_0x3bd1('0x64')]['id']){delete _0x1efa26[_0x3bd1('0x64')]['id'];}var _0x1bbe86=_0x1efa26[_0x3bd1('0x64')][_0x3bd1('0x65')]===_0x3bd1('0x66')?null:_0x1efa26['body']['provider'];var _0xc444ee=_0x1efa26[_0x3bd1('0x64')]['Imap']||{};var _0x28a1ca=_0x1efa26[_0x3bd1('0x64')][_0x3bd1('0x41')]||{};if(_0x1bbe86){_0xc444ee[_0x3bd1('0x3b')]=getImapHost(_0x1bbe86);_0xc444ee[_0x3bd1('0x3c')]=0x3e1;_0x28a1ca[_0x3bd1('0x3b')]=getSmtpHost(_0x1bbe86);_0x28a1ca['port']=0x24b;_0x28a1ca[_0x3bd1('0x3d')]=![];}if(_0x28a1ca[_0x3bd1('0x38')]){_0x28a1ca[_0x3bd1('0x3d')]=![];}else{_0x28a1ca[_0x3bd1('0x39')]=null;}if(!_0xc444ee['modernAuthentication'])_0xc444ee[_0x3bd1('0x39')]=null;_0x1efa26[_0x3bd1('0x64')]['Imap']=_0xc444ee;_0x1efa26[_0x3bd1('0x64')][_0x3bd1('0x41')]=_0x28a1ca;return db[_0x3bd1('0x45')][_0x3bd1('0x62')]({'where':{'id':_0x1efa26['params']['id']},'include':[{'model':db[_0x3bd1('0x42')],'as':_0x3bd1('0x40')},{'model':db[_0x3bd1('0x5e')],'as':_0x3bd1('0x41')},{'model':db[_0x3bd1('0x43')],'as':_0x3bd1('0x5f')}]})[_0x3bd1('0x11')](handleEntityNotFound(_0x355acd,null))[_0x3bd1('0x11')](function(_0x2c514e){if(!_0x2c514e)throw new Error(_0x3bd1('0x67'));if(_0x2c514e[_0x3bd1('0x3e')])delete _0x1efa26['body']['Imap'];return _0x2c514e;})[_0x3bd1('0x11')](saveUpdates(_0x1efa26[_0x3bd1('0x64')],null))[_0x3bd1('0x11')](function(_0x334745){if(!_0x1efa26[_0x3bd1('0x64')][_0x3bd1('0x40')])return _0x334745;return db[_0x3bd1('0x42')][_0x3bd1('0x63')](_0x1efa26[_0x3bd1('0x64')][_0x3bd1('0x40')],{'where':{'MailAccountId':_0x334745['id']}})[_0x3bd1('0x11')](function(){return _0x334745;});})['then'](function(_0x5c3115){if(!_0x1efa26[_0x3bd1('0x64')][_0x3bd1('0x41')])return _0x5c3115;return db[_0x3bd1('0x5e')][_0x3bd1('0x63')](_0x1efa26['body'][_0x3bd1('0x41')],{'where':{'MailAccountId':_0x5c3115['id']}})[_0x3bd1('0x11')](function(){return _0x5c3115;});})[_0x3bd1('0x11')](respondWithResult(_0x355acd,null))[_0x3bd1('0x1b')](handleError(_0x355acd,null));};exports[_0x3bd1('0x68')]=function(_0x4ac9a6,_0x215b11){return db[_0x3bd1('0x45')][_0x3bd1('0x68')]()[_0x3bd1('0x11')](respondWithResult(_0x215b11,null))[_0x3bd1('0x1b')](handleError(_0x215b11,null));};exports[_0x3bd1('0x69')]=function(_0x190bf9,_0x5cb7f4){if(_0x190bf9[_0x3bd1('0x64')]['id']){delete _0x190bf9[_0x3bd1('0x64')]['id'];}return db['MailAccount'][_0x3bd1('0x62')]({'where':{'id':_0x190bf9[_0x3bd1('0x5d')]['id']}})[_0x3bd1('0x11')](handleEntityNotFound(_0x5cb7f4,null))[_0x3bd1('0x11')](function(_0x3dc978){if(_0x3dc978){_0x190bf9[_0x3bd1('0x64')][_0x3bd1('0x6a')]=_0x3dc978['id'];return db[_0x3bd1('0x6b')][_0x3bd1('0x6c')](_0x190bf9[_0x3bd1('0x64')]);}})[_0x3bd1('0x11')](respondWithResult(_0x5cb7f4,null))[_0x3bd1('0x1b')](handleError(_0x5cb7f4,null));};exports['getDispositions']=function(_0x4addf5,_0x503623){var _0x503468={'raw':![],'where':{}};var _0x177973={};var _0x14056b={'count':0x0,'rows':[]};return db[_0x3bd1('0x45')]['findOne']({'where':{'id':_0x4addf5[_0x3bd1('0x5d')]['id']}})[_0x3bd1('0x11')](handleEntityNotFound(_0x503623,null))[_0x3bd1('0x11')](function(_0x1ff586){if(_0x1ff586){_0x177973['model']=_[_0x3bd1('0x49')](db[_0x3bd1('0x6b')][_0x3bd1('0x60')]);_0x177973[_0x3bd1('0x4a')]=_[_0x3bd1('0x49')](_0x4addf5[_0x3bd1('0x4a')]);_0x177973['filters']=_[_0x3bd1('0x4d')](_0x177973['model'],_0x177973['query']);_0x503468[_0x3bd1('0x4c')]=_[_0x3bd1('0x4d')](_0x177973[_0x3bd1('0x48')],qs[_0x3bd1('0x4e')](_0x4addf5[_0x3bd1('0x4a')][_0x3bd1('0x4e')]));_0x503468['attributes']=_0x503468[_0x3bd1('0x4c')][_0x3bd1('0x4f')]?_0x503468[_0x3bd1('0x4c')]:_0x177973[_0x3bd1('0x48')];if(!_0x4addf5['query'][_0x3bd1('0x50')](_0x3bd1('0x51'))){_0x503468['limit']=qs[_0x3bd1('0x52')](_0x4addf5[_0x3bd1('0x4a')][_0x3bd1('0x52')]);_0x503468[_0x3bd1('0x1f')]=qs[_0x3bd1('0x1f')](_0x4addf5[_0x3bd1('0x4a')][_0x3bd1('0x1f')]);}_0x503468[_0x3bd1('0x6d')]=qs[_0x3bd1('0x53')](_0x4addf5['query']['sort']);_0x503468['where']=qs[_0x3bd1('0x4b')](_['pick'](_0x4addf5[_0x3bd1('0x4a')],_0x177973[_0x3bd1('0x4b')]));_0x503468[_0x3bd1('0x54')]['MailAccountId']=_0x1ff586['id'];if(_0x4addf5['query'][_0x3bd1('0x56')]){_0x503468[_0x3bd1('0x54')]=_[_0x3bd1('0x61')](_0x503468[_0x3bd1('0x54')],{'$or':_['map'](_0x503468['attributes'],function(_0x3f8730){var _0x280391={};_0x280391[_0x3f8730]={'$like':'%'+_0x4addf5['query'][_0x3bd1('0x56')]+'%'};return _0x280391;})});}_0x503468=_[_0x3bd1('0x61')]({},_0x503468,_0x4addf5[_0x3bd1('0x58')]);return db[_0x3bd1('0x6b')][_0x3bd1('0x21')]({'where':_0x503468[_0x3bd1('0x54')]})[_0x3bd1('0x11')](function(_0x324484){_0x14056b[_0x3bd1('0x21')]=_0x324484;if(_0x4addf5[_0x3bd1('0x4a')][_0x3bd1('0x59')]){_0x503468[_0x3bd1('0x5a')]=[{'all':!![]}];}return db[_0x3bd1('0x6b')][_0x3bd1('0x5b')](_0x503468);})[_0x3bd1('0x11')](function(_0xc08240){_0x14056b[_0x3bd1('0x6e')]=_0xc08240;return _0x14056b;});}})['then'](respondWithFilteredResult(_0x503623,_0x503468))[_0x3bd1('0x1b')](handleError(_0x503623,null));};exports[_0x3bd1('0x6f')]=function(_0x4ddee1,_0x34564e){return db['MailAccount'][_0x3bd1('0x62')]({'where':{'id':_0x4ddee1[_0x3bd1('0x5d')]['id']}})[_0x3bd1('0x11')](handleEntityNotFound(_0x34564e,null))['then'](function(_0xfc9fa3){if(_0xfc9fa3){return _0xfc9fa3[_0x3bd1('0x6f')](_0x4ddee1[_0x3bd1('0x4a')][_0x3bd1('0x70')]);}})['then'](respondWithStatusCode(_0x34564e,null))['catch'](handleError(_0x34564e,null));};exports[_0x3bd1('0x71')]=function(_0xe0374b,_0x492d22){if(_0xe0374b[_0x3bd1('0x64')]['id']){delete _0xe0374b['body']['id'];}return db['MailAccount'][_0x3bd1('0x62')]({'where':{'id':_0xe0374b[_0x3bd1('0x5d')]['id']}})['then'](handleEntityNotFound(_0x492d22,null))['then'](function(_0x2136af){if(_0x2136af){_0xe0374b[_0x3bd1('0x64')][_0x3bd1('0x6a')]=_0x2136af['id'];return db['CannedAnswer'][_0x3bd1('0x6c')](_0xe0374b[_0x3bd1('0x64')]);}})[_0x3bd1('0x11')](respondWithResult(_0x492d22,null))[_0x3bd1('0x1b')](handleError(_0x492d22,null));};exports[_0x3bd1('0x72')]=function(_0x17ee70,_0x2a800e){var _0x27c429={'raw':![],'where':{}};var _0x28e62b={};var _0x11e0b2={'count':0x0,'rows':[]};return db[_0x3bd1('0x45')][_0x3bd1('0x73')]({'where':{'id':_0x17ee70[_0x3bd1('0x5d')]['id']}})[_0x3bd1('0x11')](handleEntityNotFound(_0x2a800e,null))[_0x3bd1('0x11')](function(_0x1b47d8){if(_0x1b47d8){_0x28e62b['model']=_[_0x3bd1('0x49')](db[_0x3bd1('0x74')][_0x3bd1('0x60')]);_0x28e62b[_0x3bd1('0x4a')]=_[_0x3bd1('0x49')](_0x17ee70[_0x3bd1('0x4a')]);_0x28e62b['filters']=_['intersection'](_0x28e62b[_0x3bd1('0x48')],_0x28e62b['query']);_0x27c429[_0x3bd1('0x4c')]=_[_0x3bd1('0x4d')](_0x28e62b[_0x3bd1('0x48')],qs[_0x3bd1('0x4e')](_0x17ee70['query'][_0x3bd1('0x4e')]));_0x27c429['attributes']=_0x27c429[_0x3bd1('0x4c')][_0x3bd1('0x4f')]?_0x27c429['attributes']:_0x28e62b[_0x3bd1('0x48')];if(!_0x17ee70['query'][_0x3bd1('0x50')]('nolimit')){_0x27c429[_0x3bd1('0x52')]=qs[_0x3bd1('0x52')](_0x17ee70[_0x3bd1('0x4a')][_0x3bd1('0x52')]);_0x27c429[_0x3bd1('0x1f')]=qs['offset'](_0x17ee70['query'][_0x3bd1('0x1f')]);}_0x27c429['order']=qs[_0x3bd1('0x53')](_0x17ee70[_0x3bd1('0x4a')]['sort']);_0x27c429['where']=qs['filters'](_[_0x3bd1('0x55')](_0x17ee70[_0x3bd1('0x4a')],_0x28e62b[_0x3bd1('0x4b')]));_0x27c429[_0x3bd1('0x54')]['MailAccountId']=_0x1b47d8['id'];if(_0x17ee70[_0x3bd1('0x4a')][_0x3bd1('0x56')]){_0x27c429[_0x3bd1('0x54')]=_[_0x3bd1('0x61')](_0x27c429[_0x3bd1('0x54')],{'$or':_['map'](_0x27c429[_0x3bd1('0x4c')],function(_0xe31be7){var _0xe285b0={};_0xe285b0[_0xe31be7]={'$like':'%'+_0x17ee70[_0x3bd1('0x4a')][_0x3bd1('0x56')]+'%'};return _0xe285b0;})});}_0x27c429=_[_0x3bd1('0x61')]({},_0x27c429,_0x17ee70[_0x3bd1('0x58')]);return db[_0x3bd1('0x74')][_0x3bd1('0x21')]({'where':_0x27c429[_0x3bd1('0x54')]})[_0x3bd1('0x11')](function(_0x2bfdb9){_0x11e0b2[_0x3bd1('0x21')]=_0x2bfdb9;if(_0x17ee70[_0x3bd1('0x4a')]['includeAll']){_0x27c429['include']=[{'all':!![]}];}return db[_0x3bd1('0x74')][_0x3bd1('0x5b')](_0x27c429);})['then'](function(_0x455e88){_0x11e0b2[_0x3bd1('0x6e')]=_0x455e88;return _0x11e0b2;});}})[_0x3bd1('0x11')](respondWithFilteredResult(_0x2a800e,_0x27c429))[_0x3bd1('0x1b')](handleError(_0x2a800e,null));};exports[_0x3bd1('0x75')]=function(_0x40df17,_0x46bc8a){return db[_0x3bd1('0x45')][_0x3bd1('0x62')]({'where':{'id':_0x40df17[_0x3bd1('0x5d')]['id']}})[_0x3bd1('0x11')](handleEntityNotFound(_0x46bc8a,null))[_0x3bd1('0x11')](function(_0x3f1bfa){if(_0x3f1bfa){return _0x3f1bfa['removeAnswers'](_0x40df17[_0x3bd1('0x4a')][_0x3bd1('0x70')]);}})[_0x3bd1('0x11')](respondWithStatusCode(_0x46bc8a,null))[_0x3bd1('0x1b')](handleError(_0x46bc8a,null));};exports['create']=function(_0x1136b5,_0x21270c){var _0x46ad64={'name':_0x1136b5['body'][_0x3bd1('0x28')],'key':_0x1136b5['body'][_0x3bd1('0x47')],'provider':_0x1136b5[_0x3bd1('0x64')]['provider']===_0x3bd1('0x66')?null:_0x1136b5[_0x3bd1('0x64')][_0x3bd1('0x65')],'email':_0x1136b5[_0x3bd1('0x64')]['email'],'ListId':_0x1136b5[_0x3bd1('0x64')]['ListId'],'active':!_[_0x3bd1('0x76')](_0x1136b5[_0x3bd1('0x64')]['active'])?_0x1136b5[_0x3bd1('0x64')]['active']:!![],'description':_0x1136b5['body'][_0x3bd1('0x77')]||null};var _0x5efdc4=getAuthenticationOptions(_0x46ad64[_0x3bd1('0x65')],_0x1136b5['body']);_0x46ad64[_0x3bd1('0x40')]=_0x5efdc4[_0x3bd1('0x40')];_0x46ad64[_0x3bd1('0x41')]=_0x5efdc4[_0x3bd1('0x41')];return db[_0x3bd1('0x45')][_0x3bd1('0x6c')](_0x46ad64,{'include':[{'model':db['MailServerOut'],'as':_0x3bd1('0x41')},{'model':db[_0x3bd1('0x42')],'as':_0x3bd1('0x40')}]})['then'](function(_0x2e72e7){var _0x5a5ecf=_0x1136b5[_0x3bd1('0x35')][_0x3bd1('0x24')]({'plain':!![]});if(!_0x5a5ecf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a5ecf[_0x3bd1('0x78')]==='user'){var _0xc05bb3=_0x2e72e7[_0x3bd1('0x24')]({'plain':!![]});return db['UserProfileSection'][_0x3bd1('0x62')]({'where':{'name':_0x3bd1('0x79'),'userProfileId':_0x5a5ecf['userProfileId']},'raw':!![]})[_0x3bd1('0x11')](function(_0x1e02b5){if(_0x1e02b5&&_0x1e02b5[_0x3bd1('0x7a')]===0x0){return db['UserProfileResource'][_0x3bd1('0x6c')]({'name':_0xc05bb3['name'],'resourceId':_0xc05bb3['id'],'type':_0x1e02b5[_0x3bd1('0x28')],'sectionId':_0x1e02b5['id']},{})[_0x3bd1('0x11')](function(){return _0x2e72e7;});}else{return _0x2e72e7;}})['catch'](function(_0x13b040){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13b040);throw _0x13b040;});}return _0x2e72e7;})[_0x3bd1('0x11')](respondWithResult(_0x21270c,0xc9))['catch'](handleError(_0x21270c,null));};exports[_0x3bd1('0x7b')]=function(_0x465b32,_0x2b9c6a){return db[_0x3bd1('0x45')]['findOne']({'where':{'id':_0x465b32[_0x3bd1('0x5d')]['id']}})[_0x3bd1('0x11')](handleEntityNotFound(_0x2b9c6a,null))[_0x3bd1('0x11')](function(_0x5997e6){if(_0x5997e6){return _0x5997e6[_0x3bd1('0x7b')]();}return null;})[_0x3bd1('0x11')](respondWithResult(_0x2b9c6a,null))[_0x3bd1('0x1b')](handleError(_0x2b9c6a,null));};exports[_0x3bd1('0x7c')]=function(_0x186d38,_0x2b3b1b){if(_0x186d38[_0x3bd1('0x64')]['id']){delete _0x186d38[_0x3bd1('0x64')]['id'];}return db[_0x3bd1('0x45')][_0x3bd1('0x62')]({'where':{'id':_0x186d38[_0x3bd1('0x5d')]['id']}})[_0x3bd1('0x11')](handleEntityNotFound(_0x2b3b1b,null))[_0x3bd1('0x11')](function(_0x752a2d){if(_0x752a2d){_0x186d38[_0x3bd1('0x64')][_0x3bd1('0x6a')]=_0x752a2d['id'];return db[_0x3bd1('0x42')][_0x3bd1('0x6c')](_0x186d38[_0x3bd1('0x64')]);}})[_0x3bd1('0x11')](respondWithResult(_0x2b3b1b,null))['catch'](handleError(_0x2b3b1b,null));};exports[_0x3bd1('0x7d')]=function(_0x4726bb,_0x2a2277){return db['MailAccount'][_0x3bd1('0x73')]({'where':{'id':_0x4726bb[_0x3bd1('0x5d')]['id']}})[_0x3bd1('0x11')](handleEntityNotFound(_0x2a2277,null))['then'](function(_0x136cf9){if(_0x136cf9){return _0x136cf9[_0x3bd1('0x7e')](null);}return null;})[_0x3bd1('0x11')](respondWithStatusCode(_0x2a2277,null))[_0x3bd1('0x1b')](handleError(_0x2a2277,null));};exports[_0x3bd1('0x7f')]=function(_0x44bc8f,_0x22886a){return db[_0x3bd1('0x45')][_0x3bd1('0x73')]({'where':{'id':_0x44bc8f[_0x3bd1('0x5d')]['id']}})[_0x3bd1('0x11')](handleEntityNotFound(_0x22886a,null))[_0x3bd1('0x11')](function(_0x47fd75){if(_0x47fd75){return _0x47fd75[_0x3bd1('0x7f')]();}return null;})[_0x3bd1('0x11')](respondWithResult(_0x22886a,null))[_0x3bd1('0x1b')](handleError(_0x22886a,null));};exports[_0x3bd1('0x80')]=function(_0x456c12,_0x808594){if(_0x456c12[_0x3bd1('0x64')]['id']){delete _0x456c12[_0x3bd1('0x64')]['id'];}return db[_0x3bd1('0x45')][_0x3bd1('0x62')]({'where':{'id':_0x456c12[_0x3bd1('0x5d')]['id']}})[_0x3bd1('0x11')](handleEntityNotFound(_0x808594,null))['then'](function(_0x2ed9c9){if(_0x2ed9c9){_0x456c12[_0x3bd1('0x64')][_0x3bd1('0x6a')]=_0x2ed9c9['id'];return db['MailServerOut']['create'](_0x456c12['body']);}})['then'](respondWithResult(_0x808594,null))[_0x3bd1('0x1b')](handleError(_0x808594,null));};exports[_0x3bd1('0x81')]=function(_0x3687cf,_0x4219bd){return db['MailAccount'][_0x3bd1('0x73')]({'where':{'id':_0x3687cf[_0x3bd1('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4219bd,null))[_0x3bd1('0x11')](function(_0x598c09){if(_0x598c09){return _0x598c09[_0x3bd1('0x82')](null);}return null;})['then'](respondWithStatusCode(_0x4219bd,null))[_0x3bd1('0x1b')](handleError(_0x4219bd,null));};exports[_0x3bd1('0x83')]=function(_0xd13686,_0x5350cf){return db['MailInteraction']['find']({'where':{'id':_0xd13686[_0x3bd1('0x5d')]['id']}})[_0x3bd1('0x11')](handleEntityNotFound(_0x5350cf,null))[_0x3bd1('0x11')](function(_0x2a4960){if(_0x2a4960){return _0x2a4960[_0x3bd1('0x83')](_0xd13686[_0x3bd1('0x64')][_0x3bd1('0x70')],_['omit'](_0xd13686[_0x3bd1('0x64')],[_0x3bd1('0x70'),'id'])||{});}})[_0x3bd1('0x11')](respondWithResult(_0x5350cf,null))[_0x3bd1('0x1b')](handleError(_0x5350cf,null));};exports['getInteractions']=function(_0x547bd1,_0x39f44a){var _0x4ea5b2={'raw':![],'where':{}};var _0x3677e1={};var _0x203265={'count':0x0,'rows':[]};return db[_0x3bd1('0x45')][_0x3bd1('0x73')]({'where':{'id':_0x547bd1[_0x3bd1('0x5d')]['id']}})[_0x3bd1('0x11')](handleEntityNotFound(_0x39f44a,null))[_0x3bd1('0x11')](function(_0x2926df){if(_0x2926df){_0x3677e1[_0x3bd1('0x48')]=_[_0x3bd1('0x49')](db[_0x3bd1('0x84')][_0x3bd1('0x60')]);_0x3677e1[_0x3bd1('0x4a')]=_[_0x3bd1('0x49')](_0x547bd1['query']);_0x3677e1[_0x3bd1('0x4b')]=_[_0x3bd1('0x4d')](_0x3677e1['model'],_0x3677e1[_0x3bd1('0x4a')]);_0x4ea5b2[_0x3bd1('0x4c')]=_[_0x3bd1('0x4d')](_0x3677e1[_0x3bd1('0x48')],qs['fields'](_0x547bd1[_0x3bd1('0x4a')]['fields']));_0x4ea5b2[_0x3bd1('0x4c')]=_0x4ea5b2[_0x3bd1('0x4c')][_0x3bd1('0x4f')]?_0x4ea5b2[_0x3bd1('0x4c')]:_0x3677e1[_0x3bd1('0x48')];if(!_0x547bd1[_0x3bd1('0x4a')][_0x3bd1('0x50')](_0x3bd1('0x51'))){_0x4ea5b2['limit']=qs[_0x3bd1('0x52')](_0x547bd1[_0x3bd1('0x4a')][_0x3bd1('0x52')]);_0x4ea5b2[_0x3bd1('0x1f')]=qs['offset'](_0x547bd1[_0x3bd1('0x4a')][_0x3bd1('0x1f')]);}_0x4ea5b2[_0x3bd1('0x6d')]=qs['sort'](_0x547bd1[_0x3bd1('0x4a')][_0x3bd1('0x53')]);_0x4ea5b2[_0x3bd1('0x54')]=qs[_0x3bd1('0x4b')](_['pick'](_0x547bd1[_0x3bd1('0x4a')],_0x3677e1[_0x3bd1('0x4b')]));_0x4ea5b2[_0x3bd1('0x54')]['MailAccountId']=_0x2926df['id'];if(_0x547bd1['query']['filter']){_0x4ea5b2[_0x3bd1('0x54')]=_[_0x3bd1('0x61')](_0x4ea5b2[_0x3bd1('0x54')],{'$or':_[_0x3bd1('0x44')](_0x4ea5b2['attributes'],function(_0x1456b1){var _0x144d50={};_0x144d50[_0x1456b1]={'$like':'%'+_0x547bd1[_0x3bd1('0x4a')]['filter']+'%'};return _0x144d50;})});}_0x4ea5b2=_['merge']({},_0x4ea5b2,_0x547bd1['options']);return db['MailInteraction'][_0x3bd1('0x21')]({'where':_0x4ea5b2[_0x3bd1('0x54')]})['then'](function(_0xe2fb08){_0x203265[_0x3bd1('0x21')]=_0xe2fb08;if(_0x547bd1[_0x3bd1('0x4a')][_0x3bd1('0x59')]){_0x4ea5b2[_0x3bd1('0x5a')]=[{'model':db[_0x3bd1('0x85')],'as':_0x3bd1('0x86'),'required':![]},{'model':db[_0x3bd1('0x87')],'as':_0x3bd1('0x88'),'attributes':['name',_0x3bd1('0x89'),'internal'],'required':![]},{'model':db[_0x3bd1('0x8a')],'as':'Tags','attributes':['id',_0x3bd1('0x28'),_0x3bd1('0x8b')],'where':_0x547bd1['query'][_0x3bd1('0x8c')]?{'id':_0x547bd1[_0x3bd1('0x4a')]['tag']}:undefined,'required':_0x547bd1['query'][_0x3bd1('0x8c')]?!![]:![]}];}return db[_0x3bd1('0x84')][_0x3bd1('0x5b')](_0x4ea5b2);})[_0x3bd1('0x11')](function(_0x38b9e1){_0x203265['rows']=_0x38b9e1;return _0x203265;});}})[_0x3bd1('0x11')](respondWithFilteredResult(_0x39f44a,_0x4ea5b2))['catch'](handleError(_0x39f44a,null));};exports[_0x3bd1('0x8d')]=function addApplications(_0x1c0909,_0x46628d){var _0x5920cd=_0x1c0909[_0x3bd1('0x5d')]['id'];var _0x23d916=_0x1c0909[_0x3bd1('0x64')];var _0x1f5a73=0xc8;var _0x195078=null;return db[_0x3bd1('0x8e')][_0x3bd1('0x8f')]({'isolationLevel':db[_0x3bd1('0x8e')]['Transaction'][_0x3bd1('0x90')][_0x3bd1('0x91')]},function(_0x512d2c){return db['MailAccount'][_0x3bd1('0x73')]({'where':{'id':_0x5920cd},'transaction':_0x512d2c})[_0x3bd1('0x11')](function(_0x4444e9){if(_0x4444e9){return db[_0x3bd1('0x92')]['destroy']({'where':{'MailAccountId':_0x5920cd},'transaction':_0x512d2c})[_0x3bd1('0x11')](function(){var _0x166363=_[_0x3bd1('0x44')](_0x23d916,function(_0x7b7692){_0x7b7692[_0x3bd1('0x6a')]=_0x5920cd;return _0x7b7692;});return db[_0x3bd1('0x92')][_0x3bd1('0x93')](_0x166363,{'transaction':_0x512d2c});});}else{_0x1f5a73=0x194;_0x195078=[];}});})[_0x3bd1('0x11')](function(){if(_0x1f5a73!==0x194){return db['MailApplication'][_0x3bd1('0x94')]({'where':{'MailAccountId':_0x5920cd},'order':_0x3bd1('0x95')})['then'](function(_0x4c0927){_0x195078=_0x4c0927;});}})['catch'](function(_0x260bc3){_0x1f5a73=0x1f4;logger[_0x3bd1('0x17')](_0x260bc3['stack']);if(_0x260bc3[_0x3bd1('0x28')]){delete _0x260bc3['name'];}_0x195078=_0x260bc3;})[_0x3bd1('0x96')](function(){if(_0x195078===null){_0x46628d[_0x3bd1('0x1c')](_0x1f5a73);}else{if(_0x1f5a73===0x1f4){_0x46628d[_0x3bd1('0x1d')](_0x1f5a73)[_0x3bd1('0x97')](_0x195078);}else{_0x46628d['status'](_0x1f5a73)[_0x3bd1('0x98')](_0x195078);}}});};exports['getApplications']=function(_0x237bb0,_0x186c44){var _0x587cce={};var _0x28ce94={};var _0x1ac99c;var _0x50cd05;return db[_0x3bd1('0x45')][_0x3bd1('0x73')]({'where':{'id':_0x237bb0[_0x3bd1('0x5d')]['id']}})[_0x3bd1('0x11')](handleEntityNotFound(_0x186c44,null))[_0x3bd1('0x11')](function(_0x5e3e49){if(_0x5e3e49){_0x1ac99c=_0x5e3e49;_0x28ce94['model']=_[_0x3bd1('0x49')](db[_0x3bd1('0x92')][_0x3bd1('0x60')]);_0x28ce94[_0x3bd1('0x4a')]=_[_0x3bd1('0x49')](_0x237bb0[_0x3bd1('0x4a')]);_0x28ce94['filters']=_[_0x3bd1('0x4d')](_0x28ce94[_0x3bd1('0x48')],_0x28ce94[_0x3bd1('0x4a')]);_0x587cce[_0x3bd1('0x4c')]=_[_0x3bd1('0x4d')](_0x28ce94['model'],qs[_0x3bd1('0x4e')](_0x237bb0[_0x3bd1('0x4a')][_0x3bd1('0x4e')]));_0x587cce['attributes']=_0x587cce[_0x3bd1('0x4c')][_0x3bd1('0x4f')]?_0x587cce[_0x3bd1('0x4c')]:_0x28ce94[_0x3bd1('0x48')];_0x587cce[_0x3bd1('0x6d')]=qs[_0x3bd1('0x53')](_0x237bb0[_0x3bd1('0x4a')][_0x3bd1('0x53')]);_0x587cce[_0x3bd1('0x54')]=qs['filters'](_[_0x3bd1('0x55')](_0x237bb0[_0x3bd1('0x4a')],_0x28ce94[_0x3bd1('0x4b')]));if(_0x237bb0[_0x3bd1('0x4a')][_0x3bd1('0x56')]){_0x587cce[_0x3bd1('0x54')]=_[_0x3bd1('0x61')](_0x587cce[_0x3bd1('0x54')],{'$or':_['map'](_0x587cce[_0x3bd1('0x4c')],function(_0x34bd0d){var _0x2fd3cd={};_0x2fd3cd[_0x34bd0d]={'$like':'%'+_0x237bb0[_0x3bd1('0x4a')]['filter']+'%'};return _0x2fd3cd;})});}_0x587cce=_[_0x3bd1('0x61')]({},_0x587cce,_0x237bb0[_0x3bd1('0x58')]);return _0x1ac99c['getApplications'](_0x587cce);}})['then'](function(_0x1012e9){if(_0x1012e9){_0x50cd05=_0x1012e9['length'];if(!_0x237bb0[_0x3bd1('0x4a')][_0x3bd1('0x50')](_0x3bd1('0x51'))){_0x587cce[_0x3bd1('0x52')]=qs[_0x3bd1('0x52')](_0x237bb0[_0x3bd1('0x4a')][_0x3bd1('0x52')]);_0x587cce[_0x3bd1('0x1f')]=qs['offset'](_0x237bb0[_0x3bd1('0x4a')][_0x3bd1('0x1f')]);}return _0x1ac99c['getApplications'](_0x587cce);}})['then'](function(_0x3f7bda){if(_0x3f7bda){return _0x3f7bda?{'count':_0x50cd05,'rows':_0x3f7bda}:null;}})[_0x3bd1('0x11')](respondWithResult(_0x186c44,null))[_0x3bd1('0x1b')](handleError(_0x186c44,null));};exports[_0x3bd1('0x99')]=function(_0x3cd479,_0x7a7d29){var _0x4ab146={'raw':!![],'where':{}};var _0x2cb088={};var _0x2708b1={'count':0x0,'rows':[]};return db[_0x3bd1('0x45')][_0x3bd1('0x73')]({'where':{'id':_0x3cd479[_0x3bd1('0x5d')]['id']}})[_0x3bd1('0x11')](handleEntityNotFound(_0x7a7d29,null))[_0x3bd1('0x11')](function(_0x4772da){if(_0x4772da){_0x2cb088[_0x3bd1('0x48')]=_[_0x3bd1('0x49')](db[_0x3bd1('0x9a')][_0x3bd1('0x60')]);_0x2cb088['query']=_[_0x3bd1('0x49')](_0x3cd479[_0x3bd1('0x4a')]);_0x2cb088[_0x3bd1('0x4b')]=_[_0x3bd1('0x4d')](_0x2cb088[_0x3bd1('0x48')],_0x2cb088[_0x3bd1('0x4a')]);_0x4ab146[_0x3bd1('0x4c')]=_[_0x3bd1('0x4d')](_0x2cb088['model'],qs[_0x3bd1('0x4e')](_0x3cd479[_0x3bd1('0x4a')]['fields']));_0x4ab146['attributes']=_0x4ab146[_0x3bd1('0x4c')][_0x3bd1('0x4f')]?_0x4ab146[_0x3bd1('0x4c')]:_0x2cb088[_0x3bd1('0x48')];if(!_0x3cd479[_0x3bd1('0x4a')][_0x3bd1('0x50')](_0x3bd1('0x51'))){_0x4ab146[_0x3bd1('0x52')]=qs[_0x3bd1('0x52')](_0x3cd479[_0x3bd1('0x4a')][_0x3bd1('0x52')]);_0x4ab146[_0x3bd1('0x1f')]=qs[_0x3bd1('0x1f')](_0x3cd479[_0x3bd1('0x4a')][_0x3bd1('0x1f')]);}_0x4ab146['order']=qs['sort'](_0x3cd479['query'][_0x3bd1('0x53')]);_0x4ab146[_0x3bd1('0x54')]=qs[_0x3bd1('0x4b')](_['pick'](_0x3cd479['query'],_0x2cb088[_0x3bd1('0x4b')]));_0x4ab146[_0x3bd1('0x54')]['MailAccountId']=_0x4772da['id'];if(_0x3cd479[_0x3bd1('0x4a')][_0x3bd1('0x56')]){_0x4ab146['where']=_['merge'](_0x4ab146[_0x3bd1('0x54')],{'$or':_[_0x3bd1('0x44')](_0x4ab146[_0x3bd1('0x4c')],function(_0x50ce11){var _0x90af1e={};_0x90af1e[_0x50ce11]={'$like':'%'+_0x3cd479['query']['filter']+'%'};return _0x90af1e;})});}if(_0x3cd479[_0x3bd1('0x4a')][_0x3bd1('0x9b')]){var _0x386c10=_0x3cd479[_0x3bd1('0x4a')]['$gte']['split'](',');var _0x1d1386={};_0x1d1386[_0x386c10[0x0]]={'$gte':moment(_0x386c10[0x1])[_0x3bd1('0x9c')](_0x3bd1('0x9d'))};_0x4ab146[_0x3bd1('0x54')]=_[_0x3bd1('0x61')](_0x4ab146['where'],_0x1d1386);}_0x4ab146=_[_0x3bd1('0x61')]({},_0x4ab146,_0x3cd479[_0x3bd1('0x58')]);return db[_0x3bd1('0x9a')][_0x3bd1('0x21')]({'where':_0x4ab146[_0x3bd1('0x54')]})[_0x3bd1('0x11')](function(_0x8d8f22){_0x2708b1[_0x3bd1('0x21')]=_0x8d8f22;if(_0x3cd479[_0x3bd1('0x4a')][_0x3bd1('0x59')]){_0x4ab146['include']=[{'all':!![]}];}return db[_0x3bd1('0x9a')][_0x3bd1('0x5b')](_0x4ab146);})[_0x3bd1('0x11')](function(_0x14f4db){if(_0x3cd479[_0x3bd1('0x4a')][_0x3bd1('0x9e')]===_0x3bd1('0x9f')){for(var _0x12cb11=0x0;_0x12cb11<_0x14f4db[_0x3bd1('0x4f')];_0x12cb11++){_0x14f4db[_0x12cb11][_0x3bd1('0x64')]=juice(_0x14f4db[_0x12cb11][_0x3bd1('0x64')]);}}_0x2708b1[_0x3bd1('0x6e')]=_0x14f4db;return _0x2708b1;});}})[_0x3bd1('0x11')](respondWithFilteredResult(_0x7a7d29,_0x4ab146))['catch'](handleError(_0x7a7d29,null));};exports[_0x3bd1('0x97')]=function(_0x546204,_0x50a88a){var _0x2c3bcb,_0x33dd6c={},_0xe15c21;if(_0x546204[_0x3bd1('0x64')]['to']){_0xe15c21=_0x546204[_0x3bd1('0x64')]['to'][_0x3bd1('0xa0')](',')[0x0];}return db[_0x3bd1('0x45')][_0x3bd1('0x62')]({'where':{'id':_0x546204[_0x3bd1('0x5d')]['id']},'include':[{'model':db['CmList'],'as':_0x3bd1('0xa1'),'include':[{'model':db[_0x3bd1('0x85')],'as':'Contacts','where':{'email':_0xe15c21},'limit':0x1,'order':[[_0x3bd1('0xa2'),_0x3bd1('0xa3')]]}]},{'model':db[_0x3bd1('0x5e')],'as':_0x3bd1('0x41'),'raw':!![],'include':[{'model':db[_0x3bd1('0xa4')],'as':_0x3bd1('0xa4'),'raw':!![]}]}]})[_0x3bd1('0x11')](handleEntityNotFound(_0x50a88a,null))[_0x3bd1('0x11')](function(_0x6008c0){if(!_0x6008c0)return;_0x2c3bcb=_0x6008c0;if(!_0x6008c0[_0x3bd1('0x41')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x3bd1('0x76')](_0x546204[_0x3bd1('0x64')][_0x3bd1('0xa5')])){_0x546204[_0x3bd1('0x64')]['from']=util['format'](_0x3bd1('0xa6'),_0x6008c0[_0x3bd1('0x28')],_0x6008c0['email']||_0x6008c0['Smtp'][_0x3bd1('0x35')]);}if(_0x546204[_0x3bd1('0x64')][_0x3bd1('0xa7')]&&_0x546204[_0x3bd1('0x64')][_0x3bd1('0xa7')][_0x3bd1('0x4f')]){for(var _0x233a43=0x0;_0x233a43<_0x546204[_0x3bd1('0x64')]['attachments']['length'];_0x233a43+=0x1){_0x546204[_0x3bd1('0x64')][_0x3bd1('0xa7')][_0x233a43]={'filename':_0x546204['body'][_0x3bd1('0xa7')][_0x233a43]['name'],'path':path[_0x3bd1('0xa8')](config[_0x3bd1('0xa9')],_0x3bd1('0xaa'),_0x546204[_0x3bd1('0x64')][_0x3bd1('0xa7')][_0x233a43][_0x3bd1('0xab')])};}}var _0x1acf2c=_0x6008c0[_0x3bd1('0xac')]();return respondWithRpcPromise(_0x3bd1('0xad'),_0x3bd1('0xae'),{'account':_0x1acf2c,'message':_0x546204[_0x3bd1('0x64')]});})[_0x3bd1('0x11')](function(_0x2fbece){if(!_0x2fbece)return;_0x33dd6c=_0x2fbece;if(!_0x2c3bcb[_0x3bd1('0xa1')])throw new Error('List\x20not\x20found');if(_0x2c3bcb['List'][_0x3bd1('0xaf')][_0x3bd1('0x4f')])return _0x2c3bcb[_0x3bd1('0xa1')][_0x3bd1('0xaf')][0x0];return db[_0x3bd1('0x85')]['create'](_[_0x3bd1('0xa')](_0x546204['body'],{'firstName':_0x546204['body']['to'],'email':_0x546204['body']['to'],'phone':_0x546204[_0x3bd1('0x64')]['to'],'ListId':_0x2c3bcb['ListId']}));})['then'](function(_0x5363d2){if(!_0x5363d2)return;var _0x4bbba7={'UserId':_0x546204[_0x3bd1('0x35')]['id'],'ContactId':_0x5363d2['id'],'MailAccountId':_0x2c3bcb['id'],'inReplyTo':_0x33dd6c[_0x3bd1('0xb0')],'to':_0x546204[_0x3bd1('0x64')]['from'],'cc':_0x546204[_0x3bd1('0x64')]['cc'],'subject':_0x546204['body']['subject'],'attach':_0x546204[_0x3bd1('0x64')][_0x3bd1('0xb1')],'firstMsgDirection':_0x3bd1('0xb2'),'lastMsgAt':moment()[_0x3bd1('0x9c')](_0x3bd1('0x9d')),'lastMsgDirection':_0x3bd1('0xb2'),'Messages':[_[_0x3bd1('0x61')](_0x546204[_0x3bd1('0x64')],{'messageId':_0x33dd6c[_0x3bd1('0xb0')],'sentAt':moment()[_0x3bd1('0x9c')](_0x3bd1('0x9d')),'read':!![],'MailAccountId':_0x2c3bcb['id'],'UserId':_0x546204[_0x3bd1('0x35')]['id'],'ContactId':_0x5363d2['id']})]};if(_0x546204[_0x3bd1('0x64')]['Interaction']){_0x4bbba7=_[_0x3bd1('0x61')](_0x4bbba7,_0x546204[_0x3bd1('0x64')]['Interaction']);}return db[_0x3bd1('0x84')][_0x3bd1('0x6c')](_0x4bbba7,{'include':[{'model':db[_0x3bd1('0x9a')],'as':'Messages'}]});})[_0x3bd1('0x11')](respondWithResult(_0x50a88a,null))[_0x3bd1('0x1b')](handleError(_0x50a88a,null));};exports[_0x3bd1('0xb3')]=function(_0x50bc2d,_0x16246e){return db['MailAccount']['find']({'where':{'id':_0x50bc2d['params']['id']},'include':[{'model':db[_0x3bd1('0x5e')],'as':_0x3bd1('0x41'),'raw':!![],'include':[{'model':db[_0x3bd1('0xa4')],'as':_0x3bd1('0xa4'),'raw':!![]}]}]})[_0x3bd1('0x11')](handleEntityNotFound(_0x16246e,null))[_0x3bd1('0x11')](function(_0x284a7f){if(!_0x284a7f[_0x3bd1('0x41')])return;var _0xcfb390=_0x284a7f[_0x3bd1('0xac')]();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0xcfb390});})[_0x3bd1('0x11')](respondWithResult(_0x16246e,null))[_0x3bd1('0x1b')](handleError(_0x16246e,null));};exports[_0x3bd1('0x26')]=function(_0x4770b3,_0x53c1fe){return db[_0x3bd1('0x45')][_0x3bd1('0x62')]({'where':{'id':_0x4770b3[_0x3bd1('0x5d')]['id']}})['then'](handleEntityNotFound(_0x53c1fe,null))[_0x3bd1('0x11')](function(_0xec623f){if(_0xec623f&&_0xec623f[_0x3bd1('0x3e')]){throw new db['Sequelize'][(_0x3bd1('0xb4'))](_0x3bd1('0xb5'));}return _0xec623f;})[_0x3bd1('0x11')](removeEntity(_0x53c1fe,null))[_0x3bd1('0x1b')](handleError(_0x53c1fe,null));};exports[_0x3bd1('0xb6')]=function(_0x3ba787,_0x5bac61){return db[_0x3bd1('0x45')][_0x3bd1('0x62')]({'where':{'id':_0x3ba787[_0x3bd1('0x5d')]['id']}})[_0x3bd1('0x11')](handleEntityNotFound(_0x5bac61,null))[_0x3bd1('0x11')](function(_0x38b61c){if(_0x38b61c){return _0x38b61c[_0x3bd1('0xb6')](_0x3ba787[_0x3bd1('0x64')][_0x3bd1('0x70')],_[_0x3bd1('0xb7')](_0x3ba787[_0x3bd1('0x64')],[_0x3bd1('0x70'),'id'])||{})[_0x3bd1('0xb8')](function(_0x12d0cd){for(var _0x5698ca=0x0;_0x5698ca<_0x3ba787[_0x3bd1('0x64')][_0x3bd1('0x70')]['length'];_0x5698ca+=0x1){socket[_0x3bd1('0xb9')]('userMailAccount:save',{'UserId':Number(_0x3ba787[_0x3bd1('0x64')][_0x3bd1('0x70')][_0x5698ca]),'MailAccountId':Number(_0x3ba787[_0x3bd1('0x5d')]['id'])});}return _0x12d0cd;});}})[_0x3bd1('0x11')](respondWithResult(_0x5bac61,null))[_0x3bd1('0x1b')](handleError(_0x5bac61,null));};exports[_0x3bd1('0xba')]=function(_0x422fbb,_0x1457a1){return db['MailAccount'][_0x3bd1('0x62')]({'where':{'id':_0x422fbb[_0x3bd1('0x5d')]['id']}})[_0x3bd1('0x11')](handleEntityNotFound(_0x1457a1,null))[_0x3bd1('0x11')](function(_0x5e8183){if(_0x5e8183){return _0x5e8183['removeAgents'](_0x422fbb[_0x3bd1('0x4a')][_0x3bd1('0x70')])[_0x3bd1('0x11')](function(){if(_['isArray'](_0x422fbb['query'][_0x3bd1('0x70')])){for(var _0x5be778=0x0;_0x5be778<_0x422fbb[_0x3bd1('0x4a')][_0x3bd1('0x70')][_0x3bd1('0x4f')];_0x5be778+=0x1){socket[_0x3bd1('0xb9')](_0x3bd1('0xbb'),{'UserId':Number(_0x422fbb[_0x3bd1('0x4a')][_0x3bd1('0x70')][_0x5be778]),'MailAccountId':Number(_0x422fbb[_0x3bd1('0x5d')]['id'])});}}else{socket['emit'](_0x3bd1('0xbb'),{'UserId':Number(_0x422fbb[_0x3bd1('0x4a')][_0x3bd1('0x70')]),'MailAccountId':Number(_0x422fbb[_0x3bd1('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x1457a1,null))[_0x3bd1('0x1b')](handleError(_0x1457a1,null));};exports[_0x3bd1('0xbc')]=function(_0x472d18,_0x320c20){var _0x471271={};var _0x53c325={};var _0x5bb884;var _0x4547e9;return db[_0x3bd1('0x45')][_0x3bd1('0x73')]({'where':{'id':_0x472d18[_0x3bd1('0x5d')]['id']}})[_0x3bd1('0x11')](handleEntityNotFound(_0x320c20,null))[_0x3bd1('0x11')](function(_0x415b9f){if(_0x415b9f){_0x5bb884=_0x415b9f;_0x53c325[_0x3bd1('0x48')]=_[_0x3bd1('0x49')](db['User']['rawAttributes']);_0x53c325[_0x3bd1('0x4a')]=_[_0x3bd1('0x49')](_0x472d18['query']);_0x53c325['filters']=_[_0x3bd1('0x4d')](_0x53c325[_0x3bd1('0x48')],_0x53c325[_0x3bd1('0x4a')]);_0x471271[_0x3bd1('0x4c')]=_['intersection'](_0x53c325[_0x3bd1('0x48')],qs['fields'](_0x472d18[_0x3bd1('0x4a')][_0x3bd1('0x4e')]));_0x471271[_0x3bd1('0x4c')]=_0x471271['attributes']['length']?_0x471271[_0x3bd1('0x4c')]:_0x53c325[_0x3bd1('0x48')];_0x471271['order']=qs[_0x3bd1('0x53')](_0x472d18['query'][_0x3bd1('0x53')]);_0x471271[_0x3bd1('0x54')]=qs['filters'](_[_0x3bd1('0x55')](_0x472d18[_0x3bd1('0x4a')],_0x53c325[_0x3bd1('0x4b')]));if(_0x472d18['query']['filter']){_0x471271[_0x3bd1('0x54')]=_[_0x3bd1('0x61')](_0x471271['where'],{'$or':_[_0x3bd1('0x44')](_0x471271['attributes'],function(_0x3a93d2){var _0x1f341e={};_0x1f341e[_0x3a93d2]={'$like':'%'+_0x472d18[_0x3bd1('0x4a')][_0x3bd1('0x56')]+'%'};return _0x1f341e;})});}_0x471271=_['merge']({},_0x471271,_0x472d18['options']);return _0x5bb884['getAgents'](_0x471271);}})[_0x3bd1('0x11')](function(_0x213f49){if(_0x213f49){_0x4547e9=_0x213f49[_0x3bd1('0x4f')];if(!_0x472d18['query'][_0x3bd1('0x50')](_0x3bd1('0x51'))){_0x471271['limit']=qs[_0x3bd1('0x52')](_0x472d18[_0x3bd1('0x4a')][_0x3bd1('0x52')]);_0x471271[_0x3bd1('0x1f')]=qs[_0x3bd1('0x1f')](_0x472d18[_0x3bd1('0x4a')][_0x3bd1('0x1f')]);}return _0x5bb884['getAgents'](_0x471271);}})[_0x3bd1('0x11')](function(_0xd2116){if(_0xd2116){return _0xd2116?{'count':_0x4547e9,'rows':_0xd2116}:null;}})[_0x3bd1('0x11')](respondWithResult(_0x320c20,null))['catch'](handleError(_0x320c20,null));};
\ No newline at end of file
+var _0x0e7c=['MailServerOut','mandatoryDispositionPause','keys','intersection','find','body','provider','params','Mail\x20Account\x20not\x20found','update','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rawAttributes','rows','removeAnswers','email','ListId','isNil','active','description','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','Contact','User','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','stack','finally','send','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','CmContact','Contacts','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','from','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','emit','userMailAccount:save','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','redis','defaults','./mailAccount.socket','client','http','request','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','destroy','get','MailAccounts','UserProfileResource','end','name','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','yahoo','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Smtp','index','MailServerIn','Imap','Pause','MailAccount','type','key','map','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','show'];(function(_0x2c0601,_0xb2a82f){var _0x5529a7=function(_0x44f8ec){while(--_0x44f8ec){_0x2c0601['push'](_0x2c0601['shift']());}};_0x5529a7(++_0xb2a82f);}(_0x0e7c,0x6a));var _0xc0e7=function(_0x3c66e5,_0xab5ea3){_0x3c66e5=_0x3c66e5-0x0;var _0x678a=_0x0e7c[_0x3c66e5];return _0x678a;};'use strict';var moment=require(_0xc0e7('0x0'));var BPromise=require(_0xc0e7('0x1'));var util=require(_0xc0e7('0x2'));var path=require(_0xc0e7('0x3'));var _=require(_0xc0e7('0x4'));var juice=require('juice');var Redis=require(_0xc0e7('0x5'));var qs=require(_0xc0e7('0x6'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xc0e7('0x7')]=_[_0xc0e7('0x8')](config[_0xc0e7('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc0e7('0x7')]));require(_0xc0e7('0x9'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xc0e7('0xa')][_0xc0e7('0xb')]({'port':0x232b});function respondWithRpcPromise(_0x143e7e,_0x2dd6b6,_0x43fb09,_0x465946){return new BPromise(function(_0x46c1b9,_0x580818){var _0x2436ef=_0x465946||client;return _0x2436ef[_0xc0e7('0xc')](_0x143e7e,_0x43fb09)[_0xc0e7('0xd')](function(_0x54b6cc){logger['info'](_0xc0e7('0xe'),_0x2dd6b6,'request\x20sent');logger[_0xc0e7('0xf')](_0xc0e7('0x10'),_0x2dd6b6,_0xc0e7('0x11'),JSON[_0xc0e7('0x12')](_0x54b6cc));if(_0x54b6cc[_0xc0e7('0x13')]){if(_0x54b6cc['error']['code']===0x1f4){logger[_0xc0e7('0x13')](_0xc0e7('0xe'),_0x2dd6b6,_0x54b6cc['error'][_0xc0e7('0x14')]);return _0x580818(_0x54b6cc[_0xc0e7('0x13')][_0xc0e7('0x14')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x2dd6b6,_0x54b6cc[_0xc0e7('0x13')][_0xc0e7('0x14')]);return _0x46c1b9(_0x54b6cc['error'][_0xc0e7('0x14')]);}else{logger[_0xc0e7('0x15')]('MailAccount,\x20%s,\x20%s',_0x2dd6b6,'request\x20sent');_0x46c1b9(_0x54b6cc[_0xc0e7('0x16')][_0xc0e7('0x14')]);}})[_0xc0e7('0x17')](function(_0x410e18){logger[_0xc0e7('0x13')](_0xc0e7('0xe'),_0x2dd6b6,_0x410e18);_0x580818(_0x410e18);});});}function respondWithStatusCode(_0x47fb79,_0x165f55){_0x165f55=_0x165f55||0xcc;return function(_0x571930){if(_0x571930){return _0x47fb79[_0xc0e7('0x18')](_0x165f55);}return _0x47fb79[_0xc0e7('0x19')](_0x165f55)['end']();};}function respondWithResult(_0x55de44,_0xe9bef4){_0xe9bef4=_0xe9bef4||0xc8;return function(_0x2f7c90){if(_0x2f7c90){return _0x55de44[_0xc0e7('0x19')](_0xe9bef4)[_0xc0e7('0x1a')](_0x2f7c90);}};}function respondWithFilteredResult(_0x35a167,_0x41d190){return function(_0x599eba){if(_0x599eba){var _0x5704ce=typeof _0x41d190[_0xc0e7('0x1b')]===_0xc0e7('0x1c')&&typeof _0x41d190[_0xc0e7('0x1d')]===_0xc0e7('0x1c');var _0x89322f=_0x599eba[_0xc0e7('0x1e')];var _0x3e5990=_0x5704ce?0x0:_0x41d190[_0xc0e7('0x1b')];var _0x26769a=_0x5704ce?_0x599eba[_0xc0e7('0x1e')]:_0x41d190[_0xc0e7('0x1b')]+_0x41d190[_0xc0e7('0x1d')];var _0x3b8f23;if(_0x26769a>=_0x89322f){_0x26769a=_0x89322f;_0x3b8f23=0xc8;}else{_0x3b8f23=0xce;}_0x35a167['status'](_0x3b8f23);return _0x35a167['set'](_0xc0e7('0x1f'),_0x3e5990+'-'+_0x26769a+'/'+_0x89322f)[_0xc0e7('0x1a')](_0x599eba);}return null;};}function saveUpdates(_0x45b5a8){return function(_0x30b263){if(_0x30b263){return _0x30b263['update'](_0x45b5a8)[_0xc0e7('0xd')](function(_0x4305ab){return _0x4305ab;});}return null;};}function removeEntity(_0x3e1d58){return function(_0x140cb5){if(_0x140cb5){return _0x140cb5[_0xc0e7('0x20')]()[_0xc0e7('0xd')](function(){var _0x144828=_0x140cb5[_0xc0e7('0x21')]({'plain':!![]});var _0x2830fc=_0xc0e7('0x22');return db[_0xc0e7('0x23')][_0xc0e7('0x20')]({'where':{'type':_0x2830fc,'resourceId':_0x144828['id']}})[_0xc0e7('0xd')](function(){return _0x140cb5;});})[_0xc0e7('0xd')](function(){_0x3e1d58[_0xc0e7('0x19')](0xcc)[_0xc0e7('0x24')]();});}};}function handleEntityNotFound(_0x2561d8){return function(_0x437923){if(!_0x437923){_0x2561d8[_0xc0e7('0x18')](0x194);}return _0x437923;};}function handleError(_0x1d62ab,_0x47e35a){_0x47e35a=_0x47e35a||0x1f4;return function(_0x3d0e26){logger[_0xc0e7('0x13')](_0x3d0e26['stack']);if(_0x3d0e26[_0xc0e7('0x25')]){delete _0x3d0e26[_0xc0e7('0x25')];}_0x1d62ab[_0xc0e7('0x19')](_0x47e35a)['send'](_0x3d0e26);};}function getImapHost(_0x57785b){switch(_0x57785b){case _0xc0e7('0x26'):return _0xc0e7('0x27');case'yahoo':return _0xc0e7('0x28');case _0xc0e7('0x29'):return _0xc0e7('0x2a');case'outlook365':return _0xc0e7('0x2b');}throw new Error('Unknown\x20email\x20service\x20provider',_0x57785b);}function getSmtpHost(_0x2f9db8){switch(_0x2f9db8){case _0xc0e7('0x26'):return'smtp.gmail.com';case _0xc0e7('0x2c'):return _0xc0e7('0x2d');case _0xc0e7('0x29'):return _0xc0e7('0x2e');case _0xc0e7('0x2f'):return _0xc0e7('0x30');}throw new Error(_0xc0e7('0x31'),_0x2f9db8);}function getAuthenticationOptions(_0x2cc9d4,_0x5b84a2){var _0x363278={};var _0x52d3d4={};if(_0x2cc9d4){_0x363278['user']=_0x52d3d4[_0xc0e7('0x32')]=_0x5b84a2[_0xc0e7('0x33')];_0x363278[_0xc0e7('0x34')]=_0x52d3d4[_0xc0e7('0x35')]=_0x5b84a2[_0xc0e7('0x34')];if(_0x5b84a2['modernAuthentication']){_0x363278[_0xc0e7('0x36')]=_0x52d3d4[_0xc0e7('0x36')]=!![];_0x363278[_0xc0e7('0x37')]=_0x52d3d4[_0xc0e7('0x37')]=_0x5b84a2[_0xc0e7('0x37')];_0x363278[_0xc0e7('0x34')]=_0x52d3d4[_0xc0e7('0x35')]=null;}else{_0x363278['CloudProviderId']=_0x52d3d4[_0xc0e7('0x37')]=null;}_0x363278[_0xc0e7('0x38')]=getImapHost(_0x2cc9d4);_0x363278[_0xc0e7('0x39')]=0x3e1;_0x52d3d4[_0xc0e7('0x38')]=getSmtpHost(_0x2cc9d4);_0x52d3d4[_0xc0e7('0x39')]=0x24b;_0x52d3d4[_0xc0e7('0x3a')]=![];_0x363278[_0xc0e7('0x3b')]=_0x52d3d4['service']=null;}else{if(_0x5b84a2[_0xc0e7('0x3c')]){_0x363278[_0xc0e7('0x32')]=_0x52d3d4[_0xc0e7('0x32')]=_0x5b84a2[_0xc0e7('0x33')];_0x363278['password']=_0x52d3d4[_0xc0e7('0x35')]=_0x5b84a2[_0xc0e7('0x34')];}else{_0x363278[_0xc0e7('0x3c')]=_0x52d3d4['authentication']=![];_0x363278[_0xc0e7('0x32')]=_0x52d3d4[_0xc0e7('0x32')]=null;_0x363278['password']=_0x52d3d4[_0xc0e7('0x35')]=null;}_0x363278['host']=_0x5b84a2['Imap'][_0xc0e7('0x38')];_0x363278[_0xc0e7('0x39')]=_0x5b84a2['Imap'][_0xc0e7('0x39')];_0x52d3d4[_0xc0e7('0x38')]=_0x5b84a2[_0xc0e7('0x3d')][_0xc0e7('0x38')];_0x52d3d4[_0xc0e7('0x39')]=_0x5b84a2['Smtp']['port'];}return{'Imap':_0x363278,'Smtp':_0x52d3d4};}exports[_0xc0e7('0x3e')]=function(_0x106143,_0x49fd94){var _0x51c2e8={'include':[{'model':db[_0xc0e7('0x3f')],'as':_0xc0e7('0x40')},{'model':db['MailServerOut'],'as':_0xc0e7('0x3d')},{'model':db[_0xc0e7('0x41')],'as':'mandatoryDispositionPause'}]},_0x337174={},_0x8e58a2={'count':0x0,'rows':[]};var _0x566382=_['map'](db[_0xc0e7('0x42')]['rawAttributes'],function(_0x579f99){return{'name':_0x579f99['fieldName'],'type':_0x579f99[_0xc0e7('0x43')][_0xc0e7('0x44')]};});_0x337174['model']=_[_0xc0e7('0x45')](_0x566382,_0xc0e7('0x25'));_0x337174['query']=_['keys'](_0x106143[_0xc0e7('0x46')]);_0x337174[_0xc0e7('0x47')]=_['intersection'](_0x337174[_0xc0e7('0x48')],_0x337174[_0xc0e7('0x46')]);_0x51c2e8[_0xc0e7('0x49')]=_['intersection'](_0x337174[_0xc0e7('0x48')],qs[_0xc0e7('0x4a')](_0x106143['query'][_0xc0e7('0x4a')]));_0x51c2e8[_0xc0e7('0x49')]=_0x51c2e8[_0xc0e7('0x49')][_0xc0e7('0x4b')]?_0x51c2e8['attributes']:_0x337174['model'];if(!_0x106143[_0xc0e7('0x46')][_0xc0e7('0x4c')](_0xc0e7('0x4d'))){_0x51c2e8[_0xc0e7('0x1d')]=qs['limit'](_0x106143[_0xc0e7('0x46')][_0xc0e7('0x1d')]);_0x51c2e8[_0xc0e7('0x1b')]=qs[_0xc0e7('0x1b')](_0x106143['query'][_0xc0e7('0x1b')]);}_0x51c2e8['order']=qs[_0xc0e7('0x4e')](_0x106143[_0xc0e7('0x46')][_0xc0e7('0x4e')]);_0x51c2e8[_0xc0e7('0x4f')]=qs[_0xc0e7('0x47')](_[_0xc0e7('0x50')](_0x106143[_0xc0e7('0x46')],_0x337174[_0xc0e7('0x47')]),_0x566382);if(_0x106143[_0xc0e7('0x46')][_0xc0e7('0x51')]){_0x51c2e8[_0xc0e7('0x4f')]=_[_0xc0e7('0x52')](_0x51c2e8[_0xc0e7('0x4f')],{'$or':_[_0xc0e7('0x45')](_0x566382,function(_0xf0587b){if(_0xf0587b[_0xc0e7('0x43')]!=='VIRTUAL'){var _0x17ea3b={};_0x17ea3b[_0xf0587b[_0xc0e7('0x25')]]={'$like':'%'+_0x106143[_0xc0e7('0x46')][_0xc0e7('0x51')]+'%'};return _0x17ea3b;}})});}_0x51c2e8=_[_0xc0e7('0x52')]({},_0x51c2e8,_0x106143[_0xc0e7('0x53')]);var _0x34bf0d={'where':_0x51c2e8[_0xc0e7('0x4f')]};return db['MailAccount'][_0xc0e7('0x1e')](_0x34bf0d)[_0xc0e7('0xd')](function(_0x4dd46c){_0x8e58a2['count']=_0x4dd46c;if(_0x106143['query'][_0xc0e7('0x54')]){_0x51c2e8[_0xc0e7('0x55')]=[{'all':!![]}];}return db[_0xc0e7('0x42')][_0xc0e7('0x56')](_0x51c2e8);})[_0xc0e7('0xd')](function(_0x214b2e){_0x8e58a2['rows']=_0x214b2e;return _0x8e58a2;})['then'](respondWithFilteredResult(_0x49fd94,_0x51c2e8))['catch'](handleError(_0x49fd94,null));};exports[_0xc0e7('0x57')]=function(_0x1bc176,_0x3f8a81){var _0x263129={'raw':![],'where':{'id':_0x1bc176['params']['id']},'include':[{'model':db[_0xc0e7('0x3f')],'as':_0xc0e7('0x40')},{'model':db[_0xc0e7('0x58')],'as':_0xc0e7('0x3d')},{'model':db[_0xc0e7('0x41')],'as':_0xc0e7('0x59')}]},_0x4b81ca={};_0x4b81ca['model']=_[_0xc0e7('0x5a')](db[_0xc0e7('0x42')]['rawAttributes']);_0x4b81ca[_0xc0e7('0x46')]=_['keys'](_0x1bc176[_0xc0e7('0x46')]);_0x4b81ca[_0xc0e7('0x47')]=_['intersection'](_0x4b81ca['model'],_0x4b81ca[_0xc0e7('0x46')]);_0x263129['attributes']=_[_0xc0e7('0x5b')](_0x4b81ca[_0xc0e7('0x48')],qs[_0xc0e7('0x4a')](_0x1bc176[_0xc0e7('0x46')]['fields']));_0x263129[_0xc0e7('0x49')]=_0x263129[_0xc0e7('0x49')][_0xc0e7('0x4b')]?_0x263129[_0xc0e7('0x49')]:_0x4b81ca[_0xc0e7('0x48')];if(_0x1bc176[_0xc0e7('0x46')][_0xc0e7('0x54')]){_0x263129[_0xc0e7('0x55')]=[{'all':!![]}];}_0x263129=_[_0xc0e7('0x52')]({},_0x263129,_0x1bc176['options']);return db[_0xc0e7('0x42')][_0xc0e7('0x5c')](_0x263129)[_0xc0e7('0xd')](handleEntityNotFound(_0x3f8a81,null))['then'](respondWithResult(_0x3f8a81,null))[_0xc0e7('0x17')](handleError(_0x3f8a81,null));};exports['update']=function(_0x468935,_0x538657){if(_0x468935['body']['id']){delete _0x468935[_0xc0e7('0x5d')]['id'];}var _0x8ed6e3=_0x468935[_0xc0e7('0x5d')][_0xc0e7('0x5e')]==='custom'?null:_0x468935[_0xc0e7('0x5d')][_0xc0e7('0x5e')];var _0x433d61=_0x468935[_0xc0e7('0x5d')][_0xc0e7('0x40')]||{};var _0x108d42=_0x468935[_0xc0e7('0x5d')][_0xc0e7('0x3d')]||{};if(_0x8ed6e3){_0x433d61['host']=getImapHost(_0x8ed6e3);_0x433d61[_0xc0e7('0x39')]=0x3e1;_0x108d42[_0xc0e7('0x38')]=getSmtpHost(_0x8ed6e3);_0x108d42['port']=0x24b;_0x108d42[_0xc0e7('0x3a')]=![];}if(_0x108d42[_0xc0e7('0x36')]){_0x108d42[_0xc0e7('0x3a')]=![];}else{_0x108d42[_0xc0e7('0x37')]=null;}if(!_0x433d61[_0xc0e7('0x36')])_0x433d61['CloudProviderId']=null;_0x468935[_0xc0e7('0x5d')][_0xc0e7('0x40')]=_0x433d61;_0x468935[_0xc0e7('0x5d')][_0xc0e7('0x3d')]=_0x108d42;return db[_0xc0e7('0x42')]['find']({'where':{'id':_0x468935[_0xc0e7('0x5f')]['id']},'include':[{'model':db[_0xc0e7('0x3f')],'as':'Imap'},{'model':db[_0xc0e7('0x58')],'as':'Smtp'},{'model':db['Pause'],'as':_0xc0e7('0x59')}]})['then'](handleEntityNotFound(_0x538657,null))['then'](function(_0x499c1a){if(!_0x499c1a)throw new Error(_0xc0e7('0x60'));if(_0x499c1a[_0xc0e7('0x3b')])delete _0x468935[_0xc0e7('0x5d')][_0xc0e7('0x40')];return _0x499c1a;})['then'](saveUpdates(_0x468935[_0xc0e7('0x5d')],null))[_0xc0e7('0xd')](function(_0x15a010){if(!_0x468935[_0xc0e7('0x5d')][_0xc0e7('0x40')])return _0x15a010;return db[_0xc0e7('0x3f')][_0xc0e7('0x61')](_0x468935[_0xc0e7('0x5d')][_0xc0e7('0x40')],{'where':{'MailAccountId':_0x15a010['id']}})[_0xc0e7('0xd')](function(){return _0x15a010;});})['then'](function(_0x1acb20){if(!_0x468935[_0xc0e7('0x5d')][_0xc0e7('0x3d')])return _0x1acb20;return db[_0xc0e7('0x58')]['update'](_0x468935[_0xc0e7('0x5d')][_0xc0e7('0x3d')],{'where':{'MailAccountId':_0x1acb20['id']}})[_0xc0e7('0xd')](function(){return _0x1acb20;});})[_0xc0e7('0xd')](respondWithResult(_0x538657,null))[_0xc0e7('0x17')](handleError(_0x538657,null));};exports[_0xc0e7('0x62')]=function(_0x3958e0,_0x5d6e5d){return db[_0xc0e7('0x42')][_0xc0e7('0x62')]()['then'](respondWithResult(_0x5d6e5d,null))[_0xc0e7('0x17')](handleError(_0x5d6e5d,null));};exports[_0xc0e7('0x63')]=function(_0x5d3d19,_0x580b44){if(_0x5d3d19[_0xc0e7('0x5d')]['id']){delete _0x5d3d19[_0xc0e7('0x5d')]['id'];}return db['MailAccount'][_0xc0e7('0x5c')]({'where':{'id':_0x5d3d19[_0xc0e7('0x5f')]['id']}})[_0xc0e7('0xd')](handleEntityNotFound(_0x580b44,null))[_0xc0e7('0xd')](function(_0x5ac122){if(_0x5ac122){_0x5d3d19['body'][_0xc0e7('0x64')]=_0x5ac122['id'];return db[_0xc0e7('0x65')][_0xc0e7('0x66')](_0x5d3d19[_0xc0e7('0x5d')]);}})[_0xc0e7('0xd')](respondWithResult(_0x580b44,null))[_0xc0e7('0x17')](handleError(_0x580b44,null));};exports[_0xc0e7('0x67')]=function(_0x5c7796,_0x1cbe63){var _0x2d5ca4={'raw':![],'where':{}};var _0x4c10e3={};var _0x436fd7={'count':0x0,'rows':[]};return db[_0xc0e7('0x42')][_0xc0e7('0x68')]({'where':{'id':_0x5c7796[_0xc0e7('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1cbe63,null))[_0xc0e7('0xd')](function(_0x538eb8){if(_0x538eb8){_0x4c10e3[_0xc0e7('0x48')]=_[_0xc0e7('0x5a')](db[_0xc0e7('0x65')]['rawAttributes']);_0x4c10e3[_0xc0e7('0x46')]=_[_0xc0e7('0x5a')](_0x5c7796['query']);_0x4c10e3[_0xc0e7('0x47')]=_['intersection'](_0x4c10e3[_0xc0e7('0x48')],_0x4c10e3['query']);_0x2d5ca4[_0xc0e7('0x49')]=_[_0xc0e7('0x5b')](_0x4c10e3[_0xc0e7('0x48')],qs[_0xc0e7('0x4a')](_0x5c7796[_0xc0e7('0x46')]['fields']));_0x2d5ca4[_0xc0e7('0x49')]=_0x2d5ca4[_0xc0e7('0x49')][_0xc0e7('0x4b')]?_0x2d5ca4[_0xc0e7('0x49')]:_0x4c10e3[_0xc0e7('0x48')];if(!_0x5c7796[_0xc0e7('0x46')][_0xc0e7('0x4c')](_0xc0e7('0x4d'))){_0x2d5ca4[_0xc0e7('0x1d')]=qs[_0xc0e7('0x1d')](_0x5c7796[_0xc0e7('0x46')][_0xc0e7('0x1d')]);_0x2d5ca4[_0xc0e7('0x1b')]=qs[_0xc0e7('0x1b')](_0x5c7796[_0xc0e7('0x46')][_0xc0e7('0x1b')]);}_0x2d5ca4[_0xc0e7('0x69')]=qs[_0xc0e7('0x4e')](_0x5c7796[_0xc0e7('0x46')][_0xc0e7('0x4e')]);_0x2d5ca4['where']=qs[_0xc0e7('0x47')](_[_0xc0e7('0x50')](_0x5c7796[_0xc0e7('0x46')],_0x4c10e3[_0xc0e7('0x47')]));_0x2d5ca4['where'][_0xc0e7('0x64')]=_0x538eb8['id'];if(_0x5c7796[_0xc0e7('0x46')][_0xc0e7('0x51')]){_0x2d5ca4[_0xc0e7('0x4f')]=_[_0xc0e7('0x52')](_0x2d5ca4[_0xc0e7('0x4f')],{'$or':_[_0xc0e7('0x45')](_0x2d5ca4['attributes'],function(_0x1ab95c){var _0x267c8a={};_0x267c8a[_0x1ab95c]={'$like':'%'+_0x5c7796[_0xc0e7('0x46')][_0xc0e7('0x51')]+'%'};return _0x267c8a;})});}_0x2d5ca4=_[_0xc0e7('0x52')]({},_0x2d5ca4,_0x5c7796[_0xc0e7('0x53')]);return db[_0xc0e7('0x65')][_0xc0e7('0x1e')]({'where':_0x2d5ca4['where']})[_0xc0e7('0xd')](function(_0x1b990f){_0x436fd7[_0xc0e7('0x1e')]=_0x1b990f;if(_0x5c7796['query']['includeAll']){_0x2d5ca4[_0xc0e7('0x55')]=[{'all':!![]}];}return db[_0xc0e7('0x65')]['findAll'](_0x2d5ca4);})[_0xc0e7('0xd')](function(_0x9971b3){_0x436fd7['rows']=_0x9971b3;return _0x436fd7;});}})[_0xc0e7('0xd')](respondWithFilteredResult(_0x1cbe63,_0x2d5ca4))[_0xc0e7('0x17')](handleError(_0x1cbe63,null));};exports[_0xc0e7('0x6a')]=function(_0x4fb87f,_0x55b27d){return db[_0xc0e7('0x42')][_0xc0e7('0x5c')]({'where':{'id':_0x4fb87f[_0xc0e7('0x5f')]['id']}})[_0xc0e7('0xd')](handleEntityNotFound(_0x55b27d,null))[_0xc0e7('0xd')](function(_0x4a4b8b){if(_0x4a4b8b){return _0x4a4b8b['removeDispositions'](_0x4fb87f[_0xc0e7('0x46')][_0xc0e7('0x6b')]);}})[_0xc0e7('0xd')](respondWithStatusCode(_0x55b27d,null))['catch'](handleError(_0x55b27d,null));};exports[_0xc0e7('0x6c')]=function(_0xb66c06,_0x763d94){if(_0xb66c06[_0xc0e7('0x5d')]['id']){delete _0xb66c06[_0xc0e7('0x5d')]['id'];}return db[_0xc0e7('0x42')][_0xc0e7('0x5c')]({'where':{'id':_0xb66c06[_0xc0e7('0x5f')]['id']}})[_0xc0e7('0xd')](handleEntityNotFound(_0x763d94,null))[_0xc0e7('0xd')](function(_0x2a7eb9){if(_0x2a7eb9){_0xb66c06[_0xc0e7('0x5d')][_0xc0e7('0x64')]=_0x2a7eb9['id'];return db[_0xc0e7('0x6d')][_0xc0e7('0x66')](_0xb66c06[_0xc0e7('0x5d')]);}})[_0xc0e7('0xd')](respondWithResult(_0x763d94,null))[_0xc0e7('0x17')](handleError(_0x763d94,null));};exports[_0xc0e7('0x6e')]=function(_0x34f862,_0x48fcf1){var _0x3d2c5c={'raw':![],'where':{}};var _0x53a511={};var _0x5cdc44={'count':0x0,'rows':[]};return db[_0xc0e7('0x42')][_0xc0e7('0x68')]({'where':{'id':_0x34f862[_0xc0e7('0x5f')]['id']}})[_0xc0e7('0xd')](handleEntityNotFound(_0x48fcf1,null))[_0xc0e7('0xd')](function(_0x4ccb0c){if(_0x4ccb0c){_0x53a511[_0xc0e7('0x48')]=_['keys'](db[_0xc0e7('0x6d')][_0xc0e7('0x6f')]);_0x53a511[_0xc0e7('0x46')]=_[_0xc0e7('0x5a')](_0x34f862[_0xc0e7('0x46')]);_0x53a511[_0xc0e7('0x47')]=_['intersection'](_0x53a511['model'],_0x53a511['query']);_0x3d2c5c[_0xc0e7('0x49')]=_[_0xc0e7('0x5b')](_0x53a511[_0xc0e7('0x48')],qs['fields'](_0x34f862[_0xc0e7('0x46')][_0xc0e7('0x4a')]));_0x3d2c5c['attributes']=_0x3d2c5c[_0xc0e7('0x49')][_0xc0e7('0x4b')]?_0x3d2c5c[_0xc0e7('0x49')]:_0x53a511['model'];if(!_0x34f862['query']['hasOwnProperty'](_0xc0e7('0x4d'))){_0x3d2c5c[_0xc0e7('0x1d')]=qs[_0xc0e7('0x1d')](_0x34f862['query'][_0xc0e7('0x1d')]);_0x3d2c5c['offset']=qs[_0xc0e7('0x1b')](_0x34f862[_0xc0e7('0x46')][_0xc0e7('0x1b')]);}_0x3d2c5c[_0xc0e7('0x69')]=qs[_0xc0e7('0x4e')](_0x34f862['query']['sort']);_0x3d2c5c[_0xc0e7('0x4f')]=qs[_0xc0e7('0x47')](_[_0xc0e7('0x50')](_0x34f862[_0xc0e7('0x46')],_0x53a511[_0xc0e7('0x47')]));_0x3d2c5c[_0xc0e7('0x4f')][_0xc0e7('0x64')]=_0x4ccb0c['id'];if(_0x34f862[_0xc0e7('0x46')][_0xc0e7('0x51')]){_0x3d2c5c['where']=_[_0xc0e7('0x52')](_0x3d2c5c[_0xc0e7('0x4f')],{'$or':_['map'](_0x3d2c5c['attributes'],function(_0x58c370){var _0x4ecb06={};_0x4ecb06[_0x58c370]={'$like':'%'+_0x34f862[_0xc0e7('0x46')]['filter']+'%'};return _0x4ecb06;})});}_0x3d2c5c=_[_0xc0e7('0x52')]({},_0x3d2c5c,_0x34f862[_0xc0e7('0x53')]);return db[_0xc0e7('0x6d')]['count']({'where':_0x3d2c5c[_0xc0e7('0x4f')]})[_0xc0e7('0xd')](function(_0x187f12){_0x5cdc44[_0xc0e7('0x1e')]=_0x187f12;if(_0x34f862[_0xc0e7('0x46')]['includeAll']){_0x3d2c5c['include']=[{'all':!![]}];}return db[_0xc0e7('0x6d')][_0xc0e7('0x56')](_0x3d2c5c);})[_0xc0e7('0xd')](function(_0x4ee852){_0x5cdc44[_0xc0e7('0x70')]=_0x4ee852;return _0x5cdc44;});}})[_0xc0e7('0xd')](respondWithFilteredResult(_0x48fcf1,_0x3d2c5c))[_0xc0e7('0x17')](handleError(_0x48fcf1,null));};exports[_0xc0e7('0x71')]=function(_0x40387f,_0x362325){return db[_0xc0e7('0x42')][_0xc0e7('0x5c')]({'where':{'id':_0x40387f[_0xc0e7('0x5f')]['id']}})['then'](handleEntityNotFound(_0x362325,null))[_0xc0e7('0xd')](function(_0x26dbcc){if(_0x26dbcc){return _0x26dbcc[_0xc0e7('0x71')](_0x40387f[_0xc0e7('0x46')][_0xc0e7('0x6b')]);}})[_0xc0e7('0xd')](respondWithStatusCode(_0x362325,null))['catch'](handleError(_0x362325,null));};exports['create']=function(_0x50b037,_0x213ed7){var _0x32b03a={'name':_0x50b037[_0xc0e7('0x5d')][_0xc0e7('0x25')],'key':_0x50b037['body'][_0xc0e7('0x44')],'provider':_0x50b037[_0xc0e7('0x5d')]['provider']==='custom'?null:_0x50b037['body'][_0xc0e7('0x5e')],'email':_0x50b037['body'][_0xc0e7('0x72')],'ListId':_0x50b037[_0xc0e7('0x5d')][_0xc0e7('0x73')],'active':!_[_0xc0e7('0x74')](_0x50b037[_0xc0e7('0x5d')][_0xc0e7('0x75')])?_0x50b037[_0xc0e7('0x5d')][_0xc0e7('0x75')]:!![],'description':_0x50b037['body'][_0xc0e7('0x76')]||null};var _0x5f369a=getAuthenticationOptions(_0x32b03a[_0xc0e7('0x5e')],_0x50b037[_0xc0e7('0x5d')]);_0x32b03a[_0xc0e7('0x40')]=_0x5f369a['Imap'];_0x32b03a[_0xc0e7('0x3d')]=_0x5f369a['Smtp'];return db[_0xc0e7('0x42')]['create'](_0x32b03a,{'include':[{'model':db['MailServerOut'],'as':_0xc0e7('0x3d')},{'model':db[_0xc0e7('0x3f')],'as':_0xc0e7('0x40')}]})['then'](function(_0x4a8ed7){var _0x56588a=_0x50b037[_0xc0e7('0x32')]['get']({'plain':!![]});if(!_0x56588a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56588a['role']===_0xc0e7('0x32')){var _0x4dde66=_0x4a8ed7[_0xc0e7('0x21')]({'plain':!![]});return db[_0xc0e7('0x77')][_0xc0e7('0x5c')]({'where':{'name':'MailAccounts','userProfileId':_0x56588a[_0xc0e7('0x78')]},'raw':!![]})['then'](function(_0x53d99f){if(_0x53d99f&&_0x53d99f[_0xc0e7('0x79')]===0x0){return db[_0xc0e7('0x23')][_0xc0e7('0x66')]({'name':_0x4dde66[_0xc0e7('0x25')],'resourceId':_0x4dde66['id'],'type':_0x53d99f[_0xc0e7('0x25')],'sectionId':_0x53d99f['id']},{})[_0xc0e7('0xd')](function(){return _0x4a8ed7;});}else{return _0x4a8ed7;}})['catch'](function(_0x237593){logger['error'](_0xc0e7('0x7a'),_0x237593);throw _0x237593;});}return _0x4a8ed7;})[_0xc0e7('0xd')](respondWithResult(_0x213ed7,0xc9))[_0xc0e7('0x17')](handleError(_0x213ed7,null));};exports['getImap']=function(_0x3b4c12,_0x4cbbaf){return db[_0xc0e7('0x42')][_0xc0e7('0x68')]({'where':{'id':_0x3b4c12[_0xc0e7('0x5f')]['id']}})[_0xc0e7('0xd')](handleEntityNotFound(_0x4cbbaf,null))[_0xc0e7('0xd')](function(_0x4289ac){if(_0x4289ac){return _0x4289ac['getImap']();}return null;})[_0xc0e7('0xd')](respondWithResult(_0x4cbbaf,null))[_0xc0e7('0x17')](handleError(_0x4cbbaf,null));};exports[_0xc0e7('0x7b')]=function(_0x31f0f8,_0x5a46d2){if(_0x31f0f8[_0xc0e7('0x5d')]['id']){delete _0x31f0f8[_0xc0e7('0x5d')]['id'];}return db[_0xc0e7('0x42')][_0xc0e7('0x5c')]({'where':{'id':_0x31f0f8['params']['id']}})[_0xc0e7('0xd')](handleEntityNotFound(_0x5a46d2,null))[_0xc0e7('0xd')](function(_0x38b7e7){if(_0x38b7e7){_0x31f0f8[_0xc0e7('0x5d')][_0xc0e7('0x64')]=_0x38b7e7['id'];return db['MailServerIn'][_0xc0e7('0x66')](_0x31f0f8[_0xc0e7('0x5d')]);}})['then'](respondWithResult(_0x5a46d2,null))['catch'](handleError(_0x5a46d2,null));};exports[_0xc0e7('0x7c')]=function(_0x429f0f,_0x5de1cc){return db['MailAccount'][_0xc0e7('0x68')]({'where':{'id':_0x429f0f[_0xc0e7('0x5f')]['id']}})[_0xc0e7('0xd')](handleEntityNotFound(_0x5de1cc,null))[_0xc0e7('0xd')](function(_0x120e68){if(_0x120e68){return _0x120e68[_0xc0e7('0x7d')](null);}return null;})[_0xc0e7('0xd')](respondWithStatusCode(_0x5de1cc,null))[_0xc0e7('0x17')](handleError(_0x5de1cc,null));};exports[_0xc0e7('0x7e')]=function(_0x4c773d,_0x1c492d){return db[_0xc0e7('0x42')][_0xc0e7('0x68')]({'where':{'id':_0x4c773d[_0xc0e7('0x5f')]['id']}})[_0xc0e7('0xd')](handleEntityNotFound(_0x1c492d,null))[_0xc0e7('0xd')](function(_0x3573d4){if(_0x3573d4){return _0x3573d4[_0xc0e7('0x7e')]();}return null;})['then'](respondWithResult(_0x1c492d,null))[_0xc0e7('0x17')](handleError(_0x1c492d,null));};exports['addSmtp']=function(_0x1d2abe,_0x200191){if(_0x1d2abe['body']['id']){delete _0x1d2abe['body']['id'];}return db['MailAccount'][_0xc0e7('0x5c')]({'where':{'id':_0x1d2abe['params']['id']}})[_0xc0e7('0xd')](handleEntityNotFound(_0x200191,null))[_0xc0e7('0xd')](function(_0x4af8a2){if(_0x4af8a2){_0x1d2abe['body'][_0xc0e7('0x64')]=_0x4af8a2['id'];return db['MailServerOut'][_0xc0e7('0x66')](_0x1d2abe[_0xc0e7('0x5d')]);}})[_0xc0e7('0xd')](respondWithResult(_0x200191,null))[_0xc0e7('0x17')](handleError(_0x200191,null));};exports[_0xc0e7('0x7f')]=function(_0x46bc02,_0x426bda){return db['MailAccount']['findOne']({'where':{'id':_0x46bc02[_0xc0e7('0x5f')]['id']}})[_0xc0e7('0xd')](handleEntityNotFound(_0x426bda,null))['then'](function(_0x7e02ab){if(_0x7e02ab){return _0x7e02ab[_0xc0e7('0x80')](null);}return null;})[_0xc0e7('0xd')](respondWithStatusCode(_0x426bda,null))[_0xc0e7('0x17')](handleError(_0x426bda,null));};exports[_0xc0e7('0x81')]=function(_0x40d790,_0x3483ea){return db['MailInteraction'][_0xc0e7('0x5c')]({'where':{'id':_0x40d790[_0xc0e7('0x5f')]['id']}})[_0xc0e7('0xd')](handleEntityNotFound(_0x3483ea,null))['then'](function(_0x5a8a84){if(_0x5a8a84){return _0x5a8a84[_0xc0e7('0x81')](_0x40d790[_0xc0e7('0x5d')][_0xc0e7('0x6b')],_['omit'](_0x40d790[_0xc0e7('0x5d')],[_0xc0e7('0x6b'),'id'])||{});}})[_0xc0e7('0xd')](respondWithResult(_0x3483ea,null))[_0xc0e7('0x17')](handleError(_0x3483ea,null));};exports['getInteractions']=function(_0x2e07fc,_0x3e1514){var _0x39b252={'raw':![],'where':{}};var _0x5e7754={};var _0x43457a={'count':0x0,'rows':[]};return db[_0xc0e7('0x42')][_0xc0e7('0x68')]({'where':{'id':_0x2e07fc[_0xc0e7('0x5f')]['id']}})[_0xc0e7('0xd')](handleEntityNotFound(_0x3e1514,null))[_0xc0e7('0xd')](function(_0x627af4){if(_0x627af4){_0x5e7754['model']=_[_0xc0e7('0x5a')](db[_0xc0e7('0x82')][_0xc0e7('0x6f')]);_0x5e7754[_0xc0e7('0x46')]=_[_0xc0e7('0x5a')](_0x2e07fc[_0xc0e7('0x46')]);_0x5e7754[_0xc0e7('0x47')]=_['intersection'](_0x5e7754['model'],_0x5e7754[_0xc0e7('0x46')]);_0x39b252[_0xc0e7('0x49')]=_['intersection'](_0x5e7754[_0xc0e7('0x48')],qs['fields'](_0x2e07fc[_0xc0e7('0x46')][_0xc0e7('0x4a')]));_0x39b252[_0xc0e7('0x49')]=_0x39b252[_0xc0e7('0x49')][_0xc0e7('0x4b')]?_0x39b252[_0xc0e7('0x49')]:_0x5e7754[_0xc0e7('0x48')];if(!_0x2e07fc['query']['hasOwnProperty']('nolimit')){_0x39b252[_0xc0e7('0x1d')]=qs[_0xc0e7('0x1d')](_0x2e07fc[_0xc0e7('0x46')][_0xc0e7('0x1d')]);_0x39b252[_0xc0e7('0x1b')]=qs[_0xc0e7('0x1b')](_0x2e07fc['query'][_0xc0e7('0x1b')]);}_0x39b252['order']=qs[_0xc0e7('0x4e')](_0x2e07fc[_0xc0e7('0x46')][_0xc0e7('0x4e')]);_0x39b252['where']=qs[_0xc0e7('0x47')](_[_0xc0e7('0x50')](_0x2e07fc[_0xc0e7('0x46')],_0x5e7754[_0xc0e7('0x47')]));_0x39b252[_0xc0e7('0x4f')][_0xc0e7('0x64')]=_0x627af4['id'];if(_0x2e07fc['query'][_0xc0e7('0x51')]){_0x39b252[_0xc0e7('0x4f')]=_['merge'](_0x39b252[_0xc0e7('0x4f')],{'$or':_['map'](_0x39b252[_0xc0e7('0x49')],function(_0x545b1b){var _0x5c8975={};_0x5c8975[_0x545b1b]={'$like':'%'+_0x2e07fc[_0xc0e7('0x46')][_0xc0e7('0x51')]+'%'};return _0x5c8975;})});}_0x39b252=_['merge']({},_0x39b252,_0x2e07fc[_0xc0e7('0x53')]);return db['MailInteraction'][_0xc0e7('0x1e')]({'where':_0x39b252[_0xc0e7('0x4f')]})[_0xc0e7('0xd')](function(_0x2de276){_0x43457a[_0xc0e7('0x1e')]=_0x2de276;if(_0x2e07fc[_0xc0e7('0x46')][_0xc0e7('0x54')]){_0x39b252['include']=[{'model':db['CmContact'],'as':_0xc0e7('0x83'),'required':![]},{'model':db[_0xc0e7('0x84')],'as':'Owner','attributes':[_0xc0e7('0x25'),_0xc0e7('0x85'),_0xc0e7('0x86')],'required':![]},{'model':db[_0xc0e7('0x87')],'as':_0xc0e7('0x88'),'attributes':['id',_0xc0e7('0x25'),_0xc0e7('0x89')],'where':_0x2e07fc[_0xc0e7('0x46')][_0xc0e7('0x8a')]?{'id':_0x2e07fc[_0xc0e7('0x46')][_0xc0e7('0x8a')]}:undefined,'required':_0x2e07fc['query'][_0xc0e7('0x8a')]?!![]:![]}];}return db[_0xc0e7('0x82')][_0xc0e7('0x56')](_0x39b252);})[_0xc0e7('0xd')](function(_0x4c6d9c){_0x43457a[_0xc0e7('0x70')]=_0x4c6d9c;return _0x43457a;});}})['then'](respondWithFilteredResult(_0x3e1514,_0x39b252))['catch'](handleError(_0x3e1514,null));};exports[_0xc0e7('0x8b')]=function addApplications(_0x1362c8,_0x4c0006){var _0x41bcf2=_0x1362c8[_0xc0e7('0x5f')]['id'];var _0x221de6=_0x1362c8[_0xc0e7('0x5d')];var _0x43d03a=0xc8;var _0x337d32=null;return db['sequelize'][_0xc0e7('0x8c')]({'isolationLevel':db[_0xc0e7('0x8d')]['Transaction'][_0xc0e7('0x8e')][_0xc0e7('0x8f')]},function(_0x20f35c){return db['MailAccount'][_0xc0e7('0x68')]({'where':{'id':_0x41bcf2},'transaction':_0x20f35c})[_0xc0e7('0xd')](function(_0x16b56f){if(_0x16b56f){return db[_0xc0e7('0x90')][_0xc0e7('0x20')]({'where':{'MailAccountId':_0x41bcf2},'transaction':_0x20f35c})[_0xc0e7('0xd')](function(){var _0x47704f=_[_0xc0e7('0x45')](_0x221de6,function(_0x48684f){_0x48684f[_0xc0e7('0x64')]=_0x41bcf2;return _0x48684f;});return db[_0xc0e7('0x90')][_0xc0e7('0x91')](_0x47704f,{'transaction':_0x20f35c});});}else{_0x43d03a=0x194;_0x337d32=[];}});})[_0xc0e7('0xd')](function(){if(_0x43d03a!==0x194){return db[_0xc0e7('0x90')][_0xc0e7('0x92')]({'where':{'MailAccountId':_0x41bcf2},'order':_0xc0e7('0x93')})[_0xc0e7('0xd')](function(_0x46de3c){_0x337d32=_0x46de3c;});}})[_0xc0e7('0x17')](function(_0x47ade8){_0x43d03a=0x1f4;logger[_0xc0e7('0x13')](_0x47ade8[_0xc0e7('0x94')]);if(_0x47ade8['name']){delete _0x47ade8[_0xc0e7('0x25')];}_0x337d32=_0x47ade8;})[_0xc0e7('0x95')](function(){if(_0x337d32===null){_0x4c0006['sendStatus'](_0x43d03a);}else{if(_0x43d03a===0x1f4){_0x4c0006[_0xc0e7('0x19')](_0x43d03a)[_0xc0e7('0x96')](_0x337d32);}else{_0x4c0006['status'](_0x43d03a)[_0xc0e7('0x1a')](_0x337d32);}}});};exports['getApplications']=function(_0x5c2529,_0x4831dc){var _0xe41043={};var _0x525df8={};var _0x45ad93;var _0x48fcab;return db[_0xc0e7('0x42')][_0xc0e7('0x68')]({'where':{'id':_0x5c2529['params']['id']}})[_0xc0e7('0xd')](handleEntityNotFound(_0x4831dc,null))[_0xc0e7('0xd')](function(_0x58d81e){if(_0x58d81e){_0x45ad93=_0x58d81e;_0x525df8[_0xc0e7('0x48')]=_['keys'](db[_0xc0e7('0x90')][_0xc0e7('0x6f')]);_0x525df8[_0xc0e7('0x46')]=_[_0xc0e7('0x5a')](_0x5c2529[_0xc0e7('0x46')]);_0x525df8['filters']=_[_0xc0e7('0x5b')](_0x525df8[_0xc0e7('0x48')],_0x525df8['query']);_0xe41043['attributes']=_[_0xc0e7('0x5b')](_0x525df8[_0xc0e7('0x48')],qs[_0xc0e7('0x4a')](_0x5c2529[_0xc0e7('0x46')][_0xc0e7('0x4a')]));_0xe41043[_0xc0e7('0x49')]=_0xe41043[_0xc0e7('0x49')][_0xc0e7('0x4b')]?_0xe41043[_0xc0e7('0x49')]:_0x525df8[_0xc0e7('0x48')];_0xe41043[_0xc0e7('0x69')]=qs[_0xc0e7('0x4e')](_0x5c2529[_0xc0e7('0x46')]['sort']);_0xe41043[_0xc0e7('0x4f')]=qs[_0xc0e7('0x47')](_[_0xc0e7('0x50')](_0x5c2529['query'],_0x525df8[_0xc0e7('0x47')]));if(_0x5c2529[_0xc0e7('0x46')][_0xc0e7('0x51')]){_0xe41043['where']=_[_0xc0e7('0x52')](_0xe41043['where'],{'$or':_[_0xc0e7('0x45')](_0xe41043[_0xc0e7('0x49')],function(_0x4e0cb9){var _0x2929d3={};_0x2929d3[_0x4e0cb9]={'$like':'%'+_0x5c2529[_0xc0e7('0x46')][_0xc0e7('0x51')]+'%'};return _0x2929d3;})});}_0xe41043=_['merge']({},_0xe41043,_0x5c2529[_0xc0e7('0x53')]);return _0x45ad93[_0xc0e7('0x97')](_0xe41043);}})[_0xc0e7('0xd')](function(_0x4a4c59){if(_0x4a4c59){_0x48fcab=_0x4a4c59[_0xc0e7('0x4b')];if(!_0x5c2529[_0xc0e7('0x46')][_0xc0e7('0x4c')](_0xc0e7('0x4d'))){_0xe41043['limit']=qs[_0xc0e7('0x1d')](_0x5c2529[_0xc0e7('0x46')]['limit']);_0xe41043['offset']=qs[_0xc0e7('0x1b')](_0x5c2529[_0xc0e7('0x46')][_0xc0e7('0x1b')]);}return _0x45ad93[_0xc0e7('0x97')](_0xe41043);}})[_0xc0e7('0xd')](function(_0x203063){if(_0x203063){return _0x203063?{'count':_0x48fcab,'rows':_0x203063}:null;}})[_0xc0e7('0xd')](respondWithResult(_0x4831dc,null))[_0xc0e7('0x17')](handleError(_0x4831dc,null));};exports[_0xc0e7('0x98')]=function(_0x362904,_0x4205bd){var _0x54faa7={'raw':!![],'where':{}};var _0xca17eb={};var _0x43ce86={'count':0x0,'rows':[]};return db[_0xc0e7('0x42')][_0xc0e7('0x68')]({'where':{'id':_0x362904[_0xc0e7('0x5f')]['id']}})[_0xc0e7('0xd')](handleEntityNotFound(_0x4205bd,null))[_0xc0e7('0xd')](function(_0x335289){if(_0x335289){_0xca17eb['model']=_[_0xc0e7('0x5a')](db[_0xc0e7('0x99')][_0xc0e7('0x6f')]);_0xca17eb[_0xc0e7('0x46')]=_[_0xc0e7('0x5a')](_0x362904[_0xc0e7('0x46')]);_0xca17eb['filters']=_[_0xc0e7('0x5b')](_0xca17eb['model'],_0xca17eb[_0xc0e7('0x46')]);_0x54faa7[_0xc0e7('0x49')]=_['intersection'](_0xca17eb[_0xc0e7('0x48')],qs[_0xc0e7('0x4a')](_0x362904[_0xc0e7('0x46')][_0xc0e7('0x4a')]));_0x54faa7['attributes']=_0x54faa7[_0xc0e7('0x49')][_0xc0e7('0x4b')]?_0x54faa7[_0xc0e7('0x49')]:_0xca17eb['model'];if(!_0x362904['query'][_0xc0e7('0x4c')](_0xc0e7('0x4d'))){_0x54faa7[_0xc0e7('0x1d')]=qs[_0xc0e7('0x1d')](_0x362904[_0xc0e7('0x46')]['limit']);_0x54faa7[_0xc0e7('0x1b')]=qs[_0xc0e7('0x1b')](_0x362904[_0xc0e7('0x46')][_0xc0e7('0x1b')]);}_0x54faa7[_0xc0e7('0x69')]=qs[_0xc0e7('0x4e')](_0x362904[_0xc0e7('0x46')][_0xc0e7('0x4e')]);_0x54faa7['where']=qs[_0xc0e7('0x47')](_['pick'](_0x362904[_0xc0e7('0x46')],_0xca17eb[_0xc0e7('0x47')]));_0x54faa7['where'][_0xc0e7('0x64')]=_0x335289['id'];if(_0x362904['query'][_0xc0e7('0x51')]){_0x54faa7[_0xc0e7('0x4f')]=_[_0xc0e7('0x52')](_0x54faa7[_0xc0e7('0x4f')],{'$or':_[_0xc0e7('0x45')](_0x54faa7['attributes'],function(_0x5cde5a){var _0x5bbc34={};_0x5bbc34[_0x5cde5a]={'$like':'%'+_0x362904[_0xc0e7('0x46')]['filter']+'%'};return _0x5bbc34;})});}if(_0x362904[_0xc0e7('0x46')]['$gte']){var _0x7ec6d9=_0x362904['query'][_0xc0e7('0x9a')][_0xc0e7('0x9b')](',');var _0x49e1e2={};_0x49e1e2[_0x7ec6d9[0x0]]={'$gte':moment(_0x7ec6d9[0x1])[_0xc0e7('0x9c')](_0xc0e7('0x9d'))};_0x54faa7[_0xc0e7('0x4f')]=_['merge'](_0x54faa7[_0xc0e7('0x4f')],_0x49e1e2);}_0x54faa7=_['merge']({},_0x54faa7,_0x362904[_0xc0e7('0x53')]);return db['MailMessage'][_0xc0e7('0x1e')]({'where':_0x54faa7['where']})[_0xc0e7('0xd')](function(_0x32264f){_0x43ce86[_0xc0e7('0x1e')]=_0x32264f;if(_0x362904[_0xc0e7('0x46')][_0xc0e7('0x54')]){_0x54faa7['include']=[{'all':!![]}];}return db[_0xc0e7('0x99')][_0xc0e7('0x56')](_0x54faa7);})[_0xc0e7('0xd')](function(_0x5a49b6){if(_0x362904[_0xc0e7('0x46')][_0xc0e7('0x9e')]===_0xc0e7('0x9f')){for(var _0x3b85b1=0x0;_0x3b85b1<_0x5a49b6['length'];_0x3b85b1++){_0x5a49b6[_0x3b85b1][_0xc0e7('0x5d')]=juice(_0x5a49b6[_0x3b85b1][_0xc0e7('0x5d')]);}}_0x43ce86['rows']=_0x5a49b6;return _0x43ce86;});}})[_0xc0e7('0xd')](respondWithFilteredResult(_0x4205bd,_0x54faa7))[_0xc0e7('0x17')](handleError(_0x4205bd,null));};exports[_0xc0e7('0x96')]=function(_0x2c2208,_0x5a01c3){var _0x3cc32f,_0x41370a={},_0x4b5dfe;if(_0x2c2208['body']['to']){_0x4b5dfe=_0x2c2208[_0xc0e7('0x5d')]['to'][_0xc0e7('0x9b')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x2c2208['params']['id']},'include':[{'model':db[_0xc0e7('0xa0')],'as':_0xc0e7('0xa1'),'include':[{'model':db[_0xc0e7('0xa2')],'as':_0xc0e7('0xa3'),'where':{'email':_0x4b5dfe},'limit':0x1,'order':[[_0xc0e7('0xa4'),'DESC']]}]},{'model':db[_0xc0e7('0x58')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xc0e7('0xa5')],'as':_0xc0e7('0xa5'),'raw':!![]}]}]})[_0xc0e7('0xd')](handleEntityNotFound(_0x5a01c3,null))[_0xc0e7('0xd')](function(_0x3b7d71){if(!_0x3b7d71)return;_0x3cc32f=_0x3b7d71;if(!_0x3b7d71[_0xc0e7('0x3d')])throw new Error(_0xc0e7('0xa6'));if(_[_0xc0e7('0x74')](_0x2c2208[_0xc0e7('0x5d')][_0xc0e7('0xa7')])){_0x2c2208['body'][_0xc0e7('0xa7')]=util[_0xc0e7('0x9c')]('%s\x20<%s>',_0x3b7d71[_0xc0e7('0x25')],_0x3b7d71[_0xc0e7('0x72')]||_0x3b7d71['Smtp'][_0xc0e7('0x32')]);}if(_0x2c2208[_0xc0e7('0x5d')][_0xc0e7('0xa8')]&&_0x2c2208[_0xc0e7('0x5d')][_0xc0e7('0xa8')][_0xc0e7('0x4b')]){for(var _0x37cc26=0x0;_0x37cc26<_0x2c2208[_0xc0e7('0x5d')][_0xc0e7('0xa8')][_0xc0e7('0x4b')];_0x37cc26+=0x1){_0x2c2208['body'][_0xc0e7('0xa8')][_0x37cc26]={'filename':_0x2c2208['body'][_0xc0e7('0xa8')][_0x37cc26][_0xc0e7('0x25')],'path':path[_0xc0e7('0xa9')](config[_0xc0e7('0xaa')],_0xc0e7('0xab'),_0x2c2208[_0xc0e7('0x5d')][_0xc0e7('0xa8')][_0x37cc26][_0xc0e7('0xac')])};}}var _0x34173d=_0x3b7d71[_0xc0e7('0xad')]();return respondWithRpcPromise(_0xc0e7('0xae'),_0xc0e7('0xaf'),{'account':_0x34173d,'message':_0x2c2208[_0xc0e7('0x5d')]});})[_0xc0e7('0xd')](function(_0x123db0){if(!_0x123db0)return;_0x41370a=_0x123db0;if(!_0x3cc32f[_0xc0e7('0xa1')])throw new Error(_0xc0e7('0xb0'));if(_0x3cc32f['List'][_0xc0e7('0xa3')][_0xc0e7('0x4b')])return _0x3cc32f[_0xc0e7('0xa1')][_0xc0e7('0xa3')][0x0];return db[_0xc0e7('0xa2')][_0xc0e7('0x66')](_[_0xc0e7('0x8')](_0x2c2208[_0xc0e7('0x5d')],{'firstName':_0x2c2208[_0xc0e7('0x5d')]['to'],'email':_0x2c2208[_0xc0e7('0x5d')]['to'],'phone':_0x2c2208[_0xc0e7('0x5d')]['to'],'ListId':_0x3cc32f[_0xc0e7('0x73')]}));})[_0xc0e7('0xd')](function(_0x508c41){if(!_0x508c41)return;var _0x44ce30={'UserId':_0x2c2208['user']['id'],'ContactId':_0x508c41['id'],'MailAccountId':_0x3cc32f['id'],'inReplyTo':_0x41370a[_0xc0e7('0xb1')],'to':_0x2c2208['body'][_0xc0e7('0xa7')],'cc':_0x2c2208[_0xc0e7('0x5d')]['cc'],'subject':_0x2c2208[_0xc0e7('0x5d')][_0xc0e7('0xb2')],'attach':_0x2c2208[_0xc0e7('0x5d')][_0xc0e7('0xb3')],'firstMsgDirection':_0xc0e7('0xb4'),'lastMsgAt':moment()[_0xc0e7('0x9c')](_0xc0e7('0x9d')),'lastMsgDirection':_0xc0e7('0xb4'),'Messages':[_[_0xc0e7('0x52')](_0x2c2208['body'],{'messageId':_0x41370a['messageId'],'sentAt':moment()[_0xc0e7('0x9c')](_0xc0e7('0x9d')),'read':!![],'MailAccountId':_0x3cc32f['id'],'UserId':_0x2c2208[_0xc0e7('0x32')]['id'],'ContactId':_0x508c41['id']})]};if(_0x2c2208['body'][_0xc0e7('0xb5')]){_0x44ce30=_[_0xc0e7('0x52')](_0x44ce30,_0x2c2208[_0xc0e7('0x5d')][_0xc0e7('0xb5')]);}return db['MailInteraction']['create'](_0x44ce30,{'include':[{'model':db['MailMessage'],'as':_0xc0e7('0xb6')}]});})[_0xc0e7('0xd')](respondWithResult(_0x5a01c3,null))[_0xc0e7('0x17')](handleError(_0x5a01c3,null));};exports[_0xc0e7('0xb7')]=function(_0x30fb6f,_0x3d60fa){return db[_0xc0e7('0x42')]['find']({'where':{'id':_0x30fb6f[_0xc0e7('0x5f')]['id']},'include':[{'model':db[_0xc0e7('0x58')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xc0e7('0xa5')],'as':_0xc0e7('0xa5'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3d60fa,null))['then'](function(_0x5cdd64){if(!_0x5cdd64['Smtp'])return;var _0x13d35b=_0x5cdd64['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp',_0xc0e7('0xb7'),{'account':_0x13d35b});})[_0xc0e7('0xd')](respondWithResult(_0x3d60fa,null))[_0xc0e7('0x17')](handleError(_0x3d60fa,null));};exports[_0xc0e7('0x20')]=function(_0x2225f4,_0x58bbf7){return db['MailAccount']['find']({'where':{'id':_0x2225f4['params']['id']}})[_0xc0e7('0xd')](handleEntityNotFound(_0x58bbf7,null))[_0xc0e7('0xd')](function(_0x27db7d){if(_0x27db7d&&_0x27db7d[_0xc0e7('0x3b')]){throw new db[(_0xc0e7('0xb8'))][(_0xc0e7('0xb9'))](_0xc0e7('0xba'));}return _0x27db7d;})[_0xc0e7('0xd')](removeEntity(_0x58bbf7,null))[_0xc0e7('0x17')](handleError(_0x58bbf7,null));};exports['addAgents']=function(_0x5e0c28,_0x5ed454){return db[_0xc0e7('0x42')][_0xc0e7('0x5c')]({'where':{'id':_0x5e0c28[_0xc0e7('0x5f')]['id']}})[_0xc0e7('0xd')](handleEntityNotFound(_0x5ed454,null))['then'](function(_0x2fac98){if(_0x2fac98){return _0x2fac98[_0xc0e7('0xbb')](_0x5e0c28['body'][_0xc0e7('0x6b')],_[_0xc0e7('0xbc')](_0x5e0c28[_0xc0e7('0x5d')],[_0xc0e7('0x6b'),'id'])||{})['spread'](function(_0xaef704){for(var _0x186c10=0x0;_0x186c10<_0x5e0c28['body'][_0xc0e7('0x6b')][_0xc0e7('0x4b')];_0x186c10+=0x1){socket[_0xc0e7('0xbd')](_0xc0e7('0xbe'),{'UserId':Number(_0x5e0c28[_0xc0e7('0x5d')][_0xc0e7('0x6b')][_0x186c10]),'MailAccountId':Number(_0x5e0c28[_0xc0e7('0x5f')]['id'])});}return _0xaef704;});}})[_0xc0e7('0xd')](respondWithResult(_0x5ed454,null))[_0xc0e7('0x17')](handleError(_0x5ed454,null));};exports['removeAgents']=function(_0x56e119,_0x54dc33){return db[_0xc0e7('0x42')]['find']({'where':{'id':_0x56e119[_0xc0e7('0x5f')]['id']}})[_0xc0e7('0xd')](handleEntityNotFound(_0x54dc33,null))[_0xc0e7('0xd')](function(_0x4864bb){if(_0x4864bb){return _0x4864bb['removeAgents'](_0x56e119['query']['ids'])[_0xc0e7('0xd')](function(){if(_[_0xc0e7('0xbf')](_0x56e119[_0xc0e7('0x46')][_0xc0e7('0x6b')])){for(var _0x5b3053=0x0;_0x5b3053<_0x56e119['query'][_0xc0e7('0x6b')][_0xc0e7('0x4b')];_0x5b3053+=0x1){socket['emit'](_0xc0e7('0xc0'),{'UserId':Number(_0x56e119[_0xc0e7('0x46')][_0xc0e7('0x6b')][_0x5b3053]),'MailAccountId':Number(_0x56e119[_0xc0e7('0x5f')]['id'])});}}else{socket['emit'](_0xc0e7('0xc0'),{'UserId':Number(_0x56e119['query'][_0xc0e7('0x6b')]),'MailAccountId':Number(_0x56e119['params']['id'])});}});}})[_0xc0e7('0xd')](respondWithStatusCode(_0x54dc33,null))[_0xc0e7('0x17')](handleError(_0x54dc33,null));};exports['getAgents']=function(_0xddf3bd,_0x57b442){var _0xaaead3={};var _0x3365a6={};var _0x21759d;var _0x28ccef;return db[_0xc0e7('0x42')][_0xc0e7('0x68')]({'where':{'id':_0xddf3bd[_0xc0e7('0x5f')]['id']}})['then'](handleEntityNotFound(_0x57b442,null))[_0xc0e7('0xd')](function(_0x8798fb){if(_0x8798fb){_0x21759d=_0x8798fb;_0x3365a6[_0xc0e7('0x48')]=_[_0xc0e7('0x5a')](db['User'][_0xc0e7('0x6f')]);_0x3365a6[_0xc0e7('0x46')]=_[_0xc0e7('0x5a')](_0xddf3bd[_0xc0e7('0x46')]);_0x3365a6[_0xc0e7('0x47')]=_[_0xc0e7('0x5b')](_0x3365a6['model'],_0x3365a6[_0xc0e7('0x46')]);_0xaaead3['attributes']=_[_0xc0e7('0x5b')](_0x3365a6[_0xc0e7('0x48')],qs['fields'](_0xddf3bd[_0xc0e7('0x46')][_0xc0e7('0x4a')]));_0xaaead3[_0xc0e7('0x49')]=_0xaaead3[_0xc0e7('0x49')]['length']?_0xaaead3[_0xc0e7('0x49')]:_0x3365a6[_0xc0e7('0x48')];_0xaaead3[_0xc0e7('0x69')]=qs[_0xc0e7('0x4e')](_0xddf3bd[_0xc0e7('0x46')][_0xc0e7('0x4e')]);_0xaaead3[_0xc0e7('0x4f')]=qs[_0xc0e7('0x47')](_[_0xc0e7('0x50')](_0xddf3bd[_0xc0e7('0x46')],_0x3365a6[_0xc0e7('0x47')]));if(_0xddf3bd['query'][_0xc0e7('0x51')]){_0xaaead3[_0xc0e7('0x4f')]=_[_0xc0e7('0x52')](_0xaaead3[_0xc0e7('0x4f')],{'$or':_[_0xc0e7('0x45')](_0xaaead3[_0xc0e7('0x49')],function(_0x37de87){var _0x4e93a2={};_0x4e93a2[_0x37de87]={'$like':'%'+_0xddf3bd[_0xc0e7('0x46')][_0xc0e7('0x51')]+'%'};return _0x4e93a2;})});}_0xaaead3=_[_0xc0e7('0x52')]({},_0xaaead3,_0xddf3bd[_0xc0e7('0x53')]);return _0x21759d[_0xc0e7('0xc1')](_0xaaead3);}})[_0xc0e7('0xd')](function(_0x5f449e){if(_0x5f449e){_0x28ccef=_0x5f449e[_0xc0e7('0x4b')];if(!_0xddf3bd[_0xc0e7('0x46')][_0xc0e7('0x4c')](_0xc0e7('0x4d'))){_0xaaead3[_0xc0e7('0x1d')]=qs[_0xc0e7('0x1d')](_0xddf3bd[_0xc0e7('0x46')][_0xc0e7('0x1d')]);_0xaaead3[_0xc0e7('0x1b')]=qs['offset'](_0xddf3bd['query'][_0xc0e7('0x1b')]);}return _0x21759d[_0xc0e7('0xc1')](_0xaaead3);}})[_0xc0e7('0xd')](function(_0xf845f9){if(_0xf845f9){return _0xf845f9?{'count':_0x28ccef,'rows':_0xf845f9}:null;}})[_0xc0e7('0xd')](respondWithResult(_0x57b442,null))[_0xc0e7('0x17')](handleError(_0x57b442,null));};
\ No newline at end of file
index d585de5..49b9af5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9d9=['../../mysqldb','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty','exports','events'];(function(_0x2092a1,_0x5ba2c0){var _0x242c02=function(_0x198fea){while(--_0x198fea){_0x2092a1['push'](_0x2092a1['shift']());}};_0x242c02(++_0x5ba2c0);}(_0xb9d9,0x104));var _0x9b9d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb9d9[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require(_0x9b9d('0x0'));var MailAccount=require(_0x9b9d('0x1'))['db'][_0x9b9d('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x9b9d('0x3')](0x0);var events={'afterCreate':_0x9b9d('0x4'),'afterUpdate':_0x9b9d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2ef1dd){return function(_0x1810cf,_0xc8f8ad,_0x3d7109){MailAccountEvents['emit'](_0x2ef1dd+':'+_0x1810cf['id'],_0x1810cf);MailAccountEvents[_0x9b9d('0x6')](_0x2ef1dd,_0x1810cf);_0x3d7109(null);};}for(var e in events){if(events[_0x9b9d('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x9b9d('0x8')]=MailAccountEvents;
\ No newline at end of file
+var _0x496e=['../../mysqldb','MailAccount','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x496e,0x1a0));var _0xe496=function(_0x5261d8,_0x2cf72e){_0x5261d8=_0x5261d8-0x0;var _0x9f6a71=_0x496e[_0x5261d8];return _0x9f6a71;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xe496('0x0'))['db'][_0xe496('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xe496('0x2')](0x0);var events={'afterCreate':_0xe496('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x58f21a){return function(_0x1daba1,_0x509847,_0xa68e68){MailAccountEvents[_0xe496('0x4')](_0x58f21a+':'+_0x1daba1['id'],_0x1daba1);MailAccountEvents[_0xe496('0x4')](_0x58f21a,_0x1daba1);_0xa68e68(null);};}for(var e in events){if(events[_0xe496('0x5')](e)){var event=events[e];MailAccount[_0xe496('0x6')](e,emitEvent(event));}}module[_0xe496('0x7')]=MailAccountEvents;
\ No newline at end of file
index 7122e9a..56845c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a00=['define','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','modernAuthentication','CloudProvider','auth','user','data5','pass','./mailAccount.attributes','exports'];(function(_0x262821,_0x5e779d){var _0x499be7=function(_0x201c19){while(--_0x201c19){_0x262821['push'](_0x262821['shift']());}};_0x499be7(++_0x5e779d);}(_0x9a00,0xb2));var _0x09a0=function(_0x2d734d,_0x37443f){_0x2d734d=_0x2d734d-0x0;var _0x799a21=_0x9a00[_0x2d734d];return _0x799a21;};'use strict';var attributes=require(_0x09a0('0x0'));module[_0x09a0('0x1')]=function(_0x345714){return _0x345714[_0x09a0('0x2')](_0x09a0('0x3'),attributes,{'tableName':_0x09a0('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x5d676d=this;var _0x389f34={'id':_0x5d676d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5d676d[_0x09a0('0x5')]!==_0x09a0('0x6')){_0x389f34[_0x09a0('0x7')]=_0x5d676d['provider'];}else{_0x389f34[_0x09a0('0x8')]=_0x5d676d[_0x09a0('0x9')][_0x09a0('0x8')];_0x389f34[_0x09a0('0xa')]=_0x5d676d[_0x09a0('0x9')]['port'];_0x389f34[_0x09a0('0xb')]=_0x5d676d[_0x09a0('0x9')][_0x09a0('0xb')];}if(_0x5d676d['Smtp']['authentication']){if(_0x5d676d[_0x09a0('0x9')][_0x09a0('0xc')]){if(!_0x5d676d[_0x09a0('0x9')][_0x09a0('0xd')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x389f34[_0x09a0('0xe')]={'type':'OAuth2','user':_0x5d676d[_0x09a0('0x9')][_0x09a0('0xf')],'accessToken':_0x5d676d[_0x09a0('0x9')][_0x09a0('0xd')][_0x09a0('0x10')]};}else{_0x389f34[_0x09a0('0xe')]={'user':_0x5d676d['Smtp']['user'],'pass':_0x5d676d['Smtp'][_0x09a0('0x11')]};}}return _0x389f34;}}});};
\ No newline at end of file
+var _0xb1f7=['service','host','Smtp','port','secure','modernAuthentication','CloudProvider','OAuth2','user','data5','auth','./mailAccount.attributes','exports','MailAccount','mail_accounts','custom'];(function(_0x959d99,_0x339028){var _0x325388=function(_0x223a12){while(--_0x223a12){_0x959d99['push'](_0x959d99['shift']());}};_0x325388(++_0x339028);}(_0xb1f7,0xdb));var _0x7b1f=function(_0x1f6ee5,_0x2eba21){_0x1f6ee5=_0x1f6ee5-0x0;var _0x167f5b=_0xb1f7[_0x1f6ee5];return _0x167f5b;};'use strict';var attributes=require(_0x7b1f('0x0'));module[_0x7b1f('0x1')]=function(_0x3fc967){return _0x3fc967['define'](_0x7b1f('0x2'),attributes,{'tableName':_0x7b1f('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0xa45c86=this;var _0x3cfd3e={'id':_0xa45c86['id'],'tls':{'rejectUnauthorized':![]}};if(_0xa45c86['provider']!==_0x7b1f('0x4')){_0x3cfd3e[_0x7b1f('0x5')]=_0xa45c86['provider'];}else{_0x3cfd3e[_0x7b1f('0x6')]=_0xa45c86[_0x7b1f('0x7')]['host'];_0x3cfd3e[_0x7b1f('0x8')]=_0xa45c86[_0x7b1f('0x7')][_0x7b1f('0x8')];_0x3cfd3e[_0x7b1f('0x9')]=_0xa45c86['Smtp']['secure'];}if(_0xa45c86['Smtp']['authentication']){if(_0xa45c86['Smtp'][_0x7b1f('0xa')]){if(!_0xa45c86['Smtp'][_0x7b1f('0xb')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x3cfd3e['auth']={'type':_0x7b1f('0xc'),'user':_0xa45c86[_0x7b1f('0x7')][_0x7b1f('0xd')],'accessToken':_0xa45c86[_0x7b1f('0x7')]['CloudProvider'][_0x7b1f('0xe')]};}else{_0x3cfd3e[_0x7b1f('0xf')]={'user':_0xa45c86[_0x7b1f('0x7')]['user'],'pass':_0xa45c86[_0x7b1f('0x7')]['pass']};}}return _0x3cfd3e;}}});};
\ No newline at end of file
index 2b9c51f..84d3b5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','find','smtp','setDataValue','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','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','CmList','List','Contacts','DESC','MailApplication','Applications','CloudProvider','get','account','omit','smtpOptions','applications','list','orderBy','asc','autoclose','push','length','close','create','List\x20not\x20found','contact','messageId','generate','subject','format','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','attach','YYYY-MM-DD\x20HH:mm:ss','interaction','created','originTo','originCc','originChannel','Email','Attachments','UserId','User','unshift','agent','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash'];(function(_0x207461,_0x3296ba){var _0x5939b4=function(_0x2d641b){while(--_0x2d641b){_0x207461['push'](_0x207461['shift']());}};_0x5939b4(++_0x3296ba);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xac4a('0x0'));var moment=require(_0xac4a('0x1'));var BPromise=require(_0xac4a('0x2'));var rs=require(_0xac4a('0x3'));var Redis=require(_0xac4a('0x4'));var db=require(_0xac4a('0x5'))['db'];var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xac4a('0x6'));var client=jayson[_0xac4a('0x7')][_0xac4a('0x8')]({'port':0x232c});config[_0xac4a('0x9')]=_[_0xac4a('0xa')](config[_0xac4a('0x9')],{'host':_0xac4a('0xb'),'port':0x18eb});var socket=require(_0xac4a('0xc'))(new Redis(config['redis']));require('./mailAccount.socket')[_0xac4a('0xd')](socket);function respondWithRpcPromise(_0x2a4d53,_0x26ec84,_0x4f4146){return new BPromise(function(_0x1d182e,_0x3a82de){return client[_0xac4a('0xe')](_0x2a4d53,_0x4f4146)['then'](function(_0x30135d){logger['info'](_0xac4a('0xf'),_0x26ec84,'request\x20sent');logger[_0xac4a('0x10')](_0xac4a('0x11'),_0x26ec84,_0xac4a('0x12'),JSON['stringify'](_0x30135d));if(_0x30135d[_0xac4a('0x13')]){if(_0x30135d[_0xac4a('0x13')][_0xac4a('0x14')]===0x1f4){logger[_0xac4a('0x13')](_0xac4a('0xf'),_0x26ec84,_0x30135d[_0xac4a('0x13')][_0xac4a('0x15')]);return _0x3a82de(_0x30135d[_0xac4a('0x13')][_0xac4a('0x15')]);}logger[_0xac4a('0x13')](_0xac4a('0xf'),_0x26ec84,_0x30135d[_0xac4a('0x13')]['message']);return _0x1d182e(_0x30135d[_0xac4a('0x13')][_0xac4a('0x15')]);}else{logger[_0xac4a('0x16')](_0xac4a('0xf'),_0x26ec84,_0xac4a('0x12'));_0x1d182e(_0x30135d[_0xac4a('0x17')][_0xac4a('0x15')]);}})[_0xac4a('0x18')](function(_0x546c5d){logger['error'](_0xac4a('0xf'),_0x26ec84,_0x546c5d);_0x3a82de(_0x546c5d);});});}exports[_0xac4a('0x19')]=function(_0x39b691){var _0x4d837c=this;return new Promise(function(_0x39e83e,_0x15c223){return db[_0xac4a('0x1a')][_0xac4a('0x1b')]({'raw':_0x39b691[_0xac4a('0x1c')]?_0x39b691[_0xac4a('0x1c')][_0xac4a('0x1d')]===undefined?!![]:![]:!![],'where':_0x39b691[_0xac4a('0x1c')]?_0x39b691['options'][_0xac4a('0x1e')]||null:null,'attributes':_0x39b691[_0xac4a('0x1c')]?_0x39b691['options'][_0xac4a('0x1f')]||null:null,'limit':_0x39b691[_0xac4a('0x1c')]?_0x39b691[_0xac4a('0x1c')][_0xac4a('0x20')]||null:null,'include':_0x39b691['options']?_0x39b691[_0xac4a('0x1c')][_0xac4a('0x21')]?_[_0xac4a('0x22')](_0x39b691[_0xac4a('0x1c')][_0xac4a('0x21')],function(_0x2b0dc2){return{'model':db[_0x2b0dc2[_0xac4a('0x23')]],'as':_0x2b0dc2['as'],'attributes':_0x2b0dc2[_0xac4a('0x1f')],'include':_0x2b0dc2[_0xac4a('0x21')]?_[_0xac4a('0x22')](_0x2b0dc2[_0xac4a('0x21')],function(_0x215a31){return{'model':db[_0x215a31[_0xac4a('0x23')]],'as':_0x215a31['as'],'attributes':_0x215a31[_0xac4a('0x1f')],'include':_0x215a31[_0xac4a('0x21')]?_[_0xac4a('0x22')](_0x215a31['include'],function(_0x23b061){return{'model':db[_0x23b061[_0xac4a('0x23')]],'as':_0x23b061['as'],'attributes':_0x23b061[_0xac4a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xac4a('0x24')](function(_0x116700){logger['info']('GetMailAccount',_0x39b691);logger[_0xac4a('0x10')](_0xac4a('0x19'),_0x39b691,JSON[_0xac4a('0x25')](_0x116700));_0x39e83e(_0x116700);})['catch'](function(_0x4bda1f){logger[_0xac4a('0x13')](_0xac4a('0x19'),_0x4bda1f[_0xac4a('0x15')],_0x39b691);_0x15c223(_0x4d837c[_0xac4a('0x13')](0x1f4,_0x4bda1f[_0xac4a('0x15')]));});});};exports['ShowMailAccount']=function(_0x6dcc7f){var _0x482afc=this;return new Promise(function(_0x30364b,_0x57adcf){return db[_0xac4a('0x1a')][_0xac4a('0x26')]({'raw':_0x6dcc7f[_0xac4a('0x1c')]?_0x6dcc7f[_0xac4a('0x1c')][_0xac4a('0x1d')]===undefined?!![]:![]:!![],'where':_0x6dcc7f[_0xac4a('0x1c')]?_0x6dcc7f[_0xac4a('0x1c')][_0xac4a('0x1e')]||null:null,'attributes':_0x6dcc7f[_0xac4a('0x1c')]?_0x6dcc7f[_0xac4a('0x1c')][_0xac4a('0x1f')]||null:null,'include':_0x6dcc7f[_0xac4a('0x1c')]?_0x6dcc7f[_0xac4a('0x1c')][_0xac4a('0x21')]?_['map'](_0x6dcc7f[_0xac4a('0x1c')][_0xac4a('0x21')],function(_0x5a4e2b){return{'model':db[_0x5a4e2b[_0xac4a('0x23')]],'as':_0x5a4e2b['as'],'attributes':_0x5a4e2b[_0xac4a('0x1f')],'include':_0x5a4e2b['include']?_['map'](_0x5a4e2b[_0xac4a('0x21')],function(_0x1ba096){return{'model':db[_0x1ba096[_0xac4a('0x23')]],'as':_0x1ba096['as'],'attributes':_0x1ba096[_0xac4a('0x1f')],'include':_0x1ba096['include']?_[_0xac4a('0x22')](_0x1ba096[_0xac4a('0x21')],function(_0x4e7630){return{'model':db[_0x4e7630[_0xac4a('0x23')]],'as':_0x4e7630['as'],'attributes':_0x4e7630[_0xac4a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xac4a('0x24')](function(_0x5f0eb8){if(_0x6dcc7f[_0xac4a('0x1c')][_0xac4a('0x27')]===!![])_0x5f0eb8[_0xac4a('0x28')]('smtpOptions',_0x5f0eb8[_0xac4a('0x29')]());logger[_0xac4a('0x16')]('ShowMailAccount',_0x6dcc7f);logger['debug'](_0xac4a('0x2a'),_0x6dcc7f,JSON['stringify'](_0x5f0eb8));_0x30364b(_0x5f0eb8);})['catch'](function(_0x5f0af0){logger['error'](_0xac4a('0x2a'),_0x5f0af0[_0xac4a('0x15')],_0x6dcc7f);_0x57adcf(_0x482afc[_0xac4a('0x13')](0x1f4,_0x5f0af0[_0xac4a('0x15')]));});});};exports[_0xac4a('0x2b')]=function(_0x415f31){var _0x4220e2=this;return new Promise(function(_0x2b16f0,_0x28292c){var _0x1f7721={'body':_0x415f31[_0xac4a('0x2c')],'channel':_0xac4a('0x2d')};var _0x4e4994=_['difference'](_['keys'](db[_0xac4a('0x2e')][_0xac4a('0x2f')]),[_0xac4a('0x30'),_0xac4a('0x31'),_0xac4a('0x32'),_0xac4a('0x33')]);var _0x8febf0=![];if(_0x415f31[_0xac4a('0x2c')]['id']){delete _0x415f31[_0xac4a('0x2c')]['id'];}if(_[_0xac4a('0x34')](_0x415f31['body'][_0xac4a('0x35')])){return _0x28292c(_0x4220e2[_0xac4a('0x13')](0x1f4,_0xac4a('0x36')));}if(_[_0xac4a('0x34')](_0x415f31[_0xac4a('0x2c')]['body'])||_0x415f31[_0xac4a('0x2c')][_0xac4a('0x2c')]===''){return _0x28292c(_0x4220e2['error'](0x1f4,_0xac4a('0x37')));}if(_['isNil'](_0x415f31[_0xac4a('0x2c')][_0xac4a('0x38')])){return _0x28292c(_0x4220e2[_0xac4a('0x13')](0x1f4,_0xac4a('0x39')+_0x4e4994));}if(!_[_0xac4a('0x3a')](_0x4e4994,_0x415f31[_0xac4a('0x2c')][_0xac4a('0x38')])){return _0x28292c(_0x4220e2[_0xac4a('0x13')](0x1f4,_0xac4a('0x3b')+_0x4e4994));}var _0xcb002b={};_0xcb002b[_0x415f31[_0xac4a('0x2c')][_0xac4a('0x38')]]=_0x415f31['body'][_0xac4a('0x35')];return db[_0xac4a('0x1a')][_0xac4a('0x26')]({'where':{'id':_0x415f31['account']['id']},'include':[{'model':db[_0xac4a('0x3c')],'as':_0xac4a('0x3d'),'include':[{'model':db['CmContact'],'as':_0xac4a('0x3e'),'where':_0xcb002b,'limit':0x1,'order':[['updatedAt',_0xac4a('0x3f')]]}]},{'model':db[_0xac4a('0x40')],'as':_0xac4a('0x41')},{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0xac4a('0x42')],'as':'CloudProvider'}]}]})[_0xac4a('0x24')](function(_0x566258){if(_0x566258&&_0x566258[_0xac4a('0x3d')]){var _0x530bbb=_0x566258[_0xac4a('0x43')]({'plain':!![]});_0x1f7721[_0xac4a('0x44')]=_[_0xac4a('0x45')](_0x530bbb,[_0xac4a('0x41'),'List']);_0x1f7721[_0xac4a('0x44')][_0xac4a('0x46')]=_0x566258[_0xac4a('0x29')]();_0x1f7721[_0xac4a('0x47')]=_0x530bbb[_0xac4a('0x41')];_0x1f7721[_0xac4a('0x48')]=_0x530bbb[_0xac4a('0x3d')];_0x1f7721['applications']=_[_0xac4a('0x49')](_0x1f7721[_0xac4a('0x47')],['priority'],[_0xac4a('0x4a')]);if(_0x1f7721[_0xac4a('0x44')]&&_0x1f7721[_0xac4a('0x44')][_0xac4a('0x4b')]){_0x1f7721['applications'][_0xac4a('0x4c')]({'id':0x0,'priority':_0x1f7721[_0xac4a('0x47')][_0xac4a('0x4d')]+0x1,'app':_0xac4a('0x4e'),'appdata':_0xac4a('0x4b'),'interval':'*,*,*,*'});}if(_0x1f7721[_0xac4a('0x44')]['Applications']){delete _0x1f7721[_0xac4a('0x44')][_0xac4a('0x41')];}if(_0x1f7721['account']['List']){delete _0x1f7721[_0xac4a('0x44')][_0xac4a('0x3d')];}if(_0x530bbb['List'][_0xac4a('0x3e')][_0xac4a('0x4d')]){return _0x530bbb[_0xac4a('0x3d')][_0xac4a('0x3e')][0x0];}var _0x48900f=_[_0xac4a('0xa')](_0x415f31[_0xac4a('0x2c')],{'firstName':_0x415f31[_0xac4a('0x2c')][_0xac4a('0x35')],'ListId':_0x530bbb[_0xac4a('0x33')]});_0x48900f[_0x415f31[_0xac4a('0x2c')][_0xac4a('0x38')]]=_0x415f31['body'][_0xac4a('0x35')];return db[_0xac4a('0x2e')][_0xac4a('0x4f')](_0x48900f);}else{throw new Error(_0xac4a('0x50'));}})[_0xac4a('0x24')](function(_0x2ac1e9){_0x1f7721[_0xac4a('0x51')]=_0x2ac1e9;if(_0x2ac1e9){if(!_0x415f31[_0xac4a('0x2c')][_0xac4a('0x15')][_0xac4a('0x52')]){_0x415f31[_0xac4a('0x2c')][_0xac4a('0x15')][_0xac4a('0x52')]=rs[_0xac4a('0x53')]()+'\x20'+_0x415f31[_0xac4a('0x2c')][_0xac4a('0x15')]['from'];}var _0x13a577={'ContactId':_0x2ac1e9['id'],'MailAccountId':_0x415f31['account']['id'],'inReplyTo':_0x415f31[_0xac4a('0x2c')]['message'][_0xac4a('0x52')],'to':_0x415f31['body'][_0xac4a('0x15')]['from'],'cc':_0x415f31['body'][_0xac4a('0x15')]['cc'],'subject':_0x415f31[_0xac4a('0x2c')][_0xac4a('0x15')][_0xac4a('0x54')],'attach':_0x415f31[_0xac4a('0x2c')][_0xac4a('0x15')]['attach'],'lastMsgAt':moment()[_0xac4a('0x55')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0xac4a('0x56')]['find']({'where':{'closed':![],'MailAccountId':_0x415f31[_0xac4a('0x44')]['id']},'include':[{'model':db[_0xac4a('0x57')],'as':_0xac4a('0x58'),'attributes':[_0xac4a('0x52')],'where':{'messageId':_0x415f31[_0xac4a('0x2c')][_0xac4a('0x15')][_0xac4a('0x59')]}}]})[_0xac4a('0x24')](function(_0x2ff07a){if(_0x2ff07a){return[_0x2ff07a,![]];}return db[_0xac4a('0x56')][_0xac4a('0x4f')](_0x13a577)[_0xac4a('0x24')](function(_0x1fe05a){return[_0x1fe05a,!![]];});});}else{throw new Error(_0xac4a('0x5a'));}})[_0xac4a('0x5b')](function(_0xf07212,_0x38cb4f){if(_0xf07212){_0x8febf0=_0x38cb4f;if(!_0x38cb4f){return _0xf07212['update']({'inReplyTo':_0x415f31[_0xac4a('0x2c')][_0xac4a('0x15')]['messageId'],'to':_0x415f31[_0xac4a('0x2c')][_0xac4a('0x15')][_0xac4a('0x35')],'cc':_0x415f31[_0xac4a('0x2c')][_0xac4a('0x15')]['cc'],'subject':_0x415f31['body']['message'][_0xac4a('0x54')],'attach':_0xf07212[_0xac4a('0x5c')]?_0xf07212[_0xac4a('0x5c')]:_0x415f31[_0xac4a('0x2c')][_0xac4a('0x15')][_0xac4a('0x5c')],'substatus':null,'substatusAt':moment()[_0xac4a('0x55')](_0xac4a('0x5d')),'lastMsgAt':moment()[_0xac4a('0x55')](_0xac4a('0x5d')),'lastMsgDirection':'in'});}else{return _0xf07212;}}})[_0xac4a('0x24')](function(_0x49e5f5){_0x1f7721['interaction']=_0x49e5f5[_0xac4a('0x43')]({'plain':!![]});_0x1f7721[_0xac4a('0x5e')][_0xac4a('0x5f')]=_0x8febf0;return db[_0xac4a('0x57')][_0xac4a('0x4f')]({'body':_0x415f31[_0xac4a('0x2c')][_0xac4a('0x2c')],'MailAccountId':_0x415f31[_0xac4a('0x44')]['id'],'MailInteractionId':_0x49e5f5['id'],'direction':'in','ContactId':_0x1f7721[_0xac4a('0x51')]['id'],'messageId':_0x415f31[_0xac4a('0x2c')][_0xac4a('0x15')][_0xac4a('0x52')],'from':_0x415f31['body'][_0xac4a('0x15')][_0xac4a('0x35')],'to':_0x415f31[_0xac4a('0x2c')][_0xac4a('0x15')]['to'],'cc':_0x415f31['body'][_0xac4a('0x15')]['cc'],'subject':_0x415f31['body'][_0xac4a('0x15')][_0xac4a('0x54')],'attach':_0x415f31['body']['message'][_0xac4a('0x5c')],'Attachments':_0x415f31[_0xac4a('0x2c')][_0xac4a('0x15')]['attachments'],'originTo':_0x415f31[_0xac4a('0x2c')]['message'][_0xac4a('0x60')],'originCc':_0x415f31['body']['message'][_0xac4a('0x61')],'bcc':_0x415f31['body'][_0xac4a('0x15')]['bcc'],'ChatWebsiteId':_0x415f31[_0xac4a('0x2c')][_0xac4a('0x15')]['ChatWebsiteId']||null,'originChannel':_0x415f31[_0xac4a('0x2c')]['message'][_0xac4a('0x62')]||_0xac4a('0x63'),'ChatOfflineMessageId':_0x415f31['body'][_0xac4a('0x15')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':_0xac4a('0x64')}]});})['then'](function(_0x26b962){_0x1f7721['message']=_0x26b962;if(_0x1f7721['interaction'][_0xac4a('0x65')]){return db[_0xac4a('0x66')][_0xac4a('0x26')]({'attributes':['id','name'],'where':{'id':_0x1f7721['interaction'][_0xac4a('0x65')]}})[_0xac4a('0x24')](function(_0x5ac8cc){if(_0x5ac8cc){_0x1f7721['applications'][_0xac4a('0x67')]({'id':0x0,'priority':0x0,'app':_0xac4a('0x68'),'appdata':_0x5ac8cc[_0xac4a('0x69')]+','+(_0x1f7721[_0xac4a('0x44')][_0xac4a('0x6a')]||0xa),'interval':_0xac4a('0x6b')});}return respondWithRpcPromise(_0xac4a('0x6c'),_0xac4a('0x6d'),_0x1f7721);});}return respondWithRpcPromise(_0xac4a('0x6c'),'startRouting',_0x1f7721);})[_0xac4a('0x24')](function(_0x440dc4){_0x2b16f0(_0x440dc4);})[_0xac4a('0x18')](function(_0x582e1e){_0x28292c(_0x4220e2[_0xac4a('0x13')](0x1f4,_0x582e1e[_0xac4a('0x15')]));});});};
\ No newline at end of file
+var _0x1261=['Contact\x20not\x20found','spread','update','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','User','UserId','unshift','agent','*,*,*,*','Start','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./mailAccount.socket','register','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','MailAccount','options','where','attributes','limit','map','include','model','ShowMailAccount','find','setDataValue','getSmtpOptions','catch','difference','keys','CmContact','rawAttributes','createdAt','body','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','account','CmList','List','Contacts','updatedAt','MailApplication','Applications','Smtp','CloudProvider','get','omit','smtpOptions','applications','priority','asc','autoclose','push','close','length','ListId','create','List\x20not\x20found','contact','messageId','generate','attach','format','MailInteraction','Messages','inReplyTo'];(function(_0x54aea3,_0xae7d81){var _0x21ae46=function(_0xe16dbc){while(--_0xe16dbc){_0x54aea3['push'](_0x54aea3['shift']());}};_0x21ae46(++_0xae7d81);}(_0x1261,0x144));var _0x1126=function(_0x218419,_0x57f42c){_0x218419=_0x218419-0x0;var _0xe4f396=_0x1261[_0x218419];return _0xe4f396;};'use strict';var _=require('lodash');var moment=require(_0x1126('0x0'));var BPromise=require(_0x1126('0x1'));var rs=require(_0x1126('0x2'));var Redis=require(_0x1126('0x3'));var db=require(_0x1126('0x4'))['db'];var logger=require(_0x1126('0x5'))(_0x1126('0x6'));var config=require(_0x1126('0x7'));var jayson=require(_0x1126('0x8'));var client=jayson[_0x1126('0x9')]['http']({'port':0x232c});config['redis']=_[_0x1126('0xa')](config[_0x1126('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1126('0xc'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xd'))[_0x1126('0xe')](socket);function respondWithRpcPromise(_0x2d9033,_0x59cfa1,_0x3f09ac){return new BPromise(function(_0x18dbe6,_0x167ef1){return client['request'](_0x2d9033,_0x3f09ac)[_0x1126('0xf')](function(_0x5d581b){logger['info'](_0x1126('0x10'),_0x59cfa1,'request\x20sent');logger[_0x1126('0x11')](_0x1126('0x12'),_0x59cfa1,_0x1126('0x13'),JSON[_0x1126('0x14')](_0x5d581b));if(_0x5d581b[_0x1126('0x15')]){if(_0x5d581b[_0x1126('0x15')][_0x1126('0x16')]===0x1f4){logger[_0x1126('0x15')](_0x1126('0x10'),_0x59cfa1,_0x5d581b['error']['message']);return _0x167ef1(_0x5d581b[_0x1126('0x15')][_0x1126('0x17')]);}logger[_0x1126('0x15')]('MailAccount,\x20%s,\x20%s',_0x59cfa1,_0x5d581b[_0x1126('0x15')]['message']);return _0x18dbe6(_0x5d581b[_0x1126('0x15')][_0x1126('0x17')]);}else{logger[_0x1126('0x18')]('MailAccount,\x20%s,\x20%s',_0x59cfa1,_0x1126('0x13'));_0x18dbe6(_0x5d581b[_0x1126('0x19')]['message']);}})['catch'](function(_0x22ae0b){logger[_0x1126('0x15')]('MailAccount,\x20%s,\x20%s',_0x59cfa1,_0x22ae0b);_0x167ef1(_0x22ae0b);});});}exports['GetMailAccount']=function(_0x4564c0){var _0x58b109=this;return new Promise(function(_0x22ed37,_0x1d6d19){return db[_0x1126('0x1a')]['findAll']({'raw':_0x4564c0[_0x1126('0x1b')]?_0x4564c0['options']['raw']===undefined?!![]:![]:!![],'where':_0x4564c0[_0x1126('0x1b')]?_0x4564c0[_0x1126('0x1b')][_0x1126('0x1c')]||null:null,'attributes':_0x4564c0[_0x1126('0x1b')]?_0x4564c0['options'][_0x1126('0x1d')]||null:null,'limit':_0x4564c0[_0x1126('0x1b')]?_0x4564c0['options'][_0x1126('0x1e')]||null:null,'include':_0x4564c0['options']?_0x4564c0['options']['include']?_[_0x1126('0x1f')](_0x4564c0[_0x1126('0x1b')][_0x1126('0x20')],function(_0x34bcf1){return{'model':db[_0x34bcf1[_0x1126('0x21')]],'as':_0x34bcf1['as'],'attributes':_0x34bcf1[_0x1126('0x1d')],'include':_0x34bcf1[_0x1126('0x20')]?_[_0x1126('0x1f')](_0x34bcf1['include'],function(_0x35eec3){return{'model':db[_0x35eec3[_0x1126('0x21')]],'as':_0x35eec3['as'],'attributes':_0x35eec3[_0x1126('0x1d')],'include':_0x35eec3['include']?_['map'](_0x35eec3[_0x1126('0x20')],function(_0x39bf0e){return{'model':db[_0x39bf0e['model']],'as':_0x39bf0e['as'],'attributes':_0x39bf0e[_0x1126('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1126('0xf')](function(_0x4a334a){logger[_0x1126('0x18')]('GetMailAccount',_0x4564c0);logger[_0x1126('0x11')]('GetMailAccount',_0x4564c0,JSON[_0x1126('0x14')](_0x4a334a));_0x22ed37(_0x4a334a);})['catch'](function(_0x378f4d){logger['error']('GetMailAccount',_0x378f4d['message'],_0x4564c0);_0x1d6d19(_0x58b109[_0x1126('0x15')](0x1f4,_0x378f4d[_0x1126('0x17')]));});});};exports[_0x1126('0x22')]=function(_0x5b8bea){var _0x2a3055=this;return new Promise(function(_0x226afb,_0x56f7f8){return db[_0x1126('0x1a')][_0x1126('0x23')]({'raw':_0x5b8bea[_0x1126('0x1b')]?_0x5b8bea[_0x1126('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5b8bea['options']?_0x5b8bea[_0x1126('0x1b')][_0x1126('0x1c')]||null:null,'attributes':_0x5b8bea[_0x1126('0x1b')]?_0x5b8bea[_0x1126('0x1b')]['attributes']||null:null,'include':_0x5b8bea[_0x1126('0x1b')]?_0x5b8bea[_0x1126('0x1b')][_0x1126('0x20')]?_[_0x1126('0x1f')](_0x5b8bea[_0x1126('0x1b')]['include'],function(_0x2a0dfe){return{'model':db[_0x2a0dfe[_0x1126('0x21')]],'as':_0x2a0dfe['as'],'attributes':_0x2a0dfe[_0x1126('0x1d')],'include':_0x2a0dfe[_0x1126('0x20')]?_['map'](_0x2a0dfe['include'],function(_0x22827a){return{'model':db[_0x22827a[_0x1126('0x21')]],'as':_0x22827a['as'],'attributes':_0x22827a['attributes'],'include':_0x22827a[_0x1126('0x20')]?_[_0x1126('0x1f')](_0x22827a[_0x1126('0x20')],function(_0x5c08b9){return{'model':db[_0x5c08b9['model']],'as':_0x5c08b9['as'],'attributes':_0x5c08b9[_0x1126('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1126('0xf')](function(_0x3aa08f){if(_0x5b8bea[_0x1126('0x1b')]['smtp']===!![])_0x3aa08f[_0x1126('0x24')]('smtpOptions',_0x3aa08f[_0x1126('0x25')]());logger[_0x1126('0x18')](_0x1126('0x22'),_0x5b8bea);logger[_0x1126('0x11')](_0x1126('0x22'),_0x5b8bea,JSON['stringify'](_0x3aa08f));_0x226afb(_0x3aa08f);})[_0x1126('0x26')](function(_0x3ea9de){logger[_0x1126('0x15')](_0x1126('0x22'),_0x3ea9de[_0x1126('0x17')],_0x5b8bea);_0x56f7f8(_0x2a3055[_0x1126('0x15')](0x1f4,_0x3ea9de[_0x1126('0x17')]));});});};exports['NotifyMailAccount']=function(_0x1c8d8a){var _0x154c28=this;return new Promise(function(_0x227a6b,_0xf3a0bd){var _0xcf0483={'body':_0x1c8d8a['body'],'channel':'mail'};var _0x1c4f06=_[_0x1126('0x27')](_[_0x1126('0x28')](db[_0x1126('0x29')][_0x1126('0x2a')]),[_0x1126('0x2b'),'updatedAt','CompanyId','ListId']);var _0xb8054e=![];if(_0x1c8d8a['body']['id']){delete _0x1c8d8a[_0x1126('0x2c')]['id'];}if(_[_0x1126('0x2d')](_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x2e')])){return _0xf3a0bd(_0x154c28['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x1126('0x2d')](_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x2c')])||_0x1c8d8a['body'][_0x1126('0x2c')]===''){return _0xf3a0bd(_0x154c28['error'](0x1f4,_0x1126('0x2f')));}if(_['isNil'](_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x30')])){return _0xf3a0bd(_0x154c28[_0x1126('0x15')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c4f06));}if(!_[_0x1126('0x31')](_0x1c4f06,_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x30')])){return _0xf3a0bd(_0x154c28['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c4f06));}var _0x4dd7f5={};_0x4dd7f5[_0x1c8d8a[_0x1126('0x2c')]['mapKey']]=_0x1c8d8a[_0x1126('0x2c')]['from'];return db[_0x1126('0x1a')][_0x1126('0x23')]({'where':{'id':_0x1c8d8a[_0x1126('0x32')]['id']},'include':[{'model':db[_0x1126('0x33')],'as':_0x1126('0x34'),'include':[{'model':db['CmContact'],'as':_0x1126('0x35'),'where':_0x4dd7f5,'limit':0x1,'order':[[_0x1126('0x36'),'DESC']]}]},{'model':db[_0x1126('0x37')],'as':_0x1126('0x38')},{'model':db['MailServerOut'],'as':_0x1126('0x39'),'include':[{'model':db[_0x1126('0x3a')],'as':'CloudProvider'}]}]})[_0x1126('0xf')](function(_0xbdde58){if(_0xbdde58&&_0xbdde58[_0x1126('0x34')]){var _0x59656d=_0xbdde58[_0x1126('0x3b')]({'plain':!![]});_0xcf0483[_0x1126('0x32')]=_[_0x1126('0x3c')](_0x59656d,[_0x1126('0x38'),_0x1126('0x34')]);_0xcf0483[_0x1126('0x32')][_0x1126('0x3d')]=_0xbdde58[_0x1126('0x25')]();_0xcf0483['applications']=_0x59656d[_0x1126('0x38')];_0xcf0483['list']=_0x59656d[_0x1126('0x34')];_0xcf0483[_0x1126('0x3e')]=_['orderBy'](_0xcf0483['applications'],[_0x1126('0x3f')],[_0x1126('0x40')]);if(_0xcf0483[_0x1126('0x32')]&&_0xcf0483['account'][_0x1126('0x41')]){_0xcf0483[_0x1126('0x3e')][_0x1126('0x42')]({'id':0x0,'priority':_0xcf0483[_0x1126('0x3e')]['length']+0x1,'app':_0x1126('0x43'),'appdata':_0x1126('0x41'),'interval':'*,*,*,*'});}if(_0xcf0483['account']['Applications']){delete _0xcf0483['account'][_0x1126('0x38')];}if(_0xcf0483[_0x1126('0x32')]['List']){delete _0xcf0483[_0x1126('0x32')][_0x1126('0x34')];}if(_0x59656d[_0x1126('0x34')][_0x1126('0x35')][_0x1126('0x44')]){return _0x59656d['List'][_0x1126('0x35')][0x0];}var _0x267592=_['defaults'](_0x1c8d8a[_0x1126('0x2c')],{'firstName':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x2e')],'ListId':_0x59656d[_0x1126('0x45')]});_0x267592[_0x1c8d8a[_0x1126('0x2c')]['mapKey']]=_0x1c8d8a[_0x1126('0x2c')]['from'];return db[_0x1126('0x29')][_0x1126('0x46')](_0x267592);}else{throw new Error(_0x1126('0x47'));}})['then'](function(_0x427add){_0xcf0483[_0x1126('0x48')]=_0x427add;if(_0x427add){if(!_0x1c8d8a['body'][_0x1126('0x17')][_0x1126('0x49')]){_0x1c8d8a[_0x1126('0x2c')]['message'][_0x1126('0x49')]=rs[_0x1126('0x4a')]()+'\x20'+_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x2e')];}var _0x26949c={'ContactId':_0x427add['id'],'MailAccountId':_0x1c8d8a[_0x1126('0x32')]['id'],'inReplyTo':_0x1c8d8a[_0x1126('0x2c')]['message'][_0x1126('0x49')],'to':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x2e')],'cc':_0x1c8d8a[_0x1126('0x2c')]['message']['cc'],'subject':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')]['subject'],'attach':_0x1c8d8a[_0x1126('0x2c')]['message'][_0x1126('0x4b')],'lastMsgAt':moment()[_0x1126('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x1126('0x4d')][_0x1126('0x23')]({'where':{'closed':![],'MailAccountId':_0x1c8d8a[_0x1126('0x32')]['id']},'include':[{'model':db['MailMessage'],'as':_0x1126('0x4e'),'attributes':['messageId'],'where':{'messageId':_0x1c8d8a['body'][_0x1126('0x17')][_0x1126('0x4f')]}}]})[_0x1126('0xf')](function(_0x1230e9){if(_0x1230e9){return[_0x1230e9,![]];}return db[_0x1126('0x4d')][_0x1126('0x46')](_0x26949c)[_0x1126('0xf')](function(_0x5036d4){return[_0x5036d4,!![]];});});}else{throw new Error(_0x1126('0x50'));}})[_0x1126('0x51')](function(_0x116867,_0xc39c36){if(_0x116867){_0xb8054e=_0xc39c36;if(!_0xc39c36){return _0x116867[_0x1126('0x52')]({'inReplyTo':_0x1c8d8a[_0x1126('0x2c')]['message']['messageId'],'to':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')]['from'],'cc':_0x1c8d8a['body']['message']['cc'],'subject':_0x1c8d8a['body'][_0x1126('0x17')][_0x1126('0x53')],'attach':_0x116867[_0x1126('0x4b')]?_0x116867['attach']:_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x4b')],'substatus':null,'substatusAt':moment()[_0x1126('0x4c')](_0x1126('0x54')),'lastMsgAt':moment()[_0x1126('0x4c')](_0x1126('0x54')),'lastMsgDirection':'in'});}else{return _0x116867;}}})['then'](function(_0x339aa6){_0xcf0483[_0x1126('0x55')]=_0x339aa6[_0x1126('0x3b')]({'plain':!![]});_0xcf0483[_0x1126('0x55')][_0x1126('0x56')]=_0xb8054e;return db['MailMessage']['create']({'body':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x2c')],'MailAccountId':_0x1c8d8a['account']['id'],'MailInteractionId':_0x339aa6['id'],'direction':'in','ContactId':_0xcf0483[_0x1126('0x48')]['id'],'messageId':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x49')],'from':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x2e')],'to':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')]['to'],'cc':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')]['cc'],'subject':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')]['subject'],'attach':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x4b')],'Attachments':_0x1c8d8a['body']['message'][_0x1126('0x57')],'originTo':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x58')],'originCc':_0x1c8d8a['body']['message']['originCc'],'bcc':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x59')],'ChatWebsiteId':_0x1c8d8a[_0x1126('0x2c')]['message'][_0x1126('0x5a')]||null,'originChannel':_0x1c8d8a['body'][_0x1126('0x17')][_0x1126('0x5b')]||_0x1126('0x5c'),'ChatOfflineMessageId':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x5d')]||null},{'include':[{'model':db[_0x1126('0x5e')],'as':'Attachments'}]});})[_0x1126('0xf')](function(_0x57ece2){_0xcf0483[_0x1126('0x17')]=_0x57ece2;if(_0xcf0483[_0x1126('0x55')]['UserId']){return db[_0x1126('0x5f')][_0x1126('0x23')]({'attributes':['id','name'],'where':{'id':_0xcf0483[_0x1126('0x55')][_0x1126('0x60')]}})['then'](function(_0x561647){if(_0x561647){_0xcf0483[_0x1126('0x3e')][_0x1126('0x61')]({'id':0x0,'priority':0x0,'app':_0x1126('0x62'),'appdata':_0x561647['name']+','+(_0xcf0483['account']['waitForTheAssignedAgent']||0xa),'interval':_0x1126('0x63')});}return respondWithRpcPromise('Start','startRouting',_0xcf0483);});}return respondWithRpcPromise(_0x1126('0x64'),'startRouting',_0xcf0483);})[_0x1126('0xf')](function(_0x288a0c){_0x227a6b(_0x288a0c);})['catch'](function(_0x133075){_0xf3a0bd(_0x154c28[_0x1126('0x15')](0x1f4,_0x133075[_0x1126('0x17')]));});});};
\ No newline at end of file
index 9976909..9fe4f4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb11=['emit','register','length','mailAccount:','./mailAccount.events','save','remove','update'];(function(_0x7b6430,_0x259cda){var _0x4aafb3=function(_0x517f4d){while(--_0x517f4d){_0x7b6430['push'](_0x7b6430['shift']());}};_0x4aafb3(++_0x259cda);}(_0xcb11,0x1a4));var _0x1cb1=function(_0x5991d7,_0x3ca7f8){_0x5991d7=_0x5991d7-0x0;var _0x5b299d=_0xcb11[_0x5991d7];return _0x5b299d;};'use strict';var MailAccountEvents=require(_0x1cb1('0x0'));var events=[_0x1cb1('0x1'),_0x1cb1('0x2'),_0x1cb1('0x3')];function createListener(_0x14faeb,_0x55e0d6){return function(_0x11f0cd){_0x55e0d6[_0x1cb1('0x4')](_0x14faeb,_0x11f0cd);};}function removeListener(_0x546acb,_0x549aa4){return function(){MailAccountEvents['removeListener'](_0x546acb,_0x549aa4);};}exports[_0x1cb1('0x5')]=function(_0x33112d){for(var _0x22c556=0x0,_0x1d16b0=events[_0x1cb1('0x6')];_0x22c556<_0x1d16b0;_0x22c556++){var _0x59b4cc=events[_0x22c556];var _0x427ce4=createListener(_0x1cb1('0x7')+_0x59b4cc,_0x33112d);MailAccountEvents['on'](_0x59b4cc,_0x427ce4);}};
\ No newline at end of file
+var _0x720f=['emit','removeListener','register','length','./mailAccount.events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x720f,0x185));var _0xf720=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x720f[_0x2b4411];return _0x8e41ef;};'use strict';var MailAccountEvents=require(_0xf720('0x0'));var events=['save','remove','update'];function createListener(_0x38a523,_0x3e4830){return function(_0x9c808c){_0x3e4830[_0xf720('0x1')](_0x38a523,_0x9c808c);};}function removeListener(_0x23b16f,_0x1e0ae8){return function(){MailAccountEvents[_0xf720('0x2')](_0x23b16f,_0x1e0ae8);};}exports[_0xf720('0x3')]=function(_0x2abab7){for(var _0x1affee=0x0,_0x5d7c71=events[_0xf720('0x4')];_0x1affee<_0x5d7c71;_0x1affee++){var _0x1220b2=events[_0x1affee];var _0x57bec2=createListener('mailAccount:'+_0x1220b2,_0x2abab7);MailAccountEvents['on'](_0x1220b2,_0x57bec2);}};
\ No newline at end of file
index 9efc6de..b65de02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f78=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','put','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1f8435,_0x48696a){var _0x208958=function(_0x3f822d){while(--_0x3f822d){_0x1f8435['push'](_0x1f8435['shift']());}};_0x208958(++_0x48696a);}(_0x6f78,0x166));var _0x86f7=function(_0x48b441,_0x4e72d1){_0x48b441=_0x48b441-0x0;var _0x2ef83c=_0x6f78[_0x48b441];return _0x2ef83c;};'use strict';var multer=require('multer');var util=require(_0x86f7('0x0'));var path=require('path');var timeout=require(_0x86f7('0x1'));var express=require(_0x86f7('0x2'));var router=express[_0x86f7('0x3')]();var fs_extra=require(_0x86f7('0x4'));var auth=require(_0x86f7('0x5'));var interaction=require(_0x86f7('0x6'));var config=require(_0x86f7('0x7'));var controller=require('./mailApplication.controller');router[_0x86f7('0x8')](_0x86f7('0x9'),auth[_0x86f7('0xa')](),controller['show']);router[_0x86f7('0xb')](_0x86f7('0x9'),auth[_0x86f7('0xa')](),controller['update']);router['delete'](_0x86f7('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x86f7('0xc')]=router;
\ No newline at end of file
+var _0x8a57=['update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put'];(function(_0x539c1d,_0x2ae224){var _0x4a49fd=function(_0x4a41c0){while(--_0x4a41c0){_0x539c1d['push'](_0x539c1d['shift']());}};_0x4a49fd(++_0x2ae224);}(_0x8a57,0x19c));var _0x78a5=function(_0x34b25b,_0x1bec89){_0x34b25b=_0x34b25b-0x0;var _0x4cebf6=_0x8a57[_0x34b25b];return _0x4cebf6;};'use strict';var multer=require('multer');var util=require(_0x78a5('0x0'));var path=require('path');var timeout=require(_0x78a5('0x1'));var express=require(_0x78a5('0x2'));var router=express['Router']();var fs_extra=require(_0x78a5('0x3'));var auth=require(_0x78a5('0x4'));var interaction=require(_0x78a5('0x5'));var config=require(_0x78a5('0x6'));var controller=require(_0x78a5('0x7'));router[_0x78a5('0x8')](_0x78a5('0x9'),auth[_0x78a5('0xa')](),controller[_0x78a5('0xb')]);router[_0x78a5('0xc')](_0x78a5('0x9'),auth[_0x78a5('0xa')](),controller[_0x78a5('0xd')]);router[_0x78a5('0xe')](_0x78a5('0x9'),auth[_0x78a5('0xa')](),controller[_0x78a5('0xf')]);module[_0x78a5('0x10')]=router;
\ No newline at end of file
index 7627f61..c94f3ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd345=['noop','*,*,*,*','sequelize','exports','STRING'];(function(_0x3724d7,_0x21491d){var _0x3557e7=function(_0x317a18){while(--_0x317a18){_0x3724d7['push'](_0x3724d7['shift']());}};_0x3557e7(++_0x21491d);}(_0xd345,0x133));var _0x5d34=function(_0x5d2f46,_0x2b30e1){_0x5d2f46=_0x5d2f46-0x0;var _0x1d663e=_0xd345[_0x5d2f46];return _0x1d663e;};'use strict';var Sequelize=require(_0x5d34('0x0'));module[_0x5d34('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5d34('0x2')],'allowNull':![],'defaultValue':_0x5d34('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x5d34('0x2')],'defaultValue':_0x5d34('0x4')}};
\ No newline at end of file
+var _0x1d78=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x391b3a,_0xbc016){var _0x56ab47=function(_0x4eb269){while(--_0x4eb269){_0x391b3a['push'](_0x391b3a['shift']());}};_0x56ab47(++_0xbc016);}(_0x1d78,0x11c));var _0x81d7=function(_0x5a24e9,_0x439e75){_0x5a24e9=_0x5a24e9-0x0;var _0x3cfec6=_0x1d78[_0x5a24e9];return _0x3cfec6;};'use strict';var Sequelize=require(_0x81d7('0x0'));module[_0x81d7('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x81d7('0x2')],'allowNull':![],'defaultValue':_0x81d7('0x3')},'appdata':{'type':Sequelize[_0x81d7('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x81d7('0x2')],'defaultValue':_0x81d7('0x5')}};
\ No newline at end of file
index cc5e0dd..5384557 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['name','status','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x401035,_0x1aa106){var _0x45c84e=function(_0x4ece73){while(--_0x4ece73){_0x401035['push'](_0x401035['shift']());}};_0x45c84e(++_0x1aa106);}(_0xb43b,0x1b2));var _0xbb43=function(_0x179b2d,_0x4f73d7){_0x179b2d=_0x179b2d-0x0;var _0x3a11f2=_0xb43b[_0x179b2d];return _0x3a11f2;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['MailApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));};
\ No newline at end of file
+var _0x9c44=['Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x7148a3,_0x1c6652){var _0x52f31d=function(_0x31c8a7){while(--_0x31c8a7){_0x7148a3['push'](_0x7148a3['shift']());}};_0x52f31d(++_0x1c6652);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={'raw':!![],'where':{'id':_0x5987ae[_0x49c4('0x29')]['id']}},_0x46e04d={};_0x46e04d[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](db[_0x49c4('0x2c')][_0x49c4('0x2d')]);_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2b')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d['filters']=_['intersection'](_0x46e04d['model'],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x46e04d[_0x49c4('0x2a')],qs[_0x49c4('0x31')](_0x5987ae['query'][_0x49c4('0x31')]));_0x2b2793[_0x49c4('0x2f')]=_0x2b2793[_0x49c4('0x2f')][_0x49c4('0x32')]?_0x2b2793['attributes']:_0x46e04d['model'];if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x33')]){_0x2b2793[_0x49c4('0x34')]=[{'all':!![]}];}_0x2b2793=_[_0x49c4('0x35')]({},_0x2b2793,_0x5987ae[_0x49c4('0x36')]);return db['MailApplication'][_0x49c4('0x37')](_0x2b2793)[_0x49c4('0x38')](handleEntityNotFound(_0x889909,null))[_0x49c4('0x38')](respondWithResult(_0x889909,null))['catch'](handleError(_0x889909,null));};exports['update']=function(_0x85dce2,_0x1991e9){if(_0x85dce2[_0x49c4('0x39')]['id']){delete _0x85dce2[_0x49c4('0x39')]['id'];}return db[_0x49c4('0x2c')][_0x49c4('0x37')]({'where':{'id':_0x85dce2[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x1991e9,null))[_0x49c4('0x38')](saveUpdates(_0x85dce2['body'],null))[_0x49c4('0x38')](respondWithResult(_0x1991e9,null))['catch'](handleError(_0x1991e9,null));};exports[_0x49c4('0x23')]=function(_0x349791,_0x2625a6){return db[_0x49c4('0x2c')]['find']({'where':{'id':_0x349791[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x2625a6,null))[_0x49c4('0x38')](removeEntity(_0x2625a6,null))['catch'](handleError(_0x2625a6,null));};
\ No newline at end of file
index e3e771e..2395c09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe588=['lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','MailApplication','utf8mb4_unicode_ci'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xe588,0x181));var _0x8e58=function(_0xefbaa9,_0xa5ed70){_0xefbaa9=_0xefbaa9-0x0;var _0x2db664=_0xe588[_0xefbaa9];return _0x2db664;};'use strict';var _=require(_0x8e58('0x0'));var util=require('util');var logger=require(_0x8e58('0x1'))('api');var moment=require(_0x8e58('0x2'));var BPromise=require(_0x8e58('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e58('0x4'));var rimraf=require(_0x8e58('0x5'));var config=require(_0x8e58('0x6'));var attributes=require('./mailApplication.attributes');module[_0x8e58('0x7')]=function(_0x4ea311,_0x1f06c3){return _0x4ea311[_0x8e58('0x8')](_0x8e58('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8e58('0xa')});};
\ No newline at end of file
+var _0xf034=['MailApplication','utf8mb4','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','define'];(function(_0x19a9a5,_0x2bf8b2){var _0x5306fe=function(_0x20f9e1){while(--_0x20f9e1){_0x19a9a5['push'](_0x19a9a5['shift']());}};_0x5306fe(++_0x2bf8b2);}(_0xf034,0x120));var _0x4f03=function(_0x5e78ef,_0x3458dd){_0x5e78ef=_0x5e78ef-0x0;var _0x41bae9=_0xf034[_0x5e78ef];return _0x41bae9;};'use strict';var _=require(_0x4f03('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4f03('0x1'));var moment=require('moment');var BPromise=require(_0x4f03('0x2'));var rp=require(_0x4f03('0x3'));var fs=require('fs');var path=require(_0x4f03('0x4'));var rimraf=require(_0x4f03('0x5'));var config=require(_0x4f03('0x6'));var attributes=require(_0x4f03('0x7'));module['exports']=function(_0x7b9e2b,_0x2e8e8b){return _0x7b9e2b[_0x4f03('0x8')](_0x4f03('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4f03('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 916091c..4102be3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7451=['update','body','options','attributes','limit','then','lodash','moment','bluebird','randomstring','ioredis','jayson/promise','client','http','request','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateMailApplication','MailApplication'];(function(_0x44a736,_0x20e0bd){var _0x380580=function(_0x3e9f69){while(--_0x3e9f69){_0x44a736['push'](_0x44a736['shift']());}};_0x380580(++_0x20e0bd);}(_0x7451,0x1ec));var _0x1745=function(_0x111b5d,_0xe446a2){_0x111b5d=_0x111b5d-0x0;var _0x19a482=_0x7451[_0x111b5d];return _0x19a482;};'use strict';var _=require(_0x1745('0x0'));var util=require('util');var moment=require(_0x1745('0x1'));var BPromise=require(_0x1745('0x2'));var rs=require(_0x1745('0x3'));var fs=require('fs');var Redis=require(_0x1745('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1745('0x5'));var client=jayson[_0x1745('0x6')][_0x1745('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4bca1b,_0x5cb29c,_0xbf6f3e){return new BPromise(function(_0x500750,_0x382af7){return client[_0x1745('0x8')](_0x4bca1b,_0xbf6f3e)['then'](function(_0x176a01){logger[_0x1745('0x9')](_0x1745('0xa'),_0x5cb29c,'request\x20sent');logger[_0x1745('0xb')](_0x1745('0xc'),_0x5cb29c,_0x1745('0xd'),JSON[_0x1745('0xe')](_0x176a01));if(_0x176a01['error']){if(_0x176a01[_0x1745('0xf')]['code']===0x1f4){logger[_0x1745('0xf')](_0x1745('0xa'),_0x5cb29c,_0x176a01['error'][_0x1745('0x10')]);return _0x382af7(_0x176a01[_0x1745('0xf')][_0x1745('0x10')]);}logger[_0x1745('0xf')](_0x1745('0xa'),_0x5cb29c,_0x176a01['error'][_0x1745('0x10')]);return _0x500750(_0x176a01[_0x1745('0xf')][_0x1745('0x10')]);}else{logger[_0x1745('0x9')](_0x1745('0xa'),_0x5cb29c,_0x1745('0xd'));_0x500750(_0x176a01[_0x1745('0x11')][_0x1745('0x10')]);}})[_0x1745('0x12')](function(_0x2a569f){logger['error'](_0x1745('0xa'),_0x5cb29c,_0x2a569f);_0x382af7(_0x2a569f);});});}exports[_0x1745('0x13')]=function(_0x945866){var _0x1b5c1e=this;return new Promise(function(_0x46020e,_0x241c91){return db[_0x1745('0x14')][_0x1745('0x15')](_0x945866[_0x1745('0x16')],{'raw':_0x945866[_0x1745('0x17')]?_0x945866[_0x1745('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x945866[_0x1745('0x17')]?_0x945866[_0x1745('0x17')]['where']||null:null,'attributes':_0x945866[_0x1745('0x17')]?_0x945866[_0x1745('0x17')][_0x1745('0x18')]||null:null,'limit':_0x945866[_0x1745('0x17')]?_0x945866[_0x1745('0x17')][_0x1745('0x19')]||null:null})[_0x1745('0x1a')](function(_0x1cf9ed){logger['info'](_0x1745('0x13'),_0x945866);logger[_0x1745('0xb')](_0x1745('0x13'),_0x945866,JSON[_0x1745('0xe')](_0x1cf9ed));_0x46020e(_0x1cf9ed);})['catch'](function(_0x6b6cb){logger['error'](_0x1745('0x13'),_0x6b6cb[_0x1745('0x10')],_0x945866);_0x241c91(_0x1b5c1e['error'](0x1f4,_0x6b6cb['message']));});});};
\ No newline at end of file
+var _0x7906=['options','raw','where','attributes','limit','UpdateMailApplication','debug','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','MailApplication','update','body'];(function(_0x400935,_0x342a6c){var _0x120271=function(_0x11eab8){while(--_0x11eab8){_0x400935['push'](_0x400935['shift']());}};_0x120271(++_0x342a6c);}(_0x7906,0x15d));var _0x6790=function(_0x7de0af,_0x2741f8){_0x7de0af=_0x7de0af-0x0;var _0x149ba6=_0x7906[_0x7de0af];return _0x149ba6;};'use strict';var _=require(_0x6790('0x0'));var util=require(_0x6790('0x1'));var moment=require(_0x6790('0x2'));var BPromise=require('bluebird');var rs=require(_0x6790('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6790('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6790('0x5'))(_0x6790('0x6'));var config=require(_0x6790('0x7'));var jayson=require(_0x6790('0x8'));var client=jayson[_0x6790('0x9')][_0x6790('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14fe7e,_0x20b904,_0x1143a1){return new BPromise(function(_0x224bbe,_0x45651b){return client[_0x6790('0xb')](_0x14fe7e,_0x1143a1)[_0x6790('0xc')](function(_0x2baed4){logger['info'](_0x6790('0xd'),_0x20b904,_0x6790('0xe'));logger['debug'](_0x6790('0xf'),_0x20b904,_0x6790('0xe'),JSON[_0x6790('0x10')](_0x2baed4));if(_0x2baed4[_0x6790('0x11')]){if(_0x2baed4[_0x6790('0x11')]['code']===0x1f4){logger[_0x6790('0x11')](_0x6790('0xd'),_0x20b904,_0x2baed4[_0x6790('0x11')]['message']);return _0x45651b(_0x2baed4[_0x6790('0x11')]['message']);}logger[_0x6790('0x11')]('MailApplication,\x20%s,\x20%s',_0x20b904,_0x2baed4[_0x6790('0x11')]['message']);return _0x224bbe(_0x2baed4[_0x6790('0x11')][_0x6790('0x12')]);}else{logger[_0x6790('0x13')](_0x6790('0xd'),_0x20b904,_0x6790('0xe'));_0x224bbe(_0x2baed4['result'][_0x6790('0x12')]);}})['catch'](function(_0x35ec5c){logger['error'](_0x6790('0xd'),_0x20b904,_0x35ec5c);_0x45651b(_0x35ec5c);});});}exports['UpdateMailApplication']=function(_0x31b8d6){var _0x50b940=this;return new Promise(function(_0x44731c,_0x105588){return db[_0x6790('0x14')][_0x6790('0x15')](_0x31b8d6[_0x6790('0x16')],{'raw':_0x31b8d6['options']?_0x31b8d6[_0x6790('0x17')][_0x6790('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31b8d6[_0x6790('0x17')]?_0x31b8d6[_0x6790('0x17')][_0x6790('0x19')]||null:null,'attributes':_0x31b8d6[_0x6790('0x17')]?_0x31b8d6[_0x6790('0x17')][_0x6790('0x1a')]||null:null,'limit':_0x31b8d6[_0x6790('0x17')]?_0x31b8d6[_0x6790('0x17')][_0x6790('0x1b')]||null:null})[_0x6790('0xc')](function(_0x3bdca6){logger[_0x6790('0x13')](_0x6790('0x1c'),_0x31b8d6);logger[_0x6790('0x1d')](_0x6790('0x1c'),_0x31b8d6,JSON['stringify'](_0x3bdca6));_0x44731c(_0x3bdca6);})[_0x6790('0x1e')](function(_0xacc4fa){logger['error'](_0x6790('0x1c'),_0xacc4fa[_0x6790('0x12')],_0x31b8d6);_0x105588(_0x50b940[_0x6790('0x11')](0x1f4,_0xacc4fa[_0x6790('0x12')]));});});};
\ No newline at end of file
index dc53429..54ff21a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2756=['describe','/:id','getMessages','download','post','create','/:id/messages','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','delete','tracked','removeTags','express','get','isAuthenticated','index'];(function(_0x4acf48,_0x36192d){var _0x102e65=function(_0x1c4d2c){while(--_0x1c4d2c){_0x4acf48['push'](_0x4acf48['shift']());}};_0x102e65(++_0x36192d);}(_0x2756,0xa4));var _0x6275=function(_0x4f5108,_0x46a54b){_0x4f5108=_0x4f5108-0x0;var _0x2d56ca=_0x2756[_0x4f5108];return _0x2d56ca;};'use strict';var express=require(_0x6275('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require('./mailInteraction.controller');router[_0x6275('0x1')]('/',auth[_0x6275('0x2')](),controller[_0x6275('0x3')]);router[_0x6275('0x1')]('/describe',auth[_0x6275('0x2')](),controller[_0x6275('0x4')]);router[_0x6275('0x1')](_0x6275('0x5'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/messages',auth[_0x6275('0x2')](),controller[_0x6275('0x6')]);router[_0x6275('0x1')]('/:id/download',auth['isAuthenticated'](),controller[_0x6275('0x7')]);router[_0x6275('0x8')]('/',auth['isAuthenticated'](),controller[_0x6275('0x9')]);router[_0x6275('0x8')](_0x6275('0xa'),auth['isAuthenticated'](),controller[_0x6275('0xb')]);router[_0x6275('0x8')](_0x6275('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0x6275('0xd'),_0x6275('0xe')),controller[_0x6275('0xf')]);router[_0x6275('0x10')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x6275('0xd'),_0x6275('0x11')),controller['update']);router[_0x6275('0x12')]('/:id',auth[_0x6275('0x2')](),interaction[_0x6275('0x13')]('mail','mailinteraction:destroy'),controller['destroy']);router[_0x6275('0x12')](_0x6275('0xc'),auth['isAuthenticated'](),controller[_0x6275('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xcc9b=['mailinteraction:destroy','destroy','/:id/tags','removeTags','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','getMessages','download','post','/:id/messages','tracked','mailinteraction:addtags','put','mailinteraction:update','update','delete'];(function(_0x4deb1e,_0x428128){var _0x2a70d8=function(_0x42abcc){while(--_0x42abcc){_0x4deb1e['push'](_0x4deb1e['shift']());}};_0x2a70d8(++_0x428128);}(_0xcc9b,0x68));var _0xbcc9=function(_0x258e93,_0x44975d){_0x258e93=_0x258e93-0x0;var _0x231ab3=_0xcc9b[_0x258e93];return _0x231ab3;};'use strict';var express=require(_0xbcc9('0x0'));var router=express[_0xbcc9('0x1')]();var auth=require(_0xbcc9('0x2'));var interaction=require(_0xbcc9('0x3'));var controller=require(_0xbcc9('0x4'));router[_0xbcc9('0x5')]('/',auth[_0xbcc9('0x6')](),controller[_0xbcc9('0x7')]);router['get'](_0xbcc9('0x8'),auth['isAuthenticated'](),controller[_0xbcc9('0x9')]);router[_0xbcc9('0x5')](_0xbcc9('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xbcc9('0x5')]('/:id/messages',auth['isAuthenticated'](),controller[_0xbcc9('0xb')]);router[_0xbcc9('0x5')]('/:id/download',auth[_0xbcc9('0x6')](),controller[_0xbcc9('0xc')]);router[_0xbcc9('0xd')]('/',auth[_0xbcc9('0x6')](),controller['create']);router[_0xbcc9('0xd')](_0xbcc9('0xe'),auth['isAuthenticated'](),controller['addMessage']);router['post']('/:id/tags',auth[_0xbcc9('0x6')](),interaction[_0xbcc9('0xf')]('mail',_0xbcc9('0x10')),controller['addTags']);router[_0xbcc9('0x11')](_0xbcc9('0xa'),auth[_0xbcc9('0x6')](),interaction[_0xbcc9('0xf')]('mail',_0xbcc9('0x12')),controller[_0xbcc9('0x13')]);router[_0xbcc9('0x14')]('/:id',auth[_0xbcc9('0x6')](),interaction[_0xbcc9('0xf')]('mail',_0xbcc9('0x15')),controller[_0xbcc9('0x16')]);router[_0xbcc9('0x14')](_0xbcc9('0x17'),auth[_0xbcc9('0x6')](),controller[_0xbcc9('0x18')]);module['exports']=router;
\ No newline at end of file
index b9c98b3..e6baa0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8eb=['BOOLEAN','sequelize','exports','DATE','STRING','TEXT','out','ENUM'];(function(_0x427217,_0x4039b1){var _0x5b28fb=function(_0x3eaa08){while(--_0x3eaa08){_0x427217['push'](_0x427217['shift']());}};_0x5b28fb(++_0x4039b1);}(_0xa8eb,0x179));var _0xba8e=function(_0x160f07,_0x4ed237){_0x160f07=_0x160f07-0x0;var _0x4e9e71=_0xa8eb[_0x160f07];return _0x4e9e71;};'use strict';var Sequelize=require(_0xba8e('0x0'));var iconv=require('iconv');module[_0xba8e('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xba8e('0x2')]},'disposition':{'type':Sequelize[_0xba8e('0x3')]},'secondDisposition':{'type':Sequelize[_0xba8e('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xba8e('0x3')]},'inReplyTo':{'type':Sequelize[_0xba8e('0x3')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xba8e('0x4')]('long')},'subject':{'type':Sequelize[_0xba8e('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xba8e('0x2')]},'substatus':{'type':Sequelize[_0xba8e('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xba8e('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xba8e('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xba8e('0x6')]('in',_0xba8e('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xba8e('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0x9e92=['BOOLEAN','DATE','STRING','long','TEXT','out','exports'];(function(_0x13788d,_0x29a5e9){var _0x127576=function(_0x428abd){while(--_0x428abd){_0x13788d['push'](_0x13788d['shift']());}};_0x127576(++_0x29a5e9);}(_0x9e92,0xb5));var _0x29e9=function(_0x5cb0a5,_0x4e789e){_0x5cb0a5=_0x5cb0a5-0x0;var _0x4cc0da=_0x9e92[_0x5cb0a5];return _0x4cc0da;};'use strict';var Sequelize=require('sequelize');var iconv=require('iconv');module[_0x29e9('0x0')]={'closed':{'type':Sequelize[_0x29e9('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x29e9('0x2')]},'disposition':{'type':Sequelize[_0x29e9('0x3')]},'secondDisposition':{'type':Sequelize[_0x29e9('0x3')]},'thirdDisposition':{'type':Sequelize[_0x29e9('0x3')]},'note':{'type':Sequelize[_0x29e9('0x3')]},'inReplyTo':{'type':Sequelize[_0x29e9('0x3')](0x1fe)},'to':{'type':Sequelize[_0x29e9('0x3')]},'cc':{'type':Sequelize['TEXT'](_0x29e9('0x4'))},'subject':{'type':Sequelize[_0x29e9('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x29e9('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x29e9('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x29e9('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x29e9('0x1')],'defaultValue':![]}};
\ No newline at end of file
index 0ed5871..4427b81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6132=['SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','i.MailAccountId\x20IS\x20NOT\x20NULL','user','agent','getMailAccounts','role','toString','sequelize','merge','fields','a.key','contactName','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.substatus','i.ContactId','i.UserId','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','all','show','params','includeAll','options','create','body','destroy','describe','addMessage','ids','omit','getMessages','sort','pick','MailInteractionId','$gte','include','true','addTags','findAll','emit','mailInteractionTags:save','removeTags','join','server','files','attachments','format','transcript-%d-%s.zip','Attachment','Messages','bcc','get','mkdirSync','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','readFileSync','build','writeFileSync','message%d.eml','eml-format','rimraf','zip-dir','moment','util','path','lodash','squel','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','defaults','redis','localhost','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','push','MailMessage','findOne','out','plainBody','-id','trimStart','catch','waiting','unmanaged','UserId','talking','closed','total','index','MailInteraction','rawAttributes','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','where','select','field','color','u.id','ui.MailInteractionId','user_has_mail_interactions','users','u.id\x20=\x20ui.UserId','from','left_join','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','tools_tags','expr','search','parseSearch','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','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','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','some','compact','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','QueryTypes','SELECT','clone'];(function(_0x38a8f6,_0xd5cc55){var _0x5bedc6=function(_0x4e6970){while(--_0x4e6970){_0x38a8f6['push'](_0x38a8f6['shift']());}};_0x5bedc6(++_0xd5cc55);}(_0x6132,0x13a));var _0x2613=function(_0x53aa49,_0x472ca5){_0x53aa49=_0x53aa49-0x0;var _0x3a08ee=_0x6132[_0x53aa49];return _0x3a08ee;};'use strict';var emlformat=require(_0x2613('0x0'));var rimraf=require(_0x2613('0x1'));var zipdir=require(_0x2613('0x2'));var moment=require(_0x2613('0x3'));var BPromise=require('bluebird');var util=require(_0x2613('0x4'));var path=require(_0x2613('0x5'));var fs=require('fs');var _=require(_0x2613('0x6'));var squel=require(_0x2613('0x7'));var juice=require('juice');var Redis=require(_0x2613('0x8'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0x2613('0x9'))(_0x2613('0xa'));var config=require(_0x2613('0xb'));var db=require(_0x2613('0xc'))['db'];var htmlEntities=require(_0x2613('0xd'));config['redis']=_[_0x2613('0xe')](config[_0x2613('0xf')],{'host':_0x2613('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2613('0xf')]));require(_0x2613('0x11'))[_0x2613('0x12')](socket);function respondWithStatusCode(_0x37fe48,_0x1eb641){_0x1eb641=_0x1eb641||0xcc;return function(_0x1d7d9d){if(_0x1d7d9d){return _0x37fe48[_0x2613('0x13')](_0x1eb641);}return _0x37fe48[_0x2613('0x14')](_0x1eb641)[_0x2613('0x15')]();};}function respondWithResult(_0x5d100a,_0x55338b){_0x55338b=_0x55338b||0xc8;return function(_0x2b7906){if(_0x2b7906){return _0x5d100a[_0x2613('0x14')](_0x55338b)[_0x2613('0x16')](_0x2b7906);}};}function respondWithFilteredResult(_0x34cbc4,_0x5e7fef){return function(_0x39d9ce){if(_0x39d9ce){var _0x197ac8=typeof _0x5e7fef[_0x2613('0x17')]===_0x2613('0x18')&&typeof _0x5e7fef['limit']===_0x2613('0x18');var _0x431b97=_0x39d9ce[_0x2613('0x19')];var _0x3e3620=_0x197ac8?0x0:_0x5e7fef['offset'];var _0x35dd88=_0x197ac8?_0x39d9ce[_0x2613('0x19')]:_0x5e7fef['offset']+_0x5e7fef[_0x2613('0x1a')];var _0x226197;if(_0x35dd88>=_0x431b97){_0x35dd88=_0x431b97;_0x226197=0xc8;}else{_0x226197=0xce;}_0x34cbc4[_0x2613('0x14')](_0x226197);return _0x34cbc4[_0x2613('0x1b')](_0x2613('0x1c'),_0x3e3620+'-'+_0x35dd88+'/'+_0x431b97)['json'](_0x39d9ce);}return null;};}function saveUpdates(_0x349c5c){return function(_0x20877a){if(_0x20877a){return _0x20877a['update'](_0x349c5c)[_0x2613('0x1d')](function(_0x2b5242){return _0x2b5242;});}return null;};}function removeEntity(_0x2328e6){return function(_0x8256f7){if(_0x8256f7){return _0x8256f7['destroy']()[_0x2613('0x1d')](function(){_0x2328e6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fe5da){return function(_0x51a67d){if(!_0x51a67d){_0x1fe5da[_0x2613('0x13')](0x194);}return _0x51a67d;};}function handleError(_0x764f7b,_0x41a764){_0x41a764=_0x41a764||0x1f4;return function(_0x5b3893){logger['error'](_0x5b3893[_0x2613('0x1e')]);if(_0x5b3893[_0x2613('0x1f')]){delete _0x5b3893['name'];}_0x764f7b[_0x2613('0x14')](_0x41a764)[_0x2613('0x20')](_0x5b3893);};}function getInteractionUsers(_0x325e98,_0x434c08){return new BPromise(function(_0x28e206,_0x115f6f){try{if(_0x434c08[_0x325e98['id']]){_0x325e98[_0x2613('0x21')]=_[_0x2613('0x22')](_0x434c08[_0x325e98['id']],function(_0x52898d){return{'id':_0x52898d['id'],'fullname':_0x52898d[_0x2613('0x23')]};});}}catch(_0x11419f){_0x115f6f(_0x11419f);}_0x28e206(_0x325e98);});}function getInteractionTags(_0x19fb11,_0x21235f){return new BPromise(function(_0xf81db,_0x329e65){try{if(_0x19fb11[_0x2613('0x24')]){_0x19fb11[_0x2613('0x25')]=[];_0x19fb11[_0x2613('0x24')]['split'](',')[_0x2613('0x26')](function(_0x34860e){_0x19fb11[_0x2613('0x25')][_0x2613('0x27')](_0x21235f[_0x34860e]);});}delete _0x19fb11[_0x2613('0x24')];}catch(_0x9175c8){_0x329e65(_0x9175c8);}_0xf81db(_0x19fb11);});}function getLastMessageText(_0x3fbf0d){return new BPromise(function(_0x2ee0ac,_0x5b0c2f){return db[_0x2613('0x28')][_0x2613('0x29')]({'where':{'$and':[{'MailInteractionId':_0x3fbf0d['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x2613('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x2613('0x2b')],'order':_0x2613('0x2c'),'raw':!![]})[_0x2613('0x1d')](function(_0x4d5888){if(_0x4d5888&&_0x4d5888[_0x2613('0x2b')]){_0x3fbf0d['lastMsgText']=_[_0x2613('0x2d')](_0x4d5888['plainBody']);}_0x2ee0ac(_0x3fbf0d);})[_0x2613('0x2e')](function(_0x59369a){_0x5b0c2f(_0x59369a);});});}function updateMailInteraction(_0x4412a2,_0xb136df,_0xd11cae,_0x2de59e){return new BPromise(function(_0x141815,_0x51a5b8){return getInteractionUsers(_0x4412a2,_0xd11cae)[_0x2613('0x1d')](function(_0xb25315){return getInteractionTags(_0xb25315,_0xb136df);})[_0x2613('0x1d')](function(_0x527927){return getStateInteraction(_0x527927);})['then'](function(_0xa6cab2){if(_0x2de59e){_0x141815(getLastMessageText(_0xa6cab2));}else{_0x141815(_0xa6cab2);}})[_0x2613('0x2e')](function(_0x145a46){_0x51a5b8(_0x145a46);});});}function getStateInteraction(_0x328931){return new BPromise(function(_0x2e9b07){_0x328931[_0x2613('0x2f')]=0x0;_0x328931['talking']=0x0;_0x328931['answered']=0x0;_0x328931[_0x2613('0x30')]=0x0;_0x328931['total']=0x0;if(!_0x328931['closed']&&!_0x328931[_0x2613('0x31')]){_0x328931[_0x2613('0x2f')]+=0x1;}if(!_0x328931['closed']&&_0x328931[_0x2613('0x31')]){_0x328931['talking']+=0x1;if(_0x328931[_0x2613('0x2f')]){_0x328931[_0x2613('0x2f')]-=0x1;}}if(_0x328931['closed']&&_0x328931['UserId']){_0x328931['answered']+=0x1;if(_0x328931[_0x2613('0x32')]){_0x328931[_0x2613('0x32')]-=0x1;}}if(_0x328931[_0x2613('0x33')]&&!_0x328931['UserId']){_0x328931[_0x2613('0x30')]+=0x1;if(_0x328931[_0x2613('0x2f')]){_0x328931[_0x2613('0x2f')]-=0x1;}}_0x328931[_0x2613('0x34')]+=0x1;_0x2e9b07(_0x328931);});}exports[_0x2613('0x35')]=function(_0x5eccd6,_0x5b383e){var _0x34846b={},_0x3f49d3={},_0x46126d={'count':0x0,'rows':[]};var _0x4f6b7f=_['map'](db[_0x2613('0x36')][_0x2613('0x37')],function(_0x1d7a70){return{'name':_0x1d7a70['fieldName'],'type':_0x1d7a70['type']['key']};});_0x3f49d3[_0x2613('0x38')]=_[_0x2613('0x22')](_0x4f6b7f,_0x2613('0x1f'));_0x3f49d3[_0x2613('0x39')]=_[_0x2613('0x3a')](_0x5eccd6[_0x2613('0x39')]);_0x3f49d3[_0x2613('0x3b')]=_[_0x2613('0x3c')](_0x3f49d3[_0x2613('0x38')],_0x3f49d3[_0x2613('0x39')]);_0x34846b[_0x2613('0x3d')]=_[_0x2613('0x3c')](_0x3f49d3[_0x2613('0x38')],qs['fields'](_0x5eccd6[_0x2613('0x39')]['fields']));_0x34846b[_0x2613('0x3d')]=_0x34846b[_0x2613('0x3d')][_0x2613('0x3e')]?_0x34846b['attributes']:_0x3f49d3['model'];if(!_0x5eccd6[_0x2613('0x39')][_0x2613('0x3f')](_0x2613('0x40'))){_0x34846b[_0x2613('0x1a')]=qs[_0x2613('0x1a')](_0x5eccd6['query']['limit']);_0x34846b['offset']=qs[_0x2613('0x17')](_0x5eccd6[_0x2613('0x39')][_0x2613('0x17')]);}_0x34846b[_0x2613('0x41')]=qs['sort'](_0x5eccd6[_0x2613('0x39')]['sort']);_0x34846b[_0x2613('0x42')]=qs['filters'](_['pick'](_0x5eccd6[_0x2613('0x39')],_0x3f49d3[_0x2613('0x3b')]),_0x4f6b7f);var _0xfa7b4b=[];var _0x349c2c=squel[_0x2613('0x43')]()[_0x2613('0x44')]('id')[_0x2613('0x44')](_0x2613('0x1f'))['field'](_0x2613('0x45'))['from']('tools_tags');var _0x1b0069=squel[_0x2613('0x43')]()['field'](_0x2613('0x46'))[_0x2613('0x44')]('u.fullname')[_0x2613('0x44')](_0x2613('0x47'))['from'](_0x2613('0x48'),'ui')['left_join'](_0x2613('0x49'),'u',_0x2613('0x4a'));var _0x2481da=squel['select']()[_0x2613('0x4b')]('mail_interactions','i')[_0x2613('0x4c')]('cm_contacts','c',_0x2613('0x4d'))[_0x2613('0x4c')]('users','o',_0x2613('0x4e'))[_0x2613('0x4c')](_0x2613('0x4f'),'a',_0x2613('0x50'))[_0x2613('0x4c')](_0x2613('0x51'),'me','me.MailInteractionId\x20=\x20i.id')[_0x2613('0x4c')](_0x2613('0x52'),'it',_0x2613('0x53'))[_0x2613('0x4c')](_0x2613('0x54'),'t','t.id\x20=\x20it.TagId');var _0x40fcd3=squel[_0x2613('0x55')]();var _0x1cb3a3=[];var _0x3a12b2=squel['expr']();var _0x3c3d1c;if(_0x5eccd6['query'][_0x2613('0x56')]){_0x3c3d1c=as[_0x2613('0x57')](_0x5eccd6[_0x2613('0x39')]['search']);var _0x451d90=_0x3c3d1c['sqlOperator'];for(var _0x590592=0x0;_0x590592<_0x3c3d1c['conditions'][_0x2613('0x3e')];_0x590592++){var _0x5f3b2e=_0x3c3d1c['conditions'][_0x590592];var _0x54a11e='i';var _0x7c7c1d=_[_0x2613('0x58')](_0x4f6b7f,[_0x2613('0x1f'),_0x5f3b2e[_0x2613('0x44')]]);if(!_0x7c7c1d){switch(_0x5f3b2e[_0x2613('0x44')]){case _0x2613('0x59'):if(_0x5f3b2e['value']==0x1){_0x2481da[_0x2613('0x5a')]('`'+_0x5f3b2e[_0x2613('0x44')]+_0x2613('0x5b'));}else{_0x2481da[_0x2613('0x5a')]('`'+_0x5f3b2e[_0x2613('0x44')]+_0x2613('0x5c'));}break;case _0x2613('0x5d'):if(_0x5f3b2e[_0x2613('0x5e')]==='$substring'){if(_0x5f3b2e[_0x2613('0x5f')][_0x2613('0x60')]('\x20')[_0x2613('0x3e')]>0x1){_0x40fcd3[_0x451d90](_0x2613('0x61'),qs[_0x2613('0x62')](_0x5f3b2e[_0x2613('0x5f')]),null);}else{var _0x28e9ce='%'+_0x5f3b2e['value']+'%';_0x40fcd3[_0x451d90](_0x2613('0x63'),_0x28e9ce,_0x28e9ce,_0x28e9ce);}}else{_0x7c7c1d=_[_0x2613('0x58')](_0x4f6b7f,['name',_0x2613('0x64')]);_0x5f3b2e['field']=_0x2613('0x64');_0x31081a=as[_0x2613('0x65')](_0x54a11e,_0x7c7c1d[_0x2613('0x66')],_0x5f3b2e);_0x40fcd3[_0x451d90](_0x31081a['text'],_0x31081a[_0x2613('0x5f')][_0x2613('0x67')],_0x31081a[_0x2613('0x5f')][_0x2613('0x15')]);}break;case _0x2613('0x68'):var _0x31e436=_0x5f3b2e['value'][_0x2613('0x60')](',')[_0x2613('0x22')](function(_0xaa6c44){return Number(_0xaa6c44);});_0x31e436[_0x2613('0x26')](function(_0x1ebc6c){_0x3a12b2['or'](_0x2613('0x69'),'%,'+_0x1ebc6c+',%');});_0x1cb3a3=_[_0x2613('0x6a')](_0x1cb3a3,_0x31e436);break;case _0x2613('0x6b'):if(_0x5f3b2e[_0x2613('0x5e')]===_0x2613('0x6c')){_0x40fcd3[_0x451d90](_0x2613('0x6d'),'%'+_0x5f3b2e['value']+'%',null);}else{_0x7c7c1d=_['find'](_0x4f6b7f,[_0x2613('0x1f'),'UserId']);_0x5f3b2e['field']='UserId';_0x31081a=as[_0x2613('0x65')](_0x54a11e,_0x7c7c1d[_0x2613('0x66')],_0x5f3b2e);_0x40fcd3[_0x451d90](_0x31081a[_0x2613('0x6e')],_0x31081a[_0x2613('0x5f')][_0x2613('0x67')],_0x31081a[_0x2613('0x5f')]['end']);}break;case _0x2613('0x2b'):_0x31081a=as[_0x2613('0x65')]('me',null,_0x5f3b2e);_0x40fcd3[_0x451d90](_0x31081a['text'],_0x31081a[_0x2613('0x5f')]['start'],_0x31081a[_0x2613('0x5f')]['end']);break;}}else{var _0x31081a=as[_0x2613('0x65')](_0x54a11e,_0x7c7c1d[_0x2613('0x66')],_0x5f3b2e);_0x40fcd3[_0x451d90](_0x31081a[_0x2613('0x6e')],_0x31081a[_0x2613('0x5f')][_0x2613('0x67')],_0x31081a[_0x2613('0x5f')][_0x2613('0x15')]);}}}else{var _0x1a4555=_(_0x5eccd6[_0x2613('0x39')])[_0x2613('0x3a')]()[_0x2613('0x22')](function(_0x2e84cb){return _[_0x2613('0x6f')](_0x4f6b7f,['name',_0x2e84cb])?_0x2e84cb:undefined;})[_0x2613('0x70')]()['value']();if(!_['isEmpty'](_0x1a4555)){_0x1a4555[_0x2613('0x26')](function(_0x231afa){if(_0x231afa===_0x2613('0x71')){_0x2481da[_0x2613('0x42')](_0x2613('0x72'),[][_0x2613('0x73')](_0x5eccd6[_0x2613('0x39')][_0x231afa]));}else if(_0x231afa===_0x2613('0x74')){var _0x15f51a=JSON[_0x2613('0x75')](_0x5eccd6[_0x2613('0x39')][_0x231afa])['$gte'];var _0x1fbd5e=JSON[_0x2613('0x75')](_0x5eccd6['query'][_0x231afa])[_0x2613('0x76')];_0x2481da[_0x2613('0x42')](_0x2613('0x77'),_0x15f51a,_0x1fbd5e);}else{if(_0x5eccd6['query'][_0x231afa]===_0x2613('0x78')){_0x2481da[_0x2613('0x42')]('i.'+_0x231afa+_0x2613('0x79'));}else{_0x2481da[_0x2613('0x42')]('i.'+_0x231afa+_0x2613('0x7a'),_0x5eccd6[_0x2613('0x39')][_0x231afa]);}}});}if(_0x5eccd6['query'][_0x2613('0x7b')]){if(_0x5eccd6['query'][_0x2613('0x7b')]==0x1){_0x2481da[_0x2613('0x5a')](_0x2613('0x7c'));}else{_0x2481da['having'](_0x2613('0x7d'));}}if(_0x5eccd6[_0x2613('0x39')][_0x2613('0x7e')]){_0x1cb3a3=_[_0x2613('0x7f')](_0x5eccd6['query']['tag'])?_0x5eccd6[_0x2613('0x39')][_0x2613('0x7e')]:new Array(_0x5eccd6[_0x2613('0x39')][_0x2613('0x7e')]);_0x1cb3a3['forEach'](function(_0x10f92f){_0x3a12b2['or'](_0x2613('0x69'),'%,'+_0x10f92f+',%');});}if(_0x5eccd6[_0x2613('0x39')]['filter']){var _0x926518=_0x5eccd6[_0x2613('0x39')][_0x2613('0x80')][_0x2613('0x81')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x2613('0x82')](_0x926518)){_0x40fcd3['or']('i.id\x20LIKE\x20?',_0x926518+'%');}else if(qs['isEmail'](_0x926518)){_0x40fcd3['or'](_0x2613('0x83'),_0x926518+'%');}else{_0x40fcd3['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2613('0x62')](_0x926518))['or'](_0x2613('0x84'),qs[_0x2613('0x62')](_0x926518));}}}_0x2481da[_0x2613('0x42')](_0x40fcd3);_0x2481da['group'](_0x2613('0x85'));var _0x400459={'type':db[_0x2613('0x86')][_0x2613('0x87')][_0x2613('0x88')],'raw':!![]};var _0x21b878=_0x2481da[_0x2613('0x89')]();_0x21b878[_0x2613('0x44')](_0x2613('0x85'));_0x21b878[_0x2613('0x44')](_0x2613('0x8a'),'unreadMessages');if(_0x34846b[_0x2613('0x41')]){_0x34846b[_0x2613('0x41')][_0x2613('0x26')](function(_0x5888a1){var _0x36e0e6=_0x5888a1[0x0]==='contactName'?_0x5888a1[0x0]:'i.'+_0x5888a1[0x0];_0x2481da['order'](_0x36e0e6,_0x5888a1[0x1]===_0x2613('0x8b')?![]:!![]);});}if(!_[_0x2613('0x8c')](_0x1cb3a3)){_0x2481da[_0x2613('0x5a')](_0x3a12b2);_0x21b878['where'](_0x2613('0x8d'),_0x1cb3a3);}BPromise['resolve']()[_0x2613('0x1d')](function(){if(!_0x3c3d1c){if(_0x5eccd6['query']['MailAccountId'])return;_0x21b878[_0x2613('0x42')](_0x2613('0x8e'));_0x2481da['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x5eccd6[_0x2613('0x8f')]['role']!==_0x2613('0x90'))return;return _0x5eccd6['user'][_0x2613('0x91')]({'attributes':['id'],'raw':!![]})[_0x2613('0x1d')](function(_0x4856f4){if(_[_0x2613('0x8c')](_0x4856f4)){_0x21b878[_0x2613('0x42')]('i.MailAccountId\x20IS\x20NULL');_0x2481da[_0x2613('0x42')]('i.MailAccountId\x20IS\x20NULL');}else{_0x21b878[_0x2613('0x42')](_0x2613('0x72'),_['map'](_0x4856f4,'id'));_0x2481da['where'](_0x2613('0x72'),_[_0x2613('0x22')](_0x4856f4,'id'));}});})[_0x2613('0x1d')](function(){if(_0x5eccd6['user'][_0x2613('0x92')]===_0x2613('0x90')&&!_0x3c3d1c&&!_0x5eccd6['query'][_0x2613('0x71')])return[];return db['sequelize'][_0x2613('0x39')](_0x21b878[_0x2613('0x93')](),_0x400459);})[_0x2613('0x1d')](function(_0x344a0c){_0x46126d[_0x2613('0x19')]=_0x344a0c[_0x2613('0x3e')];if(_0x46126d[_0x2613('0x19')]===0x0)return[];return db[_0x2613('0x94')][_0x2613('0x39')](_0x349c2c[_0x2613('0x93')](),_0x400459)['then'](function(_0x28d9c8){_0xfa7b4b=_['keyBy'](_0x28d9c8,'id');_0x400459=_[_0x2613('0x95')](_0x400459,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5eccd6[_0x2613('0x39')][_0x2613('0x96')]){_0x34846b['attributes']['forEach'](function(_0x58d6d6){_0x2481da[_0x2613('0x44')]('i.'+_0x58d6d6);});}else{_0x2481da['field'](_0x2613('0x8a'),_0x2613('0x59'));_0x2481da[_0x2613('0x44')](_0x2613('0x97'),'Account.key');_0x2481da[_0x2613('0x44')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x2481da[_0x2613('0x44')]('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',_0x2613('0x98'));_0x2481da[_0x2613('0x44')](_0x2613('0x85'));_0x2481da[_0x2613('0x44')](_0x2613('0x99'));_0x2481da[_0x2613('0x44')](_0x2613('0x9a'));_0x2481da['field'](_0x2613('0x9b'));_0x2481da[_0x2613('0x44')](_0x2613('0x9c'));_0x2481da[_0x2613('0x44')](_0x2613('0x9d'));_0x2481da['field'](_0x2613('0x9e'));_0x2481da['field'](_0x2613('0x9f'));_0x2481da[_0x2613('0x44')](_0x2613('0xa0'));_0x2481da[_0x2613('0x44')](_0x2613('0xa1'));_0x2481da['field'](_0x2613('0xa2'));_0x2481da[_0x2613('0x44')]('i.thirdDisposition');_0x2481da[_0x2613('0x44')](_0x2613('0xa3'));_0x2481da[_0x2613('0x44')]('i.to');_0x2481da[_0x2613('0x44')](_0x2613('0xa4'));_0x2481da['field']('i.MailAccountId');_0x2481da[_0x2613('0x44')](_0x2613('0xa5'));_0x2481da['field']('c.firstName','Contact.firstName');_0x2481da['field']('c.lastName',_0x2613('0xa6'));_0x2481da[_0x2613('0x44')](_0x2613('0xa7'),_0x2613('0xa8'));_0x2481da[_0x2613('0x44')](_0x2613('0xa9'),_0x2613('0xaa'));_0x2481da[_0x2613('0x44')](_0x2613('0xab'),'Contact.mobile');_0x2481da[_0x2613('0x44')]('c.fax',_0x2613('0xac'));_0x2481da[_0x2613('0x44')](_0x2613('0xad'),_0x2613('0xae'));_0x2481da[_0x2613('0x44')](_0x2613('0xaf'),'Owner.internal');_0x2481da['field'](_0x2613('0xb0'),_0x2613('0x24'));}if(_0x34846b['limit'])_0x2481da[_0x2613('0x1a')](_0x34846b[_0x2613('0x1a')]);if(_0x34846b[_0x2613('0x17')])_0x2481da[_0x2613('0x17')](_0x34846b[_0x2613('0x17')]);return db[_0x2613('0x94')][_0x2613('0x39')](_0x2481da[_0x2613('0x93')](),_0x400459);})[_0x2613('0x1d')](function(_0x4ba81d){if(_0x4ba81d[_0x2613('0x3e')]>0x0)_0x1b0069[_0x2613('0x42')](_0x2613('0xb1'),_[_0x2613('0x22')](_0x4ba81d,'id'));return db[_0x2613('0x94')]['query'](_0x1b0069[_0x2613('0x93')](),_0x400459)['then'](function(_0x840565){var _0x554d0f=_[_0x2613('0xb2')](_0x840565,'MailInteractionId');var _0x591489=[];return db[_0x2613('0xb3')][_0x2613('0x29')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x2613('0x1d')](function(_0x5e4842){var _0x1e5f38=_0x5e4842[_0x2613('0xb4')];_0x4ba81d[_0x2613('0x26')](function(_0x1f9415){_0x591489[_0x2613('0x27')](updateMailInteraction(_0x1f9415,_0xfa7b4b,_0x554d0f,_0x1e5f38));});return BPromise[_0x2613('0xb5')](_0x591489);});});});})['then'](function(_0x5ef63c){_0x46126d['rows']=_0x5ef63c;return _0x46126d;})[_0x2613('0x1d')](respondWithFilteredResult(_0x5b383e,_0x34846b))[_0x2613('0x2e')](handleError(_0x5b383e,null));};exports[_0x2613('0xb6')]=function(_0x28ece3,_0x3d2fc5){var _0x1ad6a2={'raw':![],'where':{'id':_0x28ece3[_0x2613('0xb7')]['id']}},_0x5115d0={};_0x5115d0[_0x2613('0x38')]=_[_0x2613('0x3a')](db[_0x2613('0x36')]['rawAttributes']);_0x5115d0[_0x2613('0x39')]=_[_0x2613('0x3a')](_0x28ece3[_0x2613('0x39')]);_0x5115d0[_0x2613('0x3b')]=_[_0x2613('0x3c')](_0x5115d0[_0x2613('0x38')],_0x5115d0[_0x2613('0x39')]);_0x1ad6a2[_0x2613('0x3d')]=_[_0x2613('0x3c')](_0x5115d0[_0x2613('0x38')],qs[_0x2613('0x96')](_0x28ece3['query'][_0x2613('0x96')]));_0x1ad6a2[_0x2613('0x3d')]=_0x1ad6a2['attributes'][_0x2613('0x3e')]?_0x1ad6a2[_0x2613('0x3d')]:_0x5115d0[_0x2613('0x38')];if(_0x28ece3[_0x2613('0x39')][_0x2613('0xb8')]){_0x1ad6a2['include']=[{'all':!![]}];}_0x1ad6a2=_['merge']({},_0x1ad6a2,_0x28ece3[_0x2613('0xb9')]);return db['MailInteraction'][_0x2613('0x58')](_0x1ad6a2)[_0x2613('0x1d')](handleEntityNotFound(_0x3d2fc5,null))[_0x2613('0x1d')](respondWithResult(_0x3d2fc5,null))[_0x2613('0x2e')](handleError(_0x3d2fc5,null));};exports[_0x2613('0xba')]=function(_0x2569eb,_0x196ffe){return db[_0x2613('0x36')]['create'](_0x2569eb['body'],{})[_0x2613('0x1d')](respondWithResult(_0x196ffe,0xc9))['catch'](handleError(_0x196ffe,null));};exports['update']=function(_0x26855b,_0x1cff51){if(_0x26855b[_0x2613('0xbb')]['id']){delete _0x26855b[_0x2613('0xbb')]['id'];}return db[_0x2613('0x36')][_0x2613('0x58')]({'where':{'id':_0x26855b[_0x2613('0xb7')]['id']}})[_0x2613('0x1d')](handleEntityNotFound(_0x1cff51,null))['then'](saveUpdates(_0x26855b['body'],null))[_0x2613('0x1d')](respondWithResult(_0x1cff51,null))[_0x2613('0x2e')](handleError(_0x1cff51,null));};exports[_0x2613('0xbc')]=function(_0x3be9e6,_0x1bbdb1){return db[_0x2613('0x36')][_0x2613('0x58')]({'where':{'id':_0x3be9e6[_0x2613('0xb7')]['id']}})['then'](handleEntityNotFound(_0x1bbdb1,null))[_0x2613('0x1d')](removeEntity(_0x1bbdb1,null))[_0x2613('0x2e')](handleError(_0x1bbdb1,null));};exports['describe']=function(_0x874636,_0x5b7fa0){return db['MailInteraction'][_0x2613('0xbd')]()[_0x2613('0x1d')](respondWithResult(_0x5b7fa0,null))[_0x2613('0x2e')](handleError(_0x5b7fa0,null));};exports['addMessage']=function(_0x564b05,_0x2e40dd){return db[_0x2613('0x28')]['find']({'where':{'id':_0x564b05[_0x2613('0xb7')]['id']}})[_0x2613('0x1d')](handleEntityNotFound(_0x2e40dd,null))[_0x2613('0x1d')](function(_0x227694){if(_0x227694){return _0x227694[_0x2613('0xbe')](_0x564b05['body'][_0x2613('0xbf')],_[_0x2613('0xc0')](_0x564b05['body'],[_0x2613('0xbf'),'id'])||{});}})[_0x2613('0x1d')](respondWithResult(_0x2e40dd,null))[_0x2613('0x2e')](handleError(_0x2e40dd,null));};exports[_0x2613('0xc1')]=function(_0x317556,_0x17963d){var _0x6e8778={'raw':![],'where':{}};var _0x57a85b={};var _0x1baca1={'count':0x0,'rows':[]};return db['MailInteraction'][_0x2613('0x29')]({'where':{'id':_0x317556[_0x2613('0xb7')]['id']}})[_0x2613('0x1d')](handleEntityNotFound(_0x17963d,null))[_0x2613('0x1d')](function(_0x5ae131){if(_0x5ae131){_0x57a85b[_0x2613('0x38')]=_[_0x2613('0x3a')](db[_0x2613('0x28')][_0x2613('0x37')]);_0x57a85b[_0x2613('0x39')]=_[_0x2613('0x3a')](_0x317556[_0x2613('0x39')]);_0x57a85b[_0x2613('0x3b')]=_[_0x2613('0x3c')](_0x57a85b[_0x2613('0x38')],_0x57a85b[_0x2613('0x39')]);_0x6e8778['attributes']=_['intersection'](_0x57a85b[_0x2613('0x38')],qs[_0x2613('0x96')](_0x317556['query'][_0x2613('0x96')]));_0x6e8778['attributes']=_0x6e8778[_0x2613('0x3d')][_0x2613('0x3e')]?_0x6e8778['attributes']:_0x57a85b[_0x2613('0x38')];if(!_0x317556[_0x2613('0x39')][_0x2613('0x3f')](_0x2613('0x40'))){_0x6e8778[_0x2613('0x1a')]=qs[_0x2613('0x1a')](_0x317556[_0x2613('0x39')][_0x2613('0x1a')]);_0x6e8778[_0x2613('0x17')]=qs['offset'](_0x317556[_0x2613('0x39')][_0x2613('0x17')]);}_0x6e8778['order']=qs[_0x2613('0xc2')](_0x317556['query']['sort']);_0x6e8778['where']=qs[_0x2613('0x3b')](_[_0x2613('0xc3')](_0x317556[_0x2613('0x39')],_0x57a85b['filters']));_0x6e8778[_0x2613('0x42')][_0x2613('0xc4')]=_0x5ae131['id'];if(_0x317556['query'][_0x2613('0x80')]){_0x6e8778[_0x2613('0x42')]=_['merge'](_0x6e8778[_0x2613('0x42')],{'$or':_['map'](_0x6e8778[_0x2613('0x3d')],function(_0x3ac9a4){var _0x4bdb8e={};_0x4bdb8e[_0x3ac9a4]={'$like':'%'+_0x317556['query']['filter']+'%'};return _0x4bdb8e;})});}if(_0x317556['query']['$gte']){var _0x3c6c70=_0x317556[_0x2613('0x39')][_0x2613('0xc5')]['split'](',');var _0x313d84={};_0x313d84[_0x3c6c70[0x0]]={'$gte':moment(_0x3c6c70[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x6e8778[_0x2613('0x42')]=_[_0x2613('0x95')](_0x6e8778[_0x2613('0x42')],_0x313d84);}_0x6e8778=_[_0x2613('0x95')]({},_0x6e8778,_0x317556['options']);return db[_0x2613('0x28')][_0x2613('0x19')]({'where':_0x6e8778[_0x2613('0x42')]})['then'](function(_0x1be1ac){_0x1baca1[_0x2613('0x19')]=_0x1be1ac;if(_0x317556[_0x2613('0x39')][_0x2613('0xb8')]){_0x6e8778[_0x2613('0xc6')]=[{'all':!![]}];}return db[_0x2613('0x28')]['findAll'](_0x6e8778);})[_0x2613('0x1d')](function(_0x4f334a){if(_0x317556[_0x2613('0x39')]['inlineCss']===_0x2613('0xc7')){for(var _0xea4aab=0x0;_0xea4aab<_0x4f334a[_0x2613('0x3e')];_0xea4aab++){_0x4f334a[_0xea4aab][_0x2613('0xbb')]=juice(_0x4f334a[_0xea4aab][_0x2613('0xbb')]);}}_0x1baca1['rows']=_0x4f334a;return _0x1baca1;});}})[_0x2613('0x1d')](respondWithFilteredResult(_0x17963d,_0x6e8778))['catch'](handleError(_0x17963d,null));};exports[_0x2613('0xc8')]=function(_0x3973de,_0x2d5318){return db['MailInteraction'][_0x2613('0x58')]({'where':{'id':_0x3973de['params']['id']}})[_0x2613('0x1d')](handleEntityNotFound(_0x2d5318,null))[_0x2613('0x1d')](function(_0x3bbc05){if(_0x3bbc05){return _0x3bbc05['setTags'](_0x3973de[_0x2613('0xbb')][_0x2613('0xbf')],_[_0x2613('0xc0')](_0x3973de[_0x2613('0xbb')],[_0x2613('0xbf'),'id'])||{})['spread'](function(){return db['Tag'][_0x2613('0xc9')]({'attributes':['id',_0x2613('0x1f'),_0x2613('0x45')],'where':{'id':_0x3973de['body']['ids']}});})[_0x2613('0x1d')](function(_0x156d16){socket[_0x2613('0xca')](_0x2613('0xcb'),{'id':Number(_0x3973de['params']['id']),'tags':_0x156d16||[]});return{'id':Number(_0x3973de[_0x2613('0xb7')]['id']),'tags':_0x156d16||[]};});}})['then'](respondWithResult(_0x2d5318,null))['catch'](handleError(_0x2d5318,null));};exports['removeTags']=function(_0x2b5b98,_0x1ed93e){return db[_0x2613('0x36')]['find']({'where':{'id':_0x2b5b98[_0x2613('0xb7')]['id']}})['then'](handleEntityNotFound(_0x1ed93e,null))[_0x2613('0x1d')](function(_0x4ca6cb){if(_0x4ca6cb){return _0x4ca6cb[_0x2613('0xcc')](_0x2b5b98[_0x2613('0x39')]['ids']);}})[_0x2613('0x1d')](respondWithStatusCode(_0x1ed93e,null))['catch'](handleError(_0x1ed93e,null));};exports['download']=function(_0x2a945f,_0x5695f7){var _0x2b1ee2=moment()['unix']()[_0x2613('0x93')]();var _0x32feab=path[_0x2613('0xcd')](config['root'],_0x2613('0xce'),_0x2613('0xcf'),'tmp');var _0x4a0f3d=path['join'](config['root'],'server',_0x2613('0xcf'),_0x2613('0xd0'));var _0x55375c=path[_0x2613('0xcd')](_0x32feab,_0x2b1ee2);var _0x59c6af=util[_0x2613('0xd1')](_0x2613('0xd2'),_0x2a945f[_0x2613('0xb7')]['id'],_0x2b1ee2);var _0x4858e6=path[_0x2613('0xcd')](_0x32feab,_0x59c6af);var _0x170993=[];if(_0x2a945f[_0x2613('0x39')][_0x2613('0xd0')]){_0x170993[_0x2613('0x27')]({'model':db[_0x2613('0xd3')],'as':'Attachments','raw':!![]});}var _0xfd0fed=[{'model':db[_0x2613('0x28')],'as':_0x2613('0xd4'),'attributes':['id','body',_0x2613('0x4b'),'to','cc',_0x2613('0xd5'),'subject','createdAt'],'where':{'secret':![]},'order':qs[_0x2613('0xc2')]('id'),'include':_0x170993}];return db['MailInteraction']['find']({'where':{'id':_0x2a945f[_0x2613('0xb7')]['id']},'include':_0xfd0fed})[_0x2613('0x1d')](handleEntityNotFound(_0x5695f7,null))[_0x2613('0x1d')](function(_0x477813){if(_0x477813&&_0x477813[_0x2613('0xd4')]){var _0x3dfc9c=_0x477813[_0x2613('0xd6')]({'plain':!![]});fs[_0x2613('0xd7')](_0x55375c);return BPromise['each'](_0x3dfc9c[_0x2613('0xd4')],function(_0x10cdd1,_0x5c4a01){var _0x3dc863={'from':_0x10cdd1[_0x2613('0x4b')],'to':_0x10cdd1['to'],'subject':_0x10cdd1['subject'],'html':htmlEntities[_0x2613('0xd8')](_0x10cdd1[_0x2613('0xbb')]),'headers':{'Date':moment(_0x10cdd1['createdAt'])[_0x2613('0xd1')](_0x2613('0xd9'))},'attachments':[]};if(_0x10cdd1['cc']){_0x3dc863[_0x2613('0xda')]['Cc']=_0x10cdd1['cc'];}if(_0x10cdd1[_0x2613('0xd5')]){_0x3dc863['headers'][_0x2613('0xdb')]=_0x10cdd1['bcc'];}return new BPromise(function(_0x497fe4,_0x402c31){if(_0x10cdd1[_0x2613('0xdc')]){for(var _0x11f6e0=0x0;_0x11f6e0<_0x10cdd1[_0x2613('0xdc')][_0x2613('0x3e')];_0x11f6e0++){var _0x3a37b3=_0x10cdd1[_0x2613('0xdc')][_0x11f6e0];var _0x2c8cda=path[_0x2613('0xcd')](_0x4a0f3d,_0x3a37b3['basename']);if(fs[_0x2613('0xdd')](_0x2c8cda)){_0x3dc863['attachments'][_0x2613('0x27')]({'name':_0x3a37b3['name'],'contentType':_0x3a37b3['type'],'data':fs[_0x2613('0xde')](_0x2c8cda)});}}}emlformat[_0x2613('0xdf')](_0x3dc863,function(_0xd85dad,_0xcf04fa){if(_0xd85dad)return _0x402c31(_0xd85dad);fs[_0x2613('0xe0')](path['join'](_0x55375c,util[_0x2613('0xd1')](_0x2613('0xe1'),_0x5c4a01)),_0xcf04fa);return _0x497fe4(_0xcf04fa);});});})['then'](function(){return new BPromise(function(_0x47c88e,_0x434ac7){zipdir(_0x55375c,{'saveTo':_0x4858e6},function(_0x48f143,_0x4a3e8e){if(_0x48f143)return _0x434ac7(_0x48f143);return _0x47c88e(_0x4a3e8e);});})['then'](function(){return new BPromise(function(_0x4a432c,_0x2add4d){rimraf(_0x55375c,function(_0x3f3775){if(_0x3f3775)_0x2add4d(_0x3f3775);return _0x4a432c();});});})[_0x2613('0x1d')](function(){return _0x5695f7['download'](_0x4858e6,_0x59c6af,function(_0x17f4e0){if(!_0x17f4e0)fs['unlinkSync'](_0x4858e6);});});});}else{return _0x5695f7[_0x2613('0x13')](0xc8);}})[_0x2613('0x2e')](handleError(_0x5695f7,null));};
\ No newline at end of file
+var _0x8f9d=['me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','length','find','having','`\x20=\x200','Contact','$substring','value','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','i.MailAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','\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(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','QueryTypes','SELECT','clone','i.id','unreadMessages','order','contactName','isEmpty','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.MailAccountId\x20IS\x20NULL','sequelize','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.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.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.secondDisposition','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','Setting','enableEmailPreview','all','rows','show','params','includeAll','merge','options','create','body','update','describe','MailMessage','addMessage','ids','getMessages','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','true','addTags','setTags','spread','color','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','readFileSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','bluebird','util','path','lodash','squel','juice','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','then','destroy','end','error','name','send','Users','map','fullname','TagIds','forEach','push','findOne','plainBody','-id','lastMsgText','trimStart','catch','waiting','answered','unmanaged','total','UserId','talking','closed','index','MailInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','sort','where','pick','select','field','from','tools_tags','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages'];(function(_0x184184,_0x5dedce){var _0x4f86ae=function(_0x21e4f8){while(--_0x21e4f8){_0x184184['push'](_0x184184['shift']());}};_0x4f86ae(++_0x5dedce);}(_0x8f9d,0x93));var _0xd8f9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8f9d[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0xd8f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd8f9('0x1'));var moment=require('moment');var BPromise=require(_0xd8f9('0x2'));var util=require(_0xd8f9('0x3'));var path=require(_0xd8f9('0x4'));var fs=require('fs');var _=require(_0xd8f9('0x5'));var squel=require(_0xd8f9('0x6'));var juice=require(_0xd8f9('0x7'));var Redis=require(_0xd8f9('0x8'));var qs=require('../../components/parsers/qs');var as=require(_0xd8f9('0x9'));var logger=require(_0xd8f9('0xa'))(_0xd8f9('0xb'));var config=require(_0xd8f9('0xc'));var db=require(_0xd8f9('0xd'))['db'];var htmlEntities=require('html-entities');config[_0xd8f9('0xe')]=_[_0xd8f9('0xf')](config['redis'],{'host':_0xd8f9('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd8f9('0x11'))[_0xd8f9('0x12')](socket);function respondWithStatusCode(_0x32b880,_0x379359){_0x379359=_0x379359||0xcc;return function(_0x6a0ec2){if(_0x6a0ec2){return _0x32b880[_0xd8f9('0x13')](_0x379359);}return _0x32b880[_0xd8f9('0x14')](_0x379359)['end']();};}function respondWithResult(_0x3a214b,_0x56e0d6){_0x56e0d6=_0x56e0d6||0xc8;return function(_0x39aca0){if(_0x39aca0){return _0x3a214b[_0xd8f9('0x14')](_0x56e0d6)[_0xd8f9('0x15')](_0x39aca0);}};}function respondWithFilteredResult(_0x5b01ce,_0x46468b){return function(_0x3df6d2){if(_0x3df6d2){var _0x4cfebf=typeof _0x46468b[_0xd8f9('0x16')]==='undefined'&&typeof _0x46468b[_0xd8f9('0x17')]===_0xd8f9('0x18');var _0x234901=_0x3df6d2[_0xd8f9('0x19')];var _0x3a3a41=_0x4cfebf?0x0:_0x46468b[_0xd8f9('0x16')];var _0x566448=_0x4cfebf?_0x3df6d2['count']:_0x46468b['offset']+_0x46468b[_0xd8f9('0x17')];var _0xc6a825;if(_0x566448>=_0x234901){_0x566448=_0x234901;_0xc6a825=0xc8;}else{_0xc6a825=0xce;}_0x5b01ce['status'](_0xc6a825);return _0x5b01ce[_0xd8f9('0x1a')]('Content-Range',_0x3a3a41+'-'+_0x566448+'/'+_0x234901)[_0xd8f9('0x15')](_0x3df6d2);}return null;};}function saveUpdates(_0x49f2e7){return function(_0x4cf93a){if(_0x4cf93a){return _0x4cf93a['update'](_0x49f2e7)[_0xd8f9('0x1b')](function(_0x5d094d){return _0x5d094d;});}return null;};}function removeEntity(_0x37a252){return function(_0xef802d){if(_0xef802d){return _0xef802d[_0xd8f9('0x1c')]()[_0xd8f9('0x1b')](function(){_0x37a252[_0xd8f9('0x14')](0xcc)[_0xd8f9('0x1d')]();});}};}function handleEntityNotFound(_0x5863ad){return function(_0x1de3cc){if(!_0x1de3cc){_0x5863ad[_0xd8f9('0x13')](0x194);}return _0x1de3cc;};}function handleError(_0x164bf6,_0x36d740){_0x36d740=_0x36d740||0x1f4;return function(_0x1bf210){logger[_0xd8f9('0x1e')](_0x1bf210['stack']);if(_0x1bf210[_0xd8f9('0x1f')]){delete _0x1bf210[_0xd8f9('0x1f')];}_0x164bf6[_0xd8f9('0x14')](_0x36d740)[_0xd8f9('0x20')](_0x1bf210);};}function getInteractionUsers(_0x290553,_0x4c0002){return new BPromise(function(_0xcc9b18,_0x1d6796){try{if(_0x4c0002[_0x290553['id']]){_0x290553[_0xd8f9('0x21')]=_[_0xd8f9('0x22')](_0x4c0002[_0x290553['id']],function(_0x3e68dc){return{'id':_0x3e68dc['id'],'fullname':_0x3e68dc[_0xd8f9('0x23')]};});}}catch(_0x175123){_0x1d6796(_0x175123);}_0xcc9b18(_0x290553);});}function getInteractionTags(_0x461880,_0x4aab29){return new BPromise(function(_0x464a6a,_0x4764d9){try{if(_0x461880[_0xd8f9('0x24')]){_0x461880['Tags']=[];_0x461880['TagIds']['split'](',')[_0xd8f9('0x25')](function(_0x2c25c2){_0x461880['Tags'][_0xd8f9('0x26')](_0x4aab29[_0x2c25c2]);});}delete _0x461880[_0xd8f9('0x24')];}catch(_0x5da878){_0x4764d9(_0x5da878);}_0x464a6a(_0x461880);});}function getLastMessageText(_0x4b0de7){return new BPromise(function(_0x13fa4b,_0x2786db){return db['MailMessage'][_0xd8f9('0x27')]({'where':{'$and':[{'MailInteractionId':_0x4b0de7['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xd8f9('0x28')],'order':_0xd8f9('0x29'),'raw':!![]})['then'](function(_0x19d639){if(_0x19d639&&_0x19d639['plainBody']){_0x4b0de7[_0xd8f9('0x2a')]=_[_0xd8f9('0x2b')](_0x19d639[_0xd8f9('0x28')]);}_0x13fa4b(_0x4b0de7);})[_0xd8f9('0x2c')](function(_0x402b73){_0x2786db(_0x402b73);});});}function updateMailInteraction(_0x105f00,_0xcfd867,_0x5211c2,_0x11d865){return new BPromise(function(_0x5d285a,_0x52871a){return getInteractionUsers(_0x105f00,_0x5211c2)['then'](function(_0x57bf98){return getInteractionTags(_0x57bf98,_0xcfd867);})[_0xd8f9('0x1b')](function(_0xebc856){return getStateInteraction(_0xebc856);})[_0xd8f9('0x1b')](function(_0x1ec068){if(_0x11d865){_0x5d285a(getLastMessageText(_0x1ec068));}else{_0x5d285a(_0x1ec068);}})[_0xd8f9('0x2c')](function(_0x5b197a){_0x52871a(_0x5b197a);});});}function getStateInteraction(_0x4e7265){return new BPromise(function(_0x1d5c7d){_0x4e7265[_0xd8f9('0x2d')]=0x0;_0x4e7265['talking']=0x0;_0x4e7265[_0xd8f9('0x2e')]=0x0;_0x4e7265[_0xd8f9('0x2f')]=0x0;_0x4e7265[_0xd8f9('0x30')]=0x0;if(!_0x4e7265['closed']&&!_0x4e7265['UserId']){_0x4e7265['waiting']+=0x1;}if(!_0x4e7265['closed']&&_0x4e7265[_0xd8f9('0x31')]){_0x4e7265[_0xd8f9('0x32')]+=0x1;if(_0x4e7265[_0xd8f9('0x2d')]){_0x4e7265[_0xd8f9('0x2d')]-=0x1;}}if(_0x4e7265[_0xd8f9('0x33')]&&_0x4e7265['UserId']){_0x4e7265[_0xd8f9('0x2e')]+=0x1;if(_0x4e7265[_0xd8f9('0x32')]){_0x4e7265[_0xd8f9('0x32')]-=0x1;}}if(_0x4e7265[_0xd8f9('0x33')]&&!_0x4e7265[_0xd8f9('0x31')]){_0x4e7265[_0xd8f9('0x2f')]+=0x1;if(_0x4e7265[_0xd8f9('0x2d')]){_0x4e7265[_0xd8f9('0x2d')]-=0x1;}}_0x4e7265[_0xd8f9('0x30')]+=0x1;_0x1d5c7d(_0x4e7265);});}exports[_0xd8f9('0x34')]=function(_0x2a94d6,_0x5d16b8){var _0x310836={},_0x3cfd69={},_0x149530={'count':0x0,'rows':[]};var _0x45f13d=_['map'](db[_0xd8f9('0x35')][_0xd8f9('0x36')],function(_0x8d41c4){return{'name':_0x8d41c4[_0xd8f9('0x37')],'type':_0x8d41c4[_0xd8f9('0x38')][_0xd8f9('0x39')]};});_0x3cfd69['model']=_['map'](_0x45f13d,'name');_0x3cfd69[_0xd8f9('0x3a')]=_[_0xd8f9('0x3b')](_0x2a94d6[_0xd8f9('0x3a')]);_0x3cfd69[_0xd8f9('0x3c')]=_[_0xd8f9('0x3d')](_0x3cfd69[_0xd8f9('0x3e')],_0x3cfd69[_0xd8f9('0x3a')]);_0x310836[_0xd8f9('0x3f')]=_[_0xd8f9('0x3d')](_0x3cfd69['model'],qs['fields'](_0x2a94d6[_0xd8f9('0x3a')][_0xd8f9('0x40')]));_0x310836[_0xd8f9('0x3f')]=_0x310836['attributes']['length']?_0x310836[_0xd8f9('0x3f')]:_0x3cfd69[_0xd8f9('0x3e')];if(!_0x2a94d6[_0xd8f9('0x3a')]['hasOwnProperty'](_0xd8f9('0x41'))){_0x310836[_0xd8f9('0x17')]=qs[_0xd8f9('0x17')](_0x2a94d6[_0xd8f9('0x3a')][_0xd8f9('0x17')]);_0x310836[_0xd8f9('0x16')]=qs[_0xd8f9('0x16')](_0x2a94d6[_0xd8f9('0x3a')][_0xd8f9('0x16')]);}_0x310836['order']=qs['sort'](_0x2a94d6['query'][_0xd8f9('0x42')]);_0x310836[_0xd8f9('0x43')]=qs[_0xd8f9('0x3c')](_[_0xd8f9('0x44')](_0x2a94d6[_0xd8f9('0x3a')],_0x3cfd69[_0xd8f9('0x3c')]),_0x45f13d);var _0x1b1782=[];var _0x26b892=squel[_0xd8f9('0x45')]()[_0xd8f9('0x46')]('id')[_0xd8f9('0x46')](_0xd8f9('0x1f'))[_0xd8f9('0x46')]('color')[_0xd8f9('0x47')](_0xd8f9('0x48'));var _0x417be0=squel[_0xd8f9('0x45')]()['field'](_0xd8f9('0x49'))['field']('u.fullname')[_0xd8f9('0x46')](_0xd8f9('0x4a'))[_0xd8f9('0x47')](_0xd8f9('0x4b'),'ui')[_0xd8f9('0x4c')](_0xd8f9('0x4d'),'u',_0xd8f9('0x4e'));var _0xaad657=squel[_0xd8f9('0x45')]()[_0xd8f9('0x47')]('mail_interactions','i')['left_join']('cm_contacts','c',_0xd8f9('0x4f'))[_0xd8f9('0x4c')]('users','o',_0xd8f9('0x50'))[_0xd8f9('0x4c')](_0xd8f9('0x51'),'a',_0xd8f9('0x52'))[_0xd8f9('0x4c')](_0xd8f9('0x53'),'me',_0xd8f9('0x54'))[_0xd8f9('0x4c')]('mail_interaction_has_tags','it',_0xd8f9('0x55'))[_0xd8f9('0x4c')](_0xd8f9('0x48'),'t',_0xd8f9('0x56'));var _0xaf7e91=squel[_0xd8f9('0x57')]();var _0x51a978=[];var _0x16a2bb=squel[_0xd8f9('0x57')]();var _0xf30721;if(_0x2a94d6[_0xd8f9('0x3a')]['search']){_0xf30721=as[_0xd8f9('0x58')](_0x2a94d6[_0xd8f9('0x3a')][_0xd8f9('0x59')]);var _0x273eda=_0xf30721['sqlOperator'];for(var _0x2de50d=0x0;_0x2de50d<_0xf30721[_0xd8f9('0x5a')][_0xd8f9('0x5b')];_0x2de50d++){var _0x4dab6e=_0xf30721[_0xd8f9('0x5a')][_0x2de50d];var _0x195a46='i';var _0x2218da=_[_0xd8f9('0x5c')](_0x45f13d,['name',_0x4dab6e[_0xd8f9('0x46')]]);if(!_0x2218da){switch(_0x4dab6e[_0xd8f9('0x46')]){case'unreadMessages':if(_0x4dab6e['value']==0x1){_0xaad657[_0xd8f9('0x5d')]('`'+_0x4dab6e[_0xd8f9('0x46')]+_0xd8f9('0x5e'));}else{_0xaad657['having']('`'+_0x4dab6e[_0xd8f9('0x46')]+'`\x20>\x200');}break;case _0xd8f9('0x5f'):if(_0x4dab6e['operator']===_0xd8f9('0x60')){if(_0x4dab6e[_0xd8f9('0x61')][_0xd8f9('0x62')]('\x20')[_0xd8f9('0x5b')]>0x1){_0xaf7e91[_0x273eda]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd8f9('0x63')](_0x4dab6e[_0xd8f9('0x61')]),null);}else{var _0x10aa0a='%'+_0x4dab6e[_0xd8f9('0x61')]+'%';_0xaf7e91[_0x273eda](_0xd8f9('0x64'),_0x10aa0a,_0x10aa0a,_0x10aa0a);}}else{_0x2218da=_[_0xd8f9('0x5c')](_0x45f13d,[_0xd8f9('0x1f'),_0xd8f9('0x65')]);_0x4dab6e['field']=_0xd8f9('0x65');_0x1c2f00=as[_0xd8f9('0x66')](_0x195a46,_0x2218da[_0xd8f9('0x38')],_0x4dab6e);_0xaf7e91[_0x273eda](_0x1c2f00[_0xd8f9('0x67')],_0x1c2f00[_0xd8f9('0x61')]['start'],_0x1c2f00['value']['end']);}break;case _0xd8f9('0x68'):var _0x3fecfc=_0x4dab6e['value']['split'](',')[_0xd8f9('0x22')](function(_0xc2ef18){return Number(_0xc2ef18);});_0x3fecfc[_0xd8f9('0x25')](function(_0x90e1d6){_0x16a2bb['or'](_0xd8f9('0x69'),'%,'+_0x90e1d6+',%');});_0x51a978=_[_0xd8f9('0x6a')](_0x51a978,_0x3fecfc);break;case'User':if(_0x4dab6e[_0xd8f9('0x6b')]===_0xd8f9('0x60')){_0xaf7e91[_0x273eda](_0xd8f9('0x6c'),'%'+_0x4dab6e[_0xd8f9('0x61')]+'%',null);}else{_0x2218da=_['find'](_0x45f13d,[_0xd8f9('0x1f'),_0xd8f9('0x31')]);_0x4dab6e[_0xd8f9('0x46')]=_0xd8f9('0x31');_0x1c2f00=as[_0xd8f9('0x66')](_0x195a46,_0x2218da[_0xd8f9('0x38')],_0x4dab6e);_0xaf7e91[_0x273eda](_0x1c2f00[_0xd8f9('0x67')],_0x1c2f00[_0xd8f9('0x61')][_0xd8f9('0x6d')],_0x1c2f00['value']['end']);}break;case'plainBody':_0x1c2f00=as[_0xd8f9('0x66')]('me',null,_0x4dab6e);_0xaf7e91[_0x273eda](_0x1c2f00[_0xd8f9('0x67')],_0x1c2f00[_0xd8f9('0x61')][_0xd8f9('0x6d')],_0x1c2f00[_0xd8f9('0x61')][_0xd8f9('0x1d')]);break;}}else{var _0x1c2f00=as[_0xd8f9('0x66')](_0x195a46,_0x2218da['type'],_0x4dab6e);_0xaf7e91[_0x273eda](_0x1c2f00[_0xd8f9('0x67')],_0x1c2f00['value'][_0xd8f9('0x6d')],_0x1c2f00[_0xd8f9('0x61')][_0xd8f9('0x1d')]);}}}else{var _0x4580dc=_(_0x2a94d6[_0xd8f9('0x3a')])[_0xd8f9('0x3b')]()[_0xd8f9('0x22')](function(_0x404ae3){return _['some'](_0x45f13d,[_0xd8f9('0x1f'),_0x404ae3])?_0x404ae3:undefined;})['compact']()[_0xd8f9('0x61')]();if(!_['isEmpty'](_0x4580dc)){_0x4580dc['forEach'](function(_0x207601){if(_0x207601==='MailAccountId'){_0xaad657['where'](_0xd8f9('0x6e'),[][_0xd8f9('0x6f')](_0x2a94d6[_0xd8f9('0x3a')][_0x207601]));}else if(_0x207601===_0xd8f9('0x70')){var _0x371056=JSON['parse'](_0x2a94d6[_0xd8f9('0x3a')][_0x207601])[_0xd8f9('0x71')];var _0x58e951=JSON[_0xd8f9('0x72')](_0x2a94d6[_0xd8f9('0x3a')][_0x207601])[_0xd8f9('0x73')];_0xaad657[_0xd8f9('0x43')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x371056,_0x58e951);}else{if(_0x2a94d6[_0xd8f9('0x3a')][_0x207601]==='null'){_0xaad657[_0xd8f9('0x43')]('i.'+_0x207601+_0xd8f9('0x74'));}else{_0xaad657[_0xd8f9('0x43')]('i.'+_0x207601+_0xd8f9('0x75'),_0x2a94d6[_0xd8f9('0x3a')][_0x207601]);}}});}if(_0x2a94d6[_0xd8f9('0x3a')][_0xd8f9('0x76')]){if(_0x2a94d6[_0xd8f9('0x3a')][_0xd8f9('0x76')]==0x1){_0xaad657[_0xd8f9('0x5d')](_0xd8f9('0x77'));}else{_0xaad657[_0xd8f9('0x5d')](_0xd8f9('0x78'));}}if(_0x2a94d6[_0xd8f9('0x3a')][_0xd8f9('0x79')]){_0x51a978=_[_0xd8f9('0x7a')](_0x2a94d6[_0xd8f9('0x3a')][_0xd8f9('0x79')])?_0x2a94d6['query'][_0xd8f9('0x79')]:new Array(_0x2a94d6[_0xd8f9('0x3a')]['tag']);_0x51a978[_0xd8f9('0x25')](function(_0x381d1e){_0x16a2bb['or'](_0xd8f9('0x69'),'%,'+_0x381d1e+',%');});}if(_0x2a94d6[_0xd8f9('0x3a')][_0xd8f9('0x7b')]){var _0x5eb7e8=_0x2a94d6[_0xd8f9('0x3a')]['filter'][_0xd8f9('0x7c')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xd8f9('0x7d')](_0x5eb7e8)){_0xaf7e91['or'](_0xd8f9('0x7e'),_0x5eb7e8+'%');}else if(qs['isEmail'](_0x5eb7e8)){_0xaf7e91['or'](_0xd8f9('0x7f'),_0x5eb7e8+'%');}else{_0xaf7e91['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5eb7e8))['or'](_0xd8f9('0x80'),qs['getFullTextValue'](_0x5eb7e8));}}}_0xaad657['where'](_0xaf7e91);_0xaad657[_0xd8f9('0x81')]('i.id');var _0xebea11={'type':db['Sequelize'][_0xd8f9('0x82')][_0xd8f9('0x83')],'raw':!![]};var _0x4c2613=_0xaad657[_0xd8f9('0x84')]();_0x4c2613[_0xd8f9('0x46')](_0xd8f9('0x85'));_0x4c2613[_0xd8f9('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd8f9('0x86'));if(_0x310836[_0xd8f9('0x87')]){_0x310836[_0xd8f9('0x87')][_0xd8f9('0x25')](function(_0x1f71d4){var _0xe3c3=_0x1f71d4[0x0]===_0xd8f9('0x88')?_0x1f71d4[0x0]:'i.'+_0x1f71d4[0x0];_0xaad657[_0xd8f9('0x87')](_0xe3c3,_0x1f71d4[0x1]==='DESC'?![]:!![]);});}if(!_[_0xd8f9('0x89')](_0x51a978)){_0xaad657[_0xd8f9('0x5d')](_0x16a2bb);_0x4c2613['where']('t.id\x20IN\x20?',_0x51a978);}BPromise['resolve']()[_0xd8f9('0x1b')](function(){if(!_0xf30721){if(_0x2a94d6[_0xd8f9('0x3a')][_0xd8f9('0x8a')])return;_0x4c2613[_0xd8f9('0x43')](_0xd8f9('0x8b'));_0xaad657['where'](_0xd8f9('0x8b'));return;}if(_0x2a94d6[_0xd8f9('0x8c')][_0xd8f9('0x8d')]!==_0xd8f9('0x8e'))return;return _0x2a94d6[_0xd8f9('0x8c')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0xd8f9('0x1b')](function(_0x5cdd2b){if(_[_0xd8f9('0x89')](_0x5cdd2b)){_0x4c2613['where'](_0xd8f9('0x8f'));_0xaad657['where'](_0xd8f9('0x8f'));}else{_0x4c2613[_0xd8f9('0x43')](_0xd8f9('0x6e'),_['map'](_0x5cdd2b,'id'));_0xaad657[_0xd8f9('0x43')]('i.MailAccountId\x20IN\x20?',_[_0xd8f9('0x22')](_0x5cdd2b,'id'));}});})[_0xd8f9('0x1b')](function(){if(_0x2a94d6[_0xd8f9('0x8c')][_0xd8f9('0x8d')]===_0xd8f9('0x8e')&&!_0xf30721&&!_0x2a94d6[_0xd8f9('0x3a')]['MailAccountId'])return[];return db[_0xd8f9('0x90')][_0xd8f9('0x3a')](_0x4c2613[_0xd8f9('0x91')](),_0xebea11);})[_0xd8f9('0x1b')](function(_0x3db156){_0x149530[_0xd8f9('0x19')]=_0x3db156[_0xd8f9('0x5b')];if(_0x149530['count']===0x0)return[];return db[_0xd8f9('0x90')]['query'](_0x26b892[_0xd8f9('0x91')](),_0xebea11)[_0xd8f9('0x1b')](function(_0x41f5fb){_0x1b1782=_['keyBy'](_0x41f5fb,'id');_0xebea11=_['merge'](_0xebea11,{'model':db[_0xd8f9('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2a94d6[_0xd8f9('0x3a')]['fields']){_0x310836['attributes'][_0xd8f9('0x25')](function(_0x4216a6){_0xaad657[_0xd8f9('0x46')]('i.'+_0x4216a6);});}else{_0xaad657[_0xd8f9('0x46')](_0xd8f9('0x92'),_0xd8f9('0x86'));_0xaad657['field'](_0xd8f9('0x93'),'Account.key');_0xaad657[_0xd8f9('0x46')](_0xd8f9('0x94'),_0xd8f9('0x95'));_0xaad657['field'](_0xd8f9('0x96'),'contactName');_0xaad657[_0xd8f9('0x46')](_0xd8f9('0x85'));_0xaad657[_0xd8f9('0x46')]('i.createdAt');_0xaad657[_0xd8f9('0x46')](_0xd8f9('0x97'));_0xaad657[_0xd8f9('0x46')](_0xd8f9('0x98'));_0xaad657[_0xd8f9('0x46')](_0xd8f9('0x99'));_0xaad657[_0xd8f9('0x46')](_0xd8f9('0x9a'));_0xaad657[_0xd8f9('0x46')](_0xd8f9('0x9b'));_0xaad657['field'](_0xd8f9('0x9c'));_0xaad657[_0xd8f9('0x46')]('i.subject');_0xaad657[_0xd8f9('0x46')]('i.disposition');_0xaad657[_0xd8f9('0x46')](_0xd8f9('0x9d'));_0xaad657[_0xd8f9('0x46')](_0xd8f9('0x9e'));_0xaad657[_0xd8f9('0x46')]('i.substatus');_0xaad657[_0xd8f9('0x46')](_0xd8f9('0x9f'));_0xaad657[_0xd8f9('0x46')](_0xd8f9('0xa0'));_0xaad657[_0xd8f9('0x46')](_0xd8f9('0xa1'));_0xaad657[_0xd8f9('0x46')](_0xd8f9('0xa2'));_0xaad657[_0xd8f9('0x46')](_0xd8f9('0xa3'),_0xd8f9('0xa4'));_0xaad657[_0xd8f9('0x46')](_0xd8f9('0xa5'),_0xd8f9('0xa6'));_0xaad657[_0xd8f9('0x46')](_0xd8f9('0xa7'),_0xd8f9('0xa8'));_0xaad657[_0xd8f9('0x46')]('c.phone',_0xd8f9('0xa9'));_0xaad657[_0xd8f9('0x46')](_0xd8f9('0xaa'),_0xd8f9('0xab'));_0xaad657[_0xd8f9('0x46')](_0xd8f9('0xac'),_0xd8f9('0xad'));_0xaad657['field']('o.fullname',_0xd8f9('0xae'));_0xaad657['field']('o.internal',_0xd8f9('0xaf'));_0xaad657['field'](_0xd8f9('0xb0'),_0xd8f9('0x24'));}if(_0x310836[_0xd8f9('0x17')])_0xaad657[_0xd8f9('0x17')](_0x310836[_0xd8f9('0x17')]);if(_0x310836[_0xd8f9('0x16')])_0xaad657[_0xd8f9('0x16')](_0x310836['offset']);return db[_0xd8f9('0x90')][_0xd8f9('0x3a')](_0xaad657[_0xd8f9('0x91')](),_0xebea11);})['then'](function(_0x5081fd){if(_0x5081fd[_0xd8f9('0x5b')]>0x0)_0x417be0[_0xd8f9('0x43')](_0xd8f9('0xb1'),_['map'](_0x5081fd,'id'));return db['sequelize']['query'](_0x417be0[_0xd8f9('0x91')](),_0xebea11)[_0xd8f9('0x1b')](function(_0x50b0f6){var _0x3d1b67=_['groupBy'](_0x50b0f6,'MailInteractionId');var _0x254485=[];return db[_0xd8f9('0xb2')][_0xd8f9('0x27')]({'attributes':[_0xd8f9('0xb3')],'raw':!![]})['then'](function(_0x2eab44){var _0x28f647=_0x2eab44[_0xd8f9('0xb3')];_0x5081fd[_0xd8f9('0x25')](function(_0x35e0b1){_0x254485[_0xd8f9('0x26')](updateMailInteraction(_0x35e0b1,_0x1b1782,_0x3d1b67,_0x28f647));});return BPromise[_0xd8f9('0xb4')](_0x254485);});});});})['then'](function(_0x4066e5){_0x149530[_0xd8f9('0xb5')]=_0x4066e5;return _0x149530;})['then'](respondWithFilteredResult(_0x5d16b8,_0x310836))['catch'](handleError(_0x5d16b8,null));};exports[_0xd8f9('0xb6')]=function(_0x274c84,_0xd16a68){var _0x2d61c8={'raw':![],'where':{'id':_0x274c84[_0xd8f9('0xb7')]['id']}},_0x35715e={};_0x35715e[_0xd8f9('0x3e')]=_[_0xd8f9('0x3b')](db['MailInteraction'][_0xd8f9('0x36')]);_0x35715e[_0xd8f9('0x3a')]=_['keys'](_0x274c84[_0xd8f9('0x3a')]);_0x35715e[_0xd8f9('0x3c')]=_['intersection'](_0x35715e[_0xd8f9('0x3e')],_0x35715e[_0xd8f9('0x3a')]);_0x2d61c8['attributes']=_[_0xd8f9('0x3d')](_0x35715e[_0xd8f9('0x3e')],qs[_0xd8f9('0x40')](_0x274c84[_0xd8f9('0x3a')]['fields']));_0x2d61c8[_0xd8f9('0x3f')]=_0x2d61c8[_0xd8f9('0x3f')][_0xd8f9('0x5b')]?_0x2d61c8[_0xd8f9('0x3f')]:_0x35715e[_0xd8f9('0x3e')];if(_0x274c84[_0xd8f9('0x3a')][_0xd8f9('0xb8')]){_0x2d61c8['include']=[{'all':!![]}];}_0x2d61c8=_[_0xd8f9('0xb9')]({},_0x2d61c8,_0x274c84[_0xd8f9('0xba')]);return db[_0xd8f9('0x35')][_0xd8f9('0x5c')](_0x2d61c8)[_0xd8f9('0x1b')](handleEntityNotFound(_0xd16a68,null))[_0xd8f9('0x1b')](respondWithResult(_0xd16a68,null))[_0xd8f9('0x2c')](handleError(_0xd16a68,null));};exports['create']=function(_0x93f0fe,_0x7ace54){return db[_0xd8f9('0x35')][_0xd8f9('0xbb')](_0x93f0fe[_0xd8f9('0xbc')],{})[_0xd8f9('0x1b')](respondWithResult(_0x7ace54,0xc9))['catch'](handleError(_0x7ace54,null));};exports[_0xd8f9('0xbd')]=function(_0x3ba804,_0x483b33){if(_0x3ba804['body']['id']){delete _0x3ba804[_0xd8f9('0xbc')]['id'];}return db[_0xd8f9('0x35')]['find']({'where':{'id':_0x3ba804[_0xd8f9('0xb7')]['id']}})[_0xd8f9('0x1b')](handleEntityNotFound(_0x483b33,null))[_0xd8f9('0x1b')](saveUpdates(_0x3ba804['body'],null))[_0xd8f9('0x1b')](respondWithResult(_0x483b33,null))[_0xd8f9('0x2c')](handleError(_0x483b33,null));};exports['destroy']=function(_0x250f0e,_0x53c36a){return db[_0xd8f9('0x35')][_0xd8f9('0x5c')]({'where':{'id':_0x250f0e[_0xd8f9('0xb7')]['id']}})['then'](handleEntityNotFound(_0x53c36a,null))[_0xd8f9('0x1b')](removeEntity(_0x53c36a,null))[_0xd8f9('0x2c')](handleError(_0x53c36a,null));};exports[_0xd8f9('0xbe')]=function(_0x2e5df3,_0x2341ee){return db[_0xd8f9('0x35')][_0xd8f9('0xbe')]()['then'](respondWithResult(_0x2341ee,null))[_0xd8f9('0x2c')](handleError(_0x2341ee,null));};exports['addMessage']=function(_0xc3fdfd,_0xa22c1f){return db[_0xd8f9('0xbf')][_0xd8f9('0x5c')]({'where':{'id':_0xc3fdfd[_0xd8f9('0xb7')]['id']}})[_0xd8f9('0x1b')](handleEntityNotFound(_0xa22c1f,null))[_0xd8f9('0x1b')](function(_0x5c1e3c){if(_0x5c1e3c){return _0x5c1e3c[_0xd8f9('0xc0')](_0xc3fdfd[_0xd8f9('0xbc')][_0xd8f9('0xc1')],_['omit'](_0xc3fdfd['body'],['ids','id'])||{});}})[_0xd8f9('0x1b')](respondWithResult(_0xa22c1f,null))[_0xd8f9('0x2c')](handleError(_0xa22c1f,null));};exports[_0xd8f9('0xc2')]=function(_0x2edaa6,_0x124b19){var _0x4bf8c1={'raw':![],'where':{}};var _0x5f3d06={};var _0x1828cc={'count':0x0,'rows':[]};return db[_0xd8f9('0x35')][_0xd8f9('0x27')]({'where':{'id':_0x2edaa6[_0xd8f9('0xb7')]['id']}})[_0xd8f9('0x1b')](handleEntityNotFound(_0x124b19,null))[_0xd8f9('0x1b')](function(_0x5dc831){if(_0x5dc831){_0x5f3d06[_0xd8f9('0x3e')]=_[_0xd8f9('0x3b')](db[_0xd8f9('0xbf')]['rawAttributes']);_0x5f3d06[_0xd8f9('0x3a')]=_[_0xd8f9('0x3b')](_0x2edaa6[_0xd8f9('0x3a')]);_0x5f3d06[_0xd8f9('0x3c')]=_[_0xd8f9('0x3d')](_0x5f3d06['model'],_0x5f3d06[_0xd8f9('0x3a')]);_0x4bf8c1['attributes']=_[_0xd8f9('0x3d')](_0x5f3d06['model'],qs['fields'](_0x2edaa6['query']['fields']));_0x4bf8c1[_0xd8f9('0x3f')]=_0x4bf8c1[_0xd8f9('0x3f')]['length']?_0x4bf8c1[_0xd8f9('0x3f')]:_0x5f3d06['model'];if(!_0x2edaa6[_0xd8f9('0x3a')][_0xd8f9('0xc3')](_0xd8f9('0x41'))){_0x4bf8c1['limit']=qs[_0xd8f9('0x17')](_0x2edaa6[_0xd8f9('0x3a')][_0xd8f9('0x17')]);_0x4bf8c1[_0xd8f9('0x16')]=qs['offset'](_0x2edaa6[_0xd8f9('0x3a')][_0xd8f9('0x16')]);}_0x4bf8c1[_0xd8f9('0x87')]=qs['sort'](_0x2edaa6[_0xd8f9('0x3a')][_0xd8f9('0x42')]);_0x4bf8c1[_0xd8f9('0x43')]=qs['filters'](_[_0xd8f9('0x44')](_0x2edaa6['query'],_0x5f3d06['filters']));_0x4bf8c1['where']['MailInteractionId']=_0x5dc831['id'];if(_0x2edaa6[_0xd8f9('0x3a')]['filter']){_0x4bf8c1[_0xd8f9('0x43')]=_[_0xd8f9('0xb9')](_0x4bf8c1[_0xd8f9('0x43')],{'$or':_[_0xd8f9('0x22')](_0x4bf8c1[_0xd8f9('0x3f')],function(_0x4009ce){var _0x115d37={};_0x115d37[_0x4009ce]={'$like':'%'+_0x2edaa6[_0xd8f9('0x3a')][_0xd8f9('0x7b')]+'%'};return _0x115d37;})});}if(_0x2edaa6[_0xd8f9('0x3a')][_0xd8f9('0x71')]){var _0x2e0049=_0x2edaa6[_0xd8f9('0x3a')][_0xd8f9('0x71')][_0xd8f9('0x62')](',');var _0x3fa88a={};_0x3fa88a[_0x2e0049[0x0]]={'$gte':moment(_0x2e0049[0x1])[_0xd8f9('0xc4')](_0xd8f9('0xc5'))};_0x4bf8c1[_0xd8f9('0x43')]=_['merge'](_0x4bf8c1[_0xd8f9('0x43')],_0x3fa88a);}_0x4bf8c1=_['merge']({},_0x4bf8c1,_0x2edaa6[_0xd8f9('0xba')]);return db[_0xd8f9('0xbf')][_0xd8f9('0x19')]({'where':_0x4bf8c1[_0xd8f9('0x43')]})[_0xd8f9('0x1b')](function(_0xc6a6b4){_0x1828cc['count']=_0xc6a6b4;if(_0x2edaa6['query'][_0xd8f9('0xb8')]){_0x4bf8c1[_0xd8f9('0xc6')]=[{'all':!![]}];}return db['MailMessage'][_0xd8f9('0xc7')](_0x4bf8c1);})['then'](function(_0x4b53d6){if(_0x2edaa6['query']['inlineCss']===_0xd8f9('0xc8')){for(var _0x416742=0x0;_0x416742<_0x4b53d6[_0xd8f9('0x5b')];_0x416742++){_0x4b53d6[_0x416742][_0xd8f9('0xbc')]=juice(_0x4b53d6[_0x416742][_0xd8f9('0xbc')]);}}_0x1828cc[_0xd8f9('0xb5')]=_0x4b53d6;return _0x1828cc;});}})[_0xd8f9('0x1b')](respondWithFilteredResult(_0x124b19,_0x4bf8c1))['catch'](handleError(_0x124b19,null));};exports[_0xd8f9('0xc9')]=function(_0x1c57b1,_0x3469d1){return db[_0xd8f9('0x35')]['find']({'where':{'id':_0x1c57b1[_0xd8f9('0xb7')]['id']}})[_0xd8f9('0x1b')](handleEntityNotFound(_0x3469d1,null))['then'](function(_0x1ec972){if(_0x1ec972){return _0x1ec972[_0xd8f9('0xca')](_0x1c57b1['body'][_0xd8f9('0xc1')],_['omit'](_0x1c57b1['body'],[_0xd8f9('0xc1'),'id'])||{})[_0xd8f9('0xcb')](function(){return db[_0xd8f9('0x68')]['findAll']({'attributes':['id',_0xd8f9('0x1f'),_0xd8f9('0xcc')],'where':{'id':_0x1c57b1['body'][_0xd8f9('0xc1')]}});})['then'](function(_0x36f421){socket[_0xd8f9('0xcd')](_0xd8f9('0xce'),{'id':Number(_0x1c57b1[_0xd8f9('0xb7')]['id']),'tags':_0x36f421||[]});return{'id':Number(_0x1c57b1[_0xd8f9('0xb7')]['id']),'tags':_0x36f421||[]};});}})['then'](respondWithResult(_0x3469d1,null))[_0xd8f9('0x2c')](handleError(_0x3469d1,null));};exports[_0xd8f9('0xcf')]=function(_0x590142,_0x53fd6c){return db['MailInteraction'][_0xd8f9('0x5c')]({'where':{'id':_0x590142[_0xd8f9('0xb7')]['id']}})[_0xd8f9('0x1b')](handleEntityNotFound(_0x53fd6c,null))[_0xd8f9('0x1b')](function(_0x33f4f7){if(_0x33f4f7){return _0x33f4f7[_0xd8f9('0xcf')](_0x590142['query']['ids']);}})[_0xd8f9('0x1b')](respondWithStatusCode(_0x53fd6c,null))[_0xd8f9('0x2c')](handleError(_0x53fd6c,null));};exports[_0xd8f9('0xd0')]=function(_0x2175a3,_0x5464e1){var _0x5e6982=moment()[_0xd8f9('0xd1')]()[_0xd8f9('0x91')]();var _0x77d89d=path[_0xd8f9('0xd2')](config[_0xd8f9('0xd3')],_0xd8f9('0xd4'),_0xd8f9('0xd5'),_0xd8f9('0xd6'));var _0x26b8f7=path['join'](config['root'],_0xd8f9('0xd4'),_0xd8f9('0xd5'),_0xd8f9('0xd7'));var _0x521000=path[_0xd8f9('0xd2')](_0x77d89d,_0x5e6982);var _0x1bdec7=util[_0xd8f9('0xc4')](_0xd8f9('0xd8'),_0x2175a3[_0xd8f9('0xb7')]['id'],_0x5e6982);var _0x5a1850=path[_0xd8f9('0xd2')](_0x77d89d,_0x1bdec7);var _0x40406a=[];if(_0x2175a3[_0xd8f9('0x3a')][_0xd8f9('0xd7')]){_0x40406a[_0xd8f9('0x26')]({'model':db[_0xd8f9('0xd9')],'as':_0xd8f9('0xda'),'raw':!![]});}var _0x415fc4=[{'model':db[_0xd8f9('0xbf')],'as':_0xd8f9('0xdb'),'attributes':['id',_0xd8f9('0xbc'),_0xd8f9('0x47'),'to','cc',_0xd8f9('0xdc'),_0xd8f9('0xdd'),_0xd8f9('0x70')],'where':{'secret':![]},'order':qs[_0xd8f9('0x42')]('id'),'include':_0x40406a}];return db['MailInteraction'][_0xd8f9('0x5c')]({'where':{'id':_0x2175a3[_0xd8f9('0xb7')]['id']},'include':_0x415fc4})['then'](handleEntityNotFound(_0x5464e1,null))['then'](function(_0xa8c6f3){if(_0xa8c6f3&&_0xa8c6f3['Messages']){var _0x4b0b6a=_0xa8c6f3[_0xd8f9('0xde')]({'plain':!![]});fs['mkdirSync'](_0x521000);return BPromise['each'](_0x4b0b6a[_0xd8f9('0xdb')],function(_0x2c1c09,_0x3cfc98){var _0x16d681={'from':_0x2c1c09[_0xd8f9('0x47')],'to':_0x2c1c09['to'],'subject':_0x2c1c09[_0xd8f9('0xdd')],'html':htmlEntities[_0xd8f9('0xdf')](_0x2c1c09['body']),'headers':{'Date':moment(_0x2c1c09[_0xd8f9('0x70')])['format'](_0xd8f9('0xe0'))},'attachments':[]};if(_0x2c1c09['cc']){_0x16d681['headers']['Cc']=_0x2c1c09['cc'];}if(_0x2c1c09[_0xd8f9('0xdc')]){_0x16d681[_0xd8f9('0xe1')][_0xd8f9('0xe2')]=_0x2c1c09[_0xd8f9('0xdc')];}return new BPromise(function(_0x289fa0,_0x5c701a){if(_0x2c1c09[_0xd8f9('0xda')]){for(var _0x2bb559=0x0;_0x2bb559<_0x2c1c09[_0xd8f9('0xda')][_0xd8f9('0x5b')];_0x2bb559++){var _0x506844=_0x2c1c09[_0xd8f9('0xda')][_0x2bb559];var _0x57880d=path['join'](_0x26b8f7,_0x506844['basename']);if(fs['existsSync'](_0x57880d)){_0x16d681[_0xd8f9('0xd7')][_0xd8f9('0x26')]({'name':_0x506844[_0xd8f9('0x1f')],'contentType':_0x506844[_0xd8f9('0x38')],'data':fs[_0xd8f9('0xe3')](_0x57880d)});}}}emlformat[_0xd8f9('0xe4')](_0x16d681,function(_0x56d6a4,_0x3acaf3){if(_0x56d6a4)return _0x5c701a(_0x56d6a4);fs['writeFileSync'](path['join'](_0x521000,util['format'](_0xd8f9('0xe5'),_0x3cfc98)),_0x3acaf3);return _0x289fa0(_0x3acaf3);});});})['then'](function(){return new BPromise(function(_0x207e4a,_0x14c0c8){zipdir(_0x521000,{'saveTo':_0x5a1850},function(_0x5f19ea,_0x450645){if(_0x5f19ea)return _0x14c0c8(_0x5f19ea);return _0x207e4a(_0x450645);});})['then'](function(){return new BPromise(function(_0x525dc5,_0xd4be2c){rimraf(_0x521000,function(_0x1ef396){if(_0x1ef396)_0xd4be2c(_0x1ef396);return _0x525dc5();});});})[_0xd8f9('0x1b')](function(){return _0x5464e1[_0xd8f9('0xd0')](_0x5a1850,_0x1bdec7,function(_0x54c0af){if(!_0x54c0af)fs[_0xd8f9('0xe6')](_0x5a1850);});});});}else{return _0x5464e1[_0xd8f9('0x13')](0xc8);}})[_0xd8f9('0x2c')](handleError(_0x5464e1,null));};
\ No newline at end of file
index 3600203..1bc4c9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95b7=['setMaxListeners','update','remove','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','MailInteraction','../../mysqldb','MailMessage'];(function(_0x5c604c,_0x3c638f){var _0x565a0e=function(_0x363a79){while(--_0x363a79){_0x5c604c['push'](_0x5c604c['shift']());}};_0x565a0e(++_0x3c638f);}(_0x95b7,0x69));var _0x795b=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0x95b7[_0x424501];return _0xb719af;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0x795b('0x0')];var MailMessage=require(_0x795b('0x1'))['db'][_0x795b('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x795b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x795b('0x4'),'afterDestroy':_0x795b('0x5')};function emitEvent(_0xa14e45){return function(_0x12a3ee,_0x1a5ed3,_0x434a41){_0x12a3ee['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x13007a){_0x12a3ee[_0x795b('0x6')](_0x795b('0x7'),_0x13007a[_0x795b('0x8')](function(_0x203ca8){return{'id':_0x203ca8['id']};}));return MailMessage[_0x795b('0x9')]({'where':{'MailInteractionId':_0x12a3ee['id'],'direction':'in','read':![]},'raw':!![]});})[_0x795b('0xa')](function(_0x18f62b){_0x12a3ee[_0x795b('0x6')](_0x795b('0xb'),_0x18f62b[_0x795b('0xc')]);MailInteractionEvents[_0x795b('0xd')](_0xa14e45+':'+_0x12a3ee['id'],_0x12a3ee);MailInteractionEvents['emit'](_0xa14e45,_0x12a3ee);_0x434a41(null);})[_0x795b('0xe')](_0x434a41(null));};}for(var e in events){if(events[_0x795b('0xf')](e)){var event=events[e];MailInteraction[_0x795b('0x10')](e,emitEvent(event));}}module[_0x795b('0x11')]=MailInteractionEvents;
\ No newline at end of file
+var _0xfb2b=['events','MailInteraction','MailMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hook','exports'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xfb2b,0x121));var _0xbfb2=function(_0x2d6330,_0x2e2ea0){_0x2d6330=_0x2d6330-0x0;var _0x202683=_0xfb2b[_0x2d6330];return _0x202683;};'use strict';var EventEmitter=require(_0xbfb2('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xbfb2('0x1')];var MailMessage=require('../../mysqldb')['db'][_0xbfb2('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xbfb2('0x3')](0x0);var events={'afterCreate':_0xbfb2('0x4'),'afterUpdate':_0xbfb2('0x5'),'afterDestroy':_0xbfb2('0x6')};function emitEvent(_0x39e4ae){return function(_0x6999cb,_0x1a52ec,_0x568ff5){_0x6999cb['getUsers']({'attributes':['id'],'raw':!![]})[_0xbfb2('0x7')](function(_0x463fed){_0x6999cb[_0xbfb2('0x8')](_0xbfb2('0x9'),_0x463fed['map'](function(_0x3c4ae4){return{'id':_0x3c4ae4['id']};}));return MailMessage[_0xbfb2('0xa')]({'where':{'MailInteractionId':_0x6999cb['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbfb2('0x7')](function(_0x1e25b4){_0x6999cb['setDataValue'](_0xbfb2('0xb'),_0x1e25b4[_0xbfb2('0xc')]);MailInteractionEvents[_0xbfb2('0xd')](_0x39e4ae+':'+_0x6999cb['id'],_0x6999cb);MailInteractionEvents[_0xbfb2('0xd')](_0x39e4ae,_0x6999cb);_0x568ff5(null);})[_0xbfb2('0xe')](_0x568ff5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xbfb2('0xf')](e,emitEvent(event));}}module[_0xbfb2('0x10')]=MailInteractionEvents;
\ No newline at end of file
index 8520e10..877c866 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d73=['models','get','update','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','substatusAt'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x5d73,0x101));var _0x35d7=function(_0x49bd0e,_0x1a557c){_0x49bd0e=_0x49bd0e-0x0;var _0xadf87e=_0x5d73[_0x49bd0e];return _0xadf87e;};'use strict';var _=require(_0x35d7('0x0'));var util=require(_0x35d7('0x1'));var logger=require(_0x35d7('0x2'))(_0x35d7('0x3'));var moment=require(_0x35d7('0x4'));var BPromise=require(_0x35d7('0x5'));var rp=require(_0x35d7('0x6'));var fs=require('fs');var path=require(_0x35d7('0x7'));var rimraf=require('rimraf');var config=require(_0x35d7('0x8'));var attributes=require(_0x35d7('0x9'));module[_0x35d7('0xa')]=function(_0x2158de,_0x1bb566){return _0x2158de['define'](_0x35d7('0xb'),attributes,{'tableName':_0x35d7('0xc'),'paranoid':![],'indexes':[{'name':_0x35d7('0xd'),'fields':[_0x35d7('0xe'),'to'],'type':_0x35d7('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5b2228,_0x1d895c,_0x480bd9){if(_0x5b2228[_0x35d7('0x10')]){_0x5b2228['substatusAt']=moment()['format'](_0x35d7('0x11'));}if(_0x5b2228[_0x35d7('0x12')]){_0x5b2228[_0x35d7('0x13')]=moment()[_0x35d7('0x14')](_0x35d7('0x11'));}_0x480bd9(null,_0x1d895c);},'beforeUpdate':function(_0x3a9e7d,_0x4231a8,_0x37a5e9){if(_0x3a9e7d[_0x35d7('0x15')](_0x35d7('0x10'))){_0x3a9e7d[_0x35d7('0x16')]=_0x3a9e7d[_0x35d7('0x10')]?moment()[_0x35d7('0x14')](_0x35d7('0x11')):null;}if(_0x3a9e7d[_0x35d7('0x15')](_0x35d7('0x12'))){_0x3a9e7d[_0x35d7('0x13')]=moment()[_0x35d7('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x3a9e7d[_0x35d7('0x10')]=null;_0x3a9e7d[_0x35d7('0x16')]=null;}_0x37a5e9(null,_0x3a9e7d);},'afterUpdate':function(_0x4daa42,_0x3e5e66,_0x2949f9){var _0x4b84e8=_0x2158de[_0x35d7('0x17')];var _0x566df3=_0x4daa42[_0x35d7('0x18')]({'plain':!![]});if(_0x566df3[_0x35d7('0x12')]){return _0x4b84e8['MailMessage'][_0x35d7('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x566df3['id']}})['then'](function(){_0x2949f9();})[_0x35d7('0x1a')](function(_0x3b148c){_0x2949f9(_0x3b148c);});}else{_0x2949f9();}}},'charset':'utf8mb4','collate':_0x35d7('0x1b')});};
\ No newline at end of file
+var _0x9a06=['../../config/environment','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','substatusAt','closedAt','get','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','path'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9a06,0xb1));var _0x69a0=function(_0x3aeb62,_0x2a5e8d){_0x3aeb62=_0x3aeb62-0x0;var _0x1c6b02=_0x9a06[_0x3aeb62];return _0x1c6b02;};'use strict';var _=require(_0x69a0('0x0'));var util=require(_0x69a0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x69a0('0x2'));var rp=require(_0x69a0('0x3'));var fs=require('fs');var path=require(_0x69a0('0x4'));var rimraf=require('rimraf');var config=require(_0x69a0('0x5'));var attributes=require('./mailInteraction.attributes');module[_0x69a0('0x6')]=function(_0x44f69e,_0x53f34f){return _0x44f69e[_0x69a0('0x7')](_0x69a0('0x8'),attributes,{'tableName':_0x69a0('0x9'),'paranoid':![],'indexes':[{'name':_0x69a0('0xa'),'fields':[_0x69a0('0xb'),'to'],'type':_0x69a0('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3d7a2f,_0x1e0c47,_0x297c48){if(_0x3d7a2f[_0x69a0('0xd')]){_0x3d7a2f['substatusAt']=moment()[_0x69a0('0xe')](_0x69a0('0xf'));}if(_0x3d7a2f[_0x69a0('0x10')]){_0x3d7a2f['closedAt']=moment()[_0x69a0('0xe')](_0x69a0('0xf'));}_0x297c48(null,_0x1e0c47);},'beforeUpdate':function(_0x2c4997,_0x232574,_0x4c28c5){if(_0x2c4997[_0x69a0('0x11')]('substatus')){_0x2c4997[_0x69a0('0x12')]=_0x2c4997[_0x69a0('0xd')]?moment()[_0x69a0('0xe')](_0x69a0('0xf')):null;}if(_0x2c4997[_0x69a0('0x11')]('closed')){_0x2c4997[_0x69a0('0x13')]=moment()[_0x69a0('0xe')](_0x69a0('0xf'));_0x2c4997[_0x69a0('0xd')]=null;_0x2c4997[_0x69a0('0x12')]=null;}_0x4c28c5(null,_0x2c4997);},'afterUpdate':function(_0x284be4,_0x7ddab3,_0x40ace6){var _0x3c6746=_0x44f69e['models'];var _0x580448=_0x284be4[_0x69a0('0x14')]({'plain':!![]});if(_0x580448[_0x69a0('0x10')]){return _0x3c6746[_0x69a0('0x15')][_0x69a0('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x580448['id']}})['then'](function(){_0x40ace6();})[_0x69a0('0x17')](function(_0x2fe384){_0x40ace6(_0x2fe384);});}else{_0x40ace6();}}},'charset':_0x69a0('0x18'),'collate':_0x69a0('0x19')});};
\ No newline at end of file
index 8940ae2..8a9f54e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1156=['then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','MailInteraction','update','options','raw','where','limit','UpdateMailInteraction','stringify','AddTagsToMailInteraction','addTags','body','ids','omit','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request'];(function(_0x2f0bd4,_0x28e679){var _0x5830ef=function(_0x3d3dda){while(--_0x3d3dda){_0x2f0bd4['push'](_0x2f0bd4['shift']());}};_0x5830ef(++_0x28e679);}(_0x1156,0x93));var _0x6115=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x1156[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0x6115('0x0'));var util=require(_0x6115('0x1'));var moment=require(_0x6115('0x2'));var BPromise=require(_0x6115('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6115('0x4'));var db=require(_0x6115('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6115('0x6'))('rpc');var config=require(_0x6115('0x7'));var jayson=require(_0x6115('0x8'));var client=jayson[_0x6115('0x9')][_0x6115('0xa')]({'port':0x232a});config['redis']=_[_0x6115('0xb')](config[_0x6115('0xc')],{'host':_0x6115('0xd'),'port':0x18eb});var socket=require(_0x6115('0xe'))(new Redis(config[_0x6115('0xc')]));require('./mailInteraction.socket')[_0x6115('0xf')](socket);function respondWithRpcPromise(_0x3e6406,_0x4351b3,_0x1318a7){return new BPromise(function(_0x4f650f,_0xbcca0){return client[_0x6115('0x10')](_0x3e6406,_0x1318a7)[_0x6115('0x11')](function(_0x405eb7){logger[_0x6115('0x12')](_0x6115('0x13'),_0x4351b3,_0x6115('0x14'));logger[_0x6115('0x15')](_0x6115('0x16'),_0x4351b3,_0x6115('0x14'),JSON['stringify'](_0x405eb7));if(_0x405eb7[_0x6115('0x17')]){if(_0x405eb7[_0x6115('0x17')][_0x6115('0x18')]===0x1f4){logger[_0x6115('0x17')](_0x6115('0x13'),_0x4351b3,_0x405eb7[_0x6115('0x17')][_0x6115('0x19')]);return _0xbcca0(_0x405eb7[_0x6115('0x17')][_0x6115('0x19')]);}logger[_0x6115('0x17')](_0x6115('0x13'),_0x4351b3,_0x405eb7[_0x6115('0x17')]['message']);return _0x4f650f(_0x405eb7[_0x6115('0x17')][_0x6115('0x19')]);}else{logger[_0x6115('0x12')]('MailInteraction,\x20%s,\x20%s',_0x4351b3,'request\x20sent');_0x4f650f(_0x405eb7[_0x6115('0x1a')][_0x6115('0x19')]);}})['catch'](function(_0xa2bb7){logger[_0x6115('0x17')](_0x6115('0x13'),_0x4351b3,_0xa2bb7);_0xbcca0(_0xa2bb7);});});}exports['UpdateMailInteraction']=function(_0x218f1d){var _0x4e4041=this;return new Promise(function(_0x2f6fcb,_0x47cd31){return db[_0x6115('0x1b')][_0x6115('0x1c')](_0x218f1d['body'],{'raw':_0x218f1d[_0x6115('0x1d')]?_0x218f1d['options'][_0x6115('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x218f1d['options']?_0x218f1d[_0x6115('0x1d')][_0x6115('0x1f')]||null:null,'attributes':_0x218f1d[_0x6115('0x1d')]?_0x218f1d['options']['attributes']||null:null,'limit':_0x218f1d[_0x6115('0x1d')]?_0x218f1d['options'][_0x6115('0x20')]||null:null})[_0x6115('0x11')](function(_0x5d243d){logger['info'](_0x6115('0x21'),_0x218f1d);logger['debug'](_0x6115('0x21'),_0x218f1d,JSON[_0x6115('0x22')](_0x5d243d));_0x2f6fcb(_0x5d243d);})['catch'](function(_0x1a5aa5){logger[_0x6115('0x17')](_0x6115('0x21'),_0x1a5aa5['message'],_0x218f1d);_0x47cd31(_0x4e4041[_0x6115('0x17')](0x1f4,_0x1a5aa5[_0x6115('0x19')]));});});};exports[_0x6115('0x23')]=function(_0x24460e){return new Promise(function(_0x1a6b61,_0x4281cc){return db[_0x6115('0x1b')]['find']({'where':_0x24460e['options']?_0x24460e['options'][_0x6115('0x1f')]||null:null})[_0x6115('0x11')](function(_0x55e08c){if(_0x55e08c){return _0x55e08c[_0x6115('0x24')](_0x24460e[_0x6115('0x25')][_0x6115('0x26')],_[_0x6115('0x27')](_0x24460e[_0x6115('0x25')],[_0x6115('0x26'),'id'])||{});}})['spread'](function(_0x6ec511){logger[_0x6115('0x12')](_0x6115('0x28'),_0x24460e);logger['debug'](_0x6115('0x28'),_0x24460e,JSON['stringify'](_0x6ec511));_0x1a6b61(_0x6ec511);})['catch'](function(_0x11e570){logger[_0x6115('0x17')]('AddTags',_0x11e570[_0x6115('0x19')],_0x24460e);_0x4281cc(_this[_0x6115('0x17')](0x1f4,_0x11e570[_0x6115('0x19')]));});});};
\ No newline at end of file
+var _0x9de5=['ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','http','redis','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','code','message','info','MailInteraction','body','options','raw','where','limit','UpdateMailInteraction','AddTagsToMailInteraction','find','addTags'];(function(_0x28e7dc,_0x420c9f){var _0x40fa4c=function(_0x1cc0e2){while(--_0x1cc0e2){_0x28e7dc['push'](_0x28e7dc['shift']());}};_0x40fa4c(++_0x420c9f);}(_0x9de5,0xbc));var _0x59de=function(_0x5e4f7c,_0x2c7430){_0x5e4f7c=_0x5e4f7c-0x0;var _0x288709=_0x9de5[_0x5e4f7c];return _0x288709;};'use strict';var _=require(_0x59de('0x0'));var util=require(_0x59de('0x1'));var moment=require(_0x59de('0x2'));var BPromise=require(_0x59de('0x3'));var rs=require(_0x59de('0x4'));var fs=require('fs');var Redis=require(_0x59de('0x5'));var db=require(_0x59de('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x59de('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x59de('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x59de('0x9')],{'host':_0x59de('0xa'),'port':0x18eb});var socket=require(_0x59de('0xb'))(new Redis(config[_0x59de('0x9')]));require(_0x59de('0xc'))[_0x59de('0xd')](socket);function respondWithRpcPromise(_0x504aa5,_0x1df4db,_0x4e9c4b){return new BPromise(function(_0x54bb12,_0x2ac26b){return client['request'](_0x504aa5,_0x4e9c4b)[_0x59de('0xe')](function(_0x861bcd){logger['info'](_0x59de('0xf'),_0x1df4db,_0x59de('0x10'));logger[_0x59de('0x11')](_0x59de('0x12'),_0x1df4db,_0x59de('0x10'),JSON[_0x59de('0x13')](_0x861bcd));if(_0x861bcd[_0x59de('0x14')]){if(_0x861bcd[_0x59de('0x14')][_0x59de('0x15')]===0x1f4){logger[_0x59de('0x14')](_0x59de('0xf'),_0x1df4db,_0x861bcd['error'][_0x59de('0x16')]);return _0x2ac26b(_0x861bcd[_0x59de('0x14')]['message']);}logger[_0x59de('0x14')](_0x59de('0xf'),_0x1df4db,_0x861bcd[_0x59de('0x14')][_0x59de('0x16')]);return _0x54bb12(_0x861bcd[_0x59de('0x14')][_0x59de('0x16')]);}else{logger[_0x59de('0x17')](_0x59de('0xf'),_0x1df4db,_0x59de('0x10'));_0x54bb12(_0x861bcd['result']['message']);}})['catch'](function(_0x38afdf){logger[_0x59de('0x14')](_0x59de('0xf'),_0x1df4db,_0x38afdf);_0x2ac26b(_0x38afdf);});});}exports['UpdateMailInteraction']=function(_0x32e837){var _0x3622a7=this;return new Promise(function(_0x578513,_0x1c1bf4){return db[_0x59de('0x18')]['update'](_0x32e837[_0x59de('0x19')],{'raw':_0x32e837['options']?_0x32e837[_0x59de('0x1a')][_0x59de('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32e837['options']?_0x32e837[_0x59de('0x1a')][_0x59de('0x1c')]||null:null,'attributes':_0x32e837[_0x59de('0x1a')]?_0x32e837[_0x59de('0x1a')]['attributes']||null:null,'limit':_0x32e837[_0x59de('0x1a')]?_0x32e837[_0x59de('0x1a')][_0x59de('0x1d')]||null:null})[_0x59de('0xe')](function(_0x5919d4){logger[_0x59de('0x17')]('UpdateMailInteraction',_0x32e837);logger[_0x59de('0x11')](_0x59de('0x1e'),_0x32e837,JSON[_0x59de('0x13')](_0x5919d4));_0x578513(_0x5919d4);})['catch'](function(_0x69f39a){logger[_0x59de('0x14')](_0x59de('0x1e'),_0x69f39a[_0x59de('0x16')],_0x32e837);_0x1c1bf4(_0x3622a7[_0x59de('0x14')](0x1f4,_0x69f39a[_0x59de('0x16')]));});});};exports[_0x59de('0x1f')]=function(_0x4ecbd1){return new Promise(function(_0x5f0d73,_0x587c76){return db[_0x59de('0x18')][_0x59de('0x20')]({'where':_0x4ecbd1['options']?_0x4ecbd1[_0x59de('0x1a')][_0x59de('0x1c')]||null:null})[_0x59de('0xe')](function(_0x2e5a03){if(_0x2e5a03){return _0x2e5a03[_0x59de('0x21')](_0x4ecbd1['body'][_0x59de('0x22')],_[_0x59de('0x23')](_0x4ecbd1[_0x59de('0x19')],['ids','id'])||{});}})['spread'](function(_0x5317c1){logger[_0x59de('0x17')](_0x59de('0x24'),_0x4ecbd1);logger[_0x59de('0x11')](_0x59de('0x24'),_0x4ecbd1,JSON[_0x59de('0x13')](_0x5317c1));_0x5f0d73(_0x5317c1);})['catch'](function(_0x118f20){logger['error'](_0x59de('0x24'),_0x118f20['message'],_0x4ecbd1);_0x587c76(_this[_0x59de('0x14')](0x1f4,_0x118f20[_0x59de('0x16')]));});});};
\ No newline at end of file
index 8a5903d..1e2b303 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x194a=['length','mailInteraction:','./mailInteraction.events','save','remove','update','emit','register'];(function(_0x47164b,_0x525d3c){var _0x427f6f=function(_0x4b2cfd){while(--_0x4b2cfd){_0x47164b['push'](_0x47164b['shift']());}};_0x427f6f(++_0x525d3c);}(_0x194a,0x1e2));var _0xa194=function(_0x44b7d6,_0x4a3f3f){_0x44b7d6=_0x44b7d6-0x0;var _0x5346f0=_0x194a[_0x44b7d6];return _0x5346f0;};'use strict';var MailInteractionEvents=require(_0xa194('0x0'));var events=[_0xa194('0x1'),_0xa194('0x2'),_0xa194('0x3')];function createListener(_0x6beb8c,_0x2a8a00){return function(_0x45935e){_0x2a8a00[_0xa194('0x4')](_0x6beb8c,_0x45935e);};}function removeListener(_0x17b416,_0x2d3c98){return function(){MailInteractionEvents['removeListener'](_0x17b416,_0x2d3c98);};}exports[_0xa194('0x5')]=function(_0x1c1231){for(var _0x3b41f8=0x0,_0x4529f7=events[_0xa194('0x6')];_0x3b41f8<_0x4529f7;_0x3b41f8++){var _0x49236c=events[_0x3b41f8];var _0x5ddb83=createListener(_0xa194('0x7')+_0x49236c,_0x1c1231);MailInteractionEvents['on'](_0x49236c,_0x5ddb83);}};
\ No newline at end of file
+var _0x8d4c=['save','update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x9d14e3,_0x5a6072){var _0x19bf32=function(_0x19da07){while(--_0x19da07){_0x9d14e3['push'](_0x9d14e3['shift']());}};_0x19bf32(++_0x5a6072);}(_0x8d4c,0x12f));var _0xc8d4=function(_0x2401fc,_0xbc7845){_0x2401fc=_0x2401fc-0x0;var _0x23bb42=_0x8d4c[_0x2401fc];return _0x23bb42;};'use strict';var MailInteractionEvents=require(_0xc8d4('0x0'));var events=[_0xc8d4('0x1'),'remove',_0xc8d4('0x2')];function createListener(_0x3af27d,_0x1aec42){return function(_0x580fde){_0x1aec42[_0xc8d4('0x3')](_0x3af27d,_0x580fde);};}function removeListener(_0x3f2e9e,_0x33e683){return function(){MailInteractionEvents[_0xc8d4('0x4')](_0x3f2e9e,_0x33e683);};}exports[_0xc8d4('0x5')]=function(_0x2c4636){for(var _0x1d7191=0x0,_0x29217e=events[_0xc8d4('0x6')];_0x1d7191<_0x29217e;_0x1d7191++){var _0x597d30=events[_0x1d7191];var _0x18c24b=createListener(_0xc8d4('0x7')+_0x597d30,_0x2c4636);MailInteractionEvents['on'](_0x597d30,_0x18c24b);}};
\ No newline at end of file
index 0ad69e5..c7433b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x477a=['/:id','/:id/download','mail','mailmessage:create','create','update','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./mailMessage.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x32b30c,_0x2d5ec8){var _0xcfc212=function(_0x42e668){while(--_0x42e668){_0x32b30c['push'](_0x32b30c['shift']());}};_0xcfc212(++_0x2d5ec8);}(_0x477a,0x1e2));var _0xa477=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x477a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa477('0x0'));var util=require('util');var path=require(_0xa477('0x1'));var timeout=require(_0xa477('0x2'));var express=require('express');var router=express[_0xa477('0x3')]();var fs_extra=require(_0xa477('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa477('0x5'));var controller=require(_0xa477('0x6'));router['get']('/',auth[_0xa477('0x7')](),controller[_0xa477('0x8')]);router[_0xa477('0x9')](_0xa477('0xa'),auth[_0xa477('0x7')](),controller[_0xa477('0xb')]);router[_0xa477('0x9')](_0xa477('0xc'),auth[_0xa477('0x7')](),controller['show']);router[_0xa477('0x9')](_0xa477('0xd'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0xa477('0xe'),_0xa477('0xf')),controller[_0xa477('0x10')]);router['put'](_0xa477('0xc'),auth[_0xa477('0x7')](),controller[_0xa477('0x11')]);router['put'](_0xa477('0x12'),auth[_0xa477('0x7')](),controller[_0xa477('0x13')]);router[_0xa477('0x14')](_0xa477('0x15'),auth['isAuthenticated'](),controller[_0xa477('0x16')]);router[_0xa477('0x17')](_0xa477('0xc'),auth[_0xa477('0x7')](),controller[_0xa477('0x18')]);module[_0xa477('0x19')]=router;
\ No newline at end of file
+var _0x0e24=['../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id/download','download','post','mail','mailmessage:create','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3a53d7,_0x4d7d68){var _0x403d76=function(_0x38c723){while(--_0x38c723){_0x3a53d7['push'](_0x3a53d7['shift']());}};_0x403d76(++_0x4d7d68);}(_0x0e24,0x1da));var _0x40e2=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x0e24[_0x2aecb2];return _0x3ebb80;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x40e2('0x0'));var timeout=require(_0x40e2('0x1'));var express=require(_0x40e2('0x2'));var router=express[_0x40e2('0x3')]();var fs_extra=require(_0x40e2('0x4'));var auth=require(_0x40e2('0x5'));var interaction=require(_0x40e2('0x6'));var config=require(_0x40e2('0x7'));var controller=require(_0x40e2('0x8'));router[_0x40e2('0x9')]('/',auth[_0x40e2('0xa')](),controller[_0x40e2('0xb')]);router[_0x40e2('0x9')](_0x40e2('0xc'),auth['isAuthenticated'](),controller[_0x40e2('0xd')]);router[_0x40e2('0x9')]('/:id',auth[_0x40e2('0xa')](),controller['show']);router[_0x40e2('0x9')](_0x40e2('0xe'),auth[_0x40e2('0xa')](),controller[_0x40e2('0xf')]);router[_0x40e2('0x10')]('/',auth[_0x40e2('0xa')](),interaction['tracked'](_0x40e2('0x11'),_0x40e2('0x12')),controller[_0x40e2('0x13')]);router[_0x40e2('0x14')](_0x40e2('0x15'),auth[_0x40e2('0xa')](),controller[_0x40e2('0x16')]);router[_0x40e2('0x14')](_0x40e2('0x17'),auth[_0x40e2('0xa')](),controller[_0x40e2('0x18')]);router[_0x40e2('0x14')](_0x40e2('0x19'),auth[_0x40e2('0xa')](),controller[_0x40e2('0x1a')]);router[_0x40e2('0x1b')]('/:id',auth[_0x40e2('0xa')](),controller[_0x40e2('0x1c')]);module[_0x40e2('0x1d')]=router;
\ No newline at end of file
index 2773e0a..ab8c023 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ec7=['BOOLEAN','DATE','Email','Chat','lodash','TEXT','medium','ENUM','out','STRING','long','INTEGER'];(function(_0x40511f,_0x1936ff){var _0x275dac=function(_0xe9ceff){while(--_0xe9ceff){_0x40511f['push'](_0x40511f['shift']());}};_0x275dac(++_0x1936ff);}(_0x1ec7,0x70));var _0x71ec=function(_0x315e37,_0x5b9549){_0x315e37=_0x315e37-0x0;var _0x36c9c8=_0x1ec7[_0x315e37];return _0x36c9c8;};'use strict';var Sequelize=require('sequelize');var _=require(_0x71ec('0x0'));module['exports']={'body':{'type':Sequelize[_0x71ec('0x1')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x71ec('0x2'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x71ec('0x3')]('in',_0x71ec('0x4')),'defaultValue':_0x71ec('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x71ec('0x5')]},'to':{'type':Sequelize[_0x71ec('0x1')]('long')},'cc':{'type':Sequelize[_0x71ec('0x1')](_0x71ec('0x6'))},'bcc':{'type':Sequelize[_0x71ec('0x1')]('long')},'subject':{'type':Sequelize[_0x71ec('0x1')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x71ec('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x71ec('0x8')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x71ec('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x71ec('0x6'))},'originCc':{'type':Sequelize['TEXT'](_0x71ec('0x6'))},'originChannel':{'type':Sequelize[_0x71ec('0x3')](_0x71ec('0xa'),_0x71ec('0xb')),'defaultValue':_0x71ec('0xa'),'allowNull':![]}};
\ No newline at end of file
+var _0xf21e=['lodash','exports','long','TEXT','medium','BOOLEAN','ENUM','STRING','INTEGER','Email','Chat','sequelize'];(function(_0x1bef0a,_0x4621d5){var _0x33a45c=function(_0x154da9){while(--_0x154da9){_0x1bef0a['push'](_0x1bef0a['shift']());}};_0x33a45c(++_0x4621d5);}(_0xf21e,0x14f));var _0xef21=function(_0x121ee7,_0x2f9395){_0x121ee7=_0x121ee7-0x0;var _0x127755=_0xf21e[_0x121ee7];return _0x127755;};'use strict';var Sequelize=require(_0xef21('0x0'));var _=require(_0xef21('0x1'));module[_0xef21('0x2')]={'body':{'type':Sequelize['TEXT'](_0xef21('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xef21('0x4')](_0xef21('0x5'))},'read':{'type':Sequelize[_0xef21('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xef21('0x7')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xef21('0x8')]},'to':{'type':Sequelize['TEXT'](_0xef21('0x3'))},'cc':{'type':Sequelize[_0xef21('0x4')](_0xef21('0x3'))},'bcc':{'type':Sequelize[_0xef21('0x4')]('long')},'subject':{'type':Sequelize[_0xef21('0x4')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xef21('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xef21('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xef21('0x4')]('long')},'originCc':{'type':Sequelize['TEXT'](_0xef21('0x3'))},'originChannel':{'type':Sequelize[_0xef21('0x7')](_0xef21('0xa'),_0xef21('0xb')),'defaultValue':_0xef21('0xa'),'allowNull':![]}};
\ No newline at end of file
index 463652c..4671df4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a5d=['info','catch','status','json','undefined','limit','count','offset','Content-Range','end','stack','name','index','map','MailMessage','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','length','update','body','find','destroy','params','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','root','server/files/attachments','basename','ListId','SendMail','sendMail','format','accept','mail','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','sequelize','Sequelize','SELECT','contact','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','User','fullname','email','internal','fromString','rejectmessage','toString','join','server','files','message-%s.eml','from','subject','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','push','type','readFileSync','writeFileSync','unlinkSync','eml-format','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','localhost','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x163beb,_0x4de43b){var _0x53cb8a=function(_0x142972){while(--_0x142972){_0x163beb['push'](_0x163beb['shift']());}};_0x53cb8a(++_0x4de43b);}(_0x3a5d,0x11a));var _0xd3a5=function(_0xa9cda2,_0x59434d){_0xa9cda2=_0xa9cda2-0x0;var _0x287bb0=_0x3a5d[_0xa9cda2];return _0x287bb0;};'use strict';var emlformat=require(_0xd3a5('0x0'));var moment=require('moment');var BPromise=require(_0xd3a5('0x1'));var util=require(_0xd3a5('0x2'));var path=require(_0xd3a5('0x3'));var fs=require('fs');var _=require(_0xd3a5('0x4'));var Redis=require(_0xd3a5('0x5'));var htmlToText=require('html-to-text');var qs=require(_0xd3a5('0x6'));var logger=require(_0xd3a5('0x7'))(_0xd3a5('0x8'));var interaction_log=require(_0xd3a5('0x7'))(_0xd3a5('0x9'));var config=require(_0xd3a5('0xa'));var db=require('../../mysqldb')['db'];config[_0xd3a5('0xb')]=_[_0xd3a5('0xc')](config[_0xd3a5('0xb')],{'host':_0xd3a5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var htmlEntities=require(_0xd3a5('0xe'));require(_0xd3a5('0xf'))[_0xd3a5('0x10')](socket);var jayson=require(_0xd3a5('0x11'));var client=jayson[_0xd3a5('0x12')][_0xd3a5('0x13')]({'port':0x232c});var client9003=jayson['client'][_0xd3a5('0x13')]({'port':0x232b});var client9002=jayson[_0xd3a5('0x12')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e10b8,_0xe3da34,_0x4fccd7,_0xa9777c){return new BPromise(function(_0x43a9fd,_0x1e114a){var _0xaf1cba=_0xa9777c||client;return _0xaf1cba[_0xd3a5('0x14')](_0x1e10b8,_0x4fccd7)[_0xd3a5('0x15')](function(_0x5d34d1){logger['info'](_0xd3a5('0x16'),_0xe3da34,_0xd3a5('0x17'));logger[_0xd3a5('0x18')](_0xd3a5('0x19'),_0xe3da34,_0xd3a5('0x17'),JSON[_0xd3a5('0x1a')](_0x5d34d1));if(_0x5d34d1[_0xd3a5('0x1b')]){if(_0x5d34d1[_0xd3a5('0x1b')][_0xd3a5('0x1c')]===0x1f4){logger[_0xd3a5('0x1b')](_0xd3a5('0x16'),_0xe3da34,_0x5d34d1[_0xd3a5('0x1b')][_0xd3a5('0x1d')]);return _0x1e114a(_0x5d34d1[_0xd3a5('0x1b')]['message']);}logger['error'](_0xd3a5('0x16'),_0xe3da34,_0x5d34d1['error'][_0xd3a5('0x1d')]);return _0x43a9fd(_0x5d34d1[_0xd3a5('0x1b')][_0xd3a5('0x1d')]);}else{logger[_0xd3a5('0x1e')](_0xd3a5('0x16'),_0xe3da34,'request\x20sent');_0x43a9fd(_0x5d34d1['result'][_0xd3a5('0x1d')]);}})[_0xd3a5('0x1f')](function(_0x95c0c1){logger[_0xd3a5('0x1b')](_0xd3a5('0x16'),_0xe3da34,_0x95c0c1);_0x1e114a(_0x95c0c1);});});}function respondWithResult(_0x3fb076,_0x28c027){_0x28c027=_0x28c027||0xc8;return function(_0x192cdf){if(_0x192cdf){return _0x3fb076[_0xd3a5('0x20')](_0x28c027)[_0xd3a5('0x21')](_0x192cdf);}};}function respondWithFilteredResult(_0x106784,_0x1196aa){return function(_0x12d388){if(_0x12d388){var _0x8b4d78=typeof _0x1196aa['offset']===_0xd3a5('0x22')&&typeof _0x1196aa[_0xd3a5('0x23')]===_0xd3a5('0x22');var _0xc8853=_0x12d388[_0xd3a5('0x24')];var _0x5964dd=_0x8b4d78?0x0:_0x1196aa['offset'];var _0xded988=_0x8b4d78?_0x12d388['count']:_0x1196aa[_0xd3a5('0x25')]+_0x1196aa[_0xd3a5('0x23')];var _0x4f086f;if(_0xded988>=_0xc8853){_0xded988=_0xc8853;_0x4f086f=0xc8;}else{_0x4f086f=0xce;}_0x106784[_0xd3a5('0x20')](_0x4f086f);return _0x106784['set'](_0xd3a5('0x26'),_0x5964dd+'-'+_0xded988+'/'+_0xc8853)[_0xd3a5('0x21')](_0x12d388);}return null;};}function saveUpdates(_0x30636e){return function(_0x558bc4){if(_0x558bc4){return _0x558bc4['update'](_0x30636e)[_0xd3a5('0x15')](function(_0x7ba35){return _0x7ba35;});}return null;};}function removeEntity(_0x4bc931){return function(_0x2e55f2){if(_0x2e55f2){return _0x2e55f2['destroy']()[_0xd3a5('0x15')](function(){_0x4bc931['status'](0xcc)[_0xd3a5('0x27')]();});}};}function handleEntityNotFound(_0x39ce60){return function(_0x4956aa){if(!_0x4956aa){_0x39ce60['sendStatus'](0x194);}return _0x4956aa;};}function handleError(_0x2db2c4,_0x3018ef){_0x3018ef=_0x3018ef||0x1f4;return function(_0x58f3b7){logger[_0xd3a5('0x1b')](_0x58f3b7[_0xd3a5('0x28')]);if(_0x58f3b7['name']){delete _0x58f3b7[_0xd3a5('0x29')];}_0x2db2c4[_0xd3a5('0x20')](_0x3018ef)['send'](_0x58f3b7);};}exports[_0xd3a5('0x2a')]=function(_0x3a1ae2,_0x486492){var _0x2a2575={},_0x43ad2e={},_0x58945b={'count':0x0,'rows':[]};var _0x322b1a=_[_0xd3a5('0x2b')](db[_0xd3a5('0x2c')][_0xd3a5('0x2d')],function(_0x25994a){return{'name':_0x25994a[_0xd3a5('0x2e')],'type':_0x25994a['type'][_0xd3a5('0x2f')]};});_0x43ad2e[_0xd3a5('0x30')]=_[_0xd3a5('0x2b')](_0x322b1a,_0xd3a5('0x29'));_0x43ad2e[_0xd3a5('0x31')]=_[_0xd3a5('0x32')](_0x3a1ae2[_0xd3a5('0x31')]);_0x43ad2e['filters']=_[_0xd3a5('0x33')](_0x43ad2e[_0xd3a5('0x30')],_0x43ad2e[_0xd3a5('0x31')]);_0x2a2575[_0xd3a5('0x34')]=_[_0xd3a5('0x33')](_0x43ad2e['model'],qs[_0xd3a5('0x35')](_0x3a1ae2[_0xd3a5('0x31')][_0xd3a5('0x35')]));_0x2a2575[_0xd3a5('0x34')]=_0x2a2575[_0xd3a5('0x34')]['length']?_0x2a2575[_0xd3a5('0x34')]:_0x43ad2e[_0xd3a5('0x30')];if(!_0x3a1ae2['query'][_0xd3a5('0x36')](_0xd3a5('0x37'))){_0x2a2575[_0xd3a5('0x23')]=qs[_0xd3a5('0x23')](_0x3a1ae2['query'][_0xd3a5('0x23')]);_0x2a2575[_0xd3a5('0x25')]=qs[_0xd3a5('0x25')](_0x3a1ae2[_0xd3a5('0x31')][_0xd3a5('0x25')]);}_0x2a2575[_0xd3a5('0x38')]=qs['sort'](_0x3a1ae2['query']['sort']);_0x2a2575[_0xd3a5('0x39')]=qs[_0xd3a5('0x3a')](_[_0xd3a5('0x3b')](_0x3a1ae2['query'],_0x43ad2e['filters']),_0x322b1a);if(_0x3a1ae2['query'][_0xd3a5('0x3c')]){_0x2a2575[_0xd3a5('0x39')]=_[_0xd3a5('0x3d')](_0x2a2575['where'],{'$or':_['map'](_0x322b1a,function(_0x2aa761){if(_0x2aa761['type']!==_0xd3a5('0x3e')){var _0x453900={};_0x453900[_0x2aa761['name']]={'$like':'%'+_0x3a1ae2['query'][_0xd3a5('0x3c')]+'%'};return _0x453900;}})});}_0x2a2575=_[_0xd3a5('0x3d')]({},_0x2a2575,_0x3a1ae2[_0xd3a5('0x3f')]);var _0x4a9901={'where':_0x2a2575[_0xd3a5('0x39')]};return db[_0xd3a5('0x2c')][_0xd3a5('0x24')](_0x4a9901)[_0xd3a5('0x15')](function(_0x4a0772){_0x58945b[_0xd3a5('0x24')]=_0x4a0772;if(_0x3a1ae2['query'][_0xd3a5('0x40')]){_0x2a2575[_0xd3a5('0x41')]=[{'all':!![]}];}return db[_0xd3a5('0x2c')]['findAll'](_0x2a2575);})[_0xd3a5('0x15')](function(_0x58cc97){_0x58945b['rows']=_0x58cc97;return _0x58945b;})[_0xd3a5('0x15')](respondWithFilteredResult(_0x486492,_0x2a2575))[_0xd3a5('0x1f')](handleError(_0x486492,null));};exports['show']=function(_0x4347f1,_0x32a85c){var _0x5a5317={'raw':!![],'where':{'id':_0x4347f1['params']['id']}},_0x185261={};_0x185261['model']=_[_0xd3a5('0x32')](db[_0xd3a5('0x2c')][_0xd3a5('0x2d')]);_0x185261[_0xd3a5('0x31')]=_[_0xd3a5('0x32')](_0x4347f1[_0xd3a5('0x31')]);_0x185261['filters']=_[_0xd3a5('0x33')](_0x185261[_0xd3a5('0x30')],_0x185261[_0xd3a5('0x31')]);_0x5a5317[_0xd3a5('0x34')]=_[_0xd3a5('0x33')](_0x185261[_0xd3a5('0x30')],qs[_0xd3a5('0x35')](_0x4347f1[_0xd3a5('0x31')][_0xd3a5('0x35')]));_0x5a5317[_0xd3a5('0x34')]=_0x5a5317[_0xd3a5('0x34')][_0xd3a5('0x42')]?_0x5a5317['attributes']:_0x185261[_0xd3a5('0x30')];if(_0x4347f1[_0xd3a5('0x31')]['includeAll']){_0x5a5317[_0xd3a5('0x41')]=[{'all':!![]}];}_0x5a5317=_[_0xd3a5('0x3d')]({},_0x5a5317,_0x4347f1[_0xd3a5('0x3f')]);return db['MailMessage']['find'](_0x5a5317)[_0xd3a5('0x15')](handleEntityNotFound(_0x32a85c,null))[_0xd3a5('0x15')](respondWithResult(_0x32a85c,null))['catch'](handleError(_0x32a85c,null));};exports[_0xd3a5('0x43')]=function(_0x50146e,_0x2d8430){if(_0x50146e[_0xd3a5('0x44')]['id']){delete _0x50146e[_0xd3a5('0x44')]['id'];}return db[_0xd3a5('0x2c')][_0xd3a5('0x45')]({'where':{'id':_0x50146e['params']['id']}})[_0xd3a5('0x15')](handleEntityNotFound(_0x2d8430,null))['then'](saveUpdates(_0x50146e[_0xd3a5('0x44')],null))[_0xd3a5('0x15')](respondWithResult(_0x2d8430,null))[_0xd3a5('0x1f')](handleError(_0x2d8430,null));};exports[_0xd3a5('0x46')]=function(_0x1f3315,_0x564c2a){return db[_0xd3a5('0x2c')][_0xd3a5('0x45')]({'where':{'id':_0x1f3315[_0xd3a5('0x47')]['id']}})[_0xd3a5('0x15')](handleEntityNotFound(_0x564c2a,null))[_0xd3a5('0x15')](removeEntity(_0x564c2a,null))['catch'](handleError(_0x564c2a,null));};exports[_0xd3a5('0x48')]=function(_0x13ff7f,_0x37ca34){return db['MailMessage'][_0xd3a5('0x48')]()['then'](respondWithResult(_0x37ca34,null))[_0xd3a5('0x1f')](handleError(_0x37ca34,null));};exports['create']=function(_0x3317cc,_0x4c6d01){return db[_0xd3a5('0x2c')][_0xd3a5('0x49')](_0x3317cc['body'])['then'](function(_0x1dfb7b){if(_0x1dfb7b){if(_0x1dfb7b[_0xd3a5('0x4a')]===_0xd3a5('0x4b')&&!_0x1dfb7b[_0xd3a5('0x4c')]){var _0x4058f2,_0x41a320,_0x392c6a;if(_0x3317cc['body']['to']){_0x41a320=_0x3317cc[_0xd3a5('0x44')]['to'][_0xd3a5('0x4d')](',')[0x0];}return db[_0xd3a5('0x4e')][_0xd3a5('0x4f')]({'where':{'id':_0x1dfb7b[_0xd3a5('0x50')]},'include':[{'model':db['CmList'],'as':_0xd3a5('0x51'),'include':[{'model':db[_0xd3a5('0x52')],'as':_0xd3a5('0x53'),'where':{'email':_0x41a320},'limit':0x1,'order':[[_0xd3a5('0x54'),_0xd3a5('0x55')]]}]},{'model':db[_0xd3a5('0x56')],'as':_0xd3a5('0x57'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xd3a5('0x58'),'raw':!![]}]}]})[_0xd3a5('0x15')](function(_0x505b9f){_0x4058f2=_0x505b9f;if(!_0x4058f2||!_0x4058f2[_0xd3a5('0x57')])return;var _0x4a1619=_0x4058f2[_0xd3a5('0x59')]();if(_0x3317cc[_0xd3a5('0x44')][_0xd3a5('0x5a')]&&_0x3317cc['body']['attachments'][_0xd3a5('0x42')]){for(var _0xb5acd5=0x0;_0xb5acd5<_0x3317cc[_0xd3a5('0x44')][_0xd3a5('0x5a')]['length'];_0xb5acd5+=0x1){_0x3317cc['body']['attachments'][_0xb5acd5]={'filename':_0x3317cc[_0xd3a5('0x44')][_0xd3a5('0x5a')][_0xb5acd5]['name'],'path':path['join'](config[_0xd3a5('0x5b')],_0xd3a5('0x5c'),_0x3317cc['body'][_0xd3a5('0x5a')][_0xb5acd5][_0xd3a5('0x5d')])};}}_0x392c6a={'account':_0x4a1619,'message':_0x3317cc['body']};return;})[_0xd3a5('0x15')](function(){if(_0x4058f2['List']){if(_0x4058f2[_0xd3a5('0x51')][_0xd3a5('0x53')]['length']){return _0x4058f2[_0xd3a5('0x51')][_0xd3a5('0x53')][0x0];}else{return db['CmContact']['create'](_['defaults'](_0x3317cc[_0xd3a5('0x44')],{'firstName':_0x3317cc['body']['to'],'email':_0x3317cc['body']['to'],'phone':_0x3317cc[_0xd3a5('0x44')]['to'],'ListId':_0x4058f2[_0xd3a5('0x5e')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xd3a5('0x15')](function(){if(_0x392c6a){return respondWithRpcPromise(_0xd3a5('0x5f'),_0xd3a5('0x60'),_0x392c6a,client9003)[_0xd3a5('0x15')](function(_0xfde7f1){return _0x1dfb7b[_0xd3a5('0x43')]({'read':!![],'messageId':_0xfde7f1['messageId'],'sentAt':moment()[_0xd3a5('0x61')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xd3a5('0x1f')](function(_0x49cb36){logger['error']('%s',JSON[_0xd3a5('0x1a')](_0x49cb36));return _0x1dfb7b;});}return _0x1dfb7b;});}return _0x1dfb7b;}})['then'](respondWithResult(_0x4c6d01,0xc9))[_0xd3a5('0x1f')](handleError(_0x4c6d01,null));};exports[_0xd3a5('0x62')]=function(_0x1f2929,_0x5eccec){var _0x27142c={'agent':{},'channel':_0xd3a5('0x63')};if(_0x1f2929['body']['id']){delete _0x1f2929['body']['id'];}_0x1f2929[_0xd3a5('0x44')]['read']=!![];_0x1f2929[_0xd3a5('0x44')][_0xd3a5('0x64')]=moment()[_0xd3a5('0x61')](_0xd3a5('0x65'));_0x1f2929[_0xd3a5('0x44')]['UserId']=_0x1f2929['body'][_0xd3a5('0x66')]||_0x1f2929[_0xd3a5('0x67')]['id'];_0x27142c[_0xd3a5('0x68')]['id']=_0x1f2929[_0xd3a5('0x44')][_0xd3a5('0x66')];return db[_0xd3a5('0x2c')]['find']({'where':{'id':_0x1f2929[_0xd3a5('0x47')]['id'],'UserId':null}})[_0xd3a5('0x15')](handleEntityNotFound(_0x5eccec,null))[_0xd3a5('0x15')](saveUpdates(_0x1f2929[_0xd3a5('0x44')],null))[_0xd3a5('0x15')](function(_0xd8e035){if(_0xd8e035){_0x27142c[_0xd3a5('0x1d')]=_0xd8e035[_0xd3a5('0x69')]({'plain':!![]});return db[_0xd3a5('0x6a')]['find']({'where':{'id':_0xd8e035[_0xd3a5('0x6b')]}});}return null;})[_0xd3a5('0x15')](handleEntityNotFound(_0x5eccec,null))['then'](function(_0x2ae434){if(_0x2ae434){return _0x2ae434[_0xd3a5('0x43')]({'UserId':_0x1f2929['body']['UserId'],'read1stAt':_[_0xd3a5('0x6c')](_0x2ae434['read1stAt'])?moment()[_0xd3a5('0x61')](_0xd3a5('0x65')):undefined});}return null;})[_0xd3a5('0x15')](function(_0x37508c){if(_0x37508c){_0x27142c[_0xd3a5('0x6d')]=_0x37508c[_0xd3a5('0x69')]({'plain':!![]});interaction_log['info'](_0xd3a5('0x6e'),_0x1f2929[_0xd3a5('0x67')]['id'],_0x1f2929[_0xd3a5('0x67')][_0xd3a5('0x29')],_0x1f2929[_0xd3a5('0x67')][_0xd3a5('0x6f')],_0x27142c['interaction']['id'],_0x1f2929['body']?JSON[_0xd3a5('0x1a')](_0x1f2929['body']):_0xd3a5('0x70'));return respondWithRpcPromise(_0xd3a5('0x71'),_0xd3a5('0x72'),_0x27142c);}return null;})[_0xd3a5('0x15')](function(_0x1aa12f){var _0x473027='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1aa12f[_0xd3a5('0x1d')]['ContactId'];return db[_0xd3a5('0x73')][_0xd3a5('0x31')](_0x473027,{'type':db[_0xd3a5('0x74')]['QueryTypes'][_0xd3a5('0x75')],'raw':!![]})[_0xd3a5('0x15')](function(_0x3e5775){return _0x3e5775;});})[_0xd3a5('0x15')](function(_0x55294d){if(_0x55294d){_0x27142c[_0xd3a5('0x1d')][_0xd3a5('0x76')]=_0x55294d[0x0];if(!_0x1f2929['body'][_0xd3a5('0x66')])return;return db['User'][_0xd3a5('0x45')]({'where':{'id':_0x1f2929[_0xd3a5('0x44')][_0xd3a5('0x66')],'role':_0xd3a5('0x68')},'attributes':['id',_0xd3a5('0x29'),'fullname','email','internal'],'raw':!![]});}return null;})[_0xd3a5('0x15')](function(_0x48ea46){if(!_0x48ea46)return null;_0x27142c[_0xd3a5('0x1d')][_0xd3a5('0x68')]=_0x48ea46;return _0x27142c;})[_0xd3a5('0x15')](function(_0x3a7b15){if(_0x3a7b15){if(_0x1f2929[_0xd3a5('0x44')][_0xd3a5('0x77')]){_0x27142c[_0xd3a5('0x1d')][_0xd3a5('0x78')]=util[_0xd3a5('0x61')](_0xd3a5('0x79'),_0x1f2929[_0xd3a5('0x67')]['name']);_0x27142c[_0xd3a5('0x1d')][_0xd3a5('0x7a')]=_0x27142c[_0xd3a5('0x7a')];_0x27142c[_0xd3a5('0x1d')][_0xd3a5('0x7b')]=_0x27142c[_0xd3a5('0x7a')];_0x27142c[_0xd3a5('0x1d')][_0xd3a5('0x7c')]=_0xd3a5('0x62');_0x27142c[_0xd3a5('0x1d')][_0xd3a5('0x44')]=htmlToText['fromString'](_0x27142c[_0xd3a5('0x1d')][_0xd3a5('0x44')]);return respondWithRpcPromise(_0xd3a5('0x7d'),_0xd3a5('0x7d'),{'event':_0xd3a5('0x7e'),'message':_0x27142c[_0xd3a5('0x1d')]},client9002)[_0xd3a5('0x15')](function(){return _0x27142c;});}return _0x27142c;}return null;})[_0xd3a5('0x15')](respondWithResult(_0x5eccec,null))[_0xd3a5('0x1f')](handleError(_0x5eccec,null));};exports[_0xd3a5('0x7f')]=function(_0x1e4b1a,_0x85aca3){var _0x25b2a7={'agent':{},'channel':_0xd3a5('0x63')};if(_0x1e4b1a[_0xd3a5('0x44')]['id']){delete _0x1e4b1a['body']['id'];}_0x1e4b1a['body'][_0xd3a5('0x66')]=_0x1e4b1a[_0xd3a5('0x44')]['UserId']||_0x1e4b1a['user']['id'];_0x25b2a7[_0xd3a5('0x68')]['id']=_0x1e4b1a[_0xd3a5('0x44')]['UserId'];return db[_0xd3a5('0x2c')]['find']({'where':{'id':_0x1e4b1a[_0xd3a5('0x47')]['id'],'UserId':null}})[_0xd3a5('0x15')](handleEntityNotFound(_0x85aca3,null))[_0xd3a5('0x15')](function(_0x4ddef6){if(_0x4ddef6){_0x25b2a7[_0xd3a5('0x1d')]=_0x4ddef6[_0xd3a5('0x69')]({'plain':!![]});return db['MailInteraction'][_0xd3a5('0x45')]({'where':{'id':_0x4ddef6[_0xd3a5('0x6b')]}});}return null;})[_0xd3a5('0x15')](handleEntityNotFound(_0x85aca3,null))['then'](function(_0x25732a){if(_0x25732a){_0x25b2a7['interaction']=_0x25732a[_0xd3a5('0x69')]({'plain':!![]});interaction_log[_0xd3a5('0x1e')](_0xd3a5('0x80'),_0x1e4b1a[_0xd3a5('0x67')]['id'],_0x1e4b1a[_0xd3a5('0x67')][_0xd3a5('0x29')],_0x1e4b1a[_0xd3a5('0x67')]['role'],_0x25b2a7[_0xd3a5('0x6d')]['id'],_0x1e4b1a['body']?JSON[_0xd3a5('0x1a')](_0x1e4b1a[_0xd3a5('0x44')]):_0xd3a5('0x70'));return respondWithRpcPromise(_0xd3a5('0x81'),_0xd3a5('0x82'),_0x25b2a7);}return null;})[_0xd3a5('0x15')](function(_0x380680){var _0x4c08bc=_0xd3a5('0x83')+_0x380680['message']['ContactId'];return db['sequelize'][_0xd3a5('0x31')](_0x4c08bc,{'type':db[_0xd3a5('0x74')][_0xd3a5('0x84')]['SELECT'],'raw':!![]})[_0xd3a5('0x15')](function(_0x1134fb){return _0x1134fb;});})['then'](function(_0x393434){if(_0x393434){_0x25b2a7['message'][_0xd3a5('0x76')]=_0x393434[0x0];if(!_0x1e4b1a['body'][_0xd3a5('0x66')])return;return db[_0xd3a5('0x85')][_0xd3a5('0x45')]({'where':{'id':_0x1e4b1a[_0xd3a5('0x44')]['UserId'],'role':_0xd3a5('0x68')},'attributes':['id',_0xd3a5('0x29'),_0xd3a5('0x86'),_0xd3a5('0x87'),_0xd3a5('0x88')],'raw':!![]});}return null;})[_0xd3a5('0x15')](function(_0x4b8204){if(!_0x4b8204)return null;_0x25b2a7[_0xd3a5('0x1d')]['agent']=_0x4b8204;return _0x25b2a7;})[_0xd3a5('0x15')](function(_0xf28993){if(_0xf28993){_0xf28993[_0xd3a5('0x1d')][_0xd3a5('0x78')]=util[_0xd3a5('0x61')](_0xd3a5('0x79'),_0x1e4b1a[_0xd3a5('0x67')][_0xd3a5('0x29')]);_0xf28993['message'][_0xd3a5('0x7a')]=_0x25b2a7[_0xd3a5('0x7a')];_0xf28993[_0xd3a5('0x1d')][_0xd3a5('0x7b')]=_0x25b2a7['channel'];_0xf28993[_0xd3a5('0x1d')]['event']=_0xd3a5('0x7f');_0xf28993[_0xd3a5('0x1d')][_0xd3a5('0x44')]=htmlToText[_0xd3a5('0x89')](_0x25b2a7[_0xd3a5('0x1d')][_0xd3a5('0x44')]);respondWithRpcPromise(_0xd3a5('0x7d'),_0xd3a5('0x7d'),{'event':_0xd3a5('0x8a'),'message':_0xf28993[_0xd3a5('0x1d')]},client9002);return _0x25b2a7;}return null;})[_0xd3a5('0x15')](respondWithResult(_0x85aca3,null))[_0xd3a5('0x1f')](handleError(_0x85aca3,null));};exports['download']=function(_0x310f79,_0x107b6a){var _0x16f2d5=moment()['unix']()[_0xd3a5('0x8b')]();var _0x3c1419=path[_0xd3a5('0x8c')](config[_0xd3a5('0x5b')],'server','files','tmp');var _0x4ef35b=path[_0xd3a5('0x8c')](config['root'],_0xd3a5('0x8d'),_0xd3a5('0x8e'),_0xd3a5('0x5a'));var _0x535e02=util['format'](_0xd3a5('0x8f'),_0x16f2d5);return db[_0xd3a5('0x2c')][_0xd3a5('0x45')]({'where':{'id':_0x310f79[_0xd3a5('0x47')]['id']},'attributes':['id',_0xd3a5('0x44'),_0xd3a5('0x90'),'to','cc','bcc',_0xd3a5('0x91'),'createdAt'],'include':_0x310f79[_0xd3a5('0x31')]['attachments']?[{'model':db[_0xd3a5('0x92')],'as':_0xd3a5('0x93')}]:undefined})[_0xd3a5('0x15')](handleEntityNotFound(_0x107b6a,null))[_0xd3a5('0x15')](function(_0x4e2eaa){if(_0x4e2eaa){var _0x2839a2=_0x4e2eaa;var _0x33e090={'from':_0x2839a2[_0xd3a5('0x90')],'to':_0x2839a2['to'],'subject':_0x2839a2[_0xd3a5('0x91')],'html':htmlEntities[_0xd3a5('0x94')](_0x2839a2[_0xd3a5('0x44')]),'headers':{'Date':moment(_0x2839a2['createdAt'])[_0xd3a5('0x61')](_0xd3a5('0x95'))},'attachments':[]};if(_0x4e2eaa['cc']){_0x33e090['headers']['Cc']=_0x4e2eaa['cc'];}if(_0x4e2eaa['bcc']){_0x33e090['headers'][_0xd3a5('0x96')]=_0x4e2eaa['bcc'];}return new BPromise(function(_0x105711,_0x347eb0){if(_0x4e2eaa['Attachments']){for(var _0x5e5583=0x0;_0x5e5583<_0x4e2eaa[_0xd3a5('0x93')][_0xd3a5('0x42')];_0x5e5583++){var _0x40f05c=_0x4e2eaa[_0xd3a5('0x93')][_0x5e5583];var _0x35a672=path[_0xd3a5('0x8c')](_0x4ef35b,_0x40f05c[_0xd3a5('0x5d')]);if(fs['existsSync'](_0x35a672)){_0x33e090[_0xd3a5('0x5a')][_0xd3a5('0x97')]({'name':_0x40f05c[_0xd3a5('0x29')],'contentType':_0x40f05c[_0xd3a5('0x98')],'data':fs[_0xd3a5('0x99')](_0x35a672)});}}}emlformat['build'](_0x33e090,function(_0x351b79,_0x55f502){if(_0x351b79)return _0x347eb0(_0x351b79);fs[_0xd3a5('0x9a')](path[_0xd3a5('0x8c')](_0x3c1419,_0x535e02),_0x55f502);return _0x105711(_0x55f502);});});}})[_0xd3a5('0x15')](function(_0x37eda6){if(_0x37eda6){return _0x107b6a['download'](path[_0xd3a5('0x8c')](_0x3c1419,_0x535e02),_0x535e02,function(_0x5d4df1){if(!_0x5d4df1)fs[_0xd3a5('0x9b')](path[_0xd3a5('0x8c')](_0x3c1419,_0x535e02));});}})[_0xd3a5('0x1f')](handleError(_0x107b6a,null));};
\ No newline at end of file
+var _0x5bbb=['ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','json','undefined','count','offset','limit','set','update','end','sendStatus','name','send','index','MailMessage','type','key','model','map','query','keys','filters','attributes','intersection','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','body','destroy','describe','create','direction','out','secret','split','MailAccount','findOne','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','attachments','root','server/files/attachments','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','Sequelize','contact','reject','EventManager','toString','join','server','files','tmp','from','bcc','subject','createdAt','Attachment','Attachments','decode'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5bbb,0xac));var _0xb5bb=function(_0x31f5fd,_0x38f456){_0x31f5fd=_0x31f5fd-0x0;var _0x2ccee4=_0x5bbb[_0x31f5fd];return _0x2ccee4;};'use strict';var emlformat=require('eml-format');var moment=require(_0xb5bb('0x0'));var BPromise=require(_0xb5bb('0x1'));var util=require(_0xb5bb('0x2'));var path=require(_0xb5bb('0x3'));var fs=require('fs');var _=require(_0xb5bb('0x4'));var Redis=require(_0xb5bb('0x5'));var htmlToText=require(_0xb5bb('0x6'));var qs=require(_0xb5bb('0x7'));var logger=require(_0xb5bb('0x8'))(_0xb5bb('0x9'));var interaction_log=require(_0xb5bb('0x8'))('mail-interactions');var config=require(_0xb5bb('0xa'));var db=require(_0xb5bb('0xb'))['db'];config['redis']=_[_0xb5bb('0xc')](config[_0xb5bb('0xd')],{'host':_0xb5bb('0xe'),'port':0x18eb});var socket=require(_0xb5bb('0xf'))(new Redis(config[_0xb5bb('0xd')]));var htmlEntities=require('html-entities');require(_0xb5bb('0x10'))[_0xb5bb('0x11')](socket);var jayson=require(_0xb5bb('0x12'));var client=jayson[_0xb5bb('0x13')]['http']({'port':0x232c});var client9003=jayson[_0xb5bb('0x13')][_0xb5bb('0x14')]({'port':0x232b});var client9002=jayson[_0xb5bb('0x13')][_0xb5bb('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x4ea6da,_0xcc7488,_0x1dd9f9,_0x1496d9){return new BPromise(function(_0x2ad6f7,_0x3731cf){var _0x451cfb=_0x1496d9||client;return _0x451cfb[_0xb5bb('0x15')](_0x4ea6da,_0x1dd9f9)[_0xb5bb('0x16')](function(_0x4a6d92){logger[_0xb5bb('0x17')](_0xb5bb('0x18'),_0xcc7488,_0xb5bb('0x19'));logger['debug'](_0xb5bb('0x1a'),_0xcc7488,_0xb5bb('0x19'),JSON[_0xb5bb('0x1b')](_0x4a6d92));if(_0x4a6d92[_0xb5bb('0x1c')]){if(_0x4a6d92[_0xb5bb('0x1c')]['code']===0x1f4){logger['error'](_0xb5bb('0x18'),_0xcc7488,_0x4a6d92[_0xb5bb('0x1c')][_0xb5bb('0x1d')]);return _0x3731cf(_0x4a6d92['error'][_0xb5bb('0x1d')]);}logger[_0xb5bb('0x1c')](_0xb5bb('0x18'),_0xcc7488,_0x4a6d92[_0xb5bb('0x1c')][_0xb5bb('0x1d')]);return _0x2ad6f7(_0x4a6d92[_0xb5bb('0x1c')][_0xb5bb('0x1d')]);}else{logger[_0xb5bb('0x17')]('MailMessage,\x20%s,\x20%s',_0xcc7488,_0xb5bb('0x19'));_0x2ad6f7(_0x4a6d92[_0xb5bb('0x1e')][_0xb5bb('0x1d')]);}})['catch'](function(_0x11d085){logger[_0xb5bb('0x1c')](_0xb5bb('0x18'),_0xcc7488,_0x11d085);_0x3731cf(_0x11d085);});});}function respondWithResult(_0x430ab1,_0x4da965){_0x4da965=_0x4da965||0xc8;return function(_0x5e9b12){if(_0x5e9b12){return _0x430ab1[_0xb5bb('0x1f')](_0x4da965)[_0xb5bb('0x20')](_0x5e9b12);}};}function respondWithFilteredResult(_0x42b986,_0x2d7150){return function(_0x3da865){if(_0x3da865){var _0x21beb5=typeof _0x2d7150['offset']==='undefined'&&typeof _0x2d7150['limit']===_0xb5bb('0x21');var _0x1791e7=_0x3da865[_0xb5bb('0x22')];var _0x43318f=_0x21beb5?0x0:_0x2d7150[_0xb5bb('0x23')];var _0x20fca2=_0x21beb5?_0x3da865['count']:_0x2d7150[_0xb5bb('0x23')]+_0x2d7150[_0xb5bb('0x24')];var _0x2a1f01;if(_0x20fca2>=_0x1791e7){_0x20fca2=_0x1791e7;_0x2a1f01=0xc8;}else{_0x2a1f01=0xce;}_0x42b986[_0xb5bb('0x1f')](_0x2a1f01);return _0x42b986[_0xb5bb('0x25')]('Content-Range',_0x43318f+'-'+_0x20fca2+'/'+_0x1791e7)[_0xb5bb('0x20')](_0x3da865);}return null;};}function saveUpdates(_0x24f56d){return function(_0x9d3083){if(_0x9d3083){return _0x9d3083[_0xb5bb('0x26')](_0x24f56d)[_0xb5bb('0x16')](function(_0x49d3bc){return _0x49d3bc;});}return null;};}function removeEntity(_0x13ff47){return function(_0x18e7ba){if(_0x18e7ba){return _0x18e7ba['destroy']()['then'](function(){_0x13ff47['status'](0xcc)[_0xb5bb('0x27')]();});}};}function handleEntityNotFound(_0x1d8201){return function(_0xaa8fee){if(!_0xaa8fee){_0x1d8201[_0xb5bb('0x28')](0x194);}return _0xaa8fee;};}function handleError(_0x2c6dba,_0x354844){_0x354844=_0x354844||0x1f4;return function(_0x3c5626){logger['error'](_0x3c5626['stack']);if(_0x3c5626['name']){delete _0x3c5626[_0xb5bb('0x29')];}_0x2c6dba[_0xb5bb('0x1f')](_0x354844)[_0xb5bb('0x2a')](_0x3c5626);};}exports[_0xb5bb('0x2b')]=function(_0x26bdf7,_0x113316){var _0x3cbe87={},_0x2f908c={},_0x37bda4={'count':0x0,'rows':[]};var _0x2301f4=_['map'](db[_0xb5bb('0x2c')]['rawAttributes'],function(_0x1658df){return{'name':_0x1658df['fieldName'],'type':_0x1658df[_0xb5bb('0x2d')][_0xb5bb('0x2e')]};});_0x2f908c[_0xb5bb('0x2f')]=_[_0xb5bb('0x30')](_0x2301f4,_0xb5bb('0x29'));_0x2f908c[_0xb5bb('0x31')]=_[_0xb5bb('0x32')](_0x26bdf7['query']);_0x2f908c[_0xb5bb('0x33')]=_['intersection'](_0x2f908c[_0xb5bb('0x2f')],_0x2f908c[_0xb5bb('0x31')]);_0x3cbe87[_0xb5bb('0x34')]=_[_0xb5bb('0x35')](_0x2f908c[_0xb5bb('0x2f')],qs['fields'](_0x26bdf7[_0xb5bb('0x31')]['fields']));_0x3cbe87['attributes']=_0x3cbe87['attributes'][_0xb5bb('0x36')]?_0x3cbe87[_0xb5bb('0x34')]:_0x2f908c[_0xb5bb('0x2f')];if(!_0x26bdf7[_0xb5bb('0x31')]['hasOwnProperty'](_0xb5bb('0x37'))){_0x3cbe87['limit']=qs[_0xb5bb('0x24')](_0x26bdf7[_0xb5bb('0x31')][_0xb5bb('0x24')]);_0x3cbe87[_0xb5bb('0x23')]=qs[_0xb5bb('0x23')](_0x26bdf7[_0xb5bb('0x31')]['offset']);}_0x3cbe87[_0xb5bb('0x38')]=qs['sort'](_0x26bdf7[_0xb5bb('0x31')][_0xb5bb('0x39')]);_0x3cbe87[_0xb5bb('0x3a')]=qs[_0xb5bb('0x33')](_[_0xb5bb('0x3b')](_0x26bdf7[_0xb5bb('0x31')],_0x2f908c['filters']),_0x2301f4);if(_0x26bdf7[_0xb5bb('0x31')][_0xb5bb('0x3c')]){_0x3cbe87['where']=_[_0xb5bb('0x3d')](_0x3cbe87[_0xb5bb('0x3a')],{'$or':_[_0xb5bb('0x30')](_0x2301f4,function(_0x110fae){if(_0x110fae[_0xb5bb('0x2d')]!==_0xb5bb('0x3e')){var _0x25d04c={};_0x25d04c[_0x110fae['name']]={'$like':'%'+_0x26bdf7[_0xb5bb('0x31')]['filter']+'%'};return _0x25d04c;}})});}_0x3cbe87=_['merge']({},_0x3cbe87,_0x26bdf7[_0xb5bb('0x3f')]);var _0x6785d2={'where':_0x3cbe87['where']};return db[_0xb5bb('0x2c')][_0xb5bb('0x22')](_0x6785d2)[_0xb5bb('0x16')](function(_0x588fbf){_0x37bda4['count']=_0x588fbf;if(_0x26bdf7[_0xb5bb('0x31')][_0xb5bb('0x40')]){_0x3cbe87[_0xb5bb('0x41')]=[{'all':!![]}];}return db[_0xb5bb('0x2c')][_0xb5bb('0x42')](_0x3cbe87);})[_0xb5bb('0x16')](function(_0xe29e02){_0x37bda4[_0xb5bb('0x43')]=_0xe29e02;return _0x37bda4;})[_0xb5bb('0x16')](respondWithFilteredResult(_0x113316,_0x3cbe87))['catch'](handleError(_0x113316,null));};exports[_0xb5bb('0x44')]=function(_0x4bb647,_0x710202){var _0x1577c5={'raw':!![],'where':{'id':_0x4bb647[_0xb5bb('0x45')]['id']}},_0x1682ad={};_0x1682ad[_0xb5bb('0x2f')]=_['keys'](db['MailMessage'][_0xb5bb('0x46')]);_0x1682ad[_0xb5bb('0x31')]=_[_0xb5bb('0x32')](_0x4bb647[_0xb5bb('0x31')]);_0x1682ad[_0xb5bb('0x33')]=_[_0xb5bb('0x35')](_0x1682ad[_0xb5bb('0x2f')],_0x1682ad[_0xb5bb('0x31')]);_0x1577c5['attributes']=_[_0xb5bb('0x35')](_0x1682ad[_0xb5bb('0x2f')],qs[_0xb5bb('0x47')](_0x4bb647[_0xb5bb('0x31')]['fields']));_0x1577c5[_0xb5bb('0x34')]=_0x1577c5[_0xb5bb('0x34')][_0xb5bb('0x36')]?_0x1577c5['attributes']:_0x1682ad[_0xb5bb('0x2f')];if(_0x4bb647[_0xb5bb('0x31')]['includeAll']){_0x1577c5[_0xb5bb('0x41')]=[{'all':!![]}];}_0x1577c5=_[_0xb5bb('0x3d')]({},_0x1577c5,_0x4bb647[_0xb5bb('0x3f')]);return db['MailMessage'][_0xb5bb('0x48')](_0x1577c5)[_0xb5bb('0x16')](handleEntityNotFound(_0x710202,null))[_0xb5bb('0x16')](respondWithResult(_0x710202,null))[_0xb5bb('0x49')](handleError(_0x710202,null));};exports[_0xb5bb('0x26')]=function(_0x6931bc,_0xd15d4d){if(_0x6931bc['body']['id']){delete _0x6931bc['body']['id'];}return db['MailMessage'][_0xb5bb('0x48')]({'where':{'id':_0x6931bc[_0xb5bb('0x45')]['id']}})[_0xb5bb('0x16')](handleEntityNotFound(_0xd15d4d,null))[_0xb5bb('0x16')](saveUpdates(_0x6931bc[_0xb5bb('0x4a')],null))[_0xb5bb('0x16')](respondWithResult(_0xd15d4d,null))[_0xb5bb('0x49')](handleError(_0xd15d4d,null));};exports[_0xb5bb('0x4b')]=function(_0x58c1cf,_0x1f8e7b){return db[_0xb5bb('0x2c')][_0xb5bb('0x48')]({'where':{'id':_0x58c1cf[_0xb5bb('0x45')]['id']}})[_0xb5bb('0x16')](handleEntityNotFound(_0x1f8e7b,null))[_0xb5bb('0x16')](removeEntity(_0x1f8e7b,null))[_0xb5bb('0x49')](handleError(_0x1f8e7b,null));};exports[_0xb5bb('0x4c')]=function(_0x174dad,_0x27053d){return db['MailMessage'][_0xb5bb('0x4c')]()[_0xb5bb('0x16')](respondWithResult(_0x27053d,null))[_0xb5bb('0x49')](handleError(_0x27053d,null));};exports[_0xb5bb('0x4d')]=function(_0x15ba6b,_0x3a5f00){return db[_0xb5bb('0x2c')][_0xb5bb('0x4d')](_0x15ba6b['body'])[_0xb5bb('0x16')](function(_0xc5f6c1){if(_0xc5f6c1){if(_0xc5f6c1[_0xb5bb('0x4e')]===_0xb5bb('0x4f')&&!_0xc5f6c1[_0xb5bb('0x50')]){var _0xaac6a,_0x133fdb,_0x47819d;if(_0x15ba6b['body']['to']){_0x133fdb=_0x15ba6b[_0xb5bb('0x4a')]['to'][_0xb5bb('0x51')](',')[0x0];}return db[_0xb5bb('0x52')][_0xb5bb('0x53')]({'where':{'id':_0xc5f6c1['MailAccountId']},'include':[{'model':db[_0xb5bb('0x54')],'as':_0xb5bb('0x55'),'include':[{'model':db[_0xb5bb('0x56')],'as':_0xb5bb('0x57'),'where':{'email':_0x133fdb},'limit':0x1,'order':[[_0xb5bb('0x58'),_0xb5bb('0x59')]]}]},{'model':db[_0xb5bb('0x5a')],'as':_0xb5bb('0x5b'),'raw':!![],'include':[{'model':db[_0xb5bb('0x5c')],'as':_0xb5bb('0x5c'),'raw':!![]}]}]})[_0xb5bb('0x16')](function(_0x40b221){_0xaac6a=_0x40b221;if(!_0xaac6a||!_0xaac6a[_0xb5bb('0x5b')])return;var _0xc30f18=_0xaac6a['getSmtpOptions']();if(_0x15ba6b[_0xb5bb('0x4a')][_0xb5bb('0x5d')]&&_0x15ba6b[_0xb5bb('0x4a')][_0xb5bb('0x5d')][_0xb5bb('0x36')]){for(var _0x2cba8f=0x0;_0x2cba8f<_0x15ba6b[_0xb5bb('0x4a')][_0xb5bb('0x5d')]['length'];_0x2cba8f+=0x1){_0x15ba6b[_0xb5bb('0x4a')][_0xb5bb('0x5d')][_0x2cba8f]={'filename':_0x15ba6b['body']['attachments'][_0x2cba8f]['name'],'path':path['join'](config[_0xb5bb('0x5e')],_0xb5bb('0x5f'),_0x15ba6b[_0xb5bb('0x4a')][_0xb5bb('0x5d')][_0x2cba8f]['basename'])};}}_0x47819d={'account':_0xc30f18,'message':_0x15ba6b[_0xb5bb('0x4a')]};return;})[_0xb5bb('0x16')](function(){if(_0xaac6a['List']){if(_0xaac6a[_0xb5bb('0x55')][_0xb5bb('0x57')][_0xb5bb('0x36')]){return _0xaac6a[_0xb5bb('0x55')][_0xb5bb('0x57')][0x0];}else{return db[_0xb5bb('0x56')][_0xb5bb('0x4d')](_[_0xb5bb('0xc')](_0x15ba6b[_0xb5bb('0x4a')],{'firstName':_0x15ba6b[_0xb5bb('0x4a')]['to'],'email':_0x15ba6b[_0xb5bb('0x4a')]['to'],'phone':_0x15ba6b[_0xb5bb('0x4a')]['to'],'ListId':_0xaac6a['ListId']}));}}else{throw new Error(_0xb5bb('0x60'));}})[_0xb5bb('0x16')](function(){if(_0x47819d){return respondWithRpcPromise(_0xb5bb('0x61'),_0xb5bb('0x62'),_0x47819d,client9003)[_0xb5bb('0x16')](function(_0x392ed5){return _0xc5f6c1[_0xb5bb('0x26')]({'read':!![],'messageId':_0x392ed5[_0xb5bb('0x63')],'sentAt':moment()[_0xb5bb('0x64')](_0xb5bb('0x65'))});})[_0xb5bb('0x49')](function(_0x341bf4){logger[_0xb5bb('0x1c')]('%s',JSON[_0xb5bb('0x1b')](_0x341bf4));return _0xc5f6c1;});}return _0xc5f6c1;});}return _0xc5f6c1;}})['then'](respondWithResult(_0x3a5f00,0xc9))[_0xb5bb('0x49')](handleError(_0x3a5f00,null));};exports[_0xb5bb('0x66')]=function(_0x4650b2,_0x55236b){var _0x38a249={'agent':{},'channel':_0xb5bb('0x67')};if(_0x4650b2['body']['id']){delete _0x4650b2[_0xb5bb('0x4a')]['id'];}_0x4650b2[_0xb5bb('0x4a')][_0xb5bb('0x68')]=!![];_0x4650b2[_0xb5bb('0x4a')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4650b2[_0xb5bb('0x4a')][_0xb5bb('0x69')]=_0x4650b2[_0xb5bb('0x4a')][_0xb5bb('0x69')]||_0x4650b2[_0xb5bb('0x6a')]['id'];_0x38a249[_0xb5bb('0x6b')]['id']=_0x4650b2[_0xb5bb('0x4a')][_0xb5bb('0x69')];return db[_0xb5bb('0x2c')][_0xb5bb('0x48')]({'where':{'id':_0x4650b2[_0xb5bb('0x45')]['id'],'UserId':null}})[_0xb5bb('0x16')](handleEntityNotFound(_0x55236b,null))[_0xb5bb('0x16')](saveUpdates(_0x4650b2[_0xb5bb('0x4a')],null))[_0xb5bb('0x16')](function(_0x170aaa){if(_0x170aaa){_0x38a249[_0xb5bb('0x1d')]=_0x170aaa[_0xb5bb('0x6c')]({'plain':!![]});return db[_0xb5bb('0x6d')][_0xb5bb('0x48')]({'where':{'id':_0x170aaa[_0xb5bb('0x6e')]}});}return null;})[_0xb5bb('0x16')](handleEntityNotFound(_0x55236b,null))[_0xb5bb('0x16')](function(_0x580dbc){if(_0x580dbc){return _0x580dbc[_0xb5bb('0x26')]({'UserId':_0x4650b2[_0xb5bb('0x4a')][_0xb5bb('0x69')],'read1stAt':_[_0xb5bb('0x6f')](_0x580dbc[_0xb5bb('0x70')])?moment()[_0xb5bb('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb5bb('0x16')](function(_0x24a62f){if(_0x24a62f){_0x38a249[_0xb5bb('0x71')]=_0x24a62f[_0xb5bb('0x6c')]({'plain':!![]});interaction_log['info'](_0xb5bb('0x72'),_0x4650b2['user']['id'],_0x4650b2['user'][_0xb5bb('0x29')],_0x4650b2[_0xb5bb('0x6a')][_0xb5bb('0x73')],_0x38a249[_0xb5bb('0x71')]['id'],_0x4650b2[_0xb5bb('0x4a')]?JSON[_0xb5bb('0x1b')](_0x4650b2[_0xb5bb('0x4a')]):_0xb5bb('0x74'));return respondWithRpcPromise(_0xb5bb('0x75'),'acceptMessage',_0x38a249);}return null;})[_0xb5bb('0x16')](function(_0x344e77){var _0x1c5319=_0xb5bb('0x76')+_0x344e77['message']['ContactId'];return db[_0xb5bb('0x77')][_0xb5bb('0x31')](_0x1c5319,{'type':db['Sequelize'][_0xb5bb('0x78')][_0xb5bb('0x79')],'raw':!![]})[_0xb5bb('0x16')](function(_0x3ed372){return _0x3ed372;});})['then'](function(_0x172c12){if(_0x172c12){_0x38a249['message']['contact']=_0x172c12[0x0];if(!_0x4650b2[_0xb5bb('0x4a')][_0xb5bb('0x69')])return;return db[_0xb5bb('0x7a')][_0xb5bb('0x48')]({'where':{'id':_0x4650b2['body'][_0xb5bb('0x69')],'role':_0xb5bb('0x6b')},'attributes':['id',_0xb5bb('0x29'),_0xb5bb('0x7b'),_0xb5bb('0x7c'),_0xb5bb('0x7d')],'raw':!![]});}return null;})['then'](function(_0x517719){if(!_0x517719)return null;_0x38a249['message'][_0xb5bb('0x6b')]=_0x517719;return _0x38a249;})['then'](function(_0x2dc6fc){if(_0x2dc6fc){if(_0x4650b2[_0xb5bb('0x4a')][_0xb5bb('0x7e')]){_0x38a249[_0xb5bb('0x1d')][_0xb5bb('0x7f')]=util[_0xb5bb('0x64')](_0xb5bb('0x80'),_0x4650b2[_0xb5bb('0x6a')]['name']);_0x38a249['message'][_0xb5bb('0x81')]=_0x38a249[_0xb5bb('0x81')];_0x38a249[_0xb5bb('0x1d')][_0xb5bb('0x82')]=_0x38a249['channel'];_0x38a249[_0xb5bb('0x1d')][_0xb5bb('0x83')]='accept';_0x38a249[_0xb5bb('0x1d')][_0xb5bb('0x4a')]=htmlToText['fromString'](_0x38a249[_0xb5bb('0x1d')][_0xb5bb('0x4a')]);return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x38a249['message']},client9002)[_0xb5bb('0x16')](function(){return _0x38a249;});}return _0x38a249;}return null;})['then'](respondWithResult(_0x55236b,null))[_0xb5bb('0x49')](handleError(_0x55236b,null));};exports['reject']=function(_0x5bf299,_0x231ff7){var _0x3638aa={'agent':{},'channel':_0xb5bb('0x67')};if(_0x5bf299[_0xb5bb('0x4a')]['id']){delete _0x5bf299[_0xb5bb('0x4a')]['id'];}_0x5bf299['body'][_0xb5bb('0x69')]=_0x5bf299[_0xb5bb('0x4a')]['UserId']||_0x5bf299[_0xb5bb('0x6a')]['id'];_0x3638aa[_0xb5bb('0x6b')]['id']=_0x5bf299[_0xb5bb('0x4a')][_0xb5bb('0x69')];return db[_0xb5bb('0x2c')][_0xb5bb('0x48')]({'where':{'id':_0x5bf299[_0xb5bb('0x45')]['id'],'UserId':null}})[_0xb5bb('0x16')](handleEntityNotFound(_0x231ff7,null))[_0xb5bb('0x16')](function(_0x368f60){if(_0x368f60){_0x3638aa[_0xb5bb('0x1d')]=_0x368f60[_0xb5bb('0x6c')]({'plain':!![]});return db[_0xb5bb('0x6d')][_0xb5bb('0x48')]({'where':{'id':_0x368f60[_0xb5bb('0x6e')]}});}return null;})[_0xb5bb('0x16')](handleEntityNotFound(_0x231ff7,null))[_0xb5bb('0x16')](function(_0x1ebaf4){if(_0x1ebaf4){_0x3638aa[_0xb5bb('0x71')]=_0x1ebaf4[_0xb5bb('0x6c')]({'plain':!![]});interaction_log[_0xb5bb('0x17')](_0xb5bb('0x84'),_0x5bf299[_0xb5bb('0x6a')]['id'],_0x5bf299[_0xb5bb('0x6a')][_0xb5bb('0x29')],_0x5bf299[_0xb5bb('0x6a')][_0xb5bb('0x73')],_0x3638aa[_0xb5bb('0x71')]['id'],_0x5bf299[_0xb5bb('0x4a')]?JSON[_0xb5bb('0x1b')](_0x5bf299[_0xb5bb('0x4a')]):_0xb5bb('0x74'));return respondWithRpcPromise(_0xb5bb('0x85'),_0xb5bb('0x86'),_0x3638aa);}return null;})[_0xb5bb('0x16')](function(_0x16cce0){var _0x11c218=_0xb5bb('0x76')+_0x16cce0[_0xb5bb('0x1d')][_0xb5bb('0x87')];return db[_0xb5bb('0x77')]['query'](_0x11c218,{'type':db[_0xb5bb('0x88')][_0xb5bb('0x78')][_0xb5bb('0x79')],'raw':!![]})['then'](function(_0x3deb6e){return _0x3deb6e;});})[_0xb5bb('0x16')](function(_0x576f1){if(_0x576f1){_0x3638aa[_0xb5bb('0x1d')][_0xb5bb('0x89')]=_0x576f1[0x0];if(!_0x5bf299[_0xb5bb('0x4a')]['UserId'])return;return db['User'][_0xb5bb('0x48')]({'where':{'id':_0x5bf299[_0xb5bb('0x4a')][_0xb5bb('0x69')],'role':_0xb5bb('0x6b')},'attributes':['id',_0xb5bb('0x29'),_0xb5bb('0x7b'),_0xb5bb('0x7c'),'internal'],'raw':!![]});}return null;})[_0xb5bb('0x16')](function(_0x1a607f){if(!_0x1a607f)return null;_0x3638aa['message'][_0xb5bb('0x6b')]=_0x1a607f;return _0x3638aa;})['then'](function(_0x5482ea){if(_0x5482ea){_0x5482ea[_0xb5bb('0x1d')][_0xb5bb('0x7f')]=util[_0xb5bb('0x64')](_0xb5bb('0x80'),_0x5bf299[_0xb5bb('0x6a')]['name']);_0x5482ea[_0xb5bb('0x1d')][_0xb5bb('0x81')]=_0x3638aa[_0xb5bb('0x81')];_0x5482ea[_0xb5bb('0x1d')][_0xb5bb('0x82')]=_0x3638aa['channel'];_0x5482ea['message']['event']=_0xb5bb('0x8a');_0x5482ea[_0xb5bb('0x1d')][_0xb5bb('0x4a')]=htmlToText['fromString'](_0x3638aa[_0xb5bb('0x1d')][_0xb5bb('0x4a')]);respondWithRpcPromise(_0xb5bb('0x8b'),'EventManager',{'event':'rejectmessage','message':_0x5482ea[_0xb5bb('0x1d')]},client9002);return _0x3638aa;}return null;})[_0xb5bb('0x16')](respondWithResult(_0x231ff7,null))['catch'](handleError(_0x231ff7,null));};exports['download']=function(_0x2a0df7,_0x50b170){var _0x3b2713=moment()['unix']()[_0xb5bb('0x8c')]();var _0x235424=path[_0xb5bb('0x8d')](config[_0xb5bb('0x5e')],_0xb5bb('0x8e'),_0xb5bb('0x8f'),_0xb5bb('0x90'));var _0x2afcf7=path[_0xb5bb('0x8d')](config[_0xb5bb('0x5e')],'server',_0xb5bb('0x8f'),_0xb5bb('0x5d'));var _0x45d805=util[_0xb5bb('0x64')]('message-%s.eml',_0x3b2713);return db[_0xb5bb('0x2c')][_0xb5bb('0x48')]({'where':{'id':_0x2a0df7[_0xb5bb('0x45')]['id']},'attributes':['id','body',_0xb5bb('0x91'),'to','cc',_0xb5bb('0x92'),_0xb5bb('0x93'),_0xb5bb('0x94')],'include':_0x2a0df7['query'][_0xb5bb('0x5d')]?[{'model':db[_0xb5bb('0x95')],'as':_0xb5bb('0x96')}]:undefined})[_0xb5bb('0x16')](handleEntityNotFound(_0x50b170,null))['then'](function(_0x7c0bfb){if(_0x7c0bfb){var _0x56358d=_0x7c0bfb;var _0x3a0025={'from':_0x56358d['from'],'to':_0x56358d['to'],'subject':_0x56358d[_0xb5bb('0x93')],'html':htmlEntities[_0xb5bb('0x97')](_0x56358d['body']),'headers':{'Date':moment(_0x56358d[_0xb5bb('0x94')])[_0xb5bb('0x64')](_0xb5bb('0x98'))},'attachments':[]};if(_0x7c0bfb['cc']){_0x3a0025[_0xb5bb('0x99')]['Cc']=_0x7c0bfb['cc'];}if(_0x7c0bfb[_0xb5bb('0x92')]){_0x3a0025[_0xb5bb('0x99')][_0xb5bb('0x9a')]=_0x7c0bfb[_0xb5bb('0x92')];}return new BPromise(function(_0x1bdf99,_0x577f27){if(_0x7c0bfb['Attachments']){for(var _0x640f97=0x0;_0x640f97<_0x7c0bfb['Attachments'][_0xb5bb('0x36')];_0x640f97++){var _0x485e32=_0x7c0bfb[_0xb5bb('0x96')][_0x640f97];var _0x204a4d=path[_0xb5bb('0x8d')](_0x2afcf7,_0x485e32[_0xb5bb('0x9b')]);if(fs[_0xb5bb('0x9c')](_0x204a4d)){_0x3a0025[_0xb5bb('0x5d')][_0xb5bb('0x9d')]({'name':_0x485e32[_0xb5bb('0x29')],'contentType':_0x485e32[_0xb5bb('0x2d')],'data':fs[_0xb5bb('0x9e')](_0x204a4d)});}}}emlformat[_0xb5bb('0x9f')](_0x3a0025,function(_0x194a8c,_0x40ed5f){if(_0x194a8c)return _0x577f27(_0x194a8c);fs[_0xb5bb('0xa0')](path[_0xb5bb('0x8d')](_0x235424,_0x45d805),_0x40ed5f);return _0x1bdf99(_0x40ed5f);});});}})[_0xb5bb('0x16')](function(_0x47d2f6){if(_0x47d2f6){return _0x50b170['download'](path[_0xb5bb('0x8d')](_0x235424,_0x45d805),_0x45d805,function(_0xd1734e){if(!_0xd1734e)fs[_0xb5bb('0xa1')](path[_0xb5bb('0x8d')](_0x235424,_0x45d805));});}})[_0xb5bb('0x49')](handleError(_0x50b170,null));};
\ No newline at end of file
index e909f2a..a959778 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x293b=['MailMessage','setMaxListeners','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x1c65f4,_0x5f4f78){var _0x206c81=function(_0x588b63){while(--_0x588b63){_0x1c65f4['push'](_0x1c65f4['shift']());}};_0x206c81(++_0x5f4f78);}(_0x293b,0x1db));var _0xb293=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x293b[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xb293('0x0'))['db'][_0xb293('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xb293('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb293('0x3')};function emitEvent(_0x132919){return function(_0x5220d8,_0x3e3fbf,_0x2d171d){MailMessageEvents[_0xb293('0x4')](_0x132919+':'+_0x5220d8['id'],_0x5220d8);MailMessageEvents[_0xb293('0x4')](_0x132919,_0x5220d8);_0x2d171d(null);};}for(var e in events){if(events[_0xb293('0x5')](e)){var event=events[e];MailMessage[_0xb293('0x6')](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
+var _0x3fee=['emit','events','save','update','remove'];(function(_0x144b30,_0x77072d){var _0x1bb7bc=function(_0x1082cc){while(--_0x1082cc){_0x144b30['push'](_0x144b30['shift']());}};_0x1bb7bc(++_0x77072d);}(_0x3fee,0x196));var _0xe3fe=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x3fee[_0x2112d4];return _0x434972;};'use strict';var EventEmitter=require(_0xe3fe('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe3fe('0x1'),'afterUpdate':_0xe3fe('0x2'),'afterDestroy':_0xe3fe('0x3')};function emitEvent(_0xa251c0){return function(_0x4834ab,_0x32ecbb,_0x297f05){MailMessageEvents[_0xe3fe('0x4')](_0xa251c0+':'+_0x4834ab['id'],_0x4834ab);MailMessageEvents['emit'](_0xa251c0,_0x4834ab);_0x297f05(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
index 07743e1..94af429 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd012=['error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','models','get','toLowerCase','direction','out','secret','isNil','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xd012,0x150));var _0x2d01=function(_0x400e66,_0x3cedb1){_0x400e66=_0x400e66-0x0;var _0x4e079d=_0xd012[_0x400e66];return _0x4e079d;};'use strict';var _=require(_0x2d01('0x0'));var util=require('util');var logger=require(_0x2d01('0x1'))(_0x2d01('0x2'));var moment=require(_0x2d01('0x3'));var BPromise=require(_0x2d01('0x4'));var rp=require(_0x2d01('0x5'));var htmlToText=require(_0x2d01('0x6'));var fs=require('fs');var path=require(_0x2d01('0x7'));var rimraf=require(_0x2d01('0x8'));var config=require(_0x2d01('0x9'));var attributes=require('./mailMessage.attributes');module[_0x2d01('0xa')]=function(_0x3cb78c,_0x5b3e13){return _0x3cb78c[_0x2d01('0xb')](_0x2d01('0xc'),attributes,{'tableName':_0x2d01('0xd'),'paranoid':![],'indexes':[{'name':_0x2d01('0xe'),'fields':[_0x2d01('0xe')]},{'name':_0x2d01('0xf'),'fields':['plainBody',_0x2d01('0x10')],'type':_0x2d01('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x7f27d5,_0x417307,_0x391d18){if(_0x7f27d5[_0x2d01('0x12')]){_0x7f27d5[_0x2d01('0x13')]=htmlToText['fromString'](_0x7f27d5['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x391d18(null,_0x417307);},'afterCreate':function(_0x3059a7,_0x283ad1,_0x5ca9b9){var _0xad51b3=_0x3cb78c[_0x2d01('0x14')];var _0x13a057=_0x3059a7[_0x2d01('0x15')]({'plain':!![]});if(_0x13a057['direction'][_0x2d01('0x16')]()==='in'||_0x13a057[_0x2d01('0x17')][_0x2d01('0x16')]()===_0x2d01('0x18')&&!_0x13a057[_0x2d01('0x19')]&&!_[_0x2d01('0x1a')](_0x13a057['UserId'])){_0xad51b3[_0x2d01('0x1b')][_0x2d01('0x1c')]({'where':{'id':_0x13a057[_0x2d01('0x1d')]}})[_0x2d01('0x1e')](function(_0x2e3ec7){if(_0x2e3ec7){_0x2e3ec7[_0x2d01('0x1f')]({'lastMsgAt':_0x13a057[_0x2d01('0x20')],'lastMsgDirection':_0x13a057['direction'][_0x2d01('0x16')]()});}})[_0x2d01('0x21')](function(_0xdeef81){console[_0x2d01('0x22')](_0xdeef81);});}_0x5ca9b9();}},'charset':_0x2d01('0x23'),'collate':_0x2d01('0x24')});};
\ No newline at end of file
+var _0xc21d=['utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','fromString','models','get','direction','toLowerCase','isNil','UserId','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4'];(function(_0x59bea5,_0x5a5ad3){var _0x387087=function(_0x440567){while(--_0x440567){_0x59bea5['push'](_0x59bea5['shift']());}};_0x387087(++_0x5a5ad3);}(_0xc21d,0x133));var _0xdc21=function(_0x52a8f0,_0x53b6d1){_0x52a8f0=_0x52a8f0-0x0;var _0x22f559=_0xc21d[_0x52a8f0];return _0x22f559;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdc21('0x0'))(_0xdc21('0x1'));var moment=require(_0xdc21('0x2'));var BPromise=require(_0xdc21('0x3'));var rp=require(_0xdc21('0x4'));var htmlToText=require(_0xdc21('0x5'));var fs=require('fs');var path=require(_0xdc21('0x6'));var rimraf=require(_0xdc21('0x7'));var config=require(_0xdc21('0x8'));var attributes=require(_0xdc21('0x9'));module[_0xdc21('0xa')]=function(_0x52188a,_0xac22f0){return _0x52188a[_0xdc21('0xb')]('MailMessage',attributes,{'tableName':_0xdc21('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xdc21('0xd')]},{'name':_0xdc21('0xe'),'fields':[_0xdc21('0xf'),_0xdc21('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x383155,_0x250f64,_0x3161a0){if(_0x383155[_0xdc21('0x11')]){_0x383155['plainBody']=htmlToText[_0xdc21('0x12')](_0x383155[_0xdc21('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3161a0(null,_0x250f64);},'afterCreate':function(_0x2d7108,_0x78af7f,_0x41dfdc){var _0x29f89c=_0x52188a[_0xdc21('0x13')];var _0x440aa9=_0x2d7108[_0xdc21('0x14')]({'plain':!![]});if(_0x440aa9[_0xdc21('0x15')][_0xdc21('0x16')]()==='in'||_0x440aa9[_0xdc21('0x15')][_0xdc21('0x16')]()==='out'&&!_0x440aa9['secret']&&!_[_0xdc21('0x17')](_0x440aa9[_0xdc21('0x18')])){_0x29f89c['MailInteraction'][_0xdc21('0x19')]({'where':{'id':_0x440aa9[_0xdc21('0x1a')]}})[_0xdc21('0x1b')](function(_0x28b2aa){if(_0x28b2aa){_0x28b2aa[_0xdc21('0x1c')]({'lastMsgAt':_0x440aa9[_0xdc21('0x1d')],'lastMsgDirection':_0x440aa9[_0xdc21('0x15')][_0xdc21('0x16')]()});}})[_0xdc21('0x1e')](function(_0x164af6){console[_0xdc21('0x1f')](_0x164af6);});}_0x41dfdc();}},'charset':_0xdc21('0x20'),'collate':_0xdc21('0x21')});};
\ No newline at end of file
index b9af904..93b825b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed3c=['request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateMailMessage','MailMessage','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','localhost','register'];(function(_0x4ff73e,_0x50503d){var _0x1d25ea=function(_0x31e36c){while(--_0x31e36c){_0x4ff73e['push'](_0x4ff73e['shift']());}};_0x1d25ea(++_0x50503d);}(_0xed3c,0x1a6));var _0xced3=function(_0x4937b2,_0x2599cf){_0x4937b2=_0x4937b2-0x0;var _0x8da2fb=_0xed3c[_0x4937b2];return _0x8da2fb;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));var BPromise=require(_0xced3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced3('0x4'));var db=require(_0xced3('0x5'))['db'];var utils=require(_0xced3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xced3('0x7'));var jayson=require(_0xced3('0x8'));var client=jayson[_0xced3('0x9')][_0xced3('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xced3('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailMessage.socket')[_0xced3('0xc')](socket);function respondWithRpcPromise(_0x321c42,_0x3e5a04,_0x12612f){return new BPromise(function(_0x1cb639,_0x5934b2){return client[_0xced3('0xd')](_0x321c42,_0x12612f)[_0xced3('0xe')](function(_0x3da0ff){logger['info'](_0xced3('0xf'),_0x3e5a04,_0xced3('0x10'));logger[_0xced3('0x11')](_0xced3('0x12'),_0x3e5a04,_0xced3('0x10'),JSON[_0xced3('0x13')](_0x3da0ff));if(_0x3da0ff[_0xced3('0x14')]){if(_0x3da0ff['error'][_0xced3('0x15')]===0x1f4){logger['error'](_0xced3('0xf'),_0x3e5a04,_0x3da0ff[_0xced3('0x14')][_0xced3('0x16')]);return _0x5934b2(_0x3da0ff[_0xced3('0x14')]['message']);}logger[_0xced3('0x14')](_0xced3('0xf'),_0x3e5a04,_0x3da0ff['error'][_0xced3('0x16')]);return _0x1cb639(_0x3da0ff[_0xced3('0x14')][_0xced3('0x16')]);}else{logger[_0xced3('0x17')]('MailMessage,\x20%s,\x20%s',_0x3e5a04,_0xced3('0x10'));_0x1cb639(_0x3da0ff['result'][_0xced3('0x16')]);}})[_0xced3('0x18')](function(_0x32c402){logger[_0xced3('0x14')](_0xced3('0xf'),_0x3e5a04,_0x32c402);_0x5934b2(_0x32c402);});});}exports[_0xced3('0x19')]=function(_0xe0cf2e){var _0x16d30d=this;return new Promise(function(_0x3f688c,_0x17c011){return db[_0xced3('0x1a')]['create'](_0xe0cf2e['body'],{'raw':_0xe0cf2e['options']?_0xe0cf2e[_0xced3('0x1b')][_0xced3('0x1c')]===undefined?!![]:![]:!![]})[_0xced3('0xe')](function(_0x4bf915){logger[_0xced3('0x17')](_0xced3('0x19'),_0xe0cf2e);logger['debug']('CreateMailMessage',_0xe0cf2e,JSON[_0xced3('0x13')](_0x4bf915));_0x3f688c(_0x4bf915);})[_0xced3('0x18')](function(_0x219fa8){logger[_0xced3('0x14')]('CreateMailMessage',_0x219fa8[_0xced3('0x16')],_0xe0cf2e);_0x17c011(_0x16d30d[_0xced3('0x14')](0x1f4,_0x219fa8['message']));});});};
\ No newline at end of file
+var _0x0abf=['MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info'];(function(_0x44d487,_0x13ba53){var _0x2a01ee=function(_0x40b3d6){while(--_0x40b3d6){_0x44d487['push'](_0x44d487['shift']());}};_0x2a01ee(++_0x13ba53);}(_0x0abf,0xe8));var _0xf0ab=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0abf[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});config[_0xf0ab('0xa')]=_['defaults'](config[_0xf0ab('0xa')],{'host':_0xf0ab('0xb'),'port':0x18eb});var socket=require(_0xf0ab('0xc'))(new Redis(config[_0xf0ab('0xa')]));require('./mailMessage.socket')[_0xf0ab('0xd')](socket);function respondWithRpcPromise(_0x4688d8,_0x1e7887,_0x4ab8e7){return new BPromise(function(_0x5d25a0,_0x30042c){return client['request'](_0x4688d8,_0x4ab8e7)[_0xf0ab('0xe')](function(_0x10a5a2){logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));logger[_0xf0ab('0x12')](_0xf0ab('0x13'),_0x1e7887,'request\x20sent',JSON[_0xf0ab('0x14')](_0x10a5a2));if(_0x10a5a2[_0xf0ab('0x15')]){if(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x16')]===0x1f4){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x30042c(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);}logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x5d25a0(_0x10a5a2[_0xf0ab('0x15')]['message']);}else{logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));_0x5d25a0(_0x10a5a2[_0xf0ab('0x18')][_0xf0ab('0x17')]);}})[_0xf0ab('0x19')](function(_0x3a0edf){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x3a0edf);_0x30042c(_0x3a0edf);});});}exports[_0xf0ab('0x1a')]=function(_0x715579){var _0xdfcfb2=this;return new Promise(function(_0xf43bc4,_0x22a205){return db[_0xf0ab('0x1b')][_0xf0ab('0x1c')](_0x715579['body'],{'raw':_0x715579[_0xf0ab('0x1d')]?_0x715579[_0xf0ab('0x1d')][_0xf0ab('0x1e')]===undefined?!![]:![]:!![]})[_0xf0ab('0xe')](function(_0x3bf6a1){logger[_0xf0ab('0xf')](_0xf0ab('0x1a'),_0x715579);logger[_0xf0ab('0x12')](_0xf0ab('0x1a'),_0x715579,JSON[_0xf0ab('0x14')](_0x3bf6a1));_0xf43bc4(_0x3bf6a1);})[_0xf0ab('0x19')](function(_0x5645b2){logger['error']('CreateMailMessage',_0x5645b2[_0xf0ab('0x17')],_0x715579);_0x22a205(_0xdfcfb2['error'](0x1f4,_0x5645b2[_0xf0ab('0x17')]));});});};
\ No newline at end of file
index 0740f41..c6c7d04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12cc=['remove','update','length','mailMessage:','save'];(function(_0x1a79cd,_0xe527ac){var _0xe29138=function(_0x1afc5f){while(--_0x1afc5f){_0x1a79cd['push'](_0x1a79cd['shift']());}};_0xe29138(++_0xe527ac);}(_0x12cc,0xc2));var _0xc12c=function(_0x58a0f9,_0x25a8a7){_0x58a0f9=_0x58a0f9-0x0;var _0x1906a0=_0x12cc[_0x58a0f9];return _0x1906a0;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xc12c('0x0'),_0xc12c('0x1'),_0xc12c('0x2')];function createListener(_0x1a575d,_0x6719fc){return function(_0x554e98){_0x6719fc['emit'](_0x1a575d,_0x554e98);};}function removeListener(_0x3e773c,_0x914c7e){return function(){MailMessageEvents['removeListener'](_0x3e773c,_0x914c7e);};}exports['register']=function(_0x4990f4){for(var _0x152fcd=0x0,_0x1c0435=events[_0xc12c('0x3')];_0x152fcd<_0x1c0435;_0x152fcd++){var _0x52017f=events[_0x152fcd];var _0x488940=createListener(_0xc12c('0x4')+_0x52017f,_0x4990f4);MailMessageEvents['on'](_0x52017f,_0x488940);}};
\ No newline at end of file
+var _0xad2c=['mailMessage:','save','remove','removeListener','register','length'];(function(_0x481342,_0x14d1e7){var _0x314c27=function(_0x335ff3){while(--_0x335ff3){_0x481342['push'](_0x481342['shift']());}};_0x314c27(++_0x14d1e7);}(_0xad2c,0x1c3));var _0xcad2=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xad2c[_0x3b380d];return _0x54502b;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xcad2('0x0'),_0xcad2('0x1'),'update'];function createListener(_0x41aa08,_0x10824e){return function(_0x370644){_0x10824e['emit'](_0x41aa08,_0x370644);};}function removeListener(_0x4cdb54,_0x1d63d9){return function(){MailMessageEvents[_0xcad2('0x2')](_0x4cdb54,_0x1d63d9);};}exports[_0xcad2('0x3')]=function(_0x123efe){for(var _0x38eb1a=0x0,_0xa8562=events[_0xcad2('0x4')];_0x38eb1a<_0xa8562;_0x38eb1a++){var _0x172a62=events[_0x38eb1a];var _0x3044a9=createListener(_0xcad2('0x5')+_0x172a62,_0x123efe);MailMessageEvents['on'](_0x172a62,_0x3044a9);}};
\ No newline at end of file
index 36ad896..3225d9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1716=['/:id/users','getAgents','create','post','put','update','delete','destroy','removeTeams','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','describe','get','/:id','show','/:id/members','getMembers','/:id/teams'];(function(_0x5ebb1c,_0x44ccd2){var _0xe71985=function(_0x4ea1b8){while(--_0x4ea1b8){_0x5ebb1c['push'](_0x5ebb1c['shift']());}};_0xe71985(++_0x44ccd2);}(_0x1716,0xac));var _0x6171=function(_0x4e6ed4,_0x5e772f){_0x4e6ed4=_0x4e6ed4-0x0;var _0xcb6d61=_0x1716[_0x4e6ed4];return _0xcb6d61;};'use strict';var multer=require(_0x6171('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6171('0x1'));var express=require(_0x6171('0x2'));var router=express[_0x6171('0x3')]();var fs_extra=require(_0x6171('0x4'));var auth=require(_0x6171('0x5'));var interaction=require(_0x6171('0x6'));var config=require(_0x6171('0x7'));var controller=require(_0x6171('0x8'));router['get']('/',auth[_0x6171('0x9')](),controller['index']);router['get']('/describe',auth[_0x6171('0x9')](),controller[_0x6171('0xa')]);router[_0x6171('0xb')](_0x6171('0xc'),auth[_0x6171('0x9')](),controller[_0x6171('0xd')]);router[_0x6171('0xb')](_0x6171('0xe'),auth['isAuthenticated'](),controller[_0x6171('0xf')]);router[_0x6171('0xb')](_0x6171('0x10'),auth[_0x6171('0x9')](),controller['getTeams']);router[_0x6171('0xb')](_0x6171('0x11'),auth[_0x6171('0x9')](),controller[_0x6171('0x12')]);router['post']('/',auth[_0x6171('0x9')](),controller[_0x6171('0x13')]);router[_0x6171('0x14')]('/:id/teams',auth[_0x6171('0x9')](),controller['addTeams']);router[_0x6171('0x14')]('/:id/users',auth[_0x6171('0x9')](),controller['addAgents']);router[_0x6171('0x15')]('/:id',auth[_0x6171('0x9')](),controller[_0x6171('0x16')]);router[_0x6171('0x17')](_0x6171('0xc'),auth[_0x6171('0x9')](),controller[_0x6171('0x18')]);router['delete'](_0x6171('0x10'),auth[_0x6171('0x9')](),controller[_0x6171('0x19')]);router[_0x6171('0x17')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x6171('0x1a')]=router;
\ No newline at end of file
+var _0x5e05=['/describe','/:id','show','/:id/members','getMembers','/:id/teams','post','create','/:id/users','delete','destroy','removeTeams','exports','path','express','Router','fs-extra','../../config/environment','./mailQueue.controller','isAuthenticated','get'];(function(_0x569485,_0x2df4bc){var _0x1d2d10=function(_0x4d6f74){while(--_0x4d6f74){_0x569485['push'](_0x569485['shift']());}};_0x1d2d10(++_0x2df4bc);}(_0x5e05,0x11e));var _0x55e0=function(_0x156455,_0x46a4a9){_0x156455=_0x156455-0x0;var _0x46aa93=_0x5e05[_0x156455];return _0x46aa93;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x55e0('0x0'));var timeout=require('connect-timeout');var express=require(_0x55e0('0x1'));var router=express[_0x55e0('0x2')]();var fs_extra=require(_0x55e0('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x55e0('0x4'));var controller=require(_0x55e0('0x5'));router['get']('/',auth[_0x55e0('0x6')](),controller['index']);router[_0x55e0('0x7')](_0x55e0('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x55e0('0x7')](_0x55e0('0x9'),auth[_0x55e0('0x6')](),controller[_0x55e0('0xa')]);router['get'](_0x55e0('0xb'),auth['isAuthenticated'](),controller[_0x55e0('0xc')]);router['get'](_0x55e0('0xd'),auth[_0x55e0('0x6')](),controller['getTeams']);router[_0x55e0('0x7')]('/:id/users',auth[_0x55e0('0x6')](),controller['getAgents']);router[_0x55e0('0xe')]('/',auth[_0x55e0('0x6')](),controller[_0x55e0('0xf')]);router[_0x55e0('0xe')]('/:id/teams',auth[_0x55e0('0x6')](),controller['addTeams']);router[_0x55e0('0xe')](_0x55e0('0x10'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x55e0('0x9'),auth[_0x55e0('0x6')](),controller['update']);router[_0x55e0('0x11')]('/:id',auth[_0x55e0('0x6')](),controller[_0x55e0('0x12')]);router['delete'](_0x55e0('0xd'),auth[_0x55e0('0x6')](),controller[_0x55e0('0x13')]);router['delete'](_0x55e0('0x10'),auth[_0x55e0('0x6')](),controller['removeAgents']);module[_0x55e0('0x14')]=router;
\ No newline at end of file
index fe80b1d..ba6f554 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d22=['name','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x2b34b5,_0x125643){var _0x4ed08c=function(_0x24ddcb){while(--_0x24ddcb){_0x2b34b5['push'](_0x2b34b5['shift']());}};_0x4ed08c(++_0x125643);}(_0x3d22,0xcf));var _0x23d2=function(_0x25311b,_0x3366cf){_0x25311b=_0x25311b-0x0;var _0x158b12=_0x3d22[_0x25311b];return _0x158b12;};'use strict';var Sequelize=require(_0x23d2('0x0'));module[_0x23d2('0x1')]={'name':{'type':Sequelize[_0x23d2('0x2')],'unique':_0x23d2('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x23d2('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x23d2('0x4'),_0x23d2('0x5'),'roundrobin')}};
\ No newline at end of file
+var _0x69c4=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory'];(function(_0x4d3f3d,_0x1c44f6){var _0x3e3e5d=function(_0x59c2af){while(--_0x59c2af){_0x4d3f3d['push'](_0x4d3f3d['shift']());}};_0x3e3e5d(++_0x1c44f6);}(_0x69c4,0xfd));var _0x469c=function(_0x5a8899,_0x1f77fc){_0x5a8899=_0x5a8899-0x0;var _0xda0126=_0x69c4[_0x5a8899];return _0xda0126;};'use strict';var Sequelize=require(_0x469c('0x0'));module[_0x469c('0x1')]={'name':{'type':Sequelize[_0x469c('0x2')],'unique':_0x469c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x469c('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x469c('0x4')](_0x469c('0x5'),'beepall',_0x469c('0x6'))}};
\ No newline at end of file
index 11e9a7b..6090797 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a9b=['ids','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','userMailQueue:save','removeTeams','Agents','select','field','from','team_has_mail_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','union','compact','value','isEmpty','removeAgents','forEach','emit','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register','status','end','json','offset','limit','undefined','count','set','reject','then','destroy','MailQueues','UserProfileResource','sendStatus','error','stack','name','index','map','MailQueue','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserMailQueue','MailQueueId','findAll','User','findAndCountAll','agent','mailPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','pick','addTeams'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a9b,0x1b3));var _0xb5a9=function(_0x456037,_0x5c1308){_0x456037=_0x456037-0x0;var _0x2a2721=_0x5a9b[_0x456037];return _0x2a2721;};'use strict';var emlformat=require(_0xb5a9('0x0'));var rimraf=require(_0xb5a9('0x1'));var zipdir=require(_0xb5a9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb5a9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb5a9('0x4'));var util=require('util');var path=require(_0xb5a9('0x5'));var sox=require(_0xb5a9('0x6'));var csv=require('to-csv');var ejs=require(_0xb5a9('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb5a9('0x8'));var squel=require(_0xb5a9('0x9'));var crypto=require(_0xb5a9('0xa'));var jsforce=require(_0xb5a9('0xb'));var deskjs=require(_0xb5a9('0xc'));var toCsv=require(_0xb5a9('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb5a9('0xe'));var qs=require(_0xb5a9('0xf'));var as=require(_0xb5a9('0x10'));var hardwareService=require(_0xb5a9('0x11'));var logger=require(_0xb5a9('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb5a9('0x13'));var db=require(_0xb5a9('0x14'))['db'];config[_0xb5a9('0x15')]=_[_0xb5a9('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb5a9('0x17'))(new Redis(config[_0xb5a9('0x15')]));require(_0xb5a9('0x18'))[_0xb5a9('0x19')](socket);function respondWithStatusCode(_0x27115a,_0x46e4ef){_0x46e4ef=_0x46e4ef||0xcc;return function(_0x823382){if(_0x823382){return _0x27115a['sendStatus'](_0x46e4ef);}return _0x27115a[_0xb5a9('0x1a')](_0x46e4ef)[_0xb5a9('0x1b')]();};}function respondWithResult(_0x315a98,_0x42ddee){_0x42ddee=_0x42ddee||0xc8;return function(_0x3f8d34){if(_0x3f8d34){return _0x315a98[_0xb5a9('0x1a')](_0x42ddee)[_0xb5a9('0x1c')](_0x3f8d34);}};}function respondWithFilteredResult(_0x1c8138,_0x3a32b6){return function(_0x596802){if(_0x596802){var _0x7db56=typeof _0x3a32b6[_0xb5a9('0x1d')]==='undefined'&&typeof _0x3a32b6[_0xb5a9('0x1e')]===_0xb5a9('0x1f');var _0x80394a=_0x596802[_0xb5a9('0x20')];var _0x2726fa=_0x7db56?0x0:_0x3a32b6[_0xb5a9('0x1d')];var _0x17552b=_0x7db56?_0x596802[_0xb5a9('0x20')]:_0x3a32b6['offset']+_0x3a32b6[_0xb5a9('0x1e')];var _0x2c8d46;if(_0x17552b>=_0x80394a){_0x17552b=_0x80394a;_0x2c8d46=0xc8;}else{_0x2c8d46=0xce;}_0x1c8138[_0xb5a9('0x1a')](_0x2c8d46);return _0x1c8138[_0xb5a9('0x21')]('Content-Range',_0x2726fa+'-'+_0x17552b+'/'+_0x80394a)[_0xb5a9('0x1c')](_0x596802);}return null;};}function patchUpdates(_0x13f702){return function(_0x509769){try{jsonpatch['apply'](_0x509769,_0x13f702,!![]);}catch(_0x40a8d7){return BPromise[_0xb5a9('0x22')](_0x40a8d7);}return _0x509769['save']();};}function saveUpdates(_0x4b17bb,_0x1d971d){return function(_0x520318){if(_0x520318){return _0x520318['update'](_0x4b17bb)[_0xb5a9('0x23')](function(_0x108854){return _0x108854;});}return null;};}function removeEntity(_0x18b3d2,_0x1ba541){return function(_0x4a0759){if(_0x4a0759){return _0x4a0759[_0xb5a9('0x24')]()[_0xb5a9('0x23')](function(){var _0x17eee6=_0x4a0759['get']({'plain':!![]});var _0x135155=_0xb5a9('0x25');return db[_0xb5a9('0x26')][_0xb5a9('0x24')]({'where':{'type':_0x135155,'resourceId':_0x17eee6['id']}})[_0xb5a9('0x23')](function(){return _0x4a0759;});})['then'](function(){_0x18b3d2[_0xb5a9('0x1a')](0xcc)[_0xb5a9('0x1b')]();});}};}function handleEntityNotFound(_0x594bf3,_0x41fde6){return function(_0x5c9215){if(!_0x5c9215){_0x594bf3[_0xb5a9('0x27')](0x194);}return _0x5c9215;};}function handleError(_0x4f2f4a,_0x297b0f){_0x297b0f=_0x297b0f||0x1f4;return function(_0xf2597e){logger[_0xb5a9('0x28')](_0xf2597e[_0xb5a9('0x29')]);if(_0xf2597e[_0xb5a9('0x2a')]){delete _0xf2597e[_0xb5a9('0x2a')];}_0x4f2f4a[_0xb5a9('0x1a')](_0x297b0f)['send'](_0xf2597e);};}exports[_0xb5a9('0x2b')]=function(_0x2f9837,_0x29743a){var _0x3004dc={},_0x33c278={},_0x34d2a9={'count':0x0,'rows':[]};var _0x463e37=_[_0xb5a9('0x2c')](db[_0xb5a9('0x2d')][_0xb5a9('0x2e')],function(_0x2a5a0d){return{'name':_0x2a5a0d[_0xb5a9('0x2f')],'type':_0x2a5a0d[_0xb5a9('0x30')]['key']};});_0x33c278[_0xb5a9('0x31')]=_[_0xb5a9('0x2c')](_0x463e37,'name');_0x33c278[_0xb5a9('0x32')]=_[_0xb5a9('0x33')](_0x2f9837[_0xb5a9('0x32')]);_0x33c278[_0xb5a9('0x34')]=_['intersection'](_0x33c278[_0xb5a9('0x31')],_0x33c278['query']);_0x3004dc[_0xb5a9('0x35')]=_[_0xb5a9('0x36')](_0x33c278[_0xb5a9('0x31')],qs['fields'](_0x2f9837[_0xb5a9('0x32')][_0xb5a9('0x37')]));_0x3004dc['attributes']=_0x3004dc['attributes'][_0xb5a9('0x38')]?_0x3004dc['attributes']:_0x33c278[_0xb5a9('0x31')];if(!_0x2f9837[_0xb5a9('0x32')][_0xb5a9('0x39')](_0xb5a9('0x3a'))){_0x3004dc[_0xb5a9('0x1e')]=qs[_0xb5a9('0x1e')](_0x2f9837['query'][_0xb5a9('0x1e')]);_0x3004dc['offset']=qs[_0xb5a9('0x1d')](_0x2f9837['query']['offset']);}_0x3004dc[_0xb5a9('0x3b')]=qs[_0xb5a9('0x3c')](_0x2f9837[_0xb5a9('0x32')][_0xb5a9('0x3c')]);_0x3004dc[_0xb5a9('0x3d')]=qs[_0xb5a9('0x34')](_['pick'](_0x2f9837[_0xb5a9('0x32')],_0x33c278[_0xb5a9('0x34')]),_0x463e37);if(_0x2f9837[_0xb5a9('0x32')][_0xb5a9('0x3e')]){_0x3004dc['where']=_[_0xb5a9('0x3f')](_0x3004dc[_0xb5a9('0x3d')],{'$or':_['map'](_0x463e37,function(_0x140b7e){if(_0x140b7e['type']!==_0xb5a9('0x40')){var _0x5185be={};_0x5185be[_0x140b7e[_0xb5a9('0x2a')]]={'$like':'%'+_0x2f9837[_0xb5a9('0x32')]['filter']+'%'};return _0x5185be;}})});}_0x3004dc=_[_0xb5a9('0x3f')]({},_0x3004dc,_0x2f9837[_0xb5a9('0x41')]);var _0x122d7e={'where':_0x3004dc[_0xb5a9('0x3d')]};return db['MailQueue'][_0xb5a9('0x20')](_0x122d7e)['then'](function(_0x2e6519){_0x34d2a9[_0xb5a9('0x20')]=_0x2e6519;if(_0x2f9837[_0xb5a9('0x32')][_0xb5a9('0x42')]){_0x3004dc[_0xb5a9('0x43')]=[{'all':!![]}];}return db[_0xb5a9('0x2d')]['findAll'](_0x3004dc);})[_0xb5a9('0x23')](function(_0x395225){_0x34d2a9[_0xb5a9('0x44')]=_0x395225;return _0x34d2a9;})[_0xb5a9('0x23')](respondWithFilteredResult(_0x29743a,_0x3004dc))[_0xb5a9('0x45')](handleError(_0x29743a,null));};exports['show']=function(_0x4e754c,_0x4f0aec){var _0x1db19d={'raw':!![],'where':{'id':_0x4e754c['params']['id']}},_0x88e80c={};_0x88e80c['model']=_['keys'](db[_0xb5a9('0x2d')][_0xb5a9('0x2e')]);_0x88e80c[_0xb5a9('0x32')]=_[_0xb5a9('0x33')](_0x4e754c[_0xb5a9('0x32')]);_0x88e80c[_0xb5a9('0x34')]=_[_0xb5a9('0x36')](_0x88e80c[_0xb5a9('0x31')],_0x88e80c[_0xb5a9('0x32')]);_0x1db19d[_0xb5a9('0x35')]=_[_0xb5a9('0x36')](_0x88e80c[_0xb5a9('0x31')],qs['fields'](_0x4e754c['query'][_0xb5a9('0x37')]));_0x1db19d[_0xb5a9('0x35')]=_0x1db19d[_0xb5a9('0x35')]['length']?_0x1db19d[_0xb5a9('0x35')]:_0x88e80c['model'];if(_0x4e754c['query'][_0xb5a9('0x42')]){_0x1db19d[_0xb5a9('0x43')]=[{'all':!![]}];}_0x1db19d=_['merge']({},_0x1db19d,_0x4e754c[_0xb5a9('0x41')]);return db[_0xb5a9('0x2d')][_0xb5a9('0x46')](_0x1db19d)[_0xb5a9('0x23')](handleEntityNotFound(_0x4f0aec,null))[_0xb5a9('0x23')](respondWithResult(_0x4f0aec,null))[_0xb5a9('0x45')](handleError(_0x4f0aec,null));};exports['create']=function(_0x2b918c,_0x504048){return db['MailQueue'][_0xb5a9('0x47')](_0x2b918c[_0xb5a9('0x48')],{})[_0xb5a9('0x23')](function(_0x23349a){var _0x3ef27c=_0x2b918c[_0xb5a9('0x49')][_0xb5a9('0x4a')]({'plain':!![]});if(!_0x3ef27c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ef27c['role']===_0xb5a9('0x49')){var _0xd978b8=_0x23349a[_0xb5a9('0x4a')]({'plain':!![]});var _0x1cefac=_0xb5a9('0x25');return db[_0xb5a9('0x4b')]['find']({'where':{'name':_0x1cefac,'userProfileId':_0x3ef27c['userProfileId']},'raw':!![]})[_0xb5a9('0x23')](function(_0x2d9922){if(_0x2d9922&&_0x2d9922[_0xb5a9('0x4c')]===0x0){return db[_0xb5a9('0x26')][_0xb5a9('0x47')]({'name':_0xd978b8[_0xb5a9('0x2a')],'resourceId':_0xd978b8['id'],'type':_0x2d9922['name'],'sectionId':_0x2d9922['id']},{})[_0xb5a9('0x23')](function(){return _0x23349a;});}else{return _0x23349a;}})[_0xb5a9('0x45')](function(_0x4184e8){logger[_0xb5a9('0x28')](_0xb5a9('0x4d'),_0x4184e8);throw _0x4184e8;});}return _0x23349a;})['then'](respondWithResult(_0x504048,0xc9))['catch'](handleError(_0x504048,null));};exports['update']=function(_0x4db28e,_0x455cab){if(_0x4db28e[_0xb5a9('0x48')]['id']){delete _0x4db28e['body']['id'];}return db['MailQueue']['find']({'where':{'id':_0x4db28e[_0xb5a9('0x4e')]['id']}})[_0xb5a9('0x23')](handleEntityNotFound(_0x455cab,null))[_0xb5a9('0x23')](saveUpdates(_0x4db28e[_0xb5a9('0x48')],null))['then'](respondWithResult(_0x455cab,null))[_0xb5a9('0x45')](handleError(_0x455cab,null));};exports[_0xb5a9('0x24')]=function(_0x203a13,_0x11a151){return db[_0xb5a9('0x2d')][_0xb5a9('0x46')]({'where':{'id':_0x203a13[_0xb5a9('0x4e')]['id']}})[_0xb5a9('0x23')](handleEntityNotFound(_0x11a151,null))[_0xb5a9('0x23')](removeEntity(_0x11a151,null))['catch'](handleError(_0x11a151,null));};exports[_0xb5a9('0x4f')]=function(_0x9a2766,_0x1d1f6f){return db[_0xb5a9('0x2d')][_0xb5a9('0x4f')]()['then'](respondWithResult(_0x1d1f6f,null))[_0xb5a9('0x45')](handleError(_0x1d1f6f,null));};exports['getMembers']=function(_0x11b5e0,_0x313ffa,_0x220e0e){var _0x39663c={'raw':!![],'where':{}},_0x17a809={},_0x40155c;return db[_0xb5a9('0x2d')][_0xb5a9('0x50')]({'where':{'id':_0x11b5e0[_0xb5a9('0x4e')]['id']}})[_0xb5a9('0x23')](handleEntityNotFound(_0x313ffa,null))[_0xb5a9('0x23')](function(_0x52721e){if(_0x52721e){_0x40155c=_0x52721e[_0xb5a9('0x4a')]({'plain':!![]});_0x17a809['model']=_[_0xb5a9('0x33')](db[_0xb5a9('0x51')][_0xb5a9('0x2e')]);_0x17a809[_0xb5a9('0x32')]=_[_0xb5a9('0x33')](_0x11b5e0[_0xb5a9('0x32')]);_0x17a809[_0xb5a9('0x34')]=_[_0xb5a9('0x36')](_0x17a809[_0xb5a9('0x31')],_0x17a809[_0xb5a9('0x32')]);_0x39663c[_0xb5a9('0x35')]=_['intersection'](_0x17a809[_0xb5a9('0x31')],qs['fields'](_0x11b5e0[_0xb5a9('0x32')][_0xb5a9('0x37')]));_0x39663c[_0xb5a9('0x35')]=_0x39663c['attributes'][_0xb5a9('0x38')]?_0x39663c[_0xb5a9('0x35')]:_0x17a809[_0xb5a9('0x31')];if(!_0x11b5e0[_0xb5a9('0x32')][_0xb5a9('0x39')]('nolimit')){_0x39663c[_0xb5a9('0x1e')]=qs[_0xb5a9('0x1e')](_0x11b5e0[_0xb5a9('0x32')]['limit']);_0x39663c[_0xb5a9('0x1d')]=qs[_0xb5a9('0x1d')](_0x11b5e0['query'][_0xb5a9('0x1d')]);}_0x39663c[_0xb5a9('0x3b')]=qs['sort'](_0x11b5e0[_0xb5a9('0x32')][_0xb5a9('0x3c')]);_0x39663c[_0xb5a9('0x3d')]=qs[_0xb5a9('0x34')](_['pick'](_0x11b5e0['query'],_0x17a809[_0xb5a9('0x34')]));_0x39663c[_0xb5a9('0x3d')][_0xb5a9('0x52')]=_0x52721e['id'];if(_0x11b5e0[_0xb5a9('0x32')][_0xb5a9('0x3e')]){_0x39663c[_0xb5a9('0x3d')]=_[_0xb5a9('0x3f')](_0x39663c[_0xb5a9('0x3d')],{'$or':_[_0xb5a9('0x2c')](_0x39663c['attributes'],function(_0xe352b1){var _0x3517c3={};_0x3517c3[_0xe352b1]={'$like':'%'+_0x11b5e0[_0xb5a9('0x32')][_0xb5a9('0x3e')]+'%'};return _0x3517c3;})});}_0x39663c=_[_0xb5a9('0x3f')]({},_0x39663c,_0x11b5e0[_0xb5a9('0x41')]);return db[_0xb5a9('0x51')][_0xb5a9('0x53')](_0x39663c);}})[_0xb5a9('0x23')](function(_0x296ba3){if(_0x296ba3){return db[_0xb5a9('0x54')][_0xb5a9('0x55')]({'where':{'id':_['map'](_0x296ba3,'UserId'),'role':_0xb5a9('0x56')},'attributes':['id','name',_0xb5a9('0x57'),'updatedAt',_0xb5a9('0x58')]});}})[_0xb5a9('0x23')](function(_0x5a9015){if(_0x5a9015){return{'count':_0x5a9015[_0xb5a9('0x20')],'rows':_[_0xb5a9('0x2c')](_0x5a9015[_0xb5a9('0x44')],function(_0x353399){return{'membername':_0x353399[_0xb5a9('0x2a')],'UserId':_0x353399['id'],'queue_name':_0x40155c['name'],'MailQueueId':_0x40155c['id'],'interface':util[_0xb5a9('0x59')](_0xb5a9('0x5a'),_0xb5a9('0x5b'),_0x353399[_0xb5a9('0x2a')]),'penalty':0x0,'paused':_0x353399[_0xb5a9('0x57')],'createdAt':_0x353399['createdAt'],'updatedAt':_0x353399[_0xb5a9('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb5a9('0x23')](respondWithFilteredResult(_0x313ffa,_0x39663c))[_0xb5a9('0x45')](handleError(_0x313ffa,null));};exports[_0xb5a9('0x5d')]=function(_0x337bac,_0x4b4902,_0x52ae4d){var _0x5b1d79={};var _0x51902c={};var _0x47d392;var _0x5be0b5;return db[_0xb5a9('0x2d')][_0xb5a9('0x50')]({'where':{'id':_0x337bac[_0xb5a9('0x4e')]['id']}})[_0xb5a9('0x23')](handleEntityNotFound(_0x4b4902,null))[_0xb5a9('0x23')](function(_0x30d12b){if(_0x30d12b){_0x47d392=_0x30d12b;_0x51902c['model']=_[_0xb5a9('0x33')](db[_0xb5a9('0x5e')][_0xb5a9('0x2e')]);_0x51902c[_0xb5a9('0x32')]=_[_0xb5a9('0x33')](_0x337bac[_0xb5a9('0x32')]);_0x51902c['filters']=_[_0xb5a9('0x36')](_0x51902c[_0xb5a9('0x31')],_0x51902c['query']);_0x5b1d79['attributes']=_[_0xb5a9('0x36')](_0x51902c['model'],qs['fields'](_0x337bac['query'][_0xb5a9('0x37')]));_0x5b1d79['attributes']=_0x5b1d79['attributes'][_0xb5a9('0x38')]?_0x5b1d79[_0xb5a9('0x35')]:_0x51902c['model'];_0x5b1d79[_0xb5a9('0x3b')]=qs[_0xb5a9('0x3c')](_0x337bac[_0xb5a9('0x32')][_0xb5a9('0x3c')]);_0x5b1d79[_0xb5a9('0x3d')]=qs['filters'](_[_0xb5a9('0x5f')](_0x337bac[_0xb5a9('0x32')],_0x51902c[_0xb5a9('0x34')]));if(_0x337bac[_0xb5a9('0x32')][_0xb5a9('0x3e')]){_0x5b1d79[_0xb5a9('0x3d')]=_[_0xb5a9('0x3f')](_0x5b1d79[_0xb5a9('0x3d')],{'$or':_[_0xb5a9('0x2c')](_0x5b1d79['attributes'],function(_0x307538){var _0x41cbf1={};_0x41cbf1[_0x307538]={'$like':'%'+_0x337bac[_0xb5a9('0x32')][_0xb5a9('0x3e')]+'%'};return _0x41cbf1;})});}_0x5b1d79=_[_0xb5a9('0x3f')]({},_0x5b1d79,_0x337bac['options']);return _0x47d392['getTeams'](_0x5b1d79);}})[_0xb5a9('0x23')](function(_0x3d01a5){if(_0x3d01a5){_0x5be0b5=_0x3d01a5[_0xb5a9('0x38')];if(!_0x337bac[_0xb5a9('0x32')][_0xb5a9('0x39')]('nolimit')){_0x5b1d79['limit']=qs[_0xb5a9('0x1e')](_0x337bac[_0xb5a9('0x32')]['limit']);_0x5b1d79[_0xb5a9('0x1d')]=qs[_0xb5a9('0x1d')](_0x337bac[_0xb5a9('0x32')][_0xb5a9('0x1d')]);}return _0x47d392[_0xb5a9('0x5d')](_0x5b1d79);}})['then'](function(_0xa9733a){if(_0xa9733a){return _0xa9733a?{'count':_0x5be0b5,'rows':_0xa9733a}:null;}})[_0xb5a9('0x23')](respondWithResult(_0x4b4902,null))['catch'](handleError(_0x4b4902,null));};exports[_0xb5a9('0x60')]=function(_0x482986,_0x25fe1e,_0x28f480){var _0x519c14=_0x482986[_0xb5a9('0x48')][_0xb5a9('0x61')];return db[_0xb5a9('0x5e')]['findAll']({'where':{'id':_0x519c14},'attributes':['id'],'include':[{'model':db[_0xb5a9('0x54')],'as':'Agents','attributes':['id','name',_0xb5a9('0x62'),_0xb5a9('0x63'),'interface'],'raw':!![]}]})[_0xb5a9('0x23')](function(_0x3a722a){if(_0x3a722a){var _0x3ff338=_[_0xb5a9('0x64')](_0x3a722a,function(_0x4cc987){var _0x3e656c=_0x4cc987[_0xb5a9('0x4a')]({'plain':!![]});return _0x3e656c['Agents'];});return db['MailQueue'][_0xb5a9('0x46')]({'where':{'id':_0x482986['params']['id']}})['then'](function(_0x3c5cbc){return db[_0xb5a9('0x65')][_0xb5a9('0x66')](function(_0xb37d00){return _0x3c5cbc[_0xb5a9('0x60')](_0x519c14,{'transaction':_0xb37d00})[_0xb5a9('0x23')](function(){return BPromise[_0xb5a9('0x67')](_0x3ff338,function(_0x32c252){return db[_0xb5a9('0x51')][_0xb5a9('0x68')]({'where':{'UserId':_0x32c252['id'],'MailQueueId':_0x482986[_0xb5a9('0x4e')]['id']},'transaction':_0xb37d00});});})[_0xb5a9('0x23')](function(){_0x3ff338['forEach'](function(_0x25a67e){socket['emit'](_0xb5a9('0x69'),{'UserId':_0x25a67e['id'],'MailQueueId':_0x3c5cbc['id']});});});});});}})[_0xb5a9('0x23')](respondWithStatusCode(_0x25fe1e,null))[_0xb5a9('0x45')](handleError(_0x25fe1e,null));};exports[_0xb5a9('0x6a')]=function(_0x121eb9,_0x4e9d36,_0x12665a){return db[_0xb5a9('0x5e')]['findAll']({'where':{'id':_0x121eb9['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xb5a9('0x54')],'as':_0xb5a9('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xb5a9('0x23')](handleEntityNotFound(_0x4e9d36,null))[_0xb5a9('0x23')](function(_0x5165b9){var _0x1e4260=_[_0xb5a9('0x2c')](_0x5165b9,'id');var _0x306ab3=[];var _0x43e3b4=[];var _0x27b3f7=squel[_0xb5a9('0x6c')]();_0x27b3f7[_0xb5a9('0x6d')]('tq.TeamId')[_0xb5a9('0x6e')](_0xb5a9('0x6f'),'tq')[_0xb5a9('0x70')](_0xb5a9('0x71'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb5a9('0x3d')]('MailQueueId\x20=\x20?',_0x121eb9[_0xb5a9('0x4e')]['id']);for(var _0x619aac=0x0;_0x619aac<_0x5165b9[_0xb5a9('0x38')];_0x619aac+=0x1){let _0x136186=_0x5165b9[_0x619aac];for(var _0x2ea961=0x0;_0x2ea961<_0x136186[_0xb5a9('0x6b')][_0xb5a9('0x38')];_0x2ea961+=0x1){let _0x2a11d0=_0x136186[_0xb5a9('0x6b')][_0x2ea961];var _0x163318=_0x27b3f7['clone']();_0x163318['where'](_0xb5a9('0x72'),_0x2a11d0['id']);_0x43e3b4[_0xb5a9('0x73')](db[_0xb5a9('0x65')][_0xb5a9('0x32')](_0x163318[_0xb5a9('0x74')](),{'type':db[_0xb5a9('0x65')][_0xb5a9('0x75')]['SELECT']})[_0xb5a9('0x23')](function(_0x223f81){if(_0x223f81[_0xb5a9('0x38')]===0x1){return _0x2a11d0['id'];}else{var _0x38b492=_[_0xb5a9('0x76')](_[_0xb5a9('0x2c')](_0x223f81,'TeamId'),function(_0x3be092){return _[_0xb5a9('0x77')](_0x1e4260,_0x3be092);});if(_0x38b492){return _0x2a11d0['id'];}}}));}}return BPromise['all'](_0x43e3b4)[_0xb5a9('0x23')](function(_0x4f3d29){_0x306ab3=_(_0x306ab3)[_0xb5a9('0x78')](_0x4f3d29)[_0xb5a9('0x79')]()[_0xb5a9('0x7a')]();return db['MailQueue'][_0xb5a9('0x46')]({'where':{'id':_0x121eb9[_0xb5a9('0x4e')]['id']}})[_0xb5a9('0x23')](function(_0x21ba03){return db['sequelize'][_0xb5a9('0x66')](function(_0x5d5e08){return _0x21ba03[_0xb5a9('0x6a')](_0x121eb9[_0xb5a9('0x32')][_0xb5a9('0x61')],{'transaction':_0x5d5e08})[_0xb5a9('0x23')](function(){if(!_[_0xb5a9('0x7b')](_0x306ab3)){return _0x21ba03[_0xb5a9('0x7c')](_0x306ab3,{'transaction':_0x5d5e08});}})[_0xb5a9('0x23')](function(){_0x306ab3[_0xb5a9('0x7d')](function(_0x10a6af){socket[_0xb5a9('0x7e')]('userMailQueue:remove',{'UserId':_0x10a6af,'MailQueueId':_0x21ba03['id']});});});});});});})['then'](respondWithStatusCode(_0x4e9d36,null))[_0xb5a9('0x45')](handleError(_0x4e9d36,null));};exports[_0xb5a9('0x7f')]=function(_0x15fd3c,_0x43343b,_0x5607fa){return db[_0xb5a9('0x2d')][_0xb5a9('0x46')]({'where':{'id':_0x15fd3c['params']['id']}})[_0xb5a9('0x23')](handleEntityNotFound(_0x43343b,null))[_0xb5a9('0x23')](function(_0x274dad){if(_0x274dad){return _0x274dad[_0xb5a9('0x7f')](_0x15fd3c[_0xb5a9('0x48')][_0xb5a9('0x61')],_[_0xb5a9('0x80')](_0x15fd3c[_0xb5a9('0x48')],[_0xb5a9('0x61'),'id'])||{})[_0xb5a9('0x81')](function(_0x5c347d){for(var _0x32f984=0x0;_0x32f984<_0x15fd3c[_0xb5a9('0x48')][_0xb5a9('0x61')]['length'];_0x32f984+=0x1){socket[_0xb5a9('0x7e')]('userMailQueue:save',{'UserId':Number(_0x15fd3c['body'][_0xb5a9('0x61')][_0x32f984]),'MailQueueId':Number(_0x15fd3c[_0xb5a9('0x4e')]['id'])});}return _0x5c347d;});}})[_0xb5a9('0x23')](respondWithResult(_0x43343b,null))['catch'](handleError(_0x43343b,null));};exports[_0xb5a9('0x7c')]=function(_0x495b2d,_0xf14ddd,_0x53a9c1){return db[_0xb5a9('0x2d')][_0xb5a9('0x46')]({'where':{'id':_0x495b2d[_0xb5a9('0x4e')]['id']}})[_0xb5a9('0x23')](handleEntityNotFound(_0xf14ddd,null))['then'](function(_0x1ec5da){if(_0x1ec5da){return _0x1ec5da[_0xb5a9('0x7c')](_0x495b2d[_0xb5a9('0x32')]['ids'])[_0xb5a9('0x23')](function(){if(_[_0xb5a9('0x82')](_0x495b2d[_0xb5a9('0x32')][_0xb5a9('0x61')])){for(var _0x49fdda=0x0;_0x49fdda<_0x495b2d[_0xb5a9('0x32')][_0xb5a9('0x61')][_0xb5a9('0x38')];_0x49fdda+=0x1){socket['emit'](_0xb5a9('0x83'),{'UserId':Number(_0x495b2d['query'][_0xb5a9('0x61')][_0x49fdda]),'MailQueueId':Number(_0x495b2d['params']['id'])});}}else{socket[_0xb5a9('0x7e')](_0xb5a9('0x83'),{'UserId':Number(_0x495b2d['query']['ids']),'MailQueueId':Number(_0x495b2d[_0xb5a9('0x4e')]['id'])});}});}})[_0xb5a9('0x23')](respondWithStatusCode(_0xf14ddd,null))[_0xb5a9('0x45')](handleError(_0xf14ddd,null));};exports['getAgents']=function(_0x3546f9,_0x5f490e,_0x25c39c){var _0x3abc07={};var _0x47eb54={};var _0x80a062;var _0xe63166;return db[_0xb5a9('0x2d')][_0xb5a9('0x50')]({'where':{'id':_0x3546f9[_0xb5a9('0x4e')]['id']}})[_0xb5a9('0x23')](handleEntityNotFound(_0x5f490e,null))[_0xb5a9('0x23')](function(_0x49abc2){if(_0x49abc2){_0x80a062=_0x49abc2;_0x47eb54[_0xb5a9('0x31')]=_[_0xb5a9('0x33')](db[_0xb5a9('0x54')][_0xb5a9('0x2e')]);_0x47eb54[_0xb5a9('0x32')]=_[_0xb5a9('0x33')](_0x3546f9[_0xb5a9('0x32')]);_0x47eb54[_0xb5a9('0x34')]=_['intersection'](_0x47eb54[_0xb5a9('0x31')],_0x47eb54[_0xb5a9('0x32')]);_0x3abc07['attributes']=_[_0xb5a9('0x36')](_0x47eb54[_0xb5a9('0x31')],qs[_0xb5a9('0x37')](_0x3546f9[_0xb5a9('0x32')][_0xb5a9('0x37')]));_0x3abc07[_0xb5a9('0x35')]=_0x3abc07['attributes'][_0xb5a9('0x38')]?_0x3abc07[_0xb5a9('0x35')]:_0x47eb54[_0xb5a9('0x31')];_0x3abc07[_0xb5a9('0x3b')]=qs[_0xb5a9('0x3c')](_0x3546f9[_0xb5a9('0x32')][_0xb5a9('0x3c')]);_0x3abc07[_0xb5a9('0x3d')]=qs[_0xb5a9('0x34')](_[_0xb5a9('0x5f')](_0x3546f9[_0xb5a9('0x32')],_0x47eb54[_0xb5a9('0x34')]));if(_0x3546f9[_0xb5a9('0x32')][_0xb5a9('0x3e')]){_0x3abc07[_0xb5a9('0x3d')]=_[_0xb5a9('0x3f')](_0x3abc07[_0xb5a9('0x3d')],{'$or':_[_0xb5a9('0x2c')](_0x3abc07['attributes'],function(_0x4d7663){var _0x2d8080={};_0x2d8080[_0x4d7663]={'$like':'%'+_0x3546f9[_0xb5a9('0x32')]['filter']+'%'};return _0x2d8080;})});}_0x3abc07=_[_0xb5a9('0x3f')]({},_0x3abc07,_0x3546f9[_0xb5a9('0x41')]);return _0x80a062[_0xb5a9('0x84')](_0x3abc07);}})[_0xb5a9('0x23')](function(_0x3600a5){if(_0x3600a5){_0xe63166=_0x3600a5[_0xb5a9('0x38')];if(!_0x3546f9['query']['hasOwnProperty']('nolimit')){_0x3abc07[_0xb5a9('0x1e')]=qs[_0xb5a9('0x1e')](_0x3546f9[_0xb5a9('0x32')][_0xb5a9('0x1e')]);_0x3abc07[_0xb5a9('0x1d')]=qs['offset'](_0x3546f9[_0xb5a9('0x32')][_0xb5a9('0x1d')]);}return _0x80a062['getAgents'](_0x3abc07);}})['then'](function(_0x233fd6){if(_0x233fd6){return _0x233fd6?{'count':_0xe63166,'rows':_0x233fd6}:null;}})[_0xb5a9('0x23')](respondWithResult(_0x5f490e,null))[_0xb5a9('0x45')](handleError(_0x5f490e,null));};
\ No newline at end of file
+var _0x3066=['findAll','catch','show','include','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','params','describe','findOne','UserMailQueue','order','MailQueueId','User','agent','mailPause','createdAt','rows','format','%s/%s','getTeams','Team','ids','voicePause','flatMap','sequelize','transaction','each','forEach','userMailQueue:save','select','field','tq.TeamId','team_has_mail_queues','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','Agents','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','all','union','compact','value','removeTeams','isEmpty','removeAgents','emit','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','MailQueue'];(function(_0x2af502,_0x175595){var _0x5a9700=function(_0x377d95){while(--_0x377d95){_0x2af502['push'](_0x2af502['shift']());}};_0x5a9700(++_0x175595);}(_0x3066,0x156));var _0x6306=function(_0x27a8b6,_0x3a500d){_0x27a8b6=_0x27a8b6-0x0;var _0x331215=_0x3066[_0x27a8b6];return _0x331215;};'use strict';var emlformat=require(_0x6306('0x0'));var rimraf=require(_0x6306('0x1'));var zipdir=require(_0x6306('0x2'));var jsonpatch=require(_0x6306('0x3'));var rp=require(_0x6306('0x4'));var moment=require(_0x6306('0x5'));var BPromise=require(_0x6306('0x6'));var Mustache=require(_0x6306('0x7'));var util=require(_0x6306('0x8'));var path=require(_0x6306('0x9'));var sox=require(_0x6306('0xa'));var csv=require(_0x6306('0xb'));var ejs=require(_0x6306('0xc'));var fs=require('fs');var fs_extra=require(_0x6306('0xd'));var _=require(_0x6306('0xe'));var squel=require(_0x6306('0xf'));var crypto=require(_0x6306('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x6306('0x11'));var toCsv=require(_0x6306('0xb'));var querystring=require(_0x6306('0x12'));var Papa=require(_0x6306('0x13'));var Redis=require(_0x6306('0x14'));var authService=require(_0x6306('0x15'));var qs=require(_0x6306('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6306('0x17'));var logger=require(_0x6306('0x18'))('api');var utils=require(_0x6306('0x19'));var config=require(_0x6306('0x1a'));var licenseUtil=require(_0x6306('0x1b'));var db=require(_0x6306('0x1c'))['db'];config[_0x6306('0x1d')]=_[_0x6306('0x1e')](config[_0x6306('0x1d')],{'host':_0x6306('0x1f'),'port':0x18eb});var socket=require(_0x6306('0x20'))(new Redis(config['redis']));require(_0x6306('0x21'))['register'](socket);function respondWithStatusCode(_0x46c298,_0x3e0036){_0x3e0036=_0x3e0036||0xcc;return function(_0x2513f7){if(_0x2513f7){return _0x46c298[_0x6306('0x22')](_0x3e0036);}return _0x46c298[_0x6306('0x23')](_0x3e0036)[_0x6306('0x24')]();};}function respondWithResult(_0x5670be,_0x423098){_0x423098=_0x423098||0xc8;return function(_0x2c831e){if(_0x2c831e){return _0x5670be[_0x6306('0x23')](_0x423098)[_0x6306('0x25')](_0x2c831e);}};}function respondWithFilteredResult(_0x4bafdc,_0x2f45ab){return function(_0x11a3bd){if(_0x11a3bd){var _0x125f05=typeof _0x2f45ab[_0x6306('0x26')]===_0x6306('0x27')&&typeof _0x2f45ab['limit']===_0x6306('0x27');var _0x3152bf=_0x11a3bd['count'];var _0x4afd7f=_0x125f05?0x0:_0x2f45ab[_0x6306('0x26')];var _0x345889=_0x125f05?_0x11a3bd[_0x6306('0x28')]:_0x2f45ab[_0x6306('0x26')]+_0x2f45ab[_0x6306('0x29')];var _0x1650b8;if(_0x345889>=_0x3152bf){_0x345889=_0x3152bf;_0x1650b8=0xc8;}else{_0x1650b8=0xce;}_0x4bafdc[_0x6306('0x23')](_0x1650b8);return _0x4bafdc['set'](_0x6306('0x2a'),_0x4afd7f+'-'+_0x345889+'/'+_0x3152bf)['json'](_0x11a3bd);}return null;};}function patchUpdates(_0x2d9095){return function(_0x134780){try{jsonpatch['apply'](_0x134780,_0x2d9095,!![]);}catch(_0x7de74b){return BPromise['reject'](_0x7de74b);}return _0x134780[_0x6306('0x2b')]();};}function saveUpdates(_0x4c0505,_0x1cff3e){return function(_0x20e7e0){if(_0x20e7e0){return _0x20e7e0[_0x6306('0x2c')](_0x4c0505)[_0x6306('0x2d')](function(_0x341abe){return _0x341abe;});}return null;};}function removeEntity(_0x2e0217,_0x52e11d){return function(_0x3e07eb){if(_0x3e07eb){return _0x3e07eb[_0x6306('0x2e')]()[_0x6306('0x2d')](function(){var _0x54f524=_0x3e07eb['get']({'plain':!![]});var _0x1372dc='MailQueues';return db[_0x6306('0x2f')][_0x6306('0x2e')]({'where':{'type':_0x1372dc,'resourceId':_0x54f524['id']}})[_0x6306('0x2d')](function(){return _0x3e07eb;});})[_0x6306('0x2d')](function(){_0x2e0217[_0x6306('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb20f3b,_0xbd8fcd){return function(_0x2591ad){if(!_0x2591ad){_0xb20f3b[_0x6306('0x22')](0x194);}return _0x2591ad;};}function handleError(_0x42f991,_0x5c3308){_0x5c3308=_0x5c3308||0x1f4;return function(_0x506a52){logger[_0x6306('0x30')](_0x506a52[_0x6306('0x31')]);if(_0x506a52['name']){delete _0x506a52[_0x6306('0x32')];}_0x42f991[_0x6306('0x23')](_0x5c3308)[_0x6306('0x33')](_0x506a52);};}exports[_0x6306('0x34')]=function(_0x4ae156,_0x316a76){var _0x43ea11={},_0x510380={},_0x388359={'count':0x0,'rows':[]};var _0x23178a=_[_0x6306('0x35')](db['MailQueue'][_0x6306('0x36')],function(_0x4fc508){return{'name':_0x4fc508['fieldName'],'type':_0x4fc508[_0x6306('0x37')]['key']};});_0x510380[_0x6306('0x38')]=_[_0x6306('0x35')](_0x23178a,_0x6306('0x32'));_0x510380[_0x6306('0x39')]=_[_0x6306('0x3a')](_0x4ae156[_0x6306('0x39')]);_0x510380['filters']=_['intersection'](_0x510380['model'],_0x510380[_0x6306('0x39')]);_0x43ea11[_0x6306('0x3b')]=_[_0x6306('0x3c')](_0x510380[_0x6306('0x38')],qs[_0x6306('0x3d')](_0x4ae156[_0x6306('0x39')][_0x6306('0x3d')]));_0x43ea11['attributes']=_0x43ea11[_0x6306('0x3b')][_0x6306('0x3e')]?_0x43ea11[_0x6306('0x3b')]:_0x510380[_0x6306('0x38')];if(!_0x4ae156[_0x6306('0x39')][_0x6306('0x3f')](_0x6306('0x40'))){_0x43ea11['limit']=qs[_0x6306('0x29')](_0x4ae156[_0x6306('0x39')][_0x6306('0x29')]);_0x43ea11[_0x6306('0x26')]=qs['offset'](_0x4ae156[_0x6306('0x39')][_0x6306('0x26')]);}_0x43ea11['order']=qs[_0x6306('0x41')](_0x4ae156[_0x6306('0x39')][_0x6306('0x41')]);_0x43ea11[_0x6306('0x42')]=qs[_0x6306('0x43')](_[_0x6306('0x44')](_0x4ae156[_0x6306('0x39')],_0x510380[_0x6306('0x43')]),_0x23178a);if(_0x4ae156['query'][_0x6306('0x45')]){_0x43ea11[_0x6306('0x42')]=_[_0x6306('0x46')](_0x43ea11['where'],{'$or':_[_0x6306('0x35')](_0x23178a,function(_0x503c52){if(_0x503c52[_0x6306('0x37')]!==_0x6306('0x47')){var _0x3f8e80={};_0x3f8e80[_0x503c52[_0x6306('0x32')]]={'$like':'%'+_0x4ae156[_0x6306('0x39')][_0x6306('0x45')]+'%'};return _0x3f8e80;}})});}_0x43ea11=_[_0x6306('0x46')]({},_0x43ea11,_0x4ae156[_0x6306('0x48')]);var _0x18eb54={'where':_0x43ea11[_0x6306('0x42')]};return db['MailQueue'][_0x6306('0x28')](_0x18eb54)[_0x6306('0x2d')](function(_0xf508ad){_0x388359[_0x6306('0x28')]=_0xf508ad;if(_0x4ae156['query'][_0x6306('0x49')]){_0x43ea11['include']=[{'all':!![]}];}return db[_0x6306('0x4a')][_0x6306('0x4b')](_0x43ea11);})[_0x6306('0x2d')](function(_0x4e8a50){_0x388359['rows']=_0x4e8a50;return _0x388359;})[_0x6306('0x2d')](respondWithFilteredResult(_0x316a76,_0x43ea11))[_0x6306('0x4c')](handleError(_0x316a76,null));};exports[_0x6306('0x4d')]=function(_0x1cd05b,_0x323629){var _0x1046d4={'raw':!![],'where':{'id':_0x1cd05b['params']['id']}},_0x2f9811={};_0x2f9811[_0x6306('0x38')]=_['keys'](db['MailQueue'][_0x6306('0x36')]);_0x2f9811[_0x6306('0x39')]=_['keys'](_0x1cd05b[_0x6306('0x39')]);_0x2f9811[_0x6306('0x43')]=_[_0x6306('0x3c')](_0x2f9811[_0x6306('0x38')],_0x2f9811[_0x6306('0x39')]);_0x1046d4[_0x6306('0x3b')]=_[_0x6306('0x3c')](_0x2f9811['model'],qs[_0x6306('0x3d')](_0x1cd05b['query'][_0x6306('0x3d')]));_0x1046d4[_0x6306('0x3b')]=_0x1046d4['attributes'][_0x6306('0x3e')]?_0x1046d4[_0x6306('0x3b')]:_0x2f9811[_0x6306('0x38')];if(_0x1cd05b[_0x6306('0x39')][_0x6306('0x49')]){_0x1046d4[_0x6306('0x4e')]=[{'all':!![]}];}_0x1046d4=_[_0x6306('0x46')]({},_0x1046d4,_0x1cd05b[_0x6306('0x48')]);return db['MailQueue'][_0x6306('0x4f')](_0x1046d4)['then'](handleEntityNotFound(_0x323629,null))[_0x6306('0x2d')](respondWithResult(_0x323629,null))[_0x6306('0x4c')](handleError(_0x323629,null));};exports[_0x6306('0x50')]=function(_0x717406,_0x3a34e9){return db[_0x6306('0x4a')][_0x6306('0x50')](_0x717406[_0x6306('0x51')],{})[_0x6306('0x2d')](function(_0x35cce7){var _0x49555e=_0x717406[_0x6306('0x52')][_0x6306('0x53')]({'plain':!![]});if(!_0x49555e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49555e[_0x6306('0x54')]===_0x6306('0x52')){var _0x72e531=_0x35cce7[_0x6306('0x53')]({'plain':!![]});var _0x4da793='MailQueues';return db[_0x6306('0x55')]['find']({'where':{'name':_0x4da793,'userProfileId':_0x49555e[_0x6306('0x56')]},'raw':!![]})[_0x6306('0x2d')](function(_0x1b135){if(_0x1b135&&_0x1b135[_0x6306('0x57')]===0x0){return db[_0x6306('0x2f')][_0x6306('0x50')]({'name':_0x72e531[_0x6306('0x32')],'resourceId':_0x72e531['id'],'type':_0x1b135['name'],'sectionId':_0x1b135['id']},{})['then'](function(){return _0x35cce7;});}else{return _0x35cce7;}})[_0x6306('0x4c')](function(_0x118344){logger[_0x6306('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x118344);throw _0x118344;});}return _0x35cce7;})['then'](respondWithResult(_0x3a34e9,0xc9))[_0x6306('0x4c')](handleError(_0x3a34e9,null));};exports['update']=function(_0x276c58,_0x128627){if(_0x276c58[_0x6306('0x51')]['id']){delete _0x276c58[_0x6306('0x51')]['id'];}return db[_0x6306('0x4a')][_0x6306('0x4f')]({'where':{'id':_0x276c58[_0x6306('0x58')]['id']}})[_0x6306('0x2d')](handleEntityNotFound(_0x128627,null))[_0x6306('0x2d')](saveUpdates(_0x276c58['body'],null))[_0x6306('0x2d')](respondWithResult(_0x128627,null))['catch'](handleError(_0x128627,null));};exports[_0x6306('0x2e')]=function(_0x33120d,_0x5d3d57){return db[_0x6306('0x4a')]['find']({'where':{'id':_0x33120d['params']['id']}})[_0x6306('0x2d')](handleEntityNotFound(_0x5d3d57,null))[_0x6306('0x2d')](removeEntity(_0x5d3d57,null))[_0x6306('0x4c')](handleError(_0x5d3d57,null));};exports[_0x6306('0x59')]=function(_0x16889c,_0x59f1bc){return db[_0x6306('0x4a')][_0x6306('0x59')]()[_0x6306('0x2d')](respondWithResult(_0x59f1bc,null))[_0x6306('0x4c')](handleError(_0x59f1bc,null));};exports['getMembers']=function(_0x39d4b8,_0x1474de,_0x5964f5){var _0x3d17e3={'raw':!![],'where':{}},_0xe6f3c3={},_0x363561;return db['MailQueue'][_0x6306('0x5a')]({'where':{'id':_0x39d4b8[_0x6306('0x58')]['id']}})[_0x6306('0x2d')](handleEntityNotFound(_0x1474de,null))[_0x6306('0x2d')](function(_0x394ee3){if(_0x394ee3){_0x363561=_0x394ee3[_0x6306('0x53')]({'plain':!![]});_0xe6f3c3[_0x6306('0x38')]=_[_0x6306('0x3a')](db[_0x6306('0x5b')][_0x6306('0x36')]);_0xe6f3c3[_0x6306('0x39')]=_[_0x6306('0x3a')](_0x39d4b8[_0x6306('0x39')]);_0xe6f3c3[_0x6306('0x43')]=_['intersection'](_0xe6f3c3['model'],_0xe6f3c3[_0x6306('0x39')]);_0x3d17e3[_0x6306('0x3b')]=_[_0x6306('0x3c')](_0xe6f3c3[_0x6306('0x38')],qs[_0x6306('0x3d')](_0x39d4b8['query'][_0x6306('0x3d')]));_0x3d17e3[_0x6306('0x3b')]=_0x3d17e3[_0x6306('0x3b')][_0x6306('0x3e')]?_0x3d17e3[_0x6306('0x3b')]:_0xe6f3c3[_0x6306('0x38')];if(!_0x39d4b8['query'][_0x6306('0x3f')](_0x6306('0x40'))){_0x3d17e3[_0x6306('0x29')]=qs[_0x6306('0x29')](_0x39d4b8[_0x6306('0x39')][_0x6306('0x29')]);_0x3d17e3[_0x6306('0x26')]=qs[_0x6306('0x26')](_0x39d4b8[_0x6306('0x39')][_0x6306('0x26')]);}_0x3d17e3[_0x6306('0x5c')]=qs['sort'](_0x39d4b8[_0x6306('0x39')][_0x6306('0x41')]);_0x3d17e3[_0x6306('0x42')]=qs['filters'](_[_0x6306('0x44')](_0x39d4b8['query'],_0xe6f3c3['filters']));_0x3d17e3[_0x6306('0x42')][_0x6306('0x5d')]=_0x394ee3['id'];if(_0x39d4b8[_0x6306('0x39')]['filter']){_0x3d17e3[_0x6306('0x42')]=_[_0x6306('0x46')](_0x3d17e3['where'],{'$or':_[_0x6306('0x35')](_0x3d17e3[_0x6306('0x3b')],function(_0x354b5e){var _0x5ee46a={};_0x5ee46a[_0x354b5e]={'$like':'%'+_0x39d4b8[_0x6306('0x39')][_0x6306('0x45')]+'%'};return _0x5ee46a;})});}_0x3d17e3=_[_0x6306('0x46')]({},_0x3d17e3,_0x39d4b8[_0x6306('0x48')]);return db[_0x6306('0x5b')][_0x6306('0x4b')](_0x3d17e3);}})[_0x6306('0x2d')](function(_0x181b90){if(_0x181b90){return db[_0x6306('0x5e')]['findAndCountAll']({'where':{'id':_[_0x6306('0x35')](_0x181b90,'UserId'),'role':_0x6306('0x5f')},'attributes':['id','name',_0x6306('0x60'),'updatedAt',_0x6306('0x61')]});}})['then'](function(_0x4e1655){if(_0x4e1655){return{'count':_0x4e1655[_0x6306('0x28')],'rows':_[_0x6306('0x35')](_0x4e1655[_0x6306('0x62')],function(_0x2f9a50){return{'membername':_0x2f9a50['name'],'UserId':_0x2f9a50['id'],'queue_name':_0x363561[_0x6306('0x32')],'MailQueueId':_0x363561['id'],'interface':util[_0x6306('0x63')](_0x6306('0x64'),'SIP',_0x2f9a50[_0x6306('0x32')]),'penalty':0x0,'paused':_0x2f9a50[_0x6306('0x60')],'createdAt':_0x2f9a50['createdAt'],'updatedAt':_0x2f9a50['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1474de,_0x3d17e3))[_0x6306('0x4c')](handleError(_0x1474de,null));};exports[_0x6306('0x65')]=function(_0x50ace0,_0xa3e5df,_0x47048c){var _0x45c47c={};var _0x3f40e3={};var _0x2f7a19;var _0x1c7e1a;return db[_0x6306('0x4a')][_0x6306('0x5a')]({'where':{'id':_0x50ace0[_0x6306('0x58')]['id']}})[_0x6306('0x2d')](handleEntityNotFound(_0xa3e5df,null))[_0x6306('0x2d')](function(_0x3dbb77){if(_0x3dbb77){_0x2f7a19=_0x3dbb77;_0x3f40e3[_0x6306('0x38')]=_['keys'](db[_0x6306('0x66')][_0x6306('0x36')]);_0x3f40e3[_0x6306('0x39')]=_['keys'](_0x50ace0[_0x6306('0x39')]);_0x3f40e3[_0x6306('0x43')]=_[_0x6306('0x3c')](_0x3f40e3['model'],_0x3f40e3[_0x6306('0x39')]);_0x45c47c['attributes']=_[_0x6306('0x3c')](_0x3f40e3[_0x6306('0x38')],qs[_0x6306('0x3d')](_0x50ace0[_0x6306('0x39')][_0x6306('0x3d')]));_0x45c47c[_0x6306('0x3b')]=_0x45c47c[_0x6306('0x3b')]['length']?_0x45c47c['attributes']:_0x3f40e3[_0x6306('0x38')];_0x45c47c['order']=qs[_0x6306('0x41')](_0x50ace0['query'][_0x6306('0x41')]);_0x45c47c[_0x6306('0x42')]=qs[_0x6306('0x43')](_[_0x6306('0x44')](_0x50ace0['query'],_0x3f40e3[_0x6306('0x43')]));if(_0x50ace0[_0x6306('0x39')][_0x6306('0x45')]){_0x45c47c[_0x6306('0x42')]=_[_0x6306('0x46')](_0x45c47c[_0x6306('0x42')],{'$or':_['map'](_0x45c47c[_0x6306('0x3b')],function(_0x4cd353){var _0x2a5324={};_0x2a5324[_0x4cd353]={'$like':'%'+_0x50ace0[_0x6306('0x39')]['filter']+'%'};return _0x2a5324;})});}_0x45c47c=_[_0x6306('0x46')]({},_0x45c47c,_0x50ace0[_0x6306('0x48')]);return _0x2f7a19['getTeams'](_0x45c47c);}})[_0x6306('0x2d')](function(_0x472cd4){if(_0x472cd4){_0x1c7e1a=_0x472cd4['length'];if(!_0x50ace0['query'][_0x6306('0x3f')](_0x6306('0x40'))){_0x45c47c[_0x6306('0x29')]=qs[_0x6306('0x29')](_0x50ace0[_0x6306('0x39')]['limit']);_0x45c47c[_0x6306('0x26')]=qs[_0x6306('0x26')](_0x50ace0['query']['offset']);}return _0x2f7a19[_0x6306('0x65')](_0x45c47c);}})[_0x6306('0x2d')](function(_0x42c5a7){if(_0x42c5a7){return _0x42c5a7?{'count':_0x1c7e1a,'rows':_0x42c5a7}:null;}})['then'](respondWithResult(_0xa3e5df,null))[_0x6306('0x4c')](handleError(_0xa3e5df,null));};exports['addTeams']=function(_0x159ef5,_0x70f426,_0x5513b7){var _0x5b908d=_0x159ef5[_0x6306('0x51')][_0x6306('0x67')];return db[_0x6306('0x66')]['findAll']({'where':{'id':_0x5b908d},'attributes':['id'],'include':[{'model':db[_0x6306('0x5e')],'as':'Agents','attributes':['id',_0x6306('0x32'),'online',_0x6306('0x68'),'interface'],'raw':!![]}]})[_0x6306('0x2d')](function(_0x2deb1f){if(_0x2deb1f){var _0x3ab182=_[_0x6306('0x69')](_0x2deb1f,function(_0xb41fc){var _0x2588ef=_0xb41fc[_0x6306('0x53')]({'plain':!![]});return _0x2588ef['Agents'];});return db[_0x6306('0x4a')]['find']({'where':{'id':_0x159ef5[_0x6306('0x58')]['id']}})[_0x6306('0x2d')](function(_0x3dbfb7){return db[_0x6306('0x6a')][_0x6306('0x6b')](function(_0x490b0d){return _0x3dbfb7['addTeams'](_0x5b908d,{'transaction':_0x490b0d})['then'](function(){return BPromise[_0x6306('0x6c')](_0x3ab182,function(_0x31073f){return db[_0x6306('0x5b')]['findOrCreate']({'where':{'UserId':_0x31073f['id'],'MailQueueId':_0x159ef5[_0x6306('0x58')]['id']},'transaction':_0x490b0d});});})['then'](function(){_0x3ab182[_0x6306('0x6d')](function(_0x26bc6c){socket['emit'](_0x6306('0x6e'),{'UserId':_0x26bc6c['id'],'MailQueueId':_0x3dbfb7['id']});});});});});}})[_0x6306('0x2d')](respondWithStatusCode(_0x70f426,null))[_0x6306('0x4c')](handleError(_0x70f426,null));};exports['removeTeams']=function(_0x53ceb1,_0x2ad90f,_0x1ec08f){return db[_0x6306('0x66')][_0x6306('0x4b')]({'where':{'id':_0x53ceb1['query'][_0x6306('0x67')]},'attributes':['id'],'include':[{'model':db[_0x6306('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6306('0x2d')](handleEntityNotFound(_0x2ad90f,null))[_0x6306('0x2d')](function(_0x4b4bbb){var _0x25c233=_['map'](_0x4b4bbb,'id');var _0x3bc0de=[];var _0x161a4b=[];var _0x5546ac=squel[_0x6306('0x6f')]();_0x5546ac[_0x6306('0x70')](_0x6306('0x71'))['from'](_0x6306('0x72'),'tq')['join']('user_has_teams','ut',_0x6306('0x73'))[_0x6306('0x42')](_0x6306('0x74'),_0x53ceb1[_0x6306('0x58')]['id']);for(var _0x280465=0x0;_0x280465<_0x4b4bbb[_0x6306('0x3e')];_0x280465+=0x1){let _0x3100c9=_0x4b4bbb[_0x280465];for(var _0x971f60=0x0;_0x971f60<_0x3100c9['Agents'][_0x6306('0x3e')];_0x971f60+=0x1){let _0x5940e8=_0x3100c9[_0x6306('0x75')][_0x971f60];var _0x581983=_0x5546ac[_0x6306('0x76')]();_0x581983[_0x6306('0x42')](_0x6306('0x77'),_0x5940e8['id']);_0x161a4b[_0x6306('0x78')](db[_0x6306('0x6a')][_0x6306('0x39')](_0x581983[_0x6306('0x79')](),{'type':db['sequelize']['QueryTypes'][_0x6306('0x7a')]})[_0x6306('0x2d')](function(_0x37ed57){if(_0x37ed57[_0x6306('0x3e')]===0x1){return _0x5940e8['id'];}else{var _0x19c586=_[_0x6306('0x7b')](_[_0x6306('0x35')](_0x37ed57,_0x6306('0x7c')),function(_0x1910fa){return _['includes'](_0x25c233,_0x1910fa);});if(_0x19c586){return _0x5940e8['id'];}}}));}}return BPromise[_0x6306('0x7d')](_0x161a4b)[_0x6306('0x2d')](function(_0x1d692b){_0x3bc0de=_(_0x3bc0de)[_0x6306('0x7e')](_0x1d692b)[_0x6306('0x7f')]()[_0x6306('0x80')]();return db[_0x6306('0x4a')][_0x6306('0x4f')]({'where':{'id':_0x53ceb1[_0x6306('0x58')]['id']}})[_0x6306('0x2d')](function(_0x484d4d){return db[_0x6306('0x6a')]['transaction'](function(_0x44bc2a){return _0x484d4d[_0x6306('0x81')](_0x53ceb1[_0x6306('0x39')][_0x6306('0x67')],{'transaction':_0x44bc2a})[_0x6306('0x2d')](function(){if(!_[_0x6306('0x82')](_0x3bc0de)){return _0x484d4d[_0x6306('0x83')](_0x3bc0de,{'transaction':_0x44bc2a});}})[_0x6306('0x2d')](function(){_0x3bc0de[_0x6306('0x6d')](function(_0x2ce480){socket[_0x6306('0x84')]('userMailQueue:remove',{'UserId':_0x2ce480,'MailQueueId':_0x484d4d['id']});});});});});});})[_0x6306('0x2d')](respondWithStatusCode(_0x2ad90f,null))['catch'](handleError(_0x2ad90f,null));};exports[_0x6306('0x85')]=function(_0x1f66d4,_0x9fca83,_0x13ad8d){return db[_0x6306('0x4a')][_0x6306('0x4f')]({'where':{'id':_0x1f66d4['params']['id']}})[_0x6306('0x2d')](handleEntityNotFound(_0x9fca83,null))[_0x6306('0x2d')](function(_0x4eef4f){if(_0x4eef4f){return _0x4eef4f['addAgents'](_0x1f66d4[_0x6306('0x51')]['ids'],_[_0x6306('0x86')](_0x1f66d4[_0x6306('0x51')],['ids','id'])||{})[_0x6306('0x87')](function(_0x510b20){for(var _0x108dcf=0x0;_0x108dcf<_0x1f66d4[_0x6306('0x51')][_0x6306('0x67')][_0x6306('0x3e')];_0x108dcf+=0x1){socket[_0x6306('0x84')]('userMailQueue:save',{'UserId':Number(_0x1f66d4[_0x6306('0x51')][_0x6306('0x67')][_0x108dcf]),'MailQueueId':Number(_0x1f66d4['params']['id'])});}return _0x510b20;});}})[_0x6306('0x2d')](respondWithResult(_0x9fca83,null))[_0x6306('0x4c')](handleError(_0x9fca83,null));};exports['removeAgents']=function(_0x6b72db,_0x5a2cf6,_0x234b18){return db[_0x6306('0x4a')][_0x6306('0x4f')]({'where':{'id':_0x6b72db[_0x6306('0x58')]['id']}})[_0x6306('0x2d')](handleEntityNotFound(_0x5a2cf6,null))['then'](function(_0x33621b){if(_0x33621b){return _0x33621b[_0x6306('0x83')](_0x6b72db[_0x6306('0x39')][_0x6306('0x67')])[_0x6306('0x2d')](function(){if(_[_0x6306('0x88')](_0x6b72db[_0x6306('0x39')]['ids'])){for(var _0x223f7b=0x0;_0x223f7b<_0x6b72db['query'][_0x6306('0x67')][_0x6306('0x3e')];_0x223f7b+=0x1){socket[_0x6306('0x84')](_0x6306('0x89'),{'UserId':Number(_0x6b72db[_0x6306('0x39')][_0x6306('0x67')][_0x223f7b]),'MailQueueId':Number(_0x6b72db['params']['id'])});}}else{socket[_0x6306('0x84')]('userMailQueue:remove',{'UserId':Number(_0x6b72db[_0x6306('0x39')][_0x6306('0x67')]),'MailQueueId':Number(_0x6b72db[_0x6306('0x58')]['id'])});}});}})[_0x6306('0x2d')](respondWithStatusCode(_0x5a2cf6,null))['catch'](handleError(_0x5a2cf6,null));};exports[_0x6306('0x8a')]=function(_0xf01f7a,_0x1ae837,_0x1c8821){var _0x475a5b={};var _0x17da50={};var _0x158761;var _0x4c7932;return db[_0x6306('0x4a')]['findOne']({'where':{'id':_0xf01f7a['params']['id']}})['then'](handleEntityNotFound(_0x1ae837,null))[_0x6306('0x2d')](function(_0xfba5a1){if(_0xfba5a1){_0x158761=_0xfba5a1;_0x17da50[_0x6306('0x38')]=_[_0x6306('0x3a')](db[_0x6306('0x5e')]['rawAttributes']);_0x17da50['query']=_[_0x6306('0x3a')](_0xf01f7a['query']);_0x17da50[_0x6306('0x43')]=_[_0x6306('0x3c')](_0x17da50['model'],_0x17da50[_0x6306('0x39')]);_0x475a5b[_0x6306('0x3b')]=_['intersection'](_0x17da50[_0x6306('0x38')],qs[_0x6306('0x3d')](_0xf01f7a[_0x6306('0x39')][_0x6306('0x3d')]));_0x475a5b[_0x6306('0x3b')]=_0x475a5b[_0x6306('0x3b')][_0x6306('0x3e')]?_0x475a5b['attributes']:_0x17da50[_0x6306('0x38')];_0x475a5b[_0x6306('0x5c')]=qs['sort'](_0xf01f7a['query'][_0x6306('0x41')]);_0x475a5b['where']=qs[_0x6306('0x43')](_[_0x6306('0x44')](_0xf01f7a[_0x6306('0x39')],_0x17da50['filters']));if(_0xf01f7a[_0x6306('0x39')]['filter']){_0x475a5b[_0x6306('0x42')]=_['merge'](_0x475a5b['where'],{'$or':_[_0x6306('0x35')](_0x475a5b[_0x6306('0x3b')],function(_0x14a3cd){var _0x1aecd5={};_0x1aecd5[_0x14a3cd]={'$like':'%'+_0xf01f7a[_0x6306('0x39')][_0x6306('0x45')]+'%'};return _0x1aecd5;})});}_0x475a5b=_[_0x6306('0x46')]({},_0x475a5b,_0xf01f7a[_0x6306('0x48')]);return _0x158761['getAgents'](_0x475a5b);}})[_0x6306('0x2d')](function(_0x44ddea){if(_0x44ddea){_0x4c7932=_0x44ddea[_0x6306('0x3e')];if(!_0xf01f7a['query']['hasOwnProperty'](_0x6306('0x40'))){_0x475a5b['limit']=qs[_0x6306('0x29')](_0xf01f7a[_0x6306('0x39')]['limit']);_0x475a5b['offset']=qs['offset'](_0xf01f7a['query'][_0x6306('0x26')]);}return _0x158761[_0x6306('0x8a')](_0x475a5b);}})[_0x6306('0x2d')](function(_0x5a243f){if(_0x5a243f){return _0x5a243f?{'count':_0x4c7932,'rows':_0x5a243f}:null;}})[_0x6306('0x2d')](respondWithResult(_0x1ae837,null))['catch'](handleError(_0x1ae837,null));};
\ No newline at end of file
index 43711d9..16a53bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ba8=['hasOwnProperty','hook','exports','events','remove','emit'];(function(_0x54f9a3,_0xfff391){var _0xd1e4a4=function(_0x1f19a3){while(--_0x1f19a3){_0x54f9a3['push'](_0x54f9a3['shift']());}};_0xd1e4a4(++_0xfff391);}(_0x6ba8,0x129));var _0x86ba=function(_0x3e586b,_0x3dd5aa){_0x3e586b=_0x3e586b-0x0;var _0x101ec9=_0x6ba8[_0x3e586b];return _0x101ec9;};'use strict';var EventEmitter=require(_0x86ba('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x86ba('0x1')};function emitEvent(_0x4e962e){return function(_0x51bbd0,_0x59fe53,_0x345fc2){MailQueueEvents['emit'](_0x4e962e+':'+_0x51bbd0['id'],_0x51bbd0);MailQueueEvents[_0x86ba('0x2')](_0x4e962e,_0x51bbd0);_0x345fc2(null);};}for(var e in events){if(events[_0x86ba('0x3')](e)){var event=events[e];MailQueue[_0x86ba('0x4')](e,emitEvent(event));}}module[_0x86ba('0x5')]=MailQueueEvents;
\ No newline at end of file
+var _0x632c=['exports','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14d3cc,_0x567831){var _0x1f822b=function(_0x1eeeb9){while(--_0x1eeeb9){_0x14d3cc['push'](_0x14d3cc['shift']());}};_0x1f822b(++_0x567831);}(_0x632c,0xf4));var _0xc632=function(_0x54352c,_0x56877f){_0x54352c=_0x54352c-0x0;var _0x20ce3e=_0x632c[_0x54352c];return _0x20ce3e;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xc632('0x0'))['db'][_0xc632('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xc632('0x2')](0x0);var events={'afterCreate':_0xc632('0x3'),'afterUpdate':_0xc632('0x4'),'afterDestroy':_0xc632('0x5')};function emitEvent(_0x518f90){return function(_0x42da9c,_0x46106a,_0x4dfe02){MailQueueEvents[_0xc632('0x6')](_0x518f90+':'+_0x42da9c['id'],_0x42da9c);MailQueueEvents[_0xc632('0x6')](_0x518f90,_0x42da9c);_0x4dfe02(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xc632('0x7')](e,emitEvent(event));}}module[_0xc632('0x8')]=MailQueueEvents;
\ No newline at end of file
index 58082f1..c87cb8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e7c=['rimraf','../../config/environment','./mailQueue.attributes','MailQueue','util','../../config/logger','moment','bluebird','path'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0x2e7c,0xd3));var _0xc2e7=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x2e7c[_0xaa0309];return _0x5de7ce;};'use strict';var _=require('lodash');var util=require(_0xc2e7('0x0'));var logger=require(_0xc2e7('0x1'))('api');var moment=require(_0xc2e7('0x2'));var BPromise=require(_0xc2e7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc2e7('0x4'));var rimraf=require(_0xc2e7('0x5'));var config=require(_0xc2e7('0x6'));var attributes=require(_0xc2e7('0x7'));module['exports']=function(_0x2bda38,_0x577a9f){return _0x2bda38['define'](_0xc2e7('0x8'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2344=['rimraf','../../config/environment','./mailQueue.attributes','define','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3b166b,_0x2c8ba1){var _0x579602=function(_0x8d7abc){while(--_0x8d7abc){_0x3b166b['push'](_0x3b166b['shift']());}};_0x579602(++_0x2c8ba1);}(_0x2344,0x1d0));var _0x4234=function(_0x5c2c63,_0x595de3){_0x5c2c63=_0x5c2c63-0x0;var _0x2b0f59=_0x2344[_0x5c2c63];return _0x2b0f59;};'use strict';var _=require(_0x4234('0x0'));var util=require(_0x4234('0x1'));var logger=require(_0x4234('0x2'))(_0x4234('0x3'));var moment=require(_0x4234('0x4'));var BPromise=require('bluebird');var rp=require(_0x4234('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4234('0x6'));var config=require(_0x4234('0x7'));var attributes=require(_0x4234('0x8'));module['exports']=function(_0x29f09e,_0x37474a){return _0x29f09e[_0x4234('0x9')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7a0548d..07bdddc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc812=['find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','limit','map','model','include','attributes','ShowMailQueue'];(function(_0x5a0e06,_0x5559c7){var _0x8157a=function(_0x4a04e1){while(--_0x4a04e1){_0x5a0e06['push'](_0x5a0e06['shift']());}};_0x8157a(++_0x5559c7);}(_0xc812,0x9d));var _0x2c81=function(_0x525389,_0x2987b4){_0x525389=_0x525389-0x0;var _0xfde83c=_0xc812[_0x525389];return _0xfde83c;};'use strict';var _=require(_0x2c81('0x0'));var util=require(_0x2c81('0x1'));var moment=require(_0x2c81('0x2'));var BPromise=require(_0x2c81('0x3'));var rs=require(_0x2c81('0x4'));var fs=require('fs');var Redis=require(_0x2c81('0x5'));var db=require(_0x2c81('0x6'))['db'];var utils=require(_0x2c81('0x7'));var logger=require(_0x2c81('0x8'))(_0x2c81('0x9'));var config=require(_0x2c81('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x2c81('0xb')][_0x2c81('0xc')]({'port':0x232a});config[_0x2c81('0xd')]=_['defaults'](config[_0x2c81('0xd')],{'host':_0x2c81('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x408196,_0x3889c1,_0x1ff25f){return new BPromise(function(_0x1aa9af,_0x423d4d){return client['request'](_0x408196,_0x1ff25f)[_0x2c81('0xf')](function(_0x2abce4){logger[_0x2c81('0x10')](_0x2c81('0x11'),_0x3889c1,_0x2c81('0x12'));logger[_0x2c81('0x13')](_0x2c81('0x14'),_0x3889c1,_0x2c81('0x12'),JSON[_0x2c81('0x15')](_0x2abce4));if(_0x2abce4[_0x2c81('0x16')]){if(_0x2abce4[_0x2c81('0x16')]['code']===0x1f4){logger[_0x2c81('0x16')](_0x2c81('0x11'),_0x3889c1,_0x2abce4['error'][_0x2c81('0x17')]);return _0x423d4d(_0x2abce4[_0x2c81('0x16')]['message']);}logger[_0x2c81('0x16')](_0x2c81('0x11'),_0x3889c1,_0x2abce4[_0x2c81('0x16')][_0x2c81('0x17')]);return _0x1aa9af(_0x2abce4[_0x2c81('0x16')]['message']);}else{logger[_0x2c81('0x10')]('MailQueue,\x20%s,\x20%s',_0x3889c1,_0x2c81('0x12'));_0x1aa9af(_0x2abce4[_0x2c81('0x18')]['message']);}})[_0x2c81('0x19')](function(_0x5e670b){logger[_0x2c81('0x16')](_0x2c81('0x11'),_0x3889c1,_0x5e670b);_0x423d4d(_0x5e670b);});});}exports[_0x2c81('0x1a')]=function(_0x54f62d){var _0x666628=this;return new Promise(function(_0x2fdfce,_0x4ec729){return db[_0x2c81('0x1b')][_0x2c81('0x1c')]({'raw':_0x54f62d[_0x2c81('0x1d')]?_0x54f62d['options'][_0x2c81('0x1e')]===undefined?!![]:![]:!![],'where':_0x54f62d[_0x2c81('0x1d')]?_0x54f62d[_0x2c81('0x1d')][_0x2c81('0x1f')]||null:null,'attributes':_0x54f62d[_0x2c81('0x1d')]?_0x54f62d['options']['attributes']||null:null,'limit':_0x54f62d[_0x2c81('0x1d')]?_0x54f62d['options'][_0x2c81('0x20')]||null:null,'include':_0x54f62d[_0x2c81('0x1d')]?_0x54f62d[_0x2c81('0x1d')]['include']?_[_0x2c81('0x21')](_0x54f62d[_0x2c81('0x1d')]['include'],function(_0x2110c7){return{'model':db[_0x2110c7[_0x2c81('0x22')]],'as':_0x2110c7['as'],'attributes':_0x2110c7['attributes'],'include':_0x2110c7[_0x2c81('0x23')]?_['map'](_0x2110c7[_0x2c81('0x23')],function(_0x5d3959){return{'model':db[_0x5d3959[_0x2c81('0x22')]],'as':_0x5d3959['as'],'attributes':_0x5d3959[_0x2c81('0x24')],'include':_0x5d3959[_0x2c81('0x23')]?_[_0x2c81('0x21')](_0x5d3959[_0x2c81('0x23')],function(_0x912a27){return{'model':db[_0x912a27[_0x2c81('0x22')]],'as':_0x912a27['as'],'attributes':_0x912a27['attributes']};}):[]};}):[]};}):[]:[]})[_0x2c81('0xf')](function(_0xf403bc){logger[_0x2c81('0x10')](_0x2c81('0x1a'),_0x54f62d);logger['debug'](_0x2c81('0x1a'),_0x54f62d,JSON[_0x2c81('0x15')](_0xf403bc));_0x2fdfce(_0xf403bc);})[_0x2c81('0x19')](function(_0x43a66d){logger['error'](_0x2c81('0x1a'),_0x43a66d[_0x2c81('0x17')],_0x54f62d);_0x4ec729(_0x666628['error'](0x1f4,_0x43a66d['message']));});});};exports[_0x2c81('0x25')]=function(_0x35c7b1){var _0x36ee18=this;return new Promise(function(_0x942093,_0x5cc3cc){return db[_0x2c81('0x1b')][_0x2c81('0x26')]({'raw':_0x35c7b1[_0x2c81('0x1d')]?_0x35c7b1[_0x2c81('0x1d')][_0x2c81('0x1e')]===undefined?!![]:![]:!![],'where':_0x35c7b1['options']?_0x35c7b1['options'][_0x2c81('0x1f')]||null:null,'attributes':_0x35c7b1[_0x2c81('0x1d')]?_0x35c7b1[_0x2c81('0x1d')][_0x2c81('0x24')]||null:null,'include':_0x35c7b1['options']?_0x35c7b1['options']['include']?_['map'](_0x35c7b1[_0x2c81('0x1d')]['include'],function(_0x521151){return{'model':db[_0x521151[_0x2c81('0x22')]],'as':_0x521151['as'],'attributes':_0x521151[_0x2c81('0x24')],'include':_0x521151[_0x2c81('0x23')]?_[_0x2c81('0x21')](_0x521151[_0x2c81('0x23')],function(_0xe56fdc){return{'model':db[_0xe56fdc[_0x2c81('0x22')]],'as':_0xe56fdc['as'],'attributes':_0xe56fdc[_0x2c81('0x24')],'include':_0xe56fdc[_0x2c81('0x23')]?_[_0x2c81('0x21')](_0xe56fdc[_0x2c81('0x23')],function(_0x572443){return{'model':db[_0x572443['model']],'as':_0x572443['as'],'attributes':_0x572443[_0x2c81('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f9805){logger[_0x2c81('0x10')]('ShowMailQueue',_0x35c7b1);logger[_0x2c81('0x13')]('ShowMailQueue',_0x35c7b1,JSON[_0x2c81('0x15')](_0x1f9805));_0x942093(_0x1f9805);})[_0x2c81('0x19')](function(_0x3094d1){logger[_0x2c81('0x16')]('ShowMailQueue',_0x3094d1['message'],_0x35c7b1);_0x5cc3cc(_0x36ee18[_0x2c81('0x16')](0x1f4,_0x3094d1['message']));});});};
\ No newline at end of file
+var _0xfc3c=['MailQueue','findAll','options','where','attributes','limit','include','map','model','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue'];(function(_0xf52322,_0x4e2427){var _0x528e53=function(_0x41ed72){while(--_0x41ed72){_0xf52322['push'](_0xf52322['shift']());}};_0x528e53(++_0x4e2427);}(_0xfc3c,0x101));var _0xcfc3=function(_0x173113,_0x316a7c){_0x173113=_0x173113-0x0;var _0x3bea89=_0xfc3c[_0x173113];return _0x3bea89;};'use strict';var _=require(_0xcfc3('0x0'));var util=require(_0xcfc3('0x1'));var moment=require(_0xcfc3('0x2'));var BPromise=require(_0xcfc3('0x3'));var rs=require(_0xcfc3('0x4'));var fs=require('fs');var Redis=require(_0xcfc3('0x5'));var db=require(_0xcfc3('0x6'))['db'];var utils=require(_0xcfc3('0x7'));var logger=require(_0xcfc3('0x8'))(_0xcfc3('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcfc3('0xa')][_0xcfc3('0xb')]({'port':0x232a});config[_0xcfc3('0xc')]=_[_0xcfc3('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcfc3('0xe'))(new Redis(config['redis']));require(_0xcfc3('0xf'))[_0xcfc3('0x10')](socket);function respondWithRpcPromise(_0x36e539,_0x57b961,_0x4f136d){return new BPromise(function(_0x4eb666,_0x1ea3c){return client['request'](_0x36e539,_0x4f136d)[_0xcfc3('0x11')](function(_0xc7a3d9){logger[_0xcfc3('0x12')](_0xcfc3('0x13'),_0x57b961,_0xcfc3('0x14'));logger[_0xcfc3('0x15')](_0xcfc3('0x16'),_0x57b961,_0xcfc3('0x14'),JSON[_0xcfc3('0x17')](_0xc7a3d9));if(_0xc7a3d9[_0xcfc3('0x18')]){if(_0xc7a3d9[_0xcfc3('0x18')][_0xcfc3('0x19')]===0x1f4){logger[_0xcfc3('0x18')](_0xcfc3('0x13'),_0x57b961,_0xc7a3d9[_0xcfc3('0x18')][_0xcfc3('0x1a')]);return _0x1ea3c(_0xc7a3d9[_0xcfc3('0x18')][_0xcfc3('0x1a')]);}logger[_0xcfc3('0x18')](_0xcfc3('0x13'),_0x57b961,_0xc7a3d9[_0xcfc3('0x18')][_0xcfc3('0x1a')]);return _0x4eb666(_0xc7a3d9[_0xcfc3('0x18')]['message']);}else{logger['info'](_0xcfc3('0x13'),_0x57b961,_0xcfc3('0x14'));_0x4eb666(_0xc7a3d9[_0xcfc3('0x1b')][_0xcfc3('0x1a')]);}})[_0xcfc3('0x1c')](function(_0x108442){logger[_0xcfc3('0x18')]('MailQueue,\x20%s,\x20%s',_0x57b961,_0x108442);_0x1ea3c(_0x108442);});});}exports[_0xcfc3('0x1d')]=function(_0x48636f){var _0x2c2607=this;return new Promise(function(_0xabb8da,_0x474e13){return db[_0xcfc3('0x1e')][_0xcfc3('0x1f')]({'raw':_0x48636f[_0xcfc3('0x20')]?_0x48636f['options']['raw']===undefined?!![]:![]:!![],'where':_0x48636f[_0xcfc3('0x20')]?_0x48636f['options'][_0xcfc3('0x21')]||null:null,'attributes':_0x48636f[_0xcfc3('0x20')]?_0x48636f[_0xcfc3('0x20')][_0xcfc3('0x22')]||null:null,'limit':_0x48636f['options']?_0x48636f[_0xcfc3('0x20')][_0xcfc3('0x23')]||null:null,'include':_0x48636f['options']?_0x48636f[_0xcfc3('0x20')][_0xcfc3('0x24')]?_[_0xcfc3('0x25')](_0x48636f[_0xcfc3('0x20')][_0xcfc3('0x24')],function(_0x24a59e){return{'model':db[_0x24a59e[_0xcfc3('0x26')]],'as':_0x24a59e['as'],'attributes':_0x24a59e[_0xcfc3('0x22')],'include':_0x24a59e['include']?_[_0xcfc3('0x25')](_0x24a59e['include'],function(_0x5c5a72){return{'model':db[_0x5c5a72[_0xcfc3('0x26')]],'as':_0x5c5a72['as'],'attributes':_0x5c5a72[_0xcfc3('0x22')],'include':_0x5c5a72['include']?_[_0xcfc3('0x25')](_0x5c5a72[_0xcfc3('0x24')],function(_0x59c5f4){return{'model':db[_0x59c5f4[_0xcfc3('0x26')]],'as':_0x59c5f4['as'],'attributes':_0x59c5f4[_0xcfc3('0x22')]};}):[]};}):[]};}):[]:[]})[_0xcfc3('0x11')](function(_0x2eb7d6){logger['info'](_0xcfc3('0x1d'),_0x48636f);logger[_0xcfc3('0x15')](_0xcfc3('0x1d'),_0x48636f,JSON[_0xcfc3('0x17')](_0x2eb7d6));_0xabb8da(_0x2eb7d6);})[_0xcfc3('0x1c')](function(_0xdadd14){logger['error'](_0xcfc3('0x1d'),_0xdadd14['message'],_0x48636f);_0x474e13(_0x2c2607[_0xcfc3('0x18')](0x1f4,_0xdadd14[_0xcfc3('0x1a')]));});});};exports[_0xcfc3('0x27')]=function(_0x4d5666){var _0x3f8e6d=this;return new Promise(function(_0x2ab4a8,_0x1ea180){return db[_0xcfc3('0x1e')][_0xcfc3('0x28')]({'raw':_0x4d5666[_0xcfc3('0x20')]?_0x4d5666['options']['raw']===undefined?!![]:![]:!![],'where':_0x4d5666[_0xcfc3('0x20')]?_0x4d5666[_0xcfc3('0x20')][_0xcfc3('0x21')]||null:null,'attributes':_0x4d5666[_0xcfc3('0x20')]?_0x4d5666[_0xcfc3('0x20')][_0xcfc3('0x22')]||null:null,'include':_0x4d5666['options']?_0x4d5666[_0xcfc3('0x20')][_0xcfc3('0x24')]?_[_0xcfc3('0x25')](_0x4d5666[_0xcfc3('0x20')][_0xcfc3('0x24')],function(_0x4e823a){return{'model':db[_0x4e823a[_0xcfc3('0x26')]],'as':_0x4e823a['as'],'attributes':_0x4e823a[_0xcfc3('0x22')],'include':_0x4e823a[_0xcfc3('0x24')]?_[_0xcfc3('0x25')](_0x4e823a[_0xcfc3('0x24')],function(_0x53a6fd){return{'model':db[_0x53a6fd[_0xcfc3('0x26')]],'as':_0x53a6fd['as'],'attributes':_0x53a6fd['attributes'],'include':_0x53a6fd[_0xcfc3('0x24')]?_[_0xcfc3('0x25')](_0x53a6fd[_0xcfc3('0x24')],function(_0x243764){return{'model':db[_0x243764[_0xcfc3('0x26')]],'as':_0x243764['as'],'attributes':_0x243764[_0xcfc3('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18016a){logger['info']('ShowMailQueue',_0x4d5666);logger[_0xcfc3('0x15')](_0xcfc3('0x27'),_0x4d5666,JSON['stringify'](_0x18016a));_0x2ab4a8(_0x18016a);})[_0xcfc3('0x1c')](function(_0x201427){logger['error'](_0xcfc3('0x27'),_0x201427[_0xcfc3('0x1a')],_0x4d5666);_0x1ea180(_0x3f8e6d[_0xcfc3('0x18')](0x1f4,_0x201427[_0xcfc3('0x1a')]));});});};
\ No newline at end of file
index e00059b..4e42954 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e20=['mailQueue:','./mailQueue.events','save','remove','emit','removeListener','register','length'];(function(_0x382617,_0x26bd93){var _0x195247=function(_0x2d2a0){while(--_0x2d2a0){_0x382617['push'](_0x382617['shift']());}};_0x195247(++_0x26bd93);}(_0x6e20,0x1e1));var _0x06e2=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x6e20[_0x4fde08];return _0x12e725;};'use strict';var MailQueueEvents=require(_0x06e2('0x0'));var events=[_0x06e2('0x1'),_0x06e2('0x2'),'update'];function createListener(_0x2966ec,_0x56040c){return function(_0x215338){_0x56040c[_0x06e2('0x3')](_0x2966ec,_0x215338);};}function removeListener(_0x9f754,_0x307f74){return function(){MailQueueEvents[_0x06e2('0x4')](_0x9f754,_0x307f74);};}exports[_0x06e2('0x5')]=function(_0x1f285e){for(var _0x26e406=0x0,_0x2a6a39=events[_0x06e2('0x6')];_0x26e406<_0x2a6a39;_0x26e406++){var _0x5a9282=events[_0x26e406];var _0x8380db=createListener(_0x06e2('0x7')+_0x5a9282,_0x1f285e);MailQueueEvents['on'](_0x5a9282,_0x8380db);}};
\ No newline at end of file
+var _0x8e78=['emit','removeListener','register','length','./mailQueue.events','save','remove','update'];(function(_0x575148,_0x2a92fc){var _0x4b03c9=function(_0x4492d0){while(--_0x4492d0){_0x575148['push'](_0x575148['shift']());}};_0x4b03c9(++_0x2a92fc);}(_0x8e78,0xdc));var _0x88e7=function(_0x408f04,_0x31825c){_0x408f04=_0x408f04-0x0;var _0x2ccd4a=_0x8e78[_0x408f04];return _0x2ccd4a;};'use strict';var MailQueueEvents=require(_0x88e7('0x0'));var events=[_0x88e7('0x1'),_0x88e7('0x2'),_0x88e7('0x3')];function createListener(_0x2e04a1,_0x48ffed){return function(_0x4a4b2d){_0x48ffed[_0x88e7('0x4')](_0x2e04a1,_0x4a4b2d);};}function removeListener(_0x1b5316,_0x2f54c1){return function(){MailQueueEvents[_0x88e7('0x5')](_0x1b5316,_0x2f54c1);};}exports[_0x88e7('0x6')]=function(_0x4c1384){for(var _0x316ed7=0x0,_0x41ccad=events[_0x88e7('0x7')];_0x316ed7<_0x41ccad;_0x316ed7++){var _0x4cf8f8=events[_0x316ed7];var _0x4bbbad=createListener('mailQueue:'+_0x4cf8f8,_0x4c1384);MailQueueEvents['on'](_0x4cf8f8,_0x4bbbad);}};
\ No newline at end of file
index 6ddf3ae..da3bd8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe828=['isAuthenticated','get','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','./mailQueueReport.controller'];(function(_0x15cc52,_0x167dca){var _0x47224b=function(_0x2046e6){while(--_0x2046e6){_0x15cc52['push'](_0x15cc52['shift']());}};_0x47224b(++_0x167dca);}(_0xe828,0xca));var _0x8e82=function(_0x4d6720,_0x5d5655){_0x4d6720=_0x4d6720-0x0;var _0x870c1b=_0xe828[_0x4d6720];return _0x870c1b;};'use strict';var multer=require(_0x8e82('0x0'));var util=require(_0x8e82('0x1'));var path=require(_0x8e82('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8e82('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8e82('0x4'));var config=require(_0x8e82('0x5'));var controller=require(_0x8e82('0x6'));router['get']('/',auth[_0x8e82('0x7')](),controller['index']);router[_0x8e82('0x8')](_0x8e82('0x9'),auth[_0x8e82('0x7')](),controller[_0x8e82('0xa')]);router[_0x8e82('0x8')](_0x8e82('0xb'),auth['isAuthenticated'](),controller[_0x8e82('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8e82('0xd')]);router[_0x8e82('0xe')](_0x8e82('0xb'),auth[_0x8e82('0x7')](),controller[_0x8e82('0xf')]);router[_0x8e82('0x10')](_0x8e82('0xb'),auth['isAuthenticated'](),controller[_0x8e82('0x11')]);module[_0x8e82('0x12')]=router;
\ No newline at end of file
+var _0x7184=['isAuthenticated','index','/describe','/:id','post','create','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get'];(function(_0x594e11,_0x28f652){var _0x5418ad=function(_0x5dcfa7){while(--_0x5dcfa7){_0x594e11['push'](_0x594e11['shift']());}};_0x5418ad(++_0x28f652);}(_0x7184,0x8f));var _0x4718=function(_0x595a21,_0x24790f){_0x595a21=_0x595a21-0x0;var _0x50df84=_0x7184[_0x595a21];return _0x50df84;};'use strict';var multer=require(_0x4718('0x0'));var util=require(_0x4718('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4718('0x2'));var router=express[_0x4718('0x3')]();var fs_extra=require(_0x4718('0x4'));var auth=require(_0x4718('0x5'));var interaction=require(_0x4718('0x6'));var config=require('../../config/environment');var controller=require(_0x4718('0x7'));router[_0x4718('0x8')]('/',auth[_0x4718('0x9')](),controller[_0x4718('0xa')]);router[_0x4718('0x8')](_0x4718('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x4718('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x4718('0xd')]('/',auth[_0x4718('0x9')](),controller[_0x4718('0xe')]);router[_0x4718('0xf')](_0x4718('0xc'),auth[_0x4718('0x9')](),controller[_0x4718('0x10')]);router[_0x4718('0x11')]('/:id',auth[_0x4718('0x9')](),controller['destroy']);module[_0x4718('0x12')]=router;
\ No newline at end of file
index 643c766..a543fc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x141d=['sequelize','exports','STRING','DATE','moment'];(function(_0x430f44,_0x4ae21b){var _0x1f6b0f=function(_0x35968f){while(--_0x35968f){_0x430f44['push'](_0x430f44['shift']());}};_0x1f6b0f(++_0x4ae21b);}(_0x141d,0xe5));var _0xd141=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x141d[_0x6c993a];return _0x27f547;};'use strict';var moment=require(_0xd141('0x0'));var Sequelize=require(_0xd141('0x1'));module[_0xd141('0x2')]={'uniqueid':{'type':Sequelize[_0xd141('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd141('0x3')]},'joinAt':{'type':Sequelize[_0xd141('0x4')]},'leaveAt':{'type':Sequelize[_0xd141('0x4')]},'acceptAt':{'type':Sequelize[_0xd141('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xd141('0x3')]}};
\ No newline at end of file
+var _0x4c7a=['STRING','DATE','moment','sequelize','exports'];(function(_0x440e53,_0x146742){var _0xb85369=function(_0x16bd59){while(--_0x16bd59){_0x440e53['push'](_0x440e53['shift']());}};_0xb85369(++_0x146742);}(_0x4c7a,0x11a));var _0xa4c7=function(_0x24597c,_0x370fd7){_0x24597c=_0x24597c-0x0;var _0x43ca23=_0x4c7a[_0x24597c];return _0x43ca23;};'use strict';var moment=require(_0xa4c7('0x0'));var Sequelize=require(_0xa4c7('0x1'));module[_0xa4c7('0x2')]={'uniqueid':{'type':Sequelize[_0xa4c7('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa4c7('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa4c7('0x4')]},'acceptAt':{'type':Sequelize[_0xa4c7('0x4')]},'exitAt':{'type':Sequelize[_0xa4c7('0x4')]},'reason':{'type':Sequelize[_0xa4c7('0x3')]}};
\ No newline at end of file
index e477566..759b75a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf55=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','MailQueueReport','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x483f7d,_0xa2c9b1){var _0x548bdf=function(_0x34a816){while(--_0x34a816){_0x483f7d['push'](_0x483f7d['shift']());}};_0x548bdf(++_0xa2c9b1);}(_0xdf55,0x83));var _0x5df5=function(_0x404cde,_0x27b51c){_0x404cde=_0x404cde-0x0;var _0x139882=_0xdf55[_0x404cde];return _0x139882;};'use strict';var emlformat=require(_0x5df5('0x0'));var rimraf=require(_0x5df5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5df5('0x2'));var rp=require(_0x5df5('0x3'));var moment=require('moment');var BPromise=require(_0x5df5('0x4'));var Mustache=require(_0x5df5('0x5'));var util=require(_0x5df5('0x6'));var path=require('path');var sox=require(_0x5df5('0x7'));var csv=require(_0x5df5('0x8'));var ejs=require(_0x5df5('0x9'));var fs=require('fs');var fs_extra=require(_0x5df5('0xa'));var _=require(_0x5df5('0xb'));var squel=require(_0x5df5('0xc'));var crypto=require(_0x5df5('0xd'));var jsforce=require(_0x5df5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5df5('0x8'));var querystring=require(_0x5df5('0xf'));var Papa=require(_0x5df5('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5df5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5df5('0x12'));var logger=require(_0x5df5('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5df5('0x14'));var licenseUtil=require(_0x5df5('0x15'));var db=require(_0x5df5('0x16'))['db'];function respondWithStatusCode(_0x4c3d6f,_0xe8bcd8){_0xe8bcd8=_0xe8bcd8||0xcc;return function(_0xb4a4fe){if(_0xb4a4fe){return _0x4c3d6f[_0x5df5('0x17')](_0xe8bcd8);}return _0x4c3d6f[_0x5df5('0x18')](_0xe8bcd8)[_0x5df5('0x19')]();};}function respondWithResult(_0x956317,_0x555d3f){_0x555d3f=_0x555d3f||0xc8;return function(_0x30fd32){if(_0x30fd32){return _0x956317['status'](_0x555d3f)[_0x5df5('0x1a')](_0x30fd32);}};}function respondWithFilteredResult(_0x33f818,_0x5b0ad9){return function(_0x3657c8){if(_0x3657c8){var _0x282d53=typeof _0x5b0ad9['offset']===_0x5df5('0x1b')&&typeof _0x5b0ad9[_0x5df5('0x1c')]==='undefined';var _0x9a52c9=_0x3657c8[_0x5df5('0x1d')];var _0xb7e1c2=_0x282d53?0x0:_0x5b0ad9[_0x5df5('0x1e')];var _0x215d59=_0x282d53?_0x3657c8['count']:_0x5b0ad9['offset']+_0x5b0ad9[_0x5df5('0x1c')];var _0x5d8dfd;if(_0x215d59>=_0x9a52c9){_0x215d59=_0x9a52c9;_0x5d8dfd=0xc8;}else{_0x5d8dfd=0xce;}_0x33f818[_0x5df5('0x18')](_0x5d8dfd);return _0x33f818[_0x5df5('0x1f')](_0x5df5('0x20'),_0xb7e1c2+'-'+_0x215d59+'/'+_0x9a52c9)[_0x5df5('0x1a')](_0x3657c8);}return null;};}function patchUpdates(_0x1deae7){return function(_0x4b4b57){try{jsonpatch[_0x5df5('0x21')](_0x4b4b57,_0x1deae7,!![]);}catch(_0x39d8a1){return BPromise[_0x5df5('0x22')](_0x39d8a1);}return _0x4b4b57[_0x5df5('0x23')]();};}function saveUpdates(_0x28efc8,_0x382999){return function(_0x59ff67){if(_0x59ff67){return _0x59ff67[_0x5df5('0x24')](_0x28efc8)[_0x5df5('0x25')](function(_0x8742a7){return _0x8742a7;});}return null;};}function removeEntity(_0x446bba,_0x5ca542){return function(_0x4358ba){if(_0x4358ba){return _0x4358ba[_0x5df5('0x26')]()[_0x5df5('0x25')](function(){_0x446bba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x532923,_0x357fb0){return function(_0x3ff82e){if(!_0x3ff82e){_0x532923[_0x5df5('0x17')](0x194);}return _0x3ff82e;};}function handleError(_0xa7f4b3,_0x1baf52){_0x1baf52=_0x1baf52||0x1f4;return function(_0x1fd83c){logger[_0x5df5('0x27')](_0x1fd83c[_0x5df5('0x28')]);if(_0x1fd83c['name']){delete _0x1fd83c[_0x5df5('0x29')];}_0xa7f4b3['status'](_0x1baf52)[_0x5df5('0x2a')](_0x1fd83c);};}exports[_0x5df5('0x2b')]=function(_0x5bc181,_0x3854d0){var _0x4945c6={},_0xd2b213={},_0x4cccf1={'count':0x0,'rows':[]};var _0x2e1885=_['map'](db[_0x5df5('0x2c')]['rawAttributes'],function(_0x2f91e3){return{'name':_0x2f91e3[_0x5df5('0x2d')],'type':_0x2f91e3[_0x5df5('0x2e')]['key']};});_0xd2b213[_0x5df5('0x2f')]=_[_0x5df5('0x30')](_0x2e1885,_0x5df5('0x29'));_0xd2b213[_0x5df5('0x31')]=_[_0x5df5('0x32')](_0x5bc181[_0x5df5('0x31')]);_0xd2b213[_0x5df5('0x33')]=_['intersection'](_0xd2b213['model'],_0xd2b213[_0x5df5('0x31')]);_0x4945c6[_0x5df5('0x34')]=_[_0x5df5('0x35')](_0xd2b213[_0x5df5('0x2f')],qs[_0x5df5('0x36')](_0x5bc181[_0x5df5('0x31')]['fields']));_0x4945c6[_0x5df5('0x34')]=_0x4945c6[_0x5df5('0x34')][_0x5df5('0x37')]?_0x4945c6[_0x5df5('0x34')]:_0xd2b213['model'];if(!_0x5bc181[_0x5df5('0x31')]['hasOwnProperty'](_0x5df5('0x38'))){_0x4945c6[_0x5df5('0x1c')]=qs['limit'](_0x5bc181[_0x5df5('0x31')]['limit']);_0x4945c6[_0x5df5('0x1e')]=qs[_0x5df5('0x1e')](_0x5bc181[_0x5df5('0x31')][_0x5df5('0x1e')]);}_0x4945c6['order']=qs[_0x5df5('0x39')](_0x5bc181[_0x5df5('0x31')][_0x5df5('0x39')]);_0x4945c6[_0x5df5('0x3a')]=qs['filters'](_[_0x5df5('0x3b')](_0x5bc181[_0x5df5('0x31')],_0xd2b213[_0x5df5('0x33')]),_0x2e1885);if(_0x5bc181[_0x5df5('0x31')][_0x5df5('0x3c')]){_0x4945c6[_0x5df5('0x3a')]=_[_0x5df5('0x3d')](_0x4945c6['where'],{'$or':_[_0x5df5('0x30')](_0x2e1885,function(_0x3102c7){if(_0x3102c7['type']!==_0x5df5('0x3e')){var _0x217844={};_0x217844[_0x3102c7['name']]={'$like':'%'+_0x5bc181[_0x5df5('0x31')][_0x5df5('0x3c')]+'%'};return _0x217844;}})});}_0x4945c6=_[_0x5df5('0x3d')]({},_0x4945c6,_0x5bc181[_0x5df5('0x3f')]);var _0x235f3e={'where':_0x4945c6[_0x5df5('0x3a')]};return db[_0x5df5('0x2c')][_0x5df5('0x1d')](_0x235f3e)['then'](function(_0x5e6c93){_0x4cccf1[_0x5df5('0x1d')]=_0x5e6c93;if(_0x5bc181['query'][_0x5df5('0x40')]){_0x4945c6[_0x5df5('0x41')]=[{'all':!![]}];}return db['MailQueueReport'][_0x5df5('0x42')](_0x4945c6);})[_0x5df5('0x25')](function(_0x23e592){_0x4cccf1[_0x5df5('0x43')]=_0x23e592;return _0x4cccf1;})[_0x5df5('0x25')](respondWithFilteredResult(_0x3854d0,_0x4945c6))[_0x5df5('0x44')](handleError(_0x3854d0,null));};exports[_0x5df5('0x45')]=function(_0x3902a1,_0x5824c3){var _0x42b562={'raw':!![],'where':{'id':_0x3902a1[_0x5df5('0x46')]['id']}},_0x4a4057={};_0x4a4057[_0x5df5('0x2f')]=_[_0x5df5('0x32')](db[_0x5df5('0x2c')][_0x5df5('0x47')]);_0x4a4057['query']=_[_0x5df5('0x32')](_0x3902a1[_0x5df5('0x31')]);_0x4a4057[_0x5df5('0x33')]=_['intersection'](_0x4a4057[_0x5df5('0x2f')],_0x4a4057[_0x5df5('0x31')]);_0x42b562['attributes']=_[_0x5df5('0x35')](_0x4a4057[_0x5df5('0x2f')],qs[_0x5df5('0x36')](_0x3902a1[_0x5df5('0x31')]['fields']));_0x42b562[_0x5df5('0x34')]=_0x42b562[_0x5df5('0x34')]['length']?_0x42b562[_0x5df5('0x34')]:_0x4a4057[_0x5df5('0x2f')];if(_0x3902a1[_0x5df5('0x31')]['includeAll']){_0x42b562[_0x5df5('0x41')]=[{'all':!![]}];}_0x42b562=_[_0x5df5('0x3d')]({},_0x42b562,_0x3902a1[_0x5df5('0x3f')]);return db[_0x5df5('0x2c')]['find'](_0x42b562)[_0x5df5('0x25')](handleEntityNotFound(_0x5824c3,null))[_0x5df5('0x25')](respondWithResult(_0x5824c3,null))[_0x5df5('0x44')](handleError(_0x5824c3,null));};exports[_0x5df5('0x48')]=function(_0x14f9ca,_0x5f44cb){return db['MailQueueReport'][_0x5df5('0x48')](_0x14f9ca['body'],{})[_0x5df5('0x25')](respondWithResult(_0x5f44cb,0xc9))[_0x5df5('0x44')](handleError(_0x5f44cb,null));};exports[_0x5df5('0x24')]=function(_0x28108e,_0x48462e){if(_0x28108e[_0x5df5('0x49')]['id']){delete _0x28108e[_0x5df5('0x49')]['id'];}return db[_0x5df5('0x2c')][_0x5df5('0x4a')]({'where':{'id':_0x28108e[_0x5df5('0x46')]['id']}})[_0x5df5('0x25')](handleEntityNotFound(_0x48462e,null))['then'](saveUpdates(_0x28108e[_0x5df5('0x49')],null))['then'](respondWithResult(_0x48462e,null))[_0x5df5('0x44')](handleError(_0x48462e,null));};exports[_0x5df5('0x26')]=function(_0x17288f,_0x4d1ebd){return db[_0x5df5('0x2c')]['find']({'where':{'id':_0x17288f[_0x5df5('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d1ebd,null))[_0x5df5('0x25')](removeEntity(_0x4d1ebd,null))[_0x5df5('0x44')](handleError(_0x4d1ebd,null));};exports[_0x5df5('0x4b')]=function(_0x5997c1,_0x3d92a3){return db[_0x5df5('0x2c')]['describe']()[_0x5df5('0x25')](respondWithResult(_0x3d92a3,null))[_0x5df5('0x44')](handleError(_0x3d92a3,null));};
\ No newline at end of file
+var _0x0424=['index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','MailQueueReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','stack','name','send'];(function(_0x39714b,_0x5e0b0e){var _0x45ed60=function(_0x3ce5c8){while(--_0x3ce5c8){_0x39714b['push'](_0x39714b['shift']());}};_0x45ed60(++_0x5e0b0e);}(_0x0424,0x159));var _0x4042=function(_0x4c9cc4,_0x1b6528){_0x4c9cc4=_0x4c9cc4-0x0;var _0x4384fb=_0x0424[_0x4c9cc4];return _0x4384fb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4042('0x0'));var jsonpatch=require(_0x4042('0x1'));var rp=require(_0x4042('0x2'));var moment=require(_0x4042('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4042('0x4'));var util=require('util');var path=require('path');var sox=require(_0x4042('0x5'));var csv=require(_0x4042('0x6'));var ejs=require(_0x4042('0x7'));var fs=require('fs');var fs_extra=require(_0x4042('0x8'));var _=require(_0x4042('0x9'));var squel=require(_0x4042('0xa'));var crypto=require(_0x4042('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4042('0x6'));var querystring=require(_0x4042('0xc'));var Papa=require(_0x4042('0xd'));var Redis=require('ioredis');var authService=require(_0x4042('0xe'));var qs=require(_0x4042('0xf'));var as=require(_0x4042('0x10'));var hardwareService=require(_0x4042('0x11'));var logger=require(_0x4042('0x12'))(_0x4042('0x13'));var utils=require(_0x4042('0x14'));var config=require(_0x4042('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4042('0x16'))['db'];function respondWithStatusCode(_0x357838,_0x59a068){_0x59a068=_0x59a068||0xcc;return function(_0x25fd0a){if(_0x25fd0a){return _0x357838[_0x4042('0x17')](_0x59a068);}return _0x357838[_0x4042('0x18')](_0x59a068)[_0x4042('0x19')]();};}function respondWithResult(_0x35f82a,_0x1ff3ca){_0x1ff3ca=_0x1ff3ca||0xc8;return function(_0xc115bd){if(_0xc115bd){return _0x35f82a['status'](_0x1ff3ca)[_0x4042('0x1a')](_0xc115bd);}};}function respondWithFilteredResult(_0x291e5c,_0x50206f){return function(_0x28087d){if(_0x28087d){var _0x3f99f8=typeof _0x50206f[_0x4042('0x1b')]===_0x4042('0x1c')&&typeof _0x50206f[_0x4042('0x1d')]===_0x4042('0x1c');var _0x62cb76=_0x28087d[_0x4042('0x1e')];var _0x466077=_0x3f99f8?0x0:_0x50206f['offset'];var _0xe5c1ec=_0x3f99f8?_0x28087d['count']:_0x50206f[_0x4042('0x1b')]+_0x50206f['limit'];var _0xca9ca6;if(_0xe5c1ec>=_0x62cb76){_0xe5c1ec=_0x62cb76;_0xca9ca6=0xc8;}else{_0xca9ca6=0xce;}_0x291e5c[_0x4042('0x18')](_0xca9ca6);return _0x291e5c[_0x4042('0x1f')](_0x4042('0x20'),_0x466077+'-'+_0xe5c1ec+'/'+_0x62cb76)['json'](_0x28087d);}return null;};}function patchUpdates(_0xb72021){return function(_0x4561e3){try{jsonpatch[_0x4042('0x21')](_0x4561e3,_0xb72021,!![]);}catch(_0xd1ddb){return BPromise['reject'](_0xd1ddb);}return _0x4561e3[_0x4042('0x22')]();};}function saveUpdates(_0xf0e0c6,_0xd6fe6c){return function(_0x83ce71){if(_0x83ce71){return _0x83ce71[_0x4042('0x23')](_0xf0e0c6)['then'](function(_0x1f9d4a){return _0x1f9d4a;});}return null;};}function removeEntity(_0x6d12a5,_0x519f2c){return function(_0x1daee8){if(_0x1daee8){return _0x1daee8['destroy']()[_0x4042('0x24')](function(){_0x6d12a5[_0x4042('0x18')](0xcc)[_0x4042('0x19')]();});}};}function handleEntityNotFound(_0x5d5c6d,_0x461c5e){return function(_0x3b9e78){if(!_0x3b9e78){_0x5d5c6d[_0x4042('0x17')](0x194);}return _0x3b9e78;};}function handleError(_0xbdadc8,_0x1c4d9f){_0x1c4d9f=_0x1c4d9f||0x1f4;return function(_0x52e575){logger['error'](_0x52e575[_0x4042('0x25')]);if(_0x52e575[_0x4042('0x26')]){delete _0x52e575[_0x4042('0x26')];}_0xbdadc8[_0x4042('0x18')](_0x1c4d9f)[_0x4042('0x27')](_0x52e575);};}exports[_0x4042('0x28')]=function(_0x5eb84b,_0x33733b){var _0x1e9bd7={},_0x4a6a6e={},_0xae26c2={'count':0x0,'rows':[]};var _0x89e16=_[_0x4042('0x29')](db['MailQueueReport']['rawAttributes'],function(_0x3d1f48){return{'name':_0x3d1f48[_0x4042('0x2a')],'type':_0x3d1f48['type'][_0x4042('0x2b')]};});_0x4a6a6e[_0x4042('0x2c')]=_[_0x4042('0x29')](_0x89e16,_0x4042('0x26'));_0x4a6a6e[_0x4042('0x2d')]=_[_0x4042('0x2e')](_0x5eb84b[_0x4042('0x2d')]);_0x4a6a6e[_0x4042('0x2f')]=_[_0x4042('0x30')](_0x4a6a6e['model'],_0x4a6a6e[_0x4042('0x2d')]);_0x1e9bd7[_0x4042('0x31')]=_['intersection'](_0x4a6a6e[_0x4042('0x2c')],qs[_0x4042('0x32')](_0x5eb84b['query'][_0x4042('0x32')]));_0x1e9bd7[_0x4042('0x31')]=_0x1e9bd7[_0x4042('0x31')][_0x4042('0x33')]?_0x1e9bd7[_0x4042('0x31')]:_0x4a6a6e[_0x4042('0x2c')];if(!_0x5eb84b[_0x4042('0x2d')][_0x4042('0x34')](_0x4042('0x35'))){_0x1e9bd7[_0x4042('0x1d')]=qs[_0x4042('0x1d')](_0x5eb84b[_0x4042('0x2d')][_0x4042('0x1d')]);_0x1e9bd7[_0x4042('0x1b')]=qs[_0x4042('0x1b')](_0x5eb84b[_0x4042('0x2d')][_0x4042('0x1b')]);}_0x1e9bd7[_0x4042('0x36')]=qs[_0x4042('0x37')](_0x5eb84b[_0x4042('0x2d')][_0x4042('0x37')]);_0x1e9bd7['where']=qs[_0x4042('0x2f')](_[_0x4042('0x38')](_0x5eb84b[_0x4042('0x2d')],_0x4a6a6e[_0x4042('0x2f')]),_0x89e16);if(_0x5eb84b['query'][_0x4042('0x39')]){_0x1e9bd7[_0x4042('0x3a')]=_[_0x4042('0x3b')](_0x1e9bd7[_0x4042('0x3a')],{'$or':_[_0x4042('0x29')](_0x89e16,function(_0x13da64){if(_0x13da64[_0x4042('0x3c')]!==_0x4042('0x3d')){var _0x341083={};_0x341083[_0x13da64[_0x4042('0x26')]]={'$like':'%'+_0x5eb84b['query'][_0x4042('0x39')]+'%'};return _0x341083;}})});}_0x1e9bd7=_[_0x4042('0x3b')]({},_0x1e9bd7,_0x5eb84b[_0x4042('0x3e')]);var _0x1eab87={'where':_0x1e9bd7[_0x4042('0x3a')]};return db[_0x4042('0x3f')][_0x4042('0x1e')](_0x1eab87)[_0x4042('0x24')](function(_0x52b1bd){_0xae26c2['count']=_0x52b1bd;if(_0x5eb84b[_0x4042('0x2d')][_0x4042('0x40')]){_0x1e9bd7[_0x4042('0x41')]=[{'all':!![]}];}return db[_0x4042('0x3f')][_0x4042('0x42')](_0x1e9bd7);})[_0x4042('0x24')](function(_0xdfb5cb){_0xae26c2[_0x4042('0x43')]=_0xdfb5cb;return _0xae26c2;})[_0x4042('0x24')](respondWithFilteredResult(_0x33733b,_0x1e9bd7))[_0x4042('0x44')](handleError(_0x33733b,null));};exports[_0x4042('0x45')]=function(_0x35fdc2,_0x5666ed){var _0x5dea57={'raw':!![],'where':{'id':_0x35fdc2[_0x4042('0x46')]['id']}},_0x929884={};_0x929884['model']=_[_0x4042('0x2e')](db['MailQueueReport'][_0x4042('0x47')]);_0x929884[_0x4042('0x2d')]=_[_0x4042('0x2e')](_0x35fdc2['query']);_0x929884[_0x4042('0x2f')]=_[_0x4042('0x30')](_0x929884['model'],_0x929884[_0x4042('0x2d')]);_0x5dea57[_0x4042('0x31')]=_[_0x4042('0x30')](_0x929884[_0x4042('0x2c')],qs[_0x4042('0x32')](_0x35fdc2['query']['fields']));_0x5dea57['attributes']=_0x5dea57[_0x4042('0x31')][_0x4042('0x33')]?_0x5dea57['attributes']:_0x929884['model'];if(_0x35fdc2['query'][_0x4042('0x40')]){_0x5dea57['include']=[{'all':!![]}];}_0x5dea57=_['merge']({},_0x5dea57,_0x35fdc2[_0x4042('0x3e')]);return db[_0x4042('0x3f')][_0x4042('0x48')](_0x5dea57)[_0x4042('0x24')](handleEntityNotFound(_0x5666ed,null))[_0x4042('0x24')](respondWithResult(_0x5666ed,null))[_0x4042('0x44')](handleError(_0x5666ed,null));};exports[_0x4042('0x49')]=function(_0x2abc13,_0x198209){return db['MailQueueReport']['create'](_0x2abc13['body'],{})['then'](respondWithResult(_0x198209,0xc9))[_0x4042('0x44')](handleError(_0x198209,null));};exports[_0x4042('0x23')]=function(_0xd898ea,_0x250434){if(_0xd898ea[_0x4042('0x4a')]['id']){delete _0xd898ea[_0x4042('0x4a')]['id'];}return db[_0x4042('0x3f')][_0x4042('0x48')]({'where':{'id':_0xd898ea['params']['id']}})[_0x4042('0x24')](handleEntityNotFound(_0x250434,null))[_0x4042('0x24')](saveUpdates(_0xd898ea[_0x4042('0x4a')],null))[_0x4042('0x24')](respondWithResult(_0x250434,null))[_0x4042('0x44')](handleError(_0x250434,null));};exports[_0x4042('0x4b')]=function(_0xf5f38a,_0x591a0f){return db['MailQueueReport']['find']({'where':{'id':_0xf5f38a[_0x4042('0x46')]['id']}})[_0x4042('0x24')](handleEntityNotFound(_0x591a0f,null))['then'](removeEntity(_0x591a0f,null))[_0x4042('0x44')](handleError(_0x591a0f,null));};exports[_0x4042('0x4c')]=function(_0x5d42a7,_0x4ec047){return db[_0x4042('0x3f')][_0x4042('0x4c')]()[_0x4042('0x24')](respondWithResult(_0x4ec047,null))[_0x4042('0x44')](handleError(_0x4ec047,null));};
\ No newline at end of file
index 908ba79..6346a49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2131=['define','uniqueid','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x5b1b08,_0x469193){var _0x77cdb1=function(_0x35bc3c){while(--_0x35bc3c){_0x5b1b08['push'](_0x5b1b08['shift']());}};_0x77cdb1(++_0x469193);}(_0x2131,0x1b2));var _0x1213=function(_0x9d15f5,_0x16158f){_0x9d15f5=_0x9d15f5-0x0;var _0x1abfea=_0x2131[_0x9d15f5];return _0x1abfea;};'use strict';var _=require('lodash');var util=require(_0x1213('0x0'));var logger=require(_0x1213('0x1'))(_0x1213('0x2'));var moment=require('moment');var BPromise=require(_0x1213('0x3'));var rp=require(_0x1213('0x4'));var fs=require('fs');var path=require(_0x1213('0x5'));var rimraf=require(_0x1213('0x6'));var config=require(_0x1213('0x7'));var attributes=require(_0x1213('0x8'));module[_0x1213('0x9')]=function(_0x4f8c79,_0x3c0856){return _0x4f8c79[_0x1213('0xa')]('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x1213('0xb'),'fields':[_0x1213('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbc3e=['define','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x2cc686,_0x421550){var _0x4e4ad3=function(_0x391678){while(--_0x391678){_0x2cc686['push'](_0x2cc686['shift']());}};_0x4e4ad3(++_0x421550);}(_0xbc3e,0xd6));var _0xebc3=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xbc3e[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0xebc3('0x0'));var logger=require(_0xebc3('0x1'))(_0xebc3('0x2'));var moment=require(_0xebc3('0x3'));var BPromise=require(_0xebc3('0x4'));var rp=require(_0xebc3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xebc3('0x6'));var config=require(_0xebc3('0x7'));var attributes=require(_0xebc3('0x8'));module[_0xebc3('0x9')]=function(_0x2bf8a6,_0x2ac1b5){return _0x2bf8a6[_0xebc3('0xa')](_0xebc3('0xb'),attributes,{'tableName':_0xebc3('0xc'),'paranoid':![],'indexes':[{'name':_0xebc3('0xd'),'fields':[_0xebc3('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 9e58697..a8d4a37 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(_0x53c92c,_0x39a147){var _0x502888=function(_0x3da092){while(--_0x3da092){_0x53c92c['push'](_0x53c92c['shift']());}};_0x502888(++_0x39a147);}(_0xadb5,0xad));var _0x5adb=function(_0x34c6f8,_0x925897){_0x34c6f8=_0x34c6f8-0x0;var _0x598371=_0xadb5[_0x34c6f8];return _0x598371;};'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(_0x16f02b,_0x4ef08b){var _0x3c4d25=function(_0x5d15ba){while(--_0x5d15ba){_0x16f02b['push'](_0x16f02b['shift']());}};_0x3c4d25(++_0x4ef08b);}(_0x1261,0x144));var _0x1126=function(_0x1acf4b,_0x5a750c){_0x1acf4b=_0x1acf4b-0x0;var _0x4eca09=_0x1261[_0x1acf4b];return _0x4eca09;};'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 abc0715..c8dec68 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(_0x453bee,_0x2a051e){var _0x33076e=function(_0x16c27a){while(--_0x16c27a){_0x453bee['push'](_0x453bee['shift']());}};_0x33076e(++_0x2a051e);}(_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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1b1bd5,_0xf50a3){var _0x12bf17=function(_0x5a1a9f){while(--_0x5a1a9f){_0x1b1bd5['push'](_0x1b1bd5['shift']());}};_0x12bf17(++_0xf50a3);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index 1adec0e..d50d2cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x304d=['INTEGER','INBOX','sequelize','STRING'];(function(_0x581865,_0x303011){var _0x3bbcba=function(_0x2af5f9){while(--_0x2af5f9){_0x581865['push'](_0x581865['shift']());}};_0x3bbcba(++_0x303011);}(_0x304d,0x9e));var _0xd304=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x304d[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xd304('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xd304('0x1')]},'password':{'type':Sequelize[_0xd304('0x1')]},'port':{'type':Sequelize[_0xd304('0x2')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xd304('0x1')],'defaultValue':_0xd304('0x3')},'connTimeout':{'type':Sequelize[_0xd304('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xd304('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xa6ec=['INBOX','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x5bec0f,_0x2347e7){var _0x5d9990=function(_0x358575){while(--_0x358575){_0x5bec0f['push'](_0x5bec0f['shift']());}};_0x5d9990(++_0x2347e7);}(_0xa6ec,0xd3));var _0xca6e=function(_0x280f59,_0x5de6e3){_0x280f59=_0x280f59-0x0;var _0x2480da=_0xa6ec[_0x280f59];return _0x2480da;};'use strict';var Sequelize=require(_0xca6e('0x0'));module[_0xca6e('0x1')]={'description':{'type':Sequelize[_0xca6e('0x2')]},'host':{'type':Sequelize[_0xca6e('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xca6e('0x2')]},'port':{'type':Sequelize[_0xca6e('0x3')]},'tls':{'type':Sequelize[_0xca6e('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xca6e('0x5')},'connTimeout':{'type':Sequelize[_0xca6e('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xca6e('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xca6e('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 572b3ad..9890d0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8245=['mail_servers_in','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','MailServerIn'];(function(_0x3c9d5d,_0x5421c4){var _0x6208eb=function(_0x2369bb){while(--_0x2369bb){_0x3c9d5d['push'](_0x3c9d5d['shift']());}};_0x6208eb(++_0x5421c4);}(_0x8245,0x145));var _0x5824=function(_0x1a68f4,_0x1d2060){_0x1a68f4=_0x1a68f4-0x0;var _0x4972f2=_0x8245[_0x1a68f4];return _0x4972f2;};'use strict';var _=require('lodash');var util=require(_0x5824('0x0'));var logger=require(_0x5824('0x1'))(_0x5824('0x2'));var moment=require(_0x5824('0x3'));var BPromise=require(_0x5824('0x4'));var rp=require(_0x5824('0x5'));var fs=require('fs');var path=require(_0x5824('0x6'));var rimraf=require(_0x5824('0x7'));var config=require(_0x5824('0x8'));var attributes=require(_0x5824('0x9'));module['exports']=function(_0x19fad3,_0x609318){return _0x19fad3['define'](_0x5824('0xa'),attributes,{'tableName':_0x5824('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f7c=['exports','MailServerIn','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./mailServerIn.attributes'];(function(_0x144298,_0x402234){var _0x478d43=function(_0x16af6b){while(--_0x16af6b){_0x144298['push'](_0x144298['shift']());}};_0x478d43(++_0x402234);}(_0x9f7c,0xd3));var _0xc9f7=function(_0x6134d5,_0x3669a1){_0x6134d5=_0x6134d5-0x0;var _0xd8f723=_0x9f7c[_0x6134d5];return _0xd8f723;};'use strict';var _=require(_0xc9f7('0x0'));var util=require(_0xc9f7('0x1'));var logger=require('../../config/logger')(_0xc9f7('0x2'));var moment=require(_0xc9f7('0x3'));var BPromise=require(_0xc9f7('0x4'));var rp=require(_0xc9f7('0x5'));var fs=require('fs');var path=require(_0xc9f7('0x6'));var rimraf=require(_0xc9f7('0x7'));var config=require('../../config/environment');var attributes=require(_0xc9f7('0x8'));module[_0xc9f7('0x9')]=function(_0x28f908,_0x415a66){return _0x28f908['define'](_0xc9f7('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ec08e3b..5d00531 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd17b=['debug','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','model','attributes','map','include','then','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','MailServerIn,\x20%s,\x20%s','request\x20sent'];(function(_0x178b3b,_0xf2382){var _0xe31e04=function(_0x1a8a1a){while(--_0x1a8a1a){_0x178b3b['push'](_0x178b3b['shift']());}};_0xe31e04(++_0xf2382);}(_0xd17b,0x16c));var _0xbd17=function(_0x7feb90,_0x28e700){_0x7feb90=_0x7feb90-0x0;var _0x3c5b33=_0xd17b[_0x7feb90];return _0x3c5b33;};'use strict';var _=require(_0xbd17('0x0'));var util=require(_0xbd17('0x1'));var moment=require(_0xbd17('0x2'));var BPromise=require('bluebird');var rs=require(_0xbd17('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd17('0x4'))['db'];var utils=require(_0xbd17('0x5'));var logger=require('../../config/logger')(_0xbd17('0x6'));var config=require(_0xbd17('0x7'));var jayson=require(_0xbd17('0x8'));var client=jayson[_0xbd17('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1797b5,_0xf32a90,_0x53880c){return new BPromise(function(_0x2f72ad,_0x22030f){return client['request'](_0x1797b5,_0x53880c)['then'](function(_0x209dd6){logger[_0xbd17('0xa')](_0xbd17('0xb'),_0xf32a90,_0xbd17('0xc'));logger[_0xbd17('0xd')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0xf32a90,'request\x20sent',JSON[_0xbd17('0xe')](_0x209dd6));if(_0x209dd6[_0xbd17('0xf')]){if(_0x209dd6['error'][_0xbd17('0x10')]===0x1f4){logger[_0xbd17('0xf')](_0xbd17('0xb'),_0xf32a90,_0x209dd6['error'][_0xbd17('0x11')]);return _0x22030f(_0x209dd6['error'][_0xbd17('0x11')]);}logger['error'](_0xbd17('0xb'),_0xf32a90,_0x209dd6[_0xbd17('0xf')]['message']);return _0x2f72ad(_0x209dd6[_0xbd17('0xf')][_0xbd17('0x11')]);}else{logger[_0xbd17('0xa')](_0xbd17('0xb'),_0xf32a90,_0xbd17('0xc'));_0x2f72ad(_0x209dd6[_0xbd17('0x12')]['message']);}})[_0xbd17('0x13')](function(_0x564e17){logger[_0xbd17('0xf')](_0xbd17('0xb'),_0xf32a90,_0x564e17);_0x22030f(_0x564e17);});});}exports[_0xbd17('0x14')]=function(_0x429285){var _0x47be4b=this;return new Promise(function(_0xbff5fd,_0x1e3c58){return db[_0xbd17('0x15')][_0xbd17('0x16')]({'raw':_0x429285[_0xbd17('0x17')]?_0x429285[_0xbd17('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x429285[_0xbd17('0x17')]?_0x429285[_0xbd17('0x17')]['where']||null:null,'attributes':_0x429285[_0xbd17('0x17')]?_0x429285[_0xbd17('0x17')]['attributes']||null:null,'limit':_0x429285[_0xbd17('0x17')]?_0x429285[_0xbd17('0x17')]['limit']||null:null,'include':_0x429285[_0xbd17('0x17')]?_0x429285[_0xbd17('0x17')]['include']?_['map'](_0x429285[_0xbd17('0x17')]['include'],function(_0x3c4ca2){return{'model':db[_0x3c4ca2[_0xbd17('0x18')]],'as':_0x3c4ca2['as'],'attributes':_0x3c4ca2[_0xbd17('0x19')],'include':_0x3c4ca2['include']?_[_0xbd17('0x1a')](_0x3c4ca2[_0xbd17('0x1b')],function(_0x2e9cf4){return{'model':db[_0x2e9cf4['model']],'as':_0x2e9cf4['as'],'attributes':_0x2e9cf4[_0xbd17('0x19')],'include':_0x2e9cf4['include']?_[_0xbd17('0x1a')](_0x2e9cf4[_0xbd17('0x1b')],function(_0x160980){return{'model':db[_0x160980[_0xbd17('0x18')]],'as':_0x160980['as'],'attributes':_0x160980['attributes']};}):[]};}):[]};}):[]:[]})[_0xbd17('0x1c')](function(_0x28af0c){logger[_0xbd17('0xa')](_0xbd17('0x14'),_0x429285);logger[_0xbd17('0xd')]('GetMailServerIn',_0x429285,JSON['stringify'](_0x28af0c));_0xbff5fd(_0x28af0c);})['catch'](function(_0x5cacf2){logger[_0xbd17('0xf')](_0xbd17('0x14'),_0x5cacf2[_0xbd17('0x11')],_0x429285);_0x1e3c58(_0x47be4b[_0xbd17('0xf')](0x1f4,_0x5cacf2['message']));});});};
\ No newline at end of file
+var _0xf6ec=['then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf6ec,0x198));var _0xcf6e=function(_0x5ed10c,_0x1ac023){_0x5ed10c=_0x5ed10c-0x0;var _0x572d1b=_0xf6ec[_0x5ed10c];return _0x572d1b;};'use strict';var _=require('lodash');var util=require(_0xcf6e('0x0'));var moment=require(_0xcf6e('0x1'));var BPromise=require(_0xcf6e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf6e('0x3'));var db=require(_0xcf6e('0x4'))['db'];var utils=require(_0xcf6e('0x5'));var logger=require(_0xcf6e('0x6'))(_0xcf6e('0x7'));var config=require(_0xcf6e('0x8'));var jayson=require(_0xcf6e('0x9'));var client=jayson[_0xcf6e('0xa')][_0xcf6e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15d212,_0x48b426,_0x3c8df1){return new BPromise(function(_0x36a925,_0x191531){return client['request'](_0x15d212,_0x3c8df1)[_0xcf6e('0xc')](function(_0x24b15a){logger['info'](_0xcf6e('0xd'),_0x48b426,_0xcf6e('0xe'));logger[_0xcf6e('0xf')](_0xcf6e('0x10'),_0x48b426,'request\x20sent',JSON[_0xcf6e('0x11')](_0x24b15a));if(_0x24b15a[_0xcf6e('0x12')]){if(_0x24b15a[_0xcf6e('0x12')][_0xcf6e('0x13')]===0x1f4){logger['error'](_0xcf6e('0xd'),_0x48b426,_0x24b15a[_0xcf6e('0x12')][_0xcf6e('0x14')]);return _0x191531(_0x24b15a[_0xcf6e('0x12')]['message']);}logger[_0xcf6e('0x12')](_0xcf6e('0xd'),_0x48b426,_0x24b15a[_0xcf6e('0x12')][_0xcf6e('0x14')]);return _0x36a925(_0x24b15a['error'][_0xcf6e('0x14')]);}else{logger[_0xcf6e('0x15')](_0xcf6e('0xd'),_0x48b426,_0xcf6e('0xe'));_0x36a925(_0x24b15a[_0xcf6e('0x16')]['message']);}})[_0xcf6e('0x17')](function(_0x475837){logger[_0xcf6e('0x12')](_0xcf6e('0xd'),_0x48b426,_0x475837);_0x191531(_0x475837);});});}exports[_0xcf6e('0x18')]=function(_0x3e5a63){var _0x25caec=this;return new Promise(function(_0x207a9f,_0x4197e5){return db[_0xcf6e('0x19')][_0xcf6e('0x1a')]({'raw':_0x3e5a63[_0xcf6e('0x1b')]?_0x3e5a63[_0xcf6e('0x1b')][_0xcf6e('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e5a63[_0xcf6e('0x1b')]?_0x3e5a63[_0xcf6e('0x1b')][_0xcf6e('0x1d')]||null:null,'attributes':_0x3e5a63[_0xcf6e('0x1b')]?_0x3e5a63['options'][_0xcf6e('0x1e')]||null:null,'limit':_0x3e5a63[_0xcf6e('0x1b')]?_0x3e5a63[_0xcf6e('0x1b')][_0xcf6e('0x1f')]||null:null,'include':_0x3e5a63[_0xcf6e('0x1b')]?_0x3e5a63[_0xcf6e('0x1b')][_0xcf6e('0x20')]?_[_0xcf6e('0x21')](_0x3e5a63[_0xcf6e('0x1b')]['include'],function(_0x4ef26d){return{'model':db[_0x4ef26d[_0xcf6e('0x22')]],'as':_0x4ef26d['as'],'attributes':_0x4ef26d[_0xcf6e('0x1e')],'include':_0x4ef26d[_0xcf6e('0x20')]?_[_0xcf6e('0x21')](_0x4ef26d[_0xcf6e('0x20')],function(_0x41c92b){return{'model':db[_0x41c92b[_0xcf6e('0x22')]],'as':_0x41c92b['as'],'attributes':_0x41c92b[_0xcf6e('0x1e')],'include':_0x41c92b[_0xcf6e('0x20')]?_[_0xcf6e('0x21')](_0x41c92b[_0xcf6e('0x20')],function(_0x34a500){return{'model':db[_0x34a500[_0xcf6e('0x22')]],'as':_0x34a500['as'],'attributes':_0x34a500[_0xcf6e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcf6e('0xc')](function(_0x1d15c3){logger[_0xcf6e('0x15')]('GetMailServerIn',_0x3e5a63);logger['debug'](_0xcf6e('0x18'),_0x3e5a63,JSON[_0xcf6e('0x11')](_0x1d15c3));_0x207a9f(_0x1d15c3);})[_0xcf6e('0x17')](function(_0x30f46a){logger[_0xcf6e('0x12')](_0xcf6e('0x18'),_0x30f46a[_0xcf6e('0x14')],_0x3e5a63);_0x4197e5(_0x25caec[_0xcf6e('0x12')](0x1f4,_0x30f46a[_0xcf6e('0x14')]));});});};
\ No newline at end of file
index eb2b115..6e3fcdc 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(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x7a54,0x106));var _0x47a5=function(_0x59e288,_0x2737d2){_0x59e288=_0x59e288-0x0;var _0x1c45ad=_0x7a54[_0x59e288];return _0x1c45ad;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
+var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
index 452c545..f3e5d13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9348=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x49b0bf,_0x2c50e9){var _0x4e6b5c=function(_0x2eaf9e){while(--_0x2eaf9e){_0x49b0bf['push'](_0x49b0bf['shift']());}};_0x4e6b5c(++_0x2c50e9);}(_0x9348,0x10d));var _0x8934=function(_0x7725a7,_0x5d029e){_0x7725a7=_0x7725a7-0x0;var _0x52e82e=_0x9348[_0x7725a7];return _0x52e82e;};'use strict';var Sequelize=require(_0x8934('0x0'));module[_0x8934('0x1')]={'description':{'type':Sequelize[_0x8934('0x2')]},'host':{'type':Sequelize[_0x8934('0x2')]},'user':{'type':Sequelize[_0x8934('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x8934('0x3')]},'secure':{'type':Sequelize[_0x8934('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x8934('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x8934('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x97c1=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x222388,_0x1f0a9b){var _0x4c4de5=function(_0x2a9616){while(--_0x2a9616){_0x222388['push'](_0x222388['shift']());}};_0x4c4de5(++_0x1f0a9b);}(_0x97c1,0xdf));var _0x197c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x97c1[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x197c('0x0'));module[_0x197c('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x197c('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x197c('0x3')]},'secure':{'type':Sequelize[_0x197c('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x197c('0x2')]},'authentication':{'type':Sequelize[_0x197c('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x197c('0x4')],'defaultValue':![]}};
\ No newline at end of file
index e448ae8..638eadd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74da=['Content-Range','apply','save','destroy','then','stack','name','send','index','map','MailServerOut','rawAttributes','type','key','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','keys','includeAll','options','find','create','update','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','desk.js','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','undefined','limit','count','offset','set'];(function(_0x3486c8,_0x115f9c){var _0x32e6e5=function(_0x54fd3c){while(--_0x54fd3c){_0x3486c8['push'](_0x3486c8['shift']());}};_0x32e6e5(++_0x115f9c);}(_0x74da,0x10b));var _0xa74d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x74da[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa74d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa74d('0x1'));var rp=require(_0xa74d('0x2'));var moment=require(_0xa74d('0x3'));var BPromise=require(_0xa74d('0x4'));var Mustache=require(_0xa74d('0x5'));var util=require(_0xa74d('0x6'));var path=require(_0xa74d('0x7'));var sox=require(_0xa74d('0x8'));var csv=require('to-csv');var ejs=require(_0xa74d('0x9'));var fs=require('fs');var fs_extra=require(_0xa74d('0xa'));var _=require(_0xa74d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa74d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa74d('0xd'));var Redis=require(_0xa74d('0xe'));var authService=require(_0xa74d('0xf'));var qs=require(_0xa74d('0x10'));var as=require(_0xa74d('0x11'));var hardwareService=require(_0xa74d('0x12'));var logger=require(_0xa74d('0x13'))(_0xa74d('0x14'));var utils=require(_0xa74d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa74d('0x16'));var db=require(_0xa74d('0x17'))['db'];function respondWithStatusCode(_0x3a59e0,_0x3c2168){_0x3c2168=_0x3c2168||0xcc;return function(_0x109ab8){if(_0x109ab8){return _0x3a59e0[_0xa74d('0x18')](_0x3c2168);}return _0x3a59e0[_0xa74d('0x19')](_0x3c2168)[_0xa74d('0x1a')]();};}function respondWithResult(_0x593bcc,_0x42324e){_0x42324e=_0x42324e||0xc8;return function(_0x533c29){if(_0x533c29){return _0x593bcc[_0xa74d('0x19')](_0x42324e)[_0xa74d('0x1b')](_0x533c29);}};}function respondWithFilteredResult(_0x959be3,_0x194baa){return function(_0x4eced5){if(_0x4eced5){var _0x4e3631=typeof _0x194baa['offset']===_0xa74d('0x1c')&&typeof _0x194baa[_0xa74d('0x1d')]===_0xa74d('0x1c');var _0x380514=_0x4eced5[_0xa74d('0x1e')];var _0x12392d=_0x4e3631?0x0:_0x194baa[_0xa74d('0x1f')];var _0x7cdff7=_0x4e3631?_0x4eced5['count']:_0x194baa[_0xa74d('0x1f')]+_0x194baa[_0xa74d('0x1d')];var _0x1bd7db;if(_0x7cdff7>=_0x380514){_0x7cdff7=_0x380514;_0x1bd7db=0xc8;}else{_0x1bd7db=0xce;}_0x959be3[_0xa74d('0x19')](_0x1bd7db);return _0x959be3[_0xa74d('0x20')](_0xa74d('0x21'),_0x12392d+'-'+_0x7cdff7+'/'+_0x380514)[_0xa74d('0x1b')](_0x4eced5);}return null;};}function patchUpdates(_0x4d1b98){return function(_0x4a1b27){try{jsonpatch[_0xa74d('0x22')](_0x4a1b27,_0x4d1b98,!![]);}catch(_0x52500e){return BPromise['reject'](_0x52500e);}return _0x4a1b27[_0xa74d('0x23')]();};}function saveUpdates(_0x2b735c,_0x3249a9){return function(_0x4a69b2){if(_0x4a69b2){return _0x4a69b2['update'](_0x2b735c)['then'](function(_0x46950f){return _0x46950f;});}return null;};}function removeEntity(_0x41cb46,_0x3df2b0){return function(_0x5a5994){if(_0x5a5994){return _0x5a5994[_0xa74d('0x24')]()[_0xa74d('0x25')](function(){_0x41cb46['status'](0xcc)[_0xa74d('0x1a')]();});}};}function handleEntityNotFound(_0x1c036d,_0x4c8e24){return function(_0x13321d){if(!_0x13321d){_0x1c036d[_0xa74d('0x18')](0x194);}return _0x13321d;};}function handleError(_0x4cee67,_0x277289){_0x277289=_0x277289||0x1f4;return function(_0x4ddb91){logger['error'](_0x4ddb91[_0xa74d('0x26')]);if(_0x4ddb91[_0xa74d('0x27')]){delete _0x4ddb91['name'];}_0x4cee67[_0xa74d('0x19')](_0x277289)[_0xa74d('0x28')](_0x4ddb91);};}exports[_0xa74d('0x29')]=function(_0x34fda2,_0x4e54e7){var _0x10d085={},_0x2227ca={},_0x12ce4f={'count':0x0,'rows':[]};var _0x3ef413=_[_0xa74d('0x2a')](db[_0xa74d('0x2b')][_0xa74d('0x2c')],function(_0x211db6){return{'name':_0x211db6['fieldName'],'type':_0x211db6[_0xa74d('0x2d')][_0xa74d('0x2e')]};});_0x2227ca['model']=_[_0xa74d('0x2a')](_0x3ef413,'name');_0x2227ca['query']=_['keys'](_0x34fda2['query']);_0x2227ca[_0xa74d('0x2f')]=_[_0xa74d('0x30')](_0x2227ca[_0xa74d('0x31')],_0x2227ca[_0xa74d('0x32')]);_0x10d085[_0xa74d('0x33')]=_[_0xa74d('0x30')](_0x2227ca['model'],qs[_0xa74d('0x34')](_0x34fda2[_0xa74d('0x32')]['fields']));_0x10d085[_0xa74d('0x33')]=_0x10d085[_0xa74d('0x33')][_0xa74d('0x35')]?_0x10d085[_0xa74d('0x33')]:_0x2227ca['model'];if(!_0x34fda2['query'][_0xa74d('0x36')](_0xa74d('0x37'))){_0x10d085[_0xa74d('0x1d')]=qs[_0xa74d('0x1d')](_0x34fda2[_0xa74d('0x32')][_0xa74d('0x1d')]);_0x10d085[_0xa74d('0x1f')]=qs['offset'](_0x34fda2['query'][_0xa74d('0x1f')]);}_0x10d085['order']=qs[_0xa74d('0x38')](_0x34fda2[_0xa74d('0x32')][_0xa74d('0x38')]);_0x10d085[_0xa74d('0x39')]=qs['filters'](_[_0xa74d('0x3a')](_0x34fda2[_0xa74d('0x32')],_0x2227ca[_0xa74d('0x2f')]),_0x3ef413);if(_0x34fda2[_0xa74d('0x32')][_0xa74d('0x3b')]){_0x10d085[_0xa74d('0x39')]=_['merge'](_0x10d085['where'],{'$or':_[_0xa74d('0x2a')](_0x3ef413,function(_0x3e00e4){if(_0x3e00e4[_0xa74d('0x2d')]!==_0xa74d('0x3c')){var _0x3b4539={};_0x3b4539[_0x3e00e4['name']]={'$like':'%'+_0x34fda2[_0xa74d('0x32')][_0xa74d('0x3b')]+'%'};return _0x3b4539;}})});}_0x10d085=_[_0xa74d('0x3d')]({},_0x10d085,_0x34fda2['options']);var _0x41cf46={'where':_0x10d085[_0xa74d('0x39')]};return db['MailServerOut']['count'](_0x41cf46)[_0xa74d('0x25')](function(_0x2031ed){_0x12ce4f[_0xa74d('0x1e')]=_0x2031ed;if(_0x34fda2[_0xa74d('0x32')]['includeAll']){_0x10d085[_0xa74d('0x3e')]=[{'all':!![]}];}return db[_0xa74d('0x2b')][_0xa74d('0x3f')](_0x10d085);})[_0xa74d('0x25')](function(_0x4172e7){_0x12ce4f[_0xa74d('0x40')]=_0x4172e7;return _0x12ce4f;})['then'](respondWithFilteredResult(_0x4e54e7,_0x10d085))[_0xa74d('0x41')](handleError(_0x4e54e7,null));};exports[_0xa74d('0x42')]=function(_0x24bd91,_0x1e4a99){var _0x5a5882={'raw':!![],'where':{'id':_0x24bd91[_0xa74d('0x43')]['id']}},_0x1baaa6={};_0x1baaa6['model']=_['keys'](db['MailServerOut'][_0xa74d('0x2c')]);_0x1baaa6['query']=_[_0xa74d('0x44')](_0x24bd91[_0xa74d('0x32')]);_0x1baaa6['filters']=_[_0xa74d('0x30')](_0x1baaa6[_0xa74d('0x31')],_0x1baaa6[_0xa74d('0x32')]);_0x5a5882['attributes']=_[_0xa74d('0x30')](_0x1baaa6['model'],qs[_0xa74d('0x34')](_0x24bd91[_0xa74d('0x32')][_0xa74d('0x34')]));_0x5a5882[_0xa74d('0x33')]=_0x5a5882[_0xa74d('0x33')]['length']?_0x5a5882[_0xa74d('0x33')]:_0x1baaa6[_0xa74d('0x31')];if(_0x24bd91['query'][_0xa74d('0x45')]){_0x5a5882[_0xa74d('0x3e')]=[{'all':!![]}];}_0x5a5882=_[_0xa74d('0x3d')]({},_0x5a5882,_0x24bd91[_0xa74d('0x46')]);return db['MailServerOut'][_0xa74d('0x47')](_0x5a5882)[_0xa74d('0x25')](handleEntityNotFound(_0x1e4a99,null))[_0xa74d('0x25')](respondWithResult(_0x1e4a99,null))[_0xa74d('0x41')](handleError(_0x1e4a99,null));};exports[_0xa74d('0x48')]=function(_0x3e9417,_0x4b3335){return db[_0xa74d('0x2b')][_0xa74d('0x48')](_0x3e9417['body'],{})['then'](respondWithResult(_0x4b3335,0xc9))[_0xa74d('0x41')](handleError(_0x4b3335,null));};exports[_0xa74d('0x49')]=function(_0x5d2a0d,_0x31ceec){if(_0x5d2a0d['body']['id']){delete _0x5d2a0d[_0xa74d('0x4a')]['id'];}return db[_0xa74d('0x2b')][_0xa74d('0x47')]({'where':{'id':_0x5d2a0d[_0xa74d('0x43')]['id']}})[_0xa74d('0x25')](handleEntityNotFound(_0x31ceec,null))['then'](saveUpdates(_0x5d2a0d[_0xa74d('0x4a')],null))[_0xa74d('0x25')](respondWithResult(_0x31ceec,null))[_0xa74d('0x41')](handleError(_0x31ceec,null));};exports[_0xa74d('0x24')]=function(_0x5c1835,_0x4fa58d){return db[_0xa74d('0x2b')][_0xa74d('0x47')]({'where':{'id':_0x5c1835['params']['id']}})[_0xa74d('0x25')](handleEntityNotFound(_0x4fa58d,null))[_0xa74d('0x25')](removeEntity(_0x4fa58d,null))['catch'](handleError(_0x4fa58d,null));};
\ No newline at end of file
+var _0x7c16=['merge','VIRTUAL','filter','options','rows','show','params','intersection','includeAll','find','catch','create','body','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','stack','name','index','map','MailServerOut','rawAttributes','type','key','model','query','keys','filters','fields','attributes','length','order','sort','where','pick'];(function(_0x37f4f2,_0xfd97d3){var _0x3819ac=function(_0xceca9d){while(--_0xceca9d){_0x37f4f2['push'](_0x37f4f2['shift']());}};_0x3819ac(++_0xfd97d3);}(_0x7c16,0x1c3));var _0x67c1=function(_0x15718e,_0x2f5096){_0x15718e=_0x15718e-0x0;var _0xf3b1d2=_0x7c16[_0x15718e];return _0xf3b1d2;};'use strict';var emlformat=require(_0x67c1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x67c1('0x1'));var moment=require(_0x67c1('0x2'));var BPromise=require(_0x67c1('0x3'));var Mustache=require(_0x67c1('0x4'));var util=require(_0x67c1('0x5'));var path=require(_0x67c1('0x6'));var sox=require(_0x67c1('0x7'));var csv=require(_0x67c1('0x8'));var ejs=require(_0x67c1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x67c1('0xa'));var squel=require(_0x67c1('0xb'));var crypto=require(_0x67c1('0xc'));var jsforce=require(_0x67c1('0xd'));var deskjs=require(_0x67c1('0xe'));var toCsv=require(_0x67c1('0x8'));var querystring=require(_0x67c1('0xf'));var Papa=require(_0x67c1('0x10'));var Redis=require(_0x67c1('0x11'));var authService=require(_0x67c1('0x12'));var qs=require(_0x67c1('0x13'));var as=require(_0x67c1('0x14'));var hardwareService=require(_0x67c1('0x15'));var logger=require(_0x67c1('0x16'))(_0x67c1('0x17'));var utils=require(_0x67c1('0x18'));var config=require(_0x67c1('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x67c1('0x1a'))['db'];function respondWithStatusCode(_0x3e86c1,_0x5bfbe4){_0x5bfbe4=_0x5bfbe4||0xcc;return function(_0x10d3c0){if(_0x10d3c0){return _0x3e86c1[_0x67c1('0x1b')](_0x5bfbe4);}return _0x3e86c1['status'](_0x5bfbe4)[_0x67c1('0x1c')]();};}function respondWithResult(_0x17f059,_0x24d89b){_0x24d89b=_0x24d89b||0xc8;return function(_0x2c9bab){if(_0x2c9bab){return _0x17f059[_0x67c1('0x1d')](_0x24d89b)[_0x67c1('0x1e')](_0x2c9bab);}};}function respondWithFilteredResult(_0x4cf00a,_0x4b343b){return function(_0x105f0e){if(_0x105f0e){var _0x3c6cbd=typeof _0x4b343b['offset']===_0x67c1('0x1f')&&typeof _0x4b343b[_0x67c1('0x20')]==='undefined';var _0x1a44b2=_0x105f0e[_0x67c1('0x21')];var _0x27c00a=_0x3c6cbd?0x0:_0x4b343b[_0x67c1('0x22')];var _0x30b5b5=_0x3c6cbd?_0x105f0e['count']:_0x4b343b['offset']+_0x4b343b[_0x67c1('0x20')];var _0x20d582;if(_0x30b5b5>=_0x1a44b2){_0x30b5b5=_0x1a44b2;_0x20d582=0xc8;}else{_0x20d582=0xce;}_0x4cf00a[_0x67c1('0x1d')](_0x20d582);return _0x4cf00a[_0x67c1('0x23')]('Content-Range',_0x27c00a+'-'+_0x30b5b5+'/'+_0x1a44b2)[_0x67c1('0x1e')](_0x105f0e);}return null;};}function patchUpdates(_0x33b76e){return function(_0x67eacf){try{jsonpatch[_0x67c1('0x24')](_0x67eacf,_0x33b76e,!![]);}catch(_0x1d6c09){return BPromise[_0x67c1('0x25')](_0x1d6c09);}return _0x67eacf[_0x67c1('0x26')]();};}function saveUpdates(_0x3538cb,_0x3f0b95){return function(_0x2656e8){if(_0x2656e8){return _0x2656e8[_0x67c1('0x27')](_0x3538cb)[_0x67c1('0x28')](function(_0x193303){return _0x193303;});}return null;};}function removeEntity(_0xffa4b8,_0x5a2642){return function(_0x596059){if(_0x596059){return _0x596059['destroy']()['then'](function(){_0xffa4b8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d6a70,_0x291223){return function(_0x1b5193){if(!_0x1b5193){_0x1d6a70[_0x67c1('0x1b')](0x194);}return _0x1b5193;};}function handleError(_0x413035,_0x3adbc6){_0x3adbc6=_0x3adbc6||0x1f4;return function(_0x4ea03b){logger['error'](_0x4ea03b[_0x67c1('0x29')]);if(_0x4ea03b[_0x67c1('0x2a')]){delete _0x4ea03b[_0x67c1('0x2a')];}_0x413035[_0x67c1('0x1d')](_0x3adbc6)['send'](_0x4ea03b);};}exports[_0x67c1('0x2b')]=function(_0x344c28,_0x268fa5){var _0x3f6bba={},_0x3bab79={},_0x4515fb={'count':0x0,'rows':[]};var _0x5255c9=_[_0x67c1('0x2c')](db[_0x67c1('0x2d')][_0x67c1('0x2e')],function(_0x19d28e){return{'name':_0x19d28e['fieldName'],'type':_0x19d28e[_0x67c1('0x2f')][_0x67c1('0x30')]};});_0x3bab79[_0x67c1('0x31')]=_['map'](_0x5255c9,'name');_0x3bab79[_0x67c1('0x32')]=_[_0x67c1('0x33')](_0x344c28[_0x67c1('0x32')]);_0x3bab79[_0x67c1('0x34')]=_['intersection'](_0x3bab79[_0x67c1('0x31')],_0x3bab79[_0x67c1('0x32')]);_0x3f6bba['attributes']=_['intersection'](_0x3bab79[_0x67c1('0x31')],qs[_0x67c1('0x35')](_0x344c28[_0x67c1('0x32')][_0x67c1('0x35')]));_0x3f6bba['attributes']=_0x3f6bba[_0x67c1('0x36')][_0x67c1('0x37')]?_0x3f6bba['attributes']:_0x3bab79['model'];if(!_0x344c28[_0x67c1('0x32')]['hasOwnProperty']('nolimit')){_0x3f6bba[_0x67c1('0x20')]=qs[_0x67c1('0x20')](_0x344c28[_0x67c1('0x32')][_0x67c1('0x20')]);_0x3f6bba[_0x67c1('0x22')]=qs['offset'](_0x344c28[_0x67c1('0x32')]['offset']);}_0x3f6bba[_0x67c1('0x38')]=qs['sort'](_0x344c28[_0x67c1('0x32')][_0x67c1('0x39')]);_0x3f6bba[_0x67c1('0x3a')]=qs[_0x67c1('0x34')](_[_0x67c1('0x3b')](_0x344c28['query'],_0x3bab79[_0x67c1('0x34')]),_0x5255c9);if(_0x344c28['query']['filter']){_0x3f6bba[_0x67c1('0x3a')]=_[_0x67c1('0x3c')](_0x3f6bba['where'],{'$or':_['map'](_0x5255c9,function(_0x5c60ad){if(_0x5c60ad[_0x67c1('0x2f')]!==_0x67c1('0x3d')){var _0x3e4f94={};_0x3e4f94[_0x5c60ad[_0x67c1('0x2a')]]={'$like':'%'+_0x344c28[_0x67c1('0x32')][_0x67c1('0x3e')]+'%'};return _0x3e4f94;}})});}_0x3f6bba=_[_0x67c1('0x3c')]({},_0x3f6bba,_0x344c28[_0x67c1('0x3f')]);var _0x5bff69={'where':_0x3f6bba[_0x67c1('0x3a')]};return db['MailServerOut'][_0x67c1('0x21')](_0x5bff69)[_0x67c1('0x28')](function(_0x54568c){_0x4515fb[_0x67c1('0x21')]=_0x54568c;if(_0x344c28[_0x67c1('0x32')]['includeAll']){_0x3f6bba['include']=[{'all':!![]}];}return db[_0x67c1('0x2d')]['findAll'](_0x3f6bba);})[_0x67c1('0x28')](function(_0x9b14c){_0x4515fb[_0x67c1('0x40')]=_0x9b14c;return _0x4515fb;})[_0x67c1('0x28')](respondWithFilteredResult(_0x268fa5,_0x3f6bba))['catch'](handleError(_0x268fa5,null));};exports[_0x67c1('0x41')]=function(_0x375661,_0x556c4a){var _0x2b8e7e={'raw':!![],'where':{'id':_0x375661[_0x67c1('0x42')]['id']}},_0xff3ff4={};_0xff3ff4[_0x67c1('0x31')]=_['keys'](db[_0x67c1('0x2d')][_0x67c1('0x2e')]);_0xff3ff4[_0x67c1('0x32')]=_['keys'](_0x375661['query']);_0xff3ff4[_0x67c1('0x34')]=_[_0x67c1('0x43')](_0xff3ff4['model'],_0xff3ff4[_0x67c1('0x32')]);_0x2b8e7e['attributes']=_['intersection'](_0xff3ff4[_0x67c1('0x31')],qs['fields'](_0x375661['query'][_0x67c1('0x35')]));_0x2b8e7e[_0x67c1('0x36')]=_0x2b8e7e[_0x67c1('0x36')][_0x67c1('0x37')]?_0x2b8e7e['attributes']:_0xff3ff4[_0x67c1('0x31')];if(_0x375661[_0x67c1('0x32')][_0x67c1('0x44')]){_0x2b8e7e['include']=[{'all':!![]}];}_0x2b8e7e=_[_0x67c1('0x3c')]({},_0x2b8e7e,_0x375661['options']);return db[_0x67c1('0x2d')][_0x67c1('0x45')](_0x2b8e7e)[_0x67c1('0x28')](handleEntityNotFound(_0x556c4a,null))['then'](respondWithResult(_0x556c4a,null))[_0x67c1('0x46')](handleError(_0x556c4a,null));};exports[_0x67c1('0x47')]=function(_0x2d7fb8,_0x127593){return db[_0x67c1('0x2d')][_0x67c1('0x47')](_0x2d7fb8[_0x67c1('0x48')],{})[_0x67c1('0x28')](respondWithResult(_0x127593,0xc9))['catch'](handleError(_0x127593,null));};exports[_0x67c1('0x27')]=function(_0x3a537c,_0x80f0a8){if(_0x3a537c[_0x67c1('0x48')]['id']){delete _0x3a537c['body']['id'];}return db[_0x67c1('0x2d')][_0x67c1('0x45')]({'where':{'id':_0x3a537c[_0x67c1('0x42')]['id']}})['then'](handleEntityNotFound(_0x80f0a8,null))['then'](saveUpdates(_0x3a537c[_0x67c1('0x48')],null))[_0x67c1('0x28')](respondWithResult(_0x80f0a8,null))[_0x67c1('0x46')](handleError(_0x80f0a8,null));};exports['destroy']=function(_0x1dc4db,_0x15700a){return db[_0x67c1('0x2d')][_0x67c1('0x45')]({'where':{'id':_0x1dc4db[_0x67c1('0x42')]['id']}})['then'](handleEntityNotFound(_0x15700a,null))[_0x67c1('0x28')](removeEntity(_0x15700a,null))[_0x67c1('0x46')](handleError(_0x15700a,null));};
\ No newline at end of file
index b0fab88..76dad79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdeed=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./mailServerOut.attributes','exports','define','MailServerOut'];(function(_0x4179e2,_0xf2dbb){var _0x24cb50=function(_0x3b7899){while(--_0x3b7899){_0x4179e2['push'](_0x4179e2['shift']());}};_0x24cb50(++_0xf2dbb);}(_0xdeed,0x1b0));var _0xddee=function(_0x46559b,_0x5230c5){_0x46559b=_0x46559b-0x0;var _0x5b09aa=_0xdeed[_0x46559b];return _0x5b09aa;};'use strict';var _=require(_0xddee('0x0'));var util=require(_0xddee('0x1'));var logger=require('../../config/logger')(_0xddee('0x2'));var moment=require(_0xddee('0x3'));var BPromise=require(_0xddee('0x4'));var rp=require(_0xddee('0x5'));var fs=require('fs');var path=require(_0xddee('0x6'));var rimraf=require(_0xddee('0x7'));var config=require('../../config/environment');var attributes=require(_0xddee('0x8'));module[_0xddee('0x9')]=function(_0x5eea78,_0x4615a9){return _0x5eea78[_0xddee('0xa')](_0xddee('0xb'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea94=['../../config/environment','./mailServerOut.attributes','define','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x84fe44,_0x472fb8){var _0x45514a=function(_0xbcb4b9){while(--_0xbcb4b9){_0x84fe44['push'](_0x84fe44['shift']());}};_0x45514a(++_0x472fb8);}(_0xea94,0x142));var _0x4ea9=function(_0x1fe56b,_0x3860ff){_0x1fe56b=_0x1fe56b-0x0;var _0x366c40=_0xea94[_0x1fe56b];return _0x366c40;};'use strict';var _=require(_0x4ea9('0x0'));var util=require(_0x4ea9('0x1'));var logger=require('../../config/logger')(_0x4ea9('0x2'));var moment=require(_0x4ea9('0x3'));var BPromise=require(_0x4ea9('0x4'));var rp=require(_0x4ea9('0x5'));var fs=require('fs');var path=require(_0x4ea9('0x6'));var rimraf=require(_0x4ea9('0x7'));var config=require(_0x4ea9('0x8'));var attributes=require(_0x4ea9('0x9'));module['exports']=function(_0x3ad2f7,_0x27de6b){return _0x3ad2f7[_0x4ea9('0xa')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 778511f..7f67a55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x48ae8b,_0x4e278c){var _0x25eb59=function(_0x340bd2){while(--_0x340bd2){_0x48ae8b['push'](_0x48ae8b['shift']());}};_0x25eb59(++_0x4e278c);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('MailServerOut,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x21ce5f,_0x1b138b){var _0x27ea60=function(_0x4a199b){while(--_0x4a199b){_0x21ce5f['push'](_0x21ce5f['shift']());}};_0x27ea60(++_0x1b138b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x18d238,_0x5ab60d){_0x18d238=_0x18d238-0x0;var _0x2b2fd9=_0x5f2f[_0x18d238];return _0x2b2fd9;};'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});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
index e5872d4..30d1aa1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bba=['get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller'];(function(_0x1dec61,_0x36d3cc){var _0x1f16b1=function(_0x2eb0f8){while(--_0x2eb0f8){_0x1dec61['push'](_0x1dec61['shift']());}};_0x1f16b1(++_0x36d3cc);}(_0x4bba,0x19b));var _0xa4bb=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x4bba[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0xa4bb('0x0'));var util=require(_0xa4bb('0x1'));var path=require('path');var timeout=require(_0xa4bb('0x2'));var express=require(_0xa4bb('0x3'));var router=express[_0xa4bb('0x4')]();var fs_extra=require(_0xa4bb('0x5'));var auth=require(_0xa4bb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa4bb('0x7'));var controller=require(_0xa4bb('0x8'));router[_0xa4bb('0x9')]('/',auth[_0xa4bb('0xa')](),controller[_0xa4bb('0xb')]);router[_0xa4bb('0x9')](_0xa4bb('0xc'),auth[_0xa4bb('0xa')](),controller[_0xa4bb('0xd')]);router[_0xa4bb('0x9')](_0xa4bb('0xe'),auth[_0xa4bb('0xa')](),controller[_0xa4bb('0xf')]);router[_0xa4bb('0x10')]('/',auth[_0xa4bb('0xa')](),controller['create']);router[_0xa4bb('0x11')](_0xa4bb('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xa4bb('0x12')](_0xa4bb('0xe'),auth[_0xa4bb('0xa')](),controller[_0xa4bb('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xccdf=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x3afa76,_0xd7ee5a){var _0x3962fc=function(_0x44ce2f){while(--_0x44ce2f){_0x3afa76['push'](_0x3afa76['shift']());}};_0x3962fc(++_0xd7ee5a);}(_0xccdf,0xdd));var _0xfccd=function(_0x40d62b,_0x11e9b0){_0x40d62b=_0x40d62b-0x0;var _0x2cdf1f=_0xccdf[_0x40d62b];return _0x2cdf1f;};'use strict';var multer=require(_0xfccd('0x0'));var util=require(_0xfccd('0x1'));var path=require(_0xfccd('0x2'));var timeout=require(_0xfccd('0x3'));var express=require(_0xfccd('0x4'));var router=express[_0xfccd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfccd('0x6'));var interaction=require(_0xfccd('0x7'));var config=require(_0xfccd('0x8'));var controller=require(_0xfccd('0x9'));router[_0xfccd('0xa')]('/',auth[_0xfccd('0xb')](),controller[_0xfccd('0xc')]);router[_0xfccd('0xa')](_0xfccd('0xd'),auth['isAuthenticated'](),controller[_0xfccd('0xe')]);router[_0xfccd('0xa')](_0xfccd('0xf'),auth[_0xfccd('0xb')](),controller[_0xfccd('0x10')]);router[_0xfccd('0x11')]('/',auth[_0xfccd('0xb')](),controller[_0xfccd('0x12')]);router[_0xfccd('0x13')](_0xfccd('0xf'),auth[_0xfccd('0xb')](),controller[_0xfccd('0x14')]);router[_0xfccd('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xfccd('0x16')]);module[_0xfccd('0x17')]=router;
\ No newline at end of file
index 737483d..df30e03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90ec=['sequelize','exports','name','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x90ec,0x1d4));var _0xc90e=function(_0xcc4b0c,_0xb1d3b5){_0xcc4b0c=_0xcc4b0c-0x0;var _0x24abcf=_0x90ec[_0xcc4b0c];return _0x24abcf;};'use strict';var Sequelize=require(_0xc90e('0x0'));module[_0xc90e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc90e('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc90e('0x3')]}};
\ No newline at end of file
+var _0xa498=['exports','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa498,0x1d6));var _0x8a49=function(_0x4604ad,_0x2c516e){_0x4604ad=_0x4604ad-0x0;var _0x3ed8ef=_0xa498[_0x4604ad];return _0x3ed8ef;};'use strict';var Sequelize=require('sequelize');module[_0x8a49('0x0')]={'name':{'type':Sequelize[_0x8a49('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 9bafbe2..90e3897 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b03=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','MailSubstatus','rawAttributes','fieldName','key','map','query','model','attributes','intersection','fields','nolimit','order','sort','filters','pick','filter','type','VIRTUAL','merge','options','where','includeAll','include','findAll','rows','params','keys','length','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x1fd8e3,_0x5bd0d7){var _0x993383=function(_0x37516c){while(--_0x37516c){_0x1fd8e3['push'](_0x1fd8e3['shift']());}};_0x993383(++_0x5bd0d7);}(_0x8b03,0x155));var _0x38b0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8b03[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x38b0('0x0'));var rimraf=require(_0x38b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38b0('0x2'));var rp=require('request-promise');var moment=require(_0x38b0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x38b0('0x4'));var util=require(_0x38b0('0x5'));var path=require(_0x38b0('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x38b0('0x7'));var fs=require('fs');var fs_extra=require(_0x38b0('0x8'));var _=require(_0x38b0('0x9'));var squel=require(_0x38b0('0xa'));var crypto=require('crypto');var jsforce=require(_0x38b0('0xb'));var deskjs=require(_0x38b0('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x38b0('0xd'));var Redis=require(_0x38b0('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x38b0('0xf'));var hardwareService=require(_0x38b0('0x10'));var logger=require('../../config/logger')(_0x38b0('0x11'));var utils=require(_0x38b0('0x12'));var config=require(_0x38b0('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3963b2,_0x2a092f){_0x2a092f=_0x2a092f||0xcc;return function(_0x933e72){if(_0x933e72){return _0x3963b2['sendStatus'](_0x2a092f);}return _0x3963b2[_0x38b0('0x14')](_0x2a092f)['end']();};}function respondWithResult(_0x200323,_0x4e75fd){_0x4e75fd=_0x4e75fd||0xc8;return function(_0x96aae){if(_0x96aae){return _0x200323[_0x38b0('0x14')](_0x4e75fd)[_0x38b0('0x15')](_0x96aae);}};}function respondWithFilteredResult(_0xc590d6,_0x1df81c){return function(_0x4b416b){if(_0x4b416b){var _0xac2208=typeof _0x1df81c[_0x38b0('0x16')]===_0x38b0('0x17')&&typeof _0x1df81c[_0x38b0('0x18')]===_0x38b0('0x17');var _0x511cab=_0x4b416b[_0x38b0('0x19')];var _0x5984a1=_0xac2208?0x0:_0x1df81c[_0x38b0('0x16')];var _0xd853b5=_0xac2208?_0x4b416b[_0x38b0('0x19')]:_0x1df81c[_0x38b0('0x16')]+_0x1df81c[_0x38b0('0x18')];var _0xebc25;if(_0xd853b5>=_0x511cab){_0xd853b5=_0x511cab;_0xebc25=0xc8;}else{_0xebc25=0xce;}_0xc590d6[_0x38b0('0x14')](_0xebc25);return _0xc590d6['set'](_0x38b0('0x1a'),_0x5984a1+'-'+_0xd853b5+'/'+_0x511cab)[_0x38b0('0x15')](_0x4b416b);}return null;};}function patchUpdates(_0x251716){return function(_0x5b4240){try{jsonpatch[_0x38b0('0x1b')](_0x5b4240,_0x251716,!![]);}catch(_0x65e1c8){return BPromise[_0x38b0('0x1c')](_0x65e1c8);}return _0x5b4240[_0x38b0('0x1d')]();};}function saveUpdates(_0x3ef02b,_0x1b4bc5){return function(_0x466d24){if(_0x466d24){return _0x466d24[_0x38b0('0x1e')](_0x3ef02b)[_0x38b0('0x1f')](function(_0x48c206){return _0x48c206;});}return null;};}function removeEntity(_0x7b5543,_0x212386){return function(_0x3e0fe0){if(_0x3e0fe0){return _0x3e0fe0[_0x38b0('0x20')]()[_0x38b0('0x1f')](function(){_0x7b5543[_0x38b0('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x242697,_0x3ebc2d){return function(_0x2c1739){if(!_0x2c1739){_0x242697[_0x38b0('0x21')](0x194);}return _0x2c1739;};}function handleError(_0x2f12fa,_0x60bf1c){_0x60bf1c=_0x60bf1c||0x1f4;return function(_0x1f954d){logger[_0x38b0('0x22')](_0x1f954d['stack']);if(_0x1f954d[_0x38b0('0x23')]){delete _0x1f954d[_0x38b0('0x23')];}_0x2f12fa[_0x38b0('0x14')](_0x60bf1c)[_0x38b0('0x24')](_0x1f954d);};}exports[_0x38b0('0x25')]=function(_0x248521,_0x126ee0){var _0x4f10d9={},_0x6d9704={},_0x49a590={'count':0x0,'rows':[]};var _0x2e30b4=_['map'](db[_0x38b0('0x26')][_0x38b0('0x27')],function(_0x56903c){return{'name':_0x56903c[_0x38b0('0x28')],'type':_0x56903c['type'][_0x38b0('0x29')]};});_0x6d9704['model']=_[_0x38b0('0x2a')](_0x2e30b4,'name');_0x6d9704[_0x38b0('0x2b')]=_['keys'](_0x248521[_0x38b0('0x2b')]);_0x6d9704['filters']=_['intersection'](_0x6d9704[_0x38b0('0x2c')],_0x6d9704[_0x38b0('0x2b')]);_0x4f10d9[_0x38b0('0x2d')]=_[_0x38b0('0x2e')](_0x6d9704['model'],qs[_0x38b0('0x2f')](_0x248521[_0x38b0('0x2b')]['fields']));_0x4f10d9[_0x38b0('0x2d')]=_0x4f10d9['attributes']['length']?_0x4f10d9[_0x38b0('0x2d')]:_0x6d9704[_0x38b0('0x2c')];if(!_0x248521[_0x38b0('0x2b')]['hasOwnProperty'](_0x38b0('0x30'))){_0x4f10d9['limit']=qs[_0x38b0('0x18')](_0x248521[_0x38b0('0x2b')]['limit']);_0x4f10d9[_0x38b0('0x16')]=qs[_0x38b0('0x16')](_0x248521[_0x38b0('0x2b')][_0x38b0('0x16')]);}_0x4f10d9[_0x38b0('0x31')]=qs[_0x38b0('0x32')](_0x248521[_0x38b0('0x2b')][_0x38b0('0x32')]);_0x4f10d9['where']=qs[_0x38b0('0x33')](_[_0x38b0('0x34')](_0x248521[_0x38b0('0x2b')],_0x6d9704[_0x38b0('0x33')]),_0x2e30b4);if(_0x248521[_0x38b0('0x2b')][_0x38b0('0x35')]){_0x4f10d9['where']=_['merge'](_0x4f10d9['where'],{'$or':_[_0x38b0('0x2a')](_0x2e30b4,function(_0x5c4804){if(_0x5c4804[_0x38b0('0x36')]!==_0x38b0('0x37')){var _0x4eddf0={};_0x4eddf0[_0x5c4804[_0x38b0('0x23')]]={'$like':'%'+_0x248521[_0x38b0('0x2b')][_0x38b0('0x35')]+'%'};return _0x4eddf0;}})});}_0x4f10d9=_[_0x38b0('0x38')]({},_0x4f10d9,_0x248521[_0x38b0('0x39')]);var _0x49472a={'where':_0x4f10d9[_0x38b0('0x3a')]};return db[_0x38b0('0x26')][_0x38b0('0x19')](_0x49472a)[_0x38b0('0x1f')](function(_0x55548b){_0x49a590[_0x38b0('0x19')]=_0x55548b;if(_0x248521[_0x38b0('0x2b')][_0x38b0('0x3b')]){_0x4f10d9[_0x38b0('0x3c')]=[{'all':!![]}];}return db[_0x38b0('0x26')][_0x38b0('0x3d')](_0x4f10d9);})[_0x38b0('0x1f')](function(_0x51c22c){_0x49a590[_0x38b0('0x3e')]=_0x51c22c;return _0x49a590;})[_0x38b0('0x1f')](respondWithFilteredResult(_0x126ee0,_0x4f10d9))['catch'](handleError(_0x126ee0,null));};exports['show']=function(_0x59f1ec,_0x594c55){var _0x14fe45={'raw':!![],'where':{'id':_0x59f1ec[_0x38b0('0x3f')]['id']}},_0xcbac01={};_0xcbac01[_0x38b0('0x2c')]=_['keys'](db[_0x38b0('0x26')][_0x38b0('0x27')]);_0xcbac01['query']=_[_0x38b0('0x40')](_0x59f1ec[_0x38b0('0x2b')]);_0xcbac01[_0x38b0('0x33')]=_[_0x38b0('0x2e')](_0xcbac01[_0x38b0('0x2c')],_0xcbac01[_0x38b0('0x2b')]);_0x14fe45['attributes']=_[_0x38b0('0x2e')](_0xcbac01[_0x38b0('0x2c')],qs[_0x38b0('0x2f')](_0x59f1ec[_0x38b0('0x2b')][_0x38b0('0x2f')]));_0x14fe45[_0x38b0('0x2d')]=_0x14fe45[_0x38b0('0x2d')][_0x38b0('0x41')]?_0x14fe45[_0x38b0('0x2d')]:_0xcbac01[_0x38b0('0x2c')];if(_0x59f1ec['query']['includeAll']){_0x14fe45['include']=[{'all':!![]}];}_0x14fe45=_['merge']({},_0x14fe45,_0x59f1ec['options']);return db[_0x38b0('0x26')][_0x38b0('0x42')](_0x14fe45)[_0x38b0('0x1f')](handleEntityNotFound(_0x594c55,null))[_0x38b0('0x1f')](respondWithResult(_0x594c55,null))[_0x38b0('0x43')](handleError(_0x594c55,null));};exports[_0x38b0('0x44')]=function(_0x143d78,_0x499962){return db[_0x38b0('0x26')][_0x38b0('0x44')](_0x143d78[_0x38b0('0x45')],{})[_0x38b0('0x1f')](respondWithResult(_0x499962,0xc9))[_0x38b0('0x43')](handleError(_0x499962,null));};exports[_0x38b0('0x1e')]=function(_0x4f4c22,_0x4bbbdb){if(_0x4f4c22[_0x38b0('0x45')]['id']){delete _0x4f4c22[_0x38b0('0x45')]['id'];}return db[_0x38b0('0x26')][_0x38b0('0x42')]({'where':{'id':_0x4f4c22[_0x38b0('0x3f')]['id']}})[_0x38b0('0x1f')](handleEntityNotFound(_0x4bbbdb,null))[_0x38b0('0x1f')](saveUpdates(_0x4f4c22[_0x38b0('0x45')],null))[_0x38b0('0x1f')](respondWithResult(_0x4bbbdb,null))[_0x38b0('0x43')](handleError(_0x4bbbdb,null));};exports[_0x38b0('0x20')]=function(_0x2c0a01,_0x1ff218){return db[_0x38b0('0x26')]['find']({'where':{'id':_0x2c0a01[_0x38b0('0x3f')]['id']}})[_0x38b0('0x1f')](handleEntityNotFound(_0x1ff218,null))[_0x38b0('0x1f')](removeEntity(_0x1ff218,null))[_0x38b0('0x43')](handleError(_0x1ff218,null));};exports[_0x38b0('0x46')]=function(_0x181470,_0xed3761){return db[_0x38b0('0x26')][_0x38b0('0x46')]()[_0x38b0('0x1f')](respondWithResult(_0xed3761,null))[_0x38b0('0x43')](handleError(_0xed3761,null));};
\ No newline at end of file
+var _0xabe8=['rows','catch','includeAll','merge','create','body','find','params','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options','include','findAll'];(function(_0x4df589,_0x3b59e2){var _0x261622=function(_0x3f5d29){while(--_0x3f5d29){_0x4df589['push'](_0x4df589['shift']());}};_0x261622(++_0x3b59e2);}(_0xabe8,0x1c5));var _0x8abe=function(_0x371833,_0x256a2e){_0x371833=_0x371833-0x0;var _0x2fea55=_0xabe8[_0x371833];return _0x2fea55;};'use strict';var emlformat=require(_0x8abe('0x0'));var rimraf=require(_0x8abe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8abe('0x2'));var moment=require('moment');var BPromise=require(_0x8abe('0x3'));var Mustache=require(_0x8abe('0x4'));var util=require(_0x8abe('0x5'));var path=require(_0x8abe('0x6'));var sox=require(_0x8abe('0x7'));var csv=require(_0x8abe('0x8'));var ejs=require(_0x8abe('0x9'));var fs=require('fs');var fs_extra=require(_0x8abe('0xa'));var _=require('lodash');var squel=require(_0x8abe('0xb'));var crypto=require('crypto');var jsforce=require(_0x8abe('0xc'));var deskjs=require(_0x8abe('0xd'));var toCsv=require(_0x8abe('0x8'));var querystring=require(_0x8abe('0xe'));var Papa=require(_0x8abe('0xf'));var Redis=require('ioredis');var authService=require(_0x8abe('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8abe('0x11'));var logger=require('../../config/logger')(_0x8abe('0x12'));var utils=require(_0x8abe('0x13'));var config=require(_0x8abe('0x14'));var licenseUtil=require(_0x8abe('0x15'));var db=require(_0x8abe('0x16'))['db'];function respondWithStatusCode(_0x2bb342,_0x3e22f3){_0x3e22f3=_0x3e22f3||0xcc;return function(_0x339c93){if(_0x339c93){return _0x2bb342[_0x8abe('0x17')](_0x3e22f3);}return _0x2bb342[_0x8abe('0x18')](_0x3e22f3)[_0x8abe('0x19')]();};}function respondWithResult(_0x3bb876,_0x5a9e63){_0x5a9e63=_0x5a9e63||0xc8;return function(_0x28da93){if(_0x28da93){return _0x3bb876[_0x8abe('0x18')](_0x5a9e63)[_0x8abe('0x1a')](_0x28da93);}};}function respondWithFilteredResult(_0x165f63,_0x17ea75){return function(_0x2b8b9a){if(_0x2b8b9a){var _0x1e4b67=typeof _0x17ea75['offset']===_0x8abe('0x1b')&&typeof _0x17ea75[_0x8abe('0x1c')]===_0x8abe('0x1b');var _0x1d77f3=_0x2b8b9a['count'];var _0x5787c6=_0x1e4b67?0x0:_0x17ea75[_0x8abe('0x1d')];var _0x3bb5bb=_0x1e4b67?_0x2b8b9a[_0x8abe('0x1e')]:_0x17ea75['offset']+_0x17ea75['limit'];var _0x4ce7b2;if(_0x3bb5bb>=_0x1d77f3){_0x3bb5bb=_0x1d77f3;_0x4ce7b2=0xc8;}else{_0x4ce7b2=0xce;}_0x165f63[_0x8abe('0x18')](_0x4ce7b2);return _0x165f63[_0x8abe('0x1f')](_0x8abe('0x20'),_0x5787c6+'-'+_0x3bb5bb+'/'+_0x1d77f3)['json'](_0x2b8b9a);}return null;};}function patchUpdates(_0xcd0964){return function(_0x278ec4){try{jsonpatch[_0x8abe('0x21')](_0x278ec4,_0xcd0964,!![]);}catch(_0x4aeb77){return BPromise['reject'](_0x4aeb77);}return _0x278ec4['save']();};}function saveUpdates(_0x4f242e,_0x544804){return function(_0x1f1f58){if(_0x1f1f58){return _0x1f1f58[_0x8abe('0x22')](_0x4f242e)[_0x8abe('0x23')](function(_0x4fd70f){return _0x4fd70f;});}return null;};}function removeEntity(_0x284d25,_0x47100a){return function(_0xe29aad){if(_0xe29aad){return _0xe29aad['destroy']()[_0x8abe('0x23')](function(){_0x284d25[_0x8abe('0x18')](0xcc)[_0x8abe('0x19')]();});}};}function handleEntityNotFound(_0x30d9bb,_0x262e3a){return function(_0x37ae80){if(!_0x37ae80){_0x30d9bb[_0x8abe('0x17')](0x194);}return _0x37ae80;};}function handleError(_0x2d1bbd,_0x3ed81e){_0x3ed81e=_0x3ed81e||0x1f4;return function(_0x2f5c6){logger[_0x8abe('0x24')](_0x2f5c6[_0x8abe('0x25')]);if(_0x2f5c6['name']){delete _0x2f5c6[_0x8abe('0x26')];}_0x2d1bbd[_0x8abe('0x18')](_0x3ed81e)[_0x8abe('0x27')](_0x2f5c6);};}exports[_0x8abe('0x28')]=function(_0x138f0e,_0x409c38){var _0x176bf3={},_0x524555={},_0xfd6b98={'count':0x0,'rows':[]};var _0x745d0b=_[_0x8abe('0x29')](db[_0x8abe('0x2a')][_0x8abe('0x2b')],function(_0x3452b8){return{'name':_0x3452b8[_0x8abe('0x2c')],'type':_0x3452b8[_0x8abe('0x2d')][_0x8abe('0x2e')]};});_0x524555[_0x8abe('0x2f')]=_[_0x8abe('0x29')](_0x745d0b,_0x8abe('0x26'));_0x524555[_0x8abe('0x30')]=_[_0x8abe('0x31')](_0x138f0e[_0x8abe('0x30')]);_0x524555[_0x8abe('0x32')]=_['intersection'](_0x524555[_0x8abe('0x2f')],_0x524555[_0x8abe('0x30')]);_0x176bf3[_0x8abe('0x33')]=_[_0x8abe('0x34')](_0x524555['model'],qs[_0x8abe('0x35')](_0x138f0e[_0x8abe('0x30')][_0x8abe('0x35')]));_0x176bf3[_0x8abe('0x33')]=_0x176bf3['attributes'][_0x8abe('0x36')]?_0x176bf3['attributes']:_0x524555[_0x8abe('0x2f')];if(!_0x138f0e[_0x8abe('0x30')][_0x8abe('0x37')](_0x8abe('0x38'))){_0x176bf3[_0x8abe('0x1c')]=qs['limit'](_0x138f0e['query']['limit']);_0x176bf3[_0x8abe('0x1d')]=qs['offset'](_0x138f0e[_0x8abe('0x30')]['offset']);}_0x176bf3[_0x8abe('0x39')]=qs['sort'](_0x138f0e['query'][_0x8abe('0x3a')]);_0x176bf3[_0x8abe('0x3b')]=qs['filters'](_[_0x8abe('0x3c')](_0x138f0e[_0x8abe('0x30')],_0x524555[_0x8abe('0x32')]),_0x745d0b);if(_0x138f0e[_0x8abe('0x30')]['filter']){_0x176bf3[_0x8abe('0x3b')]=_['merge'](_0x176bf3['where'],{'$or':_[_0x8abe('0x29')](_0x745d0b,function(_0x52f9cf){if(_0x52f9cf['type']!==_0x8abe('0x3d')){var _0x41930e={};_0x41930e[_0x52f9cf[_0x8abe('0x26')]]={'$like':'%'+_0x138f0e[_0x8abe('0x30')]['filter']+'%'};return _0x41930e;}})});}_0x176bf3=_['merge']({},_0x176bf3,_0x138f0e[_0x8abe('0x3e')]);var _0x507d91={'where':_0x176bf3['where']};return db[_0x8abe('0x2a')][_0x8abe('0x1e')](_0x507d91)['then'](function(_0x4162a0){_0xfd6b98['count']=_0x4162a0;if(_0x138f0e['query']['includeAll']){_0x176bf3[_0x8abe('0x3f')]=[{'all':!![]}];}return db[_0x8abe('0x2a')][_0x8abe('0x40')](_0x176bf3);})[_0x8abe('0x23')](function(_0x562837){_0xfd6b98[_0x8abe('0x41')]=_0x562837;return _0xfd6b98;})[_0x8abe('0x23')](respondWithFilteredResult(_0x409c38,_0x176bf3))[_0x8abe('0x42')](handleError(_0x409c38,null));};exports['show']=function(_0x36aa84,_0x5b4461){var _0x1221f2={'raw':!![],'where':{'id':_0x36aa84['params']['id']}},_0xf9c3c9={};_0xf9c3c9[_0x8abe('0x2f')]=_[_0x8abe('0x31')](db[_0x8abe('0x2a')][_0x8abe('0x2b')]);_0xf9c3c9[_0x8abe('0x30')]=_[_0x8abe('0x31')](_0x36aa84[_0x8abe('0x30')]);_0xf9c3c9['filters']=_['intersection'](_0xf9c3c9['model'],_0xf9c3c9[_0x8abe('0x30')]);_0x1221f2[_0x8abe('0x33')]=_[_0x8abe('0x34')](_0xf9c3c9['model'],qs[_0x8abe('0x35')](_0x36aa84[_0x8abe('0x30')][_0x8abe('0x35')]));_0x1221f2[_0x8abe('0x33')]=_0x1221f2['attributes']['length']?_0x1221f2[_0x8abe('0x33')]:_0xf9c3c9[_0x8abe('0x2f')];if(_0x36aa84['query'][_0x8abe('0x43')]){_0x1221f2[_0x8abe('0x3f')]=[{'all':!![]}];}_0x1221f2=_[_0x8abe('0x44')]({},_0x1221f2,_0x36aa84[_0x8abe('0x3e')]);return db['MailSubstatus']['find'](_0x1221f2)[_0x8abe('0x23')](handleEntityNotFound(_0x5b4461,null))[_0x8abe('0x23')](respondWithResult(_0x5b4461,null))[_0x8abe('0x42')](handleError(_0x5b4461,null));};exports[_0x8abe('0x45')]=function(_0x2452ea,_0x27669c){return db['MailSubstatus']['create'](_0x2452ea[_0x8abe('0x46')],{})['then'](respondWithResult(_0x27669c,0xc9))[_0x8abe('0x42')](handleError(_0x27669c,null));};exports[_0x8abe('0x22')]=function(_0x38fa7a,_0x2fec9b){if(_0x38fa7a[_0x8abe('0x46')]['id']){delete _0x38fa7a[_0x8abe('0x46')]['id'];}return db[_0x8abe('0x2a')]['find']({'where':{'id':_0x38fa7a['params']['id']}})[_0x8abe('0x23')](handleEntityNotFound(_0x2fec9b,null))[_0x8abe('0x23')](saveUpdates(_0x38fa7a['body'],null))[_0x8abe('0x23')](respondWithResult(_0x2fec9b,null))[_0x8abe('0x42')](handleError(_0x2fec9b,null));};exports['destroy']=function(_0xa60d8f,_0x1e5bd7){return db[_0x8abe('0x2a')][_0x8abe('0x47')]({'where':{'id':_0xa60d8f[_0x8abe('0x48')]['id']}})[_0x8abe('0x23')](handleEntityNotFound(_0x1e5bd7,null))[_0x8abe('0x23')](removeEntity(_0x1e5bd7,null))[_0x8abe('0x42')](handleError(_0x1e5bd7,null));};exports[_0x8abe('0x49')]=function(_0x4b4ecf,_0x3cd6b7){return db[_0x8abe('0x2a')][_0x8abe('0x49')]()[_0x8abe('0x23')](respondWithResult(_0x3cd6b7,null))[_0x8abe('0x42')](handleError(_0x3cd6b7,null));};
\ No newline at end of file
index 30aa414..f495252 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x589c=['hasOwnProperty','hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit'];(function(_0x4623fa,_0xbdecc8){var _0x2714b3=function(_0x5e55c4){while(--_0x5e55c4){_0x4623fa['push'](_0x4623fa['shift']());}};_0x2714b3(++_0xbdecc8);}(_0x589c,0x8a));var _0xc589=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x589c[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0xc589('0x0'));var MailSubstatus=require(_0xc589('0x1'))['db'][_0xc589('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xc589('0x3')](0x0);var events={'afterUpdate':_0xc589('0x4')};function emitEvent(_0xdb7cee){return function(_0x3d16c6,_0x99be09,_0x5bf1f7){MailSubstatusEvents['emit'](_0xdb7cee+':'+_0x3d16c6['id'],_0x3d16c6);MailSubstatusEvents[_0xc589('0x5')](_0xdb7cee,_0x3d16c6);_0x5bf1f7(null);};}for(var e in events){if(events[_0xc589('0x6')](e)){var event=events[e];MailSubstatus[_0xc589('0x7')](e,emitEvent(event));}}module[_0xc589('0x8')]=MailSubstatusEvents;
\ No newline at end of file
+var _0x1de9=['setMaxListeners','update','emit','hook','exports','events','../../mysqldb','MailSubstatus'];(function(_0x17ba7d,_0x3d1ace){var _0x8fd171=function(_0xc08d1f){while(--_0xc08d1f){_0x17ba7d['push'](_0x17ba7d['shift']());}};_0x8fd171(++_0x3d1ace);}(_0x1de9,0x12d));var _0x91de=function(_0x24ca52,_0x1d7478){_0x24ca52=_0x24ca52-0x0;var _0x2392f9=_0x1de9[_0x24ca52];return _0x2392f9;};'use strict';var EventEmitter=require(_0x91de('0x0'));var MailSubstatus=require(_0x91de('0x1'))['db'][_0x91de('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x91de('0x3')](0x0);var events={'afterUpdate':_0x91de('0x4')};function emitEvent(_0x40bb59){return function(_0x26929b,_0x26bd7e,_0x51499b){MailSubstatusEvents['emit'](_0x40bb59+':'+_0x26929b['id'],_0x26929b);MailSubstatusEvents[_0x91de('0x5')](_0x40bb59,_0x26929b);_0x51499b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x91de('0x6')](e,emitEvent(event));}}module[_0x91de('0x7')]=MailSubstatusEvents;
\ No newline at end of file
index c5b24e1..c12143c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeee0=['mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','catch','exports','models','define','MailSubstatus'];(function(_0x1aaf43,_0x459210){var _0x15040c=function(_0x5b75a9){while(--_0x5b75a9){_0x1aaf43['push'](_0x1aaf43['shift']());}};_0x15040c(++_0x459210);}(_0xeee0,0x164));var _0x0eee=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0xeee0[_0x11a220];return _0x20d8fe;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x0eee('0x0')]=function(_0x545b0a){var _0x55c075=_0x545b0a[_0x0eee('0x1')];return _0x545b0a[_0x0eee('0x2')](_0x0eee('0x3'),attributes,{'tableName':_0x0eee('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5b2aa4,_0x48aea2,_0x395497){return _0x55c075[_0x0eee('0x5')][_0x0eee('0x6')]({'value':_0x5b2aa4[_0x0eee('0x7')]},{'where':{'field':_0x0eee('0x8'),'value':_0x5b2aa4[_0x0eee('0x9')][_0x0eee('0x7')]}})[_0x0eee('0xa')](function(){_0x395497();})[_0x0eee('0xb')](function(_0x41f25a){_0x395497(_0x41f25a);});}}});};
\ No newline at end of file
+var _0xd4ad=['./mailSubstatus.attributes','exports','define','MailSubstatus','update','mailSubstatus','_previousDataValues','then'];(function(_0x3badcd,_0x5292fe){var _0x50cd9d=function(_0x4d1448){while(--_0x4d1448){_0x3badcd['push'](_0x3badcd['shift']());}};_0x50cd9d(++_0x5292fe);}(_0xd4ad,0x158));var _0xdd4a=function(_0xb839a0,_0x400379){_0xb839a0=_0xb839a0-0x0;var _0x5d80f6=_0xd4ad[_0xb839a0];return _0x5d80f6;};'use strict';var attributes=require(_0xdd4a('0x0'));module[_0xdd4a('0x1')]=function(_0x1f1c79){var _0x2d0890=_0x1f1c79['models'];return _0x1f1c79[_0xdd4a('0x2')](_0xdd4a('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x587cf8,_0x13851c,_0x4775aa){return _0x2d0890['Condition'][_0xdd4a('0x4')]({'value':_0x587cf8['name']},{'where':{'field':_0xdd4a('0x5'),'value':_0x587cf8[_0xdd4a('0x6')]['name']}})[_0xdd4a('0x7')](function(){_0x4775aa();})['catch'](function(_0x2ddb28){_0x4775aa(_0x2ddb28);});}}});};
\ No newline at end of file
index aabbfce..7b763ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd8b=['util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','MailSubstatus,\x20%s,\x20%s','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x58e39a,_0x474e33){var _0x5233f4=function(_0x3fa875){while(--_0x3fa875){_0x58e39a['push'](_0x58e39a['shift']());}};_0x5233f4(++_0x474e33);}(_0xfd8b,0x72));var _0xbfd8=function(_0x3cf550,_0x51e786){_0x3cf550=_0x3cf550-0x0;var _0x3a6231=_0xfd8b[_0x3cf550];return _0x3a6231;};'use strict';var _=require('lodash');var util=require(_0xbfd8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbfd8('0x1'))['db'];var utils=require(_0xbfd8('0x2'));var logger=require(_0xbfd8('0x3'))(_0xbfd8('0x4'));var config=require(_0xbfd8('0x5'));var jayson=require(_0xbfd8('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16a3d0,_0x2cb7ba,_0x353261){return new BPromise(function(_0x1b437c,_0x176689){return client[_0xbfd8('0x7')](_0x16a3d0,_0x353261)[_0xbfd8('0x8')](function(_0x2b1864){logger[_0xbfd8('0x9')](_0xbfd8('0xa'),_0x2cb7ba,'request\x20sent');logger['debug'](_0xbfd8('0xb'),_0x2cb7ba,_0xbfd8('0xc'),JSON[_0xbfd8('0xd')](_0x2b1864));if(_0x2b1864[_0xbfd8('0xe')]){if(_0x2b1864[_0xbfd8('0xe')][_0xbfd8('0xf')]===0x1f4){logger[_0xbfd8('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x2cb7ba,_0x2b1864['error']['message']);return _0x176689(_0x2b1864[_0xbfd8('0xe')][_0xbfd8('0x10')]);}logger[_0xbfd8('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x2cb7ba,_0x2b1864['error'][_0xbfd8('0x10')]);return _0x1b437c(_0x2b1864['error']['message']);}else{logger['info'](_0xbfd8('0xa'),_0x2cb7ba,_0xbfd8('0xc'));_0x1b437c(_0x2b1864[_0xbfd8('0x11')]['message']);}})[_0xbfd8('0x12')](function(_0x23c13e){logger[_0xbfd8('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x2cb7ba,_0x23c13e);_0x176689(_0x23c13e);});});}
\ No newline at end of file
+var _0x6f69=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','message','MailSubstatus,\x20%s,\x20%s','info','result','lodash','util','bluebird','randomstring','ioredis'];(function(_0x25d791,_0x72ea53){var _0x44c30f=function(_0x18f877){while(--_0x18f877){_0x25d791['push'](_0x25d791['shift']());}};_0x44c30f(++_0x72ea53);}(_0x6f69,0x154));var _0x96f6=function(_0x3764b6,_0x36d082){_0x3764b6=_0x3764b6-0x0;var _0x15b857=_0x6f69[_0x3764b6];return _0x15b857;};'use strict';var _=require(_0x96f6('0x0'));var util=require(_0x96f6('0x1'));var moment=require('moment');var BPromise=require(_0x96f6('0x2'));var rs=require(_0x96f6('0x3'));var fs=require('fs');var Redis=require(_0x96f6('0x4'));var db=require(_0x96f6('0x5'))['db'];var utils=require(_0x96f6('0x6'));var logger=require(_0x96f6('0x7'))('rpc');var config=require(_0x96f6('0x8'));var jayson=require(_0x96f6('0x9'));var client=jayson[_0x96f6('0xa')][_0x96f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10556b,_0x2a4ef7,_0x4ca89e){return new BPromise(function(_0x36f9d2,_0xe22c89){return client[_0x96f6('0xc')](_0x10556b,_0x4ca89e)[_0x96f6('0xd')](function(_0x44f921){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x2a4ef7,'request\x20sent');logger[_0x96f6('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x2a4ef7,_0x96f6('0xf'),JSON[_0x96f6('0x10')](_0x44f921));if(_0x44f921[_0x96f6('0x11')]){if(_0x44f921['error'][_0x96f6('0x12')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2a4ef7,_0x44f921['error'][_0x96f6('0x13')]);return _0xe22c89(_0x44f921[_0x96f6('0x11')]['message']);}logger['error'](_0x96f6('0x14'),_0x2a4ef7,_0x44f921[_0x96f6('0x11')][_0x96f6('0x13')]);return _0x36f9d2(_0x44f921['error'][_0x96f6('0x13')]);}else{logger[_0x96f6('0x15')](_0x96f6('0x14'),_0x2a4ef7,_0x96f6('0xf'));_0x36f9d2(_0x44f921[_0x96f6('0x16')][_0x96f6('0x13')]);}})['catch'](function(_0x5e6af6){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2a4ef7,_0x5e6af6);_0xe22c89(_0x5e6af6);});});}
\ No newline at end of file
index 0b33c2b..2c09d76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcd6=['/:id','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xfcd6,0x1d2));var _0x6fcd=function(_0x1c9f1b,_0x1450dd){_0x1c9f1b=_0x1c9f1b-0x0;var _0x540ab0=_0xfcd6[_0x1c9f1b];return _0x540ab0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6fcd('0x0'));var timeout=require(_0x6fcd('0x1'));var express=require(_0x6fcd('0x2'));var router=express[_0x6fcd('0x3')]();var fs_extra=require(_0x6fcd('0x4'));var auth=require(_0x6fcd('0x5'));var interaction=require(_0x6fcd('0x6'));var config=require('../../config/environment');var controller=require(_0x6fcd('0x7'));router[_0x6fcd('0x8')]('/',auth['isAuthenticated'](),controller[_0x6fcd('0x9')]);router[_0x6fcd('0x8')](_0x6fcd('0xa'),auth[_0x6fcd('0xb')](),controller[_0x6fcd('0xc')]);router[_0x6fcd('0x8')]('/:id',auth[_0x6fcd('0xb')](),controller[_0x6fcd('0xd')]);router[_0x6fcd('0xe')]('/',auth[_0x6fcd('0xb')](),controller[_0x6fcd('0xf')]);router[_0x6fcd('0x10')](_0x6fcd('0x11'),auth[_0x6fcd('0xb')](),controller[_0x6fcd('0x12')]);router['delete'](_0x6fcd('0x11'),auth['isAuthenticated'](),controller[_0x6fcd('0x13')]);module[_0x6fcd('0x14')]=router;
\ No newline at end of file
+var _0x43a8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1486e5,_0x39684f){var _0x29d89b=function(_0x4a0a80){while(--_0x4a0a80){_0x1486e5['push'](_0x1486e5['shift']());}};_0x29d89b(++_0x39684f);}(_0x43a8,0x7d));var _0x843a=function(_0xd7ac7f,_0x488c3b){_0xd7ac7f=_0xd7ac7f-0x0;var _0x293408=_0x43a8[_0xd7ac7f];return _0x293408;};'use strict';var multer=require(_0x843a('0x0'));var util=require(_0x843a('0x1'));var path=require(_0x843a('0x2'));var timeout=require(_0x843a('0x3'));var express=require(_0x843a('0x4'));var router=express[_0x843a('0x5')]();var fs_extra=require(_0x843a('0x6'));var auth=require(_0x843a('0x7'));var interaction=require(_0x843a('0x8'));var config=require(_0x843a('0x9'));var controller=require(_0x843a('0xa'));router[_0x843a('0xb')]('/',auth[_0x843a('0xc')](),controller[_0x843a('0xd')]);router['get']('/describe',auth[_0x843a('0xc')](),controller[_0x843a('0xe')]);router[_0x843a('0xb')](_0x843a('0xf'),auth[_0x843a('0xc')](),controller[_0x843a('0x10')]);router[_0x843a('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x843a('0x12')](_0x843a('0xf'),auth[_0x843a('0xc')](),controller[_0x843a('0x13')]);router['delete'](_0x843a('0xf'),auth[_0x843a('0xc')](),controller[_0x843a('0x14')]);module[_0x843a('0x15')]=router;
\ No newline at end of file
index 14f60a4..d6d1094 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x55c00d,_0x520cb6){var _0x254a8f=function(_0x2b3378){while(--_0x2b3378){_0x55c00d['push'](_0x55c00d['shift']());}};_0x254a8f(++_0x520cb6);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1d294f,_0x2df2e1){_0x1d294f=_0x1d294f-0x0;var _0x47ac16=_0xb43b[_0x1d294f];return _0x47ac16;};'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
+var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x5e0dfe,_0x464308){var _0x24feb0=function(_0x3d5ef2){while(--_0x3d5ef2){_0x5e0dfe['push'](_0x5e0dfe['shift']());}};_0x24feb0(++_0x464308);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x00bb[_0x2d7f0e];return _0x110b07;};'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 3a875ef..068f9c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bb7=['crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','Content-Range','apply','reject','save','then','destroy','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','model','keys','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','include','findAll','rows','show','includeAll','options','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0x5bb7,0xd4));var _0x75bb=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x5bb7[_0x40ac5e];return _0x2839d6;};'use strict';var emlformat=require(_0x75bb('0x0'));var rimraf=require(_0x75bb('0x1'));var zipdir=require(_0x75bb('0x2'));var jsonpatch=require(_0x75bb('0x3'));var rp=require(_0x75bb('0x4'));var moment=require(_0x75bb('0x5'));var BPromise=require(_0x75bb('0x6'));var Mustache=require(_0x75bb('0x7'));var util=require(_0x75bb('0x8'));var path=require(_0x75bb('0x9'));var sox=require(_0x75bb('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75bb('0xb'));var _=require(_0x75bb('0xc'));var squel=require('squel');var crypto=require(_0x75bb('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x75bb('0xe'));var querystring=require('querystring');var Papa=require(_0x75bb('0xf'));var Redis=require(_0x75bb('0x10'));var authService=require(_0x75bb('0x11'));var qs=require(_0x75bb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x75bb('0x13'))(_0x75bb('0x14'));var utils=require(_0x75bb('0x15'));var config=require(_0x75bb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x75bb('0x17'))['db'];function respondWithStatusCode(_0x3acb1c,_0x5c00e4){_0x5c00e4=_0x5c00e4||0xcc;return function(_0x5cf2c5){if(_0x5cf2c5){return _0x3acb1c[_0x75bb('0x18')](_0x5c00e4);}return _0x3acb1c['status'](_0x5c00e4)[_0x75bb('0x19')]();};}function respondWithResult(_0x3f0db7,_0x530448){_0x530448=_0x530448||0xc8;return function(_0x2795f2){if(_0x2795f2){return _0x3f0db7['status'](_0x530448)['json'](_0x2795f2);}};}function respondWithFilteredResult(_0x58902d,_0x2764fb){return function(_0xc2f98f){if(_0xc2f98f){var _0x38ae48=typeof _0x2764fb[_0x75bb('0x1a')]==='undefined'&&typeof _0x2764fb[_0x75bb('0x1b')]===_0x75bb('0x1c');var _0x4e33b1=_0xc2f98f['count'];var _0x1ea936=_0x38ae48?0x0:_0x2764fb['offset'];var _0x200c77=_0x38ae48?_0xc2f98f[_0x75bb('0x1d')]:_0x2764fb[_0x75bb('0x1a')]+_0x2764fb[_0x75bb('0x1b')];var _0x377f27;if(_0x200c77>=_0x4e33b1){_0x200c77=_0x4e33b1;_0x377f27=0xc8;}else{_0x377f27=0xce;}_0x58902d[_0x75bb('0x1e')](_0x377f27);return _0x58902d['set'](_0x75bb('0x1f'),_0x1ea936+'-'+_0x200c77+'/'+_0x4e33b1)['json'](_0xc2f98f);}return null;};}function patchUpdates(_0x7cd2eb){return function(_0x3e1741){try{jsonpatch[_0x75bb('0x20')](_0x3e1741,_0x7cd2eb,!![]);}catch(_0x22f3aa){return BPromise[_0x75bb('0x21')](_0x22f3aa);}return _0x3e1741[_0x75bb('0x22')]();};}function saveUpdates(_0xad3ff7,_0x588fcf){return function(_0x77e16e){if(_0x77e16e){return _0x77e16e['update'](_0xad3ff7)[_0x75bb('0x23')](function(_0x6d9b5c){return _0x6d9b5c;});}return null;};}function removeEntity(_0x5f3ebc,_0x1f514d){return function(_0x35d0a8){if(_0x35d0a8){return _0x35d0a8[_0x75bb('0x24')]()[_0x75bb('0x23')](function(){_0x5f3ebc[_0x75bb('0x1e')](0xcc)[_0x75bb('0x19')]();});}};}function handleEntityNotFound(_0x3348f4,_0x39c6c9){return function(_0x3631b5){if(!_0x3631b5){_0x3348f4[_0x75bb('0x18')](0x194);}return _0x3631b5;};}function handleError(_0x3ed67b,_0x18d680){_0x18d680=_0x18d680||0x1f4;return function(_0x857bb8){logger[_0x75bb('0x25')](_0x857bb8['stack']);if(_0x857bb8[_0x75bb('0x26')]){delete _0x857bb8[_0x75bb('0x26')];}_0x3ed67b[_0x75bb('0x1e')](_0x18d680)[_0x75bb('0x27')](_0x857bb8);};}exports['index']=function(_0x17e473,_0x5358aa){var _0x27f542={},_0xa28bda={},_0x3b88c3={'count':0x0,'rows':[]};var _0x4fa2b3=_[_0x75bb('0x28')](db[_0x75bb('0x29')][_0x75bb('0x2a')],function(_0x1af3d8){return{'name':_0x1af3d8[_0x75bb('0x2b')],'type':_0x1af3d8[_0x75bb('0x2c')][_0x75bb('0x2d')]};});_0xa28bda[_0x75bb('0x2e')]=_[_0x75bb('0x28')](_0x4fa2b3,_0x75bb('0x26'));_0xa28bda['query']=_[_0x75bb('0x2f')](_0x17e473['query']);_0xa28bda['filters']=_[_0x75bb('0x30')](_0xa28bda[_0x75bb('0x2e')],_0xa28bda['query']);_0x27f542[_0x75bb('0x31')]=_[_0x75bb('0x30')](_0xa28bda[_0x75bb('0x2e')],qs[_0x75bb('0x32')](_0x17e473[_0x75bb('0x33')][_0x75bb('0x32')]));_0x27f542['attributes']=_0x27f542[_0x75bb('0x31')][_0x75bb('0x34')]?_0x27f542[_0x75bb('0x31')]:_0xa28bda[_0x75bb('0x2e')];if(!_0x17e473[_0x75bb('0x33')][_0x75bb('0x35')](_0x75bb('0x36'))){_0x27f542[_0x75bb('0x1b')]=qs[_0x75bb('0x1b')](_0x17e473[_0x75bb('0x33')]['limit']);_0x27f542['offset']=qs[_0x75bb('0x1a')](_0x17e473[_0x75bb('0x33')]['offset']);}_0x27f542[_0x75bb('0x37')]=qs['sort'](_0x17e473[_0x75bb('0x33')][_0x75bb('0x38')]);_0x27f542[_0x75bb('0x39')]=qs[_0x75bb('0x3a')](_[_0x75bb('0x3b')](_0x17e473['query'],_0xa28bda[_0x75bb('0x3a')]),_0x4fa2b3);if(_0x17e473[_0x75bb('0x33')][_0x75bb('0x3c')]){_0x27f542[_0x75bb('0x39')]=_['merge'](_0x27f542[_0x75bb('0x39')],{'$or':_[_0x75bb('0x28')](_0x4fa2b3,function(_0x36a7ae){if(_0x36a7ae['type']!==_0x75bb('0x3d')){var _0x100414={};_0x100414[_0x36a7ae['name']]={'$like':'%'+_0x17e473['query'][_0x75bb('0x3c')]+'%'};return _0x100414;}})});}_0x27f542=_[_0x75bb('0x3e')]({},_0x27f542,_0x17e473['options']);var _0x28af90={'where':_0x27f542[_0x75bb('0x39')]};return db[_0x75bb('0x29')][_0x75bb('0x1d')](_0x28af90)[_0x75bb('0x23')](function(_0x154848){_0x3b88c3[_0x75bb('0x1d')]=_0x154848;if(_0x17e473['query']['includeAll']){_0x27f542[_0x75bb('0x3f')]=[{'all':!![]}];}return db['MailTransferReport'][_0x75bb('0x40')](_0x27f542);})['then'](function(_0x2e8df0){_0x3b88c3[_0x75bb('0x41')]=_0x2e8df0;return _0x3b88c3;})[_0x75bb('0x23')](respondWithFilteredResult(_0x5358aa,_0x27f542))['catch'](handleError(_0x5358aa,null));};exports[_0x75bb('0x42')]=function(_0x32f9f6,_0x3317e0){var _0x582398={'raw':!![],'where':{'id':_0x32f9f6['params']['id']}},_0x558f09={};_0x558f09[_0x75bb('0x2e')]=_[_0x75bb('0x2f')](db[_0x75bb('0x29')][_0x75bb('0x2a')]);_0x558f09['query']=_[_0x75bb('0x2f')](_0x32f9f6[_0x75bb('0x33')]);_0x558f09[_0x75bb('0x3a')]=_[_0x75bb('0x30')](_0x558f09[_0x75bb('0x2e')],_0x558f09[_0x75bb('0x33')]);_0x582398[_0x75bb('0x31')]=_[_0x75bb('0x30')](_0x558f09[_0x75bb('0x2e')],qs[_0x75bb('0x32')](_0x32f9f6[_0x75bb('0x33')][_0x75bb('0x32')]));_0x582398[_0x75bb('0x31')]=_0x582398[_0x75bb('0x31')][_0x75bb('0x34')]?_0x582398[_0x75bb('0x31')]:_0x558f09[_0x75bb('0x2e')];if(_0x32f9f6['query'][_0x75bb('0x43')]){_0x582398[_0x75bb('0x3f')]=[{'all':!![]}];}_0x582398=_[_0x75bb('0x3e')]({},_0x582398,_0x32f9f6[_0x75bb('0x44')]);return db[_0x75bb('0x29')]['find'](_0x582398)[_0x75bb('0x23')](handleEntityNotFound(_0x3317e0,null))[_0x75bb('0x23')](respondWithResult(_0x3317e0,null))[_0x75bb('0x45')](handleError(_0x3317e0,null));};exports[_0x75bb('0x46')]=function(_0x460ea4,_0x1a92d1){return db[_0x75bb('0x29')][_0x75bb('0x46')](_0x460ea4[_0x75bb('0x47')],{})[_0x75bb('0x23')](respondWithResult(_0x1a92d1,0xc9))[_0x75bb('0x45')](handleError(_0x1a92d1,null));};exports['update']=function(_0x56e607,_0x589bf4){if(_0x56e607[_0x75bb('0x47')]['id']){delete _0x56e607[_0x75bb('0x47')]['id'];}return db[_0x75bb('0x29')][_0x75bb('0x48')]({'where':{'id':_0x56e607[_0x75bb('0x49')]['id']}})[_0x75bb('0x23')](handleEntityNotFound(_0x589bf4,null))[_0x75bb('0x23')](saveUpdates(_0x56e607[_0x75bb('0x47')],null))[_0x75bb('0x23')](respondWithResult(_0x589bf4,null))[_0x75bb('0x45')](handleError(_0x589bf4,null));};exports['destroy']=function(_0x5b0dc7,_0x41b63f){return db[_0x75bb('0x29')][_0x75bb('0x48')]({'where':{'id':_0x5b0dc7['params']['id']}})[_0x75bb('0x23')](handleEntityNotFound(_0x41b63f,null))['then'](removeEntity(_0x41b63f,null))[_0x75bb('0x45')](handleError(_0x41b63f,null));};exports['describe']=function(_0x126936,_0x49faa0){return db[_0x75bb('0x29')][_0x75bb('0x4a')]()[_0x75bb('0x23')](respondWithResult(_0x49faa0,null))[_0x75bb('0x45')](handleError(_0x49faa0,null));};
\ No newline at end of file
+var _0xed9e=['include','findAll','rows','intersection','find','create','body','catch','params','describe','zip-dir','moment','mustache','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','save','update','then','destroy','error','name','send','map','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','VIRTUAL','options','MailTransferReport','includeAll'];(function(_0x1d9bc1,_0x52f0a6){var _0x540128=function(_0x2e35ff){while(--_0x2e35ff){_0x1d9bc1['push'](_0x1d9bc1['shift']());}};_0x540128(++_0x52f0a6);}(_0xed9e,0x112));var _0xeed9=function(_0x4c556b,_0x527052){_0x4c556b=_0x4c556b-0x0;var _0x50b9bd=_0xed9e[_0x4c556b];return _0x50b9bd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeed9('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeed9('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xeed9('0x2'));var util=require('util');var path=require(_0xeed9('0x3'));var sox=require(_0xeed9('0x4'));var csv=require('to-csv');var ejs=require(_0xeed9('0x5'));var fs=require('fs');var fs_extra=require(_0xeed9('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xeed9('0x7'));var jsforce=require('jsforce');var deskjs=require(_0xeed9('0x8'));var toCsv=require(_0xeed9('0x9'));var querystring=require('querystring');var Papa=require(_0xeed9('0xa'));var Redis=require(_0xeed9('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xeed9('0xc'));var as=require(_0xeed9('0xd'));var hardwareService=require(_0xeed9('0xe'));var logger=require(_0xeed9('0xf'))('api');var utils=require(_0xeed9('0x10'));var config=require(_0xeed9('0x11'));var licenseUtil=require(_0xeed9('0x12'));var db=require(_0xeed9('0x13'))['db'];function respondWithStatusCode(_0x4332ed,_0x3f976e){_0x3f976e=_0x3f976e||0xcc;return function(_0x482d23){if(_0x482d23){return _0x4332ed['sendStatus'](_0x3f976e);}return _0x4332ed[_0xeed9('0x14')](_0x3f976e)[_0xeed9('0x15')]();};}function respondWithResult(_0x1f5317,_0x4be433){_0x4be433=_0x4be433||0xc8;return function(_0x1ddec1){if(_0x1ddec1){return _0x1f5317['status'](_0x4be433)[_0xeed9('0x16')](_0x1ddec1);}};}function respondWithFilteredResult(_0x1c75ab,_0x4da4f8){return function(_0x17c554){if(_0x17c554){var _0x53f666=typeof _0x4da4f8[_0xeed9('0x17')]===_0xeed9('0x18')&&typeof _0x4da4f8['limit']==='undefined';var _0x1e678b=_0x17c554[_0xeed9('0x19')];var _0x55de75=_0x53f666?0x0:_0x4da4f8[_0xeed9('0x17')];var _0x28e21e=_0x53f666?_0x17c554[_0xeed9('0x19')]:_0x4da4f8[_0xeed9('0x17')]+_0x4da4f8[_0xeed9('0x1a')];var _0x765eac;if(_0x28e21e>=_0x1e678b){_0x28e21e=_0x1e678b;_0x765eac=0xc8;}else{_0x765eac=0xce;}_0x1c75ab[_0xeed9('0x14')](_0x765eac);return _0x1c75ab[_0xeed9('0x1b')]('Content-Range',_0x55de75+'-'+_0x28e21e+'/'+_0x1e678b)['json'](_0x17c554);}return null;};}function patchUpdates(_0x865aec){return function(_0x37a1b2){try{jsonpatch['apply'](_0x37a1b2,_0x865aec,!![]);}catch(_0x503095){return BPromise['reject'](_0x503095);}return _0x37a1b2[_0xeed9('0x1c')]();};}function saveUpdates(_0x48756e,_0x5819cb){return function(_0x207f6b){if(_0x207f6b){return _0x207f6b[_0xeed9('0x1d')](_0x48756e)[_0xeed9('0x1e')](function(_0x4dc52f){return _0x4dc52f;});}return null;};}function removeEntity(_0x21461d,_0x6a5756){return function(_0x2b3088){if(_0x2b3088){return _0x2b3088[_0xeed9('0x1f')]()['then'](function(){_0x21461d[_0xeed9('0x14')](0xcc)[_0xeed9('0x15')]();});}};}function handleEntityNotFound(_0x3080ce,_0x3eafc1){return function(_0x1e8453){if(!_0x1e8453){_0x3080ce['sendStatus'](0x194);}return _0x1e8453;};}function handleError(_0x2f465f,_0x4e03d3){_0x4e03d3=_0x4e03d3||0x1f4;return function(_0x497f0e){logger[_0xeed9('0x20')](_0x497f0e['stack']);if(_0x497f0e[_0xeed9('0x21')]){delete _0x497f0e[_0xeed9('0x21')];}_0x2f465f['status'](_0x4e03d3)[_0xeed9('0x22')](_0x497f0e);};}exports['index']=function(_0x4eb6e3,_0x3cc259){var _0x13052c={},_0x430d21={},_0x83132b={'count':0x0,'rows':[]};var _0x3fdd10=_[_0xeed9('0x23')](db['MailTransferReport']['rawAttributes'],function(_0x3c86f5){return{'name':_0x3c86f5[_0xeed9('0x24')],'type':_0x3c86f5[_0xeed9('0x25')][_0xeed9('0x26')]};});_0x430d21[_0xeed9('0x27')]=_[_0xeed9('0x23')](_0x3fdd10,_0xeed9('0x21'));_0x430d21[_0xeed9('0x28')]=_[_0xeed9('0x29')](_0x4eb6e3[_0xeed9('0x28')]);_0x430d21['filters']=_['intersection'](_0x430d21['model'],_0x430d21[_0xeed9('0x28')]);_0x13052c[_0xeed9('0x2a')]=_['intersection'](_0x430d21[_0xeed9('0x27')],qs[_0xeed9('0x2b')](_0x4eb6e3[_0xeed9('0x28')][_0xeed9('0x2b')]));_0x13052c['attributes']=_0x13052c[_0xeed9('0x2a')][_0xeed9('0x2c')]?_0x13052c[_0xeed9('0x2a')]:_0x430d21['model'];if(!_0x4eb6e3[_0xeed9('0x28')][_0xeed9('0x2d')](_0xeed9('0x2e'))){_0x13052c[_0xeed9('0x1a')]=qs[_0xeed9('0x1a')](_0x4eb6e3[_0xeed9('0x28')][_0xeed9('0x1a')]);_0x13052c[_0xeed9('0x17')]=qs['offset'](_0x4eb6e3[_0xeed9('0x28')][_0xeed9('0x17')]);}_0x13052c[_0xeed9('0x2f')]=qs['sort'](_0x4eb6e3['query']['sort']);_0x13052c[_0xeed9('0x30')]=qs[_0xeed9('0x31')](_['pick'](_0x4eb6e3[_0xeed9('0x28')],_0x430d21['filters']),_0x3fdd10);if(_0x4eb6e3[_0xeed9('0x28')][_0xeed9('0x32')]){_0x13052c[_0xeed9('0x30')]=_[_0xeed9('0x33')](_0x13052c[_0xeed9('0x30')],{'$or':_[_0xeed9('0x23')](_0x3fdd10,function(_0x52fd14){if(_0x52fd14[_0xeed9('0x25')]!==_0xeed9('0x34')){var _0x5cac63={};_0x5cac63[_0x52fd14[_0xeed9('0x21')]]={'$like':'%'+_0x4eb6e3['query'][_0xeed9('0x32')]+'%'};return _0x5cac63;}})});}_0x13052c=_[_0xeed9('0x33')]({},_0x13052c,_0x4eb6e3[_0xeed9('0x35')]);var _0x3c0b7={'where':_0x13052c['where']};return db[_0xeed9('0x36')]['count'](_0x3c0b7)[_0xeed9('0x1e')](function(_0x51fcc4){_0x83132b['count']=_0x51fcc4;if(_0x4eb6e3[_0xeed9('0x28')][_0xeed9('0x37')]){_0x13052c[_0xeed9('0x38')]=[{'all':!![]}];}return db[_0xeed9('0x36')][_0xeed9('0x39')](_0x13052c);})[_0xeed9('0x1e')](function(_0x81ec83){_0x83132b[_0xeed9('0x3a')]=_0x81ec83;return _0x83132b;})[_0xeed9('0x1e')](respondWithFilteredResult(_0x3cc259,_0x13052c))['catch'](handleError(_0x3cc259,null));};exports['show']=function(_0x3ff042,_0x5ea4c7){var _0x13e597={'raw':!![],'where':{'id':_0x3ff042['params']['id']}},_0x5a19fe={};_0x5a19fe[_0xeed9('0x27')]=_[_0xeed9('0x29')](db['MailTransferReport']['rawAttributes']);_0x5a19fe[_0xeed9('0x28')]=_[_0xeed9('0x29')](_0x3ff042[_0xeed9('0x28')]);_0x5a19fe['filters']=_[_0xeed9('0x3b')](_0x5a19fe[_0xeed9('0x27')],_0x5a19fe[_0xeed9('0x28')]);_0x13e597[_0xeed9('0x2a')]=_[_0xeed9('0x3b')](_0x5a19fe[_0xeed9('0x27')],qs[_0xeed9('0x2b')](_0x3ff042[_0xeed9('0x28')][_0xeed9('0x2b')]));_0x13e597[_0xeed9('0x2a')]=_0x13e597[_0xeed9('0x2a')][_0xeed9('0x2c')]?_0x13e597[_0xeed9('0x2a')]:_0x5a19fe[_0xeed9('0x27')];if(_0x3ff042[_0xeed9('0x28')][_0xeed9('0x37')]){_0x13e597[_0xeed9('0x38')]=[{'all':!![]}];}_0x13e597=_[_0xeed9('0x33')]({},_0x13e597,_0x3ff042[_0xeed9('0x35')]);return db[_0xeed9('0x36')][_0xeed9('0x3c')](_0x13e597)[_0xeed9('0x1e')](handleEntityNotFound(_0x5ea4c7,null))[_0xeed9('0x1e')](respondWithResult(_0x5ea4c7,null))['catch'](handleError(_0x5ea4c7,null));};exports['create']=function(_0x4ebf80,_0x378bad){return db[_0xeed9('0x36')][_0xeed9('0x3d')](_0x4ebf80[_0xeed9('0x3e')],{})[_0xeed9('0x1e')](respondWithResult(_0x378bad,0xc9))[_0xeed9('0x3f')](handleError(_0x378bad,null));};exports['update']=function(_0x48598c,_0x51b422){if(_0x48598c[_0xeed9('0x3e')]['id']){delete _0x48598c[_0xeed9('0x3e')]['id'];}return db[_0xeed9('0x36')][_0xeed9('0x3c')]({'where':{'id':_0x48598c[_0xeed9('0x40')]['id']}})[_0xeed9('0x1e')](handleEntityNotFound(_0x51b422,null))[_0xeed9('0x1e')](saveUpdates(_0x48598c[_0xeed9('0x3e')],null))[_0xeed9('0x1e')](respondWithResult(_0x51b422,null))['catch'](handleError(_0x51b422,null));};exports[_0xeed9('0x1f')]=function(_0x318bb3,_0x1fbe86){return db[_0xeed9('0x36')][_0xeed9('0x3c')]({'where':{'id':_0x318bb3[_0xeed9('0x40')]['id']}})['then'](handleEntityNotFound(_0x1fbe86,null))['then'](removeEntity(_0x1fbe86,null))['catch'](handleError(_0x1fbe86,null));};exports['describe']=function(_0x43c58d,_0x1001b8){return db['MailTransferReport'][_0xeed9('0x41')]()[_0xeed9('0x1e')](respondWithResult(_0x1001b8,null))[_0xeed9('0x3f')](handleError(_0x1001b8,null));};
\ No newline at end of file
index 82045da..34b94ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4074=['rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x4074,0xf0));var _0x4407=function(_0x397adf,_0x2f362c){_0x397adf=_0x397adf-0x0;var _0x140492=_0x4074[_0x397adf];return _0x140492;};'use strict';var _=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var logger=require(_0x4407('0x2'))('api');var moment=require(_0x4407('0x3'));var BPromise=require(_0x4407('0x4'));var rp=require(_0x4407('0x5'));var fs=require('fs');var path=require(_0x4407('0x6'));var rimraf=require(_0x4407('0x7'));var config=require(_0x4407('0x8'));var attributes=require(_0x4407('0x9'));module[_0x4407('0xa')]=function(_0x3f085d,_0x35899d){return _0x3f085d['define'](_0x4407('0xb'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x4407('0xc'),'fields':[_0x4407('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6ede=['path','rimraf','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid','util','api','moment','bluebird','request-promise'];(function(_0x52121d,_0x1d1704){var _0x448627=function(_0x495bf0){while(--_0x495bf0){_0x52121d['push'](_0x52121d['shift']());}};_0x448627(++_0x1d1704);}(_0x6ede,0x140));var _0xe6ed=function(_0x49beea,_0x47add1){_0x49beea=_0x49beea-0x0;var _0x27693a=_0x6ede[_0x49beea];return _0x27693a;};'use strict';var _=require('lodash');var util=require(_0xe6ed('0x0'));var logger=require('../../config/logger')(_0xe6ed('0x1'));var moment=require(_0xe6ed('0x2'));var BPromise=require(_0xe6ed('0x3'));var rp=require(_0xe6ed('0x4'));var fs=require('fs');var path=require(_0xe6ed('0x5'));var rimraf=require(_0xe6ed('0x6'));var config=require(_0xe6ed('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0xe6ed('0x8')]=function(_0x1b1eb7,_0x144aeb){return _0x1b1eb7[_0xe6ed('0x9')](_0xe6ed('0xa'),attributes,{'tableName':_0xe6ed('0xb'),'paranoid':![],'indexes':[{'name':_0xe6ed('0xc'),'fields':[_0xe6ed('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index fc0da76..673a67e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c45=['../../config/environment','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x508835,_0x80e24b){var _0x5b8e84=function(_0x299554){while(--_0x299554){_0x508835['push'](_0x508835['shift']());}};_0x5b8e84(++_0x80e24b);}(_0x9c45,0x12a));var _0x59c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c45[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x59c4('0x0'));var moment=require('moment');var BPromise=require(_0x59c4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x59c4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x59c4('0x3'));var logger=require(_0x59c4('0x4'))(_0x59c4('0x5'));var config=require(_0x59c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x59c4('0x7')][_0x59c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x360e03,_0xf0f71a,_0xadc774){return new BPromise(function(_0x3661fb,_0xf09949){return client['request'](_0x360e03,_0xadc774)[_0x59c4('0x9')](function(_0x3edc3c){logger[_0x59c4('0xa')](_0x59c4('0xb'),_0xf0f71a,_0x59c4('0xc'));logger[_0x59c4('0xd')](_0x59c4('0xe'),_0xf0f71a,_0x59c4('0xc'),JSON['stringify'](_0x3edc3c));if(_0x3edc3c[_0x59c4('0xf')]){if(_0x3edc3c[_0x59c4('0xf')][_0x59c4('0x10')]===0x1f4){logger[_0x59c4('0xf')](_0x59c4('0xb'),_0xf0f71a,_0x3edc3c[_0x59c4('0xf')]['message']);return _0xf09949(_0x3edc3c[_0x59c4('0xf')][_0x59c4('0x11')]);}logger[_0x59c4('0xf')](_0x59c4('0xb'),_0xf0f71a,_0x3edc3c[_0x59c4('0xf')][_0x59c4('0x11')]);return _0x3661fb(_0x3edc3c[_0x59c4('0xf')]['message']);}else{logger[_0x59c4('0xa')]('MailTransferReport,\x20%s,\x20%s',_0xf0f71a,_0x59c4('0xc'));_0x3661fb(_0x3edc3c[_0x59c4('0x12')][_0x59c4('0x11')]);}})['catch'](function(_0x5baa57){logger[_0x59c4('0xf')]('MailTransferReport,\x20%s,\x20%s',_0xf0f71a,_0x5baa57);_0xf09949(_0x5baa57);});});}
\ No newline at end of file
+var _0x8bce=['message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x12f307,_0x13dc45){var _0x124060=function(_0x19cd32){while(--_0x19cd32){_0x12f307['push'](_0x12f307['shift']());}};_0x124060(++_0x13dc45);}(_0x8bce,0xa3));var _0xe8bc=function(_0x37ba5b,_0x3123f4){_0x37ba5b=_0x37ba5b-0x0;var _0x5ab2c1=_0x8bce[_0x37ba5b];return _0x5ab2c1;};'use strict';var _=require(_0xe8bc('0x0'));var util=require(_0xe8bc('0x1'));var moment=require(_0xe8bc('0x2'));var BPromise=require(_0xe8bc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe8bc('0x4'));var db=require(_0xe8bc('0x5'))['db'];var utils=require(_0xe8bc('0x6'));var logger=require('../../config/logger')(_0xe8bc('0x7'));var config=require(_0xe8bc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe8bc('0x9')][_0xe8bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a6e01,_0x274083,_0x3ba89b){return new BPromise(function(_0x5e1688,_0xa4f347){return client[_0xe8bc('0xb')](_0x3a6e01,_0x3ba89b)[_0xe8bc('0xc')](function(_0x1ee485){logger[_0xe8bc('0xd')](_0xe8bc('0xe'),_0x274083,_0xe8bc('0xf'));logger[_0xe8bc('0x10')](_0xe8bc('0x11'),_0x274083,_0xe8bc('0xf'),JSON[_0xe8bc('0x12')](_0x1ee485));if(_0x1ee485[_0xe8bc('0x13')]){if(_0x1ee485['error'][_0xe8bc('0x14')]===0x1f4){logger[_0xe8bc('0x13')](_0xe8bc('0xe'),_0x274083,_0x1ee485[_0xe8bc('0x13')][_0xe8bc('0x15')]);return _0xa4f347(_0x1ee485['error'][_0xe8bc('0x15')]);}logger['error'](_0xe8bc('0xe'),_0x274083,_0x1ee485[_0xe8bc('0x13')]['message']);return _0x5e1688(_0x1ee485[_0xe8bc('0x13')][_0xe8bc('0x15')]);}else{logger['info'](_0xe8bc('0xe'),_0x274083,'request\x20sent');_0x5e1688(_0x1ee485['result'][_0xe8bc('0x15')]);}})[_0xe8bc('0x16')](function(_0x50c753){logger[_0xe8bc('0x13')](_0xe8bc('0xe'),_0x274083,_0x50c753);_0xa4f347(_0x50c753);});});}
\ No newline at end of file
index 4378072..c030c77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9ac=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','update','destroy'];(function(_0x9ef99c,_0x188d3b){var _0x9a56bb=function(_0x44532b){while(--_0x44532b){_0x9ef99c['push'](_0x9ef99c['shift']());}};_0x9a56bb(++_0x188d3b);}(_0xc9ac,0x10e));var _0xcc9a=function(_0x336c8b,_0x56b55b){_0x336c8b=_0x336c8b-0x0;var _0x4dd2f6=_0xc9ac[_0x336c8b];return _0x4dd2f6;};'use strict';var multer=require(_0xcc9a('0x0'));var util=require(_0xcc9a('0x1'));var path=require(_0xcc9a('0x2'));var timeout=require('connect-timeout');var express=require(_0xcc9a('0x3'));var router=express[_0xcc9a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcc9a('0x5'));var interaction=require(_0xcc9a('0x6'));var config=require(_0xcc9a('0x7'));var controller=require('./memberReport.controller');router[_0xcc9a('0x8')]('/',auth[_0xcc9a('0x9')](),controller[_0xcc9a('0xa')]);router[_0xcc9a('0x8')]('/describe',auth[_0xcc9a('0x9')](),controller[_0xcc9a('0xb')]);router[_0xcc9a('0x8')]('/:id',auth[_0xcc9a('0x9')](),controller[_0xcc9a('0xc')]);router['post']('/',auth[_0xcc9a('0x9')](),controller['create']);router['put']('/:id',auth[_0xcc9a('0x9')](),controller[_0xcc9a('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xcc9a('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x5a2e=['show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x4cc355,_0x3b688c){var _0x26693d=function(_0xa7f9a2){while(--_0xa7f9a2){_0x4cc355['push'](_0x4cc355['shift']());}};_0x26693d(++_0x3b688c);}(_0x5a2e,0x12e));var _0xe5a2=function(_0x4495da,_0xf9ad1f){_0x4495da=_0x4495da-0x0;var _0x51dc7a=_0x5a2e[_0x4495da];return _0x51dc7a;};'use strict';var multer=require(_0xe5a2('0x0'));var util=require(_0xe5a2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe5a2('0x2'));var router=express[_0xe5a2('0x3')]();var fs_extra=require(_0xe5a2('0x4'));var auth=require(_0xe5a2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe5a2('0x6'));var controller=require(_0xe5a2('0x7'));router[_0xe5a2('0x8')]('/',auth[_0xe5a2('0x9')](),controller[_0xe5a2('0xa')]);router['get'](_0xe5a2('0xb'),auth[_0xe5a2('0x9')](),controller['describe']);router[_0xe5a2('0x8')](_0xe5a2('0xc'),auth['isAuthenticated'](),controller[_0xe5a2('0xd')]);router[_0xe5a2('0xe')]('/',auth[_0xe5a2('0x9')](),controller[_0xe5a2('0xf')]);router[_0xe5a2('0x10')](_0xe5a2('0xc'),auth[_0xe5a2('0x9')](),controller[_0xe5a2('0x11')]);router[_0xe5a2('0x12')](_0xe5a2('0xc'),auth[_0xe5a2('0x9')](),controller[_0xe5a2('0x13')]);module[_0xe5a2('0x14')]=router;
\ No newline at end of file
index a61d85a..bdb72bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c64=['sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','DATE','enterAt','seconds','setDataValue','exitAt','duration','talk:[destination]','INTEGER'];(function(_0x2655d1,_0x591d32){var _0x2de07c=function(_0x3a7f0d){while(--_0x3a7f0d){_0x2655d1['push'](_0x2655d1['shift']());}};_0x2de07c(++_0x591d32);}(_0x2c64,0xdd));var _0x42c6=function(_0x2c7dc6,_0x3c4ce0){_0x2c7dc6=_0x2c7dc6-0x0;var _0x10002b=_0x2c64[_0x2c7dc6];return _0x10002b;};'use strict';var Sequelize=require(_0x42c6('0x0'));var moment=require(_0x42c6('0x1'));module[_0x42c6('0x2')]={'channel':{'type':Sequelize[_0x42c6('0x3')]},'membername':{'type':Sequelize[_0x42c6('0x3')]},'interface':{'type':Sequelize[_0x42c6('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x42c6('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x42c6('0x5')]},'exitAt':{'type':Sequelize[_0x42c6('0x5')],'set':function(_0x33abad){var _0x2b62b3=moment(_0x33abad);var _0xbd4e1c=moment(this['getDataValue'](_0x42c6('0x6')));var _0x289e45=_0x2b62b3['diff'](_0xbd4e1c,_0x42c6('0x7'));this[_0x42c6('0x8')](_0x42c6('0x9'),_0x33abad);this['setDataValue'](_0x42c6('0xa'),_0x289e45>=0x0?_0x289e45:null);}},'data1':{'type':Sequelize[_0x42c6('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x42c6('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x42c6('0x3')],'comment':_0x42c6('0xb')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x42c6('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x42c6('0xc')]},'uniqueid':{'type':Sequelize[_0x42c6('0x3')]}};
\ No newline at end of file
+var _0x44cb=['talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE','enterAt','diff','seconds','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x44cb,0xf5));var _0xb44c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x44cb[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xb44c('0x0'));var moment=require(_0xb44c('0x1'));module[_0xb44c('0x2')]={'channel':{'type':Sequelize[_0xb44c('0x3')]},'membername':{'type':Sequelize[_0xb44c('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb44c('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xb44c('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xb44c('0x5')]},'exitAt':{'type':Sequelize[_0xb44c('0x5')],'set':function(_0x27e2a6){var _0x556935=moment(_0x27e2a6);var _0x49169d=moment(this['getDataValue'](_0xb44c('0x6')));var _0x2fad12=_0x556935[_0xb44c('0x7')](_0x49169d,_0xb44c('0x8'));this['setDataValue']('exitAt',_0x27e2a6);this[_0xb44c('0x9')]('duration',_0x2fad12>=0x0?_0x2fad12:null);}},'data1':{'type':Sequelize[_0xb44c('0x3')],'comment':_0xb44c('0xa')},'data2':{'type':Sequelize['STRING'],'comment':_0xb44c('0xb')},'data3':{'type':Sequelize[_0xb44c('0x3')],'comment':_0xb44c('0xc')},'data4':{'type':Sequelize[_0xb44c('0x3')],'comment':_0xb44c('0xd')},'data5':{'type':Sequelize[_0xb44c('0x3')],'comment':_0xb44c('0xe')},'role':{'type':Sequelize[_0xb44c('0x3')]},'internal':{'type':Sequelize[_0xb44c('0xf')]},'uniqueid':{'type':Sequelize[_0xb44c('0x3')]}};
\ No newline at end of file
index dc0e5bf..cc894a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xedd9,0xfc));var _0x9edd=function(_0x338e09,_0x463951){_0x338e09=_0x338e09-0x0;var _0x5e78f2=_0xedd9[_0x338e09];return _0x5e78f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));};
\ No newline at end of file
+var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x5aaf20,_0x38dc01){var _0x5a8c39=function(_0x1ec3a5){while(--_0x1ec3a5){_0x5aaf20['push'](_0x5aaf20['shift']());}};_0x5a8c39(++_0x38dc01);}(_0x008c,0x188));var _0xc008=function(_0x16f6e4,_0x288b61){_0x16f6e4=_0x16f6e4-0x0;var _0x275354=_0x008c[_0x16f6e4];return _0x275354;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));};
\ No newline at end of file
index 0fb276d..b1febaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f01=['request-promise','rimraf','./memberReport.attributes','exports','define','MemberReport','membername_interface','membername','interface','util','../../config/logger','api','bluebird'];(function(_0x49d701,_0x50f461){var _0x4e2a65=function(_0x735dff){while(--_0x735dff){_0x49d701['push'](_0x49d701['shift']());}};_0x4e2a65(++_0x50f461);}(_0x5f01,0xcc));var _0x15f0=function(_0x34b6cb,_0x2587f8){_0x34b6cb=_0x34b6cb-0x0;var _0x28fba5=_0x5f01[_0x34b6cb];return _0x28fba5;};'use strict';var _=require('lodash');var util=require(_0x15f0('0x0'));var logger=require(_0x15f0('0x1'))(_0x15f0('0x2'));var moment=require('moment');var BPromise=require(_0x15f0('0x3'));var rp=require(_0x15f0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15f0('0x5'));var config=require('../../config/environment');var attributes=require(_0x15f0('0x6'));module[_0x15f0('0x7')]=function(_0x19d434,_0x2ead28){return _0x19d434[_0x15f0('0x8')](_0x15f0('0x9'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x15f0('0xa'),'fields':[_0x15f0('0xb'),_0x15f0('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6822=['request-promise','path','rimraf','./memberReport.attributes','define','membername','interface','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4943c3,_0x2875c7){var _0x24c59a=function(_0x46c951){while(--_0x46c951){_0x4943c3['push'](_0x4943c3['shift']());}};_0x24c59a(++_0x2875c7);}(_0x6822,0xca));var _0x2682=function(_0x4e158d,_0x5a7e47){_0x4e158d=_0x4e158d-0x0;var _0x47270a=_0x6822[_0x4e158d];return _0x47270a;};'use strict';var _=require(_0x2682('0x0'));var util=require(_0x2682('0x1'));var logger=require(_0x2682('0x2'))(_0x2682('0x3'));var moment=require(_0x2682('0x4'));var BPromise=require(_0x2682('0x5'));var rp=require(_0x2682('0x6'));var fs=require('fs');var path=require(_0x2682('0x7'));var rimraf=require(_0x2682('0x8'));var config=require('../../config/environment');var attributes=require(_0x2682('0x9'));module['exports']=function(_0x30fcd9,_0x39d4f7){return _0x30fcd9[_0x2682('0xa')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x2682('0xb'),_0x2682('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index c5c26bc..c419a40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x644f=['options','raw','where','attributes','limit','map','include','model','GetMemberReport','create','body','CreateMemberReport','UpdateMemberReport','update','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','MemberReport'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x644f,0xc2));var _0xf644=function(_0x967959,_0x53c5c1){_0x967959=_0x967959-0x0;var _0x5c4489=_0x644f[_0x967959];return _0x5c4489;};'use strict';var _=require(_0xf644('0x0'));var util=require(_0xf644('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf644('0x2'));var fs=require('fs');var Redis=require(_0xf644('0x3'));var db=require(_0xf644('0x4'))['db'];var utils=require(_0xf644('0x5'));var logger=require(_0xf644('0x6'))(_0xf644('0x7'));var config=require(_0xf644('0x8'));var jayson=require(_0xf644('0x9'));var client=jayson[_0xf644('0xa')][_0xf644('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c7aaf,_0x454018,_0x50362e){return new BPromise(function(_0x2c2868,_0x11fa91){return client['request'](_0x2c7aaf,_0x50362e)[_0xf644('0xc')](function(_0x5746ae){logger['info'](_0xf644('0xd'),_0x454018,'request\x20sent');logger[_0xf644('0xe')](_0xf644('0xf'),_0x454018,'request\x20sent',JSON[_0xf644('0x10')](_0x5746ae));if(_0x5746ae[_0xf644('0x11')]){if(_0x5746ae[_0xf644('0x11')]['code']===0x1f4){logger[_0xf644('0x11')](_0xf644('0xd'),_0x454018,_0x5746ae['error'][_0xf644('0x12')]);return _0x11fa91(_0x5746ae[_0xf644('0x11')]['message']);}logger[_0xf644('0x11')](_0xf644('0xd'),_0x454018,_0x5746ae[_0xf644('0x11')][_0xf644('0x12')]);return _0x2c2868(_0x5746ae['error'][_0xf644('0x12')]);}else{logger[_0xf644('0x13')]('MemberReport,\x20%s,\x20%s',_0x454018,'request\x20sent');_0x2c2868(_0x5746ae['result']['message']);}})[_0xf644('0x14')](function(_0x331478){logger[_0xf644('0x11')](_0xf644('0xd'),_0x454018,_0x331478);_0x11fa91(_0x331478);});});}exports['GetMemberReport']=function(_0x5bd03c){var _0x15d065=this;return new Promise(function(_0x4650b5,_0x44fc39){return db[_0xf644('0x15')]['findAll']({'raw':_0x5bd03c['options']?_0x5bd03c[_0xf644('0x16')][_0xf644('0x17')]===undefined?!![]:![]:!![],'where':_0x5bd03c[_0xf644('0x16')]?_0x5bd03c[_0xf644('0x16')][_0xf644('0x18')]||null:null,'attributes':_0x5bd03c[_0xf644('0x16')]?_0x5bd03c[_0xf644('0x16')][_0xf644('0x19')]||null:null,'limit':_0x5bd03c['options']?_0x5bd03c[_0xf644('0x16')][_0xf644('0x1a')]||null:null,'include':_0x5bd03c[_0xf644('0x16')]?_0x5bd03c[_0xf644('0x16')]['include']?_[_0xf644('0x1b')](_0x5bd03c[_0xf644('0x16')][_0xf644('0x1c')],function(_0x17b2c6){return{'model':db[_0x17b2c6[_0xf644('0x1d')]],'as':_0x17b2c6['as'],'attributes':_0x17b2c6[_0xf644('0x19')],'include':_0x17b2c6[_0xf644('0x1c')]?_['map'](_0x17b2c6['include'],function(_0x22febe){return{'model':db[_0x22febe[_0xf644('0x1d')]],'as':_0x22febe['as'],'attributes':_0x22febe[_0xf644('0x19')],'include':_0x22febe[_0xf644('0x1c')]?_[_0xf644('0x1b')](_0x22febe[_0xf644('0x1c')],function(_0x2b2882){return{'model':db[_0x2b2882[_0xf644('0x1d')]],'as':_0x2b2882['as'],'attributes':_0x2b2882['attributes']};}):[]};}):[]};}):[]:[]})[_0xf644('0xc')](function(_0x3705a0){logger['info']('GetMemberReport',_0x5bd03c);logger[_0xf644('0xe')](_0xf644('0x1e'),_0x5bd03c,JSON[_0xf644('0x10')](_0x3705a0));_0x4650b5(_0x3705a0);})[_0xf644('0x14')](function(_0x2bcb20){logger[_0xf644('0x11')](_0xf644('0x1e'),_0x2bcb20['message'],_0x5bd03c);_0x44fc39(_0x15d065[_0xf644('0x11')](0x1f4,_0x2bcb20[_0xf644('0x12')]));});});};exports['CreateMemberReport']=function(_0x517a4e){var _0x279daa=this;return new Promise(function(_0x3efd75,_0x2cdca1){return db[_0xf644('0x15')][_0xf644('0x1f')](_0x517a4e[_0xf644('0x20')],{'raw':_0x517a4e[_0xf644('0x16')]?_0x517a4e[_0xf644('0x16')][_0xf644('0x17')]===undefined?!![]:![]:!![]})[_0xf644('0xc')](function(_0x5914d8){logger['info'](_0xf644('0x21'),_0x517a4e);logger[_0xf644('0xe')](_0xf644('0x21'),_0x517a4e,JSON[_0xf644('0x10')](_0x5914d8));_0x3efd75(_0x5914d8);})[_0xf644('0x14')](function(_0x37a72f){logger[_0xf644('0x11')]('CreateMemberReport',_0x37a72f[_0xf644('0x12')],_0x517a4e);_0x2cdca1(_0x279daa['error'](0x1f4,_0x37a72f['message']));});});};exports[_0xf644('0x22')]=function(_0x316d24){var _0xcef4ad=this;return new Promise(function(_0x54a537,_0x4f28d4){return db[_0xf644('0x15')][_0xf644('0x23')](_0x316d24[_0xf644('0x20')],{'raw':_0x316d24['options']?_0x316d24[_0xf644('0x16')][_0xf644('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x316d24['options']?_0x316d24[_0xf644('0x16')][_0xf644('0x18')]||null:null,'attributes':_0x316d24[_0xf644('0x16')]?_0x316d24[_0xf644('0x16')][_0xf644('0x19')]||null:null,'limit':_0x316d24[_0xf644('0x16')]?_0x316d24['options'][_0xf644('0x1a')]||null:null})['then'](function(_0x3f0248){logger[_0xf644('0x13')](_0xf644('0x22'),_0x316d24);logger[_0xf644('0xe')](_0xf644('0x22'),_0x316d24,JSON[_0xf644('0x10')](_0x3f0248));_0x54a537(_0x3f0248);})['catch'](function(_0x38b556){logger[_0xf644('0x11')](_0xf644('0x22'),_0x38b556['message'],_0x316d24);_0x4f28d4(_0xcef4ad['error'](0x1f4,_0x38b556[_0xf644('0x12')]));});});};
\ No newline at end of file
+var _0x0d4d=['map','model','attributes','GetMemberReport','catch','CreateMemberReport','body','raw','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','MemberReport','options','where','limit','include'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0x0d4d,0x132));var _0xd0d4=function(_0x2b136a,_0x412687){_0x2b136a=_0x2b136a-0x0;var _0x296d65=_0x0d4d[_0x2b136a];return _0x296d65;};'use strict';var _=require(_0xd0d4('0x0'));var util=require(_0xd0d4('0x1'));var moment=require(_0xd0d4('0x2'));var BPromise=require(_0xd0d4('0x3'));var rs=require(_0xd0d4('0x4'));var fs=require('fs');var Redis=require(_0xd0d4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd0d4('0x6'));var logger=require('../../config/logger')(_0xd0d4('0x7'));var config=require(_0xd0d4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd0d4('0x9')][_0xd0d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c5d01,_0x5c8c7b,_0x5bfae8){return new BPromise(function(_0x5403c0,_0x3fdd50){return client['request'](_0x1c5d01,_0x5bfae8)[_0xd0d4('0xb')](function(_0x314cd5){logger[_0xd0d4('0xc')]('MemberReport,\x20%s,\x20%s',_0x5c8c7b,_0xd0d4('0xd'));logger[_0xd0d4('0xe')](_0xd0d4('0xf'),_0x5c8c7b,_0xd0d4('0xd'),JSON[_0xd0d4('0x10')](_0x314cd5));if(_0x314cd5[_0xd0d4('0x11')]){if(_0x314cd5['error'][_0xd0d4('0x12')]===0x1f4){logger[_0xd0d4('0x11')](_0xd0d4('0x13'),_0x5c8c7b,_0x314cd5[_0xd0d4('0x11')][_0xd0d4('0x14')]);return _0x3fdd50(_0x314cd5[_0xd0d4('0x11')]['message']);}logger[_0xd0d4('0x11')](_0xd0d4('0x13'),_0x5c8c7b,_0x314cd5[_0xd0d4('0x11')]['message']);return _0x5403c0(_0x314cd5['error'][_0xd0d4('0x14')]);}else{logger[_0xd0d4('0xc')]('MemberReport,\x20%s,\x20%s',_0x5c8c7b,_0xd0d4('0xd'));_0x5403c0(_0x314cd5[_0xd0d4('0x15')]['message']);}})['catch'](function(_0x1b64f){logger[_0xd0d4('0x11')](_0xd0d4('0x13'),_0x5c8c7b,_0x1b64f);_0x3fdd50(_0x1b64f);});});}exports['GetMemberReport']=function(_0x5cf4c6){var _0x5eb5e4=this;return new Promise(function(_0x407cda,_0x1e46db){return db[_0xd0d4('0x16')]['findAll']({'raw':_0x5cf4c6['options']?_0x5cf4c6[_0xd0d4('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5cf4c6[_0xd0d4('0x17')]?_0x5cf4c6[_0xd0d4('0x17')][_0xd0d4('0x18')]||null:null,'attributes':_0x5cf4c6['options']?_0x5cf4c6[_0xd0d4('0x17')]['attributes']||null:null,'limit':_0x5cf4c6['options']?_0x5cf4c6[_0xd0d4('0x17')][_0xd0d4('0x19')]||null:null,'include':_0x5cf4c6['options']?_0x5cf4c6['options'][_0xd0d4('0x1a')]?_[_0xd0d4('0x1b')](_0x5cf4c6[_0xd0d4('0x17')][_0xd0d4('0x1a')],function(_0x1d8033){return{'model':db[_0x1d8033[_0xd0d4('0x1c')]],'as':_0x1d8033['as'],'attributes':_0x1d8033['attributes'],'include':_0x1d8033[_0xd0d4('0x1a')]?_['map'](_0x1d8033[_0xd0d4('0x1a')],function(_0x1b03ef){return{'model':db[_0x1b03ef[_0xd0d4('0x1c')]],'as':_0x1b03ef['as'],'attributes':_0x1b03ef['attributes'],'include':_0x1b03ef['include']?_[_0xd0d4('0x1b')](_0x1b03ef['include'],function(_0x50e7f0){return{'model':db[_0x50e7f0[_0xd0d4('0x1c')]],'as':_0x50e7f0['as'],'attributes':_0x50e7f0[_0xd0d4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd0d4('0xb')](function(_0x320efe){logger['info'](_0xd0d4('0x1e'),_0x5cf4c6);logger[_0xd0d4('0xe')](_0xd0d4('0x1e'),_0x5cf4c6,JSON[_0xd0d4('0x10')](_0x320efe));_0x407cda(_0x320efe);})[_0xd0d4('0x1f')](function(_0xefce4f){logger[_0xd0d4('0x11')](_0xd0d4('0x1e'),_0xefce4f[_0xd0d4('0x14')],_0x5cf4c6);_0x1e46db(_0x5eb5e4['error'](0x1f4,_0xefce4f[_0xd0d4('0x14')]));});});};exports[_0xd0d4('0x20')]=function(_0x192f43){var _0x18096a=this;return new Promise(function(_0x2ea5d9,_0x198991){return db['MemberReport']['create'](_0x192f43[_0xd0d4('0x21')],{'raw':_0x192f43['options']?_0x192f43[_0xd0d4('0x17')][_0xd0d4('0x22')]===undefined?!![]:![]:!![]})[_0xd0d4('0xb')](function(_0x446763){logger[_0xd0d4('0xc')](_0xd0d4('0x20'),_0x192f43);logger[_0xd0d4('0xe')]('CreateMemberReport',_0x192f43,JSON['stringify'](_0x446763));_0x2ea5d9(_0x446763);})[_0xd0d4('0x1f')](function(_0x161d17){logger['error'](_0xd0d4('0x20'),_0x161d17['message'],_0x192f43);_0x198991(_0x18096a['error'](0x1f4,_0x161d17[_0xd0d4('0x14')]));});});};exports[_0xd0d4('0x23')]=function(_0x3fd1b1){var _0x26a080=this;return new Promise(function(_0x5011dd,_0x47e4c5){return db[_0xd0d4('0x16')][_0xd0d4('0x24')](_0x3fd1b1[_0xd0d4('0x21')],{'raw':_0x3fd1b1['options']?_0x3fd1b1[_0xd0d4('0x17')][_0xd0d4('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fd1b1[_0xd0d4('0x17')]?_0x3fd1b1[_0xd0d4('0x17')][_0xd0d4('0x18')]||null:null,'attributes':_0x3fd1b1[_0xd0d4('0x17')]?_0x3fd1b1[_0xd0d4('0x17')][_0xd0d4('0x1d')]||null:null,'limit':_0x3fd1b1['options']?_0x3fd1b1[_0xd0d4('0x17')]['limit']||null:null})['then'](function(_0x29434a){logger['info'](_0xd0d4('0x23'),_0x3fd1b1);logger[_0xd0d4('0xe')](_0xd0d4('0x23'),_0x3fd1b1,JSON[_0xd0d4('0x10')](_0x29434a));_0x5011dd(_0x29434a);})[_0xd0d4('0x1f')](function(_0x3b24c8){logger['error'](_0xd0d4('0x23'),_0x3b24c8[_0xd0d4('0x14')],_0x3fd1b1);_0x47e4c5(_0x26a080['error'](0x1f4,_0x3b24c8['message']));});});};
\ No newline at end of file
index f01fa73..01f4397 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27bd=['Router','../../components/interaction/service','../../config/environment','get','index','exports','multer','express'];(function(_0x2b3c09,_0x58baa9){var _0x44bc56=function(_0x22e196){while(--_0x22e196){_0x2b3c09['push'](_0x2b3c09['shift']());}};_0x44bc56(++_0x58baa9);}(_0x27bd,0x11e));var _0xd27b=function(_0x53d6dc,_0x430cf2){_0x53d6dc=_0x53d6dc-0x0;var _0x4d3c6e=_0x27bd[_0x53d6dc];return _0x4d3c6e;};'use strict';var multer=require(_0xd27b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd27b('0x1'));var router=express[_0xd27b('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd27b('0x3'));var config=require(_0xd27b('0x4'));var controller=require('./migration.controller');router[_0xd27b('0x5')]('/',controller[_0xd27b('0x6')]);module[_0xd27b('0x7')]=router;
\ No newline at end of file
+var _0xebe5=['./migration.controller','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x36da00,_0x5b533b){var _0x4b72c5=function(_0x46e26b){while(--_0x46e26b){_0x36da00['push'](_0x36da00['shift']());}};_0x4b72c5(++_0x5b533b);}(_0xebe5,0xc9));var _0x5ebe=function(_0x4ce18d,_0x4f9144){_0x4ce18d=_0x4ce18d-0x0;var _0x3bdcdd=_0xebe5[_0x4ce18d];return _0x3bdcdd;};'use strict';var multer=require('multer');var util=require(_0x5ebe('0x0'));var path=require(_0x5ebe('0x1'));var timeout=require(_0x5ebe('0x2'));var express=require(_0x5ebe('0x3'));var router=express[_0x5ebe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5ebe('0x5'));var interaction=require(_0x5ebe('0x6'));var config=require('../../config/environment');var controller=require(_0x5ebe('0x7'));router['get']('/',controller['index']);module['exports']=router;
\ No newline at end of file
index 0d68109..cbd3e2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03cd=['version','STRING'];(function(_0x4792ac,_0x24d2fe){var _0x566444=function(_0x3880df){while(--_0x3880df){_0x4792ac['push'](_0x4792ac['shift']());}};_0x566444(++_0x24d2fe);}(_0x03cd,0xb1));var _0xd03c=function(_0x38d5ff,_0x394bb5){_0x38d5ff=_0x38d5ff-0x0;var _0x7d7b0f=_0x03cd[_0x38d5ff];return _0x7d7b0f;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize[_0xd03c('0x0')],'unique':_0xd03c('0x1')}};
\ No newline at end of file
+var _0x6c39=['exports','STRING','version','sequelize'];(function(_0xe9b2fc,_0x1174fa){var _0x59b35f=function(_0x219933){while(--_0x219933){_0xe9b2fc['push'](_0xe9b2fc['shift']());}};_0x59b35f(++_0x1174fa);}(_0x6c39,0x15b));var _0x96c3=function(_0x1b76e6,_0x598520){_0x1b76e6=_0x1b76e6-0x0;var _0x333b53=_0x6c39[_0x1b76e6];return _0x333b53;};'use strict';var Sequelize=require(_0x96c3('0x0'));module[_0x96c3('0x1')]={'version':{'type':Sequelize[_0x96c3('0x2')],'unique':_0x96c3('0x3')}};
\ No newline at end of file
index 4cdcfdb..83d46c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf505=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','error','name','send','map','Migration','rawAttributes','fieldName','type','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0xe81e03,_0x15695d){var _0x2e87c6=function(_0x17557e){while(--_0x17557e){_0xe81e03['push'](_0xe81e03['shift']());}};_0x2e87c6(++_0x15695d);}(_0xf505,0x1e7));var _0x5f50=function(_0xe69bf1,_0x487cbc){_0xe69bf1=_0xe69bf1-0x0;var _0x1259d1=_0xf505[_0xe69bf1];return _0x1259d1;};'use strict';var emlformat=require(_0x5f50('0x0'));var rimraf=require(_0x5f50('0x1'));var zipdir=require(_0x5f50('0x2'));var jsonpatch=require(_0x5f50('0x3'));var rp=require(_0x5f50('0x4'));var moment=require(_0x5f50('0x5'));var BPromise=require(_0x5f50('0x6'));var Mustache=require(_0x5f50('0x7'));var util=require(_0x5f50('0x8'));var path=require(_0x5f50('0x9'));var sox=require(_0x5f50('0xa'));var csv=require(_0x5f50('0xb'));var ejs=require(_0x5f50('0xc'));var fs=require('fs');var fs_extra=require(_0x5f50('0xd'));var _=require(_0x5f50('0xe'));var squel=require(_0x5f50('0xf'));var crypto=require(_0x5f50('0x10'));var jsforce=require(_0x5f50('0x11'));var deskjs=require(_0x5f50('0x12'));var toCsv=require('to-csv');var querystring=require(_0x5f50('0x13'));var Papa=require(_0x5f50('0x14'));var Redis=require('ioredis');var authService=require(_0x5f50('0x15'));var qs=require(_0x5f50('0x16'));var as=require(_0x5f50('0x17'));var hardwareService=require(_0x5f50('0x18'));var logger=require(_0x5f50('0x19'))('api');var utils=require(_0x5f50('0x1a'));var config=require(_0x5f50('0x1b'));var licenseUtil=require(_0x5f50('0x1c'));var db=require(_0x5f50('0x1d'))['db'];function respondWithStatusCode(_0x36be22,_0x156dee){_0x156dee=_0x156dee||0xcc;return function(_0x3434ff){if(_0x3434ff){return _0x36be22[_0x5f50('0x1e')](_0x156dee);}return _0x36be22[_0x5f50('0x1f')](_0x156dee)[_0x5f50('0x20')]();};}function respondWithResult(_0x458241,_0x475dc1){_0x475dc1=_0x475dc1||0xc8;return function(_0x3acd08){if(_0x3acd08){return _0x458241[_0x5f50('0x1f')](_0x475dc1)[_0x5f50('0x21')](_0x3acd08);}};}function respondWithFilteredResult(_0x494b2b,_0x1e5bf9){return function(_0x5de282){if(_0x5de282){var _0x12041a=typeof _0x1e5bf9['offset']===_0x5f50('0x22')&&typeof _0x1e5bf9[_0x5f50('0x23')]===_0x5f50('0x22');var _0x6468f1=_0x5de282[_0x5f50('0x24')];var _0x3813f4=_0x12041a?0x0:_0x1e5bf9[_0x5f50('0x25')];var _0x31980f=_0x12041a?_0x5de282[_0x5f50('0x24')]:_0x1e5bf9[_0x5f50('0x25')]+_0x1e5bf9['limit'];var _0x5debf7;if(_0x31980f>=_0x6468f1){_0x31980f=_0x6468f1;_0x5debf7=0xc8;}else{_0x5debf7=0xce;}_0x494b2b['status'](_0x5debf7);return _0x494b2b[_0x5f50('0x26')](_0x5f50('0x27'),_0x3813f4+'-'+_0x31980f+'/'+_0x6468f1)[_0x5f50('0x21')](_0x5de282);}return null;};}function patchUpdates(_0x195e24){return function(_0x50faf2){try{jsonpatch[_0x5f50('0x28')](_0x50faf2,_0x195e24,!![]);}catch(_0x275614){return BPromise['reject'](_0x275614);}return _0x50faf2[_0x5f50('0x29')]();};}function saveUpdates(_0x40542f,_0x2a3ada){return function(_0x37ee29){if(_0x37ee29){return _0x37ee29[_0x5f50('0x2a')](_0x40542f)[_0x5f50('0x2b')](function(_0x2c362a){return _0x2c362a;});}return null;};}function removeEntity(_0x4f8427,_0x2dd3b1){return function(_0x30d859){if(_0x30d859){return _0x30d859['destroy']()['then'](function(){_0x4f8427[_0x5f50('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x87e68c,_0x13cb31){return function(_0xfb3619){if(!_0xfb3619){_0x87e68c[_0x5f50('0x1e')](0x194);}return _0xfb3619;};}function handleError(_0x305120,_0x4a896a){_0x4a896a=_0x4a896a||0x1f4;return function(_0x4aa99e){logger[_0x5f50('0x2c')](_0x4aa99e['stack']);if(_0x4aa99e['name']){delete _0x4aa99e[_0x5f50('0x2d')];}_0x305120['status'](_0x4a896a)[_0x5f50('0x2e')](_0x4aa99e);};}exports['index']=function(_0x2cbdb8,_0x2c3c15){var _0x3bfc7b={},_0x59f881={},_0x5262d0={'count':0x0,'rows':[]};var _0x2eee5e=_[_0x5f50('0x2f')](db[_0x5f50('0x30')][_0x5f50('0x31')],function(_0x5ab111){return{'name':_0x5ab111[_0x5f50('0x32')],'type':_0x5ab111[_0x5f50('0x33')]['key']};});_0x59f881[_0x5f50('0x34')]=_['map'](_0x2eee5e,_0x5f50('0x2d'));_0x59f881[_0x5f50('0x35')]=_[_0x5f50('0x36')](_0x2cbdb8['query']);_0x59f881['filters']=_['intersection'](_0x59f881['model'],_0x59f881[_0x5f50('0x35')]);_0x3bfc7b[_0x5f50('0x37')]=_['intersection'](_0x59f881[_0x5f50('0x34')],qs[_0x5f50('0x38')](_0x2cbdb8[_0x5f50('0x35')][_0x5f50('0x38')]));_0x3bfc7b[_0x5f50('0x37')]=_0x3bfc7b[_0x5f50('0x37')][_0x5f50('0x39')]?_0x3bfc7b['attributes']:_0x59f881[_0x5f50('0x34')];if(!_0x2cbdb8[_0x5f50('0x35')][_0x5f50('0x3a')](_0x5f50('0x3b'))){_0x3bfc7b[_0x5f50('0x23')]=qs[_0x5f50('0x23')](_0x2cbdb8['query'][_0x5f50('0x23')]);_0x3bfc7b[_0x5f50('0x25')]=qs[_0x5f50('0x25')](_0x2cbdb8[_0x5f50('0x35')]['offset']);}_0x3bfc7b[_0x5f50('0x3c')]=qs[_0x5f50('0x3d')](_0x2cbdb8[_0x5f50('0x35')][_0x5f50('0x3d')]);_0x3bfc7b[_0x5f50('0x3e')]=qs[_0x5f50('0x3f')](_[_0x5f50('0x40')](_0x2cbdb8[_0x5f50('0x35')],_0x59f881[_0x5f50('0x3f')]),_0x2eee5e);if(_0x2cbdb8[_0x5f50('0x35')]['filter']){_0x3bfc7b['where']=_[_0x5f50('0x41')](_0x3bfc7b[_0x5f50('0x3e')],{'$or':_[_0x5f50('0x2f')](_0x2eee5e,function(_0xf62bac){if(_0xf62bac[_0x5f50('0x33')]!=='VIRTUAL'){var _0x551ec2={};_0x551ec2[_0xf62bac['name']]={'$like':'%'+_0x2cbdb8[_0x5f50('0x35')]['filter']+'%'};return _0x551ec2;}})});}_0x3bfc7b=_[_0x5f50('0x41')]({},_0x3bfc7b,_0x2cbdb8[_0x5f50('0x42')]);var _0x135cc0={'where':_0x3bfc7b[_0x5f50('0x3e')]};return db[_0x5f50('0x30')][_0x5f50('0x24')](_0x135cc0)[_0x5f50('0x2b')](function(_0x282c53){_0x5262d0['count']=_0x282c53;if(_0x2cbdb8[_0x5f50('0x35')][_0x5f50('0x43')]){_0x3bfc7b[_0x5f50('0x44')]=[{'all':!![]}];}return db['Migration'][_0x5f50('0x45')](_0x3bfc7b);})['then'](function(_0x28c72a){_0x5262d0[_0x5f50('0x46')]=_0x28c72a;return _0x5262d0;})[_0x5f50('0x2b')](respondWithFilteredResult(_0x2c3c15,_0x3bfc7b))[_0x5f50('0x47')](handleError(_0x2c3c15,null));};
\ No newline at end of file
+var _0xd25e=['json','apply','reject','save','update','then','sendStatus','name','send','index','map','Migration','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','end','status','offset','undefined','limit','count','Content-Range'];(function(_0x39f177,_0x36aebe){var _0x4aa518=function(_0x241a0e){while(--_0x241a0e){_0x39f177['push'](_0x39f177['shift']());}};_0x4aa518(++_0x36aebe);}(_0xd25e,0x1d1));var _0xed25=function(_0x42ef22,_0x73a87b){_0x42ef22=_0x42ef22-0x0;var _0x3dc2c3=_0xd25e[_0x42ef22];return _0x3dc2c3;};'use strict';var emlformat=require(_0xed25('0x0'));var rimraf=require(_0xed25('0x1'));var zipdir=require(_0xed25('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed25('0x3'));var moment=require(_0xed25('0x4'));var BPromise=require(_0xed25('0x5'));var Mustache=require(_0xed25('0x6'));var util=require('util');var path=require(_0xed25('0x7'));var sox=require(_0xed25('0x8'));var csv=require(_0xed25('0x9'));var ejs=require(_0xed25('0xa'));var fs=require('fs');var fs_extra=require(_0xed25('0xb'));var _=require(_0xed25('0xc'));var squel=require(_0xed25('0xd'));var crypto=require(_0xed25('0xe'));var jsforce=require(_0xed25('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xed25('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xed25('0x10'));var authService=require(_0xed25('0x11'));var qs=require(_0xed25('0x12'));var as=require(_0xed25('0x13'));var hardwareService=require(_0xed25('0x14'));var logger=require('../../config/logger')(_0xed25('0x15'));var utils=require(_0xed25('0x16'));var config=require(_0xed25('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x439e1a,_0x33ae5d){_0x33ae5d=_0x33ae5d||0xcc;return function(_0x188056){if(_0x188056){return _0x439e1a['sendStatus'](_0x33ae5d);}return _0x439e1a['status'](_0x33ae5d)[_0xed25('0x18')]();};}function respondWithResult(_0x2b5a2c,_0x5d7786){_0x5d7786=_0x5d7786||0xc8;return function(_0x43614d){if(_0x43614d){return _0x2b5a2c[_0xed25('0x19')](_0x5d7786)['json'](_0x43614d);}};}function respondWithFilteredResult(_0x196882,_0x5b3c0f){return function(_0x1838cf){if(_0x1838cf){var _0x5738ae=typeof _0x5b3c0f[_0xed25('0x1a')]===_0xed25('0x1b')&&typeof _0x5b3c0f[_0xed25('0x1c')]===_0xed25('0x1b');var _0x247081=_0x1838cf[_0xed25('0x1d')];var _0x6f14df=_0x5738ae?0x0:_0x5b3c0f[_0xed25('0x1a')];var _0x524506=_0x5738ae?_0x1838cf[_0xed25('0x1d')]:_0x5b3c0f[_0xed25('0x1a')]+_0x5b3c0f[_0xed25('0x1c')];var _0x8a333b;if(_0x524506>=_0x247081){_0x524506=_0x247081;_0x8a333b=0xc8;}else{_0x8a333b=0xce;}_0x196882[_0xed25('0x19')](_0x8a333b);return _0x196882['set'](_0xed25('0x1e'),_0x6f14df+'-'+_0x524506+'/'+_0x247081)[_0xed25('0x1f')](_0x1838cf);}return null;};}function patchUpdates(_0x264e7c){return function(_0x1aabe8){try{jsonpatch[_0xed25('0x20')](_0x1aabe8,_0x264e7c,!![]);}catch(_0x1da2f0){return BPromise[_0xed25('0x21')](_0x1da2f0);}return _0x1aabe8[_0xed25('0x22')]();};}function saveUpdates(_0x3c615f,_0x2b74a6){return function(_0x493f90){if(_0x493f90){return _0x493f90[_0xed25('0x23')](_0x3c615f)[_0xed25('0x24')](function(_0x3bf6c7){return _0x3bf6c7;});}return null;};}function removeEntity(_0x193951,_0x12271f){return function(_0x48793d){if(_0x48793d){return _0x48793d['destroy']()[_0xed25('0x24')](function(){_0x193951['status'](0xcc)[_0xed25('0x18')]();});}};}function handleEntityNotFound(_0x4acc97,_0x585b13){return function(_0x8f695f){if(!_0x8f695f){_0x4acc97[_0xed25('0x25')](0x194);}return _0x8f695f;};}function handleError(_0x339a02,_0x57bc31){_0x57bc31=_0x57bc31||0x1f4;return function(_0x8ae073){logger['error'](_0x8ae073['stack']);if(_0x8ae073[_0xed25('0x26')]){delete _0x8ae073[_0xed25('0x26')];}_0x339a02[_0xed25('0x19')](_0x57bc31)[_0xed25('0x27')](_0x8ae073);};}exports[_0xed25('0x28')]=function(_0x5b6f68,_0x597202){var _0x204bfb={},_0x26d32e={},_0x18faec={'count':0x0,'rows':[]};var _0x2dc97e=_[_0xed25('0x29')](db[_0xed25('0x2a')]['rawAttributes'],function(_0x2557d1){return{'name':_0x2557d1[_0xed25('0x2b')],'type':_0x2557d1[_0xed25('0x2c')]['key']};});_0x26d32e[_0xed25('0x2d')]=_['map'](_0x2dc97e,_0xed25('0x26'));_0x26d32e[_0xed25('0x2e')]=_['keys'](_0x5b6f68[_0xed25('0x2e')]);_0x26d32e[_0xed25('0x2f')]=_[_0xed25('0x30')](_0x26d32e['model'],_0x26d32e[_0xed25('0x2e')]);_0x204bfb[_0xed25('0x31')]=_['intersection'](_0x26d32e[_0xed25('0x2d')],qs[_0xed25('0x32')](_0x5b6f68[_0xed25('0x2e')]['fields']));_0x204bfb['attributes']=_0x204bfb[_0xed25('0x31')]['length']?_0x204bfb[_0xed25('0x31')]:_0x26d32e[_0xed25('0x2d')];if(!_0x5b6f68[_0xed25('0x2e')][_0xed25('0x33')]('nolimit')){_0x204bfb['limit']=qs[_0xed25('0x1c')](_0x5b6f68[_0xed25('0x2e')][_0xed25('0x1c')]);_0x204bfb[_0xed25('0x1a')]=qs[_0xed25('0x1a')](_0x5b6f68['query']['offset']);}_0x204bfb[_0xed25('0x34')]=qs[_0xed25('0x35')](_0x5b6f68['query'][_0xed25('0x35')]);_0x204bfb[_0xed25('0x36')]=qs[_0xed25('0x2f')](_[_0xed25('0x37')](_0x5b6f68[_0xed25('0x2e')],_0x26d32e[_0xed25('0x2f')]),_0x2dc97e);if(_0x5b6f68[_0xed25('0x2e')][_0xed25('0x38')]){_0x204bfb['where']=_[_0xed25('0x39')](_0x204bfb['where'],{'$or':_[_0xed25('0x29')](_0x2dc97e,function(_0x5bc6c6){if(_0x5bc6c6[_0xed25('0x2c')]!=='VIRTUAL'){var _0x4551ec={};_0x4551ec[_0x5bc6c6[_0xed25('0x26')]]={'$like':'%'+_0x5b6f68[_0xed25('0x2e')][_0xed25('0x38')]+'%'};return _0x4551ec;}})});}_0x204bfb=_[_0xed25('0x39')]({},_0x204bfb,_0x5b6f68[_0xed25('0x3a')]);var _0xc48844={'where':_0x204bfb[_0xed25('0x36')]};return db[_0xed25('0x2a')][_0xed25('0x1d')](_0xc48844)[_0xed25('0x24')](function(_0xc0c036){_0x18faec['count']=_0xc0c036;if(_0x5b6f68[_0xed25('0x2e')][_0xed25('0x3b')]){_0x204bfb[_0xed25('0x3c')]=[{'all':!![]}];}return db['Migration']['findAll'](_0x204bfb);})[_0xed25('0x24')](function(_0x353998){_0x18faec['rows']=_0x353998;return _0x18faec;})['then'](respondWithFilteredResult(_0x597202,_0x204bfb))[_0xed25('0x3d')](handleError(_0x597202,null));};
\ No newline at end of file
index 5c0af27..1e54c03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfea0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./migration.attributes','define','Migration','migrations','lodash','util'];(function(_0x5cb472,_0x140fe9){var _0x2dcace=function(_0x5e7409){while(--_0x5e7409){_0x5cb472['push'](_0x5cb472['shift']());}};_0x2dcace(++_0x140fe9);}(_0xfea0,0x15d));var _0x0fea=function(_0x3fda39,_0x55cc43){_0x3fda39=_0x3fda39-0x0;var _0x2a4381=_0xfea0[_0x3fda39];return _0x2a4381;};'use strict';var _=require(_0x0fea('0x0'));var util=require(_0x0fea('0x1'));var logger=require(_0x0fea('0x2'))(_0x0fea('0x3'));var moment=require(_0x0fea('0x4'));var BPromise=require(_0x0fea('0x5'));var rp=require(_0x0fea('0x6'));var fs=require('fs');var path=require(_0x0fea('0x7'));var rimraf=require(_0x0fea('0x8'));var config=require('../../config/environment');var attributes=require(_0x0fea('0x9'));module['exports']=function(_0x106eb6,_0x18db6b){return _0x106eb6[_0x0fea('0xa')](_0x0fea('0xb'),attributes,{'tableName':_0x0fea('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x008e=['define','migrations','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes'];(function(_0x1b1e6,_0x31af46){var _0x586961=function(_0x47c0d4){while(--_0x47c0d4){_0x1b1e6['push'](_0x1b1e6['shift']());}};_0x586961(++_0x31af46);}(_0x008e,0x1a4));var _0xe008=function(_0x38499b,_0x145a6c){_0x38499b=_0x38499b-0x0;var _0x8cf0fd=_0x008e[_0x38499b];return _0x8cf0fd;};'use strict';var _=require(_0xe008('0x0'));var util=require('util');var logger=require(_0xe008('0x1'))(_0xe008('0x2'));var moment=require(_0xe008('0x3'));var BPromise=require(_0xe008('0x4'));var rp=require(_0xe008('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe008('0x6'));var config=require(_0xe008('0x7'));var attributes=require(_0xe008('0x8'));module['exports']=function(_0x4e136c,_0x12d0dd){return _0x4e136c[_0xe008('0x9')]('Migration',attributes,{'tableName':_0xe008('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 81f7ac2..19471bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f49=['Migration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0x3f49,0x11f));var _0x93f4=function(_0x247ae1,_0x39928e){_0x247ae1=_0x247ae1-0x0;var _0x15062d=_0x3f49[_0x247ae1];return _0x15062d;};'use strict';var _=require(_0x93f4('0x0'));var util=require(_0x93f4('0x1'));var moment=require('moment');var BPromise=require(_0x93f4('0x2'));var rs=require(_0x93f4('0x3'));var fs=require('fs');var Redis=require(_0x93f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x93f4('0x5'));var logger=require(_0x93f4('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x93f4('0x7'));var client=jayson[_0x93f4('0x8')][_0x93f4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a86ad,_0x956b50,_0x5d22d9){return new BPromise(function(_0x144f31,_0x5e5b4d){return client[_0x93f4('0xa')](_0x5a86ad,_0x5d22d9)[_0x93f4('0xb')](function(_0x325984){logger[_0x93f4('0xc')](_0x93f4('0xd'),_0x956b50,_0x93f4('0xe'));logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x956b50,_0x93f4('0xe'),JSON[_0x93f4('0xf')](_0x325984));if(_0x325984[_0x93f4('0x10')]){if(_0x325984[_0x93f4('0x10')][_0x93f4('0x11')]===0x1f4){logger[_0x93f4('0x10')](_0x93f4('0xd'),_0x956b50,_0x325984[_0x93f4('0x10')]['message']);return _0x5e5b4d(_0x325984[_0x93f4('0x10')]['message']);}logger['error'](_0x93f4('0xd'),_0x956b50,_0x325984[_0x93f4('0x10')][_0x93f4('0x12')]);return _0x144f31(_0x325984['error']['message']);}else{logger[_0x93f4('0xc')](_0x93f4('0xd'),_0x956b50,_0x93f4('0xe'));_0x144f31(_0x325984['result'][_0x93f4('0x12')]);}})[_0x93f4('0x13')](function(_0x53151e){logger[_0x93f4('0x10')]('Migration,\x20%s,\x20%s',_0x956b50,_0x53151e);_0x5e5b4d(_0x53151e);});});}
\ No newline at end of file
+var _0xe829=['request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','info','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x4b0a5a,_0x49f7ab){var _0x12d259=function(_0x3cc158){while(--_0x3cc158){_0x4b0a5a['push'](_0x4b0a5a['shift']());}};_0x12d259(++_0x49f7ab);}(_0xe829,0x1d8));var _0x9e82=function(_0x48ac7f,_0xb8ec44){_0x48ac7f=_0x48ac7f-0x0;var _0x50a9b6=_0xe829[_0x48ac7f];return _0x50a9b6;};'use strict';var _=require(_0x9e82('0x0'));var util=require(_0x9e82('0x1'));var moment=require(_0x9e82('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e82('0x3'));var db=require(_0x9e82('0x4'))['db'];var utils=require(_0x9e82('0x5'));var logger=require(_0x9e82('0x6'))(_0x9e82('0x7'));var config=require(_0x9e82('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9e82('0x9')][_0x9e82('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a63b3,_0x7cebd4,_0x2d91ba){return new BPromise(function(_0x5c4c57,_0x149f39){return client['request'](_0x1a63b3,_0x2d91ba)[_0x9e82('0xb')](function(_0x13070b){logger['info']('Migration,\x20%s,\x20%s',_0x7cebd4,_0x9e82('0xc'));logger[_0x9e82('0xd')](_0x9e82('0xe'),_0x7cebd4,_0x9e82('0xc'),JSON[_0x9e82('0xf')](_0x13070b));if(_0x13070b[_0x9e82('0x10')]){if(_0x13070b[_0x9e82('0x10')][_0x9e82('0x11')]===0x1f4){logger[_0x9e82('0x10')](_0x9e82('0x12'),_0x7cebd4,_0x13070b[_0x9e82('0x10')][_0x9e82('0x13')]);return _0x149f39(_0x13070b['error']['message']);}logger[_0x9e82('0x10')](_0x9e82('0x12'),_0x7cebd4,_0x13070b[_0x9e82('0x10')][_0x9e82('0x13')]);return _0x5c4c57(_0x13070b['error'][_0x9e82('0x13')]);}else{logger[_0x9e82('0x14')](_0x9e82('0x12'),_0x7cebd4,_0x9e82('0xc'));_0x5c4c57(_0x13070b['result'][_0x9e82('0x13')]);}})[_0x9e82('0x15')](function(_0x3f70a3){logger[_0x9e82('0x10')]('Migration,\x20%s,\x20%s',_0x7cebd4,_0x3f70a3);_0x149f39(_0x3f70a3);});});}
\ No newline at end of file
index c34f82b..8576f12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a87=['delete','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','post','create','update'];(function(_0x4e6eb2,_0x16a451){var _0x4e0c1c=function(_0x59f144){while(--_0x59f144){_0x4e6eb2['push'](_0x4e6eb2['shift']());}};_0x4e0c1c(++_0x16a451);}(_0x8a87,0x6b));var _0x78a8=function(_0x3e2e82,_0x369bbe){_0x3e2e82=_0x3e2e82-0x0;var _0xba15aa=_0x8a87[_0x3e2e82];return _0xba15aa;};'use strict';var multer=require(_0x78a8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x78a8('0x1'));var express=require('express');var router=express[_0x78a8('0x2')]();var fs_extra=require(_0x78a8('0x3'));var auth=require(_0x78a8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x78a8('0x5'));var controller=require('./network.controller');router['get']('/',auth[_0x78a8('0x6')](),controller[_0x78a8('0x7')]);router[_0x78a8('0x8')](_0x78a8('0x9'),auth[_0x78a8('0x6')](),controller['show']);router[_0x78a8('0xa')]('/',auth['isAuthenticated'](),controller[_0x78a8('0xb')]);router['put'](_0x78a8('0x9'),auth[_0x78a8('0x6')](),controller[_0x78a8('0xc')]);router[_0x78a8('0xd')](_0x78a8('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x78a8('0xe')]=router;
\ No newline at end of file
+var _0x3d1f=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','isAuthenticated','show','create','/:id','destroy','exports','multer'];(function(_0x2a7ad8,_0x593e72){var _0x2e926b=function(_0x30bc8c){while(--_0x30bc8c){_0x2a7ad8['push'](_0x2a7ad8['shift']());}};_0x2e926b(++_0x593e72);}(_0x3d1f,0xfb));var _0xf3d1=function(_0x3a744c,_0x18dbba){_0x3a744c=_0x3a744c-0x0;var _0x3456c6=_0x3d1f[_0x3a744c];return _0x3456c6;};'use strict';var multer=require(_0xf3d1('0x0'));var util=require(_0xf3d1('0x1'));var path=require(_0xf3d1('0x2'));var timeout=require(_0xf3d1('0x3'));var express=require('express');var router=express[_0xf3d1('0x4')]();var fs_extra=require(_0xf3d1('0x5'));var auth=require(_0xf3d1('0x6'));var interaction=require(_0xf3d1('0x7'));var config=require(_0xf3d1('0x8'));var controller=require(_0xf3d1('0x9'));router[_0xf3d1('0xa')]('/',auth['isAuthenticated'](),controller[_0xf3d1('0xb')]);router[_0xf3d1('0xa')]('/:id',auth[_0xf3d1('0xc')](),controller[_0xf3d1('0xd')]);router['post']('/',auth[_0xf3d1('0xc')](),controller[_0xf3d1('0xe')]);router['put'](_0xf3d1('0xf'),auth[_0xf3d1('0xc')](),controller['update']);router['delete'](_0xf3d1('0xf'),auth[_0xf3d1('0xc')](),controller[_0xf3d1('0x10')]);module[_0xf3d1('0x11')]=router;
\ No newline at end of file
index 7fcbfb9..46d43b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x808f=['turn','STRING','sequelize','exports','ENUM','stun'];(function(_0x4d571a,_0xfad568){var _0x59b727=function(_0x488db6){while(--_0x488db6){_0x4d571a['push'](_0x4d571a['shift']());}};_0x59b727(++_0xfad568);}(_0x808f,0xc2));var _0xf808=function(_0x38e668,_0xc67ebf){_0x38e668=_0x38e668-0x0;var _0x272d03=_0x808f[_0x38e668];return _0x272d03;};'use strict';var Sequelize=require(_0xf808('0x0'));module[_0xf808('0x1')]={'type':{'type':Sequelize[_0xf808('0x2')]('localnet','externip',_0xf808('0x3'),_0xf808('0x4'))},'value':{'type':Sequelize[_0xf808('0x5')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xf808('0x5')]}};
\ No newline at end of file
+var _0xb4cf=['sequelize','exports','ENUM','localnet','stun','STRING'];(function(_0x36e6e1,_0x57a450){var _0xc8dc3c=function(_0x320159){while(--_0x320159){_0x36e6e1['push'](_0x36e6e1['shift']());}};_0xc8dc3c(++_0x57a450);}(_0xb4cf,0xa2));var _0xfb4c=function(_0x210cd8,_0x12799e){_0x210cd8=_0x210cd8-0x0;var _0x1af9e4=_0xb4cf[_0x210cd8];return _0x1af9e4;};'use strict';var Sequelize=require(_0xfb4c('0x0'));module[_0xfb4c('0x1')]={'type':{'type':Sequelize[_0xfb4c('0x2')](_0xfb4c('0x3'),'externip',_0xfb4c('0x4'),'turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xfb4c('0x5')]}};
\ No newline at end of file
index 8f3f9df..b105052 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6403=['merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','create','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','body','toLowerCase','chan_sip.so','TURN','path','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x4d67b9,_0x2ae8af){var _0x6462ed=function(_0x2d051d){while(--_0x2d051d){_0x4d67b9['push'](_0x4d67b9['shift']());}};_0x6462ed(++_0x2ae8af);}(_0x6403,0x17b));var _0x3640=function(_0x58329b,_0x58f381){_0x58329b=_0x58329b-0x0;var _0x5c7173=_0x6403[_0x58329b];return _0x5c7173;};'use strict';var util=require('util');var path=require(_0x3640('0x0'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3640('0x1'));var qs=require(_0x3640('0x2'));var logger=require(_0x3640('0x3'))('api');var config=require(_0x3640('0x4'));var db=require(_0x3640('0x5'))['db'];var jayson=require(_0x3640('0x6'));var client=jayson[_0x3640('0x7')][_0x3640('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56d2c9,_0x53e960,_0x589525,_0x7b4fc4){return new Promise(function(_0x4f3819,_0x4f67a5){var _0x461b72=_0x7b4fc4||client;return _0x461b72[_0x3640('0x9')](_0x56d2c9,_0x589525)[_0x3640('0xa')](function(_0x42c1a2){logger[_0x3640('0xb')](_0x3640('0xc'),_0x53e960,_0x3640('0xd'));logger[_0x3640('0xe')](_0x3640('0xf'),_0x53e960,_0x3640('0xd'),JSON[_0x3640('0x10')](_0x42c1a2));if(_0x42c1a2['error']){if(_0x42c1a2['error'][_0x3640('0x11')]===0x1f4){logger[_0x3640('0x12')]('Network,\x20%s,\x20%s',_0x53e960,_0x42c1a2['error'][_0x3640('0x13')]);return _0x4f67a5(_0x42c1a2['error'][_0x3640('0x13')]);}logger[_0x3640('0x12')]('Network,\x20%s,\x20%s',_0x53e960,_0x42c1a2[_0x3640('0x12')][_0x3640('0x13')]);return _0x4f3819(_0x42c1a2[_0x3640('0x12')][_0x3640('0x13')]);}else{logger[_0x3640('0xb')](_0x3640('0xc'),_0x53e960,_0x3640('0xd'));_0x4f3819(_0x42c1a2[_0x3640('0x14')][_0x3640('0x13')]);}})['catch'](function(_0x492fcc){logger[_0x3640('0x12')](_0x3640('0xc'),_0x53e960,_0x492fcc);_0x4f67a5(_0x492fcc);});});}function respondWithResult(_0x4c6ee3,_0x7d4cc4){_0x7d4cc4=_0x7d4cc4||0xc8;return function(_0x356818){if(_0x356818){return _0x4c6ee3[_0x3640('0x15')](_0x7d4cc4)[_0x3640('0x16')](_0x356818);}};}function respondWithFilteredResult(_0x501a9f,_0xffdef1){return function(_0x49fbb7){if(_0x49fbb7){var _0x5f2b7d=typeof _0xffdef1[_0x3640('0x17')]===_0x3640('0x18')&&typeof _0xffdef1[_0x3640('0x19')]===_0x3640('0x18');var _0x270733=_0x49fbb7[_0x3640('0x1a')];var _0x36ce29=_0x5f2b7d?0x0:_0xffdef1[_0x3640('0x17')];var _0x4e23e8=_0x5f2b7d?_0x49fbb7[_0x3640('0x1a')]:_0xffdef1[_0x3640('0x17')]+_0xffdef1['limit'];var _0x441c50;if(_0x4e23e8>=_0x270733){_0x4e23e8=_0x270733;_0x441c50=0xc8;}else{_0x441c50=0xce;}_0x501a9f[_0x3640('0x15')](_0x441c50);return _0x501a9f[_0x3640('0x1b')](_0x3640('0x1c'),_0x36ce29+'-'+_0x4e23e8+'/'+_0x270733)[_0x3640('0x16')](_0x49fbb7);}return null;};}function saveUpdates(_0x11f5c4){return function(_0x3fd60f){if(_0x3fd60f){return _0x3fd60f[_0x3640('0x1d')](_0x11f5c4)[_0x3640('0xa')](function(_0x416ac0){return _0x416ac0;});}return null;};}function removeEntity(_0x1d3ade){return function(_0x21dffe){if(_0x21dffe){return _0x21dffe[_0x3640('0x1e')]()[_0x3640('0xa')](function(){_0x1d3ade[_0x3640('0x15')](0xcc)[_0x3640('0x1f')]();});}};}function handleEntityNotFound(_0x219ac6){return function(_0xb422dd){if(!_0xb422dd){_0x219ac6[_0x3640('0x20')](0x194);}return _0xb422dd;};}function handleError(_0x3295c5,_0x449b81){_0x449b81=_0x449b81||0x1f4;return function(_0x5dc86a){logger[_0x3640('0x12')](_0x5dc86a[_0x3640('0x21')]);if(_0x5dc86a[_0x3640('0x22')]){delete _0x5dc86a[_0x3640('0x22')];}_0x3295c5['status'](_0x449b81)['send'](_0x5dc86a);};}exports[_0x3640('0x23')]=function(_0x5c278d,_0x2946a9){var _0x313410={},_0xc968f6={},_0x367841={'count':0x0,'rows':[]};var _0x6cfe12=_[_0x3640('0x24')](db[_0x3640('0x25')][_0x3640('0x26')],function(_0x21841d){return{'name':_0x21841d[_0x3640('0x27')],'type':_0x21841d[_0x3640('0x28')][_0x3640('0x29')]};});_0xc968f6[_0x3640('0x2a')]=_[_0x3640('0x24')](_0x6cfe12,_0x3640('0x22'));_0xc968f6[_0x3640('0x2b')]=_[_0x3640('0x2c')](_0x5c278d['query']);_0xc968f6[_0x3640('0x2d')]=_[_0x3640('0x2e')](_0xc968f6['model'],_0xc968f6[_0x3640('0x2b')]);_0x313410[_0x3640('0x2f')]=_['intersection'](_0xc968f6[_0x3640('0x2a')],qs[_0x3640('0x30')](_0x5c278d[_0x3640('0x2b')][_0x3640('0x30')]));_0x313410['attributes']=_0x313410[_0x3640('0x2f')][_0x3640('0x31')]?_0x313410[_0x3640('0x2f')]:_0xc968f6[_0x3640('0x2a')];if(!_0x5c278d[_0x3640('0x2b')][_0x3640('0x32')](_0x3640('0x33'))){_0x313410[_0x3640('0x19')]=qs[_0x3640('0x19')](_0x5c278d[_0x3640('0x2b')][_0x3640('0x19')]);_0x313410[_0x3640('0x17')]=qs[_0x3640('0x17')](_0x5c278d[_0x3640('0x2b')][_0x3640('0x17')]);}_0x313410[_0x3640('0x34')]=qs[_0x3640('0x35')](_0x5c278d['query'][_0x3640('0x35')]);_0x313410[_0x3640('0x36')]=qs['filters'](_['pick'](_0x5c278d[_0x3640('0x2b')],_0xc968f6[_0x3640('0x2d')]),_0x6cfe12);if(_0x5c278d[_0x3640('0x2b')][_0x3640('0x37')]){_0x313410[_0x3640('0x36')]=_[_0x3640('0x38')](_0x313410[_0x3640('0x36')],{'$or':_[_0x3640('0x24')](_0x6cfe12,function(_0x680b){if(_0x680b['type']!==_0x3640('0x39')){var _0x5b2714={};_0x5b2714[_0x680b[_0x3640('0x22')]]={'$like':'%'+_0x5c278d[_0x3640('0x2b')][_0x3640('0x37')]+'%'};return _0x5b2714;}})});}_0x313410=_[_0x3640('0x38')]({},_0x313410,_0x5c278d[_0x3640('0x3a')]);var _0x3445a4={'where':_0x313410[_0x3640('0x36')]};return db[_0x3640('0x25')][_0x3640('0x1a')](_0x3445a4)[_0x3640('0xa')](function(_0x46e39e){_0x367841[_0x3640('0x1a')]=_0x46e39e;if(_0x5c278d[_0x3640('0x2b')][_0x3640('0x3b')]){_0x313410[_0x3640('0x3c')]=[{'all':!![]}];}return db[_0x3640('0x25')][_0x3640('0x3d')](_0x313410);})['then'](function(_0x14d533){_0x367841['rows']=_0x14d533;return _0x367841;})[_0x3640('0xa')](respondWithFilteredResult(_0x2946a9,_0x313410))[_0x3640('0x3e')](handleError(_0x2946a9,null));};exports['show']=function(_0x23ac37,_0x38a9a2){var _0xcc171e={'raw':!![],'where':{'id':_0x23ac37[_0x3640('0x3f')]['id']}},_0x1c5a05={};_0x1c5a05[_0x3640('0x2a')]=_[_0x3640('0x2c')](db[_0x3640('0x25')][_0x3640('0x26')]);_0x1c5a05[_0x3640('0x2b')]=_[_0x3640('0x2c')](_0x23ac37[_0x3640('0x2b')]);_0x1c5a05[_0x3640('0x2d')]=_[_0x3640('0x2e')](_0x1c5a05[_0x3640('0x2a')],_0x1c5a05['query']);_0xcc171e[_0x3640('0x2f')]=_['intersection'](_0x1c5a05[_0x3640('0x2a')],qs['fields'](_0x23ac37[_0x3640('0x2b')][_0x3640('0x30')]));_0xcc171e['attributes']=_0xcc171e[_0x3640('0x2f')][_0x3640('0x31')]?_0xcc171e[_0x3640('0x2f')]:_0x1c5a05[_0x3640('0x2a')];if(_0x23ac37[_0x3640('0x2b')][_0x3640('0x3b')]){_0xcc171e[_0x3640('0x3c')]=[{'all':!![]}];}_0xcc171e=_[_0x3640('0x38')]({},_0xcc171e,_0x23ac37[_0x3640('0x3a')]);return db['Network'][_0x3640('0x40')](_0xcc171e)[_0x3640('0xa')](handleEntityNotFound(_0x38a9a2,null))[_0x3640('0xa')](respondWithResult(_0x38a9a2,null))[_0x3640('0x3e')](handleError(_0x38a9a2,null));};exports['create']=function(_0x438757,_0x191739){var _0x113b0e;return db[_0x3640('0x25')]['create'](_0x438757['body'],{'raw':!![]})['then'](function(_0x2b411d){_0x113b0e=_0x2b411d;return db[_0x3640('0x25')][_0x3640('0x3d')]({'where':{'type':_0x438757['body'][_0x3640('0x28')]},'raw':!![]});})[_0x3640('0xa')](function(_0x3d7b92){if(_0x113b0e[_0x3640('0x28')][_0x3640('0x41')]()==_0x3640('0x42')){var _0x171576=fs['readFileSync'](path[_0x3640('0x43')](config[_0x3640('0x44')],_0x3640('0x45')),_0x3640('0x46'));var _0x1f542d=ejs[_0x3640('0x47')](_0x171576,{'networks':_0x3d7b92||[]});fs[_0x3640('0x48')](_0x3640('0x49'),_0x1f542d);return respondWithRpcPromise(_0x3640('0x4a'),'create',{'module':_0x3640('0x4b')});}else if(_0x113b0e['type'][_0x3640('0x41')]()=='TURN'){var _0x3163e7=fs[_0x3640('0x4c')](path[_0x3640('0x43')](config[_0x3640('0x44')],_0x3640('0x4d')),_0x3640('0x46'));var _0x5b8922=ejs[_0x3640('0x47')](_0x3163e7,{'networks':_0x3d7b92||[]});fs[_0x3640('0x48')](_0x3640('0x4e'),_0x5b8922);return respondWithRpcPromise(_0x3640('0x4a'),_0x3640('0x4f'),{'module':_0x3640('0x4b')});}else{var _0x426f55=fs[_0x3640('0x4c')](path[_0x3640('0x43')](config[_0x3640('0x44')],_0x3640('0x50')),'utf8');var _0x2409af=ejs['render'](_0x426f55,{'networks':_0x3d7b92||[]});fs[_0x3640('0x48')](util[_0x3640('0x51')](_0x3640('0x52'),_0x438757[_0x3640('0x53')][_0x3640('0x28')][_0x3640('0x54')]()),_0x2409af);return respondWithRpcPromise(_0x3640('0x4a'),'create',{'module':_0x3640('0x55')});}})[_0x3640('0xa')](function(){return _0x113b0e;})[_0x3640('0xa')](respondWithResult(_0x191739,0xc9))[_0x3640('0x3e')](handleError(_0x191739,null));};exports[_0x3640('0x1d')]=function(_0x532492,_0x29e4c7){var _0x10f480;return db['Network']['find']({'where':{'id':_0x532492[_0x3640('0x3f')]['id']}})[_0x3640('0xa')](handleEntityNotFound(_0x29e4c7,null))[_0x3640('0xa')](saveUpdates(_0x532492[_0x3640('0x53')],null))['then'](function(_0x41d0f9){if(_0x41d0f9){_0x10f480=_0x41d0f9;return db['Network']['findAll']({'where':{'type':_0x10f480[_0x3640('0x28')]},'raw':!![]});}return null;})[_0x3640('0xa')](function(_0x27fa45){if(_0x10f480[_0x3640('0x28')][_0x3640('0x41')]()==_0x3640('0x42')){var _0x51b58a=fs[_0x3640('0x4c')](path[_0x3640('0x43')](config['root'],_0x3640('0x45')),'utf8');var _0x31ea93=ejs[_0x3640('0x47')](_0x51b58a,{'networks':_0x27fa45||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x31ea93);return respondWithRpcPromise(_0x3640('0x4a'),_0x3640('0x1d'),{'module':_0x3640('0x4b')});}else if(_0x10f480['type'][_0x3640('0x41')]()==_0x3640('0x56')){var _0x586ffd=fs[_0x3640('0x4c')](path[_0x3640('0x43')](config['root'],'server/files/templates/turn_multiple.ejs'),'utf8');var _0xfb08d7=ejs['render'](_0x586ffd,{'networks':_0x27fa45||[]});fs[_0x3640('0x48')]('/etc/asterisk/turn_xcally.conf',_0xfb08d7);return respondWithRpcPromise(_0x3640('0x4a'),_0x3640('0x1d'),{'module':_0x3640('0x4b')});}else{var _0x265b25=fs[_0x3640('0x4c')](path['join'](config[_0x3640('0x44')],_0x3640('0x50')),_0x3640('0x46'));var _0x24a728=ejs[_0x3640('0x47')](_0x265b25,{'networks':_0x27fa45||[]});fs[_0x3640('0x48')](util[_0x3640('0x51')](_0x3640('0x52'),_0x532492[_0x3640('0x53')][_0x3640('0x28')]['toLowerCase']()),_0x24a728);return respondWithRpcPromise(_0x3640('0x4a'),_0x3640('0x1d'),{'module':_0x3640('0x55')});}})['then'](function(_0x2438cc){if(_0x2438cc){return _0x10f480;}return null;})[_0x3640('0xa')](respondWithResult(_0x29e4c7,null))[_0x3640('0x3e')](handleError(_0x29e4c7,null));};exports[_0x3640('0x1e')]=function(_0x420307,_0x215a2e){var _0x51c3c1;return db[_0x3640('0x25')][_0x3640('0x40')]({'where':{'id':_0x420307['params']['id']}})['then'](function(_0x2fac4b){_0x51c3c1=_0x2fac4b;return _0x2fac4b;})[_0x3640('0xa')](handleEntityNotFound(_0x215a2e,null))[_0x3640('0xa')](removeEntity(_0x215a2e,null))['then'](function(){if(_0x51c3c1){return db[_0x3640('0x25')]['findAll']({'where':{'type':_0x51c3c1[_0x3640('0x28')]},'raw':!![]});}})[_0x3640('0xa')](function(_0x3ef773){if(_0x51c3c1[_0x3640('0x28')][_0x3640('0x41')]()==_0x3640('0x42')){var _0x38863f=fs[_0x3640('0x4c')](path[_0x3640('0x43')](config[_0x3640('0x44')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x417281=ejs[_0x3640('0x47')](_0x38863f,{'networks':_0x3ef773||[]});fs[_0x3640('0x48')](_0x3640('0x49'),_0x417281);return respondWithRpcPromise(_0x3640('0x4a'),_0x3640('0x1e'),{'module':_0x3640('0x4b')});}else if(_0x51c3c1[_0x3640('0x28')][_0x3640('0x41')]()==_0x3640('0x56')){var _0x2ce319=fs['readFileSync'](path[_0x3640('0x43')](config[_0x3640('0x44')],_0x3640('0x4d')),'utf8');var _0x183789=ejs[_0x3640('0x47')](_0x2ce319,{'networks':_0x3ef773||[]});fs['writeFileSync'](_0x3640('0x4e'),_0x183789);return respondWithRpcPromise(_0x3640('0x4a'),_0x3640('0x1e'),{'module':'res_stun_monitor.so'});}else{var _0x3d0927=fs[_0x3640('0x4c')](path[_0x3640('0x43')](config[_0x3640('0x44')],'server/files/templates/network.ejs'),_0x3640('0x46'));var _0x159578=ejs[_0x3640('0x47')](_0x3d0927,{'networks':_0x3ef773||[]});fs[_0x3640('0x48')](util[_0x3640('0x51')]('/etc/asterisk/sip_xcally_%s.conf',_0x51c3c1['type'][_0x3640('0x54')]()),_0x159578);return respondWithRpcPromise('Reload',_0x3640('0x1e'),{'module':_0x3640('0x55')});}})[_0x3640('0x3e')](handleError(_0x215a2e,null));};
\ No newline at end of file
+var _0xda84=['Network','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','create','body','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','toUpperCase','TURN','readFileSync','join','root','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','toLowerCase','Reload','chan_sip.so','update','find','server/files/templates/turn_multiple.ejs','/etc/asterisk/sip_xcally_%s.conf','destroy','STUN','util','ejs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','json','offset','limit','undefined','count','set','Content-Range','end','sendStatus','stack','name','status','send','index','map'];(function(_0x3d6cf5,_0x51cd3d){var _0x33ea68=function(_0x3cc3e4){while(--_0x3cc3e4){_0x3d6cf5['push'](_0x3d6cf5['shift']());}};_0x33ea68(++_0x51cd3d);}(_0xda84,0x88));var _0x4da8=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xda84[_0x1d1779];return _0x2377e9;};'use strict';var util=require(_0x4da8('0x0'));var path=require('path');var ejs=require(_0x4da8('0x1'));var fs=require('fs');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0x4da8('0x2'))(_0x4da8('0x3'));var config=require(_0x4da8('0x4'));var db=require(_0x4da8('0x5'))['db'];var jayson=require(_0x4da8('0x6'));var client=jayson[_0x4da8('0x7')][_0x4da8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x506e41,_0x25c739,_0x48ba5a,_0x288c27){return new Promise(function(_0x216383,_0x4a3704){var _0x3fd4b8=_0x288c27||client;return _0x3fd4b8[_0x4da8('0x9')](_0x506e41,_0x48ba5a)[_0x4da8('0xa')](function(_0x160be5){logger[_0x4da8('0xb')](_0x4da8('0xc'),_0x25c739,_0x4da8('0xd'));logger['debug'](_0x4da8('0xe'),_0x25c739,_0x4da8('0xd'),JSON[_0x4da8('0xf')](_0x160be5));if(_0x160be5[_0x4da8('0x10')]){if(_0x160be5[_0x4da8('0x10')][_0x4da8('0x11')]===0x1f4){logger[_0x4da8('0x10')](_0x4da8('0xc'),_0x25c739,_0x160be5[_0x4da8('0x10')][_0x4da8('0x12')]);return _0x4a3704(_0x160be5['error'][_0x4da8('0x12')]);}logger['error'](_0x4da8('0xc'),_0x25c739,_0x160be5[_0x4da8('0x10')][_0x4da8('0x12')]);return _0x216383(_0x160be5['error'][_0x4da8('0x12')]);}else{logger['info'](_0x4da8('0xc'),_0x25c739,_0x4da8('0xd'));_0x216383(_0x160be5['result'][_0x4da8('0x12')]);}})['catch'](function(_0x4d6051){logger[_0x4da8('0x10')](_0x4da8('0xc'),_0x25c739,_0x4d6051);_0x4a3704(_0x4d6051);});});}function respondWithResult(_0x208479,_0x19a60c){_0x19a60c=_0x19a60c||0xc8;return function(_0x12722e){if(_0x12722e){return _0x208479['status'](_0x19a60c)[_0x4da8('0x13')](_0x12722e);}};}function respondWithFilteredResult(_0x38ad74,_0x4ac83d){return function(_0x2a0801){if(_0x2a0801){var _0x2ed058=typeof _0x4ac83d[_0x4da8('0x14')]==='undefined'&&typeof _0x4ac83d[_0x4da8('0x15')]===_0x4da8('0x16');var _0x472497=_0x2a0801[_0x4da8('0x17')];var _0x435832=_0x2ed058?0x0:_0x4ac83d[_0x4da8('0x14')];var _0x1ecb6d=_0x2ed058?_0x2a0801[_0x4da8('0x17')]:_0x4ac83d[_0x4da8('0x14')]+_0x4ac83d[_0x4da8('0x15')];var _0xb3636e;if(_0x1ecb6d>=_0x472497){_0x1ecb6d=_0x472497;_0xb3636e=0xc8;}else{_0xb3636e=0xce;}_0x38ad74['status'](_0xb3636e);return _0x38ad74[_0x4da8('0x18')](_0x4da8('0x19'),_0x435832+'-'+_0x1ecb6d+'/'+_0x472497)[_0x4da8('0x13')](_0x2a0801);}return null;};}function saveUpdates(_0x9bf0d7){return function(_0x7addcd){if(_0x7addcd){return _0x7addcd['update'](_0x9bf0d7)[_0x4da8('0xa')](function(_0x59bcbf){return _0x59bcbf;});}return null;};}function removeEntity(_0x38f338){return function(_0x20b22d){if(_0x20b22d){return _0x20b22d['destroy']()['then'](function(){_0x38f338['status'](0xcc)[_0x4da8('0x1a')]();});}};}function handleEntityNotFound(_0x3d6c98){return function(_0x2d0f82){if(!_0x2d0f82){_0x3d6c98[_0x4da8('0x1b')](0x194);}return _0x2d0f82;};}function handleError(_0x323f0a,_0x589c0b){_0x589c0b=_0x589c0b||0x1f4;return function(_0x2bb06b){logger[_0x4da8('0x10')](_0x2bb06b[_0x4da8('0x1c')]);if(_0x2bb06b[_0x4da8('0x1d')]){delete _0x2bb06b[_0x4da8('0x1d')];}_0x323f0a[_0x4da8('0x1e')](_0x589c0b)[_0x4da8('0x1f')](_0x2bb06b);};}exports[_0x4da8('0x20')]=function(_0x23c3f1,_0x42c4fc){var _0x1d726e={},_0xac92f7={},_0x35d869={'count':0x0,'rows':[]};var _0x1a83be=_[_0x4da8('0x21')](db[_0x4da8('0x22')]['rawAttributes'],function(_0x47ba4b){return{'name':_0x47ba4b[_0x4da8('0x23')],'type':_0x47ba4b[_0x4da8('0x24')]['key']};});_0xac92f7[_0x4da8('0x25')]=_['map'](_0x1a83be,_0x4da8('0x1d'));_0xac92f7[_0x4da8('0x26')]=_[_0x4da8('0x27')](_0x23c3f1[_0x4da8('0x26')]);_0xac92f7[_0x4da8('0x28')]=_[_0x4da8('0x29')](_0xac92f7[_0x4da8('0x25')],_0xac92f7[_0x4da8('0x26')]);_0x1d726e[_0x4da8('0x2a')]=_[_0x4da8('0x29')](_0xac92f7[_0x4da8('0x25')],qs[_0x4da8('0x2b')](_0x23c3f1['query'][_0x4da8('0x2b')]));_0x1d726e[_0x4da8('0x2a')]=_0x1d726e[_0x4da8('0x2a')][_0x4da8('0x2c')]?_0x1d726e[_0x4da8('0x2a')]:_0xac92f7[_0x4da8('0x25')];if(!_0x23c3f1[_0x4da8('0x26')][_0x4da8('0x2d')](_0x4da8('0x2e'))){_0x1d726e[_0x4da8('0x15')]=qs[_0x4da8('0x15')](_0x23c3f1[_0x4da8('0x26')]['limit']);_0x1d726e[_0x4da8('0x14')]=qs['offset'](_0x23c3f1['query'][_0x4da8('0x14')]);}_0x1d726e['order']=qs[_0x4da8('0x2f')](_0x23c3f1[_0x4da8('0x26')]['sort']);_0x1d726e['where']=qs[_0x4da8('0x28')](_[_0x4da8('0x30')](_0x23c3f1['query'],_0xac92f7[_0x4da8('0x28')]),_0x1a83be);if(_0x23c3f1[_0x4da8('0x26')][_0x4da8('0x31')]){_0x1d726e[_0x4da8('0x32')]=_[_0x4da8('0x33')](_0x1d726e[_0x4da8('0x32')],{'$or':_[_0x4da8('0x21')](_0x1a83be,function(_0x1c734e){if(_0x1c734e['type']!=='VIRTUAL'){var _0x31c60d={};_0x31c60d[_0x1c734e[_0x4da8('0x1d')]]={'$like':'%'+_0x23c3f1['query'][_0x4da8('0x31')]+'%'};return _0x31c60d;}})});}_0x1d726e=_[_0x4da8('0x33')]({},_0x1d726e,_0x23c3f1[_0x4da8('0x34')]);var _0x550bb8={'where':_0x1d726e[_0x4da8('0x32')]};return db[_0x4da8('0x22')][_0x4da8('0x17')](_0x550bb8)[_0x4da8('0xa')](function(_0x46f17c){_0x35d869[_0x4da8('0x17')]=_0x46f17c;if(_0x23c3f1[_0x4da8('0x26')][_0x4da8('0x35')]){_0x1d726e['include']=[{'all':!![]}];}return db[_0x4da8('0x22')][_0x4da8('0x36')](_0x1d726e);})[_0x4da8('0xa')](function(_0x37ce06){_0x35d869[_0x4da8('0x37')]=_0x37ce06;return _0x35d869;})['then'](respondWithFilteredResult(_0x42c4fc,_0x1d726e))[_0x4da8('0x38')](handleError(_0x42c4fc,null));};exports[_0x4da8('0x39')]=function(_0x5cd957,_0x5cd363){var _0x1eb1ac={'raw':!![],'where':{'id':_0x5cd957[_0x4da8('0x3a')]['id']}},_0x84cbbb={};_0x84cbbb[_0x4da8('0x25')]=_[_0x4da8('0x27')](db[_0x4da8('0x22')][_0x4da8('0x3b')]);_0x84cbbb[_0x4da8('0x26')]=_[_0x4da8('0x27')](_0x5cd957['query']);_0x84cbbb[_0x4da8('0x28')]=_['intersection'](_0x84cbbb[_0x4da8('0x25')],_0x84cbbb['query']);_0x1eb1ac[_0x4da8('0x2a')]=_[_0x4da8('0x29')](_0x84cbbb[_0x4da8('0x25')],qs[_0x4da8('0x2b')](_0x5cd957[_0x4da8('0x26')][_0x4da8('0x2b')]));_0x1eb1ac[_0x4da8('0x2a')]=_0x1eb1ac['attributes'][_0x4da8('0x2c')]?_0x1eb1ac['attributes']:_0x84cbbb[_0x4da8('0x25')];if(_0x5cd957['query'][_0x4da8('0x35')]){_0x1eb1ac['include']=[{'all':!![]}];}_0x1eb1ac=_[_0x4da8('0x33')]({},_0x1eb1ac,_0x5cd957[_0x4da8('0x34')]);return db[_0x4da8('0x22')]['find'](_0x1eb1ac)['then'](handleEntityNotFound(_0x5cd363,null))[_0x4da8('0xa')](respondWithResult(_0x5cd363,null))[_0x4da8('0x38')](handleError(_0x5cd363,null));};exports['create']=function(_0x1db21a,_0x37886e){var _0x3351be;return db[_0x4da8('0x22')][_0x4da8('0x3c')](_0x1db21a[_0x4da8('0x3d')],{'raw':!![]})[_0x4da8('0xa')](function(_0x308f31){_0x3351be=_0x308f31;return db[_0x4da8('0x22')][_0x4da8('0x36')]({'where':{'type':_0x1db21a[_0x4da8('0x3d')][_0x4da8('0x24')]},'raw':!![]});})[_0x4da8('0xa')](function(_0x582f46){if(_0x3351be[_0x4da8('0x24')]['toUpperCase']()=='STUN'){var _0x58881b=fs['readFileSync'](path['join'](config['root'],_0x4da8('0x3e')),_0x4da8('0x3f'));var _0x5778a9=ejs[_0x4da8('0x40')](_0x58881b,{'networks':_0x582f46||[]});fs[_0x4da8('0x41')](_0x4da8('0x42'),_0x5778a9);return respondWithRpcPromise('Reload',_0x4da8('0x3c'),{'module':_0x4da8('0x43')});}else if(_0x3351be['type'][_0x4da8('0x44')]()==_0x4da8('0x45')){var _0x759fa2=fs[_0x4da8('0x46')](path[_0x4da8('0x47')](config[_0x4da8('0x48')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x3ca05e=ejs[_0x4da8('0x40')](_0x759fa2,{'networks':_0x582f46||[]});fs[_0x4da8('0x41')](_0x4da8('0x49'),_0x3ca05e);return respondWithRpcPromise('Reload',_0x4da8('0x3c'),{'module':'res_stun_monitor.so'});}else{var _0x22bf77=fs[_0x4da8('0x46')](path['join'](config[_0x4da8('0x48')],_0x4da8('0x4a')),_0x4da8('0x3f'));var _0x46b9d0=ejs['render'](_0x22bf77,{'networks':_0x582f46||[]});fs[_0x4da8('0x41')](util[_0x4da8('0x4b')]('/etc/asterisk/sip_xcally_%s.conf',_0x1db21a['body'][_0x4da8('0x24')][_0x4da8('0x4c')]()),_0x46b9d0);return respondWithRpcPromise(_0x4da8('0x4d'),_0x4da8('0x3c'),{'module':_0x4da8('0x4e')});}})[_0x4da8('0xa')](function(){return _0x3351be;})['then'](respondWithResult(_0x37886e,0xc9))[_0x4da8('0x38')](handleError(_0x37886e,null));};exports[_0x4da8('0x4f')]=function(_0x4de054,_0x1f36d3){var _0x20cf1c;return db[_0x4da8('0x22')][_0x4da8('0x50')]({'where':{'id':_0x4de054[_0x4da8('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1f36d3,null))[_0x4da8('0xa')](saveUpdates(_0x4de054['body'],null))['then'](function(_0x5a7df6){if(_0x5a7df6){_0x20cf1c=_0x5a7df6;return db[_0x4da8('0x22')][_0x4da8('0x36')]({'where':{'type':_0x20cf1c[_0x4da8('0x24')]},'raw':!![]});}return null;})['then'](function(_0x1e5926){if(_0x20cf1c['type'][_0x4da8('0x44')]()=='STUN'){var _0x538152=fs[_0x4da8('0x46')](path[_0x4da8('0x47')](config[_0x4da8('0x48')],_0x4da8('0x3e')),_0x4da8('0x3f'));var _0x5a9e1a=ejs['render'](_0x538152,{'networks':_0x1e5926||[]});fs[_0x4da8('0x41')](_0x4da8('0x42'),_0x5a9e1a);return respondWithRpcPromise(_0x4da8('0x4d'),'update',{'module':_0x4da8('0x43')});}else if(_0x20cf1c['type'][_0x4da8('0x44')]()=='TURN'){var _0x1b408f=fs[_0x4da8('0x46')](path[_0x4da8('0x47')](config[_0x4da8('0x48')],_0x4da8('0x51')),_0x4da8('0x3f'));var _0x5b07ec=ejs['render'](_0x1b408f,{'networks':_0x1e5926||[]});fs[_0x4da8('0x41')]('/etc/asterisk/turn_xcally.conf',_0x5b07ec);return respondWithRpcPromise('Reload',_0x4da8('0x4f'),{'module':_0x4da8('0x43')});}else{var _0x533d2c=fs[_0x4da8('0x46')](path['join'](config['root'],_0x4da8('0x4a')),_0x4da8('0x3f'));var _0x3fa5da=ejs[_0x4da8('0x40')](_0x533d2c,{'networks':_0x1e5926||[]});fs[_0x4da8('0x41')](util['format'](_0x4da8('0x52'),_0x4de054[_0x4da8('0x3d')]['type'][_0x4da8('0x4c')]()),_0x3fa5da);return respondWithRpcPromise(_0x4da8('0x4d'),_0x4da8('0x4f'),{'module':'chan_sip.so'});}})['then'](function(_0x24550a){if(_0x24550a){return _0x20cf1c;}return null;})['then'](respondWithResult(_0x1f36d3,null))[_0x4da8('0x38')](handleError(_0x1f36d3,null));};exports[_0x4da8('0x53')]=function(_0x4f3e44,_0x5af090){var _0xbca028;return db[_0x4da8('0x22')]['find']({'where':{'id':_0x4f3e44[_0x4da8('0x3a')]['id']}})[_0x4da8('0xa')](function(_0x2e8005){_0xbca028=_0x2e8005;return _0x2e8005;})[_0x4da8('0xa')](handleEntityNotFound(_0x5af090,null))['then'](removeEntity(_0x5af090,null))[_0x4da8('0xa')](function(){if(_0xbca028){return db[_0x4da8('0x22')][_0x4da8('0x36')]({'where':{'type':_0xbca028[_0x4da8('0x24')]},'raw':!![]});}})['then'](function(_0x10bb32){if(_0xbca028['type']['toUpperCase']()==_0x4da8('0x54')){var _0x337be4=fs[_0x4da8('0x46')](path['join'](config[_0x4da8('0x48')],_0x4da8('0x3e')),_0x4da8('0x3f'));var _0x3f5c77=ejs[_0x4da8('0x40')](_0x337be4,{'networks':_0x10bb32||[]});fs['writeFileSync'](_0x4da8('0x42'),_0x3f5c77);return respondWithRpcPromise(_0x4da8('0x4d'),_0x4da8('0x53'),{'module':_0x4da8('0x43')});}else if(_0xbca028[_0x4da8('0x24')][_0x4da8('0x44')]()==_0x4da8('0x45')){var _0x1148c5=fs['readFileSync'](path[_0x4da8('0x47')](config[_0x4da8('0x48')],_0x4da8('0x51')),_0x4da8('0x3f'));var _0x434742=ejs['render'](_0x1148c5,{'networks':_0x10bb32||[]});fs['writeFileSync'](_0x4da8('0x49'),_0x434742);return respondWithRpcPromise(_0x4da8('0x4d'),_0x4da8('0x53'),{'module':'res_stun_monitor.so'});}else{var _0x1522af=fs['readFileSync'](path[_0x4da8('0x47')](config[_0x4da8('0x48')],_0x4da8('0x4a')),_0x4da8('0x3f'));var _0x16d730=ejs[_0x4da8('0x40')](_0x1522af,{'networks':_0x10bb32||[]});fs[_0x4da8('0x41')](util[_0x4da8('0x4b')]('/etc/asterisk/sip_xcally_%s.conf',_0xbca028[_0x4da8('0x24')][_0x4da8('0x4c')]()),_0x16d730);return respondWithRpcPromise('Reload','destroy',{'module':_0x4da8('0x4e')});}})[_0x4da8('0x38')](handleError(_0x5af090,null));};
\ No newline at end of file
index 4cdcac1..b125cc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4876=['../../config/environment','./network.attributes','Network','network','../../config/logger','bluebird','path','rimraf'];(function(_0x1f2eeb,_0x11d879){var _0x5145b7=function(_0x2b0b32){while(--_0x2b0b32){_0x1f2eeb['push'](_0x1f2eeb['shift']());}};_0x5145b7(++_0x11d879);}(_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':!![]});};
\ No newline at end of file
+var _0x8ce3=['./network.attributes','Network','network','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x32cf08,_0x4f5c2a){var _0x3013f5=function(_0x42968c){while(--_0x42968c){_0x32cf08['push'](_0x32cf08['shift']());}};_0x3013f5(++_0x4f5c2a);}(_0x8ce3,0xc3));var _0x38ce=function(_0x223461,_0x2bca70){_0x223461=_0x223461-0x0;var _0x4dbe0a=_0x8ce3[_0x223461];return _0x4dbe0a;};'use strict';var _=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var logger=require('../../config/logger')(_0x38ce('0x2'));var moment=require(_0x38ce('0x3'));var BPromise=require(_0x38ce('0x4'));var rp=require(_0x38ce('0x5'));var fs=require('fs');var path=require(_0x38ce('0x6'));var rimraf=require(_0x38ce('0x7'));var config=require(_0x38ce('0x8'));var attributes=require(_0x38ce('0x9'));module['exports']=function(_0x372f86,_0xb24f4c){return _0x372f86['define'](_0x38ce('0xa'),attributes,{'tableName':_0x38ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dea345f..6b6808c 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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x1dd5a7,_0x3769d3){_0x1dd5a7=_0x1dd5a7-0x0;var _0x3a9501=_0x7a54[_0x1dd5a7];return _0x3a9501;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x18273a,_0x3ea521){_0x18273a=_0x18273a-0x0;var _0x2857e1=_0x7a54[_0x18273a];return _0x2857e1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
index 566a0b6..a748630 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2349=['/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','post','addDisposition','/:id/notify','notify','addApplications','/:id/users','addAgents','send','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x1e9136,_0x250381){var _0xb78645=function(_0x5a5f25){while(--_0x5a5f25){_0x1e9136['push'](_0x1e9136['shift']());}};_0xb78645(++_0x250381);}(_0x2349,0x17a));var _0x9234=function(_0x1dad92,_0x2f948c){_0x1dad92=_0x1dad92-0x0;var _0x90a9f6=_0x2349[_0x1dad92];return _0x90a9f6;};'use strict';var multer=require(_0x9234('0x0'));var util=require(_0x9234('0x1'));var path=require(_0x9234('0x2'));var timeout=require(_0x9234('0x3'));var express=require(_0x9234('0x4'));var router=express[_0x9234('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9234('0x6'));var interaction=require(_0x9234('0x7'));var config=require('../../config/environment');var controller=require(_0x9234('0x8'));router['get']('/',auth[_0x9234('0x9')](),controller['index']);router[_0x9234('0xa')](_0x9234('0xb'),auth[_0x9234('0x9')](),controller[_0x9234('0xc')]);router[_0x9234('0xa')](_0x9234('0xd'),auth['isAuthenticated'](),controller[_0x9234('0xe')]);router[_0x9234('0xa')](_0x9234('0xf'),auth['isAuthenticated'](),controller[_0x9234('0x10')]);router[_0x9234('0xa')](_0x9234('0x11'),auth[_0x9234('0x9')](),controller['getAnswers']);router[_0x9234('0xa')](_0x9234('0x12'),auth[_0x9234('0x9')](),controller[_0x9234('0x13')]);router[_0x9234('0xa')](_0x9234('0x14'),auth[_0x9234('0x9')](),controller[_0x9234('0x15')]);router[_0x9234('0xa')]('/:id/users',auth[_0x9234('0x9')](),controller[_0x9234('0x16')]);router[_0x9234('0x17')]('/',auth[_0x9234('0x9')](),controller['create']);router[_0x9234('0x17')](_0x9234('0xf'),auth[_0x9234('0x9')](),controller[_0x9234('0x18')]);router[_0x9234('0x17')](_0x9234('0x11'),auth[_0x9234('0x9')](),controller['addAnswer']);router[_0x9234('0x17')](_0x9234('0x19'),controller[_0x9234('0x1a')]);router[_0x9234('0x17')](_0x9234('0x12'),auth[_0x9234('0x9')](),controller[_0x9234('0x1b')]);router[_0x9234('0x17')](_0x9234('0x1c'),auth['isAuthenticated'](),controller[_0x9234('0x1d')]);router['post']('/:id/send',auth[_0x9234('0x9')](),controller[_0x9234('0x1e')]);router[_0x9234('0x1f')](_0x9234('0xd'),auth[_0x9234('0x9')](),controller[_0x9234('0x20')]);router[_0x9234('0x21')](_0x9234('0xd'),auth[_0x9234('0x9')](),controller[_0x9234('0x22')]);router[_0x9234('0x21')](_0x9234('0xf'),auth[_0x9234('0x9')](),controller['removeDispositions']);router[_0x9234('0x21')](_0x9234('0x11'),auth[_0x9234('0x9')](),controller['removeAnswers']);router['delete'](_0x9234('0x1c'),auth[_0x9234('0x9')](),controller['removeAgents']);module[_0x9234('0x23')]=router;
\ No newline at end of file
+var _0xa85a=['getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','notify','addApplications','addAgents','/:id/send','send','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x11155f,_0x57b687){var _0xd07e48=function(_0x592615){while(--_0x592615){_0x11155f['push'](_0x11155f['shift']());}};_0xd07e48(++_0x57b687);}(_0xa85a,0x1ec));var _0xaa85=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xa85a[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require(_0xaa85('0x0'));var util=require(_0xaa85('0x1'));var path=require(_0xaa85('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaa85('0x3')]();var fs_extra=require(_0xaa85('0x4'));var auth=require(_0xaa85('0x5'));var interaction=require(_0xaa85('0x6'));var config=require(_0xaa85('0x7'));var controller=require(_0xaa85('0x8'));router[_0xaa85('0x9')]('/',auth[_0xaa85('0xa')](),controller[_0xaa85('0xb')]);router[_0xaa85('0x9')](_0xaa85('0xc'),auth[_0xaa85('0xa')](),controller[_0xaa85('0xd')]);router[_0xaa85('0x9')](_0xaa85('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xaa85('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xaa85('0xf')]);router[_0xaa85('0x9')](_0xaa85('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0xaa85('0x11'),auth[_0xaa85('0xa')](),controller[_0xaa85('0x12')]);router[_0xaa85('0x9')]('/:id/interactions',auth[_0xaa85('0xa')](),controller['getInteractions']);router[_0xaa85('0x9')](_0xaa85('0x13'),auth[_0xaa85('0xa')](),controller[_0xaa85('0x14')]);router[_0xaa85('0x15')]('/',auth[_0xaa85('0xa')](),controller[_0xaa85('0x16')]);router['post'](_0xaa85('0x17'),auth[_0xaa85('0xa')](),controller[_0xaa85('0x18')]);router['post'](_0xaa85('0x10'),auth[_0xaa85('0xa')](),controller[_0xaa85('0x19')]);router[_0xaa85('0x15')]('/:id/notify',controller[_0xaa85('0x1a')]);router[_0xaa85('0x15')]('/:id/applications',auth['isAuthenticated'](),controller[_0xaa85('0x1b')]);router[_0xaa85('0x15')](_0xaa85('0x13'),auth[_0xaa85('0xa')](),controller[_0xaa85('0x1c')]);router[_0xaa85('0x15')](_0xaa85('0x1d'),auth['isAuthenticated'](),controller[_0xaa85('0x1e')]);router[_0xaa85('0x1f')]('/:id',auth[_0xaa85('0xa')](),controller[_0xaa85('0x20')]);router['delete'](_0xaa85('0xe'),auth[_0xaa85('0xa')](),controller[_0xaa85('0x21')]);router[_0xaa85('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xaa85('0x23')]);router[_0xaa85('0x22')](_0xaa85('0x10'),auth['isAuthenticated'](),controller[_0xaa85('0x24')]);router[_0xaa85('0x22')](_0xaa85('0x13'),auth['isAuthenticated'](),controller[_0xaa85('0x25')]);module[_0xaa85('0x26')]=router;
\ No newline at end of file
index 1251ccf..8d401cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x383b=['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','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT'];(function(_0xf1f015,_0x1cc594){var _0x48a310=function(_0x444712){while(--_0x444712){_0xf1f015['push'](_0xf1f015['shift']());}};_0x48a310(++_0x1cc594);}(_0x383b,0x12d));var _0xb383=function(_0x1c44d7,_0x21dafd){_0x1c44d7=_0x1c44d7-0x0;var _0xc485e5=_0x383b[_0x1c44d7];return _0xc485e5;};'use strict';var Sequelize=require(_0xb383('0x0'));var rs=require(_0xb383('0x1'));module[_0xb383('0x2')]={'name':{'type':Sequelize[_0xb383('0x3')],'unique':_0xb383('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xb383('0x3')]},'token':{'type':Sequelize[_0xb383('0x3')],'defaultValue':function(){return rs[_0xb383('0x5')]();}},'replyUri':{'type':Sequelize[_0xb383('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xb383('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb383('0x6')],'defaultValue':function(){return _0xb383('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb383('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb383('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb383('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb383('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb383('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0xb383('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xb383('0x8')],'defaultValue':![],'comment':_0xb383('0xb'),'set':function(_0x1eaf2c){if(!_0x1eaf2c)this[_0xb383('0xc')]('mandatoryDispositionPauseId',null);this[_0xb383('0xc')](_0xb383('0xd'),_0x1eaf2c);}}};
\ No newline at end of file
+var _0xb45f=['setDataValue','mandatoryDispositionPauseId','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x1bd9d4,_0xef182c){var _0x691c4d=function(_0x4056f6){while(--_0x4056f6){_0x1bd9d4['push'](_0x1bd9d4['shift']());}};_0x691c4d(++_0xef182c);}(_0xb45f,0x86));var _0xfb45=function(_0x24d4ce,_0x3b7658){_0x24d4ce=_0x24d4ce-0x0;var _0x335e42=_0xb45f[_0x24d4ce];return _0x335e42;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xfb45('0x0'));module[_0xfb45('0x1')]={'name':{'type':Sequelize[_0xfb45('0x2')],'unique':_0xfb45('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xfb45('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xfb45('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfb45('0x5')],'defaultValue':function(){return _0xfb45('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfb45('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xfb45('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfb45('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xfb45('0x8')],'defaultValue':![],'comment':_0xfb45('0x9'),'set':function(_0x18fdf6){if(!_0x18fdf6)this[_0xfb45('0xa')](_0xfb45('0xb'),null);this[_0xfb45('0xa')]('mandatoryDisposition',_0x18fdf6);}}};
\ No newline at end of file
index 493f32d..91c1f48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe181=['merge','map','options','includeAll','include','findAll','catch','show','params','fields','create','user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','mandatoryDispositionPause','describe','OpenchannelAccountId','Disposition','getDispositions','nolimit','pick','rows','removeDispositions','CannedAnswer','findOne','length','removeAnswers','ids','notify','CmContact','ValidationError','updatedAt','difference','createdAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','applications','orderBy','priority','asc','account','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','lastName','messageId','interaction','created','close','unmanaged','OpenchannelMessage','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','Contact','Owner','internal','Tag','color','tag','addAgents','omit','spread','emit','removeAgents','getAgents','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','update','destroy','get','OpenchannelAccounts','UserProfileResource','name','send','index','Pause','OpenchannelAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','hasOwnProperty','limit','order','sort','where','filter'];(function(_0x4876ea,_0xa5003e){var _0x1ea8ba=function(_0x28d2b1){while(--_0x28d2b1){_0x4876ea['push'](_0x4876ea['shift']());}};_0x1ea8ba(++_0xa5003e);}(_0xe181,0x68));var _0x1e18=function(_0x1a0620,_0x4f40c3){_0x1a0620=_0x1a0620-0x0;var _0x475abc=_0xe181[_0x1a0620];return _0x475abc;};'use strict';var emlformat=require(_0x1e18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e18('0x1'));var jsonpatch=require(_0x1e18('0x2'));var rp=require(_0x1e18('0x3'));var moment=require(_0x1e18('0x4'));var BPromise=require(_0x1e18('0x5'));var Mustache=require(_0x1e18('0x6'));var util=require(_0x1e18('0x7'));var path=require('path');var sox=require(_0x1e18('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e18('0x9'));var _=require(_0x1e18('0xa'));var squel=require(_0x1e18('0xb'));var crypto=require(_0x1e18('0xc'));var jsforce=require(_0x1e18('0xd'));var deskjs=require(_0x1e18('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1e18('0xf'));var Papa=require(_0x1e18('0x10'));var Redis=require(_0x1e18('0x11'));var authService=require(_0x1e18('0x12'));var qs=require(_0x1e18('0x13'));var as=require(_0x1e18('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e18('0x15'))(_0x1e18('0x16'));var utils=require(_0x1e18('0x17'));var config=require(_0x1e18('0x18'));var licenseUtil=require(_0x1e18('0x19'));var db=require(_0x1e18('0x1a'))['db'];config[_0x1e18('0x1b')]=_[_0x1e18('0x1c')](config['redis'],{'host':_0x1e18('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1e18('0x1b')]));require('./openchannelAccount.socket')[_0x1e18('0x1e')](socket);var jayson=require(_0x1e18('0x1f'));var client=jayson[_0x1e18('0x20')][_0x1e18('0x21')]({'port':0x232c});var client9002=jayson[_0x1e18('0x20')][_0x1e18('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x39bc56,_0x33fea1,_0x134863,_0x3f5f61){return new BPromise(function(_0x12ef98,_0x3490d2){var _0x349f3c=_0x3f5f61||client;return _0x349f3c[_0x1e18('0x22')](_0x39bc56,_0x134863)[_0x1e18('0x23')](function(_0x5b2888){logger[_0x1e18('0x24')](_0x1e18('0x25'),_0x33fea1,_0x1e18('0x26'));logger[_0x1e18('0x27')](_0x1e18('0x28'),_0x33fea1,_0x1e18('0x26'),JSON[_0x1e18('0x29')](_0x5b2888));if(_0x5b2888[_0x1e18('0x2a')]){if(_0x5b2888[_0x1e18('0x2a')][_0x1e18('0x2b')]===0x1f4){logger[_0x1e18('0x2a')](_0x1e18('0x25'),_0x33fea1,_0x5b2888[_0x1e18('0x2a')][_0x1e18('0x2c')]);return _0x3490d2(_0x5b2888[_0x1e18('0x2a')][_0x1e18('0x2c')]);}logger[_0x1e18('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x33fea1,_0x5b2888[_0x1e18('0x2a')][_0x1e18('0x2c')]);return _0x12ef98(_0x5b2888[_0x1e18('0x2a')]['message']);}else{logger[_0x1e18('0x24')](_0x1e18('0x25'),_0x33fea1,_0x1e18('0x26'));_0x12ef98(_0x5b2888[_0x1e18('0x2d')]['message']);}})['catch'](function(_0x6fa4db){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x33fea1,_0x6fa4db);_0x3490d2(_0x6fa4db);});});}function respondWithStatusCode(_0x587906,_0x32a196){_0x32a196=_0x32a196||0xcc;return function(_0x29cac0){if(_0x29cac0){return _0x587906[_0x1e18('0x2e')](_0x32a196);}return _0x587906[_0x1e18('0x2f')](_0x32a196)[_0x1e18('0x30')]();};}function respondWithResult(_0x38fca8,_0x167f67){_0x167f67=_0x167f67||0xc8;return function(_0x149cb6){if(_0x149cb6){return _0x38fca8[_0x1e18('0x2f')](_0x167f67)[_0x1e18('0x31')](_0x149cb6);}};}function respondWithFilteredResult(_0x1015a3,_0x42c638){return function(_0x40d0af){if(_0x40d0af){var _0x1be225=typeof _0x42c638['offset']===_0x1e18('0x32')&&typeof _0x42c638['limit']===_0x1e18('0x32');var _0x1baf4f=_0x40d0af[_0x1e18('0x33')];var _0x230bb1=_0x1be225?0x0:_0x42c638[_0x1e18('0x34')];var _0x93dd11=_0x1be225?_0x40d0af[_0x1e18('0x33')]:_0x42c638[_0x1e18('0x34')]+_0x42c638['limit'];var _0x27fdf7;if(_0x93dd11>=_0x1baf4f){_0x93dd11=_0x1baf4f;_0x27fdf7=0xc8;}else{_0x27fdf7=0xce;}_0x1015a3[_0x1e18('0x2f')](_0x27fdf7);return _0x1015a3['set'](_0x1e18('0x35'),_0x230bb1+'-'+_0x93dd11+'/'+_0x1baf4f)[_0x1e18('0x31')](_0x40d0af);}return null;};}function patchUpdates(_0x415d7b){return function(_0x4cf595){try{jsonpatch[_0x1e18('0x36')](_0x4cf595,_0x415d7b,!![]);}catch(_0x5597ab){return BPromise['reject'](_0x5597ab);}return _0x4cf595['save']();};}function saveUpdates(_0xa4fe9e,_0x48b89f){return function(_0x2a1fd1){if(_0x2a1fd1){return _0x2a1fd1[_0x1e18('0x37')](_0xa4fe9e)[_0x1e18('0x23')](function(_0x5c7d0f){return _0x5c7d0f;});}return null;};}function removeEntity(_0x4a569d,_0x2dd8ad){return function(_0x3a7779){if(_0x3a7779){return _0x3a7779[_0x1e18('0x38')]()[_0x1e18('0x23')](function(){var _0x28ef51=_0x3a7779[_0x1e18('0x39')]({'plain':!![]});var _0x215fef=_0x1e18('0x3a');return db[_0x1e18('0x3b')][_0x1e18('0x38')]({'where':{'type':_0x215fef,'resourceId':_0x28ef51['id']}})[_0x1e18('0x23')](function(){return _0x3a7779;});})[_0x1e18('0x23')](function(){_0x4a569d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a007e,_0x267213){return function(_0x34dfe4){if(!_0x34dfe4){_0x3a007e['sendStatus'](0x194);}return _0x34dfe4;};}function handleError(_0xb76b49,_0x49e7e6){_0x49e7e6=_0x49e7e6||0x1f4;return function(_0x743201){logger['error'](_0x743201['stack']);if(_0x743201[_0x1e18('0x3c')]){delete _0x743201[_0x1e18('0x3c')];}_0xb76b49[_0x1e18('0x2f')](_0x49e7e6)[_0x1e18('0x3d')](_0x743201);};}exports[_0x1e18('0x3e')]=function(_0x39e504,_0x4e2ca3){var _0x2f228f={'include':[{'model':db[_0x1e18('0x3f')],'as':'mandatoryDispositionPause'}]},_0x2066c1={},_0x395868={'count':0x0,'rows':[]};var _0x11f839=_['map'](db[_0x1e18('0x40')][_0x1e18('0x41')],function(_0x5a2d85){return{'name':_0x5a2d85[_0x1e18('0x42')],'type':_0x5a2d85[_0x1e18('0x43')]['key']};});_0x2066c1['model']=_['map'](_0x11f839,_0x1e18('0x3c'));_0x2066c1[_0x1e18('0x44')]=_[_0x1e18('0x45')](_0x39e504[_0x1e18('0x44')]);_0x2066c1[_0x1e18('0x46')]=_[_0x1e18('0x47')](_0x2066c1[_0x1e18('0x48')],_0x2066c1[_0x1e18('0x44')]);_0x2f228f[_0x1e18('0x49')]=_[_0x1e18('0x47')](_0x2066c1[_0x1e18('0x48')],qs['fields'](_0x39e504[_0x1e18('0x44')]['fields']));_0x2f228f[_0x1e18('0x49')]=_0x2f228f[_0x1e18('0x49')]['length']?_0x2f228f['attributes']:_0x2066c1['model'];if(!_0x39e504[_0x1e18('0x44')][_0x1e18('0x4a')]('nolimit')){_0x2f228f[_0x1e18('0x4b')]=qs[_0x1e18('0x4b')](_0x39e504['query']['limit']);_0x2f228f[_0x1e18('0x34')]=qs[_0x1e18('0x34')](_0x39e504[_0x1e18('0x44')][_0x1e18('0x34')]);}_0x2f228f[_0x1e18('0x4c')]=qs[_0x1e18('0x4d')](_0x39e504[_0x1e18('0x44')][_0x1e18('0x4d')]);_0x2f228f[_0x1e18('0x4e')]=qs[_0x1e18('0x46')](_['pick'](_0x39e504['query'],_0x2066c1[_0x1e18('0x46')]),_0x11f839);if(_0x39e504[_0x1e18('0x44')][_0x1e18('0x4f')]){_0x2f228f[_0x1e18('0x4e')]=_[_0x1e18('0x50')](_0x2f228f[_0x1e18('0x4e')],{'$or':_[_0x1e18('0x51')](_0x11f839,function(_0x5291e2){if(_0x5291e2['type']!=='VIRTUAL'){var _0x3110d7={};_0x3110d7[_0x5291e2[_0x1e18('0x3c')]]={'$like':'%'+_0x39e504[_0x1e18('0x44')][_0x1e18('0x4f')]+'%'};return _0x3110d7;}})});}_0x2f228f=_[_0x1e18('0x50')]({},_0x2f228f,_0x39e504[_0x1e18('0x52')]);var _0x191c18={'where':_0x2f228f[_0x1e18('0x4e')]};return db[_0x1e18('0x40')][_0x1e18('0x33')](_0x191c18)[_0x1e18('0x23')](function(_0x8a0a9d){_0x395868[_0x1e18('0x33')]=_0x8a0a9d;if(_0x39e504[_0x1e18('0x44')][_0x1e18('0x53')]){_0x2f228f[_0x1e18('0x54')]=[{'all':!![]}];}return db[_0x1e18('0x40')][_0x1e18('0x55')](_0x2f228f);})[_0x1e18('0x23')](function(_0x11d573){_0x395868['rows']=_0x11d573;return _0x395868;})[_0x1e18('0x23')](respondWithFilteredResult(_0x4e2ca3,_0x2f228f))[_0x1e18('0x56')](handleError(_0x4e2ca3,null));};exports[_0x1e18('0x57')]=function(_0x24ad42,_0x16ef59){var _0x5c1062={'raw':![],'where':{'id':_0x24ad42[_0x1e18('0x58')]['id']},'include':[{'model':db[_0x1e18('0x3f')],'as':'mandatoryDispositionPause'}]},_0x4d2c96={};_0x4d2c96[_0x1e18('0x48')]=_[_0x1e18('0x45')](db[_0x1e18('0x40')]['rawAttributes']);_0x4d2c96[_0x1e18('0x44')]=_[_0x1e18('0x45')](_0x24ad42[_0x1e18('0x44')]);_0x4d2c96[_0x1e18('0x46')]=_[_0x1e18('0x47')](_0x4d2c96['model'],_0x4d2c96[_0x1e18('0x44')]);_0x5c1062['attributes']=_['intersection'](_0x4d2c96[_0x1e18('0x48')],qs[_0x1e18('0x59')](_0x24ad42[_0x1e18('0x44')][_0x1e18('0x59')]));_0x5c1062[_0x1e18('0x49')]=_0x5c1062[_0x1e18('0x49')]['length']?_0x5c1062[_0x1e18('0x49')]:_0x4d2c96[_0x1e18('0x48')];if(_0x24ad42[_0x1e18('0x44')]['includeAll']){_0x5c1062[_0x1e18('0x54')]=[{'all':!![]}];}_0x5c1062=_[_0x1e18('0x50')]({},_0x5c1062,_0x24ad42['options']);return db[_0x1e18('0x40')]['find'](_0x5c1062)[_0x1e18('0x23')](handleEntityNotFound(_0x16ef59,null))[_0x1e18('0x23')](respondWithResult(_0x16ef59,null))[_0x1e18('0x56')](handleError(_0x16ef59,null));};exports[_0x1e18('0x5a')]=function(_0x127af3,_0x31f349){return db[_0x1e18('0x40')][_0x1e18('0x5a')](_0x127af3['body'],{})[_0x1e18('0x23')](function(_0x3baa8d){var _0x5a5881=_0x127af3[_0x1e18('0x5b')]['get']({'plain':!![]});if(!_0x5a5881)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a5881[_0x1e18('0x5c')]===_0x1e18('0x5b')){var _0x426a33=_0x3baa8d[_0x1e18('0x39')]({'plain':!![]});var _0x5eb803=_0x1e18('0x3a');return db[_0x1e18('0x5d')][_0x1e18('0x5e')]({'where':{'name':_0x5eb803,'userProfileId':_0x5a5881['userProfileId']},'raw':!![]})['then'](function(_0x19590a){if(_0x19590a&&_0x19590a['autoAssociation']===0x0){return db['UserProfileResource'][_0x1e18('0x5a')]({'name':_0x426a33[_0x1e18('0x3c')],'resourceId':_0x426a33['id'],'type':_0x19590a[_0x1e18('0x3c')],'sectionId':_0x19590a['id']},{})[_0x1e18('0x23')](function(){return _0x3baa8d;});}else{return _0x3baa8d;}})[_0x1e18('0x56')](function(_0x22495c){logger[_0x1e18('0x2a')](_0x1e18('0x5f'),_0x22495c);throw _0x22495c;});}return _0x3baa8d;})[_0x1e18('0x23')](respondWithResult(_0x31f349,0xc9))[_0x1e18('0x56')](handleError(_0x31f349,null));};exports[_0x1e18('0x37')]=function(_0x461899,_0x3d9d6e){if(_0x461899[_0x1e18('0x60')]['id']){delete _0x461899[_0x1e18('0x60')]['id'];}return db[_0x1e18('0x40')]['find']({'where':{'id':_0x461899[_0x1e18('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x1e18('0x61')}]})[_0x1e18('0x23')](handleEntityNotFound(_0x3d9d6e,null))[_0x1e18('0x23')](saveUpdates(_0x461899[_0x1e18('0x60')],null))['then'](respondWithResult(_0x3d9d6e,null))[_0x1e18('0x56')](handleError(_0x3d9d6e,null));};exports['destroy']=function(_0x57a472,_0x59c6e6){return db['OpenchannelAccount'][_0x1e18('0x5e')]({'where':{'id':_0x57a472[_0x1e18('0x58')]['id']}})[_0x1e18('0x23')](handleEntityNotFound(_0x59c6e6,null))[_0x1e18('0x23')](removeEntity(_0x59c6e6,null))[_0x1e18('0x56')](handleError(_0x59c6e6,null));};exports[_0x1e18('0x62')]=function(_0x359b0c,_0x5aee35){return db[_0x1e18('0x40')][_0x1e18('0x62')]()[_0x1e18('0x23')](respondWithResult(_0x5aee35,null))['catch'](handleError(_0x5aee35,null));};exports['addDisposition']=function(_0x594f1e,_0x8f19f6,_0x6f623a){if(_0x594f1e[_0x1e18('0x60')]['id']){delete _0x594f1e['body']['id'];}return db[_0x1e18('0x40')][_0x1e18('0x5e')]({'where':{'id':_0x594f1e[_0x1e18('0x58')]['id']}})[_0x1e18('0x23')](handleEntityNotFound(_0x8f19f6,null))['then'](function(_0x60c240){if(_0x60c240){_0x594f1e['body'][_0x1e18('0x63')]=_0x60c240['id'];return db[_0x1e18('0x64')]['create'](_0x594f1e[_0x1e18('0x60')]);}})[_0x1e18('0x23')](respondWithResult(_0x8f19f6,null))[_0x1e18('0x56')](handleError(_0x8f19f6,null));};exports[_0x1e18('0x65')]=function(_0x3a3430,_0x22d89c,_0x20e353){var _0x20fd79={'raw':![],'where':{}};var _0xcdcdb1={};var _0x3f4c9f={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3a3430[_0x1e18('0x58')]['id']}})['then'](handleEntityNotFound(_0x22d89c,null))['then'](function(_0x3bc0f9){if(_0x3bc0f9){_0xcdcdb1[_0x1e18('0x48')]=_[_0x1e18('0x45')](db[_0x1e18('0x64')][_0x1e18('0x41')]);_0xcdcdb1['query']=_[_0x1e18('0x45')](_0x3a3430[_0x1e18('0x44')]);_0xcdcdb1[_0x1e18('0x46')]=_['intersection'](_0xcdcdb1[_0x1e18('0x48')],_0xcdcdb1[_0x1e18('0x44')]);_0x20fd79[_0x1e18('0x49')]=_[_0x1e18('0x47')](_0xcdcdb1[_0x1e18('0x48')],qs['fields'](_0x3a3430[_0x1e18('0x44')][_0x1e18('0x59')]));_0x20fd79[_0x1e18('0x49')]=_0x20fd79[_0x1e18('0x49')]['length']?_0x20fd79[_0x1e18('0x49')]:_0xcdcdb1[_0x1e18('0x48')];if(!_0x3a3430[_0x1e18('0x44')][_0x1e18('0x4a')](_0x1e18('0x66'))){_0x20fd79[_0x1e18('0x4b')]=qs[_0x1e18('0x4b')](_0x3a3430[_0x1e18('0x44')][_0x1e18('0x4b')]);_0x20fd79['offset']=qs[_0x1e18('0x34')](_0x3a3430[_0x1e18('0x44')][_0x1e18('0x34')]);}_0x20fd79['order']=qs[_0x1e18('0x4d')](_0x3a3430[_0x1e18('0x44')]['sort']);_0x20fd79[_0x1e18('0x4e')]=qs['filters'](_[_0x1e18('0x67')](_0x3a3430['query'],_0xcdcdb1[_0x1e18('0x46')]));_0x20fd79[_0x1e18('0x4e')][_0x1e18('0x63')]=_0x3bc0f9['id'];if(_0x3a3430['query'][_0x1e18('0x4f')]){_0x20fd79[_0x1e18('0x4e')]=_[_0x1e18('0x50')](_0x20fd79['where'],{'$or':_[_0x1e18('0x51')](_0x20fd79[_0x1e18('0x49')],function(_0x1d2ea7){var _0x40e300={};_0x40e300[_0x1d2ea7]={'$like':'%'+_0x3a3430[_0x1e18('0x44')][_0x1e18('0x4f')]+'%'};return _0x40e300;})});}_0x20fd79=_['merge']({},_0x20fd79,_0x3a3430[_0x1e18('0x52')]);return db[_0x1e18('0x64')][_0x1e18('0x33')]({'where':_0x20fd79[_0x1e18('0x4e')]})[_0x1e18('0x23')](function(_0x3162df){_0x3f4c9f[_0x1e18('0x33')]=_0x3162df;if(_0x3a3430[_0x1e18('0x44')][_0x1e18('0x53')]){_0x20fd79[_0x1e18('0x54')]=[{'all':!![]}];}return db[_0x1e18('0x64')][_0x1e18('0x55')](_0x20fd79);})[_0x1e18('0x23')](function(_0x581916){_0x3f4c9f[_0x1e18('0x68')]=_0x581916;return _0x3f4c9f;});}})[_0x1e18('0x23')](respondWithFilteredResult(_0x22d89c,_0x20fd79))[_0x1e18('0x56')](handleError(_0x22d89c,null));};exports[_0x1e18('0x69')]=function(_0x3c4670,_0x36959a,_0x1fe13f){return db[_0x1e18('0x40')][_0x1e18('0x5e')]({'where':{'id':_0x3c4670[_0x1e18('0x58')]['id']}})[_0x1e18('0x23')](handleEntityNotFound(_0x36959a,null))[_0x1e18('0x23')](function(_0x56baf1){if(_0x56baf1){return _0x56baf1[_0x1e18('0x69')](_0x3c4670[_0x1e18('0x44')]['ids']);}})[_0x1e18('0x23')](respondWithStatusCode(_0x36959a,null))[_0x1e18('0x56')](handleError(_0x36959a,null));};exports['addAnswer']=function(_0xba1f32,_0x441245,_0x31c79a){if(_0xba1f32['body']['id']){delete _0xba1f32[_0x1e18('0x60')]['id'];}return db[_0x1e18('0x40')][_0x1e18('0x5e')]({'where':{'id':_0xba1f32[_0x1e18('0x58')]['id']}})[_0x1e18('0x23')](handleEntityNotFound(_0x441245,null))[_0x1e18('0x23')](function(_0x2ea332){if(_0x2ea332){_0xba1f32[_0x1e18('0x60')][_0x1e18('0x63')]=_0x2ea332['id'];return db[_0x1e18('0x6a')][_0x1e18('0x5a')](_0xba1f32[_0x1e18('0x60')]);}})[_0x1e18('0x23')](respondWithResult(_0x441245,null))[_0x1e18('0x56')](handleError(_0x441245,null));};exports['getAnswers']=function(_0x42d1da,_0x4b5fcb,_0x23d720){var _0x2df948={'raw':![],'where':{}};var _0x2fb8b6={};var _0x55924b={'count':0x0,'rows':[]};return db[_0x1e18('0x40')][_0x1e18('0x6b')]({'where':{'id':_0x42d1da[_0x1e18('0x58')]['id']}})[_0x1e18('0x23')](handleEntityNotFound(_0x4b5fcb,null))[_0x1e18('0x23')](function(_0x5082d0){if(_0x5082d0){_0x2fb8b6[_0x1e18('0x48')]=_[_0x1e18('0x45')](db[_0x1e18('0x6a')][_0x1e18('0x41')]);_0x2fb8b6['query']=_[_0x1e18('0x45')](_0x42d1da['query']);_0x2fb8b6[_0x1e18('0x46')]=_[_0x1e18('0x47')](_0x2fb8b6[_0x1e18('0x48')],_0x2fb8b6[_0x1e18('0x44')]);_0x2df948['attributes']=_['intersection'](_0x2fb8b6['model'],qs['fields'](_0x42d1da[_0x1e18('0x44')][_0x1e18('0x59')]));_0x2df948[_0x1e18('0x49')]=_0x2df948['attributes'][_0x1e18('0x6c')]?_0x2df948['attributes']:_0x2fb8b6['model'];if(!_0x42d1da['query'][_0x1e18('0x4a')]('nolimit')){_0x2df948['limit']=qs[_0x1e18('0x4b')](_0x42d1da[_0x1e18('0x44')][_0x1e18('0x4b')]);_0x2df948[_0x1e18('0x34')]=qs[_0x1e18('0x34')](_0x42d1da[_0x1e18('0x44')][_0x1e18('0x34')]);}_0x2df948[_0x1e18('0x4c')]=qs['sort'](_0x42d1da[_0x1e18('0x44')][_0x1e18('0x4d')]);_0x2df948[_0x1e18('0x4e')]=qs[_0x1e18('0x46')](_[_0x1e18('0x67')](_0x42d1da[_0x1e18('0x44')],_0x2fb8b6['filters']));_0x2df948[_0x1e18('0x4e')][_0x1e18('0x63')]=_0x5082d0['id'];if(_0x42d1da[_0x1e18('0x44')][_0x1e18('0x4f')]){_0x2df948[_0x1e18('0x4e')]=_[_0x1e18('0x50')](_0x2df948[_0x1e18('0x4e')],{'$or':_[_0x1e18('0x51')](_0x2df948[_0x1e18('0x49')],function(_0x3e0e5b){var _0x31d491={};_0x31d491[_0x3e0e5b]={'$like':'%'+_0x42d1da[_0x1e18('0x44')]['filter']+'%'};return _0x31d491;})});}_0x2df948=_['merge']({},_0x2df948,_0x42d1da[_0x1e18('0x52')]);return db[_0x1e18('0x6a')][_0x1e18('0x33')]({'where':_0x2df948[_0x1e18('0x4e')]})[_0x1e18('0x23')](function(_0x37c960){_0x55924b[_0x1e18('0x33')]=_0x37c960;if(_0x42d1da[_0x1e18('0x44')][_0x1e18('0x53')]){_0x2df948[_0x1e18('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1e18('0x55')](_0x2df948);})[_0x1e18('0x23')](function(_0x445a7c){_0x55924b[_0x1e18('0x68')]=_0x445a7c;return _0x55924b;});}})[_0x1e18('0x23')](respondWithFilteredResult(_0x4b5fcb,_0x2df948))[_0x1e18('0x56')](handleError(_0x4b5fcb,null));};exports[_0x1e18('0x6d')]=function(_0x2fe625,_0x3372ad,_0x284d1c){return db[_0x1e18('0x40')][_0x1e18('0x5e')]({'where':{'id':_0x2fe625[_0x1e18('0x58')]['id']}})[_0x1e18('0x23')](handleEntityNotFound(_0x3372ad,null))[_0x1e18('0x23')](function(_0x3e21ce){if(_0x3e21ce){return _0x3e21ce[_0x1e18('0x6d')](_0x2fe625[_0x1e18('0x44')][_0x1e18('0x6e')]);}})[_0x1e18('0x23')](respondWithStatusCode(_0x3372ad,null))['catch'](handleError(_0x3372ad,null));};exports[_0x1e18('0x6f')]=function(_0x15bb32,_0x49ee04,_0x3b6d5c){var _0x111500={'body':_0x15bb32[_0x1e18('0x60')],'channel':'openchannel'};var _0x449222=[];var _0x5b9c49=[];var _0x26828f={};var _0x5d91c6=![];return db[_0x1e18('0x70')]['describe']()[_0x1e18('0x23')](function(_0x14879c){if(!_0x14879c){throw new db['Sequelize'][(_0x1e18('0x71'))]('no\x20available\x20attributes');}_0x449222=_['difference'](_[_0x1e18('0x45')](_0x14879c),['createdAt',_0x1e18('0x72')]);_0x5b9c49=_[_0x1e18('0x73')](_[_0x1e18('0x45')](_0x14879c),[_0x1e18('0x74'),_0x1e18('0x72'),_0x1e18('0x75'),_0x1e18('0x76')]);if(_0x15bb32[_0x1e18('0x60')]['id']){delete _0x15bb32[_0x1e18('0x60')]['id'];}if(_[_0x1e18('0x77')](_0x15bb32[_0x1e18('0x60')][_0x1e18('0x78')])){throw new db[(_0x1e18('0x79'))][(_0x1e18('0x71'))](_0x1e18('0x7a'));}if(_[_0x1e18('0x77')](_0x15bb32['body']['body'])||_0x15bb32[_0x1e18('0x60')][_0x1e18('0x60')]===''){throw new db[(_0x1e18('0x79'))][(_0x1e18('0x71'))](_0x1e18('0x7b'));}if(_[_0x1e18('0x77')](_0x15bb32[_0x1e18('0x60')][_0x1e18('0x7c')])){throw new db[(_0x1e18('0x79'))][(_0x1e18('0x71'))](_0x1e18('0x7d')+_0x5b9c49);}if(!_[_0x1e18('0x7e')](_0x5b9c49,_0x15bb32['body'][_0x1e18('0x7c')])){throw new db['Sequelize'][(_0x1e18('0x71'))](_0x1e18('0x7f')+_0x5b9c49);}_0x26828f[_0x15bb32['body'][_0x1e18('0x7c')]]=_0x15bb32[_0x1e18('0x60')][_0x1e18('0x78')];})['then'](function(){return db[_0x1e18('0x40')][_0x1e18('0x5e')]({'where':{'id':_0x15bb32[_0x1e18('0x58')]['id']},'include':[{'model':db[_0x1e18('0x80')],'as':_0x1e18('0x81'),'include':[{'model':db[_0x1e18('0x70')],'as':_0x1e18('0x82'),'where':_0x26828f,'limit':0x1,'order':[[_0x1e18('0x72'),_0x1e18('0x83')]]}]},{'model':db[_0x1e18('0x84')],'as':_0x1e18('0x85')}]});})[_0x1e18('0x23')](handleEntityNotFound(_0x49ee04,null))[_0x1e18('0x23')](function(_0x581f62){if(_0x581f62&&_0x581f62[_0x1e18('0x81')]){_0x111500['account']=_0x581f62;_0x111500[_0x1e18('0x86')]=_0x581f62['Applications'];_0x111500['list']=_0x581f62[_0x1e18('0x81')];_0x111500[_0x1e18('0x86')]=_[_0x1e18('0x87')](_0x111500[_0x1e18('0x86')],[_0x1e18('0x88')],[_0x1e18('0x89')]);if(_0x111500[_0x1e18('0x8a')]['Applications']){delete _0x111500['account'][_0x1e18('0x85')];}if(_0x111500[_0x1e18('0x8a')][_0x1e18('0x81')]&&_0x111500[_0x1e18('0x8a')][_0x1e18('0x81')][_0x1e18('0x82')][_0x1e18('0x6c')]){return _0x111500[_0x1e18('0x8a')][_0x1e18('0x81')][_0x1e18('0x82')][0x0];}var _0x34d636=_[_0x1e18('0x1c')](_0x15bb32[_0x1e18('0x60')],{'firstName':_0x15bb32['body'][_0x1e18('0x78')],'ListId':_0x581f62[_0x1e18('0x76')]});_0x34d636[_0x15bb32[_0x1e18('0x60')]['mapKey']]=_0x15bb32['body'][_0x1e18('0x78')];return db['CmContact'][_0x1e18('0x5a')](_0x34d636,{'fields':_0x449222,'raw':!![]});}})[_0x1e18('0x23')](handleEntityNotFound(_0x49ee04,null))[_0x1e18('0x23')](function(_0x1dd8d7){_0x111500[_0x1e18('0x8b')]=_0x1dd8d7;if(_0x1dd8d7){var _0x52f953={'ContactId':_0x1dd8d7['id'],'OpenchannelAccountId':_0x15bb32[_0x1e18('0x58')]['id'],'from':(_0x1dd8d7[_0x1e18('0x8c')]||'')+'\x20'+(_0x1dd8d7['lastName']||'')};var _0x1d0918={'OpenchannelAccountId':_0x15bb32[_0x1e18('0x58')]['id'],'closed':![]};if(_0x15bb32[_0x1e18('0x60')][_0x1e18('0x8d')]){_0x1d0918['threadId']=_0x15bb32[_0x1e18('0x60')][_0x1e18('0x8d')];return db[_0x1e18('0x8e')][_0x1e18('0x5e')]({'where':_0x1d0918})['then'](function(_0x833d27){if(_0x833d27){return[_0x833d27,![]];}_0x52f953[_0x1e18('0x8d')]=_0x15bb32[_0x1e18('0x60')][_0x1e18('0x8d')];_0x52f953['externalUrl']=_0x15bb32['body'][_0x1e18('0x8f')];return db[_0x1e18('0x8e')][_0x1e18('0x5a')](_0x52f953)['then'](function(_0x9cc123){return[_0x9cc123,!![]];});});}else{_0x1d0918[_0x1e18('0x8d')]=null;}_0x1d0918[_0x1e18('0x90')]=_0x1dd8d7['id'];return db[_0x1e18('0x8e')][_0x1e18('0x5e')]({'where':_0x1d0918})[_0x1e18('0x23')](function(_0x461dc0){if(_0x461dc0){return[_0x461dc0,![]];}return db[_0x1e18('0x8e')]['create'](_0x52f953)[_0x1e18('0x23')](function(_0x3a98d9){return[_0x3a98d9,!![]];});});}})['spread'](function(_0x111da5,_0x2e0981){if(_0x111da5){_0x5d91c6=_0x2e0981;if(!_0x2e0981){var _0x47c989={'from':(_0x111500['contact'][_0x1e18('0x8c')]||'')+'\x20'+(_0x111500['contact'][_0x1e18('0x91')]||'')};if(_0x15bb32[_0x1e18('0x60')][_0x1e18('0x8d')]&&_0x15bb32['body'][_0x1e18('0x92')]&&_0x15bb32[_0x1e18('0x60')]['threadId']!=_0x15bb32[_0x1e18('0x60')][_0x1e18('0x92')]){_0x47c989[_0x1e18('0x8d')]=_0x15bb32[_0x1e18('0x60')][_0x1e18('0x92')];}return _0x111da5[_0x1e18('0x37')](_0x47c989);}else{return _0x111da5;}}})['then'](function(_0x4bebb2){_0x111500[_0x1e18('0x93')]=_0x4bebb2['get']({'plain':!![]});_0x111500[_0x1e18('0x93')][_0x1e18('0x94')]=_0x5d91c6;if(_0x111500[_0x1e18('0x93')]['created']){if(_0x111500[_0x1e18('0x8a')]['autoclose']){_0x111500[_0x1e18('0x86')]['push']({'id':0x0,'priority':_0x111500[_0x1e18('0x86')][_0x1e18('0x6c')]+0x1,'app':_0x1e18('0x95'),'appdata':_0x1e18('0x96'),'interval':'*,*,*,*'});}}return db[_0x1e18('0x97')][_0x1e18('0x5a')]({'body':_0x15bb32[_0x1e18('0x60')][_0x1e18('0x60')],'OpenchannelAccountId':_0x15bb32[_0x1e18('0x58')]['id'],'OpenchannelInteractionId':_0x4bebb2['id'],'direction':'in','ContactId':_0x111500[_0x1e18('0x8b')]['id'],'AttachmentId':_0x15bb32[_0x1e18('0x60')]['AttachmentId']});})[_0x1e18('0x23')](function(_0x1da1fb){_0x111500[_0x1e18('0x2c')]=_0x1da1fb;if(_0x111500[_0x1e18('0x93')][_0x1e18('0x98')]){return db[_0x1e18('0x99')][_0x1e18('0x5e')]({'attributes':['id',_0x1e18('0x3c')],'where':{'id':_0x111500[_0x1e18('0x93')][_0x1e18('0x98')]}})[_0x1e18('0x23')](function(_0x3787fd){if(_0x3787fd){_0x111500[_0x1e18('0x86')]['unshift']({'id':0x0,'priority':0x0,'app':_0x1e18('0x9a'),'appdata':_0x3787fd['name']+','+(_0x111500[_0x1e18('0x8a')][_0x1e18('0x9b')]||0xa),'interval':_0x1e18('0x9c')});_0x111500[_0x1e18('0x9d')]=![];}return respondWithRpcPromise('Start','startRouting',_0x111500);});}return respondWithRpcPromise('Start',_0x1e18('0x9e'),_0x111500);})[_0x1e18('0x23')](function(_0x2e81c5){respondWithRpcPromise(_0x1e18('0x9f'),_0x1e18('0x9f'),{'event':_0x1e18('0x6f'),'message':_0x2e81c5},client9002);return _0x2e81c5;})[_0x1e18('0x23')](respondWithResult(_0x49ee04,null))[_0x1e18('0x56')](handleError(_0x49ee04,null));};exports[_0x1e18('0xa0')]=function(_0x241075,_0x2da7a7){var _0x2a5c93=_0x241075['params']['id'];var _0x14894c=_0x241075[_0x1e18('0x60')];var _0x5e2b7d=0xc8;var _0x184ef7=null;return db[_0x1e18('0xa1')][_0x1e18('0xa2')]({'isolationLevel':db[_0x1e18('0xa1')][_0x1e18('0xa3')][_0x1e18('0xa4')][_0x1e18('0xa5')]},function(_0x18d041){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x2a5c93},'transaction':_0x18d041})[_0x1e18('0x23')](function(_0xf6107f){if(_0xf6107f){return db['OpenchannelApplication'][_0x1e18('0x38')]({'where':{'OpenchannelAccountId':_0x2a5c93},'transaction':_0x18d041})['then'](function(){var _0x24c6e2=_[_0x1e18('0x51')](_0x14894c,function(_0x57163b){_0x57163b['OpenchannelAccountId']=_0x2a5c93;return _0x57163b;});return db['OpenchannelApplication'][_0x1e18('0xa6')](_0x24c6e2,{'transaction':_0x18d041});});}else{_0x5e2b7d=0x194;_0x184ef7=[];}});})[_0x1e18('0x23')](function(){if(_0x5e2b7d!==0x194){return db[_0x1e18('0x84')][_0x1e18('0xa7')]({'where':{'OpenchannelAccountId':_0x2a5c93},'order':_0x1e18('0x88')})['then'](function(_0x2de0f0){_0x184ef7=_0x2de0f0;});}})[_0x1e18('0x56')](function(_0x46360b){_0x5e2b7d=0x1f4;logger['error'](_0x46360b['stack']);if(_0x46360b[_0x1e18('0x3c')]){delete _0x46360b[_0x1e18('0x3c')];}_0x184ef7=_0x46360b;})[_0x1e18('0xa8')](function(){if(_0x184ef7===null){_0x2da7a7['sendStatus'](_0x5e2b7d);}else{if(_0x5e2b7d===0x1f4){_0x2da7a7[_0x1e18('0x2f')](_0x5e2b7d)['send'](_0x184ef7);}else{_0x2da7a7[_0x1e18('0x2f')](_0x5e2b7d)['json'](_0x184ef7);}}});};exports['getApplications']=function(_0x175201,_0x3b0377,_0x120f05){var _0x516114={};var _0x1ed962={};var _0x3f7168;var _0x195f26;return db[_0x1e18('0x40')][_0x1e18('0x6b')]({'where':{'id':_0x175201[_0x1e18('0x58')]['id']}})[_0x1e18('0x23')](handleEntityNotFound(_0x3b0377,null))['then'](function(_0xe75d1e){if(_0xe75d1e){_0x3f7168=_0xe75d1e;_0x1ed962['model']=_[_0x1e18('0x45')](db[_0x1e18('0x84')]['rawAttributes']);_0x1ed962['query']=_[_0x1e18('0x45')](_0x175201[_0x1e18('0x44')]);_0x1ed962[_0x1e18('0x46')]=_[_0x1e18('0x47')](_0x1ed962[_0x1e18('0x48')],_0x1ed962[_0x1e18('0x44')]);_0x516114['attributes']=_[_0x1e18('0x47')](_0x1ed962['model'],qs['fields'](_0x175201[_0x1e18('0x44')]['fields']));_0x516114[_0x1e18('0x49')]=_0x516114[_0x1e18('0x49')][_0x1e18('0x6c')]?_0x516114[_0x1e18('0x49')]:_0x1ed962[_0x1e18('0x48')];_0x516114[_0x1e18('0x4c')]=qs[_0x1e18('0x4d')](_0x175201[_0x1e18('0x44')][_0x1e18('0x4d')]);_0x516114['where']=qs[_0x1e18('0x46')](_['pick'](_0x175201['query'],_0x1ed962['filters']));if(_0x175201[_0x1e18('0x44')]['filter']){_0x516114['where']=_[_0x1e18('0x50')](_0x516114[_0x1e18('0x4e')],{'$or':_[_0x1e18('0x51')](_0x516114[_0x1e18('0x49')],function(_0x43a443){var _0x4a79b3={};_0x4a79b3[_0x43a443]={'$like':'%'+_0x175201[_0x1e18('0x44')]['filter']+'%'};return _0x4a79b3;})});}_0x516114=_[_0x1e18('0x50')]({},_0x516114,_0x175201['options']);return _0x3f7168['getApplications'](_0x516114);}})[_0x1e18('0x23')](function(_0x313f19){if(_0x313f19){_0x195f26=_0x313f19[_0x1e18('0x6c')];if(!_0x175201[_0x1e18('0x44')][_0x1e18('0x4a')]('nolimit')){_0x516114['limit']=qs[_0x1e18('0x4b')](_0x175201[_0x1e18('0x44')]['limit']);_0x516114[_0x1e18('0x34')]=qs[_0x1e18('0x34')](_0x175201[_0x1e18('0x44')][_0x1e18('0x34')]);}return _0x3f7168['getApplications'](_0x516114);}})[_0x1e18('0x23')](function(_0x1203df){if(_0x1203df){return _0x1203df?{'count':_0x195f26,'rows':_0x1203df}:null;}})['then'](respondWithResult(_0x3b0377,null))[_0x1e18('0x56')](handleError(_0x3b0377,null));};exports['getInteractions']=function(_0x3b9653,_0x5355d5,_0xfd9af4){var _0x5f3bed={'raw':![],'where':{}};var _0x4bce09={};var _0x2890ad={'count':0x0,'rows':[]};return db[_0x1e18('0x40')]['findOne']({'where':{'id':_0x3b9653['params']['id']}})[_0x1e18('0x23')](handleEntityNotFound(_0x5355d5,null))['then'](function(_0x5a4ec5){if(_0x5a4ec5){_0x4bce09[_0x1e18('0x48')]=_[_0x1e18('0x45')](db[_0x1e18('0x8e')][_0x1e18('0x41')]);_0x4bce09[_0x1e18('0x44')]=_['keys'](_0x3b9653[_0x1e18('0x44')]);_0x4bce09['filters']=_['intersection'](_0x4bce09[_0x1e18('0x48')],_0x4bce09[_0x1e18('0x44')]);_0x5f3bed[_0x1e18('0x49')]=_[_0x1e18('0x47')](_0x4bce09[_0x1e18('0x48')],qs[_0x1e18('0x59')](_0x3b9653['query'][_0x1e18('0x59')]));_0x5f3bed[_0x1e18('0x49')]=_0x5f3bed[_0x1e18('0x49')]['length']?_0x5f3bed[_0x1e18('0x49')]:_0x4bce09['model'];if(!_0x3b9653[_0x1e18('0x44')][_0x1e18('0x4a')]('nolimit')){_0x5f3bed[_0x1e18('0x4b')]=qs['limit'](_0x3b9653[_0x1e18('0x44')][_0x1e18('0x4b')]);_0x5f3bed[_0x1e18('0x34')]=qs['offset'](_0x3b9653[_0x1e18('0x44')][_0x1e18('0x34')]);}_0x5f3bed[_0x1e18('0x4c')]=qs['sort'](_0x3b9653[_0x1e18('0x44')][_0x1e18('0x4d')]);_0x5f3bed[_0x1e18('0x4e')]=qs[_0x1e18('0x46')](_[_0x1e18('0x67')](_0x3b9653[_0x1e18('0x44')],_0x4bce09[_0x1e18('0x46')]));_0x5f3bed[_0x1e18('0x4e')][_0x1e18('0x63')]=_0x5a4ec5['id'];if(_0x3b9653['query'][_0x1e18('0x4f')]){_0x5f3bed['where']=_['merge'](_0x5f3bed[_0x1e18('0x4e')],{'$or':_[_0x1e18('0x51')](_0x5f3bed['attributes'],function(_0x4921dd){var _0x13f0c9={};_0x13f0c9[_0x4921dd]={'$like':'%'+_0x3b9653[_0x1e18('0x44')][_0x1e18('0x4f')]+'%'};return _0x13f0c9;})});}_0x5f3bed=_[_0x1e18('0x50')]({},_0x5f3bed,_0x3b9653[_0x1e18('0x52')]);return db['OpenchannelInteraction']['count']({'where':_0x5f3bed[_0x1e18('0x4e')]})[_0x1e18('0x23')](function(_0x301778){_0x2890ad[_0x1e18('0x33')]=_0x301778;if(_0x3b9653['query']['includeAll']){_0x5f3bed[_0x1e18('0x54')]=[{'model':db[_0x1e18('0x70')],'as':_0x1e18('0xa9'),'required':![]},{'model':db['User'],'as':_0x1e18('0xaa'),'attributes':[_0x1e18('0x3c'),'fullname',_0x1e18('0xab')],'required':![]},{'model':db[_0x1e18('0xac')],'as':'Tags','attributes':['id',_0x1e18('0x3c'),_0x1e18('0xad')],'where':_0x3b9653[_0x1e18('0x44')][_0x1e18('0xae')]?{'id':_0x3b9653['query']['tag']}:undefined,'required':_0x3b9653['query']['tag']?!![]:![]}];}return db[_0x1e18('0x8e')][_0x1e18('0x55')](_0x5f3bed);})['then'](function(_0x1ddacb){_0x2890ad[_0x1e18('0x68')]=_0x1ddacb;return _0x2890ad;});}})['then'](respondWithFilteredResult(_0x5355d5,_0x5f3bed))[_0x1e18('0x56')](handleError(_0x5355d5,null));};exports['addAgents']=function(_0x2ac8f3,_0x2e1f2e,_0x47349a){return db[_0x1e18('0x40')][_0x1e18('0x5e')]({'where':{'id':_0x2ac8f3[_0x1e18('0x58')]['id']}})[_0x1e18('0x23')](handleEntityNotFound(_0x2e1f2e,null))['then'](function(_0x8afb8){if(_0x8afb8){return _0x8afb8[_0x1e18('0xaf')](_0x2ac8f3['body'][_0x1e18('0x6e')],_[_0x1e18('0xb0')](_0x2ac8f3[_0x1e18('0x60')],['ids','id'])||{})[_0x1e18('0xb1')](function(_0x4a035e){for(var _0x59eb44=0x0;_0x59eb44<_0x2ac8f3[_0x1e18('0x60')][_0x1e18('0x6e')][_0x1e18('0x6c')];_0x59eb44+=0x1){socket[_0x1e18('0xb2')]('userOpenchannelAccount:save',{'UserId':Number(_0x2ac8f3[_0x1e18('0x60')][_0x1e18('0x6e')][_0x59eb44]),'OpenchannelAccountId':Number(_0x2ac8f3['params']['id'])});}return _0x4a035e;});}})[_0x1e18('0x23')](respondWithResult(_0x2e1f2e,null))[_0x1e18('0x56')](handleError(_0x2e1f2e,null));};exports[_0x1e18('0xb3')]=function(_0x21a78c,_0x430cdd,_0x2d0e62){return db[_0x1e18('0x40')][_0x1e18('0x5e')]({'where':{'id':_0x21a78c[_0x1e18('0x58')]['id']}})['then'](handleEntityNotFound(_0x430cdd,null))[_0x1e18('0x23')](function(_0x5ce49f){if(_0x5ce49f){return _0x5ce49f[_0x1e18('0xb3')](_0x21a78c[_0x1e18('0x44')][_0x1e18('0x6e')])[_0x1e18('0x23')](function(){if(_['isArray'](_0x21a78c[_0x1e18('0x44')][_0x1e18('0x6e')])){for(var _0x36fc34=0x0;_0x36fc34<_0x21a78c[_0x1e18('0x44')]['ids'][_0x1e18('0x6c')];_0x36fc34+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x21a78c[_0x1e18('0x44')][_0x1e18('0x6e')][_0x36fc34]),'OpenchannelAccountId':Number(_0x21a78c[_0x1e18('0x58')]['id'])});}}else{socket[_0x1e18('0xb2')]('userOpenchannelAccount:remove',{'UserId':Number(_0x21a78c[_0x1e18('0x44')][_0x1e18('0x6e')]),'OpenchannelAccountId':Number(_0x21a78c[_0x1e18('0x58')]['id'])});}});}})[_0x1e18('0x23')](respondWithStatusCode(_0x430cdd,null))['catch'](handleError(_0x430cdd,null));};exports['getAgents']=function(_0x48b625,_0x185d5b,_0x28b851){var _0x2f62be={};var _0x5d008b={};var _0x2542f7;var _0x199865;return db[_0x1e18('0x40')][_0x1e18('0x6b')]({'where':{'id':_0x48b625[_0x1e18('0x58')]['id']}})[_0x1e18('0x23')](handleEntityNotFound(_0x185d5b,null))[_0x1e18('0x23')](function(_0x42de7b){if(_0x42de7b){_0x2542f7=_0x42de7b;_0x5d008b[_0x1e18('0x48')]=_[_0x1e18('0x45')](db[_0x1e18('0x99')][_0x1e18('0x41')]);_0x5d008b[_0x1e18('0x44')]=_[_0x1e18('0x45')](_0x48b625[_0x1e18('0x44')]);_0x5d008b['filters']=_[_0x1e18('0x47')](_0x5d008b[_0x1e18('0x48')],_0x5d008b['query']);_0x2f62be[_0x1e18('0x49')]=_[_0x1e18('0x47')](_0x5d008b['model'],qs[_0x1e18('0x59')](_0x48b625[_0x1e18('0x44')]['fields']));_0x2f62be[_0x1e18('0x49')]=_0x2f62be[_0x1e18('0x49')][_0x1e18('0x6c')]?_0x2f62be[_0x1e18('0x49')]:_0x5d008b[_0x1e18('0x48')];_0x2f62be[_0x1e18('0x4c')]=qs['sort'](_0x48b625[_0x1e18('0x44')][_0x1e18('0x4d')]);_0x2f62be[_0x1e18('0x4e')]=qs[_0x1e18('0x46')](_[_0x1e18('0x67')](_0x48b625[_0x1e18('0x44')],_0x5d008b[_0x1e18('0x46')]));if(_0x48b625[_0x1e18('0x44')][_0x1e18('0x4f')]){_0x2f62be[_0x1e18('0x4e')]=_[_0x1e18('0x50')](_0x2f62be['where'],{'$or':_['map'](_0x2f62be[_0x1e18('0x49')],function(_0x2dda0f){var _0x59d8b1={};_0x59d8b1[_0x2dda0f]={'$like':'%'+_0x48b625[_0x1e18('0x44')][_0x1e18('0x4f')]+'%'};return _0x59d8b1;})});}_0x2f62be=_[_0x1e18('0x50')]({},_0x2f62be,_0x48b625[_0x1e18('0x52')]);return _0x2542f7[_0x1e18('0xb4')](_0x2f62be);}})[_0x1e18('0x23')](function(_0x47f339){if(_0x47f339){_0x199865=_0x47f339['length'];if(!_0x48b625[_0x1e18('0x44')][_0x1e18('0x4a')](_0x1e18('0x66'))){_0x2f62be[_0x1e18('0x4b')]=qs[_0x1e18('0x4b')](_0x48b625[_0x1e18('0x44')]['limit']);_0x2f62be['offset']=qs[_0x1e18('0x34')](_0x48b625['query'][_0x1e18('0x34')]);}return _0x2542f7[_0x1e18('0xb4')](_0x2f62be);}})[_0x1e18('0x23')](function(_0x20d1df){if(_0x20d1df){return _0x20d1df?{'count':_0x199865,'rows':_0x20d1df}:null;}})['then'](respondWithResult(_0x185d5b,null))[_0x1e18('0x56')](handleError(_0x185d5b,null));};exports[_0x1e18('0x3d')]=function(_0x29ed69,_0x5db02c,_0x528721){var _0x1c21b4,_0x3fedc6,_0x2a5461;if(_[_0x1e18('0x77')](_0x29ed69[_0x1e18('0x60')][_0x1e18('0x60')])||_0x29ed69['body'][_0x1e18('0x60')]===''){throw new db['Sequelize'][(_0x1e18('0x71'))](_0x1e18('0x7b'));}if(_[_0x1e18('0x77')](_0x29ed69[_0x1e18('0x60')]['to'])){}_0x1c21b4=_0x29ed69[_0x1e18('0x60')]['to'];return db[_0x1e18('0x40')][_0x1e18('0x6b')]({'where':{'id':_0x29ed69[_0x1e18('0x58')]['id']}})[_0x1e18('0x23')](handleEntityNotFound(_0x5db02c,null))[_0x1e18('0x23')](function(_0x315467){if(_0x315467){return db['OpenchannelAccount']['find']({'where':{'id':_0x315467['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x1e18('0x70')],'as':_0x1e18('0x82'),'where':{[_0x315467['mapKey']]:_0x1c21b4},'limit':0x1,'order':[[_0x1e18('0x72'),_0x1e18('0x83')]]}]}]})[_0x1e18('0x23')](handleEntityNotFound(_0x5db02c,null))['then'](function(_0x1c89e6){if(_0x1c89e6&&_0x1c89e6['List']){_0x3fedc6=_0x1c89e6[_0x1e18('0x39')]({'plain':!![]});if(_0x3fedc6[_0x1e18('0x81')]&&_0x3fedc6[_0x1e18('0x81')][_0x1e18('0x82')][_0x1e18('0x6c')]){return _0x3fedc6[_0x1e18('0x81')]['Contacts'][0x0];}return db[_0x1e18('0x70')][_0x1e18('0x5a')](_[_0x1e18('0x1c')](_0x29ed69['body'],{'firstName':_0x1c21b4,[_0x1c89e6['mapKey']]:_0x1c21b4,'phone':_0x1c21b4,'ListId':_0x3fedc6[_0x1e18('0x76')]}));}})['then'](handleEntityNotFound(_0x5db02c,null))['then'](function(_0x211ca4){if(_0x211ca4){_0x2a5461=_0x211ca4;return db['OpenchannelInteraction'][_0x1e18('0x5e')]({'where':{'ContactId':_0x2a5461['id'],'closed':![],'OpenchannelAccountId':_0x3fedc6['id']}})['then'](function(_0x3a3ee6){if(_0x3a3ee6){return[_0x3a3ee6,![]];}return db[_0x1e18('0x8e')][_0x1e18('0x5a')]({'UserId':_0x29ed69[_0x1e18('0x5b')]['id'],'ContactId':_0x2a5461['id'],'OpenchannelAccountId':_0x3fedc6['id'],'lastMsgDirection':_0x1e18('0xb5'),'firstMsgDirection':'out','Messages':[_['merge'](_0x29ed69[_0x1e18('0x60')],{'read':![],'body':_0x29ed69[_0x1e18('0x60')][_0x1e18('0x60')],'OpenchannelAccountId':_0x3fedc6['id'],'UserId':_0x29ed69[_0x1e18('0x5b')]['id'],'ContactId':_0x2a5461['id']})]},{'include':[{'model':db[_0x1e18('0x97')],'as':_0x1e18('0xb6')}]})['then'](function(_0x1e894b){return[_0x1e894b,!![]];});});}})['spread'](function(_0x4de951,_0xb29bea){if(_0xb29bea){return _0x4de951;}return db['OpenchannelMessage'][_0x1e18('0x5a')](_[_0x1e18('0x50')](_0x29ed69[_0x1e18('0x60')],{'read':![],'body':_0x29ed69[_0x1e18('0x60')][_0x1e18('0x60')],'OpenchannelAccountId':_0x3fedc6['id'],'OpenchannelInteractionId':_0x4de951['id'],'UserId':_0x29ed69[_0x1e18('0x5b')]['id'],'ContactId':_0x2a5461['id']}))[_0x1e18('0x23')](function(_0x360f45){_0x4de951[_0x1e18('0xb7')][_0x1e18('0xb6')]=[];_0x4de951[_0x1e18('0xb7')][_0x1e18('0xb6')]['push'](_0x360f45[_0x1e18('0xb7')]);return _0x4de951;});});}})[_0x1e18('0x23')](respondWithResult(_0x5db02c,null))['catch'](handleError(_0x5db02c,null));};
\ No newline at end of file
+var _0x54a1=['list','orderBy','priority','asc','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','contact','firstName','messageId','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','OpenchannelApplication','bulkCreate','findAndCountAll','stack','getApplications','getInteractions','Owner','internal','Tag','Tags','color','tag','addAgents','omit','spread','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','get','OpenchannelAccounts','UserProfileResource','end','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','OpenchannelAccount','includeAll','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','OpenchannelAccountId','findOne','Disposition','nolimit','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','ValidationError','difference','updatedAt','createdAt','ListId','isNil','from','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','Applications','account','applications'];(function(_0x405c22,_0x3882a0){var _0x18f596=function(_0x24266f){while(--_0x24266f){_0x405c22['push'](_0x405c22['shift']());}};_0x18f596(++_0x3882a0);}(_0x54a1,0xf1));var _0x154a=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x54a1[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require(_0x154a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x154a('0x1'));var jsonpatch=require(_0x154a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x154a('0x3'));var util=require('util');var path=require(_0x154a('0x4'));var sox=require('sox');var csv=require(_0x154a('0x5'));var ejs=require(_0x154a('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x154a('0x7'));var squel=require(_0x154a('0x8'));var crypto=require(_0x154a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x154a('0xa'));var toCsv=require(_0x154a('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x154a('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x154a('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x154a('0xd'));var logger=require(_0x154a('0xe'))(_0x154a('0xf'));var utils=require(_0x154a('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x154a('0x11'))['db'];config[_0x154a('0x12')]=_[_0x154a('0x13')](config['redis'],{'host':_0x154a('0x14'),'port':0x18eb});var socket=require(_0x154a('0x15'))(new Redis(config[_0x154a('0x12')]));require('./openchannelAccount.socket')[_0x154a('0x16')](socket);var jayson=require(_0x154a('0x17'));var client=jayson[_0x154a('0x18')][_0x154a('0x19')]({'port':0x232c});var client9002=jayson['client'][_0x154a('0x19')]({'port':0x232a});function respondWithRpcPromise(_0xf12e02,_0x1c567e,_0x334ed3,_0x4d76b0){return new BPromise(function(_0x283621,_0x10445d){var _0x99de63=_0x4d76b0||client;return _0x99de63[_0x154a('0x1a')](_0xf12e02,_0x334ed3)[_0x154a('0x1b')](function(_0xb19354){logger[_0x154a('0x1c')](_0x154a('0x1d'),_0x1c567e,_0x154a('0x1e'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1c567e,_0x154a('0x1e'),JSON['stringify'](_0xb19354));if(_0xb19354[_0x154a('0x1f')]){if(_0xb19354[_0x154a('0x1f')][_0x154a('0x20')]===0x1f4){logger[_0x154a('0x1f')](_0x154a('0x1d'),_0x1c567e,_0xb19354[_0x154a('0x1f')]['message']);return _0x10445d(_0xb19354[_0x154a('0x1f')][_0x154a('0x21')]);}logger[_0x154a('0x1f')](_0x154a('0x1d'),_0x1c567e,_0xb19354[_0x154a('0x1f')][_0x154a('0x21')]);return _0x283621(_0xb19354[_0x154a('0x1f')]['message']);}else{logger[_0x154a('0x1c')](_0x154a('0x1d'),_0x1c567e,'request\x20sent');_0x283621(_0xb19354[_0x154a('0x22')][_0x154a('0x21')]);}})['catch'](function(_0xb0371b){logger[_0x154a('0x1f')](_0x154a('0x1d'),_0x1c567e,_0xb0371b);_0x10445d(_0xb0371b);});});}function respondWithStatusCode(_0x23a181,_0xf972a){_0xf972a=_0xf972a||0xcc;return function(_0x17c637){if(_0x17c637){return _0x23a181[_0x154a('0x23')](_0xf972a);}return _0x23a181['status'](_0xf972a)['end']();};}function respondWithResult(_0x330d47,_0x5339eb){_0x5339eb=_0x5339eb||0xc8;return function(_0x36c36c){if(_0x36c36c){return _0x330d47[_0x154a('0x24')](_0x5339eb)[_0x154a('0x25')](_0x36c36c);}};}function respondWithFilteredResult(_0x148e4e,_0x2dd684){return function(_0x54517e){if(_0x54517e){var _0x41f185=typeof _0x2dd684[_0x154a('0x26')]===_0x154a('0x27')&&typeof _0x2dd684[_0x154a('0x28')]===_0x154a('0x27');var _0x352698=_0x54517e[_0x154a('0x29')];var _0x42f301=_0x41f185?0x0:_0x2dd684[_0x154a('0x26')];var _0x36bd92=_0x41f185?_0x54517e[_0x154a('0x29')]:_0x2dd684[_0x154a('0x26')]+_0x2dd684['limit'];var _0xd0ead9;if(_0x36bd92>=_0x352698){_0x36bd92=_0x352698;_0xd0ead9=0xc8;}else{_0xd0ead9=0xce;}_0x148e4e['status'](_0xd0ead9);return _0x148e4e[_0x154a('0x2a')](_0x154a('0x2b'),_0x42f301+'-'+_0x36bd92+'/'+_0x352698)[_0x154a('0x25')](_0x54517e);}return null;};}function patchUpdates(_0x3f50c7){return function(_0x2653d8){try{jsonpatch[_0x154a('0x2c')](_0x2653d8,_0x3f50c7,!![]);}catch(_0x1b870e){return BPromise['reject'](_0x1b870e);}return _0x2653d8[_0x154a('0x2d')]();};}function saveUpdates(_0x20ff14,_0x5daacc){return function(_0x60e165){if(_0x60e165){return _0x60e165['update'](_0x20ff14)[_0x154a('0x1b')](function(_0x4693e1){return _0x4693e1;});}return null;};}function removeEntity(_0x45f5a2,_0x603ce5){return function(_0x3b2d58){if(_0x3b2d58){return _0x3b2d58[_0x154a('0x2e')]()[_0x154a('0x1b')](function(){var _0x112b52=_0x3b2d58[_0x154a('0x2f')]({'plain':!![]});var _0x424eae=_0x154a('0x30');return db[_0x154a('0x31')][_0x154a('0x2e')]({'where':{'type':_0x424eae,'resourceId':_0x112b52['id']}})['then'](function(){return _0x3b2d58;});})['then'](function(){_0x45f5a2[_0x154a('0x24')](0xcc)[_0x154a('0x32')]();});}};}function handleEntityNotFound(_0x24a6be,_0x10be3d){return function(_0x2e8322){if(!_0x2e8322){_0x24a6be[_0x154a('0x23')](0x194);}return _0x2e8322;};}function handleError(_0x1fafca,_0xb04296){_0xb04296=_0xb04296||0x1f4;return function(_0x4c6624){logger[_0x154a('0x1f')](_0x4c6624['stack']);if(_0x4c6624[_0x154a('0x33')]){delete _0x4c6624['name'];}_0x1fafca['status'](_0xb04296)[_0x154a('0x34')](_0x4c6624);};}exports[_0x154a('0x35')]=function(_0x51ebd9,_0x14e73a){var _0x3baa38={'include':[{'model':db[_0x154a('0x36')],'as':_0x154a('0x37')}]},_0x4ae910={},_0x42da53={'count':0x0,'rows':[]};var _0x526ea2=_['map'](db['OpenchannelAccount'][_0x154a('0x38')],function(_0x26e6b8){return{'name':_0x26e6b8[_0x154a('0x39')],'type':_0x26e6b8['type']['key']};});_0x4ae910[_0x154a('0x3a')]=_[_0x154a('0x3b')](_0x526ea2,_0x154a('0x33'));_0x4ae910['query']=_[_0x154a('0x3c')](_0x51ebd9[_0x154a('0x3d')]);_0x4ae910[_0x154a('0x3e')]=_[_0x154a('0x3f')](_0x4ae910[_0x154a('0x3a')],_0x4ae910[_0x154a('0x3d')]);_0x3baa38[_0x154a('0x40')]=_[_0x154a('0x3f')](_0x4ae910[_0x154a('0x3a')],qs[_0x154a('0x41')](_0x51ebd9[_0x154a('0x3d')][_0x154a('0x41')]));_0x3baa38[_0x154a('0x40')]=_0x3baa38[_0x154a('0x40')]['length']?_0x3baa38[_0x154a('0x40')]:_0x4ae910[_0x154a('0x3a')];if(!_0x51ebd9['query'][_0x154a('0x42')]('nolimit')){_0x3baa38['limit']=qs['limit'](_0x51ebd9[_0x154a('0x3d')][_0x154a('0x28')]);_0x3baa38[_0x154a('0x26')]=qs[_0x154a('0x26')](_0x51ebd9['query'][_0x154a('0x26')]);}_0x3baa38[_0x154a('0x43')]=qs[_0x154a('0x44')](_0x51ebd9[_0x154a('0x3d')][_0x154a('0x44')]);_0x3baa38[_0x154a('0x45')]=qs[_0x154a('0x3e')](_[_0x154a('0x46')](_0x51ebd9['query'],_0x4ae910[_0x154a('0x3e')]),_0x526ea2);if(_0x51ebd9[_0x154a('0x3d')]['filter']){_0x3baa38['where']=_[_0x154a('0x47')](_0x3baa38['where'],{'$or':_[_0x154a('0x3b')](_0x526ea2,function(_0x18fc58){if(_0x18fc58[_0x154a('0x48')]!==_0x154a('0x49')){var _0x407d28={};_0x407d28[_0x18fc58['name']]={'$like':'%'+_0x51ebd9[_0x154a('0x3d')][_0x154a('0x4a')]+'%'};return _0x407d28;}})});}_0x3baa38=_[_0x154a('0x47')]({},_0x3baa38,_0x51ebd9[_0x154a('0x4b')]);var _0x3dfd62={'where':_0x3baa38[_0x154a('0x45')]};return db[_0x154a('0x4c')][_0x154a('0x29')](_0x3dfd62)[_0x154a('0x1b')](function(_0x26f4d0){_0x42da53['count']=_0x26f4d0;if(_0x51ebd9[_0x154a('0x3d')][_0x154a('0x4d')]){_0x3baa38['include']=[{'all':!![]}];}return db[_0x154a('0x4c')][_0x154a('0x4e')](_0x3baa38);})['then'](function(_0x55c157){_0x42da53[_0x154a('0x4f')]=_0x55c157;return _0x42da53;})[_0x154a('0x1b')](respondWithFilteredResult(_0x14e73a,_0x3baa38))[_0x154a('0x50')](handleError(_0x14e73a,null));};exports[_0x154a('0x51')]=function(_0x1fbad2,_0x380192){var _0x653383={'raw':![],'where':{'id':_0x1fbad2[_0x154a('0x52')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2030ff={};_0x2030ff[_0x154a('0x3a')]=_['keys'](db[_0x154a('0x4c')][_0x154a('0x38')]);_0x2030ff[_0x154a('0x3d')]=_['keys'](_0x1fbad2[_0x154a('0x3d')]);_0x2030ff[_0x154a('0x3e')]=_[_0x154a('0x3f')](_0x2030ff[_0x154a('0x3a')],_0x2030ff[_0x154a('0x3d')]);_0x653383['attributes']=_[_0x154a('0x3f')](_0x2030ff['model'],qs['fields'](_0x1fbad2[_0x154a('0x3d')][_0x154a('0x41')]));_0x653383[_0x154a('0x40')]=_0x653383[_0x154a('0x40')][_0x154a('0x53')]?_0x653383[_0x154a('0x40')]:_0x2030ff[_0x154a('0x3a')];if(_0x1fbad2[_0x154a('0x3d')][_0x154a('0x4d')]){_0x653383['include']=[{'all':!![]}];}_0x653383=_['merge']({},_0x653383,_0x1fbad2[_0x154a('0x4b')]);return db[_0x154a('0x4c')][_0x154a('0x54')](_0x653383)[_0x154a('0x1b')](handleEntityNotFound(_0x380192,null))[_0x154a('0x1b')](respondWithResult(_0x380192,null))[_0x154a('0x50')](handleError(_0x380192,null));};exports['create']=function(_0x526e16,_0x6f2262){return db[_0x154a('0x4c')][_0x154a('0x55')](_0x526e16[_0x154a('0x56')],{})[_0x154a('0x1b')](function(_0x3579e6){var _0x15aecf=_0x526e16[_0x154a('0x57')][_0x154a('0x2f')]({'plain':!![]});if(!_0x15aecf)throw new Error(_0x154a('0x58'));if(_0x15aecf['role']===_0x154a('0x57')){var _0x1fd363=_0x3579e6[_0x154a('0x2f')]({'plain':!![]});var _0x54d21a=_0x154a('0x30');return db['UserProfileSection'][_0x154a('0x54')]({'where':{'name':_0x54d21a,'userProfileId':_0x15aecf[_0x154a('0x59')]},'raw':!![]})['then'](function(_0x3c1774){if(_0x3c1774&&_0x3c1774[_0x154a('0x5a')]===0x0){return db[_0x154a('0x31')][_0x154a('0x55')]({'name':_0x1fd363[_0x154a('0x33')],'resourceId':_0x1fd363['id'],'type':_0x3c1774[_0x154a('0x33')],'sectionId':_0x3c1774['id']},{})[_0x154a('0x1b')](function(){return _0x3579e6;});}else{return _0x3579e6;}})[_0x154a('0x50')](function(_0x5b9036){logger[_0x154a('0x1f')](_0x154a('0x5b'),_0x5b9036);throw _0x5b9036;});}return _0x3579e6;})[_0x154a('0x1b')](respondWithResult(_0x6f2262,0xc9))['catch'](handleError(_0x6f2262,null));};exports[_0x154a('0x5c')]=function(_0x4fce6c,_0x3f16c3){if(_0x4fce6c['body']['id']){delete _0x4fce6c[_0x154a('0x56')]['id'];}return db[_0x154a('0x4c')]['find']({'where':{'id':_0x4fce6c['params']['id']},'include':[{'model':db[_0x154a('0x36')],'as':_0x154a('0x37')}]})[_0x154a('0x1b')](handleEntityNotFound(_0x3f16c3,null))[_0x154a('0x1b')](saveUpdates(_0x4fce6c[_0x154a('0x56')],null))[_0x154a('0x1b')](respondWithResult(_0x3f16c3,null))[_0x154a('0x50')](handleError(_0x3f16c3,null));};exports[_0x154a('0x2e')]=function(_0x465c3c,_0x310452){return db['OpenchannelAccount']['find']({'where':{'id':_0x465c3c[_0x154a('0x52')]['id']}})['then'](handleEntityNotFound(_0x310452,null))[_0x154a('0x1b')](removeEntity(_0x310452,null))[_0x154a('0x50')](handleError(_0x310452,null));};exports[_0x154a('0x5d')]=function(_0x388c85,_0x29d838){return db[_0x154a('0x4c')][_0x154a('0x5d')]()['then'](respondWithResult(_0x29d838,null))[_0x154a('0x50')](handleError(_0x29d838,null));};exports[_0x154a('0x5e')]=function(_0x3eaa40,_0x559d6f,_0x1cdf36){if(_0x3eaa40[_0x154a('0x56')]['id']){delete _0x3eaa40[_0x154a('0x56')]['id'];}return db['OpenchannelAccount'][_0x154a('0x54')]({'where':{'id':_0x3eaa40[_0x154a('0x52')]['id']}})['then'](handleEntityNotFound(_0x559d6f,null))[_0x154a('0x1b')](function(_0x35c545){if(_0x35c545){_0x3eaa40[_0x154a('0x56')][_0x154a('0x5f')]=_0x35c545['id'];return db['Disposition'][_0x154a('0x55')](_0x3eaa40[_0x154a('0x56')]);}})['then'](respondWithResult(_0x559d6f,null))[_0x154a('0x50')](handleError(_0x559d6f,null));};exports['getDispositions']=function(_0x2223ba,_0x4b64bb,_0x1f3b10){var _0x4e9aef={'raw':![],'where':{}};var _0x24b84f={};var _0x4e894c={'count':0x0,'rows':[]};return db[_0x154a('0x4c')][_0x154a('0x60')]({'where':{'id':_0x2223ba['params']['id']}})[_0x154a('0x1b')](handleEntityNotFound(_0x4b64bb,null))[_0x154a('0x1b')](function(_0x4207af){if(_0x4207af){_0x24b84f['model']=_[_0x154a('0x3c')](db[_0x154a('0x61')]['rawAttributes']);_0x24b84f['query']=_[_0x154a('0x3c')](_0x2223ba[_0x154a('0x3d')]);_0x24b84f['filters']=_[_0x154a('0x3f')](_0x24b84f['model'],_0x24b84f['query']);_0x4e9aef[_0x154a('0x40')]=_[_0x154a('0x3f')](_0x24b84f[_0x154a('0x3a')],qs[_0x154a('0x41')](_0x2223ba['query']['fields']));_0x4e9aef[_0x154a('0x40')]=_0x4e9aef['attributes'][_0x154a('0x53')]?_0x4e9aef[_0x154a('0x40')]:_0x24b84f[_0x154a('0x3a')];if(!_0x2223ba[_0x154a('0x3d')][_0x154a('0x42')](_0x154a('0x62'))){_0x4e9aef['limit']=qs['limit'](_0x2223ba[_0x154a('0x3d')][_0x154a('0x28')]);_0x4e9aef['offset']=qs[_0x154a('0x26')](_0x2223ba[_0x154a('0x3d')][_0x154a('0x26')]);}_0x4e9aef['order']=qs[_0x154a('0x44')](_0x2223ba[_0x154a('0x3d')]['sort']);_0x4e9aef[_0x154a('0x45')]=qs[_0x154a('0x3e')](_[_0x154a('0x46')](_0x2223ba[_0x154a('0x3d')],_0x24b84f[_0x154a('0x3e')]));_0x4e9aef[_0x154a('0x45')][_0x154a('0x5f')]=_0x4207af['id'];if(_0x2223ba[_0x154a('0x3d')][_0x154a('0x4a')]){_0x4e9aef[_0x154a('0x45')]=_[_0x154a('0x47')](_0x4e9aef[_0x154a('0x45')],{'$or':_['map'](_0x4e9aef[_0x154a('0x40')],function(_0x680d44){var _0x4c313a={};_0x4c313a[_0x680d44]={'$like':'%'+_0x2223ba[_0x154a('0x3d')][_0x154a('0x4a')]+'%'};return _0x4c313a;})});}_0x4e9aef=_[_0x154a('0x47')]({},_0x4e9aef,_0x2223ba['options']);return db[_0x154a('0x61')]['count']({'where':_0x4e9aef[_0x154a('0x45')]})[_0x154a('0x1b')](function(_0xca088b){_0x4e894c[_0x154a('0x29')]=_0xca088b;if(_0x2223ba['query'][_0x154a('0x4d')]){_0x4e9aef[_0x154a('0x63')]=[{'all':!![]}];}return db[_0x154a('0x61')][_0x154a('0x4e')](_0x4e9aef);})[_0x154a('0x1b')](function(_0x231fbe){_0x4e894c[_0x154a('0x4f')]=_0x231fbe;return _0x4e894c;});}})[_0x154a('0x1b')](respondWithFilteredResult(_0x4b64bb,_0x4e9aef))[_0x154a('0x50')](handleError(_0x4b64bb,null));};exports[_0x154a('0x64')]=function(_0x4d62d8,_0x1c9de0,_0x60d757){return db[_0x154a('0x4c')][_0x154a('0x54')]({'where':{'id':_0x4d62d8[_0x154a('0x52')]['id']}})[_0x154a('0x1b')](handleEntityNotFound(_0x1c9de0,null))['then'](function(_0x527306){if(_0x527306){return _0x527306[_0x154a('0x64')](_0x4d62d8[_0x154a('0x3d')][_0x154a('0x65')]);}})[_0x154a('0x1b')](respondWithStatusCode(_0x1c9de0,null))[_0x154a('0x50')](handleError(_0x1c9de0,null));};exports[_0x154a('0x66')]=function(_0x57e49f,_0x559f12,_0x39f97d){if(_0x57e49f[_0x154a('0x56')]['id']){delete _0x57e49f[_0x154a('0x56')]['id'];}return db[_0x154a('0x4c')]['find']({'where':{'id':_0x57e49f[_0x154a('0x52')]['id']}})[_0x154a('0x1b')](handleEntityNotFound(_0x559f12,null))[_0x154a('0x1b')](function(_0x4d1846){if(_0x4d1846){_0x57e49f['body'][_0x154a('0x5f')]=_0x4d1846['id'];return db[_0x154a('0x67')][_0x154a('0x55')](_0x57e49f[_0x154a('0x56')]);}})[_0x154a('0x1b')](respondWithResult(_0x559f12,null))[_0x154a('0x50')](handleError(_0x559f12,null));};exports[_0x154a('0x68')]=function(_0x28d4d7,_0x2db2fe,_0x9d3360){var _0x3209ec={'raw':![],'where':{}};var _0x4c7a51={};var _0xf0e037={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x154a('0x60')]({'where':{'id':_0x28d4d7[_0x154a('0x52')]['id']}})['then'](handleEntityNotFound(_0x2db2fe,null))[_0x154a('0x1b')](function(_0x2c68f4){if(_0x2c68f4){_0x4c7a51['model']=_[_0x154a('0x3c')](db['CannedAnswer']['rawAttributes']);_0x4c7a51[_0x154a('0x3d')]=_[_0x154a('0x3c')](_0x28d4d7[_0x154a('0x3d')]);_0x4c7a51[_0x154a('0x3e')]=_[_0x154a('0x3f')](_0x4c7a51[_0x154a('0x3a')],_0x4c7a51[_0x154a('0x3d')]);_0x3209ec['attributes']=_[_0x154a('0x3f')](_0x4c7a51[_0x154a('0x3a')],qs['fields'](_0x28d4d7['query'][_0x154a('0x41')]));_0x3209ec[_0x154a('0x40')]=_0x3209ec['attributes'][_0x154a('0x53')]?_0x3209ec[_0x154a('0x40')]:_0x4c7a51['model'];if(!_0x28d4d7[_0x154a('0x3d')][_0x154a('0x42')]('nolimit')){_0x3209ec[_0x154a('0x28')]=qs[_0x154a('0x28')](_0x28d4d7[_0x154a('0x3d')][_0x154a('0x28')]);_0x3209ec['offset']=qs['offset'](_0x28d4d7[_0x154a('0x3d')]['offset']);}_0x3209ec[_0x154a('0x43')]=qs[_0x154a('0x44')](_0x28d4d7['query'][_0x154a('0x44')]);_0x3209ec[_0x154a('0x45')]=qs['filters'](_['pick'](_0x28d4d7[_0x154a('0x3d')],_0x4c7a51['filters']));_0x3209ec[_0x154a('0x45')][_0x154a('0x5f')]=_0x2c68f4['id'];if(_0x28d4d7[_0x154a('0x3d')][_0x154a('0x4a')]){_0x3209ec[_0x154a('0x45')]=_['merge'](_0x3209ec[_0x154a('0x45')],{'$or':_[_0x154a('0x3b')](_0x3209ec[_0x154a('0x40')],function(_0x357915){var _0x52ed37={};_0x52ed37[_0x357915]={'$like':'%'+_0x28d4d7[_0x154a('0x3d')][_0x154a('0x4a')]+'%'};return _0x52ed37;})});}_0x3209ec=_[_0x154a('0x47')]({},_0x3209ec,_0x28d4d7[_0x154a('0x4b')]);return db['CannedAnswer'][_0x154a('0x29')]({'where':_0x3209ec[_0x154a('0x45')]})['then'](function(_0x34611d){_0xf0e037[_0x154a('0x29')]=_0x34611d;if(_0x28d4d7[_0x154a('0x3d')][_0x154a('0x4d')]){_0x3209ec[_0x154a('0x63')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3209ec);})[_0x154a('0x1b')](function(_0x232963){_0xf0e037['rows']=_0x232963;return _0xf0e037;});}})[_0x154a('0x1b')](respondWithFilteredResult(_0x2db2fe,_0x3209ec))['catch'](handleError(_0x2db2fe,null));};exports[_0x154a('0x69')]=function(_0x3fe9e9,_0x2d818b,_0x5a1067){return db[_0x154a('0x4c')][_0x154a('0x54')]({'where':{'id':_0x3fe9e9[_0x154a('0x52')]['id']}})[_0x154a('0x1b')](handleEntityNotFound(_0x2d818b,null))[_0x154a('0x1b')](function(_0x499fb9){if(_0x499fb9){return _0x499fb9[_0x154a('0x69')](_0x3fe9e9[_0x154a('0x3d')]['ids']);}})[_0x154a('0x1b')](respondWithStatusCode(_0x2d818b,null))['catch'](handleError(_0x2d818b,null));};exports[_0x154a('0x6a')]=function(_0x30869c,_0x2218bd,_0x11b652){var _0x2d3af2={'body':_0x30869c['body'],'channel':_0x154a('0x6b')};var _0x31e467=[];var _0x76b4d7=[];var _0xf6805d={};var _0x2a215c=![];return db[_0x154a('0x6c')][_0x154a('0x5d')]()[_0x154a('0x1b')](function(_0x520954){if(!_0x520954){throw new db['Sequelize'][(_0x154a('0x6d'))]('no\x20available\x20attributes');}_0x31e467=_[_0x154a('0x6e')](_[_0x154a('0x3c')](_0x520954),['createdAt',_0x154a('0x6f')]);_0x76b4d7=_[_0x154a('0x6e')](_[_0x154a('0x3c')](_0x520954),[_0x154a('0x70'),_0x154a('0x6f'),'CompanyId',_0x154a('0x71')]);if(_0x30869c[_0x154a('0x56')]['id']){delete _0x30869c['body']['id'];}if(_[_0x154a('0x72')](_0x30869c['body'][_0x154a('0x73')])){throw new db['Sequelize'][(_0x154a('0x6d'))]('from\x20is\x20mandatory');}if(_[_0x154a('0x72')](_0x30869c[_0x154a('0x56')][_0x154a('0x56')])||_0x30869c[_0x154a('0x56')][_0x154a('0x56')]===''){throw new db[(_0x154a('0x74'))][(_0x154a('0x6d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x154a('0x72')](_0x30869c[_0x154a('0x56')][_0x154a('0x75')])){throw new db[(_0x154a('0x74'))][(_0x154a('0x6d'))](_0x154a('0x76')+_0x76b4d7);}if(!_[_0x154a('0x77')](_0x76b4d7,_0x30869c[_0x154a('0x56')][_0x154a('0x75')])){throw new db[(_0x154a('0x74'))][(_0x154a('0x6d'))](_0x154a('0x78')+_0x76b4d7);}_0xf6805d[_0x30869c[_0x154a('0x56')]['mapKey']]=_0x30869c['body'][_0x154a('0x73')];})[_0x154a('0x1b')](function(){return db[_0x154a('0x4c')][_0x154a('0x54')]({'where':{'id':_0x30869c[_0x154a('0x52')]['id']},'include':[{'model':db['CmList'],'as':_0x154a('0x79'),'include':[{'model':db[_0x154a('0x6c')],'as':_0x154a('0x7a'),'where':_0xf6805d,'limit':0x1,'order':[['updatedAt',_0x154a('0x7b')]]}]},{'model':db['OpenchannelApplication'],'as':_0x154a('0x7c')}]});})[_0x154a('0x1b')](handleEntityNotFound(_0x2218bd,null))[_0x154a('0x1b')](function(_0x33435d){if(_0x33435d&&_0x33435d[_0x154a('0x79')]){_0x2d3af2[_0x154a('0x7d')]=_0x33435d;_0x2d3af2[_0x154a('0x7e')]=_0x33435d[_0x154a('0x7c')];_0x2d3af2[_0x154a('0x7f')]=_0x33435d[_0x154a('0x79')];_0x2d3af2[_0x154a('0x7e')]=_[_0x154a('0x80')](_0x2d3af2[_0x154a('0x7e')],[_0x154a('0x81')],[_0x154a('0x82')]);if(_0x2d3af2[_0x154a('0x7d')][_0x154a('0x7c')]){delete _0x2d3af2[_0x154a('0x7d')][_0x154a('0x7c')];}if(_0x2d3af2[_0x154a('0x7d')][_0x154a('0x79')]&&_0x2d3af2['account']['List']['Contacts']['length']){return _0x2d3af2['account'][_0x154a('0x79')][_0x154a('0x7a')][0x0];}var _0xa9fedc=_[_0x154a('0x13')](_0x30869c['body'],{'firstName':_0x30869c[_0x154a('0x56')]['from'],'ListId':_0x33435d['ListId']});_0xa9fedc[_0x30869c[_0x154a('0x56')]['mapKey']]=_0x30869c['body'][_0x154a('0x73')];return db[_0x154a('0x6c')]['create'](_0xa9fedc,{'fields':_0x31e467,'raw':!![]});}})[_0x154a('0x1b')](handleEntityNotFound(_0x2218bd,null))['then'](function(_0x582f58){_0x2d3af2['contact']=_0x582f58;if(_0x582f58){var _0x47f145={'ContactId':_0x582f58['id'],'OpenchannelAccountId':_0x30869c['params']['id'],'from':(_0x582f58['firstName']||'')+'\x20'+(_0x582f58[_0x154a('0x83')]||'')};var _0x3c164e={'OpenchannelAccountId':_0x30869c[_0x154a('0x52')]['id'],'closed':![]};if(_0x30869c[_0x154a('0x56')]['threadId']){_0x3c164e[_0x154a('0x84')]=_0x30869c[_0x154a('0x56')][_0x154a('0x84')];return db[_0x154a('0x85')][_0x154a('0x54')]({'where':_0x3c164e})['then'](function(_0x1f3ef1){if(_0x1f3ef1){return[_0x1f3ef1,![]];}_0x47f145[_0x154a('0x84')]=_0x30869c[_0x154a('0x56')]['threadId'];_0x47f145[_0x154a('0x86')]=_0x30869c['body']['externalUrl'];return db[_0x154a('0x85')]['create'](_0x47f145)[_0x154a('0x1b')](function(_0x11eef9){return[_0x11eef9,!![]];});});}else{_0x3c164e[_0x154a('0x84')]=null;}_0x3c164e[_0x154a('0x87')]=_0x582f58['id'];return db[_0x154a('0x85')][_0x154a('0x54')]({'where':_0x3c164e})[_0x154a('0x1b')](function(_0x44bcb3){if(_0x44bcb3){return[_0x44bcb3,![]];}return db[_0x154a('0x85')]['create'](_0x47f145)['then'](function(_0x4eebca){return[_0x4eebca,!![]];});});}})['spread'](function(_0x18dda0,_0x1bf97b){if(_0x18dda0){_0x2a215c=_0x1bf97b;if(!_0x1bf97b){var _0x26d3e8={'from':(_0x2d3af2[_0x154a('0x88')][_0x154a('0x89')]||'')+'\x20'+(_0x2d3af2[_0x154a('0x88')][_0x154a('0x83')]||'')};if(_0x30869c[_0x154a('0x56')][_0x154a('0x84')]&&_0x30869c[_0x154a('0x56')][_0x154a('0x8a')]&&_0x30869c[_0x154a('0x56')][_0x154a('0x84')]!=_0x30869c[_0x154a('0x56')][_0x154a('0x8a')]){_0x26d3e8[_0x154a('0x84')]=_0x30869c[_0x154a('0x56')][_0x154a('0x8a')];}return _0x18dda0[_0x154a('0x5c')](_0x26d3e8);}else{return _0x18dda0;}}})['then'](function(_0x42f3a9){_0x2d3af2[_0x154a('0x8b')]=_0x42f3a9[_0x154a('0x2f')]({'plain':!![]});_0x2d3af2[_0x154a('0x8b')][_0x154a('0x8c')]=_0x2a215c;if(_0x2d3af2[_0x154a('0x8b')][_0x154a('0x8c')]){if(_0x2d3af2[_0x154a('0x7d')][_0x154a('0x8d')]){_0x2d3af2[_0x154a('0x7e')][_0x154a('0x8e')]({'id':0x0,'priority':_0x2d3af2[_0x154a('0x7e')][_0x154a('0x53')]+0x1,'app':_0x154a('0x8f'),'appdata':'unmanaged','interval':_0x154a('0x90')});}}return db[_0x154a('0x91')][_0x154a('0x55')]({'body':_0x30869c[_0x154a('0x56')]['body'],'OpenchannelAccountId':_0x30869c[_0x154a('0x52')]['id'],'OpenchannelInteractionId':_0x42f3a9['id'],'direction':'in','ContactId':_0x2d3af2[_0x154a('0x88')]['id'],'AttachmentId':_0x30869c[_0x154a('0x56')][_0x154a('0x92')]});})[_0x154a('0x1b')](function(_0x28b9d9){_0x2d3af2[_0x154a('0x21')]=_0x28b9d9;if(_0x2d3af2[_0x154a('0x8b')][_0x154a('0x93')]){return db[_0x154a('0x94')]['find']({'attributes':['id',_0x154a('0x33')],'where':{'id':_0x2d3af2[_0x154a('0x8b')][_0x154a('0x93')]}})[_0x154a('0x1b')](function(_0x14dbfa){if(_0x14dbfa){_0x2d3af2[_0x154a('0x7e')][_0x154a('0x95')]({'id':0x0,'priority':0x0,'app':_0x154a('0x96'),'appdata':_0x14dbfa['name']+','+(_0x2d3af2[_0x154a('0x7d')][_0x154a('0x97')]||0xa),'interval':_0x154a('0x90')});_0x2d3af2['forcedOwnership']=![];}return respondWithRpcPromise(_0x154a('0x98'),_0x154a('0x99'),_0x2d3af2);});}return respondWithRpcPromise(_0x154a('0x98'),_0x154a('0x99'),_0x2d3af2);})[_0x154a('0x1b')](function(_0x383044){respondWithRpcPromise(_0x154a('0x9a'),_0x154a('0x9a'),{'event':'notify','message':_0x383044},client9002);return _0x383044;})[_0x154a('0x1b')](respondWithResult(_0x2218bd,null))[_0x154a('0x50')](handleError(_0x2218bd,null));};exports[_0x154a('0x9b')]=function(_0x1ea2f3,_0x3d9bc0){var _0x42f1d7=_0x1ea2f3[_0x154a('0x52')]['id'];var _0x2b68b3=_0x1ea2f3[_0x154a('0x56')];var _0x38c56e=0xc8;var _0x18bf02=null;return db['sequelize'][_0x154a('0x9c')]({'isolationLevel':db[_0x154a('0x9d')][_0x154a('0x9e')][_0x154a('0x9f')]['READ_COMMITTED']},function(_0xfbc25f){return db[_0x154a('0x4c')][_0x154a('0x60')]({'where':{'id':_0x42f1d7},'transaction':_0xfbc25f})[_0x154a('0x1b')](function(_0x984031){if(_0x984031){return db[_0x154a('0xa0')][_0x154a('0x2e')]({'where':{'OpenchannelAccountId':_0x42f1d7},'transaction':_0xfbc25f})[_0x154a('0x1b')](function(){var _0x113c1d=_['map'](_0x2b68b3,function(_0x2dbeb0){_0x2dbeb0[_0x154a('0x5f')]=_0x42f1d7;return _0x2dbeb0;});return db[_0x154a('0xa0')][_0x154a('0xa1')](_0x113c1d,{'transaction':_0xfbc25f});});}else{_0x38c56e=0x194;_0x18bf02=[];}});})[_0x154a('0x1b')](function(){if(_0x38c56e!==0x194){return db[_0x154a('0xa0')][_0x154a('0xa2')]({'where':{'OpenchannelAccountId':_0x42f1d7},'order':_0x154a('0x81')})['then'](function(_0x4730b9){_0x18bf02=_0x4730b9;});}})[_0x154a('0x50')](function(_0x1fdd0f){_0x38c56e=0x1f4;logger[_0x154a('0x1f')](_0x1fdd0f[_0x154a('0xa3')]);if(_0x1fdd0f[_0x154a('0x33')]){delete _0x1fdd0f[_0x154a('0x33')];}_0x18bf02=_0x1fdd0f;})['finally'](function(){if(_0x18bf02===null){_0x3d9bc0[_0x154a('0x23')](_0x38c56e);}else{if(_0x38c56e===0x1f4){_0x3d9bc0[_0x154a('0x24')](_0x38c56e)[_0x154a('0x34')](_0x18bf02);}else{_0x3d9bc0['status'](_0x38c56e)[_0x154a('0x25')](_0x18bf02);}}});};exports[_0x154a('0xa4')]=function(_0x2e6fe1,_0x125093,_0x3480fc){var _0x54ecec={};var _0x2f1a41={};var _0x7a9bf7;var _0x1aec11;return db[_0x154a('0x4c')]['findOne']({'where':{'id':_0x2e6fe1[_0x154a('0x52')]['id']}})[_0x154a('0x1b')](handleEntityNotFound(_0x125093,null))[_0x154a('0x1b')](function(_0x4b35e7){if(_0x4b35e7){_0x7a9bf7=_0x4b35e7;_0x2f1a41[_0x154a('0x3a')]=_[_0x154a('0x3c')](db[_0x154a('0xa0')][_0x154a('0x38')]);_0x2f1a41['query']=_[_0x154a('0x3c')](_0x2e6fe1['query']);_0x2f1a41[_0x154a('0x3e')]=_[_0x154a('0x3f')](_0x2f1a41[_0x154a('0x3a')],_0x2f1a41['query']);_0x54ecec[_0x154a('0x40')]=_['intersection'](_0x2f1a41[_0x154a('0x3a')],qs[_0x154a('0x41')](_0x2e6fe1['query']['fields']));_0x54ecec[_0x154a('0x40')]=_0x54ecec['attributes']['length']?_0x54ecec[_0x154a('0x40')]:_0x2f1a41[_0x154a('0x3a')];_0x54ecec[_0x154a('0x43')]=qs[_0x154a('0x44')](_0x2e6fe1[_0x154a('0x3d')][_0x154a('0x44')]);_0x54ecec[_0x154a('0x45')]=qs[_0x154a('0x3e')](_['pick'](_0x2e6fe1[_0x154a('0x3d')],_0x2f1a41['filters']));if(_0x2e6fe1[_0x154a('0x3d')][_0x154a('0x4a')]){_0x54ecec[_0x154a('0x45')]=_[_0x154a('0x47')](_0x54ecec[_0x154a('0x45')],{'$or':_[_0x154a('0x3b')](_0x54ecec[_0x154a('0x40')],function(_0x30778f){var _0x108538={};_0x108538[_0x30778f]={'$like':'%'+_0x2e6fe1['query'][_0x154a('0x4a')]+'%'};return _0x108538;})});}_0x54ecec=_['merge']({},_0x54ecec,_0x2e6fe1[_0x154a('0x4b')]);return _0x7a9bf7['getApplications'](_0x54ecec);}})['then'](function(_0x2ab936){if(_0x2ab936){_0x1aec11=_0x2ab936['length'];if(!_0x2e6fe1[_0x154a('0x3d')][_0x154a('0x42')]('nolimit')){_0x54ecec['limit']=qs[_0x154a('0x28')](_0x2e6fe1[_0x154a('0x3d')][_0x154a('0x28')]);_0x54ecec[_0x154a('0x26')]=qs[_0x154a('0x26')](_0x2e6fe1[_0x154a('0x3d')]['offset']);}return _0x7a9bf7[_0x154a('0xa4')](_0x54ecec);}})[_0x154a('0x1b')](function(_0x450263){if(_0x450263){return _0x450263?{'count':_0x1aec11,'rows':_0x450263}:null;}})[_0x154a('0x1b')](respondWithResult(_0x125093,null))[_0x154a('0x50')](handleError(_0x125093,null));};exports[_0x154a('0xa5')]=function(_0x30519a,_0x4197d0,_0x5d89b0){var _0x364ac1={'raw':![],'where':{}};var _0x232da3={};var _0x33b6bb={'count':0x0,'rows':[]};return db[_0x154a('0x4c')]['findOne']({'where':{'id':_0x30519a['params']['id']}})[_0x154a('0x1b')](handleEntityNotFound(_0x4197d0,null))[_0x154a('0x1b')](function(_0x426f20){if(_0x426f20){_0x232da3[_0x154a('0x3a')]=_['keys'](db[_0x154a('0x85')][_0x154a('0x38')]);_0x232da3[_0x154a('0x3d')]=_[_0x154a('0x3c')](_0x30519a[_0x154a('0x3d')]);_0x232da3[_0x154a('0x3e')]=_[_0x154a('0x3f')](_0x232da3[_0x154a('0x3a')],_0x232da3[_0x154a('0x3d')]);_0x364ac1[_0x154a('0x40')]=_[_0x154a('0x3f')](_0x232da3[_0x154a('0x3a')],qs[_0x154a('0x41')](_0x30519a[_0x154a('0x3d')][_0x154a('0x41')]));_0x364ac1[_0x154a('0x40')]=_0x364ac1[_0x154a('0x40')][_0x154a('0x53')]?_0x364ac1[_0x154a('0x40')]:_0x232da3[_0x154a('0x3a')];if(!_0x30519a['query'][_0x154a('0x42')]('nolimit')){_0x364ac1[_0x154a('0x28')]=qs['limit'](_0x30519a['query'][_0x154a('0x28')]);_0x364ac1[_0x154a('0x26')]=qs['offset'](_0x30519a[_0x154a('0x3d')]['offset']);}_0x364ac1[_0x154a('0x43')]=qs[_0x154a('0x44')](_0x30519a[_0x154a('0x3d')]['sort']);_0x364ac1[_0x154a('0x45')]=qs['filters'](_['pick'](_0x30519a[_0x154a('0x3d')],_0x232da3[_0x154a('0x3e')]));_0x364ac1[_0x154a('0x45')][_0x154a('0x5f')]=_0x426f20['id'];if(_0x30519a['query'][_0x154a('0x4a')]){_0x364ac1[_0x154a('0x45')]=_['merge'](_0x364ac1[_0x154a('0x45')],{'$or':_['map'](_0x364ac1[_0x154a('0x40')],function(_0x271f4c){var _0x3cc7d6={};_0x3cc7d6[_0x271f4c]={'$like':'%'+_0x30519a[_0x154a('0x3d')][_0x154a('0x4a')]+'%'};return _0x3cc7d6;})});}_0x364ac1=_[_0x154a('0x47')]({},_0x364ac1,_0x30519a[_0x154a('0x4b')]);return db[_0x154a('0x85')]['count']({'where':_0x364ac1[_0x154a('0x45')]})[_0x154a('0x1b')](function(_0x49b3d0){_0x33b6bb[_0x154a('0x29')]=_0x49b3d0;if(_0x30519a[_0x154a('0x3d')][_0x154a('0x4d')]){_0x364ac1['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x154a('0x94')],'as':_0x154a('0xa6'),'attributes':['name','fullname',_0x154a('0xa7')],'required':![]},{'model':db[_0x154a('0xa8')],'as':_0x154a('0xa9'),'attributes':['id','name',_0x154a('0xaa')],'where':_0x30519a[_0x154a('0x3d')][_0x154a('0xab')]?{'id':_0x30519a[_0x154a('0x3d')]['tag']}:undefined,'required':_0x30519a['query'][_0x154a('0xab')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x364ac1);})['then'](function(_0x8db36b){_0x33b6bb[_0x154a('0x4f')]=_0x8db36b;return _0x33b6bb;});}})[_0x154a('0x1b')](respondWithFilteredResult(_0x4197d0,_0x364ac1))[_0x154a('0x50')](handleError(_0x4197d0,null));};exports[_0x154a('0xac')]=function(_0x1d3008,_0x181ef6,_0x3c1b5c){return db[_0x154a('0x4c')][_0x154a('0x54')]({'where':{'id':_0x1d3008['params']['id']}})[_0x154a('0x1b')](handleEntityNotFound(_0x181ef6,null))['then'](function(_0x1d7d0d){if(_0x1d7d0d){return _0x1d7d0d[_0x154a('0xac')](_0x1d3008['body']['ids'],_[_0x154a('0xad')](_0x1d3008[_0x154a('0x56')],['ids','id'])||{})[_0x154a('0xae')](function(_0x471102){for(var _0x11819a=0x0;_0x11819a<_0x1d3008[_0x154a('0x56')][_0x154a('0x65')][_0x154a('0x53')];_0x11819a+=0x1){socket[_0x154a('0xaf')]('userOpenchannelAccount:save',{'UserId':Number(_0x1d3008[_0x154a('0x56')][_0x154a('0x65')][_0x11819a]),'OpenchannelAccountId':Number(_0x1d3008[_0x154a('0x52')]['id'])});}return _0x471102;});}})[_0x154a('0x1b')](respondWithResult(_0x181ef6,null))['catch'](handleError(_0x181ef6,null));};exports[_0x154a('0xb0')]=function(_0x2b51e1,_0x46cc4d,_0x5e471d){return db[_0x154a('0x4c')][_0x154a('0x54')]({'where':{'id':_0x2b51e1[_0x154a('0x52')]['id']}})[_0x154a('0x1b')](handleEntityNotFound(_0x46cc4d,null))[_0x154a('0x1b')](function(_0x113a28){if(_0x113a28){return _0x113a28[_0x154a('0xb0')](_0x2b51e1[_0x154a('0x3d')][_0x154a('0x65')])['then'](function(){if(_[_0x154a('0xb1')](_0x2b51e1[_0x154a('0x3d')]['ids'])){for(var _0x528ce5=0x0;_0x528ce5<_0x2b51e1[_0x154a('0x3d')][_0x154a('0x65')][_0x154a('0x53')];_0x528ce5+=0x1){socket[_0x154a('0xaf')](_0x154a('0xb2'),{'UserId':Number(_0x2b51e1[_0x154a('0x3d')][_0x154a('0x65')][_0x528ce5]),'OpenchannelAccountId':Number(_0x2b51e1[_0x154a('0x52')]['id'])});}}else{socket[_0x154a('0xaf')](_0x154a('0xb2'),{'UserId':Number(_0x2b51e1[_0x154a('0x3d')][_0x154a('0x65')]),'OpenchannelAccountId':Number(_0x2b51e1['params']['id'])});}});}})[_0x154a('0x1b')](respondWithStatusCode(_0x46cc4d,null))['catch'](handleError(_0x46cc4d,null));};exports['getAgents']=function(_0x25b65d,_0x494459,_0x20dcc8){var _0x10ca6b={};var _0x24f4cb={};var _0x5b9390;var _0x123172;return db['OpenchannelAccount'][_0x154a('0x60')]({'where':{'id':_0x25b65d[_0x154a('0x52')]['id']}})[_0x154a('0x1b')](handleEntityNotFound(_0x494459,null))[_0x154a('0x1b')](function(_0x1789c8){if(_0x1789c8){_0x5b9390=_0x1789c8;_0x24f4cb['model']=_[_0x154a('0x3c')](db[_0x154a('0x94')][_0x154a('0x38')]);_0x24f4cb[_0x154a('0x3d')]=_[_0x154a('0x3c')](_0x25b65d[_0x154a('0x3d')]);_0x24f4cb[_0x154a('0x3e')]=_[_0x154a('0x3f')](_0x24f4cb[_0x154a('0x3a')],_0x24f4cb[_0x154a('0x3d')]);_0x10ca6b[_0x154a('0x40')]=_[_0x154a('0x3f')](_0x24f4cb['model'],qs[_0x154a('0x41')](_0x25b65d[_0x154a('0x3d')][_0x154a('0x41')]));_0x10ca6b[_0x154a('0x40')]=_0x10ca6b['attributes'][_0x154a('0x53')]?_0x10ca6b[_0x154a('0x40')]:_0x24f4cb[_0x154a('0x3a')];_0x10ca6b['order']=qs[_0x154a('0x44')](_0x25b65d[_0x154a('0x3d')]['sort']);_0x10ca6b[_0x154a('0x45')]=qs['filters'](_['pick'](_0x25b65d[_0x154a('0x3d')],_0x24f4cb[_0x154a('0x3e')]));if(_0x25b65d[_0x154a('0x3d')][_0x154a('0x4a')]){_0x10ca6b[_0x154a('0x45')]=_['merge'](_0x10ca6b[_0x154a('0x45')],{'$or':_[_0x154a('0x3b')](_0x10ca6b[_0x154a('0x40')],function(_0x5dbda4){var _0x4c67f7={};_0x4c67f7[_0x5dbda4]={'$like':'%'+_0x25b65d[_0x154a('0x3d')][_0x154a('0x4a')]+'%'};return _0x4c67f7;})});}_0x10ca6b=_[_0x154a('0x47')]({},_0x10ca6b,_0x25b65d[_0x154a('0x4b')]);return _0x5b9390[_0x154a('0xb3')](_0x10ca6b);}})[_0x154a('0x1b')](function(_0x2838b2){if(_0x2838b2){_0x123172=_0x2838b2[_0x154a('0x53')];if(!_0x25b65d[_0x154a('0x3d')][_0x154a('0x42')]('nolimit')){_0x10ca6b['limit']=qs[_0x154a('0x28')](_0x25b65d[_0x154a('0x3d')]['limit']);_0x10ca6b[_0x154a('0x26')]=qs[_0x154a('0x26')](_0x25b65d[_0x154a('0x3d')][_0x154a('0x26')]);}return _0x5b9390['getAgents'](_0x10ca6b);}})[_0x154a('0x1b')](function(_0x3d1714){if(_0x3d1714){return _0x3d1714?{'count':_0x123172,'rows':_0x3d1714}:null;}})['then'](respondWithResult(_0x494459,null))[_0x154a('0x50')](handleError(_0x494459,null));};exports[_0x154a('0x34')]=function(_0x390c83,_0x879f93,_0x543435){var _0x3fb8ca,_0x33c618,_0x3f16b0;if(_['isNil'](_0x390c83[_0x154a('0x56')][_0x154a('0x56')])||_0x390c83[_0x154a('0x56')]['body']===''){throw new db[(_0x154a('0x74'))][(_0x154a('0x6d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x154a('0x72')](_0x390c83['body']['to'])){}_0x3fb8ca=_0x390c83[_0x154a('0x56')]['to'];return db['OpenchannelAccount'][_0x154a('0x60')]({'where':{'id':_0x390c83[_0x154a('0x52')]['id']}})[_0x154a('0x1b')](handleEntityNotFound(_0x879f93,null))[_0x154a('0x1b')](function(_0x19095d){if(_0x19095d){return db['OpenchannelAccount'][_0x154a('0x54')]({'where':{'id':_0x19095d['id']},'include':[{'model':db[_0x154a('0xb4')],'as':_0x154a('0x79'),'include':[{'model':db[_0x154a('0x6c')],'as':'Contacts','where':{[_0x19095d[_0x154a('0x75')]]:_0x3fb8ca},'limit':0x1,'order':[[_0x154a('0x6f'),'DESC']]}]}]})[_0x154a('0x1b')](handleEntityNotFound(_0x879f93,null))[_0x154a('0x1b')](function(_0x3456d6){if(_0x3456d6&&_0x3456d6[_0x154a('0x79')]){_0x33c618=_0x3456d6[_0x154a('0x2f')]({'plain':!![]});if(_0x33c618[_0x154a('0x79')]&&_0x33c618[_0x154a('0x79')]['Contacts']['length']){return _0x33c618[_0x154a('0x79')][_0x154a('0x7a')][0x0];}return db[_0x154a('0x6c')]['create'](_[_0x154a('0x13')](_0x390c83[_0x154a('0x56')],{'firstName':_0x3fb8ca,[_0x3456d6[_0x154a('0x75')]]:_0x3fb8ca,'phone':_0x3fb8ca,'ListId':_0x33c618[_0x154a('0x71')]}));}})[_0x154a('0x1b')](handleEntityNotFound(_0x879f93,null))['then'](function(_0x35765b){if(_0x35765b){_0x3f16b0=_0x35765b;return db[_0x154a('0x85')][_0x154a('0x54')]({'where':{'ContactId':_0x3f16b0['id'],'closed':![],'OpenchannelAccountId':_0x33c618['id']}})[_0x154a('0x1b')](function(_0x1e1f4f){if(_0x1e1f4f){return[_0x1e1f4f,![]];}return db[_0x154a('0x85')]['create']({'UserId':_0x390c83[_0x154a('0x57')]['id'],'ContactId':_0x3f16b0['id'],'OpenchannelAccountId':_0x33c618['id'],'lastMsgDirection':_0x154a('0xb5'),'firstMsgDirection':_0x154a('0xb5'),'Messages':[_[_0x154a('0x47')](_0x390c83[_0x154a('0x56')],{'read':![],'body':_0x390c83['body'][_0x154a('0x56')],'OpenchannelAccountId':_0x33c618['id'],'UserId':_0x390c83[_0x154a('0x57')]['id'],'ContactId':_0x3f16b0['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x154a('0xb6')}]})[_0x154a('0x1b')](function(_0x48c1db){return[_0x48c1db,!![]];});});}})[_0x154a('0xae')](function(_0x9ea7d4,_0xffd8f7){if(_0xffd8f7){return _0x9ea7d4;}return db[_0x154a('0x91')]['create'](_[_0x154a('0x47')](_0x390c83['body'],{'read':![],'body':_0x390c83['body']['body'],'OpenchannelAccountId':_0x33c618['id'],'OpenchannelInteractionId':_0x9ea7d4['id'],'UserId':_0x390c83[_0x154a('0x57')]['id'],'ContactId':_0x3f16b0['id']}))[_0x154a('0x1b')](function(_0xf2bc01){_0x9ea7d4[_0x154a('0xb7')]['Messages']=[];_0x9ea7d4[_0x154a('0xb7')][_0x154a('0xb6')][_0x154a('0x8e')](_0xf2bc01[_0x154a('0xb7')]);return _0x9ea7d4;});});}})[_0x154a('0x1b')](respondWithResult(_0x879f93,null))[_0x154a('0x50')](handleError(_0x879f93,null));};
\ No newline at end of file
index 8a5461f..6d87223 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb688=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x3746fe,_0x30b6b0){var _0xb3093d=function(_0x424b01){while(--_0x424b01){_0x3746fe['push'](_0x3746fe['shift']());}};_0xb3093d(++_0x30b6b0);}(_0xb688,0xcf));var _0x8b68=function(_0x2d7a8b,_0x3802db){_0x2d7a8b=_0x2d7a8b-0x0;var _0x23ce09=_0xb688[_0x2d7a8b];return _0x23ce09;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x8b68('0x0'))['db'][_0x8b68('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8b68('0x2')](0x0);var events={'afterCreate':_0x8b68('0x3'),'afterUpdate':_0x8b68('0x4'),'afterDestroy':_0x8b68('0x5')};function emitEvent(_0x4e281c){return function(_0x41030e,_0x27925d,_0x30f33d){OpenchannelAccountEvents[_0x8b68('0x6')](_0x4e281c+':'+_0x41030e['id'],_0x41030e);OpenchannelAccountEvents['emit'](_0x4e281c,_0x41030e);_0x30f33d(null);};}for(var e in events){if(events[_0x8b68('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x8b68('0x8')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x99e9=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1470f8,_0x2d6a3c){var _0xf2ef8e=function(_0x504226){while(--_0x504226){_0x1470f8['push'](_0x1470f8['shift']());}};_0xf2ef8e(++_0x2d6a3c);}(_0x99e9,0xb4));var _0x999e=function(_0x5338fe,_0x5e71d1){_0x5338fe=_0x5338fe-0x0;var _0xf0a1be=_0x99e9[_0x5338fe];return _0xf0a1be;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x999e('0x0'))['db'][_0x999e('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x999e('0x2')](0x0);var events={'afterCreate':_0x999e('0x3'),'afterUpdate':'update','afterDestroy':_0x999e('0x4')};function emitEvent(_0x2f803e){return function(_0x3aac27,_0x4e2112,_0x296411){OpenchannelAccountEvents['emit'](_0x2f803e+':'+_0x3aac27['id'],_0x3aac27);OpenchannelAccountEvents[_0x999e('0x5')](_0x2f803e,_0x3aac27);_0x296411(null);};}for(var e in events){if(events[_0x999e('0x6')](e)){var event=events[e];OpenchannelAccount[_0x999e('0x7')](e,emitEvent(event));}}module[_0x999e('0x8')]=OpenchannelAccountEvents;
\ No newline at end of file
index 13da58c..1735305 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(_0x2592cb,_0x320d06){var _0x490886=function(_0x1fed12){while(--_0x1fed12){_0x2592cb['push'](_0x2592cb['shift']());}};_0x490886(++_0x320d06);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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(_0x521188,_0x51bb41){var _0x55d050=function(_0x53c1c0){while(--_0x53c1c0){_0x521188['push'](_0x521188['shift']());}};_0x55d050(++_0x51bb41);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 ab99090..3bc1277 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e6c=['OpenchannelAccount,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x22ffbd,_0xc7722a){var _0x4888cd=function(_0x2dfb0b){while(--_0x2dfb0b){_0x22ffbd['push'](_0x22ffbd['shift']());}};_0x4888cd(++_0xc7722a);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var moment=require('moment');var BPromise=require(_0xc6e6('0x2'));var rs=require(_0xc6e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc6e6('0x4'));var logger=require('../../config/logger')(_0xc6e6('0x5'));var config=require('../../config/environment');var jayson=require(_0xc6e6('0x6'));var client=jayson[_0xc6e6('0x7')]['http']({'port':0x232a});config[_0xc6e6('0x8')]=_[_0xc6e6('0x9')](config['redis'],{'host':_0xc6e6('0xa'),'port':0x18eb});var socket=require(_0xc6e6('0xb'))(new Redis(config['redis']));require(_0xc6e6('0xc'))['register'](socket);function respondWithRpcPromise(_0x172aa9,_0x3b2f50,_0x29f78a){return new BPromise(function(_0x3ddf6f,_0x12596b){return client[_0xc6e6('0xd')](_0x172aa9,_0x29f78a)[_0xc6e6('0xe')](function(_0x10aae5){logger[_0xc6e6('0xf')]('OpenchannelAccount,\x20%s,\x20%s',_0x3b2f50,_0xc6e6('0x10'));logger['debug'](_0xc6e6('0x11'),_0x3b2f50,_0xc6e6('0x10'),JSON[_0xc6e6('0x12')](_0x10aae5));if(_0x10aae5[_0xc6e6('0x13')]){if(_0x10aae5['error'][_0xc6e6('0x14')]===0x1f4){logger[_0xc6e6('0x13')](_0xc6e6('0x15'),_0x3b2f50,_0x10aae5[_0xc6e6('0x13')][_0xc6e6('0x16')]);return _0x12596b(_0x10aae5['error'][_0xc6e6('0x16')]);}logger[_0xc6e6('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x3b2f50,_0x10aae5[_0xc6e6('0x13')][_0xc6e6('0x16')]);return _0x3ddf6f(_0x10aae5[_0xc6e6('0x13')]['message']);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x3b2f50,_0xc6e6('0x10'));_0x3ddf6f(_0x10aae5['result'][_0xc6e6('0x16')]);}})[_0xc6e6('0x17')](function(_0x1ecc8f){logger[_0xc6e6('0x13')](_0xc6e6('0x15'),_0x3b2f50,_0x1ecc8f);_0x12596b(_0x1ecc8f);});});}
\ No newline at end of file
+var _0x36ee=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','randomstring'];(function(_0x2a647a,_0x205bca){var _0x3cfa1d=function(_0xbda138){while(--_0xbda138){_0x2a647a['push'](_0x2a647a['shift']());}};_0x3cfa1d(++_0x205bca);}(_0x36ee,0xe8));var _0xe36e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x36ee[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe36e('0x1'));var fs=require('fs');var Redis=require(_0xe36e('0x2'));var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var jayson=require(_0xe36e('0x8'));var client=jayson[_0xe36e('0x9')][_0xe36e('0xa')]({'port':0x232a});config[_0xe36e('0xb')]=_[_0xe36e('0xc')](config['redis'],{'host':_0xe36e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe36e('0xb')]));require(_0xe36e('0xe'))[_0xe36e('0xf')](socket);function respondWithRpcPromise(_0x47ce3a,_0xf119e4,_0x48981b){return new BPromise(function(_0x2e968d,_0x2133cf){return client[_0xe36e('0x10')](_0x47ce3a,_0x48981b)[_0xe36e('0x11')](function(_0xce0110){logger[_0xe36e('0x12')](_0xe36e('0x13'),_0xf119e4,_0xe36e('0x14'));logger['debug'](_0xe36e('0x15'),_0xf119e4,_0xe36e('0x14'),JSON[_0xe36e('0x16')](_0xce0110));if(_0xce0110[_0xe36e('0x17')]){if(_0xce0110['error'][_0xe36e('0x18')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0xf119e4,_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);return _0x2133cf(_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);}logger[_0xe36e('0x17')](_0xe36e('0x13'),_0xf119e4,_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);return _0x2e968d(_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);}else{logger['info'](_0xe36e('0x13'),_0xf119e4,_0xe36e('0x14'));_0x2e968d(_0xce0110['result'][_0xe36e('0x19')]);}})['catch'](function(_0x471400){logger[_0xe36e('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0xf119e4,_0x471400);_0x2133cf(_0x471400);});});}
\ No newline at end of file
index 25e1d62..03c098b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57f8=['save','remove','update','emit','removeListener','register','length','openchannelAccount:'];(function(_0x459d2e,_0x2544ea){var _0x1c6f90=function(_0x3cfa67){while(--_0x3cfa67){_0x459d2e['push'](_0x459d2e['shift']());}};_0x1c6f90(++_0x2544ea);}(_0x57f8,0x198));var _0x857f=function(_0x21cd08,_0x16cd11){_0x21cd08=_0x21cd08-0x0;var _0x1d77ba=_0x57f8[_0x21cd08];return _0x1d77ba;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x857f('0x0'),_0x857f('0x1'),_0x857f('0x2')];function createListener(_0x3c0125,_0x238445){return function(_0x27b98d){_0x238445[_0x857f('0x3')](_0x3c0125,_0x27b98d);};}function removeListener(_0x6f054b,_0x318050){return function(){OpenchannelAccountEvents[_0x857f('0x4')](_0x6f054b,_0x318050);};}exports[_0x857f('0x5')]=function(_0x369c40){for(var _0x5d22e4=0x0,_0x8380e8=events[_0x857f('0x6')];_0x5d22e4<_0x8380e8;_0x5d22e4++){var _0x1aaeea=events[_0x5d22e4];var _0x577fc3=createListener(_0x857f('0x7')+_0x1aaeea,_0x369c40);OpenchannelAccountEvents['on'](_0x1aaeea,_0x577fc3);}};
\ No newline at end of file
+var _0xb43b=['register','openchannelAccount:','./openchannelAccount.events','remove','update','emit','removeListener'];(function(_0x3da727,_0x6dadfe){var _0x33f500=function(_0x3c88b0){while(--_0x3c88b0){_0x3da727['push'](_0x3da727['shift']());}};_0x33f500(++_0x6dadfe);}(_0xb43b,0xbf));var _0xbb43=function(_0x12325c,_0x4fa78d){_0x12325c=_0x12325c-0x0;var _0x1f8bcd=_0xb43b[_0x12325c];return _0x1f8bcd;};'use strict';var OpenchannelAccountEvents=require(_0xbb43('0x0'));var events=['save',_0xbb43('0x1'),_0xbb43('0x2')];function createListener(_0x831f09,_0x293836){return function(_0x11e19e){_0x293836[_0xbb43('0x3')](_0x831f09,_0x11e19e);};}function removeListener(_0x2e9c09,_0x25f690){return function(){OpenchannelAccountEvents[_0xbb43('0x4')](_0x2e9c09,_0x25f690);};}exports[_0xbb43('0x5')]=function(_0x2e55f3){for(var _0x51e44e=0x0,_0x16fc1c=events['length'];_0x51e44e<_0x16fc1c;_0x51e44e++){var _0x54806a=events[_0x51e44e];var _0x33f9a8=createListener(_0xbb43('0x6')+_0x54806a,_0x2e55f3);OpenchannelAccountEvents['on'](_0x54806a,_0x33f9a8);}};
\ No newline at end of file
index 06fdd28..d177242 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7448=['update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0xf27833,_0x3b7458){var _0x160826=function(_0x4aaeac){while(--_0x4aaeac){_0xf27833['push'](_0xf27833['shift']());}};_0x160826(++_0x3b7458);}(_0x7448,0xc2));var _0x8744=function(_0xdb0cc5,_0x33653a){_0xdb0cc5=_0xdb0cc5-0x0;var _0x153aa=_0x7448[_0xdb0cc5];return _0x153aa;};'use strict';var multer=require(_0x8744('0x0'));var util=require('util');var path=require(_0x8744('0x1'));var timeout=require('connect-timeout');var express=require(_0x8744('0x2'));var router=express[_0x8744('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8744('0x4'));var interaction=require(_0x8744('0x5'));var config=require(_0x8744('0x6'));var controller=require(_0x8744('0x7'));router[_0x8744('0x8')]('/',auth[_0x8744('0x9')](),controller[_0x8744('0xa')]);router[_0x8744('0x8')](_0x8744('0xb'),auth[_0x8744('0x9')](),controller[_0x8744('0xc')]);router[_0x8744('0xd')]('/',auth[_0x8744('0x9')](),controller[_0x8744('0xe')]);router['put']('/:id',auth[_0x8744('0x9')](),controller[_0x8744('0xf')]);router[_0x8744('0x10')]('/:id',auth[_0x8744('0x9')](),controller[_0x8744('0x11')]);module[_0x8744('0x12')]=router;
\ No newline at end of file
+var _0x483b=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','destroy','exports','multer','util','path'];(function(_0x5fdd68,_0x1622fe){var _0x43900c=function(_0x3092d8){while(--_0x3092d8){_0x5fdd68['push'](_0x5fdd68['shift']());}};_0x43900c(++_0x1622fe);}(_0x483b,0xb1));var _0xb483=function(_0x57ad5c,_0x569a10){_0x57ad5c=_0x57ad5c-0x0;var _0x5dd58f=_0x483b[_0x57ad5c];return _0x5dd58f;};'use strict';var multer=require(_0xb483('0x0'));var util=require(_0xb483('0x1'));var path=require(_0xb483('0x2'));var timeout=require(_0xb483('0x3'));var express=require(_0xb483('0x4'));var router=express[_0xb483('0x5')]();var fs_extra=require(_0xb483('0x6'));var auth=require(_0xb483('0x7'));var interaction=require(_0xb483('0x8'));var config=require(_0xb483('0x9'));var controller=require(_0xb483('0xa'));router[_0xb483('0xb')]('/',auth[_0xb483('0xc')](),controller[_0xb483('0xd')]);router[_0xb483('0xb')](_0xb483('0xe'),auth[_0xb483('0xc')](),controller[_0xb483('0xf')]);router[_0xb483('0x10')]('/',auth[_0xb483('0xc')](),controller[_0xb483('0x11')]);router['put'](_0xb483('0xe'),auth[_0xb483('0xc')](),controller['update']);router['delete']('/:id',auth[_0xb483('0xc')](),controller[_0xb483('0x12')]);module[_0xb483('0x13')]=router;
\ No newline at end of file
index 3656c0e..a8b11ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7149=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x450749,_0x55f797){var _0x37ea89=function(_0x49e15c){while(--_0x49e15c){_0x450749['push'](_0x450749['shift']());}};_0x37ea89(++_0x55f797);}(_0x7149,0x149));var _0x9714=function(_0x30f19d,_0x3d9341){_0x30f19d=_0x30f19d-0x0;var _0x1c1adf=_0x7149[_0x30f19d];return _0x1c1adf;};'use strict';var Sequelize=require(_0x9714('0x0'));module['exports']={'priority':{'type':Sequelize[_0x9714('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x9714('0x2')],'allowNull':![],'defaultValue':_0x9714('0x3')},'appdata':{'type':Sequelize[_0x9714('0x4')]()},'description':{'type':Sequelize[_0x9714('0x2')]},'interval':{'type':Sequelize[_0x9714('0x2')],'defaultValue':_0x9714('0x5')}};
\ No newline at end of file
+var _0xe294=['sequelize','exports','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0xabd635,_0x557e51){var _0x9f283=function(_0x834238){while(--_0x834238){_0xabd635['push'](_0xabd635['shift']());}};_0x9f283(++_0x557e51);}(_0xe294,0x1da));var _0x4e29=function(_0x5f4531,_0x4bab8e){_0x5f4531=_0x5f4531-0x0;var _0x58c4d6=_0xe294[_0x5f4531];return _0x58c4d6;};'use strict';var Sequelize=require(_0x4e29('0x0'));module[_0x4e29('0x1')]={'priority':{'type':Sequelize[_0x4e29('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4e29('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x4e29('0x4')]()},'description':{'type':Sequelize[_0x4e29('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4e29('0x5')}};
\ No newline at end of file
index 2082d5f..c1d2d06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5893=['fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','OpenchannelApplication','includeAll','include','findAll','rows','catch','show','params','create','body','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x5893,0xd5));var _0x3589=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5893[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3589('0x0'));var jsonpatch=require(_0x3589('0x1'));var rp=require(_0x3589('0x2'));var moment=require(_0x3589('0x3'));var BPromise=require(_0x3589('0x4'));var Mustache=require(_0x3589('0x5'));var util=require(_0x3589('0x6'));var path=require('path');var sox=require(_0x3589('0x7'));var csv=require(_0x3589('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3589('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3589('0xa'));var jsforce=require(_0x3589('0xb'));var deskjs=require(_0x3589('0xc'));var toCsv=require(_0x3589('0x8'));var querystring=require(_0x3589('0xd'));var Papa=require(_0x3589('0xe'));var Redis=require('ioredis');var authService=require(_0x3589('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3589('0x10'));var logger=require(_0x3589('0x11'))(_0x3589('0x12'));var utils=require(_0x3589('0x13'));var config=require(_0x3589('0x14'));var licenseUtil=require(_0x3589('0x15'));var db=require(_0x3589('0x16'))['db'];function respondWithStatusCode(_0x79c159,_0x4f03b4){_0x4f03b4=_0x4f03b4||0xcc;return function(_0x357d95){if(_0x357d95){return _0x79c159[_0x3589('0x17')](_0x4f03b4);}return _0x79c159[_0x3589('0x18')](_0x4f03b4)[_0x3589('0x19')]();};}function respondWithResult(_0x46172d,_0x48d671){_0x48d671=_0x48d671||0xc8;return function(_0x191dd7){if(_0x191dd7){return _0x46172d[_0x3589('0x18')](_0x48d671)[_0x3589('0x1a')](_0x191dd7);}};}function respondWithFilteredResult(_0x112183,_0x48e542){return function(_0x9054a1){if(_0x9054a1){var _0x28c4c8=typeof _0x48e542['offset']==='undefined'&&typeof _0x48e542[_0x3589('0x1b')]===_0x3589('0x1c');var _0x5d8f8b=_0x9054a1['count'];var _0x3066dc=_0x28c4c8?0x0:_0x48e542[_0x3589('0x1d')];var _0x29a4f0=_0x28c4c8?_0x9054a1[_0x3589('0x1e')]:_0x48e542[_0x3589('0x1d')]+_0x48e542[_0x3589('0x1b')];var _0x30dc38;if(_0x29a4f0>=_0x5d8f8b){_0x29a4f0=_0x5d8f8b;_0x30dc38=0xc8;}else{_0x30dc38=0xce;}_0x112183[_0x3589('0x18')](_0x30dc38);return _0x112183['set'](_0x3589('0x1f'),_0x3066dc+'-'+_0x29a4f0+'/'+_0x5d8f8b)['json'](_0x9054a1);}return null;};}function patchUpdates(_0x1a29fe){return function(_0x317ec2){try{jsonpatch[_0x3589('0x20')](_0x317ec2,_0x1a29fe,!![]);}catch(_0x517246){return BPromise['reject'](_0x517246);}return _0x317ec2[_0x3589('0x21')]();};}function saveUpdates(_0x430058,_0x231a65){return function(_0x41005a){if(_0x41005a){return _0x41005a[_0x3589('0x22')](_0x430058)[_0x3589('0x23')](function(_0x33e9){return _0x33e9;});}return null;};}function removeEntity(_0x4d8236,_0x3bd1e0){return function(_0x171dc9){if(_0x171dc9){return _0x171dc9[_0x3589('0x24')]()[_0x3589('0x23')](function(){_0x4d8236['status'](0xcc)[_0x3589('0x19')]();});}};}function handleEntityNotFound(_0x2c60f0,_0x466cb8){return function(_0x533005){if(!_0x533005){_0x2c60f0[_0x3589('0x17')](0x194);}return _0x533005;};}function handleError(_0xd1d49c,_0x2722f2){_0x2722f2=_0x2722f2||0x1f4;return function(_0x950b15){logger[_0x3589('0x25')](_0x950b15[_0x3589('0x26')]);if(_0x950b15[_0x3589('0x27')]){delete _0x950b15[_0x3589('0x27')];}_0xd1d49c[_0x3589('0x18')](_0x2722f2)[_0x3589('0x28')](_0x950b15);};}exports['index']=function(_0x38d469,_0x553bf1){var _0x15dde1={},_0x4be163={},_0x2a7836={'count':0x0,'rows':[]};var _0x4169c7=_[_0x3589('0x29')](db['OpenchannelApplication'][_0x3589('0x2a')],function(_0xdae943){return{'name':_0xdae943['fieldName'],'type':_0xdae943[_0x3589('0x2b')][_0x3589('0x2c')]};});_0x4be163[_0x3589('0x2d')]=_[_0x3589('0x29')](_0x4169c7,'name');_0x4be163[_0x3589('0x2e')]=_[_0x3589('0x2f')](_0x38d469[_0x3589('0x2e')]);_0x4be163['filters']=_[_0x3589('0x30')](_0x4be163['model'],_0x4be163[_0x3589('0x2e')]);_0x15dde1['attributes']=_[_0x3589('0x30')](_0x4be163[_0x3589('0x2d')],qs[_0x3589('0x31')](_0x38d469[_0x3589('0x2e')][_0x3589('0x31')]));_0x15dde1[_0x3589('0x32')]=_0x15dde1[_0x3589('0x32')][_0x3589('0x33')]?_0x15dde1['attributes']:_0x4be163[_0x3589('0x2d')];if(!_0x38d469[_0x3589('0x2e')][_0x3589('0x34')](_0x3589('0x35'))){_0x15dde1[_0x3589('0x1b')]=qs['limit'](_0x38d469['query']['limit']);_0x15dde1['offset']=qs[_0x3589('0x1d')](_0x38d469[_0x3589('0x2e')]['offset']);}_0x15dde1[_0x3589('0x36')]=qs[_0x3589('0x37')](_0x38d469[_0x3589('0x2e')][_0x3589('0x37')]);_0x15dde1[_0x3589('0x38')]=qs['filters'](_[_0x3589('0x39')](_0x38d469['query'],_0x4be163[_0x3589('0x3a')]),_0x4169c7);if(_0x38d469['query'][_0x3589('0x3b')]){_0x15dde1[_0x3589('0x38')]=_[_0x3589('0x3c')](_0x15dde1[_0x3589('0x38')],{'$or':_['map'](_0x4169c7,function(_0x5027de){if(_0x5027de[_0x3589('0x2b')]!==_0x3589('0x3d')){var _0x5b0b3c={};_0x5b0b3c[_0x5027de[_0x3589('0x27')]]={'$like':'%'+_0x38d469['query'][_0x3589('0x3b')]+'%'};return _0x5b0b3c;}})});}_0x15dde1=_[_0x3589('0x3c')]({},_0x15dde1,_0x38d469[_0x3589('0x3e')]);var _0x1c6b7d={'where':_0x15dde1[_0x3589('0x38')]};return db[_0x3589('0x3f')][_0x3589('0x1e')](_0x1c6b7d)[_0x3589('0x23')](function(_0x495c45){_0x2a7836[_0x3589('0x1e')]=_0x495c45;if(_0x38d469[_0x3589('0x2e')][_0x3589('0x40')]){_0x15dde1[_0x3589('0x41')]=[{'all':!![]}];}return db[_0x3589('0x3f')][_0x3589('0x42')](_0x15dde1);})[_0x3589('0x23')](function(_0x1cb7c6){_0x2a7836[_0x3589('0x43')]=_0x1cb7c6;return _0x2a7836;})[_0x3589('0x23')](respondWithFilteredResult(_0x553bf1,_0x15dde1))[_0x3589('0x44')](handleError(_0x553bf1,null));};exports[_0x3589('0x45')]=function(_0x536d58,_0x21d135){var _0x2d82de={'raw':!![],'where':{'id':_0x536d58[_0x3589('0x46')]['id']}},_0x3cfc5d={};_0x3cfc5d[_0x3589('0x2d')]=_[_0x3589('0x2f')](db[_0x3589('0x3f')]['rawAttributes']);_0x3cfc5d[_0x3589('0x2e')]=_[_0x3589('0x2f')](_0x536d58[_0x3589('0x2e')]);_0x3cfc5d['filters']=_[_0x3589('0x30')](_0x3cfc5d[_0x3589('0x2d')],_0x3cfc5d[_0x3589('0x2e')]);_0x2d82de[_0x3589('0x32')]=_[_0x3589('0x30')](_0x3cfc5d[_0x3589('0x2d')],qs[_0x3589('0x31')](_0x536d58[_0x3589('0x2e')][_0x3589('0x31')]));_0x2d82de[_0x3589('0x32')]=_0x2d82de[_0x3589('0x32')][_0x3589('0x33')]?_0x2d82de[_0x3589('0x32')]:_0x3cfc5d[_0x3589('0x2d')];if(_0x536d58[_0x3589('0x2e')][_0x3589('0x40')]){_0x2d82de[_0x3589('0x41')]=[{'all':!![]}];}_0x2d82de=_['merge']({},_0x2d82de,_0x536d58[_0x3589('0x3e')]);return db[_0x3589('0x3f')]['find'](_0x2d82de)['then'](handleEntityNotFound(_0x21d135,null))[_0x3589('0x23')](respondWithResult(_0x21d135,null))[_0x3589('0x44')](handleError(_0x21d135,null));};exports['create']=function(_0x47ea03,_0x593e98){return db[_0x3589('0x3f')][_0x3589('0x47')](_0x47ea03[_0x3589('0x48')],{})[_0x3589('0x23')](respondWithResult(_0x593e98,0xc9))[_0x3589('0x44')](handleError(_0x593e98,null));};exports[_0x3589('0x22')]=function(_0xe445db,_0x225cc6){if(_0xe445db[_0x3589('0x48')]['id']){delete _0xe445db[_0x3589('0x48')]['id'];}return db[_0x3589('0x3f')][_0x3589('0x49')]({'where':{'id':_0xe445db[_0x3589('0x46')]['id']}})['then'](handleEntityNotFound(_0x225cc6,null))[_0x3589('0x23')](saveUpdates(_0xe445db[_0x3589('0x48')],null))[_0x3589('0x23')](respondWithResult(_0x225cc6,null))[_0x3589('0x44')](handleError(_0x225cc6,null));};exports['destroy']=function(_0x34fdc4,_0x2d42a2){return db[_0x3589('0x3f')]['find']({'where':{'id':_0x34fdc4[_0x3589('0x46')]['id']}})[_0x3589('0x23')](handleEntityNotFound(_0x2d42a2,null))[_0x3589('0x23')](removeEntity(_0x2d42a2,null))[_0x3589('0x44')](handleError(_0x2d42a2,null));};
\ No newline at end of file
+var _0xea8e=['sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','then','end','error','stack','name','index','map','OpenchannelApplication','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x545fd0,_0x20f7f8){var _0x2fd180=function(_0x430247){while(--_0x430247){_0x545fd0['push'](_0x545fd0['shift']());}};_0x2fd180(++_0x20f7f8);}(_0xea8e,0x1ee));var _0xeea8=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0xea8e[_0xef8146];return _0x5a6cb0;};'use strict';var emlformat=require(_0xeea8('0x0'));var rimraf=require(_0xeea8('0x1'));var zipdir=require(_0xeea8('0x2'));var jsonpatch=require(_0xeea8('0x3'));var rp=require('request-promise');var moment=require(_0xeea8('0x4'));var BPromise=require(_0xeea8('0x5'));var Mustache=require(_0xeea8('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xeea8('0x7'));var ejs=require(_0xeea8('0x8'));var fs=require('fs');var fs_extra=require(_0xeea8('0x9'));var _=require(_0xeea8('0xa'));var squel=require(_0xeea8('0xb'));var crypto=require(_0xeea8('0xc'));var jsforce=require(_0xeea8('0xd'));var deskjs=require(_0xeea8('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xeea8('0xf'));var Redis=require(_0xeea8('0x10'));var authService=require(_0xeea8('0x11'));var qs=require(_0xeea8('0x12'));var as=require(_0xeea8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeea8('0x14'))('api');var utils=require(_0xeea8('0x15'));var config=require(_0xeea8('0x16'));var licenseUtil=require(_0xeea8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bd8bb,_0x1ffa5e){_0x1ffa5e=_0x1ffa5e||0xcc;return function(_0x49c13f){if(_0x49c13f){return _0x2bd8bb[_0xeea8('0x18')](_0x1ffa5e);}return _0x2bd8bb[_0xeea8('0x19')](_0x1ffa5e)['end']();};}function respondWithResult(_0x36426f,_0x4ff180){_0x4ff180=_0x4ff180||0xc8;return function(_0x32f9d4){if(_0x32f9d4){return _0x36426f[_0xeea8('0x19')](_0x4ff180)[_0xeea8('0x1a')](_0x32f9d4);}};}function respondWithFilteredResult(_0x24ec11,_0x356c5e){return function(_0x1535f4){if(_0x1535f4){var _0x449420=typeof _0x356c5e[_0xeea8('0x1b')]===_0xeea8('0x1c')&&typeof _0x356c5e['limit']==='undefined';var _0x10af72=_0x1535f4[_0xeea8('0x1d')];var _0x468b55=_0x449420?0x0:_0x356c5e[_0xeea8('0x1b')];var _0x172b9a=_0x449420?_0x1535f4[_0xeea8('0x1d')]:_0x356c5e[_0xeea8('0x1b')]+_0x356c5e['limit'];var _0x14d3ac;if(_0x172b9a>=_0x10af72){_0x172b9a=_0x10af72;_0x14d3ac=0xc8;}else{_0x14d3ac=0xce;}_0x24ec11[_0xeea8('0x19')](_0x14d3ac);return _0x24ec11[_0xeea8('0x1e')](_0xeea8('0x1f'),_0x468b55+'-'+_0x172b9a+'/'+_0x10af72)['json'](_0x1535f4);}return null;};}function patchUpdates(_0x43b831){return function(_0x6e5480){try{jsonpatch[_0xeea8('0x20')](_0x6e5480,_0x43b831,!![]);}catch(_0x4348c0){return BPromise[_0xeea8('0x21')](_0x4348c0);}return _0x6e5480['save']();};}function saveUpdates(_0x5565f3,_0x1b166b){return function(_0x40fbc7){if(_0x40fbc7){return _0x40fbc7['update'](_0x5565f3)[_0xeea8('0x22')](function(_0x194199){return _0x194199;});}return null;};}function removeEntity(_0x145cf5,_0x535b7c){return function(_0x49e54e){if(_0x49e54e){return _0x49e54e['destroy']()[_0xeea8('0x22')](function(){_0x145cf5[_0xeea8('0x19')](0xcc)[_0xeea8('0x23')]();});}};}function handleEntityNotFound(_0x18f5f8,_0x47a98c){return function(_0xa3e5b9){if(!_0xa3e5b9){_0x18f5f8['sendStatus'](0x194);}return _0xa3e5b9;};}function handleError(_0x19143c,_0x565751){_0x565751=_0x565751||0x1f4;return function(_0x2f07c5){logger[_0xeea8('0x24')](_0x2f07c5[_0xeea8('0x25')]);if(_0x2f07c5[_0xeea8('0x26')]){delete _0x2f07c5[_0xeea8('0x26')];}_0x19143c[_0xeea8('0x19')](_0x565751)['send'](_0x2f07c5);};}exports[_0xeea8('0x27')]=function(_0xb3123b,_0x7f2a61){var _0x266ccf={},_0x38f5cb={},_0x3869aa={'count':0x0,'rows':[]};var _0x39e33d=_[_0xeea8('0x28')](db[_0xeea8('0x29')]['rawAttributes'],function(_0xea024a){return{'name':_0xea024a[_0xeea8('0x2a')],'type':_0xea024a['type'][_0xeea8('0x2b')]};});_0x38f5cb[_0xeea8('0x2c')]=_[_0xeea8('0x28')](_0x39e33d,_0xeea8('0x26'));_0x38f5cb[_0xeea8('0x2d')]=_[_0xeea8('0x2e')](_0xb3123b[_0xeea8('0x2d')]);_0x38f5cb['filters']=_[_0xeea8('0x2f')](_0x38f5cb[_0xeea8('0x2c')],_0x38f5cb[_0xeea8('0x2d')]);_0x266ccf[_0xeea8('0x30')]=_[_0xeea8('0x2f')](_0x38f5cb[_0xeea8('0x2c')],qs[_0xeea8('0x31')](_0xb3123b[_0xeea8('0x2d')]['fields']));_0x266ccf[_0xeea8('0x30')]=_0x266ccf['attributes'][_0xeea8('0x32')]?_0x266ccf[_0xeea8('0x30')]:_0x38f5cb[_0xeea8('0x2c')];if(!_0xb3123b[_0xeea8('0x2d')][_0xeea8('0x33')](_0xeea8('0x34'))){_0x266ccf[_0xeea8('0x35')]=qs['limit'](_0xb3123b[_0xeea8('0x2d')][_0xeea8('0x35')]);_0x266ccf[_0xeea8('0x1b')]=qs['offset'](_0xb3123b[_0xeea8('0x2d')][_0xeea8('0x1b')]);}_0x266ccf[_0xeea8('0x36')]=qs[_0xeea8('0x37')](_0xb3123b['query'][_0xeea8('0x37')]);_0x266ccf['where']=qs[_0xeea8('0x38')](_[_0xeea8('0x39')](_0xb3123b[_0xeea8('0x2d')],_0x38f5cb[_0xeea8('0x38')]),_0x39e33d);if(_0xb3123b[_0xeea8('0x2d')][_0xeea8('0x3a')]){_0x266ccf[_0xeea8('0x3b')]=_[_0xeea8('0x3c')](_0x266ccf[_0xeea8('0x3b')],{'$or':_[_0xeea8('0x28')](_0x39e33d,function(_0x2a9c6a){if(_0x2a9c6a[_0xeea8('0x3d')]!=='VIRTUAL'){var _0x335fbc={};_0x335fbc[_0x2a9c6a[_0xeea8('0x26')]]={'$like':'%'+_0xb3123b['query'][_0xeea8('0x3a')]+'%'};return _0x335fbc;}})});}_0x266ccf=_[_0xeea8('0x3c')]({},_0x266ccf,_0xb3123b[_0xeea8('0x3e')]);var _0x54d77b={'where':_0x266ccf[_0xeea8('0x3b')]};return db[_0xeea8('0x29')][_0xeea8('0x1d')](_0x54d77b)[_0xeea8('0x22')](function(_0x42f04b){_0x3869aa[_0xeea8('0x1d')]=_0x42f04b;if(_0xb3123b[_0xeea8('0x2d')][_0xeea8('0x3f')]){_0x266ccf[_0xeea8('0x40')]=[{'all':!![]}];}return db[_0xeea8('0x29')][_0xeea8('0x41')](_0x266ccf);})[_0xeea8('0x22')](function(_0x2ef253){_0x3869aa[_0xeea8('0x42')]=_0x2ef253;return _0x3869aa;})[_0xeea8('0x22')](respondWithFilteredResult(_0x7f2a61,_0x266ccf))['catch'](handleError(_0x7f2a61,null));};exports[_0xeea8('0x43')]=function(_0x506488,_0x35485a){var _0x1fb8d2={'raw':!![],'where':{'id':_0x506488[_0xeea8('0x44')]['id']}},_0x9f0c6e={};_0x9f0c6e[_0xeea8('0x2c')]=_['keys'](db[_0xeea8('0x29')]['rawAttributes']);_0x9f0c6e['query']=_['keys'](_0x506488[_0xeea8('0x2d')]);_0x9f0c6e[_0xeea8('0x38')]=_[_0xeea8('0x2f')](_0x9f0c6e[_0xeea8('0x2c')],_0x9f0c6e[_0xeea8('0x2d')]);_0x1fb8d2[_0xeea8('0x30')]=_[_0xeea8('0x2f')](_0x9f0c6e['model'],qs[_0xeea8('0x31')](_0x506488[_0xeea8('0x2d')]['fields']));_0x1fb8d2[_0xeea8('0x30')]=_0x1fb8d2[_0xeea8('0x30')][_0xeea8('0x32')]?_0x1fb8d2[_0xeea8('0x30')]:_0x9f0c6e['model'];if(_0x506488[_0xeea8('0x2d')][_0xeea8('0x3f')]){_0x1fb8d2[_0xeea8('0x40')]=[{'all':!![]}];}_0x1fb8d2=_[_0xeea8('0x3c')]({},_0x1fb8d2,_0x506488[_0xeea8('0x3e')]);return db[_0xeea8('0x29')][_0xeea8('0x45')](_0x1fb8d2)[_0xeea8('0x22')](handleEntityNotFound(_0x35485a,null))['then'](respondWithResult(_0x35485a,null))[_0xeea8('0x46')](handleError(_0x35485a,null));};exports['create']=function(_0x1b7e21,_0x1316ff){return db[_0xeea8('0x29')][_0xeea8('0x47')](_0x1b7e21[_0xeea8('0x48')],{})['then'](respondWithResult(_0x1316ff,0xc9))[_0xeea8('0x46')](handleError(_0x1316ff,null));};exports['update']=function(_0xb7433b,_0xc4e0cd){if(_0xb7433b[_0xeea8('0x48')]['id']){delete _0xb7433b['body']['id'];}return db['OpenchannelApplication'][_0xeea8('0x45')]({'where':{'id':_0xb7433b[_0xeea8('0x44')]['id']}})[_0xeea8('0x22')](handleEntityNotFound(_0xc4e0cd,null))[_0xeea8('0x22')](saveUpdates(_0xb7433b[_0xeea8('0x48')],null))[_0xeea8('0x22')](respondWithResult(_0xc4e0cd,null))['catch'](handleError(_0xc4e0cd,null));};exports[_0xeea8('0x49')]=function(_0x306ac8,_0x44affb){return db[_0xeea8('0x29')][_0xeea8('0x45')]({'where':{'id':_0x306ac8['params']['id']}})[_0xeea8('0x22')](handleEntityNotFound(_0x44affb,null))['then'](removeEntity(_0x44affb,null))[_0xeea8('0x46')](handleError(_0x44affb,null));};
\ No newline at end of file
index d461bd1..96f5dda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3343=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','define','openchannel_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4efa16,_0x2d0ece){var _0x3c9e2c=function(_0x214dc6){while(--_0x214dc6){_0x4efa16['push'](_0x4efa16['shift']());}};_0x3c9e2c(++_0x2d0ece);}(_0x3343,0xb0));var _0x3334=function(_0x44714c,_0x2ac454){_0x44714c=_0x44714c-0x0;var _0x57d4d5=_0x3343[_0x44714c];return _0x57d4d5;};'use strict';var _=require('lodash');var util=require(_0x3334('0x0'));var logger=require(_0x3334('0x1'))(_0x3334('0x2'));var moment=require(_0x3334('0x3'));var BPromise=require(_0x3334('0x4'));var rp=require(_0x3334('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3334('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0xb2966a,_0x32709f){return _0xb2966a[_0x3334('0x7')]('OpenchannelApplication',attributes,{'tableName':_0x3334('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3334('0x9'),'collate':_0x3334('0xa')});};
\ No newline at end of file
+var _0xc8c9=['bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc8c9,0xbe));var _0x9c8c=function(_0x242a98,_0x13988e){_0x242a98=_0x242a98-0x0;var _0x580999=_0xc8c9[_0x242a98];return _0x580999;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9c8c('0x0'))(_0x9c8c('0x1'));var moment=require('moment');var BPromise=require(_0x9c8c('0x2'));var rp=require(_0x9c8c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c8c('0x4'));var config=require(_0x9c8c('0x5'));var attributes=require(_0x9c8c('0x6'));module['exports']=function(_0xc8022c,_0xae680f){return _0xc8022c['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9c8c('0x7')});};
\ No newline at end of file
index d83ea03..b2587a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb770=['util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','lodash'];(function(_0x16bb79,_0x1f57b3){var _0x1707a0=function(_0x380f7d){while(--_0x380f7d){_0x16bb79['push'](_0x16bb79['shift']());}};_0x1707a0(++_0x1f57b3);}(_0xb770,0x1d0));var _0x0b77=function(_0x2ca524,_0x5ee9e9){_0x2ca524=_0x2ca524-0x0;var _0x466ac5=_0xb770[_0x2ca524];return _0x466ac5;};'use strict';var _=require(_0x0b77('0x0'));var util=require(_0x0b77('0x1'));var moment=require(_0x0b77('0x2'));var BPromise=require(_0x0b77('0x3'));var rs=require(_0x0b77('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0b77('0x5'));var logger=require('../../config/logger')(_0x0b77('0x6'));var config=require(_0x0b77('0x7'));var jayson=require(_0x0b77('0x8'));var client=jayson[_0x0b77('0x9')][_0x0b77('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4219c7,_0x724bb4,_0xbf3d9){return new BPromise(function(_0x12c231,_0x201527){return client[_0x0b77('0xb')](_0x4219c7,_0xbf3d9)[_0x0b77('0xc')](function(_0x5cd843){logger['info'](_0x0b77('0xd'),_0x724bb4,'request\x20sent');logger[_0x0b77('0xe')](_0x0b77('0xf'),_0x724bb4,'request\x20sent',JSON[_0x0b77('0x10')](_0x5cd843));if(_0x5cd843[_0x0b77('0x11')]){if(_0x5cd843[_0x0b77('0x11')]['code']===0x1f4){logger[_0x0b77('0x11')](_0x0b77('0xd'),_0x724bb4,_0x5cd843['error']['message']);return _0x201527(_0x5cd843[_0x0b77('0x11')][_0x0b77('0x12')]);}logger['error'](_0x0b77('0xd'),_0x724bb4,_0x5cd843[_0x0b77('0x11')][_0x0b77('0x12')]);return _0x12c231(_0x5cd843['error'][_0x0b77('0x12')]);}else{logger[_0x0b77('0x13')](_0x0b77('0xd'),_0x724bb4,_0x0b77('0x14'));_0x12c231(_0x5cd843[_0x0b77('0x15')][_0x0b77('0x12')]);}})[_0x0b77('0x16')](function(_0x30b71c){logger[_0x0b77('0x11')](_0x0b77('0xd'),_0x724bb4,_0x30b71c);_0x201527(_0x30b71c);});});}exports[_0x0b77('0x17')]=function(_0xc54499){var _0x5e130b=this;return new Promise(function(_0x465769,_0x5d1fda){return db[_0x0b77('0x18')][_0x0b77('0x19')](_0xc54499[_0x0b77('0x1a')],{'raw':_0xc54499[_0x0b77('0x1b')]?_0xc54499[_0x0b77('0x1b')][_0x0b77('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc54499[_0x0b77('0x1b')]?_0xc54499[_0x0b77('0x1b')][_0x0b77('0x1d')]||null:null,'attributes':_0xc54499['options']?_0xc54499[_0x0b77('0x1b')][_0x0b77('0x1e')]||null:null,'limit':_0xc54499['options']?_0xc54499[_0x0b77('0x1b')]['limit']||null:null})['then'](function(_0x380395){logger[_0x0b77('0x13')](_0x0b77('0x17'),_0xc54499);logger[_0x0b77('0xe')]('UpdateOpenchannelApplication',_0xc54499,JSON[_0x0b77('0x10')](_0x380395));_0x465769(_0x380395);})[_0x0b77('0x16')](function(_0x350dd4){logger[_0x0b77('0x11')](_0x0b77('0x17'),_0x350dd4[_0x0b77('0x12')],_0xc54499);_0x5d1fda(_0x5e130b[_0x0b77('0x11')](0x1f4,_0x350dd4[_0x0b77('0x12')]));});});};
\ No newline at end of file
+var _0x06c8=['info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code','message','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','then','stringify','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x37c7f9,_0x547265){var _0x65fce2=function(_0x5376b6){while(--_0x5376b6){_0x37c7f9['push'](_0x37c7f9['shift']());}};_0x65fce2(++_0x547265);}(_0x06c8,0x90));var _0x806c=function(_0x400a94,_0x31b06f){_0x400a94=_0x400a94-0x0;var _0x17739a=_0x06c8[_0x400a94];return _0x17739a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x806c('0x0'));var rs=require(_0x806c('0x1'));var fs=require('fs');var Redis=require(_0x806c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x806c('0x3'));var logger=require(_0x806c('0x4'))(_0x806c('0x5'));var config=require(_0x806c('0x6'));var jayson=require(_0x806c('0x7'));var client=jayson[_0x806c('0x8')][_0x806c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x478a66,_0x5a0087,_0x20bf37){return new BPromise(function(_0x33b0f6,_0x3f04c0){return client[_0x806c('0xa')](_0x478a66,_0x20bf37)['then'](function(_0xf44a52){logger[_0x806c('0xb')](_0x806c('0xc'),_0x5a0087,_0x806c('0xd'));logger[_0x806c('0xe')](_0x806c('0xf'),_0x5a0087,'request\x20sent',JSON['stringify'](_0xf44a52));if(_0xf44a52[_0x806c('0x10')]){if(_0xf44a52['error'][_0x806c('0x11')]===0x1f4){logger[_0x806c('0x10')](_0x806c('0xc'),_0x5a0087,_0xf44a52[_0x806c('0x10')][_0x806c('0x12')]);return _0x3f04c0(_0xf44a52[_0x806c('0x10')][_0x806c('0x12')]);}logger[_0x806c('0x10')](_0x806c('0xc'),_0x5a0087,_0xf44a52[_0x806c('0x10')][_0x806c('0x12')]);return _0x33b0f6(_0xf44a52['error'][_0x806c('0x12')]);}else{logger[_0x806c('0xb')](_0x806c('0xc'),_0x5a0087,_0x806c('0xd'));_0x33b0f6(_0xf44a52['result']['message']);}})['catch'](function(_0x3c4493){logger[_0x806c('0x10')](_0x806c('0xc'),_0x5a0087,_0x3c4493);_0x3f04c0(_0x3c4493);});});}exports[_0x806c('0x13')]=function(_0x1065f2){var _0x3ffb7f=this;return new Promise(function(_0xe917af,_0x5af018){return db[_0x806c('0x14')][_0x806c('0x15')](_0x1065f2[_0x806c('0x16')],{'raw':_0x1065f2[_0x806c('0x17')]?_0x1065f2[_0x806c('0x17')][_0x806c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1065f2[_0x806c('0x17')]?_0x1065f2[_0x806c('0x17')][_0x806c('0x19')]||null:null,'attributes':_0x1065f2[_0x806c('0x17')]?_0x1065f2[_0x806c('0x17')][_0x806c('0x1a')]||null:null,'limit':_0x1065f2[_0x806c('0x17')]?_0x1065f2['options'][_0x806c('0x1b')]||null:null})[_0x806c('0x1c')](function(_0x5948db){logger['info']('UpdateOpenchannelApplication',_0x1065f2);logger[_0x806c('0xe')](_0x806c('0x13'),_0x1065f2,JSON[_0x806c('0x1d')](_0x5948db));_0xe917af(_0x5948db);})[_0x806c('0x1e')](function(_0x163676){logger[_0x806c('0x10')](_0x806c('0x13'),_0x163676['message'],_0x1065f2);_0x5af018(_0x3ffb7f[_0x806c('0x10')](0x1f4,_0x163676[_0x806c('0x12')]));});});};
\ No newline at end of file
index e24b320..9eccaa5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa143=['openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','describe','/:id','isAuthenticated','show','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put'];(function(_0xf98d22,_0x158e2a){var _0x5652b7=function(_0x44b016){while(--_0x44b016){_0xf98d22['push'](_0xf98d22['shift']());}};_0x5652b7(++_0x158e2a);}(_0xa143,0x171));var _0x3a14=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa143[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3a14('0x0'));var timeout=require(_0x3a14('0x1'));var express=require(_0x3a14('0x2'));var router=express[_0x3a14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3a14('0x4'));var interaction=require(_0x3a14('0x5'));var config=require(_0x3a14('0x6'));var controller=require(_0x3a14('0x7'));router[_0x3a14('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3a14('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x3a14('0x9')]);router[_0x3a14('0x8')](_0x3a14('0xa'),auth[_0x3a14('0xb')](),controller[_0x3a14('0xc')]);router['get'](_0x3a14('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x3a14('0x8')](_0x3a14('0xe'),auth[_0x3a14('0xb')](),controller[_0x3a14('0xf')]);router[_0x3a14('0x10')]('/',auth[_0x3a14('0xb')](),controller['create']);router['post'](_0x3a14('0xd'),auth['isAuthenticated'](),controller[_0x3a14('0x11')]);router['post'](_0x3a14('0x12'),auth[_0x3a14('0xb')](),interaction[_0x3a14('0x13')](_0x3a14('0x14'),_0x3a14('0x15')),controller['addTags']);router[_0x3a14('0x16')](_0x3a14('0xa'),auth[_0x3a14('0xb')](),interaction[_0x3a14('0x13')](_0x3a14('0x14'),_0x3a14('0x17')),controller['update']);router[_0x3a14('0x18')](_0x3a14('0xa'),auth[_0x3a14('0xb')](),interaction[_0x3a14('0x13')](_0x3a14('0x14'),_0x3a14('0x19')),controller[_0x3a14('0x1a')]);router[_0x3a14('0x18')]('/:id/tags',auth[_0x3a14('0xb')](),controller['removeTags']);module[_0x3a14('0x1b')]=router;
\ No newline at end of file
+var _0xb6a4=['put','tracked','openchannelinteraction:update','update','destroy','/:id/tags','removeTags','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','openchannel','addTags'];(function(_0x36fe9b,_0x518d1b){var _0x113065=function(_0x4f78d4){while(--_0x4f78d4){_0x36fe9b['push'](_0x36fe9b['shift']());}};_0x113065(++_0x518d1b);}(_0xb6a4,0x7c));var _0x4b6a=function(_0x7ceb9e,_0x251ee3){_0x7ceb9e=_0x7ceb9e-0x0;var _0x54579b=_0xb6a4[_0x7ceb9e];return _0x54579b;};'use strict';var multer=require(_0x4b6a('0x0'));var util=require(_0x4b6a('0x1'));var path=require('path');var timeout=require(_0x4b6a('0x2'));var express=require(_0x4b6a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4b6a('0x4'));var config=require(_0x4b6a('0x5'));var controller=require(_0x4b6a('0x6'));router[_0x4b6a('0x7')]('/',auth[_0x4b6a('0x8')](),controller['index']);router['get'](_0x4b6a('0x9'),auth[_0x4b6a('0x8')](),controller[_0x4b6a('0xa')]);router[_0x4b6a('0x7')](_0x4b6a('0xb'),auth[_0x4b6a('0x8')](),controller[_0x4b6a('0xc')]);router['get'](_0x4b6a('0xd'),auth[_0x4b6a('0x8')](),controller[_0x4b6a('0xe')]);router['get'](_0x4b6a('0xf'),auth[_0x4b6a('0x8')](),controller[_0x4b6a('0x10')]);router[_0x4b6a('0x11')]('/',auth[_0x4b6a('0x8')](),controller[_0x4b6a('0x12')]);router['post'](_0x4b6a('0xd'),auth[_0x4b6a('0x8')](),controller['addMessage']);router[_0x4b6a('0x11')]('/:id/tags',auth[_0x4b6a('0x8')](),interaction['tracked'](_0x4b6a('0x13'),'openchannelinteraction:addtags'),controller[_0x4b6a('0x14')]);router[_0x4b6a('0x15')](_0x4b6a('0xb'),auth[_0x4b6a('0x8')](),interaction[_0x4b6a('0x16')](_0x4b6a('0x13'),_0x4b6a('0x17')),controller[_0x4b6a('0x18')]);router['delete']('/:id',auth[_0x4b6a('0x8')](),interaction[_0x4b6a('0x16')](_0x4b6a('0x13'),'openchannelinteraction:destroy'),controller[_0x4b6a('0x19')]);router['delete'](_0x4b6a('0x1a'),auth[_0x4b6a('0x8')](),controller[_0x4b6a('0x1b')]);module[_0x4b6a('0x1c')]=router;
\ No newline at end of file
index 6a9ea0e..9529db7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad36=['ENUM','out','exports','BOOLEAN','DATE','STRING'];(function(_0x2ec663,_0x2cd5c5){var _0x512a30=function(_0x46f8d4){while(--_0x46f8d4){_0x2ec663['push'](_0x2ec663['shift']());}};_0x512a30(++_0x2cd5c5);}(_0xad36,0x11c));var _0x6ad3=function(_0x420c64,_0x1543e5){_0x420c64=_0x420c64-0x0;var _0x288739=_0xad36[_0x420c64];return _0x288739;};'use strict';var Sequelize=require('sequelize');module[_0x6ad3('0x0')]={'closed':{'type':Sequelize[_0x6ad3('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6ad3('0x2')]},'disposition':{'type':Sequelize[_0x6ad3('0x3')]},'secondDisposition':{'type':Sequelize[_0x6ad3('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6ad3('0x3')]},'note':{'type':Sequelize[_0x6ad3('0x3')]},'read1stAt':{'type':Sequelize[_0x6ad3('0x2')]},'threadId':{'type':Sequelize[_0x6ad3('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x6ad3('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x6ad3('0x4')]('in',_0x6ad3('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x6ad3('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x89c3=['DATE','STRING','ENUM','sequelize','exports','BOOLEAN'];(function(_0x13cd96,_0xdab822){var _0x39e5b9=function(_0x26d78e){while(--_0x26d78e){_0x13cd96['push'](_0x13cd96['shift']());}};_0x39e5b9(++_0xdab822);}(_0x89c3,0xff));var _0x389c=function(_0x5e7b09,_0x51ee25){_0x5e7b09=_0x5e7b09-0x0;var _0x2c7d8a=_0x89c3[_0x5e7b09];return _0x2c7d8a;};'use strict';var Sequelize=require(_0x389c('0x0'));module[_0x389c('0x1')]={'closed':{'type':Sequelize[_0x389c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x389c('0x3')]},'disposition':{'type':Sequelize[_0x389c('0x4')]},'secondDisposition':{'type':Sequelize[_0x389c('0x4')]},'thirdDisposition':{'type':Sequelize[_0x389c('0x4')]},'note':{'type':Sequelize[_0x389c('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x389c('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x389c('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x389c('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x389c('0x2')],'defaultValue':![]}};
\ No newline at end of file
index dcc5dbb..47729bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ab=['hasOwnProperty','order','sort','where','pick','filters','field','color','from','tools_tags','select','ui.OpenchannelInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','body','some','compact','isEmpty','OpenchannelAccountId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','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','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','agent','user','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.phone','c.mobile','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','rows','catch','params','keys','rawAttributes','includeAll','create','describe','addMessage','OpenchannelMessage','ids','omit','findOne','YYYY-MM-DD\x20HH:mm:ss','include','addTags','setTags','findAll','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','User','CmContact','firstName','Attachment','Messages','direction','secret','get','mkdirSync','Openchannel','Account','Owner','N.A.','closedAt','format','disposition','threadId','Public','basename','pipe','lastName','out','transcript-','createPdfFromHTML','err','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/utils','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','stack','name','send','map','fullname','TagIds','split','forEach','Tags','push','waiting','talking','answered','unmanaged','closed','UserId','total','index','OpenchannelInteraction','fieldName','key','model','query','intersection','attributes','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x46ab,0x17b));var _0xb46a=function(_0x2fb004,_0x217c04){_0x2fb004=_0x2fb004-0x0;var _0x2cfe86=_0x46ab[_0x2fb004];return _0x2cfe86;};'use strict';var emlformat=require(_0xb46a('0x0'));var rimraf=require(_0xb46a('0x1'));var zipdir=require(_0xb46a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb46a('0x3'));var moment=require(_0xb46a('0x4'));var BPromise=require(_0xb46a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb46a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb46a('0x7'));var _=require(_0xb46a('0x8'));var squel=require(_0xb46a('0x9'));var crypto=require(_0xb46a('0xa'));var jsforce=require(_0xb46a('0xb'));var deskjs=require(_0xb46a('0xc'));var toCsv=require(_0xb46a('0xd'));var querystring=require(_0xb46a('0xe'));var Papa=require('papaparse');var Redis=require(_0xb46a('0xf'));var authService=require(_0xb46a('0x10'));var qs=require(_0xb46a('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xb46a('0x12'));var hardwareService=require(_0xb46a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xb46a('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb46a('0x15')]=_[_0xb46a('0x16')](config[_0xb46a('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xb46a('0x17'))(new Redis(config[_0xb46a('0x15')]));require(_0xb46a('0x18'))[_0xb46a('0x19')](socket);function respondWithStatusCode(_0x1d6410,_0x426571){_0x426571=_0x426571||0xcc;return function(_0x27ebc5){if(_0x27ebc5){return _0x1d6410[_0xb46a('0x1a')](_0x426571);}return _0x1d6410[_0xb46a('0x1b')](_0x426571)[_0xb46a('0x1c')]();};}function respondWithResult(_0x90a6e8,_0x300efa){_0x300efa=_0x300efa||0xc8;return function(_0x2110d9){if(_0x2110d9){return _0x90a6e8[_0xb46a('0x1b')](_0x300efa)[_0xb46a('0x1d')](_0x2110d9);}};}function respondWithFilteredResult(_0x4db07b,_0x34bec1){return function(_0x52c1b0){if(_0x52c1b0){var _0x3611fb=typeof _0x34bec1[_0xb46a('0x1e')]===_0xb46a('0x1f')&&typeof _0x34bec1[_0xb46a('0x20')]===_0xb46a('0x1f');var _0x495907=_0x52c1b0[_0xb46a('0x21')];var _0x4fd067=_0x3611fb?0x0:_0x34bec1[_0xb46a('0x1e')];var _0x362917=_0x3611fb?_0x52c1b0['count']:_0x34bec1[_0xb46a('0x1e')]+_0x34bec1['limit'];var _0x54eb32;if(_0x362917>=_0x495907){_0x362917=_0x495907;_0x54eb32=0xc8;}else{_0x54eb32=0xce;}_0x4db07b['status'](_0x54eb32);return _0x4db07b[_0xb46a('0x22')]('Content-Range',_0x4fd067+'-'+_0x362917+'/'+_0x495907)[_0xb46a('0x1d')](_0x52c1b0);}return null;};}function patchUpdates(_0x367a52){return function(_0x4feb4d){try{jsonpatch[_0xb46a('0x23')](_0x4feb4d,_0x367a52,!![]);}catch(_0x1c4f9e){return BPromise['reject'](_0x1c4f9e);}return _0x4feb4d['save']();};}function saveUpdates(_0x47042f,_0x538708){return function(_0x2843c3){if(_0x2843c3){return _0x2843c3[_0xb46a('0x24')](_0x47042f)[_0xb46a('0x25')](function(_0x72091){return _0x72091;});}return null;};}function removeEntity(_0x1ad91e,_0x534d20){return function(_0x59022e){if(_0x59022e){return _0x59022e[_0xb46a('0x26')]()[_0xb46a('0x25')](function(){_0x1ad91e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c66e6,_0x187f68){return function(_0x235e7a){if(!_0x235e7a){_0x2c66e6[_0xb46a('0x1a')](0x194);}return _0x235e7a;};}function handleError(_0x2aa9bb,_0x5d92ca){_0x5d92ca=_0x5d92ca||0x1f4;return function(_0x4475f1){logger['error'](_0x4475f1[_0xb46a('0x27')]);if(_0x4475f1[_0xb46a('0x28')]){delete _0x4475f1[_0xb46a('0x28')];}_0x2aa9bb[_0xb46a('0x1b')](_0x5d92ca)[_0xb46a('0x29')](_0x4475f1);};}function getInteractionUsers(_0x5cf3ee,_0x4da72c){return new BPromise(function(_0x508f40,_0xe30f86){try{if(_0x4da72c[_0x5cf3ee['id']]){_0x5cf3ee['Users']=_[_0xb46a('0x2a')](_0x4da72c[_0x5cf3ee['id']],function(_0x17f876){return{'id':_0x17f876['id'],'fullname':_0x17f876[_0xb46a('0x2b')]};});}}catch(_0x11d9df){_0xe30f86(_0x11d9df);}_0x508f40(_0x5cf3ee);});}function getInteractionTags(_0x34eb32,_0x2bff5b){return new BPromise(function(_0x3d3c63,_0x7f1f6a){try{if(_0x34eb32[_0xb46a('0x2c')]){_0x34eb32['Tags']=[];_0x34eb32[_0xb46a('0x2c')][_0xb46a('0x2d')](',')[_0xb46a('0x2e')](function(_0x317b75){_0x34eb32[_0xb46a('0x2f')][_0xb46a('0x30')](_0x2bff5b[_0x317b75]);});}delete _0x34eb32[_0xb46a('0x2c')];}catch(_0x161415){_0x7f1f6a(_0x161415);}_0x3d3c63(_0x34eb32);});}function updateOpenchannelInteraction(_0x2537d7,_0x1e14f0,_0x9e7f86){return new BPromise(function(_0x15e258,_0x460621){return getInteractionUsers(_0x2537d7,_0x9e7f86)['then'](function(_0xc4d838){return getInteractionTags(_0xc4d838,_0x1e14f0);})[_0xb46a('0x25')](function(_0x3bea34){return getStateInteraction(_0x3bea34);})[_0xb46a('0x25')](function(_0x2eb6b2){_0x15e258(_0x2eb6b2);})['catch'](function(_0x8e6eae){_0x460621(_0x8e6eae);});});}function getStateInteraction(_0x46d685){return new BPromise(function(_0x294d4c){_0x46d685[_0xb46a('0x31')]=0x0;_0x46d685[_0xb46a('0x32')]=0x0;_0x46d685[_0xb46a('0x33')]=0x0;_0x46d685[_0xb46a('0x34')]=0x0;_0x46d685['total']=0x0;if(!_0x46d685[_0xb46a('0x35')]&&!_0x46d685[_0xb46a('0x36')]){_0x46d685[_0xb46a('0x31')]+=0x1;}if(!_0x46d685[_0xb46a('0x35')]&&_0x46d685[_0xb46a('0x36')]){_0x46d685[_0xb46a('0x32')]+=0x1;if(_0x46d685[_0xb46a('0x31')]){_0x46d685[_0xb46a('0x31')]-=0x1;}}if(_0x46d685[_0xb46a('0x35')]&&_0x46d685['UserId']){_0x46d685[_0xb46a('0x33')]+=0x1;if(_0x46d685[_0xb46a('0x32')]){_0x46d685[_0xb46a('0x32')]-=0x1;}}if(_0x46d685[_0xb46a('0x35')]&&!_0x46d685[_0xb46a('0x36')]){_0x46d685[_0xb46a('0x34')]+=0x1;if(_0x46d685[_0xb46a('0x31')]){_0x46d685['waiting']-=0x1;}}_0x46d685[_0xb46a('0x37')]+=0x1;_0x294d4c(_0x46d685);});}exports[_0xb46a('0x38')]=function(_0x66782a,_0x57b99e){var _0x1612a4={},_0x266d5f={},_0x48620f={'count':0x0,'rows':[]};var _0x4383bf=_[_0xb46a('0x2a')](db[_0xb46a('0x39')]['rawAttributes'],function(_0x85d500){return{'name':_0x85d500[_0xb46a('0x3a')],'type':_0x85d500['type'][_0xb46a('0x3b')]};});_0x266d5f[_0xb46a('0x3c')]=_['map'](_0x4383bf,_0xb46a('0x28'));_0x266d5f[_0xb46a('0x3d')]=_['keys'](_0x66782a[_0xb46a('0x3d')]);_0x266d5f['filters']=_[_0xb46a('0x3e')](_0x266d5f[_0xb46a('0x3c')],_0x266d5f['query']);_0x1612a4[_0xb46a('0x3f')]=_[_0xb46a('0x3e')](_0x266d5f[_0xb46a('0x3c')],qs[_0xb46a('0x40')](_0x66782a[_0xb46a('0x3d')][_0xb46a('0x40')]));_0x1612a4['attributes']=_0x1612a4[_0xb46a('0x3f')]['length']?_0x1612a4[_0xb46a('0x3f')]:_0x266d5f['model'];if(!_0x66782a['query'][_0xb46a('0x41')]('nolimit')){_0x1612a4['limit']=qs['limit'](_0x66782a[_0xb46a('0x3d')][_0xb46a('0x20')]);_0x1612a4['offset']=qs['offset'](_0x66782a['query'][_0xb46a('0x1e')]);}_0x1612a4[_0xb46a('0x42')]=qs['sort'](_0x66782a[_0xb46a('0x3d')][_0xb46a('0x43')]);_0x1612a4[_0xb46a('0x44')]=qs['filters'](_[_0xb46a('0x45')](_0x66782a[_0xb46a('0x3d')],_0x266d5f[_0xb46a('0x46')]),_0x4383bf);var _0x527111=[];var _0x218a6c=squel['select']()[_0xb46a('0x47')]('id')[_0xb46a('0x47')](_0xb46a('0x28'))['field'](_0xb46a('0x48'))[_0xb46a('0x49')](_0xb46a('0x4a'));var _0x2fdfed=squel[_0xb46a('0x4b')]()['field']('u.id')[_0xb46a('0x47')]('u.fullname')[_0xb46a('0x47')](_0xb46a('0x4c'))[_0xb46a('0x49')]('user_has_openchannel_interactions','ui')[_0xb46a('0x4d')](_0xb46a('0x4e'),'u',_0xb46a('0x4f'));var _0x20b5e5=squel['select']()[_0xb46a('0x49')]('openchannel_interactions','i')[_0xb46a('0x4d')](_0xb46a('0x50'),'c',_0xb46a('0x51'))[_0xb46a('0x4d')](_0xb46a('0x4e'),'o',_0xb46a('0x52'))[_0xb46a('0x4d')](_0xb46a('0x53'),'a',_0xb46a('0x54'))[_0xb46a('0x4d')]('openchannel_messages','me',_0xb46a('0x55'))[_0xb46a('0x4d')]('openchannel_interaction_has_tags','it','it.OpenchannelInteractionId\x20=\x20i.id')[_0xb46a('0x4d')]('tools_tags','t',_0xb46a('0x56'));var _0x157599=squel['expr']();var _0x249b82=[];var _0xafbf84=squel[_0xb46a('0x57')]();var _0x1a032f;if(_0x66782a['query'][_0xb46a('0x58')]){_0x1a032f=as[_0xb46a('0x59')](_0x66782a[_0xb46a('0x3d')][_0xb46a('0x58')]);var _0x39986d=_0x1a032f[_0xb46a('0x5a')];for(var _0x52a238=0x0;_0x52a238<_0x1a032f[_0xb46a('0x5b')][_0xb46a('0x5c')];_0x52a238++){var _0x7a7679=_0x1a032f['conditions'][_0x52a238];var _0x561979='i';var _0x4dfaa3=_[_0xb46a('0x5d')](_0x4383bf,[_0xb46a('0x28'),_0x7a7679[_0xb46a('0x47')]]);if(!_0x4dfaa3){switch(_0x7a7679['field']){case _0xb46a('0x5e'):if(_0x7a7679[_0xb46a('0x5f')]==0x1){_0x20b5e5[_0xb46a('0x60')]('`'+_0x7a7679[_0xb46a('0x47')]+_0xb46a('0x61'));}else{_0x20b5e5[_0xb46a('0x60')]('`'+_0x7a7679[_0xb46a('0x47')]+'`\x20>\x200');}break;case _0xb46a('0x62'):if(_0x7a7679['operator']===_0xb46a('0x63')){if(_0x7a7679[_0xb46a('0x5f')][_0xb46a('0x2d')]('\x20')[_0xb46a('0x5c')]>0x1){_0x157599[_0x39986d](_0xb46a('0x64'),qs[_0xb46a('0x65')](_0x7a7679[_0xb46a('0x5f')]),null);}else{var _0x376224='%'+_0x7a7679[_0xb46a('0x5f')]+'%';_0x157599[_0x39986d](_0xb46a('0x66'),_0x376224,_0x376224,_0x376224);}}else{_0x4dfaa3=_[_0xb46a('0x5d')](_0x4383bf,['name',_0xb46a('0x67')]);_0x7a7679[_0xb46a('0x47')]=_0xb46a('0x67');_0x3838eb=as[_0xb46a('0x68')](_0x561979,_0x4dfaa3[_0xb46a('0x69')],_0x7a7679);_0x157599[_0x39986d](_0x3838eb[_0xb46a('0x6a')],_0x3838eb[_0xb46a('0x5f')][_0xb46a('0x6b')],_0x3838eb['value']['end']);}break;case _0xb46a('0x6c'):var _0x545250=_0x7a7679[_0xb46a('0x5f')][_0xb46a('0x2d')](',')[_0xb46a('0x2a')](function(_0x42c75c){return Number(_0x42c75c);});_0x545250['forEach'](function(_0x4ada49){_0xafbf84['or'](_0xb46a('0x6d'),'%,'+_0x4ada49+',%');});_0x249b82=_[_0xb46a('0x6e')](_0x249b82,_0x545250);break;case'User':if(_0x7a7679[_0xb46a('0x6f')]===_0xb46a('0x63')){_0x157599[_0x39986d]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x7a7679['value']+'%',null);}else{_0x4dfaa3=_['find'](_0x4383bf,[_0xb46a('0x28'),_0xb46a('0x36')]);_0x7a7679[_0xb46a('0x47')]=_0xb46a('0x36');_0x3838eb=as[_0xb46a('0x68')](_0x561979,_0x4dfaa3[_0xb46a('0x69')],_0x7a7679);_0x157599[_0x39986d](_0x3838eb[_0xb46a('0x6a')],_0x3838eb[_0xb46a('0x5f')][_0xb46a('0x6b')],_0x3838eb['value'][_0xb46a('0x1c')]);}break;case _0xb46a('0x70'):_0x3838eb=as[_0xb46a('0x68')]('me',null,_0x7a7679);_0x157599[_0x39986d](_0x3838eb[_0xb46a('0x6a')],_0x3838eb['value'][_0xb46a('0x6b')],_0x3838eb[_0xb46a('0x5f')][_0xb46a('0x1c')]);break;}}else{var _0x3838eb=as['buildExpression'](_0x561979,_0x4dfaa3[_0xb46a('0x69')],_0x7a7679);_0x157599[_0x39986d](_0x3838eb[_0xb46a('0x6a')],_0x3838eb[_0xb46a('0x5f')][_0xb46a('0x6b')],_0x3838eb[_0xb46a('0x5f')]['end']);}}}else{var _0x25242f=_(_0x66782a[_0xb46a('0x3d')])['keys']()['map'](function(_0x47a6ea){return _[_0xb46a('0x71')](_0x4383bf,[_0xb46a('0x28'),_0x47a6ea])?_0x47a6ea:undefined;})[_0xb46a('0x72')]()['value']();if(!_[_0xb46a('0x73')](_0x25242f)){_0x25242f['forEach'](function(_0x5ef0d6){if(_0x5ef0d6===_0xb46a('0x74')){_0x20b5e5[_0xb46a('0x44')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xb46a('0x75')](_0x66782a['query'][_0x5ef0d6]));}else if(_0x5ef0d6===_0xb46a('0x76')){var _0x2c0288=JSON[_0xb46a('0x77')](_0x66782a[_0xb46a('0x3d')][_0x5ef0d6])[_0xb46a('0x78')];var _0x119b6d=JSON[_0xb46a('0x77')](_0x66782a[_0xb46a('0x3d')][_0x5ef0d6])[_0xb46a('0x79')];_0x20b5e5[_0xb46a('0x44')](_0xb46a('0x7a'),_0x2c0288,_0x119b6d);}else{if(_0x66782a[_0xb46a('0x3d')][_0x5ef0d6]===_0xb46a('0x7b')){_0x20b5e5[_0xb46a('0x44')]('i.'+_0x5ef0d6+_0xb46a('0x7c'));}else{_0x20b5e5[_0xb46a('0x44')]('i.'+_0x5ef0d6+'\x20=\x20?',_0x66782a['query'][_0x5ef0d6]);}}});}if(_0x66782a[_0xb46a('0x3d')][_0xb46a('0x7d')]){if(_0x66782a[_0xb46a('0x3d')][_0xb46a('0x7d')]==0x1){_0x20b5e5[_0xb46a('0x60')]('`unreadMessages`\x20=\x200');}else{_0x20b5e5[_0xb46a('0x60')](_0xb46a('0x7e'));}}if(_0x66782a[_0xb46a('0x3d')][_0xb46a('0x7f')]){_0x249b82=_[_0xb46a('0x80')](_0x66782a[_0xb46a('0x3d')][_0xb46a('0x7f')])?_0x66782a[_0xb46a('0x3d')][_0xb46a('0x7f')]:new Array(_0x66782a[_0xb46a('0x3d')][_0xb46a('0x7f')]);_0x249b82['forEach'](function(_0x822587){_0xafbf84['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x822587+',%');});}if(_0x66782a[_0xb46a('0x3d')][_0xb46a('0x81')]){var _0x51ad09=_0x66782a[_0xb46a('0x3d')]['filter'][_0xb46a('0x82')]('\x5c','\x5c\x5c')[_0xb46a('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x51ad09)){_0x157599['or'](_0xb46a('0x83'),_0x51ad09+'%');}else{_0x157599['or'](_0xb46a('0x84'),qs[_0xb46a('0x65')](_0x51ad09))['or'](_0xb46a('0x85'),_0x51ad09+'%')['or'](_0xb46a('0x86'),_0x51ad09+'%');}}}_0x20b5e5[_0xb46a('0x44')](_0x157599);_0x20b5e5[_0xb46a('0x87')](_0xb46a('0x88'));var _0x420ddd={'type':db[_0xb46a('0x89')][_0xb46a('0x8a')][_0xb46a('0x8b')],'raw':!![]};var _0x56699d=_0x20b5e5[_0xb46a('0x8c')]();_0x56699d['field']('i.id');_0x56699d['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb46a('0x5e'));if(_0x1612a4[_0xb46a('0x42')]){_0x1612a4[_0xb46a('0x42')][_0xb46a('0x2e')](function(_0x560472){var _0x312142=_0x560472[0x0]===_0xb46a('0x8d')?_0x560472[0x0]:'i.'+_0x560472[0x0];_0x20b5e5['order'](_0x312142,_0x560472[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb46a('0x73')](_0x249b82)){_0x20b5e5[_0xb46a('0x60')](_0xafbf84);_0x56699d['where']('t.id\x20IN\x20?',_0x249b82);}BPromise['resolve']()[_0xb46a('0x25')](function(){if(!_0x1a032f){if(_0x66782a[_0xb46a('0x3d')][_0xb46a('0x74')])return;_0x56699d[_0xb46a('0x44')](_0xb46a('0x8e'));_0x20b5e5['where'](_0xb46a('0x8e'));return;}if(_0x66782a['user']['role']!==_0xb46a('0x8f'))return;return _0x66782a[_0xb46a('0x90')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x46c0aa){if(_[_0xb46a('0x73')](_0x46c0aa)){_0x56699d[_0xb46a('0x44')](_0xb46a('0x91'));_0x20b5e5[_0xb46a('0x44')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x56699d[_0xb46a('0x44')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xb46a('0x2a')](_0x46c0aa,'id'));_0x20b5e5[_0xb46a('0x44')](_0xb46a('0x92'),_[_0xb46a('0x2a')](_0x46c0aa,'id'));}});})['then'](function(){if(_0x66782a[_0xb46a('0x90')]['role']===_0xb46a('0x8f')&&!_0x1a032f&&!_0x66782a[_0xb46a('0x3d')][_0xb46a('0x74')])return[];return db[_0xb46a('0x93')]['query'](_0x56699d[_0xb46a('0x94')](),_0x420ddd);})['then'](function(_0x2801cc){_0x48620f[_0xb46a('0x21')]=_0x2801cc[_0xb46a('0x5c')];if(_0x48620f[_0xb46a('0x21')]===0x0)return[];return db[_0xb46a('0x93')][_0xb46a('0x3d')](_0x218a6c[_0xb46a('0x94')](),_0x420ddd)[_0xb46a('0x25')](function(_0x17ebbe){_0x527111=_[_0xb46a('0x95')](_0x17ebbe,'id');_0x420ddd=_[_0xb46a('0x96')](_0x420ddd,{'model':db[_0xb46a('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x66782a[_0xb46a('0x3d')][_0xb46a('0x40')]){_0x1612a4[_0xb46a('0x3f')]['forEach'](function(_0x11d5d4){_0x20b5e5[_0xb46a('0x47')]('i.'+_0x11d5d4);});}else{_0x20b5e5[_0xb46a('0x47')](_0xb46a('0x97'),_0xb46a('0x5e'));_0x20b5e5[_0xb46a('0x47')](_0xb46a('0x98'),_0xb46a('0x99'));_0x20b5e5[_0xb46a('0x47')](_0xb46a('0x9a'),_0xb46a('0x9b'));_0x20b5e5[_0xb46a('0x47')](_0xb46a('0x9c'),_0xb46a('0x8d'));_0x20b5e5['field'](_0xb46a('0x9d'));_0x20b5e5[_0xb46a('0x47')](_0xb46a('0x9e'),_0xb46a('0x9f'));_0x20b5e5[_0xb46a('0x47')]('c.lastName',_0xb46a('0xa0'));_0x20b5e5[_0xb46a('0x47')]('c.email','Contact.email');_0x20b5e5[_0xb46a('0x47')](_0xb46a('0xa1'),'Contact.phone');_0x20b5e5['field'](_0xb46a('0xa2'),'Contact.mobile');_0x20b5e5['field']('c.fax','Contact.fax');_0x20b5e5[_0xb46a('0x47')]('o.fullname',_0xb46a('0xa3'));_0x20b5e5[_0xb46a('0x47')](_0xb46a('0xa4'),'Owner.internal');_0x20b5e5['field'](_0xb46a('0xa5'),'TagIds');}if(_0x1612a4[_0xb46a('0x20')])_0x20b5e5['limit'](_0x1612a4[_0xb46a('0x20')]);if(_0x1612a4[_0xb46a('0x1e')])_0x20b5e5[_0xb46a('0x1e')](_0x1612a4[_0xb46a('0x1e')]);return db[_0xb46a('0x93')][_0xb46a('0x3d')](_0x20b5e5[_0xb46a('0x94')](),_0x420ddd);})[_0xb46a('0x25')](function(_0x339f24){if(_0x339f24['length']>0x0)_0x2fdfed[_0xb46a('0x44')](_0xb46a('0xa6'),_[_0xb46a('0x2a')](_0x339f24,'id'));return db[_0xb46a('0x93')][_0xb46a('0x3d')](_0x2fdfed[_0xb46a('0x94')](),_0x420ddd)['then'](function(_0x2bc1d9){var _0x1f5f37=_[_0xb46a('0xa7')](_0x2bc1d9,_0xb46a('0xa8'));var _0x39c258=[];_0x339f24[_0xb46a('0x2e')](function(_0xbde609){_0x39c258['push'](updateOpenchannelInteraction(_0xbde609,_0x527111,_0x1f5f37));});return BPromise['all'](_0x39c258);});});})[_0xb46a('0x25')](function(_0xe0baee){_0x48620f[_0xb46a('0xa9')]=_0xe0baee;return _0x48620f;})['then'](respondWithFilteredResult(_0x57b99e,_0x1612a4))[_0xb46a('0xaa')](handleError(_0x57b99e,null));};exports['show']=function(_0x513871,_0x1d929a){var _0x2ae3d7={};if(_0x513871[_0xb46a('0x3d')]['type']&&_0x513871[_0xb46a('0x3d')][_0xb46a('0x69')]===_0xb46a('0x49')){_0x2ae3d7[_0xb46a('0x49')]=_0x513871[_0xb46a('0xab')]['id'];}else{_0x2ae3d7['id']=_0x513871['params']['id'];}var _0x306570={'raw':![],'where':_0x2ae3d7},_0xd279be={};_0xd279be[_0xb46a('0x3c')]=_[_0xb46a('0xac')](db['OpenchannelInteraction'][_0xb46a('0xad')]);_0xd279be[_0xb46a('0x3d')]=_['keys'](_0x513871[_0xb46a('0x3d')]);_0xd279be[_0xb46a('0x46')]=_[_0xb46a('0x3e')](_0xd279be[_0xb46a('0x3c')],_0xd279be[_0xb46a('0x3d')]);_0x306570[_0xb46a('0x3f')]=_[_0xb46a('0x3e')](_0xd279be['model'],qs[_0xb46a('0x40')](_0x513871[_0xb46a('0x3d')][_0xb46a('0x40')]));_0x306570['attributes']=_0x306570[_0xb46a('0x3f')][_0xb46a('0x5c')]?_0x306570[_0xb46a('0x3f')]:_0xd279be[_0xb46a('0x3c')];if(_0x513871[_0xb46a('0x3d')][_0xb46a('0xae')]){_0x306570['include']=[{'all':!![]}];}_0x306570=_[_0xb46a('0x96')]({},_0x306570,_0x513871['options']);return db[_0xb46a('0x39')][_0xb46a('0x5d')](_0x306570)[_0xb46a('0x25')](handleEntityNotFound(_0x1d929a,null))[_0xb46a('0x25')](respondWithResult(_0x1d929a,null))[_0xb46a('0xaa')](handleError(_0x1d929a,null));};exports['create']=function(_0x56f6a1,_0x21dd54){return db['OpenchannelInteraction'][_0xb46a('0xaf')](_0x56f6a1[_0xb46a('0x70')],{})['then'](respondWithResult(_0x21dd54,0xc9))[_0xb46a('0xaa')](handleError(_0x21dd54,null));};exports[_0xb46a('0x24')]=function(_0x404ce7,_0x1c79f7){if(_0x404ce7[_0xb46a('0x70')]['id']){delete _0x404ce7[_0xb46a('0x70')]['id'];}return db[_0xb46a('0x39')][_0xb46a('0x5d')]({'where':{'id':_0x404ce7[_0xb46a('0xab')]['id']}})['then'](handleEntityNotFound(_0x1c79f7,null))['then'](saveUpdates(_0x404ce7[_0xb46a('0x70')],null))[_0xb46a('0x25')](respondWithResult(_0x1c79f7,null))[_0xb46a('0xaa')](handleError(_0x1c79f7,null));};exports[_0xb46a('0x26')]=function(_0xa549a6,_0x2a4eeb){return db['OpenchannelInteraction'][_0xb46a('0x5d')]({'where':{'id':_0xa549a6['params']['id']}})[_0xb46a('0x25')](handleEntityNotFound(_0x2a4eeb,null))[_0xb46a('0x25')](removeEntity(_0x2a4eeb,null))[_0xb46a('0xaa')](handleError(_0x2a4eeb,null));};exports[_0xb46a('0xb0')]=function(_0x3c76d1,_0x5436b1){return db['OpenchannelInteraction'][_0xb46a('0xb0')]()[_0xb46a('0x25')](respondWithResult(_0x5436b1,null))[_0xb46a('0xaa')](handleError(_0x5436b1,null));};exports[_0xb46a('0xb1')]=function(_0x3c3df4,_0x2ce3d8,_0x5db465){return db[_0xb46a('0xb2')][_0xb46a('0x5d')]({'where':{'id':_0x3c3df4['params']['id']}})[_0xb46a('0x25')](handleEntityNotFound(_0x2ce3d8,null))['then'](function(_0x9a90cc){if(_0x9a90cc){return _0x9a90cc['addMessage'](_0x3c3df4['body'][_0xb46a('0xb3')],_[_0xb46a('0xb4')](_0x3c3df4[_0xb46a('0x70')],[_0xb46a('0xb3'),'id'])||{});}})[_0xb46a('0x25')](respondWithResult(_0x2ce3d8,null))[_0xb46a('0xaa')](handleError(_0x2ce3d8,null));};exports['getMessages']=function(_0x4bb2d0,_0x52619b,_0x205b4b){var _0x1315e9={'raw':![],'where':{}};var _0x2ac26a={};var _0x8ee98c={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xb46a('0xb5')]({'where':{'id':_0x4bb2d0['params']['id']}})['then'](handleEntityNotFound(_0x52619b,null))[_0xb46a('0x25')](function(_0x3d23cc){if(_0x3d23cc){_0x2ac26a[_0xb46a('0x3c')]=_[_0xb46a('0xac')](db[_0xb46a('0xb2')][_0xb46a('0xad')]);_0x2ac26a[_0xb46a('0x3d')]=_[_0xb46a('0xac')](_0x4bb2d0[_0xb46a('0x3d')]);_0x2ac26a['filters']=_['intersection'](_0x2ac26a[_0xb46a('0x3c')],_0x2ac26a[_0xb46a('0x3d')]);_0x1315e9[_0xb46a('0x3f')]=_[_0xb46a('0x3e')](_0x2ac26a['model'],qs[_0xb46a('0x40')](_0x4bb2d0[_0xb46a('0x3d')][_0xb46a('0x40')]));_0x1315e9[_0xb46a('0x3f')]=_0x1315e9[_0xb46a('0x3f')][_0xb46a('0x5c')]?_0x1315e9['attributes']:_0x2ac26a[_0xb46a('0x3c')];if(!_0x4bb2d0['query'][_0xb46a('0x41')]('nolimit')){_0x1315e9[_0xb46a('0x20')]=qs[_0xb46a('0x20')](_0x4bb2d0[_0xb46a('0x3d')][_0xb46a('0x20')]);_0x1315e9[_0xb46a('0x1e')]=qs[_0xb46a('0x1e')](_0x4bb2d0[_0xb46a('0x3d')][_0xb46a('0x1e')]);}_0x1315e9[_0xb46a('0x42')]=qs['sort'](_0x4bb2d0[_0xb46a('0x3d')][_0xb46a('0x43')]);_0x1315e9[_0xb46a('0x44')]=qs[_0xb46a('0x46')](_[_0xb46a('0x45')](_0x4bb2d0['query'],_0x2ac26a[_0xb46a('0x46')]));_0x1315e9[_0xb46a('0x44')][_0xb46a('0xa8')]=_0x3d23cc['id'];if(_0x4bb2d0[_0xb46a('0x3d')]['filter']){_0x1315e9[_0xb46a('0x44')]=_['merge'](_0x1315e9[_0xb46a('0x44')],{'$or':_[_0xb46a('0x2a')](_0x1315e9[_0xb46a('0x3f')],function(_0x41e29a){var _0x4d3c95={};_0x4d3c95[_0x41e29a]={'$like':'%'+_0x4bb2d0['query'][_0xb46a('0x81')]+'%'};return _0x4d3c95;})});}if(_0x4bb2d0[_0xb46a('0x3d')][_0xb46a('0x78')]){var _0x8cf633=_0x4bb2d0[_0xb46a('0x3d')][_0xb46a('0x78')][_0xb46a('0x2d')](',');var _0x4b8fa1={};_0x4b8fa1[_0x8cf633[0x0]]={'$gte':moment(_0x8cf633[0x1])['format'](_0xb46a('0xb6'))};_0x1315e9[_0xb46a('0x44')]=_[_0xb46a('0x96')](_0x1315e9[_0xb46a('0x44')],_0x4b8fa1);}_0x1315e9=_[_0xb46a('0x96')]({},_0x1315e9,_0x4bb2d0['options']);return db[_0xb46a('0xb2')][_0xb46a('0x21')]({'where':_0x1315e9[_0xb46a('0x44')]})[_0xb46a('0x25')](function(_0x2f841e){_0x8ee98c[_0xb46a('0x21')]=_0x2f841e;if(_0x4bb2d0[_0xb46a('0x3d')][_0xb46a('0xae')]){_0x1315e9[_0xb46a('0xb7')]=[{'all':!![]}];}return db[_0xb46a('0xb2')]['findAll'](_0x1315e9);})['then'](function(_0x150fe3){_0x8ee98c[_0xb46a('0xa9')]=_0x150fe3;return _0x8ee98c;});}})[_0xb46a('0x25')](respondWithFilteredResult(_0x52619b,_0x1315e9))[_0xb46a('0xaa')](handleError(_0x52619b,null));};exports[_0xb46a('0xb8')]=function(_0x6ceed7,_0x4d7309,_0x40932b){return db[_0xb46a('0x39')][_0xb46a('0x5d')]({'where':{'id':_0x6ceed7[_0xb46a('0xab')]['id']}})[_0xb46a('0x25')](handleEntityNotFound(_0x4d7309,null))[_0xb46a('0x25')](function(_0xbb8e52){if(_0xbb8e52){return _0xbb8e52[_0xb46a('0xb9')](_0x6ceed7[_0xb46a('0x70')][_0xb46a('0xb3')],_['omit'](_0x6ceed7[_0xb46a('0x70')],[_0xb46a('0xb3'),'id'])||{})['spread'](function(){return db[_0xb46a('0x6c')][_0xb46a('0xba')]({'attributes':['id',_0xb46a('0x28'),_0xb46a('0x48')],'where':{'id':_0x6ceed7[_0xb46a('0x70')][_0xb46a('0xb3')]}});})[_0xb46a('0x25')](function(_0x9f9387){socket[_0xb46a('0xbb')](_0xb46a('0xbc'),{'id':Number(_0x6ceed7[_0xb46a('0xab')]['id']),'tags':_0x9f9387||[]});return{'id':Number(_0x6ceed7[_0xb46a('0xab')]['id']),'tags':_0x9f9387||[]};});}})['then'](respondWithResult(_0x4d7309,null))[_0xb46a('0xaa')](handleError(_0x4d7309,null));};exports[_0xb46a('0xbd')]=function(_0x4cb2da,_0xe2147d,_0x30d8f0){return db[_0xb46a('0x39')][_0xb46a('0x5d')]({'where':{'id':_0x4cb2da[_0xb46a('0xab')]['id']}})[_0xb46a('0x25')](handleEntityNotFound(_0xe2147d,null))[_0xb46a('0x25')](function(_0x2c6772){if(_0x2c6772){return _0x2c6772[_0xb46a('0xbd')](_0x4cb2da[_0xb46a('0x3d')][_0xb46a('0xb3')]);}})[_0xb46a('0x25')](respondWithStatusCode(_0xe2147d,null))[_0xb46a('0xaa')](handleError(_0xe2147d,null));};exports[_0xb46a('0xbe')]=function(_0x1c6394,_0x52804f){var _0x5acff5=moment()[_0xb46a('0xbf')]()['toString']();var _0x571fa9=path[_0xb46a('0xc0')](config[_0xb46a('0xc1')],_0xb46a('0xc2'),'files','tmp');var _0x3b97c2=path[_0xb46a('0xc0')](config[_0xb46a('0xc1')],_0xb46a('0xc2'),_0xb46a('0xc3'),_0xb46a('0xc4'));var _0x4830a0=path['join'](_0x571fa9,_0x5acff5);var _0x2a0029=util['format']('transcript-%d-%s.zip',_0x1c6394[_0xb46a('0xab')]['id'],_0x5acff5);var _0x18e03a=path[_0xb46a('0xc0')](_0x571fa9,_0x2a0029);var _0x4fb4b7=[];_0x4fb4b7['push']({'model':db['User'],'as':_0xb46a('0xc5'),'attributes':['id','fullname'],'raw':!![]});_0x4fb4b7[_0xb46a('0x30')]({'model':db[_0xb46a('0xc6')],'as':_0xb46a('0x62'),'attributes':['id',_0xb46a('0xc7'),'lastName'],'raw':!![]});if(_0x1c6394[_0xb46a('0x3d')][_0xb46a('0xc4')]){_0x4fb4b7[_0xb46a('0x30')]({'model':db[_0xb46a('0xc8')],'as':_0xb46a('0xc8'),'raw':!![]});}var _0x14d85b=[{'model':db[_0xb46a('0xb2')],'as':_0xb46a('0xc9'),'attributes':['id',_0xb46a('0x70'),'createdAt',_0xb46a('0xca'),_0xb46a('0xcb'),_0xb46a('0x7d')],'include':_0x4fb4b7}];_0x14d85b[_0xb46a('0x30')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0xb46a('0x28')]});_0x14d85b[_0xb46a('0x30')]({'model':db[_0xb46a('0xc5')],'as':'Owner','attributes':['id',_0xb46a('0x2b')]});return db[_0xb46a('0x39')][_0xb46a('0x5d')]({'where':{'id':_0x1c6394[_0xb46a('0xab')]['id']},'include':_0x14d85b})[_0xb46a('0x25')](handleEntityNotFound(_0x52804f,null))['then'](function(_0x2f4447){if(_0x2f4447){var _0x59a395=_0x2f4447[_0xb46a('0xcc')]({'plain':!![]});fs[_0xb46a('0xcd')](_0x4830a0);var _0x295974={'channel':_0xb46a('0xce'),'account':_0x59a395[_0xb46a('0xcf')][_0xb46a('0x28')],'agent':_0x59a395[_0xb46a('0xd0')]?_0x59a395[_0xb46a('0xd0')]['fullname']:_0xb46a('0xd1'),'createdAt':moment(_0x59a395['createdAt'])['format'](_0xb46a('0xb6'))[_0xb46a('0x94')](),'closedAt':_0x59a395['closed']?moment(_0x59a395[_0xb46a('0xd2')])[_0xb46a('0xd3')](_0xb46a('0xb6'))[_0xb46a('0x94')]():'','disposition':_0x59a395[_0xb46a('0xd4')],'visibility':_0x59a395[_0xb46a('0xd5')]?_0xb46a('0xd6'):'Private','messages':_(_0x59a395[_0xb46a('0xc9')])[_0xb46a('0x81')]({'secret':![]})[_0xb46a('0x2a')](function(_0x595042){if(_0x595042['Attachment']){var _0x8daf6a=path[_0xb46a('0xc0')](_0x3b97c2,_0x595042['Attachment'][_0xb46a('0xd7')]);if(fs['existsSync'](_0x8daf6a)){fs['createReadStream'](_0x8daf6a)[_0xb46a('0xd8')](fs['createWriteStream'](path[_0xb46a('0xc0')](_0x4830a0,_0x595042[_0xb46a('0xc8')]['basename'])));}}return{'date':moment(_0x595042['createdAt'])[_0xb46a('0xd3')](_0xb46a('0xb6'))[_0xb46a('0x94')](),'sender':_0x595042[_0xb46a('0xca')]==='out'?_0x595042[_0xb46a('0xc5')]?_0x595042['User'][_0xb46a('0x2b')]:'System':_0x595042['Contact']['firstName']+(_0x595042[_0xb46a('0x62')][_0xb46a('0xd9')]?'\x20'+_0x595042[_0xb46a('0x62')]['lastName']:''),'body':_0x595042[_0xb46a('0xc8')]?_0x595042[_0xb46a('0xc8')][_0xb46a('0xd7')]:_0x595042[_0xb46a('0x70')],'direction':_0x595042[_0xb46a('0xca')]===_0xb46a('0xda')?'A':'C','secret':_0x595042[_0xb46a('0xcb')],'read':_0x595042[_0xb46a('0x7d')],'attachment':_0x595042[_0xb46a('0xc8')]};})[_0xb46a('0x5f')]()};return ejs['renderFile'](path[_0xb46a('0xc0')](config['root'],_0xb46a('0xc2'),'views','downloadInteraction.ejs'),{'interaction':_0x295974})['then'](function(_0x486c91){var _0x3b5b5a=path[_0xb46a('0xc0')](_0x4830a0,_0xb46a('0xdb')+_0x59a395['id']+'-'+_0x5acff5+'.pdf');var _0x175c1c={'path':_0x3b5b5a,'channel':'Openchannel','interactionId':_0x59a395['id']};return pdf[_0xb46a('0xdc')](_0x486c91,_0x175c1c);})[_0xb46a('0x25')](function(){return new BPromise(function(_0x399698,_0x343c0b){zipdir(_0x4830a0,{'saveTo':_0x18e03a},function(_0x1bf23a,_0x2442f4){if(_0x1bf23a)return _0x343c0b(_0x1bf23a);return _0x399698(_0x2442f4);});})[_0xb46a('0x25')](function(){return new BPromise(function(_0x23d7a9,_0x342e96){rimraf(_0x4830a0,function(_0x2c6d65){if(_0x2c6d65)_0x342e96(_0x2c6d65);return _0x23d7a9();});});})[_0xb46a('0x25')](function(){return _0x52804f[_0xb46a('0xbe')](_0x18e03a,_0x2a0029,function(_0x4708e2){if(_0x4708e2){console['log'](_0xb46a('0xdd'),_0x4708e2);}else{fs['unlinkSync'](_0x18e03a);}});});});}else{return _0x52804f[_0xb46a('0x1a')](0xc8);}})[_0xb46a('0xaa')](handleError(_0x52804f,null));};
\ No newline at end of file
+var _0xb1b8=['openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','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','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','isEmpty','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','agent','user','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','rows','show','params','includeAll','include','create','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','options','setTags','spread','findAll','emit','openchannelInteractionTags:save','removeTags','root','server','files','join','attachments','format','transcript-%d-%s.zip','User','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','OpenchannelAccount','Owner','get','mkdirSync','Openchannel','Account','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','secret','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','update','then','destroy','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','user_has_openchannel_interactions','left_join','users','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL'];(function(_0x2f5e81,_0x49c319){var _0x5e4f0e=function(_0x3343d8){while(--_0x3343d8){_0x2f5e81['push'](_0x2f5e81['shift']());}};_0x5e4f0e(++_0x49c319);}(_0xb1b8,0x8f));var _0x8b1b=function(_0x437560,_0xc5d67f){_0x437560=_0x437560-0x0;var _0x278361=_0xb1b8[_0x437560];return _0x278361;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b1b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8b1b('0x1'));var moment=require(_0x8b1b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8b1b('0x3'));var util=require(_0x8b1b('0x4'));var path=require(_0x8b1b('0x5'));var sox=require(_0x8b1b('0x6'));var csv=require(_0x8b1b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b1b('0x8'));var _=require(_0x8b1b('0x9'));var squel=require('squel');var crypto=require(_0x8b1b('0xa'));var jsforce=require(_0x8b1b('0xb'));var deskjs=require(_0x8b1b('0xc'));var toCsv=require(_0x8b1b('0x7'));var querystring=require(_0x8b1b('0xd'));var Papa=require(_0x8b1b('0xe'));var Redis=require(_0x8b1b('0xf'));var authService=require(_0x8b1b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8b1b('0x11'));var pdf=require(_0x8b1b('0x12'));var hardwareService=require(_0x8b1b('0x13'));var logger=require(_0x8b1b('0x14'))(_0x8b1b('0x15'));var utils=require('../../config/utils');var config=require(_0x8b1b('0x16'));var licenseUtil=require(_0x8b1b('0x17'));var db=require(_0x8b1b('0x18'))['db'];config[_0x8b1b('0x19')]=_[_0x8b1b('0x1a')](config[_0x8b1b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8b1b('0x1b'))(new Redis(config[_0x8b1b('0x19')]));require(_0x8b1b('0x1c'))[_0x8b1b('0x1d')](socket);function respondWithStatusCode(_0x4d3720,_0x1da831){_0x1da831=_0x1da831||0xcc;return function(_0x303fa2){if(_0x303fa2){return _0x4d3720[_0x8b1b('0x1e')](_0x1da831);}return _0x4d3720[_0x8b1b('0x1f')](_0x1da831)[_0x8b1b('0x20')]();};}function respondWithResult(_0x2aa453,_0x264c57){_0x264c57=_0x264c57||0xc8;return function(_0x3d7682){if(_0x3d7682){return _0x2aa453[_0x8b1b('0x1f')](_0x264c57)[_0x8b1b('0x21')](_0x3d7682);}};}function respondWithFilteredResult(_0x51c14d,_0x2a3db1){return function(_0x4358db){if(_0x4358db){var _0x522261=typeof _0x2a3db1['offset']===_0x8b1b('0x22')&&typeof _0x2a3db1[_0x8b1b('0x23')]===_0x8b1b('0x22');var _0x4e1caf=_0x4358db[_0x8b1b('0x24')];var _0x287a25=_0x522261?0x0:_0x2a3db1[_0x8b1b('0x25')];var _0x1ced2c=_0x522261?_0x4358db[_0x8b1b('0x24')]:_0x2a3db1['offset']+_0x2a3db1[_0x8b1b('0x23')];var _0x20b31a;if(_0x1ced2c>=_0x4e1caf){_0x1ced2c=_0x4e1caf;_0x20b31a=0xc8;}else{_0x20b31a=0xce;}_0x51c14d[_0x8b1b('0x1f')](_0x20b31a);return _0x51c14d[_0x8b1b('0x26')]('Content-Range',_0x287a25+'-'+_0x1ced2c+'/'+_0x4e1caf)[_0x8b1b('0x21')](_0x4358db);}return null;};}function patchUpdates(_0x1a6838){return function(_0x3b8e93){try{jsonpatch[_0x8b1b('0x27')](_0x3b8e93,_0x1a6838,!![]);}catch(_0x51ec83){return BPromise['reject'](_0x51ec83);}return _0x3b8e93['save']();};}function saveUpdates(_0x5927b2,_0x15f081){return function(_0xd6ba14){if(_0xd6ba14){return _0xd6ba14[_0x8b1b('0x28')](_0x5927b2)[_0x8b1b('0x29')](function(_0x17fefd){return _0x17fefd;});}return null;};}function removeEntity(_0x52803c,_0x560717){return function(_0x56e4b5){if(_0x56e4b5){return _0x56e4b5[_0x8b1b('0x2a')]()[_0x8b1b('0x29')](function(){_0x52803c['status'](0xcc)[_0x8b1b('0x20')]();});}};}function handleEntityNotFound(_0xbfd7,_0x4001b0){return function(_0x27cfa4){if(!_0x27cfa4){_0xbfd7[_0x8b1b('0x1e')](0x194);}return _0x27cfa4;};}function handleError(_0x2a4d5d,_0x53bdf0){_0x53bdf0=_0x53bdf0||0x1f4;return function(_0x1fa88c){logger['error'](_0x1fa88c['stack']);if(_0x1fa88c[_0x8b1b('0x2b')]){delete _0x1fa88c[_0x8b1b('0x2b')];}_0x2a4d5d[_0x8b1b('0x1f')](_0x53bdf0)[_0x8b1b('0x2c')](_0x1fa88c);};}function getInteractionUsers(_0x4c6c77,_0x5b4685){return new BPromise(function(_0x11b06b,_0x5309df){try{if(_0x5b4685[_0x4c6c77['id']]){_0x4c6c77[_0x8b1b('0x2d')]=_[_0x8b1b('0x2e')](_0x5b4685[_0x4c6c77['id']],function(_0x58d7d3){return{'id':_0x58d7d3['id'],'fullname':_0x58d7d3[_0x8b1b('0x2f')]};});}}catch(_0x9489d5){_0x5309df(_0x9489d5);}_0x11b06b(_0x4c6c77);});}function getInteractionTags(_0x43f0d1,_0x3c8065){return new BPromise(function(_0x5121bd,_0x46a9c1){try{if(_0x43f0d1[_0x8b1b('0x30')]){_0x43f0d1[_0x8b1b('0x31')]=[];_0x43f0d1[_0x8b1b('0x30')][_0x8b1b('0x32')](',')[_0x8b1b('0x33')](function(_0x4ad692){_0x43f0d1[_0x8b1b('0x31')][_0x8b1b('0x34')](_0x3c8065[_0x4ad692]);});}delete _0x43f0d1['TagIds'];}catch(_0x2ac3cb){_0x46a9c1(_0x2ac3cb);}_0x5121bd(_0x43f0d1);});}function updateOpenchannelInteraction(_0x1f3eb6,_0x4f3215,_0x17bbea){return new BPromise(function(_0x5dd2b0,_0x176515){return getInteractionUsers(_0x1f3eb6,_0x17bbea)[_0x8b1b('0x29')](function(_0xaa66cc){return getInteractionTags(_0xaa66cc,_0x4f3215);})[_0x8b1b('0x29')](function(_0x4ef8c6){return getStateInteraction(_0x4ef8c6);})[_0x8b1b('0x29')](function(_0x598a47){_0x5dd2b0(_0x598a47);})[_0x8b1b('0x35')](function(_0x37d3df){_0x176515(_0x37d3df);});});}function getStateInteraction(_0x51f607){return new BPromise(function(_0x5e1e3c){_0x51f607[_0x8b1b('0x36')]=0x0;_0x51f607[_0x8b1b('0x37')]=0x0;_0x51f607[_0x8b1b('0x38')]=0x0;_0x51f607[_0x8b1b('0x39')]=0x0;_0x51f607[_0x8b1b('0x3a')]=0x0;if(!_0x51f607[_0x8b1b('0x3b')]&&!_0x51f607[_0x8b1b('0x3c')]){_0x51f607[_0x8b1b('0x36')]+=0x1;}if(!_0x51f607[_0x8b1b('0x3b')]&&_0x51f607[_0x8b1b('0x3c')]){_0x51f607[_0x8b1b('0x37')]+=0x1;if(_0x51f607[_0x8b1b('0x36')]){_0x51f607[_0x8b1b('0x36')]-=0x1;}}if(_0x51f607[_0x8b1b('0x3b')]&&_0x51f607[_0x8b1b('0x3c')]){_0x51f607[_0x8b1b('0x38')]+=0x1;if(_0x51f607[_0x8b1b('0x37')]){_0x51f607[_0x8b1b('0x37')]-=0x1;}}if(_0x51f607[_0x8b1b('0x3b')]&&!_0x51f607[_0x8b1b('0x3c')]){_0x51f607[_0x8b1b('0x39')]+=0x1;if(_0x51f607[_0x8b1b('0x36')]){_0x51f607['waiting']-=0x1;}}_0x51f607[_0x8b1b('0x3a')]+=0x1;_0x5e1e3c(_0x51f607);});}exports[_0x8b1b('0x3d')]=function(_0x448f68,_0xa98c10){var _0x320daf={},_0x43508b={},_0x2f56c3={'count':0x0,'rows':[]};var _0x3b2bc5=_[_0x8b1b('0x2e')](db[_0x8b1b('0x3e')][_0x8b1b('0x3f')],function(_0x2bfe05){return{'name':_0x2bfe05[_0x8b1b('0x40')],'type':_0x2bfe05[_0x8b1b('0x41')][_0x8b1b('0x42')]};});_0x43508b['model']=_[_0x8b1b('0x2e')](_0x3b2bc5,_0x8b1b('0x2b'));_0x43508b[_0x8b1b('0x43')]=_[_0x8b1b('0x44')](_0x448f68[_0x8b1b('0x43')]);_0x43508b[_0x8b1b('0x45')]=_['intersection'](_0x43508b[_0x8b1b('0x46')],_0x43508b[_0x8b1b('0x43')]);_0x320daf[_0x8b1b('0x47')]=_[_0x8b1b('0x48')](_0x43508b[_0x8b1b('0x46')],qs[_0x8b1b('0x49')](_0x448f68[_0x8b1b('0x43')]['fields']));_0x320daf[_0x8b1b('0x47')]=_0x320daf[_0x8b1b('0x47')][_0x8b1b('0x4a')]?_0x320daf[_0x8b1b('0x47')]:_0x43508b[_0x8b1b('0x46')];if(!_0x448f68[_0x8b1b('0x43')][_0x8b1b('0x4b')](_0x8b1b('0x4c'))){_0x320daf[_0x8b1b('0x23')]=qs[_0x8b1b('0x23')](_0x448f68['query'][_0x8b1b('0x23')]);_0x320daf[_0x8b1b('0x25')]=qs[_0x8b1b('0x25')](_0x448f68[_0x8b1b('0x43')]['offset']);}_0x320daf[_0x8b1b('0x4d')]=qs[_0x8b1b('0x4e')](_0x448f68['query'][_0x8b1b('0x4e')]);_0x320daf[_0x8b1b('0x4f')]=qs[_0x8b1b('0x45')](_[_0x8b1b('0x50')](_0x448f68[_0x8b1b('0x43')],_0x43508b[_0x8b1b('0x45')]),_0x3b2bc5);var _0x5948eb=[];var _0x1abd30=squel[_0x8b1b('0x51')]()[_0x8b1b('0x52')]('id')[_0x8b1b('0x52')](_0x8b1b('0x2b'))[_0x8b1b('0x52')](_0x8b1b('0x53'))[_0x8b1b('0x54')]('tools_tags');var _0x21c8ad=squel[_0x8b1b('0x51')]()[_0x8b1b('0x52')](_0x8b1b('0x55'))[_0x8b1b('0x52')]('u.fullname')[_0x8b1b('0x52')]('ui.OpenchannelInteractionId')[_0x8b1b('0x54')](_0x8b1b('0x56'),'ui')[_0x8b1b('0x57')](_0x8b1b('0x58'),'u','u.id\x20=\x20ui.UserId');var _0x2b3c23=squel[_0x8b1b('0x51')]()['from'](_0x8b1b('0x59'),'i')[_0x8b1b('0x57')](_0x8b1b('0x5a'),'c',_0x8b1b('0x5b'))[_0x8b1b('0x57')](_0x8b1b('0x58'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x8b1b('0x5c'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x8b1b('0x57')](_0x8b1b('0x5d'),'me',_0x8b1b('0x5e'))[_0x8b1b('0x57')](_0x8b1b('0x5f'),'it',_0x8b1b('0x60'))[_0x8b1b('0x57')](_0x8b1b('0x61'),'t',_0x8b1b('0x62'));var _0x5b445c=squel[_0x8b1b('0x63')]();var _0x5bc955=[];var _0x4502dd=squel['expr']();var _0x554396;if(_0x448f68[_0x8b1b('0x43')][_0x8b1b('0x64')]){_0x554396=as[_0x8b1b('0x65')](_0x448f68[_0x8b1b('0x43')][_0x8b1b('0x64')]);var _0x370caf=_0x554396['sqlOperator'];for(var _0x5d79fd=0x0;_0x5d79fd<_0x554396[_0x8b1b('0x66')][_0x8b1b('0x4a')];_0x5d79fd++){var _0x13919d=_0x554396[_0x8b1b('0x66')][_0x5d79fd];var _0x3042cc='i';var _0x7b135f=_[_0x8b1b('0x67')](_0x3b2bc5,[_0x8b1b('0x2b'),_0x13919d[_0x8b1b('0x52')]]);if(!_0x7b135f){switch(_0x13919d[_0x8b1b('0x52')]){case'unreadMessages':if(_0x13919d[_0x8b1b('0x68')]==0x1){_0x2b3c23[_0x8b1b('0x69')]('`'+_0x13919d[_0x8b1b('0x52')]+_0x8b1b('0x6a'));}else{_0x2b3c23[_0x8b1b('0x69')]('`'+_0x13919d[_0x8b1b('0x52')]+_0x8b1b('0x6b'));}break;case'Contact':if(_0x13919d[_0x8b1b('0x6c')]===_0x8b1b('0x6d')){if(_0x13919d['value'][_0x8b1b('0x32')]('\x20')[_0x8b1b('0x4a')]>0x1){_0x5b445c[_0x370caf]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8b1b('0x6e')](_0x13919d['value']),null);}else{var _0x938ad0='%'+_0x13919d[_0x8b1b('0x68')]+'%';_0x5b445c[_0x370caf](_0x8b1b('0x6f'),_0x938ad0,_0x938ad0,_0x938ad0);}}else{_0x7b135f=_[_0x8b1b('0x67')](_0x3b2bc5,[_0x8b1b('0x2b'),_0x8b1b('0x70')]);_0x13919d['field']=_0x8b1b('0x70');_0x1ea967=as[_0x8b1b('0x71')](_0x3042cc,_0x7b135f['type'],_0x13919d);_0x5b445c[_0x370caf](_0x1ea967[_0x8b1b('0x72')],_0x1ea967['value'][_0x8b1b('0x73')],_0x1ea967['value'][_0x8b1b('0x20')]);}break;case _0x8b1b('0x74'):var _0x5ceea1=_0x13919d['value'][_0x8b1b('0x32')](',')[_0x8b1b('0x2e')](function(_0x309f2f){return Number(_0x309f2f);});_0x5ceea1[_0x8b1b('0x33')](function(_0x78a6ec){_0x4502dd['or'](_0x8b1b('0x75'),'%,'+_0x78a6ec+',%');});_0x5bc955=_[_0x8b1b('0x76')](_0x5bc955,_0x5ceea1);break;case'User':if(_0x13919d[_0x8b1b('0x6c')]==='$substring'){_0x5b445c[_0x370caf](_0x8b1b('0x77'),'%'+_0x13919d[_0x8b1b('0x68')]+'%',null);}else{_0x7b135f=_[_0x8b1b('0x67')](_0x3b2bc5,[_0x8b1b('0x2b'),_0x8b1b('0x3c')]);_0x13919d['field']='UserId';_0x1ea967=as[_0x8b1b('0x71')](_0x3042cc,_0x7b135f[_0x8b1b('0x41')],_0x13919d);_0x5b445c[_0x370caf](_0x1ea967['text'],_0x1ea967[_0x8b1b('0x68')][_0x8b1b('0x73')],_0x1ea967[_0x8b1b('0x68')]['end']);}break;case'body':_0x1ea967=as[_0x8b1b('0x71')]('me',null,_0x13919d);_0x5b445c[_0x370caf](_0x1ea967[_0x8b1b('0x72')],_0x1ea967[_0x8b1b('0x68')][_0x8b1b('0x73')],_0x1ea967[_0x8b1b('0x68')]['end']);break;}}else{var _0x1ea967=as['buildExpression'](_0x3042cc,_0x7b135f[_0x8b1b('0x41')],_0x13919d);_0x5b445c[_0x370caf](_0x1ea967[_0x8b1b('0x72')],_0x1ea967['value'][_0x8b1b('0x73')],_0x1ea967[_0x8b1b('0x68')][_0x8b1b('0x20')]);}}}else{var _0xebd737=_(_0x448f68[_0x8b1b('0x43')])[_0x8b1b('0x44')]()[_0x8b1b('0x2e')](function(_0x577be6){return _[_0x8b1b('0x78')](_0x3b2bc5,[_0x8b1b('0x2b'),_0x577be6])?_0x577be6:undefined;})['compact']()[_0x8b1b('0x68')]();if(!_[_0x8b1b('0x79')](_0xebd737)){_0xebd737[_0x8b1b('0x33')](function(_0x2a230b){if(_0x2a230b==='OpenchannelAccountId'){_0x2b3c23[_0x8b1b('0x4f')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x8b1b('0x7a')](_0x448f68[_0x8b1b('0x43')][_0x2a230b]));}else if(_0x2a230b===_0x8b1b('0x7b')){var _0x2e1d0e=JSON[_0x8b1b('0x7c')](_0x448f68['query'][_0x2a230b])['$gte'];var _0x3abf87=JSON[_0x8b1b('0x7c')](_0x448f68[_0x8b1b('0x43')][_0x2a230b])['$lte'];_0x2b3c23[_0x8b1b('0x4f')](_0x8b1b('0x7d'),_0x2e1d0e,_0x3abf87);}else{if(_0x448f68['query'][_0x2a230b]===_0x8b1b('0x7e')){_0x2b3c23['where']('i.'+_0x2a230b+'\x20IS\x20NULL');}else{_0x2b3c23[_0x8b1b('0x4f')]('i.'+_0x2a230b+'\x20=\x20?',_0x448f68[_0x8b1b('0x43')][_0x2a230b]);}}});}if(_0x448f68['query'][_0x8b1b('0x7f')]){if(_0x448f68[_0x8b1b('0x43')][_0x8b1b('0x7f')]==0x1){_0x2b3c23[_0x8b1b('0x69')]('`unreadMessages`\x20=\x200');}else{_0x2b3c23[_0x8b1b('0x69')]('`unreadMessages`\x20>\x200');}}if(_0x448f68[_0x8b1b('0x43')][_0x8b1b('0x80')]){_0x5bc955=_['isArray'](_0x448f68['query']['tag'])?_0x448f68[_0x8b1b('0x43')]['tag']:new Array(_0x448f68[_0x8b1b('0x43')]['tag']);_0x5bc955[_0x8b1b('0x33')](function(_0x4773df){_0x4502dd['or'](_0x8b1b('0x75'),'%,'+_0x4773df+',%');});}if(_0x448f68[_0x8b1b('0x43')]['filter']){var _0x4036af=_0x448f68[_0x8b1b('0x43')][_0x8b1b('0x81')][_0x8b1b('0x82')]('\x5c','\x5c\x5c')[_0x8b1b('0x82')](/'/g,'\x27\x27');if(qs[_0x8b1b('0x83')](_0x4036af)){_0x5b445c['or'](_0x8b1b('0x84'),_0x4036af+'%');}else{_0x5b445c['or'](_0x8b1b('0x85'),qs['getFullTextValue'](_0x4036af))['or'](_0x8b1b('0x86'),_0x4036af+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4036af+'%');}}}_0x2b3c23[_0x8b1b('0x4f')](_0x5b445c);_0x2b3c23['group'](_0x8b1b('0x87'));var _0x2ce0d3={'type':db[_0x8b1b('0x88')][_0x8b1b('0x89')]['SELECT'],'raw':!![]};var _0x96b126=_0x2b3c23['clone']();_0x96b126[_0x8b1b('0x52')](_0x8b1b('0x87'));_0x96b126['field'](_0x8b1b('0x8a'),_0x8b1b('0x8b'));if(_0x320daf[_0x8b1b('0x4d')]){_0x320daf['order'][_0x8b1b('0x33')](function(_0x24debe){var _0x2ffe5=_0x24debe[0x0]===_0x8b1b('0x8c')?_0x24debe[0x0]:'i.'+_0x24debe[0x0];_0x2b3c23[_0x8b1b('0x4d')](_0x2ffe5,_0x24debe[0x1]===_0x8b1b('0x8d')?![]:!![]);});}if(!_[_0x8b1b('0x79')](_0x5bc955)){_0x2b3c23[_0x8b1b('0x69')](_0x4502dd);_0x96b126[_0x8b1b('0x4f')](_0x8b1b('0x8e'),_0x5bc955);}BPromise[_0x8b1b('0x8f')]()['then'](function(){if(!_0x554396){if(_0x448f68[_0x8b1b('0x43')][_0x8b1b('0x90')])return;_0x96b126['where'](_0x8b1b('0x91'));_0x2b3c23['where'](_0x8b1b('0x91'));return;}if(_0x448f68['user']['role']!==_0x8b1b('0x92'))return;return _0x448f68[_0x8b1b('0x93')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x8b1b('0x29')](function(_0x15da6a){if(_[_0x8b1b('0x79')](_0x15da6a)){_0x96b126[_0x8b1b('0x4f')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x2b3c23[_0x8b1b('0x4f')](_0x8b1b('0x94'));}else{_0x96b126[_0x8b1b('0x4f')](_0x8b1b('0x95'),_[_0x8b1b('0x2e')](_0x15da6a,'id'));_0x2b3c23[_0x8b1b('0x4f')](_0x8b1b('0x95'),_[_0x8b1b('0x2e')](_0x15da6a,'id'));}});})[_0x8b1b('0x29')](function(){if(_0x448f68[_0x8b1b('0x93')]['role']===_0x8b1b('0x92')&&!_0x554396&&!_0x448f68[_0x8b1b('0x43')][_0x8b1b('0x90')])return[];return db[_0x8b1b('0x96')][_0x8b1b('0x43')](_0x96b126[_0x8b1b('0x97')](),_0x2ce0d3);})[_0x8b1b('0x29')](function(_0x544a95){_0x2f56c3[_0x8b1b('0x24')]=_0x544a95['length'];if(_0x2f56c3[_0x8b1b('0x24')]===0x0)return[];return db[_0x8b1b('0x96')]['query'](_0x1abd30[_0x8b1b('0x97')](),_0x2ce0d3)[_0x8b1b('0x29')](function(_0x45745b){_0x5948eb=_['keyBy'](_0x45745b,'id');_0x2ce0d3=_[_0x8b1b('0x98')](_0x2ce0d3,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x448f68[_0x8b1b('0x43')][_0x8b1b('0x49')]){_0x320daf[_0x8b1b('0x47')][_0x8b1b('0x33')](function(_0x315845){_0x2b3c23['field']('i.'+_0x315845);});}else{_0x2b3c23[_0x8b1b('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8b1b('0x8b'));_0x2b3c23['field'](_0x8b1b('0x99'),_0x8b1b('0x9a'));_0x2b3c23[_0x8b1b('0x52')](_0x8b1b('0x9b'),_0x8b1b('0x9c'));_0x2b3c23['field']('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',_0x8b1b('0x8c'));_0x2b3c23['field'](_0x8b1b('0x9d'));_0x2b3c23['field']('c.firstName',_0x8b1b('0x9e'));_0x2b3c23['field'](_0x8b1b('0x9f'),_0x8b1b('0xa0'));_0x2b3c23[_0x8b1b('0x52')](_0x8b1b('0xa1'),_0x8b1b('0xa2'));_0x2b3c23['field']('c.phone',_0x8b1b('0xa3'));_0x2b3c23['field'](_0x8b1b('0xa4'),_0x8b1b('0xa5'));_0x2b3c23[_0x8b1b('0x52')](_0x8b1b('0xa6'),_0x8b1b('0xa7'));_0x2b3c23[_0x8b1b('0x52')]('o.fullname','Owner.fullname');_0x2b3c23['field'](_0x8b1b('0xa8'),_0x8b1b('0xa9'));_0x2b3c23[_0x8b1b('0x52')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x8b1b('0x30'));}if(_0x320daf[_0x8b1b('0x23')])_0x2b3c23[_0x8b1b('0x23')](_0x320daf[_0x8b1b('0x23')]);if(_0x320daf[_0x8b1b('0x25')])_0x2b3c23[_0x8b1b('0x25')](_0x320daf[_0x8b1b('0x25')]);return db[_0x8b1b('0x96')][_0x8b1b('0x43')](_0x2b3c23['toString'](),_0x2ce0d3);})[_0x8b1b('0x29')](function(_0x1ce13b){if(_0x1ce13b[_0x8b1b('0x4a')]>0x0)_0x21c8ad[_0x8b1b('0x4f')](_0x8b1b('0xaa'),_[_0x8b1b('0x2e')](_0x1ce13b,'id'));return db['sequelize'][_0x8b1b('0x43')](_0x21c8ad[_0x8b1b('0x97')](),_0x2ce0d3)[_0x8b1b('0x29')](function(_0x5f3604){var _0x40a037=_['groupBy'](_0x5f3604,_0x8b1b('0xab'));var _0x216deb=[];_0x1ce13b[_0x8b1b('0x33')](function(_0x29d17d){_0x216deb[_0x8b1b('0x34')](updateOpenchannelInteraction(_0x29d17d,_0x5948eb,_0x40a037));});return BPromise['all'](_0x216deb);});});})['then'](function(_0x51e5ee){_0x2f56c3[_0x8b1b('0xac')]=_0x51e5ee;return _0x2f56c3;})[_0x8b1b('0x29')](respondWithFilteredResult(_0xa98c10,_0x320daf))['catch'](handleError(_0xa98c10,null));};exports[_0x8b1b('0xad')]=function(_0x931c09,_0x23c8f8){var _0x26ff98={};if(_0x931c09[_0x8b1b('0x43')][_0x8b1b('0x41')]&&_0x931c09['query'][_0x8b1b('0x41')]===_0x8b1b('0x54')){_0x26ff98[_0x8b1b('0x54')]=_0x931c09['params']['id'];}else{_0x26ff98['id']=_0x931c09[_0x8b1b('0xae')]['id'];}var _0x5bcf1e={'raw':![],'where':_0x26ff98},_0x235afa={};_0x235afa['model']=_['keys'](db[_0x8b1b('0x3e')][_0x8b1b('0x3f')]);_0x235afa[_0x8b1b('0x43')]=_[_0x8b1b('0x44')](_0x931c09[_0x8b1b('0x43')]);_0x235afa[_0x8b1b('0x45')]=_[_0x8b1b('0x48')](_0x235afa['model'],_0x235afa[_0x8b1b('0x43')]);_0x5bcf1e[_0x8b1b('0x47')]=_[_0x8b1b('0x48')](_0x235afa[_0x8b1b('0x46')],qs[_0x8b1b('0x49')](_0x931c09['query'][_0x8b1b('0x49')]));_0x5bcf1e['attributes']=_0x5bcf1e[_0x8b1b('0x47')]['length']?_0x5bcf1e[_0x8b1b('0x47')]:_0x235afa[_0x8b1b('0x46')];if(_0x931c09['query'][_0x8b1b('0xaf')]){_0x5bcf1e[_0x8b1b('0xb0')]=[{'all':!![]}];}_0x5bcf1e=_['merge']({},_0x5bcf1e,_0x931c09['options']);return db['OpenchannelInteraction']['find'](_0x5bcf1e)['then'](handleEntityNotFound(_0x23c8f8,null))[_0x8b1b('0x29')](respondWithResult(_0x23c8f8,null))[_0x8b1b('0x35')](handleError(_0x23c8f8,null));};exports[_0x8b1b('0xb1')]=function(_0x548522,_0x30c51f){return db[_0x8b1b('0x3e')][_0x8b1b('0xb1')](_0x548522['body'],{})['then'](respondWithResult(_0x30c51f,0xc9))[_0x8b1b('0x35')](handleError(_0x30c51f,null));};exports[_0x8b1b('0x28')]=function(_0x3b668a,_0x3df26d){if(_0x3b668a['body']['id']){delete _0x3b668a['body']['id'];}return db[_0x8b1b('0x3e')][_0x8b1b('0x67')]({'where':{'id':_0x3b668a['params']['id']}})[_0x8b1b('0x29')](handleEntityNotFound(_0x3df26d,null))[_0x8b1b('0x29')](saveUpdates(_0x3b668a[_0x8b1b('0xb2')],null))[_0x8b1b('0x29')](respondWithResult(_0x3df26d,null))[_0x8b1b('0x35')](handleError(_0x3df26d,null));};exports[_0x8b1b('0x2a')]=function(_0x1304fd,_0xca3e76){return db[_0x8b1b('0x3e')][_0x8b1b('0x67')]({'where':{'id':_0x1304fd['params']['id']}})[_0x8b1b('0x29')](handleEntityNotFound(_0xca3e76,null))['then'](removeEntity(_0xca3e76,null))[_0x8b1b('0x35')](handleError(_0xca3e76,null));};exports[_0x8b1b('0xb3')]=function(_0x22c7c8,_0xf5ee07){return db['OpenchannelInteraction'][_0x8b1b('0xb3')]()[_0x8b1b('0x29')](respondWithResult(_0xf5ee07,null))[_0x8b1b('0x35')](handleError(_0xf5ee07,null));};exports[_0x8b1b('0xb4')]=function(_0x29e38a,_0x5a819d,_0x4bbecf){return db[_0x8b1b('0xb5')]['find']({'where':{'id':_0x29e38a[_0x8b1b('0xae')]['id']}})[_0x8b1b('0x29')](handleEntityNotFound(_0x5a819d,null))[_0x8b1b('0x29')](function(_0x217d4c){if(_0x217d4c){return _0x217d4c[_0x8b1b('0xb4')](_0x29e38a[_0x8b1b('0xb2')][_0x8b1b('0xb6')],_[_0x8b1b('0xb7')](_0x29e38a[_0x8b1b('0xb2')],[_0x8b1b('0xb6'),'id'])||{});}})[_0x8b1b('0x29')](respondWithResult(_0x5a819d,null))['catch'](handleError(_0x5a819d,null));};exports[_0x8b1b('0xb8')]=function(_0x59751b,_0x186720,_0x2dab57){var _0x28ea2a={'raw':![],'where':{}};var _0x1d504e={};var _0x334426={'count':0x0,'rows':[]};return db[_0x8b1b('0x3e')][_0x8b1b('0xb9')]({'where':{'id':_0x59751b[_0x8b1b('0xae')]['id']}})[_0x8b1b('0x29')](handleEntityNotFound(_0x186720,null))[_0x8b1b('0x29')](function(_0x597cf1){if(_0x597cf1){_0x1d504e['model']=_[_0x8b1b('0x44')](db[_0x8b1b('0xb5')][_0x8b1b('0x3f')]);_0x1d504e[_0x8b1b('0x43')]=_['keys'](_0x59751b[_0x8b1b('0x43')]);_0x1d504e[_0x8b1b('0x45')]=_[_0x8b1b('0x48')](_0x1d504e[_0x8b1b('0x46')],_0x1d504e[_0x8b1b('0x43')]);_0x28ea2a[_0x8b1b('0x47')]=_[_0x8b1b('0x48')](_0x1d504e['model'],qs[_0x8b1b('0x49')](_0x59751b['query'][_0x8b1b('0x49')]));_0x28ea2a[_0x8b1b('0x47')]=_0x28ea2a[_0x8b1b('0x47')][_0x8b1b('0x4a')]?_0x28ea2a[_0x8b1b('0x47')]:_0x1d504e[_0x8b1b('0x46')];if(!_0x59751b['query'][_0x8b1b('0x4b')]('nolimit')){_0x28ea2a[_0x8b1b('0x23')]=qs['limit'](_0x59751b[_0x8b1b('0x43')][_0x8b1b('0x23')]);_0x28ea2a[_0x8b1b('0x25')]=qs[_0x8b1b('0x25')](_0x59751b['query'][_0x8b1b('0x25')]);}_0x28ea2a[_0x8b1b('0x4d')]=qs[_0x8b1b('0x4e')](_0x59751b[_0x8b1b('0x43')]['sort']);_0x28ea2a[_0x8b1b('0x4f')]=qs[_0x8b1b('0x45')](_['pick'](_0x59751b[_0x8b1b('0x43')],_0x1d504e[_0x8b1b('0x45')]));_0x28ea2a[_0x8b1b('0x4f')][_0x8b1b('0xab')]=_0x597cf1['id'];if(_0x59751b['query']['filter']){_0x28ea2a[_0x8b1b('0x4f')]=_[_0x8b1b('0x98')](_0x28ea2a['where'],{'$or':_[_0x8b1b('0x2e')](_0x28ea2a['attributes'],function(_0xe158cb){var _0x2f6cf8={};_0x2f6cf8[_0xe158cb]={'$like':'%'+_0x59751b[_0x8b1b('0x43')]['filter']+'%'};return _0x2f6cf8;})});}if(_0x59751b['query'][_0x8b1b('0xba')]){var _0x159f98=_0x59751b[_0x8b1b('0x43')][_0x8b1b('0xba')][_0x8b1b('0x32')](',');var _0x9abf4c={};_0x9abf4c[_0x159f98[0x0]]={'$gte':moment(_0x159f98[0x1])['format'](_0x8b1b('0xbb'))};_0x28ea2a[_0x8b1b('0x4f')]=_[_0x8b1b('0x98')](_0x28ea2a[_0x8b1b('0x4f')],_0x9abf4c);}_0x28ea2a=_[_0x8b1b('0x98')]({},_0x28ea2a,_0x59751b[_0x8b1b('0xbc')]);return db[_0x8b1b('0xb5')][_0x8b1b('0x24')]({'where':_0x28ea2a[_0x8b1b('0x4f')]})[_0x8b1b('0x29')](function(_0x2a83ef){_0x334426['count']=_0x2a83ef;if(_0x59751b[_0x8b1b('0x43')]['includeAll']){_0x28ea2a[_0x8b1b('0xb0')]=[{'all':!![]}];}return db[_0x8b1b('0xb5')]['findAll'](_0x28ea2a);})['then'](function(_0xa771d){_0x334426[_0x8b1b('0xac')]=_0xa771d;return _0x334426;});}})[_0x8b1b('0x29')](respondWithFilteredResult(_0x186720,_0x28ea2a))[_0x8b1b('0x35')](handleError(_0x186720,null));};exports['addTags']=function(_0x46fe63,_0x497cca,_0x359adf){return db['OpenchannelInteraction'][_0x8b1b('0x67')]({'where':{'id':_0x46fe63['params']['id']}})[_0x8b1b('0x29')](handleEntityNotFound(_0x497cca,null))[_0x8b1b('0x29')](function(_0x54887b){if(_0x54887b){return _0x54887b[_0x8b1b('0xbd')](_0x46fe63['body'][_0x8b1b('0xb6')],_[_0x8b1b('0xb7')](_0x46fe63[_0x8b1b('0xb2')],[_0x8b1b('0xb6'),'id'])||{})[_0x8b1b('0xbe')](function(){return db['Tag'][_0x8b1b('0xbf')]({'attributes':['id',_0x8b1b('0x2b'),_0x8b1b('0x53')],'where':{'id':_0x46fe63[_0x8b1b('0xb2')][_0x8b1b('0xb6')]}});})['then'](function(_0x23ab94){socket[_0x8b1b('0xc0')](_0x8b1b('0xc1'),{'id':Number(_0x46fe63['params']['id']),'tags':_0x23ab94||[]});return{'id':Number(_0x46fe63[_0x8b1b('0xae')]['id']),'tags':_0x23ab94||[]};});}})[_0x8b1b('0x29')](respondWithResult(_0x497cca,null))[_0x8b1b('0x35')](handleError(_0x497cca,null));};exports[_0x8b1b('0xc2')]=function(_0x550dda,_0x49ab09,_0x5b09c6){return db[_0x8b1b('0x3e')]['find']({'where':{'id':_0x550dda[_0x8b1b('0xae')]['id']}})[_0x8b1b('0x29')](handleEntityNotFound(_0x49ab09,null))[_0x8b1b('0x29')](function(_0x2a45ff){if(_0x2a45ff){return _0x2a45ff[_0x8b1b('0xc2')](_0x550dda[_0x8b1b('0x43')][_0x8b1b('0xb6')]);}})[_0x8b1b('0x29')](respondWithStatusCode(_0x49ab09,null))[_0x8b1b('0x35')](handleError(_0x49ab09,null));};exports['download']=function(_0x172932,_0x514678){var _0x50232c=moment()['unix']()[_0x8b1b('0x97')]();var _0x568767=path['join'](config[_0x8b1b('0xc3')],_0x8b1b('0xc4'),_0x8b1b('0xc5'),'tmp');var _0x47e92d=path[_0x8b1b('0xc6')](config[_0x8b1b('0xc3')],_0x8b1b('0xc4'),_0x8b1b('0xc5'),_0x8b1b('0xc7'));var _0x384ce7=path['join'](_0x568767,_0x50232c);var _0x580498=util[_0x8b1b('0xc8')](_0x8b1b('0xc9'),_0x172932['params']['id'],_0x50232c);var _0x2b7a25=path[_0x8b1b('0xc6')](_0x568767,_0x580498);var _0x52624e=[];_0x52624e[_0x8b1b('0x34')]({'model':db[_0x8b1b('0xca')],'as':_0x8b1b('0xca'),'attributes':['id',_0x8b1b('0x2f')],'raw':!![]});_0x52624e['push']({'model':db[_0x8b1b('0xcb')],'as':_0x8b1b('0xcc'),'attributes':['id',_0x8b1b('0xcd'),_0x8b1b('0xce')],'raw':!![]});if(_0x172932[_0x8b1b('0x43')][_0x8b1b('0xc7')]){_0x52624e[_0x8b1b('0x34')]({'model':db[_0x8b1b('0xcf')],'as':_0x8b1b('0xcf'),'raw':!![]});}var _0x107ddf=[{'model':db[_0x8b1b('0xb5')],'as':_0x8b1b('0xd0'),'attributes':['id','body','createdAt',_0x8b1b('0xd1'),'secret','read'],'include':_0x52624e}];_0x107ddf[_0x8b1b('0x34')]({'model':db[_0x8b1b('0xd2')],'as':'Account','attributes':['id','name']});_0x107ddf['push']({'model':db[_0x8b1b('0xca')],'as':_0x8b1b('0xd3'),'attributes':['id',_0x8b1b('0x2f')]});return db[_0x8b1b('0x3e')][_0x8b1b('0x67')]({'where':{'id':_0x172932['params']['id']},'include':_0x107ddf})[_0x8b1b('0x29')](handleEntityNotFound(_0x514678,null))['then'](function(_0x17dafa){if(_0x17dafa){var _0x487180=_0x17dafa[_0x8b1b('0xd4')]({'plain':!![]});fs[_0x8b1b('0xd5')](_0x384ce7);var _0x1c59c6={'channel':_0x8b1b('0xd6'),'account':_0x487180[_0x8b1b('0xd7')][_0x8b1b('0x2b')],'agent':_0x487180[_0x8b1b('0xd3')]?_0x487180['Owner']['fullname']:'N.A.','createdAt':moment(_0x487180['createdAt'])[_0x8b1b('0xc8')](_0x8b1b('0xbb'))[_0x8b1b('0x97')](),'closedAt':_0x487180[_0x8b1b('0x3b')]?moment(_0x487180[_0x8b1b('0xd8')])[_0x8b1b('0xc8')](_0x8b1b('0xbb'))[_0x8b1b('0x97')]():'','disposition':_0x487180[_0x8b1b('0xd9')],'visibility':_0x487180[_0x8b1b('0xda')]?_0x8b1b('0xdb'):_0x8b1b('0xdc'),'messages':_(_0x487180[_0x8b1b('0xd0')])['filter']({'secret':![]})[_0x8b1b('0x2e')](function(_0x467d2a){if(_0x467d2a[_0x8b1b('0xcf')]){var _0x1e9b8d=path[_0x8b1b('0xc6')](_0x47e92d,_0x467d2a[_0x8b1b('0xcf')][_0x8b1b('0xdd')]);if(fs[_0x8b1b('0xde')](_0x1e9b8d)){fs[_0x8b1b('0xdf')](_0x1e9b8d)[_0x8b1b('0xe0')](fs[_0x8b1b('0xe1')](path[_0x8b1b('0xc6')](_0x384ce7,_0x467d2a[_0x8b1b('0xcf')][_0x8b1b('0xdd')])));}}return{'date':moment(_0x467d2a['createdAt'])[_0x8b1b('0xc8')](_0x8b1b('0xbb'))[_0x8b1b('0x97')](),'sender':_0x467d2a['direction']===_0x8b1b('0xe2')?_0x467d2a['User']?_0x467d2a['User'][_0x8b1b('0x2f')]:_0x8b1b('0xe3'):_0x467d2a[_0x8b1b('0xcc')][_0x8b1b('0xcd')]+(_0x467d2a[_0x8b1b('0xcc')]['lastName']?'\x20'+_0x467d2a[_0x8b1b('0xcc')][_0x8b1b('0xce')]:''),'body':_0x467d2a[_0x8b1b('0xcf')]?_0x467d2a[_0x8b1b('0xcf')]['basename']:_0x467d2a[_0x8b1b('0xb2')],'direction':_0x467d2a['direction']===_0x8b1b('0xe2')?'A':'C','secret':_0x467d2a[_0x8b1b('0xe4')],'read':_0x467d2a[_0x8b1b('0x7f')],'attachment':_0x467d2a[_0x8b1b('0xcf')]};})[_0x8b1b('0x68')]()};return ejs['renderFile'](path['join'](config[_0x8b1b('0xc3')],'server','views',_0x8b1b('0xe5')),{'interaction':_0x1c59c6})[_0x8b1b('0x29')](function(_0x34e33e){var _0xc791ad=path['join'](_0x384ce7,_0x8b1b('0xe6')+_0x487180['id']+'-'+_0x50232c+_0x8b1b('0xe7'));var _0x4ff607={'path':_0xc791ad,'channel':_0x8b1b('0xd6'),'interactionId':_0x487180['id']};return pdf[_0x8b1b('0xe8')](_0x34e33e,_0x4ff607);})[_0x8b1b('0x29')](function(){return new BPromise(function(_0x47865c,_0x3fe394){zipdir(_0x384ce7,{'saveTo':_0x2b7a25},function(_0x6353d,_0x120de6){if(_0x6353d)return _0x3fe394(_0x6353d);return _0x47865c(_0x120de6);});})[_0x8b1b('0x29')](function(){return new BPromise(function(_0x45d698,_0x32626e){rimraf(_0x384ce7,function(_0x13f41a){if(_0x13f41a)_0x32626e(_0x13f41a);return _0x45d698();});});})[_0x8b1b('0x29')](function(){return _0x514678['download'](_0x2b7a25,_0x580498,function(_0x24b3f2){if(_0x24b3f2){console[_0x8b1b('0xe9')](_0x8b1b('0xea'),_0x24b3f2);}else{fs['unlinkSync'](_0x2b7a25);}});});});}else{return _0x514678[_0x8b1b('0x1e')](0xc8);}})['catch'](handleError(_0x514678,null));};
\ No newline at end of file
index 7acdfd5..979023e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54d3=['getUsers','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','events','OpenchannelInteraction','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x54d3,0x1b3));var _0x354d=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x54d3[_0x122096];return _0x3d1966;};'use strict';var EventEmitter=require(_0x354d('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x354d('0x1')];var OpenchannelMessage=require(_0x354d('0x2'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x354d('0x3')](0x0);var events={'afterCreate':_0x354d('0x4'),'afterUpdate':_0x354d('0x5'),'afterDestroy':_0x354d('0x6')};function emitEvent(_0x15c8e6){return function(_0x4d66f8,_0x1f8d0d,_0x3f8ea8){_0x4d66f8[_0x354d('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4a3432){_0x4d66f8[_0x354d('0x8')](_0x354d('0x9'),_0x4a3432[_0x354d('0xa')](function(_0x101ac9){return{'id':_0x101ac9['id']};}));return OpenchannelMessage[_0x354d('0xb')]({'where':{'OpenchannelInteractionId':_0x4d66f8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x534d73){_0x4d66f8['setDataValue']('unreadMessages',_0x534d73[_0x354d('0xc')]);OpenchannelInteractionEvents[_0x354d('0xd')](_0x15c8e6+':'+_0x4d66f8['id'],_0x4d66f8);OpenchannelInteractionEvents['emit'](_0x15c8e6,_0x4d66f8);_0x3f8ea8(null);})[_0x354d('0xe')](_0x3f8ea8(null));};}for(var e in events){if(events[_0x354d('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x354d('0x10')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0xe220=['remove','getUsers','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','update'];(function(_0x34de09,_0x58dabe){var _0x48844a=function(_0x5ace92){while(--_0x5ace92){_0x34de09['push'](_0x34de09['shift']());}};_0x48844a(++_0x58dabe);}(_0xe220,0x87));var _0x0e22=function(_0x238b66,_0x324868){_0x238b66=_0x238b66-0x0;var _0xc82e46=_0xe220[_0x238b66];return _0xc82e46;};'use strict';var EventEmitter=require(_0x0e22('0x0'));var OpenchannelInteraction=require(_0x0e22('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x0e22('0x1'))['db'][_0x0e22('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x0e22('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0e22('0x4'),'afterDestroy':_0x0e22('0x5')};function emitEvent(_0x8a28c1){return function(_0x3a8c42,_0x3a739f,_0x504bf7){_0x3a8c42[_0x0e22('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x30a6bb){_0x3a8c42[_0x0e22('0x7')]('Users',_0x30a6bb['map'](function(_0x5d24d5){return{'id':_0x5d24d5['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x3a8c42['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x296d77){_0x3a8c42['setDataValue'](_0x0e22('0x8'),_0x296d77[_0x0e22('0x9')]);OpenchannelInteractionEvents['emit'](_0x8a28c1+':'+_0x3a8c42['id'],_0x3a8c42);OpenchannelInteractionEvents[_0x0e22('0xa')](_0x8a28c1,_0x3a8c42);_0x504bf7(null);})[_0x0e22('0xb')](_0x504bf7(null));};}for(var e in events){if(events[_0x0e22('0xc')](e)){var event=events[e];OpenchannelInteraction[_0x0e22('0xd')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
index 8a6ba50..12da778 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb75b=['path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','request-promise'];(function(_0x539a7b,_0x3d2d07){var _0x343ff6=function(_0x4f8f93){while(--_0x4f8f93){_0x539a7b['push'](_0x539a7b['shift']());}};_0x343ff6(++_0x3d2d07);}(_0xb75b,0x1ab));var _0xbb75=function(_0x16240f,_0xcc7965){_0x16240f=_0x16240f-0x0;var _0x2ad3da=_0xb75b[_0x16240f];return _0x2ad3da;};'use strict';var _=require('lodash');var util=require(_0xbb75('0x0'));var logger=require(_0xbb75('0x1'))(_0xbb75('0x2'));var moment=require(_0xbb75('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb75('0x4'));var fs=require('fs');var path=require(_0xbb75('0x5'));var rimraf=require(_0xbb75('0x6'));var config=require(_0xbb75('0x7'));var attributes=require(_0xbb75('0x8'));module[_0xbb75('0x9')]=function(_0x193a29,_0x18a8e0){return _0x193a29[_0xbb75('0xa')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbb75('0xb'),'collate':_0xbb75('0xc'),'hooks':{'beforeUpdate':function(_0x35edd4,_0x14d7ef,_0x168afa){if(_0x35edd4[_0xbb75('0xd')](_0xbb75('0xe'))){_0x35edd4[_0xbb75('0xf')]=moment()[_0xbb75('0x10')](_0xbb75('0x11'));}_0x168afa(null,_0x35edd4);}}});};
\ No newline at end of file
+var _0xbdda=['bluebird','rimraf','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment'];(function(_0x57863b,_0x1d6d69){var _0x11bb98=function(_0x4146a6){while(--_0x4146a6){_0x57863b['push'](_0x57863b['shift']());}};_0x11bb98(++_0x1d6d69);}(_0xbdda,0x137));var _0xabdd=function(_0x160737,_0x1e2c25){_0x160737=_0x160737-0x0;var _0x28fbef=_0xbdda[_0x160737];return _0x28fbef;};'use strict';var _=require('lodash');var util=require(_0xabdd('0x0'));var logger=require(_0xabdd('0x1'))(_0xabdd('0x2'));var moment=require(_0xabdd('0x3'));var BPromise=require(_0xabdd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xabdd('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0xabdd('0x6')]=function(_0x10722a,_0xfc919e){return _0x10722a[_0xabdd('0x7')](_0xabdd('0x8'),attributes,{'tableName':_0xabdd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xabdd('0xa'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x13a69b,_0x521d77,_0x1742d4){if(_0x13a69b[_0xabdd('0xb')](_0xabdd('0xc'))){_0x13a69b['closedAt']=moment()[_0xabdd('0xd')](_0xabdd('0xe'));}_0x1742d4(null,_0x13a69b);}}});};
\ No newline at end of file
index 016bb6a..3b1e6c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ea6=['result','catch','update','options','where','attributes','limit','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost','./openchannelInteraction.socket','register','then','info','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','request\x20sent'];(function(_0x1f16e7,_0x3ae7df){var _0x554cc8=function(_0x231bc7){while(--_0x231bc7){_0x1f16e7['push'](_0x1f16e7['shift']());}};_0x554cc8(++_0x3ae7df);}(_0x7ea6,0x1a0));var _0x67ea=function(_0x202031,_0x4cac3c){_0x202031=_0x202031-0x0;var _0x4aea5f=_0x7ea6[_0x202031];return _0x4aea5f;};'use strict';var _=require(_0x67ea('0x0'));var util=require('util');var moment=require(_0x67ea('0x1'));var BPromise=require('bluebird');var rs=require(_0x67ea('0x2'));var fs=require('fs');var Redis=require(_0x67ea('0x3'));var db=require(_0x67ea('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x67ea('0x5'));var config=require('../../config/environment');var jayson=require(_0x67ea('0x6'));var client=jayson[_0x67ea('0x7')][_0x67ea('0x8')]({'port':0x232a});config[_0x67ea('0x9')]=_[_0x67ea('0xa')](config['redis'],{'host':_0x67ea('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x67ea('0x9')]));require(_0x67ea('0xc'))[_0x67ea('0xd')](socket);function respondWithRpcPromise(_0x4627e3,_0x4e5a5a,_0xf6348f){return new BPromise(function(_0x389ae4,_0x433d12){return client['request'](_0x4627e3,_0xf6348f)[_0x67ea('0xe')](function(_0x27dd8a){logger[_0x67ea('0xf')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4e5a5a,'request\x20sent');logger[_0x67ea('0x10')](_0x67ea('0x11'),_0x4e5a5a,'request\x20sent',JSON[_0x67ea('0x12')](_0x27dd8a));if(_0x27dd8a[_0x67ea('0x13')]){if(_0x27dd8a['error'][_0x67ea('0x14')]===0x1f4){logger[_0x67ea('0x13')](_0x67ea('0x15'),_0x4e5a5a,_0x27dd8a[_0x67ea('0x13')]['message']);return _0x433d12(_0x27dd8a[_0x67ea('0x13')][_0x67ea('0x16')]);}logger[_0x67ea('0x13')](_0x67ea('0x15'),_0x4e5a5a,_0x27dd8a[_0x67ea('0x13')][_0x67ea('0x16')]);return _0x389ae4(_0x27dd8a[_0x67ea('0x13')][_0x67ea('0x16')]);}else{logger[_0x67ea('0xf')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4e5a5a,_0x67ea('0x17'));_0x389ae4(_0x27dd8a[_0x67ea('0x18')][_0x67ea('0x16')]);}})[_0x67ea('0x19')](function(_0x93c9c){logger[_0x67ea('0x13')](_0x67ea('0x15'),_0x4e5a5a,_0x93c9c);_0x433d12(_0x93c9c);});});}exports['UpdateOpenchannelInteraction']=function(_0x3f4157){var _0xc1b096=this;return new Promise(function(_0x49d567,_0x158298){return db['OpenchannelInteraction'][_0x67ea('0x1a')](_0x3f4157['body'],{'raw':_0x3f4157[_0x67ea('0x1b')]?_0x3f4157[_0x67ea('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f4157[_0x67ea('0x1b')]?_0x3f4157[_0x67ea('0x1b')][_0x67ea('0x1c')]||null:null,'attributes':_0x3f4157[_0x67ea('0x1b')]?_0x3f4157[_0x67ea('0x1b')][_0x67ea('0x1d')]||null:null,'limit':_0x3f4157[_0x67ea('0x1b')]?_0x3f4157[_0x67ea('0x1b')][_0x67ea('0x1e')]||null:null})[_0x67ea('0xe')](function(_0x432b4b){logger[_0x67ea('0xf')]('UpdateOpenchannelInteraction',_0x3f4157);logger['debug'](_0x67ea('0x1f'),_0x3f4157,JSON[_0x67ea('0x12')](_0x432b4b));_0x49d567(_0x432b4b);})[_0x67ea('0x19')](function(_0x5b14b4){logger[_0x67ea('0x13')](_0x67ea('0x1f'),_0x5b14b4[_0x67ea('0x16')],_0x3f4157);_0x158298(_0xc1b096[_0x67ea('0x13')](0x1f4,_0x5b14b4['message']));});});};exports[_0x67ea('0x20')]=function(_0x1643b7){return new Promise(function(_0x10fd21,_0x2acbf8){return db['OpenchannelInteraction'][_0x67ea('0x21')]({'where':_0x1643b7[_0x67ea('0x1b')]?_0x1643b7[_0x67ea('0x1b')]['where']||null:null})['then'](function(_0x3384b2){if(_0x3384b2){return _0x3384b2[_0x67ea('0x22')](_0x1643b7[_0x67ea('0x23')][_0x67ea('0x24')],_[_0x67ea('0x25')](_0x1643b7[_0x67ea('0x23')],[_0x67ea('0x24'),'id'])||{});}})[_0x67ea('0x26')](function(_0x142e4f){logger[_0x67ea('0xf')](_0x67ea('0x27'),_0x1643b7);logger[_0x67ea('0x10')](_0x67ea('0x27'),_0x1643b7,JSON['stringify'](_0x142e4f));_0x10fd21(_0x142e4f);})[_0x67ea('0x19')](function(_0x438ca2){logger['error'](_0x67ea('0x27'),_0x438ca2['message'],_0x1643b7);_0x2acbf8(_this[_0x67ea('0x13')](0x1f4,_0x438ca2[_0x67ea('0x16')]));});});};
\ No newline at end of file
+var _0x83aa=['body','options','raw','where','attributes','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','update'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x83aa,0x109));var _0xa83a=function(_0x2880cd,_0x4fd6f4){_0x2880cd=_0x2880cd-0x0;var _0x540615=_0x83aa[_0x2880cd];return _0x540615;};'use strict';var _=require(_0xa83a('0x0'));var util=require('util');var moment=require(_0xa83a('0x1'));var BPromise=require(_0xa83a('0x2'));var rs=require(_0xa83a('0x3'));var fs=require('fs');var Redis=require(_0xa83a('0x4'));var db=require(_0xa83a('0x5'))['db'];var utils=require(_0xa83a('0x6'));var logger=require(_0xa83a('0x7'))('rpc');var config=require(_0xa83a('0x8'));var jayson=require(_0xa83a('0x9'));var client=jayson[_0xa83a('0xa')]['http']({'port':0x232a});config[_0xa83a('0xb')]=_['defaults'](config[_0xa83a('0xb')],{'host':_0xa83a('0xc'),'port':0x18eb});var socket=require(_0xa83a('0xd'))(new Redis(config['redis']));require(_0xa83a('0xe'))[_0xa83a('0xf')](socket);function respondWithRpcPromise(_0x325e09,_0x4ac12e,_0x14466f){return new BPromise(function(_0x1504c1,_0x12d5f1){return client[_0xa83a('0x10')](_0x325e09,_0x14466f)[_0xa83a('0x11')](function(_0xf45bb9){logger[_0xa83a('0x12')](_0xa83a('0x13'),_0x4ac12e,_0xa83a('0x14'));logger[_0xa83a('0x15')](_0xa83a('0x16'),_0x4ac12e,_0xa83a('0x14'),JSON[_0xa83a('0x17')](_0xf45bb9));if(_0xf45bb9[_0xa83a('0x18')]){if(_0xf45bb9['error'][_0xa83a('0x19')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x4ac12e,_0xf45bb9['error'][_0xa83a('0x1a')]);return _0x12d5f1(_0xf45bb9['error'][_0xa83a('0x1a')]);}logger['error'](_0xa83a('0x13'),_0x4ac12e,_0xf45bb9['error'][_0xa83a('0x1a')]);return _0x1504c1(_0xf45bb9['error'][_0xa83a('0x1a')]);}else{logger[_0xa83a('0x12')](_0xa83a('0x13'),_0x4ac12e,'request\x20sent');_0x1504c1(_0xf45bb9['result'][_0xa83a('0x1a')]);}})[_0xa83a('0x1b')](function(_0x1d2cd8){logger[_0xa83a('0x18')](_0xa83a('0x13'),_0x4ac12e,_0x1d2cd8);_0x12d5f1(_0x1d2cd8);});});}exports['UpdateOpenchannelInteraction']=function(_0x3f81fb){var _0x22ea77=this;return new Promise(function(_0x44ba0e,_0x34005e){return db['OpenchannelInteraction'][_0xa83a('0x1c')](_0x3f81fb[_0xa83a('0x1d')],{'raw':_0x3f81fb[_0xa83a('0x1e')]?_0x3f81fb[_0xa83a('0x1e')][_0xa83a('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f81fb[_0xa83a('0x1e')]?_0x3f81fb['options'][_0xa83a('0x20')]||null:null,'attributes':_0x3f81fb[_0xa83a('0x1e')]?_0x3f81fb[_0xa83a('0x1e')][_0xa83a('0x21')]||null:null,'limit':_0x3f81fb[_0xa83a('0x1e')]?_0x3f81fb['options']['limit']||null:null})[_0xa83a('0x11')](function(_0x19a5dc){logger[_0xa83a('0x12')]('UpdateOpenchannelInteraction',_0x3f81fb);logger[_0xa83a('0x15')](_0xa83a('0x22'),_0x3f81fb,JSON['stringify'](_0x19a5dc));_0x44ba0e(_0x19a5dc);})[_0xa83a('0x1b')](function(_0x5bf6b6){logger[_0xa83a('0x18')](_0xa83a('0x22'),_0x5bf6b6[_0xa83a('0x1a')],_0x3f81fb);_0x34005e(_0x22ea77[_0xa83a('0x18')](0x1f4,_0x5bf6b6[_0xa83a('0x1a')]));});});};exports[_0xa83a('0x23')]=function(_0xe4ed){return new Promise(function(_0x36539d,_0x57300b){return db[_0xa83a('0x24')][_0xa83a('0x25')]({'where':_0xe4ed[_0xa83a('0x1e')]?_0xe4ed['options']['where']||null:null})['then'](function(_0x52b992){if(_0x52b992){return _0x52b992[_0xa83a('0x26')](_0xe4ed[_0xa83a('0x1d')][_0xa83a('0x27')],_['omit'](_0xe4ed[_0xa83a('0x1d')],[_0xa83a('0x27'),'id'])||{});}})[_0xa83a('0x28')](function(_0x977ad1){logger[_0xa83a('0x12')](_0xa83a('0x29'),_0xe4ed);logger[_0xa83a('0x15')](_0xa83a('0x29'),_0xe4ed,JSON[_0xa83a('0x17')](_0x977ad1));_0x36539d(_0x977ad1);})['catch'](function(_0xfdf2c1){logger[_0xa83a('0x18')](_0xa83a('0x29'),_0xfdf2c1[_0xa83a('0x1a')],_0xe4ed);_0x57300b(_this[_0xa83a('0x18')](0x1f4,_0xfdf2c1[_0xa83a('0x1a')]));});});};
\ No newline at end of file
index d482b25..462d72a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25a0=['emit','removeListener','register','openchannelInteraction:','./openchannelInteraction.events','save','update'];(function(_0x36b400,_0x277ec5){var _0x4d47bf=function(_0x55372b){while(--_0x55372b){_0x36b400['push'](_0x36b400['shift']());}};_0x4d47bf(++_0x277ec5);}(_0x25a0,0x1b6));var _0x025a=function(_0x2528cc,_0xd5b39b){_0x2528cc=_0x2528cc-0x0;var _0x11fda2=_0x25a0[_0x2528cc];return _0x11fda2;};'use strict';var OpenchannelInteractionEvents=require(_0x025a('0x0'));var events=[_0x025a('0x1'),'remove',_0x025a('0x2')];function createListener(_0x3daed2,_0x5f4720){return function(_0xfe570){_0x5f4720[_0x025a('0x3')](_0x3daed2,_0xfe570);};}function removeListener(_0x5c5b3f,_0xe22bd9){return function(){OpenchannelInteractionEvents[_0x025a('0x4')](_0x5c5b3f,_0xe22bd9);};}exports[_0x025a('0x5')]=function(_0x536ca0){for(var _0x37598d=0x0,_0x5445f4=events['length'];_0x37598d<_0x5445f4;_0x37598d++){var _0x4a8295=events[_0x37598d];var _0x12cf68=createListener(_0x025a('0x6')+_0x4a8295,_0x536ca0);OpenchannelInteractionEvents['on'](_0x4a8295,_0x12cf68);}};
\ No newline at end of file
+var _0xb2b4=['update','emit','removeListener','register','length','openchannelInteraction:','save','remove'];(function(_0x1a7137,_0x3da853){var _0x285df0=function(_0x4e4aa3){while(--_0x4e4aa3){_0x1a7137['push'](_0x1a7137['shift']());}};_0x285df0(++_0x3da853);}(_0xb2b4,0x10e));var _0x4b2b=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xb2b4[_0xaa0309];return _0x5de7ce;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x4b2b('0x0'),_0x4b2b('0x1'),_0x4b2b('0x2')];function createListener(_0x54f9f4,_0x1e2d3d){return function(_0x4e3bfb){_0x1e2d3d[_0x4b2b('0x3')](_0x54f9f4,_0x4e3bfb);};}function removeListener(_0xae9d72,_0x127d2e){return function(){OpenchannelInteractionEvents[_0x4b2b('0x4')](_0xae9d72,_0x127d2e);};}exports[_0x4b2b('0x5')]=function(_0x3226cc){for(var _0x3614e1=0x0,_0x22a550=events[_0x4b2b('0x6')];_0x3614e1<_0x22a550;_0x3614e1++){var _0x145e73=events[_0x3614e1];var _0xc9ba77=createListener(_0x4b2b('0x7')+_0x145e73,_0x3226cc);OpenchannelInteractionEvents['on'](_0x145e73,_0xc9ba77);}};
\ No newline at end of file
index aba8a18..bf234e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x5d61fa,_0x5428fe){var _0x271751=function(_0xa87023){while(--_0xa87023){_0x5d61fa['push'](_0x5d61fa['shift']());}};_0x271751(++_0x5428fe);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router;
\ No newline at end of file
+var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x52df1b,_0x281bfa){var _0x30c68f=function(_0x138ecc){while(--_0x138ecc){_0x52df1b['push'](_0x52df1b['shift']());}};_0x30c68f(++_0x281bfa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router;
\ No newline at end of file
index eb26745..66214e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88c3=['DATE','STRING','sequelize','TEXT','BOOLEAN','out'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x88c3,0x1ee));var _0x388c=function(_0x4827c6,_0x39636f){_0x4827c6=_0x4827c6-0x0;var _0x349106=_0x88c3[_0x4827c6];return _0x349106;};'use strict';var Sequelize=require(_0x388c('0x0'));module['exports']={'body':{'type':Sequelize[_0x388c('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x388c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x388c('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x388c('0x4')]},'providerName':{'type':Sequelize[_0x388c('0x5')]},'providerResponse':{'type':Sequelize[_0x388c('0x1')]}};
\ No newline at end of file
+var _0x6e6c=['exports','medium','BOOLEAN','out','DATE','TEXT','sequelize'];(function(_0x124ef9,_0x343698){var _0x17ab4e=function(_0x1ae807){while(--_0x1ae807){_0x124ef9['push'](_0x124ef9['shift']());}};_0x17ab4e(++_0x343698);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]={'body':{'type':Sequelize['TEXT'](_0xc6e6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc6e6('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc6e6('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xc6e6('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xc6e6('0x6')]}};
\ No newline at end of file
index 3d3538f..2ee6cc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc164=['moment','bluebird','mustache','util','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','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','agent','manual','SIP/%s','channel','motionChannel','event','EventManager','reject','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2b24af,_0x33f85d){var _0x4df4a1=function(_0xb6b7d4){while(--_0xb6b7d4){_0x2b24af['push'](_0x2b24af['shift']());}};_0x4df4a1(++_0x33f85d);}(_0xc164,0x18e));var _0x4c16=function(_0x41ad56,_0x198e19){_0x41ad56=_0x41ad56-0x0;var _0x14b0f1=_0xc164[_0x41ad56];return _0x14b0f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c16('0x0'));var zipdir=require(_0x4c16('0x1'));var jsonpatch=require(_0x4c16('0x2'));var rp=require(_0x4c16('0x3'));var moment=require(_0x4c16('0x4'));var BPromise=require(_0x4c16('0x5'));var Mustache=require(_0x4c16('0x6'));var util=require(_0x4c16('0x7'));var path=require('path');var sox=require(_0x4c16('0x8'));var csv=require(_0x4c16('0x9'));var ejs=require(_0x4c16('0xa'));var fs=require('fs');var fs_extra=require(_0x4c16('0xb'));var _=require(_0x4c16('0xc'));var squel=require('squel');var crypto=require(_0x4c16('0xd'));var jsforce=require(_0x4c16('0xe'));var deskjs=require(_0x4c16('0xf'));var toCsv=require(_0x4c16('0x9'));var querystring=require('querystring');var Papa=require(_0x4c16('0x10'));var Redis=require(_0x4c16('0x11'));var authService=require(_0x4c16('0x12'));var qs=require(_0x4c16('0x13'));var as=require(_0x4c16('0x14'));var hardwareService=require(_0x4c16('0x15'));var logger=require(_0x4c16('0x16'))(_0x4c16('0x17'));var utils=require(_0x4c16('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4c16('0x19'))['db'];config[_0x4c16('0x1a')]=_['defaults'](config[_0x4c16('0x1a')],{'host':_0x4c16('0x1b'),'port':0x18eb});var socket=require(_0x4c16('0x1c'))(new Redis(config['redis']));require('./openchannelMessage.socket')[_0x4c16('0x1d')](socket);var jayson=require(_0x4c16('0x1e'));var client=jayson[_0x4c16('0x1f')][_0x4c16('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x41265e,_0x3699e3,_0x11dbdf,_0x49092b){return new BPromise(function(_0x3aa010,_0x5b235d){var _0x9f5a28=_0x49092b||client;return _0x9f5a28['request'](_0x41265e,_0x11dbdf)[_0x4c16('0x21')](function(_0xda9b1){logger[_0x4c16('0x22')](_0x4c16('0x23'),_0x3699e3,_0x4c16('0x24'));logger[_0x4c16('0x25')](_0x4c16('0x26'),_0x3699e3,_0x4c16('0x24'),JSON[_0x4c16('0x27')](_0xda9b1));if(_0xda9b1[_0x4c16('0x28')]){if(_0xda9b1['error'][_0x4c16('0x29')]===0x1f4){logger['error'](_0x4c16('0x23'),_0x3699e3,_0xda9b1[_0x4c16('0x28')][_0x4c16('0x2a')]);return _0x5b235d(_0xda9b1[_0x4c16('0x28')][_0x4c16('0x2a')]);}logger[_0x4c16('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x3699e3,_0xda9b1[_0x4c16('0x28')][_0x4c16('0x2a')]);return _0x3aa010(_0xda9b1[_0x4c16('0x28')]['message']);}else{logger[_0x4c16('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x3699e3,'request\x20sent');_0x3aa010(_0xda9b1[_0x4c16('0x2b')][_0x4c16('0x2a')]);}})[_0x4c16('0x2c')](function(_0x51f527){logger[_0x4c16('0x28')](_0x4c16('0x23'),_0x3699e3,_0x51f527);_0x5b235d(_0x51f527);});});}function respondWithStatusCode(_0x44fa47,_0x321fbd){_0x321fbd=_0x321fbd||0xcc;return function(_0x1b710c){if(_0x1b710c){return _0x44fa47[_0x4c16('0x2d')](_0x321fbd);}return _0x44fa47[_0x4c16('0x2e')](_0x321fbd)[_0x4c16('0x2f')]();};}function respondWithResult(_0x5f4ea2,_0x3b7714){_0x3b7714=_0x3b7714||0xc8;return function(_0x4c4231){if(_0x4c4231){return _0x5f4ea2[_0x4c16('0x2e')](_0x3b7714)[_0x4c16('0x30')](_0x4c4231);}};}function respondWithFilteredResult(_0xbf399b,_0x18ea36){return function(_0xb3cd5){if(_0xb3cd5){var _0x12ca48=typeof _0x18ea36[_0x4c16('0x31')]===_0x4c16('0x32')&&typeof _0x18ea36[_0x4c16('0x33')]===_0x4c16('0x32');var _0x8748=_0xb3cd5[_0x4c16('0x34')];var _0x49183c=_0x12ca48?0x0:_0x18ea36['offset'];var _0xdfa4ae=_0x12ca48?_0xb3cd5[_0x4c16('0x34')]:_0x18ea36[_0x4c16('0x31')]+_0x18ea36[_0x4c16('0x33')];var _0x34f2a9;if(_0xdfa4ae>=_0x8748){_0xdfa4ae=_0x8748;_0x34f2a9=0xc8;}else{_0x34f2a9=0xce;}_0xbf399b['status'](_0x34f2a9);return _0xbf399b[_0x4c16('0x35')]('Content-Range',_0x49183c+'-'+_0xdfa4ae+'/'+_0x8748)[_0x4c16('0x30')](_0xb3cd5);}return null;};}function patchUpdates(_0x488507){return function(_0xa21f9b){try{jsonpatch[_0x4c16('0x36')](_0xa21f9b,_0x488507,!![]);}catch(_0x3d2fd2){return BPromise['reject'](_0x3d2fd2);}return _0xa21f9b[_0x4c16('0x37')]();};}function saveUpdates(_0x568a9f,_0x38220f){return function(_0x3d398d){if(_0x3d398d){return _0x3d398d[_0x4c16('0x38')](_0x568a9f)[_0x4c16('0x21')](function(_0xedd802){return _0xedd802;});}return null;};}function removeEntity(_0xbc00a2,_0x3705fe){return function(_0x322ba6){if(_0x322ba6){return _0x322ba6[_0x4c16('0x39')]()[_0x4c16('0x21')](function(){_0xbc00a2['status'](0xcc)[_0x4c16('0x2f')]();});}};}function handleEntityNotFound(_0x4c7774,_0x1b4369){return function(_0x758dba){if(!_0x758dba){_0x4c7774['sendStatus'](0x194);}return _0x758dba;};}function handleError(_0x14d5ab,_0x3dc0f5){_0x3dc0f5=_0x3dc0f5||0x1f4;return function(_0x54c881){logger[_0x4c16('0x28')](_0x54c881[_0x4c16('0x3a')]);if(_0x54c881[_0x4c16('0x3b')]){delete _0x54c881[_0x4c16('0x3b')];}_0x14d5ab[_0x4c16('0x2e')](_0x3dc0f5)[_0x4c16('0x3c')](_0x54c881);};}exports[_0x4c16('0x3d')]=function(_0x5c6bf6,_0x2d8f27){var _0x528075={},_0x5697fe={},_0x15f42b={'count':0x0,'rows':[]};var _0xe15c3=_[_0x4c16('0x3e')](db[_0x4c16('0x3f')][_0x4c16('0x40')],function(_0x5b90e7){return{'name':_0x5b90e7[_0x4c16('0x41')],'type':_0x5b90e7[_0x4c16('0x42')][_0x4c16('0x43')]};});_0x5697fe[_0x4c16('0x44')]=_['map'](_0xe15c3,_0x4c16('0x3b'));_0x5697fe[_0x4c16('0x45')]=_[_0x4c16('0x46')](_0x5c6bf6[_0x4c16('0x45')]);_0x5697fe[_0x4c16('0x47')]=_['intersection'](_0x5697fe[_0x4c16('0x44')],_0x5697fe[_0x4c16('0x45')]);_0x528075[_0x4c16('0x48')]=_[_0x4c16('0x49')](_0x5697fe[_0x4c16('0x44')],qs[_0x4c16('0x4a')](_0x5c6bf6['query'][_0x4c16('0x4a')]));_0x528075[_0x4c16('0x48')]=_0x528075[_0x4c16('0x48')][_0x4c16('0x4b')]?_0x528075[_0x4c16('0x48')]:_0x5697fe[_0x4c16('0x44')];if(!_0x5c6bf6[_0x4c16('0x45')][_0x4c16('0x4c')](_0x4c16('0x4d'))){_0x528075[_0x4c16('0x33')]=qs['limit'](_0x5c6bf6[_0x4c16('0x45')][_0x4c16('0x33')]);_0x528075['offset']=qs[_0x4c16('0x31')](_0x5c6bf6['query'][_0x4c16('0x31')]);}_0x528075[_0x4c16('0x4e')]=qs[_0x4c16('0x4f')](_0x5c6bf6['query'][_0x4c16('0x4f')]);_0x528075[_0x4c16('0x50')]=qs['filters'](_['pick'](_0x5c6bf6[_0x4c16('0x45')],_0x5697fe[_0x4c16('0x47')]),_0xe15c3);if(_0x5c6bf6[_0x4c16('0x45')]['filter']){_0x528075['where']=_[_0x4c16('0x51')](_0x528075[_0x4c16('0x50')],{'$or':_[_0x4c16('0x3e')](_0xe15c3,function(_0x530d94){if(_0x530d94['type']!==_0x4c16('0x52')){var _0x148cfa={};_0x148cfa[_0x530d94['name']]={'$like':'%'+_0x5c6bf6[_0x4c16('0x45')]['filter']+'%'};return _0x148cfa;}})});}_0x528075=_[_0x4c16('0x51')]({},_0x528075,_0x5c6bf6[_0x4c16('0x53')]);var _0x2b3f19={'where':_0x528075[_0x4c16('0x50')]};return db[_0x4c16('0x3f')][_0x4c16('0x34')](_0x2b3f19)[_0x4c16('0x21')](function(_0x28228c){_0x15f42b[_0x4c16('0x34')]=_0x28228c;if(_0x5c6bf6[_0x4c16('0x45')][_0x4c16('0x54')]){_0x528075[_0x4c16('0x55')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x4c16('0x56')](_0x528075);})[_0x4c16('0x21')](function(_0x1efa6b){_0x15f42b[_0x4c16('0x57')]=_0x1efa6b;return _0x15f42b;})[_0x4c16('0x21')](respondWithFilteredResult(_0x2d8f27,_0x528075))[_0x4c16('0x2c')](handleError(_0x2d8f27,null));};exports[_0x4c16('0x58')]=function(_0x180f0d,_0xf9d499){var _0x56c831={'raw':!![],'where':{'id':_0x180f0d[_0x4c16('0x59')]['id']}},_0x46a00b={};_0x46a00b[_0x4c16('0x44')]=_[_0x4c16('0x46')](db[_0x4c16('0x3f')][_0x4c16('0x40')]);_0x46a00b[_0x4c16('0x45')]=_[_0x4c16('0x46')](_0x180f0d['query']);_0x46a00b['filters']=_[_0x4c16('0x49')](_0x46a00b['model'],_0x46a00b[_0x4c16('0x45')]);_0x56c831[_0x4c16('0x48')]=_['intersection'](_0x46a00b[_0x4c16('0x44')],qs['fields'](_0x180f0d[_0x4c16('0x45')][_0x4c16('0x4a')]));_0x56c831['attributes']=_0x56c831[_0x4c16('0x48')][_0x4c16('0x4b')]?_0x56c831['attributes']:_0x46a00b[_0x4c16('0x44')];if(_0x180f0d[_0x4c16('0x45')][_0x4c16('0x54')]){_0x56c831[_0x4c16('0x55')]=[{'all':!![]}];}_0x56c831=_[_0x4c16('0x51')]({},_0x56c831,_0x180f0d[_0x4c16('0x53')]);return db[_0x4c16('0x3f')][_0x4c16('0x5a')](_0x56c831)['then'](handleEntityNotFound(_0xf9d499,null))['then'](respondWithResult(_0xf9d499,null))[_0x4c16('0x2c')](handleError(_0xf9d499,null));};exports[_0x4c16('0x5b')]=function(_0x4baa08,_0x43e096){return db[_0x4c16('0x3f')][_0x4c16('0x5b')](_0x4baa08[_0x4c16('0x5c')],{})[_0x4c16('0x21')](respondWithResult(_0x43e096,0xc9))[_0x4c16('0x2c')](handleError(_0x43e096,null));};exports[_0x4c16('0x38')]=function(_0x4c6219,_0x53b892){if(_0x4c6219[_0x4c16('0x5c')]['id']){delete _0x4c6219['body']['id'];}return db['OpenchannelMessage'][_0x4c16('0x5a')]({'where':{'id':_0x4c6219['params']['id']}})[_0x4c16('0x21')](handleEntityNotFound(_0x53b892,null))[_0x4c16('0x21')](saveUpdates(_0x4c6219[_0x4c16('0x5c')],null))['then'](respondWithResult(_0x53b892,null))[_0x4c16('0x2c')](handleError(_0x53b892,null));};exports[_0x4c16('0x39')]=function(_0x57ba69,_0x45ee81){return db[_0x4c16('0x3f')][_0x4c16('0x5a')]({'where':{'id':_0x57ba69[_0x4c16('0x59')]['id']}})[_0x4c16('0x21')](handleEntityNotFound(_0x45ee81,null))[_0x4c16('0x21')](removeEntity(_0x45ee81,null))[_0x4c16('0x2c')](handleError(_0x45ee81,null));};exports[_0x4c16('0x5d')]=function(_0x56c1b2,_0x5bfc35){return db[_0x4c16('0x3f')]['describe']()[_0x4c16('0x21')](respondWithResult(_0x5bfc35,null))['catch'](handleError(_0x5bfc35,null));};var interaction_log=require(_0x4c16('0x16'))(_0x4c16('0x5e'));exports[_0x4c16('0x5f')]=function(_0x5e1a0c,_0x4ff56a,_0x360a0e){var _0x4118ea={'agent':{},'channel':_0x4c16('0x60')};if(_0x5e1a0c[_0x4c16('0x5c')]['id']){delete _0x5e1a0c[_0x4c16('0x5c')]['id'];}_0x5e1a0c['body'][_0x4c16('0x61')]=!![];_0x5e1a0c[_0x4c16('0x5c')][_0x4c16('0x62')]=moment()[_0x4c16('0x63')](_0x4c16('0x64'));_0x5e1a0c[_0x4c16('0x5c')][_0x4c16('0x65')]=_0x5e1a0c[_0x4c16('0x5c')][_0x4c16('0x65')]||_0x5e1a0c[_0x4c16('0x66')]['id'];_0x4118ea['agent']['id']=_0x5e1a0c[_0x4c16('0x5c')][_0x4c16('0x65')];return db['OpenchannelMessage'][_0x4c16('0x5a')]({'where':{'id':_0x5e1a0c[_0x4c16('0x59')]['id'],'UserId':null}})[_0x4c16('0x21')](handleEntityNotFound(_0x4ff56a,null))[_0x4c16('0x21')](saveUpdates(_0x5e1a0c['body'],null))['then'](function(_0x2254a1){if(_0x2254a1){_0x4118ea[_0x4c16('0x2a')]=_0x2254a1[_0x4c16('0x67')]({'plain':!![]});return db['OpenchannelInteraction'][_0x4c16('0x5a')]({'where':{'id':_0x2254a1[_0x4c16('0x68')]}});}return null;})[_0x4c16('0x21')](handleEntityNotFound(_0x4ff56a,null))[_0x4c16('0x21')](function(_0x34d02d){if(_0x34d02d){return _0x34d02d[_0x4c16('0x38')]({'UserId':_0x5e1a0c['body'][_0x4c16('0x65')],'read1stAt':_[_0x4c16('0x69')](_0x34d02d[_0x4c16('0x6a')])?moment()[_0x4c16('0x63')](_0x4c16('0x64')):undefined});}return null;})[_0x4c16('0x21')](function(_0x4ec1a0){if(_0x4ec1a0){_0x4118ea[_0x4c16('0x6b')]=_0x4ec1a0[_0x4c16('0x67')]({'plain':!![]});interaction_log[_0x4c16('0x22')](_0x4c16('0x6c'),_0x5e1a0c[_0x4c16('0x66')]['id'],_0x5e1a0c[_0x4c16('0x66')][_0x4c16('0x3b')],_0x5e1a0c[_0x4c16('0x66')]['role'],_0x4118ea[_0x4c16('0x6b')]['id'],_0x5e1a0c[_0x4c16('0x5c')]?JSON[_0x4c16('0x27')](_0x5e1a0c[_0x4c16('0x5c')]):'null');return respondWithRpcPromise(_0x4c16('0x6d'),'acceptMessage',_0x4118ea);}return null;})[_0x4c16('0x21')](function(_0x47e053){var _0x5a74ac=_0x4c16('0x6e')+_0x47e053[_0x4c16('0x2a')][_0x4c16('0x6f')];return db[_0x4c16('0x70')][_0x4c16('0x45')](_0x5a74ac,{'type':db['Sequelize'][_0x4c16('0x71')][_0x4c16('0x72')],'raw':!![]})[_0x4c16('0x21')](function(_0x5650d3){return _0x5650d3;});})['then'](function(_0x2d59e9){if(_0x2d59e9){_0x4118ea[_0x4c16('0x2a')][_0x4c16('0x73')]=_0x2d59e9[0x0];if(!_0x5e1a0c[_0x4c16('0x5c')][_0x4c16('0x65')])return;return db[_0x4c16('0x74')][_0x4c16('0x5a')]({'where':{'id':_0x5e1a0c[_0x4c16('0x5c')]['UserId'],'role':'agent'},'attributes':['id',_0x4c16('0x3b'),_0x4c16('0x75'),_0x4c16('0x76'),_0x4c16('0x77')],'raw':!![]});}return null;})[_0x4c16('0x21')](function(_0x3594f0){if(!_0x3594f0)return null;_0x4118ea['message'][_0x4c16('0x78')]=_0x3594f0;return _0x4118ea;})[_0x4c16('0x21')](function(_0x2b7455){if(_0x2b7455){if(_0x5e1a0c[_0x4c16('0x5c')][_0x4c16('0x79')]){_0x4118ea[_0x4c16('0x2a')]['interface']=util['format'](_0x4c16('0x7a'),_0x5e1a0c[_0x4c16('0x66')][_0x4c16('0x3b')]);_0x4118ea[_0x4c16('0x2a')][_0x4c16('0x7b')]=_0x4118ea[_0x4c16('0x7b')];_0x4118ea[_0x4c16('0x2a')][_0x4c16('0x7c')]=_0x4118ea[_0x4c16('0x7b')];_0x4118ea[_0x4c16('0x2a')][_0x4c16('0x7d')]=_0x4c16('0x5f');return respondWithRpcPromise(_0x4c16('0x7e'),_0x4c16('0x7e'),{'event':'acceptmessage','message':_0x4118ea[_0x4c16('0x2a')]},client9002)[_0x4c16('0x21')](function(){return _0x4118ea;});}return _0x4118ea;}return null;})[_0x4c16('0x21')](respondWithResult(_0x4ff56a,null))[_0x4c16('0x2c')](handleError(_0x4ff56a,null));};var interaction_log=require(_0x4c16('0x16'))(_0x4c16('0x5e'));exports[_0x4c16('0x7f')]=function(_0x5ecef4,_0xbecf52,_0x55b9a5){var _0x24ac22={'agent':{},'channel':_0x4c16('0x60')};if(_0x5ecef4[_0x4c16('0x5c')]['id']){delete _0x5ecef4['body']['id'];}_0x5ecef4[_0x4c16('0x5c')]['UserId']=_0x5ecef4[_0x4c16('0x5c')][_0x4c16('0x65')]||_0x5ecef4['user']['id'];_0x24ac22['agent']['id']=_0x5ecef4[_0x4c16('0x5c')][_0x4c16('0x65')];return db['OpenchannelMessage'][_0x4c16('0x5a')]({'where':{'id':_0x5ecef4[_0x4c16('0x59')]['id'],'UserId':null}})[_0x4c16('0x21')](handleEntityNotFound(_0xbecf52,null))['then'](function(_0x26ca07){if(_0x26ca07){_0x24ac22[_0x4c16('0x2a')]=_0x26ca07[_0x4c16('0x67')]({'plain':!![]});return db[_0x4c16('0x80')]['find']({'where':{'id':_0x26ca07[_0x4c16('0x68')]}});}return null;})[_0x4c16('0x21')](handleEntityNotFound(_0xbecf52,null))['then'](function(_0x406a95){if(_0x406a95){_0x24ac22[_0x4c16('0x6b')]=_0x406a95[_0x4c16('0x67')]({'plain':!![]});interaction_log[_0x4c16('0x22')](_0x4c16('0x81'),_0x5ecef4[_0x4c16('0x66')]['id'],_0x5ecef4[_0x4c16('0x66')][_0x4c16('0x3b')],_0x5ecef4[_0x4c16('0x66')]['role'],_0x24ac22[_0x4c16('0x6b')]['id'],_0x5ecef4[_0x4c16('0x5c')]?JSON['stringify'](_0x5ecef4['body']):'null');return respondWithRpcPromise(_0x4c16('0x82'),_0x4c16('0x83'),_0x24ac22);}return null;})[_0x4c16('0x21')](function(_0x6f9cdb){var _0x37bc02='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x6f9cdb[_0x4c16('0x2a')][_0x4c16('0x6f')];return db[_0x4c16('0x70')][_0x4c16('0x45')](_0x37bc02,{'type':db['Sequelize'][_0x4c16('0x71')]['SELECT'],'raw':!![]})[_0x4c16('0x21')](function(_0x112c04){return _0x112c04;});})[_0x4c16('0x21')](function(_0x16ab8e){if(_0x16ab8e){_0x24ac22[_0x4c16('0x2a')][_0x4c16('0x73')]=_0x16ab8e[0x0];if(!_0x5ecef4[_0x4c16('0x5c')][_0x4c16('0x65')])return;return db[_0x4c16('0x74')][_0x4c16('0x5a')]({'where':{'id':_0x5ecef4['body'][_0x4c16('0x65')],'role':_0x4c16('0x78')},'attributes':['id',_0x4c16('0x3b'),_0x4c16('0x75'),_0x4c16('0x76'),'internal'],'raw':!![]});}return null;})[_0x4c16('0x21')](function(_0x53d3f7){if(!_0x53d3f7)return null;_0x24ac22[_0x4c16('0x2a')][_0x4c16('0x78')]=_0x53d3f7;return _0x24ac22;})[_0x4c16('0x21')](function(_0x48425d){if(_0x48425d){_0x48425d[_0x4c16('0x2a')][_0x4c16('0x84')]=util['format'](_0x4c16('0x7a'),_0x5ecef4['user'][_0x4c16('0x3b')]);_0x48425d[_0x4c16('0x2a')][_0x4c16('0x7b')]=_0x24ac22['channel'];_0x48425d[_0x4c16('0x2a')][_0x4c16('0x7c')]=_0x24ac22['channel'];_0x48425d[_0x4c16('0x2a')][_0x4c16('0x7d')]=_0x4c16('0x7f');respondWithRpcPromise(_0x4c16('0x7e'),'EventManager',{'event':_0x4c16('0x85'),'message':_0x48425d[_0x4c16('0x2a')]},client9002);return _0x24ac22;}return null;})[_0x4c16('0x21')](respondWithResult(_0xbecf52,null))[_0x4c16('0x2c')](handleError(_0xbecf52,null));};
\ No newline at end of file
+var _0x4380=['pick','filter','merge','options','then','includeAll','include','findAll','params','keys','fields','find','create','body','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','request','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','catch','status','offset','undefined','count','limit','set','json','reject','update','destroy','end','sendStatus','stack','name','index','map','OpenchannelMessage','fieldName','type','key','model','query','filters','attributes','intersection','length','hasOwnProperty','order','sort','where'];(function(_0x2e9b53,_0x5e6bce){var _0x1e22cd=function(_0x363c6b){while(--_0x363c6b){_0x2e9b53['push'](_0x2e9b53['shift']());}};_0x1e22cd(++_0x5e6bce);}(_0x4380,0xb6));var _0x0438=function(_0x28ba74,_0x21d454){_0x28ba74=_0x28ba74-0x0;var _0x5ba3d8=_0x4380[_0x28ba74];return _0x5ba3d8;};'use strict';var emlformat=require(_0x0438('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0438('0x1'));var jsonpatch=require(_0x0438('0x2'));var rp=require(_0x0438('0x3'));var moment=require('moment');var BPromise=require(_0x0438('0x4'));var Mustache=require(_0x0438('0x5'));var util=require(_0x0438('0x6'));var path=require(_0x0438('0x7'));var sox=require(_0x0438('0x8'));var csv=require(_0x0438('0x9'));var ejs=require(_0x0438('0xa'));var fs=require('fs');var fs_extra=require(_0x0438('0xb'));var _=require(_0x0438('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0438('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0438('0x9'));var querystring=require(_0x0438('0xe'));var Papa=require(_0x0438('0xf'));var Redis=require(_0x0438('0x10'));var authService=require(_0x0438('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0438('0x12'));var logger=require(_0x0438('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x0438('0x14'));var licenseUtil=require(_0x0438('0x15'));var db=require('../../mysqldb')['db'];config[_0x0438('0x16')]=_[_0x0438('0x17')](config['redis'],{'host':_0x0438('0x18'),'port':0x18eb});var socket=require(_0x0438('0x19'))(new Redis(config['redis']));require(_0x0438('0x1a'))[_0x0438('0x1b')](socket);var jayson=require(_0x0438('0x1c'));var client=jayson['client'][_0x0438('0x1d')]({'port':0x232c});var client9002=jayson[_0x0438('0x1e')][_0x0438('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x552c69,_0x3de06f,_0x192f05,_0x4fe2de){return new BPromise(function(_0x1ba119,_0x21d280){var _0x46b95f=_0x4fe2de||client;return _0x46b95f[_0x0438('0x1f')](_0x552c69,_0x192f05)['then'](function(_0x4dc27b){logger[_0x0438('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x3de06f,_0x0438('0x21'));logger[_0x0438('0x22')](_0x0438('0x23'),_0x3de06f,_0x0438('0x21'),JSON[_0x0438('0x24')](_0x4dc27b));if(_0x4dc27b[_0x0438('0x25')]){if(_0x4dc27b[_0x0438('0x25')][_0x0438('0x26')]===0x1f4){logger['error'](_0x0438('0x27'),_0x3de06f,_0x4dc27b[_0x0438('0x25')]['message']);return _0x21d280(_0x4dc27b[_0x0438('0x25')][_0x0438('0x28')]);}logger[_0x0438('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x3de06f,_0x4dc27b[_0x0438('0x25')][_0x0438('0x28')]);return _0x1ba119(_0x4dc27b['error'][_0x0438('0x28')]);}else{logger[_0x0438('0x20')](_0x0438('0x27'),_0x3de06f,_0x0438('0x21'));_0x1ba119(_0x4dc27b['result'][_0x0438('0x28')]);}})[_0x0438('0x29')](function(_0xa74ebe){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x3de06f,_0xa74ebe);_0x21d280(_0xa74ebe);});});}function respondWithStatusCode(_0x785de3,_0x4b13e4){_0x4b13e4=_0x4b13e4||0xcc;return function(_0x459b8e){if(_0x459b8e){return _0x785de3['sendStatus'](_0x4b13e4);}return _0x785de3[_0x0438('0x2a')](_0x4b13e4)['end']();};}function respondWithResult(_0x966f00,_0x528016){_0x528016=_0x528016||0xc8;return function(_0x4e9f2c){if(_0x4e9f2c){return _0x966f00['status'](_0x528016)['json'](_0x4e9f2c);}};}function respondWithFilteredResult(_0x514ec3,_0x242b96){return function(_0x4f07e8){if(_0x4f07e8){var _0x549802=typeof _0x242b96[_0x0438('0x2b')]==='undefined'&&typeof _0x242b96['limit']===_0x0438('0x2c');var _0xa03cbc=_0x4f07e8[_0x0438('0x2d')];var _0xbec7c8=_0x549802?0x0:_0x242b96['offset'];var _0x59ffba=_0x549802?_0x4f07e8['count']:_0x242b96['offset']+_0x242b96[_0x0438('0x2e')];var _0xcdf632;if(_0x59ffba>=_0xa03cbc){_0x59ffba=_0xa03cbc;_0xcdf632=0xc8;}else{_0xcdf632=0xce;}_0x514ec3['status'](_0xcdf632);return _0x514ec3[_0x0438('0x2f')]('Content-Range',_0xbec7c8+'-'+_0x59ffba+'/'+_0xa03cbc)[_0x0438('0x30')](_0x4f07e8);}return null;};}function patchUpdates(_0x3daed6){return function(_0x185a5c){try{jsonpatch['apply'](_0x185a5c,_0x3daed6,!![]);}catch(_0x3fb162){return BPromise[_0x0438('0x31')](_0x3fb162);}return _0x185a5c['save']();};}function saveUpdates(_0x4d8afc,_0x4a53e9){return function(_0x5afc0e){if(_0x5afc0e){return _0x5afc0e[_0x0438('0x32')](_0x4d8afc)['then'](function(_0x3d0d72){return _0x3d0d72;});}return null;};}function removeEntity(_0x866adc,_0xdc1e26){return function(_0x4d8e4b){if(_0x4d8e4b){return _0x4d8e4b[_0x0438('0x33')]()['then'](function(){_0x866adc[_0x0438('0x2a')](0xcc)[_0x0438('0x34')]();});}};}function handleEntityNotFound(_0x17fbf3,_0x5f480b){return function(_0x8afab0){if(!_0x8afab0){_0x17fbf3[_0x0438('0x35')](0x194);}return _0x8afab0;};}function handleError(_0x40c8bd,_0x3eb05a){_0x3eb05a=_0x3eb05a||0x1f4;return function(_0x15f60f){logger[_0x0438('0x25')](_0x15f60f[_0x0438('0x36')]);if(_0x15f60f[_0x0438('0x37')]){delete _0x15f60f['name'];}_0x40c8bd[_0x0438('0x2a')](_0x3eb05a)['send'](_0x15f60f);};}exports[_0x0438('0x38')]=function(_0x295387,_0x34417d){var _0x12917b={},_0x415ff4={},_0x878404={'count':0x0,'rows':[]};var _0x204d09=_[_0x0438('0x39')](db[_0x0438('0x3a')]['rawAttributes'],function(_0x4236a9){return{'name':_0x4236a9[_0x0438('0x3b')],'type':_0x4236a9[_0x0438('0x3c')][_0x0438('0x3d')]};});_0x415ff4[_0x0438('0x3e')]=_['map'](_0x204d09,_0x0438('0x37'));_0x415ff4[_0x0438('0x3f')]=_['keys'](_0x295387[_0x0438('0x3f')]);_0x415ff4[_0x0438('0x40')]=_['intersection'](_0x415ff4[_0x0438('0x3e')],_0x415ff4[_0x0438('0x3f')]);_0x12917b[_0x0438('0x41')]=_[_0x0438('0x42')](_0x415ff4[_0x0438('0x3e')],qs['fields'](_0x295387[_0x0438('0x3f')]['fields']));_0x12917b[_0x0438('0x41')]=_0x12917b[_0x0438('0x41')][_0x0438('0x43')]?_0x12917b['attributes']:_0x415ff4[_0x0438('0x3e')];if(!_0x295387[_0x0438('0x3f')][_0x0438('0x44')]('nolimit')){_0x12917b['limit']=qs[_0x0438('0x2e')](_0x295387[_0x0438('0x3f')][_0x0438('0x2e')]);_0x12917b[_0x0438('0x2b')]=qs[_0x0438('0x2b')](_0x295387[_0x0438('0x3f')]['offset']);}_0x12917b[_0x0438('0x45')]=qs[_0x0438('0x46')](_0x295387['query']['sort']);_0x12917b[_0x0438('0x47')]=qs['filters'](_[_0x0438('0x48')](_0x295387[_0x0438('0x3f')],_0x415ff4[_0x0438('0x40')]),_0x204d09);if(_0x295387['query'][_0x0438('0x49')]){_0x12917b['where']=_[_0x0438('0x4a')](_0x12917b[_0x0438('0x47')],{'$or':_[_0x0438('0x39')](_0x204d09,function(_0x269285){if(_0x269285[_0x0438('0x3c')]!=='VIRTUAL'){var _0x447c28={};_0x447c28[_0x269285[_0x0438('0x37')]]={'$like':'%'+_0x295387[_0x0438('0x3f')][_0x0438('0x49')]+'%'};return _0x447c28;}})});}_0x12917b=_[_0x0438('0x4a')]({},_0x12917b,_0x295387[_0x0438('0x4b')]);var _0x33826e={'where':_0x12917b[_0x0438('0x47')]};return db[_0x0438('0x3a')][_0x0438('0x2d')](_0x33826e)[_0x0438('0x4c')](function(_0x438d0c){_0x878404[_0x0438('0x2d')]=_0x438d0c;if(_0x295387['query'][_0x0438('0x4d')]){_0x12917b[_0x0438('0x4e')]=[{'all':!![]}];}return db[_0x0438('0x3a')][_0x0438('0x4f')](_0x12917b);})[_0x0438('0x4c')](function(_0x1c3be1){_0x878404['rows']=_0x1c3be1;return _0x878404;})[_0x0438('0x4c')](respondWithFilteredResult(_0x34417d,_0x12917b))['catch'](handleError(_0x34417d,null));};exports['show']=function(_0x18b907,_0x36f13a){var _0x15068b={'raw':!![],'where':{'id':_0x18b907[_0x0438('0x50')]['id']}},_0x54cc24={};_0x54cc24[_0x0438('0x3e')]=_[_0x0438('0x51')](db[_0x0438('0x3a')]['rawAttributes']);_0x54cc24[_0x0438('0x3f')]=_[_0x0438('0x51')](_0x18b907[_0x0438('0x3f')]);_0x54cc24[_0x0438('0x40')]=_['intersection'](_0x54cc24['model'],_0x54cc24['query']);_0x15068b[_0x0438('0x41')]=_['intersection'](_0x54cc24['model'],qs[_0x0438('0x52')](_0x18b907[_0x0438('0x3f')][_0x0438('0x52')]));_0x15068b['attributes']=_0x15068b[_0x0438('0x41')]['length']?_0x15068b['attributes']:_0x54cc24[_0x0438('0x3e')];if(_0x18b907[_0x0438('0x3f')][_0x0438('0x4d')]){_0x15068b[_0x0438('0x4e')]=[{'all':!![]}];}_0x15068b=_[_0x0438('0x4a')]({},_0x15068b,_0x18b907[_0x0438('0x4b')]);return db[_0x0438('0x3a')][_0x0438('0x53')](_0x15068b)[_0x0438('0x4c')](handleEntityNotFound(_0x36f13a,null))[_0x0438('0x4c')](respondWithResult(_0x36f13a,null))[_0x0438('0x29')](handleError(_0x36f13a,null));};exports['create']=function(_0x546b41,_0x57ae5d){return db['OpenchannelMessage'][_0x0438('0x54')](_0x546b41[_0x0438('0x55')],{})[_0x0438('0x4c')](respondWithResult(_0x57ae5d,0xc9))[_0x0438('0x29')](handleError(_0x57ae5d,null));};exports[_0x0438('0x32')]=function(_0x5f6a1a,_0xbedf16){if(_0x5f6a1a[_0x0438('0x55')]['id']){delete _0x5f6a1a[_0x0438('0x55')]['id'];}return db[_0x0438('0x3a')][_0x0438('0x53')]({'where':{'id':_0x5f6a1a[_0x0438('0x50')]['id']}})['then'](handleEntityNotFound(_0xbedf16,null))[_0x0438('0x4c')](saveUpdates(_0x5f6a1a[_0x0438('0x55')],null))[_0x0438('0x4c')](respondWithResult(_0xbedf16,null))[_0x0438('0x29')](handleError(_0xbedf16,null));};exports[_0x0438('0x33')]=function(_0x1b03ad,_0x4001bb){return db[_0x0438('0x3a')][_0x0438('0x53')]({'where':{'id':_0x1b03ad[_0x0438('0x50')]['id']}})['then'](handleEntityNotFound(_0x4001bb,null))[_0x0438('0x4c')](removeEntity(_0x4001bb,null))['catch'](handleError(_0x4001bb,null));};exports[_0x0438('0x56')]=function(_0x48d357,_0x4e6491){return db[_0x0438('0x3a')]['describe']()[_0x0438('0x4c')](respondWithResult(_0x4e6491,null))[_0x0438('0x29')](handleError(_0x4e6491,null));};var interaction_log=require(_0x0438('0x13'))(_0x0438('0x57'));exports['accept']=function(_0x4b3c6e,_0x4ad2da,_0x3dcf15){var _0x4d68e1={'agent':{},'channel':_0x0438('0x58')};if(_0x4b3c6e[_0x0438('0x55')]['id']){delete _0x4b3c6e[_0x0438('0x55')]['id'];}_0x4b3c6e[_0x0438('0x55')][_0x0438('0x59')]=!![];_0x4b3c6e[_0x0438('0x55')][_0x0438('0x5a')]=moment()[_0x0438('0x5b')](_0x0438('0x5c'));_0x4b3c6e[_0x0438('0x55')][_0x0438('0x5d')]=_0x4b3c6e[_0x0438('0x55')][_0x0438('0x5d')]||_0x4b3c6e[_0x0438('0x5e')]['id'];_0x4d68e1[_0x0438('0x5f')]['id']=_0x4b3c6e[_0x0438('0x55')][_0x0438('0x5d')];return db[_0x0438('0x3a')][_0x0438('0x53')]({'where':{'id':_0x4b3c6e[_0x0438('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4ad2da,null))['then'](saveUpdates(_0x4b3c6e['body'],null))[_0x0438('0x4c')](function(_0x2a7786){if(_0x2a7786){_0x4d68e1['message']=_0x2a7786[_0x0438('0x60')]({'plain':!![]});return db[_0x0438('0x61')][_0x0438('0x53')]({'where':{'id':_0x2a7786[_0x0438('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x4ad2da,null))['then'](function(_0x47faed){if(_0x47faed){return _0x47faed[_0x0438('0x32')]({'UserId':_0x4b3c6e[_0x0438('0x55')][_0x0438('0x5d')],'read1stAt':_[_0x0438('0x63')](_0x47faed[_0x0438('0x64')])?moment()[_0x0438('0x5b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0438('0x4c')](function(_0x46cfe3){if(_0x46cfe3){_0x4d68e1[_0x0438('0x65')]=_0x46cfe3['get']({'plain':!![]});interaction_log['info'](_0x0438('0x66'),_0x4b3c6e[_0x0438('0x5e')]['id'],_0x4b3c6e[_0x0438('0x5e')][_0x0438('0x37')],_0x4b3c6e[_0x0438('0x5e')]['role'],_0x4d68e1[_0x0438('0x65')]['id'],_0x4b3c6e[_0x0438('0x55')]?JSON['stringify'](_0x4b3c6e[_0x0438('0x55')]):_0x0438('0x67'));return respondWithRpcPromise('AcceptMessage',_0x0438('0x68'),_0x4d68e1);}return null;})['then'](function(_0x139a5d){var _0x5d18db=_0x0438('0x69')+_0x139a5d['message'][_0x0438('0x6a')];return db['sequelize']['query'](_0x5d18db,{'type':db['Sequelize'][_0x0438('0x6b')][_0x0438('0x6c')],'raw':!![]})[_0x0438('0x4c')](function(_0x42cfa2){return _0x42cfa2;});})[_0x0438('0x4c')](function(_0x494756){if(_0x494756){_0x4d68e1[_0x0438('0x28')][_0x0438('0x6d')]=_0x494756[0x0];if(!_0x4b3c6e['body'][_0x0438('0x5d')])return;return db[_0x0438('0x6e')][_0x0438('0x53')]({'where':{'id':_0x4b3c6e[_0x0438('0x55')][_0x0438('0x5d')],'role':'agent'},'attributes':['id',_0x0438('0x37'),_0x0438('0x6f'),'email',_0x0438('0x70')],'raw':!![]});}return null;})['then'](function(_0x540c64){if(!_0x540c64)return null;_0x4d68e1[_0x0438('0x28')]['agent']=_0x540c64;return _0x4d68e1;})[_0x0438('0x4c')](function(_0x35f3aa){if(_0x35f3aa){if(_0x4b3c6e[_0x0438('0x55')][_0x0438('0x71')]){_0x4d68e1[_0x0438('0x28')][_0x0438('0x72')]=util[_0x0438('0x5b')](_0x0438('0x73'),_0x4b3c6e[_0x0438('0x5e')]['name']);_0x4d68e1[_0x0438('0x28')][_0x0438('0x74')]=_0x4d68e1[_0x0438('0x74')];_0x4d68e1[_0x0438('0x28')][_0x0438('0x75')]=_0x4d68e1[_0x0438('0x74')];_0x4d68e1['message'][_0x0438('0x76')]=_0x0438('0x77');return respondWithRpcPromise(_0x0438('0x78'),_0x0438('0x78'),{'event':_0x0438('0x79'),'message':_0x4d68e1['message']},client9002)[_0x0438('0x4c')](function(){return _0x4d68e1;});}return _0x4d68e1;}return null;})[_0x0438('0x4c')](respondWithResult(_0x4ad2da,null))[_0x0438('0x29')](handleError(_0x4ad2da,null));};var interaction_log=require(_0x0438('0x13'))(_0x0438('0x57'));exports[_0x0438('0x31')]=function(_0x36775f,_0x1cb8ad,_0x5ed168){var _0x275a8a={'agent':{},'channel':'openchannel'};if(_0x36775f['body']['id']){delete _0x36775f['body']['id'];}_0x36775f[_0x0438('0x55')][_0x0438('0x5d')]=_0x36775f[_0x0438('0x55')]['UserId']||_0x36775f[_0x0438('0x5e')]['id'];_0x275a8a[_0x0438('0x5f')]['id']=_0x36775f[_0x0438('0x55')][_0x0438('0x5d')];return db['OpenchannelMessage'][_0x0438('0x53')]({'where':{'id':_0x36775f[_0x0438('0x50')]['id'],'UserId':null}})[_0x0438('0x4c')](handleEntityNotFound(_0x1cb8ad,null))['then'](function(_0x1282bc){if(_0x1282bc){_0x275a8a['message']=_0x1282bc[_0x0438('0x60')]({'plain':!![]});return db['OpenchannelInteraction'][_0x0438('0x53')]({'where':{'id':_0x1282bc['OpenchannelInteractionId']}});}return null;})[_0x0438('0x4c')](handleEntityNotFound(_0x1cb8ad,null))[_0x0438('0x4c')](function(_0x1ebb79){if(_0x1ebb79){_0x275a8a[_0x0438('0x65')]=_0x1ebb79[_0x0438('0x60')]({'plain':!![]});interaction_log[_0x0438('0x20')](_0x0438('0x7a'),_0x36775f['user']['id'],_0x36775f[_0x0438('0x5e')][_0x0438('0x37')],_0x36775f[_0x0438('0x5e')][_0x0438('0x7b')],_0x275a8a[_0x0438('0x65')]['id'],_0x36775f[_0x0438('0x55')]?JSON[_0x0438('0x24')](_0x36775f[_0x0438('0x55')]):'null');return respondWithRpcPromise(_0x0438('0x7c'),_0x0438('0x7d'),_0x275a8a);}return null;})[_0x0438('0x4c')](function(_0x2ba967){var _0x3eedd7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2ba967[_0x0438('0x28')][_0x0438('0x6a')];return db['sequelize'][_0x0438('0x3f')](_0x3eedd7,{'type':db['Sequelize'][_0x0438('0x6b')][_0x0438('0x6c')],'raw':!![]})[_0x0438('0x4c')](function(_0x5b09c7){return _0x5b09c7;});})['then'](function(_0x3eb578){if(_0x3eb578){_0x275a8a[_0x0438('0x28')][_0x0438('0x6d')]=_0x3eb578[0x0];if(!_0x36775f['body'][_0x0438('0x5d')])return;return db[_0x0438('0x6e')][_0x0438('0x53')]({'where':{'id':_0x36775f[_0x0438('0x55')][_0x0438('0x5d')],'role':_0x0438('0x5f')},'attributes':['id','name',_0x0438('0x6f'),'email',_0x0438('0x70')],'raw':!![]});}return null;})[_0x0438('0x4c')](function(_0x1ea236){if(!_0x1ea236)return null;_0x275a8a[_0x0438('0x28')][_0x0438('0x5f')]=_0x1ea236;return _0x275a8a;})['then'](function(_0x280994){if(_0x280994){_0x280994[_0x0438('0x28')][_0x0438('0x72')]=util[_0x0438('0x5b')](_0x0438('0x73'),_0x36775f[_0x0438('0x5e')][_0x0438('0x37')]);_0x280994[_0x0438('0x28')][_0x0438('0x74')]=_0x275a8a['channel'];_0x280994['message'][_0x0438('0x75')]=_0x275a8a['channel'];_0x280994['message']['event']='reject';respondWithRpcPromise(_0x0438('0x78'),_0x0438('0x78'),{'event':_0x0438('0x7e'),'message':_0x280994[_0x0438('0x28')]},client9002);return _0x275a8a;}return null;})[_0x0438('0x4c')](respondWithResult(_0x1cb8ad,null))[_0x0438('0x29')](handleError(_0x1cb8ad,null));};
\ No newline at end of file
index bd0d35a..d56fe37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a88=['OpenchannelMessage','setMaxListeners','save','update','hook','exports'];(function(_0x50f382,_0x32473c){var _0x16afda=function(_0x199898){while(--_0x199898){_0x50f382['push'](_0x50f382['shift']());}};_0x16afda(++_0x32473c);}(_0x5a88,0x132));var _0x85a8=function(_0x3c8ab4,_0x15237b){_0x3c8ab4=_0x3c8ab4-0x0;var _0x1a5d47=_0x5a88[_0x3c8ab4];return _0x1a5d47;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0x85a8('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x85a8('0x1')](0x0);var events={'afterCreate':_0x85a8('0x2'),'afterUpdate':_0x85a8('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3af05e){return function(_0x12a700,_0x338a18,_0x2ec06b){OpenchannelMessageEvents['emit'](_0x3af05e+':'+_0x12a700['id'],_0x12a700);OpenchannelMessageEvents['emit'](_0x3af05e,_0x12a700);_0x2ec06b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x85a8('0x4')](e,emitEvent(event));}}module[_0x85a8('0x5')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0xdab9=['events','../../mysqldb','OpenchannelMessage','update','hasOwnProperty','hook'];(function(_0x2bf3ef,_0x1f97a8){var _0x2315ce=function(_0x54e2c0){while(--_0x54e2c0){_0x2bf3ef['push'](_0x2bf3ef['shift']());}};_0x2315ce(++_0x1f97a8);}(_0xdab9,0x126));var _0x9dab=function(_0x551eae,_0x1048cf){_0x551eae=_0x551eae-0x0;var _0x274a43=_0xdab9[_0x551eae];return _0x274a43;};'use strict';var EventEmitter=require(_0x9dab('0x0'));var OpenchannelMessage=require(_0x9dab('0x1'))['db'][_0x9dab('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9dab('0x3'),'afterDestroy':'remove'};function emitEvent(_0x15c7cd){return function(_0x3839c5,_0x3e0ee0,_0x103636){OpenchannelMessageEvents['emit'](_0x15c7cd+':'+_0x3839c5['id'],_0x3839c5);OpenchannelMessageEvents['emit'](_0x15c7cd,_0x3839c5);_0x103636(null);};}for(var e in events){if(events[_0x9dab('0x4')](e)){var event=events[e];OpenchannelMessage[_0x9dab('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
index 93fc758..b0a301d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65d0=['out','secret','isNil','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','POST','method','GET','body','Message\x20%d\x20forwarded\x20to\x20%s','inspect','finally','utf8mb4','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','get','toLowerCase','direction'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x65d0,0x1dc));var _0x065d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x65d0[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x065d('0x0'));var util=require(_0x065d('0x1'));var logger=require(_0x065d('0x2'))('api');var moment=require(_0x065d('0x3'));var BPromise=require(_0x065d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x065d('0x5'));var rimraf=require('rimraf');var config=require(_0x065d('0x6'));var attributes=require(_0x065d('0x7'));module[_0x065d('0x8')]=function(_0x3f0fbc,_0x20ca87){return _0x3f0fbc['define'](_0x065d('0x9'),attributes,{'tableName':_0x065d('0xa'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1499dd,_0x2530e8,_0x2fc8e1){var _0x2ace77=_0x3f0fbc['models'];var _0x2e8c84=_0x1499dd[_0x065d('0xb')]({'plain':!![]});if(_0x2e8c84['direction'][_0x065d('0xc')]()==='in'||_0x2e8c84[_0x065d('0xd')][_0x065d('0xc')]()===_0x065d('0xe')&&!_0x2e8c84[_0x065d('0xf')]&&!_[_0x065d('0x10')](_0x2e8c84['UserId'])){_0x2ace77['OpenchannelInteraction'][_0x065d('0x11')]({'where':{'id':_0x2e8c84[_0x065d('0x12')]}})[_0x065d('0x13')](function(_0x1673ce){if(_0x1673ce){_0x1673ce[_0x065d('0x14')]({'lastMsgAt':_0x2e8c84[_0x065d('0x15')],'lastMsgDirection':_0x2e8c84[_0x065d('0xd')][_0x065d('0xc')]()});}})[_0x065d('0x16')](function(_0x159bc9){console[_0x065d('0x17')](_0x159bc9);});}if(_0x2e8c84['direction']===_0x065d('0xe')&&!_0x2e8c84['secret']){var _0x129eed;_0x2ace77[_0x065d('0x18')][_0x065d('0x19')]()[_0x065d('0x13')](function(_0x235f1b){return _0x2ace77[_0x065d('0x1a')][_0x065d('0x1b')]({'where':{'id':_0x2e8c84[_0x065d('0x1c')]},'include':[{'model':_0x2ace77[_0x065d('0x1d')],'as':_0x065d('0x1e'),'where':{'id':_0x2e8c84[_0x065d('0x12')]},'limit':0x1,'include':[{'model':_0x2ace77['CmContact'],'as':_0x065d('0x1f'),'attributes':_[_0x065d('0x20')](_0x235f1b)}]}]});})[_0x065d('0x13')](function(_0x5c6458){_0x129eed=_0x5c6458[_0x065d('0xb')]({'plain':!![]});if(_0x129eed&&_0x129eed[_0x065d('0x21')]){logger[_0x065d('0x22')](_0x065d('0x23'),_0x065d('0x24'),util[_0x065d('0x25')](_0x065d('0x26'),_0x2e8c84['id'],_0x129eed['replyUri']));if(_0x129eed['Interactions']&&_0x129eed[_0x065d('0x1e')][_0x065d('0x27')]){_0x2e8c84[_0x065d('0x28')]=_['omit'](_0x129eed[_0x065d('0x1e')][0x0],'Contact');_0x2e8c84[_0x065d('0x1f')]=_0x129eed[_0x065d('0x1e')][0x0][_0x065d('0x1f')];}var _0x2530e8={'method':_0x065d('0x29'),'uri':encodeURI(_0x129eed[_0x065d('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2530e8[_0x065d('0x2a')]){case _0x065d('0x2b'):_0x2530e8['qs']=_0x2e8c84;break;case _0x065d('0x29'):_0x2530e8[_0x065d('0x2c')]=_0x2e8c84;break;}return rp(_0x2530e8)[_0x065d('0x13')](function(_0x4a69a0){logger[_0x065d('0x22')](_0x065d('0x23'),'afterCreate',util[_0x065d('0x25')](_0x065d('0x2d'),_0x2e8c84['id'],_0x129eed[_0x065d('0x21')]));if(_0x4a69a0[_0x065d('0x2c')]['threadId']&&_0x4a69a0['body']['threadId']!=_0x2e8c84[_0x065d('0x28')]['threadId']){return _0x2ace77['OpenchannelInteraction'][_0x065d('0x14')]({'threadId':_0x4a69a0[_0x065d('0x2c')]['threadId']},{'where':{'id':_0x2e8c84['Interaction']['id']}});}else{return;}})[_0x065d('0x13')](function(){return _0x1499dd[_0x065d('0x14')]({'read':!![]});})[_0x065d('0x16')](function(_0x4cefbb){logger[_0x065d('0x17')](_0x065d('0x23'),_0x065d('0x24'),util[_0x065d('0x2e')](_0x4cefbb,{'showHidden':![],'depth':null}));_0x2fc8e1();});}else{_0x2fc8e1();}})[_0x065d('0x2f')](function(){_0x2fc8e1();});}else{_0x2fc8e1();}}},'charset':_0x065d('0x30'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xe201=['get','direction','toLowerCase','isNil','UserId','OpenchannelInteraction','findOne','then','update','createdAt','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','POST','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','catch','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xe201,0xbc));var _0x1e20=function(_0x6e79bf,_0x52f2ba){_0x6e79bf=_0x6e79bf-0x0;var _0x5b0e31=_0xe201[_0x6e79bf];return _0x5b0e31;};'use strict';var _=require(_0x1e20('0x0'));var util=require('util');var logger=require(_0x1e20('0x1'))(_0x1e20('0x2'));var moment=require(_0x1e20('0x3'));var BPromise=require(_0x1e20('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e20('0x5'));var rimraf=require(_0x1e20('0x6'));var config=require(_0x1e20('0x7'));var attributes=require(_0x1e20('0x8'));module[_0x1e20('0x9')]=function(_0x2827d9,_0x75f96a){return _0x2827d9[_0x1e20('0xa')](_0x1e20('0xb'),attributes,{'tableName':_0x1e20('0xc'),'paranoid':![],'indexes':[{'name':_0x1e20('0xd'),'fields':[_0x1e20('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d25b7,_0x3f56de,_0x1b2e37){var _0x3c1a9a=_0x2827d9[_0x1e20('0xf')];var _0x884e93=_0x1d25b7[_0x1e20('0x10')]({'plain':!![]});if(_0x884e93[_0x1e20('0x11')]['toLowerCase']()==='in'||_0x884e93['direction'][_0x1e20('0x12')]()==='out'&&!_0x884e93['secret']&&!_[_0x1e20('0x13')](_0x884e93[_0x1e20('0x14')])){_0x3c1a9a[_0x1e20('0x15')][_0x1e20('0x16')]({'where':{'id':_0x884e93['OpenchannelInteractionId']}})[_0x1e20('0x17')](function(_0x299800){if(_0x299800){_0x299800[_0x1e20('0x18')]({'lastMsgAt':_0x884e93[_0x1e20('0x19')],'lastMsgDirection':_0x884e93[_0x1e20('0x11')][_0x1e20('0x12')]()});}})['catch'](function(_0x47cee2){console[_0x1e20('0x1a')](_0x47cee2);});}if(_0x884e93[_0x1e20('0x11')]==='out'&&!_0x884e93['secret']){var _0x1f8e1f;_0x3c1a9a[_0x1e20('0x1b')][_0x1e20('0x1c')]()[_0x1e20('0x17')](function(_0x1a063f){return _0x3c1a9a[_0x1e20('0x1d')][_0x1e20('0x1e')]({'where':{'id':_0x884e93[_0x1e20('0x1f')]},'include':[{'model':_0x3c1a9a[_0x1e20('0x15')],'as':_0x1e20('0x20'),'where':{'id':_0x884e93[_0x1e20('0x21')]},'limit':0x1,'include':[{'model':_0x3c1a9a[_0x1e20('0x1b')],'as':_0x1e20('0x22'),'attributes':_[_0x1e20('0x23')](_0x1a063f)}]}]});})['then'](function(_0xabe13e){_0x1f8e1f=_0xabe13e['get']({'plain':!![]});if(_0x1f8e1f&&_0x1f8e1f[_0x1e20('0x24')]){logger['info'](_0x1e20('0x25'),_0x1e20('0x26'),util[_0x1e20('0x27')](_0x1e20('0x28'),_0x884e93['id'],_0x1f8e1f[_0x1e20('0x24')]));if(_0x1f8e1f[_0x1e20('0x20')]&&_0x1f8e1f['Interactions']['length']){_0x884e93['Interaction']=_['omit'](_0x1f8e1f['Interactions'][0x0],_0x1e20('0x22'));_0x884e93[_0x1e20('0x22')]=_0x1f8e1f[_0x1e20('0x20')][0x0][_0x1e20('0x22')];}var _0x3f56de={'method':_0x1e20('0x29'),'uri':encodeURI(_0x1f8e1f[_0x1e20('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3f56de['method']){case _0x1e20('0x2a'):_0x3f56de['qs']=_0x884e93;break;case _0x1e20('0x29'):_0x3f56de[_0x1e20('0xe')]=_0x884e93;break;}return rp(_0x3f56de)[_0x1e20('0x17')](function(_0x3f1d6c){logger[_0x1e20('0x2b')](_0x1e20('0x25'),_0x1e20('0x26'),util['format'](_0x1e20('0x2c'),_0x884e93['id'],_0x1f8e1f[_0x1e20('0x24')]));if(_0x3f1d6c[_0x1e20('0xe')][_0x1e20('0x2d')]&&_0x3f1d6c[_0x1e20('0xe')][_0x1e20('0x2d')]!=_0x884e93[_0x1e20('0x2e')][_0x1e20('0x2d')]){return _0x3c1a9a[_0x1e20('0x15')]['update']({'threadId':_0x3f1d6c[_0x1e20('0xe')][_0x1e20('0x2d')]},{'where':{'id':_0x884e93[_0x1e20('0x2e')]['id']}});}else{return;}})[_0x1e20('0x17')](function(){return _0x1d25b7[_0x1e20('0x18')]({'read':!![]});})[_0x1e20('0x2f')](function(_0x37c1f9){logger[_0x1e20('0x1a')](_0x1e20('0x25'),'afterCreate',util[_0x1e20('0x30')](_0x37c1f9,{'showHidden':![],'depth':null}));_0x1b2e37();});}else{_0x1b2e37();}})['finally'](function(){_0x1b2e37();});}else{_0x1b2e37();}}},'charset':_0x1e20('0x31'),'collate':_0x1e20('0x32')});};
\ No newline at end of file
index 9f72f31..c8e1dbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x33229f,_0x4065ec){var _0x323587=function(_0x1491e8){while(--_0x1491e8){_0x33229f['push'](_0x33229f['shift']());}};_0x323587(++_0x4065ec);}(_0xadb5,0xad));var _0x5adb=function(_0x38b365,_0x1711e3){_0x38b365=_0x38b365-0x0;var _0x76d8a5=_0xadb5[_0x38b365];return _0x76d8a5;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});};
\ No newline at end of file
+var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x5e0e54,_0x537a84){var _0x525cda=function(_0x5ad8e8){while(--_0x5ad8e8){_0x5e0e54['push'](_0x5e0e54['shift']());}};_0x525cda(++_0x537a84);}(_0xadb5,0xad));var _0x5adb=function(_0x2957c9,_0x51ec3d){_0x2957c9=_0x2957c9-0x0;var _0xde77e0=_0xadb5[_0x2957c9];return _0xde77e0;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});};
\ No newline at end of file
index 3bddb0b..fdaea05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ae=['openchannelMessage:','save','update','emit','removeListener','register'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x53ae,0x16f));var _0xe53a=function(_0x5b0252,_0x334472){_0x5b0252=_0x5b0252-0x0;var _0x27cd57=_0x53ae[_0x5b0252];return _0x27cd57;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xe53a('0x0'),'remove',_0xe53a('0x1')];function createListener(_0x3b22f7,_0x446863){return function(_0x40fe91){_0x446863[_0xe53a('0x2')](_0x3b22f7,_0x40fe91);};}function removeListener(_0x55bd70,_0xf1f9d7){return function(){OpenchannelMessageEvents[_0xe53a('0x3')](_0x55bd70,_0xf1f9d7);};}exports[_0xe53a('0x4')]=function(_0x19279d){for(var _0x3e844e=0x0,_0x153a02=events['length'];_0x3e844e<_0x153a02;_0x3e844e++){var _0x2cd181=events[_0x3e844e];var _0x3840fa=createListener(_0xe53a('0x5')+_0x2cd181,_0x19279d);OpenchannelMessageEvents['on'](_0x2cd181,_0x3840fa);}};
\ No newline at end of file
+var _0xb288=['emit','register','openchannelMessage:','./openchannelMessage.events','save','remove'];(function(_0x2424af,_0x125be9){var _0x62fffb=function(_0x2feeed){while(--_0x2feeed){_0x2424af['push'](_0x2424af['shift']());}};_0x62fffb(++_0x125be9);}(_0xb288,0x1b3));var _0x8b28=function(_0x4c67fc,_0x3a3a02){_0x4c67fc=_0x4c67fc-0x0;var _0x5d4ce1=_0xb288[_0x4c67fc];return _0x5d4ce1;};'use strict';var OpenchannelMessageEvents=require(_0x8b28('0x0'));var events=[_0x8b28('0x1'),_0x8b28('0x2'),'update'];function createListener(_0x41434c,_0x35f47e){return function(_0x2e17f7){_0x35f47e[_0x8b28('0x3')](_0x41434c,_0x2e17f7);};}function removeListener(_0x443864,_0x8a325b){return function(){OpenchannelMessageEvents['removeListener'](_0x443864,_0x8a325b);};}exports[_0x8b28('0x4')]=function(_0x670c4e){for(var _0x237d61=0x0,_0xc18b4f=events['length'];_0x237d61<_0xc18b4f;_0x237d61++){var _0x2c6c03=events[_0x237d61];var _0x573089=createListener(_0x8b28('0x5')+_0x2c6c03,_0x670c4e);OpenchannelMessageEvents['on'](_0x2c6c03,_0x573089);}};
\ No newline at end of file
index e427f7e..0ee0887 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x989e=['/:id/users','getAgents','post','create','/:id/teams','addTeams','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers'];(function(_0x1703d9,_0x475cad){var _0x47e702=function(_0x4a1079){while(--_0x4a1079){_0x1703d9['push'](_0x1703d9['shift']());}};_0x47e702(++_0x475cad);}(_0x989e,0x192));var _0xe989=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0x989e[_0x258fb0];return _0x4d1afe;};'use strict';var multer=require(_0xe989('0x0'));var util=require(_0xe989('0x1'));var path=require('path');var timeout=require(_0xe989('0x2'));var express=require(_0xe989('0x3'));var router=express[_0xe989('0x4')]();var fs_extra=require(_0xe989('0x5'));var auth=require(_0xe989('0x6'));var interaction=require(_0xe989('0x7'));var config=require(_0xe989('0x8'));var controller=require(_0xe989('0x9'));router[_0xe989('0xa')]('/',auth[_0xe989('0xb')](),controller[_0xe989('0xc')]);router[_0xe989('0xa')](_0xe989('0xd'),auth[_0xe989('0xb')](),controller['describe']);router[_0xe989('0xa')](_0xe989('0xe'),auth[_0xe989('0xb')](),controller[_0xe989('0xf')]);router[_0xe989('0xa')](_0xe989('0x10'),auth[_0xe989('0xb')](),controller[_0xe989('0x11')]);router[_0xe989('0xa')]('/:id/teams',auth[_0xe989('0xb')](),controller['getTeams']);router['get'](_0xe989('0x12'),auth[_0xe989('0xb')](),controller[_0xe989('0x13')]);router[_0xe989('0x14')]('/',auth['isAuthenticated'](),controller[_0xe989('0x15')]);router[_0xe989('0x14')](_0xe989('0x16'),auth[_0xe989('0xb')](),controller[_0xe989('0x17')]);router[_0xe989('0x14')](_0xe989('0x12'),auth[_0xe989('0xb')](),controller['addAgents']);router['put']('/:id',auth[_0xe989('0xb')](),controller['update']);router[_0xe989('0x18')](_0xe989('0xe'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xe989('0x16'),auth['isAuthenticated'](),controller[_0xe989('0x19')]);router[_0xe989('0x18')](_0xe989('0x12'),auth[_0xe989('0xb')](),controller[_0xe989('0x1a')]);module[_0xe989('0x1b')]=router;
\ No newline at end of file
+var _0x9b12=['/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index'];(function(_0x4b32fb,_0x36dfc8){var _0x305e91=function(_0x5bbf63){while(--_0x5bbf63){_0x4b32fb['push'](_0x4b32fb['shift']());}};_0x305e91(++_0x36dfc8);}(_0x9b12,0x124));var _0x29b1=function(_0x2d8c5e,_0x5f1f60){_0x2d8c5e=_0x2d8c5e-0x0;var _0x2cd3f0=_0x9b12[_0x2d8c5e];return _0x2cd3f0;};'use strict';var multer=require(_0x29b1('0x0'));var util=require(_0x29b1('0x1'));var path=require(_0x29b1('0x2'));var timeout=require(_0x29b1('0x3'));var express=require(_0x29b1('0x4'));var router=express[_0x29b1('0x5')]();var fs_extra=require(_0x29b1('0x6'));var auth=require(_0x29b1('0x7'));var interaction=require(_0x29b1('0x8'));var config=require(_0x29b1('0x9'));var controller=require(_0x29b1('0xa'));router[_0x29b1('0xb')]('/',auth[_0x29b1('0xc')](),controller[_0x29b1('0xd')]);router[_0x29b1('0xb')](_0x29b1('0xe'),auth['isAuthenticated'](),controller[_0x29b1('0xf')]);router[_0x29b1('0xb')](_0x29b1('0x10'),auth[_0x29b1('0xc')](),controller[_0x29b1('0x11')]);router[_0x29b1('0xb')](_0x29b1('0x12'),auth[_0x29b1('0xc')](),controller[_0x29b1('0x13')]);router[_0x29b1('0xb')](_0x29b1('0x14'),auth[_0x29b1('0xc')](),controller[_0x29b1('0x15')]);router[_0x29b1('0xb')](_0x29b1('0x16'),auth[_0x29b1('0xc')](),controller[_0x29b1('0x17')]);router[_0x29b1('0x18')]('/',auth['isAuthenticated'](),controller[_0x29b1('0x19')]);router[_0x29b1('0x18')](_0x29b1('0x14'),auth[_0x29b1('0xc')](),controller[_0x29b1('0x1a')]);router[_0x29b1('0x18')](_0x29b1('0x16'),auth['isAuthenticated'](),controller[_0x29b1('0x1b')]);router[_0x29b1('0x1c')](_0x29b1('0x10'),auth[_0x29b1('0xc')](),controller[_0x29b1('0x1d')]);router['delete'](_0x29b1('0x10'),auth['isAuthenticated'](),controller[_0x29b1('0x1e')]);router[_0x29b1('0x1f')](_0x29b1('0x14'),auth[_0x29b1('0xc')](),controller[_0x29b1('0x20')]);router['delete'](_0x29b1('0x16'),auth[_0x29b1('0xc')](),controller[_0x29b1('0x21')]);module['exports']=router;
\ No newline at end of file
index 0735e08..69b9324 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8381=['beepall','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x5f1d32,_0x47d03f){var _0x49145a=function(_0x5744b1){while(--_0x5744b1){_0x5f1d32['push'](_0x5f1d32['shift']());}};_0x49145a(++_0x47d03f);}(_0x8381,0x136));var _0x1838=function(_0x497584,_0x5b5a33){_0x497584=_0x497584-0x0;var _0x4c1d8a=_0x8381[_0x497584];return _0x4c1d8a;};'use strict';var Sequelize=require('sequelize');module[_0x1838('0x0')]={'name':{'type':Sequelize[_0x1838('0x1')],'unique':_0x1838('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1838('0x1')]},'timeout':{'type':Sequelize[_0x1838('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1838('0x4')]('rrmemory',_0x1838('0x5'),_0x1838('0x6'))}};
\ No newline at end of file
+var _0x03b8=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x314bee,_0x4ed3e7){var _0x366d6b=function(_0x448a67){while(--_0x448a67){_0x314bee['push'](_0x314bee['shift']());}};_0x366d6b(++_0x4ed3e7);}(_0x03b8,0x195));var _0x803b=function(_0x50c926,_0x3a22a1){_0x50c926=_0x50c926-0x0;var _0x3ec1ee=_0x03b8[_0x50c926];return _0x3ec1ee;};'use strict';var Sequelize=require(_0x803b('0x0'));module[_0x803b('0x1')]={'name':{'type':Sequelize[_0x803b('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x803b('0x2')]},'timeout':{'type':Sequelize[_0x803b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x803b('0x4')](_0x803b('0x5'),_0x803b('0x6'),_0x803b('0x7'))}};
\ No newline at end of file
index 92897da..80ab96e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b4c=['limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','OpenchannelQueues','error','stack','name','index','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','map','VIRTUAL','filter','merge','options','OpenchannelQueue','includeAll','include','findAll','rows','show','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserOpenchannelQueue','pick','OpenchannelQueueId','User','findAndCountAll','agent','updatedAt','createdAt','%s/%s','SIP','openchannelPause','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','userOpenchannelQueue:save','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','all','compact','value','removeTeams','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','spread','getAgents','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','undefined'];(function(_0x66a36d,_0x1af0fc){var _0x346738=function(_0x356e41){while(--_0x356e41){_0x66a36d['push'](_0x66a36d['shift']());}};_0x346738(++_0x1af0fc);}(_0x1b4c,0x6c));var _0xc1b4=function(_0x334c50,_0x1f11d0){_0x334c50=_0x334c50-0x0;var _0x524766=_0x1b4c[_0x334c50];return _0x524766;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc1b4('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc1b4('0x1'));var moment=require(_0xc1b4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc1b4('0x3'));var util=require(_0xc1b4('0x4'));var path=require(_0xc1b4('0x5'));var sox=require(_0xc1b4('0x6'));var csv=require(_0xc1b4('0x7'));var ejs=require(_0xc1b4('0x8'));var fs=require('fs');var fs_extra=require(_0xc1b4('0x9'));var _=require(_0xc1b4('0xa'));var squel=require('squel');var crypto=require(_0xc1b4('0xb'));var jsforce=require(_0xc1b4('0xc'));var deskjs=require(_0xc1b4('0xd'));var toCsv=require(_0xc1b4('0x7'));var querystring=require(_0xc1b4('0xe'));var Papa=require(_0xc1b4('0xf'));var Redis=require('ioredis');var authService=require(_0xc1b4('0x10'));var qs=require(_0xc1b4('0x11'));var as=require(_0xc1b4('0x12'));var hardwareService=require(_0xc1b4('0x13'));var logger=require(_0xc1b4('0x14'))('api');var utils=require(_0xc1b4('0x15'));var config=require(_0xc1b4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1b4('0x17'))['db'];config[_0xc1b4('0x18')]=_[_0xc1b4('0x19')](config[_0xc1b4('0x18')],{'host':_0xc1b4('0x1a'),'port':0x18eb});var socket=require(_0xc1b4('0x1b'))(new Redis(config[_0xc1b4('0x18')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x503ca5,_0x1df493){_0x1df493=_0x1df493||0xcc;return function(_0x7a4556){if(_0x7a4556){return _0x503ca5['sendStatus'](_0x1df493);}return _0x503ca5[_0xc1b4('0x1c')](_0x1df493)[_0xc1b4('0x1d')]();};}function respondWithResult(_0x21572b,_0x1161af){_0x1161af=_0x1161af||0xc8;return function(_0x5ff7d4){if(_0x5ff7d4){return _0x21572b[_0xc1b4('0x1c')](_0x1161af)[_0xc1b4('0x1e')](_0x5ff7d4);}};}function respondWithFilteredResult(_0x26718f,_0x265f02){return function(_0x1d45eb){if(_0x1d45eb){var _0x1e4b56=typeof _0x265f02['offset']===_0xc1b4('0x1f')&&typeof _0x265f02[_0xc1b4('0x20')]===_0xc1b4('0x1f');var _0x4e5963=_0x1d45eb[_0xc1b4('0x21')];var _0x31a748=_0x1e4b56?0x0:_0x265f02[_0xc1b4('0x22')];var _0x42e82f=_0x1e4b56?_0x1d45eb[_0xc1b4('0x21')]:_0x265f02['offset']+_0x265f02[_0xc1b4('0x20')];var _0x534d85;if(_0x42e82f>=_0x4e5963){_0x42e82f=_0x4e5963;_0x534d85=0xc8;}else{_0x534d85=0xce;}_0x26718f[_0xc1b4('0x1c')](_0x534d85);return _0x26718f[_0xc1b4('0x23')](_0xc1b4('0x24'),_0x31a748+'-'+_0x42e82f+'/'+_0x4e5963)[_0xc1b4('0x1e')](_0x1d45eb);}return null;};}function patchUpdates(_0x13a2ed){return function(_0x393678){try{jsonpatch[_0xc1b4('0x25')](_0x393678,_0x13a2ed,!![]);}catch(_0x5d7e71){return BPromise[_0xc1b4('0x26')](_0x5d7e71);}return _0x393678[_0xc1b4('0x27')]();};}function saveUpdates(_0x3d5f30,_0x23d010){return function(_0x332d04){if(_0x332d04){return _0x332d04[_0xc1b4('0x28')](_0x3d5f30)['then'](function(_0x127023){return _0x127023;});}return null;};}function removeEntity(_0x4f7a7c,_0x490850){return function(_0x18bafe){if(_0x18bafe){return _0x18bafe[_0xc1b4('0x29')]()[_0xc1b4('0x2a')](function(){var _0x219dba=_0x18bafe[_0xc1b4('0x2b')]({'plain':!![]});var _0x59ea8a=_0xc1b4('0x2c');return db['UserProfileResource'][_0xc1b4('0x29')]({'where':{'type':_0x59ea8a,'resourceId':_0x219dba['id']}})[_0xc1b4('0x2a')](function(){return _0x18bafe;});})[_0xc1b4('0x2a')](function(){_0x4f7a7c[_0xc1b4('0x1c')](0xcc)[_0xc1b4('0x1d')]();});}};}function handleEntityNotFound(_0x4a2e02,_0x417c8b){return function(_0xd52079){if(!_0xd52079){_0x4a2e02['sendStatus'](0x194);}return _0xd52079;};}function handleError(_0x2b6068,_0x1bd510){_0x1bd510=_0x1bd510||0x1f4;return function(_0x4eb653){logger[_0xc1b4('0x2d')](_0x4eb653[_0xc1b4('0x2e')]);if(_0x4eb653[_0xc1b4('0x2f')]){delete _0x4eb653[_0xc1b4('0x2f')];}_0x2b6068[_0xc1b4('0x1c')](_0x1bd510)['send'](_0x4eb653);};}exports[_0xc1b4('0x30')]=function(_0x284a24,_0x2097b7){var _0x32e18f={},_0x550f06={},_0x29f454={'count':0x0,'rows':[]};var _0x48092a=_['map'](db['OpenchannelQueue'][_0xc1b4('0x31')],function(_0x4586ad){return{'name':_0x4586ad[_0xc1b4('0x32')],'type':_0x4586ad['type'][_0xc1b4('0x33')]};});_0x550f06[_0xc1b4('0x34')]=_['map'](_0x48092a,_0xc1b4('0x2f'));_0x550f06[_0xc1b4('0x35')]=_[_0xc1b4('0x36')](_0x284a24[_0xc1b4('0x35')]);_0x550f06['filters']=_[_0xc1b4('0x37')](_0x550f06['model'],_0x550f06[_0xc1b4('0x35')]);_0x32e18f[_0xc1b4('0x38')]=_[_0xc1b4('0x37')](_0x550f06[_0xc1b4('0x34')],qs['fields'](_0x284a24[_0xc1b4('0x35')][_0xc1b4('0x39')]));_0x32e18f[_0xc1b4('0x38')]=_0x32e18f[_0xc1b4('0x38')][_0xc1b4('0x3a')]?_0x32e18f[_0xc1b4('0x38')]:_0x550f06[_0xc1b4('0x34')];if(!_0x284a24[_0xc1b4('0x35')][_0xc1b4('0x3b')](_0xc1b4('0x3c'))){_0x32e18f[_0xc1b4('0x20')]=qs[_0xc1b4('0x20')](_0x284a24[_0xc1b4('0x35')][_0xc1b4('0x20')]);_0x32e18f['offset']=qs[_0xc1b4('0x22')](_0x284a24[_0xc1b4('0x35')][_0xc1b4('0x22')]);}_0x32e18f[_0xc1b4('0x3d')]=qs[_0xc1b4('0x3e')](_0x284a24['query'][_0xc1b4('0x3e')]);_0x32e18f['where']=qs[_0xc1b4('0x3f')](_['pick'](_0x284a24[_0xc1b4('0x35')],_0x550f06[_0xc1b4('0x3f')]),_0x48092a);if(_0x284a24[_0xc1b4('0x35')]['filter']){_0x32e18f[_0xc1b4('0x40')]=_['merge'](_0x32e18f[_0xc1b4('0x40')],{'$or':_[_0xc1b4('0x41')](_0x48092a,function(_0xfe3723){if(_0xfe3723['type']!==_0xc1b4('0x42')){var _0x281974={};_0x281974[_0xfe3723[_0xc1b4('0x2f')]]={'$like':'%'+_0x284a24[_0xc1b4('0x35')][_0xc1b4('0x43')]+'%'};return _0x281974;}})});}_0x32e18f=_[_0xc1b4('0x44')]({},_0x32e18f,_0x284a24[_0xc1b4('0x45')]);var _0x50e5c1={'where':_0x32e18f[_0xc1b4('0x40')]};return db[_0xc1b4('0x46')][_0xc1b4('0x21')](_0x50e5c1)[_0xc1b4('0x2a')](function(_0x31fad3){_0x29f454[_0xc1b4('0x21')]=_0x31fad3;if(_0x284a24[_0xc1b4('0x35')][_0xc1b4('0x47')]){_0x32e18f[_0xc1b4('0x48')]=[{'all':!![]}];}return db[_0xc1b4('0x46')][_0xc1b4('0x49')](_0x32e18f);})['then'](function(_0x4ca842){_0x29f454[_0xc1b4('0x4a')]=_0x4ca842;return _0x29f454;})[_0xc1b4('0x2a')](respondWithFilteredResult(_0x2097b7,_0x32e18f))['catch'](handleError(_0x2097b7,null));};exports[_0xc1b4('0x4b')]=function(_0x27a57f,_0x5e5d46){var _0x222dd7={'raw':!![],'where':{'id':_0x27a57f['params']['id']}},_0x58e5fb={};_0x58e5fb[_0xc1b4('0x34')]=_['keys'](db['OpenchannelQueue'][_0xc1b4('0x31')]);_0x58e5fb['query']=_[_0xc1b4('0x36')](_0x27a57f[_0xc1b4('0x35')]);_0x58e5fb[_0xc1b4('0x3f')]=_['intersection'](_0x58e5fb[_0xc1b4('0x34')],_0x58e5fb[_0xc1b4('0x35')]);_0x222dd7['attributes']=_[_0xc1b4('0x37')](_0x58e5fb['model'],qs[_0xc1b4('0x39')](_0x27a57f['query']['fields']));_0x222dd7[_0xc1b4('0x38')]=_0x222dd7[_0xc1b4('0x38')]['length']?_0x222dd7[_0xc1b4('0x38')]:_0x58e5fb[_0xc1b4('0x34')];if(_0x27a57f[_0xc1b4('0x35')][_0xc1b4('0x47')]){_0x222dd7[_0xc1b4('0x48')]=[{'all':!![]}];}_0x222dd7=_[_0xc1b4('0x44')]({},_0x222dd7,_0x27a57f[_0xc1b4('0x45')]);return db[_0xc1b4('0x46')][_0xc1b4('0x4c')](_0x222dd7)[_0xc1b4('0x2a')](handleEntityNotFound(_0x5e5d46,null))[_0xc1b4('0x2a')](respondWithResult(_0x5e5d46,null))[_0xc1b4('0x4d')](handleError(_0x5e5d46,null));};exports[_0xc1b4('0x4e')]=function(_0x4300bf,_0x32f29e){return db[_0xc1b4('0x46')][_0xc1b4('0x4e')](_0x4300bf[_0xc1b4('0x4f')],{})[_0xc1b4('0x2a')](function(_0x4eceff){var _0x44dfc5=_0x4300bf['user'][_0xc1b4('0x2b')]({'plain':!![]});if(!_0x44dfc5)throw new Error(_0xc1b4('0x50'));if(_0x44dfc5[_0xc1b4('0x51')]===_0xc1b4('0x52')){var _0x34b85f=_0x4eceff[_0xc1b4('0x2b')]({'plain':!![]});var _0x27e1aa='OpenchannelQueues';return db[_0xc1b4('0x53')][_0xc1b4('0x4c')]({'where':{'name':_0x27e1aa,'userProfileId':_0x44dfc5[_0xc1b4('0x54')]},'raw':!![]})[_0xc1b4('0x2a')](function(_0x445509){if(_0x445509&&_0x445509[_0xc1b4('0x55')]===0x0){return db[_0xc1b4('0x56')][_0xc1b4('0x4e')]({'name':_0x34b85f[_0xc1b4('0x2f')],'resourceId':_0x34b85f['id'],'type':_0x445509['name'],'sectionId':_0x445509['id']},{})[_0xc1b4('0x2a')](function(){return _0x4eceff;});}else{return _0x4eceff;}})['catch'](function(_0x2758de){logger[_0xc1b4('0x2d')](_0xc1b4('0x57'),_0x2758de);throw _0x2758de;});}return _0x4eceff;})['then'](respondWithResult(_0x32f29e,0xc9))['catch'](handleError(_0x32f29e,null));};exports[_0xc1b4('0x28')]=function(_0x123cb7,_0x1be0fb){if(_0x123cb7[_0xc1b4('0x4f')]['id']){delete _0x123cb7[_0xc1b4('0x4f')]['id'];}return db[_0xc1b4('0x46')][_0xc1b4('0x4c')]({'where':{'id':_0x123cb7[_0xc1b4('0x58')]['id']}})['then'](handleEntityNotFound(_0x1be0fb,null))[_0xc1b4('0x2a')](saveUpdates(_0x123cb7[_0xc1b4('0x4f')],null))['then'](respondWithResult(_0x1be0fb,null))[_0xc1b4('0x4d')](handleError(_0x1be0fb,null));};exports[_0xc1b4('0x29')]=function(_0x2d6e06,_0x220a50){return db[_0xc1b4('0x46')][_0xc1b4('0x4c')]({'where':{'id':_0x2d6e06[_0xc1b4('0x58')]['id']}})[_0xc1b4('0x2a')](handleEntityNotFound(_0x220a50,null))[_0xc1b4('0x2a')](removeEntity(_0x220a50,null))[_0xc1b4('0x4d')](handleError(_0x220a50,null));};exports['describe']=function(_0x35082f,_0x39a974){return db[_0xc1b4('0x46')][_0xc1b4('0x59')]()[_0xc1b4('0x2a')](respondWithResult(_0x39a974,null))[_0xc1b4('0x4d')](handleError(_0x39a974,null));};exports['getMembers']=function(_0x3d21e0,_0x5e5c5d,_0x3aba6d){var _0x4c3e2e={'raw':!![],'where':{}},_0x41ef6b={},_0x11eaf3;return db[_0xc1b4('0x46')][_0xc1b4('0x5a')]({'where':{'id':_0x3d21e0[_0xc1b4('0x58')]['id']}})[_0xc1b4('0x2a')](handleEntityNotFound(_0x5e5c5d,null))[_0xc1b4('0x2a')](function(_0x16e6a6){if(_0x16e6a6){_0x11eaf3=_0x16e6a6[_0xc1b4('0x2b')]({'plain':!![]});_0x41ef6b[_0xc1b4('0x34')]=_[_0xc1b4('0x36')](db[_0xc1b4('0x5b')][_0xc1b4('0x31')]);_0x41ef6b[_0xc1b4('0x35')]=_[_0xc1b4('0x36')](_0x3d21e0[_0xc1b4('0x35')]);_0x41ef6b[_0xc1b4('0x3f')]=_[_0xc1b4('0x37')](_0x41ef6b[_0xc1b4('0x34')],_0x41ef6b[_0xc1b4('0x35')]);_0x4c3e2e[_0xc1b4('0x38')]=_[_0xc1b4('0x37')](_0x41ef6b[_0xc1b4('0x34')],qs[_0xc1b4('0x39')](_0x3d21e0[_0xc1b4('0x35')][_0xc1b4('0x39')]));_0x4c3e2e[_0xc1b4('0x38')]=_0x4c3e2e[_0xc1b4('0x38')][_0xc1b4('0x3a')]?_0x4c3e2e['attributes']:_0x41ef6b['model'];if(!_0x3d21e0['query'][_0xc1b4('0x3b')](_0xc1b4('0x3c'))){_0x4c3e2e[_0xc1b4('0x20')]=qs[_0xc1b4('0x20')](_0x3d21e0[_0xc1b4('0x35')][_0xc1b4('0x20')]);_0x4c3e2e['offset']=qs[_0xc1b4('0x22')](_0x3d21e0[_0xc1b4('0x35')][_0xc1b4('0x22')]);}_0x4c3e2e[_0xc1b4('0x3d')]=qs[_0xc1b4('0x3e')](_0x3d21e0[_0xc1b4('0x35')]['sort']);_0x4c3e2e[_0xc1b4('0x40')]=qs['filters'](_[_0xc1b4('0x5c')](_0x3d21e0[_0xc1b4('0x35')],_0x41ef6b[_0xc1b4('0x3f')]));_0x4c3e2e[_0xc1b4('0x40')][_0xc1b4('0x5d')]=_0x16e6a6['id'];if(_0x3d21e0[_0xc1b4('0x35')][_0xc1b4('0x43')]){_0x4c3e2e[_0xc1b4('0x40')]=_['merge'](_0x4c3e2e[_0xc1b4('0x40')],{'$or':_[_0xc1b4('0x41')](_0x4c3e2e[_0xc1b4('0x38')],function(_0x1ee173){var _0x536534={};_0x536534[_0x1ee173]={'$like':'%'+_0x3d21e0[_0xc1b4('0x35')]['filter']+'%'};return _0x536534;})});}_0x4c3e2e=_['merge']({},_0x4c3e2e,_0x3d21e0[_0xc1b4('0x45')]);return db[_0xc1b4('0x5b')][_0xc1b4('0x49')](_0x4c3e2e);}})['then'](function(_0xc23930){if(_0xc23930){return db[_0xc1b4('0x5e')][_0xc1b4('0x5f')]({'where':{'id':_[_0xc1b4('0x41')](_0xc23930,'UserId'),'role':_0xc1b4('0x60')},'attributes':['id',_0xc1b4('0x2f'),'openchannelPause',_0xc1b4('0x61'),_0xc1b4('0x62')]});}})[_0xc1b4('0x2a')](function(_0x49ff2e){if(_0x49ff2e){return{'count':_0x49ff2e[_0xc1b4('0x21')],'rows':_['map'](_0x49ff2e[_0xc1b4('0x4a')],function(_0x1d48da){return{'membername':_0x1d48da[_0xc1b4('0x2f')],'UserId':_0x1d48da['id'],'queue_name':_0x11eaf3[_0xc1b4('0x2f')],'OpenchannelQueueId':_0x11eaf3['id'],'interface':util['format'](_0xc1b4('0x63'),_0xc1b4('0x64'),_0x1d48da['name']),'penalty':0x0,'paused':_0x1d48da[_0xc1b4('0x65')],'createdAt':_0x1d48da[_0xc1b4('0x62')],'updatedAt':_0x1d48da[_0xc1b4('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc1b4('0x2a')](respondWithFilteredResult(_0x5e5c5d,_0x4c3e2e))[_0xc1b4('0x4d')](handleError(_0x5e5c5d,null));};exports[_0xc1b4('0x66')]=function(_0x4ec282,_0x33aa45,_0x74e677){var _0x2932c7={};var _0xaf94e3={};var _0x7e5e95;var _0x36559b;return db[_0xc1b4('0x46')]['findOne']({'where':{'id':_0x4ec282[_0xc1b4('0x58')]['id']}})['then'](handleEntityNotFound(_0x33aa45,null))[_0xc1b4('0x2a')](function(_0x5367c8){if(_0x5367c8){_0x7e5e95=_0x5367c8;_0xaf94e3[_0xc1b4('0x34')]=_[_0xc1b4('0x36')](db['Team'][_0xc1b4('0x31')]);_0xaf94e3[_0xc1b4('0x35')]=_[_0xc1b4('0x36')](_0x4ec282[_0xc1b4('0x35')]);_0xaf94e3[_0xc1b4('0x3f')]=_[_0xc1b4('0x37')](_0xaf94e3[_0xc1b4('0x34')],_0xaf94e3['query']);_0x2932c7[_0xc1b4('0x38')]=_[_0xc1b4('0x37')](_0xaf94e3[_0xc1b4('0x34')],qs[_0xc1b4('0x39')](_0x4ec282['query'][_0xc1b4('0x39')]));_0x2932c7['attributes']=_0x2932c7['attributes'][_0xc1b4('0x3a')]?_0x2932c7[_0xc1b4('0x38')]:_0xaf94e3[_0xc1b4('0x34')];_0x2932c7['order']=qs[_0xc1b4('0x3e')](_0x4ec282[_0xc1b4('0x35')][_0xc1b4('0x3e')]);_0x2932c7['where']=qs[_0xc1b4('0x3f')](_[_0xc1b4('0x5c')](_0x4ec282[_0xc1b4('0x35')],_0xaf94e3['filters']));if(_0x4ec282[_0xc1b4('0x35')][_0xc1b4('0x43')]){_0x2932c7[_0xc1b4('0x40')]=_[_0xc1b4('0x44')](_0x2932c7['where'],{'$or':_[_0xc1b4('0x41')](_0x2932c7[_0xc1b4('0x38')],function(_0x385833){var _0x16bcd8={};_0x16bcd8[_0x385833]={'$like':'%'+_0x4ec282[_0xc1b4('0x35')][_0xc1b4('0x43')]+'%'};return _0x16bcd8;})});}_0x2932c7=_[_0xc1b4('0x44')]({},_0x2932c7,_0x4ec282[_0xc1b4('0x45')]);return _0x7e5e95[_0xc1b4('0x66')](_0x2932c7);}})[_0xc1b4('0x2a')](function(_0x307015){if(_0x307015){_0x36559b=_0x307015[_0xc1b4('0x3a')];if(!_0x4ec282['query'][_0xc1b4('0x3b')](_0xc1b4('0x3c'))){_0x2932c7[_0xc1b4('0x20')]=qs[_0xc1b4('0x20')](_0x4ec282['query'][_0xc1b4('0x20')]);_0x2932c7[_0xc1b4('0x22')]=qs[_0xc1b4('0x22')](_0x4ec282['query'][_0xc1b4('0x22')]);}return _0x7e5e95[_0xc1b4('0x66')](_0x2932c7);}})[_0xc1b4('0x2a')](function(_0x3f308b){if(_0x3f308b){return _0x3f308b?{'count':_0x36559b,'rows':_0x3f308b}:null;}})[_0xc1b4('0x2a')](respondWithResult(_0x33aa45,null))['catch'](handleError(_0x33aa45,null));};exports[_0xc1b4('0x67')]=function(_0x54cb71,_0x3b2751,_0x38c9de){var _0x4c54de=_0x54cb71[_0xc1b4('0x4f')][_0xc1b4('0x68')];return db[_0xc1b4('0x69')]['findAll']({'where':{'id':_0x4c54de},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc1b4('0x6a'),'attributes':['id',_0xc1b4('0x2f'),_0xc1b4('0x6b'),_0xc1b4('0x6c'),_0xc1b4('0x6d')],'raw':!![]}]})[_0xc1b4('0x2a')](function(_0xeca6ad){if(_0xeca6ad){var _0x30f786=_[_0xc1b4('0x6e')](_0xeca6ad,function(_0x324115){var _0x4248a5=_0x324115[_0xc1b4('0x2b')]({'plain':!![]});return _0x4248a5['Agents'];});return db[_0xc1b4('0x46')][_0xc1b4('0x4c')]({'where':{'id':_0x54cb71[_0xc1b4('0x58')]['id']}})['then'](function(_0x123726){return db['sequelize'][_0xc1b4('0x6f')](function(_0x9b60e5){return _0x123726['addTeams'](_0x4c54de,{'transaction':_0x9b60e5})[_0xc1b4('0x2a')](function(){return BPromise[_0xc1b4('0x70')](_0x30f786,function(_0x3eefb0){return db[_0xc1b4('0x5b')][_0xc1b4('0x71')]({'where':{'UserId':_0x3eefb0['id'],'OpenchannelQueueId':_0x54cb71['params']['id']},'transaction':_0x9b60e5});});})['then'](function(){_0x30f786[_0xc1b4('0x72')](function(_0x3d8cdd){socket['emit'](_0xc1b4('0x73'),{'UserId':_0x3d8cdd['id'],'OpenchannelQueueId':_0x123726['id']});});});});});}})['then'](respondWithStatusCode(_0x3b2751,null))[_0xc1b4('0x4d')](handleError(_0x3b2751,null));};exports['removeTeams']=function(_0x444daa,_0x13563d,_0x2490a1){return db[_0xc1b4('0x69')][_0xc1b4('0x49')]({'where':{'id':_0x444daa['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xc1b4('0x5e')],'as':_0xc1b4('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xc1b4('0x2a')](handleEntityNotFound(_0x13563d,null))[_0xc1b4('0x2a')](function(_0x10d972){var _0x574259=_['map'](_0x10d972,'id');var _0x303cd1=[];var _0x5f3248=[];var _0x4c5f65=squel[_0xc1b4('0x74')]();_0x4c5f65[_0xc1b4('0x75')](_0xc1b4('0x76'))[_0xc1b4('0x77')]('team_has_openchannel_queues','tq')[_0xc1b4('0x78')](_0xc1b4('0x79'),'ut',_0xc1b4('0x7a'))[_0xc1b4('0x40')](_0xc1b4('0x7b'),_0x444daa[_0xc1b4('0x58')]['id']);for(var _0x30ea2f=0x0;_0x30ea2f<_0x10d972[_0xc1b4('0x3a')];_0x30ea2f+=0x1){let _0x43f2d9=_0x10d972[_0x30ea2f];for(var _0x885595=0x0;_0x885595<_0x43f2d9[_0xc1b4('0x6a')][_0xc1b4('0x3a')];_0x885595+=0x1){let _0x515d5a=_0x43f2d9[_0xc1b4('0x6a')][_0x885595];var _0x3a0130=_0x4c5f65['clone']();_0x3a0130[_0xc1b4('0x40')](_0xc1b4('0x7c'),_0x515d5a['id']);_0x5f3248['push'](db[_0xc1b4('0x7d')][_0xc1b4('0x35')](_0x3a0130[_0xc1b4('0x7e')](),{'type':db['sequelize'][_0xc1b4('0x7f')][_0xc1b4('0x80')]})[_0xc1b4('0x2a')](function(_0x13eefb){if(_0x13eefb[_0xc1b4('0x3a')]===0x1){return _0x515d5a['id'];}else{var _0x155813=_['every'](_[_0xc1b4('0x41')](_0x13eefb,'TeamId'),function(_0x37f7c0){return _['includes'](_0x574259,_0x37f7c0);});if(_0x155813){return _0x515d5a['id'];}}}));}}return BPromise[_0xc1b4('0x81')](_0x5f3248)['then'](function(_0x201e34){_0x303cd1=_(_0x303cd1)['union'](_0x201e34)[_0xc1b4('0x82')]()[_0xc1b4('0x83')]();return db[_0xc1b4('0x46')][_0xc1b4('0x4c')]({'where':{'id':_0x444daa[_0xc1b4('0x58')]['id']}})[_0xc1b4('0x2a')](function(_0x7a0e99){return db[_0xc1b4('0x7d')][_0xc1b4('0x6f')](function(_0x281a98){return _0x7a0e99[_0xc1b4('0x84')](_0x444daa[_0xc1b4('0x35')][_0xc1b4('0x68')],{'transaction':_0x281a98})[_0xc1b4('0x2a')](function(){if(!_[_0xc1b4('0x85')](_0x303cd1)){return _0x7a0e99[_0xc1b4('0x86')](_0x303cd1,{'transaction':_0x281a98});}})[_0xc1b4('0x2a')](function(){_0x303cd1['forEach'](function(_0x2c578b){socket[_0xc1b4('0x87')](_0xc1b4('0x88'),{'UserId':_0x2c578b,'OpenchannelQueueId':_0x7a0e99['id']});});});});});});})[_0xc1b4('0x2a')](respondWithStatusCode(_0x13563d,null))[_0xc1b4('0x4d')](handleError(_0x13563d,null));};exports[_0xc1b4('0x89')]=function(_0x45cdd6,_0x8c570e,_0x5b8652){return db[_0xc1b4('0x46')]['find']({'where':{'id':_0x45cdd6['params']['id']}})[_0xc1b4('0x2a')](handleEntityNotFound(_0x8c570e,null))[_0xc1b4('0x2a')](function(_0x4b86d5){if(_0x4b86d5){return _0x4b86d5['addAgents'](_0x45cdd6['body']['ids'],_['omit'](_0x45cdd6[_0xc1b4('0x4f')],[_0xc1b4('0x68'),'id'])||{})[_0xc1b4('0x8a')](function(_0x56a77c){for(var _0x247467=0x0;_0x247467<_0x45cdd6[_0xc1b4('0x4f')][_0xc1b4('0x68')][_0xc1b4('0x3a')];_0x247467+=0x1){socket[_0xc1b4('0x87')](_0xc1b4('0x73'),{'UserId':Number(_0x45cdd6['body'][_0xc1b4('0x68')][_0x247467]),'OpenchannelQueueId':Number(_0x45cdd6[_0xc1b4('0x58')]['id'])});}return _0x56a77c;});}})[_0xc1b4('0x2a')](respondWithResult(_0x8c570e,null))['catch'](handleError(_0x8c570e,null));};exports[_0xc1b4('0x86')]=function(_0x41b9f0,_0x2e9024,_0x5aa825){return db[_0xc1b4('0x46')][_0xc1b4('0x4c')]({'where':{'id':_0x41b9f0[_0xc1b4('0x58')]['id']}})[_0xc1b4('0x2a')](handleEntityNotFound(_0x2e9024,null))['then'](function(_0x3d7179){if(_0x3d7179){return _0x3d7179[_0xc1b4('0x86')](_0x41b9f0[_0xc1b4('0x35')]['ids'])[_0xc1b4('0x2a')](function(){if(_['isArray'](_0x41b9f0[_0xc1b4('0x35')][_0xc1b4('0x68')])){for(var _0x1f91f6=0x0;_0x1f91f6<_0x41b9f0['query']['ids'][_0xc1b4('0x3a')];_0x1f91f6+=0x1){socket['emit'](_0xc1b4('0x88'),{'UserId':Number(_0x41b9f0['query'][_0xc1b4('0x68')][_0x1f91f6]),'OpenchannelQueueId':Number(_0x41b9f0[_0xc1b4('0x58')]['id'])});}}else{socket['emit'](_0xc1b4('0x88'),{'UserId':Number(_0x41b9f0['query'][_0xc1b4('0x68')]),'OpenchannelQueueId':Number(_0x41b9f0[_0xc1b4('0x58')]['id'])});}});}})[_0xc1b4('0x2a')](respondWithStatusCode(_0x2e9024,null))[_0xc1b4('0x4d')](handleError(_0x2e9024,null));};exports[_0xc1b4('0x8b')]=function(_0x3237cb,_0x37c507,_0x1b5271){var _0x3607e1={};var _0x5a5d8b={};var _0x103ab1;var _0x38b7c1;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x3237cb[_0xc1b4('0x58')]['id']}})[_0xc1b4('0x2a')](handleEntityNotFound(_0x37c507,null))[_0xc1b4('0x2a')](function(_0x296b83){if(_0x296b83){_0x103ab1=_0x296b83;_0x5a5d8b['model']=_[_0xc1b4('0x36')](db[_0xc1b4('0x5e')][_0xc1b4('0x31')]);_0x5a5d8b['query']=_[_0xc1b4('0x36')](_0x3237cb[_0xc1b4('0x35')]);_0x5a5d8b[_0xc1b4('0x3f')]=_[_0xc1b4('0x37')](_0x5a5d8b[_0xc1b4('0x34')],_0x5a5d8b['query']);_0x3607e1[_0xc1b4('0x38')]=_[_0xc1b4('0x37')](_0x5a5d8b[_0xc1b4('0x34')],qs[_0xc1b4('0x39')](_0x3237cb['query'][_0xc1b4('0x39')]));_0x3607e1[_0xc1b4('0x38')]=_0x3607e1[_0xc1b4('0x38')][_0xc1b4('0x3a')]?_0x3607e1[_0xc1b4('0x38')]:_0x5a5d8b['model'];_0x3607e1[_0xc1b4('0x3d')]=qs[_0xc1b4('0x3e')](_0x3237cb[_0xc1b4('0x35')]['sort']);_0x3607e1['where']=qs['filters'](_['pick'](_0x3237cb[_0xc1b4('0x35')],_0x5a5d8b[_0xc1b4('0x3f')]));if(_0x3237cb[_0xc1b4('0x35')][_0xc1b4('0x43')]){_0x3607e1[_0xc1b4('0x40')]=_[_0xc1b4('0x44')](_0x3607e1[_0xc1b4('0x40')],{'$or':_[_0xc1b4('0x41')](_0x3607e1[_0xc1b4('0x38')],function(_0x3bd063){var _0x298dc1={};_0x298dc1[_0x3bd063]={'$like':'%'+_0x3237cb[_0xc1b4('0x35')][_0xc1b4('0x43')]+'%'};return _0x298dc1;})});}_0x3607e1=_[_0xc1b4('0x44')]({},_0x3607e1,_0x3237cb['options']);return _0x103ab1[_0xc1b4('0x8b')](_0x3607e1);}})[_0xc1b4('0x2a')](function(_0x2a3b63){if(_0x2a3b63){_0x38b7c1=_0x2a3b63[_0xc1b4('0x3a')];if(!_0x3237cb[_0xc1b4('0x35')][_0xc1b4('0x3b')](_0xc1b4('0x3c'))){_0x3607e1['limit']=qs[_0xc1b4('0x20')](_0x3237cb[_0xc1b4('0x35')][_0xc1b4('0x20')]);_0x3607e1[_0xc1b4('0x22')]=qs[_0xc1b4('0x22')](_0x3237cb[_0xc1b4('0x35')]['offset']);}return _0x103ab1['getAgents'](_0x3607e1);}})[_0xc1b4('0x2a')](function(_0x1e0a22){if(_0x1e0a22){return _0x1e0a22?{'count':_0x38b7c1,'rows':_0x1e0a22}:null;}})[_0xc1b4('0x2a')](respondWithResult(_0x37c507,null))['catch'](handleError(_0x37c507,null));};
\ No newline at end of file
+var _0xe42f=['includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','options','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','%s/%s','getTeams','Team','addTeams','Agents','online','interface','sequelize','transaction','each','emit','userOpenchannelQueue:save','select','field','tq.TeamId','from','join','user_has_teams','OpenchannelQueueId\x20=\x20?','push','QueryTypes','TeamId','includes','all','value','removeTeams','ids','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','get','OpenchannelQueues','end','error','stack','name','send','index','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','OpenchannelQueue','count'];(function(_0x2f6ba0,_0x2b5f8c){var _0xd9ac22=function(_0x2dc0e0){while(--_0x2dc0e0){_0x2f6ba0['push'](_0x2f6ba0['shift']());}};_0xd9ac22(++_0x2b5f8c);}(_0xe42f,0x1d6));var _0xfe42=function(_0xd518ce,_0x5eb808){_0xd518ce=_0xd518ce-0x0;var _0x5f02f7=_0xe42f[_0xd518ce];return _0x5f02f7;};'use strict';var emlformat=require(_0xfe42('0x0'));var rimraf=require(_0xfe42('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe42('0x2'));var rp=require(_0xfe42('0x3'));var moment=require(_0xfe42('0x4'));var BPromise=require(_0xfe42('0x5'));var Mustache=require(_0xfe42('0x6'));var util=require('util');var path=require(_0xfe42('0x7'));var sox=require(_0xfe42('0x8'));var csv=require(_0xfe42('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe42('0xa'));var _=require(_0xfe42('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfe42('0xc'));var deskjs=require(_0xfe42('0xd'));var toCsv=require(_0xfe42('0x9'));var querystring=require(_0xfe42('0xe'));var Papa=require(_0xfe42('0xf'));var Redis=require(_0xfe42('0x10'));var authService=require(_0xfe42('0x11'));var qs=require(_0xfe42('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe42('0x13'));var logger=require(_0xfe42('0x14'))(_0xfe42('0x15'));var utils=require(_0xfe42('0x16'));var config=require(_0xfe42('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe42('0x18'))['db'];config[_0xfe42('0x19')]=_[_0xfe42('0x1a')](config[_0xfe42('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xfe42('0x1b'))(new Redis(config['redis']));require(_0xfe42('0x1c'))['register'](socket);function respondWithStatusCode(_0x111cd7,_0x2f7005){_0x2f7005=_0x2f7005||0xcc;return function(_0x11a1b0){if(_0x11a1b0){return _0x111cd7[_0xfe42('0x1d')](_0x2f7005);}return _0x111cd7[_0xfe42('0x1e')](_0x2f7005)['end']();};}function respondWithResult(_0x20a640,_0x51796e){_0x51796e=_0x51796e||0xc8;return function(_0x103273){if(_0x103273){return _0x20a640[_0xfe42('0x1e')](_0x51796e)[_0xfe42('0x1f')](_0x103273);}};}function respondWithFilteredResult(_0x3f4604,_0x1129b0){return function(_0x4694f8){if(_0x4694f8){var _0x4b6996=typeof _0x1129b0[_0xfe42('0x20')]===_0xfe42('0x21')&&typeof _0x1129b0['limit']===_0xfe42('0x21');var _0x45cfc4=_0x4694f8['count'];var _0x1b4f64=_0x4b6996?0x0:_0x1129b0[_0xfe42('0x20')];var _0x5b3d21=_0x4b6996?_0x4694f8['count']:_0x1129b0[_0xfe42('0x20')]+_0x1129b0[_0xfe42('0x22')];var _0x385571;if(_0x5b3d21>=_0x45cfc4){_0x5b3d21=_0x45cfc4;_0x385571=0xc8;}else{_0x385571=0xce;}_0x3f4604[_0xfe42('0x1e')](_0x385571);return _0x3f4604['set'](_0xfe42('0x23'),_0x1b4f64+'-'+_0x5b3d21+'/'+_0x45cfc4)[_0xfe42('0x1f')](_0x4694f8);}return null;};}function patchUpdates(_0x3ac753){return function(_0x117fbe){try{jsonpatch[_0xfe42('0x24')](_0x117fbe,_0x3ac753,!![]);}catch(_0x29ffd9){return BPromise[_0xfe42('0x25')](_0x29ffd9);}return _0x117fbe[_0xfe42('0x26')]();};}function saveUpdates(_0x3a3726,_0x17a897){return function(_0x517cae){if(_0x517cae){return _0x517cae[_0xfe42('0x27')](_0x3a3726)['then'](function(_0x217571){return _0x217571;});}return null;};}function removeEntity(_0x2fd78d,_0x376bd0){return function(_0x455ce8){if(_0x455ce8){return _0x455ce8['destroy']()[_0xfe42('0x28')](function(){var _0x2d5334=_0x455ce8[_0xfe42('0x29')]({'plain':!![]});var _0x318e28=_0xfe42('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x318e28,'resourceId':_0x2d5334['id']}})[_0xfe42('0x28')](function(){return _0x455ce8;});})[_0xfe42('0x28')](function(){_0x2fd78d[_0xfe42('0x1e')](0xcc)[_0xfe42('0x2b')]();});}};}function handleEntityNotFound(_0x47c85f,_0x51a15){return function(_0x44f3e8){if(!_0x44f3e8){_0x47c85f[_0xfe42('0x1d')](0x194);}return _0x44f3e8;};}function handleError(_0x192a42,_0x296c20){_0x296c20=_0x296c20||0x1f4;return function(_0x498398){logger[_0xfe42('0x2c')](_0x498398[_0xfe42('0x2d')]);if(_0x498398['name']){delete _0x498398[_0xfe42('0x2e')];}_0x192a42[_0xfe42('0x1e')](_0x296c20)[_0xfe42('0x2f')](_0x498398);};}exports[_0xfe42('0x30')]=function(_0x2038f5,_0x3fdb87){var _0x19ceae={},_0x5358ca={},_0x1a6de7={'count':0x0,'rows':[]};var _0x18f33c=_[_0xfe42('0x31')](db['OpenchannelQueue'][_0xfe42('0x32')],function(_0x55ff56){return{'name':_0x55ff56['fieldName'],'type':_0x55ff56['type'][_0xfe42('0x33')]};});_0x5358ca[_0xfe42('0x34')]=_[_0xfe42('0x31')](_0x18f33c,_0xfe42('0x2e'));_0x5358ca[_0xfe42('0x35')]=_['keys'](_0x2038f5[_0xfe42('0x35')]);_0x5358ca[_0xfe42('0x36')]=_[_0xfe42('0x37')](_0x5358ca[_0xfe42('0x34')],_0x5358ca[_0xfe42('0x35')]);_0x19ceae[_0xfe42('0x38')]=_[_0xfe42('0x37')](_0x5358ca[_0xfe42('0x34')],qs['fields'](_0x2038f5['query'][_0xfe42('0x39')]));_0x19ceae[_0xfe42('0x38')]=_0x19ceae[_0xfe42('0x38')][_0xfe42('0x3a')]?_0x19ceae[_0xfe42('0x38')]:_0x5358ca[_0xfe42('0x34')];if(!_0x2038f5[_0xfe42('0x35')][_0xfe42('0x3b')](_0xfe42('0x3c'))){_0x19ceae[_0xfe42('0x22')]=qs[_0xfe42('0x22')](_0x2038f5['query'][_0xfe42('0x22')]);_0x19ceae['offset']=qs[_0xfe42('0x20')](_0x2038f5[_0xfe42('0x35')]['offset']);}_0x19ceae[_0xfe42('0x3d')]=qs[_0xfe42('0x3e')](_0x2038f5['query']['sort']);_0x19ceae[_0xfe42('0x3f')]=qs['filters'](_[_0xfe42('0x40')](_0x2038f5[_0xfe42('0x35')],_0x5358ca['filters']),_0x18f33c);if(_0x2038f5[_0xfe42('0x35')][_0xfe42('0x41')]){_0x19ceae[_0xfe42('0x3f')]=_[_0xfe42('0x42')](_0x19ceae[_0xfe42('0x3f')],{'$or':_[_0xfe42('0x31')](_0x18f33c,function(_0x9ca05e){if(_0x9ca05e[_0xfe42('0x43')]!=='VIRTUAL'){var _0x448246={};_0x448246[_0x9ca05e['name']]={'$like':'%'+_0x2038f5[_0xfe42('0x35')]['filter']+'%'};return _0x448246;}})});}_0x19ceae=_[_0xfe42('0x42')]({},_0x19ceae,_0x2038f5['options']);var _0x1d8f26={'where':_0x19ceae['where']};return db[_0xfe42('0x44')][_0xfe42('0x45')](_0x1d8f26)[_0xfe42('0x28')](function(_0x285b8f){_0x1a6de7['count']=_0x285b8f;if(_0x2038f5[_0xfe42('0x35')][_0xfe42('0x46')]){_0x19ceae[_0xfe42('0x47')]=[{'all':!![]}];}return db[_0xfe42('0x44')][_0xfe42('0x48')](_0x19ceae);})[_0xfe42('0x28')](function(_0x290d4b){_0x1a6de7[_0xfe42('0x49')]=_0x290d4b;return _0x1a6de7;})[_0xfe42('0x28')](respondWithFilteredResult(_0x3fdb87,_0x19ceae))[_0xfe42('0x4a')](handleError(_0x3fdb87,null));};exports[_0xfe42('0x4b')]=function(_0x5e0ac4,_0x710bbb){var _0x35e53e={'raw':!![],'where':{'id':_0x5e0ac4[_0xfe42('0x4c')]['id']}},_0x5f1ef9={};_0x5f1ef9['model']=_[_0xfe42('0x4d')](db[_0xfe42('0x44')][_0xfe42('0x32')]);_0x5f1ef9['query']=_[_0xfe42('0x4d')](_0x5e0ac4[_0xfe42('0x35')]);_0x5f1ef9[_0xfe42('0x36')]=_[_0xfe42('0x37')](_0x5f1ef9[_0xfe42('0x34')],_0x5f1ef9[_0xfe42('0x35')]);_0x35e53e['attributes']=_['intersection'](_0x5f1ef9[_0xfe42('0x34')],qs[_0xfe42('0x39')](_0x5e0ac4[_0xfe42('0x35')][_0xfe42('0x39')]));_0x35e53e[_0xfe42('0x38')]=_0x35e53e['attributes']['length']?_0x35e53e[_0xfe42('0x38')]:_0x5f1ef9[_0xfe42('0x34')];if(_0x5e0ac4[_0xfe42('0x35')][_0xfe42('0x46')]){_0x35e53e[_0xfe42('0x47')]=[{'all':!![]}];}_0x35e53e=_[_0xfe42('0x42')]({},_0x35e53e,_0x5e0ac4['options']);return db[_0xfe42('0x44')][_0xfe42('0x4e')](_0x35e53e)[_0xfe42('0x28')](handleEntityNotFound(_0x710bbb,null))[_0xfe42('0x28')](respondWithResult(_0x710bbb,null))[_0xfe42('0x4a')](handleError(_0x710bbb,null));};exports[_0xfe42('0x4f')]=function(_0x4a9fa4,_0x5c4e38){return db[_0xfe42('0x44')][_0xfe42('0x4f')](_0x4a9fa4[_0xfe42('0x50')],{})['then'](function(_0x5d8889){var _0x55a384=_0x4a9fa4[_0xfe42('0x51')][_0xfe42('0x29')]({'plain':!![]});if(!_0x55a384)throw new Error(_0xfe42('0x52'));if(_0x55a384[_0xfe42('0x53')]===_0xfe42('0x51')){var _0x3c35b9=_0x5d8889[_0xfe42('0x29')]({'plain':!![]});var _0x19c148=_0xfe42('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x19c148,'userProfileId':_0x55a384[_0xfe42('0x54')]},'raw':!![]})[_0xfe42('0x28')](function(_0x2baaf6){if(_0x2baaf6&&_0x2baaf6['autoAssociation']===0x0){return db[_0xfe42('0x55')][_0xfe42('0x4f')]({'name':_0x3c35b9[_0xfe42('0x2e')],'resourceId':_0x3c35b9['id'],'type':_0x2baaf6['name'],'sectionId':_0x2baaf6['id']},{})[_0xfe42('0x28')](function(){return _0x5d8889;});}else{return _0x5d8889;}})[_0xfe42('0x4a')](function(_0x1b6cd3){logger['error'](_0xfe42('0x56'),_0x1b6cd3);throw _0x1b6cd3;});}return _0x5d8889;})[_0xfe42('0x28')](respondWithResult(_0x5c4e38,0xc9))[_0xfe42('0x4a')](handleError(_0x5c4e38,null));};exports[_0xfe42('0x27')]=function(_0x3ce0bf,_0x573fdf){if(_0x3ce0bf['body']['id']){delete _0x3ce0bf['body']['id'];}return db[_0xfe42('0x44')][_0xfe42('0x4e')]({'where':{'id':_0x3ce0bf[_0xfe42('0x4c')]['id']}})[_0xfe42('0x28')](handleEntityNotFound(_0x573fdf,null))[_0xfe42('0x28')](saveUpdates(_0x3ce0bf[_0xfe42('0x50')],null))['then'](respondWithResult(_0x573fdf,null))[_0xfe42('0x4a')](handleError(_0x573fdf,null));};exports[_0xfe42('0x57')]=function(_0x523ef0,_0x4c09a7){return db[_0xfe42('0x44')][_0xfe42('0x4e')]({'where':{'id':_0x523ef0['params']['id']}})[_0xfe42('0x28')](handleEntityNotFound(_0x4c09a7,null))[_0xfe42('0x28')](removeEntity(_0x4c09a7,null))[_0xfe42('0x4a')](handleError(_0x4c09a7,null));};exports[_0xfe42('0x58')]=function(_0x2fb013,_0x23c158){return db['OpenchannelQueue'][_0xfe42('0x58')]()[_0xfe42('0x28')](respondWithResult(_0x23c158,null))['catch'](handleError(_0x23c158,null));};exports[_0xfe42('0x59')]=function(_0x43d026,_0x497db4,_0x1c8d40){var _0x2f6fca={'raw':!![],'where':{}},_0x4992b9={},_0x4d1e6e;return db['OpenchannelQueue'][_0xfe42('0x5a')]({'where':{'id':_0x43d026['params']['id']}})[_0xfe42('0x28')](handleEntityNotFound(_0x497db4,null))[_0xfe42('0x28')](function(_0x4e48f1){if(_0x4e48f1){_0x4d1e6e=_0x4e48f1[_0xfe42('0x29')]({'plain':!![]});_0x4992b9[_0xfe42('0x34')]=_[_0xfe42('0x4d')](db[_0xfe42('0x5b')][_0xfe42('0x32')]);_0x4992b9['query']=_['keys'](_0x43d026[_0xfe42('0x35')]);_0x4992b9[_0xfe42('0x36')]=_[_0xfe42('0x37')](_0x4992b9[_0xfe42('0x34')],_0x4992b9[_0xfe42('0x35')]);_0x2f6fca[_0xfe42('0x38')]=_[_0xfe42('0x37')](_0x4992b9[_0xfe42('0x34')],qs[_0xfe42('0x39')](_0x43d026['query'][_0xfe42('0x39')]));_0x2f6fca['attributes']=_0x2f6fca['attributes'][_0xfe42('0x3a')]?_0x2f6fca[_0xfe42('0x38')]:_0x4992b9[_0xfe42('0x34')];if(!_0x43d026[_0xfe42('0x35')][_0xfe42('0x3b')]('nolimit')){_0x2f6fca['limit']=qs['limit'](_0x43d026[_0xfe42('0x35')]['limit']);_0x2f6fca[_0xfe42('0x20')]=qs[_0xfe42('0x20')](_0x43d026['query'][_0xfe42('0x20')]);}_0x2f6fca[_0xfe42('0x3d')]=qs['sort'](_0x43d026['query'][_0xfe42('0x3e')]);_0x2f6fca[_0xfe42('0x3f')]=qs[_0xfe42('0x36')](_[_0xfe42('0x40')](_0x43d026[_0xfe42('0x35')],_0x4992b9[_0xfe42('0x36')]));_0x2f6fca['where'][_0xfe42('0x5c')]=_0x4e48f1['id'];if(_0x43d026[_0xfe42('0x35')][_0xfe42('0x41')]){_0x2f6fca['where']=_[_0xfe42('0x42')](_0x2f6fca[_0xfe42('0x3f')],{'$or':_[_0xfe42('0x31')](_0x2f6fca['attributes'],function(_0x47dc02){var _0x207505={};_0x207505[_0x47dc02]={'$like':'%'+_0x43d026['query'][_0xfe42('0x41')]+'%'};return _0x207505;})});}_0x2f6fca=_[_0xfe42('0x42')]({},_0x2f6fca,_0x43d026[_0xfe42('0x5d')]);return db[_0xfe42('0x5b')][_0xfe42('0x48')](_0x2f6fca);}})['then'](function(_0x4cf35b){if(_0x4cf35b){return db[_0xfe42('0x5e')][_0xfe42('0x5f')]({'where':{'id':_[_0xfe42('0x31')](_0x4cf35b,_0xfe42('0x60')),'role':'agent'},'attributes':['id',_0xfe42('0x2e'),_0xfe42('0x61'),_0xfe42('0x62'),_0xfe42('0x63')]});}})[_0xfe42('0x28')](function(_0x504af5){if(_0x504af5){return{'count':_0x504af5[_0xfe42('0x45')],'rows':_['map'](_0x504af5['rows'],function(_0x37a1be){return{'membername':_0x37a1be[_0xfe42('0x2e')],'UserId':_0x37a1be['id'],'queue_name':_0x4d1e6e[_0xfe42('0x2e')],'OpenchannelQueueId':_0x4d1e6e['id'],'interface':util['format'](_0xfe42('0x64'),'SIP',_0x37a1be[_0xfe42('0x2e')]),'penalty':0x0,'paused':_0x37a1be[_0xfe42('0x61')],'createdAt':_0x37a1be[_0xfe42('0x63')],'updatedAt':_0x37a1be[_0xfe42('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x497db4,_0x2f6fca))['catch'](handleError(_0x497db4,null));};exports[_0xfe42('0x65')]=function(_0x471682,_0x16cb6b,_0x10e648){var _0x39473f={};var _0x432147={};var _0x2b2169;var _0x28485f;return db[_0xfe42('0x44')][_0xfe42('0x5a')]({'where':{'id':_0x471682[_0xfe42('0x4c')]['id']}})[_0xfe42('0x28')](handleEntityNotFound(_0x16cb6b,null))['then'](function(_0x500873){if(_0x500873){_0x2b2169=_0x500873;_0x432147[_0xfe42('0x34')]=_[_0xfe42('0x4d')](db[_0xfe42('0x66')][_0xfe42('0x32')]);_0x432147['query']=_[_0xfe42('0x4d')](_0x471682[_0xfe42('0x35')]);_0x432147[_0xfe42('0x36')]=_[_0xfe42('0x37')](_0x432147[_0xfe42('0x34')],_0x432147[_0xfe42('0x35')]);_0x39473f[_0xfe42('0x38')]=_[_0xfe42('0x37')](_0x432147['model'],qs[_0xfe42('0x39')](_0x471682[_0xfe42('0x35')][_0xfe42('0x39')]));_0x39473f[_0xfe42('0x38')]=_0x39473f[_0xfe42('0x38')][_0xfe42('0x3a')]?_0x39473f['attributes']:_0x432147['model'];_0x39473f['order']=qs['sort'](_0x471682[_0xfe42('0x35')]['sort']);_0x39473f['where']=qs[_0xfe42('0x36')](_[_0xfe42('0x40')](_0x471682['query'],_0x432147[_0xfe42('0x36')]));if(_0x471682[_0xfe42('0x35')][_0xfe42('0x41')]){_0x39473f[_0xfe42('0x3f')]=_[_0xfe42('0x42')](_0x39473f[_0xfe42('0x3f')],{'$or':_['map'](_0x39473f[_0xfe42('0x38')],function(_0xfaeaa4){var _0x452d2b={};_0x452d2b[_0xfaeaa4]={'$like':'%'+_0x471682[_0xfe42('0x35')][_0xfe42('0x41')]+'%'};return _0x452d2b;})});}_0x39473f=_[_0xfe42('0x42')]({},_0x39473f,_0x471682[_0xfe42('0x5d')]);return _0x2b2169[_0xfe42('0x65')](_0x39473f);}})[_0xfe42('0x28')](function(_0x222f78){if(_0x222f78){_0x28485f=_0x222f78[_0xfe42('0x3a')];if(!_0x471682[_0xfe42('0x35')]['hasOwnProperty'](_0xfe42('0x3c'))){_0x39473f[_0xfe42('0x22')]=qs[_0xfe42('0x22')](_0x471682[_0xfe42('0x35')][_0xfe42('0x22')]);_0x39473f[_0xfe42('0x20')]=qs['offset'](_0x471682[_0xfe42('0x35')]['offset']);}return _0x2b2169[_0xfe42('0x65')](_0x39473f);}})[_0xfe42('0x28')](function(_0x402c3e){if(_0x402c3e){return _0x402c3e?{'count':_0x28485f,'rows':_0x402c3e}:null;}})[_0xfe42('0x28')](respondWithResult(_0x16cb6b,null))[_0xfe42('0x4a')](handleError(_0x16cb6b,null));};exports[_0xfe42('0x67')]=function(_0x4ce1f6,_0x1e315b,_0x1541b6){var _0x5793ac=_0x4ce1f6[_0xfe42('0x50')]['ids'];return db[_0xfe42('0x66')][_0xfe42('0x48')]({'where':{'id':_0x5793ac},'attributes':['id'],'include':[{'model':db[_0xfe42('0x5e')],'as':_0xfe42('0x68'),'attributes':['id',_0xfe42('0x2e'),_0xfe42('0x69'),'voicePause',_0xfe42('0x6a')],'raw':!![]}]})['then'](function(_0x141517){if(_0x141517){var _0x370940=_['flatMap'](_0x141517,function(_0x1e9c8a){var _0x1826c4=_0x1e9c8a['get']({'plain':!![]});return _0x1826c4['Agents'];});return db[_0xfe42('0x44')][_0xfe42('0x4e')]({'where':{'id':_0x4ce1f6['params']['id']}})['then'](function(_0x5da6dd){return db[_0xfe42('0x6b')][_0xfe42('0x6c')](function(_0x55ef13){return _0x5da6dd['addTeams'](_0x5793ac,{'transaction':_0x55ef13})[_0xfe42('0x28')](function(){return BPromise[_0xfe42('0x6d')](_0x370940,function(_0xc6f5e3){return db[_0xfe42('0x5b')]['findOrCreate']({'where':{'UserId':_0xc6f5e3['id'],'OpenchannelQueueId':_0x4ce1f6[_0xfe42('0x4c')]['id']},'transaction':_0x55ef13});});})[_0xfe42('0x28')](function(){_0x370940['forEach'](function(_0x5f08e0){socket[_0xfe42('0x6e')](_0xfe42('0x6f'),{'UserId':_0x5f08e0['id'],'OpenchannelQueueId':_0x5da6dd['id']});});});});});}})[_0xfe42('0x28')](respondWithStatusCode(_0x1e315b,null))[_0xfe42('0x4a')](handleError(_0x1e315b,null));};exports['removeTeams']=function(_0x7f0f60,_0x2285fd,_0x40f1c8){return db['Team'][_0xfe42('0x48')]({'where':{'id':_0x7f0f60[_0xfe42('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0xfe42('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2285fd,null))[_0xfe42('0x28')](function(_0xf4bd65){var _0x2916cd=_[_0xfe42('0x31')](_0xf4bd65,'id');var _0x572d8f=[];var _0x3a01e8=[];var _0x4a05f3=squel[_0xfe42('0x70')]();_0x4a05f3[_0xfe42('0x71')](_0xfe42('0x72'))[_0xfe42('0x73')]('team_has_openchannel_queues','tq')[_0xfe42('0x74')](_0xfe42('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xfe42('0x3f')](_0xfe42('0x76'),_0x7f0f60[_0xfe42('0x4c')]['id']);for(var _0x2df318=0x0;_0x2df318<_0xf4bd65[_0xfe42('0x3a')];_0x2df318+=0x1){let _0x55cdc=_0xf4bd65[_0x2df318];for(var _0x5ed48d=0x0;_0x5ed48d<_0x55cdc['Agents'][_0xfe42('0x3a')];_0x5ed48d+=0x1){let _0x4fef95=_0x55cdc[_0xfe42('0x68')][_0x5ed48d];var _0x572d24=_0x4a05f3['clone']();_0x572d24[_0xfe42('0x3f')]('ut.UserId\x20=\x20?',_0x4fef95['id']);_0x3a01e8[_0xfe42('0x77')](db['sequelize'][_0xfe42('0x35')](_0x572d24['toString'](),{'type':db[_0xfe42('0x6b')][_0xfe42('0x78')]['SELECT']})[_0xfe42('0x28')](function(_0x3b9ee7){if(_0x3b9ee7[_0xfe42('0x3a')]===0x1){return _0x4fef95['id'];}else{var _0x745bd6=_['every'](_['map'](_0x3b9ee7,_0xfe42('0x79')),function(_0x421b56){return _[_0xfe42('0x7a')](_0x2916cd,_0x421b56);});if(_0x745bd6){return _0x4fef95['id'];}}}));}}return BPromise[_0xfe42('0x7b')](_0x3a01e8)['then'](function(_0xe5e8f6){_0x572d8f=_(_0x572d8f)['union'](_0xe5e8f6)['compact']()[_0xfe42('0x7c')]();return db[_0xfe42('0x44')][_0xfe42('0x4e')]({'where':{'id':_0x7f0f60[_0xfe42('0x4c')]['id']}})['then'](function(_0x375c8f){return db[_0xfe42('0x6b')][_0xfe42('0x6c')](function(_0x2f4da1){return _0x375c8f[_0xfe42('0x7d')](_0x7f0f60[_0xfe42('0x35')][_0xfe42('0x7e')],{'transaction':_0x2f4da1})['then'](function(){if(!_[_0xfe42('0x7f')](_0x572d8f)){return _0x375c8f[_0xfe42('0x80')](_0x572d8f,{'transaction':_0x2f4da1});}})[_0xfe42('0x28')](function(){_0x572d8f[_0xfe42('0x81')](function(_0x22cb0d){socket['emit'](_0xfe42('0x82'),{'UserId':_0x22cb0d,'OpenchannelQueueId':_0x375c8f['id']});});});});});});})[_0xfe42('0x28')](respondWithStatusCode(_0x2285fd,null))[_0xfe42('0x4a')](handleError(_0x2285fd,null));};exports[_0xfe42('0x83')]=function(_0x2f7ae9,_0x5861b2,_0x229d78){return db[_0xfe42('0x44')][_0xfe42('0x4e')]({'where':{'id':_0x2f7ae9[_0xfe42('0x4c')]['id']}})[_0xfe42('0x28')](handleEntityNotFound(_0x5861b2,null))['then'](function(_0x3513d8){if(_0x3513d8){return _0x3513d8[_0xfe42('0x83')](_0x2f7ae9[_0xfe42('0x50')][_0xfe42('0x7e')],_['omit'](_0x2f7ae9[_0xfe42('0x50')],['ids','id'])||{})[_0xfe42('0x84')](function(_0x28d4fc){for(var _0x1a0d06=0x0;_0x1a0d06<_0x2f7ae9[_0xfe42('0x50')][_0xfe42('0x7e')][_0xfe42('0x3a')];_0x1a0d06+=0x1){socket[_0xfe42('0x6e')]('userOpenchannelQueue:save',{'UserId':Number(_0x2f7ae9[_0xfe42('0x50')][_0xfe42('0x7e')][_0x1a0d06]),'OpenchannelQueueId':Number(_0x2f7ae9[_0xfe42('0x4c')]['id'])});}return _0x28d4fc;});}})[_0xfe42('0x28')](respondWithResult(_0x5861b2,null))[_0xfe42('0x4a')](handleError(_0x5861b2,null));};exports[_0xfe42('0x80')]=function(_0x4818d8,_0x3b00a0,_0x535936){return db['OpenchannelQueue'][_0xfe42('0x4e')]({'where':{'id':_0x4818d8['params']['id']}})[_0xfe42('0x28')](handleEntityNotFound(_0x3b00a0,null))[_0xfe42('0x28')](function(_0x3ab47b){if(_0x3ab47b){return _0x3ab47b['removeAgents'](_0x4818d8['query'][_0xfe42('0x7e')])[_0xfe42('0x28')](function(){if(_[_0xfe42('0x85')](_0x4818d8['query'][_0xfe42('0x7e')])){for(var _0x25056b=0x0;_0x25056b<_0x4818d8[_0xfe42('0x35')][_0xfe42('0x7e')]['length'];_0x25056b+=0x1){socket[_0xfe42('0x6e')]('userOpenchannelQueue:remove',{'UserId':Number(_0x4818d8[_0xfe42('0x35')][_0xfe42('0x7e')][_0x25056b]),'OpenchannelQueueId':Number(_0x4818d8[_0xfe42('0x4c')]['id'])});}}else{socket['emit'](_0xfe42('0x82'),{'UserId':Number(_0x4818d8[_0xfe42('0x35')][_0xfe42('0x7e')]),'OpenchannelQueueId':Number(_0x4818d8['params']['id'])});}});}})[_0xfe42('0x28')](respondWithStatusCode(_0x3b00a0,null))[_0xfe42('0x4a')](handleError(_0x3b00a0,null));};exports[_0xfe42('0x86')]=function(_0x3a4f89,_0x37349e,_0x3c1ec1){var _0x28fec3={};var _0xde7642={};var _0x96a78a;var _0x138ea2;return db[_0xfe42('0x44')][_0xfe42('0x5a')]({'where':{'id':_0x3a4f89[_0xfe42('0x4c')]['id']}})[_0xfe42('0x28')](handleEntityNotFound(_0x37349e,null))['then'](function(_0x313b0c){if(_0x313b0c){_0x96a78a=_0x313b0c;_0xde7642[_0xfe42('0x34')]=_[_0xfe42('0x4d')](db[_0xfe42('0x5e')]['rawAttributes']);_0xde7642['query']=_[_0xfe42('0x4d')](_0x3a4f89[_0xfe42('0x35')]);_0xde7642['filters']=_[_0xfe42('0x37')](_0xde7642[_0xfe42('0x34')],_0xde7642[_0xfe42('0x35')]);_0x28fec3[_0xfe42('0x38')]=_[_0xfe42('0x37')](_0xde7642[_0xfe42('0x34')],qs[_0xfe42('0x39')](_0x3a4f89[_0xfe42('0x35')][_0xfe42('0x39')]));_0x28fec3[_0xfe42('0x38')]=_0x28fec3[_0xfe42('0x38')]['length']?_0x28fec3[_0xfe42('0x38')]:_0xde7642[_0xfe42('0x34')];_0x28fec3[_0xfe42('0x3d')]=qs[_0xfe42('0x3e')](_0x3a4f89['query']['sort']);_0x28fec3['where']=qs[_0xfe42('0x36')](_['pick'](_0x3a4f89[_0xfe42('0x35')],_0xde7642[_0xfe42('0x36')]));if(_0x3a4f89[_0xfe42('0x35')][_0xfe42('0x41')]){_0x28fec3['where']=_['merge'](_0x28fec3[_0xfe42('0x3f')],{'$or':_['map'](_0x28fec3[_0xfe42('0x38')],function(_0x3890f4){var _0x2046c8={};_0x2046c8[_0x3890f4]={'$like':'%'+_0x3a4f89[_0xfe42('0x35')]['filter']+'%'};return _0x2046c8;})});}_0x28fec3=_['merge']({},_0x28fec3,_0x3a4f89[_0xfe42('0x5d')]);return _0x96a78a[_0xfe42('0x86')](_0x28fec3);}})[_0xfe42('0x28')](function(_0x49e932){if(_0x49e932){_0x138ea2=_0x49e932[_0xfe42('0x3a')];if(!_0x3a4f89[_0xfe42('0x35')][_0xfe42('0x3b')](_0xfe42('0x3c'))){_0x28fec3[_0xfe42('0x22')]=qs[_0xfe42('0x22')](_0x3a4f89[_0xfe42('0x35')]['limit']);_0x28fec3[_0xfe42('0x20')]=qs[_0xfe42('0x20')](_0x3a4f89[_0xfe42('0x35')]['offset']);}return _0x96a78a[_0xfe42('0x86')](_0x28fec3);}})[_0xfe42('0x28')](function(_0x2574d8){if(_0x2574d8){return _0x2574d8?{'count':_0x138ea2,'rows':_0x2574d8}:null;}})[_0xfe42('0x28')](respondWithResult(_0x37349e,null))['catch'](handleError(_0x37349e,null));};
\ No newline at end of file
index 079d97e..397b294 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb864=['save','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x1cc686,_0x59ddf0){var _0x182a2c=function(_0x4b8084){while(--_0x4b8084){_0x1cc686['push'](_0x1cc686['shift']());}};_0x182a2c(++_0x59ddf0);}(_0xb864,0x16e));var _0x4b86=function(_0x16455e,_0x9e7da5){_0x16455e=_0x16455e-0x0;var _0x5a1ebd=_0xb864[_0x16455e];return _0x5a1ebd;};'use strict';var EventEmitter=require(_0x4b86('0x0'));var OpenchannelQueue=require(_0x4b86('0x1'))['db'][_0x4b86('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x4b86('0x3')](0x0);var events={'afterCreate':_0x4b86('0x4'),'afterUpdate':_0x4b86('0x5'),'afterDestroy':_0x4b86('0x6')};function emitEvent(_0x522028){return function(_0x2ac2ad,_0x43ede6,_0x28494d){OpenchannelQueueEvents['emit'](_0x522028+':'+_0x2ac2ad['id'],_0x2ac2ad);OpenchannelQueueEvents['emit'](_0x522028,_0x2ac2ad);_0x28494d(null);};}for(var e in events){if(events[_0x4b86('0x7')](e)){var event=events[e];OpenchannelQueue[_0x4b86('0x8')](e,emitEvent(event));}}module[_0x4b86('0x9')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0xa7be=['hook','events','OpenchannelQueue','setMaxListeners','save','update','remove','emit'];(function(_0x3506fd,_0x51ad7c){var _0x271bc4=function(_0x114327){while(--_0x114327){_0x3506fd['push'](_0x3506fd['shift']());}};_0x271bc4(++_0x51ad7c);}(_0xa7be,0x131));var _0xea7b=function(_0x348d60,_0x252ed9){_0x348d60=_0x348d60-0x0;var _0x1855ee=_0xa7be[_0x348d60];return _0x1855ee;};'use strict';var EventEmitter=require(_0xea7b('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xea7b('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xea7b('0x2')](0x0);var events={'afterCreate':_0xea7b('0x3'),'afterUpdate':_0xea7b('0x4'),'afterDestroy':_0xea7b('0x5')};function emitEvent(_0x15b961){return function(_0x11b5c8,_0xe0879c,_0x59d9a8){OpenchannelQueueEvents['emit'](_0x15b961+':'+_0x11b5c8['id'],_0x11b5c8);OpenchannelQueueEvents[_0xea7b('0x6')](_0x15b961,_0x11b5c8);_0x59d9a8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xea7b('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
index cd567d2..b178093 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4e4=['define','OpenchannelQueue','openchannel_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd4e4,0x7b));var _0x4d4e=function(_0x458c05,_0x185221){_0x458c05=_0x458c05-0x0;var _0x461a63=_0xd4e4[_0x458c05];return _0x461a63;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4d4e('0x0'))(_0x4d4e('0x1'));var moment=require(_0x4d4e('0x2'));var BPromise=require(_0x4d4e('0x3'));var rp=require(_0x4d4e('0x4'));var fs=require('fs');var path=require(_0x4d4e('0x5'));var rimraf=require(_0x4d4e('0x6'));var config=require(_0x4d4e('0x7'));var attributes=require(_0x4d4e('0x8'));module['exports']=function(_0x3c9a0a,_0x413f96){return _0x3c9a0a[_0x4d4e('0x9')](_0x4d4e('0xa'),attributes,{'tableName':_0x4d4e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2a30=['rimraf','./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5da0d9,_0x49ee54){var _0x4b6d2f=function(_0x9832cf){while(--_0x9832cf){_0x5da0d9['push'](_0x5da0d9['shift']());}};_0x4b6d2f(++_0x49ee54);}(_0x2a30,0xd5));var _0x02a3=function(_0x8ea9f0,_0x240003){_0x8ea9f0=_0x8ea9f0-0x0;var _0x36e454=_0x2a30[_0x8ea9f0];return _0x36e454;};'use strict';var _=require(_0x02a3('0x0'));var util=require(_0x02a3('0x1'));var logger=require(_0x02a3('0x2'))(_0x02a3('0x3'));var moment=require(_0x02a3('0x4'));var BPromise=require(_0x02a3('0x5'));var rp=require(_0x02a3('0x6'));var fs=require('fs');var path=require(_0x02a3('0x7'));var rimraf=require(_0x02a3('0x8'));var config=require('../../config/environment');var attributes=require(_0x02a3('0x9'));module[_0x02a3('0xa')]=function(_0x30ef35,_0x14909d){return _0x30ef35[_0x02a3('0xb')]('OpenchannelQueue',attributes,{'tableName':_0x02a3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a9e23e1..bef84be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x941b=['message','catch','OpenchannelQueue','findAll','options','raw','where','attributes','include','model','map','GetOpenchannelQueue','debug','ShowOpenchannelQueue','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x12499d,_0x239cf1){var _0x3a582e=function(_0x30094c){while(--_0x30094c){_0x12499d['push'](_0x12499d['shift']());}};_0x3a582e(++_0x239cf1);}(_0x941b,0x1e3));var _0xb941=function(_0x5e193b,_0xd5eccf){_0x5e193b=_0x5e193b-0x0;var _0x4f8d4d=_0x941b[_0x5e193b];return _0x4f8d4d;};'use strict';var _=require('lodash');var util=require(_0xb941('0x0'));var moment=require(_0xb941('0x1'));var BPromise=require('bluebird');var rs=require(_0xb941('0x2'));var fs=require('fs');var Redis=require(_0xb941('0x3'));var db=require(_0xb941('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb941('0x5'))(_0xb941('0x6'));var config=require(_0xb941('0x7'));var jayson=require(_0xb941('0x8'));var client=jayson[_0xb941('0x9')]['http']({'port':0x232a});config['redis']=_[_0xb941('0xa')](config['redis'],{'host':_0xb941('0xb'),'port':0x18eb});var socket=require(_0xb941('0xc'))(new Redis(config[_0xb941('0xd')]));require(_0xb941('0xe'))[_0xb941('0xf')](socket);function respondWithRpcPromise(_0x22efdd,_0x43807d,_0x2279a3){return new BPromise(function(_0x151826,_0x3a9998){return client[_0xb941('0x10')](_0x22efdd,_0x2279a3)[_0xb941('0x11')](function(_0xdaf37){logger[_0xb941('0x12')](_0xb941('0x13'),_0x43807d,_0xb941('0x14'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x43807d,'request\x20sent',JSON[_0xb941('0x15')](_0xdaf37));if(_0xdaf37[_0xb941('0x16')]){if(_0xdaf37[_0xb941('0x16')][_0xb941('0x17')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x43807d,_0xdaf37[_0xb941('0x16')][_0xb941('0x18')]);return _0x3a9998(_0xdaf37[_0xb941('0x16')][_0xb941('0x18')]);}logger[_0xb941('0x16')](_0xb941('0x13'),_0x43807d,_0xdaf37['error'][_0xb941('0x18')]);return _0x151826(_0xdaf37[_0xb941('0x16')]['message']);}else{logger[_0xb941('0x12')](_0xb941('0x13'),_0x43807d,_0xb941('0x14'));_0x151826(_0xdaf37['result']['message']);}})[_0xb941('0x19')](function(_0x4b3913){logger[_0xb941('0x16')](_0xb941('0x13'),_0x43807d,_0x4b3913);_0x3a9998(_0x4b3913);});});}exports['GetOpenchannelQueue']=function(_0x7908a0){var _0x597ccf=this;return new Promise(function(_0x3a4133,_0x236da5){return db[_0xb941('0x1a')][_0xb941('0x1b')]({'raw':_0x7908a0[_0xb941('0x1c')]?_0x7908a0[_0xb941('0x1c')][_0xb941('0x1d')]===undefined?!![]:![]:!![],'where':_0x7908a0[_0xb941('0x1c')]?_0x7908a0['options'][_0xb941('0x1e')]||null:null,'attributes':_0x7908a0['options']?_0x7908a0[_0xb941('0x1c')][_0xb941('0x1f')]||null:null,'limit':_0x7908a0[_0xb941('0x1c')]?_0x7908a0[_0xb941('0x1c')]['limit']||null:null,'include':_0x7908a0['options']?_0x7908a0['options']['include']?_['map'](_0x7908a0[_0xb941('0x1c')][_0xb941('0x20')],function(_0x120604){return{'model':db[_0x120604[_0xb941('0x21')]],'as':_0x120604['as'],'attributes':_0x120604['attributes'],'include':_0x120604[_0xb941('0x20')]?_[_0xb941('0x22')](_0x120604[_0xb941('0x20')],function(_0x47301f){return{'model':db[_0x47301f[_0xb941('0x21')]],'as':_0x47301f['as'],'attributes':_0x47301f['attributes'],'include':_0x47301f[_0xb941('0x20')]?_[_0xb941('0x22')](_0x47301f['include'],function(_0x5d9473){return{'model':db[_0x5d9473[_0xb941('0x21')]],'as':_0x5d9473['as'],'attributes':_0x5d9473[_0xb941('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11522e){logger[_0xb941('0x12')](_0xb941('0x23'),_0x7908a0);logger[_0xb941('0x24')](_0xb941('0x23'),_0x7908a0,JSON['stringify'](_0x11522e));_0x3a4133(_0x11522e);})[_0xb941('0x19')](function(_0x5ad7e2){logger[_0xb941('0x16')](_0xb941('0x23'),_0x5ad7e2['message'],_0x7908a0);_0x236da5(_0x597ccf[_0xb941('0x16')](0x1f4,_0x5ad7e2[_0xb941('0x18')]));});});};exports[_0xb941('0x25')]=function(_0x393137){var _0x1eff9d=this;return new Promise(function(_0x1c02e2,_0x347659){return db['OpenchannelQueue'][_0xb941('0x26')]({'raw':_0x393137[_0xb941('0x1c')]?_0x393137[_0xb941('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x393137[_0xb941('0x1c')]?_0x393137[_0xb941('0x1c')][_0xb941('0x1e')]||null:null,'attributes':_0x393137[_0xb941('0x1c')]?_0x393137[_0xb941('0x1c')]['attributes']||null:null,'include':_0x393137[_0xb941('0x1c')]?_0x393137[_0xb941('0x1c')][_0xb941('0x20')]?_[_0xb941('0x22')](_0x393137[_0xb941('0x1c')][_0xb941('0x20')],function(_0x3fb782){return{'model':db[_0x3fb782[_0xb941('0x21')]],'as':_0x3fb782['as'],'attributes':_0x3fb782[_0xb941('0x1f')],'include':_0x3fb782[_0xb941('0x20')]?_[_0xb941('0x22')](_0x3fb782[_0xb941('0x20')],function(_0x31ff7b){return{'model':db[_0x31ff7b['model']],'as':_0x31ff7b['as'],'attributes':_0x31ff7b[_0xb941('0x1f')],'include':_0x31ff7b[_0xb941('0x20')]?_['map'](_0x31ff7b[_0xb941('0x20')],function(_0x54c7cf){return{'model':db[_0x54c7cf[_0xb941('0x21')]],'as':_0x54c7cf['as'],'attributes':_0x54c7cf[_0xb941('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb941('0x11')](function(_0x57fa02){logger[_0xb941('0x12')]('ShowOpenchannelQueue',_0x393137);logger[_0xb941('0x24')](_0xb941('0x25'),_0x393137,JSON['stringify'](_0x57fa02));_0x1c02e2(_0x57fa02);})[_0xb941('0x19')](function(_0x56ee59){logger['error'](_0xb941('0x25'),_0x56ee59[_0xb941('0x18')],_0x393137);_0x347659(_0x1eff9d['error'](0x1f4,_0x56ee59['message']));});});};
\ No newline at end of file
+var _0x59a4=['attributes','limit','include','map','model','then','stringify','catch','ShowOpenchannelQueue','find','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetOpenchannelQueue','OpenchannelQueue','options','where'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x59a4,0x19b));var _0x459a=function(_0x1b88fd,_0x3fc359){_0x1b88fd=_0x1b88fd-0x0;var _0x287cd1=_0x59a4[_0x1b88fd];return _0x287cd1;};'use strict';var _=require(_0x459a('0x0'));var util=require(_0x459a('0x1'));var moment=require('moment');var BPromise=require(_0x459a('0x2'));var rs=require(_0x459a('0x3'));var fs=require('fs');var Redis=require(_0x459a('0x4'));var db=require(_0x459a('0x5'))['db'];var utils=require(_0x459a('0x6'));var logger=require(_0x459a('0x7'))('rpc');var config=require(_0x459a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x459a('0x9')]({'port':0x232a});config[_0x459a('0xa')]=_['defaults'](config[_0x459a('0xa')],{'host':_0x459a('0xb'),'port':0x18eb});var socket=require(_0x459a('0xc'))(new Redis(config[_0x459a('0xa')]));require(_0x459a('0xd'))[_0x459a('0xe')](socket);function respondWithRpcPromise(_0x25bbab,_0x5c55eb,_0x2616a2){return new BPromise(function(_0x3845e4,_0x251c86){return client[_0x459a('0xf')](_0x25bbab,_0x2616a2)['then'](function(_0x154dc1){logger[_0x459a('0x10')](_0x459a('0x11'),_0x5c55eb,_0x459a('0x12'));logger[_0x459a('0x13')](_0x459a('0x14'),_0x5c55eb,_0x459a('0x12'),JSON['stringify'](_0x154dc1));if(_0x154dc1[_0x459a('0x15')]){if(_0x154dc1[_0x459a('0x15')][_0x459a('0x16')]===0x1f4){logger[_0x459a('0x15')](_0x459a('0x11'),_0x5c55eb,_0x154dc1[_0x459a('0x15')][_0x459a('0x17')]);return _0x251c86(_0x154dc1[_0x459a('0x15')][_0x459a('0x17')]);}logger['error'](_0x459a('0x11'),_0x5c55eb,_0x154dc1[_0x459a('0x15')][_0x459a('0x17')]);return _0x3845e4(_0x154dc1[_0x459a('0x15')][_0x459a('0x17')]);}else{logger[_0x459a('0x10')](_0x459a('0x11'),_0x5c55eb,_0x459a('0x12'));_0x3845e4(_0x154dc1[_0x459a('0x18')][_0x459a('0x17')]);}})['catch'](function(_0x55a5f8){logger[_0x459a('0x15')](_0x459a('0x11'),_0x5c55eb,_0x55a5f8);_0x251c86(_0x55a5f8);});});}exports[_0x459a('0x19')]=function(_0x25e5b1){var _0x3d760f=this;return new Promise(function(_0x3ced7a,_0x2f3553){return db[_0x459a('0x1a')]['findAll']({'raw':_0x25e5b1['options']?_0x25e5b1[_0x459a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x25e5b1['options']?_0x25e5b1['options'][_0x459a('0x1c')]||null:null,'attributes':_0x25e5b1[_0x459a('0x1b')]?_0x25e5b1[_0x459a('0x1b')][_0x459a('0x1d')]||null:null,'limit':_0x25e5b1['options']?_0x25e5b1[_0x459a('0x1b')][_0x459a('0x1e')]||null:null,'include':_0x25e5b1[_0x459a('0x1b')]?_0x25e5b1[_0x459a('0x1b')][_0x459a('0x1f')]?_[_0x459a('0x20')](_0x25e5b1['options'][_0x459a('0x1f')],function(_0x5b109d){return{'model':db[_0x5b109d[_0x459a('0x21')]],'as':_0x5b109d['as'],'attributes':_0x5b109d['attributes'],'include':_0x5b109d[_0x459a('0x1f')]?_[_0x459a('0x20')](_0x5b109d[_0x459a('0x1f')],function(_0xed1e37){return{'model':db[_0xed1e37[_0x459a('0x21')]],'as':_0xed1e37['as'],'attributes':_0xed1e37[_0x459a('0x1d')],'include':_0xed1e37['include']?_['map'](_0xed1e37[_0x459a('0x1f')],function(_0x30d68e){return{'model':db[_0x30d68e[_0x459a('0x21')]],'as':_0x30d68e['as'],'attributes':_0x30d68e[_0x459a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x459a('0x22')](function(_0x19be5f){logger['info'](_0x459a('0x19'),_0x25e5b1);logger['debug']('GetOpenchannelQueue',_0x25e5b1,JSON[_0x459a('0x23')](_0x19be5f));_0x3ced7a(_0x19be5f);})[_0x459a('0x24')](function(_0x49e6c2){logger[_0x459a('0x15')](_0x459a('0x19'),_0x49e6c2[_0x459a('0x17')],_0x25e5b1);_0x2f3553(_0x3d760f['error'](0x1f4,_0x49e6c2[_0x459a('0x17')]));});});};exports[_0x459a('0x25')]=function(_0x8f9a72){var _0x368278=this;return new Promise(function(_0x4cecd6,_0x4c9fe8){return db[_0x459a('0x1a')][_0x459a('0x26')]({'raw':_0x8f9a72['options']?_0x8f9a72['options'][_0x459a('0x27')]===undefined?!![]:![]:!![],'where':_0x8f9a72[_0x459a('0x1b')]?_0x8f9a72[_0x459a('0x1b')][_0x459a('0x1c')]||null:null,'attributes':_0x8f9a72[_0x459a('0x1b')]?_0x8f9a72[_0x459a('0x1b')][_0x459a('0x1d')]||null:null,'include':_0x8f9a72['options']?_0x8f9a72['options'][_0x459a('0x1f')]?_[_0x459a('0x20')](_0x8f9a72[_0x459a('0x1b')][_0x459a('0x1f')],function(_0x55de8e){return{'model':db[_0x55de8e['model']],'as':_0x55de8e['as'],'attributes':_0x55de8e[_0x459a('0x1d')],'include':_0x55de8e[_0x459a('0x1f')]?_['map'](_0x55de8e[_0x459a('0x1f')],function(_0x22acb3){return{'model':db[_0x22acb3[_0x459a('0x21')]],'as':_0x22acb3['as'],'attributes':_0x22acb3[_0x459a('0x1d')],'include':_0x22acb3[_0x459a('0x1f')]?_[_0x459a('0x20')](_0x22acb3[_0x459a('0x1f')],function(_0x188d46){return{'model':db[_0x188d46[_0x459a('0x21')]],'as':_0x188d46['as'],'attributes':_0x188d46[_0x459a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x459a('0x22')](function(_0x126c62){logger[_0x459a('0x10')](_0x459a('0x25'),_0x8f9a72);logger[_0x459a('0x13')](_0x459a('0x25'),_0x8f9a72,JSON[_0x459a('0x23')](_0x126c62));_0x4cecd6(_0x126c62);})['catch'](function(_0x9aadf7){logger['error']('ShowOpenchannelQueue',_0x9aadf7['message'],_0x8f9a72);_0x4c9fe8(_0x368278[_0x459a('0x15')](0x1f4,_0x9aadf7[_0x459a('0x17')]));});});};
\ No newline at end of file
index 7ff4dcd..596412f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4918=['openchannelQueue:','./openchannelQueue.events','save','update'];(function(_0x4f0217,_0x29aa7e){var _0x4da152=function(_0x213af1){while(--_0x213af1){_0x4f0217['push'](_0x4f0217['shift']());}};_0x4da152(++_0x29aa7e);}(_0x4918,0x199));var _0x8491=function(_0x39ea42,_0x3c1f50){_0x39ea42=_0x39ea42-0x0;var _0x33f5b7=_0x4918[_0x39ea42];return _0x33f5b7;};'use strict';var OpenchannelQueueEvents=require(_0x8491('0x0'));var events=[_0x8491('0x1'),'remove',_0x8491('0x2')];function createListener(_0x5526ff,_0x3ee0e1){return function(_0x281edb){_0x3ee0e1['emit'](_0x5526ff,_0x281edb);};}function removeListener(_0xb65a4b,_0x128b27){return function(){OpenchannelQueueEvents['removeListener'](_0xb65a4b,_0x128b27);};}exports['register']=function(_0x4cbb1e){for(var _0x43ca2b=0x0,_0x2b26a0=events['length'];_0x43ca2b<_0x2b26a0;_0x43ca2b++){var _0xa5a103=events[_0x43ca2b];var _0x425deb=createListener(_0x8491('0x3')+_0xa5a103,_0x4cbb1e);OpenchannelQueueEvents['on'](_0xa5a103,_0x425deb);}};
\ No newline at end of file
+var _0x10a9=['removeListener','register','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit'];(function(_0x3de32a,_0x48187d){var _0x334991=function(_0x11b690){while(--_0x11b690){_0x3de32a['push'](_0x3de32a['shift']());}};_0x334991(++_0x48187d);}(_0x10a9,0x18b));var _0x910a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x10a9[_0x14add3];return _0x4a174f;};'use strict';var OpenchannelQueueEvents=require(_0x910a('0x0'));var events=[_0x910a('0x1'),_0x910a('0x2'),_0x910a('0x3')];function createListener(_0x25fe86,_0x2fe53c){return function(_0x275b3f){_0x2fe53c[_0x910a('0x4')](_0x25fe86,_0x275b3f);};}function removeListener(_0x227ebe,_0x3d17f3){return function(){OpenchannelQueueEvents[_0x910a('0x5')](_0x227ebe,_0x3d17f3);};}exports[_0x910a('0x6')]=function(_0x196391){for(var _0x3ef932=0x0,_0x4f7bdd=events['length'];_0x3ef932<_0x4f7bdd;_0x3ef932++){var _0x428c78=events[_0x3ef932];var _0x2c083e=createListener(_0x910a('0x7')+_0x428c78,_0x196391);OpenchannelQueueEvents['on'](_0x428c78,_0x2c083e);}};
\ No newline at end of file
index aa1173f..265e6af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeea5=['isAuthenticated','index','describe','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get'];(function(_0x1aaa34,_0xe266ce){var _0x29969c=function(_0x2d32a7){while(--_0x2d32a7){_0x1aaa34['push'](_0x1aaa34['shift']());}};_0x29969c(++_0xe266ce);}(_0xeea5,0xd0));var _0x5eea=function(_0x161c36,_0x26f37a){_0x161c36=_0x161c36-0x0;var _0x1d54fb=_0xeea5[_0x161c36];return _0x1d54fb;};'use strict';var multer=require(_0x5eea('0x0'));var util=require(_0x5eea('0x1'));var path=require(_0x5eea('0x2'));var timeout=require(_0x5eea('0x3'));var express=require(_0x5eea('0x4'));var router=express[_0x5eea('0x5')]();var fs_extra=require(_0x5eea('0x6'));var auth=require(_0x5eea('0x7'));var interaction=require(_0x5eea('0x8'));var config=require(_0x5eea('0x9'));var controller=require(_0x5eea('0xa'));router[_0x5eea('0xb')]('/',auth[_0x5eea('0xc')](),controller[_0x5eea('0xd')]);router[_0x5eea('0xb')]('/describe',auth[_0x5eea('0xc')](),controller[_0x5eea('0xe')]);router[_0x5eea('0xb')](_0x5eea('0xf'),auth[_0x5eea('0xc')](),controller[_0x5eea('0x10')]);router['post']('/',auth[_0x5eea('0xc')](),controller[_0x5eea('0x11')]);router['put'](_0x5eea('0xf'),auth[_0x5eea('0xc')](),controller[_0x5eea('0x12')]);router[_0x5eea('0x13')]('/:id',auth[_0x5eea('0xc')](),controller[_0x5eea('0x14')]);module[_0x5eea('0x15')]=router;
\ No newline at end of file
+var _0xb463=['./openchannelQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','put','update','destroy','multer','util','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1ce163,_0x321175){var _0x1816c1=function(_0x1fcff3){while(--_0x1fcff3){_0x1ce163['push'](_0x1ce163['shift']());}};_0x1816c1(++_0x321175);}(_0xb463,0x14b));var _0x3b46=function(_0x3e8b32,_0x4e721e){_0x3e8b32=_0x3e8b32-0x0;var _0x61ea3b=_0xb463[_0x3e8b32];return _0x61ea3b;};'use strict';var multer=require(_0x3b46('0x0'));var util=require(_0x3b46('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3b46('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3b46('0x3'));var interaction=require(_0x3b46('0x4'));var config=require('../../config/environment');var controller=require(_0x3b46('0x5'));router['get']('/',auth[_0x3b46('0x6')](),controller[_0x3b46('0x7')]);router[_0x3b46('0x8')](_0x3b46('0x9'),auth[_0x3b46('0x6')](),controller[_0x3b46('0xa')]);router[_0x3b46('0x8')](_0x3b46('0xb'),auth[_0x3b46('0x6')](),controller['show']);router[_0x3b46('0xc')]('/',auth[_0x3b46('0x6')](),controller['create']);router[_0x3b46('0xd')]('/:id',auth[_0x3b46('0x6')](),controller[_0x3b46('0xe')]);router['delete']('/:id',auth[_0x3b46('0x6')](),controller[_0x3b46('0xf')]);module['exports']=router;
\ No newline at end of file
index 9773bbb..4f11f51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x058f=['STRING','DATE','moment','sequelize'];(function(_0x19311a,_0x2d2679){var _0x42617c=function(_0x43227d){while(--_0x43227d){_0x19311a['push'](_0x19311a['shift']());}};_0x42617c(++_0x2d2679);}(_0x058f,0xc6));var _0xf058=function(_0x590f90,_0xc28e35){_0x590f90=_0x590f90-0x0;var _0x49ffe7=_0x058f[_0x590f90];return _0x49ffe7;};'use strict';var moment=require(_0xf058('0x0'));var Sequelize=require(_0xf058('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xf058('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf058('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf058('0x3')]},'acceptAt':{'type':Sequelize[_0xf058('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf058('0x2')]}};
\ No newline at end of file
+var _0xea09=['exports','DATE'];(function(_0x298925,_0x1dad24){var _0x55bab9=function(_0x527d05){while(--_0x527d05){_0x298925['push'](_0x298925['shift']());}};_0x55bab9(++_0x1dad24);}(_0xea09,0xd0));var _0x9ea0=function(_0x4bc17f,_0x39e897){_0x4bc17f=_0x4bc17f-0x0;var _0x52e53f=_0xea09[_0x4bc17f];return _0x52e53f;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x9ea0('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9ea0('0x1')]},'acceptAt':{'type':Sequelize[_0x9ea0('0x1')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 6ddd5cc..d3d3974 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7442=['undefined','count','Content-Range','apply','save','update','then','destroy','error','stack','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','options','rows','catch','show','params','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit'];(function(_0x373cf8,_0x207e5){var _0x1f0ccf=function(_0x33a5b8){while(--_0x33a5b8){_0x373cf8['push'](_0x373cf8['shift']());}};_0x1f0ccf(++_0x207e5);}(_0x7442,0x152));var _0x2744=function(_0x2b7ef5,_0x1dad9c){_0x2b7ef5=_0x2b7ef5-0x0;var _0x1fac58=_0x7442[_0x2b7ef5];return _0x1fac58;};'use strict';var emlformat=require(_0x2744('0x0'));var rimraf=require(_0x2744('0x1'));var zipdir=require(_0x2744('0x2'));var jsonpatch=require(_0x2744('0x3'));var rp=require('request-promise');var moment=require(_0x2744('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2744('0x5'));var util=require('util');var path=require(_0x2744('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2744('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2744('0x8'));var squel=require('squel');var crypto=require(_0x2744('0x9'));var jsforce=require(_0x2744('0xa'));var deskjs=require(_0x2744('0xb'));var toCsv=require(_0x2744('0xc'));var querystring=require(_0x2744('0xd'));var Papa=require('papaparse');var Redis=require(_0x2744('0xe'));var authService=require(_0x2744('0xf'));var qs=require(_0x2744('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2744('0x11'))(_0x2744('0x12'));var utils=require('../../config/utils');var config=require(_0x2744('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2744('0x14'))['db'];function respondWithStatusCode(_0xac9de5,_0x4139e5){_0x4139e5=_0x4139e5||0xcc;return function(_0x5480a3){if(_0x5480a3){return _0xac9de5[_0x2744('0x15')](_0x4139e5);}return _0xac9de5[_0x2744('0x16')](_0x4139e5)[_0x2744('0x17')]();};}function respondWithResult(_0x3e3d47,_0x55c16c){_0x55c16c=_0x55c16c||0xc8;return function(_0x31a33b){if(_0x31a33b){return _0x3e3d47[_0x2744('0x16')](_0x55c16c)[_0x2744('0x18')](_0x31a33b);}};}function respondWithFilteredResult(_0xeb9b1f,_0x25398b){return function(_0x1165d3){if(_0x1165d3){var _0x34a86c=typeof _0x25398b[_0x2744('0x19')]==='undefined'&&typeof _0x25398b[_0x2744('0x1a')]===_0x2744('0x1b');var _0x3c4330=_0x1165d3['count'];var _0x1a7e7b=_0x34a86c?0x0:_0x25398b[_0x2744('0x19')];var _0x5da738=_0x34a86c?_0x1165d3[_0x2744('0x1c')]:_0x25398b[_0x2744('0x19')]+_0x25398b['limit'];var _0x7113;if(_0x5da738>=_0x3c4330){_0x5da738=_0x3c4330;_0x7113=0xc8;}else{_0x7113=0xce;}_0xeb9b1f['status'](_0x7113);return _0xeb9b1f['set'](_0x2744('0x1d'),_0x1a7e7b+'-'+_0x5da738+'/'+_0x3c4330)['json'](_0x1165d3);}return null;};}function patchUpdates(_0x5a689c){return function(_0x1f2f36){try{jsonpatch[_0x2744('0x1e')](_0x1f2f36,_0x5a689c,!![]);}catch(_0xa1ed8b){return BPromise['reject'](_0xa1ed8b);}return _0x1f2f36[_0x2744('0x1f')]();};}function saveUpdates(_0x2d978b,_0x2706fa){return function(_0xe275b9){if(_0xe275b9){return _0xe275b9[_0x2744('0x20')](_0x2d978b)[_0x2744('0x21')](function(_0x5e4874){return _0x5e4874;});}return null;};}function removeEntity(_0x359f88,_0x18386b){return function(_0x226c14){if(_0x226c14){return _0x226c14[_0x2744('0x22')]()[_0x2744('0x21')](function(){_0x359f88[_0x2744('0x16')](0xcc)[_0x2744('0x17')]();});}};}function handleEntityNotFound(_0x503d23,_0x588559){return function(_0x4b99d2){if(!_0x4b99d2){_0x503d23[_0x2744('0x15')](0x194);}return _0x4b99d2;};}function handleError(_0x93bdf9,_0x372567){_0x372567=_0x372567||0x1f4;return function(_0x7bcb5f){logger[_0x2744('0x23')](_0x7bcb5f[_0x2744('0x24')]);if(_0x7bcb5f['name']){delete _0x7bcb5f['name'];}_0x93bdf9[_0x2744('0x16')](_0x372567)[_0x2744('0x25')](_0x7bcb5f);};}exports[_0x2744('0x26')]=function(_0x37236f,_0x18a6bd){var _0x37131d={},_0x5f3cae={},_0x3d0d6a={'count':0x0,'rows':[]};var _0x4938ce=_[_0x2744('0x27')](db[_0x2744('0x28')][_0x2744('0x29')],function(_0x561e91){return{'name':_0x561e91[_0x2744('0x2a')],'type':_0x561e91['type'][_0x2744('0x2b')]};});_0x5f3cae[_0x2744('0x2c')]=_[_0x2744('0x27')](_0x4938ce,_0x2744('0x2d'));_0x5f3cae[_0x2744('0x2e')]=_[_0x2744('0x2f')](_0x37236f[_0x2744('0x2e')]);_0x5f3cae['filters']=_[_0x2744('0x30')](_0x5f3cae[_0x2744('0x2c')],_0x5f3cae[_0x2744('0x2e')]);_0x37131d[_0x2744('0x31')]=_['intersection'](_0x5f3cae['model'],qs['fields'](_0x37236f['query'][_0x2744('0x32')]));_0x37131d[_0x2744('0x31')]=_0x37131d[_0x2744('0x31')][_0x2744('0x33')]?_0x37131d[_0x2744('0x31')]:_0x5f3cae[_0x2744('0x2c')];if(!_0x37236f[_0x2744('0x2e')][_0x2744('0x34')](_0x2744('0x35'))){_0x37131d[_0x2744('0x1a')]=qs[_0x2744('0x1a')](_0x37236f[_0x2744('0x2e')][_0x2744('0x1a')]);_0x37131d['offset']=qs[_0x2744('0x19')](_0x37236f['query']['offset']);}_0x37131d[_0x2744('0x36')]=qs[_0x2744('0x37')](_0x37236f[_0x2744('0x2e')]['sort']);_0x37131d[_0x2744('0x38')]=qs[_0x2744('0x39')](_[_0x2744('0x3a')](_0x37236f[_0x2744('0x2e')],_0x5f3cae[_0x2744('0x39')]),_0x4938ce);if(_0x37236f['query']['filter']){_0x37131d['where']=_[_0x2744('0x3b')](_0x37131d['where'],{'$or':_[_0x2744('0x27')](_0x4938ce,function(_0x55c3bb){if(_0x55c3bb[_0x2744('0x3c')]!==_0x2744('0x3d')){var _0x30cca6={};_0x30cca6[_0x55c3bb[_0x2744('0x2d')]]={'$like':'%'+_0x37236f[_0x2744('0x2e')]['filter']+'%'};return _0x30cca6;}})});}_0x37131d=_[_0x2744('0x3b')]({},_0x37131d,_0x37236f[_0x2744('0x3e')]);var _0x112418={'where':_0x37131d[_0x2744('0x38')]};return db[_0x2744('0x28')][_0x2744('0x1c')](_0x112418)['then'](function(_0x276796){_0x3d0d6a[_0x2744('0x1c')]=_0x276796;if(_0x37236f[_0x2744('0x2e')]['includeAll']){_0x37131d['include']=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x37131d);})[_0x2744('0x21')](function(_0x1af420){_0x3d0d6a[_0x2744('0x3f')]=_0x1af420;return _0x3d0d6a;})[_0x2744('0x21')](respondWithFilteredResult(_0x18a6bd,_0x37131d))[_0x2744('0x40')](handleError(_0x18a6bd,null));};exports[_0x2744('0x41')]=function(_0x2c1c8b,_0xc4b817){var _0xb2e5f8={'raw':!![],'where':{'id':_0x2c1c8b[_0x2744('0x42')]['id']}},_0x3d407a={};_0x3d407a[_0x2744('0x2c')]=_[_0x2744('0x2f')](db['OpenchannelQueueReport'][_0x2744('0x29')]);_0x3d407a[_0x2744('0x2e')]=_[_0x2744('0x2f')](_0x2c1c8b['query']);_0x3d407a['filters']=_[_0x2744('0x30')](_0x3d407a[_0x2744('0x2c')],_0x3d407a[_0x2744('0x2e')]);_0xb2e5f8['attributes']=_[_0x2744('0x30')](_0x3d407a[_0x2744('0x2c')],qs[_0x2744('0x32')](_0x2c1c8b[_0x2744('0x2e')][_0x2744('0x32')]));_0xb2e5f8[_0x2744('0x31')]=_0xb2e5f8[_0x2744('0x31')][_0x2744('0x33')]?_0xb2e5f8[_0x2744('0x31')]:_0x3d407a[_0x2744('0x2c')];if(_0x2c1c8b[_0x2744('0x2e')][_0x2744('0x43')]){_0xb2e5f8[_0x2744('0x44')]=[{'all':!![]}];}_0xb2e5f8=_[_0x2744('0x3b')]({},_0xb2e5f8,_0x2c1c8b['options']);return db[_0x2744('0x28')][_0x2744('0x45')](_0xb2e5f8)[_0x2744('0x21')](handleEntityNotFound(_0xc4b817,null))[_0x2744('0x21')](respondWithResult(_0xc4b817,null))[_0x2744('0x40')](handleError(_0xc4b817,null));};exports[_0x2744('0x46')]=function(_0x50c44c,_0x203991){return db[_0x2744('0x28')][_0x2744('0x46')](_0x50c44c[_0x2744('0x47')],{})[_0x2744('0x21')](respondWithResult(_0x203991,0xc9))[_0x2744('0x40')](handleError(_0x203991,null));};exports[_0x2744('0x20')]=function(_0x203d30,_0x56aebd){if(_0x203d30[_0x2744('0x47')]['id']){delete _0x203d30[_0x2744('0x47')]['id'];}return db[_0x2744('0x28')][_0x2744('0x45')]({'where':{'id':_0x203d30['params']['id']}})[_0x2744('0x21')](handleEntityNotFound(_0x56aebd,null))[_0x2744('0x21')](saveUpdates(_0x203d30['body'],null))[_0x2744('0x21')](respondWithResult(_0x56aebd,null))[_0x2744('0x40')](handleError(_0x56aebd,null));};exports['destroy']=function(_0x126a74,_0x444ea2){return db[_0x2744('0x28')][_0x2744('0x45')]({'where':{'id':_0x126a74['params']['id']}})[_0x2744('0x21')](handleEntityNotFound(_0x444ea2,null))['then'](removeEntity(_0x444ea2,null))[_0x2744('0x40')](handleError(_0x444ea2,null));};exports[_0x2744('0x48')]=function(_0x2fb1fd,_0xb59644){return db[_0x2744('0x28')][_0x2744('0x48')]()[_0x2744('0x21')](respondWithResult(_0xb59644,null))[_0x2744('0x40')](handleError(_0xb59644,null));};
\ No newline at end of file
+var _0x329c=['find','create','body','destroy','describe','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','options'];(function(_0x2c4440,_0x4fe366){var _0x20f1dd=function(_0x7495a5){while(--_0x7495a5){_0x2c4440['push'](_0x2c4440['shift']());}};_0x20f1dd(++_0x4fe366);}(_0x329c,0x93));var _0xc329=function(_0x40ddc0,_0x41c082){_0x40ddc0=_0x40ddc0-0x0;var _0x1aebf1=_0x329c[_0x40ddc0];return _0x1aebf1;};'use strict';var emlformat=require(_0xc329('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc329('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc329('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc329('0x3'));var util=require(_0xc329('0x4'));var path=require(_0xc329('0x5'));var sox=require(_0xc329('0x6'));var csv=require(_0xc329('0x7'));var ejs=require(_0xc329('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc329('0x9'));var crypto=require(_0xc329('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc329('0x7'));var querystring=require('querystring');var Papa=require(_0xc329('0xb'));var Redis=require('ioredis');var authService=require(_0xc329('0xc'));var qs=require(_0xc329('0xd'));var as=require(_0xc329('0xe'));var hardwareService=require(_0xc329('0xf'));var logger=require(_0xc329('0x10'))('api');var utils=require(_0xc329('0x11'));var config=require(_0xc329('0x12'));var licenseUtil=require(_0xc329('0x13'));var db=require(_0xc329('0x14'))['db'];function respondWithStatusCode(_0x121dc8,_0x64e6ba){_0x64e6ba=_0x64e6ba||0xcc;return function(_0x4a149d){if(_0x4a149d){return _0x121dc8[_0xc329('0x15')](_0x64e6ba);}return _0x121dc8[_0xc329('0x16')](_0x64e6ba)[_0xc329('0x17')]();};}function respondWithResult(_0x43ae5d,_0x536ca3){_0x536ca3=_0x536ca3||0xc8;return function(_0x3ed60a){if(_0x3ed60a){return _0x43ae5d[_0xc329('0x16')](_0x536ca3)[_0xc329('0x18')](_0x3ed60a);}};}function respondWithFilteredResult(_0x3f91d6,_0x4b4dcc){return function(_0x4e208e){if(_0x4e208e){var _0x333bb8=typeof _0x4b4dcc[_0xc329('0x19')]===_0xc329('0x1a')&&typeof _0x4b4dcc[_0xc329('0x1b')]===_0xc329('0x1a');var _0x22e5be=_0x4e208e[_0xc329('0x1c')];var _0x3dd60d=_0x333bb8?0x0:_0x4b4dcc[_0xc329('0x19')];var _0x1d9f8e=_0x333bb8?_0x4e208e[_0xc329('0x1c')]:_0x4b4dcc[_0xc329('0x19')]+_0x4b4dcc['limit'];var _0x26b4a6;if(_0x1d9f8e>=_0x22e5be){_0x1d9f8e=_0x22e5be;_0x26b4a6=0xc8;}else{_0x26b4a6=0xce;}_0x3f91d6[_0xc329('0x16')](_0x26b4a6);return _0x3f91d6[_0xc329('0x1d')]('Content-Range',_0x3dd60d+'-'+_0x1d9f8e+'/'+_0x22e5be)[_0xc329('0x18')](_0x4e208e);}return null;};}function patchUpdates(_0x28596e){return function(_0x101982){try{jsonpatch[_0xc329('0x1e')](_0x101982,_0x28596e,!![]);}catch(_0x529e48){return BPromise['reject'](_0x529e48);}return _0x101982[_0xc329('0x1f')]();};}function saveUpdates(_0x5bf332,_0x54fe1e){return function(_0x3e4363){if(_0x3e4363){return _0x3e4363[_0xc329('0x20')](_0x5bf332)[_0xc329('0x21')](function(_0x4d27ff){return _0x4d27ff;});}return null;};}function removeEntity(_0x1b5de2,_0x108221){return function(_0x575e9a){if(_0x575e9a){return _0x575e9a['destroy']()[_0xc329('0x21')](function(){_0x1b5de2[_0xc329('0x16')](0xcc)[_0xc329('0x17')]();});}};}function handleEntityNotFound(_0x78e20f,_0x53cc29){return function(_0x4ddb77){if(!_0x4ddb77){_0x78e20f[_0xc329('0x15')](0x194);}return _0x4ddb77;};}function handleError(_0x1a8e19,_0x22dd8f){_0x22dd8f=_0x22dd8f||0x1f4;return function(_0x112ac1){logger[_0xc329('0x22')](_0x112ac1[_0xc329('0x23')]);if(_0x112ac1[_0xc329('0x24')]){delete _0x112ac1[_0xc329('0x24')];}_0x1a8e19[_0xc329('0x16')](_0x22dd8f)['send'](_0x112ac1);};}exports[_0xc329('0x25')]=function(_0x38ce25,_0x37fc75){var _0xb0c105={},_0x3463db={},_0x5cbf45={'count':0x0,'rows':[]};var _0x5a690a=_[_0xc329('0x26')](db[_0xc329('0x27')][_0xc329('0x28')],function(_0x1cafeb){return{'name':_0x1cafeb[_0xc329('0x29')],'type':_0x1cafeb[_0xc329('0x2a')][_0xc329('0x2b')]};});_0x3463db[_0xc329('0x2c')]=_['map'](_0x5a690a,_0xc329('0x24'));_0x3463db[_0xc329('0x2d')]=_[_0xc329('0x2e')](_0x38ce25[_0xc329('0x2d')]);_0x3463db[_0xc329('0x2f')]=_[_0xc329('0x30')](_0x3463db['model'],_0x3463db[_0xc329('0x2d')]);_0xb0c105[_0xc329('0x31')]=_[_0xc329('0x30')](_0x3463db[_0xc329('0x2c')],qs[_0xc329('0x32')](_0x38ce25[_0xc329('0x2d')][_0xc329('0x32')]));_0xb0c105['attributes']=_0xb0c105['attributes']['length']?_0xb0c105[_0xc329('0x31')]:_0x3463db[_0xc329('0x2c')];if(!_0x38ce25[_0xc329('0x2d')][_0xc329('0x33')]('nolimit')){_0xb0c105['limit']=qs[_0xc329('0x1b')](_0x38ce25[_0xc329('0x2d')][_0xc329('0x1b')]);_0xb0c105[_0xc329('0x19')]=qs[_0xc329('0x19')](_0x38ce25[_0xc329('0x2d')][_0xc329('0x19')]);}_0xb0c105['order']=qs[_0xc329('0x34')](_0x38ce25[_0xc329('0x2d')]['sort']);_0xb0c105[_0xc329('0x35')]=qs['filters'](_[_0xc329('0x36')](_0x38ce25[_0xc329('0x2d')],_0x3463db[_0xc329('0x2f')]),_0x5a690a);if(_0x38ce25[_0xc329('0x2d')][_0xc329('0x37')]){_0xb0c105[_0xc329('0x35')]=_['merge'](_0xb0c105[_0xc329('0x35')],{'$or':_['map'](_0x5a690a,function(_0x572210){if(_0x572210['type']!=='VIRTUAL'){var _0xc6a741={};_0xc6a741[_0x572210[_0xc329('0x24')]]={'$like':'%'+_0x38ce25[_0xc329('0x2d')]['filter']+'%'};return _0xc6a741;}})});}_0xb0c105=_[_0xc329('0x38')]({},_0xb0c105,_0x38ce25['options']);var _0x86a180={'where':_0xb0c105[_0xc329('0x35')]};return db[_0xc329('0x27')][_0xc329('0x1c')](_0x86a180)[_0xc329('0x21')](function(_0x56fb01){_0x5cbf45[_0xc329('0x1c')]=_0x56fb01;if(_0x38ce25[_0xc329('0x2d')][_0xc329('0x39')]){_0xb0c105[_0xc329('0x3a')]=[{'all':!![]}];}return db[_0xc329('0x27')][_0xc329('0x3b')](_0xb0c105);})['then'](function(_0x3d8c3e){_0x5cbf45[_0xc329('0x3c')]=_0x3d8c3e;return _0x5cbf45;})[_0xc329('0x21')](respondWithFilteredResult(_0x37fc75,_0xb0c105))[_0xc329('0x3d')](handleError(_0x37fc75,null));};exports[_0xc329('0x3e')]=function(_0x592817,_0x1f531c){var _0x5c9222={'raw':!![],'where':{'id':_0x592817[_0xc329('0x3f')]['id']}},_0x2332a0={};_0x2332a0[_0xc329('0x2c')]=_[_0xc329('0x2e')](db[_0xc329('0x27')][_0xc329('0x28')]);_0x2332a0[_0xc329('0x2d')]=_[_0xc329('0x2e')](_0x592817['query']);_0x2332a0[_0xc329('0x2f')]=_[_0xc329('0x30')](_0x2332a0[_0xc329('0x2c')],_0x2332a0[_0xc329('0x2d')]);_0x5c9222[_0xc329('0x31')]=_['intersection'](_0x2332a0['model'],qs[_0xc329('0x32')](_0x592817[_0xc329('0x2d')]['fields']));_0x5c9222[_0xc329('0x31')]=_0x5c9222[_0xc329('0x31')][_0xc329('0x40')]?_0x5c9222[_0xc329('0x31')]:_0x2332a0[_0xc329('0x2c')];if(_0x592817[_0xc329('0x2d')][_0xc329('0x39')]){_0x5c9222['include']=[{'all':!![]}];}_0x5c9222=_['merge']({},_0x5c9222,_0x592817[_0xc329('0x41')]);return db[_0xc329('0x27')][_0xc329('0x42')](_0x5c9222)[_0xc329('0x21')](handleEntityNotFound(_0x1f531c,null))[_0xc329('0x21')](respondWithResult(_0x1f531c,null))[_0xc329('0x3d')](handleError(_0x1f531c,null));};exports[_0xc329('0x43')]=function(_0x2fbb3e,_0x52a79d){return db[_0xc329('0x27')][_0xc329('0x43')](_0x2fbb3e[_0xc329('0x44')],{})[_0xc329('0x21')](respondWithResult(_0x52a79d,0xc9))[_0xc329('0x3d')](handleError(_0x52a79d,null));};exports[_0xc329('0x20')]=function(_0x463634,_0x4182dc){if(_0x463634[_0xc329('0x44')]['id']){delete _0x463634[_0xc329('0x44')]['id'];}return db['OpenchannelQueueReport'][_0xc329('0x42')]({'where':{'id':_0x463634[_0xc329('0x3f')]['id']}})[_0xc329('0x21')](handleEntityNotFound(_0x4182dc,null))[_0xc329('0x21')](saveUpdates(_0x463634[_0xc329('0x44')],null))[_0xc329('0x21')](respondWithResult(_0x4182dc,null))['catch'](handleError(_0x4182dc,null));};exports[_0xc329('0x45')]=function(_0x4210c5,_0x1f6d70){return db[_0xc329('0x27')][_0xc329('0x42')]({'where':{'id':_0x4210c5['params']['id']}})[_0xc329('0x21')](handleEntityNotFound(_0x1f6d70,null))[_0xc329('0x21')](removeEntity(_0x1f6d70,null))[_0xc329('0x3d')](handleError(_0x1f6d70,null));};exports[_0xc329('0x46')]=function(_0x2c54d2,_0x4ace5f){return db[_0xc329('0x27')][_0xc329('0x46')]()[_0xc329('0x21')](respondWithResult(_0x4ace5f,null))['catch'](handleError(_0x4ace5f,null));};
\ No newline at end of file
index 00e4b46..6d750f1 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(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x814b,0x1a2));var _0xb814=function(_0x3804da,_0x4b1678){_0x3804da=_0x3804da-0x0;var _0x1038e3=_0x814b[_0x3804da];return _0x1038e3;};'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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x465506,_0x17ddf4){var _0x140114=function(_0x4e567d){while(--_0x4e567d){_0x465506['push'](_0x465506['shift']());}};_0x140114(++_0x17ddf4);}(_0x5fc3,0xa8));var _0x35fc=function(_0x35bd6c,_0x585087){_0x35bd6c=_0x35bd6c-0x0;var _0x2f421d=_0x5fc3[_0x35bd6c];return _0x2f421d;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 3baa534..696bc2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4a2=['CreateOpenchannelQueueReport','create','body','options','raw','stringify','catch','UpdateOpenchannelQueueReport','OpenchannelQueueReport','where','attributes','lodash','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x8cb31b,_0x509016){var _0x2ce32e=function(_0x1e6f4a){while(--_0x1e6f4a){_0x8cb31b['push'](_0x8cb31b['shift']());}};_0x2ce32e(++_0x509016);}(_0xd4a2,0x173));var _0x2d4a=function(_0x3924dc,_0x3e5fe7){_0x3924dc=_0x3924dc-0x0;var _0x457e06=_0xd4a2[_0x3924dc];return _0x457e06;};'use strict';var _=require(_0x2d4a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2d4a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d4a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d4a('0x3'));var logger=require('../../config/logger')(_0x2d4a('0x4'));var config=require(_0x2d4a('0x5'));var jayson=require(_0x2d4a('0x6'));var client=jayson[_0x2d4a('0x7')][_0x2d4a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57058f,_0x45fefb,_0x41b161){return new BPromise(function(_0x1f237e,_0x29597e){return client[_0x2d4a('0x9')](_0x57058f,_0x41b161)[_0x2d4a('0xa')](function(_0xb9f016){logger[_0x2d4a('0xb')](_0x2d4a('0xc'),_0x45fefb,_0x2d4a('0xd'));logger[_0x2d4a('0xe')](_0x2d4a('0xf'),_0x45fefb,'request\x20sent',JSON['stringify'](_0xb9f016));if(_0xb9f016[_0x2d4a('0x10')]){if(_0xb9f016['error'][_0x2d4a('0x11')]===0x1f4){logger[_0x2d4a('0x10')](_0x2d4a('0xc'),_0x45fefb,_0xb9f016[_0x2d4a('0x10')][_0x2d4a('0x12')]);return _0x29597e(_0xb9f016[_0x2d4a('0x10')][_0x2d4a('0x12')]);}logger[_0x2d4a('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x45fefb,_0xb9f016['error'][_0x2d4a('0x12')]);return _0x1f237e(_0xb9f016['error'][_0x2d4a('0x12')]);}else{logger[_0x2d4a('0xb')](_0x2d4a('0xc'),_0x45fefb,_0x2d4a('0xd'));_0x1f237e(_0xb9f016['result'][_0x2d4a('0x12')]);}})['catch'](function(_0x2838fa){logger['error'](_0x2d4a('0xc'),_0x45fefb,_0x2838fa);_0x29597e(_0x2838fa);});});}exports[_0x2d4a('0x13')]=function(_0x2188b2){var _0x388371=this;return new Promise(function(_0x498956,_0x4fd169){return db['OpenchannelQueueReport'][_0x2d4a('0x14')](_0x2188b2[_0x2d4a('0x15')],{'raw':_0x2188b2[_0x2d4a('0x16')]?_0x2188b2[_0x2d4a('0x16')][_0x2d4a('0x17')]===undefined?!![]:![]:!![]})[_0x2d4a('0xa')](function(_0x56445a){logger['info'](_0x2d4a('0x13'),_0x2188b2);logger[_0x2d4a('0xe')](_0x2d4a('0x13'),_0x2188b2,JSON[_0x2d4a('0x18')](_0x56445a));_0x498956(_0x56445a);})[_0x2d4a('0x19')](function(_0x2e7736){logger[_0x2d4a('0x10')](_0x2d4a('0x13'),_0x2e7736['message'],_0x2188b2);_0x4fd169(_0x388371[_0x2d4a('0x10')](0x1f4,_0x2e7736[_0x2d4a('0x12')]));});});};exports[_0x2d4a('0x1a')]=function(_0x42d813){var _0x2c845c=this;return new Promise(function(_0xed2822,_0x456d38){return db[_0x2d4a('0x1b')]['update'](_0x42d813['body'],{'raw':_0x42d813['options']?_0x42d813[_0x2d4a('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42d813[_0x2d4a('0x16')]?_0x42d813[_0x2d4a('0x16')][_0x2d4a('0x1c')]||null:null,'attributes':_0x42d813[_0x2d4a('0x16')]?_0x42d813[_0x2d4a('0x16')][_0x2d4a('0x1d')]||null:null,'limit':_0x42d813[_0x2d4a('0x16')]?_0x42d813[_0x2d4a('0x16')]['limit']||null:null})[_0x2d4a('0xa')](function(_0x5ce262){logger[_0x2d4a('0xb')](_0x2d4a('0x1a'),_0x42d813);logger[_0x2d4a('0xe')](_0x2d4a('0x1a'),_0x42d813,JSON[_0x2d4a('0x18')](_0x5ce262));_0xed2822(_0x5ce262);})[_0x2d4a('0x19')](function(_0x25ac5c){logger[_0x2d4a('0x10')]('UpdateOpenchannelQueueReport',_0x25ac5c[_0x2d4a('0x12')],_0x42d813);_0x456d38(_0x2c845c[_0x2d4a('0x10')](0x1f4,_0x25ac5c[_0x2d4a('0x12')]));});});};
\ No newline at end of file
+var _0x47c5=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3024e5,_0x1f9f1b){var _0x76858=function(_0x28931f){while(--_0x28931f){_0x3024e5['push'](_0x3024e5['shift']());}};_0x76858(++_0x1f9f1b);}(_0x47c5,0x165));var _0x547c=function(_0x2238f5,_0x3e0089){_0x2238f5=_0x2238f5-0x0;var _0x225e8b=_0x47c5[_0x2238f5];return _0x225e8b;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x439f25,_0x381f2e,_0x10a334){return new BPromise(function(_0x12fb7d,_0x4ef079){return client[_0x547c('0xb')](_0x439f25,_0x10a334)[_0x547c('0xc')](function(_0x10dec9){logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));logger[_0x547c('0x10')](_0x547c('0x11'),_0x381f2e,_0x547c('0xf'),JSON[_0x547c('0x12')](_0x10dec9));if(_0x10dec9[_0x547c('0x13')]){if(_0x10dec9['error'][_0x547c('0x14')]===0x1f4){logger[_0x547c('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x4ef079(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}logger[_0x547c('0x13')](_0x547c('0xe'),_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x12fb7d(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}else{logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));_0x12fb7d(_0x10dec9[_0x547c('0x16')][_0x547c('0x15')]);}})[_0x547c('0x17')](function(_0x39498d){logger[_0x547c('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x381f2e,_0x39498d);_0x4ef079(_0x39498d);});});}exports['CreateOpenchannelQueueReport']=function(_0x23fa9e){var _0x199e4f=this;return new Promise(function(_0xeb059e,_0x4a8901){return db[_0x547c('0x18')][_0x547c('0x19')](_0x23fa9e[_0x547c('0x1a')],{'raw':_0x23fa9e['options']?_0x23fa9e[_0x547c('0x1b')][_0x547c('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x5453f9){logger[_0x547c('0xd')](_0x547c('0x1d'),_0x23fa9e);logger['debug'](_0x547c('0x1d'),_0x23fa9e,JSON[_0x547c('0x12')](_0x5453f9));_0xeb059e(_0x5453f9);})['catch'](function(_0x2e317a){logger[_0x547c('0x13')](_0x547c('0x1d'),_0x2e317a['message'],_0x23fa9e);_0x4a8901(_0x199e4f[_0x547c('0x13')](0x1f4,_0x2e317a[_0x547c('0x15')]));});});};exports[_0x547c('0x1e')]=function(_0x26823c){var _0x1f3581=this;return new Promise(function(_0x2663bc,_0x2ab2cc){return db[_0x547c('0x18')]['update'](_0x26823c[_0x547c('0x1a')],{'raw':_0x26823c['options']?_0x26823c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26823c['options']?_0x26823c[_0x547c('0x1b')]['where']||null:null,'attributes':_0x26823c[_0x547c('0x1b')]?_0x26823c['options'][_0x547c('0x1f')]||null:null,'limit':_0x26823c['options']?_0x26823c[_0x547c('0x1b')][_0x547c('0x20')]||null:null})[_0x547c('0xc')](function(_0x30a96c){logger[_0x547c('0xd')]('UpdateOpenchannelQueueReport',_0x26823c);logger['debug'](_0x547c('0x1e'),_0x26823c,JSON['stringify'](_0x30a96c));_0x2663bc(_0x30a96c);})[_0x547c('0x17')](function(_0xed2d39){logger[_0x547c('0x13')](_0x547c('0x1e'),_0xed2d39[_0x547c('0x15')],_0x26823c);_0x2ab2cc(_0x1f3581[_0x547c('0x13')](0x1f4,_0xed2d39[_0x547c('0x15')]));});});};
\ No newline at end of file
index 7c0f6b9..619968b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78b6=['delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update'];(function(_0x58e8eb,_0x2ac0c7){var _0x168540=function(_0x47ad20){while(--_0x47ad20){_0x58e8eb['push'](_0x58e8eb['shift']());}};_0x168540(++_0x2ac0c7);}(_0x78b6,0x105));var _0x678b=function(_0x27e2c8,_0x5f40a0){_0x27e2c8=_0x27e2c8-0x0;var _0x5454d4=_0x78b6[_0x27e2c8];return _0x5454d4;};'use strict';var multer=require('multer');var util=require(_0x678b('0x0'));var path=require(_0x678b('0x1'));var timeout=require(_0x678b('0x2'));var express=require(_0x678b('0x3'));var router=express[_0x678b('0x4')]();var fs_extra=require(_0x678b('0x5'));var auth=require(_0x678b('0x6'));var interaction=require(_0x678b('0x7'));var config=require(_0x678b('0x8'));var controller=require(_0x678b('0x9'));router[_0x678b('0xa')]('/',auth[_0x678b('0xb')](),controller[_0x678b('0xc')]);router[_0x678b('0xa')](_0x678b('0xd'),auth[_0x678b('0xb')](),controller['describe']);router[_0x678b('0xa')](_0x678b('0xe'),auth[_0x678b('0xb')](),controller['show']);router[_0x678b('0xf')]('/',auth[_0x678b('0xb')](),controller[_0x678b('0x10')]);router[_0x678b('0x11')](_0x678b('0xe'),auth[_0x678b('0xb')](),controller[_0x678b('0x12')]);router[_0x678b('0x13')](_0x678b('0xe'),auth[_0x678b('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x86ba=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','put','delete','multer','path','connect-timeout'];(function(_0x122d9f,_0x2c9e5b){var _0x41a09e=function(_0x3d9564){while(--_0x3d9564){_0x122d9f['push'](_0x122d9f['shift']());}};_0x41a09e(++_0x2c9e5b);}(_0x86ba,0x74));var _0xa86b=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x86ba[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0xa86b('0x0'));var util=require('util');var path=require(_0xa86b('0x1'));var timeout=require(_0xa86b('0x2'));var express=require('express');var router=express[_0xa86b('0x3')]();var fs_extra=require(_0xa86b('0x4'));var auth=require(_0xa86b('0x5'));var interaction=require(_0xa86b('0x6'));var config=require(_0xa86b('0x7'));var controller=require(_0xa86b('0x8'));router[_0xa86b('0x9')]('/',auth[_0xa86b('0xa')](),controller[_0xa86b('0xb')]);router['get'](_0xa86b('0xc'),auth[_0xa86b('0xa')](),controller['describe']);router[_0xa86b('0x9')](_0xa86b('0xd'),auth[_0xa86b('0xa')](),controller[_0xa86b('0xe')]);router['post']('/',auth[_0xa86b('0xa')](),controller['create']);router[_0xa86b('0xf')](_0xa86b('0xd'),auth[_0xa86b('0xa')](),controller['update']);router[_0xa86b('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index bf6ed42..d0886ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x358bb5,_0xabcb2e){var _0x11e131=function(_0x33412c){while(--_0x33412c){_0x358bb5['push'](_0x358bb5['shift']());}};_0x11e131(++_0xabcb2e);}(_0xaa88,0x137));var _0x8aa8=function(_0xea343d,_0x311197){_0xea343d=_0xea343d-0x0;var _0x2c6e9c=_0xaa88[_0xea343d];return _0x2c6e9c;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x3a111c,_0x516c64){var _0x499a2e=function(_0x49f921){while(--_0x49f921){_0x3a111c['push'](_0x3a111c['shift']());}};_0x499a2e(++_0x516c64);}(_0xedd9,0xfc));var _0x9edd=function(_0x152616,_0xaed170){_0x152616=_0x152616-0x0;var _0x175655=_0xedd9[_0x152616];return _0x175655;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
index 296aff0..4bf044a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a78=['pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','index','map','OpenchannelTransferReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x37cc52,_0x459a9b){var _0x2b4a90=function(_0xabcfc7){while(--_0xabcfc7){_0x37cc52['push'](_0x37cc52['shift']());}};_0x2b4a90(++_0x459a9b);}(_0x9a78,0x145));var _0x89a7=function(_0x2bd327,_0xdb8828){_0x2bd327=_0x2bd327-0x0;var _0x4bb5f0=_0x9a78[_0x2bd327];return _0x4bb5f0;};'use strict';var emlformat=require(_0x89a7('0x0'));var rimraf=require(_0x89a7('0x1'));var zipdir=require(_0x89a7('0x2'));var jsonpatch=require(_0x89a7('0x3'));var rp=require(_0x89a7('0x4'));var moment=require(_0x89a7('0x5'));var BPromise=require(_0x89a7('0x6'));var Mustache=require(_0x89a7('0x7'));var util=require('util');var path=require(_0x89a7('0x8'));var sox=require(_0x89a7('0x9'));var csv=require(_0x89a7('0xa'));var ejs=require(_0x89a7('0xb'));var fs=require('fs');var fs_extra=require(_0x89a7('0xc'));var _=require('lodash');var squel=require(_0x89a7('0xd'));var crypto=require(_0x89a7('0xe'));var jsforce=require(_0x89a7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x89a7('0xa'));var querystring=require(_0x89a7('0x10'));var Papa=require(_0x89a7('0x11'));var Redis=require(_0x89a7('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x89a7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x89a7('0x14'))(_0x89a7('0x15'));var utils=require('../../config/utils');var config=require(_0x89a7('0x16'));var licenseUtil=require(_0x89a7('0x17'));var db=require(_0x89a7('0x18'))['db'];function respondWithStatusCode(_0x1fd8c3,_0x487a70){_0x487a70=_0x487a70||0xcc;return function(_0x50d920){if(_0x50d920){return _0x1fd8c3['sendStatus'](_0x487a70);}return _0x1fd8c3['status'](_0x487a70)['end']();};}function respondWithResult(_0xa2a3a5,_0x31ac46){_0x31ac46=_0x31ac46||0xc8;return function(_0x550b1b){if(_0x550b1b){return _0xa2a3a5['status'](_0x31ac46)[_0x89a7('0x19')](_0x550b1b);}};}function respondWithFilteredResult(_0x7cbdd8,_0xbe8a81){return function(_0x1e3c27){if(_0x1e3c27){var _0x2f93a1=typeof _0xbe8a81[_0x89a7('0x1a')]===_0x89a7('0x1b')&&typeof _0xbe8a81[_0x89a7('0x1c')]===_0x89a7('0x1b');var _0x1caf11=_0x1e3c27[_0x89a7('0x1d')];var _0x1c8e58=_0x2f93a1?0x0:_0xbe8a81['offset'];var _0x1eb7e5=_0x2f93a1?_0x1e3c27['count']:_0xbe8a81[_0x89a7('0x1a')]+_0xbe8a81[_0x89a7('0x1c')];var _0x32dc11;if(_0x1eb7e5>=_0x1caf11){_0x1eb7e5=_0x1caf11;_0x32dc11=0xc8;}else{_0x32dc11=0xce;}_0x7cbdd8[_0x89a7('0x1e')](_0x32dc11);return _0x7cbdd8[_0x89a7('0x1f')](_0x89a7('0x20'),_0x1c8e58+'-'+_0x1eb7e5+'/'+_0x1caf11)['json'](_0x1e3c27);}return null;};}function patchUpdates(_0x2545ad){return function(_0x5535e2){try{jsonpatch[_0x89a7('0x21')](_0x5535e2,_0x2545ad,!![]);}catch(_0x5d1429){return BPromise[_0x89a7('0x22')](_0x5d1429);}return _0x5535e2[_0x89a7('0x23')]();};}function saveUpdates(_0x424862,_0x327226){return function(_0x220567){if(_0x220567){return _0x220567[_0x89a7('0x24')](_0x424862)['then'](function(_0x39a83b){return _0x39a83b;});}return null;};}function removeEntity(_0x4cdb28,_0x38d5f2){return function(_0xe407e){if(_0xe407e){return _0xe407e['destroy']()[_0x89a7('0x25')](function(){_0x4cdb28[_0x89a7('0x1e')](0xcc)[_0x89a7('0x26')]();});}};}function handleEntityNotFound(_0x148e7e,_0x23d769){return function(_0x1aa5a0){if(!_0x1aa5a0){_0x148e7e['sendStatus'](0x194);}return _0x1aa5a0;};}function handleError(_0x187ed8,_0x29805e){_0x29805e=_0x29805e||0x1f4;return function(_0xbfb955){logger[_0x89a7('0x27')](_0xbfb955[_0x89a7('0x28')]);if(_0xbfb955['name']){delete _0xbfb955[_0x89a7('0x29')];}_0x187ed8[_0x89a7('0x1e')](_0x29805e)['send'](_0xbfb955);};}exports[_0x89a7('0x2a')]=function(_0x1ba5a6,_0x579091){var _0x306f2d={},_0x1f2b0d={},_0x45adea={'count':0x0,'rows':[]};var _0x3d0cb4=_[_0x89a7('0x2b')](db[_0x89a7('0x2c')]['rawAttributes'],function(_0x1b3b28){return{'name':_0x1b3b28['fieldName'],'type':_0x1b3b28[_0x89a7('0x2d')][_0x89a7('0x2e')]};});_0x1f2b0d[_0x89a7('0x2f')]=_[_0x89a7('0x2b')](_0x3d0cb4,_0x89a7('0x29'));_0x1f2b0d[_0x89a7('0x30')]=_[_0x89a7('0x31')](_0x1ba5a6[_0x89a7('0x30')]);_0x1f2b0d[_0x89a7('0x32')]=_[_0x89a7('0x33')](_0x1f2b0d['model'],_0x1f2b0d[_0x89a7('0x30')]);_0x306f2d[_0x89a7('0x34')]=_[_0x89a7('0x33')](_0x1f2b0d[_0x89a7('0x2f')],qs[_0x89a7('0x35')](_0x1ba5a6[_0x89a7('0x30')][_0x89a7('0x35')]));_0x306f2d[_0x89a7('0x34')]=_0x306f2d['attributes'][_0x89a7('0x36')]?_0x306f2d[_0x89a7('0x34')]:_0x1f2b0d['model'];if(!_0x1ba5a6[_0x89a7('0x30')][_0x89a7('0x37')](_0x89a7('0x38'))){_0x306f2d[_0x89a7('0x1c')]=qs['limit'](_0x1ba5a6[_0x89a7('0x30')][_0x89a7('0x1c')]);_0x306f2d[_0x89a7('0x1a')]=qs[_0x89a7('0x1a')](_0x1ba5a6[_0x89a7('0x30')][_0x89a7('0x1a')]);}_0x306f2d[_0x89a7('0x39')]=qs[_0x89a7('0x3a')](_0x1ba5a6[_0x89a7('0x30')][_0x89a7('0x3a')]);_0x306f2d[_0x89a7('0x3b')]=qs[_0x89a7('0x32')](_[_0x89a7('0x3c')](_0x1ba5a6[_0x89a7('0x30')],_0x1f2b0d[_0x89a7('0x32')]),_0x3d0cb4);if(_0x1ba5a6['query']['filter']){_0x306f2d[_0x89a7('0x3b')]=_[_0x89a7('0x3d')](_0x306f2d['where'],{'$or':_[_0x89a7('0x2b')](_0x3d0cb4,function(_0xce0ece){if(_0xce0ece['type']!==_0x89a7('0x3e')){var _0x3800dc={};_0x3800dc[_0xce0ece[_0x89a7('0x29')]]={'$like':'%'+_0x1ba5a6[_0x89a7('0x30')][_0x89a7('0x3f')]+'%'};return _0x3800dc;}})});}_0x306f2d=_[_0x89a7('0x3d')]({},_0x306f2d,_0x1ba5a6[_0x89a7('0x40')]);var _0x216f38={'where':_0x306f2d[_0x89a7('0x3b')]};return db[_0x89a7('0x2c')][_0x89a7('0x1d')](_0x216f38)[_0x89a7('0x25')](function(_0x1733ed){_0x45adea[_0x89a7('0x1d')]=_0x1733ed;if(_0x1ba5a6[_0x89a7('0x30')][_0x89a7('0x41')]){_0x306f2d[_0x89a7('0x42')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x89a7('0x43')](_0x306f2d);})['then'](function(_0x31849e){_0x45adea[_0x89a7('0x44')]=_0x31849e;return _0x45adea;})[_0x89a7('0x25')](respondWithFilteredResult(_0x579091,_0x306f2d))[_0x89a7('0x45')](handleError(_0x579091,null));};exports['show']=function(_0x2e9208,_0x5c50c7){var _0x1a9adb={'raw':!![],'where':{'id':_0x2e9208[_0x89a7('0x46')]['id']}},_0x40ff4a={};_0x40ff4a[_0x89a7('0x2f')]=_['keys'](db['OpenchannelTransferReport'][_0x89a7('0x47')]);_0x40ff4a[_0x89a7('0x30')]=_[_0x89a7('0x31')](_0x2e9208[_0x89a7('0x30')]);_0x40ff4a[_0x89a7('0x32')]=_[_0x89a7('0x33')](_0x40ff4a[_0x89a7('0x2f')],_0x40ff4a[_0x89a7('0x30')]);_0x1a9adb[_0x89a7('0x34')]=_[_0x89a7('0x33')](_0x40ff4a[_0x89a7('0x2f')],qs['fields'](_0x2e9208[_0x89a7('0x30')][_0x89a7('0x35')]));_0x1a9adb['attributes']=_0x1a9adb[_0x89a7('0x34')][_0x89a7('0x36')]?_0x1a9adb[_0x89a7('0x34')]:_0x40ff4a[_0x89a7('0x2f')];if(_0x2e9208[_0x89a7('0x30')]['includeAll']){_0x1a9adb[_0x89a7('0x42')]=[{'all':!![]}];}_0x1a9adb=_['merge']({},_0x1a9adb,_0x2e9208[_0x89a7('0x40')]);return db['OpenchannelTransferReport']['find'](_0x1a9adb)[_0x89a7('0x25')](handleEntityNotFound(_0x5c50c7,null))['then'](respondWithResult(_0x5c50c7,null))[_0x89a7('0x45')](handleError(_0x5c50c7,null));};exports['create']=function(_0x19939e,_0x3e897b){return db[_0x89a7('0x2c')][_0x89a7('0x48')](_0x19939e[_0x89a7('0x49')],{})[_0x89a7('0x25')](respondWithResult(_0x3e897b,0xc9))['catch'](handleError(_0x3e897b,null));};exports[_0x89a7('0x24')]=function(_0x598634,_0xedd73f){if(_0x598634['body']['id']){delete _0x598634['body']['id'];}return db[_0x89a7('0x2c')][_0x89a7('0x4a')]({'where':{'id':_0x598634[_0x89a7('0x46')]['id']}})[_0x89a7('0x25')](handleEntityNotFound(_0xedd73f,null))[_0x89a7('0x25')](saveUpdates(_0x598634[_0x89a7('0x49')],null))[_0x89a7('0x25')](respondWithResult(_0xedd73f,null))['catch'](handleError(_0xedd73f,null));};exports[_0x89a7('0x4b')]=function(_0x278056,_0x26e95f){return db[_0x89a7('0x2c')]['find']({'where':{'id':_0x278056[_0x89a7('0x46')]['id']}})[_0x89a7('0x25')](handleEntityNotFound(_0x26e95f,null))[_0x89a7('0x25')](removeEntity(_0x26e95f,null))[_0x89a7('0x45')](handleError(_0x26e95f,null));};exports[_0x89a7('0x4c')]=function(_0x123732,_0x209b06){return db[_0x89a7('0x2c')][_0x89a7('0x4c')]()[_0x89a7('0x25')](respondWithResult(_0x209b06,null))[_0x89a7('0x45')](handleError(_0x209b06,null));};
\ No newline at end of file
+var _0xb051=['options','includeAll','findAll','rows','catch','include','create','body','find','destroy','describe','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','end','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xb051,0x16e));var _0x1b05=function(_0x4de877,_0x340170){_0x4de877=_0x4de877-0x0;var _0xb2cfeb=_0xb051[_0x4de877];return _0xb2cfeb;};'use strict';var emlformat=require(_0x1b05('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1b05('0x1'));var rp=require(_0x1b05('0x2'));var moment=require(_0x1b05('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1b05('0x4'));var util=require(_0x1b05('0x5'));var path=require(_0x1b05('0x6'));var sox=require('sox');var csv=require(_0x1b05('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b05('0x8'));var _=require(_0x1b05('0x9'));var squel=require(_0x1b05('0xa'));var crypto=require(_0x1b05('0xb'));var jsforce=require(_0x1b05('0xc'));var deskjs=require(_0x1b05('0xd'));var toCsv=require(_0x1b05('0x7'));var querystring=require('querystring');var Papa=require(_0x1b05('0xe'));var Redis=require(_0x1b05('0xf'));var authService=require(_0x1b05('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1b05('0x11'));var hardwareService=require(_0x1b05('0x12'));var logger=require('../../config/logger')(_0x1b05('0x13'));var utils=require(_0x1b05('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1b05('0x15'));var db=require(_0x1b05('0x16'))['db'];function respondWithStatusCode(_0x6a6b74,_0x21a613){_0x21a613=_0x21a613||0xcc;return function(_0x2adb1d){if(_0x2adb1d){return _0x6a6b74[_0x1b05('0x17')](_0x21a613);}return _0x6a6b74[_0x1b05('0x18')](_0x21a613)['end']();};}function respondWithResult(_0x354f16,_0x5591eb){_0x5591eb=_0x5591eb||0xc8;return function(_0x15750d){if(_0x15750d){return _0x354f16['status'](_0x5591eb)['json'](_0x15750d);}};}function respondWithFilteredResult(_0x2863a2,_0x46c5fa){return function(_0x119301){if(_0x119301){var _0x14cc2c=typeof _0x46c5fa[_0x1b05('0x19')]===_0x1b05('0x1a')&&typeof _0x46c5fa[_0x1b05('0x1b')]===_0x1b05('0x1a');var _0x33b572=_0x119301[_0x1b05('0x1c')];var _0x781e21=_0x14cc2c?0x0:_0x46c5fa[_0x1b05('0x19')];var _0x21f0b8=_0x14cc2c?_0x119301[_0x1b05('0x1c')]:_0x46c5fa[_0x1b05('0x19')]+_0x46c5fa[_0x1b05('0x1b')];var _0x2cfaa5;if(_0x21f0b8>=_0x33b572){_0x21f0b8=_0x33b572;_0x2cfaa5=0xc8;}else{_0x2cfaa5=0xce;}_0x2863a2[_0x1b05('0x18')](_0x2cfaa5);return _0x2863a2[_0x1b05('0x1d')](_0x1b05('0x1e'),_0x781e21+'-'+_0x21f0b8+'/'+_0x33b572)[_0x1b05('0x1f')](_0x119301);}return null;};}function patchUpdates(_0x35909b){return function(_0x49c23b){try{jsonpatch[_0x1b05('0x20')](_0x49c23b,_0x35909b,!![]);}catch(_0x2dff4e){return BPromise['reject'](_0x2dff4e);}return _0x49c23b[_0x1b05('0x21')]();};}function saveUpdates(_0x37e3c9,_0x39710f){return function(_0x58f414){if(_0x58f414){return _0x58f414[_0x1b05('0x22')](_0x37e3c9)[_0x1b05('0x23')](function(_0x49cc5e){return _0x49cc5e;});}return null;};}function removeEntity(_0x56102c,_0xe006d3){return function(_0x568c87){if(_0x568c87){return _0x568c87['destroy']()[_0x1b05('0x23')](function(){_0x56102c[_0x1b05('0x18')](0xcc)[_0x1b05('0x24')]();});}};}function handleEntityNotFound(_0x562994,_0x2b3540){return function(_0x2f2ec3){if(!_0x2f2ec3){_0x562994[_0x1b05('0x17')](0x194);}return _0x2f2ec3;};}function handleError(_0x4ecd60,_0x44937c){_0x44937c=_0x44937c||0x1f4;return function(_0x1a6071){logger['error'](_0x1a6071['stack']);if(_0x1a6071[_0x1b05('0x25')]){delete _0x1a6071[_0x1b05('0x25')];}_0x4ecd60[_0x1b05('0x18')](_0x44937c)[_0x1b05('0x26')](_0x1a6071);};}exports[_0x1b05('0x27')]=function(_0x4aa303,_0x25349f){var _0xc8a8da={},_0x4e66a4={},_0x418ff3={'count':0x0,'rows':[]};var _0x58944e=_[_0x1b05('0x28')](db[_0x1b05('0x29')][_0x1b05('0x2a')],function(_0x5b844b){return{'name':_0x5b844b[_0x1b05('0x2b')],'type':_0x5b844b[_0x1b05('0x2c')][_0x1b05('0x2d')]};});_0x4e66a4[_0x1b05('0x2e')]=_['map'](_0x58944e,_0x1b05('0x25'));_0x4e66a4['query']=_[_0x1b05('0x2f')](_0x4aa303[_0x1b05('0x30')]);_0x4e66a4[_0x1b05('0x31')]=_[_0x1b05('0x32')](_0x4e66a4[_0x1b05('0x2e')],_0x4e66a4[_0x1b05('0x30')]);_0xc8a8da[_0x1b05('0x33')]=_['intersection'](_0x4e66a4[_0x1b05('0x2e')],qs[_0x1b05('0x34')](_0x4aa303[_0x1b05('0x30')][_0x1b05('0x34')]));_0xc8a8da['attributes']=_0xc8a8da[_0x1b05('0x33')][_0x1b05('0x35')]?_0xc8a8da['attributes']:_0x4e66a4[_0x1b05('0x2e')];if(!_0x4aa303[_0x1b05('0x30')]['hasOwnProperty'](_0x1b05('0x36'))){_0xc8a8da['limit']=qs['limit'](_0x4aa303[_0x1b05('0x30')][_0x1b05('0x1b')]);_0xc8a8da['offset']=qs[_0x1b05('0x19')](_0x4aa303['query'][_0x1b05('0x19')]);}_0xc8a8da['order']=qs[_0x1b05('0x37')](_0x4aa303[_0x1b05('0x30')]['sort']);_0xc8a8da[_0x1b05('0x38')]=qs[_0x1b05('0x31')](_['pick'](_0x4aa303['query'],_0x4e66a4['filters']),_0x58944e);if(_0x4aa303[_0x1b05('0x30')][_0x1b05('0x39')]){_0xc8a8da[_0x1b05('0x38')]=_[_0x1b05('0x3a')](_0xc8a8da[_0x1b05('0x38')],{'$or':_[_0x1b05('0x28')](_0x58944e,function(_0x1ace74){if(_0x1ace74[_0x1b05('0x2c')]!==_0x1b05('0x3b')){var _0xcd45a0={};_0xcd45a0[_0x1ace74[_0x1b05('0x25')]]={'$like':'%'+_0x4aa303[_0x1b05('0x30')][_0x1b05('0x39')]+'%'};return _0xcd45a0;}})});}_0xc8a8da=_[_0x1b05('0x3a')]({},_0xc8a8da,_0x4aa303[_0x1b05('0x3c')]);var _0x1ddb69={'where':_0xc8a8da['where']};return db[_0x1b05('0x29')]['count'](_0x1ddb69)[_0x1b05('0x23')](function(_0x3e5921){_0x418ff3[_0x1b05('0x1c')]=_0x3e5921;if(_0x4aa303[_0x1b05('0x30')][_0x1b05('0x3d')]){_0xc8a8da['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x1b05('0x3e')](_0xc8a8da);})[_0x1b05('0x23')](function(_0x5e0aaa){_0x418ff3[_0x1b05('0x3f')]=_0x5e0aaa;return _0x418ff3;})[_0x1b05('0x23')](respondWithFilteredResult(_0x25349f,_0xc8a8da))[_0x1b05('0x40')](handleError(_0x25349f,null));};exports['show']=function(_0x497fce,_0x22403f){var _0x4a6151={'raw':!![],'where':{'id':_0x497fce['params']['id']}},_0xfdeab3={};_0xfdeab3['model']=_['keys'](db[_0x1b05('0x29')][_0x1b05('0x2a')]);_0xfdeab3[_0x1b05('0x30')]=_['keys'](_0x497fce['query']);_0xfdeab3['filters']=_['intersection'](_0xfdeab3[_0x1b05('0x2e')],_0xfdeab3[_0x1b05('0x30')]);_0x4a6151[_0x1b05('0x33')]=_[_0x1b05('0x32')](_0xfdeab3[_0x1b05('0x2e')],qs[_0x1b05('0x34')](_0x497fce['query'][_0x1b05('0x34')]));_0x4a6151['attributes']=_0x4a6151[_0x1b05('0x33')][_0x1b05('0x35')]?_0x4a6151[_0x1b05('0x33')]:_0xfdeab3[_0x1b05('0x2e')];if(_0x497fce[_0x1b05('0x30')][_0x1b05('0x3d')]){_0x4a6151[_0x1b05('0x41')]=[{'all':!![]}];}_0x4a6151=_['merge']({},_0x4a6151,_0x497fce['options']);return db[_0x1b05('0x29')]['find'](_0x4a6151)[_0x1b05('0x23')](handleEntityNotFound(_0x22403f,null))[_0x1b05('0x23')](respondWithResult(_0x22403f,null))[_0x1b05('0x40')](handleError(_0x22403f,null));};exports[_0x1b05('0x42')]=function(_0x330e45,_0x26ed0a){return db[_0x1b05('0x29')][_0x1b05('0x42')](_0x330e45[_0x1b05('0x43')],{})['then'](respondWithResult(_0x26ed0a,0xc9))[_0x1b05('0x40')](handleError(_0x26ed0a,null));};exports[_0x1b05('0x22')]=function(_0x12342f,_0xc7672d){if(_0x12342f[_0x1b05('0x43')]['id']){delete _0x12342f['body']['id'];}return db[_0x1b05('0x29')][_0x1b05('0x44')]({'where':{'id':_0x12342f['params']['id']}})[_0x1b05('0x23')](handleEntityNotFound(_0xc7672d,null))[_0x1b05('0x23')](saveUpdates(_0x12342f[_0x1b05('0x43')],null))[_0x1b05('0x23')](respondWithResult(_0xc7672d,null))[_0x1b05('0x40')](handleError(_0xc7672d,null));};exports[_0x1b05('0x45')]=function(_0x1f7f15,_0x43f4a5){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x1f7f15['params']['id']}})[_0x1b05('0x23')](handleEntityNotFound(_0x43f4a5,null))[_0x1b05('0x23')](removeEntity(_0x43f4a5,null))['catch'](handleError(_0x43f4a5,null));};exports['describe']=function(_0x3d04fc,_0x5e4265){return db[_0x1b05('0x29')][_0x1b05('0x46')]()[_0x1b05('0x23')](respondWithResult(_0x5e4265,null))[_0x1b05('0x40')](handleError(_0x5e4265,null));};
\ No newline at end of file
index 41a62e9..1dbc7e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe903=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','lodash'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0xe903,0x8e));var _0x3e90=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xe903[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0x3e90('0x0'));var util=require(_0x3e90('0x1'));var logger=require(_0x3e90('0x2'))('api');var moment=require(_0x3e90('0x3'));var BPromise=require(_0x3e90('0x4'));var rp=require(_0x3e90('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e90('0x6'));var config=require(_0x3e90('0x7'));var attributes=require(_0x3e90('0x8'));module[_0x3e90('0x9')]=function(_0x4fff8e,_0x28990b){return _0x4fff8e[_0x3e90('0xa')]('OpenchannelTransferReport',attributes,{'tableName':_0x3e90('0xb'),'paranoid':![],'indexes':[{'name':_0x3e90('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8c2=['lodash','util','api','moment','bluebird','request-promise','path','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','uniqueid'];(function(_0x286e30,_0x4e9cc1){var _0x3d1e6c=function(_0x1cc3e7){while(--_0x1cc3e7){_0x286e30['push'](_0x286e30['shift']());}};_0x3d1e6c(++_0x4e9cc1);}(_0xd8c2,0x18c));var _0x2d8c=function(_0x483fcb,_0x6e1b32){_0x483fcb=_0x483fcb-0x0;var _0x39743b=_0xd8c2[_0x483fcb];return _0x39743b;};'use strict';var _=require(_0x2d8c('0x0'));var util=require(_0x2d8c('0x1'));var logger=require('../../config/logger')(_0x2d8c('0x2'));var moment=require(_0x2d8c('0x3'));var BPromise=require(_0x2d8c('0x4'));var rp=require(_0x2d8c('0x5'));var fs=require('fs');var path=require(_0x2d8c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2d8c('0x7'));module['exports']=function(_0x2f6f69,_0x1d7cbb){return _0x2f6f69[_0x2d8c('0x8')](_0x2d8c('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x2d8c('0xa'),'fields':[_0x2d8c('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 0204e2f..e4c426f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1f=['request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5bee3b,_0x25e87e){var _0x2e8c86=function(_0x3e7c49){while(--_0x3e7c49){_0x5bee3b['push'](_0x5bee3b['shift']());}};_0x2e8c86(++_0x25e87e);}(_0xed1f,0x6a));var _0xfed1=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xed1f[_0x26f702];return _0x11417d;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){return client[_0xfed1('0xe')](_0x380e18,_0x2a6082)[_0xfed1('0xf')](function(_0x48862d){logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,'request\x20sent');logger[_0xfed1('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x612b38,_0xfed1('0x13'),JSON[_0xfed1('0x14')](_0x48862d));if(_0x48862d['error']){if(_0x48862d['error'][_0xfed1('0x15')]===0x1f4){logger[_0xfed1('0x16')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x568d48(_0x48862d['error'][_0xfed1('0x17')]);}logger[_0xfed1('0x16')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x2967ef(_0x48862d['error'][_0xfed1('0x17')]);}else{logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,_0xfed1('0x13'));_0x2967ef(_0x48862d['result'][_0xfed1('0x17')]);}})['catch'](function(_0x36ff34){logger[_0xfed1('0x16')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x612b38,_0x36ff34);_0x568d48(_0x36ff34);});});}
\ No newline at end of file
+var _0xac95=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0x3e3a0c,_0x5c4d35){var _0xf117fa=function(_0x3fc115){while(--_0x3fc115){_0x3e3a0c['push'](_0x3e3a0c['shift']());}};_0xf117fa(++_0x5c4d35);}(_0xac95,0xa8));var _0x5ac9=function(_0x1e5e91,_0x29c908){_0x1e5e91=_0x1e5e91-0x0;var _0x3c55e8=_0xac95[_0x1e5e91];return _0x3c55e8;};'use strict';var _=require(_0x5ac9('0x0'));var util=require(_0x5ac9('0x1'));var moment=require(_0x5ac9('0x2'));var BPromise=require(_0x5ac9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ac9('0x4'))['db'];var utils=require(_0x5ac9('0x5'));var logger=require('../../config/logger')(_0x5ac9('0x6'));var config=require(_0x5ac9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5ac9('0x8')][_0x5ac9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8675ec,_0x4bddcf,_0x4dffb8){return new BPromise(function(_0x32afbc,_0x2ab11c){return client[_0x5ac9('0xa')](_0x8675ec,_0x4dffb8)[_0x5ac9('0xb')](function(_0x397bb8){logger[_0x5ac9('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4bddcf,_0x5ac9('0xd'));logger[_0x5ac9('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x4bddcf,_0x5ac9('0xd'),JSON['stringify'](_0x397bb8));if(_0x397bb8[_0x5ac9('0xf')]){if(_0x397bb8['error'][_0x5ac9('0x10')]===0x1f4){logger[_0x5ac9('0xf')](_0x5ac9('0x11'),_0x4bddcf,_0x397bb8[_0x5ac9('0xf')]['message']);return _0x2ab11c(_0x397bb8['error'][_0x5ac9('0x12')]);}logger['error'](_0x5ac9('0x11'),_0x4bddcf,_0x397bb8[_0x5ac9('0xf')]['message']);return _0x32afbc(_0x397bb8[_0x5ac9('0xf')][_0x5ac9('0x12')]);}else{logger[_0x5ac9('0xc')](_0x5ac9('0x11'),_0x4bddcf,_0x5ac9('0xd'));_0x32afbc(_0x397bb8[_0x5ac9('0x13')][_0x5ac9('0x12')]);}})[_0x5ac9('0x14')](function(_0x460fd7){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x4bddcf,_0x460fd7);_0x2ab11c(_0x460fd7);});});}
\ No newline at end of file
index dac0e0f..7e8fdb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf03c=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','update','destroy','exports','multer','util'];(function(_0x134abe,_0x1f306d){var _0x4c6609=function(_0x23d2bf){while(--_0x23d2bf){_0x134abe['push'](_0x134abe['shift']());}};_0x4c6609(++_0x1f306d);}(_0xf03c,0xbe));var _0xcf03=function(_0x422a67,_0x15a39a){_0x422a67=_0x422a67-0x0;var _0x409f2c=_0xf03c[_0x422a67];return _0x409f2c;};'use strict';var multer=require(_0xcf03('0x0'));var util=require(_0xcf03('0x1'));var path=require(_0xcf03('0x2'));var timeout=require('connect-timeout');var express=require(_0xcf03('0x3'));var router=express[_0xcf03('0x4')]();var fs_extra=require(_0xcf03('0x5'));var auth=require(_0xcf03('0x6'));var interaction=require(_0xcf03('0x7'));var config=require(_0xcf03('0x8'));var controller=require('./pause.controller');router[_0xcf03('0x9')]('/',auth[_0xcf03('0xa')](),controller['index']);router[_0xcf03('0x9')](_0xcf03('0xb'),auth[_0xcf03('0xa')](),controller['show']);router[_0xcf03('0xc')]('/',auth[_0xcf03('0xa')](),controller['create']);router['put'](_0xcf03('0xb'),auth[_0xcf03('0xa')](),controller[_0xcf03('0xd')]);router['delete'](_0xcf03('0xb'),auth[_0xcf03('0xa')](),controller[_0xcf03('0xe')]);module[_0xcf03('0xf')]=router;
\ No newline at end of file
+var _0x2dc3=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id','show','update','delete','destroy'];(function(_0x423eec,_0x4044ad){var _0xcd11bc=function(_0x13e30b){while(--_0x13e30b){_0x423eec['push'](_0x423eec['shift']());}};_0xcd11bc(++_0x4044ad);}(_0x2dc3,0x150));var _0x32dc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2dc3[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x32dc('0x0'));var path=require('path');var timeout=require(_0x32dc('0x1'));var express=require(_0x32dc('0x2'));var router=express[_0x32dc('0x3')]();var fs_extra=require(_0x32dc('0x4'));var auth=require(_0x32dc('0x5'));var interaction=require(_0x32dc('0x6'));var config=require(_0x32dc('0x7'));var controller=require(_0x32dc('0x8'));router[_0x32dc('0x9')]('/',auth[_0x32dc('0xa')](),controller['index']);router[_0x32dc('0x9')](_0x32dc('0xb'),auth['isAuthenticated'](),controller[_0x32dc('0xc')]);router['post']('/',auth[_0x32dc('0xa')](),controller['create']);router['put'](_0x32dc('0xb'),auth[_0x32dc('0xa')](),controller[_0x32dc('0xd')]);router[_0x32dc('0xe')](_0x32dc('0xb'),auth[_0x32dc('0xa')](),controller[_0x32dc('0xf')]);module['exports']=router;
\ No newline at end of file
index f004cae..b6b3384 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf861=['exports','name','STRING','sequelize'];(function(_0x136200,_0x3bac4c){var _0x313a9a=function(_0x147aef){while(--_0x147aef){_0x136200['push'](_0x136200['shift']());}};_0x313a9a(++_0x3bac4c);}(_0xf861,0xbb));var _0x1f86=function(_0x273c1c,_0x4d42ff){_0x273c1c=_0x273c1c-0x0;var _0x3fccae=_0xf861[_0x273c1c];return _0x3fccae;};'use strict';var Sequelize=require(_0x1f86('0x0'));module[_0x1f86('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1f86('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x1f86('0x3')]}};
\ No newline at end of file
+var _0x4ed2=['exports','STRING','sequelize'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x4ed2,0x1eb));var _0x24ed=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4ed2[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x24ed('0x0'));module[_0x24ed('0x1')]={'name':{'type':Sequelize[_0x24ed('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 0357e51..72f7b7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5847=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','get','Pauses','UserProfileResource','error','stack','name','Pause','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','find','create','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x5847,0x99));var _0x7584=function(_0x26299a,_0x25c3b4){_0x26299a=_0x26299a-0x0;var _0x441b04=_0x5847[_0x26299a];return _0x441b04;};'use strict';var emlformat=require(_0x7584('0x0'));var rimraf=require(_0x7584('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7584('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7584('0x3'));var Mustache=require('mustache');var util=require(_0x7584('0x4'));var path=require(_0x7584('0x5'));var sox=require(_0x7584('0x6'));var csv=require(_0x7584('0x7'));var ejs=require(_0x7584('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7584('0x9'));var squel=require(_0x7584('0xa'));var crypto=require(_0x7584('0xb'));var jsforce=require(_0x7584('0xc'));var deskjs=require(_0x7584('0xd'));var toCsv=require(_0x7584('0x7'));var querystring=require(_0x7584('0xe'));var Papa=require(_0x7584('0xf'));var Redis=require('ioredis');var authService=require(_0x7584('0x10'));var qs=require(_0x7584('0x11'));var as=require(_0x7584('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7584('0x13'))(_0x7584('0x14'));var utils=require(_0x7584('0x15'));var config=require(_0x7584('0x16'));var licenseUtil=require(_0x7584('0x17'));var db=require(_0x7584('0x18'))['db'];function respondWithStatusCode(_0x2c6033,_0x3cdb6a){_0x3cdb6a=_0x3cdb6a||0xcc;return function(_0x58e6dc){if(_0x58e6dc){return _0x2c6033[_0x7584('0x19')](_0x3cdb6a);}return _0x2c6033[_0x7584('0x1a')](_0x3cdb6a)[_0x7584('0x1b')]();};}function respondWithResult(_0x1ffb39,_0x4550c5){_0x4550c5=_0x4550c5||0xc8;return function(_0x178ab3){if(_0x178ab3){return _0x1ffb39[_0x7584('0x1a')](_0x4550c5)[_0x7584('0x1c')](_0x178ab3);}};}function respondWithFilteredResult(_0x4cf3d7,_0x3da221){return function(_0x3b6cb7){if(_0x3b6cb7){var _0x482eee=typeof _0x3da221[_0x7584('0x1d')]===_0x7584('0x1e')&&typeof _0x3da221['limit']===_0x7584('0x1e');var _0x5c47fe=_0x3b6cb7['count'];var _0x1f22b0=_0x482eee?0x0:_0x3da221[_0x7584('0x1d')];var _0x2ce941=_0x482eee?_0x3b6cb7[_0x7584('0x1f')]:_0x3da221['offset']+_0x3da221[_0x7584('0x20')];var _0x5840e4;if(_0x2ce941>=_0x5c47fe){_0x2ce941=_0x5c47fe;_0x5840e4=0xc8;}else{_0x5840e4=0xce;}_0x4cf3d7[_0x7584('0x1a')](_0x5840e4);return _0x4cf3d7[_0x7584('0x21')](_0x7584('0x22'),_0x1f22b0+'-'+_0x2ce941+'/'+_0x5c47fe)[_0x7584('0x1c')](_0x3b6cb7);}return null;};}function patchUpdates(_0x44689d){return function(_0x2c89fc){try{jsonpatch[_0x7584('0x23')](_0x2c89fc,_0x44689d,!![]);}catch(_0x23ce30){return BPromise[_0x7584('0x24')](_0x23ce30);}return _0x2c89fc['save']();};}function saveUpdates(_0x500372,_0x350138){return function(_0x4bbdc3){if(_0x4bbdc3){return _0x4bbdc3[_0x7584('0x25')](_0x500372)['then'](function(_0x463d9d){return _0x463d9d;});}return null;};}function removeEntity(_0x5e2d0d,_0x3d9d23){return function(_0x56b259){if(_0x56b259){return _0x56b259[_0x7584('0x26')]()[_0x7584('0x27')](function(){var _0x2fb741=_0x56b259[_0x7584('0x28')]({'plain':!![]});var _0x5a3476=_0x7584('0x29');return db[_0x7584('0x2a')][_0x7584('0x26')]({'where':{'type':_0x5a3476,'resourceId':_0x2fb741['id']}})[_0x7584('0x27')](function(){return _0x56b259;});})[_0x7584('0x27')](function(){_0x5e2d0d[_0x7584('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46a5a4,_0x1de01e){return function(_0x489ad5){if(!_0x489ad5){_0x46a5a4['sendStatus'](0x194);}return _0x489ad5;};}function handleError(_0x244d4a,_0x47bbd1){_0x47bbd1=_0x47bbd1||0x1f4;return function(_0x206fc1){logger[_0x7584('0x2b')](_0x206fc1[_0x7584('0x2c')]);if(_0x206fc1[_0x7584('0x2d')]){delete _0x206fc1['name'];}_0x244d4a[_0x7584('0x1a')](_0x47bbd1)['send'](_0x206fc1);};}exports['index']=function(_0x14dfeb,_0x1a0512){var _0x17feab={},_0x11eea6={},_0x17c329={'count':0x0,'rows':[]};var _0x3832f2=_['map'](db[_0x7584('0x2e')][_0x7584('0x2f')],function(_0x4f2aae){return{'name':_0x4f2aae[_0x7584('0x30')],'type':_0x4f2aae[_0x7584('0x31')][_0x7584('0x32')]};});_0x11eea6[_0x7584('0x33')]=_[_0x7584('0x34')](_0x3832f2,_0x7584('0x2d'));_0x11eea6[_0x7584('0x35')]=_[_0x7584('0x36')](_0x14dfeb[_0x7584('0x35')]);_0x11eea6[_0x7584('0x37')]=_[_0x7584('0x38')](_0x11eea6[_0x7584('0x33')],_0x11eea6[_0x7584('0x35')]);_0x17feab['attributes']=_[_0x7584('0x38')](_0x11eea6[_0x7584('0x33')],qs[_0x7584('0x39')](_0x14dfeb[_0x7584('0x35')][_0x7584('0x39')]));_0x17feab[_0x7584('0x3a')]=_0x17feab['attributes'][_0x7584('0x3b')]?_0x17feab['attributes']:_0x11eea6[_0x7584('0x33')];if(!_0x14dfeb[_0x7584('0x35')][_0x7584('0x3c')](_0x7584('0x3d'))){_0x17feab[_0x7584('0x20')]=qs[_0x7584('0x20')](_0x14dfeb[_0x7584('0x35')][_0x7584('0x20')]);_0x17feab['offset']=qs[_0x7584('0x1d')](_0x14dfeb[_0x7584('0x35')]['offset']);}_0x17feab[_0x7584('0x3e')]=qs[_0x7584('0x3f')](_0x14dfeb['query'][_0x7584('0x3f')]);_0x17feab[_0x7584('0x40')]=qs['filters'](_[_0x7584('0x41')](_0x14dfeb[_0x7584('0x35')],_0x11eea6[_0x7584('0x37')]),_0x3832f2);if(_0x14dfeb[_0x7584('0x35')][_0x7584('0x42')]){_0x17feab[_0x7584('0x40')]=_[_0x7584('0x43')](_0x17feab[_0x7584('0x40')],{'$or':_[_0x7584('0x34')](_0x3832f2,function(_0x37601f){if(_0x37601f['type']!==_0x7584('0x44')){var _0x714517={};_0x714517[_0x37601f[_0x7584('0x2d')]]={'$like':'%'+_0x14dfeb[_0x7584('0x35')][_0x7584('0x42')]+'%'};return _0x714517;}})});}_0x17feab=_[_0x7584('0x43')]({},_0x17feab,_0x14dfeb['options']);var _0x34aca7={'where':_0x17feab['where']};return db[_0x7584('0x2e')]['count'](_0x34aca7)['then'](function(_0x12a8a9){_0x17c329[_0x7584('0x1f')]=_0x12a8a9;if(_0x14dfeb[_0x7584('0x35')][_0x7584('0x45')]){_0x17feab[_0x7584('0x46')]=[{'all':!![]}];}return db[_0x7584('0x2e')]['findAll'](_0x17feab);})[_0x7584('0x27')](function(_0x22488f){_0x17c329[_0x7584('0x47')]=_0x22488f;return _0x17c329;})[_0x7584('0x27')](respondWithFilteredResult(_0x1a0512,_0x17feab))[_0x7584('0x48')](handleError(_0x1a0512,null));};exports['show']=function(_0x22b70c,_0x9b90f3){var _0x5caf1f={'raw':!![],'where':{'id':_0x22b70c[_0x7584('0x49')]['id']}},_0x4544f8={};_0x4544f8[_0x7584('0x33')]=_[_0x7584('0x36')](db[_0x7584('0x2e')][_0x7584('0x2f')]);_0x4544f8[_0x7584('0x35')]=_[_0x7584('0x36')](_0x22b70c[_0x7584('0x35')]);_0x4544f8[_0x7584('0x37')]=_[_0x7584('0x38')](_0x4544f8[_0x7584('0x33')],_0x4544f8[_0x7584('0x35')]);_0x5caf1f['attributes']=_['intersection'](_0x4544f8[_0x7584('0x33')],qs[_0x7584('0x39')](_0x22b70c['query'][_0x7584('0x39')]));_0x5caf1f[_0x7584('0x3a')]=_0x5caf1f[_0x7584('0x3a')][_0x7584('0x3b')]?_0x5caf1f[_0x7584('0x3a')]:_0x4544f8[_0x7584('0x33')];if(_0x22b70c[_0x7584('0x35')]['includeAll']){_0x5caf1f[_0x7584('0x46')]=[{'all':!![]}];}_0x5caf1f=_[_0x7584('0x43')]({},_0x5caf1f,_0x22b70c['options']);return db['Pause'][_0x7584('0x4a')](_0x5caf1f)['then'](handleEntityNotFound(_0x9b90f3,null))[_0x7584('0x27')](respondWithResult(_0x9b90f3,null))[_0x7584('0x48')](handleError(_0x9b90f3,null));};exports[_0x7584('0x4b')]=function(_0x288a89,_0x247cd9){return db[_0x7584('0x2e')][_0x7584('0x4b')](_0x288a89['body'],{})[_0x7584('0x27')](function(_0x2759e1){var _0x393baf=_0x288a89['user'][_0x7584('0x28')]({'plain':!![]});if(!_0x393baf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x393baf[_0x7584('0x4c')]===_0x7584('0x4d')){var _0x462abe=_0x2759e1[_0x7584('0x28')]({'plain':!![]});var _0x53af7b='Pauses';return db[_0x7584('0x4e')]['find']({'where':{'name':_0x53af7b,'userProfileId':_0x393baf['userProfileId']},'raw':!![]})['then'](function(_0x463570){if(_0x463570&&_0x463570['autoAssociation']===0x0){return db['UserProfileResource'][_0x7584('0x4b')]({'name':_0x462abe[_0x7584('0x2d')],'resourceId':_0x462abe['id'],'type':_0x463570[_0x7584('0x2d')],'sectionId':_0x463570['id']},{})[_0x7584('0x27')](function(){return _0x2759e1;});}else{return _0x2759e1;}})[_0x7584('0x48')](function(_0x169bf0){logger[_0x7584('0x2b')](_0x7584('0x4f'),_0x169bf0);throw _0x169bf0;});}return _0x2759e1;})[_0x7584('0x27')](respondWithResult(_0x247cd9,0xc9))['catch'](handleError(_0x247cd9,null));};exports[_0x7584('0x25')]=function(_0x1acd44,_0x2134b1){if(_0x1acd44[_0x7584('0x50')]['id']){delete _0x1acd44[_0x7584('0x50')]['id'];}return db['Pause']['find']({'where':{'id':_0x1acd44[_0x7584('0x49')]['id']}})[_0x7584('0x27')](handleEntityNotFound(_0x2134b1,null))[_0x7584('0x27')](saveUpdates(_0x1acd44[_0x7584('0x50')],null))[_0x7584('0x27')](respondWithResult(_0x2134b1,null))[_0x7584('0x48')](handleError(_0x2134b1,null));};exports[_0x7584('0x26')]=function(_0x49f680,_0x25a39f){return db[_0x7584('0x2e')]['find']({'where':{'id':_0x49f680[_0x7584('0x49')]['id']}})[_0x7584('0x27')](handleEntityNotFound(_0x25a39f,null))[_0x7584('0x27')](removeEntity(_0x25a39f,null))[_0x7584('0x48')](handleError(_0x25a39f,null));};
\ No newline at end of file
+var _0x7bb4=['create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','squel','crypto','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','limit','Content-Range','apply','reject','save','update','then','destroy','Pauses','UserProfileResource','sendStatus','error','stack','name','map','Pause','type','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','filters','where','merge','VIRTUAL','filter','count','include','findAll','catch','show','params','rawAttributes','includeAll','options'];(function(_0x43dca4,_0x2d45b7){var _0xa31b28=function(_0x2ace68){while(--_0x2ace68){_0x43dca4['push'](_0x43dca4['shift']());}};_0xa31b28(++_0x2d45b7);}(_0x7bb4,0x14b));var _0x47bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7bb4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x47bb('0x0'));var rimraf=require(_0x47bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x47bb('0x2'));var moment=require(_0x47bb('0x3'));var BPromise=require(_0x47bb('0x4'));var Mustache=require(_0x47bb('0x5'));var util=require('util');var path=require(_0x47bb('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x47bb('0x7'));var fs=require('fs');var fs_extra=require(_0x47bb('0x8'));var _=require('lodash');var squel=require(_0x47bb('0x9'));var crypto=require(_0x47bb('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x47bb('0xb'));var querystring=require(_0x47bb('0xc'));var Papa=require('papaparse');var Redis=require(_0x47bb('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x47bb('0xe'));var as=require(_0x47bb('0xf'));var hardwareService=require(_0x47bb('0x10'));var logger=require(_0x47bb('0x11'))(_0x47bb('0x12'));var utils=require(_0x47bb('0x13'));var config=require(_0x47bb('0x14'));var licenseUtil=require(_0x47bb('0x15'));var db=require(_0x47bb('0x16'))['db'];function respondWithStatusCode(_0xe10085,_0x3aafe8){_0x3aafe8=_0x3aafe8||0xcc;return function(_0x2f5fd4){if(_0x2f5fd4){return _0xe10085['sendStatus'](_0x3aafe8);}return _0xe10085[_0x47bb('0x17')](_0x3aafe8)[_0x47bb('0x18')]();};}function respondWithResult(_0x25c5b7,_0x352ddf){_0x352ddf=_0x352ddf||0xc8;return function(_0x3b1ad4){if(_0x3b1ad4){return _0x25c5b7[_0x47bb('0x17')](_0x352ddf)[_0x47bb('0x19')](_0x3b1ad4);}};}function respondWithFilteredResult(_0x5c5dc2,_0x2cc9c6){return function(_0x59af3f){if(_0x59af3f){var _0x5b830c=typeof _0x2cc9c6['offset']==='undefined'&&typeof _0x2cc9c6['limit']===_0x47bb('0x1a');var _0x10330b=_0x59af3f['count'];var _0x1ae562=_0x5b830c?0x0:_0x2cc9c6[_0x47bb('0x1b')];var _0x3e2933=_0x5b830c?_0x59af3f['count']:_0x2cc9c6[_0x47bb('0x1b')]+_0x2cc9c6[_0x47bb('0x1c')];var _0x322a9c;if(_0x3e2933>=_0x10330b){_0x3e2933=_0x10330b;_0x322a9c=0xc8;}else{_0x322a9c=0xce;}_0x5c5dc2[_0x47bb('0x17')](_0x322a9c);return _0x5c5dc2['set'](_0x47bb('0x1d'),_0x1ae562+'-'+_0x3e2933+'/'+_0x10330b)[_0x47bb('0x19')](_0x59af3f);}return null;};}function patchUpdates(_0x425896){return function(_0x341101){try{jsonpatch[_0x47bb('0x1e')](_0x341101,_0x425896,!![]);}catch(_0x2490e6){return BPromise[_0x47bb('0x1f')](_0x2490e6);}return _0x341101[_0x47bb('0x20')]();};}function saveUpdates(_0x315e87,_0x425386){return function(_0x2d2ab2){if(_0x2d2ab2){return _0x2d2ab2[_0x47bb('0x21')](_0x315e87)[_0x47bb('0x22')](function(_0x45505a){return _0x45505a;});}return null;};}function removeEntity(_0x10f643,_0x27ca79){return function(_0x21e5af){if(_0x21e5af){return _0x21e5af[_0x47bb('0x23')]()[_0x47bb('0x22')](function(){var _0x50b93b=_0x21e5af['get']({'plain':!![]});var _0x3635e0=_0x47bb('0x24');return db[_0x47bb('0x25')][_0x47bb('0x23')]({'where':{'type':_0x3635e0,'resourceId':_0x50b93b['id']}})[_0x47bb('0x22')](function(){return _0x21e5af;});})[_0x47bb('0x22')](function(){_0x10f643[_0x47bb('0x17')](0xcc)[_0x47bb('0x18')]();});}};}function handleEntityNotFound(_0xa17cca,_0xd95953){return function(_0xae6d7b){if(!_0xae6d7b){_0xa17cca[_0x47bb('0x26')](0x194);}return _0xae6d7b;};}function handleError(_0x9b5c20,_0x2a4030){_0x2a4030=_0x2a4030||0x1f4;return function(_0x2c12d6){logger[_0x47bb('0x27')](_0x2c12d6[_0x47bb('0x28')]);if(_0x2c12d6[_0x47bb('0x29')]){delete _0x2c12d6[_0x47bb('0x29')];}_0x9b5c20['status'](_0x2a4030)['send'](_0x2c12d6);};}exports['index']=function(_0x5a4bb0,_0xcfe0fe){var _0x47ec48={},_0x4641a1={},_0x595268={'count':0x0,'rows':[]};var _0x458bd7=_[_0x47bb('0x2a')](db[_0x47bb('0x2b')]['rawAttributes'],function(_0x270608){return{'name':_0x270608['fieldName'],'type':_0x270608[_0x47bb('0x2c')]['key']};});_0x4641a1['model']=_[_0x47bb('0x2a')](_0x458bd7,_0x47bb('0x29'));_0x4641a1[_0x47bb('0x2d')]=_[_0x47bb('0x2e')](_0x5a4bb0[_0x47bb('0x2d')]);_0x4641a1['filters']=_[_0x47bb('0x2f')](_0x4641a1[_0x47bb('0x30')],_0x4641a1['query']);_0x47ec48['attributes']=_[_0x47bb('0x2f')](_0x4641a1[_0x47bb('0x30')],qs['fields'](_0x5a4bb0['query'][_0x47bb('0x31')]));_0x47ec48[_0x47bb('0x32')]=_0x47ec48['attributes'][_0x47bb('0x33')]?_0x47ec48[_0x47bb('0x32')]:_0x4641a1['model'];if(!_0x5a4bb0[_0x47bb('0x2d')]['hasOwnProperty'](_0x47bb('0x34'))){_0x47ec48['limit']=qs[_0x47bb('0x1c')](_0x5a4bb0['query'][_0x47bb('0x1c')]);_0x47ec48[_0x47bb('0x1b')]=qs[_0x47bb('0x1b')](_0x5a4bb0[_0x47bb('0x2d')][_0x47bb('0x1b')]);}_0x47ec48[_0x47bb('0x35')]=qs[_0x47bb('0x36')](_0x5a4bb0[_0x47bb('0x2d')]['sort']);_0x47ec48['where']=qs[_0x47bb('0x37')](_['pick'](_0x5a4bb0[_0x47bb('0x2d')],_0x4641a1[_0x47bb('0x37')]),_0x458bd7);if(_0x5a4bb0[_0x47bb('0x2d')]['filter']){_0x47ec48[_0x47bb('0x38')]=_[_0x47bb('0x39')](_0x47ec48[_0x47bb('0x38')],{'$or':_[_0x47bb('0x2a')](_0x458bd7,function(_0x3dce8f){if(_0x3dce8f[_0x47bb('0x2c')]!==_0x47bb('0x3a')){var _0x40c6f4={};_0x40c6f4[_0x3dce8f[_0x47bb('0x29')]]={'$like':'%'+_0x5a4bb0[_0x47bb('0x2d')][_0x47bb('0x3b')]+'%'};return _0x40c6f4;}})});}_0x47ec48=_[_0x47bb('0x39')]({},_0x47ec48,_0x5a4bb0['options']);var _0x1f86bc={'where':_0x47ec48['where']};return db[_0x47bb('0x2b')][_0x47bb('0x3c')](_0x1f86bc)[_0x47bb('0x22')](function(_0x3eef13){_0x595268['count']=_0x3eef13;if(_0x5a4bb0[_0x47bb('0x2d')]['includeAll']){_0x47ec48[_0x47bb('0x3d')]=[{'all':!![]}];}return db['Pause'][_0x47bb('0x3e')](_0x47ec48);})['then'](function(_0x504e68){_0x595268['rows']=_0x504e68;return _0x595268;})[_0x47bb('0x22')](respondWithFilteredResult(_0xcfe0fe,_0x47ec48))[_0x47bb('0x3f')](handleError(_0xcfe0fe,null));};exports[_0x47bb('0x40')]=function(_0x292394,_0xfac72a){var _0x439bb9={'raw':!![],'where':{'id':_0x292394[_0x47bb('0x41')]['id']}},_0x5c473b={};_0x5c473b['model']=_[_0x47bb('0x2e')](db[_0x47bb('0x2b')][_0x47bb('0x42')]);_0x5c473b['query']=_[_0x47bb('0x2e')](_0x292394['query']);_0x5c473b['filters']=_[_0x47bb('0x2f')](_0x5c473b[_0x47bb('0x30')],_0x5c473b[_0x47bb('0x2d')]);_0x439bb9[_0x47bb('0x32')]=_[_0x47bb('0x2f')](_0x5c473b['model'],qs['fields'](_0x292394['query'][_0x47bb('0x31')]));_0x439bb9[_0x47bb('0x32')]=_0x439bb9['attributes'][_0x47bb('0x33')]?_0x439bb9[_0x47bb('0x32')]:_0x5c473b[_0x47bb('0x30')];if(_0x292394['query'][_0x47bb('0x43')]){_0x439bb9[_0x47bb('0x3d')]=[{'all':!![]}];}_0x439bb9=_[_0x47bb('0x39')]({},_0x439bb9,_0x292394[_0x47bb('0x44')]);return db[_0x47bb('0x2b')]['find'](_0x439bb9)[_0x47bb('0x22')](handleEntityNotFound(_0xfac72a,null))['then'](respondWithResult(_0xfac72a,null))['catch'](handleError(_0xfac72a,null));};exports[_0x47bb('0x45')]=function(_0x5c0aa7,_0x972bbb){return db[_0x47bb('0x2b')][_0x47bb('0x45')](_0x5c0aa7['body'],{})[_0x47bb('0x22')](function(_0x21e7ac){var _0x588c6d=_0x5c0aa7[_0x47bb('0x46')][_0x47bb('0x47')]({'plain':!![]});if(!_0x588c6d)throw new Error(_0x47bb('0x48'));if(_0x588c6d[_0x47bb('0x49')]===_0x47bb('0x46')){var _0x505957=_0x21e7ac['get']({'plain':!![]});var _0x528e6a=_0x47bb('0x24');return db[_0x47bb('0x4a')][_0x47bb('0x4b')]({'where':{'name':_0x528e6a,'userProfileId':_0x588c6d[_0x47bb('0x4c')]},'raw':!![]})[_0x47bb('0x22')](function(_0x59e32d){if(_0x59e32d&&_0x59e32d[_0x47bb('0x4d')]===0x0){return db[_0x47bb('0x25')]['create']({'name':_0x505957[_0x47bb('0x29')],'resourceId':_0x505957['id'],'type':_0x59e32d[_0x47bb('0x29')],'sectionId':_0x59e32d['id']},{})[_0x47bb('0x22')](function(){return _0x21e7ac;});}else{return _0x21e7ac;}})[_0x47bb('0x3f')](function(_0x12ce36){logger[_0x47bb('0x27')](_0x47bb('0x4e'),_0x12ce36);throw _0x12ce36;});}return _0x21e7ac;})[_0x47bb('0x22')](respondWithResult(_0x972bbb,0xc9))[_0x47bb('0x3f')](handleError(_0x972bbb,null));};exports['update']=function(_0x25caad,_0x304dcb){if(_0x25caad[_0x47bb('0x4f')]['id']){delete _0x25caad['body']['id'];}return db[_0x47bb('0x2b')][_0x47bb('0x4b')]({'where':{'id':_0x25caad['params']['id']}})[_0x47bb('0x22')](handleEntityNotFound(_0x304dcb,null))[_0x47bb('0x22')](saveUpdates(_0x25caad[_0x47bb('0x4f')],null))[_0x47bb('0x22')](respondWithResult(_0x304dcb,null))[_0x47bb('0x3f')](handleError(_0x304dcb,null));};exports['destroy']=function(_0x2b57b7,_0x1d2325){return db[_0x47bb('0x2b')][_0x47bb('0x4b')]({'where':{'id':_0x2b57b7['params']['id']}})['then'](handleEntityNotFound(_0x1d2325,null))[_0x47bb('0x22')](removeEntity(_0x1d2325,null))[_0x47bb('0x3f')](handleError(_0x1d2325,null));};
\ No newline at end of file
index 648d3ed..b5b252b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','util'];(function(_0x501d00,_0x23c09b){var _0x909259=function(_0x333080){while(--_0x333080){_0x501d00['push'](_0x501d00['shift']());}};_0x909259(++_0x23c09b);}(_0x5fab,0x177));var _0xb5fa=function(_0x1121c6,_0x4b400d){_0x1121c6=_0x1121c6-0x0;var _0x207280=_0x5fab[_0x1121c6];return _0x207280;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xc4aa[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b827c0d..5ee810d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x47272a,_0x29b291){var _0x111896=function(_0x2b558e){while(--_0x2b558e){_0x47272a['push'](_0x47272a['shift']());}};_0x111896(++_0x29b291);}(_0xb10b,0x12a));var _0xbb10=function(_0x336030,_0x4086ea){_0x336030=_0x336030-0x0;var _0x2b203b=_0xb10b[_0x336030];return _0x2b203b;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x13320d,_0x3024b3){var _0x597e25=function(_0x48921f){while(--_0x48921f){_0x13320d['push'](_0x13320d['shift']());}};_0x597e25(++_0x3024b3);}(_0xb10b,0x12a));var _0xbb10=function(_0x250514,_0x389eda){_0x250514=_0x250514-0x0;var _0x59c25b=_0xb10b[_0x250514];return _0x59c25b;};'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 cacb30a..097c823 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3937=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','show','/:id/download','download','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','now','single','upload','post','webhookPost','update','delete','/:id','exports','multer'];(function(_0x4f6dc2,_0x1ed976){var _0x349317=function(_0x534ff4){while(--_0x534ff4){_0x4f6dc2['push'](_0x4f6dc2['shift']());}};_0x349317(++_0x1ed976);}(_0x3937,0xbf));var _0x7393=function(_0x14dfee,_0x1e1541){_0x14dfee=_0x14dfee-0x0;var _0x47820d=_0x3937[_0x14dfee];return _0x47820d;};'use strict';var multer=require(_0x7393('0x0'));var util=require('util');var path=require(_0x7393('0x1'));var timeout=require(_0x7393('0x2'));var express=require('express');var router=express[_0x7393('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7393('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7393('0x5'));var controller=require(_0x7393('0x6'));router[_0x7393('0x7')]('/',auth[_0x7393('0x8')](),controller[_0x7393('0x9')]);router[_0x7393('0x7')](_0x7393('0xa'),controller[_0x7393('0xb')]);router[_0x7393('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x7393('0xc')]);router[_0x7393('0x7')](_0x7393('0xd'),auth['isAuthenticated'](),controller[_0x7393('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56ed4c,_0x47c5c6,_0x497b6b){_0x497b6b(null,path[_0x7393('0xf')](config[_0x7393('0x10')],_0x7393('0x11')));},'filename':function(_0x4fb764,_0x79fc4e,_0x470f09){_0x79fc4e[_0x7393('0x12')]=_0x79fc4e[_0x7393('0x12')][_0x7393('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x470f09(null,util[_0x7393('0x14')](_0x7393('0x15'),path[_0x7393('0x16')](_0x79fc4e[_0x7393('0x12')],path['extname'](_0x79fc4e['originalname'])),Date[_0x7393('0x17')](),path['extname'](_0x79fc4e['originalname'])));}})});router['post']('/',upload[_0x7393('0x18')]('file'),controller[_0x7393('0x19')]);router[_0x7393('0x1a')]('/webhook',controller[_0x7393('0x1b')]);router['put']('/:id',auth[_0x7393('0x8')](),controller[_0x7393('0x1c')]);router[_0x7393('0x1d')](_0x7393('0x1e'),auth[_0x7393('0x8')](),controller[_0x7393('0x1d')]);module[_0x7393('0x1f')]=router;
\ No newline at end of file
+var _0xedd9=['/webhook','/:id','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','single','file','upload','webhookPost','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index'];(function(_0x3eb4f4,_0x5577b3){var _0x112974=function(_0x234d5d){while(--_0x234d5d){_0x3eb4f4['push'](_0x3eb4f4['shift']());}};_0x112974(++_0x5577b3);}(_0xedd9,0xfc));var _0x9edd=function(_0x354cf4,_0x3c3670){_0x354cf4=_0x354cf4-0x0;var _0x556908=_0xedd9[_0x354cf4];return _0x556908;};'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'),controller['webhookGet']);router[_0x9edd('0x9')](_0x9edd('0xd'),auth[_0x9edd('0xa')](),controller[_0x9edd('0xe')]);router['get'](_0x9edd('0xf'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);var upload=multer({'storage':multer[_0x9edd('0x11')]({'destination':function(_0x523026,_0xbf9da6,_0x13dc4f){_0x13dc4f(null,path['join'](config[_0x9edd('0x12')],_0x9edd('0x13')));},'filename':function(_0x25e64c,_0xfd544a,_0x287ddd){_0xfd544a[_0x9edd('0x14')]=_0xfd544a[_0x9edd('0x14')][_0x9edd('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x287ddd(null,util['format'](_0x9edd('0x16'),path[_0x9edd('0x17')](_0xfd544a[_0x9edd('0x14')],path[_0x9edd('0x18')](_0xfd544a[_0x9edd('0x14')])),Date[_0x9edd('0x19')](),path[_0x9edd('0x18')](_0xfd544a[_0x9edd('0x14')])));}})});router['post']('/',upload[_0x9edd('0x1a')](_0x9edd('0x1b')),controller[_0x9edd('0x1c')]);router['post'](_0x9edd('0xc'),controller[_0x9edd('0x1d')]);router[_0x9edd('0x1e')]('/:id',auth[_0x9edd('0xa')](),controller['update']);router[_0x9edd('0x1f')](_0x9edd('0xd'),auth['isAuthenticated'](),controller['delete']);module[_0x9edd('0x20')]=router;
\ No newline at end of file
index e1b30eb..059f260 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4d5=['agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','TEXT','adminOnly'];(function(_0x4c183a,_0x454596){var _0x534409=function(_0x11ced9){while(--_0x11ced9){_0x4c183a['push'](_0x4c183a['shift']());}};_0x534409(++_0x454596);}(_0xf4d5,0x19b));var _0x5f4d=function(_0x4d1431,_0xb96e16){_0x4d1431=_0x4d1431-0x0;var _0x594fd9=_0xf4d5[_0x4d1431];return _0x594fd9;};'use strict';var Sequelize=require(_0x5f4d('0x0'));module[_0x5f4d('0x1')]={'name':{'type':Sequelize[_0x5f4d('0x2')]},'type':{'type':Sequelize[_0x5f4d('0x3')](_0x5f4d('0x4'),'script')},'description':{'type':Sequelize[_0x5f4d('0x5')]},'version':{'type':Sequelize[_0x5f4d('0x5')]},'path':{'type':Sequelize[_0x5f4d('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x5f4d('0x3')](_0x5f4d('0x6'),_0x5f4d('0x7'),'always',_0x5f4d('0x8')),'defaultValue':_0x5f4d('0x9'),'comment':_0x5f4d('0xa')},'icon':{'type':Sequelize[_0x5f4d('0x2')]},'adminUrl':{'type':Sequelize[_0x5f4d('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x5f4d('0x2')]},'scriptPath':{'type':Sequelize[_0x5f4d('0x2')]}};
\ No newline at end of file
+var _0x065b=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING','sequelize','exports','script','TEXT'];(function(_0x4d7739,_0x3ae83d){var _0xe1390b=function(_0x22762d){while(--_0x22762d){_0x4d7739['push'](_0x4d7739['shift']());}};_0xe1390b(++_0x3ae83d);}(_0x065b,0x146));var _0xb065=function(_0x217a6f,_0x3ecd8b){_0x217a6f=_0x217a6f-0x0;var _0x5553f3=_0x065b[_0x217a6f];return _0x5553f3;};'use strict';var Sequelize=require(_0xb065('0x0'));module[_0xb065('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('html',_0xb065('0x2'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xb065('0x3')]},'path':{'type':Sequelize['STRING'],'comment':_0xb065('0x4')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb065('0x5')},'sidebar':{'type':Sequelize[_0xb065('0x6')](_0xb065('0x7'),'agentOnly',_0xb065('0x8'),'never'),'defaultValue':_0xb065('0x8'),'comment':_0xb065('0x9')},'icon':{'type':Sequelize[_0xb065('0xa')]},'adminUrl':{'type':Sequelize[_0xb065('0xa')]},'agentUrl':{'type':Sequelize[_0xb065('0xa')]},'scriptName':{'type':Sequelize[_0xb065('0xa')]},'scriptPath':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 9f10e71..4fb82be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe59a=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','extract-zip','archiver','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','status','error','stack','name','index','map','Plugin','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','params','length','find','catch','download','path','join','root','format','%s.zip','basename','createWriteStream','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','readdirSync','isFile','Invalid\x20plugin\x20structure','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv'];(function(_0xf6541e,_0x221dbf){var _0x24926c=function(_0xd1213e){while(--_0xd1213e){_0xf6541e['push'](_0xf6541e['shift']());}};_0x24926c(++_0x221dbf);}(_0xe59a,0xa5));var _0xae59=function(_0x47de12,_0x423cc6){_0x47de12=_0x47de12-0x0;var _0x222afd=_0xe59a[_0x47de12];return _0x222afd;};'use strict';var emlformat=require(_0xae59('0x0'));var rimraf=require(_0xae59('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xae59('0x2'));var rp=require(_0xae59('0x3'));var moment=require(_0xae59('0x4'));var BPromise=require(_0xae59('0x5'));var Mustache=require(_0xae59('0x6'));var util=require(_0xae59('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xae59('0x8'));var ejs=require(_0xae59('0x9'));var fs=require('fs');var fs_extra=require(_0xae59('0xa'));var _=require(_0xae59('0xb'));var squel=require(_0xae59('0xc'));var crypto=require(_0xae59('0xd'));var jsforce=require(_0xae59('0xe'));var deskjs=require(_0xae59('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0xae59('0x10'));var rimraf=require(_0xae59('0x1'));var archiver=require(_0xae59('0x11'));var Redis=require(_0xae59('0x12'));var authService=require(_0xae59('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae59('0x14'));var logger=require('../../config/logger')(_0xae59('0x15'));var utils=require(_0xae59('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xae59('0x17'));var db=require(_0xae59('0x18'))['db'];config['redis']=_[_0xae59('0x19')](config[_0xae59('0x1a')],{'host':_0xae59('0x1b'),'port':0x18eb});var socket=require(_0xae59('0x1c'))(new Redis(config[_0xae59('0x1a')]));require(_0xae59('0x1d'))[_0xae59('0x1e')](socket);function respondWithStatusCode(_0x12c727,_0x2cedba){_0x2cedba=_0x2cedba||0xcc;return function(_0x22f16a){if(_0x22f16a){return _0x12c727[_0xae59('0x1f')](_0x2cedba);}return _0x12c727['status'](_0x2cedba)[_0xae59('0x20')]();};}function respondWithResult(_0x360cf7,_0xc75580){_0xc75580=_0xc75580||0xc8;return function(_0x4aefd6){if(_0x4aefd6){return _0x360cf7['status'](_0xc75580)['json'](_0x4aefd6);}};}function respondWithFilteredResult(_0x12a4c5,_0x4fe0c1){return function(_0x93ecc6){if(_0x93ecc6){var _0x19eda4=typeof _0x4fe0c1[_0xae59('0x21')]==='undefined'&&typeof _0x4fe0c1[_0xae59('0x22')]===_0xae59('0x23');var _0x52030e=_0x93ecc6[_0xae59('0x24')];var _0x1d6e58=_0x19eda4?0x0:_0x4fe0c1[_0xae59('0x21')];var _0x700ea=_0x19eda4?_0x93ecc6[_0xae59('0x24')]:_0x4fe0c1[_0xae59('0x21')]+_0x4fe0c1[_0xae59('0x22')];var _0x20b833;if(_0x700ea>=_0x52030e){_0x700ea=_0x52030e;_0x20b833=0xc8;}else{_0x20b833=0xce;}_0x12a4c5['status'](_0x20b833);return _0x12a4c5[_0xae59('0x25')](_0xae59('0x26'),_0x1d6e58+'-'+_0x700ea+'/'+_0x52030e)[_0xae59('0x27')](_0x93ecc6);}return null;};}function patchUpdates(_0x12c79e){return function(_0x8bccc8){try{jsonpatch[_0xae59('0x28')](_0x8bccc8,_0x12c79e,!![]);}catch(_0x180a5d){return BPromise[_0xae59('0x29')](_0x180a5d);}return _0x8bccc8[_0xae59('0x2a')]();};}function saveUpdates(_0xa66187,_0x213768){return function(_0x26e32e){if(_0x26e32e){return _0x26e32e[_0xae59('0x2b')](_0xa66187)[_0xae59('0x2c')](function(_0x257849){return _0x257849;});}return null;};}function removeEntity(_0x11e4b7,_0x2aea2d){return function(_0x595e85){if(_0x595e85){return _0x595e85[_0xae59('0x2d')]()[_0xae59('0x2c')](function(){var _0x4111f6=_0x595e85[_0xae59('0x2e')]({'plain':!![]});var _0x1e060f=_0xae59('0x2f');return db[_0xae59('0x30')][_0xae59('0x2d')]({'where':{'type':_0x1e060f,'resourceId':_0x4111f6['id']}})[_0xae59('0x2c')](function(){return _0x595e85;});})[_0xae59('0x2c')](function(){_0x11e4b7[_0xae59('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x597abb,_0x583f5a){return function(_0x5bc6ee){if(!_0x5bc6ee){_0x597abb[_0xae59('0x1f')](0x194);}return _0x5bc6ee;};}function handleError(_0x157b2b,_0x4f578f){_0x4f578f=_0x4f578f||0x1f4;return function(_0xf26a79){logger[_0xae59('0x32')](_0xf26a79[_0xae59('0x33')]);if(_0xf26a79[_0xae59('0x34')]){delete _0xf26a79['name'];}_0x157b2b['status'](_0x4f578f)['send'](_0xf26a79);};}exports[_0xae59('0x35')]=function(_0x4a92bf,_0x3e4318){var _0x18097f={},_0x2677a4={},_0x26351d={'count':0x0,'rows':[]};var _0x42da90=_[_0xae59('0x36')](db[_0xae59('0x37')][_0xae59('0x38')],function(_0x200235){return{'name':_0x200235[_0xae59('0x39')],'type':_0x200235[_0xae59('0x3a')]['key']};});_0x2677a4[_0xae59('0x3b')]=_['map'](_0x42da90,_0xae59('0x34'));_0x2677a4[_0xae59('0x3c')]=_[_0xae59('0x3d')](_0x4a92bf[_0xae59('0x3c')]);_0x2677a4[_0xae59('0x3e')]=_['intersection'](_0x2677a4[_0xae59('0x3b')],_0x2677a4[_0xae59('0x3c')]);_0x18097f[_0xae59('0x3f')]=_[_0xae59('0x40')](_0x2677a4['model'],qs[_0xae59('0x41')](_0x4a92bf[_0xae59('0x3c')][_0xae59('0x41')]));_0x18097f[_0xae59('0x3f')]=_0x18097f[_0xae59('0x3f')]['length']?_0x18097f[_0xae59('0x3f')]:_0x2677a4['model'];if(!_0x4a92bf[_0xae59('0x3c')][_0xae59('0x42')](_0xae59('0x43'))){_0x18097f[_0xae59('0x22')]=qs[_0xae59('0x22')](_0x4a92bf['query'][_0xae59('0x22')]);_0x18097f['offset']=qs['offset'](_0x4a92bf['query']['offset']);}_0x18097f[_0xae59('0x44')]=qs['sort'](_0x4a92bf[_0xae59('0x3c')][_0xae59('0x45')]);_0x18097f[_0xae59('0x46')]=qs[_0xae59('0x3e')](_[_0xae59('0x47')](_0x4a92bf['query'],_0x2677a4[_0xae59('0x3e')]),_0x42da90);if(_0x4a92bf[_0xae59('0x3c')][_0xae59('0x48')]){_0x18097f[_0xae59('0x46')]=_[_0xae59('0x49')](_0x18097f['where'],{'$or':_['map'](_0x42da90,function(_0x2cb448){if(_0x2cb448['type']!=='VIRTUAL'){var _0x5793c8={};_0x5793c8[_0x2cb448['name']]={'$like':'%'+_0x4a92bf['query'][_0xae59('0x48')]+'%'};return _0x5793c8;}})});}_0x18097f=_[_0xae59('0x49')]({},_0x18097f,_0x4a92bf[_0xae59('0x4a')]);var _0x4bde62={'where':_0x18097f[_0xae59('0x46')]};return db[_0xae59('0x37')][_0xae59('0x24')](_0x4bde62)[_0xae59('0x2c')](function(_0x4f6054){_0x26351d[_0xae59('0x24')]=_0x4f6054;if(_0x4a92bf['query'][_0xae59('0x4b')]){_0x18097f[_0xae59('0x4c')]=[{'all':!![]}];}return db[_0xae59('0x37')]['findAll'](_0x18097f);})[_0xae59('0x2c')](function(_0x69f024){_0x26351d[_0xae59('0x4d')]=_0x69f024;return _0x26351d;})[_0xae59('0x2c')](respondWithFilteredResult(_0x3e4318,_0x18097f))['catch'](handleError(_0x3e4318,null));};exports['show']=function(_0x411ff0,_0x1c71a4){var _0x26116f={'raw':!![],'where':{'id':_0x411ff0[_0xae59('0x4e')]['id']}},_0x15c6ae={};_0x15c6ae[_0xae59('0x3b')]=_[_0xae59('0x3d')](db[_0xae59('0x37')]['rawAttributes']);_0x15c6ae[_0xae59('0x3c')]=_[_0xae59('0x3d')](_0x411ff0[_0xae59('0x3c')]);_0x15c6ae['filters']=_[_0xae59('0x40')](_0x15c6ae[_0xae59('0x3b')],_0x15c6ae['query']);_0x26116f[_0xae59('0x3f')]=_[_0xae59('0x40')](_0x15c6ae[_0xae59('0x3b')],qs[_0xae59('0x41')](_0x411ff0[_0xae59('0x3c')][_0xae59('0x41')]));_0x26116f[_0xae59('0x3f')]=_0x26116f[_0xae59('0x3f')][_0xae59('0x4f')]?_0x26116f['attributes']:_0x15c6ae[_0xae59('0x3b')];if(_0x411ff0[_0xae59('0x3c')]['includeAll']){_0x26116f[_0xae59('0x4c')]=[{'all':!![]}];}_0x26116f=_[_0xae59('0x49')]({},_0x26116f,_0x411ff0['options']);return db[_0xae59('0x37')][_0xae59('0x50')](_0x26116f)[_0xae59('0x2c')](handleEntityNotFound(_0x1c71a4,null))[_0xae59('0x2c')](respondWithResult(_0x1c71a4,null))[_0xae59('0x51')](handleError(_0x1c71a4,null));};exports[_0xae59('0x52')]=function(_0x3ad33f,_0x2d8bb5,_0x16f3bf){return db[_0xae59('0x37')]['find']({'where':{'id':_0x3ad33f[_0xae59('0x4e')]['id']},'attributes':[_0xae59('0x34'),_0xae59('0x53')],'raw':!![]})[_0xae59('0x2c')](handleEntityNotFound(_0x2d8bb5,null))[_0xae59('0x2c')](function(_0x47063c){if(_0x47063c){var _0x1f2c63=path[_0xae59('0x54')](config[_0xae59('0x55')],'server/files/plugins',util[_0xae59('0x56')](_0xae59('0x57'),path[_0xae59('0x58')](_0x47063c[_0xae59('0x53')])));var _0x5b9bb0=fs[_0xae59('0x59')](_0x1f2c63);var _0x3dbd5f=archiver('zip',{'zlib':{'level':0x9}});_0x3dbd5f['on']('warning',function(_0xa7fcb7){if(_0xa7fcb7[_0xae59('0x5a')]===_0xae59('0x5b')){logger[_0xae59('0x32')](_0xa7fcb7);}else{throw new db[(_0xae59('0x5c'))][(_0xae59('0x5d'))](_0xae59('0x5e'));}});_0x3dbd5f['on'](_0xae59('0x32'),function(_0x56098c){throw new db[(_0xae59('0x5c'))]['Error'](_0xae59('0x5e'));});_0x3dbd5f[_0xae59('0x5f')](_0x5b9bb0);_0x3dbd5f[_0xae59('0x60')](_0xae59('0x61'),{'cwd':path[_0xae59('0x54')](config[_0xae59('0x55')],_0xae59('0x62'),path[_0xae59('0x63')](_0x47063c[_0xae59('0x53')])),'ignore':[path['join'](path[_0xae59('0x58')](_0x47063c[_0xae59('0x53')]),_0xae59('0x64')),path[_0xae59('0x54')](path[_0xae59('0x58')](_0x47063c[_0xae59('0x53')]),_0xae59('0x65'))],'nodir':!![]})[_0xae59('0x66')]();_0x5b9bb0['on'](_0xae59('0x67'),function(){if(!fs[_0xae59('0x68')](_0x1f2c63)){throw new db[(_0xae59('0x5c'))][(_0xae59('0x5d'))]('Plugin\x20not\x20found');}return _0x2d8bb5['download'](_0x1f2c63,util['format'](_0xae59('0x57'),path['basename'](_0x47063c['path'])),function(_0x1ca987){if(_0x1ca987){throw new db[(_0xae59('0x5c'))]['Error'](_0xae59('0x69'));}fs[_0xae59('0x6a')](_0x1f2c63);logger[_0xae59('0x6b')](_0xae59('0x6c'));logger[_0xae59('0x6b')](_0xae59('0x6d'));});});}return null;})[_0xae59('0x51')](handleError(_0x2d8bb5,null));};exports[_0xae59('0x6e')]=function(_0x1c0e12,_0x5421ad,_0x3a9570){var _0x814421=path['basename'](_0x1c0e12[_0xae59('0x6f')][_0xae59('0x70')],path[_0xae59('0x71')](_0x1c0e12['file'][_0xae59('0x70')]));var _0x47f393=path['join'](config['root'],_0xae59('0x62'),_0x1c0e12[_0xae59('0x6f')][_0xae59('0x70')]);var _0x11ac96=path[_0xae59('0x54')](config['root'],_0xae59('0x62'),_0x814421);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x47f393);logger[_0xae59('0x6b')]('Plugin\x20upload\x20destination:\x20%s',_0x11ac96);try{fs['chmodSync'](_0x47f393,parseInt('0777',0x8));extract(_0x47f393,{'dir':_0x11ac96},function(_0x196dbd){if(_0x196dbd){logger[_0xae59('0x32')](_0x196dbd);handleError(_0x196dbd,!![]);};var _0x271ce7=fs[_0xae59('0x72')](_0x11ac96);if(_0x271ce7[_0xae59('0x4f')]>0x1){removeReferences(_0x47f393,_0x11ac96);logger[_0xae59('0x32')]('Invalid\x20plugin\x20structure');return _0x3a9570(new Error('Invalid\x20plugin\x20structure'));}var _0x2913b8=fs['lstatSync'](path[_0xae59('0x54')](_0x11ac96,_0x271ce7[0x0]));if(_0x2913b8[_0xae59('0x73')]()){removeReferences(_0x47f393,_0x11ac96);logger[_0xae59('0x32')](_0xae59('0x74'));return _0x3a9570(new Error(_0xae59('0x74')));}if(_0x2913b8['isDirectory']()){var _0xbe4096=fs[_0xae59('0x72')](path[_0xae59('0x54')](_0x11ac96,_0x271ce7[0x0]));if(_0xbe4096[_0xae59('0x4f')]===0x0){removeReferences(_0x47f393,_0x11ac96);logger[_0xae59('0x32')](_0xae59('0x74'));return _0x3a9570(new Error('Invalid\x20plugin\x20structure'));}var _0x55fe93=_0xbe4096[_0xae59('0x75')](function(_0x24959f){return _0x24959f===_0xae59('0x76');});if(!_0x55fe93){return _0x3a9570(new Error(_0xae59('0x77')));}var _0x29e79a=fs[_0xae59('0x78')](path[_0xae59('0x54')](_0x11ac96,_0x271ce7[0x0],_0xae59('0x76')));var _0x5ed9b8=JSON[_0xae59('0x79')](_0x29e79a);if(_0xae59('0x23')==typeof _0x5ed9b8[_0xae59('0x34')]){return _0x3a9570(new Error(_0xae59('0x7a')));}if(_0xae59('0x23')==typeof _0x5ed9b8[_0xae59('0x3a')]){return _0x3a9570(new Error(_0xae59('0x7b')));}if(_0xae59('0x23')==typeof _0x5ed9b8[_0xae59('0x7c')]){return _0x3a9570(new Error(_0xae59('0x7d')));}if(_0xae59('0x23')==typeof _0x5ed9b8[_0xae59('0x7e')]){return _0x3a9570(new Error(_0xae59('0x7f')));}if(_0x5ed9b8[_0xae59('0x3a')]===_0xae59('0x80')){if('undefined'==typeof _0x5ed9b8[_0xae59('0x7e')][_0xae59('0x81')]){return _0x3a9570(new Error(_0xae59('0x82')));}if(_0xae59('0x23')==typeof _0x5ed9b8[_0xae59('0x7e')][_0xae59('0x81')][_0xae59('0x83')]&&_0xae59('0x23')==typeof _0x5ed9b8[_0xae59('0x7e')][_0xae59('0x81')][_0xae59('0x84')]){return _0x3a9570(new Error(_0xae59('0x85')));}}else if(_0x5ed9b8[_0xae59('0x3a')]===_0xae59('0x86')){if('undefined'==typeof _0x5ed9b8[_0xae59('0x7e')][_0xae59('0x87')]){return _0x3a9570(new Error(_0xae59('0x88')));}if(_0xae59('0x23')==typeof _0x5ed9b8[_0xae59('0x7e')][_0xae59('0x89')]){return _0x3a9570(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x3a9570(new Error(_0xae59('0x8a')));}var _0x994331=_0x5ed9b8[_0xae59('0x34')];var _0x2fb271=_0x5ed9b8['description'];var _0x20e230=_0x5ed9b8['type'];var _0x3bb735=_0x5ed9b8[_0xae59('0x8b')]?_0x5ed9b8[_0xae59('0x8b')]:_0xae59('0x8c');var _0x314f2d=_0x5ed9b8[_0xae59('0x8d')]?_0x5ed9b8[_0xae59('0x8d')]:_0xae59('0x8e');var _0x43f414='';var _0x6dcac2='';var _0x510eed='';var _0x378c33='';var _0x1f5116=_0x5ed9b8[_0xae59('0x7c')];if(_0x20e230==='html'){if(_0xae59('0x23')!=typeof _0x5ed9b8[_0xae59('0x7e')]['views'][_0xae59('0x83')]){var _0x1a16cb=_0x5ed9b8[_0xae59('0x7e')][_0xae59('0x81')][_0xae59('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xae59('0x8f')](_0x1a16cb)){_0x43f414=path[_0xae59('0x54')]('plugins',_0x814421,_0x271ce7[0x0],_0x1a16cb);}else{_0x43f414=_0x1a16cb;}}else{logger[_0xae59('0x6b')](_0xae59('0x90'));}if(_0xae59('0x23')!=typeof _0x5ed9b8[_0xae59('0x7e')][_0xae59('0x81')][_0xae59('0x84')]){var _0x2d2a97=_0x5ed9b8[_0xae59('0x7e')][_0xae59('0x81')][_0xae59('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xae59('0x8f')](_0x2d2a97)){_0x6dcac2=path[_0xae59('0x54')](_0xae59('0x91'),_0x814421,_0x271ce7[0x0],_0x2d2a97);}else{_0x6dcac2=_0x2d2a97;}}else{logger['info'](_0xae59('0x92'));}}else if(_0x20e230==='script'){_0x510eed=_0x5ed9b8[_0xae59('0x7e')][_0xae59('0x87')];_0x378c33=_0x5ed9b8[_0xae59('0x7e')][_0xae59('0x89')];if(_0xae59('0x23')!=typeof _0x5ed9b8['parameters'][_0xae59('0x81')]){if(_0xae59('0x23')!=typeof _0x5ed9b8[_0xae59('0x7e')][_0xae59('0x81')][_0xae59('0x83')]){var _0x1a16cb=_0x5ed9b8[_0xae59('0x7e')][_0xae59('0x81')][_0xae59('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xae59('0x8f')](_0x1a16cb)){_0x43f414=path[_0xae59('0x54')](_0xae59('0x91'),_0x814421,_0x271ce7[0x0],_0x1a16cb);}else{_0x43f414=_0x1a16cb;}}if(_0xae59('0x23')!=typeof _0x5ed9b8[_0xae59('0x7e')][_0xae59('0x81')][_0xae59('0x84')]){var _0x2d2a97=_0x5ed9b8[_0xae59('0x7e')][_0xae59('0x81')][_0xae59('0x84')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2d2a97)){_0x6dcac2=path[_0xae59('0x54')]('plugins',_0x814421,_0x271ce7[0x0],_0x2d2a97);}else{_0x6dcac2=_0x2d2a97;}}}}var _0x48a598={'name':_0x994331,'description':_0x2fb271,'path':path['join'](_0x814421,_0x271ce7[0x0]),'type':_0x20e230,'sidebar':_0x3bb735,'icon':_0x314f2d,'adminUrl':_0x43f414,'agentUrl':_0x6dcac2,'scriptName':_0x510eed,'scriptPath':_0x378c33,'version':_0x1f5116};removeReferences(_0x47f393,null);return db[_0xae59('0x37')][_0xae59('0x93')](_0x48a598)[_0xae59('0x2c')](function(_0x16a5c5){var _0x108b07={'role':_0x1c0e12['body'][_0xae59('0x94')],'userProfileId':_0x1c0e12[_0xae59('0x95')][_0xae59('0x96')]};if(!_0x108b07)throw new Error(_0xae59('0x97'));if(_0x108b07[_0xae59('0x94')]==='user'){var _0x2b1c51=_0x16a5c5['get']({'plain':!![]});return db[_0xae59('0x98')][_0xae59('0x50')]({'where':{'name':_0xae59('0x2f'),'userProfileId':_0x108b07[_0xae59('0x96')]},'raw':!![]})[_0xae59('0x2c')](function(_0x568406){if(_0x568406&&_0x568406[_0xae59('0x99')]===0x0){return db[_0xae59('0x30')][_0xae59('0x93')]({'name':_0x2b1c51[_0xae59('0x34')],'resourceId':_0x2b1c51['id'],'type':_0x568406[_0xae59('0x34')],'sectionId':_0x568406['id']},{})[_0xae59('0x2c')](function(){return _0x16a5c5;});}else{return _0x16a5c5;}})[_0xae59('0x51')](function(_0x36e012){logger['error'](_0xae59('0x9a'),_0x36e012);throw _0x36e012;});}return _0x16a5c5;})[_0xae59('0x2c')](respondWithResult(_0x5421ad,null))[_0xae59('0x51')](handleError(_0x5421ad,null));}});}catch(_0x50cbd6){_0x5421ad['status'](0x1f4)[_0xae59('0x9b')](_0x50cbd6);}};function removeReferences(_0x4fceac,_0x458634){try{if(_0x4fceac){fs[_0xae59('0x6a')](_0x4fceac);logger[_0xae59('0x6b')](_0xae59('0x9c'));}if(_0x458634){rimraf(_0x458634,function(){});logger[_0xae59('0x6b')](_0xae59('0x9d'));}}catch(_0x2de30a){logger[_0xae59('0x32')](_0x2de30a);}}exports[_0xae59('0x2b')]=function(_0x7637eb,_0x418b39,_0x1cf348){return db[_0xae59('0x37')][_0xae59('0x50')]({'where':{'id':_0x7637eb[_0xae59('0x4e')]['id']}})[_0xae59('0x2c')](handleEntityNotFound(_0x418b39,null))[_0xae59('0x2c')](saveUpdates(_0x7637eb[_0xae59('0x95')],null))[_0xae59('0x2c')](respondWithResult(_0x418b39,null))[_0xae59('0x51')](handleError(_0x418b39,null));};exports[_0xae59('0x9e')]=function(_0x2007b8,_0xa3e7d8,_0x3f84be){return db['Plugin'][_0xae59('0x50')]({'where':{'id':_0x2007b8[_0xae59('0x4e')]['id']}})['then'](function(_0x28d27e){if(_0x28d27e){return _0x28d27e[_0xae59('0x2d')]();}})[_0xae59('0x2c')](function(_0x3e4967){rimraf(path[_0xae59('0x54')](config[_0xae59('0x55')],_0xae59('0x62'),path[_0xae59('0x63')](_0x3e4967[_0xae59('0x53')])),function(){});return _0x3e4967;})['then'](handleEntityNotFound(_0xa3e7d8,null))['then'](respondWithStatusCode(_0xa3e7d8,null))['catch'](handleError(_0xa3e7d8,null));};exports['webhookGet']=function(_0x54e70e,_0x5ec107,_0x29ca17){return BPromise[_0xae59('0x9f')]()[_0xae59('0x2c')](function(){if(!_0x54e70e['query'][_0xae59('0x53')]){throw new Error(_0xae59('0xa0'));}if(!_0x54e70e[_0xae59('0x3c')]['port']){throw new Error(_0xae59('0xa1'));}var _0x265d20=_0x54e70e[_0xae59('0x3c')][_0xae59('0xa2')]?_0x54e70e[_0xae59('0x3c')][_0xae59('0xa2')]+':'+_0x54e70e['query'][_0xae59('0xa3')]:_0xae59('0xa4')+_0x54e70e[_0xae59('0x3c')][_0xae59('0xa3')];var _0x51856d=_0x54e70e[_0xae59('0x3c')][_0xae59('0x27')]?_0x54e70e['query']['json']:!![];var _0x2f4cef=_0x54e70e['query'][_0xae59('0xa5')]?_0x54e70e[_0xae59('0x3c')]['encoding']:null;var _0x55b1a3={'method':_0x54e70e[_0xae59('0xa6')],'uri':util[_0xae59('0x56')](_0xae59('0xa7'),_0x265d20,_0x54e70e[_0xae59('0x3c')][_0xae59('0x53')]),'json':_0x51856d,'resolveWithFullResponse':!![],'encoding':_0x2f4cef,'qs':_0x54e70e[_0xae59('0x3c')]};if(_0x54e70e[_0xae59('0xa8')]){_0x55b1a3[_0xae59('0xa8')]=_0x54e70e['headers'];if(_0x55b1a3[_0xae59('0xa8')][_0xae59('0xa9')]){delete _0x55b1a3[_0xae59('0xa8')][_0xae59('0xa9')];}}if(_0x55b1a3[_0xae59('0xa8')]['content-type']){delete _0x55b1a3[_0xae59('0xa8')][_0xae59('0xaa')];}return rp(_0x55b1a3);})['then'](function(_0x503b25){if(_0x503b25){_0x5ec107[_0xae59('0x25')](_0x503b25[_0xae59('0xa8')]);logger[_0xae59('0x6b')](_0x503b25[_0xae59('0x95')]);if(_[_0xae59('0xab')](_0x54e70e['query'][_0xae59('0x53')],_0xae59('0x52'))&&_0x503b25[_0xae59('0xac')]==0x1f4){return _0x5ec107[_0xae59('0x1f')](_0x503b25[_0xae59('0xac')]);}else{return _0x5ec107[_0xae59('0x31')](_0x503b25[_0xae59('0xac')])[_0xae59('0x9b')](_0x503b25[_0xae59('0x95')]);}}else{return _0x5ec107[_0xae59('0x1f')](0xc8);}})[_0xae59('0x51')](handleError(_0x5ec107,null));};exports[_0xae59('0xad')]=function(_0x29c61f,_0x5cf435,_0x45b5c9){return BPromise[_0xae59('0x9f')]()['then'](function(){if(!_0x29c61f['query']['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x29c61f['query'][_0xae59('0xa3')]){throw new Error(_0xae59('0xa1'));}var _0x19e3ed=_0x29c61f[_0xae59('0x3c')][_0xae59('0xa2')]?_0x29c61f[_0xae59('0x3c')][_0xae59('0xa2')]+':'+_0x29c61f[_0xae59('0x3c')]['port']:_0xae59('0xa4')+_0x29c61f[_0xae59('0x3c')]['port'];var _0x5271a9=_0x29c61f[_0xae59('0x3c')]['json']?_0x29c61f[_0xae59('0x3c')][_0xae59('0x27')]:!![];var _0x415f68=_0x29c61f[_0xae59('0x3c')]['encoding']?_0x29c61f[_0xae59('0x3c')][_0xae59('0xa5')]:null;var _0x5a61cb={'method':_0x29c61f[_0xae59('0xa6')],'uri':util[_0xae59('0x56')](_0xae59('0xa7'),_0x19e3ed,_0x29c61f[_0xae59('0x3c')][_0xae59('0x53')]),'json':_0x5271a9,'resolveWithFullResponse':!![],'encoding':_0x415f68,'body':_0x29c61f[_0xae59('0x95')]};if(_0x29c61f[_0xae59('0xa8')]){_0x5a61cb[_0xae59('0xa8')]=_0x29c61f['headers'];if(_0x5a61cb[_0xae59('0xa8')][_0xae59('0xa9')]){delete _0x5a61cb[_0xae59('0xa8')][_0xae59('0xa9')];}}if(_0x5a61cb[_0xae59('0xa8')][_0xae59('0xaa')]){delete _0x5a61cb[_0xae59('0xa8')][_0xae59('0xaa')];}return rp(_0x5a61cb);})[_0xae59('0x2c')](function(_0x20dc8b){if(_0x20dc8b){_0x5cf435[_0xae59('0x25')](_0x20dc8b[_0xae59('0xa8')]);logger[_0xae59('0x6b')](_0x20dc8b['body']);return _0x5cf435['status'](_0x20dc8b[_0xae59('0xac')])[_0xae59('0x9b')](_0x20dc8b[_0xae59('0x95')]);}else{return _0x5cf435[_0xae59('0x1f')](0xc8);}})[_0xae59('0x51')](handleError(_0x5cf435,null));};
\ No newline at end of file
+var _0xc6a4=['type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','Plugin','include','findAll','rows','catch','show','params','includeAll','find','download','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','dirname','finalize','close','existsSync','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','undefined','version','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','http://localhost:','method','eml-format','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','extract-zip','rimraf','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','json','offset','count','limit','Content-Range','reject','save','then','destroy','Plugins','end','error','stack','status','send','index','map','rawAttributes','fieldName'];(function(_0x5717e2,_0x3f2cc5){var _0x1a5466=function(_0x192cca){while(--_0x192cca){_0x5717e2['push'](_0x5717e2['shift']());}};_0x1a5466(++_0x3f2cc5);}(_0xc6a4,0x7d));var _0x4c6a=function(_0x425d11,_0x2ead50){_0x425d11=_0x425d11-0x0;var _0x37b976=_0xc6a4[_0x425d11];return _0x37b976;};'use strict';var emlformat=require(_0x4c6a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4c6a('0x1'));var util=require(_0x4c6a('0x2'));var path=require(_0x4c6a('0x3'));var sox=require(_0x4c6a('0x4'));var csv=require(_0x4c6a('0x5'));var ejs=require(_0x4c6a('0x6'));var fs=require('fs');var fs_extra=require(_0x4c6a('0x7'));var _=require(_0x4c6a('0x8'));var squel=require(_0x4c6a('0x9'));var crypto=require(_0x4c6a('0xa'));var jsforce=require(_0x4c6a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4c6a('0x5'));var querystring=require(_0x4c6a('0xc'));var Papa=require('papaparse');var extract=require(_0x4c6a('0xd'));var rimraf=require(_0x4c6a('0xe'));var archiver=require(_0x4c6a('0xf'));var Redis=require('ioredis');var authService=require(_0x4c6a('0x10'));var qs=require(_0x4c6a('0x11'));var as=require(_0x4c6a('0x12'));var hardwareService=require(_0x4c6a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x4c6a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4c6a('0x15'));var db=require('../../mysqldb')['db'];config[_0x4c6a('0x16')]=_[_0x4c6a('0x17')](config[_0x4c6a('0x16')],{'host':_0x4c6a('0x18'),'port':0x18eb});var socket=require(_0x4c6a('0x19'))(new Redis(config['redis']));require(_0x4c6a('0x1a'))[_0x4c6a('0x1b')](socket);function respondWithStatusCode(_0x3ed101,_0x5a4443){_0x5a4443=_0x5a4443||0xcc;return function(_0x2bd586){if(_0x2bd586){return _0x3ed101[_0x4c6a('0x1c')](_0x5a4443);}return _0x3ed101['status'](_0x5a4443)['end']();};}function respondWithResult(_0xa70e14,_0x300e82){_0x300e82=_0x300e82||0xc8;return function(_0x46fa1e){if(_0x46fa1e){return _0xa70e14['status'](_0x300e82)[_0x4c6a('0x1d')](_0x46fa1e);}};}function respondWithFilteredResult(_0x18dedd,_0x51051f){return function(_0x515459){if(_0x515459){var _0x3dc128=typeof _0x51051f[_0x4c6a('0x1e')]==='undefined'&&typeof _0x51051f['limit']==='undefined';var _0x5ac246=_0x515459[_0x4c6a('0x1f')];var _0x4b9095=_0x3dc128?0x0:_0x51051f['offset'];var _0x3e646e=_0x3dc128?_0x515459['count']:_0x51051f[_0x4c6a('0x1e')]+_0x51051f[_0x4c6a('0x20')];var _0x10f0b3;if(_0x3e646e>=_0x5ac246){_0x3e646e=_0x5ac246;_0x10f0b3=0xc8;}else{_0x10f0b3=0xce;}_0x18dedd['status'](_0x10f0b3);return _0x18dedd['set'](_0x4c6a('0x21'),_0x4b9095+'-'+_0x3e646e+'/'+_0x5ac246)[_0x4c6a('0x1d')](_0x515459);}return null;};}function patchUpdates(_0x552a32){return function(_0x38a2b6){try{jsonpatch['apply'](_0x38a2b6,_0x552a32,!![]);}catch(_0x933948){return BPromise[_0x4c6a('0x22')](_0x933948);}return _0x38a2b6[_0x4c6a('0x23')]();};}function saveUpdates(_0x135dc8,_0x193151){return function(_0x5a1ec5){if(_0x5a1ec5){return _0x5a1ec5['update'](_0x135dc8)[_0x4c6a('0x24')](function(_0x32cd85){return _0x32cd85;});}return null;};}function removeEntity(_0x45bedd,_0xc03cec){return function(_0xaace49){if(_0xaace49){return _0xaace49[_0x4c6a('0x25')]()[_0x4c6a('0x24')](function(){var _0xc00ba9=_0xaace49['get']({'plain':!![]});var _0x1cabb5=_0x4c6a('0x26');return db['UserProfileResource'][_0x4c6a('0x25')]({'where':{'type':_0x1cabb5,'resourceId':_0xc00ba9['id']}})[_0x4c6a('0x24')](function(){return _0xaace49;});})[_0x4c6a('0x24')](function(){_0x45bedd['status'](0xcc)[_0x4c6a('0x27')]();});}};}function handleEntityNotFound(_0x327b60,_0x3e8b5d){return function(_0x3c2b59){if(!_0x3c2b59){_0x327b60[_0x4c6a('0x1c')](0x194);}return _0x3c2b59;};}function handleError(_0x40f904,_0x38e40c){_0x38e40c=_0x38e40c||0x1f4;return function(_0x2dbb7c){logger[_0x4c6a('0x28')](_0x2dbb7c[_0x4c6a('0x29')]);if(_0x2dbb7c['name']){delete _0x2dbb7c['name'];}_0x40f904[_0x4c6a('0x2a')](_0x38e40c)[_0x4c6a('0x2b')](_0x2dbb7c);};}exports[_0x4c6a('0x2c')]=function(_0x34d397,_0x1cfe80){var _0x306609={},_0xd20de0={},_0x19da95={'count':0x0,'rows':[]};var _0x18cdc0=_[_0x4c6a('0x2d')](db['Plugin'][_0x4c6a('0x2e')],function(_0xc215c6){return{'name':_0xc215c6[_0x4c6a('0x2f')],'type':_0xc215c6[_0x4c6a('0x30')][_0x4c6a('0x31')]};});_0xd20de0[_0x4c6a('0x32')]=_[_0x4c6a('0x2d')](_0x18cdc0,_0x4c6a('0x33'));_0xd20de0[_0x4c6a('0x34')]=_[_0x4c6a('0x35')](_0x34d397['query']);_0xd20de0['filters']=_[_0x4c6a('0x36')](_0xd20de0[_0x4c6a('0x32')],_0xd20de0['query']);_0x306609[_0x4c6a('0x37')]=_[_0x4c6a('0x36')](_0xd20de0[_0x4c6a('0x32')],qs[_0x4c6a('0x38')](_0x34d397['query']['fields']));_0x306609['attributes']=_0x306609['attributes'][_0x4c6a('0x39')]?_0x306609[_0x4c6a('0x37')]:_0xd20de0[_0x4c6a('0x32')];if(!_0x34d397[_0x4c6a('0x34')][_0x4c6a('0x3a')](_0x4c6a('0x3b'))){_0x306609[_0x4c6a('0x20')]=qs[_0x4c6a('0x20')](_0x34d397[_0x4c6a('0x34')][_0x4c6a('0x20')]);_0x306609[_0x4c6a('0x1e')]=qs[_0x4c6a('0x1e')](_0x34d397[_0x4c6a('0x34')]['offset']);}_0x306609[_0x4c6a('0x3c')]=qs[_0x4c6a('0x3d')](_0x34d397['query'][_0x4c6a('0x3d')]);_0x306609[_0x4c6a('0x3e')]=qs['filters'](_[_0x4c6a('0x3f')](_0x34d397[_0x4c6a('0x34')],_0xd20de0[_0x4c6a('0x40')]),_0x18cdc0);if(_0x34d397['query'][_0x4c6a('0x41')]){_0x306609['where']=_[_0x4c6a('0x42')](_0x306609[_0x4c6a('0x3e')],{'$or':_[_0x4c6a('0x2d')](_0x18cdc0,function(_0x53cb47){if(_0x53cb47[_0x4c6a('0x30')]!==_0x4c6a('0x43')){var _0x2f3cfa={};_0x2f3cfa[_0x53cb47[_0x4c6a('0x33')]]={'$like':'%'+_0x34d397[_0x4c6a('0x34')]['filter']+'%'};return _0x2f3cfa;}})});}_0x306609=_[_0x4c6a('0x42')]({},_0x306609,_0x34d397[_0x4c6a('0x44')]);var _0x3ffed4={'where':_0x306609['where']};return db[_0x4c6a('0x45')][_0x4c6a('0x1f')](_0x3ffed4)['then'](function(_0x49361a){_0x19da95[_0x4c6a('0x1f')]=_0x49361a;if(_0x34d397[_0x4c6a('0x34')]['includeAll']){_0x306609[_0x4c6a('0x46')]=[{'all':!![]}];}return db[_0x4c6a('0x45')][_0x4c6a('0x47')](_0x306609);})[_0x4c6a('0x24')](function(_0x36b413){_0x19da95[_0x4c6a('0x48')]=_0x36b413;return _0x19da95;})['then'](respondWithFilteredResult(_0x1cfe80,_0x306609))[_0x4c6a('0x49')](handleError(_0x1cfe80,null));};exports[_0x4c6a('0x4a')]=function(_0xd2c253,_0x84ce02){var _0x204b6f={'raw':!![],'where':{'id':_0xd2c253[_0x4c6a('0x4b')]['id']}},_0xab154e={};_0xab154e[_0x4c6a('0x32')]=_[_0x4c6a('0x35')](db[_0x4c6a('0x45')][_0x4c6a('0x2e')]);_0xab154e[_0x4c6a('0x34')]=_['keys'](_0xd2c253['query']);_0xab154e[_0x4c6a('0x40')]=_[_0x4c6a('0x36')](_0xab154e[_0x4c6a('0x32')],_0xab154e[_0x4c6a('0x34')]);_0x204b6f[_0x4c6a('0x37')]=_['intersection'](_0xab154e[_0x4c6a('0x32')],qs[_0x4c6a('0x38')](_0xd2c253[_0x4c6a('0x34')]['fields']));_0x204b6f['attributes']=_0x204b6f[_0x4c6a('0x37')][_0x4c6a('0x39')]?_0x204b6f[_0x4c6a('0x37')]:_0xab154e[_0x4c6a('0x32')];if(_0xd2c253['query'][_0x4c6a('0x4c')]){_0x204b6f[_0x4c6a('0x46')]=[{'all':!![]}];}_0x204b6f=_[_0x4c6a('0x42')]({},_0x204b6f,_0xd2c253['options']);return db[_0x4c6a('0x45')][_0x4c6a('0x4d')](_0x204b6f)['then'](handleEntityNotFound(_0x84ce02,null))['then'](respondWithResult(_0x84ce02,null))[_0x4c6a('0x49')](handleError(_0x84ce02,null));};exports[_0x4c6a('0x4e')]=function(_0x2f711a,_0x5b702,_0x32f64a){return db[_0x4c6a('0x45')][_0x4c6a('0x4d')]({'where':{'id':_0x2f711a['params']['id']},'attributes':[_0x4c6a('0x33'),_0x4c6a('0x3')],'raw':!![]})[_0x4c6a('0x24')](handleEntityNotFound(_0x5b702,null))[_0x4c6a('0x24')](function(_0x18cd5e){if(_0x18cd5e){var _0x45fdc8=path[_0x4c6a('0x4f')](config[_0x4c6a('0x50')],_0x4c6a('0x51'),util[_0x4c6a('0x52')](_0x4c6a('0x53'),path[_0x4c6a('0x54')](_0x18cd5e[_0x4c6a('0x3')])));var _0x27dfcc=fs[_0x4c6a('0x55')](_0x45fdc8);var _0x20f32d=archiver(_0x4c6a('0x56'),{'zlib':{'level':0x9}});_0x20f32d['on'](_0x4c6a('0x57'),function(_0x3bdaf2){if(_0x3bdaf2[_0x4c6a('0x58')]==='ENOENT'){logger[_0x4c6a('0x28')](_0x3bdaf2);}else{throw new db[(_0x4c6a('0x59'))][(_0x4c6a('0x5a'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x20f32d['on'](_0x4c6a('0x28'),function(_0x2ef017){throw new db[(_0x4c6a('0x59'))][(_0x4c6a('0x5a'))](_0x4c6a('0x5b'));});_0x20f32d[_0x4c6a('0x5c')](_0x27dfcc);_0x20f32d['glob'](_0x4c6a('0x5d'),{'cwd':path[_0x4c6a('0x4f')](config[_0x4c6a('0x50')],'server/files/plugins',path[_0x4c6a('0x5e')](_0x18cd5e[_0x4c6a('0x3')])),'ignore':[path[_0x4c6a('0x4f')](path[_0x4c6a('0x54')](_0x18cd5e['path']),'node_modules/**/*'),path[_0x4c6a('0x4f')](path['basename'](_0x18cd5e[_0x4c6a('0x3')]),'attachments/**/*')],'nodir':!![]})[_0x4c6a('0x5f')]();_0x27dfcc['on'](_0x4c6a('0x60'),function(){if(!fs[_0x4c6a('0x61')](_0x45fdc8)){throw new db[(_0x4c6a('0x59'))][(_0x4c6a('0x5a'))]('Plugin\x20not\x20found');}return _0x5b702[_0x4c6a('0x4e')](_0x45fdc8,util['format'](_0x4c6a('0x53'),path[_0x4c6a('0x54')](_0x18cd5e[_0x4c6a('0x3')])),function(_0x918e84){if(_0x918e84){throw new db[(_0x4c6a('0x59'))][(_0x4c6a('0x5a'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x4c6a('0x62')](_0x45fdc8);logger[_0x4c6a('0x63')](_0x4c6a('0x64'));logger['info'](_0x4c6a('0x65'));});});}return null;})[_0x4c6a('0x49')](handleError(_0x5b702,null));};exports[_0x4c6a('0x66')]=function(_0x19396c,_0x3a91b5,_0x24a1b1){var _0x4d78cb=path['basename'](_0x19396c[_0x4c6a('0x67')][_0x4c6a('0x68')],path[_0x4c6a('0x69')](_0x19396c[_0x4c6a('0x67')]['filename']));var _0x3d90a0=path['join'](config['root'],_0x4c6a('0x51'),_0x19396c[_0x4c6a('0x67')][_0x4c6a('0x68')]);var _0x5e3c2c=path[_0x4c6a('0x4f')](config[_0x4c6a('0x50')],'server/files/plugins',_0x4d78cb);logger[_0x4c6a('0x63')](_0x4c6a('0x6a'),_0x3d90a0);logger[_0x4c6a('0x63')](_0x4c6a('0x6b'),_0x5e3c2c);try{fs[_0x4c6a('0x6c')](_0x3d90a0,parseInt('0777',0x8));extract(_0x3d90a0,{'dir':_0x5e3c2c},function(_0x160ca6){if(_0x160ca6){logger[_0x4c6a('0x28')](_0x160ca6);handleError(_0x160ca6,!![]);};var _0x5510bb=fs[_0x4c6a('0x6d')](_0x5e3c2c);if(_0x5510bb[_0x4c6a('0x39')]>0x1){removeReferences(_0x3d90a0,_0x5e3c2c);logger[_0x4c6a('0x28')](_0x4c6a('0x6e'));return _0x24a1b1(new Error('Invalid\x20plugin\x20structure'));}var _0x4762ad=fs[_0x4c6a('0x6f')](path['join'](_0x5e3c2c,_0x5510bb[0x0]));if(_0x4762ad['isFile']()){removeReferences(_0x3d90a0,_0x5e3c2c);logger['error']('Invalid\x20plugin\x20structure');return _0x24a1b1(new Error(_0x4c6a('0x6e')));}if(_0x4762ad[_0x4c6a('0x70')]()){var _0x54a0c7=fs[_0x4c6a('0x6d')](path['join'](_0x5e3c2c,_0x5510bb[0x0]));if(_0x54a0c7[_0x4c6a('0x39')]===0x0){removeReferences(_0x3d90a0,_0x5e3c2c);logger['error'](_0x4c6a('0x6e'));return _0x24a1b1(new Error(_0x4c6a('0x6e')));}var _0xfb08f1=_0x54a0c7[_0x4c6a('0x71')](function(_0x27b057){return _0x27b057===_0x4c6a('0x72');});if(!_0xfb08f1){return _0x24a1b1(new Error(_0x4c6a('0x73')));}var _0xaf9349=fs[_0x4c6a('0x74')](path[_0x4c6a('0x4f')](_0x5e3c2c,_0x5510bb[0x0],'manifest.json'));var _0x42e055=JSON[_0x4c6a('0x75')](_0xaf9349);if('undefined'==typeof _0x42e055[_0x4c6a('0x33')]){return _0x24a1b1(new Error(_0x4c6a('0x76')));}if('undefined'==typeof _0x42e055[_0x4c6a('0x30')]){return _0x24a1b1(new Error(_0x4c6a('0x77')));}if(_0x4c6a('0x78')==typeof _0x42e055[_0x4c6a('0x79')]){return _0x24a1b1(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x42e055['parameters']){return _0x24a1b1(new Error(_0x4c6a('0x7a')));}if(_0x42e055[_0x4c6a('0x30')]===_0x4c6a('0x7b')){if(_0x4c6a('0x78')==typeof _0x42e055[_0x4c6a('0x7c')][_0x4c6a('0x7d')]){return _0x24a1b1(new Error(_0x4c6a('0x7e')));}if('undefined'==typeof _0x42e055[_0x4c6a('0x7c')]['views'][_0x4c6a('0x7f')]&&_0x4c6a('0x78')==typeof _0x42e055[_0x4c6a('0x7c')][_0x4c6a('0x7d')][_0x4c6a('0x80')]){return _0x24a1b1(new Error(_0x4c6a('0x81')));}}else if(_0x42e055[_0x4c6a('0x30')]===_0x4c6a('0x82')){if('undefined'==typeof _0x42e055[_0x4c6a('0x7c')]['scriptName']){return _0x24a1b1(new Error(_0x4c6a('0x83')));}if(_0x4c6a('0x78')==typeof _0x42e055[_0x4c6a('0x7c')][_0x4c6a('0x84')]){return _0x24a1b1(new Error(_0x4c6a('0x85')));}}else{return _0x24a1b1(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x2ca2aa=_0x42e055[_0x4c6a('0x33')];var _0x4beab9=_0x42e055[_0x4c6a('0x86')];var _0x264069=_0x42e055[_0x4c6a('0x30')];var _0x4bbd26=_0x42e055[_0x4c6a('0x87')]?_0x42e055[_0x4c6a('0x87')]:'always';var _0x15699e=_0x42e055['icon']?_0x42e055[_0x4c6a('0x88')]:_0x4c6a('0x89');var _0x510071='';var _0x401d45='';var _0x10ee7a='';var _0x4c7cd3='';var _0x394ec4=_0x42e055[_0x4c6a('0x79')];if(_0x264069===_0x4c6a('0x7b')){if(_0x4c6a('0x78')!=typeof _0x42e055[_0x4c6a('0x7c')][_0x4c6a('0x7d')][_0x4c6a('0x7f')]){var _0x4e47c0=_0x42e055['parameters'][_0x4c6a('0x7d')][_0x4c6a('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x4c6a('0x8a')](_0x4e47c0)){_0x510071=path[_0x4c6a('0x4f')](_0x4c6a('0x8b'),_0x4d78cb,_0x5510bb[0x0],_0x4e47c0);}else{_0x510071=_0x4e47c0;}}else{logger[_0x4c6a('0x63')](_0x4c6a('0x8c'));}if('undefined'!=typeof _0x42e055['parameters']['views'][_0x4c6a('0x80')]){var _0x161280=_0x42e055[_0x4c6a('0x7c')][_0x4c6a('0x7d')][_0x4c6a('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x4c6a('0x8a')](_0x161280)){_0x401d45=path[_0x4c6a('0x4f')](_0x4c6a('0x8b'),_0x4d78cb,_0x5510bb[0x0],_0x161280);}else{_0x401d45=_0x161280;}}else{logger[_0x4c6a('0x63')](_0x4c6a('0x8d'));}}else if(_0x264069===_0x4c6a('0x82')){_0x10ee7a=_0x42e055['parameters'][_0x4c6a('0x8e')];_0x4c7cd3=_0x42e055[_0x4c6a('0x7c')]['scriptPath'];if(_0x4c6a('0x78')!=typeof _0x42e055[_0x4c6a('0x7c')][_0x4c6a('0x7d')]){if(_0x4c6a('0x78')!=typeof _0x42e055['parameters']['views'][_0x4c6a('0x7f')]){var _0x4e47c0=_0x42e055[_0x4c6a('0x7c')][_0x4c6a('0x7d')][_0x4c6a('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x4c6a('0x8a')](_0x4e47c0)){_0x510071=path['join'](_0x4c6a('0x8b'),_0x4d78cb,_0x5510bb[0x0],_0x4e47c0);}else{_0x510071=_0x4e47c0;}}if('undefined'!=typeof _0x42e055[_0x4c6a('0x7c')]['views'][_0x4c6a('0x80')]){var _0x161280=_0x42e055[_0x4c6a('0x7c')][_0x4c6a('0x7d')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x4c6a('0x8a')](_0x161280)){_0x401d45=path[_0x4c6a('0x4f')](_0x4c6a('0x8b'),_0x4d78cb,_0x5510bb[0x0],_0x161280);}else{_0x401d45=_0x161280;}}}}var _0x29e4e7={'name':_0x2ca2aa,'description':_0x4beab9,'path':path['join'](_0x4d78cb,_0x5510bb[0x0]),'type':_0x264069,'sidebar':_0x4bbd26,'icon':_0x15699e,'adminUrl':_0x510071,'agentUrl':_0x401d45,'scriptName':_0x10ee7a,'scriptPath':_0x4c7cd3,'version':_0x394ec4};removeReferences(_0x3d90a0,null);return db[_0x4c6a('0x45')][_0x4c6a('0x8f')](_0x29e4e7)['then'](function(_0xb2d18f){var _0x58ebee={'role':_0x19396c[_0x4c6a('0x90')][_0x4c6a('0x91')],'userProfileId':_0x19396c['body'][_0x4c6a('0x92')]};if(!_0x58ebee)throw new Error(_0x4c6a('0x93'));if(_0x58ebee[_0x4c6a('0x91')]==='user'){var _0x54581a=_0xb2d18f[_0x4c6a('0x94')]({'plain':!![]});return db[_0x4c6a('0x95')][_0x4c6a('0x4d')]({'where':{'name':_0x4c6a('0x26'),'userProfileId':_0x58ebee[_0x4c6a('0x92')]},'raw':!![]})[_0x4c6a('0x24')](function(_0x23541b){if(_0x23541b&&_0x23541b[_0x4c6a('0x96')]===0x0){return db[_0x4c6a('0x97')][_0x4c6a('0x8f')]({'name':_0x54581a[_0x4c6a('0x33')],'resourceId':_0x54581a['id'],'type':_0x23541b[_0x4c6a('0x33')],'sectionId':_0x23541b['id']},{})[_0x4c6a('0x24')](function(){return _0xb2d18f;});}else{return _0xb2d18f;}})[_0x4c6a('0x49')](function(_0x588b47){logger[_0x4c6a('0x28')](_0x4c6a('0x98'),_0x588b47);throw _0x588b47;});}return _0xb2d18f;})['then'](respondWithResult(_0x3a91b5,null))['catch'](handleError(_0x3a91b5,null));}});}catch(_0x1f1216){_0x3a91b5[_0x4c6a('0x2a')](0x1f4)['send'](_0x1f1216);}};function removeReferences(_0x2e0732,_0x3b17d6){try{if(_0x2e0732){fs[_0x4c6a('0x62')](_0x2e0732);logger['info'](_0x4c6a('0x99'));}if(_0x3b17d6){rimraf(_0x3b17d6,function(){});logger[_0x4c6a('0x63')](_0x4c6a('0x9a'));}}catch(_0x438ca1){logger[_0x4c6a('0x28')](_0x438ca1);}}exports[_0x4c6a('0x9b')]=function(_0x52aa30,_0x347b4e,_0x2c15b9){return db[_0x4c6a('0x45')][_0x4c6a('0x4d')]({'where':{'id':_0x52aa30['params']['id']}})[_0x4c6a('0x24')](handleEntityNotFound(_0x347b4e,null))['then'](saveUpdates(_0x52aa30[_0x4c6a('0x90')],null))[_0x4c6a('0x24')](respondWithResult(_0x347b4e,null))['catch'](handleError(_0x347b4e,null));};exports[_0x4c6a('0x9c')]=function(_0x4919bf,_0x256c17,_0x24295c){return db[_0x4c6a('0x45')][_0x4c6a('0x4d')]({'where':{'id':_0x4919bf[_0x4c6a('0x4b')]['id']}})['then'](function(_0x3434a2){if(_0x3434a2){return _0x3434a2[_0x4c6a('0x25')]();}})[_0x4c6a('0x24')](function(_0x434fe9){rimraf(path['join'](config[_0x4c6a('0x50')],_0x4c6a('0x51'),path[_0x4c6a('0x5e')](_0x434fe9['path'])),function(){});return _0x434fe9;})[_0x4c6a('0x24')](handleEntityNotFound(_0x256c17,null))[_0x4c6a('0x24')](respondWithStatusCode(_0x256c17,null))[_0x4c6a('0x49')](handleError(_0x256c17,null));};exports[_0x4c6a('0x9d')]=function(_0x5749ef,_0x19a51f,_0x2b95f2){return BPromise[_0x4c6a('0x9e')]()[_0x4c6a('0x24')](function(){if(!_0x5749ef[_0x4c6a('0x34')][_0x4c6a('0x3')]){throw new Error(_0x4c6a('0x9f'));}if(!_0x5749ef['query'][_0x4c6a('0xa0')]){throw new Error(_0x4c6a('0xa1'));}var _0xf4b996=_0x5749ef[_0x4c6a('0x34')]['hostname']?_0x5749ef['query'][_0x4c6a('0xa2')]+':'+_0x5749ef['query'][_0x4c6a('0xa0')]:'http://localhost:'+_0x5749ef['query'][_0x4c6a('0xa0')];var _0x6c18a8=_0x5749ef['query'][_0x4c6a('0x1d')]?_0x5749ef[_0x4c6a('0x34')][_0x4c6a('0x1d')]:!![];var _0x113270=_0x5749ef[_0x4c6a('0x34')][_0x4c6a('0xa3')]?_0x5749ef['query'][_0x4c6a('0xa3')]:null;var _0x1fe801={'method':_0x5749ef['method'],'uri':util[_0x4c6a('0x52')]('%s%s',_0xf4b996,_0x5749ef[_0x4c6a('0x34')]['path']),'json':_0x6c18a8,'resolveWithFullResponse':!![],'encoding':_0x113270,'qs':_0x5749ef[_0x4c6a('0x34')]};if(_0x5749ef[_0x4c6a('0xa4')]){_0x1fe801[_0x4c6a('0xa4')]=_0x5749ef[_0x4c6a('0xa4')];if(_0x1fe801[_0x4c6a('0xa4')][_0x4c6a('0xa5')]){delete _0x1fe801[_0x4c6a('0xa4')]['content-length'];}}if(_0x1fe801[_0x4c6a('0xa4')][_0x4c6a('0xa6')]){delete _0x1fe801[_0x4c6a('0xa4')][_0x4c6a('0xa6')];}return rp(_0x1fe801);})[_0x4c6a('0x24')](function(_0x1fab0d){if(_0x1fab0d){_0x19a51f[_0x4c6a('0xa7')](_0x1fab0d['headers']);logger[_0x4c6a('0x63')](_0x1fab0d[_0x4c6a('0x90')]);if(_[_0x4c6a('0xa8')](_0x5749ef[_0x4c6a('0x34')][_0x4c6a('0x3')],_0x4c6a('0x4e'))&&_0x1fab0d[_0x4c6a('0xa9')]==0x1f4){return _0x19a51f[_0x4c6a('0x1c')](_0x1fab0d[_0x4c6a('0xa9')]);}else{return _0x19a51f[_0x4c6a('0x2a')](_0x1fab0d['statusCode'])['send'](_0x1fab0d[_0x4c6a('0x90')]);}}else{return _0x19a51f['sendStatus'](0xc8);}})[_0x4c6a('0x49')](handleError(_0x19a51f,null));};exports[_0x4c6a('0xaa')]=function(_0x438183,_0x24a180,_0x4dcb01){return BPromise[_0x4c6a('0x9e')]()['then'](function(){if(!_0x438183[_0x4c6a('0x34')][_0x4c6a('0x3')]){throw new Error(_0x4c6a('0x9f'));}if(!_0x438183['query']['port']){throw new Error(_0x4c6a('0xa1'));}var _0x149771=_0x438183[_0x4c6a('0x34')]['hostname']?_0x438183['query'][_0x4c6a('0xa2')]+':'+_0x438183[_0x4c6a('0x34')][_0x4c6a('0xa0')]:_0x4c6a('0xab')+_0x438183[_0x4c6a('0x34')][_0x4c6a('0xa0')];var _0x527259=_0x438183[_0x4c6a('0x34')][_0x4c6a('0x1d')]?_0x438183['query'][_0x4c6a('0x1d')]:!![];var _0x429c5b=_0x438183['query'][_0x4c6a('0xa3')]?_0x438183[_0x4c6a('0x34')][_0x4c6a('0xa3')]:null;var _0xc58e32={'method':_0x438183[_0x4c6a('0xac')],'uri':util['format']('%s%s',_0x149771,_0x438183[_0x4c6a('0x34')][_0x4c6a('0x3')]),'json':_0x527259,'resolveWithFullResponse':!![],'encoding':_0x429c5b,'body':_0x438183[_0x4c6a('0x90')]};if(_0x438183['headers']){_0xc58e32['headers']=_0x438183[_0x4c6a('0xa4')];if(_0xc58e32['headers'][_0x4c6a('0xa5')]){delete _0xc58e32['headers'][_0x4c6a('0xa5')];}}if(_0xc58e32['headers'][_0x4c6a('0xa6')]){delete _0xc58e32[_0x4c6a('0xa4')][_0x4c6a('0xa6')];}return rp(_0xc58e32);})['then'](function(_0x25f5c9){if(_0x25f5c9){_0x24a180[_0x4c6a('0xa7')](_0x25f5c9[_0x4c6a('0xa4')]);logger[_0x4c6a('0x63')](_0x25f5c9[_0x4c6a('0x90')]);return _0x24a180[_0x4c6a('0x2a')](_0x25f5c9['statusCode'])['send'](_0x25f5c9['body']);}else{return _0x24a180['sendStatus'](0xc8);}})['catch'](handleError(_0x24a180,null));};
\ No newline at end of file
index 3d1f285..286043a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b47=['update','remove','emit','exports','events','Plugin','setMaxListeners','save'];(function(_0x1c8e8e,_0x4c56b6){var _0x5dbb72=function(_0x3d91d3){while(--_0x3d91d3){_0x1c8e8e['push'](_0x1c8e8e['shift']());}};_0x5dbb72(++_0x4c56b6);}(_0x4b47,0x1b4));var _0x74b4=function(_0x192883,_0x483e2e){_0x192883=_0x192883-0x0;var _0x55a008=_0x4b47[_0x192883];return _0x55a008;};'use strict';var EventEmitter=require(_0x74b4('0x0'));var Plugin=require('../../mysqldb')['db'][_0x74b4('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x74b4('0x2')](0x0);var events={'afterCreate':_0x74b4('0x3'),'afterUpdate':_0x74b4('0x4'),'afterDestroy':_0x74b4('0x5')};function emitEvent(_0x2795e9){return function(_0x565f6b,_0x4ed4fe,_0x27ddaf){PluginEvents[_0x74b4('0x6')](_0x2795e9+':'+_0x565f6b['id'],_0x565f6b);PluginEvents['emit'](_0x2795e9,_0x565f6b);_0x27ddaf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x74b4('0x7')]=PluginEvents;
\ No newline at end of file
+var _0x6d19=['events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x302170,_0x82effd){var _0x3497c1=function(_0x243ee0){while(--_0x243ee0){_0x302170['push'](_0x302170['shift']());}};_0x3497c1(++_0x82effd);}(_0x6d19,0x160));var _0x96d1=function(_0x1fcaf1,_0x21c3c2){_0x1fcaf1=_0x1fcaf1-0x0;var _0x55f464=_0x6d19[_0x1fcaf1];return _0x55f464;};'use strict';var EventEmitter=require(_0x96d1('0x0'));var Plugin=require(_0x96d1('0x1'))['db'][_0x96d1('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x96d1('0x3')](0x0);var events={'afterCreate':_0x96d1('0x4'),'afterUpdate':_0x96d1('0x5'),'afterDestroy':_0x96d1('0x6')};function emitEvent(_0x4d273d){return function(_0x186315,_0x394a34,_0x4c1097){PluginEvents[_0x96d1('0x7')](_0x4d273d+':'+_0x186315['id'],_0x186315);PluginEvents['emit'](_0x4d273d,_0x186315);_0x4c1097(null);};}for(var e in events){if(events[_0x96d1('0x8')](e)){var event=events[e];Plugin[_0x96d1('0x9')](e,emitEvent(event));}}module[_0x96d1('0xa')]=PluginEvents;
\ No newline at end of file
index e666ec3..6e8559d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc439=['bluebird','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','api','moment'];(function(_0x42bfb7,_0x25a3ec){var _0x5c497d=function(_0x48e83e){while(--_0x48e83e){_0x42bfb7['push'](_0x42bfb7['shift']());}};_0x5c497d(++_0x25a3ec);}(_0xc439,0x174));var _0x9c43=function(_0x34112c,_0x4af8c1){_0x34112c=_0x34112c-0x0;var _0x1d9cc6=_0xc439[_0x34112c];return _0x1d9cc6;};'use strict';var _=require(_0x9c43('0x0'));var util=require(_0x9c43('0x1'));var logger=require(_0x9c43('0x2'))(_0x9c43('0x3'));var moment=require(_0x9c43('0x4'));var BPromise=require(_0x9c43('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9c43('0x6'));var config=require(_0x9c43('0x7'));var attributes=require(_0x9c43('0x8'));module[_0x9c43('0x9')]=function(_0x34e2fc,_0x4e9ad5){return _0x34e2fc[_0x9c43('0xa')](_0x9c43('0xb'),attributes,{'tableName':_0x9c43('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0652=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./plugin.attributes','exports','Plugin','plugins'];(function(_0x1f0f2f,_0x587f0f){var _0x22c04e=function(_0x124b91){while(--_0x124b91){_0x1f0f2f['push'](_0x1f0f2f['shift']());}};_0x22c04e(++_0x587f0f);}(_0x0652,0x138));var _0x2065=function(_0x33af5c,_0x579d3c){_0x33af5c=_0x33af5c-0x0;var _0x3c397d=_0x0652[_0x33af5c];return _0x3c397d;};'use strict';var _=require(_0x2065('0x0'));var util=require(_0x2065('0x1'));var logger=require('../../config/logger')(_0x2065('0x2'));var moment=require(_0x2065('0x3'));var BPromise=require(_0x2065('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2065('0x5'));var rimraf=require(_0x2065('0x6'));var config=require(_0x2065('0x7'));var attributes=require(_0x2065('0x8'));module[_0x2065('0x9')]=function(_0x5cb47a,_0x51449e){return _0x5cb47a['define'](_0x2065('0xa'),attributes,{'tableName':_0x2065('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 902e937..bee34ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9536=['./plugin.socket','register','request','then','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','info','result','catch','CreatePlugin','create','body','options','raw','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','http','redis','localhost','socket.io-emitter'];(function(_0x2d3c25,_0x150b75){var _0x5c033e=function(_0x55d9c9){while(--_0x55d9c9){_0x2d3c25['push'](_0x2d3c25['shift']());}};_0x5c033e(++_0x150b75);}(_0x9536,0x188));var _0x6953=function(_0x41bdd4,_0x3d5c76){_0x41bdd4=_0x41bdd4-0x0;var _0x5c03a6=_0x9536[_0x41bdd4];return _0x5c03a6;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var moment=require('moment');var BPromise=require(_0x6953('0x2'));var rs=require(_0x6953('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6953('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6953('0x5'))(_0x6953('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6953('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6953('0x8')],{'host':_0x6953('0x9'),'port':0x18eb});var socket=require(_0x6953('0xa'))(new Redis(config['redis']));require(_0x6953('0xb'))[_0x6953('0xc')](socket);function respondWithRpcPromise(_0x1e4535,_0x25368e,_0x316b2f){return new BPromise(function(_0x4c6a03,_0x272267){return client[_0x6953('0xd')](_0x1e4535,_0x316b2f)[_0x6953('0xe')](function(_0x595b4e){logger['info']('Plugin,\x20%s,\x20%s',_0x25368e,_0x6953('0xf'));logger['debug'](_0x6953('0x10'),_0x25368e,_0x6953('0xf'),JSON[_0x6953('0x11')](_0x595b4e));if(_0x595b4e[_0x6953('0x12')]){if(_0x595b4e[_0x6953('0x12')][_0x6953('0x13')]===0x1f4){logger[_0x6953('0x12')](_0x6953('0x14'),_0x25368e,_0x595b4e['error']['message']);return _0x272267(_0x595b4e['error'][_0x6953('0x15')]);}logger[_0x6953('0x12')](_0x6953('0x14'),_0x25368e,_0x595b4e[_0x6953('0x12')][_0x6953('0x15')]);return _0x4c6a03(_0x595b4e['error']['message']);}else{logger[_0x6953('0x16')](_0x6953('0x14'),_0x25368e,_0x6953('0xf'));_0x4c6a03(_0x595b4e[_0x6953('0x17')][_0x6953('0x15')]);}})[_0x6953('0x18')](function(_0x50766a){logger['error'](_0x6953('0x14'),_0x25368e,_0x50766a);_0x272267(_0x50766a);});});}exports[_0x6953('0x19')]=function(_0x15176c){var _0x3432b0=this;return new Promise(function(_0x1727cd,_0x43effb){return db['Plugin'][_0x6953('0x1a')](_0x15176c[_0x6953('0x1b')],{'raw':_0x15176c[_0x6953('0x1c')]?_0x15176c[_0x6953('0x1c')][_0x6953('0x1d')]===undefined?!![]:![]:!![]})[_0x6953('0xe')](function(_0x3468da){logger[_0x6953('0x16')](_0x6953('0x19'),_0x15176c);logger[_0x6953('0x1e')](_0x6953('0x19'),_0x15176c,JSON[_0x6953('0x11')](_0x3468da));_0x1727cd(_0x3468da);})[_0x6953('0x18')](function(_0x4835c6){logger['error'](_0x6953('0x19'),_0x4835c6['message'],_0x15176c);_0x43effb(_0x3432b0[_0x6953('0x12')](0x1f4,_0x4835c6[_0x6953('0x15')]));});});};
\ No newline at end of file
+var _0x8845=['./plugin.socket','request','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','code','error','Plugin,\x20%s,\x20%s','message','result','Plugin','create','raw','then','CreatePlugin','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost'];(function(_0x2e2523,_0x2fce64){var _0x561cf9=function(_0x4284da){while(--_0x4284da){_0x2e2523['push'](_0x2e2523['shift']());}};_0x561cf9(++_0x2fce64);}(_0x8845,0x8a));var _0x5884=function(_0x131b08,_0x4c2f04){_0x131b08=_0x131b08-0x0;var _0x43a2c4=_0x8845[_0x131b08];return _0x43a2c4;};'use strict';var _=require(_0x5884('0x0'));var util=require(_0x5884('0x1'));var moment=require(_0x5884('0x2'));var BPromise=require('bluebird');var rs=require(_0x5884('0x3'));var fs=require('fs');var Redis=require(_0x5884('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5884('0x5'));var logger=require(_0x5884('0x6'))(_0x5884('0x7'));var config=require('../../config/environment');var jayson=require(_0x5884('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x5884('0x9')]=_[_0x5884('0xa')](config[_0x5884('0x9')],{'host':_0x5884('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5884('0x9')]));require(_0x5884('0xc'))['register'](socket);function respondWithRpcPromise(_0x167184,_0x2586ce,_0x4dcdd7){return new BPromise(function(_0x5e4903,_0x481c6c){return client[_0x5884('0xd')](_0x167184,_0x4dcdd7)['then'](function(_0x4b18fc){logger[_0x5884('0xe')]('Plugin,\x20%s,\x20%s',_0x2586ce,_0x5884('0xf'));logger[_0x5884('0x10')](_0x5884('0x11'),_0x2586ce,_0x5884('0xf'),JSON[_0x5884('0x12')](_0x4b18fc));if(_0x4b18fc['error']){if(_0x4b18fc['error'][_0x5884('0x13')]===0x1f4){logger[_0x5884('0x14')](_0x5884('0x15'),_0x2586ce,_0x4b18fc['error'][_0x5884('0x16')]);return _0x481c6c(_0x4b18fc[_0x5884('0x14')][_0x5884('0x16')]);}logger[_0x5884('0x14')](_0x5884('0x15'),_0x2586ce,_0x4b18fc[_0x5884('0x14')][_0x5884('0x16')]);return _0x5e4903(_0x4b18fc['error'][_0x5884('0x16')]);}else{logger[_0x5884('0xe')](_0x5884('0x15'),_0x2586ce,_0x5884('0xf'));_0x5e4903(_0x4b18fc[_0x5884('0x17')][_0x5884('0x16')]);}})['catch'](function(_0x41f898){logger[_0x5884('0x14')](_0x5884('0x15'),_0x2586ce,_0x41f898);_0x481c6c(_0x41f898);});});}exports['CreatePlugin']=function(_0x3fd99c){var _0x4274bd=this;return new Promise(function(_0x36d27f,_0x3432fa){return db[_0x5884('0x18')][_0x5884('0x19')](_0x3fd99c['body'],{'raw':_0x3fd99c['options']?_0x3fd99c['options'][_0x5884('0x1a')]===undefined?!![]:![]:!![]})[_0x5884('0x1b')](function(_0x57df49){logger[_0x5884('0xe')](_0x5884('0x1c'),_0x3fd99c);logger[_0x5884('0x10')](_0x5884('0x1c'),_0x3fd99c,JSON[_0x5884('0x12')](_0x57df49));_0x36d27f(_0x57df49);})[_0x5884('0x1d')](function(_0x8ccb03){logger[_0x5884('0x14')](_0x5884('0x1c'),_0x8ccb03[_0x5884('0x16')],_0x3fd99c);_0x3432fa(_0x4274bd[_0x5884('0x14')](0x1f4,_0x8ccb03[_0x5884('0x16')]));});});};
\ No newline at end of file
index 45f65aa..cbfc318 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd680=['emit','removeListener','register','length','plugin:','./plugin.events','save','remove','update'];(function(_0x3957ee,_0x1855a3){var _0x34d635=function(_0x2863d8){while(--_0x2863d8){_0x3957ee['push'](_0x3957ee['shift']());}};_0x34d635(++_0x1855a3);}(_0xd680,0xcb));var _0x0d68=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd680[_0x3dd15e];return _0x231fd0;};'use strict';var PluginEvents=require(_0x0d68('0x0'));var events=[_0x0d68('0x1'),_0x0d68('0x2'),_0x0d68('0x3')];function createListener(_0x1ca5e5,_0x2dc672){return function(_0x33a043){_0x2dc672[_0x0d68('0x4')](_0x1ca5e5,_0x33a043);};}function removeListener(_0x2a2047,_0x2b0d13){return function(){PluginEvents[_0x0d68('0x5')](_0x2a2047,_0x2b0d13);};}exports[_0x0d68('0x6')]=function(_0x437371){for(var _0x2f548a=0x0,_0xc2e623=events[_0x0d68('0x7')];_0x2f548a<_0xc2e623;_0x2f548a++){var _0x2213e5=events[_0x2f548a];var _0x17336d=createListener(_0x0d68('0x8')+_0x2213e5,_0x437371);PluginEvents['on'](_0x2213e5,_0x17336d);}};
\ No newline at end of file
+var _0xd667=['emit','remove','update'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0xd667,0x85));var _0x7d66=function(_0x2d77d0,_0x5c3e75){_0x2d77d0=_0x2d77d0-0x0;var _0x695cae=_0xd667[_0x2d77d0];return _0x695cae;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0x7d66('0x0'),_0x7d66('0x1')];function createListener(_0x3dabd0,_0x145897){return function(_0x1c7f31){_0x145897[_0x7d66('0x2')](_0x3dabd0,_0x1c7f31);};}function removeListener(_0x1d0d39,_0x4c60e7){return function(){PluginEvents['removeListener'](_0x1d0d39,_0x4c60e7);};}exports['register']=function(_0x4add03){for(var _0x59c75f=0x0,_0x55085a=events['length'];_0x59c75f<_0x55085a;_0x59c75f++){var _0x107073=events[_0x59c75f];var _0x50f559=createListener('plugin:'+_0x107073,_0x4add03);PluginEvents['on'](_0x107073,_0x50f559);}};
\ No newline at end of file
index 67d5004..14e4415 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(_0x4a361f,_0x96165d){var _0x15e6d7=function(_0x581ca6){while(--_0x581ca6){_0x4a361f['push'](_0x4a361f['shift']());}};_0x15e6d7(++_0x96165d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router;
\ No newline at end of file
+var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x47e748,_0x38e01a){var _0x3509eb=function(_0x19ec16){while(--_0x19ec16){_0x47e748['push'](_0x47e748['shift']());}};_0x3509eb(++_0x38e01a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 b8f838a..edb7868 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7072=['update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','sendStatus','status','json','name','send','npm\x20install','info','error','list','then','reject','express','length','catch','show','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump'];(function(_0x5b74eb,_0x46be55){var _0x48c264=function(_0x346fdb){while(--_0x346fdb){_0x5b74eb['push'](_0x5b74eb['shift']());}};_0x48c264(++_0x46be55);}(_0x7072,0x138));var _0x2707=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7072[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var pm2=require(_0x2707('0x0'));var logger=require(_0x2707('0x1'))(_0x2707('0x2'));var path=require(_0x2707('0x3'));var exec=require(_0x2707('0x4'))['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0xfdfa7a,_0x5f3c1c){return function(_0xd36287){if(!_0xd36287){_0xfdfa7a[_0x2707('0x5')](0x194);;}return _0xd36287;};}function respondWithResult(_0x1e86f2,_0x194132){_0x194132=_0x194132||0xc8;return function(_0x2fd8ff){if(_0x2fd8ff){return _0x1e86f2[_0x2707('0x6')](_0x194132)[_0x2707('0x7')](_0x2fd8ff);}return null;};}function handleError(_0x745cfd,_0x4062b6){_0x4062b6=_0x4062b6||0x1f4;return function(_0x2820ef){logger['error'](_0x2820ef['stack']);if(_0x2820ef[_0x2707('0x8')]){delete _0x2820ef[_0x2707('0x8')];}_0x745cfd[_0x2707('0x6')](_0x4062b6)[_0x2707('0x9')](_0x2820ef);};}function execChildProcess(){return new BPromise(function(_0x30090e,_0x2e1a46){exec(_0x2707('0xa'),function(_0x19881c,_0x115535,_0x478717){logger[_0x2707('0xb')](_0x115535);logger[_0x2707('0xb')](_0x478717);if(_0x19881c){logger[_0x2707('0xc')](_0x19881c);return _0x2e1a46(_0x19881c);}return _0x30090e(_0x115535);});});}exports['index']=function(_0x44c1d7,_0x590152){return pm2[_0x2707('0xd')]()[_0x2707('0xe')](function(_0xfe975c){if(_0xfe975c){var _0x3a67f2=_[_0x2707('0xf')](_0xfe975c,function(_0x4e52a3){return _0x4e52a3[_0x2707('0x8')]===_0x2707('0x10')||_0x4e52a3[_0x2707('0x8')]==='motion2';});return{'rows':_0x3a67f2,'count':_0x3a67f2[_0x2707('0x11')]};}return null;})[_0x2707('0xe')](respondWithResult(_0x590152,null))[_0x2707('0x12')](handleError(_0x590152,null));};exports[_0x2707('0x13')]=function(_0x7ed037,_0x27a3ea){return pm2['describe'](_0x7ed037[_0x2707('0x14')]['id'])[_0x2707('0xe')](respondWithResult(_0x27a3ea,null))[_0x2707('0xe')](handleEntityNotFound(_0x27a3ea,null))['catch'](handleError(_0x27a3ea,null));};exports['create']=function(_0x58a4ee,_0x1da4a6){if(_0x58a4ee[_0x2707('0x15')][_0x2707('0x8')]&&_0x58a4ee[_0x2707('0x15')][_0x2707('0x16')]){var _0x3c2935=path[_0x2707('0x17')](__dirname,_0x2707('0x18'),_0x58a4ee[_0x2707('0x15')][_0x2707('0x16')]);var _0x37c475=process[_0x2707('0x19')]();process[_0x2707('0x1a')](path[_0x2707('0x1b')](_0x3c2935));return execChildProcess()['then'](function(_0x1acf22){process[_0x2707('0x1a')](_0x37c475);return pm2[_0x2707('0x1c')]({'name':_0x58a4ee[_0x2707('0x15')][_0x2707('0x8')],'script':_0x3c2935});})[_0x2707('0xe')](function(_0x4831ed){pm2[_0x2707('0x1d')]();return _0x4831ed[0x0];})[_0x2707('0xe')](respondWithResult(_0x1da4a6,0xc9))[_0x2707('0x12')](handleError(_0x1da4a6,null));}else{return _0x1da4a6[_0x2707('0x6')](0x1f4)[_0x2707('0x9')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x2707('0x1e')]=function(_0x4ca05d,_0x29dad2){if(_0x4ca05d[_0x2707('0x15')]['id']){delete _0x4ca05d[_0x2707('0x15')]['id'];}var _0x57da26={'online':_0x2707('0x1f'),'stopped':_0x2707('0x20')};if(_0x57da26[_0x2707('0x21')](_0x4ca05d['body'][_0x2707('0x6')])){return pm2[_0x57da26[_0x4ca05d[_0x2707('0x15')]['status']]](_0x4ca05d[_0x2707('0x14')]['id'])['then'](respondWithResult(_0x29dad2,0xc8))['catch'](handleError(_0x29dad2,null));}else{return _0x29dad2[_0x2707('0x6')](0x1f4)['send']({'message':_0x2707('0x22')});}};exports[_0x2707('0x23')]=function(_0x417a97,_0x36b2e9){if(_0x417a97['body']['id']){delete _0x417a97[_0x2707('0x15')]['id'];}if(_0x417a97[_0x2707('0x14')]['id']){return pm2[_0x2707('0x24')](_0x417a97[_0x2707('0x14')]['id'])[_0x2707('0xe')](function(_0x341e14){pm2[_0x2707('0x1d')]();return _0x341e14[0x0];})[_0x2707('0xe')](respondWithResult(_0x36b2e9,null))[_0x2707('0x12')](handleError(_0x36b2e9,null));}else{return _0x36b2e9['status'](0x1f4)[_0x2707('0x9')]({'message':_0x2707('0x25')});}};
\ No newline at end of file
+var _0x3140=['send','npm\x20install','info','error','index','then','reject','express','length','catch','params','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','Unknown\x20status','destroy','lodash','../../config/pm2','../../config/logger','api','exec','bluebird','sendStatus','status','json','name'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x3140,0xaf));var _0x0314=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x3140[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x0314('0x0'));var pm2=require(_0x0314('0x1'));var logger=require(_0x0314('0x2'))(_0x0314('0x3'));var path=require('path');var exec=require('child_process')[_0x0314('0x4')];var BPromise=require(_0x0314('0x5'));function handleEntityNotFound(_0x1c0f66,_0x3e4284){return function(_0x254566){if(!_0x254566){_0x1c0f66[_0x0314('0x6')](0x194);;}return _0x254566;};}function respondWithResult(_0x9e308d,_0xf87d26){_0xf87d26=_0xf87d26||0xc8;return function(_0x11ee94){if(_0x11ee94){return _0x9e308d[_0x0314('0x7')](_0xf87d26)[_0x0314('0x8')](_0x11ee94);}return null;};}function handleError(_0x495b27,_0x26031f){_0x26031f=_0x26031f||0x1f4;return function(_0x2d87d2){logger['error'](_0x2d87d2['stack']);if(_0x2d87d2[_0x0314('0x9')]){delete _0x2d87d2['name'];}_0x495b27[_0x0314('0x7')](_0x26031f)[_0x0314('0xa')](_0x2d87d2);};}function execChildProcess(){return new BPromise(function(_0x3a7713,_0x376da9){exec(_0x0314('0xb'),function(_0x3e9964,_0x516448,_0xe78fb9){logger[_0x0314('0xc')](_0x516448);logger[_0x0314('0xc')](_0xe78fb9);if(_0x3e9964){logger[_0x0314('0xd')](_0x3e9964);return _0x376da9(_0x3e9964);}return _0x3a7713(_0x516448);});});}exports[_0x0314('0xe')]=function(_0x4318d6,_0x149b67){return pm2['list']()[_0x0314('0xf')](function(_0xbe0b07){if(_0xbe0b07){var _0x1316a0=_[_0x0314('0x10')](_0xbe0b07,function(_0x40566e){return _0x40566e[_0x0314('0x9')]===_0x0314('0x11')||_0x40566e[_0x0314('0x9')]==='motion2';});return{'rows':_0x1316a0,'count':_0x1316a0[_0x0314('0x12')]};}return null;})[_0x0314('0xf')](respondWithResult(_0x149b67,null))[_0x0314('0x13')](handleError(_0x149b67,null));};exports['show']=function(_0x6c48cb,_0x5f2e82){return pm2['describe'](_0x6c48cb[_0x0314('0x14')]['id'])[_0x0314('0xf')](respondWithResult(_0x5f2e82,null))['then'](handleEntityNotFound(_0x5f2e82,null))[_0x0314('0x13')](handleError(_0x5f2e82,null));};exports[_0x0314('0x15')]=function(_0x583ffa,_0x1a25cf){if(_0x583ffa['body'][_0x0314('0x9')]&&_0x583ffa[_0x0314('0x16')][_0x0314('0x17')]){var _0x77ddfd=path[_0x0314('0x18')](__dirname,_0x0314('0x19'),_0x583ffa['body']['script']);var _0x20305b=process[_0x0314('0x1a')]();process[_0x0314('0x1b')](path[_0x0314('0x1c')](_0x77ddfd));return execChildProcess()[_0x0314('0xf')](function(_0xd7638b){process['chdir'](_0x20305b);return pm2[_0x0314('0x1d')]({'name':_0x583ffa[_0x0314('0x16')]['name'],'script':_0x77ddfd});})[_0x0314('0xf')](function(_0xfc4893){pm2[_0x0314('0x1e')]();return _0xfc4893[0x0];})[_0x0314('0xf')](respondWithResult(_0x1a25cf,0xc9))[_0x0314('0x13')](handleError(_0x1a25cf,null));}else{return _0x1a25cf[_0x0314('0x7')](0x1f4)['send']({'message':_0x0314('0x1f')});}};exports[_0x0314('0x20')]=function(_0x2d636b,_0x47c2d1){if(_0x2d636b[_0x0314('0x16')]['id']){delete _0x2d636b[_0x0314('0x16')]['id'];}var _0x47c102={'online':'restart','stopped':_0x0314('0x21')};if(_0x47c102[_0x0314('0x22')](_0x2d636b['body'][_0x0314('0x7')])){return pm2[_0x47c102[_0x2d636b[_0x0314('0x16')]['status']]](_0x2d636b['params']['id'])[_0x0314('0xf')](respondWithResult(_0x47c2d1,0xc8))[_0x0314('0x13')](handleError(_0x47c2d1,null));}else{return _0x47c2d1['status'](0x1f4)[_0x0314('0xa')]({'message':_0x0314('0x23')});}};exports[_0x0314('0x24')]=function(_0x4da71c,_0x5b82b2){if(_0x4da71c[_0x0314('0x16')]['id']){delete _0x4da71c[_0x0314('0x16')]['id'];}if(_0x4da71c[_0x0314('0x14')]['id']){return pm2['delete'](_0x4da71c[_0x0314('0x14')]['id'])['then'](function(_0x52700f){pm2[_0x0314('0x1e')]();return _0x52700f[0x0];})[_0x0314('0xf')](respondWithResult(_0x5b82b2,null))[_0x0314('0x13')](handleError(_0x5b82b2,null));}else{return _0x5b82b2['status'](0x1f4)[_0x0314('0xa')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
index 0d72543..2270f0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95d6=['getQueues','exports','express','Router','../../components/auth/service','/agents','isAuthenticated'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x95d6,0x64));var _0x695d=function(_0x3b68c0,_0x26f208){_0x3b68c0=_0x3b68c0-0x0;var _0x195f2f=_0x95d6[_0x3b68c0];return _0x195f2f;};'use strict';var express=require(_0x695d('0x0'));var router=express[_0x695d('0x1')]();var auth=require(_0x695d('0x2'));var controller=require('./realtime.controller');router['get'](_0x695d('0x3'),auth[_0x695d('0x4')](),controller['getAgents']);router['get']('/queues',auth['isAuthenticated'](),controller[_0x695d('0x5')]);module[_0x695d('0x6')]=router;
\ No newline at end of file
+var _0xbebf=['Router','../../components/auth/service','get','/agents','getAgents','getQueues'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbebf,0xba));var _0xfbeb=function(_0x4c99b8,_0x39cd83){_0x4c99b8=_0x4c99b8-0x0;var _0x567a0e=_0xbebf[_0x4c99b8];return _0x567a0e;};'use strict';var express=require('express');var router=express[_0xfbeb('0x0')]();var auth=require(_0xfbeb('0x1'));var controller=require('./realtime.controller');router[_0xfbeb('0x2')](_0xfbeb('0x3'),auth['isAuthenticated'](),controller[_0xfbeb('0x4')]);router[_0xfbeb('0x2')]('/queues',auth['isAuthenticated'](),controller[_0xfbeb('0x5')]);module['exports']=router;
\ No newline at end of file
index 1fe3729..dc99f3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf06b=['merge','user','userProfileId','nolimit','UserProfile','getResources','findAndCountAll','rows','omit','globalStatusFilter','pauseTypeFilter','getQueues','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','client','http','offset','undefined','count','limit','status','set','Content-Range','json','error','stack','name','send','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','request','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','paused','outbound','pTalking','originated','message','dialActive','dialMethod','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','agents','loggedIn','voice','busy','find','pick','filter','queue','length','some','connectedlinenum','internal','talking','getMembers','UserId','accountcode','online','voiceStatus','push','User','startCase','Queue','Pause','QueueId','unknown','unavailable','ringing','isNil','chatPause','mailPause','openchannelPause','smsPause','voicePause','every','idle','pause','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','*pause','mail','chat','sms','fax','whatsapp','includes','toLowerCase','Invalid\x20channel','isArray','findOne','uniq','fields','order','startsWith','DESC','ASC','sort','globalStatus','pauseType','getAgents','lastPauseAt','address','whatsappPause','faxPause','chatCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','query','channel','globalQueueFilter','rawAttributes','fieldName','type','role','agent','getOptions','raw','isEmpty','where'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf06b,0x1f2));var _0xbf06=function(_0xd8ac8a,_0x5b76fd){_0xd8ac8a=_0xd8ac8a-0x0;var _0x172e4d=_0xf06b[_0xd8ac8a];return _0x172e4d;};'use strict';var util=require(_0xbf06('0x0'));var _=require(_0xbf06('0x1'));var jayson=require(_0xbf06('0x2'));var qs=require(_0xbf06('0x3'));var logger=require(_0xbf06('0x4'))(_0xbf06('0x5'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xbf06('0x6')]['http']({'port':0x232a});var routingClient=jayson[_0xbf06('0x6')][_0xbf06('0x7')]({'port':0x232c});function respondWithFilteredResult(_0xda7e6,_0x2449f2){return function(_0x4c20c6){if(_0x4c20c6){var _0x55d7d7=typeof _0x2449f2[_0xbf06('0x8')]===_0xbf06('0x9')&&typeof _0x2449f2['limit']===_0xbf06('0x9');var _0x14ec74=_0x4c20c6[_0xbf06('0xa')];var _0x5630f5=_0x55d7d7?0x0:_0x2449f2['offset'];var _0x24bab2=_0x55d7d7?_0x4c20c6[_0xbf06('0xa')]:_0x2449f2[_0xbf06('0x8')]+_0x2449f2[_0xbf06('0xb')];var _0x4f0c1c;if(_0x24bab2>=_0x14ec74){_0x24bab2=_0x14ec74;_0x4f0c1c=0xc8;}else{_0x4f0c1c=0xce;}_0xda7e6[_0xbf06('0xc')](_0x4f0c1c);return _0xda7e6[_0xbf06('0xd')](_0xbf06('0xe'),_0x5630f5+'-'+_0x24bab2+'/'+_0x14ec74)[_0xbf06('0xf')](_0x4c20c6);}return null;};}function handleError(_0x690772,_0x17dc00){_0x17dc00=_0x17dc00||0x1f4;return function(_0x1e36ba){logger[_0xbf06('0x10')](_0x1e36ba[_0xbf06('0x11')]);if(_0x1e36ba[_0xbf06('0x12')]){delete _0x1e36ba[_0xbf06('0x12')];}_0x690772[_0xbf06('0xc')](_0x17dc00)[_0xbf06('0x13')](_0x1e36ba);};}function getRealtimeAgents(){return new Promise(function(_0x381e1a,_0x157e48){return amiClient['request'](_0xbf06('0x14'),{})['then'](function(_0xd365d0){if(_0xd365d0[_0xbf06('0x10')])throw new Error(_0xbf06('0x15'));var _0x1c3c91=_0xd365d0[_0xbf06('0x16')];return routingClient['request'](_0xbf06('0x14'),{})[_0xbf06('0x17')](function(_0x2189e2){if(_0x2189e2['error'])throw new Error(_0xbf06('0x18'));var _0x1aac4f=_0x2189e2[_0xbf06('0x16')];return _0x381e1a(_['merge']({},_0x1c3c91,_0x1aac4f));});})[_0xbf06('0x19')](function(_0x140747){_0x157e48(_0x140747);});});}function getRealtimeQueues(_0x168b62,_0x5f1cf7){return new Promise(function(_0x47b70a,_0x1f7a45){var _0x37b0fa=_0x5f1cf7==='voice'?amiClient:routingClient;return _0x37b0fa[_0xbf06('0x1a')](_['startCase'](_0x5f1cf7)+_0xbf06('0x1b'),_0x168b62)[_0xbf06('0x17')](function(_0x1135c4){if(_0x1135c4[_0xbf06('0x10')])throw new Error(util[_0xbf06('0x1c')](_0xbf06('0x1d'),_0x5f1cf7));return _0x47b70a(_0x1135c4['result']);})[_0xbf06('0x19')](function(_0x1f29d7){_0x1f7a45(_0x1f29d7);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x2bb0a9,_0x41117a){return amiClient['request']('VoiceQueuesChannels',{})[_0xbf06('0x17')](function(_0x5322e4){if(_0x5322e4['error'])throw new Error(_0xbf06('0x1e'));return _0x2bb0a9(_0x5322e4[_0xbf06('0x16')]);})['catch'](function(_0xb6f97d){_0x41117a(_0xb6f97d);});});}function initializeQueues(_0xeca8af,_0x207bcf,_0x5b4bde,_0x37775d){var _0xca5b6c=['loggedIn',_0xbf06('0x1f'),_0xbf06('0x20'),'talking',_0xbf06('0x21')];if(_0x5b4bde==='voice'&&_0x37775d===_0xbf06('0x22')){_0xca5b6c['push'](_0xbf06('0x23'),_0xbf06('0x24'),_0xbf06('0x25'),_0xbf06('0x26'),_0xbf06('0x27'),'Trunk',_0xbf06('0x28'),_0xbf06('0x29'),_0xbf06('0x2a'),_0xbf06('0x2b'),_0xbf06('0x2c'),'erlangBusyFactor',_0xbf06('0x2d'),_0xbf06('0x2e'),'dialPredictiveIntervalMinThreshold',_0xbf06('0x2f'),_0xbf06('0x30'),'predictiveIntervalAnsweredCalls',_0xbf06('0x31'),_0xbf06('0x32'),_0xbf06('0x33'),_0xbf06('0x34'));}return _0xeca8af[_0xbf06('0x35')](function(_0x4b69ca){var _0x5e77fb=_0x4b69ca['get']({'plain':!![]});_0x5e77fb[_0xbf06('0x36')]=[];_0x5e77fb['paused']=0x0;_0x5e77fb['loggedInDb']=0x0;_0x5e77fb[_0xbf06('0x37')]=0x0;_0x5e77fb[_0xbf06('0x1f')]=0x0;_0x5e77fb[_0xbf06('0x20')]=0x0;if(_0x5b4bde===_0xbf06('0x38')){_0x5e77fb['talking']=0x0;_0x5e77fb[_0xbf06('0x39')]=0x0;if(_0x37775d==='outbound'){_0x5e77fb[_0xbf06('0x23')]=0x0;_0x5e77fb[_0xbf06('0x24')]=0x0;}}var _0x2af8c3=_[_0xbf06('0x3a')](_0x207bcf,['id',_0x5e77fb['id']]);if(_0x2af8c3)_['merge'](_0x5e77fb,_[_0xbf06('0x3b')](_0x2af8c3,_0xca5b6c));return _0x5e77fb;});}function updateAgentVoiceStatus(_0x478133,_0x3edcb2,_0x557dcd){var _0x151338=_[_0xbf06('0x3c')](_0x557dcd,[_0xbf06('0x3d'),_0x3edcb2['name']]);if(_0x151338[_0xbf06('0x3e')]===0x0)return _0x478133[_0xbf06('0x39')]=!![];if(_[_0xbf06('0x3f')](_0x151338,[_0xbf06('0x40'),_0x478133[_0xbf06('0x41')]['toString']()]))return _0x478133[_0xbf06('0x42')]=!![];if(!_0x478133[_0xbf06('0x42')])return _0x478133[_0xbf06('0x39')]=!![];}function getVoiceQueueAgents(_0x148f5e,_0x42ec05,_0x49b0dc,_0x14fb7a){var _0x59fe69=_[_0xbf06('0x3a')](_0x42ec05,['id',_0x148f5e['id']]);if(!_0x59fe69)return _0x148f5e;return _0x59fe69[_0xbf06('0x43')]({'raw':!![]})['then'](function(_0xc793c){for(var _0x4daaa6=0x0;_0x4daaa6<_0xc793c[_0xbf06('0x3e')];_0x4daaa6++){var _0x323734=_['find'](_0x49b0dc,['id',_0xc793c[_0x4daaa6]['UserId']]);if(!_0x323734){_0x323734={'id':_0xc793c[_0x4daaa6][_0xbf06('0x44')],'name':_0xc793c[_0x4daaa6][_0xbf06('0x44')],'accountcode':'','online':![]};}var _0x199686={'id':_0x323734['id'],'name':_0x323734[_0xbf06('0x12')],'internal':_0x323734[_0xbf06('0x45')],'online':Boolean(_0x323734[_0xbf06('0x46')]),'paused':Boolean(_0xc793c[_0x4daaa6][_0xbf06('0x21')])};if(_0x323734[_0xbf06('0x47')]===_0xbf06('0x42'))updateAgentVoiceStatus(_0x199686,_0x148f5e,_0x14fb7a);if(_0x199686[_0xbf06('0x46')])_0x148f5e['loggedInDb']++;if(_0x199686[_0xbf06('0x39')])_0x148f5e['busy']++;if(_0x199686[_0xbf06('0x21')]&&!_0x199686['busy']&&!_0x199686[_0xbf06('0x42')])_0x148f5e[_0xbf06('0x21')]++;_0x148f5e[_0xbf06('0x36')][_0xbf06('0x48')](_0x199686);}return _0x148f5e;});}function getQueueAgents(_0x2701e7,_0x2d3aaa,_0x2d5b40){var _0x35042e=_0xbf06('0x49')+_[_0xbf06('0x4a')](_0x2d5b40)+_0xbf06('0x4b');var _0x17c89f=_0x2d5b40+_0xbf06('0x4c');return db[_0x35042e]['findAll']({'where':{[_['startCase'](_0x2d5b40)+_0xbf06('0x4d')]:_0x2701e7['id']},'raw':!![]})[_0xbf06('0x17')](function(_0x551635){for(var _0x22f101=0x0;_0x22f101<_0x551635[_0xbf06('0x3e')];_0x22f101++){var _0x498854=_[_0xbf06('0x3a')](_0x2d3aaa,['id',_0x551635[_0x22f101]['UserId']]);if(!_0x498854){_0x498854={'id':_0x551635[_0x22f101]['UserId'],'name':_0x551635[_0x22f101]['UserId'],'online':![],['pauseField']:![]};}var _0x52ec1d={'id':_0x498854['id'],'name':_0x498854['name'],'online':Boolean(_0x498854[_0xbf06('0x46')]),'paused':Boolean(_0x498854[_0x17c89f])};if(_0x52ec1d[_0xbf06('0x46')])_0x2701e7['loggedInDb']++;_0x2701e7[_0xbf06('0x36')][_0xbf06('0x48')](_0x52ec1d);}return _0x2701e7;});}function isIdle(_0x9398f5){return _0x9398f5==='idle'||_0x9398f5===_0xbf06('0x4e')||_0x9398f5===_0xbf06('0x4f')||_0x9398f5===_0xbf06('0x50')||_[_0xbf06('0x51')](_0x9398f5);}function isAgentPaused(_0x2468fb,_0x1857c9){var _0x57b9af=[_0x2468fb[_0xbf06('0x52')],_0x2468fb['faxPause'],_0x2468fb[_0xbf06('0x53')],_0x2468fb[_0xbf06('0x54')],_0x2468fb[_0xbf06('0x55')],_0x2468fb[_0xbf06('0x56')],_0x2468fb['whatsappPause']];if(!_0x1857c9)return _[_0xbf06('0x57')](_0x57b9af);var _0x23ca88=_[_0xbf06('0x3c')](_0x57b9af);return _0x23ca88[_0xbf06('0x3e')]>0x0&&_0x23ca88['length']<_0x57b9af[_0xbf06('0x3e')]?!![]:![];}function isAgentIdle(_0x4ac67a){if(_0x4ac67a[_0xbf06('0x47')]!==_0xbf06('0x58')&&_0x4ac67a['voicePause']){_0x4ac67a[_0xbf06('0x47')]=_0xbf06('0x59');return![];}return _[_0xbf06('0x57')]([_0x4ac67a['chatStatus'],_0x4ac67a[_0xbf06('0x5a')],_0x4ac67a[_0xbf06('0x5b')],_0x4ac67a[_0xbf06('0x5c')],_0x4ac67a[_0xbf06('0x5d')],_0x4ac67a[_0xbf06('0x47')],_0x4ac67a[_0xbf06('0x5e')]],isIdle);}function getAgentStatus(_0x49f004){var _0x358e97=_0xbf06('0x4e');if(isAgentPaused(_0x49f004))_0x358e97='pause';else if(isAgentPaused(_0x49f004,!![]))_0x358e97=_0xbf06('0x5f');else if(isAgentIdle(_0x49f004))_0x358e97='idle';else _0x358e97='busy';return _0x358e97;}function validateChannel(_0xfe37cc){var _0x286d83=[_0xbf06('0x60'),_0xbf06('0x61'),_0xbf06('0x62'),'openchannel',_0xbf06('0x63'),_0xbf06('0x64'),_0xbf06('0x38')];if(!_[_0xbf06('0x65')](_0x286d83,_0xfe37cc[_0xbf06('0x66')]()))throw new Error(_0xbf06('0x67'));return _0xfe37cc['toLowerCase']();}function getFilteredAgentIds(_0x1e2a18,_0x23dd72){var _0x285d9d=_[_0xbf06('0x68')](_0x1e2a18)?_0x1e2a18:[_0x1e2a18];var _0x1fc248=_[_0xbf06('0x35')](_0x285d9d,function(_0x2280d9){return db[_0x23dd72][_0xbf06('0x69')]({'where':{'name':_0x2280d9}})[_0xbf06('0x17')](function(_0xdbfe40){if(!_0xdbfe40)return[];return _0xdbfe40['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x1fc248)[_0xbf06('0x17')](function(_0x472d1a){var _0x50452c=_(_0x472d1a)['flatten']()[_0xbf06('0x35')]('id')[_0xbf06('0x6a')]()['value']();return _0x50452c;});}function getUpdatedSortOptions(_0x4f9cb3){var _0x25bce2={'fields':[],'order':null};var _0x563ffb=_0x4f9cb3['split'](',');_0x25bce2[_0xbf06('0x6b')]=_['filter'](_0x563ffb,function(_0x1faeb2){if(!_0x1faeb2[_0xbf06('0x65')]('globalStatus'))return!![];_0x25bce2[_0xbf06('0x6c')]=_[_0xbf06('0x6d')](_0x1faeb2,'-')?_0xbf06('0x6e'):_0xbf06('0x6f');return![];});return _0x25bce2;}function orderAgentsByStatus(_0x4a4f90,_0x2d9779){return _0x4a4f90[_0xbf06('0x70')](function(_0x2eeb6a,_0x3d2bb4){if(_0x2eeb6a['globalStatus']===_0x3d2bb4[_0xbf06('0x71')]&&_0x2eeb6a[_0xbf06('0x71')]===_0xbf06('0x59')){if(_0x2d9779===_0xbf06('0x6e'))return(_0x2eeb6a[_0xbf06('0x72')]||'')<(_0x3d2bb4[_0xbf06('0x72')]||'')?0x1:-0x1;return _0x2eeb6a['pauseType']<_0x3d2bb4[_0xbf06('0x72')]?-0x1:0x1;}else{if(_0x2d9779===_0xbf06('0x6e'))return _0x2eeb6a[_0xbf06('0x71')]<_0x3d2bb4[_0xbf06('0x71')]?0x1:-0x1;return _0x2eeb6a['globalStatus']<_0x3d2bb4[_0xbf06('0x71')]?-0x1:0x1;}});}exports[_0xbf06('0x73')]=function(_0x17a028,_0x282db6){var _0x356e47={'count':0x0,'rows':[]},_0x5c99ab={},_0x953e8b,_0x2aa43b,_0xc2a53e,_0x5a6b54,_0x2c0a62=['userpic',_0xbf06('0x46'),'lastLoginAt',_0xbf06('0x74'),_0xbf06('0x72'),'lastPauseAt',_0xbf06('0x41'),_0xbf06('0x75'),'chatPause',_0xbf06('0x54'),_0xbf06('0x53'),'smsPause',_0xbf06('0x76'),_0xbf06('0x77'),_0xbf06('0x56'),_0xbf06('0x78'),'openchannelCapacity','mailCapacity',_0xbf06('0x79'),'whatsappCapacity',_0xbf06('0x7a'),_0xbf06('0x7b'),'openchannelCurrentCapacity','mailCurrentCapacity',_0xbf06('0x7c'),_0xbf06('0x7d'),_0xbf06('0x7e'),'chatStatus',_0xbf06('0x5c'),_0xbf06('0x5b'),_0xbf06('0x5d'),_0xbf06('0x5e'),_0xbf06('0x5a'),_0xbf06('0x47'),_0xbf06('0x7f'),_0xbf06('0x80'),'mailStatusTime','smsStatusTime',_0xbf06('0x81'),_0xbf06('0x82'),_0xbf06('0x83'),_0xbf06('0x3d'),_0xbf06('0x84'),_0xbf06('0x85'),_0xbf06('0x86'),_0xbf06('0x87'),_0xbf06('0x88')],_0x58ec78=[_0xbf06('0x52'),_0xbf06('0x54'),_0xbf06('0x53'),_0xbf06('0x55'),_0xbf06('0x76'),_0xbf06('0x77'),_0xbf06('0x56'),_0xbf06('0x46')];Promise[_0xbf06('0x89')]()[_0xbf06('0x17')](function(){if(_0x17a028[_0xbf06('0x8a')]['channel'])_0x953e8b=validateChannel(_0x17a028[_0xbf06('0x8a')][_0xbf06('0x8b')]);if(!_0x17a028[_0xbf06('0x8a')][_0xbf06('0x70')]||!_0x17a028[_0xbf06('0x8a')]['sort'][_0xbf06('0x65')](_0xbf06('0x71')))return;var _0x402635=getUpdatedSortOptions(_0x17a028[_0xbf06('0x8a')]['sort']);_0x17a028['query']['sort']=_0x402635[_0xbf06('0x6b')]['join'](',');_0x2aa43b=_0x402635[_0xbf06('0x6c')];})[_0xbf06('0x17')](function(){if(!_0x17a028[_0xbf06('0x8a')][_0xbf06('0x8c')])return[];var _0x2f2b9f=_[_0xbf06('0x4a')](_0x953e8b)+_0xbf06('0x4b');return getFilteredAgentIds(_0x17a028['query']['globalQueueFilter'],_0x2f2b9f);})[_0xbf06('0x17')](function(_0x2e8dc5){var _0x9e53ae=_[_0xbf06('0x35')](db[_0xbf06('0x49')][_0xbf06('0x8d')],function(_0x88089f){return{'name':_0x88089f[_0xbf06('0x8e')],'type':_0x88089f[_0xbf06('0x8f')]['key']};});_0x17a028['query'][_0xbf06('0x90')]=_0xbf06('0x91');_0x17a028[_0xbf06('0x8a')][_0xbf06('0x46')]=!![];_0x5c99ab=qs[_0xbf06('0x92')](_0x9e53ae,_0x17a028);_0x5c99ab[_0xbf06('0x93')]=!![];if(!_[_0xbf06('0x94')](_0x2e8dc5)){_0x5c99ab[_0xbf06('0x95')]=_[_0xbf06('0x96')](_0x5c99ab[_0xbf06('0x95')],{'$and':[{'id':{'$in':_0x2e8dc5}}]});}else if(!_[_0xbf06('0x94')](_0x17a028[_0xbf06('0x8a')][_0xbf06('0x8c')])){return _0x356e47;}if(_0x17a028[_0xbf06('0x97')]['role']==='user'){var _0xbe70e6={'params':{'id':_0x17a028[_0xbf06('0x97')][_0xbf06('0x98')]},'query':{'section':_0xbf06('0x14'),'role':_0xbf06('0x91'),'online':!![],'nolimit':_0x17a028[_0xbf06('0x8a')][_0xbf06('0x99')],'sort':_0x17a028[_0xbf06('0x8a')]['sort'],'filter':_0x17a028[_0xbf06('0x8a')]['filter'],'raw':!![],'ids':_0x2e8dc5}};return db[_0xbf06('0x9a')][_0xbf06('0x9b')](_0xbe70e6);}return db[_0xbf06('0x49')][_0xbf06('0x9c')](_0x5c99ab);})[_0xbf06('0x17')](function(_0x342f85){_0x356e47[_0xbf06('0xa')]=_0x342f85['count'];_0xc2a53e=_0x342f85['rows'];return getRealtimeAgents();})[_0xbf06('0x17')](function(_0x2c1787){_0x5a6b54=_0x2c1787[_0xbf06('0x9d')];return _0xc2a53e[_0xbf06('0x35')](function(_0x5c323e){var _0x4eb9b7=_[_0xbf06('0x3a')](_0x5a6b54,['id',_0x5c323e['id']]);if(_0x4eb9b7)_['merge'](_0x5c323e,_[_0xbf06('0x3b')](_[_0xbf06('0x9e')](_0x4eb9b7,_0x58ec78),_0x2c0a62));_0x5c323e[_0xbf06('0x71')]=getAgentStatus(_0x5c323e);return _0x5c323e;});})[_0xbf06('0x17')](function(_0x52c4aa){var _0x2c377c;if(_0x17a028[_0xbf06('0x8a')][_0xbf06('0x9f')]){_0x2c377c=_['filter'](_0x52c4aa,[_0xbf06('0x71'),_0x17a028[_0xbf06('0x8a')][_0xbf06('0x9f')]]);if(_0x17a028['query'][_0xbf06('0xa0')]){_0x2c377c=_['filter'](_0x2c377c,[_0xbf06('0x72'),_0x17a028[_0xbf06('0x8a')][_0xbf06('0xa0')]]);}}if(_0x2c377c)_0x52c4aa=_0x2c377c;if(!_0x2aa43b)return _0x52c4aa;return orderAgentsByStatus(_0x52c4aa,_0x2aa43b);})[_0xbf06('0x17')](function(_0x35f607){_0x356e47['rows']=_0x35f607;return _0x356e47;})[_0xbf06('0x17')](respondWithFilteredResult(_0x282db6,_0x5c99ab))['catch'](handleError(_0x282db6,null));};exports[_0xbf06('0xa1')]=function(_0x324791,_0x40da2d){var _0x1efd6c={'count':0x0,'rows':[]},_0x135e67={},_0x29f3e5,_0x3347c4,_0x3b1188,_0x2a3658,_0x195a68;Promise[_0xbf06('0x89')]()['then'](function(){if(_0x324791[_0xbf06('0x8a')][_0xbf06('0x8b')])_0x29f3e5=validateChannel(_0x324791[_0xbf06('0x8a')][_0xbf06('0x8b')]);var _0x3e0514=_[_0xbf06('0x4a')](_0x29f3e5)+_0xbf06('0x4b');var _0x55419c=_[_0xbf06('0x35')](db[_0x3e0514]['rawAttributes'],function(_0x5df8a9){return{'name':_0x5df8a9[_0xbf06('0x8e')],'type':_0x5df8a9[_0xbf06('0x8f')]['key']};});_0x135e67=qs[_0xbf06('0x92')](_0x55419c,_0x324791);if(_0x324791[_0xbf06('0x97')][_0xbf06('0x90')]===_0xbf06('0x97')){var _0x21d93f={'params':{'id':_0x324791[_0xbf06('0x97')]['userProfileId']},'query':{'section':_0x29f3e5===_0xbf06('0x38')&&_0x324791[_0xbf06('0x8a')]['type']===_0xbf06('0x22')?'QueueCampaigns':_[_0xbf06('0x4a')](_0x29f3e5)+_0xbf06('0x1b'),'type':_0x324791['query'][_0xbf06('0x8f')],'nolimit':!![],'sort':_0xbf06('0x12'),'filter':_0x324791[_0xbf06('0x8a')]['filter']}};return db[_0xbf06('0x9a')][_0xbf06('0x9b')](_0x21d93f);}return db[_0x3e0514][_0xbf06('0x9c')](_0x135e67);})['then'](function(_0x130afc){_0x1efd6c[_0xbf06('0xa')]=_0x130afc['count'];_0x3347c4=_0x130afc[_0xbf06('0x9d')];return getRealtimeQueues(_0x324791,_0x29f3e5);})[_0xbf06('0x17')](function(_0x20465b){_0x2a3658=_0x20465b['rows'];return getRealtimeAgents();})[_0xbf06('0x17')](function(_0x3c4a79){_0x3b1188=_0x3c4a79[_0xbf06('0x9d')];if(_0x29f3e5!='voice')return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x55b166){_0x195a68=_0x55b166?_0x55b166[_0xbf06('0x9d')]:[];return initializeQueues(_0x3347c4,_0x2a3658,_0x29f3e5,_0x324791[_0xbf06('0x8a')][_0xbf06('0x8f')]);})['then'](function(_0x5a2ade){var _0x38d89f=_0x5a2ade[_0xbf06('0x35')](function(_0x1decc4){if(_0x29f3e5===_0xbf06('0x38'))return getVoiceQueueAgents(_0x1decc4,_0x3347c4,_0x3b1188,_0x195a68);else return getQueueAgents(_0x1decc4,_0x3b1188,_0x29f3e5);});return Promise['all'](_0x38d89f);})[_0xbf06('0x17')](function(_0x494234){_0x1efd6c[_0xbf06('0x9d')]=_0x494234;return _0x1efd6c;})[_0xbf06('0x17')](respondWithFilteredResult(_0x40da2d,_0x135e67))[_0xbf06('0x19')](handleError(_0x40da2d,null));};
\ No newline at end of file
+var _0xe4de=['outbound','push','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','busy','pTalking','originated','find','pick','filter','queue','length','some','connectedlinenum','internal','UserId','accountcode','online','User','Queue','QueueId','idle','unknown','unavailable','ringing','isNil','chatPause','faxPause','mailPause','smsPause','voicePause','every','voiceStatus','pause','faxStatus','mailStatus','smsStatus','chat','sms','openchannel','fax','whatsapp','toLowerCase','isArray','findOne','getAgents','all','uniq','fields','globalStatus','order','startsWith','DESC','ASC','sort','pauseType','userpic','lastLoginAt','lastPauseAt','address','openchannelPause','whatsappPause','openchannelCapacity','mailCapacity','whatsappCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','openchannelStatus','openchannelStatusTime','mailStatusTime','whatsappStatusTime','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','resolve','query','channel','includes','join','globalQueueFilter','rawAttributes','fieldName','type','key','role','getOptions','raw','isEmpty','where','user','agent','nolimit','getResources','findAndCountAll','rows','globalStatusFilter','pauseTypeFilter','userProfileId','UserProfile','lodash','../../config/logger','api','../../mysqldb','client','http','offset','limit','undefined','count','status','Content-Range','json','error','stack','name','send','request','Agents','then','merge','voice','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','result','loggedIn','available','waiting','talking','paused'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xe4de,0x111));var _0xee4d=function(_0x3c035f,_0x4ef2f3){_0x3c035f=_0x3c035f-0x0;var _0x377156=_0xe4de[_0x3c035f];return _0x377156;};'use strict';var util=require('util');var _=require(_0xee4d('0x0'));var jayson=require('jayson/promise');var qs=require('../../components/parsers/qs');var logger=require(_0xee4d('0x1'))(_0xee4d('0x2'));var db=require(_0xee4d('0x3'))['db'];var amiClient=jayson[_0xee4d('0x4')][_0xee4d('0x5')]({'port':0x232a});var routingClient=jayson['client'][_0xee4d('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x2a1c2b,_0x1d3b65){return function(_0x272dc5){if(_0x272dc5){var _0x14d08a=typeof _0x1d3b65[_0xee4d('0x6')]==='undefined'&&typeof _0x1d3b65[_0xee4d('0x7')]===_0xee4d('0x8');var _0x32b4c2=_0x272dc5[_0xee4d('0x9')];var _0xe4a5e5=_0x14d08a?0x0:_0x1d3b65['offset'];var _0x136597=_0x14d08a?_0x272dc5[_0xee4d('0x9')]:_0x1d3b65[_0xee4d('0x6')]+_0x1d3b65[_0xee4d('0x7')];var _0x5dddb2;if(_0x136597>=_0x32b4c2){_0x136597=_0x32b4c2;_0x5dddb2=0xc8;}else{_0x5dddb2=0xce;}_0x2a1c2b[_0xee4d('0xa')](_0x5dddb2);return _0x2a1c2b['set'](_0xee4d('0xb'),_0xe4a5e5+'-'+_0x136597+'/'+_0x32b4c2)[_0xee4d('0xc')](_0x272dc5);}return null;};}function handleError(_0x24b6a3,_0x3caa52){_0x3caa52=_0x3caa52||0x1f4;return function(_0x545539){logger[_0xee4d('0xd')](_0x545539[_0xee4d('0xe')]);if(_0x545539[_0xee4d('0xf')]){delete _0x545539[_0xee4d('0xf')];}_0x24b6a3[_0xee4d('0xa')](_0x3caa52)[_0xee4d('0x10')](_0x545539);};}function getRealtimeAgents(){return new Promise(function(_0x5c0348,_0x53a5f7){return amiClient[_0xee4d('0x11')](_0xee4d('0x12'),{})[_0xee4d('0x13')](function(_0x1be40d){if(_0x1be40d[_0xee4d('0xd')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x531dd2=_0x1be40d['result'];return routingClient[_0xee4d('0x11')]('Agents',{})[_0xee4d('0x13')](function(_0x185fee){if(_0x185fee[_0xee4d('0xd')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x865ca=_0x185fee['result'];return _0x5c0348(_[_0xee4d('0x14')]({},_0x531dd2,_0x865ca));});})['catch'](function(_0x405887){_0x53a5f7(_0x405887);});});}function getRealtimeQueues(_0x265a98,_0x3ae8ed){return new Promise(function(_0x3340fe,_0x59e10a){var _0x7e06f3=_0x3ae8ed===_0xee4d('0x15')?amiClient:routingClient;return _0x7e06f3[_0xee4d('0x11')](_[_0xee4d('0x16')](_0x3ae8ed)+_0xee4d('0x17'),_0x265a98)[_0xee4d('0x13')](function(_0x2dabc9){if(_0x2dabc9['error'])throw new Error(util[_0xee4d('0x18')](_0xee4d('0x19'),_0x3ae8ed));return _0x3340fe(_0x2dabc9['result']);})[_0xee4d('0x1a')](function(_0x4f4fe6){_0x59e10a(_0x4f4fe6);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x8b488f,_0x2e3b30){return amiClient['request'](_0xee4d('0x1b'),{})[_0xee4d('0x13')](function(_0x2cc3e0){if(_0x2cc3e0[_0xee4d('0xd')])throw new Error(_0xee4d('0x1c'));return _0x8b488f(_0x2cc3e0[_0xee4d('0x1d')]);})['catch'](function(_0x5622c7){_0x2e3b30(_0x5622c7);});});}function initializeQueues(_0x168bba,_0x3444a6,_0x20bed8,_0x2c8387){var _0x41c4b6=[_0xee4d('0x1e'),_0xee4d('0x1f'),_0xee4d('0x20'),_0xee4d('0x21'),_0xee4d('0x22')];if(_0x20bed8==='voice'&&_0x2c8387===_0xee4d('0x23')){_0x41c4b6[_0xee4d('0x24')]('pTalking','originated','message',_0xee4d('0x25'),_0xee4d('0x26'),_0xee4d('0x27'),_0xee4d('0x28'),_0xee4d('0x29'),_0xee4d('0x2a'),'erlangCallToSecond',_0xee4d('0x2b'),_0xee4d('0x2c'),'dialPredictiveInterval',_0xee4d('0x2d'),_0xee4d('0x2e'),_0xee4d('0x2f'),_0xee4d('0x30'),_0xee4d('0x31'),_0xee4d('0x32'),_0xee4d('0x33'),'predictiveIntervalAvgHoldtime',_0xee4d('0x34'));}return _0x168bba[_0xee4d('0x35')](function(_0x26f826){var _0x4c5319=_0x26f826[_0xee4d('0x36')]({'plain':!![]});_0x4c5319[_0xee4d('0x37')]=[];_0x4c5319[_0xee4d('0x22')]=0x0;_0x4c5319[_0xee4d('0x38')]=0x0;_0x4c5319['loggedIn']=0x0;_0x4c5319[_0xee4d('0x1f')]=0x0;_0x4c5319[_0xee4d('0x20')]=0x0;if(_0x20bed8==='voice'){_0x4c5319[_0xee4d('0x21')]=0x0;_0x4c5319[_0xee4d('0x39')]=0x0;if(_0x2c8387===_0xee4d('0x23')){_0x4c5319[_0xee4d('0x3a')]=0x0;_0x4c5319[_0xee4d('0x3b')]=0x0;}}var _0x496d66=_[_0xee4d('0x3c')](_0x3444a6,['id',_0x4c5319['id']]);if(_0x496d66)_[_0xee4d('0x14')](_0x4c5319,_[_0xee4d('0x3d')](_0x496d66,_0x41c4b6));return _0x4c5319;});}function updateAgentVoiceStatus(_0x53e1b7,_0x5731c9,_0x340120){var _0xff0482=_[_0xee4d('0x3e')](_0x340120,[_0xee4d('0x3f'),_0x5731c9['name']]);if(_0xff0482[_0xee4d('0x40')]===0x0)return _0x53e1b7[_0xee4d('0x39')]=!![];if(_[_0xee4d('0x41')](_0xff0482,[_0xee4d('0x42'),_0x53e1b7[_0xee4d('0x43')]['toString']()]))return _0x53e1b7[_0xee4d('0x21')]=!![];if(!_0x53e1b7['talking'])return _0x53e1b7[_0xee4d('0x39')]=!![];}function getVoiceQueueAgents(_0x4c82e7,_0x2c50fe,_0x34bb1f,_0xbe7403){var _0x45c00b=_[_0xee4d('0x3c')](_0x2c50fe,['id',_0x4c82e7['id']]);if(!_0x45c00b)return _0x4c82e7;return _0x45c00b['getMembers']({'raw':!![]})[_0xee4d('0x13')](function(_0x1ade63){for(var _0x55bf3d=0x0;_0x55bf3d<_0x1ade63[_0xee4d('0x40')];_0x55bf3d++){var _0x55a187=_[_0xee4d('0x3c')](_0x34bb1f,['id',_0x1ade63[_0x55bf3d][_0xee4d('0x44')]]);if(!_0x55a187){_0x55a187={'id':_0x1ade63[_0x55bf3d][_0xee4d('0x44')],'name':_0x1ade63[_0x55bf3d][_0xee4d('0x44')],'accountcode':'','online':![]};}var _0x57642a={'id':_0x55a187['id'],'name':_0x55a187[_0xee4d('0xf')],'internal':_0x55a187[_0xee4d('0x45')],'online':Boolean(_0x55a187['online']),'paused':Boolean(_0x1ade63[_0x55bf3d][_0xee4d('0x22')])};if(_0x55a187['voiceStatus']===_0xee4d('0x21'))updateAgentVoiceStatus(_0x57642a,_0x4c82e7,_0xbe7403);if(_0x57642a[_0xee4d('0x46')])_0x4c82e7[_0xee4d('0x38')]++;if(_0x57642a[_0xee4d('0x39')])_0x4c82e7['busy']++;if(_0x57642a['paused']&&!_0x57642a[_0xee4d('0x39')]&&!_0x57642a[_0xee4d('0x21')])_0x4c82e7[_0xee4d('0x22')]++;_0x4c82e7[_0xee4d('0x37')][_0xee4d('0x24')](_0x57642a);}return _0x4c82e7;});}function getQueueAgents(_0x166ae1,_0x43376,_0x552fbe){var _0x324bd6=_0xee4d('0x47')+_[_0xee4d('0x16')](_0x552fbe)+_0xee4d('0x48');var _0x520372=_0x552fbe+'Pause';return db[_0x324bd6]['findAll']({'where':{[_['startCase'](_0x552fbe)+_0xee4d('0x49')]:_0x166ae1['id']},'raw':!![]})['then'](function(_0x6109d1){for(var _0x15eb2a=0x0;_0x15eb2a<_0x6109d1[_0xee4d('0x40')];_0x15eb2a++){var _0x217466=_['find'](_0x43376,['id',_0x6109d1[_0x15eb2a][_0xee4d('0x44')]]);if(!_0x217466){_0x217466={'id':_0x6109d1[_0x15eb2a]['UserId'],'name':_0x6109d1[_0x15eb2a][_0xee4d('0x44')],'online':![],['pauseField']:![]};}var _0xbdbdea={'id':_0x217466['id'],'name':_0x217466[_0xee4d('0xf')],'online':Boolean(_0x217466[_0xee4d('0x46')]),'paused':Boolean(_0x217466[_0x520372])};if(_0xbdbdea[_0xee4d('0x46')])_0x166ae1['loggedInDb']++;_0x166ae1[_0xee4d('0x37')][_0xee4d('0x24')](_0xbdbdea);}return _0x166ae1;});}function isIdle(_0xffd076){return _0xffd076===_0xee4d('0x4a')||_0xffd076===_0xee4d('0x4b')||_0xffd076===_0xee4d('0x4c')||_0xffd076===_0xee4d('0x4d')||_[_0xee4d('0x4e')](_0xffd076);}function isAgentPaused(_0x29ebb7,_0x50a560){var _0x57580f=[_0x29ebb7[_0xee4d('0x4f')],_0x29ebb7[_0xee4d('0x50')],_0x29ebb7[_0xee4d('0x51')],_0x29ebb7['openchannelPause'],_0x29ebb7[_0xee4d('0x52')],_0x29ebb7[_0xee4d('0x53')],_0x29ebb7['whatsappPause']];if(!_0x50a560)return _[_0xee4d('0x54')](_0x57580f);var _0x4dd341=_[_0xee4d('0x3e')](_0x57580f);return _0x4dd341[_0xee4d('0x40')]>0x0&&_0x4dd341[_0xee4d('0x40')]<_0x57580f[_0xee4d('0x40')]?!![]:![];}function isAgentIdle(_0x29c93b){if(_0x29c93b[_0xee4d('0x55')]!==_0xee4d('0x4a')&&_0x29c93b[_0xee4d('0x53')]){_0x29c93b[_0xee4d('0x55')]=_0xee4d('0x56');return![];}return _['every']([_0x29c93b['chatStatus'],_0x29c93b[_0xee4d('0x57')],_0x29c93b[_0xee4d('0x58')],_0x29c93b['openchannelStatus'],_0x29c93b[_0xee4d('0x59')],_0x29c93b[_0xee4d('0x55')],_0x29c93b['whatsappStatus']],isIdle);}function getAgentStatus(_0x5b0c28){var _0x3cbefb=_0xee4d('0x4b');if(isAgentPaused(_0x5b0c28))_0x3cbefb=_0xee4d('0x56');else if(isAgentPaused(_0x5b0c28,!![]))_0x3cbefb='*pause';else if(isAgentIdle(_0x5b0c28))_0x3cbefb=_0xee4d('0x4a');else _0x3cbefb='busy';return _0x3cbefb;}function validateChannel(_0x26d228){var _0x59bc4a=['mail',_0xee4d('0x5a'),_0xee4d('0x5b'),_0xee4d('0x5c'),_0xee4d('0x5d'),_0xee4d('0x5e'),_0xee4d('0x15')];if(!_['includes'](_0x59bc4a,_0x26d228[_0xee4d('0x5f')]()))throw new Error('Invalid\x20channel');return _0x26d228[_0xee4d('0x5f')]();}function getFilteredAgentIds(_0xa98359,_0x47ed89){var _0xa9aaba=_[_0xee4d('0x60')](_0xa98359)?_0xa98359:[_0xa98359];var _0x3b33f0=_[_0xee4d('0x35')](_0xa9aaba,function(_0xf73b3f){return db[_0x47ed89][_0xee4d('0x61')]({'where':{'name':_0xf73b3f}})['then'](function(_0x5327c6){if(!_0x5327c6)return[];return _0x5327c6[_0xee4d('0x62')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xee4d('0x63')](_0x3b33f0)['then'](function(_0x51cb79){var _0x2b2c5e=_(_0x51cb79)['flatten']()[_0xee4d('0x35')]('id')[_0xee4d('0x64')]()['value']();return _0x2b2c5e;});}function getUpdatedSortOptions(_0x451970){var _0x5aa7b7={'fields':[],'order':null};var _0x1c4165=_0x451970['split'](',');_0x5aa7b7[_0xee4d('0x65')]=_[_0xee4d('0x3e')](_0x1c4165,function(_0x146df8){if(!_0x146df8['includes'](_0xee4d('0x66')))return!![];_0x5aa7b7[_0xee4d('0x67')]=_[_0xee4d('0x68')](_0x146df8,'-')?_0xee4d('0x69'):_0xee4d('0x6a');return![];});return _0x5aa7b7;}function orderAgentsByStatus(_0x3c1587,_0x245403){return _0x3c1587[_0xee4d('0x6b')](function(_0x31c892,_0x37de8c){if(_0x31c892[_0xee4d('0x66')]===_0x37de8c[_0xee4d('0x66')]&&_0x31c892[_0xee4d('0x66')]==='pause'){if(_0x245403==='DESC')return(_0x31c892['pauseType']||'')<(_0x37de8c['pauseType']||'')?0x1:-0x1;return _0x31c892[_0xee4d('0x6c')]<_0x37de8c['pauseType']?-0x1:0x1;}else{if(_0x245403===_0xee4d('0x69'))return _0x31c892[_0xee4d('0x66')]<_0x37de8c['globalStatus']?0x1:-0x1;return _0x31c892[_0xee4d('0x66')]<_0x37de8c[_0xee4d('0x66')]?-0x1:0x1;}});}exports[_0xee4d('0x62')]=function(_0x102f22,_0x262678){var _0x51250c={'count':0x0,'rows':[]},_0x448fae={},_0x3e8917,_0x3926bf,_0x407aef,_0xb62ceb,_0x5cdfd5=[_0xee4d('0x6d'),_0xee4d('0x46'),_0xee4d('0x6e'),_0xee4d('0x6f'),_0xee4d('0x6c'),_0xee4d('0x6f'),'internal',_0xee4d('0x70'),_0xee4d('0x4f'),_0xee4d('0x71'),_0xee4d('0x51'),_0xee4d('0x52'),_0xee4d('0x72'),_0xee4d('0x50'),'voicePause','chatCapacity',_0xee4d('0x73'),_0xee4d('0x74'),'smsCapacity',_0xee4d('0x75'),'faxCapacity',_0xee4d('0x76'),'openchannelCurrentCapacity',_0xee4d('0x77'),_0xee4d('0x78'),'whatsappCurrentCapacity',_0xee4d('0x79'),'chatStatus',_0xee4d('0x7a'),_0xee4d('0x58'),'smsStatus','whatsappStatus','faxStatus',_0xee4d('0x55'),'chatStatusTime',_0xee4d('0x7b'),_0xee4d('0x7c'),'smsStatusTime',_0xee4d('0x7d'),'faxStatusTime','voiceStatusTime',_0xee4d('0x3f'),_0xee4d('0x7e'),'screenrecording',_0xee4d('0x7f'),_0xee4d('0x80'),'routealias'],_0x12bbac=['chatPause',_0xee4d('0x71'),_0xee4d('0x51'),_0xee4d('0x52'),_0xee4d('0x72'),_0xee4d('0x50'),_0xee4d('0x53'),'online'];Promise[_0xee4d('0x81')]()['then'](function(){if(_0x102f22[_0xee4d('0x82')]['channel'])_0x3e8917=validateChannel(_0x102f22[_0xee4d('0x82')][_0xee4d('0x83')]);if(!_0x102f22['query'][_0xee4d('0x6b')]||!_0x102f22['query']['sort'][_0xee4d('0x84')](_0xee4d('0x66')))return;var _0x5f1ba9=getUpdatedSortOptions(_0x102f22[_0xee4d('0x82')]['sort']);_0x102f22[_0xee4d('0x82')][_0xee4d('0x6b')]=_0x5f1ba9[_0xee4d('0x65')][_0xee4d('0x85')](',');_0x3926bf=_0x5f1ba9['order'];})[_0xee4d('0x13')](function(){if(!_0x102f22['query'][_0xee4d('0x86')])return[];var _0x482b06=_[_0xee4d('0x16')](_0x3e8917)+_0xee4d('0x48');return getFilteredAgentIds(_0x102f22[_0xee4d('0x82')][_0xee4d('0x86')],_0x482b06);})[_0xee4d('0x13')](function(_0x1edff4){var _0x5e824e=_['map'](db['User'][_0xee4d('0x87')],function(_0x376508){return{'name':_0x376508[_0xee4d('0x88')],'type':_0x376508[_0xee4d('0x89')][_0xee4d('0x8a')]};});_0x102f22[_0xee4d('0x82')][_0xee4d('0x8b')]='agent';_0x102f22['query'][_0xee4d('0x46')]=!![];_0x448fae=qs[_0xee4d('0x8c')](_0x5e824e,_0x102f22);_0x448fae[_0xee4d('0x8d')]=!![];if(!_[_0xee4d('0x8e')](_0x1edff4)){_0x448fae[_0xee4d('0x8f')]=_['merge'](_0x448fae[_0xee4d('0x8f')],{'$and':[{'id':{'$in':_0x1edff4}}]});}else if(!_[_0xee4d('0x8e')](_0x102f22[_0xee4d('0x82')][_0xee4d('0x86')])){return _0x51250c;}if(_0x102f22['user']['role']===_0xee4d('0x90')){var _0x40600e={'params':{'id':_0x102f22[_0xee4d('0x90')]['userProfileId']},'query':{'section':_0xee4d('0x12'),'role':_0xee4d('0x91'),'online':!![],'nolimit':_0x102f22[_0xee4d('0x82')][_0xee4d('0x92')],'sort':_0x102f22['query'][_0xee4d('0x6b')],'filter':_0x102f22['query'][_0xee4d('0x3e')],'raw':!![],'ids':_0x1edff4}};return db['UserProfile'][_0xee4d('0x93')](_0x40600e);}return db[_0xee4d('0x47')][_0xee4d('0x94')](_0x448fae);})[_0xee4d('0x13')](function(_0x303976){_0x51250c['count']=_0x303976[_0xee4d('0x9')];_0x407aef=_0x303976[_0xee4d('0x95')];return getRealtimeAgents();})[_0xee4d('0x13')](function(_0xf81037){_0xb62ceb=_0xf81037[_0xee4d('0x95')];return _0x407aef[_0xee4d('0x35')](function(_0x4d5803){var _0x2d900a=_['find'](_0xb62ceb,['id',_0x4d5803['id']]);if(_0x2d900a)_[_0xee4d('0x14')](_0x4d5803,_[_0xee4d('0x3d')](_['omit'](_0x2d900a,_0x12bbac),_0x5cdfd5));_0x4d5803[_0xee4d('0x66')]=getAgentStatus(_0x4d5803);return _0x4d5803;});})[_0xee4d('0x13')](function(_0x2ea156){var _0x5b4b96;if(_0x102f22['query']['globalStatusFilter']){_0x5b4b96=_['filter'](_0x2ea156,[_0xee4d('0x66'),_0x102f22[_0xee4d('0x82')][_0xee4d('0x96')]]);if(_0x102f22[_0xee4d('0x82')][_0xee4d('0x97')]){_0x5b4b96=_[_0xee4d('0x3e')](_0x5b4b96,[_0xee4d('0x6c'),_0x102f22['query']['pauseTypeFilter']]);}}if(_0x5b4b96)_0x2ea156=_0x5b4b96;if(!_0x3926bf)return _0x2ea156;return orderAgentsByStatus(_0x2ea156,_0x3926bf);})[_0xee4d('0x13')](function(_0x163f30){_0x51250c[_0xee4d('0x95')]=_0x163f30;return _0x51250c;})[_0xee4d('0x13')](respondWithFilteredResult(_0x262678,_0x448fae))[_0xee4d('0x1a')](handleError(_0x262678,null));};exports['getQueues']=function(_0x317e90,_0x262bc3){var _0xd88b98={'count':0x0,'rows':[]},_0x8b4c67={},_0x57b25a,_0x2ba47b,_0x3f0e2b,_0x2837d3,_0x5e6ccf;Promise[_0xee4d('0x81')]()[_0xee4d('0x13')](function(){if(_0x317e90[_0xee4d('0x82')]['channel'])_0x57b25a=validateChannel(_0x317e90[_0xee4d('0x82')][_0xee4d('0x83')]);var _0xd7c957=_[_0xee4d('0x16')](_0x57b25a)+'Queue';var _0x2871ea=_['map'](db[_0xd7c957][_0xee4d('0x87')],function(_0x138d64){return{'name':_0x138d64[_0xee4d('0x88')],'type':_0x138d64['type'][_0xee4d('0x8a')]};});_0x8b4c67=qs[_0xee4d('0x8c')](_0x2871ea,_0x317e90);if(_0x317e90['user']['role']===_0xee4d('0x90')){var _0x27da1e={'params':{'id':_0x317e90[_0xee4d('0x90')][_0xee4d('0x98')]},'query':{'section':_0x57b25a===_0xee4d('0x15')&&_0x317e90['query'][_0xee4d('0x89')]==='outbound'?'QueueCampaigns':_[_0xee4d('0x16')](_0x57b25a)+'Queues','type':_0x317e90[_0xee4d('0x82')]['type'],'nolimit':!![],'sort':'name','filter':_0x317e90[_0xee4d('0x82')][_0xee4d('0x3e')]}};return db[_0xee4d('0x99')][_0xee4d('0x93')](_0x27da1e);}return db[_0xd7c957][_0xee4d('0x94')](_0x8b4c67);})[_0xee4d('0x13')](function(_0x14bca9){_0xd88b98[_0xee4d('0x9')]=_0x14bca9[_0xee4d('0x9')];_0x2ba47b=_0x14bca9[_0xee4d('0x95')];return getRealtimeQueues(_0x317e90,_0x57b25a);})[_0xee4d('0x13')](function(_0x20d2a4){_0x2837d3=_0x20d2a4['rows'];return getRealtimeAgents();})['then'](function(_0x5ac1c6){_0x3f0e2b=_0x5ac1c6[_0xee4d('0x95')];if(_0x57b25a!='voice')return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x139b4b){_0x5e6ccf=_0x139b4b?_0x139b4b['rows']:[];return initializeQueues(_0x2ba47b,_0x2837d3,_0x57b25a,_0x317e90[_0xee4d('0x82')][_0xee4d('0x89')]);})['then'](function(_0x2d2b20){var _0x45a404=_0x2d2b20['map'](function(_0x2c519a){if(_0x57b25a===_0xee4d('0x15'))return getVoiceQueueAgents(_0x2c519a,_0x2ba47b,_0x3f0e2b,_0x5e6ccf);else return getQueueAgents(_0x2c519a,_0x3f0e2b,_0x57b25a);});return Promise['all'](_0x45a404);})[_0xee4d('0x13')](function(_0x479045){_0xd88b98['rows']=_0x479045;return _0xd88b98;})['then'](respondWithFilteredResult(_0x262bc3,_0x8b4c67))[_0xee4d('0x1a')](handleError(_0x262bc3,null));};
\ No newline at end of file
index 1fb275a..51fd679 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(_0xbeca8d,_0x597fae){var _0x4cb4d8=function(_0x4b503a){while(--_0x4b503a){_0xbeca8d['push'](_0xbeca8d['shift']());}};_0x4cb4d8(++_0x597fae);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4b5fd,_0x8b2af5){var _0x190ec7=function(_0x585d71){while(--_0x585d71){_0x4b5fd['push'](_0x4b5fd['shift']());}};_0x190ec7(++_0x8b2af5);}(_0xe706,0xa3));var _0x6e70=function(_0x138387,_0x2a16ac){_0x138387=_0x138387-0x0;var _0x45b15a=_0xe706[_0x138387];return _0x45b15a;};'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 cd09934..2121cd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a93=['DATE','INTEGER','exports','STRING'];(function(_0x471567,_0x28a2fc){var _0x16d4a2=function(_0x18253a){while(--_0x18253a){_0x471567['push'](_0x471567['shift']());}};_0x16d4a2(++_0x28a2fc);}(_0x5a93,0xf6));var _0x35a9=function(_0x460013,_0x3446d9){_0x460013=_0x460013-0x0;var _0x29e0d5=_0x5a93[_0x460013];return _0x29e0d5;};'use strict';var Sequelize=require('sequelize');module[_0x35a9('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x35a9('0x1')]},'scheduledat':{'type':Sequelize[_0x35a9('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x35a9('0x2')]},'ringtime':{'type':Sequelize[_0x35a9('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x35a9('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x35a9('0x1')]}};
\ No newline at end of file
+var _0x3ca4=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x2e58c7,_0x23d092){var _0x26eb00=function(_0x343124){while(--_0x343124){_0x2e58c7['push'](_0x2e58c7['shift']());}};_0x26eb00(++_0x23d092);}(_0x3ca4,0x17d));var _0x43ca=function(_0x322daa,_0x3b6187){_0x322daa=_0x322daa-0x0;var _0x45b6dc=_0x3ca4[_0x322daa];return _0x45b6dc;};'use strict';var Sequelize=require(_0x43ca('0x0'));module[_0x43ca('0x1')]={'state':{'type':Sequelize[_0x43ca('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x43ca('0x3')]},'starttime':{'type':Sequelize[_0x43ca('0x4')]},'responsetime':{'type':Sequelize[_0x43ca('0x4')]},'ringtime':{'type':Sequelize[_0x43ca('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x43ca('0x3')]},'campaigntype':{'type':Sequelize[_0x43ca('0x3')]},'membername':{'type':Sequelize[_0x43ca('0x3')]}};
\ No newline at end of file
index e435f34..d26fd0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f3e=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview'];(function(_0x311fd4,_0x2fc056){var _0x2a7835=function(_0x4945e7){while(--_0x4945e7){_0x311fd4['push'](_0x311fd4['shift']());}};_0x2a7835(++_0x2fc056);}(_0x8f3e,0x145));var _0xe8f3=function(_0x37f1b3,_0x48a496){_0x37f1b3=_0x37f1b3-0x0;var _0x124389=_0x8f3e[_0x37f1b3];return _0x124389;};'use strict';var _=require(_0xe8f3('0x0'));var util=require(_0xe8f3('0x1'));var logger=require(_0xe8f3('0x2'))(_0xe8f3('0x3'));var moment=require(_0xe8f3('0x4'));var BPromise=require(_0xe8f3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8f3('0x6'));var rimraf=require('rimraf');var config=require(_0xe8f3('0x7'));var attributes=require(_0xe8f3('0x8'));module[_0xe8f3('0x9')]=function(_0x21c4ca,_0x4368e5){return _0x21c4ca[_0xe8f3('0xa')](_0xe8f3('0xb'),attributes,{'tableName':_0xe8f3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe544=['ReportAgentPreview','report_agent_preview','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe544,0xa4));var _0x4e54=function(_0x36b686,_0x1a5757){_0x36b686=_0x36b686-0x0;var _0x4dcac4=_0xe544[_0x36b686];return _0x4dcac4;};'use strict';var _=require('lodash');var util=require(_0x4e54('0x0'));var logger=require('../../config/logger')(_0x4e54('0x1'));var moment=require(_0x4e54('0x2'));var BPromise=require(_0x4e54('0x3'));var rp=require(_0x4e54('0x4'));var fs=require('fs');var path=require(_0x4e54('0x5'));var rimraf=require(_0x4e54('0x6'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x966c5c,_0x5ab875){return _0x966c5c['define'](_0x4e54('0x7'),attributes,{'tableName':_0x4e54('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b022a8d..b5d8125 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05ab=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','ReportAgentPreview','create','body','options','raw','then','CreateReportAgentPreview','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x15b0db,_0x3ecca3){var _0x332503=function(_0x3827a3){while(--_0x3827a3){_0x15b0db['push'](_0x15b0db['shift']());}};_0x332503(++_0x3ecca3);}(_0x05ab,0x164));var _0xb05a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x05ab[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0xb05a('0x0'));var util=require(_0xb05a('0x1'));var moment=require(_0xb05a('0x2'));var BPromise=require(_0xb05a('0x3'));var rs=require(_0xb05a('0x4'));var fs=require('fs');var Redis=require(_0xb05a('0x5'));var db=require(_0xb05a('0x6'))['db'];var utils=require(_0xb05a('0x7'));var logger=require(_0xb05a('0x8'))(_0xb05a('0x9'));var config=require(_0xb05a('0xa'));var jayson=require(_0xb05a('0xb'));var client=jayson[_0xb05a('0xc')][_0xb05a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1cdc47,_0xf27351,_0x135fe5){return new BPromise(function(_0x3d62d5,_0x438bd4){return client[_0xb05a('0xe')](_0x1cdc47,_0x135fe5)['then'](function(_0x3e08ed){logger[_0xb05a('0xf')](_0xb05a('0x10'),_0xf27351,_0xb05a('0x11'));logger[_0xb05a('0x12')](_0xb05a('0x13'),_0xf27351,_0xb05a('0x11'),JSON['stringify'](_0x3e08ed));if(_0x3e08ed[_0xb05a('0x14')]){if(_0x3e08ed[_0xb05a('0x14')][_0xb05a('0x15')]===0x1f4){logger[_0xb05a('0x14')](_0xb05a('0x10'),_0xf27351,_0x3e08ed[_0xb05a('0x14')][_0xb05a('0x16')]);return _0x438bd4(_0x3e08ed[_0xb05a('0x14')][_0xb05a('0x16')]);}logger['error'](_0xb05a('0x10'),_0xf27351,_0x3e08ed['error'][_0xb05a('0x16')]);return _0x3d62d5(_0x3e08ed['error'][_0xb05a('0x16')]);}else{logger[_0xb05a('0xf')](_0xb05a('0x10'),_0xf27351,_0xb05a('0x11'));_0x3d62d5(_0x3e08ed[_0xb05a('0x17')][_0xb05a('0x16')]);}})['catch'](function(_0x66cfe7){logger[_0xb05a('0x14')](_0xb05a('0x10'),_0xf27351,_0x66cfe7);_0x438bd4(_0x66cfe7);});});}exports['CreateReportAgentPreview']=function(_0x462403){var _0x42c681=this;return new Promise(function(_0xcc95e4,_0x38a5fd){return db[_0xb05a('0x18')][_0xb05a('0x19')](_0x462403[_0xb05a('0x1a')],{'raw':_0x462403['options']?_0x462403[_0xb05a('0x1b')][_0xb05a('0x1c')]===undefined?!![]:![]:!![]})[_0xb05a('0x1d')](function(_0x5040b7){logger['info'](_0xb05a('0x1e'),_0x462403);logger['debug'](_0xb05a('0x1e'),_0x462403,JSON[_0xb05a('0x1f')](_0x5040b7));_0xcc95e4(_0x5040b7);})[_0xb05a('0x20')](function(_0x42f462){logger['error'](_0xb05a('0x1e'),_0x42f462[_0xb05a('0x16')],_0x462403);_0x38a5fd(_0x42c681[_0xb05a('0x14')](0x1f4,_0x42f462[_0xb05a('0x16')]));});});};
\ No newline at end of file
+var _0xe484=['info','CreateReportAgentPreview','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ReportAgentPreview','create','body','options','raw'];(function(_0x148247,_0x5439b1){var _0x70d17a=function(_0x3256b2){while(--_0x3256b2){_0x148247['push'](_0x148247['shift']());}};_0x70d17a(++_0x5439b1);}(_0xe484,0x1b4));var _0x4e48=function(_0x6c3f78,_0x5c1b36){_0x6c3f78=_0x6c3f78-0x0;var _0x5add5c=_0xe484[_0x6c3f78];return _0x5add5c;};'use strict';var _=require(_0x4e48('0x0'));var util=require(_0x4e48('0x1'));var moment=require(_0x4e48('0x2'));var BPromise=require(_0x4e48('0x3'));var rs=require(_0x4e48('0x4'));var fs=require('fs');var Redis=require(_0x4e48('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e48('0x6'));var logger=require(_0x4e48('0x7'))(_0x4e48('0x8'));var config=require(_0x4e48('0x9'));var jayson=require(_0x4e48('0xa'));var client=jayson[_0x4e48('0xb')][_0x4e48('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d0d71,_0x3681ed,_0x159375){return new BPromise(function(_0x9c21a4,_0x15a379){return client[_0x4e48('0xd')](_0x1d0d71,_0x159375)[_0x4e48('0xe')](function(_0x41cea0){logger['info'](_0x4e48('0xf'),_0x3681ed,_0x4e48('0x10'));logger[_0x4e48('0x11')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x3681ed,_0x4e48('0x10'),JSON[_0x4e48('0x12')](_0x41cea0));if(_0x41cea0[_0x4e48('0x13')]){if(_0x41cea0[_0x4e48('0x13')][_0x4e48('0x14')]===0x1f4){logger[_0x4e48('0x13')](_0x4e48('0xf'),_0x3681ed,_0x41cea0[_0x4e48('0x13')]['message']);return _0x15a379(_0x41cea0['error']['message']);}logger[_0x4e48('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x3681ed,_0x41cea0['error'][_0x4e48('0x15')]);return _0x9c21a4(_0x41cea0[_0x4e48('0x13')]['message']);}else{logger['info'](_0x4e48('0xf'),_0x3681ed,'request\x20sent');_0x9c21a4(_0x41cea0[_0x4e48('0x16')][_0x4e48('0x15')]);}})[_0x4e48('0x17')](function(_0x113f87){logger[_0x4e48('0x13')](_0x4e48('0xf'),_0x3681ed,_0x113f87);_0x15a379(_0x113f87);});});}exports['CreateReportAgentPreview']=function(_0x141e9b){var _0xb56ca3=this;return new Promise(function(_0x3121e4,_0x5b23a2){return db[_0x4e48('0x18')][_0x4e48('0x19')](_0x141e9b[_0x4e48('0x1a')],{'raw':_0x141e9b[_0x4e48('0x1b')]?_0x141e9b[_0x4e48('0x1b')][_0x4e48('0x1c')]===undefined?!![]:![]:!![]})[_0x4e48('0xe')](function(_0xd6f9d1){logger[_0x4e48('0x1d')](_0x4e48('0x1e'),_0x141e9b);logger[_0x4e48('0x11')](_0x4e48('0x1e'),_0x141e9b,JSON[_0x4e48('0x12')](_0xd6f9d1));_0x3121e4(_0xd6f9d1);})[_0x4e48('0x17')](function(_0x515669){logger[_0x4e48('0x13')]('CreateReportAgentPreview',_0x515669[_0x4e48('0x15')],_0x141e9b);_0x5b23a2(_0xb56ca3[_0x4e48('0x13')](0x1f4,_0x515669[_0x4e48('0x15')]));});});};
\ No newline at end of file
index b4e88e8..dd2033f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f83=['/telephones','telephones','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','fax','/fax/queues/:id','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannelMixMonitor','get','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agentCapacity'];(function(_0x2c55bf,_0x11108a){var _0x273b74=function(_0x30b7be){while(--_0x30b7be){_0x2c55bf['push'](_0x2c55bf['shift']());}};_0x273b74(++_0x11108a);}(_0x3f83,0x153));var _0x33f8=function(_0x39a798,_0x4d25e9){_0x39a798=_0x39a798-0x0;var _0x533599=_0x3f83[_0x39a798];return _0x533599;};'use strict';var multer=require(_0x33f8('0x0'));var util=require(_0x33f8('0x1'));var path=require(_0x33f8('0x2'));var express=require(_0x33f8('0x3'));var router=express[_0x33f8('0x4')]();var auth=require(_0x33f8('0x5'));var controller=require(_0x33f8('0x6'));router['get'](_0x33f8('0x7'),auth['isAuthenticated'](),controller['voiceChannels']);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0x33f8('0x8')](),controller[_0x33f8('0x9')]);router[_0x33f8('0xa')](_0x33f8('0xb'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x33f8('0xa')](_0x33f8('0xc'),auth[_0x33f8('0x8')](),controller[_0x33f8('0xd')]);router[_0x33f8('0xa')](_0x33f8('0xe'),auth['isAuthenticated'](),controller[_0x33f8('0xf')]);router[_0x33f8('0xa')](_0x33f8('0x10'),auth[_0x33f8('0x8')](),controller[_0x33f8('0x11')]);router['get'](_0x33f8('0x12'),auth[_0x33f8('0x8')](),controller['mailAccounts']);router['get'](_0x33f8('0x13'),auth[_0x33f8('0x8')](),controller[_0x33f8('0x14')]);router[_0x33f8('0xa')](_0x33f8('0x15'),auth['isAuthenticated'](),controller['smsQueues']);router['get']('/whatsapp/queues',auth[_0x33f8('0x8')](),controller[_0x33f8('0x16')]);router['get'](_0x33f8('0x17'),auth[_0x33f8('0x8')](),controller[_0x33f8('0x18')]);router[_0x33f8('0xa')]('/voice/queues/preview/:id',auth[_0x33f8('0x8')](),controller[_0x33f8('0x19')]);router[_0x33f8('0xa')](_0x33f8('0x1a'),auth[_0x33f8('0x8')](),controller['voiceQueuesChannels']);router[_0x33f8('0xa')](_0x33f8('0x1b'),auth[_0x33f8('0x8')](),controller[_0x33f8('0x1c')]);router['get'](_0x33f8('0x1d'),auth[_0x33f8('0x8')](),controller[_0x33f8('0x1e')]);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x33f8('0x8')](),controller[_0x33f8('0x1f')]);router[_0x33f8('0xa')](_0x33f8('0x20'),auth[_0x33f8('0x8')](),controller[_0x33f8('0x21')]);router[_0x33f8('0x22')](_0x33f8('0x20'),auth[_0x33f8('0x8')](),controller['updateVoiceQueue']);router[_0x33f8('0xa')](_0x33f8('0x23'),auth[_0x33f8('0x8')](),controller[_0x33f8('0x24')]);router[_0x33f8('0xa')](_0x33f8('0x25'),auth[_0x33f8('0x8')](),controller[_0x33f8('0x26')]);router[_0x33f8('0xa')](_0x33f8('0x27'),auth['isAuthenticated'](),controller['agents']);router['put']('/agents/:id/capacity',auth[_0x33f8('0x8')](),controller[_0x33f8('0x28')]);router[_0x33f8('0xa')](_0x33f8('0x29'),auth['isAuthenticated'](),controller[_0x33f8('0x2a')]);router[_0x33f8('0xa')]('/trunks',auth[_0x33f8('0x8')](),controller['trunks']);router[_0x33f8('0xa')](_0x33f8('0x2b'),auth['isAuthenticated'](),controller[_0x33f8('0x2c')]);router[_0x33f8('0xa')]('/fax/accounts',auth[_0x33f8('0x8')](),controller[_0x33f8('0x2d')]);router[_0x33f8('0xa')](_0x33f8('0x2e'),auth[_0x33f8('0x8')](),controller[_0x33f8('0x2f')]);router[_0x33f8('0xa')](_0x33f8('0x30'),auth['isAuthenticated'](),controller[_0x33f8('0x31')]);router['get']('/openchannel/queues/waitinginteractions',auth[_0x33f8('0x8')](),controller[_0x33f8('0x32')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0x33f8('0x33'),auth[_0x33f8('0x8')](),controller[_0x33f8('0x34')]);router['get']('/whatsapp/queues/waitinginteractions',auth[_0x33f8('0x8')](),controller[_0x33f8('0x35')]);router[_0x33f8('0xa')](_0x33f8('0x36'),auth[_0x33f8('0x8')](),controller[_0x33f8('0x37')]);router[_0x33f8('0x38')](_0x33f8('0x39'),auth[_0x33f8('0x8')](),controller[_0x33f8('0x3a')]('mail'));router[_0x33f8('0xa')](_0x33f8('0x3b'),auth['isAuthenticated'](),controller[_0x33f8('0x3c')]);router[_0x33f8('0x38')](_0x33f8('0x3d'),auth['isAuthenticated'](),controller['queueNotify'](_0x33f8('0x3e')));router[_0x33f8('0xa')](_0x33f8('0x3f'),auth[_0x33f8('0x8')](),controller['showChatQueues']);router['post']('/fax/queues/:id/notify',auth[_0x33f8('0x8')](),controller['queueNotify'](_0x33f8('0x40')));router[_0x33f8('0xa')](_0x33f8('0x41'),auth[_0x33f8('0x8')](),controller['showFaxQueues']);router['post']('/openchannel/queues/:id/notify',auth[_0x33f8('0x8')](),controller['queueNotify'](_0x33f8('0x42')));router[_0x33f8('0xa')](_0x33f8('0x43'),auth[_0x33f8('0x8')](),controller[_0x33f8('0x44')]);router[_0x33f8('0x38')](_0x33f8('0x45'),auth[_0x33f8('0x8')](),controller['queueNotify']('sms'));router[_0x33f8('0x38')]('/whatsapp/queues/:id/notify',auth[_0x33f8('0x8')](),controller[_0x33f8('0x3a')](_0x33f8('0x46')));router['get'](_0x33f8('0x47'),auth['isAuthenticated'](),controller[_0x33f8('0x48')]);router[_0x33f8('0xa')](_0x33f8('0x49'),auth[_0x33f8('0x8')](),controller[_0x33f8('0x4a')]);router['post'](_0x33f8('0x4b'),auth['isAuthenticated'](),controller['agentNotify']);module['exports']=router;
\ No newline at end of file
+var _0x68dd=['mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','util','path','express','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/chat/queues'];(function(_0xea7ee1,_0x1bff19){var _0x5ac82d=function(_0x1bb138){while(--_0x1bb138){_0xea7ee1['push'](_0xea7ee1['shift']());}};_0x5ac82d(++_0x1bff19);}(_0x68dd,0xda));var _0xd68d=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0x68dd[_0x412e27];return _0x53da42;};'use strict';var multer=require('multer');var util=require(_0xd68d('0x0'));var path=require(_0xd68d('0x1'));var express=require(_0xd68d('0x2'));var router=express[_0xd68d('0x3')]();var auth=require(_0xd68d('0x4'));var controller=require(_0xd68d('0x5'));router[_0xd68d('0x6')]('/voice/channels',auth[_0xd68d('0x7')](),controller[_0xd68d('0x8')]);router[_0xd68d('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth[_0xd68d('0x7')](),controller[_0xd68d('0x9')]);router[_0xd68d('0x6')](_0xd68d('0xa'),auth[_0xd68d('0x7')](),controller[_0xd68d('0xb')]);router[_0xd68d('0x6')]('/voice/queues',auth[_0xd68d('0x7')](),controller['voiceQueues']);router['get'](_0xd68d('0xc'),auth[_0xd68d('0x7')](),controller['chatQueues']);router[_0xd68d('0x6')]('/mail/queues',auth['isAuthenticated'](),controller[_0xd68d('0xd')]);router[_0xd68d('0x6')](_0xd68d('0xe'),auth[_0xd68d('0x7')](),controller[_0xd68d('0xf')]);router['get'](_0xd68d('0x10'),auth[_0xd68d('0x7')](),controller['openchannelQueues']);router[_0xd68d('0x6')](_0xd68d('0x11'),auth['isAuthenticated'](),controller[_0xd68d('0x12')]);router[_0xd68d('0x6')]('/whatsapp/queues',auth[_0xd68d('0x7')](),controller[_0xd68d('0x13')]);router[_0xd68d('0x6')](_0xd68d('0x14'),auth['isAuthenticated'](),controller['faxQueues']);router[_0xd68d('0x6')]('/voice/queues/preview/:id',auth[_0xd68d('0x7')](),controller[_0xd68d('0x15')]);router[_0xd68d('0x6')](_0xd68d('0x16'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x17')]);router['get'](_0xd68d('0x18'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x19')]);router[_0xd68d('0x6')](_0xd68d('0x1a'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x1b')]);router['get'](_0xd68d('0x1c'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x1d')]);router['get']('/voice/queues/:id',auth[_0xd68d('0x7')](),controller[_0xd68d('0x1e')]);router['put'](_0xd68d('0x1f'),auth['isAuthenticated'](),controller[_0xd68d('0x20')]);router[_0xd68d('0x6')](_0xd68d('0x21'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x22')]);router['get']('/outbound/channels',auth[_0xd68d('0x7')](),controller['outboundChannels']);router[_0xd68d('0x6')]('/agents',auth['isAuthenticated'](),controller[_0xd68d('0x23')]);router[_0xd68d('0x24')](_0xd68d('0x25'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x26')]);router['get'](_0xd68d('0x27'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x28')]);router[_0xd68d('0x6')](_0xd68d('0x29'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x2a')]);router[_0xd68d('0x6')](_0xd68d('0x2b'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x2c')]);router[_0xd68d('0x6')](_0xd68d('0x2d'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x2e')]);router[_0xd68d('0x6')]('/chat/queues/waitinginteractions',auth[_0xd68d('0x7')](),controller[_0xd68d('0x2f')]);router[_0xd68d('0x6')](_0xd68d('0x30'),auth[_0xd68d('0x7')](),controller['mailQueuesWaitingInteractions']);router['get']('/openchannel/queues/waitinginteractions',auth[_0xd68d('0x7')](),controller[_0xd68d('0x31')]);router[_0xd68d('0x6')](_0xd68d('0x32'),auth[_0xd68d('0x7')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0xd68d('0x6')](_0xd68d('0x33'),auth['isAuthenticated'](),controller[_0xd68d('0x34')]);router[_0xd68d('0x6')]('/whatsapp/queues/waitinginteractions',auth[_0xd68d('0x7')](),controller['whatsappQueuesWaitingInteractions']);router[_0xd68d('0x6')](_0xd68d('0x35'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x36')]);router[_0xd68d('0x37')]('/mail/queues/:id/notify',auth[_0xd68d('0x7')](),controller[_0xd68d('0x38')](_0xd68d('0x39')));router[_0xd68d('0x6')](_0xd68d('0x3a'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x3b')]);router['post']('/chat/queues/:id/notify',auth[_0xd68d('0x7')](),controller[_0xd68d('0x38')]('chat'));router['get']('/chat/queues/:id',auth[_0xd68d('0x7')](),controller['showChatQueues']);router[_0xd68d('0x37')](_0xd68d('0x3c'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x38')](_0xd68d('0x3d')));router[_0xd68d('0x6')](_0xd68d('0x3e'),auth['isAuthenticated'](),controller['showFaxQueues']);router[_0xd68d('0x37')](_0xd68d('0x3f'),auth['isAuthenticated'](),controller[_0xd68d('0x38')](_0xd68d('0x40')));router[_0xd68d('0x6')](_0xd68d('0x41'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x42')]);router[_0xd68d('0x37')](_0xd68d('0x43'),auth[_0xd68d('0x7')](),controller['queueNotify'](_0xd68d('0x44')));router[_0xd68d('0x37')](_0xd68d('0x45'),auth[_0xd68d('0x7')](),controller['queueNotify'](_0xd68d('0x46')));router[_0xd68d('0x6')](_0xd68d('0x47'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x48')]);router[_0xd68d('0x6')](_0xd68d('0x49'),auth[_0xd68d('0x7')](),controller['showWhatsappQueues']);router[_0xd68d('0x37')](_0xd68d('0x4a'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x4b')]);module[_0xd68d('0x4c')]=router;
\ No newline at end of file
index f23dfa1..fbf35d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0e=['merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','body','interaction','user','hasOwnProperty','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','MemberReport','findOrCreate','interface','SIP/%s','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','showChatQueues','ChatQueues','mailQueues','showMailQueues','openchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','findOne','messageId','Interaction','update','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','agent','\x20Message\x20not\x20found','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','message','result','catch','json','stack','name','send','isNil','rows','voiceChannels','query','then','VoiceChannelMixMonitor'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5137b1,_0x539685){_0x5137b1=_0x5137b1-0x0;var _0x4c3b43=_0x8d0e[_0x5137b1];return _0x4c3b43;};'use strict';var BPromise=require(_0xe8d0('0x0'));var moment=require(_0xe8d0('0x1'));var _=require(_0xe8d0('0x2'));var util=require(_0xe8d0('0x3'));var db=require(_0xe8d0('0x4'))['db'];var logger=require(_0xe8d0('0x5'))(_0xe8d0('0x6'));var jayson=require(_0xe8d0('0x7'));var amiClient=jayson[_0xe8d0('0x8')]['http']({'port':0x232a});var mailClient=jayson[_0xe8d0('0x8')]['http']({'port':0x232b});var routingClient=jayson['client'][_0xe8d0('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x92483d,_0x469d37,_0xcc03d0){return new BPromise(function(_0x2b6dce,_0x13aa63){var _0x1b353a=_0xcc03d0?_0xcc03d0:amiClient;return _0x1b353a[_0xe8d0('0xa')](_0x92483d,_0x469d37)['then'](function(_0x10e56c){if(_0x10e56c[_0xe8d0('0xb')]){if(_0x10e56c[_0xe8d0('0xb')]['code']===0x1f4){return _0x13aa63(_0x10e56c['error'][_0xe8d0('0xc')]);}return _0x2b6dce(_0x10e56c[_0xe8d0('0xb')][_0xe8d0('0xc')]);}else{_0x2b6dce(_0x10e56c[_0xe8d0('0xd')]);}})[_0xe8d0('0xe')](function(_0x41de69){_0x13aa63(_0x41de69);});});}function respondWithResult(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xc8;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['status'](_0x38fac0)[_0xe8d0('0xf')](_0x15b9e5);}return _0x5934b2['sendStatus'](0x194);};}function handleError(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0x1f4;return function(_0x2aa906){logger[_0xe8d0('0xb')](_0x2aa906[_0xe8d0('0x10')]);if(_0x2aa906[_0xe8d0('0x11')]){delete _0x2aa906[_0xe8d0('0x11')];}_0x59b4b7['status'](_0x90a1ea)[_0xe8d0('0x12')](_0x2aa906);};}function findById(_0x49554d){return function(_0x6d932b){if(!_[_0xe8d0('0x13')](_0x49554d)&&!_[_0xe8d0('0x13')](_0x6d932b)&&!_['isNil'](_0x6d932b['rows'])){return _['find'](_0x6d932b[_0xe8d0('0x14')],function(_0x384854){return _0x384854['id']==_0x49554d;});}return null;};}exports[_0xe8d0('0x15')]=function(_0x44bbe4,_0x83177b){return respondWithRpcPromise('VoiceChannels',_0x44bbe4[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x83177b,null))['catch'](handleError(_0x83177b,null));};exports['voiceChannelMixMonitor']=function(_0x554402,_0x384a60){return respondWithRpcPromise(_0xe8d0('0x18'),_[_0xe8d0('0x19')](_0x554402[_0xe8d0('0x16')],_0x554402[_0xe8d0('0x1a')]))[_0xe8d0('0x17')](respondWithResult(_0x384a60,null))[_0xe8d0('0xe')](handleError(_0x384a60,null));};exports[_0xe8d0('0x1b')]=function(_0x32e39a,_0x5ab4e7){return respondWithRpcPromise(_0xe8d0('0x1c'),_[_0xe8d0('0x19')](_0x32e39a['query'],_0x32e39a[_0xe8d0('0x1a')]))[_0xe8d0('0x17')](respondWithResult(_0x5ab4e7,null))[_0xe8d0('0xe')](handleError(_0x5ab4e7,null));};exports[_0xe8d0('0x1d')]=function(_0x146783,_0x149dfd){return respondWithRpcPromise(_0xe8d0('0x1e'),_0x146783[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x149dfd,null))[_0xe8d0('0xe')](handleError(_0x149dfd,null));};exports[_0xe8d0('0x1f')]=function(_0x539548,_0x24982c){return respondWithRpcPromise(_0xe8d0('0x1e'),_0x539548[_0xe8d0('0x16')])['then'](findById(_0x539548[_0xe8d0('0x1a')]['id']))[_0xe8d0('0x17')](respondWithResult(_0x24982c,null))['catch'](handleError(_0x24982c,null));};exports[_0xe8d0('0x20')]=function(_0x3ffcb7,_0x11fcf2){return respondWithRpcPromise(_0xe8d0('0x21'),_[_0xe8d0('0x19')](_0x3ffcb7['body'],_0x3ffcb7[_0xe8d0('0x1a')]))['then'](respondWithResult(_0x11fcf2,null))['catch'](handleError(_0x11fcf2,null));};exports['voiceQueuesPreview']=function(_0x547a2b,_0x13cd4c){return respondWithRpcPromise(_0xe8d0('0x22'),_['merge'](_0x547a2b['query'],_0x547a2b[_0xe8d0('0x1a')]))['then'](respondWithResult(_0x13cd4c,null))[_0xe8d0('0xe')](handleError(_0x13cd4c,null));};exports[_0xe8d0('0x23')]=function(_0x327004,_0x1b2b0a){return respondWithRpcPromise(_0xe8d0('0x24'),_0x327004['query'])[_0xe8d0('0x17')](respondWithResult(_0x1b2b0a,null))[_0xe8d0('0xe')](handleError(_0x1b2b0a,null));};exports[_0xe8d0('0x25')]=function(_0x145ddb,_0x587819){return respondWithRpcPromise(_0xe8d0('0x26'),_[_0xe8d0('0x19')](_0x145ddb['query'],_0x145ddb[_0xe8d0('0x1a')]))['then'](respondWithResult(_0x587819,null))[_0xe8d0('0xe')](handleError(_0x587819,null));};exports['voiceQueuesChannelHangup']=function(_0x197e01,_0x531835){return respondWithRpcPromise(_0xe8d0('0x27'),_[_0xe8d0('0x19')](_0x197e01[_0xe8d0('0x16')],_0x197e01[_0xe8d0('0x1a')]))['then'](respondWithResult(_0x531835,null))[_0xe8d0('0xe')](handleError(_0x531835,null));};exports[_0xe8d0('0x28')]=function(_0x20eec5,_0x516243){return respondWithRpcPromise(_0xe8d0('0x29'),_[_0xe8d0('0x19')](_0x20eec5[_0xe8d0('0x16')],_0x20eec5[_0xe8d0('0x1a')]))[_0xe8d0('0x17')](respondWithResult(_0x516243,null))['catch'](handleError(_0x516243,null));};exports[_0xe8d0('0x2a')]=function(_0x1828c5,_0x10970d){return respondWithRpcPromise(_0xe8d0('0x2b'),_0x1828c5[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x10970d,null))[_0xe8d0('0xe')](handleError(_0x10970d,null));};exports[_0xe8d0('0x2c')]=function(_0x4edb3d,_0x5dff14){return respondWithRpcPromise(_0xe8d0('0x2d'),_0x4edb3d[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x5dff14,null))[_0xe8d0('0xe')](handleError(_0x5dff14,null));};exports[_0xe8d0('0x2e')]=function(_0x585d27,_0x2e4362){var _0x4bd7a2;return respondWithRpcPromise(_0xe8d0('0x2f'),_0x585d27[_0xe8d0('0x16')])[_0xe8d0('0x17')](function(_0x48fa07){_0x4bd7a2=_0x48fa07;return respondWithRpcPromise(_0xe8d0('0x2f'),_0x585d27[_0xe8d0('0x16')],routingClient);})[_0xe8d0('0x17')](function(_0x230a90){return _[_0xe8d0('0x19')]({},_0x230a90,_0x4bd7a2);})['then'](respondWithResult(_0x2e4362,null))['catch'](handleError(_0x2e4362,null));};exports['agentCapacity']=function(_0x4cf0da,_0x14ffb6){if(_0x4cf0da['body']&&_0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x31')]&&_0x4cf0da[_0xe8d0('0x32')]&&_0x4cf0da[_0xe8d0('0x32')][_0xe8d0('0x11')]){for(var _0x1156da in _0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x31')]){if(_0x4cf0da['body'][_0xe8d0('0x31')][_0xe8d0('0x33')](_0x1156da)){db['MemberReport']['findAll']({'where':{'channel':_0x1156da,'membername':_0x4cf0da[_0xe8d0('0x32')][_0xe8d0('0x11')],'type':_0xe8d0('0x34'),'exitAt':null,'uniqueid':_0x4cf0da['body'][_0xe8d0('0x31')][_0x1156da]&&_0x4cf0da[_0xe8d0('0x30')]['interaction'][_0x1156da][_0xe8d0('0x35')]?{'$notIn':_0x4cf0da[_0xe8d0('0x30')]['interaction'][_0x1156da]}:{'$ne':null}}})[_0xe8d0('0x17')](function(_0x23e250){var _0x1b7866=moment()[_0xe8d0('0x36')](_0xe8d0('0x37'));for(var _0x2a6760=0x0,_0x11339d=_0x23e250[_0xe8d0('0x35')];_0x2a6760<_0x11339d;_0x2a6760+=0x1){_0x23e250[_0x2a6760]['updateAttributes']({'exitAt':_0x1b7866});}});for(var _0x31a370=0x0;_0x31a370<_0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x31')][_0x1156da][_0xe8d0('0x35')];_0x31a370+=0x1){db[_0xe8d0('0x38')][_0xe8d0('0x39')]({'where':{'channel':_0x1156da,'membername':_0x4cf0da[_0xe8d0('0x32')][_0xe8d0('0x11')],'type':_0xe8d0('0x34'),'uniqueid':_0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x31')][_0x1156da][_0x31a370],'exitAt':null},'defaults':{'channel':_0x1156da,'membername':_0x4cf0da[_0xe8d0('0x32')]['name'],'interface':_[_0xe8d0('0x13')](_0x4cf0da[_0xe8d0('0x32')][_0xe8d0('0x3a')])?util[_0xe8d0('0x36')](_0xe8d0('0x3b'),_0x4cf0da[_0xe8d0('0x32')][_0xe8d0('0x11')]):_0x4cf0da['user'][_0xe8d0('0x3a')],'type':_0xe8d0('0x34'),'enterAt':moment()[_0xe8d0('0x36')](_0xe8d0('0x37')),'role':'agent','internal':_0x4cf0da[_0xe8d0('0x32')]['internal'],'uniqueid':_0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x31')][_0x1156da][_0x31a370]}});}}}}return respondWithRpcPromise(_0xe8d0('0x3c'),{'id':_0x4cf0da[_0xe8d0('0x1a')]['id'],'capacity':_0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x3d')]},routingClient)[_0xe8d0('0x17')](respondWithResult(_0x14ffb6,null))['catch'](handleError(_0x14ffb6,null));};exports[_0xe8d0('0x3e')]=function(_0x55f93d,_0x581a34){return respondWithRpcPromise(_0xe8d0('0x3f'),_0x55f93d['query'])[_0xe8d0('0x17')](respondWithResult(_0x581a34,null))['catch'](handleError(_0x581a34,null));};exports[_0xe8d0('0x40')]=function(_0x28494c,_0x13713c){return respondWithRpcPromise(_0xe8d0('0x41'),_0x28494c['query'])[_0xe8d0('0x17')](respondWithResult(_0x13713c,null))[_0xe8d0('0xe')](handleError(_0x13713c,null));};exports[_0xe8d0('0x42')]=function(_0x2e3f1d,_0x18cc14){return respondWithRpcPromise('Campaigns',_0x2e3f1d[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x18cc14,null))[_0xe8d0('0xe')](handleError(_0x18cc14,null));};exports['chatQueues']=function(_0x2f4d43,_0x571c4e){return respondWithRpcPromise('ChatQueues',_0x2f4d43[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x571c4e,null))['catch'](handleError(_0x571c4e,null));};exports[_0xe8d0('0x43')]=function(_0x3a8074,_0x47893d){return respondWithRpcPromise(_0xe8d0('0x44'),_0x3a8074[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](findById(_0x3a8074[_0xe8d0('0x1a')]['id']))['then'](respondWithResult(_0x47893d,null))[_0xe8d0('0xe')](handleError(_0x47893d,null));};exports[_0xe8d0('0x45')]=function(_0x25e5ab,_0x76316a){return respondWithRpcPromise('MailQueues',_0x25e5ab[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x76316a,null))[_0xe8d0('0xe')](handleError(_0x76316a,null));};exports[_0xe8d0('0x46')]=function(_0x1a74d0,_0x29667c){return respondWithRpcPromise('MailQueues',_0x1a74d0['query'],routingClient)[_0xe8d0('0x17')](findById(_0x1a74d0['params']['id']))[_0xe8d0('0x17')](respondWithResult(_0x29667c,null))[_0xe8d0('0xe')](handleError(_0x29667c,null));};exports['mailAccounts']=function(_0x5ac1ae,_0x995163){return respondWithRpcPromise('MailAccounts',_0x5ac1ae[_0xe8d0('0x16')],mailClient)['then'](respondWithResult(_0x995163,null))[_0xe8d0('0xe')](handleError(_0x995163,null));};exports[_0xe8d0('0x47')]=function(_0x13b9f0,_0x4e2abc){return respondWithRpcPromise(_0xe8d0('0x48'),_0x13b9f0[_0xe8d0('0x16')],routingClient)['then'](respondWithResult(_0x4e2abc,null))[_0xe8d0('0xe')](handleError(_0x4e2abc,null));};exports['showOpenchannelQueues']=function(_0x3d0908,_0x4ff583){return respondWithRpcPromise(_0xe8d0('0x48'),_0x3d0908[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](findById(_0x3d0908[_0xe8d0('0x1a')]['id']))[_0xe8d0('0x17')](respondWithResult(_0x4ff583,null))['catch'](handleError(_0x4ff583,null));};exports['smsQueues']=function(_0xd7d433,_0x55a2df){return respondWithRpcPromise(_0xe8d0('0x49'),_0xd7d433[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x55a2df,null))[_0xe8d0('0xe')](handleError(_0x55a2df,null));};exports[_0xe8d0('0x4a')]=function(_0x1e806b,_0x177485){return respondWithRpcPromise(_0xe8d0('0x49'),_0x1e806b[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](findById(_0x1e806b[_0xe8d0('0x1a')]['id']))[_0xe8d0('0x17')](respondWithResult(_0x177485,null))[_0xe8d0('0xe')](handleError(_0x177485,null));};exports[_0xe8d0('0x4b')]=function(_0x22992f,_0x4a68d5){return respondWithRpcPromise(_0xe8d0('0x4c'),_0x22992f[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x4a68d5,null))[_0xe8d0('0xe')](handleError(_0x4a68d5,null));};exports[_0xe8d0('0x4d')]=function(_0x4848d4,_0x2eeb92){return respondWithRpcPromise(_0xe8d0('0x4c'),_0x4848d4[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](findById(_0x4848d4[_0xe8d0('0x1a')]['id']))[_0xe8d0('0x17')](respondWithResult(_0x2eeb92,null))[_0xe8d0('0xe')](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x4e')]=function(_0x40cb5c,_0x24be86){return respondWithRpcPromise(_0xe8d0('0x4f'),_0x40cb5c[_0xe8d0('0x16')],routingClient)['then'](respondWithResult(_0x24be86,null))['catch'](handleError(_0x24be86,null));};exports[_0xe8d0('0x50')]=function(_0x54c04f,_0x169047){return respondWithRpcPromise(_0xe8d0('0x4f'),_0x54c04f['query'],routingClient)[_0xe8d0('0x17')](findById(_0x54c04f[_0xe8d0('0x1a')]['id']))[_0xe8d0('0x17')](respondWithResult(_0x169047,null))[_0xe8d0('0xe')](handleError(_0x169047,null));};exports[_0xe8d0('0x51')]=function(_0x1b5df8,_0x473e0b){return respondWithRpcPromise(_0xe8d0('0x52'),_0x1b5df8[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x473e0b,null))[_0xe8d0('0xe')](handleError(_0x473e0b,null));};exports[_0xe8d0('0x53')]=function(_0xa0c61a,_0x2147d5){return respondWithRpcPromise(_0xe8d0('0x54'),_0xa0c61a[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x2147d5,null))[_0xe8d0('0xe')](handleError(_0x2147d5,null));};exports[_0xe8d0('0x55')]=function(_0x500fb0,_0x30ed66){return respondWithRpcPromise(_0xe8d0('0x56'),_0x500fb0[_0xe8d0('0x16')],routingClient)['then'](respondWithResult(_0x30ed66,null))[_0xe8d0('0xe')](handleError(_0x30ed66,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x31e6df,_0x1c1794){return respondWithRpcPromise(_0xe8d0('0x57'),_0x31e6df['query'],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x1c1794,null))[_0xe8d0('0xe')](handleError(_0x1c1794,null));};exports[_0xe8d0('0x58')]=function(_0x207680,_0x939184){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x207680[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](function(_0x23ba49){if(_0x207680[_0xe8d0('0x16')][_0xe8d0('0x59')]!==undefined){var _0x385a73=_(_0x23ba49[_0xe8d0('0x14')])[_0xe8d0('0x5a')]([_0x207680['query'][_0xe8d0('0x59')],_0x207680[_0xe8d0('0x1a')]['id']])[_0xe8d0('0x5b')](_0xe8d0('0x5c'))['uniq']()[_0xe8d0('0x5d')]();return _0x23ba49[_0xe8d0('0x14')][_0xe8d0('0x5a')](function(_0x575730){return _0x385a73[_0xe8d0('0x5e')](_0x575730['queue_id'])>-0x1;});}else{return _0x23ba49[_0xe8d0('0x14')]['filter'](function(_0x25bc77){return _0x25bc77[_0xe8d0('0x5c')]===parseInt(_0x207680[_0xe8d0('0x1a')]['id']);});}})[_0xe8d0('0x17')](respondWithResult(_0x939184,null))[_0xe8d0('0xe')](handleError(_0x939184,null));};exports[_0xe8d0('0x5f')]=function(_0x17fbdc,_0x3f5c69){return respondWithRpcPromise(_0xe8d0('0x60'),_0x17fbdc[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x3f5c69,null))[_0xe8d0('0xe')](handleError(_0x3f5c69,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x20e4ff,_0x1fa61e){return respondWithRpcPromise(_0xe8d0('0x61'),_0x20e4ff[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x1fa61e,null))[_0xe8d0('0xe')](handleError(_0x1fa61e,null));};exports[_0xe8d0('0x62')]=function(_0x605b5f,_0x2f9702){return respondWithRpcPromise(_0xe8d0('0x63'),_0x605b5f['query'],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x2f9702,null))[_0xe8d0('0xe')](handleError(_0x2f9702,null));};exports[_0xe8d0('0x64')]=function(_0xebc89e){return function(_0x255e4b,_0x550fe6){var _0x4c4ff0,_0xca752a;var _0x5c8c7d=_[_0xe8d0('0x65')](_0xebc89e);var _0x16098b=_0xebc89e===_0xe8d0('0x66')?'Website':_0xe8d0('0x67');return db[_0x5c8c7d+'Queue'][_0xe8d0('0x68')]({'raw':!![],'where':{'id':_0x255e4b[_0xe8d0('0x1a')]['id']}})[_0xe8d0('0x17')](function(_0x1a04a6){if(_[_0xe8d0('0x13')](_0x1a04a6)){throw new Error(_0x5c8c7d+'\x20Queue\x20not\x20found');}_0x4c4ff0=_0x1a04a6;return db[_0x5c8c7d+'Message'][_0xe8d0('0x68')]({'where':{'id':_0x255e4b[_0xe8d0('0x30')][_0xe8d0('0x69')]},'include':[{'model':db[_0x5c8c7d+_0xe8d0('0x6a')],'as':_0xe8d0('0x6a')},{'model':db[_0x5c8c7d+_0x16098b],'as':_0xe8d0('0x67')}]});})[_0xe8d0('0x17')](function(_0x1ff1cc){if(_[_0xe8d0('0x13')](_0x1ff1cc)){throw new Error(_0x5c8c7d+'\x20Message\x20not\x20found');}_0xca752a=_0x1ff1cc;return _0x1ff1cc[_0xe8d0('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe8d0('0x17')](function(){var _0x142db4={'uniqueid':_0xebc89e+'.'+_0xca752a['id']+'.'+_0xca752a[_0xe8d0('0x6a')]['id'],'FromUserId':_0x255e4b['user']['id'],'type':'queue'};_0x142db4[_0x5c8c7d+_0xe8d0('0x6c')]=_0xca752a['id'];_0x142db4[_0x5c8c7d+_0xe8d0('0x6d')]=_0xca752a[_0xe8d0('0x6a')]['id'];_0x142db4[_0xe8d0('0x6e')+_0x5c8c7d+_0x16098b+'Id']=_0xca752a[_0xe8d0('0x67')]['id'];_0x142db4['To'+_0x5c8c7d+_0xe8d0('0x6f')]=_0x4c4ff0['id'];return db[_0x5c8c7d+_0xe8d0('0x70')][_0xe8d0('0x71')](_0x142db4);})[_0xe8d0('0x17')](function(){return respondWithRpcPromise(_0xe8d0('0x72'),{'channel':_0xebc89e,'interaction':_0xca752a['Interaction'],'message':_0xca752a,'account':_0xca752a[_0xe8d0('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe8d0('0x73'),'appdata':_0x4c4ff0[_0xe8d0('0x11')]+','+(_0xca752a[_0xe8d0('0x67')][_0xe8d0('0x74')]||0x12c),'interval':_0xe8d0('0x75')}]},routingClient);})[_0xe8d0('0x17')](respondWithResult(_0x550fe6,null))[_0xe8d0('0xe')](handleError(_0x550fe6,null));};};exports[_0xe8d0('0x76')]=function(_0x47bdc2,_0x52aece){var _0x2e11fc,_0x38e83f;if(_['isNil'](_0x47bdc2[_0xe8d0('0x30')][_0xe8d0('0x77')])){throw new Error(_0xe8d0('0x78'));}var _0x499efb=_0x47bdc2[_0xe8d0('0x30')][_0xe8d0('0x77')];var _0x233a5a=_[_0xe8d0('0x65')](_0x499efb);var _0x55588a=_0x499efb==='chat'?_0xe8d0('0x79'):_0xe8d0('0x67');return db['User']['findOne']({'raw':!![],'where':{'id':_0x47bdc2[_0xe8d0('0x1a')]['id'],'role':_0xe8d0('0x7a')}})[_0xe8d0('0x17')](function(_0x5eaf13){if(_[_0xe8d0('0x13')](_0x5eaf13)){throw new Error('Agent\x20not\x20found');}_0x2e11fc=_0x5eaf13;return db[_0x233a5a+'Message'][_0xe8d0('0x68')]({'where':{'id':_0x47bdc2[_0xe8d0('0x30')][_0xe8d0('0x69')]},'include':[{'model':db[_0x233a5a+_0xe8d0('0x6a')],'as':_0xe8d0('0x6a')},{'model':db[_0x233a5a+_0x55588a],'as':'Account'}]});})[_0xe8d0('0x17')](function(_0x455614){if(_['isNil'](_0x455614)){throw new Error(_0x233a5a+_0xe8d0('0x7b'));}_0x38e83f=_0x455614;return _0x455614[_0xe8d0('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe8d0('0x17')](function(){var _0x3e18af={'uniqueid':_0x499efb+'.'+_0x38e83f['id']+'.'+_0x38e83f['Interaction']['id'],'FromUserId':_0x47bdc2[_0xe8d0('0x32')]['id'],'type':_0xe8d0('0x73'),'ToUserId':_0x2e11fc['id']};_0x3e18af[_0x233a5a+_0xe8d0('0x6c')]=_0x38e83f['id'];_0x3e18af[_0x233a5a+_0xe8d0('0x6d')]=_0x38e83f[_0xe8d0('0x6a')]['id'];_0x3e18af[_0xe8d0('0x6e')+_0x233a5a+_0x55588a+'Id']=_0x38e83f[_0xe8d0('0x67')]['id'];return db[_0x233a5a+_0xe8d0('0x70')]['create'](_0x3e18af);})[_0xe8d0('0x17')](function(){return respondWithRpcPromise(_0xe8d0('0x72'),{'channel':_0x499efb,'interaction':_0x38e83f['Interaction'],'message':_0x38e83f,'account':_0x38e83f['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x2e11fc['name']+','+(_0x38e83f[_0xe8d0('0x67')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe8d0('0x17')](respondWithResult(_0x52aece,null))['catch'](handleError(_0x52aece,null));};
\ No newline at end of file
+var _0x7dfd=['interface','format','SIP/%s','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','queue_id','uniq','filter','indexOf','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','findOne','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','query','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes'];(function(_0x53bfdb,_0x8ecab3){var _0x469b15=function(_0x27f761){while(--_0x27f761){_0x53bfdb['push'](_0x53bfdb['shift']());}};_0x469b15(++_0x8ecab3);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xd7df('0x0'));var moment=require(_0xd7df('0x1'));var _=require(_0xd7df('0x2'));var util=require(_0xd7df('0x3'));var db=require(_0xd7df('0x4'))['db'];var logger=require(_0xd7df('0x5'))(_0xd7df('0x6'));var jayson=require(_0xd7df('0x7'));var amiClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232a});var mailClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232b});var routingClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x354ea7,_0x16e50,_0x2c48a4){return new BPromise(function(_0x5c220a,_0xab6742){var _0xb3557a=_0x2c48a4?_0x2c48a4:amiClient;return _0xb3557a[_0xd7df('0xa')](_0x354ea7,_0x16e50)[_0xd7df('0xb')](function(_0x5e59c3){if(_0x5e59c3[_0xd7df('0xc')]){if(_0x5e59c3['error'][_0xd7df('0xd')]===0x1f4){return _0xab6742(_0x5e59c3['error'][_0xd7df('0xe')]);}return _0x5c220a(_0x5e59c3[_0xd7df('0xc')][_0xd7df('0xe')]);}else{_0x5c220a(_0x5e59c3[_0xd7df('0xf')]);}})[_0xd7df('0x10')](function(_0x174c88){_0xab6742(_0x174c88);});});}function respondWithResult(_0x2e8187,_0x3da618){_0x3da618=_0x3da618||0xc8;return function(_0x7ba3c){if(_0x7ba3c){return _0x2e8187[_0xd7df('0x11')](_0x3da618)[_0xd7df('0x12')](_0x7ba3c);}return _0x2e8187[_0xd7df('0x13')](0x194);};}function handleError(_0xe1595f,_0x196632){_0x196632=_0x196632||0x1f4;return function(_0x3b2559){logger[_0xd7df('0xc')](_0x3b2559[_0xd7df('0x14')]);if(_0x3b2559['name']){delete _0x3b2559[_0xd7df('0x15')];}_0xe1595f[_0xd7df('0x11')](_0x196632)['send'](_0x3b2559);};}function findById(_0x18d38f){return function(_0xbe1c5e){if(!_['isNil'](_0x18d38f)&&!_[_0xd7df('0x16')](_0xbe1c5e)&&!_[_0xd7df('0x16')](_0xbe1c5e[_0xd7df('0x17')])){return _['find'](_0xbe1c5e[_0xd7df('0x17')],function(_0x471621){return _0x471621['id']==_0x18d38f;});}return null;};}exports[_0xd7df('0x18')]=function(_0x5ba653,_0x96d86e){return respondWithRpcPromise(_0xd7df('0x19'),_0x5ba653[_0xd7df('0x1a')])['then'](respondWithResult(_0x96d86e,null))[_0xd7df('0x10')](handleError(_0x96d86e,null));};exports['voiceChannelMixMonitor']=function(_0x225e33,_0x5ab737){return respondWithRpcPromise(_0xd7df('0x1b'),_[_0xd7df('0x1c')](_0x225e33[_0xd7df('0x1a')],_0x225e33['params']))[_0xd7df('0xb')](respondWithResult(_0x5ab737,null))['catch'](handleError(_0x5ab737,null));};exports[_0xd7df('0x1d')]=function(_0x379e4a,_0x40e7af){return respondWithRpcPromise(_0xd7df('0x1e'),_[_0xd7df('0x1c')](_0x379e4a[_0xd7df('0x1a')],_0x379e4a[_0xd7df('0x1f')]))['then'](respondWithResult(_0x40e7af,null))['catch'](handleError(_0x40e7af,null));};exports[_0xd7df('0x20')]=function(_0x38db14,_0x26047f){return respondWithRpcPromise(_0xd7df('0x21'),_0x38db14[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x26047f,null))[_0xd7df('0x10')](handleError(_0x26047f,null));};exports[_0xd7df('0x22')]=function(_0x163904,_0x5c4d17){return respondWithRpcPromise(_0xd7df('0x21'),_0x163904[_0xd7df('0x1a')])[_0xd7df('0xb')](findById(_0x163904[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x5c4d17,null))[_0xd7df('0x10')](handleError(_0x5c4d17,null));};exports[_0xd7df('0x23')]=function(_0x36de76,_0x5195cf){return respondWithRpcPromise('UpdateVoiceQueue',_['merge'](_0x36de76['body'],_0x36de76['params']))[_0xd7df('0xb')](respondWithResult(_0x5195cf,null))['catch'](handleError(_0x5195cf,null));};exports[_0xd7df('0x24')]=function(_0x156612,_0x503a90){return respondWithRpcPromise(_0xd7df('0x25'),_[_0xd7df('0x1c')](_0x156612['query'],_0x156612[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x503a90,null))[_0xd7df('0x10')](handleError(_0x503a90,null));};exports[_0xd7df('0x26')]=function(_0x40f965,_0x3304c4){return respondWithRpcPromise('VoiceQueuesChannels',_0x40f965[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x3304c4,null))[_0xd7df('0x10')](handleError(_0x3304c4,null));};exports[_0xd7df('0x27')]=function(_0x363f2d,_0x4cecf2){return respondWithRpcPromise(_0xd7df('0x28'),_[_0xd7df('0x1c')](_0x363f2d[_0xd7df('0x1a')],_0x363f2d[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x4cecf2,null))['catch'](handleError(_0x4cecf2,null));};exports['voiceQueuesChannelHangup']=function(_0x4051fb,_0x564562){return respondWithRpcPromise(_0xd7df('0x29'),_[_0xd7df('0x1c')](_0x4051fb[_0xd7df('0x1a')],_0x4051fb[_0xd7df('0x1f')]))['then'](respondWithResult(_0x564562,null))['catch'](handleError(_0x564562,null));};exports['voiceQueuesChannelRedirect']=function(_0x2a96e3,_0x15e682){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xd7df('0x1c')](_0x2a96e3[_0xd7df('0x1a')],_0x2a96e3[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x15e682,null))['catch'](handleError(_0x15e682,null));};exports[_0xd7df('0x2a')]=function(_0x45642c,_0x5f0a6d){return respondWithRpcPromise(_0xd7df('0x2b'),_0x45642c['query'])[_0xd7df('0xb')](respondWithResult(_0x5f0a6d,null))[_0xd7df('0x10')](handleError(_0x5f0a6d,null));};exports[_0xd7df('0x2c')]=function(_0x59c755,_0x138391){return respondWithRpcPromise(_0xd7df('0x2d'),_0x59c755[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x138391,null))['catch'](handleError(_0x138391,null));};exports[_0xd7df('0x2e')]=function(_0x230857,_0x2314e6){var _0x4f6286;return respondWithRpcPromise(_0xd7df('0x2f'),_0x230857[_0xd7df('0x1a')])[_0xd7df('0xb')](function(_0x517824){_0x4f6286=_0x517824;return respondWithRpcPromise(_0xd7df('0x2f'),_0x230857[_0xd7df('0x1a')],routingClient);})['then'](function(_0x4b2561){return _[_0xd7df('0x1c')]({},_0x4b2561,_0x4f6286);})[_0xd7df('0xb')](respondWithResult(_0x2314e6,null))[_0xd7df('0x10')](handleError(_0x2314e6,null));};exports['agentCapacity']=function(_0x5e8cd0,_0x2c149e){if(_0x5e8cd0['body']&&_0x5e8cd0[_0xd7df('0x30')]['interaction']&&_0x5e8cd0['user']&&_0x5e8cd0[_0xd7df('0x31')]['name']){for(var _0x18ef10 in _0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')]){if(_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0xd7df('0x33')](_0x18ef10)){db[_0xd7df('0x34')][_0xd7df('0x35')]({'where':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')]['name'],'type':_0xd7df('0x36'),'exitAt':null,'uniqueid':_0x5e8cd0['body'][_0xd7df('0x32')][_0x18ef10]&&_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10][_0xd7df('0x37')]?{'$notIn':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10]}:{'$ne':null}}})[_0xd7df('0xb')](function(_0x38056b){var _0x3a3c1a=moment()['format'](_0xd7df('0x38'));for(var _0x563f90=0x0,_0x49085b=_0x38056b['length'];_0x563f90<_0x49085b;_0x563f90+=0x1){_0x38056b[_0x563f90][_0xd7df('0x39')]({'exitAt':_0x3a3c1a});}});for(var _0x162900=0x0;_0x162900<_0x5e8cd0[_0xd7df('0x30')]['interaction'][_0x18ef10]['length'];_0x162900+=0x1){db[_0xd7df('0x34')]['findOrCreate']({'where':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x15')],'type':_0xd7df('0x36'),'uniqueid':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10][_0x162900],'exitAt':null},'defaults':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x15')],'interface':_[_0xd7df('0x16')](_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3a')])?util[_0xd7df('0x3b')](_0xd7df('0x3c'),_0x5e8cd0['user'][_0xd7df('0x15')]):_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3a')],'type':_0xd7df('0x36'),'enterAt':moment()[_0xd7df('0x3b')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xd7df('0x3d'),'internal':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3e')],'uniqueid':_0x5e8cd0['body'][_0xd7df('0x32')][_0x18ef10][_0x162900]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x5e8cd0[_0xd7df('0x1f')]['id'],'capacity':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x3f')]},routingClient)[_0xd7df('0xb')](respondWithResult(_0x2c149e,null))[_0xd7df('0x10')](handleError(_0x2c149e,null));};exports['telephones']=function(_0x4abe81,_0x53ec02){return respondWithRpcPromise(_0xd7df('0x40'),_0x4abe81['query'])[_0xd7df('0xb')](respondWithResult(_0x53ec02,null))[_0xd7df('0x10')](handleError(_0x53ec02,null));};exports[_0xd7df('0x41')]=function(_0xdf3046,_0x275af9){return respondWithRpcPromise(_0xd7df('0x42'),_0xdf3046[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x275af9,null))[_0xd7df('0x10')](handleError(_0x275af9,null));};exports[_0xd7df('0x43')]=function(_0x382d11,_0x327365){return respondWithRpcPromise(_0xd7df('0x44'),_0x382d11[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x327365,null))[_0xd7df('0x10')](handleError(_0x327365,null));};exports['chatQueues']=function(_0x332db5,_0x28c9b7){return respondWithRpcPromise('ChatQueues',_0x332db5['query'],routingClient)[_0xd7df('0xb')](respondWithResult(_0x28c9b7,null))['catch'](handleError(_0x28c9b7,null));};exports[_0xd7df('0x45')]=function(_0x4fb55a,_0x1f34c2){return respondWithRpcPromise(_0xd7df('0x46'),_0x4fb55a[_0xd7df('0x1a')],routingClient)['then'](findById(_0x4fb55a['params']['id']))['then'](respondWithResult(_0x1f34c2,null))[_0xd7df('0x10')](handleError(_0x1f34c2,null));};exports[_0xd7df('0x47')]=function(_0x19c387,_0x527b6f){return respondWithRpcPromise(_0xd7df('0x48'),_0x19c387[_0xd7df('0x1a')],routingClient)['then'](respondWithResult(_0x527b6f,null))[_0xd7df('0x10')](handleError(_0x527b6f,null));};exports[_0xd7df('0x49')]=function(_0x35204f,_0x25d187){return respondWithRpcPromise(_0xd7df('0x48'),_0x35204f[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x35204f[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x25d187,null))[_0xd7df('0x10')](handleError(_0x25d187,null));};exports[_0xd7df('0x4a')]=function(_0x398e43,_0x3dba78){return respondWithRpcPromise(_0xd7df('0x4b'),_0x398e43[_0xd7df('0x1a')],mailClient)[_0xd7df('0xb')](respondWithResult(_0x3dba78,null))[_0xd7df('0x10')](handleError(_0x3dba78,null));};exports[_0xd7df('0x4c')]=function(_0x3f2775,_0x1e6277){return respondWithRpcPromise(_0xd7df('0x4d'),_0x3f2775[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x1e6277,null))[_0xd7df('0x10')](handleError(_0x1e6277,null));};exports[_0xd7df('0x4e')]=function(_0x3912d6,_0x51ae2b){return respondWithRpcPromise('OpenchannelQueues',_0x3912d6[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x3912d6[_0xd7df('0x1f')]['id']))['then'](respondWithResult(_0x51ae2b,null))[_0xd7df('0x10')](handleError(_0x51ae2b,null));};exports[_0xd7df('0x4f')]=function(_0x1e87aa,_0x2786a6){return respondWithRpcPromise('SmsQueues',_0x1e87aa[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x2786a6,null))[_0xd7df('0x10')](handleError(_0x2786a6,null));};exports[_0xd7df('0x50')]=function(_0x19a25b,_0x2fbc53){return respondWithRpcPromise(_0xd7df('0x51'),_0x19a25b[_0xd7df('0x1a')],routingClient)['then'](findById(_0x19a25b[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x2fbc53,null))['catch'](handleError(_0x2fbc53,null));};exports['whatsappQueues']=function(_0x481fa5,_0x264c5b){return respondWithRpcPromise(_0xd7df('0x52'),_0x481fa5[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x264c5b,null))['catch'](handleError(_0x264c5b,null));};exports[_0xd7df('0x53')]=function(_0x3d45cf,_0x19df03){return respondWithRpcPromise(_0xd7df('0x52'),_0x3d45cf[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x3d45cf[_0xd7df('0x1f')]['id']))['then'](respondWithResult(_0x19df03,null))['catch'](handleError(_0x19df03,null));};exports[_0xd7df('0x54')]=function(_0x5c1e68,_0x588537){return respondWithRpcPromise(_0xd7df('0x55'),_0x5c1e68[_0xd7df('0x1a')],routingClient)['then'](respondWithResult(_0x588537,null))['catch'](handleError(_0x588537,null));};exports[_0xd7df('0x56')]=function(_0x44d824,_0x49bf7e){return respondWithRpcPromise(_0xd7df('0x55'),_0x44d824[_0xd7df('0x1a')],routingClient)['then'](findById(_0x44d824[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x49bf7e,null))['catch'](handleError(_0x49bf7e,null));};exports[_0xd7df('0x57')]=function(_0x519f72,_0x56f55d){return respondWithRpcPromise(_0xd7df('0x58'),_0x519f72[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x56f55d,null))[_0xd7df('0x10')](handleError(_0x56f55d,null));};exports[_0xd7df('0x59')]=function(_0x40b2a1,_0x5831c1){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x40b2a1[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x5831c1,null))[_0xd7df('0x10')](handleError(_0x5831c1,null));};exports[_0xd7df('0x5a')]=function(_0x19b0e6,_0x31f681){return respondWithRpcPromise(_0xd7df('0x5b'),_0x19b0e6[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x31f681,null))['catch'](handleError(_0x31f681,null));};exports[_0xd7df('0x5c')]=function(_0x1682ca,_0x4e9806){return respondWithRpcPromise(_0xd7df('0x5d'),_0x1682ca[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x4e9806,null))[_0xd7df('0x10')](handleError(_0x4e9806,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x4e5363,_0x5628ed){return respondWithRpcPromise(_0xd7df('0x5d'),_0x4e5363['query'],routingClient)[_0xd7df('0xb')](function(_0x2b1b30){if(_0x4e5363[_0xd7df('0x1a')][_0xd7df('0x5e')]!==undefined){var _0x2d8a31=_(_0x2b1b30[_0xd7df('0x17')])['filter']([_0x4e5363[_0xd7df('0x1a')][_0xd7df('0x5e')],_0x4e5363[_0xd7df('0x1f')]['id']])['map'](_0xd7df('0x5f'))[_0xd7df('0x60')]()['value']();return _0x2b1b30[_0xd7df('0x17')][_0xd7df('0x61')](function(_0x157290){return _0x2d8a31[_0xd7df('0x62')](_0x157290[_0xd7df('0x5f')])>-0x1;});}else{return _0x2b1b30[_0xd7df('0x17')][_0xd7df('0x61')](function(_0x5e93cc){return _0x5e93cc[_0xd7df('0x5f')]===parseInt(_0x4e5363[_0xd7df('0x1f')]['id']);});}})[_0xd7df('0xb')](respondWithResult(_0x5628ed,null))[_0xd7df('0x10')](handleError(_0x5628ed,null));};exports['smsQueuesWaitingInteractions']=function(_0x531a07,_0x2e1e96){return respondWithRpcPromise(_0xd7df('0x63'),_0x531a07[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x2e1e96,null))[_0xd7df('0x10')](handleError(_0x2e1e96,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x2329ce,_0x4f739b){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x2329ce[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x4f739b,null))[_0xd7df('0x10')](handleError(_0x4f739b,null));};exports[_0xd7df('0x64')]=function(_0x30c401,_0x3ece24){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x30c401['query'],routingClient)[_0xd7df('0xb')](respondWithResult(_0x3ece24,null))[_0xd7df('0x10')](handleError(_0x3ece24,null));};exports[_0xd7df('0x65')]=function(_0x175a36){return function(_0x5cb2b0,_0xac3b73){var _0x5df36d,_0x158bd9;var _0x5b73e5=_[_0xd7df('0x66')](_0x175a36);var _0x1ed032=_0x175a36===_0xd7df('0x67')?_0xd7df('0x68'):_0xd7df('0x69');return db[_0x5b73e5+_0xd7df('0x6a')]['findOne']({'raw':!![],'where':{'id':_0x5cb2b0[_0xd7df('0x1f')]['id']}})['then'](function(_0x1e2355){if(_[_0xd7df('0x16')](_0x1e2355)){throw new Error(_0x5b73e5+_0xd7df('0x6b'));}_0x5df36d=_0x1e2355;return db[_0x5b73e5+_0xd7df('0x6c')]['findOne']({'where':{'id':_0x5cb2b0[_0xd7df('0x30')][_0xd7df('0x6d')]},'include':[{'model':db[_0x5b73e5+_0xd7df('0x6e')],'as':_0xd7df('0x6e')},{'model':db[_0x5b73e5+_0x1ed032],'as':_0xd7df('0x69')}]});})[_0xd7df('0xb')](function(_0x40a665){if(_[_0xd7df('0x16')](_0x40a665)){throw new Error(_0x5b73e5+_0xd7df('0x6f'));}_0x158bd9=_0x40a665;return _0x40a665[_0xd7df('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd7df('0xb')](function(){var _0x15bd27={'uniqueid':_0x175a36+'.'+_0x158bd9['id']+'.'+_0x158bd9['Interaction']['id'],'FromUserId':_0x5cb2b0[_0xd7df('0x31')]['id'],'type':_0xd7df('0x71')};_0x15bd27[_0x5b73e5+_0xd7df('0x72')]=_0x158bd9['id'];_0x15bd27[_0x5b73e5+'InteractionId']=_0x158bd9['Interaction']['id'];_0x15bd27[_0xd7df('0x73')+_0x5b73e5+_0x1ed032+'Id']=_0x158bd9[_0xd7df('0x69')]['id'];_0x15bd27['To'+_0x5b73e5+_0xd7df('0x74')]=_0x5df36d['id'];return db[_0x5b73e5+_0xd7df('0x75')][_0xd7df('0x76')](_0x15bd27);})[_0xd7df('0xb')](function(){return respondWithRpcPromise(_0xd7df('0x77'),{'channel':_0x175a36,'interaction':_0x158bd9[_0xd7df('0x6e')],'message':_0x158bd9,'account':_0x158bd9[_0xd7df('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd7df('0x71'),'appdata':_0x5df36d['name']+','+(_0x158bd9[_0xd7df('0x69')][_0xd7df('0x78')]||0x12c),'interval':_0xd7df('0x79')}]},routingClient);})[_0xd7df('0xb')](respondWithResult(_0xac3b73,null))[_0xd7df('0x10')](handleError(_0xac3b73,null));};};exports[_0xd7df('0x7a')]=function(_0x50c5b9,_0x518092){var _0xa3ae43,_0x31b159;if(_[_0xd7df('0x16')](_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x7b')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x1a888c=_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x7b')];var _0x3d9fba=_[_0xd7df('0x66')](_0x1a888c);var _0x2861e3=_0x1a888c===_0xd7df('0x67')?'Website':_0xd7df('0x69');return db['User']['findOne']({'raw':!![],'where':{'id':_0x50c5b9[_0xd7df('0x1f')]['id'],'role':_0xd7df('0x3d')}})[_0xd7df('0xb')](function(_0x5092d2){if(_[_0xd7df('0x16')](_0x5092d2)){throw new Error('Agent\x20not\x20found');}_0xa3ae43=_0x5092d2;return db[_0x3d9fba+'Message'][_0xd7df('0x7c')]({'where':{'id':_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x6d')]},'include':[{'model':db[_0x3d9fba+_0xd7df('0x6e')],'as':_0xd7df('0x6e')},{'model':db[_0x3d9fba+_0x2861e3],'as':'Account'}]});})['then'](function(_0x3f2ecd){if(_[_0xd7df('0x16')](_0x3f2ecd)){throw new Error(_0x3d9fba+_0xd7df('0x6f'));}_0x31b159=_0x3f2ecd;return _0x3f2ecd[_0xd7df('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd7df('0xb')](function(){var _0xc447e8={'uniqueid':_0x1a888c+'.'+_0x31b159['id']+'.'+_0x31b159[_0xd7df('0x6e')]['id'],'FromUserId':_0x50c5b9[_0xd7df('0x31')]['id'],'type':_0xd7df('0x71'),'ToUserId':_0xa3ae43['id']};_0xc447e8[_0x3d9fba+_0xd7df('0x72')]=_0x31b159['id'];_0xc447e8[_0x3d9fba+_0xd7df('0x7d')]=_0x31b159[_0xd7df('0x6e')]['id'];_0xc447e8[_0xd7df('0x73')+_0x3d9fba+_0x2861e3+'Id']=_0x31b159['Account']['id'];return db[_0x3d9fba+_0xd7df('0x75')][_0xd7df('0x76')](_0xc447e8);})[_0xd7df('0xb')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a888c,'interaction':_0x31b159[_0xd7df('0x6e')],'message':_0x31b159,'account':_0x31b159['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xd7df('0x3d'),'appdata':_0xa3ae43[_0xd7df('0x15')]+','+(_0x31b159['Account'][_0xd7df('0x7e')]||0x12c),'interval':_0xd7df('0x79')}]},routingClient);})[_0xd7df('0xb')](respondWithResult(_0x518092,null))[_0xd7df('0x10')](handleError(_0x518092,null));};
\ No newline at end of file
index 5a3cd59..a4f7053 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb80=['../../components/auth/service','../../components/interaction/service','get','index','show','/:id/run','isAuthenticated','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x2ee16f,_0x31ee67){var _0x894b90=function(_0x24bd9c){while(--_0x24bd9c){_0x2ee16f['push'](_0x2ee16f['shift']());}};_0x894b90(++_0x31ee67);}(_0xcb80,0x1c2));var _0x0cb8=function(_0x49a6ab,_0x3f30c4){_0x49a6ab=_0x49a6ab-0x0;var _0x1d29a3=_0xcb80[_0x49a6ab];return _0x1d29a3;};'use strict';var multer=require(_0x0cb8('0x0'));var util=require(_0x0cb8('0x1'));var path=require('path');var timeout=require(_0x0cb8('0x2'));var express=require(_0x0cb8('0x3'));var router=express[_0x0cb8('0x4')]();var fs_extra=require(_0x0cb8('0x5'));var auth=require(_0x0cb8('0x6'));var interaction=require(_0x0cb8('0x7'));var config=require('../../config/environment');var controller=require('./schedule.controller');router[_0x0cb8('0x8')]('/',auth['isAuthenticated'](),controller[_0x0cb8('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0cb8('0xa')]);router[_0x0cb8('0x8')](_0x0cb8('0xb'),auth[_0x0cb8('0xc')](),controller['run']);router['post']('/',auth['isAuthenticated'](),controller[_0x0cb8('0xd')]);router[_0x0cb8('0xe')](_0x0cb8('0xf'),auth[_0x0cb8('0xc')](),controller['update']);router[_0x0cb8('0x10')](_0x0cb8('0xf'),auth[_0x0cb8('0xc')](),controller[_0x0cb8('0x11')]);module[_0x0cb8('0x12')]=router;
\ No newline at end of file
+var _0x2840=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./schedule.controller','isAuthenticated','index','/:id','get','post','put','update','delete'];(function(_0x193628,_0xdd785e){var _0x4e4a0=function(_0x4e9ca1){while(--_0x4e9ca1){_0x193628['push'](_0x193628['shift']());}};_0x4e4a0(++_0xdd785e);}(_0x2840,0xde));var _0x0284=function(_0x3b81eb,_0x175f32){_0x3b81eb=_0x3b81eb-0x0;var _0x149491=_0x2840[_0x3b81eb];return _0x149491;};'use strict';var multer=require(_0x0284('0x0'));var util=require(_0x0284('0x1'));var path=require('path');var timeout=require(_0x0284('0x2'));var express=require(_0x0284('0x3'));var router=express[_0x0284('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0284('0x5'));var interaction=require(_0x0284('0x6'));var config=require('../../config/environment');var controller=require(_0x0284('0x7'));router['get']('/',auth[_0x0284('0x8')](),controller[_0x0284('0x9')]);router['get'](_0x0284('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0284('0xb')]('/:id/run',auth[_0x0284('0x8')](),controller['run']);router[_0x0284('0xc')]('/',auth[_0x0284('0x8')](),controller['create']);router[_0x0284('0xd')](_0x0284('0xa'),auth['isAuthenticated'](),controller[_0x0284('0xe')]);router[_0x0284('0xf')](_0x0284('0xa'),auth[_0x0284('0x8')](),controller['destroy']);module[_0x0284('0x10')]=router;
\ No newline at end of file
index fcffe66..dcde841 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x400b=['years','quarters','months','weeks','hours','minutes','days','csv','default','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM'];(function(_0x408626,_0x421fc6){var _0x36ef72=function(_0x495f53){while(--_0x495f53){_0x408626['push'](_0x408626['shift']());}};_0x36ef72(++_0x421fc6);}(_0x400b,0x7d));var _0xb400=function(_0x1b4986,_0x27c04e){_0x1b4986=_0x1b4986-0x0;var _0x33cd0b=_0x400b[_0x1b4986];return _0x33cd0b;};'use strict';var Sequelize=require(_0xb400('0x0'));module[_0xb400('0x1')]={'name':{'type':Sequelize[_0xb400('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb400('0x2')]},'active':{'type':Sequelize[_0xb400('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xb400('0x2')],'allowNull':![],'defaultValue':_0xb400('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xb400('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xb400('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xb400('0x7')](_0xb400('0x8'),_0xb400('0x9'),_0xb400('0xa'),_0xb400('0xb'),'days',_0xb400('0xc'),_0xb400('0xd')),'allowNull':![],'defaultValue':_0xb400('0xe')},'output':{'type':Sequelize[_0xb400('0x7')](_0xb400('0xf'),'pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xb400('0x7')]('custom',_0xb400('0x10')),'allowNull':![],'defaultValue':_0xb400('0x11')},'sendMail':{'type':Sequelize[_0xb400('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xb400('0x2')]},'cc':{'type':Sequelize[_0xb400('0x12')]},'bcc':{'type':Sequelize[_0xb400('0x12')]},'sendIfEmpty':{'type':Sequelize[_0xb400('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xb162=['weeks','minutes','days','ENUM','pdf','xlsx','csv','custom','BOOLEAN','TEXT','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','quarters','months'];(function(_0x178001,_0x5af99f){var _0x2e786e=function(_0x1da925){while(--_0x1da925){_0x178001['push'](_0x178001['shift']());}};_0x2e786e(++_0x5af99f);}(_0xb162,0x70));var _0x2b16=function(_0x360380,_0xd53724){_0x360380=_0x360380-0x0;var _0x40c893=_0xb162[_0x360380];return _0x40c893;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2b16('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x2b16('0x0')],'allowNull':![],'defaultValue':_0x2b16('0x1')},'startAt':{'type':Sequelize[_0x2b16('0x2')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x2b16('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x2b16('0x4'),_0x2b16('0x5'),_0x2b16('0x6'),_0x2b16('0x7'),'days','hours',_0x2b16('0x8')),'allowNull':![],'defaultValue':_0x2b16('0x9')},'output':{'type':Sequelize[_0x2b16('0xa')]('csv',_0x2b16('0xb'),_0x2b16('0xc')),'allowNull':![],'defaultValue':_0x2b16('0xd')},'type':{'type':Sequelize[_0x2b16('0xa')](_0x2b16('0xe'),'default'),'allowNull':![],'defaultValue':_0x2b16('0xe')},'sendMail':{'type':Sequelize[_0x2b16('0xf')],'defaultValue':![]},'email':{'type':Sequelize[_0x2b16('0x0')]},'cc':{'type':Sequelize[_0x2b16('0x10')]},'bcc':{'type':Sequelize[_0x2b16('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x2b16('0xf')],'defaultValue':!![]}};
\ No newline at end of file
index 4f0118f..09c213f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe818=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','get','Scheduler','UserProfileResource','destroy','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model'];(function(_0x1a8d36,_0xd558cd){var _0xd01432=function(_0x2810ed){while(--_0x2810ed){_0x1a8d36['push'](_0x1a8d36['shift']());}};_0xd01432(++_0xd558cd);}(_0xe818,0x187));var _0x8e81=function(_0x391747,_0x232131){_0x391747=_0x391747-0x0;var _0x12add0=_0xe818[_0x391747];return _0x12add0;};'use strict';var emlformat=require(_0x8e81('0x0'));var rimraf=require(_0x8e81('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8e81('0x2'));var moment=require(_0x8e81('0x3'));var BPromise=require(_0x8e81('0x4'));var Mustache=require(_0x8e81('0x5'));var util=require('util');var path=require(_0x8e81('0x6'));var sox=require('sox');var csv=require(_0x8e81('0x7'));var ejs=require(_0x8e81('0x8'));var fs=require('fs');var fs_extra=require(_0x8e81('0x9'));var _=require('lodash');var squel=require(_0x8e81('0xa'));var crypto=require(_0x8e81('0xb'));var jsforce=require(_0x8e81('0xc'));var deskjs=require(_0x8e81('0xd'));var toCsv=require(_0x8e81('0x7'));var querystring=require('querystring');var Papa=require(_0x8e81('0xe'));var Redis=require(_0x8e81('0xf'));var authService=require(_0x8e81('0x10'));var qs=require(_0x8e81('0x11'));var as=require(_0x8e81('0x12'));var hardwareService=require(_0x8e81('0x13'));var logger=require(_0x8e81('0x14'))(_0x8e81('0x15'));var utils=require(_0x8e81('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8e81('0x17'));var db=require(_0x8e81('0x18'))['db'];function respondWithStatusCode(_0x54cb04,_0xe40fb7){_0xe40fb7=_0xe40fb7||0xcc;return function(_0x3c6713){if(_0x3c6713){return _0x54cb04[_0x8e81('0x19')](_0xe40fb7);}return _0x54cb04[_0x8e81('0x1a')](_0xe40fb7)[_0x8e81('0x1b')]();};}function respondWithResult(_0x1b52c6,_0x85af26){_0x85af26=_0x85af26||0xc8;return function(_0x33ed05){if(_0x33ed05){return _0x1b52c6[_0x8e81('0x1a')](_0x85af26)['json'](_0x33ed05);}};}function respondWithFilteredResult(_0x9d6ec3,_0x153e01){return function(_0x528747){if(_0x528747){var _0x157e55=typeof _0x153e01[_0x8e81('0x1c')]===_0x8e81('0x1d')&&typeof _0x153e01[_0x8e81('0x1e')]===_0x8e81('0x1d');var _0x3a0dd4=_0x528747['count'];var _0xd28755=_0x157e55?0x0:_0x153e01[_0x8e81('0x1c')];var _0x429f0e=_0x157e55?_0x528747[_0x8e81('0x1f')]:_0x153e01[_0x8e81('0x1c')]+_0x153e01[_0x8e81('0x1e')];var _0x256537;if(_0x429f0e>=_0x3a0dd4){_0x429f0e=_0x3a0dd4;_0x256537=0xc8;}else{_0x256537=0xce;}_0x9d6ec3[_0x8e81('0x1a')](_0x256537);return _0x9d6ec3[_0x8e81('0x20')](_0x8e81('0x21'),_0xd28755+'-'+_0x429f0e+'/'+_0x3a0dd4)[_0x8e81('0x22')](_0x528747);}return null;};}function patchUpdates(_0x40f01d){return function(_0x42c843){try{jsonpatch[_0x8e81('0x23')](_0x42c843,_0x40f01d,!![]);}catch(_0x1c004a){return BPromise[_0x8e81('0x24')](_0x1c004a);}return _0x42c843['save']();};}function saveUpdates(_0x320844,_0x27a694){return function(_0x1bd025){if(_0x1bd025){return _0x1bd025['update'](_0x320844)['then'](function(_0x27a3bd){return _0x27a3bd;});}return null;};}function removeEntity(_0x2b37ba,_0x2f5cdd){return function(_0x3521d5){if(_0x3521d5){return _0x3521d5['destroy']()[_0x8e81('0x25')](function(){var _0x50c569=_0x3521d5[_0x8e81('0x26')]({'plain':!![]});var _0x5db2d9=_0x8e81('0x27');return db[_0x8e81('0x28')][_0x8e81('0x29')]({'where':{'type':_0x5db2d9,'resourceId':_0x50c569['id']}})[_0x8e81('0x25')](function(){return _0x3521d5;});})[_0x8e81('0x25')](function(){_0x2b37ba[_0x8e81('0x1a')](0xcc)[_0x8e81('0x1b')]();});}};}function handleEntityNotFound(_0x17a799,_0x50c239){return function(_0x2681c8){if(!_0x2681c8){_0x17a799['sendStatus'](0x194);}return _0x2681c8;};}function handleError(_0x726378,_0x38380c){_0x38380c=_0x38380c||0x1f4;return function(_0x511037){logger[_0x8e81('0x2a')](_0x511037[_0x8e81('0x2b')]);if(_0x511037[_0x8e81('0x2c')]){delete _0x511037[_0x8e81('0x2c')];}_0x726378[_0x8e81('0x1a')](_0x38380c)[_0x8e81('0x2d')](_0x511037);};}exports[_0x8e81('0x2e')]=function(_0x220b63,_0x2dc744){var _0x1a4f81={},_0x34d17e={},_0x296a80={'count':0x0,'rows':[]};var _0x26de15=_[_0x8e81('0x2f')](db[_0x8e81('0x30')][_0x8e81('0x31')],function(_0x3d7fe5){return{'name':_0x3d7fe5[_0x8e81('0x32')],'type':_0x3d7fe5[_0x8e81('0x33')][_0x8e81('0x34')]};});_0x34d17e[_0x8e81('0x35')]=_[_0x8e81('0x2f')](_0x26de15,_0x8e81('0x2c'));_0x34d17e[_0x8e81('0x36')]=_[_0x8e81('0x37')](_0x220b63['query']);_0x34d17e[_0x8e81('0x38')]=_[_0x8e81('0x39')](_0x34d17e[_0x8e81('0x35')],_0x34d17e['query']);_0x1a4f81['attributes']=_[_0x8e81('0x39')](_0x34d17e[_0x8e81('0x35')],qs[_0x8e81('0x3a')](_0x220b63[_0x8e81('0x36')]['fields']));_0x1a4f81[_0x8e81('0x3b')]=_0x1a4f81[_0x8e81('0x3b')][_0x8e81('0x3c')]?_0x1a4f81[_0x8e81('0x3b')]:_0x34d17e[_0x8e81('0x35')];if(!_0x220b63[_0x8e81('0x36')][_0x8e81('0x3d')](_0x8e81('0x3e'))){_0x1a4f81['limit']=qs['limit'](_0x220b63['query'][_0x8e81('0x1e')]);_0x1a4f81[_0x8e81('0x1c')]=qs['offset'](_0x220b63['query'][_0x8e81('0x1c')]);}_0x1a4f81[_0x8e81('0x3f')]=qs[_0x8e81('0x40')](_0x220b63['query']['sort']);_0x1a4f81[_0x8e81('0x41')]=qs['filters'](_[_0x8e81('0x42')](_0x220b63[_0x8e81('0x36')],_0x34d17e['filters']),_0x26de15);if(_0x220b63[_0x8e81('0x36')][_0x8e81('0x43')]){_0x1a4f81[_0x8e81('0x41')]=_[_0x8e81('0x44')](_0x1a4f81[_0x8e81('0x41')],{'$or':_[_0x8e81('0x2f')](_0x26de15,function(_0x2fec92){if(_0x2fec92[_0x8e81('0x33')]!==_0x8e81('0x45')){var _0x3e1a46={};_0x3e1a46[_0x2fec92['name']]={'$like':'%'+_0x220b63[_0x8e81('0x36')][_0x8e81('0x43')]+'%'};return _0x3e1a46;}})});}_0x1a4f81=_[_0x8e81('0x44')]({},_0x1a4f81,_0x220b63[_0x8e81('0x46')]);var _0x5dd682={'where':_0x1a4f81[_0x8e81('0x41')]};return db[_0x8e81('0x30')][_0x8e81('0x1f')](_0x5dd682)[_0x8e81('0x25')](function(_0x1d9e29){_0x296a80['count']=_0x1d9e29;if(_0x220b63[_0x8e81('0x36')]['includeAll']){_0x1a4f81['include']=[{'all':!![]}];}return db[_0x8e81('0x30')][_0x8e81('0x47')](_0x1a4f81);})['then'](function(_0x4a49ab){_0x296a80[_0x8e81('0x48')]=_0x4a49ab;return _0x296a80;})[_0x8e81('0x25')](respondWithFilteredResult(_0x2dc744,_0x1a4f81))['catch'](handleError(_0x2dc744,null));};exports[_0x8e81('0x49')]=function(_0x3e66a8,_0x2965b8){var _0x166b27={'raw':![],'where':{'id':_0x3e66a8[_0x8e81('0x4a')]['id']}},_0x5653f8={};_0x5653f8['model']=_[_0x8e81('0x37')](db[_0x8e81('0x30')][_0x8e81('0x31')]);_0x5653f8[_0x8e81('0x36')]=_[_0x8e81('0x37')](_0x3e66a8[_0x8e81('0x36')]);_0x5653f8[_0x8e81('0x38')]=_[_0x8e81('0x39')](_0x5653f8[_0x8e81('0x35')],_0x5653f8[_0x8e81('0x36')]);_0x166b27[_0x8e81('0x3b')]=_[_0x8e81('0x39')](_0x5653f8[_0x8e81('0x35')],qs['fields'](_0x3e66a8['query']['fields']));_0x166b27[_0x8e81('0x3b')]=_0x166b27[_0x8e81('0x3b')][_0x8e81('0x3c')]?_0x166b27[_0x8e81('0x3b')]:_0x5653f8['model'];if(_0x3e66a8['query'][_0x8e81('0x4b')]){_0x166b27[_0x8e81('0x4c')]=[{'all':!![]}];}_0x166b27=_[_0x8e81('0x44')]({},_0x166b27,_0x3e66a8['options']);return db[_0x8e81('0x30')]['find'](_0x166b27)['then'](handleEntityNotFound(_0x2965b8,null))[_0x8e81('0x25')](respondWithResult(_0x2965b8,null))[_0x8e81('0x4d')](handleError(_0x2965b8,null));};exports[_0x8e81('0x4e')]=function(_0x17dbb5,_0x2b201c){return db[_0x8e81('0x30')][_0x8e81('0x4e')](_0x17dbb5[_0x8e81('0x4f')],{})[_0x8e81('0x25')](function(_0x13eb25){var _0x5681d3=_0x17dbb5[_0x8e81('0x50')]['get']({'plain':!![]});if(!_0x5681d3)throw new Error(_0x8e81('0x51'));if(_0x5681d3[_0x8e81('0x52')]===_0x8e81('0x50')){var _0x4a3fdc=_0x13eb25[_0x8e81('0x26')]({'plain':!![]});var _0xccc6f2=_0x8e81('0x27');return db[_0x8e81('0x53')][_0x8e81('0x54')]({'where':{'name':_0xccc6f2,'userProfileId':_0x5681d3['userProfileId']},'raw':!![]})[_0x8e81('0x25')](function(_0x1532b9){if(_0x1532b9&&_0x1532b9['autoAssociation']===0x0){return db[_0x8e81('0x28')][_0x8e81('0x4e')]({'name':_0x4a3fdc[_0x8e81('0x2c')],'resourceId':_0x4a3fdc['id'],'type':_0x1532b9['name'],'sectionId':_0x1532b9['id']},{})[_0x8e81('0x25')](function(){return _0x13eb25;});}else{return _0x13eb25;}})[_0x8e81('0x4d')](function(_0x915533){logger['error'](_0x8e81('0x55'),_0x915533);throw _0x915533;});}return _0x13eb25;})['then'](respondWithResult(_0x2b201c,0xc9))[_0x8e81('0x4d')](handleError(_0x2b201c,null));};exports[_0x8e81('0x56')]=function(_0x29dc61,_0x1c1dc5){if(_0x29dc61[_0x8e81('0x4f')]['id']){delete _0x29dc61[_0x8e81('0x4f')]['id'];}return db[_0x8e81('0x30')][_0x8e81('0x54')]({'where':{'id':_0x29dc61['params']['id']}})['then'](handleEntityNotFound(_0x1c1dc5,null))[_0x8e81('0x25')](saveUpdates(_0x29dc61[_0x8e81('0x4f')],null))['then'](respondWithResult(_0x1c1dc5,null))[_0x8e81('0x4d')](handleError(_0x1c1dc5,null));};exports[_0x8e81('0x29')]=function(_0x521f49,_0x5714e4){return db[_0x8e81('0x30')][_0x8e81('0x54')]({'where':{'id':_0x521f49['params']['id']}})[_0x8e81('0x25')](handleEntityNotFound(_0x5714e4,null))[_0x8e81('0x25')](removeEntity(_0x5714e4,null))[_0x8e81('0x4d')](handleError(_0x5714e4,null));};exports[_0x8e81('0x57')]=function(_0x3e7363,_0x32159a,_0x4ec2de){var _0x1de2cf=require(_0x8e81('0x58'));return db[_0x8e81('0x30')]['find']({'where':{'id':_0x3e7363[_0x8e81('0x4a')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x32159a,null))['then'](function(){_0x1de2cf[_0x8e81('0x57')](_0x3e7363[_0x8e81('0x4a')]['id']);})['then'](respondWithStatusCode(_0x32159a,null))[_0x8e81('0x4d')](handleError(_0x32159a,null));};
\ No newline at end of file
+var _0x8df7=['model','filters','intersection','attributes','query','fields','length','nolimit','order','where','pick','filter','merge','options','include','rows','catch','show','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','get','Scheduler','UserProfileResource','error','stack','name','send','map','Schedule','rawAttributes','type','key'];(function(_0x227702,_0x5c4b0f){var _0x4871ad=function(_0x4166a4){while(--_0x4166a4){_0x227702['push'](_0x227702['shift']());}};_0x4871ad(++_0x5c4b0f);}(_0x8df7,0xc3));var _0x78df=function(_0x1388dc,_0x3afc03){_0x1388dc=_0x1388dc-0x0;var _0x57eaf9=_0x8df7[_0x1388dc];return _0x57eaf9;};'use strict';var emlformat=require(_0x78df('0x0'));var rimraf=require(_0x78df('0x1'));var zipdir=require(_0x78df('0x2'));var jsonpatch=require(_0x78df('0x3'));var rp=require(_0x78df('0x4'));var moment=require(_0x78df('0x5'));var BPromise=require(_0x78df('0x6'));var Mustache=require(_0x78df('0x7'));var util=require(_0x78df('0x8'));var path=require(_0x78df('0x9'));var sox=require(_0x78df('0xa'));var csv=require(_0x78df('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x78df('0xc'));var toCsv=require(_0x78df('0xb'));var querystring=require(_0x78df('0xd'));var Papa=require('papaparse');var Redis=require(_0x78df('0xe'));var authService=require(_0x78df('0xf'));var qs=require(_0x78df('0x10'));var as=require(_0x78df('0x11'));var hardwareService=require(_0x78df('0x12'));var logger=require(_0x78df('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x78df('0x14'));var licenseUtil=require(_0x78df('0x15'));var db=require(_0x78df('0x16'))['db'];function respondWithStatusCode(_0x261c71,_0x218025){_0x218025=_0x218025||0xcc;return function(_0x16e128){if(_0x16e128){return _0x261c71[_0x78df('0x17')](_0x218025);}return _0x261c71[_0x78df('0x18')](_0x218025)[_0x78df('0x19')]();};}function respondWithResult(_0x297375,_0x21bf87){_0x21bf87=_0x21bf87||0xc8;return function(_0x42cb84){if(_0x42cb84){return _0x297375['status'](_0x21bf87)[_0x78df('0x1a')](_0x42cb84);}};}function respondWithFilteredResult(_0x51b765,_0x457370){return function(_0x4da6aa){if(_0x4da6aa){var _0xbf052f=typeof _0x457370[_0x78df('0x1b')]===_0x78df('0x1c')&&typeof _0x457370['limit']===_0x78df('0x1c');var _0x19b271=_0x4da6aa['count'];var _0x482819=_0xbf052f?0x0:_0x457370[_0x78df('0x1b')];var _0x2247f3=_0xbf052f?_0x4da6aa[_0x78df('0x1d')]:_0x457370['offset']+_0x457370[_0x78df('0x1e')];var _0x597312;if(_0x2247f3>=_0x19b271){_0x2247f3=_0x19b271;_0x597312=0xc8;}else{_0x597312=0xce;}_0x51b765[_0x78df('0x18')](_0x597312);return _0x51b765['set']('Content-Range',_0x482819+'-'+_0x2247f3+'/'+_0x19b271)[_0x78df('0x1a')](_0x4da6aa);}return null;};}function patchUpdates(_0x12ce6f){return function(_0x2795fb){try{jsonpatch[_0x78df('0x1f')](_0x2795fb,_0x12ce6f,!![]);}catch(_0x4440ae){return BPromise[_0x78df('0x20')](_0x4440ae);}return _0x2795fb[_0x78df('0x21')]();};}function saveUpdates(_0xacec5a,_0x2fdafb){return function(_0x58b12a){if(_0x58b12a){return _0x58b12a[_0x78df('0x22')](_0xacec5a)['then'](function(_0x4e39a3){return _0x4e39a3;});}return null;};}function removeEntity(_0x45b7c7,_0x84b26e){return function(_0x2b42fd){if(_0x2b42fd){return _0x2b42fd['destroy']()[_0x78df('0x23')](function(){var _0x425bcb=_0x2b42fd[_0x78df('0x24')]({'plain':!![]});var _0x40c955=_0x78df('0x25');return db[_0x78df('0x26')]['destroy']({'where':{'type':_0x40c955,'resourceId':_0x425bcb['id']}})['then'](function(){return _0x2b42fd;});})[_0x78df('0x23')](function(){_0x45b7c7[_0x78df('0x18')](0xcc)[_0x78df('0x19')]();});}};}function handleEntityNotFound(_0x46fdc2,_0x3cdf9b){return function(_0x3964dc){if(!_0x3964dc){_0x46fdc2[_0x78df('0x17')](0x194);}return _0x3964dc;};}function handleError(_0x41fdc4,_0xf01fc0){_0xf01fc0=_0xf01fc0||0x1f4;return function(_0x1e1743){logger[_0x78df('0x27')](_0x1e1743[_0x78df('0x28')]);if(_0x1e1743[_0x78df('0x29')]){delete _0x1e1743['name'];}_0x41fdc4[_0x78df('0x18')](_0xf01fc0)[_0x78df('0x2a')](_0x1e1743);};}exports['index']=function(_0x4b3216,_0x22fe13){var _0x2547d6={},_0x44755d={},_0x27e7e3={'count':0x0,'rows':[]};var _0x470a96=_[_0x78df('0x2b')](db[_0x78df('0x2c')][_0x78df('0x2d')],function(_0x40f1eb){return{'name':_0x40f1eb['fieldName'],'type':_0x40f1eb[_0x78df('0x2e')][_0x78df('0x2f')]};});_0x44755d[_0x78df('0x30')]=_[_0x78df('0x2b')](_0x470a96,'name');_0x44755d['query']=_['keys'](_0x4b3216['query']);_0x44755d[_0x78df('0x31')]=_[_0x78df('0x32')](_0x44755d['model'],_0x44755d['query']);_0x2547d6[_0x78df('0x33')]=_[_0x78df('0x32')](_0x44755d[_0x78df('0x30')],qs['fields'](_0x4b3216[_0x78df('0x34')][_0x78df('0x35')]));_0x2547d6['attributes']=_0x2547d6['attributes'][_0x78df('0x36')]?_0x2547d6[_0x78df('0x33')]:_0x44755d[_0x78df('0x30')];if(!_0x4b3216[_0x78df('0x34')]['hasOwnProperty'](_0x78df('0x37'))){_0x2547d6[_0x78df('0x1e')]=qs[_0x78df('0x1e')](_0x4b3216[_0x78df('0x34')][_0x78df('0x1e')]);_0x2547d6['offset']=qs[_0x78df('0x1b')](_0x4b3216[_0x78df('0x34')]['offset']);}_0x2547d6[_0x78df('0x38')]=qs['sort'](_0x4b3216['query']['sort']);_0x2547d6[_0x78df('0x39')]=qs[_0x78df('0x31')](_[_0x78df('0x3a')](_0x4b3216[_0x78df('0x34')],_0x44755d[_0x78df('0x31')]),_0x470a96);if(_0x4b3216[_0x78df('0x34')][_0x78df('0x3b')]){_0x2547d6[_0x78df('0x39')]=_[_0x78df('0x3c')](_0x2547d6[_0x78df('0x39')],{'$or':_[_0x78df('0x2b')](_0x470a96,function(_0x29926c){if(_0x29926c[_0x78df('0x2e')]!=='VIRTUAL'){var _0x441c5a={};_0x441c5a[_0x29926c[_0x78df('0x29')]]={'$like':'%'+_0x4b3216[_0x78df('0x34')]['filter']+'%'};return _0x441c5a;}})});}_0x2547d6=_[_0x78df('0x3c')]({},_0x2547d6,_0x4b3216[_0x78df('0x3d')]);var _0x5e2fed={'where':_0x2547d6[_0x78df('0x39')]};return db['Schedule'][_0x78df('0x1d')](_0x5e2fed)[_0x78df('0x23')](function(_0x2037b0){_0x27e7e3[_0x78df('0x1d')]=_0x2037b0;if(_0x4b3216[_0x78df('0x34')]['includeAll']){_0x2547d6[_0x78df('0x3e')]=[{'all':!![]}];}return db[_0x78df('0x2c')]['findAll'](_0x2547d6);})[_0x78df('0x23')](function(_0x1ec330){_0x27e7e3[_0x78df('0x3f')]=_0x1ec330;return _0x27e7e3;})['then'](respondWithFilteredResult(_0x22fe13,_0x2547d6))[_0x78df('0x40')](handleError(_0x22fe13,null));};exports[_0x78df('0x41')]=function(_0x26de19,_0x1affa7){var _0x1b9a8f={'raw':![],'where':{'id':_0x26de19[_0x78df('0x42')]['id']}},_0x16a54d={};_0x16a54d['model']=_['keys'](db[_0x78df('0x2c')][_0x78df('0x2d')]);_0x16a54d[_0x78df('0x34')]=_[_0x78df('0x43')](_0x26de19[_0x78df('0x34')]);_0x16a54d[_0x78df('0x31')]=_[_0x78df('0x32')](_0x16a54d['model'],_0x16a54d[_0x78df('0x34')]);_0x1b9a8f['attributes']=_[_0x78df('0x32')](_0x16a54d['model'],qs[_0x78df('0x35')](_0x26de19[_0x78df('0x34')]['fields']));_0x1b9a8f[_0x78df('0x33')]=_0x1b9a8f['attributes'][_0x78df('0x36')]?_0x1b9a8f['attributes']:_0x16a54d[_0x78df('0x30')];if(_0x26de19[_0x78df('0x34')][_0x78df('0x44')]){_0x1b9a8f[_0x78df('0x3e')]=[{'all':!![]}];}_0x1b9a8f=_['merge']({},_0x1b9a8f,_0x26de19['options']);return db['Schedule'][_0x78df('0x45')](_0x1b9a8f)['then'](handleEntityNotFound(_0x1affa7,null))[_0x78df('0x23')](respondWithResult(_0x1affa7,null))[_0x78df('0x40')](handleError(_0x1affa7,null));};exports[_0x78df('0x46')]=function(_0x2bc320,_0x223efe){return db['Schedule'][_0x78df('0x46')](_0x2bc320[_0x78df('0x47')],{})['then'](function(_0xc1221){var _0x1eee53=_0x2bc320[_0x78df('0x48')]['get']({'plain':!![]});if(!_0x1eee53)throw new Error(_0x78df('0x49'));if(_0x1eee53[_0x78df('0x4a')]===_0x78df('0x48')){var _0x5dc2cf=_0xc1221['get']({'plain':!![]});var _0x7b3c31=_0x78df('0x25');return db[_0x78df('0x4b')][_0x78df('0x45')]({'where':{'name':_0x7b3c31,'userProfileId':_0x1eee53['userProfileId']},'raw':!![]})[_0x78df('0x23')](function(_0x44e406){if(_0x44e406&&_0x44e406[_0x78df('0x4c')]===0x0){return db[_0x78df('0x26')][_0x78df('0x46')]({'name':_0x5dc2cf['name'],'resourceId':_0x5dc2cf['id'],'type':_0x44e406[_0x78df('0x29')],'sectionId':_0x44e406['id']},{})[_0x78df('0x23')](function(){return _0xc1221;});}else{return _0xc1221;}})['catch'](function(_0x2d8d6f){logger[_0x78df('0x27')](_0x78df('0x4d'),_0x2d8d6f);throw _0x2d8d6f;});}return _0xc1221;})['then'](respondWithResult(_0x223efe,0xc9))[_0x78df('0x40')](handleError(_0x223efe,null));};exports['update']=function(_0x257738,_0x24de4d){if(_0x257738['body']['id']){delete _0x257738[_0x78df('0x47')]['id'];}return db[_0x78df('0x2c')][_0x78df('0x45')]({'where':{'id':_0x257738['params']['id']}})[_0x78df('0x23')](handleEntityNotFound(_0x24de4d,null))[_0x78df('0x23')](saveUpdates(_0x257738['body'],null))[_0x78df('0x23')](respondWithResult(_0x24de4d,null))[_0x78df('0x40')](handleError(_0x24de4d,null));};exports[_0x78df('0x4e')]=function(_0x243246,_0x596cec){return db[_0x78df('0x2c')][_0x78df('0x45')]({'where':{'id':_0x243246['params']['id']}})[_0x78df('0x23')](handleEntityNotFound(_0x596cec,null))[_0x78df('0x23')](removeEntity(_0x596cec,null))['catch'](handleError(_0x596cec,null));};exports[_0x78df('0x4f')]=function(_0x40432c,_0x117bb6,_0x5d9baa){var _0x525787=require(_0x78df('0x50'));return db[_0x78df('0x2c')][_0x78df('0x45')]({'where':{'id':_0x40432c['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x117bb6,null))[_0x78df('0x23')](function(){_0x525787[_0x78df('0x4f')](_0x40432c[_0x78df('0x42')]['id']);})['then'](respondWithStatusCode(_0x117bb6,null))['catch'](handleError(_0x117bb6,null));};
\ No newline at end of file
index 5dfd93f..ca39a28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2559=['path','./schedule.attributes','exports','define','tools_schedules','lodash','util','../../config/logger','moment'];(function(_0x561369,_0x5e037b){var _0x5b071d=function(_0x32fdee){while(--_0x32fdee){_0x561369['push'](_0x561369['shift']());}};_0x5b071d(++_0x5e037b);}(_0x2559,0x7a));var _0x9255=function(_0x397a15,_0x33fd9c){_0x397a15=_0x397a15-0x0;var _0x219b3b=_0x2559[_0x397a15];return _0x219b3b;};'use strict';var _=require(_0x9255('0x0'));var util=require(_0x9255('0x1'));var logger=require(_0x9255('0x2'))('api');var moment=require(_0x9255('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9255('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9255('0x5'));module[_0x9255('0x6')]=function(_0x5ab28d,_0x2593d5){return _0x5ab28d[_0x9255('0x7')]('Schedule',attributes,{'tableName':_0x9255('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2e38=['api','moment','bluebird','../../config/environment','./schedule.attributes','exports','define','Schedule','lodash','util','../../config/logger'];(function(_0x8bf470,_0x4216e7){var _0x3a899b=function(_0x9b3808){while(--_0x9b3808){_0x8bf470['push'](_0x8bf470['shift']());}};_0x3a899b(++_0x4216e7);}(_0x2e38,0x97));var _0x82e3=function(_0x30bb9e,_0x13ca2a){_0x30bb9e=_0x30bb9e-0x0;var _0x2bb61b=_0x2e38[_0x30bb9e];return _0x2bb61b;};'use strict';var _=require(_0x82e3('0x0'));var util=require(_0x82e3('0x1'));var logger=require(_0x82e3('0x2'))(_0x82e3('0x3'));var moment=require(_0x82e3('0x4'));var BPromise=require(_0x82e3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x82e3('0x6'));var attributes=require(_0x82e3('0x7'));module[_0x82e3('0x8')]=function(_0x1dfe46,_0x297555){return _0x1dfe46[_0x82e3('0x9')](_0x82e3('0xa'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6ed5160..b0d4f5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9319=['jayson/promise','client','request','debug','request\x20sent','error','code','Schedule,\x20%s,\x20%s','message','info','result','catch','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x5b6bf4,_0x1ecac){var _0x30c961=function(_0xcbe503){while(--_0xcbe503){_0x5b6bf4['push'](_0x5b6bf4['shift']());}};_0x30c961(++_0x1ecac);}(_0x9319,0x198));var _0x9931=function(_0x2a25e4,_0x4a5630){_0x2a25e4=_0x2a25e4-0x0;var _0x80e046=_0x9319[_0x2a25e4];return _0x80e046;};'use strict';var _=require('lodash');var util=require(_0x9931('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9931('0x1'));var fs=require('fs');var Redis=require(_0x9931('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9931('0x3'))(_0x9931('0x4'));var config=require(_0x9931('0x5'));var jayson=require(_0x9931('0x6'));var client=jayson[_0x9931('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1656a4,_0x534f2d,_0x4e8755){return new BPromise(function(_0x3b1283,_0x2f6569){return client[_0x9931('0x8')](_0x1656a4,_0x4e8755)['then'](function(_0x105a6c){logger['info']('Schedule,\x20%s,\x20%s',_0x534f2d,'request\x20sent');logger[_0x9931('0x9')]('Schedule,\x20%s,\x20%s,\x20%s',_0x534f2d,_0x9931('0xa'),JSON['stringify'](_0x105a6c));if(_0x105a6c['error']){if(_0x105a6c[_0x9931('0xb')][_0x9931('0xc')]===0x1f4){logger[_0x9931('0xb')](_0x9931('0xd'),_0x534f2d,_0x105a6c[_0x9931('0xb')][_0x9931('0xe')]);return _0x2f6569(_0x105a6c[_0x9931('0xb')][_0x9931('0xe')]);}logger[_0x9931('0xb')]('Schedule,\x20%s,\x20%s',_0x534f2d,_0x105a6c[_0x9931('0xb')]['message']);return _0x3b1283(_0x105a6c[_0x9931('0xb')]['message']);}else{logger[_0x9931('0xf')](_0x9931('0xd'),_0x534f2d,'request\x20sent');_0x3b1283(_0x105a6c[_0x9931('0x10')]['message']);}})[_0x9931('0x11')](function(_0x18f5fa){logger[_0x9931('0xb')](_0x9931('0xd'),_0x534f2d,_0x18f5fa);_0x2f6569(_0x18f5fa);});});}
\ No newline at end of file
+var _0xf29f=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xf29f,0x188));var _0xff29=function(_0x3b990f,_0x5b2293){_0x3b990f=_0x3b990f-0x0;var _0x33e10d=_0xf29f[_0x3b990f];return _0x33e10d;};'use strict';var _=require(_0xff29('0x0'));var util=require('util');var moment=require(_0xff29('0x1'));var BPromise=require(_0xff29('0x2'));var rs=require(_0xff29('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff29('0x4'))['db'];var utils=require(_0xff29('0x5'));var logger=require(_0xff29('0x6'))(_0xff29('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xff29('0x8')][_0xff29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dfb34,_0x264229,_0x1bee94){return new BPromise(function(_0x1fc22f,_0x36efe7){return client[_0xff29('0xa')](_0x1dfb34,_0x1bee94)[_0xff29('0xb')](function(_0x27fc89){logger['info'](_0xff29('0xc'),_0x264229,'request\x20sent');logger[_0xff29('0xd')](_0xff29('0xe'),_0x264229,'request\x20sent',JSON[_0xff29('0xf')](_0x27fc89));if(_0x27fc89['error']){if(_0x27fc89[_0xff29('0x10')][_0xff29('0x11')]===0x1f4){logger[_0xff29('0x10')]('Schedule,\x20%s,\x20%s',_0x264229,_0x27fc89[_0xff29('0x10')][_0xff29('0x12')]);return _0x36efe7(_0x27fc89[_0xff29('0x10')][_0xff29('0x12')]);}logger[_0xff29('0x10')]('Schedule,\x20%s,\x20%s',_0x264229,_0x27fc89['error'][_0xff29('0x12')]);return _0x1fc22f(_0x27fc89['error'][_0xff29('0x12')]);}else{logger[_0xff29('0x13')](_0xff29('0xc'),_0x264229,'request\x20sent');_0x1fc22f(_0x27fc89[_0xff29('0x14')][_0xff29('0x12')]);}})[_0xff29('0x15')](function(_0x31678b){logger[_0xff29('0x10')](_0xff29('0xc'),_0x264229,_0x31678b);_0x36efe7(_0x31678b);});});}
\ No newline at end of file
index b5f0134..d8a6003 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7be9=['isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0xb4bdb3,_0x48dca0){var _0x4c8c02=function(_0xf9850c){while(--_0xf9850c){_0xb4bdb3['push'](_0xb4bdb3['shift']());}};_0x4c8c02(++_0x48dca0);}(_0x7be9,0xff));var _0x97be=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x7be9[_0x4ff09b];return _0x3f5c2e;};'use strict';var multer=require('multer');var util=require(_0x97be('0x0'));var path=require(_0x97be('0x1'));var timeout=require(_0x97be('0x2'));var express=require(_0x97be('0x3'));var router=express[_0x97be('0x4')]();var fs_extra=require(_0x97be('0x5'));var auth=require(_0x97be('0x6'));var interaction=require(_0x97be('0x7'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0x97be('0x8')]('/',auth[_0x97be('0x9')](),controller[_0x97be('0xa')]);router['get'](_0x97be('0xb'),auth[_0x97be('0x9')](),controller[_0x97be('0xc')]);router['get'](_0x97be('0xd'),auth[_0x97be('0x9')](),controller[_0x97be('0xe')]);router[_0x97be('0x8')](_0x97be('0xf'),auth[_0x97be('0x9')](),controller[_0x97be('0x10')]);router[_0x97be('0x11')]('/',auth['isAuthenticated'](),controller[_0x97be('0x12')]);router[_0x97be('0x13')](_0x97be('0xd'),auth[_0x97be('0x9')](),controller[_0x97be('0x14')]);router[_0x97be('0x15')]('/:id',auth[_0x97be('0x9')](),controller[_0x97be('0x16')]);module[_0x97be('0x17')]=router;
\ No newline at end of file
+var _0x5cb3=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./screenRecording.controller','get','isAuthenticated','describe','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x221d96,_0xf9584c){var _0x8b9379=function(_0x3d7159){while(--_0x3d7159){_0x221d96['push'](_0x221d96['shift']());}};_0x8b9379(++_0xf9584c);}(_0x5cb3,0x174));var _0x35cb=function(_0x4cec21,_0x3d6fb4){_0x4cec21=_0x4cec21-0x0;var _0x30f1ef=_0x5cb3[_0x4cec21];return _0x30f1ef;};'use strict';var multer=require(_0x35cb('0x0'));var util=require('util');var path=require(_0x35cb('0x1'));var timeout=require(_0x35cb('0x2'));var express=require(_0x35cb('0x3'));var router=express[_0x35cb('0x4')]();var fs_extra=require(_0x35cb('0x5'));var auth=require(_0x35cb('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x35cb('0x7'));router[_0x35cb('0x8')]('/',auth[_0x35cb('0x9')](),controller['index']);router[_0x35cb('0x8')]('/describe',auth[_0x35cb('0x9')](),controller[_0x35cb('0xa')]);router[_0x35cb('0x8')](_0x35cb('0xb'),auth[_0x35cb('0x9')](),controller[_0x35cb('0xc')]);router[_0x35cb('0x8')](_0x35cb('0xd'),auth['isAuthenticated'](),controller[_0x35cb('0xe')]);router[_0x35cb('0xf')]('/',auth[_0x35cb('0x9')](),controller[_0x35cb('0x10')]);router[_0x35cb('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x35cb('0x12')]);router[_0x35cb('0x13')]('/:id',auth[_0x35cb('0x9')](),controller[_0x35cb('0x14')]);module[_0x35cb('0x15')]=router;
\ No newline at end of file
index cba5425..d4eee6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3264=['updatedAt','moment','path','../../config/environment','exports','value','STRING','replace','setDataValue','INTEGER','subtract','closedAt','getDataValue','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt'];(function(_0x54e089,_0x863de9){var _0x1beb80=function(_0x26c42d){while(--_0x26c42d){_0x54e089['push'](_0x54e089['shift']());}};_0x1beb80(++_0x863de9);}(_0x3264,0x7f));var _0x4326=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x3264[_0xdc37a1];return _0x99b4fe;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4326('0x0'));var path=require(_0x4326('0x1'));var config=require(_0x4326('0x2'));module[_0x4326('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x4326('0x4'))?path['extname'](this['getDataValue'](_0x4326('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0x4326('0x5')]},'channel':{'type':Sequelize[_0x4326('0x5')]},'value':{'type':Sequelize[_0x4326('0x5')],'set':function(_0x56bcce){var _0x3a7544=_0x56bcce[_0x4326('0x6')](/\\/g,'/');this[_0x4326('0x7')](_0x4326('0x4'),_0x3a7544);}},'rating':{'type':Sequelize[_0x4326('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x4326('0x8')],'set':function(_0x1609f){this['setDataValue']('startedAt',moment()[_0x4326('0x9')](_0x1609f,'ms'));this[_0x4326('0x7')](_0x4326('0xa'),moment());this[_0x4326('0x7')]('duration',_0x1609f);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x4326('0xb')]('startedAt'))[_0x4326('0xc')](_0x4326('0xd'))[_0x4326('0xe')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x4326('0xa')))['format']('MM-DD-YYYY\x20HH:mm')[_0x4326('0xe')]();}},'createdAt':{'type':Sequelize[_0x4326('0xf')],'get':function(){return moment(this[_0x4326('0xb')](_0x4326('0x10')))['format'](_0x4326('0xd'))[_0x4326('0xe')]();}},'updatedAt':{'type':Sequelize[_0x4326('0xf')],'get':function(){return moment(this['getDataValue'](_0x4326('0x11')))[_0x4326('0xc')](_0x4326('0xd'))[_0x4326('0xe')]();}}};
\ No newline at end of file
+var _0xa456=['path','../../config/environment','VIRTUAL','getDataValue','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','DATE','toString','format','MM-DD-YYYY\x20HH:mm','sequelize','moment'];(function(_0x3f7598,_0x212e37){var _0x51fb16=function(_0x4a5c0b){while(--_0x4a5c0b){_0x3f7598['push'](_0x3f7598['shift']());}};_0x51fb16(++_0x212e37);}(_0xa456,0x142));var _0x6a45=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xa456[_0x2112d4];return _0x434972;};'use strict';var Sequelize=require(_0x6a45('0x0'));var moment=require(_0x6a45('0x1'));var path=require(_0x6a45('0x2'));var config=require(_0x6a45('0x3'));module['exports']={'format':{'type':Sequelize[_0x6a45('0x4')],'get':function(){return this[_0x6a45('0x5')](_0x6a45('0x6'))?path['extname'](this[_0x6a45('0x5')](_0x6a45('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x6a45('0x7')]},'channel':{'type':Sequelize[_0x6a45('0x7')]},'value':{'type':Sequelize['STRING'],'set':function(_0x25cf8d){var _0x26bfc0=_0x25cf8d[_0x6a45('0x8')](/\\/g,'/');this[_0x6a45('0x9')](_0x6a45('0x6'),_0x26bfc0);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x6a45('0xa')],'set':function(_0x517040){this[_0x6a45('0x9')](_0x6a45('0xb'),moment()[_0x6a45('0xc')](_0x517040,'ms'));this[_0x6a45('0x9')](_0x6a45('0xd'),moment());this['setDataValue']('duration',_0x517040);}},'startedAt':{'type':Sequelize[_0x6a45('0xe')],'get':function(){return moment(this[_0x6a45('0x5')]('startedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0x6a45('0xf')]();}},'closedAt':{'type':Sequelize[_0x6a45('0xe')],'get':function(){return moment(this[_0x6a45('0x5')](_0x6a45('0xd')))[_0x6a45('0x10')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize[_0x6a45('0xe')],'get':function(){return moment(this[_0x6a45('0x5')]('createdAt'))[_0x6a45('0x10')](_0x6a45('0x11'))[_0x6a45('0xf')]();}},'updatedAt':{'type':Sequelize[_0x6a45('0xe')],'get':function(){return moment(this['getDataValue']('updatedAt'))['format'](_0x6a45('0x11'))[_0x6a45('0xf')]();}}};
\ No newline at end of file
index 6cbfdb8..863be5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd50=['unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','error','stack','name','send','index','map','rawAttributes','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ScreenRecording','includeAll','findAll','rows','catch','params','include','find','create','body','update','duration','value','describe','../../components/encryptor','uniqueid','join','root','%s.cypher','existsSync','decryptFile','recording','server/files/screen_recordings','ValidationError','filename','extname','download','unlink','message','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0xa47601,_0x106bc5){var _0x31eca6=function(_0x52af5f){while(--_0x52af5f){_0xa47601['push'](_0xa47601['shift']());}};_0x31eca6(++_0x106bc5);}(_0xbd50,0x196));var _0x0bd5=function(_0x72722a,_0x3501a1){_0x72722a=_0x72722a-0x0;var _0x134b69=_0xbd50[_0x72722a];return _0x134b69;};'use strict';var emlformat=require(_0x0bd5('0x0'));var rimraf=require(_0x0bd5('0x1'));var zipdir=require(_0x0bd5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd5('0x3'));var moment=require(_0x0bd5('0x4'));var BPromise=require(_0x0bd5('0x5'));var Mustache=require(_0x0bd5('0x6'));var util=require(_0x0bd5('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0bd5('0x8'));var fs=require('fs');var fs_extra=require(_0x0bd5('0x9'));var _=require(_0x0bd5('0xa'));var squel=require(_0x0bd5('0xb'));var crypto=require(_0x0bd5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0bd5('0xd'));var querystring=require(_0x0bd5('0xe'));var Papa=require(_0x0bd5('0xf'));var Redis=require('ioredis');var authService=require(_0x0bd5('0x10'));var qs=require(_0x0bd5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bd5('0x12'));var logger=require(_0x0bd5('0x13'))('api');var utils=require(_0x0bd5('0x14'));var config=require(_0x0bd5('0x15'));var licenseUtil=require(_0x0bd5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f7a0c,_0x23982f){_0x23982f=_0x23982f||0xcc;return function(_0x2f9588){if(_0x2f9588){return _0x2f7a0c[_0x0bd5('0x17')](_0x23982f);}return _0x2f7a0c[_0x0bd5('0x18')](_0x23982f)[_0x0bd5('0x19')]();};}function respondWithResult(_0x30765e,_0x1e961d){_0x1e961d=_0x1e961d||0xc8;return function(_0x4f485b){if(_0x4f485b){return _0x30765e[_0x0bd5('0x18')](_0x1e961d)[_0x0bd5('0x1a')](_0x4f485b);}};}function respondWithFilteredResult(_0x574315,_0x31349f){return function(_0x23ef4e){if(_0x23ef4e){var _0x3a34e4=typeof _0x31349f[_0x0bd5('0x1b')]==='undefined'&&typeof _0x31349f[_0x0bd5('0x1c')]===_0x0bd5('0x1d');var _0xa890be=_0x23ef4e[_0x0bd5('0x1e')];var _0x833c14=_0x3a34e4?0x0:_0x31349f[_0x0bd5('0x1b')];var _0xc58e12=_0x3a34e4?_0x23ef4e[_0x0bd5('0x1e')]:_0x31349f[_0x0bd5('0x1b')]+_0x31349f[_0x0bd5('0x1c')];var _0x27bc1e;if(_0xc58e12>=_0xa890be){_0xc58e12=_0xa890be;_0x27bc1e=0xc8;}else{_0x27bc1e=0xce;}_0x574315[_0x0bd5('0x18')](_0x27bc1e);return _0x574315[_0x0bd5('0x1f')](_0x0bd5('0x20'),_0x833c14+'-'+_0xc58e12+'/'+_0xa890be)['json'](_0x23ef4e);}return null;};}function patchUpdates(_0x5ba943){return function(_0x596b6a){try{jsonpatch['apply'](_0x596b6a,_0x5ba943,!![]);}catch(_0x47d74a){return BPromise[_0x0bd5('0x21')](_0x47d74a);}return _0x596b6a[_0x0bd5('0x22')]();};}function saveUpdates(_0x13ce46,_0x4a6910){return function(_0x6ee1a8){if(_0x6ee1a8){return _0x6ee1a8['update'](_0x13ce46)[_0x0bd5('0x23')](function(_0x3b235b){return _0x3b235b;});}return null;};}function removeEntity(_0x38c21d,_0x5a8139){return function(_0x5b6dde){if(_0x5b6dde){return _0x5b6dde['destroy']()['then'](function(){_0x38c21d[_0x0bd5('0x18')](0xcc)[_0x0bd5('0x19')]();});}};}function handleEntityNotFound(_0x184db3,_0x4fde84){return function(_0x42428c){if(!_0x42428c){_0x184db3['sendStatus'](0x194);}return _0x42428c;};}function handleError(_0x456e87,_0x3ffb08){_0x3ffb08=_0x3ffb08||0x1f4;return function(_0x18cec3){logger[_0x0bd5('0x24')](_0x18cec3[_0x0bd5('0x25')]);if(_0x18cec3[_0x0bd5('0x26')]){delete _0x18cec3[_0x0bd5('0x26')];}_0x456e87[_0x0bd5('0x18')](_0x3ffb08)[_0x0bd5('0x27')](_0x18cec3);};}exports[_0x0bd5('0x28')]=function(_0x15561b,_0xcbfc51){var _0x2e10ce={},_0x2704ee={},_0x5e5a33={'count':0x0,'rows':[]};var _0x461ae3=_[_0x0bd5('0x29')](db['ScreenRecording'][_0x0bd5('0x2a')],function(_0x8eccc9){return{'name':_0x8eccc9['fieldName'],'type':_0x8eccc9[_0x0bd5('0x2b')][_0x0bd5('0x2c')]};});_0x2704ee[_0x0bd5('0x2d')]=_[_0x0bd5('0x2e')](_['map'](_0x461ae3,_0x0bd5('0x26')),[_0x0bd5('0x2f')]);_0x2704ee[_0x0bd5('0x30')]=_[_0x0bd5('0x31')](_0x15561b[_0x0bd5('0x30')]);_0x2704ee[_0x0bd5('0x32')]=_['intersection'](_0x2704ee[_0x0bd5('0x2d')],_0x2704ee['query']);_0x2e10ce[_0x0bd5('0x33')]=_[_0x0bd5('0x34')](_0x2704ee[_0x0bd5('0x2d')],qs[_0x0bd5('0x35')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x35')]));_0x2e10ce[_0x0bd5('0x33')]=_0x2e10ce[_0x0bd5('0x33')][_0x0bd5('0x36')]?_0x2e10ce[_0x0bd5('0x33')]:_0x2704ee[_0x0bd5('0x2d')];if(!_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x37')]('nolimit')){_0x2e10ce[_0x0bd5('0x1c')]=qs[_0x0bd5('0x1c')](_0x15561b['query']['limit']);_0x2e10ce[_0x0bd5('0x1b')]=qs[_0x0bd5('0x1b')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x1b')]);}_0x2e10ce[_0x0bd5('0x38')]=qs[_0x0bd5('0x39')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x39')]);_0x2e10ce[_0x0bd5('0x3a')]=qs[_0x0bd5('0x32')](_[_0x0bd5('0x3b')](_0x15561b[_0x0bd5('0x30')],_0x2704ee[_0x0bd5('0x32')]),_0x461ae3);if(_0x15561b['query'][_0x0bd5('0x3c')]){_0x2e10ce['where']=_[_0x0bd5('0x3d')](_0x2e10ce[_0x0bd5('0x3a')],{'$or':_[_0x0bd5('0x29')](_0x461ae3,function(_0x1fcc49){if(_0x1fcc49[_0x0bd5('0x2b')]!==_0x0bd5('0x3e')){var _0x53a682={};_0x53a682[_0x1fcc49[_0x0bd5('0x26')]]={'$like':'%'+_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x3c')]+'%'};return _0x53a682;}})});}_0x2e10ce=_[_0x0bd5('0x3d')]({},_0x2e10ce,_0x15561b[_0x0bd5('0x3f')]);var _0x493089={'where':_0x2e10ce[_0x0bd5('0x3a')]};return db[_0x0bd5('0x40')][_0x0bd5('0x1e')](_0x493089)['then'](function(_0x177aa3){_0x5e5a33['count']=_0x177aa3;if(_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x41')]){_0x2e10ce['include']=[{'all':!![]}];}return db[_0x0bd5('0x40')][_0x0bd5('0x42')](_0x2e10ce);})[_0x0bd5('0x23')](function(_0x3ec4b0){_0x5e5a33[_0x0bd5('0x43')]=_0x3ec4b0;return _0x5e5a33;})[_0x0bd5('0x23')](respondWithFilteredResult(_0xcbfc51,_0x2e10ce))[_0x0bd5('0x44')](handleError(_0xcbfc51,null));};exports['show']=function(_0x4d3ca5,_0x994f24){var _0x545b63={'raw':![],'where':{'id':_0x4d3ca5[_0x0bd5('0x45')]['id']}},_0x5dd42b={};_0x5dd42b[_0x0bd5('0x2d')]=_['keys'](db['ScreenRecording']['rawAttributes']);_0x5dd42b[_0x0bd5('0x30')]=_['keys'](_0x4d3ca5['query']);_0x5dd42b[_0x0bd5('0x32')]=_[_0x0bd5('0x34')](_0x5dd42b['model'],_0x5dd42b['query']);_0x545b63[_0x0bd5('0x33')]=_[_0x0bd5('0x34')](_0x5dd42b[_0x0bd5('0x2d')],qs[_0x0bd5('0x35')](_0x4d3ca5['query'][_0x0bd5('0x35')]));_0x545b63[_0x0bd5('0x33')]=_0x545b63[_0x0bd5('0x33')][_0x0bd5('0x36')]?_0x545b63[_0x0bd5('0x33')]:_0x5dd42b[_0x0bd5('0x2d')];if(_0x4d3ca5['query'][_0x0bd5('0x41')]){_0x545b63[_0x0bd5('0x46')]=[{'all':!![]}];}_0x545b63=_[_0x0bd5('0x3d')]({},_0x545b63,_0x4d3ca5['options']);return db[_0x0bd5('0x40')][_0x0bd5('0x47')](_0x545b63)[_0x0bd5('0x23')](handleEntityNotFound(_0x994f24,null))['then'](respondWithResult(_0x994f24,null))[_0x0bd5('0x44')](handleError(_0x994f24,null));};exports[_0x0bd5('0x48')]=function(_0x54cd78,_0x18c7c7){return db[_0x0bd5('0x40')]['create'](_0x54cd78[_0x0bd5('0x49')],{})[_0x0bd5('0x23')](respondWithResult(_0x18c7c7,0xc9))['catch'](handleError(_0x18c7c7,null));};exports[_0x0bd5('0x4a')]=function(_0x20960a,_0x146bdc){if(_0x20960a[_0x0bd5('0x49')]['id']){delete _0x20960a[_0x0bd5('0x49')]['id'];}delete _0x20960a['body'][_0x0bd5('0x4b')];delete _0x20960a[_0x0bd5('0x49')]['createdAt'];delete _0x20960a[_0x0bd5('0x49')]['closedAt'];delete _0x20960a[_0x0bd5('0x49')][_0x0bd5('0x4c')];return db[_0x0bd5('0x40')][_0x0bd5('0x47')]({'where':{'id':_0x20960a['params']['id']}})[_0x0bd5('0x23')](handleEntityNotFound(_0x146bdc,null))['then'](saveUpdates(_0x20960a['body'],null))[_0x0bd5('0x23')](respondWithResult(_0x146bdc,null))[_0x0bd5('0x44')](handleError(_0x146bdc,null));};exports[_0x0bd5('0x4d')]=function(_0x4c9a79,_0x424187){return db['ScreenRecording'][_0x0bd5('0x4d')]()[_0x0bd5('0x23')](respondWithResult(_0x424187,null))[_0x0bd5('0x44')](handleError(_0x424187,null));};exports['download']=function(_0x512fe3,_0x4f0467,_0x122f84){var _0x21db5d=require(_0x0bd5('0x4e'));var _0x5b06c6=![];var _0x2b174a={};if(_0x512fe3[_0x0bd5('0x30')]['type']&&_0x512fe3[_0x0bd5('0x30')]['type']==='uniqueid'){_0x2b174a[_0x0bd5('0x4f')]=_0x512fe3[_0x0bd5('0x45')]['id'];}else{_0x2b174a['id']=_0x512fe3[_0x0bd5('0x45')]['id'];}return db[_0x0bd5('0x40')]['find']({'where':_0x2b174a,'attributes':['id',_0x0bd5('0x4c')],'raw':!![]})[_0x0bd5('0x23')](handleEntityNotFound(_0x4f0467,null))[_0x0bd5('0x23')](function(_0x5cf2f2){if(_0x5cf2f2){var _0x504e46=path[_0x0bd5('0x50')](config[_0x0bd5('0x51')],'server/files/screen_recordings',_0x5cf2f2['value']);var _0x2b11e8=util['format'](_0x0bd5('0x52'),_0x504e46);if(fs[_0x0bd5('0x53')](_0x2b11e8)){_0x5b06c6=!![];return _0x21db5d[_0x0bd5('0x54')](_0x2b11e8,_0x504e46,config['secrets'][_0x0bd5('0x55')])[_0x0bd5('0x23')](function(){return _0x5cf2f2;});}return _0x5cf2f2;}})[_0x0bd5('0x23')](function(_0x38aae5){if(_0x38aae5){var _0x5e93fa=path[_0x0bd5('0x50')](config[_0x0bd5('0x51')],_0x0bd5('0x56'),_0x38aae5[_0x0bd5('0x4c')]);if(!fs[_0x0bd5('0x53')](_0x5e93fa)){throw new db['Sequelize'][(_0x0bd5('0x57'))]('ScreenRecording\x20not\x20found');}if(_0x38aae5[_0x0bd5('0x58')]){return _0x4f0467['download'](_0x5e93fa,_0x38aae5['filename']+path[_0x0bd5('0x59')](_0x5e93fa),function(){if(_0x5b06c6){fs['unlink'](_0x5e93fa);}});}else{return _0x4f0467[_0x0bd5('0x5a')](_0x5e93fa,function(_0x3087de){if(_0x5b06c6){fs[_0x0bd5('0x5b')](_0x5e93fa);}});}}})['catch'](function(_0x4f7e86){if(_0x4f7e86[_0x0bd5('0x5c')]==='ScreenRecording\x20not\x20found'){_0x4f0467[_0x0bd5('0x18')](0x194)[_0x0bd5('0x27')]('Not\x20found');}else{return handleError(_0x4f0467,null);}});};exports[_0x0bd5('0x5d')]=function(_0x5a38b1,_0x45ccf5){return db[_0x0bd5('0x40')][_0x0bd5('0x47')]({'where':{'id':_0x5a38b1[_0x0bd5('0x45')]['id']}})[_0x0bd5('0x23')](function(_0x467488){if(_[_0x0bd5('0x5e')](_0x467488)){throw new ReferenceError('Entity\x20not\x20found');}return _0x467488;})[_0x0bd5('0x23')](function(_0x1e5e7d){var _0x33c5eb=path['join'](config['root'],_0x0bd5('0x56'),_0x1e5e7d[_0x0bd5('0x4c')]);logger[_0x0bd5('0x5f')](_0x0bd5('0x60'),_0x33c5eb);if(!_[_0x0bd5('0x5e')](_0x1e5e7d[_0x0bd5('0x4c')])&&fs[_0x0bd5('0x53')](_0x33c5eb)){logger[_0x0bd5('0x5f')](_0x0bd5('0x61')+_0x33c5eb+_0x0bd5('0x62'));fs[_0x0bd5('0x63')](_0x33c5eb);}_0x33c5eb=_0x33c5eb+_0x0bd5('0x64');if(!_[_0x0bd5('0x5e')](_0x1e5e7d[_0x0bd5('0x4c')])&&fs[_0x0bd5('0x53')](_0x33c5eb)){logger[_0x0bd5('0x5f')](_0x0bd5('0x61')+_0x33c5eb+_0x0bd5('0x62'));fs['unlinkSync'](_0x33c5eb);}return _0x1e5e7d;})[_0x0bd5('0x23')](function(_0x32eaaf){if(!_0x32eaaf)throw new InternalError();return _0x32eaaf['destroy']();})[_0x0bd5('0x23')](function(){_0x45ccf5['status'](0xcc)[_0x0bd5('0x19')]();})[_0x0bd5('0x44')](handleError(_0x45ccf5,null));};
\ No newline at end of file
+var _0xb458=['differenceBy','format','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','filter','options','ScreenRecording','includeAll','rows','catch','show','params','include','create','body','createdAt','closedAt','find','describe','download','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x1065b3,_0x24da8b){var _0x555ca7=function(_0x36ab97){while(--_0x36ab97){_0x1065b3['push'](_0x1065b3['shift']());}};_0x555ca7(++_0x24da8b);}(_0xb458,0x103));var _0x8b45=function(_0x281ba7,_0x30e002){_0x281ba7=_0x281ba7-0x0;var _0x2501ce=_0xb458[_0x281ba7];return _0x2501ce;};'use strict';var emlformat=require(_0x8b45('0x0'));var rimraf=require(_0x8b45('0x1'));var zipdir=require(_0x8b45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8b45('0x3'));var BPromise=require(_0x8b45('0x4'));var Mustache=require(_0x8b45('0x5'));var util=require(_0x8b45('0x6'));var path=require('path');var sox=require(_0x8b45('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b45('0x8'));var _=require(_0x8b45('0x9'));var squel=require(_0x8b45('0xa'));var crypto=require(_0x8b45('0xb'));var jsforce=require(_0x8b45('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8b45('0xd'));var querystring=require(_0x8b45('0xe'));var Papa=require(_0x8b45('0xf'));var Redis=require(_0x8b45('0x10'));var authService=require(_0x8b45('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8b45('0x12'));var hardwareService=require(_0x8b45('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8b45('0x14'));var db=require(_0x8b45('0x15'))['db'];function respondWithStatusCode(_0x37c220,_0x52c4db){_0x52c4db=_0x52c4db||0xcc;return function(_0x30d38c){if(_0x30d38c){return _0x37c220[_0x8b45('0x16')](_0x52c4db);}return _0x37c220[_0x8b45('0x17')](_0x52c4db)[_0x8b45('0x18')]();};}function respondWithResult(_0x32babc,_0x2ad2ae){_0x2ad2ae=_0x2ad2ae||0xc8;return function(_0x5f0b20){if(_0x5f0b20){return _0x32babc['status'](_0x2ad2ae)[_0x8b45('0x19')](_0x5f0b20);}};}function respondWithFilteredResult(_0x23f1dd,_0x445170){return function(_0x39c1d1){if(_0x39c1d1){var _0x4781d7=typeof _0x445170[_0x8b45('0x1a')]===_0x8b45('0x1b')&&typeof _0x445170[_0x8b45('0x1c')]===_0x8b45('0x1b');var _0x391d1e=_0x39c1d1[_0x8b45('0x1d')];var _0x21d5b2=_0x4781d7?0x0:_0x445170[_0x8b45('0x1a')];var _0x43ffb7=_0x4781d7?_0x39c1d1[_0x8b45('0x1d')]:_0x445170[_0x8b45('0x1a')]+_0x445170[_0x8b45('0x1c')];var _0x309e23;if(_0x43ffb7>=_0x391d1e){_0x43ffb7=_0x391d1e;_0x309e23=0xc8;}else{_0x309e23=0xce;}_0x23f1dd['status'](_0x309e23);return _0x23f1dd[_0x8b45('0x1e')](_0x8b45('0x1f'),_0x21d5b2+'-'+_0x43ffb7+'/'+_0x391d1e)[_0x8b45('0x19')](_0x39c1d1);}return null;};}function patchUpdates(_0x46e21a){return function(_0x3e1438){try{jsonpatch[_0x8b45('0x20')](_0x3e1438,_0x46e21a,!![]);}catch(_0x2f4f1c){return BPromise[_0x8b45('0x21')](_0x2f4f1c);}return _0x3e1438['save']();};}function saveUpdates(_0x52f93f,_0x41154a){return function(_0x580e17){if(_0x580e17){return _0x580e17[_0x8b45('0x22')](_0x52f93f)[_0x8b45('0x23')](function(_0x30f405){return _0x30f405;});}return null;};}function removeEntity(_0x45e2db,_0x165570){return function(_0x2b8526){if(_0x2b8526){return _0x2b8526[_0x8b45('0x24')]()['then'](function(){_0x45e2db['status'](0xcc)[_0x8b45('0x18')]();});}};}function handleEntityNotFound(_0x2c2c06,_0x500044){return function(_0x5723a2){if(!_0x5723a2){_0x2c2c06[_0x8b45('0x16')](0x194);}return _0x5723a2;};}function handleError(_0x32f6f0,_0x2ca2d9){_0x2ca2d9=_0x2ca2d9||0x1f4;return function(_0x2f37bc){logger['error'](_0x2f37bc[_0x8b45('0x25')]);if(_0x2f37bc[_0x8b45('0x26')]){delete _0x2f37bc[_0x8b45('0x26')];}_0x32f6f0[_0x8b45('0x17')](_0x2ca2d9)[_0x8b45('0x27')](_0x2f37bc);};}exports[_0x8b45('0x28')]=function(_0x461017,_0x234f62){var _0x1733a7={},_0xf21bd1={},_0x339c73={'count':0x0,'rows':[]};var _0x1ba2d4=_[_0x8b45('0x29')](db['ScreenRecording'][_0x8b45('0x2a')],function(_0x36db96){return{'name':_0x36db96[_0x8b45('0x2b')],'type':_0x36db96[_0x8b45('0x2c')][_0x8b45('0x2d')]};});_0xf21bd1[_0x8b45('0x2e')]=_[_0x8b45('0x2f')](_[_0x8b45('0x29')](_0x1ba2d4,'name'),[_0x8b45('0x30')]);_0xf21bd1[_0x8b45('0x31')]=_[_0x8b45('0x32')](_0x461017[_0x8b45('0x31')]);_0xf21bd1[_0x8b45('0x33')]=_['intersection'](_0xf21bd1[_0x8b45('0x2e')],_0xf21bd1['query']);_0x1733a7['attributes']=_[_0x8b45('0x34')](_0xf21bd1[_0x8b45('0x2e')],qs[_0x8b45('0x35')](_0x461017[_0x8b45('0x31')][_0x8b45('0x35')]));_0x1733a7[_0x8b45('0x36')]=_0x1733a7['attributes'][_0x8b45('0x37')]?_0x1733a7[_0x8b45('0x36')]:_0xf21bd1[_0x8b45('0x2e')];if(!_0x461017[_0x8b45('0x31')]['hasOwnProperty'](_0x8b45('0x38'))){_0x1733a7[_0x8b45('0x1c')]=qs[_0x8b45('0x1c')](_0x461017['query'][_0x8b45('0x1c')]);_0x1733a7[_0x8b45('0x1a')]=qs[_0x8b45('0x1a')](_0x461017['query'][_0x8b45('0x1a')]);}_0x1733a7[_0x8b45('0x39')]=qs[_0x8b45('0x3a')](_0x461017[_0x8b45('0x31')]['sort']);_0x1733a7[_0x8b45('0x3b')]=qs[_0x8b45('0x33')](_[_0x8b45('0x3c')](_0x461017[_0x8b45('0x31')],_0xf21bd1[_0x8b45('0x33')]),_0x1ba2d4);if(_0x461017[_0x8b45('0x31')]['filter']){_0x1733a7['where']=_[_0x8b45('0x3d')](_0x1733a7[_0x8b45('0x3b')],{'$or':_[_0x8b45('0x29')](_0x1ba2d4,function(_0x12d4b2){if(_0x12d4b2[_0x8b45('0x2c')]!=='VIRTUAL'){var _0x120068={};_0x120068[_0x12d4b2['name']]={'$like':'%'+_0x461017[_0x8b45('0x31')][_0x8b45('0x3e')]+'%'};return _0x120068;}})});}_0x1733a7=_[_0x8b45('0x3d')]({},_0x1733a7,_0x461017[_0x8b45('0x3f')]);var _0x254f17={'where':_0x1733a7[_0x8b45('0x3b')]};return db[_0x8b45('0x40')][_0x8b45('0x1d')](_0x254f17)[_0x8b45('0x23')](function(_0x2ca00e){_0x339c73[_0x8b45('0x1d')]=_0x2ca00e;if(_0x461017['query'][_0x8b45('0x41')]){_0x1733a7['include']=[{'all':!![]}];}return db[_0x8b45('0x40')]['findAll'](_0x1733a7);})[_0x8b45('0x23')](function(_0x224c45){_0x339c73[_0x8b45('0x42')]=_0x224c45;return _0x339c73;})[_0x8b45('0x23')](respondWithFilteredResult(_0x234f62,_0x1733a7))[_0x8b45('0x43')](handleError(_0x234f62,null));};exports[_0x8b45('0x44')]=function(_0x58e663,_0x6fbca4){var _0x5916c7={'raw':![],'where':{'id':_0x58e663[_0x8b45('0x45')]['id']}},_0x4c56c8={};_0x4c56c8[_0x8b45('0x2e')]=_[_0x8b45('0x32')](db['ScreenRecording'][_0x8b45('0x2a')]);_0x4c56c8['query']=_[_0x8b45('0x32')](_0x58e663[_0x8b45('0x31')]);_0x4c56c8[_0x8b45('0x33')]=_[_0x8b45('0x34')](_0x4c56c8[_0x8b45('0x2e')],_0x4c56c8[_0x8b45('0x31')]);_0x5916c7['attributes']=_[_0x8b45('0x34')](_0x4c56c8[_0x8b45('0x2e')],qs[_0x8b45('0x35')](_0x58e663[_0x8b45('0x31')][_0x8b45('0x35')]));_0x5916c7[_0x8b45('0x36')]=_0x5916c7[_0x8b45('0x36')][_0x8b45('0x37')]?_0x5916c7[_0x8b45('0x36')]:_0x4c56c8[_0x8b45('0x2e')];if(_0x58e663[_0x8b45('0x31')][_0x8b45('0x41')]){_0x5916c7[_0x8b45('0x46')]=[{'all':!![]}];}_0x5916c7=_[_0x8b45('0x3d')]({},_0x5916c7,_0x58e663[_0x8b45('0x3f')]);return db[_0x8b45('0x40')]['find'](_0x5916c7)['then'](handleEntityNotFound(_0x6fbca4,null))['then'](respondWithResult(_0x6fbca4,null))[_0x8b45('0x43')](handleError(_0x6fbca4,null));};exports[_0x8b45('0x47')]=function(_0x3a1621,_0x473530){return db[_0x8b45('0x40')][_0x8b45('0x47')](_0x3a1621[_0x8b45('0x48')],{})[_0x8b45('0x23')](respondWithResult(_0x473530,0xc9))['catch'](handleError(_0x473530,null));};exports[_0x8b45('0x22')]=function(_0x5d5be2,_0x23b5c6){if(_0x5d5be2[_0x8b45('0x48')]['id']){delete _0x5d5be2[_0x8b45('0x48')]['id'];}delete _0x5d5be2[_0x8b45('0x48')]['duration'];delete _0x5d5be2[_0x8b45('0x48')][_0x8b45('0x49')];delete _0x5d5be2['body'][_0x8b45('0x4a')];delete _0x5d5be2[_0x8b45('0x48')]['value'];return db[_0x8b45('0x40')][_0x8b45('0x4b')]({'where':{'id':_0x5d5be2[_0x8b45('0x45')]['id']}})[_0x8b45('0x23')](handleEntityNotFound(_0x23b5c6,null))[_0x8b45('0x23')](saveUpdates(_0x5d5be2[_0x8b45('0x48')],null))['then'](respondWithResult(_0x23b5c6,null))['catch'](handleError(_0x23b5c6,null));};exports[_0x8b45('0x4c')]=function(_0x2a2e59,_0x2d5b31){return db['ScreenRecording'][_0x8b45('0x4c')]()[_0x8b45('0x23')](respondWithResult(_0x2d5b31,null))[_0x8b45('0x43')](handleError(_0x2d5b31,null));};exports[_0x8b45('0x4d')]=function(_0x2d6b66,_0x597402,_0x34c05d){var _0xa92a05=require('../../components/encryptor');var _0x422da0=![];var _0x4c3f38={};if(_0x2d6b66[_0x8b45('0x31')][_0x8b45('0x2c')]&&_0x2d6b66[_0x8b45('0x31')][_0x8b45('0x2c')]==='uniqueid'){_0x4c3f38[_0x8b45('0x4e')]=_0x2d6b66[_0x8b45('0x45')]['id'];}else{_0x4c3f38['id']=_0x2d6b66[_0x8b45('0x45')]['id'];}return db[_0x8b45('0x40')][_0x8b45('0x4b')]({'where':_0x4c3f38,'attributes':['id',_0x8b45('0x4f')],'raw':!![]})[_0x8b45('0x23')](handleEntityNotFound(_0x597402,null))[_0x8b45('0x23')](function(_0x446fe5){if(_0x446fe5){var _0x5ba878=path[_0x8b45('0x50')](config[_0x8b45('0x51')],_0x8b45('0x52'),_0x446fe5[_0x8b45('0x4f')]);var _0x1851c2=util['format'](_0x8b45('0x53'),_0x5ba878);if(fs[_0x8b45('0x54')](_0x1851c2)){_0x422da0=!![];return _0xa92a05[_0x8b45('0x55')](_0x1851c2,_0x5ba878,config['secrets'][_0x8b45('0x56')])[_0x8b45('0x23')](function(){return _0x446fe5;});}return _0x446fe5;}})[_0x8b45('0x23')](function(_0x9eacc1){if(_0x9eacc1){var _0x5795ca=path[_0x8b45('0x50')](config[_0x8b45('0x51')],_0x8b45('0x52'),_0x9eacc1[_0x8b45('0x4f')]);if(!fs['existsSync'](_0x5795ca)){throw new db[(_0x8b45('0x57'))][(_0x8b45('0x58'))](_0x8b45('0x59'));}if(_0x9eacc1[_0x8b45('0x5a')]){return _0x597402[_0x8b45('0x4d')](_0x5795ca,_0x9eacc1['filename']+path[_0x8b45('0x5b')](_0x5795ca),function(){if(_0x422da0){fs['unlink'](_0x5795ca);}});}else{return _0x597402[_0x8b45('0x4d')](_0x5795ca,function(_0x2f7ab0){if(_0x422da0){fs[_0x8b45('0x5c')](_0x5795ca);}});}}})[_0x8b45('0x43')](function(_0x6a77bd){if(_0x6a77bd[_0x8b45('0x5d')]==='ScreenRecording\x20not\x20found'){_0x597402['status'](0x194)[_0x8b45('0x27')](_0x8b45('0x5e'));}else{return handleError(_0x597402,null);}});};exports['destroy']=function(_0x461c83,_0x239330){return db[_0x8b45('0x40')]['find']({'where':{'id':_0x461c83['params']['id']}})[_0x8b45('0x23')](function(_0x8e5a41){if(_['isNil'](_0x8e5a41)){throw new ReferenceError(_0x8b45('0x5f'));}return _0x8e5a41;})['then'](function(_0xf1ab37){var _0x560c51=path['join'](config[_0x8b45('0x51')],_0x8b45('0x52'),_0xf1ab37['value']);logger[_0x8b45('0x60')](_0x8b45('0x61'),_0x560c51);if(!_[_0x8b45('0x62')](_0xf1ab37[_0x8b45('0x4f')])&&fs[_0x8b45('0x54')](_0x560c51)){logger['info'](_0x8b45('0x63')+_0x560c51+_0x8b45('0x64'));fs[_0x8b45('0x65')](_0x560c51);}_0x560c51=_0x560c51+'.cypher';if(!_['isNil'](_0xf1ab37[_0x8b45('0x4f')])&&fs['existsSync'](_0x560c51)){logger[_0x8b45('0x60')]('File:\x20\x22'+_0x560c51+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x560c51);}return _0xf1ab37;})[_0x8b45('0x23')](function(_0x4df581){if(!_0x4df581)throw new InternalError();return _0x4df581[_0x8b45('0x24')]();})[_0x8b45('0x23')](function(){_0x239330['status'](0xcc)[_0x8b45('0x18')]();})[_0x8b45('0x43')](handleError(_0x239330,null));};
\ No newline at end of file
index 8715af7..9b6c580 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48ee=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','interactionid','lodash'];(function(_0x2cf7dc,_0x54537a){var _0x4a5b5a=function(_0x54365e){while(--_0x54365e){_0x2cf7dc['push'](_0x2cf7dc['shift']());}};_0x4a5b5a(++_0x54537a);}(_0x48ee,0xdc));var _0xe48e=function(_0x16c4f5,_0x286629){_0x16c4f5=_0x16c4f5-0x0;var _0x3e3eb4=_0x48ee[_0x16c4f5];return _0x3e3eb4;};'use strict';var _=require(_0xe48e('0x0'));var util=require(_0xe48e('0x1'));var logger=require(_0xe48e('0x2'))('api');var moment=require(_0xe48e('0x3'));var BPromise=require(_0xe48e('0x4'));var rp=require(_0xe48e('0x5'));var fs=require('fs');var path=require(_0xe48e('0x6'));var rimraf=require(_0xe48e('0x7'));var config=require(_0xe48e('0x8'));var attributes=require(_0xe48e('0x9'));module[_0xe48e('0xa')]=function(_0x57fa8c,_0x41dfaf){return _0x57fa8c[_0xe48e('0xb')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xe48e('0xc'),'fields':[_0xe48e('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f43=['path','rimraf','../../config/environment','define','ScreenRecording','interactionid','api','moment','bluebird'];(function(_0x469fc4,_0x427a80){var _0x11f6d4=function(_0x1b7238){while(--_0x1b7238){_0x469fc4['push'](_0x469fc4['shift']());}};_0x11f6d4(++_0x427a80);}(_0x9f43,0x15c));var _0x39f4=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0x9f43[_0x4b1032];return _0x5a1d55;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x39f4('0x0'));var moment=require(_0x39f4('0x1'));var BPromise=require(_0x39f4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x39f4('0x3'));var rimraf=require(_0x39f4('0x4'));var config=require(_0x39f4('0x5'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x51598d,_0x14c18e){return _0x51598d[_0x39f4('0x6')](_0x39f4('0x7'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x39f4('0x8'),'fields':['interactionid']}],'timestamps':!![]});};
\ No newline at end of file
index 04275b5..cb7efeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0db5=['request\x20sent','debug','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1c14ae,_0x25ecce){var _0x24c7cf=function(_0x167c24){while(--_0x167c24){_0x1c14ae['push'](_0x1c14ae['shift']());}};_0x24c7cf(++_0x25ecce);}(_0x0db5,0x190));var _0x50db=function(_0x2b4963,_0x2aa9d1){_0x2b4963=_0x2b4963-0x0;var _0x23fdd6=_0x0db5[_0x2b4963];return _0x23fdd6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x50db('0x0'));var BPromise=require(_0x50db('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x50db('0x2'));var db=require(_0x50db('0x3'))['db'];var utils=require(_0x50db('0x4'));var logger=require(_0x50db('0x5'))(_0x50db('0x6'));var config=require(_0x50db('0x7'));var jayson=require(_0x50db('0x8'));var client=jayson[_0x50db('0x9')][_0x50db('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6a5703,_0x3dd19f,_0x5a55f2){return new BPromise(function(_0x5287a6,_0x256236){return client[_0x50db('0xb')](_0x6a5703,_0x5a55f2)[_0x50db('0xc')](function(_0x45c85d){logger[_0x50db('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x3dd19f,_0x50db('0xe'));logger[_0x50db('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x3dd19f,'request\x20sent',JSON[_0x50db('0x10')](_0x45c85d));if(_0x45c85d[_0x50db('0x11')]){if(_0x45c85d[_0x50db('0x11')][_0x50db('0x12')]===0x1f4){logger[_0x50db('0x11')](_0x50db('0x13'),_0x3dd19f,_0x45c85d[_0x50db('0x11')][_0x50db('0x14')]);return _0x256236(_0x45c85d['error'][_0x50db('0x14')]);}logger[_0x50db('0x11')](_0x50db('0x13'),_0x3dd19f,_0x45c85d[_0x50db('0x11')]['message']);return _0x5287a6(_0x45c85d[_0x50db('0x11')]['message']);}else{logger['info'](_0x50db('0x13'),_0x3dd19f,_0x50db('0xe'));_0x5287a6(_0x45c85d[_0x50db('0x15')]['message']);}})[_0x50db('0x16')](function(_0x1b078b){logger[_0x50db('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x3dd19f,_0x1b078b);_0x256236(_0x1b078b);});});}
\ No newline at end of file
+var _0x4660=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4660,0x16b));var _0x0466=function(_0x1f9c54,_0x3b79dd){_0x1f9c54=_0x1f9c54-0x0;var _0x1150cf=_0x4660[_0x1f9c54];return _0x1150cf;};'use strict';var _=require(_0x0466('0x0'));var util=require(_0x0466('0x1'));var moment=require('moment');var BPromise=require(_0x0466('0x2'));var rs=require(_0x0466('0x3'));var fs=require('fs');var Redis=require(_0x0466('0x4'));var db=require(_0x0466('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0466('0x6'))(_0x0466('0x7'));var config=require(_0x0466('0x8'));var jayson=require(_0x0466('0x9'));var client=jayson[_0x0466('0xa')][_0x0466('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x100927,_0x38277c,_0x58f438){return new BPromise(function(_0x38f3cd,_0x215383){return client[_0x0466('0xc')](_0x100927,_0x58f438)['then'](function(_0x1f3111){logger[_0x0466('0xd')](_0x0466('0xe'),_0x38277c,'request\x20sent');logger[_0x0466('0xf')](_0x0466('0x10'),_0x38277c,_0x0466('0x11'),JSON[_0x0466('0x12')](_0x1f3111));if(_0x1f3111[_0x0466('0x13')]){if(_0x1f3111[_0x0466('0x13')][_0x0466('0x14')]===0x1f4){logger[_0x0466('0x13')](_0x0466('0xe'),_0x38277c,_0x1f3111[_0x0466('0x13')][_0x0466('0x15')]);return _0x215383(_0x1f3111[_0x0466('0x13')]['message']);}logger[_0x0466('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x38277c,_0x1f3111['error'][_0x0466('0x15')]);return _0x38f3cd(_0x1f3111[_0x0466('0x13')][_0x0466('0x15')]);}else{logger[_0x0466('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x38277c,_0x0466('0x11'));_0x38f3cd(_0x1f3111[_0x0466('0x16')]['message']);}})[_0x0466('0x17')](function(_0xf5aeb9){logger[_0x0466('0x13')](_0x0466('0xe'),_0x38277c,_0xf5aeb9);_0x215383(_0xf5aeb9);});});}
\ No newline at end of file
index f424f43..19bcb2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4ac=['../../components/interaction/service','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','getPreferred','getFavicon','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','addLogo','join','root','logologin','single','file','addLogoLogin','diskStorage','preferred','favicon','addFavicon','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x285800,_0x26765e){var _0x4b809e=function(_0x12c58b){while(--_0x12c58b){_0x285800['push'](_0x285800['shift']());}};_0x4b809e(++_0x26765e);}(_0xc4ac,0x12c));var _0xcc4a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4ac[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcc4a('0x0'));var util=require(_0xcc4a('0x1'));var path=require(_0xcc4a('0x2'));var timeout=require(_0xcc4a('0x3'));var express=require(_0xcc4a('0x4'));var router=express[_0xcc4a('0x5')]();var fs_extra=require(_0xcc4a('0x6'));var auth=require(_0xcc4a('0x7'));var interaction=require(_0xcc4a('0x8'));var config=require('../../config/environment');var controller=require(_0xcc4a('0x9'));router[_0xcc4a('0xa')]('/',auth[_0xcc4a('0xb')](),controller[_0xcc4a('0xc')]);router['get'](_0xcc4a('0xd'),controller[_0xcc4a('0xe')]);router[_0xcc4a('0xa')](_0xcc4a('0xf'),controller[_0xcc4a('0x10')]);router[_0xcc4a('0xa')](_0xcc4a('0x11'),controller[_0xcc4a('0x12')]);router[_0xcc4a('0xa')](_0xcc4a('0x13'),controller['getLogoLogin']);router[_0xcc4a('0xa')](_0xcc4a('0x14'),controller[_0xcc4a('0x15')]);router['get']('/:id/preferred',controller[_0xcc4a('0x16')]);router['get']('/:id/favicon',controller[_0xcc4a('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2b9d10,_0x449994,_0x1f54c0){_0x1f54c0(null,path['join'](config['root'],_0xcc4a('0x18')));},'filename':function(_0x32dbaa,_0x417863,_0x48d622){_0x48d622(null,util[_0xcc4a('0x19')](_0xcc4a('0x1a'),_0xcc4a('0x1b'),path[_0xcc4a('0x1c')](_0x417863[_0xcc4a('0x1d')])));}})});router[_0xcc4a('0x1e')]('/:id/logo',upload['single']('file'),controller[_0xcc4a('0x1f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5ccc1c,_0x2b5864,_0x448250){_0x448250(null,path[_0xcc4a('0x20')](config[_0xcc4a('0x21')],_0xcc4a('0x18')));},'filename':function(_0x3f8492,_0x3d0b1b,_0x1dc399){_0x1dc399(null,util[_0xcc4a('0x19')](_0xcc4a('0x1a'),_0xcc4a('0x22'),path[_0xcc4a('0x1c')](_0x3d0b1b['originalname'])));}})});router[_0xcc4a('0x1e')]('/:id/logo_login',upload[_0xcc4a('0x23')](_0xcc4a('0x24')),controller[_0xcc4a('0x25')]);var upload=multer({'storage':multer[_0xcc4a('0x26')]({'destination':function(_0x31149c,_0x15d245,_0x497b13){_0x497b13(null,path['join'](config[_0xcc4a('0x21')],_0xcc4a('0x18')));},'filename':function(_0x5c6247,_0x1f2d41,_0x198b21){_0x198b21(null,util[_0xcc4a('0x19')](_0xcc4a('0x1a'),_0xcc4a('0x27'),path[_0xcc4a('0x1c')](_0x1f2d41['originalname'])));}})});router[_0xcc4a('0x1e')]('/:id/preferred',upload[_0xcc4a('0x23')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0xcc4a('0x26')]({'destination':function(_0x4c4665,_0x26acd4,_0x20e01b){_0x20e01b(null,path[_0xcc4a('0x20')](config['root'],_0xcc4a('0x18')));},'filename':function(_0x13195f,_0x3fea98,_0x3550f1){_0x3550f1(null,util['format'](_0xcc4a('0x1a'),_0xcc4a('0x28'),path[_0xcc4a('0x1c')](_0x3fea98[_0xcc4a('0x1d')])));}})});router[_0xcc4a('0x1e')]('/:id/favicon',upload[_0xcc4a('0x23')](_0xcc4a('0x24')),controller[_0xcc4a('0x29')]);router[_0xcc4a('0x2a')]('/:id',auth[_0xcc4a('0xb')](),controller['update']);module[_0xcc4a('0x2b')]=router;
\ No newline at end of file
+var _0x3120=['server/files/images/logos/','%s%s','logo','extname','post','single','file','addLogo','join','format','logologin','originalname','addLogoLogin','preferred','addPreferred','favicon','/:id/favicon','addFavicon','put','update','multer','Router','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getFavicon','diskStorage','root'];(function(_0x139f9b,_0x276afb){var _0x631841=function(_0x2620a9){while(--_0x2620a9){_0x139f9b['push'](_0x139f9b['shift']());}};_0x631841(++_0x276afb);}(_0x3120,0x92));var _0x0312=function(_0x33484c,_0x1c0a42){_0x33484c=_0x33484c-0x0;var _0x944d86=_0x3120[_0x33484c];return _0x944d86;};'use strict';var multer=require(_0x0312('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0312('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x0312('0x2'));var interaction=require(_0x0312('0x3'));var config=require('../../config/environment');var controller=require(_0x0312('0x4'));router[_0x0312('0x5')]('/',auth[_0x0312('0x6')](),controller[_0x0312('0x7')]);router[_0x0312('0x5')](_0x0312('0x8'),controller[_0x0312('0x9')]);router[_0x0312('0x5')](_0x0312('0xa'),controller[_0x0312('0xb')]);router[_0x0312('0x5')](_0x0312('0xc'),controller[_0x0312('0xd')]);router['get'](_0x0312('0xe'),controller[_0x0312('0xf')]);router[_0x0312('0x5')](_0x0312('0x10'),controller[_0x0312('0x11')]);router[_0x0312('0x5')](_0x0312('0x12'),controller['getPreferred']);router[_0x0312('0x5')]('/:id/favicon',controller[_0x0312('0x13')]);var upload=multer({'storage':multer[_0x0312('0x14')]({'destination':function(_0x14a08d,_0x56a6bc,_0x385702){_0x385702(null,path['join'](config[_0x0312('0x15')],_0x0312('0x16')));},'filename':function(_0x4abc1c,_0x10cf8c,_0x474536){_0x474536(null,util['format'](_0x0312('0x17'),_0x0312('0x18'),path[_0x0312('0x19')](_0x10cf8c['originalname'])));}})});router[_0x0312('0x1a')]('/:id/logo',upload[_0x0312('0x1b')](_0x0312('0x1c')),controller[_0x0312('0x1d')]);var upload=multer({'storage':multer[_0x0312('0x14')]({'destination':function(_0xa46298,_0xb8b1e6,_0x2ccf7d){_0x2ccf7d(null,path[_0x0312('0x1e')](config[_0x0312('0x15')],_0x0312('0x16')));},'filename':function(_0x3dea9e,_0x9688dc,_0x5e7466){_0x5e7466(null,util[_0x0312('0x1f')](_0x0312('0x17'),_0x0312('0x20'),path[_0x0312('0x19')](_0x9688dc[_0x0312('0x21')])));}})});router[_0x0312('0x1a')]('/:id/logo_login',upload['single'](_0x0312('0x1c')),controller[_0x0312('0x22')]);var upload=multer({'storage':multer[_0x0312('0x14')]({'destination':function(_0x2d26de,_0x1c600d,_0xb0023e){_0xb0023e(null,path[_0x0312('0x1e')](config[_0x0312('0x15')],'server/files/images/logos/'));},'filename':function(_0x14cdc6,_0x105395,_0x2744f4){_0x2744f4(null,util['format'](_0x0312('0x17'),_0x0312('0x23'),path[_0x0312('0x19')](_0x105395[_0x0312('0x21')])));}})});router['post'](_0x0312('0x12'),upload['single']('file'),controller[_0x0312('0x24')]);var upload=multer({'storage':multer[_0x0312('0x14')]({'destination':function(_0x27659b,_0x2abf75,_0x5d6c40){_0x5d6c40(null,path['join'](config[_0x0312('0x15')],_0x0312('0x16')));},'filename':function(_0x297ff2,_0x2cdebe,_0x362f5e){_0x362f5e(null,util[_0x0312('0x1f')](_0x0312('0x17'),_0x0312('0x25'),path[_0x0312('0x19')](_0x2cdebe['originalname'])));}})});router[_0x0312('0x1a')](_0x0312('0x26'),upload[_0x0312('0x1b')](_0x0312('0x1c')),controller[_0x0312('0x27')]);router[_0x0312('0x28')](_0x0312('0xa'),auth[_0x0312('0x6')](),controller[_0x0312('0x29')]);module['exports']=router;
\ No newline at end of file
index dacfb8f..b7d7596 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x4b5935,_0x5c7a29){var _0xdf56e9=function(_0x23ac4e){while(--_0x23ac4e){_0x4b5935['push'](_0x4b5935['shift']());}};_0xdf56e9(++_0x5c7a29);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}};
\ No newline at end of file
+var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x38a756,_0x72950){var _0x217a23=function(_0x249e61){while(--_0x249e61){_0x38a756['push'](_0x38a756['shift']());}};_0x217a23(++_0x72950);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}};
\ No newline at end of file
index 39d3fb3..b2a3e70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd50=['rows','params','length','body','addLogo','file','logo','filename','find','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','ValidationError','upperFirst','\x20not\x20found','favicon','defaultLogo','default_loginLogo.svg','download','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','now','utcOffset','format','send','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','index','map','Setting','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','include'];(function(_0x278679,_0x1eb219){var _0x4874aa=function(_0x2806b8){while(--_0x2806b8){_0x278679['push'](_0x278679['shift']());}};_0x4874aa(++_0x1eb219);}(_0xbd50,0x196));var _0x0bd5=function(_0x2caf55,_0xb80b11){_0x2caf55=_0x2caf55-0x0;var _0xfbaf=_0xbd50[_0x2caf55];return _0xfbaf;};'use strict';var emlformat=require(_0x0bd5('0x0'));var rimraf=require(_0x0bd5('0x1'));var zipdir=require(_0x0bd5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd5('0x3'));var moment=require(_0x0bd5('0x4'));var BPromise=require(_0x0bd5('0x5'));var Mustache=require(_0x0bd5('0x6'));var util=require(_0x0bd5('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0bd5('0x8'));var fs=require('fs');var fs_extra=require(_0x0bd5('0x9'));var _=require(_0x0bd5('0xa'));var squel=require(_0x0bd5('0xb'));var crypto=require(_0x0bd5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0bd5('0xd'));var querystring=require(_0x0bd5('0xe'));var Papa=require(_0x0bd5('0xf'));var Redis=require('ioredis');var authService=require(_0x0bd5('0x10'));var qs=require(_0x0bd5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bd5('0x12'));var logger=require(_0x0bd5('0x13'))('api');var utils=require(_0x0bd5('0x14'));var config=require(_0x0bd5('0x15'));var licenseUtil=require(_0x0bd5('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x0bd5('0x17'));var client=jayson[_0x0bd5('0x18')][_0x0bd5('0x19')]({'port':0x232a});function respondWithRpcPromise(_0xc5b4cd,_0xfa1eed,_0x557be0,_0x30765e){return new BPromise(function(_0x1e961d,_0x4f485b){var _0x78f9b8=_0x30765e||client;return _0x78f9b8[_0x0bd5('0x1a')](_0xc5b4cd,_0x557be0)['then'](function(_0x31349f){logger[_0x0bd5('0x1b')](_0x0bd5('0x1c'),_0xfa1eed,_0x0bd5('0x1d'));logger['debug'](_0x0bd5('0x1e'),_0xfa1eed,_0x0bd5('0x1d'),JSON[_0x0bd5('0x1f')](_0x31349f));if(_0x31349f[_0x0bd5('0x20')]){if(_0x31349f[_0x0bd5('0x20')][_0x0bd5('0x21')]===0x1f4){logger[_0x0bd5('0x20')](_0x0bd5('0x1c'),_0xfa1eed,_0x31349f[_0x0bd5('0x20')][_0x0bd5('0x22')]);return _0x4f485b(_0x31349f[_0x0bd5('0x20')][_0x0bd5('0x22')]);}logger[_0x0bd5('0x20')](_0x0bd5('0x1c'),_0xfa1eed,_0x31349f['error']['message']);return _0x1e961d(_0x31349f['error']['message']);}else{logger['info'](_0x0bd5('0x1c'),_0xfa1eed,_0x0bd5('0x1d'));_0x1e961d(_0x31349f[_0x0bd5('0x23')][_0x0bd5('0x22')]);}})[_0x0bd5('0x24')](function(_0x4c74c9){logger[_0x0bd5('0x20')](_0x0bd5('0x1c'),_0xfa1eed,_0x4c74c9);_0x4f485b(_0x4c74c9);});});}function respondWithStatusCode(_0x38c21d,_0x5a8139){_0x5a8139=_0x5a8139||0xcc;return function(_0x5b6dde){if(_0x5b6dde){return _0x38c21d['sendStatus'](_0x5a8139);}return _0x38c21d['status'](_0x5a8139)[_0x0bd5('0x25')]();};}function respondWithResult(_0x1eacd3,_0x184db3){_0x184db3=_0x184db3||0xc8;return function(_0x4fde84){if(_0x4fde84){return _0x1eacd3[_0x0bd5('0x26')](_0x184db3)['json'](_0x4fde84);}};}function respondWithFilteredResult(_0x456e87,_0x3ffb08){return function(_0x18cec3){if(_0x18cec3){var _0x2b6b53=typeof _0x3ffb08[_0x0bd5('0x27')]===_0x0bd5('0x28')&&typeof _0x3ffb08[_0x0bd5('0x29')]===_0x0bd5('0x28');var _0x41c244=_0x18cec3[_0x0bd5('0x2a')];var _0x15561b=_0x2b6b53?0x0:_0x3ffb08[_0x0bd5('0x27')];var _0x2e10ce=_0x2b6b53?_0x18cec3[_0x0bd5('0x2a')]:_0x3ffb08['offset']+_0x3ffb08[_0x0bd5('0x29')];var _0x19eb75;if(_0x2e10ce>=_0x41c244){_0x2e10ce=_0x41c244;_0x19eb75=0xc8;}else{_0x19eb75=0xce;}_0x456e87['status'](_0x19eb75);return _0x456e87[_0x0bd5('0x2b')](_0x0bd5('0x2c'),_0x15561b+'-'+_0x2e10ce+'/'+_0x41c244)['json'](_0x18cec3);}return null;};}function patchUpdates(_0x11f482){return function(_0x1b7cf4){try{jsonpatch[_0x0bd5('0x2d')](_0x1b7cf4,_0x11f482,!![]);}catch(_0x25a35b){return BPromise['reject'](_0x25a35b);}return _0x1b7cf4[_0x0bd5('0x2e')]();};}function saveUpdates(_0x366e8c,_0x622d46){return function(_0x24ef4a){if(_0x24ef4a){return _0x24ef4a[_0x0bd5('0x2f')](_0x366e8c)[_0x0bd5('0x30')](function(_0x58de46){return _0x58de46;});}return null;};}function removeEntity(_0x22fc9e,_0x589ea2){return function(_0x398362){if(_0x398362){return _0x398362[_0x0bd5('0x31')]()[_0x0bd5('0x30')](function(){_0x22fc9e[_0x0bd5('0x26')](0xcc)[_0x0bd5('0x25')]();});}};}function handleEntityNotFound(_0x1c7010,_0x15e380){return function(_0x24f7d5){if(!_0x24f7d5){_0x1c7010[_0x0bd5('0x32')](0x194);}return _0x24f7d5;};}function handleError(_0x8363d3,_0x1a735c){_0x1a735c=_0x1a735c||0x1f4;return function(_0x64d66d){logger[_0x0bd5('0x20')](_0x64d66d['stack']);if(_0x64d66d[_0x0bd5('0x33')]){delete _0x64d66d[_0x0bd5('0x33')];}_0x8363d3['status'](_0x1a735c)['send'](_0x64d66d);};}exports[_0x0bd5('0x34')]=function(_0xdf1ef5,_0x8a6edc){var _0x3155c5={},_0x1dd2e1={},_0x387e24={'count':0x0,'rows':[]};var _0x22c10c=_[_0x0bd5('0x35')](db[_0x0bd5('0x36')][_0x0bd5('0x37')],function(_0x311bbe){return{'name':_0x311bbe[_0x0bd5('0x38')],'type':_0x311bbe[_0x0bd5('0x39')]['key']};});_0x1dd2e1[_0x0bd5('0x3a')]=_['map'](_0x22c10c,_0x0bd5('0x33'));_0x1dd2e1[_0x0bd5('0x3b')]=_[_0x0bd5('0x3c')](_0xdf1ef5[_0x0bd5('0x3b')]);_0x1dd2e1[_0x0bd5('0x3d')]=_[_0x0bd5('0x3e')](_0x1dd2e1['model'],_0x1dd2e1[_0x0bd5('0x3b')]);_0x3155c5[_0x0bd5('0x3f')]=_[_0x0bd5('0x3e')](_0x1dd2e1[_0x0bd5('0x3a')],qs[_0x0bd5('0x40')](_0xdf1ef5[_0x0bd5('0x3b')][_0x0bd5('0x40')]));_0x3155c5[_0x0bd5('0x3f')]=_0x3155c5[_0x0bd5('0x3f')]['length']?_0x3155c5[_0x0bd5('0x3f')]:_0x1dd2e1['model'];if(!_0xdf1ef5[_0x0bd5('0x3b')][_0x0bd5('0x41')]('nolimit')){_0x3155c5[_0x0bd5('0x29')]=qs[_0x0bd5('0x29')](_0xdf1ef5[_0x0bd5('0x3b')][_0x0bd5('0x29')]);_0x3155c5[_0x0bd5('0x27')]=qs[_0x0bd5('0x27')](_0xdf1ef5[_0x0bd5('0x3b')]['offset']);}_0x3155c5['order']=qs[_0x0bd5('0x42')](_0xdf1ef5['query']['sort']);_0x3155c5[_0x0bd5('0x43')]=qs[_0x0bd5('0x3d')](_['pick'](_0xdf1ef5['query'],_0x1dd2e1['filters']),_0x22c10c);if(_0xdf1ef5[_0x0bd5('0x3b')]['filter']){_0x3155c5['where']=_[_0x0bd5('0x44')](_0x3155c5[_0x0bd5('0x43')],{'$or':_['map'](_0x22c10c,function(_0x5d5b9b){if(_0x5d5b9b[_0x0bd5('0x39')]!==_0x0bd5('0x45')){var _0x238fc7={};_0x238fc7[_0x5d5b9b[_0x0bd5('0x33')]]={'$like':'%'+_0xdf1ef5['query'][_0x0bd5('0x46')]+'%'};return _0x238fc7;}})});}_0x3155c5=_[_0x0bd5('0x44')]({},_0x3155c5,_0xdf1ef5[_0x0bd5('0x47')]);var _0x39956f={'where':_0x3155c5[_0x0bd5('0x43')]};return db[_0x0bd5('0x36')]['count'](_0x39956f)[_0x0bd5('0x30')](function(_0x4411ae){_0x387e24[_0x0bd5('0x2a')]=_0x4411ae;if(_0xdf1ef5['query'][_0x0bd5('0x48')]){_0x3155c5[_0x0bd5('0x49')]=[{'all':!![]}];}return db[_0x0bd5('0x36')]['findAll'](_0x3155c5);})[_0x0bd5('0x30')](function(_0x45240c){_0x387e24[_0x0bd5('0x4a')]=_0x45240c;return _0x387e24;})[_0x0bd5('0x30')](respondWithFilteredResult(_0x8a6edc,_0x3155c5))[_0x0bd5('0x24')](handleError(_0x8a6edc,null));};exports['show']=function(_0x205569,_0x166f7b){var _0x4d00c3={'raw':![],'where':{'id':_0x205569[_0x0bd5('0x4b')]['id']}},_0x2db9b0={};_0x2db9b0[_0x0bd5('0x3a')]=_[_0x0bd5('0x3c')](db[_0x0bd5('0x36')]['rawAttributes']);_0x2db9b0[_0x0bd5('0x3b')]=_[_0x0bd5('0x3c')](_0x205569['query']);_0x2db9b0[_0x0bd5('0x3d')]=_['intersection'](_0x2db9b0[_0x0bd5('0x3a')],_0x2db9b0[_0x0bd5('0x3b')]);_0x4d00c3[_0x0bd5('0x3f')]=_[_0x0bd5('0x3e')](_0x2db9b0['model'],qs[_0x0bd5('0x40')](_0x205569['query']['fields']));_0x4d00c3[_0x0bd5('0x3f')]=_0x4d00c3[_0x0bd5('0x3f')][_0x0bd5('0x4c')]?_0x4d00c3['attributes']:_0x2db9b0[_0x0bd5('0x3a')];if(_0x205569['query'][_0x0bd5('0x48')]){_0x4d00c3[_0x0bd5('0x49')]=[{'all':!![]}];}_0x4d00c3=_[_0x0bd5('0x44')]({},_0x4d00c3,_0x205569['options']);return db['Setting']['find'](_0x4d00c3)[_0x0bd5('0x30')](handleEntityNotFound(_0x166f7b,null))[_0x0bd5('0x30')](respondWithResult(_0x166f7b,null))[_0x0bd5('0x24')](handleError(_0x166f7b,null));};exports['update']=function(_0x2b174a,_0x22b73c){if(_0x2b174a['body']['id']){delete _0x2b174a[_0x0bd5('0x4d')]['id'];}return db['Setting']['find']({'where':{'id':_0x2b174a[_0x0bd5('0x4b')]['id']}})[_0x0bd5('0x30')](handleEntityNotFound(_0x22b73c,null))[_0x0bd5('0x30')](saveUpdates(_0x2b174a[_0x0bd5('0x4d')],null))['then'](respondWithResult(_0x22b73c,null))[_0x0bd5('0x24')](handleError(_0x22b73c,null));};exports[_0x0bd5('0x4e')]=function(_0x3df0a0,_0x5cf2f2,_0x504e46){if(_0x3df0a0[_0x0bd5('0x4f')]&&_0x3df0a0[_0x0bd5('0x4f')]['filename']){_0x3df0a0['body'][_0x0bd5('0x50')]=_0x3df0a0['file'][_0x0bd5('0x51')];}return db[_0x0bd5('0x36')][_0x0bd5('0x52')]({'where':{'id':_0x3df0a0['params']['id']}})[_0x0bd5('0x30')](handleEntityNotFound(_0x5cf2f2,null))[_0x0bd5('0x30')](saveUpdates(_0x3df0a0[_0x0bd5('0x4d')],null))[_0x0bd5('0x30')](respondWithResult(_0x5cf2f2,null))['catch'](handleError(_0x5cf2f2,null));};exports[_0x0bd5('0x53')]=function(_0x401a84,_0x5d02cb,_0x183880){if(_0x401a84[_0x0bd5('0x4f')]&&_0x401a84['file'][_0x0bd5('0x51')]){_0x401a84['body'][_0x0bd5('0x54')]=_0x401a84['file']['filename'];}return db[_0x0bd5('0x36')]['find']({'where':{'id':_0x401a84[_0x0bd5('0x4b')]['id']}})[_0x0bd5('0x30')](handleEntityNotFound(_0x5d02cb,null))[_0x0bd5('0x30')](saveUpdates(_0x401a84['body'],null))[_0x0bd5('0x30')](respondWithResult(_0x5d02cb,null))[_0x0bd5('0x24')](handleError(_0x5d02cb,null));};var utilLicense=require('../../config/license/util');exports[_0x0bd5('0x55')]=function(_0x134504,_0x5eeb83,_0x460ebb){var _0x5a38b1=_0x0bd5('0x56');var _0x15ef8e={'custom':![]};return utilLicense[_0x0bd5('0x57')]()[_0x0bd5('0x30')](function(_0x1cb1b6){if(_0x1cb1b6){_0x15ef8e=_0x1cb1b6;}return db[_0x0bd5('0x36')][_0x0bd5('0x52')]({'where':{'id':_0x134504['params']['id']},'attributes':[_0x0bd5('0x50'),_0x0bd5('0x54'),_0x0bd5('0x58'),'favicon','defaultLogo',_0x0bd5('0x59'),_0x0bd5('0x5a'),_0x0bd5('0x5b')],'raw':!![]});})[_0x0bd5('0x30')](handleEntityNotFound(_0x5eeb83,null))[_0x0bd5('0x30')](function(_0x43b330){if(_0x43b330){var _0x1db7f2=_0x43b330[_0x0bd5('0x50')]&&fs[_0x0bd5('0x5c')](path[_0x0bd5('0x5d')](config[_0x0bd5('0x5e')],_0x5a38b1,_[_0x0bd5('0x5f')](_0x43b330[_0x0bd5('0x50')])))?path[_0x0bd5('0x5d')](config[_0x0bd5('0x5e')],_0x5a38b1,_[_0x0bd5('0x5f')](_0x43b330[_0x0bd5('0x50')])):path[_0x0bd5('0x5d')](config['root'],_0x5a38b1,_[_0x0bd5('0x5f')](_0x0bd5('0x60')));var _0x5cd0ad=_0x0bd5('0x61')+_['upperFirst'](_0x0bd5('0x50'));if(_0x43b330[_0x5cd0ad]||!_0x15ef8e[_0x0bd5('0x62')]){_0x1db7f2=path['join'](config[_0x0bd5('0x5e')],_0x5a38b1,_[_0x0bd5('0x5f')](_0x0bd5('0x60')));}if(!fs[_0x0bd5('0x5c')](_0x1db7f2)){throw new db[(_0x0bd5('0x63'))][(_0x0bd5('0x64'))](_[_0x0bd5('0x65')](_0x0bd5('0x50'))+_0x0bd5('0x66'));}return _0x5eeb83['download'](_0x1db7f2);}})[_0x0bd5('0x24')](handleError(_0x5eeb83,null));};var utilLicense=require(_0x0bd5('0x16'));exports['getLogoLogin']=function(_0x37d210,_0x73b493,_0x5f2b7f){var _0x215491=_0x0bd5('0x56');var _0x4ef0f7={'custom':![]};return utilLicense[_0x0bd5('0x57')]()['then'](function(_0x4a4589){if(_0x4a4589){_0x4ef0f7=_0x4a4589;}return db[_0x0bd5('0x36')][_0x0bd5('0x52')]({'where':{'id':_0x37d210[_0x0bd5('0x4b')]['id']},'attributes':[_0x0bd5('0x50'),_0x0bd5('0x54'),_0x0bd5('0x58'),_0x0bd5('0x67'),_0x0bd5('0x68'),_0x0bd5('0x59'),_0x0bd5('0x5a'),_0x0bd5('0x5b')],'raw':!![]});})[_0x0bd5('0x30')](handleEntityNotFound(_0x73b493,null))[_0x0bd5('0x30')](function(_0x580a90){if(_0x580a90){var _0x2707f7=_0x580a90[_0x0bd5('0x54')]&&fs[_0x0bd5('0x5c')](path[_0x0bd5('0x5d')](config[_0x0bd5('0x5e')],_0x215491,_[_0x0bd5('0x5f')](_0x580a90['loginLogo'])))?path[_0x0bd5('0x5d')](config[_0x0bd5('0x5e')],_0x215491,_[_0x0bd5('0x5f')](_0x580a90[_0x0bd5('0x54')])):path[_0x0bd5('0x5d')](config[_0x0bd5('0x5e')],_0x215491,_[_0x0bd5('0x5f')]('default_loginLogo.svg'));var _0x500622='default'+_[_0x0bd5('0x65')](_0x0bd5('0x54'));if(_0x580a90[_0x500622]||!_0x4ef0f7[_0x0bd5('0x62')]){_0x2707f7=path[_0x0bd5('0x5d')](config[_0x0bd5('0x5e')],_0x215491,_['toLower'](_0x0bd5('0x69')));}if(!fs[_0x0bd5('0x5c')](_0x2707f7)){throw new db['Sequelize'][(_0x0bd5('0x64'))](_[_0x0bd5('0x65')](_0x0bd5('0x54'))+_0x0bd5('0x66'));}return _0x73b493[_0x0bd5('0x6a')](_0x2707f7);}})[_0x0bd5('0x24')](handleError(_0x73b493,null));};exports[_0x0bd5('0x6b')]=function(_0x2d5a19,_0x194825){return db[_0x0bd5('0x36')][_0x0bd5('0x52')]({'where':{'id':_0x2d5a19['params']['id']},'attributes':[_0x0bd5('0x6c')]})[_0x0bd5('0x30')](respondWithResult(_0x194825,null))[_0x0bd5('0x24')](handleError(_0x194825,null));};exports[_0x0bd5('0x6d')]=function(_0x29c164,_0x5e434b,_0x40f1a1){if(_0x29c164[_0x0bd5('0x4f')]&&_0x29c164[_0x0bd5('0x4f')][_0x0bd5('0x51')]){_0x29c164[_0x0bd5('0x4d')][_0x0bd5('0x58')]=_0x29c164[_0x0bd5('0x4f')][_0x0bd5('0x51')];}return db[_0x0bd5('0x36')][_0x0bd5('0x52')]({'where':{'id':_0x29c164[_0x0bd5('0x4b')]['id']}})[_0x0bd5('0x30')](handleEntityNotFound(_0x5e434b,null))[_0x0bd5('0x30')](saveUpdates(_0x29c164[_0x0bd5('0x4d')],null))[_0x0bd5('0x30')](respondWithResult(_0x5e434b,null))[_0x0bd5('0x24')](handleError(_0x5e434b,null));};var utilLicense=require(_0x0bd5('0x16'));exports[_0x0bd5('0x6e')]=function(_0x6afdff,_0x5426c6,_0x4e01dd){var _0x4531f7=_0x0bd5('0x56');var _0xcfbe2={'custom':![]};return utilLicense[_0x0bd5('0x57')]()[_0x0bd5('0x30')](function(_0x4f57fe){if(_0x4f57fe){_0xcfbe2=_0x4f57fe;}return db[_0x0bd5('0x36')][_0x0bd5('0x52')]({'where':{'id':_0x6afdff[_0x0bd5('0x4b')]['id']},'attributes':[_0x0bd5('0x50'),_0x0bd5('0x54'),'preferred',_0x0bd5('0x67'),_0x0bd5('0x68'),_0x0bd5('0x59'),_0x0bd5('0x5a'),_0x0bd5('0x5b')],'raw':!![]});})[_0x0bd5('0x30')](handleEntityNotFound(_0x5426c6,null))[_0x0bd5('0x30')](function(_0x23f5d0){if(_0x23f5d0){var _0x179614=_0x23f5d0[_0x0bd5('0x58')]&&fs[_0x0bd5('0x5c')](path['join'](config[_0x0bd5('0x5e')],_0x4531f7,_[_0x0bd5('0x5f')](_0x23f5d0[_0x0bd5('0x58')])))?path[_0x0bd5('0x5d')](config[_0x0bd5('0x5e')],_0x4531f7,_[_0x0bd5('0x5f')](_0x23f5d0[_0x0bd5('0x58')])):path[_0x0bd5('0x5d')](config['root'],_0x4531f7,_[_0x0bd5('0x5f')](_0x0bd5('0x6f')));var _0x126ef4=_0x0bd5('0x61')+_[_0x0bd5('0x65')](_0x0bd5('0x58'));if(_0x23f5d0[_0x126ef4]||!_0xcfbe2[_0x0bd5('0x62')]||!_0xcfbe2[_0x0bd5('0x58')]){_0x179614=path[_0x0bd5('0x5d')](config[_0x0bd5('0x5e')],_0x4531f7,_[_0x0bd5('0x5f')](_0x0bd5('0x6f')));}if(!fs[_0x0bd5('0x5c')](_0x179614)){throw new db[(_0x0bd5('0x63'))][(_0x0bd5('0x64'))](_[_0x0bd5('0x65')]('preferred')+_0x0bd5('0x66'));}return _0x5426c6[_0x0bd5('0x6a')](_0x179614);}})[_0x0bd5('0x24')](handleError(_0x5426c6,null));};exports[_0x0bd5('0x70')]=function(_0x323f48,_0x2cd599,_0x311a2e){if(_0x323f48[_0x0bd5('0x4f')]&&_0x323f48[_0x0bd5('0x4f')]['filename']){_0x323f48[_0x0bd5('0x4d')][_0x0bd5('0x67')]=_0x323f48[_0x0bd5('0x4f')]['filename'];}return db[_0x0bd5('0x36')][_0x0bd5('0x52')]({'where':{'id':_0x323f48[_0x0bd5('0x4b')]['id']}})[_0x0bd5('0x30')](handleEntityNotFound(_0x2cd599,null))[_0x0bd5('0x30')](saveUpdates(_0x323f48[_0x0bd5('0x4d')],null))['then'](respondWithResult(_0x2cd599,null))[_0x0bd5('0x24')](handleError(_0x2cd599,null));};var utilLicense=require('../../config/license/util');exports[_0x0bd5('0x71')]=function(_0x527113,_0x5a6202,_0x236981){var _0x1691ca=_0x0bd5('0x56');var _0x1e0a98={'custom':![]};return utilLicense['getLicense']()[_0x0bd5('0x30')](function(_0x342f99){if(_0x342f99){_0x1e0a98=_0x342f99;}return db['Setting'][_0x0bd5('0x52')]({'where':{'id':_0x527113[_0x0bd5('0x4b')]['id']},'attributes':[_0x0bd5('0x50'),_0x0bd5('0x54'),_0x0bd5('0x58'),_0x0bd5('0x67'),_0x0bd5('0x68'),_0x0bd5('0x59'),_0x0bd5('0x5a'),_0x0bd5('0x5b')],'raw':!![]});})[_0x0bd5('0x30')](handleEntityNotFound(_0x5a6202,null))[_0x0bd5('0x30')](function(_0xaea5ef){if(_0xaea5ef){var _0x12d08f=_0xaea5ef[_0x0bd5('0x67')]&&fs[_0x0bd5('0x5c')](path[_0x0bd5('0x5d')](config[_0x0bd5('0x5e')],_0x1691ca,_[_0x0bd5('0x5f')](_0xaea5ef[_0x0bd5('0x67')])))?path[_0x0bd5('0x5d')](config[_0x0bd5('0x5e')],_0x1691ca,_[_0x0bd5('0x5f')](_0xaea5ef[_0x0bd5('0x67')])):path[_0x0bd5('0x5d')](config[_0x0bd5('0x5e')],_0x1691ca,_['toLower'](_0x0bd5('0x72')));var _0x4b65f6=_0x0bd5('0x61')+_[_0x0bd5('0x65')](_0x0bd5('0x67'));if(_0xaea5ef[_0x4b65f6]||!_0x1e0a98[_0x0bd5('0x62')]){_0x12d08f=path[_0x0bd5('0x5d')](config[_0x0bd5('0x5e')],_0x1691ca,_[_0x0bd5('0x5f')](_0x0bd5('0x72')));}if(!fs[_0x0bd5('0x5c')](_0x12d08f)){throw new db['Sequelize']['ValidationError'](_[_0x0bd5('0x65')](_0x0bd5('0x67'))+'\x20not\x20found');}return _0x5a6202[_0x0bd5('0x6a')](_0x12d08f);}})['catch'](handleError(_0x5a6202,null));};exports[_0x0bd5('0x73')]=function(_0x1e754a,_0x240ed8){var _0x40a5d0={'offset':moment()['utcOffset']()};_0x40a5d0[_0x0bd5('0x74')]=moment()[_0x0bd5('0x75')](_0x40a5d0[_0x0bd5('0x27')])[_0x0bd5('0x76')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x240ed8[_0x0bd5('0x26')](0xc8)[_0x0bd5('0x77')](_0x40a5d0);};
\ No newline at end of file
+var _0x81ea=['now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','update','destroy','stack','name','send','index','map','Setting','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','params','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultPreferred','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','custom','Sequelize','\x20not\x20found','download','getLogoLogin','defaultLogo','defaultLoginLogo','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','ValidationError','getFavicon','default_favicon.ico','getDate','utcOffset'];(function(_0x3c4998,_0x41ed83){var _0x52de89=function(_0x227952){while(--_0x227952){_0x3c4998['push'](_0x3c4998['shift']());}};_0x52de89(++_0x41ed83);}(_0x81ea,0x1e7));var _0xa81e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x81ea[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xa81e('0x0'));var rimraf=require(_0xa81e('0x1'));var zipdir=require(_0xa81e('0x2'));var jsonpatch=require(_0xa81e('0x3'));var rp=require(_0xa81e('0x4'));var moment=require(_0xa81e('0x5'));var BPromise=require(_0xa81e('0x6'));var Mustache=require('mustache');var util=require(_0xa81e('0x7'));var path=require('path');var sox=require(_0xa81e('0x8'));var csv=require(_0xa81e('0x9'));var ejs=require(_0xa81e('0xa'));var fs=require('fs');var fs_extra=require(_0xa81e('0xb'));var _=require('lodash');var squel=require(_0xa81e('0xc'));var crypto=require(_0xa81e('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa81e('0x9'));var querystring=require(_0xa81e('0xe'));var Papa=require(_0xa81e('0xf'));var Redis=require(_0xa81e('0x10'));var authService=require(_0xa81e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa81e('0x12'));var hardwareService=require(_0xa81e('0x13'));var logger=require('../../config/logger')(_0xa81e('0x14'));var utils=require(_0xa81e('0x15'));var config=require(_0xa81e('0x16'));var licenseUtil=require(_0xa81e('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa81e('0x18'));var client=jayson[_0xa81e('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e8a8c,_0x1b6fb1,_0x504fc6,_0x5ecebd){return new BPromise(function(_0x104925,_0x2325f9){var _0x8bae=_0x5ecebd||client;return _0x8bae[_0xa81e('0x1a')](_0x5e8a8c,_0x504fc6)[_0xa81e('0x1b')](function(_0x1fefe9){logger[_0xa81e('0x1c')](_0xa81e('0x1d'),_0x1b6fb1,_0xa81e('0x1e'));logger[_0xa81e('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x1b6fb1,_0xa81e('0x1e'),JSON[_0xa81e('0x20')](_0x1fefe9));if(_0x1fefe9[_0xa81e('0x21')]){if(_0x1fefe9['error']['code']===0x1f4){logger[_0xa81e('0x21')]('Setting,\x20%s,\x20%s',_0x1b6fb1,_0x1fefe9['error']['message']);return _0x2325f9(_0x1fefe9[_0xa81e('0x21')][_0xa81e('0x22')]);}logger[_0xa81e('0x21')](_0xa81e('0x1d'),_0x1b6fb1,_0x1fefe9[_0xa81e('0x21')][_0xa81e('0x22')]);return _0x104925(_0x1fefe9[_0xa81e('0x21')][_0xa81e('0x22')]);}else{logger[_0xa81e('0x1c')]('Setting,\x20%s,\x20%s',_0x1b6fb1,_0xa81e('0x1e'));_0x104925(_0x1fefe9[_0xa81e('0x23')]['message']);}})[_0xa81e('0x24')](function(_0x4d68cb){logger[_0xa81e('0x21')](_0xa81e('0x1d'),_0x1b6fb1,_0x4d68cb);_0x2325f9(_0x4d68cb);});});}function respondWithStatusCode(_0x5bc06d,_0x271c84){_0x271c84=_0x271c84||0xcc;return function(_0x43f650){if(_0x43f650){return _0x5bc06d[_0xa81e('0x25')](_0x271c84);}return _0x5bc06d[_0xa81e('0x26')](_0x271c84)[_0xa81e('0x27')]();};}function respondWithResult(_0x1e8cc3,_0x2665ca){_0x2665ca=_0x2665ca||0xc8;return function(_0x6ea9e6){if(_0x6ea9e6){return _0x1e8cc3[_0xa81e('0x26')](_0x2665ca)[_0xa81e('0x28')](_0x6ea9e6);}};}function respondWithFilteredResult(_0x3c21c9,_0x53f966){return function(_0x3f8597){if(_0x3f8597){var _0x47c1aa=typeof _0x53f966[_0xa81e('0x29')]===_0xa81e('0x2a')&&typeof _0x53f966['limit']===_0xa81e('0x2a');var _0x458323=_0x3f8597[_0xa81e('0x2b')];var _0x3a5679=_0x47c1aa?0x0:_0x53f966['offset'];var _0x30b4b6=_0x47c1aa?_0x3f8597[_0xa81e('0x2b')]:_0x53f966[_0xa81e('0x29')]+_0x53f966[_0xa81e('0x2c')];var _0x4ecdea;if(_0x30b4b6>=_0x458323){_0x30b4b6=_0x458323;_0x4ecdea=0xc8;}else{_0x4ecdea=0xce;}_0x3c21c9[_0xa81e('0x26')](_0x4ecdea);return _0x3c21c9['set']('Content-Range',_0x3a5679+'-'+_0x30b4b6+'/'+_0x458323)['json'](_0x3f8597);}return null;};}function patchUpdates(_0xcd2218){return function(_0x400d79){try{jsonpatch[_0xa81e('0x2d')](_0x400d79,_0xcd2218,!![]);}catch(_0x25772b){return BPromise[_0xa81e('0x2e')](_0x25772b);}return _0x400d79['save']();};}function saveUpdates(_0x4229a3,_0x3d3e3c){return function(_0xe59fe0){if(_0xe59fe0){return _0xe59fe0[_0xa81e('0x2f')](_0x4229a3)['then'](function(_0x2c1cc1){return _0x2c1cc1;});}return null;};}function removeEntity(_0x2e9abd,_0x12da90){return function(_0x35f2cb){if(_0x35f2cb){return _0x35f2cb[_0xa81e('0x30')]()[_0xa81e('0x1b')](function(){_0x2e9abd[_0xa81e('0x26')](0xcc)[_0xa81e('0x27')]();});}};}function handleEntityNotFound(_0x703af9,_0x28e288){return function(_0x2a61a6){if(!_0x2a61a6){_0x703af9[_0xa81e('0x25')](0x194);}return _0x2a61a6;};}function handleError(_0x5bd169,_0x157764){_0x157764=_0x157764||0x1f4;return function(_0x1efb8e){logger[_0xa81e('0x21')](_0x1efb8e[_0xa81e('0x31')]);if(_0x1efb8e['name']){delete _0x1efb8e[_0xa81e('0x32')];}_0x5bd169['status'](_0x157764)[_0xa81e('0x33')](_0x1efb8e);};}exports[_0xa81e('0x34')]=function(_0xc0a726,_0x1c984d){var _0x4d606b={},_0x4478c8={},_0x4aad69={'count':0x0,'rows':[]};var _0x1a92be=_[_0xa81e('0x35')](db[_0xa81e('0x36')]['rawAttributes'],function(_0x5bb45c){return{'name':_0x5bb45c[_0xa81e('0x37')],'type':_0x5bb45c[_0xa81e('0x38')]['key']};});_0x4478c8[_0xa81e('0x39')]=_[_0xa81e('0x35')](_0x1a92be,_0xa81e('0x32'));_0x4478c8[_0xa81e('0x3a')]=_[_0xa81e('0x3b')](_0xc0a726[_0xa81e('0x3a')]);_0x4478c8[_0xa81e('0x3c')]=_[_0xa81e('0x3d')](_0x4478c8[_0xa81e('0x39')],_0x4478c8[_0xa81e('0x3a')]);_0x4d606b['attributes']=_['intersection'](_0x4478c8[_0xa81e('0x39')],qs['fields'](_0xc0a726[_0xa81e('0x3a')][_0xa81e('0x3e')]));_0x4d606b['attributes']=_0x4d606b[_0xa81e('0x3f')][_0xa81e('0x40')]?_0x4d606b[_0xa81e('0x3f')]:_0x4478c8[_0xa81e('0x39')];if(!_0xc0a726['query'][_0xa81e('0x41')]('nolimit')){_0x4d606b['limit']=qs['limit'](_0xc0a726['query'][_0xa81e('0x2c')]);_0x4d606b['offset']=qs[_0xa81e('0x29')](_0xc0a726['query'][_0xa81e('0x29')]);}_0x4d606b[_0xa81e('0x42')]=qs[_0xa81e('0x43')](_0xc0a726[_0xa81e('0x3a')][_0xa81e('0x43')]);_0x4d606b[_0xa81e('0x44')]=qs[_0xa81e('0x3c')](_[_0xa81e('0x45')](_0xc0a726[_0xa81e('0x3a')],_0x4478c8[_0xa81e('0x3c')]),_0x1a92be);if(_0xc0a726['query']['filter']){_0x4d606b[_0xa81e('0x44')]=_[_0xa81e('0x46')](_0x4d606b[_0xa81e('0x44')],{'$or':_[_0xa81e('0x35')](_0x1a92be,function(_0x59855a){if(_0x59855a[_0xa81e('0x38')]!==_0xa81e('0x47')){var _0x484730={};_0x484730[_0x59855a[_0xa81e('0x32')]]={'$like':'%'+_0xc0a726[_0xa81e('0x3a')][_0xa81e('0x48')]+'%'};return _0x484730;}})});}_0x4d606b=_[_0xa81e('0x46')]({},_0x4d606b,_0xc0a726[_0xa81e('0x49')]);var _0x20d4df={'where':_0x4d606b['where']};return db[_0xa81e('0x36')][_0xa81e('0x2b')](_0x20d4df)[_0xa81e('0x1b')](function(_0x136ee0){_0x4aad69['count']=_0x136ee0;if(_0xc0a726['query'][_0xa81e('0x4a')]){_0x4d606b[_0xa81e('0x4b')]=[{'all':!![]}];}return db[_0xa81e('0x36')][_0xa81e('0x4c')](_0x4d606b);})[_0xa81e('0x1b')](function(_0x50c7c8){_0x4aad69['rows']=_0x50c7c8;return _0x4aad69;})[_0xa81e('0x1b')](respondWithFilteredResult(_0x1c984d,_0x4d606b))[_0xa81e('0x24')](handleError(_0x1c984d,null));};exports['show']=function(_0x4bd9b1,_0x55faf7){var _0xa7a8cd={'raw':![],'where':{'id':_0x4bd9b1[_0xa81e('0x4d')]['id']}},_0x270f55={};_0x270f55['model']=_[_0xa81e('0x3b')](db[_0xa81e('0x36')]['rawAttributes']);_0x270f55['query']=_[_0xa81e('0x3b')](_0x4bd9b1[_0xa81e('0x3a')]);_0x270f55['filters']=_['intersection'](_0x270f55[_0xa81e('0x39')],_0x270f55['query']);_0xa7a8cd[_0xa81e('0x3f')]=_[_0xa81e('0x3d')](_0x270f55[_0xa81e('0x39')],qs['fields'](_0x4bd9b1['query'][_0xa81e('0x3e')]));_0xa7a8cd[_0xa81e('0x3f')]=_0xa7a8cd[_0xa81e('0x3f')][_0xa81e('0x40')]?_0xa7a8cd['attributes']:_0x270f55[_0xa81e('0x39')];if(_0x4bd9b1[_0xa81e('0x3a')][_0xa81e('0x4a')]){_0xa7a8cd[_0xa81e('0x4b')]=[{'all':!![]}];}_0xa7a8cd=_[_0xa81e('0x46')]({},_0xa7a8cd,_0x4bd9b1[_0xa81e('0x49')]);return db[_0xa81e('0x36')][_0xa81e('0x4e')](_0xa7a8cd)[_0xa81e('0x1b')](handleEntityNotFound(_0x55faf7,null))['then'](respondWithResult(_0x55faf7,null))['catch'](handleError(_0x55faf7,null));};exports['update']=function(_0x4567a4,_0x568ff2){if(_0x4567a4['body']['id']){delete _0x4567a4[_0xa81e('0x4f')]['id'];}return db[_0xa81e('0x36')][_0xa81e('0x4e')]({'where':{'id':_0x4567a4[_0xa81e('0x4d')]['id']}})[_0xa81e('0x1b')](handleEntityNotFound(_0x568ff2,null))[_0xa81e('0x1b')](saveUpdates(_0x4567a4[_0xa81e('0x4f')],null))['then'](respondWithResult(_0x568ff2,null))['catch'](handleError(_0x568ff2,null));};exports[_0xa81e('0x50')]=function(_0x365d32,_0x22258b,_0x59e9fd){if(_0x365d32[_0xa81e('0x51')]&&_0x365d32[_0xa81e('0x51')][_0xa81e('0x52')]){_0x365d32[_0xa81e('0x4f')][_0xa81e('0x53')]=_0x365d32[_0xa81e('0x51')][_0xa81e('0x52')];}return db['Setting'][_0xa81e('0x4e')]({'where':{'id':_0x365d32[_0xa81e('0x4d')]['id']}})[_0xa81e('0x1b')](handleEntityNotFound(_0x22258b,null))[_0xa81e('0x1b')](saveUpdates(_0x365d32['body'],null))[_0xa81e('0x1b')](respondWithResult(_0x22258b,null))[_0xa81e('0x24')](handleError(_0x22258b,null));};exports[_0xa81e('0x54')]=function(_0x2cc100,_0x5ab653,_0x55a71f){if(_0x2cc100[_0xa81e('0x51')]&&_0x2cc100[_0xa81e('0x51')][_0xa81e('0x52')]){_0x2cc100[_0xa81e('0x4f')][_0xa81e('0x55')]=_0x2cc100[_0xa81e('0x51')][_0xa81e('0x52')];}return db['Setting'][_0xa81e('0x4e')]({'where':{'id':_0x2cc100[_0xa81e('0x4d')]['id']}})[_0xa81e('0x1b')](handleEntityNotFound(_0x5ab653,null))[_0xa81e('0x1b')](saveUpdates(_0x2cc100[_0xa81e('0x4f')],null))[_0xa81e('0x1b')](respondWithResult(_0x5ab653,null))[_0xa81e('0x24')](handleError(_0x5ab653,null));};var utilLicense=require('../../config/license/util');exports[_0xa81e('0x56')]=function(_0x3fd6c6,_0x3896d8,_0x241275){var _0x3c9022=_0xa81e('0x57');var _0x396c8e={'custom':![]};return utilLicense[_0xa81e('0x58')]()[_0xa81e('0x1b')](function(_0x15fcee){if(_0x15fcee){_0x396c8e=_0x15fcee;}return db[_0xa81e('0x36')][_0xa81e('0x4e')]({'where':{'id':_0x3fd6c6['params']['id']},'attributes':[_0xa81e('0x53'),_0xa81e('0x55'),_0xa81e('0x59'),_0xa81e('0x5a'),'defaultLogo','defaultLoginLogo',_0xa81e('0x5b'),_0xa81e('0x5c')],'raw':!![]});})['then'](handleEntityNotFound(_0x3896d8,null))['then'](function(_0x36375b){if(_0x36375b){var _0x5e7fee=_0x36375b['logo']&&fs[_0xa81e('0x5d')](path['join'](config[_0xa81e('0x5e')],_0x3c9022,_[_0xa81e('0x5f')](_0x36375b[_0xa81e('0x53')])))?path['join'](config[_0xa81e('0x5e')],_0x3c9022,_[_0xa81e('0x5f')](_0x36375b[_0xa81e('0x53')])):path[_0xa81e('0x60')](config[_0xa81e('0x5e')],_0x3c9022,_['toLower'](_0xa81e('0x61')));var _0xfd1176=_0xa81e('0x62')+_[_0xa81e('0x63')](_0xa81e('0x53'));if(_0x36375b[_0xfd1176]||!_0x396c8e[_0xa81e('0x64')]){_0x5e7fee=path[_0xa81e('0x60')](config[_0xa81e('0x5e')],_0x3c9022,_[_0xa81e('0x5f')](_0xa81e('0x61')));}if(!fs[_0xa81e('0x5d')](_0x5e7fee)){throw new db[(_0xa81e('0x65'))]['ValidationError'](_['upperFirst'](_0xa81e('0x53'))+_0xa81e('0x66'));}return _0x3896d8[_0xa81e('0x67')](_0x5e7fee);}})[_0xa81e('0x24')](handleError(_0x3896d8,null));};var utilLicense=require(_0xa81e('0x17'));exports[_0xa81e('0x68')]=function(_0x115b20,_0x34dcfe,_0x49b94f){var _0x56c60d=_0xa81e('0x57');var _0x27afb4={'custom':![]};return utilLicense[_0xa81e('0x58')]()[_0xa81e('0x1b')](function(_0x506647){if(_0x506647){_0x27afb4=_0x506647;}return db[_0xa81e('0x36')][_0xa81e('0x4e')]({'where':{'id':_0x115b20[_0xa81e('0x4d')]['id']},'attributes':[_0xa81e('0x53'),_0xa81e('0x55'),_0xa81e('0x59'),_0xa81e('0x5a'),_0xa81e('0x69'),_0xa81e('0x6a'),_0xa81e('0x5b'),_0xa81e('0x5c')],'raw':!![]});})[_0xa81e('0x1b')](handleEntityNotFound(_0x34dcfe,null))['then'](function(_0x2df321){if(_0x2df321){var _0x5f1c36=_0x2df321['loginLogo']&&fs[_0xa81e('0x5d')](path[_0xa81e('0x60')](config['root'],_0x56c60d,_[_0xa81e('0x5f')](_0x2df321[_0xa81e('0x55')])))?path[_0xa81e('0x60')](config['root'],_0x56c60d,_[_0xa81e('0x5f')](_0x2df321[_0xa81e('0x55')])):path[_0xa81e('0x60')](config[_0xa81e('0x5e')],_0x56c60d,_[_0xa81e('0x5f')](_0xa81e('0x6b')));var _0x2d794c='default'+_[_0xa81e('0x63')](_0xa81e('0x55'));if(_0x2df321[_0x2d794c]||!_0x27afb4[_0xa81e('0x64')]){_0x5f1c36=path['join'](config[_0xa81e('0x5e')],_0x56c60d,_['toLower'](_0xa81e('0x6b')));}if(!fs[_0xa81e('0x5d')](_0x5f1c36)){throw new db[(_0xa81e('0x65'))]['ValidationError'](_[_0xa81e('0x63')](_0xa81e('0x55'))+_0xa81e('0x66'));}return _0x34dcfe[_0xa81e('0x67')](_0x5f1c36);}})[_0xa81e('0x24')](handleError(_0x34dcfe,null));};exports[_0xa81e('0x6c')]=function(_0x41edff,_0x3952cb){return db['Setting']['find']({'where':{'id':_0x41edff[_0xa81e('0x4d')]['id']},'attributes':[_0xa81e('0x6d')]})[_0xa81e('0x1b')](respondWithResult(_0x3952cb,null))[_0xa81e('0x24')](handleError(_0x3952cb,null));};exports[_0xa81e('0x6e')]=function(_0x48a1c1,_0x5d44a3,_0xe538c6){if(_0x48a1c1[_0xa81e('0x51')]&&_0x48a1c1[_0xa81e('0x51')][_0xa81e('0x52')]){_0x48a1c1[_0xa81e('0x4f')][_0xa81e('0x59')]=_0x48a1c1[_0xa81e('0x51')][_0xa81e('0x52')];}return db[_0xa81e('0x36')]['find']({'where':{'id':_0x48a1c1['params']['id']}})[_0xa81e('0x1b')](handleEntityNotFound(_0x5d44a3,null))[_0xa81e('0x1b')](saveUpdates(_0x48a1c1[_0xa81e('0x4f')],null))['then'](respondWithResult(_0x5d44a3,null))[_0xa81e('0x24')](handleError(_0x5d44a3,null));};var utilLicense=require(_0xa81e('0x17'));exports[_0xa81e('0x6f')]=function(_0x356486,_0x2d358e,_0x3ccce6){var _0x2d9156=_0xa81e('0x57');var _0x2e085f={'custom':![]};return utilLicense[_0xa81e('0x58')]()[_0xa81e('0x1b')](function(_0x1f9a18){if(_0x1f9a18){_0x2e085f=_0x1f9a18;}return db['Setting'][_0xa81e('0x4e')]({'where':{'id':_0x356486[_0xa81e('0x4d')]['id']},'attributes':[_0xa81e('0x53'),_0xa81e('0x55'),'preferred',_0xa81e('0x5a'),_0xa81e('0x69'),_0xa81e('0x6a'),_0xa81e('0x5b'),_0xa81e('0x5c')],'raw':!![]});})[_0xa81e('0x1b')](handleEntityNotFound(_0x2d358e,null))[_0xa81e('0x1b')](function(_0x15811c){if(_0x15811c){var _0x39f060=_0x15811c[_0xa81e('0x59')]&&fs[_0xa81e('0x5d')](path[_0xa81e('0x60')](config[_0xa81e('0x5e')],_0x2d9156,_[_0xa81e('0x5f')](_0x15811c['preferred'])))?path[_0xa81e('0x60')](config[_0xa81e('0x5e')],_0x2d9156,_['toLower'](_0x15811c['preferred'])):path[_0xa81e('0x60')](config[_0xa81e('0x5e')],_0x2d9156,_[_0xa81e('0x5f')](_0xa81e('0x70')));var _0x37b974=_0xa81e('0x62')+_[_0xa81e('0x63')](_0xa81e('0x59'));if(_0x15811c[_0x37b974]||!_0x2e085f['custom']||!_0x2e085f['preferred']){_0x39f060=path[_0xa81e('0x60')](config[_0xa81e('0x5e')],_0x2d9156,_[_0xa81e('0x5f')](_0xa81e('0x70')));}if(!fs[_0xa81e('0x5d')](_0x39f060)){throw new db[(_0xa81e('0x65'))][(_0xa81e('0x71'))](_[_0xa81e('0x63')](_0xa81e('0x59'))+_0xa81e('0x66'));}return _0x2d358e[_0xa81e('0x67')](_0x39f060);}})['catch'](handleError(_0x2d358e,null));};exports['addFavicon']=function(_0x326018,_0xa8ea7f,_0x2bfec3){if(_0x326018['file']&&_0x326018[_0xa81e('0x51')][_0xa81e('0x52')]){_0x326018['body'][_0xa81e('0x5a')]=_0x326018[_0xa81e('0x51')][_0xa81e('0x52')];}return db[_0xa81e('0x36')]['find']({'where':{'id':_0x326018['params']['id']}})[_0xa81e('0x1b')](handleEntityNotFound(_0xa8ea7f,null))[_0xa81e('0x1b')](saveUpdates(_0x326018[_0xa81e('0x4f')],null))[_0xa81e('0x1b')](respondWithResult(_0xa8ea7f,null))['catch'](handleError(_0xa8ea7f,null));};var utilLicense=require(_0xa81e('0x17'));exports[_0xa81e('0x72')]=function(_0x525dc6,_0x510c49,_0xd763f8){var _0x478550=_0xa81e('0x57');var _0x121d9a={'custom':![]};return utilLicense[_0xa81e('0x58')]()[_0xa81e('0x1b')](function(_0x5c470e){if(_0x5c470e){_0x121d9a=_0x5c470e;}return db[_0xa81e('0x36')][_0xa81e('0x4e')]({'where':{'id':_0x525dc6['params']['id']},'attributes':[_0xa81e('0x53'),'loginLogo',_0xa81e('0x59'),_0xa81e('0x5a'),'defaultLogo',_0xa81e('0x6a'),_0xa81e('0x5b'),'defaultFavicon'],'raw':!![]});})[_0xa81e('0x1b')](handleEntityNotFound(_0x510c49,null))[_0xa81e('0x1b')](function(_0x2bfb27){if(_0x2bfb27){var _0x3d5a3e=_0x2bfb27['favicon']&&fs['existsSync'](path[_0xa81e('0x60')](config[_0xa81e('0x5e')],_0x478550,_[_0xa81e('0x5f')](_0x2bfb27[_0xa81e('0x5a')])))?path[_0xa81e('0x60')](config[_0xa81e('0x5e')],_0x478550,_['toLower'](_0x2bfb27[_0xa81e('0x5a')])):path[_0xa81e('0x60')](config[_0xa81e('0x5e')],_0x478550,_['toLower']('default_favicon.ico'));var _0x4ecd28=_0xa81e('0x62')+_[_0xa81e('0x63')](_0xa81e('0x5a'));if(_0x2bfb27[_0x4ecd28]||!_0x121d9a[_0xa81e('0x64')]){_0x3d5a3e=path[_0xa81e('0x60')](config[_0xa81e('0x5e')],_0x478550,_[_0xa81e('0x5f')](_0xa81e('0x73')));}if(!fs[_0xa81e('0x5d')](_0x3d5a3e)){throw new db[(_0xa81e('0x65'))][(_0xa81e('0x71'))](_[_0xa81e('0x63')](_0xa81e('0x5a'))+'\x20not\x20found');}return _0x510c49[_0xa81e('0x67')](_0x3d5a3e);}})[_0xa81e('0x24')](handleError(_0x510c49,null));};exports[_0xa81e('0x74')]=function(_0x272c5b,_0x5e0a39){var _0x334858={'offset':moment()[_0xa81e('0x75')]()};_0x334858[_0xa81e('0x76')]=moment()['utcOffset'](_0x334858[_0xa81e('0x29')])[_0xa81e('0x77')](_0xa81e('0x78'));return _0x5e0a39['status'](0xc8)[_0xa81e('0x33')](_0x334858);};
\ No newline at end of file
index 0984d63..2defd20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0x55ca,0x126));var _0xa55c=function(_0x554047,_0x46ec41){_0x554047=_0x554047-0x0;var _0x5d11e4=_0x55ca[_0x554047];return _0x5d11e4;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x14dfe0,_0x489f24){var _0x24a21e=function(_0x571dca){while(--_0x571dca){_0x14dfe0['push'](_0x14dfe0['shift']());}};_0x24a21e(++_0x489f24);}(_0x34e8,0x12c));var _0x834e=function(_0xac528f,_0x1660df){_0xac528f=_0xac528f-0x0;var _0x1f0245=_0x34e8[_0xac528f];return _0x1f0245;};'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 cb82680..4c1a465 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1b6=['catch','Setting','find','options','where','attributes','include','map','model','ShowSetting','debug','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','Setting,\x20%s,\x20%s','message','result'];(function(_0x4e5d73,_0x4503af){var _0x1d2dcc=function(_0x5ca09f){while(--_0x5ca09f){_0x4e5d73['push'](_0x4e5d73['shift']());}};_0x1d2dcc(++_0x4503af);}(_0xb1b6,0x192));var _0x6b1b=function(_0x40c53d,_0x1bd1bc){_0x40c53d=_0x40c53d-0x0;var _0x47a718=_0xb1b6[_0x40c53d];return _0x47a718;};'use strict';var _=require(_0x6b1b('0x0'));var util=require('util');var moment=require(_0x6b1b('0x1'));var BPromise=require(_0x6b1b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b1b('0x3'));var db=require(_0x6b1b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6b1b('0x5'));var config=require(_0x6b1b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6b1b('0x7')][_0x6b1b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xfa9512,_0x504038,_0x231650){return new BPromise(function(_0x150a0d,_0x1ca3de){return client[_0x6b1b('0x9')](_0xfa9512,_0x231650)[_0x6b1b('0xa')](function(_0x4c4560){logger[_0x6b1b('0xb')]('Setting,\x20%s,\x20%s',_0x504038,_0x6b1b('0xc'));logger['debug'](_0x6b1b('0xd'),_0x504038,'request\x20sent',JSON['stringify'](_0x4c4560));if(_0x4c4560['error']){if(_0x4c4560[_0x6b1b('0xe')]['code']===0x1f4){logger[_0x6b1b('0xe')](_0x6b1b('0xf'),_0x504038,_0x4c4560[_0x6b1b('0xe')][_0x6b1b('0x10')]);return _0x1ca3de(_0x4c4560[_0x6b1b('0xe')][_0x6b1b('0x10')]);}logger['error'](_0x6b1b('0xf'),_0x504038,_0x4c4560[_0x6b1b('0xe')][_0x6b1b('0x10')]);return _0x150a0d(_0x4c4560[_0x6b1b('0xe')][_0x6b1b('0x10')]);}else{logger['info'](_0x6b1b('0xf'),_0x504038,_0x6b1b('0xc'));_0x150a0d(_0x4c4560[_0x6b1b('0x11')][_0x6b1b('0x10')]);}})[_0x6b1b('0x12')](function(_0x32cf96){logger[_0x6b1b('0xe')]('Setting,\x20%s,\x20%s',_0x504038,_0x32cf96);_0x1ca3de(_0x32cf96);});});}exports['ShowSetting']=function(_0x204ff5){var _0x215daa=this;return new Promise(function(_0x32d00a,_0x54d187){return db[_0x6b1b('0x13')][_0x6b1b('0x14')]({'raw':_0x204ff5[_0x6b1b('0x15')]?_0x204ff5[_0x6b1b('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x204ff5['options']?_0x204ff5[_0x6b1b('0x15')][_0x6b1b('0x16')]||null:null,'attributes':_0x204ff5['options']?_0x204ff5['options'][_0x6b1b('0x17')]||null:null,'include':_0x204ff5['options']?_0x204ff5[_0x6b1b('0x15')][_0x6b1b('0x18')]?_[_0x6b1b('0x19')](_0x204ff5[_0x6b1b('0x15')]['include'],function(_0x1c8bf1){return{'model':db[_0x1c8bf1['model']],'as':_0x1c8bf1['as'],'attributes':_0x1c8bf1[_0x6b1b('0x17')],'include':_0x1c8bf1[_0x6b1b('0x18')]?_[_0x6b1b('0x19')](_0x1c8bf1[_0x6b1b('0x18')],function(_0x128302){return{'model':db[_0x128302['model']],'as':_0x128302['as'],'attributes':_0x128302[_0x6b1b('0x17')],'include':_0x128302[_0x6b1b('0x18')]?_[_0x6b1b('0x19')](_0x128302[_0x6b1b('0x18')],function(_0x2de6ac){return{'model':db[_0x2de6ac[_0x6b1b('0x1a')]],'as':_0x2de6ac['as'],'attributes':_0x2de6ac['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b1b('0xa')](function(_0x1b87f7){logger[_0x6b1b('0xb')](_0x6b1b('0x1b'),_0x204ff5);logger[_0x6b1b('0x1c')](_0x6b1b('0x1b'),_0x204ff5,JSON[_0x6b1b('0x1d')](_0x1b87f7));_0x32d00a(_0x1b87f7);})[_0x6b1b('0x12')](function(_0x29d499){logger[_0x6b1b('0xe')](_0x6b1b('0x1b'),_0x29d499[_0x6b1b('0x10')],_0x204ff5);_0x54d187(_0x215daa[_0x6b1b('0xe')](0x1f4,_0x29d499[_0x6b1b('0x10')]));});});};
\ No newline at end of file
+var _0x12f1=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','find','options','raw','where','attributes','include','map','model','then','ShowSetting','lodash','util','moment','bluebird','randomstring'];(function(_0x1352f0,_0x4cd565){var _0x1c2a82=function(_0x2a9b63){while(--_0x2a9b63){_0x1352f0['push'](_0x1352f0['shift']());}};_0x1c2a82(++_0x4cd565);}(_0x12f1,0xa0));var _0x112f=function(_0x316fd8,_0x3372fd){_0x316fd8=_0x316fd8-0x0;var _0x15918f=_0x12f1[_0x316fd8];return _0x15918f;};'use strict';var _=require(_0x112f('0x0'));var util=require(_0x112f('0x1'));var moment=require(_0x112f('0x2'));var BPromise=require(_0x112f('0x3'));var rs=require(_0x112f('0x4'));var fs=require('fs');var Redis=require(_0x112f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x112f('0x6'));var logger=require('../../config/logger')(_0x112f('0x7'));var config=require(_0x112f('0x8'));var jayson=require(_0x112f('0x9'));var client=jayson[_0x112f('0xa')][_0x112f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3611d9,_0x1a9bb0,_0x58f7f3){return new BPromise(function(_0x538618,_0x390618){return client[_0x112f('0xc')](_0x3611d9,_0x58f7f3)['then'](function(_0x1a835e){logger[_0x112f('0xd')](_0x112f('0xe'),_0x1a9bb0,_0x112f('0xf'));logger[_0x112f('0x10')](_0x112f('0x11'),_0x1a9bb0,'request\x20sent',JSON[_0x112f('0x12')](_0x1a835e));if(_0x1a835e[_0x112f('0x13')]){if(_0x1a835e[_0x112f('0x13')]['code']===0x1f4){logger[_0x112f('0x13')](_0x112f('0xe'),_0x1a9bb0,_0x1a835e['error'][_0x112f('0x14')]);return _0x390618(_0x1a835e[_0x112f('0x13')][_0x112f('0x14')]);}logger['error'](_0x112f('0xe'),_0x1a9bb0,_0x1a835e[_0x112f('0x13')][_0x112f('0x14')]);return _0x538618(_0x1a835e[_0x112f('0x13')]['message']);}else{logger[_0x112f('0xd')](_0x112f('0xe'),_0x1a9bb0,'request\x20sent');_0x538618(_0x1a835e[_0x112f('0x15')][_0x112f('0x14')]);}})[_0x112f('0x16')](function(_0x1ef917){logger[_0x112f('0x13')](_0x112f('0xe'),_0x1a9bb0,_0x1ef917);_0x390618(_0x1ef917);});});}exports['ShowSetting']=function(_0x21a03){var _0xd44ac7=this;return new Promise(function(_0x409880,_0xc65f){return db['Setting'][_0x112f('0x17')]({'raw':_0x21a03[_0x112f('0x18')]?_0x21a03['options'][_0x112f('0x19')]===undefined?!![]:![]:!![],'where':_0x21a03[_0x112f('0x18')]?_0x21a03[_0x112f('0x18')][_0x112f('0x1a')]||null:null,'attributes':_0x21a03['options']?_0x21a03[_0x112f('0x18')][_0x112f('0x1b')]||null:null,'include':_0x21a03[_0x112f('0x18')]?_0x21a03[_0x112f('0x18')][_0x112f('0x1c')]?_[_0x112f('0x1d')](_0x21a03[_0x112f('0x18')]['include'],function(_0x1a7d67){return{'model':db[_0x1a7d67[_0x112f('0x1e')]],'as':_0x1a7d67['as'],'attributes':_0x1a7d67[_0x112f('0x1b')],'include':_0x1a7d67[_0x112f('0x1c')]?_['map'](_0x1a7d67[_0x112f('0x1c')],function(_0x18a802){return{'model':db[_0x18a802['model']],'as':_0x18a802['as'],'attributes':_0x18a802[_0x112f('0x1b')],'include':_0x18a802[_0x112f('0x1c')]?_[_0x112f('0x1d')](_0x18a802[_0x112f('0x1c')],function(_0x46b7e0){return{'model':db[_0x46b7e0[_0x112f('0x1e')]],'as':_0x46b7e0['as'],'attributes':_0x46b7e0[_0x112f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x112f('0x1f')](function(_0x17fedd){logger[_0x112f('0xd')](_0x112f('0x20'),_0x21a03);logger[_0x112f('0x10')](_0x112f('0x20'),_0x21a03,JSON[_0x112f('0x12')](_0x17fedd));_0x409880(_0x17fedd);})['catch'](function(_0x36c7e5){logger[_0x112f('0x13')](_0x112f('0x20'),_0x36c7e5['message'],_0x21a03);_0xc65f(_0xd44ac7[_0x112f('0x13')](0x1f4,_0x36c7e5[_0x112f('0x14')]));});});};
\ No newline at end of file
index b5516f1..b9dcb19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['create','post','/:id/dispositions','addAnswer','/:id/notify','notify','addApplications','status','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users'];(function(_0x5d2f39,_0x11e2f4){var _0x3df8f6=function(_0x50eeaf){while(--_0x50eeaf){_0x5d2f39['push'](_0x5d2f39['shift']());}};_0x3df8f6(++_0x11e2f4);}(_0x5fab,0x177));var _0xb5fa=function(_0x494986,_0x4debb8){_0x494986=_0x494986-0x0;var _0x1c805b=_0x5fab[_0x494986];return _0x1c805b;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['get']('/:id/dispositions',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0xa')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0xa')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller['getApplications']);router[_0xb5fa('0xa')](_0xb5fa('0x14'),auth['isAuthenticated'](),controller[_0xb5fa('0x15')]);router['get'](_0xb5fa('0x16'),controller[_0xb5fa('0x17')]);router[_0xb5fa('0xa')](_0xb5fa('0x18'),auth[_0xb5fa('0xb')](),controller['getAgents']);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x19')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1b'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xb5fa('0x1a')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1c')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1d'),controller[_0xb5fa('0x1e')]);router[_0xb5fa('0x1a')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1f')]);router[_0xb5fa('0x1a')]('/:id/send',auth[_0xb5fa('0xb')](),controller['send']);router[_0xb5fa('0x1a')]('/:id/status',controller[_0xb5fa('0x20')]);router[_0xb5fa('0x1a')]('/:id/users',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x21')]);router[_0xb5fa('0x22')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x23')]);router[_0xb5fa('0x24')]('/:id',auth[_0xb5fa('0xb')](),controller['destroy']);router[_0xb5fa('0x24')](_0xb5fa('0x1b'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x25')]);router[_0xb5fa('0x24')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x26')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xb5fa('0x27')]=router;
\ No newline at end of file
+var _0x5fc3=['/:id','show','getDispositions','/:id/canned_answers','/:id/applications','getInteractions','/:id/status','statusGet','post','create','/:id/dispositions','addAnswer','/:id/notify','/:id/send','send','status','/:id/users','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','describe'];(function(_0x5e1201,_0x59913f){var _0x912cc4=function(_0x52e015){while(--_0x52e015){_0x5e1201['push'](_0x5e1201['shift']());}};_0x912cc4(++_0x59913f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x5fc3[_0x3f0b30];return _0x2748a5;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/dispositions',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getAnswers']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getApplications']);router[_0x35fc('0x9')]('/:id/interactions',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router[_0x35fc('0x9')](_0x35fc('0x12'),controller[_0x35fc('0x13')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x14')]('/',auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x14')](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller['addDisposition']);router[_0x35fc('0x14')](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x14')](_0x35fc('0x18'),controller['notify']);router[_0x35fc('0x14')](_0x35fc('0x10'),auth[_0x35fc('0xa')](),controller['addApplications']);router[_0x35fc('0x14')](_0x35fc('0x19'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1a')]);router[_0x35fc('0x14')](_0x35fc('0x12'),controller[_0x35fc('0x1b')]);router[_0x35fc('0x14')](_0x35fc('0x1c'),auth[_0x35fc('0xa')](),controller['addAgents']);router[_0x35fc('0x1d')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1e')]);router[_0x35fc('0x1f')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x20')]);router['delete'](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x21')]);router['delete'](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x22')]);router[_0x35fc('0x1f')]('/:id/users',auth['isAuthenticated'](),controller[_0x35fc('0x23')]);module['exports']=router;
\ No newline at end of file
index 8b3feda..21d7284 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7804=['randomstring','exports','name','STRING','generate','twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0x36cba4,_0x53a452){var _0xcc6047=function(_0x20b2a5){while(--_0x20b2a5){_0x36cba4['push'](_0x36cba4['shift']());}};_0xcc6047(++_0x53a452);}(_0x7804,0x1ce));var _0x4780=function(_0x106e67,_0x66fe57){_0x106e67=_0x106e67-0x0;var _0x2bbd07=_0x7804[_0x106e67];return _0x2bbd07;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x4780('0x0'));module[_0x4780('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4780('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x4780('0x3')],'defaultValue':function(){return rs[_0x4780('0x4')]();}},'phone':{'type':Sequelize[_0x4780('0x3')]},'type':{'type':Sequelize['ENUM'](_0x4780('0x5'),_0x4780('0x6'),_0x4780('0x7'),_0x4780('0x8'),_0x4780('0x9'),_0x4780('0xa'),_0x4780('0xb'),_0x4780('0xc'),'infobip',_0x4780('0xd'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x4780('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x4780('0x3')]},'password':{'type':Sequelize[_0x4780('0x3')]},'apiKey':{'type':Sequelize[_0x4780('0x3')]},'applicationId':{'type':Sequelize[_0x4780('0x3')]},'accountId':{'type':Sequelize[_0x4780('0x3')]},'senderString':{'type':Sequelize[_0x4780('0x3')]},'deliveryReport':{'type':Sequelize[_0x4780('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x4780('0x3')]},'notificationTemplate':{'type':Sequelize[_0x4780('0xf')],'defaultValue':function(){return _0x4780('0x10');}},'notificationSound':{'type':Sequelize[_0x4780('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4780('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4780('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4780('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4780('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4780('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x4780('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4780('0x11')],'comment':_0x4780('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x4780('0xe')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x447324){if(!_0x447324)this['setDataValue'](_0x4780('0x13'),null);this[_0x4780('0x14')](_0x4780('0x15'),_0x447324);}}};
\ No newline at end of file
+var _0x432a=['STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','intelepeer','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x192d1b,_0x2fdd17){var _0x41ea67=function(_0x13badb){while(--_0x13badb){_0x192d1b['push'](_0x192d1b['shift']());}};_0x41ea67(++_0x2fdd17);}(_0x432a,0x6f));var _0xa432=function(_0x537290,_0x1f9e4a){_0x537290=_0x537290-0x0;var _0x3a5fb3=_0x432a[_0x537290];return _0x3a5fb3;};'use strict';var Sequelize=require(_0xa432('0x0'));var rs=require(_0xa432('0x1'));module[_0xa432('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xa432('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xa432('0x3')],'defaultValue':function(){return rs[_0xa432('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa432('0x5')](_0xa432('0x6'),_0xa432('0x7'),_0xa432('0x8'),_0xa432('0x9'),_0xa432('0xa'),_0xa432('0xb'),'bandwidth','csc','infobip',_0xa432('0xc'))},'accountSid':{'type':Sequelize[_0xa432('0x3')]},'authId':{'type':Sequelize[_0xa432('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xa432('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xa432('0x3')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xa432('0x3')]},'accountId':{'type':Sequelize[_0xa432('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xa432('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xa432('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa432('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa432('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa432('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa432('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa432('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa432('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xa432('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xa432('0xf')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa432('0x10'),'set':function(_0x35056a){if(!_0x35056a)this['setDataValue'](_0xa432('0x11'),null);this['setDataValue'](_0xa432('0x12'),_0x35056a);}}};
\ No newline at end of file
index 679e4a0..b07c284 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d38=['order','sort','where','pick','filter','merge','options','SmsAccount','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','user','role','autoAssociation','describe','getDispositions','SmsAccountId','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','From','Body','skebby','from','sender','text','clicksend','messageId','message_id','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','ValidationError','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','omit','contact','SmsInteraction','interaction','created','autoclose','push','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','*,*,*,*','startRouting','Start','receiveMessage','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','Owner','fullname','internal','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','DESC','List','out','spread','dataValues','Messages','skebby_dispatch_id','connectel','requestid','statusInt','status_code','infobip','DELIVERED','groupName','redif','inspect','error_code','DELIVERED_TO_GATEWAY','bandwidth','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','state','message-id','addAgents','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','limit','undefined','count','offset','set','json','apply','reject','update','then','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x37635e,_0x21b6f5){var _0x3c0965=function(_0xe9864c){while(--_0xe9864c){_0x37635e['push'](_0x37635e['shift']());}};_0x3c0965(++_0x21b6f5);}(_0x9d38,0x16e));var _0x89d3=function(_0x472f07,_0x393fe4){_0x472f07=_0x472f07-0x0;var _0x5a6c7a=_0x9d38[_0x472f07];return _0x5a6c7a;};'use strict';var emlformat=require(_0x89d3('0x0'));var rimraf=require(_0x89d3('0x1'));var zipdir=require(_0x89d3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x89d3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x89d3('0x4'));var path=require(_0x89d3('0x5'));var sox=require(_0x89d3('0x6'));var csv=require(_0x89d3('0x7'));var ejs=require(_0x89d3('0x8'));var fs=require('fs');var fs_extra=require(_0x89d3('0x9'));var _=require(_0x89d3('0xa'));var squel=require(_0x89d3('0xb'));var crypto=require('crypto');var jsforce=require(_0x89d3('0xc'));var deskjs=require(_0x89d3('0xd'));var toCsv=require(_0x89d3('0x7'));var querystring=require(_0x89d3('0xe'));var Papa=require(_0x89d3('0xf'));var Redis=require(_0x89d3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x89d3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x89d3('0x12'));var logger=require(_0x89d3('0x13'))(_0x89d3('0x14'));var utils=require(_0x89d3('0x15'));var config=require(_0x89d3('0x16'));var licenseUtil=require(_0x89d3('0x17'));var db=require(_0x89d3('0x18'))['db'];config['redis']=_[_0x89d3('0x19')](config[_0x89d3('0x1a')],{'host':_0x89d3('0x1b'),'port':0x18eb});var socket=require(_0x89d3('0x1c'))(new Redis(config[_0x89d3('0x1a')]));require(_0x89d3('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x89d3('0x1e')][_0x89d3('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x2367c6,_0x14641c,_0x140fe8,_0x482f8b){return new BPromise(function(_0x39394b,_0x1d8c5d){var _0x2d6a05=_0x482f8b||client;return _0x2d6a05[_0x89d3('0x20')](_0x2367c6,_0x140fe8)['then'](function(_0x2a4943){logger[_0x89d3('0x21')](_0x89d3('0x22'),_0x14641c,_0x89d3('0x23'));logger['debug'](_0x89d3('0x24'),_0x14641c,_0x89d3('0x23'),JSON[_0x89d3('0x25')](_0x2a4943));if(_0x2a4943[_0x89d3('0x26')]){if(_0x2a4943['error'][_0x89d3('0x27')]===0x1f4){logger[_0x89d3('0x26')](_0x89d3('0x22'),_0x14641c,_0x2a4943[_0x89d3('0x26')]['message']);return _0x1d8c5d(_0x2a4943['error'][_0x89d3('0x28')]);}logger[_0x89d3('0x26')]('SmsAccount,\x20%s,\x20%s',_0x14641c,_0x2a4943[_0x89d3('0x26')][_0x89d3('0x28')]);return _0x39394b(_0x2a4943[_0x89d3('0x26')][_0x89d3('0x28')]);}else{logger[_0x89d3('0x21')](_0x89d3('0x22'),_0x14641c,'request\x20sent');_0x39394b(_0x2a4943[_0x89d3('0x29')][_0x89d3('0x28')]);}})['catch'](function(_0x572238){logger[_0x89d3('0x26')](_0x89d3('0x22'),_0x14641c,_0x572238);_0x1d8c5d(_0x572238);});});}function respondWithStatusCode(_0x75e8bc,_0x5e88c0){_0x5e88c0=_0x5e88c0||0xcc;return function(_0x218a9e){if(_0x218a9e){return _0x75e8bc[_0x89d3('0x2a')](_0x5e88c0);}return _0x75e8bc[_0x89d3('0x2b')](_0x5e88c0)[_0x89d3('0x2c')]();};}function respondWithResult(_0x5c441b,_0x5694ab){_0x5694ab=_0x5694ab||0xc8;return function(_0x2b9059){if(_0x2b9059){return _0x5c441b['status'](_0x5694ab)['json'](_0x2b9059);}};}function respondWithFilteredResult(_0x30dbee,_0x4e4c0f){return function(_0x2b7c09){if(_0x2b7c09){var _0x1e18e9=typeof _0x4e4c0f['offset']==='undefined'&&typeof _0x4e4c0f[_0x89d3('0x2d')]===_0x89d3('0x2e');var _0x4e9c6c=_0x2b7c09[_0x89d3('0x2f')];var _0x3aaa2c=_0x1e18e9?0x0:_0x4e4c0f[_0x89d3('0x30')];var _0x3e1709=_0x1e18e9?_0x2b7c09[_0x89d3('0x2f')]:_0x4e4c0f['offset']+_0x4e4c0f['limit'];var _0x3300e0;if(_0x3e1709>=_0x4e9c6c){_0x3e1709=_0x4e9c6c;_0x3300e0=0xc8;}else{_0x3300e0=0xce;}_0x30dbee[_0x89d3('0x2b')](_0x3300e0);return _0x30dbee[_0x89d3('0x31')]('Content-Range',_0x3aaa2c+'-'+_0x3e1709+'/'+_0x4e9c6c)[_0x89d3('0x32')](_0x2b7c09);}return null;};}function patchUpdates(_0x908d59){return function(_0x25f7ea){try{jsonpatch[_0x89d3('0x33')](_0x25f7ea,_0x908d59,!![]);}catch(_0x593d04){return BPromise[_0x89d3('0x34')](_0x593d04);}return _0x25f7ea['save']();};}function saveUpdates(_0x4a1561,_0x59389b){return function(_0x130b21){if(_0x130b21){return _0x130b21[_0x89d3('0x35')](_0x4a1561)[_0x89d3('0x36')](function(_0x1c2a0a){return _0x1c2a0a;});}return null;};}function removeEntity(_0x192e28,_0x3039d7){return function(_0x347679){if(_0x347679){return _0x347679[_0x89d3('0x37')]()[_0x89d3('0x36')](function(){var _0x2e0527=_0x347679[_0x89d3('0x38')]({'plain':!![]});var _0x3ff173=_0x89d3('0x39');return db[_0x89d3('0x3a')][_0x89d3('0x37')]({'where':{'type':_0x3ff173,'resourceId':_0x2e0527['id']}})[_0x89d3('0x36')](function(){return _0x347679;});})[_0x89d3('0x36')](function(){_0x192e28[_0x89d3('0x2b')](0xcc)[_0x89d3('0x2c')]();});}};}function handleEntityNotFound(_0x1f2361,_0x32d048){return function(_0x118d9b){if(!_0x118d9b){_0x1f2361[_0x89d3('0x2a')](0x194);}return _0x118d9b;};}function handleError(_0x32ba73,_0xaf3230){_0xaf3230=_0xaf3230||0x1f4;return function(_0x4d6d5c){logger[_0x89d3('0x26')](_0x4d6d5c[_0x89d3('0x3b')]);if(_0x4d6d5c[_0x89d3('0x3c')]){delete _0x4d6d5c[_0x89d3('0x3c')];}_0x32ba73['status'](_0xaf3230)[_0x89d3('0x3d')](_0x4d6d5c);};}exports[_0x89d3('0x3e')]=function(_0x51ad79,_0x26eba4){var _0x27b6b6={'include':[{'model':db[_0x89d3('0x3f')],'as':_0x89d3('0x40')}]},_0x3316cf={},_0x8fc92e={'count':0x0,'rows':[]};var _0x2f7dd2=_[_0x89d3('0x41')](db['SmsAccount']['rawAttributes'],function(_0x1624ec){return{'name':_0x1624ec['fieldName'],'type':_0x1624ec[_0x89d3('0x42')][_0x89d3('0x43')]};});_0x3316cf[_0x89d3('0x44')]=_[_0x89d3('0x41')](_0x2f7dd2,'name');_0x3316cf[_0x89d3('0x45')]=_[_0x89d3('0x46')](_0x51ad79['query']);_0x3316cf[_0x89d3('0x47')]=_[_0x89d3('0x48')](_0x3316cf[_0x89d3('0x44')],_0x3316cf[_0x89d3('0x45')]);_0x27b6b6[_0x89d3('0x49')]=_[_0x89d3('0x48')](_0x3316cf['model'],qs['fields'](_0x51ad79[_0x89d3('0x45')][_0x89d3('0x4a')]));_0x27b6b6[_0x89d3('0x49')]=_0x27b6b6['attributes'][_0x89d3('0x4b')]?_0x27b6b6['attributes']:_0x3316cf[_0x89d3('0x44')];if(!_0x51ad79[_0x89d3('0x45')][_0x89d3('0x4c')](_0x89d3('0x4d'))){_0x27b6b6[_0x89d3('0x2d')]=qs[_0x89d3('0x2d')](_0x51ad79['query'][_0x89d3('0x2d')]);_0x27b6b6[_0x89d3('0x30')]=qs['offset'](_0x51ad79[_0x89d3('0x45')][_0x89d3('0x30')]);}_0x27b6b6[_0x89d3('0x4e')]=qs[_0x89d3('0x4f')](_0x51ad79[_0x89d3('0x45')][_0x89d3('0x4f')]);_0x27b6b6[_0x89d3('0x50')]=qs[_0x89d3('0x47')](_[_0x89d3('0x51')](_0x51ad79[_0x89d3('0x45')],_0x3316cf[_0x89d3('0x47')]),_0x2f7dd2);if(_0x51ad79['query'][_0x89d3('0x52')]){_0x27b6b6['where']=_[_0x89d3('0x53')](_0x27b6b6['where'],{'$or':_[_0x89d3('0x41')](_0x2f7dd2,function(_0x2dd612){if(_0x2dd612[_0x89d3('0x42')]!=='VIRTUAL'){var _0x281fbe={};_0x281fbe[_0x2dd612['name']]={'$like':'%'+_0x51ad79['query']['filter']+'%'};return _0x281fbe;}})});}_0x27b6b6=_[_0x89d3('0x53')]({},_0x27b6b6,_0x51ad79[_0x89d3('0x54')]);var _0xb07c1f={'where':_0x27b6b6[_0x89d3('0x50')]};return db[_0x89d3('0x55')][_0x89d3('0x2f')](_0xb07c1f)[_0x89d3('0x36')](function(_0x277830){_0x8fc92e['count']=_0x277830;if(_0x51ad79[_0x89d3('0x45')][_0x89d3('0x56')]){_0x27b6b6[_0x89d3('0x57')]=[{'all':!![]}];}return db[_0x89d3('0x55')][_0x89d3('0x58')](_0x27b6b6);})[_0x89d3('0x36')](function(_0x3e7c09){_0x8fc92e[_0x89d3('0x59')]=_0x3e7c09;return _0x8fc92e;})[_0x89d3('0x36')](respondWithFilteredResult(_0x26eba4,_0x27b6b6))['catch'](handleError(_0x26eba4,null));};exports[_0x89d3('0x5a')]=function(_0x4a6462,_0x1ab3b8){var _0x34f461={'raw':![],'where':{'id':_0x4a6462[_0x89d3('0x5b')]['id']},'include':[{'model':db[_0x89d3('0x3f')],'as':'mandatoryDispositionPause'}]},_0x44b380={};_0x44b380['model']=_['keys'](db[_0x89d3('0x55')][_0x89d3('0x5c')]);_0x44b380['query']=_[_0x89d3('0x46')](_0x4a6462[_0x89d3('0x45')]);_0x44b380[_0x89d3('0x47')]=_[_0x89d3('0x48')](_0x44b380[_0x89d3('0x44')],_0x44b380[_0x89d3('0x45')]);_0x34f461['attributes']=_[_0x89d3('0x48')](_0x44b380[_0x89d3('0x44')],qs['fields'](_0x4a6462[_0x89d3('0x45')][_0x89d3('0x4a')]));_0x34f461[_0x89d3('0x49')]=_0x34f461['attributes'][_0x89d3('0x4b')]?_0x34f461['attributes']:_0x44b380[_0x89d3('0x44')];if(_0x4a6462['query'][_0x89d3('0x56')]){_0x34f461['include']=[{'all':!![]}];}_0x34f461=_[_0x89d3('0x53')]({},_0x34f461,_0x4a6462[_0x89d3('0x54')]);return db[_0x89d3('0x55')][_0x89d3('0x5d')](_0x34f461)[_0x89d3('0x36')](handleEntityNotFound(_0x1ab3b8,null))[_0x89d3('0x36')](respondWithResult(_0x1ab3b8,null))[_0x89d3('0x5e')](handleError(_0x1ab3b8,null));};exports[_0x89d3('0x5f')]=function(_0x33dd37,_0x170b09){return db[_0x89d3('0x55')][_0x89d3('0x5f')](_0x33dd37[_0x89d3('0x60')],{})['then'](function(_0x428688){var _0x39a8bb=_0x33dd37[_0x89d3('0x61')][_0x89d3('0x38')]({'plain':!![]});if(!_0x39a8bb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39a8bb[_0x89d3('0x62')]===_0x89d3('0x61')){var _0x299592=_0x428688[_0x89d3('0x38')]({'plain':!![]});var _0x4aac2c=_0x89d3('0x39');return db['UserProfileSection'][_0x89d3('0x5d')]({'where':{'name':_0x4aac2c,'userProfileId':_0x39a8bb['userProfileId']},'raw':!![]})[_0x89d3('0x36')](function(_0xc8f971){if(_0xc8f971&&_0xc8f971[_0x89d3('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x299592[_0x89d3('0x3c')],'resourceId':_0x299592['id'],'type':_0xc8f971[_0x89d3('0x3c')],'sectionId':_0xc8f971['id']},{})[_0x89d3('0x36')](function(){return _0x428688;});}else{return _0x428688;}})[_0x89d3('0x5e')](function(_0x350994){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x350994);throw _0x350994;});}return _0x428688;})['then'](respondWithResult(_0x170b09,0xc9))[_0x89d3('0x5e')](handleError(_0x170b09,null));};exports[_0x89d3('0x35')]=function(_0x10e2da,_0xf6bbbb){if(_0x10e2da[_0x89d3('0x60')]['id']){delete _0x10e2da[_0x89d3('0x60')]['id'];}return db[_0x89d3('0x55')][_0x89d3('0x5d')]({'where':{'id':_0x10e2da[_0x89d3('0x5b')]['id']},'include':[{'model':db[_0x89d3('0x3f')],'as':_0x89d3('0x40')}]})[_0x89d3('0x36')](handleEntityNotFound(_0xf6bbbb,null))[_0x89d3('0x36')](saveUpdates(_0x10e2da[_0x89d3('0x60')],null))['then'](respondWithResult(_0xf6bbbb,null))[_0x89d3('0x5e')](handleError(_0xf6bbbb,null));};exports[_0x89d3('0x37')]=function(_0xaaa4f5,_0x33664c){return db[_0x89d3('0x55')][_0x89d3('0x5d')]({'where':{'id':_0xaaa4f5['params']['id']}})[_0x89d3('0x36')](handleEntityNotFound(_0x33664c,null))[_0x89d3('0x36')](removeEntity(_0x33664c,null))[_0x89d3('0x5e')](handleError(_0x33664c,null));};exports[_0x89d3('0x64')]=function(_0x15325d,_0x17e415){return db['SmsAccount']['describe']()[_0x89d3('0x36')](respondWithResult(_0x17e415,null))[_0x89d3('0x5e')](handleError(_0x17e415,null));};exports['addDisposition']=function(_0x401942,_0xe095fe,_0x553492){if(_0x401942[_0x89d3('0x60')]['id']){delete _0x401942[_0x89d3('0x60')]['id'];}return db[_0x89d3('0x55')][_0x89d3('0x5d')]({'where':{'id':_0x401942[_0x89d3('0x5b')]['id']}})[_0x89d3('0x36')](handleEntityNotFound(_0xe095fe,null))[_0x89d3('0x36')](function(_0x126379){if(_0x126379){_0x401942[_0x89d3('0x60')]['SmsAccountId']=_0x126379['id'];return db['Disposition'][_0x89d3('0x5f')](_0x401942[_0x89d3('0x60')]);}})[_0x89d3('0x36')](respondWithResult(_0xe095fe,null))[_0x89d3('0x5e')](handleError(_0xe095fe,null));};exports[_0x89d3('0x65')]=function(_0x1aa111,_0x206277,_0x205e8f){var _0x8fde37={'raw':![],'where':{}};var _0x3b4194={};var _0x2eea9c={'count':0x0,'rows':[]};return db[_0x89d3('0x55')]['findOne']({'where':{'id':_0x1aa111[_0x89d3('0x5b')]['id']}})['then'](handleEntityNotFound(_0x206277,null))[_0x89d3('0x36')](function(_0x20791a){if(_0x20791a){_0x3b4194[_0x89d3('0x44')]=_[_0x89d3('0x46')](db['Disposition'][_0x89d3('0x5c')]);_0x3b4194[_0x89d3('0x45')]=_[_0x89d3('0x46')](_0x1aa111[_0x89d3('0x45')]);_0x3b4194[_0x89d3('0x47')]=_[_0x89d3('0x48')](_0x3b4194['model'],_0x3b4194['query']);_0x8fde37[_0x89d3('0x49')]=_[_0x89d3('0x48')](_0x3b4194[_0x89d3('0x44')],qs[_0x89d3('0x4a')](_0x1aa111[_0x89d3('0x45')][_0x89d3('0x4a')]));_0x8fde37[_0x89d3('0x49')]=_0x8fde37[_0x89d3('0x49')][_0x89d3('0x4b')]?_0x8fde37['attributes']:_0x3b4194['model'];if(!_0x1aa111[_0x89d3('0x45')][_0x89d3('0x4c')](_0x89d3('0x4d'))){_0x8fde37['limit']=qs[_0x89d3('0x2d')](_0x1aa111['query'][_0x89d3('0x2d')]);_0x8fde37['offset']=qs[_0x89d3('0x30')](_0x1aa111[_0x89d3('0x45')][_0x89d3('0x30')]);}_0x8fde37['order']=qs['sort'](_0x1aa111[_0x89d3('0x45')][_0x89d3('0x4f')]);_0x8fde37[_0x89d3('0x50')]=qs[_0x89d3('0x47')](_[_0x89d3('0x51')](_0x1aa111[_0x89d3('0x45')],_0x3b4194[_0x89d3('0x47')]));_0x8fde37['where'][_0x89d3('0x66')]=_0x20791a['id'];if(_0x1aa111[_0x89d3('0x45')][_0x89d3('0x52')]){_0x8fde37[_0x89d3('0x50')]=_[_0x89d3('0x53')](_0x8fde37[_0x89d3('0x50')],{'$or':_[_0x89d3('0x41')](_0x8fde37[_0x89d3('0x49')],function(_0x5e5d5a){var _0xe31491={};_0xe31491[_0x5e5d5a]={'$like':'%'+_0x1aa111[_0x89d3('0x45')][_0x89d3('0x52')]+'%'};return _0xe31491;})});}_0x8fde37=_[_0x89d3('0x53')]({},_0x8fde37,_0x1aa111[_0x89d3('0x54')]);return db[_0x89d3('0x67')][_0x89d3('0x2f')]({'where':_0x8fde37[_0x89d3('0x50')]})[_0x89d3('0x36')](function(_0x2fc263){_0x2eea9c[_0x89d3('0x2f')]=_0x2fc263;if(_0x1aa111[_0x89d3('0x45')][_0x89d3('0x56')]){_0x8fde37['include']=[{'all':!![]}];}return db[_0x89d3('0x67')][_0x89d3('0x58')](_0x8fde37);})[_0x89d3('0x36')](function(_0x3b9844){_0x2eea9c[_0x89d3('0x59')]=_0x3b9844;return _0x2eea9c;});}})[_0x89d3('0x36')](respondWithFilteredResult(_0x206277,_0x8fde37))[_0x89d3('0x5e')](handleError(_0x206277,null));};exports[_0x89d3('0x68')]=function(_0x55e1e4,_0x1c991b,_0x3fa3d9){return db[_0x89d3('0x55')][_0x89d3('0x5d')]({'where':{'id':_0x55e1e4[_0x89d3('0x5b')]['id']}})[_0x89d3('0x36')](handleEntityNotFound(_0x1c991b,null))[_0x89d3('0x36')](function(_0x10a4ae){if(_0x10a4ae){return _0x10a4ae[_0x89d3('0x68')](_0x55e1e4[_0x89d3('0x45')][_0x89d3('0x69')]);}})[_0x89d3('0x36')](respondWithStatusCode(_0x1c991b,null))['catch'](handleError(_0x1c991b,null));};exports[_0x89d3('0x6a')]=function(_0x1f87a1,_0x537f5f,_0x2cbc5f){if(_0x1f87a1[_0x89d3('0x60')]['id']){delete _0x1f87a1[_0x89d3('0x60')]['id'];}return db['SmsAccount'][_0x89d3('0x5d')]({'where':{'id':_0x1f87a1['params']['id']}})[_0x89d3('0x36')](handleEntityNotFound(_0x537f5f,null))[_0x89d3('0x36')](function(_0x1be3ee){if(_0x1be3ee){_0x1f87a1[_0x89d3('0x60')]['SmsAccountId']=_0x1be3ee['id'];return db[_0x89d3('0x6b')]['create'](_0x1f87a1[_0x89d3('0x60')]);}})[_0x89d3('0x36')](respondWithResult(_0x537f5f,null))[_0x89d3('0x5e')](handleError(_0x537f5f,null));};exports[_0x89d3('0x6c')]=function(_0x3bd434,_0x39c54a,_0x3d9722){var _0x3baef4={'raw':![],'where':{}};var _0x58ed9d={};var _0xbe6ad6={'count':0x0,'rows':[]};return db[_0x89d3('0x55')][_0x89d3('0x6d')]({'where':{'id':_0x3bd434[_0x89d3('0x5b')]['id']}})['then'](handleEntityNotFound(_0x39c54a,null))['then'](function(_0x3dce71){if(_0x3dce71){_0x58ed9d[_0x89d3('0x44')]=_['keys'](db['CannedAnswer'][_0x89d3('0x5c')]);_0x58ed9d[_0x89d3('0x45')]=_[_0x89d3('0x46')](_0x3bd434[_0x89d3('0x45')]);_0x58ed9d['filters']=_['intersection'](_0x58ed9d['model'],_0x58ed9d[_0x89d3('0x45')]);_0x3baef4[_0x89d3('0x49')]=_['intersection'](_0x58ed9d[_0x89d3('0x44')],qs[_0x89d3('0x4a')](_0x3bd434[_0x89d3('0x45')][_0x89d3('0x4a')]));_0x3baef4[_0x89d3('0x49')]=_0x3baef4[_0x89d3('0x49')][_0x89d3('0x4b')]?_0x3baef4[_0x89d3('0x49')]:_0x58ed9d[_0x89d3('0x44')];if(!_0x3bd434['query'][_0x89d3('0x4c')](_0x89d3('0x4d'))){_0x3baef4[_0x89d3('0x2d')]=qs[_0x89d3('0x2d')](_0x3bd434[_0x89d3('0x45')][_0x89d3('0x2d')]);_0x3baef4[_0x89d3('0x30')]=qs[_0x89d3('0x30')](_0x3bd434[_0x89d3('0x45')][_0x89d3('0x30')]);}_0x3baef4[_0x89d3('0x4e')]=qs[_0x89d3('0x4f')](_0x3bd434['query'][_0x89d3('0x4f')]);_0x3baef4['where']=qs[_0x89d3('0x47')](_['pick'](_0x3bd434[_0x89d3('0x45')],_0x58ed9d[_0x89d3('0x47')]));_0x3baef4['where'][_0x89d3('0x66')]=_0x3dce71['id'];if(_0x3bd434[_0x89d3('0x45')][_0x89d3('0x52')]){_0x3baef4['where']=_[_0x89d3('0x53')](_0x3baef4[_0x89d3('0x50')],{'$or':_['map'](_0x3baef4[_0x89d3('0x49')],function(_0x574dfb){var _0x3f5f2e={};_0x3f5f2e[_0x574dfb]={'$like':'%'+_0x3bd434[_0x89d3('0x45')][_0x89d3('0x52')]+'%'};return _0x3f5f2e;})});}_0x3baef4=_[_0x89d3('0x53')]({},_0x3baef4,_0x3bd434[_0x89d3('0x54')]);return db[_0x89d3('0x6b')]['count']({'where':_0x3baef4['where']})[_0x89d3('0x36')](function(_0x306115){_0xbe6ad6['count']=_0x306115;if(_0x3bd434[_0x89d3('0x45')]['includeAll']){_0x3baef4['include']=[{'all':!![]}];}return db[_0x89d3('0x6b')][_0x89d3('0x58')](_0x3baef4);})[_0x89d3('0x36')](function(_0x203080){_0xbe6ad6[_0x89d3('0x59')]=_0x203080;return _0xbe6ad6;});}})[_0x89d3('0x36')](respondWithFilteredResult(_0x39c54a,_0x3baef4))[_0x89d3('0x5e')](handleError(_0x39c54a,null));};exports[_0x89d3('0x6e')]=function(_0x3a7428,_0x5ae34d,_0x38f095){return db[_0x89d3('0x55')][_0x89d3('0x5d')]({'where':{'id':_0x3a7428[_0x89d3('0x5b')]['id']}})[_0x89d3('0x36')](handleEntityNotFound(_0x5ae34d,null))[_0x89d3('0x36')](function(_0x1e0b67){if(_0x1e0b67){return _0x1e0b67[_0x89d3('0x6e')](_0x3a7428[_0x89d3('0x45')][_0x89d3('0x69')]);}})[_0x89d3('0x36')](respondWithStatusCode(_0x5ae34d,null))[_0x89d3('0x5e')](handleError(_0x5ae34d,null));};exports[_0x89d3('0x6f')]=function(_0x55fff6,_0x2fd307,_0x33c347){var _0x35ca27={'channel':_0x89d3('0x70')};var _0x405fd8=[];var _0x3b5d14=[];var _0x41071a={};return db['SmsAccount'][_0x89d3('0x5d')]({'where':{'id':_0x55fff6['params']['id']},'include':[{'model':db[_0x89d3('0x71')],'as':_0x89d3('0x72')}]})[_0x89d3('0x36')](handleEntityNotFound(_0x2fd307,null))[_0x89d3('0x36')](function(_0x54096e){_0x35ca27[_0x89d3('0x73')]=_0x54096e;_0x35ca27[_0x89d3('0x74')]=_['orderBy'](_0x54096e['Applications'],['priority'],[_0x89d3('0x75')]);if(_0x35ca27[_0x89d3('0x73')][_0x89d3('0x72')]){delete _0x35ca27[_0x89d3('0x73')][_0x89d3('0x72')];}return db[_0x89d3('0x76')][_0x89d3('0x64')]();})[_0x89d3('0x36')](function(_0x45bb1d){if(!_0x45bb1d){throw new db[(_0x89d3('0x77'))]['ValidationError'](_0x89d3('0x78'));}_0x405fd8=_[_0x89d3('0x79')](_[_0x89d3('0x46')](_0x45bb1d),[_0x89d3('0x7a'),_0x89d3('0x7b')]);_0x3b5d14=_[_0x89d3('0x79')](_[_0x89d3('0x46')](_0x45bb1d),[_0x89d3('0x7a'),_0x89d3('0x7b'),_0x89d3('0x7c'),_0x89d3('0x7d')]);_0x35ca27[_0x89d3('0x60')]={'mapKey':'mobile'};if(_0x35ca27[_0x89d3('0x73')][_0x89d3('0x42')]){switch(_0x35ca27[_0x89d3('0x73')][_0x89d3('0x42')]){case _0x89d3('0x7e'):_0x35ca27[_0x89d3('0x60')]['from']=_0x55fff6[_0x89d3('0x60')][_0x89d3('0x7f')];_0x35ca27[_0x89d3('0x60')][_0x89d3('0x60')]=_0x55fff6[_0x89d3('0x60')][_0x89d3('0x80')];_0x35ca27[_0x89d3('0x60')]['messageId']=_0x55fff6['body']['MessageSid'];break;case _0x89d3('0x81'):_0x35ca27[_0x89d3('0x60')][_0x89d3('0x82')]='+'+_0x55fff6['body'][_0x89d3('0x83')];_0x35ca27[_0x89d3('0x60')][_0x89d3('0x60')]=_0x55fff6[_0x89d3('0x60')][_0x89d3('0x84')];break;case'connectel':_0x35ca27[_0x89d3('0x60')]['from']=_0x55fff6[_0x89d3('0x60')]['from'];_0x35ca27[_0x89d3('0x60')]['body']=_0x55fff6[_0x89d3('0x60')][_0x89d3('0x28')];break;case _0x89d3('0x85'):_0x35ca27[_0x89d3('0x60')][_0x89d3('0x82')]=_0x55fff6[_0x89d3('0x60')][_0x89d3('0x82')];_0x35ca27[_0x89d3('0x60')][_0x89d3('0x60')]=_0x55fff6[_0x89d3('0x60')][_0x89d3('0x60')];_0x35ca27[_0x89d3('0x60')][_0x89d3('0x86')]=_0x55fff6[_0x89d3('0x60')][_0x89d3('0x87')];break;case'plivo':_0x35ca27[_0x89d3('0x60')][_0x89d3('0x82')]=_0x55fff6['body']['From'];_0x35ca27['body'][_0x89d3('0x60')]=_0x55fff6[_0x89d3('0x60')]['Text'];_0x35ca27['body'][_0x89d3('0x86')]=_0x55fff6[_0x89d3('0x60')][_0x89d3('0x88')];break;case'infobip':_0x35ca27['body']['from']='+'+_0x55fff6[_0x89d3('0x60')]['results'][0x0][_0x89d3('0x82')];_0x35ca27[_0x89d3('0x60')][_0x89d3('0x60')]=_0x55fff6[_0x89d3('0x60')][_0x89d3('0x89')][0x0][_0x89d3('0x84')];_0x35ca27['body'][_0x89d3('0x86')]=_0x55fff6[_0x89d3('0x60')]['results'][0x0]['messageId'];break;case _0x89d3('0x8a'):_0x35ca27[_0x89d3('0x60')][_0x89d3('0x82')]=_0x55fff6[_0x89d3('0x60')][_0x89d3('0x8b')];_0x35ca27[_0x89d3('0x60')][_0x89d3('0x60')]=_0x55fff6[_0x89d3('0x60')][_0x89d3('0x8c')][_0x89d3('0x28')];break;case _0x89d3('0x8d'):_0x35ca27[_0x89d3('0x60')][_0x89d3('0x82')]=_0x55fff6['body'][_0x89d3('0x8e')];_0x35ca27[_0x89d3('0x60')][_0x89d3('0x60')]=_0x55fff6[_0x89d3('0x60')][_0x89d3('0x84')];_0x35ca27[_0x89d3('0x60')][_0x89d3('0x86')]=_0x55fff6[_0x89d3('0x60')][_0x89d3('0x8f')];break;case'bandwidth':_0x35ca27[_0x89d3('0x60')][_0x89d3('0x86')]=_0x55fff6[_0x89d3('0x60')][0x0][_0x89d3('0x28')]['id'];_0x35ca27[_0x89d3('0x60')][_0x89d3('0x82')]=_0x55fff6[_0x89d3('0x60')][0x0][_0x89d3('0x28')]['from'];_0x35ca27['body']['body']=_0x55fff6[_0x89d3('0x60')][0x0][_0x89d3('0x28')][_0x89d3('0x84')];break;case _0x89d3('0x90'):_0x35ca27['body']['from']=_0x55fff6[_0x89d3('0x60')]['from'];_0x35ca27[_0x89d3('0x60')][_0x89d3('0x60')]=_0x55fff6[_0x89d3('0x60')][_0x89d3('0x28')];_0x35ca27[_0x89d3('0x60')]['messageId']=_0x55fff6[_0x89d3('0x60')][_0x89d3('0x91')];break;}}if(_0x35ca27[_0x89d3('0x60')]['id']){delete _0x35ca27['body']['id'];}if(_[_0x89d3('0x92')](_0x35ca27['body'][_0x89d3('0x82')])){throw new db[(_0x89d3('0x77'))][(_0x89d3('0x93'))]('from\x20is\x20mandatory');}if(_[_0x89d3('0x92')](_0x35ca27[_0x89d3('0x60')][_0x89d3('0x60')])||_0x35ca27[_0x89d3('0x60')][_0x89d3('0x60')]===''){throw new db[(_0x89d3('0x77'))][(_0x89d3('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x89d3('0x92')](_0x35ca27['body']['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3b5d14);}if(!_[_0x89d3('0x94')](_0x3b5d14,_0x35ca27[_0x89d3('0x60')][_0x89d3('0x95')])){throw new db[(_0x89d3('0x77'))][(_0x89d3('0x93'))](_0x89d3('0x96')+_0x3b5d14);}_0x41071a[_0x35ca27[_0x89d3('0x60')][_0x89d3('0x95')]]=_0x35ca27['body'][_0x89d3('0x82')];return db[_0x89d3('0x97')][_0x89d3('0x5d')]({'where':{'id':_0x35ca27[_0x89d3('0x73')][_0x89d3('0x7d')]},'include':[{'model':db['CmContact'],'as':_0x89d3('0x98'),'where':_0x41071a,'limit':0x1,'order':[[_0x89d3('0x7b'),'DESC']]}]});})[_0x89d3('0x36')](handleEntityNotFound(_0x2fd307,null))[_0x89d3('0x36')](function(_0x10ea94){if(_0x10ea94){_0x35ca27[_0x89d3('0x99')]=_[_0x89d3('0x9a')](_0x10ea94,['Contacts']);if(_0x10ea94[_0x89d3('0x98')][_0x89d3('0x4b')]){return _0x10ea94[_0x89d3('0x98')][0x0];}var _0x5264d6=_[_0x89d3('0x19')](_0x35ca27[_0x89d3('0x60')],{'firstName':_0x35ca27['body']['from'],'ListId':_0x10ea94['id']});_0x5264d6[_0x35ca27[_0x89d3('0x60')][_0x89d3('0x95')]]=_0x35ca27['body'][_0x89d3('0x82')];return db['CmContact'][_0x89d3('0x5f')](_0x5264d6,{'fields':_0x405fd8,'raw':!![]});}})[_0x89d3('0x36')](handleEntityNotFound(_0x2fd307,null))['then'](function(_0x4481d4){if(_0x4481d4){_0x35ca27[_0x89d3('0x9b')]=_0x4481d4;var _0x400023={'ContactId':_0x4481d4['id'],'phone':_0x35ca27[_0x89d3('0x60')][_0x89d3('0x82')],'SmsAccountId':_0x55fff6['params']['id']};var _0x462d82={'ContactId':_0x4481d4['id'],'SmsAccountId':_0x55fff6['params']['id'],'closed':![]};return db['SmsInteraction'][_0x89d3('0x5d')]({'where':_0x462d82})['then'](function(_0x5a17fc){if(_0x5a17fc){return[_0x5a17fc,![]];}return db[_0x89d3('0x9c')][_0x89d3('0x5f')](_0x400023)[_0x89d3('0x36')](function(_0x285bd1){return[_0x285bd1,!![]];});});}})['spread'](function(_0x1dab03,_0x4f7339){_0x35ca27[_0x89d3('0x9d')]=_0x1dab03[_0x89d3('0x38')]({'plain':!![]});_0x35ca27[_0x89d3('0x9d')][_0x89d3('0x9e')]=![];if(_0x4f7339){if(_0x35ca27[_0x89d3('0x73')][_0x89d3('0x9f')]){_0x35ca27[_0x89d3('0x74')][_0x89d3('0xa0')]({'id':0x0,'priority':_0x35ca27['applications'][_0x89d3('0x4b')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}_0x35ca27[_0x89d3('0x9d')][_0x89d3('0x9e')]=!![];}return db[_0x89d3('0xa1')][_0x89d3('0x5f')]({'phone':_0x35ca27[_0x89d3('0x60')]['from'],'messageId':_0x35ca27[_0x89d3('0x60')][_0x89d3('0x86')],'body':_0x35ca27[_0x89d3('0x60')][_0x89d3('0x60')],'SmsAccountId':_0x55fff6[_0x89d3('0x5b')]['id'],'SmsInteractionId':_0x1dab03['id'],'direction':'in','ContactId':_0x1dab03[_0x89d3('0xa2')],'AttachmentId':_0x35ca27[_0x89d3('0x60')][_0x89d3('0xa3')]});})[_0x89d3('0x36')](function(_0x4334f4){_0x35ca27[_0x89d3('0x28')]=_0x4334f4;if(_0x35ca27[_0x89d3('0x9d')][_0x89d3('0xa4')]){return db[_0x89d3('0xa5')]['find']({'attributes':['id',_0x89d3('0x3c')],'where':{'id':_0x35ca27[_0x89d3('0x9d')][_0x89d3('0xa4')]}})[_0x89d3('0x36')](function(_0x43e020){if(_0x43e020){_0x35ca27[_0x89d3('0x74')][_0x89d3('0xa6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x43e020[_0x89d3('0x3c')]+','+(_0x35ca27[_0x89d3('0x73')]['waitForTheAssignedAgent']||0xa),'interval':_0x89d3('0xa7')});}return respondWithRpcPromise('Start',_0x89d3('0xa8'),_0x35ca27);});}return respondWithRpcPromise(_0x89d3('0xa9'),'startRouting',_0x35ca27);})[_0x89d3('0x36')](function(_0x220ab8){if(_0x220ab8){var _0x4ab00e=0xc8;var _0xc19def=_0x89d3('0xaa');logger[_0x89d3('0x21')](_0x89d3('0x24'),_0xc19def,_0x4ab00e,'entity\x20found');logger[_0x89d3('0xab')](_0x89d3('0xac'),_0xc19def,_0x4ab00e,_0x89d3('0xad'),JSON[_0x89d3('0x25')](_0x220ab8));if(_0x35ca27[_0x89d3('0x73')][_0x89d3('0x42')]===_0x89d3('0x7e')){return _0x2fd307[_0x89d3('0x2b')](_0x4ab00e)['set'](_0x89d3('0xae'),'text/xml')[_0x89d3('0x3d')](_0x89d3('0xaf'));}else{return _0x2fd307['status'](_0x4ab00e)['json'](_0x220ab8);}}})['catch'](handleError(_0x2fd307,null));};exports['addApplications']=function(_0x198af0,_0x5de304){var _0x29917b=_0x198af0[_0x89d3('0x5b')]['id'];var _0x260d9c=_0x198af0[_0x89d3('0x60')];var _0x45800c=0xc8;var _0x1c7103=null;return db[_0x89d3('0xb0')][_0x89d3('0xb1')]({'isolationLevel':db[_0x89d3('0xb0')][_0x89d3('0xb2')][_0x89d3('0xb3')][_0x89d3('0xb4')]},function(_0x4197a9){return db[_0x89d3('0x55')][_0x89d3('0x6d')]({'where':{'id':_0x29917b},'transaction':_0x4197a9})['then'](function(_0x42dd13){if(_0x42dd13){return db[_0x89d3('0x71')][_0x89d3('0x37')]({'where':{'SmsAccountId':_0x29917b},'transaction':_0x4197a9})[_0x89d3('0x36')](function(){var _0x439eb8=_[_0x89d3('0x41')](_0x260d9c,function(_0x545bd5){_0x545bd5['SmsAccountId']=_0x29917b;return _0x545bd5;});return db[_0x89d3('0x71')]['bulkCreate'](_0x439eb8,{'transaction':_0x4197a9});});}else{_0x45800c=0x194;_0x1c7103=[];}});})[_0x89d3('0x36')](function(){if(_0x45800c!==0x194){return db[_0x89d3('0x71')][_0x89d3('0xb5')]({'where':{'SmsAccountId':_0x29917b},'order':_0x89d3('0xb6')})['then'](function(_0x45ddf5){_0x1c7103=_0x45ddf5;});}})[_0x89d3('0x5e')](function(_0x4dbdac){_0x45800c=0x1f4;logger[_0x89d3('0x26')](_0x4dbdac[_0x89d3('0x3b')]);if(_0x4dbdac[_0x89d3('0x3c')]){delete _0x4dbdac[_0x89d3('0x3c')];}_0x1c7103=_0x4dbdac;})[_0x89d3('0xb7')](function(){if(_0x1c7103===null){_0x5de304[_0x89d3('0x2a')](_0x45800c);}else{if(_0x45800c===0x1f4){_0x5de304[_0x89d3('0x2b')](_0x45800c)[_0x89d3('0x3d')](_0x1c7103);}else{_0x5de304['status'](_0x45800c)['json'](_0x1c7103);}}});};exports[_0x89d3('0xb8')]=function(_0x54584d,_0x1f9392,_0x24b5ba){var _0x143c7b={};var _0x556eb3={};var _0x378b6f;var _0x4be9e3;return db[_0x89d3('0x55')][_0x89d3('0x6d')]({'where':{'id':_0x54584d[_0x89d3('0x5b')]['id']}})[_0x89d3('0x36')](handleEntityNotFound(_0x1f9392,null))['then'](function(_0x2e3e3b){if(_0x2e3e3b){_0x378b6f=_0x2e3e3b;_0x556eb3[_0x89d3('0x44')]=_[_0x89d3('0x46')](db[_0x89d3('0x71')][_0x89d3('0x5c')]);_0x556eb3[_0x89d3('0x45')]=_[_0x89d3('0x46')](_0x54584d['query']);_0x556eb3['filters']=_['intersection'](_0x556eb3[_0x89d3('0x44')],_0x556eb3[_0x89d3('0x45')]);_0x143c7b['attributes']=_['intersection'](_0x556eb3[_0x89d3('0x44')],qs[_0x89d3('0x4a')](_0x54584d[_0x89d3('0x45')]['fields']));_0x143c7b[_0x89d3('0x49')]=_0x143c7b[_0x89d3('0x49')][_0x89d3('0x4b')]?_0x143c7b[_0x89d3('0x49')]:_0x556eb3['model'];_0x143c7b['order']=qs['sort'](_0x54584d[_0x89d3('0x45')][_0x89d3('0x4f')]);_0x143c7b[_0x89d3('0x50')]=qs[_0x89d3('0x47')](_[_0x89d3('0x51')](_0x54584d['query'],_0x556eb3[_0x89d3('0x47')]));if(_0x54584d[_0x89d3('0x45')][_0x89d3('0x52')]){_0x143c7b[_0x89d3('0x50')]=_[_0x89d3('0x53')](_0x143c7b[_0x89d3('0x50')],{'$or':_[_0x89d3('0x41')](_0x143c7b['attributes'],function(_0x37de39){var _0x14587c={};_0x14587c[_0x37de39]={'$like':'%'+_0x54584d[_0x89d3('0x45')][_0x89d3('0x52')]+'%'};return _0x14587c;})});}_0x143c7b=_[_0x89d3('0x53')]({},_0x143c7b,_0x54584d[_0x89d3('0x54')]);return _0x378b6f[_0x89d3('0xb8')](_0x143c7b);}})[_0x89d3('0x36')](function(_0x15181f){if(_0x15181f){_0x4be9e3=_0x15181f['length'];if(!_0x54584d[_0x89d3('0x45')][_0x89d3('0x4c')]('nolimit')){_0x143c7b['limit']=qs[_0x89d3('0x2d')](_0x54584d['query'][_0x89d3('0x2d')]);_0x143c7b[_0x89d3('0x30')]=qs[_0x89d3('0x30')](_0x54584d[_0x89d3('0x45')][_0x89d3('0x30')]);}return _0x378b6f[_0x89d3('0xb8')](_0x143c7b);}})[_0x89d3('0x36')](function(_0x49a645){if(_0x49a645){return _0x49a645?{'count':_0x4be9e3,'rows':_0x49a645}:null;}})[_0x89d3('0x36')](respondWithResult(_0x1f9392,null))['catch'](handleError(_0x1f9392,null));};exports['getInteractions']=function(_0x4e13a7,_0xbc7cd4,_0x3a0c58){var _0x19dc14={'raw':![],'where':{}};var _0x16aca1={};var _0x242ec2={'count':0x0,'rows':[]};return db[_0x89d3('0x55')]['findOne']({'where':{'id':_0x4e13a7['params']['id']}})[_0x89d3('0x36')](handleEntityNotFound(_0xbc7cd4,null))[_0x89d3('0x36')](function(_0x1c1ca8){if(_0x1c1ca8){_0x16aca1['model']=_[_0x89d3('0x46')](db[_0x89d3('0x9c')][_0x89d3('0x5c')]);_0x16aca1['query']=_[_0x89d3('0x46')](_0x4e13a7[_0x89d3('0x45')]);_0x16aca1[_0x89d3('0x47')]=_[_0x89d3('0x48')](_0x16aca1[_0x89d3('0x44')],_0x16aca1[_0x89d3('0x45')]);_0x19dc14[_0x89d3('0x49')]=_['intersection'](_0x16aca1['model'],qs[_0x89d3('0x4a')](_0x4e13a7[_0x89d3('0x45')][_0x89d3('0x4a')]));_0x19dc14['attributes']=_0x19dc14[_0x89d3('0x49')][_0x89d3('0x4b')]?_0x19dc14[_0x89d3('0x49')]:_0x16aca1[_0x89d3('0x44')];if(!_0x4e13a7[_0x89d3('0x45')][_0x89d3('0x4c')](_0x89d3('0x4d'))){_0x19dc14['limit']=qs['limit'](_0x4e13a7[_0x89d3('0x45')][_0x89d3('0x2d')]);_0x19dc14[_0x89d3('0x30')]=qs[_0x89d3('0x30')](_0x4e13a7[_0x89d3('0x45')]['offset']);}_0x19dc14[_0x89d3('0x4e')]=qs['sort'](_0x4e13a7['query'][_0x89d3('0x4f')]);_0x19dc14[_0x89d3('0x50')]=qs[_0x89d3('0x47')](_[_0x89d3('0x51')](_0x4e13a7[_0x89d3('0x45')],_0x16aca1['filters']));_0x19dc14[_0x89d3('0x50')]['SmsAccountId']=_0x1c1ca8['id'];if(_0x4e13a7[_0x89d3('0x45')][_0x89d3('0x52')]){_0x19dc14[_0x89d3('0x50')]=_[_0x89d3('0x53')](_0x19dc14['where'],{'$or':_[_0x89d3('0x41')](_0x19dc14[_0x89d3('0x49')],function(_0x23e968){var _0x2fb609={};_0x2fb609[_0x23e968]={'$like':'%'+_0x4e13a7[_0x89d3('0x45')][_0x89d3('0x52')]+'%'};return _0x2fb609;})});}_0x19dc14=_['merge']({},_0x19dc14,_0x4e13a7[_0x89d3('0x54')]);return db[_0x89d3('0x9c')]['count']({'where':_0x19dc14['where']})[_0x89d3('0x36')](function(_0x48d6ec){_0x242ec2[_0x89d3('0x2f')]=_0x48d6ec;if(_0x4e13a7['query'][_0x89d3('0x56')]){_0x19dc14[_0x89d3('0x57')]=[{'model':db[_0x89d3('0x76')],'as':'Contact','required':![]},{'model':db[_0x89d3('0xa5')],'as':_0x89d3('0xb9'),'attributes':[_0x89d3('0x3c'),_0x89d3('0xba'),_0x89d3('0xbb')],'required':![]},{'model':db['Tag'],'as':_0x89d3('0xbc'),'attributes':['id','name',_0x89d3('0xbd')],'where':_0x4e13a7[_0x89d3('0x45')]['tag']?{'id':_0x4e13a7[_0x89d3('0x45')][_0x89d3('0xbe')]}:undefined,'required':_0x4e13a7[_0x89d3('0x45')]['tag']?!![]:![]}];}return db['SmsInteraction'][_0x89d3('0x58')](_0x19dc14);})[_0x89d3('0x36')](function(_0xb37edc){_0x242ec2['rows']=_0xb37edc;return _0x242ec2;});}})[_0x89d3('0x36')](respondWithFilteredResult(_0xbc7cd4,_0x19dc14))[_0x89d3('0x5e')](handleError(_0xbc7cd4,null));};exports[_0x89d3('0x3d')]=function(_0x407ce2,_0x241c3a,_0x5bb0a8){var _0x514ec8,_0x2ce4af,_0x468c73;if(_[_0x89d3('0x92')](_0x407ce2[_0x89d3('0x60')][_0x89d3('0x60')])||_0x407ce2[_0x89d3('0x60')][_0x89d3('0x60')]===''){throw new db[(_0x89d3('0x77'))][(_0x89d3('0x93'))](_0x89d3('0xbf'));}if(_[_0x89d3('0x92')](_0x407ce2['body']['to'])){throw new db[(_0x89d3('0x77'))][(_0x89d3('0x93'))]('to\x20is\x20mandatory');}_0x514ec8=_0x407ce2[_0x89d3('0x60')]['to'];return db['SmsAccount']['find']({'where':{'id':_0x407ce2[_0x89d3('0x5b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x89d3('0x76')],'as':_0x89d3('0x98'),'where':{'mobile':_0x514ec8},'limit':0x1,'order':[[_0x89d3('0x7b'),_0x89d3('0xc0')]]}]}]})[_0x89d3('0x36')](handleEntityNotFound(_0x241c3a,null))[_0x89d3('0x36')](function(_0xb89808){if(_0xb89808&&_0xb89808['List']){_0x2ce4af=_0xb89808['get']({'plain':!![]});if(_0x2ce4af[_0x89d3('0xc1')]&&_0x2ce4af[_0x89d3('0xc1')]['Contacts'][_0x89d3('0x4b')]){return _0x2ce4af[_0x89d3('0xc1')][_0x89d3('0x98')][0x0];}return db['CmContact']['create'](_[_0x89d3('0x19')](_0x407ce2[_0x89d3('0x60')],{'firstName':_0x514ec8,'mobile':_0x514ec8,'phone':_0x514ec8,'ListId':_0x2ce4af[_0x89d3('0x7d')]}));}})[_0x89d3('0x36')](handleEntityNotFound(_0x241c3a,null))[_0x89d3('0x36')](function(_0x1348ae){if(_0x1348ae){_0x468c73=_0x1348ae;return db[_0x89d3('0x9c')]['find']({'where':{'ContactId':_0x468c73['id'],'closed':![],'SmsAccountId':_0x2ce4af['id']}})[_0x89d3('0x36')](function(_0x54a811){if(_0x54a811){return[_0x54a811,![]];}return db[_0x89d3('0x9c')][_0x89d3('0x5f')]({'UserId':_0x407ce2[_0x89d3('0x61')]['id'],'ContactId':_0x468c73['id'],'SmsAccountId':_0x2ce4af['id'],'phone':_0x514ec8,'firstMsgDirection':_0x89d3('0xc2'),'Messages':[_['merge'](_0x407ce2['body'],{'read':![],'body':_0x407ce2[_0x89d3('0x60')]['body'],'phone':_0x514ec8,'SmsAccountId':_0x2ce4af['id'],'UserId':_0x407ce2[_0x89d3('0x61')]['id'],'ContactId':_0x468c73['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0x89d3('0x36')](function(_0xc194cf){return[_0xc194cf,!![]];});});}})[_0x89d3('0xc3')](function(_0x3d4e94,_0x44bff7){if(_0x44bff7){return _0x3d4e94;}return db['SmsMessage']['create'](_[_0x89d3('0x53')](_0x407ce2['body'],{'read':![],'body':_0x407ce2[_0x89d3('0x60')][_0x89d3('0x60')],'phone':_0x514ec8,'SmsAccountId':_0x2ce4af['id'],'SmsInteractionId':_0x3d4e94['id'],'UserId':_0x407ce2[_0x89d3('0x61')]['id'],'ContactId':_0x468c73['id']}))[_0x89d3('0x36')](function(_0x380cf4){_0x3d4e94[_0x89d3('0xc4')][_0x89d3('0xc5')]=[];_0x3d4e94[_0x89d3('0xc4')][_0x89d3('0xc5')][_0x89d3('0xa0')](_0x380cf4[_0x89d3('0xc4')]);return _0x3d4e94;});})['then'](respondWithResult(_0x241c3a,null))[_0x89d3('0x5e')](handleError(_0x241c3a,null));};exports[_0x89d3('0x2b')]=function(_0x29820a,_0xcb001e,_0x7276bd){if(_0x29820a[_0x89d3('0x60')]['id']){delete _0x29820a[_0x89d3('0x60')]['id'];}var _0x5a2126,_0x98e727,_0x590c7b;return db[_0x89d3('0x55')]['find']({'where':{'id':_0x29820a[_0x89d3('0x5b')]['id']}})[_0x89d3('0x36')](handleEntityNotFound(_0xcb001e,null))['then'](function(_0x1b7d0e){if(_0x1b7d0e){_0x590c7b=_0x1b7d0e;logger[_0x89d3('0xab')](_0x89d3('0x24'),'status','received\x20delivery\x20report\x20from',_0x1b7d0e['type'],util['inspect'](_0x29820a[_0x89d3('0x60')],{'showHidden':![],'depth':null}));switch(_0x1b7d0e[_0x89d3('0x42')]){case _0x89d3('0x81'):if(_0x29820a[_0x89d3('0x60')][_0x89d3('0xc6')]&&_0x29820a[_0x89d3('0x60')][_0x89d3('0x2b')]){_0x98e727=_0x29820a['body'][_0x89d3('0x2b')];return db[_0x89d3('0xa1')][_0x89d3('0x5d')]({'where':{'messageId':_0x29820a[_0x89d3('0x60')]['skebby_dispatch_id']}});}break;case _0x89d3('0xc7'):if(_0x29820a[_0x89d3('0x60')][_0x89d3('0xc8')]&&_0x29820a[_0x89d3('0x60')][_0x89d3('0xc9')]){_0x98e727=_0x29820a[_0x89d3('0x60')][_0x89d3('0xc9')];return db['SmsMessage'][_0x89d3('0x5d')]({'where':{'messageId':_0x29820a[_0x89d3('0x60')][_0x89d3('0xc8')]}});}break;case _0x89d3('0x85'):if(_0x29820a[_0x89d3('0x60')]['message_id']&&_0x29820a['body'][_0x89d3('0xca')]){_0x98e727=_0x29820a[_0x89d3('0x60')][_0x89d3('0xca')];return db[_0x89d3('0xa1')]['find']({'where':{'messageId':_0x29820a[_0x89d3('0x60')][_0x89d3('0x87')]}});}break;case _0x89d3('0xcb'):var _0x5a4fe8=_0x29820a[_0x89d3('0x60')]['results'][0x0];if(_0x5a4fe8[_0x89d3('0x86')]&&_0x5a4fe8['status']['groupName']===_0x89d3('0xcc')){_0x98e727=_0x5a4fe8['status'][_0x89d3('0xcd')];return db['SmsMessage'][_0x89d3('0x5d')]({'where':{'messageId':_0x5a4fe8['messageId']}});}break;case _0x89d3('0x8d'):if(_0x29820a[_0x89d3('0x60')][_0x89d3('0x86')]&&_0x29820a['body'][_0x89d3('0x2b')]){_0x98e727=_0x29820a[_0x89d3('0x60')][_0x89d3('0x2b')];return db[_0x89d3('0xa1')][_0x89d3('0x5d')]({'where':{'messageId':_0x29820a[_0x89d3('0x60')][_0x89d3('0x86')]}});}break;case'bandwidth':if(_0x29820a[_0x89d3('0x60')][0x0][_0x89d3('0x28')]['id']){_0x98e727=_0x29820a[_0x89d3('0x60')][0x0][_0x89d3('0x42')];return db[_0x89d3('0xa1')][_0x89d3('0x5d')]({'where':{'messageId':_0x29820a[_0x89d3('0x60')][0x0][_0x89d3('0x28')]['id']}});}break;case _0x89d3('0x90'):if(_0x29820a[_0x89d3('0x60')][_0x89d3('0xce')]&&_0x29820a['body'][_0x89d3('0x2b')]){_0x98e727=_0x29820a[_0x89d3('0x60')][_0x89d3('0x2b')];return db['SmsMessage'][_0x89d3('0x5d')]({'where':{'messageId':_0x29820a[_0x89d3('0x60')]['redif']}});}break;}}})[_0x89d3('0x36')](handleEntityNotFound(_0xcb001e,null))[_0x89d3('0x36')](function(_0x1b7a49){if(_0x1b7a49){_0x5a2126=_0x1b7a49;switch(_0x590c7b[_0x89d3('0x42')]){case'skebby':if(_0x98e727===_0x89d3('0xcc')){return _0x5a2126['update']({'read':!![]});}else{logger[_0x89d3('0x26')](_0x89d3('0x24'),_0x89d3('0x2b'),_0x89d3('0x81'),util[_0x89d3('0xcf')](_0x29820a[_0x89d3('0x60')],{'showHidden':![],'depth':null}));}break;case _0x89d3('0xc7'):if(_0x98e727==='1'){return _0x5a2126['update']({'read':!![]});}else{logger[_0x89d3('0x26')](_0x89d3('0x24'),_0x89d3('0x2b'),'skebby',util[_0x89d3('0xcf')](_0x29820a[_0x89d3('0x60')],{'showHidden':![],'depth':null}));}break;case _0x89d3('0x85'):if(!_0x29820a[_0x89d3('0x60')][_0x89d3('0xd0')]&&_0x98e727>=0xc8&&_0x98e727<=0xce){return _0x5a2126[_0x89d3('0x35')]({'read':!![]});}else{logger['error'](_0x89d3('0x24'),_0x89d3('0x2b'),_0x89d3('0x85'),util['inspect'](_0x29820a[_0x89d3('0x60')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x5e15b1=_0x29820a[_0x89d3('0x60')][_0x89d3('0x89')][0x0];if(_0x5e15b1['status'][_0x89d3('0xcd')]===_0x89d3('0xcc')){return _0x5a2126[_0x89d3('0x35')]({'read':!![]});}else{logger[_0x89d3('0x26')](_0x89d3('0x24'),_0x89d3('0x2b'),_0x89d3('0xcb'),util['inspect'](_0x29820a['body'],{'showHidden':![],'depth':null}));}break;case _0x89d3('0x8d'):if(_0x98e727==_0x89d3('0xd1')||_0x98e727=='RECEIVED_BY_RECIPIENT'){return _0x5a2126['update']({'read':!![]});}else{logger[_0x89d3('0x26')](_0x89d3('0x24'),_0x89d3('0x2b'),'clickatell',util['inspect'](_0x29820a[_0x89d3('0x60')],{'showHidden':![],'depth':null}));}break;case _0x89d3('0xd2'):if(_0x98e727=='message-delivered'){return _0x5a2126['update']({'read':!![]});}else{logger['error'](_0x89d3('0x24'),_0x89d3('0x2b'),_0x89d3('0xd2'),util['inspect'](_0x29820a['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x98e727==='DELIVRD'||_0x98e727===_0x89d3('0xd3')){return _0x5a2126[_0x89d3('0x35')]({'read':!![]});}else{logger[_0x89d3('0x26')](_0x89d3('0x24'),_0x89d3('0x2b'),_0x89d3('0x90'),util[_0x89d3('0xcf')](_0x29820a[_0x89d3('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x5a2126;}})['then'](respondWithResult(_0xcb001e,null))[_0x89d3('0x5e')](handleError(_0xcb001e,null));};exports[_0x89d3('0xd4')]=function(_0x22722b,_0x2b2385,_0x5689b7){var _0x57dc0d,_0xdb825d,_0x11c788;return db[_0x89d3('0x55')][_0x89d3('0x5d')]({'where':{'id':_0x22722b['params']['id']}})[_0x89d3('0x36')](handleEntityNotFound(_0x2b2385,null))[_0x89d3('0x36')](function(_0x510bfa){if(_0x510bfa){_0x11c788=_0x510bfa;logger[_0x89d3('0xab')](_0x89d3('0x24'),_0x89d3('0x2b'),_0x89d3('0xd5'),_0x510bfa[_0x89d3('0x42')],util[_0x89d3('0xcf')](_0x22722b['query'],{'showHidden':![],'depth':null}));switch(_0x510bfa[_0x89d3('0x42')]){case'csc':if(_0x22722b[_0x89d3('0x45')]['message-id']&&_0x22722b[_0x89d3('0x45')][_0x89d3('0xd6')]){_0xdb825d=_0x22722b[_0x89d3('0x45')]['state'];return db[_0x89d3('0xa1')][_0x89d3('0x5d')]({'where':{'messageId':_0x22722b['query'][_0x89d3('0xd7')]}});}break;}}})[_0x89d3('0x36')](handleEntityNotFound(_0x2b2385,null))['then'](function(_0x327caf){if(_0x327caf){_0x57dc0d=_0x327caf;switch(_0x11c788['type']){case'csc':if(_0xdb825d==='2'||_0xdb825d==='6'){return _0x57dc0d[_0x89d3('0x35')]({'read':!![]});}else{logger[_0x89d3('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x89d3('0x8a'),util['inspect'](_0x22722b['query'],{'showHidden':![],'depth':null}));};break;}return _0x57dc0d;}})[_0x89d3('0x36')](respondWithResult(_0x2b2385,null))[_0x89d3('0x5e')](handleError(_0x2b2385,null));};exports[_0x89d3('0xd8')]=function(_0x3a45a2,_0x4fa76d,_0x4967e1){return db['SmsAccount'][_0x89d3('0x5d')]({'where':{'id':_0x3a45a2[_0x89d3('0x5b')]['id']}})[_0x89d3('0x36')](handleEntityNotFound(_0x4fa76d,null))[_0x89d3('0x36')](function(_0xff39db){if(_0xff39db){return _0xff39db[_0x89d3('0xd8')](_0x3a45a2[_0x89d3('0x60')][_0x89d3('0x69')],_['omit'](_0x3a45a2[_0x89d3('0x60')],['ids','id'])||{})[_0x89d3('0xc3')](function(_0x25a7bc){for(var _0x1e4fce=0x0;_0x1e4fce<_0x3a45a2[_0x89d3('0x60')][_0x89d3('0x69')][_0x89d3('0x4b')];_0x1e4fce+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x3a45a2['body']['ids'][_0x1e4fce]),'SmsAccountId':Number(_0x3a45a2[_0x89d3('0x5b')]['id'])});}return _0x25a7bc;});}})[_0x89d3('0x36')](respondWithResult(_0x4fa76d,null))['catch'](handleError(_0x4fa76d,null));};exports[_0x89d3('0xd9')]=function(_0x2944f6,_0x35962e,_0x3bb21e){return db['SmsAccount'][_0x89d3('0x5d')]({'where':{'id':_0x2944f6['params']['id']}})[_0x89d3('0x36')](handleEntityNotFound(_0x35962e,null))['then'](function(_0x47a515){if(_0x47a515){return _0x47a515[_0x89d3('0xd9')](_0x2944f6[_0x89d3('0x45')][_0x89d3('0x69')])[_0x89d3('0x36')](function(){if(_[_0x89d3('0xda')](_0x2944f6[_0x89d3('0x45')][_0x89d3('0x69')])){for(var _0x4c4abf=0x0;_0x4c4abf<_0x2944f6['query']['ids']['length'];_0x4c4abf+=0x1){socket[_0x89d3('0xdb')](_0x89d3('0xdc'),{'UserId':Number(_0x2944f6[_0x89d3('0x45')]['ids'][_0x4c4abf]),'SmsAccountId':Number(_0x2944f6[_0x89d3('0x5b')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x2944f6[_0x89d3('0x45')][_0x89d3('0x69')]),'SmsAccountId':Number(_0x2944f6[_0x89d3('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x35962e,null))['catch'](handleError(_0x35962e,null));};exports['getAgents']=function(_0x1f8096,_0x3e5e13,_0x23efd8){var _0x55a91d={};var _0x39b88c={};var _0x2ce3d0;var _0x92f80c;return db[_0x89d3('0x55')][_0x89d3('0x6d')]({'where':{'id':_0x1f8096[_0x89d3('0x5b')]['id']}})[_0x89d3('0x36')](handleEntityNotFound(_0x3e5e13,null))[_0x89d3('0x36')](function(_0x2bcd48){if(_0x2bcd48){_0x2ce3d0=_0x2bcd48;_0x39b88c[_0x89d3('0x44')]=_[_0x89d3('0x46')](db[_0x89d3('0xa5')][_0x89d3('0x5c')]);_0x39b88c[_0x89d3('0x45')]=_['keys'](_0x1f8096['query']);_0x39b88c['filters']=_[_0x89d3('0x48')](_0x39b88c['model'],_0x39b88c['query']);_0x55a91d[_0x89d3('0x49')]=_[_0x89d3('0x48')](_0x39b88c[_0x89d3('0x44')],qs[_0x89d3('0x4a')](_0x1f8096[_0x89d3('0x45')][_0x89d3('0x4a')]));_0x55a91d['attributes']=_0x55a91d[_0x89d3('0x49')]['length']?_0x55a91d['attributes']:_0x39b88c[_0x89d3('0x44')];_0x55a91d[_0x89d3('0x4e')]=qs[_0x89d3('0x4f')](_0x1f8096[_0x89d3('0x45')]['sort']);_0x55a91d[_0x89d3('0x50')]=qs[_0x89d3('0x47')](_[_0x89d3('0x51')](_0x1f8096[_0x89d3('0x45')],_0x39b88c[_0x89d3('0x47')]));if(_0x1f8096[_0x89d3('0x45')][_0x89d3('0x52')]){_0x55a91d[_0x89d3('0x50')]=_[_0x89d3('0x53')](_0x55a91d[_0x89d3('0x50')],{'$or':_[_0x89d3('0x41')](_0x55a91d['attributes'],function(_0x4d6e96){var _0x28f67a={};_0x28f67a[_0x4d6e96]={'$like':'%'+_0x1f8096[_0x89d3('0x45')][_0x89d3('0x52')]+'%'};return _0x28f67a;})});}_0x55a91d=_[_0x89d3('0x53')]({},_0x55a91d,_0x1f8096[_0x89d3('0x54')]);return _0x2ce3d0[_0x89d3('0xdd')](_0x55a91d);}})[_0x89d3('0x36')](function(_0xc3e01b){if(_0xc3e01b){_0x92f80c=_0xc3e01b[_0x89d3('0x4b')];if(!_0x1f8096[_0x89d3('0x45')]['hasOwnProperty'](_0x89d3('0x4d'))){_0x55a91d[_0x89d3('0x2d')]=qs[_0x89d3('0x2d')](_0x1f8096[_0x89d3('0x45')][_0x89d3('0x2d')]);_0x55a91d[_0x89d3('0x30')]=qs[_0x89d3('0x30')](_0x1f8096[_0x89d3('0x45')][_0x89d3('0x30')]);}return _0x2ce3d0[_0x89d3('0xdd')](_0x55a91d);}})[_0x89d3('0x36')](function(_0x1fff21){if(_0x1fff21){return _0x1fff21?{'count':_0x92f80c,'rows':_0x1fff21}:null;}})[_0x89d3('0x36')](respondWithResult(_0x3e5e13,null))['catch'](handleError(_0x3e5e13,null));};
\ No newline at end of file
+var _0x1e69=['applications','orderBy','Applications','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','Body','messageId','skebby','from','text','clicksend','message_id','plivo','From','Text','MessageUUID','results','csc','clickatell','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','CmContact','Contacts','DESC','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','agent','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','getInteractions','fullname','internal','Tags','tag','to\x20is\x20mandatory','List','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','connectel','requestid','statusInt','status_code','infobip','groupName','DELIVERED','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','ids','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','type','SmsAccount','includeAll','include','findAll','rows','params','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','notify','SmsApplication','account'];(function(_0x16ab75,_0x2143a6){var _0xb88c63=function(_0x17f5ee){while(--_0x17f5ee){_0x16ab75['push'](_0x16ab75['shift']());}};_0xb88c63(++_0x2143a6);}(_0x1e69,0x6c));var _0x91e6=function(_0x1f65b8,_0xf2df7d){_0x1f65b8=_0x1f65b8-0x0;var _0x33a242=_0x1e69[_0x1f65b8];return _0x33a242;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x91e6('0x0'));var zipdir=require(_0x91e6('0x1'));var jsonpatch=require(_0x91e6('0x2'));var rp=require('request-promise');var moment=require(_0x91e6('0x3'));var BPromise=require(_0x91e6('0x4'));var Mustache=require('mustache');var util=require(_0x91e6('0x5'));var path=require(_0x91e6('0x6'));var sox=require(_0x91e6('0x7'));var csv=require(_0x91e6('0x8'));var ejs=require(_0x91e6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x91e6('0xa'));var squel=require(_0x91e6('0xb'));var crypto=require('crypto');var jsforce=require(_0x91e6('0xc'));var deskjs=require(_0x91e6('0xd'));var toCsv=require(_0x91e6('0x8'));var querystring=require(_0x91e6('0xe'));var Papa=require(_0x91e6('0xf'));var Redis=require(_0x91e6('0x10'));var authService=require(_0x91e6('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91e6('0x12'));var logger=require(_0x91e6('0x13'))(_0x91e6('0x14'));var utils=require(_0x91e6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x91e6('0x16'));var db=require(_0x91e6('0x17'))['db'];config[_0x91e6('0x18')]=_[_0x91e6('0x19')](config[_0x91e6('0x18')],{'host':_0x91e6('0x1a'),'port':0x18eb});var socket=require(_0x91e6('0x1b'))(new Redis(config['redis']));require(_0x91e6('0x1c'))[_0x91e6('0x1d')](socket);var jayson=require(_0x91e6('0x1e'));var client=jayson[_0x91e6('0x1f')][_0x91e6('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x5e0787,_0x5e7b2b,_0x35cfeb,_0x296ceb){return new BPromise(function(_0x16e2e5,_0x4a5d10){var _0x334d57=_0x296ceb||client;return _0x334d57[_0x91e6('0x21')](_0x5e0787,_0x35cfeb)[_0x91e6('0x22')](function(_0x505eef){logger[_0x91e6('0x23')](_0x91e6('0x24'),_0x5e7b2b,_0x91e6('0x25'));logger[_0x91e6('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5e7b2b,_0x91e6('0x25'),JSON[_0x91e6('0x27')](_0x505eef));if(_0x505eef['error']){if(_0x505eef['error'][_0x91e6('0x28')]===0x1f4){logger[_0x91e6('0x29')](_0x91e6('0x24'),_0x5e7b2b,_0x505eef[_0x91e6('0x29')][_0x91e6('0x2a')]);return _0x4a5d10(_0x505eef[_0x91e6('0x29')][_0x91e6('0x2a')]);}logger['error'](_0x91e6('0x24'),_0x5e7b2b,_0x505eef[_0x91e6('0x29')][_0x91e6('0x2a')]);return _0x16e2e5(_0x505eef[_0x91e6('0x29')][_0x91e6('0x2a')]);}else{logger['info'](_0x91e6('0x24'),_0x5e7b2b,'request\x20sent');_0x16e2e5(_0x505eef[_0x91e6('0x2b')][_0x91e6('0x2a')]);}})[_0x91e6('0x2c')](function(_0x5d4fb7){logger['error'](_0x91e6('0x24'),_0x5e7b2b,_0x5d4fb7);_0x4a5d10(_0x5d4fb7);});});}function respondWithStatusCode(_0x30882b,_0x423dda){_0x423dda=_0x423dda||0xcc;return function(_0x3f122d){if(_0x3f122d){return _0x30882b[_0x91e6('0x2d')](_0x423dda);}return _0x30882b[_0x91e6('0x2e')](_0x423dda)[_0x91e6('0x2f')]();};}function respondWithResult(_0x1d9b41,_0x192b1c){_0x192b1c=_0x192b1c||0xc8;return function(_0x1a02eb){if(_0x1a02eb){return _0x1d9b41[_0x91e6('0x2e')](_0x192b1c)[_0x91e6('0x30')](_0x1a02eb);}};}function respondWithFilteredResult(_0x3cda9d,_0x36d185){return function(_0x3fe7c7){if(_0x3fe7c7){var _0x1f5e2c=typeof _0x36d185[_0x91e6('0x31')]===_0x91e6('0x32')&&typeof _0x36d185[_0x91e6('0x33')]===_0x91e6('0x32');var _0x2e5efb=_0x3fe7c7[_0x91e6('0x34')];var _0x1c3702=_0x1f5e2c?0x0:_0x36d185['offset'];var _0x128ce2=_0x1f5e2c?_0x3fe7c7[_0x91e6('0x34')]:_0x36d185['offset']+_0x36d185['limit'];var _0x32e94e;if(_0x128ce2>=_0x2e5efb){_0x128ce2=_0x2e5efb;_0x32e94e=0xc8;}else{_0x32e94e=0xce;}_0x3cda9d[_0x91e6('0x2e')](_0x32e94e);return _0x3cda9d[_0x91e6('0x35')](_0x91e6('0x36'),_0x1c3702+'-'+_0x128ce2+'/'+_0x2e5efb)[_0x91e6('0x30')](_0x3fe7c7);}return null;};}function patchUpdates(_0x354588){return function(_0x3f748a){try{jsonpatch[_0x91e6('0x37')](_0x3f748a,_0x354588,!![]);}catch(_0x123720){return BPromise[_0x91e6('0x38')](_0x123720);}return _0x3f748a['save']();};}function saveUpdates(_0x1b1289,_0x38ee06){return function(_0x3069d0){if(_0x3069d0){return _0x3069d0[_0x91e6('0x39')](_0x1b1289)[_0x91e6('0x22')](function(_0x1faab1){return _0x1faab1;});}return null;};}function removeEntity(_0x30ec48,_0x2a2b9f){return function(_0x160140){if(_0x160140){return _0x160140[_0x91e6('0x3a')]()[_0x91e6('0x22')](function(){var _0x85c0a9=_0x160140['get']({'plain':!![]});var _0x1cfddf=_0x91e6('0x3b');return db[_0x91e6('0x3c')][_0x91e6('0x3a')]({'where':{'type':_0x1cfddf,'resourceId':_0x85c0a9['id']}})['then'](function(){return _0x160140;});})['then'](function(){_0x30ec48['status'](0xcc)[_0x91e6('0x2f')]();});}};}function handleEntityNotFound(_0x4f5563,_0x514592){return function(_0x3e247a){if(!_0x3e247a){_0x4f5563['sendStatus'](0x194);}return _0x3e247a;};}function handleError(_0xdc1a5b,_0x58de43){_0x58de43=_0x58de43||0x1f4;return function(_0x4e7d14){logger[_0x91e6('0x29')](_0x4e7d14[_0x91e6('0x3d')]);if(_0x4e7d14[_0x91e6('0x3e')]){delete _0x4e7d14[_0x91e6('0x3e')];}_0xdc1a5b[_0x91e6('0x2e')](_0x58de43)[_0x91e6('0x3f')](_0x4e7d14);};}exports[_0x91e6('0x40')]=function(_0x51be00,_0x2514de){var _0xc583a7={'include':[{'model':db[_0x91e6('0x41')],'as':_0x91e6('0x42')}]},_0x33851b={},_0x50e417={'count':0x0,'rows':[]};var _0xd81f41=_['map'](db['SmsAccount'][_0x91e6('0x43')],function(_0x126353){return{'name':_0x126353[_0x91e6('0x44')],'type':_0x126353['type'][_0x91e6('0x45')]};});_0x33851b['model']=_[_0x91e6('0x46')](_0xd81f41,_0x91e6('0x3e'));_0x33851b[_0x91e6('0x47')]=_[_0x91e6('0x48')](_0x51be00[_0x91e6('0x47')]);_0x33851b['filters']=_[_0x91e6('0x49')](_0x33851b[_0x91e6('0x4a')],_0x33851b[_0x91e6('0x47')]);_0xc583a7[_0x91e6('0x4b')]=_['intersection'](_0x33851b[_0x91e6('0x4a')],qs[_0x91e6('0x4c')](_0x51be00[_0x91e6('0x47')][_0x91e6('0x4c')]));_0xc583a7[_0x91e6('0x4b')]=_0xc583a7['attributes'][_0x91e6('0x4d')]?_0xc583a7['attributes']:_0x33851b[_0x91e6('0x4a')];if(!_0x51be00[_0x91e6('0x47')][_0x91e6('0x4e')]('nolimit')){_0xc583a7[_0x91e6('0x33')]=qs[_0x91e6('0x33')](_0x51be00[_0x91e6('0x47')][_0x91e6('0x33')]);_0xc583a7[_0x91e6('0x31')]=qs['offset'](_0x51be00[_0x91e6('0x47')][_0x91e6('0x31')]);}_0xc583a7['order']=qs[_0x91e6('0x4f')](_0x51be00[_0x91e6('0x47')][_0x91e6('0x4f')]);_0xc583a7[_0x91e6('0x50')]=qs[_0x91e6('0x51')](_[_0x91e6('0x52')](_0x51be00['query'],_0x33851b['filters']),_0xd81f41);if(_0x51be00[_0x91e6('0x47')][_0x91e6('0x53')]){_0xc583a7[_0x91e6('0x50')]=_[_0x91e6('0x54')](_0xc583a7[_0x91e6('0x50')],{'$or':_[_0x91e6('0x46')](_0xd81f41,function(_0x44d789){if(_0x44d789[_0x91e6('0x55')]!=='VIRTUAL'){var _0x1207ef={};_0x1207ef[_0x44d789[_0x91e6('0x3e')]]={'$like':'%'+_0x51be00['query'][_0x91e6('0x53')]+'%'};return _0x1207ef;}})});}_0xc583a7=_['merge']({},_0xc583a7,_0x51be00['options']);var _0x31f084={'where':_0xc583a7[_0x91e6('0x50')]};return db[_0x91e6('0x56')][_0x91e6('0x34')](_0x31f084)[_0x91e6('0x22')](function(_0x5b91cb){_0x50e417[_0x91e6('0x34')]=_0x5b91cb;if(_0x51be00[_0x91e6('0x47')][_0x91e6('0x57')]){_0xc583a7[_0x91e6('0x58')]=[{'all':!![]}];}return db['SmsAccount'][_0x91e6('0x59')](_0xc583a7);})[_0x91e6('0x22')](function(_0x4e395d){_0x50e417[_0x91e6('0x5a')]=_0x4e395d;return _0x50e417;})[_0x91e6('0x22')](respondWithFilteredResult(_0x2514de,_0xc583a7))[_0x91e6('0x2c')](handleError(_0x2514de,null));};exports['show']=function(_0x503b6b,_0x521636){var _0x19184a={'raw':![],'where':{'id':_0x503b6b[_0x91e6('0x5b')]['id']},'include':[{'model':db[_0x91e6('0x41')],'as':_0x91e6('0x42')}]},_0x28b6c7={};_0x28b6c7[_0x91e6('0x4a')]=_[_0x91e6('0x48')](db[_0x91e6('0x56')][_0x91e6('0x43')]);_0x28b6c7[_0x91e6('0x47')]=_[_0x91e6('0x48')](_0x503b6b['query']);_0x28b6c7[_0x91e6('0x51')]=_[_0x91e6('0x49')](_0x28b6c7['model'],_0x28b6c7['query']);_0x19184a[_0x91e6('0x4b')]=_['intersection'](_0x28b6c7[_0x91e6('0x4a')],qs['fields'](_0x503b6b[_0x91e6('0x47')]['fields']));_0x19184a[_0x91e6('0x4b')]=_0x19184a[_0x91e6('0x4b')]['length']?_0x19184a[_0x91e6('0x4b')]:_0x28b6c7[_0x91e6('0x4a')];if(_0x503b6b[_0x91e6('0x47')]['includeAll']){_0x19184a[_0x91e6('0x58')]=[{'all':!![]}];}_0x19184a=_['merge']({},_0x19184a,_0x503b6b[_0x91e6('0x5c')]);return db[_0x91e6('0x56')]['find'](_0x19184a)[_0x91e6('0x22')](handleEntityNotFound(_0x521636,null))[_0x91e6('0x22')](respondWithResult(_0x521636,null))[_0x91e6('0x2c')](handleError(_0x521636,null));};exports[_0x91e6('0x5d')]=function(_0x313a26,_0x19107f){return db['SmsAccount'][_0x91e6('0x5d')](_0x313a26[_0x91e6('0x5e')],{})['then'](function(_0x523db4){var _0x347ac2=_0x313a26[_0x91e6('0x5f')][_0x91e6('0x60')]({'plain':!![]});if(!_0x347ac2)throw new Error(_0x91e6('0x61'));if(_0x347ac2[_0x91e6('0x62')]===_0x91e6('0x5f')){var _0x205c9e=_0x523db4[_0x91e6('0x60')]({'plain':!![]});var _0x5b17eb=_0x91e6('0x3b');return db[_0x91e6('0x63')]['find']({'where':{'name':_0x5b17eb,'userProfileId':_0x347ac2[_0x91e6('0x64')]},'raw':!![]})['then'](function(_0x1e0122){if(_0x1e0122&&_0x1e0122[_0x91e6('0x65')]===0x0){return db[_0x91e6('0x3c')][_0x91e6('0x5d')]({'name':_0x205c9e[_0x91e6('0x3e')],'resourceId':_0x205c9e['id'],'type':_0x1e0122['name'],'sectionId':_0x1e0122['id']},{})['then'](function(){return _0x523db4;});}else{return _0x523db4;}})[_0x91e6('0x2c')](function(_0x117779){logger[_0x91e6('0x29')](_0x91e6('0x66'),_0x117779);throw _0x117779;});}return _0x523db4;})['then'](respondWithResult(_0x19107f,0xc9))[_0x91e6('0x2c')](handleError(_0x19107f,null));};exports[_0x91e6('0x39')]=function(_0x4ca4aa,_0x5516e){if(_0x4ca4aa[_0x91e6('0x5e')]['id']){delete _0x4ca4aa['body']['id'];}return db['SmsAccount'][_0x91e6('0x67')]({'where':{'id':_0x4ca4aa[_0x91e6('0x5b')]['id']},'include':[{'model':db[_0x91e6('0x41')],'as':_0x91e6('0x42')}]})[_0x91e6('0x22')](handleEntityNotFound(_0x5516e,null))[_0x91e6('0x22')](saveUpdates(_0x4ca4aa[_0x91e6('0x5e')],null))[_0x91e6('0x22')](respondWithResult(_0x5516e,null))['catch'](handleError(_0x5516e,null));};exports[_0x91e6('0x3a')]=function(_0x1f3dee,_0xc21d8){return db[_0x91e6('0x56')][_0x91e6('0x67')]({'where':{'id':_0x1f3dee[_0x91e6('0x5b')]['id']}})['then'](handleEntityNotFound(_0xc21d8,null))[_0x91e6('0x22')](removeEntity(_0xc21d8,null))[_0x91e6('0x2c')](handleError(_0xc21d8,null));};exports['describe']=function(_0x7b786d,_0x5a328c){return db['SmsAccount']['describe']()[_0x91e6('0x22')](respondWithResult(_0x5a328c,null))['catch'](handleError(_0x5a328c,null));};exports[_0x91e6('0x68')]=function(_0x20aa92,_0x399094,_0x582cd8){if(_0x20aa92[_0x91e6('0x5e')]['id']){delete _0x20aa92[_0x91e6('0x5e')]['id'];}return db[_0x91e6('0x56')][_0x91e6('0x67')]({'where':{'id':_0x20aa92[_0x91e6('0x5b')]['id']}})[_0x91e6('0x22')](handleEntityNotFound(_0x399094,null))[_0x91e6('0x22')](function(_0x4aa162){if(_0x4aa162){_0x20aa92[_0x91e6('0x5e')][_0x91e6('0x69')]=_0x4aa162['id'];return db[_0x91e6('0x6a')][_0x91e6('0x5d')](_0x20aa92[_0x91e6('0x5e')]);}})[_0x91e6('0x22')](respondWithResult(_0x399094,null))[_0x91e6('0x2c')](handleError(_0x399094,null));};exports[_0x91e6('0x6b')]=function(_0x5318fa,_0x49e2ad,_0x17f3f8){var _0x351b50={'raw':![],'where':{}};var _0x39bcf3={};var _0x2d4607={'count':0x0,'rows':[]};return db[_0x91e6('0x56')][_0x91e6('0x6c')]({'where':{'id':_0x5318fa[_0x91e6('0x5b')]['id']}})[_0x91e6('0x22')](handleEntityNotFound(_0x49e2ad,null))[_0x91e6('0x22')](function(_0x318a95){if(_0x318a95){_0x39bcf3[_0x91e6('0x4a')]=_[_0x91e6('0x48')](db['Disposition'][_0x91e6('0x43')]);_0x39bcf3[_0x91e6('0x47')]=_['keys'](_0x5318fa['query']);_0x39bcf3[_0x91e6('0x51')]=_['intersection'](_0x39bcf3[_0x91e6('0x4a')],_0x39bcf3[_0x91e6('0x47')]);_0x351b50[_0x91e6('0x4b')]=_[_0x91e6('0x49')](_0x39bcf3[_0x91e6('0x4a')],qs[_0x91e6('0x4c')](_0x5318fa[_0x91e6('0x47')][_0x91e6('0x4c')]));_0x351b50[_0x91e6('0x4b')]=_0x351b50[_0x91e6('0x4b')][_0x91e6('0x4d')]?_0x351b50[_0x91e6('0x4b')]:_0x39bcf3[_0x91e6('0x4a')];if(!_0x5318fa[_0x91e6('0x47')][_0x91e6('0x4e')]('nolimit')){_0x351b50[_0x91e6('0x33')]=qs['limit'](_0x5318fa[_0x91e6('0x47')][_0x91e6('0x33')]);_0x351b50[_0x91e6('0x31')]=qs[_0x91e6('0x31')](_0x5318fa[_0x91e6('0x47')][_0x91e6('0x31')]);}_0x351b50[_0x91e6('0x6d')]=qs['sort'](_0x5318fa[_0x91e6('0x47')]['sort']);_0x351b50[_0x91e6('0x50')]=qs[_0x91e6('0x51')](_[_0x91e6('0x52')](_0x5318fa[_0x91e6('0x47')],_0x39bcf3[_0x91e6('0x51')]));_0x351b50['where'][_0x91e6('0x69')]=_0x318a95['id'];if(_0x5318fa[_0x91e6('0x47')][_0x91e6('0x53')]){_0x351b50[_0x91e6('0x50')]=_[_0x91e6('0x54')](_0x351b50[_0x91e6('0x50')],{'$or':_[_0x91e6('0x46')](_0x351b50['attributes'],function(_0x1ea777){var _0x2cb019={};_0x2cb019[_0x1ea777]={'$like':'%'+_0x5318fa[_0x91e6('0x47')][_0x91e6('0x53')]+'%'};return _0x2cb019;})});}_0x351b50=_[_0x91e6('0x54')]({},_0x351b50,_0x5318fa[_0x91e6('0x5c')]);return db['Disposition']['count']({'where':_0x351b50[_0x91e6('0x50')]})[_0x91e6('0x22')](function(_0x565a70){_0x2d4607['count']=_0x565a70;if(_0x5318fa[_0x91e6('0x47')]['includeAll']){_0x351b50[_0x91e6('0x58')]=[{'all':!![]}];}return db[_0x91e6('0x6a')][_0x91e6('0x59')](_0x351b50);})[_0x91e6('0x22')](function(_0x4f6b96){_0x2d4607[_0x91e6('0x5a')]=_0x4f6b96;return _0x2d4607;});}})[_0x91e6('0x22')](respondWithFilteredResult(_0x49e2ad,_0x351b50))['catch'](handleError(_0x49e2ad,null));};exports[_0x91e6('0x6e')]=function(_0x30f79c,_0x27f5e6,_0x36e020){return db[_0x91e6('0x56')][_0x91e6('0x67')]({'where':{'id':_0x30f79c['params']['id']}})[_0x91e6('0x22')](handleEntityNotFound(_0x27f5e6,null))['then'](function(_0x34545){if(_0x34545){return _0x34545[_0x91e6('0x6e')](_0x30f79c[_0x91e6('0x47')]['ids']);}})['then'](respondWithStatusCode(_0x27f5e6,null))[_0x91e6('0x2c')](handleError(_0x27f5e6,null));};exports[_0x91e6('0x6f')]=function(_0x4b9cf1,_0x471608,_0x49590e){if(_0x4b9cf1[_0x91e6('0x5e')]['id']){delete _0x4b9cf1['body']['id'];}return db[_0x91e6('0x56')][_0x91e6('0x67')]({'where':{'id':_0x4b9cf1[_0x91e6('0x5b')]['id']}})['then'](handleEntityNotFound(_0x471608,null))[_0x91e6('0x22')](function(_0x19bb06){if(_0x19bb06){_0x4b9cf1[_0x91e6('0x5e')][_0x91e6('0x69')]=_0x19bb06['id'];return db[_0x91e6('0x70')]['create'](_0x4b9cf1['body']);}})[_0x91e6('0x22')](respondWithResult(_0x471608,null))[_0x91e6('0x2c')](handleError(_0x471608,null));};exports[_0x91e6('0x71')]=function(_0x3c50e0,_0xb556cb,_0x4ccbe0){var _0x4b2669={'raw':![],'where':{}};var _0x5f16fd={};var _0x17c399={'count':0x0,'rows':[]};return db[_0x91e6('0x56')][_0x91e6('0x6c')]({'where':{'id':_0x3c50e0[_0x91e6('0x5b')]['id']}})['then'](handleEntityNotFound(_0xb556cb,null))['then'](function(_0x2a3f5f){if(_0x2a3f5f){_0x5f16fd['model']=_[_0x91e6('0x48')](db[_0x91e6('0x70')][_0x91e6('0x43')]);_0x5f16fd[_0x91e6('0x47')]=_['keys'](_0x3c50e0[_0x91e6('0x47')]);_0x5f16fd['filters']=_[_0x91e6('0x49')](_0x5f16fd['model'],_0x5f16fd[_0x91e6('0x47')]);_0x4b2669[_0x91e6('0x4b')]=_[_0x91e6('0x49')](_0x5f16fd[_0x91e6('0x4a')],qs[_0x91e6('0x4c')](_0x3c50e0[_0x91e6('0x47')]['fields']));_0x4b2669[_0x91e6('0x4b')]=_0x4b2669[_0x91e6('0x4b')][_0x91e6('0x4d')]?_0x4b2669[_0x91e6('0x4b')]:_0x5f16fd[_0x91e6('0x4a')];if(!_0x3c50e0[_0x91e6('0x47')][_0x91e6('0x4e')](_0x91e6('0x72'))){_0x4b2669[_0x91e6('0x33')]=qs[_0x91e6('0x33')](_0x3c50e0[_0x91e6('0x47')][_0x91e6('0x33')]);_0x4b2669['offset']=qs[_0x91e6('0x31')](_0x3c50e0['query'][_0x91e6('0x31')]);}_0x4b2669['order']=qs[_0x91e6('0x4f')](_0x3c50e0[_0x91e6('0x47')][_0x91e6('0x4f')]);_0x4b2669[_0x91e6('0x50')]=qs[_0x91e6('0x51')](_[_0x91e6('0x52')](_0x3c50e0[_0x91e6('0x47')],_0x5f16fd[_0x91e6('0x51')]));_0x4b2669[_0x91e6('0x50')][_0x91e6('0x69')]=_0x2a3f5f['id'];if(_0x3c50e0['query'][_0x91e6('0x53')]){_0x4b2669[_0x91e6('0x50')]=_[_0x91e6('0x54')](_0x4b2669[_0x91e6('0x50')],{'$or':_[_0x91e6('0x46')](_0x4b2669[_0x91e6('0x4b')],function(_0x1fff0f){var _0xa8b7a9={};_0xa8b7a9[_0x1fff0f]={'$like':'%'+_0x3c50e0['query'][_0x91e6('0x53')]+'%'};return _0xa8b7a9;})});}_0x4b2669=_[_0x91e6('0x54')]({},_0x4b2669,_0x3c50e0[_0x91e6('0x5c')]);return db['CannedAnswer'][_0x91e6('0x34')]({'where':_0x4b2669[_0x91e6('0x50')]})[_0x91e6('0x22')](function(_0x50ecf8){_0x17c399[_0x91e6('0x34')]=_0x50ecf8;if(_0x3c50e0[_0x91e6('0x47')][_0x91e6('0x57')]){_0x4b2669['include']=[{'all':!![]}];}return db[_0x91e6('0x70')]['findAll'](_0x4b2669);})['then'](function(_0x35dd27){_0x17c399['rows']=_0x35dd27;return _0x17c399;});}})[_0x91e6('0x22')](respondWithFilteredResult(_0xb556cb,_0x4b2669))[_0x91e6('0x2c')](handleError(_0xb556cb,null));};exports[_0x91e6('0x73')]=function(_0x1da5da,_0xf89ddd,_0x1aada1){return db[_0x91e6('0x56')][_0x91e6('0x67')]({'where':{'id':_0x1da5da[_0x91e6('0x5b')]['id']}})[_0x91e6('0x22')](handleEntityNotFound(_0xf89ddd,null))[_0x91e6('0x22')](function(_0x2f601e){if(_0x2f601e){return _0x2f601e[_0x91e6('0x73')](_0x1da5da[_0x91e6('0x47')]['ids']);}})['then'](respondWithStatusCode(_0xf89ddd,null))[_0x91e6('0x2c')](handleError(_0xf89ddd,null));};exports[_0x91e6('0x74')]=function(_0xe3e0e4,_0x37a6c0,_0x17e96b){var _0x15d816={'channel':'sms'};var _0x1cf884=[];var _0x15a800=[];var _0x4d587c={};return db[_0x91e6('0x56')][_0x91e6('0x67')]({'where':{'id':_0xe3e0e4[_0x91e6('0x5b')]['id']},'include':[{'model':db[_0x91e6('0x75')],'as':'Applications'}]})[_0x91e6('0x22')](handleEntityNotFound(_0x37a6c0,null))[_0x91e6('0x22')](function(_0x54dea1){_0x15d816[_0x91e6('0x76')]=_0x54dea1;_0x15d816[_0x91e6('0x77')]=_[_0x91e6('0x78')](_0x54dea1[_0x91e6('0x79')],['priority'],[_0x91e6('0x7a')]);if(_0x15d816[_0x91e6('0x76')][_0x91e6('0x79')]){delete _0x15d816[_0x91e6('0x76')][_0x91e6('0x79')];}return db['CmContact']['describe']();})[_0x91e6('0x22')](function(_0x38bd9b){if(!_0x38bd9b){throw new db[(_0x91e6('0x7b'))][(_0x91e6('0x7c'))](_0x91e6('0x7d'));}_0x1cf884=_[_0x91e6('0x7e')](_['keys'](_0x38bd9b),[_0x91e6('0x7f'),'updatedAt']);_0x15a800=_[_0x91e6('0x7e')](_[_0x91e6('0x48')](_0x38bd9b),[_0x91e6('0x7f'),_0x91e6('0x80'),'CompanyId',_0x91e6('0x81')]);_0x15d816[_0x91e6('0x5e')]={'mapKey':_0x91e6('0x82')};if(_0x15d816[_0x91e6('0x76')][_0x91e6('0x55')]){switch(_0x15d816[_0x91e6('0x76')]['type']){case'twilio':_0x15d816[_0x91e6('0x5e')]['from']=_0xe3e0e4['body']['From'];_0x15d816['body'][_0x91e6('0x5e')]=_0xe3e0e4[_0x91e6('0x5e')][_0x91e6('0x83')];_0x15d816[_0x91e6('0x5e')][_0x91e6('0x84')]=_0xe3e0e4[_0x91e6('0x5e')]['MessageSid'];break;case _0x91e6('0x85'):_0x15d816[_0x91e6('0x5e')][_0x91e6('0x86')]='+'+_0xe3e0e4[_0x91e6('0x5e')]['sender'];_0x15d816[_0x91e6('0x5e')]['body']=_0xe3e0e4[_0x91e6('0x5e')][_0x91e6('0x87')];break;case'connectel':_0x15d816[_0x91e6('0x5e')][_0x91e6('0x86')]=_0xe3e0e4[_0x91e6('0x5e')][_0x91e6('0x86')];_0x15d816[_0x91e6('0x5e')][_0x91e6('0x5e')]=_0xe3e0e4[_0x91e6('0x5e')]['message'];break;case _0x91e6('0x88'):_0x15d816[_0x91e6('0x5e')][_0x91e6('0x86')]=_0xe3e0e4[_0x91e6('0x5e')]['from'];_0x15d816['body'][_0x91e6('0x5e')]=_0xe3e0e4[_0x91e6('0x5e')][_0x91e6('0x5e')];_0x15d816['body'][_0x91e6('0x84')]=_0xe3e0e4['body'][_0x91e6('0x89')];break;case _0x91e6('0x8a'):_0x15d816[_0x91e6('0x5e')]['from']=_0xe3e0e4[_0x91e6('0x5e')][_0x91e6('0x8b')];_0x15d816[_0x91e6('0x5e')][_0x91e6('0x5e')]=_0xe3e0e4[_0x91e6('0x5e')][_0x91e6('0x8c')];_0x15d816[_0x91e6('0x5e')][_0x91e6('0x84')]=_0xe3e0e4[_0x91e6('0x5e')][_0x91e6('0x8d')];break;case'infobip':_0x15d816[_0x91e6('0x5e')][_0x91e6('0x86')]='+'+_0xe3e0e4['body']['results'][0x0][_0x91e6('0x86')];_0x15d816[_0x91e6('0x5e')][_0x91e6('0x5e')]=_0xe3e0e4[_0x91e6('0x5e')][_0x91e6('0x8e')][0x0]['text'];_0x15d816[_0x91e6('0x5e')][_0x91e6('0x84')]=_0xe3e0e4['body'][_0x91e6('0x8e')][0x0][_0x91e6('0x84')];break;case _0x91e6('0x8f'):_0x15d816[_0x91e6('0x5e')]['from']=_0xe3e0e4['body']['originatingAddress'];_0x15d816[_0x91e6('0x5e')][_0x91e6('0x5e')]=_0xe3e0e4[_0x91e6('0x5e')]['segmentedMessage']['message'];break;case _0x91e6('0x90'):_0x15d816[_0x91e6('0x5e')]['from']=_0xe3e0e4[_0x91e6('0x5e')]['fromNumber'];_0x15d816[_0x91e6('0x5e')][_0x91e6('0x5e')]=_0xe3e0e4[_0x91e6('0x5e')][_0x91e6('0x87')];_0x15d816[_0x91e6('0x5e')][_0x91e6('0x84')]=_0xe3e0e4['body']['replyMessageId'];break;case _0x91e6('0x91'):_0x15d816['body'][_0x91e6('0x84')]=_0xe3e0e4[_0x91e6('0x5e')][0x0]['message']['id'];_0x15d816[_0x91e6('0x5e')][_0x91e6('0x86')]=_0xe3e0e4[_0x91e6('0x5e')][0x0][_0x91e6('0x2a')]['from'];_0x15d816[_0x91e6('0x5e')][_0x91e6('0x5e')]=_0xe3e0e4['body'][0x0]['message'][_0x91e6('0x87')];break;case _0x91e6('0x92'):_0x15d816[_0x91e6('0x5e')]['from']=_0xe3e0e4[_0x91e6('0x5e')][_0x91e6('0x86')];_0x15d816['body']['body']=_0xe3e0e4['body']['message'];_0x15d816[_0x91e6('0x5e')][_0x91e6('0x84')]=_0xe3e0e4['body'][_0x91e6('0x93')];break;}}if(_0x15d816[_0x91e6('0x5e')]['id']){delete _0x15d816[_0x91e6('0x5e')]['id'];}if(_[_0x91e6('0x94')](_0x15d816[_0x91e6('0x5e')][_0x91e6('0x86')])){throw new db[(_0x91e6('0x7b'))][(_0x91e6('0x7c'))](_0x91e6('0x95'));}if(_[_0x91e6('0x94')](_0x15d816[_0x91e6('0x5e')][_0x91e6('0x5e')])||_0x15d816[_0x91e6('0x5e')][_0x91e6('0x5e')]===''){throw new db[(_0x91e6('0x7b'))][(_0x91e6('0x7c'))](_0x91e6('0x96'));}if(_[_0x91e6('0x94')](_0x15d816[_0x91e6('0x5e')]['mapKey'])){throw new db[(_0x91e6('0x7b'))][(_0x91e6('0x7c'))](_0x91e6('0x97')+_0x15a800);}if(!_['includes'](_0x15a800,_0x15d816['body']['mapKey'])){throw new db[(_0x91e6('0x7b'))][(_0x91e6('0x7c'))](_0x91e6('0x98')+_0x15a800);}_0x4d587c[_0x15d816[_0x91e6('0x5e')][_0x91e6('0x99')]]=_0x15d816[_0x91e6('0x5e')][_0x91e6('0x86')];return db[_0x91e6('0x9a')]['find']({'where':{'id':_0x15d816[_0x91e6('0x76')][_0x91e6('0x81')]},'include':[{'model':db[_0x91e6('0x9b')],'as':_0x91e6('0x9c'),'where':_0x4d587c,'limit':0x1,'order':[[_0x91e6('0x80'),_0x91e6('0x9d')]]}]});})[_0x91e6('0x22')](handleEntityNotFound(_0x37a6c0,null))[_0x91e6('0x22')](function(_0x49b3f7){if(_0x49b3f7){_0x15d816['list']=_[_0x91e6('0x9e')](_0x49b3f7,[_0x91e6('0x9c')]);if(_0x49b3f7['Contacts'][_0x91e6('0x4d')]){return _0x49b3f7[_0x91e6('0x9c')][0x0];}var _0x197c4c=_[_0x91e6('0x19')](_0x15d816[_0x91e6('0x5e')],{'firstName':_0x15d816[_0x91e6('0x5e')][_0x91e6('0x86')],'ListId':_0x49b3f7['id']});_0x197c4c[_0x15d816[_0x91e6('0x5e')][_0x91e6('0x99')]]=_0x15d816['body'][_0x91e6('0x86')];return db[_0x91e6('0x9b')][_0x91e6('0x5d')](_0x197c4c,{'fields':_0x1cf884,'raw':!![]});}})['then'](handleEntityNotFound(_0x37a6c0,null))[_0x91e6('0x22')](function(_0x7c04d3){if(_0x7c04d3){_0x15d816[_0x91e6('0x9f')]=_0x7c04d3;var _0x3ef09f={'ContactId':_0x7c04d3['id'],'phone':_0x15d816[_0x91e6('0x5e')][_0x91e6('0x86')],'SmsAccountId':_0xe3e0e4[_0x91e6('0x5b')]['id']};var _0x5ca745={'ContactId':_0x7c04d3['id'],'SmsAccountId':_0xe3e0e4[_0x91e6('0x5b')]['id'],'closed':![]};return db[_0x91e6('0xa0')][_0x91e6('0x67')]({'where':_0x5ca745})[_0x91e6('0x22')](function(_0x4646ec){if(_0x4646ec){return[_0x4646ec,![]];}return db[_0x91e6('0xa0')][_0x91e6('0x5d')](_0x3ef09f)[_0x91e6('0x22')](function(_0x5872af){return[_0x5872af,!![]];});});}})[_0x91e6('0xa1')](function(_0x1977c5,_0x13c08a){_0x15d816[_0x91e6('0xa2')]=_0x1977c5['get']({'plain':!![]});_0x15d816[_0x91e6('0xa2')][_0x91e6('0xa3')]=![];if(_0x13c08a){if(_0x15d816['account'][_0x91e6('0xa4')]){_0x15d816[_0x91e6('0x77')][_0x91e6('0xa5')]({'id':0x0,'priority':_0x15d816[_0x91e6('0x77')][_0x91e6('0x4d')]+0x1,'app':_0x91e6('0xa6'),'appdata':_0x91e6('0xa7'),'interval':_0x91e6('0xa8')});}_0x15d816[_0x91e6('0xa2')][_0x91e6('0xa3')]=!![];}return db[_0x91e6('0xa9')][_0x91e6('0x5d')]({'phone':_0x15d816[_0x91e6('0x5e')][_0x91e6('0x86')],'messageId':_0x15d816[_0x91e6('0x5e')][_0x91e6('0x84')],'body':_0x15d816[_0x91e6('0x5e')]['body'],'SmsAccountId':_0xe3e0e4[_0x91e6('0x5b')]['id'],'SmsInteractionId':_0x1977c5['id'],'direction':'in','ContactId':_0x1977c5[_0x91e6('0xaa')],'AttachmentId':_0x15d816['body']['AttachmentId']});})['then'](function(_0x3d9490){_0x15d816[_0x91e6('0x2a')]=_0x3d9490;if(_0x15d816[_0x91e6('0xa2')][_0x91e6('0xab')]){return db[_0x91e6('0xac')]['find']({'attributes':['id',_0x91e6('0x3e')],'where':{'id':_0x15d816['interaction'][_0x91e6('0xab')]}})[_0x91e6('0x22')](function(_0x12a8d5){if(_0x12a8d5){_0x15d816[_0x91e6('0x77')][_0x91e6('0xad')]({'id':0x0,'priority':0x0,'app':_0x91e6('0xae'),'appdata':_0x12a8d5[_0x91e6('0x3e')]+','+(_0x15d816['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x91e6('0xaf'),_0x15d816);});}return respondWithRpcPromise(_0x91e6('0xb0'),_0x91e6('0xaf'),_0x15d816);})['then'](function(_0x3f9ada){if(_0x3f9ada){var _0x396302=0xc8;var _0x460263=_0x91e6('0xb1');logger[_0x91e6('0x23')](_0x91e6('0xb2'),_0x460263,_0x396302,_0x91e6('0xb3'));logger[_0x91e6('0x26')](_0x91e6('0xb4'),_0x460263,_0x396302,_0x91e6('0xb3'),JSON[_0x91e6('0x27')](_0x3f9ada));if(_0x15d816['account']['type']===_0x91e6('0xb5')){return _0x37a6c0[_0x91e6('0x2e')](_0x396302)[_0x91e6('0x35')]('Content-Type',_0x91e6('0xb6'))[_0x91e6('0x3f')](_0x91e6('0xb7'));}else{return _0x37a6c0[_0x91e6('0x2e')](_0x396302)[_0x91e6('0x30')](_0x3f9ada);}}})[_0x91e6('0x2c')](handleError(_0x37a6c0,null));};exports['addApplications']=function(_0x1176da,_0x4d74eb){var _0x3fd5e0=_0x1176da['params']['id'];var _0x545903=_0x1176da[_0x91e6('0x5e')];var _0x3bb1bd=0xc8;var _0x49e7e7=null;return db[_0x91e6('0xb8')][_0x91e6('0xb9')]({'isolationLevel':db[_0x91e6('0xb8')][_0x91e6('0xba')]['ISOLATION_LEVELS'][_0x91e6('0xbb')]},function(_0x2c6c4d){return db['SmsAccount'][_0x91e6('0x6c')]({'where':{'id':_0x3fd5e0},'transaction':_0x2c6c4d})[_0x91e6('0x22')](function(_0x57fad9){if(_0x57fad9){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x3fd5e0},'transaction':_0x2c6c4d})[_0x91e6('0x22')](function(){var _0x53c39b=_[_0x91e6('0x46')](_0x545903,function(_0x55ae74){_0x55ae74[_0x91e6('0x69')]=_0x3fd5e0;return _0x55ae74;});return db[_0x91e6('0x75')][_0x91e6('0xbc')](_0x53c39b,{'transaction':_0x2c6c4d});});}else{_0x3bb1bd=0x194;_0x49e7e7=[];}});})[_0x91e6('0x22')](function(){if(_0x3bb1bd!==0x194){return db['SmsApplication'][_0x91e6('0xbd')]({'where':{'SmsAccountId':_0x3fd5e0},'order':_0x91e6('0xbe')})[_0x91e6('0x22')](function(_0x525b4e){_0x49e7e7=_0x525b4e;});}})['catch'](function(_0x2b83e1){_0x3bb1bd=0x1f4;logger[_0x91e6('0x29')](_0x2b83e1[_0x91e6('0x3d')]);if(_0x2b83e1[_0x91e6('0x3e')]){delete _0x2b83e1[_0x91e6('0x3e')];}_0x49e7e7=_0x2b83e1;})[_0x91e6('0xbf')](function(){if(_0x49e7e7===null){_0x4d74eb[_0x91e6('0x2d')](_0x3bb1bd);}else{if(_0x3bb1bd===0x1f4){_0x4d74eb[_0x91e6('0x2e')](_0x3bb1bd)[_0x91e6('0x3f')](_0x49e7e7);}else{_0x4d74eb[_0x91e6('0x2e')](_0x3bb1bd)['json'](_0x49e7e7);}}});};exports[_0x91e6('0xc0')]=function(_0x5ed6e2,_0xd9075c,_0x5df91d){var _0xaa5c04={};var _0x32fe8f={};var _0x5c1dd1;var _0x231313;return db[_0x91e6('0x56')][_0x91e6('0x6c')]({'where':{'id':_0x5ed6e2[_0x91e6('0x5b')]['id']}})[_0x91e6('0x22')](handleEntityNotFound(_0xd9075c,null))['then'](function(_0x499f7f){if(_0x499f7f){_0x5c1dd1=_0x499f7f;_0x32fe8f[_0x91e6('0x4a')]=_['keys'](db[_0x91e6('0x75')][_0x91e6('0x43')]);_0x32fe8f[_0x91e6('0x47')]=_[_0x91e6('0x48')](_0x5ed6e2[_0x91e6('0x47')]);_0x32fe8f[_0x91e6('0x51')]=_[_0x91e6('0x49')](_0x32fe8f[_0x91e6('0x4a')],_0x32fe8f[_0x91e6('0x47')]);_0xaa5c04['attributes']=_['intersection'](_0x32fe8f[_0x91e6('0x4a')],qs[_0x91e6('0x4c')](_0x5ed6e2[_0x91e6('0x47')]['fields']));_0xaa5c04[_0x91e6('0x4b')]=_0xaa5c04[_0x91e6('0x4b')]['length']?_0xaa5c04[_0x91e6('0x4b')]:_0x32fe8f['model'];_0xaa5c04[_0x91e6('0x6d')]=qs['sort'](_0x5ed6e2['query'][_0x91e6('0x4f')]);_0xaa5c04[_0x91e6('0x50')]=qs[_0x91e6('0x51')](_['pick'](_0x5ed6e2[_0x91e6('0x47')],_0x32fe8f['filters']));if(_0x5ed6e2[_0x91e6('0x47')]['filter']){_0xaa5c04[_0x91e6('0x50')]=_[_0x91e6('0x54')](_0xaa5c04[_0x91e6('0x50')],{'$or':_['map'](_0xaa5c04[_0x91e6('0x4b')],function(_0x33c546){var _0x1b0f68={};_0x1b0f68[_0x33c546]={'$like':'%'+_0x5ed6e2[_0x91e6('0x47')][_0x91e6('0x53')]+'%'};return _0x1b0f68;})});}_0xaa5c04=_['merge']({},_0xaa5c04,_0x5ed6e2[_0x91e6('0x5c')]);return _0x5c1dd1[_0x91e6('0xc0')](_0xaa5c04);}})['then'](function(_0xcc32c7){if(_0xcc32c7){_0x231313=_0xcc32c7[_0x91e6('0x4d')];if(!_0x5ed6e2[_0x91e6('0x47')][_0x91e6('0x4e')](_0x91e6('0x72'))){_0xaa5c04[_0x91e6('0x33')]=qs['limit'](_0x5ed6e2['query']['limit']);_0xaa5c04[_0x91e6('0x31')]=qs[_0x91e6('0x31')](_0x5ed6e2[_0x91e6('0x47')][_0x91e6('0x31')]);}return _0x5c1dd1[_0x91e6('0xc0')](_0xaa5c04);}})[_0x91e6('0x22')](function(_0x302e0e){if(_0x302e0e){return _0x302e0e?{'count':_0x231313,'rows':_0x302e0e}:null;}})[_0x91e6('0x22')](respondWithResult(_0xd9075c,null))[_0x91e6('0x2c')](handleError(_0xd9075c,null));};exports[_0x91e6('0xc1')]=function(_0x67d61f,_0x58e1f3,_0x4efb45){var _0x1b8edc={'raw':![],'where':{}};var _0x57de65={};var _0x2a5e80={'count':0x0,'rows':[]};return db[_0x91e6('0x56')]['findOne']({'where':{'id':_0x67d61f['params']['id']}})[_0x91e6('0x22')](handleEntityNotFound(_0x58e1f3,null))[_0x91e6('0x22')](function(_0x373e59){if(_0x373e59){_0x57de65[_0x91e6('0x4a')]=_[_0x91e6('0x48')](db[_0x91e6('0xa0')][_0x91e6('0x43')]);_0x57de65[_0x91e6('0x47')]=_[_0x91e6('0x48')](_0x67d61f[_0x91e6('0x47')]);_0x57de65[_0x91e6('0x51')]=_['intersection'](_0x57de65[_0x91e6('0x4a')],_0x57de65[_0x91e6('0x47')]);_0x1b8edc['attributes']=_['intersection'](_0x57de65['model'],qs[_0x91e6('0x4c')](_0x67d61f[_0x91e6('0x47')][_0x91e6('0x4c')]));_0x1b8edc[_0x91e6('0x4b')]=_0x1b8edc[_0x91e6('0x4b')][_0x91e6('0x4d')]?_0x1b8edc[_0x91e6('0x4b')]:_0x57de65['model'];if(!_0x67d61f[_0x91e6('0x47')]['hasOwnProperty'](_0x91e6('0x72'))){_0x1b8edc['limit']=qs['limit'](_0x67d61f['query'][_0x91e6('0x33')]);_0x1b8edc[_0x91e6('0x31')]=qs[_0x91e6('0x31')](_0x67d61f[_0x91e6('0x47')]['offset']);}_0x1b8edc[_0x91e6('0x6d')]=qs[_0x91e6('0x4f')](_0x67d61f[_0x91e6('0x47')]['sort']);_0x1b8edc[_0x91e6('0x50')]=qs[_0x91e6('0x51')](_[_0x91e6('0x52')](_0x67d61f[_0x91e6('0x47')],_0x57de65[_0x91e6('0x51')]));_0x1b8edc['where'][_0x91e6('0x69')]=_0x373e59['id'];if(_0x67d61f[_0x91e6('0x47')]['filter']){_0x1b8edc[_0x91e6('0x50')]=_['merge'](_0x1b8edc[_0x91e6('0x50')],{'$or':_['map'](_0x1b8edc['attributes'],function(_0x123722){var _0x5b174f={};_0x5b174f[_0x123722]={'$like':'%'+_0x67d61f[_0x91e6('0x47')][_0x91e6('0x53')]+'%'};return _0x5b174f;})});}_0x1b8edc=_[_0x91e6('0x54')]({},_0x1b8edc,_0x67d61f[_0x91e6('0x5c')]);return db['SmsInteraction']['count']({'where':_0x1b8edc[_0x91e6('0x50')]})[_0x91e6('0x22')](function(_0x504683){_0x2a5e80[_0x91e6('0x34')]=_0x504683;if(_0x67d61f[_0x91e6('0x47')]['includeAll']){_0x1b8edc['include']=[{'model':db[_0x91e6('0x9b')],'as':'Contact','required':![]},{'model':db[_0x91e6('0xac')],'as':'Owner','attributes':[_0x91e6('0x3e'),_0x91e6('0xc2'),_0x91e6('0xc3')],'required':![]},{'model':db['Tag'],'as':_0x91e6('0xc4'),'attributes':['id','name','color'],'where':_0x67d61f[_0x91e6('0x47')][_0x91e6('0xc5')]?{'id':_0x67d61f['query'][_0x91e6('0xc5')]}:undefined,'required':_0x67d61f[_0x91e6('0x47')]['tag']?!![]:![]}];}return db[_0x91e6('0xa0')][_0x91e6('0x59')](_0x1b8edc);})['then'](function(_0x3d5bb7){_0x2a5e80[_0x91e6('0x5a')]=_0x3d5bb7;return _0x2a5e80;});}})[_0x91e6('0x22')](respondWithFilteredResult(_0x58e1f3,_0x1b8edc))[_0x91e6('0x2c')](handleError(_0x58e1f3,null));};exports[_0x91e6('0x3f')]=function(_0x5f574c,_0x53fc99,_0x5b90d7){var _0x377bc2,_0xaa7a03,_0x32e92f;if(_[_0x91e6('0x94')](_0x5f574c[_0x91e6('0x5e')][_0x91e6('0x5e')])||_0x5f574c[_0x91e6('0x5e')][_0x91e6('0x5e')]===''){throw new db[(_0x91e6('0x7b'))][(_0x91e6('0x7c'))](_0x91e6('0x96'));}if(_[_0x91e6('0x94')](_0x5f574c[_0x91e6('0x5e')]['to'])){throw new db[(_0x91e6('0x7b'))][(_0x91e6('0x7c'))](_0x91e6('0xc6'));}_0x377bc2=_0x5f574c[_0x91e6('0x5e')]['to'];return db[_0x91e6('0x56')]['find']({'where':{'id':_0x5f574c[_0x91e6('0x5b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x91e6('0x9b')],'as':_0x91e6('0x9c'),'where':{'mobile':_0x377bc2},'limit':0x1,'order':[[_0x91e6('0x80'),_0x91e6('0x9d')]]}]}]})[_0x91e6('0x22')](handleEntityNotFound(_0x53fc99,null))[_0x91e6('0x22')](function(_0x205d78){if(_0x205d78&&_0x205d78[_0x91e6('0xc7')]){_0xaa7a03=_0x205d78[_0x91e6('0x60')]({'plain':!![]});if(_0xaa7a03['List']&&_0xaa7a03[_0x91e6('0xc7')][_0x91e6('0x9c')]['length']){return _0xaa7a03['List'][_0x91e6('0x9c')][0x0];}return db[_0x91e6('0x9b')][_0x91e6('0x5d')](_['defaults'](_0x5f574c['body'],{'firstName':_0x377bc2,'mobile':_0x377bc2,'phone':_0x377bc2,'ListId':_0xaa7a03[_0x91e6('0x81')]}));}})[_0x91e6('0x22')](handleEntityNotFound(_0x53fc99,null))[_0x91e6('0x22')](function(_0x5afa73){if(_0x5afa73){_0x32e92f=_0x5afa73;return db[_0x91e6('0xa0')][_0x91e6('0x67')]({'where':{'ContactId':_0x32e92f['id'],'closed':![],'SmsAccountId':_0xaa7a03['id']}})[_0x91e6('0x22')](function(_0x83cb53){if(_0x83cb53){return[_0x83cb53,![]];}return db[_0x91e6('0xa0')][_0x91e6('0x5d')]({'UserId':_0x5f574c['user']['id'],'ContactId':_0x32e92f['id'],'SmsAccountId':_0xaa7a03['id'],'phone':_0x377bc2,'firstMsgDirection':'out','Messages':[_['merge'](_0x5f574c[_0x91e6('0x5e')],{'read':![],'body':_0x5f574c[_0x91e6('0x5e')][_0x91e6('0x5e')],'phone':_0x377bc2,'SmsAccountId':_0xaa7a03['id'],'UserId':_0x5f574c[_0x91e6('0x5f')]['id'],'ContactId':_0x32e92f['id']})]},{'include':[{'model':db[_0x91e6('0xa9')],'as':_0x91e6('0xc8')}]})['then'](function(_0x293641){return[_0x293641,!![]];});});}})[_0x91e6('0xa1')](function(_0x5b8068,_0x5be048){if(_0x5be048){return _0x5b8068;}return db[_0x91e6('0xa9')]['create'](_[_0x91e6('0x54')](_0x5f574c[_0x91e6('0x5e')],{'read':![],'body':_0x5f574c['body']['body'],'phone':_0x377bc2,'SmsAccountId':_0xaa7a03['id'],'SmsInteractionId':_0x5b8068['id'],'UserId':_0x5f574c[_0x91e6('0x5f')]['id'],'ContactId':_0x32e92f['id']}))[_0x91e6('0x22')](function(_0x44488d){_0x5b8068[_0x91e6('0xc9')][_0x91e6('0xc8')]=[];_0x5b8068[_0x91e6('0xc9')]['Messages'][_0x91e6('0xa5')](_0x44488d[_0x91e6('0xc9')]);return _0x5b8068;});})[_0x91e6('0x22')](respondWithResult(_0x53fc99,null))[_0x91e6('0x2c')](handleError(_0x53fc99,null));};exports[_0x91e6('0x2e')]=function(_0x534716,_0x18eeae,_0x5234a1){if(_0x534716[_0x91e6('0x5e')]['id']){delete _0x534716['body']['id'];}var _0x1eada4,_0x5888a6,_0x2ab526;return db[_0x91e6('0x56')]['find']({'where':{'id':_0x534716[_0x91e6('0x5b')]['id']}})[_0x91e6('0x22')](handleEntityNotFound(_0x18eeae,null))[_0x91e6('0x22')](function(_0xaa3686){if(_0xaa3686){_0x2ab526=_0xaa3686;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x91e6('0x2e'),_0x91e6('0xca'),_0xaa3686['type'],util[_0x91e6('0xcb')](_0x534716[_0x91e6('0x5e')],{'showHidden':![],'depth':null}));switch(_0xaa3686[_0x91e6('0x55')]){case _0x91e6('0x85'):if(_0x534716[_0x91e6('0x5e')]['skebby_dispatch_id']&&_0x534716[_0x91e6('0x5e')][_0x91e6('0x2e')]){_0x5888a6=_0x534716[_0x91e6('0x5e')]['status'];return db[_0x91e6('0xa9')]['find']({'where':{'messageId':_0x534716[_0x91e6('0x5e')]['skebby_dispatch_id']}});}break;case _0x91e6('0xcc'):if(_0x534716['body'][_0x91e6('0xcd')]&&_0x534716[_0x91e6('0x5e')][_0x91e6('0xce')]){_0x5888a6=_0x534716['body'][_0x91e6('0xce')];return db['SmsMessage'][_0x91e6('0x67')]({'where':{'messageId':_0x534716[_0x91e6('0x5e')][_0x91e6('0xcd')]}});}break;case _0x91e6('0x88'):if(_0x534716['body']['message_id']&&_0x534716['body'][_0x91e6('0xcf')]){_0x5888a6=_0x534716[_0x91e6('0x5e')][_0x91e6('0xcf')];return db[_0x91e6('0xa9')]['find']({'where':{'messageId':_0x534716[_0x91e6('0x5e')][_0x91e6('0x89')]}});}break;case _0x91e6('0xd0'):var _0x1158fc=_0x534716[_0x91e6('0x5e')][_0x91e6('0x8e')][0x0];if(_0x1158fc[_0x91e6('0x84')]&&_0x1158fc[_0x91e6('0x2e')][_0x91e6('0xd1')]===_0x91e6('0xd2')){_0x5888a6=_0x1158fc[_0x91e6('0x2e')][_0x91e6('0xd1')];return db[_0x91e6('0xa9')][_0x91e6('0x67')]({'where':{'messageId':_0x1158fc[_0x91e6('0x84')]}});}break;case _0x91e6('0x90'):if(_0x534716[_0x91e6('0x5e')]['messageId']&&_0x534716[_0x91e6('0x5e')][_0x91e6('0x2e')]){_0x5888a6=_0x534716['body'][_0x91e6('0x2e')];return db['SmsMessage']['find']({'where':{'messageId':_0x534716[_0x91e6('0x5e')][_0x91e6('0x84')]}});}break;case _0x91e6('0x91'):if(_0x534716['body'][0x0][_0x91e6('0x2a')]['id']){_0x5888a6=_0x534716[_0x91e6('0x5e')][0x0]['type'];return db[_0x91e6('0xa9')][_0x91e6('0x67')]({'where':{'messageId':_0x534716[_0x91e6('0x5e')][0x0]['message']['id']}});}break;case _0x91e6('0x92'):if(_0x534716[_0x91e6('0x5e')][_0x91e6('0xd3')]&&_0x534716['body'][_0x91e6('0x2e')]){_0x5888a6=_0x534716['body']['status'];return db[_0x91e6('0xa9')][_0x91e6('0x67')]({'where':{'messageId':_0x534716[_0x91e6('0x5e')][_0x91e6('0xd3')]}});}break;}}})['then'](handleEntityNotFound(_0x18eeae,null))['then'](function(_0x48c61a){if(_0x48c61a){_0x1eada4=_0x48c61a;switch(_0x2ab526[_0x91e6('0x55')]){case _0x91e6('0x85'):if(_0x5888a6==='DELIVERED'){return _0x1eada4[_0x91e6('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x91e6('0x2e'),_0x91e6('0x85'),util[_0x91e6('0xcb')](_0x534716[_0x91e6('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x91e6('0xcc'):if(_0x5888a6==='1'){return _0x1eada4[_0x91e6('0x39')]({'read':!![]});}else{logger[_0x91e6('0x29')](_0x91e6('0xb2'),_0x91e6('0x2e'),'skebby',util['inspect'](_0x534716['body'],{'showHidden':![],'depth':null}));}break;case _0x91e6('0x88'):if(!_0x534716[_0x91e6('0x5e')]['error_code']&&_0x5888a6>=0xc8&&_0x5888a6<=0xce){return _0x1eada4[_0x91e6('0x39')]({'read':!![]});}else{logger[_0x91e6('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x91e6('0x2e'),_0x91e6('0x88'),util[_0x91e6('0xcb')](_0x534716[_0x91e6('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x91e6('0xd0'):var _0x5a297b=_0x534716[_0x91e6('0x5e')][_0x91e6('0x8e')][0x0];if(_0x5a297b[_0x91e6('0x2e')]['groupName']==='DELIVERED'){return _0x1eada4[_0x91e6('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x91e6('0x2e'),_0x91e6('0xd0'),util['inspect'](_0x534716[_0x91e6('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x91e6('0x90'):if(_0x5888a6==_0x91e6('0xd4')||_0x5888a6==_0x91e6('0xd5')){return _0x1eada4[_0x91e6('0x39')]({'read':!![]});}else{logger[_0x91e6('0x29')](_0x91e6('0xb2'),_0x91e6('0x2e'),_0x91e6('0x90'),util['inspect'](_0x534716['body'],{'showHidden':![],'depth':null}));}break;case _0x91e6('0x91'):if(_0x5888a6==_0x91e6('0xd6')){return _0x1eada4[_0x91e6('0x39')]({'read':!![]});}else{logger[_0x91e6('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x91e6('0x91'),util[_0x91e6('0xcb')](_0x534716[_0x91e6('0x5e')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x5888a6===_0x91e6('0xd7')||_0x5888a6==='ACCEPTD'){return _0x1eada4[_0x91e6('0x39')]({'read':!![]});}else{logger['error'](_0x91e6('0xb2'),_0x91e6('0x2e'),_0x91e6('0x92'),util[_0x91e6('0xcb')](_0x534716['body'],{'showHidden':![],'depth':null}));}break;}return _0x1eada4;}})['then'](respondWithResult(_0x18eeae,null))[_0x91e6('0x2c')](handleError(_0x18eeae,null));};exports[_0x91e6('0xd8')]=function(_0x3b65c1,_0x337661,_0x417de6){var _0x35bc7f,_0x13dae5,_0x564c11;return db[_0x91e6('0x56')][_0x91e6('0x67')]({'where':{'id':_0x3b65c1['params']['id']}})[_0x91e6('0x22')](handleEntityNotFound(_0x337661,null))[_0x91e6('0x22')](function(_0x3e4206){if(_0x3e4206){_0x564c11=_0x3e4206;logger['debug'](_0x91e6('0xb2'),_0x91e6('0x2e'),_0x91e6('0xca'),_0x3e4206['type'],util[_0x91e6('0xcb')](_0x3b65c1[_0x91e6('0x47')],{'showHidden':![],'depth':null}));switch(_0x3e4206[_0x91e6('0x55')]){case'csc':if(_0x3b65c1['query'][_0x91e6('0xd9')]&&_0x3b65c1[_0x91e6('0x47')][_0x91e6('0xda')]){_0x13dae5=_0x3b65c1[_0x91e6('0x47')]['state'];return db[_0x91e6('0xa9')][_0x91e6('0x67')]({'where':{'messageId':_0x3b65c1['query']['message-id']}});}break;}}})[_0x91e6('0x22')](handleEntityNotFound(_0x337661,null))['then'](function(_0x3c3028){if(_0x3c3028){_0x35bc7f=_0x3c3028;switch(_0x564c11[_0x91e6('0x55')]){case _0x91e6('0x8f'):if(_0x13dae5==='2'||_0x13dae5==='6'){return _0x35bc7f[_0x91e6('0x39')]({'read':!![]});}else{logger['error'](_0x91e6('0xb2'),_0x91e6('0x2e'),_0x91e6('0x8f'),util[_0x91e6('0xcb')](_0x3b65c1[_0x91e6('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x35bc7f;}})[_0x91e6('0x22')](respondWithResult(_0x337661,null))[_0x91e6('0x2c')](handleError(_0x337661,null));};exports[_0x91e6('0xdb')]=function(_0x10108c,_0x33970e,_0x4a26da){return db[_0x91e6('0x56')]['find']({'where':{'id':_0x10108c[_0x91e6('0x5b')]['id']}})[_0x91e6('0x22')](handleEntityNotFound(_0x33970e,null))[_0x91e6('0x22')](function(_0x3a067c){if(_0x3a067c){return _0x3a067c['addAgents'](_0x10108c['body'][_0x91e6('0xdc')],_['omit'](_0x10108c[_0x91e6('0x5e')],[_0x91e6('0xdc'),'id'])||{})[_0x91e6('0xa1')](function(_0x1d494e){for(var _0x51308a=0x0;_0x51308a<_0x10108c[_0x91e6('0x5e')][_0x91e6('0xdc')]['length'];_0x51308a+=0x1){socket[_0x91e6('0xdd')](_0x91e6('0xde'),{'UserId':Number(_0x10108c[_0x91e6('0x5e')][_0x91e6('0xdc')][_0x51308a]),'SmsAccountId':Number(_0x10108c[_0x91e6('0x5b')]['id'])});}return _0x1d494e;});}})[_0x91e6('0x22')](respondWithResult(_0x33970e,null))[_0x91e6('0x2c')](handleError(_0x33970e,null));};exports[_0x91e6('0xdf')]=function(_0x3b4019,_0x331285,_0x46f167){return db[_0x91e6('0x56')][_0x91e6('0x67')]({'where':{'id':_0x3b4019['params']['id']}})[_0x91e6('0x22')](handleEntityNotFound(_0x331285,null))[_0x91e6('0x22')](function(_0xa07a1f){if(_0xa07a1f){return _0xa07a1f[_0x91e6('0xdf')](_0x3b4019[_0x91e6('0x47')][_0x91e6('0xdc')])['then'](function(){if(_[_0x91e6('0xe0')](_0x3b4019['query'][_0x91e6('0xdc')])){for(var _0x3e5b5b=0x0;_0x3e5b5b<_0x3b4019['query'][_0x91e6('0xdc')][_0x91e6('0x4d')];_0x3e5b5b+=0x1){socket[_0x91e6('0xdd')](_0x91e6('0xe1'),{'UserId':Number(_0x3b4019[_0x91e6('0x47')]['ids'][_0x3e5b5b]),'SmsAccountId':Number(_0x3b4019['params']['id'])});}}else{socket[_0x91e6('0xdd')](_0x91e6('0xe1'),{'UserId':Number(_0x3b4019[_0x91e6('0x47')][_0x91e6('0xdc')]),'SmsAccountId':Number(_0x3b4019[_0x91e6('0x5b')]['id'])});}});}})[_0x91e6('0x22')](respondWithStatusCode(_0x331285,null))[_0x91e6('0x2c')](handleError(_0x331285,null));};exports[_0x91e6('0xe2')]=function(_0x132dce,_0x35229f,_0x2c4988){var _0x5ad7ee={};var _0x4f5eca={};var _0x520428;var _0x72c6d6;return db[_0x91e6('0x56')][_0x91e6('0x6c')]({'where':{'id':_0x132dce[_0x91e6('0x5b')]['id']}})[_0x91e6('0x22')](handleEntityNotFound(_0x35229f,null))[_0x91e6('0x22')](function(_0x321bad){if(_0x321bad){_0x520428=_0x321bad;_0x4f5eca['model']=_[_0x91e6('0x48')](db[_0x91e6('0xac')][_0x91e6('0x43')]);_0x4f5eca[_0x91e6('0x47')]=_[_0x91e6('0x48')](_0x132dce[_0x91e6('0x47')]);_0x4f5eca['filters']=_[_0x91e6('0x49')](_0x4f5eca[_0x91e6('0x4a')],_0x4f5eca[_0x91e6('0x47')]);_0x5ad7ee[_0x91e6('0x4b')]=_[_0x91e6('0x49')](_0x4f5eca[_0x91e6('0x4a')],qs[_0x91e6('0x4c')](_0x132dce[_0x91e6('0x47')][_0x91e6('0x4c')]));_0x5ad7ee['attributes']=_0x5ad7ee[_0x91e6('0x4b')][_0x91e6('0x4d')]?_0x5ad7ee['attributes']:_0x4f5eca[_0x91e6('0x4a')];_0x5ad7ee['order']=qs[_0x91e6('0x4f')](_0x132dce[_0x91e6('0x47')][_0x91e6('0x4f')]);_0x5ad7ee[_0x91e6('0x50')]=qs[_0x91e6('0x51')](_['pick'](_0x132dce[_0x91e6('0x47')],_0x4f5eca[_0x91e6('0x51')]));if(_0x132dce['query'][_0x91e6('0x53')]){_0x5ad7ee[_0x91e6('0x50')]=_['merge'](_0x5ad7ee[_0x91e6('0x50')],{'$or':_['map'](_0x5ad7ee[_0x91e6('0x4b')],function(_0xc81d5e){var _0x1e8fb3={};_0x1e8fb3[_0xc81d5e]={'$like':'%'+_0x132dce[_0x91e6('0x47')]['filter']+'%'};return _0x1e8fb3;})});}_0x5ad7ee=_['merge']({},_0x5ad7ee,_0x132dce[_0x91e6('0x5c')]);return _0x520428['getAgents'](_0x5ad7ee);}})['then'](function(_0x1187cf){if(_0x1187cf){_0x72c6d6=_0x1187cf[_0x91e6('0x4d')];if(!_0x132dce[_0x91e6('0x47')][_0x91e6('0x4e')](_0x91e6('0x72'))){_0x5ad7ee['limit']=qs[_0x91e6('0x33')](_0x132dce[_0x91e6('0x47')][_0x91e6('0x33')]);_0x5ad7ee[_0x91e6('0x31')]=qs[_0x91e6('0x31')](_0x132dce[_0x91e6('0x47')][_0x91e6('0x31')]);}return _0x520428[_0x91e6('0xe2')](_0x5ad7ee);}})[_0x91e6('0x22')](function(_0x215942){if(_0x215942){return _0x215942?{'count':_0x72c6d6,'rows':_0x215942}:null;}})['then'](respondWithResult(_0x35229f,null))[_0x91e6('0x2c')](handleError(_0x35229f,null));};
\ No newline at end of file
index d3dec80..0250d8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbefe=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','save'];(function(_0x5b8bec,_0x57d320){var _0x44b227=function(_0x26fb73){while(--_0x26fb73){_0x5b8bec['push'](_0x5b8bec['shift']());}};_0x44b227(++_0x57d320);}(_0xbefe,0x92));var _0xebef=function(_0x582df7,_0x3d02cf){_0x582df7=_0x582df7-0x0;var _0x5081fd=_0xbefe[_0x582df7];return _0x5081fd;};'use strict';var EventEmitter=require(_0xebef('0x0'));var SmsAccount=require(_0xebef('0x1'))['db'][_0xebef('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xebef('0x3'),'afterUpdate':_0xebef('0x4'),'afterDestroy':_0xebef('0x5')};function emitEvent(_0x30ea78){return function(_0x3cfe9e,_0x491ca1,_0x1ca35b){SmsAccountEvents[_0xebef('0x6')](_0x30ea78+':'+_0x3cfe9e['id'],_0x3cfe9e);SmsAccountEvents[_0xebef('0x6')](_0x30ea78,_0x3cfe9e);_0x1ca35b(null);};}for(var e in events){if(events[_0xebef('0x7')](e)){var event=events[e];SmsAccount[_0xebef('0x8')](e,emitEvent(event));}}module[_0xebef('0x9')]=SmsAccountEvents;
\ No newline at end of file
+var _0x6e7a=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x2425ab,_0x173179){var _0xf39c65=function(_0x54b31c){while(--_0x54b31c){_0x2425ab['push'](_0x2425ab['shift']());}};_0xf39c65(++_0x173179);}(_0x6e7a,0x198));var _0xa6e7=function(_0xcc2c66,_0x27cf7b){_0xcc2c66=_0xcc2c66-0x0;var _0x2197b2=_0x6e7a[_0xcc2c66];return _0x2197b2;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xa6e7('0x0'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xa6e7('0x1')](0x0);var events={'afterCreate':_0xa6e7('0x2'),'afterUpdate':_0xa6e7('0x3'),'afterDestroy':_0xa6e7('0x4')};function emitEvent(_0x5ed00e){return function(_0x2e9bb0,_0x1cb7bb,_0x3e2fd9){SmsAccountEvents[_0xa6e7('0x5')](_0x5ed00e+':'+_0x2e9bb0['id'],_0x2e9bb0);SmsAccountEvents[_0xa6e7('0x5')](_0x5ed00e,_0x2e9bb0);_0x3e2fd9(null);};}for(var e in events){if(events[_0xa6e7('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xa6e7('0x7')]=SmsAccountEvents;
\ No newline at end of file
index a0d94cf..0125e0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bd9=['sms_accounts','lodash','util','api','bluebird','request-promise','path','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount'];(function(_0x4c282c,_0x252529){var _0xf3e8bc=function(_0x4eedf9){while(--_0x4eedf9){_0x4c282c['push'](_0x4c282c['shift']());}};_0xf3e8bc(++_0x252529);}(_0x0bd9,0xcd));var _0x90bd=function(_0xc51cc4,_0xe7cd55){_0xc51cc4=_0xc51cc4-0x0;var _0x4ca42d=_0x0bd9[_0xc51cc4];return _0x4ca42d;};'use strict';var _=require(_0x90bd('0x0'));var util=require(_0x90bd('0x1'));var logger=require('../../config/logger')(_0x90bd('0x2'));var moment=require('moment');var BPromise=require(_0x90bd('0x3'));var rp=require(_0x90bd('0x4'));var fs=require('fs');var path=require(_0x90bd('0x5'));var rimraf=require('rimraf');var config=require(_0x90bd('0x6'));var attributes=require(_0x90bd('0x7'));module[_0x90bd('0x8')]=function(_0x59318d,_0x2bfeaf){return _0x59318d[_0x90bd('0x9')](_0x90bd('0xa'),attributes,{'tableName':_0x90bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2663=['sms_accounts','lodash','util','../../config/logger','path','rimraf','./smsAccount.attributes','exports'];(function(_0x5fe5ca,_0x4e92d3){var _0x42f45f=function(_0x2511eb){while(--_0x2511eb){_0x5fe5ca['push'](_0x5fe5ca['shift']());}};_0x42f45f(++_0x4e92d3);}(_0x2663,0x151));var _0x3266=function(_0x159f91,_0xe8a30f){_0x159f91=_0x159f91-0x0;var _0x26bd65=_0x2663[_0x159f91];return _0x26bd65;};'use strict';var _=require(_0x3266('0x0'));var util=require(_0x3266('0x1'));var logger=require(_0x3266('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3266('0x3'));var rimraf=require(_0x3266('0x4'));var config=require('../../config/environment');var attributes=require(_0x3266('0x5'));module[_0x3266('0x6')]=function(_0x4edd3b,_0x5ca038){return _0x4edd3b['define']('SmsAccount',attributes,{'tableName':_0x3266('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d3c5eca..3786e9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccb1=['jayson/promise','client','redis','defaults','./smsAccount.socket','register','request','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','SmsAccount,\x20%s,\x20%s','message','info','result','catch','ShowSmsAccount','find','options','attributes','include','model','map','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4ad1b3,_0x5ddf55){var _0x3b0b7e=function(_0x1039ea){while(--_0x1039ea){_0x4ad1b3['push'](_0x4ad1b3['shift']());}};_0x3b0b7e(++_0x5ddf55);}(_0xccb1,0x1e0));var _0x1ccb=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xccb1[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x1ccb('0x0'));var util=require(_0x1ccb('0x1'));var moment=require(_0x1ccb('0x2'));var BPromise=require(_0x1ccb('0x3'));var rs=require(_0x1ccb('0x4'));var fs=require('fs');var Redis=require(_0x1ccb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ccb('0x6'));var logger=require(_0x1ccb('0x7'))(_0x1ccb('0x8'));var config=require(_0x1ccb('0x9'));var jayson=require(_0x1ccb('0xa'));var client=jayson[_0x1ccb('0xb')]['http']({'port':0x232a});config[_0x1ccb('0xc')]=_[_0x1ccb('0xd')](config[_0x1ccb('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ccb('0xc')]));require(_0x1ccb('0xe'))[_0x1ccb('0xf')](socket);function respondWithRpcPromise(_0x4acbe8,_0x166bfb,_0x2a385b){return new BPromise(function(_0x2ba1b9,_0x202fd0){return client[_0x1ccb('0x10')](_0x4acbe8,_0x2a385b)['then'](function(_0x3fb494){logger['info']('SmsAccount,\x20%s,\x20%s',_0x166bfb,_0x1ccb('0x11'));logger[_0x1ccb('0x12')](_0x1ccb('0x13'),_0x166bfb,_0x1ccb('0x11'),JSON['stringify'](_0x3fb494));if(_0x3fb494[_0x1ccb('0x14')]){if(_0x3fb494[_0x1ccb('0x14')][_0x1ccb('0x15')]===0x1f4){logger[_0x1ccb('0x14')](_0x1ccb('0x16'),_0x166bfb,_0x3fb494[_0x1ccb('0x14')][_0x1ccb('0x17')]);return _0x202fd0(_0x3fb494['error']['message']);}logger['error'](_0x1ccb('0x16'),_0x166bfb,_0x3fb494['error'][_0x1ccb('0x17')]);return _0x2ba1b9(_0x3fb494[_0x1ccb('0x14')][_0x1ccb('0x17')]);}else{logger[_0x1ccb('0x18')]('SmsAccount,\x20%s,\x20%s',_0x166bfb,_0x1ccb('0x11'));_0x2ba1b9(_0x3fb494[_0x1ccb('0x19')]['message']);}})[_0x1ccb('0x1a')](function(_0x3a6a10){logger[_0x1ccb('0x14')](_0x1ccb('0x16'),_0x166bfb,_0x3a6a10);_0x202fd0(_0x3a6a10);});});}exports[_0x1ccb('0x1b')]=function(_0x237f8d){var _0x5ccd85=this;return new Promise(function(_0x162e80,_0x259e05){return db['SmsAccount'][_0x1ccb('0x1c')]({'raw':_0x237f8d[_0x1ccb('0x1d')]?_0x237f8d[_0x1ccb('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x237f8d[_0x1ccb('0x1d')]?_0x237f8d[_0x1ccb('0x1d')]['where']||null:null,'attributes':_0x237f8d[_0x1ccb('0x1d')]?_0x237f8d[_0x1ccb('0x1d')][_0x1ccb('0x1e')]||null:null,'include':_0x237f8d[_0x1ccb('0x1d')]?_0x237f8d[_0x1ccb('0x1d')][_0x1ccb('0x1f')]?_['map'](_0x237f8d[_0x1ccb('0x1d')][_0x1ccb('0x1f')],function(_0x270f51){return{'model':db[_0x270f51[_0x1ccb('0x20')]],'as':_0x270f51['as'],'attributes':_0x270f51[_0x1ccb('0x1e')],'include':_0x270f51[_0x1ccb('0x1f')]?_[_0x1ccb('0x21')](_0x270f51['include'],function(_0xd28704){return{'model':db[_0xd28704[_0x1ccb('0x20')]],'as':_0xd28704['as'],'attributes':_0xd28704['attributes'],'include':_0xd28704[_0x1ccb('0x1f')]?_['map'](_0xd28704[_0x1ccb('0x1f')],function(_0x565f6b){return{'model':db[_0x565f6b[_0x1ccb('0x20')]],'as':_0x565f6b['as'],'attributes':_0x565f6b[_0x1ccb('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56c906){logger[_0x1ccb('0x18')](_0x1ccb('0x1b'),_0x237f8d);logger[_0x1ccb('0x12')](_0x1ccb('0x1b'),_0x237f8d,JSON[_0x1ccb('0x22')](_0x56c906));_0x162e80(_0x56c906);})[_0x1ccb('0x1a')](function(_0x122893){logger['error']('ShowSmsAccount',_0x122893['message'],_0x237f8d);_0x259e05(_0x5ccd85['error'](0x1f4,_0x122893[_0x1ccb('0x17')]));});});};
\ No newline at end of file
+var _0xf100=['include','map','model','ShowSmsAccount','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsAccount,\x20%s,\x20%s','info','result','catch','raw','options','where','attributes'];(function(_0xc41b1,_0x640e77){var _0x1eb550=function(_0x3f4f97){while(--_0x3f4f97){_0xc41b1['push'](_0xc41b1['shift']());}};_0x1eb550(++_0x640e77);}(_0xf100,0xd0));var _0x0f10=function(_0x1219e6,_0xc3cd3a){_0x1219e6=_0x1219e6-0x0;var _0x5e74d9=_0xf100[_0x1219e6];return _0x5e74d9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0f10('0x0'));var rs=require(_0x0f10('0x1'));var fs=require('fs');var Redis=require(_0x0f10('0x2'));var db=require(_0x0f10('0x3'))['db'];var utils=require(_0x0f10('0x4'));var logger=require('../../config/logger')(_0x0f10('0x5'));var config=require(_0x0f10('0x6'));var jayson=require(_0x0f10('0x7'));var client=jayson[_0x0f10('0x8')][_0x0f10('0x9')]({'port':0x232a});config[_0x0f10('0xa')]=_['defaults'](config[_0x0f10('0xa')],{'host':_0x0f10('0xb'),'port':0x18eb});var socket=require(_0x0f10('0xc'))(new Redis(config[_0x0f10('0xa')]));require(_0x0f10('0xd'))[_0x0f10('0xe')](socket);function respondWithRpcPromise(_0x34cab0,_0x4f15b4,_0xc185a8){return new BPromise(function(_0x17f3ad,_0x14b543){return client[_0x0f10('0xf')](_0x34cab0,_0xc185a8)[_0x0f10('0x10')](function(_0x391ec3){logger['info']('SmsAccount,\x20%s,\x20%s',_0x4f15b4,_0x0f10('0x11'));logger['debug'](_0x0f10('0x12'),_0x4f15b4,_0x0f10('0x11'),JSON[_0x0f10('0x13')](_0x391ec3));if(_0x391ec3['error']){if(_0x391ec3[_0x0f10('0x14')]['code']===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x4f15b4,_0x391ec3[_0x0f10('0x14')][_0x0f10('0x15')]);return _0x14b543(_0x391ec3[_0x0f10('0x14')][_0x0f10('0x15')]);}logger[_0x0f10('0x14')](_0x0f10('0x16'),_0x4f15b4,_0x391ec3[_0x0f10('0x14')]['message']);return _0x17f3ad(_0x391ec3['error']['message']);}else{logger[_0x0f10('0x17')](_0x0f10('0x16'),_0x4f15b4,'request\x20sent');_0x17f3ad(_0x391ec3[_0x0f10('0x18')][_0x0f10('0x15')]);}})[_0x0f10('0x19')](function(_0x5cd053){logger[_0x0f10('0x14')](_0x0f10('0x16'),_0x4f15b4,_0x5cd053);_0x14b543(_0x5cd053);});});}exports['ShowSmsAccount']=function(_0x5e42a4){var _0x24de06=this;return new Promise(function(_0x21663d,_0x4984fc){return db['SmsAccount']['find']({'raw':_0x5e42a4['options']?_0x5e42a4['options'][_0x0f10('0x1a')]===undefined?!![]:![]:!![],'where':_0x5e42a4[_0x0f10('0x1b')]?_0x5e42a4[_0x0f10('0x1b')][_0x0f10('0x1c')]||null:null,'attributes':_0x5e42a4[_0x0f10('0x1b')]?_0x5e42a4[_0x0f10('0x1b')][_0x0f10('0x1d')]||null:null,'include':_0x5e42a4[_0x0f10('0x1b')]?_0x5e42a4['options'][_0x0f10('0x1e')]?_[_0x0f10('0x1f')](_0x5e42a4[_0x0f10('0x1b')][_0x0f10('0x1e')],function(_0x3ef107){return{'model':db[_0x3ef107[_0x0f10('0x20')]],'as':_0x3ef107['as'],'attributes':_0x3ef107[_0x0f10('0x1d')],'include':_0x3ef107[_0x0f10('0x1e')]?_[_0x0f10('0x1f')](_0x3ef107[_0x0f10('0x1e')],function(_0x4d49e1){return{'model':db[_0x4d49e1[_0x0f10('0x20')]],'as':_0x4d49e1['as'],'attributes':_0x4d49e1[_0x0f10('0x1d')],'include':_0x4d49e1['include']?_[_0x0f10('0x1f')](_0x4d49e1['include'],function(_0x6afdec){return{'model':db[_0x6afdec[_0x0f10('0x20')]],'as':_0x6afdec['as'],'attributes':_0x6afdec[_0x0f10('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0f10('0x10')](function(_0x276e3b){logger[_0x0f10('0x17')](_0x0f10('0x21'),_0x5e42a4);logger['debug'](_0x0f10('0x21'),_0x5e42a4,JSON[_0x0f10('0x13')](_0x276e3b));_0x21663d(_0x276e3b);})['catch'](function(_0xfea5ed){logger[_0x0f10('0x14')](_0x0f10('0x21'),_0xfea5ed['message'],_0x5e42a4);_0x4984fc(_0x24de06['error'](0x1f4,_0xfea5ed[_0x0f10('0x15')]));});});};
\ No newline at end of file
index 622f6f0..f6b4d2c 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_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 5335f9d..58442c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1b276a,_0x69e5ce){var _0x53902e=function(_0x6beb27){while(--_0x6beb27){_0x1b276a['push'](_0x1b276a['shift']());}};_0x53902e(++_0x69e5ce);}(_0xedd9,0xfc));var _0x9edd=function(_0x240cc0,_0x49b079){_0x240cc0=_0x240cc0-0x0;var _0x5515e5=_0xedd9[_0x240cc0];return _0x5515e5;};'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('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xe14b=['/:id','create','put','exports','multer','util','express','Router','../../components/auth/service','./smsApplication.controller','get','isAuthenticated','index'];(function(_0xa71183,_0x1682af){var _0x2bd553=function(_0x292f74){while(--_0x292f74){_0xa71183['push'](_0xa71183['shift']());}};_0x2bd553(++_0x1682af);}(_0xe14b,0x93));var _0xbe14=function(_0x2a5678,_0x275e3c){_0x2a5678=_0x2a5678-0x0;var _0x482589=_0xe14b[_0x2a5678];return _0x482589;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router['delete'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['destroy']);module[_0xbe14('0xc')]=router;
\ No newline at end of file
index 583fdb5..c018887 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a61=['noop','TEXT','STRING','*,*,*,*','exports'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x8a61,0x9a));var _0x18a6=function(_0x156af9,_0x5c329e){_0x156af9=_0x156af9-0x0;var _0xa3e6fc=_0x8a61[_0x156af9];return _0xa3e6fc;};'use strict';var Sequelize=require('sequelize');module[_0x18a6('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x18a6('0x1')},'appdata':{'type':Sequelize[_0x18a6('0x2')]()},'description':{'type':Sequelize[_0x18a6('0x3')]},'interval':{'type':Sequelize[_0x18a6('0x3')],'defaultValue':_0x18a6('0x4')}};
\ No newline at end of file
+var _0x2acc=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x5ba53d,_0xc97dfe){var _0x17e642=function(_0x2fa947){while(--_0x2fa947){_0x5ba53d['push'](_0x5ba53d['shift']());}};_0x17e642(++_0xc97dfe);}(_0x2acc,0xc0));var _0xc2ac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2acc[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xc2ac('0x0'));module[_0xc2ac('0x1')]={'priority':{'type':Sequelize[_0xc2ac('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc2ac('0x3')],'allowNull':![],'defaultValue':_0xc2ac('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc2ac('0x3')]},'interval':{'type':Sequelize[_0xc2ac('0x3')],'defaultValue':_0xc2ac('0x5')}};
\ No newline at end of file
index 134c809..20bf68d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe10=['filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','create','body','find','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','map','SmsApplication','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe10,0x135));var _0x0be1=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xbe10[_0x4ae6ef];return _0x3cbb4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0be1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0be1('0x1'));var moment=require('moment');var BPromise=require(_0x0be1('0x2'));var Mustache=require(_0x0be1('0x3'));var util=require('util');var path=require(_0x0be1('0x4'));var sox=require(_0x0be1('0x5'));var csv=require(_0x0be1('0x6'));var ejs=require(_0x0be1('0x7'));var fs=require('fs');var fs_extra=require(_0x0be1('0x8'));var _=require('lodash');var squel=require(_0x0be1('0x9'));var crypto=require(_0x0be1('0xa'));var jsforce=require(_0x0be1('0xb'));var deskjs=require(_0x0be1('0xc'));var toCsv=require(_0x0be1('0x6'));var querystring=require(_0x0be1('0xd'));var Papa=require(_0x0be1('0xe'));var Redis=require('ioredis');var authService=require(_0x0be1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0be1('0x10'));var hardwareService=require(_0x0be1('0x11'));var logger=require(_0x0be1('0x12'))(_0x0be1('0x13'));var utils=require(_0x0be1('0x14'));var config=require(_0x0be1('0x15'));var licenseUtil=require(_0x0be1('0x16'));var db=require(_0x0be1('0x17'))['db'];function respondWithStatusCode(_0x10081f,_0x2ae459){_0x2ae459=_0x2ae459||0xcc;return function(_0xb6ec41){if(_0xb6ec41){return _0x10081f[_0x0be1('0x18')](_0x2ae459);}return _0x10081f[_0x0be1('0x19')](_0x2ae459)['end']();};}function respondWithResult(_0x339be5,_0x1b3fc5){_0x1b3fc5=_0x1b3fc5||0xc8;return function(_0x42ed33){if(_0x42ed33){return _0x339be5[_0x0be1('0x19')](_0x1b3fc5)[_0x0be1('0x1a')](_0x42ed33);}};}function respondWithFilteredResult(_0x4f3428,_0x4f4a69){return function(_0x8e5395){if(_0x8e5395){var _0x5ead2e=typeof _0x4f4a69[_0x0be1('0x1b')]===_0x0be1('0x1c')&&typeof _0x4f4a69['limit']===_0x0be1('0x1c');var _0x5c1ff2=_0x8e5395[_0x0be1('0x1d')];var _0x1f40bf=_0x5ead2e?0x0:_0x4f4a69[_0x0be1('0x1b')];var _0x432c19=_0x5ead2e?_0x8e5395[_0x0be1('0x1d')]:_0x4f4a69[_0x0be1('0x1b')]+_0x4f4a69[_0x0be1('0x1e')];var _0x3194a1;if(_0x432c19>=_0x5c1ff2){_0x432c19=_0x5c1ff2;_0x3194a1=0xc8;}else{_0x3194a1=0xce;}_0x4f3428[_0x0be1('0x19')](_0x3194a1);return _0x4f3428[_0x0be1('0x1f')](_0x0be1('0x20'),_0x1f40bf+'-'+_0x432c19+'/'+_0x5c1ff2)[_0x0be1('0x1a')](_0x8e5395);}return null;};}function patchUpdates(_0x527cbb){return function(_0x5a3858){try{jsonpatch[_0x0be1('0x21')](_0x5a3858,_0x527cbb,!![]);}catch(_0xd6a149){return BPromise['reject'](_0xd6a149);}return _0x5a3858[_0x0be1('0x22')]();};}function saveUpdates(_0x47650c,_0x356c6e){return function(_0x470765){if(_0x470765){return _0x470765[_0x0be1('0x23')](_0x47650c)[_0x0be1('0x24')](function(_0x3e9e3e){return _0x3e9e3e;});}return null;};}function removeEntity(_0xcaaa85,_0x668c9f){return function(_0x4130a6){if(_0x4130a6){return _0x4130a6[_0x0be1('0x25')]()[_0x0be1('0x24')](function(){_0xcaaa85[_0x0be1('0x19')](0xcc)[_0x0be1('0x26')]();});}};}function handleEntityNotFound(_0x2664ed,_0x5845ce){return function(_0x44ef18){if(!_0x44ef18){_0x2664ed[_0x0be1('0x18')](0x194);}return _0x44ef18;};}function handleError(_0x55e4cf,_0x12ce63){_0x12ce63=_0x12ce63||0x1f4;return function(_0x2bb584){logger[_0x0be1('0x27')](_0x2bb584[_0x0be1('0x28')]);if(_0x2bb584[_0x0be1('0x29')]){delete _0x2bb584[_0x0be1('0x29')];}_0x55e4cf[_0x0be1('0x19')](_0x12ce63)[_0x0be1('0x2a')](_0x2bb584);};}exports['index']=function(_0x189568,_0x18fa9e){var _0x213662={},_0x3272fe={},_0x581ebc={'count':0x0,'rows':[]};var _0x3fe30b=_[_0x0be1('0x2b')](db[_0x0be1('0x2c')][_0x0be1('0x2d')],function(_0x4f0d2f){return{'name':_0x4f0d2f['fieldName'],'type':_0x4f0d2f[_0x0be1('0x2e')][_0x0be1('0x2f')]};});_0x3272fe[_0x0be1('0x30')]=_[_0x0be1('0x2b')](_0x3fe30b,'name');_0x3272fe[_0x0be1('0x31')]=_[_0x0be1('0x32')](_0x189568['query']);_0x3272fe[_0x0be1('0x33')]=_[_0x0be1('0x34')](_0x3272fe[_0x0be1('0x30')],_0x3272fe[_0x0be1('0x31')]);_0x213662[_0x0be1('0x35')]=_[_0x0be1('0x34')](_0x3272fe[_0x0be1('0x30')],qs[_0x0be1('0x36')](_0x189568['query']['fields']));_0x213662[_0x0be1('0x35')]=_0x213662[_0x0be1('0x35')][_0x0be1('0x37')]?_0x213662[_0x0be1('0x35')]:_0x3272fe[_0x0be1('0x30')];if(!_0x189568[_0x0be1('0x31')][_0x0be1('0x38')](_0x0be1('0x39'))){_0x213662[_0x0be1('0x1e')]=qs['limit'](_0x189568[_0x0be1('0x31')][_0x0be1('0x1e')]);_0x213662[_0x0be1('0x1b')]=qs['offset'](_0x189568['query']['offset']);}_0x213662['order']=qs[_0x0be1('0x3a')](_0x189568[_0x0be1('0x31')][_0x0be1('0x3a')]);_0x213662[_0x0be1('0x3b')]=qs[_0x0be1('0x33')](_[_0x0be1('0x3c')](_0x189568[_0x0be1('0x31')],_0x3272fe[_0x0be1('0x33')]),_0x3fe30b);if(_0x189568[_0x0be1('0x31')][_0x0be1('0x3d')]){_0x213662[_0x0be1('0x3b')]=_[_0x0be1('0x3e')](_0x213662['where'],{'$or':_[_0x0be1('0x2b')](_0x3fe30b,function(_0x5b50b3){if(_0x5b50b3[_0x0be1('0x2e')]!==_0x0be1('0x3f')){var _0x40faad={};_0x40faad[_0x5b50b3['name']]={'$like':'%'+_0x189568[_0x0be1('0x31')][_0x0be1('0x3d')]+'%'};return _0x40faad;}})});}_0x213662=_[_0x0be1('0x3e')]({},_0x213662,_0x189568[_0x0be1('0x40')]);var _0x41ad48={'where':_0x213662[_0x0be1('0x3b')]};return db['SmsApplication'][_0x0be1('0x1d')](_0x41ad48)[_0x0be1('0x24')](function(_0x431df2){_0x581ebc[_0x0be1('0x1d')]=_0x431df2;if(_0x189568[_0x0be1('0x31')][_0x0be1('0x41')]){_0x213662['include']=[{'all':!![]}];}return db[_0x0be1('0x2c')][_0x0be1('0x42')](_0x213662);})[_0x0be1('0x24')](function(_0x3800c2){_0x581ebc['rows']=_0x3800c2;return _0x581ebc;})[_0x0be1('0x24')](respondWithFilteredResult(_0x18fa9e,_0x213662))[_0x0be1('0x43')](handleError(_0x18fa9e,null));};exports[_0x0be1('0x44')]=function(_0x380cad,_0x4b5c8c){var _0x44b48c={'raw':!![],'where':{'id':_0x380cad[_0x0be1('0x45')]['id']}},_0x49a049={};_0x49a049['model']=_['keys'](db['SmsApplication']['rawAttributes']);_0x49a049[_0x0be1('0x31')]=_['keys'](_0x380cad[_0x0be1('0x31')]);_0x49a049['filters']=_[_0x0be1('0x34')](_0x49a049[_0x0be1('0x30')],_0x49a049[_0x0be1('0x31')]);_0x44b48c[_0x0be1('0x35')]=_[_0x0be1('0x34')](_0x49a049[_0x0be1('0x30')],qs['fields'](_0x380cad[_0x0be1('0x31')][_0x0be1('0x36')]));_0x44b48c[_0x0be1('0x35')]=_0x44b48c['attributes']['length']?_0x44b48c['attributes']:_0x49a049[_0x0be1('0x30')];if(_0x380cad[_0x0be1('0x31')][_0x0be1('0x41')]){_0x44b48c[_0x0be1('0x46')]=[{'all':!![]}];}_0x44b48c=_[_0x0be1('0x3e')]({},_0x44b48c,_0x380cad[_0x0be1('0x40')]);return db[_0x0be1('0x2c')]['find'](_0x44b48c)['then'](handleEntityNotFound(_0x4b5c8c,null))[_0x0be1('0x24')](respondWithResult(_0x4b5c8c,null))[_0x0be1('0x43')](handleError(_0x4b5c8c,null));};exports[_0x0be1('0x47')]=function(_0x501521,_0x5a2b5f){return db[_0x0be1('0x2c')][_0x0be1('0x47')](_0x501521['body'],{})['then'](respondWithResult(_0x5a2b5f,0xc9))[_0x0be1('0x43')](handleError(_0x5a2b5f,null));};exports[_0x0be1('0x23')]=function(_0x6b63c2,_0x16bfc0){if(_0x6b63c2[_0x0be1('0x48')]['id']){delete _0x6b63c2[_0x0be1('0x48')]['id'];}return db[_0x0be1('0x2c')][_0x0be1('0x49')]({'where':{'id':_0x6b63c2[_0x0be1('0x45')]['id']}})[_0x0be1('0x24')](handleEntityNotFound(_0x16bfc0,null))[_0x0be1('0x24')](saveUpdates(_0x6b63c2[_0x0be1('0x48')],null))[_0x0be1('0x24')](respondWithResult(_0x16bfc0,null))[_0x0be1('0x43')](handleError(_0x16bfc0,null));};exports[_0x0be1('0x25')]=function(_0xf2f858,_0x31620f){return db[_0x0be1('0x2c')][_0x0be1('0x49')]({'where':{'id':_0xf2f858[_0x0be1('0x45')]['id']}})[_0x0be1('0x24')](handleEntityNotFound(_0x31620f,null))[_0x0be1('0x24')](removeEntity(_0x31620f,null))[_0x0be1('0x43')](handleError(_0x31620f,null));};
\ No newline at end of file
+var _0x532d=['undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','index','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','SmsApplication','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','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/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x28cfbf,_0x1c6879){var _0x1d2ab4=function(_0x41a318){while(--_0x41a318){_0x28cfbf['push'](_0x28cfbf['shift']());}};_0x1d2ab4(++_0x1c6879);}(_0x532d,0x1b6));var _0xd532=function(_0x533528,_0x409d05){_0x533528=_0x533528-0x0;var _0x3189f1=_0x532d[_0x533528];return _0x3189f1;};'use strict';var emlformat=require(_0xd532('0x0'));var rimraf=require(_0xd532('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd532('0x2'));var rp=require(_0xd532('0x3'));var moment=require(_0xd532('0x4'));var BPromise=require(_0xd532('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd532('0x6'));var sox=require(_0xd532('0x7'));var csv=require(_0xd532('0x8'));var ejs=require(_0xd532('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd532('0xa'));var crypto=require(_0xd532('0xb'));var jsforce=require(_0xd532('0xc'));var deskjs=require(_0xd532('0xd'));var toCsv=require(_0xd532('0x8'));var querystring=require(_0xd532('0xe'));var Papa=require(_0xd532('0xf'));var Redis=require(_0xd532('0x10'));var authService=require(_0xd532('0x11'));var qs=require(_0xd532('0x12'));var as=require(_0xd532('0x13'));var hardwareService=require(_0xd532('0x14'));var logger=require('../../config/logger')(_0xd532('0x15'));var utils=require(_0xd532('0x16'));var config=require(_0xd532('0x17'));var licenseUtil=require(_0xd532('0x18'));var db=require(_0xd532('0x19'))['db'];function respondWithStatusCode(_0x3f3ad9,_0x29e64){_0x29e64=_0x29e64||0xcc;return function(_0x16e1c3){if(_0x16e1c3){return _0x3f3ad9['sendStatus'](_0x29e64);}return _0x3f3ad9[_0xd532('0x1a')](_0x29e64)[_0xd532('0x1b')]();};}function respondWithResult(_0x6c87d2,_0x81a60c){_0x81a60c=_0x81a60c||0xc8;return function(_0x24ef29){if(_0x24ef29){return _0x6c87d2[_0xd532('0x1a')](_0x81a60c)[_0xd532('0x1c')](_0x24ef29);}};}function respondWithFilteredResult(_0x343885,_0x278a97){return function(_0x3ebf7a){if(_0x3ebf7a){var _0x287d10=typeof _0x278a97[_0xd532('0x1d')]===_0xd532('0x1e')&&typeof _0x278a97['limit']===_0xd532('0x1e');var _0x53e6aa=_0x3ebf7a[_0xd532('0x1f')];var _0x3a6c90=_0x287d10?0x0:_0x278a97[_0xd532('0x1d')];var _0x39beaf=_0x287d10?_0x3ebf7a[_0xd532('0x1f')]:_0x278a97[_0xd532('0x1d')]+_0x278a97[_0xd532('0x20')];var _0x47d5e4;if(_0x39beaf>=_0x53e6aa){_0x39beaf=_0x53e6aa;_0x47d5e4=0xc8;}else{_0x47d5e4=0xce;}_0x343885[_0xd532('0x1a')](_0x47d5e4);return _0x343885[_0xd532('0x21')](_0xd532('0x22'),_0x3a6c90+'-'+_0x39beaf+'/'+_0x53e6aa)['json'](_0x3ebf7a);}return null;};}function patchUpdates(_0x56e9dc){return function(_0x1eb3dd){try{jsonpatch[_0xd532('0x23')](_0x1eb3dd,_0x56e9dc,!![]);}catch(_0x21df57){return BPromise[_0xd532('0x24')](_0x21df57);}return _0x1eb3dd[_0xd532('0x25')]();};}function saveUpdates(_0x3b5be6,_0x4e6a6a){return function(_0x1f766e){if(_0x1f766e){return _0x1f766e[_0xd532('0x26')](_0x3b5be6)['then'](function(_0x23e109){return _0x23e109;});}return null;};}function removeEntity(_0xc7140c,_0x12e3e5){return function(_0x146109){if(_0x146109){return _0x146109[_0xd532('0x27')]()[_0xd532('0x28')](function(){_0xc7140c['status'](0xcc)[_0xd532('0x1b')]();});}};}function handleEntityNotFound(_0x30711e,_0x259f6a){return function(_0x1b65b6){if(!_0x1b65b6){_0x30711e[_0xd532('0x29')](0x194);}return _0x1b65b6;};}function handleError(_0x34a617,_0x5643a2){_0x5643a2=_0x5643a2||0x1f4;return function(_0x4aeb1c){logger['error'](_0x4aeb1c[_0xd532('0x2a')]);if(_0x4aeb1c[_0xd532('0x2b')]){delete _0x4aeb1c[_0xd532('0x2b')];}_0x34a617[_0xd532('0x1a')](_0x5643a2)[_0xd532('0x2c')](_0x4aeb1c);};}exports[_0xd532('0x2d')]=function(_0x5ead12,_0xa7fcdf){var _0x25029d={},_0x1e10c6={},_0x2f3394={'count':0x0,'rows':[]};var _0x3df8ee=_['map'](db['SmsApplication']['rawAttributes'],function(_0x2db5d0){return{'name':_0x2db5d0[_0xd532('0x2e')],'type':_0x2db5d0[_0xd532('0x2f')][_0xd532('0x30')]};});_0x1e10c6[_0xd532('0x31')]=_['map'](_0x3df8ee,_0xd532('0x2b'));_0x1e10c6[_0xd532('0x32')]=_[_0xd532('0x33')](_0x5ead12['query']);_0x1e10c6[_0xd532('0x34')]=_['intersection'](_0x1e10c6[_0xd532('0x31')],_0x1e10c6[_0xd532('0x32')]);_0x25029d[_0xd532('0x35')]=_[_0xd532('0x36')](_0x1e10c6['model'],qs[_0xd532('0x37')](_0x5ead12[_0xd532('0x32')][_0xd532('0x37')]));_0x25029d[_0xd532('0x35')]=_0x25029d[_0xd532('0x35')][_0xd532('0x38')]?_0x25029d['attributes']:_0x1e10c6['model'];if(!_0x5ead12[_0xd532('0x32')][_0xd532('0x39')](_0xd532('0x3a'))){_0x25029d[_0xd532('0x20')]=qs[_0xd532('0x20')](_0x5ead12[_0xd532('0x32')][_0xd532('0x20')]);_0x25029d['offset']=qs[_0xd532('0x1d')](_0x5ead12[_0xd532('0x32')][_0xd532('0x1d')]);}_0x25029d[_0xd532('0x3b')]=qs[_0xd532('0x3c')](_0x5ead12[_0xd532('0x32')][_0xd532('0x3c')]);_0x25029d[_0xd532('0x3d')]=qs[_0xd532('0x34')](_[_0xd532('0x3e')](_0x5ead12[_0xd532('0x32')],_0x1e10c6[_0xd532('0x34')]),_0x3df8ee);if(_0x5ead12[_0xd532('0x32')]['filter']){_0x25029d[_0xd532('0x3d')]=_[_0xd532('0x3f')](_0x25029d[_0xd532('0x3d')],{'$or':_[_0xd532('0x40')](_0x3df8ee,function(_0x4c0c63){if(_0x4c0c63[_0xd532('0x2f')]!==_0xd532('0x41')){var _0x3b07ec={};_0x3b07ec[_0x4c0c63['name']]={'$like':'%'+_0x5ead12['query'][_0xd532('0x42')]+'%'};return _0x3b07ec;}})});}_0x25029d=_[_0xd532('0x3f')]({},_0x25029d,_0x5ead12[_0xd532('0x43')]);var _0x1f1a29={'where':_0x25029d['where']};return db['SmsApplication'][_0xd532('0x1f')](_0x1f1a29)[_0xd532('0x28')](function(_0x31b781){_0x2f3394[_0xd532('0x1f')]=_0x31b781;if(_0x5ead12[_0xd532('0x32')][_0xd532('0x44')]){_0x25029d[_0xd532('0x45')]=[{'all':!![]}];}return db[_0xd532('0x46')]['findAll'](_0x25029d);})[_0xd532('0x28')](function(_0x1f024f){_0x2f3394[_0xd532('0x47')]=_0x1f024f;return _0x2f3394;})['then'](respondWithFilteredResult(_0xa7fcdf,_0x25029d))[_0xd532('0x48')](handleError(_0xa7fcdf,null));};exports[_0xd532('0x49')]=function(_0x9b078f,_0x3c6e3c){var _0x74ed13={'raw':!![],'where':{'id':_0x9b078f[_0xd532('0x4a')]['id']}},_0x33fa6e={};_0x33fa6e[_0xd532('0x31')]=_['keys'](db[_0xd532('0x46')]['rawAttributes']);_0x33fa6e[_0xd532('0x32')]=_[_0xd532('0x33')](_0x9b078f[_0xd532('0x32')]);_0x33fa6e['filters']=_[_0xd532('0x36')](_0x33fa6e['model'],_0x33fa6e[_0xd532('0x32')]);_0x74ed13['attributes']=_[_0xd532('0x36')](_0x33fa6e['model'],qs[_0xd532('0x37')](_0x9b078f[_0xd532('0x32')][_0xd532('0x37')]));_0x74ed13[_0xd532('0x35')]=_0x74ed13[_0xd532('0x35')][_0xd532('0x38')]?_0x74ed13['attributes']:_0x33fa6e[_0xd532('0x31')];if(_0x9b078f['query'][_0xd532('0x44')]){_0x74ed13[_0xd532('0x45')]=[{'all':!![]}];}_0x74ed13=_[_0xd532('0x3f')]({},_0x74ed13,_0x9b078f[_0xd532('0x43')]);return db[_0xd532('0x46')][_0xd532('0x4b')](_0x74ed13)[_0xd532('0x28')](handleEntityNotFound(_0x3c6e3c,null))[_0xd532('0x28')](respondWithResult(_0x3c6e3c,null))[_0xd532('0x48')](handleError(_0x3c6e3c,null));};exports[_0xd532('0x4c')]=function(_0x526c89,_0x1fb7df){return db[_0xd532('0x46')]['create'](_0x526c89['body'],{})[_0xd532('0x28')](respondWithResult(_0x1fb7df,0xc9))[_0xd532('0x48')](handleError(_0x1fb7df,null));};exports[_0xd532('0x26')]=function(_0x2790de,_0x4edbc2){if(_0x2790de['body']['id']){delete _0x2790de[_0xd532('0x4d')]['id'];}return db[_0xd532('0x46')][_0xd532('0x4b')]({'where':{'id':_0x2790de['params']['id']}})[_0xd532('0x28')](handleEntityNotFound(_0x4edbc2,null))['then'](saveUpdates(_0x2790de[_0xd532('0x4d')],null))['then'](respondWithResult(_0x4edbc2,null))[_0xd532('0x48')](handleError(_0x4edbc2,null));};exports[_0xd532('0x27')]=function(_0x3dda6f,_0x394054){return db[_0xd532('0x46')][_0xd532('0x4b')]({'where':{'id':_0x3dda6f['params']['id']}})['then'](handleEntityNotFound(_0x394054,null))['then'](removeEntity(_0x394054,null))['catch'](handleError(_0x394054,null));};
\ No newline at end of file
index 5884e1e..9c31df6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c43=['path','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise'];(function(_0x10f18e,_0x35e787){var _0xc350f0=function(_0x3b8fa8){while(--_0x3b8fa8){_0x10f18e['push'](_0x10f18e['shift']());}};_0xc350f0(++_0x35e787);}(_0x6c43,0xda));var _0x36c4=function(_0x1c2e29,_0x3ad48a){_0x1c2e29=_0x1c2e29-0x0;var _0x39174d=_0x6c43[_0x1c2e29];return _0x39174d;};'use strict';var _=require(_0x36c4('0x0'));var util=require(_0x36c4('0x1'));var logger=require('../../config/logger')(_0x36c4('0x2'));var moment=require(_0x36c4('0x3'));var BPromise=require(_0x36c4('0x4'));var rp=require(_0x36c4('0x5'));var fs=require('fs');var path=require(_0x36c4('0x6'));var rimraf=require('rimraf');var config=require(_0x36c4('0x7'));var attributes=require(_0x36c4('0x8'));module['exports']=function(_0x37e03e,_0x12ff92){return _0x37e03e[_0x36c4('0x9')](_0x36c4('0xa'),attributes,{'tableName':_0x36c4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x36c4('0xc'),'collate':_0x36c4('0xd')});};
\ No newline at end of file
+var _0xc7b9=['../../config/environment','./smsApplication.attributes','exports','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path'];(function(_0x515917,_0x28e928){var _0xb240af=function(_0x51e297){while(--_0x51e297){_0x515917['push'](_0x515917['shift']());}};_0xb240af(++_0x28e928);}(_0xc7b9,0x1da));var _0x9c7b=function(_0x25e9dd,_0x2dee88){_0x25e9dd=_0x25e9dd-0x0;var _0x56afc2=_0xc7b9[_0x25e9dd];return _0x56afc2;};'use strict';var _=require(_0x9c7b('0x0'));var util=require(_0x9c7b('0x1'));var logger=require('../../config/logger')(_0x9c7b('0x2'));var moment=require(_0x9c7b('0x3'));var BPromise=require(_0x9c7b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c7b('0x5'));var rimraf=require('rimraf');var config=require(_0x9c7b('0x6'));var attributes=require(_0x9c7b('0x7'));module[_0x9c7b('0x8')]=function(_0x498e9f,_0x42b19b){return _0x498e9f['define']('SmsApplication',attributes,{'tableName':_0x9c7b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9c7b('0xa'),'collate':_0x9c7b('0xb')});};
\ No newline at end of file
index 273153f..e49b31a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97ce=['jayson/promise','client','http','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x3b4253,_0x437161){var _0x40660e=function(_0x310635){while(--_0x310635){_0x3b4253['push'](_0x3b4253['shift']());}};_0x40660e(++_0x437161);}(_0x97ce,0x151));var _0xe97c=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x97ce[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0xe97c('0x0'));var util=require(_0xe97c('0x1'));var moment=require(_0xe97c('0x2'));var BPromise=require(_0xe97c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe97c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe97c('0x5'));var logger=require('../../config/logger')(_0xe97c('0x6'));var config=require(_0xe97c('0x7'));var jayson=require(_0xe97c('0x8'));var client=jayson[_0xe97c('0x9')][_0xe97c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6603e0,_0x522f0a,_0x3bf4ef){return new BPromise(function(_0x9c1b00,_0x9ce6d){return client['request'](_0x6603e0,_0x3bf4ef)[_0xe97c('0xb')](function(_0x5717fb){logger[_0xe97c('0xc')](_0xe97c('0xd'),_0x522f0a,_0xe97c('0xe'));logger[_0xe97c('0xf')](_0xe97c('0x10'),_0x522f0a,_0xe97c('0xe'),JSON[_0xe97c('0x11')](_0x5717fb));if(_0x5717fb['error']){if(_0x5717fb[_0xe97c('0x12')][_0xe97c('0x13')]===0x1f4){logger[_0xe97c('0x12')](_0xe97c('0xd'),_0x522f0a,_0x5717fb[_0xe97c('0x12')][_0xe97c('0x14')]);return _0x9ce6d(_0x5717fb[_0xe97c('0x12')][_0xe97c('0x14')]);}logger[_0xe97c('0x12')]('SmsApplication,\x20%s,\x20%s',_0x522f0a,_0x5717fb['error'][_0xe97c('0x14')]);return _0x9c1b00(_0x5717fb['error'][_0xe97c('0x14')]);}else{logger[_0xe97c('0xc')]('SmsApplication,\x20%s,\x20%s',_0x522f0a,'request\x20sent');_0x9c1b00(_0x5717fb[_0xe97c('0x15')][_0xe97c('0x14')]);}})[_0xe97c('0x16')](function(_0x2e026d){logger['error']('SmsApplication,\x20%s,\x20%s',_0x522f0a,_0x2e026d);_0x9ce6d(_0x2e026d);});});}
\ No newline at end of file
+var _0x3419=['then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x3a7a23,_0x6bffe3){var _0x2ca899=function(_0x3e7fae){while(--_0x3e7fae){_0x3a7a23['push'](_0x3a7a23['shift']());}};_0x2ca899(++_0x6bffe3);}(_0x3419,0xb3));var _0x9341=function(_0x2b5b44,_0x17189c){_0x2b5b44=_0x2b5b44-0x0;var _0x32cb66=_0x3419[_0x2b5b44];return _0x32cb66;};'use strict';var _=require(_0x9341('0x0'));var util=require(_0x9341('0x1'));var moment=require(_0x9341('0x2'));var BPromise=require(_0x9341('0x3'));var rs=require(_0x9341('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9341('0x5'))['db'];var utils=require(_0x9341('0x6'));var logger=require(_0x9341('0x7'))(_0x9341('0x8'));var config=require(_0x9341('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9341('0xa')][_0x9341('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e3e79,_0x2efc5a,_0x1c30cf){return new BPromise(function(_0x188d3b,_0x3b736e){return client[_0x9341('0xc')](_0x5e3e79,_0x1c30cf)[_0x9341('0xd')](function(_0x51826c){logger[_0x9341('0xe')]('SmsApplication,\x20%s,\x20%s',_0x2efc5a,_0x9341('0xf'));logger[_0x9341('0x10')](_0x9341('0x11'),_0x2efc5a,'request\x20sent',JSON[_0x9341('0x12')](_0x51826c));if(_0x51826c['error']){if(_0x51826c[_0x9341('0x13')][_0x9341('0x14')]===0x1f4){logger[_0x9341('0x13')](_0x9341('0x15'),_0x2efc5a,_0x51826c['error'][_0x9341('0x16')]);return _0x3b736e(_0x51826c['error']['message']);}logger[_0x9341('0x13')](_0x9341('0x15'),_0x2efc5a,_0x51826c['error'][_0x9341('0x16')]);return _0x188d3b(_0x51826c[_0x9341('0x13')]['message']);}else{logger[_0x9341('0xe')](_0x9341('0x15'),_0x2efc5a,_0x9341('0xf'));_0x188d3b(_0x51826c['result'][_0x9341('0x16')]);}})[_0x9341('0x17')](function(_0x256b0f){logger[_0x9341('0x13')](_0x9341('0x15'),_0x2efc5a,_0x256b0f);_0x3b736e(_0x256b0f);});});}
\ No newline at end of file
index 79a2dd5..2a05aa3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb8=['smsinteraction:update','update','delete','smsinteraction:destroy','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put'];(function(_0xee53fb,_0x334b1c){var _0x4b78da=function(_0xea56b){while(--_0xea56b){_0xee53fb['push'](_0xee53fb['shift']());}};_0x4b78da(++_0x334b1c);}(_0x5eb8,0xb0));var _0x85eb=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0x5eb8[_0xe15270];return _0x1e813b;};'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['get'](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0xf')]);router[_0x85eb('0x9')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x11')]);router[_0x85eb('0x9')](_0x85eb('0x12'),auth['isAuthenticated'](),controller[_0x85eb('0x13')]);router[_0x85eb('0x14')]('/',auth['isAuthenticated'](),controller[_0x85eb('0x15')]);router[_0x85eb('0x14')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller['addMessage']);router['post'](_0x85eb('0x16'),auth['isAuthenticated'](),interaction[_0x85eb('0x17')](_0x85eb('0x18'),_0x85eb('0x19')),controller[_0x85eb('0x1a')]);router[_0x85eb('0x1b')]('/:id',auth[_0x85eb('0xa')](),interaction['tracked'](_0x85eb('0x18'),_0x85eb('0x1c')),controller[_0x85eb('0x1d')]);router[_0x85eb('0x1e')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x85eb('0x18'),_0x85eb('0x1f')),controller[_0x85eb('0x20')]);router[_0x85eb('0x1e')](_0x85eb('0x16'),auth[_0x85eb('0xa')](),controller['removeTags']);module[_0x85eb('0x21')]=router;
\ No newline at end of file
+var _0xb7e7=['download','post','create','addMessage','/:id/tags','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','smsinteraction:destroy','destroy','removeTags','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','/:id/download'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xb7e7[_0x1beef3];return _0x5af964;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x8')](_0x7b7e('0x10'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x12')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x13')]);router[_0x7b7e('0x12')]('/:id/messages',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x14')]);router['post'](_0x7b7e('0x15'),auth['isAuthenticated'](),interaction['tracked'](_0x7b7e('0x16'),_0x7b7e('0x17')),controller[_0x7b7e('0x18')]);router[_0x7b7e('0x19')](_0x7b7e('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0x7b7e('0x16'),_0x7b7e('0x1a')),controller[_0x7b7e('0x1b')]);router[_0x7b7e('0x1c')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),interaction[_0x7b7e('0x1d')](_0x7b7e('0x16'),_0x7b7e('0x1e')),controller[_0x7b7e('0x1f')]);router[_0x7b7e('0x1c')](_0x7b7e('0x15'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x20')]);module[_0x7b7e('0x21')]=router;
\ No newline at end of file
index 81d4df3..da656d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['moment','exports','DATE','STRING','ENUM','out','sequelize'];(function(_0x1c88dd,_0x19de8a){var _0x2710ad=function(_0x974400){while(--_0x974400){_0x1c88dd['push'](_0x1c88dd['shift']());}};_0x2710ad(++_0x19de8a);}(_0xf494,0x1c6));var _0x4f49=function(_0x20a182,_0xb30a21){_0x20a182=_0x20a182-0x0;var _0x3bd0d1=_0xf494[_0x20a182];return _0x3bd0d1;};'use strict';var Sequelize=require(_0x4f49('0x0'));var moment=require(_0x4f49('0x1'));module[_0x4f49('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4f49('0x3')]},'disposition':{'type':Sequelize[_0x4f49('0x4')]},'secondDisposition':{'type':Sequelize[_0x4f49('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4f49('0x4')]},'note':{'type':Sequelize[_0x4f49('0x4')]},'phone':{'type':Sequelize[_0x4f49('0x4')]},'read1stAt':{'type':Sequelize[_0x4f49('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4f49('0x5')]('in',_0x4f49('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4f49('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x4f49('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x07d7=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x07d7,0x85));var _0x707d=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x07d7[_0x819464];return _0x49dcc0;};'use strict';var Sequelize=require(_0x707d('0x0'));var moment=require(_0x707d('0x1'));module[_0x707d('0x2')]={'closed':{'type':Sequelize[_0x707d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x707d('0x4')]},'disposition':{'type':Sequelize[_0x707d('0x5')]},'secondDisposition':{'type':Sequelize[_0x707d('0x5')]},'thirdDisposition':{'type':Sequelize[_0x707d('0x5')]},'note':{'type':Sequelize[_0x707d('0x5')]},'phone':{'type':Sequelize[_0x707d('0x5')]},'read1stAt':{'type':Sequelize[_0x707d('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x707d('0x6')]('in',_0x707d('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x707d('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x707d('0x6')]('in',_0x707d('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index a365718..8cca0aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['length','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','start','compact','isEmpty','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','SELECT','i.id','contactName','DESC','t.id\x20IN\x20?','resolve','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','sequelize','keyBy','merge','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','toString','groupBy','SmsInteractionId','rows','show','params','includeAll','include','options','create','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','setTags','Tag','findAll','emit','smsInteractionTags:save','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','fullname','CmContact','lastName','Messages','secret','SmsAccount','Account','Sms','Owner','N.A.','format','closedAt','disposition','direction','System','firstName','renderFile','transcript-','.pdf','createPdfFromHTML','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','Users','map','Tags','TagIds','split','forEach','push','catch','waiting','answered','unmanaged','UserId','talking','closed','index','SmsInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','u.id','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','users','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','tools_tags','expr','search','sqlOperator','conditions'];(function(_0x4fa213,_0x568c6a){var _0x1d5e57=function(_0x260326){while(--_0x260326){_0x4fa213['push'](_0x4fa213['shift']());}};_0x1d5e57(++_0x568c6a);}(_0xadb5,0x8b));var _0x5adb=function(_0x3163d2,_0xfafa26){_0x3163d2=_0x3163d2-0x0;var _0x5177d7=_0xadb5[_0x3163d2];return _0x5177d7;};'use strict';var emlformat=require(_0x5adb('0x0'));var rimraf=require(_0x5adb('0x1'));var zipdir=require(_0x5adb('0x2'));var jsonpatch=require(_0x5adb('0x3'));var rp=require(_0x5adb('0x4'));var moment=require(_0x5adb('0x5'));var BPromise=require(_0x5adb('0x6'));var Mustache=require(_0x5adb('0x7'));var util=require('util');var path=require(_0x5adb('0x8'));var sox=require(_0x5adb('0x9'));var csv=require('to-csv');var ejs=require(_0x5adb('0xa'));var fs=require('fs');var fs_extra=require(_0x5adb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5adb('0xc'));var deskjs=require(_0x5adb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5adb('0xe'));var Papa=require(_0x5adb('0xf'));var Redis=require(_0x5adb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5adb('0x11'));var as=require(_0x5adb('0x12'));var pdf=require(_0x5adb('0x13'));var hardwareService=require(_0x5adb('0x14'));var logger=require(_0x5adb('0x15'))(_0x5adb('0x16'));var utils=require('../../config/utils');var config=require(_0x5adb('0x17'));var licenseUtil=require(_0x5adb('0x18'));var db=require(_0x5adb('0x19'))['db'];config[_0x5adb('0x1a')]=_[_0x5adb('0x1b')](config['redis'],{'host':_0x5adb('0x1c'),'port':0x18eb});var socket=require(_0x5adb('0x1d'))(new Redis(config[_0x5adb('0x1a')]));require('./smsInteraction.socket')[_0x5adb('0x1e')](socket);function respondWithStatusCode(_0x1809b,_0x1ee641){_0x1ee641=_0x1ee641||0xcc;return function(_0x288cfe){if(_0x288cfe){return _0x1809b[_0x5adb('0x1f')](_0x1ee641);}return _0x1809b[_0x5adb('0x20')](_0x1ee641)[_0x5adb('0x21')]();};}function respondWithResult(_0x50cdc9,_0x1ed707){_0x1ed707=_0x1ed707||0xc8;return function(_0x1daf34){if(_0x1daf34){return _0x50cdc9[_0x5adb('0x20')](_0x1ed707)[_0x5adb('0x22')](_0x1daf34);}};}function respondWithFilteredResult(_0x45b5ab,_0x3a9325){return function(_0x2fb294){if(_0x2fb294){var _0x33c603=typeof _0x3a9325[_0x5adb('0x23')]===_0x5adb('0x24')&&typeof _0x3a9325[_0x5adb('0x25')]===_0x5adb('0x24');var _0x1a6b4f=_0x2fb294[_0x5adb('0x26')];var _0x37679c=_0x33c603?0x0:_0x3a9325[_0x5adb('0x23')];var _0xd283f2=_0x33c603?_0x2fb294[_0x5adb('0x26')]:_0x3a9325[_0x5adb('0x23')]+_0x3a9325[_0x5adb('0x25')];var _0x10bd30;if(_0xd283f2>=_0x1a6b4f){_0xd283f2=_0x1a6b4f;_0x10bd30=0xc8;}else{_0x10bd30=0xce;}_0x45b5ab['status'](_0x10bd30);return _0x45b5ab[_0x5adb('0x27')](_0x5adb('0x28'),_0x37679c+'-'+_0xd283f2+'/'+_0x1a6b4f)['json'](_0x2fb294);}return null;};}function patchUpdates(_0x2557d9){return function(_0x306dbf){try{jsonpatch[_0x5adb('0x29')](_0x306dbf,_0x2557d9,!![]);}catch(_0x52ded5){return BPromise['reject'](_0x52ded5);}return _0x306dbf[_0x5adb('0x2a')]();};}function saveUpdates(_0x269e24,_0x43cc25){return function(_0x1162b5){if(_0x1162b5){return _0x1162b5[_0x5adb('0x2b')](_0x269e24)[_0x5adb('0x2c')](function(_0x6d9225){return _0x6d9225;});}return null;};}function removeEntity(_0xc6eb46,_0x5c1f11){return function(_0x1f47e9){if(_0x1f47e9){return _0x1f47e9[_0x5adb('0x2d')]()[_0x5adb('0x2c')](function(){_0xc6eb46[_0x5adb('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47bec8,_0x50acd1){return function(_0x3317ec){if(!_0x3317ec){_0x47bec8[_0x5adb('0x1f')](0x194);}return _0x3317ec;};}function handleError(_0x484f25,_0x1bbec7){_0x1bbec7=_0x1bbec7||0x1f4;return function(_0x6118a){logger[_0x5adb('0x2e')](_0x6118a[_0x5adb('0x2f')]);if(_0x6118a['name']){delete _0x6118a[_0x5adb('0x30')];}_0x484f25[_0x5adb('0x20')](_0x1bbec7)[_0x5adb('0x31')](_0x6118a);};}function getInteractionUsers(_0x1149d5,_0x41905c){return new BPromise(function(_0xe9d65,_0x392875){try{if(_0x41905c[_0x1149d5['id']]){_0x1149d5[_0x5adb('0x32')]=_[_0x5adb('0x33')](_0x41905c[_0x1149d5['id']],function(_0x4d3789){return{'id':_0x4d3789['id'],'fullname':_0x4d3789['fullname']};});}}catch(_0x599046){_0x392875(_0x599046);}_0xe9d65(_0x1149d5);});}function getInteractionTags(_0x1bbd02,_0xea264a){return new BPromise(function(_0x136b92,_0x22c472){try{if(_0x1bbd02['TagIds']){_0x1bbd02[_0x5adb('0x34')]=[];_0x1bbd02[_0x5adb('0x35')][_0x5adb('0x36')](',')[_0x5adb('0x37')](function(_0x5b4ff0){_0x1bbd02['Tags'][_0x5adb('0x38')](_0xea264a[_0x5b4ff0]);});}delete _0x1bbd02[_0x5adb('0x35')];}catch(_0xbbee95){_0x22c472(_0xbbee95);}_0x136b92(_0x1bbd02);});}function updateSmsInteraction(_0x1b4508,_0x4ee25a,_0x5e8c5d){return new BPromise(function(_0x30aaa7,_0x415266){return getInteractionUsers(_0x1b4508,_0x5e8c5d)['then'](function(_0x3bc23e){return getInteractionTags(_0x3bc23e,_0x4ee25a);})[_0x5adb('0x2c')](function(_0x254f5f){return getStateInteraction(_0x254f5f);})['then'](function(_0x4b31fc){_0x30aaa7(_0x4b31fc);})[_0x5adb('0x39')](function(_0x5af4cb){_0x415266(_0x5af4cb);});});}function getStateInteraction(_0x52114c){return new BPromise(function(_0x423b01){_0x52114c[_0x5adb('0x3a')]=0x0;_0x52114c['talking']=0x0;_0x52114c[_0x5adb('0x3b')]=0x0;_0x52114c[_0x5adb('0x3c')]=0x0;_0x52114c['total']=0x0;if(!_0x52114c['closed']&&!_0x52114c[_0x5adb('0x3d')]){_0x52114c[_0x5adb('0x3a')]+=0x1;}if(!_0x52114c['closed']&&_0x52114c[_0x5adb('0x3d')]){_0x52114c[_0x5adb('0x3e')]+=0x1;if(_0x52114c[_0x5adb('0x3a')]){_0x52114c[_0x5adb('0x3a')]-=0x1;}}if(_0x52114c['closed']&&_0x52114c[_0x5adb('0x3d')]){_0x52114c[_0x5adb('0x3b')]+=0x1;if(_0x52114c[_0x5adb('0x3e')]){_0x52114c[_0x5adb('0x3e')]-=0x1;}}if(_0x52114c[_0x5adb('0x3f')]&&!_0x52114c[_0x5adb('0x3d')]){_0x52114c[_0x5adb('0x3c')]+=0x1;if(_0x52114c['waiting']){_0x52114c[_0x5adb('0x3a')]-=0x1;}}_0x52114c['total']+=0x1;_0x423b01(_0x52114c);});}exports[_0x5adb('0x40')]=function(_0x650104,_0x396e06){var _0x2bdd7d={},_0x2f336b={},_0x224d06={'count':0x0,'rows':[]};var _0x4e0bd2=_[_0x5adb('0x33')](db[_0x5adb('0x41')][_0x5adb('0x42')],function(_0x27af0a){return{'name':_0x27af0a[_0x5adb('0x43')],'type':_0x27af0a[_0x5adb('0x44')][_0x5adb('0x45')]};});_0x2f336b[_0x5adb('0x46')]=_[_0x5adb('0x33')](_0x4e0bd2,_0x5adb('0x30'));_0x2f336b[_0x5adb('0x47')]=_[_0x5adb('0x48')](_0x650104[_0x5adb('0x47')]);_0x2f336b[_0x5adb('0x49')]=_[_0x5adb('0x4a')](_0x2f336b[_0x5adb('0x46')],_0x2f336b[_0x5adb('0x47')]);_0x2bdd7d[_0x5adb('0x4b')]=_['intersection'](_0x2f336b[_0x5adb('0x46')],qs['fields'](_0x650104[_0x5adb('0x47')]['fields']));_0x2bdd7d[_0x5adb('0x4b')]=_0x2bdd7d[_0x5adb('0x4b')]['length']?_0x2bdd7d[_0x5adb('0x4b')]:_0x2f336b[_0x5adb('0x46')];if(!_0x650104[_0x5adb('0x47')][_0x5adb('0x4c')](_0x5adb('0x4d'))){_0x2bdd7d[_0x5adb('0x25')]=qs[_0x5adb('0x25')](_0x650104['query'][_0x5adb('0x25')]);_0x2bdd7d['offset']=qs[_0x5adb('0x23')](_0x650104[_0x5adb('0x47')][_0x5adb('0x23')]);}_0x2bdd7d[_0x5adb('0x4e')]=qs[_0x5adb('0x4f')](_0x650104[_0x5adb('0x47')][_0x5adb('0x4f')]);_0x2bdd7d[_0x5adb('0x50')]=qs[_0x5adb('0x49')](_[_0x5adb('0x51')](_0x650104['query'],_0x2f336b[_0x5adb('0x49')]),_0x4e0bd2);var _0x3d86e0=[];var _0x17d07e=squel[_0x5adb('0x52')]()['field']('id')[_0x5adb('0x53')](_0x5adb('0x30'))[_0x5adb('0x53')](_0x5adb('0x54'))['from']('tools_tags');var _0xaee415=squel['select']()['field'](_0x5adb('0x55'))[_0x5adb('0x53')](_0x5adb('0x56'))[_0x5adb('0x53')](_0x5adb('0x57'))[_0x5adb('0x58')](_0x5adb('0x59'),'ui')['left_join'](_0x5adb('0x5a'),'u','u.id\x20=\x20ui.UserId');var _0x5bd1e3=squel[_0x5adb('0x52')]()[_0x5adb('0x58')](_0x5adb('0x5b'),'i')[_0x5adb('0x5c')](_0x5adb('0x5d'),'c',_0x5adb('0x5e'))['left_join'](_0x5adb('0x5a'),'o','o.id\x20=\x20i.UserId')[_0x5adb('0x5c')]('sms_accounts','a',_0x5adb('0x5f'))['left_join'](_0x5adb('0x60'),'me',_0x5adb('0x61'))[_0x5adb('0x5c')](_0x5adb('0x62'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x5adb('0x5c')](_0x5adb('0x63'),'t','t.id\x20=\x20it.TagId');var _0x343325=squel[_0x5adb('0x64')]();var _0x578bba=[];var _0x58129f=squel[_0x5adb('0x64')]();var _0x11827d;if(_0x650104['query'][_0x5adb('0x65')]){_0x11827d=as['parseSearch'](_0x650104[_0x5adb('0x47')]['search']);var _0x39cbb7=_0x11827d[_0x5adb('0x66')];for(var _0x50235e=0x0;_0x50235e<_0x11827d[_0x5adb('0x67')][_0x5adb('0x68')];_0x50235e++){var _0x528f07=_0x11827d[_0x5adb('0x67')][_0x50235e];var _0x449e1c='i';var _0x47115e=_[_0x5adb('0x69')](_0x4e0bd2,[_0x5adb('0x30'),_0x528f07[_0x5adb('0x53')]]);if(!_0x47115e){switch(_0x528f07['field']){case _0x5adb('0x6a'):if(_0x528f07[_0x5adb('0x6b')]==0x1){_0x5bd1e3['having']('`'+_0x528f07[_0x5adb('0x53')]+_0x5adb('0x6c'));}else{_0x5bd1e3[_0x5adb('0x6d')]('`'+_0x528f07[_0x5adb('0x53')]+_0x5adb('0x6e'));}break;case _0x5adb('0x6f'):if(_0x528f07['operator']===_0x5adb('0x70')){if(_0x528f07[_0x5adb('0x6b')][_0x5adb('0x36')]('\x20')[_0x5adb('0x68')]>0x1){_0x343325[_0x39cbb7](_0x5adb('0x71'),qs[_0x5adb('0x72')](_0x528f07['value']),null);}else{var _0x25e82f='%'+_0x528f07[_0x5adb('0x6b')]+'%';_0x343325[_0x39cbb7](_0x5adb('0x73'),_0x25e82f,_0x25e82f,_0x25e82f);}}else{_0x47115e=_[_0x5adb('0x69')](_0x4e0bd2,[_0x5adb('0x30'),_0x5adb('0x74')]);_0x528f07[_0x5adb('0x53')]=_0x5adb('0x74');_0x540c81=as[_0x5adb('0x75')](_0x449e1c,_0x47115e[_0x5adb('0x44')],_0x528f07);_0x343325[_0x39cbb7](_0x540c81[_0x5adb('0x76')],_0x540c81['value']['start'],_0x540c81[_0x5adb('0x6b')][_0x5adb('0x21')]);}break;case'Tag':var _0x3bd8c6=_0x528f07[_0x5adb('0x6b')]['split'](',')[_0x5adb('0x33')](function(_0x37a564){return Number(_0x37a564);});_0x3bd8c6[_0x5adb('0x37')](function(_0x35f40e){_0x58129f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x35f40e+',%');});_0x578bba=_[_0x5adb('0x77')](_0x578bba,_0x3bd8c6);break;case _0x5adb('0x78'):if(_0x528f07[_0x5adb('0x79')]===_0x5adb('0x70')){_0x343325[_0x39cbb7](_0x5adb('0x7a'),'%'+_0x528f07[_0x5adb('0x6b')]+'%',null);}else{_0x47115e=_[_0x5adb('0x69')](_0x4e0bd2,[_0x5adb('0x30'),_0x5adb('0x3d')]);_0x528f07[_0x5adb('0x53')]='UserId';_0x540c81=as[_0x5adb('0x75')](_0x449e1c,_0x47115e[_0x5adb('0x44')],_0x528f07);_0x343325[_0x39cbb7](_0x540c81['text'],_0x540c81['value']['start'],_0x540c81[_0x5adb('0x6b')][_0x5adb('0x21')]);}break;case _0x5adb('0x7b'):_0x540c81=as['buildExpression']('me',null,_0x528f07);_0x343325[_0x39cbb7](_0x540c81['text'],_0x540c81['value'][_0x5adb('0x7c')],_0x540c81['value']['end']);break;}}else{var _0x540c81=as['buildExpression'](_0x449e1c,_0x47115e[_0x5adb('0x44')],_0x528f07);_0x343325[_0x39cbb7](_0x540c81[_0x5adb('0x76')],_0x540c81[_0x5adb('0x6b')][_0x5adb('0x7c')],_0x540c81[_0x5adb('0x6b')][_0x5adb('0x21')]);}}}else{var _0x3ac8ac=_(_0x650104[_0x5adb('0x47')])['keys']()[_0x5adb('0x33')](function(_0xf35f9){return _['some'](_0x4e0bd2,[_0x5adb('0x30'),_0xf35f9])?_0xf35f9:undefined;})[_0x5adb('0x7d')]()[_0x5adb('0x6b')]();if(!_[_0x5adb('0x7e')](_0x3ac8ac)){_0x3ac8ac[_0x5adb('0x37')](function(_0xab7af4){if(_0xab7af4==='SmsAccountId'){_0x5bd1e3[_0x5adb('0x50')](_0x5adb('0x7f'),[][_0x5adb('0x80')](_0x650104[_0x5adb('0x47')][_0xab7af4]));}else if(_0xab7af4===_0x5adb('0x81')){var _0x47beba=JSON['parse'](_0x650104['query'][_0xab7af4])[_0x5adb('0x82')];var _0x250cb9=JSON[_0x5adb('0x83')](_0x650104[_0x5adb('0x47')][_0xab7af4])[_0x5adb('0x84')];_0x5bd1e3[_0x5adb('0x50')](_0x5adb('0x85'),_0x47beba,_0x250cb9);}else{if(_0x650104['query'][_0xab7af4]===_0x5adb('0x86')){_0x5bd1e3[_0x5adb('0x50')]('i.'+_0xab7af4+_0x5adb('0x87'));}else{_0x5bd1e3[_0x5adb('0x50')]('i.'+_0xab7af4+_0x5adb('0x88'),_0x650104['query'][_0xab7af4]);}}});}if(_0x650104[_0x5adb('0x47')][_0x5adb('0x89')]){if(_0x650104[_0x5adb('0x47')][_0x5adb('0x89')]==0x1){_0x5bd1e3[_0x5adb('0x6d')](_0x5adb('0x8a'));}else{_0x5bd1e3[_0x5adb('0x6d')]('`unreadMessages`\x20>\x200');}}if(_0x650104['query'][_0x5adb('0x8b')]){_0x578bba=_[_0x5adb('0x8c')](_0x650104[_0x5adb('0x47')][_0x5adb('0x8b')])?_0x650104[_0x5adb('0x47')]['tag']:new Array(_0x650104[_0x5adb('0x47')][_0x5adb('0x8b')]);_0x578bba[_0x5adb('0x37')](function(_0x49f9ce){_0x58129f['or'](_0x5adb('0x8d'),'%,'+_0x49f9ce+',%');});}if(_0x650104[_0x5adb('0x47')][_0x5adb('0x8e')]){var _0x21dc8e=_0x650104[_0x5adb('0x47')][_0x5adb('0x8e')][_0x5adb('0x8f')]('\x5c','\x5c\x5c')[_0x5adb('0x8f')](/'/g,'\x27\x27');if(qs[_0x5adb('0x90')](_0x21dc8e)){_0x343325['or'](_0x5adb('0x91'),_0x21dc8e+'%')['or'](_0x5adb('0x92'),_0x21dc8e+'%');}else{_0x343325['or'](_0x5adb('0x93'),qs[_0x5adb('0x72')](_0x21dc8e))['or'](_0x5adb('0x94'),_0x21dc8e+'%');}}}_0x5bd1e3[_0x5adb('0x50')](_0x343325);_0x5bd1e3[_0x5adb('0x95')]('i.id');var _0x7bd1cf={'type':db['Sequelize']['QueryTypes'][_0x5adb('0x96')],'raw':!![]};var _0x371611=_0x5bd1e3['clone']();_0x371611[_0x5adb('0x53')](_0x5adb('0x97'));_0x371611[_0x5adb('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5adb('0x6a'));if(_0x2bdd7d[_0x5adb('0x4e')]){_0x2bdd7d[_0x5adb('0x4e')][_0x5adb('0x37')](function(_0x5f0d09){var _0x1733e6=_0x5f0d09[0x0]===_0x5adb('0x98')?_0x5f0d09[0x0]:'i.'+_0x5f0d09[0x0];_0x5bd1e3[_0x5adb('0x4e')](_0x1733e6,_0x5f0d09[0x1]===_0x5adb('0x99')?![]:!![]);});}if(!_[_0x5adb('0x7e')](_0x578bba)){_0x5bd1e3[_0x5adb('0x6d')](_0x58129f);_0x371611[_0x5adb('0x50')](_0x5adb('0x9a'),_0x578bba);}BPromise[_0x5adb('0x9b')]()['then'](function(){if(!_0x11827d){if(_0x650104[_0x5adb('0x47')][_0x5adb('0x9c')])return;_0x371611[_0x5adb('0x50')](_0x5adb('0x9d'));_0x5bd1e3[_0x5adb('0x50')](_0x5adb('0x9d'));return;}if(_0x650104[_0x5adb('0x9e')][_0x5adb('0x9f')]!==_0x5adb('0xa0'))return;return _0x650104[_0x5adb('0x9e')][_0x5adb('0xa1')]({'attributes':['id'],'raw':!![]})['then'](function(_0x355ffe){if(_[_0x5adb('0x7e')](_0x355ffe)){_0x371611[_0x5adb('0x50')]('i.SmsAccountId\x20IS\x20NULL');_0x5bd1e3[_0x5adb('0x50')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x371611[_0x5adb('0x50')](_0x5adb('0x7f'),_[_0x5adb('0x33')](_0x355ffe,'id'));_0x5bd1e3[_0x5adb('0x50')](_0x5adb('0x7f'),_['map'](_0x355ffe,'id'));}});})['then'](function(){if(_0x650104[_0x5adb('0x9e')][_0x5adb('0x9f')]===_0x5adb('0xa0')&&!_0x11827d&&!_0x650104[_0x5adb('0x47')][_0x5adb('0x9c')])return[];return db[_0x5adb('0xa2')][_0x5adb('0x47')](_0x371611['toString'](),_0x7bd1cf);})['then'](function(_0x9f8c1f){_0x224d06[_0x5adb('0x26')]=_0x9f8c1f[_0x5adb('0x68')];if(_0x224d06[_0x5adb('0x26')]===0x0)return[];return db[_0x5adb('0xa2')]['query'](_0x17d07e['toString'](),_0x7bd1cf)[_0x5adb('0x2c')](function(_0x5cddc8){_0x3d86e0=_[_0x5adb('0xa3')](_0x5cddc8,'id');_0x7bd1cf=_[_0x5adb('0xa4')](_0x7bd1cf,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x650104['query'][_0x5adb('0xa5')]){_0x2bdd7d[_0x5adb('0x4b')][_0x5adb('0x37')](function(_0x2bd8af){_0x5bd1e3[_0x5adb('0x53')]('i.'+_0x2bd8af);});}else{_0x5bd1e3[_0x5adb('0x53')](_0x5adb('0xa6'),_0x5adb('0x6a'));_0x5bd1e3[_0x5adb('0x53')]('a.key',_0x5adb('0xa7'));_0x5bd1e3[_0x5adb('0x53')](_0x5adb('0xa8'),_0x5adb('0xa9'));_0x5bd1e3[_0x5adb('0x53')](_0x5adb('0xaa'),_0x5adb('0x98'));_0x5bd1e3['field'](_0x5adb('0xab'));_0x5bd1e3[_0x5adb('0x53')](_0x5adb('0xac'),_0x5adb('0xad'));_0x5bd1e3[_0x5adb('0x53')](_0x5adb('0xae'),_0x5adb('0xaf'));_0x5bd1e3['field'](_0x5adb('0xb0'),_0x5adb('0xb1'));_0x5bd1e3['field'](_0x5adb('0xb2'),'Contact.phone');_0x5bd1e3['field'](_0x5adb('0xb3'),_0x5adb('0xb4'));_0x5bd1e3['field'](_0x5adb('0xb5'),_0x5adb('0xb6'));_0x5bd1e3[_0x5adb('0x53')](_0x5adb('0xb7'),_0x5adb('0xb8'));_0x5bd1e3[_0x5adb('0x53')](_0x5adb('0xb9'),_0x5adb('0xba'));_0x5bd1e3[_0x5adb('0x53')](_0x5adb('0xbb'),'TagIds');}if(_0x2bdd7d['limit'])_0x5bd1e3[_0x5adb('0x25')](_0x2bdd7d[_0x5adb('0x25')]);if(_0x2bdd7d[_0x5adb('0x23')])_0x5bd1e3[_0x5adb('0x23')](_0x2bdd7d[_0x5adb('0x23')]);return db['sequelize'][_0x5adb('0x47')](_0x5bd1e3['toString'](),_0x7bd1cf);})[_0x5adb('0x2c')](function(_0x9e7aac){if(_0x9e7aac['length']>0x0)_0xaee415['where'](_0x5adb('0xbc'),_[_0x5adb('0x33')](_0x9e7aac,'id'));return db[_0x5adb('0xa2')]['query'](_0xaee415[_0x5adb('0xbd')](),_0x7bd1cf)[_0x5adb('0x2c')](function(_0x2095c5){var _0x279bdf=_[_0x5adb('0xbe')](_0x2095c5,_0x5adb('0xbf'));var _0xcb180c=[];_0x9e7aac[_0x5adb('0x37')](function(_0x14a487){_0xcb180c[_0x5adb('0x38')](updateSmsInteraction(_0x14a487,_0x3d86e0,_0x279bdf));});return BPromise['all'](_0xcb180c);});});})['then'](function(_0x9c901){_0x224d06[_0x5adb('0xc0')]=_0x9c901;return _0x224d06;})[_0x5adb('0x2c')](respondWithFilteredResult(_0x396e06,_0x2bdd7d))['catch'](handleError(_0x396e06,null));};exports[_0x5adb('0xc1')]=function(_0x3ae82f,_0x123786){var _0x1d1bcf={'raw':![],'where':{'id':_0x3ae82f[_0x5adb('0xc2')]['id']}},_0x307845={};_0x307845[_0x5adb('0x46')]=_['keys'](db[_0x5adb('0x41')][_0x5adb('0x42')]);_0x307845[_0x5adb('0x47')]=_[_0x5adb('0x48')](_0x3ae82f['query']);_0x307845['filters']=_['intersection'](_0x307845[_0x5adb('0x46')],_0x307845[_0x5adb('0x47')]);_0x1d1bcf[_0x5adb('0x4b')]=_[_0x5adb('0x4a')](_0x307845[_0x5adb('0x46')],qs[_0x5adb('0xa5')](_0x3ae82f[_0x5adb('0x47')]['fields']));_0x1d1bcf[_0x5adb('0x4b')]=_0x1d1bcf[_0x5adb('0x4b')][_0x5adb('0x68')]?_0x1d1bcf[_0x5adb('0x4b')]:_0x307845['model'];if(_0x3ae82f[_0x5adb('0x47')][_0x5adb('0xc3')]){_0x1d1bcf[_0x5adb('0xc4')]=[{'all':!![]}];}_0x1d1bcf=_[_0x5adb('0xa4')]({},_0x1d1bcf,_0x3ae82f[_0x5adb('0xc5')]);return db[_0x5adb('0x41')][_0x5adb('0x69')](_0x1d1bcf)['then'](handleEntityNotFound(_0x123786,null))['then'](respondWithResult(_0x123786,null))[_0x5adb('0x39')](handleError(_0x123786,null));};exports[_0x5adb('0xc6')]=function(_0x3e7dc3,_0x28ef64){return db[_0x5adb('0x41')][_0x5adb('0xc6')](_0x3e7dc3['body'],{})[_0x5adb('0x2c')](respondWithResult(_0x28ef64,0xc9))[_0x5adb('0x39')](handleError(_0x28ef64,null));};exports[_0x5adb('0x2b')]=function(_0x5747c1,_0x2ddc7f){if(_0x5747c1['body']['id']){delete _0x5747c1['body']['id'];}return db['SmsInteraction'][_0x5adb('0x69')]({'where':{'id':_0x5747c1['params']['id']}})[_0x5adb('0x2c')](handleEntityNotFound(_0x2ddc7f,null))[_0x5adb('0x2c')](saveUpdates(_0x5747c1[_0x5adb('0x7b')],null))[_0x5adb('0x2c')](respondWithResult(_0x2ddc7f,null))[_0x5adb('0x39')](handleError(_0x2ddc7f,null));};exports['destroy']=function(_0x325212,_0x35d29c){return db[_0x5adb('0x41')][_0x5adb('0x69')]({'where':{'id':_0x325212[_0x5adb('0xc2')]['id']}})['then'](handleEntityNotFound(_0x35d29c,null))[_0x5adb('0x2c')](removeEntity(_0x35d29c,null))[_0x5adb('0x39')](handleError(_0x35d29c,null));};exports[_0x5adb('0xc7')]=function(_0x5a0646,_0x438695){return db[_0x5adb('0x41')][_0x5adb('0xc7')]()[_0x5adb('0x2c')](respondWithResult(_0x438695,null))[_0x5adb('0x39')](handleError(_0x438695,null));};exports[_0x5adb('0xc8')]=function(_0x1966f9,_0x40de49,_0x36b562){return db[_0x5adb('0xc9')]['find']({'where':{'id':_0x1966f9[_0x5adb('0xc2')]['id']}})[_0x5adb('0x2c')](handleEntityNotFound(_0x40de49,null))[_0x5adb('0x2c')](function(_0x2c33ea){if(_0x2c33ea){return _0x2c33ea[_0x5adb('0xc8')](_0x1966f9[_0x5adb('0x7b')][_0x5adb('0xca')],_[_0x5adb('0xcb')](_0x1966f9[_0x5adb('0x7b')],[_0x5adb('0xca'),'id'])||{});}})['then'](respondWithResult(_0x40de49,null))[_0x5adb('0x39')](handleError(_0x40de49,null));};exports[_0x5adb('0xcc')]=function(_0x3a573a,_0x449847,_0x291b5a){var _0x4dcfbc={'raw':![],'where':{}};var _0x55b4ca={};var _0x29e9a2={'count':0x0,'rows':[]};return db[_0x5adb('0x41')][_0x5adb('0xcd')]({'where':{'id':_0x3a573a[_0x5adb('0xc2')]['id']}})[_0x5adb('0x2c')](handleEntityNotFound(_0x449847,null))[_0x5adb('0x2c')](function(_0x3f8a6b){if(_0x3f8a6b){_0x55b4ca['model']=_[_0x5adb('0x48')](db['SmsMessage'][_0x5adb('0x42')]);_0x55b4ca[_0x5adb('0x47')]=_[_0x5adb('0x48')](_0x3a573a['query']);_0x55b4ca[_0x5adb('0x49')]=_['intersection'](_0x55b4ca['model'],_0x55b4ca[_0x5adb('0x47')]);_0x4dcfbc[_0x5adb('0x4b')]=_[_0x5adb('0x4a')](_0x55b4ca[_0x5adb('0x46')],qs[_0x5adb('0xa5')](_0x3a573a[_0x5adb('0x47')]['fields']));_0x4dcfbc[_0x5adb('0x4b')]=_0x4dcfbc[_0x5adb('0x4b')][_0x5adb('0x68')]?_0x4dcfbc[_0x5adb('0x4b')]:_0x55b4ca[_0x5adb('0x46')];if(!_0x3a573a[_0x5adb('0x47')][_0x5adb('0x4c')](_0x5adb('0x4d'))){_0x4dcfbc['limit']=qs['limit'](_0x3a573a[_0x5adb('0x47')]['limit']);_0x4dcfbc['offset']=qs[_0x5adb('0x23')](_0x3a573a[_0x5adb('0x47')][_0x5adb('0x23')]);}_0x4dcfbc[_0x5adb('0x4e')]=qs[_0x5adb('0x4f')](_0x3a573a[_0x5adb('0x47')][_0x5adb('0x4f')]);_0x4dcfbc['where']=qs[_0x5adb('0x49')](_[_0x5adb('0x51')](_0x3a573a[_0x5adb('0x47')],_0x55b4ca[_0x5adb('0x49')]));_0x4dcfbc['where'][_0x5adb('0xbf')]=_0x3f8a6b['id'];if(_0x3a573a[_0x5adb('0x47')][_0x5adb('0x8e')]){_0x4dcfbc[_0x5adb('0x50')]=_[_0x5adb('0xa4')](_0x4dcfbc[_0x5adb('0x50')],{'$or':_['map'](_0x4dcfbc[_0x5adb('0x4b')],function(_0xf2fdf4){var _0xea7893={};_0xea7893[_0xf2fdf4]={'$like':'%'+_0x3a573a[_0x5adb('0x47')][_0x5adb('0x8e')]+'%'};return _0xea7893;})});}if(_0x3a573a[_0x5adb('0x47')][_0x5adb('0x82')]){var _0xc9ede8=_0x3a573a['query'][_0x5adb('0x82')]['split'](',');var _0x4ebc8a={};_0x4ebc8a[_0xc9ede8[0x0]]={'$gte':moment(_0xc9ede8[0x1])['format'](_0x5adb('0xce'))};_0x4dcfbc[_0x5adb('0x50')]=_[_0x5adb('0xa4')](_0x4dcfbc['where'],_0x4ebc8a);}_0x4dcfbc=_[_0x5adb('0xa4')]({},_0x4dcfbc,_0x3a573a['options']);return db[_0x5adb('0xc9')]['count']({'where':_0x4dcfbc['where']})[_0x5adb('0x2c')](function(_0x1b8a0b){_0x29e9a2[_0x5adb('0x26')]=_0x1b8a0b;if(_0x3a573a['query']['includeAll']){_0x4dcfbc[_0x5adb('0xc4')]=[{'all':!![]}];}return db[_0x5adb('0xc9')]['findAll'](_0x4dcfbc);})['then'](function(_0x546c6a){_0x29e9a2[_0x5adb('0xc0')]=_0x546c6a;return _0x29e9a2;});}})[_0x5adb('0x2c')](respondWithFilteredResult(_0x449847,_0x4dcfbc))[_0x5adb('0x39')](handleError(_0x449847,null));};exports['addTags']=function(_0x376a64,_0x3d2f4c,_0x332e14){return db[_0x5adb('0x41')]['find']({'where':{'id':_0x376a64[_0x5adb('0xc2')]['id']}})[_0x5adb('0x2c')](handleEntityNotFound(_0x3d2f4c,null))[_0x5adb('0x2c')](function(_0x505b7d){if(_0x505b7d){return _0x505b7d[_0x5adb('0xcf')](_0x376a64['body']['ids'],_['omit'](_0x376a64[_0x5adb('0x7b')],[_0x5adb('0xca'),'id'])||{})['spread'](function(){return db[_0x5adb('0xd0')][_0x5adb('0xd1')]({'attributes':['id',_0x5adb('0x30'),_0x5adb('0x54')],'where':{'id':_0x376a64[_0x5adb('0x7b')][_0x5adb('0xca')]}});})[_0x5adb('0x2c')](function(_0x2dd5a0){socket[_0x5adb('0xd2')](_0x5adb('0xd3'),{'id':Number(_0x376a64['params']['id']),'tags':_0x2dd5a0||[]});return{'id':Number(_0x376a64[_0x5adb('0xc2')]['id']),'tags':_0x2dd5a0||[]};});}})[_0x5adb('0x2c')](respondWithResult(_0x3d2f4c,null))[_0x5adb('0x39')](handleError(_0x3d2f4c,null));};exports['removeTags']=function(_0x3aabb0,_0x9e6b70,_0x67e44c){return db['SmsInteraction'][_0x5adb('0x69')]({'where':{'id':_0x3aabb0[_0x5adb('0xc2')]['id']}})['then'](handleEntityNotFound(_0x9e6b70,null))[_0x5adb('0x2c')](function(_0x17ffa9){if(_0x17ffa9){return _0x17ffa9['removeTags'](_0x3aabb0[_0x5adb('0x47')][_0x5adb('0xca')]);}})[_0x5adb('0x2c')](respondWithStatusCode(_0x9e6b70,null))[_0x5adb('0x39')](handleError(_0x9e6b70,null));};exports[_0x5adb('0xd4')]=function(_0x59fc9c,_0x4baffe){var _0x95cd62=moment()[_0x5adb('0xd5')]()['toString']();var _0x3db193=path[_0x5adb('0xd6')](config[_0x5adb('0xd7')],_0x5adb('0xd8'),_0x5adb('0xd9'),_0x5adb('0xda'));var _0x4310ce=path[_0x5adb('0xd6')](config[_0x5adb('0xd7')],_0x5adb('0xd8'),_0x5adb('0xd9'),_0x5adb('0xdb'));var _0x12d387=path[_0x5adb('0xd6')](_0x3db193,_0x95cd62);var _0x943f79=util['format'](_0x5adb('0xdc'),_0x59fc9c[_0x5adb('0xc2')]['id'],_0x95cd62);var _0x49f22d=path[_0x5adb('0xd6')](_0x3db193,_0x943f79);var _0x508c00=[];_0x508c00['push']({'model':db[_0x5adb('0x78')],'as':_0x5adb('0x78'),'attributes':['id',_0x5adb('0xdd')],'raw':!![]});_0x508c00[_0x5adb('0x38')]({'model':db[_0x5adb('0xde')],'as':'Contact','attributes':['id','firstName',_0x5adb('0xdf')],'raw':!![]});var _0x290575=[{'model':db[_0x5adb('0xc9')],'as':_0x5adb('0xe0'),'attributes':['id',_0x5adb('0x7b'),_0x5adb('0x81'),'direction',_0x5adb('0xe1'),'read'],'include':_0x508c00}];_0x290575[_0x5adb('0x38')]({'model':db[_0x5adb('0xe2')],'as':_0x5adb('0xe3'),'attributes':['id',_0x5adb('0x30')]});_0x290575[_0x5adb('0x38')]({'model':db[_0x5adb('0x78')],'as':'Owner','attributes':['id',_0x5adb('0xdd')]});return db['SmsInteraction'][_0x5adb('0x69')]({'where':{'id':_0x59fc9c[_0x5adb('0xc2')]['id']},'include':_0x290575})[_0x5adb('0x2c')](handleEntityNotFound(_0x4baffe,null))[_0x5adb('0x2c')](function(_0x369c4c){if(_0x369c4c){var _0x5bd39d=_0x369c4c['get']({'plain':!![]});fs['mkdirSync'](_0x12d387);var _0x5eb421={'channel':_0x5adb('0xe4'),'account':_0x5bd39d[_0x5adb('0xe3')][_0x5adb('0x30')],'agent':_0x5bd39d['Owner']?_0x5bd39d[_0x5adb('0xe5')]['fullname']:_0x5adb('0xe6'),'createdAt':moment(_0x5bd39d[_0x5adb('0x81')])[_0x5adb('0xe7')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5adb('0xbd')](),'closedAt':_0x5bd39d['closed']?moment(_0x5bd39d[_0x5adb('0xe8')])['format'](_0x5adb('0xce'))['toString']():'','disposition':_0x5bd39d[_0x5adb('0xe9')],'messages':_(_0x5bd39d[_0x5adb('0xe0')])[_0x5adb('0x8e')]({'secret':![]})[_0x5adb('0x33')](function(_0x52038f){return{'date':moment(_0x52038f['createdAt'])[_0x5adb('0xe7')](_0x5adb('0xce'))[_0x5adb('0xbd')](),'sender':_0x52038f[_0x5adb('0xea')]==='out'?_0x52038f[_0x5adb('0x78')]?_0x52038f[_0x5adb('0x78')][_0x5adb('0xdd')]:_0x5adb('0xeb'):_0x52038f[_0x5adb('0x6f')][_0x5adb('0xec')]+(_0x52038f['Contact'][_0x5adb('0xdf')]?'\x20'+_0x52038f['Contact'][_0x5adb('0xdf')]:''),'body':_0x52038f['body'],'direction':_0x52038f[_0x5adb('0xea')]==='out'?'A':'C','secret':_0x52038f[_0x5adb('0xe1')],'read':_0x52038f[_0x5adb('0x89')]};})[_0x5adb('0x6b')]()};return ejs[_0x5adb('0xed')](path['join'](config[_0x5adb('0xd7')],'server','views','downloadInteraction.ejs'),{'interaction':_0x5eb421})[_0x5adb('0x2c')](function(_0x376064){var _0x3ba4d5=path[_0x5adb('0xd6')](_0x12d387,_0x5adb('0xee')+_0x5bd39d['id']+'-'+_0x95cd62+_0x5adb('0xef'));var _0x26d024={'path':_0x3ba4d5,'channel':_0x5adb('0xe4'),'interactionId':_0x5bd39d['id']};return pdf[_0x5adb('0xf0')](_0x376064,_0x26d024);})[_0x5adb('0x2c')](function(){return new BPromise(function(_0x48110a,_0x4b7c76){zipdir(_0x12d387,{'saveTo':_0x49f22d},function(_0x3ab946,_0x45440c){if(_0x3ab946)return _0x4b7c76(_0x3ab946);return _0x48110a(_0x45440c);});})[_0x5adb('0x2c')](function(){return new BPromise(function(_0x1e168c,_0x3a274b){rimraf(_0x12d387,function(_0x2ed1d4){if(_0x2ed1d4)_0x3a274b(_0x2ed1d4);return _0x1e168c();});});})[_0x5adb('0x2c')](function(){return _0x4baffe['download'](_0x49f22d,_0x943f79,function(_0x599709){if(_0x599709){console[_0x5adb('0xf1')](_0x5adb('0xf2'),_0x599709);}else{fs['unlinkSync'](_0x49f22d);}});});});}else{return _0x4baffe[_0x5adb('0x1f')](0xc8);}})[_0x5adb('0x39')](handleError(_0x4baffe,null));};
\ No newline at end of file
+var _0x33f5=['disposition','out','System','firstName','lastName','secret','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','Users','map','fullname','TagIds','Tags','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','SmsInteraction','rawAttributes','fieldName','type','key','model','query','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','select','field','color','from','u.fullname','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','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','buildExpression','text','start','Tag','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','keys','isEmpty','i.SmsAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','fields','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','show','includeAll','include','create','body','params','addMessage','SmsMessage','ids','getMessages','findOne','pick','split','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','omit','spread','findAll','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','CmContact','Contact','Messages','direction','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','closedAt'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0x33f5,0xff));var _0x533f=function(_0xa04036,_0x414442){_0xa04036=_0xa04036-0x0;var _0x41dfc2=_0x33f5[_0xa04036];return _0x41dfc2;};'use strict';var emlformat=require(_0x533f('0x0'));var rimraf=require(_0x533f('0x1'));var zipdir=require(_0x533f('0x2'));var jsonpatch=require(_0x533f('0x3'));var rp=require(_0x533f('0x4'));var moment=require(_0x533f('0x5'));var BPromise=require(_0x533f('0x6'));var Mustache=require('mustache');var util=require(_0x533f('0x7'));var path=require(_0x533f('0x8'));var sox=require(_0x533f('0x9'));var csv=require(_0x533f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x533f('0xb'));var _=require(_0x533f('0xc'));var squel=require('squel');var crypto=require(_0x533f('0xd'));var jsforce=require(_0x533f('0xe'));var deskjs=require(_0x533f('0xf'));var toCsv=require(_0x533f('0xa'));var querystring=require(_0x533f('0x10'));var Papa=require(_0x533f('0x11'));var Redis=require(_0x533f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x533f('0x13'));var pdf=require(_0x533f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x533f('0x15'));var utils=require(_0x533f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x533f('0x17'))['db'];config[_0x533f('0x18')]=_['defaults'](config[_0x533f('0x18')],{'host':_0x533f('0x19'),'port':0x18eb});var socket=require(_0x533f('0x1a'))(new Redis(config[_0x533f('0x18')]));require(_0x533f('0x1b'))[_0x533f('0x1c')](socket);function respondWithStatusCode(_0x2cd48a,_0x5c0d0f){_0x5c0d0f=_0x5c0d0f||0xcc;return function(_0x2e9cb1){if(_0x2e9cb1){return _0x2cd48a['sendStatus'](_0x5c0d0f);}return _0x2cd48a[_0x533f('0x1d')](_0x5c0d0f)[_0x533f('0x1e')]();};}function respondWithResult(_0x5cd9e5,_0x53f697){_0x53f697=_0x53f697||0xc8;return function(_0x1d388b){if(_0x1d388b){return _0x5cd9e5[_0x533f('0x1d')](_0x53f697)[_0x533f('0x1f')](_0x1d388b);}};}function respondWithFilteredResult(_0x4a5adf,_0x3aa24d){return function(_0xe2e2e4){if(_0xe2e2e4){var _0x1f91bf=typeof _0x3aa24d['offset']===_0x533f('0x20')&&typeof _0x3aa24d[_0x533f('0x21')]==='undefined';var _0x568db1=_0xe2e2e4[_0x533f('0x22')];var _0x441a31=_0x1f91bf?0x0:_0x3aa24d[_0x533f('0x23')];var _0x25af15=_0x1f91bf?_0xe2e2e4[_0x533f('0x22')]:_0x3aa24d[_0x533f('0x23')]+_0x3aa24d[_0x533f('0x21')];var _0x492eac;if(_0x25af15>=_0x568db1){_0x25af15=_0x568db1;_0x492eac=0xc8;}else{_0x492eac=0xce;}_0x4a5adf['status'](_0x492eac);return _0x4a5adf[_0x533f('0x24')](_0x533f('0x25'),_0x441a31+'-'+_0x25af15+'/'+_0x568db1)[_0x533f('0x1f')](_0xe2e2e4);}return null;};}function patchUpdates(_0x113bdb){return function(_0x40252d){try{jsonpatch[_0x533f('0x26')](_0x40252d,_0x113bdb,!![]);}catch(_0x40fda2){return BPromise['reject'](_0x40fda2);}return _0x40252d[_0x533f('0x27')]();};}function saveUpdates(_0xd13101,_0x574087){return function(_0x49784b){if(_0x49784b){return _0x49784b[_0x533f('0x28')](_0xd13101)[_0x533f('0x29')](function(_0xd127ca){return _0xd127ca;});}return null;};}function removeEntity(_0x56c2b9,_0xa9cd85){return function(_0x420280){if(_0x420280){return _0x420280[_0x533f('0x2a')]()[_0x533f('0x29')](function(){_0x56c2b9[_0x533f('0x1d')](0xcc)[_0x533f('0x1e')]();});}};}function handleEntityNotFound(_0x5c3676,_0x4a9d26){return function(_0x1a5db2){if(!_0x1a5db2){_0x5c3676[_0x533f('0x2b')](0x194);}return _0x1a5db2;};}function handleError(_0x31012b,_0x34225c){_0x34225c=_0x34225c||0x1f4;return function(_0x58419e){logger[_0x533f('0x2c')](_0x58419e[_0x533f('0x2d')]);if(_0x58419e[_0x533f('0x2e')]){delete _0x58419e['name'];}_0x31012b[_0x533f('0x1d')](_0x34225c)['send'](_0x58419e);};}function getInteractionUsers(_0x392d8f,_0x771ffe){return new BPromise(function(_0x5bfc72,_0x32f512){try{if(_0x771ffe[_0x392d8f['id']]){_0x392d8f[_0x533f('0x2f')]=_[_0x533f('0x30')](_0x771ffe[_0x392d8f['id']],function(_0x20e003){return{'id':_0x20e003['id'],'fullname':_0x20e003[_0x533f('0x31')]};});}}catch(_0x37eb9b){_0x32f512(_0x37eb9b);}_0x5bfc72(_0x392d8f);});}function getInteractionTags(_0x81fc9f,_0x5704b0){return new BPromise(function(_0xb2bbd2,_0x25a984){try{if(_0x81fc9f[_0x533f('0x32')]){_0x81fc9f[_0x533f('0x33')]=[];_0x81fc9f[_0x533f('0x32')]['split'](',')[_0x533f('0x34')](function(_0x4b4752){_0x81fc9f[_0x533f('0x33')][_0x533f('0x35')](_0x5704b0[_0x4b4752]);});}delete _0x81fc9f[_0x533f('0x32')];}catch(_0x1b697e){_0x25a984(_0x1b697e);}_0xb2bbd2(_0x81fc9f);});}function updateSmsInteraction(_0x15e913,_0x452949,_0x441d0a){return new BPromise(function(_0x1dbd97,_0x5af516){return getInteractionUsers(_0x15e913,_0x441d0a)[_0x533f('0x29')](function(_0x46d19f){return getInteractionTags(_0x46d19f,_0x452949);})[_0x533f('0x29')](function(_0x1c44ed){return getStateInteraction(_0x1c44ed);})['then'](function(_0x50c680){_0x1dbd97(_0x50c680);})[_0x533f('0x36')](function(_0x35ceef){_0x5af516(_0x35ceef);});});}function getStateInteraction(_0x51eec7){return new BPromise(function(_0x59f7c8){_0x51eec7[_0x533f('0x37')]=0x0;_0x51eec7[_0x533f('0x38')]=0x0;_0x51eec7[_0x533f('0x39')]=0x0;_0x51eec7[_0x533f('0x3a')]=0x0;_0x51eec7[_0x533f('0x3b')]=0x0;if(!_0x51eec7[_0x533f('0x3c')]&&!_0x51eec7[_0x533f('0x3d')]){_0x51eec7[_0x533f('0x37')]+=0x1;}if(!_0x51eec7[_0x533f('0x3c')]&&_0x51eec7[_0x533f('0x3d')]){_0x51eec7[_0x533f('0x38')]+=0x1;if(_0x51eec7[_0x533f('0x37')]){_0x51eec7[_0x533f('0x37')]-=0x1;}}if(_0x51eec7[_0x533f('0x3c')]&&_0x51eec7[_0x533f('0x3d')]){_0x51eec7[_0x533f('0x39')]+=0x1;if(_0x51eec7[_0x533f('0x38')]){_0x51eec7[_0x533f('0x38')]-=0x1;}}if(_0x51eec7['closed']&&!_0x51eec7[_0x533f('0x3d')]){_0x51eec7[_0x533f('0x3a')]+=0x1;if(_0x51eec7['waiting']){_0x51eec7[_0x533f('0x37')]-=0x1;}}_0x51eec7[_0x533f('0x3b')]+=0x1;_0x59f7c8(_0x51eec7);});}exports[_0x533f('0x3e')]=function(_0x55dae7,_0x2f6e83){var _0x221d5f={},_0x1141f6={},_0x446717={'count':0x0,'rows':[]};var _0xbf2d9f=_[_0x533f('0x30')](db[_0x533f('0x3f')][_0x533f('0x40')],function(_0x1ba737){return{'name':_0x1ba737[_0x533f('0x41')],'type':_0x1ba737[_0x533f('0x42')][_0x533f('0x43')]};});_0x1141f6[_0x533f('0x44')]=_['map'](_0xbf2d9f,_0x533f('0x2e'));_0x1141f6[_0x533f('0x45')]=_['keys'](_0x55dae7[_0x533f('0x45')]);_0x1141f6['filters']=_['intersection'](_0x1141f6[_0x533f('0x44')],_0x1141f6[_0x533f('0x45')]);_0x221d5f[_0x533f('0x46')]=_[_0x533f('0x47')](_0x1141f6[_0x533f('0x44')],qs['fields'](_0x55dae7[_0x533f('0x45')]['fields']));_0x221d5f[_0x533f('0x46')]=_0x221d5f[_0x533f('0x46')][_0x533f('0x48')]?_0x221d5f[_0x533f('0x46')]:_0x1141f6[_0x533f('0x44')];if(!_0x55dae7[_0x533f('0x45')][_0x533f('0x49')](_0x533f('0x4a'))){_0x221d5f[_0x533f('0x21')]=qs['limit'](_0x55dae7[_0x533f('0x45')][_0x533f('0x21')]);_0x221d5f[_0x533f('0x23')]=qs[_0x533f('0x23')](_0x55dae7[_0x533f('0x45')][_0x533f('0x23')]);}_0x221d5f[_0x533f('0x4b')]=qs[_0x533f('0x4c')](_0x55dae7['query'][_0x533f('0x4c')]);_0x221d5f[_0x533f('0x4d')]=qs['filters'](_['pick'](_0x55dae7[_0x533f('0x45')],_0x1141f6[_0x533f('0x4e')]),_0xbf2d9f);var _0xbef1e7=[];var _0x3c180e=squel[_0x533f('0x4f')]()[_0x533f('0x50')]('id')[_0x533f('0x50')](_0x533f('0x2e'))[_0x533f('0x50')](_0x533f('0x51'))[_0x533f('0x52')]('tools_tags');var _0x56854f=squel[_0x533f('0x4f')]()[_0x533f('0x50')]('u.id')[_0x533f('0x50')](_0x533f('0x53'))[_0x533f('0x50')]('ui.SmsInteractionId')[_0x533f('0x52')](_0x533f('0x54'),'ui')[_0x533f('0x55')](_0x533f('0x56'),'u',_0x533f('0x57'));var _0x3d7772=squel[_0x533f('0x4f')]()['from'](_0x533f('0x58'),'i')['left_join'](_0x533f('0x59'),'c',_0x533f('0x5a'))[_0x533f('0x55')]('users','o',_0x533f('0x5b'))['left_join'](_0x533f('0x5c'),'a',_0x533f('0x5d'))[_0x533f('0x55')](_0x533f('0x5e'),'me',_0x533f('0x5f'))[_0x533f('0x55')](_0x533f('0x60'),'it',_0x533f('0x61'))[_0x533f('0x55')]('tools_tags','t',_0x533f('0x62'));var _0x574653=squel[_0x533f('0x63')]();var _0x24be9b=[];var _0xd007cf=squel[_0x533f('0x63')]();var _0x5548d0;if(_0x55dae7[_0x533f('0x45')]['search']){_0x5548d0=as[_0x533f('0x64')](_0x55dae7[_0x533f('0x45')][_0x533f('0x65')]);var _0x53d2b6=_0x5548d0[_0x533f('0x66')];for(var _0x5aa85d=0x0;_0x5aa85d<_0x5548d0['conditions'][_0x533f('0x48')];_0x5aa85d++){var _0x12bc1d=_0x5548d0[_0x533f('0x67')][_0x5aa85d];var _0x3cc67a='i';var _0x2d15e0=_[_0x533f('0x68')](_0xbf2d9f,['name',_0x12bc1d[_0x533f('0x50')]]);if(!_0x2d15e0){switch(_0x12bc1d[_0x533f('0x50')]){case _0x533f('0x69'):if(_0x12bc1d[_0x533f('0x6a')]==0x1){_0x3d7772['having']('`'+_0x12bc1d[_0x533f('0x50')]+_0x533f('0x6b'));}else{_0x3d7772[_0x533f('0x6c')]('`'+_0x12bc1d[_0x533f('0x50')]+_0x533f('0x6d'));}break;case'Contact':if(_0x12bc1d[_0x533f('0x6e')]==='$substring'){if(_0x12bc1d[_0x533f('0x6a')]['split']('\x20')[_0x533f('0x48')]>0x1){_0x574653[_0x53d2b6](_0x533f('0x6f'),qs[_0x533f('0x70')](_0x12bc1d['value']),null);}else{var _0x15c3cd='%'+_0x12bc1d[_0x533f('0x6a')]+'%';_0x574653[_0x53d2b6]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x15c3cd,_0x15c3cd,_0x15c3cd);}}else{_0x2d15e0=_[_0x533f('0x68')](_0xbf2d9f,[_0x533f('0x2e'),'ContactId']);_0x12bc1d['field']='ContactId';_0x4619d3=as[_0x533f('0x71')](_0x3cc67a,_0x2d15e0['type'],_0x12bc1d);_0x574653[_0x53d2b6](_0x4619d3[_0x533f('0x72')],_0x4619d3['value'][_0x533f('0x73')],_0x4619d3[_0x533f('0x6a')][_0x533f('0x1e')]);}break;case _0x533f('0x74'):var _0x506478=_0x12bc1d['value']['split'](',')[_0x533f('0x30')](function(_0x12b195){return Number(_0x12b195);});_0x506478[_0x533f('0x34')](function(_0x2f8c00){_0xd007cf['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2f8c00+',%');});_0x24be9b=_[_0x533f('0x75')](_0x24be9b,_0x506478);break;case _0x533f('0x76'):if(_0x12bc1d['operator']===_0x533f('0x77')){_0x574653[_0x53d2b6](_0x533f('0x78'),'%'+_0x12bc1d[_0x533f('0x6a')]+'%',null);}else{_0x2d15e0=_[_0x533f('0x68')](_0xbf2d9f,[_0x533f('0x2e'),_0x533f('0x3d')]);_0x12bc1d[_0x533f('0x50')]=_0x533f('0x3d');_0x4619d3=as['buildExpression'](_0x3cc67a,_0x2d15e0['type'],_0x12bc1d);_0x574653[_0x53d2b6](_0x4619d3['text'],_0x4619d3[_0x533f('0x6a')][_0x533f('0x73')],_0x4619d3[_0x533f('0x6a')][_0x533f('0x1e')]);}break;case'body':_0x4619d3=as[_0x533f('0x71')]('me',null,_0x12bc1d);_0x574653[_0x53d2b6](_0x4619d3[_0x533f('0x72')],_0x4619d3[_0x533f('0x6a')][_0x533f('0x73')],_0x4619d3[_0x533f('0x6a')][_0x533f('0x1e')]);break;}}else{var _0x4619d3=as[_0x533f('0x71')](_0x3cc67a,_0x2d15e0['type'],_0x12bc1d);_0x574653[_0x53d2b6](_0x4619d3[_0x533f('0x72')],_0x4619d3[_0x533f('0x6a')]['start'],_0x4619d3[_0x533f('0x6a')][_0x533f('0x1e')]);}}}else{var _0x9277c9=_(_0x55dae7[_0x533f('0x45')])[_0x533f('0x79')]()[_0x533f('0x30')](function(_0x5dc594){return _['some'](_0xbf2d9f,[_0x533f('0x2e'),_0x5dc594])?_0x5dc594:undefined;})['compact']()[_0x533f('0x6a')]();if(!_[_0x533f('0x7a')](_0x9277c9)){_0x9277c9[_0x533f('0x34')](function(_0x115580){if(_0x115580==='SmsAccountId'){_0x3d7772[_0x533f('0x4d')](_0x533f('0x7b'),[]['concat'](_0x55dae7[_0x533f('0x45')][_0x115580]));}else if(_0x115580===_0x533f('0x7c')){var _0x4910de=JSON[_0x533f('0x7d')](_0x55dae7['query'][_0x115580])[_0x533f('0x7e')];var _0xaa498b=JSON['parse'](_0x55dae7[_0x533f('0x45')][_0x115580])[_0x533f('0x7f')];_0x3d7772[_0x533f('0x4d')](_0x533f('0x80'),_0x4910de,_0xaa498b);}else{if(_0x55dae7[_0x533f('0x45')][_0x115580]===_0x533f('0x81')){_0x3d7772['where']('i.'+_0x115580+_0x533f('0x82'));}else{_0x3d7772['where']('i.'+_0x115580+_0x533f('0x83'),_0x55dae7[_0x533f('0x45')][_0x115580]);}}});}if(_0x55dae7[_0x533f('0x45')][_0x533f('0x84')]){if(_0x55dae7[_0x533f('0x45')]['read']==0x1){_0x3d7772[_0x533f('0x6c')](_0x533f('0x85'));}else{_0x3d7772[_0x533f('0x6c')]('`unreadMessages`\x20>\x200');}}if(_0x55dae7['query'][_0x533f('0x86')]){_0x24be9b=_[_0x533f('0x87')](_0x55dae7['query'][_0x533f('0x86')])?_0x55dae7['query']['tag']:new Array(_0x55dae7[_0x533f('0x45')][_0x533f('0x86')]);_0x24be9b[_0x533f('0x34')](function(_0x2b5cb2){_0xd007cf['or'](_0x533f('0x88'),'%,'+_0x2b5cb2+',%');});}if(_0x55dae7[_0x533f('0x45')][_0x533f('0x89')]){var _0x5a5416=_0x55dae7[_0x533f('0x45')][_0x533f('0x89')][_0x533f('0x8a')]('\x5c','\x5c\x5c')[_0x533f('0x8a')](/'/g,'\x27\x27');if(qs[_0x533f('0x8b')](_0x5a5416)){_0x574653['or'](_0x533f('0x8c'),_0x5a5416+'%')['or']('i.phone\x20LIKE\x20?',_0x5a5416+'%');}else{_0x574653['or'](_0x533f('0x8d'),qs[_0x533f('0x70')](_0x5a5416))['or'](_0x533f('0x8e'),_0x5a5416+'%');}}}_0x3d7772[_0x533f('0x4d')](_0x574653);_0x3d7772['group'](_0x533f('0x8f'));var _0x5514f9={'type':db[_0x533f('0x90')][_0x533f('0x91')]['SELECT'],'raw':!![]};var _0x637bb3=_0x3d7772[_0x533f('0x92')]();_0x637bb3['field'](_0x533f('0x8f'));_0x637bb3[_0x533f('0x50')](_0x533f('0x93'),'unreadMessages');if(_0x221d5f['order']){_0x221d5f[_0x533f('0x4b')][_0x533f('0x34')](function(_0x289e09){var _0x55a73c=_0x289e09[0x0]===_0x533f('0x94')?_0x289e09[0x0]:'i.'+_0x289e09[0x0];_0x3d7772['order'](_0x55a73c,_0x289e09[0x1]==='DESC'?![]:!![]);});}if(!_[_0x533f('0x7a')](_0x24be9b)){_0x3d7772[_0x533f('0x6c')](_0xd007cf);_0x637bb3[_0x533f('0x4d')](_0x533f('0x95'),_0x24be9b);}BPromise[_0x533f('0x96')]()[_0x533f('0x29')](function(){if(!_0x5548d0){if(_0x55dae7['query'][_0x533f('0x97')])return;_0x637bb3[_0x533f('0x4d')](_0x533f('0x98'));_0x3d7772[_0x533f('0x4d')](_0x533f('0x98'));return;}if(_0x55dae7[_0x533f('0x99')][_0x533f('0x9a')]!==_0x533f('0x9b'))return;return _0x55dae7[_0x533f('0x99')][_0x533f('0x9c')]({'attributes':['id'],'raw':!![]})[_0x533f('0x29')](function(_0x486ec2){if(_[_0x533f('0x7a')](_0x486ec2)){_0x637bb3[_0x533f('0x4d')](_0x533f('0x9d'));_0x3d7772[_0x533f('0x4d')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x637bb3[_0x533f('0x4d')](_0x533f('0x7b'),_[_0x533f('0x30')](_0x486ec2,'id'));_0x3d7772[_0x533f('0x4d')](_0x533f('0x7b'),_[_0x533f('0x30')](_0x486ec2,'id'));}});})[_0x533f('0x29')](function(){if(_0x55dae7[_0x533f('0x99')][_0x533f('0x9a')]===_0x533f('0x9b')&&!_0x5548d0&&!_0x55dae7['query'][_0x533f('0x97')])return[];return db[_0x533f('0x9e')][_0x533f('0x45')](_0x637bb3['toString'](),_0x5514f9);})[_0x533f('0x29')](function(_0x414337){_0x446717[_0x533f('0x22')]=_0x414337['length'];if(_0x446717[_0x533f('0x22')]===0x0)return[];return db[_0x533f('0x9e')]['query'](_0x3c180e[_0x533f('0x9f')](),_0x5514f9)[_0x533f('0x29')](function(_0x223bb5){_0xbef1e7=_[_0x533f('0xa0')](_0x223bb5,'id');_0x5514f9=_[_0x533f('0xa1')](_0x5514f9,{'model':db[_0x533f('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x55dae7[_0x533f('0x45')][_0x533f('0xa2')]){_0x221d5f[_0x533f('0x46')][_0x533f('0x34')](function(_0x26932c){_0x3d7772[_0x533f('0x50')]('i.'+_0x26932c);});}else{_0x3d7772[_0x533f('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x3d7772[_0x533f('0x50')](_0x533f('0xa3'),'Account.key');_0x3d7772[_0x533f('0x50')](_0x533f('0xa4'),_0x533f('0xa5'));_0x3d7772[_0x533f('0x50')](_0x533f('0xa6'),_0x533f('0x94'));_0x3d7772[_0x533f('0x50')]('i.*');_0x3d7772[_0x533f('0x50')](_0x533f('0xa7'),_0x533f('0xa8'));_0x3d7772[_0x533f('0x50')]('c.lastName',_0x533f('0xa9'));_0x3d7772[_0x533f('0x50')](_0x533f('0xaa'),'Contact.email');_0x3d7772[_0x533f('0x50')](_0x533f('0xab'),_0x533f('0xac'));_0x3d7772[_0x533f('0x50')](_0x533f('0xad'),'Contact.mobile');_0x3d7772[_0x533f('0x50')](_0x533f('0xae'),_0x533f('0xaf'));_0x3d7772[_0x533f('0x50')](_0x533f('0xb0'),'Owner.fullname');_0x3d7772[_0x533f('0x50')]('o.internal',_0x533f('0xb1'));_0x3d7772[_0x533f('0x50')](_0x533f('0xb2'),_0x533f('0x32'));}if(_0x221d5f[_0x533f('0x21')])_0x3d7772[_0x533f('0x21')](_0x221d5f[_0x533f('0x21')]);if(_0x221d5f[_0x533f('0x23')])_0x3d7772[_0x533f('0x23')](_0x221d5f[_0x533f('0x23')]);return db[_0x533f('0x9e')][_0x533f('0x45')](_0x3d7772[_0x533f('0x9f')](),_0x5514f9);})[_0x533f('0x29')](function(_0x1fe5b4){if(_0x1fe5b4[_0x533f('0x48')]>0x0)_0x56854f[_0x533f('0x4d')](_0x533f('0xb3'),_['map'](_0x1fe5b4,'id'));return db[_0x533f('0x9e')][_0x533f('0x45')](_0x56854f['toString'](),_0x5514f9)[_0x533f('0x29')](function(_0x6be050){var _0x2165d2=_[_0x533f('0xb4')](_0x6be050,_0x533f('0xb5'));var _0x378ac2=[];_0x1fe5b4[_0x533f('0x34')](function(_0xf3a4f){_0x378ac2[_0x533f('0x35')](updateSmsInteraction(_0xf3a4f,_0xbef1e7,_0x2165d2));});return BPromise[_0x533f('0xb6')](_0x378ac2);});});})[_0x533f('0x29')](function(_0x2b324a){_0x446717['rows']=_0x2b324a;return _0x446717;})[_0x533f('0x29')](respondWithFilteredResult(_0x2f6e83,_0x221d5f))['catch'](handleError(_0x2f6e83,null));};exports[_0x533f('0xb7')]=function(_0x2ca743,_0x4371b1){var _0x1f0420={'raw':![],'where':{'id':_0x2ca743['params']['id']}},_0x4ca60c={};_0x4ca60c['model']=_[_0x533f('0x79')](db[_0x533f('0x3f')][_0x533f('0x40')]);_0x4ca60c[_0x533f('0x45')]=_['keys'](_0x2ca743[_0x533f('0x45')]);_0x4ca60c[_0x533f('0x4e')]=_[_0x533f('0x47')](_0x4ca60c['model'],_0x4ca60c['query']);_0x1f0420[_0x533f('0x46')]=_['intersection'](_0x4ca60c[_0x533f('0x44')],qs[_0x533f('0xa2')](_0x2ca743[_0x533f('0x45')]['fields']));_0x1f0420[_0x533f('0x46')]=_0x1f0420[_0x533f('0x46')][_0x533f('0x48')]?_0x1f0420[_0x533f('0x46')]:_0x4ca60c[_0x533f('0x44')];if(_0x2ca743['query'][_0x533f('0xb8')]){_0x1f0420[_0x533f('0xb9')]=[{'all':!![]}];}_0x1f0420=_[_0x533f('0xa1')]({},_0x1f0420,_0x2ca743['options']);return db[_0x533f('0x3f')][_0x533f('0x68')](_0x1f0420)[_0x533f('0x29')](handleEntityNotFound(_0x4371b1,null))[_0x533f('0x29')](respondWithResult(_0x4371b1,null))[_0x533f('0x36')](handleError(_0x4371b1,null));};exports[_0x533f('0xba')]=function(_0x44d394,_0x1fe81b){return db[_0x533f('0x3f')][_0x533f('0xba')](_0x44d394[_0x533f('0xbb')],{})[_0x533f('0x29')](respondWithResult(_0x1fe81b,0xc9))[_0x533f('0x36')](handleError(_0x1fe81b,null));};exports['update']=function(_0x39907f,_0x53fdde){if(_0x39907f[_0x533f('0xbb')]['id']){delete _0x39907f[_0x533f('0xbb')]['id'];}return db[_0x533f('0x3f')]['find']({'where':{'id':_0x39907f[_0x533f('0xbc')]['id']}})[_0x533f('0x29')](handleEntityNotFound(_0x53fdde,null))[_0x533f('0x29')](saveUpdates(_0x39907f['body'],null))[_0x533f('0x29')](respondWithResult(_0x53fdde,null))[_0x533f('0x36')](handleError(_0x53fdde,null));};exports[_0x533f('0x2a')]=function(_0x162a6f,_0x4ab341){return db[_0x533f('0x3f')][_0x533f('0x68')]({'where':{'id':_0x162a6f['params']['id']}})[_0x533f('0x29')](handleEntityNotFound(_0x4ab341,null))['then'](removeEntity(_0x4ab341,null))[_0x533f('0x36')](handleError(_0x4ab341,null));};exports['describe']=function(_0x1b1be1,_0x2862ee){return db[_0x533f('0x3f')]['describe']()[_0x533f('0x29')](respondWithResult(_0x2862ee,null))['catch'](handleError(_0x2862ee,null));};exports[_0x533f('0xbd')]=function(_0x43862e,_0x118c95,_0x437726){return db[_0x533f('0xbe')]['find']({'where':{'id':_0x43862e[_0x533f('0xbc')]['id']}})['then'](handleEntityNotFound(_0x118c95,null))[_0x533f('0x29')](function(_0x20f0ea){if(_0x20f0ea){return _0x20f0ea['addMessage'](_0x43862e[_0x533f('0xbb')][_0x533f('0xbf')],_['omit'](_0x43862e[_0x533f('0xbb')],[_0x533f('0xbf'),'id'])||{});}})[_0x533f('0x29')](respondWithResult(_0x118c95,null))['catch'](handleError(_0x118c95,null));};exports[_0x533f('0xc0')]=function(_0x5d6c80,_0x25cc64,_0x68e6f0){var _0x4c1049={'raw':![],'where':{}};var _0x2f8e50={};var _0x660672={'count':0x0,'rows':[]};return db[_0x533f('0x3f')][_0x533f('0xc1')]({'where':{'id':_0x5d6c80[_0x533f('0xbc')]['id']}})[_0x533f('0x29')](handleEntityNotFound(_0x25cc64,null))['then'](function(_0x3533f7){if(_0x3533f7){_0x2f8e50[_0x533f('0x44')]=_[_0x533f('0x79')](db[_0x533f('0xbe')][_0x533f('0x40')]);_0x2f8e50[_0x533f('0x45')]=_[_0x533f('0x79')](_0x5d6c80[_0x533f('0x45')]);_0x2f8e50[_0x533f('0x4e')]=_[_0x533f('0x47')](_0x2f8e50[_0x533f('0x44')],_0x2f8e50[_0x533f('0x45')]);_0x4c1049[_0x533f('0x46')]=_[_0x533f('0x47')](_0x2f8e50['model'],qs[_0x533f('0xa2')](_0x5d6c80[_0x533f('0x45')][_0x533f('0xa2')]));_0x4c1049[_0x533f('0x46')]=_0x4c1049[_0x533f('0x46')][_0x533f('0x48')]?_0x4c1049[_0x533f('0x46')]:_0x2f8e50[_0x533f('0x44')];if(!_0x5d6c80[_0x533f('0x45')][_0x533f('0x49')](_0x533f('0x4a'))){_0x4c1049[_0x533f('0x21')]=qs[_0x533f('0x21')](_0x5d6c80[_0x533f('0x45')][_0x533f('0x21')]);_0x4c1049['offset']=qs[_0x533f('0x23')](_0x5d6c80[_0x533f('0x45')]['offset']);}_0x4c1049[_0x533f('0x4b')]=qs[_0x533f('0x4c')](_0x5d6c80[_0x533f('0x45')][_0x533f('0x4c')]);_0x4c1049[_0x533f('0x4d')]=qs[_0x533f('0x4e')](_[_0x533f('0xc2')](_0x5d6c80[_0x533f('0x45')],_0x2f8e50[_0x533f('0x4e')]));_0x4c1049[_0x533f('0x4d')][_0x533f('0xb5')]=_0x3533f7['id'];if(_0x5d6c80[_0x533f('0x45')][_0x533f('0x89')]){_0x4c1049[_0x533f('0x4d')]=_[_0x533f('0xa1')](_0x4c1049[_0x533f('0x4d')],{'$or':_['map'](_0x4c1049[_0x533f('0x46')],function(_0x2db79a){var _0x3c848c={};_0x3c848c[_0x2db79a]={'$like':'%'+_0x5d6c80[_0x533f('0x45')]['filter']+'%'};return _0x3c848c;})});}if(_0x5d6c80[_0x533f('0x45')][_0x533f('0x7e')]){var _0x276bdf=_0x5d6c80[_0x533f('0x45')][_0x533f('0x7e')][_0x533f('0xc3')](',');var _0x1e0a94={};_0x1e0a94[_0x276bdf[0x0]]={'$gte':moment(_0x276bdf[0x1])['format'](_0x533f('0xc4'))};_0x4c1049[_0x533f('0x4d')]=_[_0x533f('0xa1')](_0x4c1049[_0x533f('0x4d')],_0x1e0a94);}_0x4c1049=_['merge']({},_0x4c1049,_0x5d6c80[_0x533f('0xc5')]);return db['SmsMessage'][_0x533f('0x22')]({'where':_0x4c1049[_0x533f('0x4d')]})[_0x533f('0x29')](function(_0x342777){_0x660672[_0x533f('0x22')]=_0x342777;if(_0x5d6c80[_0x533f('0x45')]['includeAll']){_0x4c1049['include']=[{'all':!![]}];}return db[_0x533f('0xbe')]['findAll'](_0x4c1049);})[_0x533f('0x29')](function(_0x201baa){_0x660672[_0x533f('0xc6')]=_0x201baa;return _0x660672;});}})[_0x533f('0x29')](respondWithFilteredResult(_0x25cc64,_0x4c1049))[_0x533f('0x36')](handleError(_0x25cc64,null));};exports[_0x533f('0xc7')]=function(_0x83e1af,_0x3fa4a2,_0x4731a7){return db[_0x533f('0x3f')]['find']({'where':{'id':_0x83e1af[_0x533f('0xbc')]['id']}})['then'](handleEntityNotFound(_0x3fa4a2,null))[_0x533f('0x29')](function(_0x57249a){if(_0x57249a){return _0x57249a[_0x533f('0xc8')](_0x83e1af[_0x533f('0xbb')][_0x533f('0xbf')],_[_0x533f('0xc9')](_0x83e1af['body'],[_0x533f('0xbf'),'id'])||{})[_0x533f('0xca')](function(){return db[_0x533f('0x74')][_0x533f('0xcb')]({'attributes':['id',_0x533f('0x2e'),_0x533f('0x51')],'where':{'id':_0x83e1af['body'][_0x533f('0xbf')]}});})[_0x533f('0x29')](function(_0xbf2b28){socket[_0x533f('0xcc')](_0x533f('0xcd'),{'id':Number(_0x83e1af[_0x533f('0xbc')]['id']),'tags':_0xbf2b28||[]});return{'id':Number(_0x83e1af[_0x533f('0xbc')]['id']),'tags':_0xbf2b28||[]};});}})[_0x533f('0x29')](respondWithResult(_0x3fa4a2,null))[_0x533f('0x36')](handleError(_0x3fa4a2,null));};exports[_0x533f('0xce')]=function(_0x35ee5a,_0x1b0d80,_0x1ea233){return db[_0x533f('0x3f')]['find']({'where':{'id':_0x35ee5a[_0x533f('0xbc')]['id']}})[_0x533f('0x29')](handleEntityNotFound(_0x1b0d80,null))[_0x533f('0x29')](function(_0x2db98e){if(_0x2db98e){return _0x2db98e[_0x533f('0xce')](_0x35ee5a[_0x533f('0x45')][_0x533f('0xbf')]);}})[_0x533f('0x29')](respondWithStatusCode(_0x1b0d80,null))[_0x533f('0x36')](handleError(_0x1b0d80,null));};exports[_0x533f('0xcf')]=function(_0x1519c1,_0x33bfab){var _0x2a4729=moment()[_0x533f('0xd0')]()[_0x533f('0x9f')]();var _0x43661f=path[_0x533f('0xd1')](config[_0x533f('0xd2')],_0x533f('0xd3'),_0x533f('0xd4'),_0x533f('0xd5'));var _0x22e574=path['join'](config[_0x533f('0xd2')],_0x533f('0xd3'),_0x533f('0xd4'),_0x533f('0xd6'));var _0x17b9a5=path[_0x533f('0xd1')](_0x43661f,_0x2a4729);var _0x21fa7b=util[_0x533f('0xd7')](_0x533f('0xd8'),_0x1519c1[_0x533f('0xbc')]['id'],_0x2a4729);var _0x8a6d73=path[_0x533f('0xd1')](_0x43661f,_0x21fa7b);var _0x18a666=[];_0x18a666[_0x533f('0x35')]({'model':db[_0x533f('0x76')],'as':_0x533f('0x76'),'attributes':['id',_0x533f('0x31')],'raw':!![]});_0x18a666[_0x533f('0x35')]({'model':db[_0x533f('0xd9')],'as':_0x533f('0xda'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x6c1c09=[{'model':db[_0x533f('0xbe')],'as':_0x533f('0xdb'),'attributes':['id',_0x533f('0xbb'),_0x533f('0x7c'),_0x533f('0xdc'),'secret','read'],'include':_0x18a666}];_0x6c1c09['push']({'model':db[_0x533f('0xdd')],'as':_0x533f('0xde'),'attributes':['id',_0x533f('0x2e')]});_0x6c1c09[_0x533f('0x35')]({'model':db['User'],'as':_0x533f('0xdf'),'attributes':['id','fullname']});return db[_0x533f('0x3f')]['find']({'where':{'id':_0x1519c1[_0x533f('0xbc')]['id']},'include':_0x6c1c09})[_0x533f('0x29')](handleEntityNotFound(_0x33bfab,null))['then'](function(_0x1aecd5){if(_0x1aecd5){var _0x42c1f9=_0x1aecd5[_0x533f('0xe0')]({'plain':!![]});fs[_0x533f('0xe1')](_0x17b9a5);var _0x51e09a={'channel':_0x533f('0xe2'),'account':_0x42c1f9[_0x533f('0xde')][_0x533f('0x2e')],'agent':_0x42c1f9['Owner']?_0x42c1f9['Owner'][_0x533f('0x31')]:_0x533f('0xe3'),'createdAt':moment(_0x42c1f9[_0x533f('0x7c')])[_0x533f('0xd7')]('YYYY-MM-DD\x20HH:mm:ss')[_0x533f('0x9f')](),'closedAt':_0x42c1f9['closed']?moment(_0x42c1f9[_0x533f('0xe4')])['format'](_0x533f('0xc4'))[_0x533f('0x9f')]():'','disposition':_0x42c1f9[_0x533f('0xe5')],'messages':_(_0x42c1f9[_0x533f('0xdb')])[_0x533f('0x89')]({'secret':![]})[_0x533f('0x30')](function(_0x1fb9b9){return{'date':moment(_0x1fb9b9[_0x533f('0x7c')])[_0x533f('0xd7')](_0x533f('0xc4'))[_0x533f('0x9f')](),'sender':_0x1fb9b9[_0x533f('0xdc')]===_0x533f('0xe6')?_0x1fb9b9[_0x533f('0x76')]?_0x1fb9b9['User'][_0x533f('0x31')]:_0x533f('0xe7'):_0x1fb9b9[_0x533f('0xda')][_0x533f('0xe8')]+(_0x1fb9b9['Contact']['lastName']?'\x20'+_0x1fb9b9[_0x533f('0xda')][_0x533f('0xe9')]:''),'body':_0x1fb9b9['body'],'direction':_0x1fb9b9[_0x533f('0xdc')]==='out'?'A':'C','secret':_0x1fb9b9[_0x533f('0xea')],'read':_0x1fb9b9[_0x533f('0x84')]};})[_0x533f('0x6a')]()};return ejs['renderFile'](path[_0x533f('0xd1')](config[_0x533f('0xd2')],_0x533f('0xd3'),_0x533f('0xeb'),_0x533f('0xec')),{'interaction':_0x51e09a})[_0x533f('0x29')](function(_0x34b002){var _0x5a6a63=path[_0x533f('0xd1')](_0x17b9a5,'transcript-'+_0x42c1f9['id']+'-'+_0x2a4729+_0x533f('0xed'));var _0x296748={'path':_0x5a6a63,'channel':_0x533f('0xe2'),'interactionId':_0x42c1f9['id']};return pdf[_0x533f('0xee')](_0x34b002,_0x296748);})['then'](function(){return new BPromise(function(_0x5436df,_0x379edf){zipdir(_0x17b9a5,{'saveTo':_0x8a6d73},function(_0x4812fb,_0xd7f6a5){if(_0x4812fb)return _0x379edf(_0x4812fb);return _0x5436df(_0xd7f6a5);});})[_0x533f('0x29')](function(){return new BPromise(function(_0x2a66a6,_0x5529dc){rimraf(_0x17b9a5,function(_0x622116){if(_0x622116)_0x5529dc(_0x622116);return _0x2a66a6();});});})[_0x533f('0x29')](function(){return _0x33bfab[_0x533f('0xcf')](_0x8a6d73,_0x21fa7b,function(_0x6c2a3e){if(_0x6c2a3e){console[_0x533f('0xef')](_0x533f('0xf0'),_0x6c2a3e);}else{fs[_0x533f('0xf1')](_0x8a6d73);}});});});}else{return _0x33bfab[_0x533f('0x2b')](0xc8);}})[_0x533f('0x36')](handleError(_0x33bfab,null));};
\ No newline at end of file
index 294c932..b83372d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7916=['Users','findAll','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','SmsInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers'];(function(_0x38a277,_0x123338){var _0x36c7a3=function(_0x4fc5fb){while(--_0x4fc5fb){_0x38a277['push'](_0x38a277['shift']());}};_0x36c7a3(++_0x123338);}(_0x7916,0x128));var _0x6791=function(_0x1fca69,_0x41c93f){_0x1fca69=_0x1fca69-0x0;var _0x538a1c=_0x7916[_0x1fca69];return _0x538a1c;};'use strict';var EventEmitter=require(_0x6791('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x6791('0x1')];var SmsMessage=require(_0x6791('0x2'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x6791('0x3')](0x0);var events={'afterCreate':_0x6791('0x4'),'afterUpdate':_0x6791('0x5'),'afterDestroy':_0x6791('0x6')};function emitEvent(_0x5e6303){return function(_0xe98396,_0x5a5726,_0x3ca328){_0xe98396[_0x6791('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x8b85ff){_0xe98396['setDataValue'](_0x6791('0x8'),_0x8b85ff['map'](function(_0x4ef65f){return{'id':_0x4ef65f['id']};}));return SmsMessage[_0x6791('0x9')]({'where':{'SmsInteractionId':_0xe98396['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6791('0xa')](function(_0x579950){_0xe98396[_0x6791('0xb')](_0x6791('0xc'),_0x579950[_0x6791('0xd')]);SmsInteractionEvents['emit'](_0x5e6303+':'+_0xe98396['id'],_0xe98396);SmsInteractionEvents[_0x6791('0xe')](_0x5e6303,_0xe98396);_0x3ca328(null);})[_0x6791('0xf')](_0x3ca328(null));};}for(var e in events){if(events[_0x6791('0x10')](e)){var event=events[e];SmsInteraction[_0x6791('0x11')](e,emitEvent(event));}}module[_0x6791('0x12')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x0abf=['Users','map','emit','catch','hasOwnProperty','hook','exports','events','SmsInteraction','../../mysqldb','save','remove','getUsers','then','setDataValue'];(function(_0xaf4843,_0x213130){var _0x2df588=function(_0x1694c5){while(--_0x1694c5){_0xaf4843['push'](_0xaf4843['shift']());}};_0x2df588(++_0x213130);}(_0x0abf,0xe8));var _0xf0ab=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x0abf[_0x5ddb1c];return _0x354adc;};'use strict';var EventEmitter=require(_0xf0ab('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xf0ab('0x1')];var SmsMessage=require(_0xf0ab('0x2'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf0ab('0x3'),'afterUpdate':'update','afterDestroy':_0xf0ab('0x4')};function emitEvent(_0x3be05e){return function(_0x2efe43,_0xbb1f91,_0x2ab7d6){_0x2efe43[_0xf0ab('0x5')]({'attributes':['id'],'raw':!![]})[_0xf0ab('0x6')](function(_0x57ff3b){_0x2efe43[_0xf0ab('0x7')](_0xf0ab('0x8'),_0x57ff3b[_0xf0ab('0x9')](function(_0x236b07){return{'id':_0x236b07['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x2efe43['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf0ab('0x6')](function(_0x4688d8){_0x2efe43[_0xf0ab('0x7')]('unreadMessages',_0x4688d8['length']);SmsInteractionEvents[_0xf0ab('0xa')](_0x3be05e+':'+_0x2efe43['id'],_0x2efe43);SmsInteractionEvents['emit'](_0x3be05e,_0x2efe43);_0x2ab7d6(null);})[_0xf0ab('0xb')](_0x2ab7d6(null));};}for(var e in events){if(events[_0xf0ab('0xc')](e)){var event=events[e];SmsInteraction[_0xf0ab('0xd')](e,emitEvent(event));}}module[_0xf0ab('0xe')]=SmsInteractionEvents;
\ No newline at end of file
index fcf136f..5b6a8a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcab7=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','request-promise','path','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','closed','closedAt'];(function(_0x5b4d46,_0x4b9cdd){var _0x299a56=function(_0x5adf89){while(--_0x5adf89){_0x5b4d46['push'](_0x5b4d46['shift']());}};_0x299a56(++_0x4b9cdd);}(_0xcab7,0x1d2));var _0x7cab=function(_0x2a8d0f,_0x42983b){_0x2a8d0f=_0x2a8d0f-0x0;var _0xf4cc50=_0xcab7[_0x2a8d0f];return _0xf4cc50;};'use strict';var _=require(_0x7cab('0x0'));var util=require(_0x7cab('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7cab('0x2'));var BPromise=require(_0x7cab('0x3'));var rp=require(_0x7cab('0x4'));var fs=require('fs');var path=require(_0x7cab('0x5'));var rimraf=require(_0x7cab('0x6'));var config=require('../../config/environment');var attributes=require(_0x7cab('0x7'));module[_0x7cab('0x8')]=function(_0x1473bc,_0xf8d7af){return _0x1473bc[_0x7cab('0x9')](_0x7cab('0xa'),attributes,{'tableName':_0x7cab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x379b52,_0x2ff770,_0x42e52a){if(_0x379b52['changed'](_0x7cab('0xc'))){_0x379b52[_0x7cab('0xd')]=moment()['format'](_0x7cab('0xe'));}_0x42e52a(null,_0x379b52);}}});};
\ No newline at end of file
+var _0x304a=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x304a,0x134));var _0xa304=function(_0x2a0137,_0x3a433f){_0x2a0137=_0x2a0137-0x0;var _0x5942f6=_0x304a[_0x2a0137];return _0x5942f6;};'use strict';var _=require(_0xa304('0x0'));var util=require(_0xa304('0x1'));var logger=require(_0xa304('0x2'))(_0xa304('0x3'));var moment=require(_0xa304('0x4'));var BPromise=require('bluebird');var rp=require(_0xa304('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa304('0x6'));var config=require(_0xa304('0x7'));var attributes=require(_0xa304('0x8'));module['exports']=function(_0x3c9568,_0x58fd65){return _0x3c9568[_0xa304('0x9')](_0xa304('0xa'),attributes,{'tableName':_0xa304('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x12d653,_0x549b64,_0x385dae){if(_0x12d653['changed'](_0xa304('0xc'))){_0x12d653[_0xa304('0xd')]=moment()[_0xa304('0xe')](_0xa304('0xf'));}_0x385dae(null,_0x12d653);}}});};
\ No newline at end of file
index b295018..4e07227 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b6f=['message','info','SmsInteraction','update','body','options','limit','then','UpdateSmsInteraction','catch','where','addTags','ids','omit','AddTags','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x43940f,_0x54ec71){var _0x53d4e3=function(_0x123fa0){while(--_0x123fa0){_0x43940f['push'](_0x43940f['shift']());}};_0x53d4e3(++_0x54ec71);}(_0x2b6f,0x1a7));var _0xf2b6=function(_0x173452,_0x3aa870){_0x173452=_0x173452-0x0;var _0xee3fd0=_0x2b6f[_0x173452];return _0xee3fd0;};'use strict';var _=require(_0xf2b6('0x0'));var util=require(_0xf2b6('0x1'));var moment=require(_0xf2b6('0x2'));var BPromise=require(_0xf2b6('0x3'));var rs=require(_0xf2b6('0x4'));var fs=require('fs');var Redis=require(_0xf2b6('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf2b6('0x6'))('rpc');var config=require(_0xf2b6('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf2b6('0x8')]({'port':0x232a});config[_0xf2b6('0x9')]=_[_0xf2b6('0xa')](config[_0xf2b6('0x9')],{'host':_0xf2b6('0xb'),'port':0x18eb});var socket=require(_0xf2b6('0xc'))(new Redis(config[_0xf2b6('0x9')]));require(_0xf2b6('0xd'))[_0xf2b6('0xe')](socket);function respondWithRpcPromise(_0xaa4068,_0x3374f0,_0x4dfa92){return new BPromise(function(_0x4889be,_0x3a3c6a){return client[_0xf2b6('0xf')](_0xaa4068,_0x4dfa92)['then'](function(_0x28edcc){logger['info'](_0xf2b6('0x10'),_0x3374f0,_0xf2b6('0x11'));logger[_0xf2b6('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x3374f0,'request\x20sent',JSON['stringify'](_0x28edcc));if(_0x28edcc[_0xf2b6('0x13')]){if(_0x28edcc[_0xf2b6('0x13')][_0xf2b6('0x14')]===0x1f4){logger[_0xf2b6('0x13')](_0xf2b6('0x10'),_0x3374f0,_0x28edcc[_0xf2b6('0x13')][_0xf2b6('0x15')]);return _0x3a3c6a(_0x28edcc['error'][_0xf2b6('0x15')]);}logger[_0xf2b6('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x3374f0,_0x28edcc[_0xf2b6('0x13')][_0xf2b6('0x15')]);return _0x4889be(_0x28edcc[_0xf2b6('0x13')][_0xf2b6('0x15')]);}else{logger[_0xf2b6('0x16')](_0xf2b6('0x10'),_0x3374f0,_0xf2b6('0x11'));_0x4889be(_0x28edcc['result']['message']);}})['catch'](function(_0xdcc673){logger[_0xf2b6('0x13')](_0xf2b6('0x10'),_0x3374f0,_0xdcc673);_0x3a3c6a(_0xdcc673);});});}exports['UpdateSmsInteraction']=function(_0x48e338){var _0x48bc7f=this;return new Promise(function(_0x4d8f7d,_0x3bffd7){return db[_0xf2b6('0x17')][_0xf2b6('0x18')](_0x48e338[_0xf2b6('0x19')],{'raw':_0x48e338[_0xf2b6('0x1a')]?_0x48e338[_0xf2b6('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48e338[_0xf2b6('0x1a')]?_0x48e338[_0xf2b6('0x1a')]['where']||null:null,'attributes':_0x48e338['options']?_0x48e338[_0xf2b6('0x1a')]['attributes']||null:null,'limit':_0x48e338['options']?_0x48e338[_0xf2b6('0x1a')][_0xf2b6('0x1b')]||null:null})[_0xf2b6('0x1c')](function(_0x222aa7){logger[_0xf2b6('0x16')](_0xf2b6('0x1d'),_0x48e338);logger[_0xf2b6('0x12')](_0xf2b6('0x1d'),_0x48e338,JSON['stringify'](_0x222aa7));_0x4d8f7d(_0x222aa7);})[_0xf2b6('0x1e')](function(_0x2fb221){logger[_0xf2b6('0x13')](_0xf2b6('0x1d'),_0x2fb221[_0xf2b6('0x15')],_0x48e338);_0x3bffd7(_0x48bc7f[_0xf2b6('0x13')](0x1f4,_0x2fb221[_0xf2b6('0x15')]));});});};exports['AddTagsToSmsInteraction']=function(_0x25c4c1){return new Promise(function(_0x17df8c,_0xde7ee2){return db['SmsInteraction']['find']({'where':_0x25c4c1[_0xf2b6('0x1a')]?_0x25c4c1['options'][_0xf2b6('0x1f')]||null:null})[_0xf2b6('0x1c')](function(_0x2263aa){if(_0x2263aa){return _0x2263aa[_0xf2b6('0x20')](_0x25c4c1[_0xf2b6('0x19')][_0xf2b6('0x21')],_[_0xf2b6('0x22')](_0x25c4c1[_0xf2b6('0x19')],[_0xf2b6('0x21'),'id'])||{});}})['spread'](function(_0x2bc0df){logger[_0xf2b6('0x16')](_0xf2b6('0x23'),_0x25c4c1);logger[_0xf2b6('0x12')](_0xf2b6('0x23'),_0x25c4c1,JSON[_0xf2b6('0x24')](_0x2bc0df));_0x17df8c(_0x2bc0df);})[_0xf2b6('0x1e')](function(_0x328ba0){logger[_0xf2b6('0x13')]('AddTags',_0x328ba0[_0xf2b6('0x15')],_0x25c4c1);_0xde7ee2(_this[_0xf2b6('0x13')](0x1f4,_0x328ba0[_0xf2b6('0x15')]));});});};
\ No newline at end of file
+var _0x4ed3=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','info','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','SmsInteraction,\x20%s,\x20%s','message','result','catch','body','options','raw','where','attributes','then','UpdateSmsInteraction','debug','stringify','SmsInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ed3,0x160));var _0x34ed=function(_0x354164,_0x4c30de){_0x354164=_0x354164-0x0;var _0x5db9a8=_0x4ed3[_0x354164];return _0x5db9a8;};'use strict';var _=require(_0x34ed('0x0'));var util=require(_0x34ed('0x1'));var moment=require(_0x34ed('0x2'));var BPromise=require(_0x34ed('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ed('0x4'));var db=require(_0x34ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x34ed('0x6'))(_0x34ed('0x7'));var config=require(_0x34ed('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x34ed('0x9')][_0x34ed('0xa')]({'port':0x232a});config[_0x34ed('0xb')]=_[_0x34ed('0xc')](config[_0x34ed('0xb')],{'host':_0x34ed('0xd'),'port':0x18eb});var socket=require(_0x34ed('0xe'))(new Redis(config[_0x34ed('0xb')]));require(_0x34ed('0xf'))[_0x34ed('0x10')](socket);function respondWithRpcPromise(_0x4af1b5,_0x26113a,_0x16b23a){return new BPromise(function(_0x5161cf,_0x2c108a){return client['request'](_0x4af1b5,_0x16b23a)['then'](function(_0x5e2d83){logger[_0x34ed('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x26113a,'request\x20sent');logger['debug'](_0x34ed('0x12'),_0x26113a,_0x34ed('0x13'),JSON['stringify'](_0x5e2d83));if(_0x5e2d83[_0x34ed('0x14')]){if(_0x5e2d83[_0x34ed('0x14')]['code']===0x1f4){logger[_0x34ed('0x14')](_0x34ed('0x15'),_0x26113a,_0x5e2d83[_0x34ed('0x14')][_0x34ed('0x16')]);return _0x2c108a(_0x5e2d83[_0x34ed('0x14')]['message']);}logger[_0x34ed('0x14')](_0x34ed('0x15'),_0x26113a,_0x5e2d83['error'][_0x34ed('0x16')]);return _0x5161cf(_0x5e2d83['error'][_0x34ed('0x16')]);}else{logger['info'](_0x34ed('0x15'),_0x26113a,'request\x20sent');_0x5161cf(_0x5e2d83[_0x34ed('0x17')][_0x34ed('0x16')]);}})[_0x34ed('0x18')](function(_0x2403ee){logger['error'](_0x34ed('0x15'),_0x26113a,_0x2403ee);_0x2c108a(_0x2403ee);});});}exports['UpdateSmsInteraction']=function(_0x43e6d8){var _0x3b8a5d=this;return new Promise(function(_0x2111ee,_0x5d7d33){return db['SmsInteraction']['update'](_0x43e6d8[_0x34ed('0x19')],{'raw':_0x43e6d8[_0x34ed('0x1a')]?_0x43e6d8[_0x34ed('0x1a')][_0x34ed('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43e6d8[_0x34ed('0x1a')]?_0x43e6d8['options'][_0x34ed('0x1c')]||null:null,'attributes':_0x43e6d8[_0x34ed('0x1a')]?_0x43e6d8[_0x34ed('0x1a')][_0x34ed('0x1d')]||null:null,'limit':_0x43e6d8[_0x34ed('0x1a')]?_0x43e6d8[_0x34ed('0x1a')]['limit']||null:null})[_0x34ed('0x1e')](function(_0x458343){logger['info'](_0x34ed('0x1f'),_0x43e6d8);logger[_0x34ed('0x20')](_0x34ed('0x1f'),_0x43e6d8,JSON[_0x34ed('0x21')](_0x458343));_0x2111ee(_0x458343);})[_0x34ed('0x18')](function(_0x1f7940){logger[_0x34ed('0x14')]('UpdateSmsInteraction',_0x1f7940[_0x34ed('0x16')],_0x43e6d8);_0x5d7d33(_0x3b8a5d[_0x34ed('0x14')](0x1f4,_0x1f7940[_0x34ed('0x16')]));});});};exports['AddTagsToSmsInteraction']=function(_0x57004c){return new Promise(function(_0x4b992b,_0x274fd0){return db[_0x34ed('0x22')]['find']({'where':_0x57004c[_0x34ed('0x1a')]?_0x57004c[_0x34ed('0x1a')][_0x34ed('0x1c')]||null:null})['then'](function(_0x471bd8){if(_0x471bd8){return _0x471bd8[_0x34ed('0x23')](_0x57004c[_0x34ed('0x19')][_0x34ed('0x24')],_[_0x34ed('0x25')](_0x57004c[_0x34ed('0x19')],[_0x34ed('0x24'),'id'])||{});}})[_0x34ed('0x26')](function(_0x1236d6){logger[_0x34ed('0x11')]('AddTags',_0x57004c);logger[_0x34ed('0x20')](_0x34ed('0x27'),_0x57004c,JSON[_0x34ed('0x21')](_0x1236d6));_0x4b992b(_0x1236d6);})[_0x34ed('0x18')](function(_0x533a39){logger[_0x34ed('0x14')](_0x34ed('0x27'),_0x533a39[_0x34ed('0x16')],_0x57004c);_0x274fd0(_this['error'](0x1f4,_0x533a39[_0x34ed('0x16')]));});});};
\ No newline at end of file
index f957317..260331e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2689=['removeListener','smsInteraction:','./smsInteraction.events','save','emit'];(function(_0x3bd52b,_0xbbc735){var _0x1e5b89=function(_0x29ccc3){while(--_0x29ccc3){_0x3bd52b['push'](_0x3bd52b['shift']());}};_0x1e5b89(++_0xbbc735);}(_0x2689,0xe8));var _0x9268=function(_0x5126c8,_0x104925){_0x5126c8=_0x5126c8-0x0;var _0x32bc5b=_0x2689[_0x5126c8];return _0x32bc5b;};'use strict';var SmsInteractionEvents=require(_0x9268('0x0'));var events=[_0x9268('0x1'),'remove','update'];function createListener(_0x1fc40a,_0x5b5c2c){return function(_0x4edc28){_0x5b5c2c[_0x9268('0x2')](_0x1fc40a,_0x4edc28);};}function removeListener(_0x724a7c,_0x133185){return function(){SmsInteractionEvents[_0x9268('0x3')](_0x724a7c,_0x133185);};}exports['register']=function(_0x131a1c){for(var _0x539e43=0x0,_0x1d26b5=events['length'];_0x539e43<_0x1d26b5;_0x539e43++){var _0x283d6a=events[_0x539e43];var _0x5d521d=createListener(_0x9268('0x4')+_0x283d6a,_0x131a1c);SmsInteractionEvents['on'](_0x283d6a,_0x5d521d);}};
\ No newline at end of file
+var _0x96fb=['update','removeListener','register','smsInteraction:','./smsInteraction.events','save','remove'];(function(_0x4394bc,_0x5d4a96){var _0x3feb79=function(_0x3a4344){while(--_0x3a4344){_0x4394bc['push'](_0x4394bc['shift']());}};_0x3feb79(++_0x5d4a96);}(_0x96fb,0x19a));var _0xb96f=function(_0x28c009,_0x5a96eb){_0x28c009=_0x28c009-0x0;var _0x54629c=_0x96fb[_0x28c009];return _0x54629c;};'use strict';var SmsInteractionEvents=require(_0xb96f('0x0'));var events=[_0xb96f('0x1'),_0xb96f('0x2'),_0xb96f('0x3')];function createListener(_0x392f04,_0x33a3f4){return function(_0x3cb9c7){_0x33a3f4['emit'](_0x392f04,_0x3cb9c7);};}function removeListener(_0xfc61b8,_0x3a639d){return function(){SmsInteractionEvents[_0xb96f('0x4')](_0xfc61b8,_0x3a639d);};}exports[_0xb96f('0x5')]=function(_0x100454){for(var _0x10e62b=0x0,_0x3c212e=events['length'];_0x10e62b<_0x3c212e;_0x10e62b++){var _0x22d2a2=events[_0x10e62b];var _0x1946bb=createListener(_0xb96f('0x6')+_0x22d2a2,_0x100454);SmsInteractionEvents['on'](_0x22d2a2,_0x1946bb);}};
\ No newline at end of file
index e179d2c..035d633 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a4d=['isAuthenticated','index','get','/describe','describe','/:id','show','sms','smsmessage:create','create','post','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller'];(function(_0x4a4139,_0xd79d9b){var _0x5b827b=function(_0x58af84){while(--_0x58af84){_0x4a4139['push'](_0x4a4139['shift']());}};_0x5b827b(++_0xd79d9b);}(_0x1a4d,0x189));var _0xd1a4=function(_0x83b866,_0x535ce1){_0x83b866=_0x83b866-0x0;var _0x4dd857=_0x1a4d[_0x83b866];return _0x4dd857;};'use strict';var multer=require(_0xd1a4('0x0'));var util=require(_0xd1a4('0x1'));var path=require('path');var timeout=require(_0xd1a4('0x2'));var express=require(_0xd1a4('0x3'));var router=express[_0xd1a4('0x4')]();var fs_extra=require(_0xd1a4('0x5'));var auth=require(_0xd1a4('0x6'));var interaction=require(_0xd1a4('0x7'));var config=require(_0xd1a4('0x8'));var controller=require(_0xd1a4('0x9'));router['get']('/',auth[_0xd1a4('0xa')](),controller[_0xd1a4('0xb')]);router[_0xd1a4('0xc')](_0xd1a4('0xd'),auth[_0xd1a4('0xa')](),controller[_0xd1a4('0xe')]);router[_0xd1a4('0xc')](_0xd1a4('0xf'),auth[_0xd1a4('0xa')](),controller[_0xd1a4('0x10')]);router['post']('/',auth[_0xd1a4('0xa')](),interaction['tracked'](_0xd1a4('0x11'),_0xd1a4('0x12')),controller[_0xd1a4('0x13')]);router[_0xd1a4('0x14')](_0xd1a4('0x15'),controller[_0xd1a4('0x16')]);router[_0xd1a4('0x17')](_0xd1a4('0xf'),auth[_0xd1a4('0xa')](),controller[_0xd1a4('0x18')]);router['put'](_0xd1a4('0x19'),auth['isAuthenticated'](),controller[_0xd1a4('0x1a')]);router[_0xd1a4('0x17')](_0xd1a4('0x1b'),auth['isAuthenticated'](),controller[_0xd1a4('0x1c')]);router[_0xd1a4('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0xd1a4('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0xd679=['/:id/status','status','put','update','/:id/accept','/:id/reject','reject','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','smsmessage:create','create'];(function(_0x2cb4af,_0x2e32db){var _0x45023b=function(_0x8f02b4){while(--_0x8f02b4){_0x2cb4af['push'](_0x2cb4af['shift']());}};_0x45023b(++_0x2e32db);}(_0xd679,0xcc));var _0x9d67=function(_0x11854c,_0xfc540b){_0x11854c=_0x11854c-0x0;var _0x1ee11f=_0xd679[_0x11854c];return _0x1ee11f;};'use strict';var multer=require('multer');var util=require(_0x9d67('0x0'));var path=require(_0x9d67('0x1'));var timeout=require(_0x9d67('0x2'));var express=require(_0x9d67('0x3'));var router=express[_0x9d67('0x4')]();var fs_extra=require(_0x9d67('0x5'));var auth=require(_0x9d67('0x6'));var interaction=require(_0x9d67('0x7'));var config=require(_0x9d67('0x8'));var controller=require(_0x9d67('0x9'));router[_0x9d67('0xa')]('/',auth['isAuthenticated'](),controller[_0x9d67('0xb')]);router['get'](_0x9d67('0xc'),auth[_0x9d67('0xd')](),controller[_0x9d67('0xe')]);router['get'](_0x9d67('0xf'),auth[_0x9d67('0xd')](),controller[_0x9d67('0x10')]);router[_0x9d67('0x11')]('/',auth['isAuthenticated'](),interaction['tracked']('sms',_0x9d67('0x12')),controller[_0x9d67('0x13')]);router[_0x9d67('0x11')](_0x9d67('0x14'),controller[_0x9d67('0x15')]);router[_0x9d67('0x16')](_0x9d67('0xf'),auth[_0x9d67('0xd')](),controller[_0x9d67('0x17')]);router[_0x9d67('0x16')](_0x9d67('0x18'),auth[_0x9d67('0xd')](),controller['accept']);router[_0x9d67('0x16')](_0x9d67('0x19'),auth['isAuthenticated'](),controller[_0x9d67('0x1a')]);router[_0x9d67('0x1b')](_0x9d67('0xf'),auth[_0x9d67('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 812aa83..d14c894 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe59a=['TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x27246a,_0x43d9d8){var _0x486772=function(_0x71c164){while(--_0x71c164){_0x27246a['push'](_0x27246a['shift']());}};_0x486772(++_0x43d9d8);}(_0xe59a,0x19f));var _0xae59=function(_0x4ed824,_0x21747e){_0x4ed824=_0x4ed824-0x0;var _0x5c4c70=_0xe59a[_0x4ed824];return _0x5c4c70;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xae59('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xae59('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xae59('0x2')]('in','out'),'defaultValue':_0xae59('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xae59('0x4')](0xbe)},'phone':{'type':Sequelize[_0xae59('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xae59('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xae59('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x0a16=['TEXT','medium','BOOLEAN','out','STRING','DATE','sequelize','exports'];(function(_0x5bef3b,_0x404690){var _0x3b9d91=function(_0x36986a){while(--_0x36986a){_0x5bef3b['push'](_0x5bef3b['shift']());}};_0x3b9d91(++_0x404690);}(_0x0a16,0x10e));var _0x60a1=function(_0x224090,_0x38f7e4){_0x224090=_0x224090-0x0;var _0xd97361=_0x0a16[_0x224090];return _0xd97361;};'use strict';var Sequelize=require(_0x60a1('0x0'));module[_0x60a1('0x1')]={'body':{'type':Sequelize[_0x60a1('0x2')](_0x60a1('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x60a1('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x60a1('0x5')),'defaultValue':_0x60a1('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x60a1('0x6')](0xbe)},'phone':{'type':Sequelize[_0x60a1('0x6')]},'readAt':{'type':Sequelize[_0x60a1('0x7')]},'secret':{'type':Sequelize[_0x60a1('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x60a1('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 415d696..0571594 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x184d=['event','EventManager','acceptmessage','../../config/logger','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','QueryTypes','interface','motionChannel','rejectmessage','received\x20delivery\x20report\x20from','MessageSid','plivo','MessageUUID','messageId','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','inspect','infobip','results','groupName','DELIVERED','rimraf','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','SmsMessage','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','show','params','rawAttributes','options','find','catch','create','body','destroy','describe','sms-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','read1stAt','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','contact','User','fullname','email','manual','SIP/%s','channel'];(function(_0x48669c,_0x511b21){var _0x5eb680=function(_0x29c287){while(--_0x29c287){_0x48669c['push'](_0x48669c['shift']());}};_0x5eb680(++_0x511b21);}(_0x184d,0x1d0));var _0xd184=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x184d[_0x2adbeb];return _0x5e18a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd184('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd184('0x1'));var Mustache=require(_0xd184('0x2'));var util=require(_0xd184('0x3'));var path=require(_0xd184('0x4'));var sox=require(_0xd184('0x5'));var csv=require(_0xd184('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd184('0x7'));var crypto=require(_0xd184('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xd184('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd184('0xa'));var Redis=require(_0xd184('0xb'));var authService=require(_0xd184('0xc'));var qs=require(_0xd184('0xd'));var as=require(_0xd184('0xe'));var hardwareService=require(_0xd184('0xf'));var logger=require('../../config/logger')(_0xd184('0x10'));var utils=require(_0xd184('0x11'));var config=require(_0xd184('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xd184('0x13'))['db'];config['redis']=_[_0xd184('0x14')](config[_0xd184('0x15')],{'host':_0xd184('0x16'),'port':0x18eb});var socket=require(_0xd184('0x17'))(new Redis(config[_0xd184('0x15')]));require(_0xd184('0x18'))['register'](socket);var jayson=require(_0xd184('0x19'));var client=jayson[_0xd184('0x1a')][_0xd184('0x1b')]({'port':0x232c});var client9002=jayson[_0xd184('0x1a')][_0xd184('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x316f4a,_0x3fe670,_0x296db8,_0x28447b){return new BPromise(function(_0xf68691,_0x58560a){var _0x48203f=_0x28447b||client;return _0x48203f['request'](_0x316f4a,_0x296db8)[_0xd184('0x1c')](function(_0x43cd89){logger[_0xd184('0x1d')](_0xd184('0x1e'),_0x3fe670,_0xd184('0x1f'));logger[_0xd184('0x20')](_0xd184('0x21'),_0x3fe670,'request\x20sent',JSON[_0xd184('0x22')](_0x43cd89));if(_0x43cd89[_0xd184('0x23')]){if(_0x43cd89[_0xd184('0x23')][_0xd184('0x24')]===0x1f4){logger[_0xd184('0x23')](_0xd184('0x1e'),_0x3fe670,_0x43cd89['error'][_0xd184('0x25')]);return _0x58560a(_0x43cd89['error'][_0xd184('0x25')]);}logger[_0xd184('0x23')](_0xd184('0x1e'),_0x3fe670,_0x43cd89[_0xd184('0x23')][_0xd184('0x25')]);return _0xf68691(_0x43cd89[_0xd184('0x23')]['message']);}else{logger['info'](_0xd184('0x1e'),_0x3fe670,'request\x20sent');_0xf68691(_0x43cd89['result'][_0xd184('0x25')]);}})['catch'](function(_0x5ae859){logger[_0xd184('0x23')](_0xd184('0x1e'),_0x3fe670,_0x5ae859);_0x58560a(_0x5ae859);});});}function respondWithStatusCode(_0x4decc0,_0x74a77a){_0x74a77a=_0x74a77a||0xcc;return function(_0x49019f){if(_0x49019f){return _0x4decc0[_0xd184('0x26')](_0x74a77a);}return _0x4decc0[_0xd184('0x27')](_0x74a77a)[_0xd184('0x28')]();};}function respondWithResult(_0x1f8c99,_0x116254){_0x116254=_0x116254||0xc8;return function(_0x419dc3){if(_0x419dc3){return _0x1f8c99[_0xd184('0x27')](_0x116254)[_0xd184('0x29')](_0x419dc3);}};}function respondWithFilteredResult(_0x540b6d,_0x41017e){return function(_0x5a9390){if(_0x5a9390){var _0x253ce2=typeof _0x41017e[_0xd184('0x2a')]==='undefined'&&typeof _0x41017e[_0xd184('0x2b')]===_0xd184('0x2c');var _0x3dbdb7=_0x5a9390[_0xd184('0x2d')];var _0x202dd0=_0x253ce2?0x0:_0x41017e['offset'];var _0x3e37e7=_0x253ce2?_0x5a9390[_0xd184('0x2d')]:_0x41017e['offset']+_0x41017e[_0xd184('0x2b')];var _0x248832;if(_0x3e37e7>=_0x3dbdb7){_0x3e37e7=_0x3dbdb7;_0x248832=0xc8;}else{_0x248832=0xce;}_0x540b6d[_0xd184('0x27')](_0x248832);return _0x540b6d[_0xd184('0x2e')](_0xd184('0x2f'),_0x202dd0+'-'+_0x3e37e7+'/'+_0x3dbdb7)[_0xd184('0x29')](_0x5a9390);}return null;};}function patchUpdates(_0x2ed7b8){return function(_0x28bd1a){try{jsonpatch[_0xd184('0x30')](_0x28bd1a,_0x2ed7b8,!![]);}catch(_0x22668d){return BPromise[_0xd184('0x31')](_0x22668d);}return _0x28bd1a[_0xd184('0x32')]();};}function saveUpdates(_0x10d929,_0x5ed63c){return function(_0x5aa26f){if(_0x5aa26f){return _0x5aa26f[_0xd184('0x33')](_0x10d929)[_0xd184('0x1c')](function(_0x25017f){return _0x25017f;});}return null;};}function removeEntity(_0x292741,_0x3296b5){return function(_0x359375){if(_0x359375){return _0x359375['destroy']()[_0xd184('0x1c')](function(){_0x292741['status'](0xcc)[_0xd184('0x28')]();});}};}function handleEntityNotFound(_0x48100e,_0x45d9ca){return function(_0x2b1437){if(!_0x2b1437){_0x48100e['sendStatus'](0x194);}return _0x2b1437;};}function handleError(_0x1ec758,_0x3fedf2){_0x3fedf2=_0x3fedf2||0x1f4;return function(_0x407e47){logger[_0xd184('0x23')](_0x407e47[_0xd184('0x34')]);if(_0x407e47[_0xd184('0x35')]){delete _0x407e47['name'];}_0x1ec758['status'](_0x3fedf2)[_0xd184('0x36')](_0x407e47);};}exports[_0xd184('0x37')]=function(_0x4821e9,_0x1c01bd){var _0x262aa5={},_0x18eab9={},_0x3034d0={'count':0x0,'rows':[]};var _0x5989ee=_[_0xd184('0x38')](db[_0xd184('0x39')]['rawAttributes'],function(_0x3f72fa){return{'name':_0x3f72fa['fieldName'],'type':_0x3f72fa[_0xd184('0x3a')][_0xd184('0x3b')]};});_0x18eab9['model']=_[_0xd184('0x38')](_0x5989ee,_0xd184('0x35'));_0x18eab9[_0xd184('0x3c')]=_[_0xd184('0x3d')](_0x4821e9['query']);_0x18eab9[_0xd184('0x3e')]=_['intersection'](_0x18eab9[_0xd184('0x3f')],_0x18eab9['query']);_0x262aa5[_0xd184('0x40')]=_[_0xd184('0x41')](_0x18eab9[_0xd184('0x3f')],qs[_0xd184('0x42')](_0x4821e9[_0xd184('0x3c')][_0xd184('0x42')]));_0x262aa5['attributes']=_0x262aa5[_0xd184('0x40')][_0xd184('0x43')]?_0x262aa5[_0xd184('0x40')]:_0x18eab9[_0xd184('0x3f')];if(!_0x4821e9['query'][_0xd184('0x44')]('nolimit')){_0x262aa5[_0xd184('0x2b')]=qs[_0xd184('0x2b')](_0x4821e9[_0xd184('0x3c')][_0xd184('0x2b')]);_0x262aa5[_0xd184('0x2a')]=qs[_0xd184('0x2a')](_0x4821e9[_0xd184('0x3c')][_0xd184('0x2a')]);}_0x262aa5['order']=qs[_0xd184('0x45')](_0x4821e9[_0xd184('0x3c')][_0xd184('0x45')]);_0x262aa5[_0xd184('0x46')]=qs['filters'](_[_0xd184('0x47')](_0x4821e9['query'],_0x18eab9['filters']),_0x5989ee);if(_0x4821e9[_0xd184('0x3c')]['filter']){_0x262aa5['where']=_[_0xd184('0x48')](_0x262aa5[_0xd184('0x46')],{'$or':_[_0xd184('0x38')](_0x5989ee,function(_0x12998e){if(_0x12998e[_0xd184('0x3a')]!==_0xd184('0x49')){var _0x33e8e3={};_0x33e8e3[_0x12998e[_0xd184('0x35')]]={'$like':'%'+_0x4821e9[_0xd184('0x3c')][_0xd184('0x4a')]+'%'};return _0x33e8e3;}})});}_0x262aa5=_[_0xd184('0x48')]({},_0x262aa5,_0x4821e9['options']);var _0x3b4f31={'where':_0x262aa5[_0xd184('0x46')]};return db['SmsMessage']['count'](_0x3b4f31)[_0xd184('0x1c')](function(_0x1eabc9){_0x3034d0[_0xd184('0x2d')]=_0x1eabc9;if(_0x4821e9[_0xd184('0x3c')][_0xd184('0x4b')]){_0x262aa5[_0xd184('0x4c')]=[{'all':!![]}];}return db[_0xd184('0x39')]['findAll'](_0x262aa5);})['then'](function(_0x2f8880){_0x3034d0[_0xd184('0x4d')]=_0x2f8880;return _0x3034d0;})[_0xd184('0x1c')](respondWithFilteredResult(_0x1c01bd,_0x262aa5))['catch'](handleError(_0x1c01bd,null));};exports[_0xd184('0x4e')]=function(_0x3d335f,_0x9d239){var _0x1b16bd={'raw':!![],'where':{'id':_0x3d335f[_0xd184('0x4f')]['id']}},_0xfdfd5e={};_0xfdfd5e['model']=_['keys'](db[_0xd184('0x39')][_0xd184('0x50')]);_0xfdfd5e['query']=_[_0xd184('0x3d')](_0x3d335f['query']);_0xfdfd5e[_0xd184('0x3e')]=_[_0xd184('0x41')](_0xfdfd5e[_0xd184('0x3f')],_0xfdfd5e[_0xd184('0x3c')]);_0x1b16bd['attributes']=_['intersection'](_0xfdfd5e[_0xd184('0x3f')],qs[_0xd184('0x42')](_0x3d335f[_0xd184('0x3c')]['fields']));_0x1b16bd['attributes']=_0x1b16bd['attributes'][_0xd184('0x43')]?_0x1b16bd[_0xd184('0x40')]:_0xfdfd5e[_0xd184('0x3f')];if(_0x3d335f[_0xd184('0x3c')][_0xd184('0x4b')]){_0x1b16bd['include']=[{'all':!![]}];}_0x1b16bd=_[_0xd184('0x48')]({},_0x1b16bd,_0x3d335f[_0xd184('0x51')]);return db['SmsMessage'][_0xd184('0x52')](_0x1b16bd)[_0xd184('0x1c')](handleEntityNotFound(_0x9d239,null))[_0xd184('0x1c')](respondWithResult(_0x9d239,null))[_0xd184('0x53')](handleError(_0x9d239,null));};exports[_0xd184('0x54')]=function(_0x4e6c8e,_0x5adff3){return db[_0xd184('0x39')][_0xd184('0x54')](_0x4e6c8e[_0xd184('0x55')],{})[_0xd184('0x1c')](respondWithResult(_0x5adff3,0xc9))[_0xd184('0x53')](handleError(_0x5adff3,null));};exports['update']=function(_0x1c4294,_0x14b456){if(_0x1c4294[_0xd184('0x55')]['id']){delete _0x1c4294[_0xd184('0x55')]['id'];}return db[_0xd184('0x39')]['find']({'where':{'id':_0x1c4294[_0xd184('0x4f')]['id']}})['then'](handleEntityNotFound(_0x14b456,null))['then'](saveUpdates(_0x1c4294['body'],null))[_0xd184('0x1c')](respondWithResult(_0x14b456,null))[_0xd184('0x53')](handleError(_0x14b456,null));};exports[_0xd184('0x56')]=function(_0x33a8cc,_0x9a38b6){return db[_0xd184('0x39')][_0xd184('0x52')]({'where':{'id':_0x33a8cc['params']['id']}})[_0xd184('0x1c')](handleEntityNotFound(_0x9a38b6,null))[_0xd184('0x1c')](removeEntity(_0x9a38b6,null))[_0xd184('0x53')](handleError(_0x9a38b6,null));};exports['describe']=function(_0x6c4d4b,_0x269075){return db[_0xd184('0x39')][_0xd184('0x57')]()[_0xd184('0x1c')](respondWithResult(_0x269075,null))[_0xd184('0x53')](handleError(_0x269075,null));};var interaction_log=require('../../config/logger')(_0xd184('0x58'));exports[_0xd184('0x59')]=function(_0x339b91,_0x5612ce,_0x1e9181){var _0x166179={'agent':{},'channel':'sms'};if(_0x339b91[_0xd184('0x55')]['id']){delete _0x339b91[_0xd184('0x55')]['id'];}_0x339b91['body'][_0xd184('0x5a')]=!![];_0x339b91[_0xd184('0x55')]['readAt']=moment()[_0xd184('0x5b')](_0xd184('0x5c'));_0x339b91[_0xd184('0x55')][_0xd184('0x5d')]=_0x339b91[_0xd184('0x55')]['UserId']||_0x339b91[_0xd184('0x5e')]['id'];_0x166179[_0xd184('0x5f')]['id']=_0x339b91['body']['UserId'];return db['SmsMessage'][_0xd184('0x52')]({'where':{'id':_0x339b91['params']['id'],'UserId':null}})[_0xd184('0x1c')](handleEntityNotFound(_0x5612ce,null))[_0xd184('0x1c')](saveUpdates(_0x339b91['body'],null))['then'](function(_0x291900){if(_0x291900){_0x166179[_0xd184('0x25')]=_0x291900['get']({'plain':!![]});return db[_0xd184('0x60')][_0xd184('0x52')]({'where':{'id':_0x291900[_0xd184('0x61')]}});}return null;})[_0xd184('0x1c')](handleEntityNotFound(_0x5612ce,null))['then'](function(_0x49cf06){if(_0x49cf06){return _0x49cf06['update']({'UserId':_0x339b91['body'][_0xd184('0x5d')],'read1stAt':_['isNil'](_0x49cf06[_0xd184('0x62')])?moment()[_0xd184('0x5b')](_0xd184('0x5c')):undefined});}return null;})[_0xd184('0x1c')](function(_0x27b687){if(_0x27b687){_0x166179[_0xd184('0x63')]=_0x27b687[_0xd184('0x64')]({'plain':!![]});interaction_log['info'](_0xd184('0x65'),_0x339b91[_0xd184('0x5e')]['id'],_0x339b91[_0xd184('0x5e')][_0xd184('0x35')],_0x339b91[_0xd184('0x5e')][_0xd184('0x66')],_0x166179[_0xd184('0x63')]['id'],_0x339b91['body']?JSON[_0xd184('0x22')](_0x339b91['body']):_0xd184('0x67'));return respondWithRpcPromise(_0xd184('0x68'),_0xd184('0x69'),_0x166179);}return null;})[_0xd184('0x1c')](function(_0x30af91){var _0x2ea296=_0xd184('0x6a')+_0x30af91[_0xd184('0x25')]['ContactId'];return db[_0xd184('0x6b')][_0xd184('0x3c')](_0x2ea296,{'type':db[_0xd184('0x6c')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x266a66){return _0x266a66;});})[_0xd184('0x1c')](function(_0x31da6f){if(_0x31da6f){_0x166179[_0xd184('0x25')][_0xd184('0x6d')]=_0x31da6f[0x0];if(!_0x339b91[_0xd184('0x55')]['UserId'])return;return db[_0xd184('0x6e')][_0xd184('0x52')]({'where':{'id':_0x339b91[_0xd184('0x55')][_0xd184('0x5d')],'role':_0xd184('0x5f')},'attributes':['id',_0xd184('0x35'),_0xd184('0x6f'),_0xd184('0x70'),'internal'],'raw':!![]});}return null;})[_0xd184('0x1c')](function(_0x45966e){if(!_0x45966e)return null;_0x166179['message'][_0xd184('0x5f')]=_0x45966e;return _0x166179;})[_0xd184('0x1c')](function(_0x3d78ca){if(_0x3d78ca){if(_0x339b91[_0xd184('0x55')][_0xd184('0x71')]){_0x166179['message']['interface']=util[_0xd184('0x5b')](_0xd184('0x72'),_0x339b91[_0xd184('0x5e')][_0xd184('0x35')]);_0x166179[_0xd184('0x25')][_0xd184('0x73')]=_0x166179[_0xd184('0x73')];_0x166179[_0xd184('0x25')]['motionChannel']=_0x166179[_0xd184('0x73')];_0x166179['message'][_0xd184('0x74')]=_0xd184('0x59');return respondWithRpcPromise(_0xd184('0x75'),'EventManager',{'event':_0xd184('0x76'),'message':_0x166179[_0xd184('0x25')]},client9002)[_0xd184('0x1c')](function(){return _0x166179;});}return _0x166179;}return null;})[_0xd184('0x1c')](respondWithResult(_0x5612ce,null))[_0xd184('0x53')](handleError(_0x5612ce,null));};var interaction_log=require(_0xd184('0x77'))('sms-interactions');exports[_0xd184('0x31')]=function(_0x2df80d,_0x219267,_0x4a5d12){var _0x4588c3={'agent':{},'channel':_0xd184('0x78')};if(_0x2df80d[_0xd184('0x55')]['id']){delete _0x2df80d[_0xd184('0x55')]['id'];}_0x2df80d[_0xd184('0x55')][_0xd184('0x5d')]=_0x2df80d['body'][_0xd184('0x5d')]||_0x2df80d['user']['id'];_0x4588c3[_0xd184('0x5f')]['id']=_0x2df80d[_0xd184('0x55')][_0xd184('0x5d')];return db[_0xd184('0x39')]['find']({'where':{'id':_0x2df80d[_0xd184('0x4f')]['id'],'UserId':null}})[_0xd184('0x1c')](handleEntityNotFound(_0x219267,null))[_0xd184('0x1c')](function(_0x3b6c59){if(_0x3b6c59){_0x4588c3[_0xd184('0x25')]=_0x3b6c59[_0xd184('0x64')]({'plain':!![]});return db[_0xd184('0x60')][_0xd184('0x52')]({'where':{'id':_0x3b6c59[_0xd184('0x61')]}});}return null;})[_0xd184('0x1c')](handleEntityNotFound(_0x219267,null))[_0xd184('0x1c')](function(_0x363b42){if(_0x363b42){_0x4588c3['interaction']=_0x363b42['get']({'plain':!![]});interaction_log[_0xd184('0x1d')](_0xd184('0x79'),_0x2df80d[_0xd184('0x5e')]['id'],_0x2df80d[_0xd184('0x5e')][_0xd184('0x35')],_0x2df80d[_0xd184('0x5e')][_0xd184('0x66')],_0x4588c3['interaction']['id'],_0x2df80d[_0xd184('0x55')]?JSON[_0xd184('0x22')](_0x2df80d['body']):_0xd184('0x67'));return respondWithRpcPromise(_0xd184('0x7a'),_0xd184('0x7b'),_0x4588c3);}return null;})[_0xd184('0x1c')](function(_0x5115f3){var _0x1aef44=_0xd184('0x6a')+_0x5115f3['message'][_0xd184('0x7c')];return db['sequelize'][_0xd184('0x3c')](_0x1aef44,{'type':db[_0xd184('0x6c')][_0xd184('0x7d')]['SELECT'],'raw':!![]})['then'](function(_0x409111){return _0x409111;});})[_0xd184('0x1c')](function(_0x36a0b1){if(_0x36a0b1){_0x4588c3[_0xd184('0x25')][_0xd184('0x6d')]=_0x36a0b1[0x0];if(!_0x2df80d['body'][_0xd184('0x5d')])return;return db[_0xd184('0x6e')][_0xd184('0x52')]({'where':{'id':_0x2df80d[_0xd184('0x55')]['UserId'],'role':'agent'},'attributes':['id',_0xd184('0x35'),_0xd184('0x6f'),_0xd184('0x70'),'internal'],'raw':!![]});}return null;})[_0xd184('0x1c')](function(_0x4d276a){if(!_0x4d276a)return null;_0x4588c3[_0xd184('0x25')][_0xd184('0x5f')]=_0x4d276a;return _0x4588c3;})[_0xd184('0x1c')](function(_0x72b7e7){if(_0x72b7e7){_0x72b7e7[_0xd184('0x25')][_0xd184('0x7e')]=util['format'](_0xd184('0x72'),_0x2df80d[_0xd184('0x5e')][_0xd184('0x35')]);_0x72b7e7[_0xd184('0x25')][_0xd184('0x73')]=_0x4588c3[_0xd184('0x73')];_0x72b7e7['message'][_0xd184('0x7f')]=_0x4588c3[_0xd184('0x73')];_0x72b7e7[_0xd184('0x25')][_0xd184('0x74')]=_0xd184('0x31');respondWithRpcPromise(_0xd184('0x75'),_0xd184('0x75'),{'event':_0xd184('0x80'),'message':_0x72b7e7[_0xd184('0x25')]},client9002);return _0x4588c3;}return null;})[_0xd184('0x1c')](respondWithResult(_0x219267,null))[_0xd184('0x53')](handleError(_0x219267,null));};exports[_0xd184('0x27')]=function(_0x277406,_0x19cb3f,_0x3a841d){if(_0x277406[_0xd184('0x55')]['id']){delete _0x277406[_0xd184('0x55')]['id'];}var _0x362218;return db[_0xd184('0x39')][_0xd184('0x52')]({'where':{'id':_0x277406[_0xd184('0x4f')]['id']}})['then'](handleEntityNotFound(_0x19cb3f,null))[_0xd184('0x1c')](function(_0x27a697){if(_0x27a697){_0x362218=_0x27a697;return db['SmsAccount'][_0xd184('0x52')]({'where':{'id':_0x27a697['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x19cb3f,null))['then'](function(_0x5977ba){if(_0x5977ba){logger[_0xd184('0x20')](_0xd184('0x21'),_0xd184('0x27'),_0xd184('0x81'),_0x5977ba[_0xd184('0x3a')],util['inspect'](_0x277406[_0xd184('0x55')],{'showHidden':![],'depth':null}));switch(_0x5977ba[_0xd184('0x3a')]){case'twilio':if(_0x277406['body'][_0xd184('0x82')]&&_0x277406[_0xd184('0x55')][_0xd184('0x82')]===_0x362218['messageId']){return _0x362218[_0xd184('0x33')]({'read':!![]});}else{logger[_0xd184('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','twilio',util['inspect'](_0x277406[_0xd184('0x55')],{'showHidden':![],'depth':null}));}break;case _0xd184('0x83'):if(_0x277406[_0xd184('0x55')][_0xd184('0x84')]&&_0x277406[_0xd184('0x55')][_0xd184('0x84')]===_0x362218[_0xd184('0x85')]&&_[_0xd184('0x86')]([_0xd184('0x87'),_0xd184('0x88')],_0x277406[_0xd184('0x55')][_0xd184('0x89')])>=0x0){return _0x362218[_0xd184('0x33')]({'read':!![]});}else{logger[_0xd184('0x23')](_0xd184('0x8a'),'status',_0xd184('0x8b'),util[_0xd184('0x8c')](_0x277406[_0xd184('0x55')],{'showHidden':![],'depth':null}));}break;case _0xd184('0x8d'):var _0x3a0884=_0x277406[_0xd184('0x55')][_0xd184('0x8e')][0x0];if(_0x3a0884[_0xd184('0x27')][_0xd184('0x8f')]===_0xd184('0x90')){return _0x362218[_0xd184('0x33')]({'read':!![]});}else{logger['error'](_0xd184('0x8a'),_0xd184('0x27'),'infobip',util[_0xd184('0x8c')](_0x277406[_0xd184('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x362218;}})[_0xd184('0x1c')](respondWithResult(_0x19cb3f,null))['catch'](handleError(_0x19cb3f,null));};
\ No newline at end of file
+var _0xc936=['read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','sms','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','SmsAccount','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','indexOf','delivered','Status','plivio','infobip','results','groupName','DELIVERED','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','register','client','http','then','info','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','update','stack','name','index','map','SmsMessage','fieldName','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','options','findAll','rows','params','rawAttributes','includeAll','include','find','create','body','destroy','describe','sms-interactions'];(function(_0x406696,_0x39f9b1){var _0x10e35c=function(_0x108de3){while(--_0x108de3){_0x406696['push'](_0x406696['shift']());}};_0x10e35c(++_0x39f9b1);}(_0xc936,0x153));var _0x6c93=function(_0x31b8a9,_0x2c7018){_0x31b8a9=_0x31b8a9-0x0;var _0x5ca45b=_0xc936[_0x31b8a9];return _0x5ca45b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c93('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6c93('0x1'));var rp=require(_0x6c93('0x2'));var moment=require(_0x6c93('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6c93('0x4'));var util=require(_0x6c93('0x5'));var path=require('path');var sox=require(_0x6c93('0x6'));var csv=require(_0x6c93('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c93('0x8'));var squel=require(_0x6c93('0x9'));var crypto=require(_0x6c93('0xa'));var jsforce=require(_0x6c93('0xb'));var deskjs=require(_0x6c93('0xc'));var toCsv=require(_0x6c93('0x7'));var querystring=require(_0x6c93('0xd'));var Papa=require('papaparse');var Redis=require(_0x6c93('0xe'));var authService=require(_0x6c93('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c93('0x10'));var logger=require(_0x6c93('0x11'))('api');var utils=require(_0x6c93('0x12'));var config=require(_0x6c93('0x13'));var licenseUtil=require(_0x6c93('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x6c93('0x15')](config[_0x6c93('0x16')],{'host':_0x6c93('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6c93('0x16')]));require('./smsMessage.socket')[_0x6c93('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6c93('0x19')][_0x6c93('0x1a')]({'port':0x232c});var client9002=jayson[_0x6c93('0x19')][_0x6c93('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4ba7f4,_0x539a18,_0x40f32e,_0x521195){return new BPromise(function(_0x150f36,_0x33f020){var _0x18a557=_0x521195||client;return _0x18a557['request'](_0x4ba7f4,_0x40f32e)[_0x6c93('0x1b')](function(_0x3c960c){logger[_0x6c93('0x1c')]('SmsMessage,\x20%s,\x20%s',_0x539a18,'request\x20sent');logger[_0x6c93('0x1d')](_0x6c93('0x1e'),_0x539a18,_0x6c93('0x1f'),JSON[_0x6c93('0x20')](_0x3c960c));if(_0x3c960c[_0x6c93('0x21')]){if(_0x3c960c[_0x6c93('0x21')][_0x6c93('0x22')]===0x1f4){logger[_0x6c93('0x21')](_0x6c93('0x23'),_0x539a18,_0x3c960c[_0x6c93('0x21')][_0x6c93('0x24')]);return _0x33f020(_0x3c960c[_0x6c93('0x21')]['message']);}logger[_0x6c93('0x21')]('SmsMessage,\x20%s,\x20%s',_0x539a18,_0x3c960c['error'][_0x6c93('0x24')]);return _0x150f36(_0x3c960c[_0x6c93('0x21')]['message']);}else{logger[_0x6c93('0x1c')]('SmsMessage,\x20%s,\x20%s',_0x539a18,_0x6c93('0x1f'));_0x150f36(_0x3c960c[_0x6c93('0x25')][_0x6c93('0x24')]);}})[_0x6c93('0x26')](function(_0x49f154){logger[_0x6c93('0x21')](_0x6c93('0x23'),_0x539a18,_0x49f154);_0x33f020(_0x49f154);});});}function respondWithStatusCode(_0x593d7a,_0x4290bf){_0x4290bf=_0x4290bf||0xcc;return function(_0x30882d){if(_0x30882d){return _0x593d7a[_0x6c93('0x27')](_0x4290bf);}return _0x593d7a[_0x6c93('0x28')](_0x4290bf)[_0x6c93('0x29')]();};}function respondWithResult(_0xd3b5f3,_0x15f35a){_0x15f35a=_0x15f35a||0xc8;return function(_0x396fea){if(_0x396fea){return _0xd3b5f3[_0x6c93('0x28')](_0x15f35a)['json'](_0x396fea);}};}function respondWithFilteredResult(_0x47f0e9,_0x8ff998){return function(_0x39bff0){if(_0x39bff0){var _0x3450e0=typeof _0x8ff998[_0x6c93('0x2a')]===_0x6c93('0x2b')&&typeof _0x8ff998['limit']===_0x6c93('0x2b');var _0x1b6623=_0x39bff0['count'];var _0x5ea7f4=_0x3450e0?0x0:_0x8ff998['offset'];var _0x480752=_0x3450e0?_0x39bff0[_0x6c93('0x2c')]:_0x8ff998[_0x6c93('0x2a')]+_0x8ff998[_0x6c93('0x2d')];var _0xf10da;if(_0x480752>=_0x1b6623){_0x480752=_0x1b6623;_0xf10da=0xc8;}else{_0xf10da=0xce;}_0x47f0e9[_0x6c93('0x28')](_0xf10da);return _0x47f0e9[_0x6c93('0x2e')](_0x6c93('0x2f'),_0x5ea7f4+'-'+_0x480752+'/'+_0x1b6623)['json'](_0x39bff0);}return null;};}function patchUpdates(_0x3b12ed){return function(_0x68aeee){try{jsonpatch['apply'](_0x68aeee,_0x3b12ed,!![]);}catch(_0x2558f7){return BPromise[_0x6c93('0x30')](_0x2558f7);}return _0x68aeee[_0x6c93('0x31')]();};}function saveUpdates(_0x323483,_0x5925bb){return function(_0x207adc){if(_0x207adc){return _0x207adc[_0x6c93('0x32')](_0x323483)[_0x6c93('0x1b')](function(_0x5cdb89){return _0x5cdb89;});}return null;};}function removeEntity(_0x2889e4,_0x3e3f01){return function(_0x8fd0c4){if(_0x8fd0c4){return _0x8fd0c4['destroy']()[_0x6c93('0x1b')](function(){_0x2889e4[_0x6c93('0x28')](0xcc)[_0x6c93('0x29')]();});}};}function handleEntityNotFound(_0x274d4e,_0x52f2f3){return function(_0x474b9c){if(!_0x474b9c){_0x274d4e['sendStatus'](0x194);}return _0x474b9c;};}function handleError(_0x37f7c1,_0x4bd3c5){_0x4bd3c5=_0x4bd3c5||0x1f4;return function(_0x429695){logger[_0x6c93('0x21')](_0x429695[_0x6c93('0x33')]);if(_0x429695['name']){delete _0x429695[_0x6c93('0x34')];}_0x37f7c1['status'](_0x4bd3c5)['send'](_0x429695);};}exports[_0x6c93('0x35')]=function(_0x95de6e,_0x4418ab){var _0x3594c0={},_0x203ee0={},_0x5e3620={'count':0x0,'rows':[]};var _0xed765f=_[_0x6c93('0x36')](db[_0x6c93('0x37')]['rawAttributes'],function(_0x1b2b20){return{'name':_0x1b2b20[_0x6c93('0x38')],'type':_0x1b2b20['type'][_0x6c93('0x39')]};});_0x203ee0[_0x6c93('0x3a')]=_[_0x6c93('0x36')](_0xed765f,_0x6c93('0x34'));_0x203ee0['query']=_[_0x6c93('0x3b')](_0x95de6e[_0x6c93('0x3c')]);_0x203ee0['filters']=_[_0x6c93('0x3d')](_0x203ee0[_0x6c93('0x3a')],_0x203ee0[_0x6c93('0x3c')]);_0x3594c0[_0x6c93('0x3e')]=_[_0x6c93('0x3d')](_0x203ee0[_0x6c93('0x3a')],qs[_0x6c93('0x3f')](_0x95de6e[_0x6c93('0x3c')][_0x6c93('0x3f')]));_0x3594c0['attributes']=_0x3594c0[_0x6c93('0x3e')][_0x6c93('0x40')]?_0x3594c0['attributes']:_0x203ee0[_0x6c93('0x3a')];if(!_0x95de6e[_0x6c93('0x3c')]['hasOwnProperty'](_0x6c93('0x41'))){_0x3594c0[_0x6c93('0x2d')]=qs[_0x6c93('0x2d')](_0x95de6e[_0x6c93('0x3c')]['limit']);_0x3594c0['offset']=qs['offset'](_0x95de6e['query'][_0x6c93('0x2a')]);}_0x3594c0[_0x6c93('0x42')]=qs[_0x6c93('0x43')](_0x95de6e[_0x6c93('0x3c')][_0x6c93('0x43')]);_0x3594c0[_0x6c93('0x44')]=qs[_0x6c93('0x45')](_[_0x6c93('0x46')](_0x95de6e['query'],_0x203ee0[_0x6c93('0x45')]),_0xed765f);if(_0x95de6e[_0x6c93('0x3c')][_0x6c93('0x47')]){_0x3594c0[_0x6c93('0x44')]=_[_0x6c93('0x48')](_0x3594c0['where'],{'$or':_[_0x6c93('0x36')](_0xed765f,function(_0x300004){if(_0x300004[_0x6c93('0x49')]!=='VIRTUAL'){var _0x5546a8={};_0x5546a8[_0x300004[_0x6c93('0x34')]]={'$like':'%'+_0x95de6e['query']['filter']+'%'};return _0x5546a8;}})});}_0x3594c0=_[_0x6c93('0x48')]({},_0x3594c0,_0x95de6e[_0x6c93('0x4a')]);var _0x23deb7={'where':_0x3594c0[_0x6c93('0x44')]};return db['SmsMessage'][_0x6c93('0x2c')](_0x23deb7)[_0x6c93('0x1b')](function(_0x236cb4){_0x5e3620[_0x6c93('0x2c')]=_0x236cb4;if(_0x95de6e[_0x6c93('0x3c')]['includeAll']){_0x3594c0['include']=[{'all':!![]}];}return db['SmsMessage'][_0x6c93('0x4b')](_0x3594c0);})[_0x6c93('0x1b')](function(_0x2164fb){_0x5e3620[_0x6c93('0x4c')]=_0x2164fb;return _0x5e3620;})[_0x6c93('0x1b')](respondWithFilteredResult(_0x4418ab,_0x3594c0))[_0x6c93('0x26')](handleError(_0x4418ab,null));};exports['show']=function(_0x294278,_0x4af119){var _0xc2c801={'raw':!![],'where':{'id':_0x294278[_0x6c93('0x4d')]['id']}},_0x4d716e={};_0x4d716e[_0x6c93('0x3a')]=_[_0x6c93('0x3b')](db[_0x6c93('0x37')][_0x6c93('0x4e')]);_0x4d716e[_0x6c93('0x3c')]=_[_0x6c93('0x3b')](_0x294278[_0x6c93('0x3c')]);_0x4d716e[_0x6c93('0x45')]=_['intersection'](_0x4d716e[_0x6c93('0x3a')],_0x4d716e[_0x6c93('0x3c')]);_0xc2c801[_0x6c93('0x3e')]=_['intersection'](_0x4d716e[_0x6c93('0x3a')],qs['fields'](_0x294278[_0x6c93('0x3c')][_0x6c93('0x3f')]));_0xc2c801['attributes']=_0xc2c801[_0x6c93('0x3e')][_0x6c93('0x40')]?_0xc2c801[_0x6c93('0x3e')]:_0x4d716e[_0x6c93('0x3a')];if(_0x294278[_0x6c93('0x3c')][_0x6c93('0x4f')]){_0xc2c801[_0x6c93('0x50')]=[{'all':!![]}];}_0xc2c801=_['merge']({},_0xc2c801,_0x294278[_0x6c93('0x4a')]);return db['SmsMessage'][_0x6c93('0x51')](_0xc2c801)['then'](handleEntityNotFound(_0x4af119,null))[_0x6c93('0x1b')](respondWithResult(_0x4af119,null))[_0x6c93('0x26')](handleError(_0x4af119,null));};exports[_0x6c93('0x52')]=function(_0x30d33d,_0x363fdd){return db['SmsMessage'][_0x6c93('0x52')](_0x30d33d[_0x6c93('0x53')],{})[_0x6c93('0x1b')](respondWithResult(_0x363fdd,0xc9))[_0x6c93('0x26')](handleError(_0x363fdd,null));};exports[_0x6c93('0x32')]=function(_0x58b4bc,_0x390841){if(_0x58b4bc[_0x6c93('0x53')]['id']){delete _0x58b4bc[_0x6c93('0x53')]['id'];}return db[_0x6c93('0x37')][_0x6c93('0x51')]({'where':{'id':_0x58b4bc[_0x6c93('0x4d')]['id']}})['then'](handleEntityNotFound(_0x390841,null))[_0x6c93('0x1b')](saveUpdates(_0x58b4bc[_0x6c93('0x53')],null))[_0x6c93('0x1b')](respondWithResult(_0x390841,null))[_0x6c93('0x26')](handleError(_0x390841,null));};exports[_0x6c93('0x54')]=function(_0x75666b,_0x1a2481){return db[_0x6c93('0x37')][_0x6c93('0x51')]({'where':{'id':_0x75666b[_0x6c93('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1a2481,null))[_0x6c93('0x1b')](removeEntity(_0x1a2481,null))[_0x6c93('0x26')](handleError(_0x1a2481,null));};exports[_0x6c93('0x55')]=function(_0x52e9e6,_0x43c323){return db['SmsMessage'][_0x6c93('0x55')]()['then'](respondWithResult(_0x43c323,null))[_0x6c93('0x26')](handleError(_0x43c323,null));};var interaction_log=require(_0x6c93('0x11'))(_0x6c93('0x56'));exports['accept']=function(_0x4dac6c,_0x294d1e,_0x59dcfd){var _0x5f1bfc={'agent':{},'channel':'sms'};if(_0x4dac6c[_0x6c93('0x53')]['id']){delete _0x4dac6c['body']['id'];}_0x4dac6c[_0x6c93('0x53')][_0x6c93('0x57')]=!![];_0x4dac6c['body'][_0x6c93('0x58')]=moment()[_0x6c93('0x59')](_0x6c93('0x5a'));_0x4dac6c[_0x6c93('0x53')][_0x6c93('0x5b')]=_0x4dac6c['body'][_0x6c93('0x5b')]||_0x4dac6c['user']['id'];_0x5f1bfc[_0x6c93('0x5c')]['id']=_0x4dac6c[_0x6c93('0x53')]['UserId'];return db[_0x6c93('0x37')]['find']({'where':{'id':_0x4dac6c[_0x6c93('0x4d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x294d1e,null))[_0x6c93('0x1b')](saveUpdates(_0x4dac6c[_0x6c93('0x53')],null))[_0x6c93('0x1b')](function(_0x3383fe){if(_0x3383fe){_0x5f1bfc[_0x6c93('0x24')]=_0x3383fe[_0x6c93('0x5d')]({'plain':!![]});return db[_0x6c93('0x5e')][_0x6c93('0x51')]({'where':{'id':_0x3383fe['SmsInteractionId']}});}return null;})[_0x6c93('0x1b')](handleEntityNotFound(_0x294d1e,null))[_0x6c93('0x1b')](function(_0x4fb584){if(_0x4fb584){return _0x4fb584['update']({'UserId':_0x4dac6c[_0x6c93('0x53')][_0x6c93('0x5b')],'read1stAt':_[_0x6c93('0x5f')](_0x4fb584[_0x6c93('0x60')])?moment()[_0x6c93('0x59')](_0x6c93('0x5a')):undefined});}return null;})[_0x6c93('0x1b')](function(_0x2542ae){if(_0x2542ae){_0x5f1bfc[_0x6c93('0x61')]=_0x2542ae[_0x6c93('0x5d')]({'plain':!![]});interaction_log[_0x6c93('0x1c')](_0x6c93('0x62'),_0x4dac6c['user']['id'],_0x4dac6c['user']['name'],_0x4dac6c[_0x6c93('0x63')][_0x6c93('0x64')],_0x5f1bfc[_0x6c93('0x61')]['id'],_0x4dac6c['body']?JSON[_0x6c93('0x20')](_0x4dac6c[_0x6c93('0x53')]):_0x6c93('0x65'));return respondWithRpcPromise(_0x6c93('0x66'),_0x6c93('0x67'),_0x5f1bfc);}return null;})[_0x6c93('0x1b')](function(_0x235ab6){var _0x523e65=_0x6c93('0x68')+_0x235ab6[_0x6c93('0x24')][_0x6c93('0x69')];return db[_0x6c93('0x6a')][_0x6c93('0x3c')](_0x523e65,{'type':db['Sequelize'][_0x6c93('0x6b')]['SELECT'],'raw':!![]})[_0x6c93('0x1b')](function(_0xd7a4e7){return _0xd7a4e7;});})['then'](function(_0x5cabd5){if(_0x5cabd5){_0x5f1bfc['message'][_0x6c93('0x6c')]=_0x5cabd5[0x0];if(!_0x4dac6c[_0x6c93('0x53')]['UserId'])return;return db[_0x6c93('0x6d')][_0x6c93('0x51')]({'where':{'id':_0x4dac6c['body'][_0x6c93('0x5b')],'role':_0x6c93('0x5c')},'attributes':['id',_0x6c93('0x34'),'fullname',_0x6c93('0x6e'),_0x6c93('0x6f')],'raw':!![]});}return null;})[_0x6c93('0x1b')](function(_0x56b14f){if(!_0x56b14f)return null;_0x5f1bfc[_0x6c93('0x24')][_0x6c93('0x5c')]=_0x56b14f;return _0x5f1bfc;})[_0x6c93('0x1b')](function(_0x47d017){if(_0x47d017){if(_0x4dac6c['body'][_0x6c93('0x70')]){_0x5f1bfc[_0x6c93('0x24')][_0x6c93('0x71')]=util[_0x6c93('0x59')](_0x6c93('0x72'),_0x4dac6c['user'][_0x6c93('0x34')]);_0x5f1bfc['message'][_0x6c93('0x73')]=_0x5f1bfc['channel'];_0x5f1bfc[_0x6c93('0x24')][_0x6c93('0x74')]=_0x5f1bfc[_0x6c93('0x73')];_0x5f1bfc[_0x6c93('0x24')][_0x6c93('0x75')]='accept';return respondWithRpcPromise(_0x6c93('0x76'),'EventManager',{'event':_0x6c93('0x77'),'message':_0x5f1bfc[_0x6c93('0x24')]},client9002)['then'](function(){return _0x5f1bfc;});}return _0x5f1bfc;}return null;})[_0x6c93('0x1b')](respondWithResult(_0x294d1e,null))[_0x6c93('0x26')](handleError(_0x294d1e,null));};var interaction_log=require(_0x6c93('0x11'))(_0x6c93('0x56'));exports[_0x6c93('0x30')]=function(_0x12ad96,_0xbceaf7,_0x22b52a){var _0x204448={'agent':{},'channel':_0x6c93('0x78')};if(_0x12ad96[_0x6c93('0x53')]['id']){delete _0x12ad96[_0x6c93('0x53')]['id'];}_0x12ad96[_0x6c93('0x53')][_0x6c93('0x5b')]=_0x12ad96[_0x6c93('0x53')]['UserId']||_0x12ad96[_0x6c93('0x63')]['id'];_0x204448[_0x6c93('0x5c')]['id']=_0x12ad96[_0x6c93('0x53')][_0x6c93('0x5b')];return db[_0x6c93('0x37')][_0x6c93('0x51')]({'where':{'id':_0x12ad96[_0x6c93('0x4d')]['id'],'UserId':null}})[_0x6c93('0x1b')](handleEntityNotFound(_0xbceaf7,null))[_0x6c93('0x1b')](function(_0x2dc5df){if(_0x2dc5df){_0x204448[_0x6c93('0x24')]=_0x2dc5df['get']({'plain':!![]});return db[_0x6c93('0x5e')][_0x6c93('0x51')]({'where':{'id':_0x2dc5df[_0x6c93('0x79')]}});}return null;})[_0x6c93('0x1b')](handleEntityNotFound(_0xbceaf7,null))['then'](function(_0x2af5ac){if(_0x2af5ac){_0x204448['interaction']=_0x2af5ac['get']({'plain':!![]});interaction_log['info'](_0x6c93('0x7a'),_0x12ad96['user']['id'],_0x12ad96[_0x6c93('0x63')][_0x6c93('0x34')],_0x12ad96[_0x6c93('0x63')][_0x6c93('0x64')],_0x204448['interaction']['id'],_0x12ad96['body']?JSON[_0x6c93('0x20')](_0x12ad96[_0x6c93('0x53')]):'null');return respondWithRpcPromise(_0x6c93('0x7b'),_0x6c93('0x7c'),_0x204448);}return null;})[_0x6c93('0x1b')](function(_0x5f3366){var _0x254a7d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5f3366['message'][_0x6c93('0x69')];return db[_0x6c93('0x6a')][_0x6c93('0x3c')](_0x254a7d,{'type':db['Sequelize'][_0x6c93('0x6b')]['SELECT'],'raw':!![]})[_0x6c93('0x1b')](function(_0x448cba){return _0x448cba;});})[_0x6c93('0x1b')](function(_0x3a90ac){if(_0x3a90ac){_0x204448[_0x6c93('0x24')]['contact']=_0x3a90ac[0x0];if(!_0x12ad96[_0x6c93('0x53')][_0x6c93('0x5b')])return;return db[_0x6c93('0x6d')][_0x6c93('0x51')]({'where':{'id':_0x12ad96[_0x6c93('0x53')][_0x6c93('0x5b')],'role':_0x6c93('0x5c')},'attributes':['id',_0x6c93('0x34'),'fullname',_0x6c93('0x6e'),_0x6c93('0x6f')],'raw':!![]});}return null;})[_0x6c93('0x1b')](function(_0x5df637){if(!_0x5df637)return null;_0x204448['message'][_0x6c93('0x5c')]=_0x5df637;return _0x204448;})['then'](function(_0x68afe0){if(_0x68afe0){_0x68afe0[_0x6c93('0x24')]['interface']=util[_0x6c93('0x59')](_0x6c93('0x72'),_0x12ad96['user'][_0x6c93('0x34')]);_0x68afe0['message'][_0x6c93('0x73')]=_0x204448['channel'];_0x68afe0[_0x6c93('0x24')][_0x6c93('0x74')]=_0x204448[_0x6c93('0x73')];_0x68afe0[_0x6c93('0x24')][_0x6c93('0x75')]=_0x6c93('0x30');respondWithRpcPromise(_0x6c93('0x76'),_0x6c93('0x76'),{'event':_0x6c93('0x7d'),'message':_0x68afe0['message']},client9002);return _0x204448;}return null;})[_0x6c93('0x1b')](respondWithResult(_0xbceaf7,null))[_0x6c93('0x26')](handleError(_0xbceaf7,null));};exports[_0x6c93('0x28')]=function(_0xe7f4ad,_0x5975d7,_0x28646e){if(_0xe7f4ad[_0x6c93('0x53')]['id']){delete _0xe7f4ad['body']['id'];}var _0x27d1c8;return db[_0x6c93('0x37')][_0x6c93('0x51')]({'where':{'id':_0xe7f4ad[_0x6c93('0x4d')]['id']}})[_0x6c93('0x1b')](handleEntityNotFound(_0x5975d7,null))[_0x6c93('0x1b')](function(_0x35463b){if(_0x35463b){_0x27d1c8=_0x35463b;return db[_0x6c93('0x7e')]['find']({'where':{'id':_0x35463b['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x5975d7,null))['then'](function(_0x48b35d){if(_0x48b35d){logger[_0x6c93('0x1d')](_0x6c93('0x1e'),_0x6c93('0x28'),'received\x20delivery\x20report\x20from',_0x48b35d[_0x6c93('0x49')],util[_0x6c93('0x7f')](_0xe7f4ad[_0x6c93('0x53')],{'showHidden':![],'depth':null}));switch(_0x48b35d[_0x6c93('0x49')]){case _0x6c93('0x80'):if(_0xe7f4ad['body']['MessageSid']&&_0xe7f4ad[_0x6c93('0x53')][_0x6c93('0x81')]===_0x27d1c8['messageId']){return _0x27d1c8['update']({'read':!![]});}else{logger[_0x6c93('0x21')](_0x6c93('0x82'),'status',_0x6c93('0x80'),util[_0x6c93('0x7f')](_0xe7f4ad['body'],{'showHidden':![],'depth':null}));}break;case _0x6c93('0x83'):if(_0xe7f4ad[_0x6c93('0x53')][_0x6c93('0x84')]&&_0xe7f4ad['body']['MessageUUID']===_0x27d1c8[_0x6c93('0x85')]&&_[_0x6c93('0x86')](['sent',_0x6c93('0x87')],_0xe7f4ad['body'][_0x6c93('0x88')])>=0x0){return _0x27d1c8['update']({'read':!![]});}else{logger[_0x6c93('0x21')](_0x6c93('0x82'),_0x6c93('0x28'),_0x6c93('0x89'),util[_0x6c93('0x7f')](_0xe7f4ad[_0x6c93('0x53')],{'showHidden':![],'depth':null}));}break;case _0x6c93('0x8a'):var _0x10a96e=_0xe7f4ad[_0x6c93('0x53')][_0x6c93('0x8b')][0x0];if(_0x10a96e[_0x6c93('0x28')][_0x6c93('0x8c')]===_0x6c93('0x8d')){return _0x27d1c8[_0x6c93('0x32')]({'read':!![]});}else{logger[_0x6c93('0x21')](_0x6c93('0x82'),_0x6c93('0x28'),_0x6c93('0x8a'),util[_0x6c93('0x7f')](_0xe7f4ad[_0x6c93('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x27d1c8;}})[_0x6c93('0x1b')](respondWithResult(_0x5975d7,null))[_0x6c93('0x26')](handleError(_0x5975d7,null));};
\ No newline at end of file
index 102fff1..b263438 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeede=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','SmsMessage'];(function(_0xfc8938,_0x296364){var _0x55198=function(_0x23c2b4){while(--_0x23c2b4){_0xfc8938['push'](_0xfc8938['shift']());}};_0x55198(++_0x296364);}(_0xeede,0x1ce));var _0xeeed=function(_0x29bf80,_0x4af855){_0x29bf80=_0x29bf80-0x0;var _0x932096=_0xeede[_0x29bf80];return _0x932096;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xeeed('0x0'))['db'][_0xeeed('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeeed('0x2'),'afterUpdate':_0xeeed('0x3'),'afterDestroy':_0xeeed('0x4')};function emitEvent(_0x3188c3){return function(_0xaef223,_0x2aef3b,_0x376cc3){SmsMessageEvents[_0xeeed('0x5')](_0x3188c3+':'+_0xaef223['id'],_0xaef223);SmsMessageEvents['emit'](_0x3188c3,_0xaef223);_0x376cc3(null);};}for(var e in events){if(events[_0xeeed('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xeeed('0x7')]=SmsMessageEvents;
\ No newline at end of file
+var _0xfd53=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xfd53,0x19b));var _0x3fd5=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xfd53[_0x1d24eb];return _0x1dc576;};'use strict';var EventEmitter=require(_0x3fd5('0x0'));var SmsMessage=require(_0x3fd5('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x3fd5('0x2')](0x0);var events={'afterCreate':_0x3fd5('0x3'),'afterUpdate':_0x3fd5('0x4'),'afterDestroy':_0x3fd5('0x5')};function emitEvent(_0x43fec4){return function(_0x17cb76,_0x1ec1bf,_0x24cc63){SmsMessageEvents[_0x3fd5('0x6')](_0x43fec4+':'+_0x17cb76['id'],_0x17cb76);SmsMessageEvents[_0x3fd5('0x6')](_0x43fec4,_0x17cb76);_0x24cc63(null);};}for(var e in events){if(events[_0x3fd5('0x7')](e)){var event=events[e];SmsMessage[_0x3fd5('0x8')](e,emitEvent(event));}}module[_0x3fd5('0x9')]=SmsMessageEvents;
\ No newline at end of file
index ac81e29..c306da5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ec8=['baseUrl','/auth/1/session','Missing\x20parameters:\x20base_url','csc','crypto','login','text','timestamp','keys','length','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','apiKey','https://platform.clickatell.com/messages','uuid','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','finally','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','get','direction','toLowerCase','out','secret','UserId','isNil','SmsInteraction','then','update','createdAt','catch','error','SmsAccount','SmsAccountId','type','twilio','authToken','phone','accountSid','messages','create','/api/sms/messages/','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','sms','POST','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','queued_count','head','data','message_id','clickSend','plivo','authId','remote','/status?token=','token','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip'];(function(_0x168466,_0x5f37e5){var _0xcf8a4=function(_0x48cf99){while(--_0x48cf99){_0x168466['push'](_0x168466['shift']());}};_0xcf8a4(++_0x5f37e5);}(_0x1ec8,0x11c));var _0x81ec=function(_0x429dcc,_0x7dcc45){_0x429dcc=_0x429dcc-0x0;var _0x11bf27=_0x1ec8[_0x429dcc];return _0x11bf27;};'use strict';var _=require(_0x81ec('0x0'));var util=require(_0x81ec('0x1'));var logger=require(_0x81ec('0x2'))(_0x81ec('0x3'));var moment=require(_0x81ec('0x4'));var BPromise=require('bluebird');var rp=require(_0x81ec('0x5'));var fs=require('fs');var path=require(_0x81ec('0x6'));var rimraf=require(_0x81ec('0x7'));var config=require('../../config/environment');var attributes=require(_0x81ec('0x8'));module['exports']=function(_0x48e47a,_0x35794f){return _0x48e47a[_0x81ec('0x9')](_0x81ec('0xa'),attributes,{'tableName':_0x81ec('0xb'),'paranoid':![],'indexes':[{'name':_0x81ec('0xc'),'fields':['messageId']},{'name':_0x81ec('0xd'),'fields':[_0x81ec('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1134a6,_0x3aa691,_0x3bb28b){var _0x28e223=_0x48e47a['models'];var _0x117ba5=_0x1134a6[_0x81ec('0xf')]({'plain':!![]});if(_0x117ba5[_0x81ec('0x10')][_0x81ec('0x11')]()==='in'||_0x117ba5[_0x81ec('0x10')][_0x81ec('0x11')]()===_0x81ec('0x12')&&!_0x117ba5[_0x81ec('0x13')]&&!_['isNil'](_0x117ba5[_0x81ec('0x14')])&&!_[_0x81ec('0x15')](_0x117ba5['SmsInteractionId'])){_0x28e223[_0x81ec('0x16')]['findOne']({'where':{'id':_0x117ba5['SmsInteractionId']}})[_0x81ec('0x17')](function(_0x4188b6){if(_0x4188b6){_0x4188b6[_0x81ec('0x18')]({'lastMsgAt':_0x117ba5[_0x81ec('0x19')],'lastMsgDirection':_0x117ba5['direction'][_0x81ec('0x11')]()});}})[_0x81ec('0x1a')](function(_0x55d8eb){console[_0x81ec('0x1b')](_0x55d8eb);});}if(_0x117ba5[_0x81ec('0x10')]==='out'&&!_0x117ba5[_0x81ec('0x13')]){var _0xe4b107;_0x28e223[_0x81ec('0x1c')]['find']({'where':{'id':_0x117ba5[_0x81ec('0x1d')]},'raw':!![]})[_0x81ec('0x17')](function(_0x65f1c1){_0xe4b107=_0x65f1c1;if(_0xe4b107&&_0xe4b107['type']){switch(_0xe4b107[_0x81ec('0x1e')]){case'twilio':var _0x19347c=require(_0x81ec('0x1f'));if(_0xe4b107['accountSid']&&_0xe4b107[_0x81ec('0x20')]&&_0xe4b107[_0x81ec('0x21')]){var _0x2b86f7=new _0x19347c(_0xe4b107[_0x81ec('0x22')],_0xe4b107[_0x81ec('0x20')]);_0x2b86f7[_0x81ec('0x23')][_0x81ec('0x24')]({'body':_0x117ba5[_0x81ec('0xe')],'to':_0x117ba5[_0x81ec('0x21')],'from':_0xe4b107[_0x81ec('0x21')],'statusCallback':_0xe4b107['remote']+_0x81ec('0x25')+_0x117ba5['id']+'/status?token='+_0xe4b107['token']})[_0x81ec('0x17')](function(_0x15b683){if(_0x15b683[_0x81ec('0x26')]){return _0x1134a6[_0x81ec('0x18')]({'messageId':_0x15b683[_0x81ec('0x26')]});}})[_0x81ec('0x1a')](function(_0x20ae52){logger[_0x81ec('0x1b')](_0x81ec('0x27'),_0x81ec('0x28'),_0x81ec('0x1f'),util[_0x81ec('0x29')](_0x20ae52,{'showHidden':![],'depth':null}));});}else{logger[_0x81ec('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',_0x81ec('0x2a'));}break;case _0x81ec('0x2b'):var _0x443f9e=_0x81ec('0x2c');if(_0xe4b107[_0x81ec('0x2d')]&&_0xe4b107[_0x81ec('0x2e')]){var _0x1821f3={'recipient':[_0x117ba5[_0x81ec('0x21')]],'message':_0x117ba5['body'],'message_type':_0xe4b107['smsMethod']};if(_0xe4b107['smsMethod']&&_0xe4b107[_0x81ec('0x2f')]!=='SI'){_0x1821f3[_0x81ec('0x30')]=_0xe4b107[_0x81ec('0x21')];}var _0x2aaf4a={'url':_0x443f9e+_0x81ec('0x31')+_0xe4b107[_0x81ec('0x2d')]+_0x81ec('0x32')+_0xe4b107[_0x81ec('0x2e')],'method':_0x81ec('0x33')};rp(_0x2aaf4a)[_0x81ec('0x17')](function(_0xad7eb7){var _0x519c07=_0xad7eb7[_0x81ec('0x34')](';');var _0x500a32={'user_key':_0x519c07[0x0],'session_key':_0x519c07[0x1]};_0x2aaf4a={'url':_0x443f9e+_0x81ec('0x35'),'method':_0x81ec('0x36'),'headers':{'user_key':_0x500a32['user_key'],'Session_key':_0x500a32[_0x81ec('0x37')]},'json':!![],'body':_0x1821f3};return rp(_0x2aaf4a);})['then'](function(_0x35e8a6){if(_0x35e8a6[_0x81ec('0x38')]>=0x1){var _0xe6db04={'messageId':_0x35e8a6[_0x81ec('0x39')]};if(_0xe4b107[_0x81ec('0x2f')]!=='GP'||!_0xe4b107[_0x81ec('0x3a')]){_0xe6db04[_0x81ec('0x3b')]=!![];}return _0x1134a6[_0x81ec('0x18')](_0xe6db04);}else{return logger['error'](_0x81ec('0x27'),'afterCreate',_0x81ec('0x2b'),util[_0x81ec('0x29')](_0x35e8a6,{'showHidden':![],'depth':null}));}})['catch'](function(_0x95c3c2){return logger[_0x81ec('0x1b')](_0x81ec('0x27'),_0x81ec('0x28'),_0x81ec('0x2b'),util[_0x81ec('0x29')](_0x95c3c2,{'showHidden':![],'depth':null}));});}else{logger[_0x81ec('0x1b')](_0x81ec('0x27'),_0x81ec('0x28'),'skebby',_0x81ec('0x3c'));}break;case _0x81ec('0x3d'):if(_0xe4b107[_0x81ec('0x20')]){var _0x212005={'recipient':_0x117ba5['phone'],'message':_0x117ba5[_0x81ec('0xe')],'sender':_0xe4b107[_0x81ec('0x3e')]||_0xe4b107['phone'],'authorization':_0xe4b107[_0x81ec('0x20')]};var _0x3aa691={'method':'POST','uri':_0x81ec('0x3f'),'body':_0x212005,'json':!![]};rp(_0x3aa691)[_0x81ec('0x17')](function(_0x4b799e){var _0x3bf31c={'messageId':_0x4b799e[_0x81ec('0x40')]};if(!_0xe4b107[_0x81ec('0x3a')]){_0x3bf31c['read']=!![];}return _0x1134a6[_0x81ec('0x18')](_0x3bf31c);})['catch'](function(_0x496852){logger['error'](_0x81ec('0x27'),_0x81ec('0x28'),_0x81ec('0x3d'),util[_0x81ec('0x29')](_0x496852,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x81ec('0x27'),_0x81ec('0x28'),_0x81ec('0x3d'),_0x81ec('0x41'));}break;case _0x81ec('0x42'):if(_0xe4b107[_0x81ec('0x2d')]&&_0xe4b107[_0x81ec('0x2e')]){var _0x212005={'messages':[{'source':_0x81ec('0x43'),'to':_0x117ba5['phone'],'body':_0x117ba5[_0x81ec('0xe')],'from':_0xe4b107[_0x81ec('0x3e')]||_0xe4b107['phone']}]};var _0xdde282=util[_0x81ec('0x44')](_0x81ec('0x45'),_0xe4b107[_0x81ec('0x2d')],_0xe4b107[_0x81ec('0x2e')]);var _0x3aa691={'method':_0x81ec('0x36'),'uri':_0x81ec('0x46'),'body':_0x212005,'headers':{'Authorization':util['format'](_0x81ec('0x47'),new Buffer(_0xdde282)[_0x81ec('0x48')]('base64'))},'json':!![]};rp(_0x3aa691)[_0x81ec('0x17')](function(_0x465481){if(_0x465481[_0x81ec('0x49')]>=0xc8&&_0x465481[_0x81ec('0x49')]<=0xce){if(_0x465481['data']&&_0x465481['data'][_0x81ec('0x4a')]>0x0){var _0x27efe9=_[_0x81ec('0x4b')](_0x465481[_0x81ec('0x4c')][_0x81ec('0x23')]);var _0x7f83c8={'messageId':_0x27efe9[_0x81ec('0x4d')]};if(!_0xe4b107[_0x81ec('0x3a')]){_0x7f83c8[_0x81ec('0x3b')]=!![];}return _0x1134a6[_0x81ec('0x18')](_0x7f83c8);}else{logger[_0x81ec('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x81ec('0x28'),_0x81ec('0x4e'),util['inspect'](_0x465481,{'showHidden':![],'depth':null}));}}else{logger[_0x81ec('0x1b')](_0x81ec('0x27'),'afterCreate','clickSend',util[_0x81ec('0x29')](_0x465481,{'showHidden':![],'depth':null}));}})[_0x81ec('0x1a')](function(_0x5cf15c){logger[_0x81ec('0x1b')](_0x81ec('0x27'),_0x81ec('0x28'),_0x81ec('0x4e'),util[_0x81ec('0x29')](_0x5cf15c,{'showHidden':![],'depth':null}));});}else{logger[_0x81ec('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x81ec('0x28'),_0x81ec('0x4e'),_0x81ec('0x3c'));}break;case _0x81ec('0x4f'):if(_0xe4b107[_0x81ec('0x50')]&&_0xe4b107[_0x81ec('0x20')]){var _0x212005={'dst':_0x117ba5['phone'],'text':_0x117ba5['body'],'src':_0xe4b107[_0x81ec('0x3e')]||_0xe4b107[_0x81ec('0x21')],'url':_0xe4b107[_0x81ec('0x51')]+_0x81ec('0x25')+_0x117ba5['id']+_0x81ec('0x52')+_0xe4b107[_0x81ec('0x53')]};var _0xdde282=util[_0x81ec('0x44')]('%s:%s',_0xe4b107['authId'],_0xe4b107[_0x81ec('0x20')]);var _0x3aa691={'method':_0x81ec('0x36'),'uri':util[_0x81ec('0x44')]('https://api.plivo.com/v1/Account/%s/Message/',_0xe4b107['authId']),'body':_0x212005,'headers':{'Authorization':util['format'](_0x81ec('0x47'),new Buffer(_0xdde282)['toString'](_0x81ec('0x54')))},'json':!![]};rp(_0x3aa691)[_0x81ec('0x17')](function(_0x2b56b9){var _0x3d15cb={'messageId':_0x2b56b9[_0x81ec('0x55')][0x0]};return _0x1134a6[_0x81ec('0x18')](_0x3d15cb);})[_0x81ec('0x1a')](function(_0x45071b){logger[_0x81ec('0x1b')](_0x81ec('0x27'),_0x81ec('0x28'),'plivo',util[_0x81ec('0x29')](_0x45071b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x81ec('0x27'),_0x81ec('0x28'),_0x81ec('0x4f'),_0x81ec('0x56'));}break;case _0x81ec('0x57'):if(_0xe4b107['username']&&_0xe4b107[_0x81ec('0x2e')]){if(_0xe4b107[_0x81ec('0x58')]){var _0x40bfd6={'method':'POST','uri':_0xe4b107['baseUrl']+_0x81ec('0x59'),'body':{'username':_0xe4b107[_0x81ec('0x2d')],'password':_0xe4b107[_0x81ec('0x2e')]},'json':!![]};return rp(_0x40bfd6)[_0x81ec('0x17')](function(_0x65ab94){var _0x1a6a5d={'method':'POST','uri':_0xe4b107[_0x81ec('0x58')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0xe4b107[_0x81ec('0x21')],'destinations':[{'to':_0x117ba5[_0x81ec('0x21')]}],'text':_0x117ba5['body'],'notifyUrl':_0xe4b107['remote']+_0x81ec('0x25')+_0x117ba5['id']+_0x81ec('0x52')+_0xe4b107[_0x81ec('0x53')],'notifyContentType':'application/json','callbackData':_0xe4b107[_0x81ec('0x21')]+';'+_0x117ba5[_0x81ec('0xe')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x65ab94[_0x81ec('0x53')]},'json':!![]};return rp(_0x1a6a5d)[_0x81ec('0x17')](function(_0x472d28){if(_0x472d28[_0x81ec('0x23')]){var _0x16b756={'messageId':_0x472d28[_0x81ec('0x23')][0x0][_0x81ec('0xc')]};if(!_0xe4b107['deliveryReport']){_0x16b756[_0x81ec('0x3b')]=!![];}return _0x1134a6[_0x81ec('0x18')](_0x16b756);}else{return logger[_0x81ec('0x1b')](_0x81ec('0x27'),_0x81ec('0x28'),_0x81ec('0x57'),util[_0x81ec('0x29')](_0x472d28,{'showHidden':![],'depth':null}));}});})[_0x81ec('0x1a')](function(_0x4a2488){return logger['error'](_0x81ec('0x27'),'afterCreate','infobip',util[_0x81ec('0x29')](_0x4a2488,{'showHidden':![],'depth':null}));});}else{logger[_0x81ec('0x1b')](_0x81ec('0x27'),_0x81ec('0x28'),_0x81ec('0x57'),_0x81ec('0x5a'));}}else{logger[_0x81ec('0x1b')](_0x81ec('0x27'),_0x81ec('0x28'),_0x81ec('0x57'),_0x81ec('0x3c'));}break;case _0x81ec('0x5b'):var _0x5cb988=require(_0x81ec('0x5c'));if(_0xe4b107['apiKey']){var _0x2c2cfe={};_0x2c2cfe[_0x81ec('0x5d')]=_0xe4b107['username'];_0x2c2cfe[_0x81ec('0x21')]=_0x117ba5['phone'];_0x2c2cfe['sender']=_0xe4b107[_0x81ec('0x21')];_0x2c2cfe[_0x81ec('0x5e')]=_0x117ba5['body'];_0x2c2cfe[_0x81ec('0x5f')]=+new Date();var _0x2d5ec6='';var _0x5c3a93='';var _0x3d2446=Object[_0x81ec('0x60')](_0x2c2cfe);_0x3d2446['sort']();for(var _0x4b6918=0x0;_0x4b6918<_0x3d2446[_0x81ec('0x61')];_0x4b6918++){if(_0x2d5ec6!=''){_0x2d5ec6+='&';}_0x2d5ec6+=_0x3d2446[_0x4b6918]+'='+encodeURIComponent(_0x2c2cfe[_0x3d2446[_0x4b6918]]);_0x5c3a93+=_0x2c2cfe[_0x3d2446[_0x4b6918]];}_0x5c3a93+=_0xe4b107['apiKey'];_0x5c3a93=_0x5cb988['createHash'](_0x81ec('0x62'))['update'](_0x5c3a93)[_0x81ec('0x63')](_0x81ec('0x64'));if(_0x2d5ec6!==''){_0x2d5ec6+='&';}_0x2d5ec6+=_0x81ec('0x65')+_0x5c3a93;var _0x2aaf4a={'method':'GET','uri':_0xe4b107['baseUrl']+_0x81ec('0x66')+_0x2d5ec6,'json':!![]};return rp(_0x2aaf4a)[_0x81ec('0x17')](function(_0x4fac39){var _0x3044ea=Object['keys'](_0x4fac39);if(_0x4fac39[_0x3044ea[0x0]][_0x81ec('0x1b')]&&parseInt(_0x4fac39[_0x3044ea[0x0]][_0x81ec('0x1b')])===0x0){var _0x161431={'messageId':_0x4fac39[_0x3044ea[0x0]][_0x81ec('0x67')]};if(!_0xe4b107[_0x81ec('0x3a')]){_0x161431['read']=!![];}return _0x1134a6[_0x81ec('0x18')](_0x161431);}else{return logger[_0x81ec('0x1b')](_0x81ec('0x27'),'afterCreate',_0x81ec('0x5b'),util[_0x81ec('0x29')](_0x4fac39[_0x81ec('0x1b')],{'showHidden':![],'depth':null}));}})[_0x81ec('0x1a')](function(_0x32cd1c){return logger[_0x81ec('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x81ec('0x5b'),util[_0x81ec('0x29')](_0x32cd1c,{'showHidden':![],'depth':null}));});}else{logger[_0x81ec('0x1b')](_0x81ec('0x27'),_0x81ec('0x28'),_0x81ec('0x5b'),_0x81ec('0x68'));}break;case'clickatell':if(_0xe4b107[_0x81ec('0x69')]){var _0x105220={'method':_0x81ec('0x36'),'uri':_0x81ec('0x6a'),'headers':{'Authorization':_0xe4b107[_0x81ec('0x69')]},'body':{'content':_0x117ba5[_0x81ec('0xe')],'to':[_0x117ba5[_0x81ec('0x21')]],'from':_0xe4b107['phone'],'binary':![],'clientMessageId':_0x81ec('0x6b'),'charset':'UTF-8'},'json':!![]};rp(_0x105220)[_0x81ec('0x17')](function(_0x2ba0a2){if(!_0x2ba0a2['error']){var _0x30ebcd={'messageId':_0x2ba0a2[_0x81ec('0x23')][0x0][_0x81ec('0x6c')]};if(!_0xe4b107[_0x81ec('0x3a')]){_0x30ebcd['read']=!![];}return _0x1134a6[_0x81ec('0x18')](_0x30ebcd);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x81ec('0x28'),'clickatell',util[_0x81ec('0x29')](_0x2ba0a2['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0xa64662){return logger['error'](_0x81ec('0x27'),'afterCreate','clickatell',util['inspect'](_0xa64662,{'showHidden':![],'depth':null}));});}else{logger[_0x81ec('0x1b')](_0x81ec('0x27'),_0x81ec('0x28'),_0x81ec('0x6d'),_0x81ec('0x68'));}break;case _0x81ec('0x6e'):if(_0xe4b107[_0x81ec('0x2d')]&&_0xe4b107[_0x81ec('0x2e')]){var _0xdde282=util[_0x81ec('0x44')](_0x81ec('0x45'),_0xe4b107['username'],_0xe4b107[_0x81ec('0x2e')]);var _0x3aa691={'method':'POST','uri':_0x81ec('0x6f')+_0xe4b107[_0x81ec('0x70')]+_0x81ec('0x71'),'body':{'to':[_0x117ba5[_0x81ec('0x21')]],'text':_0x117ba5['body'],'from':_0xe4b107[_0x81ec('0x21')],'applicationId':_0xe4b107['applicationId']},'headers':{'Authorization':util[_0x81ec('0x44')]('Basic\x20%s',new Buffer(_0xdde282)[_0x81ec('0x48')]('base64'))},'json':!![]};rp(_0x3aa691)[_0x81ec('0x17')](function(_0x41fa75){if(_0x41fa75['id']){var _0x2a1948={'messageId':_0x41fa75['id']};return _0x1134a6['update'](_0x2a1948);}else{logger[_0x81ec('0x1b')](_0x81ec('0x27'),_0x81ec('0x28'),_0x81ec('0x6e'),util['inspect'](_0x41fa75,{'showHidden':![],'depth':null}));}})[_0x81ec('0x1a')](function(_0x1cd68a){logger[_0x81ec('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x81ec('0x28'),'bandwidth',util['inspect'](_0x1cd68a,{'showHidden':![],'depth':null}));});}else{logger[_0x81ec('0x1b')](_0x81ec('0x27'),'afterCreate','bandwidth',_0x81ec('0x3c'));}break;case _0x81ec('0x72'):if(_0xe4b107[_0x81ec('0x69')]){var _0x3c2ca4={};var _0x2aaf4a={'method':_0x81ec('0x36'),'uri':_0x81ec('0x73'),'headers':{'Authorization':_0x81ec('0x74')+_0xe4b107[_0x81ec('0x69')],'Content-Type':_0x81ec('0x75')},'body':{'from':_0xe4b107[_0x81ec('0x21')],'to':_0x117ba5[_0x81ec('0x21')],'text':_0x117ba5[_0x81ec('0xe')]},'json':!![]};return rp(_0x2aaf4a)['then'](function(_0x1769e2){if(_0x1769e2['code']==0xca){_0x3c2ca4[_0x81ec('0x76')]=_0x1769e2;var _0x34c33f={'method':'POST','uri':_0x81ec('0x77'),'headers':{'Authorization':_0x81ec('0x74')+_0xe4b107['apiKey'],'Content-Type':_0x81ec('0x75')},'body':{'refid':_0x3c2ca4[_0x81ec('0x76')][_0x81ec('0x78')]},'json':!![]};return rp(_0x34c33f)[_0x81ec('0x17')](function(_0x539f0d){_0x3c2ca4[_0x81ec('0x79')]=_0x539f0d;var _0x287f32={'messageId':_0x3c2ca4[_0x81ec('0x76')][_0x81ec('0x78')],'read':!![]};return _0x1134a6['update'](_0x287f32);});}else{return logger[_0x81ec('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x81ec('0x72'),util['inspect'](_0x1769e2,{'showHidden':![],'depth':null}));}})[_0x81ec('0x1a')](function(_0x48951c){return logger['error'](_0x81ec('0x27'),_0x81ec('0x28'),_0x81ec('0x72'),util[_0x81ec('0x29')](_0x48951c,{'showHidden':![],'depth':null}));});}else{return logger[_0x81ec('0x1b')](_0x81ec('0x27'),'afterCreate',_0x81ec('0x72'),'Token\x20not\x20received');}break;}}})[_0x81ec('0x7a')](function(){_0x3bb28b();});}else{_0x3bb28b();}}},'charset':_0x81ec('0x7b'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0f01=['length','createHash','digest','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','apiMessageId','accountId','/messages','applicationId','bandwidth','intelepeer','code','message','Bearer\x20','refid','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','error','out','find','SmsAccountId','type','twilio','authToken','phone','create','body','remote','/api/sms/messages/','token','sid','afterCreate','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','smsMethod','sender','login?username=','&password=','password','POST','user_key','total_sent','deliveryReport','read','inspect','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','messages','message_id','clickSend','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','infobip','Missing\x20parameters:\x20base_url','Missing\x20parameters:\x20username,\x20password','csc','crypto','apiKey','login','text','keys','sort'];(function(_0x2de1fb,_0x329b33){var _0x4fb590=function(_0xf80fc5){while(--_0xf80fc5){_0x2de1fb['push'](_0x2de1fb['shift']());}};_0x4fb590(++_0x329b33);}(_0x0f01,0x177));var _0x10f0=function(_0x6a555d,_0x57335f){_0x6a555d=_0x6a555d-0x0;var _0x28020b=_0x0f01[_0x6a555d];return _0x28020b;};'use strict';var _=require(_0x10f0('0x0'));var util=require(_0x10f0('0x1'));var logger=require(_0x10f0('0x2'))(_0x10f0('0x3'));var moment=require(_0x10f0('0x4'));var BPromise=require(_0x10f0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x10f0('0x6'));var rimraf=require(_0x10f0('0x7'));var config=require(_0x10f0('0x8'));var attributes=require(_0x10f0('0x9'));module[_0x10f0('0xa')]=function(_0xc1e87,_0x54150f){return _0xc1e87[_0x10f0('0xb')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x10f0('0xc'),'fields':[_0x10f0('0xc')]},{'name':_0x10f0('0xd'),'fields':['body'],'type':_0x10f0('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x562ad8,_0x2c4a8e,_0x1bcf27){var _0x3978ce=_0xc1e87[_0x10f0('0xf')];var _0x5869fa=_0x562ad8[_0x10f0('0x10')]({'plain':!![]});if(_0x5869fa[_0x10f0('0x11')][_0x10f0('0x12')]()==='in'||_0x5869fa[_0x10f0('0x11')][_0x10f0('0x12')]()==='out'&&!_0x5869fa[_0x10f0('0x13')]&&!_[_0x10f0('0x14')](_0x5869fa[_0x10f0('0x15')])&&!_['isNil'](_0x5869fa[_0x10f0('0x16')])){_0x3978ce[_0x10f0('0x17')][_0x10f0('0x18')]({'where':{'id':_0x5869fa[_0x10f0('0x16')]}})[_0x10f0('0x19')](function(_0x3f3756){if(_0x3f3756){_0x3f3756[_0x10f0('0x1a')]({'lastMsgAt':_0x5869fa[_0x10f0('0x1b')],'lastMsgDirection':_0x5869fa[_0x10f0('0x11')][_0x10f0('0x12')]()});}})[_0x10f0('0x1c')](function(_0x3aae2c){console[_0x10f0('0x1d')](_0x3aae2c);});}if(_0x5869fa['direction']===_0x10f0('0x1e')&&!_0x5869fa['secret']){var _0x56a735;_0x3978ce['SmsAccount'][_0x10f0('0x1f')]({'where':{'id':_0x5869fa[_0x10f0('0x20')]},'raw':!![]})[_0x10f0('0x19')](function(_0x329c8d){_0x56a735=_0x329c8d;if(_0x56a735&&_0x56a735[_0x10f0('0x21')]){switch(_0x56a735[_0x10f0('0x21')]){case _0x10f0('0x22'):var _0x419e2d=require(_0x10f0('0x22'));if(_0x56a735['accountSid']&&_0x56a735[_0x10f0('0x23')]&&_0x56a735[_0x10f0('0x24')]){var _0x252bd2=new _0x419e2d(_0x56a735['accountSid'],_0x56a735[_0x10f0('0x23')]);_0x252bd2['messages'][_0x10f0('0x25')]({'body':_0x5869fa[_0x10f0('0x26')],'to':_0x5869fa[_0x10f0('0x24')],'from':_0x56a735[_0x10f0('0x24')],'statusCallback':_0x56a735[_0x10f0('0x27')]+_0x10f0('0x28')+_0x5869fa['id']+'/status?token='+_0x56a735[_0x10f0('0x29')]})[_0x10f0('0x19')](function(_0x8a98f){if(_0x8a98f['sid']){return _0x562ad8[_0x10f0('0x1a')]({'messageId':_0x8a98f[_0x10f0('0x2a')]});}})['catch'](function(_0x2649a1){logger[_0x10f0('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x10f0('0x2b'),_0x10f0('0x22'),util['inspect'](_0x2649a1,{'showHidden':![],'depth':null}));});}else{logger[_0x10f0('0x1d')](_0x10f0('0x2c'),_0x10f0('0x2b'),_0x10f0('0x22'),_0x10f0('0x2d'));}break;case _0x10f0('0x2e'):var _0x269041='https://api.skebby.it/API/v1.0/REST/';if(_0x56a735[_0x10f0('0x2f')]&&_0x56a735['password']){var _0x2b9bff={'recipient':[_0x5869fa['phone']],'message':_0x5869fa[_0x10f0('0x26')],'message_type':_0x56a735[_0x10f0('0x30')]};if(_0x56a735[_0x10f0('0x30')]&&_0x56a735[_0x10f0('0x30')]!=='SI'){_0x2b9bff[_0x10f0('0x31')]=_0x56a735[_0x10f0('0x24')];}var _0x3c0eed={'url':_0x269041+_0x10f0('0x32')+_0x56a735['username']+_0x10f0('0x33')+_0x56a735[_0x10f0('0x34')],'method':'GET'};rp(_0x3c0eed)[_0x10f0('0x19')](function(_0x160038){var _0x4418a4=_0x160038['split'](';');var _0x4e3739={'user_key':_0x4418a4[0x0],'session_key':_0x4418a4[0x1]};_0x3c0eed={'url':_0x269041+'sms','method':_0x10f0('0x35'),'headers':{'user_key':_0x4e3739[_0x10f0('0x36')],'Session_key':_0x4e3739['session_key']},'json':!![],'body':_0x2b9bff};return rp(_0x3c0eed);})[_0x10f0('0x19')](function(_0x47f5d9){if(_0x47f5d9[_0x10f0('0x37')]>=0x1){var _0x51dc76={'messageId':_0x47f5d9['internal_order_id']};if(_0x56a735['smsMethod']!=='GP'||!_0x56a735[_0x10f0('0x38')]){_0x51dc76[_0x10f0('0x39')]=!![];}return _0x562ad8['update'](_0x51dc76);}else{return logger['error'](_0x10f0('0x2c'),_0x10f0('0x2b'),_0x10f0('0x2e'),util[_0x10f0('0x3a')](_0x47f5d9,{'showHidden':![],'depth':null}));}})[_0x10f0('0x1c')](function(_0x3566a9){return logger[_0x10f0('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x10f0('0x2b'),_0x10f0('0x2e'),util[_0x10f0('0x3a')](_0x3566a9,{'showHidden':![],'depth':null}));});}else{logger[_0x10f0('0x1d')](_0x10f0('0x2c'),_0x10f0('0x2b'),_0x10f0('0x2e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x10f0('0x3b'):if(_0x56a735[_0x10f0('0x23')]){var _0x4097e0={'recipient':_0x5869fa[_0x10f0('0x24')],'message':_0x5869fa['body'],'sender':_0x56a735[_0x10f0('0x3c')]||_0x56a735[_0x10f0('0x24')],'authorization':_0x56a735['authToken']};var _0x2c4a8e={'method':_0x10f0('0x35'),'uri':_0x10f0('0x3d'),'body':_0x4097e0,'json':!![]};rp(_0x2c4a8e)[_0x10f0('0x19')](function(_0x229a53){var _0x4525ea={'messageId':_0x229a53['requestid']};if(!_0x56a735[_0x10f0('0x38')]){_0x4525ea[_0x10f0('0x39')]=!![];}return _0x562ad8[_0x10f0('0x1a')](_0x4525ea);})['catch'](function(_0x4ea14a){logger[_0x10f0('0x1d')](_0x10f0('0x2c'),'afterCreate','connectel',util[_0x10f0('0x3a')](_0x4ea14a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x10f0('0x2c'),_0x10f0('0x2b'),_0x10f0('0x3b'),_0x10f0('0x3e'));}break;case _0x10f0('0x3f'):if(_0x56a735[_0x10f0('0x2f')]&&_0x56a735[_0x10f0('0x34')]){var _0x4097e0={'messages':[{'source':_0x10f0('0x40'),'to':_0x5869fa[_0x10f0('0x24')],'body':_0x5869fa[_0x10f0('0x26')],'from':_0x56a735[_0x10f0('0x3c')]||_0x56a735[_0x10f0('0x24')]}]};var _0x45b3e4=util[_0x10f0('0x41')](_0x10f0('0x42'),_0x56a735['username'],_0x56a735[_0x10f0('0x34')]);var _0x2c4a8e={'method':_0x10f0('0x35'),'uri':_0x10f0('0x43'),'body':_0x4097e0,'headers':{'Authorization':util['format'](_0x10f0('0x44'),new Buffer(_0x45b3e4)[_0x10f0('0x45')](_0x10f0('0x46')))},'json':!![]};rp(_0x2c4a8e)[_0x10f0('0x19')](function(_0x57b4f3){if(_0x57b4f3[_0x10f0('0x47')]>=0xc8&&_0x57b4f3[_0x10f0('0x47')]<=0xce){if(_0x57b4f3[_0x10f0('0x48')]&&_0x57b4f3[_0x10f0('0x48')][_0x10f0('0x49')]>0x0){var _0x23b998=_['head'](_0x57b4f3[_0x10f0('0x48')][_0x10f0('0x4a')]);var _0x77fa9c={'messageId':_0x23b998[_0x10f0('0x4b')]};if(!_0x56a735[_0x10f0('0x38')]){_0x77fa9c[_0x10f0('0x39')]=!![];}return _0x562ad8[_0x10f0('0x1a')](_0x77fa9c);}else{logger[_0x10f0('0x1d')](_0x10f0('0x2c'),'afterCreate','clickSend',util[_0x10f0('0x3a')](_0x57b4f3,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x10f0('0x2c'),_0x10f0('0x2b'),_0x10f0('0x4c'),util[_0x10f0('0x3a')](_0x57b4f3,{'showHidden':![],'depth':null}));}})[_0x10f0('0x1c')](function(_0x1768b1){logger[_0x10f0('0x1d')](_0x10f0('0x2c'),_0x10f0('0x2b'),'clickSend',util[_0x10f0('0x3a')](_0x1768b1,{'showHidden':![],'depth':null}));});}else{logger[_0x10f0('0x1d')](_0x10f0('0x2c'),_0x10f0('0x2b'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x56a735[_0x10f0('0x4d')]&&_0x56a735[_0x10f0('0x23')]){var _0x4097e0={'dst':_0x5869fa['phone'],'text':_0x5869fa[_0x10f0('0x26')],'src':_0x56a735[_0x10f0('0x3c')]||_0x56a735[_0x10f0('0x24')],'url':_0x56a735[_0x10f0('0x27')]+_0x10f0('0x28')+_0x5869fa['id']+_0x10f0('0x4e')+_0x56a735['token']};var _0x45b3e4=util[_0x10f0('0x41')]('%s:%s',_0x56a735['authId'],_0x56a735[_0x10f0('0x23')]);var _0x2c4a8e={'method':_0x10f0('0x35'),'uri':util[_0x10f0('0x41')](_0x10f0('0x4f'),_0x56a735[_0x10f0('0x4d')]),'body':_0x4097e0,'headers':{'Authorization':util[_0x10f0('0x41')]('Basic\x20%s',new Buffer(_0x45b3e4)['toString'](_0x10f0('0x46')))},'json':!![]};rp(_0x2c4a8e)[_0x10f0('0x19')](function(_0x7494f5){var _0x329128={'messageId':_0x7494f5[_0x10f0('0x50')][0x0]};return _0x562ad8['update'](_0x329128);})['catch'](function(_0x54b57a){logger[_0x10f0('0x1d')](_0x10f0('0x2c'),_0x10f0('0x2b'),_0x10f0('0x51'),util[_0x10f0('0x3a')](_0x54b57a,{'showHidden':![],'depth':null}));});}else{logger[_0x10f0('0x1d')](_0x10f0('0x2c'),'afterCreate',_0x10f0('0x51'),_0x10f0('0x52'));}break;case'infobip':if(_0x56a735[_0x10f0('0x2f')]&&_0x56a735['password']){if(_0x56a735[_0x10f0('0x53')]){var _0x4bd68b={'method':_0x10f0('0x35'),'uri':_0x56a735[_0x10f0('0x53')]+_0x10f0('0x54'),'body':{'username':_0x56a735[_0x10f0('0x2f')],'password':_0x56a735[_0x10f0('0x34')]},'json':!![]};return rp(_0x4bd68b)[_0x10f0('0x19')](function(_0x449192){var _0x4a9dcb={'method':_0x10f0('0x35'),'uri':_0x56a735[_0x10f0('0x53')]+_0x10f0('0x55'),'body':{'messages':[{'from':_0x56a735[_0x10f0('0x24')],'destinations':[{'to':_0x5869fa[_0x10f0('0x24')]}],'text':_0x5869fa['body'],'notifyUrl':_0x56a735[_0x10f0('0x27')]+_0x10f0('0x28')+_0x5869fa['id']+'/status?token='+_0x56a735[_0x10f0('0x29')],'notifyContentType':_0x10f0('0x56'),'callbackData':_0x56a735[_0x10f0('0x24')]+';'+_0x5869fa[_0x10f0('0x26')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x449192[_0x10f0('0x29')]},'json':!![]};return rp(_0x4a9dcb)['then'](function(_0x51c05e){if(_0x51c05e[_0x10f0('0x4a')]){var _0xfa48ea={'messageId':_0x51c05e[_0x10f0('0x4a')][0x0][_0x10f0('0xc')]};if(!_0x56a735[_0x10f0('0x38')]){_0xfa48ea[_0x10f0('0x39')]=!![];}return _0x562ad8['update'](_0xfa48ea);}else{return logger[_0x10f0('0x1d')](_0x10f0('0x2c'),_0x10f0('0x2b'),_0x10f0('0x57'),util[_0x10f0('0x3a')](_0x51c05e,{'showHidden':![],'depth':null}));}});})[_0x10f0('0x1c')](function(_0x11ed2e){return logger[_0x10f0('0x1d')](_0x10f0('0x2c'),_0x10f0('0x2b'),'infobip',util[_0x10f0('0x3a')](_0x11ed2e,{'showHidden':![],'depth':null}));});}else{logger[_0x10f0('0x1d')](_0x10f0('0x2c'),_0x10f0('0x2b'),_0x10f0('0x57'),_0x10f0('0x58'));}}else{logger[_0x10f0('0x1d')](_0x10f0('0x2c'),_0x10f0('0x2b'),_0x10f0('0x57'),_0x10f0('0x59'));}break;case _0x10f0('0x5a'):var _0x1a6869=require(_0x10f0('0x5b'));if(_0x56a735[_0x10f0('0x5c')]){var _0x5bd5be={};_0x5bd5be[_0x10f0('0x5d')]=_0x56a735['username'];_0x5bd5be['phone']=_0x5869fa['phone'];_0x5bd5be[_0x10f0('0x31')]=_0x56a735[_0x10f0('0x24')];_0x5bd5be[_0x10f0('0x5e')]=_0x5869fa[_0x10f0('0x26')];_0x5bd5be['timestamp']=+new Date();var _0xe9e6a2='';var _0x4d3d1e='';var _0x4382ee=Object[_0x10f0('0x5f')](_0x5bd5be);_0x4382ee[_0x10f0('0x60')]();for(var _0x4290ea=0x0;_0x4290ea<_0x4382ee[_0x10f0('0x61')];_0x4290ea++){if(_0xe9e6a2!=''){_0xe9e6a2+='&';}_0xe9e6a2+=_0x4382ee[_0x4290ea]+'='+encodeURIComponent(_0x5bd5be[_0x4382ee[_0x4290ea]]);_0x4d3d1e+=_0x5bd5be[_0x4382ee[_0x4290ea]];}_0x4d3d1e+=_0x56a735[_0x10f0('0x5c')];_0x4d3d1e=_0x1a6869[_0x10f0('0x62')]('md5')[_0x10f0('0x1a')](_0x4d3d1e)[_0x10f0('0x63')]('hex');if(_0xe9e6a2!==''){_0xe9e6a2+='&';}_0xe9e6a2+='signature='+_0x4d3d1e;var _0x3c0eed={'method':'GET','uri':_0x56a735['baseUrl']+_0x10f0('0x64')+_0xe9e6a2,'json':!![]};return rp(_0x3c0eed)[_0x10f0('0x19')](function(_0x514019){var _0x42943d=Object[_0x10f0('0x5f')](_0x514019);if(_0x514019[_0x42943d[0x0]][_0x10f0('0x1d')]&&parseInt(_0x514019[_0x42943d[0x0]]['error'])===0x0){var _0x22a951={'messageId':_0x514019[_0x42943d[0x0]][_0x10f0('0x65')]};if(!_0x56a735['deliveryReport']){_0x22a951['read']=!![];}return _0x562ad8[_0x10f0('0x1a')](_0x22a951);}else{return logger[_0x10f0('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x10f0('0x5a'),util[_0x10f0('0x3a')](_0x514019[_0x10f0('0x1d')],{'showHidden':![],'depth':null}));}})[_0x10f0('0x1c')](function(_0x4c10e5){return logger[_0x10f0('0x1d')](_0x10f0('0x2c'),_0x10f0('0x2b'),_0x10f0('0x5a'),util[_0x10f0('0x3a')](_0x4c10e5,{'showHidden':![],'depth':null}));});}else{logger[_0x10f0('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x10f0('0x2b'),_0x10f0('0x5a'),_0x10f0('0x66'));}break;case _0x10f0('0x67'):if(_0x56a735[_0x10f0('0x5c')]){var _0x17b082={'method':_0x10f0('0x35'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x56a735['apiKey']},'body':{'content':_0x5869fa[_0x10f0('0x26')],'to':[_0x5869fa[_0x10f0('0x24')]],'from':_0x56a735[_0x10f0('0x24')],'binary':![],'clientMessageId':_0x10f0('0x68'),'charset':'UTF-8'},'json':!![]};rp(_0x17b082)[_0x10f0('0x19')](function(_0x4e41ac){if(!_0x4e41ac[_0x10f0('0x1d')]){var _0x4615f8={'messageId':_0x4e41ac[_0x10f0('0x4a')][0x0][_0x10f0('0x69')]};if(!_0x56a735[_0x10f0('0x38')]){_0x4615f8['read']=!![];}return _0x562ad8[_0x10f0('0x1a')](_0x4615f8);}else{return logger[_0x10f0('0x1d')](_0x10f0('0x2c'),_0x10f0('0x2b'),_0x10f0('0x67'),util[_0x10f0('0x3a')](_0x4e41ac[_0x10f0('0x1d')],{'showHidden':![],'depth':null}));}})[_0x10f0('0x1c')](function(_0x40115d){return logger[_0x10f0('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x10f0('0x2b'),_0x10f0('0x67'),util[_0x10f0('0x3a')](_0x40115d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x10f0('0x2c'),'afterCreate','clickatell',_0x10f0('0x66'));}break;case'bandwidth':if(_0x56a735[_0x10f0('0x2f')]&&_0x56a735['password']){var _0x45b3e4=util['format'](_0x10f0('0x42'),_0x56a735[_0x10f0('0x2f')],_0x56a735[_0x10f0('0x34')]);var _0x2c4a8e={'method':'POST','uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x56a735[_0x10f0('0x6a')]+_0x10f0('0x6b'),'body':{'to':[_0x5869fa[_0x10f0('0x24')]],'text':_0x5869fa['body'],'from':_0x56a735[_0x10f0('0x24')],'applicationId':_0x56a735[_0x10f0('0x6c')]},'headers':{'Authorization':util[_0x10f0('0x41')]('Basic\x20%s',new Buffer(_0x45b3e4)[_0x10f0('0x45')]('base64'))},'json':!![]};rp(_0x2c4a8e)['then'](function(_0x1707cd){if(_0x1707cd['id']){var _0x165304={'messageId':_0x1707cd['id']};return _0x562ad8[_0x10f0('0x1a')](_0x165304);}else{logger[_0x10f0('0x1d')](_0x10f0('0x2c'),_0x10f0('0x2b'),_0x10f0('0x6d'),util[_0x10f0('0x3a')](_0x1707cd,{'showHidden':![],'depth':null}));}})[_0x10f0('0x1c')](function(_0x1346f9){logger['error'](_0x10f0('0x2c'),_0x10f0('0x2b'),_0x10f0('0x6d'),util[_0x10f0('0x3a')](_0x1346f9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x10f0('0x2c'),_0x10f0('0x2b'),_0x10f0('0x6d'),_0x10f0('0x59'));}break;case _0x10f0('0x6e'):if(_0x56a735['apiKey']){var _0x425422={};var _0x3c0eed={'method':_0x10f0('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x56a735[_0x10f0('0x5c')],'Content-Type':_0x10f0('0x56')},'body':{'from':_0x56a735[_0x10f0('0x24')],'to':_0x5869fa['phone'],'text':_0x5869fa[_0x10f0('0x26')]},'json':!![]};return rp(_0x3c0eed)[_0x10f0('0x19')](function(_0x2865b4){if(_0x2865b4[_0x10f0('0x6f')]==0xca){_0x425422[_0x10f0('0x70')]=_0x2865b4;var _0x38d911={'method':_0x10f0('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x10f0('0x71')+_0x56a735['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x425422[_0x10f0('0x70')][_0x10f0('0x72')]},'json':!![]};return rp(_0x38d911)[_0x10f0('0x19')](function(_0x195df6){_0x425422['status']=_0x195df6;var _0xc977bd={'messageId':_0x425422[_0x10f0('0x70')][_0x10f0('0x72')],'read':!![]};return _0x562ad8[_0x10f0('0x1a')](_0xc977bd);});}else{return logger['error'](_0x10f0('0x2c'),'afterCreate',_0x10f0('0x6e'),util[_0x10f0('0x3a')](_0x2865b4,{'showHidden':![],'depth':null}));}})['catch'](function(_0x56d862){return logger[_0x10f0('0x1d')](_0x10f0('0x2c'),_0x10f0('0x2b'),'intelepeer',util[_0x10f0('0x3a')](_0x56d862,{'showHidden':![],'depth':null}));});}else{return logger[_0x10f0('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x10f0('0x2b'),_0x10f0('0x6e'),'Token\x20not\x20received');}break;}}})[_0x10f0('0x73')](function(){_0x1bcf27();});}else{_0x1bcf27();}}},'charset':_0x10f0('0x74'),'collate':_0x10f0('0x75')});};
\ No newline at end of file
index fcd43db..ef2ef5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf181=['SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','create','body','options','raw','CreateSmsMessage','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','defaults','socket.io-emitter','redis','./smsMessage.socket','register','request','then','info'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf181,0xef));var _0x1f18=function(_0x6f24f9,_0x14049c){_0x6f24f9=_0x6f24f9-0x0;var _0x3d36d7=_0xf181[_0x6f24f9];return _0x3d36d7;};'use strict';var _=require(_0x1f18('0x0'));var util=require(_0x1f18('0x1'));var moment=require('moment');var BPromise=require(_0x1f18('0x2'));var rs=require(_0x1f18('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f18('0x4'))['db'];var utils=require(_0x1f18('0x5'));var logger=require(_0x1f18('0x6'))(_0x1f18('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1f18('0x8')]['http']({'port':0x232a});config['redis']=_[_0x1f18('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1f18('0xa'))(new Redis(config[_0x1f18('0xb')]));require(_0x1f18('0xc'))[_0x1f18('0xd')](socket);function respondWithRpcPromise(_0x196882,_0x339c63,_0x27f82b){return new BPromise(function(_0x199baa,_0x1a3e78){return client[_0x1f18('0xe')](_0x196882,_0x27f82b)[_0x1f18('0xf')](function(_0x3fc8db){logger[_0x1f18('0x10')](_0x1f18('0x11'),_0x339c63,'request\x20sent');logger[_0x1f18('0x12')](_0x1f18('0x13'),_0x339c63,_0x1f18('0x14'),JSON['stringify'](_0x3fc8db));if(_0x3fc8db[_0x1f18('0x15')]){if(_0x3fc8db[_0x1f18('0x15')][_0x1f18('0x16')]===0x1f4){logger['error'](_0x1f18('0x11'),_0x339c63,_0x3fc8db['error'][_0x1f18('0x17')]);return _0x1a3e78(_0x3fc8db['error'][_0x1f18('0x17')]);}logger['error'](_0x1f18('0x11'),_0x339c63,_0x3fc8db[_0x1f18('0x15')][_0x1f18('0x17')]);return _0x199baa(_0x3fc8db[_0x1f18('0x15')][_0x1f18('0x17')]);}else{logger[_0x1f18('0x10')](_0x1f18('0x11'),_0x339c63,'request\x20sent');_0x199baa(_0x3fc8db[_0x1f18('0x18')]['message']);}})[_0x1f18('0x19')](function(_0x27ddb9){logger[_0x1f18('0x15')]('SmsMessage,\x20%s,\x20%s',_0x339c63,_0x27ddb9);_0x1a3e78(_0x27ddb9);});});}exports['CreateSmsMessage']=function(_0x5b248a){var _0x246b59=this;return new Promise(function(_0x37b6cc,_0xf0ba3){return db['SmsMessage'][_0x1f18('0x1a')](_0x5b248a[_0x1f18('0x1b')],{'raw':_0x5b248a[_0x1f18('0x1c')]?_0x5b248a[_0x1f18('0x1c')][_0x1f18('0x1d')]===undefined?!![]:![]:!![]})[_0x1f18('0xf')](function(_0x5c3c92){logger[_0x1f18('0x10')](_0x1f18('0x1e'),_0x5b248a);logger[_0x1f18('0x12')](_0x1f18('0x1e'),_0x5b248a,JSON[_0x1f18('0x1f')](_0x5c3c92));_0x37b6cc(_0x5c3c92);})['catch'](function(_0x347aa2){logger[_0x1f18('0x15')](_0x1f18('0x1e'),_0x347aa2['message'],_0x5b248a);_0xf0ba3(_0x246b59[_0x1f18('0x15')](0x1f4,_0x347aa2[_0x1f18('0x17')]));});});};
\ No newline at end of file
+var _0x842c=['then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSmsMessage','create','body','options','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','register'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x842c,0xa7));var _0xc842=function(_0x3cfc96,_0x37135c){_0x3cfc96=_0x3cfc96-0x0;var _0x3bfd1d=_0x842c[_0x3cfc96];return _0x3bfd1d;};'use strict';var _=require(_0xc842('0x0'));var util=require('util');var moment=require(_0xc842('0x1'));var BPromise=require(_0xc842('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc842('0x3'));var db=require(_0xc842('0x4'))['db'];var utils=require(_0xc842('0x5'));var logger=require('../../config/logger')(_0xc842('0x6'));var config=require(_0xc842('0x7'));var jayson=require(_0xc842('0x8'));var client=jayson['client'][_0xc842('0x9')]({'port':0x232a});config[_0xc842('0xa')]=_[_0xc842('0xb')](config[_0xc842('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc842('0xa')]));require('./smsMessage.socket')[_0xc842('0xc')](socket);function respondWithRpcPromise(_0xb84a51,_0x5ecd02,_0x1d1f0d){return new BPromise(function(_0x27a07e,_0xa18709){return client['request'](_0xb84a51,_0x1d1f0d)[_0xc842('0xd')](function(_0x400fc6){logger[_0xc842('0xe')](_0xc842('0xf'),_0x5ecd02,'request\x20sent');logger[_0xc842('0x10')](_0xc842('0x11'),_0x5ecd02,_0xc842('0x12'),JSON[_0xc842('0x13')](_0x400fc6));if(_0x400fc6[_0xc842('0x14')]){if(_0x400fc6['error'][_0xc842('0x15')]===0x1f4){logger[_0xc842('0x14')](_0xc842('0xf'),_0x5ecd02,_0x400fc6['error']['message']);return _0xa18709(_0x400fc6[_0xc842('0x14')]['message']);}logger[_0xc842('0x14')](_0xc842('0xf'),_0x5ecd02,_0x400fc6['error'][_0xc842('0x16')]);return _0x27a07e(_0x400fc6['error'][_0xc842('0x16')]);}else{logger[_0xc842('0xe')](_0xc842('0xf'),_0x5ecd02,_0xc842('0x12'));_0x27a07e(_0x400fc6[_0xc842('0x17')][_0xc842('0x16')]);}})[_0xc842('0x18')](function(_0x16364b){logger['error'](_0xc842('0xf'),_0x5ecd02,_0x16364b);_0xa18709(_0x16364b);});});}exports[_0xc842('0x19')]=function(_0x251373){var _0x292807=this;return new Promise(function(_0x3ab011,_0x5f58d9){return db['SmsMessage'][_0xc842('0x1a')](_0x251373[_0xc842('0x1b')],{'raw':_0x251373[_0xc842('0x1c')]?_0x251373[_0xc842('0x1c')][_0xc842('0x1d')]===undefined?!![]:![]:!![]})[_0xc842('0xd')](function(_0x1df1a2){logger[_0xc842('0xe')](_0xc842('0x19'),_0x251373);logger[_0xc842('0x10')](_0xc842('0x19'),_0x251373,JSON['stringify'](_0x1df1a2));_0x3ab011(_0x1df1a2);})[_0xc842('0x18')](function(_0x3a6f01){logger[_0xc842('0x14')](_0xc842('0x19'),_0x3a6f01[_0xc842('0x16')],_0x251373);_0x5f58d9(_0x292807[_0xc842('0x14')](0x1f4,_0x3a6f01[_0xc842('0x16')]));});});};
\ No newline at end of file
index 61e16ed..2091e79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb32=['save','emit','removeListener','register','length','./smsMessage.events'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xcb32,0x71));var _0x2cb3=function(_0x56ab57,_0x573a3a){_0x56ab57=_0x56ab57-0x0;var _0x2a9e97=_0xcb32[_0x56ab57];return _0x2a9e97;};'use strict';var SmsMessageEvents=require(_0x2cb3('0x0'));var events=[_0x2cb3('0x1'),'remove','update'];function createListener(_0x35a448,_0x1539ef){return function(_0x521f89){_0x1539ef[_0x2cb3('0x2')](_0x35a448,_0x521f89);};}function removeListener(_0x92f8b7,_0x1fe77b){return function(){SmsMessageEvents[_0x2cb3('0x3')](_0x92f8b7,_0x1fe77b);};}exports[_0x2cb3('0x4')]=function(_0xac451b){for(var _0x3ba738=0x0,_0x1a5135=events[_0x2cb3('0x5')];_0x3ba738<_0x1a5135;_0x3ba738++){var _0x28318c=events[_0x3ba738];var _0x14e67a=createListener('smsMessage:'+_0x28318c,_0xac451b);SmsMessageEvents['on'](_0x28318c,_0x14e67a);}};
\ No newline at end of file
+var _0x219b=['save','remove','update','emit','removeListener','./smsMessage.events'];(function(_0x3edefb,_0x27dad4){var _0x36204a=function(_0x42ec43){while(--_0x42ec43){_0x3edefb['push'](_0x3edefb['shift']());}};_0x36204a(++_0x27dad4);}(_0x219b,0x1c7));var _0xb219=function(_0x4b84a0,_0x22fc34){_0x4b84a0=_0x4b84a0-0x0;var _0x5bc6f4=_0x219b[_0x4b84a0];return _0x5bc6f4;};'use strict';var SmsMessageEvents=require(_0xb219('0x0'));var events=[_0xb219('0x1'),_0xb219('0x2'),_0xb219('0x3')];function createListener(_0x12e8e7,_0x79fc8b){return function(_0xe65431){_0x79fc8b[_0xb219('0x4')](_0x12e8e7,_0xe65431);};}function removeListener(_0x597a4d,_0x13118){return function(){SmsMessageEvents[_0xb219('0x5')](_0x597a4d,_0x13118);};}exports['register']=function(_0x3ff819){for(var _0x132773=0x0,_0x294fb7=events['length'];_0x132773<_0x294fb7;_0x132773++){var _0x42b5c9=events[_0x132773];var _0x312cde=createListener('smsMessage:'+_0x42b5c9,_0x3ff819);SmsMessageEvents['on'](_0x42b5c9,_0x312cde);}};
\ No newline at end of file
index 009b466..7560ff6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xceec=['getMembers','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','/:id/teams','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show'];(function(_0x8fea11,_0x2ff3a8){var _0x205c6a=function(_0x5a7fe3){while(--_0x5a7fe3){_0x8fea11['push'](_0x8fea11['shift']());}};_0x205c6a(++_0x2ff3a8);}(_0xceec,0x1be));var _0xccee=function(_0x3b9a37,_0x2adc5d){_0x3b9a37=_0x3b9a37-0x0;var _0x43f007=_0xceec[_0x3b9a37];return _0x43f007;};'use strict';var multer=require(_0xccee('0x0'));var util=require(_0xccee('0x1'));var path=require(_0xccee('0x2'));var timeout=require(_0xccee('0x3'));var express=require(_0xccee('0x4'));var router=express[_0xccee('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xccee('0x6'));var interaction=require(_0xccee('0x7'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router['get']('/',auth[_0xccee('0x8')](),controller[_0xccee('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xccee('0xa')](_0xccee('0xb'),auth[_0xccee('0x8')](),controller[_0xccee('0xc')]);router[_0xccee('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0xccee('0xd')]);router[_0xccee('0xa')]('/:id/teams',auth[_0xccee('0x8')](),controller[_0xccee('0xe')]);router[_0xccee('0xa')](_0xccee('0xf'),auth[_0xccee('0x8')](),controller['getAgents']);router[_0xccee('0x10')]('/',auth[_0xccee('0x8')](),controller[_0xccee('0x11')]);router[_0xccee('0x10')]('/:id/teams',auth[_0xccee('0x8')](),controller[_0xccee('0x12')]);router[_0xccee('0x10')](_0xccee('0xf'),auth[_0xccee('0x8')](),controller[_0xccee('0x13')]);router[_0xccee('0x14')](_0xccee('0xb'),auth[_0xccee('0x8')](),controller[_0xccee('0x15')]);router[_0xccee('0x16')](_0xccee('0xb'),auth[_0xccee('0x8')](),controller[_0xccee('0x17')]);router[_0xccee('0x16')](_0xccee('0x18'),auth[_0xccee('0x8')](),controller[_0xccee('0x19')]);router[_0xccee('0x16')](_0xccee('0xf'),auth[_0xccee('0x8')](),controller[_0xccee('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x7992=['/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0xeea763,_0x2a125a){var _0x236d62=function(_0xbcc007){while(--_0xbcc007){_0xeea763['push'](_0xeea763['shift']());}};_0x236d62(++_0x2a125a);}(_0x7992,0x125));var _0x2799=function(_0x3f25db,_0x1d3686){_0x3f25db=_0x3f25db-0x0;var _0x54f29d=_0x7992[_0x3f25db];return _0x54f29d;};'use strict';var multer=require(_0x2799('0x0'));var util=require(_0x2799('0x1'));var path=require(_0x2799('0x2'));var timeout=require(_0x2799('0x3'));var express=require('express');var router=express[_0x2799('0x4')]();var fs_extra=require(_0x2799('0x5'));var auth=require(_0x2799('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2799('0x7'));var controller=require('./smsQueue.controller');router[_0x2799('0x8')]('/',auth[_0x2799('0x9')](),controller[_0x2799('0xa')]);router[_0x2799('0x8')](_0x2799('0xb'),auth['isAuthenticated'](),controller[_0x2799('0xc')]);router[_0x2799('0x8')](_0x2799('0xd'),auth[_0x2799('0x9')](),controller[_0x2799('0xe')]);router[_0x2799('0x8')](_0x2799('0xf'),auth[_0x2799('0x9')](),controller['getMembers']);router[_0x2799('0x8')](_0x2799('0x10'),auth[_0x2799('0x9')](),controller[_0x2799('0x11')]);router[_0x2799('0x8')](_0x2799('0x12'),auth[_0x2799('0x9')](),controller[_0x2799('0x13')]);router[_0x2799('0x14')]('/',auth[_0x2799('0x9')](),controller[_0x2799('0x15')]);router[_0x2799('0x14')](_0x2799('0x10'),auth[_0x2799('0x9')](),controller[_0x2799('0x16')]);router[_0x2799('0x14')]('/:id/users',auth[_0x2799('0x9')](),controller['addAgents']);router[_0x2799('0x17')](_0x2799('0xd'),auth[_0x2799('0x9')](),controller['update']);router[_0x2799('0x18')](_0x2799('0xd'),auth[_0x2799('0x9')](),controller[_0x2799('0x19')]);router[_0x2799('0x18')](_0x2799('0x10'),auth[_0x2799('0x9')](),controller[_0x2799('0x1a')]);router['delete'](_0x2799('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x2799('0x1b')]=router;
\ No newline at end of file
index d550c84..fa02c0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d23=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x3347a4,_0x37d258){var _0x5c39be=function(_0xe17366){while(--_0xe17366){_0x3347a4['push'](_0x3347a4['shift']());}};_0x5c39be(++_0x37d258);}(_0x8d23,0x178));var _0x38d2=function(_0x33b1c4,_0x504410){_0x33b1c4=_0x33b1c4-0x0;var _0x5901df=_0x8d23[_0x33b1c4];return _0x5901df;};'use strict';var Sequelize=require(_0x38d2('0x0'));module[_0x38d2('0x1')]={'name':{'type':Sequelize[_0x38d2('0x2')],'unique':_0x38d2('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x38d2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x38d2('0x5')](_0x38d2('0x6'),'beepall',_0x38d2('0x7'))}};
\ No newline at end of file
+var _0x1783=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x29bbe2,_0x1b8a6d){var _0x2fe7d0=function(_0x2ca521){while(--_0x2ca521){_0x29bbe2['push'](_0x29bbe2['shift']());}};_0x2fe7d0(++_0x1b8a6d);}(_0x1783,0xe1));var _0x3178=function(_0x38e401,_0x6b1e8a){_0x38e401=_0x38e401-0x0;var _0x56acdf=_0x1783[_0x38e401];return _0x56acdf;};'use strict';var Sequelize=require(_0x3178('0x0'));module[_0x3178('0x1')]={'name':{'type':Sequelize[_0x3178('0x2')],'unique':_0x3178('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3178('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3178('0x4')](_0x3178('0x5'),_0x3178('0x6'),_0x3178('0x7'))}};
\ No newline at end of file
index afff5d0..c138f90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52c3=['TeamId','includes','all','union','isEmpty','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','SmsQueue','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','length','nolimit','order','where','pick','filter','merge','map','VIRTUAL','options','findAll','rows','catch','show','params','keys','fields','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','sort','SmsQueueId','User','UserId','smsPause','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','hasOwnProperty','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','UserSmsQueue','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','ids','field','tq.TeamId','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x52c3,0x94));var _0x352c=function(_0x1778e1,_0x3e1727){_0x1778e1=_0x1778e1-0x0;var _0x2bc4c6=_0x52c3[_0x1778e1];return _0x2bc4c6;};'use strict';var emlformat=require(_0x352c('0x0'));var rimraf=require(_0x352c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x352c('0x2'));var rp=require(_0x352c('0x3'));var moment=require(_0x352c('0x4'));var BPromise=require(_0x352c('0x5'));var Mustache=require('mustache');var util=require(_0x352c('0x6'));var path=require(_0x352c('0x7'));var sox=require(_0x352c('0x8'));var csv=require(_0x352c('0x9'));var ejs=require(_0x352c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x352c('0xb'));var squel=require(_0x352c('0xc'));var crypto=require(_0x352c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x352c('0xe'));var toCsv=require(_0x352c('0x9'));var querystring=require(_0x352c('0xf'));var Papa=require(_0x352c('0x10'));var Redis=require(_0x352c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x352c('0x12'));var as=require(_0x352c('0x13'));var hardwareService=require(_0x352c('0x14'));var logger=require(_0x352c('0x15'))(_0x352c('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x352c('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x352c('0x18'))(new Redis(config['redis']));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x49f1f7,_0x335e82){_0x335e82=_0x335e82||0xcc;return function(_0x329bf0){if(_0x329bf0){return _0x49f1f7[_0x352c('0x19')](_0x335e82);}return _0x49f1f7['status'](_0x335e82)[_0x352c('0x1a')]();};}function respondWithResult(_0x4b826b,_0x262be5){_0x262be5=_0x262be5||0xc8;return function(_0xf6863a){if(_0xf6863a){return _0x4b826b[_0x352c('0x1b')](_0x262be5)['json'](_0xf6863a);}};}function respondWithFilteredResult(_0x51136e,_0x576b82){return function(_0x4c5196){if(_0x4c5196){var _0x2189c3=typeof _0x576b82[_0x352c('0x1c')]===_0x352c('0x1d')&&typeof _0x576b82[_0x352c('0x1e')]===_0x352c('0x1d');var _0x4f5c9c=_0x4c5196[_0x352c('0x1f')];var _0x46debc=_0x2189c3?0x0:_0x576b82[_0x352c('0x1c')];var _0x2cd6de=_0x2189c3?_0x4c5196[_0x352c('0x1f')]:_0x576b82[_0x352c('0x1c')]+_0x576b82[_0x352c('0x1e')];var _0x4b3047;if(_0x2cd6de>=_0x4f5c9c){_0x2cd6de=_0x4f5c9c;_0x4b3047=0xc8;}else{_0x4b3047=0xce;}_0x51136e[_0x352c('0x1b')](_0x4b3047);return _0x51136e[_0x352c('0x20')]('Content-Range',_0x46debc+'-'+_0x2cd6de+'/'+_0x4f5c9c)[_0x352c('0x21')](_0x4c5196);}return null;};}function patchUpdates(_0x5652fd){return function(_0x54aa8a){try{jsonpatch[_0x352c('0x22')](_0x54aa8a,_0x5652fd,!![]);}catch(_0x22a1e9){return BPromise[_0x352c('0x23')](_0x22a1e9);}return _0x54aa8a[_0x352c('0x24')]();};}function saveUpdates(_0x3a4d56,_0x3efd04){return function(_0x2fabd9){if(_0x2fabd9){return _0x2fabd9[_0x352c('0x25')](_0x3a4d56)[_0x352c('0x26')](function(_0x2e08d6){return _0x2e08d6;});}return null;};}function removeEntity(_0x3a6935,_0x29229e){return function(_0x5bdd52){if(_0x5bdd52){return _0x5bdd52['destroy']()[_0x352c('0x26')](function(){var _0x400f09=_0x5bdd52[_0x352c('0x27')]({'plain':!![]});var _0x593d9c='SmsQueues';return db[_0x352c('0x28')][_0x352c('0x29')]({'where':{'type':_0x593d9c,'resourceId':_0x400f09['id']}})[_0x352c('0x26')](function(){return _0x5bdd52;});})[_0x352c('0x26')](function(){_0x3a6935['status'](0xcc)[_0x352c('0x1a')]();});}};}function handleEntityNotFound(_0x1f86df,_0xb63318){return function(_0x53ea8c){if(!_0x53ea8c){_0x1f86df[_0x352c('0x19')](0x194);}return _0x53ea8c;};}function handleError(_0x1711ee,_0x2a8054){_0x2a8054=_0x2a8054||0x1f4;return function(_0x570953){logger[_0x352c('0x2a')](_0x570953[_0x352c('0x2b')]);if(_0x570953[_0x352c('0x2c')]){delete _0x570953[_0x352c('0x2c')];}_0x1711ee[_0x352c('0x1b')](_0x2a8054)['send'](_0x570953);};}exports[_0x352c('0x2d')]=function(_0x2bdb85,_0x432795){var _0x30e68a={},_0xbccbbf={},_0xd2356f={'count':0x0,'rows':[]};var _0x451864=_['map'](db[_0x352c('0x2e')][_0x352c('0x2f')],function(_0xa1e21e){return{'name':_0xa1e21e[_0x352c('0x30')],'type':_0xa1e21e[_0x352c('0x31')]['key']};});_0xbccbbf[_0x352c('0x32')]=_['map'](_0x451864,'name');_0xbccbbf[_0x352c('0x33')]=_['keys'](_0x2bdb85['query']);_0xbccbbf[_0x352c('0x34')]=_['intersection'](_0xbccbbf[_0x352c('0x32')],_0xbccbbf['query']);_0x30e68a[_0x352c('0x35')]=_[_0x352c('0x36')](_0xbccbbf[_0x352c('0x32')],qs['fields'](_0x2bdb85['query']['fields']));_0x30e68a[_0x352c('0x35')]=_0x30e68a[_0x352c('0x35')][_0x352c('0x37')]?_0x30e68a[_0x352c('0x35')]:_0xbccbbf[_0x352c('0x32')];if(!_0x2bdb85[_0x352c('0x33')]['hasOwnProperty'](_0x352c('0x38'))){_0x30e68a['limit']=qs['limit'](_0x2bdb85[_0x352c('0x33')]['limit']);_0x30e68a['offset']=qs[_0x352c('0x1c')](_0x2bdb85[_0x352c('0x33')][_0x352c('0x1c')]);}_0x30e68a[_0x352c('0x39')]=qs['sort'](_0x2bdb85[_0x352c('0x33')]['sort']);_0x30e68a[_0x352c('0x3a')]=qs[_0x352c('0x34')](_[_0x352c('0x3b')](_0x2bdb85[_0x352c('0x33')],_0xbccbbf[_0x352c('0x34')]),_0x451864);if(_0x2bdb85[_0x352c('0x33')][_0x352c('0x3c')]){_0x30e68a[_0x352c('0x3a')]=_[_0x352c('0x3d')](_0x30e68a[_0x352c('0x3a')],{'$or':_[_0x352c('0x3e')](_0x451864,function(_0x35a0ef){if(_0x35a0ef[_0x352c('0x31')]!==_0x352c('0x3f')){var _0x4ddea6={};_0x4ddea6[_0x35a0ef[_0x352c('0x2c')]]={'$like':'%'+_0x2bdb85[_0x352c('0x33')][_0x352c('0x3c')]+'%'};return _0x4ddea6;}})});}_0x30e68a=_[_0x352c('0x3d')]({},_0x30e68a,_0x2bdb85[_0x352c('0x40')]);var _0x44e70c={'where':_0x30e68a[_0x352c('0x3a')]};return db['SmsQueue'][_0x352c('0x1f')](_0x44e70c)['then'](function(_0x5dced8){_0xd2356f[_0x352c('0x1f')]=_0x5dced8;if(_0x2bdb85[_0x352c('0x33')]['includeAll']){_0x30e68a['include']=[{'all':!![]}];}return db[_0x352c('0x2e')][_0x352c('0x41')](_0x30e68a);})[_0x352c('0x26')](function(_0x2a27dd){_0xd2356f[_0x352c('0x42')]=_0x2a27dd;return _0xd2356f;})[_0x352c('0x26')](respondWithFilteredResult(_0x432795,_0x30e68a))[_0x352c('0x43')](handleError(_0x432795,null));};exports[_0x352c('0x44')]=function(_0x1b2397,_0x5281d6){var _0x1fe1b0={'raw':!![],'where':{'id':_0x1b2397[_0x352c('0x45')]['id']}},_0x980732={};_0x980732[_0x352c('0x32')]=_[_0x352c('0x46')](db['SmsQueue'][_0x352c('0x2f')]);_0x980732[_0x352c('0x33')]=_['keys'](_0x1b2397[_0x352c('0x33')]);_0x980732[_0x352c('0x34')]=_[_0x352c('0x36')](_0x980732[_0x352c('0x32')],_0x980732[_0x352c('0x33')]);_0x1fe1b0['attributes']=_[_0x352c('0x36')](_0x980732[_0x352c('0x32')],qs[_0x352c('0x47')](_0x1b2397[_0x352c('0x33')]['fields']));_0x1fe1b0[_0x352c('0x35')]=_0x1fe1b0['attributes'][_0x352c('0x37')]?_0x1fe1b0[_0x352c('0x35')]:_0x980732[_0x352c('0x32')];if(_0x1b2397[_0x352c('0x33')][_0x352c('0x48')]){_0x1fe1b0[_0x352c('0x49')]=[{'all':!![]}];}_0x1fe1b0=_[_0x352c('0x3d')]({},_0x1fe1b0,_0x1b2397[_0x352c('0x40')]);return db[_0x352c('0x2e')]['find'](_0x1fe1b0)[_0x352c('0x26')](handleEntityNotFound(_0x5281d6,null))[_0x352c('0x26')](respondWithResult(_0x5281d6,null))[_0x352c('0x43')](handleError(_0x5281d6,null));};exports[_0x352c('0x4a')]=function(_0x2739c6,_0x17025e){return db[_0x352c('0x2e')][_0x352c('0x4a')](_0x2739c6[_0x352c('0x4b')],{})[_0x352c('0x26')](function(_0x1e6d40){var _0x17d0a3=_0x2739c6[_0x352c('0x4c')][_0x352c('0x27')]({'plain':!![]});if(!_0x17d0a3)throw new Error(_0x352c('0x4d'));if(_0x17d0a3[_0x352c('0x4e')]===_0x352c('0x4c')){var _0x44c227=_0x1e6d40[_0x352c('0x27')]({'plain':!![]});var _0x491c5d=_0x352c('0x4f');return db[_0x352c('0x50')][_0x352c('0x51')]({'where':{'name':_0x491c5d,'userProfileId':_0x17d0a3['userProfileId']},'raw':!![]})['then'](function(_0x210fd3){if(_0x210fd3&&_0x210fd3[_0x352c('0x52')]===0x0){return db[_0x352c('0x28')][_0x352c('0x4a')]({'name':_0x44c227[_0x352c('0x2c')],'resourceId':_0x44c227['id'],'type':_0x210fd3['name'],'sectionId':_0x210fd3['id']},{})[_0x352c('0x26')](function(){return _0x1e6d40;});}else{return _0x1e6d40;}})[_0x352c('0x43')](function(_0x1a8c1f){logger['error'](_0x352c('0x53'),_0x1a8c1f);throw _0x1a8c1f;});}return _0x1e6d40;})[_0x352c('0x26')](respondWithResult(_0x17025e,0xc9))[_0x352c('0x43')](handleError(_0x17025e,null));};exports['update']=function(_0x94760f,_0x2a3d7a){if(_0x94760f[_0x352c('0x4b')]['id']){delete _0x94760f[_0x352c('0x4b')]['id'];}return db[_0x352c('0x2e')][_0x352c('0x51')]({'where':{'id':_0x94760f['params']['id']}})[_0x352c('0x26')](handleEntityNotFound(_0x2a3d7a,null))[_0x352c('0x26')](saveUpdates(_0x94760f[_0x352c('0x4b')],null))['then'](respondWithResult(_0x2a3d7a,null))[_0x352c('0x43')](handleError(_0x2a3d7a,null));};exports['destroy']=function(_0x320c7f,_0x193879){return db[_0x352c('0x2e')][_0x352c('0x51')]({'where':{'id':_0x320c7f[_0x352c('0x45')]['id']}})['then'](handleEntityNotFound(_0x193879,null))['then'](removeEntity(_0x193879,null))[_0x352c('0x43')](handleError(_0x193879,null));};exports[_0x352c('0x54')]=function(_0x4d7f30,_0x35a112){return db[_0x352c('0x2e')][_0x352c('0x54')]()[_0x352c('0x26')](respondWithResult(_0x35a112,null))['catch'](handleError(_0x35a112,null));};exports['getMembers']=function(_0x24b6d0,_0x3ba728,_0x3ea504){var _0x203e47={'raw':!![],'where':{}},_0x182f83={},_0x564275;return db[_0x352c('0x2e')]['findOne']({'where':{'id':_0x24b6d0[_0x352c('0x45')]['id']}})[_0x352c('0x26')](handleEntityNotFound(_0x3ba728,null))[_0x352c('0x26')](function(_0x25b6aa){if(_0x25b6aa){_0x564275=_0x25b6aa[_0x352c('0x27')]({'plain':!![]});_0x182f83['model']=_['keys'](db['UserSmsQueue'][_0x352c('0x2f')]);_0x182f83[_0x352c('0x33')]=_[_0x352c('0x46')](_0x24b6d0[_0x352c('0x33')]);_0x182f83[_0x352c('0x34')]=_[_0x352c('0x36')](_0x182f83[_0x352c('0x32')],_0x182f83['query']);_0x203e47[_0x352c('0x35')]=_['intersection'](_0x182f83[_0x352c('0x32')],qs[_0x352c('0x47')](_0x24b6d0[_0x352c('0x33')]['fields']));_0x203e47[_0x352c('0x35')]=_0x203e47[_0x352c('0x35')][_0x352c('0x37')]?_0x203e47[_0x352c('0x35')]:_0x182f83[_0x352c('0x32')];if(!_0x24b6d0[_0x352c('0x33')]['hasOwnProperty'](_0x352c('0x38'))){_0x203e47[_0x352c('0x1e')]=qs['limit'](_0x24b6d0['query'][_0x352c('0x1e')]);_0x203e47[_0x352c('0x1c')]=qs[_0x352c('0x1c')](_0x24b6d0['query']['offset']);}_0x203e47[_0x352c('0x39')]=qs[_0x352c('0x55')](_0x24b6d0[_0x352c('0x33')][_0x352c('0x55')]);_0x203e47['where']=qs[_0x352c('0x34')](_[_0x352c('0x3b')](_0x24b6d0[_0x352c('0x33')],_0x182f83[_0x352c('0x34')]));_0x203e47[_0x352c('0x3a')][_0x352c('0x56')]=_0x25b6aa['id'];if(_0x24b6d0[_0x352c('0x33')][_0x352c('0x3c')]){_0x203e47['where']=_[_0x352c('0x3d')](_0x203e47['where'],{'$or':_['map'](_0x203e47[_0x352c('0x35')],function(_0x17aa1c){var _0x19262b={};_0x19262b[_0x17aa1c]={'$like':'%'+_0x24b6d0[_0x352c('0x33')][_0x352c('0x3c')]+'%'};return _0x19262b;})});}_0x203e47=_[_0x352c('0x3d')]({},_0x203e47,_0x24b6d0[_0x352c('0x40')]);return db['UserSmsQueue'][_0x352c('0x41')](_0x203e47);}})[_0x352c('0x26')](function(_0x48b0be){if(_0x48b0be){return db[_0x352c('0x57')]['findAndCountAll']({'where':{'id':_[_0x352c('0x3e')](_0x48b0be,_0x352c('0x58')),'role':'agent'},'attributes':['id','name',_0x352c('0x59'),'updatedAt',_0x352c('0x5a')]});}})['then'](function(_0x5eb220){if(_0x5eb220){return{'count':_0x5eb220[_0x352c('0x1f')],'rows':_[_0x352c('0x3e')](_0x5eb220[_0x352c('0x42')],function(_0x205cc7){return{'membername':_0x205cc7[_0x352c('0x2c')],'UserId':_0x205cc7['id'],'queue_name':_0x564275[_0x352c('0x2c')],'SmsQueueId':_0x564275['id'],'interface':util[_0x352c('0x5b')](_0x352c('0x5c'),_0x352c('0x5d'),_0x205cc7[_0x352c('0x2c')]),'penalty':0x0,'paused':_0x205cc7[_0x352c('0x59')],'createdAt':_0x205cc7['createdAt'],'updatedAt':_0x205cc7['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x352c('0x26')](respondWithFilteredResult(_0x3ba728,_0x203e47))['catch'](handleError(_0x3ba728,null));};exports[_0x352c('0x5e')]=function(_0x553857,_0x30653e,_0x21c161){var _0x9f03f4={};var _0x236418={};var _0x9719bf;var _0x5c198e;return db[_0x352c('0x2e')][_0x352c('0x5f')]({'where':{'id':_0x553857[_0x352c('0x45')]['id']}})[_0x352c('0x26')](handleEntityNotFound(_0x30653e,null))[_0x352c('0x26')](function(_0x36be87){if(_0x36be87){_0x9719bf=_0x36be87;_0x236418[_0x352c('0x32')]=_[_0x352c('0x46')](db[_0x352c('0x60')][_0x352c('0x2f')]);_0x236418[_0x352c('0x33')]=_['keys'](_0x553857['query']);_0x236418['filters']=_[_0x352c('0x36')](_0x236418[_0x352c('0x32')],_0x236418[_0x352c('0x33')]);_0x9f03f4[_0x352c('0x35')]=_[_0x352c('0x36')](_0x236418[_0x352c('0x32')],qs[_0x352c('0x47')](_0x553857[_0x352c('0x33')]['fields']));_0x9f03f4[_0x352c('0x35')]=_0x9f03f4['attributes']['length']?_0x9f03f4[_0x352c('0x35')]:_0x236418[_0x352c('0x32')];_0x9f03f4[_0x352c('0x39')]=qs[_0x352c('0x55')](_0x553857['query'][_0x352c('0x55')]);_0x9f03f4[_0x352c('0x3a')]=qs['filters'](_['pick'](_0x553857[_0x352c('0x33')],_0x236418[_0x352c('0x34')]));if(_0x553857[_0x352c('0x33')][_0x352c('0x3c')]){_0x9f03f4[_0x352c('0x3a')]=_[_0x352c('0x3d')](_0x9f03f4['where'],{'$or':_[_0x352c('0x3e')](_0x9f03f4[_0x352c('0x35')],function(_0x4e0e05){var _0x3cbca2={};_0x3cbca2[_0x4e0e05]={'$like':'%'+_0x553857['query']['filter']+'%'};return _0x3cbca2;})});}_0x9f03f4=_[_0x352c('0x3d')]({},_0x9f03f4,_0x553857[_0x352c('0x40')]);return _0x9719bf[_0x352c('0x5e')](_0x9f03f4);}})['then'](function(_0x25b0c2){if(_0x25b0c2){_0x5c198e=_0x25b0c2[_0x352c('0x37')];if(!_0x553857[_0x352c('0x33')][_0x352c('0x61')]('nolimit')){_0x9f03f4[_0x352c('0x1e')]=qs[_0x352c('0x1e')](_0x553857[_0x352c('0x33')][_0x352c('0x1e')]);_0x9f03f4['offset']=qs[_0x352c('0x1c')](_0x553857[_0x352c('0x33')][_0x352c('0x1c')]);}return _0x9719bf['getTeams'](_0x9f03f4);}})['then'](function(_0x3699dc){if(_0x3699dc){return _0x3699dc?{'count':_0x5c198e,'rows':_0x3699dc}:null;}})['then'](respondWithResult(_0x30653e,null))['catch'](handleError(_0x30653e,null));};exports[_0x352c('0x62')]=function(_0x1a6f36,_0x3ce640,_0x17fb55){var _0x4b6ceb=_0x1a6f36['body']['ids'];return db[_0x352c('0x60')]['findAll']({'where':{'id':_0x4b6ceb},'attributes':['id'],'include':[{'model':db[_0x352c('0x57')],'as':_0x352c('0x63'),'attributes':['id',_0x352c('0x2c'),_0x352c('0x64'),_0x352c('0x65'),_0x352c('0x66')],'raw':!![]}]})['then'](function(_0x55b287){if(_0x55b287){var _0x38d950=_[_0x352c('0x67')](_0x55b287,function(_0x702d98){var _0x1f66d6=_0x702d98[_0x352c('0x27')]({'plain':!![]});return _0x1f66d6['Agents'];});return db['SmsQueue']['find']({'where':{'id':_0x1a6f36[_0x352c('0x45')]['id']}})['then'](function(_0x11921b){return db[_0x352c('0x68')][_0x352c('0x69')](function(_0x900c72){return _0x11921b[_0x352c('0x62')](_0x4b6ceb,{'transaction':_0x900c72})[_0x352c('0x26')](function(){return BPromise['each'](_0x38d950,function(_0x1d715e){return db[_0x352c('0x6a')][_0x352c('0x6b')]({'where':{'UserId':_0x1d715e['id'],'SmsQueueId':_0x1a6f36[_0x352c('0x45')]['id']},'transaction':_0x900c72});});})[_0x352c('0x26')](function(){_0x38d950[_0x352c('0x6c')](function(_0x582394){socket[_0x352c('0x6d')](_0x352c('0x6e'),{'UserId':_0x582394['id'],'SmsQueueId':_0x11921b['id']});});});});});}})[_0x352c('0x26')](respondWithStatusCode(_0x3ce640,null))[_0x352c('0x43')](handleError(_0x3ce640,null));};exports[_0x352c('0x6f')]=function(_0x47695f,_0x39594e,_0x48c58a){return db[_0x352c('0x60')][_0x352c('0x41')]({'where':{'id':_0x47695f[_0x352c('0x33')][_0x352c('0x70')]},'attributes':['id'],'include':[{'model':db[_0x352c('0x57')],'as':_0x352c('0x63'),'attributes':['id'],'raw':!![]}]})[_0x352c('0x26')](handleEntityNotFound(_0x39594e,null))[_0x352c('0x26')](function(_0x515681){var _0x5e6e93=_[_0x352c('0x3e')](_0x515681,'id');var _0x357002=[];var _0x1e3709=[];var _0x372a8c=squel['select']();_0x372a8c[_0x352c('0x71')](_0x352c('0x72'))['from'](_0x352c('0x73'),'tq')[_0x352c('0x74')]('user_has_teams','ut',_0x352c('0x75'))[_0x352c('0x3a')](_0x352c('0x76'),_0x47695f[_0x352c('0x45')]['id']);for(var _0x3eb59=0x0;_0x3eb59<_0x515681[_0x352c('0x37')];_0x3eb59+=0x1){let _0x565d9f=_0x515681[_0x3eb59];for(var _0x3f46c3=0x0;_0x3f46c3<_0x565d9f[_0x352c('0x63')][_0x352c('0x37')];_0x3f46c3+=0x1){let _0x2e4dcb=_0x565d9f['Agents'][_0x3f46c3];var _0x332120=_0x372a8c[_0x352c('0x77')]();_0x332120['where'](_0x352c('0x78'),_0x2e4dcb['id']);_0x1e3709['push'](db[_0x352c('0x68')][_0x352c('0x33')](_0x332120[_0x352c('0x79')](),{'type':db[_0x352c('0x68')][_0x352c('0x7a')][_0x352c('0x7b')]})[_0x352c('0x26')](function(_0xd89864){if(_0xd89864[_0x352c('0x37')]===0x1){return _0x2e4dcb['id'];}else{var _0x3a2676=_['every'](_[_0x352c('0x3e')](_0xd89864,_0x352c('0x7c')),function(_0x3727ff){return _[_0x352c('0x7d')](_0x5e6e93,_0x3727ff);});if(_0x3a2676){return _0x2e4dcb['id'];}}}));}}return BPromise[_0x352c('0x7e')](_0x1e3709)[_0x352c('0x26')](function(_0x1ea250){_0x357002=_(_0x357002)[_0x352c('0x7f')](_0x1ea250)['compact']()['value']();return db['SmsQueue'][_0x352c('0x51')]({'where':{'id':_0x47695f[_0x352c('0x45')]['id']}})[_0x352c('0x26')](function(_0x3e279e){return db[_0x352c('0x68')][_0x352c('0x69')](function(_0x37c91f){return _0x3e279e[_0x352c('0x6f')](_0x47695f['query']['ids'],{'transaction':_0x37c91f})[_0x352c('0x26')](function(){if(!_[_0x352c('0x80')](_0x357002)){return _0x3e279e['removeAgents'](_0x357002,{'transaction':_0x37c91f});}})[_0x352c('0x26')](function(){_0x357002[_0x352c('0x6c')](function(_0x35e1f2){socket[_0x352c('0x6d')](_0x352c('0x81'),{'UserId':_0x35e1f2,'SmsQueueId':_0x3e279e['id']});});});});});});})[_0x352c('0x26')](respondWithStatusCode(_0x39594e,null))[_0x352c('0x43')](handleError(_0x39594e,null));};exports[_0x352c('0x82')]=function(_0x2876e8,_0x11451a,_0x563f67){return db[_0x352c('0x2e')][_0x352c('0x51')]({'where':{'id':_0x2876e8[_0x352c('0x45')]['id']}})['then'](handleEntityNotFound(_0x11451a,null))[_0x352c('0x26')](function(_0xd8d4af){if(_0xd8d4af){return _0xd8d4af[_0x352c('0x82')](_0x2876e8[_0x352c('0x4b')][_0x352c('0x70')],_[_0x352c('0x83')](_0x2876e8[_0x352c('0x4b')],['ids','id'])||{})[_0x352c('0x84')](function(_0x1eb914){for(var _0x5271aa=0x0;_0x5271aa<_0x2876e8['body'][_0x352c('0x70')][_0x352c('0x37')];_0x5271aa+=0x1){socket[_0x352c('0x6d')](_0x352c('0x6e'),{'UserId':Number(_0x2876e8['body'][_0x352c('0x70')][_0x5271aa]),'SmsQueueId':Number(_0x2876e8['params']['id'])});}return _0x1eb914;});}})[_0x352c('0x26')](respondWithResult(_0x11451a,null))[_0x352c('0x43')](handleError(_0x11451a,null));};exports[_0x352c('0x85')]=function(_0x5dd514,_0x140b11,_0x560eb4){return db[_0x352c('0x2e')]['find']({'where':{'id':_0x5dd514['params']['id']}})[_0x352c('0x26')](handleEntityNotFound(_0x140b11,null))[_0x352c('0x26')](function(_0xd87ae2){if(_0xd87ae2){return _0xd87ae2[_0x352c('0x85')](_0x5dd514[_0x352c('0x33')][_0x352c('0x70')])['then'](function(){if(_[_0x352c('0x86')](_0x5dd514['query'][_0x352c('0x70')])){for(var _0x14ee9f=0x0;_0x14ee9f<_0x5dd514['query']['ids'][_0x352c('0x37')];_0x14ee9f+=0x1){socket[_0x352c('0x6d')](_0x352c('0x81'),{'UserId':Number(_0x5dd514[_0x352c('0x33')]['ids'][_0x14ee9f]),'SmsQueueId':Number(_0x5dd514[_0x352c('0x45')]['id'])});}}else{socket['emit'](_0x352c('0x81'),{'UserId':Number(_0x5dd514['query']['ids']),'SmsQueueId':Number(_0x5dd514[_0x352c('0x45')]['id'])});}});}})[_0x352c('0x26')](respondWithStatusCode(_0x140b11,null))['catch'](handleError(_0x140b11,null));};exports['getAgents']=function(_0x379070,_0x4fa436,_0x1804f0){var _0x3bad6e={};var _0x26a25c={};var _0x19b44d;var _0x1e2a85;return db['SmsQueue'][_0x352c('0x5f')]({'where':{'id':_0x379070[_0x352c('0x45')]['id']}})[_0x352c('0x26')](handleEntityNotFound(_0x4fa436,null))[_0x352c('0x26')](function(_0x4a782b){if(_0x4a782b){_0x19b44d=_0x4a782b;_0x26a25c['model']=_[_0x352c('0x46')](db['User'][_0x352c('0x2f')]);_0x26a25c['query']=_[_0x352c('0x46')](_0x379070[_0x352c('0x33')]);_0x26a25c['filters']=_[_0x352c('0x36')](_0x26a25c['model'],_0x26a25c[_0x352c('0x33')]);_0x3bad6e[_0x352c('0x35')]=_['intersection'](_0x26a25c[_0x352c('0x32')],qs[_0x352c('0x47')](_0x379070[_0x352c('0x33')][_0x352c('0x47')]));_0x3bad6e[_0x352c('0x35')]=_0x3bad6e[_0x352c('0x35')]['length']?_0x3bad6e['attributes']:_0x26a25c[_0x352c('0x32')];_0x3bad6e['order']=qs[_0x352c('0x55')](_0x379070[_0x352c('0x33')]['sort']);_0x3bad6e[_0x352c('0x3a')]=qs['filters'](_[_0x352c('0x3b')](_0x379070['query'],_0x26a25c['filters']));if(_0x379070[_0x352c('0x33')][_0x352c('0x3c')]){_0x3bad6e[_0x352c('0x3a')]=_[_0x352c('0x3d')](_0x3bad6e[_0x352c('0x3a')],{'$or':_['map'](_0x3bad6e[_0x352c('0x35')],function(_0x5001ec){var _0x1378aa={};_0x1378aa[_0x5001ec]={'$like':'%'+_0x379070[_0x352c('0x33')][_0x352c('0x3c')]+'%'};return _0x1378aa;})});}_0x3bad6e=_['merge']({},_0x3bad6e,_0x379070[_0x352c('0x40')]);return _0x19b44d[_0x352c('0x87')](_0x3bad6e);}})['then'](function(_0x387338){if(_0x387338){_0x1e2a85=_0x387338[_0x352c('0x37')];if(!_0x379070[_0x352c('0x33')]['hasOwnProperty'](_0x352c('0x38'))){_0x3bad6e[_0x352c('0x1e')]=qs['limit'](_0x379070[_0x352c('0x33')][_0x352c('0x1e')]);_0x3bad6e[_0x352c('0x1c')]=qs[_0x352c('0x1c')](_0x379070[_0x352c('0x33')][_0x352c('0x1c')]);}return _0x19b44d[_0x352c('0x87')](_0x3bad6e);}})[_0x352c('0x26')](function(_0x4fa062){if(_0x4fa062){return _0x4fa062?{'count':_0x1e2a85,'rows':_0x4fa062}:null;}})[_0x352c('0x26')](respondWithResult(_0x4fa436,null))[_0x352c('0x43')](handleError(_0x4fa436,null));};
\ No newline at end of file
+var _0x3ecc=['push','toString','SELECT','includes','all','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','SmsQueues','UserProfileResource','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SmsQueue','findAll','rows','catch','show','params','keys','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','rawAttributes','SmsQueueId','findAndCountAll','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?'];(function(_0x43d701,_0x4bb2e9){var _0x2ec4c6=function(_0x4d9765){while(--_0x4d9765){_0x43d701['push'](_0x43d701['shift']());}};_0x2ec4c6(++_0x4bb2e9);}(_0x3ecc,0x12f));var _0xc3ec=function(_0x5bf070,_0x13fe62){_0x5bf070=_0x5bf070-0x0;var _0x34d47a=_0x3ecc[_0x5bf070];return _0x34d47a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc3ec('0x0'));var zipdir=require(_0xc3ec('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc3ec('0x2'));var moment=require(_0xc3ec('0x3'));var BPromise=require(_0xc3ec('0x4'));var Mustache=require(_0xc3ec('0x5'));var util=require(_0xc3ec('0x6'));var path=require(_0xc3ec('0x7'));var sox=require(_0xc3ec('0x8'));var csv=require(_0xc3ec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc3ec('0xa'));var _=require(_0xc3ec('0xb'));var squel=require(_0xc3ec('0xc'));var crypto=require(_0xc3ec('0xd'));var jsforce=require(_0xc3ec('0xe'));var deskjs=require(_0xc3ec('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc3ec('0x10'));var Papa=require(_0xc3ec('0x11'));var Redis=require('ioredis');var authService=require(_0xc3ec('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3ec('0x13'))(_0xc3ec('0x14'));var utils=require(_0xc3ec('0x15'));var config=require(_0xc3ec('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc3ec('0x17'))['db'];config[_0xc3ec('0x18')]=_[_0xc3ec('0x19')](config['redis'],{'host':_0xc3ec('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc3ec('0x18')]));require(_0xc3ec('0x1b'))[_0xc3ec('0x1c')](socket);function respondWithStatusCode(_0x297ae4,_0x23fe7d){_0x23fe7d=_0x23fe7d||0xcc;return function(_0x422fba){if(_0x422fba){return _0x297ae4[_0xc3ec('0x1d')](_0x23fe7d);}return _0x297ae4[_0xc3ec('0x1e')](_0x23fe7d)[_0xc3ec('0x1f')]();};}function respondWithResult(_0x2720d5,_0x16c055){_0x16c055=_0x16c055||0xc8;return function(_0x1f5e1a){if(_0x1f5e1a){return _0x2720d5[_0xc3ec('0x1e')](_0x16c055)[_0xc3ec('0x20')](_0x1f5e1a);}};}function respondWithFilteredResult(_0x3c0fd0,_0x3483b8){return function(_0x482d72){if(_0x482d72){var _0x571d3f=typeof _0x3483b8[_0xc3ec('0x21')]===_0xc3ec('0x22')&&typeof _0x3483b8[_0xc3ec('0x23')]===_0xc3ec('0x22');var _0x425539=_0x482d72[_0xc3ec('0x24')];var _0x152dc3=_0x571d3f?0x0:_0x3483b8[_0xc3ec('0x21')];var _0x5bb428=_0x571d3f?_0x482d72['count']:_0x3483b8['offset']+_0x3483b8[_0xc3ec('0x23')];var _0x572eef;if(_0x5bb428>=_0x425539){_0x5bb428=_0x425539;_0x572eef=0xc8;}else{_0x572eef=0xce;}_0x3c0fd0[_0xc3ec('0x1e')](_0x572eef);return _0x3c0fd0[_0xc3ec('0x25')](_0xc3ec('0x26'),_0x152dc3+'-'+_0x5bb428+'/'+_0x425539)['json'](_0x482d72);}return null;};}function patchUpdates(_0x549ebb){return function(_0x2aa0c1){try{jsonpatch['apply'](_0x2aa0c1,_0x549ebb,!![]);}catch(_0x31c874){return BPromise[_0xc3ec('0x27')](_0x31c874);}return _0x2aa0c1[_0xc3ec('0x28')]();};}function saveUpdates(_0x2b3ba4,_0x2649dd){return function(_0x3fc1b5){if(_0x3fc1b5){return _0x3fc1b5[_0xc3ec('0x29')](_0x2b3ba4)[_0xc3ec('0x2a')](function(_0x17bf1c){return _0x17bf1c;});}return null;};}function removeEntity(_0xdd0bfe,_0x5b047c){return function(_0x251c89){if(_0x251c89){return _0x251c89[_0xc3ec('0x2b')]()[_0xc3ec('0x2a')](function(){var _0x5b06d5=_0x251c89['get']({'plain':!![]});var _0x5eaba9=_0xc3ec('0x2c');return db[_0xc3ec('0x2d')][_0xc3ec('0x2b')]({'where':{'type':_0x5eaba9,'resourceId':_0x5b06d5['id']}})[_0xc3ec('0x2a')](function(){return _0x251c89;});})['then'](function(){_0xdd0bfe[_0xc3ec('0x1e')](0xcc)[_0xc3ec('0x1f')]();});}};}function handleEntityNotFound(_0x20e5d6,_0x5ab1d0){return function(_0x1eb5eb){if(!_0x1eb5eb){_0x20e5d6[_0xc3ec('0x1d')](0x194);}return _0x1eb5eb;};}function handleError(_0x5c9030,_0x54dccf){_0x54dccf=_0x54dccf||0x1f4;return function(_0x2e3370){logger[_0xc3ec('0x2e')](_0x2e3370[_0xc3ec('0x2f')]);if(_0x2e3370['name']){delete _0x2e3370[_0xc3ec('0x30')];}_0x5c9030[_0xc3ec('0x1e')](_0x54dccf)[_0xc3ec('0x31')](_0x2e3370);};}exports[_0xc3ec('0x32')]=function(_0x4129c9,_0x39340a){var _0x42f74e={},_0x572e80={},_0x326650={'count':0x0,'rows':[]};var _0x1415b7=_[_0xc3ec('0x33')](db['SmsQueue']['rawAttributes'],function(_0x3d6e0c){return{'name':_0x3d6e0c[_0xc3ec('0x34')],'type':_0x3d6e0c[_0xc3ec('0x35')][_0xc3ec('0x36')]};});_0x572e80[_0xc3ec('0x37')]=_[_0xc3ec('0x33')](_0x1415b7,_0xc3ec('0x30'));_0x572e80[_0xc3ec('0x38')]=_['keys'](_0x4129c9[_0xc3ec('0x38')]);_0x572e80[_0xc3ec('0x39')]=_[_0xc3ec('0x3a')](_0x572e80['model'],_0x572e80[_0xc3ec('0x38')]);_0x42f74e[_0xc3ec('0x3b')]=_[_0xc3ec('0x3a')](_0x572e80['model'],qs[_0xc3ec('0x3c')](_0x4129c9[_0xc3ec('0x38')][_0xc3ec('0x3c')]));_0x42f74e[_0xc3ec('0x3b')]=_0x42f74e['attributes'][_0xc3ec('0x3d')]?_0x42f74e[_0xc3ec('0x3b')]:_0x572e80[_0xc3ec('0x37')];if(!_0x4129c9[_0xc3ec('0x38')][_0xc3ec('0x3e')](_0xc3ec('0x3f'))){_0x42f74e[_0xc3ec('0x23')]=qs[_0xc3ec('0x23')](_0x4129c9[_0xc3ec('0x38')][_0xc3ec('0x23')]);_0x42f74e[_0xc3ec('0x21')]=qs[_0xc3ec('0x21')](_0x4129c9[_0xc3ec('0x38')][_0xc3ec('0x21')]);}_0x42f74e[_0xc3ec('0x40')]=qs[_0xc3ec('0x41')](_0x4129c9[_0xc3ec('0x38')][_0xc3ec('0x41')]);_0x42f74e[_0xc3ec('0x42')]=qs[_0xc3ec('0x39')](_[_0xc3ec('0x43')](_0x4129c9[_0xc3ec('0x38')],_0x572e80[_0xc3ec('0x39')]),_0x1415b7);if(_0x4129c9[_0xc3ec('0x38')][_0xc3ec('0x44')]){_0x42f74e[_0xc3ec('0x42')]=_[_0xc3ec('0x45')](_0x42f74e[_0xc3ec('0x42')],{'$or':_[_0xc3ec('0x33')](_0x1415b7,function(_0x475286){if(_0x475286['type']!=='VIRTUAL'){var _0x37d5bc={};_0x37d5bc[_0x475286['name']]={'$like':'%'+_0x4129c9[_0xc3ec('0x38')][_0xc3ec('0x44')]+'%'};return _0x37d5bc;}})});}_0x42f74e=_[_0xc3ec('0x45')]({},_0x42f74e,_0x4129c9[_0xc3ec('0x46')]);var _0x41db46={'where':_0x42f74e[_0xc3ec('0x42')]};return db[_0xc3ec('0x47')][_0xc3ec('0x24')](_0x41db46)[_0xc3ec('0x2a')](function(_0x8fa289){_0x326650[_0xc3ec('0x24')]=_0x8fa289;if(_0x4129c9[_0xc3ec('0x38')]['includeAll']){_0x42f74e['include']=[{'all':!![]}];}return db[_0xc3ec('0x47')][_0xc3ec('0x48')](_0x42f74e);})[_0xc3ec('0x2a')](function(_0xcdf0fc){_0x326650[_0xc3ec('0x49')]=_0xcdf0fc;return _0x326650;})[_0xc3ec('0x2a')](respondWithFilteredResult(_0x39340a,_0x42f74e))[_0xc3ec('0x4a')](handleError(_0x39340a,null));};exports[_0xc3ec('0x4b')]=function(_0x261ceb,_0x457cd4){var _0x2737d7={'raw':!![],'where':{'id':_0x261ceb[_0xc3ec('0x4c')]['id']}},_0x10a58a={};_0x10a58a['model']=_[_0xc3ec('0x4d')](db[_0xc3ec('0x47')]['rawAttributes']);_0x10a58a['query']=_['keys'](_0x261ceb[_0xc3ec('0x38')]);_0x10a58a[_0xc3ec('0x39')]=_[_0xc3ec('0x3a')](_0x10a58a[_0xc3ec('0x37')],_0x10a58a[_0xc3ec('0x38')]);_0x2737d7[_0xc3ec('0x3b')]=_[_0xc3ec('0x3a')](_0x10a58a[_0xc3ec('0x37')],qs[_0xc3ec('0x3c')](_0x261ceb[_0xc3ec('0x38')][_0xc3ec('0x3c')]));_0x2737d7[_0xc3ec('0x3b')]=_0x2737d7[_0xc3ec('0x3b')][_0xc3ec('0x3d')]?_0x2737d7[_0xc3ec('0x3b')]:_0x10a58a[_0xc3ec('0x37')];if(_0x261ceb['query'][_0xc3ec('0x4e')]){_0x2737d7[_0xc3ec('0x4f')]=[{'all':!![]}];}_0x2737d7=_[_0xc3ec('0x45')]({},_0x2737d7,_0x261ceb[_0xc3ec('0x46')]);return db['SmsQueue'][_0xc3ec('0x50')](_0x2737d7)[_0xc3ec('0x2a')](handleEntityNotFound(_0x457cd4,null))[_0xc3ec('0x2a')](respondWithResult(_0x457cd4,null))[_0xc3ec('0x4a')](handleError(_0x457cd4,null));};exports[_0xc3ec('0x51')]=function(_0x335e6f,_0x54cba0){return db['SmsQueue'][_0xc3ec('0x51')](_0x335e6f[_0xc3ec('0x52')],{})[_0xc3ec('0x2a')](function(_0x3eddca){var _0x6b4920=_0x335e6f[_0xc3ec('0x53')][_0xc3ec('0x54')]({'plain':!![]});if(!_0x6b4920)throw new Error(_0xc3ec('0x55'));if(_0x6b4920[_0xc3ec('0x56')]===_0xc3ec('0x53')){var _0x20dc9b=_0x3eddca[_0xc3ec('0x54')]({'plain':!![]});var _0x4434c6=_0xc3ec('0x2c');return db['UserProfileSection'][_0xc3ec('0x50')]({'where':{'name':_0x4434c6,'userProfileId':_0x6b4920['userProfileId']},'raw':!![]})['then'](function(_0x2c6e82){if(_0x2c6e82&&_0x2c6e82[_0xc3ec('0x57')]===0x0){return db[_0xc3ec('0x2d')][_0xc3ec('0x51')]({'name':_0x20dc9b[_0xc3ec('0x30')],'resourceId':_0x20dc9b['id'],'type':_0x2c6e82[_0xc3ec('0x30')],'sectionId':_0x2c6e82['id']},{})[_0xc3ec('0x2a')](function(){return _0x3eddca;});}else{return _0x3eddca;}})['catch'](function(_0x32c992){logger[_0xc3ec('0x2e')](_0xc3ec('0x58'),_0x32c992);throw _0x32c992;});}return _0x3eddca;})[_0xc3ec('0x2a')](respondWithResult(_0x54cba0,0xc9))[_0xc3ec('0x4a')](handleError(_0x54cba0,null));};exports[_0xc3ec('0x29')]=function(_0x1491ae,_0x2a4403){if(_0x1491ae[_0xc3ec('0x52')]['id']){delete _0x1491ae['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x1491ae[_0xc3ec('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2a4403,null))[_0xc3ec('0x2a')](saveUpdates(_0x1491ae[_0xc3ec('0x52')],null))[_0xc3ec('0x2a')](respondWithResult(_0x2a4403,null))[_0xc3ec('0x4a')](handleError(_0x2a4403,null));};exports[_0xc3ec('0x2b')]=function(_0x32694d,_0x5ceaaf){return db['SmsQueue'][_0xc3ec('0x50')]({'where':{'id':_0x32694d[_0xc3ec('0x4c')]['id']}})[_0xc3ec('0x2a')](handleEntityNotFound(_0x5ceaaf,null))[_0xc3ec('0x2a')](removeEntity(_0x5ceaaf,null))[_0xc3ec('0x4a')](handleError(_0x5ceaaf,null));};exports[_0xc3ec('0x59')]=function(_0x510b96,_0x25502a){return db[_0xc3ec('0x47')]['describe']()[_0xc3ec('0x2a')](respondWithResult(_0x25502a,null))[_0xc3ec('0x4a')](handleError(_0x25502a,null));};exports[_0xc3ec('0x5a')]=function(_0x53ca75,_0x1530aa,_0x5b7b5c){var _0x1bb51d={'raw':!![],'where':{}},_0x4bb4df={},_0x1ec766;return db['SmsQueue'][_0xc3ec('0x5b')]({'where':{'id':_0x53ca75[_0xc3ec('0x4c')]['id']}})[_0xc3ec('0x2a')](handleEntityNotFound(_0x1530aa,null))[_0xc3ec('0x2a')](function(_0x38e28){if(_0x38e28){_0x1ec766=_0x38e28[_0xc3ec('0x54')]({'plain':!![]});_0x4bb4df[_0xc3ec('0x37')]=_[_0xc3ec('0x4d')](db[_0xc3ec('0x5c')][_0xc3ec('0x5d')]);_0x4bb4df[_0xc3ec('0x38')]=_[_0xc3ec('0x4d')](_0x53ca75[_0xc3ec('0x38')]);_0x4bb4df[_0xc3ec('0x39')]=_[_0xc3ec('0x3a')](_0x4bb4df[_0xc3ec('0x37')],_0x4bb4df[_0xc3ec('0x38')]);_0x1bb51d[_0xc3ec('0x3b')]=_[_0xc3ec('0x3a')](_0x4bb4df[_0xc3ec('0x37')],qs[_0xc3ec('0x3c')](_0x53ca75[_0xc3ec('0x38')]['fields']));_0x1bb51d['attributes']=_0x1bb51d[_0xc3ec('0x3b')][_0xc3ec('0x3d')]?_0x1bb51d['attributes']:_0x4bb4df['model'];if(!_0x53ca75[_0xc3ec('0x38')][_0xc3ec('0x3e')](_0xc3ec('0x3f'))){_0x1bb51d['limit']=qs[_0xc3ec('0x23')](_0x53ca75['query'][_0xc3ec('0x23')]);_0x1bb51d[_0xc3ec('0x21')]=qs[_0xc3ec('0x21')](_0x53ca75[_0xc3ec('0x38')][_0xc3ec('0x21')]);}_0x1bb51d[_0xc3ec('0x40')]=qs[_0xc3ec('0x41')](_0x53ca75[_0xc3ec('0x38')]['sort']);_0x1bb51d[_0xc3ec('0x42')]=qs[_0xc3ec('0x39')](_[_0xc3ec('0x43')](_0x53ca75[_0xc3ec('0x38')],_0x4bb4df[_0xc3ec('0x39')]));_0x1bb51d[_0xc3ec('0x42')][_0xc3ec('0x5e')]=_0x38e28['id'];if(_0x53ca75[_0xc3ec('0x38')][_0xc3ec('0x44')]){_0x1bb51d[_0xc3ec('0x42')]=_[_0xc3ec('0x45')](_0x1bb51d[_0xc3ec('0x42')],{'$or':_[_0xc3ec('0x33')](_0x1bb51d[_0xc3ec('0x3b')],function(_0x43a4c8){var _0xc5670={};_0xc5670[_0x43a4c8]={'$like':'%'+_0x53ca75[_0xc3ec('0x38')]['filter']+'%'};return _0xc5670;})});}_0x1bb51d=_['merge']({},_0x1bb51d,_0x53ca75[_0xc3ec('0x46')]);return db[_0xc3ec('0x5c')][_0xc3ec('0x48')](_0x1bb51d);}})[_0xc3ec('0x2a')](function(_0x59bb02){if(_0x59bb02){return db['User'][_0xc3ec('0x5f')]({'where':{'id':_[_0xc3ec('0x33')](_0x59bb02,'UserId'),'role':_0xc3ec('0x60')},'attributes':['id',_0xc3ec('0x30'),_0xc3ec('0x61'),_0xc3ec('0x62'),_0xc3ec('0x63')]});}})[_0xc3ec('0x2a')](function(_0x48b699){if(_0x48b699){return{'count':_0x48b699[_0xc3ec('0x24')],'rows':_[_0xc3ec('0x33')](_0x48b699[_0xc3ec('0x49')],function(_0x333273){return{'membername':_0x333273['name'],'UserId':_0x333273['id'],'queue_name':_0x1ec766[_0xc3ec('0x30')],'SmsQueueId':_0x1ec766['id'],'interface':util[_0xc3ec('0x64')](_0xc3ec('0x65'),_0xc3ec('0x66'),_0x333273[_0xc3ec('0x30')]),'penalty':0x0,'paused':_0x333273[_0xc3ec('0x61')],'createdAt':_0x333273[_0xc3ec('0x63')],'updatedAt':_0x333273[_0xc3ec('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc3ec('0x2a')](respondWithFilteredResult(_0x1530aa,_0x1bb51d))[_0xc3ec('0x4a')](handleError(_0x1530aa,null));};exports[_0xc3ec('0x67')]=function(_0x382688,_0x3b7666,_0x53ee07){var _0x53e4db={};var _0x35ef7a={};var _0x539959;var _0x554a8b;return db[_0xc3ec('0x47')][_0xc3ec('0x5b')]({'where':{'id':_0x382688[_0xc3ec('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3b7666,null))[_0xc3ec('0x2a')](function(_0x17d465){if(_0x17d465){_0x539959=_0x17d465;_0x35ef7a[_0xc3ec('0x37')]=_['keys'](db[_0xc3ec('0x68')]['rawAttributes']);_0x35ef7a[_0xc3ec('0x38')]=_[_0xc3ec('0x4d')](_0x382688[_0xc3ec('0x38')]);_0x35ef7a[_0xc3ec('0x39')]=_['intersection'](_0x35ef7a[_0xc3ec('0x37')],_0x35ef7a[_0xc3ec('0x38')]);_0x53e4db[_0xc3ec('0x3b')]=_[_0xc3ec('0x3a')](_0x35ef7a['model'],qs[_0xc3ec('0x3c')](_0x382688['query'][_0xc3ec('0x3c')]));_0x53e4db[_0xc3ec('0x3b')]=_0x53e4db[_0xc3ec('0x3b')][_0xc3ec('0x3d')]?_0x53e4db[_0xc3ec('0x3b')]:_0x35ef7a[_0xc3ec('0x37')];_0x53e4db[_0xc3ec('0x40')]=qs[_0xc3ec('0x41')](_0x382688['query']['sort']);_0x53e4db[_0xc3ec('0x42')]=qs['filters'](_[_0xc3ec('0x43')](_0x382688[_0xc3ec('0x38')],_0x35ef7a[_0xc3ec('0x39')]));if(_0x382688[_0xc3ec('0x38')][_0xc3ec('0x44')]){_0x53e4db[_0xc3ec('0x42')]=_['merge'](_0x53e4db[_0xc3ec('0x42')],{'$or':_['map'](_0x53e4db[_0xc3ec('0x3b')],function(_0x44e33f){var _0x53cdf1={};_0x53cdf1[_0x44e33f]={'$like':'%'+_0x382688[_0xc3ec('0x38')][_0xc3ec('0x44')]+'%'};return _0x53cdf1;})});}_0x53e4db=_['merge']({},_0x53e4db,_0x382688['options']);return _0x539959[_0xc3ec('0x67')](_0x53e4db);}})[_0xc3ec('0x2a')](function(_0x5a5e04){if(_0x5a5e04){_0x554a8b=_0x5a5e04[_0xc3ec('0x3d')];if(!_0x382688['query'][_0xc3ec('0x3e')](_0xc3ec('0x3f'))){_0x53e4db[_0xc3ec('0x23')]=qs[_0xc3ec('0x23')](_0x382688[_0xc3ec('0x38')][_0xc3ec('0x23')]);_0x53e4db[_0xc3ec('0x21')]=qs['offset'](_0x382688[_0xc3ec('0x38')]['offset']);}return _0x539959['getTeams'](_0x53e4db);}})[_0xc3ec('0x2a')](function(_0x1f57ed){if(_0x1f57ed){return _0x1f57ed?{'count':_0x554a8b,'rows':_0x1f57ed}:null;}})[_0xc3ec('0x2a')](respondWithResult(_0x3b7666,null))['catch'](handleError(_0x3b7666,null));};exports['addTeams']=function(_0x54837e,_0x12eb23,_0x3c88ba){var _0x381d53=_0x54837e['body'][_0xc3ec('0x69')];return db[_0xc3ec('0x68')][_0xc3ec('0x48')]({'where':{'id':_0x381d53},'attributes':['id'],'include':[{'model':db[_0xc3ec('0x6a')],'as':_0xc3ec('0x6b'),'attributes':['id',_0xc3ec('0x30'),_0xc3ec('0x6c'),_0xc3ec('0x6d'),_0xc3ec('0x6e')],'raw':!![]}]})[_0xc3ec('0x2a')](function(_0x318220){if(_0x318220){var _0x237bac=_[_0xc3ec('0x6f')](_0x318220,function(_0x4a551c){var _0x43647c=_0x4a551c['get']({'plain':!![]});return _0x43647c[_0xc3ec('0x6b')];});return db[_0xc3ec('0x47')]['find']({'where':{'id':_0x54837e['params']['id']}})[_0xc3ec('0x2a')](function(_0x5051e5){return db[_0xc3ec('0x70')][_0xc3ec('0x71')](function(_0x4b70b8){return _0x5051e5['addTeams'](_0x381d53,{'transaction':_0x4b70b8})[_0xc3ec('0x2a')](function(){return BPromise[_0xc3ec('0x72')](_0x237bac,function(_0x2becaa){return db[_0xc3ec('0x5c')][_0xc3ec('0x73')]({'where':{'UserId':_0x2becaa['id'],'SmsQueueId':_0x54837e[_0xc3ec('0x4c')]['id']},'transaction':_0x4b70b8});});})['then'](function(){_0x237bac[_0xc3ec('0x74')](function(_0x5353c2){socket[_0xc3ec('0x75')](_0xc3ec('0x76'),{'UserId':_0x5353c2['id'],'SmsQueueId':_0x5051e5['id']});});});});});}})['then'](respondWithStatusCode(_0x12eb23,null))[_0xc3ec('0x4a')](handleError(_0x12eb23,null));};exports[_0xc3ec('0x77')]=function(_0x92976,_0x5662e6,_0x128842){return db['Team'][_0xc3ec('0x48')]({'where':{'id':_0x92976['query'][_0xc3ec('0x69')]},'attributes':['id'],'include':[{'model':db[_0xc3ec('0x6a')],'as':_0xc3ec('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xc3ec('0x2a')](handleEntityNotFound(_0x5662e6,null))[_0xc3ec('0x2a')](function(_0x132128){var _0x5a758d=_[_0xc3ec('0x33')](_0x132128,'id');var _0x27133f=[];var _0x19c5f2=[];var _0x155681=squel[_0xc3ec('0x78')]();_0x155681['field'](_0xc3ec('0x79'))[_0xc3ec('0x7a')]('team_has_sms_queues','tq')[_0xc3ec('0x7b')](_0xc3ec('0x7c'),'ut',_0xc3ec('0x7d'))[_0xc3ec('0x42')](_0xc3ec('0x7e'),_0x92976[_0xc3ec('0x4c')]['id']);for(var _0x187a8c=0x0;_0x187a8c<_0x132128[_0xc3ec('0x3d')];_0x187a8c+=0x1){let _0x5e8ca3=_0x132128[_0x187a8c];for(var _0x4b8c7d=0x0;_0x4b8c7d<_0x5e8ca3['Agents'][_0xc3ec('0x3d')];_0x4b8c7d+=0x1){let _0x1ee96b=_0x5e8ca3['Agents'][_0x4b8c7d];var _0x5ea1d1=_0x155681[_0xc3ec('0x7f')]();_0x5ea1d1[_0xc3ec('0x42')](_0xc3ec('0x80'),_0x1ee96b['id']);_0x19c5f2[_0xc3ec('0x81')](db[_0xc3ec('0x70')][_0xc3ec('0x38')](_0x5ea1d1[_0xc3ec('0x82')](),{'type':db[_0xc3ec('0x70')]['QueryTypes'][_0xc3ec('0x83')]})['then'](function(_0x3acd26){if(_0x3acd26[_0xc3ec('0x3d')]===0x1){return _0x1ee96b['id'];}else{var _0x235815=_['every'](_[_0xc3ec('0x33')](_0x3acd26,'TeamId'),function(_0x522781){return _[_0xc3ec('0x84')](_0x5a758d,_0x522781);});if(_0x235815){return _0x1ee96b['id'];}}}));}}return BPromise[_0xc3ec('0x85')](_0x19c5f2)[_0xc3ec('0x2a')](function(_0x37cd5e){_0x27133f=_(_0x27133f)[_0xc3ec('0x86')](_0x37cd5e)[_0xc3ec('0x87')]()[_0xc3ec('0x88')]();return db['SmsQueue'][_0xc3ec('0x50')]({'where':{'id':_0x92976[_0xc3ec('0x4c')]['id']}})[_0xc3ec('0x2a')](function(_0x93a1c){return db[_0xc3ec('0x70')][_0xc3ec('0x71')](function(_0xe6448e){return _0x93a1c[_0xc3ec('0x77')](_0x92976[_0xc3ec('0x38')]['ids'],{'transaction':_0xe6448e})[_0xc3ec('0x2a')](function(){if(!_[_0xc3ec('0x89')](_0x27133f)){return _0x93a1c[_0xc3ec('0x8a')](_0x27133f,{'transaction':_0xe6448e});}})[_0xc3ec('0x2a')](function(){_0x27133f['forEach'](function(_0xa8158d){socket[_0xc3ec('0x75')](_0xc3ec('0x8b'),{'UserId':_0xa8158d,'SmsQueueId':_0x93a1c['id']});});});});});});})['then'](respondWithStatusCode(_0x5662e6,null))[_0xc3ec('0x4a')](handleError(_0x5662e6,null));};exports[_0xc3ec('0x8c')]=function(_0xa8bfa0,_0x6be35a,_0x375127){return db['SmsQueue']['find']({'where':{'id':_0xa8bfa0[_0xc3ec('0x4c')]['id']}})[_0xc3ec('0x2a')](handleEntityNotFound(_0x6be35a,null))[_0xc3ec('0x2a')](function(_0xbf25d5){if(_0xbf25d5){return _0xbf25d5[_0xc3ec('0x8c')](_0xa8bfa0[_0xc3ec('0x52')][_0xc3ec('0x69')],_[_0xc3ec('0x8d')](_0xa8bfa0[_0xc3ec('0x52')],[_0xc3ec('0x69'),'id'])||{})[_0xc3ec('0x8e')](function(_0x3794e7){for(var _0x4970f1=0x0;_0x4970f1<_0xa8bfa0['body'][_0xc3ec('0x69')][_0xc3ec('0x3d')];_0x4970f1+=0x1){socket['emit']('userSmsQueue:save',{'UserId':Number(_0xa8bfa0['body'][_0xc3ec('0x69')][_0x4970f1]),'SmsQueueId':Number(_0xa8bfa0[_0xc3ec('0x4c')]['id'])});}return _0x3794e7;});}})[_0xc3ec('0x2a')](respondWithResult(_0x6be35a,null))[_0xc3ec('0x4a')](handleError(_0x6be35a,null));};exports[_0xc3ec('0x8a')]=function(_0x4d4d6d,_0x10f9d9,_0x3cfd9f){return db[_0xc3ec('0x47')][_0xc3ec('0x50')]({'where':{'id':_0x4d4d6d[_0xc3ec('0x4c')]['id']}})[_0xc3ec('0x2a')](handleEntityNotFound(_0x10f9d9,null))[_0xc3ec('0x2a')](function(_0x341d0b){if(_0x341d0b){return _0x341d0b[_0xc3ec('0x8a')](_0x4d4d6d[_0xc3ec('0x38')]['ids'])[_0xc3ec('0x2a')](function(){if(_['isArray'](_0x4d4d6d['query'][_0xc3ec('0x69')])){for(var _0x109faf=0x0;_0x109faf<_0x4d4d6d[_0xc3ec('0x38')][_0xc3ec('0x69')]['length'];_0x109faf+=0x1){socket[_0xc3ec('0x75')](_0xc3ec('0x8b'),{'UserId':Number(_0x4d4d6d['query'][_0xc3ec('0x69')][_0x109faf]),'SmsQueueId':Number(_0x4d4d6d[_0xc3ec('0x4c')]['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x4d4d6d['query'][_0xc3ec('0x69')]),'SmsQueueId':Number(_0x4d4d6d[_0xc3ec('0x4c')]['id'])});}});}})[_0xc3ec('0x2a')](respondWithStatusCode(_0x10f9d9,null))['catch'](handleError(_0x10f9d9,null));};exports[_0xc3ec('0x8f')]=function(_0x254735,_0x4700e4,_0xd64da){var _0x1b8f95={};var _0x12b704={};var _0x327e39;var _0x3c6a67;return db[_0xc3ec('0x47')][_0xc3ec('0x5b')]({'where':{'id':_0x254735[_0xc3ec('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4700e4,null))['then'](function(_0x454f70){if(_0x454f70){_0x327e39=_0x454f70;_0x12b704[_0xc3ec('0x37')]=_['keys'](db[_0xc3ec('0x6a')]['rawAttributes']);_0x12b704[_0xc3ec('0x38')]=_['keys'](_0x254735[_0xc3ec('0x38')]);_0x12b704[_0xc3ec('0x39')]=_[_0xc3ec('0x3a')](_0x12b704[_0xc3ec('0x37')],_0x12b704[_0xc3ec('0x38')]);_0x1b8f95[_0xc3ec('0x3b')]=_[_0xc3ec('0x3a')](_0x12b704[_0xc3ec('0x37')],qs[_0xc3ec('0x3c')](_0x254735[_0xc3ec('0x38')]['fields']));_0x1b8f95[_0xc3ec('0x3b')]=_0x1b8f95[_0xc3ec('0x3b')][_0xc3ec('0x3d')]?_0x1b8f95[_0xc3ec('0x3b')]:_0x12b704[_0xc3ec('0x37')];_0x1b8f95[_0xc3ec('0x40')]=qs[_0xc3ec('0x41')](_0x254735['query'][_0xc3ec('0x41')]);_0x1b8f95['where']=qs[_0xc3ec('0x39')](_[_0xc3ec('0x43')](_0x254735[_0xc3ec('0x38')],_0x12b704[_0xc3ec('0x39')]));if(_0x254735[_0xc3ec('0x38')][_0xc3ec('0x44')]){_0x1b8f95[_0xc3ec('0x42')]=_['merge'](_0x1b8f95[_0xc3ec('0x42')],{'$or':_[_0xc3ec('0x33')](_0x1b8f95[_0xc3ec('0x3b')],function(_0x49fc54){var _0x33877f={};_0x33877f[_0x49fc54]={'$like':'%'+_0x254735[_0xc3ec('0x38')]['filter']+'%'};return _0x33877f;})});}_0x1b8f95=_[_0xc3ec('0x45')]({},_0x1b8f95,_0x254735[_0xc3ec('0x46')]);return _0x327e39[_0xc3ec('0x8f')](_0x1b8f95);}})[_0xc3ec('0x2a')](function(_0x18ffd3){if(_0x18ffd3){_0x3c6a67=_0x18ffd3[_0xc3ec('0x3d')];if(!_0x254735[_0xc3ec('0x38')][_0xc3ec('0x3e')](_0xc3ec('0x3f'))){_0x1b8f95[_0xc3ec('0x23')]=qs[_0xc3ec('0x23')](_0x254735[_0xc3ec('0x38')][_0xc3ec('0x23')]);_0x1b8f95[_0xc3ec('0x21')]=qs[_0xc3ec('0x21')](_0x254735[_0xc3ec('0x38')]['offset']);}return _0x327e39[_0xc3ec('0x8f')](_0x1b8f95);}})[_0xc3ec('0x2a')](function(_0x223938){if(_0x223938){return _0x223938?{'count':_0x3c6a67,'rows':_0x223938}:null;}})[_0xc3ec('0x2a')](respondWithResult(_0x4700e4,null))[_0xc3ec('0x4a')](handleError(_0x4700e4,null));};
\ No newline at end of file
index 73096e1..a12cc61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65db=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x22b1a4,_0x1fdd3c){var _0x40255b=function(_0x3ad26e){while(--_0x3ad26e){_0x22b1a4['push'](_0x22b1a4['shift']());}};_0x40255b(++_0x1fdd3c);}(_0x65db,0x1e0));var _0xb65d=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x65db[_0x4d8ed9];return _0x1e2140;};'use strict';var EventEmitter=require(_0xb65d('0x0'));var SmsQueue=require(_0xb65d('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb65d('0x2')](0x0);var events={'afterCreate':_0xb65d('0x3'),'afterUpdate':_0xb65d('0x4'),'afterDestroy':_0xb65d('0x5')};function emitEvent(_0x2a24d2){return function(_0x5354ee,_0x5eec1d,_0x596eea){SmsQueueEvents[_0xb65d('0x6')](_0x2a24d2+':'+_0x5354ee['id'],_0x5354ee);SmsQueueEvents[_0xb65d('0x6')](_0x2a24d2,_0x5354ee);_0x596eea(null);};}for(var e in events){if(events[_0xb65d('0x7')](e)){var event=events[e];SmsQueue[_0xb65d('0x8')](e,emitEvent(event));}}module[_0xb65d('0x9')]=SmsQueueEvents;
\ No newline at end of file
+var _0x024b=['emit','hook','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove'];(function(_0x37c874,_0x3518c3){var _0x1a7912=function(_0x58a507){while(--_0x58a507){_0x37c874['push'](_0x37c874['shift']());}};_0x1a7912(++_0x3518c3);}(_0x024b,0x1df));var _0xb024=function(_0x4733ba,_0x39841a){_0x4733ba=_0x4733ba-0x0;var _0x2ecdba=_0x024b[_0x4733ba];return _0x2ecdba;};'use strict';var EventEmitter=require(_0xb024('0x0'));var SmsQueue=require(_0xb024('0x1'))['db'][_0xb024('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb024('0x3')](0x0);var events={'afterCreate':_0xb024('0x4'),'afterUpdate':_0xb024('0x5'),'afterDestroy':_0xb024('0x6')};function emitEvent(_0x5640db){return function(_0x58b0cf,_0x36d0ec,_0x1e4e79){SmsQueueEvents[_0xb024('0x7')](_0x5640db+':'+_0x58b0cf['id'],_0x58b0cf);SmsQueueEvents['emit'](_0x5640db,_0x58b0cf);_0x1e4e79(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xb024('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
index 1aa66b7..79f8267 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbbc=['request-promise','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','util','api','moment'];(function(_0x5aa13d,_0x21acb2){var _0x5a2998=function(_0x31b9fe){while(--_0x31b9fe){_0x5aa13d['push'](_0x5aa13d['shift']());}};_0x5a2998(++_0x21acb2);}(_0xdbbc,0x173));var _0xcdbb=function(_0x1407d1,_0x4cc88c){_0x1407d1=_0x1407d1-0x0;var _0x4e6cbe=_0xdbbc[_0x1407d1];return _0x4e6cbe;};'use strict';var _=require('lodash');var util=require(_0xcdbb('0x0'));var logger=require('../../config/logger')(_0xcdbb('0x1'));var moment=require(_0xcdbb('0x2'));var BPromise=require('bluebird');var rp=require(_0xcdbb('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcdbb('0x4'));var config=require(_0xcdbb('0x5'));var attributes=require(_0xcdbb('0x6'));module[_0xcdbb('0x7')]=function(_0x3152d2,_0x2a95c7){return _0x3152d2[_0xcdbb('0x8')](_0xcdbb('0x9'),attributes,{'tableName':_0xcdbb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1361=['util','../../config/logger','api','moment','request-promise','path','rimraf','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash'];(function(_0x37b680,_0x5582a0){var _0xe435f5=function(_0x551794){while(--_0x551794){_0x37b680['push'](_0x37b680['shift']());}};_0xe435f5(++_0x5582a0);}(_0x1361,0x107));var _0x1136=function(_0xad82d,_0x364832){_0xad82d=_0xad82d-0x0;var _0x134c63=_0x1361[_0xad82d];return _0x134c63;};'use strict';var _=require(_0x1136('0x0'));var util=require(_0x1136('0x1'));var logger=require(_0x1136('0x2'))(_0x1136('0x3'));var moment=require(_0x1136('0x4'));var BPromise=require('bluebird');var rp=require(_0x1136('0x5'));var fs=require('fs');var path=require(_0x1136('0x6'));var rimraf=require(_0x1136('0x7'));var config=require('../../config/environment');var attributes=require(_0x1136('0x8'));module[_0x1136('0x9')]=function(_0xf4e9d,_0x4982d3){return _0xf4e9d['define'](_0x1136('0xa'),attributes,{'tableName':_0x1136('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b3b6c07..110f2f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00cb=['redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','request','then','info','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','SmsQueue,\x20%s,\x20%s','message','request\x20sent','result','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowSmsQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x224035,_0x1f93ef){var _0x3a0c7a=function(_0x13afc1){while(--_0x13afc1){_0x224035['push'](_0x224035['shift']());}};_0x3a0c7a(++_0x1f93ef);}(_0x00cb,0x198));var _0xb00c=function(_0x1c9eeb,_0x1c260b){_0x1c9eeb=_0x1c9eeb-0x0;var _0x2cc1ed=_0x00cb[_0x1c9eeb];return _0x2cc1ed;};'use strict';var _=require('lodash');var util=require(_0xb00c('0x0'));var moment=require(_0xb00c('0x1'));var BPromise=require(_0xb00c('0x2'));var rs=require(_0xb00c('0x3'));var fs=require('fs');var Redis=require(_0xb00c('0x4'));var db=require(_0xb00c('0x5'))['db'];var utils=require(_0xb00c('0x6'));var logger=require(_0xb00c('0x7'))('rpc');var config=require(_0xb00c('0x8'));var jayson=require(_0xb00c('0x9'));var client=jayson[_0xb00c('0xa')][_0xb00c('0xb')]({'port':0x232a});config[_0xb00c('0xc')]=_[_0xb00c('0xd')](config['redis'],{'host':_0xb00c('0xe'),'port':0x18eb});var socket=require(_0xb00c('0xf'))(new Redis(config[_0xb00c('0xc')]));require(_0xb00c('0x10'))['register'](socket);function respondWithRpcPromise(_0x2fa845,_0xc3fb7c,_0x11c6bc){return new BPromise(function(_0x55b865,_0x5a7a21){return client[_0xb00c('0x11')](_0x2fa845,_0x11c6bc)[_0xb00c('0x12')](function(_0x529520){logger[_0xb00c('0x13')]('SmsQueue,\x20%s,\x20%s',_0xc3fb7c,'request\x20sent');logger[_0xb00c('0x14')](_0xb00c('0x15'),_0xc3fb7c,'request\x20sent',JSON[_0xb00c('0x16')](_0x529520));if(_0x529520[_0xb00c('0x17')]){if(_0x529520[_0xb00c('0x17')]['code']===0x1f4){logger[_0xb00c('0x17')](_0xb00c('0x18'),_0xc3fb7c,_0x529520[_0xb00c('0x17')][_0xb00c('0x19')]);return _0x5a7a21(_0x529520[_0xb00c('0x17')][_0xb00c('0x19')]);}logger[_0xb00c('0x17')]('SmsQueue,\x20%s,\x20%s',_0xc3fb7c,_0x529520['error'][_0xb00c('0x19')]);return _0x55b865(_0x529520['error'][_0xb00c('0x19')]);}else{logger[_0xb00c('0x13')](_0xb00c('0x18'),_0xc3fb7c,_0xb00c('0x1a'));_0x55b865(_0x529520[_0xb00c('0x1b')][_0xb00c('0x19')]);}})['catch'](function(_0x32fbef){logger[_0xb00c('0x17')]('SmsQueue,\x20%s,\x20%s',_0xc3fb7c,_0x32fbef);_0x5a7a21(_0x32fbef);});});}exports[_0xb00c('0x1c')]=function(_0x4ad90f){var _0x24ebd2=this;return new Promise(function(_0x2b02d4,_0x29a8ac){return db[_0xb00c('0x1d')][_0xb00c('0x1e')]({'raw':_0x4ad90f[_0xb00c('0x1f')]?_0x4ad90f['options'][_0xb00c('0x20')]===undefined?!![]:![]:!![],'where':_0x4ad90f[_0xb00c('0x1f')]?_0x4ad90f[_0xb00c('0x1f')][_0xb00c('0x21')]||null:null,'attributes':_0x4ad90f[_0xb00c('0x1f')]?_0x4ad90f[_0xb00c('0x1f')][_0xb00c('0x22')]||null:null,'limit':_0x4ad90f[_0xb00c('0x1f')]?_0x4ad90f[_0xb00c('0x1f')][_0xb00c('0x23')]||null:null,'include':_0x4ad90f['options']?_0x4ad90f[_0xb00c('0x1f')][_0xb00c('0x24')]?_[_0xb00c('0x25')](_0x4ad90f['options'][_0xb00c('0x24')],function(_0x591827){return{'model':db[_0x591827[_0xb00c('0x26')]],'as':_0x591827['as'],'attributes':_0x591827['attributes'],'include':_0x591827['include']?_['map'](_0x591827[_0xb00c('0x24')],function(_0x357a62){return{'model':db[_0x357a62['model']],'as':_0x357a62['as'],'attributes':_0x357a62[_0xb00c('0x22')],'include':_0x357a62['include']?_['map'](_0x357a62[_0xb00c('0x24')],function(_0x599c3e){return{'model':db[_0x599c3e[_0xb00c('0x26')]],'as':_0x599c3e['as'],'attributes':_0x599c3e[_0xb00c('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xfc7219){logger[_0xb00c('0x13')](_0xb00c('0x1c'),_0x4ad90f);logger['debug']('GetSmsQueue',_0x4ad90f,JSON[_0xb00c('0x16')](_0xfc7219));_0x2b02d4(_0xfc7219);})[_0xb00c('0x27')](function(_0x8b55c7){logger[_0xb00c('0x17')]('GetSmsQueue',_0x8b55c7[_0xb00c('0x19')],_0x4ad90f);_0x29a8ac(_0x24ebd2[_0xb00c('0x17')](0x1f4,_0x8b55c7[_0xb00c('0x19')]));});});};exports[_0xb00c('0x28')]=function(_0x313a76){var _0x525ed3=this;return new Promise(function(_0x344574,_0x363274){return db['SmsQueue'][_0xb00c('0x29')]({'raw':_0x313a76[_0xb00c('0x1f')]?_0x313a76['options'][_0xb00c('0x20')]===undefined?!![]:![]:!![],'where':_0x313a76[_0xb00c('0x1f')]?_0x313a76[_0xb00c('0x1f')][_0xb00c('0x21')]||null:null,'attributes':_0x313a76[_0xb00c('0x1f')]?_0x313a76[_0xb00c('0x1f')][_0xb00c('0x22')]||null:null,'include':_0x313a76[_0xb00c('0x1f')]?_0x313a76[_0xb00c('0x1f')][_0xb00c('0x24')]?_[_0xb00c('0x25')](_0x313a76[_0xb00c('0x1f')][_0xb00c('0x24')],function(_0x530996){return{'model':db[_0x530996[_0xb00c('0x26')]],'as':_0x530996['as'],'attributes':_0x530996[_0xb00c('0x22')],'include':_0x530996[_0xb00c('0x24')]?_['map'](_0x530996[_0xb00c('0x24')],function(_0x344648){return{'model':db[_0x344648[_0xb00c('0x26')]],'as':_0x344648['as'],'attributes':_0x344648[_0xb00c('0x22')],'include':_0x344648['include']?_[_0xb00c('0x25')](_0x344648[_0xb00c('0x24')],function(_0x1a3056){return{'model':db[_0x1a3056[_0xb00c('0x26')]],'as':_0x1a3056['as'],'attributes':_0x1a3056[_0xb00c('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45c756){logger['info'](_0xb00c('0x28'),_0x313a76);logger['debug']('ShowSmsQueue',_0x313a76,JSON[_0xb00c('0x16')](_0x45c756));_0x344574(_0x45c756);})[_0xb00c('0x27')](function(_0x2c79fc){logger['error']('ShowSmsQueue',_0x2c79fc[_0xb00c('0x19')],_0x313a76);_0x363274(_0x525ed3[_0xb00c('0x17')](0x1f4,_0x2c79fc[_0xb00c('0x19')]));});});};
\ No newline at end of file
+var _0x9632=['attributes','limit','include','map','model','find','where','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./smsQueue.socket','register','then','info','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SmsQueue,\x20%s,\x20%s','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw'];(function(_0x15831c,_0xb1b56b){var _0x431518=function(_0x26f524){while(--_0x26f524){_0x15831c['push'](_0x15831c['shift']());}};_0x431518(++_0xb1b56b);}(_0x9632,0x135));var _0x2963=function(_0x23129b,_0x2d13ae){_0x23129b=_0x23129b-0x0;var _0x3b2fe9=_0x9632[_0x23129b];return _0x3b2fe9;};'use strict';var _=require(_0x2963('0x0'));var util=require(_0x2963('0x1'));var moment=require(_0x2963('0x2'));var BPromise=require(_0x2963('0x3'));var rs=require(_0x2963('0x4'));var fs=require('fs');var Redis=require(_0x2963('0x5'));var db=require(_0x2963('0x6'))['db'];var utils=require(_0x2963('0x7'));var logger=require(_0x2963('0x8'))(_0x2963('0x9'));var config=require(_0x2963('0xa'));var jayson=require(_0x2963('0xb'));var client=jayson[_0x2963('0xc')][_0x2963('0xd')]({'port':0x232a});config[_0x2963('0xe')]=_['defaults'](config['redis'],{'host':_0x2963('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2963('0xe')]));require(_0x2963('0x10'))[_0x2963('0x11')](socket);function respondWithRpcPromise(_0x3550d6,_0x582a4a,_0x2cc05d){return new BPromise(function(_0x4f6143,_0x4696fc){return client['request'](_0x3550d6,_0x2cc05d)[_0x2963('0x12')](function(_0x2b76a8){logger[_0x2963('0x13')]('SmsQueue,\x20%s,\x20%s',_0x582a4a,'request\x20sent');logger[_0x2963('0x14')](_0x2963('0x15'),_0x582a4a,_0x2963('0x16'),JSON[_0x2963('0x17')](_0x2b76a8));if(_0x2b76a8['error']){if(_0x2b76a8[_0x2963('0x18')][_0x2963('0x19')]===0x1f4){logger[_0x2963('0x18')]('SmsQueue,\x20%s,\x20%s',_0x582a4a,_0x2b76a8[_0x2963('0x18')]['message']);return _0x4696fc(_0x2b76a8[_0x2963('0x18')][_0x2963('0x1a')]);}logger['error'](_0x2963('0x1b'),_0x582a4a,_0x2b76a8['error']['message']);return _0x4f6143(_0x2b76a8['error'][_0x2963('0x1a')]);}else{logger['info'](_0x2963('0x1b'),_0x582a4a,_0x2963('0x16'));_0x4f6143(_0x2b76a8[_0x2963('0x1c')][_0x2963('0x1a')]);}})[_0x2963('0x1d')](function(_0x15e3c4){logger[_0x2963('0x18')](_0x2963('0x1b'),_0x582a4a,_0x15e3c4);_0x4696fc(_0x15e3c4);});});}exports[_0x2963('0x1e')]=function(_0x10c46c){var _0x542234=this;return new Promise(function(_0x4cdcfc,_0x33590e){return db[_0x2963('0x1f')][_0x2963('0x20')]({'raw':_0x10c46c['options']?_0x10c46c[_0x2963('0x21')][_0x2963('0x22')]===undefined?!![]:![]:!![],'where':_0x10c46c[_0x2963('0x21')]?_0x10c46c['options']['where']||null:null,'attributes':_0x10c46c[_0x2963('0x21')]?_0x10c46c[_0x2963('0x21')][_0x2963('0x23')]||null:null,'limit':_0x10c46c[_0x2963('0x21')]?_0x10c46c[_0x2963('0x21')][_0x2963('0x24')]||null:null,'include':_0x10c46c[_0x2963('0x21')]?_0x10c46c['options']['include']?_['map'](_0x10c46c[_0x2963('0x21')][_0x2963('0x25')],function(_0x527b7f){return{'model':db[_0x527b7f['model']],'as':_0x527b7f['as'],'attributes':_0x527b7f[_0x2963('0x23')],'include':_0x527b7f[_0x2963('0x25')]?_[_0x2963('0x26')](_0x527b7f[_0x2963('0x25')],function(_0x222536){return{'model':db[_0x222536[_0x2963('0x27')]],'as':_0x222536['as'],'attributes':_0x222536[_0x2963('0x23')],'include':_0x222536['include']?_[_0x2963('0x26')](_0x222536[_0x2963('0x25')],function(_0x353ff7){return{'model':db[_0x353ff7[_0x2963('0x27')]],'as':_0x353ff7['as'],'attributes':_0x353ff7[_0x2963('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x523f1f){logger[_0x2963('0x13')](_0x2963('0x1e'),_0x10c46c);logger['debug'](_0x2963('0x1e'),_0x10c46c,JSON['stringify'](_0x523f1f));_0x4cdcfc(_0x523f1f);})[_0x2963('0x1d')](function(_0x40f6a8){logger[_0x2963('0x18')](_0x2963('0x1e'),_0x40f6a8['message'],_0x10c46c);_0x33590e(_0x542234[_0x2963('0x18')](0x1f4,_0x40f6a8['message']));});});};exports['ShowSmsQueue']=function(_0x1221f9){var _0x346346=this;return new Promise(function(_0x291f78,_0x21f380){return db[_0x2963('0x1f')][_0x2963('0x28')]({'raw':_0x1221f9[_0x2963('0x21')]?_0x1221f9[_0x2963('0x21')][_0x2963('0x22')]===undefined?!![]:![]:!![],'where':_0x1221f9['options']?_0x1221f9[_0x2963('0x21')][_0x2963('0x29')]||null:null,'attributes':_0x1221f9[_0x2963('0x21')]?_0x1221f9[_0x2963('0x21')][_0x2963('0x23')]||null:null,'include':_0x1221f9[_0x2963('0x21')]?_0x1221f9[_0x2963('0x21')][_0x2963('0x25')]?_['map'](_0x1221f9['options'][_0x2963('0x25')],function(_0x3670f0){return{'model':db[_0x3670f0[_0x2963('0x27')]],'as':_0x3670f0['as'],'attributes':_0x3670f0['attributes'],'include':_0x3670f0[_0x2963('0x25')]?_['map'](_0x3670f0[_0x2963('0x25')],function(_0x3ad55e){return{'model':db[_0x3ad55e[_0x2963('0x27')]],'as':_0x3ad55e['as'],'attributes':_0x3ad55e[_0x2963('0x23')],'include':_0x3ad55e[_0x2963('0x25')]?_[_0x2963('0x26')](_0x3ad55e[_0x2963('0x25')],function(_0xf4ec24){return{'model':db[_0xf4ec24[_0x2963('0x27')]],'as':_0xf4ec24['as'],'attributes':_0xf4ec24[_0x2963('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50ee1f){logger[_0x2963('0x13')]('ShowSmsQueue',_0x1221f9);logger[_0x2963('0x14')]('ShowSmsQueue',_0x1221f9,JSON[_0x2963('0x17')](_0x50ee1f));_0x291f78(_0x50ee1f);})[_0x2963('0x1d')](function(_0x325cf5){logger[_0x2963('0x18')](_0x2963('0x2a'),_0x325cf5['message'],_0x1221f9);_0x21f380(_0x346346[_0x2963('0x18')](0x1f4,_0x325cf5[_0x2963('0x1a')]));});});};
\ No newline at end of file
index 837772d..715d5fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb332=['remove','removeListener','smsQueue:','./smsQueue.events','save'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xb332,0xe4));var _0x2b33=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0xb332[_0xfcbcb8];return _0x1b1f97;};'use strict';var SmsQueueEvents=require(_0x2b33('0x0'));var events=[_0x2b33('0x1'),_0x2b33('0x2'),'update'];function createListener(_0x47061f,_0x3549a9){return function(_0x400f7f){_0x3549a9['emit'](_0x47061f,_0x400f7f);};}function removeListener(_0x6e6d54,_0x352900){return function(){SmsQueueEvents[_0x2b33('0x3')](_0x6e6d54,_0x352900);};}exports['register']=function(_0x21a95d){for(var _0xa7b600=0x0,_0x506adf=events['length'];_0xa7b600<_0x506adf;_0xa7b600++){var _0x528dfe=events[_0xa7b600];var _0x58b71c=createListener(_0x2b33('0x4')+_0x528dfe,_0x21a95d);SmsQueueEvents['on'](_0x528dfe,_0x58b71c);}};
\ No newline at end of file
+var _0x69c0=['remove','removeListener','register','length','smsQueue:','save'];(function(_0x5dbf14,_0x234044){var _0x4bea42=function(_0x222bec){while(--_0x222bec){_0x5dbf14['push'](_0x5dbf14['shift']());}};_0x4bea42(++_0x234044);}(_0x69c0,0x1c7));var _0x069c=function(_0x335a62,_0xfafea4){_0x335a62=_0x335a62-0x0;var _0x249a9a=_0x69c0[_0x335a62];return _0x249a9a;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x069c('0x0'),_0x069c('0x1'),'update'];function createListener(_0x32597e,_0x30057b){return function(_0x1cf7e8){_0x30057b['emit'](_0x32597e,_0x1cf7e8);};}function removeListener(_0x295536,_0x3b3e98){return function(){SmsQueueEvents[_0x069c('0x2')](_0x295536,_0x3b3e98);};}exports[_0x069c('0x3')]=function(_0x5d3a64){for(var _0x6a2594=0x0,_0x39ce46=events[_0x069c('0x4')];_0x6a2594<_0x39ce46;_0x6a2594++){var _0x519ce3=events[_0x6a2594];var _0x3c2ab6=createListener(_0x069c('0x5')+_0x519ce3,_0x5d3a64);SmsQueueEvents['on'](_0x519ce3,_0x3c2ab6);}};
\ No newline at end of file
index cc894d6..55487fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd056=['index','get','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated'];(function(_0x1c0265,_0xb11780){var _0x9cb382=function(_0xa071f1){while(--_0xa071f1){_0x1c0265['push'](_0x1c0265['shift']());}};_0x9cb382(++_0xb11780);}(_0xd056,0x13f));var _0x6d05=function(_0x44cc63,_0x4facfc){_0x44cc63=_0x44cc63-0x0;var _0xdc34d=_0xd056[_0x44cc63];return _0xdc34d;};'use strict';var multer=require(_0x6d05('0x0'));var util=require(_0x6d05('0x1'));var path=require('path');var timeout=require(_0x6d05('0x2'));var express=require(_0x6d05('0x3'));var router=express[_0x6d05('0x4')]();var fs_extra=require(_0x6d05('0x5'));var auth=require(_0x6d05('0x6'));var interaction=require(_0x6d05('0x7'));var config=require(_0x6d05('0x8'));var controller=require(_0x6d05('0x9'));router['get']('/',auth[_0x6d05('0xa')](),controller[_0x6d05('0xb')]);router[_0x6d05('0xc')]('/describe',auth[_0x6d05('0xa')](),controller[_0x6d05('0xd')]);router[_0x6d05('0xc')](_0x6d05('0xe'),auth['isAuthenticated'](),controller[_0x6d05('0xf')]);router[_0x6d05('0x10')]('/',auth['isAuthenticated'](),controller[_0x6d05('0x11')]);router[_0x6d05('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6d05('0x13')](_0x6d05('0xe'),auth[_0x6d05('0xa')](),controller[_0x6d05('0x14')]);module[_0x6d05('0x15')]=router;
\ No newline at end of file
+var _0xb35d=['get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x2ed3c2,_0x23fbfa){var _0x991c=function(_0x3419ab){while(--_0x3419ab){_0x2ed3c2['push'](_0x2ed3c2['shift']());}};_0x991c(++_0x23fbfa);}(_0xb35d,0x19c));var _0xdb35=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0xb35d[_0x104e21];return _0x605b37;};'use strict';var multer=require(_0xdb35('0x0'));var util=require(_0xdb35('0x1'));var path=require(_0xdb35('0x2'));var timeout=require(_0xdb35('0x3'));var express=require(_0xdb35('0x4'));var router=express[_0xdb35('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdb35('0x6'));var config=require(_0xdb35('0x7'));var controller=require('./smsQueueReport.controller');router[_0xdb35('0x8')]('/',auth[_0xdb35('0x9')](),controller[_0xdb35('0xa')]);router[_0xdb35('0x8')](_0xdb35('0xb'),auth[_0xdb35('0x9')](),controller[_0xdb35('0xc')]);router[_0xdb35('0x8')](_0xdb35('0xd'),auth[_0xdb35('0x9')](),controller[_0xdb35('0xe')]);router['post']('/',auth[_0xdb35('0x9')](),controller[_0xdb35('0xf')]);router[_0xdb35('0x10')](_0xdb35('0xd'),auth[_0xdb35('0x9')](),controller[_0xdb35('0x11')]);router[_0xdb35('0x12')](_0xdb35('0xd'),auth[_0xdb35('0x9')](),controller['destroy']);module[_0xdb35('0x13')]=router;
\ No newline at end of file
index d6c2d77..5750369 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ab=['sequelize','exports','STRING','DATE','moment'];(function(_0x2d8c1c,_0x40d07c){var _0x4f89c0=function(_0x238d58){while(--_0x238d58){_0x2d8c1c['push'](_0x2d8c1c['shift']());}};_0x4f89c0(++_0x40d07c);}(_0x53ab,0x130));var _0xb53a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53ab[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xb53a('0x0'));var Sequelize=require(_0xb53a('0x1'));module[_0xb53a('0x2')]={'uniqueid':{'type':Sequelize[_0xb53a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb53a('0x3')]},'joinAt':{'type':Sequelize[_0xb53a('0x4')]},'leaveAt':{'type':Sequelize[_0xb53a('0x4')]},'acceptAt':{'type':Sequelize[_0xb53a('0x4')]},'exitAt':{'type':Sequelize[_0xb53a('0x4')]},'reason':{'type':Sequelize[_0xb53a('0x3')]}};
\ No newline at end of file
+var _0x5d56=['STRING','DATE','moment','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5d56,0x6b));var _0x65d5=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5d56[_0x3e5086];return _0xfeb102;};'use strict';var moment=require(_0x65d5('0x0'));var Sequelize=require(_0x65d5('0x1'));module[_0x65d5('0x2')]={'uniqueid':{'type':Sequelize[_0x65d5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x65d5('0x3')]},'joinAt':{'type':Sequelize[_0x65d5('0x4')]},'leaveAt':{'type':Sequelize[_0x65d5('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x65d5('0x4')]},'reason':{'type':Sequelize[_0x65d5('0x3')]}};
\ No newline at end of file
index 1f45ff0..b535fe8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64c8=['status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','error','stack','name','send','map','SmsQueueReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end'];(function(_0x2f4c5e,_0x452c1a){var _0x3e19a9=function(_0x445758){while(--_0x445758){_0x2f4c5e['push'](_0x2f4c5e['shift']());}};_0x3e19a9(++_0x452c1a);}(_0x64c8,0x106));var _0x864c=function(_0x1aaf29,_0x5c04c4){_0x1aaf29=_0x1aaf29-0x0;var _0x8e9920=_0x64c8[_0x1aaf29];return _0x8e9920;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x864c('0x0'));var zipdir=require(_0x864c('0x1'));var jsonpatch=require(_0x864c('0x2'));var rp=require(_0x864c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x864c('0x4'));var util=require(_0x864c('0x5'));var path=require(_0x864c('0x6'));var sox=require('sox');var csv=require(_0x864c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x864c('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x864c('0x9'));var toCsv=require('to-csv');var querystring=require(_0x864c('0xa'));var Papa=require(_0x864c('0xb'));var Redis=require(_0x864c('0xc'));var authService=require(_0x864c('0xd'));var qs=require(_0x864c('0xe'));var as=require(_0x864c('0xf'));var hardwareService=require(_0x864c('0x10'));var logger=require('../../config/logger')(_0x864c('0x11'));var utils=require(_0x864c('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x864c('0x13'))['db'];function respondWithStatusCode(_0x5622a3,_0x220948){_0x220948=_0x220948||0xcc;return function(_0x1cff95){if(_0x1cff95){return _0x5622a3[_0x864c('0x14')](_0x220948);}return _0x5622a3['status'](_0x220948)[_0x864c('0x15')]();};}function respondWithResult(_0x3fdb38,_0x45ed67){_0x45ed67=_0x45ed67||0xc8;return function(_0x4fbbac){if(_0x4fbbac){return _0x3fdb38[_0x864c('0x16')](_0x45ed67)['json'](_0x4fbbac);}};}function respondWithFilteredResult(_0x5e9f18,_0xc17157){return function(_0xa85510){if(_0xa85510){var _0x882182=typeof _0xc17157[_0x864c('0x17')]===_0x864c('0x18')&&typeof _0xc17157[_0x864c('0x19')]===_0x864c('0x18');var _0x153db1=_0xa85510['count'];var _0x80e4ab=_0x882182?0x0:_0xc17157[_0x864c('0x17')];var _0x2d1dff=_0x882182?_0xa85510[_0x864c('0x1a')]:_0xc17157[_0x864c('0x17')]+_0xc17157[_0x864c('0x19')];var _0x39a7a1;if(_0x2d1dff>=_0x153db1){_0x2d1dff=_0x153db1;_0x39a7a1=0xc8;}else{_0x39a7a1=0xce;}_0x5e9f18[_0x864c('0x16')](_0x39a7a1);return _0x5e9f18[_0x864c('0x1b')](_0x864c('0x1c'),_0x80e4ab+'-'+_0x2d1dff+'/'+_0x153db1)[_0x864c('0x1d')](_0xa85510);}return null;};}function patchUpdates(_0x32d3de){return function(_0x1fbd69){try{jsonpatch[_0x864c('0x1e')](_0x1fbd69,_0x32d3de,!![]);}catch(_0x5eaf5f){return BPromise['reject'](_0x5eaf5f);}return _0x1fbd69[_0x864c('0x1f')]();};}function saveUpdates(_0x1af71d,_0x9f45eb){return function(_0x5f156d){if(_0x5f156d){return _0x5f156d['update'](_0x1af71d)[_0x864c('0x20')](function(_0xa9dbc2){return _0xa9dbc2;});}return null;};}function removeEntity(_0x2685df,_0x4e7877){return function(_0x19df2c){if(_0x19df2c){return _0x19df2c['destroy']()[_0x864c('0x20')](function(){_0x2685df[_0x864c('0x16')](0xcc)[_0x864c('0x15')]();});}};}function handleEntityNotFound(_0x24e602,_0x4e08f7){return function(_0x543354){if(!_0x543354){_0x24e602[_0x864c('0x14')](0x194);}return _0x543354;};}function handleError(_0x1e166a,_0xa50ab9){_0xa50ab9=_0xa50ab9||0x1f4;return function(_0xb3189){logger[_0x864c('0x21')](_0xb3189[_0x864c('0x22')]);if(_0xb3189[_0x864c('0x23')]){delete _0xb3189[_0x864c('0x23')];}_0x1e166a[_0x864c('0x16')](_0xa50ab9)[_0x864c('0x24')](_0xb3189);};}exports['index']=function(_0x13246,_0x5eb487){var _0x27a7b4={},_0x443420={},_0x12a11c={'count':0x0,'rows':[]};var _0x2121ba=_[_0x864c('0x25')](db[_0x864c('0x26')][_0x864c('0x27')],function(_0x46d308){return{'name':_0x46d308[_0x864c('0x28')],'type':_0x46d308[_0x864c('0x29')]['key']};});_0x443420['model']=_['map'](_0x2121ba,'name');_0x443420[_0x864c('0x2a')]=_[_0x864c('0x2b')](_0x13246[_0x864c('0x2a')]);_0x443420['filters']=_[_0x864c('0x2c')](_0x443420[_0x864c('0x2d')],_0x443420[_0x864c('0x2a')]);_0x27a7b4[_0x864c('0x2e')]=_['intersection'](_0x443420['model'],qs[_0x864c('0x2f')](_0x13246[_0x864c('0x2a')][_0x864c('0x2f')]));_0x27a7b4[_0x864c('0x2e')]=_0x27a7b4[_0x864c('0x2e')][_0x864c('0x30')]?_0x27a7b4[_0x864c('0x2e')]:_0x443420['model'];if(!_0x13246[_0x864c('0x2a')][_0x864c('0x31')](_0x864c('0x32'))){_0x27a7b4[_0x864c('0x19')]=qs['limit'](_0x13246[_0x864c('0x2a')][_0x864c('0x19')]);_0x27a7b4[_0x864c('0x17')]=qs[_0x864c('0x17')](_0x13246[_0x864c('0x2a')]['offset']);}_0x27a7b4[_0x864c('0x33')]=qs[_0x864c('0x34')](_0x13246[_0x864c('0x2a')][_0x864c('0x34')]);_0x27a7b4[_0x864c('0x35')]=qs[_0x864c('0x36')](_[_0x864c('0x37')](_0x13246[_0x864c('0x2a')],_0x443420[_0x864c('0x36')]),_0x2121ba);if(_0x13246['query'][_0x864c('0x38')]){_0x27a7b4[_0x864c('0x35')]=_[_0x864c('0x39')](_0x27a7b4[_0x864c('0x35')],{'$or':_[_0x864c('0x25')](_0x2121ba,function(_0x26b094){if(_0x26b094['type']!==_0x864c('0x3a')){var _0x45d14a={};_0x45d14a[_0x26b094[_0x864c('0x23')]]={'$like':'%'+_0x13246['query'][_0x864c('0x38')]+'%'};return _0x45d14a;}})});}_0x27a7b4=_[_0x864c('0x39')]({},_0x27a7b4,_0x13246['options']);var _0x37757a={'where':_0x27a7b4[_0x864c('0x35')]};return db['SmsQueueReport'][_0x864c('0x1a')](_0x37757a)[_0x864c('0x20')](function(_0x53d1bc){_0x12a11c[_0x864c('0x1a')]=_0x53d1bc;if(_0x13246['query'][_0x864c('0x3b')]){_0x27a7b4[_0x864c('0x3c')]=[{'all':!![]}];}return db[_0x864c('0x26')][_0x864c('0x3d')](_0x27a7b4);})[_0x864c('0x20')](function(_0x58b991){_0x12a11c[_0x864c('0x3e')]=_0x58b991;return _0x12a11c;})['then'](respondWithFilteredResult(_0x5eb487,_0x27a7b4))[_0x864c('0x3f')](handleError(_0x5eb487,null));};exports[_0x864c('0x40')]=function(_0x12767,_0x1ae948){var _0x432f99={'raw':!![],'where':{'id':_0x12767['params']['id']}},_0x34d911={};_0x34d911[_0x864c('0x2d')]=_[_0x864c('0x2b')](db[_0x864c('0x26')]['rawAttributes']);_0x34d911['query']=_[_0x864c('0x2b')](_0x12767['query']);_0x34d911[_0x864c('0x36')]=_['intersection'](_0x34d911[_0x864c('0x2d')],_0x34d911['query']);_0x432f99[_0x864c('0x2e')]=_[_0x864c('0x2c')](_0x34d911['model'],qs[_0x864c('0x2f')](_0x12767[_0x864c('0x2a')][_0x864c('0x2f')]));_0x432f99['attributes']=_0x432f99[_0x864c('0x2e')][_0x864c('0x30')]?_0x432f99[_0x864c('0x2e')]:_0x34d911[_0x864c('0x2d')];if(_0x12767[_0x864c('0x2a')][_0x864c('0x3b')]){_0x432f99[_0x864c('0x3c')]=[{'all':!![]}];}_0x432f99=_[_0x864c('0x39')]({},_0x432f99,_0x12767['options']);return db[_0x864c('0x26')][_0x864c('0x41')](_0x432f99)[_0x864c('0x20')](handleEntityNotFound(_0x1ae948,null))[_0x864c('0x20')](respondWithResult(_0x1ae948,null))[_0x864c('0x3f')](handleError(_0x1ae948,null));};exports['create']=function(_0x5b356d,_0x4e2f5f){return db[_0x864c('0x26')][_0x864c('0x42')](_0x5b356d[_0x864c('0x43')],{})[_0x864c('0x20')](respondWithResult(_0x4e2f5f,0xc9))[_0x864c('0x3f')](handleError(_0x4e2f5f,null));};exports[_0x864c('0x44')]=function(_0x2413bf,_0x4c82e9){if(_0x2413bf['body']['id']){delete _0x2413bf['body']['id'];}return db[_0x864c('0x26')][_0x864c('0x41')]({'where':{'id':_0x2413bf['params']['id']}})[_0x864c('0x20')](handleEntityNotFound(_0x4c82e9,null))['then'](saveUpdates(_0x2413bf['body'],null))[_0x864c('0x20')](respondWithResult(_0x4c82e9,null))[_0x864c('0x3f')](handleError(_0x4c82e9,null));};exports[_0x864c('0x45')]=function(_0x57c1fa,_0xcbcf58){return db[_0x864c('0x26')][_0x864c('0x41')]({'where':{'id':_0x57c1fa['params']['id']}})[_0x864c('0x20')](handleEntityNotFound(_0xcbcf58,null))[_0x864c('0x20')](removeEntity(_0xcbcf58,null))['catch'](handleError(_0xcbcf58,null));};exports['describe']=function(_0x41ed68,_0x26d03e){return db['SmsQueueReport'][_0x864c('0x46')]()['then'](respondWithResult(_0x26d03e,null))[_0x864c('0x3f')](handleError(_0x26d03e,null));};
\ No newline at end of file
+var _0x17fb=['zip-dir','fast-json-patch','request-promise','bluebird','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','save','update','then','destroy','error','name','send','index','map','SmsQueueReport','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','describe','rimraf'];(function(_0x2daf57,_0x582cb9){var _0x5cac34=function(_0x4c4ba4){while(--_0x4c4ba4){_0x2daf57['push'](_0x2daf57['shift']());}};_0x5cac34(++_0x582cb9);}(_0x17fb,0x1c7));var _0xb17f=function(_0xdbe2de,_0x3bdc5a){_0xdbe2de=_0xdbe2de-0x0;var _0x2facd7=_0x17fb[_0xdbe2de];return _0x2facd7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb17f('0x0'));var zipdir=require(_0xb17f('0x1'));var jsonpatch=require(_0xb17f('0x2'));var rp=require(_0xb17f('0x3'));var moment=require('moment');var BPromise=require(_0xb17f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb17f('0x5'));var sox=require(_0xb17f('0x6'));var csv=require(_0xb17f('0x7'));var ejs=require(_0xb17f('0x8'));var fs=require('fs');var fs_extra=require(_0xb17f('0x9'));var _=require(_0xb17f('0xa'));var squel=require(_0xb17f('0xb'));var crypto=require(_0xb17f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb17f('0xd'));var toCsv=require(_0xb17f('0x7'));var querystring=require(_0xb17f('0xe'));var Papa=require(_0xb17f('0xf'));var Redis=require(_0xb17f('0x10'));var authService=require(_0xb17f('0x11'));var qs=require(_0xb17f('0x12'));var as=require(_0xb17f('0x13'));var hardwareService=require(_0xb17f('0x14'));var logger=require(_0xb17f('0x15'))(_0xb17f('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb17f('0x17'));var db=require(_0xb17f('0x18'))['db'];function respondWithStatusCode(_0x3186a4,_0x5e6d42){_0x5e6d42=_0x5e6d42||0xcc;return function(_0x37e7f5){if(_0x37e7f5){return _0x3186a4[_0xb17f('0x19')](_0x5e6d42);}return _0x3186a4[_0xb17f('0x1a')](_0x5e6d42)[_0xb17f('0x1b')]();};}function respondWithResult(_0x3e4815,_0x1b616f){_0x1b616f=_0x1b616f||0xc8;return function(_0x1d58e1){if(_0x1d58e1){return _0x3e4815[_0xb17f('0x1a')](_0x1b616f)[_0xb17f('0x1c')](_0x1d58e1);}};}function respondWithFilteredResult(_0x4543f0,_0x5f61cb){return function(_0x322ff5){if(_0x322ff5){var _0x2fc7ae=typeof _0x5f61cb[_0xb17f('0x1d')]==='undefined'&&typeof _0x5f61cb[_0xb17f('0x1e')]==='undefined';var _0x60b0f5=_0x322ff5['count'];var _0x470412=_0x2fc7ae?0x0:_0x5f61cb[_0xb17f('0x1d')];var _0x2cce82=_0x2fc7ae?_0x322ff5[_0xb17f('0x1f')]:_0x5f61cb[_0xb17f('0x1d')]+_0x5f61cb[_0xb17f('0x1e')];var _0x148c6e;if(_0x2cce82>=_0x60b0f5){_0x2cce82=_0x60b0f5;_0x148c6e=0xc8;}else{_0x148c6e=0xce;}_0x4543f0[_0xb17f('0x1a')](_0x148c6e);return _0x4543f0[_0xb17f('0x20')]('Content-Range',_0x470412+'-'+_0x2cce82+'/'+_0x60b0f5)[_0xb17f('0x1c')](_0x322ff5);}return null;};}function patchUpdates(_0x28c2ee){return function(_0x598098){try{jsonpatch[_0xb17f('0x21')](_0x598098,_0x28c2ee,!![]);}catch(_0x3531bf){return BPromise['reject'](_0x3531bf);}return _0x598098[_0xb17f('0x22')]();};}function saveUpdates(_0x9b44ff,_0x1edf9e){return function(_0x55fce5){if(_0x55fce5){return _0x55fce5[_0xb17f('0x23')](_0x9b44ff)[_0xb17f('0x24')](function(_0x51ec1a){return _0x51ec1a;});}return null;};}function removeEntity(_0x2c0744,_0x54a200){return function(_0x4a5f99){if(_0x4a5f99){return _0x4a5f99[_0xb17f('0x25')]()['then'](function(){_0x2c0744['status'](0xcc)[_0xb17f('0x1b')]();});}};}function handleEntityNotFound(_0x3a370f,_0x5ba55f){return function(_0x397095){if(!_0x397095){_0x3a370f[_0xb17f('0x19')](0x194);}return _0x397095;};}function handleError(_0x36a4d1,_0x3272d4){_0x3272d4=_0x3272d4||0x1f4;return function(_0x3e74e6){logger[_0xb17f('0x26')](_0x3e74e6['stack']);if(_0x3e74e6['name']){delete _0x3e74e6[_0xb17f('0x27')];}_0x36a4d1[_0xb17f('0x1a')](_0x3272d4)[_0xb17f('0x28')](_0x3e74e6);};}exports[_0xb17f('0x29')]=function(_0x121fab,_0x14aa93){var _0x1c4d06={},_0x25bee0={},_0x20f62a={'count':0x0,'rows':[]};var _0x20f6aa=_[_0xb17f('0x2a')](db[_0xb17f('0x2b')][_0xb17f('0x2c')],function(_0x520096){return{'name':_0x520096['fieldName'],'type':_0x520096['type'][_0xb17f('0x2d')]};});_0x25bee0[_0xb17f('0x2e')]=_['map'](_0x20f6aa,_0xb17f('0x27'));_0x25bee0[_0xb17f('0x2f')]=_['keys'](_0x121fab[_0xb17f('0x2f')]);_0x25bee0[_0xb17f('0x30')]=_[_0xb17f('0x31')](_0x25bee0[_0xb17f('0x2e')],_0x25bee0[_0xb17f('0x2f')]);_0x1c4d06['attributes']=_['intersection'](_0x25bee0[_0xb17f('0x2e')],qs['fields'](_0x121fab[_0xb17f('0x2f')][_0xb17f('0x32')]));_0x1c4d06[_0xb17f('0x33')]=_0x1c4d06[_0xb17f('0x33')][_0xb17f('0x34')]?_0x1c4d06[_0xb17f('0x33')]:_0x25bee0[_0xb17f('0x2e')];if(!_0x121fab[_0xb17f('0x2f')][_0xb17f('0x35')](_0xb17f('0x36'))){_0x1c4d06[_0xb17f('0x1e')]=qs[_0xb17f('0x1e')](_0x121fab[_0xb17f('0x2f')][_0xb17f('0x1e')]);_0x1c4d06[_0xb17f('0x1d')]=qs[_0xb17f('0x1d')](_0x121fab[_0xb17f('0x2f')][_0xb17f('0x1d')]);}_0x1c4d06[_0xb17f('0x37')]=qs[_0xb17f('0x38')](_0x121fab[_0xb17f('0x2f')][_0xb17f('0x38')]);_0x1c4d06[_0xb17f('0x39')]=qs[_0xb17f('0x30')](_[_0xb17f('0x3a')](_0x121fab[_0xb17f('0x2f')],_0x25bee0['filters']),_0x20f6aa);if(_0x121fab['query'][_0xb17f('0x3b')]){_0x1c4d06[_0xb17f('0x39')]=_['merge'](_0x1c4d06[_0xb17f('0x39')],{'$or':_[_0xb17f('0x2a')](_0x20f6aa,function(_0x321614){if(_0x321614[_0xb17f('0x3c')]!==_0xb17f('0x3d')){var _0x32e1ff={};_0x32e1ff[_0x321614['name']]={'$like':'%'+_0x121fab[_0xb17f('0x2f')]['filter']+'%'};return _0x32e1ff;}})});}_0x1c4d06=_[_0xb17f('0x3e')]({},_0x1c4d06,_0x121fab[_0xb17f('0x3f')]);var _0x160fad={'where':_0x1c4d06[_0xb17f('0x39')]};return db[_0xb17f('0x2b')][_0xb17f('0x1f')](_0x160fad)[_0xb17f('0x24')](function(_0x6c7f36){_0x20f62a[_0xb17f('0x1f')]=_0x6c7f36;if(_0x121fab[_0xb17f('0x2f')][_0xb17f('0x40')]){_0x1c4d06[_0xb17f('0x41')]=[{'all':!![]}];}return db[_0xb17f('0x2b')][_0xb17f('0x42')](_0x1c4d06);})[_0xb17f('0x24')](function(_0x465459){_0x20f62a[_0xb17f('0x43')]=_0x465459;return _0x20f62a;})[_0xb17f('0x24')](respondWithFilteredResult(_0x14aa93,_0x1c4d06))['catch'](handleError(_0x14aa93,null));};exports[_0xb17f('0x44')]=function(_0x30e1ee,_0x484fb3){var _0x1ed27b={'raw':!![],'where':{'id':_0x30e1ee[_0xb17f('0x45')]['id']}},_0x102f72={};_0x102f72['model']=_[_0xb17f('0x46')](db[_0xb17f('0x2b')]['rawAttributes']);_0x102f72['query']=_[_0xb17f('0x46')](_0x30e1ee['query']);_0x102f72[_0xb17f('0x30')]=_[_0xb17f('0x31')](_0x102f72[_0xb17f('0x2e')],_0x102f72[_0xb17f('0x2f')]);_0x1ed27b[_0xb17f('0x33')]=_[_0xb17f('0x31')](_0x102f72[_0xb17f('0x2e')],qs[_0xb17f('0x32')](_0x30e1ee[_0xb17f('0x2f')]['fields']));_0x1ed27b[_0xb17f('0x33')]=_0x1ed27b['attributes'][_0xb17f('0x34')]?_0x1ed27b[_0xb17f('0x33')]:_0x102f72[_0xb17f('0x2e')];if(_0x30e1ee['query'][_0xb17f('0x40')]){_0x1ed27b['include']=[{'all':!![]}];}_0x1ed27b=_[_0xb17f('0x3e')]({},_0x1ed27b,_0x30e1ee[_0xb17f('0x3f')]);return db['SmsQueueReport'][_0xb17f('0x47')](_0x1ed27b)[_0xb17f('0x24')](handleEntityNotFound(_0x484fb3,null))[_0xb17f('0x24')](respondWithResult(_0x484fb3,null))['catch'](handleError(_0x484fb3,null));};exports['create']=function(_0x40f783,_0x3b05dd){return db[_0xb17f('0x2b')][_0xb17f('0x48')](_0x40f783[_0xb17f('0x49')],{})[_0xb17f('0x24')](respondWithResult(_0x3b05dd,0xc9))['catch'](handleError(_0x3b05dd,null));};exports['update']=function(_0x480caf,_0x51a795){if(_0x480caf[_0xb17f('0x49')]['id']){delete _0x480caf[_0xb17f('0x49')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x480caf['params']['id']}})[_0xb17f('0x24')](handleEntityNotFound(_0x51a795,null))[_0xb17f('0x24')](saveUpdates(_0x480caf['body'],null))[_0xb17f('0x24')](respondWithResult(_0x51a795,null))['catch'](handleError(_0x51a795,null));};exports['destroy']=function(_0x1f822e,_0x2b6037){return db['SmsQueueReport']['find']({'where':{'id':_0x1f822e['params']['id']}})[_0xb17f('0x24')](handleEntityNotFound(_0x2b6037,null))[_0xb17f('0x24')](removeEntity(_0x2b6037,null))[_0xb17f('0x4a')](handleError(_0x2b6037,null));};exports[_0xb17f('0x4b')]=function(_0x1e8fd4,_0xc99796){return db[_0xb17f('0x2b')][_0xb17f('0x4b')]()[_0xb17f('0x24')](respondWithResult(_0xc99796,null))['catch'](handleError(_0xc99796,null));};
\ No newline at end of file
index a305586..c5221b5 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','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x1bf809,_0x536f55){var _0x1caa4e=function(_0x9f9636){while(--_0x9f9636){_0x1bf809['push'](_0x1bf809['shift']());}};_0x1caa4e(++_0x536f55);}(_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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x5c38cd,_0x5a6b4e){var _0xc985ef=function(_0x4aa1df){while(--_0x4aa1df){_0x5c38cd['push'](_0x5c38cd['shift']());}};_0xc985ef(++_0x5a6b4e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 824e68f..a7476e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59e7=['error','message','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','UpdateSmsQueueReport','update','body','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x11e801,_0x5091de){var _0x4f102d=function(_0x6d6193){while(--_0x6d6193){_0x11e801['push'](_0x11e801['shift']());}};_0x4f102d(++_0x5091de);}(_0x59e7,0x91));var _0x759e=function(_0x48ccf5,_0x4ef990){_0x48ccf5=_0x48ccf5-0x0;var _0x1991bf=_0x59e7[_0x48ccf5];return _0x1991bf;};'use strict';var _=require(_0x759e('0x0'));var util=require(_0x759e('0x1'));var moment=require(_0x759e('0x2'));var BPromise=require(_0x759e('0x3'));var rs=require(_0x759e('0x4'));var fs=require('fs');var Redis=require(_0x759e('0x5'));var db=require(_0x759e('0x6'))['db'];var utils=require(_0x759e('0x7'));var logger=require(_0x759e('0x8'))('rpc');var config=require(_0x759e('0x9'));var jayson=require(_0x759e('0xa'));var client=jayson[_0x759e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8920,_0xa3277b,_0x5e3b31){return new BPromise(function(_0x1ecfef,_0x4b4a61){return client[_0x759e('0xc')](_0x5a8920,_0x5e3b31)[_0x759e('0xd')](function(_0x157ce0){logger[_0x759e('0xe')](_0x759e('0xf'),_0xa3277b,_0x759e('0x10'));logger[_0x759e('0x11')](_0x759e('0x12'),_0xa3277b,_0x759e('0x10'),JSON[_0x759e('0x13')](_0x157ce0));if(_0x157ce0[_0x759e('0x14')]){if(_0x157ce0[_0x759e('0x14')]['code']===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0xa3277b,_0x157ce0[_0x759e('0x14')]['message']);return _0x4b4a61(_0x157ce0[_0x759e('0x14')][_0x759e('0x15')]);}logger[_0x759e('0x14')](_0x759e('0xf'),_0xa3277b,_0x157ce0[_0x759e('0x14')][_0x759e('0x15')]);return _0x1ecfef(_0x157ce0[_0x759e('0x14')][_0x759e('0x15')]);}else{logger['info'](_0x759e('0xf'),_0xa3277b,'request\x20sent');_0x1ecfef(_0x157ce0['result'][_0x759e('0x15')]);}})[_0x759e('0x16')](function(_0x51b733){logger['error'](_0x759e('0xf'),_0xa3277b,_0x51b733);_0x4b4a61(_0x51b733);});});}exports[_0x759e('0x17')]=function(_0x266b40){var _0x3998e1=this;return new Promise(function(_0x91994,_0x2a593c){return db[_0x759e('0x18')][_0x759e('0x19')](_0x266b40['body'],{'raw':_0x266b40[_0x759e('0x1a')]?_0x266b40[_0x759e('0x1a')][_0x759e('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x1d1907){logger[_0x759e('0xe')]('CreateSmsQueueReport',_0x266b40);logger['debug']('CreateSmsQueueReport',_0x266b40,JSON[_0x759e('0x13')](_0x1d1907));_0x91994(_0x1d1907);})[_0x759e('0x16')](function(_0x1c2ecf){logger[_0x759e('0x14')](_0x759e('0x17'),_0x1c2ecf[_0x759e('0x15')],_0x266b40);_0x2a593c(_0x3998e1[_0x759e('0x14')](0x1f4,_0x1c2ecf[_0x759e('0x15')]));});});};exports[_0x759e('0x1c')]=function(_0x51da6c){var _0x4e6a08=this;return new Promise(function(_0x5288c1,_0x4e859d){return db[_0x759e('0x18')][_0x759e('0x1d')](_0x51da6c[_0x759e('0x1e')],{'raw':_0x51da6c[_0x759e('0x1a')]?_0x51da6c['options'][_0x759e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51da6c[_0x759e('0x1a')]?_0x51da6c[_0x759e('0x1a')]['where']||null:null,'attributes':_0x51da6c[_0x759e('0x1a')]?_0x51da6c['options'][_0x759e('0x1f')]||null:null,'limit':_0x51da6c[_0x759e('0x1a')]?_0x51da6c[_0x759e('0x1a')][_0x759e('0x20')]||null:null})[_0x759e('0xd')](function(_0x5153cc){logger[_0x759e('0xe')](_0x759e('0x1c'),_0x51da6c);logger['debug']('UpdateSmsQueueReport',_0x51da6c,JSON[_0x759e('0x13')](_0x5153cc));_0x5288c1(_0x5153cc);})[_0x759e('0x16')](function(_0x4a4529){logger[_0x759e('0x14')]('UpdateSmsQueueReport',_0x4a4529[_0x759e('0x15')],_0x51da6c);_0x4e859d(_0x4e6a08[_0x759e('0x14')](0x1f4,_0x4a4529[_0x759e('0x15')]));});});};
\ No newline at end of file
+var _0xa640=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','code','error','message','result','SmsQueueReport','create','options','raw','CreateSmsQueueReport','stringify','UpdateSmsQueueReport','body','where','attributes','catch','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa640,0xd5));var _0x0a64=function(_0x37bab4,_0x4fa85e){_0x37bab4=_0x37bab4-0x0;var _0x336d20=_0xa640[_0x37bab4];return _0x336d20;};'use strict';var _=require(_0x0a64('0x0'));var util=require(_0x0a64('0x1'));var moment=require(_0x0a64('0x2'));var BPromise=require(_0x0a64('0x3'));var rs=require(_0x0a64('0x4'));var fs=require('fs');var Redis=require(_0x0a64('0x5'));var db=require(_0x0a64('0x6'))['db'];var utils=require(_0x0a64('0x7'));var logger=require(_0x0a64('0x8'))(_0x0a64('0x9'));var config=require(_0x0a64('0xa'));var jayson=require(_0x0a64('0xb'));var client=jayson[_0x0a64('0xc')][_0x0a64('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x342e4e,_0x3f5609,_0x49c3bf){return new BPromise(function(_0xd28011,_0x33e536){return client[_0x0a64('0xe')](_0x342e4e,_0x49c3bf)[_0x0a64('0xf')](function(_0x3e8ba8){logger[_0x0a64('0x10')](_0x0a64('0x11'),_0x3f5609,_0x0a64('0x12'));logger[_0x0a64('0x13')](_0x0a64('0x14'),_0x3f5609,_0x0a64('0x12'),JSON['stringify'](_0x3e8ba8));if(_0x3e8ba8['error']){if(_0x3e8ba8['error'][_0x0a64('0x15')]===0x1f4){logger['error'](_0x0a64('0x11'),_0x3f5609,_0x3e8ba8[_0x0a64('0x16')][_0x0a64('0x17')]);return _0x33e536(_0x3e8ba8[_0x0a64('0x16')][_0x0a64('0x17')]);}logger[_0x0a64('0x16')]('SmsQueueReport,\x20%s,\x20%s',_0x3f5609,_0x3e8ba8[_0x0a64('0x16')][_0x0a64('0x17')]);return _0xd28011(_0x3e8ba8['error'][_0x0a64('0x17')]);}else{logger[_0x0a64('0x10')](_0x0a64('0x11'),_0x3f5609,'request\x20sent');_0xd28011(_0x3e8ba8[_0x0a64('0x18')]['message']);}})['catch'](function(_0x15db74){logger[_0x0a64('0x16')](_0x0a64('0x11'),_0x3f5609,_0x15db74);_0x33e536(_0x15db74);});});}exports['CreateSmsQueueReport']=function(_0x5207ff){var _0x2f94d0=this;return new Promise(function(_0x5205f0,_0x1022c3){return db[_0x0a64('0x19')][_0x0a64('0x1a')](_0x5207ff['body'],{'raw':_0x5207ff['options']?_0x5207ff[_0x0a64('0x1b')][_0x0a64('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x58442e){logger['info']('CreateSmsQueueReport',_0x5207ff);logger[_0x0a64('0x13')](_0x0a64('0x1d'),_0x5207ff,JSON[_0x0a64('0x1e')](_0x58442e));_0x5205f0(_0x58442e);})['catch'](function(_0x182b26){logger[_0x0a64('0x16')]('CreateSmsQueueReport',_0x182b26[_0x0a64('0x17')],_0x5207ff);_0x1022c3(_0x2f94d0[_0x0a64('0x16')](0x1f4,_0x182b26[_0x0a64('0x17')]));});});};exports[_0x0a64('0x1f')]=function(_0x2aed99){var _0x599168=this;return new Promise(function(_0x4764ff,_0x1cc2af){return db[_0x0a64('0x19')]['update'](_0x2aed99[_0x0a64('0x20')],{'raw':_0x2aed99[_0x0a64('0x1b')]?_0x2aed99[_0x0a64('0x1b')][_0x0a64('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2aed99[_0x0a64('0x1b')]?_0x2aed99[_0x0a64('0x1b')][_0x0a64('0x21')]||null:null,'attributes':_0x2aed99[_0x0a64('0x1b')]?_0x2aed99[_0x0a64('0x1b')][_0x0a64('0x22')]||null:null,'limit':_0x2aed99['options']?_0x2aed99[_0x0a64('0x1b')]['limit']||null:null})[_0x0a64('0xf')](function(_0x481636){logger['info'](_0x0a64('0x1f'),_0x2aed99);logger[_0x0a64('0x13')](_0x0a64('0x1f'),_0x2aed99,JSON['stringify'](_0x481636));_0x4764ff(_0x481636);})[_0x0a64('0x23')](function(_0x21345e){logger[_0x0a64('0x16')](_0x0a64('0x1f'),_0x21345e[_0x0a64('0x17')],_0x2aed99);_0x1cc2af(_0x599168[_0x0a64('0x16')](0x1f4,_0x21345e[_0x0a64('0x17')]));});});};
\ No newline at end of file
index a5f326d..a0f165d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41a=['/:id','show','post','create','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','describe'];(function(_0x24cf29,_0x590c1a){var _0x3974ef=function(_0xe758ea){while(--_0xe758ea){_0x24cf29['push'](_0x24cf29['shift']());}};_0x3974ef(++_0x590c1a);}(_0xa41a,0x6b));var _0xaa41=function(_0x32ac02,_0x44eaa3){_0x32ac02=_0x32ac02-0x0;var _0x2d83=_0xa41a[_0x32ac02];return _0x2d83;};'use strict';var multer=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var path=require('path');var timeout=require(_0xaa41('0x2'));var express=require(_0xaa41('0x3'));var router=express[_0xaa41('0x4')]();var fs_extra=require(_0xaa41('0x5'));var auth=require(_0xaa41('0x6'));var interaction=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var controller=require(_0xaa41('0x9'));router['get']('/',auth[_0xaa41('0xa')](),controller[_0xaa41('0xb')]);router['get']('/describe',auth[_0xaa41('0xa')](),controller[_0xaa41('0xc')]);router['get'](_0xaa41('0xd'),auth[_0xaa41('0xa')](),controller[_0xaa41('0xe')]);router[_0xaa41('0xf')]('/',auth[_0xaa41('0xa')](),controller[_0xaa41('0x10')]);router[_0xaa41('0x11')](_0xaa41('0xd'),auth[_0xaa41('0xa')](),controller['update']);router[_0xaa41('0x12')](_0xaa41('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xaa41('0x13')]=router;
\ No newline at end of file
+var _0x7fbe=['/describe','describe','/:id','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index'];(function(_0x10ceb7,_0x4ac9a1){var _0x29da59=function(_0x472b20){while(--_0x472b20){_0x10ceb7['push'](_0x10ceb7['shift']());}};_0x29da59(++_0x4ac9a1);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2aae31,_0x1014a2){_0x2aae31=_0x2aae31-0x0;var _0x379006=_0x7fbe[_0x2aae31];return _0x379006;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router;
\ No newline at end of file
index 54ddab6..d5623cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xad7a15,_0x11d7b6){var _0x319437=function(_0x4b5583){while(--_0x4b5583){_0xad7a15['push'](_0xad7a15['shift']());}};_0x319437(++_0x11d7b6);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x28b0a4,_0x2ea758){_0x28b0a4=_0x28b0a4-0x0;var _0x105ce6=_0xf3cd[_0x28b0a4];return _0x105ce6;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x3d9206,_0x4dcef2){var _0x5a5f9c=function(_0x3a0b3c){while(--_0x3a0b3c){_0x3d9206['push'](_0x3d9206['shift']());}};_0x5a5f9c(++_0x4dcef2);}(_0xedd9,0xfc));var _0x9edd=function(_0x2ee171,_0x24a6cb){_0x2ee171=_0x2ee171-0x0;var _0x9af003=_0xedd9[_0x2ee171];return _0x9af003;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
index 6a1b263..6e9a80c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e51=['update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','SmsTransferReport','findAll','catch','params','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject'];(function(_0x148a4d,_0xe6f5e8){var _0x51018a=function(_0x142539){while(--_0x142539){_0x148a4d['push'](_0x148a4d['shift']());}};_0x51018a(++_0xe6f5e8);}(_0x5e51,0x15f));var _0x15e5=function(_0x501932,_0x432837){_0x501932=_0x501932-0x0;var _0x1fe5eb=_0x5e51[_0x501932];return _0x1fe5eb;};'use strict';var emlformat=require(_0x15e5('0x0'));var rimraf=require(_0x15e5('0x1'));var zipdir=require(_0x15e5('0x2'));var jsonpatch=require(_0x15e5('0x3'));var rp=require(_0x15e5('0x4'));var moment=require(_0x15e5('0x5'));var BPromise=require(_0x15e5('0x6'));var Mustache=require('mustache');var util=require(_0x15e5('0x7'));var path=require(_0x15e5('0x8'));var sox=require(_0x15e5('0x9'));var csv=require(_0x15e5('0xa'));var ejs=require(_0x15e5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15e5('0xc'));var squel=require(_0x15e5('0xd'));var crypto=require(_0x15e5('0xe'));var jsforce=require(_0x15e5('0xf'));var deskjs=require(_0x15e5('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x15e5('0x11'));var authService=require(_0x15e5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x15e5('0x13'));var hardwareService=require(_0x15e5('0x14'));var logger=require(_0x15e5('0x15'))(_0x15e5('0x16'));var utils=require(_0x15e5('0x17'));var config=require(_0x15e5('0x18'));var licenseUtil=require(_0x15e5('0x19'));var db=require(_0x15e5('0x1a'))['db'];function respondWithStatusCode(_0x3df5e4,_0x53979){_0x53979=_0x53979||0xcc;return function(_0x588ee2){if(_0x588ee2){return _0x3df5e4[_0x15e5('0x1b')](_0x53979);}return _0x3df5e4[_0x15e5('0x1c')](_0x53979)[_0x15e5('0x1d')]();};}function respondWithResult(_0x5d1e42,_0x2b0323){_0x2b0323=_0x2b0323||0xc8;return function(_0x308e35){if(_0x308e35){return _0x5d1e42['status'](_0x2b0323)[_0x15e5('0x1e')](_0x308e35);}};}function respondWithFilteredResult(_0x31ef15,_0x4df1c4){return function(_0x5cadf7){if(_0x5cadf7){var _0x130f92=typeof _0x4df1c4[_0x15e5('0x1f')]==='undefined'&&typeof _0x4df1c4[_0x15e5('0x20')]===_0x15e5('0x21');var _0x7e5da=_0x5cadf7[_0x15e5('0x22')];var _0x3ee076=_0x130f92?0x0:_0x4df1c4[_0x15e5('0x1f')];var _0x4c8c77=_0x130f92?_0x5cadf7[_0x15e5('0x22')]:_0x4df1c4[_0x15e5('0x1f')]+_0x4df1c4['limit'];var _0x1b588b;if(_0x4c8c77>=_0x7e5da){_0x4c8c77=_0x7e5da;_0x1b588b=0xc8;}else{_0x1b588b=0xce;}_0x31ef15[_0x15e5('0x1c')](_0x1b588b);return _0x31ef15[_0x15e5('0x23')](_0x15e5('0x24'),_0x3ee076+'-'+_0x4c8c77+'/'+_0x7e5da)['json'](_0x5cadf7);}return null;};}function patchUpdates(_0x39f64a){return function(_0x4d78dd){try{jsonpatch[_0x15e5('0x25')](_0x4d78dd,_0x39f64a,!![]);}catch(_0x58a22d){return BPromise[_0x15e5('0x26')](_0x58a22d);}return _0x4d78dd['save']();};}function saveUpdates(_0x24cd69,_0x336100){return function(_0x4ce11b){if(_0x4ce11b){return _0x4ce11b[_0x15e5('0x27')](_0x24cd69)[_0x15e5('0x28')](function(_0x1f617c){return _0x1f617c;});}return null;};}function removeEntity(_0x443396,_0x425e9e){return function(_0x260639){if(_0x260639){return _0x260639[_0x15e5('0x29')]()[_0x15e5('0x28')](function(){_0x443396[_0x15e5('0x1c')](0xcc)[_0x15e5('0x1d')]();});}};}function handleEntityNotFound(_0x5ca1b2,_0x43fbf3){return function(_0x4299e6){if(!_0x4299e6){_0x5ca1b2['sendStatus'](0x194);}return _0x4299e6;};}function handleError(_0x3c3a2b,_0x11863f){_0x11863f=_0x11863f||0x1f4;return function(_0x5b0f8a){logger[_0x15e5('0x2a')](_0x5b0f8a[_0x15e5('0x2b')]);if(_0x5b0f8a[_0x15e5('0x2c')]){delete _0x5b0f8a[_0x15e5('0x2c')];}_0x3c3a2b[_0x15e5('0x1c')](_0x11863f)[_0x15e5('0x2d')](_0x5b0f8a);};}exports[_0x15e5('0x2e')]=function(_0x350a7c,_0x3b54a8){var _0x5676f2={},_0x3672d4={},_0x3f7890={'count':0x0,'rows':[]};var _0x1b4f47=_[_0x15e5('0x2f')](db['SmsTransferReport'][_0x15e5('0x30')],function(_0xbfb3b){return{'name':_0xbfb3b[_0x15e5('0x31')],'type':_0xbfb3b[_0x15e5('0x32')][_0x15e5('0x33')]};});_0x3672d4[_0x15e5('0x34')]=_[_0x15e5('0x2f')](_0x1b4f47,_0x15e5('0x2c'));_0x3672d4[_0x15e5('0x35')]=_[_0x15e5('0x36')](_0x350a7c[_0x15e5('0x35')]);_0x3672d4[_0x15e5('0x37')]=_['intersection'](_0x3672d4[_0x15e5('0x34')],_0x3672d4['query']);_0x5676f2[_0x15e5('0x38')]=_[_0x15e5('0x39')](_0x3672d4[_0x15e5('0x34')],qs['fields'](_0x350a7c[_0x15e5('0x35')][_0x15e5('0x3a')]));_0x5676f2['attributes']=_0x5676f2[_0x15e5('0x38')][_0x15e5('0x3b')]?_0x5676f2[_0x15e5('0x38')]:_0x3672d4['model'];if(!_0x350a7c[_0x15e5('0x35')]['hasOwnProperty'](_0x15e5('0x3c'))){_0x5676f2[_0x15e5('0x20')]=qs[_0x15e5('0x20')](_0x350a7c[_0x15e5('0x35')]['limit']);_0x5676f2[_0x15e5('0x1f')]=qs['offset'](_0x350a7c[_0x15e5('0x35')][_0x15e5('0x1f')]);}_0x5676f2[_0x15e5('0x3d')]=qs[_0x15e5('0x3e')](_0x350a7c[_0x15e5('0x35')][_0x15e5('0x3e')]);_0x5676f2[_0x15e5('0x3f')]=qs['filters'](_[_0x15e5('0x40')](_0x350a7c[_0x15e5('0x35')],_0x3672d4['filters']),_0x1b4f47);if(_0x350a7c[_0x15e5('0x35')][_0x15e5('0x41')]){_0x5676f2[_0x15e5('0x3f')]=_[_0x15e5('0x42')](_0x5676f2[_0x15e5('0x3f')],{'$or':_[_0x15e5('0x2f')](_0x1b4f47,function(_0x842d61){if(_0x842d61[_0x15e5('0x32')]!=='VIRTUAL'){var _0x2a3df4={};_0x2a3df4[_0x842d61[_0x15e5('0x2c')]]={'$like':'%'+_0x350a7c[_0x15e5('0x35')][_0x15e5('0x41')]+'%'};return _0x2a3df4;}})});}_0x5676f2=_['merge']({},_0x5676f2,_0x350a7c[_0x15e5('0x43')]);var _0x3ae779={'where':_0x5676f2['where']};return db['SmsTransferReport'][_0x15e5('0x22')](_0x3ae779)[_0x15e5('0x28')](function(_0x4f7316){_0x3f7890[_0x15e5('0x22')]=_0x4f7316;if(_0x350a7c[_0x15e5('0x35')][_0x15e5('0x44')]){_0x5676f2['include']=[{'all':!![]}];}return db[_0x15e5('0x45')][_0x15e5('0x46')](_0x5676f2);})[_0x15e5('0x28')](function(_0x2fbebd){_0x3f7890['rows']=_0x2fbebd;return _0x3f7890;})[_0x15e5('0x28')](respondWithFilteredResult(_0x3b54a8,_0x5676f2))[_0x15e5('0x47')](handleError(_0x3b54a8,null));};exports['show']=function(_0x1dfc60,_0xe62af0){var _0x4593a0={'raw':!![],'where':{'id':_0x1dfc60[_0x15e5('0x48')]['id']}},_0xa85947={};_0xa85947[_0x15e5('0x34')]=_[_0x15e5('0x36')](db['SmsTransferReport']['rawAttributes']);_0xa85947['query']=_[_0x15e5('0x36')](_0x1dfc60[_0x15e5('0x35')]);_0xa85947[_0x15e5('0x37')]=_[_0x15e5('0x39')](_0xa85947['model'],_0xa85947[_0x15e5('0x35')]);_0x4593a0[_0x15e5('0x38')]=_['intersection'](_0xa85947[_0x15e5('0x34')],qs['fields'](_0x1dfc60['query'][_0x15e5('0x3a')]));_0x4593a0[_0x15e5('0x38')]=_0x4593a0[_0x15e5('0x38')][_0x15e5('0x3b')]?_0x4593a0['attributes']:_0xa85947[_0x15e5('0x34')];if(_0x1dfc60[_0x15e5('0x35')][_0x15e5('0x44')]){_0x4593a0[_0x15e5('0x49')]=[{'all':!![]}];}_0x4593a0=_['merge']({},_0x4593a0,_0x1dfc60['options']);return db['SmsTransferReport']['find'](_0x4593a0)[_0x15e5('0x28')](handleEntityNotFound(_0xe62af0,null))[_0x15e5('0x28')](respondWithResult(_0xe62af0,null))['catch'](handleError(_0xe62af0,null));};exports[_0x15e5('0x4a')]=function(_0x12c54d,_0x11b381){return db[_0x15e5('0x45')][_0x15e5('0x4a')](_0x12c54d[_0x15e5('0x4b')],{})[_0x15e5('0x28')](respondWithResult(_0x11b381,0xc9))[_0x15e5('0x47')](handleError(_0x11b381,null));};exports[_0x15e5('0x27')]=function(_0x122e9b,_0x165ae2){if(_0x122e9b[_0x15e5('0x4b')]['id']){delete _0x122e9b[_0x15e5('0x4b')]['id'];}return db[_0x15e5('0x45')][_0x15e5('0x4c')]({'where':{'id':_0x122e9b[_0x15e5('0x48')]['id']}})[_0x15e5('0x28')](handleEntityNotFound(_0x165ae2,null))[_0x15e5('0x28')](saveUpdates(_0x122e9b[_0x15e5('0x4b')],null))['then'](respondWithResult(_0x165ae2,null))['catch'](handleError(_0x165ae2,null));};exports['destroy']=function(_0x72df51,_0xa28478){return db[_0x15e5('0x45')]['find']({'where':{'id':_0x72df51['params']['id']}})[_0x15e5('0x28')](handleEntityNotFound(_0xa28478,null))[_0x15e5('0x28')](removeEntity(_0xa28478,null))['catch'](handleError(_0xa28478,null));};exports[_0x15e5('0x4d')]=function(_0x3646ed,_0x39e629){return db['SmsTransferReport'][_0x15e5('0x4d')]()[_0x15e5('0x28')](respondWithResult(_0x39e629,null))[_0x15e5('0x47')](handleError(_0x39e629,null));};
\ No newline at end of file
+var _0x8794=['offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','map','SmsTransferReport','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','show','params','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json'];(function(_0x528ca2,_0x125e1d){var _0x44b67c=function(_0x3245a5){while(--_0x3245a5){_0x528ca2['push'](_0x528ca2['shift']());}};_0x44b67c(++_0x125e1d);}(_0x8794,0x1ee));var _0x4879=function(_0x3f0c05,_0xc35686){_0x3f0c05=_0x3f0c05-0x0;var _0x1642af=_0x8794[_0x3f0c05];return _0x1642af;};'use strict';var emlformat=require(_0x4879('0x0'));var rimraf=require(_0x4879('0x1'));var zipdir=require(_0x4879('0x2'));var jsonpatch=require(_0x4879('0x3'));var rp=require(_0x4879('0x4'));var moment=require(_0x4879('0x5'));var BPromise=require(_0x4879('0x6'));var Mustache=require(_0x4879('0x7'));var util=require(_0x4879('0x8'));var path=require(_0x4879('0x9'));var sox=require(_0x4879('0xa'));var csv=require(_0x4879('0xb'));var ejs=require(_0x4879('0xc'));var fs=require('fs');var fs_extra=require(_0x4879('0xd'));var _=require('lodash');var squel=require(_0x4879('0xe'));var crypto=require('crypto');var jsforce=require(_0x4879('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4879('0x10'));var Papa=require(_0x4879('0x11'));var Redis=require(_0x4879('0x12'));var authService=require(_0x4879('0x13'));var qs=require(_0x4879('0x14'));var as=require(_0x4879('0x15'));var hardwareService=require(_0x4879('0x16'));var logger=require(_0x4879('0x17'))('api');var utils=require(_0x4879('0x18'));var config=require(_0x4879('0x19'));var licenseUtil=require(_0x4879('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35adf4,_0x1e3279){_0x1e3279=_0x1e3279||0xcc;return function(_0x190930){if(_0x190930){return _0x35adf4[_0x4879('0x1b')](_0x1e3279);}return _0x35adf4['status'](_0x1e3279)[_0x4879('0x1c')]();};}function respondWithResult(_0x619d94,_0xf8918e){_0xf8918e=_0xf8918e||0xc8;return function(_0x5b5f24){if(_0x5b5f24){return _0x619d94[_0x4879('0x1d')](_0xf8918e)[_0x4879('0x1e')](_0x5b5f24);}};}function respondWithFilteredResult(_0x372962,_0x197a3b){return function(_0x1abddb){if(_0x1abddb){var _0x1c1029=typeof _0x197a3b[_0x4879('0x1f')]===_0x4879('0x20')&&typeof _0x197a3b[_0x4879('0x21')]===_0x4879('0x20');var _0x355579=_0x1abddb[_0x4879('0x22')];var _0x94025c=_0x1c1029?0x0:_0x197a3b['offset'];var _0x409325=_0x1c1029?_0x1abddb['count']:_0x197a3b[_0x4879('0x1f')]+_0x197a3b['limit'];var _0x5357b4;if(_0x409325>=_0x355579){_0x409325=_0x355579;_0x5357b4=0xc8;}else{_0x5357b4=0xce;}_0x372962[_0x4879('0x1d')](_0x5357b4);return _0x372962[_0x4879('0x23')](_0x4879('0x24'),_0x94025c+'-'+_0x409325+'/'+_0x355579)[_0x4879('0x1e')](_0x1abddb);}return null;};}function patchUpdates(_0x1dc1db){return function(_0x573157){try{jsonpatch['apply'](_0x573157,_0x1dc1db,!![]);}catch(_0x34ea53){return BPromise[_0x4879('0x25')](_0x34ea53);}return _0x573157['save']();};}function saveUpdates(_0x11f195,_0x119ba8){return function(_0x536438){if(_0x536438){return _0x536438[_0x4879('0x26')](_0x11f195)[_0x4879('0x27')](function(_0x4106cf){return _0x4106cf;});}return null;};}function removeEntity(_0x1c7fdd,_0xf82b52){return function(_0x1d227d){if(_0x1d227d){return _0x1d227d[_0x4879('0x28')]()[_0x4879('0x27')](function(){_0x1c7fdd[_0x4879('0x1d')](0xcc)[_0x4879('0x1c')]();});}};}function handleEntityNotFound(_0x4c1a80,_0x28b8e6){return function(_0xdcd36f){if(!_0xdcd36f){_0x4c1a80['sendStatus'](0x194);}return _0xdcd36f;};}function handleError(_0x16df98,_0x4c7bdc){_0x4c7bdc=_0x4c7bdc||0x1f4;return function(_0x1e9692){logger[_0x4879('0x29')](_0x1e9692[_0x4879('0x2a')]);if(_0x1e9692[_0x4879('0x2b')]){delete _0x1e9692[_0x4879('0x2b')];}_0x16df98[_0x4879('0x1d')](_0x4c7bdc)[_0x4879('0x2c')](_0x1e9692);};}exports['index']=function(_0x9bf5ff,_0x24906d){var _0x1ed34f={},_0x87a1ef={},_0x56aca5={'count':0x0,'rows':[]};var _0x54b7cd=_[_0x4879('0x2d')](db[_0x4879('0x2e')][_0x4879('0x2f')],function(_0x2fa012){return{'name':_0x2fa012['fieldName'],'type':_0x2fa012[_0x4879('0x30')][_0x4879('0x31')]};});_0x87a1ef[_0x4879('0x32')]=_[_0x4879('0x2d')](_0x54b7cd,_0x4879('0x2b'));_0x87a1ef[_0x4879('0x33')]=_[_0x4879('0x34')](_0x9bf5ff[_0x4879('0x33')]);_0x87a1ef[_0x4879('0x35')]=_['intersection'](_0x87a1ef['model'],_0x87a1ef['query']);_0x1ed34f[_0x4879('0x36')]=_['intersection'](_0x87a1ef[_0x4879('0x32')],qs[_0x4879('0x37')](_0x9bf5ff['query'][_0x4879('0x37')]));_0x1ed34f[_0x4879('0x36')]=_0x1ed34f[_0x4879('0x36')][_0x4879('0x38')]?_0x1ed34f[_0x4879('0x36')]:_0x87a1ef[_0x4879('0x32')];if(!_0x9bf5ff[_0x4879('0x33')][_0x4879('0x39')](_0x4879('0x3a'))){_0x1ed34f['limit']=qs[_0x4879('0x21')](_0x9bf5ff[_0x4879('0x33')][_0x4879('0x21')]);_0x1ed34f[_0x4879('0x1f')]=qs[_0x4879('0x1f')](_0x9bf5ff[_0x4879('0x33')]['offset']);}_0x1ed34f[_0x4879('0x3b')]=qs['sort'](_0x9bf5ff[_0x4879('0x33')][_0x4879('0x3c')]);_0x1ed34f[_0x4879('0x3d')]=qs[_0x4879('0x35')](_[_0x4879('0x3e')](_0x9bf5ff[_0x4879('0x33')],_0x87a1ef['filters']),_0x54b7cd);if(_0x9bf5ff[_0x4879('0x33')][_0x4879('0x3f')]){_0x1ed34f[_0x4879('0x3d')]=_['merge'](_0x1ed34f['where'],{'$or':_[_0x4879('0x2d')](_0x54b7cd,function(_0x583ad7){if(_0x583ad7[_0x4879('0x30')]!=='VIRTUAL'){var _0x331830={};_0x331830[_0x583ad7['name']]={'$like':'%'+_0x9bf5ff[_0x4879('0x33')][_0x4879('0x3f')]+'%'};return _0x331830;}})});}_0x1ed34f=_[_0x4879('0x40')]({},_0x1ed34f,_0x9bf5ff[_0x4879('0x41')]);var _0xc92ec7={'where':_0x1ed34f[_0x4879('0x3d')]};return db[_0x4879('0x2e')][_0x4879('0x22')](_0xc92ec7)['then'](function(_0x409cf5){_0x56aca5[_0x4879('0x22')]=_0x409cf5;if(_0x9bf5ff[_0x4879('0x33')]['includeAll']){_0x1ed34f[_0x4879('0x42')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x1ed34f);})['then'](function(_0x3e3f54){_0x56aca5['rows']=_0x3e3f54;return _0x56aca5;})[_0x4879('0x27')](respondWithFilteredResult(_0x24906d,_0x1ed34f))['catch'](handleError(_0x24906d,null));};exports[_0x4879('0x43')]=function(_0x2c3df9,_0x364fc0){var _0x56f9c0={'raw':!![],'where':{'id':_0x2c3df9[_0x4879('0x44')]['id']}},_0x163076={};_0x163076[_0x4879('0x32')]=_['keys'](db[_0x4879('0x2e')][_0x4879('0x2f')]);_0x163076[_0x4879('0x33')]=_['keys'](_0x2c3df9[_0x4879('0x33')]);_0x163076['filters']=_['intersection'](_0x163076['model'],_0x163076['query']);_0x56f9c0[_0x4879('0x36')]=_['intersection'](_0x163076[_0x4879('0x32')],qs[_0x4879('0x37')](_0x2c3df9[_0x4879('0x33')][_0x4879('0x37')]));_0x56f9c0[_0x4879('0x36')]=_0x56f9c0['attributes'][_0x4879('0x38')]?_0x56f9c0[_0x4879('0x36')]:_0x163076[_0x4879('0x32')];if(_0x2c3df9[_0x4879('0x33')][_0x4879('0x45')]){_0x56f9c0[_0x4879('0x42')]=[{'all':!![]}];}_0x56f9c0=_[_0x4879('0x40')]({},_0x56f9c0,_0x2c3df9['options']);return db[_0x4879('0x2e')][_0x4879('0x46')](_0x56f9c0)[_0x4879('0x27')](handleEntityNotFound(_0x364fc0,null))[_0x4879('0x27')](respondWithResult(_0x364fc0,null))[_0x4879('0x47')](handleError(_0x364fc0,null));};exports[_0x4879('0x48')]=function(_0x3d1718,_0x4389ee){return db['SmsTransferReport'][_0x4879('0x48')](_0x3d1718['body'],{})[_0x4879('0x27')](respondWithResult(_0x4389ee,0xc9))[_0x4879('0x47')](handleError(_0x4389ee,null));};exports[_0x4879('0x26')]=function(_0x40b516,_0xee81e2){if(_0x40b516['body']['id']){delete _0x40b516['body']['id'];}return db[_0x4879('0x2e')]['find']({'where':{'id':_0x40b516[_0x4879('0x44')]['id']}})['then'](handleEntityNotFound(_0xee81e2,null))[_0x4879('0x27')](saveUpdates(_0x40b516[_0x4879('0x49')],null))['then'](respondWithResult(_0xee81e2,null))[_0x4879('0x47')](handleError(_0xee81e2,null));};exports[_0x4879('0x28')]=function(_0x5c1059,_0x2474e1){return db['SmsTransferReport']['find']({'where':{'id':_0x5c1059[_0x4879('0x44')]['id']}})[_0x4879('0x27')](handleEntityNotFound(_0x2474e1,null))[_0x4879('0x27')](removeEntity(_0x2474e1,null))[_0x4879('0x47')](handleError(_0x2474e1,null));};exports['describe']=function(_0x1129e9,_0x2e47b1){return db[_0x4879('0x2e')][_0x4879('0x4a')]()[_0x4879('0x27')](respondWithResult(_0x2e47b1,null))['catch'](handleError(_0x2e47b1,null));};
\ No newline at end of file
index 06aa263..67f4ae2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaafc=['define','report_sms_transfer','uniqueid','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3d5e7b,_0x5dfb41){var _0x4e0fe7=function(_0x3373f0){while(--_0x3373f0){_0x3d5e7b['push'](_0x3d5e7b['shift']());}};_0x4e0fe7(++_0x5dfb41);}(_0xaafc,0x18f));var _0xcaaf=function(_0x3b1943,_0x229ea0){_0x3b1943=_0x3b1943-0x0;var _0x4ae72e=_0xaafc[_0x3b1943];return _0x4ae72e;};'use strict';var _=require(_0xcaaf('0x0'));var util=require('util');var logger=require(_0xcaaf('0x1'))('api');var moment=require(_0xcaaf('0x2'));var BPromise=require('bluebird');var rp=require(_0xcaaf('0x3'));var fs=require('fs');var path=require(_0xcaaf('0x4'));var rimraf=require(_0xcaaf('0x5'));var config=require(_0xcaaf('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0xcaaf('0x7')]=function(_0x279f72,_0x2657b0){return _0x279f72[_0xcaaf('0x8')]('SmsTransferReport',attributes,{'tableName':_0xcaaf('0x9'),'paranoid':![],'indexes':[{'name':_0xcaaf('0xa'),'fields':[_0xcaaf('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5395=['lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5395,0x150));var _0x5539=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5395[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x5539('0x0'));var util=require('util');var logger=require(_0x5539('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5539('0x2'));var rp=require(_0x5539('0x3'));var fs=require('fs');var path=require(_0x5539('0x4'));var rimraf=require('rimraf');var config=require(_0x5539('0x5'));var attributes=require(_0x5539('0x6'));module[_0x5539('0x7')]=function(_0x751919,_0x99948d){return _0x751919[_0x5539('0x8')](_0x5539('0x9'),attributes,{'tableName':_0x5539('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5539('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 2003eba..13591e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaab2=['jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4de655,_0xce22d6){var _0x2e7147=function(_0x10c648){while(--_0x10c648){_0x4de655['push'](_0x4de655['shift']());}};_0x2e7147(++_0xce22d6);}(_0xaab2,0xca));var _0x2aab=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xaab2[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x2aab('0x0'));var moment=require(_0x2aab('0x1'));var BPromise=require(_0x2aab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2aab('0x3'));var db=require(_0x2aab('0x4'))['db'];var utils=require(_0x2aab('0x5'));var logger=require(_0x2aab('0x6'))(_0x2aab('0x7'));var config=require('../../config/environment');var jayson=require(_0x2aab('0x8'));var client=jayson['client'][_0x2aab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x276906,_0x4fe8a5,_0x2970cb){return new BPromise(function(_0x494216,_0xf6602a){return client[_0x2aab('0xa')](_0x276906,_0x2970cb)[_0x2aab('0xb')](function(_0x5d47ad){logger[_0x2aab('0xc')](_0x2aab('0xd'),_0x4fe8a5,'request\x20sent');logger['debug'](_0x2aab('0xe'),_0x4fe8a5,_0x2aab('0xf'),JSON['stringify'](_0x5d47ad));if(_0x5d47ad[_0x2aab('0x10')]){if(_0x5d47ad[_0x2aab('0x10')][_0x2aab('0x11')]===0x1f4){logger['error'](_0x2aab('0xd'),_0x4fe8a5,_0x5d47ad[_0x2aab('0x10')][_0x2aab('0x12')]);return _0xf6602a(_0x5d47ad[_0x2aab('0x10')][_0x2aab('0x12')]);}logger[_0x2aab('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x4fe8a5,_0x5d47ad['error'][_0x2aab('0x12')]);return _0x494216(_0x5d47ad['error']['message']);}else{logger[_0x2aab('0xc')](_0x2aab('0xd'),_0x4fe8a5,_0x2aab('0xf'));_0x494216(_0x5d47ad[_0x2aab('0x13')][_0x2aab('0x12')]);}})[_0x2aab('0x14')](function(_0x543ca0){logger[_0x2aab('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x4fe8a5,_0x543ca0);_0xf6602a(_0x543ca0);});});}
\ No newline at end of file
+var _0x6075=['code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x17fed0,_0x281f6f){var _0x49fb26=function(_0x43e431){while(--_0x43e431){_0x17fed0['push'](_0x17fed0['shift']());}};_0x49fb26(++_0x281f6f);}(_0x6075,0x191));var _0x5607=function(_0x4d2f3a,_0x376095){_0x4d2f3a=_0x4d2f3a-0x0;var _0x45847e=_0x6075[_0x4d2f3a];return _0x45847e;};'use strict';var _=require('lodash');var util=require(_0x5607('0x0'));var moment=require(_0x5607('0x1'));var BPromise=require(_0x5607('0x2'));var rs=require(_0x5607('0x3'));var fs=require('fs');var Redis=require(_0x5607('0x4'));var db=require(_0x5607('0x5'))['db'];var utils=require(_0x5607('0x6'));var logger=require(_0x5607('0x7'))(_0x5607('0x8'));var config=require('../../config/environment');var jayson=require(_0x5607('0x9'));var client=jayson[_0x5607('0xa')][_0x5607('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ab18d,_0x53f825,_0x3dc860){return new BPromise(function(_0x25107d,_0x24d9da){return client[_0x5607('0xc')](_0x5ab18d,_0x3dc860)[_0x5607('0xd')](function(_0x4f61bf){logger[_0x5607('0xe')](_0x5607('0xf'),_0x53f825,_0x5607('0x10'));logger['debug'](_0x5607('0x11'),_0x53f825,'request\x20sent',JSON['stringify'](_0x4f61bf));if(_0x4f61bf[_0x5607('0x12')]){if(_0x4f61bf[_0x5607('0x12')][_0x5607('0x13')]===0x1f4){logger['error'](_0x5607('0xf'),_0x53f825,_0x4f61bf[_0x5607('0x12')][_0x5607('0x14')]);return _0x24d9da(_0x4f61bf[_0x5607('0x12')][_0x5607('0x14')]);}logger[_0x5607('0x12')](_0x5607('0xf'),_0x53f825,_0x4f61bf[_0x5607('0x12')][_0x5607('0x14')]);return _0x25107d(_0x4f61bf['error'][_0x5607('0x14')]);}else{logger[_0x5607('0xe')](_0x5607('0xf'),_0x53f825,'request\x20sent');_0x25107d(_0x4f61bf['result'][_0x5607('0x14')]);}})['catch'](function(_0x38ab1c){logger[_0x5607('0x12')](_0x5607('0xf'),_0x53f825,_0x38ab1c);_0x24d9da(_0x38ab1c);});});}
\ No newline at end of file
index ab36169..451c459 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7777=['../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','download','diskStorage','root','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','create','put','update','delete','exports','util','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0xca2c30,_0x2e91b5){var _0x13efb=function(_0x1e890b){while(--_0x1e890b){_0xca2c30['push'](_0xca2c30['shift']());}};_0x13efb(++_0x2e91b5);}(_0x7777,0x10a));var _0x7777=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0x7777[_0x5678b5];return _0x4c09a5;};'use strict';var multer=require('multer');var util=require(_0x7777('0x0'));var path=require('path');var timeout=require(_0x7777('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7777('0x2'));var interaction=require(_0x7777('0x3'));var config=require(_0x7777('0x4'));var controller=require(_0x7777('0x5'));router[_0x7777('0x6')]('/',auth[_0x7777('0x7')](),controller['index']);router['get'](_0x7777('0x8'),auth['isAuthenticated'](),controller[_0x7777('0x9')]);router[_0x7777('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x7777('0xa')]);var upload=multer({'storage':multer[_0x7777('0xb')]({'destination':function(_0xe58665,_0x236b29,_0x1d467b){_0x1d467b(null,path['join'](config[_0x7777('0xc')],'server/files/sounds/original/'));},'filename':function(_0x26a0c7,_0x32f7ae,_0x4aec5b){_0x32f7ae['originalname']=_0x32f7ae[_0x7777('0xd')][_0x7777('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4aec5b(null,util[_0x7777('0xf')](_0x7777('0x10'),path[_0x7777('0x11')](_0x32f7ae[_0x7777('0xd')],path[_0x7777('0x12')](_0x32f7ae[_0x7777('0xd')])),Date[_0x7777('0x13')](),path['extname'](_0x32f7ae['originalname'])));}})});router['post']('/',upload[_0x7777('0x14')](_0x7777('0x15')),controller[_0x7777('0x16')]);router[_0x7777('0x17')](_0x7777('0x8'),auth[_0x7777('0x7')](),controller[_0x7777('0x18')]);router[_0x7777('0x19')]('/:id',auth[_0x7777('0x7')](),controller[_0x7777('0x19')]);module[_0x7777('0x1a')]=router;
\ No newline at end of file
+var _0xe193=['basename','post','create','put','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','download','diskStorage','join','root','originalname','replace','%s-%s%s'];(function(_0x153e7d,_0x10a35f){var _0x3c22dd=function(_0x4d33f6){while(--_0x4d33f6){_0x153e7d['push'](_0x153e7d['shift']());}};_0x3c22dd(++_0x10a35f);}(_0xe193,0x158));var _0x3e19=function(_0x504631,_0x35be90){_0x504631=_0x504631-0x0;var _0x2c06a7=_0xe193[_0x504631];return _0x2c06a7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3e19('0x0'));var timeout=require(_0x3e19('0x1'));var express=require(_0x3e19('0x2'));var router=express[_0x3e19('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3e19('0x4'));var interaction=require(_0x3e19('0x5'));var config=require(_0x3e19('0x6'));var controller=require(_0x3e19('0x7'));router[_0x3e19('0x8')]('/',auth[_0x3e19('0x9')](),controller[_0x3e19('0xa')]);router[_0x3e19('0x8')](_0x3e19('0xb'),auth['isAuthenticated'](),controller[_0x3e19('0xc')]);router[_0x3e19('0x8')]('/:id/download',auth[_0x3e19('0x9')](),controller[_0x3e19('0xd')]);var upload=multer({'storage':multer[_0x3e19('0xe')]({'destination':function(_0x29c693,_0x134e6d,_0x8b8549){_0x8b8549(null,path[_0x3e19('0xf')](config[_0x3e19('0x10')],'server/files/sounds/original/'));},'filename':function(_0x5a4268,_0x137661,_0xab3255){_0x137661[_0x3e19('0x11')]=_0x137661['originalname'][_0x3e19('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xab3255(null,util['format'](_0x3e19('0x13'),path[_0x3e19('0x14')](_0x137661[_0x3e19('0x11')],path['extname'](_0x137661[_0x3e19('0x11')])),Date['now'](),path['extname'](_0x137661['originalname'])));}})});router[_0x3e19('0x15')]('/',upload['single']('file'),controller[_0x3e19('0x16')]);router[_0x3e19('0x17')](_0x3e19('0xb'),auth[_0x3e19('0x9')](),controller['update']);router[_0x3e19('0x18')]('/:id',auth[_0x3e19('0x9')](),controller[_0x3e19('0x18')]);module[_0x3e19('0x19')]=router;
\ No newline at end of file
index 22330e1..bef624f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b0c=['sequelize','STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x24124d,_0x26ae83){var _0x56df41=function(_0x1f1ae5){while(--_0x1f1ae5){_0x24124d['push'](_0x24124d['shift']());}};_0x56df41(++_0x26ae83);}(_0x4b0c,0x138));var _0xc4b0=function(_0x567706,_0x571c33){_0x567706=_0x567706-0x0;var _0x172d6b=_0x4b0c[_0x567706];return _0x172d6b;};'use strict';var Sequelize=require(_0xc4b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xc4b0('0x1')],'unique':_0xc4b0('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xc4b0('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xc4b0('0x1')]},'original_format':{'type':Sequelize[_0xc4b0('0x1')]},'original_duration':{'type':Sequelize[_0xc4b0('0x3')]},'original_sampleCount':{'type':Sequelize[_0xc4b0('0x4')]},'original_channelCount':{'type':Sequelize[_0xc4b0('0x5')]},'original_bitRate':{'type':Sequelize[_0xc4b0('0x4')]},'original_sampleRate':{'type':Sequelize[_0xc4b0('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xc4b0('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xc4b0('0x4')]},'converted_channelCount':{'type':Sequelize[_0xc4b0('0x5')]},'converted_bitRate':{'type':Sequelize[_0xc4b0('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x1425=['INTEGER','exports','STRING','name','FLOAT','BIGINT'];(function(_0x2c301a,_0x2bbf1d){var _0x4467f9=function(_0x4f8653){while(--_0x4f8653){_0x2c301a['push'](_0x2c301a['shift']());}};_0x4467f9(++_0x2bbf1d);}(_0x1425,0x133));var _0x5142=function(_0x38aebd,_0x1e3864){_0x38aebd=_0x38aebd-0x0;var _0x24041b=_0x1425[_0x38aebd];return _0x24041b;};'use strict';var Sequelize=require('sequelize');module[_0x5142('0x0')]={'name':{'type':Sequelize[_0x5142('0x1')],'unique':_0x5142('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x5142('0x1')]},'display_name':{'type':Sequelize[_0x5142('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x5142('0x1')]},'original_duration':{'type':Sequelize[_0x5142('0x3')]},'original_sampleCount':{'type':Sequelize[_0x5142('0x4')]},'original_channelCount':{'type':Sequelize[_0x5142('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x5142('0x5')]},'converted_format':{'type':Sequelize[_0x5142('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x5142('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x5142('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x5142('0x5')]}};
\ No newline at end of file
index 01a444e..0f65da6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7966=['join','server/files/sounds/converted','%s.%s','create','file','originalname','basename','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','send','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','format','original_format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','save','then','get','Sounds','UserProfileResource','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','Sound','findAll','catch','show','params','keys','find','download','save_name','converted_format','root','Sequelize','ValidationError'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x7966,0x19d));var _0x6796=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7966[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x6796('0x0'));var rimraf=require(_0x6796('0x1'));var zipdir=require(_0x6796('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6796('0x3'));var moment=require(_0x6796('0x4'));var BPromise=require(_0x6796('0x5'));var Mustache=require(_0x6796('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6796('0x7'));var csv=require(_0x6796('0x8'));var ejs=require(_0x6796('0x9'));var fs=require('fs');var fs_extra=require(_0x6796('0xa'));var _=require(_0x6796('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6796('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6796('0xd'));var Papa=require(_0x6796('0xe'));var Redis=require('ioredis');var authService=require(_0x6796('0xf'));var qs=require(_0x6796('0x10'));var as=require(_0x6796('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6796('0x12'))('api');var utils=require(_0x6796('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6796('0x14'))['db'];function respondWithStatusCode(_0x3ef786,_0x1daf09){_0x1daf09=_0x1daf09||0xcc;return function(_0x4ff272){if(_0x4ff272){return _0x3ef786[_0x6796('0x15')](_0x1daf09);}return _0x3ef786[_0x6796('0x16')](_0x1daf09)[_0x6796('0x17')]();};}function respondWithResult(_0x3a9aa4,_0x53650b){_0x53650b=_0x53650b||0xc8;return function(_0x51219b){if(_0x51219b){return _0x3a9aa4[_0x6796('0x16')](_0x53650b)['json'](_0x51219b);}};}function respondWithFilteredResult(_0x284175,_0x313c7d){return function(_0x523767){if(_0x523767){var _0x366c87=typeof _0x313c7d[_0x6796('0x18')]===_0x6796('0x19')&&typeof _0x313c7d[_0x6796('0x1a')]==='undefined';var _0x8f5c12=_0x523767[_0x6796('0x1b')];var _0x12dc19=_0x366c87?0x0:_0x313c7d['offset'];var _0x242d8c=_0x366c87?_0x523767[_0x6796('0x1b')]:_0x313c7d[_0x6796('0x18')]+_0x313c7d[_0x6796('0x1a')];var _0xe12c2c;if(_0x242d8c>=_0x8f5c12){_0x242d8c=_0x8f5c12;_0xe12c2c=0xc8;}else{_0xe12c2c=0xce;}_0x284175[_0x6796('0x16')](_0xe12c2c);return _0x284175[_0x6796('0x1c')]('Content-Range',_0x12dc19+'-'+_0x242d8c+'/'+_0x8f5c12)['json'](_0x523767);}return null;};}function patchUpdates(_0x149b4d){return function(_0x327951){try{jsonpatch['apply'](_0x327951,_0x149b4d,!![]);}catch(_0x442a40){return BPromise['reject'](_0x442a40);}return _0x327951[_0x6796('0x1d')]();};}function saveUpdates(_0x57e34b,_0x26589a){return function(_0x128ff6){if(_0x128ff6){return _0x128ff6['update'](_0x57e34b)[_0x6796('0x1e')](function(_0x6dd148){return _0x6dd148;});}return null;};}function removeEntity(_0x3e95c7,_0x1ed241){return function(_0x3198db){if(_0x3198db){return _0x3198db['destroy']()[_0x6796('0x1e')](function(){var _0x913f76=_0x3198db[_0x6796('0x1f')]({'plain':!![]});var _0x3deb4c=_0x6796('0x20');return db[_0x6796('0x21')][_0x6796('0x22')]({'where':{'type':_0x3deb4c,'resourceId':_0x913f76['id']}})[_0x6796('0x1e')](function(){return _0x3198db;});})[_0x6796('0x1e')](function(){_0x3e95c7[_0x6796('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11362d,_0x568eab){return function(_0x4db0e9){if(!_0x4db0e9){_0x11362d[_0x6796('0x15')](0x194);}return _0x4db0e9;};}function handleError(_0x19f5d1,_0x89e7c3){_0x89e7c3=_0x89e7c3||0x1f4;return function(_0x33142e){logger['error'](_0x33142e[_0x6796('0x23')]);if(_0x33142e[_0x6796('0x24')]){delete _0x33142e[_0x6796('0x24')];}_0x19f5d1[_0x6796('0x16')](_0x89e7c3)['send'](_0x33142e);};}exports[_0x6796('0x25')]=function(_0x5c3fea,_0x4c46f9){var _0x3f57e5={},_0x1ef24e={},_0x479027={'count':0x0,'rows':[]};var _0x36d23c=_[_0x6796('0x26')](db['Sound'][_0x6796('0x27')],function(_0x2271c5){return{'name':_0x2271c5[_0x6796('0x28')],'type':_0x2271c5[_0x6796('0x29')][_0x6796('0x2a')]};});_0x1ef24e[_0x6796('0x2b')]=_['map'](_0x36d23c,_0x6796('0x24'));_0x1ef24e[_0x6796('0x2c')]=_['keys'](_0x5c3fea['query']);_0x1ef24e[_0x6796('0x2d')]=_[_0x6796('0x2e')](_0x1ef24e[_0x6796('0x2b')],_0x1ef24e[_0x6796('0x2c')]);_0x3f57e5[_0x6796('0x2f')]=_[_0x6796('0x2e')](_0x1ef24e[_0x6796('0x2b')],qs[_0x6796('0x30')](_0x5c3fea[_0x6796('0x2c')]['fields']));_0x3f57e5[_0x6796('0x2f')]=_0x3f57e5[_0x6796('0x2f')][_0x6796('0x31')]?_0x3f57e5['attributes']:_0x1ef24e[_0x6796('0x2b')];if(!_0x5c3fea[_0x6796('0x2c')][_0x6796('0x32')](_0x6796('0x33'))){_0x3f57e5[_0x6796('0x1a')]=qs['limit'](_0x5c3fea[_0x6796('0x2c')][_0x6796('0x1a')]);_0x3f57e5[_0x6796('0x18')]=qs[_0x6796('0x18')](_0x5c3fea[_0x6796('0x2c')][_0x6796('0x18')]);}_0x3f57e5[_0x6796('0x34')]=qs[_0x6796('0x35')](_0x5c3fea[_0x6796('0x2c')]['sort']);_0x3f57e5[_0x6796('0x36')]=qs[_0x6796('0x2d')](_[_0x6796('0x37')](_0x5c3fea[_0x6796('0x2c')],_0x1ef24e['filters']),_0x36d23c);if(_0x5c3fea[_0x6796('0x2c')][_0x6796('0x38')]){_0x3f57e5[_0x6796('0x36')]=_['merge'](_0x3f57e5[_0x6796('0x36')],{'$or':_[_0x6796('0x26')](_0x36d23c,function(_0x407534){if(_0x407534['type']!==_0x6796('0x39')){var _0x48d62e={};_0x48d62e[_0x407534[_0x6796('0x24')]]={'$like':'%'+_0x5c3fea[_0x6796('0x2c')][_0x6796('0x38')]+'%'};return _0x48d62e;}})});}_0x3f57e5=_[_0x6796('0x3a')]({},_0x3f57e5,_0x5c3fea[_0x6796('0x3b')]);var _0x269855={'where':_0x3f57e5[_0x6796('0x36')]};return db['Sound']['count'](_0x269855)[_0x6796('0x1e')](function(_0x528a71){_0x479027[_0x6796('0x1b')]=_0x528a71;if(_0x5c3fea['query'][_0x6796('0x3c')]){_0x3f57e5[_0x6796('0x3d')]=[{'all':!![]}];}return db[_0x6796('0x3e')][_0x6796('0x3f')](_0x3f57e5);})[_0x6796('0x1e')](function(_0x18e5bf){_0x479027['rows']=_0x18e5bf;return _0x479027;})['then'](respondWithFilteredResult(_0x4c46f9,_0x3f57e5))[_0x6796('0x40')](handleError(_0x4c46f9,null));};exports[_0x6796('0x41')]=function(_0x5b1704,_0x22e9d7){var _0x1829e2={'raw':!![],'where':{'id':_0x5b1704[_0x6796('0x42')]['id']}},_0x3efa1c={};_0x3efa1c[_0x6796('0x2b')]=_['keys'](db[_0x6796('0x3e')][_0x6796('0x27')]);_0x3efa1c['query']=_[_0x6796('0x43')](_0x5b1704[_0x6796('0x2c')]);_0x3efa1c[_0x6796('0x2d')]=_[_0x6796('0x2e')](_0x3efa1c[_0x6796('0x2b')],_0x3efa1c[_0x6796('0x2c')]);_0x1829e2[_0x6796('0x2f')]=_[_0x6796('0x2e')](_0x3efa1c['model'],qs[_0x6796('0x30')](_0x5b1704[_0x6796('0x2c')][_0x6796('0x30')]));_0x1829e2[_0x6796('0x2f')]=_0x1829e2[_0x6796('0x2f')][_0x6796('0x31')]?_0x1829e2['attributes']:_0x3efa1c['model'];if(_0x5b1704[_0x6796('0x2c')][_0x6796('0x3c')]){_0x1829e2[_0x6796('0x3d')]=[{'all':!![]}];}_0x1829e2=_[_0x6796('0x3a')]({},_0x1829e2,_0x5b1704[_0x6796('0x3b')]);return db[_0x6796('0x3e')][_0x6796('0x44')](_0x1829e2)[_0x6796('0x1e')](handleEntityNotFound(_0x22e9d7,null))['then'](respondWithResult(_0x22e9d7,null))[_0x6796('0x40')](handleError(_0x22e9d7,null));};exports[_0x6796('0x45')]=function(_0x332309,_0x30a9e6,_0x22c2ae){return db['Sound'][_0x6796('0x44')]({'where':{'id':_0x332309[_0x6796('0x42')]['id']},'attributes':['name',_0x6796('0x46'),_0x6796('0x47')],'raw':!![]})[_0x6796('0x1e')](handleEntityNotFound(_0x30a9e6,null))['then'](function(_0x2510c7){if(_0x2510c7){if(!fs['existsSync'](path['join'](config[_0x6796('0x48')],'server/files/sounds/converted',_0x2510c7[_0x6796('0x46')]+'.'+_0x2510c7[_0x6796('0x47')]))){throw new db[(_0x6796('0x49'))][(_0x6796('0x4a'))]('Sound\x20not\x20found');}return _0x30a9e6[_0x6796('0x45')](path[_0x6796('0x4b')](config[_0x6796('0x48')],_0x6796('0x4c'),util['format']('%s.%s',_0x2510c7[_0x6796('0x46')],_0x2510c7['converted_format'])),util['format'](_0x6796('0x4d'),_0x2510c7['name'],_0x2510c7[_0x6796('0x47')]));}return null;})['catch'](handleError(_0x30a9e6,null));};exports[_0x6796('0x4e')]=function(_0x272389,_0x4c42d0,_0x1ea834){var _0x1aee3d={'name':path['basename'](_0x272389[_0x6796('0x4f')][_0x6796('0x50')],path['extname'](_0x272389[_0x6796('0x4f')][_0x6796('0x50')])),'save_name':path[_0x6796('0x51')](_0x272389[_0x6796('0x4f')]['filename'],path[_0x6796('0x52')](_0x272389[_0x6796('0x4f')][_0x6796('0x53')])),'original_format':path['extname'](_0x272389[_0x6796('0x4f')]['originalname'])[_0x6796('0x54')](0x1),'converted_format':_0x6796('0x55')};var _0x10da40=path[_0x6796('0x4b')](config['root'],_0x6796('0x56'),_0x272389[_0x6796('0x4f')]['filename']);var _0x3f988f=path[_0x6796('0x4b')](config[_0x6796('0x48')],_0x6796('0x4c'),util['format'](_0x6796('0x4d'),path['basename'](_0x272389[_0x6796('0x4f')][_0x6796('0x53')],path[_0x6796('0x52')](_0x272389[_0x6796('0x4f')][_0x6796('0x53')])),_0x1aee3d[_0x6796('0x47')]));logger[_0x6796('0x57')](_0x6796('0x58'),_0x10da40);logger[_0x6796('0x57')](_0x6796('0x59'),_0x3f988f);try{fs[_0x6796('0x5a')](_0x10da40,parseInt(_0x6796('0x5b'),0x8));var _0x3c8c5d=sox[_0x6796('0x5c')](_0x10da40,_0x3f988f,{'sampleRate':0x1f40,'format':_0x6796('0x55'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3c8c5d['on'](_0x6796('0x5d'),function(_0x120d56){fs[_0x6796('0x5e')](_0x10da40);_0x4c42d0[_0x6796('0x16')](0x1f4)[_0x6796('0x5f')](_0x120d56);});_0x3c8c5d['on'](_0x6796('0x60'),function(_0x113aeb){_0x1aee3d[_0x6796('0x61')]=isNaN(_0x113aeb[_0x6796('0x62')])?null:_0x113aeb[_0x6796('0x62')]*0x3e8;_0x1aee3d[_0x6796('0x63')]=isNaN(_0x113aeb[_0x6796('0x64')])?null:_0x113aeb[_0x6796('0x64')];_0x1aee3d[_0x6796('0x65')]=isNaN(_0x113aeb[_0x6796('0x66')])?null:_0x113aeb[_0x6796('0x66')];_0x1aee3d[_0x6796('0x67')]=isNaN(_0x113aeb['bitRate'])?null:_0x113aeb[_0x6796('0x68')];_0x1aee3d[_0x6796('0x69')]=isNaN(_0x113aeb[_0x6796('0x6a')])?null:_0x113aeb[_0x6796('0x6a')];});_0x3c8c5d['on'](_0x6796('0x6b'),function(_0x4765f6){_0x1aee3d['converted_duration']=isNaN(_0x4765f6[_0x6796('0x62')])?null:_0x4765f6[_0x6796('0x62')]*0x3e8;_0x1aee3d[_0x6796('0x6c')]=isNaN(_0x4765f6[_0x6796('0x64')])?null:_0x4765f6['sampleCount'];_0x1aee3d[_0x6796('0x6d')]=isNaN(_0x4765f6[_0x6796('0x66')])?null:_0x4765f6['channelCount'];_0x1aee3d[_0x6796('0x6e')]=isNaN(_0x4765f6[_0x6796('0x68')])?null:_0x4765f6['bitRate'];_0x1aee3d[_0x6796('0x6f')]=isNaN(_0x4765f6[_0x6796('0x6a')])?null:_0x4765f6[_0x6796('0x6a')];});_0x3c8c5d['on'](_0x6796('0x17'),function(){fs['chmodSync'](_0x3f988f,parseInt(_0x6796('0x5b'),0x8));return db[_0x6796('0x3e')]['create'](_0x1aee3d)[_0x6796('0x1e')](function(_0x197cc9){var _0x48bdc0={'role':_0x272389[_0x6796('0x70')]['role'],'userProfileId':_0x272389[_0x6796('0x70')][_0x6796('0x71')]};if(!_0x48bdc0)throw new Error(_0x6796('0x72'));if(_0x48bdc0[_0x6796('0x73')]==='user'){var _0x36a4ba=_0x197cc9[_0x6796('0x1f')]({'plain':!![]});return db['UserProfileSection'][_0x6796('0x44')]({'where':{'name':_0x6796('0x20'),'userProfileId':_0x48bdc0['userProfileId']},'raw':!![]})['then'](function(_0x531651){if(_0x531651&&_0x531651[_0x6796('0x74')]===0x0){return db[_0x6796('0x21')][_0x6796('0x4e')]({'name':_0x36a4ba[_0x6796('0x24')],'resourceId':_0x36a4ba['id'],'type':_0x531651[_0x6796('0x24')],'sectionId':_0x531651['id']},{})[_0x6796('0x1e')](function(){return _0x197cc9;});}else{return _0x197cc9;}})[_0x6796('0x40')](function(_0x2c65a2){logger['error'](_0x6796('0x75'),_0x2c65a2);throw _0x2c65a2;});}return _0x197cc9;})[_0x6796('0x1e')](respondWithResult(_0x4c42d0,null))[_0x6796('0x40')](handleError(_0x4c42d0,null));});_0x3c8c5d[_0x6796('0x76')]();}catch(_0x23e09b){_0x4c42d0[_0x6796('0x16')](0x1f4)[_0x6796('0x5f')](_0x23e09b);}};exports[_0x6796('0x77')]=function(_0xe63c73,_0x5dde1c,_0x447e14){return db[_0x6796('0x3e')][_0x6796('0x44')]({'where':{'id':_0xe63c73[_0x6796('0x42')]['id']}})[_0x6796('0x1e')](handleEntityNotFound(_0x5dde1c,null))['then'](saveUpdates(_[_0x6796('0x37')](_0xe63c73[_0x6796('0x70')],[_0x6796('0x24'),'description']),null))[_0x6796('0x1e')](respondWithResult(_0x5dde1c,null))[_0x6796('0x40')](handleError(_0x5dde1c,null));};exports['delete']=function(_0x263909,_0x21715b,_0xe35fba){return db[_0x6796('0x3e')][_0x6796('0x44')]({'where':{'id':_0x263909[_0x6796('0x42')]['id']}})[_0x6796('0x1e')](function(_0x12bd72){if(_0x12bd72){return _0x12bd72[_0x6796('0x22')]();}})['then'](function(_0x26447d){var _0x58a553=path[_0x6796('0x4b')](config[_0x6796('0x48')],'server/files/sounds/original',util[_0x6796('0x78')](_0x6796('0x4d'),_0x26447d[_0x6796('0x46')],_0x26447d[_0x6796('0x79')]));var _0x35290c=path['join'](config[_0x6796('0x48')],_0x6796('0x4c'),util[_0x6796('0x78')]('%s.%s',_0x26447d[_0x6796('0x46')],_0x26447d[_0x6796('0x47')]));fs[_0x6796('0x5e')](_0x58a553);fs[_0x6796('0x5e')](_0x35290c);return _0x26447d;})[_0x6796('0x1e')](function(_0x317ae6){if(_0x317ae6){return _0x21715b[_0x6796('0x16')](0xcc)[_0x6796('0x17')]();}})[_0x6796('0x1e')](handleEntityNotFound(_0x21715b,null))[_0x6796('0x40')](handleError(_0x21715b,null));};
\ No newline at end of file
+var _0xbe85=['fast-json-patch','request-promise','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','Sounds','UserProfileResource','destroy','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','include','options','download','find','params','save_name','converted_format','existsSync','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','join','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','info','chmodSync','0777','transcode','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','unlinkSync','eml-format','rimraf','zip-dir'];(function(_0x1e6f7e,_0x4f39dd){var _0x54a9be=function(_0x3ca9d4){while(--_0x3ca9d4){_0x1e6f7e['push'](_0x1e6f7e['shift']());}};_0x54a9be(++_0x4f39dd);}(_0xbe85,0x81));var _0x5be8=function(_0x39368f,_0x51cd83){_0x39368f=_0x39368f-0x0;var _0xb2465b=_0xbe85[_0x39368f];return _0xb2465b;};'use strict';var emlformat=require(_0x5be8('0x0'));var rimraf=require(_0x5be8('0x1'));var zipdir=require(_0x5be8('0x2'));var jsonpatch=require(_0x5be8('0x3'));var rp=require(_0x5be8('0x4'));var moment=require('moment');var BPromise=require(_0x5be8('0x5'));var Mustache=require(_0x5be8('0x6'));var util=require('util');var path=require('path');var sox=require(_0x5be8('0x7'));var csv=require('to-csv');var ejs=require(_0x5be8('0x8'));var fs=require('fs');var fs_extra=require(_0x5be8('0x9'));var _=require(_0x5be8('0xa'));var squel=require(_0x5be8('0xb'));var crypto=require(_0x5be8('0xc'));var jsforce=require(_0x5be8('0xd'));var deskjs=require(_0x5be8('0xe'));var toCsv=require(_0x5be8('0xf'));var querystring=require(_0x5be8('0x10'));var Papa=require(_0x5be8('0x11'));var Redis=require(_0x5be8('0x12'));var authService=require(_0x5be8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5be8('0x14'));var hardwareService=require(_0x5be8('0x15'));var logger=require('../../config/logger')(_0x5be8('0x16'));var utils=require(_0x5be8('0x17'));var config=require(_0x5be8('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x390a88,_0x47d779){_0x47d779=_0x47d779||0xcc;return function(_0x3acc50){if(_0x3acc50){return _0x390a88[_0x5be8('0x19')](_0x47d779);}return _0x390a88[_0x5be8('0x1a')](_0x47d779)[_0x5be8('0x1b')]();};}function respondWithResult(_0x597c28,_0x5ee9e6){_0x5ee9e6=_0x5ee9e6||0xc8;return function(_0x4297cd){if(_0x4297cd){return _0x597c28[_0x5be8('0x1a')](_0x5ee9e6)['json'](_0x4297cd);}};}function respondWithFilteredResult(_0x561420,_0x5e3c65){return function(_0x174d3f){if(_0x174d3f){var _0x5a29a5=typeof _0x5e3c65[_0x5be8('0x1c')]===_0x5be8('0x1d')&&typeof _0x5e3c65[_0x5be8('0x1e')]===_0x5be8('0x1d');var _0x3aee17=_0x174d3f[_0x5be8('0x1f')];var _0x5d9b2c=_0x5a29a5?0x0:_0x5e3c65['offset'];var _0x4df24b=_0x5a29a5?_0x174d3f[_0x5be8('0x1f')]:_0x5e3c65[_0x5be8('0x1c')]+_0x5e3c65[_0x5be8('0x1e')];var _0x4c980b;if(_0x4df24b>=_0x3aee17){_0x4df24b=_0x3aee17;_0x4c980b=0xc8;}else{_0x4c980b=0xce;}_0x561420[_0x5be8('0x1a')](_0x4c980b);return _0x561420[_0x5be8('0x20')](_0x5be8('0x21'),_0x5d9b2c+'-'+_0x4df24b+'/'+_0x3aee17)[_0x5be8('0x22')](_0x174d3f);}return null;};}function patchUpdates(_0x73ac38){return function(_0x1165b8){try{jsonpatch[_0x5be8('0x23')](_0x1165b8,_0x73ac38,!![]);}catch(_0x3d6806){return BPromise[_0x5be8('0x24')](_0x3d6806);}return _0x1165b8[_0x5be8('0x25')]();};}function saveUpdates(_0x3b4148,_0x306b34){return function(_0x14785d){if(_0x14785d){return _0x14785d[_0x5be8('0x26')](_0x3b4148)[_0x5be8('0x27')](function(_0x37b962){return _0x37b962;});}return null;};}function removeEntity(_0x4369e9,_0x57fc82){return function(_0x15f341){if(_0x15f341){return _0x15f341['destroy']()['then'](function(){var _0x7c15fd=_0x15f341[_0x5be8('0x28')]({'plain':!![]});var _0x318bdd=_0x5be8('0x29');return db[_0x5be8('0x2a')][_0x5be8('0x2b')]({'where':{'type':_0x318bdd,'resourceId':_0x7c15fd['id']}})[_0x5be8('0x27')](function(){return _0x15f341;});})['then'](function(){_0x4369e9[_0x5be8('0x1a')](0xcc)[_0x5be8('0x1b')]();});}};}function handleEntityNotFound(_0x31ff20,_0x7fb830){return function(_0x13a2c3){if(!_0x13a2c3){_0x31ff20['sendStatus'](0x194);}return _0x13a2c3;};}function handleError(_0x1cd58c,_0x2d5dc0){_0x2d5dc0=_0x2d5dc0||0x1f4;return function(_0x56e493){logger[_0x5be8('0x2c')](_0x56e493[_0x5be8('0x2d')]);if(_0x56e493[_0x5be8('0x2e')]){delete _0x56e493[_0x5be8('0x2e')];}_0x1cd58c[_0x5be8('0x1a')](_0x2d5dc0)[_0x5be8('0x2f')](_0x56e493);};}exports[_0x5be8('0x30')]=function(_0x249cf9,_0x294de5){var _0x584962={},_0x609cec={},_0x2d3f95={'count':0x0,'rows':[]};var _0x19bfa5=_[_0x5be8('0x31')](db[_0x5be8('0x32')][_0x5be8('0x33')],function(_0x1ae035){return{'name':_0x1ae035[_0x5be8('0x34')],'type':_0x1ae035[_0x5be8('0x35')][_0x5be8('0x36')]};});_0x609cec['model']=_[_0x5be8('0x31')](_0x19bfa5,_0x5be8('0x2e'));_0x609cec[_0x5be8('0x37')]=_[_0x5be8('0x38')](_0x249cf9[_0x5be8('0x37')]);_0x609cec[_0x5be8('0x39')]=_['intersection'](_0x609cec['model'],_0x609cec[_0x5be8('0x37')]);_0x584962[_0x5be8('0x3a')]=_[_0x5be8('0x3b')](_0x609cec[_0x5be8('0x3c')],qs[_0x5be8('0x3d')](_0x249cf9[_0x5be8('0x37')][_0x5be8('0x3d')]));_0x584962[_0x5be8('0x3a')]=_0x584962[_0x5be8('0x3a')][_0x5be8('0x3e')]?_0x584962[_0x5be8('0x3a')]:_0x609cec[_0x5be8('0x3c')];if(!_0x249cf9['query']['hasOwnProperty'](_0x5be8('0x3f'))){_0x584962['limit']=qs[_0x5be8('0x1e')](_0x249cf9[_0x5be8('0x37')][_0x5be8('0x1e')]);_0x584962[_0x5be8('0x1c')]=qs[_0x5be8('0x1c')](_0x249cf9['query'][_0x5be8('0x1c')]);}_0x584962[_0x5be8('0x40')]=qs[_0x5be8('0x41')](_0x249cf9['query'][_0x5be8('0x41')]);_0x584962[_0x5be8('0x42')]=qs[_0x5be8('0x39')](_[_0x5be8('0x43')](_0x249cf9['query'],_0x609cec[_0x5be8('0x39')]),_0x19bfa5);if(_0x249cf9[_0x5be8('0x37')][_0x5be8('0x44')]){_0x584962['where']=_[_0x5be8('0x45')](_0x584962[_0x5be8('0x42')],{'$or':_['map'](_0x19bfa5,function(_0x3a01bc){if(_0x3a01bc[_0x5be8('0x35')]!==_0x5be8('0x46')){var _0x36daf8={};_0x36daf8[_0x3a01bc[_0x5be8('0x2e')]]={'$like':'%'+_0x249cf9[_0x5be8('0x37')][_0x5be8('0x44')]+'%'};return _0x36daf8;}})});}_0x584962=_[_0x5be8('0x45')]({},_0x584962,_0x249cf9['options']);var _0x51ec16={'where':_0x584962['where']};return db[_0x5be8('0x32')][_0x5be8('0x1f')](_0x51ec16)[_0x5be8('0x27')](function(_0x48113d){_0x2d3f95[_0x5be8('0x1f')]=_0x48113d;if(_0x249cf9[_0x5be8('0x37')][_0x5be8('0x47')]){_0x584962['include']=[{'all':!![]}];}return db[_0x5be8('0x32')][_0x5be8('0x48')](_0x584962);})[_0x5be8('0x27')](function(_0x26d5bb){_0x2d3f95[_0x5be8('0x49')]=_0x26d5bb;return _0x2d3f95;})[_0x5be8('0x27')](respondWithFilteredResult(_0x294de5,_0x584962))[_0x5be8('0x4a')](handleError(_0x294de5,null));};exports[_0x5be8('0x4b')]=function(_0x454caa,_0x136175){var _0x1a66d7={'raw':!![],'where':{'id':_0x454caa['params']['id']}},_0x98a01a={};_0x98a01a[_0x5be8('0x3c')]=_[_0x5be8('0x38')](db['Sound'][_0x5be8('0x33')]);_0x98a01a[_0x5be8('0x37')]=_[_0x5be8('0x38')](_0x454caa[_0x5be8('0x37')]);_0x98a01a[_0x5be8('0x39')]=_['intersection'](_0x98a01a[_0x5be8('0x3c')],_0x98a01a[_0x5be8('0x37')]);_0x1a66d7[_0x5be8('0x3a')]=_[_0x5be8('0x3b')](_0x98a01a['model'],qs['fields'](_0x454caa['query']['fields']));_0x1a66d7[_0x5be8('0x3a')]=_0x1a66d7[_0x5be8('0x3a')]['length']?_0x1a66d7[_0x5be8('0x3a')]:_0x98a01a[_0x5be8('0x3c')];if(_0x454caa[_0x5be8('0x37')][_0x5be8('0x47')]){_0x1a66d7[_0x5be8('0x4c')]=[{'all':!![]}];}_0x1a66d7=_[_0x5be8('0x45')]({},_0x1a66d7,_0x454caa[_0x5be8('0x4d')]);return db[_0x5be8('0x32')]['find'](_0x1a66d7)[_0x5be8('0x27')](handleEntityNotFound(_0x136175,null))[_0x5be8('0x27')](respondWithResult(_0x136175,null))['catch'](handleError(_0x136175,null));};exports[_0x5be8('0x4e')]=function(_0x1f1853,_0x142382,_0x39f16d){return db[_0x5be8('0x32')][_0x5be8('0x4f')]({'where':{'id':_0x1f1853[_0x5be8('0x50')]['id']},'attributes':['name',_0x5be8('0x51'),_0x5be8('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x142382,null))['then'](function(_0x1525b0){if(_0x1525b0){if(!fs[_0x5be8('0x53')](path['join'](config[_0x5be8('0x54')],_0x5be8('0x55'),_0x1525b0[_0x5be8('0x51')]+'.'+_0x1525b0['converted_format']))){throw new db[(_0x5be8('0x56'))][(_0x5be8('0x57'))](_0x5be8('0x58'));}return _0x142382[_0x5be8('0x4e')](path[_0x5be8('0x59')](config[_0x5be8('0x54')],_0x5be8('0x55'),util[_0x5be8('0x5a')](_0x5be8('0x5b'),_0x1525b0['save_name'],_0x1525b0[_0x5be8('0x52')])),util[_0x5be8('0x5a')](_0x5be8('0x5b'),_0x1525b0['name'],_0x1525b0[_0x5be8('0x52')]));}return null;})['catch'](handleError(_0x142382,null));};exports[_0x5be8('0x5c')]=function(_0x60d10e,_0x4f3c9a,_0x21abaf){var _0x1f936f={'name':path[_0x5be8('0x5d')](_0x60d10e[_0x5be8('0x5e')][_0x5be8('0x5f')],path[_0x5be8('0x60')](_0x60d10e[_0x5be8('0x5e')][_0x5be8('0x5f')])),'save_name':path[_0x5be8('0x5d')](_0x60d10e['file'][_0x5be8('0x61')],path[_0x5be8('0x60')](_0x60d10e['file'][_0x5be8('0x61')])),'original_format':path[_0x5be8('0x60')](_0x60d10e[_0x5be8('0x5e')]['originalname'])[_0x5be8('0x62')](0x1),'converted_format':_0x5be8('0x63')};var _0x269276=path[_0x5be8('0x59')](config[_0x5be8('0x54')],'server/files/sounds/original',_0x60d10e['file'][_0x5be8('0x61')]);var _0x2ea801=path[_0x5be8('0x59')](config[_0x5be8('0x54')],_0x5be8('0x55'),util[_0x5be8('0x5a')]('%s.%s',path[_0x5be8('0x5d')](_0x60d10e[_0x5be8('0x5e')]['filename'],path[_0x5be8('0x60')](_0x60d10e[_0x5be8('0x5e')]['filename'])),_0x1f936f[_0x5be8('0x52')]));logger[_0x5be8('0x64')]('Sound\x20upload\x20filepath:\x20%s',_0x269276);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x2ea801);try{fs[_0x5be8('0x65')](_0x269276,parseInt(_0x5be8('0x66'),0x8));var _0x1c0f4c=sox[_0x5be8('0x67')](_0x269276,_0x2ea801,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1c0f4c['on'](_0x5be8('0x2c'),function(_0x47e61b){fs['unlinkSync'](_0x269276);_0x4f3c9a['status'](0x1f4)['send'](_0x47e61b);});_0x1c0f4c['on']('src',function(_0x1fa2b4){_0x1f936f[_0x5be8('0x68')]=isNaN(_0x1fa2b4[_0x5be8('0x69')])?null:_0x1fa2b4['duration']*0x3e8;_0x1f936f[_0x5be8('0x6a')]=isNaN(_0x1fa2b4[_0x5be8('0x6b')])?null:_0x1fa2b4['sampleCount'];_0x1f936f[_0x5be8('0x6c')]=isNaN(_0x1fa2b4[_0x5be8('0x6d')])?null:_0x1fa2b4['channelCount'];_0x1f936f[_0x5be8('0x6e')]=isNaN(_0x1fa2b4['bitRate'])?null:_0x1fa2b4[_0x5be8('0x6f')];_0x1f936f[_0x5be8('0x70')]=isNaN(_0x1fa2b4[_0x5be8('0x71')])?null:_0x1fa2b4['sampleRate'];});_0x1c0f4c['on'](_0x5be8('0x72'),function(_0x58a803){_0x1f936f[_0x5be8('0x73')]=isNaN(_0x58a803[_0x5be8('0x69')])?null:_0x58a803[_0x5be8('0x69')]*0x3e8;_0x1f936f[_0x5be8('0x74')]=isNaN(_0x58a803[_0x5be8('0x6b')])?null:_0x58a803[_0x5be8('0x6b')];_0x1f936f['converted_channelCount']=isNaN(_0x58a803[_0x5be8('0x6d')])?null:_0x58a803[_0x5be8('0x6d')];_0x1f936f[_0x5be8('0x75')]=isNaN(_0x58a803['bitRate'])?null:_0x58a803[_0x5be8('0x6f')];_0x1f936f[_0x5be8('0x76')]=isNaN(_0x58a803[_0x5be8('0x71')])?null:_0x58a803['sampleRate'];});_0x1c0f4c['on']('end',function(){fs[_0x5be8('0x65')](_0x2ea801,parseInt(_0x5be8('0x66'),0x8));return db[_0x5be8('0x32')]['create'](_0x1f936f)[_0x5be8('0x27')](function(_0x2c5a02){var _0x5749cf={'role':_0x60d10e[_0x5be8('0x77')][_0x5be8('0x78')],'userProfileId':_0x60d10e[_0x5be8('0x77')][_0x5be8('0x79')]};if(!_0x5749cf)throw new Error(_0x5be8('0x7a'));if(_0x5749cf[_0x5be8('0x78')]===_0x5be8('0x7b')){var _0x13bbb0=_0x2c5a02[_0x5be8('0x28')]({'plain':!![]});return db[_0x5be8('0x7c')][_0x5be8('0x4f')]({'where':{'name':_0x5be8('0x29'),'userProfileId':_0x5749cf['userProfileId']},'raw':!![]})[_0x5be8('0x27')](function(_0x52ee49){if(_0x52ee49&&_0x52ee49[_0x5be8('0x7d')]===0x0){return db[_0x5be8('0x2a')][_0x5be8('0x5c')]({'name':_0x13bbb0[_0x5be8('0x2e')],'resourceId':_0x13bbb0['id'],'type':_0x52ee49[_0x5be8('0x2e')],'sectionId':_0x52ee49['id']},{})[_0x5be8('0x27')](function(){return _0x2c5a02;});}else{return _0x2c5a02;}})['catch'](function(_0x28af14){logger[_0x5be8('0x2c')](_0x5be8('0x7e'),_0x28af14);throw _0x28af14;});}return _0x2c5a02;})[_0x5be8('0x27')](respondWithResult(_0x4f3c9a,null))[_0x5be8('0x4a')](handleError(_0x4f3c9a,null));});_0x1c0f4c[_0x5be8('0x7f')]();}catch(_0x2847e4){_0x4f3c9a['status'](0x1f4)[_0x5be8('0x2f')](_0x2847e4);}};exports[_0x5be8('0x26')]=function(_0x64f26a,_0x3cc5b4,_0x4f5cf0){return db['Sound'][_0x5be8('0x4f')]({'where':{'id':_0x64f26a[_0x5be8('0x50')]['id']}})['then'](handleEntityNotFound(_0x3cc5b4,null))[_0x5be8('0x27')](saveUpdates(_[_0x5be8('0x43')](_0x64f26a[_0x5be8('0x77')],['name',_0x5be8('0x80')]),null))[_0x5be8('0x27')](respondWithResult(_0x3cc5b4,null))['catch'](handleError(_0x3cc5b4,null));};exports[_0x5be8('0x81')]=function(_0x2519a1,_0x2b7b70,_0x43dbc8){return db[_0x5be8('0x32')][_0x5be8('0x4f')]({'where':{'id':_0x2519a1[_0x5be8('0x50')]['id']}})['then'](function(_0x785091){if(_0x785091){return _0x785091[_0x5be8('0x2b')]();}})[_0x5be8('0x27')](function(_0x3943a7){var _0x42b1de=path['join'](config['root'],'server/files/sounds/original',util[_0x5be8('0x5a')](_0x5be8('0x5b'),_0x3943a7['save_name'],_0x3943a7[_0x5be8('0x82')]));var _0x46092a=path[_0x5be8('0x59')](config[_0x5be8('0x54')],_0x5be8('0x55'),util['format']('%s.%s',_0x3943a7[_0x5be8('0x51')],_0x3943a7[_0x5be8('0x52')]));fs[_0x5be8('0x83')](_0x42b1de);fs['unlinkSync'](_0x46092a);return _0x3943a7;})[_0x5be8('0x27')](function(_0x35b61d){if(_0x35b61d){return _0x2b7b70[_0x5be8('0x1a')](0xcc)[_0x5be8('0x1b')]();}})['then'](handleEntityNotFound(_0x2b7b70,null))[_0x5be8('0x4a')](handleError(_0x2b7b70,null));};
\ No newline at end of file
index c0ea2de..6807f17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fb2=['Sound','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x7fb2,0x197));var _0x27fb=function(_0x12256e,_0x2a60ce){_0x12256e=_0x12256e-0x0;var _0x35947e=_0x7fb2[_0x12256e];return _0x35947e;};'use strict';var _=require(_0x27fb('0x0'));var util=require(_0x27fb('0x1'));var logger=require(_0x27fb('0x2'))(_0x27fb('0x3'));var moment=require(_0x27fb('0x4'));var BPromise=require(_0x27fb('0x5'));var rp=require(_0x27fb('0x6'));var fs=require('fs');var path=require(_0x27fb('0x7'));var rimraf=require(_0x27fb('0x8'));var config=require(_0x27fb('0x9'));var attributes=require(_0x27fb('0xa'));module[_0x27fb('0xb')]=function(_0x3efeee,_0x5c5d53){return _0x3efeee[_0x27fb('0xc')](_0x27fb('0xd'),attributes,{'tableName':_0x27fb('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf9a7=['define','Sound','tools_sounds','lodash','util','api','moment','path','../../config/environment','./sound.attributes'];(function(_0x2d57a9,_0x5ae060){var _0x1b9671=function(_0x95fb4e){while(--_0x95fb4e){_0x2d57a9['push'](_0x2d57a9['shift']());}};_0x1b9671(++_0x5ae060);}(_0xf9a7,0xad));var _0x7f9a=function(_0x43473f,_0x43e26b){_0x43473f=_0x43473f-0x0;var _0x5eb06a=_0xf9a7[_0x43473f];return _0x5eb06a;};'use strict';var _=require(_0x7f9a('0x0'));var util=require(_0x7f9a('0x1'));var logger=require('../../config/logger')(_0x7f9a('0x2'));var moment=require(_0x7f9a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f9a('0x4'));var rimraf=require('rimraf');var config=require(_0x7f9a('0x5'));var attributes=require(_0x7f9a('0x6'));module['exports']=function(_0x1c236b,_0x5a8b8a){return _0x1c236b[_0x7f9a('0x7')](_0x7f9a('0x8'),attributes,{'tableName':_0x7f9a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 65b8d4b..8b3c4af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85d7=['Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSound','find','options','where','attributes','include','model','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5ae1b8,_0x548f26){var _0x2076e9=function(_0x477e5a){while(--_0x477e5a){_0x5ae1b8['push'](_0x5ae1b8['shift']());}};_0x2076e9(++_0x548f26);}(_0x85d7,0x8f));var _0x785d=function(_0x50ede0,_0x7e6410){_0x50ede0=_0x50ede0-0x0;var _0x5cbe32=_0x85d7[_0x50ede0];return _0x5cbe32;};'use strict';var _=require('lodash');var util=require(_0x785d('0x0'));var moment=require(_0x785d('0x1'));var BPromise=require(_0x785d('0x2'));var rs=require(_0x785d('0x3'));var fs=require('fs');var Redis=require(_0x785d('0x4'));var db=require(_0x785d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x785d('0x6'));var config=require(_0x785d('0x7'));var jayson=require(_0x785d('0x8'));var client=jayson[_0x785d('0x9')][_0x785d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a0d40,_0x5f4879,_0xafa305){return new BPromise(function(_0x192721,_0x3d708b){return client[_0x785d('0xb')](_0x5a0d40,_0xafa305)['then'](function(_0x2a09cf){logger['info'](_0x785d('0xc'),_0x5f4879,_0x785d('0xd'));logger[_0x785d('0xe')](_0x785d('0xf'),_0x5f4879,_0x785d('0xd'),JSON[_0x785d('0x10')](_0x2a09cf));if(_0x2a09cf[_0x785d('0x11')]){if(_0x2a09cf[_0x785d('0x11')][_0x785d('0x12')]===0x1f4){logger['error'](_0x785d('0xc'),_0x5f4879,_0x2a09cf[_0x785d('0x11')]['message']);return _0x3d708b(_0x2a09cf[_0x785d('0x11')][_0x785d('0x13')]);}logger[_0x785d('0x11')](_0x785d('0xc'),_0x5f4879,_0x2a09cf[_0x785d('0x11')][_0x785d('0x13')]);return _0x192721(_0x2a09cf[_0x785d('0x11')][_0x785d('0x13')]);}else{logger[_0x785d('0x14')]('Sound,\x20%s,\x20%s',_0x5f4879,_0x785d('0xd'));_0x192721(_0x2a09cf[_0x785d('0x15')][_0x785d('0x13')]);}})[_0x785d('0x16')](function(_0x5643c4){logger[_0x785d('0x11')](_0x785d('0xc'),_0x5f4879,_0x5643c4);_0x3d708b(_0x5643c4);});});}exports[_0x785d('0x17')]=function(_0x64923d){var _0x2d6659=this;return new Promise(function(_0x3098b7,_0x4b74d1){return db['Sound'][_0x785d('0x18')]({'raw':_0x64923d['options']?_0x64923d[_0x785d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x64923d[_0x785d('0x19')]?_0x64923d[_0x785d('0x19')][_0x785d('0x1a')]||null:null,'attributes':_0x64923d[_0x785d('0x19')]?_0x64923d['options'][_0x785d('0x1b')]||null:null,'include':_0x64923d['options']?_0x64923d['options']['include']?_['map'](_0x64923d[_0x785d('0x19')][_0x785d('0x1c')],function(_0x2e9d11){return{'model':db[_0x2e9d11['model']],'as':_0x2e9d11['as'],'attributes':_0x2e9d11['attributes'],'include':_0x2e9d11[_0x785d('0x1c')]?_['map'](_0x2e9d11[_0x785d('0x1c')],function(_0x45cca4){return{'model':db[_0x45cca4[_0x785d('0x1d')]],'as':_0x45cca4['as'],'attributes':_0x45cca4[_0x785d('0x1b')],'include':_0x45cca4[_0x785d('0x1c')]?_['map'](_0x45cca4['include'],function(_0x416eed){return{'model':db[_0x416eed[_0x785d('0x1d')]],'as':_0x416eed['as'],'attributes':_0x416eed['attributes']};}):[]};}):[]};}):[]:[]})[_0x785d('0x1e')](function(_0x153764){logger['info'](_0x785d('0x17'),_0x64923d);logger[_0x785d('0xe')]('ShowSound',_0x64923d,JSON[_0x785d('0x10')](_0x153764));_0x3098b7(_0x153764);})[_0x785d('0x16')](function(_0x21a7af){logger[_0x785d('0x11')](_0x785d('0x17'),_0x21a7af['message'],_0x64923d);_0x4b74d1(_0x2d6659['error'](0x1f4,_0x21a7af[_0x785d('0x13')]));});});};
\ No newline at end of file
+var _0x0833=['then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','result','catch','Sound','find','options','where','attributes','include','map','model','ShowSound','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x485abd,_0x32c7c1){var _0x3379f1=function(_0x36b528){while(--_0x36b528){_0x485abd['push'](_0x485abd['shift']());}};_0x3379f1(++_0x32c7c1);}(_0x0833,0x99));var _0x3083=function(_0x1e8e98,_0x372558){_0x1e8e98=_0x1e8e98-0x0;var _0x4f850f=_0x0833[_0x1e8e98];return _0x4f850f;};'use strict';var _=require('lodash');var util=require(_0x3083('0x0'));var moment=require(_0x3083('0x1'));var BPromise=require(_0x3083('0x2'));var rs=require(_0x3083('0x3'));var fs=require('fs');var Redis=require(_0x3083('0x4'));var db=require(_0x3083('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3083('0x6'))(_0x3083('0x7'));var config=require(_0x3083('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3083('0x9')][_0x3083('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x402c69,_0x44c9ce,_0x3e5762){return new BPromise(function(_0x1af86e,_0x15faa2){return client[_0x3083('0xb')](_0x402c69,_0x3e5762)[_0x3083('0xc')](function(_0x8be13b){logger[_0x3083('0xd')]('Sound,\x20%s,\x20%s',_0x44c9ce,_0x3083('0xe'));logger[_0x3083('0xf')](_0x3083('0x10'),_0x44c9ce,_0x3083('0xe'),JSON[_0x3083('0x11')](_0x8be13b));if(_0x8be13b[_0x3083('0x12')]){if(_0x8be13b[_0x3083('0x12')][_0x3083('0x13')]===0x1f4){logger[_0x3083('0x12')](_0x3083('0x14'),_0x44c9ce,_0x8be13b[_0x3083('0x12')][_0x3083('0x15')]);return _0x15faa2(_0x8be13b[_0x3083('0x12')][_0x3083('0x15')]);}logger[_0x3083('0x12')]('Sound,\x20%s,\x20%s',_0x44c9ce,_0x8be13b[_0x3083('0x12')][_0x3083('0x15')]);return _0x1af86e(_0x8be13b['error']['message']);}else{logger[_0x3083('0xd')](_0x3083('0x14'),_0x44c9ce,_0x3083('0xe'));_0x1af86e(_0x8be13b[_0x3083('0x16')][_0x3083('0x15')]);}})[_0x3083('0x17')](function(_0x231b13){logger[_0x3083('0x12')](_0x3083('0x14'),_0x44c9ce,_0x231b13);_0x15faa2(_0x231b13);});});}exports['ShowSound']=function(_0x472184){var _0x576b3b=this;return new Promise(function(_0x26188c,_0x2a7961){return db[_0x3083('0x18')][_0x3083('0x19')]({'raw':_0x472184[_0x3083('0x1a')]?_0x472184['options']['raw']===undefined?!![]:![]:!![],'where':_0x472184['options']?_0x472184[_0x3083('0x1a')][_0x3083('0x1b')]||null:null,'attributes':_0x472184[_0x3083('0x1a')]?_0x472184['options'][_0x3083('0x1c')]||null:null,'include':_0x472184[_0x3083('0x1a')]?_0x472184['options'][_0x3083('0x1d')]?_[_0x3083('0x1e')](_0x472184[_0x3083('0x1a')][_0x3083('0x1d')],function(_0x4f7f1a){return{'model':db[_0x4f7f1a[_0x3083('0x1f')]],'as':_0x4f7f1a['as'],'attributes':_0x4f7f1a['attributes'],'include':_0x4f7f1a[_0x3083('0x1d')]?_['map'](_0x4f7f1a[_0x3083('0x1d')],function(_0x13ffd){return{'model':db[_0x13ffd[_0x3083('0x1f')]],'as':_0x13ffd['as'],'attributes':_0x13ffd[_0x3083('0x1c')],'include':_0x13ffd['include']?_[_0x3083('0x1e')](_0x13ffd[_0x3083('0x1d')],function(_0x48882d){return{'model':db[_0x48882d[_0x3083('0x1f')]],'as':_0x48882d['as'],'attributes':_0x48882d[_0x3083('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3083('0xc')](function(_0x47c29a){logger[_0x3083('0xd')](_0x3083('0x20'),_0x472184);logger['debug'](_0x3083('0x20'),_0x472184,JSON[_0x3083('0x11')](_0x47c29a));_0x26188c(_0x47c29a);})[_0x3083('0x17')](function(_0x5c5025){logger['error']('ShowSound',_0x5c5025['message'],_0x472184);_0x2a7961(_0x576b3b[_0x3083('0x12')](0x1f4,_0x5c5025[_0x3083('0x15')]));});});};
\ No newline at end of file
index 19d028f..8ef8166 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x521731,_0x26752c){var _0x11477a=function(_0x173d8d){while(--_0x173d8d){_0x521731['push'](_0x521731['shift']());}};_0x11477a(++_0x26752c);}(_0x2032,0xd9));var _0x2203=function(_0x3bc7a9,_0x28d8f9){_0x3bc7a9=_0x3bc7a9-0x0;var _0x20a453=_0x2032[_0x3bc7a9];return _0x20a453;};'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('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router;
\ No newline at end of file
+var _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x1162f9,_0x35f87c){var _0x75257c=function(_0x11ac6b){while(--_0x11ac6b){_0x1162f9['push'](_0x1162f9['shift']());}};_0x75257c(++_0x35f87c);}(_0x8603,0x190));var _0x3860=function(_0x284d1e,_0x44ac0a){_0x284d1e=_0x284d1e-0x0;var _0x296c3d=_0x8603[_0x284d1e];return _0x296c3d;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router;
\ No newline at end of file
index c6b033c..a379f06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6790=['STRING','TEXT','out','exports'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0x6790,0x183));var _0x0679=function(_0x146341,_0x25b647){_0x146341=_0x146341-0x0;var _0x2d95f0=_0x6790[_0x146341];return _0x2d95f0;};'use strict';var Sequelize=require('sequelize');module[_0x0679('0x0')]={'uniqueid':{'type':Sequelize[_0x0679('0x1')]},'body':{'type':Sequelize[_0x0679('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x0679('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0x0679('0x1')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x45eb=['TEXT','ENUM','out','sequelize','exports','STRING'];(function(_0x33f9c6,_0x24cc4f){var _0x1edc0d=function(_0x49dfb8){while(--_0x49dfb8){_0x33f9c6['push'](_0x33f9c6['shift']());}};_0x1edc0d(++_0x24cc4f);}(_0x45eb,0x6f));var _0xb45e=function(_0x52ce2c,_0x51d527){_0x52ce2c=_0x52ce2c-0x0;var _0x292ab7=_0x45eb[_0x52ce2c];return _0x292ab7;};'use strict';var Sequelize=require(_0xb45e('0x0'));module[_0xb45e('0x1')]={'uniqueid':{'type':Sequelize[_0xb45e('0x2')]},'body':{'type':Sequelize[_0xb45e('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xb45e('0x4')]('in',_0xb45e('0x5')),'defaultValue':_0xb45e('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xb45e('0x2')]},'providerResponse':{'type':Sequelize[_0xb45e('0x3')]}};
\ No newline at end of file
index e075961..7f406e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdf0=['then','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','key','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xcdf0,0xa8));var _0x0cdf=function(_0x59cdcf,_0x53488e){_0x59cdcf=_0x59cdcf-0x0;var _0x5ab6ed=_0xcdf0[_0x59cdcf];return _0x5ab6ed;};'use strict';var emlformat=require(_0x0cdf('0x0'));var rimraf=require(_0x0cdf('0x1'));var zipdir=require(_0x0cdf('0x2'));var jsonpatch=require(_0x0cdf('0x3'));var rp=require(_0x0cdf('0x4'));var moment=require('moment');var BPromise=require(_0x0cdf('0x5'));var Mustache=require('mustache');var util=require(_0x0cdf('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0cdf('0x7'));var ejs=require(_0x0cdf('0x8'));var fs=require('fs');var fs_extra=require(_0x0cdf('0x9'));var _=require(_0x0cdf('0xa'));var squel=require(_0x0cdf('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0cdf('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0cdf('0xd'));var Papa=require(_0x0cdf('0xe'));var Redis=require('ioredis');var authService=require(_0x0cdf('0xf'));var qs=require(_0x0cdf('0x10'));var as=require(_0x0cdf('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0cdf('0x12'))(_0x0cdf('0x13'));var utils=require(_0x0cdf('0x14'));var config=require(_0x0cdf('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0cdf('0x16'))['db'];function respondWithStatusCode(_0x1f2610,_0x5f0166){_0x5f0166=_0x5f0166||0xcc;return function(_0x46f644){if(_0x46f644){return _0x1f2610[_0x0cdf('0x17')](_0x5f0166);}return _0x1f2610[_0x0cdf('0x18')](_0x5f0166)[_0x0cdf('0x19')]();};}function respondWithResult(_0x419fb9,_0x126265){_0x126265=_0x126265||0xc8;return function(_0x4c74d0){if(_0x4c74d0){return _0x419fb9[_0x0cdf('0x18')](_0x126265)[_0x0cdf('0x1a')](_0x4c74d0);}};}function respondWithFilteredResult(_0x5e371e,_0x249929){return function(_0x3799a3){if(_0x3799a3){var _0x35e973=typeof _0x249929[_0x0cdf('0x1b')]==='undefined'&&typeof _0x249929['limit']===_0x0cdf('0x1c');var _0x549938=_0x3799a3[_0x0cdf('0x1d')];var _0x438d05=_0x35e973?0x0:_0x249929['offset'];var _0x4a1939=_0x35e973?_0x3799a3['count']:_0x249929['offset']+_0x249929[_0x0cdf('0x1e')];var _0x5bb5b9;if(_0x4a1939>=_0x549938){_0x4a1939=_0x549938;_0x5bb5b9=0xc8;}else{_0x5bb5b9=0xce;}_0x5e371e[_0x0cdf('0x18')](_0x5bb5b9);return _0x5e371e[_0x0cdf('0x1f')](_0x0cdf('0x20'),_0x438d05+'-'+_0x4a1939+'/'+_0x549938)[_0x0cdf('0x1a')](_0x3799a3);}return null;};}function patchUpdates(_0x44613c){return function(_0x1e0e9e){try{jsonpatch['apply'](_0x1e0e9e,_0x44613c,!![]);}catch(_0x15d749){return BPromise[_0x0cdf('0x21')](_0x15d749);}return _0x1e0e9e[_0x0cdf('0x22')]();};}function saveUpdates(_0x16fe7a,_0x1df993){return function(_0x253aaf){if(_0x253aaf){return _0x253aaf['update'](_0x16fe7a)['then'](function(_0x35a656){return _0x35a656;});}return null;};}function removeEntity(_0xdd3b90,_0x15324e){return function(_0x31433b){if(_0x31433b){return _0x31433b[_0x0cdf('0x23')]()['then'](function(){_0xdd3b90[_0x0cdf('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x271471,_0x204293){return function(_0xe8005f){if(!_0xe8005f){_0x271471[_0x0cdf('0x17')](0x194);}return _0xe8005f;};}function handleError(_0x33cf47,_0x3a1514){_0x3a1514=_0x3a1514||0x1f4;return function(_0x336683){logger[_0x0cdf('0x24')](_0x336683[_0x0cdf('0x25')]);if(_0x336683[_0x0cdf('0x26')]){delete _0x336683['name'];}_0x33cf47[_0x0cdf('0x18')](_0x3a1514)[_0x0cdf('0x27')](_0x336683);};}exports[_0x0cdf('0x28')]=function(_0x54fd1c,_0x4c03a7){var _0x1f93b6={},_0x5d6cf7={},_0x1560ae={'count':0x0,'rows':[]};var _0x4c1f4c=_[_0x0cdf('0x29')](db[_0x0cdf('0x2a')][_0x0cdf('0x2b')],function(_0x45665e){return{'name':_0x45665e[_0x0cdf('0x2c')],'type':_0x45665e['type'][_0x0cdf('0x2d')]};});_0x5d6cf7['model']=_['map'](_0x4c1f4c,_0x0cdf('0x26'));_0x5d6cf7[_0x0cdf('0x2e')]=_['keys'](_0x54fd1c[_0x0cdf('0x2e')]);_0x5d6cf7[_0x0cdf('0x2f')]=_['intersection'](_0x5d6cf7['model'],_0x5d6cf7['query']);_0x1f93b6[_0x0cdf('0x30')]=_[_0x0cdf('0x31')](_0x5d6cf7[_0x0cdf('0x32')],qs[_0x0cdf('0x33')](_0x54fd1c['query'][_0x0cdf('0x33')]));_0x1f93b6['attributes']=_0x1f93b6[_0x0cdf('0x30')][_0x0cdf('0x34')]?_0x1f93b6[_0x0cdf('0x30')]:_0x5d6cf7[_0x0cdf('0x32')];if(!_0x54fd1c['query'][_0x0cdf('0x35')](_0x0cdf('0x36'))){_0x1f93b6['limit']=qs[_0x0cdf('0x1e')](_0x54fd1c['query'][_0x0cdf('0x1e')]);_0x1f93b6[_0x0cdf('0x1b')]=qs[_0x0cdf('0x1b')](_0x54fd1c[_0x0cdf('0x2e')][_0x0cdf('0x1b')]);}_0x1f93b6[_0x0cdf('0x37')]=qs[_0x0cdf('0x38')](_0x54fd1c[_0x0cdf('0x2e')][_0x0cdf('0x38')]);_0x1f93b6[_0x0cdf('0x39')]=qs[_0x0cdf('0x2f')](_[_0x0cdf('0x3a')](_0x54fd1c[_0x0cdf('0x2e')],_0x5d6cf7['filters']),_0x4c1f4c);if(_0x54fd1c[_0x0cdf('0x2e')][_0x0cdf('0x3b')]){_0x1f93b6[_0x0cdf('0x39')]=_[_0x0cdf('0x3c')](_0x1f93b6['where'],{'$or':_[_0x0cdf('0x29')](_0x4c1f4c,function(_0x273bc5){if(_0x273bc5[_0x0cdf('0x3d')]!==_0x0cdf('0x3e')){var _0x481602={};_0x481602[_0x273bc5['name']]={'$like':'%'+_0x54fd1c['query'][_0x0cdf('0x3b')]+'%'};return _0x481602;}})});}_0x1f93b6=_[_0x0cdf('0x3c')]({},_0x1f93b6,_0x54fd1c['options']);var _0x268b17={'where':_0x1f93b6[_0x0cdf('0x39')]};return db[_0x0cdf('0x2a')][_0x0cdf('0x1d')](_0x268b17)[_0x0cdf('0x3f')](function(_0x18b8aa){_0x1560ae['count']=_0x18b8aa;if(_0x54fd1c[_0x0cdf('0x2e')][_0x0cdf('0x40')]){_0x1f93b6[_0x0cdf('0x41')]=[{'all':!![]}];}return db['SquareMessage'][_0x0cdf('0x42')](_0x1f93b6);})[_0x0cdf('0x3f')](function(_0x38991e){_0x1560ae[_0x0cdf('0x43')]=_0x38991e;return _0x1560ae;})[_0x0cdf('0x3f')](respondWithFilteredResult(_0x4c03a7,_0x1f93b6))[_0x0cdf('0x44')](handleError(_0x4c03a7,null));};exports[_0x0cdf('0x45')]=function(_0x446fd2,_0x122653){var _0x54dbbb={'raw':!![],'where':{'id':_0x446fd2[_0x0cdf('0x46')]['id']}},_0xd10818={};_0xd10818[_0x0cdf('0x32')]=_['keys'](db['SquareMessage'][_0x0cdf('0x2b')]);_0xd10818[_0x0cdf('0x2e')]=_[_0x0cdf('0x47')](_0x446fd2[_0x0cdf('0x2e')]);_0xd10818['filters']=_[_0x0cdf('0x31')](_0xd10818['model'],_0xd10818[_0x0cdf('0x2e')]);_0x54dbbb['attributes']=_[_0x0cdf('0x31')](_0xd10818[_0x0cdf('0x32')],qs[_0x0cdf('0x33')](_0x446fd2[_0x0cdf('0x2e')][_0x0cdf('0x33')]));_0x54dbbb[_0x0cdf('0x30')]=_0x54dbbb[_0x0cdf('0x30')][_0x0cdf('0x34')]?_0x54dbbb['attributes']:_0xd10818['model'];if(_0x446fd2[_0x0cdf('0x2e')][_0x0cdf('0x40')]){_0x54dbbb[_0x0cdf('0x41')]=[{'all':!![]}];}_0x54dbbb=_[_0x0cdf('0x3c')]({},_0x54dbbb,_0x446fd2[_0x0cdf('0x48')]);return db[_0x0cdf('0x2a')][_0x0cdf('0x49')](_0x54dbbb)[_0x0cdf('0x3f')](handleEntityNotFound(_0x122653,null))[_0x0cdf('0x3f')](respondWithResult(_0x122653,null))[_0x0cdf('0x44')](handleError(_0x122653,null));};exports[_0x0cdf('0x4a')]=function(_0x4be1df,_0x557c64){return db[_0x0cdf('0x2a')]['create'](_0x4be1df[_0x0cdf('0x4b')],{})[_0x0cdf('0x3f')](respondWithResult(_0x557c64,0xc9))[_0x0cdf('0x44')](handleError(_0x557c64,null));};exports[_0x0cdf('0x4c')]=function(_0x271e81,_0x46f246){if(_0x271e81[_0x0cdf('0x4b')]['id']){delete _0x271e81[_0x0cdf('0x4b')]['id'];}return db['SquareMessage'][_0x0cdf('0x49')]({'where':{'id':_0x271e81[_0x0cdf('0x46')]['id']}})[_0x0cdf('0x3f')](handleEntityNotFound(_0x46f246,null))[_0x0cdf('0x3f')](saveUpdates(_0x271e81[_0x0cdf('0x4b')],null))['then'](respondWithResult(_0x46f246,null))[_0x0cdf('0x44')](handleError(_0x46f246,null));};exports['destroy']=function(_0x4496a1,_0x5d48f5){return db[_0x0cdf('0x2a')][_0x0cdf('0x49')]({'where':{'id':_0x4496a1[_0x0cdf('0x46')]['id']}})[_0x0cdf('0x3f')](handleEntityNotFound(_0x5d48f5,null))['then'](removeEntity(_0x5d48f5,null))['catch'](handleError(_0x5d48f5,null));};
\ No newline at end of file
+var _0xbdcf=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareMessage','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','create','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse'];(function(_0x652239,_0x5bc228){var _0x326ea6=function(_0x72ba37){while(--_0x72ba37){_0x652239['push'](_0x652239['shift']());}};_0x326ea6(++_0x5bc228);}(_0xbdcf,0x173));var _0xfbdc=function(_0x5e77b0,_0x3e845a){_0x5e77b0=_0x5e77b0-0x0;var _0x39c2df=_0xbdcf[_0x5e77b0];return _0x39c2df;};'use strict';var emlformat=require(_0xfbdc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfbdc('0x1'));var jsonpatch=require(_0xfbdc('0x2'));var rp=require(_0xfbdc('0x3'));var moment=require(_0xfbdc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfbdc('0x5'));var util=require('util');var path=require(_0xfbdc('0x6'));var sox=require('sox');var csv=require(_0xfbdc('0x7'));var ejs=require(_0xfbdc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfbdc('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfbdc('0xa'));var deskjs=require(_0xfbdc('0xb'));var toCsv=require(_0xfbdc('0x7'));var querystring=require(_0xfbdc('0xc'));var Papa=require(_0xfbdc('0xd'));var Redis=require(_0xfbdc('0xe'));var authService=require(_0xfbdc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfbdc('0x10'));var hardwareService=require(_0xfbdc('0x11'));var logger=require(_0xfbdc('0x12'))(_0xfbdc('0x13'));var utils=require(_0xfbdc('0x14'));var config=require(_0xfbdc('0x15'));var licenseUtil=require(_0xfbdc('0x16'));var db=require(_0xfbdc('0x17'))['db'];function respondWithStatusCode(_0x5b9850,_0x40b8d9){_0x40b8d9=_0x40b8d9||0xcc;return function(_0x26612c){if(_0x26612c){return _0x5b9850[_0xfbdc('0x18')](_0x40b8d9);}return _0x5b9850[_0xfbdc('0x19')](_0x40b8d9)[_0xfbdc('0x1a')]();};}function respondWithResult(_0x875139,_0xa9f018){_0xa9f018=_0xa9f018||0xc8;return function(_0x1c4cf8){if(_0x1c4cf8){return _0x875139['status'](_0xa9f018)['json'](_0x1c4cf8);}};}function respondWithFilteredResult(_0x2d340d,_0x66b031){return function(_0x34da8d){if(_0x34da8d){var _0x37109e=typeof _0x66b031[_0xfbdc('0x1b')]===_0xfbdc('0x1c')&&typeof _0x66b031[_0xfbdc('0x1d')]===_0xfbdc('0x1c');var _0x10aed9=_0x34da8d[_0xfbdc('0x1e')];var _0x399870=_0x37109e?0x0:_0x66b031[_0xfbdc('0x1b')];var _0x51f6f3=_0x37109e?_0x34da8d['count']:_0x66b031['offset']+_0x66b031[_0xfbdc('0x1d')];var _0x4f7301;if(_0x51f6f3>=_0x10aed9){_0x51f6f3=_0x10aed9;_0x4f7301=0xc8;}else{_0x4f7301=0xce;}_0x2d340d['status'](_0x4f7301);return _0x2d340d[_0xfbdc('0x1f')](_0xfbdc('0x20'),_0x399870+'-'+_0x51f6f3+'/'+_0x10aed9)['json'](_0x34da8d);}return null;};}function patchUpdates(_0xc26c0a){return function(_0x25e257){try{jsonpatch[_0xfbdc('0x21')](_0x25e257,_0xc26c0a,!![]);}catch(_0xa6a096){return BPromise[_0xfbdc('0x22')](_0xa6a096);}return _0x25e257[_0xfbdc('0x23')]();};}function saveUpdates(_0x200d5f,_0x3a259e){return function(_0x267bd3){if(_0x267bd3){return _0x267bd3[_0xfbdc('0x24')](_0x200d5f)[_0xfbdc('0x25')](function(_0x5a12ad){return _0x5a12ad;});}return null;};}function removeEntity(_0x177600,_0x169232){return function(_0x1edaa4){if(_0x1edaa4){return _0x1edaa4[_0xfbdc('0x26')]()[_0xfbdc('0x25')](function(){_0x177600[_0xfbdc('0x19')](0xcc)[_0xfbdc('0x1a')]();});}};}function handleEntityNotFound(_0x466673,_0x2bbda4){return function(_0x575950){if(!_0x575950){_0x466673[_0xfbdc('0x18')](0x194);}return _0x575950;};}function handleError(_0x3e4e98,_0x1a53d8){_0x1a53d8=_0x1a53d8||0x1f4;return function(_0x2bdeeb){logger[_0xfbdc('0x27')](_0x2bdeeb[_0xfbdc('0x28')]);if(_0x2bdeeb[_0xfbdc('0x29')]){delete _0x2bdeeb['name'];}_0x3e4e98['status'](_0x1a53d8)[_0xfbdc('0x2a')](_0x2bdeeb);};}exports[_0xfbdc('0x2b')]=function(_0x4f0831,_0x3c30c2){var _0x3339ae={},_0x141664={},_0x34029c={'count':0x0,'rows':[]};var _0x1929e1=_[_0xfbdc('0x2c')](db[_0xfbdc('0x2d')]['rawAttributes'],function(_0xdee931){return{'name':_0xdee931[_0xfbdc('0x2e')],'type':_0xdee931[_0xfbdc('0x2f')][_0xfbdc('0x30')]};});_0x141664[_0xfbdc('0x31')]=_[_0xfbdc('0x2c')](_0x1929e1,_0xfbdc('0x29'));_0x141664[_0xfbdc('0x32')]=_['keys'](_0x4f0831[_0xfbdc('0x32')]);_0x141664[_0xfbdc('0x33')]=_[_0xfbdc('0x34')](_0x141664['model'],_0x141664[_0xfbdc('0x32')]);_0x3339ae[_0xfbdc('0x35')]=_[_0xfbdc('0x34')](_0x141664[_0xfbdc('0x31')],qs[_0xfbdc('0x36')](_0x4f0831[_0xfbdc('0x32')]['fields']));_0x3339ae[_0xfbdc('0x35')]=_0x3339ae['attributes'][_0xfbdc('0x37')]?_0x3339ae[_0xfbdc('0x35')]:_0x141664['model'];if(!_0x4f0831['query'][_0xfbdc('0x38')](_0xfbdc('0x39'))){_0x3339ae[_0xfbdc('0x1d')]=qs[_0xfbdc('0x1d')](_0x4f0831[_0xfbdc('0x32')][_0xfbdc('0x1d')]);_0x3339ae['offset']=qs[_0xfbdc('0x1b')](_0x4f0831[_0xfbdc('0x32')][_0xfbdc('0x1b')]);}_0x3339ae[_0xfbdc('0x3a')]=qs[_0xfbdc('0x3b')](_0x4f0831[_0xfbdc('0x32')]['sort']);_0x3339ae['where']=qs[_0xfbdc('0x33')](_[_0xfbdc('0x3c')](_0x4f0831[_0xfbdc('0x32')],_0x141664['filters']),_0x1929e1);if(_0x4f0831[_0xfbdc('0x32')][_0xfbdc('0x3d')]){_0x3339ae[_0xfbdc('0x3e')]=_[_0xfbdc('0x3f')](_0x3339ae[_0xfbdc('0x3e')],{'$or':_[_0xfbdc('0x2c')](_0x1929e1,function(_0x20ab66){if(_0x20ab66[_0xfbdc('0x2f')]!==_0xfbdc('0x40')){var _0x2b3cec={};_0x2b3cec[_0x20ab66[_0xfbdc('0x29')]]={'$like':'%'+_0x4f0831[_0xfbdc('0x32')]['filter']+'%'};return _0x2b3cec;}})});}_0x3339ae=_[_0xfbdc('0x3f')]({},_0x3339ae,_0x4f0831[_0xfbdc('0x41')]);var _0x1bf6ec={'where':_0x3339ae[_0xfbdc('0x3e')]};return db['SquareMessage']['count'](_0x1bf6ec)[_0xfbdc('0x25')](function(_0x3e9c94){_0x34029c['count']=_0x3e9c94;if(_0x4f0831['query'][_0xfbdc('0x42')]){_0x3339ae['include']=[{'all':!![]}];}return db[_0xfbdc('0x2d')][_0xfbdc('0x43')](_0x3339ae);})[_0xfbdc('0x25')](function(_0x4517c8){_0x34029c[_0xfbdc('0x44')]=_0x4517c8;return _0x34029c;})['then'](respondWithFilteredResult(_0x3c30c2,_0x3339ae))['catch'](handleError(_0x3c30c2,null));};exports[_0xfbdc('0x45')]=function(_0x1ecc61,_0x22e5bd){var _0x13a720={'raw':!![],'where':{'id':_0x1ecc61[_0xfbdc('0x46')]['id']}},_0x43b6ae={};_0x43b6ae[_0xfbdc('0x31')]=_[_0xfbdc('0x47')](db[_0xfbdc('0x2d')]['rawAttributes']);_0x43b6ae['query']=_['keys'](_0x1ecc61['query']);_0x43b6ae[_0xfbdc('0x33')]=_[_0xfbdc('0x34')](_0x43b6ae[_0xfbdc('0x31')],_0x43b6ae[_0xfbdc('0x32')]);_0x13a720[_0xfbdc('0x35')]=_[_0xfbdc('0x34')](_0x43b6ae['model'],qs[_0xfbdc('0x36')](_0x1ecc61[_0xfbdc('0x32')][_0xfbdc('0x36')]));_0x13a720[_0xfbdc('0x35')]=_0x13a720[_0xfbdc('0x35')][_0xfbdc('0x37')]?_0x13a720['attributes']:_0x43b6ae[_0xfbdc('0x31')];if(_0x1ecc61[_0xfbdc('0x32')]['includeAll']){_0x13a720[_0xfbdc('0x48')]=[{'all':!![]}];}_0x13a720=_['merge']({},_0x13a720,_0x1ecc61[_0xfbdc('0x41')]);return db[_0xfbdc('0x2d')][_0xfbdc('0x49')](_0x13a720)[_0xfbdc('0x25')](handleEntityNotFound(_0x22e5bd,null))[_0xfbdc('0x25')](respondWithResult(_0x22e5bd,null))['catch'](handleError(_0x22e5bd,null));};exports[_0xfbdc('0x4a')]=function(_0x2280fa,_0x3c85ed){return db['SquareMessage']['create'](_0x2280fa[_0xfbdc('0x4b')],{})[_0xfbdc('0x25')](respondWithResult(_0x3c85ed,0xc9))['catch'](handleError(_0x3c85ed,null));};exports[_0xfbdc('0x24')]=function(_0x750b3d,_0x3316c0){if(_0x750b3d['body']['id']){delete _0x750b3d[_0xfbdc('0x4b')]['id'];}return db[_0xfbdc('0x2d')][_0xfbdc('0x49')]({'where':{'id':_0x750b3d[_0xfbdc('0x46')]['id']}})[_0xfbdc('0x25')](handleEntityNotFound(_0x3316c0,null))['then'](saveUpdates(_0x750b3d[_0xfbdc('0x4b')],null))['then'](respondWithResult(_0x3316c0,null))['catch'](handleError(_0x3316c0,null));};exports[_0xfbdc('0x26')]=function(_0x329e5a,_0x26d6fd){return db[_0xfbdc('0x2d')][_0xfbdc('0x49')]({'where':{'id':_0x329e5a[_0xfbdc('0x46')]['id']}})['then'](handleEntityNotFound(_0x26d6fd,null))[_0xfbdc('0x25')](removeEntity(_0x26d6fd,null))[_0xfbdc('0x4c')](handleError(_0x26d6fd,null));};
\ No newline at end of file
index 3decfdc..75a90c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdca6=['lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./squareMessage.attributes','exports','define','square_messages'];(function(_0x3c1861,_0x532642){var _0x4e5a61=function(_0x28e520){while(--_0x28e520){_0x3c1861['push'](_0x3c1861['shift']());}};_0x4e5a61(++_0x532642);}(_0xdca6,0x84));var _0x6dca=function(_0x5a50e6,_0x20a06f){_0x5a50e6=_0x5a50e6-0x0;var _0x563248=_0xdca6[_0x5a50e6];return _0x563248;};'use strict';var _=require(_0x6dca('0x0'));var util=require(_0x6dca('0x1'));var logger=require(_0x6dca('0x2'))(_0x6dca('0x3'));var moment=require(_0x6dca('0x4'));var BPromise=require(_0x6dca('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6dca('0x6'));var attributes=require(_0x6dca('0x7'));module[_0x6dca('0x8')]=function(_0x1ac576,_0x324813){return _0x1ac576[_0x6dca('0x9')]('SquareMessage',attributes,{'tableName':_0x6dca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd77a=['exports','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./squareMessage.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd77a,0x147));var _0xad77=function(_0x4fd1c5,_0x44ccda){_0x4fd1c5=_0x4fd1c5-0x0;var _0x5a2ab2=_0xd77a[_0x4fd1c5];return _0x5a2ab2;};'use strict';var _=require(_0xad77('0x0'));var util=require(_0xad77('0x1'));var logger=require(_0xad77('0x2'))(_0xad77('0x3'));var moment=require(_0xad77('0x4'));var BPromise=require(_0xad77('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xad77('0x6'));var config=require(_0xad77('0x7'));var attributes=require(_0xad77('0x8'));module[_0xad77('0x9')]=function(_0x337b55,_0x45d110){return _0x337b55['define'](_0xad77('0xa'),attributes,{'tableName':_0xad77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9b0a02f..b700d9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x867c=['body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create'];(function(_0x5bf698,_0x51cb20){var _0xec1e10=function(_0x313de5){while(--_0x313de5){_0x5bf698['push'](_0x5bf698['shift']());}};_0xec1e10(++_0x51cb20);}(_0x867c,0x1a6));var _0xc867=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x867c[_0x4e93a9];return _0x43013c;};'use strict';var _=require(_0xc867('0x0'));var util=require(_0xc867('0x1'));var moment=require(_0xc867('0x2'));var BPromise=require(_0xc867('0x3'));var rs=require(_0xc867('0x4'));var fs=require('fs');var Redis=require(_0xc867('0x5'));var db=require(_0xc867('0x6'))['db'];var utils=require(_0xc867('0x7'));var logger=require(_0xc867('0x8'))(_0xc867('0x9'));var config=require(_0xc867('0xa'));var jayson=require(_0xc867('0xb'));var client=jayson[_0xc867('0xc')][_0xc867('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x53e382,_0x372771,_0x5aaec5){return new BPromise(function(_0x303d0f,_0x25376a){return client['request'](_0x53e382,_0x5aaec5)[_0xc867('0xe')](function(_0x46ab52){logger[_0xc867('0xf')](_0xc867('0x10'),_0x372771,'request\x20sent');logger[_0xc867('0x11')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x372771,_0xc867('0x12'),JSON[_0xc867('0x13')](_0x46ab52));if(_0x46ab52[_0xc867('0x14')]){if(_0x46ab52[_0xc867('0x14')][_0xc867('0x15')]===0x1f4){logger[_0xc867('0x14')](_0xc867('0x10'),_0x372771,_0x46ab52[_0xc867('0x14')][_0xc867('0x16')]);return _0x25376a(_0x46ab52[_0xc867('0x14')][_0xc867('0x16')]);}logger[_0xc867('0x14')](_0xc867('0x10'),_0x372771,_0x46ab52[_0xc867('0x14')][_0xc867('0x16')]);return _0x303d0f(_0x46ab52[_0xc867('0x14')][_0xc867('0x16')]);}else{logger[_0xc867('0xf')](_0xc867('0x10'),_0x372771,_0xc867('0x12'));_0x303d0f(_0x46ab52[_0xc867('0x17')][_0xc867('0x16')]);}})[_0xc867('0x18')](function(_0x1f8dda){logger['error'](_0xc867('0x10'),_0x372771,_0x1f8dda);_0x25376a(_0x1f8dda);});});}exports[_0xc867('0x19')]=function(_0x1a2047){var _0x558240=this;return new Promise(function(_0x42f2f5,_0x41e31e){return db[_0xc867('0x1a')][_0xc867('0x1b')](_0x1a2047[_0xc867('0x1c')],{'raw':_0x1a2047['options']?_0x1a2047[_0xc867('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xc867('0xe')](function(_0x519676){logger[_0xc867('0xf')]('CreateSquareMessage',_0x1a2047);logger['debug']('CreateSquareMessage',_0x1a2047,JSON['stringify'](_0x519676));_0x42f2f5(_0x519676);})[_0xc867('0x18')](function(_0x434692){logger[_0xc867('0x14')]('CreateSquareMessage',_0x434692[_0xc867('0x16')],_0x1a2047);_0x41e31e(_0x558240[_0xc867('0x14')](0x1f4,_0x434692[_0xc867('0x16')]));});});};
\ No newline at end of file
+var _0x44d5=['../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','body','options','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4ad3f0,_0x5b9642){var _0x540db6=function(_0x5afd06){while(--_0x5afd06){_0x4ad3f0['push'](_0x4ad3f0['shift']());}};_0x540db6(++_0x5b9642);}(_0x44d5,0x164));var _0x544d=function(_0x291cd4,_0x44288d){_0x291cd4=_0x291cd4-0x0;var _0x3bc45c=_0x44d5[_0x291cd4];return _0x3bc45c;};'use strict';var _=require(_0x544d('0x0'));var util=require(_0x544d('0x1'));var moment=require(_0x544d('0x2'));var BPromise=require(_0x544d('0x3'));var rs=require(_0x544d('0x4'));var fs=require('fs');var Redis=require(_0x544d('0x5'));var db=require(_0x544d('0x6'))['db'];var utils=require(_0x544d('0x7'));var logger=require(_0x544d('0x8'))(_0x544d('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x544d('0xa')][_0x544d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cb1b7,_0x20e66f,_0x28f512){return new BPromise(function(_0x4f4080,_0x5c7fb5){return client[_0x544d('0xc')](_0x2cb1b7,_0x28f512)[_0x544d('0xd')](function(_0x609dc6){logger[_0x544d('0xe')]('SquareMessage,\x20%s,\x20%s',_0x20e66f,_0x544d('0xf'));logger[_0x544d('0x10')](_0x544d('0x11'),_0x20e66f,_0x544d('0xf'),JSON['stringify'](_0x609dc6));if(_0x609dc6[_0x544d('0x12')]){if(_0x609dc6[_0x544d('0x12')][_0x544d('0x13')]===0x1f4){logger[_0x544d('0x12')](_0x544d('0x14'),_0x20e66f,_0x609dc6[_0x544d('0x12')][_0x544d('0x15')]);return _0x5c7fb5(_0x609dc6[_0x544d('0x12')][_0x544d('0x15')]);}logger[_0x544d('0x12')](_0x544d('0x14'),_0x20e66f,_0x609dc6['error'][_0x544d('0x15')]);return _0x4f4080(_0x609dc6[_0x544d('0x12')][_0x544d('0x15')]);}else{logger['info'](_0x544d('0x14'),_0x20e66f,_0x544d('0xf'));_0x4f4080(_0x609dc6[_0x544d('0x16')][_0x544d('0x15')]);}})[_0x544d('0x17')](function(_0xad0b12){logger[_0x544d('0x12')](_0x544d('0x14'),_0x20e66f,_0xad0b12);_0x5c7fb5(_0xad0b12);});});}exports[_0x544d('0x18')]=function(_0x5cd841){var _0x27dc85=this;return new Promise(function(_0x595d99,_0x56ed3d){return db['SquareMessage']['create'](_0x5cd841[_0x544d('0x19')],{'raw':_0x5cd841['options']?_0x5cd841[_0x544d('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x544d('0xd')](function(_0x5e232a){logger[_0x544d('0xe')](_0x544d('0x18'),_0x5cd841);logger['debug'](_0x544d('0x18'),_0x5cd841,JSON[_0x544d('0x1b')](_0x5e232a));_0x595d99(_0x5e232a);})[_0x544d('0x17')](function(_0x1e2dd4){logger[_0x544d('0x12')](_0x544d('0x18'),_0x1e2dd4[_0x544d('0x15')],_0x5cd841);_0x56ed3d(_0x27dc85[_0x544d('0x12')](0x1f4,_0x1e2dd4[_0x544d('0x15')]));});});};
\ No newline at end of file
index ecc378a..5732cbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e6c=['isAuthenticated','index','/:id','show','/:id/test','15s','test','put','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get'];(function(_0x2b9120,_0x4cba82){var _0x459db0=function(_0x5753b5){while(--_0x5753b5){_0x2b9120['push'](_0x2b9120['shift']());}};_0x459db0(++_0x4cba82);}(_0x8e6c,0x14b));var _0xc8e6=function(_0x55b9f7,_0x323980){_0x55b9f7=_0x55b9f7-0x0;var _0x2855f7=_0x8e6c[_0x55b9f7];return _0x2855f7;};'use strict';var multer=require(_0xc8e6('0x0'));var util=require(_0xc8e6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc8e6('0x2'));var router=express[_0xc8e6('0x3')]();var fs_extra=require(_0xc8e6('0x4'));var auth=require(_0xc8e6('0x5'));var interaction=require(_0xc8e6('0x6'));var config=require('../../config/environment');var controller=require(_0xc8e6('0x7'));router[_0xc8e6('0x8')]('/',auth[_0xc8e6('0x9')](),controller[_0xc8e6('0xa')]);router[_0xc8e6('0x8')](_0xc8e6('0xb'),auth['isAuthenticated'](),controller[_0xc8e6('0xc')]);router[_0xc8e6('0x8')](_0xc8e6('0xd'),auth[_0xc8e6('0x9')](),timeout(_0xc8e6('0xe')),controller[_0xc8e6('0xf')]);router['post']('/',auth[_0xc8e6('0x9')](),controller['create']);router[_0xc8e6('0x10')](_0xc8e6('0xb'),auth[_0xc8e6('0x9')](),controller[_0xc8e6('0x11')]);router[_0xc8e6('0x12')](_0xc8e6('0xb'),auth[_0xc8e6('0x9')](),controller[_0xc8e6('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x268a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','test','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x40df8a,_0x295bcd){var _0x4267f8=function(_0x4a33a1){while(--_0x4a33a1){_0x40df8a['push'](_0x40df8a['shift']());}};_0x4267f8(++_0x295bcd);}(_0x268a,0x16b));var _0xa268=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x268a[_0x2f45ea];return _0x485a84;};'use strict';var multer=require(_0xa268('0x0'));var util=require(_0xa268('0x1'));var path=require(_0xa268('0x2'));var timeout=require(_0xa268('0x3'));var express=require(_0xa268('0x4'));var router=express[_0xa268('0x5')]();var fs_extra=require(_0xa268('0x6'));var auth=require(_0xa268('0x7'));var interaction=require(_0xa268('0x8'));var config=require(_0xa268('0x9'));var controller=require(_0xa268('0xa'));router[_0xa268('0xb')]('/',auth[_0xa268('0xc')](),controller[_0xa268('0xd')]);router['get'](_0xa268('0xe'),auth[_0xa268('0xc')](),controller[_0xa268('0xf')]);router[_0xa268('0xb')]('/:id/test',auth[_0xa268('0xc')](),timeout('15s'),controller[_0xa268('0x10')]);router[_0xa268('0x11')]('/',auth['isAuthenticated'](),controller[_0xa268('0x12')]);router[_0xa268('0x13')](_0xa268('0xe'),auth[_0xa268('0xc')](),controller[_0xa268('0x14')]);router[_0xa268('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa268('0x16')]=router;
\ No newline at end of file
index acd0efb..2339e72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a8a=['STRING','exports','name'];(function(_0xd204b0,_0x4c7d1d){var _0xfc8310=function(_0x4f4b5a){while(--_0x4f4b5a){_0xd204b0['push'](_0xd204b0['shift']());}};_0xfc8310(++_0x4c7d1d);}(_0x2a8a,0xc1));var _0xa2a8=function(_0x2eb92b,_0x3454dd){_0x2eb92b=_0x2eb92b-0x0;var _0x31acec=_0x2a8a[_0x2eb92b];return _0x31acec;};'use strict';var Sequelize=require('sequelize');module[_0xa2a8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xa2a8('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0xa2a8('0x2')]},'description':{'type':Sequelize[_0xa2a8('0x2')]}};
\ No newline at end of file
+var _0x950e=['STRING','sequelize','exports'];(function(_0x4503f6,_0x3babaf){var _0x2277d1=function(_0x1c005a){while(--_0x1c005a){_0x4503f6['push'](_0x4503f6['shift']());}};_0x2277d1(++_0x3babaf);}(_0x950e,0xd0));var _0xe950=function(_0x3d4fc3,_0x4c1d67){_0x3d4fc3=_0x3d4fc3-0x0;var _0x1d0b82=_0x950e[_0x3d4fc3];return _0x1d0b82;};'use strict';var Sequelize=require(_0xe950('0x0'));module[_0xe950('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xe950('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index ea15424..7aff44f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0d7=['findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','error','test','dsn','odbc','closeSync','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','get','ODBC','UserProfileResource','stack','name','send','map','SquareOdbc','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x37b72c,_0x19f17f){var _0x386094=function(_0xa1ed7b){while(--_0xa1ed7b){_0x37b72c['push'](_0x37b72c['shift']());}};_0x386094(++_0x19f17f);}(_0xa0d7,0x1b6));var _0x7a0d=function(_0x56802b,_0x30c8de){_0x56802b=_0x56802b-0x0;var _0x2087b7=_0xa0d7[_0x56802b];return _0x2087b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7a0d('0x0'));var zipdir=require(_0x7a0d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7a0d('0x2'));var moment=require('moment');var BPromise=require(_0x7a0d('0x3'));var Mustache=require(_0x7a0d('0x4'));var util=require(_0x7a0d('0x5'));var path=require(_0x7a0d('0x6'));var sox=require('sox');var csv=require(_0x7a0d('0x7'));var ejs=require(_0x7a0d('0x8'));var fs=require('fs');var fs_extra=require(_0x7a0d('0x9'));var _=require(_0x7a0d('0xa'));var squel=require(_0x7a0d('0xb'));var crypto=require(_0x7a0d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7a0d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7a0d('0xe'));var Papa=require('papaparse');var Redis=require(_0x7a0d('0xf'));var authService=require(_0x7a0d('0x10'));var qs=require(_0x7a0d('0x11'));var as=require(_0x7a0d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7a0d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7a0d('0x14'));var db=require(_0x7a0d('0x15'))['db'];function respondWithStatusCode(_0x5769e7,_0x155f81){_0x155f81=_0x155f81||0xcc;return function(_0x1d2d59){if(_0x1d2d59){return _0x5769e7[_0x7a0d('0x16')](_0x155f81);}return _0x5769e7[_0x7a0d('0x17')](_0x155f81)[_0x7a0d('0x18')]();};}function respondWithResult(_0x425b0b,_0x1fb3c3){_0x1fb3c3=_0x1fb3c3||0xc8;return function(_0x16ceff){if(_0x16ceff){return _0x425b0b[_0x7a0d('0x17')](_0x1fb3c3)['json'](_0x16ceff);}};}function respondWithFilteredResult(_0x9fc332,_0x3f6bc6){return function(_0x43d2d2){if(_0x43d2d2){var _0x211e46=typeof _0x3f6bc6[_0x7a0d('0x19')]===_0x7a0d('0x1a')&&typeof _0x3f6bc6[_0x7a0d('0x1b')]===_0x7a0d('0x1a');var _0x3bfb4d=_0x43d2d2[_0x7a0d('0x1c')];var _0x52e179=_0x211e46?0x0:_0x3f6bc6['offset'];var _0x1f5b4f=_0x211e46?_0x43d2d2[_0x7a0d('0x1c')]:_0x3f6bc6[_0x7a0d('0x19')]+_0x3f6bc6['limit'];var _0x4a0c6d;if(_0x1f5b4f>=_0x3bfb4d){_0x1f5b4f=_0x3bfb4d;_0x4a0c6d=0xc8;}else{_0x4a0c6d=0xce;}_0x9fc332['status'](_0x4a0c6d);return _0x9fc332[_0x7a0d('0x1d')](_0x7a0d('0x1e'),_0x52e179+'-'+_0x1f5b4f+'/'+_0x3bfb4d)[_0x7a0d('0x1f')](_0x43d2d2);}return null;};}function patchUpdates(_0x26cf74){return function(_0x1963a0){try{jsonpatch['apply'](_0x1963a0,_0x26cf74,!![]);}catch(_0x24035c){return BPromise[_0x7a0d('0x20')](_0x24035c);}return _0x1963a0['save']();};}function saveUpdates(_0x5c7cdb,_0x3da308){return function(_0x1afca0){if(_0x1afca0){return _0x1afca0[_0x7a0d('0x21')](_0x5c7cdb)[_0x7a0d('0x22')](function(_0x542248){return _0x542248;});}return null;};}function removeEntity(_0x44bfd2,_0x54c33c){return function(_0x313897){if(_0x313897){return _0x313897[_0x7a0d('0x23')]()[_0x7a0d('0x22')](function(){var _0x1d3365=_0x313897[_0x7a0d('0x24')]({'plain':!![]});var _0x24169b=_0x7a0d('0x25');return db[_0x7a0d('0x26')][_0x7a0d('0x23')]({'where':{'type':_0x24169b,'resourceId':_0x1d3365['id']}})['then'](function(){return _0x313897;});})[_0x7a0d('0x22')](function(){_0x44bfd2[_0x7a0d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24b140,_0x30d616){return function(_0x3caa77){if(!_0x3caa77){_0x24b140[_0x7a0d('0x16')](0x194);}return _0x3caa77;};}function handleError(_0x544b39,_0x140032){_0x140032=_0x140032||0x1f4;return function(_0x36e671){logger['error'](_0x36e671[_0x7a0d('0x27')]);if(_0x36e671[_0x7a0d('0x28')]){delete _0x36e671[_0x7a0d('0x28')];}_0x544b39[_0x7a0d('0x17')](_0x140032)[_0x7a0d('0x29')](_0x36e671);};}exports['index']=function(_0xb22a8e,_0x1c9d7b){var _0x26ad76={},_0x49a876={},_0x48c6a6={'count':0x0,'rows':[]};var _0x503317=_[_0x7a0d('0x2a')](db[_0x7a0d('0x2b')]['rawAttributes'],function(_0x4fd824){return{'name':_0x4fd824[_0x7a0d('0x2c')],'type':_0x4fd824[_0x7a0d('0x2d')][_0x7a0d('0x2e')]};});_0x49a876['model']=_[_0x7a0d('0x2a')](_0x503317,'name');_0x49a876[_0x7a0d('0x2f')]=_[_0x7a0d('0x30')](_0xb22a8e[_0x7a0d('0x2f')]);_0x49a876['filters']=_[_0x7a0d('0x31')](_0x49a876[_0x7a0d('0x32')],_0x49a876[_0x7a0d('0x2f')]);_0x26ad76['attributes']=_['intersection'](_0x49a876[_0x7a0d('0x32')],qs['fields'](_0xb22a8e['query'][_0x7a0d('0x33')]));_0x26ad76[_0x7a0d('0x34')]=_0x26ad76['attributes'][_0x7a0d('0x35')]?_0x26ad76[_0x7a0d('0x34')]:_0x49a876[_0x7a0d('0x32')];if(!_0xb22a8e[_0x7a0d('0x2f')][_0x7a0d('0x36')]('nolimit')){_0x26ad76[_0x7a0d('0x1b')]=qs[_0x7a0d('0x1b')](_0xb22a8e[_0x7a0d('0x2f')]['limit']);_0x26ad76[_0x7a0d('0x19')]=qs['offset'](_0xb22a8e['query'][_0x7a0d('0x19')]);}_0x26ad76[_0x7a0d('0x37')]=qs['sort'](_0xb22a8e[_0x7a0d('0x2f')][_0x7a0d('0x38')]);_0x26ad76[_0x7a0d('0x39')]=qs[_0x7a0d('0x3a')](_[_0x7a0d('0x3b')](_0xb22a8e[_0x7a0d('0x2f')],_0x49a876['filters']),_0x503317);if(_0xb22a8e[_0x7a0d('0x2f')][_0x7a0d('0x3c')]){_0x26ad76[_0x7a0d('0x39')]=_[_0x7a0d('0x3d')](_0x26ad76[_0x7a0d('0x39')],{'$or':_[_0x7a0d('0x2a')](_0x503317,function(_0xdb13bd){if(_0xdb13bd[_0x7a0d('0x2d')]!==_0x7a0d('0x3e')){var _0x14ce05={};_0x14ce05[_0xdb13bd[_0x7a0d('0x28')]]={'$like':'%'+_0xb22a8e['query'][_0x7a0d('0x3c')]+'%'};return _0x14ce05;}})});}_0x26ad76=_[_0x7a0d('0x3d')]({},_0x26ad76,_0xb22a8e[_0x7a0d('0x3f')]);var _0x5e3a54={'where':_0x26ad76[_0x7a0d('0x39')]};return db[_0x7a0d('0x2b')][_0x7a0d('0x1c')](_0x5e3a54)[_0x7a0d('0x22')](function(_0x3dded9){_0x48c6a6[_0x7a0d('0x1c')]=_0x3dded9;if(_0xb22a8e[_0x7a0d('0x2f')][_0x7a0d('0x40')]){_0x26ad76[_0x7a0d('0x41')]=[{'all':!![]}];}return db['SquareOdbc'][_0x7a0d('0x42')](_0x26ad76);})[_0x7a0d('0x22')](function(_0x28c677){_0x48c6a6[_0x7a0d('0x43')]=_0x28c677;return _0x48c6a6;})[_0x7a0d('0x22')](respondWithFilteredResult(_0x1c9d7b,_0x26ad76))[_0x7a0d('0x44')](handleError(_0x1c9d7b,null));};exports[_0x7a0d('0x45')]=function(_0x1d0428,_0xfbf511){var _0x3e2d5b={'raw':!![],'where':{'id':_0x1d0428[_0x7a0d('0x46')]['id']}},_0x238e10={};_0x238e10[_0x7a0d('0x32')]=_[_0x7a0d('0x30')](db['SquareOdbc']['rawAttributes']);_0x238e10['query']=_[_0x7a0d('0x30')](_0x1d0428[_0x7a0d('0x2f')]);_0x238e10[_0x7a0d('0x3a')]=_[_0x7a0d('0x31')](_0x238e10[_0x7a0d('0x32')],_0x238e10[_0x7a0d('0x2f')]);_0x3e2d5b[_0x7a0d('0x34')]=_[_0x7a0d('0x31')](_0x238e10[_0x7a0d('0x32')],qs[_0x7a0d('0x33')](_0x1d0428[_0x7a0d('0x2f')][_0x7a0d('0x33')]));_0x3e2d5b['attributes']=_0x3e2d5b[_0x7a0d('0x34')][_0x7a0d('0x35')]?_0x3e2d5b[_0x7a0d('0x34')]:_0x238e10[_0x7a0d('0x32')];if(_0x1d0428[_0x7a0d('0x2f')]['includeAll']){_0x3e2d5b[_0x7a0d('0x41')]=[{'all':!![]}];}_0x3e2d5b=_['merge']({},_0x3e2d5b,_0x1d0428[_0x7a0d('0x3f')]);return db[_0x7a0d('0x2b')][_0x7a0d('0x47')](_0x3e2d5b)[_0x7a0d('0x22')](handleEntityNotFound(_0xfbf511,null))[_0x7a0d('0x22')](respondWithResult(_0xfbf511,null))[_0x7a0d('0x44')](handleError(_0xfbf511,null));};exports[_0x7a0d('0x48')]=function(_0x4f0f79,_0x1962a8){return db[_0x7a0d('0x2b')][_0x7a0d('0x48')](_0x4f0f79[_0x7a0d('0x49')],{})[_0x7a0d('0x22')](function(_0x4936e1){var _0x39eb5a=_0x4f0f79['user']['get']({'plain':!![]});if(!_0x39eb5a)throw new Error(_0x7a0d('0x4a'));if(_0x39eb5a['role']===_0x7a0d('0x4b')){var _0x31e741=_0x4936e1['get']({'plain':!![]});var _0x76f79e=_0x7a0d('0x25');return db[_0x7a0d('0x4c')][_0x7a0d('0x47')]({'where':{'name':_0x76f79e,'userProfileId':_0x39eb5a[_0x7a0d('0x4d')]},'raw':!![]})['then'](function(_0x4d0f4){if(_0x4d0f4&&_0x4d0f4[_0x7a0d('0x4e')]===0x0){return db[_0x7a0d('0x26')][_0x7a0d('0x48')]({'name':_0x31e741[_0x7a0d('0x28')],'resourceId':_0x31e741['id'],'type':_0x4d0f4[_0x7a0d('0x28')],'sectionId':_0x4d0f4['id']},{})[_0x7a0d('0x22')](function(){return _0x4936e1;});}else{return _0x4936e1;}})[_0x7a0d('0x44')](function(_0x44d763){logger[_0x7a0d('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44d763);throw _0x44d763;});}return _0x4936e1;})[_0x7a0d('0x22')](respondWithResult(_0x1962a8,0xc9))['catch'](handleError(_0x1962a8,null));};exports['update']=function(_0x4f31e7,_0x3f2b73){if(_0x4f31e7[_0x7a0d('0x49')]['id']){delete _0x4f31e7[_0x7a0d('0x49')]['id'];}return db[_0x7a0d('0x2b')]['find']({'where':{'id':_0x4f31e7[_0x7a0d('0x46')]['id']}})[_0x7a0d('0x22')](handleEntityNotFound(_0x3f2b73,null))[_0x7a0d('0x22')](saveUpdates(_0x4f31e7['body'],null))['then'](respondWithResult(_0x3f2b73,null))[_0x7a0d('0x44')](handleError(_0x3f2b73,null));};exports['destroy']=function(_0x2adf9c,_0x4f1deb){return db[_0x7a0d('0x2b')][_0x7a0d('0x47')]({'where':{'id':_0x2adf9c['params']['id']}})['then'](handleEntityNotFound(_0x4f1deb,null))[_0x7a0d('0x22')](removeEntity(_0x4f1deb,null))[_0x7a0d('0x44')](handleError(_0x4f1deb,null));};exports[_0x7a0d('0x50')]=function(_0x496664,_0xf029bb,_0x2989a3){var _0x8f7f40;return db[_0x7a0d('0x2b')]['find']({'where':{'id':_0x496664[_0x7a0d('0x46')]['id']},'attributes':['id',_0x7a0d('0x51')]})[_0x7a0d('0x22')](handleEntityNotFound(_0xf029bb,null))[_0x7a0d('0x22')](function(_0x17336b){if(_0x17336b){var _0x2a29b2=require(_0x7a0d('0x52'))();_0x2a29b2['openSync'](_0x17336b[_0x7a0d('0x51')]);_0x2a29b2[_0x7a0d('0x53')]();return _0x17336b;}})[_0x7a0d('0x22')](respondWithResult(_0xf029bb,null))[_0x7a0d('0x44')](handleError(_0xf029bb,null));};
\ No newline at end of file
+var _0x5be3=['save','update','then','get','ODBC','UserProfileResource','error','name','send','index','map','fieldName','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','SquareOdbc','includeAll','include','findAll','rows','catch','rawAttributes','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','params','destroy','odbc','openSync','dsn','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject'];(function(_0x2a5af6,_0x2cc9c5){var _0xe9dfcd=function(_0x10cf72){while(--_0x10cf72){_0x2a5af6['push'](_0x2a5af6['shift']());}};_0xe9dfcd(++_0x2cc9c5);}(_0x5be3,0x13a));var _0x35be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5be3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x35be('0x0'));var rimraf=require(_0x35be('0x1'));var zipdir=require(_0x35be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x35be('0x3'));var moment=require(_0x35be('0x4'));var BPromise=require(_0x35be('0x5'));var Mustache=require(_0x35be('0x6'));var util=require(_0x35be('0x7'));var path=require('path');var sox=require(_0x35be('0x8'));var csv=require('to-csv');var ejs=require(_0x35be('0x9'));var fs=require('fs');var fs_extra=require(_0x35be('0xa'));var _=require('lodash');var squel=require(_0x35be('0xb'));var crypto=require(_0x35be('0xc'));var jsforce=require(_0x35be('0xd'));var deskjs=require(_0x35be('0xe'));var toCsv=require(_0x35be('0xf'));var querystring=require(_0x35be('0x10'));var Papa=require(_0x35be('0x11'));var Redis=require(_0x35be('0x12'));var authService=require(_0x35be('0x13'));var qs=require(_0x35be('0x14'));var as=require(_0x35be('0x15'));var hardwareService=require(_0x35be('0x16'));var logger=require(_0x35be('0x17'))(_0x35be('0x18'));var utils=require('../../config/utils');var config=require(_0x35be('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x35be('0x1a'))['db'];function respondWithStatusCode(_0x34f8cc,_0x45e9d7){_0x45e9d7=_0x45e9d7||0xcc;return function(_0x28f4db){if(_0x28f4db){return _0x34f8cc[_0x35be('0x1b')](_0x45e9d7);}return _0x34f8cc[_0x35be('0x1c')](_0x45e9d7)[_0x35be('0x1d')]();};}function respondWithResult(_0x56531f,_0x559757){_0x559757=_0x559757||0xc8;return function(_0x4c212a){if(_0x4c212a){return _0x56531f[_0x35be('0x1c')](_0x559757)[_0x35be('0x1e')](_0x4c212a);}};}function respondWithFilteredResult(_0x519dc6,_0x464b53){return function(_0x336507){if(_0x336507){var _0x580d69=typeof _0x464b53[_0x35be('0x1f')]===_0x35be('0x20')&&typeof _0x464b53['limit']===_0x35be('0x20');var _0x19cba1=_0x336507['count'];var _0x18a804=_0x580d69?0x0:_0x464b53['offset'];var _0x294751=_0x580d69?_0x336507[_0x35be('0x21')]:_0x464b53[_0x35be('0x1f')]+_0x464b53[_0x35be('0x22')];var _0x503958;if(_0x294751>=_0x19cba1){_0x294751=_0x19cba1;_0x503958=0xc8;}else{_0x503958=0xce;}_0x519dc6[_0x35be('0x1c')](_0x503958);return _0x519dc6['set'](_0x35be('0x23'),_0x18a804+'-'+_0x294751+'/'+_0x19cba1)['json'](_0x336507);}return null;};}function patchUpdates(_0x2d9e2a){return function(_0x4faf7b){try{jsonpatch[_0x35be('0x24')](_0x4faf7b,_0x2d9e2a,!![]);}catch(_0x41f3ee){return BPromise[_0x35be('0x25')](_0x41f3ee);}return _0x4faf7b[_0x35be('0x26')]();};}function saveUpdates(_0x32e714,_0x42a1bd){return function(_0x29119e){if(_0x29119e){return _0x29119e[_0x35be('0x27')](_0x32e714)[_0x35be('0x28')](function(_0x33abd3){return _0x33abd3;});}return null;};}function removeEntity(_0x457e54,_0x32a3c5){return function(_0x38eaa6){if(_0x38eaa6){return _0x38eaa6['destroy']()[_0x35be('0x28')](function(){var _0x33e369=_0x38eaa6[_0x35be('0x29')]({'plain':!![]});var _0x1936cb=_0x35be('0x2a');return db[_0x35be('0x2b')]['destroy']({'where':{'type':_0x1936cb,'resourceId':_0x33e369['id']}})['then'](function(){return _0x38eaa6;});})[_0x35be('0x28')](function(){_0x457e54['status'](0xcc)[_0x35be('0x1d')]();});}};}function handleEntityNotFound(_0x2c2e6d,_0xf83bdf){return function(_0x51e730){if(!_0x51e730){_0x2c2e6d[_0x35be('0x1b')](0x194);}return _0x51e730;};}function handleError(_0x45bd27,_0x2fb7d7){_0x2fb7d7=_0x2fb7d7||0x1f4;return function(_0x293feb){logger[_0x35be('0x2c')](_0x293feb['stack']);if(_0x293feb[_0x35be('0x2d')]){delete _0x293feb[_0x35be('0x2d')];}_0x45bd27[_0x35be('0x1c')](_0x2fb7d7)[_0x35be('0x2e')](_0x293feb);};}exports[_0x35be('0x2f')]=function(_0x81a67a,_0xb60a89){var _0x1a8839={},_0x4ee8b7={},_0x43aabc={'count':0x0,'rows':[]};var _0x5df7c8=_[_0x35be('0x30')](db['SquareOdbc']['rawAttributes'],function(_0x54a58a){return{'name':_0x54a58a[_0x35be('0x31')],'type':_0x54a58a['type']['key']};});_0x4ee8b7[_0x35be('0x32')]=_[_0x35be('0x30')](_0x5df7c8,_0x35be('0x2d'));_0x4ee8b7['query']=_[_0x35be('0x33')](_0x81a67a[_0x35be('0x34')]);_0x4ee8b7[_0x35be('0x35')]=_[_0x35be('0x36')](_0x4ee8b7['model'],_0x4ee8b7[_0x35be('0x34')]);_0x1a8839[_0x35be('0x37')]=_[_0x35be('0x36')](_0x4ee8b7['model'],qs['fields'](_0x81a67a['query']['fields']));_0x1a8839['attributes']=_0x1a8839[_0x35be('0x37')][_0x35be('0x38')]?_0x1a8839[_0x35be('0x37')]:_0x4ee8b7[_0x35be('0x32')];if(!_0x81a67a[_0x35be('0x34')][_0x35be('0x39')]('nolimit')){_0x1a8839[_0x35be('0x22')]=qs[_0x35be('0x22')](_0x81a67a['query'][_0x35be('0x22')]);_0x1a8839[_0x35be('0x1f')]=qs[_0x35be('0x1f')](_0x81a67a['query'][_0x35be('0x1f')]);}_0x1a8839[_0x35be('0x3a')]=qs[_0x35be('0x3b')](_0x81a67a[_0x35be('0x34')][_0x35be('0x3b')]);_0x1a8839[_0x35be('0x3c')]=qs[_0x35be('0x35')](_[_0x35be('0x3d')](_0x81a67a['query'],_0x4ee8b7[_0x35be('0x35')]),_0x5df7c8);if(_0x81a67a['query'][_0x35be('0x3e')]){_0x1a8839['where']=_[_0x35be('0x3f')](_0x1a8839['where'],{'$or':_['map'](_0x5df7c8,function(_0x1cefe3){if(_0x1cefe3[_0x35be('0x40')]!=='VIRTUAL'){var _0x1a13c2={};_0x1a13c2[_0x1cefe3[_0x35be('0x2d')]]={'$like':'%'+_0x81a67a['query'][_0x35be('0x3e')]+'%'};return _0x1a13c2;}})});}_0x1a8839=_[_0x35be('0x3f')]({},_0x1a8839,_0x81a67a['options']);var _0x114a66={'where':_0x1a8839['where']};return db[_0x35be('0x41')][_0x35be('0x21')](_0x114a66)[_0x35be('0x28')](function(_0x3e8b19){_0x43aabc[_0x35be('0x21')]=_0x3e8b19;if(_0x81a67a[_0x35be('0x34')][_0x35be('0x42')]){_0x1a8839[_0x35be('0x43')]=[{'all':!![]}];}return db['SquareOdbc'][_0x35be('0x44')](_0x1a8839);})[_0x35be('0x28')](function(_0x14470d){_0x43aabc[_0x35be('0x45')]=_0x14470d;return _0x43aabc;})[_0x35be('0x28')](respondWithFilteredResult(_0xb60a89,_0x1a8839))[_0x35be('0x46')](handleError(_0xb60a89,null));};exports['show']=function(_0x4d257f,_0x47115a){var _0x28fee4={'raw':!![],'where':{'id':_0x4d257f['params']['id']}},_0x56a3f8={};_0x56a3f8['model']=_[_0x35be('0x33')](db[_0x35be('0x41')][_0x35be('0x47')]);_0x56a3f8['query']=_[_0x35be('0x33')](_0x4d257f[_0x35be('0x34')]);_0x56a3f8[_0x35be('0x35')]=_['intersection'](_0x56a3f8[_0x35be('0x32')],_0x56a3f8[_0x35be('0x34')]);_0x28fee4[_0x35be('0x37')]=_[_0x35be('0x36')](_0x56a3f8[_0x35be('0x32')],qs[_0x35be('0x48')](_0x4d257f[_0x35be('0x34')][_0x35be('0x48')]));_0x28fee4['attributes']=_0x28fee4[_0x35be('0x37')][_0x35be('0x38')]?_0x28fee4[_0x35be('0x37')]:_0x56a3f8[_0x35be('0x32')];if(_0x4d257f[_0x35be('0x34')][_0x35be('0x42')]){_0x28fee4[_0x35be('0x43')]=[{'all':!![]}];}_0x28fee4=_[_0x35be('0x3f')]({},_0x28fee4,_0x4d257f[_0x35be('0x49')]);return db[_0x35be('0x41')]['find'](_0x28fee4)[_0x35be('0x28')](handleEntityNotFound(_0x47115a,null))['then'](respondWithResult(_0x47115a,null))[_0x35be('0x46')](handleError(_0x47115a,null));};exports[_0x35be('0x4a')]=function(_0x2d0ebc,_0x329546){return db['SquareOdbc'][_0x35be('0x4a')](_0x2d0ebc[_0x35be('0x4b')],{})[_0x35be('0x28')](function(_0xd187c2){var _0x5d417f=_0x2d0ebc[_0x35be('0x4c')]['get']({'plain':!![]});if(!_0x5d417f)throw new Error(_0x35be('0x4d'));if(_0x5d417f[_0x35be('0x4e')]===_0x35be('0x4c')){var _0xe34f13=_0xd187c2[_0x35be('0x29')]({'plain':!![]});var _0x1e78fe=_0x35be('0x2a');return db[_0x35be('0x4f')][_0x35be('0x50')]({'where':{'name':_0x1e78fe,'userProfileId':_0x5d417f[_0x35be('0x51')]},'raw':!![]})[_0x35be('0x28')](function(_0xa74fdf){if(_0xa74fdf&&_0xa74fdf[_0x35be('0x52')]===0x0){return db[_0x35be('0x2b')][_0x35be('0x4a')]({'name':_0xe34f13[_0x35be('0x2d')],'resourceId':_0xe34f13['id'],'type':_0xa74fdf['name'],'sectionId':_0xa74fdf['id']},{})[_0x35be('0x28')](function(){return _0xd187c2;});}else{return _0xd187c2;}})['catch'](function(_0x1f8be0){logger[_0x35be('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f8be0);throw _0x1f8be0;});}return _0xd187c2;})[_0x35be('0x28')](respondWithResult(_0x329546,0xc9))[_0x35be('0x46')](handleError(_0x329546,null));};exports[_0x35be('0x27')]=function(_0x1acb17,_0x22580b){if(_0x1acb17[_0x35be('0x4b')]['id']){delete _0x1acb17[_0x35be('0x4b')]['id'];}return db[_0x35be('0x41')][_0x35be('0x50')]({'where':{'id':_0x1acb17[_0x35be('0x53')]['id']}})['then'](handleEntityNotFound(_0x22580b,null))[_0x35be('0x28')](saveUpdates(_0x1acb17['body'],null))[_0x35be('0x28')](respondWithResult(_0x22580b,null))['catch'](handleError(_0x22580b,null));};exports[_0x35be('0x54')]=function(_0x50a21a,_0x383bef){return db['SquareOdbc'][_0x35be('0x50')]({'where':{'id':_0x50a21a[_0x35be('0x53')]['id']}})[_0x35be('0x28')](handleEntityNotFound(_0x383bef,null))[_0x35be('0x28')](removeEntity(_0x383bef,null))['catch'](handleError(_0x383bef,null));};exports['test']=function(_0x1afb1a,_0x490552,_0x332be2){var _0x5362af;return db['SquareOdbc'][_0x35be('0x50')]({'where':{'id':_0x1afb1a[_0x35be('0x53')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x490552,null))[_0x35be('0x28')](function(_0x11e84f){if(_0x11e84f){var _0x523e1a=require(_0x35be('0x55'))();_0x523e1a[_0x35be('0x56')](_0x11e84f[_0x35be('0x57')]);_0x523e1a['closeSync']();return _0x11e84f;}})[_0x35be('0x28')](respondWithResult(_0x490552,null))[_0x35be('0x46')](handleError(_0x490552,null));};
\ No newline at end of file
index 969e65a..46702d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc014=['define','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports'];(function(_0x54f322,_0x24a660){var _0xb0a1d5=function(_0x523587){while(--_0x523587){_0x54f322['push'](_0x54f322['shift']());}};_0xb0a1d5(++_0x24a660);}(_0xc014,0x1d5));var _0x4c01=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xc014[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x4c01('0x0'));var util=require(_0x4c01('0x1'));var logger=require('../../config/logger')(_0x4c01('0x2'));var moment=require(_0x4c01('0x3'));var BPromise=require(_0x4c01('0x4'));var rp=require(_0x4c01('0x5'));var fs=require('fs');var path=require(_0x4c01('0x6'));var rimraf=require(_0x4c01('0x7'));var config=require(_0x4c01('0x8'));var attributes=require(_0x4c01('0x9'));module[_0x4c01('0xa')]=function(_0x53b7ba,_0x511fff){return _0x53b7ba[_0x4c01('0xb')]('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1221=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash'];(function(_0x5c249e,_0x39728d){var _0x1d2665=function(_0x595949){while(--_0x595949){_0x5c249e['push'](_0x5c249e['shift']());}};_0x1d2665(++_0x39728d);}(_0x1221,0x1e9));var _0x1122=function(_0x3059ef,_0x542b16){_0x3059ef=_0x3059ef-0x0;var _0x317308=_0x1221[_0x3059ef];return _0x317308;};'use strict';var _=require(_0x1122('0x0'));var util=require(_0x1122('0x1'));var logger=require(_0x1122('0x2'))('api');var moment=require(_0x1122('0x3'));var BPromise=require(_0x1122('0x4'));var rp=require(_0x1122('0x5'));var fs=require('fs');var path=require(_0x1122('0x6'));var rimraf=require(_0x1122('0x7'));var config=require(_0x1122('0x8'));var attributes=require(_0x1122('0x9'));module[_0x1122('0xa')]=function(_0x1135c5,_0x5115f1){return _0x1135c5[_0x1122('0xb')](_0x1122('0xc'),attributes,{'tableName':_0x1122('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 56c4328..1e9ae3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8404=['options','raw','where','attributes','include','map','model','debug','stringify','util','randomstring','../../config/utils','../../config/logger','rpc','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowSquareOdbc','SquareOdbc','find'];(function(_0x188104,_0x448d45){var _0x4dfe84=function(_0xd0efa3){while(--_0xd0efa3){_0x188104['push'](_0x188104['shift']());}};_0x4dfe84(++_0x448d45);}(_0x8404,0x183));var _0x4840=function(_0x430f8f,_0x57bb98){_0x430f8f=_0x430f8f-0x0;var _0x222f90=_0x8404[_0x430f8f];return _0x222f90;};'use strict';var _=require('lodash');var util=require(_0x4840('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4840('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4840('0x2'));var logger=require(_0x4840('0x3'))(_0x4840('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4840('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x4c04e6,_0x5d5d49,_0x1fa65a){return new BPromise(function(_0x261a53,_0xc8e5c2){return client['request'](_0x4c04e6,_0x1fa65a)[_0x4840('0x6')](function(_0x1d0c8d){logger[_0x4840('0x7')](_0x4840('0x8'),_0x5d5d49,_0x4840('0x9'));logger['debug'](_0x4840('0xa'),_0x5d5d49,_0x4840('0x9'),JSON['stringify'](_0x1d0c8d));if(_0x1d0c8d[_0x4840('0xb')]){if(_0x1d0c8d[_0x4840('0xb')]['code']===0x1f4){logger['error'](_0x4840('0x8'),_0x5d5d49,_0x1d0c8d[_0x4840('0xb')][_0x4840('0xc')]);return _0xc8e5c2(_0x1d0c8d['error'][_0x4840('0xc')]);}logger['error'](_0x4840('0x8'),_0x5d5d49,_0x1d0c8d[_0x4840('0xb')][_0x4840('0xc')]);return _0x261a53(_0x1d0c8d[_0x4840('0xb')][_0x4840('0xc')]);}else{logger[_0x4840('0x7')](_0x4840('0x8'),_0x5d5d49,_0x4840('0x9'));_0x261a53(_0x1d0c8d[_0x4840('0xd')]['message']);}})[_0x4840('0xe')](function(_0x3a6d04){logger[_0x4840('0xb')](_0x4840('0x8'),_0x5d5d49,_0x3a6d04);_0xc8e5c2(_0x3a6d04);});});}exports[_0x4840('0xf')]=function(_0x2d1d92){var _0x5db519=this;return new Promise(function(_0x4e59dd,_0x4b3804){return db[_0x4840('0x10')][_0x4840('0x11')]({'raw':_0x2d1d92['options']?_0x2d1d92[_0x4840('0x12')][_0x4840('0x13')]===undefined?!![]:![]:!![],'where':_0x2d1d92[_0x4840('0x12')]?_0x2d1d92[_0x4840('0x12')][_0x4840('0x14')]||null:null,'attributes':_0x2d1d92[_0x4840('0x12')]?_0x2d1d92['options'][_0x4840('0x15')]||null:null,'include':_0x2d1d92[_0x4840('0x12')]?_0x2d1d92['options'][_0x4840('0x16')]?_[_0x4840('0x17')](_0x2d1d92[_0x4840('0x12')][_0x4840('0x16')],function(_0x450972){return{'model':db[_0x450972['model']],'as':_0x450972['as'],'attributes':_0x450972[_0x4840('0x15')],'include':_0x450972['include']?_[_0x4840('0x17')](_0x450972[_0x4840('0x16')],function(_0x2383b4){return{'model':db[_0x2383b4[_0x4840('0x18')]],'as':_0x2383b4['as'],'attributes':_0x2383b4[_0x4840('0x15')],'include':_0x2383b4[_0x4840('0x16')]?_[_0x4840('0x17')](_0x2383b4[_0x4840('0x16')],function(_0x1ec1cc){return{'model':db[_0x1ec1cc[_0x4840('0x18')]],'as':_0x1ec1cc['as'],'attributes':_0x1ec1cc[_0x4840('0x15')]};}):[]};}):[]};}):[]:[]})[_0x4840('0x6')](function(_0x34ae67){logger[_0x4840('0x7')](_0x4840('0xf'),_0x2d1d92);logger[_0x4840('0x19')]('ShowSquareOdbc',_0x2d1d92,JSON[_0x4840('0x1a')](_0x34ae67));_0x4e59dd(_0x34ae67);})[_0x4840('0xe')](function(_0x391ce8){logger[_0x4840('0xb')](_0x4840('0xf'),_0x391ce8[_0x4840('0xc')],_0x2d1d92);_0x4b3804(_0x5db519[_0x4840('0xb')](0x1f4,_0x391ce8[_0x4840('0xc')]));});});};
\ No newline at end of file
+var _0x2250=['options','raw','attributes','include','map','model','then','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ShowSquareOdbc','SquareOdbc','find'];(function(_0x6f8a55,_0x47e319){var _0x3af8f4=function(_0x3f66c8){while(--_0x3f66c8){_0x6f8a55['push'](_0x6f8a55['shift']());}};_0x3af8f4(++_0x47e319);}(_0x2250,0x1e4));var _0x0225=function(_0xb24fad,_0xd58756){_0xb24fad=_0xb24fad-0x0;var _0x173226=_0x2250[_0xb24fad];return _0x173226;};'use strict';var _=require('lodash');var util=require(_0x0225('0x0'));var moment=require(_0x0225('0x1'));var BPromise=require(_0x0225('0x2'));var rs=require(_0x0225('0x3'));var fs=require('fs');var Redis=require(_0x0225('0x4'));var db=require(_0x0225('0x5'))['db'];var utils=require(_0x0225('0x6'));var logger=require('../../config/logger')(_0x0225('0x7'));var config=require(_0x0225('0x8'));var jayson=require(_0x0225('0x9'));var client=jayson[_0x0225('0xa')][_0x0225('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x566c3b,_0x1d4e80,_0x431549){return new BPromise(function(_0x22e3b9,_0x9719c2){return client[_0x0225('0xc')](_0x566c3b,_0x431549)['then'](function(_0x3d049c){logger['info'](_0x0225('0xd'),_0x1d4e80,_0x0225('0xe'));logger[_0x0225('0xf')](_0x0225('0x10'),_0x1d4e80,'request\x20sent',JSON[_0x0225('0x11')](_0x3d049c));if(_0x3d049c['error']){if(_0x3d049c[_0x0225('0x12')][_0x0225('0x13')]===0x1f4){logger[_0x0225('0x12')](_0x0225('0xd'),_0x1d4e80,_0x3d049c['error']['message']);return _0x9719c2(_0x3d049c[_0x0225('0x12')][_0x0225('0x14')]);}logger[_0x0225('0x12')](_0x0225('0xd'),_0x1d4e80,_0x3d049c['error'][_0x0225('0x14')]);return _0x22e3b9(_0x3d049c[_0x0225('0x12')][_0x0225('0x14')]);}else{logger[_0x0225('0x15')](_0x0225('0xd'),_0x1d4e80,_0x0225('0xe'));_0x22e3b9(_0x3d049c[_0x0225('0x16')][_0x0225('0x14')]);}})['catch'](function(_0x5a1ecb){logger[_0x0225('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x1d4e80,_0x5a1ecb);_0x9719c2(_0x5a1ecb);});});}exports[_0x0225('0x17')]=function(_0x1d72e5){var _0x4f733c=this;return new Promise(function(_0x38d4c7,_0x396a8f){return db[_0x0225('0x18')][_0x0225('0x19')]({'raw':_0x1d72e5[_0x0225('0x1a')]?_0x1d72e5[_0x0225('0x1a')][_0x0225('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d72e5[_0x0225('0x1a')]?_0x1d72e5['options']['where']||null:null,'attributes':_0x1d72e5[_0x0225('0x1a')]?_0x1d72e5[_0x0225('0x1a')][_0x0225('0x1c')]||null:null,'include':_0x1d72e5[_0x0225('0x1a')]?_0x1d72e5['options'][_0x0225('0x1d')]?_[_0x0225('0x1e')](_0x1d72e5[_0x0225('0x1a')][_0x0225('0x1d')],function(_0x286f1){return{'model':db[_0x286f1['model']],'as':_0x286f1['as'],'attributes':_0x286f1['attributes'],'include':_0x286f1[_0x0225('0x1d')]?_[_0x0225('0x1e')](_0x286f1[_0x0225('0x1d')],function(_0x10e383){return{'model':db[_0x10e383['model']],'as':_0x10e383['as'],'attributes':_0x10e383[_0x0225('0x1c')],'include':_0x10e383[_0x0225('0x1d')]?_[_0x0225('0x1e')](_0x10e383[_0x0225('0x1d')],function(_0x59e54d){return{'model':db[_0x59e54d[_0x0225('0x1f')]],'as':_0x59e54d['as'],'attributes':_0x59e54d['attributes']};}):[]};}):[]};}):[]:[]})[_0x0225('0x20')](function(_0x44a898){logger[_0x0225('0x15')](_0x0225('0x17'),_0x1d72e5);logger[_0x0225('0xf')](_0x0225('0x17'),_0x1d72e5,JSON['stringify'](_0x44a898));_0x38d4c7(_0x44a898);})[_0x0225('0x21')](function(_0x4bc892){logger['error'](_0x0225('0x17'),_0x4bc892[_0x0225('0x14')],_0x1d72e5);_0x396a8f(_0x4f733c[_0x0225('0x12')](0x1f4,_0x4bc892[_0x0225('0x14')]));});});};
\ No newline at end of file
index fcdefd0..f9dddeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb87d=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','create','post','addUsers','put','destroy','delete','exports','multer','util','path'];(function(_0xcd3fdd,_0x30424c){var _0x1ab32c=function(_0x43ab03){while(--_0x43ab03){_0xcd3fdd['push'](_0xcd3fdd['shift']());}};_0x1ab32c(++_0x30424c);}(_0xb87d,0x8d));var _0xdb87=function(_0x77a404,_0x39145d){_0x77a404=_0x77a404-0x0;var _0x46e5a9=_0xb87d[_0x77a404];return _0x46e5a9;};'use strict';var multer=require(_0xdb87('0x0'));var util=require(_0xdb87('0x1'));var path=require(_0xdb87('0x2'));var timeout=require(_0xdb87('0x3'));var express=require(_0xdb87('0x4'));var router=express[_0xdb87('0x5')]();var fs_extra=require(_0xdb87('0x6'));var auth=require(_0xdb87('0x7'));var interaction=require(_0xdb87('0x8'));var config=require(_0xdb87('0x9'));var controller=require('./squareProject.controller');router[_0xdb87('0xa')]('/',auth[_0xdb87('0xb')](),controller[_0xdb87('0xc')]);router[_0xdb87('0xa')](_0xdb87('0xd'),auth[_0xdb87('0xb')](),controller[_0xdb87('0xe')]);router[_0xdb87('0xa')](_0xdb87('0xf'),auth[_0xdb87('0xb')](),controller[_0xdb87('0x10')]);router['post']('/',auth[_0xdb87('0xb')](),controller[_0xdb87('0x11')]);router[_0xdb87('0x12')](_0xdb87('0xf'),auth[_0xdb87('0xb')](),controller[_0xdb87('0x13')]);router[_0xdb87('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xdb87('0xd'),auth['isAuthenticated'](),controller[_0xdb87('0x15')]);router[_0xdb87('0x16')](_0xdb87('0xf'),auth['isAuthenticated'](),controller['removeUsers']);module[_0xdb87('0x17')]=router;
\ No newline at end of file
+var _0x5ed9=['/:id','show','/:id/users','getUsers','post','addUsers','put','removeUsers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','get'];(function(_0x50d39c,_0x2eb4c2){var _0x551b38=function(_0x3c19de){while(--_0x3c19de){_0x50d39c['push'](_0x50d39c['shift']());}};_0x551b38(++_0x2eb4c2);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5ed9[_0x278e3c];return _0x3e2d9b;};'use strict';var multer=require(_0x95ed('0x0'));var util=require(_0x95ed('0x1'));var path=require('path');var timeout=require(_0x95ed('0x2'));var express=require(_0x95ed('0x3'));var router=express[_0x95ed('0x4')]();var fs_extra=require(_0x95ed('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x95ed('0x6'));var config=require(_0x95ed('0x7'));var controller=require(_0x95ed('0x8'));router['get']('/',auth[_0x95ed('0x9')](),controller['index']);router[_0x95ed('0xa')](_0x95ed('0xb'),auth[_0x95ed('0x9')](),controller[_0x95ed('0xc')]);router[_0x95ed('0xa')](_0x95ed('0xd'),auth['isAuthenticated'](),controller[_0x95ed('0xe')]);router[_0x95ed('0xf')]('/',auth[_0x95ed('0x9')](),controller['create']);router[_0x95ed('0xf')]('/:id/users',auth[_0x95ed('0x9')](),controller[_0x95ed('0x10')]);router[_0x95ed('0x11')](_0x95ed('0xb'),auth[_0x95ed('0x9')](),controller['update']);router['delete'](_0x95ed('0xb'),auth[_0x95ed('0x9')](),controller['destroy']);router['delete'](_0x95ed('0xd'),auth[_0x95ed('0x9')](),controller[_0x95ed('0x12')]);module[_0x95ed('0x13')]=router;
\ No newline at end of file
index d347d90..7c19da6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14a0=['preproduction','utf8','production','toString','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x14a0,0x109));var _0x014a=function(_0x3c74ae,_0x75030b){_0x3c74ae=_0x3c74ae-0x0;var _0x264123=_0x14a0[_0x3c74ae];return _0x264123;};'use strict';var Sequelize=require(_0x014a('0x0'));module[_0x014a('0x1')]={'name':{'type':Sequelize[_0x014a('0x2')],'unique':_0x014a('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x014a('0x2')]},'notes':{'type':Sequelize[_0x014a('0x4')]},'preproduction':{'type':Sequelize[_0x014a('0x5')](_0x014a('0x6')),'get':function(){if(this[_0x014a('0x7')]('preproduction')){return this[_0x014a('0x7')](_0x014a('0x8'))['toString'](_0x014a('0x9'));}}},'production':{'type':Sequelize[_0x014a('0x5')](_0x014a('0x6')),'get':function(){if(this[_0x014a('0x7')](_0x014a('0xa'))){return this['getDataValue'](_0x014a('0xa'))[_0x014a('0xb')](_0x014a('0x9'));}}},'savedAt':{'type':Sequelize[_0x014a('0xc')]},'publishedAt':{'type':Sequelize[_0x014a('0xc')]}};
\ No newline at end of file
+var _0x8601=['production','DATE','sequelize','exports','STRING','name','BLOB','long','getDataValue','toString','utf8'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x8601,0x183));var _0x1860=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8601[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x1860('0x0'));module[_0x1860('0x1')]={'name':{'type':Sequelize[_0x1860('0x2')],'unique':_0x1860('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x1860('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x1860('0x4')](_0x1860('0x5')),'get':function(){if(this[_0x1860('0x6')]('preproduction')){return this[_0x1860('0x6')]('preproduction')[_0x1860('0x7')](_0x1860('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0x1860('0x5')),'get':function(){if(this['getDataValue'](_0x1860('0x9'))){return this[_0x1860('0x6')](_0x1860('0x9'))[_0x1860('0x7')](_0x1860('0x8'));}}},'savedAt':{'type':Sequelize[_0x1860('0xa')]},'publishedAt':{'type':Sequelize[_0x1860('0xa')]}};
\ No newline at end of file
index 3d4da7b..0873f15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b31=['role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','production','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','order','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','end','json','undefined','limit','count','offset','status','Content-Range','update','destroy','then','get','SquareProjects','UserProfileResource','stringify','error','stack','name','send','net','Socket','connect','agi','127.0.0.1','map','SquareProject','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','show','params','rawAttributes','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x5c6610,_0x355082){var _0x44799a=function(_0x12a496){while(--_0x12a496){_0x5c6610['push'](_0x5c6610['shift']());}};_0x44799a(++_0x355082);}(_0x7b31,0x161));var _0x17b3=function(_0x33a016,_0x1b891b){_0x33a016=_0x33a016-0x0;var _0x1b3a37=_0x7b31[_0x33a016];return _0x1b3a37;};'use strict';var _=require('lodash');var Redis=require(_0x17b3('0x0'));var qs=require(_0x17b3('0x1'));var logger=require(_0x17b3('0x2'))('api');var config=require(_0x17b3('0x3'));var db=require(_0x17b3('0x4'))['db'];config[_0x17b3('0x5')]=_[_0x17b3('0x6')](config[_0x17b3('0x5')],{'host':_0x17b3('0x7'),'port':0x18eb});var socket=require(_0x17b3('0x8'))(new Redis(config['redis']));require(_0x17b3('0x9'))[_0x17b3('0xa')](socket);function respondWithStatusCode(_0x346789,_0x25695b){_0x25695b=_0x25695b||0xcc;return function(_0x3e16fd){if(_0x3e16fd){return _0x346789[_0x17b3('0xb')](_0x25695b);}return _0x346789['status'](_0x25695b)[_0x17b3('0xc')]();};}function respondWithResult(_0x44ec45,_0x313cd0){_0x313cd0=_0x313cd0||0xc8;return function(_0x11eff1){if(_0x11eff1){return _0x44ec45['status'](_0x313cd0)[_0x17b3('0xd')](_0x11eff1);}};}function respondWithFilteredResult(_0x22676e,_0x58b42a){return function(_0x9bf611){if(_0x9bf611){var _0x32c5b4=typeof _0x58b42a['offset']===_0x17b3('0xe')&&typeof _0x58b42a[_0x17b3('0xf')]===_0x17b3('0xe');var _0x570b40=_0x9bf611[_0x17b3('0x10')];var _0x1a9694=_0x32c5b4?0x0:_0x58b42a[_0x17b3('0x11')];var _0x25f647=_0x32c5b4?_0x9bf611['count']:_0x58b42a[_0x17b3('0x11')]+_0x58b42a['limit'];var _0x2489f2;if(_0x25f647>=_0x570b40){_0x25f647=_0x570b40;_0x2489f2=0xc8;}else{_0x2489f2=0xce;}_0x22676e[_0x17b3('0x12')](_0x2489f2);return _0x22676e['set'](_0x17b3('0x13'),_0x1a9694+'-'+_0x25f647+'/'+_0x570b40)[_0x17b3('0xd')](_0x9bf611);}return null;};}function saveUpdates(_0x589610){return function(_0x178ca4){if(_0x178ca4){return _0x178ca4[_0x17b3('0x14')](_0x589610)['then'](function(_0x432a36){return _0x432a36;});}return null;};}function removeEntity(_0x40cd4c){return function(_0x4df733){if(_0x4df733){return _0x4df733[_0x17b3('0x15')]()[_0x17b3('0x16')](function(){var _0x193ec2=_0x4df733[_0x17b3('0x17')]({'plain':!![]});var _0x567332=_0x17b3('0x18');return db[_0x17b3('0x19')][_0x17b3('0x15')]({'where':{'type':_0x567332,'resourceId':_0x193ec2['id']}})['then'](function(){return _0x4df733;});})[_0x17b3('0x16')](function(){return createAgiSocket();})['then'](function(_0x4c1577){_0x4c1577[_0x17b3('0xc')](JSON[_0x17b3('0x1a')]({'id':_0x4df733['id'],'deleted':!![]}));})[_0x17b3('0x16')](function(){_0x40cd4c[_0x17b3('0x12')](0xcc)[_0x17b3('0xc')]();});}};}function handleEntityNotFound(_0x433c99){return function(_0x19fa0d){if(!_0x19fa0d){_0x433c99[_0x17b3('0xb')](0x194);}return _0x19fa0d;};}function handleError(_0x2daf62,_0x55f90e){_0x55f90e=_0x55f90e||0x1f4;return function(_0x1a000f){logger[_0x17b3('0x1b')](_0x1a000f[_0x17b3('0x1c')]);if(_0x1a000f[_0x17b3('0x1d')]){delete _0x1a000f['name'];}_0x2daf62['status'](_0x55f90e)[_0x17b3('0x1e')](_0x1a000f);};}function createAgiSocket(){try{var _0x95855f=require(_0x17b3('0x1f'));var _0x45ad50=new _0x95855f[(_0x17b3('0x20'))]();return _0x45ad50[_0x17b3('0x21')](config[_0x17b3('0x22')]['port']||0x11dd,_0x17b3('0x23'));}catch(_0x482c76){throw _0x482c76;}}exports['index']=function(_0x4fd8b6,_0x2503a5){var _0x701b68={},_0x44afa9={},_0x863f90={'count':0x0,'rows':[]};var _0x2d8d38=_[_0x17b3('0x24')](db[_0x17b3('0x25')]['rawAttributes'],function(_0xf04011){return{'name':_0xf04011['fieldName'],'type':_0xf04011['type'][_0x17b3('0x26')]};});_0x44afa9[_0x17b3('0x27')]=_['map'](_0x2d8d38,_0x17b3('0x1d'));_0x44afa9['query']=_[_0x17b3('0x28')](_0x4fd8b6[_0x17b3('0x29')]);_0x44afa9[_0x17b3('0x2a')]=_[_0x17b3('0x2b')](_0x44afa9[_0x17b3('0x27')],_0x44afa9[_0x17b3('0x29')]);_0x701b68[_0x17b3('0x2c')]=_[_0x17b3('0x2b')](_0x44afa9[_0x17b3('0x27')],qs[_0x17b3('0x2d')](_0x4fd8b6['query'][_0x17b3('0x2d')]));_0x701b68['attributes']=_0x701b68[_0x17b3('0x2c')][_0x17b3('0x2e')]?_0x701b68[_0x17b3('0x2c')]:_0x44afa9[_0x17b3('0x27')];if(!_0x4fd8b6[_0x17b3('0x29')]['hasOwnProperty'](_0x17b3('0x2f'))){_0x701b68[_0x17b3('0xf')]=qs[_0x17b3('0xf')](_0x4fd8b6[_0x17b3('0x29')][_0x17b3('0xf')]);_0x701b68[_0x17b3('0x11')]=qs[_0x17b3('0x11')](_0x4fd8b6['query'][_0x17b3('0x11')]);}_0x701b68['order']=qs[_0x17b3('0x30')](_0x4fd8b6[_0x17b3('0x29')][_0x17b3('0x30')]);_0x701b68[_0x17b3('0x31')]=qs[_0x17b3('0x2a')](_[_0x17b3('0x32')](_0x4fd8b6['query'],_0x44afa9[_0x17b3('0x2a')]),_0x2d8d38);if(_0x4fd8b6['query'][_0x17b3('0x33')]){_0x701b68['where']=_[_0x17b3('0x34')](_0x701b68['where'],{'$or':_['map'](_0x2d8d38,function(_0x2aa5d3){if(_0x2aa5d3[_0x17b3('0x35')]!==_0x17b3('0x36')){var _0xc5bffe={};_0xc5bffe[_0x2aa5d3[_0x17b3('0x1d')]]={'$like':'%'+_0x4fd8b6['query']['filter']+'%'};return _0xc5bffe;}})});}_0x701b68=_[_0x17b3('0x34')]({},_0x701b68,_0x4fd8b6[_0x17b3('0x37')]);var _0xeecd71={'where':_0x701b68[_0x17b3('0x31')]};return db['SquareProject'][_0x17b3('0x10')](_0xeecd71)[_0x17b3('0x16')](function(_0x1fcd54){_0x863f90[_0x17b3('0x10')]=_0x1fcd54;if(_0x4fd8b6[_0x17b3('0x29')]['includeAll']){_0x701b68[_0x17b3('0x38')]=[{'all':!![]}];}return db[_0x17b3('0x25')][_0x17b3('0x39')](_0x701b68);})[_0x17b3('0x16')](function(_0x5bad96){_0x863f90['rows']=_0x5bad96;return _0x863f90;})[_0x17b3('0x16')](respondWithFilteredResult(_0x2503a5,_0x701b68))['catch'](handleError(_0x2503a5,null));};exports[_0x17b3('0x3a')]=function(_0xcd5935,_0x5e8939){var _0x1ac390={'raw':![],'where':{'id':_0xcd5935[_0x17b3('0x3b')]['id']}},_0x180631={};_0x180631['model']=_[_0x17b3('0x28')](db['SquareProject'][_0x17b3('0x3c')]);_0x180631[_0x17b3('0x29')]=_[_0x17b3('0x28')](_0xcd5935['query']);_0x180631[_0x17b3('0x2a')]=_[_0x17b3('0x2b')](_0x180631[_0x17b3('0x27')],_0x180631[_0x17b3('0x29')]);_0x1ac390[_0x17b3('0x2c')]=_[_0x17b3('0x2b')](_0x180631[_0x17b3('0x27')],qs[_0x17b3('0x2d')](_0xcd5935[_0x17b3('0x29')][_0x17b3('0x2d')]));_0x1ac390[_0x17b3('0x2c')]=_0x1ac390[_0x17b3('0x2c')][_0x17b3('0x2e')]?_0x1ac390[_0x17b3('0x2c')]:_0x180631[_0x17b3('0x27')];if(_0xcd5935['query'][_0x17b3('0x3d')]){_0x1ac390['include']=[{'all':!![]}];}_0x1ac390=_[_0x17b3('0x34')]({},_0x1ac390,_0xcd5935[_0x17b3('0x37')]);return db[_0x17b3('0x25')]['find'](_0x1ac390)['then'](handleEntityNotFound(_0x5e8939,null))[_0x17b3('0x16')](respondWithResult(_0x5e8939,null))[_0x17b3('0x3e')](handleError(_0x5e8939,null));};exports[_0x17b3('0x3f')]=function(_0x39b99b,_0x514768){return db[_0x17b3('0x25')][_0x17b3('0x3f')](_0x39b99b[_0x17b3('0x40')],{})[_0x17b3('0x16')](function(_0x23882d){var _0x57157b=_0x39b99b[_0x17b3('0x41')]['get']({'plain':!![]});if(!_0x57157b)throw new Error(_0x17b3('0x42'));if(_0x57157b[_0x17b3('0x43')]===_0x17b3('0x41')){var _0x192d02=_0x23882d[_0x17b3('0x17')]({'plain':!![]});var _0x384480=_0x17b3('0x18');return db['UserProfileSection'][_0x17b3('0x44')]({'where':{'name':_0x384480,'userProfileId':_0x57157b[_0x17b3('0x45')]},'raw':!![]})[_0x17b3('0x16')](function(_0x31db3d){if(_0x31db3d&&_0x31db3d[_0x17b3('0x46')]===0x0){return db[_0x17b3('0x19')]['create']({'name':_0x192d02['name'],'resourceId':_0x192d02['id'],'type':_0x31db3d[_0x17b3('0x1d')],'sectionId':_0x31db3d['id']},{})[_0x17b3('0x16')](function(){return _0x23882d;});}else{return _0x23882d;}})[_0x17b3('0x3e')](function(_0x1d5ece){logger[_0x17b3('0x1b')](_0x17b3('0x47'),_0x1d5ece);throw _0x1d5ece;});}return _0x23882d;})[_0x17b3('0x16')](respondWithResult(_0x514768,0xc9))[_0x17b3('0x3e')](handleError(_0x514768,null));};exports[_0x17b3('0x14')]=function(_0x2a1283,_0xa8528f){if(_0x2a1283[_0x17b3('0x40')]['id']){delete _0x2a1283[_0x17b3('0x40')]['id'];}return db[_0x17b3('0x25')][_0x17b3('0x44')]({'where':{'id':_0x2a1283['params']['id']}})['then'](handleEntityNotFound(_0xa8528f,null))[_0x17b3('0x16')](saveUpdates(_0x2a1283[_0x17b3('0x40')],null))[_0x17b3('0x16')](function(_0x55326f){if(!_0x55326f)return;var _0x549817=_0x55326f[_0x17b3('0x17')]({'plain':!![]});return _0x549817;})[_0x17b3('0x16')](function(_0x15f78d){var _0x24aae0=new Redis(config['redis']);_0x24aae0['publish'](_0x17b3('0x22'),JSON[_0x17b3('0x1a')](_['pick'](_0x15f78d,['id',_0x17b3('0x1d'),_0x17b3('0x48')])));return _0x15f78d;})[_0x17b3('0x16')](respondWithResult(_0xa8528f,null))[_0x17b3('0x3e')](handleError(_0xa8528f,null));};exports['destroy']=function(_0xfd666,_0x5f4f18){return db['SquareProject'][_0x17b3('0x44')]({'where':{'id':_0xfd666[_0x17b3('0x3b')]['id']}})['then'](handleEntityNotFound(_0x5f4f18,null))[_0x17b3('0x16')](removeEntity(_0x5f4f18,null))[_0x17b3('0x3e')](handleError(_0x5f4f18,null));};exports[_0x17b3('0x49')]=function(_0x21618f,_0x1ad80a){return db[_0x17b3('0x25')][_0x17b3('0x44')]({'where':{'id':_0x21618f['params']['id']}})[_0x17b3('0x16')](handleEntityNotFound(_0x1ad80a,null))[_0x17b3('0x16')](function(_0x469471){if(_0x469471){return _0x469471[_0x17b3('0x49')](_0x21618f[_0x17b3('0x40')][_0x17b3('0x4a')],_[_0x17b3('0x4b')](_0x21618f[_0x17b3('0x40')],['ids','id'])||{});}})['then'](respondWithResult(_0x1ad80a,null))['catch'](handleError(_0x1ad80a,null));};exports[_0x17b3('0x4c')]=function(_0x38f0e1,_0x4037ba){return db[_0x17b3('0x25')][_0x17b3('0x44')]({'where':{'id':_0x38f0e1[_0x17b3('0x3b')]['id']}})[_0x17b3('0x16')](handleEntityNotFound(_0x4037ba,null))[_0x17b3('0x16')](function(_0x1f60c4){if(_0x1f60c4){return _0x1f60c4[_0x17b3('0x4c')](_0x38f0e1['query'][_0x17b3('0x4a')])[_0x17b3('0x16')](function(){if(_[_0x17b3('0x4d')](_0x38f0e1[_0x17b3('0x29')]['ids'])){for(var _0x175749=0x0;_0x175749<_0x38f0e1[_0x17b3('0x29')]['ids'][_0x17b3('0x2e')];_0x175749+=0x1){socket[_0x17b3('0x4e')](_0x17b3('0x4f'),{'UserId':Number(_0x38f0e1[_0x17b3('0x29')][_0x17b3('0x4a')][_0x175749]),'SquareProjectId':Number(_0x38f0e1[_0x17b3('0x3b')]['id'])});}}else{socket['emit'](_0x17b3('0x4f'),{'UserId':Number(_0x38f0e1[_0x17b3('0x29')][_0x17b3('0x4a')]),'SquareProjectId':Number(_0x38f0e1[_0x17b3('0x3b')]['id'])});}});}})['then'](respondWithStatusCode(_0x4037ba,null))['catch'](handleError(_0x4037ba,null));};exports[_0x17b3('0x50')]=function(_0x1d177a,_0x8059ef){var _0x4d4aeb={};var _0x18e98a={};var _0x5b6406;var _0x26beaa;return db[_0x17b3('0x25')][_0x17b3('0x51')]({'where':{'id':_0x1d177a['params']['id']}})['then'](handleEntityNotFound(_0x8059ef,null))['then'](function(_0x58e811){if(_0x58e811){_0x5b6406=_0x58e811;_0x18e98a[_0x17b3('0x27')]=_[_0x17b3('0x28')](db[_0x17b3('0x52')][_0x17b3('0x3c')]);_0x18e98a['query']=_['keys'](_0x1d177a[_0x17b3('0x29')]);_0x18e98a[_0x17b3('0x2a')]=_[_0x17b3('0x2b')](_0x18e98a[_0x17b3('0x27')],_0x18e98a['query']);_0x4d4aeb[_0x17b3('0x2c')]=_['intersection'](_0x18e98a[_0x17b3('0x27')],qs['fields'](_0x1d177a[_0x17b3('0x29')][_0x17b3('0x2d')]));_0x4d4aeb[_0x17b3('0x2c')]=_0x4d4aeb[_0x17b3('0x2c')]['length']?_0x4d4aeb[_0x17b3('0x2c')]:_0x18e98a['model'];_0x4d4aeb[_0x17b3('0x53')]=qs[_0x17b3('0x30')](_0x1d177a[_0x17b3('0x29')][_0x17b3('0x30')]);_0x4d4aeb[_0x17b3('0x31')]=qs[_0x17b3('0x2a')](_[_0x17b3('0x32')](_0x1d177a[_0x17b3('0x29')],_0x18e98a[_0x17b3('0x2a')]));if(_0x1d177a[_0x17b3('0x29')]['filter']){_0x4d4aeb[_0x17b3('0x31')]=_[_0x17b3('0x34')](_0x4d4aeb[_0x17b3('0x31')],{'$or':_[_0x17b3('0x24')](_0x4d4aeb[_0x17b3('0x2c')],function(_0x1a4e2e){var _0x439b84={};_0x439b84[_0x1a4e2e]={'$like':'%'+_0x1d177a[_0x17b3('0x29')]['filter']+'%'};return _0x439b84;})});}_0x4d4aeb=_[_0x17b3('0x34')]({},_0x4d4aeb,_0x1d177a[_0x17b3('0x37')]);return _0x5b6406['getUsers'](_0x4d4aeb);}})['then'](function(_0xd29cb3){if(_0xd29cb3){_0x26beaa=_0xd29cb3[_0x17b3('0x2e')];if(!_0x1d177a[_0x17b3('0x29')]['hasOwnProperty']('nolimit')){_0x4d4aeb['limit']=qs[_0x17b3('0xf')](_0x1d177a[_0x17b3('0x29')][_0x17b3('0xf')]);_0x4d4aeb[_0x17b3('0x11')]=qs[_0x17b3('0x11')](_0x1d177a[_0x17b3('0x29')][_0x17b3('0x11')]);}return _0x5b6406['getUsers'](_0x4d4aeb);}})[_0x17b3('0x16')](function(_0x39d1f2){if(_0x39d1f2){return _0x39d1f2?{'count':_0x26beaa,'rows':_0x39d1f2}:null;}})['then'](respondWithResult(_0x8059ef,null))[_0x17b3('0x3e')](handleError(_0x8059ef,null));};
\ No newline at end of file
+var _0x0e4b=['offset','undefined','limit','count','Content-Range','update','then','get','SquareProjects','UserProfileResource','destroy','stringify','sendStatus','name','send','net','connect','port','127.0.0.1','index','map','SquareProject','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','merge','type','filter','options','findAll','rows','catch','show','params','fields','includeAll','include','find','create','body','user','autoAssociation','error','publish','agi','production','addUsers','ids','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','lodash','ioredis','../../components/parsers/qs','api','redis','localhost','./squareProject.socket','register','status','end','json'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x7eff86,_0x2952ea){_0x7eff86=_0x7eff86-0x0;var _0x14686e=_0x0e4b[_0x7eff86];return _0x14686e;};'use strict';var _=require(_0xb0e4('0x0'));var Redis=require(_0xb0e4('0x1'));var qs=require(_0xb0e4('0x2'));var logger=require('../../config/logger')(_0xb0e4('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xb0e4('0x4')],{'host':_0xb0e4('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb0e4('0x4')]));require(_0xb0e4('0x6'))[_0xb0e4('0x7')](socket);function respondWithStatusCode(_0x3dff2f,_0x35aa64){_0x35aa64=_0x35aa64||0xcc;return function(_0x57f45d){if(_0x57f45d){return _0x3dff2f['sendStatus'](_0x35aa64);}return _0x3dff2f[_0xb0e4('0x8')](_0x35aa64)[_0xb0e4('0x9')]();};}function respondWithResult(_0x1d6452,_0x23555b){_0x23555b=_0x23555b||0xc8;return function(_0x12a36a){if(_0x12a36a){return _0x1d6452[_0xb0e4('0x8')](_0x23555b)[_0xb0e4('0xa')](_0x12a36a);}};}function respondWithFilteredResult(_0x232133,_0x38019d){return function(_0x397bf3){if(_0x397bf3){var _0x598c20=typeof _0x38019d[_0xb0e4('0xb')]===_0xb0e4('0xc')&&typeof _0x38019d[_0xb0e4('0xd')]===_0xb0e4('0xc');var _0x4c19ee=_0x397bf3[_0xb0e4('0xe')];var _0x33b575=_0x598c20?0x0:_0x38019d['offset'];var _0x39fbf7=_0x598c20?_0x397bf3[_0xb0e4('0xe')]:_0x38019d[_0xb0e4('0xb')]+_0x38019d[_0xb0e4('0xd')];var _0x1e1ca5;if(_0x39fbf7>=_0x4c19ee){_0x39fbf7=_0x4c19ee;_0x1e1ca5=0xc8;}else{_0x1e1ca5=0xce;}_0x232133['status'](_0x1e1ca5);return _0x232133['set'](_0xb0e4('0xf'),_0x33b575+'-'+_0x39fbf7+'/'+_0x4c19ee)[_0xb0e4('0xa')](_0x397bf3);}return null;};}function saveUpdates(_0x5b219a){return function(_0x152ceb){if(_0x152ceb){return _0x152ceb[_0xb0e4('0x10')](_0x5b219a)[_0xb0e4('0x11')](function(_0xd9cfb6){return _0xd9cfb6;});}return null;};}function removeEntity(_0x74c379){return function(_0x3355c6){if(_0x3355c6){return _0x3355c6['destroy']()['then'](function(){var _0x4ba49e=_0x3355c6[_0xb0e4('0x12')]({'plain':!![]});var _0x41b3c1=_0xb0e4('0x13');return db[_0xb0e4('0x14')][_0xb0e4('0x15')]({'where':{'type':_0x41b3c1,'resourceId':_0x4ba49e['id']}})[_0xb0e4('0x11')](function(){return _0x3355c6;});})['then'](function(){return createAgiSocket();})[_0xb0e4('0x11')](function(_0x459684){_0x459684[_0xb0e4('0x9')](JSON[_0xb0e4('0x16')]({'id':_0x3355c6['id'],'deleted':!![]}));})['then'](function(){_0x74c379[_0xb0e4('0x8')](0xcc)[_0xb0e4('0x9')]();});}};}function handleEntityNotFound(_0x52b55e){return function(_0x2663f3){if(!_0x2663f3){_0x52b55e[_0xb0e4('0x17')](0x194);}return _0x2663f3;};}function handleError(_0xe6a9cf,_0x5dc075){_0x5dc075=_0x5dc075||0x1f4;return function(_0x1a6810){logger['error'](_0x1a6810['stack']);if(_0x1a6810[_0xb0e4('0x18')]){delete _0x1a6810[_0xb0e4('0x18')];}_0xe6a9cf[_0xb0e4('0x8')](_0x5dc075)[_0xb0e4('0x19')](_0x1a6810);};}function createAgiSocket(){try{var _0x13781c=require(_0xb0e4('0x1a'));var _0x6665e=new _0x13781c['Socket']();return _0x6665e[_0xb0e4('0x1b')](config['agi'][_0xb0e4('0x1c')]||0x11dd,_0xb0e4('0x1d'));}catch(_0x37b2fc){throw _0x37b2fc;}}exports[_0xb0e4('0x1e')]=function(_0x4fc624,_0x1ed356){var _0x2ccef1={},_0x15d402={},_0x451008={'count':0x0,'rows':[]};var _0x447f41=_[_0xb0e4('0x1f')](db[_0xb0e4('0x20')][_0xb0e4('0x21')],function(_0x4e1f2f){return{'name':_0x4e1f2f[_0xb0e4('0x22')],'type':_0x4e1f2f['type'][_0xb0e4('0x23')]};});_0x15d402[_0xb0e4('0x24')]=_['map'](_0x447f41,_0xb0e4('0x18'));_0x15d402[_0xb0e4('0x25')]=_[_0xb0e4('0x26')](_0x4fc624[_0xb0e4('0x25')]);_0x15d402[_0xb0e4('0x27')]=_[_0xb0e4('0x28')](_0x15d402['model'],_0x15d402[_0xb0e4('0x25')]);_0x2ccef1['attributes']=_['intersection'](_0x15d402[_0xb0e4('0x24')],qs['fields'](_0x4fc624[_0xb0e4('0x25')]['fields']));_0x2ccef1[_0xb0e4('0x29')]=_0x2ccef1['attributes'][_0xb0e4('0x2a')]?_0x2ccef1[_0xb0e4('0x29')]:_0x15d402[_0xb0e4('0x24')];if(!_0x4fc624['query'][_0xb0e4('0x2b')]('nolimit')){_0x2ccef1[_0xb0e4('0xd')]=qs[_0xb0e4('0xd')](_0x4fc624[_0xb0e4('0x25')][_0xb0e4('0xd')]);_0x2ccef1[_0xb0e4('0xb')]=qs['offset'](_0x4fc624[_0xb0e4('0x25')]['offset']);}_0x2ccef1[_0xb0e4('0x2c')]=qs[_0xb0e4('0x2d')](_0x4fc624[_0xb0e4('0x25')]['sort']);_0x2ccef1[_0xb0e4('0x2e')]=qs[_0xb0e4('0x27')](_[_0xb0e4('0x2f')](_0x4fc624[_0xb0e4('0x25')],_0x15d402['filters']),_0x447f41);if(_0x4fc624['query']['filter']){_0x2ccef1['where']=_[_0xb0e4('0x30')](_0x2ccef1['where'],{'$or':_[_0xb0e4('0x1f')](_0x447f41,function(_0x49b45f){if(_0x49b45f[_0xb0e4('0x31')]!=='VIRTUAL'){var _0x5d4af8={};_0x5d4af8[_0x49b45f[_0xb0e4('0x18')]]={'$like':'%'+_0x4fc624[_0xb0e4('0x25')][_0xb0e4('0x32')]+'%'};return _0x5d4af8;}})});}_0x2ccef1=_['merge']({},_0x2ccef1,_0x4fc624[_0xb0e4('0x33')]);var _0x137d33={'where':_0x2ccef1['where']};return db[_0xb0e4('0x20')]['count'](_0x137d33)[_0xb0e4('0x11')](function(_0x15d92c){_0x451008['count']=_0x15d92c;if(_0x4fc624[_0xb0e4('0x25')]['includeAll']){_0x2ccef1['include']=[{'all':!![]}];}return db['SquareProject'][_0xb0e4('0x34')](_0x2ccef1);})[_0xb0e4('0x11')](function(_0x5d2d60){_0x451008[_0xb0e4('0x35')]=_0x5d2d60;return _0x451008;})['then'](respondWithFilteredResult(_0x1ed356,_0x2ccef1))[_0xb0e4('0x36')](handleError(_0x1ed356,null));};exports[_0xb0e4('0x37')]=function(_0x2a5c01,_0x3b8cb7){var _0x4b1975={'raw':![],'where':{'id':_0x2a5c01[_0xb0e4('0x38')]['id']}},_0x610856={};_0x610856[_0xb0e4('0x24')]=_[_0xb0e4('0x26')](db[_0xb0e4('0x20')][_0xb0e4('0x21')]);_0x610856[_0xb0e4('0x25')]=_[_0xb0e4('0x26')](_0x2a5c01[_0xb0e4('0x25')]);_0x610856[_0xb0e4('0x27')]=_[_0xb0e4('0x28')](_0x610856[_0xb0e4('0x24')],_0x610856[_0xb0e4('0x25')]);_0x4b1975[_0xb0e4('0x29')]=_[_0xb0e4('0x28')](_0x610856[_0xb0e4('0x24')],qs['fields'](_0x2a5c01[_0xb0e4('0x25')][_0xb0e4('0x39')]));_0x4b1975[_0xb0e4('0x29')]=_0x4b1975[_0xb0e4('0x29')]['length']?_0x4b1975[_0xb0e4('0x29')]:_0x610856[_0xb0e4('0x24')];if(_0x2a5c01['query'][_0xb0e4('0x3a')]){_0x4b1975[_0xb0e4('0x3b')]=[{'all':!![]}];}_0x4b1975=_[_0xb0e4('0x30')]({},_0x4b1975,_0x2a5c01[_0xb0e4('0x33')]);return db['SquareProject'][_0xb0e4('0x3c')](_0x4b1975)[_0xb0e4('0x11')](handleEntityNotFound(_0x3b8cb7,null))[_0xb0e4('0x11')](respondWithResult(_0x3b8cb7,null))[_0xb0e4('0x36')](handleError(_0x3b8cb7,null));};exports[_0xb0e4('0x3d')]=function(_0x2ffb16,_0x2a5b12){return db[_0xb0e4('0x20')][_0xb0e4('0x3d')](_0x2ffb16[_0xb0e4('0x3e')],{})[_0xb0e4('0x11')](function(_0x5b04a4){var _0x24128c=_0x2ffb16[_0xb0e4('0x3f')]['get']({'plain':!![]});if(!_0x24128c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24128c['role']===_0xb0e4('0x3f')){var _0x335b20=_0x5b04a4['get']({'plain':!![]});var _0x484d19='SquareProjects';return db['UserProfileSection']['find']({'where':{'name':_0x484d19,'userProfileId':_0x24128c['userProfileId']},'raw':!![]})[_0xb0e4('0x11')](function(_0x52f7c5){if(_0x52f7c5&&_0x52f7c5[_0xb0e4('0x40')]===0x0){return db[_0xb0e4('0x14')][_0xb0e4('0x3d')]({'name':_0x335b20[_0xb0e4('0x18')],'resourceId':_0x335b20['id'],'type':_0x52f7c5['name'],'sectionId':_0x52f7c5['id']},{})[_0xb0e4('0x11')](function(){return _0x5b04a4;});}else{return _0x5b04a4;}})[_0xb0e4('0x36')](function(_0x47eff5){logger[_0xb0e4('0x41')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47eff5);throw _0x47eff5;});}return _0x5b04a4;})[_0xb0e4('0x11')](respondWithResult(_0x2a5b12,0xc9))[_0xb0e4('0x36')](handleError(_0x2a5b12,null));};exports[_0xb0e4('0x10')]=function(_0x2e2b07,_0x4b1d48){if(_0x2e2b07[_0xb0e4('0x3e')]['id']){delete _0x2e2b07[_0xb0e4('0x3e')]['id'];}return db[_0xb0e4('0x20')][_0xb0e4('0x3c')]({'where':{'id':_0x2e2b07['params']['id']}})[_0xb0e4('0x11')](handleEntityNotFound(_0x4b1d48,null))[_0xb0e4('0x11')](saveUpdates(_0x2e2b07[_0xb0e4('0x3e')],null))['then'](function(_0x4970a8){if(!_0x4970a8)return;var _0x58a4fe=_0x4970a8['get']({'plain':!![]});return _0x58a4fe;})['then'](function(_0x288582){var _0x5c18c6=new Redis(config[_0xb0e4('0x4')]);_0x5c18c6[_0xb0e4('0x42')](_0xb0e4('0x43'),JSON[_0xb0e4('0x16')](_['pick'](_0x288582,['id',_0xb0e4('0x18'),_0xb0e4('0x44')])));return _0x288582;})['then'](respondWithResult(_0x4b1d48,null))[_0xb0e4('0x36')](handleError(_0x4b1d48,null));};exports['destroy']=function(_0x2a2b9d,_0x581366){return db[_0xb0e4('0x20')]['find']({'where':{'id':_0x2a2b9d[_0xb0e4('0x38')]['id']}})[_0xb0e4('0x11')](handleEntityNotFound(_0x581366,null))['then'](removeEntity(_0x581366,null))[_0xb0e4('0x36')](handleError(_0x581366,null));};exports[_0xb0e4('0x45')]=function(_0x4cf438,_0x4d0a0d){return db[_0xb0e4('0x20')][_0xb0e4('0x3c')]({'where':{'id':_0x4cf438[_0xb0e4('0x38')]['id']}})['then'](handleEntityNotFound(_0x4d0a0d,null))[_0xb0e4('0x11')](function(_0xf318df){if(_0xf318df){return _0xf318df['addUsers'](_0x4cf438[_0xb0e4('0x3e')][_0xb0e4('0x46')],_['omit'](_0x4cf438[_0xb0e4('0x3e')],[_0xb0e4('0x46'),'id'])||{});}})[_0xb0e4('0x11')](respondWithResult(_0x4d0a0d,null))['catch'](handleError(_0x4d0a0d,null));};exports[_0xb0e4('0x47')]=function(_0x37c800,_0x43af54){return db[_0xb0e4('0x20')]['find']({'where':{'id':_0x37c800[_0xb0e4('0x38')]['id']}})[_0xb0e4('0x11')](handleEntityNotFound(_0x43af54,null))[_0xb0e4('0x11')](function(_0x33a5fc){if(_0x33a5fc){return _0x33a5fc[_0xb0e4('0x47')](_0x37c800[_0xb0e4('0x25')][_0xb0e4('0x46')])['then'](function(){if(_['isArray'](_0x37c800[_0xb0e4('0x25')][_0xb0e4('0x46')])){for(var _0x2b8e35=0x0;_0x2b8e35<_0x37c800[_0xb0e4('0x25')][_0xb0e4('0x46')][_0xb0e4('0x2a')];_0x2b8e35+=0x1){socket[_0xb0e4('0x48')](_0xb0e4('0x49'),{'UserId':Number(_0x37c800[_0xb0e4('0x25')][_0xb0e4('0x46')][_0x2b8e35]),'SquareProjectId':Number(_0x37c800[_0xb0e4('0x38')]['id'])});}}else{socket[_0xb0e4('0x48')](_0xb0e4('0x49'),{'UserId':Number(_0x37c800[_0xb0e4('0x25')][_0xb0e4('0x46')]),'SquareProjectId':Number(_0x37c800[_0xb0e4('0x38')]['id'])});}});}})['then'](respondWithStatusCode(_0x43af54,null))['catch'](handleError(_0x43af54,null));};exports[_0xb0e4('0x4a')]=function(_0x1203a2,_0x34ee55){var _0x3a7d66={};var _0x2b7f33={};var _0x5c3d56;var _0x572e39;return db[_0xb0e4('0x20')][_0xb0e4('0x4b')]({'where':{'id':_0x1203a2[_0xb0e4('0x38')]['id']}})['then'](handleEntityNotFound(_0x34ee55,null))[_0xb0e4('0x11')](function(_0x2764ce){if(_0x2764ce){_0x5c3d56=_0x2764ce;_0x2b7f33['model']=_['keys'](db[_0xb0e4('0x4c')]['rawAttributes']);_0x2b7f33[_0xb0e4('0x25')]=_[_0xb0e4('0x26')](_0x1203a2[_0xb0e4('0x25')]);_0x2b7f33[_0xb0e4('0x27')]=_[_0xb0e4('0x28')](_0x2b7f33[_0xb0e4('0x24')],_0x2b7f33[_0xb0e4('0x25')]);_0x3a7d66[_0xb0e4('0x29')]=_[_0xb0e4('0x28')](_0x2b7f33[_0xb0e4('0x24')],qs[_0xb0e4('0x39')](_0x1203a2['query'][_0xb0e4('0x39')]));_0x3a7d66[_0xb0e4('0x29')]=_0x3a7d66[_0xb0e4('0x29')][_0xb0e4('0x2a')]?_0x3a7d66[_0xb0e4('0x29')]:_0x2b7f33[_0xb0e4('0x24')];_0x3a7d66[_0xb0e4('0x2c')]=qs[_0xb0e4('0x2d')](_0x1203a2['query'][_0xb0e4('0x2d')]);_0x3a7d66[_0xb0e4('0x2e')]=qs[_0xb0e4('0x27')](_[_0xb0e4('0x2f')](_0x1203a2[_0xb0e4('0x25')],_0x2b7f33[_0xb0e4('0x27')]));if(_0x1203a2[_0xb0e4('0x25')][_0xb0e4('0x32')]){_0x3a7d66[_0xb0e4('0x2e')]=_['merge'](_0x3a7d66[_0xb0e4('0x2e')],{'$or':_['map'](_0x3a7d66[_0xb0e4('0x29')],function(_0x56d9e0){var _0x4fabed={};_0x4fabed[_0x56d9e0]={'$like':'%'+_0x1203a2['query'][_0xb0e4('0x32')]+'%'};return _0x4fabed;})});}_0x3a7d66=_[_0xb0e4('0x30')]({},_0x3a7d66,_0x1203a2[_0xb0e4('0x33')]);return _0x5c3d56[_0xb0e4('0x4a')](_0x3a7d66);}})[_0xb0e4('0x11')](function(_0x157d14){if(_0x157d14){_0x572e39=_0x157d14[_0xb0e4('0x2a')];if(!_0x1203a2['query'][_0xb0e4('0x2b')]('nolimit')){_0x3a7d66[_0xb0e4('0xd')]=qs['limit'](_0x1203a2['query'][_0xb0e4('0xd')]);_0x3a7d66['offset']=qs['offset'](_0x1203a2[_0xb0e4('0x25')][_0xb0e4('0xb')]);}return _0x5c3d56[_0xb0e4('0x4a')](_0x3a7d66);}})[_0xb0e4('0x11')](function(_0x567866){if(_0x567866){return _0x567866?{'count':_0x572e39,'rows':_0x567866}:null;}})[_0xb0e4('0x11')](respondWithResult(_0x34ee55,null))[_0xb0e4('0x36')](handleError(_0x34ee55,null));};
\ No newline at end of file
index 75ed72e..caa9f1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1260=['exports','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','hook'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1260,0x111));var _0x0126=function(_0x1951a9,_0x4fbb1e){_0x1951a9=_0x1951a9-0x0;var _0x321dbb=_0x1260[_0x1951a9];return _0x321dbb;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x0126('0x0'))['db'][_0x0126('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x0126('0x2')](0x0);var events={'afterCreate':_0x0126('0x3'),'afterUpdate':_0x0126('0x4'),'afterDestroy':_0x0126('0x5')};function emitEvent(_0x1b4191){return function(_0x1ea157,_0xb3b03f,_0x249677){SquareProjectEvents['emit'](_0x1b4191+':'+_0x1ea157['id'],_0x1ea157);SquareProjectEvents['emit'](_0x1b4191,_0x1ea157);_0x249677(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x0126('0x6')](e,emitEvent(event));}}module[_0x0126('0x7')]=SquareProjectEvents;
\ No newline at end of file
+var _0xedb5=['emit','hasOwnProperty','hook','exports','../../mysqldb','update','remove'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xedb5,0x89));var _0x5edb=function(_0x325aad,_0x35c3d0){_0x325aad=_0x325aad-0x0;var _0x2f8045=_0xedb5[_0x325aad];return _0x2f8045;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x5edb('0x0'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5edb('0x1'),'afterDestroy':_0x5edb('0x2')};function emitEvent(_0x16fc85){return function(_0x329ab3,_0x834546,_0x57bbd9){SquareProjectEvents[_0x5edb('0x3')](_0x16fc85+':'+_0x329ab3['id'],_0x329ab3);SquareProjectEvents[_0x5edb('0x3')](_0x16fc85,_0x329ab3);_0x57bbd9(null);};}for(var e in events){if(events[_0x5edb('0x4')](e)){var event=events[e];SquareProject[_0x5edb('0x5')](e,emitEvent(event));}}module[_0x5edb('0x6')]=SquareProjectEvents;
\ No newline at end of file
index b4e8966..6d29387 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0dd1=['publishedAt','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed'];(function(_0xdb01a,_0x54a83a){var _0x107ede=function(_0x98f457){while(--_0x98f457){_0xdb01a['push'](_0xdb01a['shift']());}};_0x107ede(++_0x54a83a);}(_0x0dd1,0x169));var _0x10dd=function(_0x1886b2,_0x447454){_0x1886b2=_0x1886b2-0x0;var _0x91557a=_0x0dd1[_0x1886b2];return _0x91557a;};'use strict';var _=require(_0x10dd('0x0'));var util=require(_0x10dd('0x1'));var logger=require(_0x10dd('0x2'))(_0x10dd('0x3'));var moment=require('moment');var BPromise=require(_0x10dd('0x4'));var rp=require(_0x10dd('0x5'));var fs=require('fs');var path=require(_0x10dd('0x6'));var rimraf=require(_0x10dd('0x7'));var config=require(_0x10dd('0x8'));var attributes=require(_0x10dd('0x9'));module[_0x10dd('0xa')]=function(_0x5945ed,_0x5e6d37){return _0x5945ed[_0x10dd('0xb')](_0x10dd('0xc'),attributes,{'tableName':_0x10dd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d440b,_0x2207e2,_0xaa3ae0){if(_0x4d440b['changed'](_0x10dd('0xe'))){_0x4d440b[_0x10dd('0xf')]=moment()[_0x10dd('0x10')](_0x10dd('0x11'));}if(_0x4d440b[_0x10dd('0x12')]('production')){_0x4d440b[_0x10dd('0x13')]=moment()[_0x10dd('0x10')](_0x10dd('0x11'));}_0xaa3ae0(null,_0x4d440b);}}});};
\ No newline at end of file
+var _0x2193=['square_projects','changed','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x13b527,_0x11d948){var _0x3e2aa9=function(_0x192762){while(--_0x192762){_0x13b527['push'](_0x13b527['shift']());}};_0x3e2aa9(++_0x11d948);}(_0x2193,0x1a6));var _0x3219=function(_0x3109d8,_0xc8ff38){_0x3109d8=_0x3109d8-0x0;var _0x3a9a0f=_0x2193[_0x3109d8];return _0x3a9a0f;};'use strict';var _=require(_0x3219('0x0'));var util=require(_0x3219('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3219('0x2'));var BPromise=require(_0x3219('0x3'));var rp=require(_0x3219('0x4'));var fs=require('fs');var path=require(_0x3219('0x5'));var rimraf=require(_0x3219('0x6'));var config=require(_0x3219('0x7'));var attributes=require('./squareProject.attributes');module[_0x3219('0x8')]=function(_0x8afd72,_0xf83c55){return _0x8afd72[_0x3219('0x9')]('SquareProject',attributes,{'tableName':_0x3219('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc7e41e,_0x2e42b7,_0x2bf19e){if(_0xc7e41e[_0x3219('0xb')]('preproduction')){_0xc7e41e['savedAt']=moment()[_0x3219('0xc')](_0x3219('0xd'));}if(_0xc7e41e[_0x3219('0xb')](_0x3219('0xe'))){_0xc7e41e[_0x3219('0xf')]=moment()[_0x3219('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2bf19e(null,_0xc7e41e);}}});};
\ No newline at end of file
index 10e944b..504d8a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6215=['info','debug','lodash','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','catch','error','message','ShowSquareProject','find'];(function(_0x3b0ad2,_0x432d90){var _0x4ebddf=function(_0x58b876){while(--_0x58b876){_0x3b0ad2['push'](_0x3b0ad2['shift']());}};_0x4ebddf(++_0x432d90);}(_0x6215,0x195));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5621('0x0'));var Redis=require('ioredis');var db=require(_0x5621('0x1'))['db'];var logger=require(_0x5621('0x2'))(_0x5621('0x3'));var config=require(_0x5621('0x4'));config[_0x5621('0x5')]=_[_0x5621('0x6')](config[_0x5621('0x5')],{'host':_0x5621('0x7'),'port':0x18eb});var socket=require(_0x5621('0x8'))(new Redis(config['redis']));require(_0x5621('0x9'))[_0x5621('0xa')](socket);exports[_0x5621('0xb')]=function(_0x1ec347){var _0x592a59=this;return new Promise(function(_0xf33a91,_0x3de27a){return db[_0x5621('0xc')][_0x5621('0xd')]({'raw':_0x1ec347[_0x5621('0xe')]?_0x1ec347[_0x5621('0xe')][_0x5621('0xf')]===undefined?!![]:![]:!![],'where':_0x1ec347[_0x5621('0xe')]?_0x1ec347['options'][_0x5621('0x10')]||null:null,'attributes':_0x1ec347[_0x5621('0xe')]?_0x1ec347[_0x5621('0xe')][_0x5621('0x11')]||null:null,'limit':_0x1ec347[_0x5621('0xe')]?_0x1ec347[_0x5621('0xe')][_0x5621('0x12')]||null:null,'include':_0x1ec347['options']?_0x1ec347['options'][_0x5621('0x13')]?_[_0x5621('0x14')](_0x1ec347['options']['include'],function(_0x5316ee){return{'model':db[_0x5316ee[_0x5621('0x15')]],'as':_0x5316ee['as'],'attributes':_0x5316ee[_0x5621('0x11')],'include':_0x5316ee[_0x5621('0x13')]?_[_0x5621('0x14')](_0x5316ee['include'],function(_0x334d65){return{'model':db[_0x334d65[_0x5621('0x15')]],'as':_0x334d65['as'],'attributes':_0x334d65[_0x5621('0x11')],'include':_0x334d65[_0x5621('0x13')]?_[_0x5621('0x14')](_0x334d65[_0x5621('0x13')],function(_0x56ad61){return{'model':db[_0x56ad61[_0x5621('0x15')]],'as':_0x56ad61['as'],'attributes':_0x56ad61[_0x5621('0x11')]};}):[]};}):[]};}):[]:[]})[_0x5621('0x16')](function(_0x132d95){logger['info']('GetSquareProjects',_0x1ec347);logger['debug'](_0x5621('0xb'),_0x1ec347,JSON[_0x5621('0x17')](_0x132d95));_0xf33a91(_0x132d95);})[_0x5621('0x18')](function(_0x2a3686){logger[_0x5621('0x19')](_0x5621('0xb'),_0x2a3686['message'],_0x1ec347);_0x3de27a(_0x592a59[_0x5621('0x19')](0x1f4,_0x2a3686[_0x5621('0x1a')]));});});};exports[_0x5621('0x1b')]=function(_0x3b0faf){var _0x105ebd=this;return new Promise(function(_0xa37998,_0x4b49e4){return db[_0x5621('0xc')][_0x5621('0x1c')]({'raw':_0x3b0faf['options']?_0x3b0faf['options'][_0x5621('0xf')]===undefined?!![]:![]:!![],'where':_0x3b0faf[_0x5621('0xe')]?_0x3b0faf[_0x5621('0xe')][_0x5621('0x10')]||null:null,'attributes':_0x3b0faf[_0x5621('0xe')]?_0x3b0faf[_0x5621('0xe')][_0x5621('0x11')]||null:null,'include':_0x3b0faf[_0x5621('0xe')]?_0x3b0faf[_0x5621('0xe')][_0x5621('0x13')]?_[_0x5621('0x14')](_0x3b0faf[_0x5621('0xe')]['include'],function(_0xbf5e77){return{'model':db[_0xbf5e77[_0x5621('0x15')]],'as':_0xbf5e77['as'],'attributes':_0xbf5e77['attributes'],'include':_0xbf5e77['include']?_[_0x5621('0x14')](_0xbf5e77['include'],function(_0x55c348){return{'model':db[_0x55c348[_0x5621('0x15')]],'as':_0x55c348['as'],'attributes':_0x55c348['attributes'],'include':_0x55c348[_0x5621('0x13')]?_[_0x5621('0x14')](_0x55c348[_0x5621('0x13')],function(_0x15a558){return{'model':db[_0x15a558[_0x5621('0x15')]],'as':_0x15a558['as'],'attributes':_0x15a558[_0x5621('0x11')]};}):[]};}):[]};}):[]:[]})[_0x5621('0x16')](function(_0x21a338){logger[_0x5621('0x1d')](_0x5621('0x1b'),_0x3b0faf);logger[_0x5621('0x1e')](_0x5621('0x1b'),_0x3b0faf,JSON[_0x5621('0x17')](_0x21a338));_0xa37998(_0x21a338);})[_0x5621('0x18')](function(_0xafaed9){logger['error'](_0x5621('0x1b'),_0xafaed9[_0x5621('0x1a')],_0x3b0faf);_0x4b49e4(_0x105ebd['error'](0x1f4,_0xafaed9[_0x5621('0x1a')]));});});};
\ No newline at end of file
+var _0xc760=['findAll','options','raw','limit','include','model','attributes','map','then','GetSquareProjects','debug','stringify','catch','error','message','ShowSquareProject','find','info','lodash','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','register'];(function(_0x4070fe,_0x4f253b){var _0x430c8b=function(_0x408c31){while(--_0x408c31){_0x4070fe['push'](_0x4070fe['shift']());}};_0x430c8b(++_0x4f253b);}(_0xc760,0x198));var _0x0c76=function(_0x27693a,_0x281f52){_0x27693a=_0x27693a-0x0;var _0x37dcbf=_0xc760[_0x27693a];return _0x37dcbf;};'use strict';var _=require(_0x0c76('0x0'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0x0c76('0x1'))(_0x0c76('0x2'));var config=require(_0x0c76('0x3'));config[_0x0c76('0x4')]=_[_0x0c76('0x5')](config[_0x0c76('0x4')],{'host':_0x0c76('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0c76('0x4')]));require('./squareProject.socket')[_0x0c76('0x7')](socket);exports['GetSquareProjects']=function(_0x31a8b0){var _0x4a9a68=this;return new Promise(function(_0x29b325,_0x4db0e0){return db['SquareProject'][_0x0c76('0x8')]({'raw':_0x31a8b0[_0x0c76('0x9')]?_0x31a8b0[_0x0c76('0x9')][_0x0c76('0xa')]===undefined?!![]:![]:!![],'where':_0x31a8b0[_0x0c76('0x9')]?_0x31a8b0['options']['where']||null:null,'attributes':_0x31a8b0[_0x0c76('0x9')]?_0x31a8b0[_0x0c76('0x9')]['attributes']||null:null,'limit':_0x31a8b0[_0x0c76('0x9')]?_0x31a8b0[_0x0c76('0x9')][_0x0c76('0xb')]||null:null,'include':_0x31a8b0['options']?_0x31a8b0[_0x0c76('0x9')][_0x0c76('0xc')]?_['map'](_0x31a8b0[_0x0c76('0x9')][_0x0c76('0xc')],function(_0x125973){return{'model':db[_0x125973[_0x0c76('0xd')]],'as':_0x125973['as'],'attributes':_0x125973[_0x0c76('0xe')],'include':_0x125973[_0x0c76('0xc')]?_[_0x0c76('0xf')](_0x125973['include'],function(_0x522e72){return{'model':db[_0x522e72[_0x0c76('0xd')]],'as':_0x522e72['as'],'attributes':_0x522e72[_0x0c76('0xe')],'include':_0x522e72[_0x0c76('0xc')]?_[_0x0c76('0xf')](_0x522e72[_0x0c76('0xc')],function(_0x37a90c){return{'model':db[_0x37a90c[_0x0c76('0xd')]],'as':_0x37a90c['as'],'attributes':_0x37a90c['attributes']};}):[]};}):[]};}):[]:[]})[_0x0c76('0x10')](function(_0x1d15a9){logger['info'](_0x0c76('0x11'),_0x31a8b0);logger[_0x0c76('0x12')](_0x0c76('0x11'),_0x31a8b0,JSON[_0x0c76('0x13')](_0x1d15a9));_0x29b325(_0x1d15a9);})[_0x0c76('0x14')](function(_0x1a1c4f){logger[_0x0c76('0x15')](_0x0c76('0x11'),_0x1a1c4f[_0x0c76('0x16')],_0x31a8b0);_0x4db0e0(_0x4a9a68['error'](0x1f4,_0x1a1c4f[_0x0c76('0x16')]));});});};exports[_0x0c76('0x17')]=function(_0x4ede18){var _0x30a410=this;return new Promise(function(_0x5d4e6e,_0xcaada){return db['SquareProject'][_0x0c76('0x18')]({'raw':_0x4ede18[_0x0c76('0x9')]?_0x4ede18[_0x0c76('0x9')][_0x0c76('0xa')]===undefined?!![]:![]:!![],'where':_0x4ede18[_0x0c76('0x9')]?_0x4ede18[_0x0c76('0x9')]['where']||null:null,'attributes':_0x4ede18[_0x0c76('0x9')]?_0x4ede18[_0x0c76('0x9')][_0x0c76('0xe')]||null:null,'include':_0x4ede18[_0x0c76('0x9')]?_0x4ede18[_0x0c76('0x9')][_0x0c76('0xc')]?_[_0x0c76('0xf')](_0x4ede18[_0x0c76('0x9')]['include'],function(_0x282263){return{'model':db[_0x282263['model']],'as':_0x282263['as'],'attributes':_0x282263[_0x0c76('0xe')],'include':_0x282263['include']?_[_0x0c76('0xf')](_0x282263[_0x0c76('0xc')],function(_0x5e67f5){return{'model':db[_0x5e67f5[_0x0c76('0xd')]],'as':_0x5e67f5['as'],'attributes':_0x5e67f5[_0x0c76('0xe')],'include':_0x5e67f5['include']?_['map'](_0x5e67f5['include'],function(_0x34f8a6){return{'model':db[_0x34f8a6[_0x0c76('0xd')]],'as':_0x34f8a6['as'],'attributes':_0x34f8a6[_0x0c76('0xe')]};}):[]};}):[]};}):[]:[]})[_0x0c76('0x10')](function(_0xb078b0){logger[_0x0c76('0x19')](_0x0c76('0x17'),_0x4ede18);logger[_0x0c76('0x12')]('ShowSquareProject',_0x4ede18,JSON['stringify'](_0xb078b0));_0x5d4e6e(_0xb078b0);})['catch'](function(_0x538c99){logger[_0x0c76('0x15')]('ShowSquareProject',_0x538c99[_0x0c76('0x16')],_0x4ede18);_0xcaada(_0x30a410[_0x0c76('0x15')](0x1f4,_0x538c99[_0x0c76('0x16')]));});});};
\ No newline at end of file
index 286e191..affdbbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c84=['squareProject:','./squareProject.events','remove','update','emit','removeListener','register'];(function(_0x18b34d,_0x1bd683){var _0x4ec0f3=function(_0x5cef8c){while(--_0x5cef8c){_0x18b34d['push'](_0x18b34d['shift']());}};_0x4ec0f3(++_0x1bd683);}(_0x6c84,0x143));var _0x46c8=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x6c84[_0x1cc8fe];return _0x230054;};'use strict';var SquareProjectEvents=require(_0x46c8('0x0'));var events=['save',_0x46c8('0x1'),_0x46c8('0x2')];function createListener(_0x237dc4,_0x20cf96){return function(_0x4026e5){_0x20cf96[_0x46c8('0x3')](_0x237dc4,_0x4026e5);};}function removeListener(_0x4b472a,_0x5e4373){return function(){SquareProjectEvents[_0x46c8('0x4')](_0x4b472a,_0x5e4373);};}exports[_0x46c8('0x5')]=function(_0x3f306b){for(var _0x3a61ae=0x0,_0xe9d0e0=events['length'];_0x3a61ae<_0xe9d0e0;_0x3a61ae++){var _0x10e41c=events[_0x3a61ae];var _0xa02c1a=createListener(_0x46c8('0x6')+_0x10e41c,_0x3f306b);SquareProjectEvents['on'](_0x10e41c,_0xa02c1a);}};
\ No newline at end of file
+var _0x02cd=['register','length','squareProject:','./squareProject.events','save','update','emit','removeListener'];(function(_0x9383a0,_0x101ba1){var _0x2c6913=function(_0x315c77){while(--_0x315c77){_0x9383a0['push'](_0x9383a0['shift']());}};_0x2c6913(++_0x101ba1);}(_0x02cd,0xcb));var _0xd02c=function(_0x5be3cc,_0x3b5c7d){_0x5be3cc=_0x5be3cc-0x0;var _0x1162a2=_0x02cd[_0x5be3cc];return _0x1162a2;};'use strict';var SquareProjectEvents=require(_0xd02c('0x0'));var events=[_0xd02c('0x1'),'remove',_0xd02c('0x2')];function createListener(_0xbc3416,_0x259c71){return function(_0x4bd189){_0x259c71[_0xd02c('0x3')](_0xbc3416,_0x4bd189);};}function removeListener(_0x59301b,_0x57827c){return function(){SquareProjectEvents[_0xd02c('0x4')](_0x59301b,_0x57827c);};}exports[_0xd02c('0x5')]=function(_0x2c198b){for(var _0x9ec4a9=0x0,_0x1dc714=events[_0xd02c('0x6')];_0x9ec4a9<_0x1dc714;_0x9ec4a9++){var _0xa1f68d=events[_0x9ec4a9];var _0x41032a=createListener(_0xd02c('0x7')+_0xa1f68d,_0x2c198b);SquareProjectEvents['on'](_0xa1f68d,_0x41032a);}};
\ No newline at end of file
index b4c5156..fcdf732 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x4dfdb8,_0x373ecd){var _0x14d433=function(_0x3238db){while(--_0x3238db){_0x4dfdb8['push'](_0x4dfdb8['shift']());}};_0x14d433(++_0x373ecd);}(_0x5fab,0x177));var _0xb5fa=function(_0x428f32,_0xba79ad){_0x428f32=_0x428f32-0x0;var _0x9e6f89=_0x5fab[_0x428f32];return _0x9e6f89;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x47c7fb,_0x1058a2){var _0x5f5abd=function(_0x5596b2){while(--_0x5596b2){_0x47c7fb['push'](_0x47c7fb['shift']());}};_0x5f5abd(++_0x1058a2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x5fc3[_0x397cfb];return _0x15fed9;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 13f467d..9799b93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8fb=['STRING','getDataValue','savePath','sequelize','exports'];(function(_0x371178,_0x405ea3){var _0x2c3791=function(_0x5f1026){while(--_0x5f1026){_0x371178['push'](_0x371178['shift']());}};_0x2c3791(++_0x405ea3);}(_0xd8fb,0x99));var _0xbd8f=function(_0x37595d,_0x1dcb15){_0x37595d=_0x37595d-0x0;var _0x45359a=_0xd8fb[_0x37595d];return _0x45359a;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'uniqueid':{'type':Sequelize[_0xbd8f('0x2')]},'callerid':{'type':Sequelize[_0xbd8f('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xbd8f('0x2')]},'accountcode':{'type':Sequelize[_0xbd8f('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xbd8f('0x2')]},'saveName':{'type':Sequelize[_0xbd8f('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xbd8f('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0xf503c4='';var _0x578499=this[_0xbd8f('0x3')](_0xbd8f('0x4'));if(_0x578499){_0xf503c4=_0x578499['substring'](_0x578499['lastIndexOf']('.'));}return _0xf503c4;}}};
\ No newline at end of file
+var _0xb4c7=['sequelize','exports','STRING','VIRTUAL','getDataValue','substring','lastIndexOf'];(function(_0x37cf5f,_0x13f8da){var _0x11e0ac=function(_0x29b23b){while(--_0x29b23b){_0x37cf5f['push'](_0x37cf5f['shift']());}};_0x11e0ac(++_0x13f8da);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x9f9cab,_0x1933f8){_0x9f9cab=_0x9f9cab-0x0;var _0x3c1998=_0xb4c7[_0x9f9cab];return _0x3c1998;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'uniqueid':{'type':Sequelize[_0x7b4c('0x2')]},'callerid':{'type':Sequelize[_0x7b4c('0x2')]},'calleridname':{'type':Sequelize[_0x7b4c('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x7b4c('0x2')]},'priority':{'type':Sequelize[_0x7b4c('0x2')]},'accountcode':{'type':Sequelize[_0x7b4c('0x2')]},'dnid':{'type':Sequelize[_0x7b4c('0x2')]},'projectName':{'type':Sequelize[_0x7b4c('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x7b4c('0x2')]},'savePath':{'type':Sequelize[_0x7b4c('0x2')]},'format':{'type':Sequelize[_0x7b4c('0x3')],'get':function(){var _0x4bf85d='';var _0x2d7b7e=this[_0x7b4c('0x4')]('savePath');if(_0x2d7b7e){_0x4bf85d=_0x2d7b7e[_0x7b4c('0x5')](_0x2d7b7e[_0x7b4c('0x6')]('.'));}return _0x4bf85d;}}};
\ No newline at end of file
index e1bc521..fa635f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc0d=['fields','include','find','create','body','update','params','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','findAll','catch','show'];(function(_0x21f786,_0x21f1a1){var _0x219702=function(_0x419d68){while(--_0x419d68){_0x21f786['push'](_0x21f786['shift']());}};_0x219702(++_0x21f1a1);}(_0xfc0d,0x13c));var _0xdfc0=function(_0x24c6ee,_0x3327d0){_0x24c6ee=_0x24c6ee-0x0;var _0x3ea0d7=_0xfc0d[_0x24c6ee];return _0x3ea0d7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdfc0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdfc0('0x1'));var rp=require(_0xdfc0('0x2'));var moment=require(_0xdfc0('0x3'));var BPromise=require(_0xdfc0('0x4'));var Mustache=require(_0xdfc0('0x5'));var util=require(_0xdfc0('0x6'));var path=require(_0xdfc0('0x7'));var sox=require('sox');var csv=require(_0xdfc0('0x8'));var ejs=require(_0xdfc0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdfc0('0xa'));var squel=require(_0xdfc0('0xb'));var crypto=require(_0xdfc0('0xc'));var jsforce=require(_0xdfc0('0xd'));var deskjs=require(_0xdfc0('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdfc0('0xf'));var Papa=require(_0xdfc0('0x10'));var Redis=require('ioredis');var authService=require(_0xdfc0('0x11'));var qs=require(_0xdfc0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdfc0('0x13'));var logger=require(_0xdfc0('0x14'))(_0xdfc0('0x15'));var utils=require(_0xdfc0('0x16'));var config=require(_0xdfc0('0x17'));var licenseUtil=require(_0xdfc0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cd867,_0x93a74c){_0x93a74c=_0x93a74c||0xcc;return function(_0x3b14a6){if(_0x3b14a6){return _0x1cd867['sendStatus'](_0x93a74c);}return _0x1cd867[_0xdfc0('0x19')](_0x93a74c)[_0xdfc0('0x1a')]();};}function respondWithResult(_0x55d5cd,_0xc229a2){_0xc229a2=_0xc229a2||0xc8;return function(_0x458dda){if(_0x458dda){return _0x55d5cd['status'](_0xc229a2)[_0xdfc0('0x1b')](_0x458dda);}};}function respondWithFilteredResult(_0x14902b,_0x469a31){return function(_0x1dc9ef){if(_0x1dc9ef){var _0x4e22de=typeof _0x469a31['offset']===_0xdfc0('0x1c')&&typeof _0x469a31[_0xdfc0('0x1d')]===_0xdfc0('0x1c');var _0x49c785=_0x1dc9ef[_0xdfc0('0x1e')];var _0xd3be0f=_0x4e22de?0x0:_0x469a31[_0xdfc0('0x1f')];var _0x25f9f6=_0x4e22de?_0x1dc9ef[_0xdfc0('0x1e')]:_0x469a31[_0xdfc0('0x1f')]+_0x469a31[_0xdfc0('0x1d')];var _0xcc1127;if(_0x25f9f6>=_0x49c785){_0x25f9f6=_0x49c785;_0xcc1127=0xc8;}else{_0xcc1127=0xce;}_0x14902b[_0xdfc0('0x19')](_0xcc1127);return _0x14902b[_0xdfc0('0x20')](_0xdfc0('0x21'),_0xd3be0f+'-'+_0x25f9f6+'/'+_0x49c785)[_0xdfc0('0x1b')](_0x1dc9ef);}return null;};}function patchUpdates(_0x58493f){return function(_0x44cebd){try{jsonpatch[_0xdfc0('0x22')](_0x44cebd,_0x58493f,!![]);}catch(_0x26d840){return BPromise[_0xdfc0('0x23')](_0x26d840);}return _0x44cebd[_0xdfc0('0x24')]();};}function saveUpdates(_0x17e01d,_0x4aa078){return function(_0x1dd805){if(_0x1dd805){return _0x1dd805['update'](_0x17e01d)[_0xdfc0('0x25')](function(_0x1e5dc1){return _0x1e5dc1;});}return null;};}function removeEntity(_0x55ceb8,_0x2de54b){return function(_0x37c370){if(_0x37c370){return _0x37c370[_0xdfc0('0x26')]()['then'](function(){_0x55ceb8[_0xdfc0('0x19')](0xcc)[_0xdfc0('0x1a')]();});}};}function handleEntityNotFound(_0x8956e8,_0x4aa636){return function(_0x4edc9b){if(!_0x4edc9b){_0x8956e8[_0xdfc0('0x27')](0x194);}return _0x4edc9b;};}function handleError(_0x1c3391,_0x3d550b){_0x3d550b=_0x3d550b||0x1f4;return function(_0x46e6cc){logger['error'](_0x46e6cc[_0xdfc0('0x28')]);if(_0x46e6cc[_0xdfc0('0x29')]){delete _0x46e6cc['name'];}_0x1c3391[_0xdfc0('0x19')](_0x3d550b)[_0xdfc0('0x2a')](_0x46e6cc);};}exports[_0xdfc0('0x2b')]=function(_0x38d469,_0x540c98){var _0x15b9a3={},_0x2bcdec={},_0x24a398={'count':0x0,'rows':[]};var _0x224523=_[_0xdfc0('0x2c')](db[_0xdfc0('0x2d')][_0xdfc0('0x2e')],function(_0x119a7a){return{'name':_0x119a7a[_0xdfc0('0x2f')],'type':_0x119a7a[_0xdfc0('0x30')][_0xdfc0('0x31')]};});_0x2bcdec[_0xdfc0('0x32')]=_['map'](_0x224523,_0xdfc0('0x29'));_0x2bcdec[_0xdfc0('0x33')]=_[_0xdfc0('0x34')](_0x38d469[_0xdfc0('0x33')]);_0x2bcdec['filters']=_[_0xdfc0('0x35')](_0x2bcdec[_0xdfc0('0x32')],_0x2bcdec[_0xdfc0('0x33')]);_0x15b9a3[_0xdfc0('0x36')]=_[_0xdfc0('0x35')](_0x2bcdec[_0xdfc0('0x32')],qs['fields'](_0x38d469[_0xdfc0('0x33')]['fields']));_0x15b9a3['attributes']=_0x15b9a3[_0xdfc0('0x36')][_0xdfc0('0x37')]?_0x15b9a3[_0xdfc0('0x36')]:_0x2bcdec['model'];if(!_0x38d469['query'][_0xdfc0('0x38')](_0xdfc0('0x39'))){_0x15b9a3[_0xdfc0('0x1d')]=qs[_0xdfc0('0x1d')](_0x38d469[_0xdfc0('0x33')][_0xdfc0('0x1d')]);_0x15b9a3[_0xdfc0('0x1f')]=qs[_0xdfc0('0x1f')](_0x38d469['query'][_0xdfc0('0x1f')]);}_0x15b9a3[_0xdfc0('0x3a')]=qs[_0xdfc0('0x3b')](_0x38d469['query'][_0xdfc0('0x3b')]);_0x15b9a3[_0xdfc0('0x3c')]=qs[_0xdfc0('0x3d')](_['pick'](_0x38d469[_0xdfc0('0x33')],_0x2bcdec[_0xdfc0('0x3d')]),_0x224523);if(_0x38d469[_0xdfc0('0x33')][_0xdfc0('0x3e')]){_0x15b9a3[_0xdfc0('0x3c')]=_[_0xdfc0('0x3f')](_0x15b9a3[_0xdfc0('0x3c')],{'$or':_[_0xdfc0('0x2c')](_0x224523,function(_0x540ccc){if(_0x540ccc[_0xdfc0('0x30')]!=='VIRTUAL'){var _0x4e0998={};_0x4e0998[_0x540ccc[_0xdfc0('0x29')]]={'$like':'%'+_0x38d469[_0xdfc0('0x33')]['filter']+'%'};return _0x4e0998;}})});}_0x15b9a3=_[_0xdfc0('0x3f')]({},_0x15b9a3,_0x38d469['options']);var _0x1c3521={'where':_0x15b9a3[_0xdfc0('0x3c')]};return db[_0xdfc0('0x2d')]['count'](_0x1c3521)[_0xdfc0('0x25')](function(_0x1a0fbe){_0x24a398[_0xdfc0('0x1e')]=_0x1a0fbe;if(_0x38d469['query'][_0xdfc0('0x40')]){_0x15b9a3['include']=[{'all':!![]}];}return db[_0xdfc0('0x2d')][_0xdfc0('0x41')](_0x15b9a3);})[_0xdfc0('0x25')](function(_0x29ab73){_0x24a398['rows']=_0x29ab73;return _0x24a398;})['then'](respondWithFilteredResult(_0x540c98,_0x15b9a3))[_0xdfc0('0x42')](handleError(_0x540c98,null));};exports[_0xdfc0('0x43')]=function(_0x115bdd,_0x37a1fe){var _0x4d69c3={'raw':!![],'where':{'id':_0x115bdd['params']['id']}},_0x5d36e2={};_0x5d36e2[_0xdfc0('0x32')]=_[_0xdfc0('0x34')](db['SquareRecording']['rawAttributes']);_0x5d36e2['query']=_[_0xdfc0('0x34')](_0x115bdd['query']);_0x5d36e2[_0xdfc0('0x3d')]=_[_0xdfc0('0x35')](_0x5d36e2[_0xdfc0('0x32')],_0x5d36e2[_0xdfc0('0x33')]);_0x4d69c3[_0xdfc0('0x36')]=_[_0xdfc0('0x35')](_0x5d36e2[_0xdfc0('0x32')],qs['fields'](_0x115bdd[_0xdfc0('0x33')][_0xdfc0('0x44')]));_0x4d69c3[_0xdfc0('0x36')]=_0x4d69c3[_0xdfc0('0x36')][_0xdfc0('0x37')]?_0x4d69c3['attributes']:_0x5d36e2[_0xdfc0('0x32')];if(_0x115bdd[_0xdfc0('0x33')][_0xdfc0('0x40')]){_0x4d69c3[_0xdfc0('0x45')]=[{'all':!![]}];}_0x4d69c3=_[_0xdfc0('0x3f')]({},_0x4d69c3,_0x115bdd['options']);return db[_0xdfc0('0x2d')][_0xdfc0('0x46')](_0x4d69c3)[_0xdfc0('0x25')](handleEntityNotFound(_0x37a1fe,null))[_0xdfc0('0x25')](respondWithResult(_0x37a1fe,null))[_0xdfc0('0x42')](handleError(_0x37a1fe,null));};exports[_0xdfc0('0x47')]=function(_0x5a056f,_0x5bf54d){return db['SquareRecording'][_0xdfc0('0x47')](_0x5a056f[_0xdfc0('0x48')],{})['then'](respondWithResult(_0x5bf54d,0xc9))['catch'](handleError(_0x5bf54d,null));};exports[_0xdfc0('0x49')]=function(_0x36b65d,_0x56871a){if(_0x36b65d[_0xdfc0('0x48')]['id']){delete _0x36b65d[_0xdfc0('0x48')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x36b65d['params']['id']}})[_0xdfc0('0x25')](handleEntityNotFound(_0x56871a,null))[_0xdfc0('0x25')](saveUpdates(_0x36b65d['body'],null))['then'](respondWithResult(_0x56871a,null))[_0xdfc0('0x42')](handleError(_0x56871a,null));};exports['download']=function(_0x170ab4,_0x3a013d,_0x642efc){var _0x1f105d=require('../../components/encryptor');var _0xe6d4c2=![];var _0x2ed917={};if(_0x170ab4[_0xdfc0('0x33')][_0xdfc0('0x30')]&&_0x170ab4[_0xdfc0('0x33')]['type']==='uniqueid'){_0x2ed917['uniqueid']=_0x170ab4[_0xdfc0('0x4a')]['id'];}else{_0x2ed917['id']=_0x170ab4[_0xdfc0('0x4a')]['id'];}return db[_0xdfc0('0x2d')][_0xdfc0('0x46')]({'where':_0x2ed917,'attributes':['id',_0xdfc0('0x4b'),_0xdfc0('0x4c')],'raw':!![]})[_0xdfc0('0x25')](handleEntityNotFound(_0x3a013d,null))['then'](function(_0x45fa1e){if(_0x45fa1e){var _0x511b49=_0x45fa1e[_0xdfc0('0x4b')];var _0x36fbd6=util[_0xdfc0('0x4d')](_0xdfc0('0x4e'),_0x511b49);if(fs[_0xdfc0('0x4f')](_0x36fbd6)){_0xe6d4c2=!![];return _0x1f105d[_0xdfc0('0x50')](_0x36fbd6,_0x511b49,config[_0xdfc0('0x51')][_0xdfc0('0x52')])[_0xdfc0('0x25')](function(){return _0x45fa1e;});}return _0x45fa1e;}})['then'](function(_0x1dfe89){if(_0x1dfe89){var _0xbf7b8b=_0x1dfe89[_0xdfc0('0x4b')];if(!fs[_0xdfc0('0x4f')](_0xbf7b8b)){throw new db[(_0xdfc0('0x53'))][(_0xdfc0('0x54'))](_0xdfc0('0x55'));}if(_0x1dfe89[_0xdfc0('0x4c')]){return _0x3a013d['download'](_0xbf7b8b,_0x1dfe89['filename']+path['extname'](_0xbf7b8b),function(){if(_0xe6d4c2){fs[_0xdfc0('0x56')](_0xbf7b8b);}});}else{return _0x3a013d['download'](_0xbf7b8b,function(_0x422346){if(_0xe6d4c2){fs[_0xdfc0('0x56')](_0xbf7b8b);}});}}})['catch'](function(_0x2026db){if(_0x2026db['message']===_0xdfc0('0x55')){_0x3a013d['status'](0x194)['send'](_0xdfc0('0x57'));}else{return handleError(_0x3a013d,null);}});};exports[_0xdfc0('0x26')]=function(_0x498a06,_0x44492a){return db[_0xdfc0('0x2d')][_0xdfc0('0x46')]({'where':{'id':_0x498a06[_0xdfc0('0x4a')]['id']}})[_0xdfc0('0x25')](function(_0x2084c1){if(_[_0xdfc0('0x58')](_0x2084c1)){throw new ReferenceError(_0xdfc0('0x59'));}return _0x2084c1;})['then'](function(_0x253ace){var _0x31bea9=_0x253ace[_0xdfc0('0x4b')];logger[_0xdfc0('0x5a')](_0xdfc0('0x5b'),_0x31bea9);if(!_[_0xdfc0('0x58')](_0x253ace[_0xdfc0('0x4b')])&&fs[_0xdfc0('0x4f')](_0x31bea9)){logger[_0xdfc0('0x5a')](_0xdfc0('0x5c')+_0x31bea9+_0xdfc0('0x5d'));fs[_0xdfc0('0x5e')](_0x31bea9);}_0x31bea9=_0x31bea9+_0xdfc0('0x5f');if(!_[_0xdfc0('0x58')](_0x253ace['savePath'])&&fs[_0xdfc0('0x4f')](_0x31bea9)){logger[_0xdfc0('0x5a')](_0xdfc0('0x5c')+_0x31bea9+_0xdfc0('0x5d'));fs[_0xdfc0('0x5e')](_0x31bea9);}return _0x253ace;})[_0xdfc0('0x25')](function(_0x22148e){if(!_0x22148e)throw new InternalError();return _0x22148e[_0xdfc0('0x26')]();})['then'](function(){_0x44492a[_0xdfc0('0x19')](0xcc)[_0xdfc0('0x1a')]();})[_0xdfc0('0x42')](handleError(_0x44492a,null));};
\ No newline at end of file
+var _0xf01f=['message','destroy','info','cancellazione\x20fisica\x20documento\x20%s','isNil','existsSync','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','send','index','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','where','merge','filter','options','SquareRecording','includeAll','include','findAll','rows','catch','show','params','create','find','../../components/encryptor','uniqueid','savePath','format','decryptFile','secrets','Sequelize','ValidationError','filename','extname','unlink','download'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xf01f,0x69));var _0xff01=function(_0x1f182e,_0x259cdf){_0x1f182e=_0x1f182e-0x0;var _0x157d6e=_0xf01f[_0x1f182e];return _0x157d6e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff01('0x0'));var zipdir=require(_0xff01('0x1'));var jsonpatch=require(_0xff01('0x2'));var rp=require(_0xff01('0x3'));var moment=require(_0xff01('0x4'));var BPromise=require(_0xff01('0x5'));var Mustache=require(_0xff01('0x6'));var util=require(_0xff01('0x7'));var path=require(_0xff01('0x8'));var sox=require(_0xff01('0x9'));var csv=require('to-csv');var ejs=require(_0xff01('0xa'));var fs=require('fs');var fs_extra=require(_0xff01('0xb'));var _=require(_0xff01('0xc'));var squel=require('squel');var crypto=require(_0xff01('0xd'));var jsforce=require(_0xff01('0xe'));var deskjs=require(_0xff01('0xf'));var toCsv=require(_0xff01('0x10'));var querystring=require(_0xff01('0x11'));var Papa=require('papaparse');var Redis=require(_0xff01('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xff01('0x13'));var as=require(_0xff01('0x14'));var hardwareService=require(_0xff01('0x15'));var logger=require('../../config/logger')(_0xff01('0x16'));var utils=require(_0xff01('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xff01('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19ab05,_0x27a26a){_0x27a26a=_0x27a26a||0xcc;return function(_0x4adef4){if(_0x4adef4){return _0x19ab05[_0xff01('0x19')](_0x27a26a);}return _0x19ab05[_0xff01('0x1a')](_0x27a26a)[_0xff01('0x1b')]();};}function respondWithResult(_0x4bdb76,_0x117f56){_0x117f56=_0x117f56||0xc8;return function(_0x4225b6){if(_0x4225b6){return _0x4bdb76[_0xff01('0x1a')](_0x117f56)['json'](_0x4225b6);}};}function respondWithFilteredResult(_0x1b2e58,_0x3f09e7){return function(_0x4fad05){if(_0x4fad05){var _0x3197ca=typeof _0x3f09e7['offset']===_0xff01('0x1c')&&typeof _0x3f09e7[_0xff01('0x1d')]==='undefined';var _0x5c36c9=_0x4fad05[_0xff01('0x1e')];var _0x1a4f7a=_0x3197ca?0x0:_0x3f09e7[_0xff01('0x1f')];var _0x1f2baa=_0x3197ca?_0x4fad05[_0xff01('0x1e')]:_0x3f09e7[_0xff01('0x1f')]+_0x3f09e7['limit'];var _0x5b0ec0;if(_0x1f2baa>=_0x5c36c9){_0x1f2baa=_0x5c36c9;_0x5b0ec0=0xc8;}else{_0x5b0ec0=0xce;}_0x1b2e58[_0xff01('0x1a')](_0x5b0ec0);return _0x1b2e58[_0xff01('0x20')](_0xff01('0x21'),_0x1a4f7a+'-'+_0x1f2baa+'/'+_0x5c36c9)['json'](_0x4fad05);}return null;};}function patchUpdates(_0x255a96){return function(_0x328530){try{jsonpatch[_0xff01('0x22')](_0x328530,_0x255a96,!![]);}catch(_0x17c266){return BPromise['reject'](_0x17c266);}return _0x328530[_0xff01('0x23')]();};}function saveUpdates(_0xaad106,_0x1998ea){return function(_0x28fa52){if(_0x28fa52){return _0x28fa52[_0xff01('0x24')](_0xaad106)[_0xff01('0x25')](function(_0xf8f9f7){return _0xf8f9f7;});}return null;};}function removeEntity(_0x1fc4bd,_0x589146){return function(_0x3bafdf){if(_0x3bafdf){return _0x3bafdf['destroy']()[_0xff01('0x25')](function(){_0x1fc4bd[_0xff01('0x1a')](0xcc)[_0xff01('0x1b')]();});}};}function handleEntityNotFound(_0x40807e,_0x462bcc){return function(_0xba419f){if(!_0xba419f){_0x40807e[_0xff01('0x19')](0x194);}return _0xba419f;};}function handleError(_0x42b740,_0x303228){_0x303228=_0x303228||0x1f4;return function(_0xb624ae){logger[_0xff01('0x26')](_0xb624ae[_0xff01('0x27')]);if(_0xb624ae[_0xff01('0x28')]){delete _0xb624ae[_0xff01('0x28')];}_0x42b740['status'](_0x303228)[_0xff01('0x29')](_0xb624ae);};}exports[_0xff01('0x2a')]=function(_0x134793,_0x4bdb96){var _0x3e918b={},_0x1ebab4={},_0x7b83c5={'count':0x0,'rows':[]};var _0x5584ed=_['map'](db['SquareRecording']['rawAttributes'],function(_0x22dfce){return{'name':_0x22dfce[_0xff01('0x2b')],'type':_0x22dfce[_0xff01('0x2c')][_0xff01('0x2d')]};});_0x1ebab4[_0xff01('0x2e')]=_[_0xff01('0x2f')](_0x5584ed,_0xff01('0x28'));_0x1ebab4['query']=_[_0xff01('0x30')](_0x134793[_0xff01('0x31')]);_0x1ebab4['filters']=_[_0xff01('0x32')](_0x1ebab4[_0xff01('0x2e')],_0x1ebab4[_0xff01('0x31')]);_0x3e918b['attributes']=_[_0xff01('0x32')](_0x1ebab4['model'],qs[_0xff01('0x33')](_0x134793[_0xff01('0x31')][_0xff01('0x33')]));_0x3e918b[_0xff01('0x34')]=_0x3e918b[_0xff01('0x34')][_0xff01('0x35')]?_0x3e918b['attributes']:_0x1ebab4[_0xff01('0x2e')];if(!_0x134793[_0xff01('0x31')][_0xff01('0x36')]('nolimit')){_0x3e918b[_0xff01('0x1d')]=qs[_0xff01('0x1d')](_0x134793[_0xff01('0x31')][_0xff01('0x1d')]);_0x3e918b['offset']=qs['offset'](_0x134793[_0xff01('0x31')][_0xff01('0x1f')]);}_0x3e918b[_0xff01('0x37')]=qs['sort'](_0x134793['query'][_0xff01('0x38')]);_0x3e918b['where']=qs[_0xff01('0x39')](_[_0xff01('0x3a')](_0x134793['query'],_0x1ebab4[_0xff01('0x39')]),_0x5584ed);if(_0x134793[_0xff01('0x31')]['filter']){_0x3e918b[_0xff01('0x3b')]=_[_0xff01('0x3c')](_0x3e918b[_0xff01('0x3b')],{'$or':_[_0xff01('0x2f')](_0x5584ed,function(_0x1e1c8f){if(_0x1e1c8f['type']!=='VIRTUAL'){var _0x534db5={};_0x534db5[_0x1e1c8f[_0xff01('0x28')]]={'$like':'%'+_0x134793['query'][_0xff01('0x3d')]+'%'};return _0x534db5;}})});}_0x3e918b=_[_0xff01('0x3c')]({},_0x3e918b,_0x134793[_0xff01('0x3e')]);var _0x17347f={'where':_0x3e918b[_0xff01('0x3b')]};return db[_0xff01('0x3f')]['count'](_0x17347f)[_0xff01('0x25')](function(_0x5f3865){_0x7b83c5[_0xff01('0x1e')]=_0x5f3865;if(_0x134793[_0xff01('0x31')][_0xff01('0x40')]){_0x3e918b[_0xff01('0x41')]=[{'all':!![]}];}return db[_0xff01('0x3f')][_0xff01('0x42')](_0x3e918b);})['then'](function(_0x19ce10){_0x7b83c5[_0xff01('0x43')]=_0x19ce10;return _0x7b83c5;})[_0xff01('0x25')](respondWithFilteredResult(_0x4bdb96,_0x3e918b))[_0xff01('0x44')](handleError(_0x4bdb96,null));};exports[_0xff01('0x45')]=function(_0x26d891,_0x384d48){var _0x515f52={'raw':!![],'where':{'id':_0x26d891[_0xff01('0x46')]['id']}},_0x18f574={};_0x18f574['model']=_[_0xff01('0x30')](db[_0xff01('0x3f')]['rawAttributes']);_0x18f574['query']=_[_0xff01('0x30')](_0x26d891['query']);_0x18f574[_0xff01('0x39')]=_[_0xff01('0x32')](_0x18f574[_0xff01('0x2e')],_0x18f574[_0xff01('0x31')]);_0x515f52['attributes']=_[_0xff01('0x32')](_0x18f574[_0xff01('0x2e')],qs[_0xff01('0x33')](_0x26d891['query']['fields']));_0x515f52['attributes']=_0x515f52[_0xff01('0x34')][_0xff01('0x35')]?_0x515f52[_0xff01('0x34')]:_0x18f574[_0xff01('0x2e')];if(_0x26d891[_0xff01('0x31')][_0xff01('0x40')]){_0x515f52['include']=[{'all':!![]}];}_0x515f52=_[_0xff01('0x3c')]({},_0x515f52,_0x26d891[_0xff01('0x3e')]);return db[_0xff01('0x3f')]['find'](_0x515f52)['then'](handleEntityNotFound(_0x384d48,null))[_0xff01('0x25')](respondWithResult(_0x384d48,null))[_0xff01('0x44')](handleError(_0x384d48,null));};exports[_0xff01('0x47')]=function(_0x229f08,_0x2eef23){return db[_0xff01('0x3f')]['create'](_0x229f08['body'],{})[_0xff01('0x25')](respondWithResult(_0x2eef23,0xc9))['catch'](handleError(_0x2eef23,null));};exports[_0xff01('0x24')]=function(_0x487a93,_0x3369d5){if(_0x487a93['body']['id']){delete _0x487a93['body']['id'];}return db[_0xff01('0x3f')][_0xff01('0x48')]({'where':{'id':_0x487a93[_0xff01('0x46')]['id']}})['then'](handleEntityNotFound(_0x3369d5,null))[_0xff01('0x25')](saveUpdates(_0x487a93['body'],null))[_0xff01('0x25')](respondWithResult(_0x3369d5,null))[_0xff01('0x44')](handleError(_0x3369d5,null));};exports['download']=function(_0x430dcc,_0x23e85f,_0x4b3663){var _0x3348d5=require(_0xff01('0x49'));var _0x5b89c3=![];var _0x38b6af={};if(_0x430dcc['query'][_0xff01('0x2c')]&&_0x430dcc['query']['type']===_0xff01('0x4a')){_0x38b6af[_0xff01('0x4a')]=_0x430dcc['params']['id'];}else{_0x38b6af['id']=_0x430dcc['params']['id'];}return db[_0xff01('0x3f')][_0xff01('0x48')]({'where':_0x38b6af,'attributes':['id',_0xff01('0x4b'),'filename'],'raw':!![]})[_0xff01('0x25')](handleEntityNotFound(_0x23e85f,null))['then'](function(_0x52e8d1){if(_0x52e8d1){var _0x4c0725=_0x52e8d1[_0xff01('0x4b')];var _0x29ca67=util[_0xff01('0x4c')]('%s.cypher',_0x4c0725);if(fs['existsSync'](_0x29ca67)){_0x5b89c3=!![];return _0x3348d5[_0xff01('0x4d')](_0x29ca67,_0x4c0725,config[_0xff01('0x4e')]['recording'])['then'](function(){return _0x52e8d1;});}return _0x52e8d1;}})[_0xff01('0x25')](function(_0x3098a1){if(_0x3098a1){var _0x2c8242=_0x3098a1['savePath'];if(!fs['existsSync'](_0x2c8242)){throw new db[(_0xff01('0x4f'))][(_0xff01('0x50'))]('SquareRecording\x20not\x20found');}if(_0x3098a1['filename']){return _0x23e85f['download'](_0x2c8242,_0x3098a1[_0xff01('0x51')]+path[_0xff01('0x52')](_0x2c8242),function(){if(_0x5b89c3){fs[_0xff01('0x53')](_0x2c8242);}});}else{return _0x23e85f[_0xff01('0x54')](_0x2c8242,function(_0xd5e5d1){if(_0x5b89c3){fs['unlink'](_0x2c8242);}});}}})[_0xff01('0x44')](function(_0x191066){if(_0x191066[_0xff01('0x55')]==='SquareRecording\x20not\x20found'){_0x23e85f[_0xff01('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x23e85f,null);}});};exports[_0xff01('0x56')]=function(_0x3dbd53,_0x50a3cb){return db[_0xff01('0x3f')][_0xff01('0x48')]({'where':{'id':_0x3dbd53[_0xff01('0x46')]['id']}})[_0xff01('0x25')](function(_0x567b28){if(_['isNil'](_0x567b28)){throw new ReferenceError('Entity\x20not\x20found');}return _0x567b28;})[_0xff01('0x25')](function(_0x4da6e3){var _0x1da0be=_0x4da6e3[_0xff01('0x4b')];logger[_0xff01('0x57')](_0xff01('0x58'),_0x1da0be);if(!_[_0xff01('0x59')](_0x4da6e3[_0xff01('0x4b')])&&fs[_0xff01('0x5a')](_0x1da0be)){logger['info'](_0xff01('0x5b')+_0x1da0be+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xff01('0x5c')](_0x1da0be);}_0x1da0be=_0x1da0be+_0xff01('0x5d');if(!_[_0xff01('0x59')](_0x4da6e3['savePath'])&&fs[_0xff01('0x5a')](_0x1da0be)){logger[_0xff01('0x57')](_0xff01('0x5b')+_0x1da0be+_0xff01('0x5e'));fs[_0xff01('0x5c')](_0x1da0be);}return _0x4da6e3;})[_0xff01('0x25')](function(_0x5e0fa4){if(!_0x5e0fa4)throw new InternalError();return _0x5e0fa4[_0xff01('0x56')]();})[_0xff01('0x25')](function(){_0x50a3cb[_0xff01('0x1a')](0xcc)['end']();})[_0xff01('0x44')](handleError(_0x50a3cb,null));};
\ No newline at end of file
index 156501b..5c362d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3974=['square_recordings','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x353eeb,_0x2b72f1){var _0x311f1a=function(_0x112da7){while(--_0x112da7){_0x353eeb['push'](_0x353eeb['shift']());}};_0x311f1a(++_0x2b72f1);}(_0x3974,0xbc));var _0x4397=function(_0x1ccc60,_0x3f0d43){_0x1ccc60=_0x1ccc60-0x0;var _0x4acd63=_0x3974[_0x1ccc60];return _0x4acd63;};'use strict';var _=require(_0x4397('0x0'));var util=require(_0x4397('0x1'));var logger=require(_0x4397('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4397('0x3'));var rp=require(_0x4397('0x4'));var fs=require('fs');var path=require(_0x4397('0x5'));var rimraf=require(_0x4397('0x6'));var config=require(_0x4397('0x7'));var attributes=require('./squareRecording.attributes');module[_0x4397('0x8')]=function(_0x2bf887,_0x32f617){return _0x2bf887[_0x4397('0x9')]('SquareRecording',attributes,{'tableName':_0x4397('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf9ac=['api','moment','request-promise','rimraf','exports','define','square_recordings','lodash'];(function(_0x4bccb4,_0x765452){var _0x3b056e=function(_0x2f85b7){while(--_0x2f85b7){_0x4bccb4['push'](_0x4bccb4['shift']());}};_0x3b056e(++_0x765452);}(_0xf9ac,0x87));var _0xcf9a=function(_0x343f18,_0x1bc8c1){_0x343f18=_0x343f18-0x0;var _0x2e3288=_0xf9ac[_0x343f18];return _0x2e3288;};'use strict';var _=require(_0xcf9a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcf9a('0x1'));var moment=require(_0xcf9a('0x2'));var BPromise=require('bluebird');var rp=require(_0xcf9a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcf9a('0x4'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module[_0xcf9a('0x5')]=function(_0x3d77c8,_0x158971){return _0x3d77c8[_0xcf9a('0x6')]('SquareRecording',attributes,{'tableName':_0xcf9a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 021cae8..4306197 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa196=['SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','CreateSquareRecording','SquareRecording','create','body','options','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x4058d9,_0x240215){var _0x184d87=function(_0x4d731d){while(--_0x4d731d){_0x4058d9['push'](_0x4058d9['shift']());}};_0x184d87(++_0x240215);}(_0xa196,0x10b));var _0x6a19=function(_0x27144b,_0xc6c4dd){_0x27144b=_0x27144b-0x0;var _0x5b5ea6=_0xa196[_0x27144b];return _0x5b5ea6;};'use strict';var _=require(_0x6a19('0x0'));var util=require(_0x6a19('0x1'));var moment=require(_0x6a19('0x2'));var BPromise=require(_0x6a19('0x3'));var rs=require(_0x6a19('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a19('0x5'))['db'];var utils=require(_0x6a19('0x6'));var logger=require(_0x6a19('0x7'))(_0x6a19('0x8'));var config=require(_0x6a19('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6a19('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38a59f,_0x5ba956,_0x968770){return new BPromise(function(_0x336d7f,_0x162745){return client[_0x6a19('0xb')](_0x38a59f,_0x968770)[_0x6a19('0xc')](function(_0x14b4f4){logger['info'](_0x6a19('0xd'),_0x5ba956,_0x6a19('0xe'));logger[_0x6a19('0xf')](_0x6a19('0x10'),_0x5ba956,_0x6a19('0xe'),JSON['stringify'](_0x14b4f4));if(_0x14b4f4[_0x6a19('0x11')]){if(_0x14b4f4[_0x6a19('0x11')][_0x6a19('0x12')]===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x5ba956,_0x14b4f4[_0x6a19('0x11')][_0x6a19('0x13')]);return _0x162745(_0x14b4f4['error'][_0x6a19('0x13')]);}logger[_0x6a19('0x11')]('SquareRecording,\x20%s,\x20%s',_0x5ba956,_0x14b4f4[_0x6a19('0x11')]['message']);return _0x336d7f(_0x14b4f4[_0x6a19('0x11')][_0x6a19('0x13')]);}else{logger[_0x6a19('0x14')](_0x6a19('0xd'),_0x5ba956,_0x6a19('0xe'));_0x336d7f(_0x14b4f4['result'][_0x6a19('0x13')]);}})[_0x6a19('0x15')](function(_0x20650c){logger[_0x6a19('0x11')](_0x6a19('0xd'),_0x5ba956,_0x20650c);_0x162745(_0x20650c);});});}exports[_0x6a19('0x16')]=function(_0x4ddf0e){var _0x588aef=this;return new Promise(function(_0x3e158a,_0x3278b7){return db[_0x6a19('0x17')][_0x6a19('0x18')](_0x4ddf0e[_0x6a19('0x19')],{'raw':_0x4ddf0e[_0x6a19('0x1a')]?_0x4ddf0e[_0x6a19('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x6a19('0xc')](function(_0x39a7ff){logger['info'](_0x6a19('0x16'),_0x4ddf0e);logger[_0x6a19('0xf')](_0x6a19('0x16'),_0x4ddf0e,JSON[_0x6a19('0x1b')](_0x39a7ff));_0x3e158a(_0x39a7ff);})[_0x6a19('0x15')](function(_0x2db03a){logger['error'](_0x6a19('0x16'),_0x2db03a[_0x6a19('0x13')],_0x4ddf0e);_0x3278b7(_0x588aef[_0x6a19('0x11')](0x1f4,_0x2db03a[_0x6a19('0x13')]));});});};
\ No newline at end of file
+var _0xb7db=['../../config/environment','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3c3644,_0x4af276){var _0x8d321f=function(_0x5889e6){while(--_0x5889e6){_0x3c3644['push'](_0x3c3644['shift']());}};_0x8d321f(++_0x4af276);}(_0xb7db,0x68));var _0xbb7d=function(_0x427514,_0x550970){_0x427514=_0x427514-0x0;var _0x2f05e0=_0xb7db[_0x427514];return _0x2f05e0;};'use strict';var _=require(_0xbb7d('0x0'));var util=require(_0xbb7d('0x1'));var moment=require('moment');var BPromise=require(_0xbb7d('0x2'));var rs=require(_0xbb7d('0x3'));var fs=require('fs');var Redis=require(_0xbb7d('0x4'));var db=require(_0xbb7d('0x5'))['db'];var utils=require(_0xbb7d('0x6'));var logger=require('../../config/logger')(_0xbb7d('0x7'));var config=require(_0xbb7d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x295186,_0x114ea3,_0x295ee6){return new BPromise(function(_0x58b565,_0x4e8b11){return client[_0xbb7d('0xa')](_0x295186,_0x295ee6)[_0xbb7d('0xb')](function(_0x58611a){logger[_0xbb7d('0xc')](_0xbb7d('0xd'),_0x114ea3,_0xbb7d('0xe'));logger[_0xbb7d('0xf')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x114ea3,_0xbb7d('0xe'),JSON[_0xbb7d('0x10')](_0x58611a));if(_0x58611a[_0xbb7d('0x11')]){if(_0x58611a['error'][_0xbb7d('0x12')]===0x1f4){logger[_0xbb7d('0x11')](_0xbb7d('0xd'),_0x114ea3,_0x58611a['error'][_0xbb7d('0x13')]);return _0x4e8b11(_0x58611a[_0xbb7d('0x11')][_0xbb7d('0x13')]);}logger[_0xbb7d('0x11')](_0xbb7d('0xd'),_0x114ea3,_0x58611a[_0xbb7d('0x11')][_0xbb7d('0x13')]);return _0x58b565(_0x58611a['error']['message']);}else{logger[_0xbb7d('0xc')](_0xbb7d('0xd'),_0x114ea3,'request\x20sent');_0x58b565(_0x58611a[_0xbb7d('0x14')]['message']);}})[_0xbb7d('0x15')](function(_0x4589ca){logger[_0xbb7d('0x11')](_0xbb7d('0xd'),_0x114ea3,_0x4589ca);_0x4e8b11(_0x4589ca);});});}exports[_0xbb7d('0x16')]=function(_0x7c9fe3){var _0x44770a=this;return new Promise(function(_0x51c39a,_0x33ca23){return db[_0xbb7d('0x17')][_0xbb7d('0x18')](_0x7c9fe3[_0xbb7d('0x19')],{'raw':_0x7c9fe3[_0xbb7d('0x1a')]?_0x7c9fe3['options'][_0xbb7d('0x1b')]===undefined?!![]:![]:!![]})[_0xbb7d('0xb')](function(_0x11eb7f){logger[_0xbb7d('0xc')](_0xbb7d('0x16'),_0x7c9fe3);logger[_0xbb7d('0xf')](_0xbb7d('0x16'),_0x7c9fe3,JSON[_0xbb7d('0x10')](_0x11eb7f));_0x51c39a(_0x11eb7f);})[_0xbb7d('0x15')](function(_0x3c5b01){logger[_0xbb7d('0x11')]('CreateSquareRecording',_0x3c5b01[_0xbb7d('0x13')],_0x7c9fe3);_0x33ca23(_0x44770a[_0xbb7d('0x11')](0x1f4,_0x3c5b01[_0xbb7d('0x13')]));});});};
\ No newline at end of file
index 430a5eb..2b30763 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x86ab75,_0x43839d){var _0x2f4411=function(_0x1c3071){while(--_0x1c3071){_0x86ab75['push'](_0x86ab75['shift']());}};_0x2f4411(++_0x43839d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router;
\ No newline at end of file
+var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x4119f1,_0x1c078b){var _0xd2c589=function(_0x5f2e66){while(--_0x5f2e66){_0x4119f1['push'](_0x4119f1['shift']());}};_0xd2c589(++_0x1c078b);}(_0xe706,0xa3));var _0x6e70=function(_0x529a0f,_0x328763){_0x529a0f=_0x529a0f-0x0;var _0x187a88=_0xe706[_0x529a0f];return _0x187a88;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router;
\ No newline at end of file
index 6a45420..6a9a603 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8fa=['STRING','DATE','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb8fa,0x10d));var _0xab8f=function(_0x18e74f,_0x208653){_0x18e74f=_0x18e74f-0x0;var _0x281980=_0xb8fa[_0x18e74f];return _0x281980;};'use strict';var Sequelize=require('sequelize');module[_0xab8f('0x0')]={'network':{'type':Sequelize[_0xab8f('0x1')]},'network_script':{'type':Sequelize[_0xab8f('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xab8f('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xab8f('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xab8f('0x1')]},'callingani2':{'type':Sequelize[_0xab8f('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xab8f('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xab8f('0x1')]},'context':{'type':Sequelize[_0xab8f('0x1')]},'extension':{'type':Sequelize[_0xab8f('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xab8f('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xab8f('0x1')]},'joinAt':{'type':Sequelize[_0xab8f('0x2')]},'leaveAt':{'type':Sequelize[_0xab8f('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xcb6d=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xcb6d,0xc8));var _0xdcb6=function(_0x5b6e65,_0xe820f7){_0x5b6e65=_0x5b6e65-0x0;var _0x3ea8d6=_0xcb6d[_0x5b6e65];return _0x3ea8d6;};'use strict';var Sequelize=require(_0xdcb6('0x0'));module[_0xdcb6('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xdcb6('0x2')]},'channel':{'type':Sequelize[_0xdcb6('0x2')]},'language':{'type':Sequelize[_0xdcb6('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xdcb6('0x2')]},'version':{'type':Sequelize[_0xdcb6('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xdcb6('0x2')]},'callingani2':{'type':Sequelize[_0xdcb6('0x2')]},'callington':{'type':Sequelize[_0xdcb6('0x2')]},'callingtns':{'type':Sequelize[_0xdcb6('0x2')]},'dnid':{'type':Sequelize[_0xdcb6('0x2')]},'rdnis':{'type':Sequelize[_0xdcb6('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xdcb6('0x2')]},'priority':{'type':Sequelize[_0xdcb6('0x2')]},'enhanced':{'type':Sequelize[_0xdcb6('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xdcb6('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xdcb6('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xdcb6('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 9a607dd..30e4411 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87c7=['key','keys','query','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','merge','map','VIRTUAL','options','then','includeAll','include','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','error','stack','name','send','index','SquareReport','rawAttributes','fieldName','type'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0x87c7,0x67));var _0x787c=function(_0x47e978,_0x5e9a72){_0x47e978=_0x47e978-0x0;var _0x4d8abf=_0x87c7[_0x47e978];return _0x4d8abf;};'use strict';var emlformat=require(_0x787c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x787c('0x1'));var jsonpatch=require(_0x787c('0x2'));var rp=require(_0x787c('0x3'));var moment=require(_0x787c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x787c('0x5'));var path=require(_0x787c('0x6'));var sox=require(_0x787c('0x7'));var csv=require(_0x787c('0x8'));var ejs=require(_0x787c('0x9'));var fs=require('fs');var fs_extra=require(_0x787c('0xa'));var _=require('lodash');var squel=require(_0x787c('0xb'));var crypto=require(_0x787c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x787c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x787c('0xe'));var Papa=require('papaparse');var Redis=require(_0x787c('0xf'));var authService=require(_0x787c('0x10'));var qs=require(_0x787c('0x11'));var as=require(_0x787c('0x12'));var hardwareService=require(_0x787c('0x13'));var logger=require(_0x787c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x787c('0x15'));var licenseUtil=require(_0x787c('0x16'));var db=require(_0x787c('0x17'))['db'];function respondWithStatusCode(_0x8e900d,_0x375174){_0x375174=_0x375174||0xcc;return function(_0x29046b){if(_0x29046b){return _0x8e900d[_0x787c('0x18')](_0x375174);}return _0x8e900d[_0x787c('0x19')](_0x375174)['end']();};}function respondWithResult(_0x452fab,_0xf20030){_0xf20030=_0xf20030||0xc8;return function(_0x37950c){if(_0x37950c){return _0x452fab[_0x787c('0x19')](_0xf20030)[_0x787c('0x1a')](_0x37950c);}};}function respondWithFilteredResult(_0x538fe9,_0x368015){return function(_0x3097b6){if(_0x3097b6){var _0x36e06a=typeof _0x368015[_0x787c('0x1b')]===_0x787c('0x1c')&&typeof _0x368015[_0x787c('0x1d')]===_0x787c('0x1c');var _0x43a03d=_0x3097b6[_0x787c('0x1e')];var _0x3514c5=_0x36e06a?0x0:_0x368015[_0x787c('0x1b')];var _0x5457c8=_0x36e06a?_0x3097b6[_0x787c('0x1e')]:_0x368015['offset']+_0x368015[_0x787c('0x1d')];var _0xb1a5ab;if(_0x5457c8>=_0x43a03d){_0x5457c8=_0x43a03d;_0xb1a5ab=0xc8;}else{_0xb1a5ab=0xce;}_0x538fe9['status'](_0xb1a5ab);return _0x538fe9[_0x787c('0x1f')](_0x787c('0x20'),_0x3514c5+'-'+_0x5457c8+'/'+_0x43a03d)[_0x787c('0x1a')](_0x3097b6);}return null;};}function patchUpdates(_0x36c3e1){return function(_0x2b8890){try{jsonpatch['apply'](_0x2b8890,_0x36c3e1,!![]);}catch(_0x4d2a61){return BPromise[_0x787c('0x21')](_0x4d2a61);}return _0x2b8890[_0x787c('0x22')]();};}function saveUpdates(_0x369349,_0x1ffda8){return function(_0x3170f9){if(_0x3170f9){return _0x3170f9[_0x787c('0x23')](_0x369349)['then'](function(_0x107db4){return _0x107db4;});}return null;};}function removeEntity(_0x303a18,_0xf22d51){return function(_0x466620){if(_0x466620){return _0x466620[_0x787c('0x24')]()['then'](function(){_0x303a18[_0x787c('0x19')](0xcc)[_0x787c('0x25')]();});}};}function handleEntityNotFound(_0x6578a4,_0x3d5be7){return function(_0x1af09a){if(!_0x1af09a){_0x6578a4[_0x787c('0x18')](0x194);}return _0x1af09a;};}function handleError(_0x3b7172,_0x1eda3d){_0x1eda3d=_0x1eda3d||0x1f4;return function(_0x4d7bf2){logger[_0x787c('0x26')](_0x4d7bf2[_0x787c('0x27')]);if(_0x4d7bf2[_0x787c('0x28')]){delete _0x4d7bf2[_0x787c('0x28')];}_0x3b7172[_0x787c('0x19')](_0x1eda3d)[_0x787c('0x29')](_0x4d7bf2);};}exports[_0x787c('0x2a')]=function(_0x301cc6,_0x46017f){var _0x176808={},_0x35adc2={},_0x2f0af0={'count':0x0,'rows':[]};var _0x314243=_['map'](db[_0x787c('0x2b')][_0x787c('0x2c')],function(_0x39d044){return{'name':_0x39d044[_0x787c('0x2d')],'type':_0x39d044[_0x787c('0x2e')][_0x787c('0x2f')]};});_0x35adc2['model']=_['map'](_0x314243,_0x787c('0x28'));_0x35adc2['query']=_[_0x787c('0x30')](_0x301cc6[_0x787c('0x31')]);_0x35adc2[_0x787c('0x32')]=_['intersection'](_0x35adc2['model'],_0x35adc2[_0x787c('0x31')]);_0x176808['attributes']=_[_0x787c('0x33')](_0x35adc2[_0x787c('0x34')],qs[_0x787c('0x35')](_0x301cc6[_0x787c('0x31')]['fields']));_0x176808[_0x787c('0x36')]=_0x176808[_0x787c('0x36')][_0x787c('0x37')]?_0x176808[_0x787c('0x36')]:_0x35adc2['model'];if(!_0x301cc6[_0x787c('0x31')]['hasOwnProperty']('nolimit')){_0x176808['limit']=qs['limit'](_0x301cc6[_0x787c('0x31')][_0x787c('0x1d')]);_0x176808[_0x787c('0x1b')]=qs['offset'](_0x301cc6[_0x787c('0x31')][_0x787c('0x1b')]);}_0x176808[_0x787c('0x38')]=qs[_0x787c('0x39')](_0x301cc6[_0x787c('0x31')]['sort']);_0x176808[_0x787c('0x3a')]=qs[_0x787c('0x32')](_[_0x787c('0x3b')](_0x301cc6[_0x787c('0x31')],_0x35adc2[_0x787c('0x32')]),_0x314243);if(_0x301cc6[_0x787c('0x31')][_0x787c('0x3c')]){_0x176808[_0x787c('0x3a')]=_[_0x787c('0x3d')](_0x176808[_0x787c('0x3a')],{'$or':_[_0x787c('0x3e')](_0x314243,function(_0xe16041){if(_0xe16041[_0x787c('0x2e')]!==_0x787c('0x3f')){var _0x1eb1be={};_0x1eb1be[_0xe16041[_0x787c('0x28')]]={'$like':'%'+_0x301cc6[_0x787c('0x31')][_0x787c('0x3c')]+'%'};return _0x1eb1be;}})});}_0x176808=_[_0x787c('0x3d')]({},_0x176808,_0x301cc6[_0x787c('0x40')]);var _0x350979={'where':_0x176808[_0x787c('0x3a')]};return db[_0x787c('0x2b')][_0x787c('0x1e')](_0x350979)[_0x787c('0x41')](function(_0x114308){_0x2f0af0['count']=_0x114308;if(_0x301cc6[_0x787c('0x31')][_0x787c('0x42')]){_0x176808[_0x787c('0x43')]=[{'all':!![]}];}return db[_0x787c('0x2b')]['findAll'](_0x176808);})[_0x787c('0x41')](function(_0x5a4c1c){_0x2f0af0['rows']=_0x5a4c1c;return _0x2f0af0;})[_0x787c('0x41')](respondWithFilteredResult(_0x46017f,_0x176808))[_0x787c('0x44')](handleError(_0x46017f,null));};exports[_0x787c('0x45')]=function(_0x4902ed,_0x4a7ac5){var _0xc728ea={'raw':!![],'where':{'id':_0x4902ed[_0x787c('0x46')]['id']}},_0x3b4511={};_0x3b4511[_0x787c('0x34')]=_[_0x787c('0x30')](db[_0x787c('0x2b')][_0x787c('0x2c')]);_0x3b4511['query']=_['keys'](_0x4902ed['query']);_0x3b4511[_0x787c('0x32')]=_[_0x787c('0x33')](_0x3b4511[_0x787c('0x34')],_0x3b4511[_0x787c('0x31')]);_0xc728ea[_0x787c('0x36')]=_['intersection'](_0x3b4511[_0x787c('0x34')],qs['fields'](_0x4902ed[_0x787c('0x31')][_0x787c('0x35')]));_0xc728ea[_0x787c('0x36')]=_0xc728ea[_0x787c('0x36')][_0x787c('0x37')]?_0xc728ea['attributes']:_0x3b4511[_0x787c('0x34')];if(_0x4902ed['query']['includeAll']){_0xc728ea[_0x787c('0x43')]=[{'all':!![]}];}_0xc728ea=_[_0x787c('0x3d')]({},_0xc728ea,_0x4902ed[_0x787c('0x40')]);return db['SquareReport'][_0x787c('0x47')](_0xc728ea)['then'](handleEntityNotFound(_0x4a7ac5,null))[_0x787c('0x41')](respondWithResult(_0x4a7ac5,null))['catch'](handleError(_0x4a7ac5,null));};exports[_0x787c('0x48')]=function(_0xb3702c,_0x3f7c4a){return db[_0x787c('0x2b')][_0x787c('0x48')](_0xb3702c[_0x787c('0x49')],{})[_0x787c('0x41')](respondWithResult(_0x3f7c4a,0xc9))[_0x787c('0x44')](handleError(_0x3f7c4a,null));};exports[_0x787c('0x23')]=function(_0x59b7b5,_0x7e2484){if(_0x59b7b5[_0x787c('0x49')]['id']){delete _0x59b7b5[_0x787c('0x49')]['id'];}return db['SquareReport'][_0x787c('0x47')]({'where':{'id':_0x59b7b5[_0x787c('0x46')]['id']}})[_0x787c('0x41')](handleEntityNotFound(_0x7e2484,null))[_0x787c('0x41')](saveUpdates(_0x59b7b5[_0x787c('0x49')],null))['then'](respondWithResult(_0x7e2484,null))[_0x787c('0x44')](handleError(_0x7e2484,null));};exports[_0x787c('0x24')]=function(_0x31076e,_0x549d32){return db['SquareReport'][_0x787c('0x47')]({'where':{'id':_0x31076e[_0x787c('0x46')]['id']}})[_0x787c('0x41')](handleEntityNotFound(_0x549d32,null))[_0x787c('0x41')](removeEntity(_0x549d32,null))[_0x787c('0x44')](handleError(_0x549d32,null));};exports[_0x787c('0x4a')]=function(_0x5d200b,_0x47f4c9){return db[_0x787c('0x2b')][_0x787c('0x4a')]()[_0x787c('0x41')](respondWithResult(_0x47f4c9,null))[_0x787c('0x44')](handleError(_0x47f4c9,null));};
\ No newline at end of file
+var _0xe264=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','SquareReport','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','intersection','options','create','body','update','find','params','describe'];(function(_0x203c8c,_0x2728e5){var _0x1e5322=function(_0x4f2814){while(--_0x4f2814){_0x203c8c['push'](_0x203c8c['shift']());}};_0x1e5322(++_0x2728e5);}(_0xe264,0x1c8));var _0x4e26=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0xe264[_0x737a1f];return _0x16eba1;};'use strict';var emlformat=require(_0x4e26('0x0'));var rimraf=require(_0x4e26('0x1'));var zipdir=require(_0x4e26('0x2'));var jsonpatch=require(_0x4e26('0x3'));var rp=require(_0x4e26('0x4'));var moment=require(_0x4e26('0x5'));var BPromise=require(_0x4e26('0x6'));var Mustache=require('mustache');var util=require(_0x4e26('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4e26('0x8'));var ejs=require(_0x4e26('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4e26('0xa'));var crypto=require(_0x4e26('0xb'));var jsforce=require(_0x4e26('0xc'));var deskjs=require(_0x4e26('0xd'));var toCsv=require(_0x4e26('0x8'));var querystring=require(_0x4e26('0xe'));var Papa=require(_0x4e26('0xf'));var Redis=require('ioredis');var authService=require(_0x4e26('0x10'));var qs=require(_0x4e26('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e26('0x12'));var logger=require(_0x4e26('0x13'))(_0x4e26('0x14'));var utils=require(_0x4e26('0x15'));var config=require(_0x4e26('0x16'));var licenseUtil=require(_0x4e26('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c8430,_0xae5f2e){_0xae5f2e=_0xae5f2e||0xcc;return function(_0x295d26){if(_0x295d26){return _0x1c8430[_0x4e26('0x18')](_0xae5f2e);}return _0x1c8430[_0x4e26('0x19')](_0xae5f2e)[_0x4e26('0x1a')]();};}function respondWithResult(_0x4e8f79,_0x45849d){_0x45849d=_0x45849d||0xc8;return function(_0x185b05){if(_0x185b05){return _0x4e8f79['status'](_0x45849d)[_0x4e26('0x1b')](_0x185b05);}};}function respondWithFilteredResult(_0x4861b0,_0x2e36c2){return function(_0x2eb553){if(_0x2eb553){var _0x8153a9=typeof _0x2e36c2[_0x4e26('0x1c')]===_0x4e26('0x1d')&&typeof _0x2e36c2[_0x4e26('0x1e')]==='undefined';var _0x5eb1c3=_0x2eb553[_0x4e26('0x1f')];var _0x406749=_0x8153a9?0x0:_0x2e36c2['offset'];var _0x50d630=_0x8153a9?_0x2eb553['count']:_0x2e36c2[_0x4e26('0x1c')]+_0x2e36c2[_0x4e26('0x1e')];var _0x3c441c;if(_0x50d630>=_0x5eb1c3){_0x50d630=_0x5eb1c3;_0x3c441c=0xc8;}else{_0x3c441c=0xce;}_0x4861b0[_0x4e26('0x19')](_0x3c441c);return _0x4861b0[_0x4e26('0x20')](_0x4e26('0x21'),_0x406749+'-'+_0x50d630+'/'+_0x5eb1c3)[_0x4e26('0x1b')](_0x2eb553);}return null;};}function patchUpdates(_0x38d62d){return function(_0x1d11d8){try{jsonpatch[_0x4e26('0x22')](_0x1d11d8,_0x38d62d,!![]);}catch(_0xd7959b){return BPromise['reject'](_0xd7959b);}return _0x1d11d8[_0x4e26('0x23')]();};}function saveUpdates(_0xb1f0c,_0x315c42){return function(_0x588f5a){if(_0x588f5a){return _0x588f5a['update'](_0xb1f0c)[_0x4e26('0x24')](function(_0x59e225){return _0x59e225;});}return null;};}function removeEntity(_0xb48171,_0x243a54){return function(_0x35696d){if(_0x35696d){return _0x35696d[_0x4e26('0x25')]()[_0x4e26('0x24')](function(){_0xb48171[_0x4e26('0x19')](0xcc)[_0x4e26('0x1a')]();});}};}function handleEntityNotFound(_0x5c095c,_0xb03d33){return function(_0x19b015){if(!_0x19b015){_0x5c095c['sendStatus'](0x194);}return _0x19b015;};}function handleError(_0x440ef1,_0x671c8a){_0x671c8a=_0x671c8a||0x1f4;return function(_0x3b0cf9){logger[_0x4e26('0x26')](_0x3b0cf9[_0x4e26('0x27')]);if(_0x3b0cf9[_0x4e26('0x28')]){delete _0x3b0cf9['name'];}_0x440ef1[_0x4e26('0x19')](_0x671c8a)[_0x4e26('0x29')](_0x3b0cf9);};}exports[_0x4e26('0x2a')]=function(_0x58ea96,_0xd0279a){var _0x521704={},_0x3b6c9b={},_0x526269={'count':0x0,'rows':[]};var _0x4503f3=_['map'](db[_0x4e26('0x2b')][_0x4e26('0x2c')],function(_0x2252ba){return{'name':_0x2252ba[_0x4e26('0x2d')],'type':_0x2252ba[_0x4e26('0x2e')][_0x4e26('0x2f')]};});_0x3b6c9b[_0x4e26('0x30')]=_['map'](_0x4503f3,_0x4e26('0x28'));_0x3b6c9b['query']=_[_0x4e26('0x31')](_0x58ea96['query']);_0x3b6c9b[_0x4e26('0x32')]=_['intersection'](_0x3b6c9b[_0x4e26('0x30')],_0x3b6c9b[_0x4e26('0x33')]);_0x521704[_0x4e26('0x34')]=_['intersection'](_0x3b6c9b[_0x4e26('0x30')],qs['fields'](_0x58ea96[_0x4e26('0x33')][_0x4e26('0x35')]));_0x521704[_0x4e26('0x34')]=_0x521704[_0x4e26('0x34')][_0x4e26('0x36')]?_0x521704[_0x4e26('0x34')]:_0x3b6c9b[_0x4e26('0x30')];if(!_0x58ea96['query'][_0x4e26('0x37')](_0x4e26('0x38'))){_0x521704[_0x4e26('0x1e')]=qs[_0x4e26('0x1e')](_0x58ea96[_0x4e26('0x33')][_0x4e26('0x1e')]);_0x521704[_0x4e26('0x1c')]=qs[_0x4e26('0x1c')](_0x58ea96[_0x4e26('0x33')][_0x4e26('0x1c')]);}_0x521704[_0x4e26('0x39')]=qs[_0x4e26('0x3a')](_0x58ea96[_0x4e26('0x33')][_0x4e26('0x3a')]);_0x521704[_0x4e26('0x3b')]=qs[_0x4e26('0x32')](_[_0x4e26('0x3c')](_0x58ea96[_0x4e26('0x33')],_0x3b6c9b[_0x4e26('0x32')]),_0x4503f3);if(_0x58ea96['query'][_0x4e26('0x3d')]){_0x521704[_0x4e26('0x3b')]=_[_0x4e26('0x3e')](_0x521704['where'],{'$or':_['map'](_0x4503f3,function(_0x18c63d){if(_0x18c63d[_0x4e26('0x2e')]!=='VIRTUAL'){var _0x42695f={};_0x42695f[_0x18c63d['name']]={'$like':'%'+_0x58ea96['query'][_0x4e26('0x3d')]+'%'};return _0x42695f;}})});}_0x521704=_['merge']({},_0x521704,_0x58ea96['options']);var _0x275dd0={'where':_0x521704[_0x4e26('0x3b')]};return db[_0x4e26('0x2b')][_0x4e26('0x1f')](_0x275dd0)[_0x4e26('0x24')](function(_0x213e9e){_0x526269[_0x4e26('0x1f')]=_0x213e9e;if(_0x58ea96[_0x4e26('0x33')][_0x4e26('0x3f')]){_0x521704[_0x4e26('0x40')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x521704);})['then'](function(_0x626629){_0x526269[_0x4e26('0x41')]=_0x626629;return _0x526269;})[_0x4e26('0x24')](respondWithFilteredResult(_0xd0279a,_0x521704))[_0x4e26('0x42')](handleError(_0xd0279a,null));};exports[_0x4e26('0x43')]=function(_0x4b65e2,_0x488f33){var _0x5e8c99={'raw':!![],'where':{'id':_0x4b65e2['params']['id']}},_0x16e687={};_0x16e687[_0x4e26('0x30')]=_[_0x4e26('0x31')](db['SquareReport'][_0x4e26('0x2c')]);_0x16e687['query']=_[_0x4e26('0x31')](_0x4b65e2[_0x4e26('0x33')]);_0x16e687['filters']=_['intersection'](_0x16e687[_0x4e26('0x30')],_0x16e687[_0x4e26('0x33')]);_0x5e8c99[_0x4e26('0x34')]=_[_0x4e26('0x44')](_0x16e687[_0x4e26('0x30')],qs[_0x4e26('0x35')](_0x4b65e2[_0x4e26('0x33')][_0x4e26('0x35')]));_0x5e8c99[_0x4e26('0x34')]=_0x5e8c99['attributes'][_0x4e26('0x36')]?_0x5e8c99[_0x4e26('0x34')]:_0x16e687[_0x4e26('0x30')];if(_0x4b65e2[_0x4e26('0x33')]['includeAll']){_0x5e8c99[_0x4e26('0x40')]=[{'all':!![]}];}_0x5e8c99=_['merge']({},_0x5e8c99,_0x4b65e2[_0x4e26('0x45')]);return db[_0x4e26('0x2b')]['find'](_0x5e8c99)['then'](handleEntityNotFound(_0x488f33,null))['then'](respondWithResult(_0x488f33,null))[_0x4e26('0x42')](handleError(_0x488f33,null));};exports[_0x4e26('0x46')]=function(_0x16a466,_0x581c2e){return db[_0x4e26('0x2b')][_0x4e26('0x46')](_0x16a466[_0x4e26('0x47')],{})[_0x4e26('0x24')](respondWithResult(_0x581c2e,0xc9))['catch'](handleError(_0x581c2e,null));};exports[_0x4e26('0x48')]=function(_0x28710d,_0x4013d7){if(_0x28710d[_0x4e26('0x47')]['id']){delete _0x28710d[_0x4e26('0x47')]['id'];}return db[_0x4e26('0x2b')][_0x4e26('0x49')]({'where':{'id':_0x28710d[_0x4e26('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4013d7,null))[_0x4e26('0x24')](saveUpdates(_0x28710d[_0x4e26('0x47')],null))['then'](respondWithResult(_0x4013d7,null))[_0x4e26('0x42')](handleError(_0x4013d7,null));};exports[_0x4e26('0x25')]=function(_0x5001ce,_0x382111){return db[_0x4e26('0x2b')][_0x4e26('0x49')]({'where':{'id':_0x5001ce['params']['id']}})['then'](handleEntityNotFound(_0x382111,null))[_0x4e26('0x24')](removeEntity(_0x382111,null))['catch'](handleError(_0x382111,null));};exports[_0x4e26('0x4b')]=function(_0x13a6a2,_0x3b7a5f){return db[_0x4e26('0x2b')][_0x4e26('0x4b')]()[_0x4e26('0x24')](respondWithResult(_0x3b7a5f,null))['catch'](handleError(_0x3b7a5f,null));};
\ No newline at end of file
index 9ac4a87..a1b9fcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32dd=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uid_pname','leaveAt'];(function(_0x167c51,_0x368c03){var _0x48253d=function(_0x389212){while(--_0x389212){_0x167c51['push'](_0x167c51['shift']());}};_0x48253d(++_0x368c03);}(_0x32dd,0x1ce));var _0xd32d=function(_0x36176e,_0x3719b7){_0x36176e=_0x36176e-0x0;var _0xbe79bc=_0x32dd[_0x36176e];return _0xbe79bc;};'use strict';var _=require(_0xd32d('0x0'));var util=require(_0xd32d('0x1'));var logger=require(_0xd32d('0x2'))(_0xd32d('0x3'));var moment=require(_0xd32d('0x4'));var BPromise=require('bluebird');var rp=require(_0xd32d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd32d('0x6'));var config=require(_0xd32d('0x7'));var attributes=require(_0xd32d('0x8'));module['exports']=function(_0x3a4a97,_0x2e8b22){return _0x3a4a97[_0xd32d('0x9')](_0xd32d('0xa'),attributes,{'tableName':_0xd32d('0xb'),'paranoid':![],'indexes':[{'name':_0xd32d('0xc'),'fields':['uniqueid','project_name']},{'name':_0xd32d('0xd'),'fields':[_0xd32d('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5759=['../../config/logger','api','moment','path','rimraf','./squareReport.attributes','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x5759,0xd1));var _0x9575=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x5759[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x9575('0x0'));var util=require('util');var logger=require(_0x9575('0x1'))(_0x9575('0x2'));var moment=require(_0x9575('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9575('0x4'));var rimraf=require(_0x9575('0x5'));var config=require('../../config/environment');var attributes=require(_0x9575('0x6'));module['exports']=function(_0x52ea78,_0x27a3ad){return _0x52ea78[_0x9575('0x7')](_0x9575('0x8'),attributes,{'tableName':_0x9575('0x9'),'paranoid':![],'indexes':[{'name':_0x9575('0xa'),'fields':[_0x9575('0xb'),_0x9575('0xc')]},{'name':_0x9575('0xd'),'fields':[_0x9575('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index bc9fdca..a2c5b7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90c5=['rpc','../../config/environment','jayson/promise','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','create','body','options','UpdateSquareReport','attributes','limit','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4abbc8,_0x56168f){var _0x114408=function(_0x53c045){while(--_0x53c045){_0x4abbc8['push'](_0x4abbc8['shift']());}};_0x114408(++_0x56168f);}(_0x90c5,0x75));var _0x590c=function(_0x2ce171,_0x5a2303){_0x2ce171=_0x2ce171-0x0;var _0x54a006=_0x90c5[_0x2ce171];return _0x54a006;};'use strict';var _=require(_0x590c('0x0'));var util=require(_0x590c('0x1'));var moment=require(_0x590c('0x2'));var BPromise=require('bluebird');var rs=require(_0x590c('0x3'));var fs=require('fs');var Redis=require(_0x590c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x590c('0x5'));var logger=require(_0x590c('0x6'))(_0x590c('0x7'));var config=require(_0x590c('0x8'));var jayson=require(_0x590c('0x9'));var client=jayson['client'][_0x590c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c1490,_0x6b8321,_0x485923){return new BPromise(function(_0x114884,_0x16eabb){return client[_0x590c('0xb')](_0x5c1490,_0x485923)[_0x590c('0xc')](function(_0x4ce0d9){logger[_0x590c('0xd')](_0x590c('0xe'),_0x6b8321,_0x590c('0xf'));logger[_0x590c('0x10')](_0x590c('0x11'),_0x6b8321,_0x590c('0xf'),JSON['stringify'](_0x4ce0d9));if(_0x4ce0d9['error']){if(_0x4ce0d9[_0x590c('0x12')][_0x590c('0x13')]===0x1f4){logger['error'](_0x590c('0xe'),_0x6b8321,_0x4ce0d9[_0x590c('0x12')][_0x590c('0x14')]);return _0x16eabb(_0x4ce0d9[_0x590c('0x12')][_0x590c('0x14')]);}logger[_0x590c('0x12')]('SquareReport,\x20%s,\x20%s',_0x6b8321,_0x4ce0d9[_0x590c('0x12')]['message']);return _0x114884(_0x4ce0d9['error'][_0x590c('0x14')]);}else{logger[_0x590c('0xd')](_0x590c('0xe'),_0x6b8321,_0x590c('0xf'));_0x114884(_0x4ce0d9['result'][_0x590c('0x14')]);}})[_0x590c('0x15')](function(_0x23ce11){logger[_0x590c('0x12')](_0x590c('0xe'),_0x6b8321,_0x23ce11);_0x16eabb(_0x23ce11);});});}exports[_0x590c('0x16')]=function(_0x460259){var _0x553a9d=this;return new Promise(function(_0x3fb87f,_0x383bf6){return db[_0x590c('0x17')][_0x590c('0x18')](_0x460259[_0x590c('0x19')],{'raw':_0x460259[_0x590c('0x1a')]?_0x460259[_0x590c('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x590c('0xc')](function(_0x2d0c33){logger[_0x590c('0xd')](_0x590c('0x16'),_0x460259);logger[_0x590c('0x10')](_0x590c('0x16'),_0x460259,JSON['stringify'](_0x2d0c33));_0x3fb87f(_0x2d0c33);})[_0x590c('0x15')](function(_0x5e113d){logger['error']('CreateSquareReport',_0x5e113d[_0x590c('0x14')],_0x460259);_0x383bf6(_0x553a9d[_0x590c('0x12')](0x1f4,_0x5e113d[_0x590c('0x14')]));});});};exports[_0x590c('0x1b')]=function(_0x1598c6){var _0x304810=this;return new Promise(function(_0x1c2270,_0x22b4eb){return db[_0x590c('0x17')]['update'](_0x1598c6[_0x590c('0x19')],{'raw':_0x1598c6[_0x590c('0x1a')]?_0x1598c6['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1598c6[_0x590c('0x1a')]?_0x1598c6['options']['where']||null:null,'attributes':_0x1598c6[_0x590c('0x1a')]?_0x1598c6['options'][_0x590c('0x1c')]||null:null,'limit':_0x1598c6[_0x590c('0x1a')]?_0x1598c6[_0x590c('0x1a')][_0x590c('0x1d')]||null:null})['then'](function(_0x595960){logger[_0x590c('0xd')]('UpdateSquareReport',_0x1598c6);logger[_0x590c('0x10')](_0x590c('0x1b'),_0x1598c6,JSON[_0x590c('0x1e')](_0x595960));_0x1c2270(_0x595960);})[_0x590c('0x15')](function(_0x4e8143){logger[_0x590c('0x12')](_0x590c('0x1b'),_0x4e8143[_0x590c('0x14')],_0x1598c6);_0x22b4eb(_0x304810[_0x590c('0x12')](0x1f4,_0x4e8143[_0x590c('0x14')]));});});};
\ No newline at end of file
+var _0xb4ef=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateSquareReport','SquareReport','options','raw','UpdateSquareReport','update','body','attributes','limit','lodash','moment','ioredis'];(function(_0x4c0d3c,_0x545995){var _0x40e3fd=function(_0x15d3c8){while(--_0x15d3c8){_0x4c0d3c['push'](_0x4c0d3c['shift']());}};_0x40e3fd(++_0x545995);}(_0xb4ef,0x1dd));var _0xfb4e=function(_0x2a4e60,_0x2c5626){_0x2a4e60=_0x2a4e60-0x0;var _0x36af4a=_0xb4ef[_0x2a4e60];return _0x36af4a;};'use strict';var _=require(_0xfb4e('0x0'));var util=require('util');var moment=require(_0xfb4e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb4e('0x2'));var db=require(_0xfb4e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb4e('0x4'))(_0xfb4e('0x5'));var config=require(_0xfb4e('0x6'));var jayson=require(_0xfb4e('0x7'));var client=jayson[_0xfb4e('0x8')][_0xfb4e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39f5ad,_0xdde8c6,_0xbe327){return new BPromise(function(_0x161dff,_0x46055c){return client[_0xfb4e('0xa')](_0x39f5ad,_0xbe327)[_0xfb4e('0xb')](function(_0x5084f5){logger[_0xfb4e('0xc')](_0xfb4e('0xd'),_0xdde8c6,_0xfb4e('0xe'));logger[_0xfb4e('0xf')]('SquareReport,\x20%s,\x20%s,\x20%s',_0xdde8c6,_0xfb4e('0xe'),JSON[_0xfb4e('0x10')](_0x5084f5));if(_0x5084f5[_0xfb4e('0x11')]){if(_0x5084f5[_0xfb4e('0x11')][_0xfb4e('0x12')]===0x1f4){logger[_0xfb4e('0x11')](_0xfb4e('0xd'),_0xdde8c6,_0x5084f5[_0xfb4e('0x11')][_0xfb4e('0x13')]);return _0x46055c(_0x5084f5[_0xfb4e('0x11')][_0xfb4e('0x13')]);}logger[_0xfb4e('0x11')](_0xfb4e('0xd'),_0xdde8c6,_0x5084f5[_0xfb4e('0x11')][_0xfb4e('0x13')]);return _0x161dff(_0x5084f5[_0xfb4e('0x11')][_0xfb4e('0x13')]);}else{logger[_0xfb4e('0xc')](_0xfb4e('0xd'),_0xdde8c6,'request\x20sent');_0x161dff(_0x5084f5['result'][_0xfb4e('0x13')]);}})[_0xfb4e('0x14')](function(_0x1da67a){logger['error'](_0xfb4e('0xd'),_0xdde8c6,_0x1da67a);_0x46055c(_0x1da67a);});});}exports[_0xfb4e('0x15')]=function(_0x5d9d38){var _0x11b590=this;return new Promise(function(_0x304a8e,_0x55df61){return db[_0xfb4e('0x16')]['create'](_0x5d9d38['body'],{'raw':_0x5d9d38['options']?_0x5d9d38[_0xfb4e('0x17')][_0xfb4e('0x18')]===undefined?!![]:![]:!![]})[_0xfb4e('0xb')](function(_0x140575){logger[_0xfb4e('0xc')](_0xfb4e('0x15'),_0x5d9d38);logger[_0xfb4e('0xf')](_0xfb4e('0x15'),_0x5d9d38,JSON[_0xfb4e('0x10')](_0x140575));_0x304a8e(_0x140575);})[_0xfb4e('0x14')](function(_0x48d733){logger[_0xfb4e('0x11')](_0xfb4e('0x15'),_0x48d733[_0xfb4e('0x13')],_0x5d9d38);_0x55df61(_0x11b590['error'](0x1f4,_0x48d733[_0xfb4e('0x13')]));});});};exports[_0xfb4e('0x19')]=function(_0x7fb899){var _0xcdf9e9=this;return new Promise(function(_0x191136,_0x5e0927){return db[_0xfb4e('0x16')][_0xfb4e('0x1a')](_0x7fb899[_0xfb4e('0x1b')],{'raw':_0x7fb899[_0xfb4e('0x17')]?_0x7fb899[_0xfb4e('0x17')][_0xfb4e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7fb899[_0xfb4e('0x17')]?_0x7fb899[_0xfb4e('0x17')]['where']||null:null,'attributes':_0x7fb899[_0xfb4e('0x17')]?_0x7fb899['options'][_0xfb4e('0x1c')]||null:null,'limit':_0x7fb899[_0xfb4e('0x17')]?_0x7fb899[_0xfb4e('0x17')][_0xfb4e('0x1d')]||null:null})[_0xfb4e('0xb')](function(_0x51e4e9){logger[_0xfb4e('0xc')](_0xfb4e('0x19'),_0x7fb899);logger[_0xfb4e('0xf')](_0xfb4e('0x19'),_0x7fb899,JSON['stringify'](_0x51e4e9));_0x191136(_0x51e4e9);})[_0xfb4e('0x14')](function(_0x2a6721){logger[_0xfb4e('0x11')]('UpdateSquareReport',_0x2a6721[_0xfb4e('0x13')],_0x7fb899);_0x5e0927(_0xcdf9e9[_0xfb4e('0x11')](0x1f4,_0x2a6721['message']));});});};
\ No newline at end of file
index 6636c12..200d69b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8525=['../../config/environment','./squareReportDetail.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x8525,0x117));var _0x5852=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8525[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x5852('0x0'));var util=require('util');var path=require(_0x5852('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5852('0x2')]();var fs_extra=require(_0x5852('0x3'));var auth=require(_0x5852('0x4'));var interaction=require(_0x5852('0x5'));var config=require(_0x5852('0x6'));var controller=require(_0x5852('0x7'));router[_0x5852('0x8')]('/',auth[_0x5852('0x9')](),controller['index']);router[_0x5852('0x8')]('/describe',auth[_0x5852('0x9')](),controller[_0x5852('0xa')]);router[_0x5852('0x8')](_0x5852('0xb'),auth[_0x5852('0x9')](),controller[_0x5852('0xc')]);router[_0x5852('0xd')]('/',auth['isAuthenticated'](),controller[_0x5852('0xe')]);router[_0x5852('0xf')]('/:id',auth[_0x5852('0x9')](),controller[_0x5852('0x10')]);router['delete'](_0x5852('0xb'),auth[_0x5852('0x9')](),controller[_0x5852('0x11')]);module[_0x5852('0x12')]=router;
\ No newline at end of file
+var _0xb91e=['show','post','create','update','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','/:id'];(function(_0x4b1cd7,_0x27b641){var _0x400e61=function(_0x51d246){while(--_0x51d246){_0x4b1cd7['push'](_0x4b1cd7['shift']());}};_0x400e61(++_0x27b641);}(_0xb91e,0xb0));var _0xeb91=function(_0x383823,_0x29f54a){_0x383823=_0x383823-0x0;var _0x3a8a30=_0xb91e[_0x383823];return _0x3a8a30;};'use strict';var multer=require(_0xeb91('0x0'));var util=require(_0xeb91('0x1'));var path=require(_0xeb91('0x2'));var timeout=require(_0xeb91('0x3'));var express=require('express');var router=express[_0xeb91('0x4')]();var fs_extra=require(_0xeb91('0x5'));var auth=require(_0xeb91('0x6'));var interaction=require(_0xeb91('0x7'));var config=require(_0xeb91('0x8'));var controller=require(_0xeb91('0x9'));router[_0xeb91('0xa')]('/',auth[_0xeb91('0xb')](),controller['index']);router['get'](_0xeb91('0xc'),auth[_0xeb91('0xb')](),controller['describe']);router[_0xeb91('0xa')](_0xeb91('0xd'),auth[_0xeb91('0xb')](),controller[_0xeb91('0xe')]);router[_0xeb91('0xf')]('/',auth[_0xeb91('0xb')](),controller[_0xeb91('0x10')]);router['put'](_0xeb91('0xd'),auth[_0xeb91('0xb')](),controller[_0xeb91('0x11')]);router['delete'](_0xeb91('0xd'),auth['isAuthenticated'](),controller[_0xeb91('0x12')]);module['exports']=router;
\ No newline at end of file
index fec9cea..fbd32ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3483=['exports','STRING','TEXT','sequelize'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0x3483,0xff));var _0x3348=function(_0x5efcb2,_0x1213f1){_0x5efcb2=_0x5efcb2-0x0;var _0x249ec2=_0x3483[_0x5efcb2];return _0x249ec2;};'use strict';var Sequelize=require(_0x3348('0x0'));module[_0x3348('0x1')]={'uniqueid':{'type':Sequelize[_0x3348('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x3348('0x2')]},'data':{'type':Sequelize[_0x3348('0x3')]},'project_name':{'type':Sequelize[_0x3348('0x2')]},'callerid':{'type':Sequelize[_0x3348('0x2')]}};
\ No newline at end of file
+var _0xfa18=['STRING','sequelize','exports'];(function(_0x465981,_0x2cc44c){var _0x27abf5=function(_0x4d2532){while(--_0x4d2532){_0x465981['push'](_0x465981['shift']());}};_0x27abf5(++_0x2cc44c);}(_0xfa18,0x121));var _0x8fa1=function(_0x275dde,_0x1bb2b8){_0x275dde=_0x275dde-0x0;var _0x2b041c=_0xfa18[_0x275dde];return _0x2b041c;};'use strict';var Sequelize=require(_0x8fa1('0x0'));module[_0x8fa1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x8fa1('0x2')]},'application':{'type':Sequelize[_0x8fa1('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x8fa1('0x2')]},'callerid':{'type':Sequelize[_0x8fa1('0x2')]}};
\ No newline at end of file
index cb9f421..6447901 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ca5=['mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','sendStatus','stack','name','send','index','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','SquareDetailsReport','includeAll','include','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x88eed3,_0x1741d7){var _0xf8b3a6=function(_0xb53a90){while(--_0xb53a90){_0x88eed3['push'](_0x88eed3['shift']());}};_0xf8b3a6(++_0x1741d7);}(_0x3ca5,0x15d));var _0x53ca=function(_0x100ecb,_0x5a63de){_0x100ecb=_0x100ecb-0x0;var _0xd79607=_0x3ca5[_0x100ecb];return _0xd79607;};'use strict';var emlformat=require(_0x53ca('0x0'));var rimraf=require(_0x53ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x53ca('0x2'));var rp=require(_0x53ca('0x3'));var moment=require(_0x53ca('0x4'));var BPromise=require(_0x53ca('0x5'));var Mustache=require(_0x53ca('0x6'));var util=require(_0x53ca('0x7'));var path=require(_0x53ca('0x8'));var sox=require(_0x53ca('0x9'));var csv=require(_0x53ca('0xa'));var ejs=require(_0x53ca('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x53ca('0xc'));var jsforce=require(_0x53ca('0xd'));var deskjs=require(_0x53ca('0xe'));var toCsv=require(_0x53ca('0xa'));var querystring=require(_0x53ca('0xf'));var Papa=require('papaparse');var Redis=require(_0x53ca('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x53ca('0x11'));var logger=require(_0x53ca('0x12'))(_0x53ca('0x13'));var utils=require(_0x53ca('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x53ca('0x15'));var db=require(_0x53ca('0x16'))['db'];function respondWithStatusCode(_0x510494,_0x1fd344){_0x1fd344=_0x1fd344||0xcc;return function(_0x1460ed){if(_0x1460ed){return _0x510494['sendStatus'](_0x1fd344);}return _0x510494[_0x53ca('0x17')](_0x1fd344)['end']();};}function respondWithResult(_0x1c72de,_0x1dd5ff){_0x1dd5ff=_0x1dd5ff||0xc8;return function(_0x396a88){if(_0x396a88){return _0x1c72de['status'](_0x1dd5ff)[_0x53ca('0x18')](_0x396a88);}};}function respondWithFilteredResult(_0x31f324,_0x711ef6){return function(_0x407654){if(_0x407654){var _0x14a459=typeof _0x711ef6[_0x53ca('0x19')]===_0x53ca('0x1a')&&typeof _0x711ef6[_0x53ca('0x1b')]===_0x53ca('0x1a');var _0x365996=_0x407654['count'];var _0x508f0f=_0x14a459?0x0:_0x711ef6[_0x53ca('0x19')];var _0x17f0a6=_0x14a459?_0x407654[_0x53ca('0x1c')]:_0x711ef6['offset']+_0x711ef6[_0x53ca('0x1b')];var _0x8c3564;if(_0x17f0a6>=_0x365996){_0x17f0a6=_0x365996;_0x8c3564=0xc8;}else{_0x8c3564=0xce;}_0x31f324['status'](_0x8c3564);return _0x31f324['set'](_0x53ca('0x1d'),_0x508f0f+'-'+_0x17f0a6+'/'+_0x365996)[_0x53ca('0x18')](_0x407654);}return null;};}function patchUpdates(_0x633e68){return function(_0x15eb86){try{jsonpatch[_0x53ca('0x1e')](_0x15eb86,_0x633e68,!![]);}catch(_0x97367d){return BPromise['reject'](_0x97367d);}return _0x15eb86[_0x53ca('0x1f')]();};}function saveUpdates(_0x222fcb,_0x273bde){return function(_0x189350){if(_0x189350){return _0x189350[_0x53ca('0x20')](_0x222fcb)[_0x53ca('0x21')](function(_0x41dae8){return _0x41dae8;});}return null;};}function removeEntity(_0x267d04,_0x112bac){return function(_0x1bd48d){if(_0x1bd48d){return _0x1bd48d['destroy']()[_0x53ca('0x21')](function(){_0x267d04[_0x53ca('0x17')](0xcc)[_0x53ca('0x22')]();});}};}function handleEntityNotFound(_0x5eebf6,_0x2f203b){return function(_0x190458){if(!_0x190458){_0x5eebf6[_0x53ca('0x23')](0x194);}return _0x190458;};}function handleError(_0x509b4e,_0x5068bb){_0x5068bb=_0x5068bb||0x1f4;return function(_0x534849){logger['error'](_0x534849[_0x53ca('0x24')]);if(_0x534849[_0x53ca('0x25')]){delete _0x534849[_0x53ca('0x25')];}_0x509b4e[_0x53ca('0x17')](_0x5068bb)[_0x53ca('0x26')](_0x534849);};}exports[_0x53ca('0x27')]=function(_0x54006b,_0xfd8109){var _0x252031={},_0x126770={},_0x36a4b6={'count':0x0,'rows':[]};var _0x423d06=_['map'](db['SquareDetailsReport']['rawAttributes'],function(_0x203e39){return{'name':_0x203e39['fieldName'],'type':_0x203e39[_0x53ca('0x28')][_0x53ca('0x29')]};});_0x126770[_0x53ca('0x2a')]=_[_0x53ca('0x2b')](_0x423d06,_0x53ca('0x25'));_0x126770[_0x53ca('0x2c')]=_[_0x53ca('0x2d')](_0x54006b[_0x53ca('0x2c')]);_0x126770[_0x53ca('0x2e')]=_['intersection'](_0x126770[_0x53ca('0x2a')],_0x126770[_0x53ca('0x2c')]);_0x252031[_0x53ca('0x2f')]=_[_0x53ca('0x30')](_0x126770[_0x53ca('0x2a')],qs['fields'](_0x54006b[_0x53ca('0x2c')][_0x53ca('0x31')]));_0x252031['attributes']=_0x252031['attributes'][_0x53ca('0x32')]?_0x252031[_0x53ca('0x2f')]:_0x126770[_0x53ca('0x2a')];if(!_0x54006b[_0x53ca('0x2c')][_0x53ca('0x33')](_0x53ca('0x34'))){_0x252031[_0x53ca('0x1b')]=qs[_0x53ca('0x1b')](_0x54006b[_0x53ca('0x2c')][_0x53ca('0x1b')]);_0x252031[_0x53ca('0x19')]=qs[_0x53ca('0x19')](_0x54006b['query'][_0x53ca('0x19')]);}_0x252031[_0x53ca('0x35')]=qs[_0x53ca('0x36')](_0x54006b[_0x53ca('0x2c')][_0x53ca('0x36')]);_0x252031[_0x53ca('0x37')]=qs[_0x53ca('0x2e')](_['pick'](_0x54006b[_0x53ca('0x2c')],_0x126770[_0x53ca('0x2e')]),_0x423d06);if(_0x54006b['query']['filter']){_0x252031[_0x53ca('0x37')]=_['merge'](_0x252031[_0x53ca('0x37')],{'$or':_['map'](_0x423d06,function(_0x571de6){if(_0x571de6[_0x53ca('0x28')]!==_0x53ca('0x38')){var _0x32f210={};_0x32f210[_0x571de6[_0x53ca('0x25')]]={'$like':'%'+_0x54006b[_0x53ca('0x2c')][_0x53ca('0x39')]+'%'};return _0x32f210;}})});}_0x252031=_[_0x53ca('0x3a')]({},_0x252031,_0x54006b[_0x53ca('0x3b')]);var _0x5d27ae={'where':_0x252031[_0x53ca('0x37')]};return db[_0x53ca('0x3c')][_0x53ca('0x1c')](_0x5d27ae)[_0x53ca('0x21')](function(_0x1c8544){_0x36a4b6[_0x53ca('0x1c')]=_0x1c8544;if(_0x54006b['query'][_0x53ca('0x3d')]){_0x252031[_0x53ca('0x3e')]=[{'all':!![]}];}return db[_0x53ca('0x3c')]['findAll'](_0x252031);})[_0x53ca('0x21')](function(_0x3b4797){_0x36a4b6['rows']=_0x3b4797;return _0x36a4b6;})[_0x53ca('0x21')](respondWithFilteredResult(_0xfd8109,_0x252031))[_0x53ca('0x3f')](handleError(_0xfd8109,null));};exports[_0x53ca('0x40')]=function(_0x17ff6c,_0x2c3492){var _0x515726={'raw':!![],'where':{'id':_0x17ff6c[_0x53ca('0x41')]['id']}},_0x221cce={};_0x221cce[_0x53ca('0x2a')]=_[_0x53ca('0x2d')](db['SquareDetailsReport']['rawAttributes']);_0x221cce[_0x53ca('0x2c')]=_[_0x53ca('0x2d')](_0x17ff6c[_0x53ca('0x2c')]);_0x221cce[_0x53ca('0x2e')]=_['intersection'](_0x221cce[_0x53ca('0x2a')],_0x221cce[_0x53ca('0x2c')]);_0x515726[_0x53ca('0x2f')]=_['intersection'](_0x221cce[_0x53ca('0x2a')],qs[_0x53ca('0x31')](_0x17ff6c['query'][_0x53ca('0x31')]));_0x515726[_0x53ca('0x2f')]=_0x515726[_0x53ca('0x2f')][_0x53ca('0x32')]?_0x515726[_0x53ca('0x2f')]:_0x221cce[_0x53ca('0x2a')];if(_0x17ff6c[_0x53ca('0x2c')][_0x53ca('0x3d')]){_0x515726[_0x53ca('0x3e')]=[{'all':!![]}];}_0x515726=_[_0x53ca('0x3a')]({},_0x515726,_0x17ff6c[_0x53ca('0x3b')]);return db[_0x53ca('0x3c')][_0x53ca('0x42')](_0x515726)[_0x53ca('0x21')](handleEntityNotFound(_0x2c3492,null))['then'](respondWithResult(_0x2c3492,null))[_0x53ca('0x3f')](handleError(_0x2c3492,null));};exports[_0x53ca('0x43')]=function(_0x1e1d06,_0x3dccad){return db['SquareDetailsReport'][_0x53ca('0x43')](_0x1e1d06[_0x53ca('0x44')],{})[_0x53ca('0x21')](respondWithResult(_0x3dccad,0xc9))[_0x53ca('0x3f')](handleError(_0x3dccad,null));};exports[_0x53ca('0x20')]=function(_0x2b6e40,_0x39d1a8){if(_0x2b6e40[_0x53ca('0x44')]['id']){delete _0x2b6e40[_0x53ca('0x44')]['id'];}return db[_0x53ca('0x3c')][_0x53ca('0x42')]({'where':{'id':_0x2b6e40['params']['id']}})[_0x53ca('0x21')](handleEntityNotFound(_0x39d1a8,null))[_0x53ca('0x21')](saveUpdates(_0x2b6e40[_0x53ca('0x44')],null))[_0x53ca('0x21')](respondWithResult(_0x39d1a8,null))[_0x53ca('0x3f')](handleError(_0x39d1a8,null));};exports[_0x53ca('0x45')]=function(_0x5a3b8c,_0x2ae7e2){return db[_0x53ca('0x3c')][_0x53ca('0x42')]({'where':{'id':_0x5a3b8c[_0x53ca('0x41')]['id']}})[_0x53ca('0x21')](handleEntityNotFound(_0x2ae7e2,null))[_0x53ca('0x21')](removeEntity(_0x2ae7e2,null))[_0x53ca('0x3f')](handleError(_0x2ae7e2,null));};exports[_0x53ca('0x46')]=function(_0x3aab8b,_0x3260d5){return db[_0x53ca('0x3c')][_0x53ca('0x46')]()['then'](respondWithResult(_0x3260d5,null))[_0x53ca('0x3f')](handleError(_0x3260d5,null));};
\ No newline at end of file
+var _0x3115=['includeAll','options','find','create','update','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','end','error','stack','name','index','map','SquareDetailsReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','include','findAll','rows','catch','params'];(function(_0x1125ea,_0xab1c3a){var _0x9abe0c=function(_0x379d6f){while(--_0x379d6f){_0x1125ea['push'](_0x1125ea['shift']());}};_0x9abe0c(++_0xab1c3a);}(_0x3115,0x1b7));var _0x5311=function(_0x2cdc86,_0x4c16c7){_0x2cdc86=_0x2cdc86-0x0;var _0x2e1b96=_0x3115[_0x2cdc86];return _0x2e1b96;};'use strict';var emlformat=require(_0x5311('0x0'));var rimraf=require(_0x5311('0x1'));var zipdir=require(_0x5311('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5311('0x3'));var BPromise=require(_0x5311('0x4'));var Mustache=require(_0x5311('0x5'));var util=require(_0x5311('0x6'));var path=require('path');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('lodash');var squel=require(_0x5311('0xb'));var crypto=require(_0x5311('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5311('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5311('0xe'));var Redis=require(_0x5311('0xf'));var authService=require(_0x5311('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5311('0x11'));var hardwareService=require(_0x5311('0x12'));var logger=require(_0x5311('0x13'))(_0x5311('0x14'));var utils=require(_0x5311('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5311('0x16'));var db=require(_0x5311('0x17'))['db'];function respondWithStatusCode(_0x3a7bd6,_0x2af892){_0x2af892=_0x2af892||0xcc;return function(_0x244879){if(_0x244879){return _0x3a7bd6[_0x5311('0x18')](_0x2af892);}return _0x3a7bd6[_0x5311('0x19')](_0x2af892)['end']();};}function respondWithResult(_0x2e74fb,_0x337e3b){_0x337e3b=_0x337e3b||0xc8;return function(_0x46cc0c){if(_0x46cc0c){return _0x2e74fb[_0x5311('0x19')](_0x337e3b)[_0x5311('0x1a')](_0x46cc0c);}};}function respondWithFilteredResult(_0x1942df,_0x5f163f){return function(_0x3a42e1){if(_0x3a42e1){var _0x23e9a9=typeof _0x5f163f['offset']===_0x5311('0x1b')&&typeof _0x5f163f[_0x5311('0x1c')]==='undefined';var _0x307358=_0x3a42e1[_0x5311('0x1d')];var _0xf1d4e0=_0x23e9a9?0x0:_0x5f163f[_0x5311('0x1e')];var _0x4a24bd=_0x23e9a9?_0x3a42e1['count']:_0x5f163f['offset']+_0x5f163f[_0x5311('0x1c')];var _0x2b0935;if(_0x4a24bd>=_0x307358){_0x4a24bd=_0x307358;_0x2b0935=0xc8;}else{_0x2b0935=0xce;}_0x1942df[_0x5311('0x19')](_0x2b0935);return _0x1942df[_0x5311('0x1f')](_0x5311('0x20'),_0xf1d4e0+'-'+_0x4a24bd+'/'+_0x307358)[_0x5311('0x1a')](_0x3a42e1);}return null;};}function patchUpdates(_0x1844e1){return function(_0x2627d7){try{jsonpatch[_0x5311('0x21')](_0x2627d7,_0x1844e1,!![]);}catch(_0x6662c){return BPromise['reject'](_0x6662c);}return _0x2627d7[_0x5311('0x22')]();};}function saveUpdates(_0x414ba6,_0x2ae8af){return function(_0x32588b){if(_0x32588b){return _0x32588b['update'](_0x414ba6)[_0x5311('0x23')](function(_0x3629d7){return _0x3629d7;});}return null;};}function removeEntity(_0xefe23a,_0xe69ad7){return function(_0x223776){if(_0x223776){return _0x223776[_0x5311('0x24')]()[_0x5311('0x23')](function(){_0xefe23a[_0x5311('0x19')](0xcc)[_0x5311('0x25')]();});}};}function handleEntityNotFound(_0x22e184,_0x2967a2){return function(_0x5b3070){if(!_0x5b3070){_0x22e184[_0x5311('0x18')](0x194);}return _0x5b3070;};}function handleError(_0x2112a9,_0x4573bc){_0x4573bc=_0x4573bc||0x1f4;return function(_0x3efe95){logger[_0x5311('0x26')](_0x3efe95[_0x5311('0x27')]);if(_0x3efe95[_0x5311('0x28')]){delete _0x3efe95[_0x5311('0x28')];}_0x2112a9['status'](_0x4573bc)['send'](_0x3efe95);};}exports[_0x5311('0x29')]=function(_0x21b968,_0x27549a){var _0x53a812={},_0x113297={},_0x585c4a={'count':0x0,'rows':[]};var _0x43ceff=_[_0x5311('0x2a')](db[_0x5311('0x2b')]['rawAttributes'],function(_0x5cbb56){return{'name':_0x5cbb56['fieldName'],'type':_0x5cbb56[_0x5311('0x2c')][_0x5311('0x2d')]};});_0x113297[_0x5311('0x2e')]=_['map'](_0x43ceff,_0x5311('0x28'));_0x113297[_0x5311('0x2f')]=_[_0x5311('0x30')](_0x21b968['query']);_0x113297[_0x5311('0x31')]=_[_0x5311('0x32')](_0x113297[_0x5311('0x2e')],_0x113297['query']);_0x53a812[_0x5311('0x33')]=_[_0x5311('0x32')](_0x113297[_0x5311('0x2e')],qs[_0x5311('0x34')](_0x21b968['query'][_0x5311('0x34')]));_0x53a812[_0x5311('0x33')]=_0x53a812['attributes'][_0x5311('0x35')]?_0x53a812['attributes']:_0x113297[_0x5311('0x2e')];if(!_0x21b968[_0x5311('0x2f')][_0x5311('0x36')](_0x5311('0x37'))){_0x53a812[_0x5311('0x1c')]=qs[_0x5311('0x1c')](_0x21b968['query'][_0x5311('0x1c')]);_0x53a812[_0x5311('0x1e')]=qs[_0x5311('0x1e')](_0x21b968[_0x5311('0x2f')][_0x5311('0x1e')]);}_0x53a812['order']=qs[_0x5311('0x38')](_0x21b968[_0x5311('0x2f')][_0x5311('0x38')]);_0x53a812[_0x5311('0x39')]=qs[_0x5311('0x31')](_['pick'](_0x21b968['query'],_0x113297[_0x5311('0x31')]),_0x43ceff);if(_0x21b968[_0x5311('0x2f')]['filter']){_0x53a812[_0x5311('0x39')]=_['merge'](_0x53a812['where'],{'$or':_['map'](_0x43ceff,function(_0x2c620f){if(_0x2c620f[_0x5311('0x2c')]!=='VIRTUAL'){var _0x222286={};_0x222286[_0x2c620f[_0x5311('0x28')]]={'$like':'%'+_0x21b968['query'][_0x5311('0x3a')]+'%'};return _0x222286;}})});}_0x53a812=_[_0x5311('0x3b')]({},_0x53a812,_0x21b968['options']);var _0x5ba5d4={'where':_0x53a812[_0x5311('0x39')]};return db['SquareDetailsReport'][_0x5311('0x1d')](_0x5ba5d4)[_0x5311('0x23')](function(_0x66e4ab){_0x585c4a['count']=_0x66e4ab;if(_0x21b968[_0x5311('0x2f')]['includeAll']){_0x53a812[_0x5311('0x3c')]=[{'all':!![]}];}return db[_0x5311('0x2b')][_0x5311('0x3d')](_0x53a812);})[_0x5311('0x23')](function(_0x1a85eb){_0x585c4a[_0x5311('0x3e')]=_0x1a85eb;return _0x585c4a;})[_0x5311('0x23')](respondWithFilteredResult(_0x27549a,_0x53a812))[_0x5311('0x3f')](handleError(_0x27549a,null));};exports['show']=function(_0x1ae570,_0x5d27a6){var _0x57cb37={'raw':!![],'where':{'id':_0x1ae570[_0x5311('0x40')]['id']}},_0x40a494={};_0x40a494['model']=_[_0x5311('0x30')](db[_0x5311('0x2b')]['rawAttributes']);_0x40a494[_0x5311('0x2f')]=_['keys'](_0x1ae570[_0x5311('0x2f')]);_0x40a494[_0x5311('0x31')]=_[_0x5311('0x32')](_0x40a494[_0x5311('0x2e')],_0x40a494[_0x5311('0x2f')]);_0x57cb37[_0x5311('0x33')]=_['intersection'](_0x40a494[_0x5311('0x2e')],qs[_0x5311('0x34')](_0x1ae570[_0x5311('0x2f')][_0x5311('0x34')]));_0x57cb37[_0x5311('0x33')]=_0x57cb37[_0x5311('0x33')][_0x5311('0x35')]?_0x57cb37[_0x5311('0x33')]:_0x40a494[_0x5311('0x2e')];if(_0x1ae570[_0x5311('0x2f')][_0x5311('0x41')]){_0x57cb37['include']=[{'all':!![]}];}_0x57cb37=_[_0x5311('0x3b')]({},_0x57cb37,_0x1ae570[_0x5311('0x42')]);return db['SquareDetailsReport'][_0x5311('0x43')](_0x57cb37)[_0x5311('0x23')](handleEntityNotFound(_0x5d27a6,null))['then'](respondWithResult(_0x5d27a6,null))[_0x5311('0x3f')](handleError(_0x5d27a6,null));};exports[_0x5311('0x44')]=function(_0x26132b,_0x3639cd){return db[_0x5311('0x2b')][_0x5311('0x44')](_0x26132b['body'],{})[_0x5311('0x23')](respondWithResult(_0x3639cd,0xc9))[_0x5311('0x3f')](handleError(_0x3639cd,null));};exports[_0x5311('0x45')]=function(_0x1e23f5,_0x1fa5f8){if(_0x1e23f5['body']['id']){delete _0x1e23f5[_0x5311('0x46')]['id'];}return db[_0x5311('0x2b')][_0x5311('0x43')]({'where':{'id':_0x1e23f5['params']['id']}})[_0x5311('0x23')](handleEntityNotFound(_0x1fa5f8,null))['then'](saveUpdates(_0x1e23f5[_0x5311('0x46')],null))['then'](respondWithResult(_0x1fa5f8,null))[_0x5311('0x3f')](handleError(_0x1fa5f8,null));};exports[_0x5311('0x24')]=function(_0x1e6486,_0x50a556){return db['SquareDetailsReport'][_0x5311('0x43')]({'where':{'id':_0x1e6486[_0x5311('0x40')]['id']}})[_0x5311('0x23')](handleEntityNotFound(_0x50a556,null))[_0x5311('0x23')](removeEntity(_0x50a556,null))['catch'](handleError(_0x50a556,null));};exports[_0x5311('0x47')]=function(_0xa76ca8,_0x12a65e){return db['SquareDetailsReport'][_0x5311('0x47')]()[_0x5311('0x23')](respondWithResult(_0x12a65e,null))[_0x5311('0x3f')](handleError(_0x12a65e,null));};
\ No newline at end of file
index cd3de81..d749352 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2505=['../../config/environment','./squareReportDetail.attributes','SquareDetailsReport','report_square_details','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x5b6b47,_0x45616f){var _0x3e61e1=function(_0x11c2f5){while(--_0x11c2f5){_0x5b6b47['push'](_0x5b6b47['shift']());}};_0x3e61e1(++_0x45616f);}(_0x2505,0x108));var _0x5250=function(_0x7f6230,_0x3c199c){_0x7f6230=_0x7f6230-0x0;var _0x4143ef=_0x2505[_0x7f6230];return _0x4143ef;};'use strict';var _=require('lodash');var util=require(_0x5250('0x0'));var logger=require(_0x5250('0x1'))(_0x5250('0x2'));var moment=require('moment');var BPromise=require(_0x5250('0x3'));var rp=require(_0x5250('0x4'));var fs=require('fs');var path=require(_0x5250('0x5'));var rimraf=require('rimraf');var config=require(_0x5250('0x6'));var attributes=require(_0x5250('0x7'));module['exports']=function(_0x156e8e,_0x2c1ac9){return _0x156e8e['define'](_0x5250('0x8'),attributes,{'tableName':_0x5250('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x88c9=['rimraf','./squareReportDetail.attributes','define','SquareDetailsReport','lodash','api','request-promise'];(function(_0x2fe0a5,_0x4f67b9){var _0x3acbcc=function(_0xaa2292){while(--_0xaa2292){_0x2fe0a5['push'](_0x2fe0a5['shift']());}};_0x3acbcc(++_0x4f67b9);}(_0x88c9,0xac));var _0x988c=function(_0x5a8814,_0x39331a){_0x5a8814=_0x5a8814-0x0;var _0x2ce63d=_0x88c9[_0x5a8814];return _0x2ce63d;};'use strict';var _=require(_0x988c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x988c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x988c('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x988c('0x3'));var config=require('../../config/environment');var attributes=require(_0x988c('0x4'));module['exports']=function(_0x3693f2,_0x513696){return _0x3693f2[_0x988c('0x5')](_0x988c('0x6'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b81165c..131e247 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bc6=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','SquareDetailsReport,\x20%s,\x20%s','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','stringify','lodash','util'];(function(_0x1f2104,_0x3d1a56){var _0x590031=function(_0x16e37d){while(--_0x16e37d){_0x1f2104['push'](_0x1f2104['shift']());}};_0x590031(++_0x3d1a56);}(_0x1bc6,0x94));var _0x61bc=function(_0x58e751,_0x47291a){_0x58e751=_0x58e751-0x0;var _0x54b430=_0x1bc6[_0x58e751];return _0x54b430;};'use strict';var _=require(_0x61bc('0x0'));var util=require(_0x61bc('0x1'));var moment=require(_0x61bc('0x2'));var BPromise=require(_0x61bc('0x3'));var rs=require(_0x61bc('0x4'));var fs=require('fs');var Redis=require(_0x61bc('0x5'));var db=require(_0x61bc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x61bc('0x7'))(_0x61bc('0x8'));var config=require(_0x61bc('0x9'));var jayson=require(_0x61bc('0xa'));var client=jayson[_0x61bc('0xb')][_0x61bc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x410656,_0x1b29e3,_0x151ef4){return new BPromise(function(_0x5ebb87,_0x339305){return client['request'](_0x410656,_0x151ef4)[_0x61bc('0xd')](function(_0x502dc0){logger[_0x61bc('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x1b29e3,_0x61bc('0xf'));logger[_0x61bc('0x10')](_0x61bc('0x11'),_0x1b29e3,'request\x20sent',JSON['stringify'](_0x502dc0));if(_0x502dc0['error']){if(_0x502dc0['error']['code']===0x1f4){logger[_0x61bc('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x1b29e3,_0x502dc0[_0x61bc('0x12')][_0x61bc('0x13')]);return _0x339305(_0x502dc0['error']['message']);}logger['error'](_0x61bc('0x14'),_0x1b29e3,_0x502dc0[_0x61bc('0x12')]['message']);return _0x5ebb87(_0x502dc0[_0x61bc('0x12')][_0x61bc('0x13')]);}else{logger[_0x61bc('0xe')](_0x61bc('0x14'),_0x1b29e3,_0x61bc('0xf'));_0x5ebb87(_0x502dc0[_0x61bc('0x15')]['message']);}})[_0x61bc('0x16')](function(_0x21b974){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x1b29e3,_0x21b974);_0x339305(_0x21b974);});});}exports[_0x61bc('0x17')]=function(_0x2a6f35){var _0x96cd3=this;return new Promise(function(_0x4ca1c3,_0x457702){return db[_0x61bc('0x18')][_0x61bc('0x19')](_0x2a6f35[_0x61bc('0x1a')],{'raw':_0x2a6f35['options']?_0x2a6f35[_0x61bc('0x1b')][_0x61bc('0x1c')]===undefined?!![]:![]:!![]})[_0x61bc('0xd')](function(_0x144b07){logger['info'](_0x61bc('0x17'),_0x2a6f35);logger[_0x61bc('0x10')](_0x61bc('0x17'),_0x2a6f35,JSON[_0x61bc('0x1d')](_0x144b07));_0x4ca1c3(_0x144b07);})[_0x61bc('0x16')](function(_0x141db2){logger[_0x61bc('0x12')]('CreateSquareDetailsReport',_0x141db2[_0x61bc('0x13')],_0x2a6f35);_0x457702(_0x96cd3[_0x61bc('0x12')](0x1f4,_0x141db2[_0x61bc('0x13')]));});});};
\ No newline at end of file
+var _0xb921=['options','raw','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body'];(function(_0x3266ca,_0x2166b5){var _0x3414bf=function(_0x515d28){while(--_0x515d28){_0x3266ca['push'](_0x3266ca['shift']());}};_0x3414bf(++_0x2166b5);}(_0xb921,0x16a));var _0x1b92=function(_0x543412,_0x4d2bea){_0x543412=_0x543412-0x0;var _0x4cab53=_0xb921[_0x543412];return _0x4cab53;};'use strict';var _=require(_0x1b92('0x0'));var util=require(_0x1b92('0x1'));var moment=require(_0x1b92('0x2'));var BPromise=require(_0x1b92('0x3'));var rs=require(_0x1b92('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1b92('0x5'));var logger=require(_0x1b92('0x6'))(_0x1b92('0x7'));var config=require(_0x1b92('0x8'));var jayson=require(_0x1b92('0x9'));var client=jayson[_0x1b92('0xa')][_0x1b92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8a6282,_0x7973df,_0x352406){return new BPromise(function(_0x1545f9,_0x64a3ed){return client[_0x1b92('0xc')](_0x8a6282,_0x352406)[_0x1b92('0xd')](function(_0x4567ab){logger['info'](_0x1b92('0xe'),_0x7973df,_0x1b92('0xf'));logger[_0x1b92('0x10')](_0x1b92('0x11'),_0x7973df,_0x1b92('0xf'),JSON[_0x1b92('0x12')](_0x4567ab));if(_0x4567ab[_0x1b92('0x13')]){if(_0x4567ab['error'][_0x1b92('0x14')]===0x1f4){logger[_0x1b92('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0x7973df,_0x4567ab[_0x1b92('0x13')][_0x1b92('0x15')]);return _0x64a3ed(_0x4567ab[_0x1b92('0x13')][_0x1b92('0x15')]);}logger[_0x1b92('0x13')](_0x1b92('0xe'),_0x7973df,_0x4567ab[_0x1b92('0x13')]['message']);return _0x1545f9(_0x4567ab[_0x1b92('0x13')]['message']);}else{logger[_0x1b92('0x16')]('SquareDetailsReport,\x20%s,\x20%s',_0x7973df,_0x1b92('0xf'));_0x1545f9(_0x4567ab['result'][_0x1b92('0x15')]);}})[_0x1b92('0x17')](function(_0x688aef){logger['error'](_0x1b92('0xe'),_0x7973df,_0x688aef);_0x64a3ed(_0x688aef);});});}exports[_0x1b92('0x18')]=function(_0x289523){var _0xf62817=this;return new Promise(function(_0x4368dc,_0x5010cd){return db[_0x1b92('0x19')][_0x1b92('0x1a')](_0x289523[_0x1b92('0x1b')],{'raw':_0x289523['options']?_0x289523[_0x1b92('0x1c')][_0x1b92('0x1d')]===undefined?!![]:![]:!![]})[_0x1b92('0xd')](function(_0x4bfc51){logger[_0x1b92('0x16')]('CreateSquareDetailsReport',_0x289523);logger[_0x1b92('0x10')](_0x1b92('0x18'),_0x289523,JSON['stringify'](_0x4bfc51));_0x4368dc(_0x4bfc51);})['catch'](function(_0x34c5c9){logger[_0x1b92('0x13')](_0x1b92('0x18'),_0x34c5c9[_0x1b92('0x15')],_0x289523);_0x5010cd(_0xf62817[_0x1b92('0x13')](0x1f4,_0x34c5c9[_0x1b92('0x15')]));});});};
\ No newline at end of file
index 426d3fd..dddf0cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7a0=['index','isAuthenticated','killProcess','exports','express','./system.controller','get'];(function(_0x457290,_0x29e383){var _0x40ed69=function(_0x1a00fb){while(--_0x1a00fb){_0x457290['push'](_0x457290['shift']());}};_0x40ed69(++_0x29e383);}(_0xf7a0,0x1bd));var _0x0f7a=function(_0x32b3d8,_0xe3616c){_0x32b3d8=_0x32b3d8-0x0;var _0x2607d6=_0xf7a0[_0x32b3d8];return _0x2607d6;};'use strict';var express=require(_0x0f7a('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x0f7a('0x1'));router[_0x0f7a('0x2')]('/',auth['isAuthenticated'](),controller[_0x0f7a('0x3')]);router[_0x0f7a('0x2')]('/process/:pid/kill',auth[_0x0f7a('0x4')](),controller[_0x0f7a('0x5')]);module[_0x0f7a('0x6')]=router;
\ No newline at end of file
+var _0x2764=['./system.controller','get','index','/process/:pid/kill','isAuthenticated','killProcess','exports','express','Router','../../components/auth/service'];(function(_0xbf23b4,_0x14c39c){var _0x24dfb2=function(_0x5abaac){while(--_0x5abaac){_0xbf23b4['push'](_0xbf23b4['shift']());}};_0x24dfb2(++_0x14c39c);}(_0x2764,0xbb));var _0x4276=function(_0x15531d,_0x3c3f3e){_0x15531d=_0x15531d-0x0;var _0x2a200e=_0x2764[_0x15531d];return _0x2a200e;};'use strict';var express=require(_0x4276('0x0'));var router=express[_0x4276('0x1')]();var auth=require(_0x4276('0x2'));var controller=require(_0x4276('0x3'));router[_0x4276('0x4')]('/',auth['isAuthenticated'](),controller[_0x4276('0x5')]);router['get'](_0x4276('0x6'),auth[_0x4276('0x7')](),controller[_0x4276('0x8')]);module[_0x4276('0x9')]=router;
\ No newline at end of file
index bd80d86..52cff2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c59=['format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','../../config/logger','util','bluebird','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','getAllData','json','catch','components/import/cm'];(function(_0x470e5f,_0x73d061){var _0x193838=function(_0x579442){while(--_0x579442){_0x470e5f['push'](_0x470e5f['shift']());}};_0x193838(++_0x73d061);}(_0x2c59,0x70));var _0x92c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c59[_0x3dd15e];return _0x231fd0;};'use strict';var info=require(_0x92c5('0x0'));var exec=require(_0x92c5('0x1'))['exec'];var logger=require(_0x92c5('0x2'))('api');var util=require(_0x92c5('0x3'));var BPromise=require(_0x92c5('0x4'));var _=require('lodash');function handleError(_0x260aba,_0x4d5801,_0x2530fe){_0x4d5801=_0x4d5801||0x1f4;return function(_0x1774f2){logger['error'](_0x92c5('0x5'),_0x2530fe,_0x4d5801,util['inspect'](_0x1774f2,{'showHidden':![],'depth':null}));delete _0x1774f2[_0x92c5('0x6')];_0x260aba[_0x92c5('0x7')](_0x4d5801)[_0x92c5('0x8')](_0x1774f2);};}exports['index']=function(_0x2e04ec,_0x4c2c6a){return info[_0x92c5('0x9')]()['then'](function(_0x12e530){return _0x4c2c6a[_0x92c5('0x7')](0xc8)[_0x92c5('0xa')](_0x12e530);})[_0x92c5('0xb')](function(_0x1ee5ff){return _0x4c2c6a[_0x92c5('0x7')](0x1f4)[_0x92c5('0xa')](_0x1ee5ff);});};exports['killProcess']=function(_0x58a3a2,_0x3fe101){var _0x84dd7b=[_0x92c5('0xc')];return new BPromise(function(_0x1f85b7,_0x3cbda8){return exec(util[_0x92c5('0xd')](_0x92c5('0xe'),_0x58a3a2[_0x92c5('0xf')][_0x92c5('0x10')]),function(_0x3da1ed,_0x36d4b7,_0x5c05d2){if(_0x3da1ed){return _0x3cbda8(_0x3da1ed);}return _0x1f85b7(_0x36d4b7);});})[_0x92c5('0x11')](function(_0x10908f){var _0x7bfda0=![];var _0x4bba94=_0x10908f[_0x92c5('0x12')](/\n/);for(var _0x310d19=0x0,_0x21bfbf=_0x84dd7b['length'];_0x310d19<_0x21bfbf,_0x7bfda0===![];_0x310d19+=0x1){if(_0x10908f[_0x92c5('0x13')](_0x84dd7b[_0x310d19])>=0x0){_0x7bfda0=!![];}}if(!_0x7bfda0){throw new Error(util['format'](_0x92c5('0x14'),_0x58a3a2[_0x92c5('0xf')][_0x92c5('0x10')]));}process[_0x92c5('0x15')](_0x58a3a2[_0x92c5('0xf')][_0x92c5('0x10')],_0x92c5('0x16'));return _0x3fe101[_0x92c5('0x7')](0xc8)['json']({'message':util[_0x92c5('0xd')](_0x92c5('0x17'),_0x58a3a2['params']['pid'])});})[_0x92c5('0xb')](handleError(_0x3fe101,null,_0x92c5('0x18')));};
\ No newline at end of file
+var _0x64f2=['util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','getAllData','then','catch','json','killProcess','components/import/cm','format','params','pid','split','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec','../../config/logger','api'];(function(_0x4b0167,_0x3b178b){var _0x4e29bc=function(_0x19fe37){while(--_0x19fe37){_0x4b0167['push'](_0x4b0167['shift']());}};_0x4e29bc(++_0x3b178b);}(_0x64f2,0x19c));var _0x264f=function(_0x3c5136,_0xa0352d){_0x3c5136=_0x3c5136-0x0;var _0x51f6af=_0x64f2[_0x3c5136];return _0x51f6af;};'use strict';var info=require('systeminformation');var exec=require(_0x264f('0x0'))[_0x264f('0x1')];var logger=require(_0x264f('0x2'))(_0x264f('0x3'));var util=require(_0x264f('0x4'));var BPromise=require('bluebird');var _=require(_0x264f('0x5'));function handleError(_0x4fc7b9,_0x4fd824,_0x273830){_0x4fd824=_0x4fd824||0x1f4;return function(_0x18fcab){logger[_0x264f('0x6')](_0x264f('0x7'),_0x273830,_0x4fd824,util[_0x264f('0x8')](_0x18fcab,{'showHidden':![],'depth':null}));delete _0x18fcab[_0x264f('0x9')];_0x4fc7b9[_0x264f('0xa')](_0x4fd824)[_0x264f('0xb')](_0x18fcab);};}exports['index']=function(_0x43eda4,_0x40a425){return info[_0x264f('0xc')]()[_0x264f('0xd')](function(_0x27ecfc){return _0x40a425[_0x264f('0xa')](0xc8)['json'](_0x27ecfc);})[_0x264f('0xe')](function(_0x19e98b){return _0x40a425['status'](0x1f4)[_0x264f('0xf')](_0x19e98b);});};exports[_0x264f('0x10')]=function(_0x2245ac,_0x52bd63){var _0x424772=[_0x264f('0x11')];return new BPromise(function(_0x4d3427,_0x147e35){return exec(util[_0x264f('0x12')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x2245ac[_0x264f('0x13')][_0x264f('0x14')]),function(_0x3eae74,_0x511d60,_0x522628){if(_0x3eae74){return _0x147e35(_0x3eae74);}return _0x4d3427(_0x511d60);});})[_0x264f('0xd')](function(_0x13a5a0){var _0x161309=![];var _0x1bdd19=_0x13a5a0[_0x264f('0x15')](/\n/);for(var _0x3be7bf=0x0,_0x221050=_0x424772['length'];_0x3be7bf<_0x221050,_0x161309===![];_0x3be7bf+=0x1){if(_0x13a5a0['indexOf'](_0x424772[_0x3be7bf])>=0x0){_0x161309=!![];}}if(!_0x161309){throw new Error(util[_0x264f('0x12')](_0x264f('0x16'),_0x2245ac[_0x264f('0x13')]['pid']));}process[_0x264f('0x17')](_0x2245ac[_0x264f('0x13')][_0x264f('0x14')],_0x264f('0x18'));return _0x52bd63['status'](0xc8)['json']({'message':util['format'](_0x264f('0x19'),_0x2245ac[_0x264f('0x13')]['pid'])});})['catch'](handleError(_0x52bd63,null,'killProcess'));};
\ No newline at end of file
index b0e6ab3..90a208b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2724=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x3311f1,_0x2b4d8d){var _0x382641=function(_0x678652){while(--_0x678652){_0x3311f1['push'](_0x3311f1['shift']());}};_0x382641(++_0x2b4d8d);}(_0x2724,0xa8));var _0x4272=function(_0x5810fb,_0x1808d3){_0x5810fb=_0x5810fb-0x0;var _0x23b01e=_0x2724[_0x5810fb];return _0x23b01e;};'use strict';var multer=require('multer');var util=require(_0x4272('0x0'));var path=require('path');var timeout=require(_0x4272('0x1'));var express=require('express');var router=express[_0x4272('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4272('0x3'));var interaction=require(_0x4272('0x4'));var config=require(_0x4272('0x5'));var controller=require(_0x4272('0x6'));router[_0x4272('0x7')]('/',auth[_0x4272('0x8')](),controller[_0x4272('0x9')]);router[_0x4272('0x7')](_0x4272('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x4272('0xb')]('/',auth[_0x4272('0x8')](),controller['create']);router[_0x4272('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x4272('0xd')]);router[_0x4272('0xe')](_0x4272('0xa'),auth[_0x4272('0x8')](),controller[_0x4272('0xf')]);module[_0x4272('0x10')]=router;
\ No newline at end of file
+var _0x5848=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','put','update','delete'];(function(_0x3b7c84,_0x473272){var _0x5a6e26=function(_0x53c5fa){while(--_0x53c5fa){_0x3b7c84['push'](_0x3b7c84['shift']());}};_0x5a6e26(++_0x473272);}(_0x5848,0x17d));var _0x8584=function(_0x3137bf,_0x4d98e2){_0x3137bf=_0x3137bf-0x0;var _0x4b4617=_0x5848[_0x3137bf];return _0x4b4617;};'use strict';var multer=require(_0x8584('0x0'));var util=require(_0x8584('0x1'));var path=require(_0x8584('0x2'));var timeout=require(_0x8584('0x3'));var express=require(_0x8584('0x4'));var router=express[_0x8584('0x5')]();var fs_extra=require(_0x8584('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8584('0x7'));var config=require(_0x8584('0x8'));var controller=require(_0x8584('0x9'));router[_0x8584('0xa')]('/',auth[_0x8584('0xb')](),controller['index']);router[_0x8584('0xa')](_0x8584('0xc'),auth[_0x8584('0xb')](),controller[_0x8584('0xd')]);router[_0x8584('0xe')]('/',auth[_0x8584('0xb')](),controller['create']);router[_0x8584('0xf')](_0x8584('0xc'),auth[_0x8584('0xb')](),controller[_0x8584('0x10')]);router[_0x8584('0x11')](_0x8584('0xc'),auth[_0x8584('0xb')](),controller[_0x8584('0x12')]);module['exports']=router;
\ No newline at end of file
index 02bd175..e292a6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4345=['exports','name','STRING','#0091EA','sequelize'];(function(_0x17b5fc,_0x40f5c7){var _0x200cd6=function(_0x4260df){while(--_0x4260df){_0x17b5fc['push'](_0x17b5fc['shift']());}};_0x200cd6(++_0x40f5c7);}(_0x4345,0x77));var _0x5434=function(_0x21166b,_0x3ee7ce){_0x21166b=_0x21166b-0x0;var _0x50ecce=_0x4345[_0x21166b];return _0x50ecce;};'use strict';var Sequelize=require(_0x5434('0x0'));module[_0x5434('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5434('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x5434('0x3')],'defaultValue':_0x5434('0x4')},'description':{'type':Sequelize[_0x5434('0x3')]}};
\ No newline at end of file
+var _0x608a=['exports','STRING','#0091EA'];(function(_0x534809,_0x5adc2f){var _0x149108=function(_0x22a0f2){while(--_0x22a0f2){_0x534809['push'](_0x534809['shift']());}};_0x149108(++_0x5adc2f);}(_0x608a,0xff));var _0xa608=function(_0x47172b,_0x191fe0){_0x47172b=_0x47172b-0x0;var _0x1c812d=_0x608a[_0x47172b];return _0x1c812d;};'use strict';var Sequelize=require('sequelize');module[_0xa608('0x0')]={'name':{'type':Sequelize[_0xa608('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xa608('0x1')],'defaultValue':_0xa608('0x2')},'description':{'type':Sequelize[_0xa608('0x1')]}};
\ No newline at end of file
index 448f2e0..c4ae13f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x073e=['save','update','then','destroy','stack','name','send','index','Tag','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','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','../../mysqldb','sendStatus','end','status','json','offset','count','limit','set','Content-Range','apply','reject'];(function(_0x1549b7,_0x3a47b0){var _0x23510e=function(_0x1abf4b){while(--_0x1abf4b){_0x1549b7['push'](_0x1549b7['shift']());}};_0x23510e(++_0x3a47b0);}(_0x073e,0x181));var _0xe073=function(_0x3832cd,_0x11aca2){_0x3832cd=_0x3832cd-0x0;var _0x4176a2=_0x073e[_0x3832cd];return _0x4176a2;};'use strict';var emlformat=require(_0xe073('0x0'));var rimraf=require(_0xe073('0x1'));var zipdir=require(_0xe073('0x2'));var jsonpatch=require(_0xe073('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe073('0x4'));var util=require(_0xe073('0x5'));var path=require(_0xe073('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe073('0x7'));var _=require(_0xe073('0x8'));var squel=require(_0xe073('0x9'));var crypto=require(_0xe073('0xa'));var jsforce=require(_0xe073('0xb'));var deskjs=require(_0xe073('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe073('0xd'));var Papa=require(_0xe073('0xe'));var Redis=require(_0xe073('0xf'));var authService=require(_0xe073('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe073('0x11'));var hardwareService=require(_0xe073('0x12'));var logger=require(_0xe073('0x13'))(_0xe073('0x14'));var utils=require(_0xe073('0x15'));var config=require(_0xe073('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe073('0x17'))['db'];function respondWithStatusCode(_0x56e3f5,_0x3dedf7){_0x3dedf7=_0x3dedf7||0xcc;return function(_0x5d2f2f){if(_0x5d2f2f){return _0x56e3f5[_0xe073('0x18')](_0x3dedf7);}return _0x56e3f5['status'](_0x3dedf7)[_0xe073('0x19')]();};}function respondWithResult(_0x27d34,_0x47828d){_0x47828d=_0x47828d||0xc8;return function(_0x2ce92d){if(_0x2ce92d){return _0x27d34[_0xe073('0x1a')](_0x47828d)[_0xe073('0x1b')](_0x2ce92d);}};}function respondWithFilteredResult(_0x2f4b36,_0xfb28f5){return function(_0x208f2e){if(_0x208f2e){var _0x26f3d3=typeof _0xfb28f5[_0xe073('0x1c')]==='undefined'&&typeof _0xfb28f5['limit']==='undefined';var _0x4c578c=_0x208f2e[_0xe073('0x1d')];var _0x10486c=_0x26f3d3?0x0:_0xfb28f5[_0xe073('0x1c')];var _0x4f9c8e=_0x26f3d3?_0x208f2e[_0xe073('0x1d')]:_0xfb28f5[_0xe073('0x1c')]+_0xfb28f5[_0xe073('0x1e')];var _0x54c10e;if(_0x4f9c8e>=_0x4c578c){_0x4f9c8e=_0x4c578c;_0x54c10e=0xc8;}else{_0x54c10e=0xce;}_0x2f4b36[_0xe073('0x1a')](_0x54c10e);return _0x2f4b36[_0xe073('0x1f')](_0xe073('0x20'),_0x10486c+'-'+_0x4f9c8e+'/'+_0x4c578c)[_0xe073('0x1b')](_0x208f2e);}return null;};}function patchUpdates(_0x43668e){return function(_0x17dd4b){try{jsonpatch[_0xe073('0x21')](_0x17dd4b,_0x43668e,!![]);}catch(_0x1d7a13){return BPromise[_0xe073('0x22')](_0x1d7a13);}return _0x17dd4b[_0xe073('0x23')]();};}function saveUpdates(_0x5143fa,_0x4405fd){return function(_0x21f9c2){if(_0x21f9c2){return _0x21f9c2[_0xe073('0x24')](_0x5143fa)[_0xe073('0x25')](function(_0x39bcb4){return _0x39bcb4;});}return null;};}function removeEntity(_0x275aa8,_0x504c26){return function(_0x4c76ef){if(_0x4c76ef){return _0x4c76ef[_0xe073('0x26')]()['then'](function(){var _0x5e3b16=_0x4c76ef['get']({'plain':!![]});var _0x5c4137='Tags';return db['UserProfileResource'][_0xe073('0x26')]({'where':{'type':_0x5c4137,'resourceId':_0x5e3b16['id']}})[_0xe073('0x25')](function(){return _0x4c76ef;});})['then'](function(){_0x275aa8[_0xe073('0x1a')](0xcc)[_0xe073('0x19')]();});}};}function handleEntityNotFound(_0x436c34,_0x5a5b2b){return function(_0x10f5ba){if(!_0x10f5ba){_0x436c34['sendStatus'](0x194);}return _0x10f5ba;};}function handleError(_0x255d91,_0x2e5fac){_0x2e5fac=_0x2e5fac||0x1f4;return function(_0x599972){logger['error'](_0x599972[_0xe073('0x27')]);if(_0x599972[_0xe073('0x28')]){delete _0x599972[_0xe073('0x28')];}_0x255d91[_0xe073('0x1a')](_0x2e5fac)[_0xe073('0x29')](_0x599972);};}exports[_0xe073('0x2a')]=function(_0x4f60dd,_0x2a206a){var _0x5c04fe={},_0x1baa0a={},_0x1cdcb0={'count':0x0,'rows':[]};var _0x4a6884=_['map'](db[_0xe073('0x2b')]['rawAttributes'],function(_0x3f6564){return{'name':_0x3f6564[_0xe073('0x2c')],'type':_0x3f6564[_0xe073('0x2d')]['key']};});_0x1baa0a['model']=_[_0xe073('0x2e')](_0x4a6884,_0xe073('0x28'));_0x1baa0a['query']=_[_0xe073('0x2f')](_0x4f60dd[_0xe073('0x30')]);_0x1baa0a[_0xe073('0x31')]=_['intersection'](_0x1baa0a[_0xe073('0x32')],_0x1baa0a['query']);_0x5c04fe['attributes']=_[_0xe073('0x33')](_0x1baa0a[_0xe073('0x32')],qs[_0xe073('0x34')](_0x4f60dd['query'][_0xe073('0x34')]));_0x5c04fe[_0xe073('0x35')]=_0x5c04fe[_0xe073('0x35')]['length']?_0x5c04fe[_0xe073('0x35')]:_0x1baa0a[_0xe073('0x32')];if(!_0x4f60dd[_0xe073('0x30')][_0xe073('0x36')](_0xe073('0x37'))){_0x5c04fe[_0xe073('0x1e')]=qs['limit'](_0x4f60dd[_0xe073('0x30')][_0xe073('0x1e')]);_0x5c04fe[_0xe073('0x1c')]=qs['offset'](_0x4f60dd[_0xe073('0x30')][_0xe073('0x1c')]);}_0x5c04fe[_0xe073('0x38')]=qs[_0xe073('0x39')](_0x4f60dd[_0xe073('0x30')]['sort']);_0x5c04fe[_0xe073('0x3a')]=qs['filters'](_[_0xe073('0x3b')](_0x4f60dd[_0xe073('0x30')],_0x1baa0a[_0xe073('0x31')]),_0x4a6884);if(_0x4f60dd[_0xe073('0x30')][_0xe073('0x3c')]){_0x5c04fe[_0xe073('0x3a')]=_[_0xe073('0x3d')](_0x5c04fe[_0xe073('0x3a')],{'$or':_[_0xe073('0x2e')](_0x4a6884,function(_0x3d29e5){if(_0x3d29e5[_0xe073('0x2d')]!==_0xe073('0x3e')){var _0x16be1a={};_0x16be1a[_0x3d29e5['name']]={'$like':'%'+_0x4f60dd[_0xe073('0x30')]['filter']+'%'};return _0x16be1a;}})});}_0x5c04fe=_[_0xe073('0x3d')]({},_0x5c04fe,_0x4f60dd[_0xe073('0x3f')]);var _0x5a4e19={'where':_0x5c04fe[_0xe073('0x3a')]};return db['Tag'][_0xe073('0x1d')](_0x5a4e19)[_0xe073('0x25')](function(_0x93852a){_0x1cdcb0[_0xe073('0x1d')]=_0x93852a;if(_0x4f60dd[_0xe073('0x30')]['includeAll']){_0x5c04fe[_0xe073('0x40')]=[{'all':!![]}];}return db['Tag'][_0xe073('0x41')](_0x5c04fe);})[_0xe073('0x25')](function(_0x125d1f){_0x1cdcb0[_0xe073('0x42')]=_0x125d1f;return _0x1cdcb0;})[_0xe073('0x25')](respondWithFilteredResult(_0x2a206a,_0x5c04fe))[_0xe073('0x43')](handleError(_0x2a206a,null));};exports[_0xe073('0x44')]=function(_0x2f4939,_0x1b50c5){var _0x2d3ffe={'raw':!![],'where':{'id':_0x2f4939['params']['id']}},_0x2c312b={};_0x2c312b['model']=_[_0xe073('0x2f')](db[_0xe073('0x2b')][_0xe073('0x45')]);_0x2c312b[_0xe073('0x30')]=_[_0xe073('0x2f')](_0x2f4939['query']);_0x2c312b[_0xe073('0x31')]=_[_0xe073('0x33')](_0x2c312b[_0xe073('0x32')],_0x2c312b[_0xe073('0x30')]);_0x2d3ffe[_0xe073('0x35')]=_['intersection'](_0x2c312b[_0xe073('0x32')],qs['fields'](_0x2f4939['query'][_0xe073('0x34')]));_0x2d3ffe[_0xe073('0x35')]=_0x2d3ffe['attributes']['length']?_0x2d3ffe[_0xe073('0x35')]:_0x2c312b[_0xe073('0x32')];if(_0x2f4939[_0xe073('0x30')][_0xe073('0x46')]){_0x2d3ffe[_0xe073('0x40')]=[{'all':!![]}];}_0x2d3ffe=_[_0xe073('0x3d')]({},_0x2d3ffe,_0x2f4939[_0xe073('0x3f')]);return db['Tag'][_0xe073('0x47')](_0x2d3ffe)['then'](handleEntityNotFound(_0x1b50c5,null))[_0xe073('0x25')](respondWithResult(_0x1b50c5,null))[_0xe073('0x43')](handleError(_0x1b50c5,null));};exports[_0xe073('0x48')]=function(_0x4e1f1d,_0x4d5bcd){return db[_0xe073('0x2b')][_0xe073('0x48')](_0x4e1f1d[_0xe073('0x49')],{})['then'](function(_0x151035){var _0x338557=_0x4e1f1d[_0xe073('0x4a')][_0xe073('0x4b')]({'plain':!![]});if(!_0x338557)throw new Error(_0xe073('0x4c'));if(_0x338557[_0xe073('0x4d')]===_0xe073('0x4a')){var _0x307541=_0x151035[_0xe073('0x4b')]({'plain':!![]});var _0x5626d4=_0xe073('0x4e');return db['UserProfileSection'][_0xe073('0x47')]({'where':{'name':_0x5626d4,'userProfileId':_0x338557['userProfileId']},'raw':!![]})[_0xe073('0x25')](function(_0x202687){if(_0x202687&&_0x202687[_0xe073('0x4f')]===0x0){return db[_0xe073('0x50')]['create']({'name':_0x307541[_0xe073('0x28')],'resourceId':_0x307541['id'],'type':_0x202687[_0xe073('0x28')],'sectionId':_0x202687['id']},{})[_0xe073('0x25')](function(){return _0x151035;});}else{return _0x151035;}})['catch'](function(_0x5503c2){logger[_0xe073('0x51')](_0xe073('0x52'),_0x5503c2);throw _0x5503c2;});}return _0x151035;})[_0xe073('0x25')](respondWithResult(_0x4d5bcd,0xc9))[_0xe073('0x43')](handleError(_0x4d5bcd,null));};exports[_0xe073('0x24')]=function(_0x5212d5,_0x197c42){if(_0x5212d5[_0xe073('0x49')]['id']){delete _0x5212d5[_0xe073('0x49')]['id'];}return db[_0xe073('0x2b')][_0xe073('0x47')]({'where':{'id':_0x5212d5[_0xe073('0x53')]['id']}})[_0xe073('0x25')](handleEntityNotFound(_0x197c42,null))[_0xe073('0x25')](saveUpdates(_0x5212d5[_0xe073('0x49')],null))[_0xe073('0x25')](respondWithResult(_0x197c42,null))['catch'](handleError(_0x197c42,null));};exports[_0xe073('0x26')]=function(_0x582007,_0x5825eb){return db[_0xe073('0x2b')][_0xe073('0x47')]({'where':{'id':_0x582007[_0xe073('0x53')]['id']}})['then'](handleEntityNotFound(_0x5825eb,null))[_0xe073('0x25')](removeEntity(_0x5825eb,null))[_0xe073('0x43')](handleError(_0x5825eb,null));};
\ No newline at end of file
+var _0x0a12=['name','send','index','map','Tag','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','options','then','includeAll','include','rawAttributes','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','destroy','error','stack'];(function(_0x5143f1,_0x4258c1){var _0x2eaefb=function(_0xca6bfd){while(--_0xca6bfd){_0x5143f1['push'](_0x5143f1['shift']());}};_0x2eaefb(++_0x4258c1);}(_0x0a12,0xb8));var _0x20a1=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x0a12[_0x55abd9];return _0x3e5669;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20a1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x20a1('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x20a1('0x2'));var util=require(_0x20a1('0x3'));var path=require(_0x20a1('0x4'));var sox=require(_0x20a1('0x5'));var csv=require(_0x20a1('0x6'));var ejs=require(_0x20a1('0x7'));var fs=require('fs');var fs_extra=require(_0x20a1('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x20a1('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x20a1('0x6'));var querystring=require(_0x20a1('0xa'));var Papa=require(_0x20a1('0xb'));var Redis=require(_0x20a1('0xc'));var authService=require(_0x20a1('0xd'));var qs=require(_0x20a1('0xe'));var as=require(_0x20a1('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x20a1('0x10'))(_0x20a1('0x11'));var utils=require(_0x20a1('0x12'));var config=require(_0x20a1('0x13'));var licenseUtil=require(_0x20a1('0x14'));var db=require(_0x20a1('0x15'))['db'];function respondWithStatusCode(_0x53a689,_0x77a193){_0x77a193=_0x77a193||0xcc;return function(_0xfe130a){if(_0xfe130a){return _0x53a689[_0x20a1('0x16')](_0x77a193);}return _0x53a689[_0x20a1('0x17')](_0x77a193)[_0x20a1('0x18')]();};}function respondWithResult(_0x32f1f9,_0x3c2c9f){_0x3c2c9f=_0x3c2c9f||0xc8;return function(_0x55feb0){if(_0x55feb0){return _0x32f1f9[_0x20a1('0x17')](_0x3c2c9f)[_0x20a1('0x19')](_0x55feb0);}};}function respondWithFilteredResult(_0xb736e9,_0x401178){return function(_0x1e6ae6){if(_0x1e6ae6){var _0xec799b=typeof _0x401178['offset']==='undefined'&&typeof _0x401178['limit']==='undefined';var _0x5925d4=_0x1e6ae6['count'];var _0x5c00a6=_0xec799b?0x0:_0x401178['offset'];var _0x4a68c5=_0xec799b?_0x1e6ae6[_0x20a1('0x1a')]:_0x401178[_0x20a1('0x1b')]+_0x401178[_0x20a1('0x1c')];var _0xf5d655;if(_0x4a68c5>=_0x5925d4){_0x4a68c5=_0x5925d4;_0xf5d655=0xc8;}else{_0xf5d655=0xce;}_0xb736e9[_0x20a1('0x17')](_0xf5d655);return _0xb736e9[_0x20a1('0x1d')]('Content-Range',_0x5c00a6+'-'+_0x4a68c5+'/'+_0x5925d4)['json'](_0x1e6ae6);}return null;};}function patchUpdates(_0x463968){return function(_0xce4fc4){try{jsonpatch[_0x20a1('0x1e')](_0xce4fc4,_0x463968,!![]);}catch(_0x4f7590){return BPromise['reject'](_0x4f7590);}return _0xce4fc4[_0x20a1('0x1f')]();};}function saveUpdates(_0x2969cd,_0x9089cc){return function(_0x16605d){if(_0x16605d){return _0x16605d['update'](_0x2969cd)['then'](function(_0x4e0100){return _0x4e0100;});}return null;};}function removeEntity(_0x48eb5d,_0x67313c){return function(_0x2f81a8){if(_0x2f81a8){return _0x2f81a8[_0x20a1('0x20')]()['then'](function(){var _0x10a600=_0x2f81a8['get']({'plain':!![]});var _0x11b83c='Tags';return db['UserProfileResource']['destroy']({'where':{'type':_0x11b83c,'resourceId':_0x10a600['id']}})['then'](function(){return _0x2f81a8;});})['then'](function(){_0x48eb5d[_0x20a1('0x17')](0xcc)[_0x20a1('0x18')]();});}};}function handleEntityNotFound(_0x24d1e2,_0xee9dd8){return function(_0x3927b2){if(!_0x3927b2){_0x24d1e2[_0x20a1('0x16')](0x194);}return _0x3927b2;};}function handleError(_0x5a1352,_0x3697f8){_0x3697f8=_0x3697f8||0x1f4;return function(_0x47877f){logger[_0x20a1('0x21')](_0x47877f[_0x20a1('0x22')]);if(_0x47877f['name']){delete _0x47877f[_0x20a1('0x23')];}_0x5a1352['status'](_0x3697f8)[_0x20a1('0x24')](_0x47877f);};}exports[_0x20a1('0x25')]=function(_0x184a3d,_0x1cdc2c){var _0xe8e6d1={},_0x22627a={},_0x13d9ea={'count':0x0,'rows':[]};var _0x2f6dd0=_[_0x20a1('0x26')](db[_0x20a1('0x27')]['rawAttributes'],function(_0x1e6b14){return{'name':_0x1e6b14['fieldName'],'type':_0x1e6b14['type'][_0x20a1('0x28')]};});_0x22627a[_0x20a1('0x29')]=_[_0x20a1('0x26')](_0x2f6dd0,_0x20a1('0x23'));_0x22627a['query']=_[_0x20a1('0x2a')](_0x184a3d[_0x20a1('0x2b')]);_0x22627a[_0x20a1('0x2c')]=_[_0x20a1('0x2d')](_0x22627a['model'],_0x22627a[_0x20a1('0x2b')]);_0xe8e6d1['attributes']=_['intersection'](_0x22627a[_0x20a1('0x29')],qs[_0x20a1('0x2e')](_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x2e')]));_0xe8e6d1['attributes']=_0xe8e6d1[_0x20a1('0x2f')][_0x20a1('0x30')]?_0xe8e6d1['attributes']:_0x22627a[_0x20a1('0x29')];if(!_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x31')]('nolimit')){_0xe8e6d1['limit']=qs[_0x20a1('0x1c')](_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x1c')]);_0xe8e6d1[_0x20a1('0x1b')]=qs[_0x20a1('0x1b')](_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x1b')]);}_0xe8e6d1[_0x20a1('0x32')]=qs['sort'](_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x33')]);_0xe8e6d1[_0x20a1('0x34')]=qs[_0x20a1('0x2c')](_[_0x20a1('0x35')](_0x184a3d['query'],_0x22627a[_0x20a1('0x2c')]),_0x2f6dd0);if(_0x184a3d['query'][_0x20a1('0x36')]){_0xe8e6d1[_0x20a1('0x34')]=_['merge'](_0xe8e6d1[_0x20a1('0x34')],{'$or':_['map'](_0x2f6dd0,function(_0x12a6ed){if(_0x12a6ed['type']!=='VIRTUAL'){var _0xe1b39b={};_0xe1b39b[_0x12a6ed[_0x20a1('0x23')]]={'$like':'%'+_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x36')]+'%'};return _0xe1b39b;}})});}_0xe8e6d1=_['merge']({},_0xe8e6d1,_0x184a3d[_0x20a1('0x37')]);var _0x1d2aab={'where':_0xe8e6d1['where']};return db[_0x20a1('0x27')][_0x20a1('0x1a')](_0x1d2aab)[_0x20a1('0x38')](function(_0x2c2f12){_0x13d9ea[_0x20a1('0x1a')]=_0x2c2f12;if(_0x184a3d['query'][_0x20a1('0x39')]){_0xe8e6d1[_0x20a1('0x3a')]=[{'all':!![]}];}return db[_0x20a1('0x27')]['findAll'](_0xe8e6d1);})[_0x20a1('0x38')](function(_0x40b931){_0x13d9ea['rows']=_0x40b931;return _0x13d9ea;})[_0x20a1('0x38')](respondWithFilteredResult(_0x1cdc2c,_0xe8e6d1))['catch'](handleError(_0x1cdc2c,null));};exports['show']=function(_0x55133c,_0x4cc2d6){var _0x26c023={'raw':!![],'where':{'id':_0x55133c['params']['id']}},_0x29968a={};_0x29968a['model']=_['keys'](db[_0x20a1('0x27')][_0x20a1('0x3b')]);_0x29968a[_0x20a1('0x2b')]=_['keys'](_0x55133c[_0x20a1('0x2b')]);_0x29968a[_0x20a1('0x2c')]=_[_0x20a1('0x2d')](_0x29968a[_0x20a1('0x29')],_0x29968a[_0x20a1('0x2b')]);_0x26c023['attributes']=_['intersection'](_0x29968a['model'],qs[_0x20a1('0x2e')](_0x55133c[_0x20a1('0x2b')]['fields']));_0x26c023[_0x20a1('0x2f')]=_0x26c023[_0x20a1('0x2f')][_0x20a1('0x30')]?_0x26c023['attributes']:_0x29968a[_0x20a1('0x29')];if(_0x55133c['query'][_0x20a1('0x39')]){_0x26c023[_0x20a1('0x3a')]=[{'all':!![]}];}_0x26c023=_['merge']({},_0x26c023,_0x55133c[_0x20a1('0x37')]);return db[_0x20a1('0x27')]['find'](_0x26c023)[_0x20a1('0x38')](handleEntityNotFound(_0x4cc2d6,null))[_0x20a1('0x38')](respondWithResult(_0x4cc2d6,null))['catch'](handleError(_0x4cc2d6,null));};exports[_0x20a1('0x3c')]=function(_0x85cbfd,_0xa74b57){return db['Tag'][_0x20a1('0x3c')](_0x85cbfd[_0x20a1('0x3d')],{})[_0x20a1('0x38')](function(_0x543408){var _0x1d605c=_0x85cbfd['user'][_0x20a1('0x3e')]({'plain':!![]});if(!_0x1d605c)throw new Error(_0x20a1('0x3f'));if(_0x1d605c[_0x20a1('0x40')]===_0x20a1('0x41')){var _0x19bb8d=_0x543408[_0x20a1('0x3e')]({'plain':!![]});var _0x3008ff='Tags';return db[_0x20a1('0x42')][_0x20a1('0x43')]({'where':{'name':_0x3008ff,'userProfileId':_0x1d605c['userProfileId']},'raw':!![]})[_0x20a1('0x38')](function(_0x4abddc){if(_0x4abddc&&_0x4abddc[_0x20a1('0x44')]===0x0){return db[_0x20a1('0x45')]['create']({'name':_0x19bb8d[_0x20a1('0x23')],'resourceId':_0x19bb8d['id'],'type':_0x4abddc[_0x20a1('0x23')],'sectionId':_0x4abddc['id']},{})[_0x20a1('0x38')](function(){return _0x543408;});}else{return _0x543408;}})[_0x20a1('0x46')](function(_0x4003d5){logger[_0x20a1('0x21')](_0x20a1('0x47'),_0x4003d5);throw _0x4003d5;});}return _0x543408;})[_0x20a1('0x38')](respondWithResult(_0xa74b57,0xc9))[_0x20a1('0x46')](handleError(_0xa74b57,null));};exports['update']=function(_0xd4cd57,_0x24c197){if(_0xd4cd57[_0x20a1('0x3d')]['id']){delete _0xd4cd57[_0x20a1('0x3d')]['id'];}return db['Tag'][_0x20a1('0x43')]({'where':{'id':_0xd4cd57[_0x20a1('0x48')]['id']}})['then'](handleEntityNotFound(_0x24c197,null))[_0x20a1('0x38')](saveUpdates(_0xd4cd57['body'],null))[_0x20a1('0x38')](respondWithResult(_0x24c197,null))[_0x20a1('0x46')](handleError(_0x24c197,null));};exports[_0x20a1('0x20')]=function(_0x2cfd78,_0x12c17c){return db[_0x20a1('0x27')][_0x20a1('0x43')]({'where':{'id':_0x2cfd78[_0x20a1('0x48')]['id']}})[_0x20a1('0x38')](handleEntityNotFound(_0x12c17c,null))[_0x20a1('0x38')](removeEntity(_0x12c17c,null))[_0x20a1('0x46')](handleError(_0x12c17c,null));};
\ No newline at end of file
index e338cef..4cace59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x110f=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags'];(function(_0x4b91c4,_0x23f35f){var _0x25cb80=function(_0x48e283){while(--_0x48e283){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x25cb80(++_0x23f35f);}(_0x110f,0x188));var _0xf110=function(_0x41d5f5,_0x9ba86f){_0x41d5f5=_0x41d5f5-0x0;var _0x3e17f4=_0x110f[_0x41d5f5];return _0x3e17f4;};'use strict';var _=require(_0xf110('0x0'));var util=require(_0xf110('0x1'));var logger=require(_0xf110('0x2'))(_0xf110('0x3'));var moment=require(_0xf110('0x4'));var BPromise=require(_0xf110('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf110('0x6'));var rimraf=require(_0xf110('0x7'));var config=require(_0xf110('0x8'));var attributes=require(_0xf110('0x9'));module[_0xf110('0xa')]=function(_0x58a164,_0x178a62){return _0x58a164[_0xf110('0xb')](_0xf110('0xc'),attributes,{'tableName':_0xf110('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x367b=['path','./tag.attributes','define','Tag','tools_tags','util','moment','bluebird'];(function(_0x2d71af,_0x27b7b5){var _0x1e7caa=function(_0x14db39){while(--_0x14db39){_0x2d71af['push'](_0x2d71af['shift']());}};_0x1e7caa(++_0x27b7b5);}(_0x367b,0xdd));var _0xb367=function(_0x401154,_0xc43a3){_0x401154=_0x401154-0x0;var _0x4e1903=_0x367b[_0x401154];return _0x4e1903;};'use strict';var _=require('lodash');var util=require(_0xb367('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb367('0x1'));var BPromise=require(_0xb367('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb367('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb367('0x4'));module['exports']=function(_0x2386cf,_0x3e78bb){return _0x2386cf[_0xb367('0x5')](_0xb367('0x6'),attributes,{'tableName':_0xb367('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4882cce..416bcff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07c3=['code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x07c3,0x1bf));var _0x307c=function(_0x56fe98,_0x43dc16){_0x56fe98=_0x56fe98-0x0;var _0x212f4f=_0x07c3[_0x56fe98];return _0x212f4f;};'use strict';var _=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var moment=require(_0x307c('0x2'));var BPromise=require(_0x307c('0x3'));var rs=require(_0x307c('0x4'));var fs=require('fs');var Redis=require(_0x307c('0x5'));var db=require(_0x307c('0x6'))['db'];var utils=require(_0x307c('0x7'));var logger=require('../../config/logger')(_0x307c('0x8'));var config=require(_0x307c('0x9'));var jayson=require(_0x307c('0xa'));var client=jayson[_0x307c('0xb')][_0x307c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x410ae8,_0x39af52,_0x3f5d08){return new BPromise(function(_0xfb14bf,_0x166467){return client[_0x307c('0xd')](_0x410ae8,_0x3f5d08)[_0x307c('0xe')](function(_0x1af97f){logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,'request\x20sent');logger[_0x307c('0x11')](_0x307c('0x12'),_0x39af52,_0x307c('0x13'),JSON[_0x307c('0x14')](_0x1af97f));if(_0x1af97f['error']){if(_0x1af97f['error'][_0x307c('0x15')]===0x1f4){logger['error'](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')]['message']);return _0x166467(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);return _0xfb14bf(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}else{logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,_0x307c('0x13'));_0xfb14bf(_0x1af97f[_0x307c('0x18')]['message']);}})[_0x307c('0x19')](function(_0x364441){logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x364441);_0x166467(_0x364441);});});}
\ No newline at end of file
+var _0x6334=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','Tag,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x27a8b4,_0x1601f4){var _0x92edce=function(_0x20d460){while(--_0x20d460){_0x27a8b4['push'](_0x27a8b4['shift']());}};_0x92edce(++_0x1601f4);}(_0x6334,0x119));var _0x4633=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0x6334[_0x5774be];return _0x4914b4;};'use strict';var _=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var moment=require(_0x4633('0x2'));var BPromise=require(_0x4633('0x3'));var rs=require(_0x4633('0x4'));var fs=require('fs');var Redis=require(_0x4633('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4633('0x6'));var logger=require(_0x4633('0x7'))(_0x4633('0x8'));var config=require(_0x4633('0x9'));var jayson=require(_0x4633('0xa'));var client=jayson[_0x4633('0xb')][_0x4633('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a8997,_0x5647f1,_0x56891d){return new BPromise(function(_0x21af74,_0x148e72){return client['request'](_0x4a8997,_0x56891d)[_0x4633('0xd')](function(_0x31e794){logger[_0x4633('0xe')]('Tag,\x20%s,\x20%s',_0x5647f1,_0x4633('0xf'));logger[_0x4633('0x10')]('Tag,\x20%s,\x20%s,\x20%s',_0x5647f1,_0x4633('0xf'),JSON[_0x4633('0x11')](_0x31e794));if(_0x31e794[_0x4633('0x12')]){if(_0x31e794[_0x4633('0x12')]['code']===0x1f4){logger[_0x4633('0x12')](_0x4633('0x13'),_0x5647f1,_0x31e794[_0x4633('0x12')]['message']);return _0x148e72(_0x31e794['error']['message']);}logger[_0x4633('0x12')](_0x4633('0x13'),_0x5647f1,_0x31e794['error']['message']);return _0x21af74(_0x31e794[_0x4633('0x12')]['message']);}else{logger[_0x4633('0xe')](_0x4633('0x13'),_0x5647f1,_0x4633('0xf'));_0x21af74(_0x31e794[_0x4633('0x14')]['message']);}})[_0x4633('0x15')](function(_0x15bd98){logger[_0x4633('0x12')]('Tag,\x20%s,\x20%s',_0x5647f1,_0x15bd98);_0x148e72(_0x15bd98);});});}
\ No newline at end of file
index 2be8a95..fcba26f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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 b82be2c..110aa28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['exports','sequelize'];(function(_0x19bd09,_0x509218){var _0x40851d=function(_0x37ea0b){while(--_0x37ea0b){_0x19bd09['push'](_0x19bd09['shift']());}};_0x40851d(++_0x509218);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x5a3ad6,_0x1869d7){var _0x1c6534=function(_0x3ee7d4){while(--_0x3ee7d4){_0x5a3ad6['push'](_0x5a3ad6['shift']());}};_0x1c6534(++_0x1869d7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index c8dc4a8..c7d5044 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe231=['update','then','stack','name','send','index','map','Team','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','QueryTypes','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','VoicePrefixId','getQueues','channel','isValidChannel','capitalize','toLowerCase','order','Queues','addQueues','findOne','ValidationError','Unknown\x20channel','add','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','penalty','QueueId','TeamVoiceQueue','User','Queue','findOrCreate','emit','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','upsert','all','spread','removeAgents','isArray','Queue:remove','getAgents','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','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/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x49d1c6,_0x305e46){var _0x4ec6b9=function(_0xa846a0){while(--_0xa846a0){_0x49d1c6['push'](_0x49d1c6['shift']());}};_0x4ec6b9(++_0x305e46);}(_0xe231,0x114));var _0x1e23=function(_0x2a18b7,_0x5041c8){_0x2a18b7=_0x2a18b7-0x0;var _0x45e74e=_0xe231[_0x2a18b7];return _0x45e74e;};'use strict';var emlformat=require(_0x1e23('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e23('0x1'));var jsonpatch=require(_0x1e23('0x2'));var rp=require(_0x1e23('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1e23('0x4'));var util=require('util');var path=require(_0x1e23('0x5'));var sox=require(_0x1e23('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e23('0x7'));var _=require(_0x1e23('0x8'));var squel=require('squel');var crypto=require(_0x1e23('0x9'));var jsforce=require(_0x1e23('0xa'));var deskjs=require(_0x1e23('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1e23('0xc'));var Papa=require(_0x1e23('0xd'));var Redis=require(_0x1e23('0xe'));var authService=require(_0x1e23('0xf'));var qs=require(_0x1e23('0x10'));var as=require(_0x1e23('0x11'));var hardwareService=require(_0x1e23('0x12'));var logger=require(_0x1e23('0x13'))(_0x1e23('0x14'));var utils=require(_0x1e23('0x15'));var config=require(_0x1e23('0x16'));var licenseUtil=require(_0x1e23('0x17'));var db=require(_0x1e23('0x18'))['db'];config[_0x1e23('0x19')]=_[_0x1e23('0x1a')](config[_0x1e23('0x19')],{'host':_0x1e23('0x1b'),'port':0x18eb});var socket=require(_0x1e23('0x1c'))(new Redis(config['redis']));require(_0x1e23('0x1d'))[_0x1e23('0x1e')](socket);function respondWithStatusCode(_0x83bb5a,_0x4eb005){_0x4eb005=_0x4eb005||0xcc;return function(_0x4cda58){if(_0x4cda58){return _0x83bb5a[_0x1e23('0x1f')](_0x4eb005);}return _0x83bb5a[_0x1e23('0x20')](_0x4eb005)[_0x1e23('0x21')]();};}function respondWithResult(_0x46caf1,_0x4cf6d8){_0x4cf6d8=_0x4cf6d8||0xc8;return function(_0x168a4f){if(_0x168a4f){return _0x46caf1['status'](_0x4cf6d8)[_0x1e23('0x22')](_0x168a4f);}};}function respondWithFilteredResult(_0x46277b,_0x1e3bf4){return function(_0x29b4e6){if(_0x29b4e6){var _0x33d83f=typeof _0x1e3bf4[_0x1e23('0x23')]===_0x1e23('0x24')&&typeof _0x1e3bf4[_0x1e23('0x25')]===_0x1e23('0x24');var _0x41e2b2=_0x29b4e6[_0x1e23('0x26')];var _0x2ab536=_0x33d83f?0x0:_0x1e3bf4[_0x1e23('0x23')];var _0x74ae34=_0x33d83f?_0x29b4e6[_0x1e23('0x26')]:_0x1e3bf4[_0x1e23('0x23')]+_0x1e3bf4[_0x1e23('0x25')];var _0x43ea7b;if(_0x74ae34>=_0x41e2b2){_0x74ae34=_0x41e2b2;_0x43ea7b=0xc8;}else{_0x43ea7b=0xce;}_0x46277b['status'](_0x43ea7b);return _0x46277b[_0x1e23('0x27')](_0x1e23('0x28'),_0x2ab536+'-'+_0x74ae34+'/'+_0x41e2b2)[_0x1e23('0x22')](_0x29b4e6);}return null;};}function patchUpdates(_0x5cab5b){return function(_0xc9df57){try{jsonpatch[_0x1e23('0x29')](_0xc9df57,_0x5cab5b,!![]);}catch(_0x138354){return BPromise[_0x1e23('0x2a')](_0x138354);}return _0xc9df57[_0x1e23('0x2b')]();};}function saveUpdates(_0x226a8a,_0x384755){return function(_0x4cc159){if(_0x4cc159){return _0x4cc159[_0x1e23('0x2c')](_0x226a8a)[_0x1e23('0x2d')](function(_0x56ab79){return _0x56ab79;});}return null;};}function handleEntityNotFound(_0x27cdc6,_0xafe34d){return function(_0x3f8ca4){if(!_0x3f8ca4){_0x27cdc6[_0x1e23('0x1f')](0x194);}return _0x3f8ca4;};}function handleError(_0x5859fb,_0x90bc2f){_0x90bc2f=_0x90bc2f||0x1f4;return function(_0x1e122b){logger['error'](_0x1e122b[_0x1e23('0x2e')]);if(_0x1e122b[_0x1e23('0x2f')]){delete _0x1e122b[_0x1e23('0x2f')];}_0x5859fb[_0x1e23('0x20')](_0x90bc2f)[_0x1e23('0x30')](_0x1e122b);};}exports[_0x1e23('0x31')]=function(_0x2bed25,_0x20b27c){var _0x28c32a={},_0x389671={},_0x173cdf={'count':0x0,'rows':[]};var _0x1516f1=_[_0x1e23('0x32')](db[_0x1e23('0x33')][_0x1e23('0x34')],function(_0x2da5fd){return{'name':_0x2da5fd[_0x1e23('0x35')],'type':_0x2da5fd['type'][_0x1e23('0x36')]};});_0x389671[_0x1e23('0x37')]=_[_0x1e23('0x32')](_0x1516f1,_0x1e23('0x2f'));_0x389671[_0x1e23('0x38')]=_[_0x1e23('0x39')](_0x2bed25[_0x1e23('0x38')]);_0x389671[_0x1e23('0x3a')]=_['intersection'](_0x389671[_0x1e23('0x37')],_0x389671[_0x1e23('0x38')]);_0x28c32a[_0x1e23('0x3b')]=_[_0x1e23('0x3c')](_0x389671['model'],qs['fields'](_0x2bed25[_0x1e23('0x38')][_0x1e23('0x3d')]));_0x28c32a[_0x1e23('0x3b')]=_0x28c32a[_0x1e23('0x3b')][_0x1e23('0x3e')]?_0x28c32a['attributes']:_0x389671[_0x1e23('0x37')];if(!_0x2bed25['query'][_0x1e23('0x3f')]('nolimit')){_0x28c32a[_0x1e23('0x25')]=qs[_0x1e23('0x25')](_0x2bed25['query'][_0x1e23('0x25')]);_0x28c32a[_0x1e23('0x23')]=qs[_0x1e23('0x23')](_0x2bed25['query'][_0x1e23('0x23')]);}_0x28c32a['order']=qs['sort'](_0x2bed25[_0x1e23('0x38')][_0x1e23('0x40')]);_0x28c32a['where']=qs['filters'](_[_0x1e23('0x41')](_0x2bed25['query'],_0x389671[_0x1e23('0x3a')]),_0x1516f1);if(_0x2bed25[_0x1e23('0x38')][_0x1e23('0x42')]){_0x28c32a[_0x1e23('0x43')]=_['merge'](_0x28c32a['where'],{'$or':_[_0x1e23('0x32')](_0x1516f1,function(_0x23eb6a){if(_0x23eb6a[_0x1e23('0x44')]!==_0x1e23('0x45')){var _0x4015b7={};_0x4015b7[_0x23eb6a[_0x1e23('0x2f')]]={'$like':'%'+_0x2bed25[_0x1e23('0x38')][_0x1e23('0x42')]+'%'};return _0x4015b7;}})});}_0x28c32a=_[_0x1e23('0x46')]({},_0x28c32a,_0x2bed25[_0x1e23('0x47')]);var _0x22926b={'where':_0x28c32a['where']};return db[_0x1e23('0x33')][_0x1e23('0x26')](_0x22926b)[_0x1e23('0x2d')](function(_0x1841e9){_0x173cdf[_0x1e23('0x26')]=_0x1841e9;if(_0x2bed25[_0x1e23('0x38')][_0x1e23('0x48')]){_0x28c32a[_0x1e23('0x49')]=[{'all':!![]}];}return db[_0x1e23('0x33')][_0x1e23('0x4a')](_0x28c32a);})[_0x1e23('0x2d')](function(_0xbeb819){_0x173cdf[_0x1e23('0x4b')]=_0xbeb819;return _0x173cdf;})[_0x1e23('0x2d')](respondWithFilteredResult(_0x20b27c,_0x28c32a))['catch'](handleError(_0x20b27c,null));};exports[_0x1e23('0x4c')]=function(_0x4c5da5,_0x56c000){var _0x2cec9b={'raw':![],'where':{'id':_0x4c5da5[_0x1e23('0x4d')]['id']}},_0x5c5af4={};_0x5c5af4[_0x1e23('0x37')]=_['keys'](db[_0x1e23('0x33')][_0x1e23('0x34')]);_0x5c5af4[_0x1e23('0x38')]=_[_0x1e23('0x39')](_0x4c5da5['query']);_0x5c5af4[_0x1e23('0x3a')]=_[_0x1e23('0x3c')](_0x5c5af4[_0x1e23('0x37')],_0x5c5af4[_0x1e23('0x38')]);_0x2cec9b[_0x1e23('0x3b')]=_[_0x1e23('0x3c')](_0x5c5af4[_0x1e23('0x37')],qs[_0x1e23('0x3d')](_0x4c5da5[_0x1e23('0x38')][_0x1e23('0x3d')]));_0x2cec9b[_0x1e23('0x3b')]=_0x2cec9b[_0x1e23('0x3b')][_0x1e23('0x3e')]?_0x2cec9b[_0x1e23('0x3b')]:_0x5c5af4['model'];if(_0x4c5da5[_0x1e23('0x38')][_0x1e23('0x48')]){_0x2cec9b['include']=[{'all':!![]}];}_0x2cec9b=_['merge']({},_0x2cec9b,_0x4c5da5[_0x1e23('0x47')]);return db['Team'][_0x1e23('0x4e')](_0x2cec9b)[_0x1e23('0x2d')](handleEntityNotFound(_0x56c000,null))[_0x1e23('0x2d')](respondWithResult(_0x56c000,null))[_0x1e23('0x4f')](handleError(_0x56c000,null));};exports['create']=function(_0x5b4864,_0x5d46a7){return db[_0x1e23('0x33')][_0x1e23('0x50')](_0x5b4864[_0x1e23('0x51')],{})[_0x1e23('0x2d')](function(_0x353c59){var _0x37ad8b=_0x5b4864[_0x1e23('0x52')][_0x1e23('0x53')]({'plain':!![]});if(!_0x37ad8b)throw new Error(_0x1e23('0x54'));if(_0x37ad8b['role']===_0x1e23('0x52')){var _0x32010c=_0x353c59['get']({'plain':!![]});var _0x2b7e15=_0x1e23('0x55');return db[_0x1e23('0x56')][_0x1e23('0x4e')]({'where':{'name':_0x2b7e15,'userProfileId':_0x37ad8b[_0x1e23('0x57')]},'raw':!![]})[_0x1e23('0x2d')](function(_0x179af3){if(_0x179af3&&_0x179af3[_0x1e23('0x58')]===0x0){return db[_0x1e23('0x59')]['create']({'name':_0x32010c[_0x1e23('0x2f')],'resourceId':_0x32010c['id'],'type':_0x179af3[_0x1e23('0x2f')],'sectionId':_0x179af3['id']},{})['then'](function(){return _0x353c59;});}else{return _0x353c59;}})[_0x1e23('0x4f')](function(_0x4879fa){logger['error'](_0x1e23('0x5a'),_0x4879fa);throw _0x4879fa;});}return _0x353c59;})[_0x1e23('0x2d')](respondWithResult(_0x5d46a7,0xc9))[_0x1e23('0x4f')](handleError(_0x5d46a7,null));};exports[_0x1e23('0x2c')]=function(_0x3527d6,_0x5a14f3){if(_0x3527d6['body']['id']){delete _0x3527d6[_0x1e23('0x51')]['id'];}return db['Team'][_0x1e23('0x4e')]({'where':{'id':_0x3527d6[_0x1e23('0x4d')]['id']}})[_0x1e23('0x2d')](handleEntityNotFound(_0x5a14f3,null))[_0x1e23('0x2d')](saveUpdates(_0x3527d6['body'],null))[_0x1e23('0x2d')](respondWithResult(_0x5a14f3,null))[_0x1e23('0x4f')](handleError(_0x5a14f3,null));};exports[_0x1e23('0x5b')]=function(_0x4ec78f,_0x34ae3c){var _0x38b115=_0x4ec78f[_0x1e23('0x4d')]['id'];var _0x1296f3=[];return db[_0x1e23('0x5c')][_0x1e23('0x5d')](function(_0x43c872){var _0x3e99dd=_0x1e23('0x5e')+_0x38b115;return db['sequelize'][_0x1e23('0x38')](_0x3e99dd,{'type':db[_0x1e23('0x5f')]['QueryTypes'][_0x1e23('0x60')],'raw':!![],'transaction':_0x43c872})[_0x1e23('0x2d')](function(_0x18fd57){_0x1296f3=_['map'](_0x18fd57,function(_0x42e432){return Number(_0x42e432[_0x1e23('0x61')]);});})['then'](function(){var _0x5de4f5=_0x1e23('0x62')+_0x38b115;return db[_0x1e23('0x5c')]['query'](_0x5de4f5,{'type':db[_0x1e23('0x5f')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x43c872});})[_0x1e23('0x2d')](function(_0x39b64d){var _0x3aba76=_[_0x1e23('0x32')](_0x39b64d,function(_0x912504){return Number(_0x912504[_0x1e23('0x63')]);});return db[_0x1e23('0x64')][_0x1e23('0x5b')]({'where':{'UserId':{'$in':_0x1296f3},'VoiceQueueId':{'$in':_0x3aba76}},'transaction':_0x43c872});})['then'](function(){var _0x4acad8='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x38b115;return db['sequelize'][_0x1e23('0x38')](_0x4acad8,{'type':db[_0x1e23('0x5f')][_0x1e23('0x65')][_0x1e23('0x60')],'raw':!![],'transaction':_0x43c872});})['then'](function(_0x38d32c){var _0x4506c5=_[_0x1e23('0x32')](_0x38d32c,function(_0x11f800){return Number(_0x11f800[_0x1e23('0x66')]);});return db['UserMailQueue']['destroy']({'where':{'UserId':{'$in':_0x1296f3},'MailQueueId':{'$in':_0x4506c5}},'transaction':_0x43c872});})[_0x1e23('0x2d')](function(){var _0x2cc1fc=_0x1e23('0x67')+_0x38b115;return db['sequelize'][_0x1e23('0x38')](_0x2cc1fc,{'type':db[_0x1e23('0x5f')][_0x1e23('0x65')]['SELECT'],'raw':!![],'transaction':_0x43c872});})[_0x1e23('0x2d')](function(_0x4317fa){var _0x133952=_[_0x1e23('0x32')](_0x4317fa,function(_0x284c3f){return Number(_0x284c3f[_0x1e23('0x68')]);});return db['UserSmsQueue'][_0x1e23('0x5b')]({'where':{'UserId':{'$in':_0x1296f3},'SmsQueueId':{'$in':_0x133952}},'transaction':_0x43c872});})[_0x1e23('0x2d')](function(){var _0x49bba2='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x38b115;return db[_0x1e23('0x5c')][_0x1e23('0x38')](_0x49bba2,{'type':db[_0x1e23('0x5f')]['QueryTypes'][_0x1e23('0x60')],'raw':!![],'transaction':_0x43c872});})[_0x1e23('0x2d')](function(_0x1f936b){var _0x1b3aaa=_['map'](_0x1f936b,function(_0x3a9c40){return Number(_0x3a9c40['ChatQueueId']);});return db[_0x1e23('0x69')][_0x1e23('0x5b')]({'where':{'UserId':{'$in':_0x1296f3},'ChatQueueId':{'$in':_0x1b3aaa}},'transaction':_0x43c872});})[_0x1e23('0x2d')](function(){var _0x3e816b=_0x1e23('0x6a')+_0x38b115;return db[_0x1e23('0x5c')]['query'](_0x3e816b,{'type':db[_0x1e23('0x5f')]['QueryTypes'][_0x1e23('0x60')],'raw':!![],'transaction':_0x43c872});})[_0x1e23('0x2d')](function(_0x4cccc6){var _0x39f2aa=_[_0x1e23('0x32')](_0x4cccc6,function(_0x535099){return Number(_0x535099[_0x1e23('0x6b')]);});return db[_0x1e23('0x6c')][_0x1e23('0x5b')]({'where':{'UserId':{'$in':_0x1296f3},'FaxQueueId':{'$in':_0x39f2aa}},'transaction':_0x43c872});})[_0x1e23('0x2d')](function(){var _0x2002ef=_0x1e23('0x6d')+_0x38b115;return db['sequelize'][_0x1e23('0x38')](_0x2002ef,{'type':db[_0x1e23('0x5f')][_0x1e23('0x65')]['SELECT'],'raw':!![],'transaction':_0x43c872});})['then'](function(_0x45b331){var _0x139288=_[_0x1e23('0x32')](_0x45b331,function(_0x56ba9b){return Number(_0x56ba9b[_0x1e23('0x6e')]);});return db[_0x1e23('0x6f')][_0x1e23('0x5b')]({'where':{'UserId':{'$in':_0x1296f3},'OpenchannelQueueId':{'$in':_0x139288}},'transaction':_0x43c872});})['then'](function(){var _0x3d90ca=_0x1e23('0x70')+_0x38b115;return db[_0x1e23('0x5c')][_0x1e23('0x38')](_0x3d90ca,{'type':db[_0x1e23('0x5f')][_0x1e23('0x65')][_0x1e23('0x60')],'raw':!![],'transaction':_0x43c872});})['then'](function(_0x629c4){var _0x42abae=_['map'](_0x629c4,function(_0x2d9f0d){return Number(_0x2d9f0d[_0x1e23('0x71')]);});return db['UserWhatsappQueue'][_0x1e23('0x5b')]({'where':{'UserId':{'$in':_0x1296f3},'WhatsappQueueId':{'$in':_0x42abae}},'transaction':_0x43c872});})[_0x1e23('0x2d')](function(){return db[_0x1e23('0x72')][_0x1e23('0x4e')]({'where':{'TeamId':_0x38b115}});})[_0x1e23('0x2d')](function(_0x2b129c){if(_0x2b129c===null){return;}return db['UserVoicePrefix']['destroy']({'where':{'UserId':{'$in':_0x1296f3},'VoicePrefixId':_0x2b129c[_0x1e23('0x73')]},'transaction':_0x43c872});})[_0x1e23('0x2d')](function(){return db[_0x1e23('0x33')][_0x1e23('0x5b')]({'where':{'id':_0x38b115},'cascade':!![],'transaction':_0x43c872});})[_0x1e23('0x2d')](function(_0x138967){if(_0x138967===0x0){_0x34ae3c[_0x1e23('0x1f')](0x194);}else{return db['UserProfileResource']['destroy']({'where':{'type':_0x1e23('0x55'),'resourceId':_0x38b115},'cascade':!![],'transaction':_0x43c872})['then'](function(){_0x34ae3c[_0x1e23('0x20')](0xcc)[_0x1e23('0x21')]();});}})[_0x1e23('0x4f')](function(_0x373a82){_0x34ae3c[_0x1e23('0x20')](0x1f4)[_0x1e23('0x30')](_0x373a82);});});};exports[_0x1e23('0x74')]=function(_0xf9130d,_0x3fa251,_0x5706d3){return db['Team']['findOne']({'where':{'id':_0xf9130d[_0x1e23('0x4d')]['id']}})[_0x1e23('0x2d')](handleEntityNotFound(_0x3fa251,null))[_0x1e23('0x2d')](function(_0x356dc1){if(!_0xf9130d[_0x1e23('0x38')][_0x1e23('0x75')]||!utils[_0x1e23('0x76')](_0xf9130d[_0x1e23('0x38')][_0x1e23('0x75')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}var _0x1826a5={};var _0x17d2fc={};_0x17d2fc[_0x1e23('0x37')]=_[_0x1e23('0x39')](db[_[_0x1e23('0x77')](_0xf9130d[_0x1e23('0x38')][_0x1e23('0x75')][_0x1e23('0x78')]())+'Queue'][_0x1e23('0x34')]);_0x17d2fc['query']=_[_0x1e23('0x39')](_0xf9130d['query']);_0x17d2fc[_0x1e23('0x3a')]=_[_0x1e23('0x3c')](_0x17d2fc[_0x1e23('0x37')],_0x17d2fc[_0x1e23('0x38')]);_0x1826a5['attributes']=_[_0x1e23('0x3c')](_0x17d2fc[_0x1e23('0x37')],qs['fields'](_0xf9130d['query'][_0x1e23('0x3d')]));_0x1826a5[_0x1e23('0x3b')]=_0x1826a5[_0x1e23('0x3b')][_0x1e23('0x3e')]?_0x1826a5[_0x1e23('0x3b')]:_0x17d2fc[_0x1e23('0x37')];_0x1826a5['limit']=qs[_0x1e23('0x25')](_0xf9130d[_0x1e23('0x38')][_0x1e23('0x25')]);_0x1826a5['offset']=qs['offset'](_0xf9130d[_0x1e23('0x38')][_0x1e23('0x23')]);_0x1826a5[_0x1e23('0x79')]=qs[_0x1e23('0x40')](_0xf9130d[_0x1e23('0x38')][_0x1e23('0x40')]);_0x1826a5[_0x1e23('0x43')]=qs[_0x1e23('0x3a')](_['pick'](_0xf9130d[_0x1e23('0x38')],_0x17d2fc['filters']));_0x1826a5=_[_0x1e23('0x46')]({},_0x1826a5,_0xf9130d[_0x1e23('0x47')]);return _0x356dc1['get'+_[_0x1e23('0x77')](_0xf9130d[_0x1e23('0x38')][_0x1e23('0x75')][_0x1e23('0x78')]())+_0x1e23('0x7a')](_0x1826a5);})[_0x1e23('0x2d')](respondWithResult(_0x3fa251,null))['catch'](handleError(_0x3fa251,null));};exports[_0x1e23('0x7b')]=function(_0x2dd51b,_0x3a900b,_0x11b68e){return db[_0x1e23('0x33')][_0x1e23('0x7c')]({'where':{'id':_0x2dd51b[_0x1e23('0x4d')]['id']}})[_0x1e23('0x2d')](function(_0x6fe3e5){if(_0x6fe3e5){if(!_0x2dd51b[_0x1e23('0x51')]['channel']||!utils[_0x1e23('0x76')](_0x2dd51b[_0x1e23('0x51')][_0x1e23('0x75')])){throw new db[(_0x1e23('0x5f'))][(_0x1e23('0x7d'))](_0x1e23('0x7e'));}return _0x6fe3e5[_0x1e23('0x7f')+_[_0x1e23('0x77')](_0x2dd51b['body'][_0x1e23('0x75')][_0x1e23('0x78')]())+_0x1e23('0x7a')](_0x2dd51b[_0x1e23('0x51')][_0x1e23('0x80')]);}return null;})[_0x1e23('0x2d')](handleEntityNotFound(_0x3a900b,null))[_0x1e23('0x2d')](respondWithStatusCode(_0x3a900b,null))[_0x1e23('0x4f')](handleError(_0x3a900b,null));};exports[_0x1e23('0x81')]=function(_0x3072f1,_0x1148b5,_0x2e2d99){return db[_0x1e23('0x33')][_0x1e23('0x7c')]({'where':{'id':_0x3072f1[_0x1e23('0x4d')]['id']}})[_0x1e23('0x2d')](function(_0x2a6557){if(_0x2a6557){if(!_0x3072f1['query'][_0x1e23('0x75')]||!utils['isValidChannel'](_0x3072f1[_0x1e23('0x38')][_0x1e23('0x75')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x2a6557[_0x1e23('0x82')+_['capitalize'](_0x3072f1['query'][_0x1e23('0x75')][_0x1e23('0x78')]())+_0x1e23('0x7a')](_0x3072f1[_0x1e23('0x38')][_0x1e23('0x80')]);}return null;})[_0x1e23('0x2d')](handleEntityNotFound(_0x1148b5,null))['then'](respondWithStatusCode(_0x1148b5,null))[_0x1e23('0x4f')](handleError(_0x1148b5,null));};exports[_0x1e23('0x83')]=function(_0x6acd66,_0x649689){var _0x141865=_['isArray'](_0x6acd66[_0x1e23('0x51')][_0x1e23('0x80')])?_0x6acd66[_0x1e23('0x51')][_0x1e23('0x80')]:[_0x6acd66[_0x1e23('0x51')][_0x1e23('0x80')]];var _0x546017=_0x6acd66['params']['id'];return db['Team'][_0x1e23('0x4e')]({'where':{'id':_0x546017}})[_0x1e23('0x2d')](handleEntityNotFound(_0x649689,null))[_0x1e23('0x2d')](function(_0x998ae3){if(_0x998ae3){var _0x3af023=[_0x1e23('0x84'),_0x1e23('0x85'),_0x1e23('0x86'),_0x1e23('0x87'),_0x1e23('0x88'),_0x1e23('0x89'),_0x1e23('0x8a')];return db[_0x1e23('0x5c')][_0x1e23('0x5d')](function(_0x10255a){var _0x17012b=_['map'](_0x3af023,function(_0x4bd406){var _0x3e0e32={'attributes':['id','name']};if(_0x4bd406===_0x1e23('0x84')){_0x3e0e32['through']={'attributes':[_0x1e23('0x8b')]};}return _0x998ae3[_0x1e23('0x53')+_0x4bd406+_0x1e23('0x7a')](_0x3e0e32)[_0x1e23('0x2d')](function(_0x2c8ebe){var _0x1d1847=_['map'](_0x2c8ebe,function(_0x566b49){var _0x35bd0e=_['map'](_0x141865,function(_0x443d2f){var _0x3c076b={'where':{'UserId':_0x443d2f,[_0x4bd406+_0x1e23('0x8c')]:_0x566b49['id']},'transaction':_0x10255a};if(_0x4bd406===_0x1e23('0x84')){_0x3c076b[_0x1e23('0x1a')]={'penalty':_0x566b49[_0x1e23('0x8d')][_0x1e23('0x8b')]};}return db[_0x1e23('0x8e')+_0x4bd406+_0x1e23('0x8f')][_0x1e23('0x90')](_0x3c076b)[_0x1e23('0x2d')](function(){socket[_0x1e23('0x91')](_0x1e23('0x52')+_0x4bd406+'Queue:save',{'UserId':_0x443d2f,[_0x4bd406+_0x1e23('0x8c')]:_0x566b49['id']});if(_0x4bd406!==_0x1e23('0x84')){return;}return db[_0x1e23('0x8e')][_0x1e23('0x4a')]({'where':{'id':_0x141865,'online':0x1},'attributes':['id',_0x1e23('0x2f'),'online',_0x1e23('0x92'),_0x1e23('0x93')],'raw':!![]})[_0x1e23('0x2d')](function(_0x3b6be6){var _0x2076e7=_[_0x1e23('0x32')](_0x3b6be6,function(_0x2dc0c2){return db[_0x1e23('0x94')]['upsert']({'membername':_0x2dc0c2['name'],'UserId':_0x2dc0c2['id'],'queue_name':_0x566b49[_0x1e23('0x2f')],'VoiceQueueId':_0x566b49['id'],'interface':_[_0x1e23('0x95')](_0x2dc0c2[_0x1e23('0x93')])?util[_0x1e23('0x96')](_0x1e23('0x97'),_0x2dc0c2[_0x1e23('0x2f')]):_0x2dc0c2['interface'],'paused':_0x2dc0c2[_0x1e23('0x92')]||![],'penalty':_0x566b49['TeamVoiceQueue'][_0x1e23('0x8b')]},{'transaction':_0x10255a});});return Promise['all'](_0x2076e7);});});});return Promise['all'](_0x35bd0e);});return Promise['all'](_0x1d1847);})['then'](function(){return db[_0x1e23('0x72')][_0x1e23('0x7c')]({'where':{'teamId':_0x546017}})[_0x1e23('0x2d')](function(_0x57e233){if(_0x57e233){var _0x4eb965=_[_0x1e23('0x32')](_0x141865,function(_0x5921bd){db['UserVoicePrefix'][_0x1e23('0x98')]({'UserId':_0x5921bd,'VoicePrefixId':_0x57e233[_0x1e23('0x73')]});});return Promise[_0x1e23('0x99')](_0x4eb965);}});});});return Promise[_0x1e23('0x99')](_0x17012b)[_0x1e23('0x2d')](function(){return _0x998ae3['addAgents'](_0x141865,{'transaction':_0x10255a})[_0x1e23('0x9a')](function(_0x4461b1){return _0x4461b1;});});});}})[_0x1e23('0x2d')](respondWithResult(_0x649689,null))['catch'](handleError(_0x649689,null));};exports[_0x1e23('0x9b')]=function(_0x3dce41,_0x15e296){var _0x36f91d=_[_0x1e23('0x9c')](_0x3dce41['query'][_0x1e23('0x80')])?_0x3dce41[_0x1e23('0x38')][_0x1e23('0x80')]:[_0x3dce41[_0x1e23('0x38')][_0x1e23('0x80')]];var _0x461614=_0x3dce41[_0x1e23('0x4d')]['id'];return db[_0x1e23('0x33')][_0x1e23('0x4e')]({'where':{'id':_0x461614}})[_0x1e23('0x2d')](handleEntityNotFound(_0x15e296,null))[_0x1e23('0x2d')](function(_0x523040){if(_0x523040){var _0x21ca7e=[_0x1e23('0x84'),_0x1e23('0x85'),'Mail','Sms',_0x1e23('0x88'),_0x1e23('0x89'),_0x1e23('0x8a')];return db[_0x1e23('0x5c')]['transaction'](function(_0x16b445){var _0x487fd5=_['map'](_0x21ca7e,function(_0x240f09){var _0x54ec5f={'attributes':['id',_0x1e23('0x2f')]};return _0x523040[_0x1e23('0x53')+_0x240f09+_0x1e23('0x7a')](_0x54ec5f)[_0x1e23('0x2d')](function(_0x3b0a53){var _0x173a75=_[_0x1e23('0x32')](_0x3b0a53,function(_0x141b23){return _0x141b23[_0x1e23('0x9b')](_0x36f91d,{'transaction':_0x16b445})['then'](function(){var _0x510848=_[_0x1e23('0x32')](_0x36f91d,function(_0x35aae5){socket[_0x1e23('0x91')](_0x1e23('0x52')+_0x240f09+_0x1e23('0x9d'),{'UserId':Number(_0x35aae5),[_0x240f09+'QueueId']:_0x141b23['id']});if(_0x240f09!==_0x1e23('0x84')){return;}return db[_0x1e23('0x94')]['destroy']({'where':{'VoiceQueueId':_0x141b23['id'],'UserId':_0x35aae5},'transaction':_0x16b445});});return Promise[_0x1e23('0x99')](_0x510848);});});return Promise[_0x1e23('0x99')](_0x173a75);});});return Promise[_0x1e23('0x99')](_0x487fd5)[_0x1e23('0x2d')](function(){return _0x523040[_0x1e23('0x9b')](_0x36f91d,{'transaction':_0x16b445});})[_0x1e23('0x2d')](function(){return db[_0x1e23('0x72')]['findOne']({'where':{'teamId':_0x461614}})['then'](function(_0x5e825b){if(_0x5e825b){var _0x50436b=_['map'](_0x36f91d,function(_0x12e181){db['UserVoicePrefix'][_0x1e23('0x5b')]({'where':{'UserId':_0x12e181,'VoicePrefixId':_0x5e825b[_0x1e23('0x73')]}});});return Promise[_0x1e23('0x99')](_0x50436b);}});});});}})[_0x1e23('0x2d')](respondWithStatusCode(_0x15e296,null))[_0x1e23('0x4f')](handleError(_0x15e296,null));};exports[_0x1e23('0x9e')]=function(_0x58dd7e,_0x58feb7,_0x1a2775){var _0x44e4b9={};var _0x3d86be={};var _0x25f69e;var _0x2b2dcd;return db[_0x1e23('0x33')][_0x1e23('0x7c')]({'where':{'id':_0x58dd7e[_0x1e23('0x4d')]['id']}})['then'](handleEntityNotFound(_0x58feb7,null))[_0x1e23('0x2d')](function(_0x5a5a4f){if(_0x5a5a4f){_0x25f69e=_0x5a5a4f;_0x3d86be[_0x1e23('0x37')]=_[_0x1e23('0x39')](db[_0x1e23('0x8e')][_0x1e23('0x34')]);_0x3d86be[_0x1e23('0x38')]=_[_0x1e23('0x39')](_0x58dd7e[_0x1e23('0x38')]);_0x3d86be[_0x1e23('0x3a')]=_[_0x1e23('0x3c')](_0x3d86be[_0x1e23('0x37')],_0x3d86be['query']);_0x44e4b9[_0x1e23('0x3b')]=_[_0x1e23('0x3c')](_0x3d86be[_0x1e23('0x37')],qs[_0x1e23('0x3d')](_0x58dd7e['query'][_0x1e23('0x3d')]));_0x44e4b9['attributes']=_0x44e4b9[_0x1e23('0x3b')][_0x1e23('0x3e')]?_0x44e4b9['attributes']:_0x3d86be[_0x1e23('0x37')];_0x44e4b9['order']=qs[_0x1e23('0x40')](_0x58dd7e['query']['sort']);_0x44e4b9['where']=qs[_0x1e23('0x3a')](_['pick'](_0x58dd7e['query'],_0x3d86be[_0x1e23('0x3a')]));if(_0x58dd7e[_0x1e23('0x38')]['filter']){_0x44e4b9['where']=_[_0x1e23('0x46')](_0x44e4b9[_0x1e23('0x43')],{'$or':_['map'](_0x44e4b9[_0x1e23('0x3b')],function(_0x791c16){var _0x4f6e01={};_0x4f6e01[_0x791c16]={'$like':'%'+_0x58dd7e['query']['filter']+'%'};return _0x4f6e01;})});}_0x44e4b9=_[_0x1e23('0x46')]({},_0x44e4b9,_0x58dd7e[_0x1e23('0x47')]);return _0x25f69e[_0x1e23('0x9e')](_0x44e4b9);}})[_0x1e23('0x2d')](function(_0x4ce447){if(_0x4ce447){_0x2b2dcd=_0x4ce447[_0x1e23('0x3e')];if(!_0x58dd7e['query'][_0x1e23('0x3f')](_0x1e23('0x9f'))){_0x44e4b9[_0x1e23('0x25')]=qs['limit'](_0x58dd7e['query'][_0x1e23('0x25')]);_0x44e4b9[_0x1e23('0x23')]=qs['offset'](_0x58dd7e[_0x1e23('0x38')][_0x1e23('0x23')]);}return _0x25f69e[_0x1e23('0x9e')](_0x44e4b9);}})['then'](function(_0x13e6b9){if(_0x13e6b9){return _0x13e6b9?{'count':_0x2b2dcd,'rows':_0x13e6b9}:null;}})[_0x1e23('0x2d')](respondWithResult(_0x58feb7,null))[_0x1e23('0x4f')](handleError(_0x58feb7,null));};
\ No newline at end of file
+var _0xd641=['isNil','format','TeamVoiceQueue','all','addAgents','spread','removeAgents','Chat','emit','VoicePrefixId','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','querystring','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./team.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','index','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','options','Team','then','includeAll','include','findAll','rows','catch','keys','merge','find','create','user','role','get','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','destroy','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','Teams','end','send','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queues','addQueues','add','ids','removeQueues','isArray','Voice','Mail','Sms','Fax','Openchannel','Whatsapp','penalty','QueueId','User','Queue','findOrCreate','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert'];(function(_0x141908,_0x4e61dc){var _0x37e9c9=function(_0x3a557e){while(--_0x3a557e){_0x141908['push'](_0x141908['shift']());}};_0x37e9c9(++_0x4e61dc);}(_0xd641,0xa3));var _0x1d64=function(_0x52838e,_0x5ceee1){_0x52838e=_0x52838e-0x0;var _0x29f247=_0xd641[_0x52838e];return _0x29f247;};'use strict';var emlformat=require(_0x1d64('0x0'));var rimraf=require(_0x1d64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1d64('0x2'));var rp=require(_0x1d64('0x3'));var moment=require(_0x1d64('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1d64('0x5'));var util=require(_0x1d64('0x6'));var path=require(_0x1d64('0x7'));var sox=require(_0x1d64('0x8'));var csv=require(_0x1d64('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d64('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1d64('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1d64('0x9'));var querystring=require(_0x1d64('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1d64('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d64('0xe'))('api');var utils=require(_0x1d64('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x1d64('0x10'));var db=require(_0x1d64('0x11'))['db'];config['redis']=_[_0x1d64('0x12')](config[_0x1d64('0x13')],{'host':_0x1d64('0x14'),'port':0x18eb});var socket=require(_0x1d64('0x15'))(new Redis(config[_0x1d64('0x13')]));require(_0x1d64('0x16'))['register'](socket);function respondWithStatusCode(_0x2942bb,_0x23ebf9){_0x23ebf9=_0x23ebf9||0xcc;return function(_0x2ffe7b){if(_0x2ffe7b){return _0x2942bb[_0x1d64('0x17')](_0x23ebf9);}return _0x2942bb[_0x1d64('0x18')](_0x23ebf9)['end']();};}function respondWithResult(_0x49a08b,_0x494d71){_0x494d71=_0x494d71||0xc8;return function(_0x353728){if(_0x353728){return _0x49a08b[_0x1d64('0x18')](_0x494d71)[_0x1d64('0x19')](_0x353728);}};}function respondWithFilteredResult(_0x38f817,_0x2a2b93){return function(_0x1e4aeb){if(_0x1e4aeb){var _0xddbc8f=typeof _0x2a2b93[_0x1d64('0x1a')]===_0x1d64('0x1b')&&typeof _0x2a2b93[_0x1d64('0x1c')]==='undefined';var _0x3e1016=_0x1e4aeb[_0x1d64('0x1d')];var _0x36614d=_0xddbc8f?0x0:_0x2a2b93['offset'];var _0x4a1226=_0xddbc8f?_0x1e4aeb['count']:_0x2a2b93[_0x1d64('0x1a')]+_0x2a2b93[_0x1d64('0x1c')];var _0x436e45;if(_0x4a1226>=_0x3e1016){_0x4a1226=_0x3e1016;_0x436e45=0xc8;}else{_0x436e45=0xce;}_0x38f817[_0x1d64('0x18')](_0x436e45);return _0x38f817[_0x1d64('0x1e')](_0x1d64('0x1f'),_0x36614d+'-'+_0x4a1226+'/'+_0x3e1016)[_0x1d64('0x19')](_0x1e4aeb);}return null;};}function patchUpdates(_0x43c5e4){return function(_0x404d34){try{jsonpatch[_0x1d64('0x20')](_0x404d34,_0x43c5e4,!![]);}catch(_0x1f047a){return BPromise[_0x1d64('0x21')](_0x1f047a);}return _0x404d34[_0x1d64('0x22')]();};}function saveUpdates(_0xf6d06,_0x14c283){return function(_0x1144dd){if(_0x1144dd){return _0x1144dd[_0x1d64('0x23')](_0xf6d06)['then'](function(_0x4a3b6b){return _0x4a3b6b;});}return null;};}function handleEntityNotFound(_0x34ab84,_0x6c23c3){return function(_0x4a3c47){if(!_0x4a3c47){_0x34ab84[_0x1d64('0x17')](0x194);}return _0x4a3c47;};}function handleError(_0x180b44,_0x13b89f){_0x13b89f=_0x13b89f||0x1f4;return function(_0x4f8606){logger[_0x1d64('0x24')](_0x4f8606[_0x1d64('0x25')]);if(_0x4f8606[_0x1d64('0x26')]){delete _0x4f8606[_0x1d64('0x26')];}_0x180b44[_0x1d64('0x18')](_0x13b89f)['send'](_0x4f8606);};}exports[_0x1d64('0x27')]=function(_0x26c918,_0x55856b){var _0x150b01={},_0x12a938={},_0x4e8d76={'count':0x0,'rows':[]};var _0x147368=_['map'](db['Team'][_0x1d64('0x28')],function(_0x5b17bf){return{'name':_0x5b17bf['fieldName'],'type':_0x5b17bf['type'][_0x1d64('0x29')]};});_0x12a938[_0x1d64('0x2a')]=_[_0x1d64('0x2b')](_0x147368,_0x1d64('0x26'));_0x12a938[_0x1d64('0x2c')]=_['keys'](_0x26c918['query']);_0x12a938[_0x1d64('0x2d')]=_[_0x1d64('0x2e')](_0x12a938[_0x1d64('0x2a')],_0x12a938[_0x1d64('0x2c')]);_0x150b01[_0x1d64('0x2f')]=_['intersection'](_0x12a938[_0x1d64('0x2a')],qs[_0x1d64('0x30')](_0x26c918[_0x1d64('0x2c')][_0x1d64('0x30')]));_0x150b01['attributes']=_0x150b01[_0x1d64('0x2f')][_0x1d64('0x31')]?_0x150b01['attributes']:_0x12a938[_0x1d64('0x2a')];if(!_0x26c918['query'][_0x1d64('0x32')](_0x1d64('0x33'))){_0x150b01[_0x1d64('0x1c')]=qs[_0x1d64('0x1c')](_0x26c918[_0x1d64('0x2c')][_0x1d64('0x1c')]);_0x150b01[_0x1d64('0x1a')]=qs['offset'](_0x26c918[_0x1d64('0x2c')]['offset']);}_0x150b01[_0x1d64('0x34')]=qs[_0x1d64('0x35')](_0x26c918[_0x1d64('0x2c')][_0x1d64('0x35')]);_0x150b01['where']=qs[_0x1d64('0x2d')](_[_0x1d64('0x36')](_0x26c918[_0x1d64('0x2c')],_0x12a938['filters']),_0x147368);if(_0x26c918['query'][_0x1d64('0x37')]){_0x150b01[_0x1d64('0x38')]=_['merge'](_0x150b01[_0x1d64('0x38')],{'$or':_['map'](_0x147368,function(_0x40f738){if(_0x40f738[_0x1d64('0x39')]!==_0x1d64('0x3a')){var _0x4b6b6c={};_0x4b6b6c[_0x40f738[_0x1d64('0x26')]]={'$like':'%'+_0x26c918[_0x1d64('0x2c')][_0x1d64('0x37')]+'%'};return _0x4b6b6c;}})});}_0x150b01=_['merge']({},_0x150b01,_0x26c918[_0x1d64('0x3b')]);var _0x107c44={'where':_0x150b01[_0x1d64('0x38')]};return db[_0x1d64('0x3c')]['count'](_0x107c44)[_0x1d64('0x3d')](function(_0x18beaa){_0x4e8d76['count']=_0x18beaa;if(_0x26c918[_0x1d64('0x2c')][_0x1d64('0x3e')]){_0x150b01[_0x1d64('0x3f')]=[{'all':!![]}];}return db[_0x1d64('0x3c')][_0x1d64('0x40')](_0x150b01);})[_0x1d64('0x3d')](function(_0x1935c2){_0x4e8d76[_0x1d64('0x41')]=_0x1935c2;return _0x4e8d76;})[_0x1d64('0x3d')](respondWithFilteredResult(_0x55856b,_0x150b01))[_0x1d64('0x42')](handleError(_0x55856b,null));};exports['show']=function(_0x5460e8,_0x15db7e){var _0x4957ce={'raw':![],'where':{'id':_0x5460e8['params']['id']}},_0x9b4f65={};_0x9b4f65['model']=_[_0x1d64('0x43')](db[_0x1d64('0x3c')]['rawAttributes']);_0x9b4f65['query']=_[_0x1d64('0x43')](_0x5460e8[_0x1d64('0x2c')]);_0x9b4f65[_0x1d64('0x2d')]=_[_0x1d64('0x2e')](_0x9b4f65[_0x1d64('0x2a')],_0x9b4f65[_0x1d64('0x2c')]);_0x4957ce[_0x1d64('0x2f')]=_[_0x1d64('0x2e')](_0x9b4f65['model'],qs[_0x1d64('0x30')](_0x5460e8[_0x1d64('0x2c')][_0x1d64('0x30')]));_0x4957ce[_0x1d64('0x2f')]=_0x4957ce[_0x1d64('0x2f')]['length']?_0x4957ce[_0x1d64('0x2f')]:_0x9b4f65[_0x1d64('0x2a')];if(_0x5460e8[_0x1d64('0x2c')][_0x1d64('0x3e')]){_0x4957ce['include']=[{'all':!![]}];}_0x4957ce=_[_0x1d64('0x44')]({},_0x4957ce,_0x5460e8['options']);return db['Team'][_0x1d64('0x45')](_0x4957ce)[_0x1d64('0x3d')](handleEntityNotFound(_0x15db7e,null))[_0x1d64('0x3d')](respondWithResult(_0x15db7e,null))[_0x1d64('0x42')](handleError(_0x15db7e,null));};exports[_0x1d64('0x46')]=function(_0x33d92f,_0x5179c6){return db[_0x1d64('0x3c')][_0x1d64('0x46')](_0x33d92f['body'],{})[_0x1d64('0x3d')](function(_0x174a21){var _0x56372c=_0x33d92f[_0x1d64('0x47')]['get']({'plain':!![]});if(!_0x56372c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56372c[_0x1d64('0x48')]===_0x1d64('0x47')){var _0x213ab8=_0x174a21[_0x1d64('0x49')]({'plain':!![]});var _0x1b060e='Teams';return db['UserProfileSection'][_0x1d64('0x45')]({'where':{'name':_0x1b060e,'userProfileId':_0x56372c['userProfileId']},'raw':!![]})[_0x1d64('0x3d')](function(_0x51f8df){if(_0x51f8df&&_0x51f8df[_0x1d64('0x4a')]===0x0){return db[_0x1d64('0x4b')]['create']({'name':_0x213ab8[_0x1d64('0x26')],'resourceId':_0x213ab8['id'],'type':_0x51f8df[_0x1d64('0x26')],'sectionId':_0x51f8df['id']},{})[_0x1d64('0x3d')](function(){return _0x174a21;});}else{return _0x174a21;}})[_0x1d64('0x42')](function(_0xc28502){logger[_0x1d64('0x24')](_0x1d64('0x4c'),_0xc28502);throw _0xc28502;});}return _0x174a21;})[_0x1d64('0x3d')](respondWithResult(_0x5179c6,0xc9))[_0x1d64('0x42')](handleError(_0x5179c6,null));};exports[_0x1d64('0x23')]=function(_0x5a0d6a,_0x725e6c){if(_0x5a0d6a[_0x1d64('0x4d')]['id']){delete _0x5a0d6a[_0x1d64('0x4d')]['id'];}return db[_0x1d64('0x3c')][_0x1d64('0x45')]({'where':{'id':_0x5a0d6a[_0x1d64('0x4e')]['id']}})[_0x1d64('0x3d')](handleEntityNotFound(_0x725e6c,null))[_0x1d64('0x3d')](saveUpdates(_0x5a0d6a[_0x1d64('0x4d')],null))['then'](respondWithResult(_0x725e6c,null))[_0x1d64('0x42')](handleError(_0x725e6c,null));};exports[_0x1d64('0x4f')]=function(_0x4e9802,_0x2e5c22){var _0x4b123b=_0x4e9802[_0x1d64('0x4e')]['id'];var _0x18ff7e=[];return db['sequelize'][_0x1d64('0x50')](function(_0x1113bf){var _0x4e8f09=_0x1d64('0x51')+_0x4b123b;return db[_0x1d64('0x52')]['query'](_0x4e8f09,{'type':db[_0x1d64('0x53')][_0x1d64('0x54')]['SELECT'],'raw':!![],'transaction':_0x1113bf})[_0x1d64('0x3d')](function(_0x44f285){_0x18ff7e=_['map'](_0x44f285,function(_0x450b54){return Number(_0x450b54[_0x1d64('0x55')]);});})[_0x1d64('0x3d')](function(){var _0x4b3244=_0x1d64('0x56')+_0x4b123b;return db[_0x1d64('0x52')][_0x1d64('0x2c')](_0x4b3244,{'type':db[_0x1d64('0x53')][_0x1d64('0x54')][_0x1d64('0x57')],'raw':!![],'transaction':_0x1113bf});})[_0x1d64('0x3d')](function(_0x39dfc5){var _0x4dddc7=_[_0x1d64('0x2b')](_0x39dfc5,function(_0x4726dd){return Number(_0x4726dd[_0x1d64('0x58')]);});return db['UserVoiceQueue'][_0x1d64('0x4f')]({'where':{'UserId':{'$in':_0x18ff7e},'VoiceQueueId':{'$in':_0x4dddc7}},'transaction':_0x1113bf});})[_0x1d64('0x3d')](function(){var _0x395b97=_0x1d64('0x59')+_0x4b123b;return db['sequelize'][_0x1d64('0x2c')](_0x395b97,{'type':db['Sequelize'][_0x1d64('0x54')]['SELECT'],'raw':!![],'transaction':_0x1113bf});})[_0x1d64('0x3d')](function(_0x2c4ceb){var _0x6c5225=_['map'](_0x2c4ceb,function(_0x2837d5){return Number(_0x2837d5[_0x1d64('0x5a')]);});return db[_0x1d64('0x5b')][_0x1d64('0x4f')]({'where':{'UserId':{'$in':_0x18ff7e},'MailQueueId':{'$in':_0x6c5225}},'transaction':_0x1113bf});})[_0x1d64('0x3d')](function(){var _0x319b33=_0x1d64('0x5c')+_0x4b123b;return db[_0x1d64('0x52')][_0x1d64('0x2c')](_0x319b33,{'type':db[_0x1d64('0x53')][_0x1d64('0x54')][_0x1d64('0x57')],'raw':!![],'transaction':_0x1113bf});})['then'](function(_0x556252){var _0x3ff780=_[_0x1d64('0x2b')](_0x556252,function(_0x50badb){return Number(_0x50badb['SmsQueueId']);});return db['UserSmsQueue'][_0x1d64('0x4f')]({'where':{'UserId':{'$in':_0x18ff7e},'SmsQueueId':{'$in':_0x3ff780}},'transaction':_0x1113bf});})['then'](function(){var _0x3d6b7b=_0x1d64('0x5d')+_0x4b123b;return db[_0x1d64('0x52')]['query'](_0x3d6b7b,{'type':db[_0x1d64('0x53')][_0x1d64('0x54')][_0x1d64('0x57')],'raw':!![],'transaction':_0x1113bf});})[_0x1d64('0x3d')](function(_0x36f089){var _0x31bde2=_[_0x1d64('0x2b')](_0x36f089,function(_0x247589){return Number(_0x247589[_0x1d64('0x5e')]);});return db[_0x1d64('0x5f')][_0x1d64('0x4f')]({'where':{'UserId':{'$in':_0x18ff7e},'ChatQueueId':{'$in':_0x31bde2}},'transaction':_0x1113bf});})[_0x1d64('0x3d')](function(){var _0x19f499=_0x1d64('0x60')+_0x4b123b;return db[_0x1d64('0x52')][_0x1d64('0x2c')](_0x19f499,{'type':db['Sequelize']['QueryTypes'][_0x1d64('0x57')],'raw':!![],'transaction':_0x1113bf});})[_0x1d64('0x3d')](function(_0x1b175c){var _0x3262b7=_['map'](_0x1b175c,function(_0x51b5bc){return Number(_0x51b5bc[_0x1d64('0x61')]);});return db[_0x1d64('0x62')][_0x1d64('0x4f')]({'where':{'UserId':{'$in':_0x18ff7e},'FaxQueueId':{'$in':_0x3262b7}},'transaction':_0x1113bf});})[_0x1d64('0x3d')](function(){var _0x137c0b=_0x1d64('0x63')+_0x4b123b;return db[_0x1d64('0x52')][_0x1d64('0x2c')](_0x137c0b,{'type':db['Sequelize'][_0x1d64('0x54')][_0x1d64('0x57')],'raw':!![],'transaction':_0x1113bf});})[_0x1d64('0x3d')](function(_0x3dfc63){var _0x11e0cc=_['map'](_0x3dfc63,function(_0x506623){return Number(_0x506623[_0x1d64('0x64')]);});return db[_0x1d64('0x65')][_0x1d64('0x4f')]({'where':{'UserId':{'$in':_0x18ff7e},'OpenchannelQueueId':{'$in':_0x11e0cc}},'transaction':_0x1113bf});})['then'](function(){var _0x10428a=_0x1d64('0x66')+_0x4b123b;return db[_0x1d64('0x52')][_0x1d64('0x2c')](_0x10428a,{'type':db[_0x1d64('0x53')][_0x1d64('0x54')]['SELECT'],'raw':!![],'transaction':_0x1113bf});})[_0x1d64('0x3d')](function(_0x35cbcc){var _0x5655a9=_['map'](_0x35cbcc,function(_0x350b68){return Number(_0x350b68[_0x1d64('0x67')]);});return db[_0x1d64('0x68')][_0x1d64('0x4f')]({'where':{'UserId':{'$in':_0x18ff7e},'WhatsappQueueId':{'$in':_0x5655a9}},'transaction':_0x1113bf});})['then'](function(){return db[_0x1d64('0x69')][_0x1d64('0x45')]({'where':{'TeamId':_0x4b123b}});})['then'](function(_0x59ecd3){if(_0x59ecd3===null){return;}return db[_0x1d64('0x6a')][_0x1d64('0x4f')]({'where':{'UserId':{'$in':_0x18ff7e},'VoicePrefixId':_0x59ecd3['VoicePrefixId']},'transaction':_0x1113bf});})[_0x1d64('0x3d')](function(){return db[_0x1d64('0x3c')]['destroy']({'where':{'id':_0x4b123b},'cascade':!![],'transaction':_0x1113bf});})[_0x1d64('0x3d')](function(_0x3f8026){if(_0x3f8026===0x0){_0x2e5c22[_0x1d64('0x17')](0x194);}else{return db['UserProfileResource'][_0x1d64('0x4f')]({'where':{'type':_0x1d64('0x6b'),'resourceId':_0x4b123b},'cascade':!![],'transaction':_0x1113bf})[_0x1d64('0x3d')](function(){_0x2e5c22[_0x1d64('0x18')](0xcc)[_0x1d64('0x6c')]();});}})['catch'](function(_0x2bf13a){_0x2e5c22['status'](0x1f4)[_0x1d64('0x6d')](_0x2bf13a);});});};exports[_0x1d64('0x6e')]=function(_0x30fa56,_0x5f3938,_0x249067){return db[_0x1d64('0x3c')][_0x1d64('0x6f')]({'where':{'id':_0x30fa56[_0x1d64('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5f3938,null))[_0x1d64('0x3d')](function(_0x354fbf){if(!_0x30fa56['query'][_0x1d64('0x70')]||!utils[_0x1d64('0x71')](_0x30fa56[_0x1d64('0x2c')][_0x1d64('0x70')])){throw new db['Sequelize'][(_0x1d64('0x72'))](_0x1d64('0x73'));}var _0x302410={};var _0x4a6d0d={};_0x4a6d0d[_0x1d64('0x2a')]=_[_0x1d64('0x43')](db[_[_0x1d64('0x74')](_0x30fa56['query']['channel'][_0x1d64('0x75')]())+'Queue'][_0x1d64('0x28')]);_0x4a6d0d[_0x1d64('0x2c')]=_[_0x1d64('0x43')](_0x30fa56[_0x1d64('0x2c')]);_0x4a6d0d[_0x1d64('0x2d')]=_['intersection'](_0x4a6d0d[_0x1d64('0x2a')],_0x4a6d0d['query']);_0x302410[_0x1d64('0x2f')]=_[_0x1d64('0x2e')](_0x4a6d0d[_0x1d64('0x2a')],qs['fields'](_0x30fa56[_0x1d64('0x2c')]['fields']));_0x302410[_0x1d64('0x2f')]=_0x302410[_0x1d64('0x2f')][_0x1d64('0x31')]?_0x302410[_0x1d64('0x2f')]:_0x4a6d0d[_0x1d64('0x2a')];_0x302410[_0x1d64('0x1c')]=qs[_0x1d64('0x1c')](_0x30fa56[_0x1d64('0x2c')]['limit']);_0x302410['offset']=qs[_0x1d64('0x1a')](_0x30fa56[_0x1d64('0x2c')][_0x1d64('0x1a')]);_0x302410[_0x1d64('0x34')]=qs[_0x1d64('0x35')](_0x30fa56['query']['sort']);_0x302410[_0x1d64('0x38')]=qs[_0x1d64('0x2d')](_[_0x1d64('0x36')](_0x30fa56[_0x1d64('0x2c')],_0x4a6d0d[_0x1d64('0x2d')]));_0x302410=_[_0x1d64('0x44')]({},_0x302410,_0x30fa56[_0x1d64('0x3b')]);return _0x354fbf['get'+_[_0x1d64('0x74')](_0x30fa56['query'][_0x1d64('0x70')][_0x1d64('0x75')]())+_0x1d64('0x76')](_0x302410);})[_0x1d64('0x3d')](respondWithResult(_0x5f3938,null))[_0x1d64('0x42')](handleError(_0x5f3938,null));};exports[_0x1d64('0x77')]=function(_0xb901cc,_0x1bef3a,_0x3a47f7){return db[_0x1d64('0x3c')]['findOne']({'where':{'id':_0xb901cc['params']['id']}})[_0x1d64('0x3d')](function(_0x172d87){if(_0x172d87){if(!_0xb901cc[_0x1d64('0x4d')]['channel']||!utils[_0x1d64('0x71')](_0xb901cc[_0x1d64('0x4d')][_0x1d64('0x70')])){throw new db['Sequelize'][(_0x1d64('0x72'))](_0x1d64('0x73'));}return _0x172d87[_0x1d64('0x78')+_['capitalize'](_0xb901cc[_0x1d64('0x4d')][_0x1d64('0x70')][_0x1d64('0x75')]())+_0x1d64('0x76')](_0xb901cc['body'][_0x1d64('0x79')]);}return null;})[_0x1d64('0x3d')](handleEntityNotFound(_0x1bef3a,null))['then'](respondWithStatusCode(_0x1bef3a,null))[_0x1d64('0x42')](handleError(_0x1bef3a,null));};exports[_0x1d64('0x7a')]=function(_0x51e2c6,_0x4fcce4,_0x3e2c5b){return db['Team'][_0x1d64('0x6f')]({'where':{'id':_0x51e2c6[_0x1d64('0x4e')]['id']}})[_0x1d64('0x3d')](function(_0x1a9522){if(_0x1a9522){if(!_0x51e2c6['query'][_0x1d64('0x70')]||!utils[_0x1d64('0x71')](_0x51e2c6[_0x1d64('0x2c')][_0x1d64('0x70')])){throw new db[(_0x1d64('0x53'))][(_0x1d64('0x72'))](_0x1d64('0x73'));}return _0x1a9522['remove'+_['capitalize'](_0x51e2c6['query'][_0x1d64('0x70')][_0x1d64('0x75')]())+_0x1d64('0x76')](_0x51e2c6[_0x1d64('0x2c')]['ids']);}return null;})['then'](handleEntityNotFound(_0x4fcce4,null))['then'](respondWithStatusCode(_0x4fcce4,null))[_0x1d64('0x42')](handleError(_0x4fcce4,null));};exports['addAgents']=function(_0x3e2e93,_0xa90be0){var _0x366410=_[_0x1d64('0x7b')](_0x3e2e93[_0x1d64('0x4d')][_0x1d64('0x79')])?_0x3e2e93[_0x1d64('0x4d')][_0x1d64('0x79')]:[_0x3e2e93[_0x1d64('0x4d')][_0x1d64('0x79')]];var _0x1574d1=_0x3e2e93[_0x1d64('0x4e')]['id'];return db[_0x1d64('0x3c')][_0x1d64('0x45')]({'where':{'id':_0x1574d1}})[_0x1d64('0x3d')](handleEntityNotFound(_0xa90be0,null))[_0x1d64('0x3d')](function(_0x34c284){if(_0x34c284){var _0x33fcc8=[_0x1d64('0x7c'),'Chat',_0x1d64('0x7d'),_0x1d64('0x7e'),_0x1d64('0x7f'),_0x1d64('0x80'),_0x1d64('0x81')];return db[_0x1d64('0x52')][_0x1d64('0x50')](function(_0x30dbff){var _0x1afed4=_['map'](_0x33fcc8,function(_0x856412){var _0x4bb39a={'attributes':['id',_0x1d64('0x26')]};if(_0x856412===_0x1d64('0x7c')){_0x4bb39a['through']={'attributes':[_0x1d64('0x82')]};}return _0x34c284['get'+_0x856412+_0x1d64('0x76')](_0x4bb39a)['then'](function(_0x1cfa3a){var _0x39955d=_['map'](_0x1cfa3a,function(_0x4c19c3){var _0x2a8497=_[_0x1d64('0x2b')](_0x366410,function(_0x5bcde8){var _0x1b8129={'where':{'UserId':_0x5bcde8,[_0x856412+_0x1d64('0x83')]:_0x4c19c3['id']},'transaction':_0x30dbff};if(_0x856412===_0x1d64('0x7c')){_0x1b8129['defaults']={'penalty':_0x4c19c3['TeamVoiceQueue'][_0x1d64('0x82')]};}return db[_0x1d64('0x84')+_0x856412+_0x1d64('0x85')][_0x1d64('0x86')](_0x1b8129)[_0x1d64('0x3d')](function(){socket['emit'](_0x1d64('0x47')+_0x856412+_0x1d64('0x87'),{'UserId':_0x5bcde8,[_0x856412+_0x1d64('0x83')]:_0x4c19c3['id']});if(_0x856412!==_0x1d64('0x7c')){return;}return db[_0x1d64('0x84')][_0x1d64('0x40')]({'where':{'id':_0x366410,'online':0x1},'attributes':['id',_0x1d64('0x26'),_0x1d64('0x88'),_0x1d64('0x89'),_0x1d64('0x8a')],'raw':!![]})['then'](function(_0x16dfc0){var _0x2c87b6=_[_0x1d64('0x2b')](_0x16dfc0,function(_0x255410){return db[_0x1d64('0x8b')][_0x1d64('0x8c')]({'membername':_0x255410[_0x1d64('0x26')],'UserId':_0x255410['id'],'queue_name':_0x4c19c3[_0x1d64('0x26')],'VoiceQueueId':_0x4c19c3['id'],'interface':_[_0x1d64('0x8d')](_0x255410[_0x1d64('0x8a')])?util[_0x1d64('0x8e')]('SIP/%s',_0x255410[_0x1d64('0x26')]):_0x255410[_0x1d64('0x8a')],'paused':_0x255410[_0x1d64('0x89')]||![],'penalty':_0x4c19c3[_0x1d64('0x8f')][_0x1d64('0x82')]},{'transaction':_0x30dbff});});return Promise['all'](_0x2c87b6);});});});return Promise['all'](_0x2a8497);});return Promise[_0x1d64('0x90')](_0x39955d);})[_0x1d64('0x3d')](function(){return db[_0x1d64('0x69')][_0x1d64('0x6f')]({'where':{'teamId':_0x1574d1}})[_0x1d64('0x3d')](function(_0x2c7ee8){if(_0x2c7ee8){var _0x339f52=_[_0x1d64('0x2b')](_0x366410,function(_0x537873){db[_0x1d64('0x6a')][_0x1d64('0x8c')]({'UserId':_0x537873,'VoicePrefixId':_0x2c7ee8['VoicePrefixId']});});return Promise[_0x1d64('0x90')](_0x339f52);}});});});return Promise[_0x1d64('0x90')](_0x1afed4)[_0x1d64('0x3d')](function(){return _0x34c284[_0x1d64('0x91')](_0x366410,{'transaction':_0x30dbff})[_0x1d64('0x92')](function(_0x3beb24){return _0x3beb24;});});});}})['then'](respondWithResult(_0xa90be0,null))['catch'](handleError(_0xa90be0,null));};exports[_0x1d64('0x93')]=function(_0x5508a0,_0x468479){var _0x9bab24=_[_0x1d64('0x7b')](_0x5508a0[_0x1d64('0x2c')]['ids'])?_0x5508a0[_0x1d64('0x2c')][_0x1d64('0x79')]:[_0x5508a0['query'][_0x1d64('0x79')]];var _0x2ab116=_0x5508a0[_0x1d64('0x4e')]['id'];return db[_0x1d64('0x3c')][_0x1d64('0x45')]({'where':{'id':_0x2ab116}})[_0x1d64('0x3d')](handleEntityNotFound(_0x468479,null))[_0x1d64('0x3d')](function(_0xb0ad4a){if(_0xb0ad4a){var _0x2f3f5b=[_0x1d64('0x7c'),_0x1d64('0x94'),_0x1d64('0x7d'),_0x1d64('0x7e'),_0x1d64('0x7f'),_0x1d64('0x80'),'Whatsapp'];return db[_0x1d64('0x52')][_0x1d64('0x50')](function(_0x53d409){var _0x394c4d=_[_0x1d64('0x2b')](_0x2f3f5b,function(_0x239a2a){var _0x2f8895={'attributes':['id',_0x1d64('0x26')]};return _0xb0ad4a[_0x1d64('0x49')+_0x239a2a+_0x1d64('0x76')](_0x2f8895)[_0x1d64('0x3d')](function(_0x499795){var _0x6cdd19=_[_0x1d64('0x2b')](_0x499795,function(_0x5c6301){return _0x5c6301[_0x1d64('0x93')](_0x9bab24,{'transaction':_0x53d409})[_0x1d64('0x3d')](function(){var _0x232182=_['map'](_0x9bab24,function(_0x5bc4d9){socket[_0x1d64('0x95')]('user'+_0x239a2a+'Queue:remove',{'UserId':Number(_0x5bc4d9),[_0x239a2a+_0x1d64('0x83')]:_0x5c6301['id']});if(_0x239a2a!==_0x1d64('0x7c')){return;}return db[_0x1d64('0x8b')][_0x1d64('0x4f')]({'where':{'VoiceQueueId':_0x5c6301['id'],'UserId':_0x5bc4d9},'transaction':_0x53d409});});return Promise['all'](_0x232182);});});return Promise[_0x1d64('0x90')](_0x6cdd19);});});return Promise['all'](_0x394c4d)['then'](function(){return _0xb0ad4a[_0x1d64('0x93')](_0x9bab24,{'transaction':_0x53d409});})[_0x1d64('0x3d')](function(){return db['TeamVoicePrefix'][_0x1d64('0x6f')]({'where':{'teamId':_0x2ab116}})['then'](function(_0xf78dae){if(_0xf78dae){var _0x3f3b90=_['map'](_0x9bab24,function(_0x218de4){db[_0x1d64('0x6a')][_0x1d64('0x4f')]({'where':{'UserId':_0x218de4,'VoicePrefixId':_0xf78dae[_0x1d64('0x96')]}});});return Promise[_0x1d64('0x90')](_0x3f3b90);}});});});}})[_0x1d64('0x3d')](respondWithStatusCode(_0x468479,null))['catch'](handleError(_0x468479,null));};exports[_0x1d64('0x97')]=function(_0x53b2b2,_0x4c9ebf,_0x99e59e){var _0x508dc8={};var _0x1eeaaa={};var _0x1f2790;var _0x4d3af7;return db[_0x1d64('0x3c')]['findOne']({'where':{'id':_0x53b2b2[_0x1d64('0x4e')]['id']}})[_0x1d64('0x3d')](handleEntityNotFound(_0x4c9ebf,null))['then'](function(_0x196f3e){if(_0x196f3e){_0x1f2790=_0x196f3e;_0x1eeaaa[_0x1d64('0x2a')]=_[_0x1d64('0x43')](db[_0x1d64('0x84')]['rawAttributes']);_0x1eeaaa[_0x1d64('0x2c')]=_[_0x1d64('0x43')](_0x53b2b2['query']);_0x1eeaaa['filters']=_[_0x1d64('0x2e')](_0x1eeaaa[_0x1d64('0x2a')],_0x1eeaaa[_0x1d64('0x2c')]);_0x508dc8[_0x1d64('0x2f')]=_['intersection'](_0x1eeaaa[_0x1d64('0x2a')],qs[_0x1d64('0x30')](_0x53b2b2[_0x1d64('0x2c')][_0x1d64('0x30')]));_0x508dc8['attributes']=_0x508dc8['attributes'][_0x1d64('0x31')]?_0x508dc8['attributes']:_0x1eeaaa['model'];_0x508dc8['order']=qs[_0x1d64('0x35')](_0x53b2b2[_0x1d64('0x2c')][_0x1d64('0x35')]);_0x508dc8[_0x1d64('0x38')]=qs[_0x1d64('0x2d')](_['pick'](_0x53b2b2['query'],_0x1eeaaa[_0x1d64('0x2d')]));if(_0x53b2b2['query'][_0x1d64('0x37')]){_0x508dc8['where']=_[_0x1d64('0x44')](_0x508dc8['where'],{'$or':_[_0x1d64('0x2b')](_0x508dc8[_0x1d64('0x2f')],function(_0x169e01){var _0x38e8bb={};_0x38e8bb[_0x169e01]={'$like':'%'+_0x53b2b2[_0x1d64('0x2c')]['filter']+'%'};return _0x38e8bb;})});}_0x508dc8=_[_0x1d64('0x44')]({},_0x508dc8,_0x53b2b2[_0x1d64('0x3b')]);return _0x1f2790[_0x1d64('0x97')](_0x508dc8);}})[_0x1d64('0x3d')](function(_0xb5a420){if(_0xb5a420){_0x4d3af7=_0xb5a420[_0x1d64('0x31')];if(!_0x53b2b2['query']['hasOwnProperty'](_0x1d64('0x33'))){_0x508dc8[_0x1d64('0x1c')]=qs[_0x1d64('0x1c')](_0x53b2b2['query']['limit']);_0x508dc8[_0x1d64('0x1a')]=qs[_0x1d64('0x1a')](_0x53b2b2['query'][_0x1d64('0x1a')]);}return _0x1f2790[_0x1d64('0x97')](_0x508dc8);}})['then'](function(_0x4f2f59){if(_0x4f2f59){return _0x4f2f59?{'count':_0x4d3af7,'rows':_0x4f2f59}:null;}})[_0x1d64('0x3d')](respondWithResult(_0x4c9ebf,null))['catch'](handleError(_0x4c9ebf,null));};
\ No newline at end of file
index a9fc7be..d5230ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc4e=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners','save','update'];(function(_0x261647,_0x26ca21){var _0x1aa897=function(_0x1f174b){while(--_0x1f174b){_0x261647['push'](_0x261647['shift']());}};_0x1aa897(++_0x26ca21);}(_0xcc4e,0x7e));var _0xecc4=function(_0x375f93,_0x4f43b4){_0x375f93=_0x375f93-0x0;var _0x25b418=_0xcc4e[_0x375f93];return _0x25b418;};'use strict';var EventEmitter=require(_0xecc4('0x0'));var Team=require(_0xecc4('0x1'))['db'][_0xecc4('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xecc4('0x3')](0x0);var events={'afterCreate':_0xecc4('0x4'),'afterUpdate':_0xecc4('0x5'),'afterDestroy':_0xecc4('0x6')};function emitEvent(_0x361527){return function(_0x2a24c0,_0x3432e1,_0x1a7da3){TeamEvents['emit'](_0x361527+':'+_0x2a24c0['id'],_0x2a24c0);TeamEvents[_0xecc4('0x7')](_0x361527,_0x2a24c0);_0x1a7da3(null);};}for(var e in events){if(events[_0xecc4('0x8')](e)){var event=events[e];Team[_0xecc4('0x9')](e,emitEvent(event));}}module[_0xecc4('0xa')]=TeamEvents;
\ No newline at end of file
+var _0x0ca2=['emit','hasOwnProperty','hook','exports','Team','save','update','remove'];(function(_0x2eff37,_0x48123d){var _0x57b5d1=function(_0x7240a2){while(--_0x7240a2){_0x2eff37['push'](_0x2eff37['shift']());}};_0x57b5d1(++_0x48123d);}(_0x0ca2,0x1d4));var _0x20ca=function(_0x3f105a,_0x459d89){_0x3f105a=_0x3f105a-0x0;var _0x41a968=_0x0ca2[_0x3f105a];return _0x41a968;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db'][_0x20ca('0x0')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x20ca('0x1'),'afterUpdate':_0x20ca('0x2'),'afterDestroy':_0x20ca('0x3')};function emitEvent(_0x2429da){return function(_0x273718,_0x57b4a6,_0x2c7b4f){TeamEvents['emit'](_0x2429da+':'+_0x273718['id'],_0x273718);TeamEvents[_0x20ca('0x4')](_0x2429da,_0x273718);_0x2c7b4f(null);};}for(var e in events){if(events[_0x20ca('0x5')](e)){var event=events[e];Team[_0x20ca('0x6')](e,emitEvent(event));}}module[_0x20ca('0x7')]=TeamEvents;
\ No newline at end of file
index 4923309..ab43746 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3229=['map','setDataValue','channel','catch','exports','define','Team','teams','Chat','Mail','Voice','Whatsapp','resolve','get','then'];(function(_0x245d76,_0x1c2c6f){var _0x4516f7=function(_0x5e7c49){while(--_0x5e7c49){_0x245d76['push'](_0x245d76['shift']());}};_0x4516f7(++_0x1c2c6f);}(_0x3229,0xd0));var _0x9322=function(_0x36a6ab,_0x58015f){_0x36a6ab=_0x36a6ab-0x0;var _0x526d4a=_0x3229[_0x36a6ab];return _0x526d4a;};'use strict';var _=require('lodash');var attributes=require('./team.attributes');function getQueuesByChannel(_0xde34aa,_0x134b0a){var _0x4f5d03=_0x9322('0x0')+_0x134b0a+'Queues';return _0xde34aa[_0x4f5d03]()[_0x9322('0x1')](function(_0x348b21){return _[_0x9322('0x2')](_0x348b21,function(_0x4c369f){_0x4c369f[_0x9322('0x3')](_0x9322('0x4'),_0x134b0a);return _0x4c369f;});})[_0x9322('0x5')](function(_0x1cea37){throw _0x1cea37;});}module[_0x9322('0x6')]=function(_0x3577b8){return _0x3577b8[_0x9322('0x7')](_0x9322('0x8'),attributes,{'tableName':_0x9322('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x254c89=this;var _0x45e4ea=[_0x9322('0xa'),'Fax',_0x9322('0xb'),'Openchannel','Sms',_0x9322('0xc'),_0x9322('0xd')];return Promise[_0x9322('0xe')]()[_0x9322('0x1')](function(){var _0x1cb360=_[_0x9322('0x2')](_0x45e4ea,function(_0x6eb184){return getQueuesByChannel(_0x254c89,_0x6eb184);});return Promise['all'](_0x1cb360);})['catch'](function(_0x36272d){throw _0x36272d;});}}});};
\ No newline at end of file
+var _0x7e9d=['define','teams','Chat','Fax','Openchannel','Sms','Voice','resolve','all','lodash','get','Queues','then','map','catch','exports'];(function(_0xb8cfbe,_0x2e81b6){var _0x227d51=function(_0x5cb1ff){while(--_0x5cb1ff){_0xb8cfbe['push'](_0xb8cfbe['shift']());}};_0x227d51(++_0x2e81b6);}(_0x7e9d,0x1d9));var _0xd7e9=function(_0x1bc3fb,_0x414971){_0x1bc3fb=_0x1bc3fb-0x0;var _0x3f71c3=_0x7e9d[_0x1bc3fb];return _0x3f71c3;};'use strict';var _=require(_0xd7e9('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x1f8ab8,_0x2a5621){var _0xf97c9c=_0xd7e9('0x1')+_0x2a5621+_0xd7e9('0x2');return _0x1f8ab8[_0xf97c9c]()[_0xd7e9('0x3')](function(_0x491247){return _[_0xd7e9('0x4')](_0x491247,function(_0x68ee12){_0x68ee12['setDataValue']('channel',_0x2a5621);return _0x68ee12;});})[_0xd7e9('0x5')](function(_0x382e88){throw _0x382e88;});}module[_0xd7e9('0x6')]=function(_0x26794e){return _0x26794e[_0xd7e9('0x7')]('Team',attributes,{'tableName':_0xd7e9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x34dbca=this;var _0xf1a4a9=[_0xd7e9('0x9'),_0xd7e9('0xa'),'Mail',_0xd7e9('0xb'),_0xd7e9('0xc'),_0xd7e9('0xd'),'Whatsapp'];return Promise[_0xd7e9('0xe')]()[_0xd7e9('0x3')](function(){var _0x28e1d9=_[_0xd7e9('0x4')](_0xf1a4a9,function(_0x120d07){return getQueuesByChannel(_0x34dbca,_0x120d07);});return Promise[_0xd7e9('0xf')](_0x28e1d9);})[_0xd7e9('0x5')](function(_0xeb2bbf){throw _0xeb2bbf;});}}});};
\ No newline at end of file
index 7e7e865..bd2bb18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc125=['rpc','jayson/promise','client','http','redis','localhost','./team.socket','request','then','info','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Team,\x20%s,\x20%s','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc125,0x1f2));var _0x5c12=function(_0xd52f07,_0x4f19e8){_0xd52f07=_0xd52f07-0x0;var _0xa784dd=_0xc125[_0xd52f07];return _0xa784dd;};'use strict';var _=require(_0x5c12('0x0'));var util=require('util');var moment=require(_0x5c12('0x1'));var BPromise=require(_0x5c12('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c12('0x3'))['db'];var utils=require(_0x5c12('0x4'));var logger=require(_0x5c12('0x5'))(_0x5c12('0x6'));var config=require('../../config/environment');var jayson=require(_0x5c12('0x7'));var client=jayson[_0x5c12('0x8')][_0x5c12('0x9')]({'port':0x232a});config[_0x5c12('0xa')]=_['defaults'](config['redis'],{'host':_0x5c12('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5c12('0xc'))['register'](socket);function respondWithRpcPromise(_0x277309,_0x51fb36,_0x47d039){return new BPromise(function(_0x3f0d47,_0x46311){return client[_0x5c12('0xd')](_0x277309,_0x47d039)[_0x5c12('0xe')](function(_0x483987){logger[_0x5c12('0xf')]('Team,\x20%s,\x20%s',_0x51fb36,'request\x20sent');logger[_0x5c12('0x10')](_0x5c12('0x11'),_0x51fb36,'request\x20sent',JSON[_0x5c12('0x12')](_0x483987));if(_0x483987[_0x5c12('0x13')]){if(_0x483987[_0x5c12('0x13')][_0x5c12('0x14')]===0x1f4){logger[_0x5c12('0x13')]('Team,\x20%s,\x20%s',_0x51fb36,_0x483987[_0x5c12('0x13')][_0x5c12('0x15')]);return _0x46311(_0x483987['error'][_0x5c12('0x15')]);}logger[_0x5c12('0x13')](_0x5c12('0x16'),_0x51fb36,_0x483987[_0x5c12('0x13')][_0x5c12('0x15')]);return _0x3f0d47(_0x483987[_0x5c12('0x13')][_0x5c12('0x15')]);}else{logger[_0x5c12('0xf')]('Team,\x20%s,\x20%s',_0x51fb36,'request\x20sent');_0x3f0d47(_0x483987[_0x5c12('0x17')][_0x5c12('0x15')]);}})['catch'](function(_0x5d28d7){logger[_0x5c12('0x13')](_0x5c12('0x16'),_0x51fb36,_0x5d28d7);_0x46311(_0x5d28d7);});});}
\ No newline at end of file
+var _0xdae5=['error','Team,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','request','then','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','code'];(function(_0xb0a9e0,_0x1302f7){var _0x5d3105=function(_0x352d61){while(--_0x352d61){_0xb0a9e0['push'](_0xb0a9e0['shift']());}};_0x5d3105(++_0x1302f7);}(_0xdae5,0xf8));var _0x5dae=function(_0x54a581,_0x2aa603){_0x54a581=_0x54a581-0x0;var _0x2dc3a9=_0xdae5[_0x54a581];return _0x2dc3a9;};'use strict';var _=require(_0x5dae('0x0'));var util=require(_0x5dae('0x1'));var moment=require(_0x5dae('0x2'));var BPromise=require(_0x5dae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5dae('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5dae('0x5'))(_0x5dae('0x6'));var config=require(_0x5dae('0x7'));var jayson=require(_0x5dae('0x8'));var client=jayson[_0x5dae('0x9')][_0x5dae('0xa')]({'port':0x232a});config[_0x5dae('0xb')]=_[_0x5dae('0xc')](config[_0x5dae('0xb')],{'host':_0x5dae('0xd'),'port':0x18eb});var socket=require(_0x5dae('0xe'))(new Redis(config[_0x5dae('0xb')]));require(_0x5dae('0xf'))['register'](socket);function respondWithRpcPromise(_0x3fd05e,_0x543671,_0x488792){return new BPromise(function(_0x41fe43,_0x3edc37){return client[_0x5dae('0x10')](_0x3fd05e,_0x488792)[_0x5dae('0x11')](function(_0x2f19f1){logger['info']('Team,\x20%s,\x20%s',_0x543671,'request\x20sent');logger[_0x5dae('0x12')](_0x5dae('0x13'),_0x543671,_0x5dae('0x14'),JSON['stringify'](_0x2f19f1));if(_0x2f19f1['error']){if(_0x2f19f1['error'][_0x5dae('0x15')]===0x1f4){logger[_0x5dae('0x16')](_0x5dae('0x17'),_0x543671,_0x2f19f1[_0x5dae('0x16')][_0x5dae('0x18')]);return _0x3edc37(_0x2f19f1[_0x5dae('0x16')]['message']);}logger['error']('Team,\x20%s,\x20%s',_0x543671,_0x2f19f1[_0x5dae('0x16')]['message']);return _0x41fe43(_0x2f19f1[_0x5dae('0x16')]['message']);}else{logger[_0x5dae('0x19')]('Team,\x20%s,\x20%s',_0x543671,_0x5dae('0x14'));_0x41fe43(_0x2f19f1[_0x5dae('0x1a')]['message']);}})['catch'](function(_0x27294a){logger[_0x5dae('0x16')]('Team,\x20%s,\x20%s',_0x543671,_0x27294a);_0x3edc37(_0x27294a);});});}
\ No newline at end of file
index 31edb48..a9d00d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5761=['save','emit','removeListener','register','length','./team.events'];(function(_0x547b27,_0x146be0){var _0x3ed0eb=function(_0x3b4e16){while(--_0x3b4e16){_0x547b27['push'](_0x547b27['shift']());}};_0x3ed0eb(++_0x146be0);}(_0x5761,0x107));var _0x1576=function(_0x26c0e4,_0x267e64){_0x26c0e4=_0x26c0e4-0x0;var _0x2eb3fb=_0x5761[_0x26c0e4];return _0x2eb3fb;};'use strict';var TeamEvents=require(_0x1576('0x0'));var events=[_0x1576('0x1'),'remove','update'];function createListener(_0x1c2e0e,_0x51b296){return function(_0x135234){_0x51b296[_0x1576('0x2')](_0x1c2e0e,_0x135234);};}function removeListener(_0x40123f,_0x2c3c63){return function(){TeamEvents[_0x1576('0x3')](_0x40123f,_0x2c3c63);};}exports[_0x1576('0x4')]=function(_0x5730fd){for(var _0x4dfdf5=0x0,_0x30f503=events[_0x1576('0x5')];_0x4dfdf5<_0x30f503;_0x4dfdf5++){var _0x229cee=events[_0x4dfdf5];var _0x1f814b=createListener('team:'+_0x229cee,_0x5730fd);TeamEvents['on'](_0x229cee,_0x1f814b);}};
\ No newline at end of file
+var _0xcd8a=['length','team:','remove','update','removeListener','register'];(function(_0x498a01,_0x2b395e){var _0xa59631=function(_0x40c799){while(--_0x40c799){_0x498a01['push'](_0x498a01['shift']());}};_0xa59631(++_0x2b395e);}(_0xcd8a,0x164));var _0xacd8=function(_0x4e698c,_0x1ddadc){_0x4e698c=_0x4e698c-0x0;var _0x17dfcf=_0xcd8a[_0x4e698c];return _0x17dfcf;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0xacd8('0x0'),_0xacd8('0x1')];function createListener(_0x485c9e,_0x12630d){return function(_0x4f2063){_0x12630d['emit'](_0x485c9e,_0x4f2063);};}function removeListener(_0x2408f7,_0x2ed2e3){return function(){TeamEvents[_0xacd8('0x2')](_0x2408f7,_0x2ed2e3);};}exports[_0xacd8('0x3')]=function(_0x3b8e48){for(var _0x2d5087=0x0,_0x3d5e7c=events[_0xacd8('0x4')];_0x2d5087<_0x3d5e7c;_0x2d5087++){var _0x55b941=events[_0x2d5087];var _0x594b88=createListener(_0xacd8('0x5')+_0x55b941,_0x3b8e48);TeamEvents['on'](_0x55b941,_0x594b88);}};
\ No newline at end of file
index b2179f4..1160c95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb5e=['sequelize','INTEGER'];(function(_0x5b4313,_0x239782){var _0x57527a=function(_0x28df19){while(--_0x28df19){_0x5b4313['push'](_0x5b4313['shift']());}};_0x57527a(++_0x239782);}(_0xeb5e,0x17c));var _0xeeb5=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xeb5e[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0xeeb5('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0xeeb5('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xeeb5('0x1')]}};
\ No newline at end of file
+var _0x1c42=['exports','INTEGER'];(function(_0x33fa84,_0x179cf8){var _0x342e64=function(_0x3a834f){while(--_0x3a834f){_0x33fa84['push'](_0x33fa84['shift']());}};_0x342e64(++_0x179cf8);}(_0x1c42,0x13a));var _0x21c4=function(_0x42d301,_0x15d9f4){_0x42d301=_0x42d301-0x0;var _0x468781=_0x1c42[_0x42d301];return _0x468781;};'use strict';var Sequelize=require('sequelize');module[_0x21c4('0x0')]={'TeamId':{'type':Sequelize[_0x21c4('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x21c4('0x1')]}};
\ No newline at end of file
index c3314e9..0966cee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcae2=['team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix'];(function(_0x146be0,_0x39a85e){var _0x1bcc25=function(_0x4f871f){while(--_0x4f871f){_0x146be0['push'](_0x146be0['shift']());}};_0x1bcc25(++_0x39a85e);}(_0xcae2,0x143));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2cae('0x0'));var util=require(_0x2cae('0x1'));var logger=require(_0x2cae('0x2'))(_0x2cae('0x3'));var moment=require(_0x2cae('0x4'));var BPromise=require(_0x2cae('0x5'));var rp=require(_0x2cae('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2cae('0x7'));var config=require(_0x2cae('0x8'));var attributes=require(_0x2cae('0x9'));module[_0x2cae('0xa')]=function(_0x57cbf8,_0x3a3e3b){return _0x57cbf8[_0x2cae('0xb')](_0x2cae('0xc'),attributes,{'tableName':_0x2cae('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xed3c=['util','../../config/logger','api','bluebird','request-promise','path','./teamVoicePrefix.attributes','exports','lodash'];(function(_0x1db600,_0x43942d){var _0x581186=function(_0x274241){while(--_0x274241){_0x1db600['push'](_0x1db600['shift']());}};_0x581186(++_0x43942d);}(_0xed3c,0x1a6));var _0xced3=function(_0xfb42e6,_0x5f5d4b){_0xfb42e6=_0xfb42e6-0x0;var _0x27265b=_0xed3c[_0xfb42e6];return _0x27265b;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var logger=require(_0xced3('0x2'))(_0xced3('0x3'));var moment=require('moment');var BPromise=require(_0xced3('0x4'));var rp=require(_0xced3('0x5'));var fs=require('fs');var path=require(_0xced3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xced3('0x7'));module[_0xced3('0x8')]=function(_0x2f92f8,_0x1cd694){return _0x2f92f8['define']('TeamVoicePrefix',attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fd453c0..7474b74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x21ac28,_0x23ba47){var _0x4216a9=function(_0x3df1a2){while(--_0x3df1a2){_0x21ac28['push'](_0x21ac28['shift']());}};_0x4216a9(++_0x23ba47);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xcb91[_0x231e16];return _0x570a7c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3a16b4,_0x1dfc5c){var _0x8eba2f=function(_0x506811){while(--_0x506811){_0x3a16b4['push'](_0x3a16b4['shift']());}};_0x8eba2f(++_0x1dfc5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index a28c615..f92d7f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8524=['exports','INTEGER','sequelize'];(function(_0x2536ff,_0x2f4300){var _0x52e7c6=function(_0x4a0a9f){while(--_0x4a0a9f){_0x2536ff['push'](_0x2536ff['shift']());}};_0x52e7c6(++_0x2f4300);}(_0x8524,0xb9));var _0x4852=function(_0x4a8d4b,_0x1de53b){_0x4a8d4b=_0x4a8d4b-0x0;var _0x535f4b=_0x8524[_0x4a8d4b];return _0x535f4b;};'use strict';var Sequelize=require(_0x4852('0x0'));module[_0x4852('0x1')]={'penalty':{'type':Sequelize[_0x4852('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd48b=['INTEGER','sequelize','exports'];(function(_0x149dfc,_0x3c53df){var _0x4246ce=function(_0x159e35){while(--_0x159e35){_0x149dfc['push'](_0x149dfc['shift']());}};_0x4246ce(++_0x3c53df);}(_0xd48b,0x14e));var _0xbd48=function(_0x786478,_0x2b3c95){_0x786478=_0x786478-0x0;var _0x5524fc=_0xd48b[_0x786478];return _0x5524fc;};'use strict';var Sequelize=require(_0xbd48('0x0'));module[_0xbd48('0x1')]={'penalty':{'type':Sequelize[_0xbd48('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index a1d456b..aca1438 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac21=['team_has_voice_queues','util','../../config/logger','moment','request-promise','path','../../config/environment','exports','define','TeamVoiceQueue'];(function(_0x110bf5,_0x14c4aa){var _0x5b219c=function(_0x4cdeac){while(--_0x4cdeac){_0x110bf5['push'](_0x110bf5['shift']());}};_0x5b219c(++_0x14c4aa);}(_0xac21,0x1af));var _0x1ac2=function(_0xf7a8dd,_0x55636b){_0xf7a8dd=_0xf7a8dd-0x0;var _0x342c29=_0xac21[_0xf7a8dd];return _0x342c29;};'use strict';var _=require('lodash');var util=require(_0x1ac2('0x0'));var logger=require(_0x1ac2('0x1'))('api');var moment=require(_0x1ac2('0x2'));var BPromise=require('bluebird');var rp=require(_0x1ac2('0x3'));var fs=require('fs');var path=require(_0x1ac2('0x4'));var rimraf=require('rimraf');var config=require(_0x1ac2('0x5'));var attributes=require('./teamVoiceQueue.attributes');module[_0x1ac2('0x6')]=function(_0x21a183,_0x2c4cf2){return _0x21a183[_0x1ac2('0x7')](_0x1ac2('0x8'),attributes,{'tableName':_0x1ac2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9567=['lodash','util','../../config/logger','api','moment','path','rimraf','./teamVoiceQueue.attributes','define','TeamVoiceQueue'];(function(_0x2ef38b,_0x564ca4){var _0x1e1797=function(_0x36879e){while(--_0x36879e){_0x2ef38b['push'](_0x2ef38b['shift']());}};_0x1e1797(++_0x564ca4);}(_0x9567,0xdc));var _0x7956=function(_0x430c2d,_0x496c6b){_0x430c2d=_0x430c2d-0x0;var _0x22462b=_0x9567[_0x430c2d];return _0x22462b;};'use strict';var _=require(_0x7956('0x0'));var util=require(_0x7956('0x1'));var logger=require(_0x7956('0x2'))(_0x7956('0x3'));var moment=require(_0x7956('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7956('0x5'));var rimraf=require(_0x7956('0x6'));var config=require('../../config/environment');var attributes=require(_0x7956('0x7'));module['exports']=function(_0x12c09e,_0x48c4b6){return _0x12c09e[_0x7956('0x8')](_0x7956('0x9'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 03e387f..a76e3b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x575f=['rpc','../../config/environment','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x15a4dd,_0x187829){var _0x485988=function(_0x207dbb){while(--_0x207dbb){_0x15a4dd['push'](_0x15a4dd['shift']());}};_0x485988(++_0x187829);}(_0x575f,0xb1));var _0xf575=function(_0x168171,_0x62b837){_0x168171=_0x168171-0x0;var _0x3c2300=_0x575f[_0x168171];return _0x3c2300;};'use strict';var _=require('lodash');var util=require(_0xf575('0x0'));var moment=require(_0xf575('0x1'));var BPromise=require(_0xf575('0x2'));var rs=require(_0xf575('0x3'));var fs=require('fs');var Redis=require(_0xf575('0x4'));var db=require(_0xf575('0x5'))['db'];var utils=require(_0xf575('0x6'));var logger=require('../../config/logger')(_0xf575('0x7'));var config=require(_0xf575('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf575('0x9')][_0xf575('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26c00e,_0x5999f1,_0x14231d){return new BPromise(function(_0x39255f,_0x39f102){return client[_0xf575('0xb')](_0x26c00e,_0x14231d)[_0xf575('0xc')](function(_0x2e4ab8){logger[_0xf575('0xd')](_0xf575('0xe'),_0x5999f1,_0xf575('0xf'));logger[_0xf575('0x10')](_0xf575('0x11'),_0x5999f1,'request\x20sent',JSON['stringify'](_0x2e4ab8));if(_0x2e4ab8['error']){if(_0x2e4ab8[_0xf575('0x12')][_0xf575('0x13')]===0x1f4){logger[_0xf575('0x12')](_0xf575('0xe'),_0x5999f1,_0x2e4ab8[_0xf575('0x12')][_0xf575('0x14')]);return _0x39f102(_0x2e4ab8['error'][_0xf575('0x14')]);}logger[_0xf575('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5999f1,_0x2e4ab8[_0xf575('0x12')][_0xf575('0x14')]);return _0x39255f(_0x2e4ab8[_0xf575('0x12')][_0xf575('0x14')]);}else{logger[_0xf575('0xd')](_0xf575('0xe'),_0x5999f1,_0xf575('0xf'));_0x39255f(_0x2e4ab8[_0xf575('0x15')][_0xf575('0x14')]);}})[_0xf575('0x16')](function(_0x2b18aa){logger[_0xf575('0x12')](_0xf575('0xe'),_0x5999f1,_0x2b18aa);_0x39f102(_0x2b18aa);});});}
\ No newline at end of file
+var _0xa7d7=['message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x19d8ec,_0x33b691){var _0xd7dd90=function(_0x3c9e16){while(--_0x3c9e16){_0x19d8ec['push'](_0x19d8ec['shift']());}};_0xd7dd90(++_0x33b691);}(_0xa7d7,0x179));var _0x7a7d=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0xa7d7[_0x102ff9];return _0x24fa97;};'use strict';var _=require(_0x7a7d('0x0'));var util=require(_0x7a7d('0x1'));var moment=require(_0x7a7d('0x2'));var BPromise=require(_0x7a7d('0x3'));var rs=require(_0x7a7d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a7d('0x5'))['db'];var utils=require(_0x7a7d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x7a7d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7a7d('0x8')][_0x7a7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40a223,_0x234018,_0x3494b8){return new BPromise(function(_0x131422,_0x43f29b){return client[_0x7a7d('0xa')](_0x40a223,_0x3494b8)[_0x7a7d('0xb')](function(_0x55adbf){logger['info'](_0x7a7d('0xc'),_0x234018,'request\x20sent');logger[_0x7a7d('0xd')](_0x7a7d('0xe'),_0x234018,_0x7a7d('0xf'),JSON[_0x7a7d('0x10')](_0x55adbf));if(_0x55adbf[_0x7a7d('0x11')]){if(_0x55adbf[_0x7a7d('0x11')][_0x7a7d('0x12')]===0x1f4){logger[_0x7a7d('0x11')](_0x7a7d('0xc'),_0x234018,_0x55adbf[_0x7a7d('0x11')]['message']);return _0x43f29b(_0x55adbf['error'][_0x7a7d('0x13')]);}logger['error'](_0x7a7d('0xc'),_0x234018,_0x55adbf['error']['message']);return _0x131422(_0x55adbf[_0x7a7d('0x11')]['message']);}else{logger[_0x7a7d('0x14')](_0x7a7d('0xc'),_0x234018,_0x7a7d('0xf'));_0x131422(_0x55adbf['result'][_0x7a7d('0x13')]);}})[_0x7a7d('0x15')](function(_0x3f9462){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x234018,_0x3f9462);_0x43f29b(_0x3f9462);});});}
\ No newline at end of file
index 1728b6d..1864fbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe2c=['isAuthenticated','/:id','show','post','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x9f57ca,_0xede913){var _0x171560=function(_0x5e696c){while(--_0x5e696c){_0x9f57ca['push'](_0x9f57ca['shift']());}};_0x171560(++_0xede913);}(_0xbe2c,0x18f));var _0xcbe2=function(_0x52c6fa,_0x342860){_0x52c6fa=_0x52c6fa-0x0;var _0xbd1a14=_0xbe2c[_0x52c6fa];return _0xbd1a14;};'use strict';var multer=require(_0xcbe2('0x0'));var util=require(_0xcbe2('0x1'));var path=require('path');var timeout=require(_0xcbe2('0x2'));var express=require('express');var router=express[_0xcbe2('0x3')]();var fs_extra=require(_0xcbe2('0x4'));var auth=require(_0xcbe2('0x5'));var interaction=require(_0xcbe2('0x6'));var config=require(_0xcbe2('0x7'));var controller=require('./template.controller');router[_0xcbe2('0x8')]('/',auth[_0xcbe2('0x9')](),controller['index']);router[_0xcbe2('0x8')](_0xcbe2('0xa'),auth[_0xcbe2('0x9')](),controller[_0xcbe2('0xb')]);router[_0xcbe2('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcbe2('0xd')](_0xcbe2('0xa'),auth[_0xcbe2('0x9')](),controller[_0xcbe2('0xe')]);router['delete']('/:id',auth[_0xcbe2('0x9')](),controller[_0xcbe2('0xf')]);module[_0xcbe2('0x10')]=router;
\ No newline at end of file
+var _0x36fe=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','get','/:id','show','post','create','put','update','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x36fe,0x127));var _0xe36f=function(_0x260b48,_0x117977){_0x260b48=_0x260b48-0x0;var _0x3f730b=_0x36fe[_0x260b48];return _0x3f730b;};'use strict';var multer=require(_0xe36f('0x0'));var util=require(_0xe36f('0x1'));var path=require(_0xe36f('0x2'));var timeout=require(_0xe36f('0x3'));var express=require(_0xe36f('0x4'));var router=express[_0xe36f('0x5')]();var fs_extra=require(_0xe36f('0x6'));var auth=require(_0xe36f('0x7'));var interaction=require(_0xe36f('0x8'));var config=require(_0xe36f('0x9'));var controller=require(_0xe36f('0xa'));router['get']('/',auth[_0xe36f('0xb')](),controller['index']);router[_0xe36f('0xc')](_0xe36f('0xd'),auth['isAuthenticated'](),controller[_0xe36f('0xe')]);router[_0xe36f('0xf')]('/',auth['isAuthenticated'](),controller[_0xe36f('0x10')]);router[_0xe36f('0x11')](_0xe36f('0xd'),auth[_0xe36f('0xb')](),controller[_0xe36f('0x12')]);router['delete'](_0xe36f('0xd'),auth['isAuthenticated'](),controller[_0xe36f('0x13')]);module[_0xe36f('0x14')]=router;
\ No newline at end of file
index 33a832e..ab6d0f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69da=['TEXT','sequelize'];(function(_0x148ce5,_0x3cce90){var _0x3858bb=function(_0x9efe19){while(--_0x9efe19){_0x148ce5['push'](_0x148ce5['shift']());}};_0x3858bb(++_0x3cce90);}(_0x69da,0xc7));var _0xa69d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x69da[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xa69d('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xa69d('0x1')]}};
\ No newline at end of file
+var _0x4c80=['TEXT','exports','STRING'];(function(_0x569b94,_0x52336f){var _0x5790ea=function(_0x261a84){while(--_0x261a84){_0x569b94['push'](_0x569b94['shift']());}};_0x5790ea(++_0x52336f);}(_0x4c80,0x1a2));var _0x04c8=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x4c80[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require('sequelize');module[_0x04c8('0x0')]={'name':{'type':Sequelize[_0x04c8('0x1')]},'description':{'type':Sequelize[_0x04c8('0x1')]},'html':{'type':Sequelize[_0x04c8('0x2')]}};
\ No newline at end of file
index e1e5897..f46f9d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa500=['rawAttributes','fieldName','type','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','user','role','Templates','UserProfileSection','userProfileId','autoAssociation','error','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','stack','name','index','map','Template'];(function(_0x5e3022,_0x5ef1ae){var _0x1dd4b7=function(_0x133843){while(--_0x133843){_0x5e3022['push'](_0x5e3022['shift']());}};_0x1dd4b7(++_0x5ef1ae);}(_0xa500,0xd2));var _0x0a50=function(_0x20990d,_0x52a18b){_0x20990d=_0x20990d-0x0;var _0x247f04=_0xa500[_0x20990d];return _0x247f04;};'use strict';var emlformat=require(_0x0a50('0x0'));var rimraf=require(_0x0a50('0x1'));var zipdir=require(_0x0a50('0x2'));var jsonpatch=require(_0x0a50('0x3'));var rp=require('request-promise');var moment=require(_0x0a50('0x4'));var BPromise=require(_0x0a50('0x5'));var Mustache=require(_0x0a50('0x6'));var util=require(_0x0a50('0x7'));var path=require(_0x0a50('0x8'));var sox=require(_0x0a50('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a50('0xa'));var _=require(_0x0a50('0xb'));var squel=require(_0x0a50('0xc'));var crypto=require(_0x0a50('0xd'));var jsforce=require(_0x0a50('0xe'));var deskjs=require(_0x0a50('0xf'));var toCsv=require(_0x0a50('0x10'));var querystring=require(_0x0a50('0x11'));var Papa=require(_0x0a50('0x12'));var Redis=require(_0x0a50('0x13'));var authService=require(_0x0a50('0x14'));var qs=require(_0x0a50('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0a50('0x16'))(_0x0a50('0x17'));var utils=require(_0x0a50('0x18'));var config=require(_0x0a50('0x19'));var licenseUtil=require(_0x0a50('0x1a'));var db=require(_0x0a50('0x1b'))['db'];function respondWithStatusCode(_0x54d7f6,_0x43fc58){_0x43fc58=_0x43fc58||0xcc;return function(_0x11915b){if(_0x11915b){return _0x54d7f6[_0x0a50('0x1c')](_0x43fc58);}return _0x54d7f6[_0x0a50('0x1d')](_0x43fc58)[_0x0a50('0x1e')]();};}function respondWithResult(_0x4d3f29,_0x398ad5){_0x398ad5=_0x398ad5||0xc8;return function(_0x4bb3f6){if(_0x4bb3f6){return _0x4d3f29[_0x0a50('0x1d')](_0x398ad5)[_0x0a50('0x1f')](_0x4bb3f6);}};}function respondWithFilteredResult(_0x1d1a49,_0x494701){return function(_0x2443b1){if(_0x2443b1){var _0x1f70a1=typeof _0x494701[_0x0a50('0x20')]===_0x0a50('0x21')&&typeof _0x494701['limit']===_0x0a50('0x21');var _0x431c2c=_0x2443b1[_0x0a50('0x22')];var _0x572a5e=_0x1f70a1?0x0:_0x494701['offset'];var _0x16f260=_0x1f70a1?_0x2443b1[_0x0a50('0x22')]:_0x494701['offset']+_0x494701[_0x0a50('0x23')];var _0x3d18cc;if(_0x16f260>=_0x431c2c){_0x16f260=_0x431c2c;_0x3d18cc=0xc8;}else{_0x3d18cc=0xce;}_0x1d1a49[_0x0a50('0x1d')](_0x3d18cc);return _0x1d1a49[_0x0a50('0x24')](_0x0a50('0x25'),_0x572a5e+'-'+_0x16f260+'/'+_0x431c2c)[_0x0a50('0x1f')](_0x2443b1);}return null;};}function patchUpdates(_0x8e0e09){return function(_0x332f81){try{jsonpatch[_0x0a50('0x26')](_0x332f81,_0x8e0e09,!![]);}catch(_0x22eb58){return BPromise[_0x0a50('0x27')](_0x22eb58);}return _0x332f81[_0x0a50('0x28')]();};}function saveUpdates(_0x4761e4,_0x32b140){return function(_0x2a3183){if(_0x2a3183){return _0x2a3183[_0x0a50('0x29')](_0x4761e4)['then'](function(_0x413de4){return _0x413de4;});}return null;};}function removeEntity(_0x32272b,_0x39b4f8){return function(_0x195d68){if(_0x195d68){return _0x195d68[_0x0a50('0x2a')]()[_0x0a50('0x2b')](function(){var _0x23ed1d=_0x195d68[_0x0a50('0x2c')]({'plain':!![]});var _0x6c0b2='Templates';return db[_0x0a50('0x2d')]['destroy']({'where':{'type':_0x6c0b2,'resourceId':_0x23ed1d['id']}})[_0x0a50('0x2b')](function(){return _0x195d68;});})[_0x0a50('0x2b')](function(){_0x32272b['status'](0xcc)[_0x0a50('0x1e')]();});}};}function handleEntityNotFound(_0x46fdc0,_0x3a1aa6){return function(_0x46f946){if(!_0x46f946){_0x46fdc0[_0x0a50('0x1c')](0x194);}return _0x46f946;};}function handleError(_0x1ec6dd,_0x4031d5){_0x4031d5=_0x4031d5||0x1f4;return function(_0x451753){logger['error'](_0x451753[_0x0a50('0x2e')]);if(_0x451753[_0x0a50('0x2f')]){delete _0x451753[_0x0a50('0x2f')];}_0x1ec6dd[_0x0a50('0x1d')](_0x4031d5)['send'](_0x451753);};}exports[_0x0a50('0x30')]=function(_0x3940fd,_0x550507){var _0x1a00f3={},_0x193224={},_0x58217a={'count':0x0,'rows':[]};var _0xee6805=_[_0x0a50('0x31')](db[_0x0a50('0x32')][_0x0a50('0x33')],function(_0x327417){return{'name':_0x327417[_0x0a50('0x34')],'type':_0x327417[_0x0a50('0x35')][_0x0a50('0x36')]};});_0x193224['model']=_[_0x0a50('0x31')](_0xee6805,_0x0a50('0x2f'));_0x193224[_0x0a50('0x37')]=_['keys'](_0x3940fd[_0x0a50('0x37')]);_0x193224[_0x0a50('0x38')]=_['intersection'](_0x193224[_0x0a50('0x39')],_0x193224[_0x0a50('0x37')]);_0x1a00f3['attributes']=_[_0x0a50('0x3a')](_0x193224['model'],qs[_0x0a50('0x3b')](_0x3940fd[_0x0a50('0x37')][_0x0a50('0x3b')]));_0x1a00f3[_0x0a50('0x3c')]=_0x1a00f3['attributes'][_0x0a50('0x3d')]?_0x1a00f3[_0x0a50('0x3c')]:_0x193224[_0x0a50('0x39')];if(!_0x3940fd[_0x0a50('0x37')][_0x0a50('0x3e')]('nolimit')){_0x1a00f3[_0x0a50('0x23')]=qs['limit'](_0x3940fd[_0x0a50('0x37')][_0x0a50('0x23')]);_0x1a00f3['offset']=qs[_0x0a50('0x20')](_0x3940fd['query'][_0x0a50('0x20')]);}_0x1a00f3['order']=qs[_0x0a50('0x3f')](_0x3940fd[_0x0a50('0x37')][_0x0a50('0x3f')]);_0x1a00f3[_0x0a50('0x40')]=qs[_0x0a50('0x38')](_[_0x0a50('0x41')](_0x3940fd[_0x0a50('0x37')],_0x193224[_0x0a50('0x38')]),_0xee6805);if(_0x3940fd[_0x0a50('0x37')][_0x0a50('0x42')]){_0x1a00f3[_0x0a50('0x40')]=_[_0x0a50('0x43')](_0x1a00f3[_0x0a50('0x40')],{'$or':_[_0x0a50('0x31')](_0xee6805,function(_0x36e1b8){if(_0x36e1b8[_0x0a50('0x35')]!==_0x0a50('0x44')){var _0x346eb3={};_0x346eb3[_0x36e1b8[_0x0a50('0x2f')]]={'$like':'%'+_0x3940fd[_0x0a50('0x37')][_0x0a50('0x42')]+'%'};return _0x346eb3;}})});}_0x1a00f3=_['merge']({},_0x1a00f3,_0x3940fd[_0x0a50('0x45')]);var _0x455be3={'where':_0x1a00f3[_0x0a50('0x40')]};return db['Template'][_0x0a50('0x22')](_0x455be3)[_0x0a50('0x2b')](function(_0x39d1f1){_0x58217a['count']=_0x39d1f1;if(_0x3940fd[_0x0a50('0x37')][_0x0a50('0x46')]){_0x1a00f3[_0x0a50('0x47')]=[{'all':!![]}];}return db[_0x0a50('0x32')]['findAll'](_0x1a00f3);})[_0x0a50('0x2b')](function(_0x5a0d52){_0x58217a[_0x0a50('0x48')]=_0x5a0d52;return _0x58217a;})[_0x0a50('0x2b')](respondWithFilteredResult(_0x550507,_0x1a00f3))[_0x0a50('0x49')](handleError(_0x550507,null));};exports[_0x0a50('0x4a')]=function(_0x5c1237,_0x1b7f27){var _0x55882b={'raw':!![],'where':{'id':_0x5c1237[_0x0a50('0x4b')]['id']}},_0x497405={};_0x497405[_0x0a50('0x39')]=_[_0x0a50('0x4c')](db[_0x0a50('0x32')][_0x0a50('0x33')]);_0x497405['query']=_[_0x0a50('0x4c')](_0x5c1237['query']);_0x497405[_0x0a50('0x38')]=_[_0x0a50('0x3a')](_0x497405[_0x0a50('0x39')],_0x497405[_0x0a50('0x37')]);_0x55882b[_0x0a50('0x3c')]=_[_0x0a50('0x3a')](_0x497405['model'],qs['fields'](_0x5c1237[_0x0a50('0x37')][_0x0a50('0x3b')]));_0x55882b[_0x0a50('0x3c')]=_0x55882b[_0x0a50('0x3c')][_0x0a50('0x3d')]?_0x55882b['attributes']:_0x497405[_0x0a50('0x39')];if(_0x5c1237[_0x0a50('0x37')][_0x0a50('0x46')]){_0x55882b[_0x0a50('0x47')]=[{'all':!![]}];}_0x55882b=_[_0x0a50('0x43')]({},_0x55882b,_0x5c1237[_0x0a50('0x45')]);return db[_0x0a50('0x32')][_0x0a50('0x4d')](_0x55882b)[_0x0a50('0x2b')](handleEntityNotFound(_0x1b7f27,null))[_0x0a50('0x2b')](respondWithResult(_0x1b7f27,null))[_0x0a50('0x49')](handleError(_0x1b7f27,null));};exports['create']=function(_0x37e841,_0x50eef8){return db['Template'][_0x0a50('0x4e')](_0x37e841[_0x0a50('0x4f')],{})['then'](function(_0x31bcad){var _0x1fbf8a=_0x37e841[_0x0a50('0x50')][_0x0a50('0x2c')]({'plain':!![]});if(!_0x1fbf8a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1fbf8a[_0x0a50('0x51')]===_0x0a50('0x50')){var _0x292156=_0x31bcad['get']({'plain':!![]});var _0x2fdc51=_0x0a50('0x52');return db[_0x0a50('0x53')][_0x0a50('0x4d')]({'where':{'name':_0x2fdc51,'userProfileId':_0x1fbf8a[_0x0a50('0x54')]},'raw':!![]})['then'](function(_0x280cc2){if(_0x280cc2&&_0x280cc2[_0x0a50('0x55')]===0x0){return db[_0x0a50('0x2d')][_0x0a50('0x4e')]({'name':_0x292156['name'],'resourceId':_0x292156['id'],'type':_0x280cc2[_0x0a50('0x2f')],'sectionId':_0x280cc2['id']},{})['then'](function(){return _0x31bcad;});}else{return _0x31bcad;}})['catch'](function(_0x264d67){logger[_0x0a50('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x264d67);throw _0x264d67;});}return _0x31bcad;})[_0x0a50('0x2b')](respondWithResult(_0x50eef8,0xc9))[_0x0a50('0x49')](handleError(_0x50eef8,null));};exports[_0x0a50('0x29')]=function(_0xae54de,_0x42638a){if(_0xae54de[_0x0a50('0x4f')]['id']){delete _0xae54de[_0x0a50('0x4f')]['id'];}return db['Template'][_0x0a50('0x4d')]({'where':{'id':_0xae54de[_0x0a50('0x4b')]['id']}})[_0x0a50('0x2b')](handleEntityNotFound(_0x42638a,null))[_0x0a50('0x2b')](saveUpdates(_0xae54de[_0x0a50('0x4f')],null))[_0x0a50('0x2b')](respondWithResult(_0x42638a,null))['catch'](handleError(_0x42638a,null));};exports[_0x0a50('0x2a')]=function(_0x4ec894,_0x4da993){return db[_0x0a50('0x32')]['find']({'where':{'id':_0x4ec894[_0x0a50('0x4b')]['id']}})[_0x0a50('0x2b')](handleEntityNotFound(_0x4da993,null))['then'](removeEntity(_0x4da993,null))[_0x0a50('0x49')](handleError(_0x4da993,null));};
\ No newline at end of file
+var _0x962c=['index','map','Template','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','intersection','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','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','Templates','end','name','send'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x962c,0x1cd));var _0xc962=function(_0x4ceac0,_0x33f137){_0x4ceac0=_0x4ceac0-0x0;var _0x4d23e4=_0x962c[_0x4ceac0];return _0x4d23e4;};'use strict';var emlformat=require(_0xc962('0x0'));var rimraf=require(_0xc962('0x1'));var zipdir=require(_0xc962('0x2'));var jsonpatch=require(_0xc962('0x3'));var rp=require(_0xc962('0x4'));var moment=require(_0xc962('0x5'));var BPromise=require(_0xc962('0x6'));var Mustache=require(_0xc962('0x7'));var util=require('util');var path=require(_0xc962('0x8'));var sox=require(_0xc962('0x9'));var csv=require('to-csv');var ejs=require(_0xc962('0xa'));var fs=require('fs');var fs_extra=require(_0xc962('0xb'));var _=require(_0xc962('0xc'));var squel=require(_0xc962('0xd'));var crypto=require(_0xc962('0xe'));var jsforce=require(_0xc962('0xf'));var deskjs=require(_0xc962('0x10'));var toCsv=require(_0xc962('0x11'));var querystring=require(_0xc962('0x12'));var Papa=require('papaparse');var Redis=require(_0xc962('0x13'));var authService=require(_0xc962('0x14'));var qs=require(_0xc962('0x15'));var as=require(_0xc962('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc962('0x17'))('api');var utils=require(_0xc962('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc962('0x19'))['db'];function respondWithStatusCode(_0x2969f3,_0x3ffe5a){_0x3ffe5a=_0x3ffe5a||0xcc;return function(_0x50c39a){if(_0x50c39a){return _0x2969f3[_0xc962('0x1a')](_0x3ffe5a);}return _0x2969f3[_0xc962('0x1b')](_0x3ffe5a)['end']();};}function respondWithResult(_0x4e8c80,_0x591be7){_0x591be7=_0x591be7||0xc8;return function(_0x3a858a){if(_0x3a858a){return _0x4e8c80[_0xc962('0x1b')](_0x591be7)['json'](_0x3a858a);}};}function respondWithFilteredResult(_0x62847f,_0x48808a){return function(_0x32e590){if(_0x32e590){var _0xf69253=typeof _0x48808a[_0xc962('0x1c')]===_0xc962('0x1d')&&typeof _0x48808a[_0xc962('0x1e')]===_0xc962('0x1d');var _0xbf1bc3=_0x32e590['count'];var _0x37c5ce=_0xf69253?0x0:_0x48808a[_0xc962('0x1c')];var _0x548396=_0xf69253?_0x32e590[_0xc962('0x1f')]:_0x48808a[_0xc962('0x1c')]+_0x48808a[_0xc962('0x1e')];var _0x500ef2;if(_0x548396>=_0xbf1bc3){_0x548396=_0xbf1bc3;_0x500ef2=0xc8;}else{_0x500ef2=0xce;}_0x62847f[_0xc962('0x1b')](_0x500ef2);return _0x62847f[_0xc962('0x20')](_0xc962('0x21'),_0x37c5ce+'-'+_0x548396+'/'+_0xbf1bc3)[_0xc962('0x22')](_0x32e590);}return null;};}function patchUpdates(_0x11e16b){return function(_0x2788c5){try{jsonpatch[_0xc962('0x23')](_0x2788c5,_0x11e16b,!![]);}catch(_0x561472){return BPromise['reject'](_0x561472);}return _0x2788c5['save']();};}function saveUpdates(_0x3a2624,_0x1e0cc0){return function(_0x4ca97d){if(_0x4ca97d){return _0x4ca97d[_0xc962('0x24')](_0x3a2624)[_0xc962('0x25')](function(_0x5827c8){return _0x5827c8;});}return null;};}function removeEntity(_0x3a1978,_0x3327af){return function(_0x5ea0a1){if(_0x5ea0a1){return _0x5ea0a1['destroy']()['then'](function(){var _0x2cf76a=_0x5ea0a1[_0xc962('0x26')]({'plain':!![]});var _0x4235b3=_0xc962('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x4235b3,'resourceId':_0x2cf76a['id']}})['then'](function(){return _0x5ea0a1;});})[_0xc962('0x25')](function(){_0x3a1978[_0xc962('0x1b')](0xcc)[_0xc962('0x28')]();});}};}function handleEntityNotFound(_0x3f3a37,_0x432879){return function(_0x3b7db0){if(!_0x3b7db0){_0x3f3a37['sendStatus'](0x194);}return _0x3b7db0;};}function handleError(_0x4fae93,_0x437382){_0x437382=_0x437382||0x1f4;return function(_0xd37b81){logger['error'](_0xd37b81['stack']);if(_0xd37b81[_0xc962('0x29')]){delete _0xd37b81[_0xc962('0x29')];}_0x4fae93['status'](_0x437382)[_0xc962('0x2a')](_0xd37b81);};}exports[_0xc962('0x2b')]=function(_0x4727e0,_0x53be29){var _0xed4400={},_0x4f818a={},_0x2ceac7={'count':0x0,'rows':[]};var _0x504547=_[_0xc962('0x2c')](db[_0xc962('0x2d')][_0xc962('0x2e')],function(_0x24e7e2){return{'name':_0x24e7e2[_0xc962('0x2f')],'type':_0x24e7e2['type'][_0xc962('0x30')]};});_0x4f818a[_0xc962('0x31')]=_['map'](_0x504547,_0xc962('0x29'));_0x4f818a['query']=_[_0xc962('0x32')](_0x4727e0[_0xc962('0x33')]);_0x4f818a[_0xc962('0x34')]=_['intersection'](_0x4f818a[_0xc962('0x31')],_0x4f818a[_0xc962('0x33')]);_0xed4400[_0xc962('0x35')]=_['intersection'](_0x4f818a[_0xc962('0x31')],qs[_0xc962('0x36')](_0x4727e0[_0xc962('0x33')][_0xc962('0x36')]));_0xed4400['attributes']=_0xed4400[_0xc962('0x35')][_0xc962('0x37')]?_0xed4400[_0xc962('0x35')]:_0x4f818a['model'];if(!_0x4727e0[_0xc962('0x33')][_0xc962('0x38')]('nolimit')){_0xed4400['limit']=qs['limit'](_0x4727e0[_0xc962('0x33')][_0xc962('0x1e')]);_0xed4400['offset']=qs[_0xc962('0x1c')](_0x4727e0[_0xc962('0x33')][_0xc962('0x1c')]);}_0xed4400[_0xc962('0x39')]=qs['sort'](_0x4727e0[_0xc962('0x33')][_0xc962('0x3a')]);_0xed4400['where']=qs[_0xc962('0x34')](_[_0xc962('0x3b')](_0x4727e0[_0xc962('0x33')],_0x4f818a[_0xc962('0x34')]),_0x504547);if(_0x4727e0['query'][_0xc962('0x3c')]){_0xed4400[_0xc962('0x3d')]=_[_0xc962('0x3e')](_0xed4400[_0xc962('0x3d')],{'$or':_[_0xc962('0x2c')](_0x504547,function(_0x5b325b){if(_0x5b325b[_0xc962('0x3f')]!==_0xc962('0x40')){var _0x3c645b={};_0x3c645b[_0x5b325b[_0xc962('0x29')]]={'$like':'%'+_0x4727e0['query']['filter']+'%'};return _0x3c645b;}})});}_0xed4400=_[_0xc962('0x3e')]({},_0xed4400,_0x4727e0[_0xc962('0x41')]);var _0x285656={'where':_0xed4400[_0xc962('0x3d')]};return db[_0xc962('0x2d')]['count'](_0x285656)[_0xc962('0x25')](function(_0x2e2b06){_0x2ceac7[_0xc962('0x1f')]=_0x2e2b06;if(_0x4727e0[_0xc962('0x33')][_0xc962('0x42')]){_0xed4400[_0xc962('0x43')]=[{'all':!![]}];}return db[_0xc962('0x2d')][_0xc962('0x44')](_0xed4400);})[_0xc962('0x25')](function(_0x59fe9c){_0x2ceac7['rows']=_0x59fe9c;return _0x2ceac7;})[_0xc962('0x25')](respondWithFilteredResult(_0x53be29,_0xed4400))[_0xc962('0x45')](handleError(_0x53be29,null));};exports['show']=function(_0x55a115,_0x5d86e2){var _0x5529dd={'raw':!![],'where':{'id':_0x55a115[_0xc962('0x46')]['id']}},_0x23f53a={};_0x23f53a[_0xc962('0x31')]=_['keys'](db[_0xc962('0x2d')][_0xc962('0x2e')]);_0x23f53a['query']=_['keys'](_0x55a115[_0xc962('0x33')]);_0x23f53a[_0xc962('0x34')]=_['intersection'](_0x23f53a[_0xc962('0x31')],_0x23f53a[_0xc962('0x33')]);_0x5529dd['attributes']=_[_0xc962('0x47')](_0x23f53a[_0xc962('0x31')],qs[_0xc962('0x36')](_0x55a115[_0xc962('0x33')]['fields']));_0x5529dd[_0xc962('0x35')]=_0x5529dd[_0xc962('0x35')]['length']?_0x5529dd[_0xc962('0x35')]:_0x23f53a[_0xc962('0x31')];if(_0x55a115[_0xc962('0x33')][_0xc962('0x42')]){_0x5529dd[_0xc962('0x43')]=[{'all':!![]}];}_0x5529dd=_[_0xc962('0x3e')]({},_0x5529dd,_0x55a115[_0xc962('0x41')]);return db[_0xc962('0x2d')]['find'](_0x5529dd)[_0xc962('0x25')](handleEntityNotFound(_0x5d86e2,null))['then'](respondWithResult(_0x5d86e2,null))['catch'](handleError(_0x5d86e2,null));};exports[_0xc962('0x48')]=function(_0x1f749b,_0x4e4a21){return db[_0xc962('0x2d')][_0xc962('0x48')](_0x1f749b[_0xc962('0x49')],{})[_0xc962('0x25')](function(_0x307942){var _0x2a34a0=_0x1f749b[_0xc962('0x4a')][_0xc962('0x26')]({'plain':!![]});if(!_0x2a34a0)throw new Error(_0xc962('0x4b'));if(_0x2a34a0[_0xc962('0x4c')]===_0xc962('0x4a')){var _0x4eaf5b=_0x307942[_0xc962('0x26')]({'plain':!![]});var _0x1f3c31='Templates';return db[_0xc962('0x4d')][_0xc962('0x4e')]({'where':{'name':_0x1f3c31,'userProfileId':_0x2a34a0[_0xc962('0x4f')]},'raw':!![]})['then'](function(_0x4ea1f8){if(_0x4ea1f8&&_0x4ea1f8[_0xc962('0x50')]===0x0){return db[_0xc962('0x51')][_0xc962('0x48')]({'name':_0x4eaf5b['name'],'resourceId':_0x4eaf5b['id'],'type':_0x4ea1f8[_0xc962('0x29')],'sectionId':_0x4ea1f8['id']},{})[_0xc962('0x25')](function(){return _0x307942;});}else{return _0x307942;}})['catch'](function(_0x339829){logger['error'](_0xc962('0x52'),_0x339829);throw _0x339829;});}return _0x307942;})[_0xc962('0x25')](respondWithResult(_0x4e4a21,0xc9))['catch'](handleError(_0x4e4a21,null));};exports[_0xc962('0x24')]=function(_0x33830b,_0x3d6dfa){if(_0x33830b[_0xc962('0x49')]['id']){delete _0x33830b['body']['id'];}return db[_0xc962('0x2d')][_0xc962('0x4e')]({'where':{'id':_0x33830b[_0xc962('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d6dfa,null))[_0xc962('0x25')](saveUpdates(_0x33830b[_0xc962('0x49')],null))[_0xc962('0x25')](respondWithResult(_0x3d6dfa,null))[_0xc962('0x45')](handleError(_0x3d6dfa,null));};exports[_0xc962('0x53')]=function(_0x28968f,_0x4a6b75){return db['Template'][_0xc962('0x4e')]({'where':{'id':_0x28968f['params']['id']}})[_0xc962('0x25')](handleEntityNotFound(_0x4a6b75,null))[_0xc962('0x25')](removeEntity(_0x4a6b75,null))[_0xc962('0x45')](handleError(_0x4a6b75,null));};
\ No newline at end of file
index 5f2bdbb..0fe7d85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ff1=['./template.attributes','exports','tools_templates','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3b5e46,_0x3c09bd){var _0x4b8cc9=function(_0x3fe105){while(--_0x3fe105){_0x3b5e46['push'](_0x3b5e46['shift']());}};_0x4b8cc9(++_0x3c09bd);}(_0x1ff1,0xc9));var _0x11ff=function(_0xd24aad,_0x190625){_0xd24aad=_0xd24aad-0x0;var _0x482517=_0x1ff1[_0xd24aad];return _0x482517;};'use strict';var _=require(_0x11ff('0x0'));var util=require(_0x11ff('0x1'));var logger=require('../../config/logger')(_0x11ff('0x2'));var moment=require('moment');var BPromise=require(_0x11ff('0x3'));var rp=require(_0x11ff('0x4'));var fs=require('fs');var path=require(_0x11ff('0x5'));var rimraf=require(_0x11ff('0x6'));var config=require(_0x11ff('0x7'));var attributes=require(_0x11ff('0x8'));module[_0x11ff('0x9')]=function(_0x5f59a4,_0x2eda82){return _0x5f59a4['define']('Template',attributes,{'tableName':_0x11ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb05d=['request-promise','rimraf','../../config/environment','exports','Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1dd91c,_0x4c3ced){var _0x5b3e15=function(_0x71901b){while(--_0x71901b){_0x1dd91c['push'](_0x1dd91c['shift']());}};_0x5b3e15(++_0x4c3ced);}(_0xb05d,0xde));var _0xdb05=function(_0xf6e75d,_0xc70967){_0xf6e75d=_0xf6e75d-0x0;var _0x27514d=_0xb05d[_0xf6e75d];return _0x27514d;};'use strict';var _=require(_0xdb05('0x0'));var util=require(_0xdb05('0x1'));var logger=require(_0xdb05('0x2'))(_0xdb05('0x3'));var moment=require(_0xdb05('0x4'));var BPromise=require(_0xdb05('0x5'));var rp=require(_0xdb05('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb05('0x7'));var config=require(_0xdb05('0x8'));var attributes=require('./template.attributes');module[_0xdb05('0x9')]=function(_0xfa22c1,_0xdf68e8){return _0xfa22c1['define'](_0xdb05('0xa'),attributes,{'tableName':_0xdb05('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index be51ec9..9b5e2f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5d9=['map','model','attributes','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','request','then','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Template,\x20%s,\x20%s','message','info','GetTemplate','findAll','options','raw','where','include'];(function(_0x421868,_0xc6cb8a){var _0x2e7c09=function(_0x5503a2){while(--_0x5503a2){_0x421868['push'](_0x421868['shift']());}};_0x2e7c09(++_0xc6cb8a);}(_0xa5d9,0xb8));var _0x9a5d=function(_0x4f37c3,_0x3ff299){_0x4f37c3=_0x4f37c3-0x0;var _0x31f997=_0xa5d9[_0x4f37c3];return _0x31f997;};'use strict';var _=require(_0x9a5d('0x0'));var util=require(_0x9a5d('0x1'));var moment=require(_0x9a5d('0x2'));var BPromise=require(_0x9a5d('0x3'));var rs=require(_0x9a5d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9a5d('0x5'))(_0x9a5d('0x6'));var config=require('../../config/environment');var jayson=require(_0x9a5d('0x7'));var client=jayson[_0x9a5d('0x8')][_0x9a5d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1321d3,_0x31cc09,_0x409f99){return new BPromise(function(_0x1980ce,_0x1b4fd8){return client[_0x9a5d('0xa')](_0x1321d3,_0x409f99)[_0x9a5d('0xb')](function(_0x36a2d4){logger['info']('Template,\x20%s,\x20%s',_0x31cc09,'request\x20sent');logger[_0x9a5d('0xc')](_0x9a5d('0xd'),_0x31cc09,_0x9a5d('0xe'),JSON[_0x9a5d('0xf')](_0x36a2d4));if(_0x36a2d4[_0x9a5d('0x10')]){if(_0x36a2d4[_0x9a5d('0x10')]['code']===0x1f4){logger[_0x9a5d('0x10')](_0x9a5d('0x11'),_0x31cc09,_0x36a2d4[_0x9a5d('0x10')][_0x9a5d('0x12')]);return _0x1b4fd8(_0x36a2d4[_0x9a5d('0x10')]['message']);}logger['error']('Template,\x20%s,\x20%s',_0x31cc09,_0x36a2d4[_0x9a5d('0x10')][_0x9a5d('0x12')]);return _0x1980ce(_0x36a2d4[_0x9a5d('0x10')][_0x9a5d('0x12')]);}else{logger[_0x9a5d('0x13')](_0x9a5d('0x11'),_0x31cc09,_0x9a5d('0xe'));_0x1980ce(_0x36a2d4['result'][_0x9a5d('0x12')]);}})['catch'](function(_0x1dbd13){logger[_0x9a5d('0x10')](_0x9a5d('0x11'),_0x31cc09,_0x1dbd13);_0x1b4fd8(_0x1dbd13);});});}exports[_0x9a5d('0x14')]=function(_0x48eea2){var _0x3f2045=this;return new Promise(function(_0x5ce584,_0x2c28e3){return db['Template'][_0x9a5d('0x15')]({'raw':_0x48eea2[_0x9a5d('0x16')]?_0x48eea2[_0x9a5d('0x16')][_0x9a5d('0x17')]===undefined?!![]:![]:!![],'where':_0x48eea2[_0x9a5d('0x16')]?_0x48eea2[_0x9a5d('0x16')][_0x9a5d('0x18')]||null:null,'attributes':_0x48eea2[_0x9a5d('0x16')]?_0x48eea2[_0x9a5d('0x16')]['attributes']||null:null,'limit':_0x48eea2['options']?_0x48eea2[_0x9a5d('0x16')]['limit']||null:null,'include':_0x48eea2[_0x9a5d('0x16')]?_0x48eea2['options'][_0x9a5d('0x19')]?_[_0x9a5d('0x1a')](_0x48eea2['options']['include'],function(_0x4899a9){return{'model':db[_0x4899a9[_0x9a5d('0x1b')]],'as':_0x4899a9['as'],'attributes':_0x4899a9[_0x9a5d('0x1c')],'include':_0x4899a9[_0x9a5d('0x19')]?_['map'](_0x4899a9[_0x9a5d('0x19')],function(_0x2cb129){return{'model':db[_0x2cb129[_0x9a5d('0x1b')]],'as':_0x2cb129['as'],'attributes':_0x2cb129[_0x9a5d('0x1c')],'include':_0x2cb129[_0x9a5d('0x19')]?_['map'](_0x2cb129[_0x9a5d('0x19')],function(_0x100cd9){return{'model':db[_0x100cd9[_0x9a5d('0x1b')]],'as':_0x100cd9['as'],'attributes':_0x100cd9[_0x9a5d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9a5d('0xb')](function(_0x229610){logger[_0x9a5d('0x13')](_0x9a5d('0x14'),_0x48eea2);logger[_0x9a5d('0xc')](_0x9a5d('0x14'),_0x48eea2,JSON[_0x9a5d('0xf')](_0x229610));_0x5ce584(_0x229610);})[_0x9a5d('0x1d')](function(_0x71fe99){logger[_0x9a5d('0x10')](_0x9a5d('0x14'),_0x71fe99['message'],_0x48eea2);_0x2c28e3(_0x3f2045[_0x9a5d('0x10')](0x1f4,_0x71fe99[_0x9a5d('0x12')]));});});};
\ No newline at end of file
+var _0x6959=['GetTemplate','Template','options','raw','include','model','attributes','map','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x37d085,_0xf39fe4){var _0x4bb272=function(_0x4a4ac4){while(--_0x4a4ac4){_0x37d085['push'](_0x37d085['shift']());}};_0x4bb272(++_0xf39fe4);}(_0x6959,0x6c));var _0x9695=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6959[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x9695('0x0'));var util=require(_0x9695('0x1'));var moment=require(_0x9695('0x2'));var BPromise=require(_0x9695('0x3'));var rs=require(_0x9695('0x4'));var fs=require('fs');var Redis=require(_0x9695('0x5'));var db=require(_0x9695('0x6'))['db'];var utils=require(_0x9695('0x7'));var logger=require(_0x9695('0x8'))(_0x9695('0x9'));var config=require('../../config/environment');var jayson=require(_0x9695('0xa'));var client=jayson[_0x9695('0xb')][_0x9695('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ae625,_0x3786e3,_0x4358e5){return new BPromise(function(_0x32f084,_0x4987e6){return client[_0x9695('0xd')](_0x5ae625,_0x4358e5)['then'](function(_0x46b91f){logger[_0x9695('0xe')](_0x9695('0xf'),_0x3786e3,'request\x20sent');logger[_0x9695('0x10')](_0x9695('0x11'),_0x3786e3,_0x9695('0x12'),JSON[_0x9695('0x13')](_0x46b91f));if(_0x46b91f['error']){if(_0x46b91f[_0x9695('0x14')][_0x9695('0x15')]===0x1f4){logger['error'](_0x9695('0xf'),_0x3786e3,_0x46b91f[_0x9695('0x14')][_0x9695('0x16')]);return _0x4987e6(_0x46b91f[_0x9695('0x14')][_0x9695('0x16')]);}logger['error'](_0x9695('0xf'),_0x3786e3,_0x46b91f['error']['message']);return _0x32f084(_0x46b91f['error'][_0x9695('0x16')]);}else{logger[_0x9695('0xe')]('Template,\x20%s,\x20%s',_0x3786e3,'request\x20sent');_0x32f084(_0x46b91f['result'][_0x9695('0x16')]);}})[_0x9695('0x17')](function(_0x11d2c6){logger[_0x9695('0x14')](_0x9695('0xf'),_0x3786e3,_0x11d2c6);_0x4987e6(_0x11d2c6);});});}exports[_0x9695('0x18')]=function(_0xfba8c2){var _0x548cd3=this;return new Promise(function(_0x1e57c1,_0x5e6bae){return db[_0x9695('0x19')]['findAll']({'raw':_0xfba8c2[_0x9695('0x1a')]?_0xfba8c2['options'][_0x9695('0x1b')]===undefined?!![]:![]:!![],'where':_0xfba8c2['options']?_0xfba8c2[_0x9695('0x1a')]['where']||null:null,'attributes':_0xfba8c2[_0x9695('0x1a')]?_0xfba8c2[_0x9695('0x1a')]['attributes']||null:null,'limit':_0xfba8c2['options']?_0xfba8c2[_0x9695('0x1a')]['limit']||null:null,'include':_0xfba8c2['options']?_0xfba8c2['options'][_0x9695('0x1c')]?_['map'](_0xfba8c2[_0x9695('0x1a')][_0x9695('0x1c')],function(_0x1464c5){return{'model':db[_0x1464c5[_0x9695('0x1d')]],'as':_0x1464c5['as'],'attributes':_0x1464c5[_0x9695('0x1e')],'include':_0x1464c5[_0x9695('0x1c')]?_['map'](_0x1464c5[_0x9695('0x1c')],function(_0x11eb0c){return{'model':db[_0x11eb0c[_0x9695('0x1d')]],'as':_0x11eb0c['as'],'attributes':_0x11eb0c[_0x9695('0x1e')],'include':_0x11eb0c['include']?_[_0x9695('0x1f')](_0x11eb0c[_0x9695('0x1c')],function(_0x177ce4){return{'model':db[_0x177ce4[_0x9695('0x1d')]],'as':_0x177ce4['as'],'attributes':_0x177ce4[_0x9695('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9695('0x20')](function(_0x56a384){logger[_0x9695('0xe')](_0x9695('0x18'),_0xfba8c2);logger[_0x9695('0x10')](_0x9695('0x18'),_0xfba8c2,JSON[_0x9695('0x13')](_0x56a384));_0x1e57c1(_0x56a384);})[_0x9695('0x17')](function(_0x5207f3){logger[_0x9695('0x14')](_0x9695('0x18'),_0x5207f3['message'],_0xfba8c2);_0x5e6bae(_0x548cd3[_0x9695('0x14')](0x1f4,_0x5207f3[_0x9695('0x16')]));});});};
\ No newline at end of file
index 613bfcf..7b95921 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d3f=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','getActions','create','post','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','update','delete','destroy','exports'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_0x7d3f,0xd2));var _0xf7d3=function(_0x4b6778,_0x505a76){_0x4b6778=_0x4b6778-0x0;var _0x22dbb9=_0x7d3f[_0x4b6778];return _0x22dbb9;};'use strict';var multer=require(_0xf7d3('0x0'));var util=require(_0xf7d3('0x1'));var path=require(_0xf7d3('0x2'));var timeout=require(_0xf7d3('0x3'));var express=require(_0xf7d3('0x4'));var router=express[_0xf7d3('0x5')]();var fs_extra=require(_0xf7d3('0x6'));var auth=require(_0xf7d3('0x7'));var interaction=require(_0xf7d3('0x8'));var config=require(_0xf7d3('0x9'));var controller=require('./trigger.controller');router[_0xf7d3('0xa')]('/',auth[_0xf7d3('0xb')](),controller[_0xf7d3('0xc')]);router[_0xf7d3('0xa')](_0xf7d3('0xd'),auth[_0xf7d3('0xb')](),controller[_0xf7d3('0xe')]);router[_0xf7d3('0xa')](_0xf7d3('0xf'),auth['isAuthenticated'](),controller[_0xf7d3('0x10')]);router[_0xf7d3('0xa')]('/:id/any_conditions',auth[_0xf7d3('0xb')](),controller[_0xf7d3('0x11')]);router['get'](_0xf7d3('0x12'),auth[_0xf7d3('0xb')](),controller[_0xf7d3('0x13')]);router['post']('/',auth[_0xf7d3('0xb')](),controller[_0xf7d3('0x14')]);router[_0xf7d3('0x15')]('/:id/all_conditions',auth[_0xf7d3('0xb')](),controller[_0xf7d3('0x16')]);router[_0xf7d3('0x15')](_0xf7d3('0x17'),auth[_0xf7d3('0xb')](),controller[_0xf7d3('0x18')]);router[_0xf7d3('0x15')]('/:id/actions',auth[_0xf7d3('0xb')](),controller[_0xf7d3('0x19')]);router['put'](_0xf7d3('0xd'),auth[_0xf7d3('0xb')](),controller[_0xf7d3('0x1a')]);router[_0xf7d3('0x1b')](_0xf7d3('0xd'),auth['isAuthenticated'](),controller[_0xf7d3('0x1c')]);module[_0xf7d3('0x1d')]=router;
\ No newline at end of file
+var _0xa19c=['path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','get','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','put','/:id','update','destroy','exports','multer','util'];(function(_0x2000ca,_0x23183f){var _0x31b5a8=function(_0x155704){while(--_0x155704){_0x2000ca['push'](_0x2000ca['shift']());}};_0x31b5a8(++_0x23183f);}(_0xa19c,0xce));var _0xca19=function(_0x2b4659,_0x4655d7){_0x2b4659=_0x2b4659-0x0;var _0x35badd=_0xa19c[_0x2b4659];return _0x35badd;};'use strict';var multer=require(_0xca19('0x0'));var util=require(_0xca19('0x1'));var path=require(_0xca19('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xca19('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xca19('0x4'));var interaction=require(_0xca19('0x5'));var config=require(_0xca19('0x6'));var controller=require(_0xca19('0x7'));router['get']('/',auth[_0xca19('0x8')](),controller['index']);router[_0xca19('0x9')]('/:id',auth[_0xca19('0x8')](),controller['show']);router[_0xca19('0x9')](_0xca19('0xa'),auth[_0xca19('0x8')](),controller[_0xca19('0xb')]);router[_0xca19('0x9')]('/:id/any_conditions',auth[_0xca19('0x8')](),controller[_0xca19('0xc')]);router[_0xca19('0x9')](_0xca19('0xd'),auth[_0xca19('0x8')](),controller[_0xca19('0xe')]);router[_0xca19('0xf')]('/',auth[_0xca19('0x8')](),controller[_0xca19('0x10')]);router[_0xca19('0xf')](_0xca19('0xa'),auth['isAuthenticated'](),controller[_0xca19('0x11')]);router[_0xca19('0xf')](_0xca19('0x12'),auth[_0xca19('0x8')](),controller[_0xca19('0x13')]);router[_0xca19('0xf')](_0xca19('0xd'),auth[_0xca19('0x8')](),controller[_0xca19('0x14')]);router[_0xca19('0x15')](_0xca19('0x16'),auth[_0xca19('0x8')](),controller[_0xca19('0x17')]);router['delete'](_0xca19('0x16'),auth[_0xca19('0x8')](),controller[_0xca19('0x18')]);module[_0xca19('0x19')]=router;
\ No newline at end of file
index ec34b01..7270f71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8994=['STRING','BOOLEAN','sequelize'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0x8994,0xe6));var _0x4899=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x8994[_0x4a747d];return _0x3a5b5c;};'use strict';var Sequelize=require(_0x4899('0x0'));module['exports']={'name':{'type':Sequelize[_0x4899('0x1')]},'channel':{'type':Sequelize[_0x4899('0x1')]},'description':{'type':Sequelize[_0x4899('0x1')]},'status':{'type':Sequelize[_0x4899('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xba2a=['BOOLEAN','sequelize','STRING'];(function(_0x28509b,_0x5831ff){var _0x1e0b6=function(_0x37d8a2){while(--_0x37d8a2){_0x28509b['push'](_0x28509b['shift']());}};_0x1e0b6(++_0x5831ff);}(_0xba2a,0x94));var _0xaba2=function(_0x5e5cf0,_0x2d97a9){_0x5e5cf0=_0x5e5cf0-0x0;var _0x486355=_0xba2a[_0x5e5cf0];return _0x486355;};'use strict';var Sequelize=require(_0xaba2('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xaba2('0x1')]},'status':{'type':Sequelize[_0xaba2('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 5337a77..c27fddd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2822=['../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','length','include','find','create','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addAllCondition','TriggerAllId','TriggerAnyId','Condition','getAllConditions','findOne','pick','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x435044,_0x36ab8e){var _0x33d4c6=function(_0x15efa0){while(--_0x15efa0){_0x435044['push'](_0x435044['shift']());}};_0x33d4c6(++_0x36ab8e);}(_0x2822,0xa7));var _0x2282=function(_0x382fb5,_0x50028b){_0x382fb5=_0x382fb5-0x0;var _0x37ac4e=_0x2822[_0x382fb5];return _0x37ac4e;};'use strict';var emlformat=require(_0x2282('0x0'));var rimraf=require(_0x2282('0x1'));var zipdir=require(_0x2282('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2282('0x3'));var moment=require(_0x2282('0x4'));var BPromise=require(_0x2282('0x5'));var Mustache=require(_0x2282('0x6'));var util=require('util');var path=require(_0x2282('0x7'));var sox=require(_0x2282('0x8'));var csv=require(_0x2282('0x9'));var ejs=require(_0x2282('0xa'));var fs=require('fs');var fs_extra=require(_0x2282('0xb'));var _=require('lodash');var squel=require(_0x2282('0xc'));var crypto=require(_0x2282('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2282('0xe'));var toCsv=require(_0x2282('0x9'));var querystring=require(_0x2282('0xf'));var Papa=require(_0x2282('0x10'));var Redis=require('ioredis');var authService=require(_0x2282('0x11'));var qs=require(_0x2282('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2282('0x13'))(_0x2282('0x14'));var utils=require(_0x2282('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2282('0x16'));var db=require(_0x2282('0x17'))['db'];function respondWithStatusCode(_0x4db52e,_0x2b319e){_0x2b319e=_0x2b319e||0xcc;return function(_0x2ed838){if(_0x2ed838){return _0x4db52e[_0x2282('0x18')](_0x2b319e);}return _0x4db52e[_0x2282('0x19')](_0x2b319e)[_0x2282('0x1a')]();};}function respondWithResult(_0x3f1720,_0x15f897){_0x15f897=_0x15f897||0xc8;return function(_0x2b880c){if(_0x2b880c){return _0x3f1720[_0x2282('0x19')](_0x15f897)[_0x2282('0x1b')](_0x2b880c);}};}function respondWithFilteredResult(_0x1745e2,_0x517c9d){return function(_0x39bff7){if(_0x39bff7){var _0x3ea29b=typeof _0x517c9d[_0x2282('0x1c')]==='undefined'&&typeof _0x517c9d[_0x2282('0x1d')]==='undefined';var _0x1e81a5=_0x39bff7[_0x2282('0x1e')];var _0x3d4ec1=_0x3ea29b?0x0:_0x517c9d[_0x2282('0x1c')];var _0x4b9618=_0x3ea29b?_0x39bff7[_0x2282('0x1e')]:_0x517c9d[_0x2282('0x1c')]+_0x517c9d[_0x2282('0x1d')];var _0x102326;if(_0x4b9618>=_0x1e81a5){_0x4b9618=_0x1e81a5;_0x102326=0xc8;}else{_0x102326=0xce;}_0x1745e2[_0x2282('0x19')](_0x102326);return _0x1745e2[_0x2282('0x1f')](_0x2282('0x20'),_0x3d4ec1+'-'+_0x4b9618+'/'+_0x1e81a5)[_0x2282('0x1b')](_0x39bff7);}return null;};}function patchUpdates(_0xdaab73){return function(_0x5ede78){try{jsonpatch[_0x2282('0x21')](_0x5ede78,_0xdaab73,!![]);}catch(_0x1f7b68){return BPromise[_0x2282('0x22')](_0x1f7b68);}return _0x5ede78[_0x2282('0x23')]();};}function saveUpdates(_0x2d6a81,_0x53be69){return function(_0x1cd491){if(_0x1cd491){return _0x1cd491['update'](_0x2d6a81)[_0x2282('0x24')](function(_0x15f63e){return _0x15f63e;});}return null;};}function removeEntity(_0x1107e7,_0x5dea3a){return function(_0x58077e){if(_0x58077e){return _0x58077e[_0x2282('0x25')]()[_0x2282('0x24')](function(){var _0x55fd0a=_0x58077e[_0x2282('0x26')]({'plain':!![]});var _0x45672f=_0x2282('0x27');return db[_0x2282('0x28')][_0x2282('0x25')]({'where':{'type':_0x45672f,'resourceId':_0x55fd0a['id']}})['then'](function(){return _0x58077e;});})[_0x2282('0x24')](function(){_0x1107e7[_0x2282('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ac429,_0x398cfd){return function(_0x2a2e26){if(!_0x2a2e26){_0x1ac429[_0x2282('0x18')](0x194);}return _0x2a2e26;};}function handleError(_0x1b82d6,_0x2f7be1){_0x2f7be1=_0x2f7be1||0x1f4;return function(_0x2eb41a){logger[_0x2282('0x29')](_0x2eb41a[_0x2282('0x2a')]);if(_0x2eb41a[_0x2282('0x2b')]){delete _0x2eb41a[_0x2282('0x2b')];}_0x1b82d6[_0x2282('0x19')](_0x2f7be1)[_0x2282('0x2c')](_0x2eb41a);};}exports[_0x2282('0x2d')]=function(_0x569856,_0x5de90a){var _0x448baf={},_0x34f468={},_0x46ba6c={'count':0x0,'rows':[]};var _0x48d5ed=_[_0x2282('0x2e')](db[_0x2282('0x2f')][_0x2282('0x30')],function(_0x5f56b2){return{'name':_0x5f56b2[_0x2282('0x31')],'type':_0x5f56b2['type'][_0x2282('0x32')]};});_0x34f468[_0x2282('0x33')]=_[_0x2282('0x2e')](_0x48d5ed,_0x2282('0x2b'));_0x34f468['query']=_[_0x2282('0x34')](_0x569856['query']);_0x34f468[_0x2282('0x35')]=_[_0x2282('0x36')](_0x34f468[_0x2282('0x33')],_0x34f468[_0x2282('0x37')]);_0x448baf[_0x2282('0x38')]=_[_0x2282('0x36')](_0x34f468[_0x2282('0x33')],qs[_0x2282('0x39')](_0x569856[_0x2282('0x37')][_0x2282('0x39')]));_0x448baf['attributes']=_0x448baf[_0x2282('0x38')]['length']?_0x448baf['attributes']:_0x34f468[_0x2282('0x33')];if(!_0x569856['query'][_0x2282('0x3a')](_0x2282('0x3b'))){_0x448baf[_0x2282('0x1d')]=qs[_0x2282('0x1d')](_0x569856[_0x2282('0x37')][_0x2282('0x1d')]);_0x448baf['offset']=qs[_0x2282('0x1c')](_0x569856[_0x2282('0x37')][_0x2282('0x1c')]);}_0x448baf[_0x2282('0x3c')]=qs[_0x2282('0x3d')](_0x569856[_0x2282('0x37')][_0x2282('0x3d')]);_0x448baf[_0x2282('0x3e')]=qs[_0x2282('0x35')](_['pick'](_0x569856[_0x2282('0x37')],_0x34f468[_0x2282('0x35')]),_0x48d5ed);if(_0x569856[_0x2282('0x37')][_0x2282('0x3f')]){_0x448baf[_0x2282('0x3e')]=_['merge'](_0x448baf[_0x2282('0x3e')],{'$or':_[_0x2282('0x2e')](_0x48d5ed,function(_0x32ed05){if(_0x32ed05[_0x2282('0x40')]!==_0x2282('0x41')){var _0x82702a={};_0x82702a[_0x32ed05[_0x2282('0x2b')]]={'$like':'%'+_0x569856[_0x2282('0x37')][_0x2282('0x3f')]+'%'};return _0x82702a;}})});}_0x448baf=_[_0x2282('0x42')]({},_0x448baf,_0x569856[_0x2282('0x43')]);var _0x4630b4={'where':_0x448baf['where']};return db[_0x2282('0x2f')][_0x2282('0x1e')](_0x4630b4)[_0x2282('0x24')](function(_0x3a937a){_0x46ba6c[_0x2282('0x1e')]=_0x3a937a;if(_0x569856[_0x2282('0x37')][_0x2282('0x44')]){_0x448baf['include']=[{'all':!![]}];}return db[_0x2282('0x2f')][_0x2282('0x45')](_0x448baf);})[_0x2282('0x24')](function(_0x5a1b91){_0x46ba6c[_0x2282('0x46')]=_0x5a1b91;return _0x46ba6c;})[_0x2282('0x24')](respondWithFilteredResult(_0x5de90a,_0x448baf))[_0x2282('0x47')](handleError(_0x5de90a,null));};exports['show']=function(_0x27c302,_0x52d407){var _0x4378b2={'raw':![],'where':{'id':_0x27c302[_0x2282('0x48')]['id']}},_0x23478c={};_0x23478c[_0x2282('0x33')]=_[_0x2282('0x34')](db[_0x2282('0x2f')][_0x2282('0x30')]);_0x23478c[_0x2282('0x37')]=_[_0x2282('0x34')](_0x27c302[_0x2282('0x37')]);_0x23478c[_0x2282('0x35')]=_[_0x2282('0x36')](_0x23478c[_0x2282('0x33')],_0x23478c[_0x2282('0x37')]);_0x4378b2[_0x2282('0x38')]=_[_0x2282('0x36')](_0x23478c[_0x2282('0x33')],qs[_0x2282('0x39')](_0x27c302[_0x2282('0x37')][_0x2282('0x39')]));_0x4378b2[_0x2282('0x38')]=_0x4378b2[_0x2282('0x38')][_0x2282('0x49')]?_0x4378b2[_0x2282('0x38')]:_0x23478c[_0x2282('0x33')];if(_0x27c302['query'][_0x2282('0x44')]){_0x4378b2[_0x2282('0x4a')]=[{'all':!![]}];}_0x4378b2=_[_0x2282('0x42')]({},_0x4378b2,_0x27c302[_0x2282('0x43')]);return db['Trigger'][_0x2282('0x4b')](_0x4378b2)[_0x2282('0x24')](handleEntityNotFound(_0x52d407,null))['then'](respondWithResult(_0x52d407,null))[_0x2282('0x47')](handleError(_0x52d407,null));};exports[_0x2282('0x4c')]=function(_0x5347c6,_0x5e2e34){return db['Trigger'][_0x2282('0x4c')](_0x5347c6['body'],{})[_0x2282('0x24')](function(_0x2ba21b){var _0x234366=_0x5347c6['user'][_0x2282('0x26')]({'plain':!![]});if(!_0x234366)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x234366['role']==='user'){var _0x3592ff=_0x2ba21b[_0x2282('0x26')]({'plain':!![]});var _0x19fc51=_0x2282('0x27');return db[_0x2282('0x4d')][_0x2282('0x4b')]({'where':{'name':_0x19fc51,'userProfileId':_0x234366[_0x2282('0x4e')]},'raw':!![]})[_0x2282('0x24')](function(_0x3f9fa1){if(_0x3f9fa1&&_0x3f9fa1[_0x2282('0x4f')]===0x0){return db[_0x2282('0x28')]['create']({'name':_0x3592ff[_0x2282('0x2b')],'resourceId':_0x3592ff['id'],'type':_0x3f9fa1['name'],'sectionId':_0x3f9fa1['id']},{})['then'](function(){return _0x2ba21b;});}else{return _0x2ba21b;}})['catch'](function(_0x1fbf45){logger[_0x2282('0x29')](_0x2282('0x50'),_0x1fbf45);throw _0x1fbf45;});}return _0x2ba21b;})['then'](respondWithResult(_0x5e2e34,0xc9))[_0x2282('0x47')](handleError(_0x5e2e34,null));};exports[_0x2282('0x51')]=function(_0x59288e,_0x5a08f8){if(_0x59288e[_0x2282('0x52')]['id']){delete _0x59288e['body']['id'];}return db[_0x2282('0x2f')][_0x2282('0x4b')]({'where':{'id':_0x59288e['params']['id']}})[_0x2282('0x24')](handleEntityNotFound(_0x5a08f8,null))[_0x2282('0x24')](saveUpdates(_0x59288e[_0x2282('0x52')],null))[_0x2282('0x24')](respondWithResult(_0x5a08f8,null))['catch'](handleError(_0x5a08f8,null));};exports[_0x2282('0x25')]=function(_0x5af649,_0x2c7185){return db[_0x2282('0x2f')][_0x2282('0x4b')]({'where':{'id':_0x5af649['params']['id']}})[_0x2282('0x24')](handleEntityNotFound(_0x2c7185,null))[_0x2282('0x24')](removeEntity(_0x2c7185,null))[_0x2282('0x47')](handleError(_0x2c7185,null));};exports[_0x2282('0x53')]=function(_0x1b0938,_0xf50184,_0x4edb21){if(_0x1b0938[_0x2282('0x52')]['id']){delete _0x1b0938['body']['id'];}return db[_0x2282('0x2f')][_0x2282('0x4b')]({'where':{'id':_0x1b0938[_0x2282('0x48')]['id']}})['then'](handleEntityNotFound(_0xf50184,null))[_0x2282('0x24')](function(_0x16b38d){if(_0x16b38d){_0x1b0938[_0x2282('0x52')][_0x2282('0x54')]=_0x16b38d['id'];return db['Condition'][_0x2282('0x4c')](_0x1b0938[_0x2282('0x52')]);}})[_0x2282('0x24')](respondWithResult(_0xf50184,null))[_0x2282('0x47')](handleError(_0xf50184,null));};exports['addAnyCondition']=function(_0x55d55d,_0x1026aa,_0x4d77d4){if(_0x55d55d[_0x2282('0x52')]['id']){delete _0x55d55d['body']['id'];}return db[_0x2282('0x2f')][_0x2282('0x4b')]({'where':{'id':_0x55d55d[_0x2282('0x48')]['id']}})[_0x2282('0x24')](handleEntityNotFound(_0x1026aa,null))[_0x2282('0x24')](function(_0x23fc7c){if(_0x23fc7c){_0x55d55d[_0x2282('0x52')][_0x2282('0x55')]=_0x23fc7c['id'];return db[_0x2282('0x56')][_0x2282('0x4c')](_0x55d55d[_0x2282('0x52')]);}})[_0x2282('0x24')](respondWithResult(_0x1026aa,null))[_0x2282('0x47')](handleError(_0x1026aa,null));};exports[_0x2282('0x57')]=function(_0x3c382d,_0x2065df,_0x2e12b0){var _0x1ef1a2={};var _0x515262={};var _0x24f6f0;var _0x22772a;return db[_0x2282('0x2f')][_0x2282('0x58')]({'where':{'id':_0x3c382d[_0x2282('0x48')]['id']}})[_0x2282('0x24')](handleEntityNotFound(_0x2065df,null))['then'](function(_0x491fb8){if(_0x491fb8){_0x24f6f0=_0x491fb8;_0x515262[_0x2282('0x33')]=_[_0x2282('0x34')](db['Condition'][_0x2282('0x30')]);_0x515262['query']=_[_0x2282('0x34')](_0x3c382d[_0x2282('0x37')]);_0x515262[_0x2282('0x35')]=_['intersection'](_0x515262[_0x2282('0x33')],_0x515262[_0x2282('0x37')]);_0x1ef1a2[_0x2282('0x38')]=_['intersection'](_0x515262[_0x2282('0x33')],qs['fields'](_0x3c382d[_0x2282('0x37')][_0x2282('0x39')]));_0x1ef1a2[_0x2282('0x38')]=_0x1ef1a2[_0x2282('0x38')]['length']?_0x1ef1a2[_0x2282('0x38')]:_0x515262['model'];_0x1ef1a2[_0x2282('0x3c')]=qs[_0x2282('0x3d')](_0x3c382d[_0x2282('0x37')]['sort']);_0x1ef1a2['where']=qs[_0x2282('0x35')](_[_0x2282('0x59')](_0x3c382d[_0x2282('0x37')],_0x515262[_0x2282('0x35')]));if(_0x3c382d['query'][_0x2282('0x3f')]){_0x1ef1a2['where']=_[_0x2282('0x42')](_0x1ef1a2[_0x2282('0x3e')],{'$or':_['map'](_0x1ef1a2[_0x2282('0x38')],function(_0x40d6ac){var _0x4794f3={};_0x4794f3[_0x40d6ac]={'$like':'%'+_0x3c382d[_0x2282('0x37')][_0x2282('0x3f')]+'%'};return _0x4794f3;})});}_0x1ef1a2=_[_0x2282('0x42')]({},_0x1ef1a2,_0x3c382d[_0x2282('0x43')]);return _0x24f6f0[_0x2282('0x57')](_0x1ef1a2);}})[_0x2282('0x24')](function(_0x2bba32){if(_0x2bba32){_0x22772a=_0x2bba32['length'];if(!_0x3c382d[_0x2282('0x37')][_0x2282('0x3a')](_0x2282('0x3b'))){_0x1ef1a2['limit']=qs['limit'](_0x3c382d[_0x2282('0x37')][_0x2282('0x1d')]);_0x1ef1a2['offset']=qs[_0x2282('0x1c')](_0x3c382d['query'][_0x2282('0x1c')]);}return _0x24f6f0[_0x2282('0x57')](_0x1ef1a2);}})[_0x2282('0x24')](function(_0x17bcbb){if(_0x17bcbb){return _0x17bcbb?{'count':_0x22772a,'rows':_0x17bcbb}:null;}})[_0x2282('0x24')](respondWithResult(_0x2065df,null))[_0x2282('0x47')](handleError(_0x2065df,null));};exports[_0x2282('0x5a')]=function(_0xa99d3c,_0x2a6443,_0x291e14){var _0x3bc868={};var _0x4367de={};var _0x13ccc7;var _0x22107c;return db['Trigger'][_0x2282('0x58')]({'where':{'id':_0xa99d3c['params']['id']}})[_0x2282('0x24')](handleEntityNotFound(_0x2a6443,null))['then'](function(_0x3dd3ea){if(_0x3dd3ea){_0x13ccc7=_0x3dd3ea;_0x4367de[_0x2282('0x33')]=_[_0x2282('0x34')](db[_0x2282('0x56')][_0x2282('0x30')]);_0x4367de[_0x2282('0x37')]=_[_0x2282('0x34')](_0xa99d3c[_0x2282('0x37')]);_0x4367de[_0x2282('0x35')]=_['intersection'](_0x4367de['model'],_0x4367de['query']);_0x3bc868[_0x2282('0x38')]=_[_0x2282('0x36')](_0x4367de[_0x2282('0x33')],qs[_0x2282('0x39')](_0xa99d3c[_0x2282('0x37')]['fields']));_0x3bc868['attributes']=_0x3bc868[_0x2282('0x38')]['length']?_0x3bc868['attributes']:_0x4367de[_0x2282('0x33')];_0x3bc868[_0x2282('0x3c')]=qs[_0x2282('0x3d')](_0xa99d3c[_0x2282('0x37')][_0x2282('0x3d')]);_0x3bc868['where']=qs[_0x2282('0x35')](_[_0x2282('0x59')](_0xa99d3c[_0x2282('0x37')],_0x4367de['filters']));if(_0xa99d3c[_0x2282('0x37')][_0x2282('0x3f')]){_0x3bc868[_0x2282('0x3e')]=_[_0x2282('0x42')](_0x3bc868[_0x2282('0x3e')],{'$or':_[_0x2282('0x2e')](_0x3bc868[_0x2282('0x38')],function(_0x1d9bb9){var _0x5e7eef={};_0x5e7eef[_0x1d9bb9]={'$like':'%'+_0xa99d3c[_0x2282('0x37')][_0x2282('0x3f')]+'%'};return _0x5e7eef;})});}_0x3bc868=_[_0x2282('0x42')]({},_0x3bc868,_0xa99d3c[_0x2282('0x43')]);return _0x13ccc7['getAnyConditions'](_0x3bc868);}})['then'](function(_0x98ff0e){if(_0x98ff0e){_0x22107c=_0x98ff0e['length'];if(!_0xa99d3c[_0x2282('0x37')][_0x2282('0x3a')](_0x2282('0x3b'))){_0x3bc868[_0x2282('0x1d')]=qs[_0x2282('0x1d')](_0xa99d3c['query'][_0x2282('0x1d')]);_0x3bc868[_0x2282('0x1c')]=qs[_0x2282('0x1c')](_0xa99d3c['query'][_0x2282('0x1c')]);}return _0x13ccc7['getAnyConditions'](_0x3bc868);}})['then'](function(_0x86eef6){if(_0x86eef6){return _0x86eef6?{'count':_0x22107c,'rows':_0x86eef6}:null;}})[_0x2282('0x24')](respondWithResult(_0x2a6443,null))[_0x2282('0x47')](handleError(_0x2a6443,null));};exports[_0x2282('0x5b')]=function(_0x1d70fc,_0xd007f2,_0x2868ba){if(_0x1d70fc['body']['id']){delete _0x1d70fc[_0x2282('0x52')]['id'];}return db[_0x2282('0x2f')]['find']({'where':{'id':_0x1d70fc[_0x2282('0x48')]['id']}})['then'](handleEntityNotFound(_0xd007f2,null))[_0x2282('0x24')](function(_0x14637f){if(_0x14637f){_0x1d70fc[_0x2282('0x52')][_0x2282('0x5c')]=_0x14637f['id'];return db[_0x2282('0x5d')][_0x2282('0x4c')](_0x1d70fc[_0x2282('0x52')]);}})['then'](respondWithResult(_0xd007f2,null))[_0x2282('0x47')](handleError(_0xd007f2,null));};exports[_0x2282('0x5e')]=function(_0x5bb9ce,_0x3e52a4,_0x475581){var _0x1e2cbc={};var _0x5dd043={};var _0x30044f;var _0x4aae24;return db['Trigger'][_0x2282('0x58')]({'where':{'id':_0x5bb9ce[_0x2282('0x48')]['id']}})[_0x2282('0x24')](handleEntityNotFound(_0x3e52a4,null))[_0x2282('0x24')](function(_0x342309){if(_0x342309){_0x30044f=_0x342309;_0x5dd043[_0x2282('0x33')]=_['keys'](db[_0x2282('0x5d')]['rawAttributes']);_0x5dd043[_0x2282('0x37')]=_[_0x2282('0x34')](_0x5bb9ce[_0x2282('0x37')]);_0x5dd043[_0x2282('0x35')]=_[_0x2282('0x36')](_0x5dd043[_0x2282('0x33')],_0x5dd043['query']);_0x1e2cbc['attributes']=_[_0x2282('0x36')](_0x5dd043['model'],qs[_0x2282('0x39')](_0x5bb9ce[_0x2282('0x37')][_0x2282('0x39')]));_0x1e2cbc[_0x2282('0x38')]=_0x1e2cbc['attributes']['length']?_0x1e2cbc['attributes']:_0x5dd043[_0x2282('0x33')];_0x1e2cbc['order']=qs[_0x2282('0x3d')](_0x5bb9ce[_0x2282('0x37')][_0x2282('0x3d')]);_0x1e2cbc['where']=qs['filters'](_[_0x2282('0x59')](_0x5bb9ce[_0x2282('0x37')],_0x5dd043[_0x2282('0x35')]));if(_0x5bb9ce['query'][_0x2282('0x3f')]){_0x1e2cbc['where']=_[_0x2282('0x42')](_0x1e2cbc[_0x2282('0x3e')],{'$or':_['map'](_0x1e2cbc['attributes'],function(_0x4d5ab4){var _0x22e033={};_0x22e033[_0x4d5ab4]={'$like':'%'+_0x5bb9ce[_0x2282('0x37')][_0x2282('0x3f')]+'%'};return _0x22e033;})});}_0x1e2cbc=_['merge']({},_0x1e2cbc,_0x5bb9ce[_0x2282('0x43')]);return _0x30044f['getActions'](_0x1e2cbc);}})[_0x2282('0x24')](function(_0x317863){if(_0x317863){_0x4aae24=_0x317863[_0x2282('0x49')];if(!_0x5bb9ce[_0x2282('0x37')][_0x2282('0x3a')](_0x2282('0x3b'))){_0x1e2cbc[_0x2282('0x1d')]=qs[_0x2282('0x1d')](_0x5bb9ce['query']['limit']);_0x1e2cbc[_0x2282('0x1c')]=qs[_0x2282('0x1c')](_0x5bb9ce['query']['offset']);}return _0x30044f[_0x2282('0x5e')](_0x1e2cbc);}})[_0x2282('0x24')](function(_0x2a2665){if(_0x2a2665){return _0x2a2665?{'count':_0x4aae24,'rows':_0x2a2665}:null;}})[_0x2282('0x24')](respondWithResult(_0x3e52a4,null))['catch'](handleError(_0x3e52a4,null));};
\ No newline at end of file
+var _0x16f4=['stack','name','send','index','Trigger','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','map','VIRTUAL','merge','options','include','findAll','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addAllCondition','params','Condition','addAnyCondition','TriggerAnyId','order','getAllConditions','nolimit','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','get','Triggers','error'];(function(_0x3621ea,_0x3f585b){var _0x4e86b4=function(_0x85142f){while(--_0x85142f){_0x3621ea['push'](_0x3621ea['shift']());}};_0x4e86b4(++_0x3f585b);}(_0x16f4,0xf3));var _0x416f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x16f4[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x416f('0x0'));var zipdir=require(_0x416f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x416f('0x2'));var moment=require(_0x416f('0x3'));var BPromise=require(_0x416f('0x4'));var Mustache=require(_0x416f('0x5'));var util=require(_0x416f('0x6'));var path=require(_0x416f('0x7'));var sox=require(_0x416f('0x8'));var csv=require(_0x416f('0x9'));var ejs=require(_0x416f('0xa'));var fs=require('fs');var fs_extra=require(_0x416f('0xb'));var _=require('lodash');var squel=require(_0x416f('0xc'));var crypto=require(_0x416f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x416f('0xe'));var toCsv=require(_0x416f('0x9'));var querystring=require(_0x416f('0xf'));var Papa=require('papaparse');var Redis=require(_0x416f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x416f('0x11'));var as=require(_0x416f('0x12'));var hardwareService=require(_0x416f('0x13'));var logger=require(_0x416f('0x14'))(_0x416f('0x15'));var utils=require(_0x416f('0x16'));var config=require(_0x416f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x416f('0x18'))['db'];function respondWithStatusCode(_0x156e4c,_0x4b3d7e){_0x4b3d7e=_0x4b3d7e||0xcc;return function(_0x64e050){if(_0x64e050){return _0x156e4c[_0x416f('0x19')](_0x4b3d7e);}return _0x156e4c[_0x416f('0x1a')](_0x4b3d7e)[_0x416f('0x1b')]();};}function respondWithResult(_0x4a1c98,_0x465742){_0x465742=_0x465742||0xc8;return function(_0x241245){if(_0x241245){return _0x4a1c98[_0x416f('0x1a')](_0x465742)[_0x416f('0x1c')](_0x241245);}};}function respondWithFilteredResult(_0x18ead8,_0x523462){return function(_0x1cfea1){if(_0x1cfea1){var _0x173324=typeof _0x523462[_0x416f('0x1d')]==='undefined'&&typeof _0x523462[_0x416f('0x1e')]===_0x416f('0x1f');var _0x3ea57d=_0x1cfea1[_0x416f('0x20')];var _0x100440=_0x173324?0x0:_0x523462['offset'];var _0x34d066=_0x173324?_0x1cfea1[_0x416f('0x20')]:_0x523462[_0x416f('0x1d')]+_0x523462[_0x416f('0x1e')];var _0x2ac537;if(_0x34d066>=_0x3ea57d){_0x34d066=_0x3ea57d;_0x2ac537=0xc8;}else{_0x2ac537=0xce;}_0x18ead8[_0x416f('0x1a')](_0x2ac537);return _0x18ead8[_0x416f('0x21')](_0x416f('0x22'),_0x100440+'-'+_0x34d066+'/'+_0x3ea57d)[_0x416f('0x1c')](_0x1cfea1);}return null;};}function patchUpdates(_0x25a874){return function(_0x220ca5){try{jsonpatch[_0x416f('0x23')](_0x220ca5,_0x25a874,!![]);}catch(_0x3581c2){return BPromise[_0x416f('0x24')](_0x3581c2);}return _0x220ca5['save']();};}function saveUpdates(_0x425f6d,_0x310c3e){return function(_0x47004c){if(_0x47004c){return _0x47004c[_0x416f('0x25')](_0x425f6d)[_0x416f('0x26')](function(_0x3a80e2){return _0x3a80e2;});}return null;};}function removeEntity(_0x19a1db,_0x281255){return function(_0xdefb11){if(_0xdefb11){return _0xdefb11['destroy']()[_0x416f('0x26')](function(){var _0x226b4e=_0xdefb11[_0x416f('0x27')]({'plain':!![]});var _0x2f6fa8=_0x416f('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x2f6fa8,'resourceId':_0x226b4e['id']}})[_0x416f('0x26')](function(){return _0xdefb11;});})['then'](function(){_0x19a1db[_0x416f('0x1a')](0xcc)[_0x416f('0x1b')]();});}};}function handleEntityNotFound(_0x1f8741,_0x5ea498){return function(_0x48c1cb){if(!_0x48c1cb){_0x1f8741[_0x416f('0x19')](0x194);}return _0x48c1cb;};}function handleError(_0x2bf83f,_0x4f9cf8){_0x4f9cf8=_0x4f9cf8||0x1f4;return function(_0x301209){logger[_0x416f('0x29')](_0x301209[_0x416f('0x2a')]);if(_0x301209[_0x416f('0x2b')]){delete _0x301209[_0x416f('0x2b')];}_0x2bf83f[_0x416f('0x1a')](_0x4f9cf8)[_0x416f('0x2c')](_0x301209);};}exports[_0x416f('0x2d')]=function(_0x57d764,_0x1339a2){var _0x4329c0={},_0x192437={},_0x58f528={'count':0x0,'rows':[]};var _0x5dce0b=_['map'](db[_0x416f('0x2e')][_0x416f('0x2f')],function(_0x5e49a8){return{'name':_0x5e49a8[_0x416f('0x30')],'type':_0x5e49a8['type'][_0x416f('0x31')]};});_0x192437[_0x416f('0x32')]=_['map'](_0x5dce0b,_0x416f('0x2b'));_0x192437[_0x416f('0x33')]=_[_0x416f('0x34')](_0x57d764['query']);_0x192437[_0x416f('0x35')]=_[_0x416f('0x36')](_0x192437[_0x416f('0x32')],_0x192437['query']);_0x4329c0[_0x416f('0x37')]=_[_0x416f('0x36')](_0x192437[_0x416f('0x32')],qs[_0x416f('0x38')](_0x57d764[_0x416f('0x33')]['fields']));_0x4329c0['attributes']=_0x4329c0[_0x416f('0x37')][_0x416f('0x39')]?_0x4329c0[_0x416f('0x37')]:_0x192437[_0x416f('0x32')];if(!_0x57d764[_0x416f('0x33')][_0x416f('0x3a')]('nolimit')){_0x4329c0[_0x416f('0x1e')]=qs['limit'](_0x57d764[_0x416f('0x33')][_0x416f('0x1e')]);_0x4329c0[_0x416f('0x1d')]=qs['offset'](_0x57d764[_0x416f('0x33')]['offset']);}_0x4329c0['order']=qs[_0x416f('0x3b')](_0x57d764[_0x416f('0x33')]['sort']);_0x4329c0[_0x416f('0x3c')]=qs[_0x416f('0x35')](_[_0x416f('0x3d')](_0x57d764[_0x416f('0x33')],_0x192437[_0x416f('0x35')]),_0x5dce0b);if(_0x57d764[_0x416f('0x33')][_0x416f('0x3e')]){_0x4329c0['where']=_['merge'](_0x4329c0[_0x416f('0x3c')],{'$or':_[_0x416f('0x3f')](_0x5dce0b,function(_0x470be9){if(_0x470be9['type']!==_0x416f('0x40')){var _0x185925={};_0x185925[_0x470be9['name']]={'$like':'%'+_0x57d764[_0x416f('0x33')]['filter']+'%'};return _0x185925;}})});}_0x4329c0=_[_0x416f('0x41')]({},_0x4329c0,_0x57d764[_0x416f('0x42')]);var _0x203797={'where':_0x4329c0[_0x416f('0x3c')]};return db['Trigger'][_0x416f('0x20')](_0x203797)[_0x416f('0x26')](function(_0x1b5c6e){_0x58f528['count']=_0x1b5c6e;if(_0x57d764[_0x416f('0x33')]['includeAll']){_0x4329c0[_0x416f('0x43')]=[{'all':!![]}];}return db[_0x416f('0x2e')][_0x416f('0x44')](_0x4329c0);})[_0x416f('0x26')](function(_0x5d4611){_0x58f528['rows']=_0x5d4611;return _0x58f528;})[_0x416f('0x26')](respondWithFilteredResult(_0x1339a2,_0x4329c0))[_0x416f('0x45')](handleError(_0x1339a2,null));};exports[_0x416f('0x46')]=function(_0xdeeee,_0x3e9fce){var _0x476f18={'raw':![],'where':{'id':_0xdeeee['params']['id']}},_0x14e4fa={};_0x14e4fa[_0x416f('0x32')]=_[_0x416f('0x34')](db[_0x416f('0x2e')][_0x416f('0x2f')]);_0x14e4fa[_0x416f('0x33')]=_[_0x416f('0x34')](_0xdeeee['query']);_0x14e4fa[_0x416f('0x35')]=_[_0x416f('0x36')](_0x14e4fa['model'],_0x14e4fa['query']);_0x476f18[_0x416f('0x37')]=_['intersection'](_0x14e4fa[_0x416f('0x32')],qs[_0x416f('0x38')](_0xdeeee[_0x416f('0x33')][_0x416f('0x38')]));_0x476f18[_0x416f('0x37')]=_0x476f18['attributes'][_0x416f('0x39')]?_0x476f18['attributes']:_0x14e4fa[_0x416f('0x32')];if(_0xdeeee['query']['includeAll']){_0x476f18[_0x416f('0x43')]=[{'all':!![]}];}_0x476f18=_['merge']({},_0x476f18,_0xdeeee[_0x416f('0x42')]);return db[_0x416f('0x2e')][_0x416f('0x47')](_0x476f18)[_0x416f('0x26')](handleEntityNotFound(_0x3e9fce,null))[_0x416f('0x26')](respondWithResult(_0x3e9fce,null))['catch'](handleError(_0x3e9fce,null));};exports[_0x416f('0x48')]=function(_0x283d12,_0x338897){return db[_0x416f('0x2e')][_0x416f('0x48')](_0x283d12[_0x416f('0x49')],{})[_0x416f('0x26')](function(_0x5746d7){var _0x1a18aa=_0x283d12[_0x416f('0x4a')][_0x416f('0x27')]({'plain':!![]});if(!_0x1a18aa)throw new Error(_0x416f('0x4b'));if(_0x1a18aa['role']==='user'){var _0x5b374a=_0x5746d7[_0x416f('0x27')]({'plain':!![]});var _0xa0381f=_0x416f('0x28');return db[_0x416f('0x4c')][_0x416f('0x47')]({'where':{'name':_0xa0381f,'userProfileId':_0x1a18aa[_0x416f('0x4d')]},'raw':!![]})[_0x416f('0x26')](function(_0x3309ae){if(_0x3309ae&&_0x3309ae['autoAssociation']===0x0){return db[_0x416f('0x4e')]['create']({'name':_0x5b374a[_0x416f('0x2b')],'resourceId':_0x5b374a['id'],'type':_0x3309ae['name'],'sectionId':_0x3309ae['id']},{})[_0x416f('0x26')](function(){return _0x5746d7;});}else{return _0x5746d7;}})[_0x416f('0x45')](function(_0x36da40){logger[_0x416f('0x29')](_0x416f('0x4f'),_0x36da40);throw _0x36da40;});}return _0x5746d7;})[_0x416f('0x26')](respondWithResult(_0x338897,0xc9))[_0x416f('0x45')](handleError(_0x338897,null));};exports[_0x416f('0x25')]=function(_0x10edb0,_0x44fb36){if(_0x10edb0[_0x416f('0x49')]['id']){delete _0x10edb0['body']['id'];}return db['Trigger'][_0x416f('0x47')]({'where':{'id':_0x10edb0['params']['id']}})['then'](handleEntityNotFound(_0x44fb36,null))['then'](saveUpdates(_0x10edb0['body'],null))['then'](respondWithResult(_0x44fb36,null))[_0x416f('0x45')](handleError(_0x44fb36,null));};exports[_0x416f('0x50')]=function(_0x170bf8,_0x1c4eff){return db[_0x416f('0x2e')][_0x416f('0x47')]({'where':{'id':_0x170bf8['params']['id']}})[_0x416f('0x26')](handleEntityNotFound(_0x1c4eff,null))['then'](removeEntity(_0x1c4eff,null))[_0x416f('0x45')](handleError(_0x1c4eff,null));};exports[_0x416f('0x51')]=function(_0x4357c0,_0x2c10f2,_0x406203){if(_0x4357c0[_0x416f('0x49')]['id']){delete _0x4357c0[_0x416f('0x49')]['id'];}return db[_0x416f('0x2e')]['find']({'where':{'id':_0x4357c0[_0x416f('0x52')]['id']}})[_0x416f('0x26')](handleEntityNotFound(_0x2c10f2,null))[_0x416f('0x26')](function(_0x130f79){if(_0x130f79){_0x4357c0[_0x416f('0x49')]['TriggerAllId']=_0x130f79['id'];return db[_0x416f('0x53')][_0x416f('0x48')](_0x4357c0[_0x416f('0x49')]);}})[_0x416f('0x26')](respondWithResult(_0x2c10f2,null))[_0x416f('0x45')](handleError(_0x2c10f2,null));};exports[_0x416f('0x54')]=function(_0x2c321f,_0x53e01d,_0x400162){if(_0x2c321f['body']['id']){delete _0x2c321f[_0x416f('0x49')]['id'];}return db[_0x416f('0x2e')]['find']({'where':{'id':_0x2c321f[_0x416f('0x52')]['id']}})['then'](handleEntityNotFound(_0x53e01d,null))['then'](function(_0x46e82a){if(_0x46e82a){_0x2c321f[_0x416f('0x49')][_0x416f('0x55')]=_0x46e82a['id'];return db['Condition'][_0x416f('0x48')](_0x2c321f[_0x416f('0x49')]);}})[_0x416f('0x26')](respondWithResult(_0x53e01d,null))[_0x416f('0x45')](handleError(_0x53e01d,null));};exports['getAllConditions']=function(_0x47ca92,_0x48f9f7,_0x5799ae){var _0x5dc6ba={};var _0x3c14cf={};var _0x4c2c93;var _0x3b142a;return db[_0x416f('0x2e')]['findOne']({'where':{'id':_0x47ca92[_0x416f('0x52')]['id']}})[_0x416f('0x26')](handleEntityNotFound(_0x48f9f7,null))[_0x416f('0x26')](function(_0x17b93a){if(_0x17b93a){_0x4c2c93=_0x17b93a;_0x3c14cf[_0x416f('0x32')]=_['keys'](db[_0x416f('0x53')][_0x416f('0x2f')]);_0x3c14cf['query']=_['keys'](_0x47ca92['query']);_0x3c14cf['filters']=_[_0x416f('0x36')](_0x3c14cf[_0x416f('0x32')],_0x3c14cf[_0x416f('0x33')]);_0x5dc6ba[_0x416f('0x37')]=_['intersection'](_0x3c14cf['model'],qs['fields'](_0x47ca92[_0x416f('0x33')][_0x416f('0x38')]));_0x5dc6ba[_0x416f('0x37')]=_0x5dc6ba['attributes'][_0x416f('0x39')]?_0x5dc6ba[_0x416f('0x37')]:_0x3c14cf[_0x416f('0x32')];_0x5dc6ba[_0x416f('0x56')]=qs[_0x416f('0x3b')](_0x47ca92[_0x416f('0x33')][_0x416f('0x3b')]);_0x5dc6ba['where']=qs['filters'](_['pick'](_0x47ca92[_0x416f('0x33')],_0x3c14cf[_0x416f('0x35')]));if(_0x47ca92['query'][_0x416f('0x3e')]){_0x5dc6ba[_0x416f('0x3c')]=_[_0x416f('0x41')](_0x5dc6ba[_0x416f('0x3c')],{'$or':_[_0x416f('0x3f')](_0x5dc6ba[_0x416f('0x37')],function(_0x58be14){var _0x505679={};_0x505679[_0x58be14]={'$like':'%'+_0x47ca92[_0x416f('0x33')][_0x416f('0x3e')]+'%'};return _0x505679;})});}_0x5dc6ba=_['merge']({},_0x5dc6ba,_0x47ca92[_0x416f('0x42')]);return _0x4c2c93[_0x416f('0x57')](_0x5dc6ba);}})[_0x416f('0x26')](function(_0x352752){if(_0x352752){_0x3b142a=_0x352752['length'];if(!_0x47ca92[_0x416f('0x33')][_0x416f('0x3a')](_0x416f('0x58'))){_0x5dc6ba['limit']=qs[_0x416f('0x1e')](_0x47ca92[_0x416f('0x33')]['limit']);_0x5dc6ba[_0x416f('0x1d')]=qs[_0x416f('0x1d')](_0x47ca92[_0x416f('0x33')][_0x416f('0x1d')]);}return _0x4c2c93[_0x416f('0x57')](_0x5dc6ba);}})[_0x416f('0x26')](function(_0x1c37c1){if(_0x1c37c1){return _0x1c37c1?{'count':_0x3b142a,'rows':_0x1c37c1}:null;}})['then'](respondWithResult(_0x48f9f7,null))[_0x416f('0x45')](handleError(_0x48f9f7,null));};exports[_0x416f('0x59')]=function(_0x39abf4,_0x1cbe65,_0x100199){var _0x30b05c={};var _0x43787={};var _0x40410a;var _0x1ff0de;return db[_0x416f('0x2e')][_0x416f('0x5a')]({'where':{'id':_0x39abf4[_0x416f('0x52')]['id']}})['then'](handleEntityNotFound(_0x1cbe65,null))[_0x416f('0x26')](function(_0x46cc29){if(_0x46cc29){_0x40410a=_0x46cc29;_0x43787[_0x416f('0x32')]=_[_0x416f('0x34')](db[_0x416f('0x53')][_0x416f('0x2f')]);_0x43787['query']=_[_0x416f('0x34')](_0x39abf4[_0x416f('0x33')]);_0x43787['filters']=_[_0x416f('0x36')](_0x43787[_0x416f('0x32')],_0x43787[_0x416f('0x33')]);_0x30b05c[_0x416f('0x37')]=_['intersection'](_0x43787[_0x416f('0x32')],qs[_0x416f('0x38')](_0x39abf4[_0x416f('0x33')][_0x416f('0x38')]));_0x30b05c[_0x416f('0x37')]=_0x30b05c['attributes'][_0x416f('0x39')]?_0x30b05c[_0x416f('0x37')]:_0x43787['model'];_0x30b05c['order']=qs['sort'](_0x39abf4[_0x416f('0x33')][_0x416f('0x3b')]);_0x30b05c['where']=qs[_0x416f('0x35')](_[_0x416f('0x3d')](_0x39abf4[_0x416f('0x33')],_0x43787[_0x416f('0x35')]));if(_0x39abf4[_0x416f('0x33')][_0x416f('0x3e')]){_0x30b05c['where']=_[_0x416f('0x41')](_0x30b05c['where'],{'$or':_[_0x416f('0x3f')](_0x30b05c['attributes'],function(_0x3e0db3){var _0x3e540f={};_0x3e540f[_0x3e0db3]={'$like':'%'+_0x39abf4[_0x416f('0x33')]['filter']+'%'};return _0x3e540f;})});}_0x30b05c=_[_0x416f('0x41')]({},_0x30b05c,_0x39abf4['options']);return _0x40410a[_0x416f('0x59')](_0x30b05c);}})[_0x416f('0x26')](function(_0x112a74){if(_0x112a74){_0x1ff0de=_0x112a74[_0x416f('0x39')];if(!_0x39abf4[_0x416f('0x33')]['hasOwnProperty']('nolimit')){_0x30b05c[_0x416f('0x1e')]=qs[_0x416f('0x1e')](_0x39abf4[_0x416f('0x33')][_0x416f('0x1e')]);_0x30b05c[_0x416f('0x1d')]=qs[_0x416f('0x1d')](_0x39abf4[_0x416f('0x33')]['offset']);}return _0x40410a[_0x416f('0x59')](_0x30b05c);}})[_0x416f('0x26')](function(_0x23bc85){if(_0x23bc85){return _0x23bc85?{'count':_0x1ff0de,'rows':_0x23bc85}:null;}})['then'](respondWithResult(_0x1cbe65,null))[_0x416f('0x45')](handleError(_0x1cbe65,null));};exports[_0x416f('0x5b')]=function(_0x487327,_0x38afbb,_0x1ad530){if(_0x487327[_0x416f('0x49')]['id']){delete _0x487327[_0x416f('0x49')]['id'];}return db[_0x416f('0x2e')][_0x416f('0x47')]({'where':{'id':_0x487327[_0x416f('0x52')]['id']}})['then'](handleEntityNotFound(_0x38afbb,null))['then'](function(_0x404643){if(_0x404643){_0x487327[_0x416f('0x49')][_0x416f('0x5c')]=_0x404643['id'];return db[_0x416f('0x5d')][_0x416f('0x48')](_0x487327[_0x416f('0x49')]);}})[_0x416f('0x26')](respondWithResult(_0x38afbb,null))[_0x416f('0x45')](handleError(_0x38afbb,null));};exports[_0x416f('0x5e')]=function(_0x4c3fc2,_0x53bc44,_0x1d0c8c){var _0x299ddb={};var _0x3bcd8e={};var _0x45d008;var _0x24de73;return db['Trigger']['findOne']({'where':{'id':_0x4c3fc2[_0x416f('0x52')]['id']}})[_0x416f('0x26')](handleEntityNotFound(_0x53bc44,null))[_0x416f('0x26')](function(_0x4e08fb){if(_0x4e08fb){_0x45d008=_0x4e08fb;_0x3bcd8e['model']=_[_0x416f('0x34')](db[_0x416f('0x5d')][_0x416f('0x2f')]);_0x3bcd8e[_0x416f('0x33')]=_['keys'](_0x4c3fc2[_0x416f('0x33')]);_0x3bcd8e[_0x416f('0x35')]=_[_0x416f('0x36')](_0x3bcd8e['model'],_0x3bcd8e[_0x416f('0x33')]);_0x299ddb[_0x416f('0x37')]=_[_0x416f('0x36')](_0x3bcd8e[_0x416f('0x32')],qs[_0x416f('0x38')](_0x4c3fc2[_0x416f('0x33')]['fields']));_0x299ddb['attributes']=_0x299ddb[_0x416f('0x37')][_0x416f('0x39')]?_0x299ddb['attributes']:_0x3bcd8e[_0x416f('0x32')];_0x299ddb[_0x416f('0x56')]=qs[_0x416f('0x3b')](_0x4c3fc2[_0x416f('0x33')][_0x416f('0x3b')]);_0x299ddb[_0x416f('0x3c')]=qs[_0x416f('0x35')](_[_0x416f('0x3d')](_0x4c3fc2[_0x416f('0x33')],_0x3bcd8e['filters']));if(_0x4c3fc2[_0x416f('0x33')]['filter']){_0x299ddb[_0x416f('0x3c')]=_['merge'](_0x299ddb['where'],{'$or':_[_0x416f('0x3f')](_0x299ddb['attributes'],function(_0x374852){var _0x3b148d={};_0x3b148d[_0x374852]={'$like':'%'+_0x4c3fc2['query'][_0x416f('0x3e')]+'%'};return _0x3b148d;})});}_0x299ddb=_[_0x416f('0x41')]({},_0x299ddb,_0x4c3fc2[_0x416f('0x42')]);return _0x45d008['getActions'](_0x299ddb);}})['then'](function(_0x25e1f3){if(_0x25e1f3){_0x24de73=_0x25e1f3[_0x416f('0x39')];if(!_0x4c3fc2[_0x416f('0x33')]['hasOwnProperty'](_0x416f('0x58'))){_0x299ddb['limit']=qs[_0x416f('0x1e')](_0x4c3fc2[_0x416f('0x33')][_0x416f('0x1e')]);_0x299ddb[_0x416f('0x1d')]=qs['offset'](_0x4c3fc2[_0x416f('0x33')][_0x416f('0x1d')]);}return _0x45d008['getActions'](_0x299ddb);}})[_0x416f('0x26')](function(_0x2dd6dd){if(_0x2dd6dd){return _0x2dd6dd?{'count':_0x24de73,'rows':_0x2dd6dd}:null;}})[_0x416f('0x26')](respondWithResult(_0x53bc44,null))[_0x416f('0x45')](handleError(_0x53bc44,null));};
\ No newline at end of file
index 2a18218..f2c4632 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1d4=['util','api','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash'];(function(_0x3e2b1b,_0x429f3e){var _0x21b2ba=function(_0x2e9346){while(--_0x2e9346){_0x3e2b1b['push'](_0x3e2b1b['shift']());}};_0x21b2ba(++_0x429f3e);}(_0xd1d4,0xfb));var _0x4d1d=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xd1d4[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x4d1d('0x0'));var util=require(_0x4d1d('0x1'));var logger=require('../../config/logger')(_0x4d1d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4d1d('0x3'));var fs=require('fs');var path=require(_0x4d1d('0x4'));var rimraf=require(_0x4d1d('0x5'));var config=require(_0x4d1d('0x6'));var attributes=require(_0x4d1d('0x7'));module[_0x4d1d('0x8')]=function(_0x30466a,_0xb8a403){return _0x30466a[_0x4d1d('0x9')](_0x4d1d('0xa'),attributes,{'tableName':_0x4d1d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x99c9=['request-promise','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x99c9,0x13c));var _0x999c=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x99c9[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x999c('0x0'));var util=require(_0x999c('0x1'));var logger=require(_0x999c('0x2'))(_0x999c('0x3'));var moment=require(_0x999c('0x4'));var BPromise=require(_0x999c('0x5'));var rp=require(_0x999c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x999c('0x7'));var config=require(_0x999c('0x8'));var attributes=require(_0x999c('0x9'));module[_0x999c('0xa')]=function(_0x2bdd73,_0x14df32){return _0x2bdd73[_0x999c('0xb')](_0x999c('0xc'),attributes,{'tableName':_0x999c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c3d561f..6d9e005 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9a0=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','Trigger,\x20%s,\x20%s','message','result','GetTrigger','Trigger','findAll','options','raw','where','include','attributes','map','model','stringify','catch','find','ShowTrigger','util','moment','bluebird','randomstring'];(function(_0x56152c,_0x20fa4c){var _0x20f08e=function(_0x34e8b7){while(--_0x34e8b7){_0x56152c['push'](_0x56152c['shift']());}};_0x20f08e(++_0x20fa4c);}(_0xa9a0,0x1b6));var _0x0a9a=function(_0x45cd8c,_0x446832){_0x45cd8c=_0x45cd8c-0x0;var _0x105a7b=_0xa9a0[_0x45cd8c];return _0x105a7b;};'use strict';var _=require('lodash');var util=require(_0x0a9a('0x0'));var moment=require(_0x0a9a('0x1'));var BPromise=require(_0x0a9a('0x2'));var rs=require(_0x0a9a('0x3'));var fs=require('fs');var Redis=require(_0x0a9a('0x4'));var db=require(_0x0a9a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a9a('0x6'))(_0x0a9a('0x7'));var config=require(_0x0a9a('0x8'));var jayson=require(_0x0a9a('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3d4fc0,_0x135500,_0x3897ab){return new BPromise(function(_0x168adb,_0x117771){return client[_0x0a9a('0xa')](_0x3d4fc0,_0x3897ab)[_0x0a9a('0xb')](function(_0x476108){logger[_0x0a9a('0xc')]('Trigger,\x20%s,\x20%s',_0x135500,_0x0a9a('0xd'));logger[_0x0a9a('0xe')](_0x0a9a('0xf'),_0x135500,_0x0a9a('0xd'),JSON['stringify'](_0x476108));if(_0x476108[_0x0a9a('0x10')]){if(_0x476108[_0x0a9a('0x10')]['code']===0x1f4){logger[_0x0a9a('0x10')]('Trigger,\x20%s,\x20%s',_0x135500,_0x476108[_0x0a9a('0x10')]['message']);return _0x117771(_0x476108[_0x0a9a('0x10')]['message']);}logger[_0x0a9a('0x10')](_0x0a9a('0x11'),_0x135500,_0x476108[_0x0a9a('0x10')][_0x0a9a('0x12')]);return _0x168adb(_0x476108[_0x0a9a('0x10')]['message']);}else{logger[_0x0a9a('0xc')]('Trigger,\x20%s,\x20%s',_0x135500,_0x0a9a('0xd'));_0x168adb(_0x476108[_0x0a9a('0x13')][_0x0a9a('0x12')]);}})['catch'](function(_0x52429d){logger['error'](_0x0a9a('0x11'),_0x135500,_0x52429d);_0x117771(_0x52429d);});});}exports[_0x0a9a('0x14')]=function(_0x34a7d3){var _0x2900a8=this;return new Promise(function(_0x444586,_0x53bca4){return db[_0x0a9a('0x15')][_0x0a9a('0x16')]({'raw':_0x34a7d3['options']?_0x34a7d3[_0x0a9a('0x17')][_0x0a9a('0x18')]===undefined?!![]:![]:!![],'where':_0x34a7d3[_0x0a9a('0x17')]?_0x34a7d3['options'][_0x0a9a('0x19')]||null:null,'attributes':_0x34a7d3['options']?_0x34a7d3['options']['attributes']||null:null,'limit':_0x34a7d3[_0x0a9a('0x17')]?_0x34a7d3[_0x0a9a('0x17')]['limit']||null:null,'include':_0x34a7d3[_0x0a9a('0x17')]?_0x34a7d3[_0x0a9a('0x17')][_0x0a9a('0x1a')]?_['map'](_0x34a7d3['options']['include'],function(_0x41f355){return{'model':db[_0x41f355['model']],'as':_0x41f355['as'],'attributes':_0x41f355[_0x0a9a('0x1b')],'include':_0x41f355['include']?_[_0x0a9a('0x1c')](_0x41f355[_0x0a9a('0x1a')],function(_0x5553b0){return{'model':db[_0x5553b0[_0x0a9a('0x1d')]],'as':_0x5553b0['as'],'attributes':_0x5553b0['attributes'],'include':_0x5553b0[_0x0a9a('0x1a')]?_[_0x0a9a('0x1c')](_0x5553b0['include'],function(_0x52f0ce){return{'model':db[_0x52f0ce[_0x0a9a('0x1d')]],'as':_0x52f0ce['as'],'attributes':_0x52f0ce[_0x0a9a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0a9a('0xb')](function(_0xaf04b6){logger[_0x0a9a('0xc')](_0x0a9a('0x14'),_0x34a7d3);logger['debug'](_0x0a9a('0x14'),_0x34a7d3,JSON[_0x0a9a('0x1e')](_0xaf04b6));_0x444586(_0xaf04b6);})[_0x0a9a('0x1f')](function(_0x10fba2){logger[_0x0a9a('0x10')](_0x0a9a('0x14'),_0x10fba2[_0x0a9a('0x12')],_0x34a7d3);_0x53bca4(_0x2900a8[_0x0a9a('0x10')](0x1f4,_0x10fba2['message']));});});};exports['ShowTrigger']=function(_0xd3b7f0){var _0xa83d7d=this;return new Promise(function(_0x2be2e4,_0x301977){return db['Trigger'][_0x0a9a('0x20')]({'raw':_0xd3b7f0[_0x0a9a('0x17')]?_0xd3b7f0['options'][_0x0a9a('0x18')]===undefined?!![]:![]:!![],'where':_0xd3b7f0[_0x0a9a('0x17')]?_0xd3b7f0[_0x0a9a('0x17')][_0x0a9a('0x19')]||null:null,'attributes':_0xd3b7f0[_0x0a9a('0x17')]?_0xd3b7f0[_0x0a9a('0x17')][_0x0a9a('0x1b')]||null:null,'include':_0xd3b7f0[_0x0a9a('0x17')]?_0xd3b7f0[_0x0a9a('0x17')][_0x0a9a('0x1a')]?_[_0x0a9a('0x1c')](_0xd3b7f0[_0x0a9a('0x17')][_0x0a9a('0x1a')],function(_0x54b479){return{'model':db[_0x54b479[_0x0a9a('0x1d')]],'as':_0x54b479['as'],'attributes':_0x54b479[_0x0a9a('0x1b')],'include':_0x54b479[_0x0a9a('0x1a')]?_[_0x0a9a('0x1c')](_0x54b479[_0x0a9a('0x1a')],function(_0x30c1fd){return{'model':db[_0x30c1fd[_0x0a9a('0x1d')]],'as':_0x30c1fd['as'],'attributes':_0x30c1fd[_0x0a9a('0x1b')],'include':_0x30c1fd[_0x0a9a('0x1a')]?_['map'](_0x30c1fd[_0x0a9a('0x1a')],function(_0x448f00){return{'model':db[_0x448f00['model']],'as':_0x448f00['as'],'attributes':_0x448f00[_0x0a9a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0a9a('0xb')](function(_0x45333e){logger['info'](_0x0a9a('0x21'),_0xd3b7f0);logger[_0x0a9a('0xe')](_0x0a9a('0x21'),_0xd3b7f0,JSON[_0x0a9a('0x1e')](_0x45333e));_0x2be2e4(_0x45333e);})[_0x0a9a('0x1f')](function(_0x5cb0a1){logger[_0x0a9a('0x10')](_0x0a9a('0x21'),_0x5cb0a1[_0x0a9a('0x12')],_0xd3b7f0);_0x301977(_0xa83d7d[_0x0a9a('0x10')](0x1f4,_0x5cb0a1[_0x0a9a('0x12')]));});});};
\ No newline at end of file
+var _0x4be7=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Trigger','findAll','options','raw','where','attributes','limit','map','include','model','GetTrigger','ShowTrigger','find','util'];(function(_0x8d435c,_0xc3bcc0){var _0x22c944=function(_0x29e5f4){while(--_0x29e5f4){_0x8d435c['push'](_0x8d435c['shift']());}};_0x22c944(++_0xc3bcc0);}(_0x4be7,0x93));var _0x74be=function(_0x21f588,_0x3f63ae){_0x21f588=_0x21f588-0x0;var _0x3b28cb=_0x4be7[_0x21f588];return _0x3b28cb;};'use strict';var _=require('lodash');var util=require(_0x74be('0x0'));var moment=require('moment');var BPromise=require(_0x74be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74be('0x2'));var db=require(_0x74be('0x3'))['db'];var utils=require(_0x74be('0x4'));var logger=require(_0x74be('0x5'))(_0x74be('0x6'));var config=require(_0x74be('0x7'));var jayson=require(_0x74be('0x8'));var client=jayson[_0x74be('0x9')][_0x74be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xed573b,_0x1aabd1,_0x51de83){return new BPromise(function(_0x5ac6f5,_0x2e609e){return client[_0x74be('0xb')](_0xed573b,_0x51de83)[_0x74be('0xc')](function(_0x175ccb){logger[_0x74be('0xd')](_0x74be('0xe'),_0x1aabd1,_0x74be('0xf'));logger[_0x74be('0x10')](_0x74be('0x11'),_0x1aabd1,_0x74be('0xf'),JSON[_0x74be('0x12')](_0x175ccb));if(_0x175ccb['error']){if(_0x175ccb[_0x74be('0x13')][_0x74be('0x14')]===0x1f4){logger['error'](_0x74be('0xe'),_0x1aabd1,_0x175ccb['error'][_0x74be('0x15')]);return _0x2e609e(_0x175ccb[_0x74be('0x13')][_0x74be('0x15')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x1aabd1,_0x175ccb[_0x74be('0x13')]['message']);return _0x5ac6f5(_0x175ccb[_0x74be('0x13')][_0x74be('0x15')]);}else{logger[_0x74be('0xd')](_0x74be('0xe'),_0x1aabd1,'request\x20sent');_0x5ac6f5(_0x175ccb[_0x74be('0x16')]['message']);}})[_0x74be('0x17')](function(_0x12cd44){logger[_0x74be('0x13')]('Trigger,\x20%s,\x20%s',_0x1aabd1,_0x12cd44);_0x2e609e(_0x12cd44);});});}exports['GetTrigger']=function(_0x54ade2){var _0xe99ded=this;return new Promise(function(_0xfdb3bf,_0x47fa29){return db[_0x74be('0x18')][_0x74be('0x19')]({'raw':_0x54ade2[_0x74be('0x1a')]?_0x54ade2[_0x74be('0x1a')][_0x74be('0x1b')]===undefined?!![]:![]:!![],'where':_0x54ade2['options']?_0x54ade2[_0x74be('0x1a')][_0x74be('0x1c')]||null:null,'attributes':_0x54ade2['options']?_0x54ade2['options'][_0x74be('0x1d')]||null:null,'limit':_0x54ade2[_0x74be('0x1a')]?_0x54ade2['options'][_0x74be('0x1e')]||null:null,'include':_0x54ade2[_0x74be('0x1a')]?_0x54ade2[_0x74be('0x1a')]['include']?_[_0x74be('0x1f')](_0x54ade2[_0x74be('0x1a')][_0x74be('0x20')],function(_0x5a31de){return{'model':db[_0x5a31de['model']],'as':_0x5a31de['as'],'attributes':_0x5a31de[_0x74be('0x1d')],'include':_0x5a31de[_0x74be('0x20')]?_[_0x74be('0x1f')](_0x5a31de[_0x74be('0x20')],function(_0x132b0a){return{'model':db[_0x132b0a[_0x74be('0x21')]],'as':_0x132b0a['as'],'attributes':_0x132b0a[_0x74be('0x1d')],'include':_0x132b0a[_0x74be('0x20')]?_[_0x74be('0x1f')](_0x132b0a['include'],function(_0x252e40){return{'model':db[_0x252e40[_0x74be('0x21')]],'as':_0x252e40['as'],'attributes':_0x252e40[_0x74be('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x74be('0xc')](function(_0x3c1470){logger['info'](_0x74be('0x22'),_0x54ade2);logger[_0x74be('0x10')](_0x74be('0x22'),_0x54ade2,JSON[_0x74be('0x12')](_0x3c1470));_0xfdb3bf(_0x3c1470);})[_0x74be('0x17')](function(_0x19bcd7){logger['error'](_0x74be('0x22'),_0x19bcd7[_0x74be('0x15')],_0x54ade2);_0x47fa29(_0xe99ded[_0x74be('0x13')](0x1f4,_0x19bcd7[_0x74be('0x15')]));});});};exports[_0x74be('0x23')]=function(_0x152516){var _0x1b2e5a=this;return new Promise(function(_0x372a37,_0x35d48b){return db[_0x74be('0x18')][_0x74be('0x24')]({'raw':_0x152516[_0x74be('0x1a')]?_0x152516['options'][_0x74be('0x1b')]===undefined?!![]:![]:!![],'where':_0x152516['options']?_0x152516[_0x74be('0x1a')][_0x74be('0x1c')]||null:null,'attributes':_0x152516['options']?_0x152516[_0x74be('0x1a')][_0x74be('0x1d')]||null:null,'include':_0x152516[_0x74be('0x1a')]?_0x152516[_0x74be('0x1a')][_0x74be('0x20')]?_[_0x74be('0x1f')](_0x152516[_0x74be('0x1a')][_0x74be('0x20')],function(_0x289a88){return{'model':db[_0x289a88[_0x74be('0x21')]],'as':_0x289a88['as'],'attributes':_0x289a88['attributes'],'include':_0x289a88[_0x74be('0x20')]?_['map'](_0x289a88[_0x74be('0x20')],function(_0x2b3d0b){return{'model':db[_0x2b3d0b[_0x74be('0x21')]],'as':_0x2b3d0b['as'],'attributes':_0x2b3d0b[_0x74be('0x1d')],'include':_0x2b3d0b['include']?_['map'](_0x2b3d0b[_0x74be('0x20')],function(_0x29c931){return{'model':db[_0x29c931[_0x74be('0x21')]],'as':_0x29c931['as'],'attributes':_0x29c931['attributes']};}):[]};}):[]};}):[]:[]})[_0x74be('0xc')](function(_0x3ced0b){logger[_0x74be('0xd')](_0x74be('0x23'),_0x152516);logger[_0x74be('0x10')](_0x74be('0x23'),_0x152516,JSON['stringify'](_0x3ced0b));_0x372a37(_0x3ced0b);})[_0x74be('0x17')](function(_0x586bcd){logger['error'](_0x74be('0x23'),_0x586bcd['message'],_0x152516);_0x35d48b(_0x1b2e5a[_0x74be('0x13')](0x1f4,_0x586bcd['message']));});});};
\ No newline at end of file
index 27f03d5..0dc1e3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3979=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id','isAuthenticated','show','post','/:id/clone','clone','put','update','delete','exports'];(function(_0x4c9380,_0x2fefc0){var _0x49a523=function(_0x165e85){while(--_0x165e85){_0x4c9380['push'](_0x4c9380['shift']());}};_0x49a523(++_0x2fefc0);}(_0x3979,0x1a2));var _0x9397=function(_0x3b4ea1,_0x198d1d){_0x3b4ea1=_0x3b4ea1-0x0;var _0x23aad9=_0x3979[_0x3b4ea1];return _0x23aad9;};'use strict';var multer=require(_0x9397('0x0'));var util=require(_0x9397('0x1'));var path=require(_0x9397('0x2'));var timeout=require(_0x9397('0x3'));var express=require(_0x9397('0x4'));var router=express[_0x9397('0x5')]();var fs_extra=require(_0x9397('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9397('0x7'));var config=require(_0x9397('0x8'));var controller=require(_0x9397('0x9'));router[_0x9397('0xa')]('/',auth['isAuthenticated'](),controller[_0x9397('0xb')]);router[_0x9397('0xa')](_0x9397('0xc'),auth[_0x9397('0xd')](),controller[_0x9397('0xe')]);router[_0x9397('0xf')](_0x9397('0x10'),auth[_0x9397('0xd')](),controller[_0x9397('0x11')]);router[_0x9397('0xf')]('/',auth[_0x9397('0xd')](),controller['create']);router[_0x9397('0x12')](_0x9397('0xc'),auth[_0x9397('0xd')](),controller[_0x9397('0x13')]);router[_0x9397('0x14')](_0x9397('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x9397('0x15')]=router;
\ No newline at end of file
+var _0x6975=['/:id','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','/:id/clone','clone','create','put'];(function(_0x288ce9,_0x41d323){var _0x415381=function(_0x74a816){while(--_0x74a816){_0x288ce9['push'](_0x288ce9['shift']());}};_0x415381(++_0x41d323);}(_0x6975,0xff));var _0x5697=function(_0x3fffdb,_0x18964c){_0x3fffdb=_0x3fffdb-0x0;var _0x5a9235=_0x6975[_0x3fffdb];return _0x5a9235;};'use strict';var multer=require(_0x5697('0x0'));var util=require(_0x5697('0x1'));var path=require(_0x5697('0x2'));var timeout=require('connect-timeout');var express=require(_0x5697('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5697('0x4'));var interaction=require(_0x5697('0x5'));var config=require(_0x5697('0x6'));var controller=require('./trunk.controller');router[_0x5697('0x7')]('/',auth[_0x5697('0x8')](),controller['index']);router[_0x5697('0x7')]('/:id',auth[_0x5697('0x8')](),controller[_0x5697('0x9')]);router[_0x5697('0xa')](_0x5697('0xb'),auth[_0x5697('0x8')](),controller[_0x5697('0xc')]);router['post']('/',auth[_0x5697('0x8')](),controller[_0x5697('0xd')]);router[_0x5697('0xe')](_0x5697('0xf'),auth[_0x5697('0x8')](),controller['update']);router['delete'](_0x5697('0xf'),auth[_0x5697('0x8')](),controller[_0x5697('0x10')]);module[_0x5697('0x11')]=router;
\ No newline at end of file
index 886f797..36b302a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b20=['STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','ENUM','rfc2833','info','shortinfo','auto','yes','nonat','update','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','originate','uac','uas','pai','fingerprint','certificate','active','passive','dynamic','update,nonat','sequelize','exports','name','friend','user','peer'];(function(_0x2574c5,_0x2dd0bb){var _0x1123d8=function(_0x3cb217){while(--_0x3cb217){_0x2574c5['push'](_0x2574c5['shift']());}};_0x1123d8(++_0x2dd0bb);}(_0x0b20,0x18a));var _0x00b2=function(_0x20a996,_0xe000fd){_0x20a996=_0x20a996-0x0;var _0x158c74=_0x0b20[_0x20a996];return _0x158c74;};'use strict';var Sequelize=require(_0x00b2('0x0'));module[_0x00b2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x00b2('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x00b2('0x3'),_0x00b2('0x4'),_0x00b2('0x5')),'allowNull':![],'defaultValue':_0x00b2('0x3')},'context':{'type':Sequelize[_0x00b2('0x6')],'allowNull':![],'defaultValue':_0x00b2('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0x00b2('0x8'),'ALLOWED_PASSED_SCREEN',_0x00b2('0x9'),_0x00b2('0xa'),_0x00b2('0xb'),'PROHIB_PASSED_SCREEN',_0x00b2('0xc'),_0x00b2('0xd'))},'deny':{'type':Sequelize[_0x00b2('0x6')]},'permit':{'type':Sequelize[_0x00b2('0x6')]},'secret':{'type':Sequelize[_0x00b2('0x6')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x00b2('0x6')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x00b2('0xe'),'set':function(_0x79040b){this['setDataValue'](_0x00b2('0xf'),_0x79040b?_0x79040b[_0x00b2('0x10')](','):null);},'get':function(){return this['getDataValue'](_0x00b2('0xf'))?this[_0x00b2('0x11')](_0x00b2('0xf'))[_0x00b2('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x14'),_0x00b2('0x15'),_0x00b2('0x16'),'inband',_0x00b2('0x17')),'defaultValue':_0x00b2('0x14')},'directmedia':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no',_0x00b2('0x19'),_0x00b2('0x1a'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x00b2('0x13')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x00b2('0x6')]},'directmediadeny':{'type':Sequelize[_0x00b2('0x6')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x00b2('0x1b'),'set':function(_0xac19df){this[_0x00b2('0x1c')](_0x00b2('0x1d'),_0xac19df?_0xac19df[_0x00b2('0x10')](','):null);},'get':function(){return this[_0x00b2('0x11')](_0x00b2('0x1d'))?this[_0x00b2('0x11')](_0x00b2('0x1d'))['split'](','):null;},'comment':_0x00b2('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x00b2('0x6')]},'pickupgroup':{'type':Sequelize[_0x00b2('0x6')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x00b2('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x00b2('0x1f')},'allow':{'type':Sequelize[_0x00b2('0x6')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x5c38d4){this[_0x00b2('0x1c')]('allow',_0x5c38d4?_0x5c38d4[_0x00b2('0x10')](';'):_0x00b2('0x20'));},'get':function(){return this[_0x00b2('0x11')]('allow')?this[_0x00b2('0x11')](_0x00b2('0x21'))['split'](';'):null;},'comment':_0x00b2('0x22')},'autoframing':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no')},'insecure':{'type':Sequelize[_0x00b2('0x6')],'defaultValue':'port,invite','set':function(_0x3bc565){this[_0x00b2('0x1c')]('insecure',_0x3bc565?_0x3bc565[_0x00b2('0x10')](','):null);},'get':function(){return this[_0x00b2('0x11')]('insecure')?this[_0x00b2('0x11')](_0x00b2('0x23'))[_0x00b2('0x12')](','):null;},'comment':_0x00b2('0x24')},'trustrpid':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x00b2('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no',_0x00b2('0x25'))},'promiscredir':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x00b2('0x6')]},'callerid':{'type':Sequelize[_0x00b2('0x6')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x00b2('0x6')]},'callcounter':{'type':Sequelize['ENUM'](_0x00b2('0x18'),'no'),'defaultValue':_0x00b2('0x18')},'busylevel':{'type':Sequelize[_0x00b2('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x00b2('0x6')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x00b2('0x18'),'no',_0x00b2('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x00b2('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no')},'mailbox':{'type':Sequelize[_0x00b2('0x6')]},'session_timers':{'type':Sequelize['ENUM']('accept','refuse',_0x00b2('0x28'))},'session_expires':{'type':Sequelize[_0x00b2('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x00b2('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x29'),_0x00b2('0x2a')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x00b2('0x6')]},'regexten':{'type':Sequelize[_0x00b2('0x6')]},'fromdomain':{'type':Sequelize[_0x00b2('0x6')]},'fromuser':{'type':Sequelize[_0x00b2('0x6')]},'port':{'type':Sequelize[_0x00b2('0x26')](0x5)},'qualify':{'type':Sequelize[_0x00b2('0x13')]('yes','no'),'defaultValue':_0x00b2('0x18')},'keepalive':{'type':Sequelize[_0x00b2('0x26')](0xb)},'defaultip':{'type':Sequelize[_0x00b2('0x6')]},'defaultuser':{'type':Sequelize[_0x00b2('0x6')]},'rtptimeout':{'type':Sequelize[_0x00b2('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x00b2('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x00b2('0x26')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0x00b2('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x00b2('0x6')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x00b2('0x26')](0xb)},'timerb':{'type':Sequelize[_0x00b2('0x26')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x00b2('0x6')]},'contactdeny':{'type':Sequelize[_0x00b2('0x6')]},'contactacl':{'type':Sequelize[_0x00b2('0x6')]},'unsolicited_mailbox':{'type':Sequelize[_0x00b2('0x6')]},'use_q850_reason':{'type':Sequelize[_0x00b2('0x6')]},'maxforwards':{'type':Sequelize[_0x00b2('0x26')](0xb)},'encryption':{'type':Sequelize[_0x00b2('0x13')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x00b2('0x18'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no',_0x00b2('0x2c'),_0x00b2('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x00b2('0x26')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x00b2('0x6')]},'dtlscipher':{'type':Sequelize[_0x00b2('0x6')]},'dtlscafile':{'type':Sequelize[_0x00b2('0x6')]},'dtlscapath':{'type':Sequelize[_0x00b2('0x6')]},'dtlssetup':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x2e'),_0x00b2('0x2f'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x00b2('0x6')]},'usereqphone':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x00b2('0x6')]},'recordofffeature':{'type':Sequelize[_0x00b2('0x6')]},'call_limit':{'type':Sequelize[_0x00b2('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no')},'vmexten':{'type':Sequelize[_0x00b2('0x6')]},'mohinterpret':{'type':Sequelize[_0x00b2('0x6')]},'mohsuggest':{'type':Sequelize[_0x00b2('0x6')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x00b2('0x6')]},'host':{'type':Sequelize[_0x00b2('0x6')],'defaultValue':_0x00b2('0x30')},'canreinvite':{'type':Sequelize[_0x00b2('0x13')](_0x00b2('0x18'),'no',_0x00b2('0x19'),_0x00b2('0x1a'),_0x00b2('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x00b2('0x6')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}};
\ No newline at end of file
+var _0xcf8b=['from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join','rfc2833','info','shortinfo','auto','yes','nonat','outgoing','force_rport,comedia','nat','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','uas','pai','fingerprint','certificate','active','actpass','dynamic','update','BOOLEAN','exports','name','ENUM','friend','user','peer','STRING'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0xcf8b,0xbd));var _0xbcf8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf8b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xbcf8('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbcf8('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x3'),_0xbcf8('0x4'),_0xbcf8('0x5')),'allowNull':![],'defaultValue':_0xbcf8('0x3')},'context':{'type':Sequelize[_0xbcf8('0x6')],'allowNull':![],'defaultValue':_0xbcf8('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0xbcf8('0x8'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0xbcf8('0x9'),_0xbcf8('0xa'),_0xbcf8('0xb'),_0xbcf8('0xc'),'PROHIB')},'deny':{'type':Sequelize[_0xbcf8('0x6')]},'permit':{'type':Sequelize[_0xbcf8('0x6')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xbcf8('0x6')]},'remotesecret':{'type':Sequelize[_0xbcf8('0x6')]},'transport':{'type':Sequelize[_0xbcf8('0x6')],'defaultValue':_0xbcf8('0xd'),'set':function(_0x43e55a){this[_0xbcf8('0xe')](_0xbcf8('0xf'),_0x43e55a?_0x43e55a[_0xbcf8('0x10')](','):null);},'get':function(){return this['getDataValue'](_0xbcf8('0xf'))?this['getDataValue']('transport')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x11'),_0xbcf8('0x12'),_0xbcf8('0x13'),'inband',_0xbcf8('0x14')),'defaultValue':_0xbcf8('0x11')},'directmedia':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no',_0xbcf8('0x16'),'update',_0xbcf8('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xbcf8('0x2')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xbcf8('0x18'),'set':function(_0x15de98){this['setDataValue'](_0xbcf8('0x19'),_0x15de98?_0x15de98['join'](','):null);},'get':function(){return this['getDataValue'](_0xbcf8('0x19'))?this[_0xbcf8('0x1a')]('nat')[_0xbcf8('0x1b')](','):null;},'comment':_0xbcf8('0x1c')},'callgroup':{'type':Sequelize[_0xbcf8('0x6')]},'namedcallgroup':{'type':Sequelize[_0xbcf8('0x6')]},'pickupgroup':{'type':Sequelize[_0xbcf8('0x6')]},'namedpickupgroup':{'type':Sequelize[_0xbcf8('0x6')]},'language':{'type':Sequelize[_0xbcf8('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xbcf8('0x1d')},'allow':{'type':Sequelize[_0xbcf8('0x6')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x2e1eb0){this[_0xbcf8('0xe')]('allow',_0x2e1eb0?_0x2e1eb0[_0xbcf8('0x10')](';'):_0xbcf8('0x1e'));},'get':function(){return this[_0xbcf8('0x1a')](_0xbcf8('0x1f'))?this[_0xbcf8('0x1a')](_0xbcf8('0x1f'))[_0xbcf8('0x1b')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no')},'insecure':{'type':Sequelize[_0xbcf8('0x6')],'defaultValue':_0xbcf8('0x20'),'set':function(_0x4d6ddd){this[_0xbcf8('0xe')]('insecure',_0x4d6ddd?_0x4d6ddd['join'](','):null);},'get':function(){return this[_0xbcf8('0x1a')]('insecure')?this[_0xbcf8('0x1a')](_0xbcf8('0x21'))[_0xbcf8('0x1b')](','):null;},'comment':_0xbcf8('0x22')},'trustrpid':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xbcf8('0x15'),'no',_0xbcf8('0x23'))},'promiscredir':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no')},'useclientcode':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no')},'accountcode':{'type':Sequelize[_0xbcf8('0x24')](0xb)},'setvar':{'type':Sequelize[_0xbcf8('0x6')]},'callerid':{'type':Sequelize[_0xbcf8('0x6')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xbcf8('0x6')]},'callcounter':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no'),'defaultValue':_0xbcf8('0x15')},'busylevel':{'type':Sequelize[_0xbcf8('0x24')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xbcf8('0x15'),'no')},'allowsubscribe':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no')},'allowtransfer':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0xbcf8('0x2')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xbcf8('0x6')]},'template':{'type':Sequelize[_0xbcf8('0x6')]},'videosupport':{'type':Sequelize['ENUM'](_0xbcf8('0x15'),'no',_0xbcf8('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xbcf8('0x2')]('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x26'),_0xbcf8('0x27'),'originate')},'session_expires':{'type':Sequelize[_0xbcf8('0x24')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xbcf8('0x2')]('uac',_0xbcf8('0x28')),'defaultValue':_0xbcf8('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0xbcf8('0x6')]},'regexten':{'type':Sequelize[_0xbcf8('0x6')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no'),'defaultValue':_0xbcf8('0x15')},'keepalive':{'type':Sequelize[_0xbcf8('0x24')](0xb)},'defaultip':{'type':Sequelize[_0xbcf8('0x6')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xbcf8('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xbcf8('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no',_0xbcf8('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xbcf8('0x6')]},'callbackextension':{'type':Sequelize[_0xbcf8('0x6')]},'timert1':{'type':Sequelize[_0xbcf8('0x24')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xbcf8('0x24')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xbcf8('0x6')]},'contactacl':{'type':Sequelize[_0xbcf8('0x6')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no')},'force_avp':{'type':Sequelize[_0xbcf8('0x2')]('yes','no')},'icesupport':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no')},'dtlsenable':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no')},'dtlsverify':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no',_0xbcf8('0x2a'),_0xbcf8('0x2b'))},'dtlsrekey':{'type':Sequelize[_0xbcf8('0x24')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xbcf8('0x6')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xbcf8('0x6')]},'dtlscapath':{'type':Sequelize[_0xbcf8('0x6')]},'dtlssetup':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x2c'),'passive',_0xbcf8('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xbcf8('0x6')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no')},'subscribemwi':{'type':Sequelize[_0xbcf8('0x2')](_0xbcf8('0x15'),'no')},'vmexten':{'type':Sequelize[_0xbcf8('0x6')]},'mohinterpret':{'type':Sequelize[_0xbcf8('0x6')]},'mohsuggest':{'type':Sequelize[_0xbcf8('0x6')]},'parkinglot':{'type':Sequelize[_0xbcf8('0x6')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xbcf8('0x6')],'defaultValue':_0xbcf8('0x2e')},'canreinvite':{'type':Sequelize[_0xbcf8('0x2')]('yes','no',_0xbcf8('0x16'),_0xbcf8('0x2f'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xbcf8('0x6')]},'active':{'type':Sequelize[_0xbcf8('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xbcf8('0x6')],'defaultValue':'no'}};
\ No newline at end of file
index b50cf69..b717973 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbec5=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','Trunks','UserProfileResource','destroy','stack','name','send','map','Trunk','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','attributes','find','clone','get','omit','updatedAt','body','createdAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','join','server/files/templates/trunk.ejs','utf8'];(function(_0x5ca0d2,_0x4ffa4e){var _0x17178d=function(_0x537723){while(--_0x537723){_0x5ca0d2['push'](_0x5ca0d2['shift']());}};_0x17178d(++_0x4ffa4e);}(_0xbec5,0xe5));var _0x5bec=function(_0x402731,_0x43c115){_0x402731=_0x402731-0x0;var _0x111736=_0xbec5[_0x402731];return _0x111736;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];var jayson=require(_0x5bec('0x19'));var client=jayson['client'][_0x5bec('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xaa984d,_0x35393a,_0x6888a4,_0x3198e0){return new BPromise(function(_0xcd6d90,_0x24dcd6){var _0x43fd2a=_0x3198e0||client;return _0x43fd2a[_0x5bec('0x1b')](_0xaa984d,_0x6888a4)[_0x5bec('0x1c')](function(_0x31b9e4){logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,'request\x20sent');logger['debug'](_0x5bec('0x1f'),_0x35393a,_0x5bec('0x20'),JSON[_0x5bec('0x21')](_0x31b9e4));if(_0x31b9e4[_0x5bec('0x22')]){if(_0x31b9e4['error']['code']===0x1f4){logger[_0x5bec('0x22')](_0x5bec('0x1e'),_0x35393a,_0x31b9e4['error'][_0x5bec('0x23')]);return _0x24dcd6(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x31b9e4[_0x5bec('0x22')]['message']);return _0xcd6d90(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}else{logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,_0x5bec('0x20'));_0xcd6d90(_0x31b9e4['result'][_0x5bec('0x23')]);}})['catch'](function(_0x2b2d26){logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x2b2d26);_0x24dcd6(_0x2b2d26);});});}function respondWithStatusCode(_0xa414f8,_0xbef70b){_0xbef70b=_0xbef70b||0xcc;return function(_0x4e0ca2){if(_0x4e0ca2){return _0xa414f8[_0x5bec('0x24')](_0xbef70b);}return _0xa414f8[_0x5bec('0x25')](_0xbef70b)[_0x5bec('0x26')]();};}function respondWithResult(_0x20da89,_0x226d55){_0x226d55=_0x226d55||0xc8;return function(_0x131143){if(_0x131143){return _0x20da89[_0x5bec('0x25')](_0x226d55)['json'](_0x131143);}};}function respondWithFilteredResult(_0x5b63ab,_0x5e44b3){return function(_0x2961bd){if(_0x2961bd){var _0x2cdd2f=typeof _0x5e44b3[_0x5bec('0x27')]==='undefined'&&typeof _0x5e44b3[_0x5bec('0x28')]===_0x5bec('0x29');var _0x57331b=_0x2961bd[_0x5bec('0x2a')];var _0x63ac8=_0x2cdd2f?0x0:_0x5e44b3['offset'];var _0x5336b3=_0x2cdd2f?_0x2961bd[_0x5bec('0x2a')]:_0x5e44b3[_0x5bec('0x27')]+_0x5e44b3[_0x5bec('0x28')];var _0x2c7a7b;if(_0x5336b3>=_0x57331b){_0x5336b3=_0x57331b;_0x2c7a7b=0xc8;}else{_0x2c7a7b=0xce;}_0x5b63ab[_0x5bec('0x25')](_0x2c7a7b);return _0x5b63ab[_0x5bec('0x2b')]('Content-Range',_0x63ac8+'-'+_0x5336b3+'/'+_0x57331b)[_0x5bec('0x2c')](_0x2961bd);}return null;};}function patchUpdates(_0x59b5b6){return function(_0x45863b){try{jsonpatch[_0x5bec('0x2d')](_0x45863b,_0x59b5b6,!![]);}catch(_0x3034c9){return BPromise[_0x5bec('0x2e')](_0x3034c9);}return _0x45863b['save']();};}function saveUpdates(_0x2b42c8,_0x1aba46){return function(_0xfc7d41){if(_0xfc7d41){return _0xfc7d41['update'](_0x2b42c8)[_0x5bec('0x1c')](function(_0x4cfb89){return _0x4cfb89;});}return null;};}function removeEntity(_0x14cdbf,_0x207192){return function(_0x29df14){if(_0x29df14){return _0x29df14['destroy']()[_0x5bec('0x1c')](function(){var _0x420ad4=_0x29df14['get']({'plain':!![]});var _0x34b441=_0x5bec('0x2f');return db[_0x5bec('0x30')][_0x5bec('0x31')]({'where':{'type':_0x34b441,'resourceId':_0x420ad4['id']}})[_0x5bec('0x1c')](function(){return _0x29df14;});})['then'](function(){_0x14cdbf[_0x5bec('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3793,_0x384f04){return function(_0x182b86){if(!_0x182b86){_0x2d3793[_0x5bec('0x24')](0x194);}return _0x182b86;};}function handleError(_0x2e421e,_0x1923fc){_0x1923fc=_0x1923fc||0x1f4;return function(_0x49c8ef){logger[_0x5bec('0x22')](_0x49c8ef[_0x5bec('0x32')]);if(_0x49c8ef[_0x5bec('0x33')]){delete _0x49c8ef['name'];}_0x2e421e[_0x5bec('0x25')](_0x1923fc)[_0x5bec('0x34')](_0x49c8ef);};}exports['index']=function(_0xdb0430,_0x58c34e){var _0x400e22={},_0x2c0b08={},_0x402e5d={'count':0x0,'rows':[]};var _0x49cdfa=_[_0x5bec('0x35')](db[_0x5bec('0x36')][_0x5bec('0x37')],function(_0x139859){return{'name':_0x139859[_0x5bec('0x38')],'type':_0x139859[_0x5bec('0x39')][_0x5bec('0x3a')]};});_0x2c0b08['model']=_[_0x5bec('0x35')](_0x49cdfa,_0x5bec('0x33'));_0x2c0b08[_0x5bec('0x3b')]=_[_0x5bec('0x3c')](_0xdb0430['query']);_0x2c0b08[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],_0x2c0b08['query']);_0x400e22['attributes']=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x40')]));_0x400e22['attributes']=_0x400e22['attributes'][_0x5bec('0x41')]?_0x400e22['attributes']:_0x2c0b08[_0x5bec('0x3f')];if(!_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x42')]('nolimit')){_0x400e22[_0x5bec('0x28')]=qs[_0x5bec('0x28')](_0xdb0430['query'][_0x5bec('0x28')]);_0x400e22[_0x5bec('0x27')]=qs[_0x5bec('0x27')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x27')]);}_0x400e22[_0x5bec('0x43')]=qs[_0x5bec('0x44')](_0xdb0430['query']['sort']);_0x400e22[_0x5bec('0x45')]=qs['filters'](_['pick'](_0xdb0430[_0x5bec('0x3b')],_0x2c0b08['filters']),_0x49cdfa);if(_0xdb0430['query']['filter']){_0x400e22[_0x5bec('0x45')]=_[_0x5bec('0x46')](_0x400e22[_0x5bec('0x45')],{'$or':_[_0x5bec('0x35')](_0x49cdfa,function(_0x48858a){if(_0x48858a[_0x5bec('0x39')]!==_0x5bec('0x47')){var _0xa4d32={};_0xa4d32[_0x48858a[_0x5bec('0x33')]]={'$like':'%'+_0xdb0430['query'][_0x5bec('0x48')]+'%'};return _0xa4d32;}})});}_0x400e22=_[_0x5bec('0x46')]({},_0x400e22,_0xdb0430[_0x5bec('0x49')]);var _0x51a3f9={'where':_0x400e22[_0x5bec('0x45')]};return db['Trunk'][_0x5bec('0x2a')](_0x51a3f9)[_0x5bec('0x1c')](function(_0x133d5c){_0x402e5d[_0x5bec('0x2a')]=_0x133d5c;if(_0xdb0430['query'][_0x5bec('0x4a')]){_0x400e22[_0x5bec('0x4b')]=[{'all':!![]}];}return db[_0x5bec('0x36')][_0x5bec('0x4c')](_0x400e22);})[_0x5bec('0x1c')](function(_0x123758){_0x402e5d[_0x5bec('0x4d')]=_0x123758;return _0x402e5d;})['then'](respondWithFilteredResult(_0x58c34e,_0x400e22))[_0x5bec('0x4e')](handleError(_0x58c34e,null));};exports[_0x5bec('0x4f')]=function(_0x5775ca,_0x273e09){var _0x3e6180={'raw':![],'where':{'id':_0x5775ca[_0x5bec('0x50')]['id']}},_0x34ee24={};_0x34ee24[_0x5bec('0x3f')]=_[_0x5bec('0x3c')](db[_0x5bec('0x36')]['rawAttributes']);_0x34ee24[_0x5bec('0x3b')]=_['keys'](_0x5775ca[_0x5bec('0x3b')]);_0x34ee24[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],_0x34ee24[_0x5bec('0x3b')]);_0x3e6180[_0x5bec('0x51')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0x5775ca[_0x5bec('0x3b')]['fields']));_0x3e6180[_0x5bec('0x51')]=_0x3e6180['attributes']['length']?_0x3e6180[_0x5bec('0x51')]:_0x34ee24['model'];if(_0x5775ca['query'][_0x5bec('0x4a')]){_0x3e6180[_0x5bec('0x4b')]=[{'all':!![]}];}_0x3e6180=_[_0x5bec('0x46')]({},_0x3e6180,_0x5775ca['options']);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0x3e6180)[_0x5bec('0x1c')](handleEntityNotFound(_0x273e09,null))[_0x5bec('0x1c')](respondWithResult(_0x273e09,null))['catch'](handleError(_0x273e09,null));};exports[_0x5bec('0x53')]=function(_0x209da3,_0x9cae50){var _0xc8563a={'where':{'id':_0x209da3[_0x5bec('0x50')]['id']}},_0x2f736c={};_0x2f736c[_0x5bec('0x3f')]=_['keys'](db['Trunk'][_0x5bec('0x37')]);_0xc8563a['attributes']=_[_0x5bec('0x3e')](_0x2f736c[_0x5bec('0x3f')],qs['fields'](_0x209da3[_0x5bec('0x3b')]['fields']));_0xc8563a[_0x5bec('0x51')]=_0xc8563a[_0x5bec('0x51')][_0x5bec('0x41')]?_0xc8563a[_0x5bec('0x51')]:_0x2f736c[_0x5bec('0x3f')];if(_0x209da3[_0x5bec('0x3b')][_0x5bec('0x4a')]){_0xc8563a[_0x5bec('0x4b')]=[{'all':!![]}];}_0xc8563a=_[_0x5bec('0x46')]({},_0xc8563a,_0x209da3[_0x5bec('0x49')]);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0xc8563a)[_0x5bec('0x1c')](handleEntityNotFound(_0x9cae50,null))[_0x5bec('0x1c')](function(_0x51b25d){if(_0x51b25d){var _0x2e33a7=_0x51b25d[_0x5bec('0x54')]({'plain':!![]});_0x2e33a7=qs[_0x5bec('0x55')](_0x2e33a7,['id','createdAt',_0x5bec('0x56')]);_0x209da3[_0x5bec('0x57')]=_[_0x5bec('0x55')](_0x209da3[_0x5bec('0x57')],['id',_0x5bec('0x58'),'updatedAt']);return db[_0x5bec('0x36')][_0x5bec('0x59')](_[_0x5bec('0x46')](_0x2e33a7,_0x209da3[_0x5bec('0x57')]),{'include':_0x209da3['query'][_0x5bec('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2b701f){var _0x38deb0=_0x209da3[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0x38deb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38deb0[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x1b3c40=_0x2b701f[_0x5bec('0x54')]({'plain':!![]});var _0xc3e3df=_0x5bec('0x2f');return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0xc3e3df,'userProfileId':_0x38deb0[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0xfa751f){if(_0xfa751f&&_0xfa751f[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x1b3c40[_0x5bec('0x33')],'resourceId':_0x1b3c40['id'],'type':_0xfa751f['name'],'sectionId':_0xfa751f['id']},{})[_0x5bec('0x1c')](function(){return _0x2b701f;});}else{return _0x2b701f;}})[_0x5bec('0x4e')](function(_0x4e899c){logger[_0x5bec('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e899c);throw _0x4e899c;});}return _0x2b701f;});}})[_0x5bec('0x1c')](respondWithResult(_0x9cae50,0xc9))[_0x5bec('0x4e')](handleError(_0x9cae50,null));};exports['create']=function(_0x5a2a85,_0xd54be0,_0xcac51d){var _0xb6cf85;return db[_0x5bec('0x36')][_0x5bec('0x59')](_0x5a2a85['body'],{'raw':!![]})[_0x5bec('0x1c')](function(_0x39cb06){_0xb6cf85=_0x39cb06;return db['Trunk'][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x44a945){var _0x34f31c=fs['readFileSync'](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),_0x5bec('0x61'));var _0x3ede1d=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x1ee139=ejs[_0x5bec('0x65')](_0x34f31c,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ee139);if(_0xb6cf85['registry']){var _0x3c305e=ejs[_0x5bec('0x65')](_0x3ede1d,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0x3c305e);}})[_0x5bec('0x1c')](function(){return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x59'),{'module':'chan_sip.so'});})['then'](function(){var _0xc81e8f=_0x5a2a85[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0xc81e8f)throw new Error(_0x5bec('0x69'));if(_0xc81e8f[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x17cd00=_0xb6cf85[_0x5bec('0x54')]({'plain':!![]});return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0x5bec('0x2f'),'userProfileId':_0xc81e8f[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0x325044){if(_0x325044&&_0x325044[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x17cd00[_0x5bec('0x33')],'resourceId':_0x17cd00['id'],'type':_0x325044[_0x5bec('0x33')],'sectionId':_0x325044['id']},{})[_0x5bec('0x1c')](function(){return _0xb6cf85;});}else{return _0xb6cf85;}})['catch'](function(_0x2e76c0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e76c0);throw _0x2e76c0;});}return _0xb6cf85;})[_0x5bec('0x1c')](respondWithResult(_0xd54be0,0xc9))['catch'](handleError(_0xd54be0,null));};exports[_0x5bec('0x6a')]=function(_0x5d6af3,_0x5ca280,_0x2e849b){var _0x1b5ec0;return db['Trunk'][_0x5bec('0x52')]({'where':{'id':_0x5d6af3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x5ca280,null))[_0x5bec('0x1c')](saveUpdates(_0x5d6af3[_0x5bec('0x57')],null))[_0x5bec('0x1c')](function(_0xb76af2){if(_0xb76af2){_0x1b5ec0=_0xb76af2;return db[_0x5bec('0x36')]['findAll']({'raw':!![]});}})['then'](function(_0x2e8cd3){if(_0x2e8cd3){var _0x122c7f=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),'utf8');var _0x44ceec=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x38be2d=ejs[_0x5bec('0x65')](_0x122c7f,{'trunks':_0x2e8cd3||[]});fs['writeFileSync'](_0x5bec('0x6b'),_0x38be2d);var _0xe5f9e5=ejs[_0x5bec('0x65')](_0x44ceec,{'trunks':_0x2e8cd3||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0xe5f9e5);return respondWithRpcPromise('Reload',_0x5bec('0x6a'),{'module':_0x5bec('0x6c')});}return null;})['then'](function(_0x195c12){if(_0x195c12){return _0x1b5ec0;}})['then'](respondWithResult(_0x5ca280,null))[_0x5bec('0x4e')](handleError(_0x5ca280,null));};exports[_0x5bec('0x31')]=function(_0x4646a3,_0x313e1c,_0x437c3e){var _0x3d7600;return db[_0x5bec('0x36')][_0x5bec('0x52')]({'where':{'id':_0x4646a3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x313e1c,null))[_0x5bec('0x1c')](removeEntity(_0x313e1c,null))[_0x5bec('0x1c')](function(){return db[_0x5bec('0x36')][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x1eaf2f){var _0x317e2a=fs[_0x5bec('0x62')](path['join'](config[_0x5bec('0x63')],'server/files/templates/trunk.ejs'),_0x5bec('0x61'));var _0xfcef92=fs['readFileSync'](path['join'](config[_0x5bec('0x63')],'server/files/templates/registry.ejs'),_0x5bec('0x61'));var _0x4b70df=ejs[_0x5bec('0x65')](_0x317e2a,{'trunks':_0x1eaf2f});var _0x27b40b=ejs['render'](_0xfcef92,{'trunks':_0x1eaf2f});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4b70df);fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_registers.conf',_0x27b40b);return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x31'),{'module':'chan_sip.so'});})[_0x5bec('0x4e')](handleError(_0x313e1c,null));};
\ No newline at end of file
+var _0x3e74=['map','Trunk','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','type','filter','merge','options','includeAll','include','findAll','params','clone','find','get','omit','createdAt','body','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','Trunks','UserProfileResource','stack','name','send','index'];(function(_0x58f0a2,_0x4a5b7e){var _0x1ed5ee=function(_0x3e4435){while(--_0x3e4435){_0x58f0a2['push'](_0x58f0a2['shift']());}};_0x1ed5ee(++_0x4a5b7e);}(_0x3e74,0x175));var _0x43e7=function(_0x18e318,_0x4e3106){_0x18e318=_0x18e318-0x0;var _0x25e680=_0x3e74[_0x18e318];return _0x25e680;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];var jayson=require(_0x43e7('0x15'));var client=jayson[_0x43e7('0x16')][_0x43e7('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4e008c,_0x583d85,_0x2fcb36,_0x21fdd3){return new BPromise(function(_0x44b0bd,_0x51b974){var _0x5e641c=_0x21fdd3||client;return _0x5e641c[_0x43e7('0x18')](_0x4e008c,_0x2fcb36)[_0x43e7('0x19')](function(_0x203378){logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,'request\x20sent');logger[_0x43e7('0x1b')](_0x43e7('0x1c'),_0x583d85,_0x43e7('0x1d'),JSON['stringify'](_0x203378));if(_0x203378['error']){if(_0x203378[_0x43e7('0x1e')][_0x43e7('0x1f')]===0x1f4){logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x51b974(_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);}logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x44b0bd(_0x203378['error'][_0x43e7('0x21')]);}else{logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x43e7('0x1d'));_0x44b0bd(_0x203378[_0x43e7('0x22')][_0x43e7('0x21')]);}})[_0x43e7('0x23')](function(_0x4077fb){logger[_0x43e7('0x1e')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x4077fb);_0x51b974(_0x4077fb);});});}function respondWithStatusCode(_0x454359,_0x4eea52){_0x4eea52=_0x4eea52||0xcc;return function(_0x4c9df3){if(_0x4c9df3){return _0x454359[_0x43e7('0x24')](_0x4eea52);}return _0x454359[_0x43e7('0x25')](_0x4eea52)['end']();};}function respondWithResult(_0x1f0673,_0x4ca5cf){_0x4ca5cf=_0x4ca5cf||0xc8;return function(_0x326dab){if(_0x326dab){return _0x1f0673['status'](_0x4ca5cf)[_0x43e7('0x26')](_0x326dab);}};}function respondWithFilteredResult(_0x1b5f50,_0x20888b){return function(_0x405f85){if(_0x405f85){var _0x51f4d7=typeof _0x20888b['offset']===_0x43e7('0x27')&&typeof _0x20888b['limit']===_0x43e7('0x27');var _0x40dc8f=_0x405f85[_0x43e7('0x28')];var _0xb1fc63=_0x51f4d7?0x0:_0x20888b['offset'];var _0x33a1a5=_0x51f4d7?_0x405f85[_0x43e7('0x28')]:_0x20888b[_0x43e7('0x29')]+_0x20888b[_0x43e7('0x2a')];var _0x442c3b;if(_0x33a1a5>=_0x40dc8f){_0x33a1a5=_0x40dc8f;_0x442c3b=0xc8;}else{_0x442c3b=0xce;}_0x1b5f50[_0x43e7('0x25')](_0x442c3b);return _0x1b5f50[_0x43e7('0x2b')](_0x43e7('0x2c'),_0xb1fc63+'-'+_0x33a1a5+'/'+_0x40dc8f)[_0x43e7('0x26')](_0x405f85);}return null;};}function patchUpdates(_0x35dbcd){return function(_0x17df44){try{jsonpatch[_0x43e7('0x2d')](_0x17df44,_0x35dbcd,!![]);}catch(_0x2bde44){return BPromise[_0x43e7('0x2e')](_0x2bde44);}return _0x17df44['save']();};}function saveUpdates(_0x238321,_0x44f6b0){return function(_0x3b8f78){if(_0x3b8f78){return _0x3b8f78[_0x43e7('0x2f')](_0x238321)[_0x43e7('0x19')](function(_0x4c8650){return _0x4c8650;});}return null;};}function removeEntity(_0x1eba65,_0x49b83d){return function(_0x30d47e){if(_0x30d47e){return _0x30d47e[_0x43e7('0x30')]()['then'](function(){var _0x5a7342=_0x30d47e['get']({'plain':!![]});var _0xf8320=_0x43e7('0x31');return db[_0x43e7('0x32')][_0x43e7('0x30')]({'where':{'type':_0xf8320,'resourceId':_0x5a7342['id']}})[_0x43e7('0x19')](function(){return _0x30d47e;});})[_0x43e7('0x19')](function(){_0x1eba65['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ac23d,_0x59e5b2){return function(_0x4e8e86){if(!_0x4e8e86){_0x4ac23d['sendStatus'](0x194);}return _0x4e8e86;};}function handleError(_0x5cb753,_0x14d888){_0x14d888=_0x14d888||0x1f4;return function(_0x49cda6){logger[_0x43e7('0x1e')](_0x49cda6[_0x43e7('0x33')]);if(_0x49cda6[_0x43e7('0x34')]){delete _0x49cda6[_0x43e7('0x34')];}_0x5cb753[_0x43e7('0x25')](_0x14d888)[_0x43e7('0x35')](_0x49cda6);};}exports[_0x43e7('0x36')]=function(_0x4f1a5f,_0x5332d9){var _0x5d84f4={},_0xfa0474={},_0xfe70e9={'count':0x0,'rows':[]};var _0x199ff6=_[_0x43e7('0x37')](db[_0x43e7('0x38')][_0x43e7('0x39')],function(_0x1d4589){return{'name':_0x1d4589[_0x43e7('0x3a')],'type':_0x1d4589['type'][_0x43e7('0x3b')]};});_0xfa0474[_0x43e7('0x3c')]=_['map'](_0x199ff6,_0x43e7('0x34'));_0xfa0474['query']=_[_0x43e7('0x3d')](_0x4f1a5f[_0x43e7('0x3e')]);_0xfa0474[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0xfa0474[_0x43e7('0x3c')],_0xfa0474[_0x43e7('0x3e')]);_0x5d84f4['attributes']=_['intersection'](_0xfa0474[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x41')]));_0x5d84f4[_0x43e7('0x42')]=_0x5d84f4['attributes'][_0x43e7('0x43')]?_0x5d84f4[_0x43e7('0x42')]:_0xfa0474['model'];if(!_0x4f1a5f[_0x43e7('0x3e')]['hasOwnProperty'](_0x43e7('0x44'))){_0x5d84f4['limit']=qs[_0x43e7('0x2a')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x2a')]);_0x5d84f4[_0x43e7('0x29')]=qs['offset'](_0x4f1a5f['query'][_0x43e7('0x29')]);}_0x5d84f4[_0x43e7('0x45')]=qs[_0x43e7('0x46')](_0x4f1a5f[_0x43e7('0x3e')]['sort']);_0x5d84f4['where']=qs['filters'](_[_0x43e7('0x47')](_0x4f1a5f['query'],_0xfa0474[_0x43e7('0x3f')]),_0x199ff6);if(_0x4f1a5f['query']['filter']){_0x5d84f4[_0x43e7('0x48')]=_['merge'](_0x5d84f4[_0x43e7('0x48')],{'$or':_[_0x43e7('0x37')](_0x199ff6,function(_0x257bd8){if(_0x257bd8[_0x43e7('0x49')]!=='VIRTUAL'){var _0x91f1e4={};_0x91f1e4[_0x257bd8[_0x43e7('0x34')]]={'$like':'%'+_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x4a')]+'%'};return _0x91f1e4;}})});}_0x5d84f4=_[_0x43e7('0x4b')]({},_0x5d84f4,_0x4f1a5f[_0x43e7('0x4c')]);var _0x51eef4={'where':_0x5d84f4['where']};return db[_0x43e7('0x38')][_0x43e7('0x28')](_0x51eef4)[_0x43e7('0x19')](function(_0x4c00a8){_0xfe70e9['count']=_0x4c00a8;if(_0x4f1a5f['query'][_0x43e7('0x4d')]){_0x5d84f4[_0x43e7('0x4e')]=[{'all':!![]}];}return db['Trunk'][_0x43e7('0x4f')](_0x5d84f4);})[_0x43e7('0x19')](function(_0x3c96fe){_0xfe70e9['rows']=_0x3c96fe;return _0xfe70e9;})['then'](respondWithFilteredResult(_0x5332d9,_0x5d84f4))['catch'](handleError(_0x5332d9,null));};exports['show']=function(_0x214e7e,_0xe955fc){var _0x52fea5={'raw':![],'where':{'id':_0x214e7e[_0x43e7('0x50')]['id']}},_0x23e7cb={};_0x23e7cb[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0x23e7cb['query']=_['keys'](_0x214e7e[_0x43e7('0x3e')]);_0x23e7cb[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],_0x23e7cb[_0x43e7('0x3e')]);_0x52fea5[_0x43e7('0x42')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x214e7e[_0x43e7('0x3e')]['fields']));_0x52fea5[_0x43e7('0x42')]=_0x52fea5[_0x43e7('0x42')]['length']?_0x52fea5[_0x43e7('0x42')]:_0x23e7cb['model'];if(_0x214e7e[_0x43e7('0x3e')][_0x43e7('0x4d')]){_0x52fea5[_0x43e7('0x4e')]=[{'all':!![]}];}_0x52fea5=_[_0x43e7('0x4b')]({},_0x52fea5,_0x214e7e[_0x43e7('0x4c')]);return db['Trunk']['find'](_0x52fea5)[_0x43e7('0x19')](handleEntityNotFound(_0xe955fc,null))[_0x43e7('0x19')](respondWithResult(_0xe955fc,null))[_0x43e7('0x23')](handleError(_0xe955fc,null));};exports[_0x43e7('0x51')]=function(_0x23d835,_0x25bb44){var _0xa47464={'where':{'id':_0x23d835[_0x43e7('0x50')]['id']}},_0x44f8a0={};_0x44f8a0[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0xa47464[_0x43e7('0x42')]=_['intersection'](_0x44f8a0[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x23d835[_0x43e7('0x3e')]['fields']));_0xa47464['attributes']=_0xa47464[_0x43e7('0x42')][_0x43e7('0x43')]?_0xa47464['attributes']:_0x44f8a0[_0x43e7('0x3c')];if(_0x23d835['query']['includeAll']){_0xa47464[_0x43e7('0x4e')]=[{'all':!![]}];}_0xa47464=_[_0x43e7('0x4b')]({},_0xa47464,_0x23d835[_0x43e7('0x4c')]);return db[_0x43e7('0x38')][_0x43e7('0x52')](_0xa47464)['then'](handleEntityNotFound(_0x25bb44,null))[_0x43e7('0x19')](function(_0xdb9fbe){if(_0xdb9fbe){var _0x4d89bd=_0xdb9fbe[_0x43e7('0x53')]({'plain':!![]});_0x4d89bd=qs[_0x43e7('0x54')](_0x4d89bd,['id',_0x43e7('0x55'),'updatedAt']);_0x23d835['body']=_['omit'](_0x23d835[_0x43e7('0x56')],['id',_0x43e7('0x55'),_0x43e7('0x57')]);return db[_0x43e7('0x38')]['create'](_['merge'](_0x4d89bd,_0x23d835[_0x43e7('0x56')]),{'include':_0x23d835[_0x43e7('0x3e')][_0x43e7('0x4d')]?[{'all':!![]}]:undefined})[_0x43e7('0x19')](function(_0x5ea0db){var _0x4438c0=_0x23d835[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x4438c0)throw new Error(_0x43e7('0x59'));if(_0x4438c0[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x4665db=_0x5ea0db[_0x43e7('0x53')]({'plain':!![]});var _0x406155=_0x43e7('0x31');return db[_0x43e7('0x5b')]['find']({'where':{'name':_0x406155,'userProfileId':_0x4438c0['userProfileId']},'raw':!![]})[_0x43e7('0x19')](function(_0x58a3a8){if(_0x58a3a8&&_0x58a3a8['autoAssociation']===0x0){return db['UserProfileResource'][_0x43e7('0x5c')]({'name':_0x4665db[_0x43e7('0x34')],'resourceId':_0x4665db['id'],'type':_0x58a3a8['name'],'sectionId':_0x58a3a8['id']},{})[_0x43e7('0x19')](function(){return _0x5ea0db;});}else{return _0x5ea0db;}})[_0x43e7('0x23')](function(_0x1d8438){logger['error'](_0x43e7('0x5d'),_0x1d8438);throw _0x1d8438;});}return _0x5ea0db;});}})[_0x43e7('0x19')](respondWithResult(_0x25bb44,0xc9))[_0x43e7('0x23')](handleError(_0x25bb44,null));};exports[_0x43e7('0x5c')]=function(_0x2f43d7,_0x472a19,_0x1e02fa){var _0x515f01;return db[_0x43e7('0x38')][_0x43e7('0x5c')](_0x2f43d7[_0x43e7('0x56')],{'raw':!![]})['then'](function(_0x56b06d){_0x515f01=_0x56b06d;return db[_0x43e7('0x38')]['findAll']({'raw':!![]});})['then'](function(_0x1b793d){var _0x154e47=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x16499c=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x4e5956=ejs[_0x43e7('0x64')](_0x154e47,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x65'),_0x4e5956);if(_0x515f01[_0x43e7('0x66')]){var _0x37301b=ejs[_0x43e7('0x64')](_0x16499c,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x37301b);}})[_0x43e7('0x19')](function(){return respondWithRpcPromise(_0x43e7('0x68'),'create',{'module':_0x43e7('0x69')});})[_0x43e7('0x19')](function(){var _0x219dc6=_0x2f43d7[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x219dc6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x219dc6[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x35d133=_0x515f01[_0x43e7('0x53')]({'plain':!![]});return db[_0x43e7('0x5b')][_0x43e7('0x52')]({'where':{'name':_0x43e7('0x31'),'userProfileId':_0x219dc6['userProfileId']},'raw':!![]})['then'](function(_0x405faa){if(_0x405faa&&_0x405faa['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x35d133[_0x43e7('0x34')],'resourceId':_0x35d133['id'],'type':_0x405faa[_0x43e7('0x34')],'sectionId':_0x405faa['id']},{})[_0x43e7('0x19')](function(){return _0x515f01;});}else{return _0x515f01;}})[_0x43e7('0x23')](function(_0x18713b){logger[_0x43e7('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18713b);throw _0x18713b;});}return _0x515f01;})[_0x43e7('0x19')](respondWithResult(_0x472a19,0xc9))[_0x43e7('0x23')](handleError(_0x472a19,null));};exports[_0x43e7('0x2f')]=function(_0x5b4c76,_0x2abca0,_0xea84ec){var _0x184ae3;return db[_0x43e7('0x38')][_0x43e7('0x52')]({'where':{'id':_0x5b4c76[_0x43e7('0x50')]['id']}})[_0x43e7('0x19')](handleEntityNotFound(_0x2abca0,null))[_0x43e7('0x19')](saveUpdates(_0x5b4c76['body'],null))['then'](function(_0x55990c){if(_0x55990c){_0x184ae3=_0x55990c;return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});}})['then'](function(_0x3fe23f){if(_0x3fe23f){var _0x39a787=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x177a7a=fs[_0x43e7('0x62')](path['join'](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x3b7e5b=ejs['render'](_0x39a787,{'trunks':_0x3fe23f||[]});fs[_0x43e7('0x6a')](_0x43e7('0x65'),_0x3b7e5b);var _0x401654=ejs[_0x43e7('0x64')](_0x177a7a,{'trunks':_0x3fe23f||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x401654);return respondWithRpcPromise('Reload',_0x43e7('0x2f'),{'module':_0x43e7('0x69')});}return null;})[_0x43e7('0x19')](function(_0x90667c){if(_0x90667c){return _0x184ae3;}})[_0x43e7('0x19')](respondWithResult(_0x2abca0,null))[_0x43e7('0x23')](handleError(_0x2abca0,null));};exports[_0x43e7('0x30')]=function(_0x5e8d4e,_0x109c86,_0x40257e){var _0x1aea4e;return db[_0x43e7('0x38')]['find']({'where':{'id':_0x5e8d4e['params']['id']}})['then'](handleEntityNotFound(_0x109c86,null))[_0x43e7('0x19')](removeEntity(_0x109c86,null))['then'](function(){return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});})[_0x43e7('0x19')](function(_0x7387f6){var _0xa75254=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x3de22e=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x63')),_0x43e7('0x61'));var _0x206e54=ejs['render'](_0xa75254,{'trunks':_0x7387f6});var _0x5e04ec=ejs[_0x43e7('0x64')](_0x3de22e,{'trunks':_0x7387f6});fs[_0x43e7('0x6a')]('/etc/asterisk/sip_xcally_trunks.conf',_0x206e54);fs[_0x43e7('0x6a')](_0x43e7('0x67'),_0x5e04ec);return respondWithRpcPromise('Reload','destroy',{'module':_0x43e7('0x69')});})[_0x43e7('0x23')](handleError(_0x109c86,null));};
\ No newline at end of file
index d79eb54..6e51ed7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45ce=['../../config/logger','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util'];(function(_0xe61ff8,_0x45a014){var _0x46cbe7=function(_0x3cb835){while(--_0x3cb835){_0xe61ff8['push'](_0xe61ff8['shift']());}};_0x46cbe7(++_0x45a014);}(_0x45ce,0xbe));var _0xe45c=function(_0x58dfdd,_0x506377){_0x58dfdd=_0x58dfdd-0x0;var _0x433017=_0x45ce[_0x58dfdd];return _0x433017;};'use strict';var _=require(_0xe45c('0x0'));var util=require(_0xe45c('0x1'));var logger=require(_0xe45c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe45c('0x3'));var fs=require('fs');var path=require(_0xe45c('0x4'));var rimraf=require(_0xe45c('0x5'));var config=require(_0xe45c('0x6'));var attributes=require(_0xe45c('0x7'));module[_0xe45c('0x8')]=function(_0x499840,_0xcc5358){return _0x499840[_0xe45c('0x9')](_0xe45c('0xa'),attributes,{'tableName':_0xe45c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e97=['Trunk','tools_trunks','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./trunk.attributes','exports','define'];(function(_0x5edb06,_0x5e864b){var _0x563776=function(_0x8c22dd){while(--_0x8c22dd){_0x5edb06['push'](_0x5edb06['shift']());}};_0x563776(++_0x5e864b);}(_0x0e97,0x16a));var _0x70e9=function(_0x2bfc71,_0x1a5bf7){_0x2bfc71=_0x2bfc71-0x0;var _0x9134ac=_0x0e97[_0x2bfc71];return _0x9134ac;};'use strict';var _=require('lodash');var util=require(_0x70e9('0x0'));var logger=require(_0x70e9('0x1'))(_0x70e9('0x2'));var moment=require(_0x70e9('0x3'));var BPromise=require(_0x70e9('0x4'));var rp=require(_0x70e9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x70e9('0x6'));var config=require('../../config/environment');var attributes=require(_0x70e9('0x7'));module[_0x70e9('0x8')]=function(_0x366358,_0x4638c3){return _0x366358[_0x70e9('0x9')](_0x70e9('0xa'),attributes,{'tableName':_0x70e9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 40a97c3..1efadff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd349=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','Trunk,\x20%s,\x20%s','catch','findAll','options','raw','limit','include','map','model','attributes','then','GetTrunk','ShowTrunk','where','stringify','lodash','util'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xd349,0x139));var _0x9d34=function(_0x245602,_0x3f39b1){_0x245602=_0x245602-0x0;var _0x475f45=_0xd349[_0x245602];return _0x475f45;};'use strict';var _=require(_0x9d34('0x0'));var util=require(_0x9d34('0x1'));var moment=require(_0x9d34('0x2'));var BPromise=require(_0x9d34('0x3'));var rs=require(_0x9d34('0x4'));var fs=require('fs');var Redis=require(_0x9d34('0x5'));var db=require(_0x9d34('0x6'))['db'];var utils=require(_0x9d34('0x7'));var logger=require(_0x9d34('0x8'))('rpc');var config=require(_0x9d34('0x9'));var jayson=require(_0x9d34('0xa'));var client=jayson[_0x9d34('0xb')][_0x9d34('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22582b,_0x42a0a5,_0x2575fe){return new BPromise(function(_0x233816,_0x59e9d2){return client['request'](_0x22582b,_0x2575fe)['then'](function(_0x403af5){logger[_0x9d34('0xd')]('Trunk,\x20%s,\x20%s',_0x42a0a5,_0x9d34('0xe'));logger[_0x9d34('0xf')](_0x9d34('0x10'),_0x42a0a5,_0x9d34('0xe'),JSON['stringify'](_0x403af5));if(_0x403af5['error']){if(_0x403af5[_0x9d34('0x11')][_0x9d34('0x12')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x42a0a5,_0x403af5[_0x9d34('0x11')][_0x9d34('0x13')]);return _0x59e9d2(_0x403af5[_0x9d34('0x11')]['message']);}logger[_0x9d34('0x11')](_0x9d34('0x14'),_0x42a0a5,_0x403af5[_0x9d34('0x11')][_0x9d34('0x13')]);return _0x233816(_0x403af5[_0x9d34('0x11')][_0x9d34('0x13')]);}else{logger[_0x9d34('0xd')]('Trunk,\x20%s,\x20%s',_0x42a0a5,_0x9d34('0xe'));_0x233816(_0x403af5['result'][_0x9d34('0x13')]);}})[_0x9d34('0x15')](function(_0x28c6e7){logger['error'](_0x9d34('0x14'),_0x42a0a5,_0x28c6e7);_0x59e9d2(_0x28c6e7);});});}exports['GetTrunk']=function(_0x3f7ab3){var _0x3bbd03=this;return new Promise(function(_0x46e3a0,_0x3d9a9e){return db['Trunk'][_0x9d34('0x16')]({'raw':_0x3f7ab3[_0x9d34('0x17')]?_0x3f7ab3['options'][_0x9d34('0x18')]===undefined?!![]:![]:!![],'where':_0x3f7ab3[_0x9d34('0x17')]?_0x3f7ab3['options']['where']||null:null,'attributes':_0x3f7ab3[_0x9d34('0x17')]?_0x3f7ab3['options']['attributes']||null:null,'limit':_0x3f7ab3[_0x9d34('0x17')]?_0x3f7ab3[_0x9d34('0x17')][_0x9d34('0x19')]||null:null,'include':_0x3f7ab3[_0x9d34('0x17')]?_0x3f7ab3[_0x9d34('0x17')][_0x9d34('0x1a')]?_[_0x9d34('0x1b')](_0x3f7ab3[_0x9d34('0x17')][_0x9d34('0x1a')],function(_0x22b009){return{'model':db[_0x22b009[_0x9d34('0x1c')]],'as':_0x22b009['as'],'attributes':_0x22b009['attributes'],'include':_0x22b009[_0x9d34('0x1a')]?_['map'](_0x22b009[_0x9d34('0x1a')],function(_0xbf5b51){return{'model':db[_0xbf5b51[_0x9d34('0x1c')]],'as':_0xbf5b51['as'],'attributes':_0xbf5b51['attributes'],'include':_0xbf5b51[_0x9d34('0x1a')]?_[_0x9d34('0x1b')](_0xbf5b51['include'],function(_0x26fe0e){return{'model':db[_0x26fe0e[_0x9d34('0x1c')]],'as':_0x26fe0e['as'],'attributes':_0x26fe0e[_0x9d34('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9d34('0x1e')](function(_0x29ec45){logger[_0x9d34('0xd')](_0x9d34('0x1f'),_0x3f7ab3);logger[_0x9d34('0xf')](_0x9d34('0x1f'),_0x3f7ab3,JSON['stringify'](_0x29ec45));_0x46e3a0(_0x29ec45);})['catch'](function(_0x22770a){logger[_0x9d34('0x11')](_0x9d34('0x1f'),_0x22770a[_0x9d34('0x13')],_0x3f7ab3);_0x3d9a9e(_0x3bbd03[_0x9d34('0x11')](0x1f4,_0x22770a[_0x9d34('0x13')]));});});};exports[_0x9d34('0x20')]=function(_0x3cfe03){var _0x23ff4e=this;return new Promise(function(_0x1a1cd0,_0x5c8cbd){return db['Trunk']['find']({'raw':_0x3cfe03[_0x9d34('0x17')]?_0x3cfe03[_0x9d34('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cfe03[_0x9d34('0x17')]?_0x3cfe03[_0x9d34('0x17')][_0x9d34('0x21')]||null:null,'attributes':_0x3cfe03[_0x9d34('0x17')]?_0x3cfe03[_0x9d34('0x17')][_0x9d34('0x1d')]||null:null,'include':_0x3cfe03[_0x9d34('0x17')]?_0x3cfe03[_0x9d34('0x17')][_0x9d34('0x1a')]?_[_0x9d34('0x1b')](_0x3cfe03[_0x9d34('0x17')]['include'],function(_0x24a625){return{'model':db[_0x24a625[_0x9d34('0x1c')]],'as':_0x24a625['as'],'attributes':_0x24a625[_0x9d34('0x1d')],'include':_0x24a625[_0x9d34('0x1a')]?_[_0x9d34('0x1b')](_0x24a625[_0x9d34('0x1a')],function(_0xf88290){return{'model':db[_0xf88290[_0x9d34('0x1c')]],'as':_0xf88290['as'],'attributes':_0xf88290['attributes'],'include':_0xf88290[_0x9d34('0x1a')]?_['map'](_0xf88290[_0x9d34('0x1a')],function(_0x5a75bd){return{'model':db[_0x5a75bd['model']],'as':_0x5a75bd['as'],'attributes':_0x5a75bd[_0x9d34('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x119e4e){logger[_0x9d34('0xd')](_0x9d34('0x20'),_0x3cfe03);logger[_0x9d34('0xf')](_0x9d34('0x20'),_0x3cfe03,JSON[_0x9d34('0x22')](_0x119e4e));_0x1a1cd0(_0x119e4e);})[_0x9d34('0x15')](function(_0x40f4a5){logger[_0x9d34('0x11')](_0x9d34('0x20'),_0x40f4a5[_0x9d34('0x13')],_0x3cfe03);_0x5c8cbd(_0x23ff4e[_0x9d34('0x11')](0x1f4,_0x40f4a5[_0x9d34('0x13')]));});});};
\ No newline at end of file
+var _0x86e9=['GetTrunk','findAll','options','raw','attributes','limit','map','include','model','stringify','ShowTrunk','Trunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','message','catch'];(function(_0x42f247,_0x5bbeca){var _0x411317=function(_0x240bd6){while(--_0x240bd6){_0x42f247['push'](_0x42f247['shift']());}};_0x411317(++_0x5bbeca);}(_0x86e9,0x148));var _0x986e=function(_0x5acfde,_0x3596d4){_0x5acfde=_0x5acfde-0x0;var _0x123d61=_0x86e9[_0x5acfde];return _0x123d61;};'use strict';var _=require(_0x986e('0x0'));var util=require(_0x986e('0x1'));var moment=require(_0x986e('0x2'));var BPromise=require(_0x986e('0x3'));var rs=require(_0x986e('0x4'));var fs=require('fs');var Redis=require(_0x986e('0x5'));var db=require(_0x986e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x986e('0x7'));var config=require(_0x986e('0x8'));var jayson=require(_0x986e('0x9'));var client=jayson[_0x986e('0xa')][_0x986e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d9c58,_0xf42b52,_0x2d6cfe){return new BPromise(function(_0x27bede,_0x43609d){return client[_0x986e('0xc')](_0x2d9c58,_0x2d6cfe)[_0x986e('0xd')](function(_0x33ae91){logger[_0x986e('0xe')](_0x986e('0xf'),_0xf42b52,_0x986e('0x10'));logger[_0x986e('0x11')](_0x986e('0x12'),_0xf42b52,_0x986e('0x10'),JSON['stringify'](_0x33ae91));if(_0x33ae91[_0x986e('0x13')]){if(_0x33ae91[_0x986e('0x13')]['code']===0x1f4){logger[_0x986e('0x13')]('Trunk,\x20%s,\x20%s',_0xf42b52,_0x33ae91[_0x986e('0x13')][_0x986e('0x14')]);return _0x43609d(_0x33ae91[_0x986e('0x13')][_0x986e('0x14')]);}logger[_0x986e('0x13')](_0x986e('0xf'),_0xf42b52,_0x33ae91[_0x986e('0x13')][_0x986e('0x14')]);return _0x27bede(_0x33ae91['error']['message']);}else{logger[_0x986e('0xe')]('Trunk,\x20%s,\x20%s',_0xf42b52,'request\x20sent');_0x27bede(_0x33ae91['result'][_0x986e('0x14')]);}})[_0x986e('0x15')](function(_0x4569ba){logger[_0x986e('0x13')](_0x986e('0xf'),_0xf42b52,_0x4569ba);_0x43609d(_0x4569ba);});});}exports[_0x986e('0x16')]=function(_0x37f0a6){var _0x8b7af=this;return new Promise(function(_0x1b42af,_0x5490a9){return db['Trunk'][_0x986e('0x17')]({'raw':_0x37f0a6[_0x986e('0x18')]?_0x37f0a6[_0x986e('0x18')][_0x986e('0x19')]===undefined?!![]:![]:!![],'where':_0x37f0a6[_0x986e('0x18')]?_0x37f0a6[_0x986e('0x18')]['where']||null:null,'attributes':_0x37f0a6[_0x986e('0x18')]?_0x37f0a6['options'][_0x986e('0x1a')]||null:null,'limit':_0x37f0a6[_0x986e('0x18')]?_0x37f0a6[_0x986e('0x18')][_0x986e('0x1b')]||null:null,'include':_0x37f0a6['options']?_0x37f0a6[_0x986e('0x18')]['include']?_[_0x986e('0x1c')](_0x37f0a6['options']['include'],function(_0x56f7b6){return{'model':db[_0x56f7b6['model']],'as':_0x56f7b6['as'],'attributes':_0x56f7b6[_0x986e('0x1a')],'include':_0x56f7b6[_0x986e('0x1d')]?_[_0x986e('0x1c')](_0x56f7b6[_0x986e('0x1d')],function(_0xdbc6b){return{'model':db[_0xdbc6b['model']],'as':_0xdbc6b['as'],'attributes':_0xdbc6b[_0x986e('0x1a')],'include':_0xdbc6b[_0x986e('0x1d')]?_[_0x986e('0x1c')](_0xdbc6b['include'],function(_0x109384){return{'model':db[_0x109384[_0x986e('0x1e')]],'as':_0x109384['as'],'attributes':_0x109384[_0x986e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x986e('0xd')](function(_0x444624){logger[_0x986e('0xe')]('GetTrunk',_0x37f0a6);logger[_0x986e('0x11')]('GetTrunk',_0x37f0a6,JSON[_0x986e('0x1f')](_0x444624));_0x1b42af(_0x444624);})[_0x986e('0x15')](function(_0x6fdf6f){logger['error'](_0x986e('0x16'),_0x6fdf6f[_0x986e('0x14')],_0x37f0a6);_0x5490a9(_0x8b7af['error'](0x1f4,_0x6fdf6f[_0x986e('0x14')]));});});};exports[_0x986e('0x20')]=function(_0x59dc64){var _0x30feff=this;return new Promise(function(_0x5175ec,_0x58d6cc){return db[_0x986e('0x21')][_0x986e('0x22')]({'raw':_0x59dc64['options']?_0x59dc64[_0x986e('0x18')][_0x986e('0x19')]===undefined?!![]:![]:!![],'where':_0x59dc64[_0x986e('0x18')]?_0x59dc64[_0x986e('0x18')]['where']||null:null,'attributes':_0x59dc64[_0x986e('0x18')]?_0x59dc64[_0x986e('0x18')][_0x986e('0x1a')]||null:null,'include':_0x59dc64[_0x986e('0x18')]?_0x59dc64['options']['include']?_['map'](_0x59dc64[_0x986e('0x18')][_0x986e('0x1d')],function(_0x474306){return{'model':db[_0x474306[_0x986e('0x1e')]],'as':_0x474306['as'],'attributes':_0x474306[_0x986e('0x1a')],'include':_0x474306[_0x986e('0x1d')]?_['map'](_0x474306[_0x986e('0x1d')],function(_0x12ba9b){return{'model':db[_0x12ba9b[_0x986e('0x1e')]],'as':_0x12ba9b['as'],'attributes':_0x12ba9b[_0x986e('0x1a')],'include':_0x12ba9b[_0x986e('0x1d')]?_['map'](_0x12ba9b[_0x986e('0x1d')],function(_0x148d3d){return{'model':db[_0x148d3d[_0x986e('0x1e')]],'as':_0x148d3d['as'],'attributes':_0x148d3d[_0x986e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x986e('0xd')](function(_0x4578c2){logger[_0x986e('0xe')](_0x986e('0x20'),_0x59dc64);logger[_0x986e('0x11')](_0x986e('0x20'),_0x59dc64,JSON['stringify'](_0x4578c2));_0x5175ec(_0x4578c2);})[_0x986e('0x15')](function(_0x4b2776){logger['error'](_0x986e('0x20'),_0x4b2776[_0x986e('0x14')],_0x59dc64);_0x58d6cc(_0x30feff[_0x986e('0x13')](0x1f4,_0x4b2776['message']));});});};
\ No newline at end of file
index 9809822..6442d81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a13=['update','../../components/auth/service','put','/:id'];(function(_0x3acccb,_0x366475){var _0x64c16=function(_0x4c8568){while(--_0x4c8568){_0x3acccb['push'](_0x3acccb['shift']());}};_0x64c16(++_0x366475);}(_0x7a13,0xad));var _0x37a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a13[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x37a1('0x0'));var controller=require('./user-setting.controller');router[_0x37a1('0x1')](_0x37a1('0x2'),auth['isAuthenticated'](),controller[_0x37a1('0x3')]);module['exports']=router;
\ No newline at end of file
+var _0xdb90=['update','exports','express','Router','./user-setting.controller'];(function(_0x25f7ff,_0xfafaac){var _0xa58d8=function(_0x37f4c7){while(--_0x37f4c7){_0x25f7ff['push'](_0x25f7ff['shift']());}};_0xa58d8(++_0xfafaac);}(_0xdb90,0x147));var _0x0db9=function(_0x1aee46,_0x35a25f){_0x1aee46=_0x1aee46-0x0;var _0xf2be12=_0xdb90[_0x1aee46];return _0xf2be12;};'use strict';var express=require(_0x0db9('0x0'));var router=express[_0x0db9('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x0db9('0x2'));router['put']('/:id',auth['isAuthenticated'](),controller[_0x0db9('0x3')]);module[_0x0db9('0x4')]=router;
\ No newline at end of file
index 31541e0..7da4026 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64dc=['TEXT','DATE','INTEGER','UserId','sequelize','error','warning','debug','exports','ENUM'];(function(_0x5229d4,_0x101cb9){var _0x239eb8=function(_0x5214d9){while(--_0x5214d9){_0x5229d4['push'](_0x5229d4['shift']());}};_0x239eb8(++_0x101cb9);}(_0x64dc,0xb8));var _0xc64d=function(_0x84bb37,_0x1a37af){_0x84bb37=_0x84bb37-0x0;var _0x528577=_0x64dc[_0x84bb37];return _0x528577;};'use strict';var Sequelize=require(_0xc64d('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xc64d('0x1'),_0xc64d('0x2'),'info',_0xc64d('0x3')];module[_0xc64d('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xc64d('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xc64d('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xc64d('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xc64d('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xc64d('0x8')],'unique':_0xc64d('0x9')}};
\ No newline at end of file
+var _0x76aa=['DATE','UserId','sequelize','error','warning','info','exports','ENUM','TEXT'];(function(_0x483017,_0x73092c){var _0x3cc794=function(_0x28cb06){while(--_0x28cb06){_0x483017['push'](_0x483017['shift']());}};_0x3cc794(++_0x73092c);}(_0x76aa,0xec));var _0xa76a=function(_0x1ab58f,_0x549112){_0x1ab58f=_0x1ab58f-0x0;var _0x120521=_0x76aa[_0x1ab58f];return _0x120521;};'use strict';var Sequelize=require(_0xa76a('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xa76a('0x1'),_0xa76a('0x2'),_0xa76a('0x3'),'debug'];module[_0xa76a('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xa76a('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xa76a('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xa76a('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xa76a('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0xa76a('0x8')}};
\ No newline at end of file
index d3dfc0f..f8656b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb903=['UserSetting','find','params','then','catch','lodash','ioredis','../../config/logger','api','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','status','json','sendStatus','error','name','role','admin','Invalid\x20user\x20setting\x20id'];(function(_0x59cef0,_0x20bd73){var _0x2f9e4e=function(_0x31ce1c){while(--_0x31ce1c){_0x59cef0['push'](_0x59cef0['shift']());}};_0x2f9e4e(++_0x20bd73);}(_0xb903,0x185));var _0x3b90=function(_0x2ae842,_0x1ba648){_0x2ae842=_0x2ae842-0x0;var _0x1984d4=_0xb903[_0x2ae842];return _0x1984d4;};'use strict';var _=require(_0x3b90('0x0'));var Redis=require(_0x3b90('0x1'));var logger=require(_0x3b90('0x2'))(_0x3b90('0x3'));var config=require('../../config/environment');var db=require(_0x3b90('0x4'))['db'];var socket=require(_0x3b90('0x5'))(new Redis(config[_0x3b90('0x6')]));require(_0x3b90('0x7'))[_0x3b90('0x8')](socket);config[_0x3b90('0x6')]=_[_0x3b90('0x9')](config['redis'],{'host':_0x3b90('0xa'),'port':0x18eb});function respondWithResult(_0x5e845a,_0x55792c){_0x55792c=_0x55792c||0xc8;return function(_0x153283){if(_0x153283){return _0x5e845a[_0x3b90('0xb')](_0x55792c)[_0x3b90('0xc')](_0x153283);}};}function saveUpdates(_0x1b1fbf){return function(_0x5808c7){if(_0x5808c7){return _0x5808c7['update'](_0x1b1fbf)['then'](function(_0x51f916){return _0x51f916;});}return null;};}function handleEntityNotFound(_0x56261b){return function(_0x55db3f){if(!_0x55db3f){_0x56261b[_0x3b90('0xd')](0x194);}return _0x55db3f;};}function handleError(_0x5af39c,_0x574955){_0x574955=_0x574955||0x1f4;return function(_0x30c49c){logger[_0x3b90('0xe')](_0x30c49c['stack']);if(_0x30c49c[_0x3b90('0xf')]){delete _0x30c49c[_0x3b90('0xf')];}_0x5af39c[_0x3b90('0xb')](_0x574955)['send'](_0x30c49c);};}exports['update']=function(_0x58c4d1,_0x542cb3){if(_0x58c4d1['user'][_0x3b90('0x10')]!==_0x3b90('0x11'))throw new Error('Unauthorized');if(isNaN(Number(_0x58c4d1['params']['id'])))throw new Error(_0x3b90('0x12'));return db[_0x3b90('0x13')][_0x3b90('0x14')]({'where':{'id':_0x58c4d1[_0x3b90('0x15')]['id']}})[_0x3b90('0x16')](handleEntityNotFound(_0x542cb3,null))['then'](saveUpdates(_0x58c4d1['body'],null))[_0x3b90('0x16')](respondWithResult(_0x542cb3,null))[_0x3b90('0x17')](handleError(_0x542cb3,null));};
\ No newline at end of file
+var _0xc9b7=['socket.io-emitter','./user-setting.socket','register','redis','defaults','localhost','status','json','update','then','stack','name','user','admin','Unauthorized','Invalid\x20user\x20setting\x20id','find','params','catch','lodash','ioredis','../../config/logger','api','../../mysqldb'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xc9b7,0x1ab));var _0x7c9b=function(_0xf20b6,_0x49ddbb){_0xf20b6=_0xf20b6-0x0;var _0x4ff567=_0xc9b7[_0xf20b6];return _0x4ff567;};'use strict';var _=require(_0x7c9b('0x0'));var Redis=require(_0x7c9b('0x1'));var logger=require(_0x7c9b('0x2'))(_0x7c9b('0x3'));var config=require('../../config/environment');var db=require(_0x7c9b('0x4'))['db'];var socket=require(_0x7c9b('0x5'))(new Redis(config['redis']));require(_0x7c9b('0x6'))[_0x7c9b('0x7')](socket);config[_0x7c9b('0x8')]=_[_0x7c9b('0x9')](config[_0x7c9b('0x8')],{'host':_0x7c9b('0xa'),'port':0x18eb});function respondWithResult(_0x351532,_0xdfe4d7){_0xdfe4d7=_0xdfe4d7||0xc8;return function(_0x456555){if(_0x456555){return _0x351532[_0x7c9b('0xb')](_0xdfe4d7)[_0x7c9b('0xc')](_0x456555);}};}function saveUpdates(_0x3d2f35){return function(_0x3228bb){if(_0x3228bb){return _0x3228bb[_0x7c9b('0xd')](_0x3d2f35)[_0x7c9b('0xe')](function(_0x2705ec){return _0x2705ec;});}return null;};}function handleEntityNotFound(_0x306fd2){return function(_0x418d92){if(!_0x418d92){_0x306fd2['sendStatus'](0x194);}return _0x418d92;};}function handleError(_0x31a629,_0x447b96){_0x447b96=_0x447b96||0x1f4;return function(_0xcf69c8){logger['error'](_0xcf69c8[_0x7c9b('0xf')]);if(_0xcf69c8['name']){delete _0xcf69c8[_0x7c9b('0x10')];}_0x31a629[_0x7c9b('0xb')](_0x447b96)['send'](_0xcf69c8);};}exports[_0x7c9b('0xd')]=function(_0x2f5bb4,_0x271052){if(_0x2f5bb4[_0x7c9b('0x11')]['role']!==_0x7c9b('0x12'))throw new Error(_0x7c9b('0x13'));if(isNaN(Number(_0x2f5bb4['params']['id'])))throw new Error(_0x7c9b('0x14'));return db['UserSetting'][_0x7c9b('0x15')]({'where':{'id':_0x2f5bb4[_0x7c9b('0x16')]['id']}})[_0x7c9b('0xe')](handleEntityNotFound(_0x271052,null))['then'](saveUpdates(_0x2f5bb4['body'],null))['then'](respondWithResult(_0x271052,null))[_0x7c9b('0x17')](handleError(_0x271052,null));};
\ No newline at end of file
index 5cb4518..5658268 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81c8=['exports','events','../../mysqldb','UserSetting','save','remove','emit','hasOwnProperty','hook'];(function(_0xedde59,_0x50d9b1){var _0x4db279=function(_0xa24719){while(--_0xa24719){_0xedde59['push'](_0xedde59['shift']());}};_0x4db279(++_0x50d9b1);}(_0x81c8,0x1f0));var _0x881c=function(_0x48bad0,_0x4e7cef){_0x48bad0=_0x48bad0-0x0;var _0x3659a9=_0x81c8[_0x48bad0];return _0x3659a9;};'use strict';var EventEmitter=require(_0x881c('0x0'));var UserSetting=require(_0x881c('0x1'))['db'][_0x881c('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x881c('0x3'),'afterUpdate':'update','afterDestroy':_0x881c('0x4')};function emitEvent(_0x97d81a){return function(_0x23bd30,_0x5cb594,_0x3d1b29){UserSettingEvents[_0x881c('0x5')](_0x97d81a+':'+_0x23bd30['id'],_0x23bd30);UserSettingEvents[_0x881c('0x5')](_0x97d81a,_0x23bd30);_0x3d1b29(null);};}for(var e in events){if(events[_0x881c('0x6')](e)){var event=events[e];UserSetting[_0x881c('0x7')](e,emitEvent(event));}}module[_0x881c('0x8')]=UserSettingEvents;
\ No newline at end of file
+var _0x8426=['events','UserSetting','setMaxListeners','save','update','hasOwnProperty','hook','exports'];(function(_0x263f4c,_0x438626){var _0x3a78d3=function(_0xbdb00f){while(--_0xbdb00f){_0x263f4c['push'](_0x263f4c['shift']());}};_0x3a78d3(++_0x438626);}(_0x8426,0x78));var _0x6842=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x8426[_0x4b2436];return _0x4f5ab2;};'use strict';var EventEmitter=require(_0x6842('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x6842('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x6842('0x2')](0x0);var events={'afterCreate':_0x6842('0x3'),'afterUpdate':_0x6842('0x4'),'afterDestroy':'remove'};function emitEvent(_0xfecf49){return function(_0x2f9923,_0x1e9500,_0x2b3cdc){UserSettingEvents['emit'](_0xfecf49+':'+_0x2f9923['id'],_0x2f9923);UserSettingEvents['emit'](_0xfecf49,_0x2f9923);_0x2b3cdc(null);};}for(var e in events){if(events[_0x6842('0x5')](e)){var event=events[e];UserSetting[_0x6842('0x6')](e,emitEvent(event));}}module[_0x6842('0x7')]=UserSettingEvents;
\ No newline at end of file
index ef7aa72..a97d404 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb677=['define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x4ea955,_0x1eda76){var _0x558561=function(_0x5b20f4){while(--_0x5b20f4){_0x4ea955['push'](_0x4ea955['shift']());}};_0x558561(++_0x1eda76);}(_0xb677,0x119));var _0x7b67=function(_0x5b508,_0x5105d8){_0x5b508=_0x5b508-0x0;var _0x37f7e2=_0xb677[_0x5b508];return _0x37f7e2;};'use strict';var attributes=require(_0x7b67('0x0'));module['exports']=function(_0x3df6b1){return _0x3df6b1[_0x7b67('0x1')](_0x7b67('0x2'),attributes,{'tableName':_0x7b67('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x13f678){if(!_0x13f678[_0x7b67('0x4')])_0x13f678[_0x7b67('0x5')]=null;else if(_0x13f678[_0x7b67('0x5')]===null)_0x13f678['clientSideLoggingEnabledSince']=new Date();}}});};
\ No newline at end of file
+var _0xf4eb=['user_settings','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0xc125a2,_0x4bb5ac){var _0x22adf5=function(_0x1cd73e){while(--_0x1cd73e){_0xc125a2['push'](_0xc125a2['shift']());}};_0x22adf5(++_0x4bb5ac);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2a742e,_0x447498){_0x2a742e=_0x2a742e-0x0;var _0x13275c=_0xf4eb[_0x2a742e];return _0x13275c;};'use strict';var attributes=require(_0xbf4e('0x0'));module['exports']=function(_0x50f2fc){return _0x50f2fc['define']('UserSetting',attributes,{'tableName':_0xbf4e('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x49d80e){if(!_0x49d80e['clientSideLoggingEnabled'])_0x49d80e[_0xbf4e('0x2')]=null;else if(_0x49d80e[_0xbf4e('0x2')]===null)_0x49d80e[_0xbf4e('0x2')]=new Date();}}});};
\ No newline at end of file
index 0fdd76e..443c467 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbab9=['user-setting:update:user-','UserId','register','length','user-setting:','save','update','emit','user-setting:update'];(function(_0x292600,_0x120a55){var _0x2ef83b=function(_0xe2e801){while(--_0xe2e801){_0x292600['push'](_0x292600['shift']());}};_0x2ef83b(++_0x120a55);}(_0xbab9,0x164));var _0x9bab=function(_0x4d928a,_0x1095f2){_0x4d928a=_0x4d928a-0x0;var _0x43c167=_0xbab9[_0x4d928a];return _0x43c167;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x9bab('0x0'),'remove',_0x9bab('0x1')];function createListener(_0x1336d5,_0x2249da){return function(_0xc4472c){_0x2249da[_0x9bab('0x2')](_0x1336d5,_0xc4472c);if(_0x1336d5===_0x9bab('0x3')){_0x2249da[_0x9bab('0x2')](_0x9bab('0x4')+_0xc4472c[_0x9bab('0x5')],_0xc4472c);}};}exports[_0x9bab('0x6')]=function(_0xcef581){for(var _0x2ef547=0x0,_0x11fdcc=events[_0x9bab('0x7')];_0x2ef547<_0x11fdcc;_0x2ef547++){var _0x1d51e0=events[_0x2ef547];var _0x4e5503=createListener(_0x9bab('0x8')+_0x1d51e0,_0xcef581);UserSettingEvents['on'](_0x1d51e0,_0x4e5503);}};
\ No newline at end of file
+var _0xaab8=['user-setting:update:user-','length','user-setting:','./user-setting.events','save','emit'];(function(_0x447870,_0x53ea03){var _0x21fd74=function(_0x592298){while(--_0x592298){_0x447870['push'](_0x447870['shift']());}};_0x21fd74(++_0x53ea03);}(_0xaab8,0x87));var _0x8aab=function(_0x532020,_0x28955d){_0x532020=_0x532020-0x0;var _0x2d855e=_0xaab8[_0x532020];return _0x2d855e;};'use strict';var UserSettingEvents=require(_0x8aab('0x0'));var events=[_0x8aab('0x1'),'remove','update'];function createListener(_0x4627a4,_0x50b2fa){return function(_0x5ef530){_0x50b2fa[_0x8aab('0x2')](_0x4627a4,_0x5ef530);if(_0x4627a4==='user-setting:update'){_0x50b2fa[_0x8aab('0x2')](_0x8aab('0x3')+_0x5ef530['UserId'],_0x5ef530);}};}exports['register']=function(_0x33ef44){for(var _0x193b0a=0x0,_0x10ebdc=events[_0x8aab('0x4')];_0x193b0a<_0x10ebdc;_0x193b0a++){var _0x4cfda6=events[_0x193b0a];var _0x43479f=createListener(_0x8aab('0x5')+_0x4cfda6,_0x33ef44);UserSettingEvents['on'](_0x4cfda6,_0x43479f);}};
\ No newline at end of file
index a955993..d7256fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6948=['changePassword','delete','removeQueues','/:id/teams','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','/describe','describe','/whoami','whoami','get','/presence','getPresence','/:id','show','/:id/avatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getSmsAccounts','/:id/whatsapp_accounts','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','addQueues','join','root','server/files/images/','format','%s-%s','now','originalname','single','addAvatar','/:id/login','/:id/logout','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','addSquareProjects','put','/:id/password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6948,0x84));var _0x8694=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6948[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x8694('0x0'));var util=require(_0x8694('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8694('0x2'));var router=express[_0x8694('0x3')]();var fs_extra=require(_0x8694('0x4'));var auth=require(_0x8694('0x5'));var interaction=require(_0x8694('0x6'));var config=require(_0x8694('0x7'));var controller=require(_0x8694('0x8'));router['get']('/',auth[_0x8694('0x9')](),controller[_0x8694('0xa')]);router['get'](_0x8694('0xb'),auth[_0x8694('0x9')](),controller[_0x8694('0xc')]);router['get'](_0x8694('0xd'),auth['isAuthenticated'](),controller[_0x8694('0xe')]);router[_0x8694('0xf')](_0x8694('0x10'),auth[_0x8694('0x9')](),controller[_0x8694('0x11')]);router[_0x8694('0xf')](_0x8694('0x12'),auth[_0x8694('0x9')](),controller[_0x8694('0x13')]);router['get'](_0x8694('0x14'),controller['getAvatar']);router[_0x8694('0xf')](_0x8694('0x15'),auth[_0x8694('0x9')](),controller['getOpenTabs']);router[_0x8694('0xf')](_0x8694('0x16'),auth[_0x8694('0x9')](),controller[_0x8694('0x17')]);router[_0x8694('0xf')](_0x8694('0x18'),auth[_0x8694('0x9')](),controller[_0x8694('0x19')]);router[_0x8694('0xf')]('/:id/queues_rt',auth[_0x8694('0x9')](),controller[_0x8694('0x1a')]);router[_0x8694('0xf')](_0x8694('0x1b'),auth['isAuthenticated'](),controller[_0x8694('0x1c')]);router[_0x8694('0xf')]('/:id/recordings',auth[_0x8694('0x9')](),controller[_0x8694('0x1d')]);router[_0x8694('0xf')](_0x8694('0x1e'),auth[_0x8694('0x9')](),controller['getScreenRecordings']);router[_0x8694('0xf')](_0x8694('0x1f'),auth[_0x8694('0x9')](),controller[_0x8694('0x20')]);router['get']('/:id/openchannel/interactions',auth[_0x8694('0x9')](),controller[_0x8694('0x21')]);router['get'](_0x8694('0x22'),auth[_0x8694('0x9')](),controller['getMailInteractions']);router['get']('/:id/sms/interactions',auth[_0x8694('0x9')](),controller['getSmsInteractions']);router[_0x8694('0xf')](_0x8694('0x23'),auth['isAuthenticated'](),controller[_0x8694('0x24')]);router[_0x8694('0xf')](_0x8694('0x25'),auth['isAuthenticated'](),controller[_0x8694('0x26')]);router['get']('/:id/teams',auth[_0x8694('0x9')](),controller[_0x8694('0x27')]);router[_0x8694('0xf')](_0x8694('0x28'),auth[_0x8694('0x9')](),controller[_0x8694('0x29')]);router['get'](_0x8694('0x2a'),auth['isAuthenticated'](),controller[_0x8694('0x2b')]);router[_0x8694('0xf')]('/:id/prefixes',auth[_0x8694('0x9')](),controller[_0x8694('0x2c')]);router['get']('/:id/fax_accounts',auth[_0x8694('0x9')](),controller[_0x8694('0x2d')]);router[_0x8694('0xf')](_0x8694('0x2e'),auth[_0x8694('0x9')](),controller[_0x8694('0x2f')]);router[_0x8694('0xf')](_0x8694('0x30'),auth[_0x8694('0x9')](),controller['getOpenchannelAccounts']);router[_0x8694('0xf')]('/:id/sms_accounts',auth[_0x8694('0x9')](),controller[_0x8694('0x31')]);router[_0x8694('0xf')]('/:id/chat_websites',auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x8694('0xf')](_0x8694('0x32'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0x8694('0xf')]('/:id/square_projects',auth[_0x8694('0x9')](),controller[_0x8694('0x33')]);router['get'](_0x8694('0x34'),auth[_0x8694('0x9')](),controller[_0x8694('0x35')]);router[_0x8694('0xf')](_0x8694('0x36'),auth[_0x8694('0x9')](),controller[_0x8694('0x37')]);router[_0x8694('0x38')](_0x8694('0x16'),auth[_0x8694('0x9')](),controller[_0x8694('0x39')]);router[_0x8694('0x38')]('/',auth[_0x8694('0x9')](),controller[_0x8694('0x3a')]);router[_0x8694('0x38')]('/create_many',auth[_0x8694('0x9')](),controller['bulkCreate']);router['post'](_0x8694('0x18'),auth['isAuthenticated'](),controller[_0x8694('0x3b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x26bf6a,_0x48469e,_0x12b2c5){_0x12b2c5(null,path[_0x8694('0x3c')](config[_0x8694('0x3d')],_0x8694('0x3e')));},'filename':function(_0x674101,_0x38ba8b,_0x1395db){_0x1395db(null,util[_0x8694('0x3f')](_0x8694('0x40'),Date[_0x8694('0x41')](),_0x38ba8b[_0x8694('0x42')]));}})});router[_0x8694('0x38')](_0x8694('0x14'),upload[_0x8694('0x43')]('file'),controller[_0x8694('0x44')]);router[_0x8694('0x38')](_0x8694('0x45'),auth[_0x8694('0x9')](),controller['login']);router[_0x8694('0x38')](_0x8694('0x46'),auth[_0x8694('0x9')](),controller['logout']);router[_0x8694('0x38')]('/:id/pause',auth[_0x8694('0x9')](),controller[_0x8694('0x47')]);router[_0x8694('0x38')](_0x8694('0x48'),auth[_0x8694('0x9')](),controller[_0x8694('0x49')]);router[_0x8694('0x38')]('/:id/teams',auth[_0x8694('0x9')](),controller[_0x8694('0x4a')]);router[_0x8694('0x38')](_0x8694('0x4b'),auth[_0x8694('0x9')](),controller[_0x8694('0x4c')]);router[_0x8694('0x38')](_0x8694('0x4d'),auth[_0x8694('0x9')](),controller[_0x8694('0x4e')]);router['post'](_0x8694('0x4f'),auth[_0x8694('0x9')](),controller[_0x8694('0x50')]);router[_0x8694('0x38')](_0x8694('0x51'),auth[_0x8694('0x9')](),controller['addSmsInteractions']);router['post'](_0x8694('0x52'),auth[_0x8694('0x9')](),controller[_0x8694('0x53')]);router[_0x8694('0x38')]('/:id/whatsapp_interactions',auth[_0x8694('0x9')](),controller[_0x8694('0x54')]);router[_0x8694('0x38')](_0x8694('0x55'),auth['isAuthenticated'](),controller[_0x8694('0x56')]);router[_0x8694('0x38')](_0x8694('0x2e'),auth[_0x8694('0x9')](),controller['addMailAccounts']);router[_0x8694('0x38')](_0x8694('0x30'),auth['isAuthenticated'](),controller[_0x8694('0x57')]);router[_0x8694('0x38')](_0x8694('0x58'),auth[_0x8694('0x9')](),controller[_0x8694('0x59')]);router[_0x8694('0x38')](_0x8694('0x5a'),auth[_0x8694('0x9')](),controller[_0x8694('0x5b')]);router[_0x8694('0x38')](_0x8694('0x32'),auth[_0x8694('0x9')](),controller[_0x8694('0x5c')]);router['post']('/:id/square_projects',auth[_0x8694('0x9')](),controller[_0x8694('0x5d')]);router[_0x8694('0x38')](_0x8694('0x36'),auth[_0x8694('0x9')](),controller['createApiKey']);router[_0x8694('0x5e')](_0x8694('0x12'),auth[_0x8694('0x9')](),controller['update']);router['put'](_0x8694('0x5f'),auth[_0x8694('0x9')](),controller[_0x8694('0x60')]);router[_0x8694('0x61')](_0x8694('0x18'),auth[_0x8694('0x9')](),controller[_0x8694('0x62')]);router[_0x8694('0x61')](_0x8694('0x63'),auth[_0x8694('0x9')](),controller[_0x8694('0x64')]);router[_0x8694('0x61')](_0x8694('0x12'),auth[_0x8694('0x9')](),controller[_0x8694('0x65')]);router[_0x8694('0x61')]('/:id/chat_interactions',auth[_0x8694('0x9')](),controller[_0x8694('0x66')]);router[_0x8694('0x61')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x8694('0x67')]);router[_0x8694('0x61')](_0x8694('0x4f'),auth[_0x8694('0x9')](),controller['removeFaxInteractions']);router[_0x8694('0x61')]('/:id/sms_interactions',auth[_0x8694('0x9')](),controller[_0x8694('0x68')]);router[_0x8694('0x61')](_0x8694('0x52'),auth['isAuthenticated'](),controller[_0x8694('0x69')]);router[_0x8694('0x61')]('/:id/whatsapp_interactions',auth[_0x8694('0x9')](),controller['removeWhatsappInteractions']);router[_0x8694('0x61')](_0x8694('0x55'),auth[_0x8694('0x9')](),controller[_0x8694('0x6a')]);router[_0x8694('0x61')](_0x8694('0x2e'),auth[_0x8694('0x9')](),controller[_0x8694('0x6b')]);router[_0x8694('0x61')](_0x8694('0x30'),auth['isAuthenticated'](),controller[_0x8694('0x6c')]);router[_0x8694('0x61')](_0x8694('0x58'),auth[_0x8694('0x9')](),controller[_0x8694('0x6d')]);router[_0x8694('0x61')](_0x8694('0x5a'),auth[_0x8694('0x9')](),controller[_0x8694('0x6e')]);router[_0x8694('0x61')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x8694('0x6f')]);router[_0x8694('0x61')]('/:id/square_projects',auth[_0x8694('0x9')](),controller[_0x8694('0x70')]);router[_0x8694('0x61')]('/:id/api_key',auth[_0x8694('0x9')](),controller['removeApiKey']);module[_0x8694('0x71')]=router;
\ No newline at end of file
+var _0x7e73=['/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/sms_interactions','addSmsInteractions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addWhatsappAccounts','createApiKey','put','update','changePassword','delete','removeTeams','destroy','removeChatInteractions','/:id/openchannel_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','/:id/mail/interactions','getMailInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','/:id/api_key','post','addContacts','create','/create_many','bulkCreate','addQueues','join','root','server/files/images/','format','%s-%s','now','single','file','/:id/login','login','/:id/logout','logout','/:id/pause','pause'];(function(_0x5a05be,_0x389057){var _0x264734=function(_0x2a97bb){while(--_0x2a97bb){_0x5a05be['push'](_0x5a05be['shift']());}};_0x264734(++_0x389057);}(_0x7e73,0x16b));var _0x37e7=function(_0x635346,_0x28b302){_0x635346=_0x635346-0x0;var _0x5ea2f6=_0x7e73[_0x635346];return _0x5ea2f6;};'use strict';var multer=require(_0x37e7('0x0'));var util=require(_0x37e7('0x1'));var path=require(_0x37e7('0x2'));var timeout=require('connect-timeout');var express=require(_0x37e7('0x3'));var router=express[_0x37e7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x37e7('0x5'));var interaction=require(_0x37e7('0x6'));var config=require(_0x37e7('0x7'));var controller=require('./user.controller');router[_0x37e7('0x8')]('/',auth[_0x37e7('0x9')](),controller[_0x37e7('0xa')]);router['get'](_0x37e7('0xb'),auth[_0x37e7('0x9')](),controller[_0x37e7('0xc')]);router[_0x37e7('0x8')]('/whoami',auth[_0x37e7('0x9')](),controller[_0x37e7('0xd')]);router[_0x37e7('0x8')](_0x37e7('0xe'),auth[_0x37e7('0x9')](),controller[_0x37e7('0xf')]);router[_0x37e7('0x8')](_0x37e7('0x10'),auth[_0x37e7('0x9')](),controller['show']);router[_0x37e7('0x8')](_0x37e7('0x11'),controller[_0x37e7('0x12')]);router[_0x37e7('0x8')](_0x37e7('0x13'),auth['isAuthenticated'](),controller[_0x37e7('0x14')]);router['get'](_0x37e7('0x15'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x16')]);router[_0x37e7('0x8')](_0x37e7('0x17'),auth[_0x37e7('0x9')](),controller['getQueues']);router[_0x37e7('0x8')](_0x37e7('0x18'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x19')]);router[_0x37e7('0x8')](_0x37e7('0x1a'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x1b')]);router[_0x37e7('0x8')](_0x37e7('0x1c'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x1d')]);router[_0x37e7('0x8')](_0x37e7('0x1e'),auth[_0x37e7('0x9')](),controller['getScreenRecordings']);router['get'](_0x37e7('0x1f'),auth['isAuthenticated'](),controller['getChatInteractions']);router[_0x37e7('0x8')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller['getOpenchannelInteractions']);router['get'](_0x37e7('0x20'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x21')]);router[_0x37e7('0x8')]('/:id/sms/interactions',auth[_0x37e7('0x9')](),controller['getSmsInteractions']);router['get'](_0x37e7('0x22'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x23')]);router[_0x37e7('0x8')](_0x37e7('0x24'),auth['isAuthenticated'](),controller[_0x37e7('0x25')]);router[_0x37e7('0x8')](_0x37e7('0x26'),auth[_0x37e7('0x9')](),controller['getTeams']);router[_0x37e7('0x8')](_0x37e7('0x27'),auth['isAuthenticated'](),controller[_0x37e7('0x28')]);router[_0x37e7('0x8')](_0x37e7('0x29'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x2a')]);router[_0x37e7('0x8')](_0x37e7('0x2b'),auth['isAuthenticated'](),controller[_0x37e7('0x2c')]);router[_0x37e7('0x8')]('/:id/fax_accounts',auth['isAuthenticated'](),controller['getFaxAccounts']);router[_0x37e7('0x8')](_0x37e7('0x2d'),auth['isAuthenticated'](),controller[_0x37e7('0x2e')]);router['get'](_0x37e7('0x2f'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x30')]);router[_0x37e7('0x8')](_0x37e7('0x31'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x32')]);router[_0x37e7('0x8')](_0x37e7('0x33'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x34')]);router[_0x37e7('0x8')](_0x37e7('0x35'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0x37e7('0x8')](_0x37e7('0x36'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x37')]);router[_0x37e7('0x8')]('/:id/scheduled_calls',auth[_0x37e7('0x9')](),controller['getScheduledCalls']);router['get'](_0x37e7('0x38'),auth[_0x37e7('0x9')](),controller['getApiKey']);router[_0x37e7('0x39')]('/:id/contacts',auth[_0x37e7('0x9')](),controller[_0x37e7('0x3a')]);router['post']('/',auth[_0x37e7('0x9')](),controller[_0x37e7('0x3b')]);router['post'](_0x37e7('0x3c'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x3d')]);router[_0x37e7('0x39')](_0x37e7('0x17'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x3e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xd7aa97,_0x4b58ef,_0x3416f0){_0x3416f0(null,path[_0x37e7('0x3f')](config[_0x37e7('0x40')],_0x37e7('0x41')));},'filename':function(_0x6229a4,_0x19fdf3,_0x100f14){_0x100f14(null,util[_0x37e7('0x42')](_0x37e7('0x43'),Date[_0x37e7('0x44')](),_0x19fdf3['originalname']));}})});router[_0x37e7('0x39')](_0x37e7('0x11'),upload[_0x37e7('0x45')](_0x37e7('0x46')),controller['addAvatar']);router['post'](_0x37e7('0x47'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x48')]);router['post'](_0x37e7('0x49'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x4a')]);router[_0x37e7('0x39')](_0x37e7('0x4b'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x4c')]);router[_0x37e7('0x39')](_0x37e7('0x4d'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x4e')]);router[_0x37e7('0x39')](_0x37e7('0x26'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x4f')]);router[_0x37e7('0x39')](_0x37e7('0x50'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x51')]);router[_0x37e7('0x39')](_0x37e7('0x52'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x53')]);router[_0x37e7('0x39')]('/:id/fax_interactions',auth[_0x37e7('0x9')](),controller['addFaxInteractions']);router[_0x37e7('0x39')](_0x37e7('0x54'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x55')]);router[_0x37e7('0x39')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0x37e7('0x39')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x37e7('0x56')]);router['post'](_0x37e7('0x57'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x58')]);router['post'](_0x37e7('0x2d'),auth['isAuthenticated'](),controller[_0x37e7('0x59')]);router[_0x37e7('0x39')](_0x37e7('0x2f'),auth['isAuthenticated'](),controller[_0x37e7('0x5a')]);router[_0x37e7('0x39')](_0x37e7('0x31'),auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0x37e7('0x39')](_0x37e7('0x33'),auth[_0x37e7('0x9')](),controller['addChatWebsites']);router[_0x37e7('0x39')](_0x37e7('0x35'),auth['isAuthenticated'](),controller[_0x37e7('0x5b')]);router[_0x37e7('0x39')]('/:id/square_projects',auth[_0x37e7('0x9')](),controller['addSquareProjects']);router['post']('/:id/api_key',auth['isAuthenticated'](),controller[_0x37e7('0x5c')]);router[_0x37e7('0x5d')]('/:id',auth['isAuthenticated'](),controller[_0x37e7('0x5e')]);router[_0x37e7('0x5d')]('/:id/password',auth[_0x37e7('0x9')](),controller[_0x37e7('0x5f')]);router[_0x37e7('0x60')]('/:id/queues',auth[_0x37e7('0x9')](),controller['removeQueues']);router[_0x37e7('0x60')](_0x37e7('0x26'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x61')]);router[_0x37e7('0x60')]('/:id',auth[_0x37e7('0x9')](),controller[_0x37e7('0x62')]);router[_0x37e7('0x60')](_0x37e7('0x50'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x63')]);router[_0x37e7('0x60')]('/:id/mail_interactions',auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0x37e7('0x60')]('/:id/fax_interactions',auth[_0x37e7('0x9')](),controller['removeFaxInteractions']);router[_0x37e7('0x60')]('/:id/sms_interactions',auth[_0x37e7('0x9')](),controller['removeSmsInteractions']);router['delete'](_0x37e7('0x64'),auth[_0x37e7('0x9')](),controller['removeOpenchannelInteractions']);router[_0x37e7('0x60')]('/:id/whatsapp_interactions',auth[_0x37e7('0x9')](),controller[_0x37e7('0x65')]);router[_0x37e7('0x60')]('/:id/fax_accounts',auth[_0x37e7('0x9')](),controller[_0x37e7('0x66')]);router[_0x37e7('0x60')](_0x37e7('0x2d'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x67')]);router[_0x37e7('0x60')](_0x37e7('0x2f'),auth['isAuthenticated'](),controller[_0x37e7('0x68')]);router['delete']('/:id/sms_accounts',auth[_0x37e7('0x9')](),controller[_0x37e7('0x69')]);router['delete'](_0x37e7('0x33'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x6a')]);router[_0x37e7('0x60')]('/:id/whatsapp_accounts',auth[_0x37e7('0x9')](),controller[_0x37e7('0x6b')]);router[_0x37e7('0x60')](_0x37e7('0x36'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x6c')]);router[_0x37e7('0x60')](_0x37e7('0x38'),auth[_0x37e7('0x9')](),controller['removeApiKey']);module[_0x37e7('0x6d')]=router;
\ No newline at end of file
index 584eb4a..63b270a 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(_0x45fb7e,_0x23b174){var _0x16af63=function(_0x18e1a4){while(--_0x18e1a4){_0x45fb7e['push'](_0x45fb7e['shift']());}};_0x16af63(++_0x23b174);}(_0x34e8,0x12c));var _0x834e=function(_0x4003c0,_0x220fb5){_0x4003c0=_0x4003c0-0x0;var _0x7e6d7a=_0x34e8[_0x4003c0];return _0x7e6d7a;};'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 _0x70e0=['refuse','originate','uac','uas','fingerprint','update,nonat','TEXT','showWebBar','get','isArray','wss','udp','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','BOOLEAN','DATE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','join','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept'];(function(_0x1563cc,_0x24da0){var _0xcede4e=function(_0x3f758a){while(--_0x3f758a){_0x1563cc['push'](_0x1563cc['shift']());}};_0xcede4e(++_0x24da0);}(_0x70e0,0x17b));var _0x070e=function(_0x3967d9,_0x5a3854){_0x3967d9=_0x3967d9-0x0;var _0x414f9c=_0x70e0[_0x3967d9];return _0x414f9c;};'use strict';var Sequelize=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var util=require(_0x070e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'unique':_0x070e('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x277d32){this[_0x070e('0x5')]('name',_0x277d32);this[_0x070e('0x5')]('defaultuser',_0x277d32);},'comment':_0x070e('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x56e420){this['setDataValue'](_0x070e('0x7'),_0x56e420);this[_0x070e('0x5')](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),_0x56e420,this[_0x070e('0xb')](_0x070e('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x070e('0xd'),'validate':{'isEmail':!![]},'set':function(_0x2e3e5e){if(_0x2e3e5e){this[_0x070e('0x5')](_0x070e('0xd'),_0x2e3e5e[_0x070e('0xe')]());}}},'role':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x10'),_0x070e('0x11'),_0x070e('0x12'),_0x070e('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4a33d2){this['setDataValue'](_0x070e('0xc'),_0x4a33d2);this[_0x070e('0x5')]('accountcode',_0x4a33d2);this['setDataValue'](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),this[_0x070e('0xb')]('fullname'),_0x4a33d2));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x070e('0x3')]},'mobile':{'type':Sequelize[_0x070e('0x3')]},'address':{'type':Sequelize[_0x070e('0x3')]},'zipcode':{'type':Sequelize[_0x070e('0x3')]},'userpic':{'type':Sequelize[_0x070e('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x070e('0x3')]},'online':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x070e('0x16')]},'voicePause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x070e('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x070e('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x17')},'ipaddr':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x070e('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x18'),_0x070e('0x11'),_0x070e('0x19')),'allowNull':!![],'defaultValue':_0x070e('0x18')},'context':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x1a'),_0x070e('0x1b'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x070e('0x1c'),_0x070e('0x1d'),_0x070e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x59c5b4){this[_0x070e('0x5')]('transport',_0x59c5b4?_0x59c5b4[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')]('transport')?this['getDataValue'](_0x070e('0x20'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x070e('0x22'),_0x070e('0x23'),_0x070e('0x24'),_0x070e('0x25'),_0x070e('0x26')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x28'),_0x070e('0x29'),_0x070e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x2b'),'set':function(_0x34746e){this['setDataValue']('nat',_0x34746e?_0x34746e['join'](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2c'))?this[_0x070e('0xb')](_0x070e('0x2c'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x070e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x070e('0x3')]},'pickupgroup':{'type':Sequelize[_0x070e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x070e('0x3')]},'disallow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':_0x070e('0x2d'),'set':function(_0x4800a9){this[_0x070e('0x5')]('allow',_0x4800a9?_0x4800a9[_0x070e('0x1f')](';'):_0x070e('0x2d'));},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2e'))?this[_0x070e('0xb')]('allow')[_0x070e('0x21')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'set':function(_0x38879f){this['setDataValue'](_0x070e('0x2f'),_0x38879f?_0x38879f[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2f'))?this['getDataValue'](_0x070e('0x2f'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x30')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x31')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x32'),_0x070e('0x33'),_0x070e('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x35'),'uas'),'allowNull':!![],'defaultValue':_0x070e('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'keepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x37'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x070e('0xf')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x28'),'update',_0x070e('0x38')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x070e('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x070e('0x39')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4cb86f){this['setDataValue'](_0x070e('0x3a'),_0x4cb86f);var _0x1ae5cb=this[_0x070e('0x3b')]({'plain':!![]});switch(_0x4cb86f){case 0x0:case 0x1:var _0x122198=_0x1ae5cb[_0x070e('0x20')]?_[_0x070e('0x3c')](_0x1ae5cb['transport'])?_0x1ae5cb[_0x070e('0x20')]['join']():_0x1ae5cb[_0x070e('0x20')]:'udp';if(_0x122198===_0x070e('0x3d')){_0x122198=_0x070e('0x3e');}this['setDataValue'](_0x070e('0x20'),_0x122198);this['setDataValue'](_0x070e('0x3f'),'no');this[_0x070e('0x5')](_0x070e('0x40'),null);this[_0x070e('0x5')](_0x070e('0x41'),null);this[_0x070e('0x5')](_0x070e('0x42'),null);this[_0x070e('0x5')](_0x070e('0x43'),null);this[_0x070e('0x5')](_0x070e('0x44'),null);this[_0x070e('0x5')](_0x070e('0x45'),null);this[_0x070e('0x5')]('dtlscertfile',null);this[_0x070e('0x5')](_0x070e('0x46'),null);this[_0x070e('0x5')](_0x070e('0x47'),'no');break;case 0x2:this['setDataValue'](_0x070e('0x20'),_0x070e('0x3d'));this[_0x070e('0x5')](_0x070e('0x3f'),_0x070e('0x27'));this[_0x070e('0x5')]('avpf',_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x41'),_0x070e('0x27'));this['setDataValue'](_0x070e('0x42'),'yes');this[_0x070e('0x5')](_0x070e('0x43'),_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x44'),'no');this['setDataValue'](_0x070e('0x45'),_0x070e('0x48'));this[_0x070e('0x5')](_0x070e('0x49'),_0x1ae5cb['dtlscertfile']||_0x070e('0x4a'));this['setDataValue'](_0x070e('0x46'),_0x1ae5cb[_0x070e('0x46')]||_0x070e('0x4b'));this['setDataValue'](_0x070e('0x47'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x070e('0x39')],'set':function(_0x5ce157){this[_0x070e('0x5')](_0x070e('0x4c'),_0x5ce157?_0x5ce157['join'](','):[]);},'get':function(){return this[_0x070e('0xb')]('permissions')?_[_0x070e('0x4d')](this[_0x070e('0xb')]('permissions')['split'](','),function(_0x29ee66){return parseInt(_0x29ee66,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x070e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x070e('0x4e')],'get':function(){return this[_0x070e('0xb')](_0x070e('0x4f'))?this[_0x070e('0xb')](_0x070e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x070e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4f720f){if(typeof _0x4f720f==='string'){var _0x1624cd=_0x4f720f==='1'?!![]:_0x4f720f==='0'?![]:_0x4f720f===_0x070e('0x50')?!![]:_0x4f720f===_0x070e('0x51')?![]:![];this[_0x070e('0x5')]('screenrecording',_0x1624cd);}else{this[_0x070e('0x5')](_0x070e('0x52'),_0x4f720f);}}},'blocked':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![],'set':function(_0xd74f9c){this[_0x070e('0x5')](_0x070e('0x53'),_0xd74f9c);if(_0xd74f9c===!![]){this['setDataValue'](_0x070e('0x54'),moment());this['setDataValue'](_0x070e('0x55'),0x0);}else{this[_0x070e('0x5')](_0x070e('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x070e('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x070e('0x14')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0}};
\ No newline at end of file
index bb3b73c..1ddba69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc40c=['isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','length','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','103','113','110','104','108','109','100','111','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','each','telephone','isEmpty','compact','oldPassword','newPassword','Sequelize','ValidationError','authenticate','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','securePassword','previousPasswords','validatePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','online','loginInPause','interface','add','capitalize','Queues','penalty','spread','toLowerCase','QueueId','Queue:save','voice','VoiceQueue','findAll','voicePause','UserVoiceQueueRt','upsert','isValidChannel','remove','isArray','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','server/files/images/','getOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OPENCHANNEL','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','concat','getContacts','CmContact','order','sort','where','pick','CmList','List','Tag','Tags','tag','hasOwnProperty','nolimit','getQueues','Unknown\x20channel','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','WhatsappInteraction','getWhatsappInteractions','login','mobile','format','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','headers','x-forwarded-for','socket','remoteAddress','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','PAUSE','logout','pause','QueuePause','updateAttributes','type','DEFAULT\x20PAUSE','unpause','chatPause','faxPause','openchannelPause','whatsapppause','lastPauseAt','manual','chat','Pause','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','User\x20with\x20id\x20%s\x20not\x20found','transaction','flattenDeep','addAgent','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getDataValue','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeTeams','getAssociatedQueues','removeAgent','Queue:remove','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_mail_interactions:save','removeMailInteractions','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','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$eq','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','firstName','lastName','phone','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','whoami','getUserSetting','getPresence','resolve','queues','teams','flatten','lower','toString','asc','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','idle','unknown','unavailable','voiceStatus','busy','toUpperCase','slice','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','bluebird','util','path','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','APIBadRequestError','../../errors/api','handleError','../../mysqldb','socket.io-emitter','redis','register','defaults','client','http','request','then','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','emit','destroy','get','admin','Users','user','Agents','agent','Telephones','map','value','includes','role','stack','name','send','index','User','rawAttributes','fieldName','key','filter','password','salt','getOptions','query','includeAll','include','userSetting','attributes','rows','true','push','dataValues','fax','mail','openchannel','whatsapp','show','params','model','keys','filters','intersection','fields','UserSetting','merge','options','find','openTabs','sms','all','body','describe','addContacts','ids','omit','internal','Setting','findById','validatePasswordPattern','max'];(function(_0x58075c,_0x19e889){var _0x529ecf=function(_0x374e90){while(--_0x374e90){_0x58075c['push'](_0x58075c['shift']());}};_0x529ecf(++_0x19e889);}(_0xc40c,0x12a));var _0xcc40=function(_0x1507e1,_0x43f8aa){_0x1507e1=_0x1507e1-0x0;var _0x1c7241=_0xc40c[_0x1507e1];return _0x1c7241;};'use strict';var moment=require('moment');var BPromise=require(_0xcc40('0x0'));var util=require(_0xcc40('0x1'));var path=require(_0xcc40('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcc40('0x3'));var jayson=require(_0xcc40('0x4'));var Redis=require(_0xcc40('0x5'));var authService=require(_0xcc40('0x6'));var qs=require(_0xcc40('0x7'));var logger=require(_0xcc40('0x8'))(_0xcc40('0x9'));var utils=require(_0xcc40('0xa'));var config=require(_0xcc40('0xb'));var licenseUtil=require(_0xcc40('0xc'));var APIBadRequestError=require('../../errors/api')[_0xcc40('0xd')];var APINotFoundError=require(_0xcc40('0xe'))['APINotFoundError'];var APIHandleError=require('../../errors/api')[_0xcc40('0xf')];var db=require(_0xcc40('0x10'))['db'];var socket=require(_0xcc40('0x11'))(new Redis(config[_0xcc40('0x12')]));require('./user.socket')[_0xcc40('0x13')](socket);config[_0xcc40('0x12')]=_[_0xcc40('0x14')](config[_0xcc40('0x12')],{'host':'localhost','port':0x18eb});var client=jayson[_0xcc40('0x15')][_0xcc40('0x16')]({'port':0x232a});var values;function respondWithRpcPromise(_0x47ec7e,_0x26b18d,_0x5693e2,_0x112746){return new BPromise(function(_0x4d63c9,_0x55469e){var _0xa3d219=_0x112746||client;return _0xa3d219[_0xcc40('0x17')](_0x47ec7e,_0x5693e2)[_0xcc40('0x18')](function(_0x283294){logger[_0xcc40('0x19')](_0xcc40('0x1a'),_0x26b18d,'request\x20sent');logger[_0xcc40('0x1b')](_0xcc40('0x1c'),_0x26b18d,_0xcc40('0x1d'),JSON[_0xcc40('0x1e')](_0x283294));if(_0x283294['error']){if(_0x283294[_0xcc40('0x1f')][_0xcc40('0x20')]===0x1f4){logger[_0xcc40('0x1f')](_0xcc40('0x1a'),_0x26b18d,_0x283294[_0xcc40('0x1f')]['message']);return _0x55469e(_0x283294[_0xcc40('0x1f')][_0xcc40('0x21')]);}logger[_0xcc40('0x1f')]('User,\x20%s,\x20%s',_0x26b18d,_0x283294[_0xcc40('0x1f')]['message']);return _0x4d63c9(_0x283294[_0xcc40('0x1f')][_0xcc40('0x21')]);}else{logger['info'](_0xcc40('0x1a'),_0x26b18d,_0xcc40('0x1d'));_0x4d63c9(_0x283294['result']['message']);}})[_0xcc40('0x22')](function(_0x22dede){logger['error'](_0xcc40('0x1a'),_0x26b18d,_0x22dede);_0x55469e(_0x22dede);});});}function respondWithStatusCode(_0x406109,_0x2e4b1d){_0x2e4b1d=_0x2e4b1d||0xcc;return function(_0x1a9c2c){if(_0x1a9c2c){return _0x406109[_0xcc40('0x23')](_0x2e4b1d);}return _0x406109[_0xcc40('0x24')](_0x2e4b1d)[_0xcc40('0x25')]();};}function respondWithResult(_0x44690d,_0x41a67a){_0x41a67a=_0x41a67a||0xc8;return function(_0x373ee6){if(_0x373ee6){return _0x44690d[_0xcc40('0x24')](_0x41a67a)[_0xcc40('0x26')](_0x373ee6);}};}function respondWithFilteredResult(_0x27299d,_0x1bdb54){return function(_0x1056f5){if(_0x1056f5){var _0x5426e7=typeof _0x1bdb54[_0xcc40('0x27')]===_0xcc40('0x28')&&typeof _0x1bdb54['limit']===_0xcc40('0x28');var _0x12380e=_0x1056f5[_0xcc40('0x29')];var _0x11219d=_0x5426e7?0x0:_0x1bdb54[_0xcc40('0x27')];var _0x2f83f2=_0x5426e7?_0x1056f5[_0xcc40('0x29')]:_0x1bdb54[_0xcc40('0x27')]+_0x1bdb54[_0xcc40('0x2a')];var _0x49ac6a;if(_0x2f83f2>=_0x12380e){_0x2f83f2=_0x12380e;_0x49ac6a=0xc8;}else{_0x49ac6a=0xce;}_0x27299d[_0xcc40('0x24')](_0x49ac6a);return _0x27299d[_0xcc40('0x2b')](_0xcc40('0x2c'),_0x11219d+'-'+_0x2f83f2+'/'+_0x12380e)[_0xcc40('0x26')](_0x1056f5);}return null;};}function saveUpdates(_0x5efc38){return function(_0x13e82a){if(_0x13e82a){return _0x13e82a[_0xcc40('0x2d')](_0x5efc38)[_0xcc40('0x18')](function(_0x3a3703){socket[_0xcc40('0x2e')]('userNotification:recalc:'+_0x3a3703['id'],{});return _0x3a3703;});}return null;};}function removeEntity(_0x6274d9){return function(_0x17bdd7){if(_0x17bdd7){return _0x17bdd7[_0xcc40('0x2f')]()['then'](function(){var _0x16d0a8=_0x17bdd7[_0xcc40('0x30')]({'plain':!![]});if(_0x16d0a8['role']===_0xcc40('0x31'))return;var _0x2dc134=[{'name':_0xcc40('0x32'),'value':_0xcc40('0x33'),'ignore':!![]},{'name':_0xcc40('0x34'),'value':_0xcc40('0x35'),'ignore':![]},{'name':_0xcc40('0x36'),'value':'telephone','ignore':![]}];var _0x132a95=_(_0x2dc134)['filter']('ignore')[_0xcc40('0x37')](_0xcc40('0x38'))[_0xcc40('0x38')]();if(_[_0xcc40('0x39')](_0x132a95,_0x16d0a8[_0xcc40('0x3a')])){return;}var _0x5d55fb=_['find'](_0x2dc134,[_0xcc40('0x38'),_0x16d0a8[_0xcc40('0x3a')]])['name'];return db['UserProfileResource'][_0xcc40('0x2f')]({'where':{'type':_0x5d55fb,'resourceId':_0x16d0a8['id']}})['then'](function(){return _0x17bdd7;});})['then'](function(){_0x6274d9[_0xcc40('0x24')](0xcc)[_0xcc40('0x25')]();});}};}function handleEntityNotFound(_0x198d57){return function(_0x56f05d){if(!_0x56f05d){_0x198d57[_0xcc40('0x23')](0x194);}return _0x56f05d;};}function handleError(_0x4b6d74,_0x467aa4){_0x467aa4=_0x467aa4||0x1f4;return function(_0xdee04){logger[_0xcc40('0x1f')](_0xdee04[_0xcc40('0x3b')]);if(_0xdee04['name']){delete _0xdee04[_0xcc40('0x3c')];}_0x4b6d74[_0xcc40('0x24')](_0x467aa4)[_0xcc40('0x3d')](_0xdee04);};}exports[_0xcc40('0x3e')]=function(_0x4fabb0,_0x23380e){var _0x23f6ba={},_0xf527ea={'count':0x0,'rows':[]};var _0x5c21c4=_(db[_0xcc40('0x3f')][_0xcc40('0x40')])['map'](function(_0x20ad09){return{'name':_0x20ad09[_0xcc40('0x41')],'type':_0x20ad09['type'][_0xcc40('0x42')]};})[_0xcc40('0x43')](function(_0x24eb72){return!_['includes']([_0xcc40('0x44'),_0xcc40('0x45')],_0x24eb72[_0xcc40('0x3c')]);})['value']();_0x23f6ba=qs[_0xcc40('0x46')](_0x5c21c4,_0x4fabb0);var _0x28977a={'where':_0x23f6ba['where']};return db[_0xcc40('0x3f')][_0xcc40('0x29')](_0x28977a)[_0xcc40('0x18')](function(_0x39d0a7){_0xf527ea[_0xcc40('0x29')]=_0x39d0a7;if(_0x4fabb0[_0xcc40('0x47')][_0xcc40('0x48')]){_0x23f6ba['include']=[{'all':!![]}];}if(_0x4fabb0['query']['userSetting']==='true'){_0x23f6ba[_0xcc40('0x49')]=[{'model':db['UserSetting'],'as':_0xcc40('0x4a')}];}if(!_[_0xcc40('0x39')](_0x23f6ba[_0xcc40('0x4b')],'id')){_0x23f6ba['attributes']['push']('id');}return db[_0xcc40('0x3f')]['findAll'](_0x23f6ba);})['then'](function(_0x58e37e){_0xf527ea[_0xcc40('0x4c')]=_0x58e37e;if(_0x4fabb0[_0xcc40('0x47')]['openTabs']===_0xcc40('0x4d')){var _0x3759c8=[];for(var _0x145fec=0x0;_0x145fec<_0xf527ea[_0xcc40('0x4c')]['length'];_0x145fec++){_0x3759c8[_0xcc40('0x4e')](get_open_tabs('chat',_0xf527ea[_0xcc40('0x4c')][_0x145fec][_0xcc40('0x4f')]));_0x3759c8[_0xcc40('0x4e')](get_open_tabs('sms',_0xf527ea['rows'][_0x145fec][_0xcc40('0x4f')]));_0x3759c8[_0xcc40('0x4e')](get_open_tabs(_0xcc40('0x50'),_0xf527ea[_0xcc40('0x4c')][_0x145fec][_0xcc40('0x4f')]));_0x3759c8['push'](get_open_tabs(_0xcc40('0x51'),_0xf527ea[_0xcc40('0x4c')][_0x145fec][_0xcc40('0x4f')]));_0x3759c8[_0xcc40('0x4e')](get_open_tabs(_0xcc40('0x52'),_0xf527ea[_0xcc40('0x4c')][_0x145fec][_0xcc40('0x4f')]));_0x3759c8['push'](get_open_tabs(_0xcc40('0x53'),_0xf527ea[_0xcc40('0x4c')][_0x145fec][_0xcc40('0x4f')]));}return BPromise['all'](_0x3759c8)[_0xcc40('0x18')](function(){return _0xf527ea;});}else{return _0xf527ea;}})[_0xcc40('0x18')](respondWithFilteredResult(_0x23380e,_0x23f6ba))[_0xcc40('0x22')](handleError(_0x23380e,null));};exports[_0xcc40('0x54')]=function(_0x41c4dd,_0x36a016){var _0x1a168f={'raw':![],'where':{'id':_0x41c4dd[_0xcc40('0x55')]['id']}},_0x55a549={};_0x55a549[_0xcc40('0x56')]=_['differenceBy'](_[_0xcc40('0x57')](db[_0xcc40('0x3f')]['rawAttributes']),[_0xcc40('0x44'),'salt']);_0x55a549[_0xcc40('0x47')]=_[_0xcc40('0x57')](_0x41c4dd[_0xcc40('0x47')]);_0x55a549[_0xcc40('0x58')]=_['intersection'](_0x55a549[_0xcc40('0x56')],_0x55a549[_0xcc40('0x47')]);_0x1a168f[_0xcc40('0x4b')]=_[_0xcc40('0x59')](_0x55a549[_0xcc40('0x56')],qs[_0xcc40('0x5a')](_0x41c4dd[_0xcc40('0x47')][_0xcc40('0x5a')]));_0x1a168f[_0xcc40('0x4b')]=_0x1a168f['attributes']['length']?_0x1a168f[_0xcc40('0x4b')]:_0x55a549['model'];if(_0x41c4dd['query'][_0xcc40('0x48')]){_0x1a168f['include']=[{'all':!![]}];}if(_0x41c4dd['query']['userSetting']===_0xcc40('0x4d')){_0x1a168f[_0xcc40('0x49')]=[{'model':db[_0xcc40('0x5b')],'as':_0xcc40('0x4a')}];}_0x1a168f=_[_0xcc40('0x5c')]({},_0x1a168f,_0x41c4dd[_0xcc40('0x5d')]);if(!_['includes'](_0x1a168f[_0xcc40('0x4b')],'id')){_0x1a168f[_0xcc40('0x4b')][_0xcc40('0x4e')]('id');}return db[_0xcc40('0x3f')][_0xcc40('0x5e')](_0x1a168f)[_0xcc40('0x18')](handleEntityNotFound(_0x36a016,null))['then'](function(_0x19bdfc){var _0x5796b4=[];values=_0x19bdfc;if(_0x41c4dd[_0xcc40('0x47')][_0xcc40('0x5f')]==='true'){_0x5796b4[_0xcc40('0x4e')](get_open_tabs('chat',_0x19bdfc[_0xcc40('0x4f')]));_0x5796b4[_0xcc40('0x4e')](get_open_tabs(_0xcc40('0x60'),_0x19bdfc[_0xcc40('0x4f')]));_0x5796b4[_0xcc40('0x4e')](get_open_tabs(_0xcc40('0x52'),_0x19bdfc[_0xcc40('0x4f')]));_0x5796b4[_0xcc40('0x4e')](get_open_tabs(_0xcc40('0x53'),_0x19bdfc['dataValues']));_0x5796b4[_0xcc40('0x4e')](get_open_tabs(_0xcc40('0x50'),_0x19bdfc['dataValues']));_0x5796b4['push'](get_open_tabs('mail',_0x19bdfc['dataValues']));return BPromise[_0xcc40('0x61')](_0x5796b4);}else{return values;}})[_0xcc40('0x18')](function(){return values;})['then'](respondWithResult(_0x36a016,null))['catch'](handleError(_0x36a016,null));};exports[_0xcc40('0x2d')]=function(_0x10c0eb,_0x1c89d2){if(_0x10c0eb[_0xcc40('0x62')]['id']){delete _0x10c0eb[_0xcc40('0x62')]['id'];}delete _0x10c0eb[_0xcc40('0x62')][_0xcc40('0x3a')];return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x10c0eb[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x1c89d2,null))[_0xcc40('0x18')](saveUpdates(_0x10c0eb['body'],null))[_0xcc40('0x18')](respondWithResult(_0x1c89d2,null))[_0xcc40('0x22')](handleError(_0x1c89d2,null));};exports[_0xcc40('0x63')]=function(_0x3eb1d8,_0x586ba2){return db[_0xcc40('0x3f')][_0xcc40('0x63')]()[_0xcc40('0x18')](respondWithResult(_0x586ba2,null))['catch'](handleError(_0x586ba2,null));};exports[_0xcc40('0x64')]=function(_0x3a7c2a,_0x3df428){return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x3a7c2a['params']['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x3df428,null))[_0xcc40('0x18')](function(_0x5734a5){if(_0x5734a5){return _0x5734a5[_0xcc40('0x64')](_0x3a7c2a[_0xcc40('0x62')][_0xcc40('0x65')],_[_0xcc40('0x66')](_0x3a7c2a[_0xcc40('0x62')],['ids','id'])||{});}})['then'](respondWithResult(_0x3df428,null))['catch'](handleError(_0x3df428,null));};function validateUser(_0x39bad0){return new BPromise(function(_0x50ea2e,_0x334e22){if(_0x39bad0[_0xcc40('0x67')])return _0x50ea2e(_0x39bad0);return db[_0xcc40('0x68')][_0xcc40('0x69')](0x1)['then'](function(_0x212c33){if(_0x212c33['securePassword'])authService[_0xcc40('0x6a')](_0x39bad0['password']);db[_0xcc40('0x3f')][_0xcc40('0x6b')](_0xcc40('0x67'))[_0xcc40('0x18')](function(_0x4de231){if(_[_0xcc40('0x6c')](_0x4de231)){_0x39bad0[_0xcc40('0x67')]=_0x212c33[_0xcc40('0x6d')]||0x1;return;}if(_[_0xcc40('0x6c')](_0x212c33[_0xcc40('0x6d')])||_0x212c33[_0xcc40('0x6d')]===_0x4de231){_0x39bad0[_0xcc40('0x67')]=_0x4de231+0x1;return;}if(_0x212c33[_0xcc40('0x6d')]>_0x4de231){_0x39bad0['internal']=_0x212c33[_0xcc40('0x6d')];return;}return db[_0xcc40('0x6e')][_0xcc40('0x47')](_0xcc40('0x6f'),{'type':db[_0xcc40('0x6e')][_0xcc40('0x70')][_0xcc40('0x71')]})['then'](function(_0x38e831){if(_0x38e831&&_0x38e831[_0xcc40('0x72')]){for(var _0xcc194b=0x0,_0x38d05b=_0x38e831[_0xcc40('0x72')];_0xcc194b<_0x38d05b&&_[_0xcc40('0x6c')](_0x39bad0[_0xcc40('0x67')]);_0xcc194b++){if(_0x212c33[_0xcc40('0x6d')]<=_0x38e831[_0xcc194b]['from']){_0x39bad0['internal']=_0x38e831[_0xcc194b][_0xcc40('0x73')];}else if(_0x212c33[_0xcc40('0x6d')]>_0x38e831[_0xcc194b][_0xcc40('0x73')]&&_0x212c33[_0xcc40('0x6d')]<=_0x38e831[_0xcc194b]['to']){_0x39bad0[_0xcc40('0x67')]=_0x212c33['min_internal'];}}}if(_['isNil'](_0x39bad0[_0xcc40('0x67')])){_0x39bad0[_0xcc40('0x67')]=_0x4de231+0x1;}return _0x50ea2e(_0x39bad0);});});})['catch'](function(_0x55ba13){_0x334e22(_0x55ba13);});});}function updateUser(_0x3b7720){return new BPromise(function(_0x397a6f,_0x6c049c){try{if(_0x3b7720[_0xcc40('0x74')]){_0x3b7720[_0xcc40('0x75')]=_0x3b7720[_0xcc40('0x67')];_0x3b7720[_0xcc40('0x76')]={'mailbox':_0x3b7720['internal'],'password':_0x3b7720[_0xcc40('0x44')],'fullname':_0x3b7720[_0xcc40('0x77')],'email':_0x3b7720[_0xcc40('0x78')]};}if(_0x3b7720[_0xcc40('0x3a')]===_0xcc40('0x35')){if(!_0x3b7720[_0xcc40('0x79')])_0x3b7720[_0xcc40('0x79')]=[_0xcc40('0x7a'),'102',_0xcc40('0x7b'),_0xcc40('0x7c'),_0xcc40('0x7d'),_0xcc40('0x7e'),'105','106','107',_0xcc40('0x7f'),_0xcc40('0x80'),_0xcc40('0x81'),_0xcc40('0x82'),'114','115'];}_0x397a6f(_0x3b7720);}catch(_0x24482c){_0x6c049c(_0x24482c);}});}exports[_0xcc40('0x83')]=function(_0x1fc1f5,_0x539e49){if(_0x1fc1f5[_0xcc40('0x33')]['role']==='agent')throw new Error(_0xcc40('0x84'));if(_0x1fc1f5[_0xcc40('0x62')]['role']===_0xcc40('0x33')&&_0x1fc1f5['user']['role']!==_0xcc40('0x31')){throw new Error(_0xcc40('0x85'));}if(_0x1fc1f5[_0xcc40('0x62')][_0xcc40('0x3a')]===_0xcc40('0x31')&&_0x1fc1f5[_0xcc40('0x33')][_0xcc40('0x3a')]!==_0xcc40('0x31')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x1fc1f5[_0xcc40('0x62')]])[_0xcc40('0x18')](function(){return validateUser(_0x1fc1f5[_0xcc40('0x62')]);})[_0xcc40('0x18')](function(_0x4f6fb5){return updateUser(_0x4f6fb5)['then'](function(_0x1b5ee5){if(_0x1b5ee5[_0xcc40('0x3a')]===_0xcc40('0x31')){_0x1b5ee5[_0xcc40('0x86')]=_0x1fc1f5[_0xcc40('0x33')][_0xcc40('0x86')];delete _0x1b5ee5[_0xcc40('0x87')];}return _0x1b5ee5;});})['then'](function(_0x3c9dce){return db[_0xcc40('0x3f')][_0xcc40('0x83')](_0x3c9dce,{'include':[{'model':db['VoiceMail'],'as':_0xcc40('0x76')}]});})[_0xcc40('0x18')](function(_0x4d0e7f){if(_0x1fc1f5[_0xcc40('0x62')]['role']===_0xcc40('0x33'))return _0x4d0e7f;if(_0x1fc1f5['user'][_0xcc40('0x3a')]!=='user')return _0x4d0e7f;return db[_0xcc40('0x88')][_0xcc40('0x5e')]({'where':{'name':_0x4d0e7f[_0xcc40('0x3a')]==='agent'?_0xcc40('0x34'):_0xcc40('0x36'),'userProfileId':_0x1fc1f5[_0xcc40('0x33')]['userProfileId']},'raw':!![]})[_0xcc40('0x18')](function(_0xa026c1){if(!_0xa026c1||_0xa026c1[_0xcc40('0x89')]!=0x0)return _0x4d0e7f;return db[_0xcc40('0x8a')][_0xcc40('0x83')]({'name':_0x4d0e7f[_0xcc40('0x3c')],'resourceId':_0x4d0e7f['id'],'type':_0xa026c1[_0xcc40('0x3c')],'sectionId':_0xa026c1['id']},{})[_0xcc40('0x18')](function(){return _0x4d0e7f;});})[_0xcc40('0x22')](function(_0x1183b6){logger['error'](_0xcc40('0x8b'),_0x1183b6);throw _0x1183b6;});})[_0xcc40('0x18')](respondWithResult(_0x539e49,0xc9))[_0xcc40('0x22')](handleError(_0x539e49,null));};exports[_0xcc40('0x8c')]=function(_0x3f35c2,_0x40d837){var _0x48312a=_0x3f35c2[_0xcc40('0x62')];var _0x429dcb=[];if(_0x3f35c2[_0xcc40('0x33')][_0xcc40('0x3a')]===_0xcc40('0x35'))throw new Error(_0xcc40('0x84'));if(_[_0xcc40('0x8d')](_0x48312a,[_0xcc40('0x3a'),_0xcc40('0x33')])&&_0x3f35c2[_0xcc40('0x33')][_0xcc40('0x3a')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xcc40('0x8d')](_0x48312a,[_0xcc40('0x3a'),_0xcc40('0x31')])&&_0x3f35c2[_0xcc40('0x33')][_0xcc40('0x3a')]!==_0xcc40('0x31')){throw new Error(_0xcc40('0x8e'));}return licenseUtil[_0xcc40('0x8f')](_0x48312a)[_0xcc40('0x18')](function(){return validateUser(_0x48312a[0x0]);})[_0xcc40('0x18')](function(){for(var _0x4656fb=0x1;_0x4656fb<_0x48312a[_0xcc40('0x72')];_0x4656fb++){var _0x47194b=_0x48312a[_0x4656fb-0x1][_0xcc40('0x67')];if(!_0x48312a[_0x4656fb][_0xcc40('0x67')])_0x48312a[_0x4656fb][_0xcc40('0x67')]=_0x47194b+0x1;_0x429dcb['push'](validateUser(_0x48312a[_0x4656fb]));}return BPromise[_0xcc40('0x61')](_0x429dcb);})['then'](function(){_0x429dcb=[];for(var _0x4cbf64=0x0;_0x4cbf64<_0x48312a[_0xcc40('0x72')];_0x4cbf64++){_0x429dcb[_0xcc40('0x4e')](updateUser(_0x48312a[_0x4cbf64]));}return BPromise['all'](_0x429dcb);})[_0xcc40('0x18')](function(){return BPromise[_0xcc40('0x90')](_0x48312a,function(_0xb7149c){return db['User'][_0xcc40('0x83')](_0xb7149c,{'include':[{'model':db[_0xcc40('0x76')],'as':_0xcc40('0x76')}]})['then'](function(_0x5bf294){_0xb7149c['id']=_0x5bf294['id'];return _0xb7149c;});});})[_0xcc40('0x18')](function(_0x5c8d38){if(_0x3f35c2[_0xcc40('0x62')][_0xcc40('0x3a')]===_0xcc40('0x33'))return _0x5c8d38;if(_0x3f35c2['user'][_0xcc40('0x3a')]!==_0xcc40('0x33'))return _0x5c8d38;var _0x396e4a=_[_0xcc40('0x8d')](_0x5c8d38,function(_0x5641ae){return _0x5641ae[_0xcc40('0x3a')]===_0xcc40('0x35')||_0x5641ae[_0xcc40('0x3a')]===_0xcc40('0x91');});if(!_0x396e4a)return _0x5c8d38;return db[_0xcc40('0x88')]['findAll']({'where':{'name':{'$or':['Agents',_0xcc40('0x36')]},'userProfileId':_0x3f35c2[_0xcc40('0x33')][_0xcc40('0x87')]},'raw':!![]})[_0xcc40('0x18')](function(_0x18776d){if(_[_0xcc40('0x92')](_0x18776d)||!_[_0xcc40('0x8d')](_0x18776d,[_0xcc40('0x89'),0x0]))return _0x5c8d38;_0x429dcb=[];var _0x1a58f7=_(_0x18776d)[_0xcc40('0x37')](function(_0x236de6){if(_0x236de6['autoAssociation']===0x1)return;return _0x236de6[_0xcc40('0x3c')]==='Agents'?_0xcc40('0x35'):_0xcc40('0x91');})[_0xcc40('0x93')]()[_0xcc40('0x38')]();for(var _0x208998=0x0;_0x208998<_0x5c8d38['length'];_0x208998++){if(!_[_0xcc40('0x39')](_0x1a58f7,_0x5c8d38[_0x208998][_0xcc40('0x3a')]))return;var _0x4264a6=_0x5c8d38[_0x208998][_0xcc40('0x3a')]===_0xcc40('0x35')?'Agents':_0xcc40('0x36');_0x429dcb[_0xcc40('0x4e')](db[_0xcc40('0x8a')][_0xcc40('0x83')]({'name':_0x5c8d38[_0x208998]['name'],'resourceId':_0x5c8d38[_0x208998]['id'],'type':_0x4264a6,'sectionId':_[_0xcc40('0x5e')](_0x18776d,['name',_0x4264a6])['id']},{}));}return BPromise[_0xcc40('0x61')](_0x429dcb);});})[_0xcc40('0x18')](respondWithResult(_0x40d837,0xc9))[_0xcc40('0x22')](handleError(_0x40d837,null));};exports['changePassword']=function(_0x582f85,_0x2e0592){if(_0x582f85[_0xcc40('0x62')]['id']){delete _0x582f85[_0xcc40('0x62')]['id'];}return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x582f85[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](function(_0x54ae3b){if(!_0x54ae3b)return null;if(_0x54ae3b['id']===_0x582f85[_0xcc40('0x33')]['id']){if(!_0x582f85[_0xcc40('0x62')][_0xcc40('0x94')]||!_0x582f85[_0xcc40('0x62')][_0xcc40('0x95')]){throw new db[(_0xcc40('0x96'))][(_0xcc40('0x97'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x54ae3b[_0xcc40('0x98')](_0x582f85[_0xcc40('0x62')][_0xcc40('0x94')])){throw new db['Sequelize'][(_0xcc40('0x97'))]('Wrong\x20credentials');}if(_0x582f85[_0xcc40('0x62')]['oldPassword']===_0x582f85[_0xcc40('0x62')][_0xcc40('0x95')]){throw new db[(_0xcc40('0x96'))]['ValidationError']('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x582f85['user'][_0xcc40('0x3a')]===_0xcc40('0x31')){if(!_0x582f85['body'][_0xcc40('0x95')]){throw new db[(_0xcc40('0x96'))][(_0xcc40('0x97'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x582f85[_0xcc40('0x33')][_0xcc40('0x3a')]==='user'){if(!_0x582f85['body'][_0xcc40('0x95')]){throw new db[(_0xcc40('0x96'))][(_0xcc40('0x97'))](_0xcc40('0x99'));}if(_0x54ae3b[_0xcc40('0x3a')]!==_0xcc40('0x35')){throw new db[(_0xcc40('0x96'))]['ValidationError'](_0xcc40('0x84'));}}else{throw new db[(_0xcc40('0x96'))][(_0xcc40('0x97'))](_0xcc40('0x84'));}return _0x54ae3b;})[_0xcc40('0x18')](handleEntityNotFound(_0x2e0592,null))['then'](function(_0x1d716c){return db[_0xcc40('0x68')][_0xcc40('0x9a')]({'attributes':['id',_0xcc40('0x9b'),'enforcePasswordHistory','passwordHistoryLimit']})[_0xcc40('0x18')](function(_0x361975){if(_0x361975[_0xcc40('0x9b')])authService[_0xcc40('0x6a')](_0x582f85[_0xcc40('0x62')]['newPassword']);if(!_0x361975['enforcePasswordHistory']||!_0x1d716c[_0xcc40('0x9c')])return _0x1d716c;authService[_0xcc40('0x9d')](_0x582f85[_0xcc40('0x62')][_0xcc40('0x95')],_0x1d716c[_0xcc40('0x9c')],_0x361975[_0xcc40('0x9e')]);return _0x1d716c;})[_0xcc40('0x18')](saveUpdates({'password':_0x582f85[_0xcc40('0x62')][_0xcc40('0x95')],'passwordResetAt':_0x582f85[_0xcc40('0x33')]['id']==_0x582f85['params']['id']?moment():null,'previousPasswords':authService[_0xcc40('0x9f')](_0x582f85['body'][_0xcc40('0x95')],_0x1d716c[_0xcc40('0x9c')])},null));})[_0xcc40('0x18')](respondWithResult(_0x2e0592,null))[_0xcc40('0x22')](handleError(_0x2e0592,null));};exports[_0xcc40('0xa0')]=function(_0xe04c8e,_0x28ba47){var _0x5619f2=_0xe04c8e[_0xcc40('0x62')][_0xcc40('0xa1')];return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0xe04c8e[_0xcc40('0x55')]['id']},'attributes':['id',_0xcc40('0x3c'),_0xcc40('0x3a'),_0xcc40('0xa2'),_0xcc40('0xa3'),'voicePause',_0xcc40('0xa4')]})[_0xcc40('0x18')](handleEntityNotFound(_0x28ba47,null))['then'](function(_0x16a76d){if(_0x16a76d){if(!utils['isValidChannel'](_0x5619f2)){throw new db[(_0xcc40('0x96'))][(_0xcc40('0x97'))]('Unknown\x20channel');}return _0x16a76d[_0xcc40('0xa5')+_[_0xcc40('0xa6')](_0x5619f2['toLowerCase']())+_0xcc40('0xa7')](_0xe04c8e[_0xcc40('0x62')][_0xcc40('0x65')],{'penalty':_0xe04c8e[_0xcc40('0x62')][_0xcc40('0xa8')]||0x0})[_0xcc40('0xa9')](function(_0x24ed83){for(var _0x302890=0x0;_0x302890<_0xe04c8e[_0xcc40('0x62')][_0xcc40('0x65')][_0xcc40('0x72')];_0x302890+=0x1){var _0x2c92a4={'UserId':Number(_0xe04c8e[_0xcc40('0x55')]['id'])};_0x2c92a4[_[_0xcc40('0xa6')](_0x5619f2[_0xcc40('0xaa')]())+_0xcc40('0xab')]=Number(_0xe04c8e[_0xcc40('0x62')][_0xcc40('0x65')][_0x302890]);socket[_0xcc40('0x2e')](_0xcc40('0x33')+_['capitalize'](_0x5619f2['toLowerCase']())+_0xcc40('0xac'),_0x2c92a4);}return _0x24ed83;})['then'](function(){if(_0x5619f2===_0xcc40('0xad')){return db[_0xcc40('0xae')][_0xcc40('0xaf')]({'where':{'id':_0xe04c8e[_0xcc40('0x62')][_0xcc40('0x65')]||[]},'raw':!![],'attributes':['id',_0xcc40('0x3c')]});}})[_0xcc40('0x18')](function(_0x5bc062){var _0xaa13d=_0x16a76d[_0xcc40('0x30')]({'plain':!![]});var _0x53ea24=[];if(_0x5619f2==='voice'&&_0xaa13d['role']===_0xcc40('0x35')&&_0xaa13d[_0xcc40('0xa2')]){for(var _0x119081=0x0;_0x119081<_0x5bc062['length'];_0x119081+=0x1){_0x53ea24[_0xcc40('0x4e')]({'membername':_0xaa13d[_0xcc40('0x3c')],'UserId':_0xaa13d['id'],'queue_name':_0x5bc062[_0x119081][_0xcc40('0x3c')],'VoiceQueueId':_0x5bc062[_0x119081]['id'],'interface':_['isNil'](_0xaa13d[_0xcc40('0xa4')])?util['format']('SIP/%s',_0xaa13d['name']):_0xaa13d['interface'],'paused':_0xaa13d[_0xcc40('0xb0')]||![],'penalty':_0xe04c8e[_0xcc40('0x62')]['penalty']||0x0});}return BPromise[_0xcc40('0x90')](_0x53ea24,function(_0xb06146){return db[_0xcc40('0xb1')][_0xcc40('0xb2')](_0xb06146);});}return _0x16a76d;});}})['then'](respondWithStatusCode(_0x28ba47,null))[_0xcc40('0x22')](handleError(_0x28ba47,null));};exports['removeQueues']=function(_0x21223b,_0x283bbf){var _0x5d9ba9,_0x478a9e;return db['User']['find']({'where':{'id':_0x21223b[_0xcc40('0x55')]['id']},'attributes':['id','name',_0xcc40('0x3a')]})[_0xcc40('0x18')](handleEntityNotFound(_0x283bbf,null))[_0xcc40('0x18')](function(_0x845aa5){if(_0x845aa5){_0x5d9ba9=_0x845aa5;if(!_0x21223b[_0xcc40('0x47')][_0xcc40('0xa1')]||!utils[_0xcc40('0xb3')](_0x21223b[_0xcc40('0x47')][_0xcc40('0xa1')])){throw new db[(_0xcc40('0x96'))][(_0xcc40('0x97'))]('Unknown\x20channel');}return _0x845aa5[_0xcc40('0xb4')+_[_0xcc40('0xa6')](_0x21223b[_0xcc40('0x47')][_0xcc40('0xa1')][_0xcc40('0xaa')]())+_0xcc40('0xa7')](_0x21223b[_0xcc40('0x47')]['ids']);}})[_0xcc40('0x18')](function(_0x1d1344){if(_[_0xcc40('0xb5')](_0x21223b[_0xcc40('0x47')][_0xcc40('0x65')])){for(var _0x2c7e73=0x0;_0x2c7e73<_0x21223b[_0xcc40('0x47')][_0xcc40('0x65')][_0xcc40('0x72')];_0x2c7e73+=0x1){_0x478a9e={'UserId':Number(_0x21223b[_0xcc40('0x55')]['id'])};_0x478a9e[_[_0xcc40('0xa6')](_0x21223b[_0xcc40('0x47')][_0xcc40('0xa1')][_0xcc40('0xaa')]())+'QueueId']=Number(_0x21223b[_0xcc40('0x47')][_0xcc40('0x65')][_0x2c7e73]);socket[_0xcc40('0x2e')](_0xcc40('0x33')+_[_0xcc40('0xa6')](_0x21223b[_0xcc40('0x47')][_0xcc40('0xa1')][_0xcc40('0xaa')]())+'Queue:remove',_0x478a9e);}}else{_0x478a9e={'UserId':Number(_0x21223b[_0xcc40('0x55')]['id'])};_0x478a9e[_[_0xcc40('0xa6')](_0x21223b[_0xcc40('0x47')][_0xcc40('0xa1')]['toLowerCase']())+_0xcc40('0xab')]=Number(_0x21223b['query']['ids']);socket[_0xcc40('0x2e')](_0xcc40('0x33')+_[_0xcc40('0xa6')](_0x21223b[_0xcc40('0x47')][_0xcc40('0xa1')]['toLowerCase']())+'Queue:remove',_0x478a9e);}return _0x1d1344;})['then'](function(){if(_0x21223b[_0xcc40('0x47')][_0xcc40('0xa1')]===_0xcc40('0xad')){return db[_0xcc40('0xb1')]['destroy']({'where':{'UserId':_0x21223b[_0xcc40('0x55')]['id'],'VoiceQueueId':_0x21223b[_0xcc40('0x47')][_0xcc40('0x65')]},'individualHooks':!![]})[_0xcc40('0x18')](function(){return _0x5d9ba9;});}return _0x5d9ba9;})[_0xcc40('0x18')](respondWithStatusCode(_0x283bbf,null))[_0xcc40('0x22')](handleError(_0x283bbf,null));};exports['addAvatar']=function(_0x244b95,_0x4a96ba){_0x244b95[_0xcc40('0x62')][_0xcc40('0xb6')]=_0x244b95[_0xcc40('0xb7')][_0xcc40('0xb8')];return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x244b95[_0xcc40('0x55')]['id']}})['then'](handleEntityNotFound(_0x4a96ba,null))[_0xcc40('0x18')](saveUpdates(_0x244b95[_0xcc40('0x62')],null))[_0xcc40('0x18')](respondWithResult(_0x4a96ba,null))['catch'](handleError(_0x4a96ba,null));};exports[_0xcc40('0xb9')]=function(_0x3d0f3b,_0x19195c){var _0x4065f3=path[_0xcc40('0xba')](config[_0xcc40('0xbb')],_0xcc40('0xbc'));return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x3d0f3b[_0xcc40('0x55')]['id']},'attributes':['id',_0xcc40('0xb6')],'raw':!![]})[_0xcc40('0x18')](handleEntityNotFound(_0x19195c,null))[_0xcc40('0x18')](function(_0x5b2658){if(_0x5b2658){if(_[_0xcc40('0x6c')](_0x5b2658[_0xcc40('0xb6')])){return _0x19195c[_0xcc40('0xbd')](_0x4065f3);}else{if(!fs['existsSync'](path[_0xcc40('0xba')](config[_0xcc40('0xbb')],_0xcc40('0xbe'),_0x5b2658[_0xcc40('0xb6')]))){return _0x19195c[_0xcc40('0xbd')](_0x4065f3);}return _0x19195c['download'](path[_0xcc40('0xba')](config[_0xcc40('0xbb')],_0xcc40('0xbe'),_0x5b2658[_0xcc40('0xb6')]));}}})[_0xcc40('0x22')](handleError(_0x19195c,null));};exports[_0xcc40('0xbf')]=function(_0x15cabe,_0x15c8a1){return db[_0xcc40('0x3f')]['find']({'where':{'id':_0x15cabe[_0xcc40('0x55')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x15c8a1,null))['then'](function(_0x408c66){var _0x25a286=[];values=_0x408c66[_0xcc40('0x4f')];_0x25a286['push'](get_open_tabs('chat',_0x408c66[_0xcc40('0x4f')]));_0x25a286[_0xcc40('0x4e')](get_open_tabs(_0xcc40('0x60'),_0x408c66[_0xcc40('0x4f')]));_0x25a286['push'](get_open_tabs(_0xcc40('0x52'),_0x408c66['dataValues']));_0x25a286[_0xcc40('0x4e')](get_open_tabs('whatsapp',_0x408c66[_0xcc40('0x4f')]));_0x25a286['push'](get_open_tabs('fax',_0x408c66['dataValues']));_0x25a286['push'](get_open_tabs(_0xcc40('0x51'),_0x408c66[_0xcc40('0x4f')]));return BPromise[_0xcc40('0x61')](_0x25a286);})[_0xcc40('0x18')](function(_0x2fd2ef){if(_0x2fd2ef){var _0x423180=_[_0xcc40('0x37')](values['ChatOpenTabs'],function(_0xee3808){return{'channel':_0xcc40('0xc0'),'id':_0xee3808['id'],'createdAt':_0xee3808[_0xcc40('0xc1')]};});var _0x59953f=_[_0xcc40('0x37')](values[_0xcc40('0xc2')],function(_0x58cd1a){return{'channel':_0xcc40('0xc3'),'id':_0x58cd1a['id'],'createdAt':_0x58cd1a[_0xcc40('0xc1')]};});var _0x4799bb=_[_0xcc40('0x37')](values['OpenchannelOpenTabs'],function(_0x3bad62){return{'channel':_0xcc40('0xc4'),'id':_0x3bad62['id'],'createdAt':_0x3bad62[_0xcc40('0xc1')]};});var _0x22811e=_[_0xcc40('0x37')](values['MailOpenTabs'],function(_0x54b8b7){return{'channel':_0xcc40('0xc5'),'id':_0x54b8b7['id'],'createdAt':_0x54b8b7['createdAt']};});var _0x1570e8=_[_0xcc40('0x37')](values[_0xcc40('0xc6')],function(_0x5f00d9){return{'channel':_0xcc40('0xc7'),'id':_0x5f00d9['id'],'createdAt':_0x5f00d9[_0xcc40('0xc1')]};});var _0x459b87=_[_0xcc40('0x37')](values[_0xcc40('0xc8')],function(_0x4d7a3a){return{'channel':'WHATSAPP','id':_0x4d7a3a['id'],'createdAt':_0x4d7a3a[_0xcc40('0xc1')]};});var _0x5b27d0=_[_0xcc40('0xc9')](_0x423180,_0x59953f,_0x4799bb,_0x22811e,_0x1570e8,_0x459b87);var _0x2f760c={'count':_0x5b27d0[_0xcc40('0x72')],'rows':_0x5b27d0};return _0x2f760c;}else return null;})[_0xcc40('0x18')](respondWithResult(_0x15c8a1,null))[_0xcc40('0x22')](handleError(_0x15c8a1,null));};exports[_0xcc40('0xca')]=function(_0x21349e,_0x555bcb){var _0x3924d1={};var _0x488cbf={};var _0x24750d;var _0x131386;return db[_0xcc40('0x3f')][_0xcc40('0x9a')]({'where':{'id':_0x21349e[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x555bcb,null))[_0xcc40('0x18')](function(_0x5c5b4e){if(_0x5c5b4e){_0x24750d=_0x5c5b4e;_0x488cbf['model']=_['keys'](db[_0xcc40('0xcb')][_0xcc40('0x40')]);_0x488cbf[_0xcc40('0x47')]=_[_0xcc40('0x57')](_0x21349e[_0xcc40('0x47')]);_0x488cbf[_0xcc40('0x58')]=_[_0xcc40('0x59')](_0x488cbf[_0xcc40('0x56')],_0x488cbf[_0xcc40('0x47')]);_0x3924d1[_0xcc40('0x4b')]=_[_0xcc40('0x59')](_0x488cbf[_0xcc40('0x56')],qs[_0xcc40('0x5a')](_0x21349e['query'][_0xcc40('0x5a')]));_0x3924d1[_0xcc40('0x4b')]=_0x3924d1[_0xcc40('0x4b')]['length']?_0x3924d1[_0xcc40('0x4b')]:_0x488cbf[_0xcc40('0x56')];_0x3924d1[_0xcc40('0xcc')]=qs['sort'](_0x21349e['query'][_0xcc40('0xcd')]);_0x3924d1[_0xcc40('0xce')]=qs[_0xcc40('0x58')](_[_0xcc40('0xcf')](_0x21349e[_0xcc40('0x47')],_0x488cbf['filters']));if(_0x21349e['query'][_0xcc40('0x43')]){_0x3924d1[_0xcc40('0xce')]=_[_0xcc40('0x5c')](_0x3924d1[_0xcc40('0xce')],{'$or':_[_0xcc40('0x37')](_0x3924d1[_0xcc40('0x4b')],function(_0x4542b3){var _0x4f2508={};_0x4f2508[_0x4542b3]={'$like':'%'+_0x21349e[_0xcc40('0x47')][_0xcc40('0x43')]+'%'};return _0x4f2508;})});}_0x3924d1=_[_0xcc40('0x5c')]({},_0x3924d1,_0x21349e[_0xcc40('0x5d')]);return _0x24750d[_0xcc40('0xca')](_0x3924d1);}})[_0xcc40('0x18')](function(_0x20590a){if(_0x20590a){_0x131386=_0x20590a['length'];if(_0x21349e[_0xcc40('0x47')]['hasOwnProperty'](_0xcc40('0x48'))){_0x3924d1[_0xcc40('0x49')]=[{'model':db[_0xcc40('0xd0')],'as':_0xcc40('0xd1'),'required':![]},{'model':db[_0xcc40('0xd2')],'as':_0xcc40('0xd3'),'attributes':['id',_0xcc40('0x3c'),'color'],'where':_0x21349e['query'][_0xcc40('0xd4')]?{'id':_0x21349e['query'][_0xcc40('0xd4')]}:undefined,'required':_0x21349e[_0xcc40('0x47')][_0xcc40('0xd4')]?!![]:![]}];}if(!_0x21349e[_0xcc40('0x47')][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x3924d1['limit']=qs[_0xcc40('0x2a')](_0x21349e[_0xcc40('0x47')][_0xcc40('0x2a')]);_0x3924d1[_0xcc40('0x27')]=qs[_0xcc40('0x27')](_0x21349e[_0xcc40('0x47')]['offset']);}return _0x24750d[_0xcc40('0xca')](_0x3924d1);}})[_0xcc40('0x18')](function(_0x4732bc){if(_0x4732bc){return _0x4732bc?{'count':_0x131386,'rows':_0x4732bc}:null;}})[_0xcc40('0x18')](respondWithResult(_0x555bcb,null))[_0xcc40('0x22')](handleError(_0x555bcb,null));};exports[_0xcc40('0xd7')]=function(_0x283e8a,_0x23cac1){var _0x5bd3fa;var _0x5178fe={};var _0x2602ab;return db[_0xcc40('0x3f')][_0xcc40('0x9a')]({'where':{'id':_0x283e8a[_0xcc40('0x55')]['id']},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x23cac1,null))['then'](function(_0x1a3d5c){if(!utils[_0xcc40('0xb3')](_0x283e8a[_0xcc40('0x47')][_0xcc40('0xa1')])){throw new db[(_0xcc40('0x96'))][(_0xcc40('0x97'))](_0xcc40('0xd8'));}_0x5bd3fa=_0x1a3d5c;var _0x10bd0d={};_0x10bd0d[_0xcc40('0x56')]=_[_0xcc40('0x57')](db[_[_0xcc40('0xa6')](_0x283e8a[_0xcc40('0x47')][_0xcc40('0xa1')])+'Queue']['rawAttributes']);_0x10bd0d[_0xcc40('0x47')]=_[_0xcc40('0x57')](_0x283e8a[_0xcc40('0x47')]);_0x10bd0d[_0xcc40('0x58')]=_[_0xcc40('0x59')](_0x10bd0d[_0xcc40('0x56')],_0x10bd0d[_0xcc40('0x47')]);_0x5178fe[_0xcc40('0x4b')]=_[_0xcc40('0x59')](_0x10bd0d[_0xcc40('0x56')],qs['fields'](_0x283e8a[_0xcc40('0x47')][_0xcc40('0x5a')]));_0x5178fe[_0xcc40('0x4b')]=_0x5178fe['attributes'][_0xcc40('0x72')]?_0x5178fe['attributes']:_0x10bd0d[_0xcc40('0x56')];_0x5178fe[_0xcc40('0xcc')]=qs[_0xcc40('0xcd')](_0x283e8a['query'][_0xcc40('0xcd')]);_0x5178fe['where']=qs[_0xcc40('0x58')](_[_0xcc40('0xcf')](_0x283e8a[_0xcc40('0x47')],_0x10bd0d[_0xcc40('0x58')]));if(_0x283e8a[_0xcc40('0x47')][_0xcc40('0x43')]){_0x5178fe[_0xcc40('0xce')]=_[_0xcc40('0x5c')](_0x5178fe['where'],{'$or':_[_0xcc40('0x37')](_0x5178fe[_0xcc40('0x4b')],function(_0x270ec7){var _0x3ebe58={};_0x3ebe58[_0x270ec7]={'$like':'%'+_0x283e8a[_0xcc40('0x47')]['filter']+'%'};return _0x3ebe58;})});}_0x5178fe=_['merge']({},_0x5178fe,_0x283e8a[_0xcc40('0x5d')]);switch(_0x5bd3fa[_0xcc40('0x3a')]){case _0xcc40('0x31'):return db[_[_0xcc40('0xa6')](_0x283e8a[_0xcc40('0x47')]['channel'])+_0xcc40('0xd9')][_0xcc40('0xaf')](_0x5178fe);case'user':case _0xcc40('0x35'):return _0x5bd3fa['get'+_[_0xcc40('0xa6')](_0x283e8a['query']['channel'])+_0xcc40('0xa7')](_0x5178fe);default:throw new db[(_0xcc40('0x96'))]['ValidationError'](_0xcc40('0xda'));}})['then'](function(_0x2ab2ef){_0x2602ab=_0x2ab2ef[_0xcc40('0x72')];if(!_0x283e8a['query'][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x5178fe[_0xcc40('0x2a')]=qs[_0xcc40('0x2a')](_0x283e8a[_0xcc40('0x47')]['limit']);_0x5178fe['offset']=qs[_0xcc40('0x27')](_0x283e8a['query'][_0xcc40('0x27')]);}switch(_0x5bd3fa[_0xcc40('0x3a')]){case _0xcc40('0x31'):return db[_['capitalize'](_0x283e8a[_0xcc40('0x47')][_0xcc40('0xa1')])+_0xcc40('0xd9')][_0xcc40('0xaf')](_0x5178fe);case _0xcc40('0x33'):case _0xcc40('0x35'):return _0x5bd3fa[_0xcc40('0x30')+_['capitalize'](_0x283e8a[_0xcc40('0x47')][_0xcc40('0xa1')])+_0xcc40('0xa7')](_0x5178fe);}})[_0xcc40('0x18')](function(_0x45e20d){return{'count':_0x2602ab,'rows':_0x45e20d};})[_0xcc40('0x18')](respondWithResult(_0x23cac1,null))[_0xcc40('0x22')](handleError(_0x23cac1,null));};exports[_0xcc40('0xdb')]=function(_0x259d62,_0xa2d3a9){var _0x24cb09={};var _0x1af445={};var _0x4238a8;var _0x523843;return db[_0xcc40('0x3f')][_0xcc40('0x9a')]({'where':{'id':_0x259d62[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0xa2d3a9,null))[_0xcc40('0x18')](function(_0x2f595a){if(_0x2f595a){_0x4238a8=_0x2f595a;_0x1af445['model']=_[_0xcc40('0x57')](db[_0xcc40('0xb1')]['rawAttributes']);_0x1af445['query']=_[_0xcc40('0x57')](_0x259d62[_0xcc40('0x47')]);_0x1af445[_0xcc40('0x58')]=_['intersection'](_0x1af445[_0xcc40('0x56')],_0x1af445[_0xcc40('0x47')]);_0x24cb09[_0xcc40('0x4b')]=_[_0xcc40('0x59')](_0x1af445[_0xcc40('0x56')],qs[_0xcc40('0x5a')](_0x259d62['query'][_0xcc40('0x5a')]));_0x24cb09[_0xcc40('0x4b')]=_0x24cb09[_0xcc40('0x4b')][_0xcc40('0x72')]?_0x24cb09[_0xcc40('0x4b')]:_0x1af445[_0xcc40('0x56')];_0x24cb09['order']=qs[_0xcc40('0xcd')](_0x259d62[_0xcc40('0x47')][_0xcc40('0xcd')]);_0x24cb09[_0xcc40('0xce')]=qs[_0xcc40('0x58')](_[_0xcc40('0xcf')](_0x259d62[_0xcc40('0x47')],_0x1af445[_0xcc40('0x58')]));if(_0x259d62[_0xcc40('0x47')][_0xcc40('0x43')]){_0x24cb09[_0xcc40('0xce')]=_[_0xcc40('0x5c')](_0x24cb09[_0xcc40('0xce')],{'$or':_[_0xcc40('0x37')](_0x24cb09['attributes'],function(_0x4da04a){var _0x36c72f={};_0x36c72f[_0x4da04a]={'$like':'%'+_0x259d62['query'][_0xcc40('0x43')]+'%'};return _0x36c72f;})});}_0x24cb09=_[_0xcc40('0x5c')]({},_0x24cb09,_0x259d62['options']);return _0x4238a8[_0xcc40('0xdb')](_0x24cb09);}})[_0xcc40('0x18')](function(_0xdc64d8){if(_0xdc64d8){_0x523843=_0xdc64d8[_0xcc40('0x72')];if(!_0x259d62[_0xcc40('0x47')][_0xcc40('0xd5')]('nolimit')){_0x24cb09['limit']=qs[_0xcc40('0x2a')](_0x259d62[_0xcc40('0x47')][_0xcc40('0x2a')]);_0x24cb09[_0xcc40('0x27')]=qs[_0xcc40('0x27')](_0x259d62['query'][_0xcc40('0x27')]);}return _0x4238a8[_0xcc40('0xdb')](_0x24cb09);}})[_0xcc40('0x18')](function(_0xd84195){if(_0xd84195){return _0xd84195?{'count':_0x523843,'rows':_0xd84195}:null;}})[_0xcc40('0x18')](respondWithResult(_0xa2d3a9,null))['catch'](handleError(_0xa2d3a9,null));};exports[_0xcc40('0xdc')]=function(_0x50f6cd,_0x4963ce){var _0x5b4fc9={};var _0x379166={};var _0x2a46b0;var _0x8b4e02;return db['User'][_0xcc40('0x9a')]({'where':{'id':_0x50f6cd[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x4963ce,null))[_0xcc40('0x18')](function(_0x4d22fc){if(_0x4d22fc){_0x2a46b0=_0x4d22fc;_0x379166['model']=_[_0xcc40('0x57')](db[_0xcc40('0xdd')][_0xcc40('0x40')]);_0x379166[_0xcc40('0x47')]=_[_0xcc40('0x57')](_0x50f6cd[_0xcc40('0x47')]);_0x379166['filters']=_[_0xcc40('0x59')](_0x379166[_0xcc40('0x56')],_0x379166[_0xcc40('0x47')]);_0x5b4fc9[_0xcc40('0x4b')]=_[_0xcc40('0x59')](_0x379166[_0xcc40('0x56')],qs['fields'](_0x50f6cd['query'][_0xcc40('0x5a')]));_0x5b4fc9[_0xcc40('0x4b')]=_0x5b4fc9[_0xcc40('0x4b')][_0xcc40('0x72')]?_0x5b4fc9[_0xcc40('0x4b')]:_0x379166[_0xcc40('0x56')];_0x5b4fc9[_0xcc40('0xcc')]=qs['sort'](_0x50f6cd[_0xcc40('0x47')][_0xcc40('0xcd')]);_0x5b4fc9['where']=qs[_0xcc40('0x58')](_['pick'](_0x50f6cd[_0xcc40('0x47')],_0x379166[_0xcc40('0x58')]));if(_0x50f6cd[_0xcc40('0x47')]['filter']){_0x5b4fc9[_0xcc40('0xce')]=_['merge'](_0x5b4fc9[_0xcc40('0xce')],{'$or':_[_0xcc40('0x37')](_0x5b4fc9[_0xcc40('0x4b')],function(_0x1c6460){var _0x4b90d1={};_0x4b90d1[_0x1c6460]={'$like':'%'+_0x50f6cd[_0xcc40('0x47')]['filter']+'%'};return _0x4b90d1;})});}_0x5b4fc9=_[_0xcc40('0x5c')]({},_0x5b4fc9,_0x50f6cd['options']);return _0x2a46b0[_0xcc40('0xdc')](_0x5b4fc9);}})[_0xcc40('0x18')](function(_0xf23f20){if(_0xf23f20){_0x8b4e02=_0xf23f20[_0xcc40('0x72')];if(!_0x50f6cd['query']['hasOwnProperty'](_0xcc40('0xd6'))){_0x5b4fc9[_0xcc40('0x2a')]=qs['limit'](_0x50f6cd['query'][_0xcc40('0x2a')]);_0x5b4fc9[_0xcc40('0x27')]=qs['offset'](_0x50f6cd[_0xcc40('0x47')][_0xcc40('0x27')]);}return _0x2a46b0[_0xcc40('0xdc')](_0x5b4fc9);}})[_0xcc40('0x18')](function(_0x9d58cf){if(_0x9d58cf){return _0x9d58cf?{'count':_0x8b4e02,'rows':_0x9d58cf}:null;}})[_0xcc40('0x18')](respondWithResult(_0x4963ce,null))['catch'](handleError(_0x4963ce,null));};exports[_0xcc40('0xde')]=function(_0x56524f,_0x14eb33){var _0x5aaa54={'raw':!![],'where':{}};var _0x1b66be={};var _0x432f7b={'count':0x0,'rows':[]};return db[_0xcc40('0x3f')]['findOne']({'where':{'id':_0x56524f['params']['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x14eb33,null))['then'](function(_0x55325f){if(_0x55325f){_0x1b66be['model']=_[_0xcc40('0x57')](db[_0xcc40('0xdf')][_0xcc40('0x40')]);_0x1b66be[_0xcc40('0x47')]=_[_0xcc40('0x57')](_0x56524f[_0xcc40('0x47')]);_0x1b66be[_0xcc40('0x58')]=_[_0xcc40('0x59')](_0x1b66be[_0xcc40('0x56')],_0x1b66be[_0xcc40('0x47')]);_0x5aaa54['attributes']=_[_0xcc40('0x59')](_0x1b66be[_0xcc40('0x56')],qs[_0xcc40('0x5a')](_0x56524f['query'][_0xcc40('0x5a')]));_0x5aaa54['attributes']=_0x5aaa54['attributes'][_0xcc40('0x72')]?_0x5aaa54[_0xcc40('0x4b')]:_0x1b66be['model'];if(!_0x56524f[_0xcc40('0x47')][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x5aaa54[_0xcc40('0x2a')]=qs[_0xcc40('0x2a')](_0x56524f[_0xcc40('0x47')]['limit']);_0x5aaa54['offset']=qs[_0xcc40('0x27')](_0x56524f[_0xcc40('0x47')]['offset']);}_0x5aaa54['order']=qs[_0xcc40('0xcd')](_0x56524f[_0xcc40('0x47')][_0xcc40('0xcd')]);_0x5aaa54['where']=qs[_0xcc40('0x58')](_[_0xcc40('0xcf')](_0x56524f[_0xcc40('0x47')],_0x1b66be['filters']));_0x5aaa54[_0xcc40('0xce')][_0xcc40('0xe0')]=_0x55325f['id'];if(_0x56524f[_0xcc40('0x47')][_0xcc40('0x43')]){_0x5aaa54[_0xcc40('0xce')]=_[_0xcc40('0x5c')](_0x5aaa54['where'],{'$or':_[_0xcc40('0x37')](_0x5aaa54['attributes'],function(_0x40d4f2){var _0x293ece={};_0x293ece[_0x40d4f2]={'$like':'%'+_0x56524f[_0xcc40('0x47')]['filter']+'%'};return _0x293ece;})});}_0x5aaa54=_['merge']({},_0x5aaa54,_0x56524f[_0xcc40('0x5d')]);return db[_0xcc40('0xdf')][_0xcc40('0x29')]({'where':_0x5aaa54['where']})['then'](function(_0x2af980){_0x432f7b[_0xcc40('0x29')]=_0x2af980;if(_0x56524f['query']['includeAll']){_0x5aaa54[_0xcc40('0x49')]=[{'all':!![]}];}return db['VoiceRecording'][_0xcc40('0xaf')](_0x5aaa54);})[_0xcc40('0x18')](function(_0x4c0cb5){_0x432f7b[_0xcc40('0x4c')]=_0x4c0cb5;return _0x432f7b;});}})[_0xcc40('0x18')](respondWithFilteredResult(_0x14eb33,_0x5aaa54))[_0xcc40('0x22')](handleError(_0x14eb33,null));};exports['getScreenRecordings']=function(_0x2ee59f,_0x3625be){var _0x257a84={'raw':!![],'where':{}};var _0x14da8f={};var _0x3be4cf={'count':0x0,'rows':[]};return db[_0xcc40('0x3f')]['findOne']({'where':{'id':_0x2ee59f[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x3625be,null))['then'](function(_0x1800bc){if(_0x1800bc){_0x14da8f[_0xcc40('0x56')]=_['keys'](db[_0xcc40('0xe1')][_0xcc40('0x40')]);_0x14da8f[_0xcc40('0x47')]=_[_0xcc40('0x57')](_0x2ee59f[_0xcc40('0x47')]);_0x14da8f['filters']=_[_0xcc40('0x59')](_0x14da8f['model'],_0x14da8f[_0xcc40('0x47')]);_0x257a84[_0xcc40('0x4b')]=_[_0xcc40('0x59')](_0x14da8f['model'],qs[_0xcc40('0x5a')](_0x2ee59f[_0xcc40('0x47')][_0xcc40('0x5a')]));_0x257a84[_0xcc40('0x4b')]=_0x257a84[_0xcc40('0x4b')][_0xcc40('0x72')]?_0x257a84['attributes']:_0x14da8f[_0xcc40('0x56')];if(!_0x2ee59f[_0xcc40('0x47')][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x257a84[_0xcc40('0x2a')]=qs[_0xcc40('0x2a')](_0x2ee59f[_0xcc40('0x47')][_0xcc40('0x2a')]);_0x257a84[_0xcc40('0x27')]=qs['offset'](_0x2ee59f[_0xcc40('0x47')][_0xcc40('0x27')]);}_0x257a84[_0xcc40('0xcc')]=qs[_0xcc40('0xcd')](_0x2ee59f[_0xcc40('0x47')][_0xcc40('0xcd')]);_0x257a84[_0xcc40('0xce')]=qs[_0xcc40('0x58')](_[_0xcc40('0xcf')](_0x2ee59f[_0xcc40('0x47')],_0x14da8f[_0xcc40('0x58')]));_0x257a84[_0xcc40('0xce')]['UserId']=_0x1800bc['id'];if(_0x2ee59f[_0xcc40('0x47')][_0xcc40('0x43')]){_0x257a84[_0xcc40('0xce')]=_[_0xcc40('0x5c')](_0x257a84[_0xcc40('0xce')],{'$or':_['map'](_0x257a84['attributes'],function(_0x1f2dd3){var _0x34a92f={};_0x34a92f[_0x1f2dd3]={'$like':'%'+_0x2ee59f[_0xcc40('0x47')]['filter']+'%'};return _0x34a92f;})});}_0x257a84=_[_0xcc40('0x5c')]({},_0x257a84,_0x2ee59f[_0xcc40('0x5d')]);return db['ScreenRecording']['count']({'where':_0x257a84['where']})[_0xcc40('0x18')](function(_0x27be7c){_0x3be4cf[_0xcc40('0x29')]=_0x27be7c;if(_0x2ee59f[_0xcc40('0x47')]['includeAll']){_0x257a84['include']=[{'all':!![]}];}return db[_0xcc40('0xe1')][_0xcc40('0xaf')](_0x257a84);})[_0xcc40('0x18')](function(_0x5cd822){_0x3be4cf[_0xcc40('0x4c')]=_0x5cd822;return _0x3be4cf;});}})['then'](respondWithFilteredResult(_0x3625be,_0x257a84))['catch'](handleError(_0x3625be,null));};exports[_0xcc40('0xe2')]=function(_0x1daa0b,_0x142076){var _0x33e8eb={};var _0x338ba6={};var _0x660877;var _0x48a22b;return db[_0xcc40('0x3f')][_0xcc40('0x9a')]({'where':{'id':_0x1daa0b[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x142076,null))[_0xcc40('0x18')](function(_0x2838b9){if(_0x2838b9){_0x660877=_0x2838b9;_0x338ba6['model']=_[_0xcc40('0x57')](db[_0xcc40('0xe3')][_0xcc40('0x40')]);_0x338ba6[_0xcc40('0x47')]=_[_0xcc40('0x57')](_0x1daa0b[_0xcc40('0x47')]);_0x338ba6[_0xcc40('0x58')]=_['intersection'](_0x338ba6[_0xcc40('0x56')],_0x338ba6['query']);_0x33e8eb[_0xcc40('0x4b')]=_['intersection'](_0x338ba6[_0xcc40('0x56')],qs[_0xcc40('0x5a')](_0x1daa0b[_0xcc40('0x47')][_0xcc40('0x5a')]));_0x33e8eb['attributes']=_0x33e8eb[_0xcc40('0x4b')][_0xcc40('0x72')]?_0x33e8eb[_0xcc40('0x4b')]:_0x338ba6['model'];_0x33e8eb[_0xcc40('0xcc')]=qs['sort'](_0x1daa0b[_0xcc40('0x47')][_0xcc40('0xcd')]);_0x33e8eb[_0xcc40('0xce')]=qs[_0xcc40('0x58')](_[_0xcc40('0xcf')](_0x1daa0b[_0xcc40('0x47')],_0x338ba6[_0xcc40('0x58')]));if(_0x1daa0b[_0xcc40('0x47')][_0xcc40('0x43')]){_0x33e8eb['where']=_[_0xcc40('0x5c')](_0x33e8eb[_0xcc40('0xce')],{'$or':_['map'](_0x33e8eb['attributes'],function(_0xf05835){var _0x226250={};_0x226250[_0xf05835]={'$like':'%'+_0x1daa0b[_0xcc40('0x47')][_0xcc40('0x43')]+'%'};return _0x226250;})});}_0x33e8eb=_[_0xcc40('0x5c')]({},_0x33e8eb,_0x1daa0b['options']);return _0x660877[_0xcc40('0xe2')](_0x33e8eb);}})[_0xcc40('0x18')](function(_0x3cb4a7){if(_0x3cb4a7){_0x48a22b=_0x3cb4a7[_0xcc40('0x72')];if(!_0x1daa0b[_0xcc40('0x47')]['hasOwnProperty']('nolimit')){_0x33e8eb['limit']=qs[_0xcc40('0x2a')](_0x1daa0b[_0xcc40('0x47')][_0xcc40('0x2a')]);_0x33e8eb['offset']=qs[_0xcc40('0x27')](_0x1daa0b[_0xcc40('0x47')]['offset']);}return _0x660877['getChatInteractions'](_0x33e8eb);}})[_0xcc40('0x18')](function(_0x4b92e6){if(_0x4b92e6){return _0x4b92e6?{'count':_0x48a22b,'rows':_0x4b92e6}:null;}})['then'](respondWithResult(_0x142076,null))['catch'](handleError(_0x142076,null));};exports['getOpenchannelInteractions']=function(_0x57ec8f,_0xa2ad66){var _0x4ca3c5={};var _0x3804b1={};var _0x271bfc;var _0x4b695d;return db['User'][_0xcc40('0x9a')]({'where':{'id':_0x57ec8f[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0xa2ad66,null))[_0xcc40('0x18')](function(_0x55e111){if(_0x55e111){_0x271bfc=_0x55e111;_0x3804b1['model']=_[_0xcc40('0x57')](db[_0xcc40('0xe4')][_0xcc40('0x40')]);_0x3804b1[_0xcc40('0x47')]=_[_0xcc40('0x57')](_0x57ec8f['query']);_0x3804b1[_0xcc40('0x58')]=_['intersection'](_0x3804b1[_0xcc40('0x56')],_0x3804b1[_0xcc40('0x47')]);_0x4ca3c5['attributes']=_['intersection'](_0x3804b1[_0xcc40('0x56')],qs[_0xcc40('0x5a')](_0x57ec8f[_0xcc40('0x47')][_0xcc40('0x5a')]));_0x4ca3c5[_0xcc40('0x4b')]=_0x4ca3c5['attributes']['length']?_0x4ca3c5[_0xcc40('0x4b')]:_0x3804b1[_0xcc40('0x56')];_0x4ca3c5[_0xcc40('0xcc')]=qs['sort'](_0x57ec8f[_0xcc40('0x47')][_0xcc40('0xcd')]);_0x4ca3c5[_0xcc40('0xce')]=qs[_0xcc40('0x58')](_[_0xcc40('0xcf')](_0x57ec8f[_0xcc40('0x47')],_0x3804b1['filters']));if(_0x57ec8f[_0xcc40('0x47')][_0xcc40('0x43')]){_0x4ca3c5[_0xcc40('0xce')]=_[_0xcc40('0x5c')](_0x4ca3c5[_0xcc40('0xce')],{'$or':_['map'](_0x4ca3c5[_0xcc40('0x4b')],function(_0x106746){var _0x35e633={};_0x35e633[_0x106746]={'$like':'%'+_0x57ec8f[_0xcc40('0x47')]['filter']+'%'};return _0x35e633;})});}_0x4ca3c5=_[_0xcc40('0x5c')]({},_0x4ca3c5,_0x57ec8f[_0xcc40('0x5d')]);return _0x271bfc[_0xcc40('0xe5')](_0x4ca3c5);}})[_0xcc40('0x18')](function(_0xb1cb92){if(_0xb1cb92){_0x4b695d=_0xb1cb92[_0xcc40('0x72')];if(!_0x57ec8f[_0xcc40('0x47')][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x4ca3c5[_0xcc40('0x2a')]=qs[_0xcc40('0x2a')](_0x57ec8f['query']['limit']);_0x4ca3c5[_0xcc40('0x27')]=qs[_0xcc40('0x27')](_0x57ec8f['query'][_0xcc40('0x27')]);}return _0x271bfc[_0xcc40('0xe5')](_0x4ca3c5);}})[_0xcc40('0x18')](function(_0x10a266){if(_0x10a266){return _0x10a266?{'count':_0x4b695d,'rows':_0x10a266}:null;}})[_0xcc40('0x18')](respondWithResult(_0xa2ad66,null))[_0xcc40('0x22')](handleError(_0xa2ad66,null));};exports[_0xcc40('0xe6')]=function(_0x170d8a,_0xd0750b){var _0x2cc3f6={'raw':!![],'where':{}};var _0x57c160={};var _0x3e5302={'count':0x0,'rows':[]};return db[_0xcc40('0x3f')][_0xcc40('0x9a')]({'where':{'id':_0x170d8a[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0xd0750b,null))['then'](function(_0x3a7f92){if(_0x3a7f92){_0x57c160[_0xcc40('0x56')]=_[_0xcc40('0x57')](db[_0xcc40('0xe7')][_0xcc40('0x40')]);_0x57c160['query']=_[_0xcc40('0x57')](_0x170d8a[_0xcc40('0x47')]);_0x57c160[_0xcc40('0x58')]=_[_0xcc40('0x59')](_0x57c160[_0xcc40('0x56')],_0x57c160[_0xcc40('0x47')]);_0x2cc3f6[_0xcc40('0x4b')]=_[_0xcc40('0x59')](_0x57c160[_0xcc40('0x56')],qs[_0xcc40('0x5a')](_0x170d8a[_0xcc40('0x47')]['fields']));_0x2cc3f6[_0xcc40('0x4b')]=_0x2cc3f6[_0xcc40('0x4b')]['length']?_0x2cc3f6[_0xcc40('0x4b')]:_0x57c160[_0xcc40('0x56')];if(!_0x170d8a[_0xcc40('0x47')][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x2cc3f6['limit']=qs['limit'](_0x170d8a[_0xcc40('0x47')]['limit']);_0x2cc3f6['offset']=qs[_0xcc40('0x27')](_0x170d8a[_0xcc40('0x47')][_0xcc40('0x27')]);}_0x2cc3f6['order']=qs[_0xcc40('0xcd')](_0x170d8a[_0xcc40('0x47')][_0xcc40('0xcd')]);_0x2cc3f6[_0xcc40('0xce')]=qs[_0xcc40('0x58')](_['pick'](_0x170d8a[_0xcc40('0x47')],_0x57c160[_0xcc40('0x58')]));_0x2cc3f6[_0xcc40('0xce')][_0xcc40('0xe0')]=_0x3a7f92['id'];if(_0x170d8a[_0xcc40('0x47')]['filter']){_0x2cc3f6[_0xcc40('0xce')]=_[_0xcc40('0x5c')](_0x2cc3f6[_0xcc40('0xce')],{'$or':_['map'](_0x2cc3f6[_0xcc40('0x4b')],function(_0x309869){var _0x4e6834={};_0x4e6834[_0x309869]={'$like':'%'+_0x170d8a['query']['filter']+'%'};return _0x4e6834;})});}_0x2cc3f6=_[_0xcc40('0x5c')]({},_0x2cc3f6,_0x170d8a[_0xcc40('0x5d')]);return db[_0xcc40('0xe7')][_0xcc40('0x29')]({'where':_0x2cc3f6[_0xcc40('0xce')]})[_0xcc40('0x18')](function(_0x12c166){_0x3e5302[_0xcc40('0x29')]=_0x12c166;if(_0x170d8a[_0xcc40('0x47')]['includeAll']){_0x2cc3f6['include']=[{'all':!![]}];}return db[_0xcc40('0xe7')]['findAll'](_0x2cc3f6);})[_0xcc40('0x18')](function(_0x6054d9){_0x3e5302[_0xcc40('0x4c')]=_0x6054d9;return _0x3e5302;});}})[_0xcc40('0x18')](respondWithFilteredResult(_0xd0750b,_0x2cc3f6))[_0xcc40('0x22')](handleError(_0xd0750b,null));};exports[_0xcc40('0xe8')]=function(_0x19f070,_0x368b7c){var _0x56c700={};var _0x2c3e40={};var _0xd19c5a;var _0x362a76;return db[_0xcc40('0x3f')][_0xcc40('0x9a')]({'where':{'id':_0x19f070[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x368b7c,null))['then'](function(_0x34a258){if(_0x34a258){_0xd19c5a=_0x34a258;_0x2c3e40[_0xcc40('0x56')]=_[_0xcc40('0x57')](db[_0xcc40('0xe9')]['rawAttributes']);_0x2c3e40['query']=_[_0xcc40('0x57')](_0x19f070[_0xcc40('0x47')]);_0x2c3e40[_0xcc40('0x58')]=_[_0xcc40('0x59')](_0x2c3e40[_0xcc40('0x56')],_0x2c3e40[_0xcc40('0x47')]);_0x56c700['attributes']=_[_0xcc40('0x59')](_0x2c3e40[_0xcc40('0x56')],qs[_0xcc40('0x5a')](_0x19f070[_0xcc40('0x47')][_0xcc40('0x5a')]));_0x56c700[_0xcc40('0x4b')]=_0x56c700[_0xcc40('0x4b')]['length']?_0x56c700[_0xcc40('0x4b')]:_0x2c3e40[_0xcc40('0x56')];_0x56c700[_0xcc40('0xcc')]=qs['sort'](_0x19f070[_0xcc40('0x47')][_0xcc40('0xcd')]);_0x56c700[_0xcc40('0xce')]=qs[_0xcc40('0x58')](_[_0xcc40('0xcf')](_0x19f070[_0xcc40('0x47')],_0x2c3e40['filters']));if(_0x19f070['query'][_0xcc40('0x43')]){_0x56c700[_0xcc40('0xce')]=_[_0xcc40('0x5c')](_0x56c700[_0xcc40('0xce')],{'$or':_[_0xcc40('0x37')](_0x56c700[_0xcc40('0x4b')],function(_0x154ae4){var _0x412131={};_0x412131[_0x154ae4]={'$like':'%'+_0x19f070[_0xcc40('0x47')][_0xcc40('0x43')]+'%'};return _0x412131;})});}_0x56c700=_[_0xcc40('0x5c')]({},_0x56c700,_0x19f070[_0xcc40('0x5d')]);return _0xd19c5a[_0xcc40('0xe8')](_0x56c700);}})[_0xcc40('0x18')](function(_0x569e04){if(_0x569e04){_0x362a76=_0x569e04[_0xcc40('0x72')];if(!_0x19f070[_0xcc40('0x47')][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x56c700[_0xcc40('0x2a')]=qs[_0xcc40('0x2a')](_0x19f070[_0xcc40('0x47')][_0xcc40('0x2a')]);_0x56c700[_0xcc40('0x27')]=qs['offset'](_0x19f070['query'][_0xcc40('0x27')]);}return _0xd19c5a[_0xcc40('0xe8')](_0x56c700);}})['then'](function(_0x147601){if(_0x147601){return _0x147601?{'count':_0x362a76,'rows':_0x147601}:null;}})[_0xcc40('0x18')](respondWithResult(_0x368b7c,null))[_0xcc40('0x22')](handleError(_0x368b7c,null));};exports[_0xcc40('0xea')]=function(_0x20c719,_0x3a250d){var _0x3dc276={};var _0x408a4d={};var _0x32a04e;var _0x495644;return db['User'][_0xcc40('0x9a')]({'where':{'id':_0x20c719[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x3a250d,null))[_0xcc40('0x18')](function(_0x173afb){if(_0x173afb){_0x32a04e=_0x173afb;_0x408a4d['model']=_[_0xcc40('0x57')](db[_0xcc40('0xeb')][_0xcc40('0x40')]);_0x408a4d['query']=_[_0xcc40('0x57')](_0x20c719[_0xcc40('0x47')]);_0x408a4d[_0xcc40('0x58')]=_[_0xcc40('0x59')](_0x408a4d['model'],_0x408a4d[_0xcc40('0x47')]);_0x3dc276[_0xcc40('0x4b')]=_['intersection'](_0x408a4d[_0xcc40('0x56')],qs[_0xcc40('0x5a')](_0x20c719[_0xcc40('0x47')]['fields']));_0x3dc276[_0xcc40('0x4b')]=_0x3dc276[_0xcc40('0x4b')][_0xcc40('0x72')]?_0x3dc276[_0xcc40('0x4b')]:_0x408a4d['model'];_0x3dc276[_0xcc40('0xcc')]=qs[_0xcc40('0xcd')](_0x20c719[_0xcc40('0x47')][_0xcc40('0xcd')]);_0x3dc276[_0xcc40('0xce')]=qs[_0xcc40('0x58')](_['pick'](_0x20c719[_0xcc40('0x47')],_0x408a4d[_0xcc40('0x58')]));if(_0x20c719[_0xcc40('0x47')][_0xcc40('0x43')]){_0x3dc276[_0xcc40('0xce')]=_['merge'](_0x3dc276[_0xcc40('0xce')],{'$or':_[_0xcc40('0x37')](_0x3dc276[_0xcc40('0x4b')],function(_0x4682dd){var _0x5bcb95={};_0x5bcb95[_0x4682dd]={'$like':'%'+_0x20c719[_0xcc40('0x47')][_0xcc40('0x43')]+'%'};return _0x5bcb95;})});}_0x3dc276=_[_0xcc40('0x5c')]({},_0x3dc276,_0x20c719[_0xcc40('0x5d')]);return _0x32a04e[_0xcc40('0xea')](_0x3dc276);}})[_0xcc40('0x18')](function(_0x2997cf){if(_0x2997cf){_0x495644=_0x2997cf[_0xcc40('0x72')];if(!_0x20c719[_0xcc40('0x47')][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x3dc276[_0xcc40('0x2a')]=qs[_0xcc40('0x2a')](_0x20c719[_0xcc40('0x47')][_0xcc40('0x2a')]);_0x3dc276[_0xcc40('0x27')]=qs['offset'](_0x20c719[_0xcc40('0x47')][_0xcc40('0x27')]);}return _0x32a04e[_0xcc40('0xea')](_0x3dc276);}})[_0xcc40('0x18')](function(_0xdf24c3){if(_0xdf24c3){return _0xdf24c3?{'count':_0x495644,'rows':_0xdf24c3}:null;}})[_0xcc40('0x18')](respondWithResult(_0x3a250d,null))[_0xcc40('0x22')](handleError(_0x3a250d,null));};exports['getWhatsappInteractions']=function(_0x59deb5,_0x2736d6){var _0x331b33={};var _0xa114b7={};var _0x288745;var _0x47801e;return db['User']['findOne']({'where':{'id':_0x59deb5['params']['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x2736d6,null))['then'](function(_0x32e43c){if(_0x32e43c){_0x288745=_0x32e43c;_0xa114b7['model']=_[_0xcc40('0x57')](db[_0xcc40('0xec')][_0xcc40('0x40')]);_0xa114b7[_0xcc40('0x47')]=_[_0xcc40('0x57')](_0x59deb5['query']);_0xa114b7['filters']=_[_0xcc40('0x59')](_0xa114b7[_0xcc40('0x56')],_0xa114b7['query']);_0x331b33[_0xcc40('0x4b')]=_['intersection'](_0xa114b7[_0xcc40('0x56')],qs[_0xcc40('0x5a')](_0x59deb5[_0xcc40('0x47')][_0xcc40('0x5a')]));_0x331b33[_0xcc40('0x4b')]=_0x331b33[_0xcc40('0x4b')]['length']?_0x331b33[_0xcc40('0x4b')]:_0xa114b7['model'];_0x331b33[_0xcc40('0xcc')]=qs[_0xcc40('0xcd')](_0x59deb5[_0xcc40('0x47')]['sort']);_0x331b33[_0xcc40('0xce')]=qs['filters'](_['pick'](_0x59deb5[_0xcc40('0x47')],_0xa114b7[_0xcc40('0x58')]));if(_0x59deb5[_0xcc40('0x47')][_0xcc40('0x43')]){_0x331b33[_0xcc40('0xce')]=_[_0xcc40('0x5c')](_0x331b33[_0xcc40('0xce')],{'$or':_[_0xcc40('0x37')](_0x331b33[_0xcc40('0x4b')],function(_0x4e6801){var _0x733289={};_0x733289[_0x4e6801]={'$like':'%'+_0x59deb5['query'][_0xcc40('0x43')]+'%'};return _0x733289;})});}_0x331b33=_[_0xcc40('0x5c')]({},_0x331b33,_0x59deb5[_0xcc40('0x5d')]);return _0x288745['getWhatsappInteractions'](_0x331b33);}})[_0xcc40('0x18')](function(_0xfd929c){if(_0xfd929c){_0x47801e=_0xfd929c[_0xcc40('0x72')];if(!_0x59deb5[_0xcc40('0x47')][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x331b33[_0xcc40('0x2a')]=qs[_0xcc40('0x2a')](_0x59deb5['query']['limit']);_0x331b33[_0xcc40('0x27')]=qs['offset'](_0x59deb5[_0xcc40('0x47')][_0xcc40('0x27')]);}return _0x288745[_0xcc40('0xed')](_0x331b33);}})[_0xcc40('0x18')](function(_0x56c619){if(_0x56c619){return _0x56c619?{'count':_0x47801e,'rows':_0x56c619}:null;}})[_0xcc40('0x18')](respondWithResult(_0x2736d6,null))[_0xcc40('0x22')](handleError(_0x2736d6,null));};exports[_0xcc40('0xee')]=function(_0x3e8f70,_0x2cd5cc,_0x21430d){var _0x186ae6;var _0x3f8fac;var _0xc80cb6;var _0xe73924=!_['isNil'](_0x3e8f70[_0xcc40('0x55')]['id'])?_0x3e8f70[_0xcc40('0x55')]['id']:!_[_0xcc40('0x6c')](_0x3e8f70[_0xcc40('0x33')]['id'])?_0x3e8f70[_0xcc40('0x33')]['id']:null;return db[_0xcc40('0x3f')]['find']({'where':{'id':_0xe73924,'role':{'$or':[_0xcc40('0x31'),_0xcc40('0x33'),_0xcc40('0x35')]}},'attributes':['id','name','phone',_0xcc40('0xef'),'role',_0xcc40('0x67'),_0xcc40('0xa3')]})['then'](function(_0x33bd27){if(_0x33bd27){if(_0x33bd27['role']===_0xcc40('0x35')){_0x186ae6=_0x33bd27;if(_0x3e8f70['body'][_0xcc40('0xa4')]){_0xc80cb6=util[_0xcc40('0xf0')](_0xcc40('0xf1'),_0x186ae6[_0x3e8f70[_0xcc40('0x62')]['interface']]);}else if(_0x3e8f70[_0xcc40('0x62')][_0xcc40('0xf2')]){_0xc80cb6=util[_0xcc40('0xf0')](_0xcc40('0xf3'),_0x3e8f70['body'][_0xcc40('0xf2')]);}else{_0xc80cb6=util[_0xcc40('0xf0')](_0xcc40('0xf3'),_0x186ae6['name']);}socket['to'](util[_0xcc40('0xf0')](_0xcc40('0xf4'),_0x186ae6[_0xcc40('0x3c')]))[_0xcc40('0x2e')](_0xcc40('0xf5'),{'user':{'id':_0x186ae6['id'],'name':_0x186ae6[_0xcc40('0x3c')]},'ip':_0x3e8f70[_0xcc40('0xf6')][_0xcc40('0xf7')]||_0x3e8f70['connection']['remoteAddress']||_0x3e8f70[_0xcc40('0xf8')][_0xcc40('0xf9')]||_0x3e8f70[_0xcc40('0xfa')][_0xcc40('0xf8')][_0xcc40('0xf9')]});return db[_0xcc40('0xb1')][_0xcc40('0x2f')]({'where':{'membername':_0x186ae6[_0xcc40('0x3c')]},'individualHooks':!![]});}}else{throw new db[(_0xcc40('0x96'))][(_0xcc40('0x97'))](_0xcc40('0xfb'));}})[_0xcc40('0x18')](function(){if(_0x186ae6){return _0x186ae6[_0xcc40('0xfc')]({'raw':!![]});}})['then'](function(_0x12db26){if(_0x186ae6){var _0x44947e=[];if(_0x12db26){_0x3f8fac=_0x12db26;if(_0x3f8fac[_0xcc40('0x72')]){for(var _0x3919f3=0x0;_0x3919f3<_0x3f8fac[_0xcc40('0x72')];_0x3919f3++){_0x44947e[_0xcc40('0x4e')]({'membername':_0x186ae6[_0xcc40('0x3c')],'UserId':_0x186ae6['id'],'queue_name':_0x3f8fac[_0x3919f3][_0xcc40('0x3c')],'VoiceQueueId':_0x3f8fac[_0x3919f3]['id'],'interface':_0xc80cb6,'paused':_0x186ae6[_0xcc40('0xa3')]||![],'penalty':_0x3f8fac[_0x3919f3][_0xcc40('0xfd')]||0x0});}return BPromise[_0xcc40('0x90')](_0x44947e,function(_0x12500e){return db[_0xcc40('0xb1')][_0xcc40('0xb2')](_0x12500e);});}}}})[_0xcc40('0x18')](function(){if(_0x186ae6){return db[_0xcc40('0xfe')][_0xcc40('0xaf')]({'where':{'membername':_0x186ae6['name'],'exitAt':null}});}})[_0xcc40('0x18')](function(_0x5acbd0){if(_0x186ae6){var _0x534a9e=[];_0x5acbd0['forEach'](function(_0x452ec5){_0x534a9e[_0xcc40('0x4e')](_0x452ec5[_0xcc40('0x2d')]({'exitAt':moment()[_0xcc40('0xf0')](_0xcc40('0xff'))}));});return BPromise[_0xcc40('0x61')](_0x534a9e);}})[_0xcc40('0x18')](function(){if(_0x186ae6){var _0xb5369a=[];var _0x58e556=[];var _0x26540b=utils[_0xcc40('0x100')]();var _0x4cbe2b={'membername':_0x186ae6[_0xcc40('0x3c')],'interface':_0xc80cb6,'enterAt':moment()[_0xcc40('0xf0')](_0xcc40('0xff')),'role':_0x186ae6[_0xcc40('0x3a')],'internal':_0x186ae6[_0xcc40('0x67')]};_0x26540b[_0xcc40('0x101')](function(_0x41236a){_0xb5369a[_0xcc40('0x4e')](_['merge']({'channel':_0x41236a,'type':_0xcc40('0x102'),'data1':_0x3e8f70[_0xcc40('0x62')][_0xcc40('0x103')],'data2':_0xc80cb6},_0x4cbe2b));if(_0x186ae6[_0xcc40('0xa3')]){_0x58e556[_0xcc40('0x4e')](_[_0xcc40('0x5c')]({'channel':_0x41236a,'type':_0xcc40('0x104'),'data1':'LOGININPAUSE'},_0x4cbe2b));}});return db[_0xcc40('0xfe')][_0xcc40('0x8c')](_0xb5369a[_0xcc40('0xc9')](_0x58e556),{'individualHooks':!![]});}})['then'](function(){if(_0x186ae6){return _0x186ae6[_0xcc40('0x2d')]({'online':!![],'lastLoginAt':moment()[_0xcc40('0xf0')](_0xcc40('0xff')),'voicePause':_0x186ae6['loginInPause']||![],'mailPause':_0x186ae6[_0xcc40('0xa3')]||![],'chatPause':_0x186ae6[_0xcc40('0xa3')]||![],'faxPause':_0x186ae6['loginInPause']||![],'smsPause':_0x186ae6[_0xcc40('0xa3')]||![],'openchannelPause':_0x186ae6['loginInPause']||![],'whatsappPause':_0x186ae6['loginInPause']||![],'pauseType':_0x186ae6[_0xcc40('0xa3')]?'LOGININPAUSE':null,'interface':_0xc80cb6,'lastPauseAt':moment()[_0xcc40('0xf0')](_0xcc40('0xff'))});}})['then'](function(_0x211d9e){if(_0x3e8f70['isMiddleware']){return _0x21430d();}else{return BPromise['resolve'](_0x211d9e)['then'](respondWithResult(_0x2cd5cc,null));}})[_0xcc40('0x22')](handleError(_0x2cd5cc,null));};exports[_0xcc40('0x105')]=function(_0x404ebb,_0x553e4a){var _0x490042;return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x404ebb[_0xcc40('0x55')]['id'],'role':'agent'},'attributes':['id',_0xcc40('0x3c'),_0xcc40('0x3a')]})[_0xcc40('0x18')](handleEntityNotFound(_0x553e4a,null))[_0xcc40('0x18')](function(_0x38efb0){if(_0x38efb0){_0x490042=_0x38efb0;return db[_0xcc40('0xb1')][_0xcc40('0x2f')]({'where':{'membername':_0x490042[_0xcc40('0x3c')]},'individualHooks':!![]});}})[_0xcc40('0x18')](function(){return db[_0xcc40('0xfe')]['findAll']({'where':{'membername':_0x490042[_0xcc40('0x3c')],'exitAt':null}});})[_0xcc40('0x18')](function(_0x5b94ca){var _0xe70383=[];_0x5b94ca[_0xcc40('0x101')](function(_0x47174c){_0xe70383[_0xcc40('0x4e')](_0x47174c[_0xcc40('0x2d')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xcc40('0x61')](_0xe70383);})[_0xcc40('0x18')](function(){return _0x490042[_0xcc40('0x2d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xcc40('0x18')](respondWithResult(_0x553e4a,null))[_0xcc40('0x22')](handleError(_0x553e4a,null));};exports[_0xcc40('0x106')]=function(_0x6434c8,_0x260b64){var _0x140663;return db['UserVoiceQueueRt'][_0xcc40('0x2d')]({'paused':0x1},{'where':{'UserId':_0x6434c8[_0xcc40('0x55')]['id']},'individualHooks':!![]})['then'](function(){return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x6434c8['params']['id'],'role':_0xcc40('0x35')},'attributes':['id',_0xcc40('0x3c'),'role',_0xcc40('0x67'),_0xcc40('0xa4')]});})[_0xcc40('0x18')](handleEntityNotFound(_0x260b64,null))[_0xcc40('0x18')](function(_0x33e3f3){if(_0x33e3f3){_0x140663=_0x33e3f3;return respondWithRpcPromise(_0xcc40('0x107'),_0xcc40('0x106'),{'id':_0x140663['id'],'name':_0x140663[_0xcc40('0x3c')],'pause':!![]});}})[_0xcc40('0x18')](function(){if(_0x140663){return db['MemberReport']['findAll']({'where':{'membername':_0x140663['name'],'type':_0xcc40('0x104'),'exitAt':null}});}})[_0xcc40('0x18')](function(_0x9a1427){if(_0x9a1427[_0xcc40('0x72')]){var _0x1c1fe5=moment()[_0xcc40('0xf0')](_0xcc40('0xff'));for(var _0x3c2ee8=0x0,_0x9e3420=_0x9a1427[_0xcc40('0x72')];_0x3c2ee8<_0x9e3420;_0x3c2ee8++){_0x9a1427[_0x3c2ee8][_0xcc40('0x108')]({'exitAt':_0x1c1fe5});}}})['then'](function(){var _0x403102=[];var _0x496ffe=utils['getChannels']();_0x496ffe['forEach'](function(_0x573a91){_0x403102[_0xcc40('0x4e')]({'channel':_0x573a91,'membername':_0x140663['name'],'interface':_[_0xcc40('0x6c')](_0x140663['interface'])?util[_0xcc40('0xf0')](_0xcc40('0xf3'),_0x140663[_0xcc40('0x3c')]):_0x140663[_0xcc40('0xa4')],'type':_0xcc40('0x104'),'enterAt':moment()[_0xcc40('0xf0')](_0xcc40('0xff')),'data1':_0x6434c8[_0xcc40('0x62')][_0xcc40('0x109')]||_0xcc40('0x10a'),'role':_0x140663['role'],'internal':_0x140663[_0xcc40('0x67')]});});return db[_0xcc40('0xfe')]['bulkCreate'](_0x403102,{'individualHooks':!![]});})['then'](function(){return _0x140663[_0xcc40('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x6434c8[_0xcc40('0x62')][_0xcc40('0x109')]||_0xcc40('0x10a'),'lastPauseAt':moment()[_0xcc40('0xf0')](_0xcc40('0xff'))});})[_0xcc40('0x18')](respondWithResult(_0x260b64,null))['catch'](handleError(_0x260b64,null));};exports[_0xcc40('0x10b')]=function(_0x4814b9,_0x12e5eb){var _0x5377a4;return db[_0xcc40('0x3f')]['find']({'where':{'id':_0x4814b9[_0xcc40('0x55')]['id']},'attributes':['id',_0xcc40('0x3c'),_0xcc40('0x3a'),'voicePause','mailPause',_0xcc40('0x10c'),_0xcc40('0x10d'),_0xcc40('0x10e'),'smsPause',_0xcc40('0x10f'),'pauseType',_0xcc40('0x110')]})[_0xcc40('0x18')](handleEntityNotFound(_0x12e5eb,null))['then'](function(_0x2e2c84){if(_0x2e2c84){_0x5377a4=_0x2e2c84;if(_0x4814b9[_0xcc40('0x62')][_0xcc40('0xa1')]&&!utils[_0xcc40('0xb3')](_0x4814b9[_0xcc40('0x62')]['channel'])){throw new db[(_0xcc40('0x96'))]['ValidationError']('Unknown\x20channel');}switch(_0x4814b9[_0xcc40('0x62')][_0xcc40('0xa1')]){case'voice':return respondWithRpcPromise(_0xcc40('0x107'),_0xcc40('0x10b'),{'id':_0x5377a4['id'],'name':_0x5377a4[_0xcc40('0x3c')],'pause':![]})[_0xcc40('0x18')](function(){return db[_0xcc40('0xb1')][_0xcc40('0x2d')]({'paused':0x0},{'where':{'UserId':_0x5377a4['id']},'individualHooks':!![]});})[_0xcc40('0x18')](function(){return db[_0xcc40('0xfe')]['find']({'where':{'channel':_0x4814b9[_0xcc40('0x62')][_0xcc40('0xa1')],'membername':_0x5377a4[_0xcc40('0x3c')],'type':_0xcc40('0x104'),'exitAt':null}});})[_0xcc40('0x18')](function(_0x465369){if(_0x465369){return _0x465369['update']({'exitAt':moment()[_0xcc40('0xf0')](_0xcc40('0xff')),'data2':_0xcc40('0x111')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x5377a4[_0xcc40('0x2d')]({'voicePause':![]});});case _0xcc40('0x51'):case _0xcc40('0x112'):case _0xcc40('0x50'):case _0xcc40('0x60'):case _0xcc40('0x53'):case _0xcc40('0x52'):return db[_0xcc40('0xfe')][_0xcc40('0x5e')]({'where':{'channel':_0x4814b9[_0xcc40('0x62')][_0xcc40('0xa1')],'membername':_0x5377a4[_0xcc40('0x3c')],'type':_0xcc40('0x104'),'exitAt':null}})[_0xcc40('0x18')](function(_0xcd3358){if(_0xcd3358){return _0xcd3358[_0xcc40('0x2d')]({'exitAt':moment()[_0xcc40('0xf0')](_0xcc40('0xff')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0xcc40('0x18')](function(){var _0x1c3594={};_[_0xcc40('0x2b')](_0x1c3594,util['format']('%s%s',_0x4814b9[_0xcc40('0x62')][_0xcc40('0xa1')],_0xcc40('0x113')),![]);return _0x5377a4[_0xcc40('0x2d')](_0x1c3594);});default:return respondWithRpcPromise(_0xcc40('0x107'),'unpause',{'id':_0x5377a4['id'],'name':_0x5377a4[_0xcc40('0x3c')],'pause':![]})[_0xcc40('0x18')](function(){return db[_0xcc40('0xb1')][_0xcc40('0x2d')]({'paused':0x0},{'where':{'UserId':_0x5377a4['id']}});})[_0xcc40('0x18')](function(){return db[_0xcc40('0xfe')][_0xcc40('0xaf')]({'where':{'membername':_0x5377a4[_0xcc40('0x3c')],'type':'PAUSE','exitAt':null}});})[_0xcc40('0x18')](function(_0x199f0d){var _0x352522=[];_0x199f0d[_0xcc40('0x101')](function(_0xfd31f0){_0x352522[_0xcc40('0x4e')](_0xfd31f0[_0xcc40('0x2d')]({'exitAt':moment()[_0xcc40('0xf0')](_0xcc40('0xff')),'data2':'manual'}));});return BPromise['all'](_0x352522);})[_0xcc40('0x18')](function(){return _0x5377a4[_0xcc40('0x2d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xcc40('0x18')](respondWithResult(_0x12e5eb,null))[_0xcc40('0x22')](handleError(_0x12e5eb,null));};exports[_0xcc40('0x114')]=function(_0x1073dc,_0x435935){var _0x9f1325={};var _0x16c828={};var _0x511193;var _0x5aafb1;return db[_0xcc40('0x3f')]['findOne']({'where':{'id':_0x1073dc[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x435935,null))[_0xcc40('0x18')](function(_0x90dcd2){if(_0x90dcd2){_0x511193=_0x90dcd2;_0x16c828['model']=_[_0xcc40('0x57')](db[_0xcc40('0x115')]['rawAttributes']);_0x16c828[_0xcc40('0x47')]=_[_0xcc40('0x57')](_0x1073dc[_0xcc40('0x47')]);_0x16c828[_0xcc40('0x58')]=_[_0xcc40('0x59')](_0x16c828[_0xcc40('0x56')],_0x16c828[_0xcc40('0x47')]);_0x9f1325[_0xcc40('0x4b')]=_[_0xcc40('0x59')](_0x16c828[_0xcc40('0x56')],qs[_0xcc40('0x5a')](_0x1073dc[_0xcc40('0x47')]['fields']));_0x9f1325[_0xcc40('0x4b')]=_0x9f1325['attributes'][_0xcc40('0x72')]?_0x9f1325[_0xcc40('0x4b')]:_0x16c828[_0xcc40('0x56')];_0x9f1325[_0xcc40('0xcc')]=qs[_0xcc40('0xcd')](_0x1073dc[_0xcc40('0x47')][_0xcc40('0xcd')]);_0x9f1325[_0xcc40('0xce')]=qs[_0xcc40('0x58')](_[_0xcc40('0xcf')](_0x1073dc[_0xcc40('0x47')],_0x16c828[_0xcc40('0x58')]));if(_0x1073dc[_0xcc40('0x47')][_0xcc40('0x43')]){_0x9f1325['where']=_[_0xcc40('0x5c')](_0x9f1325[_0xcc40('0xce')],{'$or':_[_0xcc40('0x37')](_0x9f1325[_0xcc40('0x4b')],function(_0x5a33d0){var _0x560842={};_0x560842[_0x5a33d0]={'$like':'%'+_0x1073dc[_0xcc40('0x47')][_0xcc40('0x43')]+'%'};return _0x560842;})});}_0x9f1325=_[_0xcc40('0x5c')]({},_0x9f1325,_0x1073dc['options']);return _0x511193[_0xcc40('0x114')](_0x9f1325);}})[_0xcc40('0x18')](function(_0x3d2a57){if(_0x3d2a57){_0x5aafb1=_0x3d2a57['length'];if(!_0x1073dc[_0xcc40('0x47')][_0xcc40('0xd5')]('nolimit')){_0x9f1325[_0xcc40('0x2a')]=qs[_0xcc40('0x2a')](_0x1073dc['query'][_0xcc40('0x2a')]);_0x9f1325[_0xcc40('0x27')]=qs[_0xcc40('0x27')](_0x1073dc['query']['offset']);}return _0x511193[_0xcc40('0x114')](_0x9f1325);}})[_0xcc40('0x18')](function(_0x45904b){if(_0x45904b){return _0x45904b?{'count':_0x5aafb1,'rows':_0x45904b}:null;}})[_0xcc40('0x18')](respondWithResult(_0x435935,null))[_0xcc40('0x22')](handleError(_0x435935,null));};exports[_0xcc40('0x116')]=function(_0x39d738,_0x45a578){var _0x2fae42=_0x39d738[_0xcc40('0x55')]['id'];var _0x34abdf=_0x39d738['body']?_0x39d738[_0xcc40('0x62')][_0xcc40('0x65')]:null;var _0x5eb890=[];return Promise['resolve']()['then'](function(){if(!_0x34abdf)throw new APIBadRequestError(_0xcc40('0x117'));})['then'](function(){return db[_0xcc40('0x3f')][_0xcc40('0x9a')]({'where':{'id':_0x2fae42}});})[_0xcc40('0x18')](function(_0x26b1b9){if(!_0x26b1b9)throw new APINotFoundError(util[_0xcc40('0xf0')](_0xcc40('0x118'),_0x39d738[_0xcc40('0x55')]['id']));return db['sequelize'][_0xcc40('0x119')](function(_0x3f2db3){return _0x26b1b9[_0xcc40('0x116')](_0x34abdf,{'transaction':_0x3f2db3})[_0xcc40('0x18')](function(){return db[_0xcc40('0x115')][_0xcc40('0xaf')]({'where':{'id':{'$in':_0x34abdf}}});})[_0xcc40('0x18')](function(_0x5deb53){var _0x33e759=_[_0xcc40('0x37')](_0x5deb53,function(_0x4527ff){return _0x4527ff['getAssociatedQueues']();});return Promise[_0xcc40('0x61')](_0x33e759);})[_0xcc40('0x18')](function(_0x4e63c3){_0x5eb890=_[_0xcc40('0x11a')](_0x4e63c3);var _0xabf055=_[_0xcc40('0x37')](_0x5eb890,function(_0x485871){return _0x485871[_0xcc40('0x11b')](_0x26b1b9['id'],{'transaction':_0x3f2db3});});return Promise[_0xcc40('0x61')](_0xabf055);})['then'](function(){if(!_0x26b1b9[_0xcc40('0xa2')])return;var _0x1241c3=_[_0xcc40('0x43')](_0x5eb890,function(_0xf3c0c){return _0xf3c0c['getDataValue']('channel')===_0xcc40('0x11c');});var _0x1b6b78=_[_0xcc40('0x37')](_0x1241c3,function(_0x18a928){return db[_0xcc40('0xb1')][_0xcc40('0xb2')]({'membername':_0x26b1b9[_0xcc40('0x3c')],'UserId':_0x26b1b9['id'],'queue_name':_0x18a928[_0xcc40('0x3c')],'VoiceQueueId':_0x18a928['id'],'interface':_[_0xcc40('0x6c')](_0x26b1b9[_0xcc40('0xa4')])?util[_0xcc40('0xf0')](_0xcc40('0xf3'),_0x26b1b9[_0xcc40('0x3c')]):_0x26b1b9[_0xcc40('0xa4')],'paused':_0x26b1b9['voicePause']||![],'penalty':_0x26b1b9[_0xcc40('0xa8')]},{'transaction':_0x3f2db3});});return Promise['all'](_0x1b6b78);})['then'](function(){return db[_0xcc40('0x11d')][_0xcc40('0xaf')]({'where':{'teamId':{'$in':_0x34abdf}}});})[_0xcc40('0x18')](function(_0x3722e4){var _0x54da29=_[_0xcc40('0x37')](_0x3722e4,function(_0xc1b528){return db[_0xcc40('0x11e')][_0xcc40('0x83')]({'UserId':_0x26b1b9['id'],'VoicePrefixId':_0xc1b528[_0xcc40('0x11f')]},{'transaction':_0x3f2db3});});return Promise[_0xcc40('0x61')](_0x54da29);});});})[_0xcc40('0x18')](function(){for(var _0x315717=0x0;_0x315717<_0x5eb890['length'];_0x315717++){var _0x1e5007=_0x5eb890[_0x315717][_0xcc40('0x120')](_0xcc40('0xa1'));var _0x384c4d=_0x1e5007+_0xcc40('0xab');socket[_0xcc40('0x2e')]('user'+_0x1e5007+_0xcc40('0xac'),{'UserId':_0x2fae42,['queueField']:_0x5eb890[_0x315717]['id']});}})[_0xcc40('0x18')](respondWithStatusCode(_0x45a578,null))[_0xcc40('0x22')](APIHandleError(_0x45a578));};exports['removeTeams']=function(_0x229a21,_0x24a5a7){var _0x2a2538=_0x229a21[_0xcc40('0x55')]['id'];var _0x31d0dc=null;if(_0x229a21[_0xcc40('0x47')][_0xcc40('0x65')]){_0x31d0dc=_[_0xcc40('0xb5')](_0x229a21[_0xcc40('0x47')]['ids'])?_0x229a21['query'][_0xcc40('0x65')]:[_0x229a21['query'][_0xcc40('0x65')]];}var _0x4eb527=[];return Promise['resolve']()[_0xcc40('0x18')](function(){if(!_0x31d0dc)throw new APIBadRequestError(_0xcc40('0x121'));})[_0xcc40('0x18')](function(){return db['User']['findOne']({'where':{'id':_0x2a2538}});})[_0xcc40('0x18')](function(_0x4438eb){if(!_0x4438eb)throw new APINotFoundError(util['format'](_0xcc40('0x118'),_0x229a21[_0xcc40('0x55')]['id']));return db[_0xcc40('0x6e')]['transaction'](function(_0x568d1a){return _0x4438eb[_0xcc40('0x122')](_0x31d0dc,{'transaction':_0x568d1a})[_0xcc40('0x18')](function(){return db[_0xcc40('0x115')][_0xcc40('0xaf')]({'where':{'id':{'$in':_0x31d0dc}}});})[_0xcc40('0x18')](function(_0x42aff8){var _0x25d3ac=_[_0xcc40('0x37')](_0x42aff8,function(_0x378473){return _0x378473[_0xcc40('0x123')]();});return Promise['all'](_0x25d3ac);})[_0xcc40('0x18')](function(_0x1776f3){_0x4eb527=_[_0xcc40('0x11a')](_0x1776f3);var _0x25b8da=_[_0xcc40('0x37')](_0x4eb527,function(_0x33ac91){return _0x33ac91[_0xcc40('0x124')](_0x4438eb['id'],{'transaction':_0x568d1a});});return Promise[_0xcc40('0x61')](_0x25b8da);})[_0xcc40('0x18')](function(){if(!_0x4438eb[_0xcc40('0xa2')])return;var _0x5d90b7=_[_0xcc40('0x43')](_0x4eb527,function(_0x1c994b){return _0x1c994b[_0xcc40('0x120')](_0xcc40('0xa1'))===_0xcc40('0x11c');});var _0xe66220=_[_0xcc40('0x37')](_0x5d90b7,function(_0x4a9443){return db[_0xcc40('0xb1')][_0xcc40('0x2f')]({'where':{'VoiceQueueId':_0x4a9443['id'],'UserId':_0x4438eb['id']},'transaction':_0x568d1a});});return Promise['all'](_0xe66220);})[_0xcc40('0x18')](function(){return db[_0xcc40('0x11d')]['findAll']({'where':{'teamId':{'$in':_0x31d0dc}}});})[_0xcc40('0x18')](function(_0x4eb246){var _0x17d4b6=_[_0xcc40('0x37')](_0x4eb246,function(_0x194487){return db[_0xcc40('0x11e')][_0xcc40('0x2f')]({'where':{'UserId':_0x4438eb['id'],'VoicePrefixId':_0x194487[_0xcc40('0x11f')]}},{'transaction':_0x568d1a});});return Promise['all'](_0x17d4b6);});});})[_0xcc40('0x18')](function(){for(var _0x1b5227=0x0;_0x1b5227<_0x4eb527[_0xcc40('0x72')];_0x1b5227++){var _0x1e203b=_0x4eb527[_0x1b5227][_0xcc40('0x120')](_0xcc40('0xa1'));var _0x10bbaf=_0x1e203b+_0xcc40('0xab');socket[_0xcc40('0x2e')](_0xcc40('0x33')+_0x1e203b+_0xcc40('0x125'),{'UserId':_0x2a2538,['queueField']:_0x4eb527[_0x1b5227]['id']});}})[_0xcc40('0x18')](respondWithStatusCode(_0x24a5a7,null))[_0xcc40('0x22')](APIHandleError(_0x24a5a7));};exports[_0xcc40('0x126')]=function(_0x59aee6,_0x44b6b1){var _0x4a00ea={};var _0x377a8e={};var _0x12a69a;var _0x2349c4;return db['User'][_0xcc40('0x9a')]({'where':{'id':_0x59aee6[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x44b6b1,null))['then'](function(_0x3fa3f0){if(_0x3fa3f0){_0x12a69a=_0x3fa3f0;_0x377a8e['model']=_[_0xcc40('0x57')](db['CmList'][_0xcc40('0x40')]);_0x377a8e['query']=_['keys'](_0x59aee6[_0xcc40('0x47')]);_0x377a8e['filters']=_['intersection'](_0x377a8e['model'],_0x377a8e[_0xcc40('0x47')]);_0x4a00ea[_0xcc40('0x4b')]=_['intersection'](_0x377a8e[_0xcc40('0x56')],qs['fields'](_0x59aee6['query'][_0xcc40('0x5a')]));_0x4a00ea[_0xcc40('0x4b')]=_0x4a00ea[_0xcc40('0x4b')][_0xcc40('0x72')]?_0x4a00ea[_0xcc40('0x4b')]:_0x377a8e[_0xcc40('0x56')];_0x4a00ea[_0xcc40('0xcc')]=qs[_0xcc40('0xcd')](_0x59aee6['query'][_0xcc40('0xcd')]);_0x4a00ea[_0xcc40('0xce')]=qs[_0xcc40('0x58')](_['pick'](_0x59aee6[_0xcc40('0x47')],_0x377a8e['filters']));if(_0x59aee6[_0xcc40('0x47')][_0xcc40('0x43')]){_0x4a00ea[_0xcc40('0xce')]=_[_0xcc40('0x5c')](_0x4a00ea[_0xcc40('0xce')],{'$or':_['map'](_0x4a00ea[_0xcc40('0x4b')],function(_0x39996b){var _0x3ba04c={};_0x3ba04c[_0x39996b]={'$like':'%'+_0x59aee6[_0xcc40('0x47')][_0xcc40('0x43')]+'%'};return _0x3ba04c;})});}_0x4a00ea=_[_0xcc40('0x5c')]({},_0x4a00ea,_0x59aee6[_0xcc40('0x5d')]);return _0x12a69a[_0xcc40('0x126')](_0x4a00ea);}})[_0xcc40('0x18')](function(_0x1aa9e8){if(_0x1aa9e8){_0x2349c4=_0x1aa9e8['length'];if(!_0x59aee6['query'][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x4a00ea[_0xcc40('0x2a')]=qs[_0xcc40('0x2a')](_0x59aee6[_0xcc40('0x47')][_0xcc40('0x2a')]);_0x4a00ea[_0xcc40('0x27')]=qs[_0xcc40('0x27')](_0x59aee6['query'][_0xcc40('0x27')]);}return _0x12a69a[_0xcc40('0x126')](_0x4a00ea);}})[_0xcc40('0x18')](function(_0x22207f){if(_0x22207f){return _0x22207f?{'count':_0x2349c4,'rows':_0x22207f}:null;}})['then'](respondWithResult(_0x44b6b1,null))[_0xcc40('0x22')](handleError(_0x44b6b1,null));};exports['getAgents']=function(_0x3d8920,_0x1069de){var _0x33b489={};var _0x1b6eba={};var _0x455fad;return db[_0xcc40('0x3f')][_0xcc40('0x9a')]({'where':{'id':_0x3d8920[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x1069de,null))[_0xcc40('0x18')](function(_0x1df78c){if(_0x1df78c){_0x455fad=_0x1df78c;_0x1b6eba['model']=_['keys'](db[_0xcc40('0x3f')][_0xcc40('0x40')]);_0x1b6eba[_0xcc40('0x47')]=_[_0xcc40('0x57')](_0x3d8920[_0xcc40('0x47')]);_0x1b6eba[_0xcc40('0x58')]=_[_0xcc40('0x59')](_0x1b6eba[_0xcc40('0x56')],_0x1b6eba[_0xcc40('0x47')]);_0x33b489[_0xcc40('0x4b')]=_['intersection'](_0x1b6eba['model'],qs[_0xcc40('0x5a')](_0x3d8920['query'][_0xcc40('0x5a')]));_0x33b489['attributes']=_0x33b489[_0xcc40('0x4b')][_0xcc40('0x72')]?_0x33b489[_0xcc40('0x4b')]:_0x1b6eba[_0xcc40('0x56')];_0x33b489[_0xcc40('0xcc')]=qs['sort'](_0x3d8920[_0xcc40('0x47')]['sort']);_0x33b489[_0xcc40('0xce')]=qs[_0xcc40('0x58')](_['pick'](_0x3d8920[_0xcc40('0x47')],_0x1b6eba['filters']));if(_0x3d8920[_0xcc40('0x47')][_0xcc40('0x43')]){_0x33b489[_0xcc40('0xce')]=_[_0xcc40('0x5c')](_0x33b489[_0xcc40('0xce')],{'$or':_['map'](_0x33b489[_0xcc40('0x4b')],function(_0x315cd1){var _0x542c1d={};_0x542c1d[_0x315cd1]={'$like':'%'+_0x3d8920[_0xcc40('0x47')][_0xcc40('0x43')]+'%'};return _0x542c1d;})});}_0x33b489['model']=db['User'];_0x33b489['as']=_0xcc40('0x34');_0x33b489=_['merge']({},_0x33b489,_0x3d8920[_0xcc40('0x5d')]);return _0x455fad[_0xcc40('0xfc')]({'include':[_0x33b489]});}})['then'](function(_0x382062){if(_0x382062){var _0x2d82b4={},_0x39acac=[];for(var _0x24afa8=0x0;_0x24afa8<_0x382062[_0xcc40('0x72')];_0x24afa8+=0x1){for(var _0xec08f8=0x0,_0x34bebf;_0xec08f8<_0x382062[_0x24afa8]['Agents'][_0xcc40('0x72')];_0xec08f8+=0x1){_0x34bebf=_0x382062[_0x24afa8][_0xcc40('0x34')][_0xec08f8]['get']({'plain':!![]});_0x2d82b4[_0x34bebf['id']]=_0x34bebf;}}_0x2d82b4=_[_0xcc40('0x127')](_0x2d82b4);for(var _0x45bbc6=qs[_0xcc40('0x27')](_0x3d8920[_0xcc40('0x47')][_0xcc40('0x27')]);_0x45bbc6<_0x2d82b4[_0xcc40('0x72')]&&_0x39acac[_0xcc40('0x72')]<qs['limit'](_0x3d8920[_0xcc40('0x47')][_0xcc40('0x2a')]);_0x45bbc6+=0x1){if(_0x2d82b4[_0x45bbc6]){_0x39acac[_0xcc40('0x4e')](_0x2d82b4[_0x45bbc6]);}}return{'count':_0x2d82b4[_0xcc40('0x72')],'rows':_0x39acac};}})[_0xcc40('0x18')](respondWithResult(_0x1069de,null))[_0xcc40('0x22')](handleError(_0x1069de,null));};exports[_0xcc40('0x2f')]=function(_0x239e5f,_0x618c66){if(_0x239e5f['user']['id']==_0x239e5f[_0xcc40('0x55')]['id']){return _0x618c66[_0xcc40('0x24')](0x1f4)[_0xcc40('0x3d')]({'message':_0xcc40('0x128')});}return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x239e5f[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x618c66,null))['then'](removeEntity(_0x618c66,null))[_0xcc40('0x22')](handleError(_0x618c66,null));};exports[_0xcc40('0x129')]=function(_0x772ad,_0x487053){return db[_0xcc40('0x3f')]['find']({'where':{'id':_0x772ad[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x487053,null))[_0xcc40('0x18')](function(_0x5c9a29){if(_0x5c9a29){return _0x5c9a29[_0xcc40('0x129')](_0x772ad['body'][_0xcc40('0x65')],_[_0xcc40('0x66')](_0x772ad[_0xcc40('0x62')],[_0xcc40('0x65'),'id'])||{})[_0xcc40('0xa9')](function(){for(var _0x477696=0x0;_0x477696<_0x772ad[_0xcc40('0x62')][_0xcc40('0x65')][_0xcc40('0x72')];_0x477696+=0x1){socket[_0xcc40('0x2e')](_0xcc40('0x12a'),{'ChatInteractionId':Number(_0x772ad[_0xcc40('0x62')][_0xcc40('0x65')][_0x477696]),'UserId':Number(_0x772ad[_0xcc40('0x55')]['id'])});}return _0x772ad[_0xcc40('0x62')][_0xcc40('0x65')];});}})[_0xcc40('0x18')](respondWithResult(_0x487053,null))[_0xcc40('0x22')](handleError(_0x487053,null));};exports[_0xcc40('0x12b')]=function(_0x5c3993,_0x2ef571){return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x5c3993[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x2ef571,null))[_0xcc40('0x18')](function(_0x5f01b1){if(_0x5f01b1){return _0x5f01b1['removeChatInteractions'](_0x5c3993[_0xcc40('0x47')][_0xcc40('0x65')])['then'](function(){if(_['isArray'](_0x5c3993[_0xcc40('0x47')][_0xcc40('0x65')])){for(var _0x456c60=0x0;_0x456c60<_0x5c3993[_0xcc40('0x47')][_0xcc40('0x65')][_0xcc40('0x72')];_0x456c60+=0x1){socket[_0xcc40('0x2e')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x5c3993[_0xcc40('0x47')][_0xcc40('0x65')][_0x456c60]),'UserId':Number(_0x5c3993['params']['id'])});}}else{socket[_0xcc40('0x2e')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x5c3993['query']['ids']),'UserId':Number(_0x5c3993[_0xcc40('0x55')]['id'])});}});}})[_0xcc40('0x18')](respondWithStatusCode(_0x2ef571,null))[_0xcc40('0x22')](handleError(_0x2ef571,null));};exports['addMailInteractions']=function(_0x397e95,_0x16cba2){return db['User']['find']({'where':{'id':_0x397e95['params']['id']}})['then'](handleEntityNotFound(_0x16cba2,null))[_0xcc40('0x18')](function(_0x5d3cd9){if(_0x5d3cd9){return _0x5d3cd9['addMailInteractions'](_0x397e95[_0xcc40('0x62')][_0xcc40('0x65')],_['omit'](_0x397e95[_0xcc40('0x62')],[_0xcc40('0x65'),'id'])||{})[_0xcc40('0xa9')](function(){for(var _0x7bab70=0x0;_0x7bab70<_0x397e95[_0xcc40('0x62')][_0xcc40('0x65')][_0xcc40('0x72')];_0x7bab70+=0x1){socket['emit'](_0xcc40('0x12c'),{'MailInteractionId':Number(_0x397e95[_0xcc40('0x62')]['ids'][_0x7bab70]),'UserId':Number(_0x397e95[_0xcc40('0x55')]['id'])});}return _0x397e95[_0xcc40('0x62')][_0xcc40('0x65')];});}})[_0xcc40('0x18')](respondWithResult(_0x16cba2,null))[_0xcc40('0x22')](handleError(_0x16cba2,null));};exports[_0xcc40('0x12d')]=function(_0x16b641,_0x5b0496){return db['User'][_0xcc40('0x5e')]({'where':{'id':_0x16b641[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x5b0496,null))['then'](function(_0x590869){if(_0x590869){return _0x590869['removeMailInteractions'](_0x16b641['query'][_0xcc40('0x65')])[_0xcc40('0x18')](function(){if(_[_0xcc40('0xb5')](_0x16b641[_0xcc40('0x47')]['ids'])){for(var _0x3bc346=0x0;_0x3bc346<_0x16b641[_0xcc40('0x47')]['ids']['length'];_0x3bc346+=0x1){socket[_0xcc40('0x2e')](_0xcc40('0x12e'),{'MailInteractionId':Number(_0x16b641['query'][_0xcc40('0x65')][_0x3bc346]),'UserId':Number(_0x16b641['params']['id'])});}}else{socket['emit'](_0xcc40('0x12e'),{'MailInteractionId':Number(_0x16b641[_0xcc40('0x47')][_0xcc40('0x65')]),'UserId':Number(_0x16b641[_0xcc40('0x55')]['id'])});}});}})[_0xcc40('0x18')](respondWithStatusCode(_0x5b0496,null))[_0xcc40('0x22')](handleError(_0x5b0496,null));};exports['addFaxInteractions']=function(_0x1f9d93,_0x235df4){return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x1f9d93[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x235df4,null))[_0xcc40('0x18')](function(_0x7459){if(_0x7459){return _0x7459[_0xcc40('0x12f')](_0x1f9d93['body'][_0xcc40('0x65')],_[_0xcc40('0x66')](_0x1f9d93[_0xcc40('0x62')],['ids','id'])||{})['spread'](function(){for(var _0x3693bd=0x0;_0x3693bd<_0x1f9d93[_0xcc40('0x62')]['ids'][_0xcc40('0x72')];_0x3693bd+=0x1){socket[_0xcc40('0x2e')]('user_has_fax_interactions:save',{'FaxInteractionId':Number(_0x1f9d93[_0xcc40('0x62')][_0xcc40('0x65')][_0x3693bd]),'UserId':Number(_0x1f9d93[_0xcc40('0x55')]['id'])});}return _0x1f9d93[_0xcc40('0x62')]['ids'];});}})['then'](respondWithResult(_0x235df4,null))['catch'](handleError(_0x235df4,null));};exports[_0xcc40('0x130')]=function(_0x2dcf03,_0x354a82){return db[_0xcc40('0x3f')]['find']({'where':{'id':_0x2dcf03[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x354a82,null))['then'](function(_0x5498c0){if(_0x5498c0){return _0x5498c0['removeFaxInteractions'](_0x2dcf03[_0xcc40('0x47')]['ids'])[_0xcc40('0x18')](function(){if(_[_0xcc40('0xb5')](_0x2dcf03[_0xcc40('0x47')][_0xcc40('0x65')])){for(var _0x56abab=0x0;_0x56abab<_0x2dcf03['query']['ids']['length'];_0x56abab+=0x1){socket['emit'](_0xcc40('0x131'),{'FaxInteractionId':Number(_0x2dcf03['query']['ids'][_0x56abab]),'UserId':Number(_0x2dcf03['params']['id'])});}}else{socket[_0xcc40('0x2e')](_0xcc40('0x131'),{'FaxInteractionId':Number(_0x2dcf03[_0xcc40('0x47')]['ids']),'UserId':Number(_0x2dcf03[_0xcc40('0x55')]['id'])});}});}})[_0xcc40('0x18')](respondWithStatusCode(_0x354a82,null))['catch'](handleError(_0x354a82,null));};exports['addSmsInteractions']=function(_0x130a76,_0x4e7284){return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x130a76[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x4e7284,null))[_0xcc40('0x18')](function(_0x30efad){if(_0x30efad){return _0x30efad[_0xcc40('0x132')](_0x130a76[_0xcc40('0x62')][_0xcc40('0x65')],_[_0xcc40('0x66')](_0x130a76[_0xcc40('0x62')],[_0xcc40('0x65'),'id'])||{})[_0xcc40('0xa9')](function(){for(var _0x27829d=0x0;_0x27829d<_0x130a76[_0xcc40('0x62')][_0xcc40('0x65')][_0xcc40('0x72')];_0x27829d+=0x1){socket['emit'](_0xcc40('0x133'),{'SmsInteractionId':Number(_0x130a76['body']['ids'][_0x27829d]),'UserId':Number(_0x130a76[_0xcc40('0x55')]['id'])});}return _0x130a76[_0xcc40('0x62')]['ids'];});}})[_0xcc40('0x18')](respondWithResult(_0x4e7284,null))[_0xcc40('0x22')](handleError(_0x4e7284,null));};exports[_0xcc40('0x134')]=function(_0x733463,_0xb33a1e){return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x733463[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0xb33a1e,null))[_0xcc40('0x18')](function(_0x345ffc){if(_0x345ffc){return _0x345ffc['removeSmsInteractions'](_0x733463['query'][_0xcc40('0x65')])[_0xcc40('0x18')](function(){if(_['isArray'](_0x733463[_0xcc40('0x47')][_0xcc40('0x65')])){for(var _0x592130=0x0;_0x592130<_0x733463[_0xcc40('0x47')][_0xcc40('0x65')]['length'];_0x592130+=0x1){socket[_0xcc40('0x2e')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x733463[_0xcc40('0x47')][_0xcc40('0x65')][_0x592130]),'UserId':Number(_0x733463['params']['id'])});}}else{socket['emit'](_0xcc40('0x135'),{'SmsInteractionId':Number(_0x733463['query'][_0xcc40('0x65')]),'UserId':Number(_0x733463[_0xcc40('0x55')]['id'])});}});}})[_0xcc40('0x18')](respondWithStatusCode(_0xb33a1e,null))[_0xcc40('0x22')](handleError(_0xb33a1e,null));};exports['addOpenchannelInteractions']=function(_0x497e7c,_0x5be00b){return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x497e7c[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x5be00b,null))[_0xcc40('0x18')](function(_0x3c6d72){if(_0x3c6d72){return _0x3c6d72[_0xcc40('0x136')](_0x497e7c[_0xcc40('0x62')][_0xcc40('0x65')],_[_0xcc40('0x66')](_0x497e7c['body'],[_0xcc40('0x65'),'id'])||{})['spread'](function(){for(var _0x5b6d9f=0x0;_0x5b6d9f<_0x497e7c[_0xcc40('0x62')][_0xcc40('0x65')]['length'];_0x5b6d9f+=0x1){socket[_0xcc40('0x2e')]('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0x497e7c[_0xcc40('0x62')][_0xcc40('0x65')][_0x5b6d9f]),'UserId':Number(_0x497e7c[_0xcc40('0x55')]['id'])});}return _0x497e7c[_0xcc40('0x62')][_0xcc40('0x65')];});}})[_0xcc40('0x18')](respondWithResult(_0x5be00b,null))[_0xcc40('0x22')](handleError(_0x5be00b,null));};exports[_0xcc40('0x137')]=function(_0x146f5a,_0xdad467){return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x146f5a[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0xdad467,null))[_0xcc40('0x18')](function(_0x5836ad){if(_0x5836ad){return _0x5836ad[_0xcc40('0x137')](_0x146f5a[_0xcc40('0x47')][_0xcc40('0x65')])[_0xcc40('0x18')](function(){if(_[_0xcc40('0xb5')](_0x146f5a[_0xcc40('0x47')][_0xcc40('0x65')])){for(var _0x3dd530=0x0;_0x3dd530<_0x146f5a[_0xcc40('0x47')][_0xcc40('0x65')]['length'];_0x3dd530+=0x1){socket[_0xcc40('0x2e')](_0xcc40('0x138'),{'OpenchannelInteractionId':Number(_0x146f5a[_0xcc40('0x47')]['ids'][_0x3dd530]),'UserId':Number(_0x146f5a[_0xcc40('0x55')]['id'])});}}else{socket[_0xcc40('0x2e')](_0xcc40('0x138'),{'OpenchannelInteractionId':Number(_0x146f5a[_0xcc40('0x47')][_0xcc40('0x65')]),'UserId':Number(_0x146f5a[_0xcc40('0x55')]['id'])});}});}})[_0xcc40('0x18')](respondWithStatusCode(_0xdad467,null))['catch'](handleError(_0xdad467,null));};exports[_0xcc40('0x139')]=function(_0x65eea,_0x30c07f){return db['User'][_0xcc40('0x5e')]({'where':{'id':_0x65eea[_0xcc40('0x55')]['id']}})['then'](handleEntityNotFound(_0x30c07f,null))[_0xcc40('0x18')](function(_0x43f90b){if(_0x43f90b){return _0x43f90b[_0xcc40('0x139')](_0x65eea[_0xcc40('0x62')][_0xcc40('0x65')],_[_0xcc40('0x66')](_0x65eea['body'],[_0xcc40('0x65'),'id'])||{})['spread'](function(){for(var _0x176c64=0x0;_0x176c64<_0x65eea[_0xcc40('0x62')][_0xcc40('0x65')][_0xcc40('0x72')];_0x176c64+=0x1){socket['emit'](_0xcc40('0x13a'),{'WhatsappInteractionId':Number(_0x65eea[_0xcc40('0x62')]['ids'][_0x176c64]),'UserId':Number(_0x65eea[_0xcc40('0x55')]['id'])});}return _0x65eea[_0xcc40('0x62')][_0xcc40('0x65')];});}})[_0xcc40('0x18')](respondWithResult(_0x30c07f,null))[_0xcc40('0x22')](handleError(_0x30c07f,null));};exports[_0xcc40('0x13b')]=function(_0x52492f,_0x25e7fd){return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x52492f['params']['id']}})['then'](handleEntityNotFound(_0x25e7fd,null))['then'](function(_0x372f29){if(_0x372f29){return _0x372f29[_0xcc40('0x13b')](_0x52492f[_0xcc40('0x47')][_0xcc40('0x65')]);}})[_0xcc40('0x18')](respondWithStatusCode(_0x25e7fd,null))[_0xcc40('0x22')](handleError(_0x25e7fd,null));};exports[_0xcc40('0x13c')]=function(_0x821c81,_0xf753bc){var _0x3acbc5={};var _0x11a73d={};var _0x42189b;var _0x3064df;return db[_0xcc40('0x3f')][_0xcc40('0x9a')]({'where':{'id':_0x821c81[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0xf753bc,null))['then'](function(_0x19abcf){if(_0x19abcf){_0x42189b=_0x19abcf;_0x11a73d[_0xcc40('0x56')]=_[_0xcc40('0x57')](db['VoicePrefix'][_0xcc40('0x40')]);_0x11a73d[_0xcc40('0x47')]=_['keys'](_0x821c81[_0xcc40('0x47')]);_0x11a73d[_0xcc40('0x58')]=_[_0xcc40('0x59')](_0x11a73d[_0xcc40('0x56')],_0x11a73d[_0xcc40('0x47')]);_0x3acbc5['attributes']=_['intersection'](_0x11a73d['model'],qs[_0xcc40('0x5a')](_0x821c81[_0xcc40('0x47')]['fields']));_0x3acbc5[_0xcc40('0x4b')]=_0x3acbc5[_0xcc40('0x4b')]['length']?_0x3acbc5[_0xcc40('0x4b')]:_0x11a73d[_0xcc40('0x56')];_0x3acbc5[_0xcc40('0xcc')]=qs[_0xcc40('0xcd')](_0x821c81['query'][_0xcc40('0xcd')]);_0x3acbc5['where']=qs[_0xcc40('0x58')](_['pick'](_0x821c81[_0xcc40('0x47')],_0x11a73d[_0xcc40('0x58')]));if(_0x821c81[_0xcc40('0x47')][_0xcc40('0x43')]){_0x3acbc5[_0xcc40('0xce')]=_['merge'](_0x3acbc5['where'],{'$or':_[_0xcc40('0x37')](_0x3acbc5[_0xcc40('0x4b')],function(_0x761ca4){var _0x1993c4={};_0x1993c4[_0x761ca4]={'$like':'%'+_0x821c81[_0xcc40('0x47')][_0xcc40('0x43')]+'%'};return _0x1993c4;})});}_0x3acbc5=_['merge']({},_0x3acbc5,_0x821c81[_0xcc40('0x5d')]);return _0x42189b[_0xcc40('0x13c')](_0x3acbc5);}})[_0xcc40('0x18')](function(_0x2ce201){if(_0x2ce201){_0x3064df=_0x2ce201['length'];if(!_0x821c81[_0xcc40('0x47')][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x3acbc5[_0xcc40('0x2a')]=qs[_0xcc40('0x2a')](_0x821c81[_0xcc40('0x47')][_0xcc40('0x2a')]);_0x3acbc5[_0xcc40('0x27')]=qs[_0xcc40('0x27')](_0x821c81['query'][_0xcc40('0x27')]);}return _0x42189b['getVoicePrefixes'](_0x3acbc5);}})['then'](function(_0x22a0fe){if(_0x22a0fe){return _0x22a0fe?{'count':_0x3064df,'rows':_0x22a0fe}:null;}})[_0xcc40('0x18')](respondWithResult(_0xf753bc,null))[_0xcc40('0x22')](handleError(_0xf753bc,null));};exports[_0xcc40('0x13d')]=function(_0x2b868e,_0xc0a195){var _0x52fc81={};var _0x2902c7={};var _0x299ef0;var _0x41a6fa;return db[_0xcc40('0x3f')][_0xcc40('0x9a')]({'where':{'id':_0x2b868e[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0xc0a195,null))[_0xcc40('0x18')](function(_0x83ab22){if(_0x83ab22){_0x299ef0=_0x83ab22;_0x2902c7[_0xcc40('0x56')]=_[_0xcc40('0x57')](db['FaxAccount'][_0xcc40('0x40')]);_0x2902c7[_0xcc40('0x47')]=_[_0xcc40('0x57')](_0x2b868e[_0xcc40('0x47')]);_0x2902c7[_0xcc40('0x58')]=_['intersection'](_0x2902c7[_0xcc40('0x56')],_0x2902c7[_0xcc40('0x47')]);_0x52fc81['attributes']=_[_0xcc40('0x59')](_0x2902c7[_0xcc40('0x56')],qs[_0xcc40('0x5a')](_0x2b868e[_0xcc40('0x47')][_0xcc40('0x5a')]));_0x52fc81['attributes']=_0x52fc81[_0xcc40('0x4b')][_0xcc40('0x72')]?_0x52fc81[_0xcc40('0x4b')]:_0x2902c7[_0xcc40('0x56')];_0x52fc81[_0xcc40('0xcc')]=qs['sort'](_0x2b868e[_0xcc40('0x47')]['sort']);_0x52fc81[_0xcc40('0xce')]=qs['filters'](_[_0xcc40('0xcf')](_0x2b868e[_0xcc40('0x47')],_0x2902c7['filters']));if(_0x2b868e['query'][_0xcc40('0x43')]){_0x52fc81['where']=_[_0xcc40('0x5c')](_0x52fc81[_0xcc40('0xce')],{'$or':_[_0xcc40('0x37')](_0x52fc81['attributes'],function(_0x322141){var _0x116125={};_0x116125[_0x322141]={'$like':'%'+_0x2b868e[_0xcc40('0x47')]['filter']+'%'};return _0x116125;})});}_0x52fc81=_[_0xcc40('0x5c')]({},_0x52fc81,_0x2b868e['options']);return _0x299ef0[_0xcc40('0x13d')](_0x52fc81);}})[_0xcc40('0x18')](function(_0x13af80){if(_0x13af80){_0x41a6fa=_0x13af80['length'];if(!_0x2b868e[_0xcc40('0x47')][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x52fc81['limit']=qs[_0xcc40('0x2a')](_0x2b868e[_0xcc40('0x47')]['limit']);_0x52fc81[_0xcc40('0x27')]=qs[_0xcc40('0x27')](_0x2b868e[_0xcc40('0x47')][_0xcc40('0x27')]);}return _0x299ef0[_0xcc40('0x13d')](_0x52fc81);}})[_0xcc40('0x18')](function(_0x12a0fc){if(_0x12a0fc){return _0x12a0fc?{'count':_0x41a6fa,'rows':_0x12a0fc}:null;}})[_0xcc40('0x18')](respondWithResult(_0xc0a195,null))['catch'](handleError(_0xc0a195,null));};exports[_0xcc40('0x13e')]=function(_0x52df33,_0x207e16){return db['User'][_0xcc40('0x5e')]({'where':{'id':_0x52df33[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x207e16,null))[_0xcc40('0x18')](function(_0x4882d2){if(_0x4882d2){return _0x4882d2[_0xcc40('0x13e')](_0x52df33['body'][_0xcc40('0x65')],_[_0xcc40('0x66')](_0x52df33[_0xcc40('0x62')],[_0xcc40('0x65'),'id'])||{});}})[_0xcc40('0x18')](respondWithResult(_0x207e16,null))[_0xcc40('0x22')](handleError(_0x207e16,null));};exports[_0xcc40('0x13f')]=function(_0x2058bf,_0x332216){return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x2058bf[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x332216,null))[_0xcc40('0x18')](function(_0x2fdddc){if(_0x2fdddc){return _0x2fdddc[_0xcc40('0x13f')](_0x2058bf[_0xcc40('0x47')][_0xcc40('0x65')]);}})['then'](respondWithStatusCode(_0x332216,null))['catch'](handleError(_0x332216,null));};exports[_0xcc40('0x140')]=function(_0x566762,_0x550a1c){var _0x12eb97={};var _0x2a8874={};var _0x11e84e;var _0xa479d2;return db[_0xcc40('0x3f')][_0xcc40('0x9a')]({'where':{'id':_0x566762['params']['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x550a1c,null))[_0xcc40('0x18')](function(_0xd49939){if(_0xd49939){_0x11e84e=_0xd49939;_0x2a8874[_0xcc40('0x56')]=_[_0xcc40('0x57')](db[_0xcc40('0x141')]['rawAttributes']);_0x2a8874[_0xcc40('0x47')]=_[_0xcc40('0x57')](_0x566762[_0xcc40('0x47')]);_0x2a8874[_0xcc40('0x58')]=_[_0xcc40('0x59')](_0x2a8874[_0xcc40('0x56')],_0x2a8874['query']);_0x12eb97[_0xcc40('0x4b')]=_['intersection'](_0x2a8874[_0xcc40('0x56')],qs[_0xcc40('0x5a')](_0x566762[_0xcc40('0x47')][_0xcc40('0x5a')]));_0x12eb97[_0xcc40('0x4b')]=_0x12eb97['attributes']['length']?_0x12eb97[_0xcc40('0x4b')]:_0x2a8874[_0xcc40('0x56')];_0x12eb97['order']=qs[_0xcc40('0xcd')](_0x566762[_0xcc40('0x47')][_0xcc40('0xcd')]);_0x12eb97['where']=qs['filters'](_[_0xcc40('0xcf')](_0x566762[_0xcc40('0x47')],_0x2a8874['filters']));if(_0x566762['query'][_0xcc40('0x43')]){_0x12eb97[_0xcc40('0xce')]=_[_0xcc40('0x5c')](_0x12eb97[_0xcc40('0xce')],{'$or':_['map'](_0x12eb97[_0xcc40('0x4b')],function(_0x11e2c3){var _0x483206={};_0x483206[_0x11e2c3]={'$like':'%'+_0x566762[_0xcc40('0x47')][_0xcc40('0x43')]+'%'};return _0x483206;})});}_0x12eb97=_[_0xcc40('0x5c')]({},_0x12eb97,_0x566762['options']);return _0x11e84e[_0xcc40('0x140')](_0x12eb97);}})[_0xcc40('0x18')](function(_0x222dcc){if(_0x222dcc){_0xa479d2=_0x222dcc[_0xcc40('0x72')];if(!_0x566762[_0xcc40('0x47')][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x12eb97[_0xcc40('0x2a')]=qs[_0xcc40('0x2a')](_0x566762[_0xcc40('0x47')][_0xcc40('0x2a')]);_0x12eb97[_0xcc40('0x27')]=qs[_0xcc40('0x27')](_0x566762[_0xcc40('0x47')][_0xcc40('0x27')]);}return _0x11e84e[_0xcc40('0x140')](_0x12eb97);}})['then'](function(_0x1eac5f){if(_0x1eac5f){return _0x1eac5f?{'count':_0xa479d2,'rows':_0x1eac5f}:null;}})[_0xcc40('0x18')](respondWithResult(_0x550a1c,null))[_0xcc40('0x22')](handleError(_0x550a1c,null));};exports['addMailAccounts']=function(_0x625b4a,_0x36dd57){return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x625b4a['params']['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x36dd57,null))['then'](function(_0x57fd49){if(_0x57fd49){return _0x57fd49[_0xcc40('0x142')](_0x625b4a[_0xcc40('0x62')][_0xcc40('0x65')],_[_0xcc40('0x66')](_0x625b4a[_0xcc40('0x62')],[_0xcc40('0x65'),'id'])||{});}})[_0xcc40('0x18')](respondWithResult(_0x36dd57,null))[_0xcc40('0x22')](handleError(_0x36dd57,null));};exports[_0xcc40('0x143')]=function(_0x46e8d1,_0x489768){return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x46e8d1[_0xcc40('0x55')]['id']}})['then'](handleEntityNotFound(_0x489768,null))[_0xcc40('0x18')](function(_0x43b647){if(_0x43b647){return _0x43b647[_0xcc40('0x143')](_0x46e8d1[_0xcc40('0x47')][_0xcc40('0x65')]);}})['then'](respondWithStatusCode(_0x489768,null))[_0xcc40('0x22')](handleError(_0x489768,null));};exports[_0xcc40('0x144')]=function(_0x550252,_0x3a466a){var _0x465683={};var _0x5df44b={};var _0x2c01b3;var _0x1a3fda;return db[_0xcc40('0x3f')][_0xcc40('0x9a')]({'where':{'id':_0x550252[_0xcc40('0x55')]['id']}})['then'](handleEntityNotFound(_0x3a466a,null))[_0xcc40('0x18')](function(_0x563982){if(_0x563982){_0x2c01b3=_0x563982;_0x5df44b[_0xcc40('0x56')]=_[_0xcc40('0x57')](db[_0xcc40('0x145')][_0xcc40('0x40')]);_0x5df44b[_0xcc40('0x47')]=_[_0xcc40('0x57')](_0x550252[_0xcc40('0x47')]);_0x5df44b['filters']=_[_0xcc40('0x59')](_0x5df44b[_0xcc40('0x56')],_0x5df44b[_0xcc40('0x47')]);_0x465683[_0xcc40('0x4b')]=_[_0xcc40('0x59')](_0x5df44b[_0xcc40('0x56')],qs[_0xcc40('0x5a')](_0x550252[_0xcc40('0x47')]['fields']));_0x465683[_0xcc40('0x4b')]=_0x465683[_0xcc40('0x4b')][_0xcc40('0x72')]?_0x465683['attributes']:_0x5df44b[_0xcc40('0x56')];_0x465683[_0xcc40('0xcc')]=qs['sort'](_0x550252[_0xcc40('0x47')]['sort']);_0x465683[_0xcc40('0xce')]=qs[_0xcc40('0x58')](_['pick'](_0x550252[_0xcc40('0x47')],_0x5df44b[_0xcc40('0x58')]));if(_0x550252[_0xcc40('0x47')][_0xcc40('0x43')]){_0x465683['where']=_[_0xcc40('0x5c')](_0x465683[_0xcc40('0xce')],{'$or':_[_0xcc40('0x37')](_0x465683[_0xcc40('0x4b')],function(_0x3729ef){var _0x5318c1={};_0x5318c1[_0x3729ef]={'$like':'%'+_0x550252[_0xcc40('0x47')]['filter']+'%'};return _0x5318c1;})});}_0x465683=_[_0xcc40('0x5c')]({},_0x465683,_0x550252['options']);return _0x2c01b3[_0xcc40('0x144')](_0x465683);}})[_0xcc40('0x18')](function(_0x3dcaf3){if(_0x3dcaf3){_0x1a3fda=_0x3dcaf3[_0xcc40('0x72')];if(!_0x550252['query'][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x465683['limit']=qs[_0xcc40('0x2a')](_0x550252['query']['limit']);_0x465683[_0xcc40('0x27')]=qs[_0xcc40('0x27')](_0x550252[_0xcc40('0x47')]['offset']);}return _0x2c01b3[_0xcc40('0x144')](_0x465683);}})[_0xcc40('0x18')](function(_0x17c69f){if(_0x17c69f){return _0x17c69f?{'count':_0x1a3fda,'rows':_0x17c69f}:null;}})[_0xcc40('0x18')](respondWithResult(_0x3a466a,null))[_0xcc40('0x22')](handleError(_0x3a466a,null));};exports[_0xcc40('0x146')]=function(_0x445e57,_0x2ab636){return db[_0xcc40('0x3f')]['find']({'where':{'id':_0x445e57[_0xcc40('0x55')]['id']}})['then'](handleEntityNotFound(_0x2ab636,null))[_0xcc40('0x18')](function(_0x23b30b){if(_0x23b30b){return _0x23b30b[_0xcc40('0x146')](_0x445e57['body'][_0xcc40('0x65')],_[_0xcc40('0x66')](_0x445e57['body'],[_0xcc40('0x65'),'id'])||{});}})[_0xcc40('0x18')](respondWithResult(_0x2ab636,null))[_0xcc40('0x22')](handleError(_0x2ab636,null));};exports['removeOpenchannelAccounts']=function(_0xf38134,_0x104039){return db[_0xcc40('0x3f')]['find']({'where':{'id':_0xf38134['params']['id']}})['then'](handleEntityNotFound(_0x104039,null))[_0xcc40('0x18')](function(_0x368a9b){if(_0x368a9b){return _0x368a9b[_0xcc40('0x147')](_0xf38134[_0xcc40('0x47')][_0xcc40('0x65')]);}})[_0xcc40('0x18')](respondWithStatusCode(_0x104039,null))['catch'](handleError(_0x104039,null));};exports[_0xcc40('0x148')]=function(_0xdb72eb,_0x944e19){var _0x4fec74={};var _0x2d9647={};var _0x25495b;var _0x41f226;return db['User'][_0xcc40('0x9a')]({'where':{'id':_0xdb72eb[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x944e19,null))[_0xcc40('0x18')](function(_0x42df9f){if(_0x42df9f){_0x25495b=_0x42df9f;_0x2d9647['model']=_[_0xcc40('0x57')](db['SmsAccount']['rawAttributes']);_0x2d9647['query']=_['keys'](_0xdb72eb[_0xcc40('0x47')]);_0x2d9647[_0xcc40('0x58')]=_['intersection'](_0x2d9647[_0xcc40('0x56')],_0x2d9647[_0xcc40('0x47')]);_0x4fec74['attributes']=_['intersection'](_0x2d9647['model'],qs['fields'](_0xdb72eb[_0xcc40('0x47')][_0xcc40('0x5a')]));_0x4fec74[_0xcc40('0x4b')]=_0x4fec74[_0xcc40('0x4b')][_0xcc40('0x72')]?_0x4fec74['attributes']:_0x2d9647[_0xcc40('0x56')];_0x4fec74[_0xcc40('0xcc')]=qs[_0xcc40('0xcd')](_0xdb72eb[_0xcc40('0x47')][_0xcc40('0xcd')]);_0x4fec74[_0xcc40('0xce')]=qs[_0xcc40('0x58')](_[_0xcc40('0xcf')](_0xdb72eb[_0xcc40('0x47')],_0x2d9647[_0xcc40('0x58')]));if(_0xdb72eb[_0xcc40('0x47')]['filter']){_0x4fec74['where']=_[_0xcc40('0x5c')](_0x4fec74[_0xcc40('0xce')],{'$or':_['map'](_0x4fec74[_0xcc40('0x4b')],function(_0x48a093){var _0x52e62e={};_0x52e62e[_0x48a093]={'$like':'%'+_0xdb72eb['query'][_0xcc40('0x43')]+'%'};return _0x52e62e;})});}_0x4fec74=_['merge']({},_0x4fec74,_0xdb72eb[_0xcc40('0x5d')]);return _0x25495b[_0xcc40('0x148')](_0x4fec74);}})[_0xcc40('0x18')](function(_0x32ae53){if(_0x32ae53){_0x41f226=_0x32ae53[_0xcc40('0x72')];if(!_0xdb72eb[_0xcc40('0x47')][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x4fec74[_0xcc40('0x2a')]=qs['limit'](_0xdb72eb[_0xcc40('0x47')][_0xcc40('0x2a')]);_0x4fec74[_0xcc40('0x27')]=qs['offset'](_0xdb72eb[_0xcc40('0x47')]['offset']);}return _0x25495b[_0xcc40('0x148')](_0x4fec74);}})[_0xcc40('0x18')](function(_0x4f6b13){if(_0x4f6b13){return _0x4f6b13?{'count':_0x41f226,'rows':_0x4f6b13}:null;}})[_0xcc40('0x18')](respondWithResult(_0x944e19,null))['catch'](handleError(_0x944e19,null));};exports[_0xcc40('0x149')]=function(_0x34fbbe,_0xb70410){return db['User']['find']({'where':{'id':_0x34fbbe[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0xb70410,null))[_0xcc40('0x18')](function(_0x4d1530){if(_0x4d1530){return _0x4d1530[_0xcc40('0x149')](_0x34fbbe[_0xcc40('0x62')][_0xcc40('0x65')],_[_0xcc40('0x66')](_0x34fbbe[_0xcc40('0x62')],['ids','id'])||{});}})[_0xcc40('0x18')](respondWithResult(_0xb70410,null))['catch'](handleError(_0xb70410,null));};exports[_0xcc40('0x14a')]=function(_0x3a5780,_0x1b3990){return db[_0xcc40('0x3f')]['find']({'where':{'id':_0x3a5780['params']['id']}})['then'](handleEntityNotFound(_0x1b3990,null))['then'](function(_0x260229){if(_0x260229){return _0x260229[_0xcc40('0x14a')](_0x3a5780[_0xcc40('0x47')][_0xcc40('0x65')]);}})[_0xcc40('0x18')](respondWithStatusCode(_0x1b3990,null))[_0xcc40('0x22')](handleError(_0x1b3990,null));};exports[_0xcc40('0x14b')]=function(_0x20f674,_0x5b6e62){var _0x494144={};var _0x4f6d00={};var _0x3b9dec;var _0x29f6ea;return db[_0xcc40('0x3f')]['findOne']({'where':{'id':_0x20f674['params']['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x5b6e62,null))[_0xcc40('0x18')](function(_0x53e621){if(_0x53e621){_0x3b9dec=_0x53e621;_0x4f6d00[_0xcc40('0x56')]=_[_0xcc40('0x57')](db[_0xcc40('0x14c')]['rawAttributes']);_0x4f6d00[_0xcc40('0x47')]=_[_0xcc40('0x57')](_0x20f674['query']);_0x4f6d00[_0xcc40('0x58')]=_[_0xcc40('0x59')](_0x4f6d00[_0xcc40('0x56')],_0x4f6d00['query']);_0x494144[_0xcc40('0x4b')]=_[_0xcc40('0x59')](_0x4f6d00[_0xcc40('0x56')],qs[_0xcc40('0x5a')](_0x20f674[_0xcc40('0x47')][_0xcc40('0x5a')]));_0x494144[_0xcc40('0x4b')]=_0x494144[_0xcc40('0x4b')][_0xcc40('0x72')]?_0x494144[_0xcc40('0x4b')]:_0x4f6d00['model'];_0x494144['order']=qs[_0xcc40('0xcd')](_0x20f674[_0xcc40('0x47')][_0xcc40('0xcd')]);_0x494144[_0xcc40('0xce')]=qs[_0xcc40('0x58')](_[_0xcc40('0xcf')](_0x20f674[_0xcc40('0x47')],_0x4f6d00[_0xcc40('0x58')]));if(_0x20f674[_0xcc40('0x47')][_0xcc40('0x43')]){_0x494144[_0xcc40('0xce')]=_[_0xcc40('0x5c')](_0x494144[_0xcc40('0xce')],{'$or':_[_0xcc40('0x37')](_0x494144[_0xcc40('0x4b')],function(_0x57905c){var _0x537e9f={};_0x537e9f[_0x57905c]={'$like':'%'+_0x20f674[_0xcc40('0x47')][_0xcc40('0x43')]+'%'};return _0x537e9f;})});}_0x494144=_[_0xcc40('0x5c')]({},_0x494144,_0x20f674[_0xcc40('0x5d')]);return _0x3b9dec['getChatWebsites'](_0x494144);}})[_0xcc40('0x18')](function(_0x24ba4d){if(_0x24ba4d){_0x29f6ea=_0x24ba4d[_0xcc40('0x72')];if(!_0x20f674[_0xcc40('0x47')][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x494144[_0xcc40('0x2a')]=qs[_0xcc40('0x2a')](_0x20f674[_0xcc40('0x47')][_0xcc40('0x2a')]);_0x494144[_0xcc40('0x27')]=qs[_0xcc40('0x27')](_0x20f674[_0xcc40('0x47')][_0xcc40('0x27')]);}return _0x3b9dec['getChatWebsites'](_0x494144);}})['then'](function(_0x3f16a9){if(_0x3f16a9){return _0x3f16a9?{'count':_0x29f6ea,'rows':_0x3f16a9}:null;}})['then'](respondWithResult(_0x5b6e62,null))[_0xcc40('0x22')](handleError(_0x5b6e62,null));};exports['addChatWebsites']=function(_0x13bda8,_0x126d70){return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x13bda8[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x126d70,null))['then'](function(_0xec984b){if(_0xec984b){return _0xec984b[_0xcc40('0x14d')](_0x13bda8[_0xcc40('0x62')][_0xcc40('0x65')],_[_0xcc40('0x66')](_0x13bda8[_0xcc40('0x62')],['ids','id'])||{});}})['then'](respondWithResult(_0x126d70,null))['catch'](handleError(_0x126d70,null));};exports['removeChatWebsites']=function(_0x31f0db,_0x5ec864){return db[_0xcc40('0x3f')]['find']({'where':{'id':_0x31f0db[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x5ec864,null))[_0xcc40('0x18')](function(_0x14222b){if(_0x14222b){return _0x14222b[_0xcc40('0x14e')](_0x31f0db['query']['ids']);}})[_0xcc40('0x18')](respondWithStatusCode(_0x5ec864,null))[_0xcc40('0x22')](handleError(_0x5ec864,null));};exports['getWhatsappAccounts']=function(_0x3f35f8,_0x576cc7){var _0x281b4b={};var _0x8b3f98={};var _0xa71633;var _0x426848;return db['User'][_0xcc40('0x9a')]({'where':{'id':_0x3f35f8[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x576cc7,null))[_0xcc40('0x18')](function(_0x4c802a){if(_0x4c802a){_0xa71633=_0x4c802a;_0x8b3f98['model']=_[_0xcc40('0x57')](db[_0xcc40('0x14f')][_0xcc40('0x40')]);_0x8b3f98[_0xcc40('0x47')]=_['keys'](_0x3f35f8[_0xcc40('0x47')]);_0x8b3f98[_0xcc40('0x58')]=_['intersection'](_0x8b3f98[_0xcc40('0x56')],_0x8b3f98['query']);_0x281b4b[_0xcc40('0x4b')]=_[_0xcc40('0x59')](_0x8b3f98[_0xcc40('0x56')],qs[_0xcc40('0x5a')](_0x3f35f8[_0xcc40('0x47')][_0xcc40('0x5a')]));_0x281b4b['attributes']=_0x281b4b['attributes'][_0xcc40('0x72')]?_0x281b4b['attributes']:_0x8b3f98[_0xcc40('0x56')];_0x281b4b['order']=qs[_0xcc40('0xcd')](_0x3f35f8[_0xcc40('0x47')][_0xcc40('0xcd')]);_0x281b4b[_0xcc40('0xce')]=qs[_0xcc40('0x58')](_[_0xcc40('0xcf')](_0x3f35f8[_0xcc40('0x47')],_0x8b3f98[_0xcc40('0x58')]));if(_0x3f35f8[_0xcc40('0x47')][_0xcc40('0x43')]){_0x281b4b[_0xcc40('0xce')]=_[_0xcc40('0x5c')](_0x281b4b[_0xcc40('0xce')],{'$or':_['map'](_0x281b4b[_0xcc40('0x4b')],function(_0x4574d1){var _0x1211c4={};_0x1211c4[_0x4574d1]={'$like':'%'+_0x3f35f8[_0xcc40('0x47')][_0xcc40('0x43')]+'%'};return _0x1211c4;})});}_0x281b4b=_['merge']({},_0x281b4b,_0x3f35f8[_0xcc40('0x5d')]);return _0xa71633[_0xcc40('0x150')](_0x281b4b);}})[_0xcc40('0x18')](function(_0x183f97){if(_0x183f97){_0x426848=_0x183f97[_0xcc40('0x72')];if(!_0x3f35f8[_0xcc40('0x47')][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x281b4b['limit']=qs[_0xcc40('0x2a')](_0x3f35f8[_0xcc40('0x47')]['limit']);_0x281b4b[_0xcc40('0x27')]=qs[_0xcc40('0x27')](_0x3f35f8[_0xcc40('0x47')][_0xcc40('0x27')]);}return _0xa71633[_0xcc40('0x150')](_0x281b4b);}})['then'](function(_0x141bd8){if(_0x141bd8){return _0x141bd8?{'count':_0x426848,'rows':_0x141bd8}:null;}})[_0xcc40('0x18')](respondWithResult(_0x576cc7,null))['catch'](handleError(_0x576cc7,null));};exports['addWhatsappAccounts']=function(_0x4fe996,_0x2bbfa3){return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x4fe996[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x2bbfa3,null))[_0xcc40('0x18')](function(_0x23c317){if(_0x23c317){return _0x23c317['addWhatsappAccounts'](_0x4fe996['body']['ids'],_[_0xcc40('0x66')](_0x4fe996['body'],[_0xcc40('0x65'),'id'])||{});}})[_0xcc40('0x18')](respondWithResult(_0x2bbfa3,null))[_0xcc40('0x22')](handleError(_0x2bbfa3,null));};exports[_0xcc40('0x151')]=function(_0x79867c,_0x397851){return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x79867c[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x397851,null))[_0xcc40('0x18')](function(_0x490616){if(_0x490616){return _0x490616['removeWhatsappAccounts'](_0x79867c[_0xcc40('0x47')][_0xcc40('0x65')]);}})[_0xcc40('0x18')](respondWithStatusCode(_0x397851,null))[_0xcc40('0x22')](handleError(_0x397851,null));};exports[_0xcc40('0x152')]=function(_0xa69732,_0x46c4dd){var _0x578517={};var _0x298cf7={};var _0x4c388b;var _0x221f67;return db[_0xcc40('0x3f')][_0xcc40('0x9a')]({'where':{'id':_0xa69732[_0xcc40('0x55')]['id']}})['then'](handleEntityNotFound(_0x46c4dd,null))[_0xcc40('0x18')](function(_0x6f123e){if(_0x6f123e){_0x4c388b=_0x6f123e;_0x298cf7['model']=_['keys'](db['SquareProject']['rawAttributes']);_0x298cf7[_0xcc40('0x47')]=_[_0xcc40('0x57')](_0xa69732[_0xcc40('0x47')]);_0x298cf7[_0xcc40('0x58')]=_[_0xcc40('0x59')](_0x298cf7[_0xcc40('0x56')],_0x298cf7[_0xcc40('0x47')]);_0x578517[_0xcc40('0x4b')]=_[_0xcc40('0x59')](_0x298cf7[_0xcc40('0x56')],qs[_0xcc40('0x5a')](_0xa69732[_0xcc40('0x47')]['fields']));_0x578517[_0xcc40('0x4b')]=_0x578517[_0xcc40('0x4b')]['length']?_0x578517[_0xcc40('0x4b')]:_0x298cf7[_0xcc40('0x56')];_0x578517['order']=qs[_0xcc40('0xcd')](_0xa69732[_0xcc40('0x47')][_0xcc40('0xcd')]);_0x578517[_0xcc40('0xce')]=qs[_0xcc40('0x58')](_['pick'](_0xa69732[_0xcc40('0x47')],_0x298cf7[_0xcc40('0x58')]));if(_0xa69732['query']['filter']){_0x578517[_0xcc40('0xce')]=_[_0xcc40('0x5c')](_0x578517[_0xcc40('0xce')],{'$or':_['map'](_0x578517[_0xcc40('0x4b')],function(_0x5aee35){var _0x1ca504={};_0x1ca504[_0x5aee35]={'$like':'%'+_0xa69732[_0xcc40('0x47')][_0xcc40('0x43')]+'%'};return _0x1ca504;})});}_0x578517=_[_0xcc40('0x5c')]({},_0x578517,_0xa69732[_0xcc40('0x5d')]);return _0x4c388b[_0xcc40('0x152')](_0x578517);}})[_0xcc40('0x18')](function(_0xb31471){if(_0xb31471){_0x221f67=_0xb31471[_0xcc40('0x72')];if(!_0xa69732['query'][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x578517[_0xcc40('0x2a')]=qs['limit'](_0xa69732[_0xcc40('0x47')][_0xcc40('0x2a')]);_0x578517[_0xcc40('0x27')]=qs[_0xcc40('0x27')](_0xa69732['query'][_0xcc40('0x27')]);}return _0x4c388b[_0xcc40('0x152')](_0x578517);}})[_0xcc40('0x18')](function(_0x107bff){if(_0x107bff){return _0x107bff?{'count':_0x221f67,'rows':_0x107bff}:null;}})['then'](respondWithResult(_0x46c4dd,null))[_0xcc40('0x22')](handleError(_0x46c4dd,null));};exports['addSquareProjects']=function(_0x20eb43,_0x26dd9a){return db['User'][_0xcc40('0x5e')]({'where':{'id':_0x20eb43['params']['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x26dd9a,null))[_0xcc40('0x18')](function(_0x43b0d4){if(_0x43b0d4){return _0x43b0d4[_0xcc40('0x153')](_0x20eb43[_0xcc40('0x62')][_0xcc40('0x65')],_[_0xcc40('0x66')](_0x20eb43[_0xcc40('0x62')],[_0xcc40('0x65'),'id'])||{});}})[_0xcc40('0x18')](respondWithResult(_0x26dd9a,null))[_0xcc40('0x22')](handleError(_0x26dd9a,null));};exports['removeSquareProjects']=function(_0x20d99e,_0x4f6690){return db[_0xcc40('0x3f')]['find']({'where':{'id':_0x20d99e[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x4f6690,null))['then'](function(_0x27b369){if(_0x27b369){return _0x27b369[_0xcc40('0x154')](_0x20d99e[_0xcc40('0x47')][_0xcc40('0x65')]);}})[_0xcc40('0x18')](respondWithStatusCode(_0x4f6690,null))[_0xcc40('0x22')](handleError(_0x4f6690,null));};exports['getScheduledCalls']=function(_0xe3c22d,_0x533c90){var _0x17951a={},_0x32a01b={},_0x44c0b8={'count':0x0,'rows':[]};var _0x52b90e=db[_0xcc40('0x155')][_0xcc40('0x40')];_0x32a01b[_0xcc40('0x56')]=_[_0xcc40('0x57')](_0x52b90e);_0x32a01b[_0xcc40('0x47')]=_[_0xcc40('0x57')](_0xe3c22d[_0xcc40('0x47')]);_0x32a01b[_0xcc40('0x58')]=_['intersection'](_0x32a01b['model'],_0x32a01b[_0xcc40('0x47')]);_0x32a01b['filters']=_[_0xcc40('0xc9')](_0x32a01b[_0xcc40('0x58')],[_0xcc40('0x156'),_0xcc40('0x157'),_0xcc40('0x158'),_0xcc40('0x159'),_0xcc40('0x15a'),_0xcc40('0x15b'),'$ne',_0xcc40('0x15c'),_0xcc40('0x15d'),_0xcc40('0x15e'),_0xcc40('0x15f'),'$in',_0xcc40('0x160'),_0xcc40('0x161'),_0xcc40('0x162'),_0xcc40('0x163'),_0xcc40('0x164'),'$like','$overlap',_0xcc40('0x165'),_0xcc40('0x166'),_0xcc40('0x167')]);_0x17951a[_0xcc40('0x4b')]=_['intersection'](_0x32a01b[_0xcc40('0x56')],qs['fields'](_0xe3c22d['query'][_0xcc40('0x5a')]));_0x17951a['attributes']=_0x17951a[_0xcc40('0x4b')]['length']?_0x17951a[_0xcc40('0x4b')]:_0x32a01b['model'];if(!_0xe3c22d['query'][_0xcc40('0xd5')]('nolimit')){_0x17951a['limit']=qs[_0xcc40('0x2a')](_0xe3c22d[_0xcc40('0x47')][_0xcc40('0x2a')]);_0x17951a['offset']=qs[_0xcc40('0x27')](_0xe3c22d[_0xcc40('0x47')]['offset']);}_0x17951a['order']=qs[_0xcc40('0xcd')](_0xe3c22d[_0xcc40('0x47')][_0xcc40('0xcd')]);_0x17951a[_0xcc40('0xce')]=qs[_0xcc40('0x58')](_[_0xcc40('0xcf')](_0xe3c22d['query'],_0x32a01b[_0xcc40('0x58')]));if(_0xe3c22d[_0xcc40('0x47')][_0xcc40('0x43')]){_0x17951a[_0xcc40('0xce')]=_[_0xcc40('0x5c')](_0x17951a[_0xcc40('0xce')],{'$or':_['map'](_0x17951a[_0xcc40('0x4b')],function(_0x55a5b5){var _0xf4240b={};_0xf4240b[_0x55a5b5]={'$like':'%'+_0xe3c22d['query'][_0xcc40('0x43')]+'%'};return _0xf4240b;})});}_0x17951a['where']={'$and':[_0x17951a[_0xcc40('0xce')],{'$or':[{'UserId':_0xe3c22d['params']['id']},{'OwnerId':_0xe3c22d[_0xcc40('0x55')]['id']}]}]};_0x17951a=_[_0xcc40('0x5c')]({},_0x17951a,_0xe3c22d['options']);var _0x30d866={'where':_0x17951a[_0xcc40('0xce')]};return db[_0xcc40('0x155')][_0xcc40('0x29')](_0x30d866)[_0xcc40('0x18')](function(_0x1a2c68){_0x44c0b8[_0xcc40('0x29')]=_0x1a2c68;if(_0xe3c22d['query'][_0xcc40('0x48')]){_0x17951a[_0xcc40('0x49')]=[{'attributes':['id',_0xcc40('0x168'),_0xcc40('0x169'),_0xcc40('0x16a')],'model':db[_0xcc40('0xcb')],'as':_0xcc40('0x16b')},{'attributes':['id',_0xcc40('0x3c'),_0xcc40('0x16c')],'model':db['VoiceQueue'],'as':'Queue'}];}return db[_0xcc40('0x155')][_0xcc40('0xaf')](_0x17951a);})[_0xcc40('0x18')](function(_0x42273d){_0x44c0b8[_0xcc40('0x4c')]=_0x42273d;return _0x44c0b8;})[_0xcc40('0x18')](respondWithFilteredResult(_0x533c90,_0x17951a))[_0xcc40('0x22')](handleError(_0x533c90,null));};exports[_0xcc40('0x16d')]=function(_0x17c8e3,_0xb73111){if(!_['isNil'](_0x17c8e3['user']['id'])&&(_0x17c8e3['user']['role']=='admin'||_0x17c8e3['user'][_0xcc40('0x3a')]==_0xcc40('0x33'))){return db[_0xcc40('0x3f')]['findOne']({'where':{'id':_0x17c8e3[_0xcc40('0x55')]['id']},'raw':!![]})['then'](function(_0x54dd49){return authService[_0xcc40('0x16e')](_0x54dd49);})[_0xcc40('0x18')](function(_0x3bdb9c){if(_0x3bdb9c){return _0xb73111[_0xcc40('0x24')](0xc8)[_0xcc40('0x26')]({'api_key':_0x3bdb9c[_0xcc40('0x16f')]});}else{return _0xb73111[_0xcc40('0x24')](0xcc)[_0xcc40('0x26')]({'message':_0xcc40('0x170')});}})[_0xcc40('0x22')](handleError(_0xb73111,0x193));}else{return _0xb73111['status'](0x191)[_0xcc40('0x26')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0xcc40('0x171')]=function(_0x494cd8,_0x2d1f3b){if(!_[_0xcc40('0x6c')](_0x494cd8[_0xcc40('0x33')]['id'])&&(_0x494cd8[_0xcc40('0x33')][_0xcc40('0x3a')]==_0xcc40('0x31')||_0x494cd8[_0xcc40('0x33')][_0xcc40('0x3a')]==_0xcc40('0x33'))){return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x494cd8[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](function(_0xb6617){return authService[_0xcc40('0x172')](_0xb6617);})[_0xcc40('0x18')](function(_0x477c8c){return db[_0xcc40('0x3f')]['update']({'apiKeyIat':_0x477c8c['iat'],'apiKeyNonce':_0x477c8c[_0xcc40('0x173')]},{'where':{'id':_0x494cd8[_0xcc40('0x55')]['id']}})[_0xcc40('0x18')](function(){return _0x2d1f3b[_0xcc40('0x24')](0xc8)[_0xcc40('0x26')]({'api_key':_0x477c8c[_0xcc40('0x16f')]});});})[_0xcc40('0x22')](handleError(_0x2d1f3b,0x193));}else{return _0x2d1f3b[_0xcc40('0x24')](0x191)[_0xcc40('0x26')]({'message':_0xcc40('0x174')});}};exports[_0xcc40('0x175')]=function(_0x5dcb70,_0x4c84d5){if(!_['isNil'](_0x5dcb70[_0xcc40('0x33')]['id'])&&(_0x5dcb70['user'][_0xcc40('0x3a')]==_0xcc40('0x31')||_0x5dcb70[_0xcc40('0x33')][_0xcc40('0x3a')]=='user')){return db[_0xcc40('0x3f')][_0xcc40('0x5e')]({'where':{'id':_0x5dcb70['params']['id']}})[_0xcc40('0x18')](handleEntityNotFound(_0x4c84d5,null))[_0xcc40('0x18')](function(_0xef21ec){if(_0xef21ec&&_0xef21ec['apiKeyNonce']&&_0xef21ec[_0xcc40('0x176')])return _0xef21ec;else throw{'message':_0xcc40('0x177')};})[_0xcc40('0x18')](function(){return db[_0xcc40('0x3f')]['update']({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x5dcb70[_0xcc40('0x55')]['id']}});})[_0xcc40('0x18')](respondWithStatusCode(_0x4c84d5,0xc8))[_0xcc40('0x22')](handleError(_0x4c84d5,0x193));}else{return _0x4c84d5[_0xcc40('0x24')](0x191)[_0xcc40('0x26')]({'message':_0xcc40('0x174')});}};exports[_0xcc40('0x178')]=function(_0x476ef1,_0x21e4ec){var _0x403888=_0x476ef1['user']['get']({'plain':!![]});if(!_0x403888){return _0x21e4ec[_0xcc40('0x24')](0x191)[_0xcc40('0x3d')]('Unable\x20to\x20retrieve\x20the\x20current\x20user');}else{Promise['resolve']()['then'](function(){if(_0x476ef1[_0xcc40('0x47')][_0xcc40('0x4a')]!=='true')return;return _0x476ef1[_0xcc40('0x33')][_0xcc40('0x179')]();})[_0xcc40('0x18')](function(_0x3bec8e){if(!_0x3bec8e)return;return _0x3bec8e[_0xcc40('0x30')]({'plain':!![]});})['then'](function(_0x140df8){_0x403888[_0xcc40('0x4a')]=_0x140df8;return _0x21e4ec[_0xcc40('0x24')](0xc8)[_0xcc40('0x26')](_0x403888);});}};exports[_0xcc40('0x17a')]=function(_0x4be431,_0x3e3cc5){var _0x22cb27={'offset':0x0},_0x167be2={'count':0x0,'rows':[]};Promise[_0xcc40('0x17b')]()[_0xcc40('0x18')](function(){if(!_0x4be431[_0xcc40('0x47')][_0xcc40('0x43')]&&!_0x4be431[_0xcc40('0x47')]['teams']&&!_0x4be431[_0xcc40('0x47')][_0xcc40('0x17c')])return[];return Promise[_0xcc40('0x17b')]()['then'](function(){var _0x4c1d93=[];if(!_[_0xcc40('0x92')](_0x4be431['query'][_0xcc40('0x17d')])){_0x4c1d93[_0xcc40('0x4e')](db['Team']['findAll']({'attributes':['id',_0xcc40('0x3c')],'where':{'id':_0x4be431[_0xcc40('0x47')][_0xcc40('0x17d')]}}));}if(!_[_0xcc40('0x92')](_0x4be431[_0xcc40('0x47')][_0xcc40('0x17c')])){_0x4c1d93[_0xcc40('0x4e')](db[_0xcc40('0xae')][_0xcc40('0xaf')]({'attributes':['id',_0xcc40('0x3c')],'type':'inbound','where':{'id':_0x4be431[_0xcc40('0x47')][_0xcc40('0x17c')]}}));}return Promise['all'](_0x4c1d93);})[_0xcc40('0x18')](function(_0x4a0769){var _0x1c8055=_[_0xcc40('0x17e')](_0x4a0769)[_0xcc40('0x37')](function(_0x1d704a){return _0x1d704a['getAgents']({'attributes':['id',_0xcc40('0x3c'),_0xcc40('0x67'),_0xcc40('0xa2')],'raw':!![]});});return Promise[_0xcc40('0x61')](_0x1c8055);})[_0xcc40('0x18')](function(_0x211546){var _0x4765cd=_[_0xcc40('0x17e')](_0x211546);if(!_0x4be431[_0xcc40('0x47')][_0xcc40('0x43')])return _0x4765cd;if(_['isEmpty'](_0x4765cd)){return db[_0xcc40('0x3f')][_0xcc40('0xaf')]({'attributes':['id','name','internal','online'],'where':{'role':_0xcc40('0x35'),'$or':[db['sequelize'][_0xcc40('0xce')](db[_0xcc40('0x6e')]['fn'](_0xcc40('0x17f'),db[_0xcc40('0x6e')]['col'](_0xcc40('0x3c'))),{'$like':'%'+_0x4be431[_0xcc40('0x47')][_0xcc40('0x43')][_0xcc40('0xaa')]()+'%'}),{'internal':{'$like':'%'+_0x4be431[_0xcc40('0x47')][_0xcc40('0x43')]+'%'}}]},'raw':!![]});}else{return _(_0x4765cd)[_0xcc40('0x17e')]()[_0xcc40('0x43')](function(_0x559515){return _0x559515[_0xcc40('0x3c')][_0xcc40('0xaa')]()[_0xcc40('0x39')](_0x4be431[_0xcc40('0x47')][_0xcc40('0x43')][_0xcc40('0xaa')]())||_0x559515[_0xcc40('0x67')][_0xcc40('0x180')]()[_0xcc40('0x39')](_0x4be431[_0xcc40('0x47')]['filter']);})[_0xcc40('0x38')]();}})['then'](function(_0x5128dc){var _0x263b91=_0xcc40('0x3c');var _0x22e22e=_0xcc40('0x181');if(_0x4be431[_0xcc40('0x47')][_0xcc40('0xcd')]){_0x22e22e=_0x4be431[_0xcc40('0x47')]['sort'][0x0]==='-'?_0xcc40('0x182'):_0xcc40('0x181');_0x263b91=_0x22e22e===_0xcc40('0x181')?_0x4be431[_0xcc40('0x47')]['sort']:_0x4be431[_0xcc40('0x47')][_0xcc40('0xcd')][_0xcc40('0x183')](0x1);}return _(_0x5128dc)[_0xcc40('0x184')]('id')['orderBy']([function(_0x3ab2cc){return _0x263b91==='name'?_0x3ab2cc[_0x263b91][_0xcc40('0xaa')]():_0x3ab2cc[_0x263b91];}],[_0x22e22e])[_0xcc40('0x37')](function(_0x542bfc){return _[_0xcc40('0xcf')](_0x542bfc,['id',_0xcc40('0x3c'),_0xcc40('0x67'),_0xcc40('0xa2')]);})[_0xcc40('0x38')]();})[_0xcc40('0x18')](function(_0x15bafb){return client[_0xcc40('0x17')](_0xcc40('0x34'),_0x4be431)[_0xcc40('0x18')](function(_0x3f0c94){if(_0x3f0c94['error'])throw new Error(_0xcc40('0x185'));var _0x27ed3d=_0x3f0c94['result'];var _0x5285a7=jayson[_0xcc40('0x15')]['http']({'port':0x232c});return _0x5285a7[_0xcc40('0x17')](_0xcc40('0x34'),_0x4be431)[_0xcc40('0x18')](function(_0x59503b){if(_0x59503b['error'])throw new Error(_0xcc40('0x186'));var _0x2d0c96=_0x59503b[_0xcc40('0x187')];return _[_0xcc40('0x5c')]({},_0x2d0c96,_0x27ed3d);});})[_0xcc40('0x18')](function(_0xe68422){return _[_0xcc40('0x37')](_0x15bafb,function(_0x379f38){var _0x33f5b4=_[_0xcc40('0x5e')](_0xe68422['rows'],['id',_0x379f38['id']]);if(!_0x33f5b4||!_0x379f38[_0xcc40('0xa2')]){_0x379f38['status']='offline';}else if(_0x33f5b4['voicePause']){_0x379f38[_0xcc40('0x24')]=_0xcc40('0x106');}else{_0x379f38[_0xcc40('0x24')]=_[_0xcc40('0x39')]([_0xcc40('0x188'),_0xcc40('0x189'),_0xcc40('0x18a'),'ringing',null,undefined],_0x33f5b4[_0xcc40('0x18b')])?'online':_0xcc40('0x18c');}return _0x379f38;});});});})[_0xcc40('0x18')](function(_0x40192c){if(!_0x4be431['query'][_0xcc40('0xd5')](_0xcc40('0xd6'))){_0x22cb27[_0xcc40('0x2a')]=qs[_0xcc40('0x2a')](_0x4be431[_0xcc40('0x47')][_0xcc40('0x2a')]||0xa);_0x22cb27['offset']=qs['offset'](_0x4be431[_0xcc40('0x47')]['offset']);}_0x167be2['count']=_0x40192c['length'];_0x167be2[_0xcc40('0x4c')]=_0x22cb27[_0xcc40('0x2a')]?_0x40192c['slice'](_0x22cb27[_0xcc40('0x27')],_0x22cb27[_0xcc40('0x27')]+_0x22cb27['limit']):_0x40192c;return _0x167be2;})[_0xcc40('0x18')](respondWithFilteredResult(_0x3e3cc5,_0x22cb27))[_0xcc40('0x22')](handleError(_0x3e3cc5,null));};function get_open_tabs(_0x4e39ee,_0x4a8c52){var _0x4e1595=_0x4e39ee['charAt'](0x0)[_0xcc40('0x18d')]()+_0x4e39ee[_0xcc40('0x18e')](0x1);var _0x1049a9={'type':db[_0xcc40('0x96')][_0xcc40('0x70')][_0xcc40('0x71')],'raw':!![]};return new BPromise(function(_0x15234b,_0xf1fcdb){var _0x301a75=squel[_0xcc40('0x18f')]()[_0xcc40('0x190')](_0xcc40('0x191')+_0x4e1595+_0xcc40('0x192'),'id')['field'](_0xcc40('0x193'))[_0xcc40('0x73')](_0xcc40('0x194')+_0x4e39ee+_0xcc40('0x195'),'ui')[_0xcc40('0xce')]('ui.UserId\x20=\x20?',_0x4a8c52['id']);return db[_0xcc40('0x6e')][_0xcc40('0x47')](_0x301a75[_0xcc40('0x180')](),_0x1049a9)[_0xcc40('0x18')](function(_0x2001a1){_0x4a8c52[_0x4e1595+'OpenTabs']=_0x2001a1;_0x15234b(_0x2001a1);})['catch'](function(_0x46cd9c){_0xf1fcdb(_0x46cd9c);});});}
\ No newline at end of file
+var _0xe81d=['unpause','mailPause','faxPause','openchannelPause','pauseType','lastPauseAt','manual','%s%s','Pause','QueuePause','getTeams','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','User\x20with\x20id\x20%s\x20not\x20found','transaction','Team','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Queue:save','isArray','removeTeams','getAssociatedQueues','getLists','CmList','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','omit','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$like','$notLike','$overlap','$contains','$any','firstName','lastName','CmContact','dialActive','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','inbound','getAgents','flatten','lower','col','toString','asc','desc','substring','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','toUpperCase','select','field','ui.','InteractionId','ui.UserId\x20=\x20?','OpenTabs','bluebird','path','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','update','emit','userNotification:recalc:','get','admin','Users','user','Agents','agent','Telephones','filter','ignore','map','value','find','name','UserProfileResource','destroy','stack','send','index','User','rawAttributes','fieldName','type','key','includes','getOptions','where','query','include','true','UserSetting','userSetting','push','rows','openTabs','length','dataValues','fax','mail','openchannel','whatsapp','all','show','params','model','differenceBy','keys','password','salt','filters','intersection','fields','attributes','includeAll','merge','options','chat','sms','body','role','describe','addContacts','ids','internal','Setting','findById','securePassword','isNil','min_internal','sequelize','QueryTypes','SELECT','from','VoiceMail','email','permissions','101','102','113','110','104','108','109','111','114','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','create','userProfileId','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','telephone','UserProfileSection','isEmpty','some','compact','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','oldPassword','newPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','voice','VoiceQueue','findAll','format','SIP/%s','UserVoiceQueueRt','removeQueues','Queue:remove','addAvatar','userpic','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','download','existsSync','root','server/files/images/','ChatOpenTabs','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','WhatsappOpenTabs','concat','getContacts','findOne','order','sort','hasOwnProperty','Tag','Tags','tag','nolimit','getQueues','Queue','pick','Unknown\x20role','getVoiceQueuesRt','getGroups','UserId','VoiceRecording','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','pause','updateAttributes','DEFAULT\x20PAUSE'];(function(_0x3e0cf2,_0x53e381){var _0x55444a=function(_0x137c1a){while(--_0x137c1a){_0x3e0cf2['push'](_0x3e0cf2['shift']());}};_0x55444a(++_0x53e381);}(_0xe81d,0x8d));var _0xde81=function(_0x8f787c,_0x3da65c){_0x8f787c=_0x8f787c-0x0;var _0x2fac51=_0xe81d[_0x8f787c];return _0x2fac51;};'use strict';var moment=require('moment');var BPromise=require(_0xde81('0x0'));var util=require('util');var path=require(_0xde81('0x1'));var fs=require('fs');var _=require('lodash');var squel=require(_0xde81('0x2'));var jayson=require('jayson/promise');var Redis=require(_0xde81('0x3'));var authService=require(_0xde81('0x4'));var qs=require(_0xde81('0x5'));var logger=require(_0xde81('0x6'))(_0xde81('0x7'));var utils=require(_0xde81('0x8'));var config=require(_0xde81('0x9'));var licenseUtil=require(_0xde81('0xa'));var APIBadRequestError=require(_0xde81('0xb'))[_0xde81('0xc')];var APINotFoundError=require(_0xde81('0xb'))[_0xde81('0xd')];var APIHandleError=require(_0xde81('0xb'))['handleError'];var db=require(_0xde81('0xe'))['db'];var socket=require(_0xde81('0xf'))(new Redis(config[_0xde81('0x10')]));require(_0xde81('0x11'))[_0xde81('0x12')](socket);config[_0xde81('0x10')]=_[_0xde81('0x13')](config['redis'],{'host':_0xde81('0x14'),'port':0x18eb});var client=jayson[_0xde81('0x15')][_0xde81('0x16')]({'port':0x232a});var values;function respondWithRpcPromise(_0x46f3b1,_0x5decc,_0x5ea165,_0x6de2f0){return new BPromise(function(_0xd5804e,_0x445697){var _0x385241=_0x6de2f0||client;return _0x385241[_0xde81('0x17')](_0x46f3b1,_0x5ea165)[_0xde81('0x18')](function(_0x586a9e){logger[_0xde81('0x19')](_0xde81('0x1a'),_0x5decc,_0xde81('0x1b'));logger[_0xde81('0x1c')](_0xde81('0x1d'),_0x5decc,_0xde81('0x1b'),JSON[_0xde81('0x1e')](_0x586a9e));if(_0x586a9e[_0xde81('0x1f')]){if(_0x586a9e[_0xde81('0x1f')][_0xde81('0x20')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x5decc,_0x586a9e['error'][_0xde81('0x21')]);return _0x445697(_0x586a9e['error'][_0xde81('0x21')]);}logger[_0xde81('0x1f')](_0xde81('0x1a'),_0x5decc,_0x586a9e[_0xde81('0x1f')][_0xde81('0x21')]);return _0xd5804e(_0x586a9e['error'][_0xde81('0x21')]);}else{logger[_0xde81('0x19')](_0xde81('0x1a'),_0x5decc,_0xde81('0x1b'));_0xd5804e(_0x586a9e[_0xde81('0x22')][_0xde81('0x21')]);}})[_0xde81('0x23')](function(_0x38a988){logger[_0xde81('0x1f')](_0xde81('0x1a'),_0x5decc,_0x38a988);_0x445697(_0x38a988);});});}function respondWithStatusCode(_0x3e0d7a,_0x3bfed8){_0x3bfed8=_0x3bfed8||0xcc;return function(_0x125619){if(_0x125619){return _0x3e0d7a[_0xde81('0x24')](_0x3bfed8);}return _0x3e0d7a[_0xde81('0x25')](_0x3bfed8)[_0xde81('0x26')]();};}function respondWithResult(_0x504186,_0x319aa2){_0x319aa2=_0x319aa2||0xc8;return function(_0x34a776){if(_0x34a776){return _0x504186[_0xde81('0x25')](_0x319aa2)[_0xde81('0x27')](_0x34a776);}};}function respondWithFilteredResult(_0x43220a,_0xd403e4){return function(_0x581458){if(_0x581458){var _0x469c6b=typeof _0xd403e4[_0xde81('0x28')]===_0xde81('0x29')&&typeof _0xd403e4[_0xde81('0x2a')]===_0xde81('0x29');var _0x55e1ad=_0x581458[_0xde81('0x2b')];var _0x2f3f4d=_0x469c6b?0x0:_0xd403e4[_0xde81('0x28')];var _0x1483dd=_0x469c6b?_0x581458[_0xde81('0x2b')]:_0xd403e4[_0xde81('0x28')]+_0xd403e4[_0xde81('0x2a')];var _0x39e840;if(_0x1483dd>=_0x55e1ad){_0x1483dd=_0x55e1ad;_0x39e840=0xc8;}else{_0x39e840=0xce;}_0x43220a[_0xde81('0x25')](_0x39e840);return _0x43220a[_0xde81('0x2c')]('Content-Range',_0x2f3f4d+'-'+_0x1483dd+'/'+_0x55e1ad)[_0xde81('0x27')](_0x581458);}return null;};}function saveUpdates(_0x2a5d6e){return function(_0x1ab1c1){if(_0x1ab1c1){return _0x1ab1c1[_0xde81('0x2d')](_0x2a5d6e)[_0xde81('0x18')](function(_0x1cd520){socket[_0xde81('0x2e')](_0xde81('0x2f')+_0x1cd520['id'],{});return _0x1cd520;});}return null;};}function removeEntity(_0xa89224){return function(_0x30c77b){if(_0x30c77b){return _0x30c77b['destroy']()['then'](function(){var _0x27a9c8=_0x30c77b[_0xde81('0x30')]({'plain':!![]});if(_0x27a9c8['role']===_0xde81('0x31'))return;var _0x19f3cc=[{'name':_0xde81('0x32'),'value':_0xde81('0x33'),'ignore':!![]},{'name':_0xde81('0x34'),'value':_0xde81('0x35'),'ignore':![]},{'name':_0xde81('0x36'),'value':'telephone','ignore':![]}];var _0x2649d2=_(_0x19f3cc)[_0xde81('0x37')](_0xde81('0x38'))[_0xde81('0x39')](_0xde81('0x3a'))[_0xde81('0x3a')]();if(_['includes'](_0x2649d2,_0x27a9c8['role'])){return;}var _0x52d45d=_[_0xde81('0x3b')](_0x19f3cc,['value',_0x27a9c8['role']])[_0xde81('0x3c')];return db[_0xde81('0x3d')][_0xde81('0x3e')]({'where':{'type':_0x52d45d,'resourceId':_0x27a9c8['id']}})[_0xde81('0x18')](function(){return _0x30c77b;});})[_0xde81('0x18')](function(){_0xa89224[_0xde81('0x25')](0xcc)[_0xde81('0x26')]();});}};}function handleEntityNotFound(_0x1de82a){return function(_0x24d08d){if(!_0x24d08d){_0x1de82a['sendStatus'](0x194);}return _0x24d08d;};}function handleError(_0x38f7ae,_0x5ef673){_0x5ef673=_0x5ef673||0x1f4;return function(_0x3161f4){logger[_0xde81('0x1f')](_0x3161f4[_0xde81('0x3f')]);if(_0x3161f4[_0xde81('0x3c')]){delete _0x3161f4[_0xde81('0x3c')];}_0x38f7ae[_0xde81('0x25')](_0x5ef673)[_0xde81('0x40')](_0x3161f4);};}exports[_0xde81('0x41')]=function(_0x41cb99,_0x4b9a15){var _0x1c71ad={},_0x4ba2c4={'count':0x0,'rows':[]};var _0x35219d=_(db[_0xde81('0x42')][_0xde81('0x43')])[_0xde81('0x39')](function(_0x2bb1b9){return{'name':_0x2bb1b9[_0xde81('0x44')],'type':_0x2bb1b9[_0xde81('0x45')][_0xde81('0x46')]};})['filter'](function(_0x223bba){return!_[_0xde81('0x47')](['password','salt'],_0x223bba['name']);})[_0xde81('0x3a')]();_0x1c71ad=qs[_0xde81('0x48')](_0x35219d,_0x41cb99);var _0xb356c4={'where':_0x1c71ad[_0xde81('0x49')]};return db['User'][_0xde81('0x2b')](_0xb356c4)['then'](function(_0x5d4b8c){_0x4ba2c4[_0xde81('0x2b')]=_0x5d4b8c;if(_0x41cb99[_0xde81('0x4a')]['includeAll']){_0x1c71ad[_0xde81('0x4b')]=[{'all':!![]}];}if(_0x41cb99['query']['userSetting']===_0xde81('0x4c')){_0x1c71ad[_0xde81('0x4b')]=[{'model':db[_0xde81('0x4d')],'as':_0xde81('0x4e')}];}if(!_[_0xde81('0x47')](_0x1c71ad['attributes'],'id')){_0x1c71ad['attributes'][_0xde81('0x4f')]('id');}return db[_0xde81('0x42')]['findAll'](_0x1c71ad);})[_0xde81('0x18')](function(_0x49bf08){_0x4ba2c4[_0xde81('0x50')]=_0x49bf08;if(_0x41cb99[_0xde81('0x4a')][_0xde81('0x51')]===_0xde81('0x4c')){var _0x2d180d=[];for(var _0x57082f=0x0;_0x57082f<_0x4ba2c4[_0xde81('0x50')][_0xde81('0x52')];_0x57082f++){_0x2d180d[_0xde81('0x4f')](get_open_tabs('chat',_0x4ba2c4[_0xde81('0x50')][_0x57082f][_0xde81('0x53')]));_0x2d180d[_0xde81('0x4f')](get_open_tabs('sms',_0x4ba2c4['rows'][_0x57082f][_0xde81('0x53')]));_0x2d180d['push'](get_open_tabs(_0xde81('0x54'),_0x4ba2c4[_0xde81('0x50')][_0x57082f]['dataValues']));_0x2d180d[_0xde81('0x4f')](get_open_tabs(_0xde81('0x55'),_0x4ba2c4[_0xde81('0x50')][_0x57082f][_0xde81('0x53')]));_0x2d180d[_0xde81('0x4f')](get_open_tabs(_0xde81('0x56'),_0x4ba2c4[_0xde81('0x50')][_0x57082f]['dataValues']));_0x2d180d[_0xde81('0x4f')](get_open_tabs(_0xde81('0x57'),_0x4ba2c4['rows'][_0x57082f]['dataValues']));}return BPromise[_0xde81('0x58')](_0x2d180d)[_0xde81('0x18')](function(){return _0x4ba2c4;});}else{return _0x4ba2c4;}})['then'](respondWithFilteredResult(_0x4b9a15,_0x1c71ad))[_0xde81('0x23')](handleError(_0x4b9a15,null));};exports[_0xde81('0x59')]=function(_0x5b0461,_0x3abc2e){var _0x32c135={'raw':![],'where':{'id':_0x5b0461[_0xde81('0x5a')]['id']}},_0x313299={};_0x313299[_0xde81('0x5b')]=_[_0xde81('0x5c')](_[_0xde81('0x5d')](db[_0xde81('0x42')]['rawAttributes']),[_0xde81('0x5e'),_0xde81('0x5f')]);_0x313299[_0xde81('0x4a')]=_[_0xde81('0x5d')](_0x5b0461['query']);_0x313299[_0xde81('0x60')]=_[_0xde81('0x61')](_0x313299[_0xde81('0x5b')],_0x313299[_0xde81('0x4a')]);_0x32c135['attributes']=_[_0xde81('0x61')](_0x313299[_0xde81('0x5b')],qs['fields'](_0x5b0461[_0xde81('0x4a')][_0xde81('0x62')]));_0x32c135[_0xde81('0x63')]=_0x32c135[_0xde81('0x63')][_0xde81('0x52')]?_0x32c135['attributes']:_0x313299[_0xde81('0x5b')];if(_0x5b0461[_0xde81('0x4a')][_0xde81('0x64')]){_0x32c135[_0xde81('0x4b')]=[{'all':!![]}];}if(_0x5b0461[_0xde81('0x4a')][_0xde81('0x4e')]===_0xde81('0x4c')){_0x32c135['include']=[{'model':db[_0xde81('0x4d')],'as':_0xde81('0x4e')}];}_0x32c135=_[_0xde81('0x65')]({},_0x32c135,_0x5b0461[_0xde81('0x66')]);if(!_[_0xde81('0x47')](_0x32c135[_0xde81('0x63')],'id')){_0x32c135['attributes']['push']('id');}return db[_0xde81('0x42')][_0xde81('0x3b')](_0x32c135)[_0xde81('0x18')](handleEntityNotFound(_0x3abc2e,null))[_0xde81('0x18')](function(_0x5e72c9){var _0x1e4fcc=[];values=_0x5e72c9;if(_0x5b0461[_0xde81('0x4a')][_0xde81('0x51')]===_0xde81('0x4c')){_0x1e4fcc['push'](get_open_tabs(_0xde81('0x67'),_0x5e72c9[_0xde81('0x53')]));_0x1e4fcc[_0xde81('0x4f')](get_open_tabs(_0xde81('0x68'),_0x5e72c9[_0xde81('0x53')]));_0x1e4fcc[_0xde81('0x4f')](get_open_tabs(_0xde81('0x56'),_0x5e72c9[_0xde81('0x53')]));_0x1e4fcc[_0xde81('0x4f')](get_open_tabs(_0xde81('0x57'),_0x5e72c9[_0xde81('0x53')]));_0x1e4fcc[_0xde81('0x4f')](get_open_tabs(_0xde81('0x54'),_0x5e72c9[_0xde81('0x53')]));_0x1e4fcc[_0xde81('0x4f')](get_open_tabs(_0xde81('0x55'),_0x5e72c9[_0xde81('0x53')]));return BPromise[_0xde81('0x58')](_0x1e4fcc);}else{return values;}})['then'](function(){return values;})[_0xde81('0x18')](respondWithResult(_0x3abc2e,null))[_0xde81('0x23')](handleError(_0x3abc2e,null));};exports[_0xde81('0x2d')]=function(_0x27d1d7,_0x2a96d3){if(_0x27d1d7['body']['id']){delete _0x27d1d7[_0xde81('0x69')]['id'];}delete _0x27d1d7['body'][_0xde81('0x6a')];return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x27d1d7[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x2a96d3,null))[_0xde81('0x18')](saveUpdates(_0x27d1d7[_0xde81('0x69')],null))[_0xde81('0x18')](respondWithResult(_0x2a96d3,null))['catch'](handleError(_0x2a96d3,null));};exports['describe']=function(_0x2a8995,_0x1360e0){return db['User'][_0xde81('0x6b')]()[_0xde81('0x18')](respondWithResult(_0x1360e0,null))[_0xde81('0x23')](handleError(_0x1360e0,null));};exports[_0xde81('0x6c')]=function(_0xaef21b,_0x3b3778){return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0xaef21b[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x3b3778,null))[_0xde81('0x18')](function(_0xeb8609){if(_0xeb8609){return _0xeb8609['addContacts'](_0xaef21b[_0xde81('0x69')]['ids'],_['omit'](_0xaef21b[_0xde81('0x69')],[_0xde81('0x6d'),'id'])||{});}})[_0xde81('0x18')](respondWithResult(_0x3b3778,null))[_0xde81('0x23')](handleError(_0x3b3778,null));};function validateUser(_0x38e1e1){return new BPromise(function(_0x3fa109,_0x6d1e69){if(_0x38e1e1[_0xde81('0x6e')])return _0x3fa109(_0x38e1e1);return db[_0xde81('0x6f')][_0xde81('0x70')](0x1)['then'](function(_0x206e4f){if(_0x206e4f[_0xde81('0x71')])authService['validatePasswordPattern'](_0x38e1e1['password']);db[_0xde81('0x42')]['max'](_0xde81('0x6e'))[_0xde81('0x18')](function(_0x59e03c){if(_[_0xde81('0x72')](_0x59e03c)){_0x38e1e1[_0xde81('0x6e')]=_0x206e4f[_0xde81('0x73')]||0x1;return;}if(_[_0xde81('0x72')](_0x206e4f[_0xde81('0x73')])||_0x206e4f[_0xde81('0x73')]===_0x59e03c){_0x38e1e1[_0xde81('0x6e')]=_0x59e03c+0x1;return;}if(_0x206e4f[_0xde81('0x73')]>_0x59e03c){_0x38e1e1[_0xde81('0x6e')]=_0x206e4f[_0xde81('0x73')];return;}return db[_0xde81('0x74')][_0xde81('0x4a')]('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[_0xde81('0x74')][_0xde81('0x75')][_0xde81('0x76')]})[_0xde81('0x18')](function(_0x4a98d0){if(_0x4a98d0&&_0x4a98d0[_0xde81('0x52')]){for(var _0x1d409a=0x0,_0x2fe66e=_0x4a98d0[_0xde81('0x52')];_0x1d409a<_0x2fe66e&&_[_0xde81('0x72')](_0x38e1e1[_0xde81('0x6e')]);_0x1d409a++){if(_0x206e4f['min_internal']<=_0x4a98d0[_0x1d409a]['from']){_0x38e1e1[_0xde81('0x6e')]=_0x4a98d0[_0x1d409a][_0xde81('0x77')];}else if(_0x206e4f[_0xde81('0x73')]>_0x4a98d0[_0x1d409a][_0xde81('0x77')]&&_0x206e4f['min_internal']<=_0x4a98d0[_0x1d409a]['to']){_0x38e1e1[_0xde81('0x6e')]=_0x206e4f['min_internal'];}}}if(_[_0xde81('0x72')](_0x38e1e1['internal'])){_0x38e1e1['internal']=_0x59e03c+0x1;}return _0x3fa109(_0x38e1e1);});});})[_0xde81('0x23')](function(_0x1adc7e){_0x6d1e69(_0x1adc7e);});});}function updateUser(_0x2a6e36){return new BPromise(function(_0x331dfa,_0x15953e){try{if(_0x2a6e36['voicemail']){_0x2a6e36['mailbox']=_0x2a6e36[_0xde81('0x6e')];_0x2a6e36[_0xde81('0x78')]={'mailbox':_0x2a6e36['internal'],'password':_0x2a6e36[_0xde81('0x5e')],'fullname':_0x2a6e36['fullname'],'email':_0x2a6e36[_0xde81('0x79')]};}if(_0x2a6e36[_0xde81('0x6a')]===_0xde81('0x35')){if(!_0x2a6e36[_0xde81('0x7a')])_0x2a6e36[_0xde81('0x7a')]=[_0xde81('0x7b'),_0xde81('0x7c'),'103',_0xde81('0x7d'),_0xde81('0x7e'),_0xde81('0x7f'),'105','106','107',_0xde81('0x80'),_0xde81('0x81'),'100',_0xde81('0x82'),_0xde81('0x83'),'115'];}_0x331dfa(_0x2a6e36);}catch(_0xc7e94e){_0x15953e(_0xc7e94e);}});}exports['create']=function(_0x19f3c3,_0x5aa747){if(_0x19f3c3['user'][_0xde81('0x6a')]===_0xde81('0x35'))throw new Error(_0xde81('0x84'));if(_0x19f3c3[_0xde81('0x69')][_0xde81('0x6a')]==='user'&&_0x19f3c3[_0xde81('0x33')][_0xde81('0x6a')]!==_0xde81('0x31')){throw new Error(_0xde81('0x85'));}if(_0x19f3c3['body']['role']===_0xde81('0x31')&&_0x19f3c3[_0xde81('0x33')][_0xde81('0x6a')]!==_0xde81('0x31')){throw new Error(_0xde81('0x86'));}return licenseUtil[_0xde81('0x87')]([_0x19f3c3[_0xde81('0x69')]])[_0xde81('0x18')](function(){return validateUser(_0x19f3c3[_0xde81('0x69')]);})[_0xde81('0x18')](function(_0x4acc6d){return updateUser(_0x4acc6d)['then'](function(_0x988702){if(_0x988702['role']===_0xde81('0x31')){_0x988702[_0xde81('0x88')]=_0x19f3c3[_0xde81('0x33')]['settingsEnabled'];delete _0x988702['userProfileId'];}return _0x988702;});})[_0xde81('0x18')](function(_0x3ed14c){return db[_0xde81('0x42')][_0xde81('0x89')](_0x3ed14c,{'include':[{'model':db[_0xde81('0x78')],'as':_0xde81('0x78')}]});})[_0xde81('0x18')](function(_0x47e3f6){if(_0x19f3c3[_0xde81('0x69')]['role']===_0xde81('0x33'))return _0x47e3f6;if(_0x19f3c3[_0xde81('0x33')][_0xde81('0x6a')]!=='user')return _0x47e3f6;return db['UserProfileSection'][_0xde81('0x3b')]({'where':{'name':_0x47e3f6['role']===_0xde81('0x35')?_0xde81('0x34'):'Telephones','userProfileId':_0x19f3c3[_0xde81('0x33')][_0xde81('0x8a')]},'raw':!![]})[_0xde81('0x18')](function(_0x3e3a81){if(!_0x3e3a81||_0x3e3a81[_0xde81('0x8b')]!=0x0)return _0x47e3f6;return db[_0xde81('0x3d')][_0xde81('0x89')]({'name':_0x47e3f6[_0xde81('0x3c')],'resourceId':_0x47e3f6['id'],'type':_0x3e3a81['name'],'sectionId':_0x3e3a81['id']},{})['then'](function(){return _0x47e3f6;});})[_0xde81('0x23')](function(_0x141702){logger[_0xde81('0x1f')](_0xde81('0x8c'),_0x141702);throw _0x141702;});})[_0xde81('0x18')](respondWithResult(_0x5aa747,0xc9))[_0xde81('0x23')](handleError(_0x5aa747,null));};exports[_0xde81('0x8d')]=function(_0x5f3e41,_0x2d9f01){var _0x4ae6d1=_0x5f3e41[_0xde81('0x69')];var _0x18c141=[];if(_0x5f3e41[_0xde81('0x33')][_0xde81('0x6a')]===_0xde81('0x35'))throw new Error(_0xde81('0x84'));if(_['some'](_0x4ae6d1,[_0xde81('0x6a'),'user'])&&_0x5f3e41[_0xde81('0x33')][_0xde81('0x6a')]!==_0xde81('0x31')){throw new Error(_0xde81('0x85'));}if(_['some'](_0x4ae6d1,[_0xde81('0x6a'),_0xde81('0x31')])&&_0x5f3e41[_0xde81('0x33')][_0xde81('0x6a')]!==_0xde81('0x31')){throw new Error(_0xde81('0x8e'));}return licenseUtil[_0xde81('0x87')](_0x4ae6d1)[_0xde81('0x18')](function(){return validateUser(_0x4ae6d1[0x0]);})[_0xde81('0x18')](function(){for(var _0x289c9a=0x1;_0x289c9a<_0x4ae6d1['length'];_0x289c9a++){var _0x2e4206=_0x4ae6d1[_0x289c9a-0x1][_0xde81('0x6e')];if(!_0x4ae6d1[_0x289c9a][_0xde81('0x6e')])_0x4ae6d1[_0x289c9a][_0xde81('0x6e')]=_0x2e4206+0x1;_0x18c141[_0xde81('0x4f')](validateUser(_0x4ae6d1[_0x289c9a]));}return BPromise['all'](_0x18c141);})[_0xde81('0x18')](function(){_0x18c141=[];for(var _0x26eb65=0x0;_0x26eb65<_0x4ae6d1[_0xde81('0x52')];_0x26eb65++){_0x18c141['push'](updateUser(_0x4ae6d1[_0x26eb65]));}return BPromise[_0xde81('0x58')](_0x18c141);})[_0xde81('0x18')](function(){return BPromise[_0xde81('0x8f')](_0x4ae6d1,function(_0x4ff8f7){return db['User'][_0xde81('0x89')](_0x4ff8f7,{'include':[{'model':db[_0xde81('0x78')],'as':'VoiceMail'}]})[_0xde81('0x18')](function(_0x39f46a){_0x4ff8f7['id']=_0x39f46a['id'];return _0x4ff8f7;});});})[_0xde81('0x18')](function(_0x3d35b2){if(_0x5f3e41[_0xde81('0x69')]['role']===_0xde81('0x33'))return _0x3d35b2;if(_0x5f3e41[_0xde81('0x33')]['role']!==_0xde81('0x33'))return _0x3d35b2;var _0x3b643d=_['some'](_0x3d35b2,function(_0x3779bf){return _0x3779bf[_0xde81('0x6a')]==='agent'||_0x3779bf['role']===_0xde81('0x90');});if(!_0x3b643d)return _0x3d35b2;return db[_0xde81('0x91')]['findAll']({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x5f3e41['user'][_0xde81('0x8a')]},'raw':!![]})[_0xde81('0x18')](function(_0x4aeaf2){if(_[_0xde81('0x92')](_0x4aeaf2)||!_[_0xde81('0x93')](_0x4aeaf2,[_0xde81('0x8b'),0x0]))return _0x3d35b2;_0x18c141=[];var _0x4222b1=_(_0x4aeaf2)[_0xde81('0x39')](function(_0x40d53a){if(_0x40d53a['autoAssociation']===0x1)return;return _0x40d53a['name']==='Agents'?_0xde81('0x35'):'telephone';})[_0xde81('0x94')]()[_0xde81('0x3a')]();for(var _0x50e8e2=0x0;_0x50e8e2<_0x3d35b2[_0xde81('0x52')];_0x50e8e2++){if(!_[_0xde81('0x47')](_0x4222b1,_0x3d35b2[_0x50e8e2][_0xde81('0x6a')]))return;var _0x5ab2b2=_0x3d35b2[_0x50e8e2][_0xde81('0x6a')]===_0xde81('0x35')?_0xde81('0x34'):_0xde81('0x36');_0x18c141[_0xde81('0x4f')](db['UserProfileResource'][_0xde81('0x89')]({'name':_0x3d35b2[_0x50e8e2]['name'],'resourceId':_0x3d35b2[_0x50e8e2]['id'],'type':_0x5ab2b2,'sectionId':_[_0xde81('0x3b')](_0x4aeaf2,[_0xde81('0x3c'),_0x5ab2b2])['id']},{}));}return BPromise[_0xde81('0x58')](_0x18c141);});})[_0xde81('0x18')](respondWithResult(_0x2d9f01,0xc9))[_0xde81('0x23')](handleError(_0x2d9f01,null));};exports['changePassword']=function(_0x4366cc,_0x393b0c){if(_0x4366cc[_0xde81('0x69')]['id']){delete _0x4366cc[_0xde81('0x69')]['id'];}return db[_0xde81('0x42')]['find']({'where':{'id':_0x4366cc[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](function(_0x5caeb2){if(!_0x5caeb2)return null;if(_0x5caeb2['id']===_0x4366cc[_0xde81('0x33')]['id']){if(!_0x4366cc[_0xde81('0x69')]['oldPassword']||!_0x4366cc[_0xde81('0x69')]['newPassword']){throw new db[(_0xde81('0x95'))][(_0xde81('0x96'))](_0xde81('0x97'));}if(!_0x5caeb2['authenticate'](_0x4366cc['body'][_0xde81('0x98')])){throw new db[(_0xde81('0x95'))]['ValidationError']('Wrong\x20credentials');}if(_0x4366cc[_0xde81('0x69')][_0xde81('0x98')]===_0x4366cc[_0xde81('0x69')]['newPassword']){throw new db[(_0xde81('0x95'))][(_0xde81('0x96'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x4366cc[_0xde81('0x33')][_0xde81('0x6a')]==='admin'){if(!_0x4366cc['body'][_0xde81('0x99')]){throw new db[(_0xde81('0x95'))][(_0xde81('0x96'))](_0xde81('0x9a'));}}else if(_0x4366cc[_0xde81('0x33')][_0xde81('0x6a')]===_0xde81('0x33')){if(!_0x4366cc[_0xde81('0x69')][_0xde81('0x99')]){throw new db[(_0xde81('0x95'))][(_0xde81('0x96'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x5caeb2[_0xde81('0x6a')]!==_0xde81('0x35')){throw new db[(_0xde81('0x95'))][(_0xde81('0x96'))](_0xde81('0x84'));}}else{throw new db['Sequelize'][(_0xde81('0x96'))](_0xde81('0x84'));}return _0x5caeb2;})['then'](handleEntityNotFound(_0x393b0c,null))['then'](function(_0x53efa3){return db[_0xde81('0x6f')]['findOne']({'attributes':['id','securePassword',_0xde81('0x9b'),_0xde81('0x9c')]})[_0xde81('0x18')](function(_0x49a3a3){if(_0x49a3a3[_0xde81('0x71')])authService[_0xde81('0x9d')](_0x4366cc[_0xde81('0x69')][_0xde81('0x99')]);if(!_0x49a3a3[_0xde81('0x9b')]||!_0x53efa3[_0xde81('0x9e')])return _0x53efa3;authService[_0xde81('0x9f')](_0x4366cc[_0xde81('0x69')][_0xde81('0x99')],_0x53efa3[_0xde81('0x9e')],_0x49a3a3['passwordHistoryLimit']);return _0x53efa3;})[_0xde81('0x18')](saveUpdates({'password':_0x4366cc[_0xde81('0x69')]['newPassword'],'passwordResetAt':_0x4366cc[_0xde81('0x33')]['id']==_0x4366cc[_0xde81('0x5a')]['id']?moment():null,'previousPasswords':authService[_0xde81('0xa0')](_0x4366cc[_0xde81('0x69')][_0xde81('0x99')],_0x53efa3[_0xde81('0x9e')])},null));})[_0xde81('0x18')](respondWithResult(_0x393b0c,null))['catch'](handleError(_0x393b0c,null));};exports[_0xde81('0xa1')]=function(_0xf3c12c,_0x16f80d){var _0x738628=_0xf3c12c[_0xde81('0x69')][_0xde81('0xa2')];return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0xf3c12c[_0xde81('0x5a')]['id']},'attributes':['id',_0xde81('0x3c'),_0xde81('0x6a'),_0xde81('0xa3'),_0xde81('0xa4'),_0xde81('0xa5'),_0xde81('0xa6')]})[_0xde81('0x18')](handleEntityNotFound(_0x16f80d,null))[_0xde81('0x18')](function(_0x3847d4){if(_0x3847d4){if(!utils[_0xde81('0xa7')](_0x738628)){throw new db[(_0xde81('0x95'))][(_0xde81('0x96'))](_0xde81('0xa8'));}return _0x3847d4[_0xde81('0xa9')+_[_0xde81('0xaa')](_0x738628[_0xde81('0xab')]())+_0xde81('0xac')](_0xf3c12c[_0xde81('0x69')]['ids'],{'penalty':_0xf3c12c[_0xde81('0x69')][_0xde81('0xad')]||0x0})[_0xde81('0xae')](function(_0x22fd40){for(var _0x38c1ae=0x0;_0x38c1ae<_0xf3c12c[_0xde81('0x69')][_0xde81('0x6d')][_0xde81('0x52')];_0x38c1ae+=0x1){var _0xd061ea={'UserId':Number(_0xf3c12c[_0xde81('0x5a')]['id'])};_0xd061ea[_[_0xde81('0xaa')](_0x738628[_0xde81('0xab')]())+_0xde81('0xaf')]=Number(_0xf3c12c[_0xde81('0x69')]['ids'][_0x38c1ae]);socket['emit']('user'+_[_0xde81('0xaa')](_0x738628[_0xde81('0xab')]())+'Queue:save',_0xd061ea);}return _0x22fd40;})['then'](function(){if(_0x738628===_0xde81('0xb0')){return db[_0xde81('0xb1')][_0xde81('0xb2')]({'where':{'id':_0xf3c12c['body'][_0xde81('0x6d')]||[]},'raw':!![],'attributes':['id',_0xde81('0x3c')]});}})['then'](function(_0x325df9){var _0x5c293b=_0x3847d4[_0xde81('0x30')]({'plain':!![]});var _0x5c4446=[];if(_0x738628===_0xde81('0xb0')&&_0x5c293b['role']===_0xde81('0x35')&&_0x5c293b[_0xde81('0xa3')]){for(var _0x3f6efd=0x0;_0x3f6efd<_0x325df9['length'];_0x3f6efd+=0x1){_0x5c4446[_0xde81('0x4f')]({'membername':_0x5c293b[_0xde81('0x3c')],'UserId':_0x5c293b['id'],'queue_name':_0x325df9[_0x3f6efd][_0xde81('0x3c')],'VoiceQueueId':_0x325df9[_0x3f6efd]['id'],'interface':_[_0xde81('0x72')](_0x5c293b[_0xde81('0xa6')])?util[_0xde81('0xb3')](_0xde81('0xb4'),_0x5c293b['name']):_0x5c293b[_0xde81('0xa6')],'paused':_0x5c293b['voicePause']||![],'penalty':_0xf3c12c[_0xde81('0x69')]['penalty']||0x0});}return BPromise[_0xde81('0x8f')](_0x5c4446,function(_0x1d2e46){return db[_0xde81('0xb5')]['upsert'](_0x1d2e46);});}return _0x3847d4;});}})[_0xde81('0x18')](respondWithStatusCode(_0x16f80d,null))[_0xde81('0x23')](handleError(_0x16f80d,null));};exports[_0xde81('0xb6')]=function(_0xf37967,_0x1c1ca0){var _0x110bb8,_0x101a20;return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0xf37967[_0xde81('0x5a')]['id']},'attributes':['id',_0xde81('0x3c'),_0xde81('0x6a')]})['then'](handleEntityNotFound(_0x1c1ca0,null))['then'](function(_0xab366e){if(_0xab366e){_0x110bb8=_0xab366e;if(!_0xf37967[_0xde81('0x4a')]['channel']||!utils[_0xde81('0xa7')](_0xf37967['query'][_0xde81('0xa2')])){throw new db[(_0xde81('0x95'))]['ValidationError'](_0xde81('0xa8'));}return _0xab366e['remove'+_[_0xde81('0xaa')](_0xf37967['query'][_0xde81('0xa2')][_0xde81('0xab')]())+_0xde81('0xac')](_0xf37967[_0xde81('0x4a')]['ids']);}})[_0xde81('0x18')](function(_0x38953c){if(_['isArray'](_0xf37967['query'][_0xde81('0x6d')])){for(var _0x3f3a3c=0x0;_0x3f3a3c<_0xf37967[_0xde81('0x4a')][_0xde81('0x6d')][_0xde81('0x52')];_0x3f3a3c+=0x1){_0x101a20={'UserId':Number(_0xf37967['params']['id'])};_0x101a20[_[_0xde81('0xaa')](_0xf37967['query'][_0xde81('0xa2')][_0xde81('0xab')]())+_0xde81('0xaf')]=Number(_0xf37967[_0xde81('0x4a')][_0xde81('0x6d')][_0x3f3a3c]);socket[_0xde81('0x2e')](_0xde81('0x33')+_[_0xde81('0xaa')](_0xf37967[_0xde81('0x4a')]['channel']['toLowerCase']())+_0xde81('0xb7'),_0x101a20);}}else{_0x101a20={'UserId':Number(_0xf37967[_0xde81('0x5a')]['id'])};_0x101a20[_[_0xde81('0xaa')](_0xf37967['query'][_0xde81('0xa2')][_0xde81('0xab')]())+'QueueId']=Number(_0xf37967[_0xde81('0x4a')][_0xde81('0x6d')]);socket[_0xde81('0x2e')]('user'+_[_0xde81('0xaa')](_0xf37967[_0xde81('0x4a')][_0xde81('0xa2')][_0xde81('0xab')]())+'Queue:remove',_0x101a20);}return _0x38953c;})[_0xde81('0x18')](function(){if(_0xf37967[_0xde81('0x4a')][_0xde81('0xa2')]==='voice'){return db[_0xde81('0xb5')][_0xde81('0x3e')]({'where':{'UserId':_0xf37967['params']['id'],'VoiceQueueId':_0xf37967[_0xde81('0x4a')][_0xde81('0x6d')]},'individualHooks':!![]})[_0xde81('0x18')](function(){return _0x110bb8;});}return _0x110bb8;})['then'](respondWithStatusCode(_0x1c1ca0,null))[_0xde81('0x23')](handleError(_0x1c1ca0,null));};exports[_0xde81('0xb8')]=function(_0x2c88fd,_0x375e64){_0x2c88fd[_0xde81('0x69')][_0xde81('0xb9')]=_0x2c88fd[_0xde81('0xba')][_0xde81('0xbb')];return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x2c88fd[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x375e64,null))[_0xde81('0x18')](saveUpdates(_0x2c88fd[_0xde81('0x69')],null))[_0xde81('0x18')](respondWithResult(_0x375e64,null))['catch'](handleError(_0x375e64,null));};exports[_0xde81('0xbc')]=function(_0x3c0398,_0x3f80eb){var _0x434160=path[_0xde81('0xbd')](config['root'],_0xde81('0xbe'));return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x3c0398[_0xde81('0x5a')]['id']},'attributes':['id',_0xde81('0xb9')],'raw':!![]})[_0xde81('0x18')](handleEntityNotFound(_0x3f80eb,null))['then'](function(_0x2a50f1){if(_0x2a50f1){if(_[_0xde81('0x72')](_0x2a50f1[_0xde81('0xb9')])){return _0x3f80eb[_0xde81('0xbf')](_0x434160);}else{if(!fs[_0xde81('0xc0')](path['join'](config[_0xde81('0xc1')],_0xde81('0xc2'),_0x2a50f1[_0xde81('0xb9')]))){return _0x3f80eb['download'](_0x434160);}return _0x3f80eb[_0xde81('0xbf')](path['join'](config['root'],_0xde81('0xc2'),_0x2a50f1[_0xde81('0xb9')]));}}})[_0xde81('0x23')](handleError(_0x3f80eb,null));};exports['getOpenTabs']=function(_0x846c78,_0x3985c5){return db[_0xde81('0x42')]['find']({'where':{'id':_0x846c78['params']['id']},'attributes':['id']})[_0xde81('0x18')](handleEntityNotFound(_0x3985c5,null))[_0xde81('0x18')](function(_0x48858a){var _0x555ab9=[];values=_0x48858a[_0xde81('0x53')];_0x555ab9[_0xde81('0x4f')](get_open_tabs(_0xde81('0x67'),_0x48858a[_0xde81('0x53')]));_0x555ab9[_0xde81('0x4f')](get_open_tabs(_0xde81('0x68'),_0x48858a[_0xde81('0x53')]));_0x555ab9[_0xde81('0x4f')](get_open_tabs(_0xde81('0x56'),_0x48858a['dataValues']));_0x555ab9[_0xde81('0x4f')](get_open_tabs(_0xde81('0x57'),_0x48858a[_0xde81('0x53')]));_0x555ab9[_0xde81('0x4f')](get_open_tabs(_0xde81('0x54'),_0x48858a[_0xde81('0x53')]));_0x555ab9[_0xde81('0x4f')](get_open_tabs(_0xde81('0x55'),_0x48858a[_0xde81('0x53')]));return BPromise[_0xde81('0x58')](_0x555ab9);})[_0xde81('0x18')](function(_0x4b0ec6){if(_0x4b0ec6){var _0xce67cb=_['map'](values[_0xde81('0xc3')],function(_0x1ccd1f){return{'channel':'CHAT','id':_0x1ccd1f['id'],'createdAt':_0x1ccd1f[_0xde81('0xc4')]};});var _0xb3e0cf=_[_0xde81('0x39')](values[_0xde81('0xc5')],function(_0x480bcf){return{'channel':_0xde81('0xc6'),'id':_0x480bcf['id'],'createdAt':_0x480bcf[_0xde81('0xc4')]};});var _0x216dd5=_[_0xde81('0x39')](values[_0xde81('0xc7')],function(_0x4202b1){return{'channel':_0xde81('0xc8'),'id':_0x4202b1['id'],'createdAt':_0x4202b1[_0xde81('0xc4')]};});var _0x253e65=_[_0xde81('0x39')](values[_0xde81('0xc9')],function(_0x1e00cf){return{'channel':_0xde81('0xca'),'id':_0x1e00cf['id'],'createdAt':_0x1e00cf[_0xde81('0xc4')]};});var _0xb35024=_[_0xde81('0x39')](values[_0xde81('0xcb')],function(_0x1f2878){return{'channel':'SMS','id':_0x1f2878['id'],'createdAt':_0x1f2878[_0xde81('0xc4')]};});var _0xe48651=_[_0xde81('0x39')](values[_0xde81('0xcc')],function(_0x37d49b){return{'channel':'WHATSAPP','id':_0x37d49b['id'],'createdAt':_0x37d49b[_0xde81('0xc4')]};});var _0x34df4d=_[_0xde81('0xcd')](_0xce67cb,_0xb3e0cf,_0x216dd5,_0x253e65,_0xb35024,_0xe48651);var _0xe3f150={'count':_0x34df4d[_0xde81('0x52')],'rows':_0x34df4d};return _0xe3f150;}else return null;})[_0xde81('0x18')](respondWithResult(_0x3985c5,null))['catch'](handleError(_0x3985c5,null));};exports[_0xde81('0xce')]=function(_0x13fb32,_0x475d4c){var _0x38e6e0={};var _0x3627ea={};var _0xd7d5d7;var _0x1fc654;return db[_0xde81('0x42')][_0xde81('0xcf')]({'where':{'id':_0x13fb32[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x475d4c,null))['then'](function(_0x314ec8){if(_0x314ec8){_0xd7d5d7=_0x314ec8;_0x3627ea[_0xde81('0x5b')]=_[_0xde81('0x5d')](db['CmContact'][_0xde81('0x43')]);_0x3627ea['query']=_[_0xde81('0x5d')](_0x13fb32[_0xde81('0x4a')]);_0x3627ea[_0xde81('0x60')]=_[_0xde81('0x61')](_0x3627ea['model'],_0x3627ea['query']);_0x38e6e0['attributes']=_[_0xde81('0x61')](_0x3627ea[_0xde81('0x5b')],qs[_0xde81('0x62')](_0x13fb32[_0xde81('0x4a')][_0xde81('0x62')]));_0x38e6e0['attributes']=_0x38e6e0[_0xde81('0x63')][_0xde81('0x52')]?_0x38e6e0[_0xde81('0x63')]:_0x3627ea[_0xde81('0x5b')];_0x38e6e0[_0xde81('0xd0')]=qs[_0xde81('0xd1')](_0x13fb32[_0xde81('0x4a')][_0xde81('0xd1')]);_0x38e6e0['where']=qs[_0xde81('0x60')](_['pick'](_0x13fb32[_0xde81('0x4a')],_0x3627ea['filters']));if(_0x13fb32['query'][_0xde81('0x37')]){_0x38e6e0[_0xde81('0x49')]=_[_0xde81('0x65')](_0x38e6e0[_0xde81('0x49')],{'$or':_['map'](_0x38e6e0[_0xde81('0x63')],function(_0xf808c7){var _0x137ebf={};_0x137ebf[_0xf808c7]={'$like':'%'+_0x13fb32[_0xde81('0x4a')][_0xde81('0x37')]+'%'};return _0x137ebf;})});}_0x38e6e0=_['merge']({},_0x38e6e0,_0x13fb32[_0xde81('0x66')]);return _0xd7d5d7[_0xde81('0xce')](_0x38e6e0);}})[_0xde81('0x18')](function(_0x5a9296){if(_0x5a9296){_0x1fc654=_0x5a9296[_0xde81('0x52')];if(_0x13fb32['query'][_0xde81('0xd2')](_0xde81('0x64'))){_0x38e6e0[_0xde81('0x4b')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db[_0xde81('0xd3')],'as':_0xde81('0xd4'),'attributes':['id','name','color'],'where':_0x13fb32[_0xde81('0x4a')][_0xde81('0xd5')]?{'id':_0x13fb32[_0xde81('0x4a')][_0xde81('0xd5')]}:undefined,'required':_0x13fb32[_0xde81('0x4a')]['tag']?!![]:![]}];}if(!_0x13fb32[_0xde81('0x4a')]['hasOwnProperty'](_0xde81('0xd6'))){_0x38e6e0['limit']=qs['limit'](_0x13fb32['query']['limit']);_0x38e6e0[_0xde81('0x28')]=qs[_0xde81('0x28')](_0x13fb32[_0xde81('0x4a')]['offset']);}return _0xd7d5d7[_0xde81('0xce')](_0x38e6e0);}})[_0xde81('0x18')](function(_0x3fb7f3){if(_0x3fb7f3){return _0x3fb7f3?{'count':_0x1fc654,'rows':_0x3fb7f3}:null;}})[_0xde81('0x18')](respondWithResult(_0x475d4c,null))[_0xde81('0x23')](handleError(_0x475d4c,null));};exports[_0xde81('0xd7')]=function(_0x77150,_0x35eebf){var _0x675af;var _0x376ee0={};var _0x6e6a33;return db['User'][_0xde81('0xcf')]({'where':{'id':_0x77150[_0xde81('0x5a')]['id']},'attributes':['id',_0xde81('0x3c'),_0xde81('0x6a')]})[_0xde81('0x18')](handleEntityNotFound(_0x35eebf,null))[_0xde81('0x18')](function(_0x3ef19f){if(!utils[_0xde81('0xa7')](_0x77150[_0xde81('0x4a')]['channel'])){throw new db['Sequelize'][(_0xde81('0x96'))](_0xde81('0xa8'));}_0x675af=_0x3ef19f;var _0x2cbf35={};_0x2cbf35[_0xde81('0x5b')]=_[_0xde81('0x5d')](db[_['capitalize'](_0x77150[_0xde81('0x4a')]['channel'])+_0xde81('0xd8')]['rawAttributes']);_0x2cbf35[_0xde81('0x4a')]=_[_0xde81('0x5d')](_0x77150[_0xde81('0x4a')]);_0x2cbf35[_0xde81('0x60')]=_['intersection'](_0x2cbf35[_0xde81('0x5b')],_0x2cbf35[_0xde81('0x4a')]);_0x376ee0['attributes']=_[_0xde81('0x61')](_0x2cbf35[_0xde81('0x5b')],qs['fields'](_0x77150[_0xde81('0x4a')]['fields']));_0x376ee0['attributes']=_0x376ee0[_0xde81('0x63')][_0xde81('0x52')]?_0x376ee0[_0xde81('0x63')]:_0x2cbf35[_0xde81('0x5b')];_0x376ee0[_0xde81('0xd0')]=qs['sort'](_0x77150[_0xde81('0x4a')]['sort']);_0x376ee0[_0xde81('0x49')]=qs['filters'](_[_0xde81('0xd9')](_0x77150[_0xde81('0x4a')],_0x2cbf35['filters']));if(_0x77150[_0xde81('0x4a')][_0xde81('0x37')]){_0x376ee0[_0xde81('0x49')]=_[_0xde81('0x65')](_0x376ee0[_0xde81('0x49')],{'$or':_[_0xde81('0x39')](_0x376ee0['attributes'],function(_0xc9d157){var _0x320090={};_0x320090[_0xc9d157]={'$like':'%'+_0x77150[_0xde81('0x4a')]['filter']+'%'};return _0x320090;})});}_0x376ee0=_['merge']({},_0x376ee0,_0x77150[_0xde81('0x66')]);switch(_0x675af['role']){case _0xde81('0x31'):return db[_['capitalize'](_0x77150[_0xde81('0x4a')][_0xde81('0xa2')])+_0xde81('0xd8')][_0xde81('0xb2')](_0x376ee0);case _0xde81('0x33'):case _0xde81('0x35'):return _0x675af[_0xde81('0x30')+_[_0xde81('0xaa')](_0x77150[_0xde81('0x4a')][_0xde81('0xa2')])+_0xde81('0xac')](_0x376ee0);default:throw new db[(_0xde81('0x95'))][(_0xde81('0x96'))](_0xde81('0xda'));}})[_0xde81('0x18')](function(_0x455caa){_0x6e6a33=_0x455caa[_0xde81('0x52')];if(!_0x77150[_0xde81('0x4a')]['hasOwnProperty']('nolimit')){_0x376ee0[_0xde81('0x2a')]=qs['limit'](_0x77150[_0xde81('0x4a')][_0xde81('0x2a')]);_0x376ee0['offset']=qs[_0xde81('0x28')](_0x77150[_0xde81('0x4a')][_0xde81('0x28')]);}switch(_0x675af['role']){case _0xde81('0x31'):return db[_[_0xde81('0xaa')](_0x77150[_0xde81('0x4a')]['channel'])+'Queue'][_0xde81('0xb2')](_0x376ee0);case _0xde81('0x33'):case'agent':return _0x675af[_0xde81('0x30')+_['capitalize'](_0x77150[_0xde81('0x4a')][_0xde81('0xa2')])+_0xde81('0xac')](_0x376ee0);}})[_0xde81('0x18')](function(_0x3397f9){return{'count':_0x6e6a33,'rows':_0x3397f9};})[_0xde81('0x18')](respondWithResult(_0x35eebf,null))[_0xde81('0x23')](handleError(_0x35eebf,null));};exports[_0xde81('0xdb')]=function(_0x1f1b5b,_0xdafe45){var _0x42a261={};var _0x5a3882={};var _0x388272;var _0x4e4bb7;return db[_0xde81('0x42')][_0xde81('0xcf')]({'where':{'id':_0x1f1b5b[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0xdafe45,null))[_0xde81('0x18')](function(_0x47bdf4){if(_0x47bdf4){_0x388272=_0x47bdf4;_0x5a3882[_0xde81('0x5b')]=_[_0xde81('0x5d')](db['UserVoiceQueueRt'][_0xde81('0x43')]);_0x5a3882[_0xde81('0x4a')]=_['keys'](_0x1f1b5b['query']);_0x5a3882[_0xde81('0x60')]=_['intersection'](_0x5a3882[_0xde81('0x5b')],_0x5a3882[_0xde81('0x4a')]);_0x42a261['attributes']=_['intersection'](_0x5a3882['model'],qs['fields'](_0x1f1b5b['query'][_0xde81('0x62')]));_0x42a261[_0xde81('0x63')]=_0x42a261['attributes'][_0xde81('0x52')]?_0x42a261['attributes']:_0x5a3882[_0xde81('0x5b')];_0x42a261['order']=qs[_0xde81('0xd1')](_0x1f1b5b['query'][_0xde81('0xd1')]);_0x42a261[_0xde81('0x49')]=qs['filters'](_[_0xde81('0xd9')](_0x1f1b5b[_0xde81('0x4a')],_0x5a3882[_0xde81('0x60')]));if(_0x1f1b5b[_0xde81('0x4a')][_0xde81('0x37')]){_0x42a261[_0xde81('0x49')]=_[_0xde81('0x65')](_0x42a261[_0xde81('0x49')],{'$or':_['map'](_0x42a261[_0xde81('0x63')],function(_0x68a1a7){var _0x37055b={};_0x37055b[_0x68a1a7]={'$like':'%'+_0x1f1b5b['query'][_0xde81('0x37')]+'%'};return _0x37055b;})});}_0x42a261=_[_0xde81('0x65')]({},_0x42a261,_0x1f1b5b['options']);return _0x388272['getVoiceQueuesRt'](_0x42a261);}})[_0xde81('0x18')](function(_0x58b422){if(_0x58b422){_0x4e4bb7=_0x58b422['length'];if(!_0x1f1b5b[_0xde81('0x4a')][_0xde81('0xd2')]('nolimit')){_0x42a261[_0xde81('0x2a')]=qs[_0xde81('0x2a')](_0x1f1b5b['query']['limit']);_0x42a261[_0xde81('0x28')]=qs[_0xde81('0x28')](_0x1f1b5b[_0xde81('0x4a')][_0xde81('0x28')]);}return _0x388272[_0xde81('0xdb')](_0x42a261);}})[_0xde81('0x18')](function(_0xddccb3){if(_0xddccb3){return _0xddccb3?{'count':_0x4e4bb7,'rows':_0xddccb3}:null;}})[_0xde81('0x18')](respondWithResult(_0xdafe45,null))[_0xde81('0x23')](handleError(_0xdafe45,null));};exports[_0xde81('0xdc')]=function(_0x3a19ab,_0x3e9d9d){var _0x5cc317={};var _0x242436={};var _0x5c22ec;var _0x456a49;return db[_0xde81('0x42')][_0xde81('0xcf')]({'where':{'id':_0x3a19ab[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x3e9d9d,null))[_0xde81('0x18')](function(_0x14ff3c){if(_0x14ff3c){_0x5c22ec=_0x14ff3c;_0x242436[_0xde81('0x5b')]=_[_0xde81('0x5d')](db['ChatGroup'][_0xde81('0x43')]);_0x242436[_0xde81('0x4a')]=_[_0xde81('0x5d')](_0x3a19ab[_0xde81('0x4a')]);_0x242436[_0xde81('0x60')]=_[_0xde81('0x61')](_0x242436[_0xde81('0x5b')],_0x242436[_0xde81('0x4a')]);_0x5cc317[_0xde81('0x63')]=_[_0xde81('0x61')](_0x242436[_0xde81('0x5b')],qs[_0xde81('0x62')](_0x3a19ab['query'][_0xde81('0x62')]));_0x5cc317[_0xde81('0x63')]=_0x5cc317[_0xde81('0x63')][_0xde81('0x52')]?_0x5cc317['attributes']:_0x242436[_0xde81('0x5b')];_0x5cc317['order']=qs[_0xde81('0xd1')](_0x3a19ab[_0xde81('0x4a')][_0xde81('0xd1')]);_0x5cc317[_0xde81('0x49')]=qs[_0xde81('0x60')](_['pick'](_0x3a19ab[_0xde81('0x4a')],_0x242436['filters']));if(_0x3a19ab[_0xde81('0x4a')][_0xde81('0x37')]){_0x5cc317[_0xde81('0x49')]=_[_0xde81('0x65')](_0x5cc317['where'],{'$or':_[_0xde81('0x39')](_0x5cc317[_0xde81('0x63')],function(_0x2aede){var _0xa74c8={};_0xa74c8[_0x2aede]={'$like':'%'+_0x3a19ab[_0xde81('0x4a')][_0xde81('0x37')]+'%'};return _0xa74c8;})});}_0x5cc317=_[_0xde81('0x65')]({},_0x5cc317,_0x3a19ab['options']);return _0x5c22ec[_0xde81('0xdc')](_0x5cc317);}})[_0xde81('0x18')](function(_0x24bfc9){if(_0x24bfc9){_0x456a49=_0x24bfc9[_0xde81('0x52')];if(!_0x3a19ab[_0xde81('0x4a')][_0xde81('0xd2')](_0xde81('0xd6'))){_0x5cc317['limit']=qs['limit'](_0x3a19ab[_0xde81('0x4a')][_0xde81('0x2a')]);_0x5cc317[_0xde81('0x28')]=qs[_0xde81('0x28')](_0x3a19ab[_0xde81('0x4a')][_0xde81('0x28')]);}return _0x5c22ec[_0xde81('0xdc')](_0x5cc317);}})[_0xde81('0x18')](function(_0x139ca9){if(_0x139ca9){return _0x139ca9?{'count':_0x456a49,'rows':_0x139ca9}:null;}})['then'](respondWithResult(_0x3e9d9d,null))[_0xde81('0x23')](handleError(_0x3e9d9d,null));};exports['getRecordings']=function(_0x1003cd,_0x44e5af){var _0x22a151={'raw':!![],'where':{}};var _0x36acec={};var _0x95dcb9={'count':0x0,'rows':[]};return db[_0xde81('0x42')][_0xde81('0xcf')]({'where':{'id':_0x1003cd[_0xde81('0x5a')]['id']}})['then'](handleEntityNotFound(_0x44e5af,null))[_0xde81('0x18')](function(_0x5e00f0){if(_0x5e00f0){_0x36acec[_0xde81('0x5b')]=_[_0xde81('0x5d')](db['VoiceRecording'][_0xde81('0x43')]);_0x36acec['query']=_[_0xde81('0x5d')](_0x1003cd[_0xde81('0x4a')]);_0x36acec[_0xde81('0x60')]=_['intersection'](_0x36acec['model'],_0x36acec['query']);_0x22a151[_0xde81('0x63')]=_[_0xde81('0x61')](_0x36acec[_0xde81('0x5b')],qs['fields'](_0x1003cd['query'][_0xde81('0x62')]));_0x22a151['attributes']=_0x22a151[_0xde81('0x63')][_0xde81('0x52')]?_0x22a151[_0xde81('0x63')]:_0x36acec['model'];if(!_0x1003cd[_0xde81('0x4a')][_0xde81('0xd2')](_0xde81('0xd6'))){_0x22a151['limit']=qs[_0xde81('0x2a')](_0x1003cd[_0xde81('0x4a')][_0xde81('0x2a')]);_0x22a151[_0xde81('0x28')]=qs[_0xde81('0x28')](_0x1003cd['query'][_0xde81('0x28')]);}_0x22a151[_0xde81('0xd0')]=qs[_0xde81('0xd1')](_0x1003cd['query'][_0xde81('0xd1')]);_0x22a151[_0xde81('0x49')]=qs['filters'](_['pick'](_0x1003cd[_0xde81('0x4a')],_0x36acec[_0xde81('0x60')]));_0x22a151[_0xde81('0x49')][_0xde81('0xdd')]=_0x5e00f0['id'];if(_0x1003cd[_0xde81('0x4a')][_0xde81('0x37')]){_0x22a151['where']=_[_0xde81('0x65')](_0x22a151[_0xde81('0x49')],{'$or':_[_0xde81('0x39')](_0x22a151[_0xde81('0x63')],function(_0x36fbaf){var _0x2bf4c4={};_0x2bf4c4[_0x36fbaf]={'$like':'%'+_0x1003cd[_0xde81('0x4a')]['filter']+'%'};return _0x2bf4c4;})});}_0x22a151=_[_0xde81('0x65')]({},_0x22a151,_0x1003cd[_0xde81('0x66')]);return db[_0xde81('0xde')][_0xde81('0x2b')]({'where':_0x22a151['where']})[_0xde81('0x18')](function(_0x1669ea){_0x95dcb9[_0xde81('0x2b')]=_0x1669ea;if(_0x1003cd['query'][_0xde81('0x64')]){_0x22a151[_0xde81('0x4b')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x22a151);})[_0xde81('0x18')](function(_0x57c0cc){_0x95dcb9[_0xde81('0x50')]=_0x57c0cc;return _0x95dcb9;});}})[_0xde81('0x18')](respondWithFilteredResult(_0x44e5af,_0x22a151))[_0xde81('0x23')](handleError(_0x44e5af,null));};exports['getScreenRecordings']=function(_0x3e6d20,_0x223ebd){var _0x1564c4={'raw':!![],'where':{}};var _0x533b50={};var _0x31fef9={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x3e6d20[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x223ebd,null))[_0xde81('0x18')](function(_0xf70431){if(_0xf70431){_0x533b50['model']=_['keys'](db[_0xde81('0xdf')]['rawAttributes']);_0x533b50[_0xde81('0x4a')]=_['keys'](_0x3e6d20[_0xde81('0x4a')]);_0x533b50[_0xde81('0x60')]=_['intersection'](_0x533b50[_0xde81('0x5b')],_0x533b50[_0xde81('0x4a')]);_0x1564c4['attributes']=_[_0xde81('0x61')](_0x533b50['model'],qs[_0xde81('0x62')](_0x3e6d20[_0xde81('0x4a')][_0xde81('0x62')]));_0x1564c4[_0xde81('0x63')]=_0x1564c4[_0xde81('0x63')][_0xde81('0x52')]?_0x1564c4[_0xde81('0x63')]:_0x533b50['model'];if(!_0x3e6d20[_0xde81('0x4a')][_0xde81('0xd2')](_0xde81('0xd6'))){_0x1564c4[_0xde81('0x2a')]=qs[_0xde81('0x2a')](_0x3e6d20[_0xde81('0x4a')][_0xde81('0x2a')]);_0x1564c4[_0xde81('0x28')]=qs['offset'](_0x3e6d20[_0xde81('0x4a')]['offset']);}_0x1564c4[_0xde81('0xd0')]=qs[_0xde81('0xd1')](_0x3e6d20[_0xde81('0x4a')][_0xde81('0xd1')]);_0x1564c4[_0xde81('0x49')]=qs[_0xde81('0x60')](_[_0xde81('0xd9')](_0x3e6d20[_0xde81('0x4a')],_0x533b50[_0xde81('0x60')]));_0x1564c4[_0xde81('0x49')][_0xde81('0xdd')]=_0xf70431['id'];if(_0x3e6d20[_0xde81('0x4a')][_0xde81('0x37')]){_0x1564c4[_0xde81('0x49')]=_[_0xde81('0x65')](_0x1564c4[_0xde81('0x49')],{'$or':_['map'](_0x1564c4[_0xde81('0x63')],function(_0x5f34fe){var _0x179645={};_0x179645[_0x5f34fe]={'$like':'%'+_0x3e6d20[_0xde81('0x4a')]['filter']+'%'};return _0x179645;})});}_0x1564c4=_[_0xde81('0x65')]({},_0x1564c4,_0x3e6d20[_0xde81('0x66')]);return db[_0xde81('0xdf')][_0xde81('0x2b')]({'where':_0x1564c4[_0xde81('0x49')]})[_0xde81('0x18')](function(_0x40ff12){_0x31fef9[_0xde81('0x2b')]=_0x40ff12;if(_0x3e6d20[_0xde81('0x4a')][_0xde81('0x64')]){_0x1564c4[_0xde81('0x4b')]=[{'all':!![]}];}return db['ScreenRecording'][_0xde81('0xb2')](_0x1564c4);})[_0xde81('0x18')](function(_0x154377){_0x31fef9[_0xde81('0x50')]=_0x154377;return _0x31fef9;});}})[_0xde81('0x18')](respondWithFilteredResult(_0x223ebd,_0x1564c4))[_0xde81('0x23')](handleError(_0x223ebd,null));};exports[_0xde81('0xe0')]=function(_0x2dcace,_0x3e0ba6){var _0x1a8cda={};var _0x331a0d={};var _0x1c8878;var _0x56c22;return db[_0xde81('0x42')][_0xde81('0xcf')]({'where':{'id':_0x2dcace[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x3e0ba6,null))[_0xde81('0x18')](function(_0x9bb277){if(_0x9bb277){_0x1c8878=_0x9bb277;_0x331a0d[_0xde81('0x5b')]=_['keys'](db[_0xde81('0xe1')]['rawAttributes']);_0x331a0d[_0xde81('0x4a')]=_[_0xde81('0x5d')](_0x2dcace['query']);_0x331a0d[_0xde81('0x60')]=_[_0xde81('0x61')](_0x331a0d[_0xde81('0x5b')],_0x331a0d[_0xde81('0x4a')]);_0x1a8cda[_0xde81('0x63')]=_[_0xde81('0x61')](_0x331a0d['model'],qs[_0xde81('0x62')](_0x2dcace['query'][_0xde81('0x62')]));_0x1a8cda[_0xde81('0x63')]=_0x1a8cda[_0xde81('0x63')][_0xde81('0x52')]?_0x1a8cda['attributes']:_0x331a0d[_0xde81('0x5b')];_0x1a8cda[_0xde81('0xd0')]=qs['sort'](_0x2dcace[_0xde81('0x4a')][_0xde81('0xd1')]);_0x1a8cda['where']=qs['filters'](_[_0xde81('0xd9')](_0x2dcace[_0xde81('0x4a')],_0x331a0d['filters']));if(_0x2dcace[_0xde81('0x4a')][_0xde81('0x37')]){_0x1a8cda[_0xde81('0x49')]=_[_0xde81('0x65')](_0x1a8cda[_0xde81('0x49')],{'$or':_[_0xde81('0x39')](_0x1a8cda[_0xde81('0x63')],function(_0x100051){var _0x5769bc={};_0x5769bc[_0x100051]={'$like':'%'+_0x2dcace['query'][_0xde81('0x37')]+'%'};return _0x5769bc;})});}_0x1a8cda=_['merge']({},_0x1a8cda,_0x2dcace['options']);return _0x1c8878[_0xde81('0xe0')](_0x1a8cda);}})['then'](function(_0x624cec){if(_0x624cec){_0x56c22=_0x624cec['length'];if(!_0x2dcace[_0xde81('0x4a')]['hasOwnProperty'](_0xde81('0xd6'))){_0x1a8cda[_0xde81('0x2a')]=qs[_0xde81('0x2a')](_0x2dcace['query'][_0xde81('0x2a')]);_0x1a8cda[_0xde81('0x28')]=qs['offset'](_0x2dcace[_0xde81('0x4a')][_0xde81('0x28')]);}return _0x1c8878['getChatInteractions'](_0x1a8cda);}})[_0xde81('0x18')](function(_0x1ea942){if(_0x1ea942){return _0x1ea942?{'count':_0x56c22,'rows':_0x1ea942}:null;}})[_0xde81('0x18')](respondWithResult(_0x3e0ba6,null))[_0xde81('0x23')](handleError(_0x3e0ba6,null));};exports['getOpenchannelInteractions']=function(_0x581f51,_0x291d35){var _0x44aa4c={};var _0x5ec6ba={};var _0x3e4d98;var _0x3d7676;return db[_0xde81('0x42')][_0xde81('0xcf')]({'where':{'id':_0x581f51[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x291d35,null))[_0xde81('0x18')](function(_0x3e13b5){if(_0x3e13b5){_0x3e4d98=_0x3e13b5;_0x5ec6ba[_0xde81('0x5b')]=_['keys'](db[_0xde81('0xe2')]['rawAttributes']);_0x5ec6ba[_0xde81('0x4a')]=_[_0xde81('0x5d')](_0x581f51[_0xde81('0x4a')]);_0x5ec6ba[_0xde81('0x60')]=_['intersection'](_0x5ec6ba[_0xde81('0x5b')],_0x5ec6ba[_0xde81('0x4a')]);_0x44aa4c[_0xde81('0x63')]=_[_0xde81('0x61')](_0x5ec6ba[_0xde81('0x5b')],qs['fields'](_0x581f51['query'][_0xde81('0x62')]));_0x44aa4c[_0xde81('0x63')]=_0x44aa4c['attributes'][_0xde81('0x52')]?_0x44aa4c['attributes']:_0x5ec6ba[_0xde81('0x5b')];_0x44aa4c[_0xde81('0xd0')]=qs[_0xde81('0xd1')](_0x581f51[_0xde81('0x4a')][_0xde81('0xd1')]);_0x44aa4c[_0xde81('0x49')]=qs[_0xde81('0x60')](_[_0xde81('0xd9')](_0x581f51[_0xde81('0x4a')],_0x5ec6ba[_0xde81('0x60')]));if(_0x581f51[_0xde81('0x4a')]['filter']){_0x44aa4c[_0xde81('0x49')]=_[_0xde81('0x65')](_0x44aa4c[_0xde81('0x49')],{'$or':_['map'](_0x44aa4c[_0xde81('0x63')],function(_0x4e8e6c){var _0x4a07e4={};_0x4a07e4[_0x4e8e6c]={'$like':'%'+_0x581f51['query'][_0xde81('0x37')]+'%'};return _0x4a07e4;})});}_0x44aa4c=_[_0xde81('0x65')]({},_0x44aa4c,_0x581f51['options']);return _0x3e4d98[_0xde81('0xe3')](_0x44aa4c);}})[_0xde81('0x18')](function(_0x683e8a){if(_0x683e8a){_0x3d7676=_0x683e8a[_0xde81('0x52')];if(!_0x581f51[_0xde81('0x4a')][_0xde81('0xd2')](_0xde81('0xd6'))){_0x44aa4c[_0xde81('0x2a')]=qs[_0xde81('0x2a')](_0x581f51['query'][_0xde81('0x2a')]);_0x44aa4c[_0xde81('0x28')]=qs['offset'](_0x581f51[_0xde81('0x4a')][_0xde81('0x28')]);}return _0x3e4d98['getOpenchannelInteractions'](_0x44aa4c);}})[_0xde81('0x18')](function(_0x10cce4){if(_0x10cce4){return _0x10cce4?{'count':_0x3d7676,'rows':_0x10cce4}:null;}})['then'](respondWithResult(_0x291d35,null))['catch'](handleError(_0x291d35,null));};exports['getMailInteractions']=function(_0x269101,_0xb9156d){var _0x2c89ae={'raw':!![],'where':{}};var _0x5262c8={};var _0xdf1830={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x269101[_0xde81('0x5a')]['id']}})['then'](handleEntityNotFound(_0xb9156d,null))[_0xde81('0x18')](function(_0x1e72de){if(_0x1e72de){_0x5262c8[_0xde81('0x5b')]=_[_0xde81('0x5d')](db[_0xde81('0xe4')][_0xde81('0x43')]);_0x5262c8[_0xde81('0x4a')]=_[_0xde81('0x5d')](_0x269101[_0xde81('0x4a')]);_0x5262c8[_0xde81('0x60')]=_[_0xde81('0x61')](_0x5262c8[_0xde81('0x5b')],_0x5262c8[_0xde81('0x4a')]);_0x2c89ae[_0xde81('0x63')]=_[_0xde81('0x61')](_0x5262c8[_0xde81('0x5b')],qs[_0xde81('0x62')](_0x269101[_0xde81('0x4a')][_0xde81('0x62')]));_0x2c89ae[_0xde81('0x63')]=_0x2c89ae['attributes']['length']?_0x2c89ae[_0xde81('0x63')]:_0x5262c8[_0xde81('0x5b')];if(!_0x269101[_0xde81('0x4a')][_0xde81('0xd2')](_0xde81('0xd6'))){_0x2c89ae[_0xde81('0x2a')]=qs[_0xde81('0x2a')](_0x269101[_0xde81('0x4a')][_0xde81('0x2a')]);_0x2c89ae[_0xde81('0x28')]=qs[_0xde81('0x28')](_0x269101['query'][_0xde81('0x28')]);}_0x2c89ae[_0xde81('0xd0')]=qs[_0xde81('0xd1')](_0x269101[_0xde81('0x4a')][_0xde81('0xd1')]);_0x2c89ae[_0xde81('0x49')]=qs['filters'](_[_0xde81('0xd9')](_0x269101[_0xde81('0x4a')],_0x5262c8[_0xde81('0x60')]));_0x2c89ae[_0xde81('0x49')][_0xde81('0xdd')]=_0x1e72de['id'];if(_0x269101[_0xde81('0x4a')]['filter']){_0x2c89ae[_0xde81('0x49')]=_['merge'](_0x2c89ae[_0xde81('0x49')],{'$or':_['map'](_0x2c89ae['attributes'],function(_0x6188ad){var _0x25fa8c={};_0x25fa8c[_0x6188ad]={'$like':'%'+_0x269101[_0xde81('0x4a')]['filter']+'%'};return _0x25fa8c;})});}_0x2c89ae=_[_0xde81('0x65')]({},_0x2c89ae,_0x269101[_0xde81('0x66')]);return db['MailInteraction'][_0xde81('0x2b')]({'where':_0x2c89ae[_0xde81('0x49')]})[_0xde81('0x18')](function(_0x303911){_0xdf1830[_0xde81('0x2b')]=_0x303911;if(_0x269101[_0xde81('0x4a')][_0xde81('0x64')]){_0x2c89ae['include']=[{'all':!![]}];}return db[_0xde81('0xe4')]['findAll'](_0x2c89ae);})['then'](function(_0x350849){_0xdf1830[_0xde81('0x50')]=_0x350849;return _0xdf1830;});}})[_0xde81('0x18')](respondWithFilteredResult(_0xb9156d,_0x2c89ae))[_0xde81('0x23')](handleError(_0xb9156d,null));};exports[_0xde81('0xe5')]=function(_0x4a84dd,_0x308d2f){var _0x5c07c4={};var _0xb34a7e={};var _0x191b45;var _0x2d0570;return db['User'][_0xde81('0xcf')]({'where':{'id':_0x4a84dd[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x308d2f,null))[_0xde81('0x18')](function(_0x936a18){if(_0x936a18){_0x191b45=_0x936a18;_0xb34a7e['model']=_[_0xde81('0x5d')](db[_0xde81('0xe6')][_0xde81('0x43')]);_0xb34a7e[_0xde81('0x4a')]=_[_0xde81('0x5d')](_0x4a84dd['query']);_0xb34a7e[_0xde81('0x60')]=_[_0xde81('0x61')](_0xb34a7e['model'],_0xb34a7e[_0xde81('0x4a')]);_0x5c07c4[_0xde81('0x63')]=_[_0xde81('0x61')](_0xb34a7e[_0xde81('0x5b')],qs[_0xde81('0x62')](_0x4a84dd[_0xde81('0x4a')][_0xde81('0x62')]));_0x5c07c4['attributes']=_0x5c07c4['attributes'][_0xde81('0x52')]?_0x5c07c4[_0xde81('0x63')]:_0xb34a7e[_0xde81('0x5b')];_0x5c07c4[_0xde81('0xd0')]=qs[_0xde81('0xd1')](_0x4a84dd['query'][_0xde81('0xd1')]);_0x5c07c4[_0xde81('0x49')]=qs['filters'](_[_0xde81('0xd9')](_0x4a84dd[_0xde81('0x4a')],_0xb34a7e[_0xde81('0x60')]));if(_0x4a84dd[_0xde81('0x4a')][_0xde81('0x37')]){_0x5c07c4['where']=_['merge'](_0x5c07c4[_0xde81('0x49')],{'$or':_[_0xde81('0x39')](_0x5c07c4[_0xde81('0x63')],function(_0x1be7a8){var _0x3efbe6={};_0x3efbe6[_0x1be7a8]={'$like':'%'+_0x4a84dd['query']['filter']+'%'};return _0x3efbe6;})});}_0x5c07c4=_[_0xde81('0x65')]({},_0x5c07c4,_0x4a84dd[_0xde81('0x66')]);return _0x191b45[_0xde81('0xe5')](_0x5c07c4);}})[_0xde81('0x18')](function(_0x2c7cae){if(_0x2c7cae){_0x2d0570=_0x2c7cae[_0xde81('0x52')];if(!_0x4a84dd[_0xde81('0x4a')][_0xde81('0xd2')](_0xde81('0xd6'))){_0x5c07c4[_0xde81('0x2a')]=qs[_0xde81('0x2a')](_0x4a84dd['query'][_0xde81('0x2a')]);_0x5c07c4[_0xde81('0x28')]=qs[_0xde81('0x28')](_0x4a84dd[_0xde81('0x4a')]['offset']);}return _0x191b45[_0xde81('0xe5')](_0x5c07c4);}})[_0xde81('0x18')](function(_0x406971){if(_0x406971){return _0x406971?{'count':_0x2d0570,'rows':_0x406971}:null;}})['then'](respondWithResult(_0x308d2f,null))[_0xde81('0x23')](handleError(_0x308d2f,null));};exports[_0xde81('0xe7')]=function(_0x104d1b,_0x364783){var _0xcd5ede={};var _0x49b072={};var _0x48fd28;var _0x59cc46;return db[_0xde81('0x42')][_0xde81('0xcf')]({'where':{'id':_0x104d1b[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x364783,null))[_0xde81('0x18')](function(_0x40a20e){if(_0x40a20e){_0x48fd28=_0x40a20e;_0x49b072[_0xde81('0x5b')]=_[_0xde81('0x5d')](db[_0xde81('0xe8')][_0xde81('0x43')]);_0x49b072['query']=_['keys'](_0x104d1b['query']);_0x49b072['filters']=_[_0xde81('0x61')](_0x49b072[_0xde81('0x5b')],_0x49b072['query']);_0xcd5ede[_0xde81('0x63')]=_[_0xde81('0x61')](_0x49b072[_0xde81('0x5b')],qs['fields'](_0x104d1b[_0xde81('0x4a')][_0xde81('0x62')]));_0xcd5ede[_0xde81('0x63')]=_0xcd5ede[_0xde81('0x63')][_0xde81('0x52')]?_0xcd5ede[_0xde81('0x63')]:_0x49b072[_0xde81('0x5b')];_0xcd5ede[_0xde81('0xd0')]=qs[_0xde81('0xd1')](_0x104d1b['query'][_0xde81('0xd1')]);_0xcd5ede[_0xde81('0x49')]=qs[_0xde81('0x60')](_[_0xde81('0xd9')](_0x104d1b[_0xde81('0x4a')],_0x49b072[_0xde81('0x60')]));if(_0x104d1b[_0xde81('0x4a')][_0xde81('0x37')]){_0xcd5ede[_0xde81('0x49')]=_[_0xde81('0x65')](_0xcd5ede['where'],{'$or':_[_0xde81('0x39')](_0xcd5ede[_0xde81('0x63')],function(_0x4eeb2e){var _0x22bc0b={};_0x22bc0b[_0x4eeb2e]={'$like':'%'+_0x104d1b[_0xde81('0x4a')][_0xde81('0x37')]+'%'};return _0x22bc0b;})});}_0xcd5ede=_['merge']({},_0xcd5ede,_0x104d1b[_0xde81('0x66')]);return _0x48fd28[_0xde81('0xe7')](_0xcd5ede);}})[_0xde81('0x18')](function(_0x12258d){if(_0x12258d){_0x59cc46=_0x12258d['length'];if(!_0x104d1b[_0xde81('0x4a')][_0xde81('0xd2')](_0xde81('0xd6'))){_0xcd5ede[_0xde81('0x2a')]=qs[_0xde81('0x2a')](_0x104d1b[_0xde81('0x4a')]['limit']);_0xcd5ede[_0xde81('0x28')]=qs[_0xde81('0x28')](_0x104d1b['query'][_0xde81('0x28')]);}return _0x48fd28[_0xde81('0xe7')](_0xcd5ede);}})[_0xde81('0x18')](function(_0x35cd9f){if(_0x35cd9f){return _0x35cd9f?{'count':_0x59cc46,'rows':_0x35cd9f}:null;}})[_0xde81('0x18')](respondWithResult(_0x364783,null))[_0xde81('0x23')](handleError(_0x364783,null));};exports[_0xde81('0xe9')]=function(_0x310b50,_0x8606e0){var _0x2fe7d0={};var _0x4a2ced={};var _0x5b47fb;var _0x8ed2c6;return db[_0xde81('0x42')][_0xde81('0xcf')]({'where':{'id':_0x310b50[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x8606e0,null))[_0xde81('0x18')](function(_0x16720a){if(_0x16720a){_0x5b47fb=_0x16720a;_0x4a2ced['model']=_[_0xde81('0x5d')](db[_0xde81('0xea')][_0xde81('0x43')]);_0x4a2ced[_0xde81('0x4a')]=_['keys'](_0x310b50[_0xde81('0x4a')]);_0x4a2ced['filters']=_[_0xde81('0x61')](_0x4a2ced[_0xde81('0x5b')],_0x4a2ced['query']);_0x2fe7d0[_0xde81('0x63')]=_[_0xde81('0x61')](_0x4a2ced[_0xde81('0x5b')],qs['fields'](_0x310b50[_0xde81('0x4a')][_0xde81('0x62')]));_0x2fe7d0[_0xde81('0x63')]=_0x2fe7d0[_0xde81('0x63')]['length']?_0x2fe7d0[_0xde81('0x63')]:_0x4a2ced[_0xde81('0x5b')];_0x2fe7d0[_0xde81('0xd0')]=qs[_0xde81('0xd1')](_0x310b50[_0xde81('0x4a')][_0xde81('0xd1')]);_0x2fe7d0[_0xde81('0x49')]=qs[_0xde81('0x60')](_['pick'](_0x310b50[_0xde81('0x4a')],_0x4a2ced[_0xde81('0x60')]));if(_0x310b50[_0xde81('0x4a')][_0xde81('0x37')]){_0x2fe7d0[_0xde81('0x49')]=_[_0xde81('0x65')](_0x2fe7d0[_0xde81('0x49')],{'$or':_[_0xde81('0x39')](_0x2fe7d0[_0xde81('0x63')],function(_0x46eb54){var _0x225b75={};_0x225b75[_0x46eb54]={'$like':'%'+_0x310b50[_0xde81('0x4a')]['filter']+'%'};return _0x225b75;})});}_0x2fe7d0=_[_0xde81('0x65')]({},_0x2fe7d0,_0x310b50[_0xde81('0x66')]);return _0x5b47fb[_0xde81('0xe9')](_0x2fe7d0);}})['then'](function(_0x282c22){if(_0x282c22){_0x8ed2c6=_0x282c22[_0xde81('0x52')];if(!_0x310b50[_0xde81('0x4a')]['hasOwnProperty'](_0xde81('0xd6'))){_0x2fe7d0[_0xde81('0x2a')]=qs['limit'](_0x310b50[_0xde81('0x4a')]['limit']);_0x2fe7d0[_0xde81('0x28')]=qs[_0xde81('0x28')](_0x310b50[_0xde81('0x4a')][_0xde81('0x28')]);}return _0x5b47fb['getWhatsappInteractions'](_0x2fe7d0);}})[_0xde81('0x18')](function(_0x1c1ef9){if(_0x1c1ef9){return _0x1c1ef9?{'count':_0x8ed2c6,'rows':_0x1c1ef9}:null;}})[_0xde81('0x18')](respondWithResult(_0x8606e0,null))[_0xde81('0x23')](handleError(_0x8606e0,null));};exports[_0xde81('0xeb')]=function(_0x212309,_0x5ac6f6,_0x4ea67f){var _0x2cda9d;var _0x24ce21;var _0x58d93c;var _0x25ca3b=!_['isNil'](_0x212309[_0xde81('0x5a')]['id'])?_0x212309[_0xde81('0x5a')]['id']:!_[_0xde81('0x72')](_0x212309[_0xde81('0x33')]['id'])?_0x212309[_0xde81('0x33')]['id']:null;return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x25ca3b,'role':{'$or':[_0xde81('0x31'),'user','agent']}},'attributes':['id',_0xde81('0x3c'),_0xde81('0xec'),_0xde81('0xed'),'role',_0xde81('0x6e'),_0xde81('0xa4')]})['then'](function(_0x2cc0c2){if(_0x2cc0c2){if(_0x2cc0c2[_0xde81('0x6a')]===_0xde81('0x35')){_0x2cda9d=_0x2cc0c2;if(_0x212309['body'][_0xde81('0xa6')]){_0x58d93c=util[_0xde81('0xb3')](_0xde81('0xee'),_0x2cda9d[_0x212309['body'][_0xde81('0xa6')]]);}else if(_0x212309['body'][_0xde81('0xef')]){_0x58d93c=util[_0xde81('0xb3')](_0xde81('0xb4'),_0x212309['body']['intrf']);}else{_0x58d93c=util[_0xde81('0xb3')](_0xde81('0xb4'),_0x2cda9d[_0xde81('0x3c')]);}socket['to'](util['format'](_0xde81('0xf0'),_0x2cda9d[_0xde81('0x3c')]))[_0xde81('0x2e')](_0xde81('0xf1'),{'user':{'id':_0x2cda9d['id'],'name':_0x2cda9d[_0xde81('0x3c')]},'ip':_0x212309['headers']['x-forwarded-for']||_0x212309[_0xde81('0xf2')][_0xde81('0xf3')]||_0x212309[_0xde81('0xf4')][_0xde81('0xf3')]||_0x212309[_0xde81('0xf2')]['socket'][_0xde81('0xf3')]});return db[_0xde81('0xb5')][_0xde81('0x3e')]({'where':{'membername':_0x2cda9d[_0xde81('0x3c')]},'individualHooks':!![]});}}else{throw new db[(_0xde81('0x95'))][(_0xde81('0x96'))](_0xde81('0xf5'));}})[_0xde81('0x18')](function(){if(_0x2cda9d){return _0x2cda9d[_0xde81('0xf6')]({'raw':!![]});}})[_0xde81('0x18')](function(_0x1adb92){if(_0x2cda9d){var _0x25215c=[];if(_0x1adb92){_0x24ce21=_0x1adb92;if(_0x24ce21[_0xde81('0x52')]){for(var _0x3da846=0x0;_0x3da846<_0x24ce21[_0xde81('0x52')];_0x3da846++){_0x25215c['push']({'membername':_0x2cda9d[_0xde81('0x3c')],'UserId':_0x2cda9d['id'],'queue_name':_0x24ce21[_0x3da846]['name'],'VoiceQueueId':_0x24ce21[_0x3da846]['id'],'interface':_0x58d93c,'paused':_0x2cda9d[_0xde81('0xa4')]||![],'penalty':_0x24ce21[_0x3da846][_0xde81('0xf7')]||0x0});}return BPromise[_0xde81('0x8f')](_0x25215c,function(_0x259739){return db['UserVoiceQueueRt'][_0xde81('0xf8')](_0x259739);});}}}})[_0xde81('0x18')](function(){if(_0x2cda9d){return db[_0xde81('0xf9')][_0xde81('0xb2')]({'where':{'membername':_0x2cda9d['name'],'exitAt':null}});}})[_0xde81('0x18')](function(_0x47a164){if(_0x2cda9d){var _0x141fb8=[];_0x47a164[_0xde81('0xfa')](function(_0x1064cc){_0x141fb8[_0xde81('0x4f')](_0x1064cc[_0xde81('0x2d')]({'exitAt':moment()[_0xde81('0xb3')](_0xde81('0xfb'))}));});return BPromise[_0xde81('0x58')](_0x141fb8);}})[_0xde81('0x18')](function(){if(_0x2cda9d){var _0xcf69fe=[];var _0x45a5bc=[];var _0x3e6e9d=utils[_0xde81('0xfc')]();var _0x4e858d={'membername':_0x2cda9d[_0xde81('0x3c')],'interface':_0x58d93c,'enterAt':moment()['format'](_0xde81('0xfb')),'role':_0x2cda9d[_0xde81('0x6a')],'internal':_0x2cda9d[_0xde81('0x6e')]};_0x3e6e9d[_0xde81('0xfa')](function(_0x15e9c0){_0xcf69fe[_0xde81('0x4f')](_[_0xde81('0x65')]({'channel':_0x15e9c0,'type':_0xde81('0xfd'),'data1':_0x212309[_0xde81('0x69')][_0xde81('0xfe')],'data2':_0x58d93c},_0x4e858d));if(_0x2cda9d[_0xde81('0xa4')]){_0x45a5bc[_0xde81('0x4f')](_[_0xde81('0x65')]({'channel':_0x15e9c0,'type':_0xde81('0xff'),'data1':_0xde81('0x100')},_0x4e858d));}});return db[_0xde81('0xf9')][_0xde81('0x8d')](_0xcf69fe[_0xde81('0xcd')](_0x45a5bc),{'individualHooks':!![]});}})[_0xde81('0x18')](function(){if(_0x2cda9d){return _0x2cda9d[_0xde81('0x2d')]({'online':!![],'lastLoginAt':moment()['format'](_0xde81('0xfb')),'voicePause':_0x2cda9d[_0xde81('0xa4')]||![],'mailPause':_0x2cda9d[_0xde81('0xa4')]||![],'chatPause':_0x2cda9d['loginInPause']||![],'faxPause':_0x2cda9d[_0xde81('0xa4')]||![],'smsPause':_0x2cda9d[_0xde81('0xa4')]||![],'openchannelPause':_0x2cda9d['loginInPause']||![],'whatsappPause':_0x2cda9d[_0xde81('0xa4')]||![],'pauseType':_0x2cda9d[_0xde81('0xa4')]?_0xde81('0x100'):null,'interface':_0x58d93c,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xde81('0x18')](function(_0x265980){if(_0x212309[_0xde81('0x101')]){return _0x4ea67f();}else{return BPromise[_0xde81('0x102')](_0x265980)[_0xde81('0x18')](respondWithResult(_0x5ac6f6,null));}})[_0xde81('0x23')](handleError(_0x5ac6f6,null));};exports['logout']=function(_0x14d8c9,_0xbc6f2e){var _0x57ba31;return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x14d8c9[_0xde81('0x5a')]['id'],'role':_0xde81('0x35')},'attributes':['id',_0xde81('0x3c'),_0xde81('0x6a')]})[_0xde81('0x18')](handleEntityNotFound(_0xbc6f2e,null))['then'](function(_0x54c483){if(_0x54c483){_0x57ba31=_0x54c483;return db[_0xde81('0xb5')]['destroy']({'where':{'membername':_0x57ba31[_0xde81('0x3c')]},'individualHooks':!![]});}})[_0xde81('0x18')](function(){return db[_0xde81('0xf9')]['findAll']({'where':{'membername':_0x57ba31[_0xde81('0x3c')],'exitAt':null}});})[_0xde81('0x18')](function(_0x4c48db){var _0x28b1cb=[];_0x4c48db[_0xde81('0xfa')](function(_0x4cb4d0){_0x28b1cb[_0xde81('0x4f')](_0x4cb4d0['update']({'exitAt':moment()[_0xde81('0xb3')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xde81('0x58')](_0x28b1cb);})[_0xde81('0x18')](function(){return _0x57ba31[_0xde81('0x2d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xde81('0x18')](respondWithResult(_0xbc6f2e,null))[_0xde81('0x23')](handleError(_0xbc6f2e,null));};exports[_0xde81('0x103')]=function(_0x4eb635,_0x3935ce){var _0x46c0ea;return db['UserVoiceQueueRt'][_0xde81('0x2d')]({'paused':0x1},{'where':{'UserId':_0x4eb635[_0xde81('0x5a')]['id']},'individualHooks':!![]})[_0xde81('0x18')](function(){return db['User']['find']({'where':{'id':_0x4eb635['params']['id'],'role':'agent'},'attributes':['id',_0xde81('0x3c'),'role',_0xde81('0x6e'),_0xde81('0xa6')]});})[_0xde81('0x18')](handleEntityNotFound(_0x3935ce,null))[_0xde81('0x18')](function(_0x4d14db){if(_0x4d14db){_0x46c0ea=_0x4d14db;return respondWithRpcPromise('QueuePause',_0xde81('0x103'),{'id':_0x46c0ea['id'],'name':_0x46c0ea[_0xde81('0x3c')],'pause':!![]});}})['then'](function(){if(_0x46c0ea){return db[_0xde81('0xf9')][_0xde81('0xb2')]({'where':{'membername':_0x46c0ea[_0xde81('0x3c')],'type':'PAUSE','exitAt':null}});}})['then'](function(_0xf54146){if(_0xf54146['length']){var _0x7e6f88=moment()[_0xde81('0xb3')](_0xde81('0xfb'));for(var _0x917e6d=0x0,_0xa844df=_0xf54146['length'];_0x917e6d<_0xa844df;_0x917e6d++){_0xf54146[_0x917e6d][_0xde81('0x104')]({'exitAt':_0x7e6f88});}}})[_0xde81('0x18')](function(){var _0x51f1c1=[];var _0x38cfff=utils['getChannels']();_0x38cfff['forEach'](function(_0x21ede8){_0x51f1c1[_0xde81('0x4f')]({'channel':_0x21ede8,'membername':_0x46c0ea[_0xde81('0x3c')],'interface':_[_0xde81('0x72')](_0x46c0ea['interface'])?util['format'](_0xde81('0xb4'),_0x46c0ea[_0xde81('0x3c')]):_0x46c0ea[_0xde81('0xa6')],'type':_0xde81('0xff'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x4eb635[_0xde81('0x69')]['type']||_0xde81('0x105'),'role':_0x46c0ea[_0xde81('0x6a')],'internal':_0x46c0ea[_0xde81('0x6e')]});});return db[_0xde81('0xf9')]['bulkCreate'](_0x51f1c1,{'individualHooks':!![]});})['then'](function(){return _0x46c0ea[_0xde81('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x4eb635[_0xde81('0x69')]['type']||_0xde81('0x105'),'lastPauseAt':moment()[_0xde81('0xb3')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xde81('0x18')](respondWithResult(_0x3935ce,null))['catch'](handleError(_0x3935ce,null));};exports[_0xde81('0x106')]=function(_0x31da43,_0x2ec86e){var _0x2dab4f;return db['User'][_0xde81('0x3b')]({'where':{'id':_0x31da43[_0xde81('0x5a')]['id']},'attributes':['id',_0xde81('0x3c'),_0xde81('0x6a'),_0xde81('0xa5'),_0xde81('0x107'),'chatPause',_0xde81('0x108'),_0xde81('0x109'),'smsPause','whatsapppause',_0xde81('0x10a'),_0xde81('0x10b')]})[_0xde81('0x18')](handleEntityNotFound(_0x2ec86e,null))[_0xde81('0x18')](function(_0x592683){if(_0x592683){_0x2dab4f=_0x592683;if(_0x31da43[_0xde81('0x69')][_0xde81('0xa2')]&&!utils['isValidChannel'](_0x31da43['body']['channel'])){throw new db[(_0xde81('0x95'))][(_0xde81('0x96'))](_0xde81('0xa8'));}switch(_0x31da43[_0xde81('0x69')][_0xde81('0xa2')]){case _0xde81('0xb0'):return respondWithRpcPromise('QueuePause',_0xde81('0x106'),{'id':_0x2dab4f['id'],'name':_0x2dab4f['name'],'pause':![]})[_0xde81('0x18')](function(){return db[_0xde81('0xb5')][_0xde81('0x2d')]({'paused':0x0},{'where':{'UserId':_0x2dab4f['id']},'individualHooks':!![]});})[_0xde81('0x18')](function(){return db['MemberReport'][_0xde81('0x3b')]({'where':{'channel':_0x31da43['body'][_0xde81('0xa2')],'membername':_0x2dab4f[_0xde81('0x3c')],'type':_0xde81('0xff'),'exitAt':null}});})[_0xde81('0x18')](function(_0x322f83){if(_0x322f83){return _0x322f83[_0xde81('0x2d')]({'exitAt':moment()['format'](_0xde81('0xfb')),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x2dab4f[_0xde81('0x2d')]({'voicePause':![]});});case _0xde81('0x55'):case'chat':case _0xde81('0x54'):case'sms':case _0xde81('0x57'):case _0xde81('0x56'):return db[_0xde81('0xf9')][_0xde81('0x3b')]({'where':{'channel':_0x31da43[_0xde81('0x69')]['channel'],'membername':_0x2dab4f[_0xde81('0x3c')],'type':_0xde81('0xff'),'exitAt':null}})[_0xde81('0x18')](function(_0x1f92e2){if(_0x1f92e2){return _0x1f92e2[_0xde81('0x2d')]({'exitAt':moment()[_0xde81('0xb3')](_0xde81('0xfb')),'data2':_0xde81('0x10c')},{'individualHooks':!![]});}return null;})[_0xde81('0x18')](function(){var _0x67d5c3={};_[_0xde81('0x2c')](_0x67d5c3,util[_0xde81('0xb3')](_0xde81('0x10d'),_0x31da43['body'][_0xde81('0xa2')],_0xde81('0x10e')),![]);return _0x2dab4f['update'](_0x67d5c3);});default:return respondWithRpcPromise(_0xde81('0x10f'),_0xde81('0x106'),{'id':_0x2dab4f['id'],'name':_0x2dab4f[_0xde81('0x3c')],'pause':![]})[_0xde81('0x18')](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x2dab4f['id']}});})[_0xde81('0x18')](function(){return db[_0xde81('0xf9')][_0xde81('0xb2')]({'where':{'membername':_0x2dab4f[_0xde81('0x3c')],'type':'PAUSE','exitAt':null}});})[_0xde81('0x18')](function(_0x395fca){var _0x3240ac=[];_0x395fca['forEach'](function(_0x5a3577){_0x3240ac[_0xde81('0x4f')](_0x5a3577[_0xde81('0x2d')]({'exitAt':moment()[_0xde81('0xb3')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xde81('0x10c')}));});return BPromise['all'](_0x3240ac);})[_0xde81('0x18')](function(){return _0x2dab4f[_0xde81('0x2d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xde81('0x18')](respondWithResult(_0x2ec86e,null))['catch'](handleError(_0x2ec86e,null));};exports[_0xde81('0x110')]=function(_0x237e90,_0x5ea02e){var _0xe1aef9={};var _0x508f0a={};var _0x2a3582;var _0x297bcf;return db['User'][_0xde81('0xcf')]({'where':{'id':_0x237e90['params']['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x5ea02e,null))['then'](function(_0x4bfda2){if(_0x4bfda2){_0x2a3582=_0x4bfda2;_0x508f0a[_0xde81('0x5b')]=_['keys'](db['Team'][_0xde81('0x43')]);_0x508f0a[_0xde81('0x4a')]=_['keys'](_0x237e90[_0xde81('0x4a')]);_0x508f0a[_0xde81('0x60')]=_[_0xde81('0x61')](_0x508f0a['model'],_0x508f0a[_0xde81('0x4a')]);_0xe1aef9[_0xde81('0x63')]=_[_0xde81('0x61')](_0x508f0a[_0xde81('0x5b')],qs[_0xde81('0x62')](_0x237e90[_0xde81('0x4a')]['fields']));_0xe1aef9[_0xde81('0x63')]=_0xe1aef9['attributes'][_0xde81('0x52')]?_0xe1aef9[_0xde81('0x63')]:_0x508f0a[_0xde81('0x5b')];_0xe1aef9['order']=qs[_0xde81('0xd1')](_0x237e90[_0xde81('0x4a')][_0xde81('0xd1')]);_0xe1aef9[_0xde81('0x49')]=qs[_0xde81('0x60')](_[_0xde81('0xd9')](_0x237e90[_0xde81('0x4a')],_0x508f0a['filters']));if(_0x237e90[_0xde81('0x4a')][_0xde81('0x37')]){_0xe1aef9['where']=_['merge'](_0xe1aef9[_0xde81('0x49')],{'$or':_[_0xde81('0x39')](_0xe1aef9[_0xde81('0x63')],function(_0x5e63db){var _0x184a83={};_0x184a83[_0x5e63db]={'$like':'%'+_0x237e90['query'][_0xde81('0x37')]+'%'};return _0x184a83;})});}_0xe1aef9=_[_0xde81('0x65')]({},_0xe1aef9,_0x237e90['options']);return _0x2a3582[_0xde81('0x110')](_0xe1aef9);}})[_0xde81('0x18')](function(_0x535e3e){if(_0x535e3e){_0x297bcf=_0x535e3e[_0xde81('0x52')];if(!_0x237e90['query']['hasOwnProperty'](_0xde81('0xd6'))){_0xe1aef9[_0xde81('0x2a')]=qs[_0xde81('0x2a')](_0x237e90[_0xde81('0x4a')][_0xde81('0x2a')]);_0xe1aef9[_0xde81('0x28')]=qs[_0xde81('0x28')](_0x237e90[_0xde81('0x4a')]['offset']);}return _0x2a3582[_0xde81('0x110')](_0xe1aef9);}})[_0xde81('0x18')](function(_0x453b25){if(_0x453b25){return _0x453b25?{'count':_0x297bcf,'rows':_0x453b25}:null;}})[_0xde81('0x18')](respondWithResult(_0x5ea02e,null))[_0xde81('0x23')](handleError(_0x5ea02e,null));};exports[_0xde81('0x111')]=function(_0x516204,_0x2f3fe9){var _0x4df63a=_0x516204[_0xde81('0x5a')]['id'];var _0x43af1c=_0x516204[_0xde81('0x69')]?_0x516204[_0xde81('0x69')]['ids']:null;var _0x19ff5b=[];return Promise[_0xde81('0x102')]()[_0xde81('0x18')](function(){if(!_0x43af1c)throw new APIBadRequestError(_0xde81('0x112'));})['then'](function(){return db['User'][_0xde81('0xcf')]({'where':{'id':_0x4df63a}});})[_0xde81('0x18')](function(_0x34317c){if(!_0x34317c)throw new APINotFoundError(util[_0xde81('0xb3')](_0xde81('0x113'),_0x516204[_0xde81('0x5a')]['id']));return db[_0xde81('0x74')][_0xde81('0x114')](function(_0x13dd13){return _0x34317c[_0xde81('0x111')](_0x43af1c,{'transaction':_0x13dd13})[_0xde81('0x18')](function(){return db[_0xde81('0x115')][_0xde81('0xb2')]({'where':{'id':{'$in':_0x43af1c}}});})[_0xde81('0x18')](function(_0x2c619b){var _0x381d70=_[_0xde81('0x39')](_0x2c619b,function(_0x38e4e9){return _0x38e4e9['getAssociatedQueues']();});return Promise[_0xde81('0x58')](_0x381d70);})[_0xde81('0x18')](function(_0x466b3d){_0x19ff5b=_[_0xde81('0x116')](_0x466b3d);var _0xcf51ae=_['map'](_0x19ff5b,function(_0x534d0c){return _0x534d0c[_0xde81('0x117')](_0x34317c['id'],{'transaction':_0x13dd13});});return Promise['all'](_0xcf51ae);})[_0xde81('0x18')](function(){if(!_0x34317c['online'])return;var _0x219af1=_[_0xde81('0x37')](_0x19ff5b,function(_0x370443){return _0x370443[_0xde81('0x118')](_0xde81('0xa2'))===_0xde81('0x119');});var _0x55d38e=_[_0xde81('0x39')](_0x219af1,function(_0x458734){return db[_0xde81('0xb5')][_0xde81('0xf8')]({'membername':_0x34317c[_0xde81('0x3c')],'UserId':_0x34317c['id'],'queue_name':_0x458734['name'],'VoiceQueueId':_0x458734['id'],'interface':_[_0xde81('0x72')](_0x34317c[_0xde81('0xa6')])?util[_0xde81('0xb3')](_0xde81('0xb4'),_0x34317c[_0xde81('0x3c')]):_0x34317c[_0xde81('0xa6')],'paused':_0x34317c[_0xde81('0xa5')]||![],'penalty':_0x34317c[_0xde81('0xad')]},{'transaction':_0x13dd13});});return Promise[_0xde81('0x58')](_0x55d38e);})[_0xde81('0x18')](function(){return db[_0xde81('0x11a')][_0xde81('0xb2')]({'where':{'teamId':{'$in':_0x43af1c}}});})[_0xde81('0x18')](function(_0x560ada){var _0x4b237c=_['map'](_0x560ada,function(_0x41db06){return db[_0xde81('0x11b')][_0xde81('0x89')]({'UserId':_0x34317c['id'],'VoicePrefixId':_0x41db06[_0xde81('0x11c')]},{'transaction':_0x13dd13});});return Promise[_0xde81('0x58')](_0x4b237c);});});})['then'](function(){for(var _0x75ed5d=0x0;_0x75ed5d<_0x19ff5b[_0xde81('0x52')];_0x75ed5d++){var _0x4c6783=_0x19ff5b[_0x75ed5d][_0xde81('0x118')](_0xde81('0xa2'));var _0x13c198=_0x4c6783+_0xde81('0xaf');socket[_0xde81('0x2e')](_0xde81('0x33')+_0x4c6783+_0xde81('0x11d'),{'UserId':_0x4df63a,['queueField']:_0x19ff5b[_0x75ed5d]['id']});}})[_0xde81('0x18')](respondWithStatusCode(_0x2f3fe9,null))['catch'](APIHandleError(_0x2f3fe9));};exports['removeTeams']=function(_0x3236e4,_0x22bc71){var _0x19495d=_0x3236e4[_0xde81('0x5a')]['id'];var _0x3cb9e2=null;if(_0x3236e4[_0xde81('0x4a')][_0xde81('0x6d')]){_0x3cb9e2=_[_0xde81('0x11e')](_0x3236e4['query'][_0xde81('0x6d')])?_0x3236e4['query'][_0xde81('0x6d')]:[_0x3236e4[_0xde81('0x4a')][_0xde81('0x6d')]];}var _0x9605be=[];return Promise[_0xde81('0x102')]()[_0xde81('0x18')](function(){if(!_0x3cb9e2)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0xde81('0x18')](function(){return db['User'][_0xde81('0xcf')]({'where':{'id':_0x19495d}});})[_0xde81('0x18')](function(_0x2c2649){if(!_0x2c2649)throw new APINotFoundError(util[_0xde81('0xb3')](_0xde81('0x113'),_0x3236e4[_0xde81('0x5a')]['id']));return db[_0xde81('0x74')][_0xde81('0x114')](function(_0x29a939){return _0x2c2649[_0xde81('0x11f')](_0x3cb9e2,{'transaction':_0x29a939})[_0xde81('0x18')](function(){return db[_0xde81('0x115')][_0xde81('0xb2')]({'where':{'id':{'$in':_0x3cb9e2}}});})[_0xde81('0x18')](function(_0x3c323d){var _0x49c776=_[_0xde81('0x39')](_0x3c323d,function(_0x1905c9){return _0x1905c9[_0xde81('0x120')]();});return Promise[_0xde81('0x58')](_0x49c776);})[_0xde81('0x18')](function(_0x729ce9){_0x9605be=_[_0xde81('0x116')](_0x729ce9);var _0x415843=_[_0xde81('0x39')](_0x9605be,function(_0x4234e2){return _0x4234e2['removeAgent'](_0x2c2649['id'],{'transaction':_0x29a939});});return Promise[_0xde81('0x58')](_0x415843);})[_0xde81('0x18')](function(){if(!_0x2c2649[_0xde81('0xa3')])return;var _0x3b6ba3=_[_0xde81('0x37')](_0x9605be,function(_0x415b6c){return _0x415b6c['getDataValue']('channel')==='Voice';});var _0x36bd26=_['map'](_0x3b6ba3,function(_0x160f56){return db[_0xde81('0xb5')][_0xde81('0x3e')]({'where':{'VoiceQueueId':_0x160f56['id'],'UserId':_0x2c2649['id']},'transaction':_0x29a939});});return Promise['all'](_0x36bd26);})['then'](function(){return db['TeamVoicePrefix'][_0xde81('0xb2')]({'where':{'teamId':{'$in':_0x3cb9e2}}});})[_0xde81('0x18')](function(_0x3b36d6){var _0x5eddd1=_[_0xde81('0x39')](_0x3b36d6,function(_0x54687e){return db['UserVoicePrefix'][_0xde81('0x3e')]({'where':{'UserId':_0x2c2649['id'],'VoicePrefixId':_0x54687e[_0xde81('0x11c')]}},{'transaction':_0x29a939});});return Promise[_0xde81('0x58')](_0x5eddd1);});});})[_0xde81('0x18')](function(){for(var _0x2d857e=0x0;_0x2d857e<_0x9605be[_0xde81('0x52')];_0x2d857e++){var _0x2334ab=_0x9605be[_0x2d857e][_0xde81('0x118')](_0xde81('0xa2'));var _0x31e57c=_0x2334ab+_0xde81('0xaf');socket['emit'](_0xde81('0x33')+_0x2334ab+_0xde81('0xb7'),{'UserId':_0x19495d,['queueField']:_0x9605be[_0x2d857e]['id']});}})[_0xde81('0x18')](respondWithStatusCode(_0x22bc71,null))[_0xde81('0x23')](APIHandleError(_0x22bc71));};exports[_0xde81('0x121')]=function(_0x205436,_0x27afdb){var _0x45035e={};var _0x31afc7={};var _0xdcc8d2;var _0x40d389;return db['User'][_0xde81('0xcf')]({'where':{'id':_0x205436[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x27afdb,null))[_0xde81('0x18')](function(_0x4c7c89){if(_0x4c7c89){_0xdcc8d2=_0x4c7c89;_0x31afc7[_0xde81('0x5b')]=_[_0xde81('0x5d')](db[_0xde81('0x122')][_0xde81('0x43')]);_0x31afc7['query']=_[_0xde81('0x5d')](_0x205436['query']);_0x31afc7[_0xde81('0x60')]=_[_0xde81('0x61')](_0x31afc7[_0xde81('0x5b')],_0x31afc7[_0xde81('0x4a')]);_0x45035e[_0xde81('0x63')]=_[_0xde81('0x61')](_0x31afc7[_0xde81('0x5b')],qs[_0xde81('0x62')](_0x205436['query']['fields']));_0x45035e[_0xde81('0x63')]=_0x45035e[_0xde81('0x63')][_0xde81('0x52')]?_0x45035e['attributes']:_0x31afc7[_0xde81('0x5b')];_0x45035e[_0xde81('0xd0')]=qs[_0xde81('0xd1')](_0x205436[_0xde81('0x4a')][_0xde81('0xd1')]);_0x45035e[_0xde81('0x49')]=qs[_0xde81('0x60')](_[_0xde81('0xd9')](_0x205436[_0xde81('0x4a')],_0x31afc7[_0xde81('0x60')]));if(_0x205436[_0xde81('0x4a')][_0xde81('0x37')]){_0x45035e[_0xde81('0x49')]=_[_0xde81('0x65')](_0x45035e[_0xde81('0x49')],{'$or':_['map'](_0x45035e[_0xde81('0x63')],function(_0x427140){var _0x5d5c01={};_0x5d5c01[_0x427140]={'$like':'%'+_0x205436[_0xde81('0x4a')][_0xde81('0x37')]+'%'};return _0x5d5c01;})});}_0x45035e=_[_0xde81('0x65')]({},_0x45035e,_0x205436[_0xde81('0x66')]);return _0xdcc8d2[_0xde81('0x121')](_0x45035e);}})[_0xde81('0x18')](function(_0x311968){if(_0x311968){_0x40d389=_0x311968['length'];if(!_0x205436['query']['hasOwnProperty']('nolimit')){_0x45035e[_0xde81('0x2a')]=qs[_0xde81('0x2a')](_0x205436['query'][_0xde81('0x2a')]);_0x45035e['offset']=qs['offset'](_0x205436[_0xde81('0x4a')]['offset']);}return _0xdcc8d2[_0xde81('0x121')](_0x45035e);}})['then'](function(_0x1ec2e6){if(_0x1ec2e6){return _0x1ec2e6?{'count':_0x40d389,'rows':_0x1ec2e6}:null;}})[_0xde81('0x18')](respondWithResult(_0x27afdb,null))['catch'](handleError(_0x27afdb,null));};exports['getAgents']=function(_0x52a5c2,_0x411de4){var _0xecc23a={};var _0x195c45={};var _0x269b9e;return db[_0xde81('0x42')][_0xde81('0xcf')]({'where':{'id':_0x52a5c2[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x411de4,null))['then'](function(_0x5e1869){if(_0x5e1869){_0x269b9e=_0x5e1869;_0x195c45[_0xde81('0x5b')]=_[_0xde81('0x5d')](db[_0xde81('0x42')][_0xde81('0x43')]);_0x195c45[_0xde81('0x4a')]=_[_0xde81('0x5d')](_0x52a5c2[_0xde81('0x4a')]);_0x195c45[_0xde81('0x60')]=_['intersection'](_0x195c45[_0xde81('0x5b')],_0x195c45['query']);_0xecc23a['attributes']=_[_0xde81('0x61')](_0x195c45['model'],qs[_0xde81('0x62')](_0x52a5c2[_0xde81('0x4a')][_0xde81('0x62')]));_0xecc23a['attributes']=_0xecc23a['attributes'][_0xde81('0x52')]?_0xecc23a['attributes']:_0x195c45['model'];_0xecc23a[_0xde81('0xd0')]=qs[_0xde81('0xd1')](_0x52a5c2['query'][_0xde81('0xd1')]);_0xecc23a[_0xde81('0x49')]=qs[_0xde81('0x60')](_['pick'](_0x52a5c2['query'],_0x195c45[_0xde81('0x60')]));if(_0x52a5c2[_0xde81('0x4a')][_0xde81('0x37')]){_0xecc23a['where']=_[_0xde81('0x65')](_0xecc23a[_0xde81('0x49')],{'$or':_[_0xde81('0x39')](_0xecc23a[_0xde81('0x63')],function(_0x1c4085){var _0x36070b={};_0x36070b[_0x1c4085]={'$like':'%'+_0x52a5c2[_0xde81('0x4a')][_0xde81('0x37')]+'%'};return _0x36070b;})});}_0xecc23a[_0xde81('0x5b')]=db[_0xde81('0x42')];_0xecc23a['as']=_0xde81('0x34');_0xecc23a=_[_0xde81('0x65')]({},_0xecc23a,_0x52a5c2[_0xde81('0x66')]);return _0x269b9e[_0xde81('0xf6')]({'include':[_0xecc23a]});}})[_0xde81('0x18')](function(_0x31cc64){if(_0x31cc64){var _0x14a3e6={},_0x2dfd3d=[];for(var _0x280918=0x0;_0x280918<_0x31cc64[_0xde81('0x52')];_0x280918+=0x1){for(var _0x376bbf=0x0,_0x25a4ef;_0x376bbf<_0x31cc64[_0x280918][_0xde81('0x34')][_0xde81('0x52')];_0x376bbf+=0x1){_0x25a4ef=_0x31cc64[_0x280918][_0xde81('0x34')][_0x376bbf][_0xde81('0x30')]({'plain':!![]});_0x14a3e6[_0x25a4ef['id']]=_0x25a4ef;}}_0x14a3e6=_[_0xde81('0x123')](_0x14a3e6);for(var _0x4797f9=qs[_0xde81('0x28')](_0x52a5c2[_0xde81('0x4a')]['offset']);_0x4797f9<_0x14a3e6['length']&&_0x2dfd3d[_0xde81('0x52')]<qs[_0xde81('0x2a')](_0x52a5c2['query']['limit']);_0x4797f9+=0x1){if(_0x14a3e6[_0x4797f9]){_0x2dfd3d[_0xde81('0x4f')](_0x14a3e6[_0x4797f9]);}}return{'count':_0x14a3e6[_0xde81('0x52')],'rows':_0x2dfd3d};}})[_0xde81('0x18')](respondWithResult(_0x411de4,null))[_0xde81('0x23')](handleError(_0x411de4,null));};exports['destroy']=function(_0x3179f2,_0x194cdb){if(_0x3179f2[_0xde81('0x33')]['id']==_0x3179f2[_0xde81('0x5a')]['id']){return _0x194cdb[_0xde81('0x25')](0x1f4)['send']({'message':_0xde81('0x124')});}return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x3179f2[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x194cdb,null))['then'](removeEntity(_0x194cdb,null))[_0xde81('0x23')](handleError(_0x194cdb,null));};exports[_0xde81('0x125')]=function(_0x49300a,_0x28b1f2){return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x49300a['params']['id']}})['then'](handleEntityNotFound(_0x28b1f2,null))[_0xde81('0x18')](function(_0x532038){if(_0x532038){return _0x532038['addChatInteractions'](_0x49300a[_0xde81('0x69')][_0xde81('0x6d')],_[_0xde81('0x126')](_0x49300a[_0xde81('0x69')],[_0xde81('0x6d'),'id'])||{})[_0xde81('0xae')](function(){for(var _0x1f3d7f=0x0;_0x1f3d7f<_0x49300a[_0xde81('0x69')][_0xde81('0x6d')][_0xde81('0x52')];_0x1f3d7f+=0x1){socket[_0xde81('0x2e')](_0xde81('0x127'),{'ChatInteractionId':Number(_0x49300a[_0xde81('0x69')][_0xde81('0x6d')][_0x1f3d7f]),'UserId':Number(_0x49300a[_0xde81('0x5a')]['id'])});}return _0x49300a[_0xde81('0x69')]['ids'];});}})[_0xde81('0x18')](respondWithResult(_0x28b1f2,null))[_0xde81('0x23')](handleError(_0x28b1f2,null));};exports[_0xde81('0x128')]=function(_0x552458,_0x7a7f0){return db['User'][_0xde81('0x3b')]({'where':{'id':_0x552458[_0xde81('0x5a')]['id']}})['then'](handleEntityNotFound(_0x7a7f0,null))[_0xde81('0x18')](function(_0x43c6d5){if(_0x43c6d5){return _0x43c6d5[_0xde81('0x128')](_0x552458[_0xde81('0x4a')][_0xde81('0x6d')])[_0xde81('0x18')](function(){if(_[_0xde81('0x11e')](_0x552458[_0xde81('0x4a')]['ids'])){for(var _0x4671df=0x0;_0x4671df<_0x552458[_0xde81('0x4a')][_0xde81('0x6d')][_0xde81('0x52')];_0x4671df+=0x1){socket[_0xde81('0x2e')](_0xde81('0x129'),{'ChatInteractionId':Number(_0x552458[_0xde81('0x4a')][_0xde81('0x6d')][_0x4671df]),'UserId':Number(_0x552458[_0xde81('0x5a')]['id'])});}}else{socket[_0xde81('0x2e')](_0xde81('0x129'),{'ChatInteractionId':Number(_0x552458[_0xde81('0x4a')]['ids']),'UserId':Number(_0x552458[_0xde81('0x5a')]['id'])});}});}})[_0xde81('0x18')](respondWithStatusCode(_0x7a7f0,null))[_0xde81('0x23')](handleError(_0x7a7f0,null));};exports[_0xde81('0x12a')]=function(_0x1c3202,_0xf4ba8b){return db['User'][_0xde81('0x3b')]({'where':{'id':_0x1c3202['params']['id']}})[_0xde81('0x18')](handleEntityNotFound(_0xf4ba8b,null))[_0xde81('0x18')](function(_0x320738){if(_0x320738){return _0x320738[_0xde81('0x12a')](_0x1c3202[_0xde81('0x69')][_0xde81('0x6d')],_['omit'](_0x1c3202[_0xde81('0x69')],['ids','id'])||{})['spread'](function(){for(var _0x337a61=0x0;_0x337a61<_0x1c3202['body']['ids'][_0xde81('0x52')];_0x337a61+=0x1){socket[_0xde81('0x2e')]('user_has_mail_interactions:save',{'MailInteractionId':Number(_0x1c3202[_0xde81('0x69')]['ids'][_0x337a61]),'UserId':Number(_0x1c3202['params']['id'])});}return _0x1c3202[_0xde81('0x69')]['ids'];});}})['then'](respondWithResult(_0xf4ba8b,null))[_0xde81('0x23')](handleError(_0xf4ba8b,null));};exports[_0xde81('0x12b')]=function(_0x36efe8,_0x27690f){return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x36efe8[_0xde81('0x5a')]['id']}})['then'](handleEntityNotFound(_0x27690f,null))[_0xde81('0x18')](function(_0x367def){if(_0x367def){return _0x367def[_0xde81('0x12b')](_0x36efe8[_0xde81('0x4a')][_0xde81('0x6d')])['then'](function(){if(_['isArray'](_0x36efe8[_0xde81('0x4a')][_0xde81('0x6d')])){for(var _0x1466b8=0x0;_0x1466b8<_0x36efe8[_0xde81('0x4a')][_0xde81('0x6d')][_0xde81('0x52')];_0x1466b8+=0x1){socket[_0xde81('0x2e')](_0xde81('0x12c'),{'MailInteractionId':Number(_0x36efe8[_0xde81('0x4a')]['ids'][_0x1466b8]),'UserId':Number(_0x36efe8[_0xde81('0x5a')]['id'])});}}else{socket[_0xde81('0x2e')](_0xde81('0x12c'),{'MailInteractionId':Number(_0x36efe8[_0xde81('0x4a')]['ids']),'UserId':Number(_0x36efe8[_0xde81('0x5a')]['id'])});}});}})[_0xde81('0x18')](respondWithStatusCode(_0x27690f,null))[_0xde81('0x23')](handleError(_0x27690f,null));};exports[_0xde81('0x12d')]=function(_0xdb708c,_0x2eed3){return db['User'][_0xde81('0x3b')]({'where':{'id':_0xdb708c[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x2eed3,null))[_0xde81('0x18')](function(_0x5f2e5f){if(_0x5f2e5f){return _0x5f2e5f['addFaxInteractions'](_0xdb708c[_0xde81('0x69')]['ids'],_['omit'](_0xdb708c[_0xde81('0x69')],[_0xde81('0x6d'),'id'])||{})[_0xde81('0xae')](function(){for(var _0x25e571=0x0;_0x25e571<_0xdb708c[_0xde81('0x69')][_0xde81('0x6d')][_0xde81('0x52')];_0x25e571+=0x1){socket['emit'](_0xde81('0x12e'),{'FaxInteractionId':Number(_0xdb708c[_0xde81('0x69')][_0xde81('0x6d')][_0x25e571]),'UserId':Number(_0xdb708c[_0xde81('0x5a')]['id'])});}return _0xdb708c['body'][_0xde81('0x6d')];});}})[_0xde81('0x18')](respondWithResult(_0x2eed3,null))[_0xde81('0x23')](handleError(_0x2eed3,null));};exports[_0xde81('0x12f')]=function(_0x5869f4,_0x121582){return db[_0xde81('0x42')]['find']({'where':{'id':_0x5869f4[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x121582,null))[_0xde81('0x18')](function(_0x2fd60c){if(_0x2fd60c){return _0x2fd60c[_0xde81('0x12f')](_0x5869f4[_0xde81('0x4a')]['ids'])['then'](function(){if(_[_0xde81('0x11e')](_0x5869f4[_0xde81('0x4a')][_0xde81('0x6d')])){for(var _0x274c01=0x0;_0x274c01<_0x5869f4[_0xde81('0x4a')][_0xde81('0x6d')][_0xde81('0x52')];_0x274c01+=0x1){socket['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x5869f4['query'][_0xde81('0x6d')][_0x274c01]),'UserId':Number(_0x5869f4[_0xde81('0x5a')]['id'])});}}else{socket[_0xde81('0x2e')](_0xde81('0x130'),{'FaxInteractionId':Number(_0x5869f4[_0xde81('0x4a')][_0xde81('0x6d')]),'UserId':Number(_0x5869f4[_0xde81('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x121582,null))[_0xde81('0x23')](handleError(_0x121582,null));};exports[_0xde81('0x131')]=function(_0x159779,_0x2a54bc){return db[_0xde81('0x42')]['find']({'where':{'id':_0x159779[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x2a54bc,null))[_0xde81('0x18')](function(_0x40c256){if(_0x40c256){return _0x40c256['addSmsInteractions'](_0x159779[_0xde81('0x69')]['ids'],_[_0xde81('0x126')](_0x159779[_0xde81('0x69')],[_0xde81('0x6d'),'id'])||{})[_0xde81('0xae')](function(){for(var _0x4473e7=0x0;_0x4473e7<_0x159779[_0xde81('0x69')][_0xde81('0x6d')][_0xde81('0x52')];_0x4473e7+=0x1){socket[_0xde81('0x2e')](_0xde81('0x132'),{'SmsInteractionId':Number(_0x159779[_0xde81('0x69')][_0xde81('0x6d')][_0x4473e7]),'UserId':Number(_0x159779[_0xde81('0x5a')]['id'])});}return _0x159779[_0xde81('0x69')]['ids'];});}})[_0xde81('0x18')](respondWithResult(_0x2a54bc,null))[_0xde81('0x23')](handleError(_0x2a54bc,null));};exports['removeSmsInteractions']=function(_0x2367ec,_0x5cc82f){return db[_0xde81('0x42')]['find']({'where':{'id':_0x2367ec[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x5cc82f,null))[_0xde81('0x18')](function(_0x429497){if(_0x429497){return _0x429497[_0xde81('0x133')](_0x2367ec[_0xde81('0x4a')]['ids'])[_0xde81('0x18')](function(){if(_[_0xde81('0x11e')](_0x2367ec[_0xde81('0x4a')]['ids'])){for(var _0x285941=0x0;_0x285941<_0x2367ec['query'][_0xde81('0x6d')][_0xde81('0x52')];_0x285941+=0x1){socket[_0xde81('0x2e')](_0xde81('0x134'),{'SmsInteractionId':Number(_0x2367ec[_0xde81('0x4a')]['ids'][_0x285941]),'UserId':Number(_0x2367ec[_0xde81('0x5a')]['id'])});}}else{socket[_0xde81('0x2e')](_0xde81('0x134'),{'SmsInteractionId':Number(_0x2367ec[_0xde81('0x4a')][_0xde81('0x6d')]),'UserId':Number(_0x2367ec[_0xde81('0x5a')]['id'])});}});}})[_0xde81('0x18')](respondWithStatusCode(_0x5cc82f,null))[_0xde81('0x23')](handleError(_0x5cc82f,null));};exports[_0xde81('0x135')]=function(_0x36b0fa,_0x53d18d){return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x36b0fa[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x53d18d,null))['then'](function(_0x498ccf){if(_0x498ccf){return _0x498ccf[_0xde81('0x135')](_0x36b0fa[_0xde81('0x69')]['ids'],_[_0xde81('0x126')](_0x36b0fa[_0xde81('0x69')],[_0xde81('0x6d'),'id'])||{})[_0xde81('0xae')](function(){for(var _0x57e443=0x0;_0x57e443<_0x36b0fa[_0xde81('0x69')][_0xde81('0x6d')][_0xde81('0x52')];_0x57e443+=0x1){socket['emit'](_0xde81('0x136'),{'OpenchannelInteractionId':Number(_0x36b0fa[_0xde81('0x69')][_0xde81('0x6d')][_0x57e443]),'UserId':Number(_0x36b0fa[_0xde81('0x5a')]['id'])});}return _0x36b0fa[_0xde81('0x69')][_0xde81('0x6d')];});}})[_0xde81('0x18')](respondWithResult(_0x53d18d,null))[_0xde81('0x23')](handleError(_0x53d18d,null));};exports[_0xde81('0x137')]=function(_0x2d6ee7,_0x4a3e7e){return db[_0xde81('0x42')]['find']({'where':{'id':_0x2d6ee7[_0xde81('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4a3e7e,null))[_0xde81('0x18')](function(_0x375f74){if(_0x375f74){return _0x375f74[_0xde81('0x137')](_0x2d6ee7[_0xde81('0x4a')][_0xde81('0x6d')])[_0xde81('0x18')](function(){if(_[_0xde81('0x11e')](_0x2d6ee7[_0xde81('0x4a')][_0xde81('0x6d')])){for(var _0x3f7855=0x0;_0x3f7855<_0x2d6ee7['query'][_0xde81('0x6d')]['length'];_0x3f7855+=0x1){socket['emit'](_0xde81('0x138'),{'OpenchannelInteractionId':Number(_0x2d6ee7[_0xde81('0x4a')][_0xde81('0x6d')][_0x3f7855]),'UserId':Number(_0x2d6ee7[_0xde81('0x5a')]['id'])});}}else{socket[_0xde81('0x2e')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x2d6ee7['query'][_0xde81('0x6d')]),'UserId':Number(_0x2d6ee7[_0xde81('0x5a')]['id'])});}});}})[_0xde81('0x18')](respondWithStatusCode(_0x4a3e7e,null))[_0xde81('0x23')](handleError(_0x4a3e7e,null));};exports[_0xde81('0x139')]=function(_0x2cc5af,_0x517d37){return db['User']['find']({'where':{'id':_0x2cc5af[_0xde81('0x5a')]['id']}})['then'](handleEntityNotFound(_0x517d37,null))[_0xde81('0x18')](function(_0x221b22){if(_0x221b22){return _0x221b22[_0xde81('0x139')](_0x2cc5af['body'][_0xde81('0x6d')],_[_0xde81('0x126')](_0x2cc5af[_0xde81('0x69')],[_0xde81('0x6d'),'id'])||{})[_0xde81('0xae')](function(){for(var _0x1cab05=0x0;_0x1cab05<_0x2cc5af[_0xde81('0x69')]['ids']['length'];_0x1cab05+=0x1){socket['emit'](_0xde81('0x13a'),{'WhatsappInteractionId':Number(_0x2cc5af[_0xde81('0x69')]['ids'][_0x1cab05]),'UserId':Number(_0x2cc5af[_0xde81('0x5a')]['id'])});}return _0x2cc5af['body'][_0xde81('0x6d')];});}})[_0xde81('0x18')](respondWithResult(_0x517d37,null))[_0xde81('0x23')](handleError(_0x517d37,null));};exports['removeWhatsappInteractions']=function(_0xb2a77,_0x52b321){return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0xb2a77[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x52b321,null))['then'](function(_0x24a86a){if(_0x24a86a){return _0x24a86a['removeWhatsappInteractions'](_0xb2a77[_0xde81('0x4a')][_0xde81('0x6d')]);}})[_0xde81('0x18')](respondWithStatusCode(_0x52b321,null))[_0xde81('0x23')](handleError(_0x52b321,null));};exports[_0xde81('0x13b')]=function(_0x5c2984,_0x54038f){var _0x42cd50={};var _0x171883={};var _0x3bc5ec;var _0x1544ee;return db[_0xde81('0x42')][_0xde81('0xcf')]({'where':{'id':_0x5c2984[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x54038f,null))[_0xde81('0x18')](function(_0x395dcc){if(_0x395dcc){_0x3bc5ec=_0x395dcc;_0x171883[_0xde81('0x5b')]=_[_0xde81('0x5d')](db[_0xde81('0x13c')][_0xde81('0x43')]);_0x171883[_0xde81('0x4a')]=_['keys'](_0x5c2984['query']);_0x171883[_0xde81('0x60')]=_['intersection'](_0x171883[_0xde81('0x5b')],_0x171883[_0xde81('0x4a')]);_0x42cd50[_0xde81('0x63')]=_[_0xde81('0x61')](_0x171883['model'],qs[_0xde81('0x62')](_0x5c2984['query'][_0xde81('0x62')]));_0x42cd50[_0xde81('0x63')]=_0x42cd50[_0xde81('0x63')][_0xde81('0x52')]?_0x42cd50['attributes']:_0x171883['model'];_0x42cd50[_0xde81('0xd0')]=qs[_0xde81('0xd1')](_0x5c2984[_0xde81('0x4a')][_0xde81('0xd1')]);_0x42cd50[_0xde81('0x49')]=qs['filters'](_[_0xde81('0xd9')](_0x5c2984[_0xde81('0x4a')],_0x171883[_0xde81('0x60')]));if(_0x5c2984[_0xde81('0x4a')][_0xde81('0x37')]){_0x42cd50[_0xde81('0x49')]=_['merge'](_0x42cd50[_0xde81('0x49')],{'$or':_[_0xde81('0x39')](_0x42cd50[_0xde81('0x63')],function(_0x276631){var _0x4b8f46={};_0x4b8f46[_0x276631]={'$like':'%'+_0x5c2984[_0xde81('0x4a')][_0xde81('0x37')]+'%'};return _0x4b8f46;})});}_0x42cd50=_[_0xde81('0x65')]({},_0x42cd50,_0x5c2984[_0xde81('0x66')]);return _0x3bc5ec[_0xde81('0x13b')](_0x42cd50);}})[_0xde81('0x18')](function(_0x3e2887){if(_0x3e2887){_0x1544ee=_0x3e2887[_0xde81('0x52')];if(!_0x5c2984['query'][_0xde81('0xd2')](_0xde81('0xd6'))){_0x42cd50[_0xde81('0x2a')]=qs['limit'](_0x5c2984[_0xde81('0x4a')][_0xde81('0x2a')]);_0x42cd50[_0xde81('0x28')]=qs[_0xde81('0x28')](_0x5c2984['query']['offset']);}return _0x3bc5ec[_0xde81('0x13b')](_0x42cd50);}})['then'](function(_0x5733cb){if(_0x5733cb){return _0x5733cb?{'count':_0x1544ee,'rows':_0x5733cb}:null;}})[_0xde81('0x18')](respondWithResult(_0x54038f,null))[_0xde81('0x23')](handleError(_0x54038f,null));};exports[_0xde81('0x13d')]=function(_0x407d79,_0x23006e){var _0x589ea6={};var _0x511066={};var _0x6f365d;var _0x4d0b10;return db[_0xde81('0x42')][_0xde81('0xcf')]({'where':{'id':_0x407d79[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x23006e,null))[_0xde81('0x18')](function(_0x411950){if(_0x411950){_0x6f365d=_0x411950;_0x511066['model']=_[_0xde81('0x5d')](db[_0xde81('0x13e')][_0xde81('0x43')]);_0x511066[_0xde81('0x4a')]=_[_0xde81('0x5d')](_0x407d79[_0xde81('0x4a')]);_0x511066[_0xde81('0x60')]=_[_0xde81('0x61')](_0x511066[_0xde81('0x5b')],_0x511066['query']);_0x589ea6['attributes']=_[_0xde81('0x61')](_0x511066[_0xde81('0x5b')],qs['fields'](_0x407d79[_0xde81('0x4a')]['fields']));_0x589ea6[_0xde81('0x63')]=_0x589ea6[_0xde81('0x63')][_0xde81('0x52')]?_0x589ea6[_0xde81('0x63')]:_0x511066[_0xde81('0x5b')];_0x589ea6[_0xde81('0xd0')]=qs[_0xde81('0xd1')](_0x407d79[_0xde81('0x4a')][_0xde81('0xd1')]);_0x589ea6['where']=qs[_0xde81('0x60')](_[_0xde81('0xd9')](_0x407d79[_0xde81('0x4a')],_0x511066[_0xde81('0x60')]));if(_0x407d79['query'][_0xde81('0x37')]){_0x589ea6[_0xde81('0x49')]=_[_0xde81('0x65')](_0x589ea6[_0xde81('0x49')],{'$or':_['map'](_0x589ea6[_0xde81('0x63')],function(_0x41223f){var _0xfd8e05={};_0xfd8e05[_0x41223f]={'$like':'%'+_0x407d79[_0xde81('0x4a')][_0xde81('0x37')]+'%'};return _0xfd8e05;})});}_0x589ea6=_[_0xde81('0x65')]({},_0x589ea6,_0x407d79[_0xde81('0x66')]);return _0x6f365d['getFaxAccounts'](_0x589ea6);}})['then'](function(_0x212cc9){if(_0x212cc9){_0x4d0b10=_0x212cc9['length'];if(!_0x407d79[_0xde81('0x4a')]['hasOwnProperty'](_0xde81('0xd6'))){_0x589ea6['limit']=qs[_0xde81('0x2a')](_0x407d79[_0xde81('0x4a')][_0xde81('0x2a')]);_0x589ea6[_0xde81('0x28')]=qs[_0xde81('0x28')](_0x407d79[_0xde81('0x4a')][_0xde81('0x28')]);}return _0x6f365d['getFaxAccounts'](_0x589ea6);}})['then'](function(_0x184fbc){if(_0x184fbc){return _0x184fbc?{'count':_0x4d0b10,'rows':_0x184fbc}:null;}})[_0xde81('0x18')](respondWithResult(_0x23006e,null))[_0xde81('0x23')](handleError(_0x23006e,null));};exports[_0xde81('0x13f')]=function(_0x545242,_0x2dda4f){return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x545242[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x2dda4f,null))[_0xde81('0x18')](function(_0x3dc697){if(_0x3dc697){return _0x3dc697['addFaxAccounts'](_0x545242[_0xde81('0x69')][_0xde81('0x6d')],_[_0xde81('0x126')](_0x545242[_0xde81('0x69')],[_0xde81('0x6d'),'id'])||{});}})[_0xde81('0x18')](respondWithResult(_0x2dda4f,null))[_0xde81('0x23')](handleError(_0x2dda4f,null));};exports[_0xde81('0x140')]=function(_0x53e6bb,_0x270fb4){return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x53e6bb[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x270fb4,null))[_0xde81('0x18')](function(_0x30f64d){if(_0x30f64d){return _0x30f64d['removeFaxAccounts'](_0x53e6bb['query'][_0xde81('0x6d')]);}})['then'](respondWithStatusCode(_0x270fb4,null))[_0xde81('0x23')](handleError(_0x270fb4,null));};exports['getMailAccounts']=function(_0x3db4b3,_0x4cbb1e){var _0x3dfea6={};var _0x49fbf8={};var _0x2f48b4;var _0x29999f;return db[_0xde81('0x42')][_0xde81('0xcf')]({'where':{'id':_0x3db4b3['params']['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x4cbb1e,null))[_0xde81('0x18')](function(_0x3eb8df){if(_0x3eb8df){_0x2f48b4=_0x3eb8df;_0x49fbf8[_0xde81('0x5b')]=_['keys'](db['MailAccount'][_0xde81('0x43')]);_0x49fbf8[_0xde81('0x4a')]=_['keys'](_0x3db4b3[_0xde81('0x4a')]);_0x49fbf8[_0xde81('0x60')]=_[_0xde81('0x61')](_0x49fbf8[_0xde81('0x5b')],_0x49fbf8[_0xde81('0x4a')]);_0x3dfea6[_0xde81('0x63')]=_[_0xde81('0x61')](_0x49fbf8[_0xde81('0x5b')],qs[_0xde81('0x62')](_0x3db4b3['query'][_0xde81('0x62')]));_0x3dfea6[_0xde81('0x63')]=_0x3dfea6['attributes'][_0xde81('0x52')]?_0x3dfea6[_0xde81('0x63')]:_0x49fbf8[_0xde81('0x5b')];_0x3dfea6[_0xde81('0xd0')]=qs[_0xde81('0xd1')](_0x3db4b3[_0xde81('0x4a')][_0xde81('0xd1')]);_0x3dfea6[_0xde81('0x49')]=qs[_0xde81('0x60')](_[_0xde81('0xd9')](_0x3db4b3[_0xde81('0x4a')],_0x49fbf8[_0xde81('0x60')]));if(_0x3db4b3[_0xde81('0x4a')][_0xde81('0x37')]){_0x3dfea6[_0xde81('0x49')]=_['merge'](_0x3dfea6[_0xde81('0x49')],{'$or':_[_0xde81('0x39')](_0x3dfea6['attributes'],function(_0x302be4){var _0x1bfa25={};_0x1bfa25[_0x302be4]={'$like':'%'+_0x3db4b3[_0xde81('0x4a')][_0xde81('0x37')]+'%'};return _0x1bfa25;})});}_0x3dfea6=_[_0xde81('0x65')]({},_0x3dfea6,_0x3db4b3['options']);return _0x2f48b4['getMailAccounts'](_0x3dfea6);}})[_0xde81('0x18')](function(_0x35dfb3){if(_0x35dfb3){_0x29999f=_0x35dfb3['length'];if(!_0x3db4b3[_0xde81('0x4a')]['hasOwnProperty'](_0xde81('0xd6'))){_0x3dfea6[_0xde81('0x2a')]=qs[_0xde81('0x2a')](_0x3db4b3['query'][_0xde81('0x2a')]);_0x3dfea6['offset']=qs['offset'](_0x3db4b3[_0xde81('0x4a')][_0xde81('0x28')]);}return _0x2f48b4[_0xde81('0x141')](_0x3dfea6);}})['then'](function(_0x35161b){if(_0x35161b){return _0x35161b?{'count':_0x29999f,'rows':_0x35161b}:null;}})[_0xde81('0x18')](respondWithResult(_0x4cbb1e,null))[_0xde81('0x23')](handleError(_0x4cbb1e,null));};exports['addMailAccounts']=function(_0x5082ea,_0x5de6b7){return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x5082ea[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x5de6b7,null))['then'](function(_0x1b1aa1){if(_0x1b1aa1){return _0x1b1aa1[_0xde81('0x142')](_0x5082ea[_0xde81('0x69')][_0xde81('0x6d')],_[_0xde81('0x126')](_0x5082ea[_0xde81('0x69')],[_0xde81('0x6d'),'id'])||{});}})[_0xde81('0x18')](respondWithResult(_0x5de6b7,null))['catch'](handleError(_0x5de6b7,null));};exports['removeMailAccounts']=function(_0x858a7b,_0xae3de1){return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x858a7b[_0xde81('0x5a')]['id']}})['then'](handleEntityNotFound(_0xae3de1,null))[_0xde81('0x18')](function(_0x54b702){if(_0x54b702){return _0x54b702[_0xde81('0x143')](_0x858a7b['query'][_0xde81('0x6d')]);}})[_0xde81('0x18')](respondWithStatusCode(_0xae3de1,null))[_0xde81('0x23')](handleError(_0xae3de1,null));};exports[_0xde81('0x144')]=function(_0x1a9891,_0x1a53b1){var _0x2dd70d={};var _0x4e8130={};var _0xa88663;var _0x9d0695;return db['User']['findOne']({'where':{'id':_0x1a9891[_0xde81('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1a53b1,null))[_0xde81('0x18')](function(_0x3e2fc2){if(_0x3e2fc2){_0xa88663=_0x3e2fc2;_0x4e8130[_0xde81('0x5b')]=_[_0xde81('0x5d')](db[_0xde81('0x145')][_0xde81('0x43')]);_0x4e8130[_0xde81('0x4a')]=_[_0xde81('0x5d')](_0x1a9891[_0xde81('0x4a')]);_0x4e8130[_0xde81('0x60')]=_[_0xde81('0x61')](_0x4e8130[_0xde81('0x5b')],_0x4e8130[_0xde81('0x4a')]);_0x2dd70d[_0xde81('0x63')]=_[_0xde81('0x61')](_0x4e8130[_0xde81('0x5b')],qs[_0xde81('0x62')](_0x1a9891[_0xde81('0x4a')][_0xde81('0x62')]));_0x2dd70d['attributes']=_0x2dd70d['attributes']['length']?_0x2dd70d[_0xde81('0x63')]:_0x4e8130['model'];_0x2dd70d['order']=qs[_0xde81('0xd1')](_0x1a9891[_0xde81('0x4a')][_0xde81('0xd1')]);_0x2dd70d[_0xde81('0x49')]=qs[_0xde81('0x60')](_[_0xde81('0xd9')](_0x1a9891[_0xde81('0x4a')],_0x4e8130[_0xde81('0x60')]));if(_0x1a9891['query']['filter']){_0x2dd70d[_0xde81('0x49')]=_['merge'](_0x2dd70d[_0xde81('0x49')],{'$or':_[_0xde81('0x39')](_0x2dd70d[_0xde81('0x63')],function(_0x42c4b9){var _0x260c90={};_0x260c90[_0x42c4b9]={'$like':'%'+_0x1a9891[_0xde81('0x4a')][_0xde81('0x37')]+'%'};return _0x260c90;})});}_0x2dd70d=_[_0xde81('0x65')]({},_0x2dd70d,_0x1a9891[_0xde81('0x66')]);return _0xa88663[_0xde81('0x144')](_0x2dd70d);}})[_0xde81('0x18')](function(_0x5b0027){if(_0x5b0027){_0x9d0695=_0x5b0027[_0xde81('0x52')];if(!_0x1a9891['query'][_0xde81('0xd2')]('nolimit')){_0x2dd70d[_0xde81('0x2a')]=qs[_0xde81('0x2a')](_0x1a9891[_0xde81('0x4a')][_0xde81('0x2a')]);_0x2dd70d['offset']=qs[_0xde81('0x28')](_0x1a9891['query']['offset']);}return _0xa88663['getOpenchannelAccounts'](_0x2dd70d);}})[_0xde81('0x18')](function(_0x436d12){if(_0x436d12){return _0x436d12?{'count':_0x9d0695,'rows':_0x436d12}:null;}})['then'](respondWithResult(_0x1a53b1,null))['catch'](handleError(_0x1a53b1,null));};exports[_0xde81('0x146')]=function(_0x16dbbe,_0x3c2c22){return db[_0xde81('0x42')]['find']({'where':{'id':_0x16dbbe['params']['id']}})['then'](handleEntityNotFound(_0x3c2c22,null))['then'](function(_0x2d7721){if(_0x2d7721){return _0x2d7721['addOpenchannelAccounts'](_0x16dbbe['body'][_0xde81('0x6d')],_['omit'](_0x16dbbe[_0xde81('0x69')],[_0xde81('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x3c2c22,null))[_0xde81('0x23')](handleError(_0x3c2c22,null));};exports[_0xde81('0x147')]=function(_0x53f544,_0x4aa9a2){return db['User'][_0xde81('0x3b')]({'where':{'id':_0x53f544['params']['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x4aa9a2,null))['then'](function(_0x37db09){if(_0x37db09){return _0x37db09['removeOpenchannelAccounts'](_0x53f544[_0xde81('0x4a')]['ids']);}})[_0xde81('0x18')](respondWithStatusCode(_0x4aa9a2,null))[_0xde81('0x23')](handleError(_0x4aa9a2,null));};exports['getSmsAccounts']=function(_0x4e442c,_0x32d675){var _0x3219a8={};var _0x44d885={};var _0xdd3926;var _0x38d87a;return db[_0xde81('0x42')][_0xde81('0xcf')]({'where':{'id':_0x4e442c[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x32d675,null))[_0xde81('0x18')](function(_0x13c596){if(_0x13c596){_0xdd3926=_0x13c596;_0x44d885['model']=_[_0xde81('0x5d')](db[_0xde81('0x148')][_0xde81('0x43')]);_0x44d885[_0xde81('0x4a')]=_[_0xde81('0x5d')](_0x4e442c[_0xde81('0x4a')]);_0x44d885[_0xde81('0x60')]=_[_0xde81('0x61')](_0x44d885['model'],_0x44d885[_0xde81('0x4a')]);_0x3219a8[_0xde81('0x63')]=_[_0xde81('0x61')](_0x44d885[_0xde81('0x5b')],qs['fields'](_0x4e442c[_0xde81('0x4a')][_0xde81('0x62')]));_0x3219a8[_0xde81('0x63')]=_0x3219a8['attributes']['length']?_0x3219a8[_0xde81('0x63')]:_0x44d885[_0xde81('0x5b')];_0x3219a8['order']=qs[_0xde81('0xd1')](_0x4e442c['query'][_0xde81('0xd1')]);_0x3219a8[_0xde81('0x49')]=qs[_0xde81('0x60')](_[_0xde81('0xd9')](_0x4e442c[_0xde81('0x4a')],_0x44d885[_0xde81('0x60')]));if(_0x4e442c[_0xde81('0x4a')][_0xde81('0x37')]){_0x3219a8[_0xde81('0x49')]=_[_0xde81('0x65')](_0x3219a8['where'],{'$or':_[_0xde81('0x39')](_0x3219a8[_0xde81('0x63')],function(_0x28975f){var _0x450a49={};_0x450a49[_0x28975f]={'$like':'%'+_0x4e442c[_0xde81('0x4a')][_0xde81('0x37')]+'%'};return _0x450a49;})});}_0x3219a8=_[_0xde81('0x65')]({},_0x3219a8,_0x4e442c[_0xde81('0x66')]);return _0xdd3926[_0xde81('0x149')](_0x3219a8);}})['then'](function(_0x1022b9){if(_0x1022b9){_0x38d87a=_0x1022b9[_0xde81('0x52')];if(!_0x4e442c['query'][_0xde81('0xd2')](_0xde81('0xd6'))){_0x3219a8[_0xde81('0x2a')]=qs[_0xde81('0x2a')](_0x4e442c['query']['limit']);_0x3219a8[_0xde81('0x28')]=qs['offset'](_0x4e442c[_0xde81('0x4a')][_0xde81('0x28')]);}return _0xdd3926[_0xde81('0x149')](_0x3219a8);}})['then'](function(_0x43921d){if(_0x43921d){return _0x43921d?{'count':_0x38d87a,'rows':_0x43921d}:null;}})['then'](respondWithResult(_0x32d675,null))[_0xde81('0x23')](handleError(_0x32d675,null));};exports[_0xde81('0x14a')]=function(_0x400748,_0x5ad748){return db['User'][_0xde81('0x3b')]({'where':{'id':_0x400748[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x5ad748,null))['then'](function(_0x13a1be){if(_0x13a1be){return _0x13a1be[_0xde81('0x14a')](_0x400748[_0xde81('0x69')]['ids'],_[_0xde81('0x126')](_0x400748[_0xde81('0x69')],[_0xde81('0x6d'),'id'])||{});}})[_0xde81('0x18')](respondWithResult(_0x5ad748,null))[_0xde81('0x23')](handleError(_0x5ad748,null));};exports['removeSmsAccounts']=function(_0x29618d,_0x4a183f){return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x29618d[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x4a183f,null))[_0xde81('0x18')](function(_0x4d0db8){if(_0x4d0db8){return _0x4d0db8[_0xde81('0x14b')](_0x29618d[_0xde81('0x4a')][_0xde81('0x6d')]);}})[_0xde81('0x18')](respondWithStatusCode(_0x4a183f,null))[_0xde81('0x23')](handleError(_0x4a183f,null));};exports[_0xde81('0x14c')]=function(_0x18f88c,_0x13301e){var _0x21d357={};var _0x2dbce9={};var _0x4443cd;var _0x1028bf;return db['User'][_0xde81('0xcf')]({'where':{'id':_0x18f88c['params']['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x13301e,null))['then'](function(_0x41a4d4){if(_0x41a4d4){_0x4443cd=_0x41a4d4;_0x2dbce9[_0xde81('0x5b')]=_[_0xde81('0x5d')](db[_0xde81('0x14d')][_0xde81('0x43')]);_0x2dbce9[_0xde81('0x4a')]=_[_0xde81('0x5d')](_0x18f88c[_0xde81('0x4a')]);_0x2dbce9['filters']=_[_0xde81('0x61')](_0x2dbce9[_0xde81('0x5b')],_0x2dbce9['query']);_0x21d357[_0xde81('0x63')]=_[_0xde81('0x61')](_0x2dbce9[_0xde81('0x5b')],qs['fields'](_0x18f88c[_0xde81('0x4a')]['fields']));_0x21d357[_0xde81('0x63')]=_0x21d357[_0xde81('0x63')]['length']?_0x21d357[_0xde81('0x63')]:_0x2dbce9[_0xde81('0x5b')];_0x21d357[_0xde81('0xd0')]=qs[_0xde81('0xd1')](_0x18f88c['query']['sort']);_0x21d357['where']=qs[_0xde81('0x60')](_[_0xde81('0xd9')](_0x18f88c[_0xde81('0x4a')],_0x2dbce9['filters']));if(_0x18f88c[_0xde81('0x4a')][_0xde81('0x37')]){_0x21d357['where']=_[_0xde81('0x65')](_0x21d357[_0xde81('0x49')],{'$or':_['map'](_0x21d357[_0xde81('0x63')],function(_0x322117){var _0x4aba94={};_0x4aba94[_0x322117]={'$like':'%'+_0x18f88c[_0xde81('0x4a')][_0xde81('0x37')]+'%'};return _0x4aba94;})});}_0x21d357=_[_0xde81('0x65')]({},_0x21d357,_0x18f88c[_0xde81('0x66')]);return _0x4443cd[_0xde81('0x14c')](_0x21d357);}})[_0xde81('0x18')](function(_0x31945a){if(_0x31945a){_0x1028bf=_0x31945a[_0xde81('0x52')];if(!_0x18f88c[_0xde81('0x4a')][_0xde81('0xd2')]('nolimit')){_0x21d357[_0xde81('0x2a')]=qs[_0xde81('0x2a')](_0x18f88c[_0xde81('0x4a')][_0xde81('0x2a')]);_0x21d357[_0xde81('0x28')]=qs[_0xde81('0x28')](_0x18f88c[_0xde81('0x4a')]['offset']);}return _0x4443cd[_0xde81('0x14c')](_0x21d357);}})['then'](function(_0x278d5f){if(_0x278d5f){return _0x278d5f?{'count':_0x1028bf,'rows':_0x278d5f}:null;}})[_0xde81('0x18')](respondWithResult(_0x13301e,null))[_0xde81('0x23')](handleError(_0x13301e,null));};exports[_0xde81('0x14e')]=function(_0x581222,_0x2f6a22){return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x581222[_0xde81('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2f6a22,null))[_0xde81('0x18')](function(_0xe96a72){if(_0xe96a72){return _0xe96a72[_0xde81('0x14e')](_0x581222['body']['ids'],_[_0xde81('0x126')](_0x581222[_0xde81('0x69')],[_0xde81('0x6d'),'id'])||{});}})[_0xde81('0x18')](respondWithResult(_0x2f6a22,null))['catch'](handleError(_0x2f6a22,null));};exports[_0xde81('0x14f')]=function(_0x2a8d85,_0x47a675){return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x2a8d85[_0xde81('0x5a')]['id']}})['then'](handleEntityNotFound(_0x47a675,null))[_0xde81('0x18')](function(_0x3d7a87){if(_0x3d7a87){return _0x3d7a87[_0xde81('0x14f')](_0x2a8d85[_0xde81('0x4a')][_0xde81('0x6d')]);}})[_0xde81('0x18')](respondWithStatusCode(_0x47a675,null))[_0xde81('0x23')](handleError(_0x47a675,null));};exports[_0xde81('0x150')]=function(_0x1436e3,_0xa450e7){var _0x3126b7={};var _0x2ce8c8={};var _0xea8d5;var _0x508ad6;return db[_0xde81('0x42')][_0xde81('0xcf')]({'where':{'id':_0x1436e3[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0xa450e7,null))['then'](function(_0x47928f){if(_0x47928f){_0xea8d5=_0x47928f;_0x2ce8c8[_0xde81('0x5b')]=_[_0xde81('0x5d')](db[_0xde81('0x151')]['rawAttributes']);_0x2ce8c8[_0xde81('0x4a')]=_['keys'](_0x1436e3['query']);_0x2ce8c8[_0xde81('0x60')]=_['intersection'](_0x2ce8c8[_0xde81('0x5b')],_0x2ce8c8[_0xde81('0x4a')]);_0x3126b7[_0xde81('0x63')]=_[_0xde81('0x61')](_0x2ce8c8[_0xde81('0x5b')],qs[_0xde81('0x62')](_0x1436e3['query']['fields']));_0x3126b7[_0xde81('0x63')]=_0x3126b7[_0xde81('0x63')]['length']?_0x3126b7[_0xde81('0x63')]:_0x2ce8c8['model'];_0x3126b7['order']=qs[_0xde81('0xd1')](_0x1436e3[_0xde81('0x4a')][_0xde81('0xd1')]);_0x3126b7[_0xde81('0x49')]=qs[_0xde81('0x60')](_['pick'](_0x1436e3[_0xde81('0x4a')],_0x2ce8c8[_0xde81('0x60')]));if(_0x1436e3[_0xde81('0x4a')][_0xde81('0x37')]){_0x3126b7[_0xde81('0x49')]=_[_0xde81('0x65')](_0x3126b7[_0xde81('0x49')],{'$or':_[_0xde81('0x39')](_0x3126b7[_0xde81('0x63')],function(_0x155dd7){var _0x1c0c00={};_0x1c0c00[_0x155dd7]={'$like':'%'+_0x1436e3['query']['filter']+'%'};return _0x1c0c00;})});}_0x3126b7=_[_0xde81('0x65')]({},_0x3126b7,_0x1436e3['options']);return _0xea8d5[_0xde81('0x150')](_0x3126b7);}})[_0xde81('0x18')](function(_0x38e7f4){if(_0x38e7f4){_0x508ad6=_0x38e7f4[_0xde81('0x52')];if(!_0x1436e3[_0xde81('0x4a')][_0xde81('0xd2')]('nolimit')){_0x3126b7['limit']=qs['limit'](_0x1436e3['query']['limit']);_0x3126b7[_0xde81('0x28')]=qs['offset'](_0x1436e3[_0xde81('0x4a')][_0xde81('0x28')]);}return _0xea8d5[_0xde81('0x150')](_0x3126b7);}})['then'](function(_0x50408b){if(_0x50408b){return _0x50408b?{'count':_0x508ad6,'rows':_0x50408b}:null;}})['then'](respondWithResult(_0xa450e7,null))['catch'](handleError(_0xa450e7,null));};exports[_0xde81('0x152')]=function(_0x28e127,_0x599b69){return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x28e127[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x599b69,null))['then'](function(_0xc8367d){if(_0xc8367d){return _0xc8367d[_0xde81('0x152')](_0x28e127['body'][_0xde81('0x6d')],_[_0xde81('0x126')](_0x28e127[_0xde81('0x69')],['ids','id'])||{});}})[_0xde81('0x18')](respondWithResult(_0x599b69,null))['catch'](handleError(_0x599b69,null));};exports['removeWhatsappAccounts']=function(_0x3f29b6,_0x41e93a){return db['User']['find']({'where':{'id':_0x3f29b6['params']['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x41e93a,null))[_0xde81('0x18')](function(_0x323cc9){if(_0x323cc9){return _0x323cc9[_0xde81('0x153')](_0x3f29b6[_0xde81('0x4a')]['ids']);}})[_0xde81('0x18')](respondWithStatusCode(_0x41e93a,null))['catch'](handleError(_0x41e93a,null));};exports[_0xde81('0x154')]=function(_0x45e811,_0x215ff3){var _0x3335eb={};var _0x32456b={};var _0x3a5c51;var _0x109b89;return db[_0xde81('0x42')][_0xde81('0xcf')]({'where':{'id':_0x45e811[_0xde81('0x5a')]['id']}})['then'](handleEntityNotFound(_0x215ff3,null))['then'](function(_0x301795){if(_0x301795){_0x3a5c51=_0x301795;_0x32456b[_0xde81('0x5b')]=_[_0xde81('0x5d')](db[_0xde81('0x155')][_0xde81('0x43')]);_0x32456b[_0xde81('0x4a')]=_[_0xde81('0x5d')](_0x45e811['query']);_0x32456b['filters']=_['intersection'](_0x32456b['model'],_0x32456b['query']);_0x3335eb[_0xde81('0x63')]=_[_0xde81('0x61')](_0x32456b[_0xde81('0x5b')],qs['fields'](_0x45e811['query'][_0xde81('0x62')]));_0x3335eb[_0xde81('0x63')]=_0x3335eb[_0xde81('0x63')][_0xde81('0x52')]?_0x3335eb[_0xde81('0x63')]:_0x32456b[_0xde81('0x5b')];_0x3335eb[_0xde81('0xd0')]=qs[_0xde81('0xd1')](_0x45e811[_0xde81('0x4a')][_0xde81('0xd1')]);_0x3335eb[_0xde81('0x49')]=qs[_0xde81('0x60')](_[_0xde81('0xd9')](_0x45e811[_0xde81('0x4a')],_0x32456b[_0xde81('0x60')]));if(_0x45e811[_0xde81('0x4a')][_0xde81('0x37')]){_0x3335eb[_0xde81('0x49')]=_[_0xde81('0x65')](_0x3335eb[_0xde81('0x49')],{'$or':_[_0xde81('0x39')](_0x3335eb['attributes'],function(_0x149925){var _0x23daba={};_0x23daba[_0x149925]={'$like':'%'+_0x45e811[_0xde81('0x4a')][_0xde81('0x37')]+'%'};return _0x23daba;})});}_0x3335eb=_['merge']({},_0x3335eb,_0x45e811[_0xde81('0x66')]);return _0x3a5c51['getSquareProjects'](_0x3335eb);}})['then'](function(_0x201c27){if(_0x201c27){_0x109b89=_0x201c27[_0xde81('0x52')];if(!_0x45e811['query'][_0xde81('0xd2')](_0xde81('0xd6'))){_0x3335eb[_0xde81('0x2a')]=qs[_0xde81('0x2a')](_0x45e811[_0xde81('0x4a')][_0xde81('0x2a')]);_0x3335eb['offset']=qs[_0xde81('0x28')](_0x45e811[_0xde81('0x4a')][_0xde81('0x28')]);}return _0x3a5c51['getSquareProjects'](_0x3335eb);}})[_0xde81('0x18')](function(_0x3d1510){if(_0x3d1510){return _0x3d1510?{'count':_0x109b89,'rows':_0x3d1510}:null;}})[_0xde81('0x18')](respondWithResult(_0x215ff3,null))[_0xde81('0x23')](handleError(_0x215ff3,null));};exports[_0xde81('0x156')]=function(_0x56b4a7,_0x36fe79){return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x56b4a7[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x36fe79,null))[_0xde81('0x18')](function(_0x54cb4a){if(_0x54cb4a){return _0x54cb4a['addSquareProjects'](_0x56b4a7['body']['ids'],_[_0xde81('0x126')](_0x56b4a7[_0xde81('0x69')],[_0xde81('0x6d'),'id'])||{});}})[_0xde81('0x18')](respondWithResult(_0x36fe79,null))[_0xde81('0x23')](handleError(_0x36fe79,null));};exports[_0xde81('0x157')]=function(_0x29dc42,_0x5e5670){return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x29dc42[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x5e5670,null))[_0xde81('0x18')](function(_0x8ec30a){if(_0x8ec30a){return _0x8ec30a['removeSquareProjects'](_0x29dc42[_0xde81('0x4a')][_0xde81('0x6d')]);}})[_0xde81('0x18')](respondWithStatusCode(_0x5e5670,null))[_0xde81('0x23')](handleError(_0x5e5670,null));};exports[_0xde81('0x158')]=function(_0x2e3ec7,_0x108d2f){var _0x567dc5={},_0x5d2a64={},_0x1e1613={'count':0x0,'rows':[]};var _0x1c8b38=db[_0xde81('0x159')][_0xde81('0x43')];_0x5d2a64[_0xde81('0x5b')]=_['keys'](_0x1c8b38);_0x5d2a64[_0xde81('0x4a')]=_[_0xde81('0x5d')](_0x2e3ec7[_0xde81('0x4a')]);_0x5d2a64[_0xde81('0x60')]=_[_0xde81('0x61')](_0x5d2a64[_0xde81('0x5b')],_0x5d2a64[_0xde81('0x4a')]);_0x5d2a64['filters']=_[_0xde81('0xcd')](_0x5d2a64[_0xde81('0x60')],[_0xde81('0x15a'),_0xde81('0x15b'),'$gt',_0xde81('0x15c'),_0xde81('0x15d'),'$lte',_0xde81('0x15e'),_0xde81('0x15f'),_0xde81('0x160'),_0xde81('0x161'),_0xde81('0x162'),'$in','$notIn',_0xde81('0x163'),_0xde81('0x164'),'$iLike','$notILike',_0xde81('0x163'),_0xde81('0x165'),_0xde81('0x166'),'$contained',_0xde81('0x167')]);_0x567dc5[_0xde81('0x63')]=_['intersection'](_0x5d2a64[_0xde81('0x5b')],qs[_0xde81('0x62')](_0x2e3ec7[_0xde81('0x4a')][_0xde81('0x62')]));_0x567dc5[_0xde81('0x63')]=_0x567dc5[_0xde81('0x63')][_0xde81('0x52')]?_0x567dc5['attributes']:_0x5d2a64[_0xde81('0x5b')];if(!_0x2e3ec7[_0xde81('0x4a')][_0xde81('0xd2')](_0xde81('0xd6'))){_0x567dc5[_0xde81('0x2a')]=qs['limit'](_0x2e3ec7[_0xde81('0x4a')][_0xde81('0x2a')]);_0x567dc5[_0xde81('0x28')]=qs[_0xde81('0x28')](_0x2e3ec7['query'][_0xde81('0x28')]);}_0x567dc5[_0xde81('0xd0')]=qs[_0xde81('0xd1')](_0x2e3ec7[_0xde81('0x4a')][_0xde81('0xd1')]);_0x567dc5[_0xde81('0x49')]=qs[_0xde81('0x60')](_[_0xde81('0xd9')](_0x2e3ec7[_0xde81('0x4a')],_0x5d2a64['filters']));if(_0x2e3ec7[_0xde81('0x4a')]['filter']){_0x567dc5['where']=_[_0xde81('0x65')](_0x567dc5[_0xde81('0x49')],{'$or':_[_0xde81('0x39')](_0x567dc5[_0xde81('0x63')],function(_0x39cba7){var _0x46d0b5={};_0x46d0b5[_0x39cba7]={'$like':'%'+_0x2e3ec7[_0xde81('0x4a')][_0xde81('0x37')]+'%'};return _0x46d0b5;})});}_0x567dc5[_0xde81('0x49')]={'$and':[_0x567dc5[_0xde81('0x49')],{'$or':[{'UserId':_0x2e3ec7['params']['id']},{'OwnerId':_0x2e3ec7['params']['id']}]}]};_0x567dc5=_[_0xde81('0x65')]({},_0x567dc5,_0x2e3ec7[_0xde81('0x66')]);var _0x22d792={'where':_0x567dc5['where']};return db['CmHopper']['count'](_0x22d792)[_0xde81('0x18')](function(_0x20634d){_0x1e1613[_0xde81('0x2b')]=_0x20634d;if(_0x2e3ec7[_0xde81('0x4a')][_0xde81('0x64')]){_0x567dc5['include']=[{'attributes':['id',_0xde81('0x168'),_0xde81('0x169'),_0xde81('0xec')],'model':db[_0xde81('0x16a')],'as':'Contact'},{'attributes':['id',_0xde81('0x3c'),_0xde81('0x16b')],'model':db[_0xde81('0xb1')],'as':_0xde81('0xd8')}];}return db[_0xde81('0x159')][_0xde81('0xb2')](_0x567dc5);})['then'](function(_0x75108c){_0x1e1613['rows']=_0x75108c;return _0x1e1613;})[_0xde81('0x18')](respondWithFilteredResult(_0x108d2f,_0x567dc5))[_0xde81('0x23')](handleError(_0x108d2f,null));};exports[_0xde81('0x16c')]=function(_0x32f746,_0x16826a){if(!_[_0xde81('0x72')](_0x32f746[_0xde81('0x33')]['id'])&&(_0x32f746['user']['role']==_0xde81('0x31')||_0x32f746['user']['role']==_0xde81('0x33'))){return db[_0xde81('0x42')][_0xde81('0xcf')]({'where':{'id':_0x32f746[_0xde81('0x5a')]['id']},'raw':!![]})[_0xde81('0x18')](function(_0x3cc471){return authService[_0xde81('0x16d')](_0x3cc471);})[_0xde81('0x18')](function(_0x75792c){if(_0x75792c){return _0x16826a[_0xde81('0x25')](0xc8)[_0xde81('0x27')]({'api_key':_0x75792c[_0xde81('0x16e')]});}else{return _0x16826a[_0xde81('0x25')](0xcc)[_0xde81('0x27')]({'message':'No\x20API\x20access\x20key\x20found!'});}})[_0xde81('0x23')](handleError(_0x16826a,0x193));}else{return _0x16826a[_0xde81('0x25')](0x191)['json']({'message':_0xde81('0x16f')});}};exports[_0xde81('0x170')]=function(_0x5444a6,_0x2f5797){if(!_['isNil'](_0x5444a6[_0xde81('0x33')]['id'])&&(_0x5444a6['user'][_0xde81('0x6a')]==_0xde81('0x31')||_0x5444a6['user'][_0xde81('0x6a')]=='user')){return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x5444a6[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](function(_0x3e21b9){return authService['generateApiKey'](_0x3e21b9);})[_0xde81('0x18')](function(_0x1953a4){return db[_0xde81('0x42')]['update']({'apiKeyIat':_0x1953a4['iat'],'apiKeyNonce':_0x1953a4[_0xde81('0x171')]},{'where':{'id':_0x5444a6[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](function(){return _0x2f5797[_0xde81('0x25')](0xc8)[_0xde81('0x27')]({'api_key':_0x1953a4[_0xde81('0x16e')]});});})[_0xde81('0x23')](handleError(_0x2f5797,0x193));}else{return _0x2f5797[_0xde81('0x25')](0x191)[_0xde81('0x27')]({'message':_0xde81('0x16f')});}};exports[_0xde81('0x172')]=function(_0x4c1c8f,_0x364e35){if(!_['isNil'](_0x4c1c8f[_0xde81('0x33')]['id'])&&(_0x4c1c8f[_0xde81('0x33')]['role']==_0xde81('0x31')||_0x4c1c8f[_0xde81('0x33')][_0xde81('0x6a')]=='user')){return db[_0xde81('0x42')][_0xde81('0x3b')]({'where':{'id':_0x4c1c8f[_0xde81('0x5a')]['id']}})[_0xde81('0x18')](handleEntityNotFound(_0x364e35,null))['then'](function(_0x5eab88){if(_0x5eab88&&_0x5eab88[_0xde81('0x173')]&&_0x5eab88[_0xde81('0x174')])return _0x5eab88;else throw{'message':_0xde81('0x175')};})[_0xde81('0x18')](function(){return db[_0xde81('0x42')][_0xde81('0x2d')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x4c1c8f[_0xde81('0x5a')]['id']}});})[_0xde81('0x18')](respondWithStatusCode(_0x364e35,0xc8))[_0xde81('0x23')](handleError(_0x364e35,0x193));}else{return _0x364e35[_0xde81('0x25')](0x191)[_0xde81('0x27')]({'message':_0xde81('0x16f')});}};exports['whoami']=function(_0x415ceb,_0x4ae53f){var _0x10af9a=_0x415ceb[_0xde81('0x33')][_0xde81('0x30')]({'plain':!![]});if(!_0x10af9a){return _0x4ae53f[_0xde81('0x25')](0x191)[_0xde81('0x40')](_0xde81('0x176'));}else{Promise[_0xde81('0x102')]()[_0xde81('0x18')](function(){if(_0x415ceb[_0xde81('0x4a')][_0xde81('0x4e')]!==_0xde81('0x4c'))return;return _0x415ceb[_0xde81('0x33')][_0xde81('0x177')]();})['then'](function(_0x3c6aef){if(!_0x3c6aef)return;return _0x3c6aef[_0xde81('0x30')]({'plain':!![]});})[_0xde81('0x18')](function(_0x20e27e){_0x10af9a[_0xde81('0x4e')]=_0x20e27e;return _0x4ae53f[_0xde81('0x25')](0xc8)[_0xde81('0x27')](_0x10af9a);});}};exports[_0xde81('0x178')]=function(_0x3649cd,_0x4f9fdd){var _0x1e34f4={'offset':0x0},_0x35c932={'count':0x0,'rows':[]};Promise[_0xde81('0x102')]()['then'](function(){if(!_0x3649cd[_0xde81('0x4a')][_0xde81('0x37')]&&!_0x3649cd[_0xde81('0x4a')][_0xde81('0x179')]&&!_0x3649cd['query']['queues'])return[];return Promise[_0xde81('0x102')]()[_0xde81('0x18')](function(){var _0x3249e6=[];if(!_['isEmpty'](_0x3649cd[_0xde81('0x4a')][_0xde81('0x179')])){_0x3249e6['push'](db[_0xde81('0x115')][_0xde81('0xb2')]({'attributes':['id',_0xde81('0x3c')],'where':{'id':_0x3649cd[_0xde81('0x4a')][_0xde81('0x179')]}}));}if(!_['isEmpty'](_0x3649cd[_0xde81('0x4a')][_0xde81('0x17a')])){_0x3249e6[_0xde81('0x4f')](db['VoiceQueue']['findAll']({'attributes':['id',_0xde81('0x3c')],'type':_0xde81('0x17b'),'where':{'id':_0x3649cd['query'][_0xde81('0x17a')]}}));}return Promise[_0xde81('0x58')](_0x3249e6);})[_0xde81('0x18')](function(_0x34b9b3){var _0xa139ef=_['flatten'](_0x34b9b3)['map'](function(_0x161219){return _0x161219[_0xde81('0x17c')]({'attributes':['id','name',_0xde81('0x6e'),_0xde81('0xa3')],'raw':!![]});});return Promise[_0xde81('0x58')](_0xa139ef);})[_0xde81('0x18')](function(_0x7e1383){var _0x415142=_[_0xde81('0x17d')](_0x7e1383);if(!_0x3649cd[_0xde81('0x4a')][_0xde81('0x37')])return _0x415142;if(_[_0xde81('0x92')](_0x415142)){return db[_0xde81('0x42')]['findAll']({'attributes':['id',_0xde81('0x3c'),'internal',_0xde81('0xa3')],'where':{'role':_0xde81('0x35'),'$or':[db[_0xde81('0x74')][_0xde81('0x49')](db['sequelize']['fn'](_0xde81('0x17e'),db[_0xde81('0x74')][_0xde81('0x17f')]('name')),{'$like':'%'+_0x3649cd[_0xde81('0x4a')][_0xde81('0x37')]['toLowerCase']()+'%'}),{'internal':{'$like':'%'+_0x3649cd['query'][_0xde81('0x37')]+'%'}}]},'raw':!![]});}else{return _(_0x415142)[_0xde81('0x17d')]()[_0xde81('0x37')](function(_0x289c52){return _0x289c52[_0xde81('0x3c')][_0xde81('0xab')]()['includes'](_0x3649cd[_0xde81('0x4a')]['filter'][_0xde81('0xab')]())||_0x289c52[_0xde81('0x6e')][_0xde81('0x180')]()[_0xde81('0x47')](_0x3649cd[_0xde81('0x4a')][_0xde81('0x37')]);})[_0xde81('0x3a')]();}})[_0xde81('0x18')](function(_0x1eea0c){var _0x25ff0f=_0xde81('0x3c');var _0x1ddc8e=_0xde81('0x181');if(_0x3649cd[_0xde81('0x4a')][_0xde81('0xd1')]){_0x1ddc8e=_0x3649cd['query'][_0xde81('0xd1')][0x0]==='-'?_0xde81('0x182'):_0xde81('0x181');_0x25ff0f=_0x1ddc8e===_0xde81('0x181')?_0x3649cd[_0xde81('0x4a')]['sort']:_0x3649cd[_0xde81('0x4a')][_0xde81('0xd1')][_0xde81('0x183')](0x1);}return _(_0x1eea0c)['uniqBy']('id')['orderBy']([function(_0x1c9962){return _0x25ff0f===_0xde81('0x3c')?_0x1c9962[_0x25ff0f][_0xde81('0xab')]():_0x1c9962[_0x25ff0f];}],[_0x1ddc8e])['map'](function(_0x4c6e8c){return _[_0xde81('0xd9')](_0x4c6e8c,['id',_0xde81('0x3c'),_0xde81('0x6e'),'online']);})['value']();})[_0xde81('0x18')](function(_0x2a36b9){return client[_0xde81('0x17')](_0xde81('0x34'),_0x3649cd)['then'](function(_0x2e5827){if(_0x2e5827[_0xde81('0x1f')])throw new Error(_0xde81('0x184'));var _0x223e96=_0x2e5827[_0xde81('0x22')];var _0x504339=jayson[_0xde81('0x15')][_0xde81('0x16')]({'port':0x232c});return _0x504339[_0xde81('0x17')](_0xde81('0x34'),_0x3649cd)[_0xde81('0x18')](function(_0x5865f8){if(_0x5865f8[_0xde81('0x1f')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x49f10a=_0x5865f8[_0xde81('0x22')];return _[_0xde81('0x65')]({},_0x49f10a,_0x223e96);});})['then'](function(_0x3483e4){return _[_0xde81('0x39')](_0x2a36b9,function(_0xd68465){var _0x2b027d=_[_0xde81('0x3b')](_0x3483e4[_0xde81('0x50')],['id',_0xd68465['id']]);if(!_0x2b027d||!_0xd68465[_0xde81('0xa3')]){_0xd68465[_0xde81('0x25')]='offline';}else if(_0x2b027d[_0xde81('0xa5')]){_0xd68465[_0xde81('0x25')]=_0xde81('0x103');}else{_0xd68465[_0xde81('0x25')]=_[_0xde81('0x47')]([_0xde81('0x185'),_0xde81('0x186'),_0xde81('0x187'),_0xde81('0x188'),null,undefined],_0x2b027d[_0xde81('0x189')])?_0xde81('0xa3'):_0xde81('0x18a');}return _0xd68465;});});});})[_0xde81('0x18')](function(_0x321d6a){if(!_0x3649cd['query'][_0xde81('0xd2')](_0xde81('0xd6'))){_0x1e34f4[_0xde81('0x2a')]=qs['limit'](_0x3649cd['query']['limit']||0xa);_0x1e34f4['offset']=qs[_0xde81('0x28')](_0x3649cd[_0xde81('0x4a')][_0xde81('0x28')]);}_0x35c932[_0xde81('0x2b')]=_0x321d6a['length'];_0x35c932[_0xde81('0x50')]=_0x1e34f4[_0xde81('0x2a')]?_0x321d6a[_0xde81('0x18b')](_0x1e34f4[_0xde81('0x28')],_0x1e34f4[_0xde81('0x28')]+_0x1e34f4['limit']):_0x321d6a;return _0x35c932;})['then'](respondWithFilteredResult(_0x4f9fdd,_0x1e34f4))[_0xde81('0x23')](handleError(_0x4f9fdd,null));};function get_open_tabs(_0x4b2f91,_0x1170f8){var _0x19bc00=_0x4b2f91['charAt'](0x0)[_0xde81('0x18c')]()+_0x4b2f91['slice'](0x1);var _0x3eb28e={'type':db[_0xde81('0x95')]['QueryTypes'][_0xde81('0x76')],'raw':!![]};return new BPromise(function(_0x314100,_0x9f82a){var _0x196a08=squel[_0xde81('0x18d')]()[_0xde81('0x18e')](_0xde81('0x18f')+_0x19bc00+_0xde81('0x190'),'id')['field']('ui.createdAt')['from']('user_has_'+_0x4b2f91+'_interactions','ui')[_0xde81('0x49')](_0xde81('0x191'),_0x1170f8['id']);return db['sequelize'][_0xde81('0x4a')](_0x196a08['toString'](),_0x3eb28e)[_0xde81('0x18')](function(_0x531b11){_0x1170f8[_0x19bc00+_0xde81('0x192')]=_0x531b11;_0x314100(_0x531b11);})[_0xde81('0x23')](function(_0x43d409){_0x9f82a(_0x43d409);});});}
\ No newline at end of file
index 4290b33..f703537 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc36=['exports','events','../../mysqldb','User','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xcc36,0x191));var _0x6cc3=function(_0x5c9b60,_0x395d0b){_0x5c9b60=_0x5c9b60-0x0;var _0x4bdc48=_0xcc36[_0x5c9b60];return _0x4bdc48;};'use strict';var EventEmitter=require(_0x6cc3('0x0'));var User=require(_0x6cc3('0x1'))['db'][_0x6cc3('0x2')];var UserEvents=new EventEmitter();UserEvents[_0x6cc3('0x3')](0x0);var events={'afterCreate':_0x6cc3('0x4'),'afterUpdate':_0x6cc3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3c61ae){return function(_0x39b1d7,_0x4e3718,_0x5aef25){UserEvents['emit'](_0x3c61ae+':'+_0x39b1d7['id'],_0x39b1d7);UserEvents[_0x6cc3('0x6')](_0x3c61ae,_0x39b1d7);_0x5aef25(null);};}for(var e in events){if(events[_0x6cc3('0x7')](e)){var event=events[e];User[_0x6cc3('0x8')](e,emitEvent(event));}}module[_0x6cc3('0x9')]=UserEvents;
\ No newline at end of file
+var _0x2276=['save','hasOwnProperty','hook','exports','events','../../mysqldb','User'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2276,0x1a1));var _0x6227=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x2276[_0x9dfc10];return _0x4f938a;};'use strict';var EventEmitter=require(_0x6227('0x0'));var User=require(_0x6227('0x1'))['db'][_0x6227('0x2')];var UserEvents=new EventEmitter();UserEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6227('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x31f7aa){return function(_0xa7e64d,_0x3d7582,_0x225912){UserEvents['emit'](_0x31f7aa+':'+_0xa7e64d['id'],_0xa7e64d);UserEvents['emit'](_0x31f7aa,_0xa7e64d);_0x225912(null);};}for(var e in events){if(events[_0x6227('0x4')](e)){var event=events[e];User[_0x6227('0x5')](e,emitEvent(event));}}module[_0x6227('0x6')]=UserEvents;
\ No newline at end of file
index bc7e5bd..6b5f9c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a44=['Invalid\x20password',':asterisk:','bluebird','crypto','util','md5','lodash','./user.attributes','google','length','context','system','%s%s','merge','Set','format','CDR(type)=%s','chanspy','record','push','MixMonitor','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','wav','WAV','gsm','from-sip','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','SIP/%s,,tTxXU(xcally-mixmonitor-context)','Dial','SIP/%s,,tTxX','Hangup','defaults','VoiceChanSpy','findAll','then','internal','concat','catch','exports','define','users','utf8_bin','userProfileId','undefined','UserProfile','privacyEnabled','resolve','changed','password','updateMd5Password','updatePassword','createUserSetting','error','VoiceExtension','bulkCreate','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','salt','base64','pbkdf2Sync','sha1','pbkdf2','indexOf','provider'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0x4a44,0xf2));var _0x44a4=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4a44[_0x2dafbe];return _0x58a45a;};'use strict';var BPromise=require(_0x44a4('0x0'));var crypto=require(_0x44a4('0x1'));var util=require(_0x44a4('0x2'));var md5=require(_0x44a4('0x3'));var _=require(_0x44a4('0x4'));var attributes=require(_0x44a4('0x5'));var authTypes=[_0x44a4('0x6')];var validatePresenceOf=function(_0x1f0b97){return _0x1f0b97&&_0x1f0b97[_0x44a4('0x7')];};var getChanSpyApplications=function(_0x5a832d,_0x226975,_0x282432){var _0x15c513={'context':_0x5a832d[_0x44a4('0x8')]||'from-sip','type':_0x44a4('0x9'),'isApp':![],'UserId':_0x5a832d['id']};var _0x527733=[];for(var _0x1fb311=0x0,_0x39b32e=0x1;_0x1fb311<_0x282432[_0x44a4('0x7')];_0x1fb311++,_0x39b32e=0x1){var _0x266794={'exten':util['format'](_0x44a4('0xa'),_0x282432[_0x1fb311]['prefix'],_0x226975),'ChanSpyId':_0x282432[_0x1fb311]['id']};_0x527733['push'](_[_0x44a4('0xb')]({'app':_0x44a4('0xc'),'appdata':util[_0x44a4('0xd')](_0x44a4('0xe'),_0x44a4('0xf')),'priority':_0x39b32e++},_0x15c513,_0x266794));if(_0x282432[_0x1fb311][_0x44a4('0x10')]){_0x527733[_0x44a4('0x11')](_[_0x44a4('0xb')]({'app':_0x44a4('0x12'),'appdata':util[_0x44a4('0xd')]('${UNIQUEID}.%s,a',_0x282432[_0x1fb311][_0x44a4('0x13')]),'priority':_0x39b32e++},_0x15c513,_0x266794));}if(_0x282432[_0x1fb311][_0x44a4('0x14')]){_0x527733[_0x44a4('0x11')](_[_0x44a4('0xb')]({'app':_0x44a4('0x15'),'appdata':_0x282432[_0x1fb311]['password'],'priority':_0x39b32e++},_0x15c513,_0x266794));}_0x527733['push'](_[_0x44a4('0xb')]({'app':_0x44a4('0x16'),'appdata':util[_0x44a4('0xd')](_0x44a4('0x17'),_0x5a832d[_0x44a4('0x18')],_0x282432[_0x1fb311][_0x44a4('0x19')]?_0x282432[_0x1fb311][_0x44a4('0x19')][_0x44a4('0x1a')](''):''),'priority':_0x39b32e++},_0x15c513,_0x266794));if(_0x282432[_0x1fb311][_0x44a4('0x10')]){_0x527733[_0x44a4('0x11')](_[_0x44a4('0xb')]({'app':_0x44a4('0x1b'),'priority':_0x39b32e++},_0x15c513,_0x266794));}}return _0x527733;};var getUserApplications=function(_0x50ff5b,_0xe54d67){var _0x286926=[_0x44a4('0x1c'),_0x44a4('0x1d'),_0x44a4('0x1e')];var _0x362d54={'context':_0x50ff5b[_0x44a4('0x8')]||_0x44a4('0x1f'),'exten':_0xe54d67,'type':_0x44a4('0x9'),'isApp':![],'UserId':_0x50ff5b['id']};var _0x5efa18=[{'app':_0x44a4('0xc'),'appdata':_0x44a4('0x20')}];if(_0x50ff5b[_0x44a4('0x21')]&&_[_0x44a4('0x22')](_0x286926,_0x50ff5b['extensionMonitor'])){_0x5efa18[_0x44a4('0x11')]({'app':_0x44a4('0xc'),'appdata':_0x44a4('0x23')});_0x5efa18['push']({'app':'Set','appdata':util[_0x44a4('0xd')](_0x44a4('0x24'),_0x50ff5b[_0x44a4('0x21')])});_0x5efa18[_0x44a4('0x11')]({'app':'Dial','appdata':util[_0x44a4('0xd')](_0x44a4('0x25'),_0x50ff5b[_0x44a4('0x18')])});}else{_0x5efa18['push']({'app':_0x44a4('0x26'),'appdata':util[_0x44a4('0xd')](_0x44a4('0x27'),_0x50ff5b[_0x44a4('0x18')])});}_0x5efa18[_0x44a4('0x11')]({'app':_0x44a4('0x28')});for(var _0x49ba93=0x0;_0x49ba93<_0x5efa18['length'];_0x49ba93++){_0x5efa18[_0x49ba93]['priority']=_0x49ba93+0x1;_0x5efa18[_0x49ba93]=_[_0x44a4('0x29')](_0x5efa18[_0x49ba93],_0x362d54);}return _0x5efa18;};var getChanSpyPromise=function(_0x527b5f,_0x299203){return new BPromise(function(_0x1129d2,_0x48e0fe){return _0x527b5f[_0x44a4('0x2a')][_0x44a4('0x2b')]()[_0x44a4('0x2c')](function(_0x4af3ed){if(_0x4af3ed){var _0xc21e9=getChanSpyApplications(_0x299203,_0x299203[_0x44a4('0x2d')],_0x4af3ed);if(_0x299203['internal']!=_0x299203[_0x44a4('0x18')]){_0xc21e9=_0xc21e9[_0x44a4('0x2e')](getChanSpyApplications(_0x299203,_0x299203['name'],_0x4af3ed));}return _0x1129d2(_0xc21e9);}return _0x1129d2([]);})[_0x44a4('0x2f')](function(_0x3cc868){_0x48e0fe(_0x3cc868);});});};module[_0x44a4('0x30')]=function(_0x1a23f4){var _0x4d1b8e=_0x1a23f4['models'];return _0x1a23f4[_0x44a4('0x31')]('User',attributes,{'tableName':_0x44a4('0x32'),'charset':'utf8','collate':_0x44a4('0x33'),'hooks':{'beforeCreate':function(_0x501ec5,_0xb3542b,_0x1be7aa){var _0x3d978a=typeof _0x501ec5[_0x44a4('0x34')]===_0x44a4('0x35')?BPromise['resolve'](null):_0x4d1b8e[_0x44a4('0x36')]['find']({'where':{'id':_0x501ec5[_0x44a4('0x34')]}});_0x3d978a[_0x44a4('0x2c')](function(_0x53cc8f){if(_0x53cc8f){_0x501ec5[_0x44a4('0x37')]=_0x53cc8f[_0x44a4('0x37')];}})['then'](function(){_0x501ec5['updateMd5Password']();_0x501ec5['updatePassword'](_0x1be7aa);})[_0x44a4('0x2f')](function(_0x5ac556){_0x1be7aa(_0x5ac556);});},'beforeUpdate':function(_0x50180e,_0x18212f,_0x27751e){Promise[_0x44a4('0x38')]()[_0x44a4('0x2c')](function(){if(_0x50180e[_0x44a4('0x39')](_0x44a4('0x34'))===![])return;return _0x4d1b8e[_0x44a4('0x36')]['find']({'where':{'id':_0x50180e[_0x44a4('0x34')]}})[_0x44a4('0x2c')](function(_0x5f0c82){if(_0x5f0c82)_0x50180e[_0x44a4('0x37')]=_0x5f0c82[_0x44a4('0x37')];return;});})['then'](function(){if(_0x50180e[_0x44a4('0x39')](_0x44a4('0x3a'))){_0x50180e[_0x44a4('0x3b')]();return _0x50180e[_0x44a4('0x3c')](_0x27751e);}_0x27751e();})['catch'](function(_0x1e56d9){_0x27751e(_0x1e56d9);});},'afterCreate':function(_0x52c30e,_0x2f53fd,_0x1cf6af){var _0x5df632=getUserApplications(_0x52c30e,_0x52c30e[_0x44a4('0x2d')]);if(_0x52c30e[_0x44a4('0x2d')]!=_0x52c30e[_0x44a4('0x18')]){_0x5df632=_0x5df632['concat'](getUserApplications(_0x52c30e,_0x52c30e[_0x44a4('0x18')]));}return Promise[_0x44a4('0x38')]()[_0x44a4('0x2c')](function(){if(!_0x52c30e['userSetting']){return _0x52c30e[_0x44a4('0x3d')]({'clientSideLoggingLevel':_0x44a4('0x3e'),'clientSideLoggingEnabled':![]});}})['then'](function(){return _0x4d1b8e[_0x44a4('0x3f')]['bulkCreate'](_0x5df632);})[_0x44a4('0x2c')](function(){if(_0x52c30e[_0x44a4('0xf')]){return getChanSpyPromise(_0x4d1b8e,_0x52c30e);}})[_0x44a4('0x2c')](function(_0x8d87f3){if(_0x8d87f3&&_0x8d87f3[_0x44a4('0x7')]){return _0x4d1b8e['VoiceExtension'][_0x44a4('0x40')](_0x8d87f3);}})[_0x44a4('0x2c')](function(){_0x1cf6af();})[_0x44a4('0x2f')](function(_0x10ed40){_0x1cf6af(_0x10ed40);});},'afterUpdate':function(_0x14b97b,_0x4e6ed0,_0x10ad24){return BPromise[_0x44a4('0x38')]()[_0x44a4('0x2c')](function(){if(_0x14b97b[_0x44a4('0x39')](_0x44a4('0xf'))||_0x14b97b[_0x44a4('0x39')](_0x44a4('0x8'))){return _0x4d1b8e['VoiceExtension'][_0x44a4('0x41')]({'where':{'UserId':_0x14b97b['id'],'type':_0x44a4('0x9'),'ChanSpyId':{'$ne':null}}})[_0x44a4('0x2c')](function(){if(_0x14b97b[_0x44a4('0xf')]){return getChanSpyPromise(_0x4d1b8e,_0x14b97b)['then'](function(_0x4e8c89){if(_0x4e8c89&&_0x4e8c89[_0x44a4('0x7')]){return _0x4d1b8e[_0x44a4('0x3f')][_0x44a4('0x40')](_0x4e8c89);}});}});}})[_0x44a4('0x2c')](function(){if(_0x14b97b[_0x44a4('0x39')]('extensionMonitor')||_0x14b97b[_0x44a4('0x39')](_0x44a4('0x8'))){return _0x4d1b8e[_0x44a4('0x3f')][_0x44a4('0x41')]({'where':{'UserId':_0x14b97b['id'],'type':_0x44a4('0x9'),'ChanSpyId':null}})[_0x44a4('0x2c')](function(){var _0x4aadde=getUserApplications(_0x14b97b,_0x14b97b['internal']);if(_0x14b97b['internal']!=_0x14b97b[_0x44a4('0x18')]){_0x4aadde=_0x4aadde[_0x44a4('0x2e')](getUserApplications(_0x14b97b,_0x14b97b['name']));}return _0x4d1b8e['VoiceExtension'][_0x44a4('0x40')](_0x4aadde);});}})[_0x44a4('0x2c')](function(){_0x10ad24();})[_0x44a4('0x2f')](function(_0x1b5b53){_0x10ad24(_0x1b5b53);});},'afterDestroy':function(_0x456790){return _0x4d1b8e[_0x44a4('0x3f')][_0x44a4('0x41')]({'where':{'UserId':_0x456790['id'],'type':_0x44a4('0x9')}});}},'instanceMethods':{'authenticate':function(_0x5dbdc5,_0x252f2c){if(!_0x252f2c){return this[_0x44a4('0x3a')]===this[_0x44a4('0x42')](_0x5dbdc5);}var _0x5137ed=this;this[_0x44a4('0x42')](_0x5dbdc5,function(_0x33a302,_0x2b05b2){if(_0x33a302){_0x252f2c(_0x33a302);}if(_0x5137ed[_0x44a4('0x3a')]===_0x2b05b2){_0x252f2c(null,!![]);}else{_0x252f2c(null,![]);}});},'makeSalt':function(_0x3be391,_0x25f95a){var _0x42079d=0x10;if(typeof arguments[0x0]===_0x44a4('0x43')){_0x25f95a=arguments[0x0];_0x3be391=_0x42079d;}else if(typeof arguments[0x1]==='function'){_0x25f95a=arguments[0x1];}else{throw new Error(_0x44a4('0x44'));}if(!_0x3be391){_0x3be391=_0x42079d;}return crypto[_0x44a4('0x45')](_0x3be391,function(_0x506506,_0x1b1fb4){if(_0x506506){_0x25f95a(_0x506506);}return _0x25f95a(null,_0x1b1fb4[_0x44a4('0x46')]('base64'));});},'encryptPassword':function(_0x284dc7,_0x9fd7d3){if(!_0x284dc7||!this[_0x44a4('0x47')]){return _0x9fd7d3?_0x9fd7d3(null):null;}var _0x137c61=0x2710;var _0x539828=0x40;var _0x44d9dd=new Buffer(this[_0x44a4('0x47')],_0x44a4('0x48'));if(!_0x9fd7d3){return crypto[_0x44a4('0x49')](_0x284dc7,_0x44d9dd,_0x137c61,_0x539828,_0x44a4('0x4a'))[_0x44a4('0x46')](_0x44a4('0x48'));}return crypto[_0x44a4('0x4b')](_0x284dc7,_0x44d9dd,_0x137c61,_0x539828,'sha1',function(_0x3f76a1,_0x3ac702){if(_0x3f76a1){_0x9fd7d3(_0x3f76a1);}return _0x9fd7d3(null,_0x3ac702[_0x44a4('0x46')](_0x44a4('0x48')));});},'updatePassword':function(_0x29a28f){if(!this[_0x44a4('0x3a')]){return _0x29a28f(null);}if(!validatePresenceOf(this[_0x44a4('0x3a')])&&authTypes[_0x44a4('0x4c')](this[_0x44a4('0x4d')])===-0x1){_0x29a28f(new Error(_0x44a4('0x4e')));}var _0xc2299c=this;this['makeSalt'](function(_0x161b28,_0x52e298){if(_0x161b28){return _0x29a28f(_0x161b28);}_0xc2299c['salt']=_0x52e298;_0xc2299c[_0x44a4('0x42')](_0xc2299c[_0x44a4('0x3a')],function(_0x4540ae,_0x1ff11e){if(_0x4540ae){_0x29a28f(_0x4540ae);}_0xc2299c[_0x44a4('0x3a')]=_0x1ff11e;_0x29a28f(null);});});},'updateMd5Password':function(){this['md5secret']=md5(this['name']+_0x44a4('0x4f')+this[_0x44a4('0x3a')]);return this['md5secret'];}}});};
\ No newline at end of file
+var _0xd7ae=['sha1','provider','Invalid\x20password','md5secret','bluebird','crypto','util','md5','lodash','./user.attributes','google','length','from-sip','system','format','%s%s','prefix','CDR(type)=%s','chanspy','push','merge','${UNIQUEID}.%s,a','Authenticate','ChanSpy','SIP/%s,%s','name','options','WAV','context','Set','CDR(type)=internal','extensionMonitor','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','priority','defaults','VoiceChanSpy','findAll','then','internal','concat','catch','exports','models','User','users','utf8_bin','userProfileId','undefined','UserProfile','find','updatePassword','resolve','changed','privacyEnabled','password','updateMd5Password','userSetting','error','VoiceExtension','bulkCreate','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','pbkdf2Sync'];(function(_0x372c52,_0x2dda57){var _0x454a0f=function(_0x43b780){while(--_0x43b780){_0x372c52['push'](_0x372c52['shift']());}};_0x454a0f(++_0x2dda57);}(_0xd7ae,0x96));var _0xed7a=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xd7ae[_0x4e676e];return _0x336a3c;};'use strict';var BPromise=require(_0xed7a('0x0'));var crypto=require(_0xed7a('0x1'));var util=require(_0xed7a('0x2'));var md5=require(_0xed7a('0x3'));var _=require(_0xed7a('0x4'));var attributes=require(_0xed7a('0x5'));var authTypes=[_0xed7a('0x6')];var validatePresenceOf=function(_0x3c34ff){return _0x3c34ff&&_0x3c34ff[_0xed7a('0x7')];};var getChanSpyApplications=function(_0x393681,_0x5c1714,_0x32e705){var _0x49ace1={'context':_0x393681['context']||_0xed7a('0x8'),'type':_0xed7a('0x9'),'isApp':![],'UserId':_0x393681['id']};var _0x5ab179=[];for(var _0x1ffa82=0x0,_0xb72132=0x1;_0x1ffa82<_0x32e705[_0xed7a('0x7')];_0x1ffa82++,_0xb72132=0x1){var _0x54ffe0={'exten':util[_0xed7a('0xa')](_0xed7a('0xb'),_0x32e705[_0x1ffa82][_0xed7a('0xc')],_0x5c1714),'ChanSpyId':_0x32e705[_0x1ffa82]['id']};_0x5ab179['push'](_['merge']({'app':'Set','appdata':util[_0xed7a('0xa')](_0xed7a('0xd'),_0xed7a('0xe')),'priority':_0xb72132++},_0x49ace1,_0x54ffe0));if(_0x32e705[_0x1ffa82]['record']){_0x5ab179[_0xed7a('0xf')](_[_0xed7a('0x10')]({'app':'MixMonitor','appdata':util[_0xed7a('0xa')](_0xed7a('0x11'),_0x32e705[_0x1ffa82]['recordingFormat']),'priority':_0xb72132++},_0x49ace1,_0x54ffe0));}if(_0x32e705[_0x1ffa82]['auth']){_0x5ab179[_0xed7a('0xf')](_[_0xed7a('0x10')]({'app':_0xed7a('0x12'),'appdata':_0x32e705[_0x1ffa82]['password'],'priority':_0xb72132++},_0x49ace1,_0x54ffe0));}_0x5ab179[_0xed7a('0xf')](_[_0xed7a('0x10')]({'app':_0xed7a('0x13'),'appdata':util['format'](_0xed7a('0x14'),_0x393681[_0xed7a('0x15')],_0x32e705[_0x1ffa82][_0xed7a('0x16')]?_0x32e705[_0x1ffa82][_0xed7a('0x16')]['join'](''):''),'priority':_0xb72132++},_0x49ace1,_0x54ffe0));if(_0x32e705[_0x1ffa82]['record']){_0x5ab179[_0xed7a('0xf')](_[_0xed7a('0x10')]({'app':'StopMixMonitor','priority':_0xb72132++},_0x49ace1,_0x54ffe0));}}return _0x5ab179;};var getUserApplications=function(_0x23f43e,_0x4afdd6){var _0x55a617=['wav',_0xed7a('0x17'),'gsm'];var _0x1b5593={'context':_0x23f43e[_0xed7a('0x18')]||'from-sip','exten':_0x4afdd6,'type':_0xed7a('0x9'),'isApp':![],'UserId':_0x23f43e['id']};var _0x124c73=[{'app':_0xed7a('0x19'),'appdata':_0xed7a('0x1a')}];if(_0x23f43e[_0xed7a('0x1b')]&&_['includes'](_0x55a617,_0x23f43e['extensionMonitor'])){_0x124c73['push']({'app':_0xed7a('0x19'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'});_0x124c73[_0xed7a('0xf')]({'app':_0xed7a('0x19'),'appdata':util[_0xed7a('0xa')](_0xed7a('0x1c'),_0x23f43e[_0xed7a('0x1b')])});_0x124c73[_0xed7a('0xf')]({'app':_0xed7a('0x1d'),'appdata':util[_0xed7a('0xa')](_0xed7a('0x1e'),_0x23f43e['name'])});}else{_0x124c73[_0xed7a('0xf')]({'app':_0xed7a('0x1d'),'appdata':util[_0xed7a('0xa')](_0xed7a('0x1f'),_0x23f43e['name'])});}_0x124c73[_0xed7a('0xf')]({'app':_0xed7a('0x20')});for(var _0x255a10=0x0;_0x255a10<_0x124c73['length'];_0x255a10++){_0x124c73[_0x255a10][_0xed7a('0x21')]=_0x255a10+0x1;_0x124c73[_0x255a10]=_[_0xed7a('0x22')](_0x124c73[_0x255a10],_0x1b5593);}return _0x124c73;};var getChanSpyPromise=function(_0xe7fb3b,_0x46efd8){return new BPromise(function(_0x4cba86,_0x4a0b23){return _0xe7fb3b[_0xed7a('0x23')][_0xed7a('0x24')]()[_0xed7a('0x25')](function(_0xecee8d){if(_0xecee8d){var _0x55b63e=getChanSpyApplications(_0x46efd8,_0x46efd8[_0xed7a('0x26')],_0xecee8d);if(_0x46efd8['internal']!=_0x46efd8[_0xed7a('0x15')]){_0x55b63e=_0x55b63e[_0xed7a('0x27')](getChanSpyApplications(_0x46efd8,_0x46efd8[_0xed7a('0x15')],_0xecee8d));}return _0x4cba86(_0x55b63e);}return _0x4cba86([]);})[_0xed7a('0x28')](function(_0x32ca8d){_0x4a0b23(_0x32ca8d);});});};module[_0xed7a('0x29')]=function(_0x159a94){var _0x225a12=_0x159a94[_0xed7a('0x2a')];return _0x159a94['define'](_0xed7a('0x2b'),attributes,{'tableName':_0xed7a('0x2c'),'charset':'utf8','collate':_0xed7a('0x2d'),'hooks':{'beforeCreate':function(_0x325245,_0x217b34,_0x3cf280){var _0x48723b=typeof _0x325245[_0xed7a('0x2e')]===_0xed7a('0x2f')?BPromise['resolve'](null):_0x225a12[_0xed7a('0x30')][_0xed7a('0x31')]({'where':{'id':_0x325245['userProfileId']}});_0x48723b[_0xed7a('0x25')](function(_0x3d11fe){if(_0x3d11fe){_0x325245['privacyEnabled']=_0x3d11fe['privacyEnabled'];}})[_0xed7a('0x25')](function(){_0x325245['updateMd5Password']();_0x325245[_0xed7a('0x32')](_0x3cf280);})[_0xed7a('0x28')](function(_0x57920f){_0x3cf280(_0x57920f);});},'beforeUpdate':function(_0x254cf2,_0xea3869,_0x31bf26){Promise[_0xed7a('0x33')]()[_0xed7a('0x25')](function(){if(_0x254cf2[_0xed7a('0x34')](_0xed7a('0x2e'))===![])return;return _0x225a12[_0xed7a('0x30')][_0xed7a('0x31')]({'where':{'id':_0x254cf2[_0xed7a('0x2e')]}})['then'](function(_0x242a20){if(_0x242a20)_0x254cf2[_0xed7a('0x35')]=_0x242a20['privacyEnabled'];return;});})[_0xed7a('0x25')](function(){if(_0x254cf2['changed'](_0xed7a('0x36'))){_0x254cf2[_0xed7a('0x37')]();return _0x254cf2[_0xed7a('0x32')](_0x31bf26);}_0x31bf26();})[_0xed7a('0x28')](function(_0x52115c){_0x31bf26(_0x52115c);});},'afterCreate':function(_0xa2183,_0x17e3fe,_0x3c546b){var _0xee1a9f=getUserApplications(_0xa2183,_0xa2183['internal']);if(_0xa2183[_0xed7a('0x26')]!=_0xa2183['name']){_0xee1a9f=_0xee1a9f[_0xed7a('0x27')](getUserApplications(_0xa2183,_0xa2183[_0xed7a('0x15')]));}return Promise[_0xed7a('0x33')]()[_0xed7a('0x25')](function(){if(!_0xa2183[_0xed7a('0x38')]){return _0xa2183['createUserSetting']({'clientSideLoggingLevel':_0xed7a('0x39'),'clientSideLoggingEnabled':![]});}})['then'](function(){return _0x225a12[_0xed7a('0x3a')][_0xed7a('0x3b')](_0xee1a9f);})['then'](function(){if(_0xa2183[_0xed7a('0xe')]){return getChanSpyPromise(_0x225a12,_0xa2183);}})[_0xed7a('0x25')](function(_0x355ee2){if(_0x355ee2&&_0x355ee2['length']){return _0x225a12[_0xed7a('0x3a')][_0xed7a('0x3b')](_0x355ee2);}})[_0xed7a('0x25')](function(){_0x3c546b();})[_0xed7a('0x28')](function(_0x20046d){_0x3c546b(_0x20046d);});},'afterUpdate':function(_0x200bfe,_0x45b4ee,_0x312b51){return BPromise['resolve']()['then'](function(){if(_0x200bfe[_0xed7a('0x34')](_0xed7a('0xe'))||_0x200bfe[_0xed7a('0x34')](_0xed7a('0x18'))){return _0x225a12[_0xed7a('0x3a')][_0xed7a('0x3c')]({'where':{'UserId':_0x200bfe['id'],'type':_0xed7a('0x9'),'ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x200bfe[_0xed7a('0xe')]){return getChanSpyPromise(_0x225a12,_0x200bfe)[_0xed7a('0x25')](function(_0x785e8f){if(_0x785e8f&&_0x785e8f[_0xed7a('0x7')]){return _0x225a12[_0xed7a('0x3a')][_0xed7a('0x3b')](_0x785e8f);}});}});}})['then'](function(){if(_0x200bfe[_0xed7a('0x34')](_0xed7a('0x1b'))||_0x200bfe[_0xed7a('0x34')]('context')){return _0x225a12[_0xed7a('0x3a')][_0xed7a('0x3c')]({'where':{'UserId':_0x200bfe['id'],'type':'system','ChanSpyId':null}})[_0xed7a('0x25')](function(){var _0x31bf9f=getUserApplications(_0x200bfe,_0x200bfe[_0xed7a('0x26')]);if(_0x200bfe[_0xed7a('0x26')]!=_0x200bfe[_0xed7a('0x15')]){_0x31bf9f=_0x31bf9f[_0xed7a('0x27')](getUserApplications(_0x200bfe,_0x200bfe[_0xed7a('0x15')]));}return _0x225a12['VoiceExtension'][_0xed7a('0x3b')](_0x31bf9f);});}})['then'](function(){_0x312b51();})[_0xed7a('0x28')](function(_0x3c4509){_0x312b51(_0x3c4509);});},'afterDestroy':function(_0xe624a7){return _0x225a12['VoiceExtension'][_0xed7a('0x3c')]({'where':{'UserId':_0xe624a7['id'],'type':_0xed7a('0x9')}});}},'instanceMethods':{'authenticate':function(_0x11e8b6,_0x4f6037){if(!_0x4f6037){return this[_0xed7a('0x36')]===this[_0xed7a('0x3d')](_0x11e8b6);}var _0x5e6d9a=this;this['encryptPassword'](_0x11e8b6,function(_0x26c5ac,_0x38cd17){if(_0x26c5ac){_0x4f6037(_0x26c5ac);}if(_0x5e6d9a[_0xed7a('0x36')]===_0x38cd17){_0x4f6037(null,!![]);}else{_0x4f6037(null,![]);}});},'makeSalt':function(_0x52dd1,_0x54b10c){var _0xc6d7ef=0x10;if(typeof arguments[0x0]===_0xed7a('0x3e')){_0x54b10c=arguments[0x0];_0x52dd1=_0xc6d7ef;}else if(typeof arguments[0x1]==='function'){_0x54b10c=arguments[0x1];}else{throw new Error(_0xed7a('0x3f'));}if(!_0x52dd1){_0x52dd1=_0xc6d7ef;}return crypto[_0xed7a('0x40')](_0x52dd1,function(_0x240def,_0x1e90e2){if(_0x240def){_0x54b10c(_0x240def);}return _0x54b10c(null,_0x1e90e2[_0xed7a('0x41')](_0xed7a('0x42')));});},'encryptPassword':function(_0x334b1c,_0xf31eb4){if(!_0x334b1c||!this[_0xed7a('0x43')]){return _0xf31eb4?_0xf31eb4(null):null;}var _0x50d81a=0x2710;var _0x5e5c5d=0x40;var _0x1ee69a=new Buffer(this[_0xed7a('0x43')],_0xed7a('0x42'));if(!_0xf31eb4){return crypto[_0xed7a('0x44')](_0x334b1c,_0x1ee69a,_0x50d81a,_0x5e5c5d,'sha1')[_0xed7a('0x41')](_0xed7a('0x42'));}return crypto['pbkdf2'](_0x334b1c,_0x1ee69a,_0x50d81a,_0x5e5c5d,_0xed7a('0x45'),function(_0x4e4980,_0x5d91fc){if(_0x4e4980){_0xf31eb4(_0x4e4980);}return _0xf31eb4(null,_0x5d91fc[_0xed7a('0x41')](_0xed7a('0x42')));});},'updatePassword':function(_0x844992){if(!this[_0xed7a('0x36')]){return _0x844992(null);}if(!validatePresenceOf(this[_0xed7a('0x36')])&&authTypes['indexOf'](this[_0xed7a('0x46')])===-0x1){_0x844992(new Error(_0xed7a('0x47')));}var _0x5418e3=this;this['makeSalt'](function(_0x4d656b,_0x255f92){if(_0x4d656b){return _0x844992(_0x4d656b);}_0x5418e3[_0xed7a('0x43')]=_0x255f92;_0x5418e3[_0xed7a('0x3d')](_0x5418e3[_0xed7a('0x36')],function(_0x421ae0,_0x15ae40){if(_0x421ae0){_0x844992(_0x421ae0);}_0x5418e3[_0xed7a('0x36')]=_0x15ae40;_0x844992(null);});});},'updateMd5Password':function(){this[_0xed7a('0x48')]=md5(this[_0xed7a('0x15')]+':asterisk:'+this[_0xed7a('0x36')]);return this['md5secret'];}}});};
\ No newline at end of file
index 0b4e8b2..6a8f322 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb035=['format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','forEach','isNil','body','type','DEFAULT\x20PAUSE','role','uniqueid','update','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','mail','chat','fax','sms','openchannel','whatsapp','system','set','%s%s','Pause','push','all','catch','LogoutUser','destroy','mobile','phone','loginInPause','SIP/%s','count','agent','../../config/license/util','getLicense','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','getChannels','callysquare','merge','LOGININPAUSE','bulkCreate','concat','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','redis','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','findAll','options','raw','where','limit','include','map','model','attributes','GetUser','ShowUser','User','find','PauseUser','name','internal','interface','UserVoiceQueueRt','MemberReport','PAUSE','length'];(function(_0x36fbef,_0x4ffc84){var _0x45e270=function(_0x32dd95){while(--_0x32dd95){_0x36fbef['push'](_0x36fbef['shift']());}};_0x45e270(++_0x4ffc84);}(_0xb035,0x14c));var _0x5b03=function(_0x27669b,_0x306a2c){_0x27669b=_0x27669b-0x0;var _0x31ed6e=_0xb035[_0x27669b];return _0x31ed6e;};'use strict';var _=require('lodash');var util=require(_0x5b03('0x0'));var moment=require(_0x5b03('0x1'));var BPromise=require(_0x5b03('0x2'));var rs=require(_0x5b03('0x3'));var fs=require('fs');var Redis=require(_0x5b03('0x4'));var db=require(_0x5b03('0x5'))['db'];var utils=require(_0x5b03('0x6'));var logger=require('../../config/logger')(_0x5b03('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x5b03('0x8')]=_['defaults'](config[_0x5b03('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x5b03('0x9'))(new Redis(config[_0x5b03('0x8')]));require(_0x5b03('0xa'))[_0x5b03('0xb')](socket);function respondWithRpcPromise(_0x304869,_0x47d26e,_0x362933){return new BPromise(function(_0x3b0e4b,_0x338cee){return client[_0x5b03('0xc')](_0x304869,_0x362933)[_0x5b03('0xd')](function(_0x568473){logger[_0x5b03('0xe')](_0x5b03('0xf'),_0x47d26e,_0x5b03('0x10'));logger[_0x5b03('0x11')]('User,\x20%s,\x20%s,\x20%s',_0x47d26e,_0x5b03('0x10'),JSON[_0x5b03('0x12')](_0x568473));if(_0x568473['error']){if(_0x568473[_0x5b03('0x13')][_0x5b03('0x14')]===0x1f4){logger['error'](_0x5b03('0xf'),_0x47d26e,_0x568473[_0x5b03('0x13')]['message']);return _0x338cee(_0x568473['error'][_0x5b03('0x15')]);}logger[_0x5b03('0x13')](_0x5b03('0xf'),_0x47d26e,_0x568473[_0x5b03('0x13')][_0x5b03('0x15')]);return _0x3b0e4b(_0x568473[_0x5b03('0x13')][_0x5b03('0x15')]);}else{logger[_0x5b03('0xe')](_0x5b03('0xf'),_0x47d26e,'request\x20sent');_0x3b0e4b(_0x568473[_0x5b03('0x16')][_0x5b03('0x15')]);}})['catch'](function(_0x88cac7){logger['error']('User,\x20%s,\x20%s',_0x47d26e,_0x88cac7);_0x338cee(_0x88cac7);});});}exports['GetUser']=function(_0x31168f){var _0x2051f4=this;return new Promise(function(_0x3ff3b9,_0x400354){return db['User'][_0x5b03('0x17')]({'raw':_0x31168f[_0x5b03('0x18')]?_0x31168f[_0x5b03('0x18')][_0x5b03('0x19')]===undefined?!![]:![]:!![],'where':_0x31168f['options']?_0x31168f[_0x5b03('0x18')][_0x5b03('0x1a')]||null:null,'attributes':_0x31168f['options']?_0x31168f['options']['attributes']||null:null,'limit':_0x31168f[_0x5b03('0x18')]?_0x31168f['options'][_0x5b03('0x1b')]||null:null,'include':_0x31168f[_0x5b03('0x18')]?_0x31168f[_0x5b03('0x18')][_0x5b03('0x1c')]?_[_0x5b03('0x1d')](_0x31168f[_0x5b03('0x18')][_0x5b03('0x1c')],function(_0x43ef77){return{'model':db[_0x43ef77[_0x5b03('0x1e')]],'as':_0x43ef77['as'],'attributes':_0x43ef77[_0x5b03('0x1f')],'include':_0x43ef77['include']?_[_0x5b03('0x1d')](_0x43ef77['include'],function(_0x4b1533){return{'model':db[_0x4b1533['model']],'as':_0x4b1533['as'],'attributes':_0x4b1533[_0x5b03('0x1f')],'include':_0x4b1533[_0x5b03('0x1c')]?_[_0x5b03('0x1d')](_0x4b1533['include'],function(_0x476abe){return{'model':db[_0x476abe['model']],'as':_0x476abe['as'],'attributes':_0x476abe['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b03('0xd')](function(_0x42644d){logger['info']('GetUser',_0x31168f);logger[_0x5b03('0x11')](_0x5b03('0x20'),_0x31168f,JSON[_0x5b03('0x12')](_0x42644d));_0x3ff3b9(_0x42644d);})['catch'](function(_0x43361f){logger[_0x5b03('0x13')](_0x5b03('0x20'),_0x43361f[_0x5b03('0x15')],_0x31168f);_0x400354(_0x2051f4[_0x5b03('0x13')](0x1f4,_0x43361f[_0x5b03('0x15')]));});});};exports[_0x5b03('0x21')]=function(_0x403135){var _0x312b4e=this;return new Promise(function(_0x4054d6,_0x3cfb6c){return db[_0x5b03('0x22')][_0x5b03('0x23')]({'raw':_0x403135[_0x5b03('0x18')]?_0x403135[_0x5b03('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x403135[_0x5b03('0x18')]?_0x403135[_0x5b03('0x18')][_0x5b03('0x1a')]||null:null,'attributes':_0x403135['options']?_0x403135[_0x5b03('0x18')][_0x5b03('0x1f')]||null:null,'include':_0x403135[_0x5b03('0x18')]?_0x403135[_0x5b03('0x18')]['include']?_[_0x5b03('0x1d')](_0x403135['options'][_0x5b03('0x1c')],function(_0x20cc25){return{'model':db[_0x20cc25['model']],'as':_0x20cc25['as'],'attributes':_0x20cc25[_0x5b03('0x1f')],'include':_0x20cc25[_0x5b03('0x1c')]?_[_0x5b03('0x1d')](_0x20cc25[_0x5b03('0x1c')],function(_0xd6e3cc){return{'model':db[_0xd6e3cc[_0x5b03('0x1e')]],'as':_0xd6e3cc['as'],'attributes':_0xd6e3cc[_0x5b03('0x1f')],'include':_0xd6e3cc[_0x5b03('0x1c')]?_['map'](_0xd6e3cc[_0x5b03('0x1c')],function(_0x2aab11){return{'model':db[_0x2aab11[_0x5b03('0x1e')]],'as':_0x2aab11['as'],'attributes':_0x2aab11[_0x5b03('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5b03('0xd')](function(_0x25051d){logger['info'](_0x5b03('0x21'),_0x403135);logger[_0x5b03('0x11')]('ShowUser',_0x403135,JSON['stringify'](_0x25051d));_0x4054d6(_0x25051d);})['catch'](function(_0x13a875){logger[_0x5b03('0x13')](_0x5b03('0x21'),_0x13a875[_0x5b03('0x15')],_0x403135);_0x3cfb6c(_0x312b4e[_0x5b03('0x13')](0x1f4,_0x13a875[_0x5b03('0x15')]));});});};exports[_0x5b03('0x24')]=function(_0x28d54e){var _0x3936aa=this;return new Promise(function(_0x536110,_0x4b3767){var _0x39670c;return db[_0x5b03('0x22')][_0x5b03('0x23')]({'where':_0x28d54e['options']['where']||{},'attributes':['id',_0x5b03('0x25'),'role',_0x5b03('0x26'),_0x5b03('0x27')]})[_0x5b03('0xd')](function(_0x2c5bc2){if(_0x2c5bc2){_0x39670c=_0x2c5bc2;return db[_0x5b03('0x28')]['update']({'paused':0x1},{'where':{'UserId':_0x39670c['id']},'individualHooks':!![]});}})[_0x5b03('0xd')](function(){if(_0x39670c){return db[_0x5b03('0x29')][_0x5b03('0x17')]({'where':{'membername':_0x39670c[_0x5b03('0x25')],'type':_0x5b03('0x2a'),'exitAt':null}});}})[_0x5b03('0xd')](function(_0xf0c3e){if(_0x39670c){if(_0xf0c3e&&_0xf0c3e[_0x5b03('0x2b')]){var _0x495f1d=moment()[_0x5b03('0x2c')](_0x5b03('0x2d'));for(var _0x470b56=0x0,_0x2fdf94=_0xf0c3e[_0x5b03('0x2b')];_0x470b56<_0x2fdf94;_0x470b56++){_0xf0c3e[_0x470b56][_0x5b03('0x2e')]({'exitAt':_0x495f1d});}}}})[_0x5b03('0xd')](function(){if(_0x39670c){var _0x34df12=[];var _0x445bf3=utils['getChannels']();_0x445bf3[_0x5b03('0x2f')](function(_0x2504e3){_0x34df12['push']({'channel':_0x2504e3,'membername':_0x39670c[_0x5b03('0x25')],'interface':_[_0x5b03('0x30')](_0x39670c[_0x5b03('0x27')])?util[_0x5b03('0x2c')]('SIP/%s',_0x39670c[_0x5b03('0x25')]):_0x39670c[_0x5b03('0x27')],'type':_0x5b03('0x2a'),'enterAt':moment()[_0x5b03('0x2c')](_0x5b03('0x2d')),'data1':_0x28d54e[_0x5b03('0x31')][_0x5b03('0x32')]||_0x5b03('0x33'),'role':_0x39670c[_0x5b03('0x34')],'internal':_0x39670c[_0x5b03('0x26')],'uniqueid':_0x28d54e[_0x5b03('0x31')][_0x5b03('0x35')]||null});});return db[_0x5b03('0x29')]['bulkCreate'](_0x34df12,{'individualHooks':!![]});}})[_0x5b03('0xd')](function(){if(_0x39670c){return _0x39670c[_0x5b03('0x36')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x28d54e[_0x5b03('0x31')][_0x5b03('0x32')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x5b03('0x2c')](_0x5b03('0x2d'))});}})[_0x5b03('0xd')](function(_0x102ce8){_0x536110(_0x102ce8);})['catch'](function(_0x39f161){_0x4b3767(_0x3936aa[_0x5b03('0x13')](0x1f4,_0x39f161[_0x5b03('0x15')]));});});};exports[_0x5b03('0x37')]=function(_0x151940){var _0x571085=this;return new Promise(function(_0x4ba0ba,_0x2ae8c2){var _0x4b8c58;return db[_0x5b03('0x22')][_0x5b03('0x38')]({'where':_0x151940[_0x5b03('0x18')][_0x5b03('0x1a')]||{},'attributes':['id',_0x5b03('0x25')]})['then'](function(_0x1f60f2){if(_0x1f60f2){_0x4b8c58=_0x1f60f2;if(_0x151940[_0x5b03('0x31')][_0x5b03('0x39')]&&!utils[_0x5b03('0x3a')](_0x151940[_0x5b03('0x31')][_0x5b03('0x39')])){throw new Error(_0x5b03('0x3b'));}switch(_0x151940[_0x5b03('0x31')][_0x5b03('0x39')]){case _0x5b03('0x3c'):return db[_0x5b03('0x28')]['update']({'paused':0x0},{'where':{'UserId':_0x4b8c58['id']}})[_0x5b03('0xd')](function(){return db[_0x5b03('0x29')][_0x5b03('0x23')]({'where':{'channel':_0x151940['body'][_0x5b03('0x39')],'membername':_0x4b8c58[_0x5b03('0x25')],'type':'PAUSE','exitAt':null}});})[_0x5b03('0xd')](function(_0x2f3119){if(_0x2f3119){return _0x2f3119['update']({'exitAt':moment()['format'](_0x5b03('0x2d')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x5b03('0xd')](function(){return _0x4b8c58[_0x5b03('0x36')]({'voicePause':![]});});case _0x5b03('0x3d'):case _0x5b03('0x3e'):case _0x5b03('0x3f'):case _0x5b03('0x40'):case _0x5b03('0x41'):case _0x5b03('0x42'):return db['MemberReport']['find']({'where':{'channel':_0x151940[_0x5b03('0x31')][_0x5b03('0x39')],'membername':_0x4b8c58[_0x5b03('0x25')],'type':'PAUSE','exitAt':null}})[_0x5b03('0xd')](function(_0xa23877){return _0xa23877[_0x5b03('0x36')]({'exitAt':moment()[_0x5b03('0x2c')](_0x5b03('0x2d')),'data2':_0x5b03('0x43')},{'individualHooks':!![]});})['then'](function(){var _0x17994d={};_[_0x5b03('0x44')](_0x17994d,util['format'](_0x5b03('0x45'),_0x151940['body']['channel'],_0x5b03('0x46')),![]);return _0x4b8c58[_0x5b03('0x36')](_0x17994d);});default:return db[_0x5b03('0x28')][_0x5b03('0x36')]({'paused':0x0},{'where':{'UserId':_0x4b8c58['id']}})[_0x5b03('0xd')](function(){return db['MemberReport'][_0x5b03('0x17')]({'where':{'membername':_0x4b8c58['name'],'type':_0x5b03('0x2a'),'exitAt':null}});})[_0x5b03('0xd')](function(_0xf4cf6a){var _0x28816b=[];_0xf4cf6a['forEach'](function(_0x47a054){_0x28816b[_0x5b03('0x47')](_0x47a054['update']({'exitAt':moment()[_0x5b03('0x2c')](_0x5b03('0x2d')),'data2':'system'}));});return BPromise[_0x5b03('0x48')](_0x28816b);})[_0x5b03('0xd')](function(){return _0x4b8c58[_0x5b03('0x36')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x5b03('0xd')](function(_0x10ca12){_0x4ba0ba(_0x10ca12);})[_0x5b03('0x49')](function(_0xc41704){_0x2ae8c2(_0x571085['error'](0x1f4,_0xc41704[_0x5b03('0x15')]));});});};exports[_0x5b03('0x4a')]=function(_0x4ea32d){var _0x3b456a=this;return new Promise(function(_0x119588,_0x369bbf){var _0x1c42d2;return db[_0x5b03('0x22')]['findOne']({'where':_0x4ea32d[_0x5b03('0x18')][_0x5b03('0x1a')]||{},'attributes':['id',_0x5b03('0x25')]})[_0x5b03('0xd')](function(_0x469617){if(_0x469617){_0x1c42d2=_0x469617;return db[_0x5b03('0x28')][_0x5b03('0x4b')]({'where':{'membername':_0x1c42d2[_0x5b03('0x25')]},'individualHooks':!![]});}})[_0x5b03('0xd')](function(){if(_0x1c42d2){return db[_0x5b03('0x29')][_0x5b03('0x17')]({'where':{'membername':_0x1c42d2[_0x5b03('0x25')],'exitAt':null}});}})[_0x5b03('0xd')](function(_0x45a437){if(_0x1c42d2){if(_0x45a437&&_0x45a437[_0x5b03('0x2b')]){var _0x2dcb=[];_0x45a437['forEach'](function(_0x4ae485){_0x2dcb[_0x5b03('0x47')](_0x4ae485[_0x5b03('0x36')]({'exitAt':moment()[_0x5b03('0x2c')](_0x5b03('0x2d'))}));});return BPromise[_0x5b03('0x48')](_0x2dcb);}}})['then'](function(){if(_0x1c42d2){return _0x1c42d2[_0x5b03('0x36')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x5b03('0xd')](function(_0x2b8692){_0x119588(_0x2b8692);})[_0x5b03('0x49')](function(_0x20c63d){_0x369bbf(_0x3b456a['error'](0x1f4,_0x20c63d[_0x5b03('0x15')]));});});};exports['LoginUser']=function(_0x4976b9){var _0x3fd9c1=this;return new Promise(function(_0x5a91cc,_0x1ea34c){var _0x15588e;var _0x136949;var _0x33e495;var _0x2ac3b0;return db[_0x5b03('0x22')][_0x5b03('0x38')]({'where':_0x4976b9[_0x5b03('0x18')]['where']||{},'attributes':['id',_0x5b03('0x25'),_0x5b03('0x34'),_0x5b03('0x4c'),_0x5b03('0x4d'),_0x5b03('0x26'),_0x5b03('0x4e'),_0x5b03('0x27')]})[_0x5b03('0xd')](function(_0x347840){if(_0x347840){_0x15588e=_0x347840;_0x2ac3b0=_0x4976b9[_0x5b03('0x31')][_0x5b03('0x27')]?_0x4976b9['body']['interface']:util[_0x5b03('0x2c')](_0x5b03('0x4f'),_0x15588e[_0x5b03('0x25')]);return db[_0x5b03('0x22')][_0x5b03('0x50')]({'where':{'role':_0x5b03('0x51'),'online':!![],'id':{'$ne':_0x15588e['id']}}});}})[_0x5b03('0xd')](function(_0x593667){if(_0x593667){_0x33e495=_0x593667;return require(_0x5b03('0x52'))[_0x5b03('0x53')]();}})[_0x5b03('0xd')](function(_0x5b1e6b){if(_0x5b1e6b&&_0x5b1e6b['agents']&&_0x33e495>=_0x5b1e6b['agents']){throw new Error(_0x5b03('0x54'));}})[_0x5b03('0xd')](function(){if(_0x15588e){return db[_0x5b03('0x28')][_0x5b03('0x4b')]({'where':{'membername':_0x15588e['name']},'individualHooks':!![]});}})[_0x5b03('0xd')](function(){if(_0x15588e){return _0x15588e[_0x5b03('0x55')]({'raw':!![]});}})[_0x5b03('0xd')](function(_0x565e79){if(_0x15588e){if(_0x565e79){var _0x194b05=[];_0x136949=_0x565e79;if(_0x136949['length']){for(var _0x250bc7=0x0;_0x250bc7<_0x136949[_0x5b03('0x2b')];_0x250bc7++){_0x194b05[_0x5b03('0x47')](db[_0x5b03('0x28')][_0x5b03('0x56')]({'membername':_0x15588e['name'],'UserId':_0x15588e['id'],'queue_name':_0x136949[_0x250bc7][_0x5b03('0x25')],'VoiceQueueId':_0x136949[_0x250bc7]['id'],'interface':_0x2ac3b0,'paused':_0x15588e['loginInPause']||![],'penalty':_0x136949[_0x250bc7][_0x5b03('0x57')]||0x0}));}return BPromise[_0x5b03('0x48')](_0x194b05);}}}})[_0x5b03('0xd')](function(){if(_0x15588e){return db[_0x5b03('0x29')][_0x5b03('0x17')]({'where':{'membername':_0x15588e[_0x5b03('0x25')],'exitAt':null}});}})['then'](function(_0x6786a4){if(_0x15588e){if(_0x6786a4&&_0x6786a4[_0x5b03('0x2b')]){var _0x2b6a02=[];_0x6786a4['forEach'](function(_0x4582ac){_0x2b6a02[_0x5b03('0x47')](_0x4582ac['update']({'exitAt':moment()[_0x5b03('0x2c')](_0x5b03('0x2d'))}));});return BPromise['all'](_0x2b6a02);}}})[_0x5b03('0xd')](function(_0x3eb2e9){if(_0x15588e){var _0x52b328=[];var _0x5b5b83=[];var _0xdd736d=utils[_0x5b03('0x58')]();var _0x4ea1d2={'membername':_0x15588e[_0x5b03('0x25')],'interface':_0x2ac3b0,'enterAt':moment()[_0x5b03('0x2c')](_0x5b03('0x2d')),'role':_0x15588e[_0x5b03('0x34')],'internal':_0x15588e['internal']};_0xdd736d[_0x5b03('0x2f')](function(_0x2a68f5){_0x52b328[_0x5b03('0x47')](_['merge']({'channel':_0x2a68f5,'type':'LOGIN','data1':_0x5b03('0x59'),'data2':_0x2ac3b0},_0x4ea1d2));if(_0x15588e[_0x5b03('0x4e')]){_0x5b5b83[_0x5b03('0x47')](_[_0x5b03('0x5a')]({'channel':_0x2a68f5,'type':_0x5b03('0x2a'),'data1':_0x5b03('0x5b')},_0x4ea1d2));}});return db[_0x5b03('0x29')][_0x5b03('0x5c')](_0x52b328[_0x5b03('0x5d')](_0x5b5b83),{'individualHooks':!![]});}})[_0x5b03('0xd')](function(){if(_0x15588e){return _0x15588e[_0x5b03('0x36')]({'online':!![],'lastLoginAt':moment()[_0x5b03('0x2c')](_0x5b03('0x2d')),'voicePause':_0x15588e[_0x5b03('0x4e')]||![],'mailPause':_0x15588e['loginInPause']||![],'chatPause':_0x15588e[_0x5b03('0x4e')]||![],'faxPause':_0x15588e[_0x5b03('0x4e')]||![],'smsPause':_0x15588e[_0x5b03('0x4e')]||![],'openchannelPause':_0x15588e[_0x5b03('0x4e')]||![],'pauseType':_0x15588e['loginInPause']?_0x5b03('0x5b'):null,'lastPauseAt':moment()[_0x5b03('0x2c')](_0x5b03('0x2d')),'interface':_0x2ac3b0});}})[_0x5b03('0xd')](function(_0x17d2c9){_0x5a91cc(_0x17d2c9);})[_0x5b03('0x49')](function(_0x2dc2ae){_0x1ea34c(_0x3fd9c1[_0x5b03('0x13')](0x1f4,_0x2dc2ae[_0x5b03('0x15')]));});});};
\ No newline at end of file
+var _0xe463=['GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','debug','catch','ShowUser','find','PauseUser','name','role','internal','interface','update','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','type','body','MemberReport','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','UserVoiceQueueRt','system','mail','chat','fax','sms','openchannel','whatsapp','set','%s%s','Pause','LogoutUser','destroy','all','loginInPause','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','concat','LOGININPAUSE','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./user.socket','register','request','then','info','User,\x20%s,\x20%s','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x5af875,_0x54386c){var _0x440ada=function(_0x319392){while(--_0x319392){_0x5af875['push'](_0x5af875['shift']());}};_0x440ada(++_0x54386c);}(_0xe463,0x1c5));var _0x3e46=function(_0x193855,_0x241f33){_0x193855=_0x193855-0x0;var _0x11ed56=_0xe463[_0x193855];return _0x11ed56;};'use strict';var _=require(_0x3e46('0x0'));var util=require(_0x3e46('0x1'));var moment=require(_0x3e46('0x2'));var BPromise=require('bluebird');var rs=require(_0x3e46('0x3'));var fs=require('fs');var Redis=require(_0x3e46('0x4'));var db=require(_0x3e46('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e46('0x6'))(_0x3e46('0x7'));var config=require('../../config/environment');var jayson=require(_0x3e46('0x8'));var client=jayson[_0x3e46('0x9')][_0x3e46('0xa')]({'port':0x232a});config['redis']=_[_0x3e46('0xb')](config['redis'],{'host':_0x3e46('0xc'),'port':0x18eb});var socket=require(_0x3e46('0xd'))(new Redis(config[_0x3e46('0xe')]));require(_0x3e46('0xf'))[_0x3e46('0x10')](socket);function respondWithRpcPromise(_0x4efa47,_0x101a97,_0x26c48b){return new BPromise(function(_0x2bdaa1,_0x100ab2){return client[_0x3e46('0x11')](_0x4efa47,_0x26c48b)[_0x3e46('0x12')](function(_0x224f35){logger[_0x3e46('0x13')](_0x3e46('0x14'),_0x101a97,'request\x20sent');logger['debug'](_0x3e46('0x15'),_0x101a97,_0x3e46('0x16'),JSON[_0x3e46('0x17')](_0x224f35));if(_0x224f35[_0x3e46('0x18')]){if(_0x224f35['error']['code']===0x1f4){logger[_0x3e46('0x18')](_0x3e46('0x14'),_0x101a97,_0x224f35[_0x3e46('0x18')][_0x3e46('0x19')]);return _0x100ab2(_0x224f35[_0x3e46('0x18')][_0x3e46('0x19')]);}logger[_0x3e46('0x18')](_0x3e46('0x14'),_0x101a97,_0x224f35[_0x3e46('0x18')][_0x3e46('0x19')]);return _0x2bdaa1(_0x224f35[_0x3e46('0x18')][_0x3e46('0x19')]);}else{logger['info']('User,\x20%s,\x20%s',_0x101a97,_0x3e46('0x16'));_0x2bdaa1(_0x224f35[_0x3e46('0x1a')]['message']);}})['catch'](function(_0x50fda6){logger[_0x3e46('0x18')]('User,\x20%s,\x20%s',_0x101a97,_0x50fda6);_0x100ab2(_0x50fda6);});});}exports[_0x3e46('0x1b')]=function(_0xd853d){var _0x2a1f7c=this;return new Promise(function(_0x97c9ea,_0x1d1ed6){return db[_0x3e46('0x1c')][_0x3e46('0x1d')]({'raw':_0xd853d[_0x3e46('0x1e')]?_0xd853d[_0x3e46('0x1e')][_0x3e46('0x1f')]===undefined?!![]:![]:!![],'where':_0xd853d[_0x3e46('0x1e')]?_0xd853d['options'][_0x3e46('0x20')]||null:null,'attributes':_0xd853d[_0x3e46('0x1e')]?_0xd853d[_0x3e46('0x1e')][_0x3e46('0x21')]||null:null,'limit':_0xd853d[_0x3e46('0x1e')]?_0xd853d[_0x3e46('0x1e')][_0x3e46('0x22')]||null:null,'include':_0xd853d[_0x3e46('0x1e')]?_0xd853d[_0x3e46('0x1e')][_0x3e46('0x23')]?_[_0x3e46('0x24')](_0xd853d[_0x3e46('0x1e')][_0x3e46('0x23')],function(_0x208a5a){return{'model':db[_0x208a5a['model']],'as':_0x208a5a['as'],'attributes':_0x208a5a[_0x3e46('0x21')],'include':_0x208a5a[_0x3e46('0x23')]?_[_0x3e46('0x24')](_0x208a5a[_0x3e46('0x23')],function(_0x48227d){return{'model':db[_0x48227d[_0x3e46('0x25')]],'as':_0x48227d['as'],'attributes':_0x48227d[_0x3e46('0x21')],'include':_0x48227d[_0x3e46('0x23')]?_[_0x3e46('0x24')](_0x48227d[_0x3e46('0x23')],function(_0x23a320){return{'model':db[_0x23a320[_0x3e46('0x25')]],'as':_0x23a320['as'],'attributes':_0x23a320[_0x3e46('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3e46('0x12')](function(_0x580bc5){logger[_0x3e46('0x13')]('GetUser',_0xd853d);logger[_0x3e46('0x26')](_0x3e46('0x1b'),_0xd853d,JSON[_0x3e46('0x17')](_0x580bc5));_0x97c9ea(_0x580bc5);})[_0x3e46('0x27')](function(_0x50c6f4){logger['error'](_0x3e46('0x1b'),_0x50c6f4[_0x3e46('0x19')],_0xd853d);_0x1d1ed6(_0x2a1f7c[_0x3e46('0x18')](0x1f4,_0x50c6f4[_0x3e46('0x19')]));});});};exports[_0x3e46('0x28')]=function(_0x466dfc){var _0x4e2be8=this;return new Promise(function(_0x398efb,_0x9513fc){return db[_0x3e46('0x1c')][_0x3e46('0x29')]({'raw':_0x466dfc[_0x3e46('0x1e')]?_0x466dfc[_0x3e46('0x1e')][_0x3e46('0x1f')]===undefined?!![]:![]:!![],'where':_0x466dfc[_0x3e46('0x1e')]?_0x466dfc['options'][_0x3e46('0x20')]||null:null,'attributes':_0x466dfc[_0x3e46('0x1e')]?_0x466dfc[_0x3e46('0x1e')][_0x3e46('0x21')]||null:null,'include':_0x466dfc[_0x3e46('0x1e')]?_0x466dfc['options']['include']?_['map'](_0x466dfc[_0x3e46('0x1e')][_0x3e46('0x23')],function(_0x193d12){return{'model':db[_0x193d12[_0x3e46('0x25')]],'as':_0x193d12['as'],'attributes':_0x193d12[_0x3e46('0x21')],'include':_0x193d12[_0x3e46('0x23')]?_[_0x3e46('0x24')](_0x193d12['include'],function(_0x2e13de){return{'model':db[_0x2e13de[_0x3e46('0x25')]],'as':_0x2e13de['as'],'attributes':_0x2e13de[_0x3e46('0x21')],'include':_0x2e13de[_0x3e46('0x23')]?_[_0x3e46('0x24')](_0x2e13de['include'],function(_0x51cd69){return{'model':db[_0x51cd69[_0x3e46('0x25')]],'as':_0x51cd69['as'],'attributes':_0x51cd69[_0x3e46('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3e46('0x12')](function(_0x338dd9){logger[_0x3e46('0x13')]('ShowUser',_0x466dfc);logger[_0x3e46('0x26')](_0x3e46('0x28'),_0x466dfc,JSON['stringify'](_0x338dd9));_0x398efb(_0x338dd9);})[_0x3e46('0x27')](function(_0x2e2223){logger[_0x3e46('0x18')](_0x3e46('0x28'),_0x2e2223[_0x3e46('0x19')],_0x466dfc);_0x9513fc(_0x4e2be8[_0x3e46('0x18')](0x1f4,_0x2e2223[_0x3e46('0x19')]));});});};exports[_0x3e46('0x2a')]=function(_0x585939){var _0x21d810=this;return new Promise(function(_0x215e9a,_0x470a46){var _0x1681e0;return db['User']['find']({'where':_0x585939[_0x3e46('0x1e')][_0x3e46('0x20')]||{},'attributes':['id',_0x3e46('0x2b'),_0x3e46('0x2c'),_0x3e46('0x2d'),_0x3e46('0x2e')]})[_0x3e46('0x12')](function(_0xbb3647){if(_0xbb3647){_0x1681e0=_0xbb3647;return db['UserVoiceQueueRt'][_0x3e46('0x2f')]({'paused':0x1},{'where':{'UserId':_0x1681e0['id']},'individualHooks':!![]});}})[_0x3e46('0x12')](function(){if(_0x1681e0){return db['MemberReport'][_0x3e46('0x1d')]({'where':{'membername':_0x1681e0[_0x3e46('0x2b')],'type':_0x3e46('0x30'),'exitAt':null}});}})['then'](function(_0x3e0601){if(_0x1681e0){if(_0x3e0601&&_0x3e0601['length']){var _0x277b6e=moment()[_0x3e46('0x31')](_0x3e46('0x32'));for(var _0x243321=0x0,_0x5c0073=_0x3e0601[_0x3e46('0x33')];_0x243321<_0x5c0073;_0x243321++){_0x3e0601[_0x243321][_0x3e46('0x34')]({'exitAt':_0x277b6e});}}}})['then'](function(){if(_0x1681e0){var _0x5ac2fd=[];var _0x335666=utils[_0x3e46('0x35')]();_0x335666[_0x3e46('0x36')](function(_0x2b9082){_0x5ac2fd[_0x3e46('0x37')]({'channel':_0x2b9082,'membername':_0x1681e0[_0x3e46('0x2b')],'interface':_[_0x3e46('0x38')](_0x1681e0[_0x3e46('0x2e')])?util[_0x3e46('0x31')](_0x3e46('0x39'),_0x1681e0[_0x3e46('0x2b')]):_0x1681e0[_0x3e46('0x2e')],'type':'PAUSE','enterAt':moment()[_0x3e46('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x585939['body'][_0x3e46('0x3a')]||'DEFAULT\x20PAUSE','role':_0x1681e0[_0x3e46('0x2c')],'internal':_0x1681e0[_0x3e46('0x2d')],'uniqueid':_0x585939[_0x3e46('0x3b')]['uniqueid']||null});});return db[_0x3e46('0x3c')][_0x3e46('0x3d')](_0x5ac2fd,{'individualHooks':!![]});}})[_0x3e46('0x12')](function(){if(_0x1681e0){return _0x1681e0[_0x3e46('0x2f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x585939[_0x3e46('0x3b')][_0x3e46('0x3a')]||_0x3e46('0x3e'),'lastPauseAt':moment()['format'](_0x3e46('0x32'))});}})[_0x3e46('0x12')](function(_0x21b1aa){_0x215e9a(_0x21b1aa);})[_0x3e46('0x27')](function(_0x1641e1){_0x470a46(_0x21d810[_0x3e46('0x18')](0x1f4,_0x1641e1['message']));});});};exports[_0x3e46('0x3f')]=function(_0x147368){var _0x2ae6c1=this;return new Promise(function(_0x3eb9e5,_0x2a9273){var _0x201211;return db[_0x3e46('0x1c')][_0x3e46('0x40')]({'where':_0x147368[_0x3e46('0x1e')]['where']||{},'attributes':['id',_0x3e46('0x2b')]})[_0x3e46('0x12')](function(_0x465c42){if(_0x465c42){_0x201211=_0x465c42;if(_0x147368[_0x3e46('0x3b')][_0x3e46('0x41')]&&!utils[_0x3e46('0x42')](_0x147368['body'][_0x3e46('0x41')])){throw new Error(_0x3e46('0x43'));}switch(_0x147368[_0x3e46('0x3b')][_0x3e46('0x41')]){case _0x3e46('0x44'):return db[_0x3e46('0x45')][_0x3e46('0x2f')]({'paused':0x0},{'where':{'UserId':_0x201211['id']}})['then'](function(){return db[_0x3e46('0x3c')][_0x3e46('0x29')]({'where':{'channel':_0x147368[_0x3e46('0x3b')]['channel'],'membername':_0x201211[_0x3e46('0x2b')],'type':_0x3e46('0x30'),'exitAt':null}});})[_0x3e46('0x12')](function(_0x279c30){if(_0x279c30){return _0x279c30[_0x3e46('0x2f')]({'exitAt':moment()['format'](_0x3e46('0x32')),'data2':_0x3e46('0x46')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x201211[_0x3e46('0x2f')]({'voicePause':![]});});case _0x3e46('0x47'):case _0x3e46('0x48'):case _0x3e46('0x49'):case _0x3e46('0x4a'):case _0x3e46('0x4b'):case _0x3e46('0x4c'):return db[_0x3e46('0x3c')][_0x3e46('0x29')]({'where':{'channel':_0x147368['body'][_0x3e46('0x41')],'membername':_0x201211[_0x3e46('0x2b')],'type':_0x3e46('0x30'),'exitAt':null}})[_0x3e46('0x12')](function(_0x58a7fc){return _0x58a7fc['update']({'exitAt':moment()[_0x3e46('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x3e46('0x46')},{'individualHooks':!![]});})[_0x3e46('0x12')](function(){var _0x5d81e0={};_[_0x3e46('0x4d')](_0x5d81e0,util[_0x3e46('0x31')](_0x3e46('0x4e'),_0x147368[_0x3e46('0x3b')][_0x3e46('0x41')],_0x3e46('0x4f')),![]);return _0x201211[_0x3e46('0x2f')](_0x5d81e0);});default:return db[_0x3e46('0x45')]['update']({'paused':0x0},{'where':{'UserId':_0x201211['id']}})[_0x3e46('0x12')](function(){return db[_0x3e46('0x3c')][_0x3e46('0x1d')]({'where':{'membername':_0x201211[_0x3e46('0x2b')],'type':_0x3e46('0x30'),'exitAt':null}});})[_0x3e46('0x12')](function(_0x7c8eff){var _0x1a8274=[];_0x7c8eff[_0x3e46('0x36')](function(_0x3ba00b){_0x1a8274['push'](_0x3ba00b['update']({'exitAt':moment()[_0x3e46('0x31')](_0x3e46('0x32')),'data2':_0x3e46('0x46')}));});return BPromise['all'](_0x1a8274);})[_0x3e46('0x12')](function(){return _0x201211['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x3e46('0x12')](function(_0x4394c5){_0x3eb9e5(_0x4394c5);})['catch'](function(_0x4fb961){_0x2a9273(_0x2ae6c1['error'](0x1f4,_0x4fb961[_0x3e46('0x19')]));});});};exports[_0x3e46('0x50')]=function(_0x3dcc30){var _0x298781=this;return new Promise(function(_0x16a409,_0x1d1b6e){var _0x53e509;return db[_0x3e46('0x1c')][_0x3e46('0x40')]({'where':_0x3dcc30[_0x3e46('0x1e')][_0x3e46('0x20')]||{},'attributes':['id',_0x3e46('0x2b')]})[_0x3e46('0x12')](function(_0x58fb33){if(_0x58fb33){_0x53e509=_0x58fb33;return db['UserVoiceQueueRt'][_0x3e46('0x51')]({'where':{'membername':_0x53e509['name']},'individualHooks':!![]});}})[_0x3e46('0x12')](function(){if(_0x53e509){return db[_0x3e46('0x3c')][_0x3e46('0x1d')]({'where':{'membername':_0x53e509['name'],'exitAt':null}});}})[_0x3e46('0x12')](function(_0x1c3eef){if(_0x53e509){if(_0x1c3eef&&_0x1c3eef[_0x3e46('0x33')]){var _0x5bd49a=[];_0x1c3eef[_0x3e46('0x36')](function(_0x16eab9){_0x5bd49a[_0x3e46('0x37')](_0x16eab9[_0x3e46('0x2f')]({'exitAt':moment()['format'](_0x3e46('0x32'))}));});return BPromise[_0x3e46('0x52')](_0x5bd49a);}}})[_0x3e46('0x12')](function(){if(_0x53e509){return _0x53e509[_0x3e46('0x2f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x3e46('0x12')](function(_0x393822){_0x16a409(_0x393822);})[_0x3e46('0x27')](function(_0x20673c){_0x1d1b6e(_0x298781[_0x3e46('0x18')](0x1f4,_0x20673c[_0x3e46('0x19')]));});});};exports['LoginUser']=function(_0x4c0c52){var _0x40de1d=this;return new Promise(function(_0x5c3db7,_0x4c3410){var _0x1b82e7;var _0x584a02;var _0x48c231;var _0x4ec01b;return db[_0x3e46('0x1c')][_0x3e46('0x40')]({'where':_0x4c0c52[_0x3e46('0x1e')][_0x3e46('0x20')]||{},'attributes':['id',_0x3e46('0x2b'),_0x3e46('0x2c'),'mobile','phone',_0x3e46('0x2d'),_0x3e46('0x53'),'interface']})['then'](function(_0x114e52){if(_0x114e52){_0x1b82e7=_0x114e52;_0x4ec01b=_0x4c0c52[_0x3e46('0x3b')][_0x3e46('0x2e')]?_0x4c0c52['body'][_0x3e46('0x2e')]:util['format'](_0x3e46('0x39'),_0x1b82e7[_0x3e46('0x2b')]);return db[_0x3e46('0x1c')][_0x3e46('0x54')]({'where':{'role':_0x3e46('0x55'),'online':!![],'id':{'$ne':_0x1b82e7['id']}}});}})[_0x3e46('0x12')](function(_0x1e862b){if(_0x1e862b){_0x48c231=_0x1e862b;return require('../../config/license/util')[_0x3e46('0x56')]();}})[_0x3e46('0x12')](function(_0x9a47d3){if(_0x9a47d3&&_0x9a47d3['agents']&&_0x48c231>=_0x9a47d3[_0x3e46('0x57')]){throw new Error(_0x3e46('0x58'));}})[_0x3e46('0x12')](function(){if(_0x1b82e7){return db[_0x3e46('0x45')][_0x3e46('0x51')]({'where':{'membername':_0x1b82e7[_0x3e46('0x2b')]},'individualHooks':!![]});}})[_0x3e46('0x12')](function(){if(_0x1b82e7){return _0x1b82e7[_0x3e46('0x59')]({'raw':!![]});}})[_0x3e46('0x12')](function(_0x4573d7){if(_0x1b82e7){if(_0x4573d7){var _0x1aec96=[];_0x584a02=_0x4573d7;if(_0x584a02[_0x3e46('0x33')]){for(var _0x328dfb=0x0;_0x328dfb<_0x584a02[_0x3e46('0x33')];_0x328dfb++){_0x1aec96[_0x3e46('0x37')](db[_0x3e46('0x45')][_0x3e46('0x5a')]({'membername':_0x1b82e7[_0x3e46('0x2b')],'UserId':_0x1b82e7['id'],'queue_name':_0x584a02[_0x328dfb][_0x3e46('0x2b')],'VoiceQueueId':_0x584a02[_0x328dfb]['id'],'interface':_0x4ec01b,'paused':_0x1b82e7[_0x3e46('0x53')]||![],'penalty':_0x584a02[_0x328dfb][_0x3e46('0x5b')]||0x0}));}return BPromise[_0x3e46('0x52')](_0x1aec96);}}}})[_0x3e46('0x12')](function(){if(_0x1b82e7){return db[_0x3e46('0x3c')]['findAll']({'where':{'membername':_0x1b82e7[_0x3e46('0x2b')],'exitAt':null}});}})[_0x3e46('0x12')](function(_0x5360c3){if(_0x1b82e7){if(_0x5360c3&&_0x5360c3[_0x3e46('0x33')]){var _0x5d6759=[];_0x5360c3[_0x3e46('0x36')](function(_0x114e55){_0x5d6759[_0x3e46('0x37')](_0x114e55[_0x3e46('0x2f')]({'exitAt':moment()[_0x3e46('0x31')](_0x3e46('0x32'))}));});return BPromise[_0x3e46('0x52')](_0x5d6759);}}})[_0x3e46('0x12')](function(_0x38ee00){if(_0x1b82e7){var _0x364bf8=[];var _0x829a5c=[];var _0x5c938b=utils[_0x3e46('0x35')]();var _0x1c1bba={'membername':_0x1b82e7[_0x3e46('0x2b')],'interface':_0x4ec01b,'enterAt':moment()[_0x3e46('0x31')](_0x3e46('0x32')),'role':_0x1b82e7['role'],'internal':_0x1b82e7[_0x3e46('0x2d')]};_0x5c938b['forEach'](function(_0x44e952){_0x364bf8[_0x3e46('0x37')](_[_0x3e46('0x5c')]({'channel':_0x44e952,'type':_0x3e46('0x5d'),'data1':'callysquare','data2':_0x4ec01b},_0x1c1bba));if(_0x1b82e7['loginInPause']){_0x829a5c[_0x3e46('0x37')](_[_0x3e46('0x5c')]({'channel':_0x44e952,'type':_0x3e46('0x30'),'data1':'LOGININPAUSE'},_0x1c1bba));}});return db[_0x3e46('0x3c')][_0x3e46('0x3d')](_0x364bf8[_0x3e46('0x5e')](_0x829a5c),{'individualHooks':!![]});}})['then'](function(){if(_0x1b82e7){return _0x1b82e7['update']({'online':!![],'lastLoginAt':moment()[_0x3e46('0x31')](_0x3e46('0x32')),'voicePause':_0x1b82e7['loginInPause']||![],'mailPause':_0x1b82e7[_0x3e46('0x53')]||![],'chatPause':_0x1b82e7[_0x3e46('0x53')]||![],'faxPause':_0x1b82e7['loginInPause']||![],'smsPause':_0x1b82e7[_0x3e46('0x53')]||![],'openchannelPause':_0x1b82e7[_0x3e46('0x53')]||![],'pauseType':_0x1b82e7[_0x3e46('0x53')]?_0x3e46('0x5f'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x4ec01b});}})[_0x3e46('0x12')](function(_0x21f6f0){_0x5c3db7(_0x21f6f0);})[_0x3e46('0x27')](function(_0x6527de){_0x4c3410(_0x40de1d[_0x3e46('0x18')](0x1f4,_0x6527de[_0x3e46('0x19')]));});});};
\ No newline at end of file
index 787b61e..ac26602 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf281=['./user.events','save','remove','update','removeListener','register','length'];(function(_0x20fb02,_0x96c029){var _0x24a33e=function(_0x4b5c8a){while(--_0x4b5c8a){_0x20fb02['push'](_0x20fb02['shift']());}};_0x24a33e(++_0x96c029);}(_0xf281,0xf5));var _0x1f28=function(_0x813b8f,_0x424a1c){_0x813b8f=_0x813b8f-0x0;var _0x468cc0=_0xf281[_0x813b8f];return _0x468cc0;};'use strict';var UserEvents=require(_0x1f28('0x0'));var events=[_0x1f28('0x1'),_0x1f28('0x2'),_0x1f28('0x3')];function createListener(_0x1d9e23,_0x541b83){return function(_0x504bf8){_0x541b83['emit'](_0x1d9e23,_0x504bf8);};}function removeListener(_0x2cc449,_0x36b7f0){return function(){UserEvents[_0x1f28('0x4')](_0x2cc449,_0x36b7f0);};}exports[_0x1f28('0x5')]=function(_0x3aa85e){for(var _0x2dde55=0x0,_0x4522c9=events[_0x1f28('0x6')];_0x2dde55<_0x4522c9;_0x2dde55++){var _0x49497a=events[_0x2dde55];var _0x1af5bf=createListener('user:'+_0x49497a,_0x3aa85e);UserEvents['on'](_0x49497a,_0x1af5bf);}};
\ No newline at end of file
+var _0x9b21=['emit','register','length','./user.events','save','remove','update'];(function(_0x2e3799,_0x5880a8){var _0x39c9ed=function(_0x33ce43){while(--_0x33ce43){_0x2e3799['push'](_0x2e3799['shift']());}};_0x39c9ed(++_0x5880a8);}(_0x9b21,0xdc));var _0x19b2=function(_0x3aaa69,_0xc0b4b1){_0x3aaa69=_0x3aaa69-0x0;var _0x2824e4=_0x9b21[_0x3aaa69];return _0x2824e4;};'use strict';var UserEvents=require(_0x19b2('0x0'));var events=[_0x19b2('0x1'),_0x19b2('0x2'),_0x19b2('0x3')];function createListener(_0x5244bf,_0x53c602){return function(_0x48eb45){_0x53c602[_0x19b2('0x4')](_0x5244bf,_0x48eb45);};}function removeListener(_0x4f14f2,_0x5b39e0){return function(){UserEvents['removeListener'](_0x4f14f2,_0x5b39e0);};}exports[_0x19b2('0x5')]=function(_0x57474e){for(var _0x424bd7=0x0,_0x371730=events[_0x19b2('0x6')];_0x424bd7<_0x371730;_0x424bd7++){var _0x23108a=events[_0x424bd7];var _0x2096ed=createListener('user:'+_0x23108a,_0x57474e);UserEvents['on'](_0x23108a,_0x2096ed);}};
\ No newline at end of file
index 5e7fedd..08600c8 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(_0xe616f4,_0x433679){var _0x259e56=function(_0x426364){while(--_0x426364){_0xe616f4['push'](_0xe616f4['shift']());}};_0x259e56(++_0x433679);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x51445e,_0x4b4e65){var _0x477ea9=function(_0x3ab148){while(--_0x3ab148){_0x51445e['push'](_0x51445e['shift']());}};_0x477ea9(++_0x4b4e65);}(_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 1221ff6..26717ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d76=['sequelize','exports','INTEGER'];(function(_0x37ccb8,_0xe3b8c6){var _0x417789=function(_0x100571){while(--_0x100571){_0x37ccb8['push'](_0x37ccb8['shift']());}};_0x417789(++_0xe3b8c6);}(_0x0d76,0x19e));var _0x60d7=function(_0x3568c9,_0x543a4d){_0x3568c9=_0x3568c9-0x0;var _0x400db1=_0x0d76[_0x3568c9];return _0x400db1;};'use strict';var Sequelize=require(_0x60d7('0x0'));module[_0x60d7('0x1')]={'penalty':{'type':Sequelize[_0x60d7('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6e66=['sequelize'];(function(_0x4f862c,_0xcd428e){var _0x357200=function(_0x3ce787){while(--_0x3ce787){_0x4f862c['push'](_0x4f862c['shift']());}};_0x357200(++_0xcd428e);}(_0x6e66,0x9d));var _0x66e6=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x6e66[_0x409353];return _0x4f4b59;};'use strict';var Sequelize=require(_0x66e6('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 56e2e49..bf9c700 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f92=['UserChatQueue','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5a7476,_0x521ed7){var _0x690eb9=function(_0x352d39){while(--_0x352d39){_0x5a7476['push'](_0x5a7476['shift']());}};_0x690eb9(++_0x521ed7);}(_0x8f92,0x1c9));var _0x28f9=function(_0x586455,_0x12a0e4){_0x586455=_0x586455-0x0;var _0x22744c=_0x8f92[_0x586455];return _0x22744c;};'use strict';var _=require(_0x28f9('0x0'));var util=require(_0x28f9('0x1'));var logger=require('../../config/logger')(_0x28f9('0x2'));var moment=require(_0x28f9('0x3'));var BPromise=require(_0x28f9('0x4'));var rp=require(_0x28f9('0x5'));var fs=require('fs');var path=require(_0x28f9('0x6'));var rimraf=require(_0x28f9('0x7'));var config=require(_0x28f9('0x8'));var attributes=require('./userChatQueue.attributes');module[_0x28f9('0x9')]=function(_0x23a34d,_0x3f2210){return _0x23a34d[_0x28f9('0xa')](_0x28f9('0xb'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d55=['bluebird','request-promise','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','lodash','api','moment'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x6d55,0x89));var _0x56d5=function(_0x1c6601,_0x44e8e4){_0x1c6601=_0x1c6601-0x0;var _0x1d4bf0=_0x6d55[_0x1c6601];return _0x1d4bf0;};'use strict';var _=require(_0x56d5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x56d5('0x1'));var moment=require(_0x56d5('0x2'));var BPromise=require(_0x56d5('0x3'));var rp=require(_0x56d5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x56d5('0x5'));var attributes=require(_0x56d5('0x6'));module[_0x56d5('0x7')]=function(_0x11c2d9,_0x22999c){return _0x11c2d9['define'](_0x56d5('0x8'),attributes,{'tableName':_0x56d5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2f51f87..a992ff4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8275=['request\x20sent','code','error','UserChatQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','debug','UserChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x8275,0x124));var _0x5827=function(_0x110ac4,_0x2e36e9){_0x110ac4=_0x110ac4-0x0;var _0x1a364d=_0x8275[_0x110ac4];return _0x1a364d;};'use strict';var _=require(_0x5827('0x0'));var util=require(_0x5827('0x1'));var moment=require(_0x5827('0x2'));var BPromise=require(_0x5827('0x3'));var rs=require(_0x5827('0x4'));var fs=require('fs');var Redis=require(_0x5827('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5827('0x6'));var logger=require(_0x5827('0x7'))(_0x5827('0x8'));var config=require('../../config/environment');var jayson=require(_0x5827('0x9'));var client=jayson[_0x5827('0xa')][_0x5827('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10a840,_0x525a37,_0x1f3e5e){return new BPromise(function(_0x47b743,_0x10d3b4){return client['request'](_0x10a840,_0x1f3e5e)[_0x5827('0xc')](function(_0x188451){logger[_0x5827('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x525a37,'request\x20sent');logger[_0x5827('0xe')](_0x5827('0xf'),_0x525a37,_0x5827('0x10'),JSON['stringify'](_0x188451));if(_0x188451['error']){if(_0x188451['error'][_0x5827('0x11')]===0x1f4){logger[_0x5827('0x12')](_0x5827('0x13'),_0x525a37,_0x188451[_0x5827('0x12')]['message']);return _0x10d3b4(_0x188451[_0x5827('0x12')]['message']);}logger[_0x5827('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x525a37,_0x188451[_0x5827('0x12')][_0x5827('0x14')]);return _0x47b743(_0x188451['error'][_0x5827('0x14')]);}else{logger[_0x5827('0xd')](_0x5827('0x13'),_0x525a37,'request\x20sent');_0x47b743(_0x188451[_0x5827('0x15')]['message']);}})['catch'](function(_0x779692){logger[_0x5827('0x12')](_0x5827('0x13'),_0x525a37,_0x779692);_0x10d3b4(_0x779692);});});}
\ No newline at end of file
+var _0x68fa=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x354164,_0x4c30de){var _0x5db9a8=function(_0x319b08){while(--_0x319b08){_0x354164['push'](_0x354164['shift']());}};_0x5db9a8(++_0x4c30de);}(_0x68fa,0x64));var _0xa68f=function(_0x5bbdd3,_0x3be03b){_0x5bbdd3=_0x5bbdd3-0x0;var _0xbb2c40=_0x68fa[_0x5bbdd3];return _0xbb2c40;};'use strict';var _=require(_0xa68f('0x0'));var util=require('util');var moment=require(_0xa68f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa68f('0x2'));var db=require(_0xa68f('0x3'))['db'];var utils=require(_0xa68f('0x4'));var logger=require(_0xa68f('0x5'))(_0xa68f('0x6'));var config=require(_0xa68f('0x7'));var jayson=require(_0xa68f('0x8'));var client=jayson[_0xa68f('0x9')][_0xa68f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5447c1,_0x1366cb,_0x36ccc8){return new BPromise(function(_0x171426,_0x3b8deb){return client[_0xa68f('0xb')](_0x5447c1,_0x36ccc8)['then'](function(_0x4f009c){logger[_0xa68f('0xc')](_0xa68f('0xd'),_0x1366cb,_0xa68f('0xe'));logger[_0xa68f('0xf')](_0xa68f('0x10'),_0x1366cb,_0xa68f('0xe'),JSON[_0xa68f('0x11')](_0x4f009c));if(_0x4f009c[_0xa68f('0x12')]){if(_0x4f009c[_0xa68f('0x12')][_0xa68f('0x13')]===0x1f4){logger['error'](_0xa68f('0xd'),_0x1366cb,_0x4f009c[_0xa68f('0x12')][_0xa68f('0x14')]);return _0x3b8deb(_0x4f009c[_0xa68f('0x12')]['message']);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x1366cb,_0x4f009c[_0xa68f('0x12')][_0xa68f('0x14')]);return _0x171426(_0x4f009c['error'][_0xa68f('0x14')]);}else{logger[_0xa68f('0xc')](_0xa68f('0xd'),_0x1366cb,_0xa68f('0xe'));_0x171426(_0x4f009c[_0xa68f('0x15')][_0xa68f('0x14')]);}})[_0xa68f('0x16')](function(_0x480af0){logger[_0xa68f('0x12')](_0xa68f('0xd'),_0x1366cb,_0x480af0);_0x3b8deb(_0x480af0);});});}
\ No newline at end of file
index ba2ab73..2ffdd87 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(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x20737d,_0xb40cf2){var _0x43a069=function(_0xec29e6){while(--_0xec29e6){_0x20737d['push'](_0x20737d['shift']());}};_0x43a069(++_0xb40cf2);}(_0xedd9,0xfc));var _0x9edd=function(_0x1a51a0,_0x3f1541){_0x1a51a0=_0x1a51a0-0x0;var _0x35eef4=_0xedd9[_0x1a51a0];return _0x35eef4;};'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 f09e1a6..f48e80f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1df5=['exports','INTEGER','STRING'];(function(_0x51e99b,_0x2d7d42){var _0x2af489=function(_0xade5a3){while(--_0xade5a3){_0x51e99b['push'](_0x51e99b['shift']());}};_0x2af489(++_0x2d7d42);}(_0x1df5,0x195));var _0x51df=function(_0x254818,_0x359d7e){_0x254818=_0x254818-0x0;var _0x44a8d9=_0x1df5[_0x254818];return _0x44a8d9;};'use strict';var Sequelize=require('sequelize');module[_0x51df('0x0')]={'penalty':{'type':Sequelize[_0x51df('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x51df('0x2')]}};
\ No newline at end of file
+var _0x1859=['INTEGER','STRING','sequelize','exports'];(function(_0x2d8f6c,_0x44db4c){var _0x3a00f6=function(_0x1b16ea){while(--_0x1b16ea){_0x2d8f6c['push'](_0x2d8f6c['shift']());}};_0x3a00f6(++_0x44db4c);}(_0x1859,0xba));var _0x9185=function(_0x59e3b0,_0xf81707){_0x59e3b0=_0x59e3b0-0x0;var _0x23ec8c=_0x1859[_0x59e3b0];return _0x23ec8c;};'use strict';var Sequelize=require(_0x9185('0x0'));module[_0x9185('0x1')]={'penalty':{'type':Sequelize[_0x9185('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9185('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x9185('0x3')]}};
\ No newline at end of file
index 055371c..31e727b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bc0=['request-promise','path','rimraf','../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api','bluebird'];(function(_0x1c2d01,_0x55590b){var _0x2fe07e=function(_0x1e56f1){while(--_0x1e56f1){_0x1c2d01['push'](_0x1c2d01['shift']());}};_0x2fe07e(++_0x55590b);}(_0x3bc0,0x194));var _0x03bc=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x3bc0[_0x36ed3c];return _0x52a2e0;};'use strict';var _=require(_0x03bc('0x0'));var util=require('util');var logger=require(_0x03bc('0x1'))(_0x03bc('0x2'));var moment=require('moment');var BPromise=require(_0x03bc('0x3'));var rp=require(_0x03bc('0x4'));var fs=require('fs');var path=require(_0x03bc('0x5'));var rimraf=require(_0x03bc('0x6'));var config=require(_0x03bc('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0x03bc('0x8')]=function(_0x26b29c,_0x22b66a){return _0x26b29c[_0x03bc('0x9')](_0x03bc('0xa'),attributes,{'tableName':_0x03bc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ff6=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue'];(function(_0x3dddf0,_0x2cabc5){var _0x322cb3=function(_0x3b0499){while(--_0x3b0499){_0x3dddf0['push'](_0x3dddf0['shift']());}};_0x322cb3(++_0x2cabc5);}(_0x8ff6,0x12b));var _0x68ff=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x8ff6[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0x68ff('0x0'));var util=require(_0x68ff('0x1'));var logger=require(_0x68ff('0x2'))(_0x68ff('0x3'));var moment=require('moment');var BPromise=require(_0x68ff('0x4'));var rp=require(_0x68ff('0x5'));var fs=require('fs');var path=require(_0x68ff('0x6'));var rimraf=require(_0x68ff('0x7'));var config=require(_0x68ff('0x8'));var attributes=require(_0x68ff('0x9'));module[_0x68ff('0xa')]=function(_0x2f0577,_0x19107f){return _0x2f0577[_0x68ff('0xb')](_0x68ff('0xc'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5c0886c..845e2be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe37f=['catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0xe37f,0x79));var _0xfe37=function(_0x3be2e2,_0x5c166d){_0x3be2e2=_0x3be2e2-0x0;var _0x53b9c5=_0xe37f[_0x3be2e2];return _0x53b9c5;};'use strict';var _=require(_0xfe37('0x0'));var util=require('util');var moment=require(_0xfe37('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe37('0x2'));var fs=require('fs');var Redis=require(_0xfe37('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe37('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xfe37('0x5'));var jayson=require(_0xfe37('0x6'));var client=jayson['client'][_0xfe37('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3bf711,_0x5e97e7,_0x359061){return new BPromise(function(_0x3d8bc6,_0x4153b8){return client[_0xfe37('0x8')](_0x3bf711,_0x359061)[_0xfe37('0x9')](function(_0x421798){logger[_0xfe37('0xa')](_0xfe37('0xb'),_0x5e97e7,_0xfe37('0xc'));logger[_0xfe37('0xd')](_0xfe37('0xe'),_0x5e97e7,_0xfe37('0xc'),JSON[_0xfe37('0xf')](_0x421798));if(_0x421798['error']){if(_0x421798[_0xfe37('0x10')][_0xfe37('0x11')]===0x1f4){logger[_0xfe37('0x10')](_0xfe37('0xb'),_0x5e97e7,_0x421798[_0xfe37('0x10')][_0xfe37('0x12')]);return _0x4153b8(_0x421798[_0xfe37('0x10')]['message']);}logger[_0xfe37('0x10')](_0xfe37('0xb'),_0x5e97e7,_0x421798[_0xfe37('0x10')][_0xfe37('0x12')]);return _0x3d8bc6(_0x421798['error'][_0xfe37('0x12')]);}else{logger[_0xfe37('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x5e97e7,_0xfe37('0xc'));_0x3d8bc6(_0x421798['result'][_0xfe37('0x12')]);}})[_0xfe37('0x13')](function(_0x2919d7){logger[_0xfe37('0x10')](_0xfe37('0xb'),_0x5e97e7,_0x2919d7);_0x4153b8(_0x2919d7);});});}
\ No newline at end of file
+var _0xe2ef=['client','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x36ca67,_0x4773ca){var _0x34ae91=function(_0x2109a9){while(--_0x2109a9){_0x36ca67['push'](_0x36ca67['shift']());}};_0x34ae91(++_0x4773ca);}(_0xe2ef,0xd4));var _0xfe2e=function(_0x1d9955,_0x36716d){_0x1d9955=_0x1d9955-0x0;var _0x54f67f=_0xe2ef[_0x1d9955];return _0x54f67f;};'use strict';var _=require(_0xfe2e('0x0'));var util=require(_0xfe2e('0x1'));var moment=require(_0xfe2e('0x2'));var BPromise=require('bluebird');var rs=require(_0xfe2e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe2e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfe2e('0x5'));var config=require(_0xfe2e('0x6'));var jayson=require(_0xfe2e('0x7'));var client=jayson[_0xfe2e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x182610,_0x238b9c,_0xdffd0a){return new BPromise(function(_0x16d8ab,_0xdcc063){return client[_0xfe2e('0x9')](_0x182610,_0xdffd0a)[_0xfe2e('0xa')](function(_0x1b29d2){logger[_0xfe2e('0xb')](_0xfe2e('0xc'),_0x238b9c,'request\x20sent');logger[_0xfe2e('0xd')](_0xfe2e('0xe'),_0x238b9c,_0xfe2e('0xf'),JSON['stringify'](_0x1b29d2));if(_0x1b29d2[_0xfe2e('0x10')]){if(_0x1b29d2[_0xfe2e('0x10')][_0xfe2e('0x11')]===0x1f4){logger['error'](_0xfe2e('0xc'),_0x238b9c,_0x1b29d2[_0xfe2e('0x10')][_0xfe2e('0x12')]);return _0xdcc063(_0x1b29d2['error'][_0xfe2e('0x12')]);}logger[_0xfe2e('0x10')](_0xfe2e('0xc'),_0x238b9c,_0x1b29d2['error'][_0xfe2e('0x12')]);return _0x16d8ab(_0x1b29d2[_0xfe2e('0x10')][_0xfe2e('0x12')]);}else{logger[_0xfe2e('0xb')](_0xfe2e('0xc'),_0x238b9c,_0xfe2e('0xf'));_0x16d8ab(_0x1b29d2['result'][_0xfe2e('0x12')]);}})[_0xfe2e('0x13')](function(_0x5e786e){logger['error'](_0xfe2e('0xc'),_0x238b9c,_0x5e786e);_0xdcc063(_0x5e786e);});});}
\ No newline at end of file
index 86a89b6..6efabb9 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(_0x43444b,_0x8cf95b){var _0x392fe5=function(_0x7a1a82){while(--_0x7a1a82){_0x43444b['push'](_0x43444b['shift']());}};_0x392fe5(++_0x8cf95b);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x19a8f8,_0x57c40c){var _0x3c21a3=function(_0x27a594){while(--_0x27a594){_0x19a8f8['push'](_0x19a8f8['shift']());}};_0x3c21a3(++_0x57c40c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index 97de890..eb905bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd421=['sequelize','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd421,0x195));var _0x1d42=function(_0x2d6422,_0x3ac40d){_0x2d6422=_0x2d6422-0x0;var _0x1862ed=_0xd421[_0x2d6422];return _0x1862ed;};'use strict';var Sequelize=require(_0x1d42('0x0'));module[_0x1d42('0x1')]={'penalty':{'type':Sequelize[_0x1d42('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xcfa6=['sequelize','INTEGER'];(function(_0x4506f2,_0xd5ff7){var _0x1ed04e=function(_0x81ed6d){while(--_0x81ed6d){_0x4506f2['push'](_0x4506f2['shift']());}};_0x1ed04e(++_0xd5ff7);}(_0xcfa6,0x168));var _0x6cfa=function(_0x20f1f7,_0x4730b){_0x20f1f7=_0x20f1f7-0x0;var _0x10ef30=_0xcfa6[_0x20f1f7];return _0x10ef30;};'use strict';var Sequelize=require(_0x6cfa('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6cfa('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index f851f2e..9e53a0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f17=['define','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x255c48,_0x2a4449){var _0xaebda3=function(_0x12a04e){while(--_0x12a04e){_0x255c48['push'](_0x255c48['shift']());}};_0xaebda3(++_0x2a4449);}(_0x5f17,0x121));var _0x75f1=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0x5f17[_0x5f1617];return _0x3af5da;};'use strict';var _=require(_0x75f1('0x0'));var util=require('util');var logger=require(_0x75f1('0x1'))('api');var moment=require('moment');var BPromise=require(_0x75f1('0x2'));var rp=require(_0x75f1('0x3'));var fs=require('fs');var path=require(_0x75f1('0x4'));var rimraf=require('rimraf');var config=require(_0x75f1('0x5'));var attributes=require(_0x75f1('0x6'));module[_0x75f1('0x7')]=function(_0x360d4a,_0x2adb62){return _0x360d4a[_0x75f1('0x8')](_0x75f1('0x9'),attributes,{'tableName':_0x75f1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c6b=['user_has_mail_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue'];(function(_0x68d4db,_0x3c7e0c){var _0x559a69=function(_0x427998){while(--_0x427998){_0x68d4db['push'](_0x68d4db['shift']());}};_0x559a69(++_0x3c7e0c);}(_0x2c6b,0x1ae));var _0xb2c6=function(_0x546f5c,_0x2fc6f5){_0x546f5c=_0x546f5c-0x0;var _0x1c75d9=_0x2c6b[_0x546f5c];return _0x1c75d9;};'use strict';var _=require(_0xb2c6('0x0'));var util=require(_0xb2c6('0x1'));var logger=require(_0xb2c6('0x2'))(_0xb2c6('0x3'));var moment=require(_0xb2c6('0x4'));var BPromise=require('bluebird');var rp=require(_0xb2c6('0x5'));var fs=require('fs');var path=require(_0xb2c6('0x6'));var rimraf=require(_0xb2c6('0x7'));var config=require(_0xb2c6('0x8'));var attributes=require(_0xb2c6('0x9'));module[_0xb2c6('0xa')]=function(_0x29b8b5,_0x4680e5){return _0x29b8b5['define'](_0xb2c6('0xb'),attributes,{'tableName':_0xb2c6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 05c4353..5e34588 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserMailQueue,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x1d73c3,_0x1248f4){var _0x3e3c91=function(_0x3db553){while(--_0x3db553){_0x1d73c3['push'](_0x1d73c3['shift']());}};_0x3e3c91(++_0x1248f4);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2ddfd9,_0x5877d0){_0x2ddfd9=_0x2ddfd9-0x0;var _0x2668f0=_0x4b84[_0x2ddfd9];return _0x2668f0;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});}
\ No newline at end of file
+var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x7217,0x19e));var _0x7721=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x7217[_0x4154a6];return _0x3b2786;};'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')]('UserMailQueue,\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']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
index 7e01f6c..75dc32f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03c2=['express','Router','fs-extra','../../components/interaction/service','sendUserNotification','exports','multer','util','connect-timeout'];(function(_0x4529ac,_0x2ce201){var _0x149098=function(_0x48f1be){while(--_0x48f1be){_0x4529ac['push'](_0x4529ac['shift']());}};_0x149098(++_0x2ce201);}(_0x03c2,0x7b));var _0x203c=function(_0x14548f,_0x2c7397){_0x14548f=_0x14548f-0x0;var _0x59e56c=_0x03c2[_0x14548f];return _0x59e56c;};'use strict';var multer=require(_0x203c('0x0'));var util=require(_0x203c('0x1'));var path=require('path');var timeout=require(_0x203c('0x2'));var express=require(_0x203c('0x3'));var router=express[_0x203c('0x4')]();var fs_extra=require(_0x203c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x203c('0x6'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router['post']('/',auth['isAuthenticated'](),controller[_0x203c('0x7')]);module[_0x203c('0x8')]=router;
\ No newline at end of file
+var _0xbdb1=['fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','util','path','connect-timeout','Router'];(function(_0x302444,_0x15134b){var _0x2ff930=function(_0x17f7d5){while(--_0x17f7d5){_0x302444['push'](_0x302444['shift']());}};_0x2ff930(++_0x15134b);}(_0xbdb1,0x19e));var _0x1bdb=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0xbdb1[_0x178856];return _0x3c7fe7;};'use strict';var multer=require('multer');var util=require(_0x1bdb('0x0'));var path=require(_0x1bdb('0x1'));var timeout=require(_0x1bdb('0x2'));var express=require('express');var router=express[_0x1bdb('0x3')]();var fs_extra=require(_0x1bdb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1bdb('0x5'));var config=require(_0x1bdb('0x6'));var controller=require(_0x1bdb('0x7'));router[_0x1bdb('0x8')]('/',auth[_0x1bdb('0x9')](),controller['sendUserNotification']);module[_0x1bdb('0xa')]=router;
\ No newline at end of file
index be3d61a..ac2a74a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9ca=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x2dc1e7,_0x27a5c7){var _0x388783=function(_0x27c601){while(--_0x27c601){_0x2dc1e7['push'](_0x2dc1e7['shift']());}};_0x388783(++_0x27a5c7);}(_0xc9ca,0x1a1));var _0xac9c=function(_0x34af74,_0x59ab9d){_0x34af74=_0x34af74-0x0;var _0x12d74b=_0xc9ca[_0x34af74];return _0x12d74b;};'use strict';var Sequelize=require(_0xac9c('0x0'));module['exports']={'body':{'type':Sequelize[_0xac9c('0x1')]},'senderName':{'type':Sequelize[_0xac9c('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xac9c('0x2')]},'beep':{'type':Sequelize[_0xac9c('0x3')]}};
\ No newline at end of file
+var _0x9a7d=['STRING','exports','TEXT'];(function(_0x1ddba7,_0x34c28e){var _0xec3225=function(_0xaee903){while(--_0xaee903){_0x1ddba7['push'](_0x1ddba7['shift']());}};_0xec3225(++_0x34c28e);}(_0x9a7d,0xb2));var _0xd9a7=function(_0x2cc017,_0x25b198){_0x2cc017=_0x2cc017-0x0;var _0x509276=_0x9a7d[_0x2cc017];return _0x509276;};'use strict';var Sequelize=require('sequelize');module[_0xd9a7('0x0')]={'body':{'type':Sequelize[_0xd9a7('0x1')]},'senderName':{'type':Sequelize[_0xd9a7('0x2')]},'recipientsId':{'type':Sequelize[_0xd9a7('0x1')]},'recipientsDescription':{'type':Sequelize[_0xd9a7('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}};
\ No newline at end of file
index c301a54..ad97f81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6d1=['transaction','UserNotification','recipient','userNotification:send','catch','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','forEach','union','ids','queue','replace','Queue','push','flatten','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./userNotification.socket','register','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','sendUserNotification','hasOwnProperty','text','body','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','recipientsId'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa6d1,0x6f));var _0x1a6d=function(_0x2d370a,_0x5ea4d9){_0x2d370a=_0x2d370a-0x0;var _0x20fa6f=_0xa6d1[_0x2d370a];return _0x20fa6f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a6d('0x0'));var zipdir=require(_0x1a6d('0x1'));var jsonpatch=require(_0x1a6d('0x2'));var rp=require(_0x1a6d('0x3'));var moment=require('moment');var BPromise=require(_0x1a6d('0x4'));var Mustache=require('mustache');var util=require(_0x1a6d('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(_0x1a6d('0x6'));var _=require(_0x1a6d('0x7'));var squel=require(_0x1a6d('0x8'));var crypto=require(_0x1a6d('0x9'));var jsforce=require(_0x1a6d('0xa'));var deskjs=require(_0x1a6d('0xb'));var toCsv=require(_0x1a6d('0xc'));var querystring=require(_0x1a6d('0xd'));var Papa=require(_0x1a6d('0xe'));var Redis=require('ioredis');var authService=require(_0x1a6d('0xf'));var qs=require(_0x1a6d('0x10'));var as=require(_0x1a6d('0x11'));var hardwareService=require(_0x1a6d('0x12'));var logger=require('../../config/logger')(_0x1a6d('0x13'));var utils=require('../../config/utils');var config=require(_0x1a6d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1a6d('0x15'))['db'];config['redis']=_[_0x1a6d('0x16')](config[_0x1a6d('0x17')],{'host':_0x1a6d('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1a6d('0x17')]));require(_0x1a6d('0x19'))[_0x1a6d('0x1a')](socket);function respondWithStatusCode(_0x29f41f,_0x2e0417){_0x2e0417=_0x2e0417||0xcc;return function(_0x55d388){if(_0x55d388){return _0x29f41f[_0x1a6d('0x1b')](_0x2e0417);}return _0x29f41f[_0x1a6d('0x1c')](_0x2e0417)['end']();};}function respondWithResult(_0x566c88,_0x67275c){_0x67275c=_0x67275c||0xc8;return function(_0x1a3042){if(_0x1a3042){return _0x566c88[_0x1a6d('0x1c')](_0x67275c)[_0x1a6d('0x1d')](_0x1a3042);}};}function respondWithFilteredResult(_0x3e4d96,_0x4c03bf){return function(_0x5af447){if(_0x5af447){var _0x4d2173=typeof _0x4c03bf[_0x1a6d('0x1e')]===_0x1a6d('0x1f')&&typeof _0x4c03bf['limit']==='undefined';var _0x328c1c=_0x5af447[_0x1a6d('0x20')];var _0x1be97a=_0x4d2173?0x0:_0x4c03bf['offset'];var _0x2c59be=_0x4d2173?_0x5af447[_0x1a6d('0x20')]:_0x4c03bf[_0x1a6d('0x1e')]+_0x4c03bf['limit'];var _0x2f5346;if(_0x2c59be>=_0x328c1c){_0x2c59be=_0x328c1c;_0x2f5346=0xc8;}else{_0x2f5346=0xce;}_0x3e4d96[_0x1a6d('0x1c')](_0x2f5346);return _0x3e4d96['set'](_0x1a6d('0x21'),_0x1be97a+'-'+_0x2c59be+'/'+_0x328c1c)[_0x1a6d('0x1d')](_0x5af447);}return null;};}function patchUpdates(_0x2ad657){return function(_0x436fcb){try{jsonpatch[_0x1a6d('0x22')](_0x436fcb,_0x2ad657,!![]);}catch(_0x3d65bd){return BPromise[_0x1a6d('0x23')](_0x3d65bd);}return _0x436fcb[_0x1a6d('0x24')]();};}function saveUpdates(_0x2bc972,_0x38cf53){return function(_0x403682){if(_0x403682){return _0x403682[_0x1a6d('0x25')](_0x2bc972)[_0x1a6d('0x26')](function(_0x58ac6f){return _0x58ac6f;});}return null;};}function removeEntity(_0x1b5b2c,_0x35e741){return function(_0x41d821){if(_0x41d821){return _0x41d821[_0x1a6d('0x27')]()[_0x1a6d('0x26')](function(){_0x1b5b2c[_0x1a6d('0x1c')](0xcc)[_0x1a6d('0x28')]();});}};}function handleEntityNotFound(_0x51d7d3,_0x278d38){return function(_0x4849a6){if(!_0x4849a6){_0x51d7d3[_0x1a6d('0x1b')](0x194);}return _0x4849a6;};}function handleError(_0x11a3a4,_0x3d179b){_0x3d179b=_0x3d179b||0x1f4;return function(_0x2928a8){logger[_0x1a6d('0x29')](_0x2928a8[_0x1a6d('0x2a')]);if(_0x2928a8[_0x1a6d('0x2b')]){delete _0x2928a8[_0x1a6d('0x2b')];}_0x11a3a4[_0x1a6d('0x1c')](_0x3d179b)[_0x1a6d('0x2c')](_0x2928a8);};}exports[_0x1a6d('0x2d')]=function(_0x4eeecf,_0xbdce3c,_0x4acb21){if(!_0x4eeecf['body'][_0x1a6d('0x2e')](_0x1a6d('0x2f'))&&!_0x4eeecf[_0x1a6d('0x30')][_0x1a6d('0x2e')](_0x1a6d('0x31'))){throw new db[(_0x1a6d('0x32'))][(_0x1a6d('0x33'))](_0x1a6d('0x34'));}else{if(_0x4eeecf[_0x1a6d('0x30')][_0x1a6d('0x2e')](_0x1a6d('0x31'))&&!_0x4eeecf['body'][_0x1a6d('0x2e')]('view')){throw new db[(_0x1a6d('0x32'))][(_0x1a6d('0x33'))](_0x1a6d('0x35'));}if(!_0x4eeecf[_0x1a6d('0x30')]['hasOwnProperty'](_0x1a6d('0x36'))){throw new db[(_0x1a6d('0x32'))][(_0x1a6d('0x33'))](_0x1a6d('0x37'));}else{try{var _0xc7bdef=JSON[_0x1a6d('0x38')](_0x4eeecf[_0x1a6d('0x30')][_0x1a6d('0x36')]);}catch(_0x2313a7){logger[_0x1a6d('0x29')](_0x2313a7);throw new db[(_0x1a6d('0x32'))][(_0x1a6d('0x33'))](_0x1a6d('0x39'));}var _0x3a9657=[_0x1a6d('0x3a'),_0x1a6d('0x3b'),_0x1a6d('0x3c'),_0x1a6d('0x3d'),'smsqueue',_0x1a6d('0x3e'),'whatsappqueue','team',_0x1a6d('0x3f')];if(_['some'](_0xc7bdef,function(_0x13e1fd){return!_[_0x1a6d('0x40')](_0x3a9657,_0x13e1fd[_0x1a6d('0x41')][_0x1a6d('0x42')]());})){throw new db[(_0x1a6d('0x32'))][(_0x1a6d('0x33'))](_0x1a6d('0x43'));}}}var _0x36c8fd={};_0x36c8fd[_0x1a6d('0x44')]=_0x4eeecf[_0x1a6d('0x30')][_0x1a6d('0x2e')](_0x1a6d('0x44'))?_0x4eeecf[_0x1a6d('0x30')]['senderName']:_0x4eeecf['user'][_0x1a6d('0x45')];_0x36c8fd[_0x1a6d('0x46')]=_['isEmpty'](_0x4eeecf[_0x1a6d('0x30')][_0x1a6d('0x46')])?null:_0x4eeecf[_0x1a6d('0x30')][_0x1a6d('0x46')];_0x36c8fd[_0x1a6d('0x47')]=_0x4eeecf[_0x1a6d('0x30')][_0x1a6d('0x47')]||![];_0x36c8fd['SenderId']=_0x4eeecf[_0x1a6d('0x3f')]['id'];return getContent(_0x4eeecf[_0x1a6d('0x30')])[_0x1a6d('0x26')](function(_0x5f1471){_0x36c8fd['body']=_0x5f1471;return getRecipients(_0xc7bdef);})[_0x1a6d('0x26')](function(_0x41df15){_0x36c8fd[_0x1a6d('0x48')]=_['sortBy'](_0x41df15)['join'](',');return db['sequelize'][_0x1a6d('0x49')](function(_0x17d877){return db[_0x1a6d('0x4a')]['create'](_0x36c8fd,{'raw':!![],'transaction':_0x17d877})[_0x1a6d('0x26')](function(_0x2f5278){var _0x1177f1={'sender':_0x36c8fd[_0x1a6d('0x44')],'description':_0x36c8fd[_0x1a6d('0x46')],'content':_0x36c8fd[_0x1a6d('0x30')],'beep':_0x36c8fd[_0x1a6d('0x47')]};_0x41df15['forEach'](function(_0x22c979){_0x1177f1[_0x1a6d('0x4b')]=_0x22c979;socket['emit'](_0x1a6d('0x4c'),_0x1177f1);});return _0x2f5278;});});})[_0x1a6d('0x26')](respondWithResult(_0xbdce3c,0xc9))[_0x1a6d('0x4d')](handleError(_0xbdce3c,null));};function getContent(_0x3229a6){return new BPromise(function(_0x7547e2,_0x2c1f24){if(_0x3229a6['text']){_0x7547e2(_0x3229a6[_0x1a6d('0x2f')]);return;}return db['Template'][_0x1a6d('0x4e')]({'attributes':[_0x1a6d('0x4f')],'where':{'id':_0x3229a6[_0x1a6d('0x31')]},'raw':!![]})[_0x1a6d('0x26')](function(_0x163dcd){if(!_0x163dcd)throw new db[(_0x1a6d('0x32'))]['ValidationError'](_0x1a6d('0x50'));var _0x5c1dae=Mustache[_0x1a6d('0x51')](_0x163dcd[_0x1a6d('0x4f')],_0x3229a6[_0x1a6d('0x52')]);_0x7547e2(_0x5c1dae);})['catch'](function(_0x1e789c){_0x2c1f24(_0x1e789c);});});}function getRecipients(_0xd3b460){return new BPromise(function(_0x241630,_0x151e3c){var _0x49a228=[];var _0x4e64ad=[];_0xd3b460[_0x1a6d('0x53')](function(_0x54011c){var _0x42ab37=_['startCase'](_0x54011c[_0x1a6d('0x41')][_0x1a6d('0x42')]());if(_0x42ab37==='User'){_0x49a228=_[_0x1a6d('0x54')](_0x49a228,_0x54011c[_0x1a6d('0x55')]);}else{if(_[_0x1a6d('0x40')](_0x42ab37,_0x1a6d('0x56')))_0x42ab37=_0x42ab37[_0x1a6d('0x57')](_0x1a6d('0x56'),_0x1a6d('0x58'));_0x54011c['ids'][_0x1a6d('0x53')](function(_0x2863ec){_0x4e64ad[_0x1a6d('0x59')](getAgents(_0x42ab37,_0x2863ec));});}});return BPromise['all'](_0x4e64ad)[_0x1a6d('0x26')](function(_0x4f4d1d){_0x49a228=_[_0x1a6d('0x54')](_0x49a228,_[_0x1a6d('0x5a')](_0x4f4d1d));_0x241630(_0x49a228);})['catch'](function(_0x4f4a81){_0x151e3c(_0x4f4a81);});});}function getAgents(_0x4858de,_0x57185e){return new BPromise(function(_0x36e6a3,_0x244da7){return db[_0x4858de]['findOne']({'where':{'id':_0x57185e}})['then'](function(_0x30d3eb){return _0x30d3eb[_0x1a6d('0x5b')]({'attributes':['id'],'raw':!![]})[_0x1a6d('0x26')](function(_0x1a45a4){var _0x49ea8d=_['map'](_0x1a45a4,'id');_0x36e6a3(_0x49ea8d);});})['catch'](function(_0x1f15e8){_0x244da7(_0x1f15e8);});});}
\ No newline at end of file
+var _0xbfba=['Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','catch','startCase','model','User','union','ids','queue','replace','push','flatten','getAgents','map','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','register','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','view','Missing\x20\x27view\x27\x20parameter','parse','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','beep','SenderId','recipientsId','sortBy','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send'];(function(_0x3a6fcb,_0x10f2ff){var _0x27601a=function(_0x172da8){while(--_0x172da8){_0x3a6fcb['push'](_0x3a6fcb['shift']());}};_0x27601a(++_0x10f2ff);}(_0xbfba,0x1b5));var _0xabfb=function(_0x5c8f33,_0x346482){_0x5c8f33=_0x5c8f33-0x0;var _0x40aa14=_0xbfba[_0x5c8f33];return _0x40aa14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xabfb('0x0'));var zipdir=require(_0xabfb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xabfb('0x2'));var moment=require(_0xabfb('0x3'));var BPromise=require(_0xabfb('0x4'));var Mustache=require('mustache');var util=require(_0xabfb('0x5'));var path=require(_0xabfb('0x6'));var sox=require(_0xabfb('0x7'));var csv=require(_0xabfb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xabfb('0x9'));var _=require(_0xabfb('0xa'));var squel=require(_0xabfb('0xb'));var crypto=require(_0xabfb('0xc'));var jsforce=require(_0xabfb('0xd'));var deskjs=require(_0xabfb('0xe'));var toCsv=require(_0xabfb('0x8'));var querystring=require(_0xabfb('0xf'));var Papa=require(_0xabfb('0x10'));var Redis=require(_0xabfb('0x11'));var authService=require(_0xabfb('0x12'));var qs=require(_0xabfb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabfb('0x14'));var logger=require(_0xabfb('0x15'))(_0xabfb('0x16'));var utils=require(_0xabfb('0x17'));var config=require(_0xabfb('0x18'));var licenseUtil=require(_0xabfb('0x19'));var db=require(_0xabfb('0x1a'))['db'];config[_0xabfb('0x1b')]=_[_0xabfb('0x1c')](config[_0xabfb('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xabfb('0x1d'))(new Redis(config[_0xabfb('0x1b')]));require(_0xabfb('0x1e'))[_0xabfb('0x1f')](socket);function respondWithStatusCode(_0x12cf43,_0x4ca784){_0x4ca784=_0x4ca784||0xcc;return function(_0x31e2d5){if(_0x31e2d5){return _0x12cf43['sendStatus'](_0x4ca784);}return _0x12cf43[_0xabfb('0x20')](_0x4ca784)['end']();};}function respondWithResult(_0x261e6f,_0x573cab){_0x573cab=_0x573cab||0xc8;return function(_0x57a441){if(_0x57a441){return _0x261e6f['status'](_0x573cab)[_0xabfb('0x21')](_0x57a441);}};}function respondWithFilteredResult(_0x3cade4,_0x396aad){return function(_0x57da5f){if(_0x57da5f){var _0xc5772f=typeof _0x396aad[_0xabfb('0x22')]===_0xabfb('0x23')&&typeof _0x396aad['limit']===_0xabfb('0x23');var _0x54802f=_0x57da5f[_0xabfb('0x24')];var _0x27ca01=_0xc5772f?0x0:_0x396aad[_0xabfb('0x22')];var _0x3c52b4=_0xc5772f?_0x57da5f['count']:_0x396aad[_0xabfb('0x22')]+_0x396aad['limit'];var _0x3708fc;if(_0x3c52b4>=_0x54802f){_0x3c52b4=_0x54802f;_0x3708fc=0xc8;}else{_0x3708fc=0xce;}_0x3cade4[_0xabfb('0x20')](_0x3708fc);return _0x3cade4[_0xabfb('0x25')](_0xabfb('0x26'),_0x27ca01+'-'+_0x3c52b4+'/'+_0x54802f)[_0xabfb('0x21')](_0x57da5f);}return null;};}function patchUpdates(_0x33f6b0){return function(_0x35b3f7){try{jsonpatch[_0xabfb('0x27')](_0x35b3f7,_0x33f6b0,!![]);}catch(_0x538ada){return BPromise[_0xabfb('0x28')](_0x538ada);}return _0x35b3f7[_0xabfb('0x29')]();};}function saveUpdates(_0x1b0e11,_0xdd6376){return function(_0x2b0e2d){if(_0x2b0e2d){return _0x2b0e2d[_0xabfb('0x2a')](_0x1b0e11)[_0xabfb('0x2b')](function(_0x405476){return _0x405476;});}return null;};}function removeEntity(_0x119d30,_0x1d9801){return function(_0x3d23a1){if(_0x3d23a1){return _0x3d23a1['destroy']()['then'](function(){_0x119d30[_0xabfb('0x20')](0xcc)[_0xabfb('0x2c')]();});}};}function handleEntityNotFound(_0x1a0cc0,_0x5c1c07){return function(_0x57311a){if(!_0x57311a){_0x1a0cc0[_0xabfb('0x2d')](0x194);}return _0x57311a;};}function handleError(_0x5077d8,_0x52ff92){_0x52ff92=_0x52ff92||0x1f4;return function(_0x2e6584){logger[_0xabfb('0x2e')](_0x2e6584['stack']);if(_0x2e6584[_0xabfb('0x2f')]){delete _0x2e6584[_0xabfb('0x2f')];}_0x5077d8['status'](_0x52ff92)[_0xabfb('0x30')](_0x2e6584);};}exports[_0xabfb('0x31')]=function(_0x2f198c,_0x59d55b,_0x598ae9){if(!_0x2f198c[_0xabfb('0x32')][_0xabfb('0x33')](_0xabfb('0x34'))&&!_0x2f198c['body'][_0xabfb('0x33')](_0xabfb('0x35'))){throw new db[(_0xabfb('0x36'))][(_0xabfb('0x37'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x2f198c['body'][_0xabfb('0x33')](_0xabfb('0x35'))&&!_0x2f198c[_0xabfb('0x32')][_0xabfb('0x33')](_0xabfb('0x38'))){throw new db[(_0xabfb('0x36'))]['ValidationError'](_0xabfb('0x39'));}if(!_0x2f198c['body'][_0xabfb('0x33')]('recipients')){throw new db[(_0xabfb('0x36'))][(_0xabfb('0x37'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x299bae=JSON[_0xabfb('0x3a')](_0x2f198c[_0xabfb('0x32')][_0xabfb('0x3b')]);}catch(_0x33fd01){logger[_0xabfb('0x2e')](_0x33fd01);throw new db[(_0xabfb('0x36'))][(_0xabfb('0x37'))](_0xabfb('0x3c'));}var _0x44a46d=[_0xabfb('0x3d'),_0xabfb('0x3e'),_0xabfb('0x3f'),_0xabfb('0x40'),_0xabfb('0x41'),_0xabfb('0x42'),_0xabfb('0x43'),_0xabfb('0x44'),_0xabfb('0x45')];if(_[_0xabfb('0x46')](_0x299bae,function(_0x184720){return!_[_0xabfb('0x47')](_0x44a46d,_0x184720['model'][_0xabfb('0x48')]());})){throw new db[(_0xabfb('0x36'))][(_0xabfb('0x37'))](_0xabfb('0x49'));}}}var _0x2c0bce={};_0x2c0bce['senderName']=_0x2f198c[_0xabfb('0x32')][_0xabfb('0x33')]('senderName')?_0x2f198c[_0xabfb('0x32')][_0xabfb('0x4a')]:_0x2f198c[_0xabfb('0x45')]['fullname'];_0x2c0bce[_0xabfb('0x4b')]=_['isEmpty'](_0x2f198c[_0xabfb('0x32')][_0xabfb('0x4b')])?null:_0x2f198c['body']['recipientsDescription'];_0x2c0bce[_0xabfb('0x4c')]=_0x2f198c[_0xabfb('0x32')][_0xabfb('0x4c')]||![];_0x2c0bce[_0xabfb('0x4d')]=_0x2f198c[_0xabfb('0x45')]['id'];return getContent(_0x2f198c['body'])[_0xabfb('0x2b')](function(_0x209a20){_0x2c0bce[_0xabfb('0x32')]=_0x209a20;return getRecipients(_0x299bae);})['then'](function(_0x455e1a){_0x2c0bce[_0xabfb('0x4e')]=_[_0xabfb('0x4f')](_0x455e1a)['join'](',');return db[_0xabfb('0x50')][_0xabfb('0x51')](function(_0x13d4da){return db[_0xabfb('0x52')][_0xabfb('0x53')](_0x2c0bce,{'raw':!![],'transaction':_0x13d4da})['then'](function(_0x3fc0b6){var _0x4449b4={'sender':_0x2c0bce[_0xabfb('0x4a')],'description':_0x2c0bce['recipientsDescription'],'content':_0x2c0bce[_0xabfb('0x32')],'beep':_0x2c0bce[_0xabfb('0x4c')]};_0x455e1a[_0xabfb('0x54')](function(_0x41bcf0){_0x4449b4[_0xabfb('0x55')]=_0x41bcf0;socket[_0xabfb('0x56')](_0xabfb('0x57'),_0x4449b4);});return _0x3fc0b6;});});})[_0xabfb('0x2b')](respondWithResult(_0x59d55b,0xc9))['catch'](handleError(_0x59d55b,null));};function getContent(_0x449f40){return new BPromise(function(_0x56945e,_0xe98dbe){if(_0x449f40[_0xabfb('0x34')]){_0x56945e(_0x449f40[_0xabfb('0x34')]);return;}return db[_0xabfb('0x58')][_0xabfb('0x59')]({'attributes':['html'],'where':{'id':_0x449f40[_0xabfb('0x35')]},'raw':!![]})[_0xabfb('0x2b')](function(_0x45b785){if(!_0x45b785)throw new db[(_0xabfb('0x36'))][(_0xabfb('0x37'))](_0xabfb('0x5a'));var _0x238892=Mustache[_0xabfb('0x5b')](_0x45b785[_0xabfb('0x5c')],_0x449f40[_0xabfb('0x38')]);_0x56945e(_0x238892);})[_0xabfb('0x5d')](function(_0x15028c){_0xe98dbe(_0x15028c);});});}function getRecipients(_0x31f005){return new BPromise(function(_0x5003f7,_0xc1cb34){var _0x47d692=[];var _0x1054e4=[];_0x31f005[_0xabfb('0x54')](function(_0x29aa57){var _0x4d2bb7=_[_0xabfb('0x5e')](_0x29aa57[_0xabfb('0x5f')][_0xabfb('0x48')]());if(_0x4d2bb7===_0xabfb('0x60')){_0x47d692=_[_0xabfb('0x61')](_0x47d692,_0x29aa57[_0xabfb('0x62')]);}else{if(_[_0xabfb('0x47')](_0x4d2bb7,_0xabfb('0x63')))_0x4d2bb7=_0x4d2bb7[_0xabfb('0x64')](_0xabfb('0x63'),'Queue');_0x29aa57['ids'][_0xabfb('0x54')](function(_0x4fbde1){_0x1054e4[_0xabfb('0x65')](getAgents(_0x4d2bb7,_0x4fbde1));});}});return BPromise['all'](_0x1054e4)[_0xabfb('0x2b')](function(_0x5dabd2){_0x47d692=_[_0xabfb('0x61')](_0x47d692,_[_0xabfb('0x66')](_0x5dabd2));_0x5003f7(_0x47d692);})[_0xabfb('0x5d')](function(_0x32e92d){_0xc1cb34(_0x32e92d);});});}function getAgents(_0x24d75e,_0x353a62){return new BPromise(function(_0x23d73b,_0x1a91c7){return db[_0x24d75e][_0xabfb('0x59')]({'where':{'id':_0x353a62}})[_0xabfb('0x2b')](function(_0x89d19e){return _0x89d19e[_0xabfb('0x67')]({'attributes':['id'],'raw':!![]})[_0xabfb('0x2b')](function(_0x27c343){var _0x2db97f=_[_0xabfb('0x68')](_0x27c343,'id');_0x23d73b(_0x2db97f);});})[_0xabfb('0x5d')](function(_0x2f5e97){_0x1a91c7(_0x2f5e97);});});}
\ No newline at end of file
index 8372e53..fc1a096 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1cc=['hook','events','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x4ffa64,_0x271035){var _0x5da001=function(_0x7d1940){while(--_0x7d1940){_0x4ffa64['push'](_0x4ffa64['shift']());}};_0x5da001(++_0x271035);}(_0xf1cc,0xd3));var _0xcf1c=function(_0x2479e1,_0x2753f6){_0x2479e1=_0x2479e1-0x0;var _0x501acd=_0xf1cc[_0x2479e1];return _0x501acd;};'use strict';var EventEmitter=require(_0xcf1c('0x0'));var UserNotification=require(_0xcf1c('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xcf1c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xcf1c('0x3')};function emitEvent(_0x8b23){return function(_0x1d2563,_0x6870d1,_0x28aa30){UserNotificationEvents[_0xcf1c('0x4')](_0x8b23+':'+_0x1d2563['id'],_0x1d2563);UserNotificationEvents['emit'](_0x8b23,_0x1d2563);_0x28aa30(null);};}for(var e in events){if(events[_0xcf1c('0x5')](e)){var event=events[e];UserNotification[_0xcf1c('0x6')](e,emitEvent(event));}}module['exports']=UserNotificationEvents;
\ No newline at end of file
+var _0x9159=['save','update','remove','emit','hasOwnProperty','hook','events','UserNotification','setMaxListeners'];(function(_0x1ab6b8,_0x23da1b){var _0x397a24=function(_0x1a6bae){while(--_0x1a6bae){_0x1ab6b8['push'](_0x1ab6b8['shift']());}};_0x397a24(++_0x23da1b);}(_0x9159,0x126));var _0x9915=function(_0x2eee25,_0x53460d){_0x2eee25=_0x2eee25-0x0;var _0x1cb8c4=_0x9159[_0x2eee25];return _0x1cb8c4;};'use strict';var EventEmitter=require(_0x9915('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x9915('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x9915('0x2')](0x0);var events={'afterCreate':_0x9915('0x3'),'afterUpdate':_0x9915('0x4'),'afterDestroy':_0x9915('0x5')};function emitEvent(_0x160ea1){return function(_0x530e5b,_0x3663f5,_0x30f1bb){UserNotificationEvents[_0x9915('0x6')](_0x160ea1+':'+_0x530e5b['id'],_0x530e5b);UserNotificationEvents['emit'](_0x160ea1,_0x530e5b);_0x30f1bb(null);};}for(var e in events){if(events[_0x9915('0x7')](e)){var event=events[e];UserNotification[_0x9915('0x8')](e,emitEvent(event));}}module['exports']=UserNotificationEvents;
\ No newline at end of file
index d22d428..0d4ea06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe421=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4'];(function(_0x2fdbb6,_0x46f68a){var _0x2c0ee6=function(_0x40cdd4){while(--_0x40cdd4){_0x2fdbb6['push'](_0x2fdbb6['shift']());}};_0x2c0ee6(++_0x46f68a);}(_0xe421,0x10f));var _0x1e42=function(_0x4dd843,_0x4ad7dd){_0x4dd843=_0x4dd843-0x0;var _0x48e912=_0xe421[_0x4dd843];return _0x48e912;};'use strict';var _=require(_0x1e42('0x0'));var util=require(_0x1e42('0x1'));var logger=require('../../config/logger')(_0x1e42('0x2'));var moment=require(_0x1e42('0x3'));var BPromise=require(_0x1e42('0x4'));var rp=require(_0x1e42('0x5'));var fs=require('fs');var path=require(_0x1e42('0x6'));var rimraf=require('rimraf');var config=require(_0x1e42('0x7'));var attributes=require(_0x1e42('0x8'));module[_0x1e42('0x9')]=function(_0x25fc1c,_0x339b55){return _0x25fc1c[_0x1e42('0xa')](_0x1e42('0xb'),attributes,{'tableName':_0x1e42('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1e42('0xd'),'collate':_0x1e42('0xe')});};
\ No newline at end of file
+var _0x9474=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4_unicode_ci'];(function(_0x40fa1c,_0xeb346a){var _0x5ac199=function(_0x263f4e){while(--_0x263f4e){_0x40fa1c['push'](_0x40fa1c['shift']());}};_0x5ac199(++_0xeb346a);}(_0x9474,0x68));var _0x4947=function(_0x4ba380,_0x259bee){_0x4ba380=_0x4ba380-0x0;var _0x4b111b=_0x9474[_0x4ba380];return _0x4b111b;};'use strict';var _=require(_0x4947('0x0'));var util=require('util');var logger=require(_0x4947('0x1'))(_0x4947('0x2'));var moment=require(_0x4947('0x3'));var BPromise=require(_0x4947('0x4'));var rp=require(_0x4947('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4947('0x6'));var config=require(_0x4947('0x7'));var attributes=require(_0x4947('0x8'));module[_0x4947('0x9')]=function(_0x419f2b,_0x2b7d71){return _0x419f2b['define'](_0x4947('0xa'),attributes,{'tableName':_0x4947('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4947('0xc')});};
\ No newline at end of file
index 6c833c5..3bfc8e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd616=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring'];(function(_0x2e7c46,_0x4cc78b){var _0x72b22=function(_0x46772b){while(--_0x46772b){_0x2e7c46['push'](_0x2e7c46['shift']());}};_0x72b22(++_0x4cc78b);}(_0xd616,0x168));var _0x6d61=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0xd616[_0x548627];return _0x844a84;};'use strict';var _=require(_0x6d61('0x0'));var util=require(_0x6d61('0x1'));var moment=require('moment');var BPromise=require(_0x6d61('0x2'));var rs=require(_0x6d61('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d61('0x4'))['db'];var utils=require(_0x6d61('0x5'));var logger=require(_0x6d61('0x6'))(_0x6d61('0x7'));var config=require(_0x6d61('0x8'));var jayson=require(_0x6d61('0x9'));var client=jayson[_0x6d61('0xa')][_0x6d61('0xb')]({'port':0x232a});config[_0x6d61('0xc')]=_[_0x6d61('0xd')](config[_0x6d61('0xc')],{'host':_0x6d61('0xe'),'port':0x18eb});var socket=require(_0x6d61('0xf'))(new Redis(config[_0x6d61('0xc')]));require(_0x6d61('0x10'))[_0x6d61('0x11')](socket);function respondWithRpcPromise(_0x20eed5,_0x303c8e,_0x4f030a){return new BPromise(function(_0x4aeb5b,_0x4db5ed){return client['request'](_0x20eed5,_0x4f030a)[_0x6d61('0x12')](function(_0x2f8c25){logger['info'](_0x6d61('0x13'),_0x303c8e,_0x6d61('0x14'));logger[_0x6d61('0x15')](_0x6d61('0x16'),_0x303c8e,_0x6d61('0x14'),JSON[_0x6d61('0x17')](_0x2f8c25));if(_0x2f8c25[_0x6d61('0x18')]){if(_0x2f8c25[_0x6d61('0x18')][_0x6d61('0x19')]===0x1f4){logger[_0x6d61('0x18')](_0x6d61('0x13'),_0x303c8e,_0x2f8c25[_0x6d61('0x18')][_0x6d61('0x1a')]);return _0x4db5ed(_0x2f8c25[_0x6d61('0x18')][_0x6d61('0x1a')]);}logger[_0x6d61('0x18')](_0x6d61('0x13'),_0x303c8e,_0x2f8c25['error']['message']);return _0x4aeb5b(_0x2f8c25[_0x6d61('0x18')][_0x6d61('0x1a')]);}else{logger['info'](_0x6d61('0x13'),_0x303c8e,'request\x20sent');_0x4aeb5b(_0x2f8c25['result'][_0x6d61('0x1a')]);}})[_0x6d61('0x1b')](function(_0x12d2f0){logger[_0x6d61('0x18')]('UserNotification,\x20%s,\x20%s',_0x303c8e,_0x12d2f0);_0x4db5ed(_0x12d2f0);});});}
\ No newline at end of file
+var _0x8e69=['register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','socket.io-emitter','./userNotification.socket'];(function(_0x287914,_0x5d9744){var _0x24aa88=function(_0x414deb){while(--_0x414deb){_0x287914['push'](_0x287914['shift']());}};_0x24aa88(++_0x5d9744);}(_0x8e69,0x136));var _0x98e6=function(_0x433817,_0x598063){_0x433817=_0x433817-0x0;var _0x230346=_0x8e69[_0x433817];return _0x230346;};'use strict';var _=require(_0x98e6('0x0'));var util=require('util');var moment=require(_0x98e6('0x1'));var BPromise=require(_0x98e6('0x2'));var rs=require(_0x98e6('0x3'));var fs=require('fs');var Redis=require(_0x98e6('0x4'));var db=require(_0x98e6('0x5'))['db'];var utils=require(_0x98e6('0x6'));var logger=require(_0x98e6('0x7'))(_0x98e6('0x8'));var config=require('../../config/environment');var jayson=require(_0x98e6('0x9'));var client=jayson[_0x98e6('0xa')][_0x98e6('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x98e6('0xc'))(new Redis(config['redis']));require(_0x98e6('0xd'))[_0x98e6('0xe')](socket);function respondWithRpcPromise(_0x2d4fa0,_0x216c19,_0x11eea5){return new BPromise(function(_0x4d6c64,_0x1dbe9b){return client[_0x98e6('0xf')](_0x2d4fa0,_0x11eea5)[_0x98e6('0x10')](function(_0x545e88){logger[_0x98e6('0x11')](_0x98e6('0x12'),_0x216c19,_0x98e6('0x13'));logger[_0x98e6('0x14')](_0x98e6('0x15'),_0x216c19,_0x98e6('0x13'),JSON[_0x98e6('0x16')](_0x545e88));if(_0x545e88[_0x98e6('0x17')]){if(_0x545e88['error'][_0x98e6('0x18')]===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x216c19,_0x545e88['error'][_0x98e6('0x19')]);return _0x1dbe9b(_0x545e88[_0x98e6('0x17')][_0x98e6('0x19')]);}logger['error'](_0x98e6('0x12'),_0x216c19,_0x545e88[_0x98e6('0x17')][_0x98e6('0x19')]);return _0x4d6c64(_0x545e88[_0x98e6('0x17')][_0x98e6('0x19')]);}else{logger[_0x98e6('0x11')](_0x98e6('0x12'),_0x216c19,_0x98e6('0x13'));_0x4d6c64(_0x545e88['result']['message']);}})[_0x98e6('0x1a')](function(_0x2d1cb7){logger[_0x98e6('0x17')](_0x98e6('0x12'),_0x216c19,_0x2d1cb7);_0x1dbe9b(_0x2d1cb7);});});}
\ No newline at end of file
index 5f0000b..6887494 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d61=['save','remove','update','emit','removeListener','length','userNotification:','./userNotification.events'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3d61,0x117));var _0x13d6=function(_0x1c0300,_0x1733dd){_0x1c0300=_0x1c0300-0x0;var _0x2eb6b0=_0x3d61[_0x1c0300];return _0x2eb6b0;};'use strict';var UserNotificationEvents=require(_0x13d6('0x0'));var events=[_0x13d6('0x1'),_0x13d6('0x2'),_0x13d6('0x3')];function createListener(_0x20ec50,_0x3b81b2){return function(_0x26e0d4){_0x3b81b2[_0x13d6('0x4')](_0x20ec50,_0x26e0d4);};}function removeListener(_0x28cd75,_0x5358c3){return function(){UserNotificationEvents[_0x13d6('0x5')](_0x28cd75,_0x5358c3);};}exports['register']=function(_0xedae50){for(var _0x58fa84=0x0,_0x235522=events[_0x13d6('0x6')];_0x58fa84<_0x235522;_0x58fa84++){var _0x4aa347=events[_0x58fa84];var _0x5efd48=createListener(_0x13d6('0x7')+_0x4aa347,_0xedae50);UserNotificationEvents['on'](_0x4aa347,_0x5efd48);}};
\ No newline at end of file
+var _0x354c=['remove','update','emit','removeListener','register','./userNotification.events','save'];(function(_0x4e0e2e,_0x43efab){var _0x4c916b=function(_0x47d47b){while(--_0x47d47b){_0x4e0e2e['push'](_0x4e0e2e['shift']());}};_0x4c916b(++_0x43efab);}(_0x354c,0x91));var _0xc354=function(_0x5bffd7,_0x264317){_0x5bffd7=_0x5bffd7-0x0;var _0x19762b=_0x354c[_0x5bffd7];return _0x19762b;};'use strict';var UserNotificationEvents=require(_0xc354('0x0'));var events=[_0xc354('0x1'),_0xc354('0x2'),_0xc354('0x3')];function createListener(_0x514356,_0x5f4c75){return function(_0x29f72a){_0x5f4c75[_0xc354('0x4')](_0x514356,_0x29f72a);};}function removeListener(_0x5eee5e,_0x3a568b){return function(){UserNotificationEvents[_0xc354('0x5')](_0x5eee5e,_0x3a568b);};}exports[_0xc354('0x6')]=function(_0x17c1a8){for(var _0xe86a57=0x0,_0x1f4259=events['length'];_0xe86a57<_0x1f4259;_0xe86a57++){var _0x2440d4=events[_0xe86a57];var _0x19db6a=createListener('userNotification:'+_0x2440d4,_0x17c1a8);UserNotificationEvents['on'](_0x2440d4,_0x19db6a);}};
\ No newline at end of file
index 27f36ad..2025c7b 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(_0x395c06,_0x3cbfe4){var _0x4d1707=function(_0x10f8b5){while(--_0x10f8b5){_0x395c06['push'](_0x395c06['shift']());}};_0x4d1707(++_0x3cbfe4);}(_0xedd9,0xfc));var _0x9edd=function(_0x2a03e1,_0x5bf236){_0x2a03e1=_0x2a03e1-0x0;var _0x2b229d=_0xedd9[_0x2a03e1];return _0x2b229d;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x355e21,_0x5363a4){var _0x26c526=function(_0x54e0bb){while(--_0x54e0bb){_0x355e21['push'](_0x355e21['shift']());}};_0x26c526(++_0x5363a4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x30f5bb,_0x4db4bd){_0x30f5bb=_0x30f5bb-0x0;var _0x1cfc00=_0xcb91[_0x30f5bb];return _0x1cfc00;};'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 3150ebc..e54c226 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14f5=['exports'];(function(_0x5be9bb,_0x457882){var _0x4544eb=function(_0x2d79cb){while(--_0x2d79cb){_0x5be9bb['push'](_0x5be9bb['shift']());}};_0x4544eb(++_0x457882);}(_0x14f5,0xae));var _0x514f=function(_0x51991f,_0x3e2f25){_0x51991f=_0x51991f-0x0;var _0x40c6f0=_0x14f5[_0x51991f];return _0x40c6f0;};'use strict';var Sequelize=require('sequelize');module[_0x514f('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x50d8=['INTEGER','sequelize'];(function(_0x19dabf,_0x1a79f3){var _0x10f291=function(_0x2f5c88){while(--_0x2f5c88){_0x19dabf['push'](_0x19dabf['shift']());}};_0x10f291(++_0x1a79f3);}(_0x50d8,0x12b));var _0x850d=function(_0x1c31d9,_0x6920e){_0x1c31d9=_0x1c31d9-0x0;var _0x50c2ec=_0x50d8[_0x1c31d9];return _0x50c2ec;};'use strict';var Sequelize=require(_0x850d('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x850d('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 7121485..fcc475b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5a0=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3f490c,_0x131b62){var _0x5a7ffc=function(_0x2476db){while(--_0x2476db){_0x3f490c['push'](_0x3f490c['shift']());}};_0x5a7ffc(++_0x131b62);}(_0xe5a0,0xf7));var _0x0e5a=function(_0x3ed200,_0x1e19d3){_0x3ed200=_0x3ed200-0x0;var _0x319fff=_0xe5a0[_0x3ed200];return _0x319fff;};'use strict';var _=require(_0x0e5a('0x0'));var util=require(_0x0e5a('0x1'));var logger=require(_0x0e5a('0x2'))(_0x0e5a('0x3'));var moment=require(_0x0e5a('0x4'));var BPromise=require(_0x0e5a('0x5'));var rp=require(_0x0e5a('0x6'));var fs=require('fs');var path=require(_0x0e5a('0x7'));var rimraf=require(_0x0e5a('0x8'));var config=require(_0x0e5a('0x9'));var attributes=require(_0x0e5a('0xa'));module[_0x0e5a('0xb')]=function(_0x573186,_0x1713d2){return _0x573186[_0x0e5a('0xc')](_0x0e5a('0xd'),attributes,{'tableName':_0x0e5a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2053=['define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x338f3b,_0x107fdf){var _0x1fe66a=function(_0x277d33){while(--_0x277d33){_0x338f3b['push'](_0x338f3b['shift']());}};_0x1fe66a(++_0x107fdf);}(_0x2053,0x1ca));var _0x3205=function(_0x37cc82,_0x34cf48){_0x37cc82=_0x37cc82-0x0;var _0x7facc8=_0x2053[_0x37cc82];return _0x7facc8;};'use strict';var _=require(_0x3205('0x0'));var util=require(_0x3205('0x1'));var logger=require(_0x3205('0x2'))('api');var moment=require(_0x3205('0x3'));var BPromise=require(_0x3205('0x4'));var rp=require(_0x3205('0x5'));var fs=require('fs');var path=require(_0x3205('0x6'));var rimraf=require(_0x3205('0x7'));var config=require(_0x3205('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x3205('0x9')]=function(_0x3e95e8,_0x572c79){return _0x3e95e8[_0x3205('0xa')](_0x3205('0xb'),attributes,{'tableName':_0x3205('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 80a9cd1..2a0fbb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x004a=['ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','bluebird'];(function(_0x3ab98b,_0x1b0655){var _0x342ad4=function(_0x544803){while(--_0x544803){_0x3ab98b['push'](_0x3ab98b['shift']());}};_0x342ad4(++_0x1b0655);}(_0x004a,0xf3));var _0xa004=function(_0x51d7b7,_0x10d00a){_0x51d7b7=_0x51d7b7-0x0;var _0x39570a=_0x004a[_0x51d7b7];return _0x39570a;};'use strict';var _=require(_0xa004('0x0'));var util=require(_0xa004('0x1'));var moment=require(_0xa004('0x2'));var BPromise=require(_0xa004('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa004('0x4'));var db=require(_0xa004('0x5'))['db'];var utils=require(_0xa004('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa004('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa004('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7d5bab,_0x303333,_0xcd8cd0){return new BPromise(function(_0x415d78,_0x21b377){return client[_0xa004('0x9')](_0x7d5bab,_0xcd8cd0)[_0xa004('0xa')](function(_0x41ecf2){logger['info'](_0xa004('0xb'),_0x303333,_0xa004('0xc'));logger['debug'](_0xa004('0xd'),_0x303333,_0xa004('0xc'),JSON['stringify'](_0x41ecf2));if(_0x41ecf2[_0xa004('0xe')]){if(_0x41ecf2[_0xa004('0xe')][_0xa004('0xf')]===0x1f4){logger[_0xa004('0xe')](_0xa004('0xb'),_0x303333,_0x41ecf2[_0xa004('0xe')][_0xa004('0x10')]);return _0x21b377(_0x41ecf2[_0xa004('0xe')][_0xa004('0x10')]);}logger[_0xa004('0xe')](_0xa004('0xb'),_0x303333,_0x41ecf2['error'][_0xa004('0x10')]);return _0x415d78(_0x41ecf2[_0xa004('0xe')][_0xa004('0x10')]);}else{logger[_0xa004('0x11')](_0xa004('0xb'),_0x303333,_0xa004('0xc'));_0x415d78(_0x41ecf2[_0xa004('0x12')][_0xa004('0x10')]);}})['catch'](function(_0x53e6b2){logger[_0xa004('0xe')](_0xa004('0xb'),_0x303333,_0x53e6b2);_0x21b377(_0x53e6b2);});});}
\ No newline at end of file
+var _0xeb07=['info','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x217c2e,_0x358f06){var _0x22b7d8=function(_0x111c48){while(--_0x111c48){_0x217c2e['push'](_0x217c2e['shift']());}};_0x22b7d8(++_0x358f06);}(_0xeb07,0x167));var _0x7eb0=function(_0x183046,_0x3d25fa){_0x183046=_0x183046-0x0;var _0x17eb99=_0xeb07[_0x183046];return _0x17eb99;};'use strict';var _=require(_0x7eb0('0x0'));var util=require(_0x7eb0('0x1'));var moment=require('moment');var BPromise=require(_0x7eb0('0x2'));var rs=require(_0x7eb0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7eb0('0x4'))['db'];var utils=require(_0x7eb0('0x5'));var logger=require(_0x7eb0('0x6'))('rpc');var config=require(_0x7eb0('0x7'));var jayson=require(_0x7eb0('0x8'));var client=jayson[_0x7eb0('0x9')][_0x7eb0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ac8de,_0x1c9b11,_0x4de2f2){return new BPromise(function(_0x1912b6,_0x36646c){return client[_0x7eb0('0xb')](_0x4ac8de,_0x4de2f2)['then'](function(_0xc0f590){logger['info'](_0x7eb0('0xc'),_0x1c9b11,_0x7eb0('0xd'));logger[_0x7eb0('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1c9b11,_0x7eb0('0xd'),JSON[_0x7eb0('0xf')](_0xc0f590));if(_0xc0f590[_0x7eb0('0x10')]){if(_0xc0f590[_0x7eb0('0x10')][_0x7eb0('0x11')]===0x1f4){logger[_0x7eb0('0x10')](_0x7eb0('0xc'),_0x1c9b11,_0xc0f590[_0x7eb0('0x10')]['message']);return _0x36646c(_0xc0f590[_0x7eb0('0x10')][_0x7eb0('0x12')]);}logger[_0x7eb0('0x10')](_0x7eb0('0xc'),_0x1c9b11,_0xc0f590[_0x7eb0('0x10')][_0x7eb0('0x12')]);return _0x1912b6(_0xc0f590[_0x7eb0('0x10')][_0x7eb0('0x12')]);}else{logger[_0x7eb0('0x13')](_0x7eb0('0xc'),_0x1c9b11,_0x7eb0('0xd'));_0x1912b6(_0xc0f590['result'][_0x7eb0('0x12')]);}})[_0x7eb0('0x14')](function(_0x421524){logger[_0x7eb0('0x10')](_0x7eb0('0xc'),_0x1c9b11,_0x421524);_0x36646c(_0x421524);});});}
\ No newline at end of file
index c48ad40..944fa40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d5b=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','clone','addResources','put','update','destroy','delete','removeSections','removeResources','exports','util','path'];(function(_0x42da9a,_0x3db0db){var _0x12239c=function(_0x411f6b){while(--_0x411f6b){_0x42da9a['push'](_0x42da9a['shift']());}};_0x12239c(++_0x3db0db);}(_0x2d5b,0x1ce));var _0xb2d5=function(_0x3f0aea,_0x40ea8c){_0x3f0aea=_0x3f0aea-0x0;var _0x382714=_0x2d5b[_0x3f0aea];return _0x382714;};'use strict';var multer=require('multer');var util=require(_0xb2d5('0x0'));var path=require(_0xb2d5('0x1'));var timeout=require(_0xb2d5('0x2'));var express=require('express');var router=express[_0xb2d5('0x3')]();var fs_extra=require(_0xb2d5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb2d5('0x5'));var config=require(_0xb2d5('0x6'));var controller=require(_0xb2d5('0x7'));router[_0xb2d5('0x8')]('/',auth[_0xb2d5('0x9')](),controller[_0xb2d5('0xa')]);router[_0xb2d5('0x8')](_0xb2d5('0xb'),auth['isAuthenticated'](),controller[_0xb2d5('0xc')]);router[_0xb2d5('0x8')](_0xb2d5('0xd'),auth[_0xb2d5('0x9')](),controller[_0xb2d5('0xe')]);router[_0xb2d5('0x8')](_0xb2d5('0xf'),auth[_0xb2d5('0x9')](),controller[_0xb2d5('0x10')]);router[_0xb2d5('0x8')](_0xb2d5('0x11'),auth[_0xb2d5('0x9')](),controller[_0xb2d5('0x12')]);router['post']('/',auth[_0xb2d5('0x9')](),controller['create']);router[_0xb2d5('0x13')]('/:id/clone',auth[_0xb2d5('0x9')](),controller[_0xb2d5('0x14')]);router[_0xb2d5('0x13')]('/:id/sections',auth[_0xb2d5('0x9')](),controller['addSections']);router['post'](_0xb2d5('0x11'),auth[_0xb2d5('0x9')](),controller[_0xb2d5('0x15')]);router[_0xb2d5('0x16')](_0xb2d5('0xd'),auth[_0xb2d5('0x9')](),controller[_0xb2d5('0x17')]);router['delete'](_0xb2d5('0xd'),auth[_0xb2d5('0x9')](),controller[_0xb2d5('0x18')]);router[_0xb2d5('0x19')]('/:id/sections',auth['isAuthenticated'](),controller[_0xb2d5('0x1a')]);router['delete'](_0xb2d5('0x11'),auth[_0xb2d5('0x9')](),controller[_0xb2d5('0x1b')]);module[_0xb2d5('0x1c')]=router;
\ No newline at end of file
+var _0x31e7=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/sections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','delete','destroy','removeResources'];(function(_0x38f94f,_0x2dc203){var _0x160fce=function(_0x245e92){while(--_0x245e92){_0x38f94f['push'](_0x38f94f['shift']());}};_0x160fce(++_0x2dc203);}(_0x31e7,0xc8));var _0x731e=function(_0x48881b,_0x2e62bb){_0x48881b=_0x48881b-0x0;var _0x1c2b1d=_0x31e7[_0x48881b];return _0x1c2b1d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x731e('0x0'));var timeout=require('connect-timeout');var express=require(_0x731e('0x1'));var router=express[_0x731e('0x2')]();var fs_extra=require(_0x731e('0x3'));var auth=require(_0x731e('0x4'));var interaction=require(_0x731e('0x5'));var config=require(_0x731e('0x6'));var controller=require('./userProfile.controller');router[_0x731e('0x7')]('/',auth[_0x731e('0x8')](),controller[_0x731e('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x731e('0xa')]);router[_0x731e('0x7')](_0x731e('0xb'),auth[_0x731e('0x8')](),controller[_0x731e('0xc')]);router[_0x731e('0x7')](_0x731e('0xd'),auth[_0x731e('0x8')](),controller['getSections']);router[_0x731e('0x7')](_0x731e('0xe'),auth[_0x731e('0x8')](),controller[_0x731e('0xf')]);router[_0x731e('0x10')]('/',auth[_0x731e('0x8')](),controller[_0x731e('0x11')]);router[_0x731e('0x10')](_0x731e('0x12'),auth[_0x731e('0x8')](),controller[_0x731e('0x13')]);router[_0x731e('0x10')]('/:id/sections',auth[_0x731e('0x8')](),controller[_0x731e('0x14')]);router[_0x731e('0x10')](_0x731e('0xe'),auth['isAuthenticated'](),controller[_0x731e('0x15')]);router['put'](_0x731e('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x731e('0x16')](_0x731e('0xb'),auth['isAuthenticated'](),controller[_0x731e('0x17')]);router[_0x731e('0x16')](_0x731e('0xd'),auth[_0x731e('0x8')](),controller['removeSections']);router['delete'](_0x731e('0xe'),auth[_0x731e('0x8')](),controller[_0x731e('0x18')]);module['exports']=router;
\ No newline at end of file
index c815ee4..8e00fe7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f05=['setDataValue','crudPermissions','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4f05,0xd4));var _0x54f0=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4f05[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x54f0('0x0'));module[_0x54f0('0x1')]={'name':{'type':Sequelize[_0x54f0('0x2')],'allowNull':![],'unique':_0x54f0('0x3')},'crudPermissions':{'type':Sequelize[_0x54f0('0x2')],'set':function(_0x3a9eaf){this[_0x54f0('0x4')](_0x54f0('0x5'),_0x3a9eaf?_0x3a9eaf['join'](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x54f0('0x6')](_0x54f0('0x5'))[_0x54f0('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x54f0('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x54f0('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x54f0('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x54f0('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x54f0('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x54f0('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x54f0('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xa1a6=['BOOLEAN','STRING','setDataValue','join','crudPermissions','getDataValue','split'];(function(_0x5ebd8d,_0x498ea2){var _0x43eaf8=function(_0x403862){while(--_0x403862){_0x5ebd8d['push'](_0x5ebd8d['shift']());}};_0x43eaf8(++_0x498ea2);}(_0xa1a6,0xd3));var _0x6a1a=function(_0x322522,_0x4db288){_0x322522=_0x322522-0x0;var _0x293bcf=_0xa1a6[_0x322522];return _0x293bcf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6a1a('0x0')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x6a1a('0x0')],'set':function(_0x2e7533){this[_0x6a1a('0x1')]('crudPermissions',_0x2e7533?_0x2e7533[_0x6a1a('0x2')](''):[]);},'get':function(){return this['getDataValue'](_0x6a1a('0x3'))?this[_0x6a1a('0x4')](_0x6a1a('0x3'))[_0x6a1a('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x6a1a('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x6a1a('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x6a1a('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x6a1a('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x6a1a('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6a1a('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6a1a('0x6')],'defaultValue':!![]}};
\ No newline at end of file
index fcc60c3..8839f82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x056b=['UserProfile','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','clone','get','omit','createdAt','crudPermissions','body','updatedAt','sequelize','transaction','UserProfileSection','each','autoAssociation','sectionId','userProfileId','UserProfileResource','Resources','describe','addSections','ids','getSections','enabled','includes','subsections','push','findOne','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./userProfile.socket','register','sendStatus','end','json','offset','limit','undefined','count','set','apply','reject','update','destroy','then','status','error','stack','name','index','map'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x056b,0xb6));var _0xb056=function(_0x2fc1ce,_0x250865){_0x2fc1ce=_0x2fc1ce-0x0;var _0x2cf1ab=_0x056b[_0x2fc1ce];return _0x2cf1ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb056('0x0'));var zipdir=require(_0xb056('0x1'));var jsonpatch=require(_0xb056('0x2'));var rp=require(_0xb056('0x3'));var moment=require(_0xb056('0x4'));var BPromise=require(_0xb056('0x5'));var Mustache=require(_0xb056('0x6'));var util=require(_0xb056('0x7'));var path=require(_0xb056('0x8'));var sox=require(_0xb056('0x9'));var csv=require(_0xb056('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb056('0xb'));var _=require(_0xb056('0xc'));var squel=require(_0xb056('0xd'));var crypto=require(_0xb056('0xe'));var jsforce=require(_0xb056('0xf'));var deskjs=require(_0xb056('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb056('0x11'));var Redis=require(_0xb056('0x12'));var authService=require(_0xb056('0x13'));var qs=require(_0xb056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb056('0x15'));var logger=require('../../config/logger')(_0xb056('0x16'));var utils=require(_0xb056('0x17'));var config=require(_0xb056('0x18'));var licenseUtil=require(_0xb056('0x19'));var db=require(_0xb056('0x1a'))['db'];config['redis']=_['defaults'](config[_0xb056('0x1b')],{'host':_0xb056('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb056('0x1b')]));require(_0xb056('0x1d'))[_0xb056('0x1e')](socket);function respondWithStatusCode(_0x1197e5,_0x10dd19){_0x10dd19=_0x10dd19||0xcc;return function(_0x3776a1){if(_0x3776a1){return _0x1197e5[_0xb056('0x1f')](_0x10dd19);}return _0x1197e5['status'](_0x10dd19)[_0xb056('0x20')]();};}function respondWithResult(_0x43565e,_0x9e2eed){_0x9e2eed=_0x9e2eed||0xc8;return function(_0x65d7ca){if(_0x65d7ca){return _0x43565e['status'](_0x9e2eed)[_0xb056('0x21')](_0x65d7ca);}};}function respondWithFilteredResult(_0x4e501a,_0x2daffc){return function(_0x311eb9){if(_0x311eb9){var _0x48e140=typeof _0x2daffc[_0xb056('0x22')]==='undefined'&&typeof _0x2daffc[_0xb056('0x23')]===_0xb056('0x24');var _0x5e4bd9=_0x311eb9[_0xb056('0x25')];var _0x48cdaf=_0x48e140?0x0:_0x2daffc[_0xb056('0x22')];var _0x225081=_0x48e140?_0x311eb9[_0xb056('0x25')]:_0x2daffc[_0xb056('0x22')]+_0x2daffc['limit'];var _0x1db585;if(_0x225081>=_0x5e4bd9){_0x225081=_0x5e4bd9;_0x1db585=0xc8;}else{_0x1db585=0xce;}_0x4e501a['status'](_0x1db585);return _0x4e501a[_0xb056('0x26')]('Content-Range',_0x48cdaf+'-'+_0x225081+'/'+_0x5e4bd9)[_0xb056('0x21')](_0x311eb9);}return null;};}function patchUpdates(_0x40ac2d){return function(_0x1de11b){try{jsonpatch[_0xb056('0x27')](_0x1de11b,_0x40ac2d,!![]);}catch(_0x36e539){return BPromise[_0xb056('0x28')](_0x36e539);}return _0x1de11b['save']();};}function saveUpdates(_0x1016da,_0x18a3f2){return function(_0x341544){if(_0x341544){return _0x341544[_0xb056('0x29')](_0x1016da)['then'](function(_0x44a14f){return _0x44a14f;});}return null;};}function removeEntity(_0x10b9b3,_0x5c39db){return function(_0x6d0483){if(_0x6d0483){return _0x6d0483[_0xb056('0x2a')]()[_0xb056('0x2b')](function(){_0x10b9b3[_0xb056('0x2c')](0xcc)[_0xb056('0x20')]();});}};}function handleEntityNotFound(_0x4024d7,_0x211898){return function(_0x2042f1){if(!_0x2042f1){_0x4024d7['sendStatus'](0x194);}return _0x2042f1;};}function handleError(_0x29fbc1,_0x51b06b){_0x51b06b=_0x51b06b||0x1f4;return function(_0x3d83d3){logger[_0xb056('0x2d')](_0x3d83d3[_0xb056('0x2e')]);if(_0x3d83d3['name']){delete _0x3d83d3[_0xb056('0x2f')];}_0x29fbc1[_0xb056('0x2c')](_0x51b06b)['send'](_0x3d83d3);};}exports[_0xb056('0x30')]=function(_0x43aa63,_0x329eaa){var _0x1fad05={},_0x3ce984={},_0x4ebca5={'count':0x0,'rows':[]};var _0x87f31e=_[_0xb056('0x31')](db[_0xb056('0x32')][_0xb056('0x33')],function(_0x103482){return{'name':_0x103482['fieldName'],'type':_0x103482[_0xb056('0x34')][_0xb056('0x35')]};});_0x3ce984[_0xb056('0x36')]=_[_0xb056('0x31')](_0x87f31e,_0xb056('0x2f'));_0x3ce984[_0xb056('0x37')]=_[_0xb056('0x38')](_0x43aa63[_0xb056('0x37')]);_0x3ce984['filters']=_[_0xb056('0x39')](_0x3ce984['model'],_0x3ce984[_0xb056('0x37')]);_0x1fad05['attributes']=_['intersection'](_0x3ce984[_0xb056('0x36')],qs[_0xb056('0x3a')](_0x43aa63[_0xb056('0x37')][_0xb056('0x3a')]));_0x1fad05[_0xb056('0x3b')]=_0x1fad05[_0xb056('0x3b')][_0xb056('0x3c')]?_0x1fad05['attributes']:_0x3ce984[_0xb056('0x36')];if(!_0x43aa63[_0xb056('0x37')]['hasOwnProperty']('nolimit')){_0x1fad05[_0xb056('0x23')]=qs[_0xb056('0x23')](_0x43aa63[_0xb056('0x37')]['limit']);_0x1fad05[_0xb056('0x22')]=qs[_0xb056('0x22')](_0x43aa63[_0xb056('0x37')][_0xb056('0x22')]);}_0x1fad05[_0xb056('0x3d')]=qs[_0xb056('0x3e')](_0x43aa63[_0xb056('0x37')][_0xb056('0x3e')]);_0x1fad05[_0xb056('0x3f')]=qs[_0xb056('0x40')](_[_0xb056('0x41')](_0x43aa63[_0xb056('0x37')],_0x3ce984['filters']),_0x87f31e);if(_0x43aa63[_0xb056('0x37')]['filter']){_0x1fad05[_0xb056('0x3f')]=_[_0xb056('0x42')](_0x1fad05[_0xb056('0x3f')],{'$or':_[_0xb056('0x31')](_0x87f31e,function(_0x460f28){if(_0x460f28[_0xb056('0x34')]!==_0xb056('0x43')){var _0x42b54f={};_0x42b54f[_0x460f28['name']]={'$like':'%'+_0x43aa63[_0xb056('0x37')][_0xb056('0x44')]+'%'};return _0x42b54f;}})});}_0x1fad05=_[_0xb056('0x42')]({},_0x1fad05,_0x43aa63[_0xb056('0x45')]);var _0x134db7={'where':_0x1fad05['where']};return db[_0xb056('0x32')][_0xb056('0x25')](_0x134db7)[_0xb056('0x2b')](function(_0x216f72){_0x4ebca5[_0xb056('0x25')]=_0x216f72;if(_0x43aa63[_0xb056('0x37')]['includeAll']){_0x1fad05[_0xb056('0x46')]=[{'all':!![]}];}return db['UserProfile'][_0xb056('0x47')](_0x1fad05);})[_0xb056('0x2b')](function(_0x21d98e){_0x4ebca5[_0xb056('0x48')]=_0x21d98e;return _0x4ebca5;})[_0xb056('0x2b')](respondWithFilteredResult(_0x329eaa,_0x1fad05))[_0xb056('0x49')](handleError(_0x329eaa,null));};exports[_0xb056('0x4a')]=function(_0x248819,_0x2c8b61){var _0x149341={'raw':![],'where':{'id':_0x248819[_0xb056('0x4b')]['id']}},_0x4fa3c5={};_0x4fa3c5[_0xb056('0x36')]=_[_0xb056('0x38')](db['UserProfile'][_0xb056('0x33')]);_0x4fa3c5[_0xb056('0x37')]=_['keys'](_0x248819['query']);_0x4fa3c5[_0xb056('0x40')]=_[_0xb056('0x39')](_0x4fa3c5[_0xb056('0x36')],_0x4fa3c5[_0xb056('0x37')]);_0x149341['attributes']=_['intersection'](_0x4fa3c5['model'],qs['fields'](_0x248819['query']['fields']));_0x149341[_0xb056('0x3b')]=_0x149341['attributes'][_0xb056('0x3c')]?_0x149341[_0xb056('0x3b')]:_0x4fa3c5[_0xb056('0x36')];if(_0x248819[_0xb056('0x37')][_0xb056('0x4c')]){_0x149341[_0xb056('0x46')]=[{'all':!![]}];}_0x149341=_[_0xb056('0x42')]({},_0x149341,_0x248819[_0xb056('0x45')]);return db['UserProfile'][_0xb056('0x4d')](_0x149341)[_0xb056('0x2b')](handleEntityNotFound(_0x2c8b61,null))['then'](respondWithResult(_0x2c8b61,null))[_0xb056('0x49')](handleError(_0x2c8b61,null));};exports[_0xb056('0x4e')]=function(_0xe40439,_0x2f2d22){return db[_0xb056('0x32')][_0xb056('0x4e')](_0xe40439['body'],{})[_0xb056('0x2b')](respondWithResult(_0x2f2d22,0xc9))['catch'](handleError(_0x2f2d22,null));};exports[_0xb056('0x4f')]=function(_0x3e4a14,_0xde5564){var _0x66f676={'where':{'id':_0x3e4a14[_0xb056('0x4b')]['id']}},_0xb4e6cc={};_0xb4e6cc[_0xb056('0x36')]=_[_0xb056('0x38')](db['UserProfile'][_0xb056('0x33')]);_0x66f676[_0xb056('0x3b')]=_[_0xb056('0x39')](_0xb4e6cc[_0xb056('0x36')],qs[_0xb056('0x3a')](_0x3e4a14[_0xb056('0x37')][_0xb056('0x3a')]));_0x66f676[_0xb056('0x3b')]=_0x66f676['attributes'][_0xb056('0x3c')]?_0x66f676[_0xb056('0x3b')]:_0xb4e6cc[_0xb056('0x36')];if(_0x3e4a14[_0xb056('0x37')][_0xb056('0x4c')]){_0x66f676[_0xb056('0x46')]=[{'all':!![]}];}_0x66f676=_['merge']({},_0x66f676,_0x3e4a14[_0xb056('0x45')]);return db[_0xb056('0x32')][_0xb056('0x4d')](_0x66f676)['then'](handleEntityNotFound(_0xde5564,null))[_0xb056('0x2b')](function(_0x5119c0){if(_0x5119c0){var _0x3ad85e=_0x5119c0[_0xb056('0x50')]({'plain':!![]});_0x3ad85e=qs[_0xb056('0x51')](_0x3ad85e,['id',_0xb056('0x52'),'updatedAt',_0xb056('0x53')]);_0x3e4a14[_0xb056('0x54')]=_['omit'](_0x3e4a14[_0xb056('0x54')],['id',_0xb056('0x52'),_0xb056('0x55')]);return db[_0xb056('0x56')][_0xb056('0x57')](function(_0x51bd1b){return db[_0xb056('0x32')][_0xb056('0x4e')](_[_0xb056('0x42')](_0x3ad85e,_0x3e4a14[_0xb056('0x54')]),{'include':_0x3e4a14[_0xb056('0x37')][_0xb056('0x4c')]?[{'all':!![]}]:undefined,'transaction':_0x51bd1b})[_0xb056('0x2b')](function(_0x3e7d1b){var _0x3ccc5e=_0x3e7d1b[_0xb056('0x50')]({'plain':!![]});return db[_0xb056('0x58')][_0xb056('0x47')]({'where':{'userProfileId':_0x3e4a14[_0xb056('0x4b')]['id']},'raw':!![]})[_0xb056('0x2b')](function(_0xf7924b){if(_0xf7924b){return BPromise[_0xb056('0x59')](_0xf7924b,function(_0x28fc90){return new BPromise(function(_0x435fe9,_0x39765e){if(_0x28fc90[_0xb056('0x5a')]===null||_0x28fc90[_0xb056('0x5a')]===0x1)_0x435fe9(null);return db['UserProfileResource'][_0xb056('0x47')]({'where':{'sectionId':_0x28fc90['id']},'raw':!![]})[_0xb056('0x2b')](function(_0x41ae10){var _0x1ffa10=_[_0xb056('0x31')](_0x41ae10,function(_0x2ee6ca){return qs[_0xb056('0x51')](_0x2ee6ca,['id','createdAt','updatedAt',_0xb056('0x5b')]);});_0x435fe9(_0x1ffa10);})[_0xb056('0x49')](function(_0x1205cc){_0x39765e(_0x1205cc);});})[_0xb056('0x2b')](function(_0x2e7a8f){var _0x524703=qs[_0xb056('0x51')](_0x28fc90,['id',_0xb056('0x52'),_0xb056('0x55')]);_0x524703[_0xb056('0x5c')]=_0x3ccc5e['id'];if(_0x2e7a8f)_0x524703['Resources']=_0x2e7a8f;return _0x524703;})[_0xb056('0x2b')](function(_0x24b037){return db[_0xb056('0x58')]['create'](_0x24b037,{'include':[{'model':db[_0xb056('0x5d')],'as':_0xb056('0x5e')}],'raw':!![],'transaction':_0x51bd1b});});})[_0xb056('0x2b')](function(){return _0x3ccc5e;});}});});});}})['then'](respondWithResult(_0xde5564,0xc9))[_0xb056('0x49')](handleError(_0xde5564,null));};exports[_0xb056('0x29')]=function(_0x31c4ae,_0x5bf8ce){if(_0x31c4ae[_0xb056('0x54')]['id']){delete _0x31c4ae['body']['id'];}return db[_0xb056('0x32')][_0xb056('0x4d')]({'where':{'id':_0x31c4ae[_0xb056('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5bf8ce,null))[_0xb056('0x2b')](saveUpdates(_0x31c4ae[_0xb056('0x54')],null))['then'](respondWithResult(_0x5bf8ce,null))[_0xb056('0x49')](handleError(_0x5bf8ce,null));};exports[_0xb056('0x2a')]=function(_0x53f15f,_0x31a0d1){return db[_0xb056('0x32')]['find']({'where':{'id':_0x53f15f['params']['id']}})[_0xb056('0x2b')](handleEntityNotFound(_0x31a0d1,null))['then'](removeEntity(_0x31a0d1,null))[_0xb056('0x49')](handleError(_0x31a0d1,null));};exports['describe']=function(_0x39f40e,_0x2b33ba){return db[_0xb056('0x32')][_0xb056('0x5f')]()['then'](respondWithResult(_0x2b33ba,null))['catch'](handleError(_0x2b33ba,null));};exports[_0xb056('0x60')]=function(_0x1e14e1,_0x3b3bbf){var _0x21e16a=_0x1e14e1['body'];return db[_0xb056('0x32')]['find']({'where':{'id':_0x1e14e1[_0xb056('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3b3bbf,null))[_0xb056('0x2b')](function(_0x56bab7){if(_0x56bab7){return db[_0xb056('0x56')][_0xb056('0x57')](function(_0x2bff6b){return db[_0xb056('0x58')]['destroy']({'where':{'userProfileId':_0x1e14e1[_0xb056('0x4b')]['id'],'sectionId':_['map'](_0x21e16a,function(_0x227ab0){return _0x227ab0[_0xb056('0x5b')];})},'transaction':_0x2bff6b})[_0xb056('0x2b')](function(){var _0x2fc5b0=_[_0xb056('0x31')](_0x21e16a,function(_0x267d81){_0x267d81[_0xb056('0x5c')]=_0x1e14e1[_0xb056('0x4b')]['id'];return _0x267d81;});var _0x215b7c=[];return BPromise[_0xb056('0x59')](_0x2fc5b0,function(_0x44fae4){return db[_0xb056('0x58')]['create'](_0x44fae4,{'include':[{'model':db['UserProfileResource'],'as':_0xb056('0x5e')}],'raw':!![],'transaction':_0x2bff6b})['then'](function(_0x12ac85){_0x215b7c['push'](_0x12ac85[_0xb056('0x50')]({'plain':!![]}));});})['then'](function(){return _0x215b7c;});});});}})['then'](function(_0x583973){return _0x583973;})[_0xb056('0x2b')](respondWithResult(_0x3b3bbf,null))['catch'](handleError(_0x3b3bbf,null));};exports['removeSections']=function(_0x3c9d5a,_0xb6fd9b){var _0x343326;return db['UserProfile']['find']({'where':{'id':_0x3c9d5a['params']['id']},'attributes':['id',_0xb056('0x2f')]})[_0xb056('0x2b')](handleEntityNotFound(_0xb6fd9b,null))[_0xb056('0x2b')](function(_0x13bd5f){if(_0x13bd5f){_0x343326=_0x13bd5f;return db[_0xb056('0x58')][_0xb056('0x2a')]({'where':{'userProfileId':_0x3c9d5a[_0xb056('0x4b')]['id'],'sectionId':_0x3c9d5a[_0xb056('0x37')][_0xb056('0x61')]}});}})[_0xb056('0x2b')](function(){return _0x343326;})[_0xb056('0x2b')](respondWithStatusCode(_0xb6fd9b,null))[_0xb056('0x49')](handleError(_0xb6fd9b,null));};exports[_0xb056('0x62')]=function(_0x19243d,_0x4dbd50){var _0x5def29=[];var _0x18feb4=[];return db['UserProfileSection'][_0xb056('0x47')]({'where':{'userProfileId':_0x19243d[_0xb056('0x4b')]['id']},'raw':!![]})[_0xb056('0x2b')](function(_0xc2833b){_0x5def29=_['filter'](_0xc2833b,function(_0x5d84ff){return _0x5d84ff[_0xb056('0x63')]===0x1||_[_0xb056('0x64')]([0x3eb,0x709],_0x5d84ff[_0xb056('0x5b')]);});if(!_['isEmpty'](_0x5def29)){return _['map'](_0x5def29,function(_0x3a14f3){return _0x3a14f3[_0xb056('0x5b')];});}else{return;}})['then'](function(_0x345cf9){if(_0x345cf9)_0x18feb4=_0x345cf9;if(_[_0xb056('0x64')](_0x18feb4,0x64)){var _0x41b62e=_[_0xb056('0x4d')](_0x5def29,{'sectionId':0x64});return hasDefaultDashboard(_0x41b62e)[_0xb056('0x2b')](function(_0x315b19){return _[_0xb056('0x31')](_0x5def29,function(_0x27b31f){if(_0x27b31f[_0xb056('0x5b')]===0x64){_0x27b31f[_0xb056('0x65')]=_0x315b19;}return _0x27b31f;});});}else{return;}})[_0xb056('0x2b')](function(_0x5a7a61){if(_0x5a7a61)_0x5def29=_0x5a7a61;if(_[_0xb056('0x64')](_0x18feb4,0x3eb)){var _0x2d0d1e=_[_0xb056('0x4d')](_0x5def29,{'sectionId':0x3eb});return getCustomDashboards(_0x2d0d1e)['then'](function(_0x245744){return _['map'](_0x5def29,function(_0x489233){if(_0x2d0d1e[_0xb056('0x63')]){if(_0x489233[_0xb056('0x5b')]===0x3eb){_0x489233[_0xb056('0x65')]=_0x245744;}}else{if(_0x489233['sectionId']===0x64){_0x489233['subsections']=_0x245744;}}return _0x489233;});});}else{return;}})[_0xb056('0x2b')](function(_0x2ae344){if(_0x2ae344)_0x5def29=_0x2ae344;if(_['includes'](_0x18feb4,0x709)){var _0xc9623e=_['find'](_0x5def29,{'sectionId':0x709});return getPlugins(_0xc9623e)[_0xb056('0x2b')](function(_0x3c25ac){if(_0xc9623e['enabled']){return _['map'](_0x5def29,function(_0xe12984){if(_0xe12984[_0xb056('0x5b')]===0x709){_0xe12984['subsections']=_0x3c25ac;}return _0xe12984;});}else{var _0x1cc5b1={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3c25ac};var _0x4fb4ec=_['map'](_0x5def29);_0x4fb4ec[_0xb056('0x66')](_0x1cc5b1);return _0x4fb4ec;}});}else{return;}})[_0xb056('0x2b')](function(_0x2235b6){if(_0x2235b6)_0x5def29=_0x2235b6;return _[_0xb056('0x44')](_0x5def29,[_0xb056('0x63'),0x1]);})[_0xb056('0x2b')](respondWithResult(_0x4dbd50,null))['catch'](handleError(_0x4dbd50,null));};function hasDefaultDashboard(_0x444342){var _0x5b7b5a=[0x65];return new BPromise(function(_0x6dae,_0x3efaf6){try{if(_0x444342['autoAssociation']){_0x6dae(_0x5b7b5a);}else{return db[_0xb056('0x5d')][_0xb056('0x67')]({'where':{'sectionId':_0x444342['id']},'raw':!![]})['then'](function(_0x6751b0){_0x6751b0?_0x6dae(_0x5b7b5a):_0x6dae();});}}catch(_0x5bbe03){_0x3efaf6(_0x5bbe03);}});}function getCustomDashboards(_0x449637){var _0x4fdcbd=[];return new BPromise(function(_0x289ac0,_0x32c546){try{if(_0x449637['autoAssociation']){return db[_0xb056('0x68')]['findAll']({'raw':!![]})[_0xb056('0x2b')](function(_0x1c81ce){_0x1c81ce[_0xb056('0x69')](function(_0xf53df4){_0x4fdcbd[_0xb056('0x66')](_0xf53df4['id']+0x1869f);});_0x289ac0(_0x4fdcbd);});}else{return db[_0xb056('0x5d')][_0xb056('0x47')]({'where':{'sectionId':_0x449637['id']},'raw':!![]})[_0xb056('0x2b')](function(_0x5b71e4){_0x5b71e4[_0xb056('0x69')](function(_0x5b86df){_0x4fdcbd['push'](_0x5b86df['resourceId']+0x1869f);});_0x289ac0(_0x4fdcbd);});}}catch(_0x2ea984){_0x32c546(_0x2ea984);}});}function getPlugins(_0x15c3c1){var _0x3d49b1=[];return new BPromise(function(_0x2811c4,_0x505d68){try{if(_0x15c3c1[_0xb056('0x5a')]){return db[_0xb056('0x6a')][_0xb056('0x47')]({'raw':!![]})[_0xb056('0x2b')](function(_0x24c08e){_0x24c08e['forEach'](function(_0x9257a8){_0x3d49b1[_0xb056('0x66')](_0x9257a8['id']+0x15b38);});_0x2811c4(_0x3d49b1);});}else{return db[_0xb056('0x5d')]['findAll']({'where':{'sectionId':_0x15c3c1['id']},'raw':!![]})['then'](function(_0x5e3f78){_0x5e3f78['forEach'](function(_0x5e272e){_0x3d49b1['push'](_0x5e272e[_0xb056('0x6b')]+0x15b38);});_0x2811c4(_0x3d49b1);});}}catch(_0x1f5c6d){_0x505d68(_0x1f5c6d);}});}exports[_0xb056('0x6c')]=function(_0x2b62f1,_0x38b119){return db[_0xb056('0x32')]['find']({'where':{'id':_0x2b62f1[_0xb056('0x4b')]['id']}})[_0xb056('0x2b')](handleEntityNotFound(_0x38b119,null))[_0xb056('0x2b')](function(_0x3e4ba5){if(_0x3e4ba5){return db[_0xb056('0x56')][_0xb056('0x57')](function(_0x229e2f){return db[_0xb056('0x58')][_0xb056('0x47')]({'where':{'userProfileId':_0x2b62f1[_0xb056('0x4b')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x57c9d3){if(_0x57c9d3){return db['UserProfileSection'][_0xb056('0x2a')]({'where':{'userProfileId':_0x2b62f1['params']['id'],'id':_[_0xb056('0x31')](_0x57c9d3,function(_0x1851b8){return _0x1851b8['id'];})},'transaction':_0x229e2f});}})[_0xb056('0x2b')](function(_0x189f33){var _0xf9b56f=_[_0xb056('0x31')](_0x2b62f1[_0xb056('0x54')],function(_0x29d735){_0x29d735[_0xb056('0x5c')]=_0x2b62f1['params']['id'];return _0x29d735;});return db[_0xb056('0x58')][_0xb056('0x6d')](_0xf9b56f,{'raw':!![],'transaction':_0x229e2f});})[_0xb056('0x2b')](function(_0x68b905){var _0x4897b0=_['filter'](_[_0xb056('0x31')](_0x68b905,function(_0x1c8e7b){return _0x1c8e7b[_0xb056('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x4897b0){return db[_0xb056('0x58')][_0xb056('0x47')]({'where':{'userProfileId':_0x2b62f1[_0xb056('0x4b')]['id'],'sectionId':_[_0xb056('0x31')](_0x4897b0,function(_0x51e412){return _0x51e412[_0xb056('0x5b')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xb056('0x2b')](function(_0x3f470e){var _0x5ba4b4=_[_0xb056('0x31')](_0x2b62f1['body'],function(_0x155e14){_0x155e14[_0xb056('0x5c')]=_0x2b62f1[_0xb056('0x4b')]['id'];return _0x155e14;});return db[_0xb056('0x5d')][_0xb056('0x6d')](_0x5ba4b4,{'raw':!![],'transaction':_0x229e2f});});}})['catch'](handleError(_0x38b119,null));});}})[_0xb056('0x2b')](function(_0x42c752){var _0xa95d7b=_[_0xb056('0x31')](_0x42c752,function(_0x45922c){return _0x45922c[_0xb056('0x50')]({'plain':!![]});});})[_0xb056('0x2b')](respondWithResult(_0x38b119,null))[_0xb056('0x49')](handleError(_0x38b119,null));};exports[_0xb056('0x6e')]=function(_0x1a9c89,_0x62da08,_0x1636e0){return db[_0xb056('0x32')][_0xb056('0x4d')]({'where':{'id':_0x1a9c89[_0xb056('0x4b')]['id']}})[_0xb056('0x2b')](handleEntityNotFound(_0x62da08,null))[_0xb056('0x2b')](function(_0x5431a1){if(_0x5431a1){return _0x5431a1[_0xb056('0x6e')](_0x1a9c89[_0xb056('0x37')]['ids']);}})[_0xb056('0x2b')](respondWithStatusCode(_0x62da08,null))[_0xb056('0x49')](handleError(_0x62da08,null));};exports[_0xb056('0x6f')]=function(_0x3de775,_0x3b428d){var _0x430cba={};if(!_0x3de775[_0xb056('0x37')][_0xb056('0x70')])throw new Error(_0xb056('0x71'));if(!_0x3de775[_0xb056('0x37')][_0xb056('0x72')]('nolimit')){_0x430cba['limit']=qs[_0xb056('0x23')](_0x3de775['query'][_0xb056('0x23')]);_0x430cba[_0xb056('0x22')]=qs[_0xb056('0x22')](_0x3de775['query'][_0xb056('0x22')]);}return db[_0xb056('0x32')]['find']({'where':{'id':_0x3de775['params']['id']}})[_0xb056('0x2b')](function(_0x3f80ab){if(!_0x3f80ab)throw new Error(_0xb056('0x73')+_0x3de775[_0xb056('0x4b')]['id']);return db[_0xb056('0x32')]['getResources'](_0x3de775);})['then'](respondWithFilteredResult(_0x3b428d,_0x430cba))[_0xb056('0x49')](handleError(_0x3b428d,null));};
\ No newline at end of file
+var _0x806d=['localhost','socket.io-emitter','./userProfile.socket','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','end','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','UserProfile','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body','omit','createdAt','updatedAt','sequelize','transaction','get','UserProfileSection','each','autoAssociation','UserProfileResource','userProfileId','Resources','update','destroy','describe','sectionId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','section','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x219578,_0x295435){var _0x4e885a=function(_0x2d3ca7){while(--_0x2d3ca7){_0x219578['push'](_0x219578['shift']());}};_0x4e885a(++_0x295435);}(_0x806d,0x131));var _0xd806=function(_0x2f9b60,_0x1fbd6f){_0x2f9b60=_0x2f9b60-0x0;var _0x243cf9=_0x806d[_0x2f9b60];return _0x243cf9;};'use strict';var emlformat=require(_0xd806('0x0'));var rimraf=require(_0xd806('0x1'));var zipdir=require(_0xd806('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd806('0x3'));var Mustache=require(_0xd806('0x4'));var util=require('util');var path=require(_0xd806('0x5'));var sox=require('sox');var csv=require(_0xd806('0x6'));var ejs=require(_0xd806('0x7'));var fs=require('fs');var fs_extra=require(_0xd806('0x8'));var _=require(_0xd806('0x9'));var squel=require(_0xd806('0xa'));var crypto=require(_0xd806('0xb'));var jsforce=require(_0xd806('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd806('0x6'));var querystring=require(_0xd806('0xd'));var Papa=require(_0xd806('0xe'));var Redis=require(_0xd806('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd806('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd806('0x11'));var logger=require(_0xd806('0x12'))('api');var utils=require(_0xd806('0x13'));var config=require(_0xd806('0x14'));var licenseUtil=require(_0xd806('0x15'));var db=require(_0xd806('0x16'))['db'];config[_0xd806('0x17')]=_[_0xd806('0x18')](config[_0xd806('0x17')],{'host':_0xd806('0x19'),'port':0x18eb});var socket=require(_0xd806('0x1a'))(new Redis(config[_0xd806('0x17')]));require(_0xd806('0x1b'))['register'](socket);function respondWithStatusCode(_0x17d8bc,_0x359bfa){_0x359bfa=_0x359bfa||0xcc;return function(_0x69dd14){if(_0x69dd14){return _0x17d8bc['sendStatus'](_0x359bfa);}return _0x17d8bc[_0xd806('0x1c')](_0x359bfa)['end']();};}function respondWithResult(_0x33127f,_0x1195c4){_0x1195c4=_0x1195c4||0xc8;return function(_0x47f679){if(_0x47f679){return _0x33127f[_0xd806('0x1c')](_0x1195c4)[_0xd806('0x1d')](_0x47f679);}};}function respondWithFilteredResult(_0x1e7f7f,_0x3407f9){return function(_0x332eec){if(_0x332eec){var _0x1c9ce4=typeof _0x3407f9['offset']===_0xd806('0x1e')&&typeof _0x3407f9[_0xd806('0x1f')]===_0xd806('0x1e');var _0x5a3781=_0x332eec[_0xd806('0x20')];var _0x5f5b46=_0x1c9ce4?0x0:_0x3407f9[_0xd806('0x21')];var _0x1954f8=_0x1c9ce4?_0x332eec[_0xd806('0x20')]:_0x3407f9[_0xd806('0x21')]+_0x3407f9[_0xd806('0x1f')];var _0x58c632;if(_0x1954f8>=_0x5a3781){_0x1954f8=_0x5a3781;_0x58c632=0xc8;}else{_0x58c632=0xce;}_0x1e7f7f['status'](_0x58c632);return _0x1e7f7f[_0xd806('0x22')](_0xd806('0x23'),_0x5f5b46+'-'+_0x1954f8+'/'+_0x5a3781)[_0xd806('0x1d')](_0x332eec);}return null;};}function patchUpdates(_0x95450b){return function(_0x33b87a){try{jsonpatch['apply'](_0x33b87a,_0x95450b,!![]);}catch(_0x500f9d){return BPromise[_0xd806('0x24')](_0x500f9d);}return _0x33b87a[_0xd806('0x25')]();};}function saveUpdates(_0x17aa45,_0x36721b){return function(_0x3a4934){if(_0x3a4934){return _0x3a4934['update'](_0x17aa45)[_0xd806('0x26')](function(_0xf8df1e){return _0xf8df1e;});}return null;};}function removeEntity(_0x53782d,_0x479744){return function(_0x2fd73d){if(_0x2fd73d){return _0x2fd73d['destroy']()[_0xd806('0x26')](function(){_0x53782d[_0xd806('0x1c')](0xcc)[_0xd806('0x27')]();});}};}function handleEntityNotFound(_0x3a4435,_0x219ea3){return function(_0x59b43d){if(!_0x59b43d){_0x3a4435['sendStatus'](0x194);}return _0x59b43d;};}function handleError(_0xad5769,_0x382cfd){_0x382cfd=_0x382cfd||0x1f4;return function(_0x10db6c){logger['error'](_0x10db6c[_0xd806('0x28')]);if(_0x10db6c[_0xd806('0x29')]){delete _0x10db6c[_0xd806('0x29')];}_0xad5769['status'](_0x382cfd)[_0xd806('0x2a')](_0x10db6c);};}exports[_0xd806('0x2b')]=function(_0x2d46d1,_0x441e1d){var _0x34d45f={},_0x183d67={},_0x49103a={'count':0x0,'rows':[]};var _0x5845b4=_['map'](db['UserProfile'][_0xd806('0x2c')],function(_0x435d94){return{'name':_0x435d94[_0xd806('0x2d')],'type':_0x435d94[_0xd806('0x2e')][_0xd806('0x2f')]};});_0x183d67[_0xd806('0x30')]=_[_0xd806('0x31')](_0x5845b4,_0xd806('0x29'));_0x183d67[_0xd806('0x32')]=_['keys'](_0x2d46d1[_0xd806('0x32')]);_0x183d67[_0xd806('0x33')]=_[_0xd806('0x34')](_0x183d67[_0xd806('0x30')],_0x183d67['query']);_0x34d45f[_0xd806('0x35')]=_['intersection'](_0x183d67[_0xd806('0x30')],qs['fields'](_0x2d46d1['query'][_0xd806('0x36')]));_0x34d45f[_0xd806('0x35')]=_0x34d45f['attributes'][_0xd806('0x37')]?_0x34d45f[_0xd806('0x35')]:_0x183d67['model'];if(!_0x2d46d1[_0xd806('0x32')][_0xd806('0x38')]('nolimit')){_0x34d45f[_0xd806('0x1f')]=qs[_0xd806('0x1f')](_0x2d46d1['query']['limit']);_0x34d45f[_0xd806('0x21')]=qs[_0xd806('0x21')](_0x2d46d1['query'][_0xd806('0x21')]);}_0x34d45f[_0xd806('0x39')]=qs['sort'](_0x2d46d1['query']['sort']);_0x34d45f[_0xd806('0x3a')]=qs[_0xd806('0x33')](_[_0xd806('0x3b')](_0x2d46d1[_0xd806('0x32')],_0x183d67[_0xd806('0x33')]),_0x5845b4);if(_0x2d46d1[_0xd806('0x32')][_0xd806('0x3c')]){_0x34d45f[_0xd806('0x3a')]=_[_0xd806('0x3d')](_0x34d45f[_0xd806('0x3a')],{'$or':_['map'](_0x5845b4,function(_0x10edc7){if(_0x10edc7['type']!==_0xd806('0x3e')){var _0x46504a={};_0x46504a[_0x10edc7['name']]={'$like':'%'+_0x2d46d1[_0xd806('0x32')]['filter']+'%'};return _0x46504a;}})});}_0x34d45f=_[_0xd806('0x3d')]({},_0x34d45f,_0x2d46d1['options']);var _0x55b5c5={'where':_0x34d45f['where']};return db[_0xd806('0x3f')]['count'](_0x55b5c5)[_0xd806('0x26')](function(_0x11a915){_0x49103a[_0xd806('0x20')]=_0x11a915;if(_0x2d46d1[_0xd806('0x32')][_0xd806('0x40')]){_0x34d45f['include']=[{'all':!![]}];}return db['UserProfile'][_0xd806('0x41')](_0x34d45f);})['then'](function(_0x1c4191){_0x49103a[_0xd806('0x42')]=_0x1c4191;return _0x49103a;})[_0xd806('0x26')](respondWithFilteredResult(_0x441e1d,_0x34d45f))['catch'](handleError(_0x441e1d,null));};exports[_0xd806('0x43')]=function(_0x5e9089,_0x337a72){var _0x1980f8={'raw':![],'where':{'id':_0x5e9089[_0xd806('0x44')]['id']}},_0xdc7ad={};_0xdc7ad['model']=_[_0xd806('0x45')](db[_0xd806('0x3f')][_0xd806('0x2c')]);_0xdc7ad['query']=_[_0xd806('0x45')](_0x5e9089['query']);_0xdc7ad[_0xd806('0x33')]=_[_0xd806('0x34')](_0xdc7ad[_0xd806('0x30')],_0xdc7ad[_0xd806('0x32')]);_0x1980f8['attributes']=_['intersection'](_0xdc7ad[_0xd806('0x30')],qs[_0xd806('0x36')](_0x5e9089['query']['fields']));_0x1980f8[_0xd806('0x35')]=_0x1980f8[_0xd806('0x35')][_0xd806('0x37')]?_0x1980f8[_0xd806('0x35')]:_0xdc7ad[_0xd806('0x30')];if(_0x5e9089['query']['includeAll']){_0x1980f8[_0xd806('0x46')]=[{'all':!![]}];}_0x1980f8=_['merge']({},_0x1980f8,_0x5e9089['options']);return db[_0xd806('0x3f')][_0xd806('0x47')](_0x1980f8)[_0xd806('0x26')](handleEntityNotFound(_0x337a72,null))['then'](respondWithResult(_0x337a72,null))[_0xd806('0x48')](handleError(_0x337a72,null));};exports['create']=function(_0x45a75c,_0x1e5da1){return db[_0xd806('0x3f')][_0xd806('0x49')](_0x45a75c[_0xd806('0x4a')],{})['then'](respondWithResult(_0x1e5da1,0xc9))['catch'](handleError(_0x1e5da1,null));};exports['clone']=function(_0x1badb8,_0x2ddedc){var _0x5a847b={'where':{'id':_0x1badb8[_0xd806('0x44')]['id']}},_0x4d8cf6={};_0x4d8cf6[_0xd806('0x30')]=_['keys'](db[_0xd806('0x3f')]['rawAttributes']);_0x5a847b[_0xd806('0x35')]=_[_0xd806('0x34')](_0x4d8cf6['model'],qs[_0xd806('0x36')](_0x1badb8['query'][_0xd806('0x36')]));_0x5a847b['attributes']=_0x5a847b[_0xd806('0x35')][_0xd806('0x37')]?_0x5a847b['attributes']:_0x4d8cf6['model'];if(_0x1badb8['query'][_0xd806('0x40')]){_0x5a847b['include']=[{'all':!![]}];}_0x5a847b=_[_0xd806('0x3d')]({},_0x5a847b,_0x1badb8['options']);return db['UserProfile'][_0xd806('0x47')](_0x5a847b)[_0xd806('0x26')](handleEntityNotFound(_0x2ddedc,null))[_0xd806('0x26')](function(_0x56ca6b){if(_0x56ca6b){var _0x45806d=_0x56ca6b['get']({'plain':!![]});_0x45806d=qs[_0xd806('0x4b')](_0x45806d,['id','createdAt','updatedAt','crudPermissions']);_0x1badb8[_0xd806('0x4a')]=_[_0xd806('0x4b')](_0x1badb8['body'],['id',_0xd806('0x4c'),_0xd806('0x4d')]);return db[_0xd806('0x4e')][_0xd806('0x4f')](function(_0x30ede5){return db['UserProfile'][_0xd806('0x49')](_[_0xd806('0x3d')](_0x45806d,_0x1badb8['body']),{'include':_0x1badb8[_0xd806('0x32')][_0xd806('0x40')]?[{'all':!![]}]:undefined,'transaction':_0x30ede5})['then'](function(_0x1e483c){var _0x54d484=_0x1e483c[_0xd806('0x50')]({'plain':!![]});return db[_0xd806('0x51')][_0xd806('0x41')]({'where':{'userProfileId':_0x1badb8['params']['id']},'raw':!![]})[_0xd806('0x26')](function(_0x57cb59){if(_0x57cb59){return BPromise[_0xd806('0x52')](_0x57cb59,function(_0x39109c){return new BPromise(function(_0xdf669b,_0x33eac0){if(_0x39109c[_0xd806('0x53')]===null||_0x39109c['autoAssociation']===0x1)_0xdf669b(null);return db[_0xd806('0x54')][_0xd806('0x41')]({'where':{'sectionId':_0x39109c['id']},'raw':!![]})[_0xd806('0x26')](function(_0x231fd3){var _0x3b4298=_['map'](_0x231fd3,function(_0x5248cd){return qs['omit'](_0x5248cd,['id',_0xd806('0x4c'),'updatedAt','sectionId']);});_0xdf669b(_0x3b4298);})[_0xd806('0x48')](function(_0xea5f8a){_0x33eac0(_0xea5f8a);});})[_0xd806('0x26')](function(_0x1e3260){var _0x5f347d=qs['omit'](_0x39109c,['id','createdAt',_0xd806('0x4d')]);_0x5f347d[_0xd806('0x55')]=_0x54d484['id'];if(_0x1e3260)_0x5f347d['Resources']=_0x1e3260;return _0x5f347d;})[_0xd806('0x26')](function(_0x31f409){return db[_0xd806('0x51')]['create'](_0x31f409,{'include':[{'model':db[_0xd806('0x54')],'as':_0xd806('0x56')}],'raw':!![],'transaction':_0x30ede5});});})[_0xd806('0x26')](function(){return _0x54d484;});}});});});}})['then'](respondWithResult(_0x2ddedc,0xc9))['catch'](handleError(_0x2ddedc,null));};exports[_0xd806('0x57')]=function(_0x21ddbd,_0x363c8d){if(_0x21ddbd[_0xd806('0x4a')]['id']){delete _0x21ddbd[_0xd806('0x4a')]['id'];}return db[_0xd806('0x3f')]['find']({'where':{'id':_0x21ddbd[_0xd806('0x44')]['id']}})['then'](handleEntityNotFound(_0x363c8d,null))[_0xd806('0x26')](saveUpdates(_0x21ddbd['body'],null))[_0xd806('0x26')](respondWithResult(_0x363c8d,null))['catch'](handleError(_0x363c8d,null));};exports[_0xd806('0x58')]=function(_0x1b3d1a,_0x12b0cd){return db[_0xd806('0x3f')][_0xd806('0x47')]({'where':{'id':_0x1b3d1a['params']['id']}})[_0xd806('0x26')](handleEntityNotFound(_0x12b0cd,null))[_0xd806('0x26')](removeEntity(_0x12b0cd,null))['catch'](handleError(_0x12b0cd,null));};exports[_0xd806('0x59')]=function(_0x3911c3,_0x4a4da3){return db[_0xd806('0x3f')][_0xd806('0x59')]()[_0xd806('0x26')](respondWithResult(_0x4a4da3,null))[_0xd806('0x48')](handleError(_0x4a4da3,null));};exports['addSections']=function(_0xab582,_0x570197){var _0x5dd593=_0xab582['body'];return db[_0xd806('0x3f')][_0xd806('0x47')]({'where':{'id':_0xab582[_0xd806('0x44')]['id']}})[_0xd806('0x26')](handleEntityNotFound(_0x570197,null))['then'](function(_0x36b6a0){if(_0x36b6a0){return db['sequelize'][_0xd806('0x4f')](function(_0x53b810){return db[_0xd806('0x51')][_0xd806('0x58')]({'where':{'userProfileId':_0xab582[_0xd806('0x44')]['id'],'sectionId':_[_0xd806('0x31')](_0x5dd593,function(_0x30cc81){return _0x30cc81[_0xd806('0x5a')];})},'transaction':_0x53b810})[_0xd806('0x26')](function(){var _0x2da391=_[_0xd806('0x31')](_0x5dd593,function(_0x3545aa){_0x3545aa[_0xd806('0x55')]=_0xab582[_0xd806('0x44')]['id'];return _0x3545aa;});var _0x1d967d=[];return BPromise['each'](_0x2da391,function(_0x3a014f){return db[_0xd806('0x51')]['create'](_0x3a014f,{'include':[{'model':db[_0xd806('0x54')],'as':_0xd806('0x56')}],'raw':!![],'transaction':_0x53b810})[_0xd806('0x26')](function(_0x2e5583){_0x1d967d[_0xd806('0x5b')](_0x2e5583[_0xd806('0x50')]({'plain':!![]}));});})['then'](function(){return _0x1d967d;});});});}})['then'](function(_0x4adf58){return _0x4adf58;})[_0xd806('0x26')](respondWithResult(_0x570197,null))[_0xd806('0x48')](handleError(_0x570197,null));};exports[_0xd806('0x5c')]=function(_0x4a603c,_0x16c83e){var _0x587c69;return db['UserProfile']['find']({'where':{'id':_0x4a603c[_0xd806('0x44')]['id']},'attributes':['id',_0xd806('0x29')]})[_0xd806('0x26')](handleEntityNotFound(_0x16c83e,null))[_0xd806('0x26')](function(_0xdec062){if(_0xdec062){_0x587c69=_0xdec062;return db[_0xd806('0x51')][_0xd806('0x58')]({'where':{'userProfileId':_0x4a603c[_0xd806('0x44')]['id'],'sectionId':_0x4a603c['query'][_0xd806('0x5d')]}});}})[_0xd806('0x26')](function(){return _0x587c69;})['then'](respondWithStatusCode(_0x16c83e,null))[_0xd806('0x48')](handleError(_0x16c83e,null));};exports[_0xd806('0x5e')]=function(_0x47311c,_0x2e896c){var _0x177bac=[];var _0x22ae14=[];return db[_0xd806('0x51')]['findAll']({'where':{'userProfileId':_0x47311c[_0xd806('0x44')]['id']},'raw':!![]})[_0xd806('0x26')](function(_0x26c527){_0x177bac=_[_0xd806('0x3c')](_0x26c527,function(_0x103416){return _0x103416[_0xd806('0x5f')]===0x1||_[_0xd806('0x60')]([0x3eb,0x709],_0x103416[_0xd806('0x5a')]);});if(!_[_0xd806('0x61')](_0x177bac)){return _['map'](_0x177bac,function(_0x59dc16){return _0x59dc16[_0xd806('0x5a')];});}else{return;}})[_0xd806('0x26')](function(_0x2d8ee6){if(_0x2d8ee6)_0x22ae14=_0x2d8ee6;if(_[_0xd806('0x60')](_0x22ae14,0x64)){var _0x51acf4=_[_0xd806('0x47')](_0x177bac,{'sectionId':0x64});return hasDefaultDashboard(_0x51acf4)[_0xd806('0x26')](function(_0x132aa5){return _[_0xd806('0x31')](_0x177bac,function(_0x38a4c3){if(_0x38a4c3[_0xd806('0x5a')]===0x64){_0x38a4c3[_0xd806('0x62')]=_0x132aa5;}return _0x38a4c3;});});}else{return;}})[_0xd806('0x26')](function(_0x3be72f){if(_0x3be72f)_0x177bac=_0x3be72f;if(_['includes'](_0x22ae14,0x3eb)){var _0x219c39=_[_0xd806('0x47')](_0x177bac,{'sectionId':0x3eb});return getCustomDashboards(_0x219c39)['then'](function(_0x460767){return _[_0xd806('0x31')](_0x177bac,function(_0x1db29b){if(_0x219c39[_0xd806('0x5f')]){if(_0x1db29b['sectionId']===0x3eb){_0x1db29b['subsections']=_0x460767;}}else{if(_0x1db29b[_0xd806('0x5a')]===0x64){_0x1db29b[_0xd806('0x62')]=_0x460767;}}return _0x1db29b;});});}else{return;}})[_0xd806('0x26')](function(_0x9ba833){if(_0x9ba833)_0x177bac=_0x9ba833;if(_[_0xd806('0x60')](_0x22ae14,0x709)){var _0x4f0c52=_[_0xd806('0x47')](_0x177bac,{'sectionId':0x709});return getPlugins(_0x4f0c52)['then'](function(_0x1e0b33){if(_0x4f0c52[_0xd806('0x5f')]){return _[_0xd806('0x31')](_0x177bac,function(_0x3afaf7){if(_0x3afaf7['sectionId']===0x709){_0x3afaf7[_0xd806('0x62')]=_0x1e0b33;}return _0x3afaf7;});}else{var _0xb75753={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1e0b33};var _0x2af624=_['map'](_0x177bac);_0x2af624['push'](_0xb75753);return _0x2af624;}});}else{return;}})[_0xd806('0x26')](function(_0x467667){if(_0x467667)_0x177bac=_0x467667;return _['filter'](_0x177bac,[_0xd806('0x5f'),0x1]);})[_0xd806('0x26')](respondWithResult(_0x2e896c,null))[_0xd806('0x48')](handleError(_0x2e896c,null));};function hasDefaultDashboard(_0x10462c){var _0x1ab103=[0x65];return new BPromise(function(_0x8b8cea,_0x1b8d7d){try{if(_0x10462c['autoAssociation']){_0x8b8cea(_0x1ab103);}else{return db[_0xd806('0x54')][_0xd806('0x63')]({'where':{'sectionId':_0x10462c['id']},'raw':!![]})[_0xd806('0x26')](function(_0x11b58a){_0x11b58a?_0x8b8cea(_0x1ab103):_0x8b8cea();});}}catch(_0x5c0e2f){_0x1b8d7d(_0x5c0e2f);}});}function getCustomDashboards(_0xb38f72){var _0xf4f992=[];return new BPromise(function(_0x1f16b6,_0x42e86f){try{if(_0xb38f72['autoAssociation']){return db[_0xd806('0x64')][_0xd806('0x41')]({'raw':!![]})[_0xd806('0x26')](function(_0x4651bf){_0x4651bf['forEach'](function(_0x4d9eef){_0xf4f992['push'](_0x4d9eef['id']+0x1869f);});_0x1f16b6(_0xf4f992);});}else{return db[_0xd806('0x54')]['findAll']({'where':{'sectionId':_0xb38f72['id']},'raw':!![]})[_0xd806('0x26')](function(_0x25842a){_0x25842a[_0xd806('0x65')](function(_0x2030f0){_0xf4f992[_0xd806('0x5b')](_0x2030f0[_0xd806('0x66')]+0x1869f);});_0x1f16b6(_0xf4f992);});}}catch(_0x81402b){_0x42e86f(_0x81402b);}});}function getPlugins(_0x592079){var _0x2b5e3d=[];return new BPromise(function(_0xc34231,_0x2fa192){try{if(_0x592079['autoAssociation']){return db['Plugin'][_0xd806('0x41')]({'raw':!![]})['then'](function(_0x8cc1d4){_0x8cc1d4[_0xd806('0x65')](function(_0x38bcf4){_0x2b5e3d[_0xd806('0x5b')](_0x38bcf4['id']+0x15b38);});_0xc34231(_0x2b5e3d);});}else{return db[_0xd806('0x54')]['findAll']({'where':{'sectionId':_0x592079['id']},'raw':!![]})[_0xd806('0x26')](function(_0x493d71){_0x493d71[_0xd806('0x65')](function(_0x3dfbf3){_0x2b5e3d[_0xd806('0x5b')](_0x3dfbf3[_0xd806('0x66')]+0x15b38);});_0xc34231(_0x2b5e3d);});}}catch(_0x40274b){_0x2fa192(_0x40274b);}});}exports[_0xd806('0x67')]=function(_0x23da5e,_0x8618d3){return db[_0xd806('0x3f')][_0xd806('0x47')]({'where':{'id':_0x23da5e['params']['id']}})[_0xd806('0x26')](handleEntityNotFound(_0x8618d3,null))[_0xd806('0x26')](function(_0xdfe256){if(_0xdfe256){return db[_0xd806('0x4e')]['transaction'](function(_0x1318c4){return db[_0xd806('0x51')][_0xd806('0x41')]({'where':{'userProfileId':_0x23da5e[_0xd806('0x44')]['id']},'attributes':['id'],'raw':!![]})[_0xd806('0x26')](function(_0x4c50a9){if(_0x4c50a9){return db['UserProfileSection'][_0xd806('0x58')]({'where':{'userProfileId':_0x23da5e[_0xd806('0x44')]['id'],'id':_[_0xd806('0x31')](_0x4c50a9,function(_0x199dad){return _0x199dad['id'];})},'transaction':_0x1318c4});}})[_0xd806('0x26')](function(_0x48ea1f){var _0x16c491=_['map'](_0x23da5e[_0xd806('0x4a')],function(_0x5785ae){_0x5785ae['userProfileId']=_0x23da5e['params']['id'];return _0x5785ae;});return db['UserProfileSection'][_0xd806('0x68')](_0x16c491,{'raw':!![],'transaction':_0x1318c4});})[_0xd806('0x26')](function(_0x21f060){var _0x20beb7=_['filter'](_[_0xd806('0x31')](_0x21f060,function(_0x39a76f){return _0x39a76f[_0xd806('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x20beb7){return db[_0xd806('0x51')][_0xd806('0x41')]({'where':{'userProfileId':_0x23da5e[_0xd806('0x44')]['id'],'sectionId':_[_0xd806('0x31')](_0x20beb7,function(_0x623c9c){return _0x623c9c[_0xd806('0x5a')];})},'attributes':['id',_0xd806('0x5a')],'raw':!![]})[_0xd806('0x26')](function(_0x543e8c){var _0x5df571=_['map'](_0x23da5e[_0xd806('0x4a')],function(_0x4edb16){_0x4edb16[_0xd806('0x55')]=_0x23da5e[_0xd806('0x44')]['id'];return _0x4edb16;});return db[_0xd806('0x54')][_0xd806('0x68')](_0x5df571,{'raw':!![],'transaction':_0x1318c4});});}})['catch'](handleError(_0x8618d3,null));});}})['then'](function(_0x27296c){var _0x31e9e0=_[_0xd806('0x31')](_0x27296c,function(_0x51921e){return _0x51921e[_0xd806('0x50')]({'plain':!![]});});})[_0xd806('0x26')](respondWithResult(_0x8618d3,null))['catch'](handleError(_0x8618d3,null));};exports['removeResources']=function(_0xba9794,_0x16e6a3,_0x5433f5){return db['UserProfile'][_0xd806('0x47')]({'where':{'id':_0xba9794[_0xd806('0x44')]['id']}})[_0xd806('0x26')](handleEntityNotFound(_0x16e6a3,null))['then'](function(_0x2bc339){if(_0x2bc339){return _0x2bc339['removeResources'](_0xba9794[_0xd806('0x32')][_0xd806('0x5d')]);}})[_0xd806('0x26')](respondWithStatusCode(_0x16e6a3,null))[_0xd806('0x48')](handleError(_0x16e6a3,null));};exports['getResources']=function(_0x514de2,_0x4b7d91){var _0x2e0c71={};if(!_0x514de2[_0xd806('0x32')][_0xd806('0x69')])throw new Error(_0xd806('0x6a'));if(!_0x514de2[_0xd806('0x32')][_0xd806('0x38')](_0xd806('0x6b'))){_0x2e0c71[_0xd806('0x1f')]=qs[_0xd806('0x1f')](_0x514de2['query'][_0xd806('0x1f')]);_0x2e0c71[_0xd806('0x21')]=qs[_0xd806('0x21')](_0x514de2[_0xd806('0x32')]['offset']);}return db[_0xd806('0x3f')][_0xd806('0x47')]({'where':{'id':_0x514de2[_0xd806('0x44')]['id']}})[_0xd806('0x26')](function(_0x327242){if(!_0x327242)throw new Error(_0xd806('0x6c')+_0x514de2['params']['id']);return db[_0xd806('0x3f')][_0xd806('0x6d')](_0x514de2);})[_0xd806('0x26')](respondWithFilteredResult(_0x4b7d91,_0x2e0c71))[_0xd806('0x48')](handleError(_0x4b7d91,null));};
\ No newline at end of file
index 77dd9f2..6c15a80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a38=['events','../../mysqldb','UserProfile','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5045a8,_0x5d27b9){var _0x3945cf=function(_0x2c5c18){while(--_0x2c5c18){_0x5045a8['push'](_0x5045a8['shift']());}};_0x3945cf(++_0x5d27b9);}(_0x1a38,0xb0));var _0x81a3=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0x1a38[_0x4de586];return _0x46baf5;};'use strict';var EventEmitter=require(_0x81a3('0x0'));var UserProfile=require(_0x81a3('0x1'))['db'][_0x81a3('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x81a3('0x3')};function emitEvent(_0x2402ba){return function(_0x2faf46,_0x28fd86,_0x33a486){UserProfileEvents[_0x81a3('0x4')](_0x2402ba+':'+_0x2faf46['id'],_0x2faf46);UserProfileEvents[_0x81a3('0x4')](_0x2402ba,_0x2faf46);_0x33a486(null);};}for(var e in events){if(events[_0x81a3('0x5')](e)){var event=events[e];UserProfile[_0x81a3('0x6')](e,emitEvent(event));}}module[_0x81a3('0x7')]=UserProfileEvents;
\ No newline at end of file
+var _0x6b1b=['exports','../../mysqldb','UserProfile','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x42eb51,_0xafa7f2){var _0x403569=function(_0x51d5b9){while(--_0x51d5b9){_0x42eb51['push'](_0x42eb51['shift']());}};_0x403569(++_0xafa7f2);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x6b1b[_0x54d4fe];return _0x1ab5bb;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xb6b1('0x0'))['db'][_0xb6b1('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xb6b1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb6b1('0x3'),'afterDestroy':_0xb6b1('0x4')};function emitEvent(_0x28daf9){return function(_0xaaa201,_0x1f218b,_0x345886){UserProfileEvents[_0xb6b1('0x5')](_0x28daf9+':'+_0xaaa201['id'],_0xaaa201);UserProfileEvents[_0xb6b1('0x5')](_0x28daf9,_0xaaa201);_0x345886(null);};}for(var e in events){if(events[_0xb6b1('0x6')](e)){var event=events[e];UserProfile[_0xb6b1('0x7')](e,emitEvent(event));}}module[_0xb6b1('0x8')]=UserProfileEvents;
\ No newline at end of file
index 3b25e89..086ed77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f4c=['zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','tags','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','reportId','AnalyticMetric','charAt','Sequelize','QueryTypes','SELECT','ui.','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','find','params','all','ignore','union','autoAssociation','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','pick','merge','key','VIRTUAL','forEach','options','includeAll','include','reportType','default','CustomReports','count','rows','ids','Tag','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','value','findAll','then','map','catch','field','model','associatedResources','name','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','odbc','squarerecordings','SquareRecording','parentSections','projectName','JscriptyProject','contacts','CmContact','ListId','lists','companies','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueue','inbound','QueueCampaigns','queue','outbound','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelAccount','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','Team','voicequeues','users','agents','telephones','Users'];(function(_0x3a7ad9,_0x4b8ee6){var _0x5d176f=function(_0x2fe3f4){while(--_0x2fe3f4){_0x3a7ad9['push'](_0x3a7ad9['shift']());}};_0x5d176f(++_0x4b8ee6);}(_0x8f4c,0x113));var _0xc8f4=function(_0x5ae8f1,_0x58098e){_0x5ae8f1=_0x5ae8f1-0x0;var _0x4ac982=_0x8f4c[_0x5ae8f1];return _0x4ac982;};'use strict';var _=require(_0xc8f4('0x0'));var attributes=require(_0xc8f4('0x1'));var qs=require(_0xc8f4('0x2'));var squel=require(_0xc8f4('0x3'));module[_0xc8f4('0x4')]=function(_0x134d73){var _0x580083=_0x134d73[_0xc8f4('0x5')];function _0x47350d(_0x133764,_0x56c9b1){return new Promise(function(_0x32cd80,_0x5208da){if(!_0x56c9b1)return _0x32cd80(null);var _0x4c86f8=_0x56c9b1['filter']?{[_0x56c9b1[_0xc8f4('0x6')]['field']]:_0x56c9b1[_0xc8f4('0x6')][_0xc8f4('0x7')]}:undefined;return _0x580083[_0x133764][_0xc8f4('0x8')]({'where':_0x4c86f8,'raw':!![]})[_0xc8f4('0x9')](function(_0x34f05f){_0x56c9b1['associatedResources']=_[_0xc8f4('0xa')](_0x34f05f,'id');_0x32cd80(_0x56c9b1);})[_0xc8f4('0xb')](function(_0x2fba62){_0x5208da(_0x2fba62);});});}function _0x3a2f8a(_0x4fd453,_0x26f83){return new Promise(function(_0x52c699,_0x430009){var _0xf07a92=_0x4fd453[_0xc8f4('0x6')]?{[_0x4fd453[_0xc8f4('0x6')][_0xc8f4('0xc')]]:_0x4fd453['filter'][_0xc8f4('0x7')]}:undefined;return _0x580083[_0x4fd453[_0xc8f4('0xd')]][_0xc8f4('0x8')]({'where':_0xf07a92,'raw':!![]})[_0xc8f4('0x9')](function(_0x1dcee5){_0x26f83[_0xc8f4('0xe')]=_['map'](_0x1dcee5,function(_0x2bce00){return _0x2bce00[_0xc8f4('0xf')];});_0x52c699(_0x26f83);})[_0xc8f4('0xb')](function(_0x46ac15){_0x430009(_0x46ac15);});});}function _0x22c08a(_0x56a25d,_0xac45d5,_0x4d2b77){if(!_0xac45d5)return Promise['resolve'](null);return new Promise(function(_0x14bc02,_0x225b76){return _0x580083[_0xc8f4('0x10')][_0xc8f4('0x8')]({'where':{'sectionId':_0xac45d5['id']},'raw':!![]})[_0xc8f4('0x9')](function(_0x374761){if(_0x56a25d[_0xc8f4('0xc')]&&_0x56a25d[_0xc8f4('0xc')]!=='id'){_0xac45d5[_0xc8f4('0xe')]=_[_0xc8f4('0xa')](_0x374761,function(_0x3cd90c){return _0x3cd90c[_0x56a25d[_0xc8f4('0xc')]];});}else{if(_0x4d2b77===_0xc8f4('0x11')){_0xac45d5['associatedResources']=_[_0xc8f4('0xa')](_0x374761,function(_0x5c520){return{'id':_0x5c520[_0xc8f4('0x12')],'type':_0x5c520[_0xc8f4('0x13')]};});}else{_0xac45d5[_0xc8f4('0xe')]=_[_0xc8f4('0xa')](_0x374761,function(_0xaeee7d){return _0xaeee7d[_0xc8f4('0x12')];});}}_0x14bc02(_0xac45d5);})['catch'](function(_0x4463aa){_0x225b76(_0x4463aa);});});}function _0x205c41(_0x3195ff,_0x1d159e){var _0x5d54a9={'parentSections':[]};switch(_0x3195ff[_0xc8f4('0x14')]()){case'squareprojects':_0x5d54a9[_0xc8f4('0x15')]='SquareProject';break;case _0xc8f4('0x16'):_0x5d54a9[_0xc8f4('0x15')]='SquareOdbc';break;case _0xc8f4('0x17'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x18');_0x5d54a9[_0xc8f4('0x19')]=[{'name':'SquareProjects','field':_0xc8f4('0xf'),'foreignKey':_0xc8f4('0x1a')}];break;case'projects':_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x1b');break;case _0xc8f4('0x1c'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x1d');_0x5d54a9[_0xc8f4('0x19')]=[{'name':'Lists','field':'id','foreignKey':_0xc8f4('0x1e')}];break;case _0xc8f4('0x1f'):_0x5d54a9[_0xc8f4('0x15')]='CmList';break;case _0xc8f4('0x20'):_0x5d54a9[_0xc8f4('0x15')]='CmCompany';break;case'globalcustomfields':_0x5d54a9['childModel']=_0xc8f4('0x21');break;case _0xc8f4('0x22'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x23');break;case _0xc8f4('0x24'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x25');break;case _0xc8f4('0x26'):_0x5d54a9['childModel']=_0xc8f4('0x27');break;case _0xc8f4('0x28'):_0x5d54a9[_0xc8f4('0x15')]='FaxAccount';break;case _0xc8f4('0x29'):case _0xc8f4('0x2a'):case'outboundroutes':_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x2b');break;case _0xc8f4('0x2c'):_0x5d54a9['childModel']=_0xc8f4('0x2d');break;case _0xc8f4('0x2e'):_0x5d54a9[_0xc8f4('0x15')]='VoiceMail';break;case _0xc8f4('0x2f'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x30');_0x5d54a9[_0xc8f4('0x19')]=[{'name':_0xc8f4('0x31'),'field':_0xc8f4('0xf'),'foreignKey':_0xc8f4('0x32'),'model':_0xc8f4('0x33'),'filter':{'field':_0xc8f4('0x34'),'value':[_0xc8f4('0x35')]}},{'name':_0xc8f4('0x36'),'field':_0xc8f4('0xf'),'foreignKey':_0xc8f4('0x32'),'model':_0xc8f4('0x33'),'filter':{'field':_0xc8f4('0x34'),'value':[_0xc8f4('0x37')]}},{'name':'VoiceQueues','field':_0xc8f4('0xf'),'foreignKey':'queue','model':_0xc8f4('0x38'),'filter':{'field':'type','value':[_0xc8f4('0x39')]}},{'name':_0xc8f4('0x3a'),'field':_0xc8f4('0xf'),'foreignKey':_0xc8f4('0x3b'),'model':_0xc8f4('0x38'),'filter':{'field':_0xc8f4('0x13'),'value':[_0xc8f4('0x3c')]}}];break;case'musiconholds':_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x3d');break;case _0xc8f4('0x3e'):_0x5d54a9[_0xc8f4('0x15')]='VoiceChanSpy';break;case _0xc8f4('0x3f'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x40');break;case _0xc8f4('0x41'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x42');break;case _0xc8f4('0x43'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x44');break;case _0xc8f4('0x45'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x46');break;case'mailsubstatuses':_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x47');break;case _0xc8f4('0x48'):_0x5d54a9[_0xc8f4('0x15')]='OpenchannelQueue';break;case'openchannelaccounts':_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x49');break;case'smsqueues':_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x4a');break;case'smsaccounts':_0x5d54a9['childModel']=_0xc8f4('0x4b');break;case _0xc8f4('0x4c'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x4d');break;case _0xc8f4('0x4e'):_0x5d54a9[_0xc8f4('0x15')]='WhatsappAccount';break;case'teams':_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x4f');break;case _0xc8f4('0x50'):case'queuecampaigns':_0x5d54a9['childModel']='VoiceQueue';if(_0x1d159e){_0x5d54a9['parentSections']=[{'name':'VoiceQueues'},{'name':_0xc8f4('0x3a')}];}break;case _0xc8f4('0x51'):case _0xc8f4('0x52'):case _0xc8f4('0x53'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x33');if(_0x1d159e){_0x5d54a9['parentSections']=[{'name':_0xc8f4('0x54'),'filter':{'field':_0xc8f4('0x34'),'value':['admin','user']},'ignore':!![]},{'name':_0xc8f4('0x31')},{'name':_0xc8f4('0x36')}];}break;case _0xc8f4('0x55'):_0x5d54a9[_0xc8f4('0x15')]='ZendeskAccount';break;case'salesforceaccounts':_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x56');break;case _0xc8f4('0x57'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x58');break;case _0xc8f4('0x59'):_0x5d54a9['childModel']='SugarcrmAccount';break;case _0xc8f4('0x5a'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x5b');break;case _0xc8f4('0x5c'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x5d');break;case _0xc8f4('0x5e'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x33');break;case'cannedanswers':_0x5d54a9['childModel']=_0xc8f4('0x5f');break;case _0xc8f4('0x60'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x61');break;case _0xc8f4('0x62'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x63');break;case _0xc8f4('0x64'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x65');break;case _0xc8f4('0x66'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x67');break;case'scheduler':_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x68');break;case _0xc8f4('0x69'):_0x5d54a9[_0xc8f4('0x15')]='Sound';break;case _0xc8f4('0x6a'):_0x5d54a9[_0xc8f4('0x15')]='Tag';break;case'templates':_0x5d54a9[_0xc8f4('0x15')]='Template';break;case _0xc8f4('0x6b'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x6c');break;case _0xc8f4('0x6d'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x6e');break;case _0xc8f4('0x6f'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x70');break;case _0xc8f4('0x71'):_0x5d54a9[_0xc8f4('0x15')]='Plugin';break;case _0xc8f4('0x72'):_0x5d54a9[_0xc8f4('0x15')]=_0xc8f4('0x11');_0x5d54a9[_0xc8f4('0x19')]=[{'name':'Reports','field':'id','foreignKey':_0xc8f4('0x73')}];break;case'metrics':_0x5d54a9['childModel']=_0xc8f4('0x74');break;}return _0x5d54a9;}function _0x451a3e(_0x192bbc,_0x39cb77){var _0x2bfb92=_0x192bbc[_0xc8f4('0x75')](0x0)['toUpperCase']()+_0x192bbc['slice'](0x1);var _0x45fb1a={'type':_0x580083[_0xc8f4('0x76')][_0xc8f4('0x77')][_0xc8f4('0x78')],'raw':!![]};return new Promise(function(_0x25369e,_0x19a024){var _0x443148=squel['select']()[_0xc8f4('0xc')](_0xc8f4('0x79')+_0x2bfb92+'InteractionId','id')[_0xc8f4('0xc')](_0xc8f4('0x7a'))[_0xc8f4('0x7b')](_0xc8f4('0x7c')+_0x192bbc+_0xc8f4('0x7d'),'ui')[_0xc8f4('0x7e')](_0xc8f4('0x7f'),_0x39cb77['id']);return _0x580083['sequelize'][_0xc8f4('0x80')](_0x443148[_0xc8f4('0x81')](),_0x45fb1a)['then'](function(_0x52e295){_0x39cb77[_0x2bfb92+_0xc8f4('0x82')]=_0x52e295;_0x25369e(_0x52e295);})['catch'](function(_0x281b3a){_0x19a024(_0x281b3a);});});}return _0x134d73[_0xc8f4('0x83')]('UserProfile',attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x57ad51){var _0x490b8b={'raw':_0x57ad51['query']['raw'],'where':{}};var _0x32665c={};var _0x51612f={'count':0x0,'rows':[]};var _0x17e9d1=_0x57ad51[_0xc8f4('0x80')][_0xc8f4('0x84')];var _0x29231d=_0x57ad51['query'][_0xc8f4('0x85')]||![];var _0x329c26=_0x205c41(_0x17e9d1,_0x29231d);if(!_0x329c26[_0xc8f4('0x15')])throw new Error(_0xc8f4('0x86')+_0x17e9d1+'\x27');var _0x4ae72e=[{'name':_0x17e9d1}];if(!_[_0xc8f4('0x87')](_0x329c26[_0xc8f4('0x19')]))_0x4ae72e=_0x329c26[_0xc8f4('0x19')];var _0x3761cc=[];for(var _0x4dc1e5=0x0;_0x4dc1e5<_0x4ae72e[_0xc8f4('0x88')];_0x4dc1e5++){_0x3761cc[_0xc8f4('0x89')](_0x580083['UserProfileSection'][_0xc8f4('0x8a')]({'where':{'userProfileId':_0x57ad51[_0xc8f4('0x8b')]['id'],'name':_0x4ae72e[_0x4dc1e5][_0xc8f4('0xf')]},'raw':!![]}));}return Promise[_0xc8f4('0x8c')](_0x3761cc)[_0xc8f4('0x9')](function(_0x239e4d){var _0x5362c8=_[_0xc8f4('0x6')](_0x239e4d,function(_0x269766){return _0x269766?_0x269766:undefined;});var _0x3d493c=_['filter'](_0x4ae72e,[_0xc8f4('0x8d'),!![]]);var _0x2b6510=_[_0xc8f4('0x87')](_0x5362c8)&&_['isEmpty'](_0x3d493c)?null:_[_0xc8f4('0x8e')](_0x3d493c,_0x5362c8);if(!_0x2b6510)return null;var _0x38a486=[];for(var _0x482cfd=0x0;_0x482cfd<_0x2b6510[_0xc8f4('0x88')];_0x482cfd++){var _0x5bf089=_[_0xc8f4('0x8a')](_0x4ae72e,function(_0x9996da){return _0x2b6510[_0x482cfd]?_0x9996da['name']===_0x2b6510[_0x482cfd][_0xc8f4('0xf')]:null;});if(_0x5bf089){if(_0x2b6510[_0x482cfd][_0xc8f4('0x8d')]){_0x38a486['push'](_0x47350d(_0x329c26[_0xc8f4('0x15')],_0x2b6510[_0x482cfd]));}else{if(!_0x2b6510[_0x482cfd][_0xc8f4('0x8f')]){_0x38a486[_0xc8f4('0x89')](_0x22c08a(_0x5bf089,_0x2b6510[_0x482cfd],_0x329c26[_0xc8f4('0x15')]));}else{if(_0x5bf089[_0xc8f4('0xd')]){_0x38a486[_0xc8f4('0x89')](_0x3a2f8a(_0x5bf089,_0x2b6510[_0x482cfd]));}}}}}return Promise[_0xc8f4('0x8c')](_0x38a486);})[_0xc8f4('0x9')](function(_0x5a6cfe){var _0x2d363c=_0x5a6cfe;var _0x3adcdb=null;if(_0x2d363c){_0x3adcdb=_0x2d363c[_0xc8f4('0x88')]===0x1?_0x2d363c[0x0]:null;}if(!_0x3adcdb&&!_0x2d363c)return _0x51612f;var _0xd85d11=_0x580083[_0x329c26[_0xc8f4('0x15')]]['rawAttributes'];_0x32665c[_0xc8f4('0xd')]=_['keys'](_0xd85d11);_0x32665c[_0xc8f4('0x80')]=_[_0xc8f4('0x90')](_0x57ad51[_0xc8f4('0x80')]);_0x32665c[_0xc8f4('0x91')]=_[_0xc8f4('0x92')](_0x32665c[_0xc8f4('0xd')],_0x32665c[_0xc8f4('0x80')]);_0x490b8b[_0xc8f4('0x93')]=_[_0xc8f4('0x92')](_0x32665c[_0xc8f4('0xd')],qs[_0xc8f4('0x94')](_0x57ad51['query'][_0xc8f4('0x94')]));_0x490b8b[_0xc8f4('0x93')]=_0x490b8b[_0xc8f4('0x93')][_0xc8f4('0x88')]?_0x490b8b['attributes']:_0x32665c['model'];if(!_0x57ad51[_0xc8f4('0x80')]['hasOwnProperty'](_0xc8f4('0x95'))){_0x490b8b['limit']=qs[_0xc8f4('0x96')](_0x57ad51['query']['limit']);_0x490b8b['offset']=qs['offset'](_0x57ad51['query']['offset']);}_0x490b8b[_0xc8f4('0x97')]=qs['sort'](_0x57ad51[_0xc8f4('0x80')][_0xc8f4('0x98')]);_0x490b8b[_0xc8f4('0x7e')]=qs[_0xc8f4('0x91')](_[_0xc8f4('0x99')](_0x57ad51['query'],_0x32665c[_0xc8f4('0x91')]));if(_0x57ad51[_0xc8f4('0x80')][_0xc8f4('0x6')]){_0x490b8b['where']=_[_0xc8f4('0x9a')](_0x490b8b[_0xc8f4('0x7e')],{'$or':_[_0xc8f4('0xa')](_0xd85d11,function(_0x1b95e6){if(_0x1b95e6[_0xc8f4('0x13')][_0xc8f4('0x9b')]!==_0xc8f4('0x9c')){var _0x1401f1={};_0x1401f1[_0x1b95e6['field']]={'$like':'%'+_0x57ad51[_0xc8f4('0x80')][_0xc8f4('0x6')]+'%'};return _0x1401f1;}})});}var _0x1f419d=[];var _0x3ce754=null;var _0xf2a4d7={};if(_0x3adcdb){_0x3ce754=_[_0xc8f4('0x8a')](_0x4ae72e,[_0xc8f4('0xf'),_0x3adcdb[_0xc8f4('0xf')]]);if(_0x3ce754[_0xc8f4('0xc')]){_0xf2a4d7={};if(_0x329c26[_0xc8f4('0x15')]===_0xc8f4('0x11')){_0xf2a4d7[_0x3ce754['foreignKey']]=_[_0xc8f4('0xa')](_0x3adcdb[_0xc8f4('0xe')],'id');}else{_0xf2a4d7[_0x3ce754['foreignKey']]=_0x3adcdb[_0xc8f4('0xe')];}_0x1f419d[_0xc8f4('0x89')](_0xf2a4d7);}else{_0x490b8b['where']['id']=_0x3adcdb[_0xc8f4('0xe')];}}else{for(var _0x2bbf57=0x0;_0x2bbf57<_0x2d363c['length'];_0x2bbf57++){_0x3ce754=_['find'](_0x4ae72e,[_0xc8f4('0xf'),_0x2d363c[_0x2bbf57][_0xc8f4('0xf')]]);if(_0x3ce754[_0xc8f4('0xc')]){_0xf2a4d7={};_0xf2a4d7[_0x3ce754['foreignKey']]=_0x2d363c[_0x2bbf57][_0xc8f4('0xe')];_0x1f419d[_0xc8f4('0x89')](_0xf2a4d7);}else{if(!_0x490b8b['where']['id'])_0x490b8b['where']['id']=[];_0x2d363c[_0x2bbf57][_0xc8f4('0xe')][_0xc8f4('0x9d')](function(_0x327d9c){_0x490b8b['where']['id'][_0xc8f4('0x89')](_0x327d9c);});}}}if(!_[_0xc8f4('0x87')](_0x1f419d)){_0x490b8b[_0xc8f4('0x7e')]=_['merge'](_0x490b8b[_0xc8f4('0x7e')],{'$and':{'$or':_0x1f419d}});}_0x490b8b=_[_0xc8f4('0x9a')]({},_0x490b8b,_0x57ad51[_0xc8f4('0x9e')]);if(_0x3adcdb&&!_0x3adcdb[_0xc8f4('0x8f')]&&_0x329c26[_0xc8f4('0x15')]===_0xc8f4('0x11')){if(_0x57ad51[_0xc8f4('0x80')][_0xc8f4('0x9f')]){_0x490b8b[_0xc8f4('0xa0')]=[{'all':!![]}];}return _0x580083[_0x329c26[_0xc8f4('0x15')]][_0xc8f4('0x8')](_0x490b8b)['then'](function(_0x7ae79){var _0x51b4b7=[];_0x7ae79[_0xc8f4('0x9d')](function(_0x39896d){var _0x1b6953;switch(_0x39896d[_0xc8f4('0xa1')]){case _0xc8f4('0xa2'):_0x1b6953=_[_0xc8f4('0x8a')](_0x3adcdb[_0xc8f4('0xe')],function(_0x2594fa){return _0x2594fa['id']===_0x39896d['reportId']&&_0x2594fa[_0xc8f4('0x13')]==='DefaultReports';});break;case'custom':_0x1b6953=_[_0xc8f4('0x8a')](_0x3adcdb[_0xc8f4('0xe')],function(_0x35a3db){return _0x35a3db['id']===_0x39896d['reportId']&&_0x35a3db['type']===_0xc8f4('0xa3');});break;}if(_0x1b6953)_0x51b4b7[_0xc8f4('0x89')](_0x39896d);});_0x51612f[_0xc8f4('0xa4')]=_0x51b4b7['length'];_0x51612f[_0xc8f4('0xa5')]=_0x51b4b7;return _0x51612f;});}else{if(!_['isEmpty'](_0x57ad51[_0xc8f4('0x80')][_0xc8f4('0xa6')])){_0x490b8b[_0xc8f4('0x7e')]['id']=_0x490b8b[_0xc8f4('0x7e')]['id']?_[_0xc8f4('0x92')](_0x490b8b['where']['id'],_0x57ad51[_0xc8f4('0x80')]['ids']):_0x57ad51[_0xc8f4('0x80')][_0xc8f4('0xa6')];}return _0x580083[_0x329c26[_0xc8f4('0x15')]][_0xc8f4('0xa4')]({'where':_0x490b8b[_0xc8f4('0x7e')]})[_0xc8f4('0x9')](function(_0x3f1852){_0x51612f[_0xc8f4('0xa4')]=_0x3f1852;if(_0x57ad51[_0xc8f4('0x80')][_0xc8f4('0x9f')]){if(_0x329c26[_0xc8f4('0x15')]==='CmContact'){_0x490b8b['include']=[{'model':_0x580083[_0xc8f4('0xa7')],'as':_0xc8f4('0xa8'),'attributes':['id',_0xc8f4('0xf'),_0xc8f4('0xa9')],'required':_0x57ad51[_0xc8f4('0x80')][_0xc8f4('0xaa')]?!![]:![]},{'model':_0x580083[_0xc8f4('0xa7')],'as':_0xc8f4('0xab'),'attributes':['id',_0xc8f4('0xf'),_0xc8f4('0xa9')],'through':_0x57ad51[_0xc8f4('0x80')][_0xc8f4('0xaa')]?{'attributes':[],'where':{'TagId':_0x57ad51['query']['tag']||undefined}}:{},'required':_0x57ad51[_0xc8f4('0x80')]['tag']?!![]:![]}];}else{_0x490b8b['include']=[{'all':!![]}];}}return _0x580083[_0x329c26[_0xc8f4('0x15')]]['findAll'](_0x490b8b);})['then'](function(_0x5c607e){_0x51612f['rows']=_0x5c607e;if(_0x17e9d1==='Agents'&&_0x57ad51[_0xc8f4('0x80')][_0xc8f4('0xac')]===_0xc8f4('0xad')){var _0x3afcb4=[];for(var _0x383c8a=0x0;_0x383c8a<_0x51612f[_0xc8f4('0xa5')][_0xc8f4('0x88')];_0x383c8a++){_0x3afcb4[_0xc8f4('0x89')](_0x451a3e(_0xc8f4('0xae'),_0x51612f[_0xc8f4('0xa5')][_0x383c8a][_0xc8f4('0xaf')]));_0x3afcb4[_0xc8f4('0x89')](_0x451a3e(_0xc8f4('0xb0'),_0x51612f[_0xc8f4('0xa5')][_0x383c8a][_0xc8f4('0xaf')]));_0x3afcb4[_0xc8f4('0x89')](_0x451a3e(_0xc8f4('0xb1'),_0x51612f[_0xc8f4('0xa5')][_0x383c8a][_0xc8f4('0xaf')]));_0x3afcb4[_0xc8f4('0x89')](_0x451a3e(_0xc8f4('0xb2'),_0x51612f[_0xc8f4('0xa5')][_0x383c8a][_0xc8f4('0xaf')]));_0x3afcb4['push'](_0x451a3e('openchannel',_0x51612f[_0xc8f4('0xa5')][_0x383c8a][_0xc8f4('0xaf')]));_0x3afcb4[_0xc8f4('0x89')](_0x451a3e(_0xc8f4('0xb3'),_0x51612f[_0xc8f4('0xa5')][_0x383c8a][_0xc8f4('0xaf')]));}return Promise[_0xc8f4('0x8c')](_0x3afcb4)[_0xc8f4('0x9')](function(){return _0x51612f;});}return _0x51612f;});}});}}});};
\ No newline at end of file
+var _0x1eba=['plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','user_has_','where','sequelize','query','define','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','UserProfileSection','find','params','all','ignore','union','length','push','autoAssociation','model','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','VIRTUAL','foreignKey','options','includeAll','default','DefaultReports','custom','CustomReports','count','rows','ids','include','ThroughTags','tag','openTabs','chat','dataValues','sms','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','then','associatedResources','catch','findAll','map','name','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','JscriptyProject','CmContact','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','users','agents','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables'];(function(_0x177c0f,_0x324360){var _0x1f4d28=function(_0x49d3f0){while(--_0x49d3f0){_0x177c0f['push'](_0x177c0f['shift']());}};_0x1f4d28(++_0x324360);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x1eba[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xa1eb('0x0'));var attributes=require(_0xa1eb('0x1'));var qs=require(_0xa1eb('0x2'));var squel=require(_0xa1eb('0x3'));module[_0xa1eb('0x4')]=function(_0x5865fc){var _0x56c5f2=_0x5865fc[_0xa1eb('0x5')];function _0x34be5a(_0x16a13a,_0xf9d704){return new Promise(function(_0x138789,_0x2933d0){if(!_0xf9d704)return _0x138789(null);var _0x1d0d67=_0xf9d704[_0xa1eb('0x6')]?{[_0xf9d704[_0xa1eb('0x6')][_0xa1eb('0x7')]]:_0xf9d704[_0xa1eb('0x6')][_0xa1eb('0x8')]}:undefined;return _0x56c5f2[_0x16a13a]['findAll']({'where':_0x1d0d67,'raw':!![]})[_0xa1eb('0x9')](function(_0x4d4aaf){_0xf9d704[_0xa1eb('0xa')]=_['map'](_0x4d4aaf,'id');_0x138789(_0xf9d704);})[_0xa1eb('0xb')](function(_0x5d7101){_0x2933d0(_0x5d7101);});});}function _0x41a7bc(_0x5502e4,_0xc23b2e){return new Promise(function(_0x325d13,_0x151580){var _0x5839d3=_0x5502e4[_0xa1eb('0x6')]?{[_0x5502e4[_0xa1eb('0x6')]['field']]:_0x5502e4[_0xa1eb('0x6')]['value']}:undefined;return _0x56c5f2[_0x5502e4['model']][_0xa1eb('0xc')]({'where':_0x5839d3,'raw':!![]})['then'](function(_0x25d058){_0xc23b2e[_0xa1eb('0xa')]=_[_0xa1eb('0xd')](_0x25d058,function(_0x2877cb){return _0x2877cb[_0xa1eb('0xe')];});_0x325d13(_0xc23b2e);})[_0xa1eb('0xb')](function(_0x1c858c){_0x151580(_0x1c858c);});});}function _0x45d6dd(_0x211e42,_0x4aa527,_0xbd6a6b){if(!_0x4aa527)return Promise['resolve'](null);return new Promise(function(_0x1401ef,_0x3dafcd){return _0x56c5f2[_0xa1eb('0xf')][_0xa1eb('0xc')]({'where':{'sectionId':_0x4aa527['id']},'raw':!![]})['then'](function(_0x1dd621){if(_0x211e42[_0xa1eb('0x7')]&&_0x211e42[_0xa1eb('0x7')]!=='id'){_0x4aa527[_0xa1eb('0xa')]=_[_0xa1eb('0xd')](_0x1dd621,function(_0x3b8607){return _0x3b8607[_0x211e42[_0xa1eb('0x7')]];});}else{if(_0xbd6a6b===_0xa1eb('0x10')){_0x4aa527['associatedResources']=_[_0xa1eb('0xd')](_0x1dd621,function(_0x56653c){return{'id':_0x56653c[_0xa1eb('0x11')],'type':_0x56653c[_0xa1eb('0x12')]};});}else{_0x4aa527[_0xa1eb('0xa')]=_[_0xa1eb('0xd')](_0x1dd621,function(_0x5e7a34){return _0x5e7a34['resourceId'];});}}_0x1401ef(_0x4aa527);})[_0xa1eb('0xb')](function(_0xc64cb9){_0x3dafcd(_0xc64cb9);});});}function _0x5b0903(_0x437b2a,_0x250728){var _0x258d3a={'parentSections':[]};switch(_0x437b2a[_0xa1eb('0x13')]()){case _0xa1eb('0x14'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x16');break;case _0xa1eb('0x17'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x18');break;case _0xa1eb('0x19'):_0x258d3a[_0xa1eb('0x15')]='SquareRecording';_0x258d3a[_0xa1eb('0x1a')]=[{'name':_0xa1eb('0x1b'),'field':'name','foreignKey':_0xa1eb('0x1c')}];break;case'projects':_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x1d');break;case'contacts':_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x1e');_0x258d3a[_0xa1eb('0x1a')]=[{'name':'Lists','field':'id','foreignKey':_0xa1eb('0x1f')}];break;case _0xa1eb('0x20'):_0x258d3a['childModel']=_0xa1eb('0x21');break;case _0xa1eb('0x22'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x23');break;case _0xa1eb('0x24'):_0x258d3a['childModel']=_0xa1eb('0x25');break;case _0xa1eb('0x26'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x27');break;case _0xa1eb('0x28'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x29');break;case _0xa1eb('0x2a'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x2b');break;case _0xa1eb('0x2c'):_0x258d3a['childModel']='FaxAccount';break;case _0xa1eb('0x2d'):case _0xa1eb('0x2e'):case _0xa1eb('0x2f'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x30');break;case'contexts':_0x258d3a['childModel']=_0xa1eb('0x31');break;case _0xa1eb('0x32'):_0x258d3a['childModel']='VoiceMail';break;case _0xa1eb('0x33'):_0x258d3a['childModel']=_0xa1eb('0x34');_0x258d3a['parentSections']=[{'name':_0xa1eb('0x35'),'field':_0xa1eb('0xe'),'foreignKey':_0xa1eb('0x36'),'model':'User','filter':{'field':_0xa1eb('0x37'),'value':[_0xa1eb('0x38')]}},{'name':_0xa1eb('0x39'),'field':'name','foreignKey':_0xa1eb('0x36'),'model':_0xa1eb('0x3a'),'filter':{'field':_0xa1eb('0x37'),'value':[_0xa1eb('0x3b')]}},{'name':_0xa1eb('0x3c'),'field':'name','foreignKey':_0xa1eb('0x3d'),'model':_0xa1eb('0x3e'),'filter':{'field':_0xa1eb('0x12'),'value':[_0xa1eb('0x3f')]}},{'name':_0xa1eb('0x40'),'field':_0xa1eb('0xe'),'foreignKey':_0xa1eb('0x3d'),'model':_0xa1eb('0x3e'),'filter':{'field':'type','value':[_0xa1eb('0x41')]}}];break;case _0xa1eb('0x42'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x43');break;case _0xa1eb('0x44'):_0x258d3a['childModel']=_0xa1eb('0x45');break;case _0xa1eb('0x46'):_0x258d3a[_0xa1eb('0x15')]='VoicePrefix';break;case _0xa1eb('0x47'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x48');break;case _0xa1eb('0x49'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x4a');break;case _0xa1eb('0x4b'):_0x258d3a['childModel']=_0xa1eb('0x4c');break;case _0xa1eb('0x4d'):_0x258d3a['childModel']=_0xa1eb('0x4e');break;case'openchannelqueues':_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x4f');break;case _0xa1eb('0x50'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x51');break;case _0xa1eb('0x52'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x53');break;case _0xa1eb('0x54'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x55');break;case _0xa1eb('0x56'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x57');break;case _0xa1eb('0x58'):_0x258d3a[_0xa1eb('0x15')]='WhatsappAccount';break;case _0xa1eb('0x59'):_0x258d3a['childModel']=_0xa1eb('0x5a');break;case _0xa1eb('0x5b'):case'queuecampaigns':_0x258d3a['childModel']=_0xa1eb('0x3e');if(_0x250728){_0x258d3a[_0xa1eb('0x1a')]=[{'name':_0xa1eb('0x3c')},{'name':'QueueCampaigns'}];}break;case _0xa1eb('0x5c'):case _0xa1eb('0x5d'):case _0xa1eb('0x5e'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x3a');if(_0x250728){_0x258d3a[_0xa1eb('0x1a')]=[{'name':_0xa1eb('0x5f'),'filter':{'field':_0xa1eb('0x37'),'value':[_0xa1eb('0x60'),_0xa1eb('0x61')]},'ignore':!![]},{'name':_0xa1eb('0x35')},{'name':_0xa1eb('0x39')}];}break;case _0xa1eb('0x62'):_0x258d3a[_0xa1eb('0x15')]='ZendeskAccount';break;case _0xa1eb('0x63'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x64');break;case _0xa1eb('0x65'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x66');break;case _0xa1eb('0x67'):_0x258d3a['childModel']=_0xa1eb('0x68');break;case _0xa1eb('0x69'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x6a');break;case _0xa1eb('0x6b'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x6c');break;case _0xa1eb('0x6d'):_0x258d3a[_0xa1eb('0x15')]='User';break;case _0xa1eb('0x6e'):_0x258d3a['childModel']=_0xa1eb('0x6f');break;case'dispositions':_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x70');break;case _0xa1eb('0x71'):_0x258d3a['childModel']=_0xa1eb('0x72');break;case _0xa1eb('0x73'):_0x258d3a['childModel']=_0xa1eb('0x74');break;case _0xa1eb('0x75'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x76');break;case _0xa1eb('0x77'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x78');break;case _0xa1eb('0x79'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x7a');break;case _0xa1eb('0x7b'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x7c');break;case _0xa1eb('0x7d'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x7e');break;case _0xa1eb('0x7f'):_0x258d3a['childModel']=_0xa1eb('0x80');break;case _0xa1eb('0x81'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x82');break;case _0xa1eb('0x83'):_0x258d3a[_0xa1eb('0x15')]='Variable';break;case _0xa1eb('0x84'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x85');break;case _0xa1eb('0x86'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x10');_0x258d3a[_0xa1eb('0x1a')]=[{'name':'Reports','field':'id','foreignKey':_0xa1eb('0x87')}];break;case _0xa1eb('0x88'):_0x258d3a[_0xa1eb('0x15')]=_0xa1eb('0x89');break;}return _0x258d3a;}function _0x4c30ad(_0x5af1e6,_0x58ca4e){var _0x5673fa=_0x5af1e6[_0xa1eb('0x8a')](0x0)[_0xa1eb('0x8b')]()+_0x5af1e6['slice'](0x1);var _0x4643f3={'type':_0x56c5f2[_0xa1eb('0x8c')][_0xa1eb('0x8d')][_0xa1eb('0x8e')],'raw':!![]};return new Promise(function(_0x4edf8e,_0x481d19){var _0x201e6a=squel[_0xa1eb('0x8f')]()[_0xa1eb('0x7')](_0xa1eb('0x90')+_0x5673fa+_0xa1eb('0x91'),'id')[_0xa1eb('0x7')]('ui.createdAt')['from'](_0xa1eb('0x92')+_0x5af1e6+'_interactions','ui')[_0xa1eb('0x93')]('ui.UserId\x20=\x20?',_0x58ca4e['id']);return _0x56c5f2[_0xa1eb('0x94')][_0xa1eb('0x95')](_0x201e6a['toString'](),_0x4643f3)[_0xa1eb('0x9')](function(_0xf48372){_0x58ca4e[_0x5673fa+'OpenTabs']=_0xf48372;_0x4edf8e(_0xf48372);})[_0xa1eb('0xb')](function(_0x17feb5){_0x481d19(_0x17feb5);});});}return _0x5865fc[_0xa1eb('0x96')]('UserProfile',attributes,{'tableName':_0xa1eb('0x97'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x11e85f){var _0x4af59a={'raw':_0x11e85f[_0xa1eb('0x95')][_0xa1eb('0x98')],'where':{}};var _0x139a37={};var _0x4a0545={'count':0x0,'rows':[]};var _0x3a43c3=_0x11e85f['query'][_0xa1eb('0x99')];var _0x1ea97b=_0x11e85f[_0xa1eb('0x95')][_0xa1eb('0x9a')]||![];var _0x2df867=_0x5b0903(_0x3a43c3,_0x1ea97b);if(!_0x2df867['childModel'])throw new Error(_0xa1eb('0x9b')+_0x3a43c3+'\x27');var _0x401800=[{'name':_0x3a43c3}];if(!_[_0xa1eb('0x9c')](_0x2df867['parentSections']))_0x401800=_0x2df867[_0xa1eb('0x1a')];var _0x527921=[];for(var _0x4e582c=0x0;_0x4e582c<_0x401800['length'];_0x4e582c++){_0x527921['push'](_0x56c5f2[_0xa1eb('0x9d')][_0xa1eb('0x9e')]({'where':{'userProfileId':_0x11e85f[_0xa1eb('0x9f')]['id'],'name':_0x401800[_0x4e582c][_0xa1eb('0xe')]},'raw':!![]}));}return Promise[_0xa1eb('0xa0')](_0x527921)[_0xa1eb('0x9')](function(_0x11f031){var _0xc8cb66=_[_0xa1eb('0x6')](_0x11f031,function(_0x43d59b){return _0x43d59b?_0x43d59b:undefined;});var _0x5cf153=_[_0xa1eb('0x6')](_0x401800,[_0xa1eb('0xa1'),!![]]);var _0x46207c=_[_0xa1eb('0x9c')](_0xc8cb66)&&_[_0xa1eb('0x9c')](_0x5cf153)?null:_[_0xa1eb('0xa2')](_0x5cf153,_0xc8cb66);if(!_0x46207c)return null;var _0x4bf3c9=[];for(var _0x113a3a=0x0;_0x113a3a<_0x46207c[_0xa1eb('0xa3')];_0x113a3a++){var _0x16c5a3=_['find'](_0x401800,function(_0x1434a1){return _0x46207c[_0x113a3a]?_0x1434a1[_0xa1eb('0xe')]===_0x46207c[_0x113a3a][_0xa1eb('0xe')]:null;});if(_0x16c5a3){if(_0x46207c[_0x113a3a][_0xa1eb('0xa1')]){_0x4bf3c9[_0xa1eb('0xa4')](_0x34be5a(_0x2df867['childModel'],_0x46207c[_0x113a3a]));}else{if(!_0x46207c[_0x113a3a][_0xa1eb('0xa5')]){_0x4bf3c9['push'](_0x45d6dd(_0x16c5a3,_0x46207c[_0x113a3a],_0x2df867[_0xa1eb('0x15')]));}else{if(_0x16c5a3['model']){_0x4bf3c9[_0xa1eb('0xa4')](_0x41a7bc(_0x16c5a3,_0x46207c[_0x113a3a]));}}}}}return Promise[_0xa1eb('0xa0')](_0x4bf3c9);})[_0xa1eb('0x9')](function(_0x32cdfa){var _0x47c618=_0x32cdfa;var _0x3bc2e7=null;if(_0x47c618){_0x3bc2e7=_0x47c618[_0xa1eb('0xa3')]===0x1?_0x47c618[0x0]:null;}if(!_0x3bc2e7&&!_0x47c618)return _0x4a0545;var _0x2b8191=_0x56c5f2[_0x2df867[_0xa1eb('0x15')]]['rawAttributes'];_0x139a37[_0xa1eb('0xa6')]=_[_0xa1eb('0xa7')](_0x2b8191);_0x139a37[_0xa1eb('0x95')]=_[_0xa1eb('0xa7')](_0x11e85f[_0xa1eb('0x95')]);_0x139a37[_0xa1eb('0xa8')]=_[_0xa1eb('0xa9')](_0x139a37[_0xa1eb('0xa6')],_0x139a37[_0xa1eb('0x95')]);_0x4af59a['attributes']=_['intersection'](_0x139a37['model'],qs[_0xa1eb('0xaa')](_0x11e85f['query'][_0xa1eb('0xaa')]));_0x4af59a[_0xa1eb('0xab')]=_0x4af59a['attributes']['length']?_0x4af59a[_0xa1eb('0xab')]:_0x139a37[_0xa1eb('0xa6')];if(!_0x11e85f[_0xa1eb('0x95')][_0xa1eb('0xac')](_0xa1eb('0xad'))){_0x4af59a['limit']=qs['limit'](_0x11e85f[_0xa1eb('0x95')][_0xa1eb('0xae')]);_0x4af59a[_0xa1eb('0xaf')]=qs[_0xa1eb('0xaf')](_0x11e85f['query'][_0xa1eb('0xaf')]);}_0x4af59a[_0xa1eb('0xb0')]=qs[_0xa1eb('0xb1')](_0x11e85f[_0xa1eb('0x95')][_0xa1eb('0xb1')]);_0x4af59a[_0xa1eb('0x93')]=qs[_0xa1eb('0xa8')](_[_0xa1eb('0xb2')](_0x11e85f[_0xa1eb('0x95')],_0x139a37[_0xa1eb('0xa8')]));if(_0x11e85f[_0xa1eb('0x95')]['filter']){_0x4af59a[_0xa1eb('0x93')]=_[_0xa1eb('0xb3')](_0x4af59a[_0xa1eb('0x93')],{'$or':_[_0xa1eb('0xd')](_0x2b8191,function(_0x3fe7ef){if(_0x3fe7ef[_0xa1eb('0x12')]['key']!==_0xa1eb('0xb4')){var _0x36a94f={};_0x36a94f[_0x3fe7ef[_0xa1eb('0x7')]]={'$like':'%'+_0x11e85f[_0xa1eb('0x95')]['filter']+'%'};return _0x36a94f;}})});}var _0x4e24dc=[];var _0xff1843=null;var _0x5e0cd5={};if(_0x3bc2e7){_0xff1843=_[_0xa1eb('0x9e')](_0x401800,[_0xa1eb('0xe'),_0x3bc2e7['name']]);if(_0xff1843[_0xa1eb('0x7')]){_0x5e0cd5={};if(_0x2df867[_0xa1eb('0x15')]==='AnalyticExtractedReport'){_0x5e0cd5[_0xff1843[_0xa1eb('0xb5')]]=_[_0xa1eb('0xd')](_0x3bc2e7[_0xa1eb('0xa')],'id');}else{_0x5e0cd5[_0xff1843[_0xa1eb('0xb5')]]=_0x3bc2e7[_0xa1eb('0xa')];}_0x4e24dc[_0xa1eb('0xa4')](_0x5e0cd5);}else{_0x4af59a[_0xa1eb('0x93')]['id']=_0x3bc2e7[_0xa1eb('0xa')];}}else{for(var _0x3d32da=0x0;_0x3d32da<_0x47c618[_0xa1eb('0xa3')];_0x3d32da++){_0xff1843=_[_0xa1eb('0x9e')](_0x401800,['name',_0x47c618[_0x3d32da][_0xa1eb('0xe')]]);if(_0xff1843[_0xa1eb('0x7')]){_0x5e0cd5={};_0x5e0cd5[_0xff1843[_0xa1eb('0xb5')]]=_0x47c618[_0x3d32da][_0xa1eb('0xa')];_0x4e24dc['push'](_0x5e0cd5);}else{if(!_0x4af59a[_0xa1eb('0x93')]['id'])_0x4af59a[_0xa1eb('0x93')]['id']=[];_0x47c618[_0x3d32da][_0xa1eb('0xa')]['forEach'](function(_0x214913){_0x4af59a[_0xa1eb('0x93')]['id'][_0xa1eb('0xa4')](_0x214913);});}}}if(!_['isEmpty'](_0x4e24dc)){_0x4af59a[_0xa1eb('0x93')]=_['merge'](_0x4af59a[_0xa1eb('0x93')],{'$and':{'$or':_0x4e24dc}});}_0x4af59a=_[_0xa1eb('0xb3')]({},_0x4af59a,_0x11e85f[_0xa1eb('0xb6')]);if(_0x3bc2e7&&!_0x3bc2e7[_0xa1eb('0xa5')]&&_0x2df867[_0xa1eb('0x15')]===_0xa1eb('0x10')){if(_0x11e85f[_0xa1eb('0x95')][_0xa1eb('0xb7')]){_0x4af59a['include']=[{'all':!![]}];}return _0x56c5f2[_0x2df867[_0xa1eb('0x15')]][_0xa1eb('0xc')](_0x4af59a)[_0xa1eb('0x9')](function(_0x3ae7e1){var _0x454320=[];_0x3ae7e1['forEach'](function(_0x140475){var _0x2a9f79;switch(_0x140475['reportType']){case _0xa1eb('0xb8'):_0x2a9f79=_['find'](_0x3bc2e7['associatedResources'],function(_0x29f795){return _0x29f795['id']===_0x140475[_0xa1eb('0x87')]&&_0x29f795['type']===_0xa1eb('0xb9');});break;case _0xa1eb('0xba'):_0x2a9f79=_['find'](_0x3bc2e7[_0xa1eb('0xa')],function(_0x2c49d1){return _0x2c49d1['id']===_0x140475['reportId']&&_0x2c49d1['type']===_0xa1eb('0xbb');});break;}if(_0x2a9f79)_0x454320['push'](_0x140475);});_0x4a0545[_0xa1eb('0xbc')]=_0x454320[_0xa1eb('0xa3')];_0x4a0545[_0xa1eb('0xbd')]=_0x454320;return _0x4a0545;});}else{if(!_[_0xa1eb('0x9c')](_0x11e85f[_0xa1eb('0x95')][_0xa1eb('0xbe')])){_0x4af59a['where']['id']=_0x4af59a[_0xa1eb('0x93')]['id']?_['intersection'](_0x4af59a[_0xa1eb('0x93')]['id'],_0x11e85f[_0xa1eb('0x95')][_0xa1eb('0xbe')]):_0x11e85f[_0xa1eb('0x95')][_0xa1eb('0xbe')];}return _0x56c5f2[_0x2df867[_0xa1eb('0x15')]][_0xa1eb('0xbc')]({'where':_0x4af59a['where']})[_0xa1eb('0x9')](function(_0x4effc0){_0x4a0545['count']=_0x4effc0;if(_0x11e85f[_0xa1eb('0x95')][_0xa1eb('0xb7')]){if(_0x2df867[_0xa1eb('0x15')]===_0xa1eb('0x1e')){_0x4af59a[_0xa1eb('0xbf')]=[{'model':_0x56c5f2[_0xa1eb('0x7c')],'as':'Tags','attributes':['id',_0xa1eb('0xe'),'color'],'required':_0x11e85f[_0xa1eb('0x95')]['tag']?!![]:![]},{'model':_0x56c5f2[_0xa1eb('0x7c')],'as':_0xa1eb('0xc0'),'attributes':['id','name','color'],'through':_0x11e85f[_0xa1eb('0x95')][_0xa1eb('0xc1')]?{'attributes':[],'where':{'TagId':_0x11e85f[_0xa1eb('0x95')][_0xa1eb('0xc1')]||undefined}}:{},'required':_0x11e85f[_0xa1eb('0x95')][_0xa1eb('0xc1')]?!![]:![]}];}else{_0x4af59a[_0xa1eb('0xbf')]=[{'all':!![]}];}}return _0x56c5f2[_0x2df867[_0xa1eb('0x15')]][_0xa1eb('0xc')](_0x4af59a);})[_0xa1eb('0x9')](function(_0x2fc881){_0x4a0545[_0xa1eb('0xbd')]=_0x2fc881;if(_0x3a43c3===_0xa1eb('0x35')&&_0x11e85f[_0xa1eb('0x95')][_0xa1eb('0xc2')]==='true'){var _0x2593b5=[];for(var _0x34d84d=0x0;_0x34d84d<_0x4a0545['rows'][_0xa1eb('0xa3')];_0x34d84d++){_0x2593b5['push'](_0x4c30ad(_0xa1eb('0xc3'),_0x4a0545[_0xa1eb('0xbd')][_0x34d84d][_0xa1eb('0xc4')]));_0x2593b5['push'](_0x4c30ad(_0xa1eb('0xc5'),_0x4a0545[_0xa1eb('0xbd')][_0x34d84d][_0xa1eb('0xc4')]));_0x2593b5[_0xa1eb('0xa4')](_0x4c30ad('fax',_0x4a0545[_0xa1eb('0xbd')][_0x34d84d]['dataValues']));_0x2593b5[_0xa1eb('0xa4')](_0x4c30ad(_0xa1eb('0xc6'),_0x4a0545[_0xa1eb('0xbd')][_0x34d84d][_0xa1eb('0xc4')]));_0x2593b5[_0xa1eb('0xa4')](_0x4c30ad(_0xa1eb('0xc7'),_0x4a0545[_0xa1eb('0xbd')][_0x34d84d][_0xa1eb('0xc4')]));_0x2593b5['push'](_0x4c30ad(_0xa1eb('0xc8'),_0x4a0545[_0xa1eb('0xbd')][_0x34d84d][_0xa1eb('0xc4')]));}return Promise[_0xa1eb('0xa0')](_0x2593b5)[_0xa1eb('0x9')](function(){return _0x4a0545;});}return _0x4a0545;});}});}}});};
\ No newline at end of file
index 6e2cee8..69cd3a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d0a=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','stringify','error','UserProfile,\x20%s,\x20%s','message','result','lodash','moment'];(function(_0x110636,_0x5854fd){var _0x49d076=function(_0x5f47d7){while(--_0x5f47d7){_0x110636['push'](_0x110636['shift']());}};_0x49d076(++_0x5854fd);}(_0x5d0a,0x175));var _0xa5d0=function(_0x422121,_0x11a93a){_0x422121=_0x422121-0x0;var _0x46fd4f=_0x5d0a[_0x422121];return _0x46fd4f;};'use strict';var _=require(_0xa5d0('0x0'));var util=require('util');var moment=require(_0xa5d0('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5d0('0x2'));var fs=require('fs');var Redis=require(_0xa5d0('0x3'));var db=require(_0xa5d0('0x4'))['db'];var utils=require(_0xa5d0('0x5'));var logger=require('../../config/logger')(_0xa5d0('0x6'));var config=require(_0xa5d0('0x7'));var jayson=require(_0xa5d0('0x8'));var client=jayson[_0xa5d0('0x9')][_0xa5d0('0xa')]({'port':0x232a});config[_0xa5d0('0xb')]=_[_0xa5d0('0xc')](config[_0xa5d0('0xb')],{'host':_0xa5d0('0xd'),'port':0x18eb});var socket=require(_0xa5d0('0xe'))(new Redis(config[_0xa5d0('0xb')]));require('./userProfile.socket')[_0xa5d0('0xf')](socket);function respondWithRpcPromise(_0x29a3c1,_0x1f4235,_0x23e569){return new BPromise(function(_0x14fea2,_0x23f06a){return client[_0xa5d0('0x10')](_0x29a3c1,_0x23e569)[_0xa5d0('0x11')](function(_0xc847c9){logger[_0xa5d0('0x12')]('UserProfile,\x20%s,\x20%s',_0x1f4235,_0xa5d0('0x13'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x1f4235,_0xa5d0('0x13'),JSON[_0xa5d0('0x14')](_0xc847c9));if(_0xc847c9[_0xa5d0('0x15')]){if(_0xc847c9[_0xa5d0('0x15')]['code']===0x1f4){logger['error'](_0xa5d0('0x16'),_0x1f4235,_0xc847c9[_0xa5d0('0x15')][_0xa5d0('0x17')]);return _0x23f06a(_0xc847c9[_0xa5d0('0x15')][_0xa5d0('0x17')]);}logger[_0xa5d0('0x15')](_0xa5d0('0x16'),_0x1f4235,_0xc847c9['error'][_0xa5d0('0x17')]);return _0x14fea2(_0xc847c9['error'][_0xa5d0('0x17')]);}else{logger[_0xa5d0('0x12')]('UserProfile,\x20%s,\x20%s',_0x1f4235,'request\x20sent');_0x14fea2(_0xc847c9[_0xa5d0('0x18')][_0xa5d0('0x17')]);}})['catch'](function(_0x39beba){logger[_0xa5d0('0x15')](_0xa5d0('0x16'),_0x1f4235,_0x39beba);_0x23f06a(_0x39beba);});});}
\ No newline at end of file
+var _0xaa64=['socket.io-emitter','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0xda8cc9,_0x3efe96){var _0x586c46=function(_0x53fbee){while(--_0x53fbee){_0xda8cc9['push'](_0xda8cc9['shift']());}};_0x586c46(++_0x3efe96);}(_0xaa64,0xf7));var _0x4aa6=function(_0x79c3,_0x3035d7){_0x79c3=_0x79c3-0x0;var _0x2e2f49=_0xaa64[_0x79c3];return _0x2e2f49;};'use strict';var _=require(_0x4aa6('0x0'));var util=require(_0x4aa6('0x1'));var moment=require('moment');var BPromise=require(_0x4aa6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4aa6('0x3'));var db=require(_0x4aa6('0x4'))['db'];var utils=require(_0x4aa6('0x5'));var logger=require('../../config/logger')(_0x4aa6('0x6'));var config=require(_0x4aa6('0x7'));var jayson=require(_0x4aa6('0x8'));var client=jayson[_0x4aa6('0x9')][_0x4aa6('0xa')]({'port':0x232a});config[_0x4aa6('0xb')]=_[_0x4aa6('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4aa6('0xd'))(new Redis(config[_0x4aa6('0xb')]));require('./userProfile.socket')[_0x4aa6('0xe')](socket);function respondWithRpcPromise(_0x521ae3,_0x1df231,_0xf48bbb){return new BPromise(function(_0x205770,_0x136e55){return client['request'](_0x521ae3,_0xf48bbb)[_0x4aa6('0xf')](function(_0x1d23d2){logger[_0x4aa6('0x10')](_0x4aa6('0x11'),_0x1df231,_0x4aa6('0x12'));logger[_0x4aa6('0x13')](_0x4aa6('0x14'),_0x1df231,_0x4aa6('0x12'),JSON[_0x4aa6('0x15')](_0x1d23d2));if(_0x1d23d2[_0x4aa6('0x16')]){if(_0x1d23d2['error'][_0x4aa6('0x17')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x1df231,_0x1d23d2[_0x4aa6('0x16')][_0x4aa6('0x18')]);return _0x136e55(_0x1d23d2[_0x4aa6('0x16')][_0x4aa6('0x18')]);}logger[_0x4aa6('0x16')](_0x4aa6('0x11'),_0x1df231,_0x1d23d2[_0x4aa6('0x16')][_0x4aa6('0x18')]);return _0x205770(_0x1d23d2['error'][_0x4aa6('0x18')]);}else{logger['info'](_0x4aa6('0x11'),_0x1df231,'request\x20sent');_0x205770(_0x1d23d2['result'][_0x4aa6('0x18')]);}})[_0x4aa6('0x19')](function(_0x2458fd){logger[_0x4aa6('0x16')](_0x4aa6('0x11'),_0x1df231,_0x2458fd);_0x136e55(_0x2458fd);});});}
\ No newline at end of file
index d005245..3379a3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1a3=['./userProfile.events','save','update','removeListener','register','length','userProfile:'];(function(_0x5536f4,_0x81083d){var _0x2509dd=function(_0x4a0fbc){while(--_0x4a0fbc){_0x5536f4['push'](_0x5536f4['shift']());}};_0x2509dd(++_0x81083d);}(_0xf1a3,0x181));var _0x3f1a=function(_0x387dc1,_0x3ba649){_0x387dc1=_0x387dc1-0x0;var _0x17567c=_0xf1a3[_0x387dc1];return _0x17567c;};'use strict';var UserProfileEvents=require(_0x3f1a('0x0'));var events=[_0x3f1a('0x1'),'remove',_0x3f1a('0x2')];function createListener(_0x43be60,_0x2701ec){return function(_0x4800dd){_0x2701ec['emit'](_0x43be60,_0x4800dd);};}function removeListener(_0x13a0c6,_0x47ccc0){return function(){UserProfileEvents[_0x3f1a('0x3')](_0x13a0c6,_0x47ccc0);};}exports[_0x3f1a('0x4')]=function(_0x3f65d6){for(var _0x570b00=0x0,_0x3ebcf7=events[_0x3f1a('0x5')];_0x570b00<_0x3ebcf7;_0x570b00++){var _0x222a95=events[_0x570b00];var _0x12b71b=createListener(_0x3f1a('0x6')+_0x222a95,_0x3f65d6);UserProfileEvents['on'](_0x222a95,_0x12b71b);}};
\ No newline at end of file
+var _0x2fc2=['remove','update','removeListener','register','length','userProfile:','./userProfile.events','save'];(function(_0xd796a9,_0x2561a4){var _0x3b9040=function(_0x437a10){while(--_0x437a10){_0xd796a9['push'](_0xd796a9['shift']());}};_0x3b9040(++_0x2561a4);}(_0x2fc2,0x136));var _0x22fc=function(_0x3652c6,_0x569936){_0x3652c6=_0x3652c6-0x0;var _0xb28571=_0x2fc2[_0x3652c6];return _0xb28571;};'use strict';var UserProfileEvents=require(_0x22fc('0x0'));var events=[_0x22fc('0x1'),_0x22fc('0x2'),_0x22fc('0x3')];function createListener(_0x3a9ea4,_0x3e3487){return function(_0xc1520f){_0x3e3487['emit'](_0x3a9ea4,_0xc1520f);};}function removeListener(_0x1cbe75,_0xca83b2){return function(){UserProfileEvents[_0x22fc('0x4')](_0x1cbe75,_0xca83b2);};}exports[_0x22fc('0x5')]=function(_0x3f3afa){for(var _0xfe2550=0x0,_0x1eb3a9=events[_0x22fc('0x6')];_0xfe2550<_0x1eb3a9;_0xfe2550++){var _0xd8d78e=events[_0xfe2550];var _0x3b40d4=createListener(_0x22fc('0x7')+_0xd8d78e,_0x3f3afa);UserProfileEvents['on'](_0xd8d78e,_0x3b40d4);}};
\ No newline at end of file
index 4b35d4e..0ada954 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a6d=['get','index','describe','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x410b4a,_0x524c7b){var _0x10d51e=function(_0x42427e){while(--_0x42427e){_0x410b4a['push'](_0x410b4a['shift']());}};_0x10d51e(++_0x524c7b);}(_0x4a6d,0x1d8));var _0xd4a6=function(_0x6b9430,_0x520ed5){_0x6b9430=_0x6b9430-0x0;var _0x59509d=_0x4a6d[_0x6b9430];return _0x59509d;};'use strict';var multer=require('multer');var util=require(_0xd4a6('0x0'));var path=require('path');var timeout=require(_0xd4a6('0x1'));var express=require(_0xd4a6('0x2'));var router=express[_0xd4a6('0x3')]();var fs_extra=require(_0xd4a6('0x4'));var auth=require(_0xd4a6('0x5'));var interaction=require(_0xd4a6('0x6'));var config=require(_0xd4a6('0x7'));var controller=require('./userProfileResource.controller');router[_0xd4a6('0x8')]('/',auth['isAuthenticated'](),controller[_0xd4a6('0x9')]);router[_0xd4a6('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xd4a6('0xa')]);router[_0xd4a6('0x8')](_0xd4a6('0xb'),auth[_0xd4a6('0xc')](),controller[_0xd4a6('0xd')]);router[_0xd4a6('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd4a6('0xf')]('/:id',auth[_0xd4a6('0xc')](),controller[_0xd4a6('0x10')]);router[_0xd4a6('0x11')](_0xd4a6('0xb'),auth['isAuthenticated'](),controller[_0xd4a6('0x12')]);module[_0xd4a6('0x13')]=router;
\ No newline at end of file
+var _0xa469=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','create','put','update','exports','util','path'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xa469,0xa0));var _0x9a46=function(_0x3007ee,_0x1fd67c){_0x3007ee=_0x3007ee-0x0;var _0x54735c=_0xa469[_0x3007ee];return _0x54735c;};'use strict';var multer=require('multer');var util=require(_0x9a46('0x0'));var path=require(_0x9a46('0x1'));var timeout=require(_0x9a46('0x2'));var express=require(_0x9a46('0x3'));var router=express[_0x9a46('0x4')]();var fs_extra=require(_0x9a46('0x5'));var auth=require(_0x9a46('0x6'));var interaction=require(_0x9a46('0x7'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router['get']('/',auth[_0x9a46('0x8')](),controller[_0x9a46('0x9')]);router[_0x9a46('0xa')](_0x9a46('0xb'),auth['isAuthenticated'](),controller[_0x9a46('0xc')]);router[_0x9a46('0xa')](_0x9a46('0xd'),auth[_0x9a46('0x8')](),controller['show']);router['post']('/',auth[_0x9a46('0x8')](),controller[_0x9a46('0xe')]);router[_0x9a46('0xf')](_0x9a46('0xd'),auth['isAuthenticated'](),controller[_0x9a46('0x10')]);router['delete'](_0x9a46('0xd'),auth[_0x9a46('0x8')](),controller['destroy']);module[_0x9a46('0x11')]=router;
\ No newline at end of file
index 4629f1b..cb4e55a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce60=['INTEGER','sequelize','exports','STRING'];(function(_0x1b8d1e,_0x2c7fa8){var _0x5a7483=function(_0x4ee4b8){while(--_0x4ee4b8){_0x1b8d1e['push'](_0x1b8d1e['shift']());}};_0x5a7483(++_0x2c7fa8);}(_0xce60,0x7d));var _0x0ce6=function(_0x1d8119,_0xc98f17){_0x1d8119=_0x1d8119-0x0;var _0x3e30f6=_0xce60[_0x1d8119];return _0x3e30f6;};'use strict';var Sequelize=require(_0x0ce6('0x0'));module[_0x0ce6('0x1')]={'name':{'type':Sequelize[_0x0ce6('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0ce6('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x19a1=['INTEGER','sequelize','exports','STRING'];(function(_0x18ddd4,_0x284715){var _0xe3f972=function(_0x42f09e){while(--_0x42f09e){_0x18ddd4['push'](_0x18ddd4['shift']());}};_0xe3f972(++_0x284715);}(_0x19a1,0x19d));var _0x119a=function(_0x11b3bf,_0xca12c){_0x11b3bf=_0x11b3bf-0x0;var _0x2eeb8b=_0x19a1[_0x11b3bf];return _0x2eeb8b;};'use strict';var Sequelize=require(_0x119a('0x0'));module[_0x119a('0x1')]={'name':{'type':Sequelize[_0x119a('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x119a('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index c006190..b6dc97f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33af=['findAll','rows','catch','show','params','length','include','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','merge','VIRTUAL','filter','includeAll'];(function(_0x596a98,_0x544d1c){var _0x1db400=function(_0x532613){while(--_0x532613){_0x596a98['push'](_0x596a98['shift']());}};_0x1db400(++_0x544d1c);}(_0x33af,0xec));var _0xf33a=function(_0x3dd8dd,_0x369f8e){_0x3dd8dd=_0x3dd8dd-0x0;var _0x33e300=_0x33af[_0x3dd8dd];return _0x33e300;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf33a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf33a('0x1'));var rp=require(_0xf33a('0x2'));var moment=require(_0xf33a('0x3'));var BPromise=require(_0xf33a('0x4'));var Mustache=require(_0xf33a('0x5'));var util=require(_0xf33a('0x6'));var path=require('path');var sox=require(_0xf33a('0x7'));var csv=require(_0xf33a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf33a('0x9'));var _=require(_0xf33a('0xa'));var squel=require(_0xf33a('0xb'));var crypto=require(_0xf33a('0xc'));var jsforce=require(_0xf33a('0xd'));var deskjs=require(_0xf33a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf33a('0xf'));var Papa=require(_0xf33a('0x10'));var Redis=require(_0xf33a('0x11'));var authService=require(_0xf33a('0x12'));var qs=require(_0xf33a('0x13'));var as=require(_0xf33a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf33a('0x15'));var utils=require(_0xf33a('0x16'));var config=require(_0xf33a('0x17'));var licenseUtil=require(_0xf33a('0x18'));var db=require(_0xf33a('0x19'))['db'];function respondWithStatusCode(_0x5959c9,_0x9f87bc){_0x9f87bc=_0x9f87bc||0xcc;return function(_0x21b80e){if(_0x21b80e){return _0x5959c9['sendStatus'](_0x9f87bc);}return _0x5959c9['status'](_0x9f87bc)[_0xf33a('0x1a')]();};}function respondWithResult(_0x1b3bf0,_0x17043){_0x17043=_0x17043||0xc8;return function(_0x153bda){if(_0x153bda){return _0x1b3bf0[_0xf33a('0x1b')](_0x17043)[_0xf33a('0x1c')](_0x153bda);}};}function respondWithFilteredResult(_0x45e311,_0x1f2b1b){return function(_0x507cb9){if(_0x507cb9){var _0x441f59=typeof _0x1f2b1b['offset']===_0xf33a('0x1d')&&typeof _0x1f2b1b[_0xf33a('0x1e')]==='undefined';var _0x37e76c=_0x507cb9[_0xf33a('0x1f')];var _0x524109=_0x441f59?0x0:_0x1f2b1b[_0xf33a('0x20')];var _0x23d9e2=_0x441f59?_0x507cb9[_0xf33a('0x1f')]:_0x1f2b1b[_0xf33a('0x20')]+_0x1f2b1b['limit'];var _0x11efa0;if(_0x23d9e2>=_0x37e76c){_0x23d9e2=_0x37e76c;_0x11efa0=0xc8;}else{_0x11efa0=0xce;}_0x45e311[_0xf33a('0x1b')](_0x11efa0);return _0x45e311[_0xf33a('0x21')](_0xf33a('0x22'),_0x524109+'-'+_0x23d9e2+'/'+_0x37e76c)[_0xf33a('0x1c')](_0x507cb9);}return null;};}function patchUpdates(_0x6cdf7b){return function(_0x19986f){try{jsonpatch[_0xf33a('0x23')](_0x19986f,_0x6cdf7b,!![]);}catch(_0x19055e){return BPromise[_0xf33a('0x24')](_0x19055e);}return _0x19986f['save']();};}function saveUpdates(_0x3854b4,_0x272e60){return function(_0x1bf9bc){if(_0x1bf9bc){return _0x1bf9bc[_0xf33a('0x25')](_0x3854b4)[_0xf33a('0x26')](function(_0x51d3fd){return _0x51d3fd;});}return null;};}function removeEntity(_0x44654c,_0x5882ba){return function(_0x492986){if(_0x492986){return _0x492986[_0xf33a('0x27')]()[_0xf33a('0x26')](function(){_0x44654c[_0xf33a('0x1b')](0xcc)[_0xf33a('0x1a')]();});}};}function handleEntityNotFound(_0x4b9801,_0x57cb1d){return function(_0x393005){if(!_0x393005){_0x4b9801['sendStatus'](0x194);}return _0x393005;};}function handleError(_0x4af24a,_0x16ef31){_0x16ef31=_0x16ef31||0x1f4;return function(_0x5f0a53){logger['error'](_0x5f0a53[_0xf33a('0x28')]);if(_0x5f0a53['name']){delete _0x5f0a53[_0xf33a('0x29')];}_0x4af24a['status'](_0x16ef31)[_0xf33a('0x2a')](_0x5f0a53);};}exports[_0xf33a('0x2b')]=function(_0x469741,_0x729fca){var _0x4552c9={},_0x3068a9={},_0x1d19ee={'count':0x0,'rows':[]};var _0x1246ff=_[_0xf33a('0x2c')](db[_0xf33a('0x2d')][_0xf33a('0x2e')],function(_0x8f8ddc){return{'name':_0x8f8ddc[_0xf33a('0x2f')],'type':_0x8f8ddc[_0xf33a('0x30')][_0xf33a('0x31')]};});_0x3068a9['model']=_[_0xf33a('0x2c')](_0x1246ff,_0xf33a('0x29'));_0x3068a9[_0xf33a('0x32')]=_[_0xf33a('0x33')](_0x469741['query']);_0x3068a9[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x3068a9[_0xf33a('0x36')],_0x3068a9[_0xf33a('0x32')]);_0x4552c9[_0xf33a('0x37')]=_[_0xf33a('0x35')](_0x3068a9['model'],qs[_0xf33a('0x38')](_0x469741[_0xf33a('0x32')][_0xf33a('0x38')]));_0x4552c9[_0xf33a('0x37')]=_0x4552c9[_0xf33a('0x37')]['length']?_0x4552c9['attributes']:_0x3068a9[_0xf33a('0x36')];if(!_0x469741['query']['hasOwnProperty']('nolimit')){_0x4552c9[_0xf33a('0x1e')]=qs[_0xf33a('0x1e')](_0x469741['query'][_0xf33a('0x1e')]);_0x4552c9['offset']=qs[_0xf33a('0x20')](_0x469741[_0xf33a('0x32')][_0xf33a('0x20')]);}_0x4552c9[_0xf33a('0x39')]=qs[_0xf33a('0x3a')](_0x469741[_0xf33a('0x32')]['sort']);_0x4552c9[_0xf33a('0x3b')]=qs[_0xf33a('0x34')](_['pick'](_0x469741[_0xf33a('0x32')],_0x3068a9[_0xf33a('0x34')]),_0x1246ff);if(_0x469741[_0xf33a('0x32')]['filter']){_0x4552c9[_0xf33a('0x3b')]=_[_0xf33a('0x3c')](_0x4552c9[_0xf33a('0x3b')],{'$or':_[_0xf33a('0x2c')](_0x1246ff,function(_0x3ec562){if(_0x3ec562[_0xf33a('0x30')]!==_0xf33a('0x3d')){var _0x128baf={};_0x128baf[_0x3ec562[_0xf33a('0x29')]]={'$like':'%'+_0x469741['query'][_0xf33a('0x3e')]+'%'};return _0x128baf;}})});}_0x4552c9=_[_0xf33a('0x3c')]({},_0x4552c9,_0x469741['options']);var _0x1e8800={'where':_0x4552c9['where']};return db['UserProfileResource'][_0xf33a('0x1f')](_0x1e8800)[_0xf33a('0x26')](function(_0x4dada1){_0x1d19ee[_0xf33a('0x1f')]=_0x4dada1;if(_0x469741[_0xf33a('0x32')][_0xf33a('0x3f')]){_0x4552c9['include']=[{'all':!![]}];}return db[_0xf33a('0x2d')][_0xf33a('0x40')](_0x4552c9);})['then'](function(_0x1e9748){_0x1d19ee[_0xf33a('0x41')]=_0x1e9748;return _0x1d19ee;})[_0xf33a('0x26')](respondWithFilteredResult(_0x729fca,_0x4552c9))[_0xf33a('0x42')](handleError(_0x729fca,null));};exports[_0xf33a('0x43')]=function(_0x5044f9,_0x45ae15){var _0x1722e5={'raw':![],'where':{'id':_0x5044f9[_0xf33a('0x44')]['id']}},_0x2325eb={};_0x2325eb[_0xf33a('0x36')]=_['keys'](db[_0xf33a('0x2d')][_0xf33a('0x2e')]);_0x2325eb[_0xf33a('0x32')]=_['keys'](_0x5044f9[_0xf33a('0x32')]);_0x2325eb[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x2325eb[_0xf33a('0x36')],_0x2325eb[_0xf33a('0x32')]);_0x1722e5[_0xf33a('0x37')]=_['intersection'](_0x2325eb[_0xf33a('0x36')],qs[_0xf33a('0x38')](_0x5044f9[_0xf33a('0x32')][_0xf33a('0x38')]));_0x1722e5[_0xf33a('0x37')]=_0x1722e5['attributes'][_0xf33a('0x45')]?_0x1722e5[_0xf33a('0x37')]:_0x2325eb[_0xf33a('0x36')];if(_0x5044f9['query'][_0xf33a('0x3f')]){_0x1722e5[_0xf33a('0x46')]=[{'all':!![]}];}_0x1722e5=_['merge']({},_0x1722e5,_0x5044f9['options']);return db[_0xf33a('0x2d')]['find'](_0x1722e5)[_0xf33a('0x26')](handleEntityNotFound(_0x45ae15,null))[_0xf33a('0x26')](respondWithResult(_0x45ae15,null))[_0xf33a('0x42')](handleError(_0x45ae15,null));};exports[_0xf33a('0x47')]=function(_0xecc82f,_0x1a98f9){return db[_0xf33a('0x2d')][_0xf33a('0x47')](_0xecc82f[_0xf33a('0x48')],{})[_0xf33a('0x26')](respondWithResult(_0x1a98f9,0xc9))[_0xf33a('0x42')](handleError(_0x1a98f9,null));};exports[_0xf33a('0x25')]=function(_0x190a2b,_0x6b79da){if(_0x190a2b[_0xf33a('0x48')]['id']){delete _0x190a2b[_0xf33a('0x48')]['id'];}return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x190a2b[_0xf33a('0x44')]['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x6b79da,null))[_0xf33a('0x26')](saveUpdates(_0x190a2b[_0xf33a('0x48')],null))[_0xf33a('0x26')](respondWithResult(_0x6b79da,null))[_0xf33a('0x42')](handleError(_0x6b79da,null));};exports[_0xf33a('0x27')]=function(_0x1b15a1,_0x3bab07){return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x1b15a1['params']['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x3bab07,null))[_0xf33a('0x26')](removeEntity(_0x3bab07,null))['catch'](handleError(_0x3bab07,null));};exports[_0xf33a('0x4a')]=function(_0xd40707,_0x36cba8){return db['UserProfileResource'][_0xf33a('0x4a')]()[_0xf33a('0x26')](respondWithResult(_0x36cba8,null))[_0xf33a('0x42')](handleError(_0x36cba8,null));};
\ No newline at end of file
+var _0x7a54=['set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','UserProfileResource','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x62f95,_0x1212e8){var _0x1774fb=function(_0x18150b){while(--_0x18150b){_0x62f95['push'](_0x62f95['shift']());}};_0x1774fb(++_0x1212e8);}(_0x7a54,0x106));var _0x47a5=function(_0x20258e,_0x586b6a){_0x20258e=_0x20258e-0x0;var _0x117761=_0x7a54[_0x20258e];return _0x117761;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['UserProfileResource'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['UserProfileResource']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['UserProfileResource']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x48')]=function(_0x1c9a62,_0x5f6a){return db['UserProfileResource'][_0x47a5('0x48')]()['then'](respondWithResult(_0x5f6a,null))[_0x47a5('0x46')](handleError(_0x5f6a,null));};
\ No newline at end of file
index de64ee0..a9fbacd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdd7=['define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userProfileResource.attributes'];(function(_0x220afa,_0xf5f6cc){var _0x1b79d1=function(_0x178a39){while(--_0x178a39){_0x220afa['push'](_0x220afa['shift']());}};_0x1b79d1(++_0xf5f6cc);}(_0xcdd7,0x155));var _0x7cdd=function(_0x454995,_0x13cd60){_0x454995=_0x454995-0x0;var _0x5c2279=_0xcdd7[_0x454995];return _0x5c2279;};'use strict';var _=require('lodash');var util=require(_0x7cdd('0x0'));var logger=require(_0x7cdd('0x1'))(_0x7cdd('0x2'));var moment=require(_0x7cdd('0x3'));var BPromise=require(_0x7cdd('0x4'));var rp=require(_0x7cdd('0x5'));var fs=require('fs');var path=require(_0x7cdd('0x6'));var rimraf=require(_0x7cdd('0x7'));var config=require('../../config/environment');var attributes=require(_0x7cdd('0x8'));module['exports']=function(_0xda8596,_0x2b7e5b){return _0xda8596[_0x7cdd('0x9')](_0x7cdd('0xa'),attributes,{'tableName':_0x7cdd('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x7cdd('0xc'),_0x7cdd('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xffec=['define','user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./userProfileResource.attributes'];(function(_0x4e04e6,_0x52ba4a){var _0x47bdd4=function(_0x4a15fc){while(--_0x4a15fc){_0x4e04e6['push'](_0x4e04e6['shift']());}};_0x47bdd4(++_0x52ba4a);}(_0xffec,0x118));var _0xcffe=function(_0x3c025f,_0x14763a){_0x3c025f=_0x3c025f-0x0;var _0x120de5=_0xffec[_0x3c025f];return _0x120de5;};'use strict';var _=require(_0xcffe('0x0'));var util=require(_0xcffe('0x1'));var logger=require(_0xcffe('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcffe('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcffe('0x4'));var rimraf=require(_0xcffe('0x5'));var config=require(_0xcffe('0x6'));var attributes=require(_0xcffe('0x7'));module['exports']=function(_0x10ff90,_0x8f7546){return _0x10ff90[_0xcffe('0x8')]('UserProfileResource',attributes,{'tableName':_0xcffe('0x9'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xcffe('0xa'),_0xcffe('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 7e0704e..3e0d33b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda7f=['result','catch','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0xda7f,0x11a));var _0xfda7=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0xda7f[_0xc14df7];return _0x34a445;};'use strict';var _=require('lodash');var util=require(_0xfda7('0x0'));var moment=require('moment');var BPromise=require(_0xfda7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda7('0x2'))['db'];var utils=require(_0xfda7('0x3'));var logger=require('../../config/logger')(_0xfda7('0x4'));var config=require(_0xfda7('0x5'));var jayson=require(_0xfda7('0x6'));var client=jayson[_0xfda7('0x7')][_0xfda7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58e7d3,_0x39bcea,_0x44faa3){return new BPromise(function(_0x4d1414,_0x583c48){return client['request'](_0x58e7d3,_0x44faa3)['then'](function(_0x4e0ef3){logger[_0xfda7('0x9')](_0xfda7('0xa'),_0x39bcea,_0xfda7('0xb'));logger[_0xfda7('0xc')](_0xfda7('0xd'),_0x39bcea,'request\x20sent',JSON[_0xfda7('0xe')](_0x4e0ef3));if(_0x4e0ef3['error']){if(_0x4e0ef3['error'][_0xfda7('0xf')]===0x1f4){logger[_0xfda7('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x39bcea,_0x4e0ef3[_0xfda7('0x10')][_0xfda7('0x11')]);return _0x583c48(_0x4e0ef3[_0xfda7('0x10')][_0xfda7('0x11')]);}logger[_0xfda7('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x39bcea,_0x4e0ef3[_0xfda7('0x10')][_0xfda7('0x11')]);return _0x4d1414(_0x4e0ef3[_0xfda7('0x10')][_0xfda7('0x11')]);}else{logger[_0xfda7('0x9')](_0xfda7('0xa'),_0x39bcea,'request\x20sent');_0x4d1414(_0x4e0ef3[_0xfda7('0x12')][_0xfda7('0x11')]);}})[_0xfda7('0x13')](function(_0x2ca464){logger[_0xfda7('0x10')](_0xfda7('0xa'),_0x39bcea,_0x2ca464);_0x583c48(_0x2ca464);});});}
\ No newline at end of file
+var _0x7dce=['moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util'];(function(_0x36c70b,_0x16454e){var _0x4bdd82=function(_0x3a2d7d){while(--_0x3a2d7d){_0x36c70b['push'](_0x36c70b['shift']());}};_0x4bdd82(++_0x16454e);}(_0x7dce,0x99));var _0xe7dc=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x7dce[_0x47b58b];return _0x46bebe;};'use strict';var _=require('lodash');var util=require(_0xe7dc('0x0'));var moment=require(_0xe7dc('0x1'));var BPromise=require('bluebird');var rs=require(_0xe7dc('0x2'));var fs=require('fs');var Redis=require(_0xe7dc('0x3'));var db=require(_0xe7dc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe7dc('0x5'));var config=require(_0xe7dc('0x6'));var jayson=require(_0xe7dc('0x7'));var client=jayson['client'][_0xe7dc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b2e86,_0x18302a,_0x48bf47){return new BPromise(function(_0x4c5747,_0xf2e6c2){return client[_0xe7dc('0x9')](_0x4b2e86,_0x48bf47)[_0xe7dc('0xa')](function(_0x4794c1){logger['info'](_0xe7dc('0xb'),_0x18302a,_0xe7dc('0xc'));logger[_0xe7dc('0xd')](_0xe7dc('0xe'),_0x18302a,_0xe7dc('0xc'),JSON[_0xe7dc('0xf')](_0x4794c1));if(_0x4794c1[_0xe7dc('0x10')]){if(_0x4794c1['error'][_0xe7dc('0x11')]===0x1f4){logger['error'](_0xe7dc('0xb'),_0x18302a,_0x4794c1[_0xe7dc('0x10')][_0xe7dc('0x12')]);return _0xf2e6c2(_0x4794c1[_0xe7dc('0x10')][_0xe7dc('0x12')]);}logger[_0xe7dc('0x10')](_0xe7dc('0xb'),_0x18302a,_0x4794c1[_0xe7dc('0x10')][_0xe7dc('0x12')]);return _0x4c5747(_0x4794c1['error']['message']);}else{logger[_0xe7dc('0x13')](_0xe7dc('0xb'),_0x18302a,_0xe7dc('0xc'));_0x4c5747(_0x4794c1[_0xe7dc('0x14')][_0xe7dc('0x12')]);}})[_0xe7dc('0x15')](function(_0xe406c){logger[_0xe7dc('0x10')](_0xe7dc('0xb'),_0x18302a,_0xe406c);_0xf2e6c2(_0xe406c);});});}
\ No newline at end of file
index fd0e139..e3e4760 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefda=['/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get'];(function(_0x3d2c4f,_0x5f1ac9){var _0x3e0574=function(_0x48689e){while(--_0x48689e){_0x3d2c4f['push'](_0x3d2c4f['shift']());}};_0x3e0574(++_0x5f1ac9);}(_0xefda,0xbe));var _0xaefd=function(_0x5c2c72,_0x22cf09){_0x5c2c72=_0x5c2c72-0x0;var _0x11c44c=_0xefda[_0x5c2c72];return _0x11c44c;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require(_0xaefd('0x1'));var timeout=require(_0xaefd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xaefd('0x4'));var config=require(_0xaefd('0x5'));var controller=require(_0xaefd('0x6'));router['get']('/',auth[_0xaefd('0x7')](),controller[_0xaefd('0x8')]);router[_0xaefd('0x9')](_0xaefd('0xa'),auth[_0xaefd('0x7')](),controller['describe']);router['get'](_0xaefd('0xb'),auth['isAuthenticated'](),controller[_0xaefd('0xc')]);router[_0xaefd('0xd')]('/',auth['isAuthenticated'](),controller[_0xaefd('0xe')]);router[_0xaefd('0xf')](_0xaefd('0xb'),auth[_0xaefd('0x7')](),controller[_0xaefd('0x10')]);router[_0xaefd('0x11')]('/:id',auth[_0xaefd('0x7')](),controller[_0xaefd('0x12')]);module[_0xaefd('0x13')]=router;
\ No newline at end of file
+var _0x02a0=['/describe','describe','put','delete','/:id','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','./userProfileSection.controller','get','isAuthenticated'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0x02a0,0x117));var _0x002a=function(_0x53f95d,_0x2f73b3){_0x53f95d=_0x53f95d-0x0;var _0x12e359=_0x02a0[_0x53f95d];return _0x12e359;};'use strict';var multer=require(_0x002a('0x0'));var util=require(_0x002a('0x1'));var path=require(_0x002a('0x2'));var timeout=require('connect-timeout');var express=require(_0x002a('0x3'));var router=express['Router']();var fs_extra=require(_0x002a('0x4'));var auth=require(_0x002a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x002a('0x6'));router[_0x002a('0x7')]('/',auth[_0x002a('0x8')](),controller['index']);router[_0x002a('0x7')](_0x002a('0x9'),auth[_0x002a('0x8')](),controller[_0x002a('0xa')]);router[_0x002a('0x7')]('/:id',auth[_0x002a('0x8')](),controller['show']);router['post']('/',auth[_0x002a('0x8')](),controller['create']);router[_0x002a('0xb')]('/:id',auth[_0x002a('0x8')](),controller['update']);router[_0x002a('0xc')](_0x002a('0xd'),auth[_0x002a('0x8')](),controller[_0x002a('0xe')]);module[_0x002a('0xf')]=router;
\ No newline at end of file
index 4481f28..4a8c36a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f6=['INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','sequelize','exports'];(function(_0x3de49c,_0x939eed){var _0x56418d=function(_0x2dd215){while(--_0x2dd215){_0x3de49c['push'](_0x3de49c['shift']());}};_0x56418d(++_0x939eed);}(_0x13f6,0x124));var _0x613f=function(_0x1602de,_0x1af09d){_0x1602de=_0x1602de-0x0;var _0x4423d7=_0x13f6[_0x1602de];return _0x4423d7;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x613f('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x613f('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x613f('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x179f6e){this[_0x613f('0x4')](_0x613f('0x5'),_0x179f6e?_0x179f6e['join'](''):[]);},'get':function(){return this[_0x613f('0x6')](_0x613f('0x5'))?this['getDataValue']('crudPermissions')['split'](''):[];}}};
\ No newline at end of file
+var _0x5423=['getDataValue','crudPermissions','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','join'];(function(_0x2fa3be,_0x257419){var _0x2f5a4a=function(_0x5f0140){while(--_0x5f0140){_0x2fa3be['push'](_0x2fa3be['shift']());}};_0x2f5a4a(++_0x257419);}(_0x5423,0xe3));var _0x3542=function(_0x2d023d,_0x2ef586){_0x2d023d=_0x2d023d-0x0;var _0x4c1a45=_0x5423[_0x2d023d];return _0x4c1a45;};'use strict';var Sequelize=require(_0x3542('0x0'));module[_0x3542('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x3542('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x3542('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x3542('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x3542('0x2')],'set':function(_0xf0835){this[_0x3542('0x5')]('crudPermissions',_0xf0835?_0xf0835[_0x3542('0x6')](''):[]);},'get':function(){return this[_0x3542('0x7')](_0x3542('0x8'))?this[_0x3542('0x7')](_0x3542('0x8'))['split'](''):[];}}};
\ No newline at end of file
index 6a47a02..dcb09e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7941=['index','UserProfileSection','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filters','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','fs-extra','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','destroy','then','sendStatus','error','stack','name','send'];(function(_0x2c7f0c,_0x4bec61){var _0x11c8f3=function(_0x330452){while(--_0x330452){_0x2c7f0c['push'](_0x2c7f0c['shift']());}};_0x11c8f3(++_0x4bec61);}(_0x7941,0x189));var _0x1794=function(_0x1f8124,_0x12dbea){_0x1f8124=_0x1f8124-0x0;var _0x4d08f9=_0x7941[_0x1f8124];return _0x4d08f9;};'use strict';var emlformat=require(_0x1794('0x0'));var rimraf=require(_0x1794('0x1'));var zipdir=require(_0x1794('0x2'));var jsonpatch=require(_0x1794('0x3'));var rp=require('request-promise');var moment=require(_0x1794('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1794('0x5'));var util=require(_0x1794('0x6'));var path=require(_0x1794('0x7'));var sox=require(_0x1794('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1794('0x9'));var _=require('lodash');var squel=require(_0x1794('0xa'));var crypto=require(_0x1794('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1794('0xc'));var toCsv=require(_0x1794('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1794('0xe'));var authService=require(_0x1794('0xf'));var qs=require(_0x1794('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1794('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x1794('0x12'));var licenseUtil=require(_0x1794('0x13'));var db=require(_0x1794('0x14'))['db'];function respondWithStatusCode(_0x3d98ff,_0x2ceacd){_0x2ceacd=_0x2ceacd||0xcc;return function(_0x22a26a){if(_0x22a26a){return _0x3d98ff['sendStatus'](_0x2ceacd);}return _0x3d98ff[_0x1794('0x15')](_0x2ceacd)[_0x1794('0x16')]();};}function respondWithResult(_0x1fd675,_0x5c7ff1){_0x5c7ff1=_0x5c7ff1||0xc8;return function(_0x34f666){if(_0x34f666){return _0x1fd675['status'](_0x5c7ff1)['json'](_0x34f666);}};}function respondWithFilteredResult(_0x4b3393,_0x36d23a){return function(_0x50b357){if(_0x50b357){var _0x473305=typeof _0x36d23a['offset']===_0x1794('0x17')&&typeof _0x36d23a[_0x1794('0x18')]==='undefined';var _0x3833f=_0x50b357[_0x1794('0x19')];var _0x31b623=_0x473305?0x0:_0x36d23a[_0x1794('0x1a')];var _0x325533=_0x473305?_0x50b357[_0x1794('0x19')]:_0x36d23a[_0x1794('0x1a')]+_0x36d23a['limit'];var _0x33d82e;if(_0x325533>=_0x3833f){_0x325533=_0x3833f;_0x33d82e=0xc8;}else{_0x33d82e=0xce;}_0x4b3393[_0x1794('0x15')](_0x33d82e);return _0x4b3393[_0x1794('0x1b')](_0x1794('0x1c'),_0x31b623+'-'+_0x325533+'/'+_0x3833f)[_0x1794('0x1d')](_0x50b357);}return null;};}function patchUpdates(_0x111a22){return function(_0x38a706){try{jsonpatch['apply'](_0x38a706,_0x111a22,!![]);}catch(_0x5e9267){return BPromise[_0x1794('0x1e')](_0x5e9267);}return _0x38a706[_0x1794('0x1f')]();};}function saveUpdates(_0x5d52df,_0x450179){return function(_0x437197){if(_0x437197){return _0x437197['update'](_0x5d52df)['then'](function(_0x4b0495){return _0x4b0495;});}return null;};}function removeEntity(_0x43c251,_0x290b77){return function(_0x4b99a0){if(_0x4b99a0){return _0x4b99a0[_0x1794('0x20')]()[_0x1794('0x21')](function(){_0x43c251[_0x1794('0x15')](0xcc)[_0x1794('0x16')]();});}};}function handleEntityNotFound(_0x4de1e1,_0x1023ed){return function(_0x56593b){if(!_0x56593b){_0x4de1e1[_0x1794('0x22')](0x194);}return _0x56593b;};}function handleError(_0x15b01b,_0x3921d0){_0x3921d0=_0x3921d0||0x1f4;return function(_0x183cce){logger[_0x1794('0x23')](_0x183cce[_0x1794('0x24')]);if(_0x183cce[_0x1794('0x25')]){delete _0x183cce[_0x1794('0x25')];}_0x15b01b[_0x1794('0x15')](_0x3921d0)[_0x1794('0x26')](_0x183cce);};}exports[_0x1794('0x27')]=function(_0x29259e,_0x192e9e){var _0x7f3cf9={},_0x439771={},_0x56deb8={'count':0x0,'rows':[]};var _0xdd136e=_['map'](db[_0x1794('0x28')][_0x1794('0x29')],function(_0x175eb1){return{'name':_0x175eb1['fieldName'],'type':_0x175eb1[_0x1794('0x2a')]['key']};});_0x439771[_0x1794('0x2b')]=_['map'](_0xdd136e,_0x1794('0x25'));_0x439771[_0x1794('0x2c')]=_['keys'](_0x29259e[_0x1794('0x2c')]);_0x439771['filters']=_[_0x1794('0x2d')](_0x439771['model'],_0x439771[_0x1794('0x2c')]);_0x7f3cf9[_0x1794('0x2e')]=_[_0x1794('0x2d')](_0x439771[_0x1794('0x2b')],qs[_0x1794('0x2f')](_0x29259e[_0x1794('0x2c')]['fields']));_0x7f3cf9['attributes']=_0x7f3cf9[_0x1794('0x2e')][_0x1794('0x30')]?_0x7f3cf9['attributes']:_0x439771[_0x1794('0x2b')];if(!_0x29259e[_0x1794('0x2c')][_0x1794('0x31')]('nolimit')){_0x7f3cf9[_0x1794('0x18')]=qs[_0x1794('0x18')](_0x29259e[_0x1794('0x2c')][_0x1794('0x18')]);_0x7f3cf9['offset']=qs[_0x1794('0x1a')](_0x29259e['query'][_0x1794('0x1a')]);}_0x7f3cf9[_0x1794('0x32')]=qs['sort'](_0x29259e[_0x1794('0x2c')]['sort']);_0x7f3cf9[_0x1794('0x33')]=qs['filters'](_[_0x1794('0x34')](_0x29259e[_0x1794('0x2c')],_0x439771[_0x1794('0x35')]),_0xdd136e);if(_0x29259e[_0x1794('0x2c')][_0x1794('0x36')]){_0x7f3cf9[_0x1794('0x33')]=_[_0x1794('0x37')](_0x7f3cf9['where'],{'$or':_[_0x1794('0x38')](_0xdd136e,function(_0x507f84){if(_0x507f84[_0x1794('0x2a')]!==_0x1794('0x39')){var _0x29933f={};_0x29933f[_0x507f84['name']]={'$like':'%'+_0x29259e[_0x1794('0x2c')][_0x1794('0x36')]+'%'};return _0x29933f;}})});}_0x7f3cf9=_[_0x1794('0x37')]({},_0x7f3cf9,_0x29259e[_0x1794('0x3a')]);var _0xb3062f={'where':_0x7f3cf9[_0x1794('0x33')]};return db[_0x1794('0x28')][_0x1794('0x19')](_0xb3062f)['then'](function(_0x2ab4ae){_0x56deb8[_0x1794('0x19')]=_0x2ab4ae;if(_0x29259e[_0x1794('0x2c')][_0x1794('0x3b')]){_0x7f3cf9[_0x1794('0x3c')]=[{'all':!![]}];}return db[_0x1794('0x28')][_0x1794('0x3d')](_0x7f3cf9);})[_0x1794('0x21')](function(_0x4fb0d8){_0x56deb8[_0x1794('0x3e')]=_0x4fb0d8;return _0x56deb8;})[_0x1794('0x21')](respondWithFilteredResult(_0x192e9e,_0x7f3cf9))[_0x1794('0x3f')](handleError(_0x192e9e,null));};exports[_0x1794('0x40')]=function(_0x3ea0c5,_0x543667){var _0x2bcac7={'raw':![],'where':{'id':_0x3ea0c5[_0x1794('0x41')]['id']}},_0x25c29f={};_0x25c29f[_0x1794('0x2b')]=_[_0x1794('0x42')](db[_0x1794('0x28')][_0x1794('0x29')]);_0x25c29f['query']=_['keys'](_0x3ea0c5['query']);_0x25c29f[_0x1794('0x35')]=_[_0x1794('0x2d')](_0x25c29f[_0x1794('0x2b')],_0x25c29f[_0x1794('0x2c')]);_0x2bcac7[_0x1794('0x2e')]=_[_0x1794('0x2d')](_0x25c29f[_0x1794('0x2b')],qs[_0x1794('0x2f')](_0x3ea0c5[_0x1794('0x2c')][_0x1794('0x2f')]));_0x2bcac7[_0x1794('0x2e')]=_0x2bcac7[_0x1794('0x2e')][_0x1794('0x30')]?_0x2bcac7[_0x1794('0x2e')]:_0x25c29f['model'];if(_0x3ea0c5[_0x1794('0x2c')][_0x1794('0x3b')]){_0x2bcac7[_0x1794('0x3c')]=[{'all':!![]}];}_0x2bcac7=_[_0x1794('0x37')]({},_0x2bcac7,_0x3ea0c5[_0x1794('0x3a')]);return db['UserProfileSection'][_0x1794('0x43')](_0x2bcac7)[_0x1794('0x21')](handleEntityNotFound(_0x543667,null))[_0x1794('0x21')](respondWithResult(_0x543667,null))['catch'](handleError(_0x543667,null));};exports['create']=function(_0x2ba80d,_0x53749b){return db[_0x1794('0x28')][_0x1794('0x44')](_0x2ba80d[_0x1794('0x45')],{})[_0x1794('0x21')](respondWithResult(_0x53749b,0xc9))['catch'](handleError(_0x53749b,null));};exports[_0x1794('0x46')]=function(_0x14b189,_0x3e6c40){if(_0x14b189['body']['id']){delete _0x14b189[_0x1794('0x45')]['id'];}return db['UserProfileSection'][_0x1794('0x43')]({'where':{'id':_0x14b189[_0x1794('0x41')]['id']}})[_0x1794('0x21')](handleEntityNotFound(_0x3e6c40,null))[_0x1794('0x21')](saveUpdates(_0x14b189[_0x1794('0x45')],null))[_0x1794('0x21')](respondWithResult(_0x3e6c40,null))[_0x1794('0x3f')](handleError(_0x3e6c40,null));};exports[_0x1794('0x20')]=function(_0x361e17,_0x47c1b3){return db[_0x1794('0x28')][_0x1794('0x43')]({'where':{'id':_0x361e17[_0x1794('0x41')]['id']}})[_0x1794('0x21')](handleEntityNotFound(_0x47c1b3,null))['then'](removeEntity(_0x47c1b3,null))[_0x1794('0x3f')](handleError(_0x47c1b3,null));};exports[_0x1794('0x47')]=function(_0x4a71a6,_0x333ad6){return db[_0x1794('0x28')][_0x1794('0x47')]()[_0x1794('0x21')](respondWithResult(_0x333ad6,null))['catch'](handleError(_0x333ad6,null));};
\ No newline at end of file
+var _0x9c9b=['request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','filters','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x5d4d95,_0x3b998a){var _0x170eac=function(_0x4ff8de){while(--_0x4ff8de){_0x5d4d95['push'](_0x5d4d95['shift']());}};_0x170eac(++_0x3b998a);}(_0x9c9b,0xe6));var _0xb9c9=function(_0x3d641d,_0x536222){_0x3d641d=_0x3d641d-0x0;var _0x12640b=_0x9c9b[_0x3d641d];return _0x12640b;};'use strict';var emlformat=require(_0xb9c9('0x0'));var rimraf=require(_0xb9c9('0x1'));var zipdir=require(_0xb9c9('0x2'));var jsonpatch=require(_0xb9c9('0x3'));var rp=require(_0xb9c9('0x4'));var moment=require(_0xb9c9('0x5'));var BPromise=require(_0xb9c9('0x6'));var Mustache=require(_0xb9c9('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xb9c9('0x8'));var ejs=require(_0xb9c9('0x9'));var fs=require('fs');var fs_extra=require(_0xb9c9('0xa'));var _=require('lodash');var squel=require(_0xb9c9('0xb'));var crypto=require(_0xb9c9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb9c9('0xd'));var toCsv=require(_0xb9c9('0x8'));var querystring=require(_0xb9c9('0xe'));var Papa=require(_0xb9c9('0xf'));var Redis=require(_0xb9c9('0x10'));var authService=require(_0xb9c9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb9c9('0x12'));var logger=require(_0xb9c9('0x13'))(_0xb9c9('0x14'));var utils=require(_0xb9c9('0x15'));var config=require(_0xb9c9('0x16'));var licenseUtil=require(_0xb9c9('0x17'));var db=require(_0xb9c9('0x18'))['db'];function respondWithStatusCode(_0x172281,_0x25b8d2){_0x25b8d2=_0x25b8d2||0xcc;return function(_0x4c1cec){if(_0x4c1cec){return _0x172281[_0xb9c9('0x19')](_0x25b8d2);}return _0x172281[_0xb9c9('0x1a')](_0x25b8d2)['end']();};}function respondWithResult(_0x2add09,_0x5a020c){_0x5a020c=_0x5a020c||0xc8;return function(_0x4aa775){if(_0x4aa775){return _0x2add09[_0xb9c9('0x1a')](_0x5a020c)[_0xb9c9('0x1b')](_0x4aa775);}};}function respondWithFilteredResult(_0x16f18f,_0x47fa51){return function(_0x18c357){if(_0x18c357){var _0x5efd08=typeof _0x47fa51['offset']===_0xb9c9('0x1c')&&typeof _0x47fa51[_0xb9c9('0x1d')]==='undefined';var _0x38b5df=_0x18c357[_0xb9c9('0x1e')];var _0x1265f9=_0x5efd08?0x0:_0x47fa51['offset'];var _0x4960b8=_0x5efd08?_0x18c357['count']:_0x47fa51[_0xb9c9('0x1f')]+_0x47fa51['limit'];var _0x101938;if(_0x4960b8>=_0x38b5df){_0x4960b8=_0x38b5df;_0x101938=0xc8;}else{_0x101938=0xce;}_0x16f18f[_0xb9c9('0x1a')](_0x101938);return _0x16f18f[_0xb9c9('0x20')](_0xb9c9('0x21'),_0x1265f9+'-'+_0x4960b8+'/'+_0x38b5df)[_0xb9c9('0x1b')](_0x18c357);}return null;};}function patchUpdates(_0x1fbc94){return function(_0x308078){try{jsonpatch[_0xb9c9('0x22')](_0x308078,_0x1fbc94,!![]);}catch(_0x561784){return BPromise[_0xb9c9('0x23')](_0x561784);}return _0x308078[_0xb9c9('0x24')]();};}function saveUpdates(_0x442148,_0x37c7a9){return function(_0x18b031){if(_0x18b031){return _0x18b031[_0xb9c9('0x25')](_0x442148)['then'](function(_0x4d178c){return _0x4d178c;});}return null;};}function removeEntity(_0x34ff32,_0xb48d76){return function(_0x5c60c1){if(_0x5c60c1){return _0x5c60c1[_0xb9c9('0x26')]()[_0xb9c9('0x27')](function(){_0x34ff32[_0xb9c9('0x1a')](0xcc)[_0xb9c9('0x28')]();});}};}function handleEntityNotFound(_0x1008de,_0x27d6a1){return function(_0x5cdc0f){if(!_0x5cdc0f){_0x1008de['sendStatus'](0x194);}return _0x5cdc0f;};}function handleError(_0x199baf,_0xb3e94e){_0xb3e94e=_0xb3e94e||0x1f4;return function(_0x2e9823){logger[_0xb9c9('0x29')](_0x2e9823[_0xb9c9('0x2a')]);if(_0x2e9823[_0xb9c9('0x2b')]){delete _0x2e9823[_0xb9c9('0x2b')];}_0x199baf['status'](_0xb3e94e)['send'](_0x2e9823);};}exports[_0xb9c9('0x2c')]=function(_0x2cc89e,_0xb6b621){var _0x69d8b5={},_0x2fdb46={},_0xff8e3a={'count':0x0,'rows':[]};var _0x50fe47=_[_0xb9c9('0x2d')](db[_0xb9c9('0x2e')][_0xb9c9('0x2f')],function(_0x5854dd){return{'name':_0x5854dd[_0xb9c9('0x30')],'type':_0x5854dd[_0xb9c9('0x31')][_0xb9c9('0x32')]};});_0x2fdb46[_0xb9c9('0x33')]=_['map'](_0x50fe47,'name');_0x2fdb46[_0xb9c9('0x34')]=_[_0xb9c9('0x35')](_0x2cc89e[_0xb9c9('0x34')]);_0x2fdb46['filters']=_[_0xb9c9('0x36')](_0x2fdb46[_0xb9c9('0x33')],_0x2fdb46['query']);_0x69d8b5[_0xb9c9('0x37')]=_[_0xb9c9('0x36')](_0x2fdb46['model'],qs[_0xb9c9('0x38')](_0x2cc89e[_0xb9c9('0x34')][_0xb9c9('0x38')]));_0x69d8b5['attributes']=_0x69d8b5[_0xb9c9('0x37')][_0xb9c9('0x39')]?_0x69d8b5[_0xb9c9('0x37')]:_0x2fdb46['model'];if(!_0x2cc89e['query']['hasOwnProperty'](_0xb9c9('0x3a'))){_0x69d8b5[_0xb9c9('0x1d')]=qs['limit'](_0x2cc89e['query'][_0xb9c9('0x1d')]);_0x69d8b5[_0xb9c9('0x1f')]=qs['offset'](_0x2cc89e[_0xb9c9('0x34')]['offset']);}_0x69d8b5[_0xb9c9('0x3b')]=qs[_0xb9c9('0x3c')](_0x2cc89e['query'][_0xb9c9('0x3c')]);_0x69d8b5[_0xb9c9('0x3d')]=qs['filters'](_[_0xb9c9('0x3e')](_0x2cc89e[_0xb9c9('0x34')],_0x2fdb46['filters']),_0x50fe47);if(_0x2cc89e['query']['filter']){_0x69d8b5['where']=_[_0xb9c9('0x3f')](_0x69d8b5[_0xb9c9('0x3d')],{'$or':_[_0xb9c9('0x2d')](_0x50fe47,function(_0x28cd09){if(_0x28cd09[_0xb9c9('0x31')]!==_0xb9c9('0x40')){var _0x2d8748={};_0x2d8748[_0x28cd09[_0xb9c9('0x2b')]]={'$like':'%'+_0x2cc89e[_0xb9c9('0x34')][_0xb9c9('0x41')]+'%'};return _0x2d8748;}})});}_0x69d8b5=_[_0xb9c9('0x3f')]({},_0x69d8b5,_0x2cc89e['options']);var _0x62b0bd={'where':_0x69d8b5[_0xb9c9('0x3d')]};return db['UserProfileSection'][_0xb9c9('0x1e')](_0x62b0bd)['then'](function(_0x17fc86){_0xff8e3a[_0xb9c9('0x1e')]=_0x17fc86;if(_0x2cc89e['query'][_0xb9c9('0x42')]){_0x69d8b5[_0xb9c9('0x43')]=[{'all':!![]}];}return db['UserProfileSection'][_0xb9c9('0x44')](_0x69d8b5);})[_0xb9c9('0x27')](function(_0x4bc34b){_0xff8e3a[_0xb9c9('0x45')]=_0x4bc34b;return _0xff8e3a;})[_0xb9c9('0x27')](respondWithFilteredResult(_0xb6b621,_0x69d8b5))[_0xb9c9('0x46')](handleError(_0xb6b621,null));};exports[_0xb9c9('0x47')]=function(_0x337218,_0x301ab3){var _0x48d9b4={'raw':![],'where':{'id':_0x337218[_0xb9c9('0x48')]['id']}},_0x160ff8={};_0x160ff8[_0xb9c9('0x33')]=_['keys'](db[_0xb9c9('0x2e')][_0xb9c9('0x2f')]);_0x160ff8['query']=_[_0xb9c9('0x35')](_0x337218['query']);_0x160ff8[_0xb9c9('0x49')]=_[_0xb9c9('0x36')](_0x160ff8[_0xb9c9('0x33')],_0x160ff8[_0xb9c9('0x34')]);_0x48d9b4[_0xb9c9('0x37')]=_[_0xb9c9('0x36')](_0x160ff8[_0xb9c9('0x33')],qs['fields'](_0x337218[_0xb9c9('0x34')]['fields']));_0x48d9b4['attributes']=_0x48d9b4[_0xb9c9('0x37')][_0xb9c9('0x39')]?_0x48d9b4[_0xb9c9('0x37')]:_0x160ff8[_0xb9c9('0x33')];if(_0x337218[_0xb9c9('0x34')][_0xb9c9('0x42')]){_0x48d9b4[_0xb9c9('0x43')]=[{'all':!![]}];}_0x48d9b4=_[_0xb9c9('0x3f')]({},_0x48d9b4,_0x337218[_0xb9c9('0x4a')]);return db[_0xb9c9('0x2e')][_0xb9c9('0x4b')](_0x48d9b4)[_0xb9c9('0x27')](handleEntityNotFound(_0x301ab3,null))[_0xb9c9('0x27')](respondWithResult(_0x301ab3,null))[_0xb9c9('0x46')](handleError(_0x301ab3,null));};exports[_0xb9c9('0x4c')]=function(_0x3a08b5,_0x3b8d51){return db['UserProfileSection'][_0xb9c9('0x4c')](_0x3a08b5[_0xb9c9('0x4d')],{})['then'](respondWithResult(_0x3b8d51,0xc9))[_0xb9c9('0x46')](handleError(_0x3b8d51,null));};exports[_0xb9c9('0x25')]=function(_0x423f89,_0x2ba709){if(_0x423f89[_0xb9c9('0x4d')]['id']){delete _0x423f89['body']['id'];}return db[_0xb9c9('0x2e')]['find']({'where':{'id':_0x423f89[_0xb9c9('0x48')]['id']}})['then'](handleEntityNotFound(_0x2ba709,null))[_0xb9c9('0x27')](saveUpdates(_0x423f89['body'],null))[_0xb9c9('0x27')](respondWithResult(_0x2ba709,null))[_0xb9c9('0x46')](handleError(_0x2ba709,null));};exports[_0xb9c9('0x26')]=function(_0x270842,_0x186a23){return db['UserProfileSection'][_0xb9c9('0x4b')]({'where':{'id':_0x270842['params']['id']}})[_0xb9c9('0x27')](handleEntityNotFound(_0x186a23,null))[_0xb9c9('0x27')](removeEntity(_0x186a23,null))[_0xb9c9('0x46')](handleError(_0x186a23,null));};exports['describe']=function(_0xfc1f99,_0x32f97c){return db['UserProfileSection']['describe']()['then'](respondWithResult(_0x32f97c,null))[_0xb9c9('0x46')](handleError(_0x32f97c,null));};
\ No newline at end of file
index 00bd031..2ab8a76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee42=['./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','userProfileId','util','moment','path','../../config/environment'];(function(_0x24d85a,_0x45efb0){var _0x59d0fe=function(_0x5d0b66){while(--_0x5d0b66){_0x24d85a['push'](_0x24d85a['shift']());}};_0x59d0fe(++_0x45efb0);}(_0xee42,0xe2));var _0x2ee4=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xee42[_0x5c9307];return _0x373e29;};'use strict';var _=require('lodash');var util=require(_0x2ee4('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2ee4('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ee4('0x2'));var rimraf=require('rimraf');var config=require(_0x2ee4('0x3'));var attributes=require(_0x2ee4('0x4'));module[_0x2ee4('0x5')]=function(_0x1cf3c5,_0x4976c8){return _0x1cf3c5[_0x2ee4('0x6')](_0x2ee4('0x7'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x2ee4('0x8'),'fields':['sectionId',_0x2ee4('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3cdb=['userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','compositeIndex'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3cdb,0xa6));var _0xb3cd=function(_0x2f87cd,_0xcaf299){_0x2f87cd=_0x2f87cd-0x0;var _0x5d7eda=_0x3cdb[_0x2f87cd];return _0x5d7eda;};'use strict';var _=require(_0xb3cd('0x0'));var util=require(_0xb3cd('0x1'));var logger=require(_0xb3cd('0x2'))(_0xb3cd('0x3'));var moment=require(_0xb3cd('0x4'));var BPromise=require(_0xb3cd('0x5'));var rp=require(_0xb3cd('0x6'));var fs=require('fs');var path=require(_0xb3cd('0x7'));var rimraf=require(_0xb3cd('0x8'));var config=require('../../config/environment');var attributes=require(_0xb3cd('0x9'));module['exports']=function(_0x4aef3a,_0x433c59){return _0x4aef3a[_0xb3cd('0xa')](_0xb3cd('0xb'),attributes,{'tableName':_0xb3cd('0xc'),'paranoid':![],'indexes':[{'name':_0xb3cd('0xd'),'fields':['sectionId',_0xb3cd('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 1cbabfd..ca3638f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fe9=['UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x4b2311,_0xfaa6e4){var _0x41ad3c=function(_0x22ab9f){while(--_0x22ab9f){_0x4b2311['push'](_0x4b2311['shift']());}};_0x41ad3c(++_0xfaa6e4);}(_0x3fe9,0x106));var _0x93fe=function(_0x4a1dfd,_0x59c7c1){_0x4a1dfd=_0x4a1dfd-0x0;var _0x5ca05b=_0x3fe9[_0x4a1dfd];return _0x5ca05b;};'use strict';var _=require(_0x93fe('0x0'));var util=require(_0x93fe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x93fe('0x2'));var fs=require('fs');var Redis=require(_0x93fe('0x3'));var db=require(_0x93fe('0x4'))['db'];var utils=require(_0x93fe('0x5'));var logger=require('../../config/logger')(_0x93fe('0x6'));var config=require(_0x93fe('0x7'));var jayson=require(_0x93fe('0x8'));var client=jayson[_0x93fe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f7195,_0x40b7d3,_0x148776){return new BPromise(function(_0x34cd8a,_0x4fc055){return client[_0x93fe('0xa')](_0x3f7195,_0x148776)['then'](function(_0x5b0b5d){logger['info'](_0x93fe('0xb'),_0x40b7d3,_0x93fe('0xc'));logger[_0x93fe('0xd')](_0x93fe('0xe'),_0x40b7d3,_0x93fe('0xc'),JSON['stringify'](_0x5b0b5d));if(_0x5b0b5d[_0x93fe('0xf')]){if(_0x5b0b5d[_0x93fe('0xf')][_0x93fe('0x10')]===0x1f4){logger[_0x93fe('0xf')](_0x93fe('0xb'),_0x40b7d3,_0x5b0b5d['error'][_0x93fe('0x11')]);return _0x4fc055(_0x5b0b5d[_0x93fe('0xf')][_0x93fe('0x11')]);}logger[_0x93fe('0xf')](_0x93fe('0xb'),_0x40b7d3,_0x5b0b5d['error'][_0x93fe('0x11')]);return _0x34cd8a(_0x5b0b5d['error'][_0x93fe('0x11')]);}else{logger[_0x93fe('0x12')](_0x93fe('0xb'),_0x40b7d3,'request\x20sent');_0x34cd8a(_0x5b0b5d[_0x93fe('0x13')][_0x93fe('0x11')]);}})[_0x93fe('0x14')](function(_0x268508){logger[_0x93fe('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x40b7d3,_0x268508);_0x4fc055(_0x268508);});});}
\ No newline at end of file
+var _0x24dc=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','UserProfileSection,\x20%s,\x20%s','message','moment','bluebird','randomstring','ioredis'];(function(_0x233dc0,_0x2866ad){var _0x1fc160=function(_0x51e38b){while(--_0x51e38b){_0x233dc0['push'](_0x233dc0['shift']());}};_0x1fc160(++_0x2866ad);}(_0x24dc,0x65));var _0xc24d=function(_0x25d3a8,_0x35e0a){_0x25d3a8=_0x25d3a8-0x0;var _0x442c6a=_0x24dc[_0x25d3a8];return _0x442c6a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc24d('0x0'));var BPromise=require(_0xc24d('0x1'));var rs=require(_0xc24d('0x2'));var fs=require('fs');var Redis=require(_0xc24d('0x3'));var db=require(_0xc24d('0x4'))['db'];var utils=require(_0xc24d('0x5'));var logger=require(_0xc24d('0x6'))(_0xc24d('0x7'));var config=require(_0xc24d('0x8'));var jayson=require(_0xc24d('0x9'));var client=jayson[_0xc24d('0xa')][_0xc24d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d5829,_0x47ad4b,_0x42b44d){return new BPromise(function(_0x2e6391,_0x4fee92){return client[_0xc24d('0xc')](_0x1d5829,_0x42b44d)['then'](function(_0x357a04){logger[_0xc24d('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x47ad4b,_0xc24d('0xe'));logger[_0xc24d('0xf')](_0xc24d('0x10'),_0x47ad4b,'request\x20sent',JSON['stringify'](_0x357a04));if(_0x357a04[_0xc24d('0x11')]){if(_0x357a04[_0xc24d('0x11')][_0xc24d('0x12')]===0x1f4){logger['error'](_0xc24d('0x13'),_0x47ad4b,_0x357a04[_0xc24d('0x11')][_0xc24d('0x14')]);return _0x4fee92(_0x357a04[_0xc24d('0x11')][_0xc24d('0x14')]);}logger[_0xc24d('0x11')](_0xc24d('0x13'),_0x47ad4b,_0x357a04[_0xc24d('0x11')][_0xc24d('0x14')]);return _0x2e6391(_0x357a04[_0xc24d('0x11')]['message']);}else{logger[_0xc24d('0xd')](_0xc24d('0x13'),_0x47ad4b,_0xc24d('0xe'));_0x2e6391(_0x357a04['result'][_0xc24d('0x14')]);}})['catch'](function(_0x2f87e7){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x47ad4b,_0x2f87e7);_0x4fee92(_0x2f87e7);});});}
\ No newline at end of file
index 359def5..e173678 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(_0x38baac,_0x2772b3){var _0x47baf1=function(_0x5646a8){while(--_0x5646a8){_0x38baac['push'](_0x38baac['shift']());}};_0x47baf1(++_0x2772b3);}(_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(_0x1b768e,_0x8ee33c){var _0x31ea76=function(_0x4adf75){while(--_0x4adf75){_0x1b768e['push'](_0x1b768e['shift']());}};_0x31ea76(++_0x8ee33c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 12d1f79..15368d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabe7=['INTEGER','exports'];(function(_0x234e1e,_0x531528){var _0x22a084=function(_0x5de93d){while(--_0x5de93d){_0x234e1e['push'](_0x234e1e['shift']());}};_0x22a084(++_0x531528);}(_0xabe7,0x1c3));var _0x7abe=function(_0x20058b,_0x471230){_0x20058b=_0x20058b-0x0;var _0x49f139=_0xabe7[_0x20058b];return _0x49f139;};'use strict';var Sequelize=require('sequelize');module[_0x7abe('0x0')]={'penalty':{'type':Sequelize[_0x7abe('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x5e76=['INTEGER'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x5e76,0x16e));var _0x65e7=function(_0xe32741,_0x357c7c){_0xe32741=_0xe32741-0x0;var _0x16d66f=_0x5e76[_0xe32741];return _0x16d66f;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x65e7('0x0')],'defaultValue':0x0}};
\ No newline at end of file
index 33b0e79..be4d23f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32f4=['./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32f4,0x154));var _0x432f=function(_0x1e79f4,_0x2e4769){_0x1e79f4=_0x1e79f4-0x0;var _0x279302=_0x32f4[_0x1e79f4];return _0x279302;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var logger=require(_0x432f('0x2'))(_0x432f('0x3'));var moment=require('moment');var BPromise=require(_0x432f('0x4'));var rp=require(_0x432f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var attributes=require(_0x432f('0x8'));module[_0x432f('0x9')]=function(_0x2f5f03,_0x5d8cc0){return _0x2f5f03['define'](_0x432f('0xa'),attributes,{'tableName':_0x432f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f37=['lodash','util','api','request-promise','path','rimraf','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues'];(function(_0x37cd8c,_0x425de5){var _0x213168=function(_0x4aed59){while(--_0x4aed59){_0x37cd8c['push'](_0x37cd8c['shift']());}};_0x213168(++_0x425de5);}(_0x9f37,0xd1));var _0x79f3=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x9f37[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x79f3('0x0'));var util=require(_0x79f3('0x1'));var logger=require('../../config/logger')(_0x79f3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x79f3('0x3'));var fs=require('fs');var path=require(_0x79f3('0x4'));var rimraf=require(_0x79f3('0x5'));var config=require('../../config/environment');var attributes=require(_0x79f3('0x6'));module[_0x79f3('0x7')]=function(_0x594d87,_0x5db84b){return _0x594d87[_0x79f3('0x8')](_0x79f3('0x9'),attributes,{'tableName':_0x79f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2165222..5db26f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9810=['client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x9810,0x17f));var _0x0981=function(_0x4c3ffe,_0x457374){_0x4c3ffe=_0x4c3ffe-0x0;var _0x28d3eb=_0x9810[_0x4c3ffe];return _0x28d3eb;};'use strict';var _=require(_0x0981('0x0'));var util=require(_0x0981('0x1'));var moment=require('moment');var BPromise=require(_0x0981('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0981('0x3'));var db=require(_0x0981('0x4'))['db'];var utils=require(_0x0981('0x5'));var logger=require('../../config/logger')(_0x0981('0x6'));var config=require('../../config/environment');var jayson=require(_0x0981('0x7'));var client=jayson[_0x0981('0x8')][_0x0981('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x555dd6,_0x13a664,_0x4cccce){return new BPromise(function(_0x9b7b98,_0x1491cf){return client[_0x0981('0xa')](_0x555dd6,_0x4cccce)[_0x0981('0xb')](function(_0x5aad29){logger[_0x0981('0xc')](_0x0981('0xd'),_0x13a664,'request\x20sent');logger[_0x0981('0xe')](_0x0981('0xf'),_0x13a664,_0x0981('0x10'),JSON[_0x0981('0x11')](_0x5aad29));if(_0x5aad29[_0x0981('0x12')]){if(_0x5aad29[_0x0981('0x12')][_0x0981('0x13')]===0x1f4){logger[_0x0981('0x12')](_0x0981('0xd'),_0x13a664,_0x5aad29[_0x0981('0x12')]['message']);return _0x1491cf(_0x5aad29[_0x0981('0x12')][_0x0981('0x14')]);}logger[_0x0981('0x12')](_0x0981('0xd'),_0x13a664,_0x5aad29['error']['message']);return _0x9b7b98(_0x5aad29[_0x0981('0x12')]['message']);}else{logger[_0x0981('0xc')](_0x0981('0xd'),_0x13a664,_0x0981('0x10'));_0x9b7b98(_0x5aad29[_0x0981('0x15')][_0x0981('0x14')]);}})[_0x0981('0x16')](function(_0x1a8a1d){logger[_0x0981('0x12')](_0x0981('0xd'),_0x13a664,_0x1a8a1d);_0x1491cf(_0x1a8a1d);});});}
\ No newline at end of file
+var _0x0b09=['UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0b09,0xed));var _0x90b0=function(_0x3c2346,_0x4a0c93){_0x3c2346=_0x3c2346-0x0;var _0x500c4a=_0x0b09[_0x3c2346];return _0x500c4a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x90b0('0x0'));var rs=require(_0x90b0('0x1'));var fs=require('fs');var Redis=require(_0x90b0('0x2'));var db=require(_0x90b0('0x3'))['db'];var utils=require(_0x90b0('0x4'));var logger=require('../../config/logger')(_0x90b0('0x5'));var config=require('../../config/environment');var jayson=require(_0x90b0('0x6'));var client=jayson[_0x90b0('0x7')][_0x90b0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46ef25,_0x15ba4a,_0x185c07){return new BPromise(function(_0x238a9a,_0xc956dc){return client[_0x90b0('0x9')](_0x46ef25,_0x185c07)[_0x90b0('0xa')](function(_0x436c1e){logger[_0x90b0('0xb')](_0x90b0('0xc'),_0x15ba4a,_0x90b0('0xd'));logger[_0x90b0('0xe')](_0x90b0('0xf'),_0x15ba4a,_0x90b0('0xd'),JSON[_0x90b0('0x10')](_0x436c1e));if(_0x436c1e[_0x90b0('0x11')]){if(_0x436c1e[_0x90b0('0x11')]['code']===0x1f4){logger['error'](_0x90b0('0xc'),_0x15ba4a,_0x436c1e['error'][_0x90b0('0x12')]);return _0xc956dc(_0x436c1e[_0x90b0('0x11')][_0x90b0('0x12')]);}logger[_0x90b0('0x11')](_0x90b0('0xc'),_0x15ba4a,_0x436c1e['error'][_0x90b0('0x12')]);return _0x238a9a(_0x436c1e[_0x90b0('0x11')][_0x90b0('0x12')]);}else{logger[_0x90b0('0xb')](_0x90b0('0xc'),_0x15ba4a,_0x90b0('0xd'));_0x238a9a(_0x436c1e[_0x90b0('0x13')]['message']);}})[_0x90b0('0x14')](function(_0x2b3825){logger[_0x90b0('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x15ba4a,_0x2b3825);_0xc956dc(_0x2b3825);});});}
\ No newline at end of file
index dc8124c..15b8181 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7f2=['exports','sequelize'];(function(_0x2a3547,_0x13edad){var _0x1f24e9=function(_0x51af35){while(--_0x51af35){_0x2a3547['push'](_0x2a3547['shift']());}};_0x1f24e9(++_0x13edad);}(_0xc7f2,0xe1));var _0x2c7f=function(_0x17a92b,_0x35de45){_0x17a92b=_0x17a92b-0x0;var _0x1e31c7=_0xc7f2[_0x17a92b];return _0x1e31c7;};'use strict';var Sequelize=require(_0x2c7f('0x0'));module[_0x2c7f('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xb6bb=['sequelize','exports','INTEGER'];(function(_0x2487d0,_0x50c18f){var _0x173138=function(_0x4e20c9){while(--_0x4e20c9){_0x2487d0['push'](_0x2487d0['shift']());}};_0x173138(++_0x50c18f);}(_0xb6bb,0x13e));var _0xbb6b=function(_0x5b0296,_0x509c84){_0x5b0296=_0x5b0296-0x0;var _0x510fcf=_0xb6bb[_0x5b0296];return _0x510fcf;};'use strict';var Sequelize=require(_0xbb6b('0x0'));module[_0xbb6b('0x1')]={'UserId':{'type':Sequelize[_0xbb6b('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index dd94f85..62c31cb 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(_0x2ba024,_0xba8b50){var _0x39c548=function(_0x11be39){while(--_0x11be39){_0x2ba024['push'](_0x2ba024['shift']());}};_0x39c548(++_0xba8b50);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x25fe5b,_0x1c66cc){var _0x1a3f9d=function(_0x2a19b1){while(--_0x2a19b1){_0x25fe5b['push'](_0x25fe5b['shift']());}};_0x1a3f9d(++_0x1c66cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 8bd80eb..a2e343d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2a9f8f,_0x45bf47){var _0xc63dc3=function(_0x491b80){while(--_0x491b80){_0x2a9f8f['push'](_0x2a9f8f['shift']());}};_0xc63dc3(++_0x45bf47);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5581ba,_0x268887){_0x5581ba=_0x5581ba-0x0;var _0x1e927f=_0xcb91[_0x5581ba];return _0x1e927f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x57c4ec,_0xfb1ad0){var _0x157f3c=function(_0x283be4){while(--_0x283be4){_0x57c4ec['push'](_0x57c4ec['shift']());}};_0x157f3c(++_0xfb1ad0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index 5a5ad8a..4a170a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8db9=['exports','INTEGER','sequelize'];(function(_0x4d40dd,_0x39592b){var _0x1c51f2=function(_0x53e502){while(--_0x53e502){_0x4d40dd['push'](_0x4d40dd['shift']());}};_0x1c51f2(++_0x39592b);}(_0x8db9,0x1a0));var _0x98db=function(_0x6da001,_0xd9b4b1){_0x6da001=_0x6da001-0x0;var _0x39b0fd=_0x8db9[_0x6da001];return _0x39b0fd;};'use strict';var Sequelize=require(_0x98db('0x0'));module[_0x98db('0x1')]={'penalty':{'type':Sequelize[_0x98db('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x46fe=['INTEGER','sequelize','exports'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x46fe,0x1c3));var _0xe46f=function(_0x482214,_0x2550ff){_0x482214=_0x482214-0x0;var _0x38d0cb=_0x46fe[_0x482214];return _0x38d0cb;};'use strict';var Sequelize=require(_0xe46f('0x0'));module[_0xe46f('0x1')]={'penalty':{'type':Sequelize[_0xe46f('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index e4e3423..6ceac79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8164=['exports','define','UserVoiceQueue','lodash','util','moment','bluebird','rimraf','../../config/environment','./userVoiceQueue.attributes'];(function(_0x8a917c,_0x19c5f6){var _0x2c704e=function(_0x342f3a){while(--_0x342f3a){_0x8a917c['push'](_0x8a917c['shift']());}};_0x2c704e(++_0x19c5f6);}(_0x8164,0x85));var _0x4816=function(_0x12fcbd,_0x884804){_0x12fcbd=_0x12fcbd-0x0;var _0x28ec2a=_0x8164[_0x12fcbd];return _0x28ec2a;};'use strict';var _=require(_0x4816('0x0'));var util=require(_0x4816('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4816('0x2'));var BPromise=require(_0x4816('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4816('0x4'));var config=require(_0x4816('0x5'));var attributes=require(_0x4816('0x6'));module[_0x4816('0x7')]=function(_0x51c5eb,_0xba11a2){return _0x51c5eb[_0x4816('0x8')](_0x4816('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x93d9=['moment','path','../../config/environment','./userVoiceQueue.attributes','exports','user_has_voice_queues','lodash','util','../../config/logger','api'];(function(_0x4fbaf9,_0x3b8190){var _0x1d89a0=function(_0x3b650b){while(--_0x3b650b){_0x4fbaf9['push'](_0x4fbaf9['shift']());}};_0x1d89a0(++_0x3b8190);}(_0x93d9,0x18c));var _0x993d=function(_0x220606,_0x4b6630){_0x220606=_0x220606-0x0;var _0x1308ff=_0x93d9[_0x220606];return _0x1308ff;};'use strict';var _=require(_0x993d('0x0'));var util=require(_0x993d('0x1'));var logger=require(_0x993d('0x2'))(_0x993d('0x3'));var moment=require(_0x993d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x993d('0x5'));var rimraf=require('rimraf');var config=require(_0x993d('0x6'));var attributes=require(_0x993d('0x7'));module[_0x993d('0x8')]=function(_0x5057a1,_0x4fbc4e){return _0x5057a1['define']('UserVoiceQueue',attributes,{'tableName':_0x993d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 623637e..60ad8f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91ff=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x91ff,0x19a));var _0xf91f=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x91ff[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0xf91f('0x0'));var util=require('util');var moment=require(_0xf91f('0x1'));var BPromise=require(_0xf91f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf91f('0x3'));var db=require(_0xf91f('0x4'))['db'];var utils=require(_0xf91f('0x5'));var logger=require(_0xf91f('0x6'))(_0xf91f('0x7'));var config=require('../../config/environment');var jayson=require(_0xf91f('0x8'));var client=jayson[_0xf91f('0x9')][_0xf91f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c5c32,_0x1fea76,_0xeb7fa4){return new BPromise(function(_0x4f5453,_0xdde053){return client[_0xf91f('0xb')](_0x5c5c32,_0xeb7fa4)[_0xf91f('0xc')](function(_0xdc1876){logger[_0xf91f('0xd')](_0xf91f('0xe'),_0x1fea76,'request\x20sent');logger[_0xf91f('0xf')](_0xf91f('0x10'),_0x1fea76,_0xf91f('0x11'),JSON[_0xf91f('0x12')](_0xdc1876));if(_0xdc1876[_0xf91f('0x13')]){if(_0xdc1876[_0xf91f('0x13')]['code']===0x1f4){logger[_0xf91f('0x13')](_0xf91f('0xe'),_0x1fea76,_0xdc1876[_0xf91f('0x13')][_0xf91f('0x14')]);return _0xdde053(_0xdc1876[_0xf91f('0x13')][_0xf91f('0x14')]);}logger[_0xf91f('0x13')](_0xf91f('0xe'),_0x1fea76,_0xdc1876[_0xf91f('0x13')][_0xf91f('0x14')]);return _0x4f5453(_0xdc1876[_0xf91f('0x13')][_0xf91f('0x14')]);}else{logger[_0xf91f('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x1fea76,'request\x20sent');_0x4f5453(_0xdc1876[_0xf91f('0x15')][_0xf91f('0x14')]);}})[_0xf91f('0x16')](function(_0x5a87cb){logger[_0xf91f('0x13')](_0xf91f('0xe'),_0x1fea76,_0x5a87cb);_0xdde053(_0x5a87cb);});});}
\ No newline at end of file
+var _0xa776=['message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s'];(function(_0xe301ef,_0x2bfef4){var _0x2bdbd6=function(_0x2461f9){while(--_0x2461f9){_0xe301ef['push'](_0xe301ef['shift']());}};_0x2bdbd6(++_0x2bfef4);}(_0xa776,0x1e6));var _0x6a77=function(_0x460263,_0x298d4d){_0x460263=_0x460263-0x0;var _0x4fd7f9=_0xa776[_0x460263];return _0x4fd7f9;};'use strict';var _=require('lodash');var util=require(_0x6a77('0x0'));var moment=require(_0x6a77('0x1'));var BPromise=require('bluebird');var rs=require(_0x6a77('0x2'));var fs=require('fs');var Redis=require(_0x6a77('0x3'));var db=require(_0x6a77('0x4'))['db'];var utils=require(_0x6a77('0x5'));var logger=require(_0x6a77('0x6'))(_0x6a77('0x7'));var config=require('../../config/environment');var jayson=require(_0x6a77('0x8'));var client=jayson[_0x6a77('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28d2e3,_0x119cc4,_0x395edc){return new BPromise(function(_0x40bf78,_0x431749){return client[_0x6a77('0xa')](_0x28d2e3,_0x395edc)[_0x6a77('0xb')](function(_0x3aad82){logger[_0x6a77('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x119cc4,_0x6a77('0xd'));logger[_0x6a77('0xe')](_0x6a77('0xf'),_0x119cc4,_0x6a77('0xd'),JSON[_0x6a77('0x10')](_0x3aad82));if(_0x3aad82['error']){if(_0x3aad82[_0x6a77('0x11')][_0x6a77('0x12')]===0x1f4){logger[_0x6a77('0x11')](_0x6a77('0x13'),_0x119cc4,_0x3aad82[_0x6a77('0x11')]['message']);return _0x431749(_0x3aad82[_0x6a77('0x11')][_0x6a77('0x14')]);}logger[_0x6a77('0x11')](_0x6a77('0x13'),_0x119cc4,_0x3aad82[_0x6a77('0x11')]['message']);return _0x40bf78(_0x3aad82[_0x6a77('0x11')]['message']);}else{logger[_0x6a77('0xc')](_0x6a77('0x13'),_0x119cc4,_0x6a77('0xd'));_0x40bf78(_0x3aad82[_0x6a77('0x15')]['message']);}})[_0x6a77('0x16')](function(_0x151303){logger[_0x6a77('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x119cc4,_0x151303);_0x431749(_0x151303);});});}
\ No newline at end of file
index c502f8d..a207c72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x805b25,_0x1e1521){var _0x484140=function(_0x37cb3d){while(--_0x37cb3d){_0x805b25['push'](_0x805b25['shift']());}};_0x484140(++_0x1e1521);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xcb91[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x27ba9b,_0x570bb6){var _0x32b62c=function(_0x481c4e){while(--_0x481c4e){_0x27ba9b['push'](_0x27ba9b['shift']());}};_0x32b62c(++_0x570bb6);}(_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 604bec1..4e32ad2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x387c=['INTEGER','Required\x20by\x20Asterisk','queue_interface','STRING','sequelize','exports'];(function(_0x4d96bf,_0x507572){var _0x4686fd=function(_0x41fbc0){while(--_0x41fbc0){_0x4d96bf['push'](_0x4d96bf['shift']());}};_0x4686fd(++_0x507572);}(_0x387c,0x17e));var _0xc387=function(_0x379799,_0x4ccf16){_0x379799=_0x379799-0x0;var _0x46e431=_0x387c[_0x379799];return _0x46e431;};'use strict';var Sequelize=require(_0xc387('0x0'));module[_0xc387('0x1')]={'uniqueid':{'type':Sequelize[_0xc387('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xc387('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xc387('0x3')},'UserId':{'type':Sequelize[_0xc387('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc387('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xc387('0x5')],'allowNull':![],'unique':_0xc387('0x4'),'comment':_0xc387('0x3')},'penalty':{'type':Sequelize[_0xc387('0x2')](0xb),'defaultValue':0x0,'comment':_0xc387('0x3')},'paused':{'type':Sequelize[_0xc387('0x2')](0xb),'defaultValue':0x0,'comment':_0xc387('0x3')}};
\ No newline at end of file
+var _0xc269=['Required\x20by\x20Asterisk','queue_interface','sequelize','exports','INTEGER','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc269,0x194));var _0x9c26=function(_0x4354c8,_0x55542c){_0x4354c8=_0x4354c8-0x0;var _0x3b398e=_0xc269[_0x4354c8];return _0x3b398e;};'use strict';var Sequelize=require(_0x9c26('0x0'));module[_0x9c26('0x1')]={'uniqueid':{'type':Sequelize[_0x9c26('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x9c26('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x9c26('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x9c26('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x9c26('0x4')},'VoiceQueueId':{'type':Sequelize[_0x9c26('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9c26('0x5'),'comment':_0x9c26('0x4')},'penalty':{'type':Sequelize[_0x9c26('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x9c26('0x4')}};
\ No newline at end of file
index eb89919..d630a8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x707e=['remove','emit','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update'];(function(_0x4c1cda,_0xf0a97){var _0x53591d=function(_0x35a266){while(--_0x35a266){_0x4c1cda['push'](_0x4c1cda['shift']());}};_0x53591d(++_0xf0a97);}(_0x707e,0x64));var _0xe707=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0x707e[_0x421196];return _0x2738af;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xe707('0x0'))['db'][_0xe707('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xe707('0x2')](0x0);var events={'afterCreate':_0xe707('0x3'),'afterUpdate':_0xe707('0x4'),'afterDestroy':_0xe707('0x5')};function emitEvent(_0x2d8782){return function(_0xafa2e4,_0x595f67,_0x4b0c96){UserVoiceQueueRtEvents[_0xe707('0x6')](_0x2d8782+':'+_0xafa2e4['id'],_0xafa2e4);UserVoiceQueueRtEvents['emit'](_0x2d8782,_0xafa2e4);_0x4b0c96(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0x7a0e=['save','update','emit','hook','exports','UserVoiceQueueRt','setMaxListeners'];(function(_0xff0ade,_0xa45072){var _0xe2b0dd=function(_0x4fef80){while(--_0x4fef80){_0xff0ade['push'](_0xff0ade['shift']());}};_0xe2b0dd(++_0xa45072);}(_0x7a0e,0x11d));var _0xe7a0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7a0e[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xe7a0('0x0')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xe7a0('0x1')](0x0);var events={'afterCreate':_0xe7a0('0x2'),'afterUpdate':_0xe7a0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x544fc3){return function(_0x3ab8b1,_0x3501aa,_0x16f5f3){UserVoiceQueueRtEvents[_0xe7a0('0x4')](_0x544fc3+':'+_0x3ab8b1['id'],_0x3ab8b1);UserVoiceQueueRtEvents[_0xe7a0('0x4')](_0x544fc3,_0x3ab8b1);_0x16f5f3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xe7a0('0x5')](e,emitEvent(event));}}module[_0xe7a0('0x6')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index 3587725..450cf64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8647=['path','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8647,0xbd));var _0x7864=function(_0x45d517,_0x27794d){_0x45d517=_0x45d517-0x0;var _0x4418a6=_0x8647[_0x45d517];return _0x4418a6;};'use strict';var _=require(_0x7864('0x0'));var util=require(_0x7864('0x1'));var logger=require(_0x7864('0x2'))(_0x7864('0x3'));var moment=require(_0x7864('0x4'));var BPromise=require(_0x7864('0x5'));var rp=require(_0x7864('0x6'));var fs=require('fs');var path=require(_0x7864('0x7'));var rimraf=require('rimraf');var config=require(_0x7864('0x8'));var attributes=require(_0x7864('0x9'));module[_0x7864('0xa')]=function(_0x466edc,_0x487664){return _0x466edc[_0x7864('0xb')](_0x7864('0xc'),attributes,{'tableName':_0x7864('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x464d=['api','moment','bluebird','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger'];(function(_0x1b66d4,_0x448431){var _0x3af93b=function(_0x361750){while(--_0x361750){_0x1b66d4['push'](_0x1b66d4['shift']());}};_0x3af93b(++_0x448431);}(_0x464d,0xe5));var _0xd464=function(_0x49dead,_0x2d2902){_0x49dead=_0x49dead-0x0;var _0x27fd7c=_0x464d[_0x49dead];return _0x27fd7c;};'use strict';var _=require(_0xd464('0x0'));var util=require('util');var logger=require(_0xd464('0x1'))(_0xd464('0x2'));var moment=require(_0xd464('0x3'));var BPromise=require(_0xd464('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd464('0x5'));var config=require('../../config/environment');var attributes=require(_0xd464('0x6'));module[_0xd464('0x7')]=function(_0x3ae25e,_0x4e6c6a){return _0x3ae25e[_0xd464('0x8')](_0xd464('0x9'),attributes,{'tableName':_0xd464('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4bda6a7..fb1d529 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7741=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','bluebird','randomstring','ioredis'];(function(_0x3db1a6,_0x1e1104){var _0x56d613=function(_0x401b36){while(--_0x401b36){_0x3db1a6['push'](_0x3db1a6['shift']());}};_0x56d613(++_0x1e1104);}(_0x7741,0x1cf));var _0x1774=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x7741[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x1774('0x0'));var util=require(_0x1774('0x1'));var moment=require('moment');var BPromise=require(_0x1774('0x2'));var rs=require(_0x1774('0x3'));var fs=require('fs');var Redis=require(_0x1774('0x4'));var db=require(_0x1774('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1774('0x6'))(_0x1774('0x7'));var config=require(_0x1774('0x8'));var jayson=require(_0x1774('0x9'));var client=jayson[_0x1774('0xa')][_0x1774('0xb')]({'port':0x232a});config[_0x1774('0xc')]=_['defaults'](config[_0x1774('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0x1774('0xd')](socket);function respondWithRpcPromise(_0x16e3b0,_0x70039e,_0x1a1a02){return new BPromise(function(_0x2901b5,_0xd4e2d6){return client[_0x1774('0xe')](_0x16e3b0,_0x1a1a02)[_0x1774('0xf')](function(_0x5a4b06){logger[_0x1774('0x10')](_0x1774('0x11'),_0x70039e,_0x1774('0x12'));logger[_0x1774('0x13')](_0x1774('0x14'),_0x70039e,_0x1774('0x12'),JSON[_0x1774('0x15')](_0x5a4b06));if(_0x5a4b06[_0x1774('0x16')]){if(_0x5a4b06[_0x1774('0x16')][_0x1774('0x17')]===0x1f4){logger[_0x1774('0x16')](_0x1774('0x11'),_0x70039e,_0x5a4b06[_0x1774('0x16')][_0x1774('0x18')]);return _0xd4e2d6(_0x5a4b06['error'][_0x1774('0x18')]);}logger['error'](_0x1774('0x11'),_0x70039e,_0x5a4b06[_0x1774('0x16')][_0x1774('0x18')]);return _0x2901b5(_0x5a4b06[_0x1774('0x16')]['message']);}else{logger[_0x1774('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x70039e,_0x1774('0x12'));_0x2901b5(_0x5a4b06[_0x1774('0x19')][_0x1774('0x18')]);}})[_0x1774('0x1a')](function(_0x1f834f){logger[_0x1774('0x16')](_0x1774('0x11'),_0x70039e,_0x1f834f);_0xd4e2d6(_0x1f834f);});});}exports[_0x1774('0x1b')]=function(_0x56bf0e){var _0x47ad4b=this;return new Promise(function(_0x4c64c8,_0x3e84fd){return db[_0x1774('0x1c')]['findAll']({'raw':_0x56bf0e[_0x1774('0x1d')]?_0x56bf0e[_0x1774('0x1d')][_0x1774('0x1e')]===undefined?!![]:![]:!![],'where':_0x56bf0e[_0x1774('0x1d')]?_0x56bf0e['options'][_0x1774('0x1f')]||null:null,'attributes':[[db[_0x1774('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1774('0x20')][_0x1774('0x21')](_0x1774('0x22')))),_0x1774('0x23')]]})[_0x1774('0xf')](function(_0x49e9ba){logger[_0x1774('0x10')](_0x1774('0x1b'),_0x56bf0e);logger['debug'](_0x1774('0x1b'),_0x56bf0e,JSON[_0x1774('0x15')](_0x49e9ba));_0x4c64c8(_0x49e9ba);})[_0x1774('0x1a')](function(_0x37f88d){logger[_0x1774('0x16')](_0x1774('0x1b'),_0x37f88d[_0x1774('0x18')],_0x56bf0e);_0x3e84fd(_0x47ad4b[_0x1774('0x16')](0x1f4,_0x37f88d[_0x1774('0x18')]));});});};
\ No newline at end of file
+var _0xaaf2=['code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','debug','util','moment','bluebird','randomstring','ioredis','../../config/logger','http','defaults','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','info','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3f39ab,_0x16c981){var _0x170952=function(_0x45e049){while(--_0x45e049){_0x3f39ab['push'](_0x3f39ab['shift']());}};_0x170952(++_0x16c981);}(_0xaaf2,0x1d7));var _0x2aaf=function(_0x1be7d7,_0x1a95fe){_0x1be7d7=_0x1be7d7-0x0;var _0x3c36e4=_0xaaf2[_0x1be7d7];return _0x3c36e4;};'use strict';var _=require('lodash');var util=require(_0x2aaf('0x0'));var moment=require(_0x2aaf('0x1'));var BPromise=require(_0x2aaf('0x2'));var rs=require(_0x2aaf('0x3'));var fs=require('fs');var Redis=require(_0x2aaf('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2aaf('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2aaf('0x6')]({'port':0x232a});config['redis']=_[_0x2aaf('0x7')](config[_0x2aaf('0x8')],{'host':_0x2aaf('0x9'),'port':0x18eb});var socket=require(_0x2aaf('0xa'))(new Redis(config[_0x2aaf('0x8')]));require(_0x2aaf('0xb'))[_0x2aaf('0xc')](socket);function respondWithRpcPromise(_0x49c2f4,_0x286157,_0x2e4b45){return new BPromise(function(_0x5a53b1,_0x4ca3a1){return client[_0x2aaf('0xd')](_0x49c2f4,_0x2e4b45)['then'](function(_0x2295e8){logger[_0x2aaf('0xe')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x286157,_0x2aaf('0xf'));logger['debug'](_0x2aaf('0x10'),_0x286157,_0x2aaf('0xf'),JSON[_0x2aaf('0x11')](_0x2295e8));if(_0x2295e8[_0x2aaf('0x12')]){if(_0x2295e8['error'][_0x2aaf('0x13')]===0x1f4){logger[_0x2aaf('0x12')](_0x2aaf('0x14'),_0x286157,_0x2295e8[_0x2aaf('0x12')][_0x2aaf('0x15')]);return _0x4ca3a1(_0x2295e8['error']['message']);}logger['error'](_0x2aaf('0x14'),_0x286157,_0x2295e8['error']['message']);return _0x5a53b1(_0x2295e8[_0x2aaf('0x12')][_0x2aaf('0x15')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x286157,'request\x20sent');_0x5a53b1(_0x2295e8[_0x2aaf('0x16')][_0x2aaf('0x15')]);}})['catch'](function(_0x16e6cb){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x286157,_0x16e6cb);_0x4ca3a1(_0x16e6cb);});});}exports[_0x2aaf('0x17')]=function(_0x4c0a65){var _0x55f3ac=this;return new Promise(function(_0x50d572,_0x3b50c8){return db['UserVoiceQueueRt'][_0x2aaf('0x18')]({'raw':_0x4c0a65[_0x2aaf('0x19')]?_0x4c0a65[_0x2aaf('0x19')][_0x2aaf('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c0a65[_0x2aaf('0x19')]?_0x4c0a65['options'][_0x2aaf('0x1b')]||null:null,'attributes':[[db[_0x2aaf('0x1c')]['fn'](_0x2aaf('0x1d'),db['sequelize']['fn']('IF',db[_0x2aaf('0x1c')][_0x2aaf('0x1e')](_0x2aaf('0x1f')))),_0x2aaf('0x20')]]})[_0x2aaf('0x21')](function(_0x351941){logger[_0x2aaf('0xe')](_0x2aaf('0x17'),_0x4c0a65);logger[_0x2aaf('0x22')](_0x2aaf('0x17'),_0x4c0a65,JSON['stringify'](_0x351941));_0x50d572(_0x351941);})['catch'](function(_0x46307f){logger[_0x2aaf('0x12')](_0x2aaf('0x17'),_0x46307f[_0x2aaf('0x15')],_0x4c0a65);_0x3b50c8(_0x55f3ac['error'](0x1f4,_0x46307f[_0x2aaf('0x15')]));});});};
\ No newline at end of file
index f0cf8df..8352a25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7edb=['save','remove','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x19419c,_0x4c6218){var _0x3eaaf6=function(_0x31b1fd){while(--_0x31b1fd){_0x19419c['push'](_0x19419c['shift']());}};_0x3eaaf6(++_0x4c6218);}(_0x7edb,0x158));var _0xb7ed=function(_0x31fb43,_0x3c4f30){_0x31fb43=_0x31fb43-0x0;var _0x4cfde8=_0x7edb[_0x31fb43];return _0x4cfde8;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xb7ed('0x0'),_0xb7ed('0x1'),_0xb7ed('0x2')];function createListener(_0x37440f,_0x15d080){return function(_0x5a485a){_0x15d080[_0xb7ed('0x3')](_0x37440f,_0x5a485a);};}function removeListener(_0x595b65,_0x4c8316){return function(){UserVoiceQueueRtEvents[_0xb7ed('0x4')](_0x595b65,_0x4c8316);};}exports[_0xb7ed('0x5')]=function(_0x2aa67d){for(var _0x246cfa=0x0,_0x85fdf0=events[_0xb7ed('0x6')];_0x246cfa<_0x85fdf0;_0x246cfa++){var _0xac7ffe=events[_0x246cfa];var _0x3c991d=createListener(_0xb7ed('0x7')+_0xac7ffe,_0x2aa67d);UserVoiceQueueRtEvents['on'](_0xac7ffe,_0x3c991d);}};
\ No newline at end of file
+var _0x8403=['remove','update','emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x578e7b,_0x49ca85){var _0x2a3898=function(_0x3099b3){while(--_0x3099b3){_0x578e7b['push'](_0x578e7b['shift']());}};_0x2a3898(++_0x49ca85);}(_0x8403,0x1a5));var _0x3840=function(_0x122218,_0x35aa53){_0x122218=_0x122218-0x0;var _0x540150=_0x8403[_0x122218];return _0x540150;};'use strict';var UserVoiceQueueRtEvents=require(_0x3840('0x0'));var events=[_0x3840('0x1'),_0x3840('0x2'),_0x3840('0x3')];function createListener(_0x28b106,_0x43a9f0){return function(_0x502e0d){_0x43a9f0[_0x3840('0x4')](_0x28b106,_0x502e0d);};}function removeListener(_0x12aa6f,_0x579d29){return function(){UserVoiceQueueRtEvents[_0x3840('0x5')](_0x12aa6f,_0x579d29);};}exports[_0x3840('0x6')]=function(_0x1cd658){for(var _0x233be3=0x0,_0x1fcfd8=events[_0x3840('0x7')];_0x233be3<_0x1fcfd8;_0x233be3++){var _0x59923c=events[_0x233be3];var _0x5aa2c4=createListener(_0x3840('0x8')+_0x59923c,_0x1cd658);UserVoiceQueueRtEvents['on'](_0x59923c,_0x5aa2c4);}};
\ No newline at end of file
index 3cdc367..cd0e43b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x44aa31,_0x4e1ac8){var _0x19a983=function(_0x4f181a){while(--_0x4f181a){_0x44aa31['push'](_0x44aa31['shift']());}};_0x19a983(++_0x4e1ac8);}(_0xe706,0xa3));var _0x6e70=function(_0x4e0a03,_0x5eb6b0){_0x4e0a03=_0x4e0a03-0x0;var _0x2478fc=_0xe706[_0x4e0a03];return _0x2478fc;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x136619,_0x31c9b2){var _0x38c4a5=function(_0x10b74d){while(--_0x10b74d){_0x136619['push'](_0x136619['shift']());}};_0x38c4a5(++_0x31c9b2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 7d7925d..2e488a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1239=['INTEGER','sequelize','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x1239,0x19c));var _0x9123=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1239[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x9123('0x0'));module[_0x9123('0x1')]={'penalty':{'type':Sequelize[_0x9123('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6877=['INTEGER','sequelize','exports'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x6877,0xb5));var _0x7687=function(_0x47a40b,_0x443ecf){_0x47a40b=_0x47a40b-0x0;var _0x19610c=_0x6877[_0x47a40b];return _0x19610c;};'use strict';var Sequelize=require(_0x7687('0x0'));module[_0x7687('0x1')]={'penalty':{'type':Sequelize[_0x7687('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 29a4223..4beee5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cfc=['define','user_has_whatsapp_queues','lodash','moment','request-promise','rimraf','../../config/environment'];(function(_0x277a47,_0x5b00e6){var _0x42ea62=function(_0x584fc1){while(--_0x584fc1){_0x277a47['push'](_0x277a47['shift']());}};_0x42ea62(++_0x5b00e6);}(_0x3cfc,0x8e));var _0xc3cf=function(_0x12db95,_0xc9310a){_0x12db95=_0x12db95-0x0;var _0x1cc1f1=_0x3cfc[_0x12db95];return _0x1cc1f1;};'use strict';var _=require(_0xc3cf('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc3cf('0x1'));var BPromise=require('bluebird');var rp=require(_0xc3cf('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc3cf('0x3'));var config=require(_0xc3cf('0x4'));var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x4485d8,_0x2ade65){return _0x4485d8[_0xc3cf('0x5')]('UserWhatsappQueue',attributes,{'tableName':_0xc3cf('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9406=['../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9406,0xe7));var _0x6940=function(_0x208705,_0x1ee99d){_0x208705=_0x208705-0x0;var _0x101594=_0x9406[_0x208705];return _0x101594;};'use strict';var _=require(_0x6940('0x0'));var util=require(_0x6940('0x1'));var logger=require(_0x6940('0x2'))(_0x6940('0x3'));var moment=require(_0x6940('0x4'));var BPromise=require(_0x6940('0x5'));var rp=require(_0x6940('0x6'));var fs=require('fs');var path=require(_0x6940('0x7'));var rimraf=require(_0x6940('0x8'));var config=require(_0x6940('0x9'));var attributes=require(_0x6940('0xa'));module[_0x6940('0xb')]=function(_0x320c0c,_0x19d707){return _0x320c0c[_0x6940('0xc')](_0x6940('0xd'),attributes,{'tableName':_0x6940('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 000b7ca..4eec865 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0aea=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment'];(function(_0x34ebe3,_0x1148ca){var _0x2dc419=function(_0x46dce7){while(--_0x46dce7){_0x34ebe3['push'](_0x34ebe3['shift']());}};_0x2dc419(++_0x1148ca);}(_0x0aea,0x105));var _0xa0ae=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0x0aea[_0x4dab14];return _0xf41aa;};'use strict';var _=require(_0xa0ae('0x0'));var util=require(_0xa0ae('0x1'));var moment=require(_0xa0ae('0x2'));var BPromise=require('bluebird');var rs=require(_0xa0ae('0x3'));var fs=require('fs');var Redis=require(_0xa0ae('0x4'));var db=require(_0xa0ae('0x5'))['db'];var utils=require(_0xa0ae('0x6'));var logger=require(_0xa0ae('0x7'))(_0xa0ae('0x8'));var config=require(_0xa0ae('0x9'));var jayson=require(_0xa0ae('0xa'));var client=jayson[_0xa0ae('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x318c9d,_0x5bc1b5,_0x322aae){return new BPromise(function(_0x3cb372,_0x1b7319){return client['request'](_0x318c9d,_0x322aae)['then'](function(_0x34cb00){logger[_0xa0ae('0xc')](_0xa0ae('0xd'),_0x5bc1b5,_0xa0ae('0xe'));logger['debug'](_0xa0ae('0xf'),_0x5bc1b5,'request\x20sent',JSON[_0xa0ae('0x10')](_0x34cb00));if(_0x34cb00['error']){if(_0x34cb00['error'][_0xa0ae('0x11')]===0x1f4){logger[_0xa0ae('0x12')](_0xa0ae('0xd'),_0x5bc1b5,_0x34cb00['error'][_0xa0ae('0x13')]);return _0x1b7319(_0x34cb00['error'][_0xa0ae('0x13')]);}logger['error'](_0xa0ae('0xd'),_0x5bc1b5,_0x34cb00[_0xa0ae('0x12')][_0xa0ae('0x13')]);return _0x3cb372(_0x34cb00[_0xa0ae('0x12')][_0xa0ae('0x13')]);}else{logger[_0xa0ae('0xc')](_0xa0ae('0xd'),_0x5bc1b5,_0xa0ae('0xe'));_0x3cb372(_0x34cb00[_0xa0ae('0x14')][_0xa0ae('0x13')]);}})[_0xa0ae('0x15')](function(_0x39f7cb){logger[_0xa0ae('0x12')](_0xa0ae('0xd'),_0x5bc1b5,_0x39f7cb);_0x1b7319(_0x39f7cb);});});}
\ No newline at end of file
+var _0x6c32=['UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x32056c,_0x1b6db7){var _0x317313=function(_0x6456b6){while(--_0x6456b6){_0x32056c['push'](_0x32056c['shift']());}};_0x317313(++_0x1b6db7);}(_0x6c32,0xe4));var _0x26c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6c32[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x26c3('0x0'));var util=require(_0x26c3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x26c3('0x2'));var fs=require('fs');var Redis=require(_0x26c3('0x3'));var db=require(_0x26c3('0x4'))['db'];var utils=require(_0x26c3('0x5'));var logger=require(_0x26c3('0x6'))(_0x26c3('0x7'));var config=require('../../config/environment');var jayson=require(_0x26c3('0x8'));var client=jayson[_0x26c3('0x9')][_0x26c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1095b2,_0x161b69,_0x446b79){return new BPromise(function(_0xd1e45,_0x416129){return client[_0x26c3('0xb')](_0x1095b2,_0x446b79)[_0x26c3('0xc')](function(_0x4d84df){logger[_0x26c3('0xd')](_0x26c3('0xe'),_0x161b69,_0x26c3('0xf'));logger[_0x26c3('0x10')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x161b69,'request\x20sent',JSON[_0x26c3('0x11')](_0x4d84df));if(_0x4d84df[_0x26c3('0x12')]){if(_0x4d84df[_0x26c3('0x12')][_0x26c3('0x13')]===0x1f4){logger[_0x26c3('0x12')](_0x26c3('0xe'),_0x161b69,_0x4d84df[_0x26c3('0x12')][_0x26c3('0x14')]);return _0x416129(_0x4d84df[_0x26c3('0x12')][_0x26c3('0x14')]);}logger[_0x26c3('0x12')](_0x26c3('0xe'),_0x161b69,_0x4d84df[_0x26c3('0x12')][_0x26c3('0x14')]);return _0xd1e45(_0x4d84df[_0x26c3('0x12')][_0x26c3('0x14')]);}else{logger[_0x26c3('0xd')](_0x26c3('0xe'),_0x161b69,'request\x20sent');_0xd1e45(_0x4d84df['result']['message']);}})[_0x26c3('0x15')](function(_0x4be64a){logger[_0x26c3('0x12')](_0x26c3('0xe'),_0x161b69,_0x4be64a);_0x416129(_0x4be64a);});});}
\ No newline at end of file
index d0c1ed0..5630d7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa37e=['post','isAuthenticated','create','/:id','update','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./variable.controller','get','show'];(function(_0x591f9d,_0xc3893f){var _0x5aa197=function(_0xa3bba6){while(--_0xa3bba6){_0x591f9d['push'](_0x591f9d['shift']());}};_0x5aa197(++_0xc3893f);}(_0xa37e,0x97));var _0xea37=function(_0x1eee7e,_0x34fb43){_0x1eee7e=_0x1eee7e-0x0;var _0x1b5573=_0xa37e[_0x1eee7e];return _0x1b5573;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xea37('0x0'));var timeout=require(_0xea37('0x1'));var express=require(_0xea37('0x2'));var router=express[_0xea37('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xea37('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xea37('0x5'));var controller=require(_0xea37('0x6'));router[_0xea37('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xea37('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xea37('0x8')]);router[_0xea37('0x9')]('/',auth[_0xea37('0xa')](),controller[_0xea37('0xb')]);router['put'](_0xea37('0xc'),auth[_0xea37('0xa')](),controller[_0xea37('0xd')]);router['delete']('/:id',auth[_0xea37('0xa')](),controller[_0xea37('0xe')]);module[_0xea37('0xf')]=router;
\ No newline at end of file
+var _0x6aa7=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','post','create','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6aa7,0x178));var _0x76aa=function(_0xc574d8,_0xa989ab){_0xc574d8=_0xc574d8-0x0;var _0x54ca00=_0x6aa7[_0xc574d8];return _0x54ca00;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./variable.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0xb')]('/',auth[_0x76aa('0x8')](),controller[_0x76aa('0xc')]);router['put'](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0xe')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);module[_0x76aa('0x10')]=router;
\ No newline at end of file
index f2211c5..382dd63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77ec=['exports','STRING','name','sequelize'];(function(_0x50a7bb,_0x390f42){var _0x5cb421=function(_0x30e660){while(--_0x30e660){_0x50a7bb['push'](_0x50a7bb['shift']());}};_0x5cb421(++_0x390f42);}(_0x77ec,0x1cf));var _0xc77e=function(_0x3a8828,_0x28df78){_0x3a8828=_0x3a8828-0x0;var _0x15d200=_0x77ec[_0x3a8828];return _0x15d200;};'use strict';var Sequelize=require(_0xc77e('0x0'));module[_0xc77e('0x1')]={'name':{'type':Sequelize[_0xc77e('0x2')],'unique':_0xc77e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc77e('0x2')]}};
\ No newline at end of file
+var _0x10eb=['STRING','name','sequelize'];(function(_0x1678a1,_0x14d3cf){var _0x28856b=function(_0x5a26b9){while(--_0x5a26b9){_0x1678a1['push'](_0x1678a1['shift']());}};_0x28856b(++_0x14d3cf);}(_0x10eb,0x71));var _0xb10e=function(_0x3994e4,_0x4c41d2){_0x3994e4=_0x3994e4-0x0;var _0x347665=_0x10eb[_0x3994e4];return _0x347665;};'use strict';var Sequelize=require(_0xb10e('0x0'));module['exports']={'name':{'type':Sequelize[_0xb10e('0x1')],'unique':_0xb10e('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb10e('0x1')]}};
\ No newline at end of file
index d15ec62..5ff6033 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6fa=['bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','end','sendStatus','error','name','send','index','map','Variable','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir'];(function(_0x4d7a8b,_0x3afdcd){var _0x9b5113=function(_0x1a529f){while(--_0x1a529f){_0x4d7a8b['push'](_0x4d7a8b['shift']());}};_0x9b5113(++_0x3afdcd);}(_0xd6fa,0x192));var _0xad6f=function(_0xab800b,_0x1d70cd){_0xab800b=_0xab800b-0x0;var _0x1cfb63=_0xd6fa[_0xab800b];return _0x1cfb63;};'use strict';var emlformat=require(_0xad6f('0x0'));var rimraf=require(_0xad6f('0x1'));var zipdir=require(_0xad6f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xad6f('0x3'));var Mustache=require(_0xad6f('0x4'));var util=require(_0xad6f('0x5'));var path=require(_0xad6f('0x6'));var sox=require(_0xad6f('0x7'));var csv=require('to-csv');var ejs=require(_0xad6f('0x8'));var fs=require('fs');var fs_extra=require(_0xad6f('0x9'));var _=require(_0xad6f('0xa'));var squel=require(_0xad6f('0xb'));var crypto=require(_0xad6f('0xc'));var jsforce=require(_0xad6f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xad6f('0xe'));var Redis=require(_0xad6f('0xf'));var authService=require(_0xad6f('0x10'));var qs=require(_0xad6f('0x11'));var as=require(_0xad6f('0x12'));var hardwareService=require(_0xad6f('0x13'));var logger=require(_0xad6f('0x14'))(_0xad6f('0x15'));var utils=require(_0xad6f('0x16'));var config=require(_0xad6f('0x17'));var licenseUtil=require(_0xad6f('0x18'));var db=require(_0xad6f('0x19'))['db'];function respondWithStatusCode(_0x35338c,_0x1dee7b){_0x1dee7b=_0x1dee7b||0xcc;return function(_0x3916c9){if(_0x3916c9){return _0x35338c['sendStatus'](_0x1dee7b);}return _0x35338c[_0xad6f('0x1a')](_0x1dee7b)['end']();};}function respondWithResult(_0x1619c1,_0x3b92c6){_0x3b92c6=_0x3b92c6||0xc8;return function(_0x550bb8){if(_0x550bb8){return _0x1619c1[_0xad6f('0x1a')](_0x3b92c6)[_0xad6f('0x1b')](_0x550bb8);}};}function respondWithFilteredResult(_0x1e798c,_0x4e859d){return function(_0xd96268){if(_0xd96268){var _0x46ae11=typeof _0x4e859d[_0xad6f('0x1c')]===_0xad6f('0x1d')&&typeof _0x4e859d[_0xad6f('0x1e')]===_0xad6f('0x1d');var _0x3b498f=_0xd96268['count'];var _0x32101f=_0x46ae11?0x0:_0x4e859d['offset'];var _0x2fbf50=_0x46ae11?_0xd96268[_0xad6f('0x1f')]:_0x4e859d[_0xad6f('0x1c')]+_0x4e859d['limit'];var _0x4ac390;if(_0x2fbf50>=_0x3b498f){_0x2fbf50=_0x3b498f;_0x4ac390=0xc8;}else{_0x4ac390=0xce;}_0x1e798c['status'](_0x4ac390);return _0x1e798c[_0xad6f('0x20')]('Content-Range',_0x32101f+'-'+_0x2fbf50+'/'+_0x3b498f)[_0xad6f('0x1b')](_0xd96268);}return null;};}function patchUpdates(_0x2cd9a2){return function(_0x5f1781){try{jsonpatch[_0xad6f('0x21')](_0x5f1781,_0x2cd9a2,!![]);}catch(_0xa9085c){return BPromise[_0xad6f('0x22')](_0xa9085c);}return _0x5f1781[_0xad6f('0x23')]();};}function saveUpdates(_0x2f7550,_0xac08ce){return function(_0x2bd870){if(_0x2bd870){return _0x2bd870[_0xad6f('0x24')](_0x2f7550)[_0xad6f('0x25')](function(_0x461c3a){return _0x461c3a;});}return null;};}function removeEntity(_0x36ca9e,_0x5de4f6){return function(_0x5f11c5){if(_0x5f11c5){return _0x5f11c5[_0xad6f('0x26')]()[_0xad6f('0x25')](function(){var _0x4f78cb=_0x5f11c5[_0xad6f('0x27')]({'plain':!![]});var _0x335f22=_0xad6f('0x28');return db[_0xad6f('0x29')][_0xad6f('0x26')]({'where':{'type':_0x335f22,'resourceId':_0x4f78cb['id']}})[_0xad6f('0x25')](function(){return _0x5f11c5;});})['then'](function(){_0x36ca9e[_0xad6f('0x1a')](0xcc)[_0xad6f('0x2a')]();});}};}function handleEntityNotFound(_0x4b883a,_0x227ab2){return function(_0x2c0378){if(!_0x2c0378){_0x4b883a[_0xad6f('0x2b')](0x194);}return _0x2c0378;};}function handleError(_0x379935,_0x5f35bb){_0x5f35bb=_0x5f35bb||0x1f4;return function(_0x3922dd){logger[_0xad6f('0x2c')](_0x3922dd['stack']);if(_0x3922dd[_0xad6f('0x2d')]){delete _0x3922dd['name'];}_0x379935[_0xad6f('0x1a')](_0x5f35bb)[_0xad6f('0x2e')](_0x3922dd);};}exports[_0xad6f('0x2f')]=function(_0x2b36a8,_0x4791c7){var _0x2cbf70={},_0x5172b4={},_0x44ed76={'count':0x0,'rows':[]};var _0x5e10a3=_[_0xad6f('0x30')](db[_0xad6f('0x31')]['rawAttributes'],function(_0x27457b){return{'name':_0x27457b['fieldName'],'type':_0x27457b[_0xad6f('0x32')]['key']};});_0x5172b4[_0xad6f('0x33')]=_['map'](_0x5e10a3,'name');_0x5172b4['query']=_['keys'](_0x2b36a8[_0xad6f('0x34')]);_0x5172b4[_0xad6f('0x35')]=_[_0xad6f('0x36')](_0x5172b4['model'],_0x5172b4[_0xad6f('0x34')]);_0x2cbf70[_0xad6f('0x37')]=_[_0xad6f('0x36')](_0x5172b4[_0xad6f('0x33')],qs[_0xad6f('0x38')](_0x2b36a8[_0xad6f('0x34')][_0xad6f('0x38')]));_0x2cbf70['attributes']=_0x2cbf70[_0xad6f('0x37')][_0xad6f('0x39')]?_0x2cbf70[_0xad6f('0x37')]:_0x5172b4[_0xad6f('0x33')];if(!_0x2b36a8[_0xad6f('0x34')][_0xad6f('0x3a')]('nolimit')){_0x2cbf70['limit']=qs[_0xad6f('0x1e')](_0x2b36a8[_0xad6f('0x34')]['limit']);_0x2cbf70[_0xad6f('0x1c')]=qs[_0xad6f('0x1c')](_0x2b36a8[_0xad6f('0x34')][_0xad6f('0x1c')]);}_0x2cbf70['order']=qs[_0xad6f('0x3b')](_0x2b36a8[_0xad6f('0x34')][_0xad6f('0x3b')]);_0x2cbf70['where']=qs[_0xad6f('0x35')](_['pick'](_0x2b36a8['query'],_0x5172b4[_0xad6f('0x35')]),_0x5e10a3);if(_0x2b36a8['query']['filter']){_0x2cbf70[_0xad6f('0x3c')]=_[_0xad6f('0x3d')](_0x2cbf70[_0xad6f('0x3c')],{'$or':_[_0xad6f('0x30')](_0x5e10a3,function(_0x65558d){if(_0x65558d[_0xad6f('0x32')]!==_0xad6f('0x3e')){var _0x241690={};_0x241690[_0x65558d['name']]={'$like':'%'+_0x2b36a8[_0xad6f('0x34')]['filter']+'%'};return _0x241690;}})});}_0x2cbf70=_[_0xad6f('0x3d')]({},_0x2cbf70,_0x2b36a8[_0xad6f('0x3f')]);var _0xfd646d={'where':_0x2cbf70[_0xad6f('0x3c')]};return db['Variable']['count'](_0xfd646d)['then'](function(_0x2657c8){_0x44ed76['count']=_0x2657c8;if(_0x2b36a8[_0xad6f('0x34')][_0xad6f('0x40')]){_0x2cbf70[_0xad6f('0x41')]=[{'all':!![]}];}return db[_0xad6f('0x31')][_0xad6f('0x42')](_0x2cbf70);})[_0xad6f('0x25')](function(_0x5f1c18){_0x44ed76[_0xad6f('0x43')]=_0x5f1c18;return _0x44ed76;})[_0xad6f('0x25')](respondWithFilteredResult(_0x4791c7,_0x2cbf70))['catch'](handleError(_0x4791c7,null));};exports['show']=function(_0x141bfb,_0x5a1504){var _0x50bd3a={'raw':!![],'where':{'id':_0x141bfb[_0xad6f('0x44')]['id']}},_0xef1068={};_0xef1068['model']=_['keys'](db[_0xad6f('0x31')]['rawAttributes']);_0xef1068[_0xad6f('0x34')]=_[_0xad6f('0x45')](_0x141bfb['query']);_0xef1068[_0xad6f('0x35')]=_['intersection'](_0xef1068[_0xad6f('0x33')],_0xef1068[_0xad6f('0x34')]);_0x50bd3a['attributes']=_[_0xad6f('0x36')](_0xef1068[_0xad6f('0x33')],qs['fields'](_0x141bfb[_0xad6f('0x34')][_0xad6f('0x38')]));_0x50bd3a[_0xad6f('0x37')]=_0x50bd3a[_0xad6f('0x37')][_0xad6f('0x39')]?_0x50bd3a[_0xad6f('0x37')]:_0xef1068[_0xad6f('0x33')];if(_0x141bfb[_0xad6f('0x34')][_0xad6f('0x40')]){_0x50bd3a[_0xad6f('0x41')]=[{'all':!![]}];}_0x50bd3a=_['merge']({},_0x50bd3a,_0x141bfb['options']);return db[_0xad6f('0x31')][_0xad6f('0x46')](_0x50bd3a)[_0xad6f('0x25')](handleEntityNotFound(_0x5a1504,null))[_0xad6f('0x25')](respondWithResult(_0x5a1504,null))['catch'](handleError(_0x5a1504,null));};exports[_0xad6f('0x47')]=function(_0x38ed1a,_0x31b48e){return db['Variable'][_0xad6f('0x47')](_0x38ed1a[_0xad6f('0x48')],{})[_0xad6f('0x25')](function(_0x3a7bc5){var _0x5ae97f=_0x38ed1a[_0xad6f('0x49')][_0xad6f('0x27')]({'plain':!![]});if(!_0x5ae97f)throw new Error(_0xad6f('0x4a'));if(_0x5ae97f[_0xad6f('0x4b')]==='user'){var _0x57f392=_0x3a7bc5[_0xad6f('0x27')]({'plain':!![]});var _0x2569ce=_0xad6f('0x28');return db[_0xad6f('0x4c')]['find']({'where':{'name':_0x2569ce,'userProfileId':_0x5ae97f[_0xad6f('0x4d')]},'raw':!![]})['then'](function(_0x534feb){if(_0x534feb&&_0x534feb[_0xad6f('0x4e')]===0x0){return db[_0xad6f('0x29')][_0xad6f('0x47')]({'name':_0x57f392['name'],'resourceId':_0x57f392['id'],'type':_0x534feb[_0xad6f('0x2d')],'sectionId':_0x534feb['id']},{})[_0xad6f('0x25')](function(){return _0x3a7bc5;});}else{return _0x3a7bc5;}})[_0xad6f('0x4f')](function(_0x465656){logger['error'](_0xad6f('0x50'),_0x465656);throw _0x465656;});}return _0x3a7bc5;})[_0xad6f('0x25')](respondWithResult(_0x31b48e,0xc9))[_0xad6f('0x4f')](handleError(_0x31b48e,null));};exports['update']=function(_0x55f810,_0x1a80cc){if(_0x55f810[_0xad6f('0x48')]['id']){delete _0x55f810[_0xad6f('0x48')]['id'];}return db[_0xad6f('0x31')]['find']({'where':{'id':_0x55f810[_0xad6f('0x44')]['id']}})[_0xad6f('0x25')](handleEntityNotFound(_0x1a80cc,null))[_0xad6f('0x25')](saveUpdates(_0x55f810[_0xad6f('0x48')],null))[_0xad6f('0x25')](respondWithResult(_0x1a80cc,null))['catch'](handleError(_0x1a80cc,null));};exports[_0xad6f('0x26')]=function(_0x1b8496,_0x137f7c){return db[_0xad6f('0x31')][_0xad6f('0x46')]({'where':{'id':_0x1b8496[_0xad6f('0x44')]['id']}})[_0xad6f('0x25')](handleEntityNotFound(_0x137f7c,null))[_0xad6f('0x25')](removeEntity(_0x137f7c,null))[_0xad6f('0x4f')](handleError(_0x137f7c,null));};
\ No newline at end of file
+var _0x869d=['length','order','sort','where','pick','filter','merge','Variable','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Variables','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','map','query','filters','model','attributes','intersection','fields'];(function(_0x330cc7,_0x369fd4){var _0x2763c9=function(_0x473d4b){while(--_0x473d4b){_0x330cc7['push'](_0x330cc7['shift']());}};_0x2763c9(++_0x369fd4);}(_0x869d,0x70));var _0xd869=function(_0x3f6f7b,_0x59216f){_0x3f6f7b=_0x3f6f7b-0x0;var _0x59bff8=_0x869d[_0x3f6f7b];return _0x59bff8;};'use strict';var emlformat=require(_0xd869('0x0'));var rimraf=require(_0xd869('0x1'));var zipdir=require(_0xd869('0x2'));var jsonpatch=require(_0xd869('0x3'));var rp=require(_0xd869('0x4'));var moment=require(_0xd869('0x5'));var BPromise=require(_0xd869('0x6'));var Mustache=require(_0xd869('0x7'));var util=require(_0xd869('0x8'));var path=require('path');var sox=require(_0xd869('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd869('0xa'));var _=require(_0xd869('0xb'));var squel=require(_0xd869('0xc'));var crypto=require(_0xd869('0xd'));var jsforce=require(_0xd869('0xe'));var deskjs=require(_0xd869('0xf'));var toCsv=require(_0xd869('0x10'));var querystring=require(_0xd869('0x11'));var Papa=require(_0xd869('0x12'));var Redis=require(_0xd869('0x13'));var authService=require(_0xd869('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd869('0x15'));var logger=require(_0xd869('0x16'))(_0xd869('0x17'));var utils=require(_0xd869('0x18'));var config=require(_0xd869('0x19'));var licenseUtil=require(_0xd869('0x1a'));var db=require(_0xd869('0x1b'))['db'];function respondWithStatusCode(_0x4dabcd,_0x45267b){_0x45267b=_0x45267b||0xcc;return function(_0xe9b6bf){if(_0xe9b6bf){return _0x4dabcd['sendStatus'](_0x45267b);}return _0x4dabcd['status'](_0x45267b)[_0xd869('0x1c')]();};}function respondWithResult(_0x1d012a,_0x3b372d){_0x3b372d=_0x3b372d||0xc8;return function(_0x5a4734){if(_0x5a4734){return _0x1d012a[_0xd869('0x1d')](_0x3b372d)[_0xd869('0x1e')](_0x5a4734);}};}function respondWithFilteredResult(_0x352d63,_0x14a1b0){return function(_0x290b3e){if(_0x290b3e){var _0x2fa09d=typeof _0x14a1b0[_0xd869('0x1f')]===_0xd869('0x20')&&typeof _0x14a1b0[_0xd869('0x21')]==='undefined';var _0x35230c=_0x290b3e['count'];var _0x3147d8=_0x2fa09d?0x0:_0x14a1b0['offset'];var _0x652234=_0x2fa09d?_0x290b3e[_0xd869('0x22')]:_0x14a1b0['offset']+_0x14a1b0[_0xd869('0x21')];var _0x4e1dd3;if(_0x652234>=_0x35230c){_0x652234=_0x35230c;_0x4e1dd3=0xc8;}else{_0x4e1dd3=0xce;}_0x352d63[_0xd869('0x1d')](_0x4e1dd3);return _0x352d63[_0xd869('0x23')](_0xd869('0x24'),_0x3147d8+'-'+_0x652234+'/'+_0x35230c)[_0xd869('0x1e')](_0x290b3e);}return null;};}function patchUpdates(_0x58b1fd){return function(_0xcadd54){try{jsonpatch[_0xd869('0x25')](_0xcadd54,_0x58b1fd,!![]);}catch(_0x38e706){return BPromise['reject'](_0x38e706);}return _0xcadd54[_0xd869('0x26')]();};}function saveUpdates(_0x40093f,_0x3f8c70){return function(_0x42ae2c){if(_0x42ae2c){return _0x42ae2c[_0xd869('0x27')](_0x40093f)[_0xd869('0x28')](function(_0x189ab0){return _0x189ab0;});}return null;};}function removeEntity(_0x380f19,_0x47f981){return function(_0x10f538){if(_0x10f538){return _0x10f538[_0xd869('0x29')]()[_0xd869('0x28')](function(){var _0x512b47=_0x10f538[_0xd869('0x2a')]({'plain':!![]});var _0x6741bd=_0xd869('0x2b');return db['UserProfileResource'][_0xd869('0x29')]({'where':{'type':_0x6741bd,'resourceId':_0x512b47['id']}})[_0xd869('0x28')](function(){return _0x10f538;});})[_0xd869('0x28')](function(){_0x380f19[_0xd869('0x1d')](0xcc)[_0xd869('0x1c')]();});}};}function handleEntityNotFound(_0x12cbb9,_0xb03b69){return function(_0xfa96ed){if(!_0xfa96ed){_0x12cbb9[_0xd869('0x2c')](0x194);}return _0xfa96ed;};}function handleError(_0x48abb4,_0x389b1e){_0x389b1e=_0x389b1e||0x1f4;return function(_0x14b1c6){logger[_0xd869('0x2d')](_0x14b1c6['stack']);if(_0x14b1c6[_0xd869('0x2e')]){delete _0x14b1c6[_0xd869('0x2e')];}_0x48abb4[_0xd869('0x1d')](_0x389b1e)[_0xd869('0x2f')](_0x14b1c6);};}exports[_0xd869('0x30')]=function(_0x19e68c,_0x53ceb9){var _0x724f02={},_0x1b0e83={},_0x50f907={'count':0x0,'rows':[]};var _0x270eeb=_['map'](db['Variable'][_0xd869('0x31')],function(_0x4ccacf){return{'name':_0x4ccacf[_0xd869('0x32')],'type':_0x4ccacf[_0xd869('0x33')][_0xd869('0x34')]};});_0x1b0e83['model']=_[_0xd869('0x35')](_0x270eeb,_0xd869('0x2e'));_0x1b0e83['query']=_['keys'](_0x19e68c[_0xd869('0x36')]);_0x1b0e83[_0xd869('0x37')]=_['intersection'](_0x1b0e83[_0xd869('0x38')],_0x1b0e83[_0xd869('0x36')]);_0x724f02[_0xd869('0x39')]=_[_0xd869('0x3a')](_0x1b0e83[_0xd869('0x38')],qs[_0xd869('0x3b')](_0x19e68c['query']['fields']));_0x724f02[_0xd869('0x39')]=_0x724f02[_0xd869('0x39')][_0xd869('0x3c')]?_0x724f02['attributes']:_0x1b0e83[_0xd869('0x38')];if(!_0x19e68c[_0xd869('0x36')]['hasOwnProperty']('nolimit')){_0x724f02[_0xd869('0x21')]=qs[_0xd869('0x21')](_0x19e68c[_0xd869('0x36')][_0xd869('0x21')]);_0x724f02[_0xd869('0x1f')]=qs['offset'](_0x19e68c[_0xd869('0x36')][_0xd869('0x1f')]);}_0x724f02[_0xd869('0x3d')]=qs['sort'](_0x19e68c['query'][_0xd869('0x3e')]);_0x724f02[_0xd869('0x3f')]=qs[_0xd869('0x37')](_[_0xd869('0x40')](_0x19e68c['query'],_0x1b0e83[_0xd869('0x37')]),_0x270eeb);if(_0x19e68c[_0xd869('0x36')][_0xd869('0x41')]){_0x724f02['where']=_[_0xd869('0x42')](_0x724f02[_0xd869('0x3f')],{'$or':_['map'](_0x270eeb,function(_0x267b58){if(_0x267b58[_0xd869('0x33')]!=='VIRTUAL'){var _0x4baef3={};_0x4baef3[_0x267b58['name']]={'$like':'%'+_0x19e68c[_0xd869('0x36')][_0xd869('0x41')]+'%'};return _0x4baef3;}})});}_0x724f02=_['merge']({},_0x724f02,_0x19e68c['options']);var _0x86a286={'where':_0x724f02[_0xd869('0x3f')]};return db[_0xd869('0x43')]['count'](_0x86a286)[_0xd869('0x28')](function(_0x1bc41d){_0x50f907['count']=_0x1bc41d;if(_0x19e68c[_0xd869('0x36')][_0xd869('0x44')]){_0x724f02[_0xd869('0x45')]=[{'all':!![]}];}return db[_0xd869('0x43')][_0xd869('0x46')](_0x724f02);})[_0xd869('0x28')](function(_0x42a601){_0x50f907[_0xd869('0x47')]=_0x42a601;return _0x50f907;})[_0xd869('0x28')](respondWithFilteredResult(_0x53ceb9,_0x724f02))[_0xd869('0x48')](handleError(_0x53ceb9,null));};exports[_0xd869('0x49')]=function(_0x33ebcb,_0x2f846e){var _0x3f487f={'raw':!![],'where':{'id':_0x33ebcb[_0xd869('0x4a')]['id']}},_0x58f4ff={};_0x58f4ff[_0xd869('0x38')]=_[_0xd869('0x4b')](db[_0xd869('0x43')][_0xd869('0x31')]);_0x58f4ff[_0xd869('0x36')]=_[_0xd869('0x4b')](_0x33ebcb[_0xd869('0x36')]);_0x58f4ff[_0xd869('0x37')]=_[_0xd869('0x3a')](_0x58f4ff[_0xd869('0x38')],_0x58f4ff[_0xd869('0x36')]);_0x3f487f[_0xd869('0x39')]=_[_0xd869('0x3a')](_0x58f4ff[_0xd869('0x38')],qs[_0xd869('0x3b')](_0x33ebcb['query'][_0xd869('0x3b')]));_0x3f487f[_0xd869('0x39')]=_0x3f487f[_0xd869('0x39')][_0xd869('0x3c')]?_0x3f487f[_0xd869('0x39')]:_0x58f4ff[_0xd869('0x38')];if(_0x33ebcb[_0xd869('0x36')]['includeAll']){_0x3f487f[_0xd869('0x45')]=[{'all':!![]}];}_0x3f487f=_['merge']({},_0x3f487f,_0x33ebcb[_0xd869('0x4c')]);return db[_0xd869('0x43')][_0xd869('0x4d')](_0x3f487f)[_0xd869('0x28')](handleEntityNotFound(_0x2f846e,null))[_0xd869('0x28')](respondWithResult(_0x2f846e,null))['catch'](handleError(_0x2f846e,null));};exports['create']=function(_0x59af52,_0x6827e0){return db[_0xd869('0x43')][_0xd869('0x4e')](_0x59af52['body'],{})[_0xd869('0x28')](function(_0x663945){var _0x3c7fd8=_0x59af52['user'][_0xd869('0x2a')]({'plain':!![]});if(!_0x3c7fd8)throw new Error(_0xd869('0x4f'));if(_0x3c7fd8[_0xd869('0x50')]===_0xd869('0x51')){var _0x12465e=_0x663945[_0xd869('0x2a')]({'plain':!![]});var _0x324ff9=_0xd869('0x2b');return db[_0xd869('0x52')]['find']({'where':{'name':_0x324ff9,'userProfileId':_0x3c7fd8[_0xd869('0x53')]},'raw':!![]})[_0xd869('0x28')](function(_0x103d4e){if(_0x103d4e&&_0x103d4e[_0xd869('0x54')]===0x0){return db['UserProfileResource'][_0xd869('0x4e')]({'name':_0x12465e[_0xd869('0x2e')],'resourceId':_0x12465e['id'],'type':_0x103d4e['name'],'sectionId':_0x103d4e['id']},{})[_0xd869('0x28')](function(){return _0x663945;});}else{return _0x663945;}})[_0xd869('0x48')](function(_0x251f31){logger[_0xd869('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x251f31);throw _0x251f31;});}return _0x663945;})['then'](respondWithResult(_0x6827e0,0xc9))['catch'](handleError(_0x6827e0,null));};exports[_0xd869('0x27')]=function(_0x5d0e86,_0x15909b){if(_0x5d0e86[_0xd869('0x55')]['id']){delete _0x5d0e86[_0xd869('0x55')]['id'];}return db[_0xd869('0x43')][_0xd869('0x4d')]({'where':{'id':_0x5d0e86[_0xd869('0x4a')]['id']}})['then'](handleEntityNotFound(_0x15909b,null))[_0xd869('0x28')](saveUpdates(_0x5d0e86[_0xd869('0x55')],null))['then'](respondWithResult(_0x15909b,null))[_0xd869('0x48')](handleError(_0x15909b,null));};exports[_0xd869('0x29')]=function(_0x3cff04,_0x2615e4){return db[_0xd869('0x43')][_0xd869('0x4d')]({'where':{'id':_0x3cff04[_0xd869('0x4a')]['id']}})[_0xd869('0x28')](handleEntityNotFound(_0x2615e4,null))[_0xd869('0x28')](removeEntity(_0x2615e4,null))[_0xd869('0x48')](handleError(_0x2615e4,null));};
\ No newline at end of file
index e605e8f..9aadfc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f57=['request-promise','path','../../config/environment','exports','define','Variable','tools_variables','lodash','util','../../config/logger','api','moment'];(function(_0x449284,_0x37c3e2){var _0x110d33=function(_0x47cd8f){while(--_0x47cd8f){_0x449284['push'](_0x449284['shift']());}};_0x110d33(++_0x37c3e2);}(_0x4f57,0x1f3));var _0x74f5=function(_0x445f39,_0x8fe165){_0x445f39=_0x445f39-0x0;var _0x277958=_0x4f57[_0x445f39];return _0x277958;};'use strict';var _=require(_0x74f5('0x0'));var util=require(_0x74f5('0x1'));var logger=require(_0x74f5('0x2'))(_0x74f5('0x3'));var moment=require(_0x74f5('0x4'));var BPromise=require('bluebird');var rp=require(_0x74f5('0x5'));var fs=require('fs');var path=require(_0x74f5('0x6'));var rimraf=require('rimraf');var config=require(_0x74f5('0x7'));var attributes=require('./variable.attributes');module[_0x74f5('0x8')]=function(_0x243127,_0x157dcc){return _0x243127[_0x74f5('0x9')](_0x74f5('0xa'),attributes,{'tableName':_0x74f5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x546e=['tools_variables','lodash','util','api','moment','request-promise','../../config/environment','./variable.attributes','exports','define','Variable'];(function(_0x3fc0f5,_0x3c5c91){var _0x3468aa=function(_0x47e6ab){while(--_0x47e6ab){_0x3fc0f5['push'](_0x3fc0f5['shift']());}};_0x3468aa(++_0x3c5c91);}(_0x546e,0x156));var _0xe546=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x546e[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0xe546('0x0'));var util=require(_0xe546('0x1'));var logger=require('../../config/logger')(_0xe546('0x2'));var moment=require(_0xe546('0x3'));var BPromise=require('bluebird');var rp=require(_0xe546('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe546('0x5'));var attributes=require(_0xe546('0x6'));module[_0xe546('0x7')]=function(_0x3de24c,_0x30fb92){return _0x3de24c[_0xe546('0x8')](_0xe546('0x9'),attributes,{'tableName':_0xe546('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3ac3655..d23b4ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x3a6cea,_0x2bbb62){var _0x268fae=function(_0x296565){while(--_0x296565){_0x3a6cea['push'](_0x3a6cea['shift']());}};_0x268fae(++_0x2bbb62);}(_0xabce,0x103));var _0xeabc=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xabce[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});};
\ No newline at end of file
+var _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x2d9da8,_0x5d5072){var _0x57a29c=function(_0x2f562d){while(--_0x2f562d){_0x2d9da8['push'](_0x2d9da8['shift']());}};_0x57a29c(++_0x5d5072);}(_0x3e74,0x175));var _0x43e7=function(_0x4acfef,_0x5737f1){_0x4acfef=_0x4acfef-0x0;var _0x5ad7ef=_0x3e74[_0x4acfef];return _0x5ad7ef;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});};
\ No newline at end of file
index 0b0b451..f6ae354 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc769=['/reset','isAuthenticated','/pull','pull','/restart','restart','/migrations','exports','express','../../components/auth/service','./version.controller','get','/fetch','canUpdate'];(function(_0x4076c0,_0x7cc526){var _0x3d6512=function(_0x196314){while(--_0x196314){_0x4076c0['push'](_0x4076c0['shift']());}};_0x3d6512(++_0x7cc526);}(_0xc769,0x1d6));var _0x9c76=function(_0x31a242,_0xa877cc){_0x31a242=_0x31a242-0x0;var _0x39e861=_0xc769[_0x31a242];return _0x39e861;};'use strict';var express=require(_0x9c76('0x0'));var router=express['Router']();var auth=require(_0x9c76('0x1'));var controller=require(_0x9c76('0x2'));router[_0x9c76('0x3')]('/',controller['index']);router[_0x9c76('0x3')](_0x9c76('0x4'),auth['isAuthenticated'](),auth[_0x9c76('0x5')](),controller['fetch']);router[_0x9c76('0x3')](_0x9c76('0x6'),auth[_0x9c76('0x7')](),auth[_0x9c76('0x5')](),controller['reset']);router[_0x9c76('0x3')](_0x9c76('0x8'),auth[_0x9c76('0x7')](),auth[_0x9c76('0x5')](),controller[_0x9c76('0x9')]);router[_0x9c76('0x3')](_0x9c76('0xa'),auth[_0x9c76('0x7')](),controller[_0x9c76('0xb')]);router[_0x9c76('0x3')](_0x9c76('0xc'),controller['migrations']);module[_0x9c76('0xd')]=router;
\ No newline at end of file
+var _0xf0ed=['Router','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','reset','/pull','pull','/restart','/migrations','migrations','exports','express'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf0ed,0xfe));var _0xdf0e=function(_0x29228b,_0x4801be){_0x29228b=_0x29228b-0x0;var _0x2acdce=_0xf0ed[_0x29228b];return _0x2acdce;};'use strict';var express=require(_0xdf0e('0x0'));var router=express[_0xdf0e('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xdf0e('0x2'));router[_0xdf0e('0x3')]('/',controller[_0xdf0e('0x4')]);router[_0xdf0e('0x3')](_0xdf0e('0x5'),auth[_0xdf0e('0x6')](),auth[_0xdf0e('0x7')](),controller['fetch']);router[_0xdf0e('0x3')]('/reset',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xdf0e('0x8')]);router[_0xdf0e('0x3')](_0xdf0e('0x9'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xdf0e('0xa')]);router[_0xdf0e('0x3')](_0xdf0e('0xb'),auth[_0xdf0e('0x6')](),controller['restart']);router['get'](_0xdf0e('0xc'),controller[_0xdf0e('0xd')]);module[_0xdf0e('0xe')]=router;
\ No newline at end of file
index abb1250..1cdd541 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf11c=['push','sequelize','Migration','constructor','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','index','exports','query','fetch','latest','2.0.0','status','json','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','npm\x20install\x20--production','restart','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','.js'];(function(_0x5d29bf,_0x35149d){var _0x1a459d=function(_0x140694){while(--_0x140694){_0x5d29bf['push'](_0x5d29bf['shift']());}};_0x1a459d(++_0x35149d);}(_0xf11c,0x16e));var _0xcf11=function(_0x4226cf,_0x2039b3){_0x4226cf=_0x4226cf-0x0;var _0x440613=_0xf11c[_0x4226cf];return _0x440613;};'use strict';var Umzug=require(_0xcf11('0x0'));var path=require(_0xcf11('0x1'));var fs=require('fs');var _=require(_0xcf11('0x2'));var pkginfo=require(_0xcf11('0x3'))(module,_0xcf11('0x4'));var compareVersions=require(_0xcf11('0x5'));var exec=require(_0xcf11('0x6'))[_0xcf11('0x7')];var db=require(_0xcf11('0x8'))['db'];var config=require(_0xcf11('0x9'));var pm2=require(_0xcf11('0xa'));var logger=require(_0xcf11('0xb'))('update');var git=require(_0xcf11('0xc'))(config[_0xcf11('0xd')]);exports[_0xcf11('0xe')]=function(_0x292061,_0x272801){var _0xaa5f67={'current':module[_0xcf11('0xf')][_0xcf11('0x4')],'phonebar':0x2};if(_0x292061['query']&&_0x292061[_0xcf11('0x10')]['latest']){return git[_0xcf11('0x11')]()['tags'](function(_0x4baf14,_0x48d011){_0xaa5f67[_0xcf11('0x12')]=(_0x4baf14?module['exports'][_0xcf11('0x4')]:_0x48d011[_0xcf11('0x12')])||_0xcf11('0x13');return _0x272801[_0xcf11('0x14')](0xc8)[_0xcf11('0x15')](_0xaa5f67);});}else{return _0x272801['status'](0xc8)['json'](_0xaa5f67);}};exports[_0xcf11('0x11')]=function(_0x4ac1cf,_0x120723){return git[_0xcf11('0x11')]([_0xcf11('0x16'),'master'],function(_0x3ab471){if(_0x3ab471){logger[_0xcf11('0x17')](_0x3ab471);return _0x120723[_0xcf11('0x14')](0x1f4)['json'](_0x3ab471);}logger[_0xcf11('0x18')](_0xcf11('0x19'));return _0x120723[_0xcf11('0x14')](0xc8)['json']({'output':_0xcf11('0x1a')});});};exports[_0xcf11('0x1b')]=function(_0x3882ca,_0x232335){return git[_0xcf11('0x1b')](['--hard',_0xcf11('0x1c')],function(_0x2c35d4){if(_0x2c35d4){logger[_0xcf11('0x17')](_0x2c35d4);return _0x232335[_0xcf11('0x14')](0x1f4)[_0xcf11('0x15')](_0x2c35d4);}logger[_0xcf11('0x18')](_0xcf11('0x1d'));return _0x232335[_0xcf11('0x14')](0xc8)[_0xcf11('0x15')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x46b83a,_0x42430b){exec(_0xcf11('0x1e'),function(_0x20bc51,_0x437c97,_0x1b2baf){logger['info'](_0x437c97);logger[_0xcf11('0x18')](_0x1b2baf);if(_0x20bc51){logger[_0xcf11('0x17')](_0x20bc51);return _0x42430b[_0xcf11('0x14')](0x1f4)['json'](_0x20bc51);}return _0x42430b[_0xcf11('0x14')](0xc8)[_0xcf11('0x15')]({'output':_0x437c97});});};exports[_0xcf11('0x1f')]=function(_0x3cc992,_0x2c513a){return pm2[_0xcf11('0x1f')]('motion2')['then'](function(_0x57344d){logger[_0xcf11('0x18')](_0xcf11('0x20'),_0x57344d);return _0x2c513a['status'](0xc8)[_0xcf11('0x15')]({'output':_0xcf11('0x21')});})[_0xcf11('0x22')](function(_0x466939){logger[_0xcf11('0x17')](_0x466939);return _0x2c513a[_0xcf11('0x14')](0x1f4)[_0xcf11('0x15')](_0x466939);});};exports[_0xcf11('0x23')]=function(_0x5d6c93,_0x3a24a1){var _0x4fbacf=fs[_0xcf11('0x24')](path[_0xcf11('0x25')](config[_0xcf11('0xd')],_0xcf11('0x26'),_0xcf11('0x23')));var _0x1ac994=[];for(var _0x1f4ee3=0x0;_0x1f4ee3<_0x4fbacf[_0xcf11('0x27')];_0x1f4ee3++){var _0x1abfe9=_0x4fbacf[_0x1f4ee3][_0xcf11('0x28')](_0xcf11('0x29'),'');if(compareVersions(module[_0xcf11('0xf')][_0xcf11('0x4')],_0x1abfe9)===-0x1){_0x1ac994[_0xcf11('0x2a')](_0x1abfe9);}}if(_0x1ac994[_0xcf11('0x27')]){var _0x536bfc=_0x1ac994['sort'](compareVersions);var _0x4d6b3b=new Umzug({'storage':_0xcf11('0x2b'),'storageOptions':{'model':db[_0xcf11('0x2c')],'modelName':'Migration','columnName':_0xcf11('0x4')},'migrations':{'params':[db[_0xcf11('0x2b')]['getQueryInterface'](),db[_0xcf11('0x2b')][_0xcf11('0x2d')],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[_0xcf11('0x25')](config[_0xcf11('0xd')],_0xcf11('0x26'),_0xcf11('0x23')),'pattern':/\.js$/}});_0x4d6b3b['up']({'migrations':_[_0xcf11('0x2e')](_0x536bfc,function(_0x154414){return _0x154414+_0xcf11('0x29');})})['then'](function(){return _0x3a24a1[_0xcf11('0x14')](0xc8)['json']({'output':_0xcf11('0x2f')+module[_0xcf11('0xf')]['version']+_0xcf11('0x30')+_['last'](_0x536bfc),'migrations':_[_0xcf11('0x25')](_0x536bfc)});})[_0xcf11('0x22')](function(_0x5ab89f){if(_0x5ab89f instanceof db[_0xcf11('0x2b')][_0xcf11('0x31')]){return _0x3a24a1[_0xcf11('0x14')](0xc8)[_0xcf11('0x15')]({'output':_0xcf11('0x32')});}else{return _0x3a24a1[_0xcf11('0x14')](0x1f4)['json'](_0x5ab89f);}});}else{return _0x3a24a1[_0xcf11('0x14')](0xc8)[_0xcf11('0x15')]({'output':_0xcf11('0x32')});}};
\ No newline at end of file
+var _0x13bc=['FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','root','replace','sequelize','Migration','getQueryInterface','constructor','join','server','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','git\x20fetch\x20origin\x20master','reset','--hard'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x13bc,0x1a9));var _0xc13b=function(_0x4c180f,_0x15b340){_0x4c180f=_0x4c180f-0x0;var _0xbde635=_0x13bc[_0x4c180f];return _0xbde635;};'use strict';var Umzug=require(_0xc13b('0x0'));var path=require(_0xc13b('0x1'));var fs=require('fs');var _=require(_0xc13b('0x2'));var pkginfo=require(_0xc13b('0x3'))(module,_0xc13b('0x4'));var compareVersions=require('compare-versions');var exec=require(_0xc13b('0x5'))[_0xc13b('0x6')];var db=require(_0xc13b('0x7'))['db'];var config=require('../../config/environment');var pm2=require(_0xc13b('0x8'));var logger=require(_0xc13b('0x9'))('update');var git=require('simple-git')(config['root']);exports[_0xc13b('0xa')]=function(_0x1df6ab,_0x5cf0f3){var _0x4a8389={'current':module[_0xc13b('0xb')][_0xc13b('0x4')],'phonebar':0x2};if(_0x1df6ab['query']&&_0x1df6ab[_0xc13b('0xc')][_0xc13b('0xd')]){return git[_0xc13b('0xe')]()[_0xc13b('0xf')](function(_0x184581,_0x35db58){_0x4a8389['latest']=(_0x184581?module[_0xc13b('0xb')][_0xc13b('0x4')]:_0x35db58[_0xc13b('0xd')])||_0xc13b('0x10');return _0x5cf0f3[_0xc13b('0x11')](0xc8)[_0xc13b('0x12')](_0x4a8389);});}else{return _0x5cf0f3[_0xc13b('0x11')](0xc8)[_0xc13b('0x12')](_0x4a8389);}};exports[_0xc13b('0xe')]=function(_0x47bb1a,_0x293401){return git[_0xc13b('0xe')]([_0xc13b('0x13'),_0xc13b('0x14')],function(_0x18a04f){if(_0x18a04f){logger[_0xc13b('0x15')](_0x18a04f);return _0x293401[_0xc13b('0x11')](0x1f4)['json'](_0x18a04f);}logger['info']('git\x20fetch');return _0x293401['status'](0xc8)['json']({'output':_0xc13b('0x16')});});};exports[_0xc13b('0x17')]=function(_0x292eab,_0x464870){return git[_0xc13b('0x17')]([_0xc13b('0x18'),_0xc13b('0x19')],function(_0x19e18f){if(_0x19e18f){logger['error'](_0x19e18f);return _0x464870[_0xc13b('0x11')](0x1f4)[_0xc13b('0x12')](_0x19e18f);}logger[_0xc13b('0x1a')](_0xc13b('0x1b'));return _0x464870[_0xc13b('0x11')](0xc8)[_0xc13b('0x12')]({'output':_0xc13b('0x1c')});});};exports['pull']=function(_0x143afb,_0x2e4f7a){exec(_0xc13b('0x1d'),function(_0x326f77,_0x1054f7,_0xbe8b3a){logger[_0xc13b('0x1a')](_0x1054f7);logger[_0xc13b('0x1a')](_0xbe8b3a);if(_0x326f77){logger['error'](_0x326f77);return _0x2e4f7a[_0xc13b('0x11')](0x1f4)[_0xc13b('0x12')](_0x326f77);}return _0x2e4f7a[_0xc13b('0x11')](0xc8)[_0xc13b('0x12')]({'output':_0x1054f7});});};exports[_0xc13b('0x1e')]=function(_0x1b5af3,_0x193d33){return pm2[_0xc13b('0x1e')]('motion2')[_0xc13b('0x1f')](function(_0x1f50ab){logger['info'](_0xc13b('0x20'),_0x1f50ab);return _0x193d33[_0xc13b('0x11')](0xc8)[_0xc13b('0x12')]({'output':_0xc13b('0x21')});})['catch'](function(_0x14bd37){logger[_0xc13b('0x15')](_0x14bd37);return _0x193d33[_0xc13b('0x11')](0x1f4)[_0xc13b('0x12')](_0x14bd37);});};exports[_0xc13b('0x22')]=function(_0x4cd09c,_0x5963fe){var _0x383a4a=fs[_0xc13b('0x23')](path['join'](config[_0xc13b('0x24')],'server',_0xc13b('0x22')));var _0x3c0867=[];for(var _0x25bb1a=0x0;_0x25bb1a<_0x383a4a['length'];_0x25bb1a++){var _0x1ad0f2=_0x383a4a[_0x25bb1a][_0xc13b('0x25')]('.js','');if(compareVersions(module['exports'][_0xc13b('0x4')],_0x1ad0f2)===-0x1){_0x3c0867['push'](_0x1ad0f2);}}if(_0x3c0867['length']){var _0x1afa22=_0x3c0867['sort'](compareVersions);var _0x1d8598=new Umzug({'storage':_0xc13b('0x26'),'storageOptions':{'model':db[_0xc13b('0x27')],'modelName':_0xc13b('0x27'),'columnName':_0xc13b('0x4')},'migrations':{'params':[db[_0xc13b('0x26')][_0xc13b('0x28')](),db['sequelize'][_0xc13b('0x29')],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[_0xc13b('0x2a')](config[_0xc13b('0x24')],_0xc13b('0x2b'),_0xc13b('0x22')),'pattern':/\.js$/}});_0x1d8598['up']({'migrations':_[_0xc13b('0x2c')](_0x1afa22,function(_0x26fa6b){return _0x26fa6b+_0xc13b('0x2d');})})[_0xc13b('0x1f')](function(){return _0x5963fe[_0xc13b('0x11')](0xc8)[_0xc13b('0x12')]({'output':_0xc13b('0x2e')+module['exports']['version']+_0xc13b('0x2f')+_['last'](_0x1afa22),'migrations':_[_0xc13b('0x2a')](_0x1afa22)});})['catch'](function(_0x2b601b){if(_0x2b601b instanceof db['sequelize'][_0xc13b('0x30')]){return _0x5963fe[_0xc13b('0x11')](0xc8)[_0xc13b('0x12')]({'output':_0xc13b('0x31')});}else{return _0x5963fe[_0xc13b('0x11')](0x1f4)[_0xc13b('0x12')](_0x2b601b);}});}else{return _0x5963fe[_0xc13b('0x11')](0xc8)['json']({'output':_0xc13b('0x31')});}};
\ No newline at end of file
index 48c77f4..4c144e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45a3=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','create','put','delete','multer','connect-timeout','Router','fs-extra'];(function(_0x57ffa4,_0x1a1c35){var _0x45606e=function(_0x4b89d7){while(--_0x4b89d7){_0x57ffa4['push'](_0x57ffa4['shift']());}};_0x45606e(++_0x1a1c35);}(_0x45a3,0x1a0));var _0x345a=function(_0x1ab0c8,_0x4a5af6){_0x1ab0c8=_0x1ab0c8-0x0;var _0x27e8a9=_0x45a3[_0x1ab0c8];return _0x27e8a9;};'use strict';var multer=require(_0x345a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x345a('0x1'));var express=require('express');var router=express[_0x345a('0x2')]();var fs_extra=require(_0x345a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x345a('0x4'));var config=require(_0x345a('0x5'));var controller=require('./voiceAgentReport.controller');router[_0x345a('0x6')]('/',auth['isAuthenticated'](),controller[_0x345a('0x7')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x345a('0x8'),auth[_0x345a('0x9')](),controller[_0x345a('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x345a('0xb')]);router[_0x345a('0xc')](_0x345a('0x8'),auth[_0x345a('0x9')](),controller['update']);router[_0x345a('0xd')]('/:id',auth[_0x345a('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xba83=['fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','delete','destroy','exports','util','path','express','Router'];(function(_0x6230d7,_0x36e2eb){var _0x1b9eb1=function(_0x54a582){while(--_0x54a582){_0x6230d7['push'](_0x6230d7['shift']());}};_0x1b9eb1(++_0x36e2eb);}(_0xba83,0xc2));var _0x3ba8=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0xba83[_0x220afa];return _0x1b79d1;};'use strict';var multer=require('multer');var util=require(_0x3ba8('0x0'));var path=require(_0x3ba8('0x1'));var timeout=require('connect-timeout');var express=require(_0x3ba8('0x2'));var router=express[_0x3ba8('0x3')]();var fs_extra=require(_0x3ba8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3ba8('0x5'));var config=require(_0x3ba8('0x6'));var controller=require(_0x3ba8('0x7'));router[_0x3ba8('0x8')]('/',auth[_0x3ba8('0x9')](),controller[_0x3ba8('0xa')]);router[_0x3ba8('0x8')](_0x3ba8('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x3ba8('0x8')](_0x3ba8('0xc'),auth[_0x3ba8('0x9')](),controller[_0x3ba8('0xd')]);router[_0x3ba8('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x3ba8('0xc'),auth[_0x3ba8('0x9')](),controller['update']);router[_0x3ba8('0xf')](_0x3ba8('0xc'),auth[_0x3ba8('0x9')](),controller[_0x3ba8('0x10')]);module[_0x3ba8('0x11')]=router;
\ No newline at end of file
index c20e151..b55bed8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0570=['DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING'];(function(_0x19ea18,_0x2005d9){var _0x41e43c=function(_0x1c3986){while(--_0x1c3986){_0x19ea18['push'](_0x19ea18['shift']());}};_0x41e43c(++_0x2005d9);}(_0x0570,0x172));var _0x0057=function(_0x24e3b9,_0x14aa4d){_0x24e3b9=_0x24e3b9-0x0;var _0x2cacb8=_0x0570[_0x24e3b9];return _0x2cacb8;};'use strict';var Sequelize=require('sequelize');module[_0x0057('0x0')]={'type':{'type':Sequelize[_0x0057('0x1')]},'uniqueid':{'type':Sequelize[_0x0057('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0057('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x0057('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x0057('0x2')]},'agentconnectAt':{'type':Sequelize[_0x0057('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x0057('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x0057('0x2')]},'agentdumpAt':{'type':Sequelize[_0x0057('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x0057('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x0057('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x0057('0x4')]},'agentacw':{'type':Sequelize[_0x0057('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x0057('0x4')]},'reason':{'type':Sequelize[_0x0057('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0057('0x1')]},'channelstate':{'type':Sequelize[_0x0057('0x4')]},'channelstatedesc':{'type':Sequelize[_0x0057('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x0057('0x1')]},'language':{'type':Sequelize[_0x0057('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x0057('0x1')]},'priority':{'type':Sequelize[_0x0057('0x1')]},'destchannel':{'type':Sequelize[_0x0057('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x0057('0x1')]},'destcalleridnum':{'type':Sequelize[_0x0057('0x1')]},'destcalleridname':{'type':Sequelize[_0x0057('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x0057('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x0057('0x1')]},'destaccountcode':{'type':Sequelize[_0x0057('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x0057('0x1')]},'destpriority':{'type':Sequelize[_0x0057('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x0057('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x0057('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x0057('0x5')},'transferexten':{'type':Sequelize[_0x0057('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1867=['exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x5d3058,_0x3b5066){var _0x50865b=function(_0x2ce58c){while(--_0x2ce58c){_0x5d3058['push'](_0x5d3058['shift']());}};_0x50865b(++_0x3b5066);}(_0x1867,0xb5));var _0x7186=function(_0x240c7e,_0x174897){_0x240c7e=_0x240c7e-0x0;var _0x13e9f0=_0x1867[_0x240c7e];return _0x13e9f0;};'use strict';var Sequelize=require(_0x7186('0x0'));module[_0x7186('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7186('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7186('0x2')]},'queue':{'type':Sequelize[_0x7186('0x2')]},'interface':{'type':Sequelize[_0x7186('0x2')]},'membername':{'type':Sequelize[_0x7186('0x2')]},'agentcalledAt':{'type':Sequelize[_0x7186('0x3')]},'agentconnectAt':{'type':Sequelize[_0x7186('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x7186('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x7186('0x3')]},'agentdumpAt':{'type':Sequelize[_0x7186('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x7186('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x7186('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x7186('0x5')]},'agentacw':{'type':Sequelize[_0x7186('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7186('0x5')]},'reason':{'type':Sequelize[_0x7186('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7186('0x2')]},'channelstate':{'type':Sequelize[_0x7186('0x5')]},'channelstatedesc':{'type':Sequelize[_0x7186('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7186('0x2')]},'connectedlinename':{'type':Sequelize[_0x7186('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7186('0x2')]},'context':{'type':Sequelize[_0x7186('0x2')]},'exten':{'type':Sequelize[_0x7186('0x2')]},'priority':{'type':Sequelize[_0x7186('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x7186('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x7186('0x2')]},'destcalleridnum':{'type':Sequelize[_0x7186('0x2')]},'destcalleridname':{'type':Sequelize[_0x7186('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x7186('0x2')]},'destcontext':{'type':Sequelize[_0x7186('0x2')]},'destexten':{'type':Sequelize[_0x7186('0x2')]},'destpriority':{'type':Sequelize[_0x7186('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x7186('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x7186('0x2')]},'transfer':{'type':Sequelize[_0x7186('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7186('0x2')],'comment':_0x7186('0x6')},'transferexten':{'type':Sequelize[_0x7186('0x2')]},'transferuniqueid':{'type':Sequelize[_0x7186('0x2')]},'agententerreason':{'type':Sequelize[_0x7186('0x5')],'defaultValue':0x0}};
\ No newline at end of file
index 2c6d763..93c354d 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(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 bc7c1b9..66645eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb66c=['rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xb66c,0x175));var _0xcb66=function(_0x40696c,_0x496a50){_0x40696c=_0x40696c-0x0;var _0x341f55=_0xb66c[_0x40696c];return _0x341f55;};'use strict';var _=require(_0xcb66('0x0'));var util=require('util');var logger=require(_0xcb66('0x1'))('api');var moment=require(_0xcb66('0x2'));var BPromise=require(_0xcb66('0x3'));var rp=require(_0xcb66('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb66('0x5'));var config=require(_0xcb66('0x6'));var attributes=require(_0xcb66('0x7'));module[_0xcb66('0x8')]=function(_0x5d766d,_0x518163){return _0x5d766d[_0xcb66('0x9')](_0xcb66('0xa'),attributes,{'tableName':_0xcb66('0xb'),'paranoid':![],'indexes':[{'fields':[_0xcb66('0xc'),_0xcb66('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc3b5=['rimraf','../../config/environment','exports','define','VoiceAgentReport','report_agent','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2c3536,_0x1a5824){var _0x355119=function(_0x4216d7){while(--_0x4216d7){_0x2c3536['push'](_0x2c3536['shift']());}};_0x355119(++_0x1a5824);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x20a896,_0x416429){_0x20a896=_0x20a896-0x0;var _0x310b6b=_0xc3b5[_0x20a896];return _0x310b6b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5c3b('0x0'))(_0x5c3b('0x1'));var moment=require(_0x5c3b('0x2'));var BPromise=require(_0x5c3b('0x3'));var rp=require(_0x5c3b('0x4'));var fs=require('fs');var path=require(_0x5c3b('0x5'));var rimraf=require(_0x5c3b('0x6'));var config=require(_0x5c3b('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0x5c3b('0x8')]=function(_0x6b8a1e,_0x56345e){return _0x6b8a1e[_0x5c3b('0x9')](_0x5c3b('0xa'),attributes,{'tableName':_0x5c3b('0xb'),'paranoid':![],'indexes':[{'fields':[_0x5c3b('0xc'),'destuniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index f3bf3d0..7bebe01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2bb=['error','message','result','catch','CreateVoiceAgentReport','create','body','options','raw','then','UpdateVoiceAgentReport','update','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2bcd1f,_0x4f1972){var _0x2381ca=function(_0x51f935){while(--_0x51f935){_0x2bcd1f['push'](_0x2bcd1f['shift']());}};_0x2381ca(++_0x4f1972);}(_0xd2bb,0x81));var _0xbd2b=function(_0x17aedf,_0x4f45cd){_0x17aedf=_0x17aedf-0x0;var _0x20a21=_0xd2bb[_0x17aedf];return _0x20a21;};'use strict';var _=require(_0xbd2b('0x0'));var util=require('util');var moment=require(_0xbd2b('0x1'));var BPromise=require(_0xbd2b('0x2'));var rs=require(_0xbd2b('0x3'));var fs=require('fs');var Redis=require(_0xbd2b('0x4'));var db=require(_0xbd2b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd2b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbd2b('0x7')][_0xbd2b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x106cef,_0x4ca2fc,_0x228651){return new BPromise(function(_0x468e6b,_0x548419){return client[_0xbd2b('0x9')](_0x106cef,_0x228651)['then'](function(_0x43e4bb){logger[_0xbd2b('0xa')](_0xbd2b('0xb'),_0x4ca2fc,_0xbd2b('0xc'));logger[_0xbd2b('0xd')](_0xbd2b('0xe'),_0x4ca2fc,'request\x20sent',JSON[_0xbd2b('0xf')](_0x43e4bb));if(_0x43e4bb[_0xbd2b('0x10')]){if(_0x43e4bb[_0xbd2b('0x10')]['code']===0x1f4){logger[_0xbd2b('0x10')](_0xbd2b('0xb'),_0x4ca2fc,_0x43e4bb[_0xbd2b('0x10')][_0xbd2b('0x11')]);return _0x548419(_0x43e4bb[_0xbd2b('0x10')][_0xbd2b('0x11')]);}logger[_0xbd2b('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x4ca2fc,_0x43e4bb['error'][_0xbd2b('0x11')]);return _0x468e6b(_0x43e4bb[_0xbd2b('0x10')][_0xbd2b('0x11')]);}else{logger[_0xbd2b('0xa')](_0xbd2b('0xb'),_0x4ca2fc,'request\x20sent');_0x468e6b(_0x43e4bb[_0xbd2b('0x12')][_0xbd2b('0x11')]);}})[_0xbd2b('0x13')](function(_0x17c01f){logger[_0xbd2b('0x10')](_0xbd2b('0xb'),_0x4ca2fc,_0x17c01f);_0x548419(_0x17c01f);});});}exports[_0xbd2b('0x14')]=function(_0x255eb3){var _0xa5c1f4=this;return new Promise(function(_0x3ea3b4,_0x5e1add){return db['VoiceAgentReport'][_0xbd2b('0x15')](_0x255eb3[_0xbd2b('0x16')],{'raw':_0x255eb3[_0xbd2b('0x17')]?_0x255eb3[_0xbd2b('0x17')][_0xbd2b('0x18')]===undefined?!![]:![]:!![]})[_0xbd2b('0x19')](function(_0x11b299){logger[_0xbd2b('0xa')](_0xbd2b('0x14'),_0x255eb3);logger[_0xbd2b('0xd')]('CreateVoiceAgentReport',_0x255eb3,JSON[_0xbd2b('0xf')](_0x11b299));_0x3ea3b4(_0x11b299);})[_0xbd2b('0x13')](function(_0x547806){logger[_0xbd2b('0x10')](_0xbd2b('0x14'),_0x547806[_0xbd2b('0x11')],_0x255eb3);_0x5e1add(_0xa5c1f4[_0xbd2b('0x10')](0x1f4,_0x547806[_0xbd2b('0x11')]));});});};exports[_0xbd2b('0x1a')]=function(_0x27ded9){var _0x25e784=this;return new Promise(function(_0x28c2fd,_0x3cca55){return db['VoiceAgentReport'][_0xbd2b('0x1b')](_0x27ded9[_0xbd2b('0x16')],{'raw':_0x27ded9[_0xbd2b('0x17')]?_0x27ded9[_0xbd2b('0x17')][_0xbd2b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27ded9[_0xbd2b('0x17')]?_0x27ded9[_0xbd2b('0x17')]['where']||null:null,'attributes':_0x27ded9[_0xbd2b('0x17')]?_0x27ded9[_0xbd2b('0x17')][_0xbd2b('0x1c')]||null:null,'limit':_0x27ded9['options']?_0x27ded9['options']['limit']||null:null})[_0xbd2b('0x19')](function(_0x357587){logger[_0xbd2b('0xa')](_0xbd2b('0x1a'),_0x27ded9);logger['debug']('UpdateVoiceAgentReport',_0x27ded9,JSON[_0xbd2b('0xf')](_0x357587));_0x28c2fd(_0x357587);})[_0xbd2b('0x13')](function(_0x5ee2ac){logger[_0xbd2b('0x10')](_0xbd2b('0x1a'),_0x5ee2ac[_0xbd2b('0x11')],_0x27ded9);_0x3cca55(_0x25e784[_0xbd2b('0x10')](0x1f4,_0x5ee2ac[_0xbd2b('0x11')]));});});};
\ No newline at end of file
+var _0xa99f=['request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceAgentReport','body','options','raw','debug','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','VoiceAgentReport,\x20%s,\x20%s'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa99f,0x1b2));var _0xfa99=function(_0x682f86,_0x22e67a){_0x682f86=_0x682f86-0x0;var _0x284912=_0xa99f[_0x682f86];return _0x284912;};'use strict';var _=require(_0xfa99('0x0'));var util=require(_0xfa99('0x1'));var moment=require('moment');var BPromise=require(_0xfa99('0x2'));var rs=require(_0xfa99('0x3'));var fs=require('fs');var Redis=require(_0xfa99('0x4'));var db=require(_0xfa99('0x5'))['db'];var utils=require(_0xfa99('0x6'));var logger=require(_0xfa99('0x7'))('rpc');var config=require(_0xfa99('0x8'));var jayson=require(_0xfa99('0x9'));var client=jayson[_0xfa99('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2521f8,_0x21d09d,_0x1c62bf){return new BPromise(function(_0x8eaf9d,_0xbe062f){return client['request'](_0x2521f8,_0x1c62bf)[_0xfa99('0xb')](function(_0x27e92d){logger[_0xfa99('0xc')](_0xfa99('0xd'),_0x21d09d,_0xfa99('0xe'));logger['debug'](_0xfa99('0xf'),_0x21d09d,_0xfa99('0xe'),JSON[_0xfa99('0x10')](_0x27e92d));if(_0x27e92d['error']){if(_0x27e92d[_0xfa99('0x11')][_0xfa99('0x12')]===0x1f4){logger[_0xfa99('0x11')](_0xfa99('0xd'),_0x21d09d,_0x27e92d[_0xfa99('0x11')][_0xfa99('0x13')]);return _0xbe062f(_0x27e92d[_0xfa99('0x11')][_0xfa99('0x13')]);}logger[_0xfa99('0x11')](_0xfa99('0xd'),_0x21d09d,_0x27e92d[_0xfa99('0x11')][_0xfa99('0x13')]);return _0x8eaf9d(_0x27e92d[_0xfa99('0x11')][_0xfa99('0x13')]);}else{logger[_0xfa99('0xc')](_0xfa99('0xd'),_0x21d09d,'request\x20sent');_0x8eaf9d(_0x27e92d['result']['message']);}})[_0xfa99('0x14')](function(_0x1a27b0){logger[_0xfa99('0x11')](_0xfa99('0xd'),_0x21d09d,_0x1a27b0);_0xbe062f(_0x1a27b0);});});}exports['CreateVoiceAgentReport']=function(_0x1375d0){var _0x4b9383=this;return new Promise(function(_0x28ad6b,_0x26c3aa){return db[_0xfa99('0x15')]['create'](_0x1375d0[_0xfa99('0x16')],{'raw':_0x1375d0[_0xfa99('0x17')]?_0x1375d0[_0xfa99('0x17')][_0xfa99('0x18')]===undefined?!![]:![]:!![]})[_0xfa99('0xb')](function(_0x48fe97){logger['info']('CreateVoiceAgentReport',_0x1375d0);logger[_0xfa99('0x19')](_0xfa99('0x1a'),_0x1375d0,JSON[_0xfa99('0x10')](_0x48fe97));_0x28ad6b(_0x48fe97);})[_0xfa99('0x14')](function(_0xcc58a1){logger[_0xfa99('0x11')]('CreateVoiceAgentReport',_0xcc58a1[_0xfa99('0x13')],_0x1375d0);_0x26c3aa(_0x4b9383[_0xfa99('0x11')](0x1f4,_0xcc58a1[_0xfa99('0x13')]));});});};exports[_0xfa99('0x1b')]=function(_0x466244){var _0x2506b6=this;return new Promise(function(_0x5033bf,_0x14d050){return db[_0xfa99('0x15')][_0xfa99('0x1c')](_0x466244[_0xfa99('0x16')],{'raw':_0x466244['options']?_0x466244[_0xfa99('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x466244['options']?_0x466244[_0xfa99('0x17')][_0xfa99('0x1d')]||null:null,'attributes':_0x466244[_0xfa99('0x17')]?_0x466244['options'][_0xfa99('0x1e')]||null:null,'limit':_0x466244[_0xfa99('0x17')]?_0x466244[_0xfa99('0x17')][_0xfa99('0x1f')]||null:null})[_0xfa99('0xb')](function(_0x4c5823){logger['info'](_0xfa99('0x1b'),_0x466244);logger[_0xfa99('0x19')]('UpdateVoiceAgentReport',_0x466244,JSON['stringify'](_0x4c5823));_0x5033bf(_0x4c5823);})[_0xfa99('0x14')](function(_0x181342){logger['error'](_0xfa99('0x1b'),_0x181342[_0xfa99('0x13')],_0x466244);_0x14d050(_0x2506b6[_0xfa99('0x11')](0x1f4,_0x181342[_0xfa99('0x13')]));});});};
\ No newline at end of file
index 5fa4566..e3f65d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['/describe','describe','/:id','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index'];(function(_0x2b3956,_0x586f67){var _0x465b48=function(_0x57dae1){while(--_0x57dae1){_0x2b3956['push'](_0x2b3956['shift']());}};_0x465b48(++_0x586f67);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x33fab6,_0x532a04){_0x33fab6=_0x33fab6-0x0;var _0x314e60=_0x7fbe[_0x33fab6];return _0x314e60;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router;
\ No newline at end of file
+var _0x9c5a=['fs-extra','../../components/interaction/service','../../config/environment','get','index','describe','isAuthenticated','show','create','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x4a85c4,_0x144d26){_0x4a85c4=_0x4a85c4-0x0;var _0x23ade8=_0x9c5a[_0x4a85c4];return _0x23ade8;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var fs_extra=require(_0xa9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var controller=require('./voiceCallReport.controller');router[_0xa9c5('0x8')]('/',auth['isAuthenticated'](),controller[_0xa9c5('0x9')]);router[_0xa9c5('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xa9c5('0xa')]);router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xc')]);router['post']('/',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xd')]);router['put']('/:id',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xe')]);router[_0xa9c5('0xf')](_0xa9c5('0x10'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x11')]);module[_0xa9c5('0x12')]=router;
\ No newline at end of file
index ad10088..c779528 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86be=['DATE','INTEGER','sequelize','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT'];(function(_0xdfb18a,_0x3c59e7){var _0x55c734=function(_0x84c124){while(--_0x84c124){_0xdfb18a['push'](_0xdfb18a['shift']());}};_0x55c734(++_0x3c59e7);}(_0x86be,0x176));var _0xe86b=function(_0x19702e,_0x4caf63){_0x19702e=_0x19702e-0x0;var _0x186397=_0x86be[_0x19702e];return _0x186397;};'use strict';var Sequelize=require(_0xe86b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe86b('0x1')]},'type':{'type':Sequelize[_0xe86b('0x2')](_0xe86b('0x3'),_0xe86b('0x4'),_0xe86b('0x5'),_0xe86b('0x6'),_0xe86b('0x7'),_0xe86b('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xe86b('0x1')]},'destinationcontext':{'type':Sequelize[_0xe86b('0x1')]},'callerid':{'type':Sequelize[_0xe86b('0x1')]},'channel':{'type':Sequelize[_0xe86b('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xe86b('0x1')]},'lastdata':{'type':Sequelize[_0xe86b('0x9')]},'starttime':{'type':Sequelize[_0xe86b('0xa')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe86b('0xa')]},'endtime':{'type':Sequelize[_0xe86b('0xa')]},'duration':{'type':Sequelize[_0xe86b('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xe86b('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe86b('0x1')]},'amaflags':{'type':Sequelize[_0xe86b('0x1')]},'userfield':{'type':Sequelize[_0xe86b('0x1')]},'userDisposition':{'type':Sequelize[_0xe86b('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xe86b('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xe86b('0x1')]},'note':{'type':Sequelize[_0xe86b('0x1')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xe86b('0x1')]}};
\ No newline at end of file
+var _0x9805=['TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','outbound','inbound-fax','outbound-fax','dialer'];(function(_0x2d398b,_0x5e98f8){var _0x5d8b9d=function(_0x121a78){while(--_0x121a78){_0x2d398b['push'](_0x2d398b['shift']());}};_0x5d8b9d(++_0x5e98f8);}(_0x9805,0x18f));var _0x5980=function(_0x3b662b,_0x5dab5a){_0x3b662b=_0x3b662b-0x0;var _0x1c968a=_0x9805[_0x3b662b];return _0x1c968a;};'use strict';var Sequelize=require(_0x5980('0x0'));module[_0x5980('0x1')]={'uniqueid':{'type':Sequelize[_0x5980('0x2')]},'type':{'type':Sequelize[_0x5980('0x3')]('inbound','internal',_0x5980('0x4'),_0x5980('0x5'),_0x5980('0x6'),_0x5980('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x5980('0x2')]},'destination':{'type':Sequelize[_0x5980('0x2')]},'destinationcontext':{'type':Sequelize[_0x5980('0x2')]},'callerid':{'type':Sequelize[_0x5980('0x2')]},'channel':{'type':Sequelize[_0x5980('0x2')]},'destinationchannel':{'type':Sequelize[_0x5980('0x2')]},'lastapplication':{'type':Sequelize[_0x5980('0x2')]},'lastdata':{'type':Sequelize[_0x5980('0x8')]},'starttime':{'type':Sequelize[_0x5980('0x9')]},'systemanswertime':{'type':Sequelize[_0x5980('0x9')]},'answertime':{'type':Sequelize[_0x5980('0x9')]},'endtime':{'type':Sequelize[_0x5980('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x5980('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5980('0x2')]},'amaflags':{'type':Sequelize[_0x5980('0x2')]},'userfield':{'type':Sequelize[_0x5980('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x5980('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x5980('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x5980('0xa')]},'sipcallid':{'type':Sequelize[_0x5980('0x2')]}};
\ No newline at end of file
index bc74bf8..5e98df6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x147b36,_0x2f20c1){_0x147b36=_0x147b36-0x0;var _0x3f5ac4=_0x5f2f[_0x147b36];return _0x3f5ac4;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));};
\ No newline at end of file
+var _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x5485b9,_0xbbde17){var _0x582fc3=function(_0x4ab8ba){while(--_0x4ab8ba){_0x5485b9['push'](_0x5485b9['shift']());}};_0x582fc3(++_0xbbde17);}(_0x0b0e,0x187));var _0xe0b0=function(_0xff5df6,_0x514e73){_0xff5df6=_0xff5df6-0x0;var _0x2634bb=_0x0b0e[_0xff5df6];return _0x2634bb;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));};
\ No newline at end of file
index 6d3eda6..f1ed8c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8763=['bluebird','path','rimraf','../../config/environment','exports','define','VoiceCallReport','report_call','uniqueid','lodash','../../config/logger','moment'];(function(_0x43485c,_0x34612d){var _0x2bfca0=function(_0x424715){while(--_0x424715){_0x43485c['push'](_0x43485c['shift']());}};_0x2bfca0(++_0x34612d);}(_0x8763,0x81));var _0x3876=function(_0x530cac,_0x2cf131){_0x530cac=_0x530cac-0x0;var _0x1eb15c=_0x8763[_0x530cac];return _0x1eb15c;};'use strict';var _=require(_0x3876('0x0'));var util=require('util');var logger=require(_0x3876('0x1'))('api');var moment=require(_0x3876('0x2'));var BPromise=require(_0x3876('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3876('0x4'));var rimraf=require(_0x3876('0x5'));var config=require(_0x3876('0x6'));var attributes=require('./voiceCallReport.attributes');module[_0x3876('0x7')]=function(_0x42dd4a,_0x478641){return _0x42dd4a[_0x3876('0x8')](_0x3876('0x9'),attributes,{'tableName':_0x3876('0xa'),'paranoid':![],'indexes':[{'fields':[_0x3876('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x577a=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define','uniqueid'];(function(_0x199fdc,_0x2929c4){var _0x547c30=function(_0x5698f5){while(--_0x5698f5){_0x199fdc['push'](_0x199fdc['shift']());}};_0x547c30(++_0x2929c4);}(_0x577a,0x17a));var _0xa577=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x577a[_0x45b034];return _0x509cb0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa577('0x0'))(_0xa577('0x1'));var moment=require(_0xa577('0x2'));var BPromise=require(_0xa577('0x3'));var rp=require(_0xa577('0x4'));var fs=require('fs');var path=require(_0xa577('0x5'));var rimraf=require('rimraf');var config=require(_0xa577('0x6'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x49c0bf,_0x105fc1){return _0x49c0bf[_0xa577('0x7')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xa577('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
index d8d5df3..f1da5d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b68=['code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','VoiceCallReport','options','raw','where','limit','include','map','model','attributes','GetVoiceCallReport','debug','body','CreateVoiceCallReport','UpdateVoiceCallReport','update','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','stringify','error'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4b68,0x1a0));var _0x84b6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4b68[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x84b6('0x0'));var util=require(_0x84b6('0x1'));var moment=require('moment');var BPromise=require(_0x84b6('0x2'));var rs=require(_0x84b6('0x3'));var fs=require('fs');var Redis=require(_0x84b6('0x4'));var db=require(_0x84b6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x84b6('0x6'))(_0x84b6('0x7'));var config=require(_0x84b6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x84b6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e7db5,_0x5db58f,_0x2ed9dc){return new BPromise(function(_0x10f9f2,_0x4a1cf5){return client[_0x84b6('0xa')](_0x4e7db5,_0x2ed9dc)[_0x84b6('0xb')](function(_0x25ed94){logger[_0x84b6('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x5db58f,_0x84b6('0xd'));logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x5db58f,_0x84b6('0xd'),JSON[_0x84b6('0xe')](_0x25ed94));if(_0x25ed94[_0x84b6('0xf')]){if(_0x25ed94['error'][_0x84b6('0x10')]===0x1f4){logger[_0x84b6('0xf')](_0x84b6('0x11'),_0x5db58f,_0x25ed94[_0x84b6('0xf')]['message']);return _0x4a1cf5(_0x25ed94[_0x84b6('0xf')][_0x84b6('0x12')]);}logger[_0x84b6('0xf')](_0x84b6('0x11'),_0x5db58f,_0x25ed94[_0x84b6('0xf')]['message']);return _0x10f9f2(_0x25ed94[_0x84b6('0xf')][_0x84b6('0x12')]);}else{logger[_0x84b6('0xc')](_0x84b6('0x11'),_0x5db58f,_0x84b6('0xd'));_0x10f9f2(_0x25ed94[_0x84b6('0x13')]['message']);}})[_0x84b6('0x14')](function(_0xdb21ad){logger[_0x84b6('0xf')](_0x84b6('0x11'),_0x5db58f,_0xdb21ad);_0x4a1cf5(_0xdb21ad);});});}exports['GetVoiceCallReport']=function(_0xbf0776){var _0x4f7dd9=this;return new Promise(function(_0x1a254b,_0x1ec3c1){return db[_0x84b6('0x15')]['findAll']({'raw':_0xbf0776['options']?_0xbf0776[_0x84b6('0x16')][_0x84b6('0x17')]===undefined?!![]:![]:!![],'where':_0xbf0776[_0x84b6('0x16')]?_0xbf0776[_0x84b6('0x16')][_0x84b6('0x18')]||null:null,'attributes':_0xbf0776[_0x84b6('0x16')]?_0xbf0776[_0x84b6('0x16')]['attributes']||null:null,'limit':_0xbf0776[_0x84b6('0x16')]?_0xbf0776[_0x84b6('0x16')][_0x84b6('0x19')]||null:null,'include':_0xbf0776[_0x84b6('0x16')]?_0xbf0776[_0x84b6('0x16')][_0x84b6('0x1a')]?_[_0x84b6('0x1b')](_0xbf0776['options'][_0x84b6('0x1a')],function(_0x5644d9){return{'model':db[_0x5644d9[_0x84b6('0x1c')]],'as':_0x5644d9['as'],'attributes':_0x5644d9['attributes'],'include':_0x5644d9[_0x84b6('0x1a')]?_['map'](_0x5644d9[_0x84b6('0x1a')],function(_0x2e178b){return{'model':db[_0x2e178b[_0x84b6('0x1c')]],'as':_0x2e178b['as'],'attributes':_0x2e178b[_0x84b6('0x1d')],'include':_0x2e178b['include']?_[_0x84b6('0x1b')](_0x2e178b[_0x84b6('0x1a')],function(_0x15e5b3){return{'model':db[_0x15e5b3[_0x84b6('0x1c')]],'as':_0x15e5b3['as'],'attributes':_0x15e5b3[_0x84b6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x84b6('0xb')](function(_0x3b878f){logger[_0x84b6('0xc')](_0x84b6('0x1e'),_0xbf0776);logger[_0x84b6('0x1f')](_0x84b6('0x1e'),_0xbf0776,JSON[_0x84b6('0xe')](_0x3b878f));_0x1a254b(_0x3b878f);})['catch'](function(_0x401356){logger[_0x84b6('0xf')](_0x84b6('0x1e'),_0x401356[_0x84b6('0x12')],_0xbf0776);_0x1ec3c1(_0x4f7dd9['error'](0x1f4,_0x401356[_0x84b6('0x12')]));});});};exports['CreateVoiceCallReport']=function(_0x1fb262){var _0x188364=this;return new Promise(function(_0x1c6b5d,_0x2fb97b){return db['VoiceCallReport']['create'](_0x1fb262[_0x84b6('0x20')],{'raw':_0x1fb262['options']?_0x1fb262['options'][_0x84b6('0x17')]===undefined?!![]:![]:!![]})[_0x84b6('0xb')](function(_0x51dff2){logger['info'](_0x84b6('0x21'),_0x1fb262);logger[_0x84b6('0x1f')](_0x84b6('0x21'),_0x1fb262,JSON[_0x84b6('0xe')](_0x51dff2));_0x1c6b5d(_0x51dff2);})[_0x84b6('0x14')](function(_0x52e01c){logger['error']('CreateVoiceCallReport',_0x52e01c[_0x84b6('0x12')],_0x1fb262);_0x2fb97b(_0x188364[_0x84b6('0xf')](0x1f4,_0x52e01c[_0x84b6('0x12')]));});});};exports[_0x84b6('0x22')]=function(_0x553690){var _0x565564=this;return new Promise(function(_0x275843,_0x216bc6){return db[_0x84b6('0x15')][_0x84b6('0x23')](_0x553690['body'],{'raw':_0x553690[_0x84b6('0x16')]?_0x553690[_0x84b6('0x16')][_0x84b6('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x553690[_0x84b6('0x16')]?_0x553690[_0x84b6('0x16')]['where']||null:null,'attributes':_0x553690['options']?_0x553690[_0x84b6('0x16')][_0x84b6('0x1d')]||null:null,'limit':_0x553690['options']?_0x553690['options']['limit']||null:null})[_0x84b6('0xb')](function(_0x414003){logger['info'](_0x84b6('0x22'),_0x553690);logger[_0x84b6('0x1f')]('UpdateVoiceCallReport',_0x553690,JSON[_0x84b6('0xe')](_0x414003));_0x275843(_0x414003);})[_0x84b6('0x14')](function(_0x3b4086){logger[_0x84b6('0xf')](_0x84b6('0x22'),_0x3b4086['message'],_0x553690);_0x216bc6(_0x565564['error'](0x1f4,_0x3b4086[_0x84b6('0x12')]));});});};
\ No newline at end of file
+var _0x53d9=['error','code','message','result','GetVoiceCallReport','VoiceCallReport','options','raw','where','attributes','limit','include','model','map','stringify','catch','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x285da8,_0x2c66d7){var _0x4c97fe=function(_0x243126){while(--_0x243126){_0x285da8['push'](_0x285da8['shift']());}};_0x4c97fe(++_0x2c66d7);}(_0x53d9,0xad));var _0x953d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x953d('0x0'));var util=require(_0x953d('0x1'));var moment=require(_0x953d('0x2'));var BPromise=require(_0x953d('0x3'));var rs=require(_0x953d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x953d('0x5'))['db'];var utils=require(_0x953d('0x6'));var logger=require(_0x953d('0x7'))('rpc');var config=require(_0x953d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x953d('0x9')][_0x953d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51f292,_0x5bf3e4,_0xe7b1b5){return new BPromise(function(_0x2ad1d6,_0x366786){return client[_0x953d('0xb')](_0x51f292,_0xe7b1b5)[_0x953d('0xc')](function(_0x420bcb){logger[_0x953d('0xd')](_0x953d('0xe'),_0x5bf3e4,'request\x20sent');logger[_0x953d('0xf')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x5bf3e4,_0x953d('0x10'),JSON['stringify'](_0x420bcb));if(_0x420bcb[_0x953d('0x11')]){if(_0x420bcb[_0x953d('0x11')][_0x953d('0x12')]===0x1f4){logger[_0x953d('0x11')](_0x953d('0xe'),_0x5bf3e4,_0x420bcb[_0x953d('0x11')][_0x953d('0x13')]);return _0x366786(_0x420bcb[_0x953d('0x11')]['message']);}logger[_0x953d('0x11')](_0x953d('0xe'),_0x5bf3e4,_0x420bcb[_0x953d('0x11')]['message']);return _0x2ad1d6(_0x420bcb['error'][_0x953d('0x13')]);}else{logger[_0x953d('0xd')](_0x953d('0xe'),_0x5bf3e4,_0x953d('0x10'));_0x2ad1d6(_0x420bcb[_0x953d('0x14')][_0x953d('0x13')]);}})['catch'](function(_0x51c0b2){logger['error'](_0x953d('0xe'),_0x5bf3e4,_0x51c0b2);_0x366786(_0x51c0b2);});});}exports[_0x953d('0x15')]=function(_0x26d0b6){var _0xcb14f7=this;return new Promise(function(_0x3f3c15,_0x14af84){return db[_0x953d('0x16')]['findAll']({'raw':_0x26d0b6[_0x953d('0x17')]?_0x26d0b6[_0x953d('0x17')][_0x953d('0x18')]===undefined?!![]:![]:!![],'where':_0x26d0b6[_0x953d('0x17')]?_0x26d0b6[_0x953d('0x17')][_0x953d('0x19')]||null:null,'attributes':_0x26d0b6[_0x953d('0x17')]?_0x26d0b6[_0x953d('0x17')][_0x953d('0x1a')]||null:null,'limit':_0x26d0b6[_0x953d('0x17')]?_0x26d0b6[_0x953d('0x17')][_0x953d('0x1b')]||null:null,'include':_0x26d0b6[_0x953d('0x17')]?_0x26d0b6[_0x953d('0x17')][_0x953d('0x1c')]?_['map'](_0x26d0b6[_0x953d('0x17')][_0x953d('0x1c')],function(_0x17baf8){return{'model':db[_0x17baf8[_0x953d('0x1d')]],'as':_0x17baf8['as'],'attributes':_0x17baf8['attributes'],'include':_0x17baf8[_0x953d('0x1c')]?_[_0x953d('0x1e')](_0x17baf8[_0x953d('0x1c')],function(_0x169ae){return{'model':db[_0x169ae[_0x953d('0x1d')]],'as':_0x169ae['as'],'attributes':_0x169ae[_0x953d('0x1a')],'include':_0x169ae[_0x953d('0x1c')]?_[_0x953d('0x1e')](_0x169ae[_0x953d('0x1c')],function(_0x2dc7b2){return{'model':db[_0x2dc7b2[_0x953d('0x1d')]],'as':_0x2dc7b2['as'],'attributes':_0x2dc7b2[_0x953d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x953d('0xc')](function(_0x294be3){logger[_0x953d('0xd')](_0x953d('0x15'),_0x26d0b6);logger['debug']('GetVoiceCallReport',_0x26d0b6,JSON[_0x953d('0x1f')](_0x294be3));_0x3f3c15(_0x294be3);})[_0x953d('0x20')](function(_0x2f9e25){logger[_0x953d('0x11')](_0x953d('0x15'),_0x2f9e25[_0x953d('0x13')],_0x26d0b6);_0x14af84(_0xcb14f7['error'](0x1f4,_0x2f9e25['message']));});});};exports[_0x953d('0x21')]=function(_0x1d43f8){var _0x573b16=this;return new Promise(function(_0x3fae70,_0x346c7f){return db[_0x953d('0x16')][_0x953d('0x22')](_0x1d43f8[_0x953d('0x23')],{'raw':_0x1d43f8[_0x953d('0x17')]?_0x1d43f8[_0x953d('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x953d('0xc')](function(_0x315f1d){logger[_0x953d('0xd')]('CreateVoiceCallReport',_0x1d43f8);logger[_0x953d('0xf')](_0x953d('0x21'),_0x1d43f8,JSON['stringify'](_0x315f1d));_0x3fae70(_0x315f1d);})['catch'](function(_0x3a2481){logger[_0x953d('0x11')](_0x953d('0x21'),_0x3a2481[_0x953d('0x13')],_0x1d43f8);_0x346c7f(_0x573b16[_0x953d('0x11')](0x1f4,_0x3a2481['message']));});});};exports[_0x953d('0x24')]=function(_0x46611a){var _0x459d02=this;return new Promise(function(_0x5c4676,_0x2367aa){return db[_0x953d('0x16')][_0x953d('0x25')](_0x46611a[_0x953d('0x23')],{'raw':_0x46611a['options']?_0x46611a[_0x953d('0x17')][_0x953d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46611a[_0x953d('0x17')]?_0x46611a[_0x953d('0x17')][_0x953d('0x19')]||null:null,'attributes':_0x46611a[_0x953d('0x17')]?_0x46611a[_0x953d('0x17')][_0x953d('0x1a')]||null:null,'limit':_0x46611a[_0x953d('0x17')]?_0x46611a[_0x953d('0x17')]['limit']||null:null})[_0x953d('0xc')](function(_0x3d7040){logger[_0x953d('0xd')]('UpdateVoiceCallReport',_0x46611a);logger[_0x953d('0xf')](_0x953d('0x24'),_0x46611a,JSON[_0x953d('0x1f')](_0x3d7040));_0x5c4676(_0x3d7040);})['catch'](function(_0x33b053){logger[_0x953d('0x11')](_0x953d('0x24'),_0x33b053[_0x953d('0x13')],_0x46611a);_0x2367aa(_0x459d02[_0x953d('0x11')](0x1f4,_0x33b053[_0x953d('0x13')]));});});};
\ No newline at end of file
index 3ae7a47..c93099b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0623=['../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x200527,_0x398cf2){var _0x370afe=function(_0x36bb5f){while(--_0x36bb5f){_0x200527['push'](_0x200527['shift']());}};_0x370afe(++_0x398cf2);}(_0x0623,0x101));var _0x3062=function(_0x5606d9,_0x2ed570){_0x5606d9=_0x5606d9-0x0;var _0x46288d=_0x0623[_0x5606d9];return _0x46288d;};'use strict';var multer=require(_0x3062('0x0'));var util=require(_0x3062('0x1'));var path=require(_0x3062('0x2'));var timeout=require(_0x3062('0x3'));var express=require(_0x3062('0x4'));var router=express[_0x3062('0x5')]();var fs_extra=require(_0x3062('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3062('0x7'));var config=require(_0x3062('0x8'));var controller=require(_0x3062('0x9'));router[_0x3062('0xa')]('/',auth[_0x3062('0xb')](),controller[_0x3062('0xc')]);router[_0x3062('0xa')](_0x3062('0xd'),auth['isAuthenticated'](),controller[_0x3062('0xe')]);router[_0x3062('0xf')]('/',auth[_0x3062('0xb')](),controller[_0x3062('0x10')]);router[_0x3062('0x11')](_0x3062('0xd'),auth[_0x3062('0xb')](),controller[_0x3062('0x12')]);router[_0x3062('0x13')](_0x3062('0xd'),auth[_0x3062('0xb')](),controller[_0x3062('0x14')]);module[_0x3062('0x15')]=router;
\ No newline at end of file
+var _0x26da=['put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','isAuthenticated','get','/:id','show','post','create'];(function(_0x3842a6,_0x594a14){var _0x2ef530=function(_0x4e7c14){while(--_0x4e7c14){_0x3842a6['push'](_0x3842a6['shift']());}};_0x2ef530(++_0x594a14);}(_0x26da,0x64));var _0xa26d=function(_0x2264a1,_0x1a38b7){_0x2264a1=_0x2264a1-0x0;var _0x14de54=_0x26da[_0x2264a1];return _0x14de54;};'use strict';var multer=require(_0xa26d('0x0'));var util=require('util');var path=require(_0xa26d('0x1'));var timeout=require('connect-timeout');var express=require(_0xa26d('0x2'));var router=express[_0xa26d('0x3')]();var fs_extra=require(_0xa26d('0x4'));var auth=require(_0xa26d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0xa26d('0x6')](),controller['index']);router[_0xa26d('0x7')](_0xa26d('0x8'),auth['isAuthenticated'](),controller[_0xa26d('0x9')]);router[_0xa26d('0xa')]('/',auth[_0xa26d('0x6')](),controller[_0xa26d('0xb')]);router[_0xa26d('0xc')]('/:id',auth[_0xa26d('0x6')](),controller[_0xa26d('0xd')]);router[_0xa26d('0xe')](_0xa26d('0x8'),auth[_0xa26d('0x6')](),controller[_0xa26d('0xf')]);module['exports']=router;
\ No newline at end of file
index 93eb468..6094177 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9999=['options','join','getDataValue','BOOLEAN','exports','STRING','name'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x9999,0x177));var _0x9999=function(_0x4ad500,_0x3db6e1){_0x4ad500=_0x4ad500-0x0;var _0x11caa7=_0x9999[_0x4ad500];return _0x11caa7;};'use strict';var Sequelize=require('sequelize');module[_0x9999('0x0')]={'name':{'type':Sequelize[_0x9999('0x1')]},'prefix':{'type':Sequelize[_0x9999('0x1')],'unique':_0x9999('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x9999('0x1')],'set':function(_0x3899f1){this['setDataValue'](_0x9999('0x3'),_0x3899f1?_0x3899f1[_0x9999('0x4')](''):[]);},'get':function(){return this[_0x9999('0x5')](_0x9999('0x3'))?this[_0x9999('0x5')](_0x9999('0x3'))['split'](''):[];}},'auth':{'type':Sequelize[_0x9999('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x9999('0x1')]},'record':{'type':Sequelize[_0x9999('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x9999('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4418=['join','getDataValue','BOOLEAN','sequelize','STRING','name','setDataValue','options'];(function(_0x52abfc,_0x5b96ff){var _0x39a323=function(_0x205d74){while(--_0x205d74){_0x52abfc['push'](_0x52abfc['shift']());}};_0x39a323(++_0x5b96ff);}(_0x4418,0x19b));var _0x8441=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x4418[_0x220f3f];return _0x1f170e;};'use strict';var Sequelize=require(_0x8441('0x0'));module['exports']={'name':{'type':Sequelize[_0x8441('0x1')]},'prefix':{'type':Sequelize[_0x8441('0x1')],'unique':_0x8441('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x8441('0x1')],'set':function(_0x4ebc34){this[_0x8441('0x3')](_0x8441('0x4'),_0x4ebc34?_0x4ebc34[_0x8441('0x5')](''):[]);},'get':function(){return this[_0x8441('0x6')]('options')?this['getDataValue'](_0x8441('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0x8441('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x8441('0x1')]},'description':{'type':Sequelize[_0x8441('0x1')]}};
\ No newline at end of file
index 02b3100..429d08d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaefc=['save','update','then','ChanSpies','UserProfileResource','destroy','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','request-promise','moment','util','path','ejs','fs-extra','squel','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x2754ea,_0x5a6c01){var _0x4a1670=function(_0x17bc24){while(--_0x17bc24){_0x2754ea['push'](_0x2754ea['shift']());}};_0x4a1670(++_0x5a6c01);}(_0xaefc,0xc8));var _0xcaef=function(_0x2df5cb,_0x57de0b){_0x2df5cb=_0x2df5cb-0x0;var _0x43bf3d=_0xaefc[_0x2df5cb];return _0x43bf3d;};'use strict';var emlformat=require(_0xcaef('0x0'));var rimraf=require(_0xcaef('0x1'));var zipdir=require(_0xcaef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcaef('0x3'));var moment=require(_0xcaef('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcaef('0x5'));var path=require(_0xcaef('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcaef('0x7'));var fs=require('fs');var fs_extra=require(_0xcaef('0x8'));var _=require('lodash');var squel=require(_0xcaef('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcaef('0xa'));var toCsv=require(_0xcaef('0xb'));var querystring=require('querystring');var Papa=require(_0xcaef('0xc'));var Redis=require(_0xcaef('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xcaef('0xe'));var as=require(_0xcaef('0xf'));var hardwareService=require(_0xcaef('0x10'));var logger=require(_0xcaef('0x11'))(_0xcaef('0x12'));var utils=require(_0xcaef('0x13'));var config=require(_0xcaef('0x14'));var licenseUtil=require(_0xcaef('0x15'));var db=require(_0xcaef('0x16'))['db'];function respondWithStatusCode(_0x38a18b,_0x5224d5){_0x5224d5=_0x5224d5||0xcc;return function(_0x3be516){if(_0x3be516){return _0x38a18b[_0xcaef('0x17')](_0x5224d5);}return _0x38a18b[_0xcaef('0x18')](_0x5224d5)[_0xcaef('0x19')]();};}function respondWithResult(_0x426dd3,_0x48eac6){_0x48eac6=_0x48eac6||0xc8;return function(_0x514db4){if(_0x514db4){return _0x426dd3[_0xcaef('0x18')](_0x48eac6)[_0xcaef('0x1a')](_0x514db4);}};}function respondWithFilteredResult(_0x568944,_0x56eb6e){return function(_0x3d4871){if(_0x3d4871){var _0x4f20fd=typeof _0x56eb6e[_0xcaef('0x1b')]===_0xcaef('0x1c')&&typeof _0x56eb6e[_0xcaef('0x1d')]==='undefined';var _0x15c549=_0x3d4871['count'];var _0x5a37a9=_0x4f20fd?0x0:_0x56eb6e[_0xcaef('0x1b')];var _0x545ad3=_0x4f20fd?_0x3d4871[_0xcaef('0x1e')]:_0x56eb6e['offset']+_0x56eb6e[_0xcaef('0x1d')];var _0x33520d;if(_0x545ad3>=_0x15c549){_0x545ad3=_0x15c549;_0x33520d=0xc8;}else{_0x33520d=0xce;}_0x568944[_0xcaef('0x18')](_0x33520d);return _0x568944[_0xcaef('0x1f')](_0xcaef('0x20'),_0x5a37a9+'-'+_0x545ad3+'/'+_0x15c549)[_0xcaef('0x1a')](_0x3d4871);}return null;};}function patchUpdates(_0x10940e){return function(_0x3be748){try{jsonpatch[_0xcaef('0x21')](_0x3be748,_0x10940e,!![]);}catch(_0x1224f6){return BPromise['reject'](_0x1224f6);}return _0x3be748[_0xcaef('0x22')]();};}function saveUpdates(_0x40ab44,_0x480ccc){return function(_0x3bf242){if(_0x3bf242){return _0x3bf242[_0xcaef('0x23')](_0x40ab44)[_0xcaef('0x24')](function(_0x2dd6b3){return _0x2dd6b3;});}return null;};}function removeEntity(_0x5c1c94,_0x5c8d3a){return function(_0x3e37a3){if(_0x3e37a3){return _0x3e37a3['destroy']()[_0xcaef('0x24')](function(){var _0x1dfd76=_0x3e37a3['get']({'plain':!![]});var _0x5a49f6=_0xcaef('0x25');return db[_0xcaef('0x26')][_0xcaef('0x27')]({'where':{'type':_0x5a49f6,'resourceId':_0x1dfd76['id']}})['then'](function(){return _0x3e37a3;});})['then'](function(){_0x5c1c94[_0xcaef('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x482ce4,_0xb0cdfe){return function(_0x5135b7){if(!_0x5135b7){_0x482ce4['sendStatus'](0x194);}return _0x5135b7;};}function handleError(_0x24f623,_0xded21c){_0xded21c=_0xded21c||0x1f4;return function(_0x8bb9c5){logger['error'](_0x8bb9c5[_0xcaef('0x28')]);if(_0x8bb9c5['name']){delete _0x8bb9c5[_0xcaef('0x29')];}_0x24f623[_0xcaef('0x18')](_0xded21c)[_0xcaef('0x2a')](_0x8bb9c5);};}exports[_0xcaef('0x2b')]=function(_0x478059,_0x5dda23){var _0x8ace76={},_0x2a2284={},_0x3c770f={'count':0x0,'rows':[]};var _0x4a0467=_[_0xcaef('0x2c')](db[_0xcaef('0x2d')][_0xcaef('0x2e')],function(_0x4f8e04){return{'name':_0x4f8e04[_0xcaef('0x2f')],'type':_0x4f8e04['type']['key']};});_0x2a2284[_0xcaef('0x30')]=_[_0xcaef('0x2c')](_0x4a0467,_0xcaef('0x29'));_0x2a2284['query']=_[_0xcaef('0x31')](_0x478059['query']);_0x2a2284[_0xcaef('0x32')]=_[_0xcaef('0x33')](_0x2a2284[_0xcaef('0x30')],_0x2a2284[_0xcaef('0x34')]);_0x8ace76['attributes']=_[_0xcaef('0x33')](_0x2a2284['model'],qs[_0xcaef('0x35')](_0x478059[_0xcaef('0x34')][_0xcaef('0x35')]));_0x8ace76['attributes']=_0x8ace76[_0xcaef('0x36')][_0xcaef('0x37')]?_0x8ace76[_0xcaef('0x36')]:_0x2a2284['model'];if(!_0x478059['query'][_0xcaef('0x38')]('nolimit')){_0x8ace76['limit']=qs[_0xcaef('0x1d')](_0x478059[_0xcaef('0x34')][_0xcaef('0x1d')]);_0x8ace76[_0xcaef('0x1b')]=qs[_0xcaef('0x1b')](_0x478059[_0xcaef('0x34')][_0xcaef('0x1b')]);}_0x8ace76['order']=qs[_0xcaef('0x39')](_0x478059[_0xcaef('0x34')][_0xcaef('0x39')]);_0x8ace76[_0xcaef('0x3a')]=qs[_0xcaef('0x32')](_['pick'](_0x478059['query'],_0x2a2284[_0xcaef('0x32')]),_0x4a0467);if(_0x478059[_0xcaef('0x34')][_0xcaef('0x3b')]){_0x8ace76[_0xcaef('0x3a')]=_[_0xcaef('0x3c')](_0x8ace76[_0xcaef('0x3a')],{'$or':_[_0xcaef('0x2c')](_0x4a0467,function(_0x165008){if(_0x165008[_0xcaef('0x3d')]!==_0xcaef('0x3e')){var _0x221b23={};_0x221b23[_0x165008[_0xcaef('0x29')]]={'$like':'%'+_0x478059['query'][_0xcaef('0x3b')]+'%'};return _0x221b23;}})});}_0x8ace76=_['merge']({},_0x8ace76,_0x478059[_0xcaef('0x3f')]);var _0x4dbfca={'where':_0x8ace76[_0xcaef('0x3a')]};return db[_0xcaef('0x2d')]['count'](_0x4dbfca)['then'](function(_0x33dd94){_0x3c770f['count']=_0x33dd94;if(_0x478059[_0xcaef('0x34')][_0xcaef('0x40')]){_0x8ace76[_0xcaef('0x41')]=[{'all':!![]}];}return db[_0xcaef('0x2d')]['findAll'](_0x8ace76);})['then'](function(_0x4ef3fe){_0x3c770f['rows']=_0x4ef3fe;return _0x3c770f;})['then'](respondWithFilteredResult(_0x5dda23,_0x8ace76))[_0xcaef('0x42')](handleError(_0x5dda23,null));};exports[_0xcaef('0x43')]=function(_0xfe6b75,_0xcee1ab){var _0x8a7725={'raw':![],'where':{'id':_0xfe6b75['params']['id']}},_0x2f66c4={};_0x2f66c4[_0xcaef('0x30')]=_[_0xcaef('0x31')](db['VoiceChanSpy'][_0xcaef('0x2e')]);_0x2f66c4[_0xcaef('0x34')]=_['keys'](_0xfe6b75[_0xcaef('0x34')]);_0x2f66c4[_0xcaef('0x32')]=_[_0xcaef('0x33')](_0x2f66c4['model'],_0x2f66c4[_0xcaef('0x34')]);_0x8a7725[_0xcaef('0x36')]=_[_0xcaef('0x33')](_0x2f66c4[_0xcaef('0x30')],qs[_0xcaef('0x35')](_0xfe6b75[_0xcaef('0x34')][_0xcaef('0x35')]));_0x8a7725[_0xcaef('0x36')]=_0x8a7725[_0xcaef('0x36')][_0xcaef('0x37')]?_0x8a7725[_0xcaef('0x36')]:_0x2f66c4[_0xcaef('0x30')];if(_0xfe6b75[_0xcaef('0x34')][_0xcaef('0x40')]){_0x8a7725['include']=[{'all':!![]}];}_0x8a7725=_[_0xcaef('0x3c')]({},_0x8a7725,_0xfe6b75[_0xcaef('0x3f')]);return db[_0xcaef('0x2d')][_0xcaef('0x44')](_0x8a7725)[_0xcaef('0x24')](handleEntityNotFound(_0xcee1ab,null))[_0xcaef('0x24')](respondWithResult(_0xcee1ab,null))['catch'](handleError(_0xcee1ab,null));};exports[_0xcaef('0x45')]=function(_0x22030f,_0x2397b6){return db[_0xcaef('0x2d')]['create'](_0x22030f[_0xcaef('0x46')],{})[_0xcaef('0x24')](function(_0x270df8){var _0x239485=_0x22030f[_0xcaef('0x47')]['get']({'plain':!![]});if(!_0x239485)throw new Error(_0xcaef('0x48'));if(_0x239485[_0xcaef('0x49')]===_0xcaef('0x47')){var _0x13caa7=_0x270df8[_0xcaef('0x4a')]({'plain':!![]});var _0x578e80='ChanSpies';return db['UserProfileSection'][_0xcaef('0x44')]({'where':{'name':_0x578e80,'userProfileId':_0x239485['userProfileId']},'raw':!![]})[_0xcaef('0x24')](function(_0x178c8e){if(_0x178c8e&&_0x178c8e[_0xcaef('0x4b')]===0x0){return db[_0xcaef('0x26')]['create']({'name':_0x13caa7[_0xcaef('0x29')],'resourceId':_0x13caa7['id'],'type':_0x178c8e[_0xcaef('0x29')],'sectionId':_0x178c8e['id']},{})['then'](function(){return _0x270df8;});}else{return _0x270df8;}})['catch'](function(_0x2b15a3){logger['error'](_0xcaef('0x4c'),_0x2b15a3);throw _0x2b15a3;});}return _0x270df8;})[_0xcaef('0x24')](respondWithResult(_0x2397b6,0xc9))[_0xcaef('0x42')](handleError(_0x2397b6,null));};exports[_0xcaef('0x23')]=function(_0x3551e2,_0x15869e){if(_0x3551e2[_0xcaef('0x46')]['id']){delete _0x3551e2[_0xcaef('0x46')]['id'];}return db[_0xcaef('0x2d')][_0xcaef('0x44')]({'where':{'id':_0x3551e2[_0xcaef('0x4d')]['id']}})[_0xcaef('0x24')](handleEntityNotFound(_0x15869e,null))[_0xcaef('0x24')](saveUpdates(_0x3551e2[_0xcaef('0x46')],null))[_0xcaef('0x24')](respondWithResult(_0x15869e,null))['catch'](handleError(_0x15869e,null));};exports[_0xcaef('0x27')]=function(_0x230450,_0x4b84b1){return db[_0xcaef('0x2d')][_0xcaef('0x44')]({'where':{'id':_0x230450[_0xcaef('0x4d')]['id']}})[_0xcaef('0x24')](handleEntityNotFound(_0x4b84b1,null))[_0xcaef('0x24')](removeEntity(_0x4b84b1,null))[_0xcaef('0x42')](handleError(_0x4b84b1,null));};
\ No newline at end of file
+var _0x2392=['update','then','destroy','get','ChanSpies','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','catch','params','keys','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','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','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply'];(function(_0x197c37,_0x2c688f){var _0x2585cc=function(_0x14a9b7){while(--_0x14a9b7){_0x197c37['push'](_0x197c37['shift']());}};_0x2585cc(++_0x2c688f);}(_0x2392,0xd0));var _0x2239=function(_0x2e1007,_0x5622f7){_0x2e1007=_0x2e1007-0x0;var _0x1a28f0=_0x2392[_0x2e1007];return _0x1a28f0;};'use strict';var emlformat=require(_0x2239('0x0'));var rimraf=require(_0x2239('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2239('0x2'));var rp=require(_0x2239('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2239('0x4'));var util=require(_0x2239('0x5'));var path=require(_0x2239('0x6'));var sox=require(_0x2239('0x7'));var csv=require(_0x2239('0x8'));var ejs=require(_0x2239('0x9'));var fs=require('fs');var fs_extra=require(_0x2239('0xa'));var _=require(_0x2239('0xb'));var squel=require(_0x2239('0xc'));var crypto=require(_0x2239('0xd'));var jsforce=require(_0x2239('0xe'));var deskjs=require(_0x2239('0xf'));var toCsv=require(_0x2239('0x8'));var querystring=require('querystring');var Papa=require(_0x2239('0x10'));var Redis=require(_0x2239('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2239('0x12'));var hardwareService=require(_0x2239('0x13'));var logger=require(_0x2239('0x14'))(_0x2239('0x15'));var utils=require(_0x2239('0x16'));var config=require(_0x2239('0x17'));var licenseUtil=require(_0x2239('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4702dd,_0x3cee95){_0x3cee95=_0x3cee95||0xcc;return function(_0x4af7b7){if(_0x4af7b7){return _0x4702dd[_0x2239('0x19')](_0x3cee95);}return _0x4702dd[_0x2239('0x1a')](_0x3cee95)[_0x2239('0x1b')]();};}function respondWithResult(_0x3338b0,_0x5165dc){_0x5165dc=_0x5165dc||0xc8;return function(_0x367c82){if(_0x367c82){return _0x3338b0['status'](_0x5165dc)[_0x2239('0x1c')](_0x367c82);}};}function respondWithFilteredResult(_0x163e09,_0x4236da){return function(_0x472ce2){if(_0x472ce2){var _0x4f23ce=typeof _0x4236da[_0x2239('0x1d')]===_0x2239('0x1e')&&typeof _0x4236da['limit']===_0x2239('0x1e');var _0x4f218a=_0x472ce2[_0x2239('0x1f')];var _0x558138=_0x4f23ce?0x0:_0x4236da[_0x2239('0x1d')];var _0x594f20=_0x4f23ce?_0x472ce2[_0x2239('0x1f')]:_0x4236da[_0x2239('0x1d')]+_0x4236da[_0x2239('0x20')];var _0x3d8fd9;if(_0x594f20>=_0x4f218a){_0x594f20=_0x4f218a;_0x3d8fd9=0xc8;}else{_0x3d8fd9=0xce;}_0x163e09['status'](_0x3d8fd9);return _0x163e09[_0x2239('0x21')]('Content-Range',_0x558138+'-'+_0x594f20+'/'+_0x4f218a)[_0x2239('0x1c')](_0x472ce2);}return null;};}function patchUpdates(_0x4917cb){return function(_0x174bf7){try{jsonpatch[_0x2239('0x22')](_0x174bf7,_0x4917cb,!![]);}catch(_0x2c2d74){return BPromise['reject'](_0x2c2d74);}return _0x174bf7['save']();};}function saveUpdates(_0x2b2000,_0x521079){return function(_0x2f625d){if(_0x2f625d){return _0x2f625d[_0x2239('0x23')](_0x2b2000)[_0x2239('0x24')](function(_0x407581){return _0x407581;});}return null;};}function removeEntity(_0x54af84,_0x1f1f49){return function(_0x12133e){if(_0x12133e){return _0x12133e[_0x2239('0x25')]()[_0x2239('0x24')](function(){var _0x5c0fa7=_0x12133e[_0x2239('0x26')]({'plain':!![]});var _0x44e671=_0x2239('0x27');return db['UserProfileResource'][_0x2239('0x25')]({'where':{'type':_0x44e671,'resourceId':_0x5c0fa7['id']}})[_0x2239('0x24')](function(){return _0x12133e;});})[_0x2239('0x24')](function(){_0x54af84[_0x2239('0x1a')](0xcc)[_0x2239('0x1b')]();});}};}function handleEntityNotFound(_0x1937ee,_0xcb6711){return function(_0x4f4135){if(!_0x4f4135){_0x1937ee['sendStatus'](0x194);}return _0x4f4135;};}function handleError(_0x4a970a,_0x587ebc){_0x587ebc=_0x587ebc||0x1f4;return function(_0x576ac9){logger[_0x2239('0x28')](_0x576ac9[_0x2239('0x29')]);if(_0x576ac9[_0x2239('0x2a')]){delete _0x576ac9[_0x2239('0x2a')];}_0x4a970a['status'](_0x587ebc)[_0x2239('0x2b')](_0x576ac9);};}exports[_0x2239('0x2c')]=function(_0x3e164a,_0x23fab8){var _0xbf989f={},_0xac6fe8={},_0x26f3f2={'count':0x0,'rows':[]};var _0x5a9cdf=_[_0x2239('0x2d')](db[_0x2239('0x2e')][_0x2239('0x2f')],function(_0x3cc74c){return{'name':_0x3cc74c[_0x2239('0x30')],'type':_0x3cc74c['type'][_0x2239('0x31')]};});_0xac6fe8[_0x2239('0x32')]=_['map'](_0x5a9cdf,'name');_0xac6fe8['query']=_['keys'](_0x3e164a['query']);_0xac6fe8[_0x2239('0x33')]=_[_0x2239('0x34')](_0xac6fe8[_0x2239('0x32')],_0xac6fe8[_0x2239('0x35')]);_0xbf989f[_0x2239('0x36')]=_['intersection'](_0xac6fe8[_0x2239('0x32')],qs[_0x2239('0x37')](_0x3e164a[_0x2239('0x35')]['fields']));_0xbf989f[_0x2239('0x36')]=_0xbf989f[_0x2239('0x36')][_0x2239('0x38')]?_0xbf989f['attributes']:_0xac6fe8['model'];if(!_0x3e164a['query'][_0x2239('0x39')](_0x2239('0x3a'))){_0xbf989f[_0x2239('0x20')]=qs['limit'](_0x3e164a['query'][_0x2239('0x20')]);_0xbf989f['offset']=qs[_0x2239('0x1d')](_0x3e164a[_0x2239('0x35')][_0x2239('0x1d')]);}_0xbf989f[_0x2239('0x3b')]=qs['sort'](_0x3e164a[_0x2239('0x35')][_0x2239('0x3c')]);_0xbf989f[_0x2239('0x3d')]=qs[_0x2239('0x33')](_[_0x2239('0x3e')](_0x3e164a[_0x2239('0x35')],_0xac6fe8[_0x2239('0x33')]),_0x5a9cdf);if(_0x3e164a[_0x2239('0x35')]['filter']){_0xbf989f[_0x2239('0x3d')]=_[_0x2239('0x3f')](_0xbf989f[_0x2239('0x3d')],{'$or':_[_0x2239('0x2d')](_0x5a9cdf,function(_0x45136b){if(_0x45136b[_0x2239('0x40')]!==_0x2239('0x41')){var _0x1c55ef={};_0x1c55ef[_0x45136b[_0x2239('0x2a')]]={'$like':'%'+_0x3e164a[_0x2239('0x35')]['filter']+'%'};return _0x1c55ef;}})});}_0xbf989f=_[_0x2239('0x3f')]({},_0xbf989f,_0x3e164a[_0x2239('0x42')]);var _0x16304d={'where':_0xbf989f[_0x2239('0x3d')]};return db['VoiceChanSpy']['count'](_0x16304d)[_0x2239('0x24')](function(_0x546862){_0x26f3f2[_0x2239('0x1f')]=_0x546862;if(_0x3e164a['query'][_0x2239('0x43')]){_0xbf989f[_0x2239('0x44')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0xbf989f);})['then'](function(_0x4242c2){_0x26f3f2['rows']=_0x4242c2;return _0x26f3f2;})[_0x2239('0x24')](respondWithFilteredResult(_0x23fab8,_0xbf989f))[_0x2239('0x45')](handleError(_0x23fab8,null));};exports['show']=function(_0x2a2a6a,_0x1f9aa1){var _0x153449={'raw':![],'where':{'id':_0x2a2a6a[_0x2239('0x46')]['id']}},_0x1f6288={};_0x1f6288[_0x2239('0x32')]=_[_0x2239('0x47')](db[_0x2239('0x2e')][_0x2239('0x2f')]);_0x1f6288['query']=_[_0x2239('0x47')](_0x2a2a6a['query']);_0x1f6288[_0x2239('0x33')]=_['intersection'](_0x1f6288[_0x2239('0x32')],_0x1f6288[_0x2239('0x35')]);_0x153449['attributes']=_[_0x2239('0x34')](_0x1f6288['model'],qs[_0x2239('0x37')](_0x2a2a6a[_0x2239('0x35')][_0x2239('0x37')]));_0x153449['attributes']=_0x153449['attributes']['length']?_0x153449[_0x2239('0x36')]:_0x1f6288[_0x2239('0x32')];if(_0x2a2a6a[_0x2239('0x35')][_0x2239('0x43')]){_0x153449[_0x2239('0x44')]=[{'all':!![]}];}_0x153449=_[_0x2239('0x3f')]({},_0x153449,_0x2a2a6a['options']);return db[_0x2239('0x2e')][_0x2239('0x48')](_0x153449)[_0x2239('0x24')](handleEntityNotFound(_0x1f9aa1,null))['then'](respondWithResult(_0x1f9aa1,null))[_0x2239('0x45')](handleError(_0x1f9aa1,null));};exports['create']=function(_0x4a9c3c,_0x410bc6){return db[_0x2239('0x2e')][_0x2239('0x49')](_0x4a9c3c[_0x2239('0x4a')],{})[_0x2239('0x24')](function(_0x51bcad){var _0xba071b=_0x4a9c3c[_0x2239('0x4b')]['get']({'plain':!![]});if(!_0xba071b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xba071b['role']===_0x2239('0x4b')){var _0x51f5d3=_0x51bcad[_0x2239('0x26')]({'plain':!![]});var _0x4b674b=_0x2239('0x27');return db[_0x2239('0x4c')][_0x2239('0x48')]({'where':{'name':_0x4b674b,'userProfileId':_0xba071b[_0x2239('0x4d')]},'raw':!![]})['then'](function(_0x509651){if(_0x509651&&_0x509651[_0x2239('0x4e')]===0x0){return db[_0x2239('0x4f')][_0x2239('0x49')]({'name':_0x51f5d3[_0x2239('0x2a')],'resourceId':_0x51f5d3['id'],'type':_0x509651[_0x2239('0x2a')],'sectionId':_0x509651['id']},{})['then'](function(){return _0x51bcad;});}else{return _0x51bcad;}})[_0x2239('0x45')](function(_0x430c56){logger[_0x2239('0x28')](_0x2239('0x50'),_0x430c56);throw _0x430c56;});}return _0x51bcad;})[_0x2239('0x24')](respondWithResult(_0x410bc6,0xc9))['catch'](handleError(_0x410bc6,null));};exports[_0x2239('0x23')]=function(_0x2286f6,_0x4bf50f){if(_0x2286f6[_0x2239('0x4a')]['id']){delete _0x2286f6[_0x2239('0x4a')]['id'];}return db['VoiceChanSpy'][_0x2239('0x48')]({'where':{'id':_0x2286f6[_0x2239('0x46')]['id']}})['then'](handleEntityNotFound(_0x4bf50f,null))[_0x2239('0x24')](saveUpdates(_0x2286f6[_0x2239('0x4a')],null))['then'](respondWithResult(_0x4bf50f,null))[_0x2239('0x45')](handleError(_0x4bf50f,null));};exports[_0x2239('0x25')]=function(_0x3ef97,_0x1ffbb6){return db[_0x2239('0x2e')][_0x2239('0x48')]({'where':{'id':_0x3ef97[_0x2239('0x46')]['id']}})[_0x2239('0x24')](handleEntityNotFound(_0x1ffbb6,null))[_0x2239('0x24')](removeEntity(_0x1ffbb6,null))[_0x2239('0x45')](handleError(_0x1ffbb6,null));};
\ No newline at end of file
index d5294d1..860e5ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c12=['record','MixMonitor','recordingFormat','auth','Authenticate','password','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','User','findAll','agent','catch','exports','models','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','lodash','util','context','from-sip','format','%s%s','system','push','merge','Set','CDR(type)=%s','chanspy'];(function(_0x547af5,_0x25cf79){var _0x97cda7=function(_0xc60f77){while(--_0xc60f77){_0x547af5['push'](_0x547af5['shift']());}};_0x97cda7(++_0x25cf79);}(_0x8c12,0x196));var _0x28c1=function(_0x5890e9,_0x20c464){_0x5890e9=_0x5890e9-0x0;var _0x25ff13=_0x8c12[_0x5890e9];return _0x25ff13;};'use strict';var _=require(_0x28c1('0x0'));var util=require(_0x28c1('0x1'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x217f6a,_0x185bf0,_0x22ca45){var _0x247ef4=0x1;var _0x1b4a61=[];var _0x49282a={'context':_0x185bf0[_0x28c1('0x2')]||_0x28c1('0x3'),'exten':util[_0x28c1('0x4')](_0x28c1('0x5'),_0x217f6a['prefix'],_0x22ca45),'type':_0x28c1('0x6'),'isApp':![],'ChanSpyId':_0x217f6a['id'],'UserId':_0x185bf0['id']};_0x1b4a61[_0x28c1('0x7')](_[_0x28c1('0x8')]({'app':_0x28c1('0x9'),'appdata':util[_0x28c1('0x4')](_0x28c1('0xa'),_0x28c1('0xb')),'priority':_0x247ef4++},_0x49282a));if(_0x217f6a[_0x28c1('0xc')]){_0x1b4a61['push'](_['merge']({'app':_0x28c1('0xd'),'appdata':util[_0x28c1('0x4')]('${UNIQUEID}.%s,a',_0x217f6a[_0x28c1('0xe')]),'priority':_0x247ef4++},_0x49282a));}if(_0x217f6a[_0x28c1('0xf')]){_0x1b4a61[_0x28c1('0x7')](_[_0x28c1('0x8')]({'app':_0x28c1('0x10'),'appdata':_0x217f6a[_0x28c1('0x11')],'priority':_0x247ef4++},_0x49282a));}_0x1b4a61[_0x28c1('0x7')](_[_0x28c1('0x8')]({'app':'ChanSpy','appdata':util[_0x28c1('0x4')](_0x28c1('0x12'),_0x185bf0[_0x28c1('0x13')],_0x217f6a[_0x28c1('0x14')]?_0x217f6a[_0x28c1('0x14')]['join'](''):''),'priority':_0x247ef4++},_0x49282a));if(_0x217f6a['record']){_0x1b4a61[_0x28c1('0x7')](_[_0x28c1('0x8')]({'app':_0x28c1('0x15'),'priority':_0x247ef4++},_0x49282a));}return _0x1b4a61;};var getChanSpyApplications=function(_0xce229c,_0x7e6d1){var _0x1e2012=[];for(var _0x11c133=0x0,_0x45c2cd=0x1;_0x11c133<_0x7e6d1[_0x28c1('0x16')];_0x11c133++,_0x45c2cd=0x1){_0x1e2012=_0x1e2012[_0x28c1('0x17')](getUserApplications(_0xce229c,_0x7e6d1[_0x11c133],_0x7e6d1[_0x11c133][_0x28c1('0x18')]));if(_0x7e6d1[_0x11c133][_0x28c1('0x18')]!=_0x7e6d1[_0x11c133][_0x28c1('0x13')]){_0x1e2012=_0x1e2012[_0x28c1('0x17')](getUserApplications(_0xce229c,_0x7e6d1[_0x11c133],_0x7e6d1[_0x11c133][_0x28c1('0x13')]));}}return _0x1e2012;};var getChanSpyPromise=function(_0x34f67f,_0x2e4e00){return new BPromise(function(_0x3ae7d6,_0xb49ce6){return _0x34f67f[_0x28c1('0x19')][_0x28c1('0x1a')]({'attributes':['id',_0x28c1('0x13'),_0x28c1('0x18')],'where':{'role':_0x28c1('0x1b'),'chanspy':!![]},'raw':!![]})['then'](function(_0x26595d){if(_0x26595d){return _0x3ae7d6(getChanSpyApplications(_0x2e4e00,_0x26595d));}return _0x3ae7d6([]);})[_0x28c1('0x1c')](function(_0x5632fe){_0xb49ce6(_0x5632fe);});});};module[_0x28c1('0x1d')]=function(_0x3a8f9b,_0x5aa71f){var _0x337b32=_0x3a8f9b[_0x28c1('0x1e')];return _0x3a8f9b[_0x28c1('0x1f')](_0x28c1('0x20'),attributes,{'tableName':_0x28c1('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ce1e2,_0x2994ed,_0x4a7b20){return getChanSpyPromise(_0x337b32,_0x2ce1e2)[_0x28c1('0x22')](function(_0x16f4db){if(_0x16f4db&&_0x16f4db[_0x28c1('0x16')]){return _0x337b32[_0x28c1('0x23')]['bulkCreate'](_0x16f4db);}})[_0x28c1('0x22')](function(){_0x4a7b20();})[_0x28c1('0x1c')](function(_0xd0485a){_0x4a7b20(_0xd0485a);});},'afterUpdate':function(_0x4c5906,_0xf8a0fa,_0x4416b0){return _0x337b32[_0x28c1('0x23')]['destroy']({'where':{'ChanSpyId':_0x4c5906['id']}})[_0x28c1('0x22')](function(){return getChanSpyPromise(_0x337b32,_0x4c5906);})['then'](function(_0x33d737){if(_0x33d737&&_0x33d737['length']){return _0x337b32[_0x28c1('0x23')][_0x28c1('0x24')](_0x33d737);}})[_0x28c1('0x22')](function(){_0x4416b0();})[_0x28c1('0x1c')](function(_0x150db1){_0x4416b0(_0x150db1);});},'afterDestroy':function(_0x19cf6e,_0x560fee,_0x5a9f17){return _0x337b32[_0x28c1('0x23')][_0x28c1('0x25')]({'where':{'ChanSpyId':_0x19cf6e['id']}})['then'](function(){_0x5a9f17();})[_0x28c1('0x1c')](function(_0x40b1c8){_0x5a9f17(_0x40b1c8);});}}});};
\ No newline at end of file
+var _0xf4dc=['SIP/%s,%s','name','StopMixMonitor','concat','internal','User','findAll','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','catch','destroy','lodash','bluebird','./voiceChanSpy.attributes','format','prefix','system','merge','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','auth','push','Authenticate','password','ChanSpy'];(function(_0x24607b,_0x3b0ac7){var _0x349406=function(_0x3a9d55){while(--_0x3a9d55){_0x24607b['push'](_0x24607b['shift']());}};_0x349406(++_0x3b0ac7);}(_0xf4dc,0x7f));var _0xcf4d=function(_0x6278b0,_0x3cd4f1){_0x6278b0=_0x6278b0-0x0;var _0x3cc57c=_0xf4dc[_0x6278b0];return _0x3cc57c;};'use strict';var _=require(_0xcf4d('0x0'));var util=require('util');var BPromise=require(_0xcf4d('0x1'));var attributes=require(_0xcf4d('0x2'));var getUserApplications=function(_0x1dfeba,_0x18858a,_0x369869){var _0x19be6c=0x1;var _0x1891fe=[];var _0x2076b4={'context':_0x18858a['context']||'from-sip','exten':util[_0xcf4d('0x3')]('%s%s',_0x1dfeba[_0xcf4d('0x4')],_0x369869),'type':_0xcf4d('0x5'),'isApp':![],'ChanSpyId':_0x1dfeba['id'],'UserId':_0x18858a['id']};_0x1891fe['push'](_[_0xcf4d('0x6')]({'app':'Set','appdata':util['format'](_0xcf4d('0x7'),_0xcf4d('0x8')),'priority':_0x19be6c++},_0x2076b4));if(_0x1dfeba[_0xcf4d('0x9')]){_0x1891fe['push'](_[_0xcf4d('0x6')]({'app':'MixMonitor','appdata':util[_0xcf4d('0x3')](_0xcf4d('0xa'),_0x1dfeba[_0xcf4d('0xb')]),'priority':_0x19be6c++},_0x2076b4));}if(_0x1dfeba[_0xcf4d('0xc')]){_0x1891fe[_0xcf4d('0xd')](_[_0xcf4d('0x6')]({'app':_0xcf4d('0xe'),'appdata':_0x1dfeba[_0xcf4d('0xf')],'priority':_0x19be6c++},_0x2076b4));}_0x1891fe['push'](_['merge']({'app':_0xcf4d('0x10'),'appdata':util[_0xcf4d('0x3')](_0xcf4d('0x11'),_0x18858a[_0xcf4d('0x12')],_0x1dfeba['options']?_0x1dfeba['options']['join'](''):''),'priority':_0x19be6c++},_0x2076b4));if(_0x1dfeba['record']){_0x1891fe[_0xcf4d('0xd')](_[_0xcf4d('0x6')]({'app':_0xcf4d('0x13'),'priority':_0x19be6c++},_0x2076b4));}return _0x1891fe;};var getChanSpyApplications=function(_0x4c87d1,_0x1813e3){var _0x2c2d46=[];for(var _0x1bac81=0x0,_0x3797a3=0x1;_0x1bac81<_0x1813e3['length'];_0x1bac81++,_0x3797a3=0x1){_0x2c2d46=_0x2c2d46[_0xcf4d('0x14')](getUserApplications(_0x4c87d1,_0x1813e3[_0x1bac81],_0x1813e3[_0x1bac81][_0xcf4d('0x15')]));if(_0x1813e3[_0x1bac81][_0xcf4d('0x15')]!=_0x1813e3[_0x1bac81][_0xcf4d('0x12')]){_0x2c2d46=_0x2c2d46[_0xcf4d('0x14')](getUserApplications(_0x4c87d1,_0x1813e3[_0x1bac81],_0x1813e3[_0x1bac81]['name']));}}return _0x2c2d46;};var getChanSpyPromise=function(_0x1ce814,_0xea72c2){return new BPromise(function(_0x3ef56a,_0x3fba2a){return _0x1ce814[_0xcf4d('0x16')][_0xcf4d('0x17')]({'attributes':['id',_0xcf4d('0x12'),_0xcf4d('0x15')],'where':{'role':_0xcf4d('0x18'),'chanspy':!![]},'raw':!![]})[_0xcf4d('0x19')](function(_0x2d92fe){if(_0x2d92fe){return _0x3ef56a(getChanSpyApplications(_0xea72c2,_0x2d92fe));}return _0x3ef56a([]);})['catch'](function(_0x364272){_0x3fba2a(_0x364272);});});};module[_0xcf4d('0x1a')]=function(_0x439978,_0x4113b8){var _0x592a08=_0x439978[_0xcf4d('0x1b')];return _0x439978[_0xcf4d('0x1c')](_0xcf4d('0x1d'),attributes,{'tableName':_0xcf4d('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xd83018,_0x2edc2b,_0x471eae){return getChanSpyPromise(_0x592a08,_0xd83018)[_0xcf4d('0x19')](function(_0x4d5a75){if(_0x4d5a75&&_0x4d5a75[_0xcf4d('0x1f')]){return _0x592a08[_0xcf4d('0x20')][_0xcf4d('0x21')](_0x4d5a75);}})[_0xcf4d('0x19')](function(){_0x471eae();})[_0xcf4d('0x22')](function(_0xaeb2f3){_0x471eae(_0xaeb2f3);});},'afterUpdate':function(_0x1d1528,_0x5b0e8b,_0x1d5161){return _0x592a08[_0xcf4d('0x20')][_0xcf4d('0x23')]({'where':{'ChanSpyId':_0x1d1528['id']}})[_0xcf4d('0x19')](function(){return getChanSpyPromise(_0x592a08,_0x1d1528);})[_0xcf4d('0x19')](function(_0x5ae60f){if(_0x5ae60f&&_0x5ae60f['length']){return _0x592a08[_0xcf4d('0x20')]['bulkCreate'](_0x5ae60f);}})[_0xcf4d('0x19')](function(){_0x1d5161();})[_0xcf4d('0x22')](function(_0x512786){_0x1d5161(_0x512786);});},'afterDestroy':function(_0x5bcda1,_0x484771,_0x482e37){return _0x592a08['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x5bcda1['id']}})[_0xcf4d('0x19')](function(){_0x482e37();})[_0xcf4d('0x22')](function(_0x28550b){_0x482e37(_0x28550b);});}}});};
\ No newline at end of file
index f1e0c59..023b5e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x235a=['http','then','VoiceChanSpy,\x20%s,\x20%s','debug','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5e8206,_0x2422fd){var _0x539cc9=function(_0x2ffa2b){while(--_0x2ffa2b){_0x5e8206['push'](_0x5e8206['shift']());}};_0x539cc9(++_0x2422fd);}(_0x235a,0x1ef));var _0xa235=function(_0x474762,_0x18e98f){_0x474762=_0x474762-0x0;var _0x1ece9e=_0x235a[_0x474762];return _0x1ece9e;};'use strict';var _=require(_0xa235('0x0'));var util=require(_0xa235('0x1'));var moment=require(_0xa235('0x2'));var BPromise=require('bluebird');var rs=require(_0xa235('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa235('0x4'))['db'];var utils=require(_0xa235('0x5'));var logger=require(_0xa235('0x6'))(_0xa235('0x7'));var config=require(_0xa235('0x8'));var jayson=require(_0xa235('0x9'));var client=jayson[_0xa235('0xa')][_0xa235('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b849b,_0x2e535e,_0x2dc1ba){return new BPromise(function(_0x450e27,_0x2f3403){return client['request'](_0x4b849b,_0x2dc1ba)[_0xa235('0xc')](function(_0x561602){logger['info'](_0xa235('0xd'),_0x2e535e,'request\x20sent');logger[_0xa235('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x2e535e,'request\x20sent',JSON['stringify'](_0x561602));if(_0x561602[_0xa235('0xf')]){if(_0x561602[_0xa235('0xf')][_0xa235('0x10')]===0x1f4){logger[_0xa235('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x2e535e,_0x561602['error']['message']);return _0x2f3403(_0x561602[_0xa235('0xf')][_0xa235('0x11')]);}logger[_0xa235('0xf')](_0xa235('0xd'),_0x2e535e,_0x561602[_0xa235('0xf')][_0xa235('0x11')]);return _0x450e27(_0x561602[_0xa235('0xf')][_0xa235('0x11')]);}else{logger[_0xa235('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x2e535e,_0xa235('0x13'));_0x450e27(_0x561602[_0xa235('0x14')][_0xa235('0x11')]);}})[_0xa235('0x15')](function(_0x16dbe9){logger[_0xa235('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x2e535e,_0x16dbe9);_0x2f3403(_0x16dbe9);});});}
\ No newline at end of file
+var _0xad95=['VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','rpc','then'];(function(_0x44ee79,_0x41e740){var _0x362223=function(_0x25068a){while(--_0x25068a){_0x44ee79['push'](_0x44ee79['shift']());}};_0x362223(++_0x41e740);}(_0xad95,0x70));var _0x5ad9=function(_0x4e25b8,_0x2b4246){_0x4e25b8=_0x4e25b8-0x0;var _0x2a2955=_0xad95[_0x4e25b8];return _0x2a2955;};'use strict';var _=require(_0x5ad9('0x0'));var util=require(_0x5ad9('0x1'));var moment=require(_0x5ad9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ad9('0x3'));var db=require(_0x5ad9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5ad9('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bef4e,_0x117fde,_0x2a0915){return new BPromise(function(_0x3d937a,_0x404b33){return client['request'](_0x2bef4e,_0x2a0915)[_0x5ad9('0x6')](function(_0x4fdb7b){logger['info'](_0x5ad9('0x7'),_0x117fde,_0x5ad9('0x8'));logger[_0x5ad9('0x9')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x117fde,_0x5ad9('0x8'),JSON[_0x5ad9('0xa')](_0x4fdb7b));if(_0x4fdb7b['error']){if(_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xc')]===0x1f4){logger[_0x5ad9('0xb')](_0x5ad9('0x7'),_0x117fde,_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xd')]);return _0x404b33(_0x4fdb7b['error']['message']);}logger['error'](_0x5ad9('0x7'),_0x117fde,_0x4fdb7b[_0x5ad9('0xb')]['message']);return _0x3d937a(_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xd')]);}else{logger[_0x5ad9('0xe')](_0x5ad9('0x7'),_0x117fde,_0x5ad9('0x8'));_0x3d937a(_0x4fdb7b[_0x5ad9('0xf')][_0x5ad9('0xd')]);}})[_0x5ad9('0x10')](function(_0x36e61f){logger[_0x5ad9('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x117fde,_0x36e61f);_0x404b33(_0x36e61f);});});}
\ No newline at end of file
index 2bd8a9e..2b993df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1703=['../../components/auth/service','../../components/interaction/service','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0x1703,0x1ea));var _0x3170=function(_0x1301c9,_0x2d5285){_0x1301c9=_0x1301c9-0x0;var _0x355fe8=_0x1703[_0x1301c9];return _0x355fe8;};'use strict';var multer=require(_0x3170('0x0'));var util=require(_0x3170('0x1'));var path=require(_0x3170('0x2'));var timeout=require(_0x3170('0x3'));var express=require(_0x3170('0x4'));var router=express['Router']();var fs_extra=require(_0x3170('0x5'));var auth=require(_0x3170('0x6'));var interaction=require(_0x3170('0x7'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3170('0x8'),auth[_0x3170('0x9')](),controller['show']);router[_0x3170('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3170('0xb')](_0x3170('0x8'),auth[_0x3170('0x9')](),controller[_0x3170('0xc')]);router[_0x3170('0xd')]('/:id',auth[_0x3170('0x9')](),controller[_0x3170('0xe')]);module[_0x3170('0xf')]=router;
\ No newline at end of file
+var _0x2ae0=['index','get','/:id','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','isAuthenticated'];(function(_0x423752,_0x1d8a16){var _0x7a6765=function(_0xcd1d69){while(--_0xcd1d69){_0x423752['push'](_0x423752['shift']());}};_0x7a6765(++_0x1d8a16);}(_0x2ae0,0x1b9));var _0x02ae=function(_0x2a0377,_0x44da1c){_0x2a0377=_0x2a0377-0x0;var _0x1f1762=_0x2ae0[_0x2a0377];return _0x1f1762;};'use strict';var multer=require(_0x02ae('0x0'));var util=require(_0x02ae('0x1'));var path=require(_0x02ae('0x2'));var timeout=require('connect-timeout');var express=require(_0x02ae('0x3'));var router=express[_0x02ae('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x02ae('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x02ae('0x6'));var controller=require(_0x02ae('0x7'));router['get']('/',auth[_0x02ae('0x8')](),controller[_0x02ae('0x9')]);router[_0x02ae('0xa')](_0x02ae('0xb'),auth[_0x02ae('0x8')](),controller['show']);router[_0x02ae('0xc')]('/',auth[_0x02ae('0x8')](),controller[_0x02ae('0xd')]);router[_0x02ae('0xe')](_0x02ae('0xb'),auth[_0x02ae('0x8')](),controller[_0x02ae('0xf')]);router[_0x02ae('0x10')]('/:id',auth[_0x02ae('0x8')](),controller[_0x02ae('0x11')]);module['exports']=router;
\ No newline at end of file
index 5c1919f..aef002f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa416=['BOOLEAN','sequelize','STRING'];(function(_0x31133c,_0x3c8ff7){var _0x4937f9=function(_0x188d53){while(--_0x188d53){_0x31133c['push'](_0x31133c['shift']());}};_0x4937f9(++_0x3c8ff7);}(_0xa416,0x7c));var _0x6a41=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa416[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x6a41('0x0'));module['exports']={'name':{'type':Sequelize[_0x6a41('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x6a41('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x6a41('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3664=['sequelize','STRING','name','BOOLEAN'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x3664,0x6c));var _0x4366=function(_0x37c647,_0x394068){_0x37c647=_0x37c647-0x0;var _0xbacdec=_0x3664[_0x37c647];return _0xbacdec;};'use strict';var Sequelize=require(_0x4366('0x0'));module['exports']={'name':{'type':Sequelize[_0x4366('0x1')],'unique':_0x4366('0x2')},'description':{'type':Sequelize[_0x4366('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x4366('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index ccb3020..d330cc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc78e=['jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','Contexts','UserProfileResource','end','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','VoiceContext','includeAll','include','findAll','rows','params','intersection','fields','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x17fd26,_0x5618a3){var _0xcfe339=function(_0x11dccf){while(--_0x11dccf){_0x17fd26['push'](_0x17fd26['shift']());}};_0xcfe339(++_0x5618a3);}(_0xc78e,0x1d6));var _0xec78=function(_0x51a77c,_0x1a9b57){_0x51a77c=_0x51a77c-0x0;var _0xdbe423=_0xc78e[_0x51a77c];return _0xdbe423;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec78('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec78('0x1'));var rp=require(_0xec78('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xec78('0x3'));var util=require(_0xec78('0x4'));var path=require(_0xec78('0x5'));var sox=require('sox');var csv=require(_0xec78('0x6'));var ejs=require(_0xec78('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec78('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xec78('0x6'));var querystring=require(_0xec78('0x9'));var Papa=require(_0xec78('0xa'));var Redis=require(_0xec78('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xec78('0xc'));var as=require(_0xec78('0xd'));var hardwareService=require(_0xec78('0xe'));var logger=require(_0xec78('0xf'))(_0xec78('0x10'));var utils=require('../../config/utils');var config=require(_0xec78('0x11'));var licenseUtil=require(_0xec78('0x12'));var db=require(_0xec78('0x13'))['db'];var jayson=require(_0xec78('0x14'));var client=jayson[_0xec78('0x15')][_0xec78('0x16')]({'port':0x232a});function respondWithRpcPromise(_0xb5df0d,_0x5effa6,_0x5c4b67,_0x49a918){return new BPromise(function(_0x9a0233,_0x536558){var _0x3a7997=_0x49a918||client;return _0x3a7997[_0xec78('0x17')](_0xb5df0d,_0x5c4b67)['then'](function(_0x5a1d7c){logger[_0xec78('0x18')](_0xec78('0x19'),_0x5effa6,'request\x20sent');logger[_0xec78('0x1a')](_0xec78('0x1b'),_0x5effa6,_0xec78('0x1c'),JSON[_0xec78('0x1d')](_0x5a1d7c));if(_0x5a1d7c[_0xec78('0x1e')]){if(_0x5a1d7c[_0xec78('0x1e')][_0xec78('0x1f')]===0x1f4){logger[_0xec78('0x1e')](_0xec78('0x19'),_0x5effa6,_0x5a1d7c[_0xec78('0x1e')][_0xec78('0x20')]);return _0x536558(_0x5a1d7c[_0xec78('0x1e')][_0xec78('0x20')]);}logger['error'](_0xec78('0x19'),_0x5effa6,_0x5a1d7c['error'][_0xec78('0x20')]);return _0x9a0233(_0x5a1d7c['error'][_0xec78('0x20')]);}else{logger[_0xec78('0x18')](_0xec78('0x19'),_0x5effa6,_0xec78('0x1c'));_0x9a0233(_0x5a1d7c[_0xec78('0x21')][_0xec78('0x20')]);}})[_0xec78('0x22')](function(_0x20b526){logger[_0xec78('0x1e')](_0xec78('0x19'),_0x5effa6,_0x20b526);_0x536558(_0x20b526);});});}function respondWithStatusCode(_0x2bd317,_0x33b402){_0x33b402=_0x33b402||0xcc;return function(_0x504e9c){if(_0x504e9c){return _0x2bd317[_0xec78('0x23')](_0x33b402);}return _0x2bd317['status'](_0x33b402)['end']();};}function respondWithResult(_0x1eed95,_0x120e68){_0x120e68=_0x120e68||0xc8;return function(_0x71b592){if(_0x71b592){return _0x1eed95[_0xec78('0x24')](_0x120e68)[_0xec78('0x25')](_0x71b592);}};}function respondWithFilteredResult(_0x1f3f89,_0x124c6a){return function(_0x4f649d){if(_0x4f649d){var _0x3db8a4=typeof _0x124c6a[_0xec78('0x26')]===_0xec78('0x27')&&typeof _0x124c6a[_0xec78('0x28')]===_0xec78('0x27');var _0x2561b4=_0x4f649d[_0xec78('0x29')];var _0x10ab00=_0x3db8a4?0x0:_0x124c6a[_0xec78('0x26')];var _0x397e5c=_0x3db8a4?_0x4f649d[_0xec78('0x29')]:_0x124c6a[_0xec78('0x26')]+_0x124c6a[_0xec78('0x28')];var _0x192e7c;if(_0x397e5c>=_0x2561b4){_0x397e5c=_0x2561b4;_0x192e7c=0xc8;}else{_0x192e7c=0xce;}_0x1f3f89[_0xec78('0x24')](_0x192e7c);return _0x1f3f89['set'](_0xec78('0x2a'),_0x10ab00+'-'+_0x397e5c+'/'+_0x2561b4)[_0xec78('0x25')](_0x4f649d);}return null;};}function patchUpdates(_0x5dd330){return function(_0x2255ad){try{jsonpatch[_0xec78('0x2b')](_0x2255ad,_0x5dd330,!![]);}catch(_0x3f3dc7){return BPromise[_0xec78('0x2c')](_0x3f3dc7);}return _0x2255ad['save']();};}function saveUpdates(_0x10ee6a,_0x45c43f){return function(_0x1df7c9){if(_0x1df7c9){return _0x1df7c9[_0xec78('0x2d')](_0x10ee6a)[_0xec78('0x2e')](function(_0x51607e){return _0x51607e;});}return null;};}function removeEntity(_0x119aed,_0xd8a5da){return function(_0xac5ca5){if(_0xac5ca5){return _0xac5ca5[_0xec78('0x2f')]()[_0xec78('0x2e')](function(){var _0x17e71b=_0xac5ca5['get']({'plain':!![]});var _0x56a854=_0xec78('0x30');return db[_0xec78('0x31')][_0xec78('0x2f')]({'where':{'type':_0x56a854,'resourceId':_0x17e71b['id']}})[_0xec78('0x2e')](function(){return _0xac5ca5;});})[_0xec78('0x2e')](function(){_0x119aed[_0xec78('0x24')](0xcc)[_0xec78('0x32')]();});}};}function handleEntityNotFound(_0x4ec657,_0x30340b){return function(_0x47a779){if(!_0x47a779){_0x4ec657[_0xec78('0x23')](0x194);}return _0x47a779;};}function handleError(_0x14eb6b,_0x35b970){_0x35b970=_0x35b970||0x1f4;return function(_0x3c8256){logger[_0xec78('0x1e')](_0x3c8256['stack']);if(_0x3c8256[_0xec78('0x33')]){delete _0x3c8256['name'];}_0x14eb6b['status'](_0x35b970)[_0xec78('0x34')](_0x3c8256);};}exports['index']=function(_0x26f1c4,_0x100bcb){var _0x23f1fb={},_0x29da98={},_0x30db36={'count':0x0,'rows':[]};var _0x508a1e=_[_0xec78('0x35')](db['VoiceContext'][_0xec78('0x36')],function(_0x3147ce){return{'name':_0x3147ce[_0xec78('0x37')],'type':_0x3147ce[_0xec78('0x38')][_0xec78('0x39')]};});_0x29da98[_0xec78('0x3a')]=_[_0xec78('0x35')](_0x508a1e,_0xec78('0x33'));_0x29da98[_0xec78('0x3b')]=_[_0xec78('0x3c')](_0x26f1c4[_0xec78('0x3b')]);_0x29da98[_0xec78('0x3d')]=_['intersection'](_0x29da98[_0xec78('0x3a')],_0x29da98[_0xec78('0x3b')]);_0x23f1fb[_0xec78('0x3e')]=_['intersection'](_0x29da98[_0xec78('0x3a')],qs['fields'](_0x26f1c4[_0xec78('0x3b')]['fields']));_0x23f1fb['attributes']=_0x23f1fb[_0xec78('0x3e')][_0xec78('0x3f')]?_0x23f1fb[_0xec78('0x3e')]:_0x29da98[_0xec78('0x3a')];if(!_0x26f1c4[_0xec78('0x3b')][_0xec78('0x40')]('nolimit')){_0x23f1fb[_0xec78('0x28')]=qs['limit'](_0x26f1c4[_0xec78('0x3b')][_0xec78('0x28')]);_0x23f1fb[_0xec78('0x26')]=qs[_0xec78('0x26')](_0x26f1c4[_0xec78('0x3b')][_0xec78('0x26')]);}_0x23f1fb[_0xec78('0x41')]=qs[_0xec78('0x42')](_0x26f1c4[_0xec78('0x3b')][_0xec78('0x42')]);_0x23f1fb[_0xec78('0x43')]=qs[_0xec78('0x3d')](_['pick'](_0x26f1c4[_0xec78('0x3b')],_0x29da98[_0xec78('0x3d')]),_0x508a1e);if(_0x26f1c4[_0xec78('0x3b')][_0xec78('0x44')]){_0x23f1fb[_0xec78('0x43')]=_[_0xec78('0x45')](_0x23f1fb[_0xec78('0x43')],{'$or':_['map'](_0x508a1e,function(_0x457a6b){if(_0x457a6b[_0xec78('0x38')]!==_0xec78('0x46')){var _0x5be49b={};_0x5be49b[_0x457a6b['name']]={'$like':'%'+_0x26f1c4[_0xec78('0x3b')][_0xec78('0x44')]+'%'};return _0x5be49b;}})});}_0x23f1fb=_[_0xec78('0x45')]({},_0x23f1fb,_0x26f1c4['options']);var _0x33f603={'where':_0x23f1fb[_0xec78('0x43')]};return db[_0xec78('0x47')][_0xec78('0x29')](_0x33f603)[_0xec78('0x2e')](function(_0x2dfe2c){_0x30db36[_0xec78('0x29')]=_0x2dfe2c;if(_0x26f1c4[_0xec78('0x3b')][_0xec78('0x48')]){_0x23f1fb[_0xec78('0x49')]=[{'all':!![]}];}return db[_0xec78('0x47')][_0xec78('0x4a')](_0x23f1fb);})[_0xec78('0x2e')](function(_0x3ef4af){_0x30db36[_0xec78('0x4b')]=_0x3ef4af;return _0x30db36;})[_0xec78('0x2e')](respondWithFilteredResult(_0x100bcb,_0x23f1fb))['catch'](handleError(_0x100bcb,null));};exports['show']=function(_0x27d744,_0x23a191){var _0x3bc8fb={'raw':![],'where':{'id':_0x27d744[_0xec78('0x4c')]['id']}},_0x19fe7b={};_0x19fe7b[_0xec78('0x3a')]=_[_0xec78('0x3c')](db[_0xec78('0x47')][_0xec78('0x36')]);_0x19fe7b['query']=_[_0xec78('0x3c')](_0x27d744[_0xec78('0x3b')]);_0x19fe7b[_0xec78('0x3d')]=_[_0xec78('0x4d')](_0x19fe7b[_0xec78('0x3a')],_0x19fe7b[_0xec78('0x3b')]);_0x3bc8fb[_0xec78('0x3e')]=_['intersection'](_0x19fe7b[_0xec78('0x3a')],qs[_0xec78('0x4e')](_0x27d744[_0xec78('0x3b')][_0xec78('0x4e')]));_0x3bc8fb[_0xec78('0x3e')]=_0x3bc8fb[_0xec78('0x3e')][_0xec78('0x3f')]?_0x3bc8fb[_0xec78('0x3e')]:_0x19fe7b[_0xec78('0x3a')];if(_0x27d744[_0xec78('0x3b')][_0xec78('0x48')]){_0x3bc8fb[_0xec78('0x49')]=[{'all':!![]}];}_0x3bc8fb=_[_0xec78('0x45')]({},_0x3bc8fb,_0x27d744['options']);return db['VoiceContext'][_0xec78('0x4f')](_0x3bc8fb)[_0xec78('0x2e')](handleEntityNotFound(_0x23a191,null))[_0xec78('0x2e')](respondWithResult(_0x23a191,null))[_0xec78('0x22')](handleError(_0x23a191,null));};exports[_0xec78('0x50')]=function(_0x4ea4c8,_0xf5df62,_0x2b2406){var _0x4cfdfd;return db['VoiceContext'][_0xec78('0x50')](_0x4ea4c8[_0xec78('0x51')],{'raw':!![]})[_0xec78('0x2e')](function(_0x131711){_0x4cfdfd=_0x131711;return db['VoiceContext'][_0xec78('0x4a')]({'raw':!![]});})[_0xec78('0x2e')](function(_0x315feb){var _0x3b913d=fs[_0xec78('0x52')](path[_0xec78('0x53')](config[_0xec78('0x54')],_0xec78('0x55')),_0xec78('0x56'));var _0xf890b9=ejs[_0xec78('0x57')](_0x3b913d,{'contexts':_0x315feb||[]});fs[_0xec78('0x58')](_0xec78('0x59'),_0xf890b9);})[_0xec78('0x2e')](function(){return respondWithRpcPromise('Reload',_0xec78('0x50'),{'module':_0xec78('0x5a')});})[_0xec78('0x2e')](function(){var _0x44b94e=_0x4ea4c8[_0xec78('0x5b')][_0xec78('0x5c')]({'plain':!![]});if(!_0x44b94e)throw new Error(_0xec78('0x5d'));if(_0x44b94e[_0xec78('0x5e')]==='user'){var _0x594d32=_0x4cfdfd[_0xec78('0x5c')]({'plain':!![]});return db['UserProfileSection'][_0xec78('0x4f')]({'where':{'name':_0xec78('0x30'),'userProfileId':_0x44b94e['userProfileId']},'raw':!![]})[_0xec78('0x2e')](function(_0x11e329){if(_0x11e329&&_0x11e329[_0xec78('0x5f')]===0x0){return db[_0xec78('0x31')]['create']({'name':_0x594d32[_0xec78('0x33')],'resourceId':_0x594d32['id'],'type':_0x11e329[_0xec78('0x33')],'sectionId':_0x11e329['id']},{})[_0xec78('0x2e')](function(){return _0x4cfdfd;});}else{return _0x4cfdfd;}})[_0xec78('0x22')](function(_0x196c7f){logger['error'](_0xec78('0x60'),_0x196c7f);throw _0x196c7f;});}return _0x4cfdfd;})['then'](respondWithResult(_0xf5df62,0xc9))[_0xec78('0x22')](handleError(_0xf5df62,null));};exports[_0xec78('0x2d')]=function(_0x516c8e,_0x5d1291,_0x66e1f0){var _0x4a8519;return db[_0xec78('0x47')][_0xec78('0x4f')]({'where':{'id':_0x516c8e[_0xec78('0x4c')]['id']}})[_0xec78('0x2e')](handleEntityNotFound(_0x5d1291,null))[_0xec78('0x2e')](saveUpdates(_0x516c8e[_0xec78('0x51')],null))['then'](function(_0x5de0ce){if(_0x5de0ce){_0x4a8519=_0x5de0ce;return db[_0xec78('0x47')][_0xec78('0x4a')]({'raw':!![]});}})[_0xec78('0x2e')](function(_0x49074f){var _0xad17eb=fs[_0xec78('0x52')](path[_0xec78('0x53')](config[_0xec78('0x54')],_0xec78('0x55')),_0xec78('0x56'));var _0x15fb80=ejs[_0xec78('0x57')](_0xad17eb,{'contexts':_0x49074f||[]});fs[_0xec78('0x58')](_0xec78('0x59'),_0x15fb80);})[_0xec78('0x2e')](function(){return respondWithRpcPromise(_0xec78('0x61'),'update',{'module':'chan_sip.so'});})[_0xec78('0x2e')](function(){return _0x4a8519;})['then'](respondWithResult(_0x5d1291,null))[_0xec78('0x22')](handleError(_0x5d1291,null));};exports[_0xec78('0x2f')]=function(_0x2cd6c7,_0x326c64,_0x3d3735){var _0x1a37ef;return db[_0xec78('0x47')]['find']({'where':{'id':_0x2cd6c7[_0xec78('0x4c')]['id']}})['then'](handleEntityNotFound(_0x326c64,null))[_0xec78('0x2e')](removeEntity(_0x326c64,null))[_0xec78('0x2e')](function(){return db[_0xec78('0x47')]['findAll']({'raw':!![]});})['then'](function(_0x39bda4){var _0x4f1324=fs['readFileSync'](path['join'](config['root'],'server/files/templates/context.ejs'),_0xec78('0x56'));var _0x16022e=ejs[_0xec78('0x57')](_0x4f1324,{'contexts':_0x39bda4});fs['writeFileSync'](_0xec78('0x59'),_0x16022e);return respondWithRpcPromise('Reload',_0xec78('0x2f'),{'module':_0xec78('0x5a')});})[_0xec78('0x22')](handleError(_0x326c64,null));};
\ No newline at end of file
+var _0x8d82=['util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','end','status','json','offset','count','Content-Range','reject','save','get','UserProfileResource','destroy','sendStatus','stack','name','index','map','VoiceContext','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','create','body','readFileSync','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','join','server/files/templates/context.ejs','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x8d82,0xc8));var _0x28d8=function(_0x23faa0,_0x2569cd){_0x23faa0=_0x23faa0-0x0;var _0xba5f61=_0x8d82[_0x23faa0];return _0xba5f61;};'use strict';var emlformat=require(_0x28d8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x28d8('0x1'));var jsonpatch=require(_0x28d8('0x2'));var rp=require('request-promise');var moment=require(_0x28d8('0x3'));var BPromise=require(_0x28d8('0x4'));var Mustache=require(_0x28d8('0x5'));var util=require(_0x28d8('0x6'));var path=require('path');var sox=require(_0x28d8('0x7'));var csv=require(_0x28d8('0x8'));var ejs=require(_0x28d8('0x9'));var fs=require('fs');var fs_extra=require(_0x28d8('0xa'));var _=require(_0x28d8('0xb'));var squel=require(_0x28d8('0xc'));var crypto=require(_0x28d8('0xd'));var jsforce=require(_0x28d8('0xe'));var deskjs=require(_0x28d8('0xf'));var toCsv=require(_0x28d8('0x8'));var querystring=require(_0x28d8('0x10'));var Papa=require(_0x28d8('0x11'));var Redis=require(_0x28d8('0x12'));var authService=require(_0x28d8('0x13'));var qs=require(_0x28d8('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28d8('0x15'));var logger=require(_0x28d8('0x16'))('api');var utils=require(_0x28d8('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x28d8('0x18'));var db=require(_0x28d8('0x19'))['db'];var jayson=require(_0x28d8('0x1a'));var client=jayson[_0x28d8('0x1b')][_0x28d8('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x232867,_0x13c74a,_0x3abc43,_0x4fa88e){return new BPromise(function(_0x3f22c2,_0x475c21){var _0x5c1b18=_0x4fa88e||client;return _0x5c1b18[_0x28d8('0x1d')](_0x232867,_0x3abc43)[_0x28d8('0x1e')](function(_0x298a79){logger[_0x28d8('0x1f')](_0x28d8('0x20'),_0x13c74a,_0x28d8('0x21'));logger['debug'](_0x28d8('0x22'),_0x13c74a,_0x28d8('0x21'),JSON[_0x28d8('0x23')](_0x298a79));if(_0x298a79['error']){if(_0x298a79[_0x28d8('0x24')]['code']===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x13c74a,_0x298a79['error'][_0x28d8('0x25')]);return _0x475c21(_0x298a79['error'][_0x28d8('0x25')]);}logger[_0x28d8('0x24')]('VoiceContext,\x20%s,\x20%s',_0x13c74a,_0x298a79[_0x28d8('0x24')][_0x28d8('0x25')]);return _0x3f22c2(_0x298a79[_0x28d8('0x24')][_0x28d8('0x25')]);}else{logger[_0x28d8('0x1f')](_0x28d8('0x20'),_0x13c74a,_0x28d8('0x21'));_0x3f22c2(_0x298a79['result'][_0x28d8('0x25')]);}})[_0x28d8('0x26')](function(_0x1a498f){logger['error'](_0x28d8('0x20'),_0x13c74a,_0x1a498f);_0x475c21(_0x1a498f);});});}function respondWithStatusCode(_0x481d84,_0x30c8f3){_0x30c8f3=_0x30c8f3||0xcc;return function(_0x19310a){if(_0x19310a){return _0x481d84['sendStatus'](_0x30c8f3);}return _0x481d84['status'](_0x30c8f3)[_0x28d8('0x27')]();};}function respondWithResult(_0x5bbef4,_0x325a37){_0x325a37=_0x325a37||0xc8;return function(_0x129c10){if(_0x129c10){return _0x5bbef4[_0x28d8('0x28')](_0x325a37)[_0x28d8('0x29')](_0x129c10);}};}function respondWithFilteredResult(_0x172199,_0xf73633){return function(_0x2052ec){if(_0x2052ec){var _0x385411=typeof _0xf73633[_0x28d8('0x2a')]==='undefined'&&typeof _0xf73633['limit']==='undefined';var _0x5623a4=_0x2052ec[_0x28d8('0x2b')];var _0x129d58=_0x385411?0x0:_0xf73633['offset'];var _0x38403d=_0x385411?_0x2052ec[_0x28d8('0x2b')]:_0xf73633[_0x28d8('0x2a')]+_0xf73633['limit'];var _0x172b78;if(_0x38403d>=_0x5623a4){_0x38403d=_0x5623a4;_0x172b78=0xc8;}else{_0x172b78=0xce;}_0x172199[_0x28d8('0x28')](_0x172b78);return _0x172199['set'](_0x28d8('0x2c'),_0x129d58+'-'+_0x38403d+'/'+_0x5623a4)['json'](_0x2052ec);}return null;};}function patchUpdates(_0x4d66a2){return function(_0x351282){try{jsonpatch['apply'](_0x351282,_0x4d66a2,!![]);}catch(_0x39f96b){return BPromise[_0x28d8('0x2d')](_0x39f96b);}return _0x351282[_0x28d8('0x2e')]();};}function saveUpdates(_0x2c798c,_0x234c17){return function(_0x4db91b){if(_0x4db91b){return _0x4db91b['update'](_0x2c798c)[_0x28d8('0x1e')](function(_0x434771){return _0x434771;});}return null;};}function removeEntity(_0x18c278,_0x486381){return function(_0x336b8b){if(_0x336b8b){return _0x336b8b['destroy']()[_0x28d8('0x1e')](function(){var _0x8ed24f=_0x336b8b[_0x28d8('0x2f')]({'plain':!![]});var _0xdabf9='Contexts';return db[_0x28d8('0x30')][_0x28d8('0x31')]({'where':{'type':_0xdabf9,'resourceId':_0x8ed24f['id']}})[_0x28d8('0x1e')](function(){return _0x336b8b;});})[_0x28d8('0x1e')](function(){_0x18c278[_0x28d8('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14070c,_0x4f6fea){return function(_0x268a7c){if(!_0x268a7c){_0x14070c[_0x28d8('0x32')](0x194);}return _0x268a7c;};}function handleError(_0x1bef71,_0x1a43ad){_0x1a43ad=_0x1a43ad||0x1f4;return function(_0x22acd1){logger[_0x28d8('0x24')](_0x22acd1[_0x28d8('0x33')]);if(_0x22acd1[_0x28d8('0x34')]){delete _0x22acd1[_0x28d8('0x34')];}_0x1bef71[_0x28d8('0x28')](_0x1a43ad)['send'](_0x22acd1);};}exports[_0x28d8('0x35')]=function(_0xff2668,_0x5ddb3b){var _0xb0c80b={},_0x45290b={},_0x29a01a={'count':0x0,'rows':[]};var _0x406cc0=_[_0x28d8('0x36')](db[_0x28d8('0x37')][_0x28d8('0x38')],function(_0x1e1587){return{'name':_0x1e1587['fieldName'],'type':_0x1e1587[_0x28d8('0x39')][_0x28d8('0x3a')]};});_0x45290b[_0x28d8('0x3b')]=_[_0x28d8('0x36')](_0x406cc0,'name');_0x45290b['query']=_[_0x28d8('0x3c')](_0xff2668[_0x28d8('0x3d')]);_0x45290b[_0x28d8('0x3e')]=_[_0x28d8('0x3f')](_0x45290b['model'],_0x45290b['query']);_0xb0c80b['attributes']=_[_0x28d8('0x3f')](_0x45290b['model'],qs[_0x28d8('0x40')](_0xff2668[_0x28d8('0x3d')][_0x28d8('0x40')]));_0xb0c80b['attributes']=_0xb0c80b[_0x28d8('0x41')][_0x28d8('0x42')]?_0xb0c80b[_0x28d8('0x41')]:_0x45290b[_0x28d8('0x3b')];if(!_0xff2668['query'][_0x28d8('0x43')](_0x28d8('0x44'))){_0xb0c80b[_0x28d8('0x45')]=qs[_0x28d8('0x45')](_0xff2668['query'][_0x28d8('0x45')]);_0xb0c80b[_0x28d8('0x2a')]=qs['offset'](_0xff2668[_0x28d8('0x3d')][_0x28d8('0x2a')]);}_0xb0c80b[_0x28d8('0x46')]=qs['sort'](_0xff2668[_0x28d8('0x3d')][_0x28d8('0x47')]);_0xb0c80b[_0x28d8('0x48')]=qs[_0x28d8('0x3e')](_[_0x28d8('0x49')](_0xff2668[_0x28d8('0x3d')],_0x45290b[_0x28d8('0x3e')]),_0x406cc0);if(_0xff2668[_0x28d8('0x3d')][_0x28d8('0x4a')]){_0xb0c80b[_0x28d8('0x48')]=_['merge'](_0xb0c80b[_0x28d8('0x48')],{'$or':_[_0x28d8('0x36')](_0x406cc0,function(_0x4547bd){if(_0x4547bd[_0x28d8('0x39')]!==_0x28d8('0x4b')){var _0x3cd98={};_0x3cd98[_0x4547bd[_0x28d8('0x34')]]={'$like':'%'+_0xff2668[_0x28d8('0x3d')][_0x28d8('0x4a')]+'%'};return _0x3cd98;}})});}_0xb0c80b=_[_0x28d8('0x4c')]({},_0xb0c80b,_0xff2668[_0x28d8('0x4d')]);var _0x1debef={'where':_0xb0c80b['where']};return db[_0x28d8('0x37')][_0x28d8('0x2b')](_0x1debef)['then'](function(_0x5e4b61){_0x29a01a[_0x28d8('0x2b')]=_0x5e4b61;if(_0xff2668['query'][_0x28d8('0x4e')]){_0xb0c80b[_0x28d8('0x4f')]=[{'all':!![]}];}return db[_0x28d8('0x37')][_0x28d8('0x50')](_0xb0c80b);})[_0x28d8('0x1e')](function(_0x379039){_0x29a01a[_0x28d8('0x51')]=_0x379039;return _0x29a01a;})[_0x28d8('0x1e')](respondWithFilteredResult(_0x5ddb3b,_0xb0c80b))[_0x28d8('0x26')](handleError(_0x5ddb3b,null));};exports['show']=function(_0x4a941d,_0x24870f){var _0xeadda1={'raw':![],'where':{'id':_0x4a941d['params']['id']}},_0x2c5039={};_0x2c5039[_0x28d8('0x3b')]=_[_0x28d8('0x3c')](db[_0x28d8('0x37')]['rawAttributes']);_0x2c5039[_0x28d8('0x3d')]=_[_0x28d8('0x3c')](_0x4a941d['query']);_0x2c5039[_0x28d8('0x3e')]=_[_0x28d8('0x3f')](_0x2c5039[_0x28d8('0x3b')],_0x2c5039[_0x28d8('0x3d')]);_0xeadda1[_0x28d8('0x41')]=_[_0x28d8('0x3f')](_0x2c5039[_0x28d8('0x3b')],qs[_0x28d8('0x40')](_0x4a941d[_0x28d8('0x3d')]['fields']));_0xeadda1['attributes']=_0xeadda1[_0x28d8('0x41')][_0x28d8('0x42')]?_0xeadda1[_0x28d8('0x41')]:_0x2c5039['model'];if(_0x4a941d[_0x28d8('0x3d')][_0x28d8('0x4e')]){_0xeadda1[_0x28d8('0x4f')]=[{'all':!![]}];}_0xeadda1=_[_0x28d8('0x4c')]({},_0xeadda1,_0x4a941d[_0x28d8('0x4d')]);return db[_0x28d8('0x37')]['find'](_0xeadda1)['then'](handleEntityNotFound(_0x24870f,null))['then'](respondWithResult(_0x24870f,null))[_0x28d8('0x26')](handleError(_0x24870f,null));};exports['create']=function(_0x250d4f,_0xbfb5a0,_0x30c28e){var _0x351916;return db[_0x28d8('0x37')][_0x28d8('0x52')](_0x250d4f[_0x28d8('0x53')],{'raw':!![]})[_0x28d8('0x1e')](function(_0x4dfbc1){_0x351916=_0x4dfbc1;return db[_0x28d8('0x37')][_0x28d8('0x50')]({'raw':!![]});})[_0x28d8('0x1e')](function(_0x203dca){var _0x589ac2=fs[_0x28d8('0x54')](path['join'](config[_0x28d8('0x55')],'server/files/templates/context.ejs'),_0x28d8('0x56'));var _0x139441=ejs[_0x28d8('0x57')](_0x589ac2,{'contexts':_0x203dca||[]});fs[_0x28d8('0x58')](_0x28d8('0x59'),_0x139441);})['then'](function(){return respondWithRpcPromise(_0x28d8('0x5a'),_0x28d8('0x52'),{'module':_0x28d8('0x5b')});})[_0x28d8('0x1e')](function(){var _0x1a20fb=_0x250d4f[_0x28d8('0x5c')][_0x28d8('0x2f')]({'plain':!![]});if(!_0x1a20fb)throw new Error(_0x28d8('0x5d'));if(_0x1a20fb['role']===_0x28d8('0x5c')){var _0x3dea36=_0x351916[_0x28d8('0x2f')]({'plain':!![]});return db['UserProfileSection'][_0x28d8('0x5e')]({'where':{'name':_0x28d8('0x5f'),'userProfileId':_0x1a20fb[_0x28d8('0x60')]},'raw':!![]})[_0x28d8('0x1e')](function(_0x540a89){if(_0x540a89&&_0x540a89[_0x28d8('0x61')]===0x0){return db[_0x28d8('0x30')][_0x28d8('0x52')]({'name':_0x3dea36['name'],'resourceId':_0x3dea36['id'],'type':_0x540a89[_0x28d8('0x34')],'sectionId':_0x540a89['id']},{})['then'](function(){return _0x351916;});}else{return _0x351916;}})[_0x28d8('0x26')](function(_0x110b69){logger[_0x28d8('0x24')](_0x28d8('0x62'),_0x110b69);throw _0x110b69;});}return _0x351916;})['then'](respondWithResult(_0xbfb5a0,0xc9))[_0x28d8('0x26')](handleError(_0xbfb5a0,null));};exports[_0x28d8('0x63')]=function(_0x3e180e,_0x51c283,_0x517a94){var _0x42c2ed;return db[_0x28d8('0x37')][_0x28d8('0x5e')]({'where':{'id':_0x3e180e[_0x28d8('0x64')]['id']}})[_0x28d8('0x1e')](handleEntityNotFound(_0x51c283,null))[_0x28d8('0x1e')](saveUpdates(_0x3e180e[_0x28d8('0x53')],null))[_0x28d8('0x1e')](function(_0x5dda0b){if(_0x5dda0b){_0x42c2ed=_0x5dda0b;return db[_0x28d8('0x37')][_0x28d8('0x50')]({'raw':!![]});}})[_0x28d8('0x1e')](function(_0x5de4e9){var _0x38909b=fs['readFileSync'](path['join'](config[_0x28d8('0x55')],'server/files/templates/context.ejs'),_0x28d8('0x56'));var _0x5df58f=ejs['render'](_0x38909b,{'contexts':_0x5de4e9||[]});fs[_0x28d8('0x58')](_0x28d8('0x59'),_0x5df58f);})['then'](function(){return respondWithRpcPromise('Reload','update',{'module':_0x28d8('0x5b')});})[_0x28d8('0x1e')](function(){return _0x42c2ed;})[_0x28d8('0x1e')](respondWithResult(_0x51c283,null))[_0x28d8('0x26')](handleError(_0x51c283,null));};exports[_0x28d8('0x31')]=function(_0x1dee8d,_0x388be4,_0x492e0b){var _0x34b8cd;return db[_0x28d8('0x37')][_0x28d8('0x5e')]({'where':{'id':_0x1dee8d[_0x28d8('0x64')]['id']}})[_0x28d8('0x1e')](handleEntityNotFound(_0x388be4,null))[_0x28d8('0x1e')](removeEntity(_0x388be4,null))[_0x28d8('0x1e')](function(){return db['VoiceContext'][_0x28d8('0x50')]({'raw':!![]});})['then'](function(_0x968419){var _0x2a621c=fs['readFileSync'](path[_0x28d8('0x65')](config[_0x28d8('0x55')],_0x28d8('0x66')),'utf8');var _0x5d388f=ejs['render'](_0x2a621c,{'contexts':_0x968419});fs[_0x28d8('0x58')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x5d388f);return respondWithRpcPromise('Reload',_0x28d8('0x31'),{'module':'chan_sip.so'});})[_0x28d8('0x26')](handleError(_0x388be4,null));};
\ No newline at end of file
index 75ce2aa..a762f80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f18=['path','rimraf','./voiceContext.attributes','exports','define','voice_contexts','lodash','../../config/logger','moment','bluebird'];(function(_0x8c1253,_0x74df28){var _0x14123b=function(_0x3932a3){while(--_0x3932a3){_0x8c1253['push'](_0x8c1253['shift']());}};_0x14123b(++_0x74df28);}(_0x6f18,0x1b4));var _0x86f1=function(_0x2bc4dd,_0x9b5c70){_0x2bc4dd=_0x2bc4dd-0x0;var _0x294b2a=_0x6f18[_0x2bc4dd];return _0x294b2a;};'use strict';var _=require(_0x86f1('0x0'));var util=require('util');var logger=require(_0x86f1('0x1'))('api');var moment=require(_0x86f1('0x2'));var BPromise=require(_0x86f1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x86f1('0x4'));var rimraf=require(_0x86f1('0x5'));var config=require('../../config/environment');var attributes=require(_0x86f1('0x6'));module[_0x86f1('0x7')]=function(_0x3c91dc,_0x15a5e1){return _0x3c91dc[_0x86f1('0x8')]('VoiceContext',attributes,{'tableName':_0x86f1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x500b=['rimraf','../../config/environment','./voiceContext.attributes','exports','define','voice_contexts','util','../../config/logger','api','moment','bluebird','path'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x500b,0xa2));var _0xb500=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x500b[_0x187ee1];return _0x388160;};'use strict';var _=require('lodash');var util=require(_0xb500('0x0'));var logger=require(_0xb500('0x1'))(_0xb500('0x2'));var moment=require(_0xb500('0x3'));var BPromise=require(_0xb500('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb500('0x5'));var rimraf=require(_0xb500('0x6'));var config=require(_0xb500('0x7'));var attributes=require(_0xb500('0x8'));module[_0xb500('0x9')]=function(_0x374163,_0x3b709f){return _0x374163[_0xb500('0xa')]('VoiceContext',attributes,{'tableName':_0xb500('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 47da339..bbb8241 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8caf=['client','http','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x8caf[_0x1e3c16];return _0x47a0c9;};'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);});});}
\ No newline at end of file
+var _0x90d2=['../../config/environment','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x4c5d86,_0x5f22e2){var _0x10e6d6=function(_0x2dc1e1){while(--_0x2dc1e1){_0x4c5d86['push'](_0x4c5d86['shift']());}};_0x10e6d6(++_0x5f22e2);}(_0x90d2,0x86));var _0x290d=function(_0x3110ab,_0x5b6a7a){_0x3110ab=_0x3110ab-0x0;var _0x24c310=_0x90d2[_0x3110ab];return _0x24c310;};'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')]('VoiceContext,\x20%s,\x20%s',_0x4eeddf,_0x49c7d5);_0x2fe9f7(_0x49c7d5);});});}
\ No newline at end of file
index 63a6c23..6c3ed23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f3f=['./voiceDialReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x53f3ad,_0x39163e){var _0x48b203=function(_0x475ced){while(--_0x475ced){_0x53f3ad['push'](_0x53f3ad['shift']());}};_0x48b203(++_0x39163e);}(_0x6f3f,0x141));var _0xf6f3=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x6f3f[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0xf6f3('0x0'));var util=require(_0xf6f3('0x1'));var path=require(_0xf6f3('0x2'));var timeout=require(_0xf6f3('0x3'));var express=require(_0xf6f3('0x4'));var router=express[_0xf6f3('0x5')]();var fs_extra=require(_0xf6f3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf6f3('0x7'));var config=require(_0xf6f3('0x8'));var controller=require(_0xf6f3('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf6f3('0xa')]);router[_0xf6f3('0xb')](_0xf6f3('0xc'),auth['isAuthenticated'](),controller[_0xf6f3('0xd')]);router[_0xf6f3('0xb')](_0xf6f3('0xe'),auth[_0xf6f3('0xf')](),controller[_0xf6f3('0x10')]);router['post']('/',auth[_0xf6f3('0xf')](),controller['create']);router[_0xf6f3('0x11')](_0xf6f3('0xe'),auth['isAuthenticated'](),controller[_0xf6f3('0x12')]);router[_0xf6f3('0x13')](_0xf6f3('0xe'),auth['isAuthenticated'](),controller[_0xf6f3('0x14')]);module[_0xf6f3('0x15')]=router;
\ No newline at end of file
+var _0x3b51=['get','index','/describe','isAuthenticated','describe','/:id','post','put','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','./voiceDialReport.controller'];(function(_0x5ab970,_0x5b6dcf){var _0x3b6447=function(_0x3046d9){while(--_0x3046d9){_0x5ab970['push'](_0x5ab970['shift']());}};_0x3b6447(++_0x5b6dcf);}(_0x3b51,0x19a));var _0x13b5=function(_0x564878,_0x32b7db){_0x564878=_0x564878-0x0;var _0x26e2fb=_0x3b51[_0x564878];return _0x26e2fb;};'use strict';var multer=require('multer');var util=require(_0x13b5('0x0'));var path=require(_0x13b5('0x1'));var timeout=require(_0x13b5('0x2'));var express=require(_0x13b5('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x13b5('0x4'));var config=require('../../config/environment');var controller=require(_0x13b5('0x5'));router[_0x13b5('0x6')]('/',auth['isAuthenticated'](),controller[_0x13b5('0x7')]);router[_0x13b5('0x6')](_0x13b5('0x8'),auth[_0x13b5('0x9')](),controller[_0x13b5('0xa')]);router[_0x13b5('0x6')](_0x13b5('0xb'),auth[_0x13b5('0x9')](),controller['show']);router[_0x13b5('0xc')]('/',auth[_0x13b5('0x9')](),controller['create']);router[_0x13b5('0xd')](_0x13b5('0xb'),auth[_0x13b5('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x13b5('0xe')]);module[_0x13b5('0xf')]=router;
\ No newline at end of file
index 9fd30f5..05be9ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x31baee,_0x4ecc70){var _0x8fedca=function(_0x26ac5f){while(--_0x26ac5f){_0x31baee['push'](_0x31baee['shift']());}};_0x8fedca(++_0x4ecc70);}(_0x55ca,0x126));var _0xa55c=function(_0x28ef4e,_0x202aa3){_0x28ef4e=_0x28ef4e-0x0;var _0x1aa097=_0x55ca[_0x28ef4e];return _0x1aa097;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'calleridnum':{'type':Sequelize[_0xa55c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa55c('0x2')]},'connectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'language':{'type':Sequelize[_0xa55c('0x2')]},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'context':{'type':Sequelize[_0xa55c('0x2')]},'exten':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize[_0xa55c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xa55c('0x2')]},'destchannel':{'type':Sequelize[_0xa55c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'destlanguage':{'type':Sequelize[_0xa55c('0x2')]},'destaccountcode':{'type':Sequelize[_0xa55c('0x2')]},'destcontext':{'type':Sequelize[_0xa55c('0x2')]},'destexten':{'type':Sequelize[_0xa55c('0x2')]},'destpriority':{'type':Sequelize[_0xa55c('0x3')]},'destuniqueid':{'type':Sequelize[_0xa55c('0x2')]},'destlinkedid':{'type':Sequelize[_0xa55c('0x2')]},'dialstring':{'type':Sequelize[_0xa55c('0x2')]},'dialstatus':{'type':Sequelize[_0xa55c('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa55c('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xa55c('0x3')]},'holdtime':{'type':Sequelize[_0xa55c('0x3')]},'billableseconds':{'type':Sequelize[_0xa55c('0x3')]}};
\ No newline at end of file
+var _0xe5b3=['STRING','INTEGER','DATE','exports'];(function(_0x3dd60f,_0x4566bd){var _0x2cb70e=function(_0x43112b){while(--_0x43112b){_0x3dd60f['push'](_0x3dd60f['shift']());}};_0x2cb70e(++_0x4566bd);}(_0xe5b3,0x133));var _0x3e5b=function(_0x302b95,_0x182860){_0x302b95=_0x302b95-0x0;var _0x4c0419=_0xe5b3[_0x302b95];return _0x4c0419;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'privilege':{'type':Sequelize[_0x3e5b('0x1')]},'channel':{'type':Sequelize[_0x3e5b('0x1')]},'channelstate':{'type':Sequelize[_0x3e5b('0x2')]},'channelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'calleridnum':{'type':Sequelize[_0x3e5b('0x1')]},'calleridname':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'language':{'type':Sequelize[_0x3e5b('0x1')]},'accountcode':{'type':Sequelize[_0x3e5b('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3e5b('0x1')]},'priority':{'type':Sequelize[_0x3e5b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3e5b('0x1')]},'destchannel':{'type':Sequelize[_0x3e5b('0x1')]},'destchannelstate':{'type':Sequelize[_0x3e5b('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'destlanguage':{'type':Sequelize[_0x3e5b('0x1')]},'destaccountcode':{'type':Sequelize[_0x3e5b('0x1')]},'destcontext':{'type':Sequelize[_0x3e5b('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x3e5b('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x3e5b('0x1')]},'dialstring':{'type':Sequelize[_0x3e5b('0x1')]},'dialstatus':{'type':Sequelize[_0x3e5b('0x1')]},'starttime':{'type':Sequelize[_0x3e5b('0x3')]},'answertime':{'type':Sequelize[_0x3e5b('0x3')]},'endtime':{'type':Sequelize[_0x3e5b('0x3')]},'lastevent':{'type':Sequelize[_0x3e5b('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x3e5b('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index a009fc7..4a3b006 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b3e=['status','set','then','destroy','error','name','send','index','map','VoiceDialReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','limit','offset','count'];(function(_0x5a14d3,_0x389e09){var _0x2ebee2=function(_0x3ce30b){while(--_0x3ce30b){_0x5a14d3['push'](_0x5a14d3['shift']());}};_0x2ebee2(++_0x389e09);}(_0x6b3e,0x146));var _0xe6b3=function(_0x328f9b,_0x51e9b0){_0x328f9b=_0x328f9b-0x0;var _0x345ccd=_0x6b3e[_0x328f9b];return _0x345ccd;};'use strict';var emlformat=require(_0xe6b3('0x0'));var rimraf=require(_0xe6b3('0x1'));var zipdir=require(_0xe6b3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe6b3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe6b3('0x4'));var path=require('path');var sox=require(_0xe6b3('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe6b3('0x6'));var _=require(_0xe6b3('0x7'));var squel=require(_0xe6b3('0x8'));var crypto=require(_0xe6b3('0x9'));var jsforce=require(_0xe6b3('0xa'));var deskjs=require(_0xe6b3('0xb'));var toCsv=require(_0xe6b3('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe6b3('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xe6b3('0xe'));var as=require(_0xe6b3('0xf'));var hardwareService=require(_0xe6b3('0x10'));var logger=require(_0xe6b3('0x11'))(_0xe6b3('0x12'));var utils=require(_0xe6b3('0x13'));var config=require(_0xe6b3('0x14'));var licenseUtil=require(_0xe6b3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35b344,_0x3d4e94){_0x3d4e94=_0x3d4e94||0xcc;return function(_0x2866fe){if(_0x2866fe){return _0x35b344[_0xe6b3('0x16')](_0x3d4e94);}return _0x35b344['status'](_0x3d4e94)[_0xe6b3('0x17')]();};}function respondWithResult(_0x48c81b,_0x888b7d){_0x888b7d=_0x888b7d||0xc8;return function(_0x548744){if(_0x548744){return _0x48c81b['status'](_0x888b7d)[_0xe6b3('0x18')](_0x548744);}};}function respondWithFilteredResult(_0x494ad2,_0xc1eeb5){return function(_0x3026cc){if(_0x3026cc){var _0x1e390b=typeof _0xc1eeb5['offset']===_0xe6b3('0x19')&&typeof _0xc1eeb5[_0xe6b3('0x1a')]==='undefined';var _0x166768=_0x3026cc['count'];var _0x1d5e9c=_0x1e390b?0x0:_0xc1eeb5[_0xe6b3('0x1b')];var _0x2ce4cd=_0x1e390b?_0x3026cc[_0xe6b3('0x1c')]:_0xc1eeb5[_0xe6b3('0x1b')]+_0xc1eeb5[_0xe6b3('0x1a')];var _0x4de75b;if(_0x2ce4cd>=_0x166768){_0x2ce4cd=_0x166768;_0x4de75b=0xc8;}else{_0x4de75b=0xce;}_0x494ad2[_0xe6b3('0x1d')](_0x4de75b);return _0x494ad2[_0xe6b3('0x1e')]('Content-Range',_0x1d5e9c+'-'+_0x2ce4cd+'/'+_0x166768)[_0xe6b3('0x18')](_0x3026cc);}return null;};}function patchUpdates(_0x51e620){return function(_0x1a76b5){try{jsonpatch['apply'](_0x1a76b5,_0x51e620,!![]);}catch(_0x11c5d6){return BPromise['reject'](_0x11c5d6);}return _0x1a76b5['save']();};}function saveUpdates(_0x5879cc,_0x58ce3f){return function(_0x543b89){if(_0x543b89){return _0x543b89['update'](_0x5879cc)[_0xe6b3('0x1f')](function(_0x3bc465){return _0x3bc465;});}return null;};}function removeEntity(_0xb83fa7,_0x50e2a6){return function(_0x56c71f){if(_0x56c71f){return _0x56c71f[_0xe6b3('0x20')]()['then'](function(){_0xb83fa7['status'](0xcc)[_0xe6b3('0x17')]();});}};}function handleEntityNotFound(_0x1275e8,_0x33f262){return function(_0x2abbf7){if(!_0x2abbf7){_0x1275e8[_0xe6b3('0x16')](0x194);}return _0x2abbf7;};}function handleError(_0x21919a,_0x54172f){_0x54172f=_0x54172f||0x1f4;return function(_0x4ae832){logger[_0xe6b3('0x21')](_0x4ae832['stack']);if(_0x4ae832[_0xe6b3('0x22')]){delete _0x4ae832[_0xe6b3('0x22')];}_0x21919a[_0xe6b3('0x1d')](_0x54172f)[_0xe6b3('0x23')](_0x4ae832);};}exports[_0xe6b3('0x24')]=function(_0xfd6189,_0x350164){var _0x11b8f2={},_0x296162={},_0x4e5d8a={'count':0x0,'rows':[]};var _0x4b377a=_[_0xe6b3('0x25')](db[_0xe6b3('0x26')]['rawAttributes'],function(_0xb5441a){return{'name':_0xb5441a[_0xe6b3('0x27')],'type':_0xb5441a[_0xe6b3('0x28')][_0xe6b3('0x29')]};});_0x296162[_0xe6b3('0x2a')]=_[_0xe6b3('0x25')](_0x4b377a,_0xe6b3('0x22'));_0x296162[_0xe6b3('0x2b')]=_[_0xe6b3('0x2c')](_0xfd6189[_0xe6b3('0x2b')]);_0x296162[_0xe6b3('0x2d')]=_[_0xe6b3('0x2e')](_0x296162['model'],_0x296162[_0xe6b3('0x2b')]);_0x11b8f2[_0xe6b3('0x2f')]=_[_0xe6b3('0x2e')](_0x296162[_0xe6b3('0x2a')],qs[_0xe6b3('0x30')](_0xfd6189[_0xe6b3('0x2b')][_0xe6b3('0x30')]));_0x11b8f2[_0xe6b3('0x2f')]=_0x11b8f2[_0xe6b3('0x2f')][_0xe6b3('0x31')]?_0x11b8f2[_0xe6b3('0x2f')]:_0x296162[_0xe6b3('0x2a')];if(!_0xfd6189[_0xe6b3('0x2b')][_0xe6b3('0x32')](_0xe6b3('0x33'))){_0x11b8f2[_0xe6b3('0x1a')]=qs[_0xe6b3('0x1a')](_0xfd6189[_0xe6b3('0x2b')]['limit']);_0x11b8f2['offset']=qs[_0xe6b3('0x1b')](_0xfd6189['query'][_0xe6b3('0x1b')]);}_0x11b8f2[_0xe6b3('0x34')]=qs[_0xe6b3('0x35')](_0xfd6189[_0xe6b3('0x2b')][_0xe6b3('0x35')]);_0x11b8f2[_0xe6b3('0x36')]=qs[_0xe6b3('0x2d')](_[_0xe6b3('0x37')](_0xfd6189['query'],_0x296162[_0xe6b3('0x2d')]),_0x4b377a);if(_0xfd6189[_0xe6b3('0x2b')][_0xe6b3('0x38')]){_0x11b8f2[_0xe6b3('0x36')]=_['merge'](_0x11b8f2['where'],{'$or':_['map'](_0x4b377a,function(_0x44caea){if(_0x44caea[_0xe6b3('0x28')]!=='VIRTUAL'){var _0x3be97f={};_0x3be97f[_0x44caea[_0xe6b3('0x22')]]={'$like':'%'+_0xfd6189[_0xe6b3('0x2b')][_0xe6b3('0x38')]+'%'};return _0x3be97f;}})});}_0x11b8f2=_[_0xe6b3('0x39')]({},_0x11b8f2,_0xfd6189[_0xe6b3('0x3a')]);var _0x31a6b4={'where':_0x11b8f2[_0xe6b3('0x36')]};return db['VoiceDialReport']['count'](_0x31a6b4)[_0xe6b3('0x1f')](function(_0x25940f){_0x4e5d8a[_0xe6b3('0x1c')]=_0x25940f;if(_0xfd6189['query'][_0xe6b3('0x3b')]){_0x11b8f2['include']=[{'all':!![]}];}return db[_0xe6b3('0x26')][_0xe6b3('0x3c')](_0x11b8f2);})[_0xe6b3('0x1f')](function(_0x5bae4a){_0x4e5d8a[_0xe6b3('0x3d')]=_0x5bae4a;return _0x4e5d8a;})[_0xe6b3('0x1f')](respondWithFilteredResult(_0x350164,_0x11b8f2))[_0xe6b3('0x3e')](handleError(_0x350164,null));};exports[_0xe6b3('0x3f')]=function(_0x5ddf81,_0x2763cd){var _0x3f2983={'raw':!![],'where':{'id':_0x5ddf81[_0xe6b3('0x40')]['id']}},_0x23724a={};_0x23724a[_0xe6b3('0x2a')]=_['keys'](db[_0xe6b3('0x26')][_0xe6b3('0x41')]);_0x23724a[_0xe6b3('0x2b')]=_[_0xe6b3('0x2c')](_0x5ddf81[_0xe6b3('0x2b')]);_0x23724a[_0xe6b3('0x2d')]=_[_0xe6b3('0x2e')](_0x23724a[_0xe6b3('0x2a')],_0x23724a[_0xe6b3('0x2b')]);_0x3f2983['attributes']=_[_0xe6b3('0x2e')](_0x23724a['model'],qs[_0xe6b3('0x30')](_0x5ddf81['query'][_0xe6b3('0x30')]));_0x3f2983[_0xe6b3('0x2f')]=_0x3f2983[_0xe6b3('0x2f')][_0xe6b3('0x31')]?_0x3f2983[_0xe6b3('0x2f')]:_0x23724a[_0xe6b3('0x2a')];if(_0x5ddf81[_0xe6b3('0x2b')]['includeAll']){_0x3f2983['include']=[{'all':!![]}];}_0x3f2983=_[_0xe6b3('0x39')]({},_0x3f2983,_0x5ddf81[_0xe6b3('0x3a')]);return db[_0xe6b3('0x26')][_0xe6b3('0x42')](_0x3f2983)['then'](handleEntityNotFound(_0x2763cd,null))[_0xe6b3('0x1f')](respondWithResult(_0x2763cd,null))[_0xe6b3('0x3e')](handleError(_0x2763cd,null));};exports[_0xe6b3('0x43')]=function(_0x523f84,_0x1c9613){return db[_0xe6b3('0x26')]['create'](_0x523f84[_0xe6b3('0x44')],{})[_0xe6b3('0x1f')](respondWithResult(_0x1c9613,0xc9))['catch'](handleError(_0x1c9613,null));};exports[_0xe6b3('0x45')]=function(_0x187537,_0x5749ee){if(_0x187537[_0xe6b3('0x44')]['id']){delete _0x187537[_0xe6b3('0x44')]['id'];}return db[_0xe6b3('0x26')][_0xe6b3('0x42')]({'where':{'id':_0x187537[_0xe6b3('0x40')]['id']}})[_0xe6b3('0x1f')](handleEntityNotFound(_0x5749ee,null))[_0xe6b3('0x1f')](saveUpdates(_0x187537['body'],null))[_0xe6b3('0x1f')](respondWithResult(_0x5749ee,null))[_0xe6b3('0x3e')](handleError(_0x5749ee,null));};exports[_0xe6b3('0x20')]=function(_0x2cc71d,_0x16d969){return db[_0xe6b3('0x26')]['find']({'where':{'id':_0x2cc71d[_0xe6b3('0x40')]['id']}})['then'](handleEntityNotFound(_0x16d969,null))['then'](removeEntity(_0x16d969,null))[_0xe6b3('0x3e')](handleError(_0x16d969,null));};exports[_0xe6b3('0x46')]=function(_0x418ead,_0x3172ba){return db[_0xe6b3('0x26')][_0xe6b3('0x46')]()[_0xe6b3('0x1f')](respondWithResult(_0x3172ba,null))['catch'](handleError(_0x3172ba,null));};
\ No newline at end of file
+var _0xe329=['reject','save','update','then','destroy','end','error','stack','name','index','map','VoiceDialReport','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply'];(function(_0x3f839f,_0x105f92){var _0x461295=function(_0x4a1f5c){while(--_0x4a1f5c){_0x3f839f['push'](_0x3f839f['shift']());}};_0x461295(++_0x105f92);}(_0xe329,0x155));var _0x9e32=function(_0x21c633,_0x4d509e){_0x21c633=_0x21c633-0x0;var _0x3c6e74=_0xe329[_0x21c633];return _0x3c6e74;};'use strict';var emlformat=require(_0x9e32('0x0'));var rimraf=require(_0x9e32('0x1'));var zipdir=require(_0x9e32('0x2'));var jsonpatch=require(_0x9e32('0x3'));var rp=require(_0x9e32('0x4'));var moment=require(_0x9e32('0x5'));var BPromise=require(_0x9e32('0x6'));var Mustache=require('mustache');var util=require(_0x9e32('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9e32('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e32('0x9'));var _=require(_0x9e32('0xa'));var squel=require(_0x9e32('0xb'));var crypto=require(_0x9e32('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9e32('0xd'));var Papa=require(_0x9e32('0xe'));var Redis=require(_0x9e32('0xf'));var authService=require(_0x9e32('0x10'));var qs=require(_0x9e32('0x11'));var as=require(_0x9e32('0x12'));var hardwareService=require(_0x9e32('0x13'));var logger=require('../../config/logger')(_0x9e32('0x14'));var utils=require(_0x9e32('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9e32('0x16'));var db=require(_0x9e32('0x17'))['db'];function respondWithStatusCode(_0x4f73f1,_0xdab32e){_0xdab32e=_0xdab32e||0xcc;return function(_0x579e4d){if(_0x579e4d){return _0x4f73f1[_0x9e32('0x18')](_0xdab32e);}return _0x4f73f1['status'](_0xdab32e)['end']();};}function respondWithResult(_0x20c23c,_0x141999){_0x141999=_0x141999||0xc8;return function(_0x5cf078){if(_0x5cf078){return _0x20c23c['status'](_0x141999)[_0x9e32('0x19')](_0x5cf078);}};}function respondWithFilteredResult(_0x55ae8c,_0x1f2df3){return function(_0x21abd1){if(_0x21abd1){var _0x4344de=typeof _0x1f2df3[_0x9e32('0x1a')]===_0x9e32('0x1b')&&typeof _0x1f2df3[_0x9e32('0x1c')]==='undefined';var _0x1c7720=_0x21abd1[_0x9e32('0x1d')];var _0x54210b=_0x4344de?0x0:_0x1f2df3[_0x9e32('0x1a')];var _0x45d01b=_0x4344de?_0x21abd1[_0x9e32('0x1d')]:_0x1f2df3[_0x9e32('0x1a')]+_0x1f2df3['limit'];var _0x4a50de;if(_0x45d01b>=_0x1c7720){_0x45d01b=_0x1c7720;_0x4a50de=0xc8;}else{_0x4a50de=0xce;}_0x55ae8c[_0x9e32('0x1e')](_0x4a50de);return _0x55ae8c[_0x9e32('0x1f')](_0x9e32('0x20'),_0x54210b+'-'+_0x45d01b+'/'+_0x1c7720)[_0x9e32('0x19')](_0x21abd1);}return null;};}function patchUpdates(_0x1f460e){return function(_0xb444e1){try{jsonpatch[_0x9e32('0x21')](_0xb444e1,_0x1f460e,!![]);}catch(_0x3473c1){return BPromise[_0x9e32('0x22')](_0x3473c1);}return _0xb444e1[_0x9e32('0x23')]();};}function saveUpdates(_0x19eeee,_0x43bde0){return function(_0x463cce){if(_0x463cce){return _0x463cce[_0x9e32('0x24')](_0x19eeee)[_0x9e32('0x25')](function(_0x47ed99){return _0x47ed99;});}return null;};}function removeEntity(_0x1fbafa,_0x4c6e88){return function(_0x5550a8){if(_0x5550a8){return _0x5550a8[_0x9e32('0x26')]()[_0x9e32('0x25')](function(){_0x1fbafa[_0x9e32('0x1e')](0xcc)[_0x9e32('0x27')]();});}};}function handleEntityNotFound(_0x3657c3,_0x4b93d6){return function(_0x4d4638){if(!_0x4d4638){_0x3657c3['sendStatus'](0x194);}return _0x4d4638;};}function handleError(_0x35572d,_0x2f5885){_0x2f5885=_0x2f5885||0x1f4;return function(_0x553152){logger[_0x9e32('0x28')](_0x553152[_0x9e32('0x29')]);if(_0x553152[_0x9e32('0x2a')]){delete _0x553152[_0x9e32('0x2a')];}_0x35572d[_0x9e32('0x1e')](_0x2f5885)['send'](_0x553152);};}exports[_0x9e32('0x2b')]=function(_0x153b5d,_0x4729c9){var _0x59f2bf={},_0x4fca71={},_0x495d99={'count':0x0,'rows':[]};var _0xd9cfc1=_[_0x9e32('0x2c')](db[_0x9e32('0x2d')]['rawAttributes'],function(_0x1ac62f){return{'name':_0x1ac62f[_0x9e32('0x2e')],'type':_0x1ac62f[_0x9e32('0x2f')]['key']};});_0x4fca71[_0x9e32('0x30')]=_[_0x9e32('0x2c')](_0xd9cfc1,_0x9e32('0x2a'));_0x4fca71[_0x9e32('0x31')]=_['keys'](_0x153b5d['query']);_0x4fca71[_0x9e32('0x32')]=_['intersection'](_0x4fca71[_0x9e32('0x30')],_0x4fca71[_0x9e32('0x31')]);_0x59f2bf[_0x9e32('0x33')]=_[_0x9e32('0x34')](_0x4fca71[_0x9e32('0x30')],qs[_0x9e32('0x35')](_0x153b5d[_0x9e32('0x31')]['fields']));_0x59f2bf[_0x9e32('0x33')]=_0x59f2bf[_0x9e32('0x33')][_0x9e32('0x36')]?_0x59f2bf['attributes']:_0x4fca71['model'];if(!_0x153b5d['query'][_0x9e32('0x37')](_0x9e32('0x38'))){_0x59f2bf[_0x9e32('0x1c')]=qs[_0x9e32('0x1c')](_0x153b5d[_0x9e32('0x31')][_0x9e32('0x1c')]);_0x59f2bf[_0x9e32('0x1a')]=qs[_0x9e32('0x1a')](_0x153b5d[_0x9e32('0x31')][_0x9e32('0x1a')]);}_0x59f2bf['order']=qs[_0x9e32('0x39')](_0x153b5d['query'][_0x9e32('0x39')]);_0x59f2bf[_0x9e32('0x3a')]=qs[_0x9e32('0x32')](_[_0x9e32('0x3b')](_0x153b5d[_0x9e32('0x31')],_0x4fca71[_0x9e32('0x32')]),_0xd9cfc1);if(_0x153b5d[_0x9e32('0x31')][_0x9e32('0x3c')]){_0x59f2bf[_0x9e32('0x3a')]=_['merge'](_0x59f2bf[_0x9e32('0x3a')],{'$or':_[_0x9e32('0x2c')](_0xd9cfc1,function(_0x412390){if(_0x412390['type']!==_0x9e32('0x3d')){var _0x117ea2={};_0x117ea2[_0x412390['name']]={'$like':'%'+_0x153b5d['query'][_0x9e32('0x3c')]+'%'};return _0x117ea2;}})});}_0x59f2bf=_['merge']({},_0x59f2bf,_0x153b5d[_0x9e32('0x3e')]);var _0x1233bc={'where':_0x59f2bf['where']};return db[_0x9e32('0x2d')][_0x9e32('0x1d')](_0x1233bc)[_0x9e32('0x25')](function(_0x195d30){_0x495d99['count']=_0x195d30;if(_0x153b5d['query'][_0x9e32('0x3f')]){_0x59f2bf['include']=[{'all':!![]}];}return db[_0x9e32('0x2d')][_0x9e32('0x40')](_0x59f2bf);})['then'](function(_0x38d641){_0x495d99[_0x9e32('0x41')]=_0x38d641;return _0x495d99;})[_0x9e32('0x25')](respondWithFilteredResult(_0x4729c9,_0x59f2bf))[_0x9e32('0x42')](handleError(_0x4729c9,null));};exports['show']=function(_0x31e30b,_0x54b551){var _0x1024c0={'raw':!![],'where':{'id':_0x31e30b[_0x9e32('0x43')]['id']}},_0x1d2b06={};_0x1d2b06[_0x9e32('0x30')]=_[_0x9e32('0x44')](db[_0x9e32('0x2d')][_0x9e32('0x45')]);_0x1d2b06[_0x9e32('0x31')]=_['keys'](_0x31e30b['query']);_0x1d2b06['filters']=_['intersection'](_0x1d2b06['model'],_0x1d2b06[_0x9e32('0x31')]);_0x1024c0[_0x9e32('0x33')]=_['intersection'](_0x1d2b06[_0x9e32('0x30')],qs[_0x9e32('0x35')](_0x31e30b[_0x9e32('0x31')]['fields']));_0x1024c0[_0x9e32('0x33')]=_0x1024c0['attributes'][_0x9e32('0x36')]?_0x1024c0[_0x9e32('0x33')]:_0x1d2b06[_0x9e32('0x30')];if(_0x31e30b['query'][_0x9e32('0x3f')]){_0x1024c0['include']=[{'all':!![]}];}_0x1024c0=_[_0x9e32('0x46')]({},_0x1024c0,_0x31e30b[_0x9e32('0x3e')]);return db['VoiceDialReport'][_0x9e32('0x47')](_0x1024c0)[_0x9e32('0x25')](handleEntityNotFound(_0x54b551,null))[_0x9e32('0x25')](respondWithResult(_0x54b551,null))[_0x9e32('0x42')](handleError(_0x54b551,null));};exports['create']=function(_0xac599d,_0x3584fb){return db[_0x9e32('0x2d')][_0x9e32('0x48')](_0xac599d[_0x9e32('0x49')],{})[_0x9e32('0x25')](respondWithResult(_0x3584fb,0xc9))[_0x9e32('0x42')](handleError(_0x3584fb,null));};exports[_0x9e32('0x24')]=function(_0x102cfe,_0x3e66b9){if(_0x102cfe[_0x9e32('0x49')]['id']){delete _0x102cfe[_0x9e32('0x49')]['id'];}return db[_0x9e32('0x2d')][_0x9e32('0x47')]({'where':{'id':_0x102cfe[_0x9e32('0x43')]['id']}})[_0x9e32('0x25')](handleEntityNotFound(_0x3e66b9,null))[_0x9e32('0x25')](saveUpdates(_0x102cfe[_0x9e32('0x49')],null))[_0x9e32('0x25')](respondWithResult(_0x3e66b9,null))[_0x9e32('0x42')](handleError(_0x3e66b9,null));};exports[_0x9e32('0x26')]=function(_0x944ae2,_0x501b1c){return db[_0x9e32('0x2d')][_0x9e32('0x47')]({'where':{'id':_0x944ae2[_0x9e32('0x43')]['id']}})[_0x9e32('0x25')](handleEntityNotFound(_0x501b1c,null))['then'](removeEntity(_0x501b1c,null))['catch'](handleError(_0x501b1c,null));};exports['describe']=function(_0xbaf400,_0x4d5343){return db[_0x9e32('0x2d')][_0x9e32('0x4a')]()[_0x9e32('0x25')](respondWithResult(_0x4d5343,null))[_0x9e32('0x42')](handleError(_0x4d5343,null));};
\ No newline at end of file
index f2e50c4..987965a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf963=['report_dial','lodash','util','../../config/logger','api','request-promise','path','rimraf','./voiceDialReport.attributes','define','VoiceDialReport'];(function(_0x482a1c,_0xcecccf){var _0x2dab39=function(_0x314535){while(--_0x314535){_0x482a1c['push'](_0x482a1c['shift']());}};_0x2dab39(++_0xcecccf);}(_0xf963,0x11f));var _0x3f96=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf963[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x3f96('0x0'));var util=require(_0x3f96('0x1'));var logger=require(_0x3f96('0x2'))(_0x3f96('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3f96('0x4'));var fs=require('fs');var path=require(_0x3f96('0x5'));var rimraf=require(_0x3f96('0x6'));var config=require('../../config/environment');var attributes=require(_0x3f96('0x7'));module['exports']=function(_0x5dbaa0,_0x505ca5){return _0x5dbaa0[_0x3f96('0x8')](_0x3f96('0x9'),attributes,{'tableName':_0x3f96('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9787=['bluebird','request-promise','path','rimraf','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0x9787,0x122));var _0x7978=function(_0x233716,_0x346676){_0x233716=_0x233716-0x0;var _0x302298=_0x9787[_0x233716];return _0x302298;};'use strict';var _=require(_0x7978('0x0'));var util=require(_0x7978('0x1'));var logger=require(_0x7978('0x2'))(_0x7978('0x3'));var moment=require('moment');var BPromise=require(_0x7978('0x4'));var rp=require(_0x7978('0x5'));var fs=require('fs');var path=require(_0x7978('0x6'));var rimraf=require(_0x7978('0x7'));var config=require('../../config/environment');var attributes=require(_0x7978('0x8'));module[_0x7978('0x9')]=function(_0x5b9468,_0x46f605){return _0x5b9468[_0x7978('0xa')](_0x7978('0xb'),attributes,{'tableName':_0x7978('0xc'),'paranoid':![],'indexes':[{'fields':[_0x7978('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index dbdb446..ae85775 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ebb=['info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then'];(function(_0x2ec43c,_0x3f0e4e){var _0x202334=function(_0xd6890c){while(--_0xd6890c){_0x2ec43c['push'](_0x2ec43c['shift']());}};_0x202334(++_0x3f0e4e);}(_0x2ebb,0xd4));var _0xb2eb=function(_0x4ede4c,_0x5423e9){_0x4ede4c=_0x4ede4c-0x0;var _0x48a2dd=_0x2ebb[_0x4ede4c];return _0x48a2dd;};'use strict';var _=require(_0xb2eb('0x0'));var util=require(_0xb2eb('0x1'));var moment=require('moment');var BPromise=require(_0xb2eb('0x2'));var rs=require(_0xb2eb('0x3'));var fs=require('fs');var Redis=require(_0xb2eb('0x4'));var db=require(_0xb2eb('0x5'))['db'];var utils=require(_0xb2eb('0x6'));var logger=require('../../config/logger')(_0xb2eb('0x7'));var config=require('../../config/environment');var jayson=require(_0xb2eb('0x8'));var client=jayson['client'][_0xb2eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24ed57,_0x5e6344,_0x32101e){return new BPromise(function(_0x481a22,_0xf6e22b){return client[_0xb2eb('0xa')](_0x24ed57,_0x32101e)[_0xb2eb('0xb')](function(_0x308ca4){logger[_0xb2eb('0xc')](_0xb2eb('0xd'),_0x5e6344,_0xb2eb('0xe'));logger[_0xb2eb('0xf')](_0xb2eb('0x10'),_0x5e6344,_0xb2eb('0xe'),JSON[_0xb2eb('0x11')](_0x308ca4));if(_0x308ca4['error']){if(_0x308ca4[_0xb2eb('0x12')][_0xb2eb('0x13')]===0x1f4){logger[_0xb2eb('0x12')](_0xb2eb('0xd'),_0x5e6344,_0x308ca4['error'][_0xb2eb('0x14')]);return _0xf6e22b(_0x308ca4[_0xb2eb('0x12')][_0xb2eb('0x14')]);}logger[_0xb2eb('0x12')](_0xb2eb('0xd'),_0x5e6344,_0x308ca4[_0xb2eb('0x12')][_0xb2eb('0x14')]);return _0x481a22(_0x308ca4[_0xb2eb('0x12')][_0xb2eb('0x14')]);}else{logger[_0xb2eb('0xc')](_0xb2eb('0xd'),_0x5e6344,'request\x20sent');_0x481a22(_0x308ca4[_0xb2eb('0x15')][_0xb2eb('0x14')]);}})[_0xb2eb('0x16')](function(_0x15f4bd){logger[_0xb2eb('0x12')](_0xb2eb('0xd'),_0x5e6344,_0x15f4bd);_0xf6e22b(_0x15f4bd);});});}exports[_0xb2eb('0x17')]=function(_0x2a7362){var _0x4a7587=this;return new Promise(function(_0x56e214,_0x2cc877){return db[_0xb2eb('0x18')][_0xb2eb('0x19')](_0x2a7362[_0xb2eb('0x1a')],{'raw':_0x2a7362[_0xb2eb('0x1b')]?_0x2a7362['options'][_0xb2eb('0x1c')]===undefined?!![]:![]:!![]})[_0xb2eb('0xb')](function(_0x4f2401){logger[_0xb2eb('0xc')](_0xb2eb('0x17'),_0x2a7362);logger[_0xb2eb('0xf')]('CreateVoiceDialReport',_0x2a7362,JSON[_0xb2eb('0x11')](_0x4f2401));_0x56e214(_0x4f2401);})['catch'](function(_0x1d9be3){logger[_0xb2eb('0x12')](_0xb2eb('0x17'),_0x1d9be3[_0xb2eb('0x14')],_0x2a7362);_0x2cc877(_0x4a7587[_0xb2eb('0x12')](0x1f4,_0x1d9be3[_0xb2eb('0x14')]));});});};exports[_0xb2eb('0x1d')]=function(_0x302391){var _0x14ca8a=this;return new Promise(function(_0x29abeb,_0x5a25f8){return db['VoiceDialReport'][_0xb2eb('0x1e')](_0x302391[_0xb2eb('0x1a')],{'raw':_0x302391[_0xb2eb('0x1b')]?_0x302391[_0xb2eb('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x302391[_0xb2eb('0x1b')]?_0x302391[_0xb2eb('0x1b')]['where']||null:null,'attributes':_0x302391['options']?_0x302391[_0xb2eb('0x1b')][_0xb2eb('0x1f')]||null:null,'limit':_0x302391[_0xb2eb('0x1b')]?_0x302391['options']['limit']||null:null})[_0xb2eb('0xb')](function(_0x3ead61){logger[_0xb2eb('0xc')]('UpdateVoiceDialReport',_0x302391);logger[_0xb2eb('0xf')]('UpdateVoiceDialReport',_0x302391,JSON[_0xb2eb('0x11')](_0x3ead61));_0x29abeb(_0x3ead61);})['catch'](function(_0x31d015){logger[_0xb2eb('0x12')]('UpdateVoiceDialReport',_0x31d015[_0xb2eb('0x14')],_0x302391);_0x5a25f8(_0x14ca8a['error'](0x1f4,_0x31d015[_0xb2eb('0x14')]));});});};
\ No newline at end of file
+var _0xac25=['../../config/environment','client','http','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceDialReport,\x20%s,\x20%s','message','catch','VoiceDialReport','create','body','options','raw','CreateVoiceDialReport','update','where','attributes','UpdateVoiceDialReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5a6fad,_0x23a9a3){var _0x2eb803=function(_0x20d793){while(--_0x20d793){_0x5a6fad['push'](_0x5a6fad['shift']());}};_0x2eb803(++_0x23a9a3);}(_0xac25,0x137));var _0x5ac2=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xac25[_0x481bf7];return _0x461787;};'use strict';var _=require('lodash');var util=require(_0x5ac2('0x0'));var moment=require(_0x5ac2('0x1'));var BPromise=require(_0x5ac2('0x2'));var rs=require(_0x5ac2('0x3'));var fs=require('fs');var Redis=require(_0x5ac2('0x4'));var db=require(_0x5ac2('0x5'))['db'];var utils=require(_0x5ac2('0x6'));var logger=require(_0x5ac2('0x7'))(_0x5ac2('0x8'));var config=require(_0x5ac2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5ac2('0xa')][_0x5ac2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42d435,_0x72b2ea,_0x233f78){return new BPromise(function(_0x8c2a9b,_0x1d4527){return client['request'](_0x42d435,_0x233f78)[_0x5ac2('0xc')](function(_0x4ff145){logger[_0x5ac2('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x72b2ea,_0x5ac2('0xe'));logger[_0x5ac2('0xf')](_0x5ac2('0x10'),_0x72b2ea,_0x5ac2('0xe'),JSON[_0x5ac2('0x11')](_0x4ff145));if(_0x4ff145[_0x5ac2('0x12')]){if(_0x4ff145[_0x5ac2('0x12')]['code']===0x1f4){logger[_0x5ac2('0x12')](_0x5ac2('0x13'),_0x72b2ea,_0x4ff145[_0x5ac2('0x12')][_0x5ac2('0x14')]);return _0x1d4527(_0x4ff145[_0x5ac2('0x12')][_0x5ac2('0x14')]);}logger['error'](_0x5ac2('0x13'),_0x72b2ea,_0x4ff145[_0x5ac2('0x12')][_0x5ac2('0x14')]);return _0x8c2a9b(_0x4ff145[_0x5ac2('0x12')]['message']);}else{logger[_0x5ac2('0xd')](_0x5ac2('0x13'),_0x72b2ea,_0x5ac2('0xe'));_0x8c2a9b(_0x4ff145['result'][_0x5ac2('0x14')]);}})[_0x5ac2('0x15')](function(_0x57e916){logger[_0x5ac2('0x12')](_0x5ac2('0x13'),_0x72b2ea,_0x57e916);_0x1d4527(_0x57e916);});});}exports['CreateVoiceDialReport']=function(_0x5f33be){var _0x24ffc2=this;return new Promise(function(_0x44985e,_0x2490fb){return db[_0x5ac2('0x16')][_0x5ac2('0x17')](_0x5f33be[_0x5ac2('0x18')],{'raw':_0x5f33be[_0x5ac2('0x19')]?_0x5f33be[_0x5ac2('0x19')][_0x5ac2('0x1a')]===undefined?!![]:![]:!![]})[_0x5ac2('0xc')](function(_0xcd24e6){logger[_0x5ac2('0xd')](_0x5ac2('0x1b'),_0x5f33be);logger[_0x5ac2('0xf')](_0x5ac2('0x1b'),_0x5f33be,JSON[_0x5ac2('0x11')](_0xcd24e6));_0x44985e(_0xcd24e6);})[_0x5ac2('0x15')](function(_0x32b128){logger[_0x5ac2('0x12')](_0x5ac2('0x1b'),_0x32b128[_0x5ac2('0x14')],_0x5f33be);_0x2490fb(_0x24ffc2[_0x5ac2('0x12')](0x1f4,_0x32b128[_0x5ac2('0x14')]));});});};exports['UpdateVoiceDialReport']=function(_0x535df4){var _0x1ad791=this;return new Promise(function(_0x287799,_0x28a529){return db['VoiceDialReport'][_0x5ac2('0x1c')](_0x535df4[_0x5ac2('0x18')],{'raw':_0x535df4[_0x5ac2('0x19')]?_0x535df4[_0x5ac2('0x19')][_0x5ac2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x535df4['options']?_0x535df4[_0x5ac2('0x19')][_0x5ac2('0x1d')]||null:null,'attributes':_0x535df4[_0x5ac2('0x19')]?_0x535df4[_0x5ac2('0x19')][_0x5ac2('0x1e')]||null:null,'limit':_0x535df4[_0x5ac2('0x19')]?_0x535df4['options']['limit']||null:null})[_0x5ac2('0xc')](function(_0x7bbb4b){logger[_0x5ac2('0xd')](_0x5ac2('0x1f'),_0x535df4);logger[_0x5ac2('0xf')](_0x5ac2('0x1f'),_0x535df4,JSON[_0x5ac2('0x11')](_0x7bbb4b));_0x287799(_0x7bbb4b);})[_0x5ac2('0x15')](function(_0x3f955f){logger['error'](_0x5ac2('0x1f'),_0x3f955f[_0x5ac2('0x14')],_0x535df4);_0x28a529(_0x1ad791[_0x5ac2('0x12')](0x1f4,_0x3f955f[_0x5ac2('0x14')]));});});};
\ No newline at end of file
index f682629..c0e9177 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79df=['/:id/applications','addApplications','put','/:id','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','show','post','create'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x79df,0x1d4));var _0xf79d=function(_0x5656ec,_0x54e650){_0x5656ec=_0x5656ec-0x0;var _0x47a77c=_0x79df[_0x5656ec];return _0x47a77c;};'use strict';var multer=require('multer');var util=require(_0xf79d('0x0'));var path=require(_0xf79d('0x1'));var timeout=require(_0xf79d('0x2'));var express=require(_0xf79d('0x3'));var router=express[_0xf79d('0x4')]();var fs_extra=require(_0xf79d('0x5'));var auth=require(_0xf79d('0x6'));var interaction=require(_0xf79d('0x7'));var config=require(_0xf79d('0x8'));var controller=require(_0xf79d('0x9'));router[_0xf79d('0xa')]('/',auth[_0xf79d('0xb')](),controller[_0xf79d('0xc')]);router[_0xf79d('0xa')]('/:id',auth[_0xf79d('0xb')](),controller[_0xf79d('0xd')]);router[_0xf79d('0xe')]('/',auth[_0xf79d('0xb')](),controller[_0xf79d('0xf')]);router[_0xf79d('0xe')](_0xf79d('0x10'),auth[_0xf79d('0xb')](),controller[_0xf79d('0x11')]);router[_0xf79d('0x12')](_0xf79d('0x13'),auth['isAuthenticated'](),controller[_0xf79d('0x14')]);router['delete'](_0xf79d('0x13'),auth['isAuthenticated'](),controller[_0xf79d('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x7f81=['isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get'];(function(_0x10a8d8,_0x28f292){var _0x3b2b79=function(_0x55a3fe){while(--_0x55a3fe){_0x10a8d8['push'](_0x10a8d8['shift']());}};_0x3b2b79(++_0x28f292);}(_0x7f81,0xa5));var _0x17f8=function(_0x4f133c,_0x180336){_0x4f133c=_0x4f133c-0x0;var _0x2e74e4=_0x7f81[_0x4f133c];return _0x2e74e4;};'use strict';var multer=require('multer');var util=require(_0x17f8('0x0'));var path=require(_0x17f8('0x1'));var timeout=require(_0x17f8('0x2'));var express=require(_0x17f8('0x3'));var router=express[_0x17f8('0x4')]();var fs_extra=require(_0x17f8('0x5'));var auth=require(_0x17f8('0x6'));var interaction=require(_0x17f8('0x7'));var config=require(_0x17f8('0x8'));var controller=require(_0x17f8('0x9'));router[_0x17f8('0xa')]('/',auth[_0x17f8('0xb')](),controller[_0x17f8('0xc')]);router['get'](_0x17f8('0xd'),auth['isAuthenticated'](),controller[_0x17f8('0xe')]);router[_0x17f8('0xf')]('/',auth['isAuthenticated'](),controller[_0x17f8('0x10')]);router['post'](_0x17f8('0x11'),auth[_0x17f8('0xb')](),controller[_0x17f8('0x12')]);router['put'](_0x17f8('0xd'),auth[_0x17f8('0xb')](),controller[_0x17f8('0x13')]);router[_0x17f8('0x14')](_0x17f8('0xd'),auth['isAuthenticated'](),controller[_0x17f8('0x15')]);module['exports']=router;
\ No newline at end of file
index 16afd5d..367b855 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa2c=['any','INTEGER','wav','BOOLEAN','VIRTUAL','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','outbound','inbound-fax','system'];(function(_0x37c341,_0x39f539){var _0x36fb51=function(_0x7ce231){while(--_0x7ce231){_0x37c341['push'](_0x37c341['shift']());}};_0x36fb51(++_0x39f539);}(_0xfa2c,0x1e1));var _0xcfa2=function(_0x2e0f9e,_0x3ef344){_0x2e0f9e=_0x2e0f9e-0x0;var _0x1f44c1=_0xfa2c[_0x2e0f9e];return _0x1f44c1;};'use strict';var Sequelize=require(_0xcfa2('0x0'));module[_0xcfa2('0x1')]={'context':{'type':Sequelize[_0xcfa2('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xcfa2('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xcfa2('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xcfa2('0x3')},'tag':{'type':Sequelize[_0xcfa2('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xcfa2('0x2')],'allowNull':![],'defaultValue':_0xcfa2('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xcfa2('0x5')]('inbound',_0xcfa2('0x6'),'internal',_0xcfa2('0x7'),'outbound-fax',_0xcfa2('0x8'),_0xcfa2('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0xcfa2('0x2')]},'interval':{'type':Sequelize[_0xcfa2('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xcfa2('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xcfa2('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xcfa2('0xa')]},'recordingFormat':{'type':Sequelize[_0xcfa2('0x2')],'defaultValue':_0xcfa2('0xb')},'answer':{'type':Sequelize[_0xcfa2('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xcfa2('0xd')],'get':function(_0x271d86){return this['getDataValue']('exten');}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x4f14=['*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','any'];(function(_0x32d472,_0x8e802b){var _0xc11773=function(_0x1edf00){while(--_0x1edf00){_0x32d472['push'](_0x32d472['shift']());}};_0xc11773(++_0x8e802b);}(_0x4f14,0x155));var _0x44f1=function(_0x5745f5,_0x427075){_0x5745f5=_0x5745f5-0x0;var _0x26983c=_0x4f14[_0x5745f5];return _0x26983c;};'use strict';var Sequelize=require('sequelize');module[_0x44f1('0x0')]={'context':{'type':Sequelize[_0x44f1('0x1')],'allowNull':![],'unique':_0x44f1('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x44f1('0x1')],'allowNull':![],'unique':_0x44f1('0x2')},'priority':{'type':Sequelize[_0x44f1('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x44f1('0x2')},'tag':{'type':Sequelize[_0x44f1('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x44f1('0x1')],'allowNull':![],'defaultValue':_0x44f1('0x3')},'appdata':{'type':Sequelize[_0x44f1('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x44f1('0x4')](_0x44f1('0x5'),_0x44f1('0x6'),_0x44f1('0x7'),_0x44f1('0x8'),_0x44f1('0x9'),'system',_0x44f1('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x44f1('0x1')]},'interval':{'type':Sequelize[_0x44f1('0x1')],'allowNull':![],'defaultValue':_0x44f1('0xb')},'IntervalId':{'type':Sequelize[_0x44f1('0xc')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x44f1('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x44f1('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x44f1('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x44f1('0xc')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x44f1('0xe')},'answer':{'type':Sequelize[_0x44f1('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x44f1('0xf')],'get':function(_0x165e7d){return this['getDataValue']('exten');}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index 7f3eb83..bd102db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28de=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','mandatoryDisposition','sequelize','Transaction','READ_COMMITTED','VoiceExtensionId','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','sendStatus','send','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','find','name','UserProfileResource','error','stack','index','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceExtension','includeAll','include','rows','catch','show','rawAttributes','length','params','create','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','value'];(function(_0x3fb08e,_0x36e80b){var _0x6e55c3=function(_0x4790d8){while(--_0x4790d8){_0x3fb08e['push'](_0x3fb08e['shift']());}};_0x6e55c3(++_0x36e80b);}(_0x28de,0x17d));var _0xe28d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x28de[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0xe28d('0x0'));var logger=require(_0xe28d('0x1'))(_0xe28d('0x2'));var config=require(_0xe28d('0x3'));var db=require(_0xe28d('0x4'))['db'];config[_0xe28d('0x5')]=_[_0xe28d('0x6')](config[_0xe28d('0x5')],{'host':_0xe28d('0x7'),'port':0x18eb});var socket=require(_0xe28d('0x8'))(new Redis(config[_0xe28d('0x5')]));require(_0xe28d('0x9'))[_0xe28d('0xa')](socket);function respondWithStatusCode(_0x87e45e,_0x373ab0){_0x373ab0=_0x373ab0||0xcc;return function(_0xb73b6f){if(_0xb73b6f){return _0x87e45e['sendStatus'](_0x373ab0);}return _0x87e45e[_0xe28d('0xb')](_0x373ab0)[_0xe28d('0xc')]();};}function respondWithResult(_0x25eff2,_0x298d40){_0x298d40=_0x298d40||0xc8;return function(_0x24c880){if(_0x24c880){return _0x25eff2[_0xe28d('0xb')](_0x298d40)['json'](_0x24c880);}};}function respondWithFilteredResult(_0x3b697a,_0x51f11b){return function(_0x18f4ab){if(_0x18f4ab){var _0x3bf892=typeof _0x51f11b[_0xe28d('0xd')]===_0xe28d('0xe')&&typeof _0x51f11b[_0xe28d('0xf')]===_0xe28d('0xe');var _0x4dfc4b=_0x18f4ab[_0xe28d('0x10')];var _0x17c8f3=_0x3bf892?0x0:_0x51f11b[_0xe28d('0xd')];var _0xe9c4d8=_0x3bf892?_0x18f4ab['count']:_0x51f11b[_0xe28d('0xd')]+_0x51f11b[_0xe28d('0xf')];var _0x4462cb;if(_0xe9c4d8>=_0x4dfc4b){_0xe9c4d8=_0x4dfc4b;_0x4462cb=0xc8;}else{_0x4462cb=0xce;}_0x3b697a[_0xe28d('0xb')](_0x4462cb);return _0x3b697a[_0xe28d('0x11')](_0xe28d('0x12'),_0x17c8f3+'-'+_0xe9c4d8+'/'+_0x4dfc4b)[_0xe28d('0x13')](_0x18f4ab);}return null;};}function removeEntity(_0x5e1f95){return function(_0x28ed77){if(_0x28ed77){return _0x28ed77[_0xe28d('0x14')]()[_0xe28d('0x15')](function(){var _0x45ab5c=_0x28ed77[_0xe28d('0x16')]({'plain':!![]});var _0x42f6fa=[{'name':_0xe28d('0x17'),'value':_0xe28d('0x18'),'ignore':![]},{'name':_0xe28d('0x19'),'value':_0xe28d('0x1a'),'ignore':![]},{'name':_0xe28d('0x1b'),'value':_0xe28d('0x1c'),'ignore':![]}];var _0x12f269=_(_0x42f6fa)['filter'](_0xe28d('0x1d'))[_0xe28d('0x1e')]('value')['value']();if(_['includes'](_0x12f269,_0x45ab5c['type'])){return;}var _0x2a0594=_[_0xe28d('0x1f')](_0x42f6fa,['value',_0x45ab5c['type']])[_0xe28d('0x20')];return db[_0xe28d('0x21')][_0xe28d('0x14')]({'where':{'type':_0x2a0594,'resourceId':_0x45ab5c['id']}})[_0xe28d('0x15')](function(){return _0x28ed77;});})['then'](function(){_0x5e1f95[_0xe28d('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a23bb){return function(_0x5f2708){if(!_0x5f2708){_0x5a23bb['sendStatus'](0x194);}return _0x5f2708;};}function handleError(_0x333489,_0x484039){_0x484039=_0x484039||0x1f4;return function(_0x189cd0){logger[_0xe28d('0x22')](_0x189cd0[_0xe28d('0x23')]);if(_0x189cd0[_0xe28d('0x20')]){delete _0x189cd0[_0xe28d('0x20')];}_0x333489['status'](_0x484039)['send'](_0x189cd0);};}exports[_0xe28d('0x24')]=function(_0x130bca,_0x5f209){var _0xf88e63={},_0xdaa8a8={},_0xf1d3bc={'count':0x0,'rows':[]};var _0x5c7912=_['map'](db['VoiceExtension']['rawAttributes'],function(_0x54b0ee){return{'name':_0x54b0ee[_0xe28d('0x25')],'type':_0x54b0ee[_0xe28d('0x26')][_0xe28d('0x27')]};});_0xdaa8a8[_0xe28d('0x28')]=_[_0xe28d('0x1e')](_0x5c7912,_0xe28d('0x20'));_0xdaa8a8['query']=_[_0xe28d('0x29')](_0x130bca['query']);_0xdaa8a8[_0xe28d('0x2a')]=_[_0xe28d('0x2b')](_0xdaa8a8[_0xe28d('0x28')],_0xdaa8a8[_0xe28d('0x2c')]);_0xf88e63[_0xe28d('0x2d')]=_[_0xe28d('0x2b')](_0xdaa8a8[_0xe28d('0x28')],qs[_0xe28d('0x2e')](_0x130bca[_0xe28d('0x2c')]['fields']));_0xf88e63[_0xe28d('0x2d')]=_0xf88e63[_0xe28d('0x2d')]['length']?_0xf88e63['attributes']:_0xdaa8a8[_0xe28d('0x28')];if(!_0x130bca['query'][_0xe28d('0x2f')](_0xe28d('0x30'))){_0xf88e63['limit']=qs[_0xe28d('0xf')](_0x130bca['query'][_0xe28d('0xf')]);_0xf88e63['offset']=qs[_0xe28d('0xd')](_0x130bca[_0xe28d('0x2c')]['offset']);}_0xf88e63[_0xe28d('0x31')]=qs[_0xe28d('0x32')](_0x130bca[_0xe28d('0x2c')][_0xe28d('0x32')]);_0xf88e63[_0xe28d('0x33')]=qs[_0xe28d('0x2a')](_[_0xe28d('0x34')](_0x130bca[_0xe28d('0x2c')],_0xdaa8a8['filters']),_0x5c7912);if(_0x130bca[_0xe28d('0x2c')][_0xe28d('0x35')]){_0xf88e63[_0xe28d('0x33')]=_[_0xe28d('0x36')](_0xf88e63[_0xe28d('0x33')],{'$or':_[_0xe28d('0x1e')](_0x5c7912,function(_0x4f2fb7){if(_0x4f2fb7[_0xe28d('0x26')]!==_0xe28d('0x37')){var _0x16c530={};_0x16c530[_0x4f2fb7[_0xe28d('0x20')]]={'$like':'%'+_0x130bca[_0xe28d('0x2c')][_0xe28d('0x35')]+'%'};return _0x16c530;}})});}_0xf88e63=_['merge']({},_0xf88e63,_0x130bca[_0xe28d('0x38')]);var _0x1ca7f2={'where':_0xf88e63[_0xe28d('0x33')]};return db[_0xe28d('0x39')]['count'](_0x1ca7f2)['then'](function(_0x486546){_0xf1d3bc[_0xe28d('0x10')]=_0x486546;if(_0x130bca[_0xe28d('0x2c')][_0xe28d('0x3a')]){_0xf88e63[_0xe28d('0x3b')]=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0xf88e63);})[_0xe28d('0x15')](function(_0x4ccd26){_0xf1d3bc[_0xe28d('0x3c')]=_0x4ccd26;return _0xf1d3bc;})[_0xe28d('0x15')](respondWithFilteredResult(_0x5f209,_0xf88e63))[_0xe28d('0x3d')](handleError(_0x5f209,null));};exports[_0xe28d('0x3e')]=function(_0x13c56b,_0x2b6ca7){var _0x1f7981={'raw':![],'where':{'id':_0x13c56b['params']['id']}},_0x1be22e={};_0x1be22e[_0xe28d('0x28')]=_['keys'](db[_0xe28d('0x39')][_0xe28d('0x3f')]);_0x1be22e[_0xe28d('0x2c')]=_['keys'](_0x13c56b[_0xe28d('0x2c')]);_0x1be22e[_0xe28d('0x2a')]=_[_0xe28d('0x2b')](_0x1be22e['model'],_0x1be22e[_0xe28d('0x2c')]);_0x1f7981[_0xe28d('0x2d')]=_[_0xe28d('0x2b')](_0x1be22e['model'],qs[_0xe28d('0x2e')](_0x13c56b[_0xe28d('0x2c')][_0xe28d('0x2e')]));_0x1f7981[_0xe28d('0x2d')]=_0x1f7981[_0xe28d('0x2d')][_0xe28d('0x40')]?_0x1f7981[_0xe28d('0x2d')]:_0x1be22e[_0xe28d('0x28')];if(_0x13c56b[_0xe28d('0x2c')][_0xe28d('0x3a')]){_0x1f7981[_0xe28d('0x3b')]=[{'all':!![]}];}_0x1f7981=_[_0xe28d('0x36')]({},_0x1f7981,_0x13c56b[_0xe28d('0x38')]);return db[_0xe28d('0x39')][_0xe28d('0x1f')](_0x1f7981)[_0xe28d('0x15')](handleEntityNotFound(_0x2b6ca7,null))[_0xe28d('0x15')](respondWithResult(_0x2b6ca7,null))['catch'](handleError(_0x2b6ca7,null));};exports['destroy']=function(_0x257ba1,_0x4173f2){return db[_0xe28d('0x39')][_0xe28d('0x1f')]({'where':{'id':_0x257ba1[_0xe28d('0x41')]['id']}})[_0xe28d('0x15')](handleEntityNotFound(_0x4173f2,null))[_0xe28d('0x15')](removeEntity(_0x4173f2,null))[_0xe28d('0x3d')](handleError(_0x4173f2,null));};exports[_0xe28d('0x42')]=function(_0x4335da,_0x5b6a37){if(_0x4335da[_0xe28d('0x43')][_0xe28d('0x26')]==='outbound'&&!_['startsWith'](_0x4335da[_0xe28d('0x43')][_0xe28d('0x44')],'_')){_0x4335da['body'][_0xe28d('0x44')]='_'[_0xe28d('0x45')](_0x4335da[_0xe28d('0x43')][_0xe28d('0x44')]);}return db[_0xe28d('0x39')][_0xe28d('0x42')](_0x4335da[_0xe28d('0x43')],{'raw':![]})[_0xe28d('0x15')](function(_0xa4c0c1){var _0x3452fb=_0x4335da['user'][_0xe28d('0x16')]({'plain':!![]});if(!_0x3452fb)throw new Error(_0xe28d('0x46'));if(_0x3452fb[_0xe28d('0x47')]===_0xe28d('0x48')){var _0x259023=_0xa4c0c1[_0xe28d('0x16')]({'plain':!![]});var _0x105929=[{'name':'InboundRoutes','value':'inbound'},{'name':_0xe28d('0x19'),'value':_0xe28d('0x1a')},{'name':_0xe28d('0x1b'),'value':'internal'}];var _0x2f24cf=_[_0xe28d('0x1f')](_0x105929,[_0xe28d('0x49'),_0x259023[_0xe28d('0x26')]])[_0xe28d('0x20')];return db['UserProfileSection'][_0xe28d('0x1f')]({'where':{'name':_0x2f24cf,'userProfileId':_0x3452fb[_0xe28d('0x4a')]},'raw':!![]})[_0xe28d('0x15')](function(_0x11b07b){if(_0x11b07b&&_0x11b07b[_0xe28d('0x4b')]===0x0){return db['UserProfileResource'][_0xe28d('0x42')]({'name':_0x259023[_0xe28d('0x20')],'resourceId':_0x259023['id'],'type':_0x11b07b['name'],'sectionId':_0x11b07b['id']},{})['then'](function(){return _0xa4c0c1;});}else{return _0xa4c0c1;}})[_0xe28d('0x3d')](function(_0xc6bc15){logger[_0xe28d('0x22')](_0xe28d('0x4c'),_0xc6bc15);throw _0xc6bc15;});}return _0xa4c0c1;})[_0xe28d('0x15')](respondWithResult(_0x5b6a37,0xc9))['catch'](handleError(_0x5b6a37,null));};exports[_0xe28d('0x4d')]=function(_0x1e9a15,_0x5d59ac){if(_0x1e9a15['body']['id']){delete _0x1e9a15[_0xe28d('0x43')]['id'];}return db[_0xe28d('0x39')][_0xe28d('0x1f')]({'where':{'id':_0x1e9a15['params']['id']}})[_0xe28d('0x15')](handleEntityNotFound(_0x5d59ac,null))[_0xe28d('0x15')](function(_0x1f5785){if(_0x1f5785){return db['VoiceExtension'][_0xe28d('0x4d')](_[_0xe28d('0x34')](_0x1e9a15[_0xe28d('0x43')],[_0xe28d('0x44'),_0xe28d('0x4e'),_0xe28d('0x4f'),_0xe28d('0x50'),'cutdigits',_0xe28d('0x51'),'alias']),{'where':{'context':_0x1f5785[_0xe28d('0x4e')],'exten':_0x1f5785[_0xe28d('0x44')]},'individualHooks':!![]})[_0xe28d('0x15')](function(_0x588ba2){return _0x588ba2;});}return null;})[_0xe28d('0x15')](respondWithStatusCode(_0x5d59ac,null))['catch'](handleError(_0x5d59ac,null));};exports['addApplications']=function(_0x28749e,_0x42fd08){var _0x2f7a89=_0x28749e[_0xe28d('0x41')]['id'];var _0x2d1792=_0x28749e[_0xe28d('0x43')];var _0x4f366a=0xc8;var _0x4be115=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xe28d('0x52')][_0xe28d('0x53')]['ISOLATION_LEVELS'][_0xe28d('0x54')]},function(_0x1aa7b0){return db[_0xe28d('0x39')]['findOne']({'where':{'id':_0x2f7a89},'transaction':_0x1aa7b0})[_0xe28d('0x15')](function(_0x528e00){if(_0x528e00){return db['VoiceExtension'][_0xe28d('0x14')]({'where':{'VoiceExtensionId':_0x2f7a89},'transaction':_0x1aa7b0})[_0xe28d('0x15')](function(){var _0x19dc6e=_['map'](_0x2d1792,function(_0x174c0d){_0x174c0d[_0xe28d('0x55')]=_0x2f7a89;_0x174c0d['isApp']=!![];return _0x174c0d;});return _0x528e00[_0xe28d('0x56')](_0x19dc6e);})[_0xe28d('0x15')](function(_0x18bbcc){return db[_0xe28d('0x39')]['bulkCreate'](_0x18bbcc,{'transaction':_0x1aa7b0});});}else{_0x4f366a=0x194;_0x4be115=[];}});})[_0xe28d('0x15')](function(){if(_0x4f366a!==0x194){return db[_0xe28d('0x39')][_0xe28d('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2f7a89},'order':_0xe28d('0x58')})[_0xe28d('0x15')](function(_0x42b13c){_0x4be115=_0x42b13c;});}})[_0xe28d('0x3d')](function(_0x575ef7){_0x4f366a=0x1f4;logger[_0xe28d('0x22')](_0x575ef7['stack']);if(_0x575ef7[_0xe28d('0x20')]){delete _0x575ef7[_0xe28d('0x20')];}_0x4be115=_0x575ef7;})['finally'](function(){if(_0x4be115===null){_0x42fd08[_0xe28d('0x59')](_0x4f366a);}else{if(_0x4f366a===0x1f4){_0x42fd08[_0xe28d('0xb')](_0x4f366a)[_0xe28d('0x5a')](_0x4be115);}else{_0x42fd08['status'](_0x4f366a)['json'](_0x4be115);}}});};
\ No newline at end of file
+var _0x18da=['destroy','InboundRoutes','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','then','error','stack','send','VoiceExtension','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','findAll','rows','params','rawAttributes','includeAll','catch','body','outbound','startsWith','exten','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','inbound','UserProfileSection','autoAssociation','UserProfileResource','update','description','cutdigits','mandatoryDisposition','alias','context','sequelize','transaction','ISOLATION_LEVELS','findOne','isApp','createRouting','bulkCreate','findAndCountAll','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json'];(function(_0x4e76da,_0x291b71){var _0x5f14e8=function(_0x30ad0f){while(--_0x30ad0f){_0x4e76da['push'](_0x4e76da['shift']());}};_0x5f14e8(++_0x291b71);}(_0x18da,0x9d));var _0xa18d=function(_0x330d8c,_0x477d0a){_0x330d8c=_0x330d8c-0x0;var _0x38ec91=_0x18da[_0x330d8c];return _0x38ec91;};'use strict';var _=require('lodash');var Redis=require(_0xa18d('0x0'));var qs=require(_0xa18d('0x1'));var logger=require(_0xa18d('0x2'))(_0xa18d('0x3'));var config=require(_0xa18d('0x4'));var db=require(_0xa18d('0x5'))['db'];config[_0xa18d('0x6')]=_[_0xa18d('0x7')](config[_0xa18d('0x6')],{'host':_0xa18d('0x8'),'port':0x18eb});var socket=require(_0xa18d('0x9'))(new Redis(config['redis']));require(_0xa18d('0xa'))['register'](socket);function respondWithStatusCode(_0x2456d2,_0x4726fe){_0x4726fe=_0x4726fe||0xcc;return function(_0x34852e){if(_0x34852e){return _0x2456d2[_0xa18d('0xb')](_0x4726fe);}return _0x2456d2[_0xa18d('0xc')](_0x4726fe)[_0xa18d('0xd')]();};}function respondWithResult(_0x2a3f49,_0x43d203){_0x43d203=_0x43d203||0xc8;return function(_0x2e1958){if(_0x2e1958){return _0x2a3f49[_0xa18d('0xc')](_0x43d203)['json'](_0x2e1958);}};}function respondWithFilteredResult(_0x24b707,_0x25125e){return function(_0x4e00c5){if(_0x4e00c5){var _0x2b4a8a=typeof _0x25125e[_0xa18d('0xe')]===_0xa18d('0xf')&&typeof _0x25125e['limit']===_0xa18d('0xf');var _0x13c318=_0x4e00c5[_0xa18d('0x10')];var _0x4106a3=_0x2b4a8a?0x0:_0x25125e['offset'];var _0x3529e4=_0x2b4a8a?_0x4e00c5[_0xa18d('0x10')]:_0x25125e[_0xa18d('0xe')]+_0x25125e[_0xa18d('0x11')];var _0x304f9e;if(_0x3529e4>=_0x13c318){_0x3529e4=_0x13c318;_0x304f9e=0xc8;}else{_0x304f9e=0xce;}_0x24b707[_0xa18d('0xc')](_0x304f9e);return _0x24b707[_0xa18d('0x12')](_0xa18d('0x13'),_0x4106a3+'-'+_0x3529e4+'/'+_0x13c318)[_0xa18d('0x14')](_0x4e00c5);}return null;};}function removeEntity(_0x40744f){return function(_0x252d82){if(_0x252d82){return _0x252d82[_0xa18d('0x15')]()['then'](function(){var _0x42b32a=_0x252d82['get']({'plain':!![]});var _0xb4c482=[{'name':_0xa18d('0x16'),'value':'inbound','ignore':![]},{'name':_0xa18d('0x17'),'value':'outbound','ignore':![]},{'name':_0xa18d('0x18'),'value':_0xa18d('0x19'),'ignore':![]}];var _0xb6ef6d=_(_0xb4c482)[_0xa18d('0x1a')](_0xa18d('0x1b'))[_0xa18d('0x1c')](_0xa18d('0x1d'))[_0xa18d('0x1d')]();if(_[_0xa18d('0x1e')](_0xb6ef6d,_0x42b32a[_0xa18d('0x1f')])){return;}var _0x437afb=_[_0xa18d('0x20')](_0xb4c482,[_0xa18d('0x1d'),_0x42b32a[_0xa18d('0x1f')]])[_0xa18d('0x21')];return db['UserProfileResource'][_0xa18d('0x15')]({'where':{'type':_0x437afb,'resourceId':_0x42b32a['id']}})[_0xa18d('0x22')](function(){return _0x252d82;});})[_0xa18d('0x22')](function(){_0x40744f[_0xa18d('0xc')](0xcc)[_0xa18d('0xd')]();});}};}function handleEntityNotFound(_0x8b53dd){return function(_0x4876bd){if(!_0x4876bd){_0x8b53dd[_0xa18d('0xb')](0x194);}return _0x4876bd;};}function handleError(_0x2a9c1a,_0x1dcc3f){_0x1dcc3f=_0x1dcc3f||0x1f4;return function(_0x3665e0){logger[_0xa18d('0x23')](_0x3665e0[_0xa18d('0x24')]);if(_0x3665e0[_0xa18d('0x21')]){delete _0x3665e0[_0xa18d('0x21')];}_0x2a9c1a[_0xa18d('0xc')](_0x1dcc3f)[_0xa18d('0x25')](_0x3665e0);};}exports['index']=function(_0x424656,_0x1a070d){var _0x985711={},_0x33f4f7={},_0x7e6487={'count':0x0,'rows':[]};var _0x319a37=_['map'](db[_0xa18d('0x26')]['rawAttributes'],function(_0x13b213){return{'name':_0x13b213['fieldName'],'type':_0x13b213[_0xa18d('0x1f')][_0xa18d('0x27')]};});_0x33f4f7[_0xa18d('0x28')]=_[_0xa18d('0x1c')](_0x319a37,_0xa18d('0x21'));_0x33f4f7[_0xa18d('0x29')]=_[_0xa18d('0x2a')](_0x424656[_0xa18d('0x29')]);_0x33f4f7[_0xa18d('0x2b')]=_[_0xa18d('0x2c')](_0x33f4f7[_0xa18d('0x28')],_0x33f4f7['query']);_0x985711[_0xa18d('0x2d')]=_[_0xa18d('0x2c')](_0x33f4f7[_0xa18d('0x28')],qs[_0xa18d('0x2e')](_0x424656[_0xa18d('0x29')][_0xa18d('0x2e')]));_0x985711[_0xa18d('0x2d')]=_0x985711[_0xa18d('0x2d')][_0xa18d('0x2f')]?_0x985711[_0xa18d('0x2d')]:_0x33f4f7['model'];if(!_0x424656[_0xa18d('0x29')][_0xa18d('0x30')](_0xa18d('0x31'))){_0x985711['limit']=qs[_0xa18d('0x11')](_0x424656['query'][_0xa18d('0x11')]);_0x985711[_0xa18d('0xe')]=qs[_0xa18d('0xe')](_0x424656['query'][_0xa18d('0xe')]);}_0x985711[_0xa18d('0x32')]=qs[_0xa18d('0x33')](_0x424656[_0xa18d('0x29')][_0xa18d('0x33')]);_0x985711['where']=qs[_0xa18d('0x2b')](_[_0xa18d('0x34')](_0x424656[_0xa18d('0x29')],_0x33f4f7[_0xa18d('0x2b')]),_0x319a37);if(_0x424656['query'][_0xa18d('0x1a')]){_0x985711[_0xa18d('0x35')]=_[_0xa18d('0x36')](_0x985711['where'],{'$or':_[_0xa18d('0x1c')](_0x319a37,function(_0x19c66e){if(_0x19c66e[_0xa18d('0x1f')]!==_0xa18d('0x37')){var _0x4d8bb8={};_0x4d8bb8[_0x19c66e['name']]={'$like':'%'+_0x424656['query']['filter']+'%'};return _0x4d8bb8;}})});}_0x985711=_['merge']({},_0x985711,_0x424656[_0xa18d('0x38')]);var _0x5b9ea3={'where':_0x985711[_0xa18d('0x35')]};return db[_0xa18d('0x26')][_0xa18d('0x10')](_0x5b9ea3)[_0xa18d('0x22')](function(_0x95522e){_0x7e6487[_0xa18d('0x10')]=_0x95522e;if(_0x424656[_0xa18d('0x29')]['includeAll']){_0x985711['include']=[{'all':!![]}];}return db['VoiceExtension'][_0xa18d('0x39')](_0x985711);})[_0xa18d('0x22')](function(_0x338236){_0x7e6487[_0xa18d('0x3a')]=_0x338236;return _0x7e6487;})[_0xa18d('0x22')](respondWithFilteredResult(_0x1a070d,_0x985711))['catch'](handleError(_0x1a070d,null));};exports['show']=function(_0x2bdbec,_0x280e90){var _0x5d58ee={'raw':![],'where':{'id':_0x2bdbec[_0xa18d('0x3b')]['id']}},_0x5e59c1={};_0x5e59c1[_0xa18d('0x28')]=_[_0xa18d('0x2a')](db['VoiceExtension'][_0xa18d('0x3c')]);_0x5e59c1[_0xa18d('0x29')]=_['keys'](_0x2bdbec[_0xa18d('0x29')]);_0x5e59c1['filters']=_[_0xa18d('0x2c')](_0x5e59c1[_0xa18d('0x28')],_0x5e59c1[_0xa18d('0x29')]);_0x5d58ee['attributes']=_[_0xa18d('0x2c')](_0x5e59c1[_0xa18d('0x28')],qs[_0xa18d('0x2e')](_0x2bdbec[_0xa18d('0x29')]['fields']));_0x5d58ee[_0xa18d('0x2d')]=_0x5d58ee[_0xa18d('0x2d')][_0xa18d('0x2f')]?_0x5d58ee[_0xa18d('0x2d')]:_0x5e59c1[_0xa18d('0x28')];if(_0x2bdbec[_0xa18d('0x29')][_0xa18d('0x3d')]){_0x5d58ee['include']=[{'all':!![]}];}_0x5d58ee=_[_0xa18d('0x36')]({},_0x5d58ee,_0x2bdbec[_0xa18d('0x38')]);return db[_0xa18d('0x26')][_0xa18d('0x20')](_0x5d58ee)[_0xa18d('0x22')](handleEntityNotFound(_0x280e90,null))['then'](respondWithResult(_0x280e90,null))[_0xa18d('0x3e')](handleError(_0x280e90,null));};exports[_0xa18d('0x15')]=function(_0x1f17a6,_0x566c20){return db[_0xa18d('0x26')][_0xa18d('0x20')]({'where':{'id':_0x1f17a6['params']['id']}})['then'](handleEntityNotFound(_0x566c20,null))[_0xa18d('0x22')](removeEntity(_0x566c20,null))['catch'](handleError(_0x566c20,null));};exports['create']=function(_0x20afc4,_0x11682b){if(_0x20afc4[_0xa18d('0x3f')][_0xa18d('0x1f')]===_0xa18d('0x40')&&!_[_0xa18d('0x41')](_0x20afc4[_0xa18d('0x3f')][_0xa18d('0x42')],'_')){_0x20afc4[_0xa18d('0x3f')][_0xa18d('0x42')]='_'['concat'](_0x20afc4['body'][_0xa18d('0x42')]);}return db[_0xa18d('0x26')][_0xa18d('0x43')](_0x20afc4[_0xa18d('0x3f')],{'raw':![]})['then'](function(_0x2bcf5e){var _0x4ae02f=_0x20afc4['user']['get']({'plain':!![]});if(!_0x4ae02f)throw new Error(_0xa18d('0x44'));if(_0x4ae02f['role']===_0xa18d('0x45')){var _0x43dec2=_0x2bcf5e[_0xa18d('0x46')]({'plain':!![]});var _0x9855da=[{'name':_0xa18d('0x16'),'value':_0xa18d('0x47')},{'name':'OutboundRoutes','value':'outbound'},{'name':'InternalRoutes','value':_0xa18d('0x19')}];var _0x10ed31=_['find'](_0x9855da,['value',_0x43dec2['type']])[_0xa18d('0x21')];return db[_0xa18d('0x48')][_0xa18d('0x20')]({'where':{'name':_0x10ed31,'userProfileId':_0x4ae02f['userProfileId']},'raw':!![]})['then'](function(_0x39782f){if(_0x39782f&&_0x39782f[_0xa18d('0x49')]===0x0){return db[_0xa18d('0x4a')]['create']({'name':_0x43dec2['name'],'resourceId':_0x43dec2['id'],'type':_0x39782f[_0xa18d('0x21')],'sectionId':_0x39782f['id']},{})[_0xa18d('0x22')](function(){return _0x2bcf5e;});}else{return _0x2bcf5e;}})[_0xa18d('0x3e')](function(_0x4a71b6){logger[_0xa18d('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a71b6);throw _0x4a71b6;});}return _0x2bcf5e;})['then'](respondWithResult(_0x11682b,0xc9))[_0xa18d('0x3e')](handleError(_0x11682b,null));};exports[_0xa18d('0x4b')]=function(_0x11e467,_0x34ff53){if(_0x11e467[_0xa18d('0x3f')]['id']){delete _0x11e467[_0xa18d('0x3f')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x11e467[_0xa18d('0x3b')]['id']}})[_0xa18d('0x22')](handleEntityNotFound(_0x34ff53,null))['then'](function(_0x5d98db){if(_0x5d98db){return db[_0xa18d('0x26')][_0xa18d('0x4b')](_[_0xa18d('0x34')](_0x11e467['body'],[_0xa18d('0x42'),'context',_0xa18d('0x4c'),'recordingFormat',_0xa18d('0x4d'),_0xa18d('0x4e'),_0xa18d('0x4f')]),{'where':{'context':_0x5d98db[_0xa18d('0x50')],'exten':_0x5d98db['exten']},'individualHooks':!![]})[_0xa18d('0x22')](function(_0x4fcd71){return _0x4fcd71;});}return null;})['then'](respondWithStatusCode(_0x34ff53,null))['catch'](handleError(_0x34ff53,null));};exports['addApplications']=function(_0x563b2d,_0x1101eb){var _0x140973=_0x563b2d[_0xa18d('0x3b')]['id'];var _0x2d1de6=_0x563b2d['body'];var _0x455a2c=0xc8;var _0x1dbaaa=null;return db[_0xa18d('0x51')][_0xa18d('0x52')]({'isolationLevel':db['sequelize']['Transaction'][_0xa18d('0x53')]['READ_COMMITTED']},function(_0x23a677){return db[_0xa18d('0x26')][_0xa18d('0x54')]({'where':{'id':_0x140973},'transaction':_0x23a677})['then'](function(_0x418996){if(_0x418996){return db[_0xa18d('0x26')][_0xa18d('0x15')]({'where':{'VoiceExtensionId':_0x140973},'transaction':_0x23a677})[_0xa18d('0x22')](function(){var _0x38b08c=_[_0xa18d('0x1c')](_0x2d1de6,function(_0x350c04){_0x350c04['VoiceExtensionId']=_0x140973;_0x350c04[_0xa18d('0x55')]=!![];return _0x350c04;});return _0x418996[_0xa18d('0x56')](_0x38b08c);})[_0xa18d('0x22')](function(_0xb42990){return db[_0xa18d('0x26')][_0xa18d('0x57')](_0xb42990,{'transaction':_0x23a677});});}else{_0x455a2c=0x194;_0x1dbaaa=[];}});})[_0xa18d('0x22')](function(){if(_0x455a2c!==0x194){return db[_0xa18d('0x26')][_0xa18d('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x140973},'order':'cast(priority\x20as\x20unsigned)'})[_0xa18d('0x22')](function(_0x33c9ee){_0x1dbaaa=_0x33c9ee;});}})[_0xa18d('0x3e')](function(_0x557f56){_0x455a2c=0x1f4;logger[_0xa18d('0x23')](_0x557f56['stack']);if(_0x557f56[_0xa18d('0x21')]){delete _0x557f56[_0xa18d('0x21')];}_0x1dbaaa=_0x557f56;})['finally'](function(){if(_0x1dbaaa===null){_0x1101eb[_0xa18d('0xb')](_0x455a2c);}else{if(_0x455a2c===0x1f4){_0x1101eb[_0xa18d('0xc')](_0x455a2c)[_0xa18d('0x25')](_0x1dbaaa);}else{_0x1101eb['status'](_0x455a2c)[_0xa18d('0x14')](_0x1dbaaa);}}});};
\ No newline at end of file
index ffcb70b..8b71a1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x552e=['setMaxListeners','save','update','emit','hook','exports','events','VoiceExtension'];(function(_0x28b3ea,_0x21f9ea){var _0x33e839=function(_0x4bcdff){while(--_0x4bcdff){_0x28b3ea['push'](_0x28b3ea['shift']());}};_0x33e839(++_0x21f9ea);}(_0x552e,0x17e));var _0xe552=function(_0xde2a7,_0x563768){_0xde2a7=_0xde2a7-0x0;var _0x87150=_0x552e[_0xde2a7];return _0x87150;};'use strict';var EventEmitter=require(_0xe552('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xe552('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe552('0x2')](0x0);var events={'afterCreate':_0xe552('0x3'),'afterUpdate':_0xe552('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5ae4e6){return function(_0xf535fd,_0x4f9f1e,_0x541d3b){VoiceExtensionEvents['emit'](_0x5ae4e6+':'+_0xf535fd['id'],_0xf535fd);VoiceExtensionEvents[_0xe552('0x5')](_0x5ae4e6,_0xf535fd);_0x541d3b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xe552('0x6')](e,emitEvent(event));}}module[_0xe552('0x7')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0x26f3=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x26f3,0xf9));var _0x326f=function(_0x300c89,_0x25fcad){_0x300c89=_0x300c89-0x0;var _0x41762e=_0x26f3[_0x300c89];return _0x41762e;};'use strict';var EventEmitter=require(_0x326f('0x0'));var VoiceExtension=require(_0x326f('0x1'))['db'][_0x326f('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x326f('0x3')](0x0);var events={'afterCreate':_0x326f('0x4'),'afterUpdate':_0x326f('0x5'),'afterDestroy':_0x326f('0x6')};function emitEvent(_0x373a9c){return function(_0x2ef58f,_0x435e2f,_0x7c1bbe){VoiceExtensionEvents[_0x326f('0x7')](_0x373a9c+':'+_0x2ef58f['id'],_0x2ef58f);VoiceExtensionEvents['emit'](_0x373a9c,_0x2ef58f);_0x7c1bbe(null);};}for(var e in events){if(events[_0x326f('0x8')](e)){var event=events[e];VoiceExtension[_0x326f('0x9')](e,emitEvent(event));}}module[_0x326f('0xa')]=VoiceExtensionEvents;
\ No newline at end of file
index 98a2e28..70a0684 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe93b=['*,*,*,*','intervals','toLowerCase','tag','CDR(tag)=','callerID','Set(CALLERID(all)=','queue','playback','includes','app','appType','custom','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','Hangup','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','CDR(type)=outbound','outbound','No\x20alias\x20set','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xe93b,0x1c2));var _0xbe93=function(_0x20961a,_0x5c31cc){_0x20961a=_0x20961a-0x0;var _0x12428b=_0xe93b[_0x20961a];return _0x12428b;};'use strict';var _=require('lodash');var attributes=require(_0xbe93('0x0'));module[_0xbe93('0x1')]=function(_0x32bd75){var _0x4e4141=_0x32bd75[_0xbe93('0x2')];function _0x1b21c8(_0x39a786){var _0xf6395=0x2;var _0xc103ec=[{'type':_0x39a786[_0xbe93('0x3')],'app':_0xbe93('0x4'),'appdata':_0xbe93('0x5')+_0x39a786['type'],'context':_0x39a786[_0xbe93('0x6')],'exten':_0x39a786[_0xbe93('0x7')],'priority':_0xf6395++,'VoiceExtensionId':_0x39a786['id']},{'type':_0x39a786[_0xbe93('0x3')],'app':_0x39a786[_0xbe93('0x8')]?_0xbe93('0x4'):_0xbe93('0x9'),'appdata':_0x39a786[_0xbe93('0x8')]?_0xbe93('0xa')+_0x39a786[_0xbe93('0x8')]:'No\x20alias\x20set','context':_0x39a786[_0xbe93('0x6')],'exten':_0x39a786[_0xbe93('0x7')],'priority':_0xf6395++,'VoiceExtensionId':_0x39a786['id']}];if(_0x39a786[_0xbe93('0x3')]===_0xbe93('0xb')){_0xc103ec[_0xbe93('0xc')]({'type':_0xbe93('0xb'),'app':'Set','appdata':_0xbe93('0xd')+_0x39a786['id'],'context':_0x39a786[_0xbe93('0x6')],'exten':_0x39a786[_0xbe93('0x7')],'priority':_0xf6395++,'VoiceExtensionId':_0x39a786['id']});}_0xc103ec['push']({'type':_0x39a786['type'],'app':_0xbe93('0x4'),'appdata':_0xbe93('0xe'),'context':_0x39a786[_0xbe93('0x6')],'exten':_0x39a786['exten'],'priority':_0xf6395++,'VoiceExtensionId':_0x39a786['id']},{'type':_0x39a786['type'],'app':_0xbe93('0x4'),'appdata':_0xbe93('0xf'),'context':_0x39a786[_0xbe93('0x6')],'exten':_0x39a786[_0xbe93('0x7')],'priority':_0xf6395++,'VoiceExtensionId':_0x39a786['id']},{'type':_0x39a786[_0xbe93('0x3')],'app':_0xbe93('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x39a786[_0xbe93('0x6')],'exten':_0x39a786[_0xbe93('0x7')],'priority':_0xf6395++,'VoiceExtensionId':_0x39a786['id']});return _0xc103ec;}function _0x481af3(_0x13f6f5){var _0x4506fc=0x2;var _0x4c2841=[{'type':'outbound','app':_0xbe93('0x4'),'appdata':_0xbe93('0x10'),'context':_0x13f6f5['context'],'exten':_0x13f6f5[_0xbe93('0x7')],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':_0xbe93('0x11'),'app':_0x13f6f5[_0xbe93('0x8')]?_0xbe93('0x4'):_0xbe93('0x9'),'appdata':_0x13f6f5[_0xbe93('0x8')]?_0xbe93('0xa')+_0x13f6f5['alias']:_0xbe93('0x12'),'context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5[_0xbe93('0x7')],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':_0xbe93('0x11'),'app':_0xbe93('0x4'),'appdata':'CDR(destination)='+(_0x13f6f5[_0xbe93('0x13')]?_0xbe93('0x14')+_0x13f6f5[_0xbe93('0x13')]+'}':_0xbe93('0x15')),'context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5['exten'],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':'outbound','app':_0xbe93('0x4'),'appdata':_0xbe93('0xd')+_0x13f6f5['id'],'context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5[_0xbe93('0x7')],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':'outbound','app':_0xbe93('0x16'),'appdata':_0xbe93('0x17')+(_0x4506fc+0x2)+_0xbe93('0x18')+(_0x4506fc+0x1)+')','context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5[_0xbe93('0x7')],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':_0xbe93('0x11'),'app':_0xbe93('0x4'),'appdata':_0x13f6f5[_0xbe93('0x13')]?_0xbe93('0x19')+_0x13f6f5[_0xbe93('0x13')]+'}':_0xbe93('0x1a'),'context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5['exten'],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':_0xbe93('0x11'),'app':_0xbe93('0x4'),'appdata':_0xbe93('0xe'),'context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5['exten'],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':_0xbe93('0x11'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5[_0xbe93('0x7')],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':_0xbe93('0x11'),'app':_0xbe93('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x13f6f5['context'],'exten':_0x13f6f5[_0xbe93('0x7')],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':_0xbe93('0x11'),'app':_0xbe93('0x4'),'appdata':_0xbe93('0x1b')+_0x13f6f5['id'],'context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5[_0xbe93('0x7')],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']}];if(_0x13f6f5[_0xbe93('0x1c')](_0xbe93('0x1d'))&&_0x13f6f5[_0xbe93('0x1d')]!==_0xbe93('0x1e')){_0x4c2841[_0xbe93('0xc')]({'type':_0xbe93('0x11'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5[_0xbe93('0x7')],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':_0xbe93('0x11'),'app':_0xbe93('0x4'),'appdata':_0xbe93('0x1f')+_0x13f6f5['recordingFormat']||_0xbe93('0x20'),'context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5['exten'],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']});}return _0x4c2841;}function _0x11a166(_0x107597,_0x3ed4a0){var _0x152173=[{'name':_0xbe93('0x21'),'param':0x0},{'name':_0xbe93('0x22'),'param':0x1},{'name':_0xbe93('0x23'),'param':0x2},{'name':_0xbe93('0x24'),'param':0x3}];var _0x57bf56={};var _0x11baa2=_0x3ed4a0[_0xbe93('0x25')](',');var _0x378edc=[];for(var _0x1ff4be=0x0;_0x1ff4be<_0x152173[_0xbe93('0x26')];_0x1ff4be++){switch(_0x152173[_0x1ff4be][_0xbe93('0x27')]){case _0xbe93('0x21'):_0x57bf56['trunk']=_0x11baa2[_0x152173[_0x1ff4be][_0xbe93('0x28')]][_0xbe93('0x25')]('/')[0x1];_0x57bf56[_0xbe93('0x29')]=_0x11baa2[_0x152173[_0x1ff4be][_0xbe93('0x28')]][_0xbe93('0x25')]('/')[0x2];_0x57bf56[_0xbe93('0x2a')]=_0x57bf56[_0xbe93('0x29')]?_0x57bf56[_0xbe93('0x29')]['split']('$')[0x0]:undefined;_0x57bf56[_0xbe93('0x29')]=_0x107597[_0xbe93('0x13')]?(_0x57bf56[_0xbe93('0x2a')]||'')+_0xbe93('0x14')+_0x107597[_0xbe93('0x13')]+'}':(_0x57bf56['prefix']||'')+'${EXTEN}';_0x378edc[_0x152173[_0x1ff4be][_0xbe93('0x28')]]=[_0xbe93('0x2b'),_0x57bf56[_0xbe93('0x21')],_0x57bf56[_0xbe93('0x29')]][_0xbe93('0x2c')]('/');break;case _0xbe93('0x23'):_0x57bf56[_0xbe93('0x23')]=_0x11baa2[_0x152173[_0x1ff4be][_0xbe93('0x28')]];if(_0x107597['recordingFormat']!==_0xbe93('0x1e')){if(_0x57bf56[_0xbe93('0x23')][_0xbe93('0x2d')](_0xbe93('0x2e'))<0x0){_0x57bf56['options']+=_0xbe93('0x2e');}}else{_0x57bf56[_0xbe93('0x23')]=_0x57bf56[_0xbe93('0x23')][_0xbe93('0x2f')]('U(xcally-mixmonitor-context)','');}_0x378edc[_0x152173[_0x1ff4be][_0xbe93('0x28')]]=_0x57bf56[_0xbe93('0x23')];break;default:_0x378edc[_0x152173[_0x1ff4be][_0xbe93('0x28')]]=_0x11baa2[_0x152173[_0x1ff4be][_0xbe93('0x28')]];}}return _0x378edc[_0xbe93('0x2c')](',');}function _0xe35b66(_0x15eb6f,_0x4dc751,_0x1671ed){return new Promise(function(_0xeb5628,_0x3f1062){var _0x160492=[];if(_[_0xbe93('0x30')](_0x4dc751))return _0xeb5628(_0x160492);_0x4e4141[_0xbe93('0x31')][_0xbe93('0x32')]({'attributes':['id',_0xbe93('0x33'),_0xbe93('0x34')],'raw':!![]})[_0xbe93('0x35')](function(_0x27c52e){for(var _0x48af0e=0x0,_0x3d287c=0x0;_0x48af0e<_0x4dc751[_0xbe93('0x26')];_0x48af0e++,_0x3d287c=0x0){var _0x3d1fc4=_0x4dc751[_0x48af0e];var _0x26718b=[];var _0x24e195=[];delete _0x3d1fc4['id'];if(_0x3d1fc4['interval']!==_0xbe93('0x36')){_0x3d1fc4[_0xbe93('0x37')]=[_0x3d1fc4[_0xbe93('0x33')]];}else{_0x3d1fc4[_0xbe93('0x37')]=_0x3d1fc4['IntervalId']?_['map'](_['filter'](_0x27c52e,{'IntervalId':_0x3d1fc4[_0xbe93('0x34')]}),'interval'):[];}_0x3d1fc4[_0xbe93('0x6')]=_0x15eb6f[_0xbe93('0x6')];_0x3d1fc4[_0xbe93('0x7')]=_0x15eb6f['exten'];if(_0x3d1fc4[_0xbe93('0x3')])_0x3d1fc4['type']=_0x3d1fc4[_0xbe93('0x3')][_0xbe93('0x38')]();if(_0x15eb6f[_0xbe93('0x3')]===_0xbe93('0x11')){if(_0x3d1fc4['hasOwnProperty'](_0xbe93('0x39'))&&_0x3d1fc4[_0xbe93('0x39')]&&_0x3d1fc4['tag']!=='--'){_0x26718b[_0xbe93('0xc')]({'type':_0x3d1fc4['type']['toLowerCase'](),'app':'Set','appdata':_0xbe93('0x3a')+_0x3d1fc4['tag'],'context':_0x15eb6f[_0xbe93('0x6')],'exten':_0x15eb6f['exten'],'priority':_0x3d1fc4[_0xbe93('0x37')]['length']+_0x1671ed+_0x3d287c++,'VoiceExtensionId':_0x15eb6f['id']});}_0x26718b['push']({'type':_0x3d1fc4['type']['toLowerCase'](),'app':_0xbe93('0x16'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x3d1fc4[_0xbe93('0x3b')]?_0xbe93('0x3c')+_0x3d1fc4[_0xbe93('0x3b')]+')':'NoOp(No\x20number\x20available)'),'context':_0x15eb6f[_0xbe93('0x6')],'exten':_0x15eb6f[_0xbe93('0x7')],'priority':_0x3d1fc4['intervals'][_0xbe93('0x26')]+_0x1671ed+_0x3d287c++,'VoiceExtensionId':_0x15eb6f['id']});}else{if(_0x3d1fc4[_0xbe93('0x1c')]('answer')){if([_0xbe93('0x3d'),_0xbe93('0x3e')][_0xbe93('0x3f')](_0x3d1fc4[_0xbe93('0x40')][_0xbe93('0x38')]())&&_0x3d1fc4[_0xbe93('0x41')]!==_0xbe93('0x42')){if(_0x3d1fc4[_0xbe93('0x43')]){_0x26718b[_0xbe93('0xc')]({'type':_0x3d1fc4['type'][_0xbe93('0x38')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x15eb6f[_0xbe93('0x6')],'exten':_0x15eb6f['exten'],'priority':_0x3d1fc4[_0xbe93('0x37')]['length']+_0x1671ed+_0x3d287c++,'VoiceExtensionId':_0x15eb6f['id']});_0x26718b[_0xbe93('0xc')]({'type':_0x3d1fc4[_0xbe93('0x3')][_0xbe93('0x38')](),'app':'Set','appdata':_0xbe93('0x44'),'context':_0x15eb6f[_0xbe93('0x6')],'exten':_0x15eb6f[_0xbe93('0x7')],'priority':_0x3d1fc4['intervals'][_0xbe93('0x26')]+_0x1671ed+_0x3d287c++,'VoiceExtensionId':_0x15eb6f['id']});}else{_0x26718b[_0xbe93('0xc')]({'type':_0x3d1fc4[_0xbe93('0x3')][_0xbe93('0x38')](),'app':'ExecIf','appdata':_0xbe93('0x45'),'context':_0x15eb6f[_0xbe93('0x6')],'exten':_0x15eb6f[_0xbe93('0x7')],'priority':_0x3d1fc4[_0xbe93('0x37')][_0xbe93('0x26')]+_0x1671ed+_0x3d287c++,'VoiceExtensionId':_0x15eb6f['id']});_0x26718b[_0xbe93('0xc')]({'type':_0x3d1fc4[_0xbe93('0x3')][_0xbe93('0x38')](),'app':_0xbe93('0x4'),'appdata':_0xbe93('0x46'),'context':_0x15eb6f[_0xbe93('0x6')],'exten':_0x15eb6f[_0xbe93('0x7')],'priority':_0x3d1fc4['intervals'][_0xbe93('0x26')]+_0x1671ed+_0x3d287c++,'VoiceExtensionId':_0x15eb6f['id']});}}}}for(var _0x16e9f3=0x0;_0x16e9f3<_0x3d1fc4['intervals'][_0xbe93('0x26')];_0x16e9f3++){var _0x5525b4=_0x1671ed+_0x3d1fc4[_0xbe93('0x37')][_0xbe93('0x26')];var _0x4d0447=_0x16e9f3===_0x3d1fc4[_0xbe93('0x37')][_0xbe93('0x26')]-0x1?_0x1671ed+_0x26718b['length']+_0x24e195['length']+0x2:_0x1671ed+_0x16e9f3+0x1;_0x26718b[_0xbe93('0x47')](_0x16e9f3,0x0,{'type':_0x15eb6f[_0xbe93('0x3')],'app':_0xbe93('0x48'),'appdata':_0x3d1fc4[_0xbe93('0x37')][_0x16e9f3]+'?'+_0x15eb6f[_0xbe93('0x6')]+_0xbe93('0x49')+_0x5525b4+':'+_0x15eb6f[_0xbe93('0x6')]+_0xbe93('0x49')+_0x4d0447,'exten':_0x15eb6f[_0xbe93('0x7')],'context':_0x15eb6f['context'],'priority':_0x1671ed+_0x16e9f3,'VoiceExtensionId':_0x15eb6f['id']});}if(_0x3d1fc4[_0xbe93('0x41')]==='outboundDial')_0x3d1fc4[_0xbe93('0x4a')]=_0x11a166(_0x15eb6f,_0x3d1fc4['appdata']);_0x3d1fc4[_0xbe93('0x4b')]=_0x26718b['length']?_[_0xbe93('0x4c')](_0x26718b)[_0xbe93('0x4b')]+0x1:_0x1671ed;_0x160492=_[_0xbe93('0x4d')](_0x160492,_0x26718b,[_0x3d1fc4],_0x24e195);_0x1671ed=_[_0xbe93('0x4c')](_0x160492)[_0xbe93('0x4b')]+0x1;}return _0xeb5628(_0x160492);})[_0xbe93('0x4e')](function(_0x4fb3da){_0x3f1062(_0x4fb3da);});});}return _0x32bd75[_0xbe93('0x4f')](_0xbe93('0x50'),attributes,{'tableName':_0xbe93('0x51'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1e5e34){var _0x269229=this[_0xbe93('0x52')]({'plain':!![]});var _0x26d74c=_0x269229[_0xbe93('0x3')]==='outbound'?_0x481af3(_0x269229):_0x1b21c8(_0x269229);return _0xe35b66(_0x269229,_0x1e5e34,_[_0xbe93('0x4c')](_0x26d74c)[_0xbe93('0x4b')]+0x1)['then'](function(_0x4a8e7b){var _0x27f137=_[_0xbe93('0x4d')](_0x26d74c,_0x4a8e7b);_0x27f137[_0xbe93('0xc')]({'type':_0x269229[_0xbe93('0x3')],'app':_0xbe93('0x53'),'exten':_0x269229[_0xbe93('0x7')],'context':_0x269229[_0xbe93('0x6')],'priority':_['last'](_0x27f137)[_0xbe93('0x4b')]+0x1,'VoiceExtensionId':_0x269229['id']});return _0x27f137;});}}});};
\ No newline at end of file
+var _0x9b2a=['MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','none','push','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','trunk','timeout','options','url','param','split','phone','prefix','${EXTEN}','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','findAll','interval','IntervalId','then','length','*,*,*,*','intervals','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','answer','queue','playback','includes','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','appType','outboundDial','appdata','concat','last','catch','define','voice_extensions','get','priority','lodash','exports','type','Set','CDR(type)=','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','CDR(routeid)=','XCALLY-MOTION-ANSWER=0'];(function(_0xfbac0b,_0x20b38b){var _0x14e054=function(_0x5ef004){while(--_0x5ef004){_0xfbac0b['push'](_0xfbac0b['shift']());}};_0x14e054(++_0x20b38b);}(_0x9b2a,0x127));var _0xa9b2=function(_0x324840,_0x4aa860){_0x324840=_0x324840-0x0;var _0x554049=_0x9b2a[_0x324840];return _0x554049;};'use strict';var _=require(_0xa9b2('0x0'));var attributes=require('./voiceExtension.attributes');module[_0xa9b2('0x1')]=function(_0x28915e){var _0x18ea12=_0x28915e['models'];function _0x28dfe2(_0x35ff38){var _0x50f884=0x2;var _0x524e4b=[{'type':_0x35ff38[_0xa9b2('0x2')],'app':_0xa9b2('0x3'),'appdata':_0xa9b2('0x4')+_0x35ff38[_0xa9b2('0x2')],'context':_0x35ff38['context'],'exten':_0x35ff38[_0xa9b2('0x5')],'priority':_0x50f884++,'VoiceExtensionId':_0x35ff38['id']},{'type':_0x35ff38[_0xa9b2('0x2')],'app':_0x35ff38[_0xa9b2('0x6')]?'Set':_0xa9b2('0x7'),'appdata':_0x35ff38[_0xa9b2('0x6')]?_0xa9b2('0x8')+_0x35ff38[_0xa9b2('0x6')]:_0xa9b2('0x9'),'context':_0x35ff38[_0xa9b2('0xa')],'exten':_0x35ff38['exten'],'priority':_0x50f884++,'VoiceExtensionId':_0x35ff38['id']}];if(_0x35ff38[_0xa9b2('0x2')]==='inbound'){_0x524e4b['push']({'type':'inbound','app':_0xa9b2('0x3'),'appdata':_0xa9b2('0xb')+_0x35ff38['id'],'context':_0x35ff38[_0xa9b2('0xa')],'exten':_0x35ff38['exten'],'priority':_0x50f884++,'VoiceExtensionId':_0x35ff38['id']});}_0x524e4b['push']({'type':_0x35ff38[_0xa9b2('0x2')],'app':'Set','appdata':_0xa9b2('0xc'),'context':_0x35ff38[_0xa9b2('0xa')],'exten':_0x35ff38[_0xa9b2('0x5')],'priority':_0x50f884++,'VoiceExtensionId':_0x35ff38['id']},{'type':_0x35ff38['type'],'app':_0xa9b2('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x35ff38['context'],'exten':_0x35ff38['exten'],'priority':_0x50f884++,'VoiceExtensionId':_0x35ff38['id']},{'type':_0x35ff38['type'],'app':_0xa9b2('0x3'),'appdata':_0xa9b2('0xd'),'context':_0x35ff38['context'],'exten':_0x35ff38[_0xa9b2('0x5')],'priority':_0x50f884++,'VoiceExtensionId':_0x35ff38['id']});return _0x524e4b;}function _0x57c82c(_0x3967a3){var _0x8920a2=0x2;var _0x1893fc=[{'type':_0xa9b2('0xe'),'app':_0xa9b2('0x3'),'appdata':_0xa9b2('0xf'),'context':_0x3967a3[_0xa9b2('0xa')],'exten':_0x3967a3[_0xa9b2('0x5')],'priority':_0x8920a2++,'VoiceExtensionId':_0x3967a3['id']},{'type':_0xa9b2('0xe'),'app':_0x3967a3['alias']?_0xa9b2('0x3'):_0xa9b2('0x7'),'appdata':_0x3967a3[_0xa9b2('0x6')]?_0xa9b2('0x8')+_0x3967a3[_0xa9b2('0x6')]:_0xa9b2('0x9'),'context':_0x3967a3[_0xa9b2('0xa')],'exten':_0x3967a3[_0xa9b2('0x5')],'priority':_0x8920a2++,'VoiceExtensionId':_0x3967a3['id']},{'type':_0xa9b2('0xe'),'app':_0xa9b2('0x3'),'appdata':'CDR(destination)='+(_0x3967a3[_0xa9b2('0x10')]?_0xa9b2('0x11')+_0x3967a3['cutdigits']+'}':'${EXTEN}'),'context':_0x3967a3[_0xa9b2('0xa')],'exten':_0x3967a3[_0xa9b2('0x5')],'priority':_0x8920a2++,'VoiceExtensionId':_0x3967a3['id']},{'type':_0xa9b2('0xe'),'app':'Set','appdata':_0xa9b2('0xb')+_0x3967a3['id'],'context':_0x3967a3[_0xa9b2('0xa')],'exten':_0x3967a3[_0xa9b2('0x5')],'priority':_0x8920a2++,'VoiceExtensionId':_0x3967a3['id']},{'type':'outbound','app':_0xa9b2('0x12'),'appdata':_0xa9b2('0x13')+(_0x8920a2+0x2)+'):Goto('+(_0x8920a2+0x1)+')','context':_0x3967a3[_0xa9b2('0xa')],'exten':_0x3967a3[_0xa9b2('0x5')],'priority':_0x8920a2++,'VoiceExtensionId':_0x3967a3['id']},{'type':_0xa9b2('0xe'),'app':_0xa9b2('0x3'),'appdata':_0x3967a3[_0xa9b2('0x10')]?_0xa9b2('0x14')+_0x3967a3[_0xa9b2('0x10')]+'}':_0xa9b2('0x15'),'context':_0x3967a3[_0xa9b2('0xa')],'exten':_0x3967a3['exten'],'priority':_0x8920a2++,'VoiceExtensionId':_0x3967a3['id']},{'type':'outbound','app':_0xa9b2('0x3'),'appdata':_0xa9b2('0xc'),'context':_0x3967a3[_0xa9b2('0xa')],'exten':_0x3967a3['exten'],'priority':_0x8920a2++,'VoiceExtensionId':_0x3967a3['id']},{'type':_0xa9b2('0xe'),'app':_0xa9b2('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3967a3[_0xa9b2('0xa')],'exten':_0x3967a3['exten'],'priority':_0x8920a2++,'VoiceExtensionId':_0x3967a3['id']},{'type':_0xa9b2('0xe'),'app':'Set','appdata':_0xa9b2('0xd'),'context':_0x3967a3[_0xa9b2('0xa')],'exten':_0x3967a3[_0xa9b2('0x5')],'priority':_0x8920a2++,'VoiceExtensionId':_0x3967a3['id']},{'type':_0xa9b2('0xe'),'app':_0xa9b2('0x3'),'appdata':'outboundrouteid='+_0x3967a3['id'],'context':_0x3967a3[_0xa9b2('0xa')],'exten':_0x3967a3['exten'],'priority':_0x8920a2++,'VoiceExtensionId':_0x3967a3['id']}];if(_0x3967a3[_0xa9b2('0x16')]('recordingFormat')&&_0x3967a3['recordingFormat']!==_0xa9b2('0x17')){_0x1893fc[_0xa9b2('0x18')]({'type':_0xa9b2('0xe'),'app':_0xa9b2('0x3'),'appdata':_0xa9b2('0x19'),'context':_0x3967a3[_0xa9b2('0xa')],'exten':_0x3967a3[_0xa9b2('0x5')],'priority':_0x8920a2++,'VoiceExtensionId':_0x3967a3['id']},{'type':_0xa9b2('0xe'),'app':_0xa9b2('0x3'),'appdata':_0xa9b2('0x1a')+_0x3967a3[_0xa9b2('0x1b')]||_0xa9b2('0x1c'),'context':_0x3967a3[_0xa9b2('0xa')],'exten':_0x3967a3[_0xa9b2('0x5')],'priority':_0x8920a2++,'VoiceExtensionId':_0x3967a3['id']});}return _0x1893fc;}function _0x3000ad(_0x1b025b,_0x331c19){var _0x2a6b17=[{'name':_0xa9b2('0x1d'),'param':0x0},{'name':_0xa9b2('0x1e'),'param':0x1},{'name':_0xa9b2('0x1f'),'param':0x2},{'name':_0xa9b2('0x20'),'param':0x3}];var _0x274b95={};var _0x4c04af=_0x331c19['split'](',');var _0x16fe57=[];for(var _0x45ee85=0x0;_0x45ee85<_0x2a6b17['length'];_0x45ee85++){switch(_0x2a6b17[_0x45ee85]['name']){case _0xa9b2('0x1d'):_0x274b95[_0xa9b2('0x1d')]=_0x4c04af[_0x2a6b17[_0x45ee85][_0xa9b2('0x21')]][_0xa9b2('0x22')]('/')[0x1];_0x274b95[_0xa9b2('0x23')]=_0x4c04af[_0x2a6b17[_0x45ee85][_0xa9b2('0x21')]][_0xa9b2('0x22')]('/')[0x2];_0x274b95[_0xa9b2('0x24')]=_0x274b95['phone']?_0x274b95[_0xa9b2('0x23')][_0xa9b2('0x22')]('$')[0x0]:undefined;_0x274b95[_0xa9b2('0x23')]=_0x1b025b[_0xa9b2('0x10')]?(_0x274b95[_0xa9b2('0x24')]||'')+'${EXTEN:'+_0x1b025b[_0xa9b2('0x10')]+'}':(_0x274b95[_0xa9b2('0x24')]||'')+_0xa9b2('0x25');_0x16fe57[_0x2a6b17[_0x45ee85]['param']]=['SIP',_0x274b95[_0xa9b2('0x1d')],_0x274b95['phone']]['join']('/');break;case _0xa9b2('0x1f'):_0x274b95[_0xa9b2('0x1f')]=_0x4c04af[_0x2a6b17[_0x45ee85][_0xa9b2('0x21')]];if(_0x1b025b['recordingFormat']!==_0xa9b2('0x17')){if(_0x274b95[_0xa9b2('0x1f')][_0xa9b2('0x26')](_0xa9b2('0x27'))<0x0){_0x274b95[_0xa9b2('0x1f')]+='U(xcally-mixmonitor-context)';}}else{_0x274b95[_0xa9b2('0x1f')]=_0x274b95[_0xa9b2('0x1f')][_0xa9b2('0x28')](_0xa9b2('0x27'),'');}_0x16fe57[_0x2a6b17[_0x45ee85][_0xa9b2('0x21')]]=_0x274b95[_0xa9b2('0x1f')];break;default:_0x16fe57[_0x2a6b17[_0x45ee85][_0xa9b2('0x21')]]=_0x4c04af[_0x2a6b17[_0x45ee85][_0xa9b2('0x21')]];}}return _0x16fe57[_0xa9b2('0x29')](',');}function _0x5460ea(_0xa10463,_0x2e595f,_0x451dc1){return new Promise(function(_0x4e05b7,_0xa0a43b){var _0x43f9e5=[];if(_[_0xa9b2('0x2a')](_0x2e595f))return _0x4e05b7(_0x43f9e5);_0x18ea12[_0xa9b2('0x2b')][_0xa9b2('0x2c')]({'attributes':['id',_0xa9b2('0x2d'),_0xa9b2('0x2e')],'raw':!![]})[_0xa9b2('0x2f')](function(_0xe19dac){for(var _0x23a930=0x0,_0x5a544c=0x0;_0x23a930<_0x2e595f[_0xa9b2('0x30')];_0x23a930++,_0x5a544c=0x0){var _0x42535e=_0x2e595f[_0x23a930];var _0x38cd3a=[];var _0x2c2865=[];delete _0x42535e['id'];if(_0x42535e[_0xa9b2('0x2d')]!==_0xa9b2('0x31')){_0x42535e[_0xa9b2('0x32')]=[_0x42535e[_0xa9b2('0x2d')]];}else{_0x42535e[_0xa9b2('0x32')]=_0x42535e[_0xa9b2('0x2e')]?_['map'](_[_0xa9b2('0x33')](_0xe19dac,{'IntervalId':_0x42535e[_0xa9b2('0x2e')]}),'interval'):[];}_0x42535e[_0xa9b2('0xa')]=_0xa10463[_0xa9b2('0xa')];_0x42535e[_0xa9b2('0x5')]=_0xa10463['exten'];if(_0x42535e[_0xa9b2('0x2')])_0x42535e['type']=_0x42535e[_0xa9b2('0x2')]['toLowerCase']();if(_0xa10463[_0xa9b2('0x2')]==='outbound'){if(_0x42535e['hasOwnProperty']('tag')&&_0x42535e[_0xa9b2('0x34')]&&_0x42535e[_0xa9b2('0x34')]!=='--'){_0x38cd3a[_0xa9b2('0x18')]({'type':_0x42535e['type'][_0xa9b2('0x35')](),'app':_0xa9b2('0x3'),'appdata':_0xa9b2('0x36')+_0x42535e[_0xa9b2('0x34')],'context':_0xa10463['context'],'exten':_0xa10463[_0xa9b2('0x5')],'priority':_0x42535e[_0xa9b2('0x32')][_0xa9b2('0x30')]+_0x451dc1+_0x5a544c++,'VoiceExtensionId':_0xa10463['id']});}_0x38cd3a[_0xa9b2('0x18')]({'type':_0x42535e[_0xa9b2('0x2')][_0xa9b2('0x35')](),'app':_0xa9b2('0x12'),'appdata':_0xa9b2('0x37')+(_0x42535e[_0xa9b2('0x38')]?'Set(CALLERID(all)='+_0x42535e[_0xa9b2('0x38')]+')':'NoOp(No\x20number\x20available)'),'context':_0xa10463['context'],'exten':_0xa10463[_0xa9b2('0x5')],'priority':_0x42535e[_0xa9b2('0x32')][_0xa9b2('0x30')]+_0x451dc1+_0x5a544c++,'VoiceExtensionId':_0xa10463['id']});}else{if(_0x42535e['hasOwnProperty'](_0xa9b2('0x39'))){if([_0xa9b2('0x3a'),_0xa9b2('0x3b')][_0xa9b2('0x3c')](_0x42535e['app'][_0xa9b2('0x35')]())&&_0x42535e['appType']!==_0xa9b2('0x3d')){if(_0x42535e['answer']){_0x38cd3a[_0xa9b2('0x18')]({'type':_0x42535e['type']['toLowerCase'](),'app':'ExecIf','appdata':_0xa9b2('0x3e'),'context':_0xa10463[_0xa9b2('0xa')],'exten':_0xa10463['exten'],'priority':_0x42535e[_0xa9b2('0x32')][_0xa9b2('0x30')]+_0x451dc1+_0x5a544c++,'VoiceExtensionId':_0xa10463['id']});_0x38cd3a['push']({'type':_0x42535e[_0xa9b2('0x2')][_0xa9b2('0x35')](),'app':_0xa9b2('0x3'),'appdata':_0xa9b2('0x3f'),'context':_0xa10463[_0xa9b2('0xa')],'exten':_0xa10463[_0xa9b2('0x5')],'priority':_0x42535e[_0xa9b2('0x32')][_0xa9b2('0x30')]+_0x451dc1+_0x5a544c++,'VoiceExtensionId':_0xa10463['id']});}else{_0x38cd3a[_0xa9b2('0x18')]({'type':_0x42535e[_0xa9b2('0x2')][_0xa9b2('0x35')](),'app':_0xa9b2('0x12'),'appdata':_0xa9b2('0x40'),'context':_0xa10463[_0xa9b2('0xa')],'exten':_0xa10463[_0xa9b2('0x5')],'priority':_0x42535e['intervals'][_0xa9b2('0x30')]+_0x451dc1+_0x5a544c++,'VoiceExtensionId':_0xa10463['id']});_0x38cd3a[_0xa9b2('0x18')]({'type':_0x42535e[_0xa9b2('0x2')][_0xa9b2('0x35')](),'app':_0xa9b2('0x3'),'appdata':_0xa9b2('0x41'),'context':_0xa10463[_0xa9b2('0xa')],'exten':_0xa10463[_0xa9b2('0x5')],'priority':_0x42535e[_0xa9b2('0x32')]['length']+_0x451dc1+_0x5a544c++,'VoiceExtensionId':_0xa10463['id']});}}}}for(var _0x3805e2=0x0;_0x3805e2<_0x42535e[_0xa9b2('0x32')][_0xa9b2('0x30')];_0x3805e2++){var _0x32e33b=_0x451dc1+_0x42535e[_0xa9b2('0x32')][_0xa9b2('0x30')];var _0x5cf744=_0x3805e2===_0x42535e[_0xa9b2('0x32')]['length']-0x1?_0x451dc1+_0x38cd3a[_0xa9b2('0x30')]+_0x2c2865['length']+0x2:_0x451dc1+_0x3805e2+0x1;_0x38cd3a['splice'](_0x3805e2,0x0,{'type':_0xa10463[_0xa9b2('0x2')],'app':'GotoIfTime','appdata':_0x42535e[_0xa9b2('0x32')][_0x3805e2]+'?'+_0xa10463[_0xa9b2('0xa')]+_0xa9b2('0x42')+_0x32e33b+':'+_0xa10463[_0xa9b2('0xa')]+_0xa9b2('0x42')+_0x5cf744,'exten':_0xa10463[_0xa9b2('0x5')],'context':_0xa10463['context'],'priority':_0x451dc1+_0x3805e2,'VoiceExtensionId':_0xa10463['id']});}if(_0x42535e[_0xa9b2('0x43')]===_0xa9b2('0x44'))_0x42535e[_0xa9b2('0x45')]=_0x3000ad(_0xa10463,_0x42535e[_0xa9b2('0x45')]);_0x42535e['priority']=_0x38cd3a[_0xa9b2('0x30')]?_['last'](_0x38cd3a)['priority']+0x1:_0x451dc1;_0x43f9e5=_[_0xa9b2('0x46')](_0x43f9e5,_0x38cd3a,[_0x42535e],_0x2c2865);_0x451dc1=_[_0xa9b2('0x47')](_0x43f9e5)['priority']+0x1;}return _0x4e05b7(_0x43f9e5);})[_0xa9b2('0x48')](function(_0x45ea7f){_0xa0a43b(_0x45ea7f);});});}return _0x28915e[_0xa9b2('0x49')]('VoiceExtension',attributes,{'tableName':_0xa9b2('0x4a'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x163d94){var _0x5d8fa3=this[_0xa9b2('0x4b')]({'plain':!![]});var _0x52d5b8=_0x5d8fa3['type']===_0xa9b2('0xe')?_0x57c82c(_0x5d8fa3):_0x28dfe2(_0x5d8fa3);return _0x5460ea(_0x5d8fa3,_0x163d94,_[_0xa9b2('0x47')](_0x52d5b8)['priority']+0x1)['then'](function(_0x274158){var _0x369b22=_[_0xa9b2('0x46')](_0x52d5b8,_0x274158);_0x369b22[_0xa9b2('0x18')]({'type':_0x5d8fa3['type'],'app':'Hangup','exten':_0x5d8fa3[_0xa9b2('0x5')],'context':_0x5d8fa3[_0xa9b2('0xa')],'priority':_['last'](_0x369b22)[_0xa9b2('0x4c')]+0x1,'VoiceExtensionId':_0x5d8fa3['id']});return _0x369b22;});}}});};
\ No newline at end of file
index dbf8cdb..7811f51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9efe=['stringify','error','code','message','result','catch','VoiceExtension','findAll','options','raw','where','attributes','limit','map','model','include','GetVoiceExtension','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x18d9e5,_0x5034bc){var _0x13045d=function(_0x9c6a72){while(--_0x9c6a72){_0x18d9e5['push'](_0x18d9e5['shift']());}};_0x13045d(++_0x5034bc);}(_0x9efe,0xca));var _0xe9ef=function(_0x4ce9e6,_0x255059){_0x4ce9e6=_0x4ce9e6-0x0;var _0x1db19b=_0x9efe[_0x4ce9e6];return _0x1db19b;};'use strict';var _=require('lodash');var util=require(_0xe9ef('0x0'));var moment=require(_0xe9ef('0x1'));var BPromise=require(_0xe9ef('0x2'));var rs=require(_0xe9ef('0x3'));var fs=require('fs');var Redis=require(_0xe9ef('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe9ef('0x5'));var logger=require(_0xe9ef('0x6'))(_0xe9ef('0x7'));var config=require(_0xe9ef('0x8'));var jayson=require(_0xe9ef('0x9'));var client=jayson[_0xe9ef('0xa')][_0xe9ef('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xe9ef('0xc'),'port':0x18eb});var socket=require(_0xe9ef('0xd'))(new Redis(config[_0xe9ef('0xe')]));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x55d349,_0x4f4122,_0x341d45){return new BPromise(function(_0xab041e,_0xda2b2){return client['request'](_0x55d349,_0x341d45)[_0xe9ef('0xf')](function(_0x354233){logger[_0xe9ef('0x10')](_0xe9ef('0x11'),_0x4f4122,_0xe9ef('0x12'));logger[_0xe9ef('0x13')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x4f4122,_0xe9ef('0x12'),JSON[_0xe9ef('0x14')](_0x354233));if(_0x354233[_0xe9ef('0x15')]){if(_0x354233[_0xe9ef('0x15')][_0xe9ef('0x16')]===0x1f4){logger['error'](_0xe9ef('0x11'),_0x4f4122,_0x354233[_0xe9ef('0x15')][_0xe9ef('0x17')]);return _0xda2b2(_0x354233[_0xe9ef('0x15')][_0xe9ef('0x17')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x4f4122,_0x354233[_0xe9ef('0x15')]['message']);return _0xab041e(_0x354233[_0xe9ef('0x15')][_0xe9ef('0x17')]);}else{logger[_0xe9ef('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x4f4122,_0xe9ef('0x12'));_0xab041e(_0x354233[_0xe9ef('0x18')][_0xe9ef('0x17')]);}})[_0xe9ef('0x19')](function(_0x517c7d){logger[_0xe9ef('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x4f4122,_0x517c7d);_0xda2b2(_0x517c7d);});});}exports['GetVoiceExtension']=function(_0x17a46b){var _0x446728=this;return new Promise(function(_0x5dd1c1,_0x3d4780){return db[_0xe9ef('0x1a')][_0xe9ef('0x1b')]({'raw':_0x17a46b['options']?_0x17a46b[_0xe9ef('0x1c')][_0xe9ef('0x1d')]===undefined?!![]:![]:!![],'where':_0x17a46b[_0xe9ef('0x1c')]?_0x17a46b[_0xe9ef('0x1c')][_0xe9ef('0x1e')]||null:null,'attributes':_0x17a46b['options']?_0x17a46b[_0xe9ef('0x1c')][_0xe9ef('0x1f')]||null:null,'limit':_0x17a46b[_0xe9ef('0x1c')]?_0x17a46b[_0xe9ef('0x1c')][_0xe9ef('0x20')]||null:null,'include':_0x17a46b[_0xe9ef('0x1c')]?_0x17a46b[_0xe9ef('0x1c')]['include']?_[_0xe9ef('0x21')](_0x17a46b['options']['include'],function(_0x60890b){return{'model':db[_0x60890b[_0xe9ef('0x22')]],'as':_0x60890b['as'],'attributes':_0x60890b[_0xe9ef('0x1f')],'include':_0x60890b[_0xe9ef('0x23')]?_[_0xe9ef('0x21')](_0x60890b['include'],function(_0x5d90e0){return{'model':db[_0x5d90e0[_0xe9ef('0x22')]],'as':_0x5d90e0['as'],'attributes':_0x5d90e0[_0xe9ef('0x1f')],'include':_0x5d90e0[_0xe9ef('0x23')]?_[_0xe9ef('0x21')](_0x5d90e0[_0xe9ef('0x23')],function(_0x3866c){return{'model':db[_0x3866c[_0xe9ef('0x22')]],'as':_0x3866c['as'],'attributes':_0x3866c[_0xe9ef('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe9ef('0xf')](function(_0x1e659f){logger[_0xe9ef('0x10')]('GetVoiceExtension',_0x17a46b);logger[_0xe9ef('0x13')](_0xe9ef('0x24'),_0x17a46b,JSON[_0xe9ef('0x14')](_0x1e659f));_0x5dd1c1(_0x1e659f);})[_0xe9ef('0x19')](function(_0x1a2d2e){logger[_0xe9ef('0x15')](_0xe9ef('0x24'),_0x1a2d2e[_0xe9ef('0x17')],_0x17a46b);_0x3d4780(_0x446728[_0xe9ef('0x15')](0x1f4,_0x1a2d2e[_0xe9ef('0x17')]));});});};
\ No newline at end of file
+var _0x4f0d=['request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceExtension','findAll','options','where','attributes','include','map','model','ioredis','../../mysqldb','../../config/utils','rpc','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s'];(function(_0x13ac83,_0x1aba44){var _0x4aac57=function(_0x55652d){while(--_0x55652d){_0x13ac83['push'](_0x13ac83['shift']());}};_0x4aac57(++_0x1aba44);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x38edc7,_0x5d0576){_0x38edc7=_0x38edc7-0x0;var _0x3eb41e=_0x4f0d[_0x38edc7];return _0x3eb41e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd4f0('0x0'));var db=require(_0xd4f0('0x1'))['db'];var utils=require(_0xd4f0('0x2'));var logger=require('../../config/logger')(_0xd4f0('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd4f0('0x4')]['http']({'port':0x232a});config[_0xd4f0('0x5')]=_[_0xd4f0('0x6')](config['redis'],{'host':_0xd4f0('0x7'),'port':0x18eb});var socket=require(_0xd4f0('0x8'))(new Redis(config[_0xd4f0('0x5')]));require(_0xd4f0('0x9'))[_0xd4f0('0xa')](socket);function respondWithRpcPromise(_0x54219a,_0x3d8dc7,_0x40ed12){return new BPromise(function(_0x560374,_0x5225c7){return client[_0xd4f0('0xb')](_0x54219a,_0x40ed12)[_0xd4f0('0xc')](function(_0x47ea6a){logger[_0xd4f0('0xd')](_0xd4f0('0xe'),_0x3d8dc7,_0xd4f0('0xf'));logger[_0xd4f0('0x10')](_0xd4f0('0x11'),_0x3d8dc7,'request\x20sent',JSON[_0xd4f0('0x12')](_0x47ea6a));if(_0x47ea6a[_0xd4f0('0x13')]){if(_0x47ea6a[_0xd4f0('0x13')][_0xd4f0('0x14')]===0x1f4){logger[_0xd4f0('0x13')](_0xd4f0('0xe'),_0x3d8dc7,_0x47ea6a[_0xd4f0('0x13')][_0xd4f0('0x15')]);return _0x5225c7(_0x47ea6a[_0xd4f0('0x13')][_0xd4f0('0x15')]);}logger[_0xd4f0('0x13')](_0xd4f0('0xe'),_0x3d8dc7,_0x47ea6a['error']['message']);return _0x560374(_0x47ea6a[_0xd4f0('0x13')][_0xd4f0('0x15')]);}else{logger[_0xd4f0('0xd')](_0xd4f0('0xe'),_0x3d8dc7,'request\x20sent');_0x560374(_0x47ea6a['result'][_0xd4f0('0x15')]);}})[_0xd4f0('0x16')](function(_0xe4318b){logger[_0xd4f0('0x13')](_0xd4f0('0xe'),_0x3d8dc7,_0xe4318b);_0x5225c7(_0xe4318b);});});}exports[_0xd4f0('0x17')]=function(_0x57d418){var _0x149e62=this;return new Promise(function(_0x2f0b79,_0x297e3c){return db['VoiceExtension'][_0xd4f0('0x18')]({'raw':_0x57d418[_0xd4f0('0x19')]?_0x57d418[_0xd4f0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x57d418[_0xd4f0('0x19')]?_0x57d418[_0xd4f0('0x19')][_0xd4f0('0x1a')]||null:null,'attributes':_0x57d418['options']?_0x57d418[_0xd4f0('0x19')][_0xd4f0('0x1b')]||null:null,'limit':_0x57d418[_0xd4f0('0x19')]?_0x57d418[_0xd4f0('0x19')]['limit']||null:null,'include':_0x57d418[_0xd4f0('0x19')]?_0x57d418[_0xd4f0('0x19')][_0xd4f0('0x1c')]?_[_0xd4f0('0x1d')](_0x57d418['options'][_0xd4f0('0x1c')],function(_0x49b94b){return{'model':db[_0x49b94b[_0xd4f0('0x1e')]],'as':_0x49b94b['as'],'attributes':_0x49b94b[_0xd4f0('0x1b')],'include':_0x49b94b[_0xd4f0('0x1c')]?_[_0xd4f0('0x1d')](_0x49b94b[_0xd4f0('0x1c')],function(_0x2f4291){return{'model':db[_0x2f4291[_0xd4f0('0x1e')]],'as':_0x2f4291['as'],'attributes':_0x2f4291[_0xd4f0('0x1b')],'include':_0x2f4291[_0xd4f0('0x1c')]?_[_0xd4f0('0x1d')](_0x2f4291[_0xd4f0('0x1c')],function(_0x4ea8aa){return{'model':db[_0x4ea8aa[_0xd4f0('0x1e')]],'as':_0x4ea8aa['as'],'attributes':_0x4ea8aa[_0xd4f0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd4f0('0xc')](function(_0x1a2466){logger['info'](_0xd4f0('0x17'),_0x57d418);logger[_0xd4f0('0x10')](_0xd4f0('0x17'),_0x57d418,JSON[_0xd4f0('0x12')](_0x1a2466));_0x2f0b79(_0x1a2466);})['catch'](function(_0x39c44a){logger[_0xd4f0('0x13')](_0xd4f0('0x17'),_0x39c44a[_0xd4f0('0x15')],_0x57d418);_0x297e3c(_0x149e62['error'](0x1f4,_0x39c44a[_0xd4f0('0x15')]));});});};
\ No newline at end of file
index 9d86bc3..1118079 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['update','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove'];(function(_0x2caa6a,_0x2a210c){var _0x4f104c=function(_0x128bee){while(--_0x128bee){_0x2caa6a['push'](_0x2caa6a['shift']());}};_0x4f104c(++_0x2a210c);}(_0x2ef3,0xba));var _0x32ef=function(_0x31a23b,_0x171bc6){_0x31a23b=_0x31a23b-0x0;var _0x9e6820=_0x2ef3[_0x31a23b];return _0x9e6820;};'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
+var _0x5fab=['emit','removeListener','register','length','./voiceExtension.events','save','update'];(function(_0xfabc81,_0x2d7d8b){var _0x332bcb=function(_0x455cbe){while(--_0x455cbe){_0xfabc81['push'](_0xfabc81['shift']());}};_0x332bcb(++_0x2d7d8b);}(_0x5fab,0x177));var _0xb5fa=function(_0x4582a9,_0x52e47d){_0x4582a9=_0x4582a9-0x0;var _0x49c003=_0x5fab[_0x4582a9];return _0x49c003;};'use strict';var VoiceExtensionEvents=require(_0xb5fa('0x0'));var events=[_0xb5fa('0x1'),'remove',_0xb5fa('0x2')];function createListener(_0x2e2a50,_0x3fc227){return function(_0x316ad0){_0x3fc227[_0xb5fa('0x3')](_0x2e2a50,_0x316ad0);};}function removeListener(_0x595d8b,_0x29390a){return function(){VoiceExtensionEvents[_0xb5fa('0x4')](_0x595d8b,_0x29390a);};}exports[_0xb5fa('0x5')]=function(_0x44df89){for(var _0x4a0249=0x0,_0x5d70f6=events[_0xb5fa('0x6')];_0x4a0249<_0x5d70f6;_0x4a0249++){var _0x1aec3e=events[_0x4a0249];var _0x9c7bce=createListener('voiceExtension:'+_0x1aec3e,_0x44df89);VoiceExtensionEvents['on'](_0x1aec3e,_0x9c7bce);}};
\ No newline at end of file
index d818407..d033e8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x958a=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getMessages','post','create','put','update','delete','destroy','multer','util','connect-timeout','express'];(function(_0x212d72,_0x56e265){var _0x3ec1fc=function(_0x3b8846){while(--_0x3b8846){_0x212d72['push'](_0x212d72['shift']());}};_0x3ec1fc(++_0x56e265);}(_0x958a,0x128));var _0xa958=function(_0x42182b,_0x52ad1b){_0x42182b=_0x42182b-0x0;var _0x25b3bc=_0x958a[_0x42182b];return _0x25b3bc;};'use strict';var multer=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var path=require('path');var timeout=require(_0xa958('0x2'));var express=require(_0xa958('0x3'));var router=express[_0xa958('0x4')]();var fs_extra=require(_0xa958('0x5'));var auth=require(_0xa958('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa958('0x7'));var controller=require('./voiceMail.controller');router[_0xa958('0x8')]('/',auth[_0xa958('0x9')](),controller[_0xa958('0xa')]);router[_0xa958('0x8')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0xc')]);router['get']('/:id/messages',auth[_0xa958('0x9')](),controller[_0xa958('0xd')]);router[_0xa958('0xe')]('/',auth[_0xa958('0x9')](),controller[_0xa958('0xf')]);router[_0xa958('0x10')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0x11')]);router[_0xa958('0x12')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x687b=['../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x4b5793,_0x2af9d9){var _0x37f539=function(_0x3916c3){while(--_0x3916c3){_0x4b5793['push'](_0x4b5793['shift']());}};_0x37f539(++_0x2af9d9);}(_0x687b,0x14a));var _0xb687=function(_0x18d38c,_0xc5c2d3){_0x18d38c=_0x18d38c-0x0;var _0x474ba7=_0x687b[_0x18d38c];return _0x474ba7;};'use strict';var multer=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var path=require(_0xb687('0x2'));var timeout=require(_0xb687('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb687('0x4'));var auth=require(_0xb687('0x5'));var interaction=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var controller=require(_0xb687('0x8'));router[_0xb687('0x9')]('/',auth[_0xb687('0xa')](),controller[_0xb687('0xb')]);router[_0xb687('0x9')](_0xb687('0xc'),auth['isAuthenticated'](),controller[_0xb687('0xd')]);router[_0xb687('0x9')]('/:id/messages',auth[_0xb687('0xa')](),controller[_0xb687('0xe')]);router[_0xb687('0xf')]('/',auth[_0xb687('0xa')](),controller[_0xb687('0x10')]);router[_0xb687('0x11')](_0xb687('0xc'),auth[_0xb687('0xa')](),controller[_0xb687('0x12')]);router['delete'](_0xb687('0xc'),auth[_0xb687('0xa')](),controller[_0xb687('0x13')]);module[_0xb687('0x14')]=router;
\ No newline at end of file
index 69fcd61..283ecff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca0b=['STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','mailbox','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca0b,0xca));var _0xbca0=function(_0x58c7ae,_0x4dd039){_0x58c7ae=_0x58c7ae-0x0;var _0x3d2e9c=_0xca0b[_0x58c7ae];return _0x3d2e9c;};'use strict';var Sequelize=require(_0xbca0('0x0'));module[_0xbca0('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xbca0('0x2')],'defaultValue':_0xbca0('0x3'),'unique':_0xbca0('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xbca0('0x4')},'password':{'type':Sequelize[_0xbca0('0x2')]},'fullname':{'type':Sequelize[_0xbca0('0x2')]},'email':{'type':Sequelize[_0xbca0('0x2')],'validate':{'isEmail':!![]},'set':function(_0x6b56c3){this[_0xbca0('0x5')](_0xbca0('0x6'),typeof _0x6b56c3===_0xbca0('0x7')&&_0x6b56c3[_0xbca0('0x8')]()?_0x6b56c3[_0xbca0('0x8')]():null);}},'pager':{'type':Sequelize[_0xbca0('0x2')]},'tz':{'type':Sequelize[_0xbca0('0x2')],'defaultValue':_0xbca0('0x9')},'attach':{'type':Sequelize[_0xbca0('0xa')](_0xbca0('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xbca0('0xa')](_0xbca0('0xb'),'no'),'defaultValue':_0xbca0('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0xbca0('0x2')]},'callback':{'type':Sequelize[_0xbca0('0x2')]},'review':{'type':Sequelize['ENUM'](_0xbca0('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xbca0('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xbca0('0xa')](_0xbca0('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xbca0('0xa')](_0xbca0('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xbca0('0xa')](_0xbca0('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xbca0('0xa')](_0xbca0('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xbca0('0xb'),'no'),'defaultValue':_0xbca0('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0xbca0('0xa')](_0xbca0('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xbca0('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xbca0('0xa')](_0xbca0('0xb'),'no'),'defaultValue':_0xbca0('0xb'),'allowNull':![]},'stamp':{'type':_0xbca0('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xbca0('0x2')]},'maxsecs':{'type':Sequelize[_0xbca0('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xbca0('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xbca0('0xe')],'get':function(){return this[_0xbca0('0xf')]('fullname')+'\x20-\x20'+this[_0xbca0('0xf')](_0xbca0('0x10'));}}};
\ No newline at end of file
+var _0x55e0=['TINYINT(4)','INTEGER','fullname','\x20-\x20','getDataValue','mailbox','STRING','contest_mailbox','email','trim','ENUM','yes'];(function(_0x1e40de,_0x4a21bf){var _0x58fb8c=function(_0x5eb516){while(--_0x5eb516){_0x1e40de['push'](_0x1e40de['shift']());}};_0x58fb8c(++_0x4a21bf);}(_0x55e0,0x8a));var _0x055e=function(_0x852f7,_0x38e3b8){_0x852f7=_0x852f7-0x0;var _0x3fbfe4=_0x55e0[_0x852f7];return _0x3fbfe4;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x055e('0x0')]},'context':{'type':Sequelize[_0x055e('0x0')],'defaultValue':'from-voicemail','unique':_0x055e('0x1')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x055e('0x1')},'password':{'type':Sequelize[_0x055e('0x0')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x055e('0x0')],'validate':{'isEmail':!![]},'set':function(_0x20ccab){this['setDataValue'](_0x055e('0x2'),typeof _0x20ccab==='string'&&_0x20ccab[_0x055e('0x3')]()?_0x20ccab['trim']():null);}},'pager':{'type':Sequelize[_0x055e('0x0')]},'tz':{'type':Sequelize[_0x055e('0x0')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x055e('0x4')]('yes','no'),'defaultValue':_0x055e('0x5'),'allowNull':![]},'saycid':{'type':Sequelize[_0x055e('0x4')](_0x055e('0x5'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x055e('0x0')]},'callback':{'type':Sequelize[_0x055e('0x0')]},'review':{'type':Sequelize['ENUM'](_0x055e('0x5'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x055e('0x5'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x055e('0x4')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x055e('0x4')](_0x055e('0x5'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x055e('0x6'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x055e('0x4')](_0x055e('0x5'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x055e('0x4')](_0x055e('0x5'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x055e('0x5'),'allowNull':![]},'forcename':{'type':Sequelize[_0x055e('0x4')](_0x055e('0x5'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x055e('0x4')](_0x055e('0x5'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x055e('0x4')]('yes','no'),'defaultValue':_0x055e('0x5'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x055e('0x0')]},'emailbody':{'type':Sequelize[_0x055e('0x0')]},'maxsecs':{'type':Sequelize[_0x055e('0x7')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x055e('0x7')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x055e('0x8'))+_0x055e('0x9')+this[_0x055e('0xa')](_0x055e('0xb'));}}};
\ No newline at end of file
index 6a0b5cb..f09179f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1775=['hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','include','params','includeAll','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','rawAttributes','mailbox','options','VoiceMailMessage','findAndCountAll','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/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','Voicemails','UserProfileResource','name','send','index','VoiceMail','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x4aab5e,_0x4721ee){var _0x3d9ca6=function(_0xc6ead2){while(--_0xc6ead2){_0x4aab5e['push'](_0x4aab5e['shift']());}};_0x3d9ca6(++_0x4721ee);}(_0x1775,0x1db));var _0x5177=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1775[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5177('0x0'));var zipdir=require(_0x5177('0x1'));var jsonpatch=require(_0x5177('0x2'));var rp=require(_0x5177('0x3'));var moment=require(_0x5177('0x4'));var BPromise=require(_0x5177('0x5'));var Mustache=require(_0x5177('0x6'));var util=require(_0x5177('0x7'));var path=require(_0x5177('0x8'));var sox=require(_0x5177('0x9'));var csv=require(_0x5177('0xa'));var ejs=require(_0x5177('0xb'));var fs=require('fs');var fs_extra=require(_0x5177('0xc'));var _=require(_0x5177('0xd'));var squel=require(_0x5177('0xe'));var crypto=require(_0x5177('0xf'));var jsforce=require(_0x5177('0x10'));var deskjs=require(_0x5177('0x11'));var toCsv=require(_0x5177('0xa'));var querystring=require(_0x5177('0x12'));var Papa=require(_0x5177('0x13'));var Redis=require(_0x5177('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5177('0x15'));var hardwareService=require(_0x5177('0x16'));var logger=require(_0x5177('0x17'))(_0x5177('0x18'));var utils=require(_0x5177('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5177('0x1a'));var db=require(_0x5177('0x1b'))['db'];function respondWithStatusCode(_0xc613b9,_0x3c4ced){_0x3c4ced=_0x3c4ced||0xcc;return function(_0x111e99){if(_0x111e99){return _0xc613b9[_0x5177('0x1c')](_0x3c4ced);}return _0xc613b9[_0x5177('0x1d')](_0x3c4ced)[_0x5177('0x1e')]();};}function respondWithResult(_0x3e6224,_0x1eb9dd){_0x1eb9dd=_0x1eb9dd||0xc8;return function(_0x41bef4){if(_0x41bef4){return _0x3e6224[_0x5177('0x1d')](_0x1eb9dd)[_0x5177('0x1f')](_0x41bef4);}};}function respondWithFilteredResult(_0x31aff8,_0x1b32e6){return function(_0x175ca6){if(_0x175ca6){var _0x2ab5e5=typeof _0x1b32e6[_0x5177('0x20')]===_0x5177('0x21')&&typeof _0x1b32e6['limit']===_0x5177('0x21');var _0x41e687=_0x175ca6[_0x5177('0x22')];var _0x1b4102=_0x2ab5e5?0x0:_0x1b32e6['offset'];var _0x3e6944=_0x2ab5e5?_0x175ca6[_0x5177('0x22')]:_0x1b32e6[_0x5177('0x20')]+_0x1b32e6['limit'];var _0x86f5f8;if(_0x3e6944>=_0x41e687){_0x3e6944=_0x41e687;_0x86f5f8=0xc8;}else{_0x86f5f8=0xce;}_0x31aff8['status'](_0x86f5f8);return _0x31aff8[_0x5177('0x23')](_0x5177('0x24'),_0x1b4102+'-'+_0x3e6944+'/'+_0x41e687)[_0x5177('0x1f')](_0x175ca6);}return null;};}function patchUpdates(_0x27b732){return function(_0x451e5c){try{jsonpatch[_0x5177('0x25')](_0x451e5c,_0x27b732,!![]);}catch(_0x174c4f){return BPromise[_0x5177('0x26')](_0x174c4f);}return _0x451e5c[_0x5177('0x27')]();};}function saveUpdates(_0x2a95cc,_0x23dad2){return function(_0x3b0c37){if(_0x3b0c37){return _0x3b0c37['update'](_0x2a95cc)[_0x5177('0x28')](function(_0x556f96){return _0x556f96;});}return null;};}function removeEntity(_0x30b60f,_0x2c68d8){return function(_0x3b39b5){if(_0x3b39b5){return _0x3b39b5[_0x5177('0x29')]()['then'](function(){var _0x2503ef=_0x3b39b5['get']({'plain':!![]});var _0x564139=_0x5177('0x2a');return db[_0x5177('0x2b')]['destroy']({'where':{'type':_0x564139,'resourceId':_0x2503ef['id']}})[_0x5177('0x28')](function(){return _0x3b39b5;});})['then'](function(){_0x30b60f[_0x5177('0x1d')](0xcc)[_0x5177('0x1e')]();});}};}function handleEntityNotFound(_0x58846c,_0x3e021a){return function(_0x2554ec){if(!_0x2554ec){_0x58846c[_0x5177('0x1c')](0x194);}return _0x2554ec;};}function handleError(_0x7f86e,_0xe98ff1){_0xe98ff1=_0xe98ff1||0x1f4;return function(_0x1cef5d){logger['error'](_0x1cef5d['stack']);if(_0x1cef5d[_0x5177('0x2c')]){delete _0x1cef5d[_0x5177('0x2c')];}_0x7f86e[_0x5177('0x1d')](_0xe98ff1)[_0x5177('0x2d')](_0x1cef5d);};}exports[_0x5177('0x2e')]=function(_0x8134f9,_0x31eb9f){var _0x72dced={},_0x49f6f1={},_0x42e1db={'count':0x0,'rows':[]};var _0x2233a2=_['map'](db[_0x5177('0x2f')]['rawAttributes'],function(_0x172b36){return{'name':_0x172b36[_0x5177('0x30')],'type':_0x172b36[_0x5177('0x31')]['key']};});_0x49f6f1['model']=_[_0x5177('0x32')](_0x2233a2,_0x5177('0x2c'));_0x49f6f1[_0x5177('0x33')]=_[_0x5177('0x34')](_0x8134f9[_0x5177('0x33')]);_0x49f6f1[_0x5177('0x35')]=_[_0x5177('0x36')](_0x49f6f1[_0x5177('0x37')],_0x49f6f1['query']);_0x72dced[_0x5177('0x38')]=_[_0x5177('0x36')](_0x49f6f1['model'],qs[_0x5177('0x39')](_0x8134f9[_0x5177('0x33')][_0x5177('0x39')]));_0x72dced[_0x5177('0x38')]=_0x72dced[_0x5177('0x38')][_0x5177('0x3a')]?_0x72dced['attributes']:_0x49f6f1[_0x5177('0x37')];if(!_0x8134f9[_0x5177('0x33')][_0x5177('0x3b')](_0x5177('0x3c'))){_0x72dced[_0x5177('0x3d')]=qs[_0x5177('0x3d')](_0x8134f9[_0x5177('0x33')]['limit']);_0x72dced[_0x5177('0x20')]=qs[_0x5177('0x20')](_0x8134f9['query']['offset']);}_0x72dced[_0x5177('0x3e')]=qs[_0x5177('0x3f')](_0x8134f9[_0x5177('0x33')][_0x5177('0x3f')]);_0x72dced[_0x5177('0x40')]=qs[_0x5177('0x35')](_[_0x5177('0x41')](_0x8134f9[_0x5177('0x33')],_0x49f6f1[_0x5177('0x35')]),_0x2233a2);if(_0x8134f9[_0x5177('0x33')][_0x5177('0x42')]){_0x72dced[_0x5177('0x40')]=_[_0x5177('0x43')](_0x72dced['where'],{'$or':_[_0x5177('0x32')](_0x2233a2,function(_0x2a4db1){if(_0x2a4db1['type']!==_0x5177('0x44')){var _0x56f297={};_0x56f297[_0x2a4db1[_0x5177('0x2c')]]={'$like':'%'+_0x8134f9[_0x5177('0x33')][_0x5177('0x42')]+'%'};return _0x56f297;}})});}_0x72dced=_['merge']({},_0x72dced,_0x8134f9['options']);var _0x210510={'where':_0x72dced[_0x5177('0x40')]};return db[_0x5177('0x2f')][_0x5177('0x22')](_0x210510)[_0x5177('0x28')](function(_0x3e710d){_0x42e1db[_0x5177('0x22')]=_0x3e710d;if(_0x8134f9[_0x5177('0x33')]['includeAll']){_0x72dced[_0x5177('0x45')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x72dced);})[_0x5177('0x28')](function(_0x17dc98){_0x42e1db['rows']=_0x17dc98;return _0x42e1db;})[_0x5177('0x28')](respondWithFilteredResult(_0x31eb9f,_0x72dced))['catch'](handleError(_0x31eb9f,null));};exports['show']=function(_0x46c833,_0x1769cd){var _0x262c71={'raw':!![],'where':{'id':_0x46c833[_0x5177('0x46')]['id']}},_0x3776b8={};_0x3776b8[_0x5177('0x37')]=_[_0x5177('0x34')](db['VoiceMail']['rawAttributes']);_0x3776b8[_0x5177('0x33')]=_['keys'](_0x46c833[_0x5177('0x33')]);_0x3776b8[_0x5177('0x35')]=_[_0x5177('0x36')](_0x3776b8[_0x5177('0x37')],_0x3776b8['query']);_0x262c71[_0x5177('0x38')]=_[_0x5177('0x36')](_0x3776b8[_0x5177('0x37')],qs[_0x5177('0x39')](_0x46c833[_0x5177('0x33')][_0x5177('0x39')]));_0x262c71[_0x5177('0x38')]=_0x262c71[_0x5177('0x38')][_0x5177('0x3a')]?_0x262c71[_0x5177('0x38')]:_0x3776b8[_0x5177('0x37')];if(_0x46c833['query'][_0x5177('0x47')]){_0x262c71['include']=[{'all':!![]}];}_0x262c71=_['merge']({},_0x262c71,_0x46c833['options']);return db[_0x5177('0x2f')][_0x5177('0x48')](_0x262c71)['then'](handleEntityNotFound(_0x1769cd,null))[_0x5177('0x28')](respondWithResult(_0x1769cd,null))[_0x5177('0x49')](handleError(_0x1769cd,null));};exports[_0x5177('0x4a')]=function(_0x4891fe,_0x1d4ae4){return db['VoiceMail']['create'](_0x4891fe['body'],{})[_0x5177('0x28')](function(_0x37d5dd){var _0x1300d7=_0x4891fe['user']['get']({'plain':!![]});if(!_0x1300d7)throw new Error(_0x5177('0x4b'));if(_0x1300d7['role']===_0x5177('0x4c')){var _0x9dd7a2=_0x37d5dd[_0x5177('0x4d')]({'plain':!![]});var _0x31a6e1=_0x5177('0x2a');return db[_0x5177('0x4e')][_0x5177('0x48')]({'where':{'name':_0x31a6e1,'userProfileId':_0x1300d7[_0x5177('0x4f')]},'raw':!![]})[_0x5177('0x28')](function(_0x217aca){if(_0x217aca&&_0x217aca[_0x5177('0x50')]===0x0){return db[_0x5177('0x2b')][_0x5177('0x4a')]({'name':_0x9dd7a2['name'],'resourceId':_0x9dd7a2['id'],'type':_0x217aca['name'],'sectionId':_0x217aca['id']},{})[_0x5177('0x28')](function(){return _0x37d5dd;});}else{return _0x37d5dd;}})['catch'](function(_0x649c6f){logger['error'](_0x5177('0x51'),_0x649c6f);throw _0x649c6f;});}return _0x37d5dd;})[_0x5177('0x28')](respondWithResult(_0x1d4ae4,0xc9))[_0x5177('0x49')](handleError(_0x1d4ae4,null));};exports['update']=function(_0x5be224,_0x19884e){if(_0x5be224[_0x5177('0x52')]['id']){delete _0x5be224[_0x5177('0x52')]['id'];}return db[_0x5177('0x2f')]['find']({'where':{'id':_0x5be224['params']['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x19884e,null))[_0x5177('0x28')](saveUpdates(_0x5be224[_0x5177('0x52')],null))[_0x5177('0x28')](respondWithResult(_0x19884e,null))['catch'](handleError(_0x19884e,null));};exports[_0x5177('0x29')]=function(_0x143aff,_0x3a18ad){return db['VoiceMail'][_0x5177('0x48')]({'where':{'id':_0x143aff[_0x5177('0x46')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x3a18ad,null))['then'](removeEntity(_0x3a18ad,null))[_0x5177('0x49')](handleError(_0x3a18ad,null));};exports['getMessages']=function(_0x40dfd6,_0x39fb92,_0x3268bd){return db['VoiceMail'][_0x5177('0x53')]({'where':{'id':_0x40dfd6[_0x5177('0x46')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x39fb92,null))[_0x5177('0x28')](function(_0xc7a59e){var _0x74589e;var _0x37380c={},_0x267599={};_0x267599['model']=_['keys'](db['VoiceMailMessage'][_0x5177('0x54')]);_0x267599[_0x5177('0x33')]=_[_0x5177('0x34')](_0x40dfd6[_0x5177('0x33')]);_0x267599[_0x5177('0x35')]=_[_0x5177('0x36')](_0x267599['model'],_0x267599['query']);_0x37380c[_0x5177('0x38')]=_[_0x5177('0x36')](_0x267599[_0x5177('0x37')],qs[_0x5177('0x39')](_0x40dfd6[_0x5177('0x33')][_0x5177('0x39')]));_0x37380c[_0x5177('0x38')]=_0x37380c[_0x5177('0x38')][_0x5177('0x3a')]?_0x37380c['attributes']:_0x267599[_0x5177('0x37')];if(!_0x40dfd6[_0x5177('0x33')]['hasOwnProperty'](_0x5177('0x3c'))){_0x37380c[_0x5177('0x3d')]=qs['limit'](_0x40dfd6[_0x5177('0x33')][_0x5177('0x3d')]);_0x37380c[_0x5177('0x20')]=qs['offset'](_0x40dfd6[_0x5177('0x33')][_0x5177('0x20')]);}_0x37380c['order']=qs['sort'](_0x40dfd6[_0x5177('0x33')]['sort']);_0x37380c[_0x5177('0x40')]=qs['filters'](_[_0x5177('0x41')](_0x40dfd6[_0x5177('0x33')],_0x267599['filters']));if(_0x40dfd6[_0x5177('0x33')][_0x5177('0x42')]){_0x37380c[_0x5177('0x40')]=_[_0x5177('0x43')](_0x37380c[_0x5177('0x40')],{'$or':_[_0x5177('0x32')](_0x37380c[_0x5177('0x38')],function(_0x58ebdd){var _0x26b733={};_0x26b733[_0x58ebdd]={'$like':'%'+_0x40dfd6['query']['filter']+'%'};return _0x26b733;})});}_0x37380c[_0x5177('0x40')]=_[_0x5177('0x43')](_0x37380c['where'],{'mailboxuser':_0xc7a59e[_0x5177('0x55')]});_0x37380c=_[_0x5177('0x43')]({},_0x37380c,_0x40dfd6[_0x5177('0x56')]);return db[_0x5177('0x57')][_0x5177('0x58')](_0x37380c)[_0x5177('0x28')](respondWithFilteredResult(_0x39fb92,_0x37380c));})[_0x5177('0x49')](handleError(_0x39fb92,null));};
\ No newline at end of file
+var _0x7072=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','intersection','length','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','hasOwnProperty','nolimit','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Voicemails','UserProfileResource','error','stack','name','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields'];(function(_0x3b46f6,_0x5ab59e){var _0x1b6c8c=function(_0xd43908){while(--_0xd43908){_0x3b46f6['push'](_0x3b46f6['shift']());}};_0x1b6c8c(++_0x5ab59e);}(_0x7072,0x138));var _0x2707=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x7072[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2707('0x0'));var zipdir=require(_0x2707('0x1'));var jsonpatch=require(_0x2707('0x2'));var rp=require(_0x2707('0x3'));var moment=require(_0x2707('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2707('0x5'));var path=require('path');var sox=require(_0x2707('0x6'));var csv=require(_0x2707('0x7'));var ejs=require(_0x2707('0x8'));var fs=require('fs');var fs_extra=require(_0x2707('0x9'));var _=require(_0x2707('0xa'));var squel=require(_0x2707('0xb'));var crypto=require(_0x2707('0xc'));var jsforce=require(_0x2707('0xd'));var deskjs=require(_0x2707('0xe'));var toCsv=require(_0x2707('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2707('0xf'));var authService=require(_0x2707('0x10'));var qs=require(_0x2707('0x11'));var as=require(_0x2707('0x12'));var hardwareService=require(_0x2707('0x13'));var logger=require(_0x2707('0x14'))(_0x2707('0x15'));var utils=require(_0x2707('0x16'));var config=require(_0x2707('0x17'));var licenseUtil=require(_0x2707('0x18'));var db=require(_0x2707('0x19'))['db'];function respondWithStatusCode(_0x32d4bd,_0x40d370){_0x40d370=_0x40d370||0xcc;return function(_0x5bf16e){if(_0x5bf16e){return _0x32d4bd[_0x2707('0x1a')](_0x40d370);}return _0x32d4bd['status'](_0x40d370)[_0x2707('0x1b')]();};}function respondWithResult(_0x307367,_0xfe975c){_0xfe975c=_0xfe975c||0xc8;return function(_0x3a67f2){if(_0x3a67f2){return _0x307367[_0x2707('0x1c')](_0xfe975c)['json'](_0x3a67f2);}};}function respondWithFilteredResult(_0x345774,_0x1a687a){return function(_0x2f6381){if(_0x2f6381){var _0x5d523f=typeof _0x1a687a[_0x2707('0x1d')]===_0x2707('0x1e')&&typeof _0x1a687a[_0x2707('0x1f')]===_0x2707('0x1e');var _0x7ed037=_0x2f6381[_0x2707('0x20')];var _0x4a8b7f=_0x5d523f?0x0:_0x1a687a[_0x2707('0x1d')];var _0x449a61=_0x5d523f?_0x2f6381[_0x2707('0x20')]:_0x1a687a['offset']+_0x1a687a['limit'];var _0x58a4ee;if(_0x449a61>=_0x7ed037){_0x449a61=_0x7ed037;_0x58a4ee=0xc8;}else{_0x58a4ee=0xce;}_0x345774[_0x2707('0x1c')](_0x58a4ee);return _0x345774[_0x2707('0x21')](_0x2707('0x22'),_0x4a8b7f+'-'+_0x449a61+'/'+_0x7ed037)[_0x2707('0x23')](_0x2f6381);}return null;};}function patchUpdates(_0x1a0e1a){return function(_0x3c2935){try{jsonpatch[_0x2707('0x24')](_0x3c2935,_0x1a0e1a,!![]);}catch(_0x65b6e5){return BPromise[_0x2707('0x25')](_0x65b6e5);}return _0x3c2935[_0x2707('0x26')]();};}function saveUpdates(_0x37c475,_0x119df4){return function(_0x454fde){if(_0x454fde){return _0x454fde[_0x2707('0x27')](_0x37c475)['then'](function(_0x1acf22){return _0x1acf22;});}return null;};}function removeEntity(_0x3b030a,_0x46259e){return function(_0x369e3a){if(_0x369e3a){return _0x369e3a[_0x2707('0x28')]()[_0x2707('0x29')](function(){var _0x4831ed=_0x369e3a[_0x2707('0x2a')]({'plain':!![]});var _0x3f6976=_0x2707('0x2b');return db[_0x2707('0x2c')][_0x2707('0x28')]({'where':{'type':_0x3f6976,'resourceId':_0x4831ed['id']}})['then'](function(){return _0x369e3a;});})[_0x2707('0x29')](function(){_0x3b030a['status'](0xcc)[_0x2707('0x1b')]();});}};}function handleEntityNotFound(_0x34dc4e,_0x2aa3fe){return function(_0x57da26){if(!_0x57da26){_0x34dc4e[_0x2707('0x1a')](0x194);}return _0x57da26;};}function handleError(_0x14daf8,_0x2c7047){_0x2c7047=_0x2c7047||0x1f4;return function(_0x529be8){logger[_0x2707('0x2d')](_0x529be8[_0x2707('0x2e')]);if(_0x529be8['name']){delete _0x529be8[_0x2707('0x2f')];}_0x14daf8['status'](_0x2c7047)['send'](_0x529be8);};}exports[_0x2707('0x30')]=function(_0x4e0c93,_0x2a0d24){var _0x3f153d={},_0x417a97={},_0x36b2e9={'count':0x0,'rows':[]};var _0x48832b=_[_0x2707('0x31')](db[_0x2707('0x32')][_0x2707('0x33')],function(_0x154799){return{'name':_0x154799[_0x2707('0x34')],'type':_0x154799[_0x2707('0x35')][_0x2707('0x36')]};});_0x417a97[_0x2707('0x37')]=_[_0x2707('0x31')](_0x48832b,'name');_0x417a97[_0x2707('0x38')]=_[_0x2707('0x39')](_0x4e0c93['query']);_0x417a97['filters']=_['intersection'](_0x417a97['model'],_0x417a97['query']);_0x3f153d[_0x2707('0x3a')]=_['intersection'](_0x417a97['model'],qs[_0x2707('0x3b')](_0x4e0c93[_0x2707('0x38')]['fields']));_0x3f153d[_0x2707('0x3a')]=_0x3f153d[_0x2707('0x3a')]['length']?_0x3f153d['attributes']:_0x417a97[_0x2707('0x37')];if(!_0x4e0c93[_0x2707('0x38')]['hasOwnProperty']('nolimit')){_0x3f153d[_0x2707('0x1f')]=qs[_0x2707('0x1f')](_0x4e0c93['query'][_0x2707('0x1f')]);_0x3f153d[_0x2707('0x1d')]=qs[_0x2707('0x1d')](_0x4e0c93[_0x2707('0x38')][_0x2707('0x1d')]);}_0x3f153d[_0x2707('0x3c')]=qs['sort'](_0x4e0c93[_0x2707('0x38')][_0x2707('0x3d')]);_0x3f153d[_0x2707('0x3e')]=qs[_0x2707('0x3f')](_[_0x2707('0x40')](_0x4e0c93[_0x2707('0x38')],_0x417a97[_0x2707('0x3f')]),_0x48832b);if(_0x4e0c93['query'][_0x2707('0x41')]){_0x3f153d[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x3f153d[_0x2707('0x3e')],{'$or':_[_0x2707('0x31')](_0x48832b,function(_0xc7119d){if(_0xc7119d[_0x2707('0x35')]!==_0x2707('0x43')){var _0x2f06f8={};_0x2f06f8[_0xc7119d[_0x2707('0x2f')]]={'$like':'%'+_0x4e0c93[_0x2707('0x38')][_0x2707('0x41')]+'%'};return _0x2f06f8;}})});}_0x3f153d=_[_0x2707('0x42')]({},_0x3f153d,_0x4e0c93[_0x2707('0x44')]);var _0x36c8ab={'where':_0x3f153d[_0x2707('0x3e')]};return db['VoiceMail'][_0x2707('0x20')](_0x36c8ab)[_0x2707('0x29')](function(_0x5053ba){_0x36b2e9[_0x2707('0x20')]=_0x5053ba;if(_0x4e0c93['query'][_0x2707('0x45')]){_0x3f153d[_0x2707('0x46')]=[{'all':!![]}];}return db[_0x2707('0x32')][_0x2707('0x47')](_0x3f153d);})[_0x2707('0x29')](function(_0xdeec24){_0x36b2e9[_0x2707('0x48')]=_0xdeec24;return _0x36b2e9;})['then'](respondWithFilteredResult(_0x2a0d24,_0x3f153d))[_0x2707('0x49')](handleError(_0x2a0d24,null));};exports[_0x2707('0x4a')]=function(_0x4c8dbf,_0x3d25ea){var _0x6defc2={'raw':!![],'where':{'id':_0x4c8dbf['params']['id']}},_0x3b38d7={};_0x3b38d7['model']=_[_0x2707('0x39')](db[_0x2707('0x32')]['rawAttributes']);_0x3b38d7[_0x2707('0x38')]=_['keys'](_0x4c8dbf[_0x2707('0x38')]);_0x3b38d7[_0x2707('0x3f')]=_[_0x2707('0x4b')](_0x3b38d7[_0x2707('0x37')],_0x3b38d7['query']);_0x6defc2[_0x2707('0x3a')]=_[_0x2707('0x4b')](_0x3b38d7[_0x2707('0x37')],qs[_0x2707('0x3b')](_0x4c8dbf[_0x2707('0x38')][_0x2707('0x3b')]));_0x6defc2[_0x2707('0x3a')]=_0x6defc2['attributes'][_0x2707('0x4c')]?_0x6defc2[_0x2707('0x3a')]:_0x3b38d7[_0x2707('0x37')];if(_0x4c8dbf[_0x2707('0x38')][_0x2707('0x45')]){_0x6defc2['include']=[{'all':!![]}];}_0x6defc2=_[_0x2707('0x42')]({},_0x6defc2,_0x4c8dbf['options']);return db[_0x2707('0x32')][_0x2707('0x4d')](_0x6defc2)['then'](handleEntityNotFound(_0x3d25ea,null))[_0x2707('0x29')](respondWithResult(_0x3d25ea,null))[_0x2707('0x49')](handleError(_0x3d25ea,null));};exports[_0x2707('0x4e')]=function(_0x4ae196,_0x1a8034){return db['VoiceMail'][_0x2707('0x4e')](_0x4ae196[_0x2707('0x4f')],{})['then'](function(_0x2b1746){var _0xffe740=_0x4ae196[_0x2707('0x50')]['get']({'plain':!![]});if(!_0xffe740)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xffe740[_0x2707('0x51')]===_0x2707('0x50')){var _0x292b44=_0x2b1746[_0x2707('0x2a')]({'plain':!![]});var _0x463bf='Voicemails';return db['UserProfileSection']['find']({'where':{'name':_0x463bf,'userProfileId':_0xffe740[_0x2707('0x52')]},'raw':!![]})[_0x2707('0x29')](function(_0x2e11fc){if(_0x2e11fc&&_0x2e11fc[_0x2707('0x53')]===0x0){return db[_0x2707('0x2c')]['create']({'name':_0x292b44[_0x2707('0x2f')],'resourceId':_0x292b44['id'],'type':_0x2e11fc[_0x2707('0x2f')],'sectionId':_0x2e11fc['id']},{})['then'](function(){return _0x2b1746;});}else{return _0x2b1746;}})['catch'](function(_0x3b41b2){logger[_0x2707('0x2d')](_0x2707('0x54'),_0x3b41b2);throw _0x3b41b2;});}return _0x2b1746;})['then'](respondWithResult(_0x1a8034,0xc9))[_0x2707('0x49')](handleError(_0x1a8034,null));};exports[_0x2707('0x27')]=function(_0x2a2a71,_0x29a453){if(_0x2a2a71['body']['id']){delete _0x2a2a71[_0x2707('0x4f')]['id'];}return db[_0x2707('0x32')][_0x2707('0x4d')]({'where':{'id':_0x2a2a71[_0x2707('0x55')]['id']}})[_0x2707('0x29')](handleEntityNotFound(_0x29a453,null))[_0x2707('0x29')](saveUpdates(_0x2a2a71[_0x2707('0x4f')],null))[_0x2707('0x29')](respondWithResult(_0x29a453,null))[_0x2707('0x49')](handleError(_0x29a453,null));};exports[_0x2707('0x28')]=function(_0x4f2b54,_0x38acdd){return db['VoiceMail']['find']({'where':{'id':_0x4f2b54[_0x2707('0x55')]['id']}})['then'](handleEntityNotFound(_0x38acdd,null))['then'](removeEntity(_0x38acdd,null))[_0x2707('0x49')](handleError(_0x38acdd,null));};exports[_0x2707('0x56')]=function(_0x185bd3,_0x154e26,_0x3f82de){return db[_0x2707('0x32')][_0x2707('0x57')]({'where':{'id':_0x185bd3[_0x2707('0x55')]['id']}})[_0x2707('0x29')](handleEntityNotFound(_0x154e26,null))[_0x2707('0x29')](function(_0x40c333){var _0x5852bd;var _0x4c4568={},_0x4a3a35={};_0x4a3a35[_0x2707('0x37')]=_[_0x2707('0x39')](db[_0x2707('0x58')]['rawAttributes']);_0x4a3a35['query']=_[_0x2707('0x39')](_0x185bd3[_0x2707('0x38')]);_0x4a3a35[_0x2707('0x3f')]=_[_0x2707('0x4b')](_0x4a3a35[_0x2707('0x37')],_0x4a3a35['query']);_0x4c4568['attributes']=_[_0x2707('0x4b')](_0x4a3a35[_0x2707('0x37')],qs[_0x2707('0x3b')](_0x185bd3[_0x2707('0x38')][_0x2707('0x3b')]));_0x4c4568[_0x2707('0x3a')]=_0x4c4568[_0x2707('0x3a')][_0x2707('0x4c')]?_0x4c4568[_0x2707('0x3a')]:_0x4a3a35['model'];if(!_0x185bd3[_0x2707('0x38')][_0x2707('0x59')](_0x2707('0x5a'))){_0x4c4568[_0x2707('0x1f')]=qs[_0x2707('0x1f')](_0x185bd3[_0x2707('0x38')]['limit']);_0x4c4568['offset']=qs[_0x2707('0x1d')](_0x185bd3[_0x2707('0x38')]['offset']);}_0x4c4568['order']=qs['sort'](_0x185bd3['query'][_0x2707('0x3d')]);_0x4c4568[_0x2707('0x3e')]=qs['filters'](_[_0x2707('0x40')](_0x185bd3[_0x2707('0x38')],_0x4a3a35[_0x2707('0x3f')]));if(_0x185bd3['query']['filter']){_0x4c4568[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x4c4568[_0x2707('0x3e')],{'$or':_[_0x2707('0x31')](_0x4c4568[_0x2707('0x3a')],function(_0xdb1de0){var _0x3973a0={};_0x3973a0[_0xdb1de0]={'$like':'%'+_0x185bd3['query'][_0x2707('0x41')]+'%'};return _0x3973a0;})});}_0x4c4568[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x4c4568[_0x2707('0x3e')],{'mailboxuser':_0x40c333[_0x2707('0x5b')]});_0x4c4568=_[_0x2707('0x42')]({},_0x4c4568,_0x185bd3['options']);return db[_0x2707('0x58')][_0x2707('0x5c')](_0x4c4568)[_0x2707('0x29')](respondWithFilteredResult(_0x154e26,_0x4c4568));})[_0x2707('0x49')](handleError(_0x154e26,null));};
\ No newline at end of file
index 1b29046..6c1a733 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ad0=['request-promise','path','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment'];(function(_0x5e68a7,_0x224bc4){var _0x23909e=function(_0x60f157){while(--_0x60f157){_0x5e68a7['push'](_0x5e68a7['shift']());}};_0x23909e(++_0x224bc4);}(_0x1ad0,0x19f));var _0x01ad=function(_0x7420ef,_0x37b75c){_0x7420ef=_0x7420ef-0x0;var _0x5d19c9=_0x1ad0[_0x7420ef];return _0x5d19c9;};'use strict';var _=require(_0x01ad('0x0'));var util=require(_0x01ad('0x1'));var logger=require(_0x01ad('0x2'))(_0x01ad('0x3'));var moment=require(_0x01ad('0x4'));var BPromise=require('bluebird');var rp=require(_0x01ad('0x5'));var fs=require('fs');var path=require(_0x01ad('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x01ad('0x7'));module['exports']=function(_0x2c7f76,_0x1287ef){return _0x2c7f76[_0x01ad('0x8')](_0x01ad('0x9'),attributes,{'tableName':_0x01ad('0xa'),'paranoid':![],'indexes':[{'name':_0x01ad('0xb'),'fields':[_0x01ad('0xc'),_0x01ad('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x40e3=['lodash','../../config/logger','api','path','rimraf','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context'];(function(_0x456d02,_0x40a800){var _0x55d754=function(_0x195a29){while(--_0x195a29){_0x456d02['push'](_0x456d02['shift']());}};_0x55d754(++_0x40a800);}(_0x40e3,0xd0));var _0x340e=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0x40e3[_0x19159a];return _0xa677f4;};'use strict';var _=require(_0x340e('0x0'));var util=require('util');var logger=require(_0x340e('0x1'))(_0x340e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x340e('0x3'));var rimraf=require(_0x340e('0x4'));var config=require('../../config/environment');var attributes=require(_0x340e('0x5'));module[_0x340e('0x6')]=function(_0x463fc5,_0x49410c){return _0x463fc5[_0x340e('0x7')](_0x340e('0x8'),attributes,{'tableName':_0x340e('0x9'),'paranoid':![],'indexes':[{'name':_0x340e('0xa'),'fields':[_0x340e('0xb'),_0x340e('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 24dbebb..288f16f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe366=['request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceMail,\x20%s,\x20%s'];(function(_0x1f6460,_0x35435e){var _0x5cd0ec=function(_0x18b034){while(--_0x18b034){_0x1f6460['push'](_0x1f6460['shift']());}};_0x5cd0ec(++_0x35435e);}(_0xe366,0x1d1));var _0x6e36=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xe366[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x6e36('0x0'));var util=require(_0x6e36('0x1'));var moment=require(_0x6e36('0x2'));var BPromise=require(_0x6e36('0x3'));var rs=require(_0x6e36('0x4'));var fs=require('fs');var Redis=require(_0x6e36('0x5'));var db=require(_0x6e36('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e36('0x7'))(_0x6e36('0x8'));var config=require(_0x6e36('0x9'));var jayson=require(_0x6e36('0xa'));var client=jayson['client'][_0x6e36('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d474b,_0x12a2d5,_0x3aa60d){return new BPromise(function(_0x547c9a,_0x33901f){return client[_0x6e36('0xc')](_0x3d474b,_0x3aa60d)[_0x6e36('0xd')](function(_0x379e2a){logger['info'](_0x6e36('0xe'),_0x12a2d5,_0x6e36('0xf'));logger[_0x6e36('0x10')](_0x6e36('0x11'),_0x12a2d5,_0x6e36('0xf'),JSON[_0x6e36('0x12')](_0x379e2a));if(_0x379e2a[_0x6e36('0x13')]){if(_0x379e2a['error']['code']===0x1f4){logger[_0x6e36('0x13')](_0x6e36('0xe'),_0x12a2d5,_0x379e2a[_0x6e36('0x13')]['message']);return _0x33901f(_0x379e2a[_0x6e36('0x13')][_0x6e36('0x14')]);}logger[_0x6e36('0x13')](_0x6e36('0xe'),_0x12a2d5,_0x379e2a[_0x6e36('0x13')][_0x6e36('0x14')]);return _0x547c9a(_0x379e2a[_0x6e36('0x13')][_0x6e36('0x14')]);}else{logger[_0x6e36('0x15')](_0x6e36('0xe'),_0x12a2d5,_0x6e36('0xf'));_0x547c9a(_0x379e2a[_0x6e36('0x16')][_0x6e36('0x14')]);}})[_0x6e36('0x17')](function(_0x1f61a6){logger['error'](_0x6e36('0xe'),_0x12a2d5,_0x1f61a6);_0x33901f(_0x1f61a6);});});}
\ No newline at end of file
+var _0x64c1=['VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x64c1,0x123));var _0x164c=function(_0x366bc3,_0x732556){_0x366bc3=_0x366bc3-0x0;var _0x1683fc=_0x64c1[_0x366bc3];return _0x1683fc;};'use strict';var _=require(_0x164c('0x0'));var util=require(_0x164c('0x1'));var moment=require(_0x164c('0x2'));var BPromise=require(_0x164c('0x3'));var rs=require(_0x164c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x164c('0x5'))['db'];var utils=require(_0x164c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x164c('0x7'));var jayson=require(_0x164c('0x8'));var client=jayson[_0x164c('0x9')][_0x164c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4042ab,_0x59433d,_0x18a6f8){return new BPromise(function(_0x4af0c3,_0x1ccbd7){return client[_0x164c('0xb')](_0x4042ab,_0x18a6f8)[_0x164c('0xc')](function(_0x37d721){logger[_0x164c('0xd')](_0x164c('0xe'),_0x59433d,_0x164c('0xf'));logger[_0x164c('0x10')](_0x164c('0x11'),_0x59433d,_0x164c('0xf'),JSON['stringify'](_0x37d721));if(_0x37d721[_0x164c('0x12')]){if(_0x37d721[_0x164c('0x12')][_0x164c('0x13')]===0x1f4){logger[_0x164c('0x12')](_0x164c('0xe'),_0x59433d,_0x37d721[_0x164c('0x12')][_0x164c('0x14')]);return _0x1ccbd7(_0x37d721[_0x164c('0x12')][_0x164c('0x14')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x59433d,_0x37d721[_0x164c('0x12')][_0x164c('0x14')]);return _0x4af0c3(_0x37d721['error']['message']);}else{logger[_0x164c('0xd')]('VoiceMail,\x20%s,\x20%s',_0x59433d,_0x164c('0xf'));_0x4af0c3(_0x37d721[_0x164c('0x15')]['message']);}})['catch'](function(_0x13ae18){logger['error'](_0x164c('0xe'),_0x59433d,_0x13ae18);_0x1ccbd7(_0x13ae18);});});}
\ No newline at end of file
index 55e4f95..3760c34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x151f=['Router','fs-extra','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x48a660,_0x35ad89){var _0x874e67=function(_0x6a0c8a){while(--_0x6a0c8a){_0x48a660['push'](_0x48a660['shift']());}};_0x874e67(++_0x35ad89);}(_0x151f,0x9d));var _0xf151=function(_0x427145,_0x4a4662){_0x427145=_0x427145-0x0;var _0x5f1fb1=_0x151f[_0x427145];return _0x5f1fb1;};'use strict';var multer=require(_0xf151('0x0'));var util=require(_0xf151('0x1'));var path=require('path');var timeout=require(_0xf151('0x2'));var express=require('express');var router=express[_0xf151('0x3')]();var fs_extra=require(_0xf151('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf151('0x5'));var controller=require(_0xf151('0x6'));router[_0xf151('0x7')]('/',auth[_0xf151('0x8')](),controller[_0xf151('0x9')]);router[_0xf151('0x7')](_0xf151('0xa'),auth[_0xf151('0x8')](),controller[_0xf151('0xb')]);router[_0xf151('0x7')](_0xf151('0xc'),auth[_0xf151('0x8')](),controller[_0xf151('0xd')]);router[_0xf151('0xe')]('/',auth[_0xf151('0x8')](),controller[_0xf151('0xf')]);router[_0xf151('0x10')](_0xf151('0xa'),auth[_0xf151('0x8')](),controller['update']);router[_0xf151('0x11')](_0xf151('0xa'),auth['isAuthenticated'](),controller[_0xf151('0x12')]);module[_0xf151('0x13')]=router;
\ No newline at end of file
+var _0x4ce0=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','index','get','isAuthenticated','show','download','post','create','/:id','update','delete','destroy','multer','util','path'];(function(_0x28b8eb,_0x4613cd){var _0x131e48=function(_0x34cccf){while(--_0x34cccf){_0x28b8eb['push'](_0x28b8eb['shift']());}};_0x131e48(++_0x4613cd);}(_0x4ce0,0x105));var _0x04ce=function(_0x4d3531,_0x41eebf){_0x4d3531=_0x4d3531-0x0;var _0x3c8c8b=_0x4ce0[_0x4d3531];return _0x3c8c8b;};'use strict';var multer=require(_0x04ce('0x0'));var util=require(_0x04ce('0x1'));var path=require(_0x04ce('0x2'));var timeout=require(_0x04ce('0x3'));var express=require(_0x04ce('0x4'));var router=express[_0x04ce('0x5')]();var fs_extra=require(_0x04ce('0x6'));var auth=require(_0x04ce('0x7'));var interaction=require(_0x04ce('0x8'));var config=require(_0x04ce('0x9'));var controller=require(_0x04ce('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x04ce('0xb')]);router[_0x04ce('0xc')]('/:id',auth[_0x04ce('0xd')](),controller[_0x04ce('0xe')]);router[_0x04ce('0xc')]('/:id/download',auth[_0x04ce('0xd')](),controller[_0x04ce('0xf')]);router[_0x04ce('0x10')]('/',auth[_0x04ce('0xd')](),controller[_0x04ce('0x11')]);router['put'](_0x04ce('0x12'),auth[_0x04ce('0xd')](),controller[_0x04ce('0x13')]);router[_0x04ce('0x14')](_0x04ce('0x12'),auth[_0x04ce('0xd')](),controller[_0x04ce('0x15')]);module['exports']=router;
\ No newline at end of file
index 3efe0c5..4eee556 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44c2=['BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x44c2,0x191));var _0x244c=function(_0x87239,_0x38c793){_0x87239=_0x87239-0x0;var _0x53af1e=_0x44c2[_0x87239];return _0x53af1e;};'use strict';var Sequelize=require(_0x244c('0x0'));module[_0x244c('0x1')]={'name':{'type':Sequelize[_0x244c('0x2')],'get':function(_0x32fce2){return this[_0x244c('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x244c('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x244c('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x244c('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x244c('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x244c('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x244c('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x244c('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x244c('0x6')](_0x244c('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0x244c('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x244c('0x8'),'defaultValue':Sequelize[_0x244c('0x9')](_0x244c('0xa'))}};
\ No newline at end of file
+var _0xf352=['STRING','BLOB','long','TIMESTAMP','literal','sequelize','exports','VIRTUAL','INTEGER'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0xf352,0x125));var _0x2f35=function(_0x32bd81,_0x80f740){_0x32bd81=_0x32bd81-0x0;var _0x5d1cab=_0xf352[_0x32bd81];return _0x5d1cab;};'use strict';var Sequelize=require(_0x2f35('0x0'));module[_0x2f35('0x1')]={'name':{'type':Sequelize[_0x2f35('0x2')],'get':function(_0x2ee882){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x2f35('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x2f35('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x2f35('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x2f35('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x2f35('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x2f35('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x2f35('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x2f35('0x5')](_0x2f35('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x2f35('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x2f35('0x4')],'defaultValue':''},'stamp':{'type':_0x2f35('0x7'),'defaultValue':Sequelize[_0x2f35('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
index 6f1b8e0..ff60c89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cc=['to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','options','find','create','body','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','.wav\x22','set','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','desk.js'];(function(_0x20fd4b,_0x469208){var _0x17e661=function(_0x17d1b3){while(--_0x17d1b3){_0x20fd4b['push'](_0x20fd4b['shift']());}};_0x17e661(++_0x469208);}(_0xf3cc,0x9a));var _0xcf3c=function(_0x201361,_0x3d6778){_0x201361=_0x201361-0x0;var _0x300db2=_0xf3cc[_0x201361];return _0x300db2;};'use strict';var emlformat=require(_0xcf3c('0x0'));var rimraf=require(_0xcf3c('0x1'));var zipdir=require(_0xcf3c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcf3c('0x3'));var BPromise=require(_0xcf3c('0x4'));var Mustache=require(_0xcf3c('0x5'));var util=require('util');var path=require(_0xcf3c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcf3c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf3c('0x8'));var squel=require(_0xcf3c('0x9'));var crypto=require(_0xcf3c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xcf3c('0xb'));var toCsv=require(_0xcf3c('0xc'));var querystring=require(_0xcf3c('0xd'));var Papa=require(_0xcf3c('0xe'));var Redis=require('ioredis');var authService=require(_0xcf3c('0xf'));var qs=require(_0xcf3c('0x10'));var as=require(_0xcf3c('0x11'));var hardwareService=require(_0xcf3c('0x12'));var logger=require('../../config/logger')(_0xcf3c('0x13'));var utils=require(_0xcf3c('0x14'));var config=require(_0xcf3c('0x15'));var licenseUtil=require(_0xcf3c('0x16'));var db=require(_0xcf3c('0x17'))['db'];function respondWithStatusCode(_0x4529e6,_0x3de4cc){_0x3de4cc=_0x3de4cc||0xcc;return function(_0x4da6a7){if(_0x4da6a7){return _0x4529e6[_0xcf3c('0x18')](_0x3de4cc);}return _0x4529e6['status'](_0x3de4cc)[_0xcf3c('0x19')]();};}function respondWithResult(_0x52d043,_0x40b050){_0x40b050=_0x40b050||0xc8;return function(_0x1ad650){if(_0x1ad650){return _0x52d043[_0xcf3c('0x1a')](_0x40b050)[_0xcf3c('0x1b')](_0x1ad650);}};}function respondWithFilteredResult(_0x319dcf,_0x5e8cc1){return function(_0x15a9f9){if(_0x15a9f9){var _0x5b1db8=typeof _0x5e8cc1[_0xcf3c('0x1c')]===_0xcf3c('0x1d')&&typeof _0x5e8cc1[_0xcf3c('0x1e')]==='undefined';var _0x9f5b36=_0x15a9f9[_0xcf3c('0x1f')];var _0x5f3f99=_0x5b1db8?0x0:_0x5e8cc1[_0xcf3c('0x1c')];var _0x349508=_0x5b1db8?_0x15a9f9['count']:_0x5e8cc1[_0xcf3c('0x1c')]+_0x5e8cc1[_0xcf3c('0x1e')];var _0x572c78;if(_0x349508>=_0x9f5b36){_0x349508=_0x9f5b36;_0x572c78=0xc8;}else{_0x572c78=0xce;}_0x319dcf['status'](_0x572c78);return _0x319dcf['set'](_0xcf3c('0x20'),_0x5f3f99+'-'+_0x349508+'/'+_0x9f5b36)[_0xcf3c('0x1b')](_0x15a9f9);}return null;};}function patchUpdates(_0x112f6e){return function(_0x535397){try{jsonpatch[_0xcf3c('0x21')](_0x535397,_0x112f6e,!![]);}catch(_0x3b136d){return BPromise[_0xcf3c('0x22')](_0x3b136d);}return _0x535397['save']();};}function saveUpdates(_0x29ba39,_0xd12232){return function(_0x14eb92){if(_0x14eb92){return _0x14eb92[_0xcf3c('0x23')](_0x29ba39)[_0xcf3c('0x24')](function(_0x536d87){return _0x536d87;});}return null;};}function removeEntity(_0x1f1084,_0x9d3056){return function(_0x3ee179){if(_0x3ee179){return _0x3ee179[_0xcf3c('0x25')]()['then'](function(){_0x1f1084[_0xcf3c('0x1a')](0xcc)[_0xcf3c('0x19')]();});}};}function handleEntityNotFound(_0x3617cf,_0x4dfbfa){return function(_0x2ca048){if(!_0x2ca048){_0x3617cf[_0xcf3c('0x18')](0x194);}return _0x2ca048;};}function handleError(_0xf6dfcc,_0x51be96){_0x51be96=_0x51be96||0x1f4;return function(_0xd3249f){logger[_0xcf3c('0x26')](_0xd3249f[_0xcf3c('0x27')]);if(_0xd3249f['name']){delete _0xd3249f[_0xcf3c('0x28')];}_0xf6dfcc[_0xcf3c('0x1a')](_0x51be96)[_0xcf3c('0x29')](_0xd3249f);};}exports[_0xcf3c('0x2a')]=function(_0x3a7837,_0x35e8aa){var _0x575867={},_0x17bf11={},_0x1cc5ae={'count':0x0,'rows':[]};var _0x407b43=_[_0xcf3c('0x2b')](db[_0xcf3c('0x2c')]['rawAttributes'],function(_0x164662){return{'name':_0x164662[_0xcf3c('0x2d')],'type':_0x164662[_0xcf3c('0x2e')][_0xcf3c('0x2f')]};});_0x17bf11[_0xcf3c('0x30')]=_['differenceBy'](_[_0xcf3c('0x2b')](_0x407b43,_0xcf3c('0x28')),[_0xcf3c('0x28')]);_0x17bf11['query']=_['keys'](_0x3a7837[_0xcf3c('0x31')]);_0x17bf11[_0xcf3c('0x32')]=_['intersection'](_0x17bf11[_0xcf3c('0x30')],_0x17bf11[_0xcf3c('0x31')]);_0x575867[_0xcf3c('0x33')]=_[_0xcf3c('0x34')](_0x17bf11['model'],qs['fields'](_0x3a7837[_0xcf3c('0x31')][_0xcf3c('0x35')]));_0x575867[_0xcf3c('0x33')]=_0x575867[_0xcf3c('0x33')][_0xcf3c('0x36')]?_0x575867[_0xcf3c('0x33')]:_0x17bf11[_0xcf3c('0x30')];if(!_0x3a7837['query'][_0xcf3c('0x37')](_0xcf3c('0x38'))){_0x575867['limit']=qs[_0xcf3c('0x1e')](_0x3a7837['query'][_0xcf3c('0x1e')]);_0x575867[_0xcf3c('0x1c')]=qs[_0xcf3c('0x1c')](_0x3a7837[_0xcf3c('0x31')][_0xcf3c('0x1c')]);}_0x575867[_0xcf3c('0x39')]=qs[_0xcf3c('0x3a')](_0x3a7837[_0xcf3c('0x31')]['sort']);_0x575867[_0xcf3c('0x3b')]=qs[_0xcf3c('0x32')](_['pick'](_0x3a7837['query'],_0x17bf11[_0xcf3c('0x32')]),_0x407b43);if(_0x3a7837[_0xcf3c('0x31')]['filter']){_0x575867[_0xcf3c('0x3b')]=_['merge'](_0x575867[_0xcf3c('0x3b')],{'$or':_['map'](_0x407b43,function(_0x42c0c3){if(_0x42c0c3[_0xcf3c('0x2e')]!==_0xcf3c('0x3c')){var _0x1c50a4={};_0x1c50a4[_0x42c0c3[_0xcf3c('0x28')]]={'$like':'%'+_0x3a7837['query']['filter']+'%'};return _0x1c50a4;}})});}_0x575867=_[_0xcf3c('0x3d')]({},_0x575867,_0x3a7837['options']);var _0x75eea7={'where':_0x575867['where']};return db['VoiceMailMessage']['count'](_0x75eea7)[_0xcf3c('0x24')](function(_0x50ef70){_0x1cc5ae['count']=_0x50ef70;if(_0x3a7837[_0xcf3c('0x31')][_0xcf3c('0x3e')]){_0x575867[_0xcf3c('0x3f')]=[{'all':!![]}];}return db[_0xcf3c('0x2c')][_0xcf3c('0x40')](_0x575867);})['then'](function(_0x507597){_0x1cc5ae[_0xcf3c('0x41')]=_0x507597;return _0x1cc5ae;})['then'](respondWithFilteredResult(_0x35e8aa,_0x575867))[_0xcf3c('0x42')](handleError(_0x35e8aa,null));};exports['show']=function(_0x8b4288,_0x3c9288){var _0x49af2c={'raw':!![],'where':{'id':_0x8b4288[_0xcf3c('0x43')]['id']}},_0x3bfac2={};_0x3bfac2[_0xcf3c('0x30')]=_[_0xcf3c('0x44')](db[_0xcf3c('0x2c')][_0xcf3c('0x45')]);_0x3bfac2['query']=_[_0xcf3c('0x44')](_0x8b4288[_0xcf3c('0x31')]);_0x3bfac2['filters']=_[_0xcf3c('0x34')](_0x3bfac2[_0xcf3c('0x30')],_0x3bfac2[_0xcf3c('0x31')]);_0x49af2c[_0xcf3c('0x33')]=_[_0xcf3c('0x34')](_0x3bfac2[_0xcf3c('0x30')],qs[_0xcf3c('0x35')](_0x8b4288[_0xcf3c('0x31')][_0xcf3c('0x35')]));_0x49af2c['attributes']=_0x49af2c[_0xcf3c('0x33')]['length']?_0x49af2c[_0xcf3c('0x33')]:_0x3bfac2[_0xcf3c('0x30')];if(_0x8b4288[_0xcf3c('0x31')][_0xcf3c('0x3e')]){_0x49af2c[_0xcf3c('0x3f')]=[{'all':!![]}];}_0x49af2c=_[_0xcf3c('0x3d')]({},_0x49af2c,_0x8b4288[_0xcf3c('0x46')]);return db[_0xcf3c('0x2c')][_0xcf3c('0x47')](_0x49af2c)[_0xcf3c('0x24')](handleEntityNotFound(_0x3c9288,null))['then'](respondWithResult(_0x3c9288,null))[_0xcf3c('0x42')](handleError(_0x3c9288,null));};exports['create']=function(_0x1c56be,_0x27e5b1){return db[_0xcf3c('0x2c')][_0xcf3c('0x48')](_0x1c56be[_0xcf3c('0x49')],{})[_0xcf3c('0x24')](respondWithResult(_0x27e5b1,0xc9))[_0xcf3c('0x42')](handleError(_0x27e5b1,null));};exports[_0xcf3c('0x23')]=function(_0x5acd86,_0x547b54){if(_0x5acd86['body']['id']){delete _0x5acd86[_0xcf3c('0x49')]['id'];}return db[_0xcf3c('0x2c')][_0xcf3c('0x47')]({'where':{'id':_0x5acd86['params']['id']}})[_0xcf3c('0x24')](handleEntityNotFound(_0x547b54,null))[_0xcf3c('0x24')](saveUpdates(_0x5acd86[_0xcf3c('0x49')],null))[_0xcf3c('0x24')](respondWithResult(_0x547b54,null))[_0xcf3c('0x42')](handleError(_0x547b54,null));};exports[_0xcf3c('0x25')]=function(_0x18aeb7,_0x25d084){return db[_0xcf3c('0x2c')]['find']({'where':{'id':_0x18aeb7['params']['id']}})[_0xcf3c('0x24')](handleEntityNotFound(_0x25d084,null))[_0xcf3c('0x24')](removeEntity(_0x25d084,null))[_0xcf3c('0x42')](handleError(_0x25d084,null));};exports['download']=function(_0x160f61,_0x47615b,_0x473e22){return db[_0xcf3c('0x2c')][_0xcf3c('0x47')]({'where':{'id':_0x160f61['params']['id']},'attributes':['id',_0xcf3c('0x4a'),'msg_id']})[_0xcf3c('0x24')](handleEntityNotFound(_0x47615b,null))['then'](function(_0x3c8b16){if(_0x3c8b16){if(!_0x3c8b16['recording']){throw new db[(_0xcf3c('0x4b'))][(_0xcf3c('0x4c'))](_0xcf3c('0x4d'));}var _0x2cf95a={'Content-Type':_0xcf3c('0x4e'),'Content-Disposition':_0xcf3c('0x4f')};if(_0x3c8b16[_0xcf3c('0x50')]){_0x2cf95a['Content-Disposition']='attachment;\x20filename=\x22'+_0x3c8b16[_0xcf3c('0x50')]+_0xcf3c('0x51');}_0x47615b[_0xcf3c('0x52')](_0x2cf95a);return _0x47615b[_0xcf3c('0x29')](new Buffer(_0x3c8b16[_0xcf3c('0x4a')]));}})['catch'](handleError(_0x47615b,null));};
\ No newline at end of file
+var _0x8109=['order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','rows','catch','show','params','find','create','body','destroy','download','recording','msg_id','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','differenceBy','keys','filters','intersection','query','model','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x433650,_0x2780ed){var _0x13ce1d=function(_0x342294){while(--_0x342294){_0x433650['push'](_0x433650['shift']());}};_0x13ce1d(++_0x2780ed);}(_0x8109,0x71));var _0x9810=function(_0x28f425,_0x668d32){_0x28f425=_0x28f425-0x0;var _0x32123c=_0x8109[_0x28f425];return _0x32123c;};'use strict';var emlformat=require(_0x9810('0x0'));var rimraf=require(_0x9810('0x1'));var zipdir=require(_0x9810('0x2'));var jsonpatch=require(_0x9810('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9810('0x4'));var Mustache=require('mustache');var util=require(_0x9810('0x5'));var path=require(_0x9810('0x6'));var sox=require(_0x9810('0x7'));var csv=require(_0x9810('0x8'));var ejs=require(_0x9810('0x9'));var fs=require('fs');var fs_extra=require(_0x9810('0xa'));var _=require(_0x9810('0xb'));var squel=require(_0x9810('0xc'));var crypto=require(_0x9810('0xd'));var jsforce=require(_0x9810('0xe'));var deskjs=require(_0x9810('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9810('0x10'));var Papa=require(_0x9810('0x11'));var Redis=require('ioredis');var authService=require(_0x9810('0x12'));var qs=require(_0x9810('0x13'));var as=require(_0x9810('0x14'));var hardwareService=require(_0x9810('0x15'));var logger=require(_0x9810('0x16'))(_0x9810('0x17'));var utils=require(_0x9810('0x18'));var config=require(_0x9810('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13e6ae,_0x6999fa){_0x6999fa=_0x6999fa||0xcc;return function(_0x7df91d){if(_0x7df91d){return _0x13e6ae[_0x9810('0x1a')](_0x6999fa);}return _0x13e6ae[_0x9810('0x1b')](_0x6999fa)[_0x9810('0x1c')]();};}function respondWithResult(_0x225253,_0x5ba3b5){_0x5ba3b5=_0x5ba3b5||0xc8;return function(_0x451a5d){if(_0x451a5d){return _0x225253[_0x9810('0x1b')](_0x5ba3b5)[_0x9810('0x1d')](_0x451a5d);}};}function respondWithFilteredResult(_0x5a8e6f,_0x33b638){return function(_0x39cf74){if(_0x39cf74){var _0x6e58b4=typeof _0x33b638[_0x9810('0x1e')]===_0x9810('0x1f')&&typeof _0x33b638[_0x9810('0x20')]===_0x9810('0x1f');var _0x59f81b=_0x39cf74[_0x9810('0x21')];var _0xdde0d=_0x6e58b4?0x0:_0x33b638[_0x9810('0x1e')];var _0x201f74=_0x6e58b4?_0x39cf74[_0x9810('0x21')]:_0x33b638[_0x9810('0x1e')]+_0x33b638['limit'];var _0xe45aa2;if(_0x201f74>=_0x59f81b){_0x201f74=_0x59f81b;_0xe45aa2=0xc8;}else{_0xe45aa2=0xce;}_0x5a8e6f[_0x9810('0x1b')](_0xe45aa2);return _0x5a8e6f['set'](_0x9810('0x22'),_0xdde0d+'-'+_0x201f74+'/'+_0x59f81b)[_0x9810('0x1d')](_0x39cf74);}return null;};}function patchUpdates(_0x495063){return function(_0x1dce2d){try{jsonpatch[_0x9810('0x23')](_0x1dce2d,_0x495063,!![]);}catch(_0x276540){return BPromise[_0x9810('0x24')](_0x276540);}return _0x1dce2d['save']();};}function saveUpdates(_0x2d2be2,_0x4d0715){return function(_0x23c99d){if(_0x23c99d){return _0x23c99d[_0x9810('0x25')](_0x2d2be2)[_0x9810('0x26')](function(_0x1b68b1){return _0x1b68b1;});}return null;};}function removeEntity(_0x314548,_0x490ef9){return function(_0x559d29){if(_0x559d29){return _0x559d29['destroy']()[_0x9810('0x26')](function(){_0x314548[_0x9810('0x1b')](0xcc)[_0x9810('0x1c')]();});}};}function handleEntityNotFound(_0x79192d,_0x4bff47){return function(_0x14438f){if(!_0x14438f){_0x79192d[_0x9810('0x1a')](0x194);}return _0x14438f;};}function handleError(_0x10c858,_0x54471e){_0x54471e=_0x54471e||0x1f4;return function(_0x27946d){logger[_0x9810('0x27')](_0x27946d[_0x9810('0x28')]);if(_0x27946d[_0x9810('0x29')]){delete _0x27946d['name'];}_0x10c858[_0x9810('0x1b')](_0x54471e)[_0x9810('0x2a')](_0x27946d);};}exports[_0x9810('0x2b')]=function(_0x1b05c4,_0x38ef50){var _0x5a24b7={},_0x4c4da1={},_0x3d2fc4={'count':0x0,'rows':[]};var _0x2d8745=_[_0x9810('0x2c')](db[_0x9810('0x2d')][_0x9810('0x2e')],function(_0x22b74d){return{'name':_0x22b74d[_0x9810('0x2f')],'type':_0x22b74d[_0x9810('0x30')][_0x9810('0x31')]};});_0x4c4da1['model']=_[_0x9810('0x32')](_[_0x9810('0x2c')](_0x2d8745,_0x9810('0x29')),['name']);_0x4c4da1['query']=_[_0x9810('0x33')](_0x1b05c4['query']);_0x4c4da1[_0x9810('0x34')]=_[_0x9810('0x35')](_0x4c4da1['model'],_0x4c4da1[_0x9810('0x36')]);_0x5a24b7['attributes']=_[_0x9810('0x35')](_0x4c4da1[_0x9810('0x37')],qs[_0x9810('0x38')](_0x1b05c4[_0x9810('0x36')][_0x9810('0x38')]));_0x5a24b7[_0x9810('0x39')]=_0x5a24b7['attributes'][_0x9810('0x3a')]?_0x5a24b7[_0x9810('0x39')]:_0x4c4da1['model'];if(!_0x1b05c4[_0x9810('0x36')][_0x9810('0x3b')](_0x9810('0x3c'))){_0x5a24b7[_0x9810('0x20')]=qs[_0x9810('0x20')](_0x1b05c4[_0x9810('0x36')][_0x9810('0x20')]);_0x5a24b7[_0x9810('0x1e')]=qs[_0x9810('0x1e')](_0x1b05c4[_0x9810('0x36')]['offset']);}_0x5a24b7[_0x9810('0x3d')]=qs['sort'](_0x1b05c4[_0x9810('0x36')][_0x9810('0x3e')]);_0x5a24b7[_0x9810('0x3f')]=qs[_0x9810('0x34')](_[_0x9810('0x40')](_0x1b05c4[_0x9810('0x36')],_0x4c4da1[_0x9810('0x34')]),_0x2d8745);if(_0x1b05c4[_0x9810('0x36')][_0x9810('0x41')]){_0x5a24b7['where']=_['merge'](_0x5a24b7[_0x9810('0x3f')],{'$or':_[_0x9810('0x2c')](_0x2d8745,function(_0xe8e30b){if(_0xe8e30b[_0x9810('0x30')]!==_0x9810('0x42')){var _0x3d4a55={};_0x3d4a55[_0xe8e30b[_0x9810('0x29')]]={'$like':'%'+_0x1b05c4['query'][_0x9810('0x41')]+'%'};return _0x3d4a55;}})});}_0x5a24b7=_[_0x9810('0x43')]({},_0x5a24b7,_0x1b05c4['options']);var _0x185fe1={'where':_0x5a24b7[_0x9810('0x3f')]};return db[_0x9810('0x2d')]['count'](_0x185fe1)['then'](function(_0x58fded){_0x3d2fc4[_0x9810('0x21')]=_0x58fded;if(_0x1b05c4[_0x9810('0x36')][_0x9810('0x44')]){_0x5a24b7[_0x9810('0x45')]=[{'all':!![]}];}return db[_0x9810('0x2d')]['findAll'](_0x5a24b7);})[_0x9810('0x26')](function(_0x6f58ae){_0x3d2fc4[_0x9810('0x46')]=_0x6f58ae;return _0x3d2fc4;})[_0x9810('0x26')](respondWithFilteredResult(_0x38ef50,_0x5a24b7))[_0x9810('0x47')](handleError(_0x38ef50,null));};exports[_0x9810('0x48')]=function(_0x4704ea,_0x1ccf62){var _0x27c298={'raw':!![],'where':{'id':_0x4704ea[_0x9810('0x49')]['id']}},_0x5ad067={};_0x5ad067[_0x9810('0x37')]=_[_0x9810('0x33')](db['VoiceMailMessage'][_0x9810('0x2e')]);_0x5ad067['query']=_[_0x9810('0x33')](_0x4704ea[_0x9810('0x36')]);_0x5ad067[_0x9810('0x34')]=_[_0x9810('0x35')](_0x5ad067[_0x9810('0x37')],_0x5ad067[_0x9810('0x36')]);_0x27c298[_0x9810('0x39')]=_['intersection'](_0x5ad067[_0x9810('0x37')],qs['fields'](_0x4704ea[_0x9810('0x36')][_0x9810('0x38')]));_0x27c298[_0x9810('0x39')]=_0x27c298['attributes'][_0x9810('0x3a')]?_0x27c298[_0x9810('0x39')]:_0x5ad067[_0x9810('0x37')];if(_0x4704ea['query'][_0x9810('0x44')]){_0x27c298[_0x9810('0x45')]=[{'all':!![]}];}_0x27c298=_[_0x9810('0x43')]({},_0x27c298,_0x4704ea['options']);return db[_0x9810('0x2d')][_0x9810('0x4a')](_0x27c298)[_0x9810('0x26')](handleEntityNotFound(_0x1ccf62,null))[_0x9810('0x26')](respondWithResult(_0x1ccf62,null))[_0x9810('0x47')](handleError(_0x1ccf62,null));};exports[_0x9810('0x4b')]=function(_0x326377,_0x5c9027){return db[_0x9810('0x2d')][_0x9810('0x4b')](_0x326377[_0x9810('0x4c')],{})['then'](respondWithResult(_0x5c9027,0xc9))[_0x9810('0x47')](handleError(_0x5c9027,null));};exports[_0x9810('0x25')]=function(_0x1a15fc,_0x5c2f27){if(_0x1a15fc[_0x9810('0x4c')]['id']){delete _0x1a15fc[_0x9810('0x4c')]['id'];}return db[_0x9810('0x2d')][_0x9810('0x4a')]({'where':{'id':_0x1a15fc[_0x9810('0x49')]['id']}})[_0x9810('0x26')](handleEntityNotFound(_0x5c2f27,null))[_0x9810('0x26')](saveUpdates(_0x1a15fc[_0x9810('0x4c')],null))[_0x9810('0x26')](respondWithResult(_0x5c2f27,null))[_0x9810('0x47')](handleError(_0x5c2f27,null));};exports[_0x9810('0x4d')]=function(_0x132ba7,_0x61dd81){return db[_0x9810('0x2d')]['find']({'where':{'id':_0x132ba7[_0x9810('0x49')]['id']}})[_0x9810('0x26')](handleEntityNotFound(_0x61dd81,null))[_0x9810('0x26')](removeEntity(_0x61dd81,null))[_0x9810('0x47')](handleError(_0x61dd81,null));};exports[_0x9810('0x4e')]=function(_0x502f70,_0x3842eb,_0x224f1f){return db[_0x9810('0x2d')][_0x9810('0x4a')]({'where':{'id':_0x502f70['params']['id']},'attributes':['id',_0x9810('0x4f'),_0x9810('0x50')]})[_0x9810('0x26')](handleEntityNotFound(_0x3842eb,null))[_0x9810('0x26')](function(_0x156a50){if(_0x156a50){if(!_0x156a50[_0x9810('0x4f')]){throw new db['Sequelize']['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x3485f8={'Content-Type':_0x9810('0x51'),'Content-Disposition':_0x9810('0x52')};if(_0x156a50[_0x9810('0x50')]){_0x3485f8[_0x9810('0x53')]=_0x9810('0x54')+_0x156a50[_0x9810('0x50')]+_0x9810('0x55');}_0x3842eb[_0x9810('0x56')](_0x3485f8);return _0x3842eb[_0x9810('0x2a')](new Buffer(_0x156a50['recording']));}})[_0x9810('0x47')](handleError(_0x3842eb,null));};
\ No newline at end of file
index df0d55c..9e76a14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdeaf=['../../config/logger','api','moment','request-promise','rimraf','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir','util'];(function(_0x4a390f,_0x20eb8a){var _0xa188cd=function(_0x56893a){while(--_0x56893a){_0x4a390f['push'](_0x4a390f['shift']());}};_0xa188cd(++_0x20eb8a);}(_0xdeaf,0x1a1));var _0xfdea=function(_0x4e8528,_0x18c54e){_0x4e8528=_0x4e8528-0x0;var _0x193108=_0xdeaf[_0x4e8528];return _0x193108;};'use strict';var _=require('lodash');var util=require(_0xfdea('0x0'));var logger=require(_0xfdea('0x1'))(_0xfdea('0x2'));var moment=require(_0xfdea('0x3'));var BPromise=require('bluebird');var rp=require(_0xfdea('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfdea('0x5'));var config=require('../../config/environment');var attributes=require(_0xfdea('0x6'));module[_0xfdea('0x7')]=function(_0x3bf778,_0x1646af){return _0x3bf778[_0xfdea('0x8')]('VoiceMailMessage',attributes,{'tableName':_0xfdea('0x9'),'paranoid':![],'indexes':[{'name':_0xfdea('0xa'),'fields':[_0xfdea('0xa')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x72b0=['../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x72b0,0x133));var _0x072b=function(_0x2e16a9,_0x291b29){_0x2e16a9=_0x2e16a9-0x0;var _0x531354=_0x72b0[_0x2e16a9];return _0x531354;};'use strict';var _=require(_0x072b('0x0'));var util=require(_0x072b('0x1'));var logger=require(_0x072b('0x2'))(_0x072b('0x3'));var moment=require(_0x072b('0x4'));var BPromise=require('bluebird');var rp=require(_0x072b('0x5'));var fs=require('fs');var path=require(_0x072b('0x6'));var rimraf=require(_0x072b('0x7'));var config=require(_0x072b('0x8'));var attributes=require(_0x072b('0x9'));module[_0x072b('0xa')]=function(_0xa2b8ab,_0x3fcf53){return _0xa2b8ab[_0x072b('0xb')](_0x072b('0xc'),attributes,{'tableName':_0x072b('0xd'),'paranoid':![],'indexes':[{'name':_0x072b('0xe'),'fields':['dir']}],'timestamps':![]});};
\ No newline at end of file
index 892ae95..e6bdc87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b42=['VoiceMailMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info'];(function(_0x17e77f,_0x3b42b6){var _0x55f101=function(_0x4fdb58){while(--_0x4fdb58){_0x17e77f['push'](_0x17e77f['shift']());}};_0x55f101(++_0x3b42b6);}(_0x3b42,0x1e2));var _0x23b4=function(_0x252903,_0x3fd660){_0x252903=_0x252903-0x0;var _0x2c67f1=_0x3b42[_0x252903];return _0x2c67f1;};'use strict';var _=require(_0x23b4('0x0'));var util=require(_0x23b4('0x1'));var moment=require(_0x23b4('0x2'));var BPromise=require(_0x23b4('0x3'));var rs=require(_0x23b4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x23b4('0x5'))['db'];var utils=require(_0x23b4('0x6'));var logger=require(_0x23b4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x23b4('0x8'));var client=jayson[_0x23b4('0x9')][_0x23b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c97ef,_0x13a470,_0x3b9560){return new BPromise(function(_0x3c4147,_0x4be715){return client['request'](_0x1c97ef,_0x3b9560)['then'](function(_0x53b335){logger[_0x23b4('0xb')](_0x23b4('0xc'),_0x13a470,_0x23b4('0xd'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x13a470,_0x23b4('0xd'),JSON['stringify'](_0x53b335));if(_0x53b335[_0x23b4('0xe')]){if(_0x53b335[_0x23b4('0xe')][_0x23b4('0xf')]===0x1f4){logger[_0x23b4('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x13a470,_0x53b335[_0x23b4('0xe')]['message']);return _0x4be715(_0x53b335[_0x23b4('0xe')][_0x23b4('0x10')]);}logger[_0x23b4('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x13a470,_0x53b335[_0x23b4('0xe')][_0x23b4('0x10')]);return _0x3c4147(_0x53b335[_0x23b4('0xe')]['message']);}else{logger['info'](_0x23b4('0xc'),_0x13a470,'request\x20sent');_0x3c4147(_0x53b335[_0x23b4('0x11')][_0x23b4('0x10')]);}})[_0x23b4('0x12')](function(_0x112347){logger[_0x23b4('0xe')](_0x23b4('0xc'),_0x13a470,_0x112347);_0x4be715(_0x112347);});});}
\ No newline at end of file
+var _0x5dc7=['message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x546750,_0x4c86d2){var _0x518b4e=function(_0x1f1696){while(--_0x1f1696){_0x546750['push'](_0x546750['shift']());}};_0x518b4e(++_0x4c86d2);}(_0x5dc7,0x1e5));var _0x75dc=function(_0x399759,_0x1bfc7c){_0x399759=_0x399759-0x0;var _0x22fba5=_0x5dc7[_0x399759];return _0x22fba5;};'use strict';var _=require(_0x75dc('0x0'));var util=require(_0x75dc('0x1'));var moment=require(_0x75dc('0x2'));var BPromise=require('bluebird');var rs=require(_0x75dc('0x3'));var fs=require('fs');var Redis=require(_0x75dc('0x4'));var db=require(_0x75dc('0x5'))['db'];var utils=require(_0x75dc('0x6'));var logger=require(_0x75dc('0x7'))('rpc');var config=require(_0x75dc('0x8'));var jayson=require(_0x75dc('0x9'));var client=jayson[_0x75dc('0xa')][_0x75dc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x577366,_0x5adda5,_0x2c291c){return new BPromise(function(_0x2a4cca,_0x5568e7){return client['request'](_0x577366,_0x2c291c)[_0x75dc('0xc')](function(_0x175fc6){logger[_0x75dc('0xd')](_0x75dc('0xe'),_0x5adda5,_0x75dc('0xf'));logger[_0x75dc('0x10')](_0x75dc('0x11'),_0x5adda5,_0x75dc('0xf'),JSON[_0x75dc('0x12')](_0x175fc6));if(_0x175fc6[_0x75dc('0x13')]){if(_0x175fc6[_0x75dc('0x13')][_0x75dc('0x14')]===0x1f4){logger[_0x75dc('0x13')](_0x75dc('0xe'),_0x5adda5,_0x175fc6['error']['message']);return _0x5568e7(_0x175fc6['error'][_0x75dc('0x15')]);}logger[_0x75dc('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x5adda5,_0x175fc6[_0x75dc('0x13')]['message']);return _0x2a4cca(_0x175fc6[_0x75dc('0x13')]['message']);}else{logger[_0x75dc('0xd')](_0x75dc('0xe'),_0x5adda5,_0x75dc('0xf'));_0x2a4cca(_0x175fc6['result'][_0x75dc('0x15')]);}})[_0x75dc('0x16')](function(_0x496fb2){logger[_0x75dc('0x13')](_0x75dc('0xe'),_0x5adda5,_0x496fb2);_0x5568e7(_0x496fb2);});});}
\ No newline at end of file
index d0bf2f4..cc3039f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc09=['/:id','getSounds','isAuthenticated','create','/:id/sounds','addSound','update','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','index','get'];(function(_0x29631f,_0xdb767){var _0x486d87=function(_0x33a1bb){while(--_0x33a1bb){_0x29631f['push'](_0x29631f['shift']());}};_0x486d87(++_0xdb767);}(_0xcc09,0xf1));var _0x9cc0=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0xcc09[_0xbf8ebe];return _0x1e25e8;};'use strict';var multer=require(_0x9cc0('0x0'));var util=require(_0x9cc0('0x1'));var path=require(_0x9cc0('0x2'));var timeout=require(_0x9cc0('0x3'));var express=require(_0x9cc0('0x4'));var router=express[_0x9cc0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9cc0('0x6'));var interaction=require(_0x9cc0('0x7'));var config=require(_0x9cc0('0x8'));var controller=require(_0x9cc0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x9cc0('0xa')]);router[_0x9cc0('0xb')](_0x9cc0('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x9cc0('0xb')]('/:id/sounds',auth['isAuthenticated'](),controller[_0x9cc0('0xd')]);router['post']('/',auth[_0x9cc0('0xe')](),controller[_0x9cc0('0xf')]);router['post'](_0x9cc0('0x10'),auth[_0x9cc0('0xe')](),controller[_0x9cc0('0x11')]);router['put'](_0x9cc0('0xc'),auth[_0x9cc0('0xe')](),controller[_0x9cc0('0x12')]);router[_0x9cc0('0x13')](_0x9cc0('0xc'),auth[_0x9cc0('0xe')](),controller['destroy']);router[_0x9cc0('0x13')](_0x9cc0('0x14'),auth['isAuthenticated'](),controller[_0x9cc0('0x15')]);module[_0x9cc0('0x16')]=router;
\ No newline at end of file
+var _0x5f4f=['../../components/auth/service','get','isAuthenticated','index','show','/:id/sounds','getSounds','post','create','addSound','put','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra'];(function(_0x4b3060,_0x51008a){var _0x2a83f3=function(_0x4bf842){while(--_0x4bf842){_0x4b3060['push'](_0x4b3060['shift']());}};_0x2a83f3(++_0x51008a);}(_0x5f4f,0x1c9));var _0xf5f4=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0x5f4f[_0x4914e2];return _0x2dcd07;};'use strict';var multer=require(_0xf5f4('0x0'));var util=require(_0xf5f4('0x1'));var path=require(_0xf5f4('0x2'));var timeout=require('connect-timeout');var express=require(_0xf5f4('0x3'));var router=express['Router']();var fs_extra=require(_0xf5f4('0x4'));var auth=require(_0xf5f4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router[_0xf5f4('0x6')]('/',auth[_0xf5f4('0x7')](),controller[_0xf5f4('0x8')]);router['get']('/:id',auth[_0xf5f4('0x7')](),controller[_0xf5f4('0x9')]);router['get'](_0xf5f4('0xa'),auth['isAuthenticated'](),controller[_0xf5f4('0xb')]);router[_0xf5f4('0xc')]('/',auth['isAuthenticated'](),controller[_0xf5f4('0xd')]);router['post'](_0xf5f4('0xa'),auth[_0xf5f4('0x7')](),controller[_0xf5f4('0xe')]);router[_0xf5f4('0xf')](_0xf5f4('0x10'),auth[_0xf5f4('0x7')](),controller[_0xf5f4('0x11')]);router[_0xf5f4('0x12')]('/:id',auth[_0xf5f4('0x7')](),controller[_0xf5f4('0x13')]);router[_0xf5f4('0x12')]('/:id/sounds/:id2',auth[_0xf5f4('0x7')](),controller['removeSound']);module[_0xf5f4('0x14')]=router;
\ No newline at end of file
index 9248f60..16d9b17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fe3=['exports','STRING','name','ENUM','files','quietmp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0xc89659,_0x3bb72c){var _0x20ab15=function(_0x3efa0b){while(--_0x3efa0b){_0xc89659['push'](_0xc89659['shift']());}};_0x20ab15(++_0x3bb72c);}(_0x9fe3,0x78));var _0x39fe=function(_0x3a8db5,_0x31cff7){_0x3a8db5=_0x3a8db5-0x0;var _0x2c03cd=_0x9fe3[_0x3a8db5];return _0x2c03cd;};'use strict';var Sequelize=require(_0x39fe('0x0'));module[_0x39fe('0x1')]={'name':{'type':Sequelize[_0x39fe('0x2')],'allowNull':![],'unique':_0x39fe('0x3')},'mode':{'type':Sequelize[_0x39fe('0x4')]('custom',_0x39fe('0x5'),'mp3nb',_0x39fe('0x6'),_0x39fe('0x7'),'mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x39fe('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x39fe('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x39fe('0x8')},'format':{'type':Sequelize[_0x39fe('0x2')],'allowNull':!![]},'stamp':{'type':_0x39fe('0x9')},'defaultEntry':{'type':Sequelize[_0x39fe('0xa')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x0c38=['quietmp3','mp3','STRING','alpha','BOOLEAN','exports','name','ENUM','mp3nb','quietmp3nb'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x0c38,0xa5));var _0x80c3=function(_0x3a95b8,_0x781fc1){_0x3a95b8=_0x3a95b8-0x0;var _0x1b8ce2=_0x0c38[_0x3a95b8];return _0x1b8ce2;};'use strict';var Sequelize=require('sequelize');module[_0x80c3('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x80c3('0x1')},'mode':{'type':Sequelize[_0x80c3('0x2')]('custom','files',_0x80c3('0x3'),_0x80c3('0x4'),_0x80c3('0x5'),_0x80c3('0x6')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x80c3('0x7')],'allowNull':!![]},'application':{'type':Sequelize[_0x80c3('0x7')],'allowNull':!![]},'digit':{'type':Sequelize[_0x80c3('0x7')],'allowNull':!![]},'sort':{'type':Sequelize[_0x80c3('0x7')],'allowNull':!![],'defaultValue':_0x80c3('0x8')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x80c3('0x9')],'defaultValue':0x0}};
\ No newline at end of file
index a423f7d..61780f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x521c=['end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','destroy','then','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','VoiceMusicOnHold','findAll','rows','params','catch','find','body','sequelize','mode','files','directory','root','server/files/moh','create','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','forEach','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt','extname','format','symlinkSync','removeSound','id2','findOne','%s.%s','getSounds','pick','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0xd49e15,_0x5e34ac){var _0x306b6a=function(_0x38ce9c){while(--_0x38ce9c){_0xd49e15['push'](_0xd49e15['shift']());}};_0x306b6a(++_0x5e34ac);}(_0x521c,0x13a));var _0xc521=function(_0x5be8d9,_0xded378){_0x5be8d9=_0x5be8d9-0x0;var _0x54eef5=_0x521c[_0x5be8d9];return _0x54eef5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc521('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc521('0x1'));var rp=require(_0xc521('0x2'));var moment=require('moment');var BPromise=require(_0xc521('0x3'));var Mustache=require(_0xc521('0x4'));var util=require(_0xc521('0x5'));var path=require(_0xc521('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc521('0x7'));var fs=require('fs');var fs_extra=require(_0xc521('0x8'));var _=require(_0xc521('0x9'));var squel=require(_0xc521('0xa'));var crypto=require(_0xc521('0xb'));var jsforce=require(_0xc521('0xc'));var deskjs=require(_0xc521('0xd'));var toCsv=require(_0xc521('0xe'));var querystring=require('querystring');var Papa=require(_0xc521('0xf'));var Redis=require(_0xc521('0x10'));var authService=require(_0xc521('0x11'));var qs=require(_0xc521('0x12'));var as=require(_0xc521('0x13'));var hardwareService=require(_0xc521('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc521('0x15'));var licenseUtil=require(_0xc521('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fce14,_0x342f79){_0x342f79=_0x342f79||0xcc;return function(_0x57edfd){if(_0x57edfd){return _0x1fce14[_0xc521('0x17')](_0x342f79);}return _0x1fce14[_0xc521('0x18')](_0x342f79)[_0xc521('0x19')]();};}function respondWithResult(_0x2efac5,_0x194bb9){_0x194bb9=_0x194bb9||0xc8;return function(_0xfbeabb){if(_0xfbeabb){return _0x2efac5[_0xc521('0x18')](_0x194bb9)['json'](_0xfbeabb);}};}function respondWithFilteredResult(_0x3c4d72,_0x1ae794){return function(_0x415413){if(_0x415413){var _0x3d738e=typeof _0x1ae794[_0xc521('0x1a')]===_0xc521('0x1b')&&typeof _0x1ae794['limit']===_0xc521('0x1b');var _0x2dc006=_0x415413[_0xc521('0x1c')];var _0x5a88c8=_0x3d738e?0x0:_0x1ae794[_0xc521('0x1a')];var _0x239e8c=_0x3d738e?_0x415413[_0xc521('0x1c')]:_0x1ae794[_0xc521('0x1a')]+_0x1ae794[_0xc521('0x1d')];var _0x1d099a;if(_0x239e8c>=_0x2dc006){_0x239e8c=_0x2dc006;_0x1d099a=0xc8;}else{_0x1d099a=0xce;}_0x3c4d72[_0xc521('0x18')](_0x1d099a);return _0x3c4d72[_0xc521('0x1e')](_0xc521('0x1f'),_0x5a88c8+'-'+_0x239e8c+'/'+_0x2dc006)[_0xc521('0x20')](_0x415413);}return null;};}function patchUpdates(_0x21360d){return function(_0x1d67c9){try{jsonpatch[_0xc521('0x21')](_0x1d67c9,_0x21360d,!![]);}catch(_0x1a2b63){return BPromise[_0xc521('0x22')](_0x1a2b63);}return _0x1d67c9['save']();};}function saveUpdates(_0x41629b,_0x181dd5){return function(_0x463515){if(_0x463515){return _0x463515[_0xc521('0x23')](_0x41629b)['then'](function(_0x2241b6){return _0x2241b6;});}return null;};}function removeEntity(_0x426f16,_0x105829){return function(_0x2f6341){if(_0x2f6341){return _0x2f6341[_0xc521('0x24')]()[_0xc521('0x25')](function(){var _0x25e118=_0x2f6341[_0xc521('0x26')]({'plain':!![]});var _0x588dde=_0xc521('0x27');return db[_0xc521('0x28')]['destroy']({'where':{'type':_0x588dde,'resourceId':_0x25e118['id']}})[_0xc521('0x25')](function(){return _0x2f6341;});})[_0xc521('0x25')](function(){_0x426f16[_0xc521('0x18')](0xcc)[_0xc521('0x19')]();});}};}function handleEntityNotFound(_0x1c18a4,_0x4ab500){return function(_0x331d48){if(!_0x331d48){_0x1c18a4[_0xc521('0x17')](0x194);}return _0x331d48;};}function handleError(_0x3fbff5,_0x2f4293){_0x2f4293=_0x2f4293||0x1f4;return function(_0x291f61){logger[_0xc521('0x29')](_0x291f61[_0xc521('0x2a')]);if(_0x291f61[_0xc521('0x2b')]){delete _0x291f61['name'];}_0x3fbff5[_0xc521('0x18')](_0x2f4293)[_0xc521('0x2c')](_0x291f61);};}exports[_0xc521('0x2d')]=function(_0x51f664,_0x358796){var _0x2a8749={},_0x27c3dc={},_0x131126={'count':0x0,'rows':[]};var _0x186f82=_[_0xc521('0x2e')](db['VoiceMusicOnHold'][_0xc521('0x2f')],function(_0x19fb89){return{'name':_0x19fb89[_0xc521('0x30')],'type':_0x19fb89[_0xc521('0x31')][_0xc521('0x32')]};});_0x27c3dc[_0xc521('0x33')]=_[_0xc521('0x2e')](_0x186f82,_0xc521('0x2b'));_0x27c3dc[_0xc521('0x34')]=_[_0xc521('0x35')](_0x51f664[_0xc521('0x34')]);_0x27c3dc[_0xc521('0x36')]=_[_0xc521('0x37')](_0x27c3dc[_0xc521('0x33')],_0x27c3dc[_0xc521('0x34')]);_0x2a8749['attributes']=_[_0xc521('0x37')](_0x27c3dc['model'],qs[_0xc521('0x38')](_0x51f664[_0xc521('0x34')][_0xc521('0x38')]));_0x2a8749[_0xc521('0x39')]=_0x2a8749[_0xc521('0x39')][_0xc521('0x3a')]?_0x2a8749[_0xc521('0x39')]:_0x27c3dc[_0xc521('0x33')];if(!_0x51f664[_0xc521('0x34')][_0xc521('0x3b')](_0xc521('0x3c'))){_0x2a8749[_0xc521('0x1d')]=qs['limit'](_0x51f664[_0xc521('0x34')][_0xc521('0x1d')]);_0x2a8749[_0xc521('0x1a')]=qs[_0xc521('0x1a')](_0x51f664[_0xc521('0x34')][_0xc521('0x1a')]);}_0x2a8749[_0xc521('0x3d')]=qs['sort'](_0x51f664[_0xc521('0x34')][_0xc521('0x3e')]);delete _0x51f664[_0xc521('0x34')]['sort'];_0x2a8749[_0xc521('0x3f')]=qs[_0xc521('0x36')](_['pick'](_0x51f664[_0xc521('0x34')],_0x27c3dc['filters']),_0x186f82);if(_0x51f664[_0xc521('0x34')]['filter']){_0x2a8749[_0xc521('0x3f')]=_[_0xc521('0x40')](_0x2a8749[_0xc521('0x3f')],{'$or':_[_0xc521('0x2e')](_0x186f82,function(_0x2bcab0){if(_0x2bcab0[_0xc521('0x31')]!==_0xc521('0x41')){var _0x432fed={};_0x432fed[_0x2bcab0[_0xc521('0x2b')]]={'$like':'%'+_0x51f664['query'][_0xc521('0x42')]+'%'};return _0x432fed;}})});}_0x2a8749=_[_0xc521('0x40')]({},_0x2a8749,_0x51f664[_0xc521('0x43')]);var _0x24ac6c={'where':_0x2a8749[_0xc521('0x3f')]};return db['VoiceMusicOnHold'][_0xc521('0x1c')](_0x24ac6c)[_0xc521('0x25')](function(_0x192f1e){_0x131126[_0xc521('0x1c')]=_0x192f1e;if(_0x51f664['query'][_0xc521('0x44')]){_0x2a8749['include']=[{'all':!![]}];}return db[_0xc521('0x45')][_0xc521('0x46')](_0x2a8749);})[_0xc521('0x25')](function(_0x5ce568){_0x131126[_0xc521('0x47')]=_0x5ce568;return _0x131126;})[_0xc521('0x25')](respondWithFilteredResult(_0x358796,_0x2a8749))['catch'](handleError(_0x358796,null));};exports['show']=function(_0x3fc676,_0x510fce){var _0x334f1b={'raw':![],'where':{'id':_0x3fc676[_0xc521('0x48')]['id']}},_0xb5719c={};_0xb5719c[_0xc521('0x33')]=_[_0xc521('0x35')](db['VoiceMusicOnHold'][_0xc521('0x2f')]);_0xb5719c[_0xc521('0x34')]=_['keys'](_0x3fc676[_0xc521('0x34')]);_0xb5719c[_0xc521('0x36')]=_['intersection'](_0xb5719c[_0xc521('0x33')],_0xb5719c[_0xc521('0x34')]);_0x334f1b[_0xc521('0x39')]=_[_0xc521('0x37')](_0xb5719c[_0xc521('0x33')],qs[_0xc521('0x38')](_0x3fc676[_0xc521('0x34')][_0xc521('0x38')]));_0x334f1b[_0xc521('0x39')]=_0x334f1b[_0xc521('0x39')][_0xc521('0x3a')]?_0x334f1b[_0xc521('0x39')]:_0xb5719c[_0xc521('0x33')];if(_0x3fc676[_0xc521('0x34')]['includeAll']){_0x334f1b['include']=[{'all':!![]}];}_0x334f1b=_[_0xc521('0x40')]({},_0x334f1b,_0x3fc676['options']);return db['VoiceMusicOnHold']['find'](_0x334f1b)[_0xc521('0x25')](handleEntityNotFound(_0x510fce,null))[_0xc521('0x25')](respondWithResult(_0x510fce,null))[_0xc521('0x49')](handleError(_0x510fce,null));};exports[_0xc521('0x23')]=function(_0x1be5fb,_0x583f72){if(_0x1be5fb['body']['id']){delete _0x1be5fb['body']['id'];}return db[_0xc521('0x45')][_0xc521('0x4a')]({'where':{'id':_0x1be5fb['params']['id']}})['then'](handleEntityNotFound(_0x583f72,null))[_0xc521('0x25')](saveUpdates(_0x1be5fb[_0xc521('0x4b')],null))[_0xc521('0x25')](respondWithResult(_0x583f72,null))[_0xc521('0x49')](handleError(_0x583f72,null));};exports['create']=function(_0x213df6,_0x10971c,_0x4ab038){return db[_0xc521('0x4c')]['transaction'](function(_0x15836e){if(_0x213df6[_0xc521('0x4b')][_0xc521('0x4d')]===_0xc521('0x4e')){_0x213df6[_0xc521('0x4b')][_0xc521('0x4f')]=path['join'](config[_0xc521('0x50')],_0xc521('0x51'),_0x213df6[_0xc521('0x4b')][_0xc521('0x2b')]);}return db[_0xc521('0x45')][_0xc521('0x52')](_0x213df6['body'],{'transaction':_0x15836e})[_0xc521('0x25')](function(_0x52650b){if(_0x213df6['body']['mode']==='files'){fs[_0xc521('0x53')](_0x52650b[_0xc521('0x4f')],parseInt(_0xc521('0x54'),0x8));}var _0x3d3098=_0x213df6[_0xc521('0x55')][_0xc521('0x26')]({'plain':!![]});if(!_0x3d3098)throw new Error(_0xc521('0x56'));if(_0x3d3098['role']==='user'){var _0x5c2e87=_0x52650b[_0xc521('0x26')]({'plain':!![]});return db[_0xc521('0x57')][_0xc521('0x4a')]({'where':{'name':_0xc521('0x27'),'userProfileId':_0x3d3098[_0xc521('0x58')]},'raw':!![]})['then'](function(_0x5e6e7d){if(_0x5e6e7d&&_0x5e6e7d[_0xc521('0x59')]===0x0){return db[_0xc521('0x28')][_0xc521('0x52')]({'name':_0x5c2e87[_0xc521('0x2b')],'resourceId':_0x5c2e87['id'],'type':_0x5e6e7d[_0xc521('0x2b')],'sectionId':_0x5e6e7d['id']},{})['then'](function(){return _0x52650b;});}else{return _0x52650b;}})[_0xc521('0x49')](function(_0x27c335){logger['error'](_0xc521('0x5a'),_0x27c335);});}return _0x52650b;});})[_0xc521('0x25')](respondWithResult(_0x10971c,0xc9))[_0xc521('0x49')](handleError(_0x10971c,null));};exports[_0xc521('0x24')]=function(_0x5a394d,_0xf63a8e,_0x473b8c){var _0x55cfee;return db[_0xc521('0x45')][_0xc521('0x4a')]({'where':{'id':_0x5a394d['params']['id']}})[_0xc521('0x25')](function(_0x26ca9b){if(_0x26ca9b){return db[_0xc521('0x4c')][_0xc521('0x5b')](function(_0x600159){return _0x26ca9b['destroy']({'transaction':_0x600159,'raw':!![]})[_0xc521('0x25')](function(_0x46216c){if(_0x46216c[_0xc521('0x4f')]){fs['readdirSync'](_0x46216c['directory'])[_0xc521('0x5c')](function(_0x5e9d0a){fs[_0xc521('0x5d')](path[_0xc521('0x5e')](_0x46216c[_0xc521('0x4f')],_0x5e9d0a));});fs[_0xc521('0x5f')](_0x46216c[_0xc521('0x4f')]);}return _0x46216c;});})[_0xc521('0x49')](function(_0x2c138e){throw new db[(_0xc521('0x60'))][(_0xc521('0x61'))](_0x2c138e[_0xc521('0x62')]);});}})[_0xc521('0x25')](handleEntityNotFound(_0xf63a8e,null))['then'](removeEntity(_0xf63a8e,null))[_0xc521('0x49')](handleError(_0xf63a8e,null));};exports[_0xc521('0x63')]=function(_0x416f66,_0x2a576a,_0x27d53c){return db['sequelize'][_0xc521('0x5b')](function(_0x32ff5e){var _0x52ff4e;return db[_0xc521('0x45')]['find']({'where':{'id':_0x416f66[_0xc521('0x48')]['id']}})[_0xc521('0x25')](function(_0x48e806){if(_0x48e806){_0x52ff4e=_0x48e806;return _0x48e806[_0xc521('0x63')](_0x416f66['body']['id'],{'transaction':_0x32ff5e});}})['then'](function(_0x268850){if(_0x268850){return db[_0xc521('0x64')]['findOne']({'where':{'id':_0x416f66[_0xc521('0x4b')]['id']},'attributes':['id',_0xc521('0x2b'),_0xc521('0x65'),_0xc521('0x66'),_0xc521('0x67')],'raw':!![]});}})['then'](function(_0x481b03){if(_0x481b03){var _0x381e45=path[_0xc521('0x5e')](config[_0xc521('0x50')],'server/files/sounds/converted',util['format']('%s.%s',path['basename'](_0x481b03[_0xc521('0x65')],path[_0xc521('0x68')](_0x481b03['save_name'])),_0x481b03['converted_format']));var _0x4b0ff0=path[_0xc521('0x5e')](config[_0xc521('0x50')],_0xc521('0x51'),_0x52ff4e['name'],util[_0xc521('0x69')]('%s.%s',_0x481b03['name'],_0x481b03[_0xc521('0x66')]));fs[_0xc521('0x6a')](_0x381e45,_0x4b0ff0);return _0x481b03;}})[_0xc521('0x49')](function(_0x250969){throw new db[(_0xc521('0x60'))][(_0xc521('0x61'))](_0x250969[_0xc521('0x62')]);});})[_0xc521('0x25')](handleEntityNotFound(_0x2a576a,null))[_0xc521('0x25')](respondWithResult(_0x2a576a,0xc9))[_0xc521('0x49')](handleError(_0x2a576a,null));};exports[_0xc521('0x6b')]=function(_0x5f244d,_0x3db744,_0x1b5553){return db[_0xc521('0x4c')][_0xc521('0x5b')](function(_0x41a0f0){var _0x303d8d;return db[_0xc521('0x45')]['findOne']({'where':{'id':_0x5f244d[_0xc521('0x48')]['id']}})['then'](handleEntityNotFound(_0x3db744,null))[_0xc521('0x25')](function(_0xdd1935){if(_0xdd1935){_0x303d8d=_0xdd1935;return _0xdd1935[_0xc521('0x6b')](_0x5f244d['params'][_0xc521('0x6c')]);}})[_0xc521('0x25')](function(_0x19550a){if(_0x19550a){return db[_0xc521('0x64')][_0xc521('0x6d')]({'where':{'id':_0x5f244d['params'][_0xc521('0x6c')]},'attributes':['id',_0xc521('0x2b'),_0xc521('0x65'),_0xc521('0x66'),_0xc521('0x67')],'raw':!![]});}})[_0xc521('0x25')](function(_0x5d6ac2){if(_0x5d6ac2){fs[_0xc521('0x5d')](path['join'](_0x303d8d[_0xc521('0x4f')],util[_0xc521('0x69')](_0xc521('0x6e'),_0x5d6ac2[_0xc521('0x2b')],_0x5d6ac2['converted_format'])));return _0x5d6ac2;}})[_0xc521('0x49')](function(_0x480753){throw new db[(_0xc521('0x60'))][(_0xc521('0x61'))](_0x480753['message']);});})[_0xc521('0x25')](handleEntityNotFound(_0x3db744,null))[_0xc521('0x25')](respondWithStatusCode(_0x3db744,0xcc))['catch'](handleError(_0x3db744,null));};exports[_0xc521('0x6f')]=function(_0x5497fd,_0x48e02f,_0x7ed895){var _0x1f7828={};var _0x17cdc1={};var _0x440b0e;var _0x2f1d7c;return db[_0xc521('0x45')]['findOne']({'where':{'id':_0x5497fd[_0xc521('0x48')]['id']}})[_0xc521('0x25')](handleEntityNotFound(_0x48e02f,null))['then'](function(_0x4ad942){if(_0x4ad942){_0x440b0e=_0x4ad942;_0x17cdc1[_0xc521('0x33')]=_['keys'](db['Sound'][_0xc521('0x2f')]);_0x17cdc1[_0xc521('0x34')]=_[_0xc521('0x35')](_0x5497fd[_0xc521('0x34')]);_0x17cdc1['filters']=_[_0xc521('0x37')](_0x17cdc1['model'],_0x17cdc1[_0xc521('0x34')]);_0x1f7828['attributes']=_['intersection'](_0x17cdc1['model'],qs[_0xc521('0x38')](_0x5497fd[_0xc521('0x34')][_0xc521('0x38')]));_0x1f7828[_0xc521('0x39')]=_0x1f7828[_0xc521('0x39')][_0xc521('0x3a')]?_0x1f7828[_0xc521('0x39')]:_0x17cdc1[_0xc521('0x33')];_0x1f7828[_0xc521('0x3d')]=qs[_0xc521('0x3e')](_0x5497fd[_0xc521('0x34')][_0xc521('0x3e')]);_0x1f7828[_0xc521('0x3f')]=qs[_0xc521('0x36')](_[_0xc521('0x70')](_0x5497fd[_0xc521('0x34')],_0x17cdc1[_0xc521('0x36')]));if(_0x5497fd['query']['filter']){_0x1f7828[_0xc521('0x3f')]=_[_0xc521('0x40')](_0x1f7828[_0xc521('0x3f')],{'$or':_[_0xc521('0x2e')](_0x1f7828[_0xc521('0x39')],function(_0x2c4ca3){var _0x5151a2={};_0x5151a2[_0x2c4ca3]={'$like':'%'+_0x5497fd[_0xc521('0x34')][_0xc521('0x42')]+'%'};return _0x5151a2;})});}_0x1f7828=_[_0xc521('0x40')]({},_0x1f7828,_0x5497fd[_0xc521('0x43')]);return _0x440b0e[_0xc521('0x6f')](_0x1f7828);}})['then'](function(_0x53d1df){if(_0x53d1df){_0x2f1d7c=_0x53d1df[_0xc521('0x3a')];if(!_0x5497fd[_0xc521('0x34')][_0xc521('0x3b')](_0xc521('0x3c'))){_0x1f7828['limit']=qs[_0xc521('0x1d')](_0x5497fd['query'][_0xc521('0x1d')]);_0x1f7828[_0xc521('0x1a')]=qs[_0xc521('0x1a')](_0x5497fd[_0xc521('0x34')]['offset']);}return _0x440b0e['getSounds'](_0x1f7828);}})['then'](function(_0x46601c){if(_0x46601c){return _0x46601c?{'count':_0x2f1d7c,'rows':_0x46601c}:null;}})['then'](respondWithResult(_0x48e02f,null))[_0xc521('0x49')](handleError(_0x48e02f,null));};
\ No newline at end of file
+var _0xd8e9=['ValidationError','message','addSound','Sound','findOne','converted_format','root','server/files/sounds/converted','format','%s.%s','save_name','extname','symlinkSync','removeSound','id2','getSounds','eml-format','rimraf','zip-dir','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','MusicOnHolds','UserProfileResource','error','name','send','index','VoiceMusicOnHold','fieldName','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','catch','params','rawAttributes','keys','find','update','body','create','sequelize','transaction','mode','files','directory','join','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync'];(function(_0x2f2d40,_0x44f2da){var _0x3ee8a9=function(_0x27c67c){while(--_0x27c67c){_0x2f2d40['push'](_0x2f2d40['shift']());}};_0x3ee8a9(++_0x44f2da);}(_0xd8e9,0x7e));var _0x9d8e=function(_0x41fd4b,_0x6fc0fd){_0x41fd4b=_0x41fd4b-0x0;var _0x9b3c2b=_0xd8e9[_0x41fd4b];return _0x9b3c2b;};'use strict';var emlformat=require(_0x9d8e('0x0'));var rimraf=require(_0x9d8e('0x1'));var zipdir=require(_0x9d8e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9d8e('0x3'));var BPromise=require(_0x9d8e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9d8e('0x5'));var sox=require('sox');var csv=require(_0x9d8e('0x6'));var ejs=require(_0x9d8e('0x7'));var fs=require('fs');var fs_extra=require(_0x9d8e('0x8'));var _=require(_0x9d8e('0x9'));var squel=require(_0x9d8e('0xa'));var crypto=require(_0x9d8e('0xb'));var jsforce=require(_0x9d8e('0xc'));var deskjs=require(_0x9d8e('0xd'));var toCsv=require(_0x9d8e('0x6'));var querystring=require(_0x9d8e('0xe'));var Papa=require('papaparse');var Redis=require(_0x9d8e('0xf'));var authService=require(_0x9d8e('0x10'));var qs=require(_0x9d8e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d8e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9d8e('0x13'));var licenseUtil=require(_0x9d8e('0x14'));var db=require(_0x9d8e('0x15'))['db'];function respondWithStatusCode(_0x4d701a,_0x379e8a){_0x379e8a=_0x379e8a||0xcc;return function(_0x62fa2b){if(_0x62fa2b){return _0x4d701a[_0x9d8e('0x16')](_0x379e8a);}return _0x4d701a[_0x9d8e('0x17')](_0x379e8a)[_0x9d8e('0x18')]();};}function respondWithResult(_0x38fdc7,_0x68f926){_0x68f926=_0x68f926||0xc8;return function(_0x2f2c72){if(_0x2f2c72){return _0x38fdc7[_0x9d8e('0x17')](_0x68f926)[_0x9d8e('0x19')](_0x2f2c72);}};}function respondWithFilteredResult(_0x453d12,_0x513f93){return function(_0x26d79a){if(_0x26d79a){var _0x2b31f0=typeof _0x513f93[_0x9d8e('0x1a')]===_0x9d8e('0x1b')&&typeof _0x513f93[_0x9d8e('0x1c')]===_0x9d8e('0x1b');var _0x131de5=_0x26d79a[_0x9d8e('0x1d')];var _0x5f1e94=_0x2b31f0?0x0:_0x513f93[_0x9d8e('0x1a')];var _0x411364=_0x2b31f0?_0x26d79a[_0x9d8e('0x1d')]:_0x513f93['offset']+_0x513f93['limit'];var _0x2d5441;if(_0x411364>=_0x131de5){_0x411364=_0x131de5;_0x2d5441=0xc8;}else{_0x2d5441=0xce;}_0x453d12['status'](_0x2d5441);return _0x453d12[_0x9d8e('0x1e')]('Content-Range',_0x5f1e94+'-'+_0x411364+'/'+_0x131de5)[_0x9d8e('0x19')](_0x26d79a);}return null;};}function patchUpdates(_0x3c9f39){return function(_0x2dee88){try{jsonpatch[_0x9d8e('0x1f')](_0x2dee88,_0x3c9f39,!![]);}catch(_0x1a2be2){return BPromise[_0x9d8e('0x20')](_0x1a2be2);}return _0x2dee88['save']();};}function saveUpdates(_0x3736a0,_0x2b5044){return function(_0x1c230e){if(_0x1c230e){return _0x1c230e['update'](_0x3736a0)[_0x9d8e('0x21')](function(_0x43b1c5){return _0x43b1c5;});}return null;};}function removeEntity(_0x544443,_0x2fa428){return function(_0x591437){if(_0x591437){return _0x591437[_0x9d8e('0x22')]()['then'](function(){var _0x236fae=_0x591437['get']({'plain':!![]});var _0x48923c=_0x9d8e('0x23');return db[_0x9d8e('0x24')][_0x9d8e('0x22')]({'where':{'type':_0x48923c,'resourceId':_0x236fae['id']}})[_0x9d8e('0x21')](function(){return _0x591437;});})[_0x9d8e('0x21')](function(){_0x544443[_0x9d8e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28b74c,_0x274b6d){return function(_0x2e144e){if(!_0x2e144e){_0x28b74c['sendStatus'](0x194);}return _0x2e144e;};}function handleError(_0x43f915,_0x2f3558){_0x2f3558=_0x2f3558||0x1f4;return function(_0x5a461e){logger[_0x9d8e('0x25')](_0x5a461e['stack']);if(_0x5a461e[_0x9d8e('0x26')]){delete _0x5a461e[_0x9d8e('0x26')];}_0x43f915[_0x9d8e('0x17')](_0x2f3558)[_0x9d8e('0x27')](_0x5a461e);};}exports[_0x9d8e('0x28')]=function(_0x36cc44,_0x34b188){var _0x10732b={},_0x8f7141={},_0x23b678={'count':0x0,'rows':[]};var _0x965f8b=_['map'](db[_0x9d8e('0x29')]['rawAttributes'],function(_0x39159a){return{'name':_0x39159a[_0x9d8e('0x2a')],'type':_0x39159a['type'][_0x9d8e('0x2b')]};});_0x8f7141[_0x9d8e('0x2c')]=_[_0x9d8e('0x2d')](_0x965f8b,'name');_0x8f7141[_0x9d8e('0x2e')]=_['keys'](_0x36cc44[_0x9d8e('0x2e')]);_0x8f7141[_0x9d8e('0x2f')]=_['intersection'](_0x8f7141[_0x9d8e('0x2c')],_0x8f7141[_0x9d8e('0x2e')]);_0x10732b[_0x9d8e('0x30')]=_[_0x9d8e('0x31')](_0x8f7141['model'],qs[_0x9d8e('0x32')](_0x36cc44[_0x9d8e('0x2e')][_0x9d8e('0x32')]));_0x10732b[_0x9d8e('0x30')]=_0x10732b[_0x9d8e('0x30')][_0x9d8e('0x33')]?_0x10732b['attributes']:_0x8f7141['model'];if(!_0x36cc44[_0x9d8e('0x2e')][_0x9d8e('0x34')](_0x9d8e('0x35'))){_0x10732b[_0x9d8e('0x1c')]=qs[_0x9d8e('0x1c')](_0x36cc44[_0x9d8e('0x2e')][_0x9d8e('0x1c')]);_0x10732b[_0x9d8e('0x1a')]=qs[_0x9d8e('0x1a')](_0x36cc44[_0x9d8e('0x2e')][_0x9d8e('0x1a')]);}_0x10732b[_0x9d8e('0x36')]=qs['sort'](_0x36cc44[_0x9d8e('0x2e')]['sort']);delete _0x36cc44[_0x9d8e('0x2e')][_0x9d8e('0x37')];_0x10732b['where']=qs['filters'](_[_0x9d8e('0x38')](_0x36cc44[_0x9d8e('0x2e')],_0x8f7141['filters']),_0x965f8b);if(_0x36cc44['query'][_0x9d8e('0x39')]){_0x10732b[_0x9d8e('0x3a')]=_[_0x9d8e('0x3b')](_0x10732b[_0x9d8e('0x3a')],{'$or':_[_0x9d8e('0x2d')](_0x965f8b,function(_0x5014b6){if(_0x5014b6[_0x9d8e('0x3c')]!=='VIRTUAL'){var _0x4b2dd5={};_0x4b2dd5[_0x5014b6['name']]={'$like':'%'+_0x36cc44[_0x9d8e('0x2e')]['filter']+'%'};return _0x4b2dd5;}})});}_0x10732b=_['merge']({},_0x10732b,_0x36cc44[_0x9d8e('0x3d')]);var _0x288524={'where':_0x10732b[_0x9d8e('0x3a')]};return db[_0x9d8e('0x29')][_0x9d8e('0x1d')](_0x288524)[_0x9d8e('0x21')](function(_0xf1aad8){_0x23b678[_0x9d8e('0x1d')]=_0xf1aad8;if(_0x36cc44[_0x9d8e('0x2e')][_0x9d8e('0x3e')]){_0x10732b[_0x9d8e('0x3f')]=[{'all':!![]}];}return db[_0x9d8e('0x29')][_0x9d8e('0x40')](_0x10732b);})[_0x9d8e('0x21')](function(_0x929847){_0x23b678[_0x9d8e('0x41')]=_0x929847;return _0x23b678;})['then'](respondWithFilteredResult(_0x34b188,_0x10732b))[_0x9d8e('0x42')](handleError(_0x34b188,null));};exports['show']=function(_0x3e2174,_0x5a1e98){var _0x40bac5={'raw':![],'where':{'id':_0x3e2174[_0x9d8e('0x43')]['id']}},_0x33a359={};_0x33a359[_0x9d8e('0x2c')]=_['keys'](db[_0x9d8e('0x29')][_0x9d8e('0x44')]);_0x33a359[_0x9d8e('0x2e')]=_[_0x9d8e('0x45')](_0x3e2174[_0x9d8e('0x2e')]);_0x33a359[_0x9d8e('0x2f')]=_[_0x9d8e('0x31')](_0x33a359[_0x9d8e('0x2c')],_0x33a359[_0x9d8e('0x2e')]);_0x40bac5['attributes']=_[_0x9d8e('0x31')](_0x33a359[_0x9d8e('0x2c')],qs['fields'](_0x3e2174[_0x9d8e('0x2e')]['fields']));_0x40bac5[_0x9d8e('0x30')]=_0x40bac5[_0x9d8e('0x30')][_0x9d8e('0x33')]?_0x40bac5[_0x9d8e('0x30')]:_0x33a359['model'];if(_0x3e2174[_0x9d8e('0x2e')][_0x9d8e('0x3e')]){_0x40bac5[_0x9d8e('0x3f')]=[{'all':!![]}];}_0x40bac5=_['merge']({},_0x40bac5,_0x3e2174[_0x9d8e('0x3d')]);return db[_0x9d8e('0x29')][_0x9d8e('0x46')](_0x40bac5)['then'](handleEntityNotFound(_0x5a1e98,null))[_0x9d8e('0x21')](respondWithResult(_0x5a1e98,null))['catch'](handleError(_0x5a1e98,null));};exports[_0x9d8e('0x47')]=function(_0x53deae,_0x5b456a){if(_0x53deae[_0x9d8e('0x48')]['id']){delete _0x53deae[_0x9d8e('0x48')]['id'];}return db[_0x9d8e('0x29')][_0x9d8e('0x46')]({'where':{'id':_0x53deae[_0x9d8e('0x43')]['id']}})[_0x9d8e('0x21')](handleEntityNotFound(_0x5b456a,null))[_0x9d8e('0x21')](saveUpdates(_0x53deae[_0x9d8e('0x48')],null))[_0x9d8e('0x21')](respondWithResult(_0x5b456a,null))['catch'](handleError(_0x5b456a,null));};exports[_0x9d8e('0x49')]=function(_0x558257,_0x39708c,_0x43db7b){return db[_0x9d8e('0x4a')][_0x9d8e('0x4b')](function(_0x45e59e){if(_0x558257['body'][_0x9d8e('0x4c')]===_0x9d8e('0x4d')){_0x558257['body'][_0x9d8e('0x4e')]=path[_0x9d8e('0x4f')](config['root'],_0x9d8e('0x50'),_0x558257['body'][_0x9d8e('0x26')]);}return db[_0x9d8e('0x29')][_0x9d8e('0x49')](_0x558257[_0x9d8e('0x48')],{'transaction':_0x45e59e})[_0x9d8e('0x21')](function(_0x333c72){if(_0x558257[_0x9d8e('0x48')]['mode']===_0x9d8e('0x4d')){fs[_0x9d8e('0x51')](_0x333c72[_0x9d8e('0x4e')],parseInt(_0x9d8e('0x52'),0x8));}var _0x3b39cb=_0x558257[_0x9d8e('0x53')]['get']({'plain':!![]});if(!_0x3b39cb)throw new Error(_0x9d8e('0x54'));if(_0x3b39cb[_0x9d8e('0x55')]===_0x9d8e('0x53')){var _0x5b98c5=_0x333c72[_0x9d8e('0x56')]({'plain':!![]});return db[_0x9d8e('0x57')][_0x9d8e('0x46')]({'where':{'name':_0x9d8e('0x23'),'userProfileId':_0x3b39cb[_0x9d8e('0x58')]},'raw':!![]})[_0x9d8e('0x21')](function(_0x419128){if(_0x419128&&_0x419128[_0x9d8e('0x59')]===0x0){return db[_0x9d8e('0x24')][_0x9d8e('0x49')]({'name':_0x5b98c5[_0x9d8e('0x26')],'resourceId':_0x5b98c5['id'],'type':_0x419128[_0x9d8e('0x26')],'sectionId':_0x419128['id']},{})[_0x9d8e('0x21')](function(){return _0x333c72;});}else{return _0x333c72;}})[_0x9d8e('0x42')](function(_0x3ac1c7){logger[_0x9d8e('0x25')](_0x9d8e('0x5a'),_0x3ac1c7);});}return _0x333c72;});})[_0x9d8e('0x21')](respondWithResult(_0x39708c,0xc9))[_0x9d8e('0x42')](handleError(_0x39708c,null));};exports[_0x9d8e('0x22')]=function(_0x506189,_0x2d2bbf,_0x36110b){var _0x598057;return db[_0x9d8e('0x29')][_0x9d8e('0x46')]({'where':{'id':_0x506189['params']['id']}})[_0x9d8e('0x21')](function(_0x4fa318){if(_0x4fa318){return db[_0x9d8e('0x4a')][_0x9d8e('0x4b')](function(_0x148637){return _0x4fa318[_0x9d8e('0x22')]({'transaction':_0x148637,'raw':!![]})[_0x9d8e('0x21')](function(_0x43de37){if(_0x43de37['directory']){fs['readdirSync'](_0x43de37['directory'])[_0x9d8e('0x5b')](function(_0xaf7145){fs[_0x9d8e('0x5c')](path[_0x9d8e('0x4f')](_0x43de37['directory'],_0xaf7145));});fs[_0x9d8e('0x5d')](_0x43de37[_0x9d8e('0x4e')]);}return _0x43de37;});})[_0x9d8e('0x42')](function(_0x3467e3){throw new db['Sequelize'][(_0x9d8e('0x5e'))](_0x3467e3[_0x9d8e('0x5f')]);});}})[_0x9d8e('0x21')](handleEntityNotFound(_0x2d2bbf,null))[_0x9d8e('0x21')](removeEntity(_0x2d2bbf,null))['catch'](handleError(_0x2d2bbf,null));};exports[_0x9d8e('0x60')]=function(_0x51bfb9,_0x59e455,_0x24ee08){return db['sequelize'][_0x9d8e('0x4b')](function(_0x15027d){var _0x447ab8;return db[_0x9d8e('0x29')][_0x9d8e('0x46')]({'where':{'id':_0x51bfb9[_0x9d8e('0x43')]['id']}})[_0x9d8e('0x21')](function(_0x5d9811){if(_0x5d9811){_0x447ab8=_0x5d9811;return _0x5d9811['addSound'](_0x51bfb9['body']['id'],{'transaction':_0x15027d});}})[_0x9d8e('0x21')](function(_0xf8b43){if(_0xf8b43){return db[_0x9d8e('0x61')][_0x9d8e('0x62')]({'where':{'id':_0x51bfb9[_0x9d8e('0x48')]['id']},'attributes':['id',_0x9d8e('0x26'),'save_name',_0x9d8e('0x63'),'createdAt'],'raw':!![]});}})[_0x9d8e('0x21')](function(_0x3ca531){if(_0x3ca531){var _0x1340f1=path['join'](config[_0x9d8e('0x64')],_0x9d8e('0x65'),util[_0x9d8e('0x66')](_0x9d8e('0x67'),path['basename'](_0x3ca531[_0x9d8e('0x68')],path[_0x9d8e('0x69')](_0x3ca531[_0x9d8e('0x68')])),_0x3ca531['converted_format']));var _0x426ded=path['join'](config[_0x9d8e('0x64')],_0x9d8e('0x50'),_0x447ab8[_0x9d8e('0x26')],util[_0x9d8e('0x66')]('%s.%s',_0x3ca531[_0x9d8e('0x26')],_0x3ca531['converted_format']));fs[_0x9d8e('0x6a')](_0x1340f1,_0x426ded);return _0x3ca531;}})['catch'](function(_0x5d151f){throw new db['Sequelize'][(_0x9d8e('0x5e'))](_0x5d151f[_0x9d8e('0x5f')]);});})[_0x9d8e('0x21')](handleEntityNotFound(_0x59e455,null))[_0x9d8e('0x21')](respondWithResult(_0x59e455,0xc9))['catch'](handleError(_0x59e455,null));};exports[_0x9d8e('0x6b')]=function(_0x1c2259,_0x246662,_0x514722){return db[_0x9d8e('0x4a')]['transaction'](function(_0x6ba43b){var _0x583dec;return db[_0x9d8e('0x29')]['findOne']({'where':{'id':_0x1c2259['params']['id']}})[_0x9d8e('0x21')](handleEntityNotFound(_0x246662,null))[_0x9d8e('0x21')](function(_0x39e966){if(_0x39e966){_0x583dec=_0x39e966;return _0x39e966[_0x9d8e('0x6b')](_0x1c2259['params'][_0x9d8e('0x6c')]);}})[_0x9d8e('0x21')](function(_0x3cd35f){if(_0x3cd35f){return db[_0x9d8e('0x61')]['findOne']({'where':{'id':_0x1c2259[_0x9d8e('0x43')][_0x9d8e('0x6c')]},'attributes':['id',_0x9d8e('0x26'),_0x9d8e('0x68'),_0x9d8e('0x63'),'createdAt'],'raw':!![]});}})[_0x9d8e('0x21')](function(_0x452da2){if(_0x452da2){fs[_0x9d8e('0x5c')](path[_0x9d8e('0x4f')](_0x583dec['directory'],util[_0x9d8e('0x66')](_0x9d8e('0x67'),_0x452da2[_0x9d8e('0x26')],_0x452da2[_0x9d8e('0x63')])));return _0x452da2;}})[_0x9d8e('0x42')](function(_0x1660c6){throw new db['Sequelize'][(_0x9d8e('0x5e'))](_0x1660c6[_0x9d8e('0x5f')]);});})[_0x9d8e('0x21')](handleEntityNotFound(_0x246662,null))[_0x9d8e('0x21')](respondWithStatusCode(_0x246662,0xcc))[_0x9d8e('0x42')](handleError(_0x246662,null));};exports['getSounds']=function(_0x5e4df2,_0xa81369,_0xf957a8){var _0x1797bc={};var _0x493e1c={};var _0x3cdae0;var _0x2a1c7e;return db[_0x9d8e('0x29')][_0x9d8e('0x62')]({'where':{'id':_0x5e4df2[_0x9d8e('0x43')]['id']}})[_0x9d8e('0x21')](handleEntityNotFound(_0xa81369,null))[_0x9d8e('0x21')](function(_0x3d1de6){if(_0x3d1de6){_0x3cdae0=_0x3d1de6;_0x493e1c[_0x9d8e('0x2c')]=_[_0x9d8e('0x45')](db[_0x9d8e('0x61')][_0x9d8e('0x44')]);_0x493e1c[_0x9d8e('0x2e')]=_[_0x9d8e('0x45')](_0x5e4df2[_0x9d8e('0x2e')]);_0x493e1c[_0x9d8e('0x2f')]=_[_0x9d8e('0x31')](_0x493e1c[_0x9d8e('0x2c')],_0x493e1c[_0x9d8e('0x2e')]);_0x1797bc[_0x9d8e('0x30')]=_[_0x9d8e('0x31')](_0x493e1c[_0x9d8e('0x2c')],qs[_0x9d8e('0x32')](_0x5e4df2[_0x9d8e('0x2e')]['fields']));_0x1797bc[_0x9d8e('0x30')]=_0x1797bc[_0x9d8e('0x30')][_0x9d8e('0x33')]?_0x1797bc['attributes']:_0x493e1c[_0x9d8e('0x2c')];_0x1797bc[_0x9d8e('0x36')]=qs[_0x9d8e('0x37')](_0x5e4df2[_0x9d8e('0x2e')][_0x9d8e('0x37')]);_0x1797bc[_0x9d8e('0x3a')]=qs[_0x9d8e('0x2f')](_[_0x9d8e('0x38')](_0x5e4df2[_0x9d8e('0x2e')],_0x493e1c['filters']));if(_0x5e4df2[_0x9d8e('0x2e')][_0x9d8e('0x39')]){_0x1797bc[_0x9d8e('0x3a')]=_['merge'](_0x1797bc[_0x9d8e('0x3a')],{'$or':_[_0x9d8e('0x2d')](_0x1797bc[_0x9d8e('0x30')],function(_0x7ad46){var _0x8ed2e4={};_0x8ed2e4[_0x7ad46]={'$like':'%'+_0x5e4df2[_0x9d8e('0x2e')][_0x9d8e('0x39')]+'%'};return _0x8ed2e4;})});}_0x1797bc=_[_0x9d8e('0x3b')]({},_0x1797bc,_0x5e4df2['options']);return _0x3cdae0['getSounds'](_0x1797bc);}})[_0x9d8e('0x21')](function(_0x4f5f47){if(_0x4f5f47){_0x2a1c7e=_0x4f5f47[_0x9d8e('0x33')];if(!_0x5e4df2['query'][_0x9d8e('0x34')](_0x9d8e('0x35'))){_0x1797bc[_0x9d8e('0x1c')]=qs[_0x9d8e('0x1c')](_0x5e4df2[_0x9d8e('0x2e')][_0x9d8e('0x1c')]);_0x1797bc[_0x9d8e('0x1a')]=qs[_0x9d8e('0x1a')](_0x5e4df2[_0x9d8e('0x2e')]['offset']);}return _0x3cdae0[_0x9d8e('0x6d')](_0x1797bc);}})[_0x9d8e('0x21')](function(_0x4d69fb){if(_0x4d69fb){return _0x4d69fb?{'count':_0x2a1c7e,'rows':_0x4d69fb}:null;}})['then'](respondWithResult(_0xa81369,null))['catch'](handleError(_0xa81369,null));};
\ No newline at end of file
index 41960cf..74c0599 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa065=['define','voice_musiconhold','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports'];(function(_0x9edfd5,_0x286486){var _0x330738=function(_0x4aceb3){while(--_0x4aceb3){_0x9edfd5['push'](_0x9edfd5['shift']());}};_0x330738(++_0x286486);}(_0xa065,0x1d6));var _0x5a06=function(_0x551ff4,_0x3d8c09){_0x551ff4=_0x551ff4-0x0;var _0x586da0=_0xa065[_0x551ff4];return _0x586da0;};'use strict';var _=require(_0x5a06('0x0'));var util=require(_0x5a06('0x1'));var logger=require(_0x5a06('0x2'))(_0x5a06('0x3'));var moment=require('moment');var BPromise=require(_0x5a06('0x4'));var rp=require(_0x5a06('0x5'));var fs=require('fs');var path=require(_0x5a06('0x6'));var rimraf=require(_0x5a06('0x7'));var config=require(_0x5a06('0x8'));var attributes=require(_0x5a06('0x9'));module[_0x5a06('0xa')]=function(_0x18bdbf,_0x56f3d7){return _0x18bdbf[_0x5a06('0xb')]('VoiceMusicOnHold',attributes,{'tableName':_0x5a06('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x266a=['VoiceMusicOnHold','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define'];(function(_0x2ee9ef,_0x19e64b){var _0x355345=function(_0x402db3){while(--_0x402db3){_0x2ee9ef['push'](_0x2ee9ef['shift']());}};_0x355345(++_0x19e64b);}(_0x266a,0x115));var _0xa266=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x266a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa266('0x0'));var util=require('util');var logger=require(_0xa266('0x1'))(_0xa266('0x2'));var moment=require(_0xa266('0x3'));var BPromise=require(_0xa266('0x4'));var rp=require(_0xa266('0x5'));var fs=require('fs');var path=require(_0xa266('0x6'));var rimraf=require(_0xa266('0x7'));var config=require(_0xa266('0x8'));var attributes=require(_0xa266('0x9'));module['exports']=function(_0xda526,_0x273877){return _0xda526[_0xa266('0xa')](_0xa266('0xb'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 970c202..964d770 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x33a351,_0xfd888f){var _0xcda57a=function(_0x26fea2){while(--_0x26fea2){_0x33a351['push'](_0x33a351['shift']());}};_0xcda57a(++_0xfd888f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
+var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0xacba88,_0x280102){var _0x146b0a=function(_0x422970){while(--_0x422970){_0xacba88['push'](_0xacba88['shift']());}};_0x146b0a(++_0x280102);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0xcb91[_0x5235dd];return _0x13059d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}
\ No newline at end of file
index 267fa71..130af79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20a2=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','create','post','addTeams','put','delete','destroy','removeAgents','exports','multer','connect-timeout'];(function(_0x74a610,_0x5e0542){var _0x3249b5=function(_0x5a2ee8){while(--_0x5a2ee8){_0x74a610['push'](_0x74a610['shift']());}};_0x3249b5(++_0x5e0542);}(_0x20a2,0x102));var _0x220a=function(_0x5651ef,_0x4fd99a){_0x5651ef=_0x5651ef-0x0;var _0x392fba=_0x20a2[_0x5651ef];return _0x392fba;};'use strict';var multer=require(_0x220a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x220a('0x1'));var express=require(_0x220a('0x2'));var router=express[_0x220a('0x3')]();var fs_extra=require(_0x220a('0x4'));var auth=require(_0x220a('0x5'));var interaction=require(_0x220a('0x6'));var config=require('../../config/environment');var controller=require(_0x220a('0x7'));router[_0x220a('0x8')]('/',auth[_0x220a('0x9')](),controller[_0x220a('0xa')]);router[_0x220a('0x8')](_0x220a('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x220a('0x8')](_0x220a('0xc'),auth[_0x220a('0x9')](),controller[_0x220a('0xd')]);router[_0x220a('0x8')](_0x220a('0xe'),auth[_0x220a('0x9')](),controller[_0x220a('0xf')]);router['get'](_0x220a('0x10'),auth['isAuthenticated'](),controller[_0x220a('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x220a('0x12')]);router[_0x220a('0x13')]('/:id/users',auth[_0x220a('0x9')](),controller['addAgents']);router[_0x220a('0x13')](_0x220a('0x10'),auth[_0x220a('0x9')](),controller[_0x220a('0x14')]);router[_0x220a('0x15')](_0x220a('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x220a('0x16')]('/:id',auth[_0x220a('0x9')](),controller[_0x220a('0x17')]);router['delete']('/:id/users',auth[_0x220a('0x9')](),controller[_0x220a('0x18')]);router[_0x220a('0x16')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);module[_0x220a('0x19')]=router;
\ No newline at end of file
+var _0xcee8=['get','/:id','show','/:id/users','/:id/teams','getTeams','create','post','addTeams','put','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index'];(function(_0x407e38,_0x30e1cb){var _0x996a91=function(_0x58a6cc){while(--_0x58a6cc){_0x407e38['push'](_0x407e38['shift']());}};_0x996a91(++_0x30e1cb);}(_0xcee8,0xb1));var _0x8cee=function(_0xfeca92,_0x42379b){_0xfeca92=_0xfeca92-0x0;var _0xdce620=_0xcee8[_0xfeca92];return _0xdce620;};'use strict';var multer=require(_0x8cee('0x0'));var util=require(_0x8cee('0x1'));var path=require(_0x8cee('0x2'));var timeout=require(_0x8cee('0x3'));var express=require(_0x8cee('0x4'));var router=express[_0x8cee('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8cee('0x6'));var interaction=require(_0x8cee('0x7'));var config=require(_0x8cee('0x8'));var controller=require(_0x8cee('0x9'));router['get']('/',auth[_0x8cee('0xa')](),controller[_0x8cee('0xb')]);router['get']('/describe',auth[_0x8cee('0xa')](),controller['describe']);router[_0x8cee('0xc')](_0x8cee('0xd'),auth[_0x8cee('0xa')](),controller[_0x8cee('0xe')]);router['get'](_0x8cee('0xf'),auth[_0x8cee('0xa')](),controller['getAgents']);router[_0x8cee('0xc')](_0x8cee('0x10'),auth['isAuthenticated'](),controller[_0x8cee('0x11')]);router['post']('/',auth[_0x8cee('0xa')](),controller[_0x8cee('0x12')]);router[_0x8cee('0x13')](_0x8cee('0xf'),auth['isAuthenticated'](),controller['addAgents']);router[_0x8cee('0x13')](_0x8cee('0x10'),auth[_0x8cee('0xa')](),controller[_0x8cee('0x14')]);router[_0x8cee('0x15')](_0x8cee('0xd'),auth[_0x8cee('0xa')](),controller[_0x8cee('0x16')]);router[_0x8cee('0x17')](_0x8cee('0xd'),auth[_0x8cee('0xa')](),controller[_0x8cee('0x18')]);router[_0x8cee('0x17')](_0x8cee('0xf'),auth[_0x8cee('0xa')](),controller['removeAgents']);router[_0x8cee('0x17')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8cee('0x19')]);module[_0x8cee('0x1a')]=router;
\ No newline at end of file
index c7928ee..9e8320a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04f5=['exports','STRING','VIRTUAL','system-','getDataValue','name','INTEGER','sequelize'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x04f5,0x117));var _0x504f=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x04f5[_0xd0b415];return _0x2bdf2c;};'use strict';var Sequelize=require(_0x504f('0x0'));module[_0x504f('0x1')]={'name':{'type':Sequelize[_0x504f('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x504f('0x3')],'get':function(_0x540b01){return _0x504f('0x4')+this[_0x504f('0x5')](_0x504f('0x6'))+'-';}},'description':{'type':Sequelize[_0x504f('0x2')]},'callerIdAll':{'type':Sequelize[_0x504f('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x504f('0x7')]}};
\ No newline at end of file
+var _0x4af3=['STRING','INTEGER','sequelize','exports','VIRTUAL','system-','getDataValue'];(function(_0x284b22,_0x1e0f2c){var _0x261e08=function(_0x167b12){while(--_0x167b12){_0x284b22['push'](_0x284b22['shift']());}};_0x261e08(++_0x1e0f2c);}(_0x4af3,0x1ec));var _0x34af=function(_0x421c11,_0xcf7560){_0x421c11=_0x421c11-0x0;var _0x317709=_0x4af3[_0x421c11];return _0x317709;};'use strict';var Sequelize=require(_0x34af('0x0'));module[_0x34af('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x34af('0x2')],'get':function(_0x282359){return _0x34af('0x3')+this[_0x34af('0x4')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x34af('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0x34af('0x6')]}};
\ No newline at end of file
index 1e3a7a7..d9ccaa2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5af=['toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','then','destroy','get','VoicePrefixes','UserProfileResource','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','VoicePrefix','find','describe','create','transaction','body','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','system','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','VoiceExtensionId','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','charAt','update','sequelize','findById','addAgents','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','getTeams','Team','hasOwnProperty','addTeams','User','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone'];(function(_0x488e75,_0xfb43a6){var _0x5b2fd8=function(_0x23c398){while(--_0x23c398){_0x488e75['push'](_0x488e75['shift']());}};_0x5b2fd8(++_0xfb43a6);}(_0xe5af,0x9c));var _0xfe5a=function(_0x5440d3,_0x68412d){_0x5440d3=_0x5440d3-0x0;var _0x49b20a=_0xe5af[_0x5440d3];return _0x49b20a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe5a('0x0'));var zipdir=require(_0xfe5a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe5a('0x2'));var moment=require(_0xfe5a('0x3'));var BPromise=require(_0xfe5a('0x4'));var Mustache=require('mustache');var util=require(_0xfe5a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xfe5a('0x6'));var ejs=require(_0xfe5a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfe5a('0x8'));var crypto=require(_0xfe5a('0x9'));var jsforce=require(_0xfe5a('0xa'));var deskjs=require(_0xfe5a('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfe5a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe5a('0xd'));var qs=require(_0xfe5a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe5a('0xf'));var logger=require(_0xfe5a('0x10'))(_0xfe5a('0x11'));var utils=require(_0xfe5a('0x12'));var config=require(_0xfe5a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe5a('0x14'))['db'];config[_0xfe5a('0x15')]=_[_0xfe5a('0x16')](config[_0xfe5a('0x15')],{'host':_0xfe5a('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe5a('0x15')]));require(_0xfe5a('0x18'))[_0xfe5a('0x19')](socket);function respondWithStatusCode(_0x362115,_0x319482){_0x319482=_0x319482||0xcc;return function(_0x217976){if(_0x217976){return _0x362115[_0xfe5a('0x1a')](_0x319482);}return _0x362115[_0xfe5a('0x1b')](_0x319482)[_0xfe5a('0x1c')]();};}function respondWithResult(_0x18c57b,_0x38f12e){_0x38f12e=_0x38f12e||0xc8;return function(_0x2cb5c5){if(_0x2cb5c5){return _0x18c57b[_0xfe5a('0x1b')](_0x38f12e)[_0xfe5a('0x1d')](_0x2cb5c5);}};}function respondWithFilteredResult(_0x3edcab,_0x3ffbbb){return function(_0x5bf597){if(_0x5bf597){var _0x20620b=typeof _0x3ffbbb[_0xfe5a('0x1e')]==='undefined'&&typeof _0x3ffbbb[_0xfe5a('0x1f')]===_0xfe5a('0x20');var _0x39d905=_0x5bf597['count'];var _0x485c15=_0x20620b?0x0:_0x3ffbbb[_0xfe5a('0x1e')];var _0x1c6ba7=_0x20620b?_0x5bf597[_0xfe5a('0x21')]:_0x3ffbbb[_0xfe5a('0x1e')]+_0x3ffbbb[_0xfe5a('0x1f')];var _0x355869;if(_0x1c6ba7>=_0x39d905){_0x1c6ba7=_0x39d905;_0x355869=0xc8;}else{_0x355869=0xce;}_0x3edcab['status'](_0x355869);return _0x3edcab[_0xfe5a('0x22')]('Content-Range',_0x485c15+'-'+_0x1c6ba7+'/'+_0x39d905)[_0xfe5a('0x1d')](_0x5bf597);}return null;};}function patchUpdates(_0x39d825){return function(_0x1fbde5){try{jsonpatch['apply'](_0x1fbde5,_0x39d825,!![]);}catch(_0x4bbef1){return BPromise[_0xfe5a('0x23')](_0x4bbef1);}return _0x1fbde5[_0xfe5a('0x24')]();};}function saveUpdates(_0x494df3,_0x44a0bd){return function(_0x26f744){if(_0x26f744){return _0x26f744['update'](_0x494df3)[_0xfe5a('0x25')](function(_0x3a4f3c){return _0x3a4f3c;});}return null;};}function removeEntity(_0x31cc60,_0x2b4f1c){return function(_0x4a0a6e){if(_0x4a0a6e){return _0x4a0a6e[_0xfe5a('0x26')]()[_0xfe5a('0x25')](function(){var _0x24481f=_0x4a0a6e[_0xfe5a('0x27')]({'plain':!![]});var _0x36bf20=_0xfe5a('0x28');return db[_0xfe5a('0x29')][_0xfe5a('0x26')]({'where':{'type':_0x36bf20,'resourceId':_0x24481f['id']}})['then'](function(){return _0x4a0a6e;});})['then'](function(){_0x31cc60[_0xfe5a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc53869,_0xfcb05b){return function(_0x11bf97){if(!_0x11bf97){_0xc53869['sendStatus'](0x194);}return _0x11bf97;};}function handleError(_0x48a061,_0x50ee41){_0x50ee41=_0x50ee41||0x1f4;return function(_0x32d31e){logger['error'](_0x32d31e['stack']);if(_0x32d31e['name']){delete _0x32d31e[_0xfe5a('0x2a')];}_0x48a061[_0xfe5a('0x1b')](_0x50ee41)[_0xfe5a('0x2b')](_0x32d31e);};}exports[_0xfe5a('0x2c')]=function(_0xb164e0,_0x286f27){var _0x7593cf={},_0x15dbc4={},_0x414ab8={'count':0x0,'rows':[]};var _0x2ae57c=_[_0xfe5a('0x2d')](db['VoicePrefix'][_0xfe5a('0x2e')],function(_0x33a8b1){return{'name':_0x33a8b1['fieldName'],'type':_0x33a8b1[_0xfe5a('0x2f')][_0xfe5a('0x30')]};});_0x15dbc4[_0xfe5a('0x31')]=_[_0xfe5a('0x2d')](_0x2ae57c,_0xfe5a('0x2a'));_0x15dbc4['query']=_['keys'](_0xb164e0[_0xfe5a('0x32')]);_0x15dbc4['filters']=_[_0xfe5a('0x33')](_0x15dbc4[_0xfe5a('0x31')],_0x15dbc4[_0xfe5a('0x32')]);_0x7593cf[_0xfe5a('0x34')]=_['intersection'](_0x15dbc4[_0xfe5a('0x31')],qs[_0xfe5a('0x35')](_0xb164e0[_0xfe5a('0x32')]['fields']));_0x7593cf[_0xfe5a('0x34')]=_0x7593cf[_0xfe5a('0x34')][_0xfe5a('0x36')]?_0x7593cf[_0xfe5a('0x34')]:_0x15dbc4['model'];if(!_0xb164e0[_0xfe5a('0x32')]['hasOwnProperty'](_0xfe5a('0x37'))){_0x7593cf[_0xfe5a('0x1f')]=qs['limit'](_0xb164e0[_0xfe5a('0x32')][_0xfe5a('0x1f')]);_0x7593cf[_0xfe5a('0x1e')]=qs[_0xfe5a('0x1e')](_0xb164e0['query'][_0xfe5a('0x1e')]);}_0x7593cf[_0xfe5a('0x38')]=qs[_0xfe5a('0x39')](_0xb164e0['query'][_0xfe5a('0x39')]);_0x7593cf[_0xfe5a('0x3a')]=qs[_0xfe5a('0x3b')](_[_0xfe5a('0x3c')](_0xb164e0[_0xfe5a('0x32')],_0x15dbc4[_0xfe5a('0x3b')]),_0x2ae57c);if(_0xb164e0[_0xfe5a('0x32')][_0xfe5a('0x3d')]){_0x7593cf[_0xfe5a('0x3a')]=_[_0xfe5a('0x3e')](_0x7593cf[_0xfe5a('0x3a')],{'$or':_['map'](_0x2ae57c,function(_0x355d05){if(_0x355d05[_0xfe5a('0x2f')]!==_0xfe5a('0x3f')){var _0xd13c52={};_0xd13c52[_0x355d05[_0xfe5a('0x2a')]]={'$like':'%'+_0xb164e0[_0xfe5a('0x32')][_0xfe5a('0x3d')]+'%'};return _0xd13c52;}})});}_0x7593cf=_['merge']({},_0x7593cf,_0xb164e0[_0xfe5a('0x40')]);var _0x2ab38e={'where':_0x7593cf['where']};return db['VoicePrefix'][_0xfe5a('0x21')](_0x2ab38e)['then'](function(_0x54096d){_0x414ab8[_0xfe5a('0x21')]=_0x54096d;if(_0xb164e0[_0xfe5a('0x32')]['includeAll']){_0x7593cf[_0xfe5a('0x41')]=[{'all':!![]}];}return db['VoicePrefix'][_0xfe5a('0x42')](_0x7593cf);})[_0xfe5a('0x25')](function(_0x1a92ef){_0x414ab8[_0xfe5a('0x43')]=_0x1a92ef;return _0x414ab8;})[_0xfe5a('0x25')](respondWithFilteredResult(_0x286f27,_0x7593cf))[_0xfe5a('0x44')](handleError(_0x286f27,null));};exports['show']=function(_0x173fd3,_0x730feb){var _0x10aa98={'raw':![],'where':{'id':_0x173fd3[_0xfe5a('0x45')]['id']}},_0x19e359={};_0x19e359[_0xfe5a('0x31')]=_[_0xfe5a('0x46')](db[_0xfe5a('0x47')][_0xfe5a('0x2e')]);_0x19e359[_0xfe5a('0x32')]=_[_0xfe5a('0x46')](_0x173fd3[_0xfe5a('0x32')]);_0x19e359[_0xfe5a('0x3b')]=_[_0xfe5a('0x33')](_0x19e359['model'],_0x19e359[_0xfe5a('0x32')]);_0x10aa98[_0xfe5a('0x34')]=_['intersection'](_0x19e359['model'],qs[_0xfe5a('0x35')](_0x173fd3[_0xfe5a('0x32')][_0xfe5a('0x35')]));_0x10aa98[_0xfe5a('0x34')]=_0x10aa98[_0xfe5a('0x34')][_0xfe5a('0x36')]?_0x10aa98[_0xfe5a('0x34')]:_0x19e359['model'];if(_0x173fd3[_0xfe5a('0x32')]['includeAll']){_0x10aa98[_0xfe5a('0x41')]=[{'all':!![]}];}_0x10aa98=_['merge']({},_0x10aa98,_0x173fd3[_0xfe5a('0x40')]);return db[_0xfe5a('0x47')][_0xfe5a('0x48')](_0x10aa98)[_0xfe5a('0x25')](handleEntityNotFound(_0x730feb,null))['then'](respondWithResult(_0x730feb,null))[_0xfe5a('0x44')](handleError(_0x730feb,null));};exports[_0xfe5a('0x26')]=function(_0x537733,_0x2db94b){return db['VoicePrefix']['find']({'where':{'id':_0x537733[_0xfe5a('0x45')]['id']}})['then'](handleEntityNotFound(_0x2db94b,null))[_0xfe5a('0x25')](removeEntity(_0x2db94b,null))[_0xfe5a('0x44')](handleError(_0x2db94b,null));};exports[_0xfe5a('0x49')]=function(_0x646b4d,_0x522e8b){return db[_0xfe5a('0x47')]['describe']()[_0xfe5a('0x25')](respondWithResult(_0x522e8b,null))[_0xfe5a('0x44')](handleError(_0x522e8b,null));};exports[_0xfe5a('0x4a')]=function(_0x4abe4c,_0x392456){var _0x141f5e;return db['sequelize'][_0xfe5a('0x4b')](function(_0x42f2e2){return db[_0xfe5a('0x47')]['create'](_0x4abe4c[_0xfe5a('0x4c')],{'transaction':_0x42f2e2})[_0xfe5a('0x25')](function(_0x45cf68){_0x141f5e=_0x45cf68['get']({'plain':!![]});return db[_0xfe5a('0x4d')][_0xfe5a('0x48')]({'where':{'id':_0x141f5e['VoiceExtensionId']},'raw':!![]})[_0xfe5a('0x25')](function(_0x48d8fb){return createVoicePrefixExtensions(_0x141f5e,_0x48d8fb,_0x42f2e2);});});})[_0xfe5a('0x25')](function(){var _0xfa23da=_0x4abe4c[_0xfe5a('0x4e')][_0xfe5a('0x27')]({'plain':!![]});if(!_0xfa23da)throw new Error(_0xfe5a('0x4f'));if(_0xfa23da[_0xfe5a('0x50')]===_0xfe5a('0x4e')){var _0x3432d1=_0x141f5e;return db[_0xfe5a('0x51')][_0xfe5a('0x48')]({'where':{'name':_0xfe5a('0x28'),'userProfileId':_0xfa23da[_0xfe5a('0x52')]},'raw':!![]})[_0xfe5a('0x25')](function(_0x2b0e04){if(_0x2b0e04&&_0x2b0e04[_0xfe5a('0x53')]===0x0){return db[_0xfe5a('0x29')]['create']({'name':_0x3432d1[_0xfe5a('0x2a')],'resourceId':_0x3432d1['id'],'type':_0x2b0e04[_0xfe5a('0x2a')],'sectionId':_0x2b0e04['id']},{})[_0xfe5a('0x25')](function(){return _0x141f5e;});}else{return _0x141f5e;}})[_0xfe5a('0x44')](function(_0x1b531f){logger[_0xfe5a('0x54')](_0xfe5a('0x55'),_0x1b531f);throw _0x1b531f;});}return _0x141f5e;})[_0xfe5a('0x25')](respondWithResult(_0x392456,null))[_0xfe5a('0x44')](handleError(_0x392456,null));};function Extension(_0x623b35,_0x5e9b87,_0x409bf0,_0x1c459e){this[_0xfe5a('0x56')]='from-sip';this[_0xfe5a('0x57')]=_0x623b35;this[_0xfe5a('0x58')]=_0x409bf0;this['type']=_0xfe5a('0x59');this['description']=_0xfe5a('0x5a');this['priority']=_0x5e9b87;this[_0xfe5a('0x5b')]=_0x1c459e;}function createVoicePrefixExtensions(_0x53b92b,_0x4a75d2,_0x51e45c){return new BPromise(function(_0x3d6602,_0xd6e335){var _0x2f9c77=new Extension(formatPrefixName(_0x53b92b[_0xfe5a('0x5c')]),0x1,_0xfe5a('0x5d'),'Voice\x20Prefix');_0x2f9c77['VoicePrefixId']=_0x53b92b['id'];return db[_0xfe5a('0x4d')]['create'](_0x2f9c77,{'transaction':_0x51e45c})[_0xfe5a('0x25')](function(_0x50628b){var _0x5a6ce8=_0x50628b[_0xfe5a('0x27')]({'plain':!![]});var _0xf75fbd=_[_0xfe5a('0x2d')](addVoicePrefixExtensions(_0x53b92b,_0x4a75d2),function(_0x3cf2ef){_0x3cf2ef[_0xfe5a('0x5e')]=_0x5a6ce8['id'];_0x3cf2ef[_0xfe5a('0x5f')]=_0x53b92b['id'];return _0x3cf2ef;});return db['VoiceExtension'][_0xfe5a('0x60')](_0xf75fbd,{'transaction':_0x51e45c})[_0xfe5a('0x25')](function(_0x243537){if(!_0x243537){return _0xd6e335(_0xfe5a('0x61'));}else{return _0x3d6602(_0x243537);}})[_0xfe5a('0x44')](function(_0x1a9839){return _0xd6e335(_0x1a9839);});});;});};function addVoicePrefixExtensions(_0x31ae99,_0x5ecaff){var _0x4beb54=[];var _0x5b8882=formatPrefixName(_0x31ae99[_0xfe5a('0x5c')]);_0x4beb54['push'](new Extension(_0x5b8882,0x2,_0xfe5a('0x62'),_0xfe5a('0x63')+_0x31ae99['name']));if(_0x31ae99[_0xfe5a('0x64')]){_0x4beb54[_0xfe5a('0x65')](new Extension(_0x5b8882,0x3,_0xfe5a('0x62'),_0xfe5a('0x66')+_0x31ae99[_0xfe5a('0x64')]));}else{_0x4beb54['push'](new Extension(_0x5b8882,0x3,_0xfe5a('0x5d'),_0xfe5a('0x67')));}_0x4beb54['push'](new Extension(_0x5b8882,0x4,'goto',_0x5ecaff[_0xfe5a('0x56')]+','+'${EXTEN:'+(0x8+_0x31ae99[_0xfe5a('0x2a')][_0xfe5a('0x36')])+'}'+','+0x1));return _0x4beb54;}function formatPrefixName(_0x44b4b2){var _0x41c342='_';for(var _0xa3e22b=0x0;_0xa3e22b<_0x44b4b2[_0xfe5a('0x36')];_0xa3e22b++){if(_0x44b4b2[_0xfe5a('0x68')](_0xa3e22b)=='-'){_0x41c342+=_0x44b4b2['charAt'](_0xa3e22b);}else{_0x41c342+='['+_0x44b4b2[_0xfe5a('0x68')](_0xa3e22b)+']';}}_0x41c342+='.';return _0x41c342;}exports[_0xfe5a('0x69')]=function(_0x1f83b1,_0x4459ac,_0x41b3cf){var _0x5dcdca=_0x1f83b1[_0xfe5a('0x4c')];_0x5dcdca[_0xfe5a('0x5c')]='system-'+_0x5dcdca[_0xfe5a('0x2a')]+'-';return db[_0xfe5a('0x6a')][_0xfe5a('0x4b')](function(_0x485f00){return db[_0xfe5a('0x47')][_0xfe5a('0x69')](_0x5dcdca,{'where':{'id':_0x5dcdca['id']},'transaction':_0x485f00})['then'](function(){return db[_0xfe5a('0x4d')][_0xfe5a('0x26')]({'where':{'VoicePrefixId':_0x5dcdca['id']},'transaction':_0x485f00})['then'](function(){return db[_0xfe5a('0x4d')]['find']({'where':{'id':_0x5dcdca[_0xfe5a('0x5e')]},'raw':!![]})[_0xfe5a('0x25')](function(_0x371195){return createVoicePrefixExtensions(_0x5dcdca,_0x371195,_0x485f00);});});});})[_0xfe5a('0x25')](function(){return db['VoicePrefix'][_0xfe5a('0x6b')](_0x5dcdca['id']);})['then'](respondWithResult(_0x4459ac,null))['catch'](handleError(_0x4459ac,null));};exports[_0xfe5a('0x6c')]=function(_0x398405,_0x28af22,_0x4f23da){return db[_0xfe5a('0x47')]['find']({'where':{'id':_0x398405[_0xfe5a('0x45')]['id']}})[_0xfe5a('0x25')](handleEntityNotFound(_0x28af22,null))[_0xfe5a('0x25')](function(_0x1ec229){if(_0x1ec229){return _0x1ec229['addAgents'](_0x398405[_0xfe5a('0x4c')][_0xfe5a('0x6d')],_['omit'](_0x398405[_0xfe5a('0x4c')],['ids','id'])||{})['spread'](function(_0x1d7cb9){for(var _0x52dd02=0x0;_0x52dd02<_0x398405[_0xfe5a('0x4c')]['ids'][_0xfe5a('0x36')];_0x52dd02+=0x1){socket[_0xfe5a('0x6e')](_0xfe5a('0x6f'),{'UserId':Number(_0x398405[_0xfe5a('0x4c')][_0xfe5a('0x6d')][_0x52dd02]),'VoicePrefixId':Number(_0x398405[_0xfe5a('0x45')]['id'])});}return _0x1d7cb9;});}})[_0xfe5a('0x25')](respondWithResult(_0x28af22,null))[_0xfe5a('0x44')](handleError(_0x28af22,null));};exports[_0xfe5a('0x70')]=function(_0x704056,_0x583c25,_0x274cfb){return db[_0xfe5a('0x47')][_0xfe5a('0x48')]({'where':{'id':_0x704056['params']['id']}})[_0xfe5a('0x25')](handleEntityNotFound(_0x583c25,null))[_0xfe5a('0x25')](function(_0x595c08){if(_0x595c08){return _0x595c08[_0xfe5a('0x70')](_0x704056['query'][_0xfe5a('0x6d')])['then'](function(){if(_[_0xfe5a('0x71')](_0x704056['query'][_0xfe5a('0x6d')])){for(var _0x21c495=0x0;_0x21c495<_0x704056[_0xfe5a('0x32')][_0xfe5a('0x6d')][_0xfe5a('0x36')];_0x21c495+=0x1){socket[_0xfe5a('0x6e')](_0xfe5a('0x72'),{'UserId':Number(_0x704056[_0xfe5a('0x32')][_0xfe5a('0x6d')][_0x21c495]),'VoicePrefixId':Number(_0x704056['params']['id'])});}}else{socket['emit'](_0xfe5a('0x72'),{'UserId':Number(_0x704056[_0xfe5a('0x32')][_0xfe5a('0x6d')]),'VoicePrefixId':Number(_0x704056[_0xfe5a('0x45')]['id'])});}});}})[_0xfe5a('0x25')](respondWithStatusCode(_0x583c25,null))[_0xfe5a('0x44')](handleError(_0x583c25,null));};exports[_0xfe5a('0x73')]=function(_0x57fd97,_0xc87e41,_0x29c0cc){var _0x75f836={};var _0x36ecf4={};var _0x2c5eb8;var _0x50d891;return db[_0xfe5a('0x47')][_0xfe5a('0x74')]({'where':{'id':_0x57fd97['params']['id']}})[_0xfe5a('0x25')](handleEntityNotFound(_0xc87e41,null))[_0xfe5a('0x25')](function(_0x3d196c){if(_0x3d196c){_0x2c5eb8=_0x3d196c;_0x36ecf4[_0xfe5a('0x31')]=_[_0xfe5a('0x46')](db['User'][_0xfe5a('0x2e')]);_0x36ecf4[_0xfe5a('0x32')]=_['keys'](_0x57fd97['query']);_0x36ecf4['filters']=_['intersection'](_0x36ecf4[_0xfe5a('0x31')],_0x36ecf4[_0xfe5a('0x32')]);_0x75f836['attributes']=_['intersection'](_0x36ecf4[_0xfe5a('0x31')],qs[_0xfe5a('0x35')](_0x57fd97[_0xfe5a('0x32')][_0xfe5a('0x35')]));_0x75f836[_0xfe5a('0x34')]=_0x75f836[_0xfe5a('0x34')][_0xfe5a('0x36')]?_0x75f836[_0xfe5a('0x34')]:_0x36ecf4['model'];_0x75f836['order']=qs[_0xfe5a('0x39')](_0x57fd97[_0xfe5a('0x32')]['sort']);_0x75f836[_0xfe5a('0x3a')]=qs[_0xfe5a('0x3b')](_[_0xfe5a('0x3c')](_0x57fd97[_0xfe5a('0x32')],_0x36ecf4[_0xfe5a('0x3b')]));if(_0x57fd97[_0xfe5a('0x32')]['filter']){_0x75f836[_0xfe5a('0x3a')]=_[_0xfe5a('0x3e')](_0x75f836[_0xfe5a('0x3a')],{'$or':_['map'](_0x75f836[_0xfe5a('0x34')],function(_0x235b0e){var _0x3a9b9b={};_0x3a9b9b[_0x235b0e]={'$like':'%'+_0x57fd97[_0xfe5a('0x32')]['filter']+'%'};return _0x3a9b9b;})});}_0x75f836=_[_0xfe5a('0x3e')]({},_0x75f836,_0x57fd97['options']);return _0x2c5eb8[_0xfe5a('0x73')](_0x75f836);}})[_0xfe5a('0x25')](function(_0x42d7da){if(_0x42d7da){_0x50d891=_0x42d7da[_0xfe5a('0x36')];if(!_0x57fd97[_0xfe5a('0x32')]['hasOwnProperty'](_0xfe5a('0x37'))){_0x75f836[_0xfe5a('0x1f')]=qs[_0xfe5a('0x1f')](_0x57fd97[_0xfe5a('0x32')][_0xfe5a('0x1f')]);_0x75f836[_0xfe5a('0x1e')]=qs[_0xfe5a('0x1e')](_0x57fd97['query'][_0xfe5a('0x1e')]);}return _0x2c5eb8[_0xfe5a('0x73')](_0x75f836);}})[_0xfe5a('0x25')](function(_0x381c56){if(_0x381c56){return _0x381c56?{'count':_0x50d891,'rows':_0x381c56}:null;}})[_0xfe5a('0x25')](respondWithResult(_0xc87e41,null))[_0xfe5a('0x44')](handleError(_0xc87e41,null));};exports[_0xfe5a('0x75')]=function(_0x315bc7,_0x11c7b8,_0x8f2501){var _0x1d5ac3={};var _0x11dbd2={};var _0x20c74c;var _0x3e756e;return db[_0xfe5a('0x47')][_0xfe5a('0x74')]({'where':{'id':_0x315bc7[_0xfe5a('0x45')]['id']}})['then'](handleEntityNotFound(_0x11c7b8,null))['then'](function(_0x2277b4){if(_0x2277b4){_0x20c74c=_0x2277b4;_0x11dbd2[_0xfe5a('0x31')]=_[_0xfe5a('0x46')](db[_0xfe5a('0x76')][_0xfe5a('0x2e')]);_0x11dbd2[_0xfe5a('0x32')]=_[_0xfe5a('0x46')](_0x315bc7[_0xfe5a('0x32')]);_0x11dbd2[_0xfe5a('0x3b')]=_[_0xfe5a('0x33')](_0x11dbd2['model'],_0x11dbd2['query']);_0x1d5ac3[_0xfe5a('0x34')]=_[_0xfe5a('0x33')](_0x11dbd2[_0xfe5a('0x31')],qs[_0xfe5a('0x35')](_0x315bc7['query']['fields']));_0x1d5ac3['attributes']=_0x1d5ac3[_0xfe5a('0x34')][_0xfe5a('0x36')]?_0x1d5ac3[_0xfe5a('0x34')]:_0x11dbd2['model'];_0x1d5ac3[_0xfe5a('0x38')]=qs['sort'](_0x315bc7['query']['sort']);_0x1d5ac3['where']=qs[_0xfe5a('0x3b')](_[_0xfe5a('0x3c')](_0x315bc7['query'],_0x11dbd2[_0xfe5a('0x3b')]));if(_0x315bc7[_0xfe5a('0x32')][_0xfe5a('0x3d')]){_0x1d5ac3[_0xfe5a('0x3a')]=_[_0xfe5a('0x3e')](_0x1d5ac3[_0xfe5a('0x3a')],{'$or':_[_0xfe5a('0x2d')](_0x1d5ac3['attributes'],function(_0x5ec963){var _0x5c931b={};_0x5c931b[_0x5ec963]={'$like':'%'+_0x315bc7['query'][_0xfe5a('0x3d')]+'%'};return _0x5c931b;})});}_0x1d5ac3=_['merge']({},_0x1d5ac3,_0x315bc7[_0xfe5a('0x40')]);return _0x20c74c[_0xfe5a('0x75')](_0x1d5ac3);}})[_0xfe5a('0x25')](function(_0x114a60){if(_0x114a60){_0x3e756e=_0x114a60[_0xfe5a('0x36')];if(!_0x315bc7[_0xfe5a('0x32')][_0xfe5a('0x77')](_0xfe5a('0x37'))){_0x1d5ac3[_0xfe5a('0x1f')]=qs[_0xfe5a('0x1f')](_0x315bc7[_0xfe5a('0x32')]['limit']);_0x1d5ac3[_0xfe5a('0x1e')]=qs[_0xfe5a('0x1e')](_0x315bc7[_0xfe5a('0x32')][_0xfe5a('0x1e')]);}return _0x20c74c[_0xfe5a('0x75')](_0x1d5ac3);}})['then'](function(_0x280425){if(_0x280425){return _0x280425?{'count':_0x3e756e,'rows':_0x280425}:null;}})[_0xfe5a('0x25')](respondWithResult(_0x11c7b8,null))[_0xfe5a('0x44')](handleError(_0x11c7b8,null));};exports[_0xfe5a('0x78')]=function(_0x349f25,_0x52f99e,_0x353e6d){var _0x8917da=_0x349f25[_0xfe5a('0x4c')][_0xfe5a('0x6d')];var _0xf9c8c5;return db['Team'][_0xfe5a('0x42')]({'where':{'id':_0x8917da},'attributes':['id'],'include':[{'model':db[_0xfe5a('0x79')],'as':_0xfe5a('0x7a'),'attributes':['id',_0xfe5a('0x2a'),_0xfe5a('0x7b'),_0xfe5a('0x7c'),'interface'],'raw':!![]}]})[_0xfe5a('0x25')](function(_0x12f901){if(_0x12f901){_0xf9c8c5=_0x12f901;var _0x17c110=_[_0xfe5a('0x7d')](_0x12f901,function(_0x3b89be){var _0xa8c8aa=_0x3b89be[_0xfe5a('0x27')]({'plain':!![]});return _0xa8c8aa[_0xfe5a('0x7a')];});return db[_0xfe5a('0x47')][_0xfe5a('0x48')]({'where':{'id':_0x349f25[_0xfe5a('0x45')]['id']}})[_0xfe5a('0x25')](function(_0xe934c2){return db['sequelize'][_0xfe5a('0x4b')](function(_0xfbb41c){return _0xe934c2[_0xfe5a('0x78')](_0x8917da,{'transaction':_0xfbb41c})[_0xfe5a('0x25')](function(){return BPromise[_0xfe5a('0x7e')](_0xf9c8c5,function(_0x372ff1){return db[_0xfe5a('0x7f')]['upsert']({'TeamId':_0x372ff1['id'],'VoicePrefixId':_0x349f25[_0xfe5a('0x45')]['id']},{'transaction':_0xfbb41c});});})[_0xfe5a('0x25')](function(){return BPromise[_0xfe5a('0x7e')](_0x17c110,function(_0x769b8b){return db['UserVoicePrefix'][_0xfe5a('0x80')]({'where':{'UserId':_0x769b8b['id'],'VoicePrefixId':_0x349f25[_0xfe5a('0x45')]['id']},'transaction':_0xfbb41c});});})[_0xfe5a('0x25')](function(){_0x17c110[_0xfe5a('0x81')](function(_0x228f44){socket[_0xfe5a('0x6e')](_0xfe5a('0x6f'),{'UserId':_0x228f44['id'],'VoicePrefixId':_0xe934c2['id']});});});});});}})[_0xfe5a('0x25')](respondWithStatusCode(_0x52f99e,null))[_0xfe5a('0x44')](handleError(_0x52f99e,null));};exports[_0xfe5a('0x82')]=function(_0x35f0e6,_0x20f3ad,_0x5ed745){return db['Team'][_0xfe5a('0x42')]({'where':{'id':_0x35f0e6[_0xfe5a('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0xfe5a('0x79')],'as':_0xfe5a('0x7a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x20f3ad,null))['then'](function(_0xbd2d9c){var _0x1dfe2f=_['map'](_0xbd2d9c,'id');var _0xfc550=[];var _0x15b6ac=[];var _0x34492d=squel[_0xfe5a('0x83')]();_0x34492d[_0xfe5a('0x84')](_0xfe5a('0x85'))[_0xfe5a('0x86')]('team_has_voice_prefixes','tq')['join']('user_has_teams','ut',_0xfe5a('0x87'))[_0xfe5a('0x3a')](_0xfe5a('0x88'),_0x35f0e6[_0xfe5a('0x45')]['id']);for(var _0x101ec0=0x0;_0x101ec0<_0xbd2d9c[_0xfe5a('0x36')];_0x101ec0+=0x1){let _0x1630c9=_0xbd2d9c[_0x101ec0];for(var _0x5b75dd=0x0;_0x5b75dd<_0x1630c9['Agents'][_0xfe5a('0x36')];_0x5b75dd+=0x1){let _0x14025c=_0x1630c9[_0xfe5a('0x7a')][_0x5b75dd];var _0x5a7c43=_0x34492d[_0xfe5a('0x89')]();_0x5a7c43['where']('ut.UserId\x20=\x20?',_0x14025c['id']);_0x15b6ac[_0xfe5a('0x65')](db['sequelize'][_0xfe5a('0x32')](_0x5a7c43[_0xfe5a('0x8a')](),{'type':db['sequelize'][_0xfe5a('0x8b')][_0xfe5a('0x8c')]})[_0xfe5a('0x25')](function(_0x38c73c){if(_0x38c73c[_0xfe5a('0x36')]===0x1){return _0x14025c['id'];}else{var _0x386c89=_[_0xfe5a('0x8d')](_[_0xfe5a('0x2d')](_0x38c73c,_0xfe5a('0x8e')),function(_0x10803e){return _[_0xfe5a('0x8f')](_0x1dfe2f,_0x10803e);});if(_0x386c89){return _0x14025c['id'];}}}));}}return BPromise['all'](_0x15b6ac)[_0xfe5a('0x25')](function(_0x131375){_0xfc550=_(_0xfc550)[_0xfe5a('0x90')](_0x131375)[_0xfe5a('0x91')]()[_0xfe5a('0x92')]();return db[_0xfe5a('0x47')][_0xfe5a('0x48')]({'where':{'id':_0x35f0e6[_0xfe5a('0x45')]['id']}})['then'](function(_0xb94724){return db[_0xfe5a('0x6a')]['transaction'](function(_0x3c7fc8){return _0xb94724['removeTeams'](_0x35f0e6[_0xfe5a('0x32')][_0xfe5a('0x6d')],{'transaction':_0x3c7fc8})[_0xfe5a('0x25')](function(){if(!_['isEmpty'](_0xfc550)){return _0xb94724[_0xfe5a('0x70')](_0xfc550,{'transaction':_0x3c7fc8});}})[_0xfe5a('0x25')](function(){_0xfc550[_0xfe5a('0x81')](function(_0x5b005c){socket['emit']('userVoicePrefix:remove',{'UserId':_0x5b005c,'VoicePrefixId':_0xb94724['id']});});});});});});})[_0xfe5a('0x25')](respondWithStatusCode(_0x20f3ad,null))[_0xfe5a('0x44')](handleError(_0x20f3ad,null));};
\ No newline at end of file
+var _0x1c9a=['sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','offset','limit','undefined','set','Content-Range','apply','reject','update','then','destroy','VoicePrefixes','UserProfileResource','error','stack','send','index','map','VoicePrefix','rawAttributes','fieldName','type','model','name','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','find','params','describe','sequelize','create','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId','VoiceExtension','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','Set','PREFIX-CALLERIDALL=','No\x20callerid\x20available','context','${EXTEN:','charAt','body','system-','transaction','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','User','filter','getAgents','getTeams','findOne','addTeams','Team','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','every','TeamId','includes','all','union','compact','isEmpty','eml-format','zip-dir','request-promise','moment','bluebird','util','path'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1c9a,0x98));var _0xa1c9=function(_0x5183ca,_0x4a522f){_0x5183ca=_0x5183ca-0x0;var _0x42a4bb=_0x1c9a[_0x5183ca];return _0x42a4bb;};'use strict';var emlformat=require(_0xa1c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa1c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1c9('0x2'));var moment=require(_0xa1c9('0x3'));var BPromise=require(_0xa1c9('0x4'));var Mustache=require('mustache');var util=require(_0xa1c9('0x5'));var path=require(_0xa1c9('0x6'));var sox=require(_0xa1c9('0x7'));var csv=require(_0xa1c9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa1c9('0x9'));var _=require('lodash');var squel=require(_0xa1c9('0xa'));var crypto=require(_0xa1c9('0xb'));var jsforce=require(_0xa1c9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa1c9('0x8'));var querystring=require(_0xa1c9('0xd'));var Papa=require(_0xa1c9('0xe'));var Redis=require(_0xa1c9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa1c9('0x10'));var as=require(_0xa1c9('0x11'));var hardwareService=require(_0xa1c9('0x12'));var logger=require(_0xa1c9('0x13'))(_0xa1c9('0x14'));var utils=require(_0xa1c9('0x15'));var config=require(_0xa1c9('0x16'));var licenseUtil=require(_0xa1c9('0x17'));var db=require(_0xa1c9('0x18'))['db'];config[_0xa1c9('0x19')]=_['defaults'](config[_0xa1c9('0x19')],{'host':_0xa1c9('0x1a'),'port':0x18eb});var socket=require(_0xa1c9('0x1b'))(new Redis(config[_0xa1c9('0x19')]));require(_0xa1c9('0x1c'))['register'](socket);function respondWithStatusCode(_0x335dda,_0x4b2fa5){_0x4b2fa5=_0x4b2fa5||0xcc;return function(_0x2cba13){if(_0x2cba13){return _0x335dda[_0xa1c9('0x1d')](_0x4b2fa5);}return _0x335dda[_0xa1c9('0x1e')](_0x4b2fa5)[_0xa1c9('0x1f')]();};}function respondWithResult(_0x44ab5b,_0x3b51f5){_0x3b51f5=_0x3b51f5||0xc8;return function(_0x1f6d26){if(_0x1f6d26){return _0x44ab5b[_0xa1c9('0x1e')](_0x3b51f5)['json'](_0x1f6d26);}};}function respondWithFilteredResult(_0x11ca10,_0x1084d2){return function(_0x224ae4){if(_0x224ae4){var _0x50db9b=typeof _0x1084d2[_0xa1c9('0x20')]==='undefined'&&typeof _0x1084d2[_0xa1c9('0x21')]===_0xa1c9('0x22');var _0x204d54=_0x224ae4['count'];var _0x3a1110=_0x50db9b?0x0:_0x1084d2[_0xa1c9('0x20')];var _0x128732=_0x50db9b?_0x224ae4['count']:_0x1084d2[_0xa1c9('0x20')]+_0x1084d2[_0xa1c9('0x21')];var _0x4c6dbb;if(_0x128732>=_0x204d54){_0x128732=_0x204d54;_0x4c6dbb=0xc8;}else{_0x4c6dbb=0xce;}_0x11ca10[_0xa1c9('0x1e')](_0x4c6dbb);return _0x11ca10[_0xa1c9('0x23')](_0xa1c9('0x24'),_0x3a1110+'-'+_0x128732+'/'+_0x204d54)['json'](_0x224ae4);}return null;};}function patchUpdates(_0x29f1b1){return function(_0x3dcec5){try{jsonpatch[_0xa1c9('0x25')](_0x3dcec5,_0x29f1b1,!![]);}catch(_0x23a461){return BPromise[_0xa1c9('0x26')](_0x23a461);}return _0x3dcec5['save']();};}function saveUpdates(_0x50b16b,_0x200749){return function(_0x50b16d){if(_0x50b16d){return _0x50b16d[_0xa1c9('0x27')](_0x50b16b)[_0xa1c9('0x28')](function(_0x1c6f37){return _0x1c6f37;});}return null;};}function removeEntity(_0x3059eb,_0x339ed1){return function(_0x522dc0){if(_0x522dc0){return _0x522dc0[_0xa1c9('0x29')]()[_0xa1c9('0x28')](function(){var _0x20cbe1=_0x522dc0['get']({'plain':!![]});var _0x133f80=_0xa1c9('0x2a');return db[_0xa1c9('0x2b')]['destroy']({'where':{'type':_0x133f80,'resourceId':_0x20cbe1['id']}})[_0xa1c9('0x28')](function(){return _0x522dc0;});})[_0xa1c9('0x28')](function(){_0x3059eb['status'](0xcc)[_0xa1c9('0x1f')]();});}};}function handleEntityNotFound(_0x48ce34,_0xdf6d0c){return function(_0x2404c3){if(!_0x2404c3){_0x48ce34[_0xa1c9('0x1d')](0x194);}return _0x2404c3;};}function handleError(_0x254b13,_0x40b9d5){_0x40b9d5=_0x40b9d5||0x1f4;return function(_0xe8523b){logger[_0xa1c9('0x2c')](_0xe8523b[_0xa1c9('0x2d')]);if(_0xe8523b['name']){delete _0xe8523b['name'];}_0x254b13[_0xa1c9('0x1e')](_0x40b9d5)[_0xa1c9('0x2e')](_0xe8523b);};}exports[_0xa1c9('0x2f')]=function(_0xf419d0,_0x3161b0){var _0x5b67c3={},_0x53f325={},_0x5aecd7={'count':0x0,'rows':[]};var _0x259ac3=_[_0xa1c9('0x30')](db[_0xa1c9('0x31')][_0xa1c9('0x32')],function(_0x39cf81){return{'name':_0x39cf81[_0xa1c9('0x33')],'type':_0x39cf81[_0xa1c9('0x34')]['key']};});_0x53f325[_0xa1c9('0x35')]=_['map'](_0x259ac3,_0xa1c9('0x36'));_0x53f325['query']=_[_0xa1c9('0x37')](_0xf419d0[_0xa1c9('0x38')]);_0x53f325[_0xa1c9('0x39')]=_['intersection'](_0x53f325[_0xa1c9('0x35')],_0x53f325[_0xa1c9('0x38')]);_0x5b67c3[_0xa1c9('0x3a')]=_[_0xa1c9('0x3b')](_0x53f325['model'],qs['fields'](_0xf419d0[_0xa1c9('0x38')][_0xa1c9('0x3c')]));_0x5b67c3[_0xa1c9('0x3a')]=_0x5b67c3[_0xa1c9('0x3a')][_0xa1c9('0x3d')]?_0x5b67c3[_0xa1c9('0x3a')]:_0x53f325[_0xa1c9('0x35')];if(!_0xf419d0[_0xa1c9('0x38')][_0xa1c9('0x3e')](_0xa1c9('0x3f'))){_0x5b67c3['limit']=qs[_0xa1c9('0x21')](_0xf419d0[_0xa1c9('0x38')][_0xa1c9('0x21')]);_0x5b67c3[_0xa1c9('0x20')]=qs[_0xa1c9('0x20')](_0xf419d0[_0xa1c9('0x38')]['offset']);}_0x5b67c3[_0xa1c9('0x40')]=qs[_0xa1c9('0x41')](_0xf419d0[_0xa1c9('0x38')]['sort']);_0x5b67c3[_0xa1c9('0x42')]=qs[_0xa1c9('0x39')](_['pick'](_0xf419d0[_0xa1c9('0x38')],_0x53f325[_0xa1c9('0x39')]),_0x259ac3);if(_0xf419d0['query']['filter']){_0x5b67c3[_0xa1c9('0x42')]=_[_0xa1c9('0x43')](_0x5b67c3[_0xa1c9('0x42')],{'$or':_[_0xa1c9('0x30')](_0x259ac3,function(_0xd9e67){if(_0xd9e67[_0xa1c9('0x34')]!==_0xa1c9('0x44')){var _0x146e47={};_0x146e47[_0xd9e67[_0xa1c9('0x36')]]={'$like':'%'+_0xf419d0[_0xa1c9('0x38')]['filter']+'%'};return _0x146e47;}})});}_0x5b67c3=_['merge']({},_0x5b67c3,_0xf419d0[_0xa1c9('0x45')]);var _0x46920c={'where':_0x5b67c3['where']};return db[_0xa1c9('0x31')][_0xa1c9('0x46')](_0x46920c)[_0xa1c9('0x28')](function(_0x36c846){_0x5aecd7[_0xa1c9('0x46')]=_0x36c846;if(_0xf419d0[_0xa1c9('0x38')][_0xa1c9('0x47')]){_0x5b67c3[_0xa1c9('0x48')]=[{'all':!![]}];}return db[_0xa1c9('0x31')][_0xa1c9('0x49')](_0x5b67c3);})[_0xa1c9('0x28')](function(_0x50cc27){_0x5aecd7[_0xa1c9('0x4a')]=_0x50cc27;return _0x5aecd7;})['then'](respondWithFilteredResult(_0x3161b0,_0x5b67c3))[_0xa1c9('0x4b')](handleError(_0x3161b0,null));};exports['show']=function(_0x42be67,_0x4a9e02){var _0x43598b={'raw':![],'where':{'id':_0x42be67['params']['id']}},_0x18bb43={};_0x18bb43[_0xa1c9('0x35')]=_[_0xa1c9('0x37')](db['VoicePrefix'][_0xa1c9('0x32')]);_0x18bb43[_0xa1c9('0x38')]=_[_0xa1c9('0x37')](_0x42be67[_0xa1c9('0x38')]);_0x18bb43[_0xa1c9('0x39')]=_[_0xa1c9('0x3b')](_0x18bb43['model'],_0x18bb43[_0xa1c9('0x38')]);_0x43598b[_0xa1c9('0x3a')]=_[_0xa1c9('0x3b')](_0x18bb43[_0xa1c9('0x35')],qs[_0xa1c9('0x3c')](_0x42be67['query']['fields']));_0x43598b['attributes']=_0x43598b[_0xa1c9('0x3a')][_0xa1c9('0x3d')]?_0x43598b[_0xa1c9('0x3a')]:_0x18bb43['model'];if(_0x42be67[_0xa1c9('0x38')][_0xa1c9('0x47')]){_0x43598b['include']=[{'all':!![]}];}_0x43598b=_[_0xa1c9('0x43')]({},_0x43598b,_0x42be67['options']);return db['VoicePrefix'][_0xa1c9('0x4c')](_0x43598b)[_0xa1c9('0x28')](handleEntityNotFound(_0x4a9e02,null))[_0xa1c9('0x28')](respondWithResult(_0x4a9e02,null))[_0xa1c9('0x4b')](handleError(_0x4a9e02,null));};exports[_0xa1c9('0x29')]=function(_0x31fbb8,_0x18aa46){return db[_0xa1c9('0x31')][_0xa1c9('0x4c')]({'where':{'id':_0x31fbb8[_0xa1c9('0x4d')]['id']}})[_0xa1c9('0x28')](handleEntityNotFound(_0x18aa46,null))[_0xa1c9('0x28')](removeEntity(_0x18aa46,null))[_0xa1c9('0x4b')](handleError(_0x18aa46,null));};exports[_0xa1c9('0x4e')]=function(_0x149450,_0x112f82){return db[_0xa1c9('0x31')][_0xa1c9('0x4e')]()[_0xa1c9('0x28')](respondWithResult(_0x112f82,null))['catch'](handleError(_0x112f82,null));};exports['create']=function(_0x12118e,_0x6160fc){var _0x66a5eb;return db[_0xa1c9('0x4f')]['transaction'](function(_0x449e85){return db[_0xa1c9('0x31')][_0xa1c9('0x50')](_0x12118e['body'],{'transaction':_0x449e85})[_0xa1c9('0x28')](function(_0x3f650a){_0x66a5eb=_0x3f650a['get']({'plain':!![]});return db['VoiceExtension'][_0xa1c9('0x4c')]({'where':{'id':_0x66a5eb['VoiceExtensionId']},'raw':!![]})[_0xa1c9('0x28')](function(_0x1bd5c7){return createVoicePrefixExtensions(_0x66a5eb,_0x1bd5c7,_0x449e85);});});})[_0xa1c9('0x28')](function(){var _0x4c1165=_0x12118e['user'][_0xa1c9('0x51')]({'plain':!![]});if(!_0x4c1165)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c1165[_0xa1c9('0x52')]==='user'){var _0x3334ad=_0x66a5eb;return db[_0xa1c9('0x53')][_0xa1c9('0x4c')]({'where':{'name':_0xa1c9('0x2a'),'userProfileId':_0x4c1165[_0xa1c9('0x54')]},'raw':!![]})[_0xa1c9('0x28')](function(_0x3917ed){if(_0x3917ed&&_0x3917ed['autoAssociation']===0x0){return db[_0xa1c9('0x2b')][_0xa1c9('0x50')]({'name':_0x3334ad['name'],'resourceId':_0x3334ad['id'],'type':_0x3917ed['name'],'sectionId':_0x3917ed['id']},{})['then'](function(){return _0x66a5eb;});}else{return _0x66a5eb;}})[_0xa1c9('0x4b')](function(_0x55fe87){logger[_0xa1c9('0x2c')](_0xa1c9('0x55'),_0x55fe87);throw _0x55fe87;});}return _0x66a5eb;})[_0xa1c9('0x28')](respondWithResult(_0x6160fc,null))[_0xa1c9('0x4b')](handleError(_0x6160fc,null));};function Extension(_0x2f0c80,_0x5b81f4,_0x4bf711,_0x48950c){this['context']=_0xa1c9('0x56');this[_0xa1c9('0x57')]=_0x2f0c80;this[_0xa1c9('0x58')]=_0x4bf711;this[_0xa1c9('0x34')]=_0xa1c9('0x59');this[_0xa1c9('0x5a')]=_0xa1c9('0x5b');this[_0xa1c9('0x5c')]=_0x5b81f4;this[_0xa1c9('0x5d')]=_0x48950c;}function createVoicePrefixExtensions(_0x317799,_0x4639cf,_0xef5d24){return new BPromise(function(_0x288267,_0x29d833){var _0x51f675=new Extension(formatPrefixName(_0x317799[_0xa1c9('0x5e')]),0x1,_0xa1c9('0x5f'),_0xa1c9('0x60'));_0x51f675[_0xa1c9('0x61')]=_0x317799['id'];return db['VoiceExtension'][_0xa1c9('0x50')](_0x51f675,{'transaction':_0xef5d24})[_0xa1c9('0x28')](function(_0x1b2cff){var _0x39ffed=_0x1b2cff['get']({'plain':!![]});var _0x4b9aa8=_[_0xa1c9('0x30')](addVoicePrefixExtensions(_0x317799,_0x4639cf),function(_0x2a89d2){_0x2a89d2[_0xa1c9('0x62')]=_0x39ffed['id'];_0x2a89d2[_0xa1c9('0x61')]=_0x317799['id'];return _0x2a89d2;});return db[_0xa1c9('0x63')]['bulkCreate'](_0x4b9aa8,{'transaction':_0xef5d24})[_0xa1c9('0x28')](function(_0x21abdf){if(!_0x21abdf){return _0x29d833(_0xa1c9('0x64'));}else{return _0x288267(_0x21abdf);}})[_0xa1c9('0x4b')](function(_0x5ba7aa){return _0x29d833(_0x5ba7aa);});});;});};function addVoicePrefixExtensions(_0x37613f,_0x17d848){var _0xa18fa4=[];var _0x5a5c65=formatPrefixName(_0x37613f[_0xa1c9('0x5e')]);_0xa18fa4[_0xa1c9('0x65')](new Extension(_0x5a5c65,0x2,'Set',_0xa1c9('0x66')+_0x37613f[_0xa1c9('0x36')]));if(_0x37613f[_0xa1c9('0x67')]){_0xa18fa4[_0xa1c9('0x65')](new Extension(_0x5a5c65,0x3,_0xa1c9('0x68'),_0xa1c9('0x69')+_0x37613f[_0xa1c9('0x67')]));}else{_0xa18fa4[_0xa1c9('0x65')](new Extension(_0x5a5c65,0x3,_0xa1c9('0x5f'),_0xa1c9('0x6a')));}_0xa18fa4[_0xa1c9('0x65')](new Extension(_0x5a5c65,0x4,'goto',_0x17d848[_0xa1c9('0x6b')]+','+_0xa1c9('0x6c')+(0x8+_0x37613f[_0xa1c9('0x36')][_0xa1c9('0x3d')])+'}'+','+0x1));return _0xa18fa4;}function formatPrefixName(_0x5961aa){var _0x358481='_';for(var _0xdbc56a=0x0;_0xdbc56a<_0x5961aa[_0xa1c9('0x3d')];_0xdbc56a++){if(_0x5961aa[_0xa1c9('0x6d')](_0xdbc56a)=='-'){_0x358481+=_0x5961aa[_0xa1c9('0x6d')](_0xdbc56a);}else{_0x358481+='['+_0x5961aa[_0xa1c9('0x6d')](_0xdbc56a)+']';}}_0x358481+='.';return _0x358481;}exports[_0xa1c9('0x27')]=function(_0x27048c,_0xb24e0b,_0x178e47){var _0x1fec82=_0x27048c[_0xa1c9('0x6e')];_0x1fec82[_0xa1c9('0x5e')]=_0xa1c9('0x6f')+_0x1fec82['name']+'-';return db[_0xa1c9('0x4f')][_0xa1c9('0x70')](function(_0x1f219d){return db[_0xa1c9('0x31')][_0xa1c9('0x27')](_0x1fec82,{'where':{'id':_0x1fec82['id']},'transaction':_0x1f219d})[_0xa1c9('0x28')](function(){return db[_0xa1c9('0x63')]['destroy']({'where':{'VoicePrefixId':_0x1fec82['id']},'transaction':_0x1f219d})[_0xa1c9('0x28')](function(){return db[_0xa1c9('0x63')]['find']({'where':{'id':_0x1fec82[_0xa1c9('0x62')]},'raw':!![]})[_0xa1c9('0x28')](function(_0x150d76){return createVoicePrefixExtensions(_0x1fec82,_0x150d76,_0x1f219d);});});});})[_0xa1c9('0x28')](function(){return db['VoicePrefix'][_0xa1c9('0x71')](_0x1fec82['id']);})['then'](respondWithResult(_0xb24e0b,null))['catch'](handleError(_0xb24e0b,null));};exports[_0xa1c9('0x72')]=function(_0x134d3f,_0x40f420,_0x423c58){return db['VoicePrefix'][_0xa1c9('0x4c')]({'where':{'id':_0x134d3f[_0xa1c9('0x4d')]['id']}})['then'](handleEntityNotFound(_0x40f420,null))[_0xa1c9('0x28')](function(_0x464da9){if(_0x464da9){return _0x464da9[_0xa1c9('0x72')](_0x134d3f[_0xa1c9('0x6e')][_0xa1c9('0x73')],_[_0xa1c9('0x74')](_0x134d3f['body'],['ids','id'])||{})[_0xa1c9('0x75')](function(_0x52e78b){for(var _0x3de2c7=0x0;_0x3de2c7<_0x134d3f[_0xa1c9('0x6e')][_0xa1c9('0x73')][_0xa1c9('0x3d')];_0x3de2c7+=0x1){socket[_0xa1c9('0x76')](_0xa1c9('0x77'),{'UserId':Number(_0x134d3f[_0xa1c9('0x6e')][_0xa1c9('0x73')][_0x3de2c7]),'VoicePrefixId':Number(_0x134d3f[_0xa1c9('0x4d')]['id'])});}return _0x52e78b;});}})['then'](respondWithResult(_0x40f420,null))[_0xa1c9('0x4b')](handleError(_0x40f420,null));};exports['removeAgents']=function(_0x4a8841,_0x8bc83d,_0x518811){return db[_0xa1c9('0x31')][_0xa1c9('0x4c')]({'where':{'id':_0x4a8841[_0xa1c9('0x4d')]['id']}})[_0xa1c9('0x28')](handleEntityNotFound(_0x8bc83d,null))[_0xa1c9('0x28')](function(_0x2a17b7){if(_0x2a17b7){return _0x2a17b7[_0xa1c9('0x78')](_0x4a8841['query'][_0xa1c9('0x73')])[_0xa1c9('0x28')](function(){if(_[_0xa1c9('0x79')](_0x4a8841['query']['ids'])){for(var _0x3f4f76=0x0;_0x3f4f76<_0x4a8841['query'][_0xa1c9('0x73')][_0xa1c9('0x3d')];_0x3f4f76+=0x1){socket[_0xa1c9('0x76')](_0xa1c9('0x7a'),{'UserId':Number(_0x4a8841['query'][_0xa1c9('0x73')][_0x3f4f76]),'VoicePrefixId':Number(_0x4a8841[_0xa1c9('0x4d')]['id'])});}}else{socket[_0xa1c9('0x76')](_0xa1c9('0x7a'),{'UserId':Number(_0x4a8841[_0xa1c9('0x38')]['ids']),'VoicePrefixId':Number(_0x4a8841[_0xa1c9('0x4d')]['id'])});}});}})[_0xa1c9('0x28')](respondWithStatusCode(_0x8bc83d,null))[_0xa1c9('0x4b')](handleError(_0x8bc83d,null));};exports['getAgents']=function(_0x3936cb,_0x175662,_0x134935){var _0x197721={};var _0x7281bd={};var _0x35a356;var _0x53ea3b;return db[_0xa1c9('0x31')]['findOne']({'where':{'id':_0x3936cb[_0xa1c9('0x4d')]['id']}})[_0xa1c9('0x28')](handleEntityNotFound(_0x175662,null))['then'](function(_0x28d323){if(_0x28d323){_0x35a356=_0x28d323;_0x7281bd['model']=_[_0xa1c9('0x37')](db[_0xa1c9('0x7b')][_0xa1c9('0x32')]);_0x7281bd[_0xa1c9('0x38')]=_[_0xa1c9('0x37')](_0x3936cb[_0xa1c9('0x38')]);_0x7281bd[_0xa1c9('0x39')]=_[_0xa1c9('0x3b')](_0x7281bd[_0xa1c9('0x35')],_0x7281bd[_0xa1c9('0x38')]);_0x197721[_0xa1c9('0x3a')]=_[_0xa1c9('0x3b')](_0x7281bd[_0xa1c9('0x35')],qs[_0xa1c9('0x3c')](_0x3936cb[_0xa1c9('0x38')][_0xa1c9('0x3c')]));_0x197721['attributes']=_0x197721['attributes'][_0xa1c9('0x3d')]?_0x197721[_0xa1c9('0x3a')]:_0x7281bd[_0xa1c9('0x35')];_0x197721['order']=qs[_0xa1c9('0x41')](_0x3936cb['query']['sort']);_0x197721[_0xa1c9('0x42')]=qs[_0xa1c9('0x39')](_['pick'](_0x3936cb[_0xa1c9('0x38')],_0x7281bd['filters']));if(_0x3936cb['query'][_0xa1c9('0x7c')]){_0x197721['where']=_[_0xa1c9('0x43')](_0x197721[_0xa1c9('0x42')],{'$or':_['map'](_0x197721[_0xa1c9('0x3a')],function(_0x1277eb){var _0x88cb2c={};_0x88cb2c[_0x1277eb]={'$like':'%'+_0x3936cb[_0xa1c9('0x38')]['filter']+'%'};return _0x88cb2c;})});}_0x197721=_[_0xa1c9('0x43')]({},_0x197721,_0x3936cb[_0xa1c9('0x45')]);return _0x35a356[_0xa1c9('0x7d')](_0x197721);}})[_0xa1c9('0x28')](function(_0x465162){if(_0x465162){_0x53ea3b=_0x465162[_0xa1c9('0x3d')];if(!_0x3936cb['query'][_0xa1c9('0x3e')](_0xa1c9('0x3f'))){_0x197721['limit']=qs['limit'](_0x3936cb[_0xa1c9('0x38')][_0xa1c9('0x21')]);_0x197721[_0xa1c9('0x20')]=qs[_0xa1c9('0x20')](_0x3936cb[_0xa1c9('0x38')][_0xa1c9('0x20')]);}return _0x35a356['getAgents'](_0x197721);}})[_0xa1c9('0x28')](function(_0x4deadc){if(_0x4deadc){return _0x4deadc?{'count':_0x53ea3b,'rows':_0x4deadc}:null;}})[_0xa1c9('0x28')](respondWithResult(_0x175662,null))[_0xa1c9('0x4b')](handleError(_0x175662,null));};exports[_0xa1c9('0x7e')]=function(_0x59bc9f,_0x1c8a80,_0x2780b7){var _0x26f241={};var _0x537f48={};var _0x4e1e2f;var _0x46d8d1;return db['VoicePrefix'][_0xa1c9('0x7f')]({'where':{'id':_0x59bc9f['params']['id']}})[_0xa1c9('0x28')](handleEntityNotFound(_0x1c8a80,null))[_0xa1c9('0x28')](function(_0x2d2374){if(_0x2d2374){_0x4e1e2f=_0x2d2374;_0x537f48['model']=_['keys'](db['Team'][_0xa1c9('0x32')]);_0x537f48[_0xa1c9('0x38')]=_[_0xa1c9('0x37')](_0x59bc9f[_0xa1c9('0x38')]);_0x537f48['filters']=_['intersection'](_0x537f48[_0xa1c9('0x35')],_0x537f48['query']);_0x26f241[_0xa1c9('0x3a')]=_[_0xa1c9('0x3b')](_0x537f48[_0xa1c9('0x35')],qs['fields'](_0x59bc9f[_0xa1c9('0x38')][_0xa1c9('0x3c')]));_0x26f241[_0xa1c9('0x3a')]=_0x26f241[_0xa1c9('0x3a')][_0xa1c9('0x3d')]?_0x26f241[_0xa1c9('0x3a')]:_0x537f48[_0xa1c9('0x35')];_0x26f241[_0xa1c9('0x40')]=qs[_0xa1c9('0x41')](_0x59bc9f[_0xa1c9('0x38')]['sort']);_0x26f241[_0xa1c9('0x42')]=qs[_0xa1c9('0x39')](_['pick'](_0x59bc9f[_0xa1c9('0x38')],_0x537f48[_0xa1c9('0x39')]));if(_0x59bc9f[_0xa1c9('0x38')][_0xa1c9('0x7c')]){_0x26f241[_0xa1c9('0x42')]=_['merge'](_0x26f241[_0xa1c9('0x42')],{'$or':_['map'](_0x26f241[_0xa1c9('0x3a')],function(_0x2c04c5){var _0x137a58={};_0x137a58[_0x2c04c5]={'$like':'%'+_0x59bc9f['query'][_0xa1c9('0x7c')]+'%'};return _0x137a58;})});}_0x26f241=_[_0xa1c9('0x43')]({},_0x26f241,_0x59bc9f[_0xa1c9('0x45')]);return _0x4e1e2f[_0xa1c9('0x7e')](_0x26f241);}})[_0xa1c9('0x28')](function(_0x328fa7){if(_0x328fa7){_0x46d8d1=_0x328fa7[_0xa1c9('0x3d')];if(!_0x59bc9f['query'][_0xa1c9('0x3e')](_0xa1c9('0x3f'))){_0x26f241[_0xa1c9('0x21')]=qs['limit'](_0x59bc9f[_0xa1c9('0x38')][_0xa1c9('0x21')]);_0x26f241['offset']=qs[_0xa1c9('0x20')](_0x59bc9f['query'][_0xa1c9('0x20')]);}return _0x4e1e2f[_0xa1c9('0x7e')](_0x26f241);}})[_0xa1c9('0x28')](function(_0x3e5016){if(_0x3e5016){return _0x3e5016?{'count':_0x46d8d1,'rows':_0x3e5016}:null;}})[_0xa1c9('0x28')](respondWithResult(_0x1c8a80,null))['catch'](handleError(_0x1c8a80,null));};exports[_0xa1c9('0x80')]=function(_0xabacf1,_0x38a7fc,_0x2a3082){var _0x276c98=_0xabacf1[_0xa1c9('0x6e')][_0xa1c9('0x73')];var _0x48520d;return db[_0xa1c9('0x81')][_0xa1c9('0x49')]({'where':{'id':_0x276c98},'attributes':['id'],'include':[{'model':db[_0xa1c9('0x7b')],'as':_0xa1c9('0x82'),'attributes':['id','name',_0xa1c9('0x83'),_0xa1c9('0x84'),'interface'],'raw':!![]}]})[_0xa1c9('0x28')](function(_0x2a82fd){if(_0x2a82fd){_0x48520d=_0x2a82fd;var _0x419cf2=_[_0xa1c9('0x85')](_0x2a82fd,function(_0x51884d){var _0x52360b=_0x51884d[_0xa1c9('0x51')]({'plain':!![]});return _0x52360b['Agents'];});return db[_0xa1c9('0x31')]['find']({'where':{'id':_0xabacf1['params']['id']}})[_0xa1c9('0x28')](function(_0x507b2a){return db[_0xa1c9('0x4f')][_0xa1c9('0x70')](function(_0x296607){return _0x507b2a[_0xa1c9('0x80')](_0x276c98,{'transaction':_0x296607})[_0xa1c9('0x28')](function(){return BPromise[_0xa1c9('0x86')](_0x48520d,function(_0x531c20){return db[_0xa1c9('0x87')]['upsert']({'TeamId':_0x531c20['id'],'VoicePrefixId':_0xabacf1[_0xa1c9('0x4d')]['id']},{'transaction':_0x296607});});})[_0xa1c9('0x28')](function(){return BPromise['each'](_0x419cf2,function(_0x110617){return db[_0xa1c9('0x88')][_0xa1c9('0x89')]({'where':{'UserId':_0x110617['id'],'VoicePrefixId':_0xabacf1[_0xa1c9('0x4d')]['id']},'transaction':_0x296607});});})[_0xa1c9('0x28')](function(){_0x419cf2[_0xa1c9('0x8a')](function(_0x5640bb){socket[_0xa1c9('0x76')](_0xa1c9('0x77'),{'UserId':_0x5640bb['id'],'VoicePrefixId':_0x507b2a['id']});});});});});}})[_0xa1c9('0x28')](respondWithStatusCode(_0x38a7fc,null))['catch'](handleError(_0x38a7fc,null));};exports[_0xa1c9('0x8b')]=function(_0x4c8c5e,_0x3cb7d4,_0x5c504c){return db['Team'][_0xa1c9('0x49')]({'where':{'id':_0x4c8c5e['query'][_0xa1c9('0x73')]},'attributes':['id'],'include':[{'model':db[_0xa1c9('0x7b')],'as':_0xa1c9('0x82'),'attributes':['id'],'raw':!![]}]})[_0xa1c9('0x28')](handleEntityNotFound(_0x3cb7d4,null))['then'](function(_0x4423e8){var _0x2c75e6=_['map'](_0x4423e8,'id');var _0x163589=[];var _0x5f3e31=[];var _0x6e0efe=squel[_0xa1c9('0x8c')]();_0x6e0efe[_0xa1c9('0x8d')](_0xa1c9('0x8e'))[_0xa1c9('0x8f')](_0xa1c9('0x90'),'tq')[_0xa1c9('0x91')](_0xa1c9('0x92'),'ut',_0xa1c9('0x93'))[_0xa1c9('0x42')](_0xa1c9('0x94'),_0x4c8c5e[_0xa1c9('0x4d')]['id']);for(var _0x2953bd=0x0;_0x2953bd<_0x4423e8['length'];_0x2953bd+=0x1){let _0x28050b=_0x4423e8[_0x2953bd];for(var _0x3f998a=0x0;_0x3f998a<_0x28050b['Agents'][_0xa1c9('0x3d')];_0x3f998a+=0x1){let _0x12cdd5=_0x28050b[_0xa1c9('0x82')][_0x3f998a];var _0x1c5baa=_0x6e0efe[_0xa1c9('0x95')]();_0x1c5baa[_0xa1c9('0x42')](_0xa1c9('0x96'),_0x12cdd5['id']);_0x5f3e31[_0xa1c9('0x65')](db['sequelize']['query'](_0x1c5baa[_0xa1c9('0x97')](),{'type':db[_0xa1c9('0x4f')]['QueryTypes']['SELECT']})['then'](function(_0x5c9f06){if(_0x5c9f06['length']===0x1){return _0x12cdd5['id'];}else{var _0x4d6b40=_[_0xa1c9('0x98')](_[_0xa1c9('0x30')](_0x5c9f06,_0xa1c9('0x99')),function(_0x20c454){return _[_0xa1c9('0x9a')](_0x2c75e6,_0x20c454);});if(_0x4d6b40){return _0x12cdd5['id'];}}}));}}return BPromise[_0xa1c9('0x9b')](_0x5f3e31)['then'](function(_0x22fde9){_0x163589=_(_0x163589)[_0xa1c9('0x9c')](_0x22fde9)[_0xa1c9('0x9d')]()['value']();return db[_0xa1c9('0x31')]['find']({'where':{'id':_0x4c8c5e['params']['id']}})[_0xa1c9('0x28')](function(_0x3e67f4){return db[_0xa1c9('0x4f')][_0xa1c9('0x70')](function(_0x52905a){return _0x3e67f4[_0xa1c9('0x8b')](_0x4c8c5e[_0xa1c9('0x38')][_0xa1c9('0x73')],{'transaction':_0x52905a})[_0xa1c9('0x28')](function(){if(!_[_0xa1c9('0x9e')](_0x163589)){return _0x3e67f4['removeAgents'](_0x163589,{'transaction':_0x52905a});}})[_0xa1c9('0x28')](function(){_0x163589['forEach'](function(_0x424be7){socket[_0xa1c9('0x76')]('userVoicePrefix:remove',{'UserId':_0x424be7,'VoicePrefixId':_0x3e67f4['id']});});});});});});})[_0xa1c9('0x28')](respondWithStatusCode(_0x3cb7d4,null))[_0xa1c9('0x4b')](handleError(_0x3cb7d4,null));};
\ No newline at end of file
index eba3b5d..7462d2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bf2=['save','update','remove','emit','events','VoicePrefix','setMaxListeners'];(function(_0x5c0e7e,_0x3a1598){var _0x41ba37=function(_0x262cc0){while(--_0x262cc0){_0x5c0e7e['push'](_0x5c0e7e['shift']());}};_0x41ba37(++_0x3a1598);}(_0x6bf2,0x17e));var _0x26bf=function(_0x4c9252,_0x18fe70){_0x4c9252=_0x4c9252-0x0;var _0x30448d=_0x6bf2[_0x4c9252];return _0x30448d;};'use strict';var EventEmitter=require(_0x26bf('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x26bf('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x26bf('0x2')](0x0);var events={'afterCreate':_0x26bf('0x3'),'afterUpdate':_0x26bf('0x4'),'afterDestroy':_0x26bf('0x5')};function emitEvent(_0x31d64e){return function(_0x3252e6,_0x2f8015,_0x125558){VoicePrefixEvents['emit'](_0x31d64e+':'+_0x3252e6['id'],_0x3252e6);VoicePrefixEvents[_0x26bf('0x6')](_0x31d64e,_0x3252e6);_0x125558(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
+var _0x33a4=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0xe57a29,_0x322304){var _0x435973=function(_0x1dc93a){while(--_0x1dc93a){_0xe57a29['push'](_0xe57a29['shift']());}};_0x435973(++_0x322304);}(_0x33a4,0x178));var _0x433a=function(_0x2d1c13,_0x3dce05){_0x2d1c13=_0x2d1c13-0x0;var _0x24db3c=_0x33a4[_0x2d1c13];return _0x24db3c;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x433a('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x433a('0x1')](0x0);var events={'afterCreate':_0x433a('0x2'),'afterUpdate':'update','afterDestroy':_0x433a('0x3')};function emitEvent(_0x90e276){return function(_0x497b5b,_0x58997e,_0x34dc99){VoicePrefixEvents[_0x433a('0x4')](_0x90e276+':'+_0x497b5b['id'],_0x497b5b);VoicePrefixEvents['emit'](_0x90e276,_0x497b5b);_0x34dc99(null);};}for(var e in events){if(events[_0x433a('0x5')](e)){var event=events[e];VoicePrefix[_0x433a('0x6')](e,emitEvent(event));}}module[_0x433a('0x7')]=VoicePrefixEvents;
\ No newline at end of file
index 84be24f..b4411e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfb0=['bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','voice_prefixes','../../config/logger','api','moment'];(function(_0x288141,_0x36b019){var _0x35d52c=function(_0x1e4398){while(--_0x1e4398){_0x288141['push'](_0x288141['shift']());}};_0x35d52c(++_0x36b019);}(_0xdfb0,0x1ad));var _0x0dfb=function(_0x250ff2,_0x2af693){_0x250ff2=_0x250ff2-0x0;var _0x4b8bde=_0xdfb0[_0x250ff2];return _0x4b8bde;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0dfb('0x0'))(_0x0dfb('0x1'));var moment=require(_0x0dfb('0x2'));var BPromise=require(_0x0dfb('0x3'));var rp=require(_0x0dfb('0x4'));var fs=require('fs');var path=require(_0x0dfb('0x5'));var rimraf=require(_0x0dfb('0x6'));var config=require(_0x0dfb('0x7'));var attributes=require(_0x0dfb('0x8'));module[_0x0dfb('0x9')]=function(_0x41667e,_0x2a8551){return _0x41667e[_0x0dfb('0xa')]('VoicePrefix',attributes,{'tableName':_0x0dfb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3ec2=['../../config/logger','request-promise','path','rimraf','../../config/environment','exports','define','voice_prefixes'];(function(_0x54331a,_0x1f74ab){var _0x20c64d=function(_0x45bc80){while(--_0x45bc80){_0x54331a['push'](_0x54331a['shift']());}};_0x20c64d(++_0x1f74ab);}(_0x3ec2,0x1a0));var _0x23ec=function(_0x527c39,_0x3ea2a6){_0x527c39=_0x527c39-0x0;var _0x3f4dd6=_0x3ec2[_0x527c39];return _0x3f4dd6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x23ec('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x23ec('0x1'));var fs=require('fs');var path=require(_0x23ec('0x2'));var rimraf=require(_0x23ec('0x3'));var config=require(_0x23ec('0x4'));var attributes=require('./voicePrefix.attributes');module[_0x23ec('0x5')]=function(_0x174aa1,_0x1cf330){return _0x174aa1[_0x23ec('0x6')]('VoicePrefix',attributes,{'tableName':_0x23ec('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7135149..eff4cea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacc6=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./voicePrefix.socket','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x2dc14b,_0x2beca8){var _0x5b36c8=function(_0x52b51a){while(--_0x52b51a){_0x2dc14b['push'](_0x2dc14b['shift']());}};_0x5b36c8(++_0x2beca8);}(_0xacc6,0x150));var _0x6acc=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0xacc6[_0x2053ea];return _0x2232c4;};'use strict';var _=require(_0x6acc('0x0'));var util=require(_0x6acc('0x1'));var moment=require(_0x6acc('0x2'));var BPromise=require(_0x6acc('0x3'));var rs=require(_0x6acc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6acc('0x5'))['db'];var utils=require(_0x6acc('0x6'));var logger=require(_0x6acc('0x7'))('rpc');var config=require(_0x6acc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6acc('0x9')][_0x6acc('0xa')]({'port':0x232a});config['redis']=_[_0x6acc('0xb')](config['redis'],{'host':_0x6acc('0xc'),'port':0x18eb});var socket=require(_0x6acc('0xd'))(new Redis(config[_0x6acc('0xe')]));require(_0x6acc('0xf'))['register'](socket);function respondWithRpcPromise(_0x1343cb,_0x4cf4c7,_0x3c1a24){return new BPromise(function(_0x21b624,_0xb8647d){return client[_0x6acc('0x10')](_0x1343cb,_0x3c1a24)[_0x6acc('0x11')](function(_0x15b64b){logger['info'](_0x6acc('0x12'),_0x4cf4c7,_0x6acc('0x13'));logger[_0x6acc('0x14')](_0x6acc('0x15'),_0x4cf4c7,_0x6acc('0x13'),JSON['stringify'](_0x15b64b));if(_0x15b64b['error']){if(_0x15b64b[_0x6acc('0x16')][_0x6acc('0x17')]===0x1f4){logger[_0x6acc('0x16')](_0x6acc('0x12'),_0x4cf4c7,_0x15b64b[_0x6acc('0x16')][_0x6acc('0x18')]);return _0xb8647d(_0x15b64b[_0x6acc('0x16')][_0x6acc('0x18')]);}logger[_0x6acc('0x16')](_0x6acc('0x12'),_0x4cf4c7,_0x15b64b[_0x6acc('0x16')][_0x6acc('0x18')]);return _0x21b624(_0x15b64b[_0x6acc('0x16')][_0x6acc('0x18')]);}else{logger[_0x6acc('0x19')](_0x6acc('0x12'),_0x4cf4c7,_0x6acc('0x13'));_0x21b624(_0x15b64b[_0x6acc('0x1a')]['message']);}})[_0x6acc('0x1b')](function(_0x43b8ca){logger[_0x6acc('0x16')](_0x6acc('0x12'),_0x4cf4c7,_0x43b8ca);_0xb8647d(_0x43b8ca);});});}
\ No newline at end of file
+var _0xdeb3=['request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0xdeb3,0xb7));var _0x3deb=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xdeb3[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x3deb('0x0'));var moment=require(_0x3deb('0x1'));var BPromise=require(_0x3deb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3deb('0x3'))['db'];var utils=require(_0x3deb('0x4'));var logger=require(_0x3deb('0x5'))(_0x3deb('0x6'));var config=require(_0x3deb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3deb('0x8')]['http']({'port':0x232a});config[_0x3deb('0x9')]=_['defaults'](config[_0x3deb('0x9')],{'host':_0x3deb('0xa'),'port':0x18eb});var socket=require(_0x3deb('0xb'))(new Redis(config[_0x3deb('0x9')]));require(_0x3deb('0xc'))[_0x3deb('0xd')](socket);function respondWithRpcPromise(_0x2cd00a,_0x1d628e,_0x36c78a){return new BPromise(function(_0x54b603,_0x5a50f5){return client[_0x3deb('0xe')](_0x2cd00a,_0x36c78a)[_0x3deb('0xf')](function(_0x756238){logger['info'](_0x3deb('0x10'),_0x1d628e,_0x3deb('0x11'));logger[_0x3deb('0x12')](_0x3deb('0x13'),_0x1d628e,'request\x20sent',JSON['stringify'](_0x756238));if(_0x756238['error']){if(_0x756238[_0x3deb('0x14')][_0x3deb('0x15')]===0x1f4){logger[_0x3deb('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x1d628e,_0x756238[_0x3deb('0x14')][_0x3deb('0x16')]);return _0x5a50f5(_0x756238['error'][_0x3deb('0x16')]);}logger[_0x3deb('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x1d628e,_0x756238[_0x3deb('0x14')]['message']);return _0x54b603(_0x756238[_0x3deb('0x14')]['message']);}else{logger['info'](_0x3deb('0x10'),_0x1d628e,_0x3deb('0x11'));_0x54b603(_0x756238[_0x3deb('0x17')][_0x3deb('0x16')]);}})[_0x3deb('0x18')](function(_0x145d16){logger['error'](_0x3deb('0x10'),_0x1d628e,_0x145d16);_0x5a50f5(_0x145d16);});});}
\ No newline at end of file
index 3f2139b..465765d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fb7=['register','length','voicePrefix:','save','update','removeListener'];(function(_0x211bc3,_0x5860c8){var _0x34c9a2=function(_0x4bfa37){while(--_0x4bfa37){_0x211bc3['push'](_0x211bc3['shift']());}};_0x34c9a2(++_0x5860c8);}(_0x3fb7,0x189));var _0x73fb=function(_0x10f7f2,_0x42eae2){_0x10f7f2=_0x10f7f2-0x0;var _0x335b64=_0x3fb7[_0x10f7f2];return _0x335b64;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x73fb('0x0'),'remove',_0x73fb('0x1')];function createListener(_0x302333,_0x4e9e05){return function(_0xdecce4){_0x4e9e05['emit'](_0x302333,_0xdecce4);};}function removeListener(_0x309b77,_0x2c4f8c){return function(){VoicePrefixEvents[_0x73fb('0x2')](_0x309b77,_0x2c4f8c);};}exports[_0x73fb('0x3')]=function(_0x3330e3){for(var _0x423496=0x0,_0x33d35b=events[_0x73fb('0x4')];_0x423496<_0x33d35b;_0x423496++){var _0x1455de=events[_0x423496];var _0x2413ee=createListener(_0x73fb('0x5')+_0x1455de,_0x3330e3);VoicePrefixEvents['on'](_0x1455de,_0x2413ee);}};
\ No newline at end of file
+var _0x292e=['register','length','voicePrefix:','./voicePrefix.events','save','remove','update','emit'];(function(_0x4aff52,_0xb6dcf6){var _0x54c045=function(_0x2a552a){while(--_0x2a552a){_0x4aff52['push'](_0x4aff52['shift']());}};_0x54c045(++_0xb6dcf6);}(_0x292e,0xcb));var _0xe292=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x292e[_0x2b4411];return _0x8e41ef;};'use strict';var VoicePrefixEvents=require(_0xe292('0x0'));var events=[_0xe292('0x1'),_0xe292('0x2'),_0xe292('0x3')];function createListener(_0x492697,_0x5d19a5){return function(_0x2652b3){_0x5d19a5[_0xe292('0x4')](_0x492697,_0x2652b3);};}function removeListener(_0x17890d,_0x71f870){return function(){VoicePrefixEvents['removeListener'](_0x17890d,_0x71f870);};}exports[_0xe292('0x5')]=function(_0x5c64fa){for(var _0x3a2715=0x0,_0x3de36e=events[_0xe292('0x6')];_0x3a2715<_0x3de36e;_0x3a2715++){var _0x11fd14=events[_0x3a2715];var _0x26b4de=createListener(_0xe292('0x7')+_0x11fd14,_0x5c64fa);VoicePrefixEvents['on'](_0x11fd14,_0x26b4de);}};
\ No newline at end of file
index 021f7a6..e7c48a4 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(_0x4024b0,_0x8e897f){var _0x2ddad2=function(_0x11d4b3){while(--_0x11d4b3){_0x4024b0['push'](_0x4024b0['shift']());}};_0x2ddad2(++_0x8e897f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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(_0x163838,_0x58a700){var _0xe51f37=function(_0x292b4){while(--_0x292b4){_0x163838['push'](_0x163838['shift']());}};_0xe51f37(++_0x58a700);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 e598e46..623fd4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad70=['INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','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','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','ENUM','inbound','ringall','leastrecent','rrmemory','linear','wrandom','rrordered','setDataValue','getDataValue','dialMethod','booked','roundrobin','predictive','power'];(function(_0x1a27f0,_0x321cdd){var _0x395241=function(_0x57d86b){while(--_0x57d86b){_0x1a27f0['push'](_0x1a27f0['shift']());}};_0x395241(++_0x321cdd);}(_0xad70,0xd8));var _0x0ad7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xad70[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x0ad7('0x0')]={'name':{'type':Sequelize[_0x0ad7('0x1')],'allowNull':![],'unique':_0x0ad7('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0ad7('0x3')]('inbound','outbound'),'allowNull':![],'defaultValue':_0x0ad7('0x4')},'musiconhold':{'type':Sequelize[_0x0ad7('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x0ad7('0x5'),_0x0ad7('0x6'),'fewestcalls','random',_0x0ad7('0x7'),_0x0ad7('0x8'),_0x0ad7('0x9'),_0x0ad7('0xa')),'allowNull':![],'defaultValue':_0x0ad7('0x5'),'set':function(_0x56067a){this[_0x0ad7('0xb')]('strategy',_0x56067a?_0x56067a:'rrmemory');},'get':function(){var _0x2c04ac=this[_0x0ad7('0xc')]('type');var _0x57bfd4=this[_0x0ad7('0xc')](_0x0ad7('0xd'));var _0x69764e=this[_0x0ad7('0xc')]('strategy');if(_0x2c04ac==='inbound'){return _0x69764e;}if(_0x57bfd4===_0x0ad7('0xe')&&_0x69764e==='rrmemory'||_0x57bfd4===_0x0ad7('0xe')&&_0x69764e===_0x0ad7('0xf')){return _0x69764e;}if(_0x57bfd4==='progressive'||_0x57bfd4===_0x0ad7('0x10')||_0x57bfd4===_0x0ad7('0x11')){return _0x69764e;}return null;}},'servicelevel':{'type':Sequelize[_0x0ad7('0x12')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0ad7('0x12')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x0ad7('0x12')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0ad7('0x1')]},'weight':{'type':Sequelize[_0x0ad7('0x12')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0ad7('0x12')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0ad7('0x3')](_0x0ad7('0x13'),'no'),'defaultValue':_0x0ad7('0x13')},'autopause':{'type':Sequelize[_0x0ad7('0x3')]('yes','no',_0x0ad7('0x14')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x0ad7('0x3')](_0x0ad7('0x13'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0ad7('0x3')](_0x0ad7('0x13'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0ad7('0x3')](_0x0ad7('0x13'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0ad7('0x3')](_0x0ad7('0x13'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0ad7('0x13'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0ad7('0x3')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0ad7('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x0ad7('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x0ad7('0x12')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0ad7('0x12')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0ad7('0x3')](_0x0ad7('0x13'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0ad7('0x13'),'no'),'defaultValue':_0x0ad7('0x13')},'announce_holdtime':{'type':Sequelize[_0x0ad7('0x3')]('yes','no',_0x0ad7('0x15')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0ad7('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0ad7('0x3')](_0x0ad7('0x13'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0ad7('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0ad7('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0ad7('0x1')]},'queue_youarenext':{'type':Sequelize[_0x0ad7('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x0ad7('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x0ad7('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0ad7('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0ad7('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x0ad7('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x0ad7('0x1')]},'queue_less_than':{'type':Sequelize[_0x0ad7('0x1')]},'periodic_announce':{'type':Sequelize[_0x0ad7('0x16')],'set':function(_0x1359eb){this[_0x0ad7('0xb')](_0x0ad7('0x17'),_0x1359eb?_0x1359eb[_0x0ad7('0x18')](','):[]);},'get':function(){return this[_0x0ad7('0xc')](_0x0ad7('0x17'))?this['getDataValue'](_0x0ad7('0x17'))[_0x0ad7('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x0ad7('0x1')],'defaultValue':_0x0ad7('0x13'),'set':function(_0x1d3685){this[_0x0ad7('0xb')]('joinempty',_0x1d3685?_0x1d3685[_0x0ad7('0x18')](','):undefined);},'get':function(){return this[_0x0ad7('0xc')](_0x0ad7('0x1a'))?this[_0x0ad7('0xc')](_0x0ad7('0x1a'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0ad7('0x1')],'defaultValue':'no','set':function(_0x6d6d7){this[_0x0ad7('0xb')](_0x0ad7('0x1b'),_0x6d6d7?_0x6d6d7[_0x0ad7('0x18')](','):undefined);},'get':function(){return this[_0x0ad7('0xc')]('leavewhenempty')?this[_0x0ad7('0xc')](_0x0ad7('0x1b'))[_0x0ad7('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0ad7('0x3')](_0x0ad7('0x13'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0ad7('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x0ad7('0x12')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0ad7('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x0ad7('0x1c')],'defaultValue':0x0,'set':function(_0xcf6772){this[_0x0ad7('0xb')]('acw',_0xcf6772);if(_0xcf6772){if(this[_0x0ad7('0xc')](_0x0ad7('0x1d'))<0x2){this[_0x0ad7('0xb')](_0x0ad7('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x0ad7('0x12')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0ad7('0x1c')],'defaultValue':0x0,'comment':_0x0ad7('0x1e')},'dialMethod':{'type':Sequelize[_0x0ad7('0x3')](_0x0ad7('0x1f'),_0x0ad7('0x20'),'power','predictive','booked'),'defaultValue':_0x0ad7('0x20'),'comment':_0x0ad7('0x21')},'dialLimitChannel':{'type':Sequelize[_0x0ad7('0x12')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0ad7('0x22')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0ad7('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0ad7('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0ad7('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0ad7('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0ad7('0x3')](_0x0ad7('0x26'),_0x0ad7('0x27')),'defaultValue':_0x0ad7('0x27'),'comment':_0x0ad7('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0ad7('0x29')](0x2)[_0x0ad7('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x0ad7('0x12')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0ad7('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0ad7('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x0ad7('0x12')](0x3)[_0x0ad7('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ad7('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x0ad7('0x1')],'defaultValue':_0x0ad7('0x2c'),'comment':_0x0ad7('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0x0ad7('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ad7('0x2e')},'dialQueueProject':{'type':Sequelize[_0x0ad7('0x1')],'comment':_0x0ad7('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0ad7('0x12')](0x3)[_0x0ad7('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ad7('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0ad7('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ad7('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x0ad7('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ad7('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0ad7('0x12')](0x5)[_0x0ad7('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0ad7('0x12')](0x3)[_0x0ad7('0x23')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0ad7('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ad7('0x33')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0ad7('0x34')},'dialTimezone':{'type':Sequelize[_0x0ad7('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x0ad7('0x35')},'dialPrefix':{'type':Sequelize[_0x0ad7('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x0ad7('0x3')](_0x0ad7('0x36'),'never','onlyIfOpen'),'defaultValue':_0x0ad7('0x36')},'dialAMDActive':{'type':Sequelize[_0x0ad7('0x1c')],'defaultValue':0x0,'comment':_0x0ad7('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0x0ad7('0x12')](0x9)[_0x0ad7('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x0ad7('0x12')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0ad7('0x12')](0x9)[_0x0ad7('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0ad7('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0ad7('0x12')](0x9)[_0x0ad7('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0ad7('0x39')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0ad7('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0ad7('0x12')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0ad7('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0ad7('0x12')](0x9)[_0x0ad7('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0ad7('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0ad7('0x12')](0x5)[_0x0ad7('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0ad7('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0ad7('0x12')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0ad7('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0ad7('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0ad7('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0ad7('0x1c')],'defaultValue':0x0,'comment':_0x0ad7('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0ad7('0x3')]('DESC','ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x0ad7('0x1')],'comment':_0x0ad7('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0ad7('0x1c')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0ad7('0x12')](0x3)[_0x0ad7('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0ad7('0x41')},'dialCutDigit':{'type':Sequelize[_0x0ad7('0x12')](0x3)[_0x0ad7('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0ad7('0x42')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0ad7('0x12')](0x3)[_0x0ad7('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ad7('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0ad7('0x12')](0x5)[_0x0ad7('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x0ad7('0x12')](0x3)[_0x0ad7('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ad7('0x44')},'dialDropRetryFrequency':{'type':Sequelize[_0x0ad7('0x12')](0x5)[_0x0ad7('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ad7('0x45')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0ad7('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ad7('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0ad7('0x12')](0x5)[_0x0ad7('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x0ad7('0x12')](0x3)[_0x0ad7('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0ad7('0x12')](0x5)[_0x0ad7('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ad7('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0ad7('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ad7('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0ad7('0x12')](0x5)[_0x0ad7('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ad7('0x49')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0ad7('0x12')],'allowNull':!![],'comment':_0x0ad7('0x4a')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0ad7('0x4b'),'set':function(_0x275cd9){if(!_0x275cd9)this[_0x0ad7('0xb')](_0x0ad7('0x4c'),null);this[_0x0ad7('0xb')](_0x0ad7('0x4d'),_0x275cd9);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x0ad7('0x12')](0x3)[_0x0ad7('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x0ad7('0x12')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x0ad7('0x1c')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x0ad7('0x12')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x0ad7('0x1c')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1e0a=['#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports','STRING','name','inbound','outbound','ENUM','ringall','fewestcalls','random','rrmemory','linear','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','power','INTEGER','yes','once','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','predictive','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','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','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)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never'];(function(_0x7d197f,_0x2a36c3){var _0x276720=function(_0x21b2c2){while(--_0x21b2c2){_0x7d197f['push'](_0x7d197f['shift']());}};_0x276720(++_0x2a36c3);}(_0x1e0a,0x1e1));var _0xa1e0=function(_0x45fed7,_0x37c67c){_0x45fed7=_0x45fed7-0x0;var _0x404c92=_0x1e0a[_0x45fed7];return _0x404c92;};'use strict';var Sequelize=require(_0xa1e0('0x0'));module[_0xa1e0('0x1')]={'name':{'type':Sequelize[_0xa1e0('0x2')],'allowNull':![],'unique':_0xa1e0('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xa1e0('0x4'),_0xa1e0('0x5')),'allowNull':![],'defaultValue':_0xa1e0('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0xa1e0('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xa1e0('0x6')]('rr',_0xa1e0('0x7'),'leastrecent',_0xa1e0('0x8'),_0xa1e0('0x9'),_0xa1e0('0xa'),_0xa1e0('0xb'),'wrandom',_0xa1e0('0xc')),'allowNull':![],'defaultValue':_0xa1e0('0x7'),'set':function(_0x13b17e){this[_0xa1e0('0xd')](_0xa1e0('0xe'),_0x13b17e?_0x13b17e:'rrmemory');},'get':function(){var _0x3fe8af=this[_0xa1e0('0xf')](_0xa1e0('0x10'));var _0x5bf0af=this[_0xa1e0('0xf')](_0xa1e0('0x11'));var _0x439ea9=this[_0xa1e0('0xf')](_0xa1e0('0xe'));if(_0x3fe8af===_0xa1e0('0x4')){return _0x439ea9;}if(_0x5bf0af===_0xa1e0('0x12')&&_0x439ea9==='rrmemory'||_0x5bf0af===_0xa1e0('0x12')&&_0x439ea9===_0xa1e0('0x13')){return _0x439ea9;}if(_0x5bf0af==='progressive'||_0x5bf0af==='predictive'||_0x5bf0af===_0xa1e0('0x14')){return _0x439ea9;}return null;}},'servicelevel':{'type':Sequelize[_0xa1e0('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xa1e0('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xa1e0('0x15')](0xb)},'timeout':{'type':Sequelize[_0xa1e0('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xa1e0('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xa1e0('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xa1e0('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xa1e0('0x16'),'no'),'defaultValue':_0xa1e0('0x16')},'autopause':{'type':Sequelize[_0xa1e0('0x6')]('yes','no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xa1e0('0x15')](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xa1e0('0x6')](_0xa1e0('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xa1e0('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xa1e0('0x6')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xa1e0('0x6')](_0xa1e0('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xa1e0('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xa1e0('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xa1e0('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xa1e0('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xa1e0('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xa1e0('0x6')](_0xa1e0('0x16'),'no'),'defaultValue':_0xa1e0('0x16')},'announce_holdtime':{'type':Sequelize[_0xa1e0('0x6')]('yes','no',_0xa1e0('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xa1e0('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xa1e0('0x6')](_0xa1e0('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0xa1e0('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xa1e0('0x6')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xa1e0('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xa1e0('0x2')]},'queue_youarenext':{'type':Sequelize[_0xa1e0('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xa1e0('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xa1e0('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xa1e0('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xa1e0('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xa1e0('0x2')]},'queue_quantity1':{'type':Sequelize[_0xa1e0('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xa1e0('0x2')]},'queue_less_than':{'type':Sequelize[_0xa1e0('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0xffa09d){this['setDataValue'](_0xa1e0('0x18'),_0xffa09d?_0xffa09d[_0xa1e0('0x19')](','):[]);},'get':function(){return this[_0xa1e0('0xf')]('periodic_announce')?this[_0xa1e0('0xf')](_0xa1e0('0x18'))[_0xa1e0('0x1a')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xa1e0('0x16'),'set':function(_0x35e895){this[_0xa1e0('0xd')](_0xa1e0('0x1b'),_0x35e895?_0x35e895[_0xa1e0('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0xa1e0('0x1b'))?this[_0xa1e0('0xf')]('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xa1e0('0x2')],'defaultValue':'no','set':function(_0x369b8e){this[_0xa1e0('0xd')]('leavewhenempty',_0x369b8e?_0x369b8e[_0xa1e0('0x19')](','):undefined);},'get':function(){return this[_0xa1e0('0xf')]('leavewhenempty')?this[_0xa1e0('0xf')](_0xa1e0('0x1c'))[_0xa1e0('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xa1e0('0x6')](_0xa1e0('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xa1e0('0x6')](_0xa1e0('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xa1e0('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xa1e0('0x6')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa1e0('0x2')]},'acw':{'type':Sequelize[_0xa1e0('0x1d')],'defaultValue':0x0,'set':function(_0x5356f7){this['setDataValue'](_0xa1e0('0x1e'),_0x5356f7);if(_0x5356f7){if(this[_0xa1e0('0xf')](_0xa1e0('0x1f'))<0x2){this['setDataValue'](_0xa1e0('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xa1e0('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa1e0('0x20')},'dialMethod':{'type':Sequelize[_0xa1e0('0x6')](_0xa1e0('0x21'),_0xa1e0('0x22'),_0xa1e0('0x14'),_0xa1e0('0x23'),_0xa1e0('0x12')),'defaultValue':'progressive','comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xa1e0('0x15')](0x4)[_0xa1e0('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xa1e0('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa1e0('0x25')},'dialPowerLevel':{'type':Sequelize[_0xa1e0('0x26')](0x2)[_0xa1e0('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xa1e0('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0xa1e0('0x6')](_0xa1e0('0x28'),_0xa1e0('0x29')),'defaultValue':'dropRate','comment':_0xa1e0('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xa1e0('0x26')](0x2)[_0xa1e0('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xa1e0('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0xa1e0('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xa1e0('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa1e0('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa1e0('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xa1e0('0x15')](0x3)[_0xa1e0('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa1e0('0x2d')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xa1e0('0x2e'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xa1e0('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa1e0('0x2f')},'dialQueueProject':{'type':Sequelize[_0xa1e0('0x2')],'comment':_0xa1e0('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa1e0('0x15')](0x3)[_0xa1e0('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa1e0('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa1e0('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa1e0('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa1e0('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa1e0('0x15')](0x5)[_0xa1e0('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa1e0('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa1e0('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xa1e0('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa1e0('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa1e0('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa1e0('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa1e0('0x36')},'dialTimezone':{'type':Sequelize[_0xa1e0('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa1e0('0x2')],'defaultValue':_0xa1e0('0x37')},'dialPrefix':{'type':Sequelize[_0xa1e0('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xa1e0('0x38'),_0xa1e0('0x39'),'onlyIfOpen'),'defaultValue':_0xa1e0('0x38')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa1e0('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa1e0('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0xa1e0('0x15')](0x9)[_0xa1e0('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa1e0('0x15')](0x9)[_0xa1e0('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa1e0('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xa1e0('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa1e0('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0xa1e0('0x15')](0x9)[_0xa1e0('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa1e0('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa1e0('0x15')](0x9)[_0xa1e0('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa1e0('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa1e0('0x15')](0x9)[_0xa1e0('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa1e0('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa1e0('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa1e0('0x15')](0x9)[_0xa1e0('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa1e0('0x41')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xa1e0('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xa1e0('0x42')},'dialRecallInQueue':{'type':Sequelize[_0xa1e0('0x1d')],'defaultValue':0x0,'comment':_0xa1e0('0x43')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa1e0('0x6')](_0xa1e0('0x44'),'ASC'),'defaultValue':_0xa1e0('0x44')},'dialQueueProject2':{'type':Sequelize[_0xa1e0('0x2')],'comment':_0xa1e0('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xa1e0('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xa1e0('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa1e0('0x15')](0x3)[_0xa1e0('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa1e0('0x45')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa1e0('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa1e0('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa1e0('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa1e0('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa1e0('0x48')},'dialDropMaxRetry':{'type':Sequelize[_0xa1e0('0x15')](0x3)[_0xa1e0('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xa1e0('0x15')](0x5)[_0xa1e0('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa1e0('0x15')](0x3)[_0xa1e0('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa1e0('0x15')](0x5)[_0xa1e0('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xa1e0('0x15')](0x3)[_0xa1e0('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xa1e0('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa1e0('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa1e0('0x15')](0x3)[_0xa1e0('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa1e0('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa1e0('0x15')](0x5)[_0xa1e0('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa1e0('0x15')],'allowNull':!![],'comment':_0xa1e0('0x4b')},'mandatoryDisposition':{'type':Sequelize[_0xa1e0('0x1d')],'defaultValue':![],'comment':_0xa1e0('0x4c'),'set':function(_0x230597){if(!_0x230597)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xa1e0('0xd')]('mandatoryDisposition',_0x230597);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xa1e0('0x15')](0x3)[_0xa1e0('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xa1e0('0x15')](0x3)[_0xa1e0('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xa1e0('0x1d')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xa1e0('0x15')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xa1e0('0x1d')],'defaultValue':![]}};
\ No newline at end of file
index 25fd5b4..a474475 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7ae=['SIP/%s','removeAgents','isArray','getAgents','getMembers','CmList','getLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','ContactId','ListId','select','scheduledAt','CmListId','cm_contacts','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','join','h.ContactId=ci.CmContactId','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','phone\x20IS\x20NOT\x20NULL','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','end','status','json','offset','undefined','count','apply','reject','save','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','stack','send','index','VoiceQueue','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','rows','catch','show','keys','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','UserProfileSection','getHoppers','findOne','CmHopper','VoiceQueueId','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','emit','userVoiceQueue:save','removeTeams','field','from','team_has_voice_queues','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','compact','ids','userVoiceQueue:remove','addAgents','isEmpty'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xb7ae,0xf3));var _0xeb7a=function(_0x15d465,_0xf0fc84){_0x15d465=_0x15d465-0x0;var _0x9777be=_0xb7ae[_0x15d465];return _0x9777be;};'use strict';var emlformat=require(_0xeb7a('0x0'));var rimraf=require(_0xeb7a('0x1'));var zipdir=require(_0xeb7a('0x2'));var jsonpatch=require(_0xeb7a('0x3'));var rp=require(_0xeb7a('0x4'));var moment=require('moment');var BPromise=require(_0xeb7a('0x5'));var Mustache=require(_0xeb7a('0x6'));var util=require(_0xeb7a('0x7'));var path=require('path');var sox=require(_0xeb7a('0x8'));var csv=require(_0xeb7a('0x9'));var ejs=require(_0xeb7a('0xa'));var fs=require('fs');var fs_extra=require(_0xeb7a('0xb'));var _=require(_0xeb7a('0xc'));var squel=require('squel');var crypto=require(_0xeb7a('0xd'));var jsforce=require(_0xeb7a('0xe'));var deskjs=require(_0xeb7a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xeb7a('0x10'));var Papa=require(_0xeb7a('0x11'));var Redis=require(_0xeb7a('0x12'));var authService=require(_0xeb7a('0x13'));var qs=require(_0xeb7a('0x14'));var as=require(_0xeb7a('0x15'));var hardwareService=require(_0xeb7a('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xeb7a('0x17'));var config=require(_0xeb7a('0x18'));var licenseUtil=require(_0xeb7a('0x19'));var db=require(_0xeb7a('0x1a'))['db'];config[_0xeb7a('0x1b')]=_[_0xeb7a('0x1c')](config[_0xeb7a('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xeb7a('0x1d'))(new Redis(config[_0xeb7a('0x1b')]));require('./voiceQueue.socket')[_0xeb7a('0x1e')](socket);function respondWithStatusCode(_0x186ea3,_0x5f41f4){_0x5f41f4=_0x5f41f4||0xcc;return function(_0x2bf77e){if(_0x2bf77e){return _0x186ea3['sendStatus'](_0x5f41f4);}return _0x186ea3['status'](_0x5f41f4)[_0xeb7a('0x1f')]();};}function respondWithResult(_0x5e6256,_0x5782e6){_0x5782e6=_0x5782e6||0xc8;return function(_0x394208){if(_0x394208){return _0x5e6256[_0xeb7a('0x20')](_0x5782e6)[_0xeb7a('0x21')](_0x394208);}};}function respondWithFilteredResult(_0x2d92c7,_0x540b6c){return function(_0x4be13e){if(_0x4be13e){var _0x34ade5=typeof _0x540b6c[_0xeb7a('0x22')]==='undefined'&&typeof _0x540b6c['limit']===_0xeb7a('0x23');var _0x25a399=_0x4be13e[_0xeb7a('0x24')];var _0x268a17=_0x34ade5?0x0:_0x540b6c[_0xeb7a('0x22')];var _0x3025fc=_0x34ade5?_0x4be13e[_0xeb7a('0x24')]:_0x540b6c[_0xeb7a('0x22')]+_0x540b6c['limit'];var _0x431d4a;if(_0x3025fc>=_0x25a399){_0x3025fc=_0x25a399;_0x431d4a=0xc8;}else{_0x431d4a=0xce;}_0x2d92c7[_0xeb7a('0x20')](_0x431d4a);return _0x2d92c7['set']('Content-Range',_0x268a17+'-'+_0x3025fc+'/'+_0x25a399)[_0xeb7a('0x21')](_0x4be13e);}return null;};}function patchUpdates(_0x434aac){return function(_0x46a305){try{jsonpatch[_0xeb7a('0x25')](_0x46a305,_0x434aac,!![]);}catch(_0x29db91){return BPromise[_0xeb7a('0x26')](_0x29db91);}return _0x46a305[_0xeb7a('0x27')]();};}function saveUpdates(_0x4c4816,_0x1f0135){return function(_0xcf0f77){if(_0xcf0f77){return _0xcf0f77[_0xeb7a('0x28')](_0x4c4816)['then'](function(_0x10b7d3){return _0x10b7d3;});}return null;};}function removeEntity(_0x1cf8f6,_0x182335){return function(_0x9b80f5){if(_0x9b80f5){return _0x9b80f5['destroy']()[_0xeb7a('0x29')](function(){var _0x52e882=_0x9b80f5[_0xeb7a('0x2a')]({'plain':!![]});var _0x42698d=[{'name':_0xeb7a('0x2b'),'value':_0xeb7a('0x2c'),'ignore':![]},{'name':_0xeb7a('0x2d'),'value':_0xeb7a('0x2e'),'ignore':![]}];var _0x39738e=_(_0x42698d)[_0xeb7a('0x2f')](_0xeb7a('0x30'))[_0xeb7a('0x31')](_0xeb7a('0x32'))['value']();if(_[_0xeb7a('0x33')](_0x39738e,_0x52e882[_0xeb7a('0x34')])){return;}var _0x5c2ddc=_[_0xeb7a('0x35')](_0x42698d,[_0xeb7a('0x32'),_0x52e882[_0xeb7a('0x34')]])[_0xeb7a('0x36')];return db[_0xeb7a('0x37')][_0xeb7a('0x38')]({'where':{'type':_0x5c2ddc,'resourceId':_0x52e882['id']}})[_0xeb7a('0x29')](function(){return _0x9b80f5;});})[_0xeb7a('0x29')](function(){_0x1cf8f6['status'](0xcc)[_0xeb7a('0x1f')]();});}};}function handleEntityNotFound(_0x2887c6,_0x3e8490){return function(_0x203e5f){if(!_0x203e5f){_0x2887c6['sendStatus'](0x194);}return _0x203e5f;};}function handleError(_0xcb3c2b,_0x2aa250){_0x2aa250=_0x2aa250||0x1f4;return function(_0x216670){logger[_0xeb7a('0x39')](_0x216670[_0xeb7a('0x3a')]);if(_0x216670[_0xeb7a('0x36')]){delete _0x216670['name'];}_0xcb3c2b[_0xeb7a('0x20')](_0x2aa250)[_0xeb7a('0x3b')](_0x216670);};}exports[_0xeb7a('0x3c')]=function(_0x3d879c,_0x285943){var _0x37c26e={},_0x47ba59={},_0x20e72e={'count':0x0,'rows':[]};var _0x4b226f=_[_0xeb7a('0x31')](db[_0xeb7a('0x3d')]['rawAttributes'],function(_0x14705a){return{'name':_0x14705a[_0xeb7a('0x3e')],'type':_0x14705a[_0xeb7a('0x34')][_0xeb7a('0x3f')]};});_0x47ba59[_0xeb7a('0x40')]=_[_0xeb7a('0x31')](_0x4b226f,_0xeb7a('0x36'));_0x47ba59[_0xeb7a('0x41')]=_['keys'](_0x3d879c[_0xeb7a('0x41')]);_0x47ba59[_0xeb7a('0x42')]=_['intersection'](_0x47ba59[_0xeb7a('0x40')],_0x47ba59[_0xeb7a('0x41')]);_0x37c26e[_0xeb7a('0x43')]=_[_0xeb7a('0x44')](_0x47ba59[_0xeb7a('0x40')],qs[_0xeb7a('0x45')](_0x3d879c[_0xeb7a('0x41')]['fields']));_0x37c26e[_0xeb7a('0x43')]=_0x37c26e[_0xeb7a('0x43')][_0xeb7a('0x46')]?_0x37c26e[_0xeb7a('0x43')]:_0x47ba59[_0xeb7a('0x40')];if(!_0x3d879c[_0xeb7a('0x41')][_0xeb7a('0x47')](_0xeb7a('0x48'))){_0x37c26e[_0xeb7a('0x49')]=qs[_0xeb7a('0x49')](_0x3d879c[_0xeb7a('0x41')][_0xeb7a('0x49')]);_0x37c26e['offset']=qs[_0xeb7a('0x22')](_0x3d879c[_0xeb7a('0x41')][_0xeb7a('0x22')]);}_0x37c26e[_0xeb7a('0x4a')]=qs['sort'](_0x3d879c[_0xeb7a('0x41')][_0xeb7a('0x4b')]);_0x37c26e[_0xeb7a('0x4c')]=qs[_0xeb7a('0x42')](_[_0xeb7a('0x4d')](_0x3d879c[_0xeb7a('0x41')],_0x47ba59['filters']),_0x4b226f);if(_0x3d879c[_0xeb7a('0x41')][_0xeb7a('0x2f')]){_0x37c26e['where']=_[_0xeb7a('0x4e')](_0x37c26e['where'],{'$or':_['map'](_0x4b226f,function(_0x5f241a){if(_0x5f241a[_0xeb7a('0x34')]!==_0xeb7a('0x4f')){var _0x7c9d9b={};_0x7c9d9b[_0x5f241a[_0xeb7a('0x36')]]={'$like':'%'+_0x3d879c[_0xeb7a('0x41')][_0xeb7a('0x2f')]+'%'};return _0x7c9d9b;}})});}_0x37c26e=_['merge']({},_0x37c26e,_0x3d879c['options']);var _0x29ecc8={'where':_0x37c26e['where']};return db[_0xeb7a('0x3d')][_0xeb7a('0x24')](_0x29ecc8)[_0xeb7a('0x29')](function(_0x26bc4f){_0x20e72e['count']=_0x26bc4f;if(_0x3d879c[_0xeb7a('0x41')][_0xeb7a('0x50')]){_0x37c26e[_0xeb7a('0x51')]=[{'all':!![]}];}return db[_0xeb7a('0x3d')]['findAll'](_0x37c26e);})[_0xeb7a('0x29')](function(_0x577a43){_0x20e72e[_0xeb7a('0x52')]=_0x577a43;return _0x20e72e;})[_0xeb7a('0x29')](respondWithFilteredResult(_0x285943,_0x37c26e))[_0xeb7a('0x53')](handleError(_0x285943,null));};exports[_0xeb7a('0x54')]=function(_0x971eff,_0x248f29){var _0x33bd01={'raw':![],'where':{'id':_0x971eff['params']['id']}},_0x5e3d8e={};_0x5e3d8e[_0xeb7a('0x40')]=_[_0xeb7a('0x55')](db[_0xeb7a('0x3d')][_0xeb7a('0x56')]);_0x5e3d8e[_0xeb7a('0x41')]=_['keys'](_0x971eff['query']);_0x5e3d8e[_0xeb7a('0x42')]=_['intersection'](_0x5e3d8e[_0xeb7a('0x40')],_0x5e3d8e[_0xeb7a('0x41')]);_0x33bd01[_0xeb7a('0x43')]=_[_0xeb7a('0x44')](_0x5e3d8e[_0xeb7a('0x40')],qs[_0xeb7a('0x45')](_0x971eff[_0xeb7a('0x41')][_0xeb7a('0x45')]));_0x33bd01[_0xeb7a('0x43')]=_0x33bd01[_0xeb7a('0x43')][_0xeb7a('0x46')]?_0x33bd01[_0xeb7a('0x43')]:_0x5e3d8e[_0xeb7a('0x40')];if(_0x971eff[_0xeb7a('0x41')]['includeAll']){_0x33bd01[_0xeb7a('0x51')]=[{'all':!![]}];}_0x33bd01=_[_0xeb7a('0x4e')]({},_0x33bd01,_0x971eff[_0xeb7a('0x57')]);return db[_0xeb7a('0x3d')][_0xeb7a('0x35')](_0x33bd01)[_0xeb7a('0x29')](handleEntityNotFound(_0x248f29,null))[_0xeb7a('0x29')](respondWithResult(_0x248f29,null))[_0xeb7a('0x53')](handleError(_0x248f29,null));};exports[_0xeb7a('0x58')]=function(_0xbc45f8,_0x1b5e4e){return db[_0xeb7a('0x3d')][_0xeb7a('0x58')](_0xbc45f8[_0xeb7a('0x59')],{})[_0xeb7a('0x29')](function(_0x317e7c){var _0x112c88=_0xbc45f8[_0xeb7a('0x5a')][_0xeb7a('0x2a')]({'plain':!![]});if(!_0x112c88)throw new Error(_0xeb7a('0x5b'));if(_0x112c88[_0xeb7a('0x5c')]===_0xeb7a('0x5a')){var _0x196438=_0x317e7c['get']({'plain':!![]});var _0x2713fc=[{'name':'VoiceQueues','value':_0xeb7a('0x2c')},{'name':'QueueCampaigns','value':_0xeb7a('0x2e')}];var _0x139617=_[_0xeb7a('0x35')](_0x2713fc,[_0xeb7a('0x32'),_0x196438[_0xeb7a('0x34')]])[_0xeb7a('0x36')];return db['UserProfileSection'][_0xeb7a('0x35')]({'where':{'name':_0x139617,'userProfileId':_0x112c88[_0xeb7a('0x5d')]},'raw':!![]})[_0xeb7a('0x29')](function(_0x1a261a){if(_0x1a261a&&_0x1a261a['autoAssociation']===0x0){return db[_0xeb7a('0x37')][_0xeb7a('0x58')]({'name':_0x196438[_0xeb7a('0x36')],'resourceId':_0x196438['id'],'type':_0x1a261a[_0xeb7a('0x36')],'sectionId':_0x1a261a['id']},{})[_0xeb7a('0x29')](function(){return _0x317e7c;});}else{return _0x317e7c;}})[_0xeb7a('0x53')](function(_0x181d8a){logger[_0xeb7a('0x39')](_0xeb7a('0x5e'),_0x181d8a);throw _0x181d8a;});}return _0x317e7c;})[_0xeb7a('0x29')](respondWithResult(_0x1b5e4e,0xc9))[_0xeb7a('0x53')](handleError(_0x1b5e4e,null));};exports[_0xeb7a('0x5f')]=function(_0x353668,_0x5c2a77){var _0x1e99d2={'where':{'id':_0x353668[_0xeb7a('0x60')]['id']}},_0x1633ef={};_0x1633ef[_0xeb7a('0x40')]=_['keys'](db[_0xeb7a('0x3d')][_0xeb7a('0x56')]);_0x1e99d2[_0xeb7a('0x43')]=_[_0xeb7a('0x44')](_0x1633ef[_0xeb7a('0x40')],qs[_0xeb7a('0x45')](_0x353668[_0xeb7a('0x41')][_0xeb7a('0x45')]));_0x1e99d2['attributes']=_0x1e99d2[_0xeb7a('0x43')][_0xeb7a('0x46')]?_0x1e99d2[_0xeb7a('0x43')]:_0x1633ef[_0xeb7a('0x40')];if(_0x353668['query'][_0xeb7a('0x50')]){_0x1e99d2[_0xeb7a('0x51')]=[{'all':!![]}];}_0x1e99d2=_[_0xeb7a('0x4e')]({},_0x1e99d2,_0x353668[_0xeb7a('0x57')]);return db['VoiceQueue'][_0xeb7a('0x35')](_0x1e99d2)['then'](handleEntityNotFound(_0x5c2a77,null))['then'](function(_0x46c194){if(_0x46c194){var _0x2fe955=_0x46c194[_0xeb7a('0x2a')]({'plain':!![]});_0x2fe955=qs[_0xeb7a('0x61')](_0x2fe955,['id',_0xeb7a('0x62'),_0xeb7a('0x63')]);_0x353668[_0xeb7a('0x59')]=_[_0xeb7a('0x61')](_0x353668[_0xeb7a('0x59')],['id',_0xeb7a('0x62'),_0xeb7a('0x63')]);return db[_0xeb7a('0x3d')]['create'](_[_0xeb7a('0x4e')](_0x2fe955,_0x353668[_0xeb7a('0x59')]),{'include':_0x353668['query'][_0xeb7a('0x50')]?[{'all':!![]}]:undefined})['then'](function(_0x5a64b0){var _0x167322=_0x353668[_0xeb7a('0x5a')][_0xeb7a('0x2a')]({'plain':!![]});if(!_0x167322)throw new Error(_0xeb7a('0x5b'));if(_0x167322[_0xeb7a('0x5c')]==='user'){var _0x527c2f=_0x5a64b0[_0xeb7a('0x2a')]({'plain':!![]});var _0x481ae7=[{'name':_0xeb7a('0x2b'),'value':_0xeb7a('0x2c')},{'name':_0xeb7a('0x2d'),'value':_0xeb7a('0x2e')}];var _0x57918e=_['find'](_0x481ae7,[_0xeb7a('0x32'),_0x527c2f[_0xeb7a('0x34')]])[_0xeb7a('0x36')];return db[_0xeb7a('0x64')]['find']({'where':{'name':_0x57918e,'userProfileId':_0x167322[_0xeb7a('0x5d')]},'raw':!![]})[_0xeb7a('0x29')](function(_0x5cddd8){if(_0x5cddd8&&_0x5cddd8['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x527c2f[_0xeb7a('0x36')],'resourceId':_0x527c2f['id'],'type':_0x5cddd8[_0xeb7a('0x36')],'sectionId':_0x5cddd8['id']},{})['then'](function(){return _0x5a64b0;});}else{return _0x5a64b0;}})[_0xeb7a('0x53')](function(_0x275681){logger[_0xeb7a('0x39')](_0xeb7a('0x5e'),_0x275681);throw _0x275681;});}return _0x5a64b0;});}})[_0xeb7a('0x29')](respondWithResult(_0x5c2a77,0xc9))[_0xeb7a('0x53')](handleError(_0x5c2a77,null));};exports[_0xeb7a('0x28')]=function(_0x4409e7,_0x18a528){if(_0x4409e7['body']['id']){delete _0x4409e7[_0xeb7a('0x59')]['id'];}return db[_0xeb7a('0x3d')]['find']({'where':{'id':_0x4409e7[_0xeb7a('0x60')]['id']}})[_0xeb7a('0x29')](handleEntityNotFound(_0x18a528,null))[_0xeb7a('0x29')](saveUpdates(_0x4409e7[_0xeb7a('0x59')],null))[_0xeb7a('0x29')](respondWithResult(_0x18a528,null))['catch'](handleError(_0x18a528,null));};exports[_0xeb7a('0x38')]=function(_0x6a72d0,_0x54cbe6){return db[_0xeb7a('0x3d')][_0xeb7a('0x35')]({'where':{'id':_0x6a72d0['params']['id']}})[_0xeb7a('0x29')](handleEntityNotFound(_0x54cbe6,null))['then'](removeEntity(_0x54cbe6,null))[_0xeb7a('0x53')](handleError(_0x54cbe6,null));};exports[_0xeb7a('0x65')]=function(_0x257e9e,_0x4e3574,_0x107bc3){var _0x1d350d={'raw':![],'where':{}};var _0x23a2d7={};var _0x487e8d={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xeb7a('0x66')]({'where':{'id':_0x257e9e['params']['id']}})[_0xeb7a('0x29')](handleEntityNotFound(_0x4e3574,null))['then'](function(_0x438a11){if(_0x438a11){_0x23a2d7[_0xeb7a('0x40')]=_[_0xeb7a('0x55')](db[_0xeb7a('0x67')][_0xeb7a('0x56')]);_0x23a2d7[_0xeb7a('0x41')]=_['keys'](_0x257e9e['query']);_0x23a2d7[_0xeb7a('0x42')]=_[_0xeb7a('0x44')](_0x23a2d7['model'],_0x23a2d7[_0xeb7a('0x41')]);_0x1d350d['attributes']=_[_0xeb7a('0x44')](_0x23a2d7[_0xeb7a('0x40')],qs[_0xeb7a('0x45')](_0x257e9e[_0xeb7a('0x41')][_0xeb7a('0x45')]));_0x1d350d[_0xeb7a('0x43')]=_0x1d350d[_0xeb7a('0x43')]['length']?_0x1d350d[_0xeb7a('0x43')]:_0x23a2d7[_0xeb7a('0x40')];if(!_0x257e9e['query'][_0xeb7a('0x47')](_0xeb7a('0x48'))){_0x1d350d[_0xeb7a('0x49')]=qs[_0xeb7a('0x49')](_0x257e9e[_0xeb7a('0x41')][_0xeb7a('0x49')]);_0x1d350d[_0xeb7a('0x22')]=qs[_0xeb7a('0x22')](_0x257e9e['query'][_0xeb7a('0x22')]);}_0x1d350d[_0xeb7a('0x4a')]=qs[_0xeb7a('0x4b')](_0x257e9e[_0xeb7a('0x41')][_0xeb7a('0x4b')]);_0x1d350d[_0xeb7a('0x4c')]=qs['filters'](_['pick'](_0x257e9e[_0xeb7a('0x41')],_0x23a2d7[_0xeb7a('0x42')]));_0x1d350d['where'][_0xeb7a('0x68')]=_0x438a11['id'];if(_0x257e9e[_0xeb7a('0x41')][_0xeb7a('0x2f')]){_0x1d350d[_0xeb7a('0x4c')]=_[_0xeb7a('0x4e')](_0x1d350d[_0xeb7a('0x4c')],{'$or':_[_0xeb7a('0x31')](_0x1d350d['attributes'],function(_0x391cb4){var _0x404d8f={};_0x404d8f[_0x391cb4]={'$like':'%'+_0x257e9e['query'][_0xeb7a('0x2f')]+'%'};return _0x404d8f;})});}_0x1d350d=_[_0xeb7a('0x4e')]({},_0x1d350d,_0x257e9e[_0xeb7a('0x57')]);return db[_0xeb7a('0x67')][_0xeb7a('0x24')]({'where':_0x1d350d[_0xeb7a('0x4c')]})[_0xeb7a('0x29')](function(_0x388095){_0x487e8d[_0xeb7a('0x24')]=_0x388095;if(_0x257e9e[_0xeb7a('0x41')][_0xeb7a('0x50')]){_0x1d350d['include']=[{'all':!![]}];}return db[_0xeb7a('0x67')]['findAll'](_0x1d350d);})[_0xeb7a('0x29')](function(_0x28737e){_0x487e8d['rows']=_0x28737e;return _0x487e8d;});}})['then'](respondWithFilteredResult(_0x4e3574,_0x1d350d))[_0xeb7a('0x53')](handleError(_0x4e3574,null));};exports['getHopperHistories']=function(_0x76a398,_0x404810,_0x38dacf){var _0x4a0592={'raw':!![],'where':{}};var _0x570cac={};var _0x1f95d2={'count':0x0,'rows':[]};return db[_0xeb7a('0x3d')][_0xeb7a('0x66')]({'where':{'id':_0x76a398[_0xeb7a('0x60')]['id']}})[_0xeb7a('0x29')](handleEntityNotFound(_0x404810,null))[_0xeb7a('0x29')](function(_0x5452ad){if(_0x5452ad){_0x570cac[_0xeb7a('0x40')]=_['keys'](db[_0xeb7a('0x69')][_0xeb7a('0x56')]);_0x570cac[_0xeb7a('0x41')]=_[_0xeb7a('0x55')](_0x76a398['query']);_0x570cac['filters']=_[_0xeb7a('0x44')](_0x570cac['model'],_0x570cac['query']);_0x4a0592['attributes']=_[_0xeb7a('0x44')](_0x570cac['model'],qs['fields'](_0x76a398['query']['fields']));_0x4a0592['attributes']=_0x4a0592[_0xeb7a('0x43')][_0xeb7a('0x46')]?_0x4a0592[_0xeb7a('0x43')]:_0x570cac[_0xeb7a('0x40')];if(!_0x76a398['query'][_0xeb7a('0x47')](_0xeb7a('0x48'))){_0x4a0592[_0xeb7a('0x49')]=qs[_0xeb7a('0x49')](_0x76a398[_0xeb7a('0x41')][_0xeb7a('0x49')]);_0x4a0592[_0xeb7a('0x22')]=qs[_0xeb7a('0x22')](_0x76a398[_0xeb7a('0x41')][_0xeb7a('0x22')]);}_0x4a0592[_0xeb7a('0x4a')]=qs[_0xeb7a('0x4b')](_0x76a398[_0xeb7a('0x41')][_0xeb7a('0x4b')]);_0x4a0592['where']=qs[_0xeb7a('0x42')](_['pick'](_0x76a398[_0xeb7a('0x41')],_0x570cac['filters']));_0x4a0592[_0xeb7a('0x4c')][_0xeb7a('0x68')]=_0x5452ad['id'];if(_0x76a398[_0xeb7a('0x41')][_0xeb7a('0x2f')]){_0x4a0592[_0xeb7a('0x4c')]=_[_0xeb7a('0x4e')](_0x4a0592['where'],{'$or':_[_0xeb7a('0x31')](_0x4a0592[_0xeb7a('0x43')],function(_0x260044){var _0x37a5a1={};_0x37a5a1[_0x260044]={'$like':'%'+_0x76a398[_0xeb7a('0x41')][_0xeb7a('0x2f')]+'%'};return _0x37a5a1;})});}_0x4a0592=_['merge']({},_0x4a0592,_0x76a398[_0xeb7a('0x57')]);return db[_0xeb7a('0x69')]['count']({'where':_0x4a0592[_0xeb7a('0x4c')]})[_0xeb7a('0x29')](function(_0x19b7f4){_0x1f95d2['count']=_0x19b7f4;if(_0x76a398[_0xeb7a('0x41')]['includeAll']){_0x4a0592[_0xeb7a('0x51')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xeb7a('0x6a')](_0x4a0592);})[_0xeb7a('0x29')](function(_0x49adb1){_0x1f95d2[_0xeb7a('0x52')]=_0x49adb1;return _0x1f95d2;});}})[_0xeb7a('0x29')](respondWithFilteredResult(_0x404810,_0x4a0592))[_0xeb7a('0x53')](handleError(_0x404810,null));};exports[_0xeb7a('0x6b')]=function(_0x1b91b7,_0x3c7503,_0x52258b){var _0x2c230e={'raw':!![],'where':{}};var _0x50f8eb={};var _0x3f257c={'count':0x0,'rows':[]};return db[_0xeb7a('0x3d')]['findOne']({'where':{'id':_0x1b91b7[_0xeb7a('0x60')]['id']}})[_0xeb7a('0x29')](handleEntityNotFound(_0x3c7503,null))[_0xeb7a('0x29')](function(_0x527e2b){if(_0x527e2b){_0x50f8eb[_0xeb7a('0x40')]=_[_0xeb7a('0x55')](db['CmHopperFinal'][_0xeb7a('0x56')]);_0x50f8eb[_0xeb7a('0x41')]=_[_0xeb7a('0x55')](_0x1b91b7[_0xeb7a('0x41')]);_0x50f8eb[_0xeb7a('0x42')]=_[_0xeb7a('0x44')](_0x50f8eb[_0xeb7a('0x40')],_0x50f8eb[_0xeb7a('0x41')]);_0x2c230e[_0xeb7a('0x43')]=_[_0xeb7a('0x44')](_0x50f8eb['model'],qs[_0xeb7a('0x45')](_0x1b91b7['query'][_0xeb7a('0x45')]));_0x2c230e[_0xeb7a('0x43')]=_0x2c230e['attributes'][_0xeb7a('0x46')]?_0x2c230e[_0xeb7a('0x43')]:_0x50f8eb['model'];if(!_0x1b91b7['query'][_0xeb7a('0x47')]('nolimit')){_0x2c230e[_0xeb7a('0x49')]=qs[_0xeb7a('0x49')](_0x1b91b7[_0xeb7a('0x41')][_0xeb7a('0x49')]);_0x2c230e[_0xeb7a('0x22')]=qs[_0xeb7a('0x22')](_0x1b91b7['query'][_0xeb7a('0x22')]);}_0x2c230e[_0xeb7a('0x4a')]=qs[_0xeb7a('0x4b')](_0x1b91b7[_0xeb7a('0x41')][_0xeb7a('0x4b')]);_0x2c230e[_0xeb7a('0x4c')]=qs[_0xeb7a('0x42')](_['pick'](_0x1b91b7[_0xeb7a('0x41')],_0x50f8eb[_0xeb7a('0x42')]));_0x2c230e[_0xeb7a('0x4c')]['VoiceQueueId']=_0x527e2b['id'];if(_0x1b91b7['query']['filter']){_0x2c230e[_0xeb7a('0x4c')]=_['merge'](_0x2c230e[_0xeb7a('0x4c')],{'$or':_[_0xeb7a('0x31')](_0x2c230e[_0xeb7a('0x43')],function(_0x20250d){var _0x4b55de={};_0x4b55de[_0x20250d]={'$like':'%'+_0x1b91b7[_0xeb7a('0x41')][_0xeb7a('0x2f')]+'%'};return _0x4b55de;})});}_0x2c230e=_[_0xeb7a('0x4e')]({},_0x2c230e,_0x1b91b7['options']);return db[_0xeb7a('0x6c')][_0xeb7a('0x24')]({'where':_0x2c230e[_0xeb7a('0x4c')]})['then'](function(_0x52d48b){_0x3f257c[_0xeb7a('0x24')]=_0x52d48b;if(_0x1b91b7['query'][_0xeb7a('0x50')]){_0x2c230e[_0xeb7a('0x51')]=[{'all':!![]}];}return db[_0xeb7a('0x6c')][_0xeb7a('0x6a')](_0x2c230e);})['then'](function(_0x2fae16){_0x3f257c[_0xeb7a('0x52')]=_0x2fae16;return _0x3f257c;});}})['then'](respondWithFilteredResult(_0x3c7503,_0x2c230e))[_0xeb7a('0x53')](handleError(_0x3c7503,null));};exports[_0xeb7a('0x6d')]=function(_0x53f99e,_0x17c222,_0x2313d8){var _0x5f3690={'raw':!![],'where':{}};var _0xc3201c={};var _0x54d9ac={'count':0x0,'rows':[]};return db[_0xeb7a('0x3d')]['findOne']({'where':{'id':_0x53f99e[_0xeb7a('0x60')]['id']}})['then'](handleEntityNotFound(_0x17c222,null))[_0xeb7a('0x29')](function(_0x2898ce){if(_0x2898ce){_0xc3201c['model']=_['keys'](db['CmHopperBlack'][_0xeb7a('0x56')]);_0xc3201c[_0xeb7a('0x41')]=_[_0xeb7a('0x55')](_0x53f99e['query']);_0xc3201c['filters']=_['intersection'](_0xc3201c[_0xeb7a('0x40')],_0xc3201c['query']);_0x5f3690['attributes']=_['intersection'](_0xc3201c['model'],qs[_0xeb7a('0x45')](_0x53f99e['query'][_0xeb7a('0x45')]));_0x5f3690[_0xeb7a('0x43')]=_0x5f3690[_0xeb7a('0x43')][_0xeb7a('0x46')]?_0x5f3690[_0xeb7a('0x43')]:_0xc3201c['model'];if(!_0x53f99e[_0xeb7a('0x41')]['hasOwnProperty'](_0xeb7a('0x48'))){_0x5f3690[_0xeb7a('0x49')]=qs[_0xeb7a('0x49')](_0x53f99e[_0xeb7a('0x41')][_0xeb7a('0x49')]);_0x5f3690['offset']=qs[_0xeb7a('0x22')](_0x53f99e[_0xeb7a('0x41')][_0xeb7a('0x22')]);}_0x5f3690['order']=qs[_0xeb7a('0x4b')](_0x53f99e[_0xeb7a('0x41')]['sort']);_0x5f3690[_0xeb7a('0x4c')]=qs[_0xeb7a('0x42')](_[_0xeb7a('0x4d')](_0x53f99e[_0xeb7a('0x41')],_0xc3201c[_0xeb7a('0x42')]));_0x5f3690[_0xeb7a('0x4c')][_0xeb7a('0x68')]=_0x2898ce['id'];if(_0x53f99e[_0xeb7a('0x41')][_0xeb7a('0x2f')]){_0x5f3690[_0xeb7a('0x4c')]=_[_0xeb7a('0x4e')](_0x5f3690['where'],{'$or':_[_0xeb7a('0x31')](_0x5f3690['attributes'],function(_0xea6ef0){var _0x3930ff={};_0x3930ff[_0xea6ef0]={'$like':'%'+_0x53f99e[_0xeb7a('0x41')][_0xeb7a('0x2f')]+'%'};return _0x3930ff;})});}_0x5f3690=_[_0xeb7a('0x4e')]({},_0x5f3690,_0x53f99e[_0xeb7a('0x57')]);return db[_0xeb7a('0x6e')]['count']({'where':_0x5f3690[_0xeb7a('0x4c')]})[_0xeb7a('0x29')](function(_0x1b594d){_0x54d9ac['count']=_0x1b594d;if(_0x53f99e['query'][_0xeb7a('0x50')]){_0x5f3690[_0xeb7a('0x51')]=[{'all':!![]}];}return db[_0xeb7a('0x6e')][_0xeb7a('0x6a')](_0x5f3690);})[_0xeb7a('0x29')](function(_0x41eb2d){_0x54d9ac[_0xeb7a('0x52')]=_0x41eb2d;return _0x54d9ac;});}})[_0xeb7a('0x29')](respondWithFilteredResult(_0x17c222,_0x5f3690))[_0xeb7a('0x53')](handleError(_0x17c222,null));};exports['getTeams']=function(_0x3dd151,_0x4a1147,_0x2c5477){var _0x1e87ea={};var _0x2a436a={};var _0x281502;var _0x4c8f00;return db[_0xeb7a('0x3d')][_0xeb7a('0x66')]({'where':{'id':_0x3dd151['params']['id']}})[_0xeb7a('0x29')](handleEntityNotFound(_0x4a1147,null))[_0xeb7a('0x29')](function(_0x4993c5){if(_0x4993c5){_0x281502=_0x4993c5;_0x2a436a['model']=_[_0xeb7a('0x55')](db[_0xeb7a('0x6f')][_0xeb7a('0x56')]);_0x2a436a[_0xeb7a('0x41')]=_['keys'](_0x3dd151[_0xeb7a('0x41')]);_0x2a436a[_0xeb7a('0x42')]=_[_0xeb7a('0x44')](_0x2a436a[_0xeb7a('0x40')],_0x2a436a[_0xeb7a('0x41')]);_0x1e87ea[_0xeb7a('0x43')]=_['intersection'](_0x2a436a[_0xeb7a('0x40')],qs[_0xeb7a('0x45')](_0x3dd151[_0xeb7a('0x41')][_0xeb7a('0x45')]));_0x1e87ea[_0xeb7a('0x43')]=_0x1e87ea[_0xeb7a('0x43')][_0xeb7a('0x46')]?_0x1e87ea[_0xeb7a('0x43')]:_0x2a436a['model'];_0x1e87ea[_0xeb7a('0x4a')]=qs[_0xeb7a('0x4b')](_0x3dd151[_0xeb7a('0x41')][_0xeb7a('0x4b')]);_0x1e87ea[_0xeb7a('0x4c')]=qs['filters'](_[_0xeb7a('0x4d')](_0x3dd151['query'],_0x2a436a[_0xeb7a('0x42')]));if(_0x3dd151[_0xeb7a('0x41')][_0xeb7a('0x2f')]){_0x1e87ea[_0xeb7a('0x4c')]=_[_0xeb7a('0x4e')](_0x1e87ea[_0xeb7a('0x4c')],{'$or':_['map'](_0x1e87ea[_0xeb7a('0x43')],function(_0x3545e5){var _0x27a258={};_0x27a258[_0x3545e5]={'$like':'%'+_0x3dd151[_0xeb7a('0x41')][_0xeb7a('0x2f')]+'%'};return _0x27a258;})});}_0x1e87ea=_[_0xeb7a('0x4e')]({},_0x1e87ea,_0x3dd151[_0xeb7a('0x57')]);return _0x281502[_0xeb7a('0x70')](_0x1e87ea);}})[_0xeb7a('0x29')](function(_0xb29dcf){if(_0xb29dcf){_0x4c8f00=_0xb29dcf['length'];if(!_0x3dd151[_0xeb7a('0x41')][_0xeb7a('0x47')](_0xeb7a('0x48'))){_0x1e87ea[_0xeb7a('0x49')]=qs[_0xeb7a('0x49')](_0x3dd151[_0xeb7a('0x41')][_0xeb7a('0x49')]);_0x1e87ea[_0xeb7a('0x22')]=qs[_0xeb7a('0x22')](_0x3dd151[_0xeb7a('0x41')][_0xeb7a('0x22')]);}return _0x281502[_0xeb7a('0x70')](_0x1e87ea);}})[_0xeb7a('0x29')](function(_0x52a861){if(_0x52a861){return _0x52a861?{'count':_0x4c8f00,'rows':_0x52a861}:null;}})[_0xeb7a('0x29')](respondWithResult(_0x4a1147,null))[_0xeb7a('0x53')](handleError(_0x4a1147,null));};exports['addTeams']=function(_0x1961df,_0x583dde,_0x5da552){var _0x3f57b4=_0x1961df['body'][_0xeb7a('0x71')];var _0x1525d9=_[_0xeb7a('0x31')](_0x3f57b4,'id');return db['Team'][_0xeb7a('0x6a')]({'where':{'id':_0x1525d9},'attributes':['id'],'include':[{'model':db[_0xeb7a('0x72')],'as':_0xeb7a('0x73'),'attributes':['id',_0xeb7a('0x36'),_0xeb7a('0x74'),_0xeb7a('0x75'),_0xeb7a('0x76')],'raw':!![]}]})['then'](function(_0x13ab98){if(_0x13ab98){var _0x150125=_[_0xeb7a('0x77')](_0x13ab98,function(_0x113b88){var _0x101484=_0x113b88['get']({'plain':!![]});_0x101484[_0xeb7a('0x73')][_0xeb7a('0x78')](function(_0x4be79c){_0x4be79c[_0xeb7a('0x79')]=_[_0xeb7a('0x35')](_0x3f57b4,{'id':_0x101484['id']})[_0xeb7a('0x79')];});return _0x101484[_0xeb7a('0x73')];});return db['VoiceQueue']['find']({'where':{'id':_0x1961df['params']['id']}})['then'](function(_0x2df753){return db[_0xeb7a('0x7a')][_0xeb7a('0x7b')](function(_0x118d6f){return _0x2df753[_0xeb7a('0x7c')](_0x1525d9,{'transaction':_0x118d6f})[_0xeb7a('0x29')](function(){return BPromise[_0xeb7a('0x7d')](_0x3f57b4,function(_0x1bb69c){return db[_0xeb7a('0x7e')][_0xeb7a('0x7f')]({'TeamId':_0x1bb69c['id'],'VoiceQueueId':_0x1961df['params']['id'],'penalty':_0x1bb69c[_0xeb7a('0x79')]},{'transaction':_0x118d6f});});})[_0xeb7a('0x29')](function(){return BPromise[_0xeb7a('0x7d')](_0x150125,function(_0x396a76){return db['UserVoiceQueue'][_0xeb7a('0x80')]({'where':{'UserId':_0x396a76['id'],'VoiceQueueId':_0x1961df[_0xeb7a('0x60')]['id']},'defaults':{'penalty':_0x396a76[_0xeb7a('0x79')]},'transaction':_0x118d6f});});})[_0xeb7a('0x29')](function(){return BPromise[_0xeb7a('0x7d')](_[_0xeb7a('0x2f')](_0x150125,{'online':!![]}),function(_0x256f58){return db[_0xeb7a('0x81')][_0xeb7a('0x7f')]({'membername':_0x256f58[_0xeb7a('0x36')],'UserId':_0x256f58['id'],'queue_name':_0x2df753[_0xeb7a('0x36')],'VoiceQueueId':_0x2df753['id'],'interface':_[_0xeb7a('0x82')](_0x256f58['interface'])?util[_0xeb7a('0x83')]('SIP/%s',_0x256f58[_0xeb7a('0x36')]):_0x256f58[_0xeb7a('0x76')],'paused':_0x256f58[_0xeb7a('0x75')]||![],'penalty':_0x256f58['penalty']},{'transaction':_0x118d6f});});})['then'](function(){_0x150125[_0xeb7a('0x78')](function(_0x292914){socket[_0xeb7a('0x84')](_0xeb7a('0x85'),{'UserId':_0x292914['id'],'VoiceQueueId':_0x2df753['id']});});});});});}})[_0xeb7a('0x29')](respondWithStatusCode(_0x583dde,null))[_0xeb7a('0x53')](handleError(_0x583dde,null));};exports[_0xeb7a('0x86')]=function(_0xa192bb,_0x6f42e8,_0x51e6e7){return db[_0xeb7a('0x6f')][_0xeb7a('0x6a')]({'where':{'id':_0xa192bb[_0xeb7a('0x41')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeb7a('0x73'),'attributes':['id'],'raw':!![]}]})[_0xeb7a('0x29')](handleEntityNotFound(_0x6f42e8,null))[_0xeb7a('0x29')](function(_0x2eefec){var _0x209c46=_[_0xeb7a('0x31')](_0x2eefec,'id');var _0x1e7792=[];var _0x7f3eec=[];var _0x3c7083=squel['select']();_0x3c7083[_0xeb7a('0x87')]('tq.TeamId')[_0xeb7a('0x88')](_0xeb7a('0x89'),'tq')['join'](_0xeb7a('0x8a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xeb7a('0x4c')](_0xeb7a('0x8b'),_0xa192bb['params']['id']);for(var _0x2a8ff1=0x0;_0x2a8ff1<_0x2eefec[_0xeb7a('0x46')];_0x2a8ff1+=0x1){let _0x19a8a4=_0x2eefec[_0x2a8ff1];for(var _0x18c730=0x0;_0x18c730<_0x19a8a4[_0xeb7a('0x73')]['length'];_0x18c730+=0x1){let _0x3117e6=_0x19a8a4[_0xeb7a('0x73')][_0x18c730];var _0x2d2804=_0x3c7083[_0xeb7a('0x5f')]();_0x2d2804[_0xeb7a('0x4c')](_0xeb7a('0x8c'),_0x3117e6['id']);_0x7f3eec[_0xeb7a('0x8d')](db[_0xeb7a('0x7a')][_0xeb7a('0x41')](_0x2d2804[_0xeb7a('0x8e')](),{'type':db[_0xeb7a('0x7a')][_0xeb7a('0x8f')]['SELECT']})[_0xeb7a('0x29')](function(_0x3d498e){if(_0x3d498e[_0xeb7a('0x46')]===0x1){return _0x3117e6['id'];}else{var _0x267d82=_[_0xeb7a('0x90')](_['map'](_0x3d498e,_0xeb7a('0x91')),function(_0x3eabb0){return _[_0xeb7a('0x33')](_0x209c46,_0x3eabb0);});if(_0x267d82){return _0x3117e6['id'];}}}));}}return BPromise[_0xeb7a('0x92')](_0x7f3eec)[_0xeb7a('0x29')](function(_0x42dafb){_0x1e7792=_(_0x1e7792)[_0xeb7a('0x93')](_0x42dafb)[_0xeb7a('0x94')]()['value']();return db[_0xeb7a('0x3d')][_0xeb7a('0x35')]({'where':{'id':_0xa192bb[_0xeb7a('0x60')]['id']}})[_0xeb7a('0x29')](function(_0x49809c){return db[_0xeb7a('0x7a')][_0xeb7a('0x7b')](function(_0xf4e8e4){return _0x49809c[_0xeb7a('0x86')](_0xa192bb['query'][_0xeb7a('0x95')],{'transaction':_0xf4e8e4})[_0xeb7a('0x29')](function(){if(!_['isEmpty'](_0x1e7792)){return _0x49809c['removeAgents'](_0x1e7792,{'transaction':_0xf4e8e4})[_0xeb7a('0x29')](function(){return db['UserVoiceQueueRt'][_0xeb7a('0x38')]({'where':{'VoiceQueueId':_0xa192bb[_0xeb7a('0x60')]['id'],'UserId':_0x1e7792},'transaction':_0xf4e8e4});});}})[_0xeb7a('0x29')](function(){_0x1e7792['forEach'](function(_0x27ffd5){socket[_0xeb7a('0x84')](_0xeb7a('0x96'),{'UserId':_0x27ffd5,'VoiceQueueId':_0x49809c['id']});});});});});});})[_0xeb7a('0x29')](respondWithStatusCode(_0x6f42e8,null))['catch'](handleError(_0x6f42e8,null));};exports[_0xeb7a('0x97')]=function(_0x1b2b95,_0x2093df,_0x252109){var _0x1d6049,_0x5dba4e;return db[_0xeb7a('0x3d')][_0xeb7a('0x35')]({'where':{'id':_0x1b2b95['params']['id']}})[_0xeb7a('0x29')](handleEntityNotFound(_0x2093df,null))[_0xeb7a('0x29')](function(_0x38c98f){if(_0x38c98f){_0x5dba4e=_0x38c98f;return _0x38c98f[_0xeb7a('0x97')](_0x1b2b95['body'][_0xeb7a('0x95')],_[_0xeb7a('0x61')](_0x1b2b95[_0xeb7a('0x59')],[_0xeb7a('0x95'),'id'])||{})['spread'](function(_0x891f5d){for(var _0x5299ab=0x0;_0x5299ab<_0x1b2b95[_0xeb7a('0x59')][_0xeb7a('0x95')]['length'];_0x5299ab+=0x1){socket[_0xeb7a('0x84')](_0xeb7a('0x85'),{'UserId':Number(_0x1b2b95[_0xeb7a('0x59')]['ids'][_0x5299ab]),'VoiceQueueId':Number(_0x1b2b95[_0xeb7a('0x60')]['id'])});}return _0x891f5d;});}})['then'](function(_0x2bfc2f){_0x1d6049=_0x2bfc2f||[];if(_0x5dba4e){return db['User']['findAll']({'where':{'id':_0x1b2b95[_0xeb7a('0x59')]['ids']},'attributes':['id',_0xeb7a('0x36'),_0xeb7a('0x74'),_0xeb7a('0x75'),_0xeb7a('0x76')],'raw':!![]});}})['then'](function(_0x353978){if(!_[_0xeb7a('0x98')](_0x353978)){var _0xba0723=[];for(var _0x5273d1=0x0;_0x5273d1<_0x353978[_0xeb7a('0x46')];_0x5273d1++){if(_0x353978[_0x5273d1][_0xeb7a('0x74')]){_0xba0723[_0xeb7a('0x8d')](db[_0xeb7a('0x81')][_0xeb7a('0x7f')]({'membername':_0x353978[_0x5273d1][_0xeb7a('0x36')],'UserId':_0x353978[_0x5273d1]['id'],'queue_name':_0x5dba4e[_0xeb7a('0x36')],'VoiceQueueId':_0x5dba4e['id'],'interface':_[_0xeb7a('0x82')](_0x353978[_0x5273d1][_0xeb7a('0x76')])?util[_0xeb7a('0x83')](_0xeb7a('0x99'),_0x353978[_0x5273d1]['name']):_0x353978[_0x5273d1][_0xeb7a('0x76')],'paused':_0x353978[_0x5273d1][_0xeb7a('0x75')]||![],'penalty':_0x1b2b95[_0xeb7a('0x59')][_0xeb7a('0x79')]||0x0}));}}return BPromise[_0xeb7a('0x92')](_0xba0723);}})[_0xeb7a('0x29')](function(){return _0x1d6049;})[_0xeb7a('0x29')](respondWithResult(_0x2093df,null))[_0xeb7a('0x53')](handleError(_0x2093df,null));};exports[_0xeb7a('0x9a')]=function(_0x463abe,_0x237b7b,_0x394571){return db['VoiceQueue']['find']({'where':{'id':_0x463abe['params']['id']}})[_0xeb7a('0x29')](handleEntityNotFound(_0x237b7b,null))[_0xeb7a('0x29')](function(_0x3abde1){if(_0x3abde1){return _0x3abde1[_0xeb7a('0x9a')](_0x463abe[_0xeb7a('0x41')][_0xeb7a('0x95')])[_0xeb7a('0x29')](function(){if(_[_0xeb7a('0x9b')](_0x463abe[_0xeb7a('0x41')][_0xeb7a('0x95')])){for(var _0xc03f35=0x0;_0xc03f35<_0x463abe[_0xeb7a('0x41')][_0xeb7a('0x95')]['length'];_0xc03f35+=0x1){socket['emit'](_0xeb7a('0x96'),{'UserId':Number(_0x463abe[_0xeb7a('0x41')][_0xeb7a('0x95')][_0xc03f35]),'VoiceQueueId':Number(_0x463abe[_0xeb7a('0x60')]['id'])});}}else{socket[_0xeb7a('0x84')]('userVoiceQueue:remove',{'UserId':Number(_0x463abe['query'][_0xeb7a('0x95')]),'VoiceQueueId':Number(_0x463abe[_0xeb7a('0x60')]['id'])});}});}})[_0xeb7a('0x29')](function(_0x5d1dbb){return db[_0xeb7a('0x81')][_0xeb7a('0x38')]({'where':{'VoiceQueueId':_0x463abe[_0xeb7a('0x60')]['id'],'UserId':_0x463abe[_0xeb7a('0x41')]['ids']}})[_0xeb7a('0x29')](function(){return _0x5d1dbb;});})['then'](respondWithStatusCode(_0x237b7b,null))[_0xeb7a('0x53')](handleError(_0x237b7b,null));};exports[_0xeb7a('0x9c')]=function(_0x585649,_0x1c6d4,_0x460d9d){var _0x94f793={};var _0x410282={};var _0xe31b27;var _0x5e0546;return db['VoiceQueue'][_0xeb7a('0x66')]({'where':{'id':_0x585649[_0xeb7a('0x60')]['id']}})[_0xeb7a('0x29')](handleEntityNotFound(_0x1c6d4,null))['then'](function(_0xdc4801){if(_0xdc4801){_0xe31b27=_0xdc4801;_0x410282[_0xeb7a('0x40')]=_[_0xeb7a('0x55')](db[_0xeb7a('0x72')]['rawAttributes']);_0x410282['query']=_[_0xeb7a('0x55')](_0x585649[_0xeb7a('0x41')]);_0x410282['filters']=_['intersection'](_0x410282[_0xeb7a('0x40')],_0x410282[_0xeb7a('0x41')]);_0x94f793[_0xeb7a('0x43')]=_[_0xeb7a('0x44')](_0x410282[_0xeb7a('0x40')],qs[_0xeb7a('0x45')](_0x585649[_0xeb7a('0x41')][_0xeb7a('0x45')]));_0x94f793[_0xeb7a('0x43')]=_0x94f793['attributes']['length']?_0x94f793[_0xeb7a('0x43')]:_0x410282[_0xeb7a('0x40')];_0x94f793['order']=qs[_0xeb7a('0x4b')](_0x585649['query']['sort']);_0x94f793['where']=qs[_0xeb7a('0x42')](_['pick'](_0x585649[_0xeb7a('0x41')],_0x410282[_0xeb7a('0x42')]));if(_0x585649[_0xeb7a('0x41')]['filter']){_0x94f793[_0xeb7a('0x4c')]=_[_0xeb7a('0x4e')](_0x94f793[_0xeb7a('0x4c')],{'$or':_['map'](_0x94f793[_0xeb7a('0x43')],function(_0x5e4d31){var _0x26728b={};_0x26728b[_0x5e4d31]={'$like':'%'+_0x585649[_0xeb7a('0x41')][_0xeb7a('0x2f')]+'%'};return _0x26728b;})});}_0x94f793=_[_0xeb7a('0x4e')]({},_0x94f793,_0x585649[_0xeb7a('0x57')]);return _0xe31b27[_0xeb7a('0x9c')](_0x94f793);}})[_0xeb7a('0x29')](function(_0x167381){if(_0x167381){_0x5e0546=_0x167381[_0xeb7a('0x46')];if(!_0x585649[_0xeb7a('0x41')][_0xeb7a('0x47')](_0xeb7a('0x48'))){_0x94f793['limit']=qs[_0xeb7a('0x49')](_0x585649[_0xeb7a('0x41')][_0xeb7a('0x49')]);_0x94f793['offset']=qs[_0xeb7a('0x22')](_0x585649['query']['offset']);}return _0xe31b27[_0xeb7a('0x9c')](_0x94f793);}})[_0xeb7a('0x29')](function(_0x4e2fb5){if(_0x4e2fb5){return _0x4e2fb5?{'count':_0x5e0546,'rows':_0x4e2fb5}:null;}})[_0xeb7a('0x29')](respondWithResult(_0x1c6d4,null))[_0xeb7a('0x53')](handleError(_0x1c6d4,null));};exports[_0xeb7a('0x9d')]=function(_0x5e6ca2,_0x11f5c1,_0x423182){var _0x4902d9={};var _0x355865={};var _0x247b15;var _0x48a603;return db['VoiceQueue'][_0xeb7a('0x66')]({'where':{'id':_0x5e6ca2[_0xeb7a('0x60')]['id']}})[_0xeb7a('0x29')](handleEntityNotFound(_0x11f5c1,null))[_0xeb7a('0x29')](function(_0x3df324){if(_0x3df324){_0x247b15=_0x3df324;_0x355865[_0xeb7a('0x40')]=_[_0xeb7a('0x55')](db[_0xeb7a('0x81')][_0xeb7a('0x56')]);_0x355865[_0xeb7a('0x41')]=_['keys'](_0x5e6ca2['query']);_0x355865[_0xeb7a('0x42')]=_[_0xeb7a('0x44')](_0x355865[_0xeb7a('0x40')],_0x355865[_0xeb7a('0x41')]);_0x4902d9[_0xeb7a('0x43')]=_[_0xeb7a('0x44')](_0x355865[_0xeb7a('0x40')],qs[_0xeb7a('0x45')](_0x5e6ca2[_0xeb7a('0x41')][_0xeb7a('0x45')]));_0x4902d9['attributes']=_0x4902d9['attributes'][_0xeb7a('0x46')]?_0x4902d9[_0xeb7a('0x43')]:_0x355865[_0xeb7a('0x40')];_0x4902d9[_0xeb7a('0x4a')]=qs[_0xeb7a('0x4b')](_0x5e6ca2[_0xeb7a('0x41')][_0xeb7a('0x4b')]);_0x4902d9[_0xeb7a('0x4c')]=qs[_0xeb7a('0x42')](_[_0xeb7a('0x4d')](_0x5e6ca2[_0xeb7a('0x41')],_0x355865['filters']));if(_0x5e6ca2[_0xeb7a('0x41')][_0xeb7a('0x2f')]){_0x4902d9[_0xeb7a('0x4c')]=_[_0xeb7a('0x4e')](_0x4902d9[_0xeb7a('0x4c')],{'$or':_[_0xeb7a('0x31')](_0x4902d9['attributes'],function(_0x4cc536){var _0x446279={};_0x446279[_0x4cc536]={'$like':'%'+_0x5e6ca2[_0xeb7a('0x41')][_0xeb7a('0x2f')]+'%'};return _0x446279;})});}_0x4902d9=_[_0xeb7a('0x4e')]({},_0x4902d9,_0x5e6ca2['options']);return _0x247b15['getMembers'](_0x4902d9);}})[_0xeb7a('0x29')](function(_0xdb267){if(_0xdb267){_0x48a603=_0xdb267[_0xeb7a('0x46')];if(!_0x5e6ca2[_0xeb7a('0x41')]['hasOwnProperty']('nolimit')){_0x4902d9[_0xeb7a('0x49')]=qs[_0xeb7a('0x49')](_0x5e6ca2[_0xeb7a('0x41')]['limit']);_0x4902d9['offset']=qs['offset'](_0x5e6ca2[_0xeb7a('0x41')]['offset']);}return _0x247b15['getMembers'](_0x4902d9);}})['then'](function(_0x2f4b58){return _0x2f4b58?{'count':_0x48a603,'rows':_0x2f4b58}:null;})[_0xeb7a('0x29')](respondWithResult(_0x11f5c1,null))[_0xeb7a('0x53')](handleError(_0x11f5c1,null));};exports['getLists']=function(_0x4c624c,_0x1d1394,_0x8fb924){var _0x2be45f={};var _0x71f4f9={};var _0x364cd7;var _0x337cf7;return db['VoiceQueue'][_0xeb7a('0x66')]({'where':{'id':_0x4c624c['params']['id']}})[_0xeb7a('0x29')](handleEntityNotFound(_0x1d1394,null))[_0xeb7a('0x29')](function(_0x21f141){if(_0x21f141){_0x364cd7=_0x21f141;_0x71f4f9[_0xeb7a('0x40')]=_[_0xeb7a('0x55')](db[_0xeb7a('0x9e')][_0xeb7a('0x56')]);_0x71f4f9[_0xeb7a('0x41')]=_[_0xeb7a('0x55')](_0x4c624c[_0xeb7a('0x41')]);_0x71f4f9[_0xeb7a('0x42')]=_[_0xeb7a('0x44')](_0x71f4f9[_0xeb7a('0x40')],_0x71f4f9[_0xeb7a('0x41')]);_0x2be45f[_0xeb7a('0x43')]=_[_0xeb7a('0x44')](_0x71f4f9[_0xeb7a('0x40')],qs[_0xeb7a('0x45')](_0x4c624c[_0xeb7a('0x41')]['fields']));_0x2be45f[_0xeb7a('0x43')]=_0x2be45f['attributes'][_0xeb7a('0x46')]?_0x2be45f[_0xeb7a('0x43')]:_0x71f4f9[_0xeb7a('0x40')];_0x2be45f[_0xeb7a('0x4a')]=qs['sort'](_0x4c624c[_0xeb7a('0x41')][_0xeb7a('0x4b')]);_0x2be45f['where']=qs[_0xeb7a('0x42')](_[_0xeb7a('0x4d')](_0x4c624c[_0xeb7a('0x41')],_0x71f4f9['filters']));if(_0x4c624c[_0xeb7a('0x41')][_0xeb7a('0x2f')]){_0x2be45f[_0xeb7a('0x4c')]=_[_0xeb7a('0x4e')](_0x2be45f[_0xeb7a('0x4c')],{'$or':_['map'](_0x2be45f['attributes'],function(_0x1d1602){var _0x5405e2={};_0x5405e2[_0x1d1602]={'$like':'%'+_0x4c624c[_0xeb7a('0x41')]['filter']+'%'};return _0x5405e2;})});}_0x2be45f=_[_0xeb7a('0x4e')]({},_0x2be45f,_0x4c624c[_0xeb7a('0x57')]);return _0x364cd7[_0xeb7a('0x9f')](_0x2be45f);}})['then'](function(_0x46584f){if(_0x46584f){_0x337cf7=_0x46584f['length'];if(!_0x4c624c[_0xeb7a('0x41')][_0xeb7a('0x47')](_0xeb7a('0x48'))){_0x2be45f['limit']=qs[_0xeb7a('0x49')](_0x4c624c['query']['limit']);_0x2be45f['offset']=qs[_0xeb7a('0x22')](_0x4c624c[_0xeb7a('0x41')]['offset']);}return _0x364cd7['getLists'](_0x2be45f);}})['then'](function(_0x3a47c6){if(_0x3a47c6){return _0x3a47c6?{'count':_0x337cf7,'rows':_0x3a47c6}:null;}})[_0xeb7a('0x29')](respondWithResult(_0x1d1394,null))[_0xeb7a('0x53')](handleError(_0x1d1394,null));};exports['addLists']=function(_0xa4a032,_0x1d45d8,_0x5a3737){var _0xccb96=moment()['format'](_0xeb7a('0xa0'));var _0x320c86,_0x150a3c;return db[_0xeb7a('0x3d')][_0xeb7a('0x35')]({'where':{'id':_0xa4a032[_0xeb7a('0x60')]['id']}})[_0xeb7a('0x29')](handleEntityNotFound(_0x1d45d8,null))['then'](function(_0x265321){if(_0x265321){_0x150a3c=_0x265321;return _0x265321['addLists'](_0xa4a032[_0xeb7a('0x59')]['ids'],_[_0xeb7a('0x61')](_0xa4a032['body'],['ids','id'])||{});}return null;})[_0xeb7a('0xa1')](function(_0x4fe161){var _0x1e4fc3;_0x320c86=_0x4fe161||[];var _0x13a202=[];if(_0x4fe161){for(var _0x1e2856=0x0;_0x1e2856<_0x4fe161['length'];_0x1e2856+=0x1){var _0x5358be=_0x4fe161[_0x1e2856][_0xeb7a('0x2a')]({'plain':!![]});_0x150a3c[_0xeb7a('0xa2')]=_0xa4a032[_0xeb7a('0x59')][_0xeb7a('0xa2')]?_0xa4a032[_0xeb7a('0x59')]['dialCheckDuplicateType']:_0x150a3c['dialCheckDuplicateType'];switch(_0x150a3c[_0xeb7a('0xa2')]){case _0xeb7a('0xa3'):_0x1e4fc3=squel[_0xeb7a('0xa4')]()[_0xeb7a('0xa5')]('cm_hopper')[_0xeb7a('0xa6')]([_0xeb7a('0xa7'),'scheduledAt',_0xeb7a('0xa8'),_0xeb7a('0xa9'),_0xeb7a('0x68'),_0xeb7a('0x62'),_0xeb7a('0x63')],squel[_0xeb7a('0xaa')]()[_0xeb7a('0x87')](_0xeb7a('0xa7'),_0xeb7a('0xa7'))[_0xeb7a('0x87')]('\x27'+_0xccb96+'\x27',_0xeb7a('0xab'))[_0xeb7a('0x87')]('id',_0xeb7a('0xa8'))[_0xeb7a('0x87')](_0x5358be[_0xeb7a('0xac')][_0xeb7a('0x8e')](),_0xeb7a('0xa9'))['field'](_0xa4a032['params']['id']['toString'](),_0xeb7a('0x68'))[_0xeb7a('0x87')]('\x27'+_0xccb96+'\x27','createdAt')['field']('\x27'+_0xccb96+'\x27',_0xeb7a('0x63'))[_0xeb7a('0x88')](_0xeb7a('0xad'))[_0xeb7a('0x4c')]('deletedAt\x20IS\x20NULL')[_0xeb7a('0x4c')](_0xeb7a('0xae'),_0x5358be[_0xeb7a('0xac')][_0xeb7a('0x8e')]())[_0xeb7a('0x4c')]('phone\x20IS\x20NOT\x20NULL')[_0xeb7a('0x4c')](_0xeb7a('0xaf'),squel[_0xeb7a('0xaa')]()[_0xeb7a('0x87')](_0xeb7a('0xb0'))[_0xeb7a('0x88')](_0xeb7a('0xb1'))[_0xeb7a('0x4c')](_0xeb7a('0x8b'),_0xa4a032[_0xeb7a('0x60')]['id'][_0xeb7a('0x8e')]()))[_0xeb7a('0x4c')](_0xeb7a('0xaf'),squel['select']()['field'](_0xeb7a('0xb2'))['from'](_0xeb7a('0xb3'))[_0xeb7a('0x4c')](_0xeb7a('0x8b'),_0xa4a032[_0xeb7a('0x60')]['id'][_0xeb7a('0x8e')]())))[_0xeb7a('0x8e')]();break;case'onlyIfOpen':_0x1e4fc3=squel[_0xeb7a('0xa4')]()[_0xeb7a('0xa5')](_0xeb7a('0xb3'))[_0xeb7a('0xa6')]([_0xeb7a('0xa7'),_0xeb7a('0xab'),'ContactId','ListId',_0xeb7a('0x68'),'createdAt',_0xeb7a('0x63')],squel[_0xeb7a('0xaa')]()['field'](_0xeb7a('0xa7'),_0xeb7a('0xa7'))['field']('\x27'+_0xccb96+'\x27',_0xeb7a('0xab'))[_0xeb7a('0x87')]('id',_0xeb7a('0xa8'))['field'](_0x5358be[_0xeb7a('0xac')][_0xeb7a('0x8e')](),_0xeb7a('0xa9'))['field'](_0xa4a032[_0xeb7a('0x60')]['id']['toString'](),'VoiceQueueId')['field']('\x27'+_0xccb96+'\x27','createdAt')[_0xeb7a('0x87')]('\x27'+_0xccb96+'\x27',_0xeb7a('0x63'))[_0xeb7a('0x88')](_0xeb7a('0xad'))[_0xeb7a('0x4c')](_0xeb7a('0xb4'))[_0xeb7a('0x4c')](_0xeb7a('0xae'),_0x5358be['CmListId'][_0xeb7a('0x8e')]())[_0xeb7a('0x4c')]('phone\x20IS\x20NOT\x20NULL')[_0xeb7a('0x4c')](_0xeb7a('0xaf'),squel[_0xeb7a('0xaa')]()[_0xeb7a('0x87')](_0xeb7a('0xb2'))[_0xeb7a('0x88')](_0xeb7a('0xb3'))[_0xeb7a('0x4c')](_0xeb7a('0x8b'),_0xa4a032[_0xeb7a('0x60')]['id']['toString']())))['toString']();break;default:_0x1e4fc3=squel[_0xeb7a('0xa4')]()[_0xeb7a('0xa5')](_0xeb7a('0xb3'))[_0xeb7a('0xa6')](['phone','scheduledAt',_0xeb7a('0xa8'),_0xeb7a('0xa9'),_0xeb7a('0x68'),'createdAt',_0xeb7a('0x63')],squel[_0xeb7a('0xaa')]()['field'](_0xeb7a('0xa7'),'phone')[_0xeb7a('0x87')]('\x27'+_0xccb96+'\x27',_0xeb7a('0xab'))[_0xeb7a('0x87')]('id',_0xeb7a('0xa8'))[_0xeb7a('0x87')](_0x5358be[_0xeb7a('0xac')][_0xeb7a('0x8e')](),_0xeb7a('0xa9'))[_0xeb7a('0x87')](_0xa4a032[_0xeb7a('0x60')]['id'][_0xeb7a('0x8e')](),'VoiceQueueId')[_0xeb7a('0x87')]('\x27'+_0xccb96+'\x27',_0xeb7a('0x62'))[_0xeb7a('0x87')]('\x27'+_0xccb96+'\x27',_0xeb7a('0x63'))[_0xeb7a('0x88')](_0xeb7a('0xad'))[_0xeb7a('0x4c')]('deletedAt\x20IS\x20NULL')[_0xeb7a('0x4c')](_0xeb7a('0xae'),_0x5358be[_0xeb7a('0xac')]['toString']())[_0xeb7a('0x4c')]('phone\x20IS\x20NOT\x20NULL'))[_0xeb7a('0x8e')]();}_0x13a202['push'](db[_0xeb7a('0x7a')][_0xeb7a('0x41')](_0x1e4fc3));}return BPromise[_0xeb7a('0x92')](_0x13a202);}})[_0xeb7a('0x29')](function(){var _0x76c59=[];var _0x50d8ee=squel['insert']()[_0xeb7a('0xa5')](_0xeb7a('0xb5'))[_0xeb7a('0xa6')]([_0xeb7a('0xb6'),'phone',_0xeb7a('0xb7'),_0xeb7a('0x62'),'updatedAt'],squel[_0xeb7a('0xaa')]()['field'](_0xeb7a('0xb8'))[_0xeb7a('0x87')](_0xeb7a('0xb9'))[_0xeb7a('0x87')](_0xeb7a('0xba'))[_0xeb7a('0x87')]('\x27'+_0xccb96+'\x27',_0xeb7a('0x62'))[_0xeb7a('0x87')]('\x27'+_0xccb96+'\x27','updatedAt')['from']('cm_contact_has_items','ci')[_0xeb7a('0xbb')](_0xeb7a('0xb3'),'h',_0xeb7a('0xbc'))[_0xeb7a('0x4c')]('h.scheduledat=?',_0xccb96)['where'](_0xeb7a('0xbd'),_0xeb7a('0xbe')))['toString']();_0x76c59['push'](db['sequelize'][_0xeb7a('0x41')](_0x50d8ee));return BPromise[_0xeb7a('0x92')](_0x76c59);})[_0xeb7a('0x29')](function(){return _0x320c86;})['then'](respondWithResult(_0x1d45d8,null))[_0xeb7a('0x53')](handleError(_0x1d45d8,null));};exports['removeLists']=function(_0x56f92d,_0x483235,_0x2533d4){return db[_0xeb7a('0x3d')][_0xeb7a('0x35')]({'where':{'id':_0x56f92d['params']['id']}})[_0xeb7a('0x29')](handleEntityNotFound(_0x483235,null))[_0xeb7a('0x29')](function(_0x295f3a){if(_0x295f3a){return _0x295f3a[_0xeb7a('0xbf')](_0x56f92d['query']['ids']);}})['then'](function(_0x566ef2){if(_0x566ef2){return db['CmHopper'][_0xeb7a('0x38')]({'where':{'ListId':_0x56f92d[_0xeb7a('0x41')][_0xeb7a('0x95')],'VoiceQueueId':_0x56f92d[_0xeb7a('0x60')]['id']}})[_0xeb7a('0x29')](function(){return _0x566ef2;});}})[_0xeb7a('0x29')](respondWithStatusCode(_0x483235,null))[_0xeb7a('0x53')](handleError(_0x483235,null));};exports[_0xeb7a('0xc0')]=function(_0x489337,_0x25c775,_0x1b5bc2){var _0x35ab0c={};var _0xfe5552={};var _0xc2e14f;var _0x30689b;return db['VoiceQueue']['findOne']({'where':{'id':_0x489337[_0xeb7a('0x60')]['id']}})[_0xeb7a('0x29')](handleEntityNotFound(_0x25c775,null))[_0xeb7a('0x29')](function(_0x2f3400){if(_0x2f3400){_0xc2e14f=_0x2f3400;_0xfe5552['model']=_[_0xeb7a('0x55')](db[_0xeb7a('0x9e')][_0xeb7a('0x56')]);_0xfe5552[_0xeb7a('0x41')]=_['keys'](_0x489337[_0xeb7a('0x41')]);_0xfe5552[_0xeb7a('0x42')]=_[_0xeb7a('0x44')](_0xfe5552['model'],_0xfe5552[_0xeb7a('0x41')]);_0x35ab0c['attributes']=_[_0xeb7a('0x44')](_0xfe5552['model'],qs[_0xeb7a('0x45')](_0x489337[_0xeb7a('0x41')][_0xeb7a('0x45')]));_0x35ab0c[_0xeb7a('0x43')]=_0x35ab0c[_0xeb7a('0x43')][_0xeb7a('0x46')]?_0x35ab0c[_0xeb7a('0x43')]:_0xfe5552[_0xeb7a('0x40')];_0x35ab0c[_0xeb7a('0x4a')]=qs[_0xeb7a('0x4b')](_0x489337['query'][_0xeb7a('0x4b')]);_0x35ab0c[_0xeb7a('0x4c')]=qs[_0xeb7a('0x42')](_[_0xeb7a('0x4d')](_0x489337[_0xeb7a('0x41')],_0xfe5552[_0xeb7a('0x42')]));if(_0x489337[_0xeb7a('0x41')]['filter']){_0x35ab0c[_0xeb7a('0x4c')]=_[_0xeb7a('0x4e')](_0x35ab0c[_0xeb7a('0x4c')],{'$or':_[_0xeb7a('0x31')](_0x35ab0c[_0xeb7a('0x43')],function(_0x4569b3){var _0x4d841a={};_0x4d841a[_0x4569b3]={'$like':'%'+_0x489337[_0xeb7a('0x41')][_0xeb7a('0x2f')]+'%'};return _0x4d841a;})});}_0x35ab0c=_[_0xeb7a('0x4e')]({},_0x35ab0c,_0x489337[_0xeb7a('0x57')]);return _0xc2e14f[_0xeb7a('0xc0')](_0x35ab0c);}})[_0xeb7a('0x29')](function(_0x1f2380){if(_0x1f2380){_0x30689b=_0x1f2380[_0xeb7a('0x46')];if(!_0x489337[_0xeb7a('0x41')][_0xeb7a('0x47')](_0xeb7a('0x48'))){_0x35ab0c[_0xeb7a('0x49')]=qs[_0xeb7a('0x49')](_0x489337[_0xeb7a('0x41')][_0xeb7a('0x49')]);_0x35ab0c['offset']=qs[_0xeb7a('0x22')](_0x489337[_0xeb7a('0x41')]['offset']);}return _0xc2e14f[_0xeb7a('0xc0')](_0x35ab0c);}})[_0xeb7a('0x29')](function(_0xb490b4){if(_0xb490b4){return _0xb490b4?{'count':_0x30689b,'rows':_0xb490b4}:null;}})[_0xeb7a('0x29')](respondWithResult(_0x25c775,null))[_0xeb7a('0x53')](handleError(_0x25c775,null));};exports[_0xeb7a('0xc1')]=function(_0x3e00bd,_0x149b8b,_0x5e764a){var _0x3eb2f3,_0x251d42;return db['VoiceQueue'][_0xeb7a('0x35')]({'where':{'id':_0x3e00bd['params']['id']}})[_0xeb7a('0x29')](handleEntityNotFound(_0x149b8b,null))['then'](function(_0x366e79){if(_0x366e79){_0x251d42=_0x366e79;return _0x366e79['addBlackLists'](_0x3e00bd[_0xeb7a('0x59')][_0xeb7a('0x95')],_[_0xeb7a('0x61')](_0x3e00bd[_0xeb7a('0x59')],[_0xeb7a('0x95'),'id'])||{});}return null;})['spread'](function(_0x1d9979){var _0x2631a0;_0x3eb2f3=_0x1d9979||[];var _0x2a41ea=[];if(_0x1d9979){for(var _0x4b5197=0x0;_0x4b5197<_0x1d9979[_0xeb7a('0x46')];_0x4b5197+=0x1){var _0x588d2f=_0x1d9979[_0x4b5197]['get']({'plain':!![]});_0x2631a0=squel[_0xeb7a('0xa4')]()[_0xeb7a('0xa5')](_0xeb7a('0xc2'))[_0xeb7a('0xa6')]([_0xeb7a('0xa7'),'ContactId',_0xeb7a('0xa9'),_0xeb7a('0x68'),'createdAt','updatedAt'],squel[_0xeb7a('0xaa')]()[_0xeb7a('0x87')](_0xeb7a('0xa7'),_0xeb7a('0xa7'))['field']('id','ContactId')['field'](_0x588d2f[_0xeb7a('0xac')][_0xeb7a('0x8e')](),_0xeb7a('0xa9'))[_0xeb7a('0x87')](_0x3e00bd[_0xeb7a('0x60')]['id'][_0xeb7a('0x8e')](),_0xeb7a('0x68'))['field'](_0xeb7a('0xc3'),_0xeb7a('0x62'))[_0xeb7a('0x87')](_0xeb7a('0xc3'),_0xeb7a('0x63'))[_0xeb7a('0x88')](_0xeb7a('0xad'))[_0xeb7a('0x4c')](_0xeb7a('0xb4'))[_0xeb7a('0x4c')](_0xeb7a('0xae'),_0x588d2f['CmListId'][_0xeb7a('0x8e')]())[_0xeb7a('0x4c')](_0xeb7a('0xc4')))[_0xeb7a('0x8e')]();_0x2a41ea['push'](db[_0xeb7a('0x7a')][_0xeb7a('0x41')](_0x2631a0));}return BPromise['all'](_0x2a41ea);}})[_0xeb7a('0x29')](function(){return _0x3eb2f3;})['then'](respondWithResult(_0x149b8b,null))[_0xeb7a('0x53')](handleError(_0x149b8b,null));};exports['removeBlackLists']=function(_0x2a303c,_0x2333df,_0x5afa69){return db[_0xeb7a('0x3d')][_0xeb7a('0x35')]({'where':{'id':_0x2a303c['params']['id']}})['then'](handleEntityNotFound(_0x2333df,null))[_0xeb7a('0x29')](function(_0xe61fd){if(_0xe61fd){return _0xe61fd[_0xeb7a('0xc5')](_0x2a303c[_0xeb7a('0x41')][_0xeb7a('0x95')]);}})[_0xeb7a('0x29')](function(_0x543a87){if(_0x543a87){return db[_0xeb7a('0x6e')][_0xeb7a('0x38')]({'where':{'ListId':_0x2a303c[_0xeb7a('0x41')][_0xeb7a('0x95')],'VoiceQueueId':_0x2a303c['params']['id']}})['then'](function(){return _0x543a87;});}})[_0xeb7a('0x29')](respondWithStatusCode(_0x2333df,null))[_0xeb7a('0x53')](handleError(_0x2333df,null));};
\ No newline at end of file
+var _0x6c99=['get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','type','name','end','error','stack','send','rawAttributes','fieldName','key','model','map','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','VoiceQueue','includeAll','include','rows','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','getHoppers','findOne','CmHopper','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','order','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','penalty','sequelize','transaction','each','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','forEach','emit','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','clone','toString','QueryTypes','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','SIP/%s','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','cm_contacts','ListId\x20=\x20?','cm_hopper_final','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','into','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','push','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','zip-dir','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','offset','limit','count','set','json','apply','reject','update','then','destroy'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x6c99,0x9b));var _0x96c9=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x6c99[_0x50aa2e];return _0x5e07f0;};'use strict';var emlformat=require(_0x96c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x96c9('0x1'));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(_0x96c9('0x2'));var path=require(_0x96c9('0x3'));var sox=require(_0x96c9('0x4'));var csv=require(_0x96c9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96c9('0x6'));var _=require(_0x96c9('0x7'));var squel=require(_0x96c9('0x8'));var crypto=require(_0x96c9('0x9'));var jsforce=require(_0x96c9('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x96c9('0xb'));var Papa=require('papaparse');var Redis=require(_0x96c9('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x96c9('0xd'));var as=require(_0x96c9('0xe'));var hardwareService=require(_0x96c9('0xf'));var logger=require(_0x96c9('0x10'))('api');var utils=require(_0x96c9('0x11'));var config=require(_0x96c9('0x12'));var licenseUtil=require(_0x96c9('0x13'));var db=require(_0x96c9('0x14'))['db'];config[_0x96c9('0x15')]=_['defaults'](config[_0x96c9('0x15')],{'host':_0x96c9('0x16'),'port':0x18eb});var socket=require(_0x96c9('0x17'))(new Redis(config[_0x96c9('0x15')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x3f1cf9,_0x277d6a){_0x277d6a=_0x277d6a||0xcc;return function(_0x19bb22){if(_0x19bb22){return _0x3f1cf9[_0x96c9('0x18')](_0x277d6a);}return _0x3f1cf9['status'](_0x277d6a)['end']();};}function respondWithResult(_0x5d18da,_0x3b5563){_0x3b5563=_0x3b5563||0xc8;return function(_0x508568){if(_0x508568){return _0x5d18da[_0x96c9('0x19')](_0x3b5563)['json'](_0x508568);}};}function respondWithFilteredResult(_0x1ceeb0,_0xcb0fa1){return function(_0x21a0d0){if(_0x21a0d0){var _0x3803e2=typeof _0xcb0fa1[_0x96c9('0x1a')]==='undefined'&&typeof _0xcb0fa1[_0x96c9('0x1b')]==='undefined';var _0x3dd3de=_0x21a0d0[_0x96c9('0x1c')];var _0x3fc317=_0x3803e2?0x0:_0xcb0fa1['offset'];var _0x53b71c=_0x3803e2?_0x21a0d0[_0x96c9('0x1c')]:_0xcb0fa1[_0x96c9('0x1a')]+_0xcb0fa1[_0x96c9('0x1b')];var _0x1bf748;if(_0x53b71c>=_0x3dd3de){_0x53b71c=_0x3dd3de;_0x1bf748=0xc8;}else{_0x1bf748=0xce;}_0x1ceeb0[_0x96c9('0x19')](_0x1bf748);return _0x1ceeb0[_0x96c9('0x1d')]('Content-Range',_0x3fc317+'-'+_0x53b71c+'/'+_0x3dd3de)[_0x96c9('0x1e')](_0x21a0d0);}return null;};}function patchUpdates(_0x3a7fc5){return function(_0x4d2565){try{jsonpatch[_0x96c9('0x1f')](_0x4d2565,_0x3a7fc5,!![]);}catch(_0x2a7ae1){return BPromise[_0x96c9('0x20')](_0x2a7ae1);}return _0x4d2565['save']();};}function saveUpdates(_0x13e642,_0xad7d12){return function(_0x252725){if(_0x252725){return _0x252725[_0x96c9('0x21')](_0x13e642)[_0x96c9('0x22')](function(_0x2b7ad3){return _0x2b7ad3;});}return null;};}function removeEntity(_0x62b05e,_0x5c7252){return function(_0x500364){if(_0x500364){return _0x500364[_0x96c9('0x23')]()[_0x96c9('0x22')](function(){var _0x3b8b0f=_0x500364[_0x96c9('0x24')]({'plain':!![]});var _0x20787d=[{'name':_0x96c9('0x25'),'value':_0x96c9('0x26'),'ignore':![]},{'name':_0x96c9('0x27'),'value':_0x96c9('0x28'),'ignore':![]}];var _0x2ba06e=_(_0x20787d)[_0x96c9('0x29')](_0x96c9('0x2a'))['map'](_0x96c9('0x2b'))[_0x96c9('0x2b')]();if(_['includes'](_0x2ba06e,_0x3b8b0f[_0x96c9('0x2c')])){return;}var _0x53c1ea=_['find'](_0x20787d,[_0x96c9('0x2b'),_0x3b8b0f[_0x96c9('0x2c')]])[_0x96c9('0x2d')];return db['UserProfileResource']['destroy']({'where':{'type':_0x53c1ea,'resourceId':_0x3b8b0f['id']}})[_0x96c9('0x22')](function(){return _0x500364;});})[_0x96c9('0x22')](function(){_0x62b05e[_0x96c9('0x19')](0xcc)[_0x96c9('0x2e')]();});}};}function handleEntityNotFound(_0x39439d,_0x156826){return function(_0x49a4c8){if(!_0x49a4c8){_0x39439d['sendStatus'](0x194);}return _0x49a4c8;};}function handleError(_0xdbcd70,_0xb24909){_0xb24909=_0xb24909||0x1f4;return function(_0x59d909){logger[_0x96c9('0x2f')](_0x59d909[_0x96c9('0x30')]);if(_0x59d909[_0x96c9('0x2d')]){delete _0x59d909[_0x96c9('0x2d')];}_0xdbcd70[_0x96c9('0x19')](_0xb24909)[_0x96c9('0x31')](_0x59d909);};}exports['index']=function(_0x3ab931,_0x13658e){var _0x18632e={},_0x3ab7ce={},_0x5f2e94={'count':0x0,'rows':[]};var _0x12c32c=_['map'](db['VoiceQueue'][_0x96c9('0x32')],function(_0x5bb95d){return{'name':_0x5bb95d[_0x96c9('0x33')],'type':_0x5bb95d['type'][_0x96c9('0x34')]};});_0x3ab7ce[_0x96c9('0x35')]=_[_0x96c9('0x36')](_0x12c32c,'name');_0x3ab7ce['query']=_[_0x96c9('0x37')](_0x3ab931['query']);_0x3ab7ce[_0x96c9('0x38')]=_['intersection'](_0x3ab7ce[_0x96c9('0x35')],_0x3ab7ce[_0x96c9('0x39')]);_0x18632e[_0x96c9('0x3a')]=_[_0x96c9('0x3b')](_0x3ab7ce['model'],qs[_0x96c9('0x3c')](_0x3ab931[_0x96c9('0x39')][_0x96c9('0x3c')]));_0x18632e[_0x96c9('0x3a')]=_0x18632e[_0x96c9('0x3a')][_0x96c9('0x3d')]?_0x18632e[_0x96c9('0x3a')]:_0x3ab7ce[_0x96c9('0x35')];if(!_0x3ab931[_0x96c9('0x39')][_0x96c9('0x3e')](_0x96c9('0x3f'))){_0x18632e[_0x96c9('0x1b')]=qs['limit'](_0x3ab931['query'][_0x96c9('0x1b')]);_0x18632e[_0x96c9('0x1a')]=qs['offset'](_0x3ab931[_0x96c9('0x39')][_0x96c9('0x1a')]);}_0x18632e['order']=qs[_0x96c9('0x40')](_0x3ab931[_0x96c9('0x39')][_0x96c9('0x40')]);_0x18632e[_0x96c9('0x41')]=qs[_0x96c9('0x38')](_[_0x96c9('0x42')](_0x3ab931[_0x96c9('0x39')],_0x3ab7ce['filters']),_0x12c32c);if(_0x3ab931[_0x96c9('0x39')][_0x96c9('0x29')]){_0x18632e[_0x96c9('0x41')]=_[_0x96c9('0x43')](_0x18632e['where'],{'$or':_[_0x96c9('0x36')](_0x12c32c,function(_0x5ae699){if(_0x5ae699[_0x96c9('0x2c')]!==_0x96c9('0x44')){var _0x59a62f={};_0x59a62f[_0x5ae699[_0x96c9('0x2d')]]={'$like':'%'+_0x3ab931[_0x96c9('0x39')][_0x96c9('0x29')]+'%'};return _0x59a62f;}})});}_0x18632e=_[_0x96c9('0x43')]({},_0x18632e,_0x3ab931[_0x96c9('0x45')]);var _0x163e34={'where':_0x18632e[_0x96c9('0x41')]};return db[_0x96c9('0x46')][_0x96c9('0x1c')](_0x163e34)['then'](function(_0x560cf3){_0x5f2e94[_0x96c9('0x1c')]=_0x560cf3;if(_0x3ab931[_0x96c9('0x39')][_0x96c9('0x47')]){_0x18632e[_0x96c9('0x48')]=[{'all':!![]}];}return db[_0x96c9('0x46')]['findAll'](_0x18632e);})[_0x96c9('0x22')](function(_0x42590f){_0x5f2e94[_0x96c9('0x49')]=_0x42590f;return _0x5f2e94;})[_0x96c9('0x22')](respondWithFilteredResult(_0x13658e,_0x18632e))['catch'](handleError(_0x13658e,null));};exports['show']=function(_0x11225e,_0x39f3c6){var _0xeb31cb={'raw':![],'where':{'id':_0x11225e[_0x96c9('0x4a')]['id']}},_0x509881={};_0x509881['model']=_[_0x96c9('0x37')](db[_0x96c9('0x46')]['rawAttributes']);_0x509881[_0x96c9('0x39')]=_[_0x96c9('0x37')](_0x11225e['query']);_0x509881[_0x96c9('0x38')]=_[_0x96c9('0x3b')](_0x509881[_0x96c9('0x35')],_0x509881[_0x96c9('0x39')]);_0xeb31cb[_0x96c9('0x3a')]=_[_0x96c9('0x3b')](_0x509881[_0x96c9('0x35')],qs[_0x96c9('0x3c')](_0x11225e[_0x96c9('0x39')][_0x96c9('0x3c')]));_0xeb31cb['attributes']=_0xeb31cb[_0x96c9('0x3a')]['length']?_0xeb31cb[_0x96c9('0x3a')]:_0x509881[_0x96c9('0x35')];if(_0x11225e[_0x96c9('0x39')]['includeAll']){_0xeb31cb[_0x96c9('0x48')]=[{'all':!![]}];}_0xeb31cb=_[_0x96c9('0x43')]({},_0xeb31cb,_0x11225e[_0x96c9('0x45')]);return db['VoiceQueue'][_0x96c9('0x4b')](_0xeb31cb)[_0x96c9('0x22')](handleEntityNotFound(_0x39f3c6,null))[_0x96c9('0x22')](respondWithResult(_0x39f3c6,null))['catch'](handleError(_0x39f3c6,null));};exports['create']=function(_0x407e2f,_0x3a472d){return db[_0x96c9('0x46')][_0x96c9('0x4c')](_0x407e2f[_0x96c9('0x4d')],{})['then'](function(_0x189332){var _0x56a271=_0x407e2f[_0x96c9('0x4e')][_0x96c9('0x24')]({'plain':!![]});if(!_0x56a271)throw new Error(_0x96c9('0x4f'));if(_0x56a271[_0x96c9('0x50')]===_0x96c9('0x4e')){var _0x20353a=_0x189332[_0x96c9('0x24')]({'plain':!![]});var _0x1f809b=[{'name':_0x96c9('0x25'),'value':_0x96c9('0x26')},{'name':'QueueCampaigns','value':'outbound'}];var _0x4a6a68=_[_0x96c9('0x4b')](_0x1f809b,[_0x96c9('0x2b'),_0x20353a[_0x96c9('0x2c')]])[_0x96c9('0x2d')];return db[_0x96c9('0x51')][_0x96c9('0x4b')]({'where':{'name':_0x4a6a68,'userProfileId':_0x56a271[_0x96c9('0x52')]},'raw':!![]})[_0x96c9('0x22')](function(_0x4dccae){if(_0x4dccae&&_0x4dccae[_0x96c9('0x53')]===0x0){return db[_0x96c9('0x54')][_0x96c9('0x4c')]({'name':_0x20353a[_0x96c9('0x2d')],'resourceId':_0x20353a['id'],'type':_0x4dccae[_0x96c9('0x2d')],'sectionId':_0x4dccae['id']},{})[_0x96c9('0x22')](function(){return _0x189332;});}else{return _0x189332;}})[_0x96c9('0x55')](function(_0x302815){logger[_0x96c9('0x2f')](_0x96c9('0x56'),_0x302815);throw _0x302815;});}return _0x189332;})[_0x96c9('0x22')](respondWithResult(_0x3a472d,0xc9))[_0x96c9('0x55')](handleError(_0x3a472d,null));};exports['clone']=function(_0x284ed7,_0x5cf4b9){var _0x903608={'where':{'id':_0x284ed7[_0x96c9('0x4a')]['id']}},_0x6c46f={};_0x6c46f[_0x96c9('0x35')]=_[_0x96c9('0x37')](db[_0x96c9('0x46')]['rawAttributes']);_0x903608['attributes']=_[_0x96c9('0x3b')](_0x6c46f[_0x96c9('0x35')],qs[_0x96c9('0x3c')](_0x284ed7[_0x96c9('0x39')][_0x96c9('0x3c')]));_0x903608[_0x96c9('0x3a')]=_0x903608['attributes'][_0x96c9('0x3d')]?_0x903608[_0x96c9('0x3a')]:_0x6c46f[_0x96c9('0x35')];if(_0x284ed7['query'][_0x96c9('0x47')]){_0x903608[_0x96c9('0x48')]=[{'all':!![]}];}_0x903608=_[_0x96c9('0x43')]({},_0x903608,_0x284ed7[_0x96c9('0x45')]);return db['VoiceQueue'][_0x96c9('0x4b')](_0x903608)[_0x96c9('0x22')](handleEntityNotFound(_0x5cf4b9,null))[_0x96c9('0x22')](function(_0x3aa6f8){if(_0x3aa6f8){var _0x268ea7=_0x3aa6f8[_0x96c9('0x24')]({'plain':!![]});_0x268ea7=qs['omit'](_0x268ea7,['id',_0x96c9('0x57'),_0x96c9('0x58')]);_0x284ed7['body']=_[_0x96c9('0x59')](_0x284ed7[_0x96c9('0x4d')],['id',_0x96c9('0x57'),'updatedAt']);return db[_0x96c9('0x46')]['create'](_[_0x96c9('0x43')](_0x268ea7,_0x284ed7[_0x96c9('0x4d')]),{'include':_0x284ed7[_0x96c9('0x39')]['includeAll']?[{'all':!![]}]:undefined})[_0x96c9('0x22')](function(_0x2a7ce6){var _0xb0699e=_0x284ed7[_0x96c9('0x4e')][_0x96c9('0x24')]({'plain':!![]});if(!_0xb0699e)throw new Error(_0x96c9('0x4f'));if(_0xb0699e[_0x96c9('0x50')]===_0x96c9('0x4e')){var _0x43bf54=_0x2a7ce6['get']({'plain':!![]});var _0x19b9c7=[{'name':'VoiceQueues','value':_0x96c9('0x26')},{'name':_0x96c9('0x27'),'value':_0x96c9('0x28')}];var _0x419610=_[_0x96c9('0x4b')](_0x19b9c7,[_0x96c9('0x2b'),_0x43bf54[_0x96c9('0x2c')]])['name'];return db[_0x96c9('0x51')][_0x96c9('0x4b')]({'where':{'name':_0x419610,'userProfileId':_0xb0699e[_0x96c9('0x52')]},'raw':!![]})['then'](function(_0x593206){if(_0x593206&&_0x593206[_0x96c9('0x53')]===0x0){return db[_0x96c9('0x54')][_0x96c9('0x4c')]({'name':_0x43bf54['name'],'resourceId':_0x43bf54['id'],'type':_0x593206[_0x96c9('0x2d')],'sectionId':_0x593206['id']},{})[_0x96c9('0x22')](function(){return _0x2a7ce6;});}else{return _0x2a7ce6;}})[_0x96c9('0x55')](function(_0x42dacb){logger[_0x96c9('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42dacb);throw _0x42dacb;});}return _0x2a7ce6;});}})['then'](respondWithResult(_0x5cf4b9,0xc9))[_0x96c9('0x55')](handleError(_0x5cf4b9,null));};exports[_0x96c9('0x21')]=function(_0x3959d6,_0x6401da){if(_0x3959d6[_0x96c9('0x4d')]['id']){delete _0x3959d6['body']['id'];}return db[_0x96c9('0x46')][_0x96c9('0x4b')]({'where':{'id':_0x3959d6['params']['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x6401da,null))[_0x96c9('0x22')](saveUpdates(_0x3959d6[_0x96c9('0x4d')],null))[_0x96c9('0x22')](respondWithResult(_0x6401da,null))[_0x96c9('0x55')](handleError(_0x6401da,null));};exports['destroy']=function(_0x41c1c4,_0x39859e){return db[_0x96c9('0x46')][_0x96c9('0x4b')]({'where':{'id':_0x41c1c4[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x39859e,null))[_0x96c9('0x22')](removeEntity(_0x39859e,null))[_0x96c9('0x55')](handleError(_0x39859e,null));};exports[_0x96c9('0x5a')]=function(_0x11f2b7,_0x503ae8,_0x318e2d){var _0x12ee80={'raw':![],'where':{}};var _0x1351a3={};var _0x4e2a0e={'count':0x0,'rows':[]};return db[_0x96c9('0x46')][_0x96c9('0x5b')]({'where':{'id':_0x11f2b7['params']['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x503ae8,null))[_0x96c9('0x22')](function(_0x577fe3){if(_0x577fe3){_0x1351a3['model']=_[_0x96c9('0x37')](db[_0x96c9('0x5c')][_0x96c9('0x32')]);_0x1351a3[_0x96c9('0x39')]=_[_0x96c9('0x37')](_0x11f2b7['query']);_0x1351a3['filters']=_[_0x96c9('0x3b')](_0x1351a3['model'],_0x1351a3[_0x96c9('0x39')]);_0x12ee80[_0x96c9('0x3a')]=_[_0x96c9('0x3b')](_0x1351a3[_0x96c9('0x35')],qs[_0x96c9('0x3c')](_0x11f2b7[_0x96c9('0x39')]['fields']));_0x12ee80[_0x96c9('0x3a')]=_0x12ee80[_0x96c9('0x3a')][_0x96c9('0x3d')]?_0x12ee80[_0x96c9('0x3a')]:_0x1351a3[_0x96c9('0x35')];if(!_0x11f2b7[_0x96c9('0x39')][_0x96c9('0x3e')](_0x96c9('0x3f'))){_0x12ee80[_0x96c9('0x1b')]=qs['limit'](_0x11f2b7[_0x96c9('0x39')]['limit']);_0x12ee80['offset']=qs[_0x96c9('0x1a')](_0x11f2b7[_0x96c9('0x39')][_0x96c9('0x1a')]);}_0x12ee80['order']=qs[_0x96c9('0x40')](_0x11f2b7['query'][_0x96c9('0x40')]);_0x12ee80[_0x96c9('0x41')]=qs[_0x96c9('0x38')](_[_0x96c9('0x42')](_0x11f2b7['query'],_0x1351a3[_0x96c9('0x38')]));_0x12ee80['where'][_0x96c9('0x5d')]=_0x577fe3['id'];if(_0x11f2b7['query']['filter']){_0x12ee80[_0x96c9('0x41')]=_['merge'](_0x12ee80['where'],{'$or':_['map'](_0x12ee80[_0x96c9('0x3a')],function(_0x354962){var _0x4c4a1e={};_0x4c4a1e[_0x354962]={'$like':'%'+_0x11f2b7[_0x96c9('0x39')]['filter']+'%'};return _0x4c4a1e;})});}_0x12ee80=_[_0x96c9('0x43')]({},_0x12ee80,_0x11f2b7[_0x96c9('0x45')]);return db[_0x96c9('0x5c')][_0x96c9('0x1c')]({'where':_0x12ee80[_0x96c9('0x41')]})['then'](function(_0x4f0d02){_0x4e2a0e[_0x96c9('0x1c')]=_0x4f0d02;if(_0x11f2b7[_0x96c9('0x39')][_0x96c9('0x47')]){_0x12ee80[_0x96c9('0x48')]=[{'all':!![]}];}return db[_0x96c9('0x5c')][_0x96c9('0x5e')](_0x12ee80);})['then'](function(_0x5cff40){_0x4e2a0e[_0x96c9('0x49')]=_0x5cff40;return _0x4e2a0e;});}})['then'](respondWithFilteredResult(_0x503ae8,_0x12ee80))[_0x96c9('0x55')](handleError(_0x503ae8,null));};exports[_0x96c9('0x5f')]=function(_0x1b5b58,_0x5f489c,_0x5e77bc){var _0x3cc7a9={'raw':!![],'where':{}};var _0x3135fe={};var _0x488c0d={'count':0x0,'rows':[]};return db[_0x96c9('0x46')][_0x96c9('0x5b')]({'where':{'id':_0x1b5b58[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x5f489c,null))['then'](function(_0x389c8c){if(_0x389c8c){_0x3135fe[_0x96c9('0x35')]=_[_0x96c9('0x37')](db[_0x96c9('0x60')][_0x96c9('0x32')]);_0x3135fe[_0x96c9('0x39')]=_[_0x96c9('0x37')](_0x1b5b58[_0x96c9('0x39')]);_0x3135fe[_0x96c9('0x38')]=_[_0x96c9('0x3b')](_0x3135fe['model'],_0x3135fe[_0x96c9('0x39')]);_0x3cc7a9[_0x96c9('0x3a')]=_[_0x96c9('0x3b')](_0x3135fe[_0x96c9('0x35')],qs[_0x96c9('0x3c')](_0x1b5b58[_0x96c9('0x39')][_0x96c9('0x3c')]));_0x3cc7a9['attributes']=_0x3cc7a9[_0x96c9('0x3a')][_0x96c9('0x3d')]?_0x3cc7a9[_0x96c9('0x3a')]:_0x3135fe[_0x96c9('0x35')];if(!_0x1b5b58[_0x96c9('0x39')]['hasOwnProperty'](_0x96c9('0x3f'))){_0x3cc7a9['limit']=qs['limit'](_0x1b5b58['query'][_0x96c9('0x1b')]);_0x3cc7a9[_0x96c9('0x1a')]=qs['offset'](_0x1b5b58['query'][_0x96c9('0x1a')]);}_0x3cc7a9[_0x96c9('0x61')]=qs[_0x96c9('0x40')](_0x1b5b58[_0x96c9('0x39')][_0x96c9('0x40')]);_0x3cc7a9[_0x96c9('0x41')]=qs[_0x96c9('0x38')](_[_0x96c9('0x42')](_0x1b5b58[_0x96c9('0x39')],_0x3135fe[_0x96c9('0x38')]));_0x3cc7a9['where'][_0x96c9('0x5d')]=_0x389c8c['id'];if(_0x1b5b58[_0x96c9('0x39')][_0x96c9('0x29')]){_0x3cc7a9[_0x96c9('0x41')]=_[_0x96c9('0x43')](_0x3cc7a9[_0x96c9('0x41')],{'$or':_[_0x96c9('0x36')](_0x3cc7a9[_0x96c9('0x3a')],function(_0x1aa440){var _0xe09ecc={};_0xe09ecc[_0x1aa440]={'$like':'%'+_0x1b5b58[_0x96c9('0x39')][_0x96c9('0x29')]+'%'};return _0xe09ecc;})});}_0x3cc7a9=_[_0x96c9('0x43')]({},_0x3cc7a9,_0x1b5b58['options']);return db[_0x96c9('0x60')]['count']({'where':_0x3cc7a9[_0x96c9('0x41')]})[_0x96c9('0x22')](function(_0x3067f3){_0x488c0d[_0x96c9('0x1c')]=_0x3067f3;if(_0x1b5b58[_0x96c9('0x39')][_0x96c9('0x47')]){_0x3cc7a9['include']=[{'all':!![]}];}return db[_0x96c9('0x60')][_0x96c9('0x5e')](_0x3cc7a9);})[_0x96c9('0x22')](function(_0x4162e9){_0x488c0d[_0x96c9('0x49')]=_0x4162e9;return _0x488c0d;});}})['then'](respondWithFilteredResult(_0x5f489c,_0x3cc7a9))[_0x96c9('0x55')](handleError(_0x5f489c,null));};exports[_0x96c9('0x62')]=function(_0x5adbc4,_0x101594,_0x361ae0){var _0xc06003={'raw':!![],'where':{}};var _0x57aa19={};var _0x262509={'count':0x0,'rows':[]};return db[_0x96c9('0x46')][_0x96c9('0x5b')]({'where':{'id':_0x5adbc4[_0x96c9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x101594,null))['then'](function(_0x4e30c6){if(_0x4e30c6){_0x57aa19[_0x96c9('0x35')]=_['keys'](db[_0x96c9('0x63')][_0x96c9('0x32')]);_0x57aa19[_0x96c9('0x39')]=_[_0x96c9('0x37')](_0x5adbc4[_0x96c9('0x39')]);_0x57aa19[_0x96c9('0x38')]=_[_0x96c9('0x3b')](_0x57aa19['model'],_0x57aa19[_0x96c9('0x39')]);_0xc06003['attributes']=_[_0x96c9('0x3b')](_0x57aa19[_0x96c9('0x35')],qs['fields'](_0x5adbc4['query']['fields']));_0xc06003[_0x96c9('0x3a')]=_0xc06003['attributes'][_0x96c9('0x3d')]?_0xc06003[_0x96c9('0x3a')]:_0x57aa19['model'];if(!_0x5adbc4['query']['hasOwnProperty'](_0x96c9('0x3f'))){_0xc06003[_0x96c9('0x1b')]=qs[_0x96c9('0x1b')](_0x5adbc4[_0x96c9('0x39')]['limit']);_0xc06003['offset']=qs[_0x96c9('0x1a')](_0x5adbc4['query'][_0x96c9('0x1a')]);}_0xc06003['order']=qs[_0x96c9('0x40')](_0x5adbc4[_0x96c9('0x39')]['sort']);_0xc06003[_0x96c9('0x41')]=qs[_0x96c9('0x38')](_[_0x96c9('0x42')](_0x5adbc4[_0x96c9('0x39')],_0x57aa19['filters']));_0xc06003[_0x96c9('0x41')]['VoiceQueueId']=_0x4e30c6['id'];if(_0x5adbc4[_0x96c9('0x39')][_0x96c9('0x29')]){_0xc06003['where']=_[_0x96c9('0x43')](_0xc06003['where'],{'$or':_[_0x96c9('0x36')](_0xc06003[_0x96c9('0x3a')],function(_0x355ebb){var _0x23c3c6={};_0x23c3c6[_0x355ebb]={'$like':'%'+_0x5adbc4[_0x96c9('0x39')]['filter']+'%'};return _0x23c3c6;})});}_0xc06003=_[_0x96c9('0x43')]({},_0xc06003,_0x5adbc4['options']);return db['CmHopperFinal'][_0x96c9('0x1c')]({'where':_0xc06003['where']})[_0x96c9('0x22')](function(_0x2acfc0){_0x262509[_0x96c9('0x1c')]=_0x2acfc0;if(_0x5adbc4[_0x96c9('0x39')]['includeAll']){_0xc06003[_0x96c9('0x48')]=[{'all':!![]}];}return db[_0x96c9('0x63')][_0x96c9('0x5e')](_0xc06003);})[_0x96c9('0x22')](function(_0xf2e39f){_0x262509['rows']=_0xf2e39f;return _0x262509;});}})['then'](respondWithFilteredResult(_0x101594,_0xc06003))[_0x96c9('0x55')](handleError(_0x101594,null));};exports[_0x96c9('0x64')]=function(_0x22841a,_0x57192f,_0x1370ae){var _0x1de0c6={'raw':!![],'where':{}};var _0x1791da={};var _0x3b7195={'count':0x0,'rows':[]};return db[_0x96c9('0x46')][_0x96c9('0x5b')]({'where':{'id':_0x22841a[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x57192f,null))[_0x96c9('0x22')](function(_0x395bec){if(_0x395bec){_0x1791da[_0x96c9('0x35')]=_[_0x96c9('0x37')](db['CmHopperBlack'][_0x96c9('0x32')]);_0x1791da['query']=_['keys'](_0x22841a[_0x96c9('0x39')]);_0x1791da[_0x96c9('0x38')]=_[_0x96c9('0x3b')](_0x1791da['model'],_0x1791da[_0x96c9('0x39')]);_0x1de0c6['attributes']=_[_0x96c9('0x3b')](_0x1791da[_0x96c9('0x35')],qs[_0x96c9('0x3c')](_0x22841a[_0x96c9('0x39')][_0x96c9('0x3c')]));_0x1de0c6['attributes']=_0x1de0c6[_0x96c9('0x3a')][_0x96c9('0x3d')]?_0x1de0c6[_0x96c9('0x3a')]:_0x1791da[_0x96c9('0x35')];if(!_0x22841a[_0x96c9('0x39')][_0x96c9('0x3e')]('nolimit')){_0x1de0c6[_0x96c9('0x1b')]=qs[_0x96c9('0x1b')](_0x22841a[_0x96c9('0x39')]['limit']);_0x1de0c6[_0x96c9('0x1a')]=qs[_0x96c9('0x1a')](_0x22841a['query'][_0x96c9('0x1a')]);}_0x1de0c6[_0x96c9('0x61')]=qs[_0x96c9('0x40')](_0x22841a[_0x96c9('0x39')]['sort']);_0x1de0c6['where']=qs[_0x96c9('0x38')](_['pick'](_0x22841a[_0x96c9('0x39')],_0x1791da['filters']));_0x1de0c6['where'][_0x96c9('0x5d')]=_0x395bec['id'];if(_0x22841a[_0x96c9('0x39')][_0x96c9('0x29')]){_0x1de0c6[_0x96c9('0x41')]=_[_0x96c9('0x43')](_0x1de0c6[_0x96c9('0x41')],{'$or':_[_0x96c9('0x36')](_0x1de0c6['attributes'],function(_0x24564a){var _0x1238c5={};_0x1238c5[_0x24564a]={'$like':'%'+_0x22841a['query']['filter']+'%'};return _0x1238c5;})});}_0x1de0c6=_[_0x96c9('0x43')]({},_0x1de0c6,_0x22841a['options']);return db[_0x96c9('0x65')][_0x96c9('0x1c')]({'where':_0x1de0c6['where']})[_0x96c9('0x22')](function(_0x313c16){_0x3b7195[_0x96c9('0x1c')]=_0x313c16;if(_0x22841a[_0x96c9('0x39')]['includeAll']){_0x1de0c6[_0x96c9('0x48')]=[{'all':!![]}];}return db[_0x96c9('0x65')][_0x96c9('0x5e')](_0x1de0c6);})[_0x96c9('0x22')](function(_0x2476af){_0x3b7195[_0x96c9('0x49')]=_0x2476af;return _0x3b7195;});}})[_0x96c9('0x22')](respondWithFilteredResult(_0x57192f,_0x1de0c6))[_0x96c9('0x55')](handleError(_0x57192f,null));};exports[_0x96c9('0x66')]=function(_0x128f5e,_0x44decc,_0x50a8f1){var _0x47036c={};var _0x455e71={};var _0x373903;var _0xd5e161;return db[_0x96c9('0x46')][_0x96c9('0x5b')]({'where':{'id':_0x128f5e[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x44decc,null))[_0x96c9('0x22')](function(_0x4abf80){if(_0x4abf80){_0x373903=_0x4abf80;_0x455e71[_0x96c9('0x35')]=_[_0x96c9('0x37')](db[_0x96c9('0x67')][_0x96c9('0x32')]);_0x455e71['query']=_[_0x96c9('0x37')](_0x128f5e[_0x96c9('0x39')]);_0x455e71[_0x96c9('0x38')]=_[_0x96c9('0x3b')](_0x455e71[_0x96c9('0x35')],_0x455e71[_0x96c9('0x39')]);_0x47036c[_0x96c9('0x3a')]=_[_0x96c9('0x3b')](_0x455e71[_0x96c9('0x35')],qs['fields'](_0x128f5e[_0x96c9('0x39')][_0x96c9('0x3c')]));_0x47036c['attributes']=_0x47036c['attributes'][_0x96c9('0x3d')]?_0x47036c[_0x96c9('0x3a')]:_0x455e71[_0x96c9('0x35')];_0x47036c['order']=qs['sort'](_0x128f5e[_0x96c9('0x39')][_0x96c9('0x40')]);_0x47036c[_0x96c9('0x41')]=qs[_0x96c9('0x38')](_['pick'](_0x128f5e['query'],_0x455e71[_0x96c9('0x38')]));if(_0x128f5e[_0x96c9('0x39')]['filter']){_0x47036c[_0x96c9('0x41')]=_[_0x96c9('0x43')](_0x47036c[_0x96c9('0x41')],{'$or':_[_0x96c9('0x36')](_0x47036c[_0x96c9('0x3a')],function(_0x10579f){var _0x156416={};_0x156416[_0x10579f]={'$like':'%'+_0x128f5e['query'][_0x96c9('0x29')]+'%'};return _0x156416;})});}_0x47036c=_[_0x96c9('0x43')]({},_0x47036c,_0x128f5e[_0x96c9('0x45')]);return _0x373903[_0x96c9('0x66')](_0x47036c);}})[_0x96c9('0x22')](function(_0x37a902){if(_0x37a902){_0xd5e161=_0x37a902[_0x96c9('0x3d')];if(!_0x128f5e['query']['hasOwnProperty'](_0x96c9('0x3f'))){_0x47036c[_0x96c9('0x1b')]=qs['limit'](_0x128f5e['query']['limit']);_0x47036c[_0x96c9('0x1a')]=qs[_0x96c9('0x1a')](_0x128f5e[_0x96c9('0x39')]['offset']);}return _0x373903[_0x96c9('0x66')](_0x47036c);}})[_0x96c9('0x22')](function(_0x329736){if(_0x329736){return _0x329736?{'count':_0xd5e161,'rows':_0x329736}:null;}})[_0x96c9('0x22')](respondWithResult(_0x44decc,null))[_0x96c9('0x55')](handleError(_0x44decc,null));};exports[_0x96c9('0x68')]=function(_0x5d735a,_0x3a56bc,_0x3e4fe2){var _0x453ccd=_0x5d735a[_0x96c9('0x4d')][_0x96c9('0x69')];var _0x27d606=_[_0x96c9('0x36')](_0x453ccd,'id');return db[_0x96c9('0x67')]['findAll']({'where':{'id':_0x27d606},'attributes':['id'],'include':[{'model':db[_0x96c9('0x6a')],'as':_0x96c9('0x6b'),'attributes':['id',_0x96c9('0x2d'),_0x96c9('0x6c'),_0x96c9('0x6d'),_0x96c9('0x6e')],'raw':!![]}]})[_0x96c9('0x22')](function(_0x4f3a35){if(_0x4f3a35){var _0x309bf3=_[_0x96c9('0x6f')](_0x4f3a35,function(_0x4592a2){var _0x555efb=_0x4592a2[_0x96c9('0x24')]({'plain':!![]});_0x555efb[_0x96c9('0x6b')]['forEach'](function(_0x3d98fd){_0x3d98fd[_0x96c9('0x70')]=_[_0x96c9('0x4b')](_0x453ccd,{'id':_0x555efb['id']})[_0x96c9('0x70')];});return _0x555efb[_0x96c9('0x6b')];});return db[_0x96c9('0x46')]['find']({'where':{'id':_0x5d735a[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](function(_0xca4ab4){return db[_0x96c9('0x71')][_0x96c9('0x72')](function(_0x338294){return _0xca4ab4[_0x96c9('0x68')](_0x27d606,{'transaction':_0x338294})[_0x96c9('0x22')](function(){return BPromise[_0x96c9('0x73')](_0x453ccd,function(_0xaead2f){return db['TeamVoiceQueue'][_0x96c9('0x74')]({'TeamId':_0xaead2f['id'],'VoiceQueueId':_0x5d735a[_0x96c9('0x4a')]['id'],'penalty':_0xaead2f['penalty']},{'transaction':_0x338294});});})[_0x96c9('0x22')](function(){return BPromise[_0x96c9('0x73')](_0x309bf3,function(_0x5c5d4a){return db['UserVoiceQueue'][_0x96c9('0x75')]({'where':{'UserId':_0x5c5d4a['id'],'VoiceQueueId':_0x5d735a[_0x96c9('0x4a')]['id']},'defaults':{'penalty':_0x5c5d4a['penalty']},'transaction':_0x338294});});})[_0x96c9('0x22')](function(){return BPromise[_0x96c9('0x73')](_['filter'](_0x309bf3,{'online':!![]}),function(_0x68039b){return db[_0x96c9('0x76')]['upsert']({'membername':_0x68039b[_0x96c9('0x2d')],'UserId':_0x68039b['id'],'queue_name':_0xca4ab4['name'],'VoiceQueueId':_0xca4ab4['id'],'interface':_[_0x96c9('0x77')](_0x68039b[_0x96c9('0x6e')])?util[_0x96c9('0x78')]('SIP/%s',_0x68039b[_0x96c9('0x2d')]):_0x68039b[_0x96c9('0x6e')],'paused':_0x68039b[_0x96c9('0x6d')]||![],'penalty':_0x68039b['penalty']},{'transaction':_0x338294});});})['then'](function(){_0x309bf3[_0x96c9('0x79')](function(_0x5a9e16){socket[_0x96c9('0x7a')]('userVoiceQueue:save',{'UserId':_0x5a9e16['id'],'VoiceQueueId':_0xca4ab4['id']});});});});});}})['then'](respondWithStatusCode(_0x3a56bc,null))[_0x96c9('0x55')](handleError(_0x3a56bc,null));};exports[_0x96c9('0x7b')]=function(_0x57822b,_0x124a79,_0x59f16d){return db[_0x96c9('0x67')][_0x96c9('0x5e')]({'where':{'id':_0x57822b['query'][_0x96c9('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x96c9('0x6a')],'as':_0x96c9('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x96c9('0x22')](handleEntityNotFound(_0x124a79,null))[_0x96c9('0x22')](function(_0x46965a){var _0x179294=_['map'](_0x46965a,'id');var _0x4da978=[];var _0x5e8344=[];var _0x5a16d6=squel[_0x96c9('0x7d')]();_0x5a16d6[_0x96c9('0x7e')](_0x96c9('0x7f'))[_0x96c9('0x80')](_0x96c9('0x81'),'tq')['join'](_0x96c9('0x82'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x96c9('0x41')]('VoiceQueueId\x20=\x20?',_0x57822b['params']['id']);for(var _0x203ef2=0x0;_0x203ef2<_0x46965a[_0x96c9('0x3d')];_0x203ef2+=0x1){let _0x407f04=_0x46965a[_0x203ef2];for(var _0x114eaa=0x0;_0x114eaa<_0x407f04['Agents']['length'];_0x114eaa+=0x1){let _0x1ffce8=_0x407f04[_0x96c9('0x6b')][_0x114eaa];var _0x572504=_0x5a16d6[_0x96c9('0x83')]();_0x572504[_0x96c9('0x41')]('ut.UserId\x20=\x20?',_0x1ffce8['id']);_0x5e8344['push'](db[_0x96c9('0x71')][_0x96c9('0x39')](_0x572504[_0x96c9('0x84')](),{'type':db['sequelize'][_0x96c9('0x85')]['SELECT']})[_0x96c9('0x22')](function(_0x2c1e28){if(_0x2c1e28[_0x96c9('0x3d')]===0x1){return _0x1ffce8['id'];}else{var _0x249ccf=_[_0x96c9('0x86')](_[_0x96c9('0x36')](_0x2c1e28,_0x96c9('0x87')),function(_0x1538c8){return _[_0x96c9('0x88')](_0x179294,_0x1538c8);});if(_0x249ccf){return _0x1ffce8['id'];}}}));}}return BPromise[_0x96c9('0x89')](_0x5e8344)[_0x96c9('0x22')](function(_0x5b8b8b){_0x4da978=_(_0x4da978)[_0x96c9('0x8a')](_0x5b8b8b)[_0x96c9('0x8b')]()['value']();return db[_0x96c9('0x46')][_0x96c9('0x4b')]({'where':{'id':_0x57822b['params']['id']}})['then'](function(_0x3d1af9){return db[_0x96c9('0x71')][_0x96c9('0x72')](function(_0x5f3bf5){return _0x3d1af9[_0x96c9('0x7b')](_0x57822b[_0x96c9('0x39')][_0x96c9('0x7c')],{'transaction':_0x5f3bf5})[_0x96c9('0x22')](function(){if(!_[_0x96c9('0x8c')](_0x4da978)){return _0x3d1af9[_0x96c9('0x8d')](_0x4da978,{'transaction':_0x5f3bf5})[_0x96c9('0x22')](function(){return db[_0x96c9('0x76')][_0x96c9('0x23')]({'where':{'VoiceQueueId':_0x57822b[_0x96c9('0x4a')]['id'],'UserId':_0x4da978},'transaction':_0x5f3bf5});});}})[_0x96c9('0x22')](function(){_0x4da978[_0x96c9('0x79')](function(_0x3294c3){socket[_0x96c9('0x7a')](_0x96c9('0x8e'),{'UserId':_0x3294c3,'VoiceQueueId':_0x3d1af9['id']});});});});});});})['then'](respondWithStatusCode(_0x124a79,null))[_0x96c9('0x55')](handleError(_0x124a79,null));};exports[_0x96c9('0x8f')]=function(_0x4f98a2,_0x1998de,_0x4fd739){var _0x22f0ef,_0x26ad86;return db[_0x96c9('0x46')][_0x96c9('0x4b')]({'where':{'id':_0x4f98a2[_0x96c9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1998de,null))['then'](function(_0x393b37){if(_0x393b37){_0x26ad86=_0x393b37;return _0x393b37[_0x96c9('0x8f')](_0x4f98a2[_0x96c9('0x4d')][_0x96c9('0x7c')],_[_0x96c9('0x59')](_0x4f98a2[_0x96c9('0x4d')],[_0x96c9('0x7c'),'id'])||{})[_0x96c9('0x90')](function(_0x3331dd){for(var _0x1b3dd9=0x0;_0x1b3dd9<_0x4f98a2['body'][_0x96c9('0x7c')][_0x96c9('0x3d')];_0x1b3dd9+=0x1){socket[_0x96c9('0x7a')](_0x96c9('0x91'),{'UserId':Number(_0x4f98a2[_0x96c9('0x4d')][_0x96c9('0x7c')][_0x1b3dd9]),'VoiceQueueId':Number(_0x4f98a2['params']['id'])});}return _0x3331dd;});}})[_0x96c9('0x22')](function(_0xf81d0f){_0x22f0ef=_0xf81d0f||[];if(_0x26ad86){return db[_0x96c9('0x6a')]['findAll']({'where':{'id':_0x4f98a2[_0x96c9('0x4d')][_0x96c9('0x7c')]},'attributes':['id','name',_0x96c9('0x6c'),_0x96c9('0x6d'),_0x96c9('0x6e')],'raw':!![]});}})['then'](function(_0x83ced2){if(!_['isEmpty'](_0x83ced2)){var _0x35161a=[];for(var _0x43ff5f=0x0;_0x43ff5f<_0x83ced2[_0x96c9('0x3d')];_0x43ff5f++){if(_0x83ced2[_0x43ff5f][_0x96c9('0x6c')]){_0x35161a['push'](db['UserVoiceQueueRt'][_0x96c9('0x74')]({'membername':_0x83ced2[_0x43ff5f][_0x96c9('0x2d')],'UserId':_0x83ced2[_0x43ff5f]['id'],'queue_name':_0x26ad86[_0x96c9('0x2d')],'VoiceQueueId':_0x26ad86['id'],'interface':_[_0x96c9('0x77')](_0x83ced2[_0x43ff5f]['interface'])?util[_0x96c9('0x78')](_0x96c9('0x92'),_0x83ced2[_0x43ff5f][_0x96c9('0x2d')]):_0x83ced2[_0x43ff5f][_0x96c9('0x6e')],'paused':_0x83ced2[_0x43ff5f][_0x96c9('0x6d')]||![],'penalty':_0x4f98a2['body'][_0x96c9('0x70')]||0x0}));}}return BPromise[_0x96c9('0x89')](_0x35161a);}})[_0x96c9('0x22')](function(){return _0x22f0ef;})[_0x96c9('0x22')](respondWithResult(_0x1998de,null))[_0x96c9('0x55')](handleError(_0x1998de,null));};exports['removeAgents']=function(_0x4d4700,_0x467762,_0x484c4d){return db[_0x96c9('0x46')][_0x96c9('0x4b')]({'where':{'id':_0x4d4700[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x467762,null))[_0x96c9('0x22')](function(_0x101e56){if(_0x101e56){return _0x101e56['removeAgents'](_0x4d4700[_0x96c9('0x39')]['ids'])[_0x96c9('0x22')](function(){if(_[_0x96c9('0x93')](_0x4d4700[_0x96c9('0x39')][_0x96c9('0x7c')])){for(var _0x10263c=0x0;_0x10263c<_0x4d4700['query'][_0x96c9('0x7c')][_0x96c9('0x3d')];_0x10263c+=0x1){socket[_0x96c9('0x7a')]('userVoiceQueue:remove',{'UserId':Number(_0x4d4700[_0x96c9('0x39')][_0x96c9('0x7c')][_0x10263c]),'VoiceQueueId':Number(_0x4d4700[_0x96c9('0x4a')]['id'])});}}else{socket[_0x96c9('0x7a')](_0x96c9('0x8e'),{'UserId':Number(_0x4d4700['query'][_0x96c9('0x7c')]),'VoiceQueueId':Number(_0x4d4700[_0x96c9('0x4a')]['id'])});}});}})[_0x96c9('0x22')](function(_0x4b9fb8){return db[_0x96c9('0x76')]['destroy']({'where':{'VoiceQueueId':_0x4d4700['params']['id'],'UserId':_0x4d4700['query']['ids']}})[_0x96c9('0x22')](function(){return _0x4b9fb8;});})[_0x96c9('0x22')](respondWithStatusCode(_0x467762,null))[_0x96c9('0x55')](handleError(_0x467762,null));};exports[_0x96c9('0x94')]=function(_0x5d67fa,_0x348fbf,_0x5550b9){var _0x4ac0c5={};var _0x12ecdb={};var _0xd79520;var _0x4c1c42;return db[_0x96c9('0x46')]['findOne']({'where':{'id':_0x5d67fa[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x348fbf,null))[_0x96c9('0x22')](function(_0x2a18c5){if(_0x2a18c5){_0xd79520=_0x2a18c5;_0x12ecdb[_0x96c9('0x35')]=_[_0x96c9('0x37')](db[_0x96c9('0x6a')][_0x96c9('0x32')]);_0x12ecdb['query']=_['keys'](_0x5d67fa['query']);_0x12ecdb[_0x96c9('0x38')]=_[_0x96c9('0x3b')](_0x12ecdb['model'],_0x12ecdb['query']);_0x4ac0c5[_0x96c9('0x3a')]=_[_0x96c9('0x3b')](_0x12ecdb['model'],qs[_0x96c9('0x3c')](_0x5d67fa['query'][_0x96c9('0x3c')]));_0x4ac0c5[_0x96c9('0x3a')]=_0x4ac0c5['attributes'][_0x96c9('0x3d')]?_0x4ac0c5['attributes']:_0x12ecdb[_0x96c9('0x35')];_0x4ac0c5[_0x96c9('0x61')]=qs['sort'](_0x5d67fa['query']['sort']);_0x4ac0c5[_0x96c9('0x41')]=qs[_0x96c9('0x38')](_[_0x96c9('0x42')](_0x5d67fa[_0x96c9('0x39')],_0x12ecdb[_0x96c9('0x38')]));if(_0x5d67fa['query'][_0x96c9('0x29')]){_0x4ac0c5[_0x96c9('0x41')]=_[_0x96c9('0x43')](_0x4ac0c5['where'],{'$or':_[_0x96c9('0x36')](_0x4ac0c5['attributes'],function(_0x32f5d6){var _0x562627={};_0x562627[_0x32f5d6]={'$like':'%'+_0x5d67fa[_0x96c9('0x39')][_0x96c9('0x29')]+'%'};return _0x562627;})});}_0x4ac0c5=_[_0x96c9('0x43')]({},_0x4ac0c5,_0x5d67fa['options']);return _0xd79520[_0x96c9('0x94')](_0x4ac0c5);}})[_0x96c9('0x22')](function(_0x458ebc){if(_0x458ebc){_0x4c1c42=_0x458ebc[_0x96c9('0x3d')];if(!_0x5d67fa['query'][_0x96c9('0x3e')](_0x96c9('0x3f'))){_0x4ac0c5['limit']=qs['limit'](_0x5d67fa['query'][_0x96c9('0x1b')]);_0x4ac0c5[_0x96c9('0x1a')]=qs['offset'](_0x5d67fa[_0x96c9('0x39')][_0x96c9('0x1a')]);}return _0xd79520[_0x96c9('0x94')](_0x4ac0c5);}})[_0x96c9('0x22')](function(_0x2d8992){if(_0x2d8992){return _0x2d8992?{'count':_0x4c1c42,'rows':_0x2d8992}:null;}})[_0x96c9('0x22')](respondWithResult(_0x348fbf,null))[_0x96c9('0x55')](handleError(_0x348fbf,null));};exports[_0x96c9('0x95')]=function(_0x488d61,_0x5a58b5,_0x1b864c){var _0x210bb7={};var _0xf0f69f={};var _0x9a825;var _0x1fab7c;return db[_0x96c9('0x46')][_0x96c9('0x5b')]({'where':{'id':_0x488d61[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x5a58b5,null))[_0x96c9('0x22')](function(_0x7e02c){if(_0x7e02c){_0x9a825=_0x7e02c;_0xf0f69f[_0x96c9('0x35')]=_[_0x96c9('0x37')](db[_0x96c9('0x76')][_0x96c9('0x32')]);_0xf0f69f[_0x96c9('0x39')]=_[_0x96c9('0x37')](_0x488d61[_0x96c9('0x39')]);_0xf0f69f['filters']=_[_0x96c9('0x3b')](_0xf0f69f['model'],_0xf0f69f[_0x96c9('0x39')]);_0x210bb7[_0x96c9('0x3a')]=_[_0x96c9('0x3b')](_0xf0f69f[_0x96c9('0x35')],qs['fields'](_0x488d61[_0x96c9('0x39')]['fields']));_0x210bb7[_0x96c9('0x3a')]=_0x210bb7['attributes'][_0x96c9('0x3d')]?_0x210bb7[_0x96c9('0x3a')]:_0xf0f69f[_0x96c9('0x35')];_0x210bb7['order']=qs['sort'](_0x488d61[_0x96c9('0x39')][_0x96c9('0x40')]);_0x210bb7[_0x96c9('0x41')]=qs['filters'](_['pick'](_0x488d61[_0x96c9('0x39')],_0xf0f69f[_0x96c9('0x38')]));if(_0x488d61[_0x96c9('0x39')][_0x96c9('0x29')]){_0x210bb7[_0x96c9('0x41')]=_[_0x96c9('0x43')](_0x210bb7[_0x96c9('0x41')],{'$or':_[_0x96c9('0x36')](_0x210bb7[_0x96c9('0x3a')],function(_0x52f675){var _0x106c86={};_0x106c86[_0x52f675]={'$like':'%'+_0x488d61[_0x96c9('0x39')]['filter']+'%'};return _0x106c86;})});}_0x210bb7=_[_0x96c9('0x43')]({},_0x210bb7,_0x488d61['options']);return _0x9a825[_0x96c9('0x95')](_0x210bb7);}})['then'](function(_0x558036){if(_0x558036){_0x1fab7c=_0x558036['length'];if(!_0x488d61[_0x96c9('0x39')]['hasOwnProperty'](_0x96c9('0x3f'))){_0x210bb7[_0x96c9('0x1b')]=qs[_0x96c9('0x1b')](_0x488d61[_0x96c9('0x39')][_0x96c9('0x1b')]);_0x210bb7[_0x96c9('0x1a')]=qs[_0x96c9('0x1a')](_0x488d61['query'][_0x96c9('0x1a')]);}return _0x9a825[_0x96c9('0x95')](_0x210bb7);}})[_0x96c9('0x22')](function(_0x2713f0){return _0x2713f0?{'count':_0x1fab7c,'rows':_0x2713f0}:null;})[_0x96c9('0x22')](respondWithResult(_0x5a58b5,null))[_0x96c9('0x55')](handleError(_0x5a58b5,null));};exports[_0x96c9('0x96')]=function(_0x9b0e8f,_0x2ac4d1,_0x45adf0){var _0x48b18c={};var _0x13230f={};var _0x169d76;var _0x5c4404;return db[_0x96c9('0x46')]['findOne']({'where':{'id':_0x9b0e8f[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x2ac4d1,null))['then'](function(_0x53200a){if(_0x53200a){_0x169d76=_0x53200a;_0x13230f['model']=_['keys'](db[_0x96c9('0x97')][_0x96c9('0x32')]);_0x13230f['query']=_[_0x96c9('0x37')](_0x9b0e8f[_0x96c9('0x39')]);_0x13230f[_0x96c9('0x38')]=_[_0x96c9('0x3b')](_0x13230f['model'],_0x13230f[_0x96c9('0x39')]);_0x48b18c[_0x96c9('0x3a')]=_[_0x96c9('0x3b')](_0x13230f[_0x96c9('0x35')],qs[_0x96c9('0x3c')](_0x9b0e8f[_0x96c9('0x39')]['fields']));_0x48b18c['attributes']=_0x48b18c['attributes'][_0x96c9('0x3d')]?_0x48b18c['attributes']:_0x13230f['model'];_0x48b18c[_0x96c9('0x61')]=qs['sort'](_0x9b0e8f['query'][_0x96c9('0x40')]);_0x48b18c[_0x96c9('0x41')]=qs[_0x96c9('0x38')](_[_0x96c9('0x42')](_0x9b0e8f['query'],_0x13230f[_0x96c9('0x38')]));if(_0x9b0e8f[_0x96c9('0x39')][_0x96c9('0x29')]){_0x48b18c['where']=_[_0x96c9('0x43')](_0x48b18c[_0x96c9('0x41')],{'$or':_[_0x96c9('0x36')](_0x48b18c['attributes'],function(_0x51f94d){var _0x5bd908={};_0x5bd908[_0x51f94d]={'$like':'%'+_0x9b0e8f['query'][_0x96c9('0x29')]+'%'};return _0x5bd908;})});}_0x48b18c=_[_0x96c9('0x43')]({},_0x48b18c,_0x9b0e8f[_0x96c9('0x45')]);return _0x169d76[_0x96c9('0x96')](_0x48b18c);}})[_0x96c9('0x22')](function(_0x1c7998){if(_0x1c7998){_0x5c4404=_0x1c7998[_0x96c9('0x3d')];if(!_0x9b0e8f[_0x96c9('0x39')]['hasOwnProperty'](_0x96c9('0x3f'))){_0x48b18c['limit']=qs[_0x96c9('0x1b')](_0x9b0e8f[_0x96c9('0x39')][_0x96c9('0x1b')]);_0x48b18c[_0x96c9('0x1a')]=qs['offset'](_0x9b0e8f[_0x96c9('0x39')][_0x96c9('0x1a')]);}return _0x169d76['getLists'](_0x48b18c);}})[_0x96c9('0x22')](function(_0x540e0e){if(_0x540e0e){return _0x540e0e?{'count':_0x5c4404,'rows':_0x540e0e}:null;}})[_0x96c9('0x22')](respondWithResult(_0x2ac4d1,null))[_0x96c9('0x55')](handleError(_0x2ac4d1,null));};exports[_0x96c9('0x98')]=function(_0x50be9d,_0x27bddb,_0x3200fe){var _0x3e31da=moment()[_0x96c9('0x78')](_0x96c9('0x99'));var _0x14cc5c,_0x5d8a3;return db['VoiceQueue'][_0x96c9('0x4b')]({'where':{'id':_0x50be9d[_0x96c9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x27bddb,null))[_0x96c9('0x22')](function(_0x37ebec){if(_0x37ebec){_0x5d8a3=_0x37ebec;return _0x37ebec['addLists'](_0x50be9d[_0x96c9('0x4d')][_0x96c9('0x7c')],_[_0x96c9('0x59')](_0x50be9d[_0x96c9('0x4d')],['ids','id'])||{});}return null;})[_0x96c9('0x90')](function(_0xff6ac6){var _0x60326a;_0x14cc5c=_0xff6ac6||[];var _0x530b19=[];if(_0xff6ac6){for(var _0x3bed61=0x0;_0x3bed61<_0xff6ac6[_0x96c9('0x3d')];_0x3bed61+=0x1){var _0x2987b5=_0xff6ac6[_0x3bed61][_0x96c9('0x24')]({'plain':!![]});_0x5d8a3[_0x96c9('0x9a')]=_0x50be9d[_0x96c9('0x4d')][_0x96c9('0x9a')]?_0x50be9d[_0x96c9('0x4d')][_0x96c9('0x9a')]:_0x5d8a3[_0x96c9('0x9a')];switch(_0x5d8a3[_0x96c9('0x9a')]){case _0x96c9('0x9b'):_0x60326a=squel[_0x96c9('0x9c')]()['into'](_0x96c9('0x9d'))[_0x96c9('0x9e')]([_0x96c9('0x9f'),_0x96c9('0xa0'),_0x96c9('0xa1'),_0x96c9('0xa2'),'VoiceQueueId','createdAt',_0x96c9('0x58')],squel[_0x96c9('0x7d')]()[_0x96c9('0x7e')](_0x96c9('0x9f'),'phone')[_0x96c9('0x7e')]('\x27'+_0x3e31da+'\x27','scheduledAt')[_0x96c9('0x7e')]('id',_0x96c9('0xa1'))[_0x96c9('0x7e')](_0x2987b5[_0x96c9('0xa3')]['toString'](),_0x96c9('0xa2'))['field'](_0x50be9d[_0x96c9('0x4a')]['id']['toString'](),_0x96c9('0x5d'))[_0x96c9('0x7e')]('\x27'+_0x3e31da+'\x27','createdAt')[_0x96c9('0x7e')]('\x27'+_0x3e31da+'\x27','updatedAt')[_0x96c9('0x80')](_0x96c9('0xa4'))[_0x96c9('0x41')]('deletedAt\x20IS\x20NULL')['where'](_0x96c9('0xa5'),_0x2987b5[_0x96c9('0xa3')]['toString']())[_0x96c9('0x41')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x96c9('0x7d')]()[_0x96c9('0x7e')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x96c9('0xa6'))[_0x96c9('0x41')](_0x96c9('0xa7'),_0x50be9d['params']['id'][_0x96c9('0x84')]()))[_0x96c9('0x41')](_0x96c9('0xa8'),squel[_0x96c9('0x7d')]()[_0x96c9('0x7e')](_0x96c9('0xa9'))[_0x96c9('0x80')](_0x96c9('0x9d'))['where']('VoiceQueueId\x20=\x20?',_0x50be9d['params']['id'][_0x96c9('0x84')]())))[_0x96c9('0x84')]();break;case'onlyIfOpen':_0x60326a=squel[_0x96c9('0x9c')]()[_0x96c9('0xaa')]('cm_hopper')[_0x96c9('0x9e')](['phone',_0x96c9('0xa0'),_0x96c9('0xa1'),'ListId',_0x96c9('0x5d'),'createdAt',_0x96c9('0x58')],squel[_0x96c9('0x7d')]()[_0x96c9('0x7e')](_0x96c9('0x9f'),_0x96c9('0x9f'))[_0x96c9('0x7e')]('\x27'+_0x3e31da+'\x27',_0x96c9('0xa0'))[_0x96c9('0x7e')]('id','ContactId')[_0x96c9('0x7e')](_0x2987b5['CmListId']['toString'](),_0x96c9('0xa2'))[_0x96c9('0x7e')](_0x50be9d[_0x96c9('0x4a')]['id'][_0x96c9('0x84')](),_0x96c9('0x5d'))['field']('\x27'+_0x3e31da+'\x27',_0x96c9('0x57'))['field']('\x27'+_0x3e31da+'\x27',_0x96c9('0x58'))[_0x96c9('0x80')]('cm_contacts')[_0x96c9('0x41')](_0x96c9('0xab'))['where'](_0x96c9('0xa5'),_0x2987b5[_0x96c9('0xa3')][_0x96c9('0x84')]())[_0x96c9('0x41')]('phone\x20IS\x20NOT\x20NULL')[_0x96c9('0x41')](_0x96c9('0xa8'),squel[_0x96c9('0x7d')]()[_0x96c9('0x7e')](_0x96c9('0xa9'))[_0x96c9('0x80')](_0x96c9('0x9d'))[_0x96c9('0x41')](_0x96c9('0xa7'),_0x50be9d[_0x96c9('0x4a')]['id'][_0x96c9('0x84')]())))[_0x96c9('0x84')]();break;default:_0x60326a=squel['insert']()[_0x96c9('0xaa')](_0x96c9('0x9d'))[_0x96c9('0x9e')](['phone','scheduledAt',_0x96c9('0xa1'),_0x96c9('0xa2'),_0x96c9('0x5d'),_0x96c9('0x57'),'updatedAt'],squel[_0x96c9('0x7d')]()['field'](_0x96c9('0x9f'),_0x96c9('0x9f'))[_0x96c9('0x7e')]('\x27'+_0x3e31da+'\x27',_0x96c9('0xa0'))[_0x96c9('0x7e')]('id',_0x96c9('0xa1'))['field'](_0x2987b5['CmListId'][_0x96c9('0x84')](),_0x96c9('0xa2'))[_0x96c9('0x7e')](_0x50be9d['params']['id'][_0x96c9('0x84')](),_0x96c9('0x5d'))[_0x96c9('0x7e')]('\x27'+_0x3e31da+'\x27',_0x96c9('0x57'))[_0x96c9('0x7e')]('\x27'+_0x3e31da+'\x27','updatedAt')['from']('cm_contacts')[_0x96c9('0x41')](_0x96c9('0xab'))[_0x96c9('0x41')](_0x96c9('0xa5'),_0x2987b5['CmListId'][_0x96c9('0x84')]())[_0x96c9('0x41')](_0x96c9('0xac')))[_0x96c9('0x84')]();}_0x530b19[_0x96c9('0xad')](db[_0x96c9('0x71')][_0x96c9('0x39')](_0x60326a));}return BPromise[_0x96c9('0x89')](_0x530b19);}})[_0x96c9('0x22')](function(){var _0x25f67f=[];var _0x4d824b=squel['insert']()[_0x96c9('0xaa')](_0x96c9('0xae'))[_0x96c9('0x9e')]([_0x96c9('0xaf'),_0x96c9('0x9f'),_0x96c9('0xb0'),_0x96c9('0x57'),_0x96c9('0x58')],squel[_0x96c9('0x7d')]()['field'](_0x96c9('0xb1'))[_0x96c9('0x7e')](_0x96c9('0xb2'))[_0x96c9('0x7e')]('ci.OrderBy+1')[_0x96c9('0x7e')]('\x27'+_0x3e31da+'\x27','createdAt')['field']('\x27'+_0x3e31da+'\x27','updatedAt')[_0x96c9('0x80')](_0x96c9('0xb3'),'ci')[_0x96c9('0xb4')]('cm_hopper','h',_0x96c9('0xb5'))[_0x96c9('0x41')](_0x96c9('0xb6'),_0x3e31da)[_0x96c9('0x41')](_0x96c9('0xb7'),_0x96c9('0xb8')))[_0x96c9('0x84')]();_0x25f67f[_0x96c9('0xad')](db[_0x96c9('0x71')][_0x96c9('0x39')](_0x4d824b));return BPromise[_0x96c9('0x89')](_0x25f67f);})[_0x96c9('0x22')](function(){return _0x14cc5c;})[_0x96c9('0x22')](respondWithResult(_0x27bddb,null))['catch'](handleError(_0x27bddb,null));};exports[_0x96c9('0xb9')]=function(_0x552e3f,_0x4204e8,_0x119399){return db['VoiceQueue'][_0x96c9('0x4b')]({'where':{'id':_0x552e3f[_0x96c9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4204e8,null))[_0x96c9('0x22')](function(_0x433ccb){if(_0x433ccb){return _0x433ccb[_0x96c9('0xb9')](_0x552e3f[_0x96c9('0x39')]['ids']);}})[_0x96c9('0x22')](function(_0x336276){if(_0x336276){return db[_0x96c9('0x5c')][_0x96c9('0x23')]({'where':{'ListId':_0x552e3f[_0x96c9('0x39')][_0x96c9('0x7c')],'VoiceQueueId':_0x552e3f[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](function(){return _0x336276;});}})['then'](respondWithStatusCode(_0x4204e8,null))['catch'](handleError(_0x4204e8,null));};exports[_0x96c9('0xba')]=function(_0x3ef994,_0x3d480e,_0x2b5c45){var _0x9bd53c={};var _0x4453b6={};var _0x371570;var _0x4c3247;return db[_0x96c9('0x46')][_0x96c9('0x5b')]({'where':{'id':_0x3ef994[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x3d480e,null))[_0x96c9('0x22')](function(_0x3ff045){if(_0x3ff045){_0x371570=_0x3ff045;_0x4453b6[_0x96c9('0x35')]=_[_0x96c9('0x37')](db[_0x96c9('0x97')][_0x96c9('0x32')]);_0x4453b6['query']=_['keys'](_0x3ef994[_0x96c9('0x39')]);_0x4453b6[_0x96c9('0x38')]=_['intersection'](_0x4453b6[_0x96c9('0x35')],_0x4453b6[_0x96c9('0x39')]);_0x9bd53c[_0x96c9('0x3a')]=_['intersection'](_0x4453b6[_0x96c9('0x35')],qs[_0x96c9('0x3c')](_0x3ef994[_0x96c9('0x39')][_0x96c9('0x3c')]));_0x9bd53c[_0x96c9('0x3a')]=_0x9bd53c[_0x96c9('0x3a')][_0x96c9('0x3d')]?_0x9bd53c[_0x96c9('0x3a')]:_0x4453b6[_0x96c9('0x35')];_0x9bd53c[_0x96c9('0x61')]=qs[_0x96c9('0x40')](_0x3ef994[_0x96c9('0x39')][_0x96c9('0x40')]);_0x9bd53c[_0x96c9('0x41')]=qs[_0x96c9('0x38')](_['pick'](_0x3ef994[_0x96c9('0x39')],_0x4453b6[_0x96c9('0x38')]));if(_0x3ef994['query']['filter']){_0x9bd53c[_0x96c9('0x41')]=_[_0x96c9('0x43')](_0x9bd53c[_0x96c9('0x41')],{'$or':_[_0x96c9('0x36')](_0x9bd53c['attributes'],function(_0x4ef12b){var _0x37cc18={};_0x37cc18[_0x4ef12b]={'$like':'%'+_0x3ef994[_0x96c9('0x39')][_0x96c9('0x29')]+'%'};return _0x37cc18;})});}_0x9bd53c=_[_0x96c9('0x43')]({},_0x9bd53c,_0x3ef994[_0x96c9('0x45')]);return _0x371570['getBlackLists'](_0x9bd53c);}})[_0x96c9('0x22')](function(_0x6e91c2){if(_0x6e91c2){_0x4c3247=_0x6e91c2[_0x96c9('0x3d')];if(!_0x3ef994[_0x96c9('0x39')][_0x96c9('0x3e')](_0x96c9('0x3f'))){_0x9bd53c[_0x96c9('0x1b')]=qs['limit'](_0x3ef994[_0x96c9('0x39')][_0x96c9('0x1b')]);_0x9bd53c[_0x96c9('0x1a')]=qs[_0x96c9('0x1a')](_0x3ef994[_0x96c9('0x39')][_0x96c9('0x1a')]);}return _0x371570[_0x96c9('0xba')](_0x9bd53c);}})['then'](function(_0x316114){if(_0x316114){return _0x316114?{'count':_0x4c3247,'rows':_0x316114}:null;}})[_0x96c9('0x22')](respondWithResult(_0x3d480e,null))['catch'](handleError(_0x3d480e,null));};exports[_0x96c9('0xbb')]=function(_0x4d864c,_0x20e7fe,_0x3039b4){var _0x4a6c4c,_0x2dc171;return db[_0x96c9('0x46')][_0x96c9('0x4b')]({'where':{'id':_0x4d864c['params']['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x20e7fe,null))[_0x96c9('0x22')](function(_0x14cc02){if(_0x14cc02){_0x2dc171=_0x14cc02;return _0x14cc02[_0x96c9('0xbb')](_0x4d864c[_0x96c9('0x4d')][_0x96c9('0x7c')],_[_0x96c9('0x59')](_0x4d864c[_0x96c9('0x4d')],[_0x96c9('0x7c'),'id'])||{});}return null;})['spread'](function(_0x3805a6){var _0x1db15f;_0x4a6c4c=_0x3805a6||[];var _0x22a760=[];if(_0x3805a6){for(var _0x51575c=0x0;_0x51575c<_0x3805a6['length'];_0x51575c+=0x1){var _0x5a9a1d=_0x3805a6[_0x51575c][_0x96c9('0x24')]({'plain':!![]});_0x1db15f=squel['insert']()[_0x96c9('0xaa')](_0x96c9('0xbc'))[_0x96c9('0x9e')]([_0x96c9('0x9f'),_0x96c9('0xa1'),'ListId',_0x96c9('0x5d'),'createdAt','updatedAt'],squel[_0x96c9('0x7d')]()['field'](_0x96c9('0x9f'),'phone')[_0x96c9('0x7e')]('id','ContactId')[_0x96c9('0x7e')](_0x5a9a1d['CmListId']['toString'](),_0x96c9('0xa2'))[_0x96c9('0x7e')](_0x4d864c[_0x96c9('0x4a')]['id']['toString'](),'VoiceQueueId')[_0x96c9('0x7e')](_0x96c9('0xbd'),_0x96c9('0x57'))[_0x96c9('0x7e')](_0x96c9('0xbd'),_0x96c9('0x58'))[_0x96c9('0x80')](_0x96c9('0xa4'))[_0x96c9('0x41')]('deletedAt\x20IS\x20NULL')[_0x96c9('0x41')](_0x96c9('0xa5'),_0x5a9a1d[_0x96c9('0xa3')][_0x96c9('0x84')]())[_0x96c9('0x41')](_0x96c9('0xac')))[_0x96c9('0x84')]();_0x22a760[_0x96c9('0xad')](db[_0x96c9('0x71')][_0x96c9('0x39')](_0x1db15f));}return BPromise[_0x96c9('0x89')](_0x22a760);}})[_0x96c9('0x22')](function(){return _0x4a6c4c;})[_0x96c9('0x22')](respondWithResult(_0x20e7fe,null))[_0x96c9('0x55')](handleError(_0x20e7fe,null));};exports[_0x96c9('0xbe')]=function(_0x55f8e5,_0x28312c,_0x462e02){return db['VoiceQueue'][_0x96c9('0x4b')]({'where':{'id':_0x55f8e5[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x28312c,null))[_0x96c9('0x22')](function(_0xf61650){if(_0xf61650){return _0xf61650[_0x96c9('0xbe')](_0x55f8e5['query'][_0x96c9('0x7c')]);}})[_0x96c9('0x22')](function(_0x119ab8){if(_0x119ab8){return db[_0x96c9('0x65')][_0x96c9('0x23')]({'where':{'ListId':_0x55f8e5[_0x96c9('0x39')][_0x96c9('0x7c')],'VoiceQueueId':_0x55f8e5[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](function(){return _0x119ab8;});}})['then'](respondWithStatusCode(_0x28312c,null))[_0x96c9('0x55')](handleError(_0x28312c,null));};
\ No newline at end of file
index 82961b1..c0e8b85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6178=['../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x6178,0x1c2));var _0x8617=function(_0x3896cc,_0xfb344b){_0x3896cc=_0x3896cc-0x0;var _0x5c4449=_0x6178[_0x3896cc];return _0x5c4449;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x8617('0x0'))['db'][_0x8617('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x8617('0x2')](0x0);var events={'afterCreate':_0x8617('0x3'),'afterUpdate':_0x8617('0x4'),'afterDestroy':_0x8617('0x5')};function emitEvent(_0x493aef){return function(_0x38fe24,_0x25f8bc,_0x11504f){VoiceQueueEvents[_0x8617('0x6')](_0x493aef+':'+_0x38fe24['id'],_0x38fe24);VoiceQueueEvents[_0x8617('0x6')](_0x493aef,_0x38fe24);_0x11504f(null);};}for(var e in events){if(events[_0x8617('0x7')](e)){var event=events[e];VoiceQueue[_0x8617('0x8')](e,emitEvent(event));}}module[_0x8617('0x9')]=VoiceQueueEvents;
\ No newline at end of file
+var _0xd16b=['exports','VoiceQueue','setMaxListeners','save','emit','hook'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd16b,0x127));var _0xbd16=function(_0x25d9ce,_0x9d174b){_0x25d9ce=_0x25d9ce-0x0;var _0x10ce55=_0xd16b[_0x25d9ce];return _0x10ce55;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0xbd16('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xbd16('0x1')](0x0);var events={'afterCreate':_0xbd16('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1febde){return function(_0x50c5a3,_0x128f48,_0x3bd466){VoiceQueueEvents[_0xbd16('0x3')](_0x1febde+':'+_0x50c5a3['id'],_0x50c5a3);VoiceQueueEvents[_0xbd16('0x3')](_0x1febde,_0x50c5a3);_0x3bd466(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xbd16('0x4')](e,emitEvent(event));}}module[_0xbd16('0x5')]=VoiceQueueEvents;
\ No newline at end of file
index 81a7069..a5b911f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x3ec550,_0x45006e){var _0x50f946=function(_0x56200f){while(--_0x56200f){_0x3ec550['push'](_0x3ec550['shift']());}};_0x50f946(++_0x45006e);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x254e83,_0x5213fa){var _0x2534b6=function(_0x5a00b9){while(--_0x5a00b9){_0x254e83['push'](_0x254e83['shift']());}};_0x2534b6(++_0x5213fa);}(_0x34e8,0x12c));var _0x834e=function(_0x1c462f,_0x11037e){_0x1c462f=_0x1c462f-0x0;var _0x4028c8=_0x34e8[_0x1c462f];return _0x4028c8;};'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 e24102d..27c48ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fbd=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','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','catch','GetVoiceQueue','findAll','options','raw','where','attributes','include','map','model','ShowVoiceQueue','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x370377,_0x4927ed){var _0x2c8a0c=function(_0x4f92f6){while(--_0x4f92f6){_0x370377['push'](_0x370377['shift']());}};_0x2c8a0c(++_0x4927ed);}(_0x0fbd,0x193));var _0xd0fb=function(_0x2b1daf,_0x2829f6){_0x2b1daf=_0x2b1daf-0x0;var _0x14e1e7=_0x0fbd[_0x2b1daf];return _0x14e1e7;};'use strict';var _=require('lodash');var util=require(_0xd0fb('0x0'));var moment=require(_0xd0fb('0x1'));var BPromise=require(_0xd0fb('0x2'));var rs=require(_0xd0fb('0x3'));var fs=require('fs');var Redis=require(_0xd0fb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd0fb('0x5'));var logger=require(_0xd0fb('0x6'))(_0xd0fb('0x7'));var config=require(_0xd0fb('0x8'));var jayson=require(_0xd0fb('0x9'));var client=jayson[_0xd0fb('0xa')][_0xd0fb('0xb')]({'port':0x232a});config[_0xd0fb('0xc')]=_[_0xd0fb('0xd')](config[_0xd0fb('0xc')],{'host':_0xd0fb('0xe'),'port':0x18eb});var socket=require(_0xd0fb('0xf'))(new Redis(config[_0xd0fb('0xc')]));require(_0xd0fb('0x10'))[_0xd0fb('0x11')](socket);function respondWithRpcPromise(_0x153c6e,_0x1582ce,_0x2b8212){return new BPromise(function(_0x2c65d3,_0x19cc5d){return client['request'](_0x153c6e,_0x2b8212)[_0xd0fb('0x12')](function(_0x18ce59){logger['info'](_0xd0fb('0x13'),_0x1582ce,_0xd0fb('0x14'));logger[_0xd0fb('0x15')](_0xd0fb('0x16'),_0x1582ce,_0xd0fb('0x14'),JSON[_0xd0fb('0x17')](_0x18ce59));if(_0x18ce59[_0xd0fb('0x18')]){if(_0x18ce59[_0xd0fb('0x18')][_0xd0fb('0x19')]===0x1f4){logger[_0xd0fb('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x1582ce,_0x18ce59[_0xd0fb('0x18')][_0xd0fb('0x1a')]);return _0x19cc5d(_0x18ce59[_0xd0fb('0x18')][_0xd0fb('0x1a')]);}logger['error'](_0xd0fb('0x13'),_0x1582ce,_0x18ce59[_0xd0fb('0x18')][_0xd0fb('0x1a')]);return _0x2c65d3(_0x18ce59[_0xd0fb('0x18')][_0xd0fb('0x1a')]);}else{logger[_0xd0fb('0x1b')](_0xd0fb('0x13'),_0x1582ce,_0xd0fb('0x14'));_0x2c65d3(_0x18ce59[_0xd0fb('0x1c')]['message']);}})[_0xd0fb('0x1d')](function(_0x303041){logger[_0xd0fb('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x1582ce,_0x303041);_0x19cc5d(_0x303041);});});}exports[_0xd0fb('0x1e')]=function(_0x4c617f){var _0x599c43=this;return new Promise(function(_0x2be99d,_0xbc449b){return db['VoiceQueue'][_0xd0fb('0x1f')]({'raw':_0x4c617f[_0xd0fb('0x20')]?_0x4c617f[_0xd0fb('0x20')][_0xd0fb('0x21')]===undefined?!![]:![]:!![],'where':_0x4c617f[_0xd0fb('0x20')]?_0x4c617f[_0xd0fb('0x20')][_0xd0fb('0x22')]||null:null,'attributes':_0x4c617f[_0xd0fb('0x20')]?_0x4c617f['options'][_0xd0fb('0x23')]||null:null,'limit':_0x4c617f['options']?_0x4c617f[_0xd0fb('0x20')]['limit']||null:null,'include':_0x4c617f[_0xd0fb('0x20')]?_0x4c617f[_0xd0fb('0x20')][_0xd0fb('0x24')]?_[_0xd0fb('0x25')](_0x4c617f[_0xd0fb('0x20')][_0xd0fb('0x24')],function(_0x4ae974){return{'model':db[_0x4ae974[_0xd0fb('0x26')]],'as':_0x4ae974['as'],'attributes':_0x4ae974['attributes'],'include':_0x4ae974[_0xd0fb('0x24')]?_[_0xd0fb('0x25')](_0x4ae974[_0xd0fb('0x24')],function(_0x52154a){return{'model':db[_0x52154a['model']],'as':_0x52154a['as'],'attributes':_0x52154a['attributes'],'include':_0x52154a[_0xd0fb('0x24')]?_[_0xd0fb('0x25')](_0x52154a[_0xd0fb('0x24')],function(_0x384dc7){return{'model':db[_0x384dc7[_0xd0fb('0x26')]],'as':_0x384dc7['as'],'attributes':_0x384dc7[_0xd0fb('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd0fb('0x12')](function(_0x1e31b4){logger[_0xd0fb('0x1b')]('GetVoiceQueue',_0x4c617f);logger[_0xd0fb('0x15')](_0xd0fb('0x1e'),_0x4c617f,JSON[_0xd0fb('0x17')](_0x1e31b4));_0x2be99d(_0x1e31b4);})[_0xd0fb('0x1d')](function(_0x2f7cc9){logger[_0xd0fb('0x18')]('GetVoiceQueue',_0x2f7cc9[_0xd0fb('0x1a')],_0x4c617f);_0xbc449b(_0x599c43[_0xd0fb('0x18')](0x1f4,_0x2f7cc9[_0xd0fb('0x1a')]));});});};exports[_0xd0fb('0x27')]=function(_0x2d8fda){var _0x3ce9a2=this;return new Promise(function(_0x45c81b,_0x16787a){return db['VoiceQueue'][_0xd0fb('0x28')]({'raw':_0x2d8fda[_0xd0fb('0x20')]?_0x2d8fda['options'][_0xd0fb('0x21')]===undefined?!![]:![]:!![],'where':_0x2d8fda[_0xd0fb('0x20')]?_0x2d8fda[_0xd0fb('0x20')][_0xd0fb('0x22')]||null:null,'attributes':_0x2d8fda[_0xd0fb('0x20')]?_0x2d8fda['options'][_0xd0fb('0x23')]||null:null,'include':_0x2d8fda['options']?_0x2d8fda['options'][_0xd0fb('0x24')]?_['map'](_0x2d8fda[_0xd0fb('0x20')][_0xd0fb('0x24')],function(_0x3b23c8){return{'model':db[_0x3b23c8[_0xd0fb('0x26')]],'as':_0x3b23c8['as'],'attributes':_0x3b23c8['attributes'],'include':_0x3b23c8[_0xd0fb('0x24')]?_[_0xd0fb('0x25')](_0x3b23c8[_0xd0fb('0x24')],function(_0x3b9eb3){return{'model':db[_0x3b9eb3['model']],'as':_0x3b9eb3['as'],'attributes':_0x3b9eb3['attributes'],'include':_0x3b9eb3[_0xd0fb('0x24')]?_[_0xd0fb('0x25')](_0x3b9eb3['include'],function(_0x2eb6e3){return{'model':db[_0x2eb6e3['model']],'as':_0x2eb6e3['as'],'attributes':_0x2eb6e3[_0xd0fb('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd0fb('0x12')](function(_0x25c116){logger[_0xd0fb('0x1b')]('ShowVoiceQueue',_0x2d8fda);logger[_0xd0fb('0x15')](_0xd0fb('0x27'),_0x2d8fda,JSON[_0xd0fb('0x17')](_0x25c116));_0x45c81b(_0x25c116);})['catch'](function(_0x4f807b){logger[_0xd0fb('0x18')]('ShowVoiceQueue',_0x4f807b['message'],_0x2d8fda);_0x16787a(_0x3ce9a2[_0xd0fb('0x18')](0x1f4,_0x4f807b['message']));});});};
\ No newline at end of file
+var _0x93c8=['./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','options','attributes','map','include','model','GetVoiceQueue','VoiceQueue','raw','where','ShowVoiceQueue','catch','lodash','bluebird','ioredis','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter'];(function(_0x5012f6,_0x327520){var _0x21c9aa=function(_0x22bba1){while(--_0x22bba1){_0x5012f6['push'](_0x5012f6['shift']());}};_0x21c9aa(++_0x327520);}(_0x93c8,0x107));var _0x893c=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x93c8[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x893c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x893c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x893c('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x893c('0x3'));var jayson=require(_0x893c('0x4'));var client=jayson['client'][_0x893c('0x5')]({'port':0x232a});config[_0x893c('0x6')]=_['defaults'](config[_0x893c('0x6')],{'host':_0x893c('0x7'),'port':0x18eb});var socket=require(_0x893c('0x8'))(new Redis(config['redis']));require(_0x893c('0x9'))[_0x893c('0xa')](socket);function respondWithRpcPromise(_0x2ac34c,_0x1823fe,_0x4b8e69){return new BPromise(function(_0x500ce3,_0x1370d5){return client['request'](_0x2ac34c,_0x4b8e69)[_0x893c('0xb')](function(_0xaae880){logger[_0x893c('0xc')](_0x893c('0xd'),_0x1823fe,_0x893c('0xe'));logger[_0x893c('0xf')](_0x893c('0x10'),_0x1823fe,_0x893c('0xe'),JSON[_0x893c('0x11')](_0xaae880));if(_0xaae880[_0x893c('0x12')]){if(_0xaae880[_0x893c('0x12')][_0x893c('0x13')]===0x1f4){logger[_0x893c('0x12')](_0x893c('0xd'),_0x1823fe,_0xaae880[_0x893c('0x12')][_0x893c('0x14')]);return _0x1370d5(_0xaae880[_0x893c('0x12')][_0x893c('0x14')]);}logger[_0x893c('0x12')](_0x893c('0xd'),_0x1823fe,_0xaae880[_0x893c('0x12')][_0x893c('0x14')]);return _0x500ce3(_0xaae880[_0x893c('0x12')][_0x893c('0x14')]);}else{logger[_0x893c('0xc')](_0x893c('0xd'),_0x1823fe,_0x893c('0xe'));_0x500ce3(_0xaae880[_0x893c('0x15')][_0x893c('0x14')]);}})['catch'](function(_0x377310){logger[_0x893c('0x12')](_0x893c('0xd'),_0x1823fe,_0x377310);_0x1370d5(_0x377310);});});}exports['GetVoiceQueue']=function(_0x12c10a){var _0x1e14cc=this;return new Promise(function(_0x15e726,_0x371fbc){return db['VoiceQueue'][_0x893c('0x16')]({'raw':_0x12c10a[_0x893c('0x17')]?_0x12c10a[_0x893c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x12c10a[_0x893c('0x17')]?_0x12c10a[_0x893c('0x17')]['where']||null:null,'attributes':_0x12c10a[_0x893c('0x17')]?_0x12c10a[_0x893c('0x17')][_0x893c('0x18')]||null:null,'limit':_0x12c10a[_0x893c('0x17')]?_0x12c10a[_0x893c('0x17')]['limit']||null:null,'include':_0x12c10a[_0x893c('0x17')]?_0x12c10a[_0x893c('0x17')]['include']?_[_0x893c('0x19')](_0x12c10a[_0x893c('0x17')][_0x893c('0x1a')],function(_0x1a0bd6){return{'model':db[_0x1a0bd6[_0x893c('0x1b')]],'as':_0x1a0bd6['as'],'attributes':_0x1a0bd6[_0x893c('0x18')],'include':_0x1a0bd6[_0x893c('0x1a')]?_[_0x893c('0x19')](_0x1a0bd6['include'],function(_0x4da080){return{'model':db[_0x4da080['model']],'as':_0x4da080['as'],'attributes':_0x4da080[_0x893c('0x18')],'include':_0x4da080[_0x893c('0x1a')]?_['map'](_0x4da080[_0x893c('0x1a')],function(_0x73fb27){return{'model':db[_0x73fb27[_0x893c('0x1b')]],'as':_0x73fb27['as'],'attributes':_0x73fb27[_0x893c('0x18')]};}):[]};}):[]};}):[]:[]})[_0x893c('0xb')](function(_0x2b6b1e){logger[_0x893c('0xc')](_0x893c('0x1c'),_0x12c10a);logger['debug'](_0x893c('0x1c'),_0x12c10a,JSON[_0x893c('0x11')](_0x2b6b1e));_0x15e726(_0x2b6b1e);})['catch'](function(_0x1b3ac1){logger[_0x893c('0x12')]('GetVoiceQueue',_0x1b3ac1[_0x893c('0x14')],_0x12c10a);_0x371fbc(_0x1e14cc[_0x893c('0x12')](0x1f4,_0x1b3ac1[_0x893c('0x14')]));});});};exports['ShowVoiceQueue']=function(_0x13e358){var _0x7dfb80=this;return new Promise(function(_0xd0b6d8,_0x5de721){return db[_0x893c('0x1d')]['find']({'raw':_0x13e358[_0x893c('0x17')]?_0x13e358['options'][_0x893c('0x1e')]===undefined?!![]:![]:!![],'where':_0x13e358[_0x893c('0x17')]?_0x13e358[_0x893c('0x17')][_0x893c('0x1f')]||null:null,'attributes':_0x13e358['options']?_0x13e358[_0x893c('0x17')][_0x893c('0x18')]||null:null,'include':_0x13e358[_0x893c('0x17')]?_0x13e358[_0x893c('0x17')][_0x893c('0x1a')]?_['map'](_0x13e358[_0x893c('0x17')][_0x893c('0x1a')],function(_0x5c510a){return{'model':db[_0x5c510a[_0x893c('0x1b')]],'as':_0x5c510a['as'],'attributes':_0x5c510a[_0x893c('0x18')],'include':_0x5c510a[_0x893c('0x1a')]?_[_0x893c('0x19')](_0x5c510a[_0x893c('0x1a')],function(_0x4be78e){return{'model':db[_0x4be78e[_0x893c('0x1b')]],'as':_0x4be78e['as'],'attributes':_0x4be78e[_0x893c('0x18')],'include':_0x4be78e['include']?_[_0x893c('0x19')](_0x4be78e[_0x893c('0x1a')],function(_0x1b3699){return{'model':db[_0x1b3699[_0x893c('0x1b')]],'as':_0x1b3699['as'],'attributes':_0x1b3699['attributes']};}):[]};}):[]};}):[]:[]})[_0x893c('0xb')](function(_0x5909b2){logger[_0x893c('0xc')](_0x893c('0x20'),_0x13e358);logger[_0x893c('0xf')](_0x893c('0x20'),_0x13e358,JSON[_0x893c('0x11')](_0x5909b2));_0xd0b6d8(_0x5909b2);})[_0x893c('0x21')](function(_0x4904de){logger[_0x893c('0x12')](_0x893c('0x20'),_0x4904de[_0x893c('0x14')],_0x13e358);_0x5de721(_0x7dfb80[_0x893c('0x12')](0x1f4,_0x4904de[_0x893c('0x14')]));});});};
\ No newline at end of file
index 7c03790..4c6d79b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c77=['length','voiceQueue:','./voiceQueue.events','save','remove','emit','removeListener','register'];(function(_0x4e128a,_0x3ad506){var _0x3829f6=function(_0x3cc48d){while(--_0x3cc48d){_0x4e128a['push'](_0x4e128a['shift']());}};_0x3829f6(++_0x3ad506);}(_0x6c77,0xf2));var _0x76c7=function(_0x29fc2c,_0x4ff86a){_0x29fc2c=_0x29fc2c-0x0;var _0x1adbc8=_0x6c77[_0x29fc2c];return _0x1adbc8;};'use strict';var VoiceQueueEvents=require(_0x76c7('0x0'));var events=[_0x76c7('0x1'),_0x76c7('0x2'),'update'];function createListener(_0x1236a5,_0x439610){return function(_0x1adcf4){_0x439610[_0x76c7('0x3')](_0x1236a5,_0x1adcf4);};}function removeListener(_0x2f5c50,_0xf0e473){return function(){VoiceQueueEvents[_0x76c7('0x4')](_0x2f5c50,_0xf0e473);};}exports[_0x76c7('0x5')]=function(_0x116731){for(var _0x224ef4=0x0,_0x4ca2c5=events[_0x76c7('0x6')];_0x224ef4<_0x4ca2c5;_0x224ef4++){var _0x4d0e11=events[_0x224ef4];var _0x98350e=createListener(_0x76c7('0x7')+_0x4d0e11,_0x116731);VoiceQueueEvents['on'](_0x4d0e11,_0x98350e);}};
\ No newline at end of file
+var _0x18ce=['emit','removeListener','register','voiceQueue:','./voiceQueue.events','update'];(function(_0x3c5e54,_0x2b991b){var _0x3ae1f3=function(_0x43f80f){while(--_0x43f80f){_0x3c5e54['push'](_0x3c5e54['shift']());}};_0x3ae1f3(++_0x2b991b);}(_0x18ce,0x106));var _0xe18c=function(_0x52987e,_0x3b84f2){_0x52987e=_0x52987e-0x0;var _0x30fd41=_0x18ce[_0x52987e];return _0x30fd41;};'use strict';var VoiceQueueEvents=require(_0xe18c('0x0'));var events=['save','remove',_0xe18c('0x1')];function createListener(_0x1832b1,_0x43ee0f){return function(_0x4ad893){_0x43ee0f[_0xe18c('0x2')](_0x1832b1,_0x4ad893);};}function removeListener(_0xadd948,_0x53efe1){return function(){VoiceQueueEvents[_0xe18c('0x3')](_0xadd948,_0x53efe1);};}exports[_0xe18c('0x4')]=function(_0x11dd12){for(var _0x31260d=0x0,_0x3b00dc=events['length'];_0x31260d<_0x3b00dc;_0x31260d++){var _0x2d8da2=events[_0x31260d];var _0x584fe8=createListener(_0xe18c('0x5')+_0x2d8da2,_0x11dd12);VoiceQueueEvents['on'](_0x2d8da2,_0x584fe8);}};
\ No newline at end of file
index 54e6181..b0755e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe060=['get','isAuthenticated','index','/describe','describe','getVoiceQueuesReport','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3bee27,_0x211a75){var _0x500445=function(_0x2f30a2){while(--_0x2f30a2){_0x3bee27['push'](_0x3bee27['shift']());}};_0x500445(++_0x211a75);}(_0xe060,0x150));var _0x0e06=function(_0x948065,_0x402299){_0x948065=_0x948065-0x0;var _0x8bacf4=_0xe060[_0x948065];return _0x8bacf4;};'use strict';var multer=require(_0x0e06('0x0'));var util=require(_0x0e06('0x1'));var path=require(_0x0e06('0x2'));var timeout=require(_0x0e06('0x3'));var express=require(_0x0e06('0x4'));var router=express[_0x0e06('0x5')]();var fs_extra=require(_0x0e06('0x6'));var auth=require(_0x0e06('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0e06('0x8'));var controller=require('./voiceQueueReport.controller');router[_0x0e06('0x9')]('/',auth[_0x0e06('0xa')](),controller[_0x0e06('0xb')]);router[_0x0e06('0x9')](_0x0e06('0xc'),auth[_0x0e06('0xa')](),controller[_0x0e06('0xd')]);router[_0x0e06('0x9')]('/index',auth[_0x0e06('0xa')](),controller[_0x0e06('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0e06('0xf')]);router[_0x0e06('0x10')]('/',auth[_0x0e06('0xa')](),controller[_0x0e06('0x11')]);router[_0x0e06('0x12')](_0x0e06('0x13'),auth['isAuthenticated'](),controller[_0x0e06('0x14')]);router['delete'](_0x0e06('0x13'),auth[_0x0e06('0xa')](),controller[_0x0e06('0x15')]);module[_0x0e06('0x16')]=router;
\ No newline at end of file
+var _0xff8b=['/describe','describe','/index','show','post','create','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index'];(function(_0x15a72f,_0x3ca4d1){var _0x57a89c=function(_0x1e5c85){while(--_0x1e5c85){_0x15a72f['push'](_0x15a72f['shift']());}};_0x57a89c(++_0x3ca4d1);}(_0xff8b,0x105));var _0xbff8=function(_0x284b51,_0x7a975){_0x284b51=_0x284b51-0x0;var _0x3da543=_0xff8b[_0x284b51];return _0x3da543;};'use strict';var multer=require(_0xbff8('0x0'));var util=require(_0xbff8('0x1'));var path=require(_0xbff8('0x2'));var timeout=require(_0xbff8('0x3'));var express=require(_0xbff8('0x4'));var router=express[_0xbff8('0x5')]();var fs_extra=require(_0xbff8('0x6'));var auth=require(_0xbff8('0x7'));var interaction=require(_0xbff8('0x8'));var config=require(_0xbff8('0x9'));var controller=require(_0xbff8('0xa'));router[_0xbff8('0xb')]('/',auth[_0xbff8('0xc')](),controller[_0xbff8('0xd')]);router[_0xbff8('0xb')](_0xbff8('0xe'),auth['isAuthenticated'](),controller[_0xbff8('0xf')]);router[_0xbff8('0xb')](_0xbff8('0x10'),auth[_0xbff8('0xc')](),controller['getVoiceQueuesReport']);router[_0xbff8('0xb')]('/:id',auth[_0xbff8('0xc')](),controller[_0xbff8('0x11')]);router[_0xbff8('0x12')]('/',auth[_0xbff8('0xc')](),controller[_0xbff8('0x13')]);router[_0xbff8('0x14')]('/:id',auth[_0xbff8('0xc')](),controller[_0xbff8('0x15')]);router[_0xbff8('0x16')](_0xbff8('0x17'),auth[_0xbff8('0xc')](),controller[_0xbff8('0x18')]);module['exports']=router;
\ No newline at end of file
index c55f0af..2915fdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9589=['DATE','getDataValue','format','diff','seconds','setDataValue','holdtime','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','sequelize','moment','exports','STRING'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x9589,0xb2));var _0x9958=function(_0x53f628,_0x45ff37){_0x53f628=_0x53f628-0x0;var _0x44b333=_0x9589[_0x53f628];return _0x44b333;};'use strict';var Sequelize=require(_0x9958('0x0'));var moment=require(_0x9958('0x1'));module[_0x9958('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9958('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9958('0x3')]},'queue':{'type':Sequelize[_0x9958('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x9958('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x571c69){var _0x306975=moment(_0x571c69);var _0x336198=moment(this[_0x9958('0x5')]('queuecallerjoinAt'))[_0x9958('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x493d2f=_0x306975[_0x9958('0x7')](_0x336198,_0x9958('0x8'));this[_0x9958('0x9')]('queuecallerleaveAt',_0x571c69);this[_0x9958('0x9')](_0x9958('0xa'),_0x493d2f||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x9958('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x9958('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x9958('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x9958('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x9958('0x3')],'comment':_0x9958('0xc')},'originalposition':{'type':Sequelize[_0x9958('0xd')]},'channel':{'type':Sequelize[_0x9958('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9958('0x3')]},'exten':{'type':Sequelize[_0x9958('0x3')]},'priority':{'type':Sequelize[_0x9958('0x3')]},'holdtime':{'type':Sequelize[_0x9958('0xd')]},'mohtime':{'type':Sequelize[_0x9958('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9958('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x9958('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x9958('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9958('0x3')]},'thirdDisposition':{'type':Sequelize[_0x9958('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x9958('0xd')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x8665=['queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE'];(function(_0x3141c1,_0x20518b){var _0x59edab=function(_0xfefd6e){while(--_0xfefd6e){_0x3141c1['push'](_0x3141c1['shift']());}};_0x59edab(++_0x20518b);}(_0x8665,0x1a0));var _0x5866=function(_0x337845,_0x32851b){_0x337845=_0x337845-0x0;var _0x1abd38=_0x8665[_0x337845];return _0x1abd38;};'use strict';var Sequelize=require(_0x5866('0x0'));var moment=require(_0x5866('0x1'));module['exports']={'type':{'type':Sequelize[_0x5866('0x2')]},'uniqueid':{'type':Sequelize[_0x5866('0x2')]},'calleridnum':{'type':Sequelize[_0x5866('0x2')]},'calleridname':{'type':Sequelize[_0x5866('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x5866('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x36f651){var _0x55886e=moment(_0x36f651);var _0x184c1b=moment(this['getDataValue'](_0x5866('0x4')))[_0x5866('0x5')](_0x5866('0x6'));var _0x40a271=_0x55886e[_0x5866('0x7')](_0x184c1b,'seconds');this[_0x5866('0x8')](_0x5866('0x9'),_0x36f651);this[_0x5866('0x8')]('holdtime',_0x40a271||null);}},'position':{'type':Sequelize[_0x5866('0xa')]},'count':{'type':Sequelize[_0x5866('0xa')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x5866('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x5866('0x3')]},'queuecallerexit':{'type':Sequelize[_0x5866('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x5866('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x5866('0x2')],'comment':_0x5866('0xc')},'originalposition':{'type':Sequelize[_0x5866('0xa')]},'channel':{'type':Sequelize[_0x5866('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5866('0x2')]},'connectedlinename':{'type':Sequelize[_0x5866('0x2')]},'accountcode':{'type':Sequelize[_0x5866('0x2')]},'context':{'type':Sequelize[_0x5866('0x2')]},'exten':{'type':Sequelize[_0x5866('0x2')]},'priority':{'type':Sequelize[_0x5866('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x5866('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x5866('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x5866('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x5866('0xd')},'transferexten':{'type':Sequelize[_0x5866('0x2')]},'transferuniqueid':{'type':Sequelize[_0x5866('0x2')]},'disposition':{'type':Sequelize[_0x5866('0x2')]},'secondDisposition':{'type':Sequelize[_0x5866('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index f00341e..78457fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4413=['rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','index','VoiceQueueReport','fieldName','type','key','model','query','keys','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','count','includeAll','include','findAll','show','rawAttributes','intersection','options','find','catch','create','body','params','describe','getVoiceQueuesReport'];(function(_0x2f08c6,_0x5e04d1){var _0x1fe56d=function(_0xe3640b){while(--_0xe3640b){_0x2f08c6['push'](_0x2f08c6['shift']());}};_0x1fe56d(++_0x5e04d1);}(_0x4413,0xab));var _0x3441=function(_0xad528c,_0x58a589){_0xad528c=_0xad528c-0x0;var _0x23fec5=_0x4413[_0xad528c];return _0x23fec5;};'use strict';var emlformat=require(_0x3441('0x0'));var rimraf=require(_0x3441('0x1'));var zipdir=require(_0x3441('0x2'));var jsonpatch=require(_0x3441('0x3'));var rp=require(_0x3441('0x4'));var moment=require(_0x3441('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x3441('0x6'));var sox=require(_0x3441('0x7'));var csv=require(_0x3441('0x8'));var ejs=require(_0x3441('0x9'));var fs=require('fs');var fs_extra=require(_0x3441('0xa'));var _=require(_0x3441('0xb'));var squel=require(_0x3441('0xc'));var crypto=require(_0x3441('0xd'));var jsforce=require(_0x3441('0xe'));var deskjs=require(_0x3441('0xf'));var toCsv=require(_0x3441('0x8'));var querystring=require(_0x3441('0x10'));var Papa=require('papaparse');var Redis=require(_0x3441('0x11'));var authService=require(_0x3441('0x12'));var qs=require(_0x3441('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3441('0x14'))(_0x3441('0x15'));var utils=require('../../config/utils');var config=require(_0x3441('0x16'));var licenseUtil=require(_0x3441('0x17'));var db=require(_0x3441('0x18'))['db'];config[_0x3441('0x19')]=_[_0x3441('0x1a')](config[_0x3441('0x19')],{'host':_0x3441('0x1b'),'port':0x18eb});var socket=require(_0x3441('0x1c'))(new Redis(config['redis']));require(_0x3441('0x1d'))['register'](socket);function respondWithStatusCode(_0x289934,_0x19c8bb){_0x19c8bb=_0x19c8bb||0xcc;return function(_0x5ec7c2){if(_0x5ec7c2){return _0x289934[_0x3441('0x1e')](_0x19c8bb);}return _0x289934[_0x3441('0x1f')](_0x19c8bb)[_0x3441('0x20')]();};}function respondWithResult(_0x2bd047,_0x5a78de){_0x5a78de=_0x5a78de||0xc8;return function(_0x1274d2){if(_0x1274d2){return _0x2bd047[_0x3441('0x1f')](_0x5a78de)['json'](_0x1274d2);}};}function respondWithFilteredResult(_0x2b7913,_0x1c8383){return function(_0x1ced9d){if(_0x1ced9d){var _0x180c70=typeof _0x1c8383[_0x3441('0x21')]===_0x3441('0x22')&&typeof _0x1c8383[_0x3441('0x23')]===_0x3441('0x22');var _0x1ac5a7=_0x1ced9d['count'];var _0x5e4e02=_0x180c70?0x0:_0x1c8383[_0x3441('0x21')];var _0x303916=_0x180c70?_0x1ced9d['count']:_0x1c8383[_0x3441('0x21')]+_0x1c8383[_0x3441('0x23')];var _0xf4143c;if(_0x303916>=_0x1ac5a7){_0x303916=_0x1ac5a7;_0xf4143c=0xc8;}else{_0xf4143c=0xce;}_0x2b7913[_0x3441('0x1f')](_0xf4143c);return _0x2b7913[_0x3441('0x24')](_0x3441('0x25'),_0x5e4e02+'-'+_0x303916+'/'+_0x1ac5a7)[_0x3441('0x26')](_0x1ced9d);}return null;};}function patchUpdates(_0x48579f){return function(_0x1af077){try{jsonpatch[_0x3441('0x27')](_0x1af077,_0x48579f,!![]);}catch(_0x126841){return BPromise['reject'](_0x126841);}return _0x1af077[_0x3441('0x28')]();};}function saveUpdates(_0x41a665,_0x31b40b){return function(_0x2ae807){if(_0x2ae807){return _0x2ae807[_0x3441('0x29')](_0x41a665)[_0x3441('0x2a')](function(_0x509f6d){return _0x509f6d;});}return null;};}function removeEntity(_0x4b3639,_0x32ad92){return function(_0x1be7b7){if(_0x1be7b7){return _0x1be7b7[_0x3441('0x2b')]()[_0x3441('0x2a')](function(){_0x4b3639[_0x3441('0x1f')](0xcc)[_0x3441('0x20')]();});}};}function handleEntityNotFound(_0x2fbcd5,_0x2a12ba){return function(_0x5a691b){if(!_0x5a691b){_0x2fbcd5[_0x3441('0x1e')](0x194);}return _0x5a691b;};}function handleError(_0x4a2a27,_0x3a78f6){_0x3a78f6=_0x3a78f6||0x1f4;return function(_0x18c1b7){logger[_0x3441('0x2c')](_0x18c1b7[_0x3441('0x2d')]);if(_0x18c1b7[_0x3441('0x2e')]){delete _0x18c1b7[_0x3441('0x2e')];}_0x4a2a27['status'](_0x3a78f6)['send'](_0x18c1b7);};}exports[_0x3441('0x2f')]=function(_0x129e7c,_0x5917b8){var _0x58b9c5={},_0x124cf4={},_0x4f8ac4={'count':0x0,'rows':[]};var _0x421135=_['map'](db[_0x3441('0x30')]['rawAttributes'],function(_0x1db471){return{'name':_0x1db471[_0x3441('0x31')],'type':_0x1db471[_0x3441('0x32')][_0x3441('0x33')]};});_0x124cf4[_0x3441('0x34')]=_['map'](_0x421135,_0x3441('0x2e'));_0x124cf4[_0x3441('0x35')]=_[_0x3441('0x36')](_0x129e7c[_0x3441('0x35')]);_0x124cf4['filters']=_['intersection'](_0x124cf4[_0x3441('0x34')],_0x124cf4['query']);_0x58b9c5['attributes']=_['intersection'](_0x124cf4[_0x3441('0x34')],qs[_0x3441('0x37')](_0x129e7c[_0x3441('0x35')][_0x3441('0x37')]));_0x58b9c5[_0x3441('0x38')]=_0x58b9c5[_0x3441('0x38')][_0x3441('0x39')]?_0x58b9c5['attributes']:_0x124cf4['model'];if(!_0x129e7c[_0x3441('0x35')][_0x3441('0x3a')](_0x3441('0x3b'))){_0x58b9c5[_0x3441('0x23')]=qs[_0x3441('0x23')](_0x129e7c[_0x3441('0x35')]['limit']);_0x58b9c5['offset']=qs[_0x3441('0x21')](_0x129e7c[_0x3441('0x35')]['offset']);}_0x58b9c5[_0x3441('0x3c')]=qs[_0x3441('0x3d')](_0x129e7c['query'][_0x3441('0x3d')]);_0x58b9c5[_0x3441('0x3e')]=qs[_0x3441('0x3f')](_[_0x3441('0x40')](_0x129e7c[_0x3441('0x35')],_0x124cf4[_0x3441('0x3f')]),_0x421135);if(_0x129e7c[_0x3441('0x35')][_0x3441('0x41')]){_0x58b9c5[_0x3441('0x3e')]=_[_0x3441('0x42')](_0x58b9c5[_0x3441('0x3e')],{'$or':_[_0x3441('0x43')](_0x421135,function(_0x2e3df6){if(_0x2e3df6[_0x3441('0x32')]!==_0x3441('0x44')){var _0x4e9bc0={};_0x4e9bc0[_0x2e3df6[_0x3441('0x2e')]]={'$like':'%'+_0x129e7c[_0x3441('0x35')]['filter']+'%'};return _0x4e9bc0;}})});}_0x58b9c5=_[_0x3441('0x42')]({},_0x58b9c5,_0x129e7c['options']);var _0x14bcda={'where':_0x58b9c5['where']};return db[_0x3441('0x30')][_0x3441('0x45')](_0x14bcda)[_0x3441('0x2a')](function(_0x2987f8){_0x4f8ac4[_0x3441('0x45')]=_0x2987f8;if(_0x129e7c[_0x3441('0x35')][_0x3441('0x46')]){_0x58b9c5[_0x3441('0x47')]=[{'all':!![]}];}return db[_0x3441('0x30')][_0x3441('0x48')](_0x58b9c5);})[_0x3441('0x2a')](function(_0x53ed0f){_0x4f8ac4['rows']=_0x53ed0f;return _0x4f8ac4;})[_0x3441('0x2a')](respondWithFilteredResult(_0x5917b8,_0x58b9c5))['catch'](handleError(_0x5917b8,null));};exports[_0x3441('0x49')]=function(_0x1129cb,_0x1353a7){var _0x34e439={'raw':![],'where':{'id':_0x1129cb['params']['id']}},_0x39ec90={};_0x39ec90[_0x3441('0x34')]=_[_0x3441('0x36')](db[_0x3441('0x30')][_0x3441('0x4a')]);_0x39ec90['query']=_[_0x3441('0x36')](_0x1129cb[_0x3441('0x35')]);_0x39ec90[_0x3441('0x3f')]=_[_0x3441('0x4b')](_0x39ec90[_0x3441('0x34')],_0x39ec90['query']);_0x34e439[_0x3441('0x38')]=_[_0x3441('0x4b')](_0x39ec90[_0x3441('0x34')],qs[_0x3441('0x37')](_0x1129cb['query'][_0x3441('0x37')]));_0x34e439[_0x3441('0x38')]=_0x34e439[_0x3441('0x38')][_0x3441('0x39')]?_0x34e439['attributes']:_0x39ec90['model'];if(_0x1129cb[_0x3441('0x35')]['includeAll']){_0x34e439['include']=[{'all':!![]}];}_0x34e439=_['merge']({},_0x34e439,_0x1129cb[_0x3441('0x4c')]);return db[_0x3441('0x30')][_0x3441('0x4d')](_0x34e439)[_0x3441('0x2a')](handleEntityNotFound(_0x1353a7,null))['then'](respondWithResult(_0x1353a7,null))[_0x3441('0x4e')](handleError(_0x1353a7,null));};exports['create']=function(_0x4899b7,_0x373071){return db[_0x3441('0x30')][_0x3441('0x4f')](_0x4899b7[_0x3441('0x50')],{})[_0x3441('0x2a')](respondWithResult(_0x373071,0xc9))[_0x3441('0x4e')](handleError(_0x373071,null));};exports[_0x3441('0x29')]=function(_0xf45fbc,_0x5c34aa){if(_0xf45fbc[_0x3441('0x50')]['id']){delete _0xf45fbc['body']['id'];}return db[_0x3441('0x30')][_0x3441('0x4d')]({'where':{'id':_0xf45fbc[_0x3441('0x51')]['id']}})[_0x3441('0x2a')](handleEntityNotFound(_0x5c34aa,null))[_0x3441('0x2a')](saveUpdates(_0xf45fbc['body'],null))[_0x3441('0x2a')](respondWithResult(_0x5c34aa,null))[_0x3441('0x4e')](handleError(_0x5c34aa,null));};exports[_0x3441('0x2b')]=function(_0x20f956,_0x33b862){return db[_0x3441('0x30')][_0x3441('0x4d')]({'where':{'id':_0x20f956[_0x3441('0x51')]['id']}})['then'](handleEntityNotFound(_0x33b862,null))[_0x3441('0x2a')](removeEntity(_0x33b862,null))['catch'](handleError(_0x33b862,null));};exports[_0x3441('0x52')]=function(_0x5cc8b0,_0x46ee73){return db[_0x3441('0x30')][_0x3441('0x52')]()[_0x3441('0x2a')](respondWithResult(_0x46ee73,null))[_0x3441('0x4e')](handleError(_0x46ee73,null));};exports[_0x3441('0x53')]=function(_0x2d8e6f,_0x3a8e7f){var _0x40c4eb={},_0x1c9929={},_0x3eec5e={'count':0x0,'rows':[]};_0x1c9929[_0x3441('0x34')]=_[_0x3441('0x36')](db[_0x3441('0x30')][_0x3441('0x4a')]);_0x1c9929[_0x3441('0x35')]=_[_0x3441('0x36')](_0x2d8e6f[_0x3441('0x35')]);_0x1c9929[_0x3441('0x3f')]=_['intersection'](_0x1c9929['model'],_0x1c9929[_0x3441('0x35')]);_0x40c4eb['attributes']=_[_0x3441('0x4b')](_0x1c9929[_0x3441('0x34')],qs[_0x3441('0x37')](_0x2d8e6f[_0x3441('0x35')][_0x3441('0x37')]));_0x40c4eb[_0x3441('0x38')]=_0x40c4eb['attributes']['length']?_0x40c4eb[_0x3441('0x38')]:_0x1c9929[_0x3441('0x34')];if(!_0x2d8e6f[_0x3441('0x35')][_0x3441('0x3a')](_0x3441('0x3b'))){_0x40c4eb[_0x3441('0x23')]=qs[_0x3441('0x23')](_0x2d8e6f[_0x3441('0x35')][_0x3441('0x23')]);_0x40c4eb[_0x3441('0x21')]=qs[_0x3441('0x21')](_0x2d8e6f[_0x3441('0x35')][_0x3441('0x21')]);}_0x40c4eb['order']=qs['sort'](_0x2d8e6f[_0x3441('0x35')]['sort']);_0x40c4eb['where']=qs[_0x3441('0x3f')](_[_0x3441('0x40')](_0x2d8e6f[_0x3441('0x35')],_0x1c9929[_0x3441('0x3f')]));if(_0x2d8e6f[_0x3441('0x35')][_0x3441('0x41')]){_0x40c4eb[_0x3441('0x3e')]=_[_0x3441('0x42')](_0x40c4eb[_0x3441('0x3e')],{'$or':_[_0x3441('0x43')](_0x40c4eb[_0x3441('0x38')],function(_0x51f2d5){var _0x4d7b41={};_0x4d7b41[_0x51f2d5]={'$like':'%'+_0x2d8e6f[_0x3441('0x35')]['filter']+'%'};return _0x4d7b41;})});}_0x40c4eb=_[_0x3441('0x42')]({},_0x40c4eb,_0x2d8e6f[_0x3441('0x4c')]);var _0x586ebb={'where':_0x40c4eb[_0x3441('0x3e')]};return db[_0x3441('0x30')][_0x3441('0x45')](_0x586ebb)['then'](function(_0x2621f2){_0x3eec5e[_0x3441('0x45')]=_0x2621f2;if(_0x2d8e6f['query'][_0x3441('0x46')]){_0x40c4eb[_0x3441('0x47')]=[{'all':!![]}];}return db[_0x3441('0x30')]['findAll'](_0x40c4eb);})[_0x3441('0x2a')](function(_0x5a89fd){_0x3eec5e[_0x3441('0x54')]=_0x5a89fd;return _0x3eec5e;})[_0x3441('0x2a')](respondWithFilteredResult(_0x3a8e7f,_0x40c4eb,_0x3441('0x53')))[_0x3441('0x4e')](handleError(_0x3a8e7f,null,_0x3441('0x53')));};
\ No newline at end of file
+var _0xc2d8=['catch','show','params','keys','options','find','create','body','describe','getVoiceQueuesReport','nolimit','findAll','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','save','update','then','destroy','error','name','send','map','VoiceQueueReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','rows'];(function(_0x321bf2,_0x3d30c5){var _0x473879=function(_0x257700){while(--_0x257700){_0x321bf2['push'](_0x321bf2['shift']());}};_0x473879(++_0x3d30c5);}(_0xc2d8,0x1e6));var _0x8c2d=function(_0x15f037,_0x8b736c){_0x15f037=_0x15f037-0x0;var _0x2a6bc4=_0xc2d8[_0x15f037];return _0x2a6bc4;};'use strict';var emlformat=require(_0x8c2d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8c2d('0x1'));var rp=require(_0x8c2d('0x2'));var moment=require(_0x8c2d('0x3'));var BPromise=require(_0x8c2d('0x4'));var Mustache=require(_0x8c2d('0x5'));var util=require(_0x8c2d('0x6'));var path=require(_0x8c2d('0x7'));var sox=require(_0x8c2d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c2d('0x9'));var _=require(_0x8c2d('0xa'));var squel=require(_0x8c2d('0xb'));var crypto=require(_0x8c2d('0xc'));var jsforce=require(_0x8c2d('0xd'));var deskjs=require(_0x8c2d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8c2d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8c2d('0x10'));var as=require(_0x8c2d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c2d('0x12'))(_0x8c2d('0x13'));var utils=require(_0x8c2d('0x14'));var config=require(_0x8c2d('0x15'));var licenseUtil=require(_0x8c2d('0x16'));var db=require(_0x8c2d('0x17'))['db'];config[_0x8c2d('0x18')]=_['defaults'](config[_0x8c2d('0x18')],{'host':_0x8c2d('0x19'),'port':0x18eb});var socket=require(_0x8c2d('0x1a'))(new Redis(config[_0x8c2d('0x18')]));require(_0x8c2d('0x1b'))[_0x8c2d('0x1c')](socket);function respondWithStatusCode(_0x5b0d9a,_0x3adb23){_0x3adb23=_0x3adb23||0xcc;return function(_0x3291a9){if(_0x3291a9){return _0x5b0d9a[_0x8c2d('0x1d')](_0x3adb23);}return _0x5b0d9a[_0x8c2d('0x1e')](_0x3adb23)[_0x8c2d('0x1f')]();};}function respondWithResult(_0x32e90b,_0x2f869c){_0x2f869c=_0x2f869c||0xc8;return function(_0x25fd7e){if(_0x25fd7e){return _0x32e90b['status'](_0x2f869c)[_0x8c2d('0x20')](_0x25fd7e);}};}function respondWithFilteredResult(_0x38969d,_0x1c0ad9){return function(_0x55b261){if(_0x55b261){var _0x428d81=typeof _0x1c0ad9[_0x8c2d('0x21')]==='undefined'&&typeof _0x1c0ad9[_0x8c2d('0x22')]===_0x8c2d('0x23');var _0x3c45fe=_0x55b261['count'];var _0x44c63f=_0x428d81?0x0:_0x1c0ad9[_0x8c2d('0x21')];var _0x435f70=_0x428d81?_0x55b261[_0x8c2d('0x24')]:_0x1c0ad9[_0x8c2d('0x21')]+_0x1c0ad9[_0x8c2d('0x22')];var _0xf69ce3;if(_0x435f70>=_0x3c45fe){_0x435f70=_0x3c45fe;_0xf69ce3=0xc8;}else{_0xf69ce3=0xce;}_0x38969d[_0x8c2d('0x1e')](_0xf69ce3);return _0x38969d['set'](_0x8c2d('0x25'),_0x44c63f+'-'+_0x435f70+'/'+_0x3c45fe)[_0x8c2d('0x20')](_0x55b261);}return null;};}function patchUpdates(_0x18f27e){return function(_0x485a4c){try{jsonpatch['apply'](_0x485a4c,_0x18f27e,!![]);}catch(_0x35c304){return BPromise['reject'](_0x35c304);}return _0x485a4c[_0x8c2d('0x26')]();};}function saveUpdates(_0x4d0e14,_0x447dbe){return function(_0x463ab1){if(_0x463ab1){return _0x463ab1[_0x8c2d('0x27')](_0x4d0e14)[_0x8c2d('0x28')](function(_0x414fcb){return _0x414fcb;});}return null;};}function removeEntity(_0x1fee51,_0x43b917){return function(_0x3355d5){if(_0x3355d5){return _0x3355d5[_0x8c2d('0x29')]()[_0x8c2d('0x28')](function(){_0x1fee51[_0x8c2d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21c438,_0x17760d){return function(_0x58573c){if(!_0x58573c){_0x21c438['sendStatus'](0x194);}return _0x58573c;};}function handleError(_0x27f512,_0x574867){_0x574867=_0x574867||0x1f4;return function(_0x5943e4){logger[_0x8c2d('0x2a')](_0x5943e4['stack']);if(_0x5943e4[_0x8c2d('0x2b')]){delete _0x5943e4['name'];}_0x27f512[_0x8c2d('0x1e')](_0x574867)[_0x8c2d('0x2c')](_0x5943e4);};}exports['index']=function(_0x581281,_0x47d951){var _0x120564={},_0x3ebe63={},_0x808b7b={'count':0x0,'rows':[]};var _0x3937de=_[_0x8c2d('0x2d')](db[_0x8c2d('0x2e')][_0x8c2d('0x2f')],function(_0x370dfa){return{'name':_0x370dfa[_0x8c2d('0x30')],'type':_0x370dfa[_0x8c2d('0x31')]['key']};});_0x3ebe63[_0x8c2d('0x32')]=_[_0x8c2d('0x2d')](_0x3937de,_0x8c2d('0x2b'));_0x3ebe63[_0x8c2d('0x33')]=_['keys'](_0x581281[_0x8c2d('0x33')]);_0x3ebe63[_0x8c2d('0x34')]=_[_0x8c2d('0x35')](_0x3ebe63[_0x8c2d('0x32')],_0x3ebe63[_0x8c2d('0x33')]);_0x120564[_0x8c2d('0x36')]=_['intersection'](_0x3ebe63[_0x8c2d('0x32')],qs['fields'](_0x581281[_0x8c2d('0x33')][_0x8c2d('0x37')]));_0x120564[_0x8c2d('0x36')]=_0x120564[_0x8c2d('0x36')][_0x8c2d('0x38')]?_0x120564[_0x8c2d('0x36')]:_0x3ebe63[_0x8c2d('0x32')];if(!_0x581281[_0x8c2d('0x33')][_0x8c2d('0x39')]('nolimit')){_0x120564[_0x8c2d('0x22')]=qs[_0x8c2d('0x22')](_0x581281[_0x8c2d('0x33')][_0x8c2d('0x22')]);_0x120564[_0x8c2d('0x21')]=qs['offset'](_0x581281['query'][_0x8c2d('0x21')]);}_0x120564[_0x8c2d('0x3a')]=qs[_0x8c2d('0x3b')](_0x581281[_0x8c2d('0x33')][_0x8c2d('0x3b')]);_0x120564[_0x8c2d('0x3c')]=qs[_0x8c2d('0x34')](_[_0x8c2d('0x3d')](_0x581281[_0x8c2d('0x33')],_0x3ebe63[_0x8c2d('0x34')]),_0x3937de);if(_0x581281['query'][_0x8c2d('0x3e')]){_0x120564['where']=_[_0x8c2d('0x3f')](_0x120564[_0x8c2d('0x3c')],{'$or':_['map'](_0x3937de,function(_0xca8db2){if(_0xca8db2['type']!==_0x8c2d('0x40')){var _0x5479a5={};_0x5479a5[_0xca8db2[_0x8c2d('0x2b')]]={'$like':'%'+_0x581281[_0x8c2d('0x33')][_0x8c2d('0x3e')]+'%'};return _0x5479a5;}})});}_0x120564=_[_0x8c2d('0x3f')]({},_0x120564,_0x581281['options']);var _0xa24920={'where':_0x120564[_0x8c2d('0x3c')]};return db['VoiceQueueReport']['count'](_0xa24920)[_0x8c2d('0x28')](function(_0x163294){_0x808b7b['count']=_0x163294;if(_0x581281[_0x8c2d('0x33')]['includeAll']){_0x120564[_0x8c2d('0x41')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x120564);})[_0x8c2d('0x28')](function(_0x2b1adb){_0x808b7b[_0x8c2d('0x42')]=_0x2b1adb;return _0x808b7b;})['then'](respondWithFilteredResult(_0x47d951,_0x120564))[_0x8c2d('0x43')](handleError(_0x47d951,null));};exports[_0x8c2d('0x44')]=function(_0x34d837,_0x201175){var _0x4f8f77={'raw':![],'where':{'id':_0x34d837[_0x8c2d('0x45')]['id']}},_0x12158d={};_0x12158d[_0x8c2d('0x32')]=_[_0x8c2d('0x46')](db['VoiceQueueReport'][_0x8c2d('0x2f')]);_0x12158d[_0x8c2d('0x33')]=_[_0x8c2d('0x46')](_0x34d837[_0x8c2d('0x33')]);_0x12158d[_0x8c2d('0x34')]=_[_0x8c2d('0x35')](_0x12158d[_0x8c2d('0x32')],_0x12158d[_0x8c2d('0x33')]);_0x4f8f77['attributes']=_[_0x8c2d('0x35')](_0x12158d['model'],qs[_0x8c2d('0x37')](_0x34d837[_0x8c2d('0x33')][_0x8c2d('0x37')]));_0x4f8f77[_0x8c2d('0x36')]=_0x4f8f77[_0x8c2d('0x36')][_0x8c2d('0x38')]?_0x4f8f77[_0x8c2d('0x36')]:_0x12158d[_0x8c2d('0x32')];if(_0x34d837[_0x8c2d('0x33')]['includeAll']){_0x4f8f77[_0x8c2d('0x41')]=[{'all':!![]}];}_0x4f8f77=_[_0x8c2d('0x3f')]({},_0x4f8f77,_0x34d837[_0x8c2d('0x47')]);return db[_0x8c2d('0x2e')][_0x8c2d('0x48')](_0x4f8f77)[_0x8c2d('0x28')](handleEntityNotFound(_0x201175,null))[_0x8c2d('0x28')](respondWithResult(_0x201175,null))[_0x8c2d('0x43')](handleError(_0x201175,null));};exports['create']=function(_0x4070cf,_0x1960f5){return db[_0x8c2d('0x2e')][_0x8c2d('0x49')](_0x4070cf[_0x8c2d('0x4a')],{})[_0x8c2d('0x28')](respondWithResult(_0x1960f5,0xc9))[_0x8c2d('0x43')](handleError(_0x1960f5,null));};exports[_0x8c2d('0x27')]=function(_0x1965f7,_0x4c81a3){if(_0x1965f7['body']['id']){delete _0x1965f7[_0x8c2d('0x4a')]['id'];}return db['VoiceQueueReport'][_0x8c2d('0x48')]({'where':{'id':_0x1965f7[_0x8c2d('0x45')]['id']}})['then'](handleEntityNotFound(_0x4c81a3,null))['then'](saveUpdates(_0x1965f7[_0x8c2d('0x4a')],null))[_0x8c2d('0x28')](respondWithResult(_0x4c81a3,null))[_0x8c2d('0x43')](handleError(_0x4c81a3,null));};exports[_0x8c2d('0x29')]=function(_0x2a113e,_0x571a5c){return db[_0x8c2d('0x2e')][_0x8c2d('0x48')]({'where':{'id':_0x2a113e['params']['id']}})[_0x8c2d('0x28')](handleEntityNotFound(_0x571a5c,null))[_0x8c2d('0x28')](removeEntity(_0x571a5c,null))[_0x8c2d('0x43')](handleError(_0x571a5c,null));};exports['describe']=function(_0xfc90bc,_0x2eb8e2){return db['VoiceQueueReport'][_0x8c2d('0x4b')]()[_0x8c2d('0x28')](respondWithResult(_0x2eb8e2,null))['catch'](handleError(_0x2eb8e2,null));};exports[_0x8c2d('0x4c')]=function(_0x38e97d,_0x3cdaa2){var _0x446bb4={},_0x1f3444={},_0x4f531b={'count':0x0,'rows':[]};_0x1f3444['model']=_[_0x8c2d('0x46')](db['VoiceQueueReport'][_0x8c2d('0x2f')]);_0x1f3444[_0x8c2d('0x33')]=_[_0x8c2d('0x46')](_0x38e97d[_0x8c2d('0x33')]);_0x1f3444[_0x8c2d('0x34')]=_[_0x8c2d('0x35')](_0x1f3444['model'],_0x1f3444[_0x8c2d('0x33')]);_0x446bb4[_0x8c2d('0x36')]=_['intersection'](_0x1f3444[_0x8c2d('0x32')],qs[_0x8c2d('0x37')](_0x38e97d[_0x8c2d('0x33')][_0x8c2d('0x37')]));_0x446bb4[_0x8c2d('0x36')]=_0x446bb4[_0x8c2d('0x36')][_0x8c2d('0x38')]?_0x446bb4[_0x8c2d('0x36')]:_0x1f3444[_0x8c2d('0x32')];if(!_0x38e97d[_0x8c2d('0x33')]['hasOwnProperty'](_0x8c2d('0x4d'))){_0x446bb4[_0x8c2d('0x22')]=qs[_0x8c2d('0x22')](_0x38e97d[_0x8c2d('0x33')][_0x8c2d('0x22')]);_0x446bb4[_0x8c2d('0x21')]=qs[_0x8c2d('0x21')](_0x38e97d[_0x8c2d('0x33')]['offset']);}_0x446bb4['order']=qs['sort'](_0x38e97d[_0x8c2d('0x33')]['sort']);_0x446bb4[_0x8c2d('0x3c')]=qs['filters'](_['pick'](_0x38e97d[_0x8c2d('0x33')],_0x1f3444[_0x8c2d('0x34')]));if(_0x38e97d[_0x8c2d('0x33')][_0x8c2d('0x3e')]){_0x446bb4[_0x8c2d('0x3c')]=_['merge'](_0x446bb4[_0x8c2d('0x3c')],{'$or':_['map'](_0x446bb4['attributes'],function(_0x1c652f){var _0x1dbb09={};_0x1dbb09[_0x1c652f]={'$like':'%'+_0x38e97d[_0x8c2d('0x33')][_0x8c2d('0x3e')]+'%'};return _0x1dbb09;})});}_0x446bb4=_[_0x8c2d('0x3f')]({},_0x446bb4,_0x38e97d[_0x8c2d('0x47')]);var _0x204400={'where':_0x446bb4['where']};return db['VoiceQueueReport'][_0x8c2d('0x24')](_0x204400)[_0x8c2d('0x28')](function(_0x5c6d7e){_0x4f531b[_0x8c2d('0x24')]=_0x5c6d7e;if(_0x38e97d[_0x8c2d('0x33')]['includeAll']){_0x446bb4[_0x8c2d('0x41')]=[{'all':!![]}];}return db[_0x8c2d('0x2e')][_0x8c2d('0x4e')](_0x446bb4);})[_0x8c2d('0x28')](function(_0x585e9b){_0x4f531b['rows']=_0x585e9b;return _0x4f531b;})['then'](respondWithFilteredResult(_0x3cdaa2,_0x446bb4,_0x8c2d('0x4c')))['catch'](handleError(_0x3cdaa2,null,_0x8c2d('0x4c')));};
\ No newline at end of file
index 401e017..d4be773 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd210=['hook','exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x294803,_0x4565e3){var _0x5ddf5a=function(_0x36707b){while(--_0x36707b){_0x294803['push'](_0x294803['shift']());}};_0x5ddf5a(++_0x4565e3);}(_0xd210,0x1b2));var _0x0d21=function(_0x22ee1e,_0x3eff80){_0x22ee1e=_0x22ee1e-0x0;var _0x49a5c9=_0xd210[_0x22ee1e];return _0x49a5c9;};'use strict';var EventEmitter=require(_0x0d21('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x0d21('0x1')](0x0);var events={'afterCreate':_0x0d21('0x2'),'afterUpdate':_0x0d21('0x3'),'afterDestroy':_0x0d21('0x4')};function emitEvent(_0x20ba4a){return function(_0x8c81e2,_0x1c5fd4,_0x1e8f3b){VoiceQueueReportEvents[_0x0d21('0x5')](_0x20ba4a+':'+_0x8c81e2['id'],_0x8c81e2);VoiceQueueReportEvents[_0x0d21('0x5')](_0x20ba4a,_0x8c81e2);_0x1e8f3b(null);};}for(var e in events){if(events[_0x0d21('0x6')](e)){var event=events[e];VoiceQueueReport[_0x0d21('0x7')](e,emitEvent(event));}}module[_0x0d21('0x8')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0x2922=['events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x54b283,_0x5eb8a6){var _0x2462b3=function(_0x13fca7){while(--_0x13fca7){_0x54b283['push'](_0x54b283['shift']());}};_0x2462b3(++_0x5eb8a6);}(_0x2922,0x154));var _0x2292=function(_0x22c470,_0x373fcb){_0x22c470=_0x22c470-0x0;var _0x54f923=_0x2922[_0x22c470];return _0x54f923;};'use strict';var EventEmitter=require(_0x2292('0x0'));var VoiceQueueReport=require(_0x2292('0x1'))['db'][_0x2292('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x2292('0x3')](0x0);var events={'afterCreate':_0x2292('0x4'),'afterUpdate':_0x2292('0x5'),'afterDestroy':_0x2292('0x6')};function emitEvent(_0x25288e){return function(_0x36196f,_0x94f588,_0x45129d){VoiceQueueReportEvents[_0x2292('0x7')](_0x25288e+':'+_0x36196f['id'],_0x36196f);VoiceQueueReportEvents['emit'](_0x25288e,_0x36196f);_0x45129d(null);};}for(var e in events){if(events[_0x2292('0x8')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x2292('0x9')]=VoiceQueueReportEvents;
\ No newline at end of file
index 63cb383..b60416c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4e2=['rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','request-promise'];(function(_0x7780ec,_0x175888){var _0x4de7ac=function(_0x4202e1){while(--_0x4202e1){_0x7780ec['push'](_0x7780ec['shift']());}};_0x4de7ac(++_0x175888);}(_0xc4e2,0x1c9));var _0x2c4e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc4e2[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x2c4e('0x0'));var util=require(_0x2c4e('0x1'));var logger=require(_0x2c4e('0x2'))(_0x2c4e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2c4e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2c4e('0x5'));var config=require(_0x2c4e('0x6'));var attributes=require(_0x2c4e('0x7'));module[_0x2c4e('0x8')]=function(_0x26bcb5,_0xb6ed5d){return _0x26bcb5[_0x2c4e('0x9')](_0x2c4e('0xa'),attributes,{'tableName':_0x2c4e('0xb'),'paranoid':![],'indexes':[{'fields':[_0x2c4e('0xc')]},{'fields':[_0x2c4e('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1299=['../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceQueueReport.attributes','exports','uniqueid','lodash','util'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x1299,0xc4));var _0x9129=function(_0x2742c7,_0x552c52){_0x2742c7=_0x2742c7-0x0;var _0x4bb29a=_0x1299[_0x2742c7];return _0x4bb29a;};'use strict';var _=require(_0x9129('0x0'));var util=require(_0x9129('0x1'));var logger=require(_0x9129('0x2'))(_0x9129('0x3'));var moment=require('moment');var BPromise=require(_0x9129('0x4'));var rp=require(_0x9129('0x5'));var fs=require('fs');var path=require(_0x9129('0x6'));var rimraf=require(_0x9129('0x7'));var config=require('../../config/environment');var attributes=require(_0x9129('0x8'));module[_0x9129('0x9')]=function(_0x204b71,_0x4a0069){return _0x204b71['define']('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x9129('0xa')]},{'fields':['calleridnum']}],'timestamps':!![]});};
\ No newline at end of file
index 60dd2ce..2236eba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f58=['attributes','limit','map','include','model','debug','CreateVoiceQueueReport','create','body','update','raw','UpdateVoiceQueueReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where'];(function(_0x267bfd,_0x4d699a){var _0x4c8719=function(_0x4caafa){while(--_0x4caafa){_0x267bfd['push'](_0x267bfd['shift']());}};_0x4c8719(++_0x4d699a);}(_0x5f58,0x1cf));var _0x85f5=function(_0x1f32cb,_0x10774e){_0x1f32cb=_0x1f32cb-0x0;var _0xff2722=_0x5f58[_0x1f32cb];return _0xff2722;};'use strict';var _=require(_0x85f5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x85f5('0x1'));var rs=require(_0x85f5('0x2'));var fs=require('fs');var Redis=require(_0x85f5('0x3'));var db=require(_0x85f5('0x4'))['db'];var utils=require(_0x85f5('0x5'));var logger=require(_0x85f5('0x6'))('rpc');var config=require(_0x85f5('0x7'));var jayson=require(_0x85f5('0x8'));var client=jayson[_0x85f5('0x9')]['http']({'port':0x232a});config[_0x85f5('0xa')]=_[_0x85f5('0xb')](config[_0x85f5('0xa')],{'host':_0x85f5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85f5('0xa')]));require('./voiceQueueReport.socket')[_0x85f5('0xd')](socket);function respondWithRpcPromise(_0x5b5e74,_0x6a14f1,_0xf32d4b){return new BPromise(function(_0x33115b,_0xd51ce3){return client['request'](_0x5b5e74,_0xf32d4b)[_0x85f5('0xe')](function(_0x128040){logger[_0x85f5('0xf')](_0x85f5('0x10'),_0x6a14f1,_0x85f5('0x11'));logger['debug'](_0x85f5('0x12'),_0x6a14f1,'request\x20sent',JSON[_0x85f5('0x13')](_0x128040));if(_0x128040[_0x85f5('0x14')]){if(_0x128040[_0x85f5('0x14')][_0x85f5('0x15')]===0x1f4){logger[_0x85f5('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x6a14f1,_0x128040[_0x85f5('0x14')]['message']);return _0xd51ce3(_0x128040[_0x85f5('0x14')][_0x85f5('0x16')]);}logger[_0x85f5('0x14')](_0x85f5('0x10'),_0x6a14f1,_0x128040[_0x85f5('0x14')][_0x85f5('0x16')]);return _0x33115b(_0x128040['error'][_0x85f5('0x16')]);}else{logger['info'](_0x85f5('0x10'),_0x6a14f1,_0x85f5('0x11'));_0x33115b(_0x128040['result'][_0x85f5('0x16')]);}})[_0x85f5('0x17')](function(_0x127ffa){logger[_0x85f5('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x6a14f1,_0x127ffa);_0xd51ce3(_0x127ffa);});});}exports[_0x85f5('0x18')]=function(_0x39cb09){var _0x1a51f2=this;return new Promise(function(_0x5e5db2,_0xe0f586){return db[_0x85f5('0x19')][_0x85f5('0x1a')]({'raw':_0x39cb09[_0x85f5('0x1b')]?_0x39cb09[_0x85f5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x39cb09[_0x85f5('0x1b')]?_0x39cb09['options'][_0x85f5('0x1c')]||null:null,'attributes':_0x39cb09[_0x85f5('0x1b')]?_0x39cb09['options'][_0x85f5('0x1d')]||null:null,'limit':_0x39cb09['options']?_0x39cb09[_0x85f5('0x1b')][_0x85f5('0x1e')]||null:null,'include':_0x39cb09[_0x85f5('0x1b')]?_0x39cb09[_0x85f5('0x1b')]['include']?_[_0x85f5('0x1f')](_0x39cb09['options'][_0x85f5('0x20')],function(_0x55d277){return{'model':db[_0x55d277[_0x85f5('0x21')]],'as':_0x55d277['as'],'attributes':_0x55d277[_0x85f5('0x1d')],'include':_0x55d277[_0x85f5('0x20')]?_[_0x85f5('0x1f')](_0x55d277['include'],function(_0x1771a6){return{'model':db[_0x1771a6[_0x85f5('0x21')]],'as':_0x1771a6['as'],'attributes':_0x1771a6[_0x85f5('0x1d')],'include':_0x1771a6['include']?_[_0x85f5('0x1f')](_0x1771a6[_0x85f5('0x20')],function(_0x3ed176){return{'model':db[_0x3ed176[_0x85f5('0x21')]],'as':_0x3ed176['as'],'attributes':_0x3ed176[_0x85f5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x85f5('0xe')](function(_0xfa8ba9){logger['info'](_0x85f5('0x18'),_0x39cb09);logger[_0x85f5('0x22')]('GetVoiceQueueReport',_0x39cb09,JSON[_0x85f5('0x13')](_0xfa8ba9));_0x5e5db2(_0xfa8ba9);})[_0x85f5('0x17')](function(_0x393f18){logger[_0x85f5('0x14')]('GetVoiceQueueReport',_0x393f18[_0x85f5('0x16')],_0x39cb09);_0xe0f586(_0x1a51f2[_0x85f5('0x14')](0x1f4,_0x393f18[_0x85f5('0x16')]));});});};exports[_0x85f5('0x23')]=function(_0x48a210){var _0x5f18f8=this;return new Promise(function(_0x5bc2e8,_0x180ee3){return db[_0x85f5('0x19')][_0x85f5('0x24')](_0x48a210[_0x85f5('0x25')],{'raw':_0x48a210[_0x85f5('0x1b')]?_0x48a210['options']['raw']===undefined?!![]:![]:!![]})[_0x85f5('0xe')](function(_0x5c683b){logger[_0x85f5('0xf')](_0x85f5('0x23'),_0x48a210);logger[_0x85f5('0x22')]('CreateVoiceQueueReport',_0x48a210,JSON['stringify'](_0x5c683b));_0x5bc2e8(_0x5c683b);})[_0x85f5('0x17')](function(_0x230ba5){logger[_0x85f5('0x14')](_0x85f5('0x23'),_0x230ba5[_0x85f5('0x16')],_0x48a210);_0x180ee3(_0x5f18f8[_0x85f5('0x14')](0x1f4,_0x230ba5[_0x85f5('0x16')]));});});};exports['UpdateVoiceQueueReport']=function(_0x45201d){var _0x596c4b=this;return new Promise(function(_0x20e81a,_0x3a7c4c){return db[_0x85f5('0x19')][_0x85f5('0x26')](_0x45201d[_0x85f5('0x25')],{'raw':_0x45201d[_0x85f5('0x1b')]?_0x45201d[_0x85f5('0x1b')][_0x85f5('0x27')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45201d[_0x85f5('0x1b')]?_0x45201d[_0x85f5('0x1b')][_0x85f5('0x1c')]||null:null,'attributes':_0x45201d[_0x85f5('0x1b')]?_0x45201d[_0x85f5('0x1b')][_0x85f5('0x1d')]||null:null,'limit':_0x45201d[_0x85f5('0x1b')]?_0x45201d[_0x85f5('0x1b')][_0x85f5('0x1e')]||null:null})[_0x85f5('0xe')](function(_0xe29ffe){logger[_0x85f5('0xf')](_0x85f5('0x28'),_0x45201d);logger[_0x85f5('0x22')](_0x85f5('0x28'),_0x45201d,JSON[_0x85f5('0x13')](_0xe29ffe));_0x20e81a(_0xe29ffe);})[_0x85f5('0x17')](function(_0x4545b8){logger[_0x85f5('0x14')](_0x85f5('0x28'),_0x4545b8[_0x85f5('0x16')],_0x45201d);_0x3a7c4c(_0x596c4b[_0x85f5('0x14')](0x1f4,_0x4545b8['message']));});});};
\ No newline at end of file
+var _0x3dc3=['jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','limit','include','model','map','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x311000,_0x492eab){var _0x4de11b=function(_0x5b6ecc){while(--_0x5b6ecc){_0x311000['push'](_0x311000['shift']());}};_0x4de11b(++_0x492eab);}(_0x3dc3,0x195));var _0x33dc=function(_0x8e6272,_0x2e8697){_0x8e6272=_0x8e6272-0x0;var _0x226368=_0x3dc3[_0x8e6272];return _0x226368;};'use strict';var _=require(_0x33dc('0x0'));var util=require(_0x33dc('0x1'));var moment=require('moment');var BPromise=require(_0x33dc('0x2'));var rs=require(_0x33dc('0x3'));var fs=require('fs');var Redis=require(_0x33dc('0x4'));var db=require(_0x33dc('0x5'))['db'];var utils=require(_0x33dc('0x6'));var logger=require(_0x33dc('0x7'))('rpc');var config=require(_0x33dc('0x8'));var jayson=require(_0x33dc('0x9'));var client=jayson[_0x33dc('0xa')][_0x33dc('0xb')]({'port':0x232a});config['redis']=_[_0x33dc('0xc')](config[_0x33dc('0xd')],{'host':_0x33dc('0xe'),'port':0x18eb});var socket=require(_0x33dc('0xf'))(new Redis(config[_0x33dc('0xd')]));require(_0x33dc('0x10'))['register'](socket);function respondWithRpcPromise(_0x2453ca,_0x22273f,_0x13ff90){return new BPromise(function(_0x4fb6a9,_0x39db52){return client[_0x33dc('0x11')](_0x2453ca,_0x13ff90)[_0x33dc('0x12')](function(_0x5bfb5c){logger[_0x33dc('0x13')](_0x33dc('0x14'),_0x22273f,_0x33dc('0x15'));logger[_0x33dc('0x16')](_0x33dc('0x17'),_0x22273f,'request\x20sent',JSON[_0x33dc('0x18')](_0x5bfb5c));if(_0x5bfb5c[_0x33dc('0x19')]){if(_0x5bfb5c['error'][_0x33dc('0x1a')]===0x1f4){logger['error'](_0x33dc('0x14'),_0x22273f,_0x5bfb5c['error'][_0x33dc('0x1b')]);return _0x39db52(_0x5bfb5c[_0x33dc('0x19')][_0x33dc('0x1b')]);}logger['error'](_0x33dc('0x14'),_0x22273f,_0x5bfb5c[_0x33dc('0x19')][_0x33dc('0x1b')]);return _0x4fb6a9(_0x5bfb5c[_0x33dc('0x19')][_0x33dc('0x1b')]);}else{logger[_0x33dc('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x22273f,_0x33dc('0x15'));_0x4fb6a9(_0x5bfb5c[_0x33dc('0x1c')][_0x33dc('0x1b')]);}})[_0x33dc('0x1d')](function(_0x8e634c){logger[_0x33dc('0x19')](_0x33dc('0x14'),_0x22273f,_0x8e634c);_0x39db52(_0x8e634c);});});}exports[_0x33dc('0x1e')]=function(_0x46b849){var _0x195cf0=this;return new Promise(function(_0x25812b,_0x27f75f){return db[_0x33dc('0x1f')][_0x33dc('0x20')]({'raw':_0x46b849[_0x33dc('0x21')]?_0x46b849[_0x33dc('0x21')][_0x33dc('0x22')]===undefined?!![]:![]:!![],'where':_0x46b849[_0x33dc('0x21')]?_0x46b849[_0x33dc('0x21')]['where']||null:null,'attributes':_0x46b849[_0x33dc('0x21')]?_0x46b849[_0x33dc('0x21')][_0x33dc('0x23')]||null:null,'limit':_0x46b849[_0x33dc('0x21')]?_0x46b849[_0x33dc('0x21')][_0x33dc('0x24')]||null:null,'include':_0x46b849[_0x33dc('0x21')]?_0x46b849[_0x33dc('0x21')][_0x33dc('0x25')]?_['map'](_0x46b849[_0x33dc('0x21')][_0x33dc('0x25')],function(_0x100a57){return{'model':db[_0x100a57[_0x33dc('0x26')]],'as':_0x100a57['as'],'attributes':_0x100a57[_0x33dc('0x23')],'include':_0x100a57[_0x33dc('0x25')]?_['map'](_0x100a57[_0x33dc('0x25')],function(_0x1e2cdd){return{'model':db[_0x1e2cdd[_0x33dc('0x26')]],'as':_0x1e2cdd['as'],'attributes':_0x1e2cdd[_0x33dc('0x23')],'include':_0x1e2cdd[_0x33dc('0x25')]?_[_0x33dc('0x27')](_0x1e2cdd['include'],function(_0xd6764){return{'model':db[_0xd6764[_0x33dc('0x26')]],'as':_0xd6764['as'],'attributes':_0xd6764['attributes']};}):[]};}):[]};}):[]:[]})[_0x33dc('0x12')](function(_0x56501b){logger['info']('GetVoiceQueueReport',_0x46b849);logger[_0x33dc('0x16')]('GetVoiceQueueReport',_0x46b849,JSON[_0x33dc('0x18')](_0x56501b));_0x25812b(_0x56501b);})['catch'](function(_0x38545d){logger['error'](_0x33dc('0x1e'),_0x38545d['message'],_0x46b849);_0x27f75f(_0x195cf0[_0x33dc('0x19')](0x1f4,_0x38545d['message']));});});};exports['CreateVoiceQueueReport']=function(_0xe471d2){var _0x10c917=this;return new Promise(function(_0x1d6e24,_0x5ee8db){return db[_0x33dc('0x1f')][_0x33dc('0x28')](_0xe471d2[_0x33dc('0x29')],{'raw':_0xe471d2[_0x33dc('0x21')]?_0xe471d2['options'][_0x33dc('0x22')]===undefined?!![]:![]:!![]})[_0x33dc('0x12')](function(_0x167937){logger['info']('CreateVoiceQueueReport',_0xe471d2);logger[_0x33dc('0x16')](_0x33dc('0x2a'),_0xe471d2,JSON['stringify'](_0x167937));_0x1d6e24(_0x167937);})[_0x33dc('0x1d')](function(_0x3cd406){logger['error'](_0x33dc('0x2a'),_0x3cd406[_0x33dc('0x1b')],_0xe471d2);_0x5ee8db(_0x10c917[_0x33dc('0x19')](0x1f4,_0x3cd406[_0x33dc('0x1b')]));});});};exports[_0x33dc('0x2b')]=function(_0x51e287){var _0x53a35c=this;return new Promise(function(_0x3c4d78,_0x50094a){return db[_0x33dc('0x1f')][_0x33dc('0x2c')](_0x51e287[_0x33dc('0x29')],{'raw':_0x51e287['options']?_0x51e287[_0x33dc('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51e287[_0x33dc('0x21')]?_0x51e287[_0x33dc('0x21')][_0x33dc('0x2d')]||null:null,'attributes':_0x51e287[_0x33dc('0x21')]?_0x51e287[_0x33dc('0x21')][_0x33dc('0x23')]||null:null,'limit':_0x51e287[_0x33dc('0x21')]?_0x51e287[_0x33dc('0x21')][_0x33dc('0x24')]||null:null})['then'](function(_0x1567ae){logger['info'](_0x33dc('0x2b'),_0x51e287);logger[_0x33dc('0x16')](_0x33dc('0x2b'),_0x51e287,JSON[_0x33dc('0x18')](_0x1567ae));_0x3c4d78(_0x1567ae);})[_0x33dc('0x1d')](function(_0x133162){logger[_0x33dc('0x19')](_0x33dc('0x2b'),_0x133162[_0x33dc('0x1b')],_0x51e287);_0x50094a(_0x53a35c[_0x33dc('0x19')](0x1f4,_0x133162[_0x33dc('0x1b')]));});});};
\ No newline at end of file
index 7f87515..0574c7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf569=['update','emit','removeListener','length','voiceQueueReport:','save','remove'];(function(_0x329968,_0x2d851a){var _0x35fe01=function(_0x4e2492){while(--_0x4e2492){_0x329968['push'](_0x329968['shift']());}};_0x35fe01(++_0x2d851a);}(_0xf569,0xd0));var _0x9f56=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xf569[_0x20589d];return _0x422de9;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x9f56('0x0'),_0x9f56('0x1'),_0x9f56('0x2')];function createListener(_0x9c192,_0x45b196){return function(_0x4466ac){_0x45b196[_0x9f56('0x3')](_0x9c192,_0x4466ac);};}function removeListener(_0x6d506b,_0x5bc3e8){return function(){VoiceQueueReportEvents[_0x9f56('0x4')](_0x6d506b,_0x5bc3e8);};}exports['register']=function(_0x467a46){for(var _0x3488f2=0x0,_0x5c5e5f=events[_0x9f56('0x5')];_0x3488f2<_0x5c5e5f;_0x3488f2++){var _0x73c3b4=events[_0x3488f2];var _0x5980f2=createListener(_0x9f56('0x6')+_0x73c3b4,_0x467a46);VoiceQueueReportEvents['on'](_0x73c3b4,_0x5980f2);}};
\ No newline at end of file
+var _0xd9c8=['./voiceQueueReport.events','save','update','emit','length','voiceQueueReport:'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd9c8,0x15c));var _0x8d9c=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xd9c8[_0x2b4411];return _0x8e41ef;};'use strict';var VoiceQueueReportEvents=require(_0x8d9c('0x0'));var events=[_0x8d9c('0x1'),'remove',_0x8d9c('0x2')];function createListener(_0x240e64,_0x2140c9){return function(_0xaecd58){_0x2140c9[_0x8d9c('0x3')](_0x240e64,_0xaecd58);};}function removeListener(_0x376ce5,_0xa7b017){return function(){VoiceQueueReportEvents['removeListener'](_0x376ce5,_0xa7b017);};}exports['register']=function(_0x53567f){for(var _0x2c083c=0x0,_0x1ebb5a=events[_0x8d9c('0x4')];_0x2c083c<_0x1ebb5a;_0x2c083c++){var _0x49c96f=events[_0x2c083c];var _0x3790f6=createListener(_0x8d9c('0x5')+_0x49c96f,_0x53567f);VoiceQueueReportEvents['on'](_0x49c96f,_0x3790f6);}};
\ No newline at end of file
index d576070..83eed39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68c5=['post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show'];(function(_0x580d51,_0x19370c){var _0x5545cf=function(_0x48d802){while(--_0x48d802){_0x580d51['push'](_0x580d51['shift']());}};_0x5545cf(++_0x19370c);}(_0x68c5,0x136));var _0x568c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x68c5[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x568c('0x0'));var util=require('util');var path=require(_0x568c('0x1'));var timeout=require(_0x568c('0x2'));var express=require(_0x568c('0x3'));var router=express[_0x568c('0x4')]();var fs_extra=require(_0x568c('0x5'));var auth=require(_0x568c('0x6'));var interaction=require(_0x568c('0x7'));var config=require(_0x568c('0x8'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0x568c('0x9')](),controller['index']);router[_0x568c('0xa')](_0x568c('0xb'),auth[_0x568c('0x9')](),controller[_0x568c('0xc')]);router[_0x568c('0xd')]('/',auth['isAuthenticated'](),controller[_0x568c('0xe')]);router[_0x568c('0xf')]('/:id',auth[_0x568c('0x9')](),controller[_0x568c('0x10')]);router[_0x568c('0x11')](_0x568c('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x568c('0x12')]=router;
\ No newline at end of file
+var _0x8d3e=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','index','/:id','isAuthenticated','create','put','update','delete'];(function(_0x185334,_0x4630ac){var _0xf2e59a=function(_0x3cc497){while(--_0x3cc497){_0x185334['push'](_0x185334['shift']());}};_0xf2e59a(++_0x4630ac);}(_0x8d3e,0x1ce));var _0xe8d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d3e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe8d3('0x0'));var util=require('util');var path=require(_0xe8d3('0x1'));var timeout=require(_0xe8d3('0x2'));var express=require(_0xe8d3('0x3'));var router=express[_0xe8d3('0x4')]();var fs_extra=require(_0xe8d3('0x5'));var auth=require(_0xe8d3('0x6'));var interaction=require(_0xe8d3('0x7'));var config=require(_0xe8d3('0x8'));var controller=require(_0xe8d3('0x9'));router[_0xe8d3('0xa')]('/',auth['isAuthenticated'](),controller[_0xe8d3('0xb')]);router['get'](_0xe8d3('0xc'),auth[_0xe8d3('0xd')](),controller['show']);router['post']('/',auth[_0xe8d3('0xd')](),controller[_0xe8d3('0xe')]);router[_0xe8d3('0xf')]('/:id',auth[_0xe8d3('0xd')](),controller[_0xe8d3('0x10')]);router[_0xe8d3('0x11')]('/:id',auth[_0xe8d3('0xd')](),controller[_0xe8d3('0x12')]);module[_0xe8d3('0x13')]=router;
\ No newline at end of file
index f66a9eb..42c5fe5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3446=['STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x3446,0xbc));var _0x6344=function(_0x39b997,_0x23a73a){_0x39b997=_0x39b997-0x0;var _0x33e8e1=_0x3446[_0x39b997];return _0x33e8e1;};'use strict';var Sequelize=require(_0x6344('0x0'));var moment=require(_0x6344('0x1'));module['exports']={'time':{'type':Sequelize[_0x6344('0x2')]},'callid':{'type':Sequelize[_0x6344('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x6344('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x6344('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x6344('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x6344('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x6344('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x6344('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x6344('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x6344('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x6344('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0x6344('0x4'))}};
\ No newline at end of file
+var _0xee2f=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports'];(function(_0x125c6f,_0x2c21c6){var _0x10d168=function(_0x22c69b){while(--_0x22c69b){_0x125c6f['push'](_0x125c6f['shift']());}};_0x10d168(++_0x2c21c6);}(_0xee2f,0x11c));var _0xfee2=function(_0x45bfe5,_0xb13003){_0x45bfe5=_0x45bfe5-0x0;var _0x7592ac=_0xee2f[_0x45bfe5];return _0x7592ac;};'use strict';var Sequelize=require(_0xfee2('0x0'));var moment=require(_0xfee2('0x1'));module[_0xfee2('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xfee2('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xfee2('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xfee2('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xfee2('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xfee2('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xfee2('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xfee2('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xfee2('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xfee2('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xfee2('0x4')],'allowNull':![],'defaultValue':moment()[_0xfee2('0x5')](_0xfee2('0x6'))}};
\ No newline at end of file
index 4ea3201..438201d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b33=['mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','end','sendStatus','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','type','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','destroy','rimraf','fast-json-patch','moment','bluebird'];(function(_0x1b1839,_0x14d141){var _0x37e3ec=function(_0x2eb94){while(--_0x2eb94){_0x1b1839['push'](_0x1b1839['shift']());}};_0x37e3ec(++_0x14d141);}(_0x6b33,0xd4));var _0x36b3=function(_0x4c28f6,_0x3bbaf7){_0x4c28f6=_0x4c28f6-0x0;var _0x9bec5b=_0x6b33[_0x4c28f6];return _0x9bec5b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x36b3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x36b3('0x1'));var rp=require('request-promise');var moment=require(_0x36b3('0x2'));var BPromise=require(_0x36b3('0x3'));var Mustache=require(_0x36b3('0x4'));var util=require(_0x36b3('0x5'));var path=require('path');var sox=require(_0x36b3('0x6'));var csv=require(_0x36b3('0x7'));var ejs=require(_0x36b3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x36b3('0x9'));var crypto=require(_0x36b3('0xa'));var jsforce=require(_0x36b3('0xb'));var deskjs=require(_0x36b3('0xc'));var toCsv=require(_0x36b3('0x7'));var querystring=require(_0x36b3('0xd'));var Papa=require(_0x36b3('0xe'));var Redis=require(_0x36b3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x36b3('0x10'));var as=require(_0x36b3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x36b3('0x12'))(_0x36b3('0x13'));var utils=require('../../config/utils');var config=require(_0x36b3('0x14'));var licenseUtil=require(_0x36b3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4560d9,_0x36e80e){_0x36e80e=_0x36e80e||0xcc;return function(_0x197915){if(_0x197915){return _0x4560d9['sendStatus'](_0x36e80e);}return _0x4560d9[_0x36b3('0x16')](_0x36e80e)['end']();};}function respondWithResult(_0x21396e,_0x5e9b68){_0x5e9b68=_0x5e9b68||0xc8;return function(_0x412e3d){if(_0x412e3d){return _0x21396e[_0x36b3('0x16')](_0x5e9b68)[_0x36b3('0x17')](_0x412e3d);}};}function respondWithFilteredResult(_0x101e7d,_0xa4d9e9){return function(_0xaedde1){if(_0xaedde1){var _0x1d4b35=typeof _0xa4d9e9[_0x36b3('0x18')]===_0x36b3('0x19')&&typeof _0xa4d9e9[_0x36b3('0x1a')]===_0x36b3('0x19');var _0x2f0d34=_0xaedde1[_0x36b3('0x1b')];var _0x2f12b5=_0x1d4b35?0x0:_0xa4d9e9[_0x36b3('0x18')];var _0x3f1e54=_0x1d4b35?_0xaedde1[_0x36b3('0x1b')]:_0xa4d9e9[_0x36b3('0x18')]+_0xa4d9e9[_0x36b3('0x1a')];var _0x59f972;if(_0x3f1e54>=_0x2f0d34){_0x3f1e54=_0x2f0d34;_0x59f972=0xc8;}else{_0x59f972=0xce;}_0x101e7d['status'](_0x59f972);return _0x101e7d['set'](_0x36b3('0x1c'),_0x2f12b5+'-'+_0x3f1e54+'/'+_0x2f0d34)[_0x36b3('0x17')](_0xaedde1);}return null;};}function patchUpdates(_0x530e16){return function(_0xc5a503){try{jsonpatch[_0x36b3('0x1d')](_0xc5a503,_0x530e16,!![]);}catch(_0x3a451b){return BPromise[_0x36b3('0x1e')](_0x3a451b);}return _0xc5a503['save']();};}function saveUpdates(_0x234ff0,_0x5d359e){return function(_0x4564c0){if(_0x4564c0){return _0x4564c0[_0x36b3('0x1f')](_0x234ff0)[_0x36b3('0x20')](function(_0x34d392){return _0x34d392;});}return null;};}function removeEntity(_0xa3a758,_0x45cf29){return function(_0x2170c5){if(_0x2170c5){return _0x2170c5['destroy']()[_0x36b3('0x20')](function(){_0xa3a758[_0x36b3('0x16')](0xcc)[_0x36b3('0x21')]();});}};}function handleEntityNotFound(_0xf74f0f,_0x2bf453){return function(_0xe85061){if(!_0xe85061){_0xf74f0f[_0x36b3('0x22')](0x194);}return _0xe85061;};}function handleError(_0x5817b4,_0x27105e){_0x27105e=_0x27105e||0x1f4;return function(_0x3c2bf4){logger[_0x36b3('0x23')](_0x3c2bf4[_0x36b3('0x24')]);if(_0x3c2bf4[_0x36b3('0x25')]){delete _0x3c2bf4['name'];}_0x5817b4['status'](_0x27105e)[_0x36b3('0x26')](_0x3c2bf4);};}exports[_0x36b3('0x27')]=function(_0x5c680a,_0x4a4106){var _0x298907={},_0x1fec91={},_0x3fe8d4={'count':0x0,'rows':[]};var _0xe6d8a7=_[_0x36b3('0x28')](db[_0x36b3('0x29')][_0x36b3('0x2a')],function(_0x13a416){return{'name':_0x13a416['fieldName'],'type':_0x13a416[_0x36b3('0x2b')]['key']};});_0x1fec91['model']=_[_0x36b3('0x28')](_0xe6d8a7,_0x36b3('0x25'));_0x1fec91['query']=_[_0x36b3('0x2c')](_0x5c680a[_0x36b3('0x2d')]);_0x1fec91[_0x36b3('0x2e')]=_[_0x36b3('0x2f')](_0x1fec91['model'],_0x1fec91['query']);_0x298907['attributes']=_[_0x36b3('0x2f')](_0x1fec91[_0x36b3('0x30')],qs[_0x36b3('0x31')](_0x5c680a[_0x36b3('0x2d')][_0x36b3('0x31')]));_0x298907[_0x36b3('0x32')]=_0x298907[_0x36b3('0x32')][_0x36b3('0x33')]?_0x298907['attributes']:_0x1fec91[_0x36b3('0x30')];if(!_0x5c680a['query']['hasOwnProperty'](_0x36b3('0x34'))){_0x298907['limit']=qs[_0x36b3('0x1a')](_0x5c680a[_0x36b3('0x2d')]['limit']);_0x298907[_0x36b3('0x18')]=qs[_0x36b3('0x18')](_0x5c680a['query'][_0x36b3('0x18')]);}_0x298907[_0x36b3('0x35')]=qs[_0x36b3('0x36')](_0x5c680a[_0x36b3('0x2d')][_0x36b3('0x36')]);_0x298907[_0x36b3('0x37')]=qs[_0x36b3('0x2e')](_[_0x36b3('0x38')](_0x5c680a[_0x36b3('0x2d')],_0x1fec91[_0x36b3('0x2e')]),_0xe6d8a7);if(_0x5c680a[_0x36b3('0x2d')][_0x36b3('0x39')]){_0x298907[_0x36b3('0x37')]=_[_0x36b3('0x3a')](_0x298907[_0x36b3('0x37')],{'$or':_[_0x36b3('0x28')](_0xe6d8a7,function(_0x1df4b0){if(_0x1df4b0[_0x36b3('0x2b')]!==_0x36b3('0x3b')){var _0x4cc09a={};_0x4cc09a[_0x1df4b0['name']]={'$like':'%'+_0x5c680a[_0x36b3('0x2d')]['filter']+'%'};return _0x4cc09a;}})});}_0x298907=_['merge']({},_0x298907,_0x5c680a[_0x36b3('0x3c')]);var _0x1471ca={'where':_0x298907[_0x36b3('0x37')]};return db['VoiceQueuesLog'][_0x36b3('0x1b')](_0x1471ca)['then'](function(_0x442e65){_0x3fe8d4[_0x36b3('0x1b')]=_0x442e65;if(_0x5c680a[_0x36b3('0x2d')][_0x36b3('0x3d')]){_0x298907[_0x36b3('0x3e')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x36b3('0x3f')](_0x298907);})['then'](function(_0x4b66e4){_0x3fe8d4[_0x36b3('0x40')]=_0x4b66e4;return _0x3fe8d4;})[_0x36b3('0x20')](respondWithFilteredResult(_0x4a4106,_0x298907))['catch'](handleError(_0x4a4106,null));};exports[_0x36b3('0x41')]=function(_0x2632b4,_0x2b3088){var _0x417b2e={'raw':!![],'where':{'id':_0x2632b4[_0x36b3('0x42')]['id']}},_0x31e7a8={};_0x31e7a8[_0x36b3('0x30')]=_[_0x36b3('0x2c')](db[_0x36b3('0x29')][_0x36b3('0x2a')]);_0x31e7a8[_0x36b3('0x2d')]=_[_0x36b3('0x2c')](_0x2632b4[_0x36b3('0x2d')]);_0x31e7a8[_0x36b3('0x2e')]=_[_0x36b3('0x2f')](_0x31e7a8[_0x36b3('0x30')],_0x31e7a8[_0x36b3('0x2d')]);_0x417b2e[_0x36b3('0x32')]=_['intersection'](_0x31e7a8[_0x36b3('0x30')],qs[_0x36b3('0x31')](_0x2632b4[_0x36b3('0x2d')][_0x36b3('0x31')]));_0x417b2e['attributes']=_0x417b2e[_0x36b3('0x32')]['length']?_0x417b2e['attributes']:_0x31e7a8[_0x36b3('0x30')];if(_0x2632b4[_0x36b3('0x2d')][_0x36b3('0x3d')]){_0x417b2e[_0x36b3('0x3e')]=[{'all':!![]}];}_0x417b2e=_['merge']({},_0x417b2e,_0x2632b4[_0x36b3('0x3c')]);return db[_0x36b3('0x29')]['find'](_0x417b2e)[_0x36b3('0x20')](handleEntityNotFound(_0x2b3088,null))['then'](respondWithResult(_0x2b3088,null))[_0x36b3('0x43')](handleError(_0x2b3088,null));};exports[_0x36b3('0x44')]=function(_0x153f6d,_0x5ac2cb){return db[_0x36b3('0x29')][_0x36b3('0x44')](_0x153f6d[_0x36b3('0x45')],{})['then'](respondWithResult(_0x5ac2cb,0xc9))[_0x36b3('0x43')](handleError(_0x5ac2cb,null));};exports[_0x36b3('0x1f')]=function(_0x15a5ce,_0x3049d7){if(_0x15a5ce[_0x36b3('0x45')]['id']){delete _0x15a5ce['body']['id'];}return db[_0x36b3('0x29')][_0x36b3('0x46')]({'where':{'id':_0x15a5ce['params']['id']}})[_0x36b3('0x20')](handleEntityNotFound(_0x3049d7,null))[_0x36b3('0x20')](saveUpdates(_0x15a5ce[_0x36b3('0x45')],null))[_0x36b3('0x20')](respondWithResult(_0x3049d7,null))['catch'](handleError(_0x3049d7,null));};exports[_0x36b3('0x47')]=function(_0x5180cc,_0x346066){return db['VoiceQueuesLog']['find']({'where':{'id':_0x5180cc[_0x36b3('0x42')]['id']}})[_0x36b3('0x20')](handleEntityNotFound(_0x346066,null))[_0x36b3('0x20')](removeEntity(_0x346066,null))[_0x36b3('0x43')](handleError(_0x346066,null));};
\ No newline at end of file
+var _0xdb10=['status','end','json','offset','limit','undefined','count','apply','save','update','then','destroy','name','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','find','create','body','eml-format','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x5b4200,_0x279761){var _0x279cb6=function(_0x281992){while(--_0x281992){_0x5b4200['push'](_0x5b4200['shift']());}};_0x279cb6(++_0x279761);}(_0xdb10,0x12a));var _0x0db1=function(_0x437d7f,_0x1feb46){_0x437d7f=_0x437d7f-0x0;var _0x31058c=_0xdb10[_0x437d7f];return _0x31058c;};'use strict';var emlformat=require(_0x0db1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0db1('0x1'));var rp=require('request-promise');var moment=require(_0x0db1('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0db1('0x3'));var util=require(_0x0db1('0x4'));var path=require('path');var sox=require(_0x0db1('0x5'));var csv=require(_0x0db1('0x6'));var ejs=require(_0x0db1('0x7'));var fs=require('fs');var fs_extra=require(_0x0db1('0x8'));var _=require(_0x0db1('0x9'));var squel=require('squel');var crypto=require(_0x0db1('0xa'));var jsforce=require(_0x0db1('0xb'));var deskjs=require(_0x0db1('0xc'));var toCsv=require(_0x0db1('0x6'));var querystring=require('querystring');var Papa=require(_0x0db1('0xd'));var Redis=require(_0x0db1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0db1('0xf'));var hardwareService=require(_0x0db1('0x10'));var logger=require(_0x0db1('0x11'))(_0x0db1('0x12'));var utils=require('../../config/utils');var config=require(_0x0db1('0x13'));var licenseUtil=require(_0x0db1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c275c,_0x4fdf69){_0x4fdf69=_0x4fdf69||0xcc;return function(_0x354eca){if(_0x354eca){return _0x1c275c[_0x0db1('0x15')](_0x4fdf69);}return _0x1c275c[_0x0db1('0x16')](_0x4fdf69)[_0x0db1('0x17')]();};}function respondWithResult(_0x3dd622,_0x16bcbc){_0x16bcbc=_0x16bcbc||0xc8;return function(_0x2ffb2b){if(_0x2ffb2b){return _0x3dd622[_0x0db1('0x16')](_0x16bcbc)[_0x0db1('0x18')](_0x2ffb2b);}};}function respondWithFilteredResult(_0x387110,_0x5302f7){return function(_0x1617f9){if(_0x1617f9){var _0x1b5019=typeof _0x5302f7[_0x0db1('0x19')]==='undefined'&&typeof _0x5302f7[_0x0db1('0x1a')]===_0x0db1('0x1b');var _0x52c268=_0x1617f9[_0x0db1('0x1c')];var _0x2e8199=_0x1b5019?0x0:_0x5302f7['offset'];var _0x31a398=_0x1b5019?_0x1617f9[_0x0db1('0x1c')]:_0x5302f7[_0x0db1('0x19')]+_0x5302f7[_0x0db1('0x1a')];var _0xf2f49e;if(_0x31a398>=_0x52c268){_0x31a398=_0x52c268;_0xf2f49e=0xc8;}else{_0xf2f49e=0xce;}_0x387110[_0x0db1('0x16')](_0xf2f49e);return _0x387110['set']('Content-Range',_0x2e8199+'-'+_0x31a398+'/'+_0x52c268)[_0x0db1('0x18')](_0x1617f9);}return null;};}function patchUpdates(_0x83080c){return function(_0x3947fa){try{jsonpatch[_0x0db1('0x1d')](_0x3947fa,_0x83080c,!![]);}catch(_0x268b59){return BPromise['reject'](_0x268b59);}return _0x3947fa[_0x0db1('0x1e')]();};}function saveUpdates(_0x46d4a5,_0x222272){return function(_0x162e82){if(_0x162e82){return _0x162e82[_0x0db1('0x1f')](_0x46d4a5)[_0x0db1('0x20')](function(_0x5a04c3){return _0x5a04c3;});}return null;};}function removeEntity(_0x48b3aa,_0x1cab67){return function(_0x48825b){if(_0x48825b){return _0x48825b[_0x0db1('0x21')]()[_0x0db1('0x20')](function(){_0x48b3aa[_0x0db1('0x16')](0xcc)[_0x0db1('0x17')]();});}};}function handleEntityNotFound(_0x6f47e6,_0x3559e2){return function(_0x48a024){if(!_0x48a024){_0x6f47e6['sendStatus'](0x194);}return _0x48a024;};}function handleError(_0xb45c27,_0x4616ea){_0x4616ea=_0x4616ea||0x1f4;return function(_0xd4b1ce){logger['error'](_0xd4b1ce['stack']);if(_0xd4b1ce[_0x0db1('0x22')]){delete _0xd4b1ce[_0x0db1('0x22')];}_0xb45c27[_0x0db1('0x16')](_0x4616ea)['send'](_0xd4b1ce);};}exports['index']=function(_0x479406,_0x2dc097){var _0x56a4b0={},_0x18ea69={},_0x3fd888={'count':0x0,'rows':[]};var _0x13d14f=_[_0x0db1('0x23')](db[_0x0db1('0x24')][_0x0db1('0x25')],function(_0x1531bc){return{'name':_0x1531bc[_0x0db1('0x26')],'type':_0x1531bc[_0x0db1('0x27')]['key']};});_0x18ea69[_0x0db1('0x28')]=_[_0x0db1('0x23')](_0x13d14f,'name');_0x18ea69[_0x0db1('0x29')]=_[_0x0db1('0x2a')](_0x479406[_0x0db1('0x29')]);_0x18ea69[_0x0db1('0x2b')]=_[_0x0db1('0x2c')](_0x18ea69[_0x0db1('0x28')],_0x18ea69[_0x0db1('0x29')]);_0x56a4b0[_0x0db1('0x2d')]=_[_0x0db1('0x2c')](_0x18ea69[_0x0db1('0x28')],qs[_0x0db1('0x2e')](_0x479406['query']['fields']));_0x56a4b0['attributes']=_0x56a4b0[_0x0db1('0x2d')][_0x0db1('0x2f')]?_0x56a4b0[_0x0db1('0x2d')]:_0x18ea69['model'];if(!_0x479406['query'][_0x0db1('0x30')](_0x0db1('0x31'))){_0x56a4b0[_0x0db1('0x1a')]=qs[_0x0db1('0x1a')](_0x479406[_0x0db1('0x29')][_0x0db1('0x1a')]);_0x56a4b0[_0x0db1('0x19')]=qs[_0x0db1('0x19')](_0x479406['query'][_0x0db1('0x19')]);}_0x56a4b0['order']=qs[_0x0db1('0x32')](_0x479406['query'][_0x0db1('0x32')]);_0x56a4b0[_0x0db1('0x33')]=qs[_0x0db1('0x2b')](_['pick'](_0x479406[_0x0db1('0x29')],_0x18ea69[_0x0db1('0x2b')]),_0x13d14f);if(_0x479406[_0x0db1('0x29')][_0x0db1('0x34')]){_0x56a4b0[_0x0db1('0x33')]=_[_0x0db1('0x35')](_0x56a4b0['where'],{'$or':_[_0x0db1('0x23')](_0x13d14f,function(_0x4025a3){if(_0x4025a3[_0x0db1('0x27')]!=='VIRTUAL'){var _0xe03604={};_0xe03604[_0x4025a3[_0x0db1('0x22')]]={'$like':'%'+_0x479406[_0x0db1('0x29')][_0x0db1('0x34')]+'%'};return _0xe03604;}})});}_0x56a4b0=_[_0x0db1('0x35')]({},_0x56a4b0,_0x479406[_0x0db1('0x36')]);var _0xd2395a={'where':_0x56a4b0[_0x0db1('0x33')]};return db['VoiceQueuesLog']['count'](_0xd2395a)[_0x0db1('0x20')](function(_0x35f81c){_0x3fd888['count']=_0x35f81c;if(_0x479406[_0x0db1('0x29')][_0x0db1('0x37')]){_0x56a4b0['include']=[{'all':!![]}];}return db[_0x0db1('0x24')][_0x0db1('0x38')](_0x56a4b0);})['then'](function(_0x22d0b5){_0x3fd888[_0x0db1('0x39')]=_0x22d0b5;return _0x3fd888;})[_0x0db1('0x20')](respondWithFilteredResult(_0x2dc097,_0x56a4b0))[_0x0db1('0x3a')](handleError(_0x2dc097,null));};exports[_0x0db1('0x3b')]=function(_0x405601,_0x3c766c){var _0x21212a={'raw':!![],'where':{'id':_0x405601[_0x0db1('0x3c')]['id']}},_0x20a3d5={};_0x20a3d5['model']=_[_0x0db1('0x2a')](db[_0x0db1('0x24')]['rawAttributes']);_0x20a3d5[_0x0db1('0x29')]=_[_0x0db1('0x2a')](_0x405601[_0x0db1('0x29')]);_0x20a3d5[_0x0db1('0x2b')]=_[_0x0db1('0x2c')](_0x20a3d5[_0x0db1('0x28')],_0x20a3d5[_0x0db1('0x29')]);_0x21212a['attributes']=_['intersection'](_0x20a3d5['model'],qs[_0x0db1('0x2e')](_0x405601[_0x0db1('0x29')][_0x0db1('0x2e')]));_0x21212a[_0x0db1('0x2d')]=_0x21212a[_0x0db1('0x2d')]['length']?_0x21212a[_0x0db1('0x2d')]:_0x20a3d5[_0x0db1('0x28')];if(_0x405601['query'][_0x0db1('0x37')]){_0x21212a['include']=[{'all':!![]}];}_0x21212a=_[_0x0db1('0x35')]({},_0x21212a,_0x405601[_0x0db1('0x36')]);return db[_0x0db1('0x24')][_0x0db1('0x3d')](_0x21212a)[_0x0db1('0x20')](handleEntityNotFound(_0x3c766c,null))[_0x0db1('0x20')](respondWithResult(_0x3c766c,null))[_0x0db1('0x3a')](handleError(_0x3c766c,null));};exports[_0x0db1('0x3e')]=function(_0x18b83d,_0x5f07c8){return db[_0x0db1('0x24')][_0x0db1('0x3e')](_0x18b83d['body'],{})[_0x0db1('0x20')](respondWithResult(_0x5f07c8,0xc9))[_0x0db1('0x3a')](handleError(_0x5f07c8,null));};exports[_0x0db1('0x1f')]=function(_0x23b994,_0x141467){if(_0x23b994['body']['id']){delete _0x23b994[_0x0db1('0x3f')]['id'];}return db[_0x0db1('0x24')][_0x0db1('0x3d')]({'where':{'id':_0x23b994['params']['id']}})[_0x0db1('0x20')](handleEntityNotFound(_0x141467,null))['then'](saveUpdates(_0x23b994[_0x0db1('0x3f')],null))[_0x0db1('0x20')](respondWithResult(_0x141467,null))[_0x0db1('0x3a')](handleError(_0x141467,null));};exports['destroy']=function(_0x1b3a5e,_0x477690){return db[_0x0db1('0x24')][_0x0db1('0x3d')]({'where':{'id':_0x1b3a5e[_0x0db1('0x3c')]['id']}})[_0x0db1('0x20')](handleEntityNotFound(_0x477690,null))[_0x0db1('0x20')](removeEntity(_0x477690,null))[_0x0db1('0x3a')](handleError(_0x477690,null));};
\ No newline at end of file
index 1a797ff..8bfcead 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3280=['path','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5d897d,_0x8f648e){var _0x21a626=function(_0x43d4c9){while(--_0x43d4c9){_0x5d897d['push'](_0x5d897d['shift']());}};_0x21a626(++_0x8f648e);}(_0x3280,0x17a));var _0x0328=function(_0xd206ce,_0x3031d2){_0xd206ce=_0xd206ce-0x0;var _0x5b3ec6=_0x3280[_0xd206ce];return _0x5b3ec6;};'use strict';var _=require('lodash');var util=require(_0x0328('0x0'));var logger=require(_0x0328('0x1'))(_0x0328('0x2'));var moment=require(_0x0328('0x3'));var BPromise=require(_0x0328('0x4'));var rp=require(_0x0328('0x5'));var fs=require('fs');var path=require(_0x0328('0x6'));var rimraf=require(_0x0328('0x7'));var config=require('../../config/environment');var attributes=require(_0x0328('0x8'));module[_0x0328('0x9')]=function(_0x47701f,_0x1cca1b){return _0x47701f[_0x0328('0xa')](_0x0328('0xb'),attributes,{'tableName':_0x0328('0xc'),'paranoid':![],'indexes':[{'name':_0x0328('0xd'),'fields':[_0x0328('0xe'),_0x0328('0xf')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x63ea=['path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','voice_queues_log','event_dtm','dtm','lodash','util','../../config/logger','request-promise'];(function(_0x7d9fa,_0xd5656d){var _0x36d885=function(_0xdf8e43){while(--_0xdf8e43){_0x7d9fa['push'](_0x7d9fa['shift']());}};_0x36d885(++_0xd5656d);}(_0x63ea,0x15b));var _0xa63e=function(_0xf794b0,_0x47d957){_0xf794b0=_0xf794b0-0x0;var _0x47a01d=_0x63ea[_0xf794b0];return _0x47a01d;};'use strict';var _=require(_0xa63e('0x0'));var util=require(_0xa63e('0x1'));var logger=require(_0xa63e('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa63e('0x3'));var fs=require('fs');var path=require(_0xa63e('0x4'));var rimraf=require(_0xa63e('0x5'));var config=require(_0xa63e('0x6'));var attributes=require(_0xa63e('0x7'));module[_0xa63e('0x8')]=function(_0xb20fbe,_0x5ad84f){return _0xb20fbe[_0xa63e('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0xa63e('0xa'),'paranoid':![],'indexes':[{'name':_0xa63e('0xb'),'fields':['event',_0xa63e('0xc')]}],'timestamps':![]});};
\ No newline at end of file
index cd5a3f0..52e6eaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdbb=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x754ab4,_0x56daa7){var _0x34079a=function(_0x295ec1){while(--_0x295ec1){_0x754ab4['push'](_0x754ab4['shift']());}};_0x34079a(++_0x56daa7);}(_0xcdbb,0x115));var _0xbcdb=function(_0x7bb300,_0x47a21d){_0x7bb300=_0x7bb300-0x0;var _0x465de5=_0xcdbb[_0x7bb300];return _0x465de5;};'use strict';var _=require(_0xbcdb('0x0'));var util=require(_0xbcdb('0x1'));var moment=require(_0xbcdb('0x2'));var BPromise=require(_0xbcdb('0x3'));var rs=require(_0xbcdb('0x4'));var fs=require('fs');var Redis=require(_0xbcdb('0x5'));var db=require(_0xbcdb('0x6'))['db'];var utils=require(_0xbcdb('0x7'));var logger=require(_0xbcdb('0x8'))(_0xbcdb('0x9'));var config=require('../../config/environment');var jayson=require(_0xbcdb('0xa'));var client=jayson['client'][_0xbcdb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27654e,_0x58f4d6,_0x2a8130){return new BPromise(function(_0x17ed2e,_0x11fd06){return client[_0xbcdb('0xc')](_0x27654e,_0x2a8130)[_0xbcdb('0xd')](function(_0x47864b){logger[_0xbcdb('0xe')](_0xbcdb('0xf'),_0x58f4d6,_0xbcdb('0x10'));logger[_0xbcdb('0x11')](_0xbcdb('0x12'),_0x58f4d6,_0xbcdb('0x10'),JSON[_0xbcdb('0x13')](_0x47864b));if(_0x47864b[_0xbcdb('0x14')]){if(_0x47864b[_0xbcdb('0x14')][_0xbcdb('0x15')]===0x1f4){logger[_0xbcdb('0x14')](_0xbcdb('0xf'),_0x58f4d6,_0x47864b[_0xbcdb('0x14')][_0xbcdb('0x16')]);return _0x11fd06(_0x47864b['error'][_0xbcdb('0x16')]);}logger[_0xbcdb('0x14')](_0xbcdb('0xf'),_0x58f4d6,_0x47864b[_0xbcdb('0x14')][_0xbcdb('0x16')]);return _0x17ed2e(_0x47864b[_0xbcdb('0x14')][_0xbcdb('0x16')]);}else{logger[_0xbcdb('0xe')](_0xbcdb('0xf'),_0x58f4d6,_0xbcdb('0x10'));_0x17ed2e(_0x47864b[_0xbcdb('0x17')][_0xbcdb('0x16')]);}})[_0xbcdb('0x18')](function(_0x193bf1){logger[_0xbcdb('0x14')](_0xbcdb('0xf'),_0x58f4d6,_0x193bf1);_0x11fd06(_0x193bf1);});});}
\ No newline at end of file
+var _0x9251=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x248372,_0x3c686e){var _0x2d3140=function(_0x279f70){while(--_0x279f70){_0x248372['push'](_0x248372['shift']());}};_0x2d3140(++_0x3c686e);}(_0x9251,0x1e6));var _0x1925=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0x9251[_0xdeefbd];return _0x4ff63f;};'use strict';var _=require('lodash');var util=require(_0x1925('0x0'));var moment=require(_0x1925('0x1'));var BPromise=require(_0x1925('0x2'));var rs=require(_0x1925('0x3'));var fs=require('fs');var Redis=require(_0x1925('0x4'));var db=require(_0x1925('0x5'))['db'];var utils=require(_0x1925('0x6'));var logger=require(_0x1925('0x7'))(_0x1925('0x8'));var config=require(_0x1925('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1925('0xa')][_0x1925('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a6313,_0x3dd721,_0x4f8d6c){return new BPromise(function(_0x4cfd03,_0x41d888){return client[_0x1925('0xc')](_0x1a6313,_0x4f8d6c)['then'](function(_0x4a37e1){logger[_0x1925('0xd')](_0x1925('0xe'),_0x3dd721,_0x1925('0xf'));logger[_0x1925('0x10')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x3dd721,_0x1925('0xf'),JSON[_0x1925('0x11')](_0x4a37e1));if(_0x4a37e1['error']){if(_0x4a37e1[_0x1925('0x12')][_0x1925('0x13')]===0x1f4){logger[_0x1925('0x12')](_0x1925('0xe'),_0x3dd721,_0x4a37e1[_0x1925('0x12')][_0x1925('0x14')]);return _0x41d888(_0x4a37e1['error']['message']);}logger[_0x1925('0x12')](_0x1925('0xe'),_0x3dd721,_0x4a37e1[_0x1925('0x12')][_0x1925('0x14')]);return _0x4cfd03(_0x4a37e1['error']['message']);}else{logger[_0x1925('0xd')](_0x1925('0xe'),_0x3dd721,_0x1925('0xf'));_0x4cfd03(_0x4a37e1[_0x1925('0x15')][_0x1925('0x14')]);}})[_0x1925('0x16')](function(_0x568257){logger[_0x1925('0x12')](_0x1925('0xe'),_0x3dd721,_0x568257);_0x41d888(_0x568257);});});}
\ No newline at end of file
index 022f80f..c96483b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x405b=['/:id','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated'];(function(_0x250333,_0x25fe43){var _0x486c36=function(_0x169577){while(--_0x169577){_0x250333['push'](_0x250333['shift']());}};_0x486c36(++_0x25fe43);}(_0x405b,0x1ab));var _0xb405=function(_0x56ba88,_0x38068a){_0x56ba88=_0x56ba88-0x0;var _0x56b2c4=_0x405b[_0x56ba88];return _0x56b2c4;};'use strict';var multer=require(_0xb405('0x0'));var util=require(_0xb405('0x1'));var path=require(_0xb405('0x2'));var timeout=require('connect-timeout');var express=require(_0xb405('0x3'));var router=express['Router']();var fs_extra=require(_0xb405('0x4'));var auth=require(_0xb405('0x5'));var interaction=require(_0xb405('0x6'));var config=require('../../config/environment');var controller=require(_0xb405('0x7'));router[_0xb405('0x8')]('/',auth[_0xb405('0x9')](),controller['index']);router[_0xb405('0x8')]('/describe',auth[_0xb405('0x9')](),controller['describe']);router[_0xb405('0x8')](_0xb405('0xa'),auth[_0xb405('0x9')](),controller['show']);router['get'](_0xb405('0xb'),auth[_0xb405('0x9')](),controller[_0xb405('0xc')]);router[_0xb405('0x8')](_0xb405('0xd'),controller[_0xb405('0xe')]);router[_0xb405('0x8')](_0xb405('0xf'),auth[_0xb405('0x9')](),controller[_0xb405('0x10')]);router[_0xb405('0x11')]('/',auth[_0xb405('0x9')](),controller[_0xb405('0x12')]);router['post'](_0xb405('0xf'),auth[_0xb405('0x9')](),controller[_0xb405('0x13')]);router['put'](_0xb405('0xa'),auth[_0xb405('0x9')](),controller[_0xb405('0x14')]);router[_0xb405('0x15')]('/:id',auth[_0xb405('0x9')](),controller['destroy']);module[_0xb405('0x16')]=router;
\ No newline at end of file
+var _0xd19a=['downloadTranscribe','post','runTranscribe','put','/:id','update','delete','destroy','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','/describe','isAuthenticated','describe','show','download','/:id/downloads','/:id/transcribe'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xd19a,0x92));var _0xad19=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xd19a[_0x178e48];return _0x440d7e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xad19('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xad19('0x1')]();var fs_extra=require(_0xad19('0x2'));var auth=require(_0xad19('0x3'));var interaction=require(_0xad19('0x4'));var config=require(_0xad19('0x5'));var controller=require(_0xad19('0x6'));router[_0xad19('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xad19('0x7')](_0xad19('0x8'),auth[_0xad19('0x9')](),controller[_0xad19('0xa')]);router[_0xad19('0x7')]('/:id',auth[_0xad19('0x9')](),controller[_0xad19('0xb')]);router[_0xad19('0x7')]('/:id/download',auth[_0xad19('0x9')](),controller[_0xad19('0xc')]);router[_0xad19('0x7')](_0xad19('0xd'),controller['downloads']);router[_0xad19('0x7')](_0xad19('0xe'),auth[_0xad19('0x9')](),controller[_0xad19('0xf')]);router['post']('/',auth[_0xad19('0x9')](),controller['create']);router[_0xad19('0x10')](_0xad19('0xe'),auth['isAuthenticated'](),controller[_0xad19('0x11')]);router[_0xad19('0x12')](_0xad19('0x13'),auth[_0xad19('0x9')](),controller[_0xad19('0x14')]);router[_0xad19('0x15')](_0xad19('0x13'),auth[_0xad19('0x9')](),controller[_0xad19('0x16')]);module['exports']=router;
\ No newline at end of file
index 27845bc..7f200b0 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(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}};
\ No newline at end of file
index 20ac6a0..4db94a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d1b=['Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','.txt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','json','apply','reject','then','destroy','stack','name','send','map','VoiceRecording','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','update','describe','download','uniqueid','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','col','push','$and','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','../../components/encryptor','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sequelize','Cloud\x20Provider\x20not\x20available','data1','data2'];(function(_0x39e177,_0x1f09d9){var _0x441aa0=function(_0x533eef){while(--_0x533eef){_0x39e177['push'](_0x39e177['shift']());}};_0x441aa0(++_0x1f09d9);}(_0x7d1b,0xa9));var _0xb7d1=function(_0x254469,_0x5c4938){_0x254469=_0x254469-0x0;var _0x38fdd7=_0x7d1b[_0x254469];return _0x38fdd7;};'use strict';var emlformat=require(_0xb7d1('0x0'));var rimraf=require(_0xb7d1('0x1'));var zipdir=require(_0xb7d1('0x2'));var jsonpatch=require(_0xb7d1('0x3'));var rp=require(_0xb7d1('0x4'));var moment=require(_0xb7d1('0x5'));var BPromise=require(_0xb7d1('0x6'));var Mustache=require(_0xb7d1('0x7'));var util=require(_0xb7d1('0x8'));var path=require(_0xb7d1('0x9'));var sox=require(_0xb7d1('0xa'));var csv=require(_0xb7d1('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb7d1('0xc'));var _=require(_0xb7d1('0xd'));var squel=require(_0xb7d1('0xe'));var crypto=require('crypto');var jsforce=require(_0xb7d1('0xf'));var deskjs=require(_0xb7d1('0x10'));var toCsv=require(_0xb7d1('0xb'));var querystring=require(_0xb7d1('0x11'));var Papa=require(_0xb7d1('0x12'));var AWS=require('aws-sdk');var uuidv4=require(_0xb7d1('0x13'));var Redis=require(_0xb7d1('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xb7d1('0x15'));var as=require(_0xb7d1('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb7d1('0x17'))(_0xb7d1('0x18'));var utils=require(_0xb7d1('0x19'));var config=require(_0xb7d1('0x1a'));var licenseUtil=require(_0xb7d1('0x1b'));var db=require(_0xb7d1('0x1c'))['db'];function respondWithStatusCode(_0x146492,_0x118e70){_0x118e70=_0x118e70||0xcc;return function(_0x51b871){if(_0x51b871){return _0x146492[_0xb7d1('0x1d')](_0x118e70);}return _0x146492[_0xb7d1('0x1e')](_0x118e70)[_0xb7d1('0x1f')]();};}function respondWithResult(_0x242799,_0x3fb4fc){_0x3fb4fc=_0x3fb4fc||0xc8;return function(_0x406b67){if(_0x406b67){return _0x242799[_0xb7d1('0x1e')](_0x3fb4fc)['json'](_0x406b67);}};}function respondWithFilteredResult(_0x11fc41,_0x4495e3){return function(_0x3257ff){if(_0x3257ff){var _0x198ae2=typeof _0x4495e3['offset']==='undefined'&&typeof _0x4495e3[_0xb7d1('0x20')]===_0xb7d1('0x21');var _0x2410bc=_0x3257ff[_0xb7d1('0x22')];var _0x4978bf=_0x198ae2?0x0:_0x4495e3[_0xb7d1('0x23')];var _0x566499=_0x198ae2?_0x3257ff[_0xb7d1('0x22')]:_0x4495e3['offset']+_0x4495e3['limit'];var _0x1f808a;if(_0x566499>=_0x2410bc){_0x566499=_0x2410bc;_0x1f808a=0xc8;}else{_0x1f808a=0xce;}_0x11fc41['status'](_0x1f808a);return _0x11fc41[_0xb7d1('0x24')]('Content-Range',_0x4978bf+'-'+_0x566499+'/'+_0x2410bc)[_0xb7d1('0x25')](_0x3257ff);}return null;};}function patchUpdates(_0x2f0060){return function(_0x54f5a6){try{jsonpatch[_0xb7d1('0x26')](_0x54f5a6,_0x2f0060,!![]);}catch(_0x355b53){return BPromise[_0xb7d1('0x27')](_0x355b53);}return _0x54f5a6['save']();};}function saveUpdates(_0x2de727,_0x45e554){return function(_0x23b1ab){if(_0x23b1ab){return _0x23b1ab['update'](_0x2de727)[_0xb7d1('0x28')](function(_0x3e0c65){return _0x3e0c65;});}return null;};}function removeEntity(_0x1fd43c,_0x3a0773){return function(_0x36a667){if(_0x36a667){return _0x36a667[_0xb7d1('0x29')]()[_0xb7d1('0x28')](function(){_0x1fd43c['status'](0xcc)[_0xb7d1('0x1f')]();});}};}function handleEntityNotFound(_0x194b8a,_0x5808fa){return function(_0x2861cc){if(!_0x2861cc){_0x194b8a[_0xb7d1('0x1d')](0x194);}return _0x2861cc;};}function handleError(_0x19ccfa,_0x474a66){_0x474a66=_0x474a66||0x1f4;return function(_0x22f2dc){logger['error'](_0x22f2dc[_0xb7d1('0x2a')]);if(_0x22f2dc[_0xb7d1('0x2b')]){delete _0x22f2dc[_0xb7d1('0x2b')];}_0x19ccfa[_0xb7d1('0x1e')](_0x474a66)[_0xb7d1('0x2c')](_0x22f2dc);};}exports['index']=function(_0x346740,_0xa69873){var _0x33e78f={},_0x2a6e5c={},_0x451625={'count':0x0,'rows':[]};var _0x194156=_[_0xb7d1('0x2d')](db[_0xb7d1('0x2e')][_0xb7d1('0x2f')],function(_0x2827db){return{'name':_0x2827db['fieldName'],'type':_0x2827db[_0xb7d1('0x30')][_0xb7d1('0x31')]};});_0x2a6e5c[_0xb7d1('0x32')]=_['differenceBy'](_['map'](_0x194156,_0xb7d1('0x2b')),['format']);_0x2a6e5c[_0xb7d1('0x33')]=_[_0xb7d1('0x34')](_0x346740['query']);_0x2a6e5c[_0xb7d1('0x35')]=_[_0xb7d1('0x36')](_0x2a6e5c[_0xb7d1('0x32')],_0x2a6e5c[_0xb7d1('0x33')]);_0x33e78f['attributes']=_['intersection'](_0x2a6e5c[_0xb7d1('0x32')],qs[_0xb7d1('0x37')](_0x346740[_0xb7d1('0x33')][_0xb7d1('0x37')]));_0x33e78f[_0xb7d1('0x38')]=_0x33e78f[_0xb7d1('0x38')]['length']?_0x33e78f[_0xb7d1('0x38')]:_0x2a6e5c[_0xb7d1('0x32')];if(!_0x346740[_0xb7d1('0x33')][_0xb7d1('0x39')](_0xb7d1('0x3a'))){_0x33e78f[_0xb7d1('0x20')]=qs['limit'](_0x346740['query'][_0xb7d1('0x20')]);_0x33e78f[_0xb7d1('0x23')]=qs['offset'](_0x346740[_0xb7d1('0x33')][_0xb7d1('0x23')]);}_0x33e78f[_0xb7d1('0x3b')]=qs['sort'](_0x346740[_0xb7d1('0x33')][_0xb7d1('0x3c')]);_0x33e78f['where']=qs[_0xb7d1('0x35')](_[_0xb7d1('0x3d')](_0x346740[_0xb7d1('0x33')],_0x2a6e5c['filters']),_0x194156);if(_0x346740[_0xb7d1('0x33')][_0xb7d1('0x3e')]){_0x33e78f[_0xb7d1('0x3f')]=_['merge'](_0x33e78f[_0xb7d1('0x3f')],{'$or':_['map'](_0x194156,function(_0x1024ee){if(_0x1024ee[_0xb7d1('0x30')]!==_0xb7d1('0x40')){var _0xde0811={};_0xde0811[_0x1024ee['name']]={'$like':'%'+_0x346740[_0xb7d1('0x33')][_0xb7d1('0x3e')]+'%'};return _0xde0811;}})});}_0x33e78f=_[_0xb7d1('0x41')]({},_0x33e78f,_0x346740[_0xb7d1('0x42')]);var _0x1d97bc={'where':_0x33e78f['where']};return db[_0xb7d1('0x2e')][_0xb7d1('0x22')](_0x1d97bc)[_0xb7d1('0x28')](function(_0x113844){_0x451625[_0xb7d1('0x22')]=_0x113844;if(_0x346740[_0xb7d1('0x33')]['includeAll']){_0x33e78f[_0xb7d1('0x43')]=[{'all':!![]}];}return db[_0xb7d1('0x2e')][_0xb7d1('0x44')](_0x33e78f);})[_0xb7d1('0x28')](function(_0x2ba19a){_0x451625[_0xb7d1('0x45')]=_0x2ba19a;return _0x451625;})[_0xb7d1('0x28')](respondWithFilteredResult(_0xa69873,_0x33e78f))[_0xb7d1('0x46')](handleError(_0xa69873,null));};exports[_0xb7d1('0x47')]=function(_0x53a4ff,_0x5f4208){var _0x56d9b6={'raw':![],'where':{'id':_0x53a4ff[_0xb7d1('0x48')]['id']}},_0x3ae3b6={};_0x3ae3b6['model']=_[_0xb7d1('0x34')](db['VoiceRecording'][_0xb7d1('0x2f')]);_0x3ae3b6['query']=_[_0xb7d1('0x34')](_0x53a4ff[_0xb7d1('0x33')]);_0x3ae3b6[_0xb7d1('0x35')]=_['intersection'](_0x3ae3b6[_0xb7d1('0x32')],_0x3ae3b6[_0xb7d1('0x33')]);_0x56d9b6[_0xb7d1('0x38')]=_[_0xb7d1('0x36')](_0x3ae3b6[_0xb7d1('0x32')],qs['fields'](_0x53a4ff['query'][_0xb7d1('0x37')]));_0x56d9b6[_0xb7d1('0x38')]=_0x56d9b6[_0xb7d1('0x38')][_0xb7d1('0x49')]?_0x56d9b6[_0xb7d1('0x38')]:_0x3ae3b6[_0xb7d1('0x32')];if(_0x53a4ff[_0xb7d1('0x33')][_0xb7d1('0x4a')]){_0x56d9b6['include']=[{'all':!![]}];}_0x56d9b6=_[_0xb7d1('0x41')]({},_0x56d9b6,_0x53a4ff['options']);return db['VoiceRecording'][_0xb7d1('0x4b')](_0x56d9b6)[_0xb7d1('0x28')](handleEntityNotFound(_0x5f4208,null))[_0xb7d1('0x28')](respondWithResult(_0x5f4208,null))['catch'](handleError(_0x5f4208,null));};exports[_0xb7d1('0x4c')]=function(_0x52398b,_0x51624c){return db[_0xb7d1('0x2e')]['create'](_0x52398b[_0xb7d1('0x4d')],{})[_0xb7d1('0x28')](respondWithResult(_0x51624c,0xc9))['catch'](handleError(_0x51624c,null));};exports[_0xb7d1('0x4e')]=function(_0x3c419c,_0x1ce1d3){if(_0x3c419c[_0xb7d1('0x4d')]['id']){delete _0x3c419c[_0xb7d1('0x4d')]['id'];}return db[_0xb7d1('0x2e')][_0xb7d1('0x4b')]({'where':{'id':_0x3c419c[_0xb7d1('0x48')]['id']}})['then'](handleEntityNotFound(_0x1ce1d3,null))[_0xb7d1('0x28')](saveUpdates(_0x3c419c[_0xb7d1('0x4d')],null))[_0xb7d1('0x28')](respondWithResult(_0x1ce1d3,null))[_0xb7d1('0x46')](handleError(_0x1ce1d3,null));};exports[_0xb7d1('0x4f')]=function(_0x5f4611,_0x1bf049){return db[_0xb7d1('0x2e')][_0xb7d1('0x4f')]()[_0xb7d1('0x28')](respondWithResult(_0x1bf049,null))[_0xb7d1('0x46')](handleError(_0x1bf049,null));};exports[_0xb7d1('0x50')]=function(_0x596288,_0x3a276f,_0x1167ac){var _0x3a7024=require('../../components/encryptor');var _0x2e538b=![];var _0x274ba0={};if(_0x596288[_0xb7d1('0x33')][_0xb7d1('0x30')]&&_0x596288[_0xb7d1('0x33')]['type']===_0xb7d1('0x51')){_0x274ba0[_0xb7d1('0x51')]=_0x596288[_0xb7d1('0x48')]['id'];}else{_0x274ba0['id']=_0x596288[_0xb7d1('0x48')]['id'];}return db[_0xb7d1('0x2e')][_0xb7d1('0x4b')]({'where':_0x274ba0,'attributes':['id',_0xb7d1('0x52')],'raw':!![]})[_0xb7d1('0x28')](handleEntityNotFound(_0x3a276f,null))[_0xb7d1('0x28')](function(_0x5f4f8a){if(_0x5f4f8a){var _0x5e04a4=_0x5f4f8a[_0xb7d1('0x52')];var _0x4a11c2=util[_0xb7d1('0x53')](_0xb7d1('0x54'),_0x5e04a4);if(fs[_0xb7d1('0x55')](_0x4a11c2)){_0x2e538b=!![];return _0x3a7024[_0xb7d1('0x56')](_0x4a11c2,_0x5e04a4,config[_0xb7d1('0x57')][_0xb7d1('0x58')])[_0xb7d1('0x28')](function(){return _0x5f4f8a;});}return _0x5f4f8a;}})[_0xb7d1('0x28')](function(_0x47dfc0){if(_0x47dfc0){var _0x20cfb4=_0x47dfc0[_0xb7d1('0x52')];if(!fs[_0xb7d1('0x55')](_0x20cfb4)){throw new db['Sequelize'][(_0xb7d1('0x59'))](_0xb7d1('0x5a'));}if(_0x47dfc0[_0xb7d1('0x5b')]){return _0x3a276f[_0xb7d1('0x50')](_0x20cfb4,_0x47dfc0[_0xb7d1('0x5b')]+path[_0xb7d1('0x5c')](_0x20cfb4),function(){if(_0x2e538b){fs[_0xb7d1('0x5d')](_0x20cfb4);}});}else{return _0x3a276f[_0xb7d1('0x50')](_0x20cfb4,function(_0x5a6387){if(_0x2e538b){fs[_0xb7d1('0x5d')](_0x20cfb4);}});}}})[_0xb7d1('0x46')](function(_0x4aaeec){if(_0x4aaeec[_0xb7d1('0x5e')]==='VoiceRecording\x20not\x20found'){_0x3a276f[_0xb7d1('0x1e')](0x194)['send'](_0xb7d1('0x5f'));}else{return handleError(_0x3a276f,null);}});};exports[_0xb7d1('0x60')]=function(_0x5c25bd,_0x2b5220,_0x493e02){var _0x4af684=require('../../components/encryptor');var _0x1d4380=![];var _0x105e33={'$and':[db['sequelize']['where'](db[_0xb7d1('0x61')]['fn']('MD5',db['sequelize'][_0xb7d1('0x62')](_0xb7d1('0x51'))),_0x5c25bd[_0xb7d1('0x33')]['token'])]};if(_0x5c25bd[_0xb7d1('0x33')][_0xb7d1('0x30')]&&_0x5c25bd[_0xb7d1('0x33')][_0xb7d1('0x30')]===_0xb7d1('0x51')){_0x105e33['$and'][_0xb7d1('0x63')]({'uniqueid':_0x5c25bd['params']['id']});}else{_0x105e33[_0xb7d1('0x64')]['push']({'id':_0x5c25bd['params']['id']});}return db[_0xb7d1('0x2e')][_0xb7d1('0x4b')]({'where':_0x105e33,'attributes':['id',_0xb7d1('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x2b5220,null))[_0xb7d1('0x28')](function(_0x16f39f){if(_0x16f39f){var _0x225455=util[_0xb7d1('0x53')]('%s.cypher',_0x16f39f[_0xb7d1('0x52')]);if(fs['existsSync'](_0x225455)){_0x1d4380=!![];return _0x4af684[_0xb7d1('0x56')](_0x225455,_0x16f39f['value'],config['secrets'][_0xb7d1('0x58')])[_0xb7d1('0x28')](function(){return _0x16f39f;});}return _0x16f39f;}})['then'](function(_0x583f89){if(_0x583f89){if(!fs[_0xb7d1('0x55')](_0x583f89[_0xb7d1('0x52')])){throw new db['Sequelize']['ValidationError'](_0xb7d1('0x5a'));}if(_0x583f89[_0xb7d1('0x5b')]){return _0x2b5220['download'](_0x583f89['value'],_0x583f89['filename']+path[_0xb7d1('0x5c')](_0x583f89['value']),function(){if(_0x1d4380){fs['unlink'](_0x583f89[_0xb7d1('0x52')]);}});}else{return _0x2b5220[_0xb7d1('0x50')](_0x583f89[_0xb7d1('0x52')],function(_0x88f9fd){if(_0x1d4380){fs['unlink'](_0x583f89[_0xb7d1('0x52')]);}});}}})['catch'](handleError(_0x2b5220,null));};exports['destroy']=function(_0x3b2375,_0x325df4){return db[_0xb7d1('0x2e')][_0xb7d1('0x4b')]({'where':{'id':_0x3b2375[_0xb7d1('0x48')]['id']}})[_0xb7d1('0x28')](function(_0xc83e1d){if(_[_0xb7d1('0x65')](_0xc83e1d)){throw new ReferenceError(_0xb7d1('0x66'));}return _0xc83e1d;})['then'](function(_0x590401){var _0x553780=_0x590401[_0xb7d1('0x52')];logger[_0xb7d1('0x67')](_0xb7d1('0x68'),_0x553780);if(!_[_0xb7d1('0x65')](_0x590401['value'])&&fs[_0xb7d1('0x55')](_0x553780)){logger[_0xb7d1('0x67')](_0xb7d1('0x69')+_0x553780+_0xb7d1('0x6a'));fs[_0xb7d1('0x6b')](_0x553780);}_0x553780=_0x553780+'.cypher';if(!_['isNil'](_0x590401['value'])&&fs[_0xb7d1('0x55')](_0x553780)){logger['info'](_0xb7d1('0x69')+_0x553780+_0xb7d1('0x6a'));fs[_0xb7d1('0x6b')](_0x553780);}return _0x590401;})[_0xb7d1('0x28')](function(_0xd4b1f1){if(!_0xd4b1f1)throw new InternalError();return _0xd4b1f1[_0xb7d1('0x29')]();})['then'](function(){_0x325df4[_0xb7d1('0x1e')](0xcc)[_0xb7d1('0x1f')]();})['catch'](handleError(_0x325df4,null));};function getBucketslist(_0x313d61,_0x48e025,_0x4ed485){return new Promise(function(_0x11a87e,_0xf3f51a){var _0x3e10b2=new AWS['S3']({'accessKeyId':_0x48e025,'secretAccessKey':_0x313d61,'region':_0x4ed485});_0x3e10b2[_0xb7d1('0x6c')]({},function(_0x5379d9,_0x31051b){if(_0x5379d9){return _0xf3f51a(_0x5379d9);}else{return _0x11a87e(_0x31051b);}});});}function createBucket(_0x204415,_0x432825,_0x134756,_0x2989c1){return new Promise(function(_0x46bdce,_0x2224ff){var _0x56fba1=new AWS['S3']({'accessKeyId':_0x432825,'secretAccessKey':_0x204415,'region':_0x134756});_0x56fba1[_0xb7d1('0x6d')]({'Bucket':_0x2989c1},function(_0x25dca9,_0x385d0f){if(_0x25dca9){return _0x2224ff(_0x25dca9);}else{return _0x46bdce(_0x385d0f);}});});}function uploadFile(_0x3e9818,_0x3326b8,_0x3bc850,_0x237fec,_0x5c39fd,_0xd7a4b4){return new Promise(function(_0x123911,_0x5e1179){var _0x833ee9=new AWS['S3']({'accessKeyId':_0x3326b8,'secretAccessKey':_0x3e9818,'region':_0x3bc850});_0x833ee9[_0xb7d1('0x6e')]({'Bucket':_0x237fec,'Key':_0x5c39fd,'Body':_0xd7a4b4},function(_0x57fc96,_0x4950f2){if(_0x57fc96){return _0x5e1179(_0x57fc96);}else{return _0x123911(_0x4950f2);}});});}function startTranscribe(_0x43c894,_0x1e80f8,_0xf65ef1,_0x4a433d,_0xf920ca,_0x2b866f){return new Promise(function(_0x5c7210,_0x2ae487){var _0x36aa73=new AWS[(_0xb7d1('0x6f'))]({'accessKeyId':_0x1e80f8,'secretAccessKey':_0x43c894,'region':_0xf65ef1});_0x36aa73['startTranscriptionJob']({'TranscriptionJobName':_0x4a433d,'LanguageCode':_0xf920ca,'Media':{'MediaFileUri':_0x2b866f}},function(_0x6790f1,_0x139867){if(_0x6790f1){return _0x2ae487(_0x6790f1);}else{return _0x5c7210(_0x139867);}});});}function transcribe(_0x4a7a4e,_0xb38e11,_0x5aa906,_0x36031c,_0x15d8cb,_0x1c8898,_0x2e31b9){return new Promise(function(_0x436bab,_0x2cf7a){var _0x366706={};logger[_0xb7d1('0x67')](util[_0xb7d1('0x53')](_0xb7d1('0x70'),_0x4a7a4e,_0x15d8cb));return uploadFile(_0xb38e11,_0x5aa906,_0x36031c,_0x15d8cb,path[_0xb7d1('0x71')](_0x1c8898),fs[_0xb7d1('0x72')](_0x1c8898))[_0xb7d1('0x28')](function(_0x279025){logger[_0xb7d1('0x67')](util[_0xb7d1('0x53')](_0xb7d1('0x73'),_0x4a7a4e,_0x15d8cb,_0x279025[_0xb7d1('0x74')]));_0x366706[_0xb7d1('0x75')]=_0x279025[_0xb7d1('0x76')];_0x366706[_0xb7d1('0x77')]=_0x279025['Location'];logger[_0xb7d1('0x67')](util[_0xb7d1('0x53')](_0xb7d1('0x78'),_0x4a7a4e));return startTranscribe(_0xb38e11,_0x5aa906,_0x36031c,uuidv4(),_0x2e31b9,_0x279025[_0xb7d1('0x74')]);})[_0xb7d1('0x28')](function(_0x3ffd81){logger['info'](util[_0xb7d1('0x53')](_0xb7d1('0x79'),_0x4a7a4e,_0x3ffd81['TranscriptionJob'][_0xb7d1('0x7a')]));_0x366706['transcribeName']=_0x3ffd81[_0xb7d1('0x7b')][_0xb7d1('0x7a')];_0x366706[_0xb7d1('0x7c')]=_0x3ffd81[_0xb7d1('0x7b')][_0xb7d1('0x7d')];return _0x436bab(_0x366706);})[_0xb7d1('0x46')](function(_0x3f15d4){return _0x2cf7a(_0x3f15d4);});});}exports[_0xb7d1('0x7e')]=function(_0x350abd,_0x39dce6,_0x2c3ac5){var _0x5669fc;var _0x39dbd1;var _0x2cae13;var _0x3d60d8=require(_0xb7d1('0x7f'));return db[_0xb7d1('0x2e')]['findOne']({'where':{'id':_0x350abd[_0xb7d1('0x48')]['id']}})[_0xb7d1('0x28')](function(_0x388972){if(_0x388972){var _0x531521=util[_0xb7d1('0x53')](_0xb7d1('0x54'),_0x388972[_0xb7d1('0x52')]);if(fs[_0xb7d1('0x55')](_0x531521)){cypher=!![];return _0x3d60d8[_0xb7d1('0x56')](_0x531521,_0x388972['value'],config[_0xb7d1('0x57')][_0xb7d1('0x58')])['then'](function(){return _0x388972;});}return _0x388972;}})[_0xb7d1('0x28')](function(_0x39c2f9){if(!_0x39c2f9){throw new db['Sequelize'][(_0xb7d1('0x59'))](_0xb7d1('0x80'));}_0x39dbd1=_0x39c2f9;return db[_0xb7d1('0x81')][_0xb7d1('0x82')]({'where':{'id':0x1}});})[_0xb7d1('0x28')](handleEntityNotFound(_0x39dce6,null))['then'](function(_0x6fffb2){if(_0x6fffb2){_0x5669fc=_0x6fffb2;if(!_0x5669fc[_0xb7d1('0x83')]||!_0x5669fc[_0xb7d1('0x84')]||!_0x5669fc[_0xb7d1('0x85')]||!_0x5669fc[_0xb7d1('0x86')]||!_0x5669fc[_0xb7d1('0x75')]){throw new db['Sequelize'][(_0xb7d1('0x59'))](_0xb7d1('0x87'));}if(_0x350abd[_0xb7d1('0x4d')][_0xb7d1('0x88')]&&(!_0x5669fc['sentiment']||!_0x5669fc[_0xb7d1('0x89')]||!_0x5669fc[_0xb7d1('0x8a')]||!_0x5669fc['language']||!_0x5669fc['bucket'])){throw new db[(_0xb7d1('0x8b'))][(_0xb7d1('0x59'))]('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0xb7d1('0x82')]({'where':{'id':_0x5669fc[_0xb7d1('0x84')]}});}})[_0xb7d1('0x28')](function(_0x43e968){if(!_0x43e968){throw new db[(_0xb7d1('0x8b'))][(_0xb7d1('0x59'))](_0xb7d1('0x8c'));}if(!_0x43e968[_0xb7d1('0x8d')]||!_0x43e968[_0xb7d1('0x8e')]){throw new db['Sequelize'][(_0xb7d1('0x59'))]('Cloud\x20Provider\x20not\x20configured');}_0x2cae13=_0x43e968;return getBucketslist(_0x2cae13[_0xb7d1('0x8d')],_0x2cae13['data2'],_0x5669fc[_0xb7d1('0x85')]);})['then'](function(_0x4c11ad){if(_0x4c11ad&&_0x4c11ad[_0xb7d1('0x8f')]){var _0xc49bb3=_[_0xb7d1('0x4b')](_0x4c11ad[_0xb7d1('0x8f')],function(_0xfe0070){return _0xfe0070[_0xb7d1('0x90')]===_0x5669fc[_0xb7d1('0x75')];});if(!_0xc49bb3){logger[_0xb7d1('0x67')](util[_0xb7d1('0x53')](_0xb7d1('0x91'),_0x350abd[_0xb7d1('0x48')]['id'],_0x5669fc[_0xb7d1('0x75')]));return createBucket(_0x2cae13[_0xb7d1('0x8d')],_0x2cae13[_0xb7d1('0x8e')],_0x5669fc[_0xb7d1('0x85')],_0x5669fc[_0xb7d1('0x75')]);}logger['info'](util[_0xb7d1('0x53')](_0xb7d1('0x92'),_0x350abd[_0xb7d1('0x48')]['id'],_0x5669fc[_0xb7d1('0x75')]));return;}})[_0xb7d1('0x28')](function(_0x35435b){if(_0x39dbd1[_0xb7d1('0x7c')]===_0xb7d1('0x93')){return transcribe(_0x350abd[_0xb7d1('0x48')]['id'],_0x2cae13['data1'],_0x2cae13[_0xb7d1('0x8e')],_0x5669fc[_0xb7d1('0x85')],_0x5669fc[_0xb7d1('0x75')],_0x39dbd1['value'],_0x5669fc[_0xb7d1('0x86')]);}else{logger[_0xb7d1('0x67')](util['format'](_0xb7d1('0x94'),_0x350abd[_0xb7d1('0x48')]['id']));return{'transcribeStatus':_0xb7d1('0x95')};}})[_0xb7d1('0x28')](function(_0x4d04c4){if(_0x4d04c4){_0x4d04c4[_0xb7d1('0x96')]=_0x350abd['body'][_0xb7d1('0x88')];return _0x39dbd1[_0xb7d1('0x97')](_0x4d04c4);}})['then'](respondWithResult(_0x39dce6,null))['catch'](handleError(_0x39dce6,null));};function writeFile(_0x449469,_0x63efb8){return new Promise(function(_0x3784fe,_0x45fcc2){fs[_0xb7d1('0x98')](_0x63efb8,_0x449469,function(_0x250c23,_0x19a2bd){if(_0x250c23){return _0x45fcc2(_0x250c23);}else{return _0x3784fe(_0x19a2bd);}});});}exports[_0xb7d1('0x99')]=function(_0x451716,_0x3263b6,_0x322363){return db['VoiceRecording'][_0xb7d1('0x82')]({'where':{'id':_0x451716['params']['id']}})['then'](handleEntityNotFound(_0x3263b6))[_0xb7d1('0x28')](function(_0x2152b3){if(_0x2152b3&&_0x2152b3[_0xb7d1('0x9a')]){var _0x1e9924=_0x2152b3[_0xb7d1('0x9a')];var _0x3ec7b6=config['root']+'/server/files/transcribes/transcribe_'+_0x2152b3['id']+_0xb7d1('0x9b');if(fs[_0xb7d1('0x55')](_0x3ec7b6)){return _0x3ec7b6;}return writeFile(_0x1e9924,_0x3ec7b6)['then'](function(){return _0x3ec7b6;});}else{throw new db[(_0xb7d1('0x8b'))][(_0xb7d1('0x59'))]('Transcript\x20not\x20available');}})['then'](function(_0x11f686){return _0x3263b6[_0xb7d1('0x50')](_0x11f686);})[_0xb7d1('0x46')](handleError(_0x3263b6));};
\ No newline at end of file
+var _0x6c0d=['differenceBy','map','format','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','VoiceRecording','includeAll','include','findAll','catch','show','params','keys','find','body','update','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','ValidationError','VoiceRecording\x20not\x20found','download','filename','extname','unlink','message','Not\x20found','downloads','sequelize','col','push','$and','Sequelize','destroy','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','findOne','recording','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','count','limit','status','set','Content-Range','apply','reject','save','then','end','error','name','send','index','rawAttributes','key'];(function(_0x34ed02,_0x3eddbb){var _0xa80fcd=function(_0x1ea952){while(--_0x1ea952){_0x34ed02['push'](_0x34ed02['shift']());}};_0xa80fcd(++_0x3eddbb);}(_0x6c0d,0x1a1));var _0xd6c0=function(_0x24011e,_0x1990bb){_0x24011e=_0x24011e-0x0;var _0x183c10=_0x6c0d[_0x24011e];return _0x183c10;};'use strict';var emlformat=require(_0xd6c0('0x0'));var rimraf=require(_0xd6c0('0x1'));var zipdir=require(_0xd6c0('0x2'));var jsonpatch=require(_0xd6c0('0x3'));var rp=require('request-promise');var moment=require(_0xd6c0('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd6c0('0x5'));var path=require(_0xd6c0('0x6'));var sox=require(_0xd6c0('0x7'));var csv=require(_0xd6c0('0x8'));var ejs=require(_0xd6c0('0x9'));var fs=require('fs');var fs_extra=require(_0xd6c0('0xa'));var _=require('lodash');var squel=require(_0xd6c0('0xb'));var crypto=require(_0xd6c0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd6c0('0xd'));var toCsv=require(_0xd6c0('0x8'));var querystring=require(_0xd6c0('0xe'));var Papa=require('papaparse');var AWS=require(_0xd6c0('0xf'));var uuidv4=require(_0xd6c0('0x10'));var Redis=require(_0xd6c0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd6c0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6c0('0x13'));var logger=require(_0xd6c0('0x14'))(_0xd6c0('0x15'));var utils=require(_0xd6c0('0x16'));var config=require(_0xd6c0('0x17'));var licenseUtil=require(_0xd6c0('0x18'));var db=require(_0xd6c0('0x19'))['db'];function respondWithStatusCode(_0x246321,_0x30db79){_0x30db79=_0x30db79||0xcc;return function(_0x2a06c9){if(_0x2a06c9){return _0x246321[_0xd6c0('0x1a')](_0x30db79);}return _0x246321['status'](_0x30db79)['end']();};}function respondWithResult(_0x3934eb,_0x28a5ef){_0x28a5ef=_0x28a5ef||0xc8;return function(_0x229240){if(_0x229240){return _0x3934eb['status'](_0x28a5ef)[_0xd6c0('0x1b')](_0x229240);}};}function respondWithFilteredResult(_0x4687ac,_0x580efa){return function(_0x22fe1e){if(_0x22fe1e){var _0x10bb5b=typeof _0x580efa[_0xd6c0('0x1c')]==='undefined'&&typeof _0x580efa['limit']==='undefined';var _0x34160e=_0x22fe1e[_0xd6c0('0x1d')];var _0x384e2f=_0x10bb5b?0x0:_0x580efa[_0xd6c0('0x1c')];var _0x40df4d=_0x10bb5b?_0x22fe1e['count']:_0x580efa[_0xd6c0('0x1c')]+_0x580efa[_0xd6c0('0x1e')];var _0x5bdd03;if(_0x40df4d>=_0x34160e){_0x40df4d=_0x34160e;_0x5bdd03=0xc8;}else{_0x5bdd03=0xce;}_0x4687ac[_0xd6c0('0x1f')](_0x5bdd03);return _0x4687ac[_0xd6c0('0x20')](_0xd6c0('0x21'),_0x384e2f+'-'+_0x40df4d+'/'+_0x34160e)[_0xd6c0('0x1b')](_0x22fe1e);}return null;};}function patchUpdates(_0x4b0373){return function(_0x3a9cd9){try{jsonpatch[_0xd6c0('0x22')](_0x3a9cd9,_0x4b0373,!![]);}catch(_0x10c6dc){return BPromise[_0xd6c0('0x23')](_0x10c6dc);}return _0x3a9cd9[_0xd6c0('0x24')]();};}function saveUpdates(_0x21f854,_0xfa2b5f){return function(_0x4bdfea){if(_0x4bdfea){return _0x4bdfea['update'](_0x21f854)[_0xd6c0('0x25')](function(_0x5efddb){return _0x5efddb;});}return null;};}function removeEntity(_0x3d8852,_0x4e93d7){return function(_0x50a137){if(_0x50a137){return _0x50a137['destroy']()[_0xd6c0('0x25')](function(){_0x3d8852['status'](0xcc)[_0xd6c0('0x26')]();});}};}function handleEntityNotFound(_0x4773d8,_0x1bb353){return function(_0x4e621d){if(!_0x4e621d){_0x4773d8[_0xd6c0('0x1a')](0x194);}return _0x4e621d;};}function handleError(_0x1b09bf,_0x40d7ca){_0x40d7ca=_0x40d7ca||0x1f4;return function(_0x3747e5){logger[_0xd6c0('0x27')](_0x3747e5['stack']);if(_0x3747e5[_0xd6c0('0x28')]){delete _0x3747e5['name'];}_0x1b09bf[_0xd6c0('0x1f')](_0x40d7ca)[_0xd6c0('0x29')](_0x3747e5);};}exports[_0xd6c0('0x2a')]=function(_0x4abf19,_0x5ee406){var _0x30c2ae={},_0x4a32ab={},_0x310c2b={'count':0x0,'rows':[]};var _0x3cf22a=_['map'](db['VoiceRecording'][_0xd6c0('0x2b')],function(_0x2393d7){return{'name':_0x2393d7['fieldName'],'type':_0x2393d7['type'][_0xd6c0('0x2c')]};});_0x4a32ab['model']=_[_0xd6c0('0x2d')](_[_0xd6c0('0x2e')](_0x3cf22a,_0xd6c0('0x28')),[_0xd6c0('0x2f')]);_0x4a32ab[_0xd6c0('0x30')]=_['keys'](_0x4abf19[_0xd6c0('0x30')]);_0x4a32ab[_0xd6c0('0x31')]=_[_0xd6c0('0x32')](_0x4a32ab['model'],_0x4a32ab[_0xd6c0('0x30')]);_0x30c2ae[_0xd6c0('0x33')]=_[_0xd6c0('0x32')](_0x4a32ab[_0xd6c0('0x34')],qs[_0xd6c0('0x35')](_0x4abf19[_0xd6c0('0x30')][_0xd6c0('0x35')]));_0x30c2ae['attributes']=_0x30c2ae['attributes'][_0xd6c0('0x36')]?_0x30c2ae[_0xd6c0('0x33')]:_0x4a32ab[_0xd6c0('0x34')];if(!_0x4abf19[_0xd6c0('0x30')][_0xd6c0('0x37')](_0xd6c0('0x38'))){_0x30c2ae[_0xd6c0('0x1e')]=qs[_0xd6c0('0x1e')](_0x4abf19['query'][_0xd6c0('0x1e')]);_0x30c2ae[_0xd6c0('0x1c')]=qs['offset'](_0x4abf19[_0xd6c0('0x30')]['offset']);}_0x30c2ae[_0xd6c0('0x39')]=qs[_0xd6c0('0x3a')](_0x4abf19[_0xd6c0('0x30')][_0xd6c0('0x3a')]);_0x30c2ae[_0xd6c0('0x3b')]=qs[_0xd6c0('0x31')](_[_0xd6c0('0x3c')](_0x4abf19[_0xd6c0('0x30')],_0x4a32ab['filters']),_0x3cf22a);if(_0x4abf19[_0xd6c0('0x30')]['filter']){_0x30c2ae['where']=_[_0xd6c0('0x3d')](_0x30c2ae[_0xd6c0('0x3b')],{'$or':_[_0xd6c0('0x2e')](_0x3cf22a,function(_0x292a3a){if(_0x292a3a[_0xd6c0('0x3e')]!==_0xd6c0('0x3f')){var _0xd67df0={};_0xd67df0[_0x292a3a[_0xd6c0('0x28')]]={'$like':'%'+_0x4abf19[_0xd6c0('0x30')][_0xd6c0('0x40')]+'%'};return _0xd67df0;}})});}_0x30c2ae=_[_0xd6c0('0x3d')]({},_0x30c2ae,_0x4abf19[_0xd6c0('0x41')]);var _0x3727af={'where':_0x30c2ae[_0xd6c0('0x3b')]};return db[_0xd6c0('0x42')][_0xd6c0('0x1d')](_0x3727af)[_0xd6c0('0x25')](function(_0x2bdeb9){_0x310c2b[_0xd6c0('0x1d')]=_0x2bdeb9;if(_0x4abf19[_0xd6c0('0x30')][_0xd6c0('0x43')]){_0x30c2ae[_0xd6c0('0x44')]=[{'all':!![]}];}return db['VoiceRecording'][_0xd6c0('0x45')](_0x30c2ae);})[_0xd6c0('0x25')](function(_0x1f05b6){_0x310c2b['rows']=_0x1f05b6;return _0x310c2b;})[_0xd6c0('0x25')](respondWithFilteredResult(_0x5ee406,_0x30c2ae))[_0xd6c0('0x46')](handleError(_0x5ee406,null));};exports[_0xd6c0('0x47')]=function(_0x1b8041,_0x4247b8){var _0x4cf633={'raw':![],'where':{'id':_0x1b8041[_0xd6c0('0x48')]['id']}},_0x525887={};_0x525887[_0xd6c0('0x34')]=_[_0xd6c0('0x49')](db[_0xd6c0('0x42')][_0xd6c0('0x2b')]);_0x525887[_0xd6c0('0x30')]=_[_0xd6c0('0x49')](_0x1b8041[_0xd6c0('0x30')]);_0x525887[_0xd6c0('0x31')]=_[_0xd6c0('0x32')](_0x525887[_0xd6c0('0x34')],_0x525887['query']);_0x4cf633[_0xd6c0('0x33')]=_[_0xd6c0('0x32')](_0x525887[_0xd6c0('0x34')],qs['fields'](_0x1b8041['query'][_0xd6c0('0x35')]));_0x4cf633[_0xd6c0('0x33')]=_0x4cf633[_0xd6c0('0x33')][_0xd6c0('0x36')]?_0x4cf633['attributes']:_0x525887[_0xd6c0('0x34')];if(_0x1b8041[_0xd6c0('0x30')][_0xd6c0('0x43')]){_0x4cf633[_0xd6c0('0x44')]=[{'all':!![]}];}_0x4cf633=_[_0xd6c0('0x3d')]({},_0x4cf633,_0x1b8041[_0xd6c0('0x41')]);return db[_0xd6c0('0x42')][_0xd6c0('0x4a')](_0x4cf633)[_0xd6c0('0x25')](handleEntityNotFound(_0x4247b8,null))[_0xd6c0('0x25')](respondWithResult(_0x4247b8,null))[_0xd6c0('0x46')](handleError(_0x4247b8,null));};exports['create']=function(_0xde29f8,_0x169f7f){return db[_0xd6c0('0x42')]['create'](_0xde29f8[_0xd6c0('0x4b')],{})[_0xd6c0('0x25')](respondWithResult(_0x169f7f,0xc9))[_0xd6c0('0x46')](handleError(_0x169f7f,null));};exports[_0xd6c0('0x4c')]=function(_0x2fb0dd,_0x351637){if(_0x2fb0dd[_0xd6c0('0x4b')]['id']){delete _0x2fb0dd[_0xd6c0('0x4b')]['id'];}return db[_0xd6c0('0x42')][_0xd6c0('0x4a')]({'where':{'id':_0x2fb0dd[_0xd6c0('0x48')]['id']}})[_0xd6c0('0x25')](handleEntityNotFound(_0x351637,null))[_0xd6c0('0x25')](saveUpdates(_0x2fb0dd[_0xd6c0('0x4b')],null))['then'](respondWithResult(_0x351637,null))[_0xd6c0('0x46')](handleError(_0x351637,null));};exports[_0xd6c0('0x4d')]=function(_0x542725,_0x138417){return db[_0xd6c0('0x42')]['describe']()[_0xd6c0('0x25')](respondWithResult(_0x138417,null))[_0xd6c0('0x46')](handleError(_0x138417,null));};exports['download']=function(_0x2b1a3f,_0x37bd06,_0x36e40d){var _0x12572d=require(_0xd6c0('0x4e'));var _0x56442a=![];var _0xcef21a={};if(_0x2b1a3f['query'][_0xd6c0('0x3e')]&&_0x2b1a3f[_0xd6c0('0x30')][_0xd6c0('0x3e')]===_0xd6c0('0x4f')){_0xcef21a[_0xd6c0('0x4f')]=_0x2b1a3f[_0xd6c0('0x48')]['id'];}else{_0xcef21a['id']=_0x2b1a3f[_0xd6c0('0x48')]['id'];}return db['VoiceRecording'][_0xd6c0('0x4a')]({'where':_0xcef21a,'attributes':['id',_0xd6c0('0x50')],'raw':!![]})[_0xd6c0('0x25')](handleEntityNotFound(_0x37bd06,null))['then'](function(_0x3ec6ce){if(_0x3ec6ce){var _0x2d90e8=_0x3ec6ce['value'];var _0x24d337=util['format'](_0xd6c0('0x51'),_0x2d90e8);if(fs[_0xd6c0('0x52')](_0x24d337)){_0x56442a=!![];return _0x12572d[_0xd6c0('0x53')](_0x24d337,_0x2d90e8,config[_0xd6c0('0x54')]['recording'])[_0xd6c0('0x25')](function(){return _0x3ec6ce;});}return _0x3ec6ce;}})[_0xd6c0('0x25')](function(_0x23ff50){if(_0x23ff50){var _0x3ef202=_0x23ff50[_0xd6c0('0x50')];if(!fs[_0xd6c0('0x52')](_0x3ef202)){throw new db['Sequelize'][(_0xd6c0('0x55'))](_0xd6c0('0x56'));}if(_0x23ff50['filename']){return _0x37bd06[_0xd6c0('0x57')](_0x3ef202,_0x23ff50[_0xd6c0('0x58')]+path[_0xd6c0('0x59')](_0x3ef202),function(){if(_0x56442a){fs[_0xd6c0('0x5a')](_0x3ef202);}});}else{return _0x37bd06[_0xd6c0('0x57')](_0x3ef202,function(_0x52ae96){if(_0x56442a){fs[_0xd6c0('0x5a')](_0x3ef202);}});}}})[_0xd6c0('0x46')](function(_0x3092f2){if(_0x3092f2[_0xd6c0('0x5b')]===_0xd6c0('0x56')){_0x37bd06[_0xd6c0('0x1f')](0x194)[_0xd6c0('0x29')](_0xd6c0('0x5c'));}else{return handleError(_0x37bd06,null);}});};exports[_0xd6c0('0x5d')]=function(_0x3f91dc,_0x7dc31a,_0x539a90){var _0x447a15=require(_0xd6c0('0x4e'));var _0x1e3514=![];var _0x13d9c4={'$and':[db[_0xd6c0('0x5e')]['where'](db['sequelize']['fn']('MD5',db[_0xd6c0('0x5e')][_0xd6c0('0x5f')](_0xd6c0('0x4f'))),_0x3f91dc[_0xd6c0('0x30')]['token'])]};if(_0x3f91dc[_0xd6c0('0x30')]['type']&&_0x3f91dc['query'][_0xd6c0('0x3e')]===_0xd6c0('0x4f')){_0x13d9c4['$and'][_0xd6c0('0x60')]({'uniqueid':_0x3f91dc[_0xd6c0('0x48')]['id']});}else{_0x13d9c4[_0xd6c0('0x61')][_0xd6c0('0x60')]({'id':_0x3f91dc[_0xd6c0('0x48')]['id']});}return db['VoiceRecording'][_0xd6c0('0x4a')]({'where':_0x13d9c4,'attributes':['id',_0xd6c0('0x50')],'raw':!![]})[_0xd6c0('0x25')](handleEntityNotFound(_0x7dc31a,null))[_0xd6c0('0x25')](function(_0x4636c4){if(_0x4636c4){var _0x2c1e0f=util[_0xd6c0('0x2f')](_0xd6c0('0x51'),_0x4636c4[_0xd6c0('0x50')]);if(fs[_0xd6c0('0x52')](_0x2c1e0f)){_0x1e3514=!![];return _0x447a15[_0xd6c0('0x53')](_0x2c1e0f,_0x4636c4['value'],config[_0xd6c0('0x54')]['recording'])['then'](function(){return _0x4636c4;});}return _0x4636c4;}})[_0xd6c0('0x25')](function(_0x4961e1){if(_0x4961e1){if(!fs[_0xd6c0('0x52')](_0x4961e1[_0xd6c0('0x50')])){throw new db[(_0xd6c0('0x62'))]['ValidationError'](_0xd6c0('0x56'));}if(_0x4961e1['filename']){return _0x7dc31a[_0xd6c0('0x57')](_0x4961e1[_0xd6c0('0x50')],_0x4961e1['filename']+path[_0xd6c0('0x59')](_0x4961e1[_0xd6c0('0x50')]),function(){if(_0x1e3514){fs['unlink'](_0x4961e1[_0xd6c0('0x50')]);}});}else{return _0x7dc31a[_0xd6c0('0x57')](_0x4961e1[_0xd6c0('0x50')],function(_0x288249){if(_0x1e3514){fs[_0xd6c0('0x5a')](_0x4961e1[_0xd6c0('0x50')]);}});}}})[_0xd6c0('0x46')](handleError(_0x7dc31a,null));};exports[_0xd6c0('0x63')]=function(_0x575dce,_0x168082){return db[_0xd6c0('0x42')][_0xd6c0('0x4a')]({'where':{'id':_0x575dce[_0xd6c0('0x48')]['id']}})[_0xd6c0('0x25')](function(_0x1052aa){if(_[_0xd6c0('0x64')](_0x1052aa)){throw new ReferenceError(_0xd6c0('0x65'));}return _0x1052aa;})[_0xd6c0('0x25')](function(_0x5f4080){var _0x3bb6e9=_0x5f4080[_0xd6c0('0x50')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x3bb6e9);if(!_[_0xd6c0('0x64')](_0x5f4080[_0xd6c0('0x50')])&&fs[_0xd6c0('0x52')](_0x3bb6e9)){logger[_0xd6c0('0x66')](_0xd6c0('0x67')+_0x3bb6e9+_0xd6c0('0x68'));fs[_0xd6c0('0x69')](_0x3bb6e9);}_0x3bb6e9=_0x3bb6e9+'.cypher';if(!_['isNil'](_0x5f4080[_0xd6c0('0x50')])&&fs[_0xd6c0('0x52')](_0x3bb6e9)){logger[_0xd6c0('0x66')]('File:\x20\x22'+_0x3bb6e9+_0xd6c0('0x68'));fs[_0xd6c0('0x69')](_0x3bb6e9);}return _0x5f4080;})[_0xd6c0('0x25')](function(_0x23f28d){if(!_0x23f28d)throw new InternalError();return _0x23f28d['destroy']();})['then'](function(){_0x168082['status'](0xcc)['end']();})[_0xd6c0('0x46')](handleError(_0x168082,null));};function getBucketslist(_0x4c7340,_0x51a262,_0xa53a97){return new Promise(function(_0x3602b0,_0x9b5094){var _0x215147=new AWS['S3']({'accessKeyId':_0x51a262,'secretAccessKey':_0x4c7340,'region':_0xa53a97});_0x215147[_0xd6c0('0x6a')]({},function(_0x333bfd,_0x2fea9d){if(_0x333bfd){return _0x9b5094(_0x333bfd);}else{return _0x3602b0(_0x2fea9d);}});});}function createBucket(_0x3978c5,_0x2a9af8,_0x3796fc,_0x3e4bec){return new Promise(function(_0x4fdfa3,_0x33964b){var _0x3d889c=new AWS['S3']({'accessKeyId':_0x2a9af8,'secretAccessKey':_0x3978c5,'region':_0x3796fc});_0x3d889c['createBucket']({'Bucket':_0x3e4bec},function(_0x1f1d6e,_0x342ddd){if(_0x1f1d6e){return _0x33964b(_0x1f1d6e);}else{return _0x4fdfa3(_0x342ddd);}});});}function uploadFile(_0x37677f,_0x394b79,_0x37f45d,_0x121fa6,_0x4c2325,_0x58d4b1){return new Promise(function(_0x5a98a,_0x518718){var _0x114748=new AWS['S3']({'accessKeyId':_0x394b79,'secretAccessKey':_0x37677f,'region':_0x37f45d});_0x114748[_0xd6c0('0x6b')]({'Bucket':_0x121fa6,'Key':_0x4c2325,'Body':_0x58d4b1},function(_0x41b9fc,_0x14feab){if(_0x41b9fc){return _0x518718(_0x41b9fc);}else{return _0x5a98a(_0x14feab);}});});}function startTranscribe(_0x54d71b,_0x254fc7,_0x19103d,_0x538a34,_0x1ef162,_0x812476){return new Promise(function(_0x1021f8,_0x23ab74){var _0x5440e7=new AWS[(_0xd6c0('0x6c'))]({'accessKeyId':_0x254fc7,'secretAccessKey':_0x54d71b,'region':_0x19103d});_0x5440e7[_0xd6c0('0x6d')]({'TranscriptionJobName':_0x538a34,'LanguageCode':_0x1ef162,'Media':{'MediaFileUri':_0x812476}},function(_0x18b05c,_0x40d0c8){if(_0x18b05c){return _0x23ab74(_0x18b05c);}else{return _0x1021f8(_0x40d0c8);}});});}function transcribe(_0xb0f590,_0x667b9f,_0x4c3e86,_0x38b09e,_0x2e03d8,_0x102ba2,_0x182d5c){return new Promise(function(_0x3afc0b,_0x3835f1){var _0x30497f={};logger[_0xd6c0('0x66')](util[_0xd6c0('0x2f')](_0xd6c0('0x6e'),_0xb0f590,_0x2e03d8));return uploadFile(_0x667b9f,_0x4c3e86,_0x38b09e,_0x2e03d8,path['basename'](_0x102ba2),fs[_0xd6c0('0x6f')](_0x102ba2))[_0xd6c0('0x25')](function(_0x587250){logger['info'](util[_0xd6c0('0x2f')](_0xd6c0('0x70'),_0xb0f590,_0x2e03d8,_0x587250['Location']));_0x30497f['bucket']=_0x587250[_0xd6c0('0x71')];_0x30497f[_0xd6c0('0x72')]=_0x587250[_0xd6c0('0x73')];logger[_0xd6c0('0x66')](util[_0xd6c0('0x2f')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0xb0f590));return startTranscribe(_0x667b9f,_0x4c3e86,_0x38b09e,uuidv4(),_0x182d5c,_0x587250[_0xd6c0('0x73')]);})[_0xd6c0('0x25')](function(_0x11dd54){logger['info'](util[_0xd6c0('0x2f')](_0xd6c0('0x74'),_0xb0f590,_0x11dd54[_0xd6c0('0x75')][_0xd6c0('0x76')]));_0x30497f[_0xd6c0('0x77')]=_0x11dd54[_0xd6c0('0x75')]['TranscriptionJobName'];_0x30497f[_0xd6c0('0x78')]=_0x11dd54[_0xd6c0('0x75')]['TranscriptionJobStatus'];return _0x3afc0b(_0x30497f);})[_0xd6c0('0x46')](function(_0x1cdadd){return _0x3835f1(_0x1cdadd);});});}exports[_0xd6c0('0x79')]=function(_0x3b8d40,_0x5af323,_0x248fb8){var _0x56d5ba;var _0x4c88dc;var _0x329889;var _0x58d318=require(_0xd6c0('0x4e'));return db[_0xd6c0('0x42')][_0xd6c0('0x7a')]({'where':{'id':_0x3b8d40[_0xd6c0('0x48')]['id']}})[_0xd6c0('0x25')](function(_0x462275){if(_0x462275){var _0x46ed0c=util['format'](_0xd6c0('0x51'),_0x462275[_0xd6c0('0x50')]);if(fs[_0xd6c0('0x52')](_0x46ed0c)){cypher=!![];return _0x58d318['decryptFile'](_0x46ed0c,_0x462275[_0xd6c0('0x50')],config[_0xd6c0('0x54')][_0xd6c0('0x7b')])['then'](function(){return _0x462275;});}return _0x462275;}})[_0xd6c0('0x25')](function(_0x262f6f){if(!_0x262f6f){throw new db['Sequelize'][(_0xd6c0('0x55'))](_0xd6c0('0x7c'));}_0x4c88dc=_0x262f6f;return db[_0xd6c0('0x7d')]['findOne']({'where':{'id':0x1}});})[_0xd6c0('0x25')](handleEntityNotFound(_0x5af323,null))['then'](function(_0xeb7a2f){if(_0xeb7a2f){_0x56d5ba=_0xeb7a2f;if(!_0x56d5ba[_0xd6c0('0x7e')]||!_0x56d5ba[_0xd6c0('0x7f')]||!_0x56d5ba[_0xd6c0('0x80')]||!_0x56d5ba[_0xd6c0('0x81')]||!_0x56d5ba[_0xd6c0('0x82')]){throw new db[(_0xd6c0('0x62'))][(_0xd6c0('0x55'))](_0xd6c0('0x83'));}if(_0x3b8d40[_0xd6c0('0x4b')][_0xd6c0('0x84')]&&(!_0x56d5ba['sentiment']||!_0x56d5ba[_0xd6c0('0x85')]||!_0x56d5ba[_0xd6c0('0x86')]||!_0x56d5ba[_0xd6c0('0x81')]||!_0x56d5ba['bucket'])){throw new db['Sequelize'][(_0xd6c0('0x55'))](_0xd6c0('0x87'));}return db[_0xd6c0('0x88')][_0xd6c0('0x7a')]({'where':{'id':_0x56d5ba[_0xd6c0('0x7f')]}});}})[_0xd6c0('0x25')](function(_0x564e9e){if(!_0x564e9e){throw new db[(_0xd6c0('0x62'))][(_0xd6c0('0x55'))](_0xd6c0('0x89'));}if(!_0x564e9e[_0xd6c0('0x8a')]||!_0x564e9e[_0xd6c0('0x8b')]){throw new db[(_0xd6c0('0x62'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x329889=_0x564e9e;return getBucketslist(_0x329889[_0xd6c0('0x8a')],_0x329889[_0xd6c0('0x8b')],_0x56d5ba[_0xd6c0('0x80')]);})[_0xd6c0('0x25')](function(_0x38ef46){if(_0x38ef46&&_0x38ef46[_0xd6c0('0x8c')]){var _0x3c5493=_[_0xd6c0('0x4a')](_0x38ef46['Buckets'],function(_0x2a4040){return _0x2a4040[_0xd6c0('0x8d')]===_0x56d5ba[_0xd6c0('0x82')];});if(!_0x3c5493){logger['info'](util[_0xd6c0('0x2f')](_0xd6c0('0x8e'),_0x3b8d40[_0xd6c0('0x48')]['id'],_0x56d5ba[_0xd6c0('0x82')]));return createBucket(_0x329889[_0xd6c0('0x8a')],_0x329889[_0xd6c0('0x8b')],_0x56d5ba['transcribeRegion'],_0x56d5ba[_0xd6c0('0x82')]);}logger[_0xd6c0('0x66')](util[_0xd6c0('0x2f')](_0xd6c0('0x8f'),_0x3b8d40[_0xd6c0('0x48')]['id'],_0x56d5ba[_0xd6c0('0x82')]));return;}})[_0xd6c0('0x25')](function(_0x2f42f4){if(_0x4c88dc[_0xd6c0('0x78')]==='NEW'){return transcribe(_0x3b8d40[_0xd6c0('0x48')]['id'],_0x329889[_0xd6c0('0x8a')],_0x329889[_0xd6c0('0x8b')],_0x56d5ba[_0xd6c0('0x80')],_0x56d5ba['bucket'],_0x4c88dc[_0xd6c0('0x50')],_0x56d5ba['language']);}else{logger[_0xd6c0('0x66')](util['format'](_0xd6c0('0x90'),_0x3b8d40[_0xd6c0('0x48')]['id']));return{'transcribeStatus':_0xd6c0('0x91')};}})['then'](function(_0x105fdc){if(_0x105fdc){_0x105fdc[_0xd6c0('0x92')]=_0x3b8d40[_0xd6c0('0x4b')][_0xd6c0('0x84')];return _0x4c88dc[_0xd6c0('0x93')](_0x105fdc);}})[_0xd6c0('0x25')](respondWithResult(_0x5af323,null))['catch'](handleError(_0x5af323,null));};function writeFile(_0x30153a,_0xeef910){return new Promise(function(_0x3c24e4,_0x3ac442){fs[_0xd6c0('0x94')](_0xeef910,_0x30153a,function(_0x1b2ed3,_0x2a215a){if(_0x1b2ed3){return _0x3ac442(_0x1b2ed3);}else{return _0x3c24e4(_0x2a215a);}});});}exports['downloadTranscribe']=function(_0x42ec02,_0x2d8d79,_0x43ede6){return db['VoiceRecording'][_0xd6c0('0x7a')]({'where':{'id':_0x42ec02['params']['id']}})[_0xd6c0('0x25')](handleEntityNotFound(_0x2d8d79))[_0xd6c0('0x25')](function(_0x205071){if(_0x205071&&_0x205071[_0xd6c0('0x95')]){var _0x314f1c=_0x205071[_0xd6c0('0x95')];var _0x95cfb=config[_0xd6c0('0x96')]+_0xd6c0('0x97')+_0x205071['id']+_0xd6c0('0x98');if(fs['existsSync'](_0x95cfb)){return _0x95cfb;}return writeFile(_0x314f1c,_0x95cfb)[_0xd6c0('0x25')](function(){return _0x95cfb;});}else{throw new db[(_0xd6c0('0x62'))][(_0xd6c0('0x55'))](_0xd6c0('0x99'));}})[_0xd6c0('0x25')](function(_0x5123b3){return _0x2d8d79[_0xd6c0('0x57')](_0x5123b3);})[_0xd6c0('0x46')](handleError(_0x2d8d79));};
\ No newline at end of file
index 5ecd8f9..df09c7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9500=['voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','define','VoiceRecording'];(function(_0x4a68b8,_0x482104){var _0x530f1f=function(_0x164431){while(--_0x164431){_0x4a68b8['push'](_0x4a68b8['shift']());}};_0x530f1f(++_0x482104);}(_0x9500,0xb6));var _0x0950=function(_0x5c6cc9,_0x123c5e){_0x5c6cc9=_0x5c6cc9-0x0;var _0x8101d9=_0x9500[_0x5c6cc9];return _0x8101d9;};'use strict';var _=require(_0x0950('0x0'));var util=require(_0x0950('0x1'));var logger=require(_0x0950('0x2'))(_0x0950('0x3'));var moment=require(_0x0950('0x4'));var BPromise=require(_0x0950('0x5'));var rp=require(_0x0950('0x6'));var fs=require('fs');var path=require(_0x0950('0x7'));var rimraf=require(_0x0950('0x8'));var config=require(_0x0950('0x9'));var attributes=require(_0x0950('0xa'));module['exports']=function(_0x591585,_0x56710c){return _0x591585[_0x0950('0xb')](_0x0950('0xc'),attributes,{'tableName':_0x0950('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0950('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3acb=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid'];(function(_0x4769c6,_0x3086e8){var _0x4bc451=function(_0x15f699){while(--_0x15f699){_0x4769c6['push'](_0x4769c6['shift']());}};_0x4bc451(++_0x3086e8);}(_0x3acb,0x114));var _0xb3ac=function(_0x5db103,_0x418819){_0x5db103=_0x5db103-0x0;var _0x33f726=_0x3acb[_0x5db103];return _0x33f726;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb3ac('0x0'))('api');var moment=require(_0xb3ac('0x1'));var BPromise=require(_0xb3ac('0x2'));var rp=require(_0xb3ac('0x3'));var fs=require('fs');var path=require(_0xb3ac('0x4'));var rimraf=require(_0xb3ac('0x5'));var config=require('../../config/environment');var attributes=require(_0xb3ac('0x6'));module[_0xb3ac('0x7')]=function(_0x4e7494,_0x4852ff){return _0x4e7494[_0xb3ac('0x8')](_0xb3ac('0x9'),attributes,{'tableName':_0xb3ac('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb3ac('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 37c5104..b5d793c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6050=['existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','../../components/encryptor','Setting','findOne','callRecordingEncryption'];(function(_0x141fb0,_0x113bc6){var _0xcdb363=function(_0x34f5f6){while(--_0x34f5f6){_0x141fb0['push'](_0x141fb0['shift']());}};_0xcdb363(++_0x113bc6);}(_0x6050,0x196));var _0x0605=function(_0x3618d2,_0x4bc7da){_0x3618d2=_0x3618d2-0x0;var _0x9d3c92=_0x6050[_0x3618d2];return _0x9d3c92;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var moment=require(_0x0605('0x2'));var BPromise=require(_0x0605('0x3'));var rs=require(_0x0605('0x4'));var fs=require('fs');var Redis=require(_0x0605('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0605('0x6'));var logger=require(_0x0605('0x7'))(_0x0605('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0605('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x578623,_0x58f7d2,_0x5660ad){return new BPromise(function(_0x1629bf,_0x11b8b5){return client[_0x0605('0xa')](_0x578623,_0x5660ad)[_0x0605('0xb')](function(_0x44fdd3){logger['info'](_0x0605('0xc'),_0x58f7d2,_0x0605('0xd'));logger[_0x0605('0xe')](_0x0605('0xf'),_0x58f7d2,_0x0605('0xd'),JSON[_0x0605('0x10')](_0x44fdd3));if(_0x44fdd3[_0x0605('0x11')]){if(_0x44fdd3[_0x0605('0x11')][_0x0605('0x12')]===0x1f4){logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);return _0x11b8b5(_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);}logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);return _0x1629bf(_0x44fdd3['error'][_0x0605('0x13')]);}else{logger[_0x0605('0x14')](_0x0605('0xc'),_0x58f7d2,'request\x20sent');_0x1629bf(_0x44fdd3['result'][_0x0605('0x13')]);}})[_0x0605('0x15')](function(_0xa83443){logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0xa83443);_0x11b8b5(_0xa83443);});});}exports[_0x0605('0x16')]=function(_0x2b7b5a){var _0x1d57ba=this;return new Promise(function(_0x193520,_0x40abb2){return db[_0x0605('0x17')][_0x0605('0x18')](_0x2b7b5a[_0x0605('0x19')],{'raw':_0x2b7b5a[_0x0605('0x1a')]?_0x2b7b5a['options'][_0x0605('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b7b5a[_0x0605('0x1a')]?_0x2b7b5a[_0x0605('0x1a')][_0x0605('0x1c')]||null:null,'attributes':_0x2b7b5a[_0x0605('0x1a')]?_0x2b7b5a[_0x0605('0x1a')][_0x0605('0x1d')]||null:null,'limit':_0x2b7b5a[_0x0605('0x1a')]?_0x2b7b5a[_0x0605('0x1a')]['limit']||null:null})[_0x0605('0xb')](function(_0x4fe293){logger[_0x0605('0x14')](_0x0605('0x16'),_0x2b7b5a);logger[_0x0605('0xe')](_0x0605('0x16'),_0x2b7b5a,JSON[_0x0605('0x10')](_0x4fe293));_0x193520(_0x4fe293);})[_0x0605('0x15')](function(_0x2ea61d){logger[_0x0605('0x11')](_0x0605('0x16'),_0x2ea61d[_0x0605('0x13')],_0x2b7b5a);_0x40abb2(_0x1d57ba[_0x0605('0x11')](0x1f4,_0x2ea61d[_0x0605('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x6bc204){var _0x3c8e36=this;return new Promise(function(_0x4b1e0c,_0x4d9a31){var _0x55ebd8=require(_0x0605('0x1e'));var _0x226825;return db[_0x0605('0x1f')][_0x0605('0x20')]({'attributes':['id',_0x0605('0x21')],'where':{'id':0x1},'raw':!![]})[_0x0605('0xb')](function(_0x4e32ef){_0x226825=_0x4e32ef;return db[_0x0605('0x17')]['create'](_0x6bc204[_0x0605('0x19')]);})[_0x0605('0xb')](function(_0x421c26){if(_0x226825[_0x0605('0x21')]&&fs[_0x0605('0x22')](_0x421c26[_0x0605('0x23')])){var _0x56dd1a=util[_0x0605('0x24')](_0x0605('0x25'),_0x421c26[_0x0605('0x23')]);return _0x55ebd8[_0x0605('0x26')](_0x421c26[_0x0605('0x23')],_0x56dd1a,config[_0x0605('0x27')][_0x0605('0x28')])[_0x0605('0xb')](function(){fs[_0x0605('0x29')](_0x421c26[_0x0605('0x23')]);logger[_0x0605('0x14')](_0x0605('0x2a'));return _0x421c26;});}return _0x421c26;})[_0x0605('0xb')](function(_0x992e4f){logger[_0x0605('0x14')](_0x0605('0x2b'),_0x6bc204);logger[_0x0605('0xe')](_0x0605('0x2b'),_0x6bc204,JSON[_0x0605('0x10')](_0x992e4f));_0x4b1e0c(_0x992e4f);})[_0x0605('0x15')](function(_0x3a1c75){logger[_0x0605('0x11')](_0x0605('0x2b'),_0x3a1c75[_0x0605('0x13')],_0x6bc204);_0x4d9a31(_0x3c8e36[_0x0605('0x11')](0x1f4,_0x3a1c75[_0x0605('0x13')]));});});};
\ No newline at end of file
+var _0xfcf0=['request\x20sent','stringify','error','message','result','UpdateVoiceRecording','update','body','options','attributes','limit','then','catch','../../components/encryptor','findOne','callRecordingEncryption','existsSync','format','%s.cypher','value','encryptFile','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceRecording,\x20%s,\x20%s','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfcf0,0x138));var _0x0fcf=function(_0x330141,_0x1dd290){_0x330141=_0x330141-0x0;var _0x1b68a2=_0xfcf0[_0x330141];return _0x1b68a2;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});}exports[_0x0fcf('0x15')]=function(_0x19cfbd){var _0x567320=this;return new Promise(function(_0x18ea32,_0x1a8f58){return db['VoiceRecording'][_0x0fcf('0x16')](_0x19cfbd[_0x0fcf('0x17')],{'raw':_0x19cfbd['options']?_0x19cfbd[_0x0fcf('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19cfbd[_0x0fcf('0x18')]?_0x19cfbd[_0x0fcf('0x18')]['where']||null:null,'attributes':_0x19cfbd[_0x0fcf('0x18')]?_0x19cfbd[_0x0fcf('0x18')][_0x0fcf('0x19')]||null:null,'limit':_0x19cfbd['options']?_0x19cfbd[_0x0fcf('0x18')][_0x0fcf('0x1a')]||null:null})[_0x0fcf('0x1b')](function(_0x41b20b){logger[_0x0fcf('0xd')](_0x0fcf('0x15'),_0x19cfbd);logger['debug'](_0x0fcf('0x15'),_0x19cfbd,JSON[_0x0fcf('0x11')](_0x41b20b));_0x18ea32(_0x41b20b);})[_0x0fcf('0x1c')](function(_0xd6f8b5){logger[_0x0fcf('0x12')](_0x0fcf('0x15'),_0xd6f8b5[_0x0fcf('0x13')],_0x19cfbd);_0x1a8f58(_0x567320[_0x0fcf('0x12')](0x1f4,_0xd6f8b5[_0x0fcf('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x18965e){var _0xc107a=this;return new Promise(function(_0x41b7a2,_0x2f198b){var _0x3876ed=require(_0x0fcf('0x1d'));var _0x2730b0;return db['Setting'][_0x0fcf('0x1e')]({'attributes':['id',_0x0fcf('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x0fcf('0x1b')](function(_0x35180d){_0x2730b0=_0x35180d;return db['VoiceRecording']['create'](_0x18965e['body']);})[_0x0fcf('0x1b')](function(_0x50b7df){if(_0x2730b0[_0x0fcf('0x1f')]&&fs[_0x0fcf('0x20')](_0x50b7df['value'])){var _0xdfd3ec=util[_0x0fcf('0x21')](_0x0fcf('0x22'),_0x50b7df[_0x0fcf('0x23')]);return _0x3876ed[_0x0fcf('0x24')](_0x50b7df[_0x0fcf('0x23')],_0xdfd3ec,config['secrets'][_0x0fcf('0x25')])[_0x0fcf('0x1b')](function(){fs[_0x0fcf('0x26')](_0x50b7df[_0x0fcf('0x23')]);logger[_0x0fcf('0xd')](_0x0fcf('0x27'));return _0x50b7df;});}return _0x50b7df;})['then'](function(_0x208433){logger[_0x0fcf('0xd')](_0x0fcf('0x28'),_0x18965e);logger[_0x0fcf('0xf')](_0x0fcf('0x28'),_0x18965e,JSON[_0x0fcf('0x11')](_0x208433));_0x41b7a2(_0x208433);})[_0x0fcf('0x1c')](function(_0x344957){logger[_0x0fcf('0x12')](_0x0fcf('0x28'),_0x344957[_0x0fcf('0x13')],_0x18965e);_0x2f198b(_0xc107a[_0x0fcf('0x12')](0x1f4,_0x344957[_0x0fcf('0x13')]));});});};
\ No newline at end of file
index 6dbbc5a..f34fb2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dfe=['exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','describe','get','/:id','show','post','put','destroy'];(function(_0x4003fe,_0x38c382){var _0x5af37c=function(_0x112092){while(--_0x112092){_0x4003fe['push'](_0x4003fe['shift']());}};_0x5af37c(++_0x38c382);}(_0x5dfe,0x1a5));var _0xe5df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5dfe[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe5df('0x0'));var timeout=require(_0xe5df('0x1'));var express=require(_0xe5df('0x2'));var router=express['Router']();var fs_extra=require(_0xe5df('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe5df('0x4'));var config=require(_0xe5df('0x5'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0xe5df('0x6')](),controller['index']);router['get']('/describe',auth[_0xe5df('0x6')](),controller[_0xe5df('0x7')]);router[_0xe5df('0x8')](_0xe5df('0x9'),auth[_0xe5df('0x6')](),controller[_0xe5df('0xa')]);router[_0xe5df('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe5df('0xc')](_0xe5df('0x9'),auth[_0xe5df('0x6')](),controller['update']);router['delete'](_0xe5df('0x9'),auth[_0xe5df('0x6')](),controller[_0xe5df('0xd')]);module[_0xe5df('0xe')]=router;
\ No newline at end of file
+var _0x187a=['get','isAuthenticated','/describe','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller'];(function(_0x323da5,_0x5352b1){var _0xfd50cd=function(_0x5e0ba8){while(--_0x5e0ba8){_0x323da5['push'](_0x323da5['shift']());}};_0xfd50cd(++_0x5352b1);}(_0x187a,0x88));var _0xa187=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x187a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa187('0x0'));var util=require(_0xa187('0x1'));var path=require(_0xa187('0x2'));var timeout=require(_0xa187('0x3'));var express=require(_0xa187('0x4'));var router=express[_0xa187('0x5')]();var fs_extra=require(_0xa187('0x6'));var auth=require(_0xa187('0x7'));var interaction=require(_0xa187('0x8'));var config=require(_0xa187('0x9'));var controller=require(_0xa187('0xa'));router[_0xa187('0xb')]('/',auth[_0xa187('0xc')](),controller['index']);router[_0xa187('0xb')](_0xa187('0xd'),auth[_0xa187('0xc')](),controller['describe']);router[_0xa187('0xb')](_0xa187('0xe'),auth[_0xa187('0xc')](),controller[_0xa187('0xf')]);router[_0xa187('0x10')]('/',auth[_0xa187('0xc')](),controller[_0xa187('0x11')]);router['put'](_0xa187('0xe'),auth[_0xa187('0xc')](),controller['update']);router[_0xa187('0x12')](_0xa187('0xe'),auth[_0xa187('0xc')](),controller[_0xa187('0x13')]);module[_0xa187('0x14')]=router;
\ No newline at end of file
index 8383776..7b78d6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bd7=['STRING','ENUM','Yes','sequelize','moment','exports','blind','attended'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x1bd7,0xd3));var _0x71bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1bd7[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x71bd('0x0'));var moment=require(_0x71bd('0x1'));module[_0x71bd('0x2')]={'type':{'type':Sequelize['ENUM'](_0x71bd('0x3'),_0x71bd('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x71bd('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x71bd('0x5')]},'transferercalleridname':{'type':Sequelize[_0x71bd('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x71bd('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x71bd('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x71bd('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x71bd('0x5')]},'transfereechannel':{'type':Sequelize[_0x71bd('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x71bd('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x71bd('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x71bd('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x71bd('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x71bd('0x5')]},'transfereecontext':{'type':Sequelize[_0x71bd('0x5')]},'transfereeexten':{'type':Sequelize[_0x71bd('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x71bd('0x5')]},'isexternal':{'type':Sequelize[_0x71bd('0x6')](_0x71bd('0x7'),'No')},'context':{'type':Sequelize[_0x71bd('0x5')]},'extension':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd3af=['STRING','Yes','moment','exports','ENUM','blind'];(function(_0x4599ff,_0x24bf7d){var _0x193b58=function(_0x5ea4de){while(--_0x5ea4de){_0x4599ff['push'](_0x4599ff['shift']());}};_0x193b58(++_0x24bf7d);}(_0xd3af,0x182));var _0xfd3a=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd3af[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfd3a('0x0'));module[_0xfd3a('0x1')]={'type':{'type':Sequelize[_0xfd3a('0x2')](_0xfd3a('0x3'),'attended')},'result':{'type':Sequelize[_0xfd3a('0x4')]},'transfererchannel':{'type':Sequelize[_0xfd3a('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xfd3a('0x4')]},'transferercalleridname':{'type':Sequelize[_0xfd3a('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xfd3a('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xfd3a('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xfd3a('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xfd3a('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xfd3a('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xfd3a('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0xfd3a('0x4')]},'isexternal':{'type':Sequelize[_0xfd3a('0x2')](_0xfd3a('0x5'),'No')},'context':{'type':Sequelize[_0xfd3a('0x4')]},'extension':{'type':Sequelize[_0xfd3a('0x4')]}};
\ No newline at end of file
index 55a0f35..b7de21e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4416=['apply','save','then','destroy','end','error','stack','name','send','VoiceTransferReport','rawAttributes','fieldName','key','model','map','keys','query','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','filter','merge','type','options','includeAll','include','findAll','catch','show','params','length','find','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0x4416,0x73));var _0x6441=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x4416[_0x4792c8];return _0x35edb1;};'use strict';var emlformat=require(_0x6441('0x0'));var rimraf=require(_0x6441('0x1'));var zipdir=require(_0x6441('0x2'));var jsonpatch=require(_0x6441('0x3'));var rp=require(_0x6441('0x4'));var moment=require(_0x6441('0x5'));var BPromise=require(_0x6441('0x6'));var Mustache=require(_0x6441('0x7'));var util=require(_0x6441('0x8'));var path=require('path');var sox=require(_0x6441('0x9'));var csv=require(_0x6441('0xa'));var ejs=require(_0x6441('0xb'));var fs=require('fs');var fs_extra=require(_0x6441('0xc'));var _=require('lodash');var squel=require(_0x6441('0xd'));var crypto=require(_0x6441('0xe'));var jsforce=require(_0x6441('0xf'));var deskjs=require(_0x6441('0x10'));var toCsv=require(_0x6441('0xa'));var querystring=require(_0x6441('0x11'));var Papa=require('papaparse');var Redis=require(_0x6441('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6441('0x13'));var hardwareService=require(_0x6441('0x14'));var logger=require(_0x6441('0x15'))(_0x6441('0x16'));var utils=require(_0x6441('0x17'));var config=require(_0x6441('0x18'));var licenseUtil=require(_0x6441('0x19'));var db=require(_0x6441('0x1a'))['db'];function respondWithStatusCode(_0x38d9f1,_0x31d796){_0x31d796=_0x31d796||0xcc;return function(_0x56cd33){if(_0x56cd33){return _0x38d9f1[_0x6441('0x1b')](_0x31d796);}return _0x38d9f1['status'](_0x31d796)['end']();};}function respondWithResult(_0x5b4460,_0xa8d8ea){_0xa8d8ea=_0xa8d8ea||0xc8;return function(_0x12fb47){if(_0x12fb47){return _0x5b4460[_0x6441('0x1c')](_0xa8d8ea)[_0x6441('0x1d')](_0x12fb47);}};}function respondWithFilteredResult(_0x4113a1,_0x5d1bc9){return function(_0x1b6c76){if(_0x1b6c76){var _0x28c657=typeof _0x5d1bc9[_0x6441('0x1e')]==='undefined'&&typeof _0x5d1bc9[_0x6441('0x1f')]===_0x6441('0x20');var _0x4f3bdf=_0x1b6c76[_0x6441('0x21')];var _0x570b8b=_0x28c657?0x0:_0x5d1bc9[_0x6441('0x1e')];var _0x59335f=_0x28c657?_0x1b6c76[_0x6441('0x21')]:_0x5d1bc9['offset']+_0x5d1bc9['limit'];var _0x431f52;if(_0x59335f>=_0x4f3bdf){_0x59335f=_0x4f3bdf;_0x431f52=0xc8;}else{_0x431f52=0xce;}_0x4113a1[_0x6441('0x1c')](_0x431f52);return _0x4113a1['set'](_0x6441('0x22'),_0x570b8b+'-'+_0x59335f+'/'+_0x4f3bdf)[_0x6441('0x1d')](_0x1b6c76);}return null;};}function patchUpdates(_0x10adad){return function(_0x2c5699){try{jsonpatch[_0x6441('0x23')](_0x2c5699,_0x10adad,!![]);}catch(_0x4027be){return BPromise['reject'](_0x4027be);}return _0x2c5699[_0x6441('0x24')]();};}function saveUpdates(_0x3e0464,_0x402f05){return function(_0x1dee7b){if(_0x1dee7b){return _0x1dee7b['update'](_0x3e0464)[_0x6441('0x25')](function(_0x2e0e50){return _0x2e0e50;});}return null;};}function removeEntity(_0xfdf41a,_0x430e29){return function(_0x37a183){if(_0x37a183){return _0x37a183[_0x6441('0x26')]()[_0x6441('0x25')](function(){_0xfdf41a['status'](0xcc)[_0x6441('0x27')]();});}};}function handleEntityNotFound(_0x12fe9d,_0x3ce98a){return function(_0x1284f6){if(!_0x1284f6){_0x12fe9d['sendStatus'](0x194);}return _0x1284f6;};}function handleError(_0x4c728c,_0x2e6e85){_0x2e6e85=_0x2e6e85||0x1f4;return function(_0xd037b5){logger[_0x6441('0x28')](_0xd037b5[_0x6441('0x29')]);if(_0xd037b5[_0x6441('0x2a')]){delete _0xd037b5['name'];}_0x4c728c[_0x6441('0x1c')](_0x2e6e85)[_0x6441('0x2b')](_0xd037b5);};}exports['index']=function(_0x6956e1,_0x5eea3e){var _0x33b353={},_0x9f5c1b={},_0x5a921b={'count':0x0,'rows':[]};var _0x5704ec=_['map'](db[_0x6441('0x2c')][_0x6441('0x2d')],function(_0x30cf63){return{'name':_0x30cf63[_0x6441('0x2e')],'type':_0x30cf63['type'][_0x6441('0x2f')]};});_0x9f5c1b[_0x6441('0x30')]=_[_0x6441('0x31')](_0x5704ec,'name');_0x9f5c1b['query']=_[_0x6441('0x32')](_0x6956e1[_0x6441('0x33')]);_0x9f5c1b['filters']=_['intersection'](_0x9f5c1b[_0x6441('0x30')],_0x9f5c1b['query']);_0x33b353[_0x6441('0x34')]=_[_0x6441('0x35')](_0x9f5c1b['model'],qs[_0x6441('0x36')](_0x6956e1[_0x6441('0x33')]['fields']));_0x33b353['attributes']=_0x33b353[_0x6441('0x34')]['length']?_0x33b353[_0x6441('0x34')]:_0x9f5c1b['model'];if(!_0x6956e1[_0x6441('0x33')][_0x6441('0x37')]('nolimit')){_0x33b353['limit']=qs[_0x6441('0x1f')](_0x6956e1['query'][_0x6441('0x1f')]);_0x33b353[_0x6441('0x1e')]=qs[_0x6441('0x1e')](_0x6956e1['query'][_0x6441('0x1e')]);}_0x33b353[_0x6441('0x38')]=qs[_0x6441('0x39')](_0x6956e1[_0x6441('0x33')][_0x6441('0x39')]);_0x33b353[_0x6441('0x3a')]=qs[_0x6441('0x3b')](_['pick'](_0x6956e1['query'],_0x9f5c1b[_0x6441('0x3b')]),_0x5704ec);if(_0x6956e1[_0x6441('0x33')][_0x6441('0x3c')]){_0x33b353[_0x6441('0x3a')]=_[_0x6441('0x3d')](_0x33b353[_0x6441('0x3a')],{'$or':_[_0x6441('0x31')](_0x5704ec,function(_0x509851){if(_0x509851[_0x6441('0x3e')]!=='VIRTUAL'){var _0x5f2c89={};_0x5f2c89[_0x509851['name']]={'$like':'%'+_0x6956e1[_0x6441('0x33')][_0x6441('0x3c')]+'%'};return _0x5f2c89;}})});}_0x33b353=_[_0x6441('0x3d')]({},_0x33b353,_0x6956e1[_0x6441('0x3f')]);var _0x23c7b5={'where':_0x33b353['where']};return db[_0x6441('0x2c')][_0x6441('0x21')](_0x23c7b5)['then'](function(_0x3fa2cd){_0x5a921b[_0x6441('0x21')]=_0x3fa2cd;if(_0x6956e1[_0x6441('0x33')][_0x6441('0x40')]){_0x33b353[_0x6441('0x41')]=[{'all':!![]}];}return db[_0x6441('0x2c')][_0x6441('0x42')](_0x33b353);})[_0x6441('0x25')](function(_0x58e6d2){_0x5a921b['rows']=_0x58e6d2;return _0x5a921b;})[_0x6441('0x25')](respondWithFilteredResult(_0x5eea3e,_0x33b353))[_0x6441('0x43')](handleError(_0x5eea3e,null));};exports[_0x6441('0x44')]=function(_0x5c0464,_0x41f917){var _0x230e8c={'raw':!![],'where':{'id':_0x5c0464[_0x6441('0x45')]['id']}},_0x1dc686={};_0x1dc686[_0x6441('0x30')]=_[_0x6441('0x32')](db[_0x6441('0x2c')][_0x6441('0x2d')]);_0x1dc686[_0x6441('0x33')]=_[_0x6441('0x32')](_0x5c0464[_0x6441('0x33')]);_0x1dc686[_0x6441('0x3b')]=_[_0x6441('0x35')](_0x1dc686[_0x6441('0x30')],_0x1dc686[_0x6441('0x33')]);_0x230e8c[_0x6441('0x34')]=_[_0x6441('0x35')](_0x1dc686[_0x6441('0x30')],qs['fields'](_0x5c0464[_0x6441('0x33')][_0x6441('0x36')]));_0x230e8c[_0x6441('0x34')]=_0x230e8c['attributes'][_0x6441('0x46')]?_0x230e8c['attributes']:_0x1dc686[_0x6441('0x30')];if(_0x5c0464['query']['includeAll']){_0x230e8c[_0x6441('0x41')]=[{'all':!![]}];}_0x230e8c=_[_0x6441('0x3d')]({},_0x230e8c,_0x5c0464['options']);return db[_0x6441('0x2c')][_0x6441('0x47')](_0x230e8c)[_0x6441('0x25')](handleEntityNotFound(_0x41f917,null))['then'](respondWithResult(_0x41f917,null))[_0x6441('0x43')](handleError(_0x41f917,null));};exports['create']=function(_0x2b12c8,_0x525e01){return db[_0x6441('0x2c')]['create'](_0x2b12c8['body'],{})[_0x6441('0x25')](respondWithResult(_0x525e01,0xc9))['catch'](handleError(_0x525e01,null));};exports[_0x6441('0x48')]=function(_0x11d0d3,_0x127d8b){if(_0x11d0d3[_0x6441('0x49')]['id']){delete _0x11d0d3['body']['id'];}return db[_0x6441('0x2c')]['find']({'where':{'id':_0x11d0d3[_0x6441('0x45')]['id']}})[_0x6441('0x25')](handleEntityNotFound(_0x127d8b,null))[_0x6441('0x25')](saveUpdates(_0x11d0d3[_0x6441('0x49')],null))[_0x6441('0x25')](respondWithResult(_0x127d8b,null))[_0x6441('0x43')](handleError(_0x127d8b,null));};exports[_0x6441('0x26')]=function(_0x4e5cd4,_0x3a57f5){return db[_0x6441('0x2c')][_0x6441('0x47')]({'where':{'id':_0x4e5cd4[_0x6441('0x45')]['id']}})[_0x6441('0x25')](handleEntityNotFound(_0x3a57f5,null))['then'](removeEntity(_0x3a57f5,null))[_0x6441('0x43')](handleError(_0x3a57f5,null));};exports[_0x6441('0x4a')]=function(_0x648b93,_0xf88c54){return db[_0x6441('0x2c')][_0x6441('0x4a')]()[_0x6441('0x25')](respondWithResult(_0xf88c54,null))[_0x6441('0x43')](handleError(_0xf88c54,null));};
\ No newline at end of file
+var _0x2512=['options','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','papaparse','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','destroy','then','error','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VoiceTransferReport','includeAll','findAll','rows','show','params','include'];(function(_0x1124b2,_0x1b7e55){var _0x4621a0=function(_0x2556c7){while(--_0x2556c7){_0x1124b2['push'](_0x1124b2['shift']());}};_0x4621a0(++_0x1b7e55);}(_0x2512,0x9e));var _0x2251=function(_0x2dd92e,_0x5fb8e4){_0x2dd92e=_0x2dd92e-0x0;var _0x1c75e8=_0x2512[_0x2dd92e];return _0x1c75e8;};'use strict';var emlformat=require(_0x2251('0x0'));var rimraf=require(_0x2251('0x1'));var zipdir=require(_0x2251('0x2'));var jsonpatch=require(_0x2251('0x3'));var rp=require(_0x2251('0x4'));var moment=require(_0x2251('0x5'));var BPromise=require(_0x2251('0x6'));var Mustache=require(_0x2251('0x7'));var util=require(_0x2251('0x8'));var path=require(_0x2251('0x9'));var sox=require(_0x2251('0xa'));var csv=require(_0x2251('0xb'));var ejs=require(_0x2251('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2251('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2251('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2251('0xb'));var querystring=require('querystring');var Papa=require(_0x2251('0xf'));var Redis=require(_0x2251('0x10'));var authService=require(_0x2251('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2251('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2251('0x13'));var utils=require(_0x2251('0x14'));var config=require(_0x2251('0x15'));var licenseUtil=require(_0x2251('0x16'));var db=require(_0x2251('0x17'))['db'];function respondWithStatusCode(_0x35546c,_0x133dbf){_0x133dbf=_0x133dbf||0xcc;return function(_0x2ee014){if(_0x2ee014){return _0x35546c[_0x2251('0x18')](_0x133dbf);}return _0x35546c[_0x2251('0x19')](_0x133dbf)[_0x2251('0x1a')]();};}function respondWithResult(_0x1f875f,_0x44f82d){_0x44f82d=_0x44f82d||0xc8;return function(_0x4e4a64){if(_0x4e4a64){return _0x1f875f[_0x2251('0x19')](_0x44f82d)[_0x2251('0x1b')](_0x4e4a64);}};}function respondWithFilteredResult(_0x540390,_0x37043d){return function(_0x3b2b63){if(_0x3b2b63){var _0x5aa5dd=typeof _0x37043d[_0x2251('0x1c')]===_0x2251('0x1d')&&typeof _0x37043d['limit']===_0x2251('0x1d');var _0x46b08a=_0x3b2b63['count'];var _0x4a712b=_0x5aa5dd?0x0:_0x37043d[_0x2251('0x1c')];var _0x257051=_0x5aa5dd?_0x3b2b63[_0x2251('0x1e')]:_0x37043d[_0x2251('0x1c')]+_0x37043d[_0x2251('0x1f')];var _0x237987;if(_0x257051>=_0x46b08a){_0x257051=_0x46b08a;_0x237987=0xc8;}else{_0x237987=0xce;}_0x540390[_0x2251('0x19')](_0x237987);return _0x540390[_0x2251('0x20')](_0x2251('0x21'),_0x4a712b+'-'+_0x257051+'/'+_0x46b08a)[_0x2251('0x1b')](_0x3b2b63);}return null;};}function patchUpdates(_0x45b3c6){return function(_0x4ec105){try{jsonpatch['apply'](_0x4ec105,_0x45b3c6,!![]);}catch(_0x216bb4){return BPromise[_0x2251('0x22')](_0x216bb4);}return _0x4ec105[_0x2251('0x23')]();};}function saveUpdates(_0x1e409a,_0x341b35){return function(_0x2f5cf2){if(_0x2f5cf2){return _0x2f5cf2[_0x2251('0x24')](_0x1e409a)['then'](function(_0x13b50b){return _0x13b50b;});}return null;};}function removeEntity(_0x3e5ccc,_0x51c000){return function(_0x453030){if(_0x453030){return _0x453030[_0x2251('0x25')]()[_0x2251('0x26')](function(){_0x3e5ccc[_0x2251('0x19')](0xcc)[_0x2251('0x1a')]();});}};}function handleEntityNotFound(_0x567c71,_0xdbbdd4){return function(_0x367d22){if(!_0x367d22){_0x567c71[_0x2251('0x18')](0x194);}return _0x367d22;};}function handleError(_0x24a77f,_0x55f7e5){_0x55f7e5=_0x55f7e5||0x1f4;return function(_0x534709){logger[_0x2251('0x27')](_0x534709['stack']);if(_0x534709[_0x2251('0x28')]){delete _0x534709['name'];}_0x24a77f['status'](_0x55f7e5)['send'](_0x534709);};}exports[_0x2251('0x29')]=function(_0x1031dc,_0x11c184){var _0x188dd9={},_0x2ba76b={},_0x39acee={'count':0x0,'rows':[]};var _0x3c3232=_[_0x2251('0x2a')](db['VoiceTransferReport'][_0x2251('0x2b')],function(_0x840d47){return{'name':_0x840d47[_0x2251('0x2c')],'type':_0x840d47[_0x2251('0x2d')][_0x2251('0x2e')]};});_0x2ba76b[_0x2251('0x2f')]=_[_0x2251('0x2a')](_0x3c3232,_0x2251('0x28'));_0x2ba76b['query']=_[_0x2251('0x30')](_0x1031dc[_0x2251('0x31')]);_0x2ba76b[_0x2251('0x32')]=_[_0x2251('0x33')](_0x2ba76b['model'],_0x2ba76b['query']);_0x188dd9[_0x2251('0x34')]=_['intersection'](_0x2ba76b[_0x2251('0x2f')],qs[_0x2251('0x35')](_0x1031dc[_0x2251('0x31')][_0x2251('0x35')]));_0x188dd9[_0x2251('0x34')]=_0x188dd9[_0x2251('0x34')][_0x2251('0x36')]?_0x188dd9[_0x2251('0x34')]:_0x2ba76b[_0x2251('0x2f')];if(!_0x1031dc[_0x2251('0x31')]['hasOwnProperty'](_0x2251('0x37'))){_0x188dd9[_0x2251('0x1f')]=qs[_0x2251('0x1f')](_0x1031dc[_0x2251('0x31')][_0x2251('0x1f')]);_0x188dd9[_0x2251('0x1c')]=qs['offset'](_0x1031dc[_0x2251('0x31')][_0x2251('0x1c')]);}_0x188dd9[_0x2251('0x38')]=qs[_0x2251('0x39')](_0x1031dc[_0x2251('0x31')]['sort']);_0x188dd9[_0x2251('0x3a')]=qs[_0x2251('0x32')](_[_0x2251('0x3b')](_0x1031dc[_0x2251('0x31')],_0x2ba76b['filters']),_0x3c3232);if(_0x1031dc[_0x2251('0x31')][_0x2251('0x3c')]){_0x188dd9['where']=_[_0x2251('0x3d')](_0x188dd9[_0x2251('0x3a')],{'$or':_[_0x2251('0x2a')](_0x3c3232,function(_0x2bcdb3){if(_0x2bcdb3[_0x2251('0x2d')]!==_0x2251('0x3e')){var _0x38e8f4={};_0x38e8f4[_0x2bcdb3[_0x2251('0x28')]]={'$like':'%'+_0x1031dc['query']['filter']+'%'};return _0x38e8f4;}})});}_0x188dd9=_['merge']({},_0x188dd9,_0x1031dc['options']);var _0x575799={'where':_0x188dd9[_0x2251('0x3a')]};return db[_0x2251('0x3f')][_0x2251('0x1e')](_0x575799)[_0x2251('0x26')](function(_0x396390){_0x39acee['count']=_0x396390;if(_0x1031dc[_0x2251('0x31')][_0x2251('0x40')]){_0x188dd9['include']=[{'all':!![]}];}return db[_0x2251('0x3f')][_0x2251('0x41')](_0x188dd9);})[_0x2251('0x26')](function(_0x19b651){_0x39acee[_0x2251('0x42')]=_0x19b651;return _0x39acee;})[_0x2251('0x26')](respondWithFilteredResult(_0x11c184,_0x188dd9))['catch'](handleError(_0x11c184,null));};exports[_0x2251('0x43')]=function(_0x354d41,_0x3821b1){var _0x53466d={'raw':!![],'where':{'id':_0x354d41[_0x2251('0x44')]['id']}},_0x125d50={};_0x125d50['model']=_[_0x2251('0x30')](db[_0x2251('0x3f')][_0x2251('0x2b')]);_0x125d50[_0x2251('0x31')]=_[_0x2251('0x30')](_0x354d41['query']);_0x125d50[_0x2251('0x32')]=_[_0x2251('0x33')](_0x125d50[_0x2251('0x2f')],_0x125d50[_0x2251('0x31')]);_0x53466d[_0x2251('0x34')]=_['intersection'](_0x125d50['model'],qs[_0x2251('0x35')](_0x354d41[_0x2251('0x31')][_0x2251('0x35')]));_0x53466d['attributes']=_0x53466d[_0x2251('0x34')][_0x2251('0x36')]?_0x53466d[_0x2251('0x34')]:_0x125d50[_0x2251('0x2f')];if(_0x354d41[_0x2251('0x31')]['includeAll']){_0x53466d[_0x2251('0x45')]=[{'all':!![]}];}_0x53466d=_[_0x2251('0x3d')]({},_0x53466d,_0x354d41[_0x2251('0x46')]);return db[_0x2251('0x3f')][_0x2251('0x47')](_0x53466d)[_0x2251('0x26')](handleEntityNotFound(_0x3821b1,null))[_0x2251('0x26')](respondWithResult(_0x3821b1,null))['catch'](handleError(_0x3821b1,null));};exports['create']=function(_0x44d7e6,_0x130e03){return db[_0x2251('0x3f')][_0x2251('0x48')](_0x44d7e6[_0x2251('0x49')],{})['then'](respondWithResult(_0x130e03,0xc9))[_0x2251('0x4a')](handleError(_0x130e03,null));};exports[_0x2251('0x24')]=function(_0x4c2a40,_0x444f7b){if(_0x4c2a40[_0x2251('0x49')]['id']){delete _0x4c2a40['body']['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x4c2a40[_0x2251('0x44')]['id']}})[_0x2251('0x26')](handleEntityNotFound(_0x444f7b,null))['then'](saveUpdates(_0x4c2a40[_0x2251('0x49')],null))[_0x2251('0x26')](respondWithResult(_0x444f7b,null))[_0x2251('0x4a')](handleError(_0x444f7b,null));};exports[_0x2251('0x25')]=function(_0x51b4a3,_0x3346ed){return db[_0x2251('0x3f')][_0x2251('0x47')]({'where':{'id':_0x51b4a3[_0x2251('0x44')]['id']}})[_0x2251('0x26')](handleEntityNotFound(_0x3346ed,null))[_0x2251('0x26')](removeEntity(_0x3346ed,null))[_0x2251('0x4a')](handleError(_0x3346ed,null));};exports[_0x2251('0x4b')]=function(_0x430a4e,_0x20fbcd){return db[_0x2251('0x3f')][_0x2251('0x4b')]()['then'](respondWithResult(_0x20fbcd,null))[_0x2251('0x4a')](handleError(_0x20fbcd,null));};
\ No newline at end of file
index 80383dd..07e4498 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd7c=['exports','define','VoiceTransferReport','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./voiceTransferReport.attributes'];(function(_0xdfbc45,_0x45b659){var _0x4be2c4=function(_0x377ea0){while(--_0x377ea0){_0xdfbc45['push'](_0xdfbc45['shift']());}};_0x4be2c4(++_0x45b659);}(_0xfd7c,0x16e));var _0xcfd7=function(_0x24d124,_0x52b86f){_0x24d124=_0x24d124-0x0;var _0x433f0a=_0xfd7c[_0x24d124];return _0x433f0a;};'use strict';var _=require(_0xcfd7('0x0'));var util=require(_0xcfd7('0x1'));var logger=require(_0xcfd7('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcfd7('0x3'));var rp=require(_0xcfd7('0x4'));var fs=require('fs');var path=require(_0xcfd7('0x5'));var rimraf=require('rimraf');var config=require(_0xcfd7('0x6'));var attributes=require(_0xcfd7('0x7'));module[_0xcfd7('0x8')]=function(_0x33e4,_0x1f76a9){return _0x33e4[_0xcfd7('0x9')](_0xcfd7('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x36bb=['../../config/logger','moment','bluebird','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0x36bb,0x172));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb36b('0x0'));var util=require(_0xb36b('0x1'));var logger=require(_0xb36b('0x2'))('api');var moment=require(_0xb36b('0x3'));var BPromise=require(_0xb36b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb36b('0x5'));var config=require(_0xb36b('0x6'));var attributes=require(_0xb36b('0x7'));module[_0xb36b('0x8')]=function(_0x27f16e,_0xab011d){return _0x27f16e[_0xb36b('0x9')](_0xb36b('0xa'),attributes,{'tableName':_0xb36b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fd6be99..08df338 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba33=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceTransferReport','create','options','catch','lodash','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba33,0x174));var _0x3ba3=function(_0xb2cda5,_0x5bbdb1){_0xb2cda5=_0xb2cda5-0x0;var _0x11123f=_0xba33[_0xb2cda5];return _0x11123f;};'use strict';var _=require(_0x3ba3('0x0'));var util=require('util');var moment=require(_0x3ba3('0x1'));var BPromise=require(_0x3ba3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ba3('0x3'));var db=require(_0x3ba3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ba3('0x5'))(_0x3ba3('0x6'));var config=require(_0x3ba3('0x7'));var jayson=require(_0x3ba3('0x8'));var client=jayson[_0x3ba3('0x9')][_0x3ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x493d2e,_0x34d46e,_0x4e4b50){return new BPromise(function(_0x424d88,_0x445797){return client['request'](_0x493d2e,_0x4e4b50)[_0x3ba3('0xb')](function(_0x3beb22){logger['info'](_0x3ba3('0xc'),_0x34d46e,_0x3ba3('0xd'));logger[_0x3ba3('0xe')](_0x3ba3('0xf'),_0x34d46e,'request\x20sent',JSON[_0x3ba3('0x10')](_0x3beb22));if(_0x3beb22[_0x3ba3('0x11')]){if(_0x3beb22[_0x3ba3('0x11')][_0x3ba3('0x12')]===0x1f4){logger['error'](_0x3ba3('0xc'),_0x34d46e,_0x3beb22[_0x3ba3('0x11')][_0x3ba3('0x13')]);return _0x445797(_0x3beb22[_0x3ba3('0x11')]['message']);}logger[_0x3ba3('0x11')](_0x3ba3('0xc'),_0x34d46e,_0x3beb22[_0x3ba3('0x11')]['message']);return _0x424d88(_0x3beb22[_0x3ba3('0x11')][_0x3ba3('0x13')]);}else{logger['info'](_0x3ba3('0xc'),_0x34d46e,'request\x20sent');_0x424d88(_0x3beb22[_0x3ba3('0x14')][_0x3ba3('0x13')]);}})['catch'](function(_0x32cf52){logger[_0x3ba3('0x11')](_0x3ba3('0xc'),_0x34d46e,_0x32cf52);_0x445797(_0x32cf52);});});}exports[_0x3ba3('0x15')]=function(_0x3416e8){var _0x1c4f67=this;return new Promise(function(_0x1531e4,_0x4639c3){return db['VoiceTransferReport'][_0x3ba3('0x16')](_0x3416e8['body'],{'raw':_0x3416e8[_0x3ba3('0x17')]?_0x3416e8['options']['raw']===undefined?!![]:![]:!![]})[_0x3ba3('0xb')](function(_0x5313db){logger['info'](_0x3ba3('0x15'),_0x3416e8);logger['debug']('CreateVoiceTransferReport',_0x3416e8,JSON['stringify'](_0x5313db));_0x1531e4(_0x5313db);})[_0x3ba3('0x18')](function(_0x59a614){logger[_0x3ba3('0x11')]('CreateVoiceTransferReport',_0x59a614['message'],_0x3416e8);_0x4639c3(_0x1c4f67[_0x3ba3('0x11')](0x1f4,_0x59a614[_0x3ba3('0x13')]));});});};
\ No newline at end of file
+var _0xba20=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba20,0x94));var _0x0ba2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba20[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0ba2('0x0'));var util=require(_0x0ba2('0x1'));var moment=require(_0x0ba2('0x2'));var BPromise=require(_0x0ba2('0x3'));var rs=require(_0x0ba2('0x4'));var fs=require('fs');var Redis=require(_0x0ba2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0ba2('0x6'));var logger=require(_0x0ba2('0x7'))('rpc');var config=require(_0x0ba2('0x8'));var jayson=require(_0x0ba2('0x9'));var client=jayson[_0x0ba2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5aad0c,_0x1588ba,_0x432129){return new BPromise(function(_0x155831,_0x1618e3){return client[_0x0ba2('0xb')](_0x5aad0c,_0x432129)[_0x0ba2('0xc')](function(_0x46777f){logger[_0x0ba2('0xd')](_0x0ba2('0xe'),_0x1588ba,_0x0ba2('0xf'));logger[_0x0ba2('0x10')](_0x0ba2('0x11'),_0x1588ba,_0x0ba2('0xf'),JSON[_0x0ba2('0x12')](_0x46777f));if(_0x46777f[_0x0ba2('0x13')]){if(_0x46777f[_0x0ba2('0x13')][_0x0ba2('0x14')]===0x1f4){logger[_0x0ba2('0x13')](_0x0ba2('0xe'),_0x1588ba,_0x46777f[_0x0ba2('0x13')]['message']);return _0x1618e3(_0x46777f['error']['message']);}logger[_0x0ba2('0x13')](_0x0ba2('0xe'),_0x1588ba,_0x46777f[_0x0ba2('0x13')][_0x0ba2('0x15')]);return _0x155831(_0x46777f[_0x0ba2('0x13')]['message']);}else{logger[_0x0ba2('0xd')](_0x0ba2('0xe'),_0x1588ba,_0x0ba2('0xf'));_0x155831(_0x46777f[_0x0ba2('0x16')]['message']);}})[_0x0ba2('0x17')](function(_0x5edaed){logger[_0x0ba2('0x13')](_0x0ba2('0xe'),_0x1588ba,_0x5edaed);_0x1618e3(_0x5edaed);});});}exports[_0x0ba2('0x18')]=function(_0x584ead){var _0x280ee0=this;return new Promise(function(_0x392242,_0x44e0d9){return db[_0x0ba2('0x19')][_0x0ba2('0x1a')](_0x584ead[_0x0ba2('0x1b')],{'raw':_0x584ead[_0x0ba2('0x1c')]?_0x584ead['options'][_0x0ba2('0x1d')]===undefined?!![]:![]:!![]})[_0x0ba2('0xc')](function(_0x42835f){logger['info'](_0x0ba2('0x18'),_0x584ead);logger[_0x0ba2('0x10')](_0x0ba2('0x18'),_0x584ead,JSON[_0x0ba2('0x12')](_0x42835f));_0x392242(_0x42835f);})[_0x0ba2('0x17')](function(_0x154040){logger['error'](_0x0ba2('0x18'),_0x154040[_0x0ba2('0x15')],_0x584ead);_0x44e0d9(_0x280ee0[_0x0ba2('0x13')](0x1f4,_0x154040['message']));});});};
\ No newline at end of file
index 5ab80bf..2b633e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4e6=['unhold','calls','/transfer','exports','express','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/hold','hold','/unhold'];(function(_0x2d6ecc,_0x5d7cf3){var _0x215998=function(_0x1eba31){while(--_0x1eba31){_0x2d6ecc['push'](_0x2d6ecc['shift']());}};_0x215998(++_0x5d7cf3);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xb4e6[_0x5bd426];return _0x23a7eb;};'use strict';var express=require(_0x6b4e('0x0'));var router=express['Router']();var auth=require(_0x6b4e('0x1'));var controller=require(_0x6b4e('0x2'));router[_0x6b4e('0x3')](_0x6b4e('0x4'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0x7')]);router['post'](_0x6b4e('0x8'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['hangup']);router[_0x6b4e('0x3')]('/answer',auth['isAuthenticated'](),auth[_0x6b4e('0x6')](),controller['answer']);router['post'](_0x6b4e('0x9'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xa')]);router[_0x6b4e('0x3')](_0x6b4e('0xb'),auth[_0x6b4e('0x5')](),auth['isWebrtcLicence'](),controller[_0x6b4e('0xc')]);router[_0x6b4e('0x3')]('/calls',auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xd')]);router[_0x6b4e('0x3')](_0x6b4e('0xe'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['transfer']);module[_0x6b4e('0xf')]=router;
\ No newline at end of file
+var _0xe706=['/transfer','express','Router','../../components/auth/service','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','answer','/hold','hold','/unhold','/calls','calls'];(function(_0x40160b,_0x565930){var _0x5aa204=function(_0x1f78e5){while(--_0x1f78e5){_0x40160b['push'](_0x40160b['shift']());}};_0x5aa204(++_0x565930);}(_0xe706,0xa3));var _0x6e70=function(_0x531a19,_0x43e019){_0x531a19=_0x531a19-0x0;var _0x4845d2=_0xe706[_0x531a19];return _0x4845d2;};'use strict';var express=require(_0x6e70('0x0'));var router=express[_0x6e70('0x1')]();var auth=require(_0x6e70('0x2'));var controller=require('./webbar.controller');router[_0x6e70('0x3')](_0x6e70('0x4'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0x7')]);router[_0x6e70('0x3')](_0x6e70('0x8'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0x9')]);router[_0x6e70('0x3')](_0x6e70('0xa'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x3')](_0x6e70('0xc'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x3')](_0x6e70('0xe'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller['unhold']);router['post'](_0x6e70('0xf'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x3')](_0x6e70('0x11'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller['transfer']);module['exports']=router;
\ No newline at end of file
index 4da021f..60af649 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9aea=['calls\x20fired:','conference\x20fired:','conference\x20executed!','webbar:transfer','transfer\x20executed!','path','../../mysqldb','util','bluebird','client','http','../../config/logger','webbarapi','ioredis','defaults','redis','localhost','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','stack','name','status','send','NotFound','error','message','result','catch','User','findOne','agent','then','VoiceChannels','all','filter','rows','UserId','sessionId','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','user:%s','webbar:originate','length','hangup\x20executed!','answer','answer\x20fired:','format','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold','webbar:unhold','unhold\x20executed!','calls'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x9aea,0xdd));var _0xa9ae=function(_0x113bd5,_0x4f79d7){_0x113bd5=_0x113bd5-0x0;var _0xa74f97=_0x9aea[_0x113bd5];return _0xa74f97;};'use strict';var path=require(_0xa9ae('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0xa9ae('0x1'))['db'];var config=require('../../config/environment');var util=require(_0xa9ae('0x2'));var BPromise=require(_0xa9ae('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0xa9ae('0x4')][_0xa9ae('0x5')]({'port':0x232a});var logger=require(_0xa9ae('0x6'))(_0xa9ae('0x7'));var Redis=require(_0xa9ae('0x8'));config['redis']=_[_0xa9ae('0x9')](config[_0xa9ae('0xa')],{'host':_0xa9ae('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa9ae('0xa')]));var Schema=require(_0xa9ae('0xc'));var originateValidation=new Schema({'userId':{'type':_0xa9ae('0xd'),'required':[!![],_0xa9ae('0xe')]},'callNumber':{'type':_0xa9ae('0xf'),'required':[!![],_0xa9ae('0x10')]},'callerId':{'type':_0xa9ae('0xf')},'callbackUrl':{'type':_0xa9ae('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xa9ae('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa9ae('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa9ae('0xe')]},'sessionId':{'type':_0xa9ae('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xa9ae('0xd'),'required':[!![],_0xa9ae('0xe')]},'sessionId':{'type':_0xa9ae('0xf'),'required':[!![],_0xa9ae('0x11')]},'transferNumber':{'type':_0xa9ae('0xf'),'required':[!![],_0xa9ae('0x12')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa9ae('0xe')]},'sessionId':{'type':_0xa9ae('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xa9ae('0xd'),'required':[!![],_0xa9ae('0xe')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xa9ae('0xd'),'required':[!![],_0xa9ae('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0xa9ae('0xd'),'required':[!![],_0xa9ae('0xe')]}});function emit(_0x77b0a4,_0xddb095,_0x524bb2){logger[_0xa9ae('0x13')](_0x77b0a4,_0xddb095,JSON[_0xa9ae('0x14')](_0x524bb2));io['to'](_0x77b0a4)[_0xa9ae('0x15')](_0xddb095,_0x524bb2);}function handleError(_0x4ac5a6){return function(_0x4dbb30){console[_0xa9ae('0x16')]('handleError:',_0x4dbb30,_0x4dbb30 instanceof RangeError);logger['error'](_0x4dbb30[_0xa9ae('0x17')]);if(_0x4dbb30 instanceof RangeError){if(_0x4dbb30[_0xa9ae('0x18')]){delete _0x4dbb30[_0xa9ae('0x18')];}_0x4ac5a6[_0xa9ae('0x19')](0x194)['send'](_0x4dbb30);}else{if(_0x4dbb30[_0xa9ae('0x18')]){delete _0x4dbb30[_0xa9ae('0x18')];}_0x4ac5a6[_0xa9ae('0x19')](0x1f4)[_0xa9ae('0x1a')](_0x4dbb30);}};}function checkError(){return function(_0x426317){if(!_0x426317){throw new RangeError(_0xa9ae('0x1b'));}return _0x426317;};}function respondWithRpcPromise(_0x971ee1,_0x5a062d){return new BPromise(function(_0xc021cf,_0x4ca9a9){var _0x49dca9=amiClient;return _0x49dca9['request'](_0x971ee1,_0x5a062d)['then'](function(_0x1afd07){if(_0x1afd07['error']){if(_0x1afd07[_0xa9ae('0x1c')]['code']===0x1f4){return _0x4ca9a9(_0x1afd07[_0xa9ae('0x1c')][_0xa9ae('0x1d')]);}return _0xc021cf(_0x1afd07[_0xa9ae('0x1c')][_0xa9ae('0x1d')]);}else{_0xc021cf(_0x1afd07[_0xa9ae('0x1e')]);}})[_0xa9ae('0x1f')](function(_0x23c1ec){_0x4ca9a9(_0x23c1ec);});});}function getAgent(_0x5e82f1){return db[_0xa9ae('0x20')][_0xa9ae('0x21')]({'where':{'id':_0x5e82f1,'role':_0xa9ae('0x22')}})[_0xa9ae('0x23')](checkError());}function getAgentCheckSession(_0x222db7,_0x428934){return new BPromise(function(_0xb12fa8,_0x5dfcd7){var _0x489e88=respondWithRpcPromise(_0xa9ae('0x24'));var _0x3c324e=getAgent(_0x222db7);Promise[_0xa9ae('0x25')]([_0x489e88,_0x3c324e])[_0xa9ae('0x23')](function(_0x74cd94){var _0x54a821=_0x74cd94[0x0];var _0x52dd4f=_0x74cd94[0x1];var _0x1892b5=_[_0xa9ae('0x26')](_0x54a821[_0xa9ae('0x27')],function(_0x3a48b7){return _0x3a48b7[_0xa9ae('0x28')]==_0x52dd4f['id']&&_0x3a48b7[_0xa9ae('0x29')]==_0x428934;});if(_0x1892b5['length']==0x1){_0xb12fa8(_0x52dd4f);}else{_0x5dfcd7(new RangeError('sessionId\x20'+_0x428934+_0xa9ae('0x2a')));}});});}exports[_0xa9ae('0x2b')]=function(_0x3d9b30,_0x3cd87a){logger[_0xa9ae('0x13')](_0xa9ae('0x2c'),_0x3d9b30[_0xa9ae('0x2d')]);var _0x3e2ec2=originateValidation['validate'](_0x3d9b30[_0xa9ae('0x2d')]);if(_0x3e2ec2['length']>0x0){return _0x3cd87a[_0xa9ae('0x19')](0x190)[_0xa9ae('0x2e')](_0x3e2ec2);}var _0x3a701b=_0x3d9b30['body'][_0xa9ae('0x2f')];var _0x3eb867=_0x3d9b30[_0xa9ae('0x2d')][_0xa9ae('0x30')];var _0x353227=_0x3d9b30['body'][_0xa9ae('0x31')];var _0xa0730a=_0x3d9b30[_0xa9ae('0x2d')]['callbackUrl'];return getAgent(_0x3a701b)['then'](function(_0x2155c8){logger[_0xa9ae('0x13')](_0xa9ae('0x32'),_0x2155c8[_0xa9ae('0x18')]);emit(util['format'](_0xa9ae('0x33'),_0x2155c8[_0xa9ae('0x18')]),_0xa9ae('0x34'),{'callNumber':_0x3eb867,'callerId':_0x353227,'callbackUrl':_0xa0730a});return _0x3cd87a[_0xa9ae('0x19')](0xc8)[_0xa9ae('0x2e')]({'error':![],'message':'originate\x20executed!'});})[_0xa9ae('0x1f')](handleError(_0x3cd87a));};exports['hangup']=function(_0x26c8fb,_0x38f360){logger[_0xa9ae('0x13')]('hangup\x20fired:',_0x26c8fb[_0xa9ae('0x2d')]);var _0x1ffcab=hangupValidation[_0xa9ae('0xc')](_0x26c8fb['body']);if(_0x1ffcab[_0xa9ae('0x35')]>0x0){return _0x38f360[_0xa9ae('0x19')](0x190)['json'](_0x1ffcab);}var _0x2993b2=_0x26c8fb['body'][_0xa9ae('0x2f')];var _0x24c237=_0x26c8fb['body'][_0xa9ae('0x29')];return getAgent(_0x2993b2)[_0xa9ae('0x23')](function(_0x234da5){logger[_0xa9ae('0x13')](_0xa9ae('0x32'),_0x234da5[_0xa9ae('0x18')]);emit(util['format'](_0xa9ae('0x33'),_0x234da5[_0xa9ae('0x18')]),'webbar:hangup',{'sessionId':_0x24c237});return _0x38f360['status'](0xc8)[_0xa9ae('0x2e')]({'error':![],'message':_0xa9ae('0x36')});})[_0xa9ae('0x1f')](handleError(_0x38f360));};exports[_0xa9ae('0x37')]=function(_0x4c110a,_0x1b0f5e){logger[_0xa9ae('0x13')](_0xa9ae('0x38'),_0x4c110a[_0xa9ae('0x2d')]);var _0x23c91d=answerValidation[_0xa9ae('0xc')](_0x4c110a[_0xa9ae('0x2d')]);if(_0x23c91d['length']>0x0){return _0x1b0f5e[_0xa9ae('0x19')](0x190)[_0xa9ae('0x2e')](_0x23c91d);}var _0x566cb0=_0x4c110a[_0xa9ae('0x2d')]['userId'];var _0xb51a6c=_0x4c110a[_0xa9ae('0x2d')][_0xa9ae('0x29')];return getAgent(_0x566cb0)[_0xa9ae('0x23')](function(_0x250d2b){logger[_0xa9ae('0x13')](_0xa9ae('0x32'),_0x250d2b['name']);emit(util[_0xa9ae('0x39')](_0xa9ae('0x33'),_0x250d2b['name']),_0xa9ae('0x3a'),{'sessionId':_0xb51a6c});return _0x1b0f5e[_0xa9ae('0x19')](0xc8)[_0xa9ae('0x2e')]({'error':![],'message':_0xa9ae('0x3b')});})[_0xa9ae('0x1f')](handleError(_0x1b0f5e));};exports[_0xa9ae('0x3c')]=function(_0x571cb4,_0x1416a2){logger['info'](_0xa9ae('0x3d'),_0x571cb4[_0xa9ae('0x2d')]);var _0x52c6e9=holdValidation['validate'](_0x571cb4[_0xa9ae('0x2d')]);if(_0x52c6e9[_0xa9ae('0x35')]>0x0){return _0x1416a2[_0xa9ae('0x19')](0x190)[_0xa9ae('0x2e')](_0x52c6e9);}var _0x435c29=_0x571cb4[_0xa9ae('0x2d')][_0xa9ae('0x2f')];var _0x60342a=_0x571cb4['body']['sessionId'];return getAgent(_0x435c29)[_0xa9ae('0x23')](function(_0x3cf89c){logger['info'](_0xa9ae('0x32'),_0x3cf89c[_0xa9ae('0x18')]);emit(util[_0xa9ae('0x39')](_0xa9ae('0x33'),_0x3cf89c[_0xa9ae('0x18')]),_0xa9ae('0x3e'),{'sessionId':_0x60342a});return _0x1416a2[_0xa9ae('0x19')](0xc8)[_0xa9ae('0x2e')]({'error':![],'message':'hold\x20executed!'});})[_0xa9ae('0x1f')](handleError(_0x1416a2));};exports[_0xa9ae('0x3f')]=function(_0x5ea18d,_0x128f88){logger['info']('unhold\x20fired:',_0x5ea18d['body']);var _0x3b8916=unholdValidation[_0xa9ae('0xc')](_0x5ea18d['body']);if(_0x3b8916['length']>0x0){return _0x128f88['status'](0x190)[_0xa9ae('0x2e')](_0x3b8916);}var _0x54c67c=_0x5ea18d[_0xa9ae('0x2d')][_0xa9ae('0x2f')];var _0x4e39d5=_0x5ea18d[_0xa9ae('0x2d')]['sessionId'];return getAgent(_0x54c67c)[_0xa9ae('0x23')](function(_0xade70a){logger[_0xa9ae('0x13')](_0xa9ae('0x32'),_0xade70a[_0xa9ae('0x18')]);emit(util[_0xa9ae('0x39')](_0xa9ae('0x33'),_0xade70a[_0xa9ae('0x18')]),_0xa9ae('0x40'),{'sessionId':_0x4e39d5});return _0x128f88[_0xa9ae('0x19')](0xc8)[_0xa9ae('0x2e')]({'error':![],'message':_0xa9ae('0x41')});})['catch'](handleError(_0x128f88));};exports[_0xa9ae('0x42')]=function(_0x9e42b3,_0x24087a){logger[_0xa9ae('0x13')](_0xa9ae('0x43'),_0x24087a['body']);var _0x4fe9e7=callsValidation[_0xa9ae('0xc')](_0x9e42b3[_0xa9ae('0x2d')]);if(_0x4fe9e7['length']>0x0){return _0x24087a['status'](0x190)[_0xa9ae('0x2e')](_0x4fe9e7);}var _0x48637a=_0x9e42b3[_0xa9ae('0x2d')][_0xa9ae('0x2f')];var _0x1a1605=respondWithRpcPromise('VoiceChannels');var _0x36d844=getAgent(_0x48637a);return Promise['all']([_0x1a1605,_0x36d844])[_0xa9ae('0x23')](function(_0x56e847){var _0x157628=_0x56e847[0x0];var _0x38ad8f=_0x56e847[0x1];var _0x46ab4c=_[_0xa9ae('0x26')](_0x157628[_0xa9ae('0x27')],function(_0x44c3cc){return _0x44c3cc['UserId']==_0x38ad8f['id'];});return _0x24087a[_0xa9ae('0x19')](0xc8)[_0xa9ae('0x2e')]({'count':_0x46ab4c[_0xa9ae('0x35')],'rows':_0x46ab4c});})[_0xa9ae('0x1f')](handleError(_0x24087a));};exports['conference']=function(_0x2ebb14,_0x2803fb){logger[_0xa9ae('0x13')](_0xa9ae('0x44'),_0x2ebb14[_0xa9ae('0x2d')]);var _0x1f563a=conferenceValidation[_0xa9ae('0xc')](_0x2ebb14[_0xa9ae('0x2d')]);if(_0x1f563a[_0xa9ae('0x35')]>0x0){return _0x2803fb[_0xa9ae('0x19')](0x190)['json'](_0x1f563a);}var _0xc6b8a4=_0x2ebb14[_0xa9ae('0x2d')][_0xa9ae('0x2f')];return getAgent(_0xc6b8a4)[_0xa9ae('0x23')](function(_0x5b2f69){logger[_0xa9ae('0x13')](_0xa9ae('0x32'),_0x5b2f69['name']);emit(util[_0xa9ae('0x39')](_0xa9ae('0x33'),_0x5b2f69[_0xa9ae('0x18')]),'webbar:conference');return _0x2803fb['status'](0xc8)[_0xa9ae('0x2e')]({'error':![],'message':_0xa9ae('0x45')});})['catch'](handleError(_0x2803fb));};exports['transfer']=function(_0x2369e4,_0x7d0c93){logger[_0xa9ae('0x13')]('transfer\x20fired:',_0x2369e4[_0xa9ae('0x2d')]);var _0x619ae4=transferValidation[_0xa9ae('0xc')](_0x2369e4[_0xa9ae('0x2d')]);if(_0x619ae4[_0xa9ae('0x35')]>0x0){return _0x7d0c93[_0xa9ae('0x19')](0x190)[_0xa9ae('0x2e')](_0x619ae4);}var _0x381298=_0x2369e4[_0xa9ae('0x2d')][_0xa9ae('0x2f')];var _0x53445e=_0x2369e4['body'][_0xa9ae('0x29')];var _0x1a632a=_0x2369e4[_0xa9ae('0x2d')]['transferNumber'];return getAgent(_0x381298)[_0xa9ae('0x23')](function(_0xf2cd59){logger[_0xa9ae('0x13')]('entityFound:',_0xf2cd59['name']);emit(util[_0xa9ae('0x39')]('user:%s',_0xf2cd59[_0xa9ae('0x18')]),_0xa9ae('0x46'),{'sessionId':_0x53445e,'transferNumber':_0x1a632a});return _0x7d0c93[_0xa9ae('0x19')](0xc8)[_0xa9ae('0x2e')]({'error':![],'message':_0xa9ae('0x47')});})[_0xa9ae('0x1f')](handleError(_0x7d0c93));};
\ No newline at end of file
+var _0x495e=['answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','rows','conference','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','../../config/environment','util','bluebird','jayson/promise','http','../../config/logger','webbarapi','ioredis','redis','defaults','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','stringify','emit','log','handleError:','error','stack','name','send','status','NotFound','request','then','code','message','result','catch','User','findOne','all','filter','UserId','sessionId','length','sessionId\x20','originate','info','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','format','user:%s','originate\x20executed!','hangup\x20fired:','entityFound:','webbar:hangup','hangup\x20executed!'];(function(_0x7335fd,_0x1e0837){var _0x1d41e8=function(_0x5745f9){while(--_0x5745f9){_0x7335fd['push'](_0x7335fd['shift']());}};_0x1d41e8(++_0x1e0837);}(_0x495e,0xfb));var _0xe495=function(_0x40bdbc,_0x3fabcd){_0x40bdbc=_0x40bdbc-0x0;var _0xc603a8=_0x495e[_0x40bdbc];return _0xc603a8;};'use strict';var path=require(_0xe495('0x0'));var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0xe495('0x1'));var util=require(_0xe495('0x2'));var BPromise=require(_0xe495('0x3'));var jayson=require(_0xe495('0x4'));var amiClient=jayson['client'][_0xe495('0x5')]({'port':0x232a});var logger=require(_0xe495('0x6'))(_0xe495('0x7'));var Redis=require(_0xe495('0x8'));config[_0xe495('0x9')]=_[_0xe495('0xa')](config[_0xe495('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0xe495('0xb'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe495('0xc')]},'callNumber':{'type':_0xe495('0xd'),'required':[!![],_0xe495('0xe')]},'callerId':{'type':_0xe495('0xd')},'callbackUrl':{'type':_0xe495('0xd')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe495('0xc')]},'sessionId':{'type':_0xe495('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xe495('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xe495('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xe495('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],_0xe495('0x10')]},'transferNumber':{'type':_0xe495('0xd'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xe495('0xf'),'required':[!![],_0xe495('0xc')]},'sessionId':{'type':_0xe495('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe495('0xf'),'required':[!![],_0xe495('0xc')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xe495('0xf'),'required':[!![],_0xe495('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0xe495('0xf'),'required':[!![],_0xe495('0xc')]}});function emit(_0x1ea256,_0x48864f,_0x4dfd4d){logger['info'](_0x1ea256,_0x48864f,JSON[_0xe495('0x11')](_0x4dfd4d));io['to'](_0x1ea256)[_0xe495('0x12')](_0x48864f,_0x4dfd4d);}function handleError(_0x2aa692){return function(_0x577fb7){console[_0xe495('0x13')](_0xe495('0x14'),_0x577fb7,_0x577fb7 instanceof RangeError);logger[_0xe495('0x15')](_0x577fb7[_0xe495('0x16')]);if(_0x577fb7 instanceof RangeError){if(_0x577fb7[_0xe495('0x17')]){delete _0x577fb7['name'];}_0x2aa692['status'](0x194)[_0xe495('0x18')](_0x577fb7);}else{if(_0x577fb7[_0xe495('0x17')]){delete _0x577fb7[_0xe495('0x17')];}_0x2aa692[_0xe495('0x19')](0x1f4)['send'](_0x577fb7);}};}function checkError(){return function(_0x3d4d3c){if(!_0x3d4d3c){throw new RangeError(_0xe495('0x1a'));}return _0x3d4d3c;};}function respondWithRpcPromise(_0x463ba9,_0x5a8720){return new BPromise(function(_0xa0c9bc,_0x17d13f){var _0x475a7e=amiClient;return _0x475a7e[_0xe495('0x1b')](_0x463ba9,_0x5a8720)[_0xe495('0x1c')](function(_0x4840fa){if(_0x4840fa[_0xe495('0x15')]){if(_0x4840fa['error'][_0xe495('0x1d')]===0x1f4){return _0x17d13f(_0x4840fa[_0xe495('0x15')][_0xe495('0x1e')]);}return _0xa0c9bc(_0x4840fa['error'][_0xe495('0x1e')]);}else{_0xa0c9bc(_0x4840fa[_0xe495('0x1f')]);}})[_0xe495('0x20')](function(_0x1db488){_0x17d13f(_0x1db488);});});}function getAgent(_0x21513b){return db[_0xe495('0x21')][_0xe495('0x22')]({'where':{'id':_0x21513b,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x2506f7,_0x5db642){return new BPromise(function(_0x1651d4,_0x3dd5df){var _0x598108=respondWithRpcPromise('VoiceChannels');var _0xd6585c=getAgent(_0x2506f7);Promise[_0xe495('0x23')]([_0x598108,_0xd6585c])[_0xe495('0x1c')](function(_0x8623c1){var _0x18c427=_0x8623c1[0x0];var _0x258d9c=_0x8623c1[0x1];var _0x181d26=_[_0xe495('0x24')](_0x18c427['rows'],function(_0x4bae72){return _0x4bae72[_0xe495('0x25')]==_0x258d9c['id']&&_0x4bae72[_0xe495('0x26')]==_0x5db642;});if(_0x181d26[_0xe495('0x27')]==0x1){_0x1651d4(_0x258d9c);}else{_0x3dd5df(new RangeError(_0xe495('0x28')+_0x5db642+'\x20not\x20found!'));}});});}exports[_0xe495('0x29')]=function(_0x1d0c2f,_0x227019){logger[_0xe495('0x2a')](_0xe495('0x2b'),_0x1d0c2f[_0xe495('0x2c')]);var _0x2ffb33=originateValidation[_0xe495('0xb')](_0x1d0c2f[_0xe495('0x2c')]);if(_0x2ffb33[_0xe495('0x27')]>0x0){return _0x227019[_0xe495('0x19')](0x190)[_0xe495('0x2d')](_0x2ffb33);}var _0x31b515=_0x1d0c2f[_0xe495('0x2c')][_0xe495('0x2e')];var _0x5ee00d=_0x1d0c2f[_0xe495('0x2c')][_0xe495('0x2f')];var _0x538f56=_0x1d0c2f[_0xe495('0x2c')][_0xe495('0x30')];var _0x495388=_0x1d0c2f['body'][_0xe495('0x31')];return getAgent(_0x31b515)[_0xe495('0x1c')](function(_0x3b2b1e){logger[_0xe495('0x2a')]('entityFound:',_0x3b2b1e[_0xe495('0x17')]);emit(util[_0xe495('0x32')](_0xe495('0x33'),_0x3b2b1e['name']),'webbar:originate',{'callNumber':_0x5ee00d,'callerId':_0x538f56,'callbackUrl':_0x495388});return _0x227019[_0xe495('0x19')](0xc8)['json']({'error':![],'message':_0xe495('0x34')});})[_0xe495('0x20')](handleError(_0x227019));};exports['hangup']=function(_0x4d2816,_0x3fb1fe){logger[_0xe495('0x2a')](_0xe495('0x35'),_0x4d2816[_0xe495('0x2c')]);var _0x2c316f=hangupValidation[_0xe495('0xb')](_0x4d2816[_0xe495('0x2c')]);if(_0x2c316f[_0xe495('0x27')]>0x0){return _0x3fb1fe[_0xe495('0x19')](0x190)[_0xe495('0x2d')](_0x2c316f);}var _0x4f566b=_0x4d2816[_0xe495('0x2c')]['userId'];var _0x734667=_0x4d2816[_0xe495('0x2c')][_0xe495('0x26')];return getAgent(_0x4f566b)[_0xe495('0x1c')](function(_0x58df09){logger[_0xe495('0x2a')](_0xe495('0x36'),_0x58df09['name']);emit(util['format']('user:%s',_0x58df09[_0xe495('0x17')]),_0xe495('0x37'),{'sessionId':_0x734667});return _0x3fb1fe[_0xe495('0x19')](0xc8)[_0xe495('0x2d')]({'error':![],'message':_0xe495('0x38')});})[_0xe495('0x20')](handleError(_0x3fb1fe));};exports['answer']=function(_0x216b63,_0x4374ca){logger[_0xe495('0x2a')](_0xe495('0x39'),_0x216b63[_0xe495('0x2c')]);var _0x2ff501=answerValidation[_0xe495('0xb')](_0x216b63[_0xe495('0x2c')]);if(_0x2ff501[_0xe495('0x27')]>0x0){return _0x4374ca['status'](0x190)['json'](_0x2ff501);}var _0x2aa12f=_0x216b63['body'][_0xe495('0x2e')];var _0x379636=_0x216b63['body'][_0xe495('0x26')];return getAgent(_0x2aa12f)['then'](function(_0x5efdd7){logger[_0xe495('0x2a')]('entityFound:',_0x5efdd7[_0xe495('0x17')]);emit(util['format'](_0xe495('0x33'),_0x5efdd7[_0xe495('0x17')]),_0xe495('0x3a'),{'sessionId':_0x379636});return _0x4374ca[_0xe495('0x19')](0xc8)[_0xe495('0x2d')]({'error':![],'message':_0xe495('0x3b')});})[_0xe495('0x20')](handleError(_0x4374ca));};exports[_0xe495('0x3c')]=function(_0x3d9578,_0x317e4c){logger['info'](_0xe495('0x3d'),_0x3d9578['body']);var _0x3fb64a=holdValidation[_0xe495('0xb')](_0x3d9578[_0xe495('0x2c')]);if(_0x3fb64a[_0xe495('0x27')]>0x0){return _0x317e4c['status'](0x190)['json'](_0x3fb64a);}var _0x54a346=_0x3d9578[_0xe495('0x2c')][_0xe495('0x2e')];var _0x59791b=_0x3d9578[_0xe495('0x2c')][_0xe495('0x26')];return getAgent(_0x54a346)[_0xe495('0x1c')](function(_0x103953){logger[_0xe495('0x2a')](_0xe495('0x36'),_0x103953[_0xe495('0x17')]);emit(util['format'](_0xe495('0x33'),_0x103953[_0xe495('0x17')]),_0xe495('0x3e'),{'sessionId':_0x59791b});return _0x317e4c[_0xe495('0x19')](0xc8)[_0xe495('0x2d')]({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x317e4c));};exports[_0xe495('0x3f')]=function(_0x19d7b7,_0x1b81fd){logger['info']('unhold\x20fired:',_0x19d7b7[_0xe495('0x2c')]);var _0x47cb8e=unholdValidation[_0xe495('0xb')](_0x19d7b7[_0xe495('0x2c')]);if(_0x47cb8e['length']>0x0){return _0x1b81fd[_0xe495('0x19')](0x190)[_0xe495('0x2d')](_0x47cb8e);}var _0xb3f987=_0x19d7b7[_0xe495('0x2c')][_0xe495('0x2e')];var _0xb8959a=_0x19d7b7[_0xe495('0x2c')][_0xe495('0x26')];return getAgent(_0xb3f987)[_0xe495('0x1c')](function(_0x42c7dc){logger[_0xe495('0x2a')](_0xe495('0x36'),_0x42c7dc['name']);emit(util[_0xe495('0x32')](_0xe495('0x33'),_0x42c7dc[_0xe495('0x17')]),_0xe495('0x40'),{'sessionId':_0xb8959a});return _0x1b81fd[_0xe495('0x19')](0xc8)[_0xe495('0x2d')]({'error':![],'message':_0xe495('0x41')});})[_0xe495('0x20')](handleError(_0x1b81fd));};exports[_0xe495('0x42')]=function(_0xdab7c1,_0x588069){logger['info'](_0xe495('0x43'),_0x588069[_0xe495('0x2c')]);var _0x4b5747=callsValidation[_0xe495('0xb')](_0xdab7c1[_0xe495('0x2c')]);if(_0x4b5747[_0xe495('0x27')]>0x0){return _0x588069[_0xe495('0x19')](0x190)['json'](_0x4b5747);}var _0x256dce=_0xdab7c1[_0xe495('0x2c')][_0xe495('0x2e')];var _0x368566=respondWithRpcPromise(_0xe495('0x44'));var _0xfcfb7b=getAgent(_0x256dce);return Promise['all']([_0x368566,_0xfcfb7b])[_0xe495('0x1c')](function(_0x59a6de){var _0x1a4ab2=_0x59a6de[0x0];var _0x51356c=_0x59a6de[0x1];var _0x3bc187=_['filter'](_0x1a4ab2[_0xe495('0x45')],function(_0x57c584){return _0x57c584[_0xe495('0x25')]==_0x51356c['id'];});return _0x588069[_0xe495('0x19')](0xc8)['json']({'count':_0x3bc187[_0xe495('0x27')],'rows':_0x3bc187});})[_0xe495('0x20')](handleError(_0x588069));};exports[_0xe495('0x46')]=function(_0x3646ea,_0x2e94ab){logger[_0xe495('0x2a')](_0xe495('0x47'),_0x3646ea[_0xe495('0x2c')]);var _0x7425c7=conferenceValidation[_0xe495('0xb')](_0x3646ea[_0xe495('0x2c')]);if(_0x7425c7[_0xe495('0x27')]>0x0){return _0x2e94ab[_0xe495('0x19')](0x190)[_0xe495('0x2d')](_0x7425c7);}var _0x1ed773=_0x3646ea[_0xe495('0x2c')][_0xe495('0x2e')];return getAgent(_0x1ed773)[_0xe495('0x1c')](function(_0x10fdc7){logger[_0xe495('0x2a')](_0xe495('0x36'),_0x10fdc7['name']);emit(util[_0xe495('0x32')]('user:%s',_0x10fdc7[_0xe495('0x17')]),_0xe495('0x48'));return _0x2e94ab['status'](0xc8)[_0xe495('0x2d')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x2e94ab));};exports[_0xe495('0x49')]=function(_0x200664,_0x57ab3f){logger[_0xe495('0x2a')](_0xe495('0x4a'),_0x200664[_0xe495('0x2c')]);var _0x35febb=transferValidation['validate'](_0x200664[_0xe495('0x2c')]);if(_0x35febb[_0xe495('0x27')]>0x0){return _0x57ab3f[_0xe495('0x19')](0x190)[_0xe495('0x2d')](_0x35febb);}var _0xdc34c6=_0x200664['body'][_0xe495('0x2e')];var _0x273081=_0x200664[_0xe495('0x2c')][_0xe495('0x26')];var _0x273c73=_0x200664['body']['transferNumber'];return getAgent(_0xdc34c6)[_0xe495('0x1c')](function(_0x2c10a1){logger[_0xe495('0x2a')]('entityFound:',_0x2c10a1[_0xe495('0x17')]);emit(util[_0xe495('0x32')](_0xe495('0x33'),_0x2c10a1[_0xe495('0x17')]),_0xe495('0x4b'),{'sessionId':_0x273081,'transferNumber':_0x273c73});return _0x57ab3f[_0xe495('0x19')](0xc8)[_0xe495('0x2d')]({'error':![],'message':_0xe495('0x4c')});})['catch'](handleError(_0x57ab3f));};
\ No newline at end of file
index c9816e9..a47c432 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd943=['show','get','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','send','put','/:id','destroy','/:id/dispositions','removeDispositions','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe'];(function(_0x1d83ab,_0x223fea){var _0x557b0d=function(_0xa55d74){while(--_0xa55d74){_0x1d83ab['push'](_0x1d83ab['shift']());}};_0x557b0d(++_0x223fea);}(_0xd943,0x15d));var _0x3d94=function(_0x11f723,_0x36bcc7){_0x11f723=_0x11f723-0x0;var _0x3ae7ca=_0xd943[_0x11f723];return _0x3ae7ca;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require('express');var router=express[_0x3d94('0x4')]();var fs_extra=require(_0x3d94('0x5'));var auth=require(_0x3d94('0x6'));var interaction=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var controller=require('./whatsappAccount.controller');router['get']('/',auth[_0x3d94('0x9')](),controller['index']);router['get']('/describe',auth[_0x3d94('0x9')](),controller[_0x3d94('0xa')]);router['get']('/:id',auth[_0x3d94('0x9')](),controller[_0x3d94('0xb')]);router[_0x3d94('0xc')]('/:id/dispositions',auth[_0x3d94('0x9')](),controller['getDispositions']);router[_0x3d94('0xc')](_0x3d94('0xd'),auth['isAuthenticated'](),controller[_0x3d94('0xe')]);router[_0x3d94('0xc')](_0x3d94('0xf'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x10')]);router['get'](_0x3d94('0x11'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x12')]);router['post']('/',auth[_0x3d94('0x9')](),controller[_0x3d94('0x13')]);router[_0x3d94('0x14')]('/:id/dispositions',auth[_0x3d94('0x9')](),controller[_0x3d94('0x15')]);router[_0x3d94('0x14')](_0x3d94('0xd'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x16')]);router[_0x3d94('0x14')](_0x3d94('0xf'),auth['isAuthenticated'](),controller[_0x3d94('0x17')]);router[_0x3d94('0x14')](_0x3d94('0x11'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x18')]);router[_0x3d94('0x14')](_0x3d94('0x19'),controller['notify']);router[_0x3d94('0x14')]('/:id/send',auth[_0x3d94('0x9')](),controller[_0x3d94('0x1a')]);router[_0x3d94('0x1b')](_0x3d94('0x1c'),auth[_0x3d94('0x9')](),controller['update']);router['delete'](_0x3d94('0x1c'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x1d')]);router['delete'](_0x3d94('0x1e'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x1f')]);router[_0x3d94('0x20')](_0x3d94('0xd'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x21')]);router[_0x3d94('0x20')](_0x3d94('0xf'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x22')]);module[_0x3d94('0x23')]=router;
\ No newline at end of file
+var _0xd117=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/users','getAgents','getApplications','create','post','addDisposition','/:id/canned_answers','addAnswer','addAgents','/:id/applications','/:id/notify','send','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout'];(function(_0x4f0e62,_0x28e44f){var _0x117ab8=function(_0x1a74bb){while(--_0x1a74bb){_0x4f0e62['push'](_0x4f0e62['shift']());}};_0x117ab8(++_0x28e44f);}(_0xd117,0x182));var _0x7d11=function(_0x29279c,_0x570176){_0x29279c=_0x29279c-0x0;var _0x279b1f=_0xd117[_0x29279c];return _0x279b1f;};'use strict';var multer=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var path=require(_0x7d11('0x2'));var timeout=require(_0x7d11('0x3'));var express=require(_0x7d11('0x4'));var router=express[_0x7d11('0x5')]();var fs_extra=require(_0x7d11('0x6'));var auth=require(_0x7d11('0x7'));var interaction=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var controller=require(_0x7d11('0xa'));router[_0x7d11('0xb')]('/',auth[_0x7d11('0xc')](),controller[_0x7d11('0xd')]);router[_0x7d11('0xb')](_0x7d11('0xe'),auth['isAuthenticated'](),controller[_0x7d11('0xf')]);router[_0x7d11('0xb')](_0x7d11('0x10'),auth['isAuthenticated'](),controller[_0x7d11('0x11')]);router[_0x7d11('0xb')](_0x7d11('0x12'),auth['isAuthenticated'](),controller[_0x7d11('0x13')]);router['get']('/:id/canned_answers',auth[_0x7d11('0xc')](),controller['getAnswers']);router['get'](_0x7d11('0x14'),auth['isAuthenticated'](),controller[_0x7d11('0x15')]);router[_0x7d11('0xb')]('/:id/applications',auth[_0x7d11('0xc')](),controller[_0x7d11('0x16')]);router['post']('/',auth[_0x7d11('0xc')](),controller[_0x7d11('0x17')]);router[_0x7d11('0x18')](_0x7d11('0x12'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x19')]);router[_0x7d11('0x18')](_0x7d11('0x1a'),auth['isAuthenticated'](),controller[_0x7d11('0x1b')]);router[_0x7d11('0x18')](_0x7d11('0x14'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x1c')]);router['post'](_0x7d11('0x1d'),auth[_0x7d11('0xc')](),controller['addApplications']);router['post'](_0x7d11('0x1e'),controller['notify']);router[_0x7d11('0x18')]('/:id/send',auth[_0x7d11('0xc')](),controller[_0x7d11('0x1f')]);router[_0x7d11('0x20')](_0x7d11('0x10'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x21')]);router[_0x7d11('0x22')](_0x7d11('0x10'),auth['isAuthenticated'](),controller[_0x7d11('0x23')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x7d11('0x24')]);router[_0x7d11('0x22')](_0x7d11('0x1a'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x25')]);router[_0x7d11('0x22')](_0x7d11('0x14'),auth[_0x7d11('0xc')](),controller['removeAgents']);module[_0x7d11('0x26')]=router;
\ No newline at end of file
index 6dd2e36..89fc9b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad63=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','sinch','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xad63,0x68));var _0x3ad6=function(_0x3b09fd,_0x47d8ae){_0x3b09fd=_0x3b09fd-0x0;var _0x2adea6=_0xad63[_0x3b09fd];return _0x2adea6;};'use strict';var Sequelize=require(_0x3ad6('0x0'));var rs=require(_0x3ad6('0x1'));module['exports']={'name':{'type':Sequelize[_0x3ad6('0x2')],'unique':_0x3ad6('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x3ad6('0x4')]();}},'phone':{'type':Sequelize[_0x3ad6('0x2')]},'type':{'type':Sequelize['ENUM']('twilio',_0x3ad6('0x5'))},'accountSid':{'type':Sequelize[_0x3ad6('0x2')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x3ad6('0x2')]},'notificationTemplate':{'type':Sequelize[_0x3ad6('0x6')],'defaultValue':function(){return _0x3ad6('0x7');}},'notificationSound':{'type':Sequelize[_0x3ad6('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x3ad6('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3ad6('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3ad6('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3ad6('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3ad6('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3ad6('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3ad6('0x9')],'comment':_0x3ad6('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x3ad6('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x92248b){if(!_0x92248b){this[_0x3ad6('0xb')](_0x3ad6('0xc'),null);}this[_0x3ad6('0xb')](_0x3ad6('0xd'),_0x92248b);}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0abe=['mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId'];(function(_0x4b2251,_0x393f10){var _0x5d22fb=function(_0x10992c){while(--_0x10992c){_0x4b2251['push'](_0x4b2251['shift']());}};_0x5d22fb(++_0x393f10);}(_0x0abe,0xf1));var _0xe0ab=function(_0x171213,_0x3009c3){_0x171213=_0x171213-0x0;var _0x4d561a=_0x0abe[_0x171213];return _0x4d561a;};'use strict';var Sequelize=require(_0xe0ab('0x0'));var rs=require(_0xe0ab('0x1'));module[_0xe0ab('0x2')]={'name':{'type':Sequelize[_0xe0ab('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xe0ab('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xe0ab('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xe0ab('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe0ab('0x5')](_0xe0ab('0x6'),_0xe0ab('0x7'))},'accountSid':{'type':Sequelize[_0xe0ab('0x3')]},'baseUrl':{'type':Sequelize[_0xe0ab('0x3')]},'authToken':{'type':Sequelize[_0xe0ab('0x3')]},'notificationTemplate':{'type':Sequelize[_0xe0ab('0x8')],'defaultValue':function(){return _0xe0ab('0x9');}},'notificationSound':{'type':Sequelize[_0xe0ab('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xe0ab('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe0ab('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe0ab('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe0ab('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe0ab('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe0ab('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe0ab('0xb')],'comment':_0xe0ab('0xc')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4b6c33){if(!_0x4b6c33){this[_0xe0ab('0xd')](_0xe0ab('0xe'),null);}this[_0xe0ab('0xd')](_0xe0ab('0xf'),_0x4b6c33);}},'description':{'type':Sequelize[_0xe0ab('0x3')]}};
\ No newline at end of file
index 5f1c9fc..34ec6c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d62=['http','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','destroy','get','WhatsappAccounts','end','stack','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','keys','length','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','omit','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','WhatsappMessage','timestamp','message_id','orderBy','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','notifications','isNil','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','list','contact','interaction','created','autoclose','push','close','unmanaged','ContactId','AttachmentId','UserId','applications','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','receiveMessage','Content-Type','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','defaults','WhatsappInteraction','out','Messages','dataValues','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register'];(function(_0x3d7f0e,_0x104d69){var _0x3e45dd=function(_0x56770a){while(--_0x56770a){_0x3d7f0e['push'](_0x3d7f0e['shift']());}};_0x3e45dd(++_0x104d69);}(_0x0d62,0xa9));var _0x20d6=function(_0x343090,_0x433a80){_0x343090=_0x343090-0x0;var _0x3ff3e8=_0x0d62[_0x343090];return _0x3ff3e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20d6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x20d6('0x1'));var rp=require(_0x20d6('0x2'));var moment=require(_0x20d6('0x3'));var BPromise=require(_0x20d6('0x4'));var Mustache=require(_0x20d6('0x5'));var util=require(_0x20d6('0x6'));var path=require(_0x20d6('0x7'));var sox=require(_0x20d6('0x8'));var csv=require(_0x20d6('0x9'));var ejs=require(_0x20d6('0xa'));var fs=require('fs');var fs_extra=require(_0x20d6('0xb'));var _=require(_0x20d6('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x20d6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x20d6('0x9'));var querystring=require('querystring');var Papa=require(_0x20d6('0xe'));var Redis=require(_0x20d6('0xf'));var authService=require(_0x20d6('0x10'));var qs=require(_0x20d6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x20d6('0x12'));var logger=require('../../config/logger')(_0x20d6('0x13'));var utils=require(_0x20d6('0x14'));var config=require(_0x20d6('0x15'));var licenseUtil=require(_0x20d6('0x16'));var db=require(_0x20d6('0x17'))['db'];config[_0x20d6('0x18')]=_['defaults'](config['redis'],{'host':_0x20d6('0x19'),'port':0x18eb});var socket=require(_0x20d6('0x1a'))(new Redis(config[_0x20d6('0x18')]));require('./whatsappAccount.socket')[_0x20d6('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x20d6('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x639b19,_0x26c02f,_0x381878,_0x58351e){return new BPromise(function(_0x230640,_0x5031e3){var _0x1f6603=_0x58351e||client;return _0x1f6603[_0x20d6('0x1d')](_0x639b19,_0x381878)[_0x20d6('0x1e')](function(_0x4a6752){logger['info'](_0x20d6('0x1f'),_0x26c02f,_0x20d6('0x20'));logger[_0x20d6('0x21')](_0x20d6('0x22'),_0x26c02f,_0x20d6('0x20'),JSON[_0x20d6('0x23')](_0x4a6752));if(_0x4a6752[_0x20d6('0x24')]){if(_0x4a6752[_0x20d6('0x24')]['code']===0x1f4){logger[_0x20d6('0x24')](_0x20d6('0x1f'),_0x26c02f,_0x4a6752[_0x20d6('0x24')]['message']);return _0x5031e3(_0x4a6752[_0x20d6('0x24')][_0x20d6('0x25')]);}logger[_0x20d6('0x24')](_0x20d6('0x1f'),_0x26c02f,_0x4a6752['error'][_0x20d6('0x25')]);return _0x230640(_0x4a6752[_0x20d6('0x24')][_0x20d6('0x25')]);}else{logger['info'](_0x20d6('0x1f'),_0x26c02f,_0x20d6('0x20'));_0x230640(_0x4a6752[_0x20d6('0x26')][_0x20d6('0x25')]);}})[_0x20d6('0x27')](function(_0x355be2){logger['error'](_0x20d6('0x1f'),_0x26c02f,_0x355be2);_0x5031e3(_0x355be2);});});}function respondWithStatusCode(_0x37ca2a,_0x3f0e03){_0x3f0e03=_0x3f0e03||0xcc;return function(_0x3b51b3){if(_0x3b51b3){return _0x37ca2a[_0x20d6('0x28')](_0x3f0e03);}return _0x37ca2a['status'](_0x3f0e03)['end']();};}function respondWithResult(_0x4f541c,_0x47413f){_0x47413f=_0x47413f||0xc8;return function(_0x2be4a5){if(_0x2be4a5){return _0x4f541c['status'](_0x47413f)[_0x20d6('0x29')](_0x2be4a5);}};}function respondWithFilteredResult(_0x3d5c34,_0x499651){return function(_0x36ac23){if(_0x36ac23){var _0x5da1e2=typeof _0x499651[_0x20d6('0x2a')]===_0x20d6('0x2b')&&typeof _0x499651[_0x20d6('0x2c')]===_0x20d6('0x2b');var _0x11d34c=_0x36ac23[_0x20d6('0x2d')];var _0x429f10=_0x5da1e2?0x0:_0x499651['offset'];var _0x2ff4be=_0x5da1e2?_0x36ac23[_0x20d6('0x2d')]:_0x499651['offset']+_0x499651[_0x20d6('0x2c')];var _0xe9fa31;if(_0x2ff4be>=_0x11d34c){_0x2ff4be=_0x11d34c;_0xe9fa31=0xc8;}else{_0xe9fa31=0xce;}_0x3d5c34[_0x20d6('0x2e')](_0xe9fa31);return _0x3d5c34[_0x20d6('0x2f')](_0x20d6('0x30'),_0x429f10+'-'+_0x2ff4be+'/'+_0x11d34c)[_0x20d6('0x29')](_0x36ac23);}return null;};}function patchUpdates(_0x136f90){return function(_0x52e321){try{jsonpatch['apply'](_0x52e321,_0x136f90,!![]);}catch(_0x473a19){return BPromise[_0x20d6('0x31')](_0x473a19);}return _0x52e321[_0x20d6('0x32')]();};}function saveUpdates(_0x273827,_0x493777){return function(_0x1f3df4){if(_0x1f3df4){return _0x1f3df4[_0x20d6('0x33')](_0x273827)[_0x20d6('0x1e')](function(_0x571cc8){return _0x571cc8;});}return null;};}function removeEntity(_0x2272c7,_0x19a7da){return function(_0xb00a3c){if(_0xb00a3c){return _0xb00a3c[_0x20d6('0x34')]()['then'](function(){var _0x46c75a=_0xb00a3c[_0x20d6('0x35')]({'plain':!![]});var _0x28f031=_0x20d6('0x36');return db['UserProfileResource'][_0x20d6('0x34')]({'where':{'type':_0x28f031,'resourceId':_0x46c75a['id']}})[_0x20d6('0x1e')](function(){return _0xb00a3c;});})['then'](function(){_0x2272c7[_0x20d6('0x2e')](0xcc)[_0x20d6('0x37')]();});}};}function handleEntityNotFound(_0xde20,_0x2bffb7){return function(_0x5ba64f){if(!_0x5ba64f){_0xde20[_0x20d6('0x28')](0x194);}return _0x5ba64f;};}function handleError(_0x1f70c9,_0x1aac81){_0x1aac81=_0x1aac81||0x1f4;return function(_0x4b0a7f){logger[_0x20d6('0x24')](_0x4b0a7f[_0x20d6('0x38')]);if(_0x4b0a7f[_0x20d6('0x39')]){delete _0x4b0a7f[_0x20d6('0x39')];}_0x1f70c9[_0x20d6('0x2e')](_0x1aac81)[_0x20d6('0x3a')](_0x4b0a7f);};}exports[_0x20d6('0x3b')]=function(_0x3bd204,_0x1f0e4b){var _0x10f844={'include':[{'model':db[_0x20d6('0x3c')],'as':_0x20d6('0x3d')}]},_0x1d7d9f={},_0x20fbd5={'count':0x0,'rows':[]};var _0x3131ec=_['map'](db[_0x20d6('0x3e')][_0x20d6('0x3f')],function(_0x14c9b3){return{'name':_0x14c9b3[_0x20d6('0x40')],'type':_0x14c9b3['type'][_0x20d6('0x41')]};});_0x1d7d9f[_0x20d6('0x42')]=_[_0x20d6('0x43')](_0x3131ec,'name');_0x1d7d9f['query']=_['keys'](_0x3bd204[_0x20d6('0x44')]);_0x1d7d9f[_0x20d6('0x45')]=_[_0x20d6('0x46')](_0x1d7d9f['model'],_0x1d7d9f['query']);_0x10f844[_0x20d6('0x47')]=_['intersection'](_0x1d7d9f[_0x20d6('0x42')],qs['fields'](_0x3bd204[_0x20d6('0x44')][_0x20d6('0x48')]));_0x10f844[_0x20d6('0x47')]=_0x10f844['attributes']['length']?_0x10f844[_0x20d6('0x47')]:_0x1d7d9f[_0x20d6('0x42')];if(!_0x3bd204[_0x20d6('0x44')][_0x20d6('0x49')]('nolimit')){_0x10f844['limit']=qs[_0x20d6('0x2c')](_0x3bd204[_0x20d6('0x44')]['limit']);_0x10f844[_0x20d6('0x2a')]=qs[_0x20d6('0x2a')](_0x3bd204['query'][_0x20d6('0x2a')]);}_0x10f844[_0x20d6('0x4a')]=qs[_0x20d6('0x4b')](_0x3bd204[_0x20d6('0x44')][_0x20d6('0x4b')]);_0x10f844[_0x20d6('0x4c')]=qs[_0x20d6('0x45')](_[_0x20d6('0x4d')](_0x3bd204[_0x20d6('0x44')],_0x1d7d9f[_0x20d6('0x45')]),_0x3131ec);if(_0x3bd204['query']['filter']){_0x10f844[_0x20d6('0x4c')]=_[_0x20d6('0x4e')](_0x10f844['where'],{'$or':_[_0x20d6('0x43')](_0x3131ec,function(_0x3e13cb){if(_0x3e13cb[_0x20d6('0x4f')]!=='VIRTUAL'){var _0x3fe641={};_0x3fe641[_0x3e13cb['name']]={'$like':'%'+_0x3bd204[_0x20d6('0x44')][_0x20d6('0x50')]+'%'};return _0x3fe641;}})});}_0x10f844=_[_0x20d6('0x4e')]({},_0x10f844,_0x3bd204[_0x20d6('0x51')]);var _0x359a17={'where':_0x10f844[_0x20d6('0x4c')]};return db['WhatsappAccount'][_0x20d6('0x2d')](_0x359a17)['then'](function(_0x2cfda7){_0x20fbd5['count']=_0x2cfda7;if(_0x3bd204[_0x20d6('0x44')][_0x20d6('0x52')]){_0x10f844[_0x20d6('0x53')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x20d6('0x54')](_0x10f844);})[_0x20d6('0x1e')](function(_0x43fbc0){_0x20fbd5[_0x20d6('0x55')]=_0x43fbc0;return _0x20fbd5;})[_0x20d6('0x1e')](respondWithFilteredResult(_0x1f0e4b,_0x10f844))[_0x20d6('0x27')](handleError(_0x1f0e4b,null));};exports['show']=function(_0x451943,_0x2151c9){var _0x13ded7={'raw':![],'where':{'id':_0x451943['params']['id']},'include':[{'model':db[_0x20d6('0x3c')],'as':_0x20d6('0x3d')}]},_0x9db142={};_0x9db142['model']=_[_0x20d6('0x56')](db[_0x20d6('0x3e')][_0x20d6('0x3f')]);_0x9db142[_0x20d6('0x44')]=_[_0x20d6('0x56')](_0x451943[_0x20d6('0x44')]);_0x9db142[_0x20d6('0x45')]=_[_0x20d6('0x46')](_0x9db142[_0x20d6('0x42')],_0x9db142['query']);_0x13ded7['attributes']=_[_0x20d6('0x46')](_0x9db142[_0x20d6('0x42')],qs[_0x20d6('0x48')](_0x451943['query'][_0x20d6('0x48')]));_0x13ded7[_0x20d6('0x47')]=_0x13ded7[_0x20d6('0x47')][_0x20d6('0x57')]?_0x13ded7[_0x20d6('0x47')]:_0x9db142[_0x20d6('0x42')];if(_0x451943[_0x20d6('0x44')]['includeAll']){_0x13ded7[_0x20d6('0x53')]=[{'all':!![]}];}_0x13ded7=_[_0x20d6('0x4e')]({},_0x13ded7,_0x451943[_0x20d6('0x51')]);return db[_0x20d6('0x3e')][_0x20d6('0x58')](_0x13ded7)[_0x20d6('0x1e')](handleEntityNotFound(_0x2151c9,null))['then'](respondWithResult(_0x2151c9,null))['catch'](handleError(_0x2151c9,null));};exports['create']=function(_0x13d510,_0x5cea15){return db[_0x20d6('0x3e')]['create'](_0x13d510[_0x20d6('0x59')],{})[_0x20d6('0x1e')](function(_0x2267df){var _0x59ec00=_0x13d510['user'][_0x20d6('0x35')]({'plain':!![]});if(!_0x59ec00)throw new Error(_0x20d6('0x5a'));if(_0x59ec00[_0x20d6('0x5b')]===_0x20d6('0x5c')){var _0x2fbc97=_0x2267df[_0x20d6('0x35')]({'plain':!![]});var _0x2e3911=_0x20d6('0x36');return db[_0x20d6('0x5d')][_0x20d6('0x58')]({'where':{'name':_0x2e3911,'userProfileId':_0x59ec00[_0x20d6('0x5e')]},'raw':!![]})['then'](function(_0xd6f775){if(_0xd6f775&&_0xd6f775[_0x20d6('0x5f')]===0x0){return db[_0x20d6('0x60')][_0x20d6('0x61')]({'name':_0x2fbc97[_0x20d6('0x39')],'resourceId':_0x2fbc97['id'],'type':_0xd6f775[_0x20d6('0x39')],'sectionId':_0xd6f775['id']},{})[_0x20d6('0x1e')](function(){return _0x2267df;});}else{return _0x2267df;}})[_0x20d6('0x27')](function(_0x46f96f){logger[_0x20d6('0x24')](_0x20d6('0x62'),_0x46f96f);throw _0x46f96f;});}return _0x2267df;})[_0x20d6('0x1e')](respondWithResult(_0x5cea15,0xc9))['catch'](handleError(_0x5cea15,null));};exports[_0x20d6('0x33')]=function(_0xf1f813,_0x1430da){if(_0xf1f813[_0x20d6('0x59')]['id']){delete _0xf1f813[_0x20d6('0x59')]['id'];}return db[_0x20d6('0x3e')][_0x20d6('0x58')]({'where':{'id':_0xf1f813[_0x20d6('0x63')]['id']},'include':[{'model':db[_0x20d6('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x20d6('0x1e')](handleEntityNotFound(_0x1430da,null))[_0x20d6('0x1e')](saveUpdates(_0xf1f813[_0x20d6('0x59')],null))[_0x20d6('0x1e')](respondWithResult(_0x1430da,null))['catch'](handleError(_0x1430da,null));};exports[_0x20d6('0x34')]=function(_0x2134a2,_0x1aaec4){return db[_0x20d6('0x3e')][_0x20d6('0x58')]({'where':{'id':_0x2134a2['params']['id']}})['then'](handleEntityNotFound(_0x1aaec4,null))['then'](removeEntity(_0x1aaec4,null))[_0x20d6('0x27')](handleError(_0x1aaec4,null));};exports[_0x20d6('0x64')]=function(_0x1b8f57,_0x4c83ac){return db[_0x20d6('0x3e')][_0x20d6('0x64')]()['then'](respondWithResult(_0x4c83ac,null))[_0x20d6('0x27')](handleError(_0x4c83ac,null));};exports[_0x20d6('0x65')]=function(_0x5ea7d1,_0x15a9be,_0x15a128){if(_0x5ea7d1['body']['id']){delete _0x5ea7d1['body']['id'];}return db['WhatsappAccount'][_0x20d6('0x58')]({'where':{'id':_0x5ea7d1[_0x20d6('0x63')]['id']}})[_0x20d6('0x1e')](handleEntityNotFound(_0x15a9be,null))[_0x20d6('0x1e')](function(_0x501e9b){if(_0x501e9b){_0x5ea7d1[_0x20d6('0x59')][_0x20d6('0x66')]=_0x501e9b['id'];return db[_0x20d6('0x67')][_0x20d6('0x61')](_0x5ea7d1[_0x20d6('0x59')]);}})[_0x20d6('0x1e')](respondWithResult(_0x15a9be,null))[_0x20d6('0x27')](handleError(_0x15a9be,null));};exports[_0x20d6('0x68')]=function(_0x32c798,_0x5bedb8,_0x2ae00e){var _0x41434b={'raw':![],'where':{}};var _0x92072b={};var _0x462bd8={'count':0x0,'rows':[]};return db[_0x20d6('0x3e')][_0x20d6('0x69')]({'where':{'id':_0x32c798[_0x20d6('0x63')]['id']}})[_0x20d6('0x1e')](handleEntityNotFound(_0x5bedb8,null))[_0x20d6('0x1e')](function(_0x29aa0d){if(_0x29aa0d){_0x92072b[_0x20d6('0x42')]=_[_0x20d6('0x56')](db[_0x20d6('0x67')]['rawAttributes']);_0x92072b[_0x20d6('0x44')]=_[_0x20d6('0x56')](_0x32c798['query']);_0x92072b[_0x20d6('0x45')]=_[_0x20d6('0x46')](_0x92072b['model'],_0x92072b['query']);_0x41434b[_0x20d6('0x47')]=_['intersection'](_0x92072b[_0x20d6('0x42')],qs[_0x20d6('0x48')](_0x32c798[_0x20d6('0x44')][_0x20d6('0x48')]));_0x41434b[_0x20d6('0x47')]=_0x41434b[_0x20d6('0x47')][_0x20d6('0x57')]?_0x41434b[_0x20d6('0x47')]:_0x92072b['model'];if(!_0x32c798[_0x20d6('0x44')]['hasOwnProperty'](_0x20d6('0x6a'))){_0x41434b[_0x20d6('0x2c')]=qs['limit'](_0x32c798[_0x20d6('0x44')][_0x20d6('0x2c')]);_0x41434b['offset']=qs[_0x20d6('0x2a')](_0x32c798[_0x20d6('0x44')][_0x20d6('0x2a')]);}_0x41434b[_0x20d6('0x4a')]=qs['sort'](_0x32c798['query']['sort']);_0x41434b[_0x20d6('0x4c')]=qs[_0x20d6('0x45')](_['pick'](_0x32c798[_0x20d6('0x44')],_0x92072b['filters']));_0x41434b[_0x20d6('0x4c')][_0x20d6('0x66')]=_0x29aa0d['id'];if(_0x32c798[_0x20d6('0x44')][_0x20d6('0x50')]){_0x41434b[_0x20d6('0x4c')]=_[_0x20d6('0x4e')](_0x41434b[_0x20d6('0x4c')],{'$or':_[_0x20d6('0x43')](_0x41434b['attributes'],function(_0x2adee4){var _0x18f3c9={};_0x18f3c9[_0x2adee4]={'$like':'%'+_0x32c798['query'][_0x20d6('0x50')]+'%'};return _0x18f3c9;})});}_0x41434b=_['merge']({},_0x41434b,_0x32c798[_0x20d6('0x51')]);return db[_0x20d6('0x67')][_0x20d6('0x2d')]({'where':_0x41434b[_0x20d6('0x4c')]})[_0x20d6('0x1e')](function(_0x4f694c){_0x462bd8[_0x20d6('0x2d')]=_0x4f694c;if(_0x32c798[_0x20d6('0x44')][_0x20d6('0x52')]){_0x41434b[_0x20d6('0x53')]=[{'all':!![]}];}return db[_0x20d6('0x67')][_0x20d6('0x54')](_0x41434b);})[_0x20d6('0x1e')](function(_0x2b98d6){_0x462bd8[_0x20d6('0x55')]=_0x2b98d6;return _0x462bd8;});}})['then'](respondWithFilteredResult(_0x5bedb8,_0x41434b))[_0x20d6('0x27')](handleError(_0x5bedb8,null));};exports[_0x20d6('0x6b')]=function(_0x3aa14a,_0x1eae6f,_0x1718a7){return db[_0x20d6('0x3e')][_0x20d6('0x58')]({'where':{'id':_0x3aa14a['params']['id']}})[_0x20d6('0x1e')](handleEntityNotFound(_0x1eae6f,null))[_0x20d6('0x1e')](function(_0x866d46){if(_0x866d46){return _0x866d46[_0x20d6('0x6b')](_0x3aa14a[_0x20d6('0x44')][_0x20d6('0x6c')]);}})[_0x20d6('0x1e')](respondWithStatusCode(_0x1eae6f,null))[_0x20d6('0x27')](handleError(_0x1eae6f,null));};exports[_0x20d6('0x6d')]=function(_0x9887ae,_0x48b982,_0x2a71b4){if(_0x9887ae[_0x20d6('0x59')]['id']){delete _0x9887ae[_0x20d6('0x59')]['id'];}return db[_0x20d6('0x3e')]['find']({'where':{'id':_0x9887ae[_0x20d6('0x63')]['id']}})[_0x20d6('0x1e')](handleEntityNotFound(_0x48b982,null))['then'](function(_0x318c77){if(_0x318c77){_0x9887ae[_0x20d6('0x59')][_0x20d6('0x66')]=_0x318c77['id'];return db['CannedAnswer'][_0x20d6('0x61')](_0x9887ae[_0x20d6('0x59')]);}})[_0x20d6('0x1e')](respondWithResult(_0x48b982,null))['catch'](handleError(_0x48b982,null));};exports[_0x20d6('0x6e')]=function(_0x40d5a6,_0x369f0a,_0xb83cdd){var _0x15490f={'raw':![],'where':{}};var _0x20c85b={};var _0x169281={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x20d6('0x69')]({'where':{'id':_0x40d5a6[_0x20d6('0x63')]['id']}})['then'](handleEntityNotFound(_0x369f0a,null))[_0x20d6('0x1e')](function(_0x203dcd){if(_0x203dcd){_0x20c85b['model']=_[_0x20d6('0x56')](db['CannedAnswer'][_0x20d6('0x3f')]);_0x20c85b['query']=_[_0x20d6('0x56')](_0x40d5a6[_0x20d6('0x44')]);_0x20c85b['filters']=_[_0x20d6('0x46')](_0x20c85b[_0x20d6('0x42')],_0x20c85b['query']);_0x15490f[_0x20d6('0x47')]=_[_0x20d6('0x46')](_0x20c85b[_0x20d6('0x42')],qs[_0x20d6('0x48')](_0x40d5a6[_0x20d6('0x44')][_0x20d6('0x48')]));_0x15490f[_0x20d6('0x47')]=_0x15490f[_0x20d6('0x47')][_0x20d6('0x57')]?_0x15490f['attributes']:_0x20c85b[_0x20d6('0x42')];if(!_0x40d5a6[_0x20d6('0x44')][_0x20d6('0x49')](_0x20d6('0x6a'))){_0x15490f[_0x20d6('0x2c')]=qs[_0x20d6('0x2c')](_0x40d5a6['query'][_0x20d6('0x2c')]);_0x15490f[_0x20d6('0x2a')]=qs[_0x20d6('0x2a')](_0x40d5a6[_0x20d6('0x44')][_0x20d6('0x2a')]);}_0x15490f[_0x20d6('0x4a')]=qs['sort'](_0x40d5a6[_0x20d6('0x44')][_0x20d6('0x4b')]);_0x15490f[_0x20d6('0x4c')]=qs[_0x20d6('0x45')](_[_0x20d6('0x4d')](_0x40d5a6['query'],_0x20c85b[_0x20d6('0x45')]));_0x15490f[_0x20d6('0x4c')][_0x20d6('0x66')]=_0x203dcd['id'];if(_0x40d5a6[_0x20d6('0x44')][_0x20d6('0x50')]){_0x15490f[_0x20d6('0x4c')]=_[_0x20d6('0x4e')](_0x15490f['where'],{'$or':_[_0x20d6('0x43')](_0x15490f[_0x20d6('0x47')],function(_0x4eb9b3){var _0x882c77={};_0x882c77[_0x4eb9b3]={'$like':'%'+_0x40d5a6['query'][_0x20d6('0x50')]+'%'};return _0x882c77;})});}_0x15490f=_[_0x20d6('0x4e')]({},_0x15490f,_0x40d5a6[_0x20d6('0x51')]);return db[_0x20d6('0x6f')][_0x20d6('0x2d')]({'where':_0x15490f['where']})[_0x20d6('0x1e')](function(_0x1b695f){_0x169281[_0x20d6('0x2d')]=_0x1b695f;if(_0x40d5a6[_0x20d6('0x44')][_0x20d6('0x52')]){_0x15490f['include']=[{'all':!![]}];}return db[_0x20d6('0x6f')][_0x20d6('0x54')](_0x15490f);})[_0x20d6('0x1e')](function(_0x30606f){_0x169281[_0x20d6('0x55')]=_0x30606f;return _0x169281;});}})['then'](respondWithFilteredResult(_0x369f0a,_0x15490f))['catch'](handleError(_0x369f0a,null));};exports[_0x20d6('0x70')]=function(_0x4af47a,_0x3e8b6d,_0x1a455e){return db[_0x20d6('0x3e')][_0x20d6('0x58')]({'where':{'id':_0x4af47a[_0x20d6('0x63')]['id']}})[_0x20d6('0x1e')](handleEntityNotFound(_0x3e8b6d,null))[_0x20d6('0x1e')](function(_0x5526e2){if(_0x5526e2){return _0x5526e2['removeAnswers'](_0x4af47a[_0x20d6('0x44')][_0x20d6('0x6c')]);}})[_0x20d6('0x1e')](respondWithStatusCode(_0x3e8b6d,null))['catch'](handleError(_0x3e8b6d,null));};exports[_0x20d6('0x71')]=function(_0x159229,_0xf8d29a,_0x52b511){return db[_0x20d6('0x3e')][_0x20d6('0x58')]({'where':{'id':_0x159229[_0x20d6('0x63')]['id']}})[_0x20d6('0x1e')](handleEntityNotFound(_0xf8d29a,null))[_0x20d6('0x1e')](function(_0x1299e0){if(_0x1299e0){return _0x1299e0[_0x20d6('0x71')](_0x159229[_0x20d6('0x59')][_0x20d6('0x6c')],_[_0x20d6('0x72')](_0x159229[_0x20d6('0x59')],[_0x20d6('0x6c'),'id'])||{})['spread'](function(_0x3dff48){for(var _0x1f6fb3=0x0;_0x1f6fb3<_0x159229[_0x20d6('0x59')]['ids'][_0x20d6('0x57')];_0x1f6fb3+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x159229['body'][_0x20d6('0x6c')][_0x1f6fb3]),'WhatsappAccountId':Number(_0x159229[_0x20d6('0x63')]['id'])});}return _0x3dff48;});}})[_0x20d6('0x1e')](respondWithResult(_0xf8d29a,null))[_0x20d6('0x27')](handleError(_0xf8d29a,null));};exports['removeAgents']=function(_0x5a123e,_0x4791ea,_0x38a847){return db[_0x20d6('0x3e')][_0x20d6('0x58')]({'where':{'id':_0x5a123e['params']['id']}})[_0x20d6('0x1e')](handleEntityNotFound(_0x4791ea,null))[_0x20d6('0x1e')](function(_0x2590b8){if(_0x2590b8){return _0x2590b8[_0x20d6('0x73')](_0x5a123e[_0x20d6('0x44')][_0x20d6('0x6c')])[_0x20d6('0x1e')](function(){if(_[_0x20d6('0x74')](_0x5a123e[_0x20d6('0x44')]['ids'])){for(var _0x326f50=0x0;_0x326f50<_0x5a123e['query'][_0x20d6('0x6c')][_0x20d6('0x57')];_0x326f50+=0x1){socket[_0x20d6('0x75')](_0x20d6('0x76'),{'UserId':Number(_0x5a123e['query'][_0x20d6('0x6c')][_0x326f50]),'WhatsappAccountId':Number(_0x5a123e[_0x20d6('0x63')]['id'])});}}else{socket[_0x20d6('0x75')](_0x20d6('0x76'),{'UserId':Number(_0x5a123e['query'][_0x20d6('0x6c')]),'WhatsappAccountId':Number(_0x5a123e[_0x20d6('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x4791ea,null))[_0x20d6('0x27')](handleError(_0x4791ea,null));};exports[_0x20d6('0x77')]=function(_0x2bbbf6,_0x4ca915,_0x406876){var _0x186ccf={};var _0x4d8b6c={};var _0x1a39ec;var _0x3653b6;return db[_0x20d6('0x3e')]['findOne']({'where':{'id':_0x2bbbf6[_0x20d6('0x63')]['id']}})[_0x20d6('0x1e')](handleEntityNotFound(_0x4ca915,null))[_0x20d6('0x1e')](function(_0xff85b2){if(_0xff85b2){_0x1a39ec=_0xff85b2;_0x4d8b6c['model']=_['keys'](db[_0x20d6('0x78')]['rawAttributes']);_0x4d8b6c[_0x20d6('0x44')]=_[_0x20d6('0x56')](_0x2bbbf6['query']);_0x4d8b6c['filters']=_[_0x20d6('0x46')](_0x4d8b6c[_0x20d6('0x42')],_0x4d8b6c[_0x20d6('0x44')]);_0x186ccf[_0x20d6('0x47')]=_[_0x20d6('0x46')](_0x4d8b6c[_0x20d6('0x42')],qs[_0x20d6('0x48')](_0x2bbbf6[_0x20d6('0x44')]['fields']));_0x186ccf[_0x20d6('0x47')]=_0x186ccf[_0x20d6('0x47')]['length']?_0x186ccf[_0x20d6('0x47')]:_0x4d8b6c[_0x20d6('0x42')];_0x186ccf[_0x20d6('0x4a')]=qs[_0x20d6('0x4b')](_0x2bbbf6[_0x20d6('0x44')][_0x20d6('0x4b')]);_0x186ccf['where']=qs[_0x20d6('0x45')](_[_0x20d6('0x4d')](_0x2bbbf6[_0x20d6('0x44')],_0x4d8b6c[_0x20d6('0x45')]));if(_0x2bbbf6[_0x20d6('0x44')][_0x20d6('0x50')]){_0x186ccf['where']=_[_0x20d6('0x4e')](_0x186ccf[_0x20d6('0x4c')],{'$or':_['map'](_0x186ccf[_0x20d6('0x47')],function(_0x26de3f){var _0x2524d7={};_0x2524d7[_0x26de3f]={'$like':'%'+_0x2bbbf6['query']['filter']+'%'};return _0x2524d7;})});}_0x186ccf=_[_0x20d6('0x4e')]({},_0x186ccf,_0x2bbbf6[_0x20d6('0x51')]);return _0x1a39ec[_0x20d6('0x77')](_0x186ccf);}})[_0x20d6('0x1e')](function(_0x3cb792){if(_0x3cb792){_0x3653b6=_0x3cb792[_0x20d6('0x57')];if(!_0x2bbbf6['query'][_0x20d6('0x49')]('nolimit')){_0x186ccf['limit']=qs[_0x20d6('0x2c')](_0x2bbbf6[_0x20d6('0x44')][_0x20d6('0x2c')]);_0x186ccf[_0x20d6('0x2a')]=qs['offset'](_0x2bbbf6[_0x20d6('0x44')][_0x20d6('0x2a')]);}return _0x1a39ec['getAgents'](_0x186ccf);}})[_0x20d6('0x1e')](function(_0x420170){if(_0x420170){return _0x420170?{'count':_0x3653b6,'rows':_0x420170}:null;}})[_0x20d6('0x1e')](respondWithResult(_0x4ca915,null))[_0x20d6('0x27')](handleError(_0x4ca915,null));};exports[_0x20d6('0x79')]=function(_0x35e9ed,_0x21efe4){var _0x15e544=_0x35e9ed[_0x20d6('0x63')]['id'];var _0x181e30=_0x35e9ed[_0x20d6('0x59')];var _0x50bd5c=0xc8;var _0x309de3=null;return db[_0x20d6('0x7a')][_0x20d6('0x7b')]({'isolationLevel':db[_0x20d6('0x7a')]['Transaction'][_0x20d6('0x7c')][_0x20d6('0x7d')]},function(_0xcc4920){return db[_0x20d6('0x3e')]['findOne']({'where':{'id':_0x15e544},'transaction':_0xcc4920})[_0x20d6('0x1e')](function(_0x18398a){if(_0x18398a){return db[_0x20d6('0x7e')][_0x20d6('0x34')]({'where':{'WhatsappAccountId':_0x15e544},'transaction':_0xcc4920})[_0x20d6('0x1e')](function(){var _0x1d3b6a=_[_0x20d6('0x43')](_0x181e30,function(_0x41c98f){_0x41c98f[_0x20d6('0x66')]=_0x15e544;return _0x41c98f;});return db['WhatsappApplication'][_0x20d6('0x7f')](_0x1d3b6a,{'transaction':_0xcc4920});});}else{_0x50bd5c=0x194;_0x309de3=[];}});})[_0x20d6('0x1e')](function(){if(_0x50bd5c!==0x194){return db[_0x20d6('0x7e')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x15e544},'order':_0x20d6('0x80')})['then'](function(_0x13cef7){_0x309de3=_0x13cef7;});}})[_0x20d6('0x27')](function(_0x11bace){_0x50bd5c=0x1f4;logger[_0x20d6('0x24')](_0x11bace['stack']);if(_0x11bace['name']){delete _0x11bace[_0x20d6('0x39')];}_0x309de3=_0x11bace;})[_0x20d6('0x81')](function(){if(_0x309de3===null){_0x21efe4[_0x20d6('0x28')](_0x50bd5c);}else{if(_0x50bd5c===0x1f4){_0x21efe4['status'](_0x50bd5c)[_0x20d6('0x3a')](_0x309de3);}else{_0x21efe4[_0x20d6('0x2e')](_0x50bd5c)[_0x20d6('0x29')](_0x309de3);}}});};exports[_0x20d6('0x82')]=function(_0x37863a,_0x187367,_0x865ae8){var _0x2f75d6={};var _0x5376f5={};var _0x6fdc91;var _0x1614a5;return db[_0x20d6('0x3e')][_0x20d6('0x69')]({'where':{'id':_0x37863a[_0x20d6('0x63')]['id']}})[_0x20d6('0x1e')](handleEntityNotFound(_0x187367,null))[_0x20d6('0x1e')](function(_0x56fc4b){if(_0x56fc4b){_0x6fdc91=_0x56fc4b;_0x5376f5[_0x20d6('0x42')]=_[_0x20d6('0x56')](db[_0x20d6('0x7e')][_0x20d6('0x3f')]);_0x5376f5[_0x20d6('0x44')]=_['keys'](_0x37863a['query']);_0x5376f5[_0x20d6('0x45')]=_['intersection'](_0x5376f5['model'],_0x5376f5['query']);_0x2f75d6[_0x20d6('0x47')]=_[_0x20d6('0x46')](_0x5376f5['model'],qs[_0x20d6('0x48')](_0x37863a['query'][_0x20d6('0x48')]));_0x2f75d6[_0x20d6('0x47')]=_0x2f75d6[_0x20d6('0x47')][_0x20d6('0x57')]?_0x2f75d6['attributes']:_0x5376f5[_0x20d6('0x42')];_0x2f75d6['order']=qs[_0x20d6('0x4b')](_0x37863a[_0x20d6('0x44')][_0x20d6('0x4b')]);_0x2f75d6[_0x20d6('0x4c')]=qs[_0x20d6('0x45')](_[_0x20d6('0x4d')](_0x37863a[_0x20d6('0x44')],_0x5376f5[_0x20d6('0x45')]));if(_0x37863a[_0x20d6('0x44')][_0x20d6('0x50')]){_0x2f75d6[_0x20d6('0x4c')]=_[_0x20d6('0x4e')](_0x2f75d6[_0x20d6('0x4c')],{'$or':_[_0x20d6('0x43')](_0x2f75d6['attributes'],function(_0x12e58e){var _0x2404e6={};_0x2404e6[_0x12e58e]={'$like':'%'+_0x37863a[_0x20d6('0x44')][_0x20d6('0x50')]+'%'};return _0x2404e6;})});}_0x2f75d6=_[_0x20d6('0x4e')]({},_0x2f75d6,_0x37863a[_0x20d6('0x51')]);return _0x6fdc91[_0x20d6('0x82')](_0x2f75d6);}})['then'](function(_0x2358e1){if(_0x2358e1){_0x1614a5=_0x2358e1['length'];if(!_0x37863a['query'][_0x20d6('0x49')](_0x20d6('0x6a'))){_0x2f75d6['limit']=qs[_0x20d6('0x2c')](_0x37863a[_0x20d6('0x44')][_0x20d6('0x2c')]);_0x2f75d6[_0x20d6('0x2a')]=qs['offset'](_0x37863a[_0x20d6('0x44')][_0x20d6('0x2a')]);}return _0x6fdc91[_0x20d6('0x82')](_0x2f75d6);}})[_0x20d6('0x1e')](function(_0x37f985){if(_0x37f985){return _0x37f985?{'count':_0x1614a5,'rows':_0x37f985}:null;}})[_0x20d6('0x1e')](respondWithResult(_0x187367,null))[_0x20d6('0x27')](handleError(_0x187367,null));};exports[_0x20d6('0x83')]=function(_0x52b329,_0x38fa5b,_0x25a18c){var _0x23f13c={'channel':_0x20d6('0x84')};var _0x28c491=[];var _0x4f3cad=[];var _0x5d970a={};return db[_0x20d6('0x3e')]['find']({'where':{'id':_0x52b329[_0x20d6('0x63')]['id']},'include':[{'model':db[_0x20d6('0x7e')],'as':_0x20d6('0x85')}]})['then'](handleEntityNotFound(_0x38fa5b,null))[_0x20d6('0x1e')](function(_0x25bbe2){_0x23f13c[_0x20d6('0x86')]=_0x25bbe2;if(_0x23f13c[_0x20d6('0x86')]&&_0x23f13c['account']['type']===_0x20d6('0x87')&&_0x52b329['body'][_0x20d6('0x88')]){if(_0x52b329[_0x20d6('0x59')][_0x20d6('0x88')][_0x20d6('0x57')]===0x0)return;if(_0x52b329[_0x20d6('0x59')]['statuses'][0x0]['state']!=='read')return;return db[_0x20d6('0x89')][_0x20d6('0x33')]({'read':!![],'readAt':_0x52b329[_0x20d6('0x59')][_0x20d6('0x88')][0x0][_0x20d6('0x8a')]},{'where':{'messageId':_0x52b329[_0x20d6('0x59')][_0x20d6('0x88')][0x0][_0x20d6('0x8b')]},'individualHooks':!![]})[_0x20d6('0x1e')](function(_0xadd0ad){return _0x38fa5b['status'](0xc8)[_0x20d6('0x29')](_0xadd0ad);});}_0x23f13c['applications']=_[_0x20d6('0x8c')](_0x25bbe2[_0x20d6('0x85')],[_0x20d6('0x80')],[_0x20d6('0x8d')]);if(_0x23f13c[_0x20d6('0x86')]['Applications']){delete _0x23f13c[_0x20d6('0x86')][_0x20d6('0x85')];}return db['CmContact']['describe']()['then'](function(_0x58ec1c){if(!_0x58ec1c){throw new db[(_0x20d6('0x8e'))][(_0x20d6('0x8f'))](_0x20d6('0x90'));}_0x28c491=_[_0x20d6('0x91')](_[_0x20d6('0x56')](_0x58ec1c),[_0x20d6('0x92'),_0x20d6('0x93')]);_0x4f3cad=_['difference'](_[_0x20d6('0x56')](_0x58ec1c),[_0x20d6('0x92'),_0x20d6('0x93'),_0x20d6('0x94'),_0x20d6('0x95')]);_0x23f13c['body']={'mapKey':_0x20d6('0x96')};if(_0x23f13c[_0x20d6('0x86')]&&_0x23f13c[_0x20d6('0x86')][_0x20d6('0x4f')]===_0x20d6('0x97')){_0x23f13c[_0x20d6('0x59')][_0x20d6('0x98')]=_0x52b329[_0x20d6('0x59')][_0x20d6('0x99')][_0x20d6('0x9a')](_0x20d6('0x9b'),'');_0x23f13c[_0x20d6('0x59')]['body']=_0x52b329['body'][_0x20d6('0x9c')];_0x23f13c[_0x20d6('0x59')][_0x20d6('0x9d')]=_0x52b329[_0x20d6('0x59')]['MessageSid'];}if(_0x23f13c[_0x20d6('0x86')]&&_0x23f13c[_0x20d6('0x86')][_0x20d6('0x4f')]===_0x20d6('0x87')){_0x23f13c[_0x20d6('0x59')][_0x20d6('0x98')]=_0x52b329[_0x20d6('0x59')][_0x20d6('0x9e')][0x0]['from'];_0x23f13c['body']['body']=_0x52b329['body'][_0x20d6('0x9e')][0x0][_0x20d6('0x25')]['body'];_0x23f13c[_0x20d6('0x59')][_0x20d6('0x9d')]=_0x52b329[_0x20d6('0x59')][_0x20d6('0x9e')][0x0][_0x20d6('0x8b')];}if(_0x23f13c[_0x20d6('0x59')]['id']){delete _0x23f13c[_0x20d6('0x59')]['id'];}if(_[_0x20d6('0x9f')](_0x23f13c[_0x20d6('0x59')][_0x20d6('0x98')])){throw new db[(_0x20d6('0x8e'))][(_0x20d6('0x8f'))](_0x20d6('0xa0'));}if(_[_0x20d6('0x9f')](_0x23f13c[_0x20d6('0x59')][_0x20d6('0x59')])||_0x23f13c[_0x20d6('0x59')][_0x20d6('0x59')]===''){throw new db[(_0x20d6('0x8e'))][(_0x20d6('0x8f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x20d6('0x9f')](_0x23f13c[_0x20d6('0x59')][_0x20d6('0xa1')])){throw new db[(_0x20d6('0x8e'))][(_0x20d6('0x8f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4f3cad);}if(!_[_0x20d6('0xa2')](_0x4f3cad,_0x23f13c[_0x20d6('0x59')][_0x20d6('0xa1')])){throw new db['Sequelize'][(_0x20d6('0x8f'))](_0x20d6('0xa3')+_0x4f3cad);}_0x5d970a[_0x23f13c[_0x20d6('0x59')][_0x20d6('0xa1')]]=_0x23f13c[_0x20d6('0x59')][_0x20d6('0x98')];return db[_0x20d6('0xa4')]['find']({'where':{'id':_0x23f13c[_0x20d6('0x86')][_0x20d6('0x95')]},'include':[{'model':db[_0x20d6('0xa5')],'as':_0x20d6('0xa6'),'where':_0x5d970a,'limit':0x1,'order':[['updatedAt',_0x20d6('0xa7')]]}]});})['then'](handleEntityNotFound(_0x38fa5b,null))[_0x20d6('0x1e')](function(_0x399e99){if(_0x399e99){_0x23f13c[_0x20d6('0xa8')]=_[_0x20d6('0x72')](_0x399e99,[_0x20d6('0xa6')]);if(_0x399e99[_0x20d6('0xa6')][_0x20d6('0x57')]){return _0x399e99[_0x20d6('0xa6')][0x0];}var _0x5bd481=_['defaults'](_0x23f13c[_0x20d6('0x59')],{'firstName':_0x23f13c['body']['from'],'ListId':_0x399e99['id']});_0x5bd481[_0x23f13c[_0x20d6('0x59')][_0x20d6('0xa1')]]=_0x23f13c[_0x20d6('0x59')]['from'];return db[_0x20d6('0xa5')][_0x20d6('0x61')](_0x5bd481,{'fields':_0x28c491,'raw':!![]});}})[_0x20d6('0x1e')](handleEntityNotFound(_0x38fa5b,null))[_0x20d6('0x1e')](function(_0x3de016){if(_0x3de016){_0x23f13c[_0x20d6('0xa9')]=_0x3de016;var _0x3e7927={'ContactId':_0x3de016['id'],'phone':_0x23f13c[_0x20d6('0x59')][_0x20d6('0x98')],'WhatsappAccountId':_0x52b329[_0x20d6('0x63')]['id']};var _0x449ac4={'ContactId':_0x3de016['id'],'WhatsappAccountId':_0x52b329[_0x20d6('0x63')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x20d6('0x58')]({'where':_0x449ac4})[_0x20d6('0x1e')](function(_0x30a36e){if(_0x30a36e){return[_0x30a36e,![]];}return db['WhatsappInteraction']['create'](_0x3e7927)['then'](function(_0x3e17ea){return[_0x3e17ea,!![]];});});}})['spread'](function(_0x45491a,_0x54d6b8){_0x23f13c[_0x20d6('0xaa')]=_0x45491a[_0x20d6('0x35')]({'plain':!![]});_0x23f13c['interaction'][_0x20d6('0xab')]=![];if(_0x54d6b8){if(_0x23f13c[_0x20d6('0x86')][_0x20d6('0xac')]){_0x23f13c['applications'][_0x20d6('0xad')]({'id':0x0,'priority':_0x23f13c['applications'][_0x20d6('0x57')]+0x1,'app':_0x20d6('0xae'),'appdata':_0x20d6('0xaf'),'interval':'*,*,*,*'});}_0x23f13c['interaction'][_0x20d6('0xab')]=!![];}return db['WhatsappMessage']['create']({'phone':_0x23f13c[_0x20d6('0x59')][_0x20d6('0x98')],'messageId':_0x23f13c[_0x20d6('0x59')]['messageId'],'body':_0x23f13c[_0x20d6('0x59')][_0x20d6('0x59')],'WhatsappAccountId':_0x52b329[_0x20d6('0x63')]['id'],'WhatsappInteractionId':_0x45491a['id'],'direction':'in','ContactId':_0x45491a[_0x20d6('0xb0')],'AttachmentId':_0x23f13c['body'][_0x20d6('0xb1')]});})[_0x20d6('0x1e')](function(_0x339276){_0x23f13c['message']=_0x339276;if(_0x23f13c['interaction'][_0x20d6('0xb2')]){return db[_0x20d6('0x78')][_0x20d6('0x58')]({'attributes':['id',_0x20d6('0x39')],'where':{'id':_0x23f13c['interaction']['UserId']}})[_0x20d6('0x1e')](function(_0x2e48f1){if(_0x2e48f1){_0x23f13c[_0x20d6('0xb3')][_0x20d6('0xb4')]({'id':0x0,'priority':0x0,'app':_0x20d6('0xb5'),'appdata':_0x2e48f1[_0x20d6('0x39')]+','+(_0x23f13c[_0x20d6('0x86')][_0x20d6('0xb6')]||0xa),'interval':_0x20d6('0xb7')});}return respondWithRpcPromise('Start',_0x20d6('0xb8'),_0x23f13c);});}return respondWithRpcPromise(_0x20d6('0xb9'),_0x20d6('0xb8'),_0x23f13c);})[_0x20d6('0x1e')](function(_0x433614){if(_0x433614){var _0x11d2f4=0xc8;var _0x3d7858=_0x20d6('0xba');logger['info'](_0x20d6('0x22'),_0x3d7858,_0x11d2f4,'entity\x20found');logger[_0x20d6('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3d7858,_0x11d2f4,'entity\x20found',JSON[_0x20d6('0x23')](_0x433614));if(_0x23f13c[_0x20d6('0x86')]['type']==='twilio'){return _0x38fa5b[_0x20d6('0x2e')](_0x11d2f4)[_0x20d6('0x2f')](_0x20d6('0xbb'),_0x20d6('0xbc'))[_0x20d6('0x3a')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x38fa5b['status'](_0x11d2f4)[_0x20d6('0x29')](_0x433614);}}});})[_0x20d6('0x27')](handleError(_0x38fa5b,null));};exports[_0x20d6('0x3a')]=function(_0x5045d4,_0x4e4dcc,_0x4a89f7){var _0x3a1565,_0x47e952,_0x281c98;if(_[_0x20d6('0x9f')](_0x5045d4[_0x20d6('0x59')][_0x20d6('0x59')])||_0x5045d4[_0x20d6('0x59')][_0x20d6('0x59')]===''){throw new db[(_0x20d6('0x8e'))][(_0x20d6('0x8f'))](_0x20d6('0xbd'));}if(_[_0x20d6('0x9f')](_0x5045d4[_0x20d6('0x59')]['to'])){throw new db[(_0x20d6('0x8e'))][(_0x20d6('0x8f'))](_0x20d6('0xbe'));}_0x3a1565=_0x5045d4[_0x20d6('0x59')]['to'];return db[_0x20d6('0x3e')][_0x20d6('0x58')]({'where':{'id':_0x5045d4[_0x20d6('0x63')]['id']},'include':[{'model':db[_0x20d6('0xa4')],'as':_0x20d6('0xbf'),'include':[{'model':db[_0x20d6('0xa5')],'as':_0x20d6('0xa6'),'where':{'mobile':_0x3a1565},'limit':0x1,'order':[['updatedAt',_0x20d6('0xa7')]]}]}]})['then'](handleEntityNotFound(_0x4e4dcc,null))[_0x20d6('0x1e')](function(_0x163f54){if(_0x163f54&&_0x163f54['List']){_0x47e952=_0x163f54[_0x20d6('0x35')]({'plain':!![]});if(_0x47e952[_0x20d6('0xbf')]&&_0x47e952[_0x20d6('0xbf')]['Contacts']['length']){return _0x47e952[_0x20d6('0xbf')][_0x20d6('0xa6')][0x0];}return db['CmContact']['create'](_[_0x20d6('0xc0')](_0x5045d4['body'],{'firstName':_0x3a1565,'mobile':_0x3a1565,'phone':_0x3a1565,'ListId':_0x47e952[_0x20d6('0x95')]}));}})[_0x20d6('0x1e')](handleEntityNotFound(_0x4e4dcc,null))[_0x20d6('0x1e')](function(_0x3ad23f){if(_0x3ad23f){_0x281c98=_0x3ad23f;return db['WhatsappInteraction'][_0x20d6('0x58')]({'where':{'ContactId':_0x281c98['id'],'closed':![],'WhatsappAccountId':_0x47e952['id']}})[_0x20d6('0x1e')](function(_0xc5077){if(_0xc5077){return[_0xc5077,![]];}return db[_0x20d6('0xc1')][_0x20d6('0x61')]({'UserId':_0x5045d4['user']['id'],'ContactId':_0x281c98['id'],'WhatsappAccountId':_0x47e952['id'],'phone':_0x3a1565,'firstMsgDirection':_0x20d6('0xc2'),'Messages':[_[_0x20d6('0x4e')](_0x5045d4[_0x20d6('0x59')],{'read':![],'body':_0x5045d4[_0x20d6('0x59')][_0x20d6('0x59')],'phone':_0x3a1565,'WhatsappAccountId':_0x47e952['id'],'UserId':_0x5045d4[_0x20d6('0x5c')]['id'],'ContactId':_0x281c98['id']})]},{'include':[{'model':db[_0x20d6('0x89')],'as':_0x20d6('0xc3')}]})['then'](function(_0xeeefc6){return[_0xeeefc6,!![]];});});}})['spread'](function(_0x24c325,_0x490bf4){if(_0x490bf4){return _0x24c325;}return db['WhatsappMessage'][_0x20d6('0x61')](_[_0x20d6('0x4e')](_0x5045d4[_0x20d6('0x59')],{'read':![],'body':_0x5045d4[_0x20d6('0x59')][_0x20d6('0x59')],'phone':_0x3a1565,'WhatsappAccountId':_0x47e952['id'],'WhatsappInteractionId':_0x24c325['id'],'UserId':_0x5045d4['user']['id'],'ContactId':_0x281c98['id']}))['then'](function(_0x76dc8){_0x24c325[_0x20d6('0xc4')][_0x20d6('0xc3')]=[];_0x24c325[_0x20d6('0xc4')][_0x20d6('0xc3')][_0x20d6('0xad')](_0x76dc8[_0x20d6('0xc4')]);return _0x24c325;});})['then'](respondWithResult(_0x4e4dcc,null))['catch'](handleError(_0x4e4dcc,null));};
\ No newline at end of file
+var _0xd682=['state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','DESC','list','Contacts','contact','WhatsappInteraction','interaction','created','push','unmanaged','ContactId','AttachmentId','unshift','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','set','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','CmList','List','Messages','dataValues','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','request','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','save','update','destroy','WhatsappAccounts','then','name','index','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','keys','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','findOne','User','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','send','getApplications','notify','whatsapp','Applications','account','sinch','statuses'];(function(_0x5968d3,_0x424ea3){var _0x3d7649=function(_0x34494d){while(--_0x34494d){_0x5968d3['push'](_0x5968d3['shift']());}};_0x3d7649(++_0x424ea3);}(_0xd682,0x100));var _0x2d68=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xd682[_0x54d4a8];return _0x3b321b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2d68('0x0'));var jsonpatch=require(_0x2d68('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2d68('0x2'));var Mustache=require(_0x2d68('0x3'));var util=require(_0x2d68('0x4'));var path=require(_0x2d68('0x5'));var sox=require(_0x2d68('0x6'));var csv=require(_0x2d68('0x7'));var ejs=require(_0x2d68('0x8'));var fs=require('fs');var fs_extra=require(_0x2d68('0x9'));var _=require('lodash');var squel=require(_0x2d68('0xa'));var crypto=require(_0x2d68('0xb'));var jsforce=require(_0x2d68('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2d68('0xd'));var Papa=require('papaparse');var Redis=require(_0x2d68('0xe'));var authService=require(_0x2d68('0xf'));var qs=require(_0x2d68('0x10'));var as=require(_0x2d68('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d68('0x12'))('api');var utils=require(_0x2d68('0x13'));var config=require(_0x2d68('0x14'));var licenseUtil=require(_0x2d68('0x15'));var db=require(_0x2d68('0x16'))['db'];config['redis']=_[_0x2d68('0x17')](config[_0x2d68('0x18')],{'host':_0x2d68('0x19'),'port':0x18eb});var socket=require(_0x2d68('0x1a'))(new Redis(config[_0x2d68('0x18')]));require(_0x2d68('0x1b'))[_0x2d68('0x1c')](socket);var jayson=require(_0x2d68('0x1d'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x2c90b4,_0x3b7f17,_0x2d9a18,_0x36ba34){return new BPromise(function(_0x3594d9,_0x21801f){var _0x101e24=_0x36ba34||client;return _0x101e24[_0x2d68('0x1e')](_0x2c90b4,_0x2d9a18)['then'](function(_0x4e5deb){logger[_0x2d68('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x3b7f17,_0x2d68('0x20'));logger[_0x2d68('0x21')](_0x2d68('0x22'),_0x3b7f17,'request\x20sent',JSON[_0x2d68('0x23')](_0x4e5deb));if(_0x4e5deb['error']){if(_0x4e5deb[_0x2d68('0x24')][_0x2d68('0x25')]===0x1f4){logger[_0x2d68('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x3b7f17,_0x4e5deb[_0x2d68('0x24')]['message']);return _0x21801f(_0x4e5deb['error'][_0x2d68('0x26')]);}logger[_0x2d68('0x24')](_0x2d68('0x27'),_0x3b7f17,_0x4e5deb[_0x2d68('0x24')][_0x2d68('0x26')]);return _0x3594d9(_0x4e5deb[_0x2d68('0x24')][_0x2d68('0x26')]);}else{logger[_0x2d68('0x1f')](_0x2d68('0x27'),_0x3b7f17,_0x2d68('0x20'));_0x3594d9(_0x4e5deb[_0x2d68('0x28')][_0x2d68('0x26')]);}})[_0x2d68('0x29')](function(_0x206aec){logger['error'](_0x2d68('0x27'),_0x3b7f17,_0x206aec);_0x21801f(_0x206aec);});});}function respondWithStatusCode(_0x21c2f2,_0x2f287e){_0x2f287e=_0x2f287e||0xcc;return function(_0x2dd933){if(_0x2dd933){return _0x21c2f2[_0x2d68('0x2a')](_0x2f287e);}return _0x21c2f2['status'](_0x2f287e)[_0x2d68('0x2b')]();};}function respondWithResult(_0x4d9ede,_0xc85187){_0xc85187=_0xc85187||0xc8;return function(_0x21a078){if(_0x21a078){return _0x4d9ede['status'](_0xc85187)[_0x2d68('0x2c')](_0x21a078);}};}function respondWithFilteredResult(_0x14a670,_0x5a74b4){return function(_0x91e4dc){if(_0x91e4dc){var _0x40d42a=typeof _0x5a74b4[_0x2d68('0x2d')]===_0x2d68('0x2e')&&typeof _0x5a74b4['limit']===_0x2d68('0x2e');var _0x1b3e6d=_0x91e4dc[_0x2d68('0x2f')];var _0x3185c4=_0x40d42a?0x0:_0x5a74b4[_0x2d68('0x2d')];var _0x369f55=_0x40d42a?_0x91e4dc['count']:_0x5a74b4[_0x2d68('0x2d')]+_0x5a74b4[_0x2d68('0x30')];var _0x498bec;if(_0x369f55>=_0x1b3e6d){_0x369f55=_0x1b3e6d;_0x498bec=0xc8;}else{_0x498bec=0xce;}_0x14a670[_0x2d68('0x31')](_0x498bec);return _0x14a670['set'](_0x2d68('0x32'),_0x3185c4+'-'+_0x369f55+'/'+_0x1b3e6d)[_0x2d68('0x2c')](_0x91e4dc);}return null;};}function patchUpdates(_0x1df2db){return function(_0x3b0cb4){try{jsonpatch[_0x2d68('0x33')](_0x3b0cb4,_0x1df2db,!![]);}catch(_0x4043f3){return BPromise['reject'](_0x4043f3);}return _0x3b0cb4[_0x2d68('0x34')]();};}function saveUpdates(_0x226974,_0x87e04b){return function(_0x2620e1){if(_0x2620e1){return _0x2620e1[_0x2d68('0x35')](_0x226974)['then'](function(_0x24fbd2){return _0x24fbd2;});}return null;};}function removeEntity(_0x123aa8,_0x12b834){return function(_0x3c8736){if(_0x3c8736){return _0x3c8736[_0x2d68('0x36')]()['then'](function(){var _0x7202de=_0x3c8736['get']({'plain':!![]});var _0x4933bd=_0x2d68('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x4933bd,'resourceId':_0x7202de['id']}})[_0x2d68('0x38')](function(){return _0x3c8736;});})[_0x2d68('0x38')](function(){_0x123aa8[_0x2d68('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28e0fb,_0x38f378){return function(_0x568afa){if(!_0x568afa){_0x28e0fb[_0x2d68('0x2a')](0x194);}return _0x568afa;};}function handleError(_0xaee0,_0x42d2da){_0x42d2da=_0x42d2da||0x1f4;return function(_0x444f64){logger[_0x2d68('0x24')](_0x444f64['stack']);if(_0x444f64[_0x2d68('0x39')]){delete _0x444f64[_0x2d68('0x39')];}_0xaee0[_0x2d68('0x31')](_0x42d2da)['send'](_0x444f64);};}exports[_0x2d68('0x3a')]=function(_0x624c43,_0x5bc3e8){var _0x37da4b={'include':[{'model':db[_0x2d68('0x3b')],'as':_0x2d68('0x3c')}]},_0x16cfc7={},_0x571218={'count':0x0,'rows':[]};var _0x1ef0e8=_['map'](db[_0x2d68('0x3d')][_0x2d68('0x3e')],function(_0x398cd3){return{'name':_0x398cd3[_0x2d68('0x3f')],'type':_0x398cd3[_0x2d68('0x40')][_0x2d68('0x41')]};});_0x16cfc7[_0x2d68('0x42')]=_[_0x2d68('0x43')](_0x1ef0e8,_0x2d68('0x39'));_0x16cfc7[_0x2d68('0x44')]=_['keys'](_0x624c43[_0x2d68('0x44')]);_0x16cfc7[_0x2d68('0x45')]=_[_0x2d68('0x46')](_0x16cfc7[_0x2d68('0x42')],_0x16cfc7[_0x2d68('0x44')]);_0x37da4b[_0x2d68('0x47')]=_['intersection'](_0x16cfc7[_0x2d68('0x42')],qs[_0x2d68('0x48')](_0x624c43['query'][_0x2d68('0x48')]));_0x37da4b[_0x2d68('0x47')]=_0x37da4b[_0x2d68('0x47')][_0x2d68('0x49')]?_0x37da4b[_0x2d68('0x47')]:_0x16cfc7['model'];if(!_0x624c43[_0x2d68('0x44')][_0x2d68('0x4a')](_0x2d68('0x4b'))){_0x37da4b[_0x2d68('0x30')]=qs[_0x2d68('0x30')](_0x624c43['query'][_0x2d68('0x30')]);_0x37da4b['offset']=qs[_0x2d68('0x2d')](_0x624c43[_0x2d68('0x44')]['offset']);}_0x37da4b[_0x2d68('0x4c')]=qs['sort'](_0x624c43['query'][_0x2d68('0x4d')]);_0x37da4b[_0x2d68('0x4e')]=qs['filters'](_[_0x2d68('0x4f')](_0x624c43[_0x2d68('0x44')],_0x16cfc7['filters']),_0x1ef0e8);if(_0x624c43[_0x2d68('0x44')][_0x2d68('0x50')]){_0x37da4b[_0x2d68('0x4e')]=_[_0x2d68('0x51')](_0x37da4b[_0x2d68('0x4e')],{'$or':_[_0x2d68('0x43')](_0x1ef0e8,function(_0x2a0d60){if(_0x2a0d60[_0x2d68('0x40')]!=='VIRTUAL'){var _0x48b35b={};_0x48b35b[_0x2a0d60[_0x2d68('0x39')]]={'$like':'%'+_0x624c43[_0x2d68('0x44')][_0x2d68('0x50')]+'%'};return _0x48b35b;}})});}_0x37da4b=_[_0x2d68('0x51')]({},_0x37da4b,_0x624c43[_0x2d68('0x52')]);var _0xca7182={'where':_0x37da4b['where']};return db['WhatsappAccount'][_0x2d68('0x2f')](_0xca7182)[_0x2d68('0x38')](function(_0x10bd44){_0x571218[_0x2d68('0x2f')]=_0x10bd44;if(_0x624c43[_0x2d68('0x44')][_0x2d68('0x53')]){_0x37da4b[_0x2d68('0x54')]=[{'all':!![]}];}return db[_0x2d68('0x3d')]['findAll'](_0x37da4b);})['then'](function(_0x134756){_0x571218[_0x2d68('0x55')]=_0x134756;return _0x571218;})['then'](respondWithFilteredResult(_0x5bc3e8,_0x37da4b))[_0x2d68('0x29')](handleError(_0x5bc3e8,null));};exports['show']=function(_0x223833,_0x3f7546){var _0x56ae65={'raw':![],'where':{'id':_0x223833[_0x2d68('0x56')]['id']},'include':[{'model':db[_0x2d68('0x3b')],'as':_0x2d68('0x3c')}]},_0x3195e8={};_0x3195e8['model']=_['keys'](db[_0x2d68('0x3d')][_0x2d68('0x3e')]);_0x3195e8[_0x2d68('0x44')]=_['keys'](_0x223833[_0x2d68('0x44')]);_0x3195e8[_0x2d68('0x45')]=_[_0x2d68('0x46')](_0x3195e8['model'],_0x3195e8['query']);_0x56ae65[_0x2d68('0x47')]=_[_0x2d68('0x46')](_0x3195e8[_0x2d68('0x42')],qs[_0x2d68('0x48')](_0x223833['query'][_0x2d68('0x48')]));_0x56ae65[_0x2d68('0x47')]=_0x56ae65['attributes'][_0x2d68('0x49')]?_0x56ae65[_0x2d68('0x47')]:_0x3195e8['model'];if(_0x223833['query'][_0x2d68('0x53')]){_0x56ae65[_0x2d68('0x54')]=[{'all':!![]}];}_0x56ae65=_[_0x2d68('0x51')]({},_0x56ae65,_0x223833[_0x2d68('0x52')]);return db['WhatsappAccount'][_0x2d68('0x57')](_0x56ae65)[_0x2d68('0x38')](handleEntityNotFound(_0x3f7546,null))[_0x2d68('0x38')](respondWithResult(_0x3f7546,null))['catch'](handleError(_0x3f7546,null));};exports[_0x2d68('0x58')]=function(_0x4e62f3,_0x1bce1f){return db[_0x2d68('0x3d')]['create'](_0x4e62f3[_0x2d68('0x59')],{})['then'](function(_0x1967ff){var _0x521da4=_0x4e62f3[_0x2d68('0x5a')][_0x2d68('0x5b')]({'plain':!![]});if(!_0x521da4)throw new Error(_0x2d68('0x5c'));if(_0x521da4[_0x2d68('0x5d')]===_0x2d68('0x5a')){var _0x300df7=_0x1967ff[_0x2d68('0x5b')]({'plain':!![]});var _0x3260fd=_0x2d68('0x37');return db[_0x2d68('0x5e')][_0x2d68('0x57')]({'where':{'name':_0x3260fd,'userProfileId':_0x521da4[_0x2d68('0x5f')]},'raw':!![]})[_0x2d68('0x38')](function(_0x2c6534){if(_0x2c6534&&_0x2c6534[_0x2d68('0x60')]===0x0){return db[_0x2d68('0x61')]['create']({'name':_0x300df7[_0x2d68('0x39')],'resourceId':_0x300df7['id'],'type':_0x2c6534[_0x2d68('0x39')],'sectionId':_0x2c6534['id']},{})[_0x2d68('0x38')](function(){return _0x1967ff;});}else{return _0x1967ff;}})[_0x2d68('0x29')](function(_0x41a448){logger['error'](_0x2d68('0x62'),_0x41a448);throw _0x41a448;});}return _0x1967ff;})[_0x2d68('0x38')](respondWithResult(_0x1bce1f,0xc9))['catch'](handleError(_0x1bce1f,null));};exports[_0x2d68('0x35')]=function(_0x11e3f2,_0x4d364b){if(_0x11e3f2[_0x2d68('0x59')]['id']){delete _0x11e3f2[_0x2d68('0x59')]['id'];}return db[_0x2d68('0x3d')]['find']({'where':{'id':_0x11e3f2['params']['id']},'include':[{'model':db['Pause'],'as':_0x2d68('0x3c')}]})[_0x2d68('0x38')](handleEntityNotFound(_0x4d364b,null))['then'](saveUpdates(_0x11e3f2[_0x2d68('0x59')],null))[_0x2d68('0x38')](respondWithResult(_0x4d364b,null))['catch'](handleError(_0x4d364b,null));};exports['destroy']=function(_0xb92fa4,_0x5c2fdc){return db[_0x2d68('0x3d')][_0x2d68('0x57')]({'where':{'id':_0xb92fa4[_0x2d68('0x56')]['id']}})[_0x2d68('0x38')](handleEntityNotFound(_0x5c2fdc,null))[_0x2d68('0x38')](removeEntity(_0x5c2fdc,null))[_0x2d68('0x29')](handleError(_0x5c2fdc,null));};exports['describe']=function(_0x2b4013,_0xfe95c6){return db['WhatsappAccount'][_0x2d68('0x63')]()[_0x2d68('0x38')](respondWithResult(_0xfe95c6,null))['catch'](handleError(_0xfe95c6,null));};exports[_0x2d68('0x64')]=function(_0x4c4e37,_0x27c8d6,_0x412110){if(_0x4c4e37[_0x2d68('0x59')]['id']){delete _0x4c4e37[_0x2d68('0x59')]['id'];}return db[_0x2d68('0x3d')][_0x2d68('0x57')]({'where':{'id':_0x4c4e37[_0x2d68('0x56')]['id']}})[_0x2d68('0x38')](handleEntityNotFound(_0x27c8d6,null))[_0x2d68('0x38')](function(_0x47e4c5){if(_0x47e4c5){_0x4c4e37['body'][_0x2d68('0x65')]=_0x47e4c5['id'];return db[_0x2d68('0x66')][_0x2d68('0x58')](_0x4c4e37[_0x2d68('0x59')]);}})['then'](respondWithResult(_0x27c8d6,null))[_0x2d68('0x29')](handleError(_0x27c8d6,null));};exports[_0x2d68('0x67')]=function(_0x15a70b,_0xa46dc5,_0x38a948){var _0x1fa1e8={'raw':![],'where':{}};var _0x1618ee={};var _0x90e132={'count':0x0,'rows':[]};return db[_0x2d68('0x3d')]['findOne']({'where':{'id':_0x15a70b[_0x2d68('0x56')]['id']}})[_0x2d68('0x38')](handleEntityNotFound(_0xa46dc5,null))[_0x2d68('0x38')](function(_0x40ca6b){if(_0x40ca6b){_0x1618ee[_0x2d68('0x42')]=_[_0x2d68('0x68')](db['Disposition']['rawAttributes']);_0x1618ee[_0x2d68('0x44')]=_['keys'](_0x15a70b[_0x2d68('0x44')]);_0x1618ee[_0x2d68('0x45')]=_[_0x2d68('0x46')](_0x1618ee[_0x2d68('0x42')],_0x1618ee[_0x2d68('0x44')]);_0x1fa1e8[_0x2d68('0x47')]=_['intersection'](_0x1618ee[_0x2d68('0x42')],qs[_0x2d68('0x48')](_0x15a70b[_0x2d68('0x44')]['fields']));_0x1fa1e8[_0x2d68('0x47')]=_0x1fa1e8[_0x2d68('0x47')][_0x2d68('0x49')]?_0x1fa1e8['attributes']:_0x1618ee[_0x2d68('0x42')];if(!_0x15a70b[_0x2d68('0x44')][_0x2d68('0x4a')](_0x2d68('0x4b'))){_0x1fa1e8[_0x2d68('0x30')]=qs[_0x2d68('0x30')](_0x15a70b[_0x2d68('0x44')][_0x2d68('0x30')]);_0x1fa1e8[_0x2d68('0x2d')]=qs[_0x2d68('0x2d')](_0x15a70b[_0x2d68('0x44')][_0x2d68('0x2d')]);}_0x1fa1e8['order']=qs[_0x2d68('0x4d')](_0x15a70b['query'][_0x2d68('0x4d')]);_0x1fa1e8[_0x2d68('0x4e')]=qs[_0x2d68('0x45')](_[_0x2d68('0x4f')](_0x15a70b[_0x2d68('0x44')],_0x1618ee[_0x2d68('0x45')]));_0x1fa1e8[_0x2d68('0x4e')]['WhatsappAccountId']=_0x40ca6b['id'];if(_0x15a70b[_0x2d68('0x44')][_0x2d68('0x50')]){_0x1fa1e8[_0x2d68('0x4e')]=_[_0x2d68('0x51')](_0x1fa1e8[_0x2d68('0x4e')],{'$or':_[_0x2d68('0x43')](_0x1fa1e8[_0x2d68('0x47')],function(_0xa1e8b3){var _0x477b21={};_0x477b21[_0xa1e8b3]={'$like':'%'+_0x15a70b[_0x2d68('0x44')][_0x2d68('0x50')]+'%'};return _0x477b21;})});}_0x1fa1e8=_[_0x2d68('0x51')]({},_0x1fa1e8,_0x15a70b['options']);return db[_0x2d68('0x66')]['count']({'where':_0x1fa1e8[_0x2d68('0x4e')]})[_0x2d68('0x38')](function(_0x396753){_0x90e132['count']=_0x396753;if(_0x15a70b[_0x2d68('0x44')][_0x2d68('0x53')]){_0x1fa1e8[_0x2d68('0x54')]=[{'all':!![]}];}return db[_0x2d68('0x66')][_0x2d68('0x69')](_0x1fa1e8);})[_0x2d68('0x38')](function(_0x46d0c6){_0x90e132[_0x2d68('0x55')]=_0x46d0c6;return _0x90e132;});}})[_0x2d68('0x38')](respondWithFilteredResult(_0xa46dc5,_0x1fa1e8))[_0x2d68('0x29')](handleError(_0xa46dc5,null));};exports['removeDispositions']=function(_0x29bb37,_0x33ddb1,_0x552333){return db['WhatsappAccount'][_0x2d68('0x57')]({'where':{'id':_0x29bb37[_0x2d68('0x56')]['id']}})[_0x2d68('0x38')](handleEntityNotFound(_0x33ddb1,null))[_0x2d68('0x38')](function(_0x2725b8){if(_0x2725b8){return _0x2725b8[_0x2d68('0x6a')](_0x29bb37['query'][_0x2d68('0x6b')]);}})[_0x2d68('0x38')](respondWithStatusCode(_0x33ddb1,null))[_0x2d68('0x29')](handleError(_0x33ddb1,null));};exports[_0x2d68('0x6c')]=function(_0x5ce3af,_0x15c005,_0x582098){if(_0x5ce3af['body']['id']){delete _0x5ce3af[_0x2d68('0x59')]['id'];}return db[_0x2d68('0x3d')][_0x2d68('0x57')]({'where':{'id':_0x5ce3af[_0x2d68('0x56')]['id']}})[_0x2d68('0x38')](handleEntityNotFound(_0x15c005,null))[_0x2d68('0x38')](function(_0x2e2998){if(_0x2e2998){_0x5ce3af[_0x2d68('0x59')][_0x2d68('0x65')]=_0x2e2998['id'];return db[_0x2d68('0x6d')]['create'](_0x5ce3af[_0x2d68('0x59')]);}})[_0x2d68('0x38')](respondWithResult(_0x15c005,null))[_0x2d68('0x29')](handleError(_0x15c005,null));};exports['getAnswers']=function(_0x516000,_0x30f6d6,_0xde53cf){var _0x8e9fbc={'raw':![],'where':{}};var _0x16d655={};var _0x43d3e1={'count':0x0,'rows':[]};return db[_0x2d68('0x3d')]['findOne']({'where':{'id':_0x516000[_0x2d68('0x56')]['id']}})[_0x2d68('0x38')](handleEntityNotFound(_0x30f6d6,null))[_0x2d68('0x38')](function(_0x29382d){if(_0x29382d){_0x16d655[_0x2d68('0x42')]=_[_0x2d68('0x68')](db[_0x2d68('0x6d')][_0x2d68('0x3e')]);_0x16d655[_0x2d68('0x44')]=_[_0x2d68('0x68')](_0x516000['query']);_0x16d655[_0x2d68('0x45')]=_[_0x2d68('0x46')](_0x16d655[_0x2d68('0x42')],_0x16d655[_0x2d68('0x44')]);_0x8e9fbc[_0x2d68('0x47')]=_[_0x2d68('0x46')](_0x16d655['model'],qs[_0x2d68('0x48')](_0x516000[_0x2d68('0x44')]['fields']));_0x8e9fbc[_0x2d68('0x47')]=_0x8e9fbc[_0x2d68('0x47')][_0x2d68('0x49')]?_0x8e9fbc[_0x2d68('0x47')]:_0x16d655['model'];if(!_0x516000[_0x2d68('0x44')][_0x2d68('0x4a')]('nolimit')){_0x8e9fbc[_0x2d68('0x30')]=qs[_0x2d68('0x30')](_0x516000[_0x2d68('0x44')][_0x2d68('0x30')]);_0x8e9fbc['offset']=qs['offset'](_0x516000[_0x2d68('0x44')][_0x2d68('0x2d')]);}_0x8e9fbc[_0x2d68('0x4c')]=qs[_0x2d68('0x4d')](_0x516000['query'][_0x2d68('0x4d')]);_0x8e9fbc[_0x2d68('0x4e')]=qs[_0x2d68('0x45')](_[_0x2d68('0x4f')](_0x516000[_0x2d68('0x44')],_0x16d655[_0x2d68('0x45')]));_0x8e9fbc[_0x2d68('0x4e')][_0x2d68('0x65')]=_0x29382d['id'];if(_0x516000[_0x2d68('0x44')][_0x2d68('0x50')]){_0x8e9fbc[_0x2d68('0x4e')]=_[_0x2d68('0x51')](_0x8e9fbc[_0x2d68('0x4e')],{'$or':_[_0x2d68('0x43')](_0x8e9fbc[_0x2d68('0x47')],function(_0x34714e){var _0x4ab20d={};_0x4ab20d[_0x34714e]={'$like':'%'+_0x516000['query'][_0x2d68('0x50')]+'%'};return _0x4ab20d;})});}_0x8e9fbc=_['merge']({},_0x8e9fbc,_0x516000[_0x2d68('0x52')]);return db['CannedAnswer'][_0x2d68('0x2f')]({'where':_0x8e9fbc['where']})[_0x2d68('0x38')](function(_0x1d94b7){_0x43d3e1[_0x2d68('0x2f')]=_0x1d94b7;if(_0x516000[_0x2d68('0x44')][_0x2d68('0x53')]){_0x8e9fbc[_0x2d68('0x54')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x8e9fbc);})['then'](function(_0x382fc1){_0x43d3e1['rows']=_0x382fc1;return _0x43d3e1;});}})[_0x2d68('0x38')](respondWithFilteredResult(_0x30f6d6,_0x8e9fbc))['catch'](handleError(_0x30f6d6,null));};exports[_0x2d68('0x6e')]=function(_0x42e09b,_0x281282,_0x38e974){return db[_0x2d68('0x3d')][_0x2d68('0x57')]({'where':{'id':_0x42e09b['params']['id']}})['then'](handleEntityNotFound(_0x281282,null))[_0x2d68('0x38')](function(_0xce2f30){if(_0xce2f30){return _0xce2f30[_0x2d68('0x6e')](_0x42e09b[_0x2d68('0x44')]['ids']);}})[_0x2d68('0x38')](respondWithStatusCode(_0x281282,null))['catch'](handleError(_0x281282,null));};exports[_0x2d68('0x6f')]=function(_0x3fac8c,_0x138848,_0x22f03b){return db[_0x2d68('0x3d')][_0x2d68('0x57')]({'where':{'id':_0x3fac8c[_0x2d68('0x56')]['id']}})[_0x2d68('0x38')](handleEntityNotFound(_0x138848,null))[_0x2d68('0x38')](function(_0xe0aff){if(_0xe0aff){return _0xe0aff['addAgents'](_0x3fac8c[_0x2d68('0x59')][_0x2d68('0x6b')],_[_0x2d68('0x70')](_0x3fac8c['body'],[_0x2d68('0x6b'),'id'])||{})[_0x2d68('0x71')](function(_0x1a6e5a){for(var _0x11377b=0x0;_0x11377b<_0x3fac8c[_0x2d68('0x59')][_0x2d68('0x6b')]['length'];_0x11377b+=0x1){socket[_0x2d68('0x72')](_0x2d68('0x73'),{'UserId':Number(_0x3fac8c[_0x2d68('0x59')]['ids'][_0x11377b]),'WhatsappAccountId':Number(_0x3fac8c[_0x2d68('0x56')]['id'])});}return _0x1a6e5a;});}})['then'](respondWithResult(_0x138848,null))['catch'](handleError(_0x138848,null));};exports[_0x2d68('0x74')]=function(_0x5327fb,_0x379c8c,_0x5bbab1){return db[_0x2d68('0x3d')][_0x2d68('0x57')]({'where':{'id':_0x5327fb[_0x2d68('0x56')]['id']}})[_0x2d68('0x38')](handleEntityNotFound(_0x379c8c,null))[_0x2d68('0x38')](function(_0xaff184){if(_0xaff184){return _0xaff184[_0x2d68('0x74')](_0x5327fb[_0x2d68('0x44')][_0x2d68('0x6b')])[_0x2d68('0x38')](function(){if(_['isArray'](_0x5327fb[_0x2d68('0x44')]['ids'])){for(var _0x14b8a1=0x0;_0x14b8a1<_0x5327fb['query']['ids'][_0x2d68('0x49')];_0x14b8a1+=0x1){socket[_0x2d68('0x72')](_0x2d68('0x75'),{'UserId':Number(_0x5327fb[_0x2d68('0x44')][_0x2d68('0x6b')][_0x14b8a1]),'WhatsappAccountId':Number(_0x5327fb[_0x2d68('0x56')]['id'])});}}else{socket[_0x2d68('0x72')](_0x2d68('0x75'),{'UserId':Number(_0x5327fb[_0x2d68('0x44')][_0x2d68('0x6b')]),'WhatsappAccountId':Number(_0x5327fb[_0x2d68('0x56')]['id'])});}});}})[_0x2d68('0x38')](respondWithStatusCode(_0x379c8c,null))[_0x2d68('0x29')](handleError(_0x379c8c,null));};exports[_0x2d68('0x76')]=function(_0x3ebedc,_0x4484d1,_0x3f3a4a){var _0x9c91b2={};var _0x5862b1={};var _0x1e68bf;var _0x188b40;return db['WhatsappAccount'][_0x2d68('0x77')]({'where':{'id':_0x3ebedc['params']['id']}})[_0x2d68('0x38')](handleEntityNotFound(_0x4484d1,null))[_0x2d68('0x38')](function(_0x32d3d5){if(_0x32d3d5){_0x1e68bf=_0x32d3d5;_0x5862b1[_0x2d68('0x42')]=_['keys'](db[_0x2d68('0x78')]['rawAttributes']);_0x5862b1[_0x2d68('0x44')]=_['keys'](_0x3ebedc[_0x2d68('0x44')]);_0x5862b1[_0x2d68('0x45')]=_['intersection'](_0x5862b1[_0x2d68('0x42')],_0x5862b1[_0x2d68('0x44')]);_0x9c91b2[_0x2d68('0x47')]=_[_0x2d68('0x46')](_0x5862b1[_0x2d68('0x42')],qs[_0x2d68('0x48')](_0x3ebedc[_0x2d68('0x44')][_0x2d68('0x48')]));_0x9c91b2[_0x2d68('0x47')]=_0x9c91b2[_0x2d68('0x47')][_0x2d68('0x49')]?_0x9c91b2[_0x2d68('0x47')]:_0x5862b1[_0x2d68('0x42')];_0x9c91b2[_0x2d68('0x4c')]=qs['sort'](_0x3ebedc[_0x2d68('0x44')][_0x2d68('0x4d')]);_0x9c91b2['where']=qs[_0x2d68('0x45')](_[_0x2d68('0x4f')](_0x3ebedc[_0x2d68('0x44')],_0x5862b1[_0x2d68('0x45')]));if(_0x3ebedc[_0x2d68('0x44')]['filter']){_0x9c91b2[_0x2d68('0x4e')]=_[_0x2d68('0x51')](_0x9c91b2[_0x2d68('0x4e')],{'$or':_['map'](_0x9c91b2[_0x2d68('0x47')],function(_0x10a881){var _0x3a4d09={};_0x3a4d09[_0x10a881]={'$like':'%'+_0x3ebedc[_0x2d68('0x44')]['filter']+'%'};return _0x3a4d09;})});}_0x9c91b2=_['merge']({},_0x9c91b2,_0x3ebedc[_0x2d68('0x52')]);return _0x1e68bf[_0x2d68('0x76')](_0x9c91b2);}})[_0x2d68('0x38')](function(_0x5ddaa1){if(_0x5ddaa1){_0x188b40=_0x5ddaa1[_0x2d68('0x49')];if(!_0x3ebedc[_0x2d68('0x44')][_0x2d68('0x4a')](_0x2d68('0x4b'))){_0x9c91b2[_0x2d68('0x30')]=qs[_0x2d68('0x30')](_0x3ebedc[_0x2d68('0x44')][_0x2d68('0x30')]);_0x9c91b2[_0x2d68('0x2d')]=qs['offset'](_0x3ebedc['query'][_0x2d68('0x2d')]);}return _0x1e68bf[_0x2d68('0x76')](_0x9c91b2);}})[_0x2d68('0x38')](function(_0x9c1cbc){if(_0x9c1cbc){return _0x9c1cbc?{'count':_0x188b40,'rows':_0x9c1cbc}:null;}})[_0x2d68('0x38')](respondWithResult(_0x4484d1,null))[_0x2d68('0x29')](handleError(_0x4484d1,null));};exports[_0x2d68('0x79')]=function(_0x257b8b,_0x401be3){var _0x40dea2=_0x257b8b[_0x2d68('0x56')]['id'];var _0xee97b0=_0x257b8b['body'];var _0x222cef=0xc8;var _0x565a0c=null;return db[_0x2d68('0x7a')]['transaction']({'isolationLevel':db[_0x2d68('0x7a')][_0x2d68('0x7b')][_0x2d68('0x7c')][_0x2d68('0x7d')]},function(_0x14e61d){return db['WhatsappAccount'][_0x2d68('0x77')]({'where':{'id':_0x40dea2},'transaction':_0x14e61d})[_0x2d68('0x38')](function(_0x1127fe){if(_0x1127fe){return db[_0x2d68('0x7e')]['destroy']({'where':{'WhatsappAccountId':_0x40dea2},'transaction':_0x14e61d})['then'](function(){var _0xa564d7=_[_0x2d68('0x43')](_0xee97b0,function(_0x3ef70b){_0x3ef70b[_0x2d68('0x65')]=_0x40dea2;return _0x3ef70b;});return db[_0x2d68('0x7e')][_0x2d68('0x7f')](_0xa564d7,{'transaction':_0x14e61d});});}else{_0x222cef=0x194;_0x565a0c=[];}});})['then'](function(){if(_0x222cef!==0x194){return db['WhatsappApplication'][_0x2d68('0x80')]({'where':{'WhatsappAccountId':_0x40dea2},'order':_0x2d68('0x81')})['then'](function(_0x1f6278){_0x565a0c=_0x1f6278;});}})[_0x2d68('0x29')](function(_0x481429){_0x222cef=0x1f4;logger['error'](_0x481429[_0x2d68('0x82')]);if(_0x481429[_0x2d68('0x39')]){delete _0x481429['name'];}_0x565a0c=_0x481429;})[_0x2d68('0x83')](function(){if(_0x565a0c===null){_0x401be3[_0x2d68('0x2a')](_0x222cef);}else{if(_0x222cef===0x1f4){_0x401be3[_0x2d68('0x31')](_0x222cef)[_0x2d68('0x84')](_0x565a0c);}else{_0x401be3[_0x2d68('0x31')](_0x222cef)[_0x2d68('0x2c')](_0x565a0c);}}});};exports[_0x2d68('0x85')]=function(_0x184b15,_0x1c32fe,_0x5ae498){var _0x16a85b={};var _0x4bb307={};var _0x37ddc7;var _0x3e3920;return db[_0x2d68('0x3d')][_0x2d68('0x77')]({'where':{'id':_0x184b15[_0x2d68('0x56')]['id']}})['then'](handleEntityNotFound(_0x1c32fe,null))[_0x2d68('0x38')](function(_0xe45f21){if(_0xe45f21){_0x37ddc7=_0xe45f21;_0x4bb307[_0x2d68('0x42')]=_[_0x2d68('0x68')](db[_0x2d68('0x7e')][_0x2d68('0x3e')]);_0x4bb307['query']=_[_0x2d68('0x68')](_0x184b15[_0x2d68('0x44')]);_0x4bb307[_0x2d68('0x45')]=_[_0x2d68('0x46')](_0x4bb307['model'],_0x4bb307['query']);_0x16a85b[_0x2d68('0x47')]=_[_0x2d68('0x46')](_0x4bb307['model'],qs[_0x2d68('0x48')](_0x184b15[_0x2d68('0x44')][_0x2d68('0x48')]));_0x16a85b[_0x2d68('0x47')]=_0x16a85b[_0x2d68('0x47')]['length']?_0x16a85b[_0x2d68('0x47')]:_0x4bb307['model'];_0x16a85b[_0x2d68('0x4c')]=qs['sort'](_0x184b15[_0x2d68('0x44')][_0x2d68('0x4d')]);_0x16a85b[_0x2d68('0x4e')]=qs[_0x2d68('0x45')](_[_0x2d68('0x4f')](_0x184b15[_0x2d68('0x44')],_0x4bb307[_0x2d68('0x45')]));if(_0x184b15[_0x2d68('0x44')][_0x2d68('0x50')]){_0x16a85b[_0x2d68('0x4e')]=_[_0x2d68('0x51')](_0x16a85b[_0x2d68('0x4e')],{'$or':_['map'](_0x16a85b['attributes'],function(_0x3a77af){var _0x404629={};_0x404629[_0x3a77af]={'$like':'%'+_0x184b15[_0x2d68('0x44')][_0x2d68('0x50')]+'%'};return _0x404629;})});}_0x16a85b=_[_0x2d68('0x51')]({},_0x16a85b,_0x184b15[_0x2d68('0x52')]);return _0x37ddc7[_0x2d68('0x85')](_0x16a85b);}})[_0x2d68('0x38')](function(_0x5e1813){if(_0x5e1813){_0x3e3920=_0x5e1813[_0x2d68('0x49')];if(!_0x184b15[_0x2d68('0x44')]['hasOwnProperty'](_0x2d68('0x4b'))){_0x16a85b[_0x2d68('0x30')]=qs[_0x2d68('0x30')](_0x184b15[_0x2d68('0x44')][_0x2d68('0x30')]);_0x16a85b['offset']=qs[_0x2d68('0x2d')](_0x184b15[_0x2d68('0x44')][_0x2d68('0x2d')]);}return _0x37ddc7[_0x2d68('0x85')](_0x16a85b);}})['then'](function(_0x46a18f){if(_0x46a18f){return _0x46a18f?{'count':_0x3e3920,'rows':_0x46a18f}:null;}})[_0x2d68('0x38')](respondWithResult(_0x1c32fe,null))[_0x2d68('0x29')](handleError(_0x1c32fe,null));};exports[_0x2d68('0x86')]=function(_0x533fac,_0x449046,_0x4561dc){var _0x480d48={'channel':_0x2d68('0x87')};var _0x165d06=[];var _0x13df25=[];var _0x16b78c={};return db[_0x2d68('0x3d')]['find']({'where':{'id':_0x533fac[_0x2d68('0x56')]['id']},'include':[{'model':db[_0x2d68('0x7e')],'as':_0x2d68('0x88')}]})['then'](handleEntityNotFound(_0x449046,null))[_0x2d68('0x38')](function(_0x9a14cc){_0x480d48[_0x2d68('0x89')]=_0x9a14cc;if(_0x480d48[_0x2d68('0x89')]&&_0x480d48[_0x2d68('0x89')][_0x2d68('0x40')]===_0x2d68('0x8a')&&_0x533fac[_0x2d68('0x59')]['statuses']){if(_0x533fac[_0x2d68('0x59')][_0x2d68('0x8b')][_0x2d68('0x49')]===0x0)return;if(_0x533fac['body'][_0x2d68('0x8b')][0x0][_0x2d68('0x8c')]!==_0x2d68('0x8d'))return;return db[_0x2d68('0x8e')]['update']({'read':!![],'readAt':_0x533fac['body'][_0x2d68('0x8b')][0x0][_0x2d68('0x8f')]},{'where':{'messageId':_0x533fac[_0x2d68('0x59')][_0x2d68('0x8b')][0x0][_0x2d68('0x90')]},'individualHooks':!![]})[_0x2d68('0x38')](function(_0x555f2e){return _0x449046[_0x2d68('0x31')](0xc8)['json'](_0x555f2e);});}_0x480d48[_0x2d68('0x91')]=_[_0x2d68('0x92')](_0x9a14cc[_0x2d68('0x88')],['priority'],[_0x2d68('0x93')]);if(_0x480d48[_0x2d68('0x89')][_0x2d68('0x88')]){delete _0x480d48[_0x2d68('0x89')][_0x2d68('0x88')];}return db[_0x2d68('0x94')][_0x2d68('0x63')]()['then'](function(_0x4767f4){if(!_0x4767f4){throw new db[(_0x2d68('0x95'))]['ValidationError']('no\x20available\x20attributes');}_0x165d06=_[_0x2d68('0x96')](_['keys'](_0x4767f4),[_0x2d68('0x97'),_0x2d68('0x98')]);_0x13df25=_[_0x2d68('0x96')](_[_0x2d68('0x68')](_0x4767f4),[_0x2d68('0x97'),_0x2d68('0x98'),_0x2d68('0x99'),_0x2d68('0x9a')]);_0x480d48[_0x2d68('0x59')]={'mapKey':_0x2d68('0x9b')};if(_0x480d48[_0x2d68('0x89')]&&_0x480d48['account'][_0x2d68('0x40')]===_0x2d68('0x9c')){_0x480d48[_0x2d68('0x59')][_0x2d68('0x9d')]=_0x533fac[_0x2d68('0x59')][_0x2d68('0x9e')][_0x2d68('0x9f')](_0x2d68('0xa0'),'');_0x480d48['body'][_0x2d68('0x59')]=_0x533fac[_0x2d68('0x59')][_0x2d68('0xa1')];_0x480d48[_0x2d68('0x59')][_0x2d68('0xa2')]=_0x533fac[_0x2d68('0x59')][_0x2d68('0xa3')];}if(_0x480d48[_0x2d68('0x89')]&&_0x480d48['account'][_0x2d68('0x40')]===_0x2d68('0x8a')){_0x480d48[_0x2d68('0x59')][_0x2d68('0x9d')]=_0x533fac[_0x2d68('0x59')][_0x2d68('0xa4')][0x0][_0x2d68('0x9d')];_0x480d48[_0x2d68('0x59')][_0x2d68('0x59')]=_0x533fac['body'][_0x2d68('0xa4')][0x0][_0x2d68('0x26')][_0x2d68('0x59')];_0x480d48['body'][_0x2d68('0xa2')]=_0x533fac[_0x2d68('0x59')]['notifications'][0x0][_0x2d68('0x90')];}if(_0x480d48['body']['id']){delete _0x480d48[_0x2d68('0x59')]['id'];}if(_['isNil'](_0x480d48[_0x2d68('0x59')]['from'])){throw new db['Sequelize']['ValidationError'](_0x2d68('0xa5'));}if(_['isNil'](_0x480d48[_0x2d68('0x59')][_0x2d68('0x59')])||_0x480d48[_0x2d68('0x59')][_0x2d68('0x59')]===''){throw new db['Sequelize'][(_0x2d68('0xa6'))](_0x2d68('0xa7'));}if(_[_0x2d68('0xa8')](_0x480d48[_0x2d68('0x59')][_0x2d68('0xa9')])){throw new db[(_0x2d68('0x95'))][(_0x2d68('0xa6'))](_0x2d68('0xaa')+_0x13df25);}if(!_[_0x2d68('0xab')](_0x13df25,_0x480d48[_0x2d68('0x59')]['mapKey'])){throw new db['Sequelize'][(_0x2d68('0xa6'))](_0x2d68('0xac')+_0x13df25);}_0x16b78c[_0x480d48['body'][_0x2d68('0xa9')]]=_0x480d48[_0x2d68('0x59')][_0x2d68('0x9d')];return db['CmList'][_0x2d68('0x57')]({'where':{'id':_0x480d48[_0x2d68('0x89')][_0x2d68('0x9a')]},'include':[{'model':db[_0x2d68('0x94')],'as':'Contacts','where':_0x16b78c,'limit':0x1,'order':[[_0x2d68('0x98'),_0x2d68('0xad')]]}]});})[_0x2d68('0x38')](handleEntityNotFound(_0x449046,null))[_0x2d68('0x38')](function(_0x16f0cf){if(_0x16f0cf){_0x480d48[_0x2d68('0xae')]=_[_0x2d68('0x70')](_0x16f0cf,[_0x2d68('0xaf')]);if(_0x16f0cf['Contacts'][_0x2d68('0x49')]){return _0x16f0cf[_0x2d68('0xaf')][0x0];}var _0x20e470=_[_0x2d68('0x17')](_0x480d48[_0x2d68('0x59')],{'firstName':_0x480d48[_0x2d68('0x59')]['from'],'ListId':_0x16f0cf['id']});_0x20e470[_0x480d48['body']['mapKey']]=_0x480d48[_0x2d68('0x59')]['from'];return db[_0x2d68('0x94')][_0x2d68('0x58')](_0x20e470,{'fields':_0x165d06,'raw':!![]});}})[_0x2d68('0x38')](handleEntityNotFound(_0x449046,null))[_0x2d68('0x38')](function(_0x54d981){if(_0x54d981){_0x480d48[_0x2d68('0xb0')]=_0x54d981;var _0x44d435={'ContactId':_0x54d981['id'],'phone':_0x480d48[_0x2d68('0x59')]['from'],'WhatsappAccountId':_0x533fac[_0x2d68('0x56')]['id']};var _0x978529={'ContactId':_0x54d981['id'],'WhatsappAccountId':_0x533fac[_0x2d68('0x56')]['id'],'closed':![]};return db[_0x2d68('0xb1')][_0x2d68('0x57')]({'where':_0x978529})[_0x2d68('0x38')](function(_0x2dbf85){if(_0x2dbf85){return[_0x2dbf85,![]];}return db['WhatsappInteraction']['create'](_0x44d435)[_0x2d68('0x38')](function(_0x5a713b){return[_0x5a713b,!![]];});});}})[_0x2d68('0x71')](function(_0x32d036,_0x25b9a5){_0x480d48[_0x2d68('0xb2')]=_0x32d036[_0x2d68('0x5b')]({'plain':!![]});_0x480d48[_0x2d68('0xb2')][_0x2d68('0xb3')]=![];if(_0x25b9a5){if(_0x480d48[_0x2d68('0x89')]['autoclose']){_0x480d48[_0x2d68('0x91')][_0x2d68('0xb4')]({'id':0x0,'priority':_0x480d48[_0x2d68('0x91')]['length']+0x1,'app':'close','appdata':_0x2d68('0xb5'),'interval':'*,*,*,*'});}_0x480d48['interaction']['created']=!![];}return db[_0x2d68('0x8e')][_0x2d68('0x58')]({'phone':_0x480d48['body'][_0x2d68('0x9d')],'messageId':_0x480d48[_0x2d68('0x59')][_0x2d68('0xa2')],'body':_0x480d48[_0x2d68('0x59')][_0x2d68('0x59')],'WhatsappAccountId':_0x533fac[_0x2d68('0x56')]['id'],'WhatsappInteractionId':_0x32d036['id'],'direction':'in','ContactId':_0x32d036[_0x2d68('0xb6')],'AttachmentId':_0x480d48[_0x2d68('0x59')][_0x2d68('0xb7')]});})[_0x2d68('0x38')](function(_0x2e58ea){_0x480d48['message']=_0x2e58ea;if(_0x480d48[_0x2d68('0xb2')]['UserId']){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x480d48[_0x2d68('0xb2')]['UserId']}})[_0x2d68('0x38')](function(_0xe7546b){if(_0xe7546b){_0x480d48[_0x2d68('0x91')][_0x2d68('0xb8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xe7546b[_0x2d68('0x39')]+','+(_0x480d48[_0x2d68('0x89')]['waitForTheAssignedAgent']||0xa),'interval':_0x2d68('0xb9')});}return respondWithRpcPromise(_0x2d68('0xba'),_0x2d68('0xbb'),_0x480d48);});}return respondWithRpcPromise('Start',_0x2d68('0xbb'),_0x480d48);})[_0x2d68('0x38')](function(_0x65e9a6){if(_0x65e9a6){var _0x16d4ea=0xc8;var _0x1ffa01=_0x2d68('0xbc');logger[_0x2d68('0x1f')](_0x2d68('0x22'),_0x1ffa01,_0x16d4ea,_0x2d68('0xbd'));logger[_0x2d68('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1ffa01,_0x16d4ea,_0x2d68('0xbd'),JSON[_0x2d68('0x23')](_0x65e9a6));if(_0x480d48[_0x2d68('0x89')][_0x2d68('0x40')]===_0x2d68('0x9c')){return _0x449046[_0x2d68('0x31')](_0x16d4ea)[_0x2d68('0xbe')](_0x2d68('0xbf'),_0x2d68('0xc0'))[_0x2d68('0x84')](_0x2d68('0xc1'));}else{return _0x449046[_0x2d68('0x31')](_0x16d4ea)[_0x2d68('0x2c')](_0x65e9a6);}}});})[_0x2d68('0x29')](handleError(_0x449046,null));};exports[_0x2d68('0x84')]=function(_0x5092de,_0x5c5ea3,_0x1aec29){var _0x7c66f7,_0x3eb8ad,_0x139f32;if(_['isNil'](_0x5092de[_0x2d68('0x59')]['body'])||_0x5092de[_0x2d68('0x59')][_0x2d68('0x59')]===''){throw new db['Sequelize'][(_0x2d68('0xa6'))](_0x2d68('0xa7'));}if(_[_0x2d68('0xa8')](_0x5092de[_0x2d68('0x59')]['to'])){throw new db[(_0x2d68('0x95'))][(_0x2d68('0xa6'))]('to\x20is\x20mandatory');}_0x7c66f7=_0x5092de[_0x2d68('0x59')]['to'];return db[_0x2d68('0x3d')]['find']({'where':{'id':_0x5092de[_0x2d68('0x56')]['id']},'include':[{'model':db[_0x2d68('0xc2')],'as':'List','include':[{'model':db[_0x2d68('0x94')],'as':_0x2d68('0xaf'),'where':{'mobile':_0x7c66f7},'limit':0x1,'order':[[_0x2d68('0x98'),'DESC']]}]}]})[_0x2d68('0x38')](handleEntityNotFound(_0x5c5ea3,null))[_0x2d68('0x38')](function(_0x4f9281){if(_0x4f9281&&_0x4f9281[_0x2d68('0xc3')]){_0x3eb8ad=_0x4f9281[_0x2d68('0x5b')]({'plain':!![]});if(_0x3eb8ad[_0x2d68('0xc3')]&&_0x3eb8ad['List']['Contacts'][_0x2d68('0x49')]){return _0x3eb8ad[_0x2d68('0xc3')][_0x2d68('0xaf')][0x0];}return db[_0x2d68('0x94')][_0x2d68('0x58')](_[_0x2d68('0x17')](_0x5092de['body'],{'firstName':_0x7c66f7,'mobile':_0x7c66f7,'phone':_0x7c66f7,'ListId':_0x3eb8ad[_0x2d68('0x9a')]}));}})['then'](handleEntityNotFound(_0x5c5ea3,null))[_0x2d68('0x38')](function(_0x38888f){if(_0x38888f){_0x139f32=_0x38888f;return db['WhatsappInteraction'][_0x2d68('0x57')]({'where':{'ContactId':_0x139f32['id'],'closed':![],'WhatsappAccountId':_0x3eb8ad['id']}})[_0x2d68('0x38')](function(_0x1fcda6){if(_0x1fcda6){return[_0x1fcda6,![]];}return db['WhatsappInteraction'][_0x2d68('0x58')]({'UserId':_0x5092de['user']['id'],'ContactId':_0x139f32['id'],'WhatsappAccountId':_0x3eb8ad['id'],'phone':_0x7c66f7,'firstMsgDirection':'out','Messages':[_['merge'](_0x5092de[_0x2d68('0x59')],{'read':![],'body':_0x5092de[_0x2d68('0x59')]['body'],'phone':_0x7c66f7,'WhatsappAccountId':_0x3eb8ad['id'],'UserId':_0x5092de['user']['id'],'ContactId':_0x139f32['id']})]},{'include':[{'model':db[_0x2d68('0x8e')],'as':_0x2d68('0xc4')}]})['then'](function(_0x5bcad6){return[_0x5bcad6,!![]];});});}})[_0x2d68('0x71')](function(_0x33bdeb,_0x4f79a0){if(_0x4f79a0){return _0x33bdeb;}return db['WhatsappMessage']['create'](_[_0x2d68('0x51')](_0x5092de[_0x2d68('0x59')],{'read':![],'body':_0x5092de['body']['body'],'phone':_0x7c66f7,'WhatsappAccountId':_0x3eb8ad['id'],'WhatsappInteractionId':_0x33bdeb['id'],'UserId':_0x5092de[_0x2d68('0x5a')]['id'],'ContactId':_0x139f32['id']}))['then'](function(_0x3f477c){_0x33bdeb[_0x2d68('0xc5')][_0x2d68('0xc4')]=[];_0x33bdeb[_0x2d68('0xc5')][_0x2d68('0xc4')][_0x2d68('0xb4')](_0x3f477c[_0x2d68('0xc5')]);return _0x33bdeb;});})['then'](respondWithResult(_0x5c5ea3,null))[_0x2d68('0x29')](handleError(_0x5c5ea3,null));};
\ No newline at end of file
index 4fe0ab7..dfbd00b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7344=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappAccount'];(function(_0x2e2997,_0x3c0bc7){var _0x4a62b1=function(_0x2f0330){while(--_0x2f0330){_0x2e2997['push'](_0x2e2997['shift']());}};_0x4a62b1(++_0x3c0bc7);}(_0x7344,0x18e));var _0x4734=function(_0x16d36b,_0x3982d1){_0x16d36b=_0x16d36b-0x0;var _0x34508c=_0x7344[_0x16d36b];return _0x34508c;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x4734('0x0'))['db'][_0x4734('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x4734('0x2')](0x0);var events={'afterCreate':_0x4734('0x3'),'afterUpdate':_0x4734('0x4'),'afterDestroy':_0x4734('0x5')};function emitEvent(_0x634e2){return function(_0x216703,_0x1ede87,_0x7048df){WhatsappAccountEvents['emit'](_0x634e2+':'+_0x216703['id'],_0x216703);WhatsappAccountEvents[_0x4734('0x6')](_0x634e2,_0x216703);_0x7048df(null);};}for(var e in events){if(events[_0x4734('0x7')](e)){var event=events[e];WhatsappAccount[_0x4734('0x8')](e,emitEvent(event));}}module[_0x4734('0x9')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0xf151=['emit','hasOwnProperty','hook','exports','events','WhatsappAccount','setMaxListeners','save','remove'];(function(_0x12012d,_0x46e1f6){var _0x2ccaf1=function(_0x3a9488){while(--_0x3a9488){_0x12012d['push'](_0x12012d['shift']());}};_0x2ccaf1(++_0x46e1f6);}(_0xf151,0x1f3));var _0x1f15=function(_0x5867c1,_0x48926a){_0x5867c1=_0x5867c1-0x0;var _0x34a566=_0xf151[_0x5867c1];return _0x34a566;};'use strict';var EventEmitter=require(_0x1f15('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x1f15('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1f15('0x2')](0x0);var events={'afterCreate':_0x1f15('0x3'),'afterUpdate':'update','afterDestroy':_0x1f15('0x4')};function emitEvent(_0x587f2f){return function(_0x2569bb,_0x4b1e40,_0x50a7e0){WhatsappAccountEvents[_0x1f15('0x5')](_0x587f2f+':'+_0x2569bb['id'],_0x2569bb);WhatsappAccountEvents[_0x1f15('0x5')](_0x587f2f,_0x2569bb);_0x50a7e0(null);};}for(var e in events){if(events[_0x1f15('0x6')](e)){var event=events[e];WhatsappAccount[_0x1f15('0x7')](e,emitEvent(event));}}module[_0x1f15('0x8')]=WhatsappAccountEvents;
\ No newline at end of file
index 2fa5923..68713f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b82=['path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x2bfb2b,_0x4ac60a){var _0x4fe9fa=function(_0x2b5d7a){while(--_0x2b5d7a){_0x2bfb2b['push'](_0x2bfb2b['shift']());}};_0x4fe9fa(++_0x4ac60a);}(_0x4b82,0x1c8));var _0x24b8=function(_0x5c1f07,_0x35d59e){_0x5c1f07=_0x5c1f07-0x0;var _0x22c4d3=_0x4b82[_0x5c1f07];return _0x22c4d3;};'use strict';var _=require(_0x24b8('0x0'));var util=require(_0x24b8('0x1'));var logger=require(_0x24b8('0x2'))(_0x24b8('0x3'));var moment=require(_0x24b8('0x4'));var BPromise=require('bluebird');var rp=require(_0x24b8('0x5'));var fs=require('fs');var path=require(_0x24b8('0x6'));var rimraf=require(_0x24b8('0x7'));var config=require(_0x24b8('0x8'));var attributes=require(_0x24b8('0x9'));module[_0x24b8('0xa')]=function(_0x383fc5,_0x6e744b){return _0x383fc5[_0x24b8('0xb')](_0x24b8('0xc'),attributes,{'tableName':_0x24b8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4cd1=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','WhatsappAccount'];(function(_0x3ed1a5,_0xe3b77b){var _0x3d61bf=function(_0x5263ea){while(--_0x5263ea){_0x3ed1a5['push'](_0x3ed1a5['shift']());}};_0x3d61bf(++_0xe3b77b);}(_0x4cd1,0x1c3));var _0x14cd=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x4cd1[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x14cd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x14cd('0x1'));var moment=require(_0x14cd('0x2'));var BPromise=require(_0x14cd('0x3'));var rp=require(_0x14cd('0x4'));var fs=require('fs');var path=require(_0x14cd('0x5'));var rimraf=require(_0x14cd('0x6'));var config=require(_0x14cd('0x7'));var attributes=require(_0x14cd('0x8'));module[_0x14cd('0x9')]=function(_0x1de3ca,_0x307ef5){return _0x1de3ca['define'](_0x14cd('0xa'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 21cffce..add7e3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x862b=['WhatsappAccount','find','options','raw','where','attributes','include','map','model','then','debug','stringify','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowWhatsappAccount'];(function(_0x45a80c,_0x466356){var _0x20358a=function(_0x2e5418){while(--_0x2e5418){_0x45a80c['push'](_0x45a80c['shift']());}};_0x20358a(++_0x466356);}(_0x862b,0x13e));var _0xb862=function(_0x3867cd,_0x393306){_0x3867cd=_0x3867cd-0x0;var _0x4db93a=_0x862b[_0x3867cd];return _0x4db93a;};'use strict';var _=require('lodash');var util=require(_0xb862('0x0'));var moment=require(_0xb862('0x1'));var BPromise=require(_0xb862('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb862('0x3'))['db'];var utils=require(_0xb862('0x4'));var logger=require(_0xb862('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb862('0x6'));var client=jayson[_0xb862('0x7')][_0xb862('0x8')]({'port':0x232a});config[_0xb862('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb862('0x9')]));require('./whatsappAccount.socket')[_0xb862('0xa')](socket);function respondWithRpcPromise(_0x256574,_0x1a9bfa,_0x575db7){return new BPromise(function(_0x1d0067,_0x4291ce){return client[_0xb862('0xb')](_0x256574,_0x575db7)['then'](function(_0x4e6fe2){logger[_0xb862('0xc')](_0xb862('0xd'),_0x1a9bfa,_0xb862('0xe'));logger['debug'](_0xb862('0xf'),_0x1a9bfa,_0xb862('0xe'),JSON['stringify'](_0x4e6fe2));if(_0x4e6fe2[_0xb862('0x10')]){if(_0x4e6fe2[_0xb862('0x10')][_0xb862('0x11')]===0x1f4){logger[_0xb862('0x10')](_0xb862('0xd'),_0x1a9bfa,_0x4e6fe2[_0xb862('0x10')]['message']);return _0x4291ce(_0x4e6fe2[_0xb862('0x10')][_0xb862('0x12')]);}logger['error'](_0xb862('0xd'),_0x1a9bfa,_0x4e6fe2[_0xb862('0x10')][_0xb862('0x12')]);return _0x1d0067(_0x4e6fe2[_0xb862('0x10')]['message']);}else{logger['info'](_0xb862('0xd'),_0x1a9bfa,'request\x20sent');_0x1d0067(_0x4e6fe2[_0xb862('0x13')]['message']);}})[_0xb862('0x14')](function(_0x317440){logger[_0xb862('0x10')](_0xb862('0xd'),_0x1a9bfa,_0x317440);_0x4291ce(_0x317440);});});}exports[_0xb862('0x15')]=function(_0x59e74b){var _0x26700e=this;return new Promise(function(_0x37f20f,_0x951690){return db[_0xb862('0x16')][_0xb862('0x17')]({'raw':_0x59e74b[_0xb862('0x18')]?_0x59e74b[_0xb862('0x18')][_0xb862('0x19')]===undefined?!![]:![]:!![],'where':_0x59e74b[_0xb862('0x18')]?_0x59e74b[_0xb862('0x18')][_0xb862('0x1a')]||null:null,'attributes':_0x59e74b[_0xb862('0x18')]?_0x59e74b[_0xb862('0x18')][_0xb862('0x1b')]||null:null,'include':_0x59e74b[_0xb862('0x18')]?_0x59e74b[_0xb862('0x18')][_0xb862('0x1c')]?_[_0xb862('0x1d')](_0x59e74b[_0xb862('0x18')]['include'],function(_0x25a8db){return{'model':db[_0x25a8db['model']],'as':_0x25a8db['as'],'attributes':_0x25a8db[_0xb862('0x1b')],'include':_0x25a8db[_0xb862('0x1c')]?_['map'](_0x25a8db['include'],function(_0x44f0ee){return{'model':db[_0x44f0ee[_0xb862('0x1e')]],'as':_0x44f0ee['as'],'attributes':_0x44f0ee['attributes'],'include':_0x44f0ee[_0xb862('0x1c')]?_[_0xb862('0x1d')](_0x44f0ee[_0xb862('0x1c')],function(_0x10c4ad){return{'model':db[_0x10c4ad['model']],'as':_0x10c4ad['as'],'attributes':_0x10c4ad[_0xb862('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb862('0x1f')](function(_0x419259){logger[_0xb862('0xc')]('ShowWhatsappAccount',_0x59e74b);logger[_0xb862('0x20')](_0xb862('0x15'),_0x59e74b,JSON[_0xb862('0x21')](_0x419259));_0x37f20f(_0x419259);})[_0xb862('0x14')](function(_0x14d632){logger[_0xb862('0x10')](_0xb862('0x15'),_0x14d632[_0xb862('0x12')],_0x59e74b);_0x951690(_0x26700e[_0xb862('0x10')](0x1f4,_0x14d632[_0xb862('0x12')]));});});};
\ No newline at end of file
+var _0x4dc5=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','model','map','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3bc6bf,_0x131b95){var _0x2eb618=function(_0x11c9a3){while(--_0x11c9a3){_0x3bc6bf['push'](_0x3bc6bf['shift']());}};_0x2eb618(++_0x131b95);}(_0x4dc5,0x96));var _0x54dc=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x4dc5[_0x4c445a];return _0x2f611c;};'use strict';var _=require('lodash');var util=require(_0x54dc('0x0'));var moment=require(_0x54dc('0x1'));var BPromise=require(_0x54dc('0x2'));var rs=require(_0x54dc('0x3'));var fs=require('fs');var Redis=require(_0x54dc('0x4'));var db=require(_0x54dc('0x5'))['db'];var utils=require(_0x54dc('0x6'));var logger=require(_0x54dc('0x7'))(_0x54dc('0x8'));var config=require(_0x54dc('0x9'));var jayson=require(_0x54dc('0xa'));var client=jayson[_0x54dc('0xb')][_0x54dc('0xc')]({'port':0x232a});config[_0x54dc('0xd')]=_[_0x54dc('0xe')](config[_0x54dc('0xd')],{'host':_0x54dc('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x54dc('0xd')]));require(_0x54dc('0x10'))[_0x54dc('0x11')](socket);function respondWithRpcPromise(_0x1edcc9,_0x26b585,_0x2c6cee){return new BPromise(function(_0x2c3a85,_0x469270){return client['request'](_0x1edcc9,_0x2c6cee)[_0x54dc('0x12')](function(_0x43b78a){logger[_0x54dc('0x13')](_0x54dc('0x14'),_0x26b585,_0x54dc('0x15'));logger['debug'](_0x54dc('0x16'),_0x26b585,'request\x20sent',JSON[_0x54dc('0x17')](_0x43b78a));if(_0x43b78a['error']){if(_0x43b78a[_0x54dc('0x18')]['code']===0x1f4){logger[_0x54dc('0x18')](_0x54dc('0x14'),_0x26b585,_0x43b78a['error']['message']);return _0x469270(_0x43b78a[_0x54dc('0x18')][_0x54dc('0x19')]);}logger[_0x54dc('0x18')](_0x54dc('0x14'),_0x26b585,_0x43b78a[_0x54dc('0x18')][_0x54dc('0x19')]);return _0x2c3a85(_0x43b78a[_0x54dc('0x18')][_0x54dc('0x19')]);}else{logger[_0x54dc('0x13')](_0x54dc('0x14'),_0x26b585,_0x54dc('0x15'));_0x2c3a85(_0x43b78a[_0x54dc('0x1a')][_0x54dc('0x19')]);}})[_0x54dc('0x1b')](function(_0x1b082f){logger['error'](_0x54dc('0x14'),_0x26b585,_0x1b082f);_0x469270(_0x1b082f);});});}exports[_0x54dc('0x1c')]=function(_0x2d3947){var _0x19b7bc=this;return new Promise(function(_0x441fab,_0x2960a4){return db[_0x54dc('0x1d')][_0x54dc('0x1e')]({'raw':_0x2d3947['options']?_0x2d3947[_0x54dc('0x1f')][_0x54dc('0x20')]===undefined?!![]:![]:!![],'where':_0x2d3947[_0x54dc('0x1f')]?_0x2d3947[_0x54dc('0x1f')][_0x54dc('0x21')]||null:null,'attributes':_0x2d3947[_0x54dc('0x1f')]?_0x2d3947[_0x54dc('0x1f')][_0x54dc('0x22')]||null:null,'include':_0x2d3947[_0x54dc('0x1f')]?_0x2d3947['options'][_0x54dc('0x23')]?_['map'](_0x2d3947[_0x54dc('0x1f')][_0x54dc('0x23')],function(_0x3d4886){return{'model':db[_0x3d4886[_0x54dc('0x24')]],'as':_0x3d4886['as'],'attributes':_0x3d4886[_0x54dc('0x22')],'include':_0x3d4886[_0x54dc('0x23')]?_[_0x54dc('0x25')](_0x3d4886['include'],function(_0x19a45a){return{'model':db[_0x19a45a[_0x54dc('0x24')]],'as':_0x19a45a['as'],'attributes':_0x19a45a[_0x54dc('0x22')],'include':_0x19a45a[_0x54dc('0x23')]?_['map'](_0x19a45a[_0x54dc('0x23')],function(_0x209345){return{'model':db[_0x209345[_0x54dc('0x24')]],'as':_0x209345['as'],'attributes':_0x209345[_0x54dc('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14a108){logger[_0x54dc('0x13')]('ShowWhatsappAccount',_0x2d3947);logger[_0x54dc('0x26')](_0x54dc('0x1c'),_0x2d3947,JSON[_0x54dc('0x17')](_0x14a108));_0x441fab(_0x14a108);})[_0x54dc('0x1b')](function(_0xc5fe1d){logger[_0x54dc('0x18')](_0x54dc('0x1c'),_0xc5fe1d[_0x54dc('0x19')],_0x2d3947);_0x2960a4(_0x19b7bc['error'](0x1f4,_0xc5fe1d['message']));});});};
\ No newline at end of file
index dec475d..1e53d99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61e2=['update','removeListener','register','length','./whatsappAccount.events','save'];(function(_0x3fb704,_0x10e921){var _0x29e9f5=function(_0x2f5e63){while(--_0x2f5e63){_0x3fb704['push'](_0x3fb704['shift']());}};_0x29e9f5(++_0x10e921);}(_0x61e2,0x82));var _0x261e=function(_0x346bd9,_0x37b750){_0x346bd9=_0x346bd9-0x0;var _0x153d7e=_0x61e2[_0x346bd9];return _0x153d7e;};'use strict';var WhatsappAccountEvents=require(_0x261e('0x0'));var events=[_0x261e('0x1'),'remove',_0x261e('0x2')];function createListener(_0x2c4a52,_0x36ce7c){return function(_0x4bc5f8){_0x36ce7c['emit'](_0x2c4a52,_0x4bc5f8);};}function removeListener(_0x563d54,_0x3e79f4){return function(){WhatsappAccountEvents[_0x261e('0x3')](_0x563d54,_0x3e79f4);};}exports[_0x261e('0x4')]=function(_0x491f72){for(var _0x6ea5c0=0x0,_0x41f8b2=events[_0x261e('0x5')];_0x6ea5c0<_0x41f8b2;_0x6ea5c0++){var _0x110736=events[_0x6ea5c0];var _0x39f231=createListener('whatsappAccount:'+_0x110736,_0x491f72);WhatsappAccountEvents['on'](_0x110736,_0x39f231);}};
\ No newline at end of file
+var _0x1678=['register','length','whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','removeListener'];(function(_0x5cde61,_0x5aab83){var _0x626d0=function(_0x500bac){while(--_0x500bac){_0x5cde61['push'](_0x5cde61['shift']());}};_0x626d0(++_0x5aab83);}(_0x1678,0x1ce));var _0x8167=function(_0x10cec8,_0xbdc5e){_0x10cec8=_0x10cec8-0x0;var _0x519a27=_0x1678[_0x10cec8];return _0x519a27;};'use strict';var WhatsappAccountEvents=require(_0x8167('0x0'));var events=[_0x8167('0x1'),_0x8167('0x2'),_0x8167('0x3')];function createListener(_0x4c3c3b,_0x48e99f){return function(_0x2dd745){_0x48e99f[_0x8167('0x4')](_0x4c3c3b,_0x2dd745);};}function removeListener(_0x198187,_0x19a9f1){return function(){WhatsappAccountEvents[_0x8167('0x5')](_0x198187,_0x19a9f1);};}exports[_0x8167('0x6')]=function(_0x31541d){for(var _0x5128ed=0x0,_0x3c340d=events[_0x8167('0x7')];_0x5128ed<_0x3c340d;_0x5128ed++){var _0x2eb67f=events[_0x5128ed];var _0x2c37cd=createListener(_0x8167('0x8')+_0x2eb67f,_0x31541d);WhatsappAccountEvents['on'](_0x2eb67f,_0x2c37cd);}};
\ No newline at end of file
index 7b61ff5..448c01a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x074b=['isAuthenticated','index','get','show','post','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller'];(function(_0x128ca6,_0x5b4029){var _0x42f775=function(_0x473c6c){while(--_0x473c6c){_0x128ca6['push'](_0x128ca6['shift']());}};_0x42f775(++_0x5b4029);}(_0x074b,0x118));var _0xb074=function(_0x3266b8,_0x82852c){_0x3266b8=_0x3266b8-0x0;var _0x425136=_0x074b[_0x3266b8];return _0x425136;};'use strict';var multer=require(_0xb074('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb074('0x1'));var express=require(_0xb074('0x2'));var router=express[_0xb074('0x3')]();var fs_extra=require(_0xb074('0x4'));var auth=require(_0xb074('0x5'));var interaction=require(_0xb074('0x6'));var config=require('../../config/environment');var controller=require(_0xb074('0x7'));router['get']('/',auth[_0xb074('0x8')](),controller[_0xb074('0x9')]);router[_0xb074('0xa')]('/:id',auth[_0xb074('0x8')](),controller[_0xb074('0xb')]);router[_0xb074('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xb074('0xd'),auth[_0xb074('0x8')](),controller[_0xb074('0xe')]);router[_0xb074('0xf')](_0xb074('0xd'),auth['isAuthenticated'](),controller[_0xb074('0x10')]);module[_0xb074('0x11')]=router;
\ No newline at end of file
+var _0x85ed=['/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','isAuthenticated','show','create','put'];(function(_0x331702,_0x1912ff){var _0x4f20f8=function(_0x1ba864){while(--_0x1ba864){_0x331702['push'](_0x331702['shift']());}};_0x4f20f8(++_0x1912ff);}(_0x85ed,0x1bd));var _0xd85e=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x85ed[_0xbb9dbf];return _0x30223c;};'use strict';var multer=require(_0xd85e('0x0'));var util=require(_0xd85e('0x1'));var path=require(_0xd85e('0x2'));var timeout=require(_0xd85e('0x3'));var express=require(_0xd85e('0x4'));var router=express[_0xd85e('0x5')]();var fs_extra=require(_0xd85e('0x6'));var auth=require(_0xd85e('0x7'));var interaction=require(_0xd85e('0x8'));var config=require(_0xd85e('0x9'));var controller=require(_0xd85e('0xa'));router[_0xd85e('0xb')]('/',auth['isAuthenticated'](),controller[_0xd85e('0xc')]);router[_0xd85e('0xb')]('/:id',auth[_0xd85e('0xd')](),controller[_0xd85e('0xe')]);router['post']('/',auth[_0xd85e('0xd')](),controller[_0xd85e('0xf')]);router[_0xd85e('0x10')](_0xd85e('0x11'),auth[_0xd85e('0xd')](),controller[_0xd85e('0x12')]);router['delete'](_0xd85e('0x11'),auth[_0xd85e('0xd')](),controller[_0xd85e('0x13')]);module[_0xd85e('0x14')]=router;
\ No newline at end of file
index 4bab0d0..ae9b7d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce29=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x5063b8,_0xb308d1){var _0x3d775a=function(_0x454172){while(--_0x454172){_0x5063b8['push'](_0x5063b8['shift']());}};_0x3d775a(++_0xb308d1);}(_0xce29,0x191));var _0x9ce2=function(_0x3eab4b,_0x25af6e){_0x3eab4b=_0x3eab4b-0x0;var _0x38e447=_0xce29[_0x3eab4b];return _0x38e447;};'use strict';var Sequelize=require(_0x9ce2('0x0'));module[_0x9ce2('0x1')]={'priority':{'type':Sequelize[_0x9ce2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9ce2('0x3')],'allowNull':![],'defaultValue':_0x9ce2('0x4')},'appdata':{'type':Sequelize[_0x9ce2('0x5')]()},'description':{'type':Sequelize[_0x9ce2('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x3e92=['STRING','TEXT','exports','INTEGER'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x3e92,0x1e2));var _0x23e9=function(_0x1034f7,_0xfdc913){_0x1034f7=_0x1034f7-0x0;var _0x51243d=_0x3e92[_0x1034f7];return _0x51243d;};'use strict';var Sequelize=require('sequelize');module[_0x23e9('0x0')]={'priority':{'type':Sequelize[_0x23e9('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x23e9('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x23e9('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x23e9('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index a750d3d..71c308a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a2d=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','reject','update','then','destroy','end','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','keys','find','create','body','params','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x9a2d,0x123));var _0xd9a2=function(_0x1a4750,_0x3c6e0f){_0x1a4750=_0x1a4750-0x0;var _0x2228e6=_0x9a2d[_0x1a4750];return _0x2228e6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd9a2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9a2('0x1'));var moment=require(_0xd9a2('0x2'));var BPromise=require(_0xd9a2('0x3'));var Mustache=require(_0xd9a2('0x4'));var util=require(_0xd9a2('0x5'));var path=require(_0xd9a2('0x6'));var sox=require(_0xd9a2('0x7'));var csv=require(_0xd9a2('0x8'));var ejs=require(_0xd9a2('0x9'));var fs=require('fs');var fs_extra=require(_0xd9a2('0xa'));var _=require(_0xd9a2('0xb'));var squel=require(_0xd9a2('0xc'));var crypto=require(_0xd9a2('0xd'));var jsforce=require(_0xd9a2('0xe'));var deskjs=require(_0xd9a2('0xf'));var toCsv=require(_0xd9a2('0x8'));var querystring=require(_0xd9a2('0x10'));var Papa=require(_0xd9a2('0x11'));var Redis=require(_0xd9a2('0x12'));var authService=require(_0xd9a2('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd9a2('0x14'));var logger=require('../../config/logger')(_0xd9a2('0x15'));var utils=require('../../config/utils');var config=require(_0xd9a2('0x16'));var licenseUtil=require(_0xd9a2('0x17'));var db=require(_0xd9a2('0x18'))['db'];function respondWithStatusCode(_0xc5a12e,_0x58a5f0){_0x58a5f0=_0x58a5f0||0xcc;return function(_0x1ba710){if(_0x1ba710){return _0xc5a12e[_0xd9a2('0x19')](_0x58a5f0);}return _0xc5a12e[_0xd9a2('0x1a')](_0x58a5f0)['end']();};}function respondWithResult(_0x41b098,_0x4f3c91){_0x4f3c91=_0x4f3c91||0xc8;return function(_0xf3b78e){if(_0xf3b78e){return _0x41b098['status'](_0x4f3c91)[_0xd9a2('0x1b')](_0xf3b78e);}};}function respondWithFilteredResult(_0x3a6969,_0x5e3a6e){return function(_0xee6ea8){if(_0xee6ea8){var _0x1447e6=typeof _0x5e3a6e['offset']===_0xd9a2('0x1c')&&typeof _0x5e3a6e['limit']===_0xd9a2('0x1c');var _0x5185d0=_0xee6ea8[_0xd9a2('0x1d')];var _0x143ec5=_0x1447e6?0x0:_0x5e3a6e[_0xd9a2('0x1e')];var _0x2fd2df=_0x1447e6?_0xee6ea8[_0xd9a2('0x1d')]:_0x5e3a6e[_0xd9a2('0x1e')]+_0x5e3a6e[_0xd9a2('0x1f')];var _0x319859;if(_0x2fd2df>=_0x5185d0){_0x2fd2df=_0x5185d0;_0x319859=0xc8;}else{_0x319859=0xce;}_0x3a6969[_0xd9a2('0x1a')](_0x319859);return _0x3a6969[_0xd9a2('0x20')]('Content-Range',_0x143ec5+'-'+_0x2fd2df+'/'+_0x5185d0)['json'](_0xee6ea8);}return null;};}function patchUpdates(_0xde39f6){return function(_0x468f53){try{jsonpatch['apply'](_0x468f53,_0xde39f6,!![]);}catch(_0x36c3a7){return BPromise[_0xd9a2('0x21')](_0x36c3a7);}return _0x468f53['save']();};}function saveUpdates(_0x1758ec,_0x291a1c){return function(_0x11e928){if(_0x11e928){return _0x11e928[_0xd9a2('0x22')](_0x1758ec)[_0xd9a2('0x23')](function(_0x464af5){return _0x464af5;});}return null;};}function removeEntity(_0x3aedd2,_0x5a59b9){return function(_0x568b91){if(_0x568b91){return _0x568b91[_0xd9a2('0x24')]()[_0xd9a2('0x23')](function(){_0x3aedd2[_0xd9a2('0x1a')](0xcc)[_0xd9a2('0x25')]();});}};}function handleEntityNotFound(_0x492320,_0x2c1c33){return function(_0x591510){if(!_0x591510){_0x492320[_0xd9a2('0x19')](0x194);}return _0x591510;};}function handleError(_0x2093ea,_0x5ea1fc){_0x5ea1fc=_0x5ea1fc||0x1f4;return function(_0x1f042e){logger[_0xd9a2('0x26')](_0x1f042e[_0xd9a2('0x27')]);if(_0x1f042e[_0xd9a2('0x28')]){delete _0x1f042e[_0xd9a2('0x28')];}_0x2093ea[_0xd9a2('0x1a')](_0x5ea1fc)[_0xd9a2('0x29')](_0x1f042e);};}exports[_0xd9a2('0x2a')]=function(_0x53723f,_0x1c8557){var _0x5a6f29={},_0xc422b0={},_0x4964fd={'count':0x0,'rows':[]};var _0x216231=_[_0xd9a2('0x2b')](db[_0xd9a2('0x2c')][_0xd9a2('0x2d')],function(_0x57d1c9){return{'name':_0x57d1c9[_0xd9a2('0x2e')],'type':_0x57d1c9[_0xd9a2('0x2f')][_0xd9a2('0x30')]};});_0xc422b0['model']=_[_0xd9a2('0x2b')](_0x216231,'name');_0xc422b0[_0xd9a2('0x31')]=_['keys'](_0x53723f['query']);_0xc422b0[_0xd9a2('0x32')]=_['intersection'](_0xc422b0['model'],_0xc422b0[_0xd9a2('0x31')]);_0x5a6f29[_0xd9a2('0x33')]=_[_0xd9a2('0x34')](_0xc422b0[_0xd9a2('0x35')],qs['fields'](_0x53723f['query'][_0xd9a2('0x36')]));_0x5a6f29[_0xd9a2('0x33')]=_0x5a6f29['attributes'][_0xd9a2('0x37')]?_0x5a6f29[_0xd9a2('0x33')]:_0xc422b0[_0xd9a2('0x35')];if(!_0x53723f[_0xd9a2('0x31')][_0xd9a2('0x38')](_0xd9a2('0x39'))){_0x5a6f29['limit']=qs[_0xd9a2('0x1f')](_0x53723f['query'][_0xd9a2('0x1f')]);_0x5a6f29['offset']=qs[_0xd9a2('0x1e')](_0x53723f[_0xd9a2('0x31')][_0xd9a2('0x1e')]);}_0x5a6f29[_0xd9a2('0x3a')]=qs['sort'](_0x53723f[_0xd9a2('0x31')][_0xd9a2('0x3b')]);_0x5a6f29[_0xd9a2('0x3c')]=qs[_0xd9a2('0x32')](_[_0xd9a2('0x3d')](_0x53723f['query'],_0xc422b0['filters']),_0x216231);if(_0x53723f[_0xd9a2('0x31')][_0xd9a2('0x3e')]){_0x5a6f29[_0xd9a2('0x3c')]=_[_0xd9a2('0x3f')](_0x5a6f29[_0xd9a2('0x3c')],{'$or':_[_0xd9a2('0x2b')](_0x216231,function(_0x5cf0c5){if(_0x5cf0c5['type']!=='VIRTUAL'){var _0x3dae16={};_0x3dae16[_0x5cf0c5[_0xd9a2('0x28')]]={'$like':'%'+_0x53723f['query'][_0xd9a2('0x3e')]+'%'};return _0x3dae16;}})});}_0x5a6f29=_[_0xd9a2('0x3f')]({},_0x5a6f29,_0x53723f[_0xd9a2('0x40')]);var _0x50f9c5={'where':_0x5a6f29[_0xd9a2('0x3c')]};return db['WhatsappApplication'][_0xd9a2('0x1d')](_0x50f9c5)['then'](function(_0x54b433){_0x4964fd[_0xd9a2('0x1d')]=_0x54b433;if(_0x53723f[_0xd9a2('0x31')][_0xd9a2('0x41')]){_0x5a6f29[_0xd9a2('0x42')]=[{'all':!![]}];}return db[_0xd9a2('0x2c')][_0xd9a2('0x43')](_0x5a6f29);})[_0xd9a2('0x23')](function(_0x2f5209){_0x4964fd[_0xd9a2('0x44')]=_0x2f5209;return _0x4964fd;})[_0xd9a2('0x23')](respondWithFilteredResult(_0x1c8557,_0x5a6f29))[_0xd9a2('0x45')](handleError(_0x1c8557,null));};exports['show']=function(_0x622a10,_0x219975){var _0x19dc29={'raw':!![],'where':{'id':_0x622a10['params']['id']}},_0x2354c8={};_0x2354c8[_0xd9a2('0x35')]=_[_0xd9a2('0x46')](db['WhatsappApplication']['rawAttributes']);_0x2354c8[_0xd9a2('0x31')]=_['keys'](_0x622a10['query']);_0x2354c8[_0xd9a2('0x32')]=_[_0xd9a2('0x34')](_0x2354c8[_0xd9a2('0x35')],_0x2354c8[_0xd9a2('0x31')]);_0x19dc29[_0xd9a2('0x33')]=_['intersection'](_0x2354c8['model'],qs[_0xd9a2('0x36')](_0x622a10['query'][_0xd9a2('0x36')]));_0x19dc29[_0xd9a2('0x33')]=_0x19dc29[_0xd9a2('0x33')][_0xd9a2('0x37')]?_0x19dc29[_0xd9a2('0x33')]:_0x2354c8[_0xd9a2('0x35')];if(_0x622a10[_0xd9a2('0x31')][_0xd9a2('0x41')]){_0x19dc29[_0xd9a2('0x42')]=[{'all':!![]}];}_0x19dc29=_[_0xd9a2('0x3f')]({},_0x19dc29,_0x622a10[_0xd9a2('0x40')]);return db[_0xd9a2('0x2c')][_0xd9a2('0x47')](_0x19dc29)[_0xd9a2('0x23')](handleEntityNotFound(_0x219975,null))['then'](respondWithResult(_0x219975,null))[_0xd9a2('0x45')](handleError(_0x219975,null));};exports[_0xd9a2('0x48')]=function(_0x44bbb2,_0x37a9f6){return db[_0xd9a2('0x2c')]['create'](_0x44bbb2['body'],{})[_0xd9a2('0x23')](respondWithResult(_0x37a9f6,0xc9))[_0xd9a2('0x45')](handleError(_0x37a9f6,null));};exports[_0xd9a2('0x22')]=function(_0x985214,_0x293ed3){if(_0x985214[_0xd9a2('0x49')]['id']){delete _0x985214[_0xd9a2('0x49')]['id'];}return db[_0xd9a2('0x2c')][_0xd9a2('0x47')]({'where':{'id':_0x985214[_0xd9a2('0x4a')]['id']}})[_0xd9a2('0x23')](handleEntityNotFound(_0x293ed3,null))[_0xd9a2('0x23')](saveUpdates(_0x985214[_0xd9a2('0x49')],null))[_0xd9a2('0x23')](respondWithResult(_0x293ed3,null))[_0xd9a2('0x45')](handleError(_0x293ed3,null));};exports['destroy']=function(_0x12ee64,_0x4d8af3){return db[_0xd9a2('0x2c')][_0xd9a2('0x47')]({'where':{'id':_0x12ee64[_0xd9a2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4d8af3,null))[_0xd9a2('0x23')](removeEntity(_0x4d8af3,null))[_0xd9a2('0x45')](handleError(_0x4d8af3,null));};
\ No newline at end of file
+var _0xcd2f=['fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappApplication','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','fieldName','type','key','query','keys','filters','intersection','attributes','model'];(function(_0x52bafc,_0x5d649b){var _0x51ee83=function(_0x2f5d63){while(--_0x2f5d63){_0x52bafc['push'](_0x52bafc['shift']());}};_0x51ee83(++_0x5d649b);}(_0xcd2f,0xf8));var _0xfcd2=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xcd2f[_0x4d8ed9];return _0x1e2140;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfcd2('0x0'));var rp=require(_0xfcd2('0x1'));var moment=require(_0xfcd2('0x2'));var BPromise=require(_0xfcd2('0x3'));var Mustache=require(_0xfcd2('0x4'));var util=require(_0xfcd2('0x5'));var path=require(_0xfcd2('0x6'));var sox=require(_0xfcd2('0x7'));var csv=require('to-csv');var ejs=require(_0xfcd2('0x8'));var fs=require('fs');var fs_extra=require(_0xfcd2('0x9'));var _=require(_0xfcd2('0xa'));var squel=require(_0xfcd2('0xb'));var crypto=require(_0xfcd2('0xc'));var jsforce=require(_0xfcd2('0xd'));var deskjs=require(_0xfcd2('0xe'));var toCsv=require(_0xfcd2('0xf'));var querystring=require(_0xfcd2('0x10'));var Papa=require(_0xfcd2('0x11'));var Redis=require(_0xfcd2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xfcd2('0x13'));var as=require(_0xfcd2('0x14'));var hardwareService=require(_0xfcd2('0x15'));var logger=require(_0xfcd2('0x16'))(_0xfcd2('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bff49,_0xdcfde9){_0xdcfde9=_0xdcfde9||0xcc;return function(_0x15aebb){if(_0x15aebb){return _0x5bff49['sendStatus'](_0xdcfde9);}return _0x5bff49[_0xfcd2('0x18')](_0xdcfde9)[_0xfcd2('0x19')]();};}function respondWithResult(_0x5ad180,_0x50f44c){_0x50f44c=_0x50f44c||0xc8;return function(_0x2825df){if(_0x2825df){return _0x5ad180[_0xfcd2('0x18')](_0x50f44c)[_0xfcd2('0x1a')](_0x2825df);}};}function respondWithFilteredResult(_0x4baf2f,_0x428cf3){return function(_0x4a2bcd){if(_0x4a2bcd){var _0x1a9f8f=typeof _0x428cf3[_0xfcd2('0x1b')]===_0xfcd2('0x1c')&&typeof _0x428cf3[_0xfcd2('0x1d')]===_0xfcd2('0x1c');var _0x378484=_0x4a2bcd['count'];var _0xba3186=_0x1a9f8f?0x0:_0x428cf3[_0xfcd2('0x1b')];var _0x32607c=_0x1a9f8f?_0x4a2bcd[_0xfcd2('0x1e')]:_0x428cf3[_0xfcd2('0x1b')]+_0x428cf3[_0xfcd2('0x1d')];var _0x5c8a4d;if(_0x32607c>=_0x378484){_0x32607c=_0x378484;_0x5c8a4d=0xc8;}else{_0x5c8a4d=0xce;}_0x4baf2f[_0xfcd2('0x18')](_0x5c8a4d);return _0x4baf2f[_0xfcd2('0x1f')](_0xfcd2('0x20'),_0xba3186+'-'+_0x32607c+'/'+_0x378484)[_0xfcd2('0x1a')](_0x4a2bcd);}return null;};}function patchUpdates(_0x266c86){return function(_0x55d8b0){try{jsonpatch[_0xfcd2('0x21')](_0x55d8b0,_0x266c86,!![]);}catch(_0x41c503){return BPromise[_0xfcd2('0x22')](_0x41c503);}return _0x55d8b0[_0xfcd2('0x23')]();};}function saveUpdates(_0x2a06d4,_0x37dafa){return function(_0x19ea4a){if(_0x19ea4a){return _0x19ea4a[_0xfcd2('0x24')](_0x2a06d4)[_0xfcd2('0x25')](function(_0x47fa14){return _0x47fa14;});}return null;};}function removeEntity(_0x23104f,_0x50c0cc){return function(_0xedae7a){if(_0xedae7a){return _0xedae7a[_0xfcd2('0x26')]()['then'](function(){_0x23104f['status'](0xcc)[_0xfcd2('0x19')]();});}};}function handleEntityNotFound(_0xe7fde9,_0x193dc3){return function(_0x2b0364){if(!_0x2b0364){_0xe7fde9['sendStatus'](0x194);}return _0x2b0364;};}function handleError(_0x1c4981,_0x2a8557){_0x2a8557=_0x2a8557||0x1f4;return function(_0x13e447){logger[_0xfcd2('0x27')](_0x13e447['stack']);if(_0x13e447[_0xfcd2('0x28')]){delete _0x13e447['name'];}_0x1c4981[_0xfcd2('0x18')](_0x2a8557)[_0xfcd2('0x29')](_0x13e447);};}exports['index']=function(_0x909257,_0x3cb642){var _0x41ecc9={},_0x4bffa9={},_0x15965e={'count':0x0,'rows':[]};var _0x4e79b=_[_0xfcd2('0x2a')](db['WhatsappApplication']['rawAttributes'],function(_0x5192b9){return{'name':_0x5192b9[_0xfcd2('0x2b')],'type':_0x5192b9[_0xfcd2('0x2c')][_0xfcd2('0x2d')]};});_0x4bffa9['model']=_[_0xfcd2('0x2a')](_0x4e79b,_0xfcd2('0x28'));_0x4bffa9[_0xfcd2('0x2e')]=_[_0xfcd2('0x2f')](_0x909257[_0xfcd2('0x2e')]);_0x4bffa9[_0xfcd2('0x30')]=_[_0xfcd2('0x31')](_0x4bffa9['model'],_0x4bffa9['query']);_0x41ecc9[_0xfcd2('0x32')]=_['intersection'](_0x4bffa9[_0xfcd2('0x33')],qs[_0xfcd2('0x34')](_0x909257[_0xfcd2('0x2e')][_0xfcd2('0x34')]));_0x41ecc9[_0xfcd2('0x32')]=_0x41ecc9[_0xfcd2('0x32')][_0xfcd2('0x35')]?_0x41ecc9[_0xfcd2('0x32')]:_0x4bffa9[_0xfcd2('0x33')];if(!_0x909257['query'][_0xfcd2('0x36')](_0xfcd2('0x37'))){_0x41ecc9[_0xfcd2('0x1d')]=qs[_0xfcd2('0x1d')](_0x909257['query']['limit']);_0x41ecc9[_0xfcd2('0x1b')]=qs[_0xfcd2('0x1b')](_0x909257[_0xfcd2('0x2e')][_0xfcd2('0x1b')]);}_0x41ecc9['order']=qs[_0xfcd2('0x38')](_0x909257[_0xfcd2('0x2e')]['sort']);_0x41ecc9[_0xfcd2('0x39')]=qs['filters'](_[_0xfcd2('0x3a')](_0x909257['query'],_0x4bffa9[_0xfcd2('0x30')]),_0x4e79b);if(_0x909257[_0xfcd2('0x2e')][_0xfcd2('0x3b')]){_0x41ecc9['where']=_[_0xfcd2('0x3c')](_0x41ecc9[_0xfcd2('0x39')],{'$or':_[_0xfcd2('0x2a')](_0x4e79b,function(_0x89e532){if(_0x89e532[_0xfcd2('0x2c')]!==_0xfcd2('0x3d')){var _0x10249c={};_0x10249c[_0x89e532[_0xfcd2('0x28')]]={'$like':'%'+_0x909257[_0xfcd2('0x2e')][_0xfcd2('0x3b')]+'%'};return _0x10249c;}})});}_0x41ecc9=_[_0xfcd2('0x3c')]({},_0x41ecc9,_0x909257[_0xfcd2('0x3e')]);var _0x31368e={'where':_0x41ecc9[_0xfcd2('0x39')]};return db[_0xfcd2('0x3f')][_0xfcd2('0x1e')](_0x31368e)[_0xfcd2('0x25')](function(_0x47d6b6){_0x15965e[_0xfcd2('0x1e')]=_0x47d6b6;if(_0x909257['query'][_0xfcd2('0x40')]){_0x41ecc9[_0xfcd2('0x41')]=[{'all':!![]}];}return db[_0xfcd2('0x3f')][_0xfcd2('0x42')](_0x41ecc9);})['then'](function(_0x20f985){_0x15965e[_0xfcd2('0x43')]=_0x20f985;return _0x15965e;})[_0xfcd2('0x25')](respondWithFilteredResult(_0x3cb642,_0x41ecc9))[_0xfcd2('0x44')](handleError(_0x3cb642,null));};exports[_0xfcd2('0x45')]=function(_0x100198,_0x20c15b){var _0x34ffd6={'raw':!![],'where':{'id':_0x100198[_0xfcd2('0x46')]['id']}},_0x4ba64d={};_0x4ba64d[_0xfcd2('0x33')]=_[_0xfcd2('0x2f')](db[_0xfcd2('0x3f')][_0xfcd2('0x47')]);_0x4ba64d['query']=_[_0xfcd2('0x2f')](_0x100198[_0xfcd2('0x2e')]);_0x4ba64d[_0xfcd2('0x30')]=_[_0xfcd2('0x31')](_0x4ba64d['model'],_0x4ba64d[_0xfcd2('0x2e')]);_0x34ffd6[_0xfcd2('0x32')]=_[_0xfcd2('0x31')](_0x4ba64d[_0xfcd2('0x33')],qs[_0xfcd2('0x34')](_0x100198[_0xfcd2('0x2e')][_0xfcd2('0x34')]));_0x34ffd6[_0xfcd2('0x32')]=_0x34ffd6[_0xfcd2('0x32')]['length']?_0x34ffd6['attributes']:_0x4ba64d['model'];if(_0x100198[_0xfcd2('0x2e')][_0xfcd2('0x40')]){_0x34ffd6[_0xfcd2('0x41')]=[{'all':!![]}];}_0x34ffd6=_[_0xfcd2('0x3c')]({},_0x34ffd6,_0x100198['options']);return db[_0xfcd2('0x3f')][_0xfcd2('0x48')](_0x34ffd6)[_0xfcd2('0x25')](handleEntityNotFound(_0x20c15b,null))[_0xfcd2('0x25')](respondWithResult(_0x20c15b,null))['catch'](handleError(_0x20c15b,null));};exports[_0xfcd2('0x49')]=function(_0x26dbe2,_0x36233a){return db['WhatsappApplication'][_0xfcd2('0x49')](_0x26dbe2[_0xfcd2('0x4a')],{})['then'](respondWithResult(_0x36233a,0xc9))[_0xfcd2('0x44')](handleError(_0x36233a,null));};exports['update']=function(_0x559dea,_0x7352bb){if(_0x559dea[_0xfcd2('0x4a')]['id']){delete _0x559dea[_0xfcd2('0x4a')]['id'];}return db[_0xfcd2('0x3f')]['find']({'where':{'id':_0x559dea[_0xfcd2('0x46')]['id']}})[_0xfcd2('0x25')](handleEntityNotFound(_0x7352bb,null))[_0xfcd2('0x25')](saveUpdates(_0x559dea['body'],null))[_0xfcd2('0x25')](respondWithResult(_0x7352bb,null))[_0xfcd2('0x44')](handleError(_0x7352bb,null));};exports[_0xfcd2('0x26')]=function(_0x50f31c,_0x159aec){return db[_0xfcd2('0x3f')][_0xfcd2('0x48')]({'where':{'id':_0x50f31c[_0xfcd2('0x46')]['id']}})[_0xfcd2('0x25')](handleEntityNotFound(_0x159aec,null))[_0xfcd2('0x25')](removeEntity(_0x159aec,null))[_0xfcd2('0x44')](handleError(_0x159aec,null));};
\ No newline at end of file
index a16c723..01b8500 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8eb=['bluebird','request-promise','rimraf','../../config/environment','exports','WhatsappApplication','whatsapp_applications','lodash','../../config/logger','moment'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0xa8eb,0x179));var _0xba8e=function(_0x5c4f36,_0x4c54f2){_0x5c4f36=_0x5c4f36-0x0;var _0x588c4a=_0xa8eb[_0x5c4f36];return _0x588c4a;};'use strict';var _=require(_0xba8e('0x0'));var util=require('util');var logger=require(_0xba8e('0x1'))('api');var moment=require(_0xba8e('0x2'));var BPromise=require(_0xba8e('0x3'));var rp=require(_0xba8e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xba8e('0x5'));var config=require(_0xba8e('0x6'));var attributes=require('./whatsappApplication.attributes');module[_0xba8e('0x7')]=function(_0x57e345,_0x14c3ac){return _0x57e345['define'](_0xba8e('0x8'),attributes,{'tableName':_0xba8e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x3eea=['exports','WhatsappApplication','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes'];(function(_0x465a22,_0x6bfa46){var _0x5ad9da=function(_0x527753){while(--_0x527753){_0x465a22['push'](_0x465a22['shift']());}};_0x5ad9da(++_0x6bfa46);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x11f3cd,_0xf47a8e){_0x11f3cd=_0x11f3cd-0x0;var _0x452db8=_0x3eea[_0x11f3cd];return _0x452db8;};'use strict';var _=require(_0xa3ee('0x0'));var util=require('util');var logger=require(_0xa3ee('0x1'))(_0xa3ee('0x2'));var moment=require(_0xa3ee('0x3'));var BPromise=require(_0xa3ee('0x4'));var rp=require(_0xa3ee('0x5'));var fs=require('fs');var path=require(_0xa3ee('0x6'));var rimraf=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var attributes=require(_0xa3ee('0x9'));module[_0xa3ee('0xa')]=function(_0xb93cdb,_0x5776bb){return _0xb93cdb['define'](_0xa3ee('0xb'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa3ee('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 1a73c2d..95e091a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappApplication,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x1f167d,_0x4292f1){var _0x3109bf=function(_0x2a2bea){while(--_0x2a2bea){_0x1f167d['push'](_0x1f167d['shift']());}};_0x3109bf(++_0x4292f1);}(_0x4b84,0x1cc));var _0x44b8=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0x4b84[_0x191154];return _0x3dcd73;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('WhatsappApplication,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});}
\ No newline at end of file
+var _0x6f0d=['WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x417720,_0x4811d5){var _0x310f0f=function(_0x499297){while(--_0x499297){_0x417720['push'](_0x417720['shift']());}};_0x310f0f(++_0x4811d5);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2f81d8,_0x498650){_0x2f81d8=_0x2f81d8-0x0;var _0x4c3468=_0x6f0d[_0x2f81d8];return _0x4c3468;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe21ac4,_0x1af29c,_0x8b89a9){return new BPromise(function(_0x1a48a0,_0x4c4916){return client['request'](_0xe21ac4,_0x8b89a9)[_0xd6f0('0xa')](function(_0x272c4e){logger[_0xd6f0('0xb')](_0xd6f0('0xc'),_0x1af29c,_0xd6f0('0xd'));logger['debug'](_0xd6f0('0xe'),_0x1af29c,_0xd6f0('0xd'),JSON[_0xd6f0('0xf')](_0x272c4e));if(_0x272c4e[_0xd6f0('0x10')]){if(_0x272c4e['error'][_0xd6f0('0x11')]===0x1f4){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);return _0x4c4916(_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);}logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e['error'][_0xd6f0('0x12')]);return _0x1a48a0(_0x272c4e[_0xd6f0('0x10')]['message']);}else{logger[_0xd6f0('0xb')]('WhatsappApplication,\x20%s,\x20%s',_0x1af29c,_0xd6f0('0xd'));_0x1a48a0(_0x272c4e[_0xd6f0('0x13')][_0xd6f0('0x12')]);}})[_0xd6f0('0x14')](function(_0x64ff5f){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x64ff5f);_0x4c4916(_0x64ff5f);});});}
\ No newline at end of file
index 7867a89..b2ac80f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25fa=['update','delete','whatsappinteraction:destroy','removeTags','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update'];(function(_0x3ed5d6,_0x1f09ea){var _0x5ae31c=function(_0x1deb73){while(--_0x1deb73){_0x3ed5d6['push'](_0x3ed5d6['shift']());}};_0x5ae31c(++_0x1f09ea);}(_0x25fa,0x109));var _0xa25f=function(_0x28bb88,_0x2f627e){_0x28bb88=_0x28bb88-0x0;var _0x25156c=_0x25fa[_0x28bb88];return _0x25156c;};'use strict';var multer=require(_0xa25f('0x0'));var util=require('util');var path=require(_0xa25f('0x1'));var timeout=require(_0xa25f('0x2'));var express=require('express');var router=express[_0xa25f('0x3')]();var fs_extra=require(_0xa25f('0x4'));var auth=require(_0xa25f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa25f('0x6'));router['get']('/',auth[_0xa25f('0x7')](),controller[_0xa25f('0x8')]);router[_0xa25f('0x9')](_0xa25f('0xa'),auth[_0xa25f('0x7')](),controller[_0xa25f('0xb')]);router[_0xa25f('0x9')](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller['show']);router[_0xa25f('0x9')](_0xa25f('0xd'),auth['isAuthenticated'](),controller[_0xa25f('0xe')]);router[_0xa25f('0x9')](_0xa25f('0xf'),auth[_0xa25f('0x7')](),controller['download']);router[_0xa25f('0x10')]('/',auth[_0xa25f('0x7')](),controller['create']);router[_0xa25f('0x10')](_0xa25f('0xd'),auth['isAuthenticated'](),controller[_0xa25f('0x11')]);router[_0xa25f('0x10')](_0xa25f('0x12'),auth[_0xa25f('0x7')](),interaction[_0xa25f('0x13')](_0xa25f('0x14'),_0xa25f('0x15')),controller[_0xa25f('0x16')]);router[_0xa25f('0x17')](_0xa25f('0xc'),auth[_0xa25f('0x7')](),interaction[_0xa25f('0x13')]('whatsapp',_0xa25f('0x18')),controller[_0xa25f('0x19')]);router[_0xa25f('0x1a')](_0xa25f('0xc'),auth[_0xa25f('0x7')](),interaction[_0xa25f('0x13')]('whatsapp',_0xa25f('0x1b')),controller['destroy']);router[_0xa25f('0x1a')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa25f('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0xed1c=['whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','/:id/messages','addMessage','tracked'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0xed1c,0xe4));var _0xced1=function(_0x1ae238,_0x392b07){_0x1ae238=_0x1ae238-0x0;var _0x5413f4=_0xed1c[_0x1ae238];return _0x5413f4;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xced1('0x2'));var auth=require(_0xced1('0x3'));var interaction=require(_0xced1('0x4'));var config=require('../../config/environment');var controller=require(_0xced1('0x5'));router[_0xced1('0x6')]('/',auth[_0xced1('0x7')](),controller[_0xced1('0x8')]);router['get'](_0xced1('0x9'),auth[_0xced1('0x7')](),controller[_0xced1('0xa')]);router[_0xced1('0x6')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0xc')]);router[_0xced1('0x6')]('/:id/messages',auth[_0xced1('0x7')](),controller['getMessages']);router[_0xced1('0x6')](_0xced1('0xd'),auth[_0xced1('0x7')](),controller[_0xced1('0xe')]);router[_0xced1('0xf')]('/',auth[_0xced1('0x7')](),controller[_0xced1('0x10')]);router['post'](_0xced1('0x11'),auth[_0xced1('0x7')](),controller[_0xced1('0x12')]);router[_0xced1('0xf')]('/:id/tags',auth[_0xced1('0x7')](),interaction[_0xced1('0x13')]('whatsapp',_0xced1('0x14')),controller[_0xced1('0x15')]);router[_0xced1('0x16')](_0xced1('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0xced1('0x17'),_0xced1('0x18')),controller[_0xced1('0x19')]);router[_0xced1('0x1a')](_0xced1('0xb'),auth[_0xced1('0x7')](),interaction['tracked']('whatsapp',_0xced1('0x1b')),controller[_0xced1('0x1c')]);router[_0xced1('0x1a')]('/:id/tags',auth[_0xced1('0x7')](),controller[_0xced1('0x1d')]);module[_0xced1('0x1e')]=router;
\ No newline at end of file
index 53efd92..0fc57ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4250=['exports','BOOLEAN','STRING','DATE','ENUM','out','sequelize','moment'];(function(_0x4abf3f,_0x3cd016){var _0x13902e=function(_0x5c11ac){while(--_0x5c11ac){_0x4abf3f['push'](_0x4abf3f['shift']());}};_0x13902e(++_0x3cd016);}(_0x4250,0x146));var _0x0425=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x4250[_0x4c7fb5];return _0x2e10ac;};'use strict';var Sequelize=require(_0x0425('0x0'));var moment=require(_0x0425('0x1'));module[_0x0425('0x2')]={'closed':{'type':Sequelize[_0x0425('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0425('0x4')]},'secondDisposition':{'type':Sequelize[_0x0425('0x4')]},'thirdDisposition':{'type':Sequelize[_0x0425('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0425('0x4')]},'read1stAt':{'type':Sequelize[_0x0425('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x0425('0x6')]('in',_0x0425('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0425('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x0425('0x6')]('in',_0x0425('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0425('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x75a2=['moment','exports','DATE','STRING','ENUM','out','BOOLEAN','sequelize'];(function(_0x3a010e,_0xe31482){var _0x25053c=function(_0x4858eb){while(--_0x4858eb){_0x3a010e['push'](_0x3a010e['shift']());}};_0x25053c(++_0xe31482);}(_0x75a2,0x187));var _0x275a=function(_0x5ccd0d,_0xc3a58){_0x5ccd0d=_0x5ccd0d-0x0;var _0x233a9e=_0x75a2[_0x5ccd0d];return _0x233a9e;};'use strict';var Sequelize=require(_0x275a('0x0'));var moment=require(_0x275a('0x1'));module[_0x275a('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x275a('0x3')]},'disposition':{'type':Sequelize[_0x275a('0x4')]},'secondDisposition':{'type':Sequelize[_0x275a('0x4')]},'thirdDisposition':{'type':Sequelize[_0x275a('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x275a('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x275a('0x5')]('in',_0x275a('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x275a('0x7')],'defaultValue':![]}};
\ No newline at end of file
index 2514da1..f01f9c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79d7=['whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','some','compact','isEmpty','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','getWhatsappAccounts','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','push','all','rows','catch','params','intersection','fields','includeAll','include','create','find','describe','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','emit','whatsappInteractionTags:save','removeTags','unix','join','root','server','files','tmp','format','transcript-%d-%s.zip','CmContact','firstName','attachments','Attachment','direction','secret','Owner','get','mkdirSync','Whatsapp','Account','N.A.','Messages','existsSync','createReadStream','createWriteStream','basename','out','lastName','views','transcript-','.pdf','createPdfFromHTML','log','err','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','name','send','Users','map','fullname','TagIds','Tags','forEach','then','waiting','talking','answered','unmanaged','total','closed','UserId','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','tools_tags','u.fullname','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x79d7,0x9c));var _0x779d=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x79d7[_0x51020b];return _0x371e47;};'use strict';var emlformat=require(_0x779d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x779d('0x1'));var jsonpatch=require(_0x779d('0x2'));var rp=require(_0x779d('0x3'));var moment=require(_0x779d('0x4'));var BPromise=require(_0x779d('0x5'));var Mustache=require(_0x779d('0x6'));var util=require('util');var path=require(_0x779d('0x7'));var sox=require(_0x779d('0x8'));var csv=require(_0x779d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x779d('0xa'));var squel=require('squel');var crypto=require(_0x779d('0xb'));var jsforce=require(_0x779d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x779d('0xd'));var authService=require(_0x779d('0xe'));var qs=require(_0x779d('0xf'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x779d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x779d('0x11'))('api');var utils=require(_0x779d('0x12'));var config=require(_0x779d('0x13'));var licenseUtil=require(_0x779d('0x14'));var db=require('../../mysqldb')['db'];config[_0x779d('0x15')]=_[_0x779d('0x16')](config[_0x779d('0x15')],{'host':_0x779d('0x17'),'port':0x18eb});var socket=require(_0x779d('0x18'))(new Redis(config[_0x779d('0x15')]));require('./whatsappInteraction.socket')[_0x779d('0x19')](socket);function respondWithStatusCode(_0x1028c6,_0x2a0678){_0x2a0678=_0x2a0678||0xcc;return function(_0x349220){if(_0x349220){return _0x1028c6[_0x779d('0x1a')](_0x2a0678);}return _0x1028c6['status'](_0x2a0678)[_0x779d('0x1b')]();};}function respondWithResult(_0x1e5744,_0x3755c6){_0x3755c6=_0x3755c6||0xc8;return function(_0x4cc248){if(_0x4cc248){return _0x1e5744[_0x779d('0x1c')](_0x3755c6)[_0x779d('0x1d')](_0x4cc248);}};}function respondWithFilteredResult(_0xd9042d,_0x18900e){return function(_0x6a0916){if(_0x6a0916){var _0x21102d=typeof _0x18900e[_0x779d('0x1e')]===_0x779d('0x1f')&&typeof _0x18900e[_0x779d('0x20')]===_0x779d('0x1f');var _0x2629b3=_0x6a0916[_0x779d('0x21')];var _0x4553a2=_0x21102d?0x0:_0x18900e['offset'];var _0x1ab255=_0x21102d?_0x6a0916['count']:_0x18900e[_0x779d('0x1e')]+_0x18900e['limit'];var _0x75103;if(_0x1ab255>=_0x2629b3){_0x1ab255=_0x2629b3;_0x75103=0xc8;}else{_0x75103=0xce;}_0xd9042d[_0x779d('0x1c')](_0x75103);return _0xd9042d[_0x779d('0x22')](_0x779d('0x23'),_0x4553a2+'-'+_0x1ab255+'/'+_0x2629b3)['json'](_0x6a0916);}return null;};}function patchUpdates(_0x864506){return function(_0x33c1ee){try{jsonpatch[_0x779d('0x24')](_0x33c1ee,_0x864506,!![]);}catch(_0x10da0e){return BPromise[_0x779d('0x25')](_0x10da0e);}return _0x33c1ee[_0x779d('0x26')]();};}function saveUpdates(_0x2fca0a,_0x42bc01){return function(_0x1e2ab5){if(_0x1e2ab5){return _0x1e2ab5[_0x779d('0x27')](_0x2fca0a)['then'](function(_0x3c990c){return _0x3c990c;});}return null;};}function removeEntity(_0x58e397,_0x5d7ab5){return function(_0x3d5b8d){if(_0x3d5b8d){return _0x3d5b8d[_0x779d('0x28')]()['then'](function(){_0x58e397[_0x779d('0x1c')](0xcc)[_0x779d('0x1b')]();});}};}function handleEntityNotFound(_0x151d35,_0x5b2070){return function(_0x581a4e){if(!_0x581a4e){_0x151d35[_0x779d('0x1a')](0x194);}return _0x581a4e;};}function handleError(_0x3e825a,_0x1b7584){_0x1b7584=_0x1b7584||0x1f4;return function(_0x23d5ea){logger[_0x779d('0x29')](_0x23d5ea['stack']);if(_0x23d5ea[_0x779d('0x2a')]){delete _0x23d5ea[_0x779d('0x2a')];}_0x3e825a[_0x779d('0x1c')](_0x1b7584)[_0x779d('0x2b')](_0x23d5ea);};}function getInteractionUsers(_0x2a0982,_0x1ed423){return new BPromise(function(_0x22df77,_0x2060d5){try{if(_0x1ed423[_0x2a0982['id']]){_0x2a0982[_0x779d('0x2c')]=_[_0x779d('0x2d')](_0x1ed423[_0x2a0982['id']],function(_0x54fc9b){return{'id':_0x54fc9b['id'],'fullname':_0x54fc9b[_0x779d('0x2e')]};});}}catch(_0x31bbe3){_0x2060d5(_0x31bbe3);}_0x22df77(_0x2a0982);});}function getInteractionTags(_0x1d33c5,_0x15f656){return new BPromise(function(_0x18312f,_0x44ca8b){try{if(_0x1d33c5[_0x779d('0x2f')]){_0x1d33c5[_0x779d('0x30')]=[];_0x1d33c5[_0x779d('0x2f')]['split'](',')[_0x779d('0x31')](function(_0x2237a2){_0x1d33c5[_0x779d('0x30')]['push'](_0x15f656[_0x2237a2]);});}delete _0x1d33c5[_0x779d('0x2f')];}catch(_0x3be0af){_0x44ca8b(_0x3be0af);}_0x18312f(_0x1d33c5);});}function updateWhatsappInteraction(_0x2623ac,_0x33b699,_0x3c8ec0){return new BPromise(function(_0xa40abe,_0x3c81a9){return getInteractionUsers(_0x2623ac,_0x3c8ec0)['then'](function(_0x388e29){return getInteractionTags(_0x388e29,_0x33b699);})[_0x779d('0x32')](function(_0x467755){return getStateInteraction(_0x467755);})['then'](function(_0x1c974c){_0xa40abe(_0x1c974c);})['catch'](function(_0x503f33){_0x3c81a9(_0x503f33);});});}function getStateInteraction(_0x3fbc1e){return new BPromise(function(_0x1efda7){_0x3fbc1e[_0x779d('0x33')]=0x0;_0x3fbc1e[_0x779d('0x34')]=0x0;_0x3fbc1e[_0x779d('0x35')]=0x0;_0x3fbc1e[_0x779d('0x36')]=0x0;_0x3fbc1e[_0x779d('0x37')]=0x0;if(!_0x3fbc1e[_0x779d('0x38')]&&!_0x3fbc1e[_0x779d('0x39')]){_0x3fbc1e[_0x779d('0x33')]+=0x1;}if(!_0x3fbc1e['closed']&&_0x3fbc1e['UserId']){_0x3fbc1e['talking']+=0x1;if(_0x3fbc1e[_0x779d('0x33')]){_0x3fbc1e[_0x779d('0x33')]-=0x1;}}if(_0x3fbc1e['closed']&&_0x3fbc1e[_0x779d('0x39')]){_0x3fbc1e[_0x779d('0x35')]+=0x1;if(_0x3fbc1e['talking']){_0x3fbc1e[_0x779d('0x34')]-=0x1;}}if(_0x3fbc1e[_0x779d('0x38')]&&!_0x3fbc1e[_0x779d('0x39')]){_0x3fbc1e[_0x779d('0x36')]+=0x1;if(_0x3fbc1e[_0x779d('0x33')]){_0x3fbc1e[_0x779d('0x33')]-=0x1;}}_0x3fbc1e['total']+=0x1;_0x1efda7(_0x3fbc1e);});}exports[_0x779d('0x3a')]=function(_0x51958e,_0x23dbdc){var _0x17bf31={},_0x5e1d80={},_0x3939f9={'count':0x0,'rows':[]};var _0x42e580=_['map'](db[_0x779d('0x3b')][_0x779d('0x3c')],function(_0x1c3fd0){return{'name':_0x1c3fd0[_0x779d('0x3d')],'type':_0x1c3fd0[_0x779d('0x3e')][_0x779d('0x3f')]};});_0x5e1d80[_0x779d('0x40')]=_['map'](_0x42e580,_0x779d('0x2a'));_0x5e1d80['query']=_[_0x779d('0x41')](_0x51958e[_0x779d('0x42')]);_0x5e1d80[_0x779d('0x43')]=_['intersection'](_0x5e1d80['model'],_0x5e1d80[_0x779d('0x42')]);_0x17bf31['attributes']=_['intersection'](_0x5e1d80[_0x779d('0x40')],qs['fields'](_0x51958e[_0x779d('0x42')]['fields']));_0x17bf31[_0x779d('0x44')]=_0x17bf31['attributes'][_0x779d('0x45')]?_0x17bf31[_0x779d('0x44')]:_0x5e1d80[_0x779d('0x40')];if(!_0x51958e[_0x779d('0x42')][_0x779d('0x46')](_0x779d('0x47'))){_0x17bf31[_0x779d('0x20')]=qs[_0x779d('0x20')](_0x51958e[_0x779d('0x42')][_0x779d('0x20')]);_0x17bf31[_0x779d('0x1e')]=qs['offset'](_0x51958e[_0x779d('0x42')][_0x779d('0x1e')]);}_0x17bf31['order']=qs['sort'](_0x51958e[_0x779d('0x42')][_0x779d('0x48')]);_0x17bf31['where']=qs[_0x779d('0x43')](_[_0x779d('0x49')](_0x51958e[_0x779d('0x42')],_0x5e1d80['filters']),_0x42e580);var _0x424421=[];var _0x22942b=squel[_0x779d('0x4a')]()[_0x779d('0x4b')]('id')[_0x779d('0x4b')](_0x779d('0x2a'))[_0x779d('0x4b')](_0x779d('0x4c'))[_0x779d('0x4d')](_0x779d('0x4e'));var _0x345d5e=squel[_0x779d('0x4a')]()['field']('u.id')[_0x779d('0x4b')](_0x779d('0x4f'))['field']('ui.WhatsappInteractionId')[_0x779d('0x4d')](_0x779d('0x50'),'ui')[_0x779d('0x51')](_0x779d('0x52'),'u',_0x779d('0x53'));var _0x56b015=squel[_0x779d('0x4a')]()[_0x779d('0x4d')](_0x779d('0x54'),'i')[_0x779d('0x51')](_0x779d('0x55'),'c',_0x779d('0x56'))['left_join'](_0x779d('0x52'),'o',_0x779d('0x57'))[_0x779d('0x51')](_0x779d('0x58'),'a',_0x779d('0x59'))[_0x779d('0x51')]('whatsapp_messages','me',_0x779d('0x5a'))[_0x779d('0x51')](_0x779d('0x5b'),'it',_0x779d('0x5c'))[_0x779d('0x51')](_0x779d('0x4e'),'t',_0x779d('0x5d'));var _0x41e706=squel[_0x779d('0x5e')]();var _0x3cd8ca=[];var _0x2ad55a=squel['expr']();var _0x185acc;if(_0x51958e['query'][_0x779d('0x5f')]){_0x185acc=as[_0x779d('0x60')](_0x51958e['query'][_0x779d('0x5f')]);var _0x234e43=_0x185acc['sqlOperator'];for(var _0x284a92=0x0;_0x284a92<_0x185acc[_0x779d('0x61')]['length'];_0x284a92++){var _0x2d6f8c=_0x185acc[_0x779d('0x61')][_0x284a92];var _0x493031='i';var _0x4e8733=_['find'](_0x42e580,[_0x779d('0x2a'),_0x2d6f8c[_0x779d('0x4b')]]);if(!_0x4e8733){switch(_0x2d6f8c[_0x779d('0x4b')]){case _0x779d('0x62'):if(_0x2d6f8c[_0x779d('0x63')]==0x1){_0x56b015[_0x779d('0x64')]('`'+_0x2d6f8c[_0x779d('0x4b')]+_0x779d('0x65'));}else{_0x56b015[_0x779d('0x64')]('`'+_0x2d6f8c[_0x779d('0x4b')]+_0x779d('0x66'));}break;case _0x779d('0x67'):if(_0x2d6f8c[_0x779d('0x68')]===_0x779d('0x69')){if(_0x2d6f8c['value'][_0x779d('0x6a')]('\x20')[_0x779d('0x45')]>0x1){_0x41e706[_0x234e43](_0x779d('0x6b'),qs[_0x779d('0x6c')](_0x2d6f8c[_0x779d('0x63')]),null);}else{var _0x9e953f='%'+_0x2d6f8c[_0x779d('0x63')]+'%';_0x41e706[_0x234e43]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x9e953f,_0x9e953f,_0x9e953f);}}else{_0x4e8733=_['find'](_0x42e580,['name','ContactId']);_0x2d6f8c[_0x779d('0x4b')]='ContactId';_0x232a69=as[_0x779d('0x6d')](_0x493031,_0x4e8733[_0x779d('0x3e')],_0x2d6f8c);_0x41e706[_0x234e43](_0x232a69['text'],_0x232a69['value'][_0x779d('0x6e')],_0x232a69[_0x779d('0x63')][_0x779d('0x1b')]);}break;case _0x779d('0x6f'):var _0x59d699=_0x2d6f8c[_0x779d('0x63')]['split'](',')[_0x779d('0x2d')](function(_0x2d10e8){return Number(_0x2d10e8);});_0x59d699[_0x779d('0x31')](function(_0x1c2320){_0x2ad55a['or'](_0x779d('0x70'),'%,'+_0x1c2320+',%');});_0x3cd8ca=_[_0x779d('0x71')](_0x3cd8ca,_0x59d699);break;case _0x779d('0x72'):if(_0x2d6f8c[_0x779d('0x68')]==='$substring'){_0x41e706[_0x234e43](_0x779d('0x73'),'%'+_0x2d6f8c['value']+'%',null);}else{_0x4e8733=_['find'](_0x42e580,[_0x779d('0x2a'),'UserId']);_0x2d6f8c[_0x779d('0x4b')]='UserId';_0x232a69=as['buildExpression'](_0x493031,_0x4e8733[_0x779d('0x3e')],_0x2d6f8c);_0x41e706[_0x234e43](_0x232a69[_0x779d('0x74')],_0x232a69[_0x779d('0x63')]['start'],_0x232a69[_0x779d('0x63')][_0x779d('0x1b')]);}break;case _0x779d('0x75'):_0x232a69=as['buildExpression']('me',null,_0x2d6f8c);_0x41e706[_0x234e43](_0x232a69[_0x779d('0x74')],_0x232a69[_0x779d('0x63')][_0x779d('0x6e')],_0x232a69[_0x779d('0x63')][_0x779d('0x1b')]);break;}}else{var _0x232a69=as[_0x779d('0x6d')](_0x493031,_0x4e8733[_0x779d('0x3e')],_0x2d6f8c);_0x41e706[_0x234e43](_0x232a69[_0x779d('0x74')],_0x232a69[_0x779d('0x63')][_0x779d('0x6e')],_0x232a69[_0x779d('0x63')][_0x779d('0x1b')]);}}}else{var _0x374432=_(_0x51958e[_0x779d('0x42')])[_0x779d('0x41')]()['map'](function(_0x4d7251){return _[_0x779d('0x76')](_0x42e580,[_0x779d('0x2a'),_0x4d7251])?_0x4d7251:undefined;})[_0x779d('0x77')]()[_0x779d('0x63')]();if(!_[_0x779d('0x78')](_0x374432)){_0x374432[_0x779d('0x31')](function(_0x5a9b30){if(_0x5a9b30===_0x779d('0x79')){_0x56b015[_0x779d('0x7a')](_0x779d('0x7b'),[][_0x779d('0x7c')](_0x51958e[_0x779d('0x42')][_0x5a9b30]));}else if(_0x5a9b30===_0x779d('0x7d')){var _0xb81003=JSON[_0x779d('0x7e')](_0x51958e[_0x779d('0x42')][_0x5a9b30])[_0x779d('0x7f')];var _0x1f92b8=JSON[_0x779d('0x7e')](_0x51958e['query'][_0x5a9b30])[_0x779d('0x80')];_0x56b015[_0x779d('0x7a')](_0x779d('0x81'),_0xb81003,_0x1f92b8);}else{if(_0x51958e[_0x779d('0x42')][_0x5a9b30]===_0x779d('0x82')){_0x56b015[_0x779d('0x7a')]('i.'+_0x5a9b30+_0x779d('0x83'));}else{_0x56b015[_0x779d('0x7a')]('i.'+_0x5a9b30+_0x779d('0x84'),_0x51958e[_0x779d('0x42')][_0x5a9b30]);}}});}if(_0x51958e['query'][_0x779d('0x85')]){if(_0x51958e[_0x779d('0x42')]['read']==0x1){_0x56b015['having']('`unreadMessages`\x20=\x200');}else{_0x56b015[_0x779d('0x64')](_0x779d('0x86'));}}if(_0x51958e[_0x779d('0x42')]['tag']){_0x3cd8ca=_[_0x779d('0x87')](_0x51958e['query'][_0x779d('0x88')])?_0x51958e[_0x779d('0x42')][_0x779d('0x88')]:new Array(_0x51958e[_0x779d('0x42')][_0x779d('0x88')]);_0x3cd8ca[_0x779d('0x31')](function(_0x3044fb){_0x2ad55a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3044fb+',%');});}if(_0x51958e[_0x779d('0x42')][_0x779d('0x89')]){var _0x302d80=_0x51958e[_0x779d('0x42')][_0x779d('0x89')]['replace']('\x5c','\x5c\x5c')[_0x779d('0x8a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x302d80)){_0x41e706['or'](_0x779d('0x8b'),_0x302d80+'%')['or'](_0x779d('0x8c'),_0x302d80+'%');}else{_0x41e706['or'](_0x779d('0x8d'),qs[_0x779d('0x6c')](_0x302d80))['or'](_0x779d('0x8e'),_0x302d80+'%');}}}_0x56b015['where'](_0x41e706);_0x56b015['group'](_0x779d('0x8f'));var _0x57c235={'type':db[_0x779d('0x90')]['QueryTypes'][_0x779d('0x91')],'raw':!![]};var _0x5e4f8b=_0x56b015[_0x779d('0x92')]();_0x5e4f8b[_0x779d('0x4b')](_0x779d('0x8f'));_0x5e4f8b[_0x779d('0x4b')](_0x779d('0x93'),_0x779d('0x62'));if(_0x17bf31['order']){_0x17bf31[_0x779d('0x94')][_0x779d('0x31')](function(_0x2e9fc9){var _0x486233=_0x2e9fc9[0x0]===_0x779d('0x95')?_0x2e9fc9[0x0]:'i.'+_0x2e9fc9[0x0];_0x56b015['order'](_0x486233,_0x2e9fc9[0x1]===_0x779d('0x96')?![]:!![]);});}if(!_[_0x779d('0x78')](_0x3cd8ca)){_0x56b015[_0x779d('0x64')](_0x2ad55a);_0x5e4f8b['where'](_0x779d('0x97'),_0x3cd8ca);}BPromise[_0x779d('0x98')]()['then'](function(){if(!_0x185acc){if(_0x51958e[_0x779d('0x42')]['WhatsappAccountId'])return;_0x5e4f8b['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x56b015[_0x779d('0x7a')](_0x779d('0x99'));return;}if(_0x51958e[_0x779d('0x9a')]['role']!==_0x779d('0x9b'))return;return _0x51958e[_0x779d('0x9a')][_0x779d('0x9c')]({'attributes':['id'],'raw':!![]})[_0x779d('0x32')](function(_0x14b922){if(_['isEmpty'](_0x14b922)){_0x5e4f8b['where']('i.WhatsappAccountId\x20IS\x20NULL');_0x56b015[_0x779d('0x7a')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x5e4f8b[_0x779d('0x7a')]('i.WhatsappAccountId\x20IN\x20?',_[_0x779d('0x2d')](_0x14b922,'id'));_0x56b015[_0x779d('0x7a')]('i.WhatsappAccountId\x20IN\x20?',_[_0x779d('0x2d')](_0x14b922,'id'));}});})['then'](function(){if(_0x51958e[_0x779d('0x9a')]['role']===_0x779d('0x9b')&&!_0x185acc&&!_0x51958e[_0x779d('0x42')][_0x779d('0x79')])return[];return db[_0x779d('0x9d')][_0x779d('0x42')](_0x5e4f8b['toString'](),_0x57c235);})[_0x779d('0x32')](function(_0x50f935){_0x3939f9['count']=_0x50f935['length'];if(_0x3939f9[_0x779d('0x21')]===0x0)return[];return db['sequelize'][_0x779d('0x42')](_0x22942b['toString'](),_0x57c235)[_0x779d('0x32')](function(_0x335d5d){_0x424421=_[_0x779d('0x9e')](_0x335d5d,'id');_0x57c235=_[_0x779d('0x9f')](_0x57c235,{'model':db[_0x779d('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x51958e['query']['fields']){_0x17bf31['attributes'][_0x779d('0x31')](function(_0x13632b){_0x56b015[_0x779d('0x4b')]('i.'+_0x13632b);});}else{_0x56b015[_0x779d('0x4b')](_0x779d('0x93'),_0x779d('0x62'));_0x56b015[_0x779d('0x4b')](_0x779d('0xa0'),_0x779d('0xa1'));_0x56b015[_0x779d('0x4b')](_0x779d('0xa2'),'Account.mandatoryDisposition');_0x56b015[_0x779d('0x4b')](_0x779d('0xa3'),_0x779d('0x95'));_0x56b015['field'](_0x779d('0xa4'));_0x56b015[_0x779d('0x4b')](_0x779d('0xa5'),_0x779d('0xa6'));_0x56b015[_0x779d('0x4b')](_0x779d('0xa7'),'Contact.lastName');_0x56b015['field'](_0x779d('0xa8'),_0x779d('0xa9'));_0x56b015[_0x779d('0x4b')](_0x779d('0xaa'),'Contact.phone');_0x56b015[_0x779d('0x4b')](_0x779d('0xab'),_0x779d('0xac'));_0x56b015[_0x779d('0x4b')]('c.fax',_0x779d('0xad'));_0x56b015['field']('o.fullname',_0x779d('0xae'));_0x56b015[_0x779d('0x4b')]('o.internal',_0x779d('0xaf'));_0x56b015[_0x779d('0x4b')](_0x779d('0xb0'),_0x779d('0x2f'));}if(_0x17bf31[_0x779d('0x20')])_0x56b015[_0x779d('0x20')](_0x17bf31[_0x779d('0x20')]);if(_0x17bf31[_0x779d('0x1e')])_0x56b015[_0x779d('0x1e')](_0x17bf31['offset']);return db[_0x779d('0x9d')][_0x779d('0x42')](_0x56b015[_0x779d('0xb1')](),_0x57c235);})['then'](function(_0x28e067){if(_0x28e067[_0x779d('0x45')]>0x0)_0x345d5e[_0x779d('0x7a')](_0x779d('0xb2'),_[_0x779d('0x2d')](_0x28e067,'id'));return db[_0x779d('0x9d')][_0x779d('0x42')](_0x345d5e[_0x779d('0xb1')](),_0x57c235)['then'](function(_0x589b0e){var _0x3955dd=_[_0x779d('0xb3')](_0x589b0e,_0x779d('0xb4'));var _0x5f387b=[];_0x28e067[_0x779d('0x31')](function(_0x1b1f0c){_0x5f387b[_0x779d('0xb5')](updateWhatsappInteraction(_0x1b1f0c,_0x424421,_0x3955dd));});return BPromise[_0x779d('0xb6')](_0x5f387b);});});})['then'](function(_0x41a1b6){_0x3939f9[_0x779d('0xb7')]=_0x41a1b6;return _0x3939f9;})[_0x779d('0x32')](respondWithFilteredResult(_0x23dbdc,_0x17bf31))[_0x779d('0xb8')](handleError(_0x23dbdc,null));};exports['show']=function(_0x500018,_0x919c02){var _0x23b262={'raw':![],'where':{'id':_0x500018[_0x779d('0xb9')]['id']}},_0x122ed8={};_0x122ed8[_0x779d('0x40')]=_[_0x779d('0x41')](db[_0x779d('0x3b')][_0x779d('0x3c')]);_0x122ed8[_0x779d('0x42')]=_['keys'](_0x500018[_0x779d('0x42')]);_0x122ed8['filters']=_[_0x779d('0xba')](_0x122ed8['model'],_0x122ed8[_0x779d('0x42')]);_0x23b262[_0x779d('0x44')]=_[_0x779d('0xba')](_0x122ed8[_0x779d('0x40')],qs[_0x779d('0xbb')](_0x500018[_0x779d('0x42')][_0x779d('0xbb')]));_0x23b262[_0x779d('0x44')]=_0x23b262[_0x779d('0x44')][_0x779d('0x45')]?_0x23b262[_0x779d('0x44')]:_0x122ed8[_0x779d('0x40')];if(_0x500018['query'][_0x779d('0xbc')]){_0x23b262[_0x779d('0xbd')]=[{'all':!![]}];}_0x23b262=_[_0x779d('0x9f')]({},_0x23b262,_0x500018['options']);return db[_0x779d('0x3b')]['find'](_0x23b262)['then'](handleEntityNotFound(_0x919c02,null))[_0x779d('0x32')](respondWithResult(_0x919c02,null))[_0x779d('0xb8')](handleError(_0x919c02,null));};exports[_0x779d('0xbe')]=function(_0x1c69a2,_0x4487b6){return db['WhatsappInteraction']['create'](_0x1c69a2[_0x779d('0x75')],{})[_0x779d('0x32')](respondWithResult(_0x4487b6,0xc9))[_0x779d('0xb8')](handleError(_0x4487b6,null));};exports[_0x779d('0x27')]=function(_0x19dc71,_0x16f8c6){if(_0x19dc71[_0x779d('0x75')]['id']){delete _0x19dc71[_0x779d('0x75')]['id'];}return db['WhatsappInteraction'][_0x779d('0xbf')]({'where':{'id':_0x19dc71['params']['id']}})[_0x779d('0x32')](handleEntityNotFound(_0x16f8c6,null))[_0x779d('0x32')](saveUpdates(_0x19dc71['body'],null))[_0x779d('0x32')](respondWithResult(_0x16f8c6,null))[_0x779d('0xb8')](handleError(_0x16f8c6,null));};exports[_0x779d('0x28')]=function(_0x7814fc,_0x1f2953){return db[_0x779d('0x3b')][_0x779d('0xbf')]({'where':{'id':_0x7814fc[_0x779d('0xb9')]['id']}})[_0x779d('0x32')](handleEntityNotFound(_0x1f2953,null))[_0x779d('0x32')](removeEntity(_0x1f2953,null))[_0x779d('0xb8')](handleError(_0x1f2953,null));};exports[_0x779d('0xc0')]=function(_0x1ec87a,_0x48869c){return db[_0x779d('0x3b')]['describe']()[_0x779d('0x32')](respondWithResult(_0x48869c,null))['catch'](handleError(_0x48869c,null));};exports[_0x779d('0xc1')]=function(_0x44e85f,_0x36054c,_0x4ab974){return db[_0x779d('0xc2')][_0x779d('0xbf')]({'where':{'id':_0x44e85f[_0x779d('0xb9')]['id']}})[_0x779d('0x32')](handleEntityNotFound(_0x36054c,null))[_0x779d('0x32')](function(_0x3d08d3){if(_0x3d08d3){return _0x3d08d3[_0x779d('0xc1')](_0x44e85f[_0x779d('0x75')]['ids'],_[_0x779d('0xc3')](_0x44e85f[_0x779d('0x75')],[_0x779d('0xc4'),'id'])||{});}})[_0x779d('0x32')](respondWithResult(_0x36054c,null))[_0x779d('0xb8')](handleError(_0x36054c,null));};exports[_0x779d('0xc5')]=function(_0x253ba8,_0x1ab70c,_0x2b3dfb){var _0x481a8a={'raw':![],'where':{}};var _0x601d12={};var _0x39c506={'count':0x0,'rows':[]};return db[_0x779d('0x3b')][_0x779d('0xc6')]({'where':{'id':_0x253ba8[_0x779d('0xb9')]['id']}})['then'](handleEntityNotFound(_0x1ab70c,null))[_0x779d('0x32')](function(_0x5f54b4){if(_0x5f54b4){_0x601d12[_0x779d('0x40')]=_[_0x779d('0x41')](db[_0x779d('0xc2')][_0x779d('0x3c')]);_0x601d12[_0x779d('0x42')]=_[_0x779d('0x41')](_0x253ba8[_0x779d('0x42')]);_0x601d12['filters']=_['intersection'](_0x601d12[_0x779d('0x40')],_0x601d12[_0x779d('0x42')]);_0x481a8a[_0x779d('0x44')]=_[_0x779d('0xba')](_0x601d12[_0x779d('0x40')],qs[_0x779d('0xbb')](_0x253ba8[_0x779d('0x42')]['fields']));_0x481a8a['attributes']=_0x481a8a['attributes']['length']?_0x481a8a[_0x779d('0x44')]:_0x601d12[_0x779d('0x40')];if(!_0x253ba8[_0x779d('0x42')][_0x779d('0x46')]('nolimit')){_0x481a8a[_0x779d('0x20')]=qs[_0x779d('0x20')](_0x253ba8['query'][_0x779d('0x20')]);_0x481a8a[_0x779d('0x1e')]=qs[_0x779d('0x1e')](_0x253ba8[_0x779d('0x42')][_0x779d('0x1e')]);}_0x481a8a[_0x779d('0x94')]=qs[_0x779d('0x48')](_0x253ba8[_0x779d('0x42')][_0x779d('0x48')]);_0x481a8a[_0x779d('0x7a')]=qs[_0x779d('0x43')](_[_0x779d('0x49')](_0x253ba8['query'],_0x601d12[_0x779d('0x43')]));_0x481a8a[_0x779d('0x7a')][_0x779d('0xb4')]=_0x5f54b4['id'];if(_0x253ba8['query'][_0x779d('0x89')]){_0x481a8a[_0x779d('0x7a')]=_['merge'](_0x481a8a[_0x779d('0x7a')],{'$or':_[_0x779d('0x2d')](_0x481a8a[_0x779d('0x44')],function(_0x260535){var _0x342f69={};_0x342f69[_0x260535]={'$like':'%'+_0x253ba8[_0x779d('0x42')][_0x779d('0x89')]+'%'};return _0x342f69;})});}if(_0x253ba8[_0x779d('0x42')]['$gte']){var _0x5827d0=_0x253ba8['query'][_0x779d('0x7f')][_0x779d('0x6a')](',');var _0x48b0fd={};_0x48b0fd[_0x5827d0[0x0]]={'$gte':moment(_0x5827d0[0x1])['format'](_0x779d('0xc7'))};_0x481a8a[_0x779d('0x7a')]=_[_0x779d('0x9f')](_0x481a8a['where'],_0x48b0fd);}_0x481a8a=_['merge']({},_0x481a8a,_0x253ba8[_0x779d('0xc8')]);return db[_0x779d('0xc2')][_0x779d('0x21')]({'where':_0x481a8a['where']})[_0x779d('0x32')](function(_0x2353ee){_0x39c506[_0x779d('0x21')]=_0x2353ee;if(_0x253ba8[_0x779d('0x42')]['includeAll']){_0x481a8a[_0x779d('0xbd')]=[{'all':!![]}];}return db[_0x779d('0xc2')][_0x779d('0xc9')](_0x481a8a);})['then'](function(_0xf26131){_0x39c506[_0x779d('0xb7')]=_0xf26131;return _0x39c506;});}})[_0x779d('0x32')](respondWithFilteredResult(_0x1ab70c,_0x481a8a))[_0x779d('0xb8')](handleError(_0x1ab70c,null));};exports[_0x779d('0xca')]=function(_0x424572,_0xae01c3,_0x468f43){return db[_0x779d('0x3b')][_0x779d('0xbf')]({'where':{'id':_0x424572[_0x779d('0xb9')]['id']}})['then'](handleEntityNotFound(_0xae01c3,null))[_0x779d('0x32')](function(_0x1d969b){if(_0x1d969b){return _0x1d969b[_0x779d('0xcb')](_0x424572['body'][_0x779d('0xc4')],_[_0x779d('0xc3')](_0x424572[_0x779d('0x75')],['ids','id'])||{})['spread'](function(){return db['Tag'][_0x779d('0xc9')]({'attributes':['id',_0x779d('0x2a'),_0x779d('0x4c')],'where':{'id':_0x424572[_0x779d('0x75')][_0x779d('0xc4')]}});})[_0x779d('0x32')](function(_0x53ec4c){socket[_0x779d('0xcc')](_0x779d('0xcd'),{'id':Number(_0x424572[_0x779d('0xb9')]['id']),'tags':_0x53ec4c||[]});return{'id':Number(_0x424572[_0x779d('0xb9')]['id']),'tags':_0x53ec4c||[]};});}})[_0x779d('0x32')](respondWithResult(_0xae01c3,null))[_0x779d('0xb8')](handleError(_0xae01c3,null));};exports[_0x779d('0xce')]=function(_0x96d505,_0x49a8b3,_0x894370){return db[_0x779d('0x3b')][_0x779d('0xbf')]({'where':{'id':_0x96d505[_0x779d('0xb9')]['id']}})[_0x779d('0x32')](handleEntityNotFound(_0x49a8b3,null))[_0x779d('0x32')](function(_0x1b7db5){if(_0x1b7db5){return _0x1b7db5[_0x779d('0xce')](_0x96d505[_0x779d('0x42')][_0x779d('0xc4')]);}})[_0x779d('0x32')](respondWithStatusCode(_0x49a8b3,null))[_0x779d('0xb8')](handleError(_0x49a8b3,null));};exports['download']=function(_0x419cbf,_0x4b617b){var _0x5f2ef8=moment()[_0x779d('0xcf')]()[_0x779d('0xb1')]();var _0xc69772=path[_0x779d('0xd0')](config[_0x779d('0xd1')],_0x779d('0xd2'),_0x779d('0xd3'),_0x779d('0xd4'));var _0x9d2725=path[_0x779d('0xd0')](config[_0x779d('0xd1')],_0x779d('0xd2'),'files','attachments');var _0x4281ff=path[_0x779d('0xd0')](_0xc69772,_0x5f2ef8);var _0x340dc3=util[_0x779d('0xd5')](_0x779d('0xd6'),_0x419cbf[_0x779d('0xb9')]['id'],_0x5f2ef8);var _0xa576cf=path['join'](_0xc69772,_0x340dc3);var _0x26b460=[];_0x26b460[_0x779d('0xb5')]({'model':db[_0x779d('0x72')],'as':'User','attributes':['id',_0x779d('0x2e')],'raw':!![]});_0x26b460[_0x779d('0xb5')]({'model':db[_0x779d('0xd7')],'as':_0x779d('0x67'),'attributes':['id',_0x779d('0xd8'),'lastName'],'raw':!![]});if(_0x419cbf[_0x779d('0x42')][_0x779d('0xd9')]){_0x26b460['push']({'model':db[_0x779d('0xda')],'as':'Attachment','raw':!![]});}var _0x5e0065=[{'model':db[_0x779d('0xc2')],'as':'Messages','attributes':['id',_0x779d('0x75'),_0x779d('0x7d'),_0x779d('0xdb'),_0x779d('0xdc'),'read'],'include':_0x26b460}];_0x5e0065[_0x779d('0xb5')]({'model':db['WhatsappAccount'],'as':'Account','attributes':['id',_0x779d('0x2a')]});_0x5e0065[_0x779d('0xb5')]({'model':db[_0x779d('0x72')],'as':_0x779d('0xdd'),'attributes':['id',_0x779d('0x2e')]});return db['WhatsappInteraction']['find']({'where':{'id':_0x419cbf['params']['id']},'include':_0x5e0065})[_0x779d('0x32')](handleEntityNotFound(_0x4b617b,null))[_0x779d('0x32')](function(_0x4e3927){if(_0x4e3927){var _0x549598=_0x4e3927[_0x779d('0xde')]({'plain':!![]});fs[_0x779d('0xdf')](_0x4281ff);var _0x1d2ae1={'channel':_0x779d('0xe0'),'account':_0x549598[_0x779d('0xe1')][_0x779d('0x2a')],'agent':_0x549598[_0x779d('0xdd')]?_0x549598[_0x779d('0xdd')][_0x779d('0x2e')]:_0x779d('0xe2'),'createdAt':moment(_0x549598['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x779d('0xb1')](),'closedAt':_0x549598[_0x779d('0x38')]?moment(_0x549598['closedAt'])[_0x779d('0xd5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x779d('0xb1')]():'','disposition':_0x549598['disposition'],'messages':_(_0x549598[_0x779d('0xe3')])[_0x779d('0x89')]({'secret':![]})[_0x779d('0x2d')](function(_0x1421e3){if(_0x1421e3['Attachment']){var _0x2b440d=path[_0x779d('0xd0')](_0x9d2725,_0x1421e3[_0x779d('0xda')]['basename']);if(fs[_0x779d('0xe4')](_0x2b440d)){fs[_0x779d('0xe5')](_0x2b440d)['pipe'](fs[_0x779d('0xe6')](path[_0x779d('0xd0')](_0x4281ff,_0x1421e3[_0x779d('0xda')][_0x779d('0xe7')])));}}return{'date':moment(_0x1421e3[_0x779d('0x7d')])['format'](_0x779d('0xc7'))[_0x779d('0xb1')](),'sender':_0x1421e3[_0x779d('0xdb')]===_0x779d('0xe8')?_0x1421e3[_0x779d('0x72')]?_0x1421e3[_0x779d('0x72')][_0x779d('0x2e')]:'System':_0x1421e3[_0x779d('0x67')][_0x779d('0xd8')]+(_0x1421e3[_0x779d('0x67')][_0x779d('0xe9')]?'\x20'+_0x1421e3[_0x779d('0x67')][_0x779d('0xe9')]:''),'body':_0x1421e3[_0x779d('0xda')]?_0x1421e3[_0x779d('0xda')]['basename']:_0x1421e3['body'],'direction':_0x1421e3[_0x779d('0xdb')]===_0x779d('0xe8')?'A':'C','secret':_0x1421e3[_0x779d('0xdc')],'read':_0x1421e3[_0x779d('0x85')],'attachment':_0x1421e3[_0x779d('0xda')]};})[_0x779d('0x63')]()};return ejs['renderFile'](path[_0x779d('0xd0')](config[_0x779d('0xd1')],_0x779d('0xd2'),_0x779d('0xea'),'downloadInteraction.ejs'),{'interaction':_0x1d2ae1})[_0x779d('0x32')](function(_0x1dc34c){var _0x34b9e1=path[_0x779d('0xd0')](_0x4281ff,_0x779d('0xeb')+_0x549598['id']+'-'+_0x5f2ef8+_0x779d('0xec'));var _0x1d8f53={'path':_0x34b9e1,'channel':'Whatsapp','interactionId':_0x549598['id']};return pdf[_0x779d('0xed')](_0x1dc34c,_0x1d8f53);})[_0x779d('0x32')](function(){return new BPromise(function(_0x3b0253,_0x2c7b94){zipdir(_0x4281ff,{'saveTo':_0xa576cf},function(_0x3f164a,_0x7290c8){if(_0x3f164a)return _0x2c7b94(_0x3f164a);return _0x3b0253(_0x7290c8);});})[_0x779d('0x32')](function(){return new BPromise(function(_0x448bb0,_0x5918a7){rimraf(_0x4281ff,function(_0x36bbf0){if(_0x36bbf0)_0x5918a7(_0x36bbf0);return _0x448bb0();});});})[_0x779d('0x32')](function(){return _0x4b617b['download'](_0xa576cf,_0x340dc3,function(_0x190e52){if(_0x190e52){console[_0x779d('0xee')](_0x779d('0xef'),_0x190e52);}else{fs['unlinkSync'](_0xa576cf);}});});});}else{return _0x4b617b[_0x779d('0x1a')](0xc8);}})[_0x779d('0xb8')](handleError(_0x4b617b,null));};
\ No newline at end of file
+var _0xb96d=['tools_tags','select','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','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','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','compact','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.phone\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','getWhatsappAccounts','isEmpty','i.WhatsappAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','all','show','params','includeAll','include','options','create','update','describe','WhatsappMessage','ids','getMessages','rawAttributes','nolimit','WhatsappInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','setTags','omit','spread','findAll','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','User','fullname','attachments','Attachment','direction','secret','Owner','get','mkdirSync','Account','disposition','Messages','existsSync','pipe','basename','out','System','firstName','lastName','renderFile','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','reject','then','destroy','error','stack','name','send','Users','map','split','Tags','push','TagIds','catch','answered','unmanaged','total','closed','waiting','talking','UserId','index','WhatsappInteraction','fieldName','type','key','model','keys','filters','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','field','color','from'];(function(_0x180067,_0x4df29a){var _0x5a82e0=function(_0x29f6f9){while(--_0x29f6f9){_0x180067['push'](_0x180067['shift']());}};_0x5a82e0(++_0x4df29a);}(_0xb96d,0x9e));var _0xdb96=function(_0x297eea,_0x5060be){_0x297eea=_0x297eea-0x0;var _0x1c42d2=_0xb96d[_0x297eea];return _0x1c42d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb96('0x0'));var zipdir=require(_0xdb96('0x1'));var jsonpatch=require(_0xdb96('0x2'));var rp=require('request-promise');var moment=require(_0xdb96('0x3'));var BPromise=require(_0xdb96('0x4'));var Mustache=require(_0xdb96('0x5'));var util=require('util');var path=require('path');var sox=require(_0xdb96('0x6'));var csv=require(_0xdb96('0x7'));var ejs=require(_0xdb96('0x8'));var fs=require('fs');var fs_extra=require(_0xdb96('0x9'));var _=require('lodash');var squel=require(_0xdb96('0xa'));var crypto=require(_0xdb96('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdb96('0xc'));var toCsv=require('to-csv');var querystring=require(_0xdb96('0xd'));var Papa=require(_0xdb96('0xe'));var Redis=require('ioredis');var authService=require(_0xdb96('0xf'));var qs=require(_0xdb96('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xdb96('0x11'));var hardwareService=require(_0xdb96('0x12'));var logger=require(_0xdb96('0x13'))(_0xdb96('0x14'));var utils=require('../../config/utils');var config=require(_0xdb96('0x15'));var licenseUtil=require(_0xdb96('0x16'));var db=require(_0xdb96('0x17'))['db'];config['redis']=_[_0xdb96('0x18')](config[_0xdb96('0x19')],{'host':_0xdb96('0x1a'),'port':0x18eb});var socket=require(_0xdb96('0x1b'))(new Redis(config[_0xdb96('0x19')]));require(_0xdb96('0x1c'))[_0xdb96('0x1d')](socket);function respondWithStatusCode(_0x116432,_0x12630d){_0x12630d=_0x12630d||0xcc;return function(_0x745780){if(_0x745780){return _0x116432[_0xdb96('0x1e')](_0x12630d);}return _0x116432[_0xdb96('0x1f')](_0x12630d)[_0xdb96('0x20')]();};}function respondWithResult(_0x596673,_0x3a94da){_0x3a94da=_0x3a94da||0xc8;return function(_0x2a766e){if(_0x2a766e){return _0x596673[_0xdb96('0x1f')](_0x3a94da)[_0xdb96('0x21')](_0x2a766e);}};}function respondWithFilteredResult(_0x56dfd9,_0x27fa8e){return function(_0x33ec8f){if(_0x33ec8f){var _0x244f66=typeof _0x27fa8e['offset']==='undefined'&&typeof _0x27fa8e[_0xdb96('0x22')]==='undefined';var _0x51a885=_0x33ec8f[_0xdb96('0x23')];var _0x195a01=_0x244f66?0x0:_0x27fa8e[_0xdb96('0x24')];var _0x11b7bd=_0x244f66?_0x33ec8f['count']:_0x27fa8e[_0xdb96('0x24')]+_0x27fa8e['limit'];var _0x22b3aa;if(_0x11b7bd>=_0x51a885){_0x11b7bd=_0x51a885;_0x22b3aa=0xc8;}else{_0x22b3aa=0xce;}_0x56dfd9[_0xdb96('0x1f')](_0x22b3aa);return _0x56dfd9['set'](_0xdb96('0x25'),_0x195a01+'-'+_0x11b7bd+'/'+_0x51a885)[_0xdb96('0x21')](_0x33ec8f);}return null;};}function patchUpdates(_0x3815f2){return function(_0x235b8f){try{jsonpatch[_0xdb96('0x26')](_0x235b8f,_0x3815f2,!![]);}catch(_0xca6ca0){return BPromise[_0xdb96('0x27')](_0xca6ca0);}return _0x235b8f['save']();};}function saveUpdates(_0x4c7558,_0x18d5a3){return function(_0x350115){if(_0x350115){return _0x350115['update'](_0x4c7558)[_0xdb96('0x28')](function(_0x2348d4){return _0x2348d4;});}return null;};}function removeEntity(_0x169425,_0x41eb65){return function(_0x2663c4){if(_0x2663c4){return _0x2663c4[_0xdb96('0x29')]()[_0xdb96('0x28')](function(){_0x169425[_0xdb96('0x1f')](0xcc)[_0xdb96('0x20')]();});}};}function handleEntityNotFound(_0x5efe23,_0x3e9c4e){return function(_0x3f2a43){if(!_0x3f2a43){_0x5efe23['sendStatus'](0x194);}return _0x3f2a43;};}function handleError(_0x372bca,_0x1f020c){_0x1f020c=_0x1f020c||0x1f4;return function(_0x59f07e){logger[_0xdb96('0x2a')](_0x59f07e[_0xdb96('0x2b')]);if(_0x59f07e[_0xdb96('0x2c')]){delete _0x59f07e[_0xdb96('0x2c')];}_0x372bca[_0xdb96('0x1f')](_0x1f020c)[_0xdb96('0x2d')](_0x59f07e);};}function getInteractionUsers(_0x301e5f,_0x5c0f15){return new BPromise(function(_0x37c180,_0xe1f111){try{if(_0x5c0f15[_0x301e5f['id']]){_0x301e5f[_0xdb96('0x2e')]=_[_0xdb96('0x2f')](_0x5c0f15[_0x301e5f['id']],function(_0x502912){return{'id':_0x502912['id'],'fullname':_0x502912['fullname']};});}}catch(_0x19c7c3){_0xe1f111(_0x19c7c3);}_0x37c180(_0x301e5f);});}function getInteractionTags(_0x245dfb,_0x562a13){return new BPromise(function(_0x3c8e36,_0x5db781){try{if(_0x245dfb['TagIds']){_0x245dfb['Tags']=[];_0x245dfb['TagIds'][_0xdb96('0x30')](',')['forEach'](function(_0x4dde91){_0x245dfb[_0xdb96('0x31')][_0xdb96('0x32')](_0x562a13[_0x4dde91]);});}delete _0x245dfb[_0xdb96('0x33')];}catch(_0x3360de){_0x5db781(_0x3360de);}_0x3c8e36(_0x245dfb);});}function updateWhatsappInteraction(_0x4a5933,_0x1a5a53,_0x9c0eac){return new BPromise(function(_0x29e9ad,_0x105207){return getInteractionUsers(_0x4a5933,_0x9c0eac)[_0xdb96('0x28')](function(_0x5a07de){return getInteractionTags(_0x5a07de,_0x1a5a53);})[_0xdb96('0x28')](function(_0x3bb38a){return getStateInteraction(_0x3bb38a);})[_0xdb96('0x28')](function(_0x35a5cb){_0x29e9ad(_0x35a5cb);})[_0xdb96('0x34')](function(_0x5aad1f){_0x105207(_0x5aad1f);});});}function getStateInteraction(_0x13bb07){return new BPromise(function(_0x4cdb70){_0x13bb07['waiting']=0x0;_0x13bb07['talking']=0x0;_0x13bb07[_0xdb96('0x35')]=0x0;_0x13bb07[_0xdb96('0x36')]=0x0;_0x13bb07[_0xdb96('0x37')]=0x0;if(!_0x13bb07[_0xdb96('0x38')]&&!_0x13bb07['UserId']){_0x13bb07[_0xdb96('0x39')]+=0x1;}if(!_0x13bb07['closed']&&_0x13bb07['UserId']){_0x13bb07[_0xdb96('0x3a')]+=0x1;if(_0x13bb07[_0xdb96('0x39')]){_0x13bb07[_0xdb96('0x39')]-=0x1;}}if(_0x13bb07[_0xdb96('0x38')]&&_0x13bb07['UserId']){_0x13bb07[_0xdb96('0x35')]+=0x1;if(_0x13bb07[_0xdb96('0x3a')]){_0x13bb07[_0xdb96('0x3a')]-=0x1;}}if(_0x13bb07[_0xdb96('0x38')]&&!_0x13bb07[_0xdb96('0x3b')]){_0x13bb07['unmanaged']+=0x1;if(_0x13bb07[_0xdb96('0x39')]){_0x13bb07['waiting']-=0x1;}}_0x13bb07[_0xdb96('0x37')]+=0x1;_0x4cdb70(_0x13bb07);});}exports[_0xdb96('0x3c')]=function(_0x34c9c3,_0x13ac52){var _0x1135e5={},_0x5bc2bd={},_0xb2ed0b={'count':0x0,'rows':[]};var _0x4da5b2=_[_0xdb96('0x2f')](db[_0xdb96('0x3d')]['rawAttributes'],function(_0x5f339c){return{'name':_0x5f339c[_0xdb96('0x3e')],'type':_0x5f339c[_0xdb96('0x3f')][_0xdb96('0x40')]};});_0x5bc2bd[_0xdb96('0x41')]=_[_0xdb96('0x2f')](_0x4da5b2,_0xdb96('0x2c'));_0x5bc2bd['query']=_[_0xdb96('0x42')](_0x34c9c3['query']);_0x5bc2bd[_0xdb96('0x43')]=_['intersection'](_0x5bc2bd['model'],_0x5bc2bd[_0xdb96('0x44')]);_0x1135e5['attributes']=_['intersection'](_0x5bc2bd['model'],qs['fields'](_0x34c9c3[_0xdb96('0x44')][_0xdb96('0x45')]));_0x1135e5['attributes']=_0x1135e5[_0xdb96('0x46')][_0xdb96('0x47')]?_0x1135e5[_0xdb96('0x46')]:_0x5bc2bd['model'];if(!_0x34c9c3[_0xdb96('0x44')][_0xdb96('0x48')]('nolimit')){_0x1135e5[_0xdb96('0x22')]=qs[_0xdb96('0x22')](_0x34c9c3[_0xdb96('0x44')]['limit']);_0x1135e5[_0xdb96('0x24')]=qs[_0xdb96('0x24')](_0x34c9c3[_0xdb96('0x44')]['offset']);}_0x1135e5[_0xdb96('0x49')]=qs['sort'](_0x34c9c3[_0xdb96('0x44')][_0xdb96('0x4a')]);_0x1135e5[_0xdb96('0x4b')]=qs['filters'](_[_0xdb96('0x4c')](_0x34c9c3['query'],_0x5bc2bd[_0xdb96('0x43')]),_0x4da5b2);var _0x4f1ec6=[];var _0x5cd616=squel['select']()[_0xdb96('0x4d')]('id')[_0xdb96('0x4d')](_0xdb96('0x2c'))[_0xdb96('0x4d')](_0xdb96('0x4e'))[_0xdb96('0x4f')](_0xdb96('0x50'));var _0x45a0cc=squel[_0xdb96('0x51')]()[_0xdb96('0x4d')](_0xdb96('0x52'))['field'](_0xdb96('0x53'))[_0xdb96('0x4d')](_0xdb96('0x54'))[_0xdb96('0x4f')](_0xdb96('0x55'),'ui')[_0xdb96('0x56')](_0xdb96('0x57'),'u','u.id\x20=\x20ui.UserId');var _0x550f43=squel[_0xdb96('0x51')]()[_0xdb96('0x4f')](_0xdb96('0x58'),'i')[_0xdb96('0x56')](_0xdb96('0x59'),'c',_0xdb96('0x5a'))['left_join'](_0xdb96('0x57'),'o',_0xdb96('0x5b'))['left_join'](_0xdb96('0x5c'),'a','a.id\x20=\x20i.WhatsappAccountId')['left_join']('whatsapp_messages','me',_0xdb96('0x5d'))['left_join'](_0xdb96('0x5e'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0xdb96('0x56')](_0xdb96('0x50'),'t',_0xdb96('0x5f'));var _0x3d2066=squel[_0xdb96('0x60')]();var _0x2f025b=[];var _0x321738=squel[_0xdb96('0x60')]();var _0x14b38d;if(_0x34c9c3['query'][_0xdb96('0x61')]){_0x14b38d=as[_0xdb96('0x62')](_0x34c9c3[_0xdb96('0x44')][_0xdb96('0x61')]);var _0x2181be=_0x14b38d[_0xdb96('0x63')];for(var _0x3b4998=0x0;_0x3b4998<_0x14b38d[_0xdb96('0x64')][_0xdb96('0x47')];_0x3b4998++){var _0x547be9=_0x14b38d[_0xdb96('0x64')][_0x3b4998];var _0x15558e='i';var _0x326442=_[_0xdb96('0x65')](_0x4da5b2,['name',_0x547be9[_0xdb96('0x4d')]]);if(!_0x326442){switch(_0x547be9[_0xdb96('0x4d')]){case _0xdb96('0x66'):if(_0x547be9[_0xdb96('0x67')]==0x1){_0x550f43[_0xdb96('0x68')]('`'+_0x547be9[_0xdb96('0x4d')]+'`\x20=\x200');}else{_0x550f43[_0xdb96('0x68')]('`'+_0x547be9['field']+'`\x20>\x200');}break;case _0xdb96('0x69'):if(_0x547be9[_0xdb96('0x6a')]==='$substring'){if(_0x547be9['value'][_0xdb96('0x30')]('\x20')[_0xdb96('0x47')]>0x1){_0x3d2066[_0x2181be](_0xdb96('0x6b'),qs[_0xdb96('0x6c')](_0x547be9[_0xdb96('0x67')]),null);}else{var _0x4c0c6b='%'+_0x547be9[_0xdb96('0x67')]+'%';_0x3d2066[_0x2181be](_0xdb96('0x6d'),_0x4c0c6b,_0x4c0c6b,_0x4c0c6b);}}else{_0x326442=_['find'](_0x4da5b2,[_0xdb96('0x2c'),'ContactId']);_0x547be9['field']=_0xdb96('0x6e');_0x397e80=as[_0xdb96('0x6f')](_0x15558e,_0x326442[_0xdb96('0x3f')],_0x547be9);_0x3d2066[_0x2181be](_0x397e80[_0xdb96('0x70')],_0x397e80['value'][_0xdb96('0x71')],_0x397e80[_0xdb96('0x67')][_0xdb96('0x20')]);}break;case _0xdb96('0x72'):var _0x53907e=_0x547be9['value'][_0xdb96('0x30')](',')[_0xdb96('0x2f')](function(_0x1252cb){return Number(_0x1252cb);});_0x53907e[_0xdb96('0x73')](function(_0x4f8c36){_0x321738['or'](_0xdb96('0x74'),'%,'+_0x4f8c36+',%');});_0x2f025b=_['union'](_0x2f025b,_0x53907e);break;case'User':if(_0x547be9[_0xdb96('0x6a')]===_0xdb96('0x75')){_0x3d2066[_0x2181be](_0xdb96('0x76'),'%'+_0x547be9['value']+'%',null);}else{_0x326442=_[_0xdb96('0x65')](_0x4da5b2,['name',_0xdb96('0x3b')]);_0x547be9[_0xdb96('0x4d')]=_0xdb96('0x3b');_0x397e80=as[_0xdb96('0x6f')](_0x15558e,_0x326442[_0xdb96('0x3f')],_0x547be9);_0x3d2066[_0x2181be](_0x397e80[_0xdb96('0x70')],_0x397e80[_0xdb96('0x67')][_0xdb96('0x71')],_0x397e80[_0xdb96('0x67')][_0xdb96('0x20')]);}break;case _0xdb96('0x77'):_0x397e80=as[_0xdb96('0x6f')]('me',null,_0x547be9);_0x3d2066[_0x2181be](_0x397e80[_0xdb96('0x70')],_0x397e80[_0xdb96('0x67')][_0xdb96('0x71')],_0x397e80[_0xdb96('0x67')][_0xdb96('0x20')]);break;}}else{var _0x397e80=as['buildExpression'](_0x15558e,_0x326442[_0xdb96('0x3f')],_0x547be9);_0x3d2066[_0x2181be](_0x397e80[_0xdb96('0x70')],_0x397e80[_0xdb96('0x67')][_0xdb96('0x71')],_0x397e80[_0xdb96('0x67')][_0xdb96('0x20')]);}}}else{var _0xe685b9=_(_0x34c9c3[_0xdb96('0x44')])['keys']()[_0xdb96('0x2f')](function(_0x409b5a){return _['some'](_0x4da5b2,[_0xdb96('0x2c'),_0x409b5a])?_0x409b5a:undefined;})[_0xdb96('0x78')]()[_0xdb96('0x67')]();if(!_['isEmpty'](_0xe685b9)){_0xe685b9[_0xdb96('0x73')](function(_0x5c3d47){if(_0x5c3d47===_0xdb96('0x79')){_0x550f43[_0xdb96('0x4b')](_0xdb96('0x7a'),[][_0xdb96('0x7b')](_0x34c9c3[_0xdb96('0x44')][_0x5c3d47]));}else if(_0x5c3d47===_0xdb96('0x7c')){var _0x38b197=JSON['parse'](_0x34c9c3[_0xdb96('0x44')][_0x5c3d47])[_0xdb96('0x7d')];var _0x2dc4fd=JSON[_0xdb96('0x7e')](_0x34c9c3[_0xdb96('0x44')][_0x5c3d47])[_0xdb96('0x7f')];_0x550f43['where'](_0xdb96('0x80'),_0x38b197,_0x2dc4fd);}else{if(_0x34c9c3[_0xdb96('0x44')][_0x5c3d47]===_0xdb96('0x81')){_0x550f43['where']('i.'+_0x5c3d47+'\x20IS\x20NULL');}else{_0x550f43[_0xdb96('0x4b')]('i.'+_0x5c3d47+_0xdb96('0x82'),_0x34c9c3[_0xdb96('0x44')][_0x5c3d47]);}}});}if(_0x34c9c3[_0xdb96('0x44')][_0xdb96('0x83')]){if(_0x34c9c3['query'][_0xdb96('0x83')]==0x1){_0x550f43[_0xdb96('0x68')]('`unreadMessages`\x20=\x200');}else{_0x550f43[_0xdb96('0x68')](_0xdb96('0x84'));}}if(_0x34c9c3[_0xdb96('0x44')][_0xdb96('0x85')]){_0x2f025b=_[_0xdb96('0x86')](_0x34c9c3[_0xdb96('0x44')]['tag'])?_0x34c9c3[_0xdb96('0x44')]['tag']:new Array(_0x34c9c3[_0xdb96('0x44')]['tag']);_0x2f025b[_0xdb96('0x73')](function(_0x40ad23){_0x321738['or'](_0xdb96('0x74'),'%,'+_0x40ad23+',%');});}if(_0x34c9c3[_0xdb96('0x44')][_0xdb96('0x87')]){var _0x231a89=_0x34c9c3[_0xdb96('0x44')][_0xdb96('0x87')][_0xdb96('0x88')]('\x5c','\x5c\x5c')[_0xdb96('0x88')](/'/g,'\x27\x27');if(qs[_0xdb96('0x89')](_0x231a89)){_0x3d2066['or']('i.id\x20LIKE\x20?',_0x231a89+'%')['or'](_0xdb96('0x8a'),_0x231a89+'%');}else{_0x3d2066['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xdb96('0x6c')](_0x231a89))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x231a89+'%');}}}_0x550f43[_0xdb96('0x4b')](_0x3d2066);_0x550f43[_0xdb96('0x8b')](_0xdb96('0x8c'));var _0x27f3f5={'type':db[_0xdb96('0x8d')][_0xdb96('0x8e')][_0xdb96('0x8f')],'raw':!![]};var _0x5b6531=_0x550f43[_0xdb96('0x90')]();_0x5b6531['field'](_0xdb96('0x8c'));_0x5b6531[_0xdb96('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xdb96('0x66'));if(_0x1135e5['order']){_0x1135e5[_0xdb96('0x49')]['forEach'](function(_0xf674b6){var _0x1cf5d8=_0xf674b6[0x0]===_0xdb96('0x91')?_0xf674b6[0x0]:'i.'+_0xf674b6[0x0];_0x550f43[_0xdb96('0x49')](_0x1cf5d8,_0xf674b6[0x1]===_0xdb96('0x92')?![]:!![]);});}if(!_['isEmpty'](_0x2f025b)){_0x550f43['having'](_0x321738);_0x5b6531[_0xdb96('0x4b')](_0xdb96('0x93'),_0x2f025b);}BPromise[_0xdb96('0x94')]()[_0xdb96('0x28')](function(){if(!_0x14b38d){if(_0x34c9c3[_0xdb96('0x44')][_0xdb96('0x79')])return;_0x5b6531[_0xdb96('0x4b')](_0xdb96('0x95'));_0x550f43[_0xdb96('0x4b')](_0xdb96('0x95'));return;}if(_0x34c9c3[_0xdb96('0x96')]['role']!=='agent')return;return _0x34c9c3['user'][_0xdb96('0x97')]({'attributes':['id'],'raw':!![]})[_0xdb96('0x28')](function(_0x2e027b){if(_[_0xdb96('0x98')](_0x2e027b)){_0x5b6531[_0xdb96('0x4b')](_0xdb96('0x99'));_0x550f43[_0xdb96('0x4b')](_0xdb96('0x99'));}else{_0x5b6531['where'](_0xdb96('0x7a'),_[_0xdb96('0x2f')](_0x2e027b,'id'));_0x550f43[_0xdb96('0x4b')](_0xdb96('0x7a'),_['map'](_0x2e027b,'id'));}});})[_0xdb96('0x28')](function(){if(_0x34c9c3[_0xdb96('0x96')]['role']===_0xdb96('0x9a')&&!_0x14b38d&&!_0x34c9c3[_0xdb96('0x44')][_0xdb96('0x79')])return[];return db[_0xdb96('0x9b')][_0xdb96('0x44')](_0x5b6531[_0xdb96('0x9c')](),_0x27f3f5);})['then'](function(_0xea639b){_0xb2ed0b[_0xdb96('0x23')]=_0xea639b['length'];if(_0xb2ed0b[_0xdb96('0x23')]===0x0)return[];return db[_0xdb96('0x9b')][_0xdb96('0x44')](_0x5cd616[_0xdb96('0x9c')](),_0x27f3f5)['then'](function(_0x1c9a15){_0x4f1ec6=_[_0xdb96('0x9d')](_0x1c9a15,'id');_0x27f3f5=_[_0xdb96('0x9e')](_0x27f3f5,{'model':db[_0xdb96('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x34c9c3[_0xdb96('0x44')]['fields']){_0x1135e5['attributes'][_0xdb96('0x73')](function(_0x42a72e){_0x550f43[_0xdb96('0x4d')]('i.'+_0x42a72e);});}else{_0x550f43[_0xdb96('0x4d')](_0xdb96('0x9f'),_0xdb96('0x66'));_0x550f43['field'](_0xdb96('0xa0'),'Account.key');_0x550f43['field'](_0xdb96('0xa1'),_0xdb96('0xa2'));_0x550f43[_0xdb96('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',_0xdb96('0x91'));_0x550f43['field']('i.*');_0x550f43[_0xdb96('0x4d')](_0xdb96('0xa3'),_0xdb96('0xa4'));_0x550f43[_0xdb96('0x4d')](_0xdb96('0xa5'),'Contact.lastName');_0x550f43[_0xdb96('0x4d')](_0xdb96('0xa6'),_0xdb96('0xa7'));_0x550f43[_0xdb96('0x4d')](_0xdb96('0xa8'),_0xdb96('0xa9'));_0x550f43[_0xdb96('0x4d')](_0xdb96('0xaa'),'Contact.mobile');_0x550f43[_0xdb96('0x4d')](_0xdb96('0xab'),_0xdb96('0xac'));_0x550f43[_0xdb96('0x4d')](_0xdb96('0xad'),_0xdb96('0xae'));_0x550f43[_0xdb96('0x4d')](_0xdb96('0xaf'),_0xdb96('0xb0'));_0x550f43[_0xdb96('0x4d')](_0xdb96('0xb1'),'TagIds');}if(_0x1135e5[_0xdb96('0x22')])_0x550f43[_0xdb96('0x22')](_0x1135e5['limit']);if(_0x1135e5[_0xdb96('0x24')])_0x550f43[_0xdb96('0x24')](_0x1135e5['offset']);return db[_0xdb96('0x9b')][_0xdb96('0x44')](_0x550f43[_0xdb96('0x9c')](),_0x27f3f5);})[_0xdb96('0x28')](function(_0x174f9c){if(_0x174f9c[_0xdb96('0x47')]>0x0)_0x45a0cc[_0xdb96('0x4b')](_0xdb96('0xb2'),_[_0xdb96('0x2f')](_0x174f9c,'id'));return db[_0xdb96('0x9b')][_0xdb96('0x44')](_0x45a0cc[_0xdb96('0x9c')](),_0x27f3f5)[_0xdb96('0x28')](function(_0x23b3e3){var _0x1c1925=_['groupBy'](_0x23b3e3,'WhatsappInteractionId');var _0x291f95=[];_0x174f9c['forEach'](function(_0x18824b){_0x291f95[_0xdb96('0x32')](updateWhatsappInteraction(_0x18824b,_0x4f1ec6,_0x1c1925));});return BPromise[_0xdb96('0xb3')](_0x291f95);});});})[_0xdb96('0x28')](function(_0x4a2d41){_0xb2ed0b['rows']=_0x4a2d41;return _0xb2ed0b;})[_0xdb96('0x28')](respondWithFilteredResult(_0x13ac52,_0x1135e5))[_0xdb96('0x34')](handleError(_0x13ac52,null));};exports[_0xdb96('0xb4')]=function(_0x20e7f0,_0x453274){var _0x21b124={'raw':![],'where':{'id':_0x20e7f0[_0xdb96('0xb5')]['id']}},_0x24328a={};_0x24328a[_0xdb96('0x41')]=_[_0xdb96('0x42')](db[_0xdb96('0x3d')]['rawAttributes']);_0x24328a[_0xdb96('0x44')]=_['keys'](_0x20e7f0[_0xdb96('0x44')]);_0x24328a[_0xdb96('0x43')]=_['intersection'](_0x24328a[_0xdb96('0x41')],_0x24328a[_0xdb96('0x44')]);_0x21b124[_0xdb96('0x46')]=_['intersection'](_0x24328a['model'],qs[_0xdb96('0x45')](_0x20e7f0[_0xdb96('0x44')]['fields']));_0x21b124['attributes']=_0x21b124[_0xdb96('0x46')]['length']?_0x21b124['attributes']:_0x24328a['model'];if(_0x20e7f0[_0xdb96('0x44')][_0xdb96('0xb6')]){_0x21b124[_0xdb96('0xb7')]=[{'all':!![]}];}_0x21b124=_[_0xdb96('0x9e')]({},_0x21b124,_0x20e7f0[_0xdb96('0xb8')]);return db['WhatsappInteraction'][_0xdb96('0x65')](_0x21b124)['then'](handleEntityNotFound(_0x453274,null))[_0xdb96('0x28')](respondWithResult(_0x453274,null))[_0xdb96('0x34')](handleError(_0x453274,null));};exports['create']=function(_0x50d65b,_0x10f32f){return db['WhatsappInteraction'][_0xdb96('0xb9')](_0x50d65b[_0xdb96('0x77')],{})[_0xdb96('0x28')](respondWithResult(_0x10f32f,0xc9))[_0xdb96('0x34')](handleError(_0x10f32f,null));};exports[_0xdb96('0xba')]=function(_0x54975e,_0x5dd610){if(_0x54975e[_0xdb96('0x77')]['id']){delete _0x54975e['body']['id'];}return db[_0xdb96('0x3d')][_0xdb96('0x65')]({'where':{'id':_0x54975e['params']['id']}})[_0xdb96('0x28')](handleEntityNotFound(_0x5dd610,null))['then'](saveUpdates(_0x54975e[_0xdb96('0x77')],null))[_0xdb96('0x28')](respondWithResult(_0x5dd610,null))['catch'](handleError(_0x5dd610,null));};exports[_0xdb96('0x29')]=function(_0xe0a5a5,_0x520794){return db[_0xdb96('0x3d')]['find']({'where':{'id':_0xe0a5a5[_0xdb96('0xb5')]['id']}})[_0xdb96('0x28')](handleEntityNotFound(_0x520794,null))[_0xdb96('0x28')](removeEntity(_0x520794,null))[_0xdb96('0x34')](handleError(_0x520794,null));};exports['describe']=function(_0x3a299e,_0x43c43c){return db['WhatsappInteraction'][_0xdb96('0xbb')]()[_0xdb96('0x28')](respondWithResult(_0x43c43c,null))[_0xdb96('0x34')](handleError(_0x43c43c,null));};exports['addMessage']=function(_0x1f9e83,_0x6c13e7,_0x58db41){return db[_0xdb96('0xbc')][_0xdb96('0x65')]({'where':{'id':_0x1f9e83[_0xdb96('0xb5')]['id']}})[_0xdb96('0x28')](handleEntityNotFound(_0x6c13e7,null))[_0xdb96('0x28')](function(_0x37124f){if(_0x37124f){return _0x37124f['addMessage'](_0x1f9e83[_0xdb96('0x77')]['ids'],_['omit'](_0x1f9e83['body'],[_0xdb96('0xbd'),'id'])||{});}})[_0xdb96('0x28')](respondWithResult(_0x6c13e7,null))[_0xdb96('0x34')](handleError(_0x6c13e7,null));};exports[_0xdb96('0xbe')]=function(_0x422cbc,_0x28882e,_0x4f6dc6){var _0x295731={'raw':![],'where':{}};var _0x32c232={};var _0x43655d={'count':0x0,'rows':[]};return db['WhatsappInteraction']['findOne']({'where':{'id':_0x422cbc[_0xdb96('0xb5')]['id']}})[_0xdb96('0x28')](handleEntityNotFound(_0x28882e,null))[_0xdb96('0x28')](function(_0x591149){if(_0x591149){_0x32c232['model']=_[_0xdb96('0x42')](db[_0xdb96('0xbc')][_0xdb96('0xbf')]);_0x32c232['query']=_[_0xdb96('0x42')](_0x422cbc['query']);_0x32c232[_0xdb96('0x43')]=_['intersection'](_0x32c232[_0xdb96('0x41')],_0x32c232[_0xdb96('0x44')]);_0x295731[_0xdb96('0x46')]=_['intersection'](_0x32c232[_0xdb96('0x41')],qs['fields'](_0x422cbc[_0xdb96('0x44')]['fields']));_0x295731[_0xdb96('0x46')]=_0x295731[_0xdb96('0x46')][_0xdb96('0x47')]?_0x295731['attributes']:_0x32c232[_0xdb96('0x41')];if(!_0x422cbc[_0xdb96('0x44')][_0xdb96('0x48')](_0xdb96('0xc0'))){_0x295731[_0xdb96('0x22')]=qs[_0xdb96('0x22')](_0x422cbc[_0xdb96('0x44')]['limit']);_0x295731[_0xdb96('0x24')]=qs[_0xdb96('0x24')](_0x422cbc[_0xdb96('0x44')]['offset']);}_0x295731['order']=qs[_0xdb96('0x4a')](_0x422cbc[_0xdb96('0x44')]['sort']);_0x295731['where']=qs[_0xdb96('0x43')](_[_0xdb96('0x4c')](_0x422cbc[_0xdb96('0x44')],_0x32c232[_0xdb96('0x43')]));_0x295731['where'][_0xdb96('0xc1')]=_0x591149['id'];if(_0x422cbc['query'][_0xdb96('0x87')]){_0x295731['where']=_[_0xdb96('0x9e')](_0x295731[_0xdb96('0x4b')],{'$or':_[_0xdb96('0x2f')](_0x295731[_0xdb96('0x46')],function(_0x500cae){var _0x18da7c={};_0x18da7c[_0x500cae]={'$like':'%'+_0x422cbc[_0xdb96('0x44')][_0xdb96('0x87')]+'%'};return _0x18da7c;})});}if(_0x422cbc[_0xdb96('0x44')][_0xdb96('0x7d')]){var _0x57d1ff=_0x422cbc[_0xdb96('0x44')][_0xdb96('0x7d')]['split'](',');var _0x5c43db={};_0x5c43db[_0x57d1ff[0x0]]={'$gte':moment(_0x57d1ff[0x1])[_0xdb96('0xc2')](_0xdb96('0xc3'))};_0x295731[_0xdb96('0x4b')]=_['merge'](_0x295731['where'],_0x5c43db);}_0x295731=_['merge']({},_0x295731,_0x422cbc[_0xdb96('0xb8')]);return db[_0xdb96('0xbc')][_0xdb96('0x23')]({'where':_0x295731[_0xdb96('0x4b')]})['then'](function(_0x13fa25){_0x43655d[_0xdb96('0x23')]=_0x13fa25;if(_0x422cbc[_0xdb96('0x44')][_0xdb96('0xb6')]){_0x295731[_0xdb96('0xb7')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x295731);})[_0xdb96('0x28')](function(_0x586b3f){_0x43655d['rows']=_0x586b3f;return _0x43655d;});}})[_0xdb96('0x28')](respondWithFilteredResult(_0x28882e,_0x295731))['catch'](handleError(_0x28882e,null));};exports['addTags']=function(_0x51708b,_0x4e0a11,_0x2b5822){return db[_0xdb96('0x3d')]['find']({'where':{'id':_0x51708b[_0xdb96('0xb5')]['id']}})[_0xdb96('0x28')](handleEntityNotFound(_0x4e0a11,null))[_0xdb96('0x28')](function(_0xbbb1f0){if(_0xbbb1f0){return _0xbbb1f0[_0xdb96('0xc4')](_0x51708b[_0xdb96('0x77')]['ids'],_[_0xdb96('0xc5')](_0x51708b[_0xdb96('0x77')],['ids','id'])||{})[_0xdb96('0xc6')](function(){return db['Tag'][_0xdb96('0xc7')]({'attributes':['id','name','color'],'where':{'id':_0x51708b[_0xdb96('0x77')]['ids']}});})[_0xdb96('0x28')](function(_0xfd9ac8){socket[_0xdb96('0xc8')](_0xdb96('0xc9'),{'id':Number(_0x51708b[_0xdb96('0xb5')]['id']),'tags':_0xfd9ac8||[]});return{'id':Number(_0x51708b[_0xdb96('0xb5')]['id']),'tags':_0xfd9ac8||[]};});}})[_0xdb96('0x28')](respondWithResult(_0x4e0a11,null))['catch'](handleError(_0x4e0a11,null));};exports[_0xdb96('0xca')]=function(_0xa64cbe,_0x115ccc,_0xa8e38e){return db['WhatsappInteraction'][_0xdb96('0x65')]({'where':{'id':_0xa64cbe[_0xdb96('0xb5')]['id']}})[_0xdb96('0x28')](handleEntityNotFound(_0x115ccc,null))[_0xdb96('0x28')](function(_0x13861e){if(_0x13861e){return _0x13861e['removeTags'](_0xa64cbe['query'][_0xdb96('0xbd')]);}})[_0xdb96('0x28')](respondWithStatusCode(_0x115ccc,null))[_0xdb96('0x34')](handleError(_0x115ccc,null));};exports[_0xdb96('0xcb')]=function(_0x50df79,_0x889e9){var _0x47324=moment()[_0xdb96('0xcc')]()[_0xdb96('0x9c')]();var _0x47325b=path[_0xdb96('0xcd')](config[_0xdb96('0xce')],_0xdb96('0xcf'),'files',_0xdb96('0xd0'));var _0x413f79=path[_0xdb96('0xcd')](config['root'],'server',_0xdb96('0xd1'),'attachments');var _0x54d9bf=path[_0xdb96('0xcd')](_0x47325b,_0x47324);var _0x135988=util[_0xdb96('0xc2')]('transcript-%d-%s.zip',_0x50df79[_0xdb96('0xb5')]['id'],_0x47324);var _0x18e198=path[_0xdb96('0xcd')](_0x47325b,_0x135988);var _0x23361f=[];_0x23361f[_0xdb96('0x32')]({'model':db[_0xdb96('0xd2')],'as':'User','attributes':['id',_0xdb96('0xd3')],'raw':!![]});_0x23361f['push']({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x50df79['query'][_0xdb96('0xd4')]){_0x23361f[_0xdb96('0x32')]({'model':db[_0xdb96('0xd5')],'as':_0xdb96('0xd5'),'raw':!![]});}var _0x22ca0c=[{'model':db[_0xdb96('0xbc')],'as':'Messages','attributes':['id',_0xdb96('0x77'),'createdAt',_0xdb96('0xd6'),_0xdb96('0xd7'),_0xdb96('0x83')],'include':_0x23361f}];_0x22ca0c['push']({'model':db['WhatsappAccount'],'as':'Account','attributes':['id',_0xdb96('0x2c')]});_0x22ca0c[_0xdb96('0x32')]({'model':db[_0xdb96('0xd2')],'as':_0xdb96('0xd8'),'attributes':['id',_0xdb96('0xd3')]});return db[_0xdb96('0x3d')]['find']({'where':{'id':_0x50df79['params']['id']},'include':_0x22ca0c})[_0xdb96('0x28')](handleEntityNotFound(_0x889e9,null))[_0xdb96('0x28')](function(_0x2349f5){if(_0x2349f5){var _0xc065ec=_0x2349f5[_0xdb96('0xd9')]({'plain':!![]});fs[_0xdb96('0xda')](_0x54d9bf);var _0xb853c1={'channel':'Whatsapp','account':_0xc065ec[_0xdb96('0xdb')][_0xdb96('0x2c')],'agent':_0xc065ec[_0xdb96('0xd8')]?_0xc065ec[_0xdb96('0xd8')][_0xdb96('0xd3')]:'N.A.','createdAt':moment(_0xc065ec[_0xdb96('0x7c')])[_0xdb96('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0xdb96('0x9c')](),'closedAt':_0xc065ec[_0xdb96('0x38')]?moment(_0xc065ec['closedAt'])[_0xdb96('0xc2')](_0xdb96('0xc3'))[_0xdb96('0x9c')]():'','disposition':_0xc065ec[_0xdb96('0xdc')],'messages':_(_0xc065ec[_0xdb96('0xdd')])['filter']({'secret':![]})[_0xdb96('0x2f')](function(_0x3a1979){if(_0x3a1979[_0xdb96('0xd5')]){var _0x1e5f25=path[_0xdb96('0xcd')](_0x413f79,_0x3a1979[_0xdb96('0xd5')]['basename']);if(fs[_0xdb96('0xde')](_0x1e5f25)){fs['createReadStream'](_0x1e5f25)[_0xdb96('0xdf')](fs['createWriteStream'](path['join'](_0x54d9bf,_0x3a1979[_0xdb96('0xd5')][_0xdb96('0xe0')])));}}return{'date':moment(_0x3a1979[_0xdb96('0x7c')])[_0xdb96('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x3a1979[_0xdb96('0xd6')]===_0xdb96('0xe1')?_0x3a1979['User']?_0x3a1979[_0xdb96('0xd2')][_0xdb96('0xd3')]:_0xdb96('0xe2'):_0x3a1979[_0xdb96('0x69')][_0xdb96('0xe3')]+(_0x3a1979['Contact'][_0xdb96('0xe4')]?'\x20'+_0x3a1979['Contact'][_0xdb96('0xe4')]:''),'body':_0x3a1979[_0xdb96('0xd5')]?_0x3a1979[_0xdb96('0xd5')]['basename']:_0x3a1979[_0xdb96('0x77')],'direction':_0x3a1979[_0xdb96('0xd6')]==='out'?'A':'C','secret':_0x3a1979[_0xdb96('0xd7')],'read':_0x3a1979[_0xdb96('0x83')],'attachment':_0x3a1979[_0xdb96('0xd5')]};})[_0xdb96('0x67')]()};return ejs[_0xdb96('0xe5')](path[_0xdb96('0xcd')](config[_0xdb96('0xce')],_0xdb96('0xcf'),'views',_0xdb96('0xe6')),{'interaction':_0xb853c1})[_0xdb96('0x28')](function(_0x118135){var _0x1cbf6b=path[_0xdb96('0xcd')](_0x54d9bf,_0xdb96('0xe7')+_0xc065ec['id']+'-'+_0x47324+_0xdb96('0xe8'));var _0x10069d={'path':_0x1cbf6b,'channel':_0xdb96('0xe9'),'interactionId':_0xc065ec['id']};return pdf[_0xdb96('0xea')](_0x118135,_0x10069d);})[_0xdb96('0x28')](function(){return new BPromise(function(_0x1e9736,_0x33a33b){zipdir(_0x54d9bf,{'saveTo':_0x18e198},function(_0x315f5b,_0x18cae5){if(_0x315f5b)return _0x33a33b(_0x315f5b);return _0x1e9736(_0x18cae5);});})[_0xdb96('0x28')](function(){return new BPromise(function(_0x554798,_0xf7efb7){rimraf(_0x54d9bf,function(_0x49f041){if(_0x49f041)_0xf7efb7(_0x49f041);return _0x554798();});});})[_0xdb96('0x28')](function(){return _0x889e9[_0xdb96('0xcb')](_0x18e198,_0x135988,function(_0x128616){if(_0x128616){console[_0xdb96('0xeb')](_0xdb96('0xec'),_0x128616);}else{fs[_0xdb96('0xed')](_0x18e198);}});});});}else{return _0x889e9[_0xdb96('0x1e')](0xc8);}})[_0xdb96('0x34')](handleError(_0x889e9,null));};
\ No newline at end of file
index 32a44fe..8f9e5a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1aa=['getUsers','Users','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','remove'];(function(_0x16e95e,_0x315da2){var _0x489d02=function(_0x47d883){while(--_0x47d883){_0x16e95e['push'](_0x16e95e['shift']());}};_0x489d02(++_0x315da2);}(_0xa1aa,0x19b));var _0xaa1a=function(_0x3049f1,_0x1594e2){_0x3049f1=_0x3049f1-0x0;var _0x2b175a=_0xa1aa[_0x3049f1];return _0x2b175a;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xaa1a('0x0'))['db'][_0xaa1a('0x1')];var WhatsappMessage=require(_0xaa1a('0x0'))['db'][_0xaa1a('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xaa1a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xaa1a('0x4')};function emitEvent(_0x35abf4){return function(_0x4a2e4d,_0x26dfcd,_0x370a4e){_0x4a2e4d[_0xaa1a('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3c1a12){_0x4a2e4d['setDataValue'](_0xaa1a('0x6'),_0x3c1a12['map'](function(_0x3ee428){return{'id':_0x3ee428['id']};}));return WhatsappMessage[_0xaa1a('0x7')]({'where':{'WhatsappInteractionId':_0x4a2e4d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5aa4ce){_0x4a2e4d[_0xaa1a('0x8')](_0xaa1a('0x9'),_0x5aa4ce[_0xaa1a('0xa')]);WhatsappInteractionEvents[_0xaa1a('0xb')](_0x35abf4+':'+_0x4a2e4d['id'],_0x4a2e4d);WhatsappInteractionEvents['emit'](_0x35abf4,_0x4a2e4d);_0x370a4e(null);})[_0xaa1a('0xc')](_0x370a4e(null));};}for(var e in events){if(events[_0xaa1a('0xd')](e)){var event=events[e];WhatsappInteraction[_0xaa1a('0xe')](e,emitEvent(event));}}module[_0xaa1a('0xf')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0xe600=['setDataValue','Users','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','then'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0xe600,0x159));var _0x0e60=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe600[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x0e60('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x0e60('0x0'))['db'][_0x0e60('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x0e60('0x2')](0x0);var events={'afterCreate':_0x0e60('0x3'),'afterUpdate':_0x0e60('0x4'),'afterDestroy':_0x0e60('0x5')};function emitEvent(_0x1838bf){return function(_0x1ca309,_0xc730ea,_0x2f9c33){_0x1ca309['getUsers']({'attributes':['id'],'raw':!![]})[_0x0e60('0x6')](function(_0x497a61){_0x1ca309[_0x0e60('0x7')](_0x0e60('0x8'),_0x497a61['map'](function(_0x3577c5){return{'id':_0x3577c5['id']};}));return WhatsappMessage[_0x0e60('0x9')]({'where':{'WhatsappInteractionId':_0x1ca309['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0e60('0x6')](function(_0x420063){_0x1ca309[_0x0e60('0x7')](_0x0e60('0xa'),_0x420063['length']);WhatsappInteractionEvents[_0x0e60('0xb')](_0x1838bf+':'+_0x1ca309['id'],_0x1ca309);WhatsappInteractionEvents[_0x0e60('0xb')](_0x1838bf,_0x1ca309);_0x2f9c33(null);})[_0x0e60('0xc')](_0x2f9c33(null));};}for(var e in events){if(events[_0x0e60('0xd')](e)){var event=events[e];WhatsappInteraction[_0x0e60('0xe')](e,emitEvent(event));}}module[_0x0e60('0xf')]=WhatsappInteractionEvents;
\ No newline at end of file
index f0bfee1..f2291f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x373e=['api','moment','bluebird','request-promise','path','rimraf','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','lodash','util','../../config/logger'];(function(_0x2b0a8e,_0x491846){var _0x2f0755=function(_0x19b617){while(--_0x19b617){_0x2b0a8e['push'](_0x2b0a8e['shift']());}};_0x2f0755(++_0x491846);}(_0x373e,0x18d));var _0xe373=function(_0x2839a6,_0x49783a){_0x2839a6=_0x2839a6-0x0;var _0x42705a=_0x373e[_0x2839a6];return _0x42705a;};'use strict';var _=require(_0xe373('0x0'));var util=require(_0xe373('0x1'));var logger=require(_0xe373('0x2'))(_0xe373('0x3'));var moment=require(_0xe373('0x4'));var BPromise=require(_0xe373('0x5'));var rp=require(_0xe373('0x6'));var fs=require('fs');var path=require(_0xe373('0x7'));var rimraf=require(_0xe373('0x8'));var config=require('../../config/environment');var attributes=require(_0xe373('0x9'));module['exports']=function(_0x282a25,_0x4350e7){return _0x282a25[_0xe373('0xa')](_0xe373('0xb'),attributes,{'tableName':_0xe373('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x43d0cd,_0x494511,_0x1c4d18){if(_0x43d0cd[_0xe373('0xd')](_0xe373('0xe'))){_0x43d0cd[_0xe373('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1c4d18(null,_0x43d0cd);}}});};
\ No newline at end of file
+var _0x583c=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x583c,0x12b));var _0xc583=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x583c[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var logger=require(_0xc583('0x2'))(_0xc583('0x3'));var moment=require('moment');var BPromise=require(_0xc583('0x4'));var rp=require(_0xc583('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc583('0x6'));var attributes=require(_0xc583('0x7'));module['exports']=function(_0xd3a750,_0x365ed6){return _0xd3a750[_0xc583('0x8')](_0xc583('0x9'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x21ed88,_0x26cec0,_0x5b456e){if(_0x21ed88[_0xc583('0xa')](_0xc583('0xb'))){_0x21ed88[_0xc583('0xc')]=moment()[_0xc583('0xd')](_0xc583('0xe'));}_0x5b456e(null,_0x21ed88);}}});};
\ No newline at end of file
index e03ab6e..7e00c92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9477=['request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateWhatsappInteraction','update','options','raw','attributes','then','AddTagsToWhatsappInteraction','WhatsappInteraction','find','where','body','ids','spread','AddTags','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','WhatsappInteraction,\x20%s,\x20%s'];(function(_0x13ec6e,_0x44cf87){var _0x4377c1=function(_0x3a9764){while(--_0x3a9764){_0x13ec6e['push'](_0x13ec6e['shift']());}};_0x4377c1(++_0x44cf87);}(_0x9477,0x1a1));var _0x7947=function(_0xcce184,_0xe0dead){_0xcce184=_0xcce184-0x0;var _0x470acb=_0x9477[_0xcce184];return _0x470acb;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7947('0x0'));var db=require(_0x7947('0x1'))['db'];var utils=require(_0x7947('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x7947('0x3'));var jayson=require(_0x7947('0x4'));var client=jayson[_0x7947('0x5')][_0x7947('0x6')]({'port':0x232a});config[_0x7947('0x7')]=_[_0x7947('0x8')](config['redis'],{'host':_0x7947('0x9'),'port':0x18eb});var socket=require(_0x7947('0xa'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0x7947('0xb')](socket);function respondWithRpcPromise(_0x37e564,_0x22e11d,_0x36142d){return new BPromise(function(_0x18c6b3,_0x38289b){return client[_0x7947('0xc')](_0x37e564,_0x36142d)['then'](function(_0x164a38){logger[_0x7947('0xd')](_0x7947('0xe'),_0x22e11d,_0x7947('0xf'));logger[_0x7947('0x10')](_0x7947('0x11'),_0x22e11d,_0x7947('0xf'),JSON[_0x7947('0x12')](_0x164a38));if(_0x164a38[_0x7947('0x13')]){if(_0x164a38[_0x7947('0x13')]['code']===0x1f4){logger[_0x7947('0x13')](_0x7947('0xe'),_0x22e11d,_0x164a38[_0x7947('0x13')][_0x7947('0x14')]);return _0x38289b(_0x164a38['error'][_0x7947('0x14')]);}logger['error'](_0x7947('0xe'),_0x22e11d,_0x164a38[_0x7947('0x13')][_0x7947('0x14')]);return _0x18c6b3(_0x164a38[_0x7947('0x13')][_0x7947('0x14')]);}else{logger[_0x7947('0xd')](_0x7947('0xe'),_0x22e11d,_0x7947('0xf'));_0x18c6b3(_0x164a38['result'][_0x7947('0x14')]);}})[_0x7947('0x15')](function(_0x1d4dfc){logger[_0x7947('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x22e11d,_0x1d4dfc);_0x38289b(_0x1d4dfc);});});}exports[_0x7947('0x16')]=function(_0x1ceaf6){var _0x316410=this;return new Promise(function(_0x3588a5,_0x2705a8){return db['WhatsappInteraction'][_0x7947('0x17')](_0x1ceaf6['body'],{'raw':_0x1ceaf6['options']?_0x1ceaf6[_0x7947('0x18')][_0x7947('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ceaf6[_0x7947('0x18')]?_0x1ceaf6['options']['where']||null:null,'attributes':_0x1ceaf6['options']?_0x1ceaf6['options'][_0x7947('0x1a')]||null:null,'limit':_0x1ceaf6[_0x7947('0x18')]?_0x1ceaf6['options']['limit']||null:null})[_0x7947('0x1b')](function(_0xb9bd3d){logger[_0x7947('0xd')](_0x7947('0x16'),_0x1ceaf6);logger[_0x7947('0x10')](_0x7947('0x16'),_0x1ceaf6,JSON[_0x7947('0x12')](_0xb9bd3d));_0x3588a5(_0xb9bd3d);})['catch'](function(_0x26df2d){logger[_0x7947('0x13')](_0x7947('0x16'),_0x26df2d['message'],_0x1ceaf6);_0x2705a8(_0x316410[_0x7947('0x13')](0x1f4,_0x26df2d[_0x7947('0x14')]));});});};exports[_0x7947('0x1c')]=function(_0x28eff7){return new Promise(function(_0x3c37c7,_0x203dee){return db[_0x7947('0x1d')][_0x7947('0x1e')]({'where':_0x28eff7[_0x7947('0x18')]?_0x28eff7[_0x7947('0x18')][_0x7947('0x1f')]||null:null})[_0x7947('0x1b')](function(_0x43c57f){if(_0x43c57f){return _0x43c57f['addTags'](_0x28eff7[_0x7947('0x20')][_0x7947('0x21')],_['omit'](_0x28eff7[_0x7947('0x20')],[_0x7947('0x21'),'id'])||{});}})[_0x7947('0x22')](function(_0x2e7ff7){logger[_0x7947('0xd')](_0x7947('0x23'),_0x28eff7);logger[_0x7947('0x10')](_0x7947('0x23'),_0x28eff7,JSON['stringify'](_0x2e7ff7));_0x3c37c7(_0x2e7ff7);})[_0x7947('0x15')](function(_0x3a7d79){logger['error'](_0x7947('0x23'),_0x3a7d79['message'],_0x28eff7);_0x203dee(_this[_0x7947('0x13')](0x1f4,_0x3a7d79[_0x7947('0x14')]));});});};
\ No newline at end of file
+var _0x563b=['request\x20sent','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','attributes','limit','debug','stringify','AddTagsToWhatsappInteraction','find','omit','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info'];(function(_0xbe05c8,_0x26be13){var _0xbd60ca=function(_0x202473){while(--_0x202473){_0xbe05c8['push'](_0xbe05c8['shift']());}};_0xbd60ca(++_0x26be13);}(_0x563b,0xc3));var _0xb563=function(_0x4e296e,_0x3e3400){_0x4e296e=_0x4e296e-0x0;var _0x50336d=_0x563b[_0x4e296e];return _0x50336d;};'use strict';var _=require('lodash');var util=require(_0xb563('0x0'));var moment=require(_0xb563('0x1'));var BPromise=require(_0xb563('0x2'));var rs=require(_0xb563('0x3'));var fs=require('fs');var Redis=require(_0xb563('0x4'));var db=require(_0xb563('0x5'))['db'];var utils=require(_0xb563('0x6'));var logger=require(_0xb563('0x7'))(_0xb563('0x8'));var config=require('../../config/environment');var jayson=require(_0xb563('0x9'));var client=jayson[_0xb563('0xa')][_0xb563('0xb')]({'port':0x232a});config[_0xb563('0xc')]=_[_0xb563('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb563('0xe'))(new Redis(config['redis']));require(_0xb563('0xf'))[_0xb563('0x10')](socket);function respondWithRpcPromise(_0x86d381,_0x4a4bd8,_0x43d1ae){return new BPromise(function(_0x1cb054,_0x21d44c){return client[_0xb563('0x11')](_0x86d381,_0x43d1ae)[_0xb563('0x12')](function(_0x57526e){logger[_0xb563('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x4a4bd8,_0xb563('0x14'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x4a4bd8,_0xb563('0x14'),JSON['stringify'](_0x57526e));if(_0x57526e[_0xb563('0x15')]){if(_0x57526e[_0xb563('0x15')][_0xb563('0x16')]===0x1f4){logger[_0xb563('0x15')](_0xb563('0x17'),_0x4a4bd8,_0x57526e[_0xb563('0x15')][_0xb563('0x18')]);return _0x21d44c(_0x57526e[_0xb563('0x15')][_0xb563('0x18')]);}logger[_0xb563('0x15')](_0xb563('0x17'),_0x4a4bd8,_0x57526e[_0xb563('0x15')][_0xb563('0x18')]);return _0x1cb054(_0x57526e[_0xb563('0x15')][_0xb563('0x18')]);}else{logger[_0xb563('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x4a4bd8,_0xb563('0x14'));_0x1cb054(_0x57526e[_0xb563('0x19')][_0xb563('0x18')]);}})[_0xb563('0x1a')](function(_0x423e54){logger[_0xb563('0x15')](_0xb563('0x17'),_0x4a4bd8,_0x423e54);_0x21d44c(_0x423e54);});});}exports[_0xb563('0x1b')]=function(_0x25ec84){var _0x21de7a=this;return new Promise(function(_0x4cc8ff,_0x2c103c){return db[_0xb563('0x1c')][_0xb563('0x1d')](_0x25ec84[_0xb563('0x1e')],{'raw':_0x25ec84[_0xb563('0x1f')]?_0x25ec84[_0xb563('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25ec84['options']?_0x25ec84[_0xb563('0x1f')][_0xb563('0x20')]||null:null,'attributes':_0x25ec84[_0xb563('0x1f')]?_0x25ec84[_0xb563('0x1f')][_0xb563('0x21')]||null:null,'limit':_0x25ec84[_0xb563('0x1f')]?_0x25ec84[_0xb563('0x1f')][_0xb563('0x22')]||null:null})[_0xb563('0x12')](function(_0x516072){logger['info'](_0xb563('0x1b'),_0x25ec84);logger[_0xb563('0x23')]('UpdateWhatsappInteraction',_0x25ec84,JSON[_0xb563('0x24')](_0x516072));_0x4cc8ff(_0x516072);})[_0xb563('0x1a')](function(_0x297317){logger[_0xb563('0x15')](_0xb563('0x1b'),_0x297317['message'],_0x25ec84);_0x2c103c(_0x21de7a[_0xb563('0x15')](0x1f4,_0x297317['message']));});});};exports[_0xb563('0x25')]=function(_0x52c691){return new Promise(function(_0x3c8649,_0xe45d2a){return db[_0xb563('0x1c')][_0xb563('0x26')]({'where':_0x52c691['options']?_0x52c691['options'][_0xb563('0x20')]||null:null})['then'](function(_0x53aa14){if(_0x53aa14){return _0x53aa14['addTags'](_0x52c691[_0xb563('0x1e')]['ids'],_[_0xb563('0x27')](_0x52c691[_0xb563('0x1e')],[_0xb563('0x28'),'id'])||{});}})[_0xb563('0x29')](function(_0x474581){logger['info'](_0xb563('0x2a'),_0x52c691);logger[_0xb563('0x23')](_0xb563('0x2a'),_0x52c691,JSON[_0xb563('0x24')](_0x474581));_0x3c8649(_0x474581);})[_0xb563('0x1a')](function(_0x5f59ed){logger[_0xb563('0x15')](_0xb563('0x2a'),_0x5f59ed['message'],_0x52c691);_0xe45d2a(_this[_0xb563('0x15')](0x1f4,_0x5f59ed['message']));});});};
\ No newline at end of file
index 3f5161e..d59ee7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc7e=['register','./whatsappInteraction.events','save','remove','emit'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xfc7e,0xf1));var _0xefc7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfc7e[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappInteractionEvents=require(_0xefc7('0x0'));var events=[_0xefc7('0x1'),_0xefc7('0x2'),'update'];function createListener(_0x12a0bd,_0x3a6e7c){return function(_0x355f6c){_0x3a6e7c[_0xefc7('0x3')](_0x12a0bd,_0x355f6c);};}function removeListener(_0x1d7fc0,_0x17d36e){return function(){WhatsappInteractionEvents['removeListener'](_0x1d7fc0,_0x17d36e);};}exports[_0xefc7('0x4')]=function(_0x5cc709){for(var _0x565369=0x0,_0x332050=events['length'];_0x565369<_0x332050;_0x565369++){var _0x43cc94=events[_0x565369];var _0x1058b3=createListener('whatsappInteraction:'+_0x43cc94,_0x5cc709);WhatsappInteractionEvents['on'](_0x43cc94,_0x1058b3);}};
\ No newline at end of file
+var _0x21eb=['remove','update','emit','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x4e690f,_0x375bc4){var _0x23f962=function(_0x1c01ef){while(--_0x1c01ef){_0x4e690f['push'](_0x4e690f['shift']());}};_0x23f962(++_0x375bc4);}(_0x21eb,0x6e));var _0xb21e=function(_0x8de119,_0x597e67){_0x8de119=_0x8de119-0x0;var _0x4bb917=_0x21eb[_0x8de119];return _0x4bb917;};'use strict';var WhatsappInteractionEvents=require(_0xb21e('0x0'));var events=[_0xb21e('0x1'),_0xb21e('0x2'),_0xb21e('0x3')];function createListener(_0x3f605f,_0x8e706a){return function(_0x3d66cd){_0x8e706a[_0xb21e('0x4')](_0x3f605f,_0x3d66cd);};}function removeListener(_0x36034b,_0x404513){return function(){WhatsappInteractionEvents['removeListener'](_0x36034b,_0x404513);};}exports['register']=function(_0x5d9a58){for(var _0x817d8d=0x0,_0x3b481b=events[_0xb21e('0x5')];_0x817d8d<_0x3b481b;_0x817d8d++){var _0x4775fc=events[_0x817d8d];var _0x4ded04=createListener(_0xb21e('0x6')+_0x4775fc,_0x5d9a58);WhatsappInteractionEvents['on'](_0x4775fc,_0x4ded04);}};
\ No newline at end of file
index ad18d0e..2591486 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbeec=['whatsappmessage:create','create','status','put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','whatsapp'];(function(_0x28208f,_0x7f5ff2){var _0x16e45f=function(_0x303e15){while(--_0x303e15){_0x28208f['push'](_0x28208f['shift']());}};_0x16e45f(++_0x7f5ff2);}(_0xbeec,0x76));var _0xcbee=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbeec[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xcbee('0x0'));var util=require(_0xcbee('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcbee('0x2'));var router=express['Router']();var fs_extra=require(_0xcbee('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xcbee('0x4'));var config=require(_0xcbee('0x5'));var controller=require(_0xcbee('0x6'));router[_0xcbee('0x7')]('/',auth[_0xcbee('0x8')](),controller[_0xcbee('0x9')]);router[_0xcbee('0x7')](_0xcbee('0xa'),auth[_0xcbee('0x8')](),controller[_0xcbee('0xb')]);router[_0xcbee('0x7')](_0xcbee('0xc'),auth[_0xcbee('0x8')](),controller[_0xcbee('0xd')]);router[_0xcbee('0xe')]('/',auth['isAuthenticated'](),interaction[_0xcbee('0xf')](_0xcbee('0x10'),_0xcbee('0x11')),controller[_0xcbee('0x12')]);router['post']('/:id/status',controller[_0xcbee('0x13')]);router['put'](_0xcbee('0xc'),auth[_0xcbee('0x8')](),controller['update']);router[_0xcbee('0x14')](_0xcbee('0x15'),auth[_0xcbee('0x8')](),controller[_0xcbee('0x16')]);router[_0xcbee('0x14')]('/:id/reject',auth[_0xcbee('0x8')](),controller[_0xcbee('0x17')]);router[_0xcbee('0x18')](_0xcbee('0xc'),auth[_0xcbee('0x8')](),controller[_0xcbee('0x19')]);module[_0xcbee('0x1a')]=router;
\ No newline at end of file
+var _0x0a07=['../../config/environment','./whatsappMessage.controller','isAuthenticated','/describe','describe','/:id','show','post','tracked','/:id/status','status','put','update','accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0a07,0x76));var _0x70a0=function(_0x161a96,_0x5331fd){_0x161a96=_0x161a96-0x0;var _0x5041e5=_0x0a07[_0x161a96];return _0x5041e5;};'use strict';var multer=require('multer');var util=require(_0x70a0('0x0'));var path=require(_0x70a0('0x1'));var timeout=require(_0x70a0('0x2'));var express=require(_0x70a0('0x3'));var router=express[_0x70a0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x70a0('0x5'));var interaction=require(_0x70a0('0x6'));var config=require(_0x70a0('0x7'));var controller=require(_0x70a0('0x8'));router['get']('/',auth[_0x70a0('0x9')](),controller['index']);router['get'](_0x70a0('0xa'),auth['isAuthenticated'](),controller[_0x70a0('0xb')]);router['get'](_0x70a0('0xc'),auth[_0x70a0('0x9')](),controller[_0x70a0('0xd')]);router[_0x70a0('0xe')]('/',auth[_0x70a0('0x9')](),interaction[_0x70a0('0xf')]('whatsapp','whatsappmessage:create'),controller['create']);router['post'](_0x70a0('0x10'),controller[_0x70a0('0x11')]);router[_0x70a0('0x12')](_0x70a0('0xc'),auth[_0x70a0('0x9')](),controller[_0x70a0('0x13')]);router[_0x70a0('0x12')]('/:id/accept',auth[_0x70a0('0x9')](),controller[_0x70a0('0x14')]);router[_0x70a0('0x12')](_0x70a0('0x15'),auth[_0x70a0('0x9')](),controller[_0x70a0('0x16')]);router[_0x70a0('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x70a0('0x18')]);module['exports']=router;
\ No newline at end of file
index 36da24d..604379a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9abb=['medium','BOOLEAN','ENUM','out','STRING','DATE','TEXT'];(function(_0x46f5e4,_0x1576ff){var _0x15c000=function(_0x321438){while(--_0x321438){_0x46f5e4['push'](_0x46f5e4['shift']());}};_0x15c000(++_0x1576ff);}(_0x9abb,0xae));var _0xb9ab=function(_0x4c4b70,_0x349ccd){_0x4c4b70=_0x4c4b70-0x0;var _0x4346e4=_0x9abb[_0x4c4b70];return _0x4346e4;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xb9ab('0x0')](_0xb9ab('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xb9ab('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb9ab('0x3')]('in',_0xb9ab('0x4')),'defaultValue':_0xb9ab('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb9ab('0x5')](0xbe)},'phone':{'type':Sequelize[_0xb9ab('0x5')]},'readAt':{'type':Sequelize[_0xb9ab('0x6')]},'secret':{'type':Sequelize[_0xb9ab('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb9ab('0x5')]},'providerResponse':{'type':Sequelize[_0xb9ab('0x0')]}};
\ No newline at end of file
+var _0x63b1=['medium','ENUM','out','STRING','DATE','BOOLEAN','sequelize','exports','TEXT'];(function(_0x2ef251,_0x3687e5){var _0x5c931b=function(_0x3e1e36){while(--_0x3e1e36){_0x2ef251['push'](_0x2ef251['shift']());}};_0x5c931b(++_0x3687e5);}(_0x63b1,0x177));var _0x163b=function(_0x14ae45,_0x2c4576){_0x14ae45=_0x14ae45-0x0;var _0x3742eb=_0x63b1[_0x14ae45];return _0x3742eb;};'use strict';var Sequelize=require(_0x163b('0x0'));module[_0x163b('0x1')]={'body':{'type':Sequelize[_0x163b('0x2')](_0x163b('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x163b('0x4')]('in','out'),'defaultValue':_0x163b('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x163b('0x6')](0xbe)},'phone':{'type':Sequelize[_0x163b('0x6')]},'readAt':{'type':Sequelize[_0x163b('0x7')]},'secret':{'type':Sequelize[_0x163b('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x163b('0x6')]},'providerResponse':{'type':Sequelize[_0x163b('0x2')]}};
\ No newline at end of file
index 78943bd..d576d44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x324c=['catch','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','WhatsappMessage','rawAttributes','query','keys','filters','attributes','intersection','length','model','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','rows','show','fields','includeAll','include','create','body','find','params','accept','readAt','format','UserId','agent','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','ContactId','Sequelize','SELECT','fullname','email','internal','interface','SIP/%s','channel','EventManager','acceptmessage','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','contact','motionChannel','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','read','eml-format','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','then','info','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result'];(function(_0x17e67e,_0x44af85){var _0x48b05f=function(_0x3ac0d6){while(--_0x3ac0d6){_0x17e67e['push'](_0x17e67e['shift']());}};_0x48b05f(++_0x44af85);}(_0x324c,0x1ea));var _0xc324=function(_0x3528ce,_0x7414ae){_0x3528ce=_0x3528ce-0x0;var _0x3a6106=_0x324c[_0x3528ce];return _0x3a6106;};'use strict';var emlformat=require(_0xc324('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc324('0x1'));var rp=require(_0xc324('0x2'));var moment=require(_0xc324('0x3'));var BPromise=require(_0xc324('0x4'));var Mustache=require('mustache');var util=require(_0xc324('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xc324('0x6'));var ejs=require(_0xc324('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc324('0x8'));var crypto=require(_0xc324('0x9'));var jsforce=require(_0xc324('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xc324('0x6'));var querystring=require(_0xc324('0xb'));var Papa=require(_0xc324('0xc'));var Redis=require(_0xc324('0xd'));var authService=require(_0xc324('0xe'));var qs=require(_0xc324('0xf'));var as=require(_0xc324('0x10'));var hardwareService=require(_0xc324('0x11'));var logger=require(_0xc324('0x12'))('api');var utils=require(_0xc324('0x13'));var config=require(_0xc324('0x14'));var licenseUtil=require(_0xc324('0x15'));var db=require(_0xc324('0x16'))['db'];config[_0xc324('0x17')]=_[_0xc324('0x18')](config[_0xc324('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xc324('0x19'))(new Redis(config[_0xc324('0x17')]));require(_0xc324('0x1a'))['register'](socket);var jayson=require(_0xc324('0x1b'));var client=jayson[_0xc324('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xc324('0x1c')][_0xc324('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xcc2f3b,_0x5db759,_0x1947ab,_0x54bf19){return new BPromise(function(_0x20ab09,_0x23f3a6){var _0x345328=_0x54bf19||client;return _0x345328[_0xc324('0x1e')](_0xcc2f3b,_0x1947ab)[_0xc324('0x1f')](function(_0x55a038){logger[_0xc324('0x20')]('WhatsappMessage,\x20%s,\x20%s',_0x5db759,'request\x20sent');logger[_0xc324('0x21')](_0xc324('0x22'),_0x5db759,_0xc324('0x23'),JSON[_0xc324('0x24')](_0x55a038));if(_0x55a038[_0xc324('0x25')]){if(_0x55a038[_0xc324('0x25')][_0xc324('0x26')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x5db759,_0x55a038['error']['message']);return _0x23f3a6(_0x55a038[_0xc324('0x25')]['message']);}logger['error'](_0xc324('0x27'),_0x5db759,_0x55a038['error'][_0xc324('0x28')]);return _0x20ab09(_0x55a038[_0xc324('0x25')]['message']);}else{logger[_0xc324('0x20')]('WhatsappMessage,\x20%s,\x20%s',_0x5db759,'request\x20sent');_0x20ab09(_0x55a038[_0xc324('0x29')]['message']);}})[_0xc324('0x2a')](function(_0x353f3d){logger[_0xc324('0x25')](_0xc324('0x27'),_0x5db759,_0x353f3d);_0x23f3a6(_0x353f3d);});});}function respondWithStatusCode(_0x50b5be,_0x1a8548){_0x1a8548=_0x1a8548||0xcc;return function(_0x59febc){if(_0x59febc){return _0x50b5be['sendStatus'](_0x1a8548);}return _0x50b5be[_0xc324('0x2b')](_0x1a8548)[_0xc324('0x2c')]();};}function respondWithResult(_0x75d0a7,_0x4dba50){_0x4dba50=_0x4dba50||0xc8;return function(_0x273f1c){if(_0x273f1c){return _0x75d0a7[_0xc324('0x2b')](_0x4dba50)[_0xc324('0x2d')](_0x273f1c);}};}function respondWithFilteredResult(_0x1fb0dd,_0x2f773c){return function(_0x519769){if(_0x519769){var _0x41d7b0=typeof _0x2f773c['offset']==='undefined'&&typeof _0x2f773c[_0xc324('0x2e')]==='undefined';var _0x20f8c5=_0x519769[_0xc324('0x2f')];var _0x5bc89e=_0x41d7b0?0x0:_0x2f773c[_0xc324('0x30')];var _0x29b1b0=_0x41d7b0?_0x519769[_0xc324('0x2f')]:_0x2f773c['offset']+_0x2f773c[_0xc324('0x2e')];var _0x22a77e;if(_0x29b1b0>=_0x20f8c5){_0x29b1b0=_0x20f8c5;_0x22a77e=0xc8;}else{_0x22a77e=0xce;}_0x1fb0dd['status'](_0x22a77e);return _0x1fb0dd['set'](_0xc324('0x31'),_0x5bc89e+'-'+_0x29b1b0+'/'+_0x20f8c5)[_0xc324('0x2d')](_0x519769);}return null;};}function patchUpdates(_0x22a0b5){return function(_0x5e3685){try{jsonpatch[_0xc324('0x32')](_0x5e3685,_0x22a0b5,!![]);}catch(_0x24d3e0){return BPromise[_0xc324('0x33')](_0x24d3e0);}return _0x5e3685[_0xc324('0x34')]();};}function saveUpdates(_0x390956,_0x3f0b75){return function(_0x14e387){if(_0x14e387){return _0x14e387[_0xc324('0x35')](_0x390956)[_0xc324('0x1f')](function(_0x2e72f9){return _0x2e72f9;});}return null;};}function removeEntity(_0x1c0d56,_0x5e616b){return function(_0x4cfa85){if(_0x4cfa85){return _0x4cfa85[_0xc324('0x36')]()[_0xc324('0x1f')](function(){_0x1c0d56[_0xc324('0x2b')](0xcc)[_0xc324('0x2c')]();});}};}function handleEntityNotFound(_0x238977,_0x416c78){return function(_0x3fb926){if(!_0x3fb926){_0x238977[_0xc324('0x37')](0x194);}return _0x3fb926;};}function handleError(_0x344a53,_0x45d65b){_0x45d65b=_0x45d65b||0x1f4;return function(_0x1c7d36){logger['error'](_0x1c7d36[_0xc324('0x38')]);if(_0x1c7d36[_0xc324('0x39')]){delete _0x1c7d36[_0xc324('0x39')];}_0x344a53['status'](_0x45d65b)[_0xc324('0x3a')](_0x1c7d36);};}exports[_0xc324('0x3b')]=function(_0x3279b5,_0x4b84de){var _0xba11b6={},_0x562d6a={},_0x38d367={'count':0x0,'rows':[]};var _0x77649=_[_0xc324('0x3c')](db[_0xc324('0x3d')][_0xc324('0x3e')],function(_0x5b2795){return{'name':_0x5b2795['fieldName'],'type':_0x5b2795['type']['key']};});_0x562d6a['model']=_['map'](_0x77649,_0xc324('0x39'));_0x562d6a[_0xc324('0x3f')]=_[_0xc324('0x40')](_0x3279b5[_0xc324('0x3f')]);_0x562d6a[_0xc324('0x41')]=_['intersection'](_0x562d6a['model'],_0x562d6a[_0xc324('0x3f')]);_0xba11b6[_0xc324('0x42')]=_[_0xc324('0x43')](_0x562d6a['model'],qs['fields'](_0x3279b5[_0xc324('0x3f')]['fields']));_0xba11b6['attributes']=_0xba11b6[_0xc324('0x42')][_0xc324('0x44')]?_0xba11b6[_0xc324('0x42')]:_0x562d6a[_0xc324('0x45')];if(!_0x3279b5[_0xc324('0x3f')][_0xc324('0x46')]('nolimit')){_0xba11b6['limit']=qs['limit'](_0x3279b5[_0xc324('0x3f')][_0xc324('0x2e')]);_0xba11b6[_0xc324('0x30')]=qs[_0xc324('0x30')](_0x3279b5[_0xc324('0x3f')]['offset']);}_0xba11b6[_0xc324('0x47')]=qs[_0xc324('0x48')](_0x3279b5[_0xc324('0x3f')][_0xc324('0x48')]);_0xba11b6[_0xc324('0x49')]=qs[_0xc324('0x41')](_['pick'](_0x3279b5[_0xc324('0x3f')],_0x562d6a[_0xc324('0x41')]),_0x77649);if(_0x3279b5['query'][_0xc324('0x4a')]){_0xba11b6[_0xc324('0x49')]=_[_0xc324('0x4b')](_0xba11b6['where'],{'$or':_[_0xc324('0x3c')](_0x77649,function(_0x33144b){if(_0x33144b[_0xc324('0x4c')]!==_0xc324('0x4d')){var _0x520c53={};_0x520c53[_0x33144b[_0xc324('0x39')]]={'$like':'%'+_0x3279b5[_0xc324('0x3f')][_0xc324('0x4a')]+'%'};return _0x520c53;}})});}_0xba11b6=_['merge']({},_0xba11b6,_0x3279b5['options']);var _0x3e937a={'where':_0xba11b6[_0xc324('0x49')]};return db[_0xc324('0x3d')][_0xc324('0x2f')](_0x3e937a)[_0xc324('0x1f')](function(_0x2ed3fb){_0x38d367[_0xc324('0x2f')]=_0x2ed3fb;if(_0x3279b5['query']['includeAll']){_0xba11b6['include']=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0xba11b6);})['then'](function(_0x2afb40){_0x38d367[_0xc324('0x4e')]=_0x2afb40;return _0x38d367;})[_0xc324('0x1f')](respondWithFilteredResult(_0x4b84de,_0xba11b6))[_0xc324('0x2a')](handleError(_0x4b84de,null));};exports[_0xc324('0x4f')]=function(_0x2e6c52,_0x93d544){var _0x4e72d1={'raw':!![],'where':{'id':_0x2e6c52['params']['id']}},_0x4c1af6={};_0x4c1af6[_0xc324('0x45')]=_[_0xc324('0x40')](db[_0xc324('0x3d')][_0xc324('0x3e')]);_0x4c1af6[_0xc324('0x3f')]=_['keys'](_0x2e6c52[_0xc324('0x3f')]);_0x4c1af6[_0xc324('0x41')]=_['intersection'](_0x4c1af6[_0xc324('0x45')],_0x4c1af6['query']);_0x4e72d1['attributes']=_['intersection'](_0x4c1af6['model'],qs[_0xc324('0x50')](_0x2e6c52[_0xc324('0x3f')][_0xc324('0x50')]));_0x4e72d1['attributes']=_0x4e72d1[_0xc324('0x42')][_0xc324('0x44')]?_0x4e72d1[_0xc324('0x42')]:_0x4c1af6['model'];if(_0x2e6c52[_0xc324('0x3f')][_0xc324('0x51')]){_0x4e72d1[_0xc324('0x52')]=[{'all':!![]}];}_0x4e72d1=_[_0xc324('0x4b')]({},_0x4e72d1,_0x2e6c52['options']);return db[_0xc324('0x3d')]['find'](_0x4e72d1)[_0xc324('0x1f')](handleEntityNotFound(_0x93d544,null))[_0xc324('0x1f')](respondWithResult(_0x93d544,null))['catch'](handleError(_0x93d544,null));};exports[_0xc324('0x53')]=function(_0xb8e42b,_0x46f439){return db[_0xc324('0x3d')][_0xc324('0x53')](_0xb8e42b[_0xc324('0x54')],{})[_0xc324('0x1f')](respondWithResult(_0x46f439,0xc9))[_0xc324('0x2a')](handleError(_0x46f439,null));};exports[_0xc324('0x35')]=function(_0x3d556b,_0x308e32){if(_0x3d556b[_0xc324('0x54')]['id']){delete _0x3d556b[_0xc324('0x54')]['id'];}return db[_0xc324('0x3d')][_0xc324('0x55')]({'where':{'id':_0x3d556b[_0xc324('0x56')]['id']}})[_0xc324('0x1f')](handleEntityNotFound(_0x308e32,null))[_0xc324('0x1f')](saveUpdates(_0x3d556b[_0xc324('0x54')],null))[_0xc324('0x1f')](respondWithResult(_0x308e32,null))['catch'](handleError(_0x308e32,null));};exports[_0xc324('0x36')]=function(_0x2d7970,_0x48b933){return db[_0xc324('0x3d')][_0xc324('0x55')]({'where':{'id':_0x2d7970[_0xc324('0x56')]['id']}})['then'](handleEntityNotFound(_0x48b933,null))[_0xc324('0x1f')](removeEntity(_0x48b933,null))['catch'](handleError(_0x48b933,null));};exports['describe']=function(_0x2f420c,_0xebab89){return db[_0xc324('0x3d')]['describe']()[_0xc324('0x1f')](respondWithResult(_0xebab89,null))[_0xc324('0x2a')](handleError(_0xebab89,null));};var interaction_log=require(_0xc324('0x12'))('whatsapp-interactions');exports[_0xc324('0x57')]=function(_0x57f0f7,_0x575075,_0xf09c81){var _0xb1ec={'agent':{},'channel':'whatsapp'};if(_0x57f0f7[_0xc324('0x54')]['id']){delete _0x57f0f7[_0xc324('0x54')]['id'];}_0x57f0f7[_0xc324('0x54')]['read']=!![];_0x57f0f7[_0xc324('0x54')][_0xc324('0x58')]=moment()[_0xc324('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x57f0f7[_0xc324('0x54')][_0xc324('0x5a')]=_0x57f0f7[_0xc324('0x54')][_0xc324('0x5a')]||_0x57f0f7['user']['id'];_0xb1ec[_0xc324('0x5b')]['id']=_0x57f0f7[_0xc324('0x54')][_0xc324('0x5a')];return db['WhatsappMessage']['find']({'where':{'id':_0x57f0f7[_0xc324('0x56')]['id'],'UserId':null}})[_0xc324('0x1f')](handleEntityNotFound(_0x575075,null))[_0xc324('0x1f')](saveUpdates(_0x57f0f7[_0xc324('0x54')],null))[_0xc324('0x1f')](function(_0x2a170f){if(_0x2a170f){_0xb1ec[_0xc324('0x28')]=_0x2a170f['get']({'plain':!![]});return db[_0xc324('0x5c')][_0xc324('0x55')]({'where':{'id':_0x2a170f[_0xc324('0x5d')]}});}return null;})[_0xc324('0x1f')](handleEntityNotFound(_0x575075,null))[_0xc324('0x1f')](function(_0xce3b5f){if(_0xce3b5f){return _0xce3b5f['update']({'UserId':_0x57f0f7['body']['UserId'],'read1stAt':_[_0xc324('0x5e')](_0xce3b5f[_0xc324('0x5f')])?moment()[_0xc324('0x59')](_0xc324('0x60')):undefined});}return null;})['then'](function(_0x4c171e){if(_0x4c171e){_0xb1ec[_0xc324('0x61')]=_0x4c171e[_0xc324('0x62')]({'plain':!![]});interaction_log['info'](_0xc324('0x63'),_0x57f0f7['user']['id'],_0x57f0f7['user'][_0xc324('0x39')],_0x57f0f7[_0xc324('0x64')][_0xc324('0x65')],_0xb1ec['interaction']['id'],_0x57f0f7[_0xc324('0x54')]?JSON[_0xc324('0x24')](_0x57f0f7[_0xc324('0x54')]):'null');return respondWithRpcPromise(_0xc324('0x66'),_0xc324('0x67'),_0xb1ec);}return null;})['then'](function(_0x487ede){var _0x3083ca='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x487ede[_0xc324('0x28')][_0xc324('0x68')];return db['sequelize'][_0xc324('0x3f')](_0x3083ca,{'type':db[_0xc324('0x69')]['QueryTypes'][_0xc324('0x6a')],'raw':!![]})[_0xc324('0x1f')](function(_0x23ddcd){return _0x23ddcd;});})[_0xc324('0x1f')](function(_0x6a9cf4){if(_0x6a9cf4){_0xb1ec[_0xc324('0x28')]['contact']=_0x6a9cf4[0x0];if(!_0x57f0f7[_0xc324('0x54')]['UserId'])return;return db['User'][_0xc324('0x55')]({'where':{'id':_0x57f0f7[_0xc324('0x54')][_0xc324('0x5a')],'role':_0xc324('0x5b')},'attributes':['id','name',_0xc324('0x6b'),_0xc324('0x6c'),_0xc324('0x6d')],'raw':!![]});}return null;})[_0xc324('0x1f')](function(_0x1cf7f5){if(!_0x1cf7f5)return null;_0xb1ec[_0xc324('0x28')][_0xc324('0x5b')]=_0x1cf7f5;return _0xb1ec;})[_0xc324('0x1f')](function(_0x15478c){if(_0x15478c){if(_0x57f0f7[_0xc324('0x54')]['manual']){_0xb1ec[_0xc324('0x28')][_0xc324('0x6e')]=util[_0xc324('0x59')](_0xc324('0x6f'),_0x57f0f7[_0xc324('0x64')][_0xc324('0x39')]);_0xb1ec[_0xc324('0x28')][_0xc324('0x70')]=_0xb1ec[_0xc324('0x70')];_0xb1ec['message']['motionChannel']=_0xb1ec[_0xc324('0x70')];_0xb1ec['message']['event']=_0xc324('0x57');return respondWithRpcPromise(_0xc324('0x71'),_0xc324('0x71'),{'event':_0xc324('0x72'),'message':_0xb1ec[_0xc324('0x28')]},client9002)['then'](function(){return _0xb1ec;});}return _0xb1ec;}return null;})[_0xc324('0x1f')](respondWithResult(_0x575075,null))['catch'](handleError(_0x575075,null));};var interaction_log=require('../../config/logger')(_0xc324('0x73'));exports['reject']=function(_0x1677a0,_0x1ae555,_0x54a9f9){var _0x5609c2={'agent':{},'channel':'whatsapp'};if(_0x1677a0[_0xc324('0x54')]['id']){delete _0x1677a0[_0xc324('0x54')]['id'];}_0x1677a0[_0xc324('0x54')][_0xc324('0x5a')]=_0x1677a0[_0xc324('0x54')][_0xc324('0x5a')]||_0x1677a0[_0xc324('0x64')]['id'];_0x5609c2[_0xc324('0x5b')]['id']=_0x1677a0[_0xc324('0x54')][_0xc324('0x5a')];return db['WhatsappMessage']['find']({'where':{'id':_0x1677a0[_0xc324('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1ae555,null))[_0xc324('0x1f')](function(_0x30a90b){if(_0x30a90b){_0x5609c2['message']=_0x30a90b[_0xc324('0x62')]({'plain':!![]});return db['WhatsappInteraction'][_0xc324('0x55')]({'where':{'id':_0x30a90b['WhatsappInteractionId']}});}return null;})[_0xc324('0x1f')](handleEntityNotFound(_0x1ae555,null))[_0xc324('0x1f')](function(_0x5dc79c){if(_0x5dc79c){_0x5609c2[_0xc324('0x61')]=_0x5dc79c[_0xc324('0x62')]({'plain':!![]});interaction_log[_0xc324('0x20')](_0xc324('0x74'),_0x1677a0['user']['id'],_0x1677a0[_0xc324('0x64')]['name'],_0x1677a0[_0xc324('0x64')][_0xc324('0x65')],_0x5609c2['interaction']['id'],_0x1677a0[_0xc324('0x54')]?JSON[_0xc324('0x24')](_0x1677a0[_0xc324('0x54')]):_0xc324('0x75'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5609c2);}return null;})[_0xc324('0x1f')](function(_0x507f60){var _0xa3e6ae=_0xc324('0x76')+_0x507f60[_0xc324('0x28')]['ContactId'];return db[_0xc324('0x77')][_0xc324('0x3f')](_0xa3e6ae,{'type':db[_0xc324('0x69')][_0xc324('0x78')][_0xc324('0x6a')],'raw':!![]})[_0xc324('0x1f')](function(_0x591782){return _0x591782;});})[_0xc324('0x1f')](function(_0x10d3f3){if(_0x10d3f3){_0x5609c2[_0xc324('0x28')][_0xc324('0x79')]=_0x10d3f3[0x0];if(!_0x1677a0['body']['UserId'])return;return db['User'][_0xc324('0x55')]({'where':{'id':_0x1677a0[_0xc324('0x54')]['UserId'],'role':_0xc324('0x5b')},'attributes':['id',_0xc324('0x39'),_0xc324('0x6b'),_0xc324('0x6c'),'internal'],'raw':!![]});}return null;})[_0xc324('0x1f')](function(_0x2c9017){if(!_0x2c9017)return null;_0x5609c2[_0xc324('0x28')][_0xc324('0x5b')]=_0x2c9017;return _0x5609c2;})[_0xc324('0x1f')](function(_0x32b709){if(_0x32b709){_0x32b709['message'][_0xc324('0x6e')]=util[_0xc324('0x59')](_0xc324('0x6f'),_0x1677a0[_0xc324('0x64')][_0xc324('0x39')]);_0x32b709[_0xc324('0x28')][_0xc324('0x70')]=_0x5609c2[_0xc324('0x70')];_0x32b709[_0xc324('0x28')][_0xc324('0x7a')]=_0x5609c2[_0xc324('0x70')];_0x32b709[_0xc324('0x28')]['event']=_0xc324('0x33');respondWithRpcPromise(_0xc324('0x71'),_0xc324('0x71'),{'event':_0xc324('0x7b'),'message':_0x32b709[_0xc324('0x28')]},client9002);return _0x5609c2;}return null;})['then'](respondWithResult(_0x1ae555,null))[_0xc324('0x2a')](handleError(_0x1ae555,null));};exports[_0xc324('0x2b')]=function(_0x324e4a,_0x9e1e4b,_0x2cfe7b){if(_0x324e4a['body']['id']){delete _0x324e4a['body']['id'];}var _0x3b5e3f;return db[_0xc324('0x3d')][_0xc324('0x55')]({'where':{'id':_0x324e4a[_0xc324('0x56')]['id']}})[_0xc324('0x1f')](handleEntityNotFound(_0x9e1e4b,null))[_0xc324('0x1f')](function(_0xc250d5){if(_0xc250d5){_0x3b5e3f=_0xc250d5;return db[_0xc324('0x7c')][_0xc324('0x55')]({'where':{'id':_0xc250d5[_0xc324('0x7d')]}});}})[_0xc324('0x1f')](handleEntityNotFound(_0x9e1e4b,null))[_0xc324('0x1f')](function(_0x226410){if(_0x226410){logger['debug'](_0xc324('0x7e'),_0xc324('0x2b'),_0xc324('0x7f'),_0x226410[_0xc324('0x4c')],util[_0xc324('0x80')](_0x324e4a[_0xc324('0x54')],{'showHidden':![],'depth':null}));switch(_0x226410['type']){case _0xc324('0x81'):if(_0x324e4a[_0xc324('0x54')]['MessageSid']&&_0x324e4a[_0xc324('0x54')][_0xc324('0x82')]===_0x3b5e3f['messageId']&&_0x324e4a[_0xc324('0x54')][_0xc324('0x83')]&&_0x324e4a[_0xc324('0x54')][_0xc324('0x83')]===_0xc324('0x84')){return _0x3b5e3f[_0xc324('0x35')]({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s','status','twilio',util[_0xc324('0x80')](_0x324e4a[_0xc324('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x3b5e3f;}})[_0xc324('0x1f')](respondWithResult(_0x9e1e4b,null))[_0xc324('0x2a')](handleError(_0x9e1e4b,null));};
\ No newline at end of file
+var _0x0a2d=['messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','stack','name','send','map','WhatsappMessage','fieldName','key','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','type','merge','options','includeAll','findAll','rows','show','params','keys','rawAttributes','include','find','create','body','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','User','email','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','Sequelize','QueryTypes','SELECT','fullname','internal','event','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','received\x20delivery\x20report\x20from','inspect','MessageSid'];(function(_0x3fe414,_0x5eb1fb){var _0x4180f9=function(_0x32ae3b){while(--_0x32ae3b){_0x3fe414['push'](_0x3fe414['shift']());}};_0x4180f9(++_0x5eb1fb);}(_0x0a2d,0x97));var _0xd0a2=function(_0x3a2dc1,_0x43bbad){_0x3a2dc1=_0x3a2dc1-0x0;var _0x2c0953=_0x0a2d[_0x3a2dc1];return _0x2c0953;};'use strict';var emlformat=require(_0xd0a2('0x0'));var rimraf=require(_0xd0a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd0a2('0x2'));var rp=require(_0xd0a2('0x3'));var moment=require(_0xd0a2('0x4'));var BPromise=require(_0xd0a2('0x5'));var Mustache=require(_0xd0a2('0x6'));var util=require(_0xd0a2('0x7'));var path=require(_0xd0a2('0x8'));var sox=require(_0xd0a2('0x9'));var csv=require(_0xd0a2('0xa'));var ejs=require(_0xd0a2('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0a2('0xc'));var squel=require(_0xd0a2('0xd'));var crypto=require(_0xd0a2('0xe'));var jsforce=require(_0xd0a2('0xf'));var deskjs=require(_0xd0a2('0x10'));var toCsv=require(_0xd0a2('0xa'));var querystring=require(_0xd0a2('0x11'));var Papa=require(_0xd0a2('0x12'));var Redis=require(_0xd0a2('0x13'));var authService=require(_0xd0a2('0x14'));var qs=require(_0xd0a2('0x15'));var as=require(_0xd0a2('0x16'));var hardwareService=require(_0xd0a2('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xd0a2('0x18'));var config=require(_0xd0a2('0x19'));var licenseUtil=require(_0xd0a2('0x1a'));var db=require(_0xd0a2('0x1b'))['db'];config[_0xd0a2('0x1c')]=_[_0xd0a2('0x1d')](config[_0xd0a2('0x1c')],{'host':_0xd0a2('0x1e'),'port':0x18eb});var socket=require(_0xd0a2('0x1f'))(new Redis(config[_0xd0a2('0x1c')]));require(_0xd0a2('0x20'))['register'](socket);var jayson=require(_0xd0a2('0x21'));var client=jayson[_0xd0a2('0x22')][_0xd0a2('0x23')]({'port':0x232c});var client9002=jayson[_0xd0a2('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55b91e,_0x3c3bef,_0x4ab54e,_0x11651c){return new BPromise(function(_0x2f9947,_0x32c47d){var _0x20ac7b=_0x11651c||client;return _0x20ac7b['request'](_0x55b91e,_0x4ab54e)['then'](function(_0x449697){logger[_0xd0a2('0x24')](_0xd0a2('0x25'),_0x3c3bef,_0xd0a2('0x26'));logger['debug'](_0xd0a2('0x27'),_0x3c3bef,_0xd0a2('0x26'),JSON[_0xd0a2('0x28')](_0x449697));if(_0x449697[_0xd0a2('0x29')]){if(_0x449697[_0xd0a2('0x29')]['code']===0x1f4){logger[_0xd0a2('0x29')](_0xd0a2('0x25'),_0x3c3bef,_0x449697[_0xd0a2('0x29')][_0xd0a2('0x2a')]);return _0x32c47d(_0x449697[_0xd0a2('0x29')][_0xd0a2('0x2a')]);}logger['error'](_0xd0a2('0x25'),_0x3c3bef,_0x449697['error'][_0xd0a2('0x2a')]);return _0x2f9947(_0x449697[_0xd0a2('0x29')][_0xd0a2('0x2a')]);}else{logger['info'](_0xd0a2('0x25'),_0x3c3bef,_0xd0a2('0x26'));_0x2f9947(_0x449697[_0xd0a2('0x2b')][_0xd0a2('0x2a')]);}})[_0xd0a2('0x2c')](function(_0x1825a0){logger[_0xd0a2('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x3c3bef,_0x1825a0);_0x32c47d(_0x1825a0);});});}function respondWithStatusCode(_0x1c177d,_0x1e5cbf){_0x1e5cbf=_0x1e5cbf||0xcc;return function(_0x1526e6){if(_0x1526e6){return _0x1c177d[_0xd0a2('0x2d')](_0x1e5cbf);}return _0x1c177d[_0xd0a2('0x2e')](_0x1e5cbf)['end']();};}function respondWithResult(_0x3d9382,_0x3c08f6){_0x3c08f6=_0x3c08f6||0xc8;return function(_0x266fe6){if(_0x266fe6){return _0x3d9382[_0xd0a2('0x2e')](_0x3c08f6)['json'](_0x266fe6);}};}function respondWithFilteredResult(_0x2a0799,_0x4795b7){return function(_0x395aac){if(_0x395aac){var _0x3f2265=typeof _0x4795b7[_0xd0a2('0x2f')]===_0xd0a2('0x30')&&typeof _0x4795b7[_0xd0a2('0x31')]===_0xd0a2('0x30');var _0x5896b3=_0x395aac['count'];var _0x5cf493=_0x3f2265?0x0:_0x4795b7['offset'];var _0x26ace8=_0x3f2265?_0x395aac[_0xd0a2('0x32')]:_0x4795b7[_0xd0a2('0x2f')]+_0x4795b7[_0xd0a2('0x31')];var _0x2fe822;if(_0x26ace8>=_0x5896b3){_0x26ace8=_0x5896b3;_0x2fe822=0xc8;}else{_0x2fe822=0xce;}_0x2a0799[_0xd0a2('0x2e')](_0x2fe822);return _0x2a0799[_0xd0a2('0x33')](_0xd0a2('0x34'),_0x5cf493+'-'+_0x26ace8+'/'+_0x5896b3)[_0xd0a2('0x35')](_0x395aac);}return null;};}function patchUpdates(_0x4c72be){return function(_0x8da71a){try{jsonpatch[_0xd0a2('0x36')](_0x8da71a,_0x4c72be,!![]);}catch(_0x43415d){return BPromise[_0xd0a2('0x37')](_0x43415d);}return _0x8da71a[_0xd0a2('0x38')]();};}function saveUpdates(_0x3e3704,_0x5277d2){return function(_0x1b6614){if(_0x1b6614){return _0x1b6614[_0xd0a2('0x39')](_0x3e3704)[_0xd0a2('0x3a')](function(_0x2235e9){return _0x2235e9;});}return null;};}function removeEntity(_0x34b5c4,_0x4daf4e){return function(_0xc47de3){if(_0xc47de3){return _0xc47de3['destroy']()[_0xd0a2('0x3a')](function(){_0x34b5c4[_0xd0a2('0x2e')](0xcc)[_0xd0a2('0x3b')]();});}};}function handleEntityNotFound(_0x3907a8,_0xf4b117){return function(_0x4b2dac){if(!_0x4b2dac){_0x3907a8[_0xd0a2('0x2d')](0x194);}return _0x4b2dac;};}function handleError(_0x1fa0e6,_0x4724cd){_0x4724cd=_0x4724cd||0x1f4;return function(_0x522946){logger[_0xd0a2('0x29')](_0x522946[_0xd0a2('0x3c')]);if(_0x522946[_0xd0a2('0x3d')]){delete _0x522946[_0xd0a2('0x3d')];}_0x1fa0e6[_0xd0a2('0x2e')](_0x4724cd)[_0xd0a2('0x3e')](_0x522946);};}exports['index']=function(_0x1b4824,_0x1c6642){var _0x408fba={},_0x4a6a1f={},_0x331418={'count':0x0,'rows':[]};var _0xe9e469=_[_0xd0a2('0x3f')](db[_0xd0a2('0x40')]['rawAttributes'],function(_0x3bddd0){return{'name':_0x3bddd0[_0xd0a2('0x41')],'type':_0x3bddd0['type'][_0xd0a2('0x42')]};});_0x4a6a1f['model']=_['map'](_0xe9e469,'name');_0x4a6a1f[_0xd0a2('0x43')]=_['keys'](_0x1b4824[_0xd0a2('0x43')]);_0x4a6a1f[_0xd0a2('0x44')]=_[_0xd0a2('0x45')](_0x4a6a1f['model'],_0x4a6a1f[_0xd0a2('0x43')]);_0x408fba[_0xd0a2('0x46')]=_[_0xd0a2('0x45')](_0x4a6a1f[_0xd0a2('0x47')],qs[_0xd0a2('0x48')](_0x1b4824['query'][_0xd0a2('0x48')]));_0x408fba[_0xd0a2('0x46')]=_0x408fba[_0xd0a2('0x46')][_0xd0a2('0x49')]?_0x408fba['attributes']:_0x4a6a1f[_0xd0a2('0x47')];if(!_0x1b4824[_0xd0a2('0x43')]['hasOwnProperty'](_0xd0a2('0x4a'))){_0x408fba[_0xd0a2('0x31')]=qs[_0xd0a2('0x31')](_0x1b4824[_0xd0a2('0x43')]['limit']);_0x408fba[_0xd0a2('0x2f')]=qs['offset'](_0x1b4824[_0xd0a2('0x43')][_0xd0a2('0x2f')]);}_0x408fba[_0xd0a2('0x4b')]=qs[_0xd0a2('0x4c')](_0x1b4824['query'][_0xd0a2('0x4c')]);_0x408fba[_0xd0a2('0x4d')]=qs[_0xd0a2('0x44')](_[_0xd0a2('0x4e')](_0x1b4824['query'],_0x4a6a1f[_0xd0a2('0x44')]),_0xe9e469);if(_0x1b4824[_0xd0a2('0x43')][_0xd0a2('0x4f')]){_0x408fba[_0xd0a2('0x4d')]=_['merge'](_0x408fba[_0xd0a2('0x4d')],{'$or':_[_0xd0a2('0x3f')](_0xe9e469,function(_0x98df6b){if(_0x98df6b[_0xd0a2('0x50')]!=='VIRTUAL'){var _0x4cfec2={};_0x4cfec2[_0x98df6b['name']]={'$like':'%'+_0x1b4824['query'][_0xd0a2('0x4f')]+'%'};return _0x4cfec2;}})});}_0x408fba=_[_0xd0a2('0x51')]({},_0x408fba,_0x1b4824[_0xd0a2('0x52')]);var _0x2293c8={'where':_0x408fba['where']};return db[_0xd0a2('0x40')][_0xd0a2('0x32')](_0x2293c8)[_0xd0a2('0x3a')](function(_0x5ec3b8){_0x331418[_0xd0a2('0x32')]=_0x5ec3b8;if(_0x1b4824[_0xd0a2('0x43')][_0xd0a2('0x53')]){_0x408fba['include']=[{'all':!![]}];}return db[_0xd0a2('0x40')][_0xd0a2('0x54')](_0x408fba);})[_0xd0a2('0x3a')](function(_0x205550){_0x331418[_0xd0a2('0x55')]=_0x205550;return _0x331418;})[_0xd0a2('0x3a')](respondWithFilteredResult(_0x1c6642,_0x408fba))['catch'](handleError(_0x1c6642,null));};exports[_0xd0a2('0x56')]=function(_0x3a68c9,_0x2eb322){var _0x2a43b9={'raw':!![],'where':{'id':_0x3a68c9[_0xd0a2('0x57')]['id']}},_0x203ef3={};_0x203ef3[_0xd0a2('0x47')]=_[_0xd0a2('0x58')](db[_0xd0a2('0x40')][_0xd0a2('0x59')]);_0x203ef3[_0xd0a2('0x43')]=_[_0xd0a2('0x58')](_0x3a68c9[_0xd0a2('0x43')]);_0x203ef3[_0xd0a2('0x44')]=_[_0xd0a2('0x45')](_0x203ef3['model'],_0x203ef3[_0xd0a2('0x43')]);_0x2a43b9[_0xd0a2('0x46')]=_[_0xd0a2('0x45')](_0x203ef3[_0xd0a2('0x47')],qs[_0xd0a2('0x48')](_0x3a68c9[_0xd0a2('0x43')][_0xd0a2('0x48')]));_0x2a43b9[_0xd0a2('0x46')]=_0x2a43b9[_0xd0a2('0x46')][_0xd0a2('0x49')]?_0x2a43b9[_0xd0a2('0x46')]:_0x203ef3[_0xd0a2('0x47')];if(_0x3a68c9[_0xd0a2('0x43')]['includeAll']){_0x2a43b9[_0xd0a2('0x5a')]=[{'all':!![]}];}_0x2a43b9=_[_0xd0a2('0x51')]({},_0x2a43b9,_0x3a68c9['options']);return db[_0xd0a2('0x40')][_0xd0a2('0x5b')](_0x2a43b9)[_0xd0a2('0x3a')](handleEntityNotFound(_0x2eb322,null))[_0xd0a2('0x3a')](respondWithResult(_0x2eb322,null))[_0xd0a2('0x2c')](handleError(_0x2eb322,null));};exports[_0xd0a2('0x5c')]=function(_0x2ca4f4,_0x10279f){return db[_0xd0a2('0x40')][_0xd0a2('0x5c')](_0x2ca4f4[_0xd0a2('0x5d')],{})[_0xd0a2('0x3a')](respondWithResult(_0x10279f,0xc9))[_0xd0a2('0x2c')](handleError(_0x10279f,null));};exports[_0xd0a2('0x39')]=function(_0x457942,_0x2b6561){if(_0x457942['body']['id']){delete _0x457942[_0xd0a2('0x5d')]['id'];}return db['WhatsappMessage'][_0xd0a2('0x5b')]({'where':{'id':_0x457942[_0xd0a2('0x57')]['id']}})[_0xd0a2('0x3a')](handleEntityNotFound(_0x2b6561,null))[_0xd0a2('0x3a')](saveUpdates(_0x457942[_0xd0a2('0x5d')],null))['then'](respondWithResult(_0x2b6561,null))[_0xd0a2('0x2c')](handleError(_0x2b6561,null));};exports['destroy']=function(_0x4d5886,_0x4fb36c){return db['WhatsappMessage'][_0xd0a2('0x5b')]({'where':{'id':_0x4d5886[_0xd0a2('0x57')]['id']}})['then'](handleEntityNotFound(_0x4fb36c,null))['then'](removeEntity(_0x4fb36c,null))['catch'](handleError(_0x4fb36c,null));};exports[_0xd0a2('0x5e')]=function(_0x3e93bc,_0x24a096){return db['WhatsappMessage'][_0xd0a2('0x5e')]()[_0xd0a2('0x3a')](respondWithResult(_0x24a096,null))['catch'](handleError(_0x24a096,null));};var interaction_log=require(_0xd0a2('0x5f'))(_0xd0a2('0x60'));exports[_0xd0a2('0x61')]=function(_0x20497b,_0x4aeb97,_0x28bb36){var _0x536357={'agent':{},'channel':_0xd0a2('0x62')};if(_0x20497b['body']['id']){delete _0x20497b[_0xd0a2('0x5d')]['id'];}_0x20497b[_0xd0a2('0x5d')]['read']=!![];_0x20497b['body'][_0xd0a2('0x63')]=moment()['format'](_0xd0a2('0x64'));_0x20497b[_0xd0a2('0x5d')][_0xd0a2('0x65')]=_0x20497b['body'][_0xd0a2('0x65')]||_0x20497b['user']['id'];_0x536357[_0xd0a2('0x66')]['id']=_0x20497b[_0xd0a2('0x5d')][_0xd0a2('0x65')];return db[_0xd0a2('0x40')][_0xd0a2('0x5b')]({'where':{'id':_0x20497b['params']['id'],'UserId':null}})[_0xd0a2('0x3a')](handleEntityNotFound(_0x4aeb97,null))[_0xd0a2('0x3a')](saveUpdates(_0x20497b[_0xd0a2('0x5d')],null))[_0xd0a2('0x3a')](function(_0x452156){if(_0x452156){_0x536357[_0xd0a2('0x2a')]=_0x452156[_0xd0a2('0x67')]({'plain':!![]});return db[_0xd0a2('0x68')][_0xd0a2('0x5b')]({'where':{'id':_0x452156[_0xd0a2('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x4aeb97,null))['then'](function(_0x2e5643){if(_0x2e5643){return _0x2e5643[_0xd0a2('0x39')]({'UserId':_0x20497b[_0xd0a2('0x5d')][_0xd0a2('0x65')],'read1stAt':_[_0xd0a2('0x6a')](_0x2e5643[_0xd0a2('0x6b')])?moment()[_0xd0a2('0x6c')](_0xd0a2('0x64')):undefined});}return null;})['then'](function(_0x111c44){if(_0x111c44){_0x536357[_0xd0a2('0x6d')]=_0x111c44[_0xd0a2('0x67')]({'plain':!![]});interaction_log[_0xd0a2('0x24')](_0xd0a2('0x6e'),_0x20497b['user']['id'],_0x20497b[_0xd0a2('0x6f')][_0xd0a2('0x3d')],_0x20497b['user']['role'],_0x536357[_0xd0a2('0x6d')]['id'],_0x20497b[_0xd0a2('0x5d')]?JSON[_0xd0a2('0x28')](_0x20497b[_0xd0a2('0x5d')]):_0xd0a2('0x70'));return respondWithRpcPromise(_0xd0a2('0x71'),_0xd0a2('0x72'),_0x536357);}return null;})['then'](function(_0x52e359){var _0x34fe5f=_0xd0a2('0x73')+_0x52e359[_0xd0a2('0x2a')][_0xd0a2('0x74')];return db[_0xd0a2('0x75')]['query'](_0x34fe5f,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xd0a2('0x3a')](function(_0x4d1104){return _0x4d1104;});})[_0xd0a2('0x3a')](function(_0x414c8c){if(_0x414c8c){_0x536357['message'][_0xd0a2('0x76')]=_0x414c8c[0x0];if(!_0x20497b[_0xd0a2('0x5d')][_0xd0a2('0x65')])return;return db[_0xd0a2('0x77')][_0xd0a2('0x5b')]({'where':{'id':_0x20497b[_0xd0a2('0x5d')]['UserId'],'role':_0xd0a2('0x66')},'attributes':['id','name','fullname',_0xd0a2('0x78'),'internal'],'raw':!![]});}return null;})[_0xd0a2('0x3a')](function(_0x314bd0){if(!_0x314bd0)return null;_0x536357[_0xd0a2('0x2a')][_0xd0a2('0x66')]=_0x314bd0;return _0x536357;})[_0xd0a2('0x3a')](function(_0x146603){if(_0x146603){if(_0x20497b[_0xd0a2('0x5d')]['manual']){_0x536357[_0xd0a2('0x2a')][_0xd0a2('0x79')]=util[_0xd0a2('0x6c')](_0xd0a2('0x7a'),_0x20497b[_0xd0a2('0x6f')][_0xd0a2('0x3d')]);_0x536357[_0xd0a2('0x2a')][_0xd0a2('0x7b')]=_0x536357[_0xd0a2('0x7b')];_0x536357[_0xd0a2('0x2a')][_0xd0a2('0x7c')]=_0x536357[_0xd0a2('0x7b')];_0x536357[_0xd0a2('0x2a')]['event']=_0xd0a2('0x61');return respondWithRpcPromise(_0xd0a2('0x7d'),'EventManager',{'event':_0xd0a2('0x7e'),'message':_0x536357[_0xd0a2('0x2a')]},client9002)[_0xd0a2('0x3a')](function(){return _0x536357;});}return _0x536357;}return null;})[_0xd0a2('0x3a')](respondWithResult(_0x4aeb97,null))['catch'](handleError(_0x4aeb97,null));};var interaction_log=require('../../config/logger')(_0xd0a2('0x60'));exports[_0xd0a2('0x37')]=function(_0x116231,_0x2da41a,_0x21be9c){var _0x5c7100={'agent':{},'channel':_0xd0a2('0x62')};if(_0x116231[_0xd0a2('0x5d')]['id']){delete _0x116231[_0xd0a2('0x5d')]['id'];}_0x116231['body']['UserId']=_0x116231[_0xd0a2('0x5d')][_0xd0a2('0x65')]||_0x116231[_0xd0a2('0x6f')]['id'];_0x5c7100[_0xd0a2('0x66')]['id']=_0x116231[_0xd0a2('0x5d')][_0xd0a2('0x65')];return db[_0xd0a2('0x40')][_0xd0a2('0x5b')]({'where':{'id':_0x116231[_0xd0a2('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2da41a,null))['then'](function(_0x557b4d){if(_0x557b4d){_0x5c7100[_0xd0a2('0x2a')]=_0x557b4d[_0xd0a2('0x67')]({'plain':!![]});return db['WhatsappInteraction'][_0xd0a2('0x5b')]({'where':{'id':_0x557b4d[_0xd0a2('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x2da41a,null))['then'](function(_0x56daf0){if(_0x56daf0){_0x5c7100[_0xd0a2('0x6d')]=_0x56daf0[_0xd0a2('0x67')]({'plain':!![]});interaction_log[_0xd0a2('0x24')](_0xd0a2('0x7f'),_0x116231[_0xd0a2('0x6f')]['id'],_0x116231[_0xd0a2('0x6f')][_0xd0a2('0x3d')],_0x116231['user'][_0xd0a2('0x80')],_0x5c7100['interaction']['id'],_0x116231[_0xd0a2('0x5d')]?JSON[_0xd0a2('0x28')](_0x116231[_0xd0a2('0x5d')]):'null');return respondWithRpcPromise(_0xd0a2('0x81'),'rejectMessage',_0x5c7100);}return null;})['then'](function(_0x5e4b78){var _0x84bb1d=_0xd0a2('0x73')+_0x5e4b78[_0xd0a2('0x2a')][_0xd0a2('0x74')];return db[_0xd0a2('0x75')][_0xd0a2('0x43')](_0x84bb1d,{'type':db[_0xd0a2('0x82')][_0xd0a2('0x83')][_0xd0a2('0x84')],'raw':!![]})[_0xd0a2('0x3a')](function(_0x2843f0){return _0x2843f0;});})[_0xd0a2('0x3a')](function(_0x2b1af8){if(_0x2b1af8){_0x5c7100['message'][_0xd0a2('0x76')]=_0x2b1af8[0x0];if(!_0x116231[_0xd0a2('0x5d')]['UserId'])return;return db[_0xd0a2('0x77')][_0xd0a2('0x5b')]({'where':{'id':_0x116231[_0xd0a2('0x5d')][_0xd0a2('0x65')],'role':_0xd0a2('0x66')},'attributes':['id',_0xd0a2('0x3d'),_0xd0a2('0x85'),'email',_0xd0a2('0x86')],'raw':!![]});}return null;})['then'](function(_0x203b5a){if(!_0x203b5a)return null;_0x5c7100[_0xd0a2('0x2a')][_0xd0a2('0x66')]=_0x203b5a;return _0x5c7100;})[_0xd0a2('0x3a')](function(_0x2b7581){if(_0x2b7581){_0x2b7581[_0xd0a2('0x2a')][_0xd0a2('0x79')]=util[_0xd0a2('0x6c')](_0xd0a2('0x7a'),_0x116231[_0xd0a2('0x6f')][_0xd0a2('0x3d')]);_0x2b7581[_0xd0a2('0x2a')]['channel']=_0x5c7100['channel'];_0x2b7581['message'][_0xd0a2('0x7c')]=_0x5c7100[_0xd0a2('0x7b')];_0x2b7581[_0xd0a2('0x2a')][_0xd0a2('0x87')]='reject';respondWithRpcPromise(_0xd0a2('0x7d'),_0xd0a2('0x7d'),{'event':_0xd0a2('0x88'),'message':_0x2b7581['message']},client9002);return _0x5c7100;}return null;})['then'](respondWithResult(_0x2da41a,null))[_0xd0a2('0x2c')](handleError(_0x2da41a,null));};exports['status']=function(_0x3944e0,_0x436d48,_0x56b207){if(_0x3944e0[_0xd0a2('0x5d')]['id']){delete _0x3944e0[_0xd0a2('0x5d')]['id'];}var _0x3ce816;return db[_0xd0a2('0x40')]['find']({'where':{'id':_0x3944e0[_0xd0a2('0x57')]['id']}})[_0xd0a2('0x3a')](handleEntityNotFound(_0x436d48,null))['then'](function(_0x4ff828){if(_0x4ff828){_0x3ce816=_0x4ff828;return db[_0xd0a2('0x89')][_0xd0a2('0x5b')]({'where':{'id':_0x4ff828[_0xd0a2('0x8a')]}});}})['then'](handleEntityNotFound(_0x436d48,null))['then'](function(_0x2b9924){if(_0x2b9924){logger[_0xd0a2('0x8b')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xd0a2('0x2e'),_0xd0a2('0x8c'),_0x2b9924[_0xd0a2('0x50')],util[_0xd0a2('0x8d')](_0x3944e0[_0xd0a2('0x5d')],{'showHidden':![],'depth':null}));switch(_0x2b9924[_0xd0a2('0x50')]){case'twilio':if(_0x3944e0['body']['MessageSid']&&_0x3944e0[_0xd0a2('0x5d')][_0xd0a2('0x8e')]===_0x3ce816[_0xd0a2('0x8f')]&&_0x3944e0[_0xd0a2('0x5d')][_0xd0a2('0x90')]&&_0x3944e0[_0xd0a2('0x5d')][_0xd0a2('0x90')]==='read'){return _0x3ce816[_0xd0a2('0x39')]({'read':!![]});}else{logger[_0xd0a2('0x29')](_0xd0a2('0x91'),'status',_0xd0a2('0x92'),util[_0xd0a2('0x8d')](_0x3944e0[_0xd0a2('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x3ce816;}})['then'](respondWithResult(_0x436d48,null))[_0xd0a2('0x2c')](handleError(_0x436d48,null));};
\ No newline at end of file
index 2d6b25f..0507a14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06ef=['emit','WhatsappMessage'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x06ef,0x185));var _0xf06e=function(_0x47c165,_0x189d08){_0x47c165=_0x47c165-0x0;var _0x10d689=_0x06ef[_0x47c165];return _0x10d689;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0xf06e('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x404485){return function(_0x1281ca,_0x16d4da,_0x569390){WhatsappMessageEvents[_0xf06e('0x1')](_0x404485+':'+_0x1281ca['id'],_0x1281ca);WhatsappMessageEvents[_0xf06e('0x1')](_0x404485,_0x1281ca);_0x569390(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
+var _0xb9be=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xb9be,0xc5));var _0xeb9b=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xb9be[_0xd0b415];return _0x2bdf2c;};'use strict';var EventEmitter=require(_0xeb9b('0x0'));var WhatsappMessage=require(_0xeb9b('0x1'))['db'][_0xeb9b('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xeb9b('0x3')](0x0);var events={'afterCreate':_0xeb9b('0x4'),'afterUpdate':_0xeb9b('0x5'),'afterDestroy':_0xeb9b('0x6')};function emitEvent(_0x2003d4){return function(_0x288aaa,_0x579a7e,_0x5006b8){WhatsappMessageEvents[_0xeb9b('0x7')](_0x2003d4+':'+_0x288aaa['id'],_0x288aaa);WhatsappMessageEvents[_0xeb9b('0x7')](_0x2003d4,_0x288aaa);_0x5006b8(null);};}for(var e in events){if(events[_0xeb9b('0x8')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xeb9b('0x9')]=WhatsappMessageEvents;
\ No newline at end of file
index fdecaf8..becd0f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe220=['toLowerCase','out','secret','isNil','UserId','WhatsappInteractionId','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','messages','create','phone','whatsapp:','remote','/api/whatsapp/messages/','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','api','moment','request-promise','node-fetch','path','../../config/environment','./whatsappMessage.attributes','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction'];(function(_0x206711,_0x4125b4){var _0x4fe02b=function(_0x27dc45){while(--_0x27dc45){_0x206711['push'](_0x206711['shift']());}};_0x4fe02b(++_0x4125b4);}(_0xe220,0x9e));var _0x0e22=function(_0x26a4e7,_0x45d492){_0x26a4e7=_0x26a4e7-0x0;var _0x15d773=_0xe220[_0x26a4e7];return _0x15d773;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0e22('0x0'));var moment=require(_0x0e22('0x1'));var BPromise=require('bluebird');var rp=require(_0x0e22('0x2'));var fetch=require(_0x0e22('0x3'));var fs=require('fs');var path=require(_0x0e22('0x4'));var rimraf=require('rimraf');var config=require(_0x0e22('0x5'));var attributes=require(_0x0e22('0x6'));module['exports']=function(_0x19d5c9,_0x379215){return _0x19d5c9['define'](_0x0e22('0x7'),attributes,{'tableName':_0x0e22('0x8'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x0e22('0x9')]},{'name':_0x0e22('0xa'),'fields':[_0x0e22('0xb')],'type':_0x0e22('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b95d7,_0x4e21c9,_0x5157c8){var _0x5c14a2=_0x19d5c9[_0x0e22('0xd')];var _0xa44f6=_0x3b95d7[_0x0e22('0xe')]({'plain':!![]});if(_0xa44f6[_0x0e22('0xf')][_0x0e22('0x10')]()==='in'||_0xa44f6[_0x0e22('0xf')][_0x0e22('0x10')]()===_0x0e22('0x11')&&!_0xa44f6[_0x0e22('0x12')]&&!_[_0x0e22('0x13')](_0xa44f6[_0x0e22('0x14')])){_0x5c14a2['WhatsappInteraction']['findOne']({'where':{'id':_0xa44f6[_0x0e22('0x15')]}})['then'](function(_0x11b1bf){if(_0x11b1bf){_0x11b1bf[_0x0e22('0x16')]({'lastMsgAt':_0xa44f6[_0x0e22('0x17')],'lastMsgDirection':_0xa44f6['direction'][_0x0e22('0x10')]()});}})[_0x0e22('0x18')](function(_0xc6c311){console[_0x0e22('0x19')](_0xc6c311);});}if(_0xa44f6['direction']==='out'&&!_0xa44f6[_0x0e22('0x12')]){var _0x11ae90;_0x5c14a2[_0x0e22('0x1a')][_0x0e22('0x1b')]({'where':{'id':_0xa44f6[_0x0e22('0x1c')]},'raw':!![]})[_0x0e22('0x1d')](function(_0x21f3ad){_0x11ae90=_0x21f3ad;if(_0x11ae90&&_0x11ae90[_0x0e22('0x1e')]){switch(_0x11ae90[_0x0e22('0x1e')]){case _0x0e22('0x1f'):var _0xda3797=require('twilio');if(_0x11ae90[_0x0e22('0x20')]&&_0x11ae90['authToken']&&_0x11ae90['phone']){var _0x262c4d=new _0xda3797(_0x11ae90[_0x0e22('0x20')],_0x11ae90[_0x0e22('0x21')]);_0x262c4d[_0x0e22('0x22')][_0x0e22('0x23')]({'body':_0xa44f6[_0x0e22('0xb')],'to':'whatsapp:'+_0xa44f6[_0x0e22('0x24')],'from':_0x0e22('0x25')+_0x11ae90[_0x0e22('0x24')],'statusCallback':_0x11ae90[_0x0e22('0x26')]+_0x0e22('0x27')+_0xa44f6['id']+'/status?token='+_0x11ae90['token']})[_0x0e22('0x1d')](function(_0xd292b8){if(_0xd292b8[_0x0e22('0x28')]){return _0x3b95d7[_0x0e22('0x16')]({'messageId':_0xd292b8['sid']});}})[_0x0e22('0x18')](function(_0x46b201){logger[_0x0e22('0x19')](_0x0e22('0x29'),'afterCreate',_0x0e22('0x1f'),util[_0x0e22('0x2a')](_0x46b201,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0e22('0x29'),_0x0e22('0x2b'),_0x0e22('0x1f'),_0x0e22('0x2c'));}break;case _0x0e22('0x2d'):var _0x1d85ea=_0x11ae90['accountSid'];var _0x43c872=_0x11ae90[_0x0e22('0x21')];var _0x33276c=_0x11ae90[_0x0e22('0x2e')]+_0x0e22('0x2f')+_0x1d85ea+_0x0e22('0x30');var _0x4b0ff6={'to':[_0xa44f6['phone']],'message':{'type':_0x0e22('0x31'),'text':_0xa44f6[_0x0e22('0xb')]}};var _0x813282={'method':_0x0e22('0x32'),'uri':_0x33276c,'headers':{'Authorization':_0x0e22('0x33')+_0x43c872,'Content-Type':'application/json'},'body':_0x4b0ff6,'json':!![]};rp(_0x813282)['then'](function(_0x352470){if(_0x352470[_0x0e22('0x34')][0x0][_0x0e22('0x35')]){return _0x3b95d7['update']({'messageId':_0x352470['statuses'][0x0]['message_id']});}})['catch'](function(_0x4049a3){logger[_0x0e22('0x36')](_0x0e22('0x37'),_0x4049a3);});break;}}})[_0x0e22('0x38')](function(){_0x5157c8();});}else{_0x5157c8();}}},'charset':'utf8mb4','collate':_0x0e22('0x39')});};
\ No newline at end of file
+var _0x213f=['direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','update','createdAt','catch','secret','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','messages','create','whatsapp:','phone','/api/whatsapp/messages/','/status?token=','token','then','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','authToken','baseUrl','/whatsapp/v1/','/messages/','text','application/json','statuses','message_id','WhatsappMessage,\x20%s','utf8mb4','util','api','moment','bluebird','request-promise','node-fetch','path','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get'];(function(_0x1f920f,_0x2eb533){var _0x3fc2f7=function(_0x1b9d48){while(--_0x1b9d48){_0x1f920f['push'](_0x1f920f['shift']());}};_0x3fc2f7(++_0x2eb533);}(_0x213f,0x145));var _0xf213=function(_0x3f2239,_0x125579){_0x3f2239=_0x3f2239-0x0;var _0x127b75=_0x213f[_0x3f2239];return _0x127b75;};'use strict';var _=require('lodash');var util=require(_0xf213('0x0'));var logger=require('../../config/logger')(_0xf213('0x1'));var moment=require(_0xf213('0x2'));var BPromise=require(_0xf213('0x3'));var rp=require(_0xf213('0x4'));var fetch=require(_0xf213('0x5'));var fs=require('fs');var path=require(_0xf213('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf213('0x7'));module['exports']=function(_0x29f545,_0xb54862){return _0x29f545[_0xf213('0x8')](_0xf213('0x9'),attributes,{'tableName':_0xf213('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xf213('0xb')]},{'name':_0xf213('0xc'),'fields':[_0xf213('0xd')],'type':_0xf213('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d1549,_0x26e2e0,_0x4b8356){var _0x29cfbe=_0x29f545[_0xf213('0xf')];var _0x2c535b=_0x5d1549[_0xf213('0x10')]({'plain':!![]});if(_0x2c535b[_0xf213('0x11')][_0xf213('0x12')]()==='in'||_0x2c535b['direction'][_0xf213('0x12')]()===_0xf213('0x13')&&!_0x2c535b['secret']&&!_[_0xf213('0x14')](_0x2c535b[_0xf213('0x15')])){_0x29cfbe[_0xf213('0x16')]['findOne']({'where':{'id':_0x2c535b[_0xf213('0x17')]}})['then'](function(_0x367091){if(_0x367091){_0x367091[_0xf213('0x18')]({'lastMsgAt':_0x2c535b[_0xf213('0x19')],'lastMsgDirection':_0x2c535b['direction'][_0xf213('0x12')]()});}})[_0xf213('0x1a')](function(_0x3ffb8f){console['error'](_0x3ffb8f);});}if(_0x2c535b['direction']===_0xf213('0x13')&&!_0x2c535b[_0xf213('0x1b')]){var _0x239cb8;_0x29cfbe[_0xf213('0x1c')]['find']({'where':{'id':_0x2c535b[_0xf213('0x1d')]},'raw':!![]})['then'](function(_0x11c4d9){_0x239cb8=_0x11c4d9;if(_0x239cb8&&_0x239cb8[_0xf213('0x1e')]){switch(_0x239cb8['type']){case _0xf213('0x1f'):var _0x4699e6=require(_0xf213('0x1f'));if(_0x239cb8[_0xf213('0x20')]&&_0x239cb8['authToken']&&_0x239cb8['phone']){var _0x2f591e=new _0x4699e6(_0x239cb8['accountSid'],_0x239cb8['authToken']);_0x2f591e[_0xf213('0x21')][_0xf213('0x22')]({'body':_0x2c535b[_0xf213('0xd')],'to':_0xf213('0x23')+_0x2c535b[_0xf213('0x24')],'from':_0xf213('0x23')+_0x239cb8['phone'],'statusCallback':_0x239cb8['remote']+_0xf213('0x25')+_0x2c535b['id']+_0xf213('0x26')+_0x239cb8[_0xf213('0x27')]})[_0xf213('0x28')](function(_0x4d3a53){if(_0x4d3a53['sid']){return _0x5d1549[_0xf213('0x18')]({'messageId':_0x4d3a53[_0xf213('0x29')]});}})[_0xf213('0x1a')](function(_0x517c35){logger[_0xf213('0x2a')](_0xf213('0x2b'),_0xf213('0x2c'),_0xf213('0x1f'),util[_0xf213('0x2d')](_0x517c35,{'showHidden':![],'depth':null}));});}else{logger[_0xf213('0x2a')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xf213('0x2c'),_0xf213('0x1f'),_0xf213('0x2e'));}break;case'sinch':var _0x453f56=_0x239cb8['accountSid'];var _0x37f201=_0x239cb8[_0xf213('0x2f')];var _0xff05e8=_0x239cb8[_0xf213('0x30')]+_0xf213('0x31')+_0x453f56+_0xf213('0x32');var _0x1152bb={'to':[_0x2c535b[_0xf213('0x24')]],'message':{'type':_0xf213('0x33'),'text':_0x2c535b[_0xf213('0xd')]}};var _0x2739d6={'method':'POST','uri':_0xff05e8,'headers':{'Authorization':'Bearer\x20'+_0x37f201,'Content-Type':_0xf213('0x34')},'body':_0x1152bb,'json':!![]};rp(_0x2739d6)['then'](function(_0x5d6034){if(_0x5d6034[_0xf213('0x35')][0x0][_0xf213('0x36')]){return _0x5d1549[_0xf213('0x18')]({'messageId':_0x5d6034['statuses'][0x0][_0xf213('0x36')]});}})[_0xf213('0x1a')](function(_0x1d0ed4){logger['err'](_0xf213('0x37'),_0x1d0ed4);});break;}}})['finally'](function(){_0x4b8356();});}else{_0x4b8356();}}},'charset':_0xf213('0x38'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 26f11a7..c093176 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e0d=['catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x2d11fb,_0x971ef1){var _0x377e16=function(_0xd27fb1){while(--_0xd27fb1){_0x2d11fb['push'](_0x2d11fb['shift']());}};_0x377e16(++_0x971ef1);}(_0x4e0d,0x76));var _0xd4e0=function(_0x348677,_0xca623b){_0x348677=_0x348677-0x0;var _0xf4126c=_0x4e0d[_0x348677];return _0xf4126c;};'use strict';var _=require(_0xd4e0('0x0'));var util=require(_0xd4e0('0x1'));var moment=require(_0xd4e0('0x2'));var BPromise=require(_0xd4e0('0x3'));var rs=require(_0xd4e0('0x4'));var fs=require('fs');var Redis=require(_0xd4e0('0x5'));var db=require(_0xd4e0('0x6'))['db'];var utils=require(_0xd4e0('0x7'));var logger=require(_0xd4e0('0x8'))(_0xd4e0('0x9'));var config=require(_0xd4e0('0xa'));var jayson=require(_0xd4e0('0xb'));var client=jayson[_0xd4e0('0xc')][_0xd4e0('0xd')]({'port':0x232a});config['redis']=_[_0xd4e0('0xe')](config[_0xd4e0('0xf')],{'host':_0xd4e0('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd4e0('0xf')]));require(_0xd4e0('0x11'))[_0xd4e0('0x12')](socket);function respondWithRpcPromise(_0x1412db,_0xb7f3b7,_0x3dfb9b){return new BPromise(function(_0x31f981,_0x15e575){return client[_0xd4e0('0x13')](_0x1412db,_0x3dfb9b)[_0xd4e0('0x14')](function(_0x2879bf){logger[_0xd4e0('0x15')](_0xd4e0('0x16'),_0xb7f3b7,_0xd4e0('0x17'));logger[_0xd4e0('0x18')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xb7f3b7,_0xd4e0('0x17'),JSON[_0xd4e0('0x19')](_0x2879bf));if(_0x2879bf[_0xd4e0('0x1a')]){if(_0x2879bf[_0xd4e0('0x1a')][_0xd4e0('0x1b')]===0x1f4){logger[_0xd4e0('0x1a')](_0xd4e0('0x16'),_0xb7f3b7,_0x2879bf['error']['message']);return _0x15e575(_0x2879bf[_0xd4e0('0x1a')]['message']);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0xb7f3b7,_0x2879bf[_0xd4e0('0x1a')][_0xd4e0('0x1c')]);return _0x31f981(_0x2879bf[_0xd4e0('0x1a')][_0xd4e0('0x1c')]);}else{logger[_0xd4e0('0x15')](_0xd4e0('0x16'),_0xb7f3b7,_0xd4e0('0x17'));_0x31f981(_0x2879bf[_0xd4e0('0x1d')]['message']);}})[_0xd4e0('0x1e')](function(_0x4b5fab){logger['error'](_0xd4e0('0x16'),_0xb7f3b7,_0x4b5fab);_0x15e575(_0x4b5fab);});});}exports[_0xd4e0('0x1f')]=function(_0x45f50a){var _0x482c6c=this;return new Promise(function(_0x56c104,_0x263445){return db[_0xd4e0('0x20')][_0xd4e0('0x21')](_0x45f50a[_0xd4e0('0x22')],{'raw':_0x45f50a[_0xd4e0('0x23')]?_0x45f50a[_0xd4e0('0x23')][_0xd4e0('0x24')]===undefined?!![]:![]:!![]})[_0xd4e0('0x14')](function(_0x302883){logger[_0xd4e0('0x15')]('CreateWhatsappMessage',_0x45f50a);logger['debug'](_0xd4e0('0x1f'),_0x45f50a,JSON[_0xd4e0('0x19')](_0x302883));_0x56c104(_0x302883);})['catch'](function(_0xd4cc5){logger['error'](_0xd4e0('0x1f'),_0xd4cc5['message'],_0x45f50a);_0x263445(_0x482c6c['error'](0x1f4,_0xd4cc5[_0xd4e0('0x1c')]));});});};
\ No newline at end of file
+var _0x1c49=['rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateWhatsappMessage','create','body','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0x1c49,0x7c));var _0x91c4=function(_0xfd7a15,_0x411ec0){_0xfd7a15=_0xfd7a15-0x0;var _0x5eb63d=_0x1c49[_0xfd7a15];return _0x5eb63d;};'use strict';var _=require(_0x91c4('0x0'));var util=require(_0x91c4('0x1'));var moment=require(_0x91c4('0x2'));var BPromise=require(_0x91c4('0x3'));var rs=require(_0x91c4('0x4'));var fs=require('fs');var Redis=require(_0x91c4('0x5'));var db=require(_0x91c4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x91c4('0x7'))(_0x91c4('0x8'));var config=require(_0x91c4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x91c4('0xa')]['http']({'port':0x232a});config[_0x91c4('0xb')]=_[_0x91c4('0xc')](config[_0x91c4('0xb')],{'host':_0x91c4('0xd'),'port':0x18eb});var socket=require(_0x91c4('0xe'))(new Redis(config[_0x91c4('0xb')]));require(_0x91c4('0xf'))[_0x91c4('0x10')](socket);function respondWithRpcPromise(_0x206254,_0x5af017,_0x3c3fce){return new BPromise(function(_0xd8cb0,_0x2f4114){return client[_0x91c4('0x11')](_0x206254,_0x3c3fce)[_0x91c4('0x12')](function(_0x5e4a6a){logger['info'](_0x91c4('0x13'),_0x5af017,_0x91c4('0x14'));logger[_0x91c4('0x15')](_0x91c4('0x16'),_0x5af017,_0x91c4('0x14'),JSON[_0x91c4('0x17')](_0x5e4a6a));if(_0x5e4a6a[_0x91c4('0x18')]){if(_0x5e4a6a[_0x91c4('0x18')][_0x91c4('0x19')]===0x1f4){logger[_0x91c4('0x18')](_0x91c4('0x13'),_0x5af017,_0x5e4a6a[_0x91c4('0x18')]['message']);return _0x2f4114(_0x5e4a6a['error'][_0x91c4('0x1a')]);}logger[_0x91c4('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x5af017,_0x5e4a6a[_0x91c4('0x18')][_0x91c4('0x1a')]);return _0xd8cb0(_0x5e4a6a['error'][_0x91c4('0x1a')]);}else{logger[_0x91c4('0x1b')]('WhatsappMessage,\x20%s,\x20%s',_0x5af017,'request\x20sent');_0xd8cb0(_0x5e4a6a[_0x91c4('0x1c')][_0x91c4('0x1a')]);}})[_0x91c4('0x1d')](function(_0x54fd14){logger[_0x91c4('0x18')](_0x91c4('0x13'),_0x5af017,_0x54fd14);_0x2f4114(_0x54fd14);});});}exports[_0x91c4('0x1e')]=function(_0x4107a4){var _0x493495=this;return new Promise(function(_0x254321,_0x1bcf61){return db['WhatsappMessage'][_0x91c4('0x1f')](_0x4107a4[_0x91c4('0x20')],{'raw':_0x4107a4['options']?_0x4107a4['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2429a8){logger[_0x91c4('0x1b')](_0x91c4('0x1e'),_0x4107a4);logger[_0x91c4('0x15')](_0x91c4('0x1e'),_0x4107a4,JSON[_0x91c4('0x17')](_0x2429a8));_0x254321(_0x2429a8);})[_0x91c4('0x1d')](function(_0x340084){logger[_0x91c4('0x18')](_0x91c4('0x1e'),_0x340084['message'],_0x4107a4);_0x1bcf61(_0x493495[_0x91c4('0x18')](0x1f4,_0x340084[_0x91c4('0x1a')]));});});};
\ No newline at end of file
index d8d506b..46e13ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0ba=['removeListener','length','whatsappMessage:','./whatsappMessage.events','save','remove','emit'];(function(_0x42943b,_0x2fabb7){var _0x3c4836=function(_0x2c69ab){while(--_0x2c69ab){_0x42943b['push'](_0x42943b['shift']());}};_0x3c4836(++_0x2fabb7);}(_0xb0ba,0x192));var _0xab0b=function(_0xcce245,_0x4ceaf8){_0xcce245=_0xcce245-0x0;var _0x52d4e4=_0xb0ba[_0xcce245];return _0x52d4e4;};'use strict';var WhatsappMessageEvents=require(_0xab0b('0x0'));var events=[_0xab0b('0x1'),_0xab0b('0x2'),'update'];function createListener(_0x5c197c,_0x2b12a7){return function(_0x32d40f){_0x2b12a7[_0xab0b('0x3')](_0x5c197c,_0x32d40f);};}function removeListener(_0x557edd,_0x2535ea){return function(){WhatsappMessageEvents[_0xab0b('0x4')](_0x557edd,_0x2535ea);};}exports['register']=function(_0x3979ae){for(var _0x1a3653=0x0,_0x54d624=events[_0xab0b('0x5')];_0x1a3653<_0x54d624;_0x1a3653++){var _0x4502bc=events[_0x1a3653];var _0x9d44cd=createListener(_0xab0b('0x6')+_0x4502bc,_0x3979ae);WhatsappMessageEvents['on'](_0x4502bc,_0x9d44cd);}};
\ No newline at end of file
+var _0xef8c=['save','remove','update','emit','removeListener','register','length','whatsappMessage:'];(function(_0x32da04,_0x255b7b){var _0x468bac=function(_0x4e2e53){while(--_0x4e2e53){_0x32da04['push'](_0x32da04['shift']());}};_0x468bac(++_0x255b7b);}(_0xef8c,0x110));var _0xcef8=function(_0x5090d4,_0x1950a7){_0x5090d4=_0x5090d4-0x0;var _0x56c310=_0xef8c[_0x5090d4];return _0x56c310;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xcef8('0x0'),_0xcef8('0x1'),_0xcef8('0x2')];function createListener(_0x3c53d4,_0x4a5cde){return function(_0x50f49c){_0x4a5cde[_0xcef8('0x3')](_0x3c53d4,_0x50f49c);};}function removeListener(_0x51ba28,_0x51d0b6){return function(){WhatsappMessageEvents[_0xcef8('0x4')](_0x51ba28,_0x51d0b6);};}exports[_0xcef8('0x5')]=function(_0x2bd423){for(var _0x38af01=0x0,_0x3a8fa6=events[_0xcef8('0x6')];_0x38af01<_0x3a8fa6;_0x38af01++){var _0xbc7f76=events[_0x38af01];var _0x90c23f=createListener(_0xcef8('0x7')+_0xbc7f76,_0x2bd423);WhatsappMessageEvents['on'](_0xbc7f76,_0x90c23f);}};
\ No newline at end of file
index d1d1397..bdce300 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb97=['isAuthenticated','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','/:id','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','/describe'];(function(_0x44ab01,_0x3dd806){var _0xf35191=function(_0x2d94f4){while(--_0x2d94f4){_0x44ab01['push'](_0x44ab01['shift']());}};_0xf35191(++_0x3dd806);}(_0xfb97,0x13b));var _0x7fb9=function(_0x46cb21,_0x482f03){_0x46cb21=_0x46cb21-0x0;var _0x6dc6dc=_0xfb97[_0x46cb21];return _0x6dc6dc;};'use strict';var multer=require(_0x7fb9('0x0'));var util=require(_0x7fb9('0x1'));var path=require(_0x7fb9('0x2'));var timeout=require(_0x7fb9('0x3'));var express=require(_0x7fb9('0x4'));var router=express[_0x7fb9('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7fb9('0x6'));var config=require(_0x7fb9('0x7'));var controller=require('./whatsappQueue.controller');router[_0x7fb9('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7fb9('0x9'),auth[_0x7fb9('0xa')](),controller['describe']);router['get']('/:id',auth[_0x7fb9('0xa')](),controller[_0x7fb9('0xb')]);router[_0x7fb9('0x8')]('/:id/members',auth[_0x7fb9('0xa')](),controller[_0x7fb9('0xc')]);router[_0x7fb9('0x8')](_0x7fb9('0xd'),auth[_0x7fb9('0xa')](),controller[_0x7fb9('0xe')]);router['get'](_0x7fb9('0xf'),auth[_0x7fb9('0xa')](),controller[_0x7fb9('0x10')]);router[_0x7fb9('0x11')]('/',auth[_0x7fb9('0xa')](),controller['create']);router[_0x7fb9('0x11')]('/:id/teams',auth[_0x7fb9('0xa')](),controller[_0x7fb9('0x12')]);router[_0x7fb9('0x11')]('/:id/users',auth[_0x7fb9('0xa')](),controller['addAgents']);router['put'](_0x7fb9('0x13'),auth[_0x7fb9('0xa')](),controller[_0x7fb9('0x14')]);router[_0x7fb9('0x15')]('/:id',auth[_0x7fb9('0xa')](),controller[_0x7fb9('0x16')]);router['delete'](_0x7fb9('0xd'),auth[_0x7fb9('0xa')](),controller[_0x7fb9('0x17')]);router[_0x7fb9('0x15')](_0x7fb9('0xf'),auth[_0x7fb9('0xa')](),controller['removeAgents']);module[_0x7fb9('0x18')]=router;
\ No newline at end of file
+var _0x6325=['removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','destroy','removeTeams'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0x6325,0xb0));var _0x5632=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x6325[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x5632('0x0'));var util=require(_0x5632('0x1'));var path=require(_0x5632('0x2'));var timeout=require(_0x5632('0x3'));var express=require(_0x5632('0x4'));var router=express['Router']();var fs_extra=require(_0x5632('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5632('0x6'));var controller=require(_0x5632('0x7'));router[_0x5632('0x8')]('/',auth[_0x5632('0x9')](),controller[_0x5632('0xa')]);router[_0x5632('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x5632('0xb')]);router[_0x5632('0x8')](_0x5632('0xc'),auth['isAuthenticated'](),controller[_0x5632('0xd')]);router[_0x5632('0x8')](_0x5632('0xe'),auth[_0x5632('0x9')](),controller[_0x5632('0xf')]);router[_0x5632('0x8')](_0x5632('0x10'),auth[_0x5632('0x9')](),controller[_0x5632('0x11')]);router[_0x5632('0x8')](_0x5632('0x12'),auth['isAuthenticated'](),controller[_0x5632('0x13')]);router[_0x5632('0x14')]('/',auth[_0x5632('0x9')](),controller['create']);router[_0x5632('0x14')](_0x5632('0x10'),auth[_0x5632('0x9')](),controller[_0x5632('0x15')]);router[_0x5632('0x14')]('/:id/users',auth[_0x5632('0x9')](),controller[_0x5632('0x16')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5632('0x17')]);router[_0x5632('0x18')](_0x5632('0xc'),auth[_0x5632('0x9')](),controller[_0x5632('0x19')]);router[_0x5632('0x18')](_0x5632('0x10'),auth[_0x5632('0x9')](),controller[_0x5632('0x1a')]);router['delete'](_0x5632('0x12'),auth['isAuthenticated'](),controller[_0x5632('0x1b')]);module[_0x5632('0x1c')]=router;
\ No newline at end of file
index e6c66e0..cabc98f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fdc=['name','INTEGER','ENUM','beepall','roundrobin','STRING','exports'];(function(_0x121b4d,_0x30874d){var _0x5ece8e=function(_0x2498a2){while(--_0x2498a2){_0x121b4d['push'](_0x121b4d['shift']());}};_0x5ece8e(++_0x30874d);}(_0x4fdc,0x84));var _0xc4fd=function(_0x5a698e,_0x540aa5){_0x5a698e=_0x5a698e-0x0;var _0x3c4028=_0x4fdc[_0x5a698e];return _0x3c4028;};'use strict';var Sequelize=require('sequelize');module[_0xc4fd('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xc4fd('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xc4fd('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc4fd('0x3')]('rrmemory',_0xc4fd('0x4'),_0xc4fd('0x5'))},'description':{'type':Sequelize[_0xc4fd('0x6')]}};
\ No newline at end of file
+var _0x92d7=['rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM'];(function(_0x5c7e53,_0x174ce5){var _0x1c9af9=function(_0x38895d){while(--_0x38895d){_0x5c7e53['push'](_0x5c7e53['shift']());}};_0x1c9af9(++_0x174ce5);}(_0x92d7,0x17b));var _0x792d=function(_0x227564,_0x1c9bcc){_0x227564=_0x227564-0x0;var _0x645895=_0x92d7[_0x227564];return _0x645895;};'use strict';var Sequelize=require(_0x792d('0x0'));module['exports']={'name':{'type':Sequelize[_0x792d('0x1')],'unique':_0x792d('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x792d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x792d('0x4')](_0x792d('0x5'),_0x792d('0x6'),_0x792d('0x7'))},'description':{'type':Sequelize[_0x792d('0x1')]}};
\ No newline at end of file
index ee56e05..98b31a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5609=['merge','type','VIRTUAL','filter','options','count','include','findAll','catch','show','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','update','describe','getMembers','WhatsappQueueId','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','whatsappPause','createdAt','getTeams','findOne','Team','Agents','voicePause','interface','sequelize','transaction','addTeams','each','UserWhatsappQueue','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','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','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','get','WhatsappQueues','UserProfileResource','error','name','send','map','WhatsappQueue','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1cb574,_0x318720){var _0x3f11a5=function(_0xa75264){while(--_0xa75264){_0x1cb574['push'](_0x1cb574['shift']());}};_0x3f11a5(++_0x318720);}(_0x5609,0x170));var _0x9560=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x5609[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0x9560('0x0'));var rimraf=require(_0x9560('0x1'));var zipdir=require(_0x9560('0x2'));var jsonpatch=require(_0x9560('0x3'));var rp=require('request-promise');var moment=require(_0x9560('0x4'));var BPromise=require(_0x9560('0x5'));var Mustache=require(_0x9560('0x6'));var util=require(_0x9560('0x7'));var path=require(_0x9560('0x8'));var sox=require(_0x9560('0x9'));var csv=require(_0x9560('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9560('0xb'));var _=require(_0x9560('0xc'));var squel=require('squel');var crypto=require(_0x9560('0xd'));var jsforce=require(_0x9560('0xe'));var deskjs=require(_0x9560('0xf'));var toCsv=require(_0x9560('0xa'));var querystring=require(_0x9560('0x10'));var Papa=require(_0x9560('0x11'));var Redis=require(_0x9560('0x12'));var authService=require(_0x9560('0x13'));var qs=require(_0x9560('0x14'));var as=require(_0x9560('0x15'));var hardwareService=require(_0x9560('0x16'));var logger=require(_0x9560('0x17'))('api');var utils=require(_0x9560('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9560('0x19'))['db'];config[_0x9560('0x1a')]=_[_0x9560('0x1b')](config[_0x9560('0x1a')],{'host':_0x9560('0x1c'),'port':0x18eb});var socket=require(_0x9560('0x1d'))(new Redis(config[_0x9560('0x1a')]));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x14a8e2,_0xa9cfe9){_0xa9cfe9=_0xa9cfe9||0xcc;return function(_0x1e0a62){if(_0x1e0a62){return _0x14a8e2[_0x9560('0x1e')](_0xa9cfe9);}return _0x14a8e2[_0x9560('0x1f')](_0xa9cfe9)[_0x9560('0x20')]();};}function respondWithResult(_0x44ab9f,_0x6600c0){_0x6600c0=_0x6600c0||0xc8;return function(_0x44d365){if(_0x44d365){return _0x44ab9f[_0x9560('0x1f')](_0x6600c0)[_0x9560('0x21')](_0x44d365);}};}function respondWithFilteredResult(_0x125ffb,_0x491bb3){return function(_0x3362aa){if(_0x3362aa){var _0x3f0181=typeof _0x491bb3[_0x9560('0x22')]===_0x9560('0x23')&&typeof _0x491bb3[_0x9560('0x24')]===_0x9560('0x23');var _0x40336f=_0x3362aa['count'];var _0x5a75b3=_0x3f0181?0x0:_0x491bb3['offset'];var _0x33b9d3=_0x3f0181?_0x3362aa['count']:_0x491bb3[_0x9560('0x22')]+_0x491bb3[_0x9560('0x24')];var _0x457b9c;if(_0x33b9d3>=_0x40336f){_0x33b9d3=_0x40336f;_0x457b9c=0xc8;}else{_0x457b9c=0xce;}_0x125ffb[_0x9560('0x1f')](_0x457b9c);return _0x125ffb[_0x9560('0x25')](_0x9560('0x26'),_0x5a75b3+'-'+_0x33b9d3+'/'+_0x40336f)[_0x9560('0x21')](_0x3362aa);}return null;};}function patchUpdates(_0x5c3394){return function(_0xe2a3a9){try{jsonpatch[_0x9560('0x27')](_0xe2a3a9,_0x5c3394,!![]);}catch(_0x5042ee){return BPromise[_0x9560('0x28')](_0x5042ee);}return _0xe2a3a9['save']();};}function saveUpdates(_0x200c6f,_0x47fb08){return function(_0x22dc21){if(_0x22dc21){return _0x22dc21['update'](_0x200c6f)[_0x9560('0x29')](function(_0x5435dc){return _0x5435dc;});}return null;};}function removeEntity(_0x31c5ba,_0x4ef076){return function(_0x7f3daa){if(_0x7f3daa){return _0x7f3daa[_0x9560('0x2a')]()[_0x9560('0x29')](function(){var _0x2ea635=_0x7f3daa[_0x9560('0x2b')]({'plain':!![]});var _0x5520dd=_0x9560('0x2c');return db[_0x9560('0x2d')][_0x9560('0x2a')]({'where':{'type':_0x5520dd,'resourceId':_0x2ea635['id']}})['then'](function(){return _0x7f3daa;});})[_0x9560('0x29')](function(){_0x31c5ba['status'](0xcc)[_0x9560('0x20')]();});}};}function handleEntityNotFound(_0x495b73,_0x341a21){return function(_0x50f50b){if(!_0x50f50b){_0x495b73[_0x9560('0x1e')](0x194);}return _0x50f50b;};}function handleError(_0x254442,_0x5da8cb){_0x5da8cb=_0x5da8cb||0x1f4;return function(_0x3a36ea){logger[_0x9560('0x2e')](_0x3a36ea['stack']);if(_0x3a36ea[_0x9560('0x2f')]){delete _0x3a36ea['name'];}_0x254442[_0x9560('0x1f')](_0x5da8cb)[_0x9560('0x30')](_0x3a36ea);};}exports['index']=function(_0x4bad29,_0x5bca4f){var _0x366d7e={},_0x50ccbb={},_0x1cc89e={'count':0x0,'rows':[]};var _0xb5fe52=_[_0x9560('0x31')](db[_0x9560('0x32')][_0x9560('0x33')],function(_0x2842b8){return{'name':_0x2842b8[_0x9560('0x34')],'type':_0x2842b8['type'][_0x9560('0x35')]};});_0x50ccbb[_0x9560('0x36')]=_[_0x9560('0x31')](_0xb5fe52,'name');_0x50ccbb['query']=_[_0x9560('0x37')](_0x4bad29[_0x9560('0x38')]);_0x50ccbb[_0x9560('0x39')]=_[_0x9560('0x3a')](_0x50ccbb[_0x9560('0x36')],_0x50ccbb['query']);_0x366d7e[_0x9560('0x3b')]=_['intersection'](_0x50ccbb[_0x9560('0x36')],qs[_0x9560('0x3c')](_0x4bad29[_0x9560('0x38')]['fields']));_0x366d7e[_0x9560('0x3b')]=_0x366d7e[_0x9560('0x3b')]['length']?_0x366d7e[_0x9560('0x3b')]:_0x50ccbb[_0x9560('0x36')];if(!_0x4bad29['query'][_0x9560('0x3d')](_0x9560('0x3e'))){_0x366d7e[_0x9560('0x24')]=qs[_0x9560('0x24')](_0x4bad29[_0x9560('0x38')]['limit']);_0x366d7e[_0x9560('0x22')]=qs['offset'](_0x4bad29['query'][_0x9560('0x22')]);}_0x366d7e[_0x9560('0x3f')]=qs[_0x9560('0x40')](_0x4bad29[_0x9560('0x38')][_0x9560('0x40')]);_0x366d7e[_0x9560('0x41')]=qs['filters'](_[_0x9560('0x42')](_0x4bad29[_0x9560('0x38')],_0x50ccbb[_0x9560('0x39')]),_0xb5fe52);if(_0x4bad29['query']['filter']){_0x366d7e[_0x9560('0x41')]=_[_0x9560('0x43')](_0x366d7e[_0x9560('0x41')],{'$or':_['map'](_0xb5fe52,function(_0x5e23ba){if(_0x5e23ba[_0x9560('0x44')]!==_0x9560('0x45')){var _0x523cc8={};_0x523cc8[_0x5e23ba['name']]={'$like':'%'+_0x4bad29[_0x9560('0x38')][_0x9560('0x46')]+'%'};return _0x523cc8;}})});}_0x366d7e=_[_0x9560('0x43')]({},_0x366d7e,_0x4bad29[_0x9560('0x47')]);var _0x565091={'where':_0x366d7e[_0x9560('0x41')]};return db['WhatsappQueue']['count'](_0x565091)['then'](function(_0x1f026e){_0x1cc89e[_0x9560('0x48')]=_0x1f026e;if(_0x4bad29[_0x9560('0x38')]['includeAll']){_0x366d7e[_0x9560('0x49')]=[{'all':!![]}];}return db[_0x9560('0x32')][_0x9560('0x4a')](_0x366d7e);})['then'](function(_0x4e7def){_0x1cc89e['rows']=_0x4e7def;return _0x1cc89e;})[_0x9560('0x29')](respondWithFilteredResult(_0x5bca4f,_0x366d7e))[_0x9560('0x4b')](handleError(_0x5bca4f,null));};exports[_0x9560('0x4c')]=function(_0x38466e,_0xcb3ca2){var _0x597fd7={'raw':!![],'where':{'id':_0x38466e[_0x9560('0x4d')]['id']}},_0x59b873={};_0x59b873[_0x9560('0x36')]=_[_0x9560('0x37')](db['WhatsappQueue'][_0x9560('0x33')]);_0x59b873[_0x9560('0x38')]=_[_0x9560('0x37')](_0x38466e[_0x9560('0x38')]);_0x59b873['filters']=_[_0x9560('0x3a')](_0x59b873[_0x9560('0x36')],_0x59b873[_0x9560('0x38')]);_0x597fd7[_0x9560('0x3b')]=_[_0x9560('0x3a')](_0x59b873[_0x9560('0x36')],qs['fields'](_0x38466e[_0x9560('0x38')][_0x9560('0x3c')]));_0x597fd7[_0x9560('0x3b')]=_0x597fd7[_0x9560('0x3b')][_0x9560('0x4e')]?_0x597fd7[_0x9560('0x3b')]:_0x59b873[_0x9560('0x36')];if(_0x38466e[_0x9560('0x38')][_0x9560('0x4f')]){_0x597fd7[_0x9560('0x49')]=[{'all':!![]}];}_0x597fd7=_[_0x9560('0x43')]({},_0x597fd7,_0x38466e[_0x9560('0x47')]);return db[_0x9560('0x32')][_0x9560('0x50')](_0x597fd7)[_0x9560('0x29')](handleEntityNotFound(_0xcb3ca2,null))[_0x9560('0x29')](respondWithResult(_0xcb3ca2,null))['catch'](handleError(_0xcb3ca2,null));};exports[_0x9560('0x51')]=function(_0x480942,_0x42c56f){return db['WhatsappQueue'][_0x9560('0x51')](_0x480942[_0x9560('0x52')],{})['then'](function(_0x58164d){var _0x563d79=_0x480942[_0x9560('0x53')][_0x9560('0x2b')]({'plain':!![]});if(!_0x563d79)throw new Error(_0x9560('0x54'));if(_0x563d79['role']===_0x9560('0x53')){var _0x53da10=_0x58164d[_0x9560('0x2b')]({'plain':!![]});var _0x2f2622=_0x9560('0x2c');return db[_0x9560('0x55')][_0x9560('0x50')]({'where':{'name':_0x2f2622,'userProfileId':_0x563d79[_0x9560('0x56')]},'raw':!![]})[_0x9560('0x29')](function(_0x404bf4){if(_0x404bf4&&_0x404bf4['autoAssociation']===0x0){return db['UserProfileResource'][_0x9560('0x51')]({'name':_0x53da10[_0x9560('0x2f')],'resourceId':_0x53da10['id'],'type':_0x404bf4[_0x9560('0x2f')],'sectionId':_0x404bf4['id']},{})['then'](function(){return _0x58164d;});}else{return _0x58164d;}})[_0x9560('0x4b')](function(_0x150557){logger[_0x9560('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x150557);throw _0x150557;});}return _0x58164d;})[_0x9560('0x29')](respondWithResult(_0x42c56f,0xc9))[_0x9560('0x4b')](handleError(_0x42c56f,null));};exports[_0x9560('0x57')]=function(_0x5b3774,_0x2c3012){if(_0x5b3774[_0x9560('0x52')]['id']){delete _0x5b3774[_0x9560('0x52')]['id'];}return db[_0x9560('0x32')]['find']({'where':{'id':_0x5b3774[_0x9560('0x4d')]['id']}})[_0x9560('0x29')](handleEntityNotFound(_0x2c3012,null))[_0x9560('0x29')](saveUpdates(_0x5b3774['body'],null))[_0x9560('0x29')](respondWithResult(_0x2c3012,null))[_0x9560('0x4b')](handleError(_0x2c3012,null));};exports[_0x9560('0x2a')]=function(_0x3964f5,_0xca3910){return db[_0x9560('0x32')]['find']({'where':{'id':_0x3964f5['params']['id']}})[_0x9560('0x29')](handleEntityNotFound(_0xca3910,null))[_0x9560('0x29')](removeEntity(_0xca3910,null))['catch'](handleError(_0xca3910,null));};exports[_0x9560('0x58')]=function(_0x449190,_0x5d77c3){return db[_0x9560('0x32')][_0x9560('0x58')]()[_0x9560('0x29')](respondWithResult(_0x5d77c3,null))[_0x9560('0x4b')](handleError(_0x5d77c3,null));};exports[_0x9560('0x59')]=function(_0x5da60c,_0x4f1e86,_0x3c0473){var _0x3b0ede={'raw':!![],'where':{}},_0x324440={},_0x143054;return db[_0x9560('0x32')]['findOne']({'where':{'id':_0x5da60c['params']['id']}})[_0x9560('0x29')](handleEntityNotFound(_0x4f1e86,null))['then'](function(_0x3244a8){if(_0x3244a8){_0x143054=_0x3244a8['get']({'plain':!![]});_0x324440[_0x9560('0x36')]=_[_0x9560('0x37')](db['UserWhatsappQueue'][_0x9560('0x33')]);_0x324440[_0x9560('0x38')]=_[_0x9560('0x37')](_0x5da60c[_0x9560('0x38')]);_0x324440[_0x9560('0x39')]=_[_0x9560('0x3a')](_0x324440['model'],_0x324440[_0x9560('0x38')]);_0x3b0ede[_0x9560('0x3b')]=_[_0x9560('0x3a')](_0x324440[_0x9560('0x36')],qs[_0x9560('0x3c')](_0x5da60c['query']['fields']));_0x3b0ede[_0x9560('0x3b')]=_0x3b0ede[_0x9560('0x3b')]['length']?_0x3b0ede[_0x9560('0x3b')]:_0x324440[_0x9560('0x36')];if(!_0x5da60c['query'][_0x9560('0x3d')]('nolimit')){_0x3b0ede[_0x9560('0x24')]=qs['limit'](_0x5da60c[_0x9560('0x38')][_0x9560('0x24')]);_0x3b0ede[_0x9560('0x22')]=qs[_0x9560('0x22')](_0x5da60c[_0x9560('0x38')][_0x9560('0x22')]);}_0x3b0ede['order']=qs[_0x9560('0x40')](_0x5da60c[_0x9560('0x38')][_0x9560('0x40')]);_0x3b0ede[_0x9560('0x41')]=qs[_0x9560('0x39')](_[_0x9560('0x42')](_0x5da60c['query'],_0x324440[_0x9560('0x39')]));_0x3b0ede[_0x9560('0x41')][_0x9560('0x5a')]=_0x3244a8['id'];if(_0x5da60c['query'][_0x9560('0x46')]){_0x3b0ede[_0x9560('0x41')]=_['merge'](_0x3b0ede['where'],{'$or':_[_0x9560('0x31')](_0x3b0ede[_0x9560('0x3b')],function(_0x55516d){var _0x118f53={};_0x118f53[_0x55516d]={'$like':'%'+_0x5da60c['query'][_0x9560('0x46')]+'%'};return _0x118f53;})});}_0x3b0ede=_[_0x9560('0x43')]({},_0x3b0ede,_0x5da60c['options']);return db['UserWhatsappQueue'][_0x9560('0x4a')](_0x3b0ede);}})['then'](function(_0x57d4e4){if(_0x57d4e4){return db[_0x9560('0x5b')][_0x9560('0x5c')]({'where':{'id':_[_0x9560('0x31')](_0x57d4e4,_0x9560('0x5d')),'role':_0x9560('0x5e')},'attributes':['id',_0x9560('0x2f'),'whatsappPause',_0x9560('0x5f'),'createdAt']});}})[_0x9560('0x29')](function(_0x344cef){if(_0x344cef){return{'count':_0x344cef[_0x9560('0x48')],'rows':_[_0x9560('0x31')](_0x344cef['rows'],function(_0x4e906f){return{'membername':_0x4e906f[_0x9560('0x2f')],'UserId':_0x4e906f['id'],'queue_name':_0x143054[_0x9560('0x2f')],'WhatsappQueueId':_0x143054['id'],'interface':util[_0x9560('0x60')](_0x9560('0x61'),'SIP',_0x4e906f[_0x9560('0x2f')]),'penalty':0x0,'paused':_0x4e906f[_0x9560('0x62')],'createdAt':_0x4e906f[_0x9560('0x63')],'updatedAt':_0x4e906f[_0x9560('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9560('0x29')](respondWithFilteredResult(_0x4f1e86,_0x3b0ede))[_0x9560('0x4b')](handleError(_0x4f1e86,null));};exports[_0x9560('0x64')]=function(_0x19ecdc,_0x3793df,_0x1c9177){var _0x1201f3={};var _0x248dd9={};var _0x54d317;var _0x1b5112;return db['WhatsappQueue'][_0x9560('0x65')]({'where':{'id':_0x19ecdc[_0x9560('0x4d')]['id']}})[_0x9560('0x29')](handleEntityNotFound(_0x3793df,null))[_0x9560('0x29')](function(_0x585197){if(_0x585197){_0x54d317=_0x585197;_0x248dd9[_0x9560('0x36')]=_[_0x9560('0x37')](db[_0x9560('0x66')]['rawAttributes']);_0x248dd9[_0x9560('0x38')]=_['keys'](_0x19ecdc[_0x9560('0x38')]);_0x248dd9[_0x9560('0x39')]=_[_0x9560('0x3a')](_0x248dd9[_0x9560('0x36')],_0x248dd9[_0x9560('0x38')]);_0x1201f3[_0x9560('0x3b')]=_['intersection'](_0x248dd9[_0x9560('0x36')],qs[_0x9560('0x3c')](_0x19ecdc[_0x9560('0x38')]['fields']));_0x1201f3['attributes']=_0x1201f3[_0x9560('0x3b')][_0x9560('0x4e')]?_0x1201f3[_0x9560('0x3b')]:_0x248dd9[_0x9560('0x36')];_0x1201f3['order']=qs[_0x9560('0x40')](_0x19ecdc[_0x9560('0x38')]['sort']);_0x1201f3[_0x9560('0x41')]=qs[_0x9560('0x39')](_[_0x9560('0x42')](_0x19ecdc[_0x9560('0x38')],_0x248dd9[_0x9560('0x39')]));if(_0x19ecdc['query'][_0x9560('0x46')]){_0x1201f3[_0x9560('0x41')]=_[_0x9560('0x43')](_0x1201f3['where'],{'$or':_['map'](_0x1201f3['attributes'],function(_0x44391c){var _0x29bed7={};_0x29bed7[_0x44391c]={'$like':'%'+_0x19ecdc[_0x9560('0x38')][_0x9560('0x46')]+'%'};return _0x29bed7;})});}_0x1201f3=_[_0x9560('0x43')]({},_0x1201f3,_0x19ecdc[_0x9560('0x47')]);return _0x54d317[_0x9560('0x64')](_0x1201f3);}})['then'](function(_0x3c1e37){if(_0x3c1e37){_0x1b5112=_0x3c1e37[_0x9560('0x4e')];if(!_0x19ecdc['query'][_0x9560('0x3d')](_0x9560('0x3e'))){_0x1201f3['limit']=qs[_0x9560('0x24')](_0x19ecdc[_0x9560('0x38')]['limit']);_0x1201f3[_0x9560('0x22')]=qs[_0x9560('0x22')](_0x19ecdc[_0x9560('0x38')][_0x9560('0x22')]);}return _0x54d317[_0x9560('0x64')](_0x1201f3);}})[_0x9560('0x29')](function(_0x161573){if(_0x161573){return _0x161573?{'count':_0x1b5112,'rows':_0x161573}:null;}})[_0x9560('0x29')](respondWithResult(_0x3793df,null))[_0x9560('0x4b')](handleError(_0x3793df,null));};exports['addTeams']=function(_0x417d15,_0x2ad07c,_0x241f8a){var _0x34e84a=_0x417d15[_0x9560('0x52')]['ids'];return db[_0x9560('0x66')][_0x9560('0x4a')]({'where':{'id':_0x34e84a},'attributes':['id'],'include':[{'model':db[_0x9560('0x5b')],'as':_0x9560('0x67'),'attributes':['id',_0x9560('0x2f'),'online',_0x9560('0x68'),_0x9560('0x69')],'raw':!![]}]})[_0x9560('0x29')](function(_0x1335da){if(_0x1335da){var _0x4a8d44=_['flatMap'](_0x1335da,function(_0x564942){var _0x5a511e=_0x564942[_0x9560('0x2b')]({'plain':!![]});return _0x5a511e[_0x9560('0x67')];});return db[_0x9560('0x32')][_0x9560('0x50')]({'where':{'id':_0x417d15['params']['id']}})[_0x9560('0x29')](function(_0x24aff3){return db[_0x9560('0x6a')][_0x9560('0x6b')](function(_0x4d35cf){return _0x24aff3[_0x9560('0x6c')](_0x34e84a,{'transaction':_0x4d35cf})['then'](function(){return BPromise[_0x9560('0x6d')](_0x4a8d44,function(_0x9c701c){return db[_0x9560('0x6e')][_0x9560('0x6f')]({'where':{'UserId':_0x9c701c['id'],'WhatsappQueueId':_0x417d15[_0x9560('0x4d')]['id']},'transaction':_0x4d35cf});});})[_0x9560('0x29')](function(){_0x4a8d44[_0x9560('0x70')](function(_0x47ae03){socket[_0x9560('0x71')](_0x9560('0x72'),{'UserId':_0x47ae03['id'],'WhatsappQueueId':_0x24aff3['id']});});});});});}})[_0x9560('0x29')](respondWithStatusCode(_0x2ad07c,null))[_0x9560('0x4b')](handleError(_0x2ad07c,null));};exports[_0x9560('0x73')]=function(_0x136f6f,_0x137615,_0x4dc183){return db[_0x9560('0x66')][_0x9560('0x4a')]({'where':{'id':_0x136f6f['query'][_0x9560('0x74')]},'attributes':['id'],'include':[{'model':db[_0x9560('0x5b')],'as':_0x9560('0x67'),'attributes':['id'],'raw':!![]}]})[_0x9560('0x29')](handleEntityNotFound(_0x137615,null))[_0x9560('0x29')](function(_0x235fd9){var _0x1a02ab=_['map'](_0x235fd9,'id');var _0x46fd39=[];var _0x3eda6a=[];var _0x2acfa0=squel[_0x9560('0x75')]();_0x2acfa0[_0x9560('0x76')](_0x9560('0x77'))[_0x9560('0x78')](_0x9560('0x79'),'tq')[_0x9560('0x7a')](_0x9560('0x7b'),'ut',_0x9560('0x7c'))['where'](_0x9560('0x7d'),_0x136f6f[_0x9560('0x4d')]['id']);for(var _0x2273ee=0x0;_0x2273ee<_0x235fd9['length'];_0x2273ee+=0x1){let _0x1aed23=_0x235fd9[_0x2273ee];for(var _0x442384=0x0;_0x442384<_0x1aed23[_0x9560('0x67')]['length'];_0x442384+=0x1){let _0x1b49b6=_0x1aed23[_0x9560('0x67')][_0x442384];var _0x2dd549=_0x2acfa0[_0x9560('0x7e')]();_0x2dd549[_0x9560('0x41')]('ut.UserId\x20=\x20?',_0x1b49b6['id']);_0x3eda6a[_0x9560('0x7f')](db[_0x9560('0x6a')][_0x9560('0x38')](_0x2dd549[_0x9560('0x80')](),{'type':db['sequelize'][_0x9560('0x81')][_0x9560('0x82')]})['then'](function(_0x268693){if(_0x268693[_0x9560('0x4e')]===0x1){return _0x1b49b6['id'];}else{var _0x55a89a=_[_0x9560('0x83')](_[_0x9560('0x31')](_0x268693,_0x9560('0x84')),function(_0x12e228){return _[_0x9560('0x85')](_0x1a02ab,_0x12e228);});if(_0x55a89a){return _0x1b49b6['id'];}}}));}}return BPromise[_0x9560('0x86')](_0x3eda6a)[_0x9560('0x29')](function(_0x430fee){_0x46fd39=_(_0x46fd39)[_0x9560('0x87')](_0x430fee)['compact']()[_0x9560('0x88')]();return db[_0x9560('0x32')][_0x9560('0x50')]({'where':{'id':_0x136f6f[_0x9560('0x4d')]['id']}})[_0x9560('0x29')](function(_0x995338){return db[_0x9560('0x6a')]['transaction'](function(_0x4c9a54){return _0x995338[_0x9560('0x73')](_0x136f6f[_0x9560('0x38')][_0x9560('0x74')],{'transaction':_0x4c9a54})[_0x9560('0x29')](function(){if(!_[_0x9560('0x89')](_0x46fd39)){return _0x995338[_0x9560('0x8a')](_0x46fd39,{'transaction':_0x4c9a54});}})[_0x9560('0x29')](function(){_0x46fd39['forEach'](function(_0x30d494){socket['emit'](_0x9560('0x8b'),{'UserId':_0x30d494,'WhatsappQueueId':_0x995338['id']});});});});});});})[_0x9560('0x29')](respondWithStatusCode(_0x137615,null))[_0x9560('0x4b')](handleError(_0x137615,null));};exports[_0x9560('0x8c')]=function(_0x2e024e,_0x2dd818,_0x35c8b9){return db['WhatsappQueue'][_0x9560('0x50')]({'where':{'id':_0x2e024e[_0x9560('0x4d')]['id']}})[_0x9560('0x29')](handleEntityNotFound(_0x2dd818,null))[_0x9560('0x29')](function(_0x3353f2){if(_0x3353f2){return _0x3353f2[_0x9560('0x8c')](_0x2e024e['body'][_0x9560('0x74')],_[_0x9560('0x8d')](_0x2e024e[_0x9560('0x52')],[_0x9560('0x74'),'id'])||{})[_0x9560('0x8e')](function(_0x4d3e82){for(var _0x56caca=0x0;_0x56caca<_0x2e024e[_0x9560('0x52')][_0x9560('0x74')][_0x9560('0x4e')];_0x56caca+=0x1){socket[_0x9560('0x71')](_0x9560('0x72'),{'UserId':Number(_0x2e024e['body']['ids'][_0x56caca]),'WhatsappQueueId':Number(_0x2e024e[_0x9560('0x4d')]['id'])});}return _0x4d3e82;});}})['then'](respondWithResult(_0x2dd818,null))[_0x9560('0x4b')](handleError(_0x2dd818,null));};exports[_0x9560('0x8a')]=function(_0xcccab3,_0x58874c,_0x5b4606){return db[_0x9560('0x32')][_0x9560('0x50')]({'where':{'id':_0xcccab3[_0x9560('0x4d')]['id']}})[_0x9560('0x29')](handleEntityNotFound(_0x58874c,null))[_0x9560('0x29')](function(_0x369cfa){if(_0x369cfa){return _0x369cfa[_0x9560('0x8a')](_0xcccab3[_0x9560('0x38')]['ids'])['then'](function(){if(_[_0x9560('0x8f')](_0xcccab3[_0x9560('0x38')]['ids'])){for(var _0x862ffd=0x0;_0x862ffd<_0xcccab3[_0x9560('0x38')][_0x9560('0x74')][_0x9560('0x4e')];_0x862ffd+=0x1){socket[_0x9560('0x71')](_0x9560('0x8b'),{'UserId':Number(_0xcccab3['query']['ids'][_0x862ffd]),'WhatsappQueueId':Number(_0xcccab3['params']['id'])});}}else{socket[_0x9560('0x71')](_0x9560('0x8b'),{'UserId':Number(_0xcccab3['query'][_0x9560('0x74')]),'WhatsappQueueId':Number(_0xcccab3[_0x9560('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x58874c,null))['catch'](handleError(_0x58874c,null));};exports[_0x9560('0x90')]=function(_0x2e1759,_0x31950f,_0xfe1cc){var _0x505a07={};var _0x4c10ef={};var _0x1ecb1d;var _0x481297;return db[_0x9560('0x32')]['findOne']({'where':{'id':_0x2e1759[_0x9560('0x4d')]['id']}})[_0x9560('0x29')](handleEntityNotFound(_0x31950f,null))[_0x9560('0x29')](function(_0x297658){if(_0x297658){_0x1ecb1d=_0x297658;_0x4c10ef[_0x9560('0x36')]=_[_0x9560('0x37')](db['User']['rawAttributes']);_0x4c10ef[_0x9560('0x38')]=_[_0x9560('0x37')](_0x2e1759[_0x9560('0x38')]);_0x4c10ef['filters']=_['intersection'](_0x4c10ef[_0x9560('0x36')],_0x4c10ef[_0x9560('0x38')]);_0x505a07[_0x9560('0x3b')]=_[_0x9560('0x3a')](_0x4c10ef[_0x9560('0x36')],qs[_0x9560('0x3c')](_0x2e1759[_0x9560('0x38')][_0x9560('0x3c')]));_0x505a07[_0x9560('0x3b')]=_0x505a07['attributes'][_0x9560('0x4e')]?_0x505a07['attributes']:_0x4c10ef[_0x9560('0x36')];_0x505a07[_0x9560('0x3f')]=qs[_0x9560('0x40')](_0x2e1759['query'][_0x9560('0x40')]);_0x505a07['where']=qs[_0x9560('0x39')](_['pick'](_0x2e1759['query'],_0x4c10ef[_0x9560('0x39')]));if(_0x2e1759[_0x9560('0x38')]['filter']){_0x505a07[_0x9560('0x41')]=_['merge'](_0x505a07[_0x9560('0x41')],{'$or':_[_0x9560('0x31')](_0x505a07[_0x9560('0x3b')],function(_0x2022ae){var _0x596689={};_0x596689[_0x2022ae]={'$like':'%'+_0x2e1759['query'][_0x9560('0x46')]+'%'};return _0x596689;})});}_0x505a07=_[_0x9560('0x43')]({},_0x505a07,_0x2e1759[_0x9560('0x47')]);return _0x1ecb1d[_0x9560('0x90')](_0x505a07);}})[_0x9560('0x29')](function(_0x5c8640){if(_0x5c8640){_0x481297=_0x5c8640[_0x9560('0x4e')];if(!_0x2e1759[_0x9560('0x38')][_0x9560('0x3d')]('nolimit')){_0x505a07[_0x9560('0x24')]=qs[_0x9560('0x24')](_0x2e1759['query'][_0x9560('0x24')]);_0x505a07['offset']=qs[_0x9560('0x22')](_0x2e1759[_0x9560('0x38')][_0x9560('0x22')]);}return _0x1ecb1d[_0x9560('0x90')](_0x505a07);}})[_0x9560('0x29')](function(_0x27c842){if(_0x27c842){return _0x27c842?{'count':_0x481297,'rows':_0x27c842}:null;}})[_0x9560('0x29')](respondWithResult(_0x31950f,null))['catch'](handleError(_0x31950f,null));};
\ No newline at end of file
+var _0x602e=['undefined','count','offset','set','Content-Range','apply','reject','save','then','get','UserProfileResource','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','WhatsappQueue','catch','params','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','rawAttributes','pick','WhatsappQueueId','UserWhatsappQueue','findAll','User','findAndCountAll','agent','whatsappPause','updatedAt','createdAt','rows','%s/%s','getTeams','findOne','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','compact','value','removeAgents','addAgents','omit','spread','isArray','emit','userWhatsappQueue:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','defaults','./whatsappQueue.socket','register','sendStatus','status','end','json','limit'];(function(_0x7b484,_0x195ad4){var _0x2ae1cf=function(_0x2e6247){while(--_0x2e6247){_0x7b484['push'](_0x7b484['shift']());}};_0x2ae1cf(++_0x195ad4);}(_0x602e,0x6b));var _0xe602=function(_0x449b81,_0x4b2a6f){_0x449b81=_0x449b81-0x0;var _0xb9b60c=_0x602e[_0x449b81];return _0xb9b60c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe602('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe602('0x1'));var rp=require(_0xe602('0x2'));var moment=require(_0xe602('0x3'));var BPromise=require(_0xe602('0x4'));var Mustache=require(_0xe602('0x5'));var util=require(_0xe602('0x6'));var path=require(_0xe602('0x7'));var sox=require(_0xe602('0x8'));var csv=require(_0xe602('0x9'));var ejs=require(_0xe602('0xa'));var fs=require('fs');var fs_extra=require(_0xe602('0xb'));var _=require(_0xe602('0xc'));var squel=require(_0xe602('0xd'));var crypto=require(_0xe602('0xe'));var jsforce=require(_0xe602('0xf'));var deskjs=require(_0xe602('0x10'));var toCsv=require(_0xe602('0x9'));var querystring=require(_0xe602('0x11'));var Papa=require(_0xe602('0x12'));var Redis=require(_0xe602('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xe602('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe602('0x15'))(_0xe602('0x16'));var utils=require(_0xe602('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xe602('0x18')]=_[_0xe602('0x19')](config[_0xe602('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe602('0x18')]));require(_0xe602('0x1a'))[_0xe602('0x1b')](socket);function respondWithStatusCode(_0x3a7c26,_0x825932){_0x825932=_0x825932||0xcc;return function(_0x5f2964){if(_0x5f2964){return _0x3a7c26[_0xe602('0x1c')](_0x825932);}return _0x3a7c26[_0xe602('0x1d')](_0x825932)[_0xe602('0x1e')]();};}function respondWithResult(_0x5d78a4,_0x2aa325){_0x2aa325=_0x2aa325||0xc8;return function(_0x4c0cb5){if(_0x4c0cb5){return _0x5d78a4[_0xe602('0x1d')](_0x2aa325)[_0xe602('0x1f')](_0x4c0cb5);}};}function respondWithFilteredResult(_0x120628,_0x3451e4){return function(_0x58ab69){if(_0x58ab69){var _0x8bb04b=typeof _0x3451e4['offset']==='undefined'&&typeof _0x3451e4[_0xe602('0x20')]===_0xe602('0x21');var _0x1c1b81=_0x58ab69[_0xe602('0x22')];var _0x12bff7=_0x8bb04b?0x0:_0x3451e4[_0xe602('0x23')];var _0x376d20=_0x8bb04b?_0x58ab69[_0xe602('0x22')]:_0x3451e4[_0xe602('0x23')]+_0x3451e4[_0xe602('0x20')];var _0x3fe60f;if(_0x376d20>=_0x1c1b81){_0x376d20=_0x1c1b81;_0x3fe60f=0xc8;}else{_0x3fe60f=0xce;}_0x120628[_0xe602('0x1d')](_0x3fe60f);return _0x120628[_0xe602('0x24')](_0xe602('0x25'),_0x12bff7+'-'+_0x376d20+'/'+_0x1c1b81)['json'](_0x58ab69);}return null;};}function patchUpdates(_0x3c2dbf){return function(_0x4748d7){try{jsonpatch[_0xe602('0x26')](_0x4748d7,_0x3c2dbf,!![]);}catch(_0x37a8b5){return BPromise[_0xe602('0x27')](_0x37a8b5);}return _0x4748d7[_0xe602('0x28')]();};}function saveUpdates(_0x421868,_0x55349d){return function(_0x3090b7){if(_0x3090b7){return _0x3090b7['update'](_0x421868)['then'](function(_0x5ce7b8){return _0x5ce7b8;});}return null;};}function removeEntity(_0x3831d,_0x3a2f04){return function(_0x335403){if(_0x335403){return _0x335403['destroy']()[_0xe602('0x29')](function(){var _0x588bbc=_0x335403[_0xe602('0x2a')]({'plain':!![]});var _0x4a4f69='WhatsappQueues';return db[_0xe602('0x2b')]['destroy']({'where':{'type':_0x4a4f69,'resourceId':_0x588bbc['id']}})[_0xe602('0x29')](function(){return _0x335403;});})[_0xe602('0x29')](function(){_0x3831d[_0xe602('0x1d')](0xcc)[_0xe602('0x1e')]();});}};}function handleEntityNotFound(_0x5e3dc1,_0xb6a62b){return function(_0x5aed8b){if(!_0x5aed8b){_0x5e3dc1[_0xe602('0x1c')](0x194);}return _0x5aed8b;};}function handleError(_0x496a64,_0x546054){_0x546054=_0x546054||0x1f4;return function(_0x451416){logger['error'](_0x451416[_0xe602('0x2c')]);if(_0x451416[_0xe602('0x2d')]){delete _0x451416[_0xe602('0x2d')];}_0x496a64[_0xe602('0x1d')](_0x546054)[_0xe602('0x2e')](_0x451416);};}exports[_0xe602('0x2f')]=function(_0x51b367,_0x6992b0){var _0x16257c={},_0x983df4={},_0xe27a67={'count':0x0,'rows':[]};var _0x3042cb=_[_0xe602('0x30')](db['WhatsappQueue']['rawAttributes'],function(_0x1711bb){return{'name':_0x1711bb[_0xe602('0x31')],'type':_0x1711bb[_0xe602('0x32')]['key']};});_0x983df4[_0xe602('0x33')]=_[_0xe602('0x30')](_0x3042cb,_0xe602('0x2d'));_0x983df4[_0xe602('0x34')]=_[_0xe602('0x35')](_0x51b367[_0xe602('0x34')]);_0x983df4[_0xe602('0x36')]=_[_0xe602('0x37')](_0x983df4[_0xe602('0x33')],_0x983df4[_0xe602('0x34')]);_0x16257c[_0xe602('0x38')]=_[_0xe602('0x37')](_0x983df4[_0xe602('0x33')],qs[_0xe602('0x39')](_0x51b367['query'][_0xe602('0x39')]));_0x16257c['attributes']=_0x16257c['attributes']['length']?_0x16257c[_0xe602('0x38')]:_0x983df4[_0xe602('0x33')];if(!_0x51b367['query'][_0xe602('0x3a')](_0xe602('0x3b'))){_0x16257c[_0xe602('0x20')]=qs['limit'](_0x51b367[_0xe602('0x34')][_0xe602('0x20')]);_0x16257c[_0xe602('0x23')]=qs[_0xe602('0x23')](_0x51b367['query'][_0xe602('0x23')]);}_0x16257c[_0xe602('0x3c')]=qs[_0xe602('0x3d')](_0x51b367['query'][_0xe602('0x3d')]);_0x16257c['where']=qs[_0xe602('0x36')](_['pick'](_0x51b367[_0xe602('0x34')],_0x983df4['filters']),_0x3042cb);if(_0x51b367[_0xe602('0x34')][_0xe602('0x3e')]){_0x16257c[_0xe602('0x3f')]=_[_0xe602('0x40')](_0x16257c[_0xe602('0x3f')],{'$or':_['map'](_0x3042cb,function(_0x35878f){if(_0x35878f[_0xe602('0x32')]!==_0xe602('0x41')){var _0x25299f={};_0x25299f[_0x35878f[_0xe602('0x2d')]]={'$like':'%'+_0x51b367[_0xe602('0x34')]['filter']+'%'};return _0x25299f;}})});}_0x16257c=_[_0xe602('0x40')]({},_0x16257c,_0x51b367[_0xe602('0x42')]);var _0x5f5ba5={'where':_0x16257c['where']};return db['WhatsappQueue'][_0xe602('0x22')](_0x5f5ba5)[_0xe602('0x29')](function(_0x1d8242){_0xe27a67[_0xe602('0x22')]=_0x1d8242;if(_0x51b367['query'][_0xe602('0x43')]){_0x16257c[_0xe602('0x44')]=[{'all':!![]}];}return db[_0xe602('0x45')]['findAll'](_0x16257c);})[_0xe602('0x29')](function(_0x3cf0aa){_0xe27a67['rows']=_0x3cf0aa;return _0xe27a67;})['then'](respondWithFilteredResult(_0x6992b0,_0x16257c))[_0xe602('0x46')](handleError(_0x6992b0,null));};exports['show']=function(_0xfb0501,_0x127354){var _0x3ac472={'raw':!![],'where':{'id':_0xfb0501[_0xe602('0x47')]['id']}},_0x246493={};_0x246493[_0xe602('0x33')]=_['keys'](db[_0xe602('0x45')]['rawAttributes']);_0x246493[_0xe602('0x34')]=_[_0xe602('0x35')](_0xfb0501[_0xe602('0x34')]);_0x246493[_0xe602('0x36')]=_[_0xe602('0x37')](_0x246493[_0xe602('0x33')],_0x246493['query']);_0x3ac472[_0xe602('0x38')]=_['intersection'](_0x246493[_0xe602('0x33')],qs[_0xe602('0x39')](_0xfb0501[_0xe602('0x34')]['fields']));_0x3ac472[_0xe602('0x38')]=_0x3ac472[_0xe602('0x38')][_0xe602('0x48')]?_0x3ac472['attributes']:_0x246493[_0xe602('0x33')];if(_0xfb0501[_0xe602('0x34')][_0xe602('0x43')]){_0x3ac472[_0xe602('0x44')]=[{'all':!![]}];}_0x3ac472=_[_0xe602('0x40')]({},_0x3ac472,_0xfb0501['options']);return db[_0xe602('0x45')][_0xe602('0x49')](_0x3ac472)[_0xe602('0x29')](handleEntityNotFound(_0x127354,null))[_0xe602('0x29')](respondWithResult(_0x127354,null))[_0xe602('0x46')](handleError(_0x127354,null));};exports['create']=function(_0xe3b8a3,_0x33818f){return db[_0xe602('0x45')]['create'](_0xe3b8a3[_0xe602('0x4a')],{})[_0xe602('0x29')](function(_0x34a9a3){var _0x11c047=_0xe3b8a3[_0xe602('0x4b')]['get']({'plain':!![]});if(!_0x11c047)throw new Error(_0xe602('0x4c'));if(_0x11c047[_0xe602('0x4d')]===_0xe602('0x4b')){var _0x9e1939=_0x34a9a3[_0xe602('0x2a')]({'plain':!![]});var _0xdec21a='WhatsappQueues';return db[_0xe602('0x4e')][_0xe602('0x49')]({'where':{'name':_0xdec21a,'userProfileId':_0x11c047[_0xe602('0x4f')]},'raw':!![]})[_0xe602('0x29')](function(_0x48bd88){if(_0x48bd88&&_0x48bd88[_0xe602('0x50')]===0x0){return db[_0xe602('0x2b')][_0xe602('0x51')]({'name':_0x9e1939[_0xe602('0x2d')],'resourceId':_0x9e1939['id'],'type':_0x48bd88[_0xe602('0x2d')],'sectionId':_0x48bd88['id']},{})[_0xe602('0x29')](function(){return _0x34a9a3;});}else{return _0x34a9a3;}})[_0xe602('0x46')](function(_0x491d12){logger[_0xe602('0x52')](_0xe602('0x53'),_0x491d12);throw _0x491d12;});}return _0x34a9a3;})[_0xe602('0x29')](respondWithResult(_0x33818f,0xc9))['catch'](handleError(_0x33818f,null));};exports[_0xe602('0x54')]=function(_0xad5592,_0x1f307a){if(_0xad5592[_0xe602('0x4a')]['id']){delete _0xad5592[_0xe602('0x4a')]['id'];}return db[_0xe602('0x45')][_0xe602('0x49')]({'where':{'id':_0xad5592[_0xe602('0x47')]['id']}})[_0xe602('0x29')](handleEntityNotFound(_0x1f307a,null))[_0xe602('0x29')](saveUpdates(_0xad5592[_0xe602('0x4a')],null))[_0xe602('0x29')](respondWithResult(_0x1f307a,null))[_0xe602('0x46')](handleError(_0x1f307a,null));};exports[_0xe602('0x55')]=function(_0x2113bf,_0x5f5335){return db['WhatsappQueue'][_0xe602('0x49')]({'where':{'id':_0x2113bf[_0xe602('0x47')]['id']}})[_0xe602('0x29')](handleEntityNotFound(_0x5f5335,null))[_0xe602('0x29')](removeEntity(_0x5f5335,null))[_0xe602('0x46')](handleError(_0x5f5335,null));};exports['describe']=function(_0x42be4d,_0x3ec185){return db[_0xe602('0x45')]['describe']()[_0xe602('0x29')](respondWithResult(_0x3ec185,null))[_0xe602('0x46')](handleError(_0x3ec185,null));};exports['getMembers']=function(_0x308e3a,_0x320950,_0x1d7a7a){var _0x52e91c={'raw':!![],'where':{}},_0x5dfabb={},_0x37dfdd;return db['WhatsappQueue']['findOne']({'where':{'id':_0x308e3a[_0xe602('0x47')]['id']}})[_0xe602('0x29')](handleEntityNotFound(_0x320950,null))[_0xe602('0x29')](function(_0x32bcff){if(_0x32bcff){_0x37dfdd=_0x32bcff[_0xe602('0x2a')]({'plain':!![]});_0x5dfabb['model']=_[_0xe602('0x35')](db['UserWhatsappQueue'][_0xe602('0x56')]);_0x5dfabb['query']=_[_0xe602('0x35')](_0x308e3a[_0xe602('0x34')]);_0x5dfabb[_0xe602('0x36')]=_[_0xe602('0x37')](_0x5dfabb[_0xe602('0x33')],_0x5dfabb[_0xe602('0x34')]);_0x52e91c[_0xe602('0x38')]=_['intersection'](_0x5dfabb[_0xe602('0x33')],qs[_0xe602('0x39')](_0x308e3a[_0xe602('0x34')][_0xe602('0x39')]));_0x52e91c[_0xe602('0x38')]=_0x52e91c[_0xe602('0x38')]['length']?_0x52e91c[_0xe602('0x38')]:_0x5dfabb[_0xe602('0x33')];if(!_0x308e3a['query'][_0xe602('0x3a')](_0xe602('0x3b'))){_0x52e91c[_0xe602('0x20')]=qs[_0xe602('0x20')](_0x308e3a[_0xe602('0x34')][_0xe602('0x20')]);_0x52e91c['offset']=qs[_0xe602('0x23')](_0x308e3a[_0xe602('0x34')][_0xe602('0x23')]);}_0x52e91c[_0xe602('0x3c')]=qs['sort'](_0x308e3a['query'][_0xe602('0x3d')]);_0x52e91c[_0xe602('0x3f')]=qs[_0xe602('0x36')](_[_0xe602('0x57')](_0x308e3a[_0xe602('0x34')],_0x5dfabb[_0xe602('0x36')]));_0x52e91c[_0xe602('0x3f')][_0xe602('0x58')]=_0x32bcff['id'];if(_0x308e3a[_0xe602('0x34')][_0xe602('0x3e')]){_0x52e91c[_0xe602('0x3f')]=_[_0xe602('0x40')](_0x52e91c[_0xe602('0x3f')],{'$or':_[_0xe602('0x30')](_0x52e91c['attributes'],function(_0x4d3326){var _0x2d1860={};_0x2d1860[_0x4d3326]={'$like':'%'+_0x308e3a[_0xe602('0x34')][_0xe602('0x3e')]+'%'};return _0x2d1860;})});}_0x52e91c=_[_0xe602('0x40')]({},_0x52e91c,_0x308e3a['options']);return db[_0xe602('0x59')][_0xe602('0x5a')](_0x52e91c);}})['then'](function(_0x302d70){if(_0x302d70){return db[_0xe602('0x5b')][_0xe602('0x5c')]({'where':{'id':_['map'](_0x302d70,'UserId'),'role':_0xe602('0x5d')},'attributes':['id',_0xe602('0x2d'),_0xe602('0x5e'),_0xe602('0x5f'),_0xe602('0x60')]});}})[_0xe602('0x29')](function(_0x5af74a){if(_0x5af74a){return{'count':_0x5af74a[_0xe602('0x22')],'rows':_[_0xe602('0x30')](_0x5af74a[_0xe602('0x61')],function(_0x41419a){return{'membername':_0x41419a[_0xe602('0x2d')],'UserId':_0x41419a['id'],'queue_name':_0x37dfdd[_0xe602('0x2d')],'WhatsappQueueId':_0x37dfdd['id'],'interface':util['format'](_0xe602('0x62'),'SIP',_0x41419a[_0xe602('0x2d')]),'penalty':0x0,'paused':_0x41419a[_0xe602('0x5e')],'createdAt':_0x41419a[_0xe602('0x60')],'updatedAt':_0x41419a['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x320950,_0x52e91c))[_0xe602('0x46')](handleError(_0x320950,null));};exports[_0xe602('0x63')]=function(_0x37809f,_0x5a700b,_0x1967ae){var _0x1b17cb={};var _0x27252a={};var _0x21ac35;var _0x47a96a;return db['WhatsappQueue'][_0xe602('0x64')]({'where':{'id':_0x37809f[_0xe602('0x47')]['id']}})[_0xe602('0x29')](handleEntityNotFound(_0x5a700b,null))['then'](function(_0x33a0a4){if(_0x33a0a4){_0x21ac35=_0x33a0a4;_0x27252a[_0xe602('0x33')]=_[_0xe602('0x35')](db[_0xe602('0x65')][_0xe602('0x56')]);_0x27252a[_0xe602('0x34')]=_[_0xe602('0x35')](_0x37809f[_0xe602('0x34')]);_0x27252a[_0xe602('0x36')]=_['intersection'](_0x27252a[_0xe602('0x33')],_0x27252a[_0xe602('0x34')]);_0x1b17cb[_0xe602('0x38')]=_['intersection'](_0x27252a[_0xe602('0x33')],qs[_0xe602('0x39')](_0x37809f[_0xe602('0x34')]['fields']));_0x1b17cb[_0xe602('0x38')]=_0x1b17cb[_0xe602('0x38')][_0xe602('0x48')]?_0x1b17cb[_0xe602('0x38')]:_0x27252a[_0xe602('0x33')];_0x1b17cb[_0xe602('0x3c')]=qs[_0xe602('0x3d')](_0x37809f[_0xe602('0x34')][_0xe602('0x3d')]);_0x1b17cb['where']=qs[_0xe602('0x36')](_[_0xe602('0x57')](_0x37809f[_0xe602('0x34')],_0x27252a['filters']));if(_0x37809f['query'][_0xe602('0x3e')]){_0x1b17cb[_0xe602('0x3f')]=_[_0xe602('0x40')](_0x1b17cb[_0xe602('0x3f')],{'$or':_[_0xe602('0x30')](_0x1b17cb[_0xe602('0x38')],function(_0x24f664){var _0x2e1f03={};_0x2e1f03[_0x24f664]={'$like':'%'+_0x37809f[_0xe602('0x34')][_0xe602('0x3e')]+'%'};return _0x2e1f03;})});}_0x1b17cb=_[_0xe602('0x40')]({},_0x1b17cb,_0x37809f['options']);return _0x21ac35[_0xe602('0x63')](_0x1b17cb);}})[_0xe602('0x29')](function(_0x89d537){if(_0x89d537){_0x47a96a=_0x89d537[_0xe602('0x48')];if(!_0x37809f['query'][_0xe602('0x3a')](_0xe602('0x3b'))){_0x1b17cb[_0xe602('0x20')]=qs[_0xe602('0x20')](_0x37809f['query'][_0xe602('0x20')]);_0x1b17cb[_0xe602('0x23')]=qs[_0xe602('0x23')](_0x37809f[_0xe602('0x34')]['offset']);}return _0x21ac35['getTeams'](_0x1b17cb);}})[_0xe602('0x29')](function(_0x3c8cd0){if(_0x3c8cd0){return _0x3c8cd0?{'count':_0x47a96a,'rows':_0x3c8cd0}:null;}})[_0xe602('0x29')](respondWithResult(_0x5a700b,null))[_0xe602('0x46')](handleError(_0x5a700b,null));};exports['addTeams']=function(_0x3a30db,_0x26507b,_0x505a00){var _0x1f62e1=_0x3a30db[_0xe602('0x4a')][_0xe602('0x66')];return db[_0xe602('0x65')][_0xe602('0x5a')]({'where':{'id':_0x1f62e1},'attributes':['id'],'include':[{'model':db[_0xe602('0x5b')],'as':_0xe602('0x67'),'attributes':['id','name',_0xe602('0x68'),_0xe602('0x69'),_0xe602('0x6a')],'raw':!![]}]})[_0xe602('0x29')](function(_0x80859){if(_0x80859){var _0x301dcd=_[_0xe602('0x6b')](_0x80859,function(_0x29e09d){var _0x42b13e=_0x29e09d[_0xe602('0x2a')]({'plain':!![]});return _0x42b13e[_0xe602('0x67')];});return db[_0xe602('0x45')][_0xe602('0x49')]({'where':{'id':_0x3a30db['params']['id']}})['then'](function(_0x3d0a8e){return db[_0xe602('0x6c')][_0xe602('0x6d')](function(_0x411baf){return _0x3d0a8e[_0xe602('0x6e')](_0x1f62e1,{'transaction':_0x411baf})[_0xe602('0x29')](function(){return BPromise[_0xe602('0x6f')](_0x301dcd,function(_0x3bbbd2){return db['UserWhatsappQueue'][_0xe602('0x70')]({'where':{'UserId':_0x3bbbd2['id'],'WhatsappQueueId':_0x3a30db[_0xe602('0x47')]['id']},'transaction':_0x411baf});});})['then'](function(){_0x301dcd[_0xe602('0x71')](function(_0xa15ab3){socket['emit'](_0xe602('0x72'),{'UserId':_0xa15ab3['id'],'WhatsappQueueId':_0x3d0a8e['id']});});});});});}})[_0xe602('0x29')](respondWithStatusCode(_0x26507b,null))[_0xe602('0x46')](handleError(_0x26507b,null));};exports[_0xe602('0x73')]=function(_0xe90ac,_0x266cb1,_0x5bbd15){return db[_0xe602('0x65')]['findAll']({'where':{'id':_0xe90ac[_0xe602('0x34')][_0xe602('0x66')]},'attributes':['id'],'include':[{'model':db[_0xe602('0x5b')],'as':_0xe602('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x266cb1,null))[_0xe602('0x29')](function(_0xbca8f4){var _0x167bc3=_[_0xe602('0x30')](_0xbca8f4,'id');var _0x193eae=[];var _0x253b63=[];var _0x18522e=squel[_0xe602('0x74')]();_0x18522e['field'](_0xe602('0x75'))[_0xe602('0x76')](_0xe602('0x77'),'tq')[_0xe602('0x78')]('user_has_teams','ut',_0xe602('0x79'))['where'](_0xe602('0x7a'),_0xe90ac[_0xe602('0x47')]['id']);for(var _0x4149a5=0x0;_0x4149a5<_0xbca8f4[_0xe602('0x48')];_0x4149a5+=0x1){let _0xb5da03=_0xbca8f4[_0x4149a5];for(var _0x163d40=0x0;_0x163d40<_0xb5da03[_0xe602('0x67')]['length'];_0x163d40+=0x1){let _0x21bc79=_0xb5da03[_0xe602('0x67')][_0x163d40];var _0x1ace55=_0x18522e[_0xe602('0x7b')]();_0x1ace55['where'](_0xe602('0x7c'),_0x21bc79['id']);_0x253b63['push'](db[_0xe602('0x6c')][_0xe602('0x34')](_0x1ace55[_0xe602('0x7d')](),{'type':db[_0xe602('0x6c')][_0xe602('0x7e')]['SELECT']})[_0xe602('0x29')](function(_0xb57a72){if(_0xb57a72[_0xe602('0x48')]===0x1){return _0x21bc79['id'];}else{var _0x327930=_[_0xe602('0x7f')](_[_0xe602('0x30')](_0xb57a72,_0xe602('0x80')),function(_0x365747){return _['includes'](_0x167bc3,_0x365747);});if(_0x327930){return _0x21bc79['id'];}}}));}}return BPromise[_0xe602('0x81')](_0x253b63)[_0xe602('0x29')](function(_0x8092ef){_0x193eae=_(_0x193eae)['union'](_0x8092ef)[_0xe602('0x82')]()[_0xe602('0x83')]();return db[_0xe602('0x45')]['find']({'where':{'id':_0xe90ac[_0xe602('0x47')]['id']}})[_0xe602('0x29')](function(_0x525ba5){return db[_0xe602('0x6c')]['transaction'](function(_0x2fe750){return _0x525ba5[_0xe602('0x73')](_0xe90ac[_0xe602('0x34')][_0xe602('0x66')],{'transaction':_0x2fe750})['then'](function(){if(!_['isEmpty'](_0x193eae)){return _0x525ba5[_0xe602('0x84')](_0x193eae,{'transaction':_0x2fe750});}})[_0xe602('0x29')](function(){_0x193eae[_0xe602('0x71')](function(_0x5de318){socket['emit']('userWhatsappQueue:remove',{'UserId':_0x5de318,'WhatsappQueueId':_0x525ba5['id']});});});});});});})[_0xe602('0x29')](respondWithStatusCode(_0x266cb1,null))[_0xe602('0x46')](handleError(_0x266cb1,null));};exports[_0xe602('0x85')]=function(_0x4e8977,_0x62167b,_0x2f4677){return db[_0xe602('0x45')][_0xe602('0x49')]({'where':{'id':_0x4e8977[_0xe602('0x47')]['id']}})[_0xe602('0x29')](handleEntityNotFound(_0x62167b,null))[_0xe602('0x29')](function(_0x6e017f){if(_0x6e017f){return _0x6e017f['addAgents'](_0x4e8977[_0xe602('0x4a')][_0xe602('0x66')],_[_0xe602('0x86')](_0x4e8977[_0xe602('0x4a')],[_0xe602('0x66'),'id'])||{})[_0xe602('0x87')](function(_0x143ce9){for(var _0x17efc0=0x0;_0x17efc0<_0x4e8977[_0xe602('0x4a')][_0xe602('0x66')][_0xe602('0x48')];_0x17efc0+=0x1){socket['emit'](_0xe602('0x72'),{'UserId':Number(_0x4e8977[_0xe602('0x4a')][_0xe602('0x66')][_0x17efc0]),'WhatsappQueueId':Number(_0x4e8977[_0xe602('0x47')]['id'])});}return _0x143ce9;});}})[_0xe602('0x29')](respondWithResult(_0x62167b,null))[_0xe602('0x46')](handleError(_0x62167b,null));};exports[_0xe602('0x84')]=function(_0x567389,_0x4cdd31,_0x3905e9){return db[_0xe602('0x45')][_0xe602('0x49')]({'where':{'id':_0x567389['params']['id']}})[_0xe602('0x29')](handleEntityNotFound(_0x4cdd31,null))['then'](function(_0xa5fc6b){if(_0xa5fc6b){return _0xa5fc6b[_0xe602('0x84')](_0x567389[_0xe602('0x34')][_0xe602('0x66')])[_0xe602('0x29')](function(){if(_[_0xe602('0x88')](_0x567389[_0xe602('0x34')][_0xe602('0x66')])){for(var _0x51e5bd=0x0;_0x51e5bd<_0x567389[_0xe602('0x34')][_0xe602('0x66')]['length'];_0x51e5bd+=0x1){socket[_0xe602('0x89')](_0xe602('0x8a'),{'UserId':Number(_0x567389[_0xe602('0x34')][_0xe602('0x66')][_0x51e5bd]),'WhatsappQueueId':Number(_0x567389[_0xe602('0x47')]['id'])});}}else{socket[_0xe602('0x89')]('userWhatsappQueue:remove',{'UserId':Number(_0x567389[_0xe602('0x34')][_0xe602('0x66')]),'WhatsappQueueId':Number(_0x567389[_0xe602('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x4cdd31,null))[_0xe602('0x46')](handleError(_0x4cdd31,null));};exports[_0xe602('0x8b')]=function(_0x30a268,_0x4ec613,_0x151712){var _0x1727bf={};var _0x2f2a52={};var _0x1f9775;var _0x1bccbc;return db[_0xe602('0x45')][_0xe602('0x64')]({'where':{'id':_0x30a268[_0xe602('0x47')]['id']}})[_0xe602('0x29')](handleEntityNotFound(_0x4ec613,null))[_0xe602('0x29')](function(_0x5ce56c){if(_0x5ce56c){_0x1f9775=_0x5ce56c;_0x2f2a52[_0xe602('0x33')]=_[_0xe602('0x35')](db[_0xe602('0x5b')][_0xe602('0x56')]);_0x2f2a52[_0xe602('0x34')]=_['keys'](_0x30a268[_0xe602('0x34')]);_0x2f2a52['filters']=_['intersection'](_0x2f2a52[_0xe602('0x33')],_0x2f2a52[_0xe602('0x34')]);_0x1727bf[_0xe602('0x38')]=_[_0xe602('0x37')](_0x2f2a52[_0xe602('0x33')],qs[_0xe602('0x39')](_0x30a268[_0xe602('0x34')][_0xe602('0x39')]));_0x1727bf[_0xe602('0x38')]=_0x1727bf[_0xe602('0x38')][_0xe602('0x48')]?_0x1727bf['attributes']:_0x2f2a52[_0xe602('0x33')];_0x1727bf[_0xe602('0x3c')]=qs[_0xe602('0x3d')](_0x30a268[_0xe602('0x34')][_0xe602('0x3d')]);_0x1727bf[_0xe602('0x3f')]=qs['filters'](_['pick'](_0x30a268[_0xe602('0x34')],_0x2f2a52[_0xe602('0x36')]));if(_0x30a268[_0xe602('0x34')][_0xe602('0x3e')]){_0x1727bf['where']=_[_0xe602('0x40')](_0x1727bf['where'],{'$or':_['map'](_0x1727bf['attributes'],function(_0x45c69c){var _0x35d7d9={};_0x35d7d9[_0x45c69c]={'$like':'%'+_0x30a268[_0xe602('0x34')]['filter']+'%'};return _0x35d7d9;})});}_0x1727bf=_['merge']({},_0x1727bf,_0x30a268[_0xe602('0x42')]);return _0x1f9775[_0xe602('0x8b')](_0x1727bf);}})[_0xe602('0x29')](function(_0x4cd147){if(_0x4cd147){_0x1bccbc=_0x4cd147['length'];if(!_0x30a268[_0xe602('0x34')]['hasOwnProperty'](_0xe602('0x3b'))){_0x1727bf[_0xe602('0x20')]=qs['limit'](_0x30a268[_0xe602('0x34')][_0xe602('0x20')]);_0x1727bf[_0xe602('0x23')]=qs['offset'](_0x30a268[_0xe602('0x34')][_0xe602('0x23')]);}return _0x1f9775[_0xe602('0x8b')](_0x1727bf);}})['then'](function(_0x4ed785){if(_0x4ed785){return _0x4ed785?{'count':_0x1bccbc,'rows':_0x4ed785}:null;}})[_0xe602('0x29')](respondWithResult(_0x4ec613,null))['catch'](handleError(_0x4ec613,null));};
\ No newline at end of file
index 5d73ab6..079b0ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30d3=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x52fb65,_0x3522b0){var _0x482d6a=function(_0x53a14f){while(--_0x53a14f){_0x52fb65['push'](_0x52fb65['shift']());}};_0x482d6a(++_0x3522b0);}(_0x30d3,0x1d0));var _0x330d=function(_0x1d006f,_0x19ab56){_0x1d006f=_0x1d006f-0x0;var _0x3cdc8e=_0x30d3[_0x1d006f];return _0x3cdc8e;};'use strict';var EventEmitter=require(_0x330d('0x0'));var WhatsappQueue=require(_0x330d('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x330d('0x2')](0x0);var events={'afterCreate':_0x330d('0x3'),'afterUpdate':'update','afterDestroy':_0x330d('0x4')};function emitEvent(_0x41b94f){return function(_0x7b6400,_0x576a99,_0x4fdbf9){WhatsappQueueEvents[_0x330d('0x5')](_0x41b94f+':'+_0x7b6400['id'],_0x7b6400);WhatsappQueueEvents[_0x330d('0x5')](_0x41b94f,_0x7b6400);_0x4fdbf9(null);};}for(var e in events){if(events[_0x330d('0x6')](e)){var event=events[e];WhatsappQueue[_0x330d('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;
\ No newline at end of file
+var _0xfc67=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x5842eb,_0x585f4c){var _0x3eca2d=function(_0x59a441){while(--_0x59a441){_0x5842eb['push'](_0x5842eb['shift']());}};_0x3eca2d(++_0x585f4c);}(_0xfc67,0x11c));var _0x7fc6=function(_0x21cd58,_0x4604d6){_0x21cd58=_0x21cd58-0x0;var _0x3fba55=_0xfc67[_0x21cd58];return _0x3fba55;};'use strict';var EventEmitter=require(_0x7fc6('0x0'));var WhatsappQueue=require(_0x7fc6('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x7fc6('0x2')](0x0);var events={'afterCreate':_0x7fc6('0x3'),'afterUpdate':_0x7fc6('0x4'),'afterDestroy':_0x7fc6('0x5')};function emitEvent(_0x2cea28){return function(_0x2b317c,_0x21da4c,_0x4cb5b7){WhatsappQueueEvents[_0x7fc6('0x6')](_0x2cea28+':'+_0x2b317c['id'],_0x2b317c);WhatsappQueueEvents[_0x7fc6('0x6')](_0x2cea28,_0x2b317c);_0x4cb5b7(null);};}for(var e in events){if(events[_0x7fc6('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x7fc6('0x8')]=WhatsappQueueEvents;
\ No newline at end of file
index bd31688..427c5f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4164=['./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x1c3ec5,_0x2969d3){var _0x51b9f0=function(_0x420536){while(--_0x420536){_0x1c3ec5['push'](_0x1c3ec5['shift']());}};_0x51b9f0(++_0x2969d3);}(_0x4164,0xaa));var _0x4416=function(_0x404cde,_0x27b51c){_0x404cde=_0x404cde-0x0;var _0x139882=_0x4164[_0x404cde];return _0x139882;};'use strict';var _=require(_0x4416('0x0'));var util=require('util');var logger=require(_0x4416('0x1'))(_0x4416('0x2'));var moment=require(_0x4416('0x3'));var BPromise=require(_0x4416('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4416('0x5'));var attributes=require(_0x4416('0x6'));module[_0x4416('0x7')]=function(_0x35aeea,_0x2f2393){return _0x35aeea[_0x4416('0x8')](_0x4416('0x9'),attributes,{'tableName':_0x4416('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c93=['path','rimraf','../../config/environment','exports','WhatsappQueue','whatsapp_queues','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x477bf1,_0x296437){var _0x4cd72a=function(_0x118f7e){while(--_0x118f7e){_0x477bf1['push'](_0x477bf1['shift']());}};_0x4cd72a(++_0x296437);}(_0x1c93,0x187));var _0x31c9=function(_0x153a4b,_0x127932){_0x153a4b=_0x153a4b-0x0;var _0x334b30=_0x1c93[_0x153a4b];return _0x334b30;};'use strict';var _=require('lodash');var util=require(_0x31c9('0x0'));var logger=require(_0x31c9('0x1'))('api');var moment=require(_0x31c9('0x2'));var BPromise=require(_0x31c9('0x3'));var rp=require(_0x31c9('0x4'));var fs=require('fs');var path=require(_0x31c9('0x5'));var rimraf=require(_0x31c9('0x6'));var config=require(_0x31c9('0x7'));var attributes=require('./whatsappQueue.attributes');module[_0x31c9('0x8')]=function(_0x341b71,_0x33b533){return _0x341b71['define'](_0x31c9('0x9'),attributes,{'tableName':_0x31c9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 53a1154..cc04fae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b9b=['./whatsappQueue.socket','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetWhatsappQueue','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6b9b,0x193));var _0xb6b9=function(_0x48e6b8,_0x362747){_0x48e6b8=_0x48e6b8-0x0;var _0x7ccc54=_0x6b9b[_0x48e6b8];return _0x7ccc54;};'use strict';var _=require(_0xb6b9('0x0'));var util=require(_0xb6b9('0x1'));var moment=require(_0xb6b9('0x2'));var BPromise=require(_0xb6b9('0x3'));var rs=require(_0xb6b9('0x4'));var fs=require('fs');var Redis=require(_0xb6b9('0x5'));var db=require(_0xb6b9('0x6'))['db'];var utils=require(_0xb6b9('0x7'));var logger=require(_0xb6b9('0x8'))(_0xb6b9('0x9'));var config=require(_0xb6b9('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xb6b9('0xb')][_0xb6b9('0xc')]({'port':0x232a});config['redis']=_[_0xb6b9('0xd')](config[_0xb6b9('0xe')],{'host':_0xb6b9('0xf'),'port':0x18eb});var socket=require(_0xb6b9('0x10'))(new Redis(config[_0xb6b9('0xe')]));require(_0xb6b9('0x11'))['register'](socket);function respondWithRpcPromise(_0x937be3,_0x517ddb,_0x146448){return new BPromise(function(_0x9b3ff1,_0x3e11ab){return client['request'](_0x937be3,_0x146448)[_0xb6b9('0x12')](function(_0x92564d){logger['info'](_0xb6b9('0x13'),_0x517ddb,_0xb6b9('0x14'));logger[_0xb6b9('0x15')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x517ddb,_0xb6b9('0x14'),JSON[_0xb6b9('0x16')](_0x92564d));if(_0x92564d[_0xb6b9('0x17')]){if(_0x92564d[_0xb6b9('0x17')][_0xb6b9('0x18')]===0x1f4){logger['error'](_0xb6b9('0x13'),_0x517ddb,_0x92564d[_0xb6b9('0x17')][_0xb6b9('0x19')]);return _0x3e11ab(_0x92564d[_0xb6b9('0x17')][_0xb6b9('0x19')]);}logger[_0xb6b9('0x17')](_0xb6b9('0x13'),_0x517ddb,_0x92564d['error'][_0xb6b9('0x19')]);return _0x9b3ff1(_0x92564d[_0xb6b9('0x17')]['message']);}else{logger[_0xb6b9('0x1a')]('WhatsappQueue,\x20%s,\x20%s',_0x517ddb,_0xb6b9('0x14'));_0x9b3ff1(_0x92564d[_0xb6b9('0x1b')]['message']);}})[_0xb6b9('0x1c')](function(_0x14e34f){logger[_0xb6b9('0x17')](_0xb6b9('0x13'),_0x517ddb,_0x14e34f);_0x3e11ab(_0x14e34f);});});}exports['GetWhatsappQueue']=function(_0xf67450){var _0x1397c5=this;return new Promise(function(_0x46c14c,_0x4eafa0){return db[_0xb6b9('0x1d')][_0xb6b9('0x1e')]({'raw':_0xf67450[_0xb6b9('0x1f')]?_0xf67450[_0xb6b9('0x1f')][_0xb6b9('0x20')]===undefined?!![]:![]:!![],'where':_0xf67450[_0xb6b9('0x1f')]?_0xf67450[_0xb6b9('0x1f')][_0xb6b9('0x21')]||null:null,'attributes':_0xf67450[_0xb6b9('0x1f')]?_0xf67450[_0xb6b9('0x1f')][_0xb6b9('0x22')]||null:null,'limit':_0xf67450[_0xb6b9('0x1f')]?_0xf67450[_0xb6b9('0x1f')][_0xb6b9('0x23')]||null:null,'include':_0xf67450[_0xb6b9('0x1f')]?_0xf67450['options'][_0xb6b9('0x24')]?_[_0xb6b9('0x25')](_0xf67450[_0xb6b9('0x1f')][_0xb6b9('0x24')],function(_0x1205af){return{'model':db[_0x1205af[_0xb6b9('0x26')]],'as':_0x1205af['as'],'attributes':_0x1205af['attributes'],'include':_0x1205af['include']?_['map'](_0x1205af['include'],function(_0x2bfd01){return{'model':db[_0x2bfd01[_0xb6b9('0x26')]],'as':_0x2bfd01['as'],'attributes':_0x2bfd01['attributes'],'include':_0x2bfd01['include']?_[_0xb6b9('0x25')](_0x2bfd01[_0xb6b9('0x24')],function(_0x55342b){return{'model':db[_0x55342b[_0xb6b9('0x26')]],'as':_0x55342b['as'],'attributes':_0x55342b[_0xb6b9('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb6b9('0x12')](function(_0x477a69){logger[_0xb6b9('0x1a')](_0xb6b9('0x27'),_0xf67450);logger[_0xb6b9('0x15')]('GetWhatsappQueue',_0xf67450,JSON['stringify'](_0x477a69));_0x46c14c(_0x477a69);})['catch'](function(_0x5ba4ad){logger[_0xb6b9('0x17')](_0xb6b9('0x27'),_0x5ba4ad['message'],_0xf67450);_0x4eafa0(_0x1397c5[_0xb6b9('0x17')](0x1f4,_0x5ba4ad['message']));});});};exports[_0xb6b9('0x28')]=function(_0x2c49a8){var _0x1216f5=this;return new Promise(function(_0x18aa4c,_0x2ce078){return db['WhatsappQueue'][_0xb6b9('0x29')]({'raw':_0x2c49a8['options']?_0x2c49a8['options'][_0xb6b9('0x20')]===undefined?!![]:![]:!![],'where':_0x2c49a8[_0xb6b9('0x1f')]?_0x2c49a8[_0xb6b9('0x1f')]['where']||null:null,'attributes':_0x2c49a8[_0xb6b9('0x1f')]?_0x2c49a8[_0xb6b9('0x1f')][_0xb6b9('0x22')]||null:null,'include':_0x2c49a8[_0xb6b9('0x1f')]?_0x2c49a8[_0xb6b9('0x1f')][_0xb6b9('0x24')]?_['map'](_0x2c49a8['options'][_0xb6b9('0x24')],function(_0x4c67d8){return{'model':db[_0x4c67d8[_0xb6b9('0x26')]],'as':_0x4c67d8['as'],'attributes':_0x4c67d8['attributes'],'include':_0x4c67d8[_0xb6b9('0x24')]?_[_0xb6b9('0x25')](_0x4c67d8['include'],function(_0x17e2cc){return{'model':db[_0x17e2cc['model']],'as':_0x17e2cc['as'],'attributes':_0x17e2cc[_0xb6b9('0x22')],'include':_0x17e2cc[_0xb6b9('0x24')]?_[_0xb6b9('0x25')](_0x17e2cc['include'],function(_0x40eb0c){return{'model':db[_0x40eb0c[_0xb6b9('0x26')]],'as':_0x40eb0c['as'],'attributes':_0x40eb0c[_0xb6b9('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb6b9('0x12')](function(_0x3a704e){logger[_0xb6b9('0x1a')](_0xb6b9('0x28'),_0x2c49a8);logger[_0xb6b9('0x15')](_0xb6b9('0x28'),_0x2c49a8,JSON['stringify'](_0x3a704e));_0x18aa4c(_0x3a704e);})[_0xb6b9('0x1c')](function(_0xf5ac6f){logger[_0xb6b9('0x17')]('ShowWhatsappQueue',_0xf5ac6f[_0xb6b9('0x19')],_0x2c49a8);_0x2ce078(_0x1216f5[_0xb6b9('0x17')](0x1f4,_0xf5ac6f['message']));});});};
\ No newline at end of file
+var _0x385f=['./whatsappQueue.socket','register','request','then','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappQueue,\x20%s,\x20%s','message','catch','GetWhatsappQueue','findAll','options','raw','attributes','limit','include','map','ShowWhatsappQueue','WhatsappQueue','find','where','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','redis','localhost'];(function(_0x5cff32,_0x371623){var _0x5af039=function(_0x3326c8){while(--_0x3326c8){_0x5cff32['push'](_0x5cff32['shift']());}};_0x5af039(++_0x371623);}(_0x385f,0x18c));var _0xf385=function(_0x5bc5fe,_0x2afaef){_0x5bc5fe=_0x5bc5fe-0x0;var _0x298ea7=_0x385f[_0x5bc5fe];return _0x298ea7;};'use strict';var _=require('lodash');var util=require(_0xf385('0x0'));var moment=require(_0xf385('0x1'));var BPromise=require(_0xf385('0x2'));var rs=require(_0xf385('0x3'));var fs=require('fs');var Redis=require(_0xf385('0x4'));var db=require(_0xf385('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf385('0x6'));var client=jayson[_0xf385('0x7')][_0xf385('0x8')]({'port':0x232a});config[_0xf385('0x9')]=_['defaults'](config[_0xf385('0x9')],{'host':_0xf385('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf385('0x9')]));require(_0xf385('0xb'))[_0xf385('0xc')](socket);function respondWithRpcPromise(_0x1f02b7,_0x2a826e,_0xfb1e9c){return new BPromise(function(_0x1a6fd6,_0x2e555e){return client[_0xf385('0xd')](_0x1f02b7,_0xfb1e9c)[_0xf385('0xe')](function(_0x5d8720){logger[_0xf385('0xf')]('WhatsappQueue,\x20%s,\x20%s',_0x2a826e,_0xf385('0x10'));logger[_0xf385('0x11')](_0xf385('0x12'),_0x2a826e,_0xf385('0x10'),JSON[_0xf385('0x13')](_0x5d8720));if(_0x5d8720[_0xf385('0x14')]){if(_0x5d8720['error']['code']===0x1f4){logger[_0xf385('0x14')](_0xf385('0x15'),_0x2a826e,_0x5d8720[_0xf385('0x14')][_0xf385('0x16')]);return _0x2e555e(_0x5d8720[_0xf385('0x14')][_0xf385('0x16')]);}logger[_0xf385('0x14')](_0xf385('0x15'),_0x2a826e,_0x5d8720[_0xf385('0x14')][_0xf385('0x16')]);return _0x1a6fd6(_0x5d8720[_0xf385('0x14')][_0xf385('0x16')]);}else{logger['info'](_0xf385('0x15'),_0x2a826e,_0xf385('0x10'));_0x1a6fd6(_0x5d8720['result'][_0xf385('0x16')]);}})[_0xf385('0x17')](function(_0x4f1cd7){logger['error'](_0xf385('0x15'),_0x2a826e,_0x4f1cd7);_0x2e555e(_0x4f1cd7);});});}exports[_0xf385('0x18')]=function(_0x57db0b){var _0x4fb77e=this;return new Promise(function(_0x1d6dde,_0x412fdf){return db['WhatsappQueue'][_0xf385('0x19')]({'raw':_0x57db0b[_0xf385('0x1a')]?_0x57db0b[_0xf385('0x1a')][_0xf385('0x1b')]===undefined?!![]:![]:!![],'where':_0x57db0b[_0xf385('0x1a')]?_0x57db0b[_0xf385('0x1a')]['where']||null:null,'attributes':_0x57db0b[_0xf385('0x1a')]?_0x57db0b[_0xf385('0x1a')][_0xf385('0x1c')]||null:null,'limit':_0x57db0b[_0xf385('0x1a')]?_0x57db0b['options'][_0xf385('0x1d')]||null:null,'include':_0x57db0b[_0xf385('0x1a')]?_0x57db0b[_0xf385('0x1a')][_0xf385('0x1e')]?_[_0xf385('0x1f')](_0x57db0b[_0xf385('0x1a')][_0xf385('0x1e')],function(_0x515ee5){return{'model':db[_0x515ee5['model']],'as':_0x515ee5['as'],'attributes':_0x515ee5[_0xf385('0x1c')],'include':_0x515ee5[_0xf385('0x1e')]?_[_0xf385('0x1f')](_0x515ee5[_0xf385('0x1e')],function(_0x2f86db){return{'model':db[_0x2f86db['model']],'as':_0x2f86db['as'],'attributes':_0x2f86db[_0xf385('0x1c')],'include':_0x2f86db[_0xf385('0x1e')]?_[_0xf385('0x1f')](_0x2f86db[_0xf385('0x1e')],function(_0x4a8df1){return{'model':db[_0x4a8df1['model']],'as':_0x4a8df1['as'],'attributes':_0x4a8df1[_0xf385('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf385('0xe')](function(_0x42cb74){logger[_0xf385('0xf')](_0xf385('0x18'),_0x57db0b);logger[_0xf385('0x11')](_0xf385('0x18'),_0x57db0b,JSON[_0xf385('0x13')](_0x42cb74));_0x1d6dde(_0x42cb74);})[_0xf385('0x17')](function(_0x491745){logger['error']('GetWhatsappQueue',_0x491745[_0xf385('0x16')],_0x57db0b);_0x412fdf(_0x4fb77e[_0xf385('0x14')](0x1f4,_0x491745[_0xf385('0x16')]));});});};exports[_0xf385('0x20')]=function(_0x3ba67c){var _0x27892a=this;return new Promise(function(_0xb9b8ab,_0x172010){return db[_0xf385('0x21')][_0xf385('0x22')]({'raw':_0x3ba67c[_0xf385('0x1a')]?_0x3ba67c[_0xf385('0x1a')][_0xf385('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ba67c[_0xf385('0x1a')]?_0x3ba67c[_0xf385('0x1a')][_0xf385('0x23')]||null:null,'attributes':_0x3ba67c['options']?_0x3ba67c['options']['attributes']||null:null,'include':_0x3ba67c[_0xf385('0x1a')]?_0x3ba67c[_0xf385('0x1a')][_0xf385('0x1e')]?_['map'](_0x3ba67c['options'][_0xf385('0x1e')],function(_0x5497ee){return{'model':db[_0x5497ee['model']],'as':_0x5497ee['as'],'attributes':_0x5497ee['attributes'],'include':_0x5497ee['include']?_[_0xf385('0x1f')](_0x5497ee[_0xf385('0x1e')],function(_0x57fd19){return{'model':db[_0x57fd19[_0xf385('0x24')]],'as':_0x57fd19['as'],'attributes':_0x57fd19[_0xf385('0x1c')],'include':_0x57fd19[_0xf385('0x1e')]?_[_0xf385('0x1f')](_0x57fd19[_0xf385('0x1e')],function(_0x102a56){return{'model':db[_0x102a56[_0xf385('0x24')]],'as':_0x102a56['as'],'attributes':_0x102a56[_0xf385('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf385('0xe')](function(_0x5948d0){logger[_0xf385('0xf')](_0xf385('0x20'),_0x3ba67c);logger['debug'](_0xf385('0x20'),_0x3ba67c,JSON[_0xf385('0x13')](_0x5948d0));_0xb9b8ab(_0x5948d0);})[_0xf385('0x17')](function(_0x444f88){logger['error'](_0xf385('0x20'),_0x444f88[_0xf385('0x16')],_0x3ba67c);_0x172010(_0x27892a[_0xf385('0x14')](0x1f4,_0x444f88[_0xf385('0x16')]));});});};
\ No newline at end of file
index b6f2404..378678d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe26d=['length','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x2a972e,_0x15a4e2){var _0xb04743=function(_0x57137c){while(--_0x57137c){_0x2a972e['push'](_0x2a972e['shift']());}};_0xb04743(++_0x15a4e2);}(_0xe26d,0x1b2));var _0xde26=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe26d[_0x14add3];return _0x4a174f;};'use strict';var WhatsappQueueEvents=require(_0xde26('0x0'));var events=[_0xde26('0x1'),_0xde26('0x2'),_0xde26('0x3')];function createListener(_0x29e2ea,_0x47e473){return function(_0x3394b8){_0x47e473[_0xde26('0x4')](_0x29e2ea,_0x3394b8);};}function removeListener(_0x2c1b7e,_0x5d1128){return function(){WhatsappQueueEvents[_0xde26('0x5')](_0x2c1b7e,_0x5d1128);};}exports[_0xde26('0x6')]=function(_0x55a2d6){for(var _0x3a2479=0x0,_0x17d9a7=events[_0xde26('0x7')];_0x3a2479<_0x17d9a7;_0x3a2479++){var _0x379740=events[_0x3a2479];var _0x5efe93=createListener(_0xde26('0x8')+_0x379740,_0x55a2d6);WhatsappQueueEvents['on'](_0x379740,_0x5efe93);}};
\ No newline at end of file
+var _0x485c=['whatsappQueue:','save','remove','removeListener','register','length'];(function(_0x32a612,_0x536865){var _0x265432=function(_0x4db88a){while(--_0x4db88a){_0x32a612['push'](_0x32a612['shift']());}};_0x265432(++_0x536865);}(_0x485c,0x85));var _0xc485=function(_0x149c64,_0x1d9032){_0x149c64=_0x149c64-0x0;var _0x372f8c=_0x485c[_0x149c64];return _0x372f8c;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xc485('0x0'),_0xc485('0x1'),'update'];function createListener(_0x3d78b0,_0x2dd20f){return function(_0x42b3cb){_0x2dd20f['emit'](_0x3d78b0,_0x42b3cb);};}function removeListener(_0x1a5c6d,_0x4d1757){return function(){WhatsappQueueEvents[_0xc485('0x2')](_0x1a5c6d,_0x4d1757);};}exports[_0xc485('0x3')]=function(_0x5f3479){for(var _0x4c2edd=0x0,_0x558a8f=events[_0xc485('0x4')];_0x4c2edd<_0x558a8f;_0x4c2edd++){var _0x2ac5c4=events[_0x4c2edd];var _0x5af417=createListener(_0xc485('0x5')+_0x2ac5c4,_0x5f3479);WhatsappQueueEvents['on'](_0x2ac5c4,_0x5af417);}};
\ No newline at end of file
index 4688f73..4af5fdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed10=['destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','post','create','put','/:id','delete'];(function(_0x440ee8,_0x1d43f7){var _0x1c7461=function(_0x381357){while(--_0x381357){_0x440ee8['push'](_0x440ee8['shift']());}};_0x1c7461(++_0x1d43f7);}(_0xed10,0x81));var _0x0ed1=function(_0x1a635e,_0x241651){_0x1a635e=_0x1a635e-0x0;var _0x5b3345=_0xed10[_0x1a635e];return _0x5b3345;};'use strict';var multer=require(_0x0ed1('0x0'));var util=require('util');var path=require(_0x0ed1('0x1'));var timeout=require(_0x0ed1('0x2'));var express=require(_0x0ed1('0x3'));var router=express['Router']();var fs_extra=require(_0x0ed1('0x4'));var auth=require(_0x0ed1('0x5'));var interaction=require(_0x0ed1('0x6'));var config=require('../../config/environment');var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0x0ed1('0x7')](),controller[_0x0ed1('0x8')]);router[_0x0ed1('0x9')]('/describe',auth[_0x0ed1('0x7')](),controller['describe']);router[_0x0ed1('0x9')]('/:id',auth[_0x0ed1('0x7')](),controller['show']);router[_0x0ed1('0xa')]('/',auth['isAuthenticated'](),controller[_0x0ed1('0xb')]);router[_0x0ed1('0xc')](_0x0ed1('0xd'),auth[_0x0ed1('0x7')](),controller['update']);router[_0x0ed1('0xe')](_0x0ed1('0xd'),auth[_0x0ed1('0x7')](),controller[_0x0ed1('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x7eee=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5e6b74,_0x449746){var _0x2c25a5=function(_0x2f05a3){while(--_0x2f05a3){_0x5e6b74['push'](_0x5e6b74['shift']());}};_0x2c25a5(++_0x449746);}(_0x7eee,0x1da));var _0xe7ee=function(_0x32dcd4,_0x346b1f){_0x32dcd4=_0x32dcd4-0x0;var _0x39a251=_0x7eee[_0x32dcd4];return _0x39a251;};'use strict';var multer=require('multer');var util=require(_0xe7ee('0x0'));var path=require(_0xe7ee('0x1'));var timeout=require(_0xe7ee('0x2'));var express=require(_0xe7ee('0x3'));var router=express[_0xe7ee('0x4')]();var fs_extra=require(_0xe7ee('0x5'));var auth=require(_0xe7ee('0x6'));var interaction=require(_0xe7ee('0x7'));var config=require(_0xe7ee('0x8'));var controller=require('./whatsappQueueReport.controller');router[_0xe7ee('0x9')]('/',auth[_0xe7ee('0xa')](),controller[_0xe7ee('0xb')]);router[_0xe7ee('0x9')](_0xe7ee('0xc'),auth[_0xe7ee('0xa')](),controller[_0xe7ee('0xd')]);router['get'](_0xe7ee('0xe'),auth[_0xe7ee('0xa')](),controller[_0xe7ee('0xf')]);router['post']('/',auth[_0xe7ee('0xa')](),controller[_0xe7ee('0x10')]);router[_0xe7ee('0x11')](_0xe7ee('0xe'),auth[_0xe7ee('0xa')](),controller[_0xe7ee('0x12')]);router['delete'](_0xe7ee('0xe'),auth[_0xe7ee('0xa')](),controller[_0xe7ee('0x13')]);module['exports']=router;
\ No newline at end of file
index 2267c0e..7da4d93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x40b772,_0x5a0314){var _0x10b315=function(_0x27b337){while(--_0x27b337){_0x40b772['push'](_0x40b772['shift']());}};_0x10b315(++_0x5a0314);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
+var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x22a489,_0x4c3967){var _0x3237f0=function(_0x41ef33){while(--_0x41ef33){_0x22a489['push'](_0x22a489['shift']());}};_0x3237f0(++_0x4c3967);}(_0x7a54,0x106));var _0x47a5=function(_0x318091,_0x2815ab){_0x318091=_0x318091-0x0;var _0x5152bf=_0x7a54[_0x318091];return _0x5152bf;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
index a43b8bd..1e27c03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c7c=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','error','name','index','map','WhatsappQueueReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x1c7c,0x164));var _0xc1c7=function(_0x5ccf24,_0x335f8c){_0x5ccf24=_0x5ccf24-0x0;var _0x2f77c8=_0x1c7c[_0x5ccf24];return _0x2f77c8;};'use strict';var emlformat=require(_0xc1c7('0x0'));var rimraf=require(_0xc1c7('0x1'));var zipdir=require(_0xc1c7('0x2'));var jsonpatch=require(_0xc1c7('0x3'));var rp=require('request-promise');var moment=require(_0xc1c7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc1c7('0x5'));var util=require(_0xc1c7('0x6'));var path=require(_0xc1c7('0x7'));var sox=require(_0xc1c7('0x8'));var csv=require(_0xc1c7('0x9'));var ejs=require(_0xc1c7('0xa'));var fs=require('fs');var fs_extra=require(_0xc1c7('0xb'));var _=require(_0xc1c7('0xc'));var squel=require(_0xc1c7('0xd'));var crypto=require(_0xc1c7('0xe'));var jsforce=require(_0xc1c7('0xf'));var deskjs=require(_0xc1c7('0x10'));var toCsv=require(_0xc1c7('0x9'));var querystring=require(_0xc1c7('0x11'));var Papa=require(_0xc1c7('0x12'));var Redis=require(_0xc1c7('0x13'));var authService=require(_0xc1c7('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc1c7('0x15'));var hardwareService=require(_0xc1c7('0x16'));var logger=require('../../config/logger')(_0xc1c7('0x17'));var utils=require(_0xc1c7('0x18'));var config=require(_0xc1c7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1c7('0x1a'))['db'];function respondWithStatusCode(_0x44bf88,_0x376cab){_0x376cab=_0x376cab||0xcc;return function(_0x35feaa){if(_0x35feaa){return _0x44bf88[_0xc1c7('0x1b')](_0x376cab);}return _0x44bf88[_0xc1c7('0x1c')](_0x376cab)[_0xc1c7('0x1d')]();};}function respondWithResult(_0x1b57ab,_0xdfc7d9){_0xdfc7d9=_0xdfc7d9||0xc8;return function(_0x1b6905){if(_0x1b6905){return _0x1b57ab[_0xc1c7('0x1c')](_0xdfc7d9)[_0xc1c7('0x1e')](_0x1b6905);}};}function respondWithFilteredResult(_0x49576d,_0x3e1f0e){return function(_0x335600){if(_0x335600){var _0x21911c=typeof _0x3e1f0e['offset']===_0xc1c7('0x1f')&&typeof _0x3e1f0e[_0xc1c7('0x20')]===_0xc1c7('0x1f');var _0x39ac54=_0x335600[_0xc1c7('0x21')];var _0xb42702=_0x21911c?0x0:_0x3e1f0e[_0xc1c7('0x22')];var _0x2e93e5=_0x21911c?_0x335600['count']:_0x3e1f0e[_0xc1c7('0x22')]+_0x3e1f0e[_0xc1c7('0x20')];var _0x3ec66a;if(_0x2e93e5>=_0x39ac54){_0x2e93e5=_0x39ac54;_0x3ec66a=0xc8;}else{_0x3ec66a=0xce;}_0x49576d[_0xc1c7('0x1c')](_0x3ec66a);return _0x49576d['set'](_0xc1c7('0x23'),_0xb42702+'-'+_0x2e93e5+'/'+_0x39ac54)['json'](_0x335600);}return null;};}function patchUpdates(_0x5e7e4a){return function(_0x195c5f){try{jsonpatch['apply'](_0x195c5f,_0x5e7e4a,!![]);}catch(_0x5846f0){return BPromise[_0xc1c7('0x24')](_0x5846f0);}return _0x195c5f[_0xc1c7('0x25')]();};}function saveUpdates(_0x2f1b87,_0x4c6b34){return function(_0x813853){if(_0x813853){return _0x813853[_0xc1c7('0x26')](_0x2f1b87)[_0xc1c7('0x27')](function(_0x31a0e0){return _0x31a0e0;});}return null;};}function removeEntity(_0x2e64c4,_0x3a2483){return function(_0x3180fd){if(_0x3180fd){return _0x3180fd[_0xc1c7('0x28')]()[_0xc1c7('0x27')](function(){_0x2e64c4[_0xc1c7('0x1c')](0xcc)[_0xc1c7('0x1d')]();});}};}function handleEntityNotFound(_0x363fbc,_0x33aac7){return function(_0x260a3f){if(!_0x260a3f){_0x363fbc[_0xc1c7('0x1b')](0x194);}return _0x260a3f;};}function handleError(_0x21563a,_0x5edb34){_0x5edb34=_0x5edb34||0x1f4;return function(_0xf0ab9c){logger[_0xc1c7('0x29')](_0xf0ab9c['stack']);if(_0xf0ab9c['name']){delete _0xf0ab9c[_0xc1c7('0x2a')];}_0x21563a['status'](_0x5edb34)['send'](_0xf0ab9c);};}exports[_0xc1c7('0x2b')]=function(_0x1b873c,_0x46d045){var _0x243450={},_0x461360={},_0x4adb81={'count':0x0,'rows':[]};var _0x574e1c=_[_0xc1c7('0x2c')](db[_0xc1c7('0x2d')][_0xc1c7('0x2e')],function(_0x3a786f){return{'name':_0x3a786f[_0xc1c7('0x2f')],'type':_0x3a786f['type']['key']};});_0x461360[_0xc1c7('0x30')]=_[_0xc1c7('0x2c')](_0x574e1c,'name');_0x461360[_0xc1c7('0x31')]=_[_0xc1c7('0x32')](_0x1b873c[_0xc1c7('0x31')]);_0x461360[_0xc1c7('0x33')]=_[_0xc1c7('0x34')](_0x461360[_0xc1c7('0x30')],_0x461360[_0xc1c7('0x31')]);_0x243450['attributes']=_[_0xc1c7('0x34')](_0x461360[_0xc1c7('0x30')],qs[_0xc1c7('0x35')](_0x1b873c[_0xc1c7('0x31')][_0xc1c7('0x35')]));_0x243450[_0xc1c7('0x36')]=_0x243450[_0xc1c7('0x36')][_0xc1c7('0x37')]?_0x243450[_0xc1c7('0x36')]:_0x461360['model'];if(!_0x1b873c['query'][_0xc1c7('0x38')](_0xc1c7('0x39'))){_0x243450[_0xc1c7('0x20')]=qs[_0xc1c7('0x20')](_0x1b873c[_0xc1c7('0x31')][_0xc1c7('0x20')]);_0x243450[_0xc1c7('0x22')]=qs[_0xc1c7('0x22')](_0x1b873c[_0xc1c7('0x31')][_0xc1c7('0x22')]);}_0x243450[_0xc1c7('0x3a')]=qs[_0xc1c7('0x3b')](_0x1b873c[_0xc1c7('0x31')][_0xc1c7('0x3b')]);_0x243450[_0xc1c7('0x3c')]=qs[_0xc1c7('0x33')](_[_0xc1c7('0x3d')](_0x1b873c[_0xc1c7('0x31')],_0x461360[_0xc1c7('0x33')]),_0x574e1c);if(_0x1b873c[_0xc1c7('0x31')][_0xc1c7('0x3e')]){_0x243450['where']=_['merge'](_0x243450['where'],{'$or':_[_0xc1c7('0x2c')](_0x574e1c,function(_0x4f4312){if(_0x4f4312['type']!==_0xc1c7('0x3f')){var _0x24ceb4={};_0x24ceb4[_0x4f4312[_0xc1c7('0x2a')]]={'$like':'%'+_0x1b873c[_0xc1c7('0x31')]['filter']+'%'};return _0x24ceb4;}})});}_0x243450=_[_0xc1c7('0x40')]({},_0x243450,_0x1b873c[_0xc1c7('0x41')]);var _0x32e9fd={'where':_0x243450[_0xc1c7('0x3c')]};return db[_0xc1c7('0x2d')][_0xc1c7('0x21')](_0x32e9fd)[_0xc1c7('0x27')](function(_0x26343d){_0x4adb81[_0xc1c7('0x21')]=_0x26343d;if(_0x1b873c[_0xc1c7('0x31')][_0xc1c7('0x42')]){_0x243450[_0xc1c7('0x43')]=[{'all':!![]}];}return db[_0xc1c7('0x2d')]['findAll'](_0x243450);})[_0xc1c7('0x27')](function(_0x412520){_0x4adb81['rows']=_0x412520;return _0x4adb81;})[_0xc1c7('0x27')](respondWithFilteredResult(_0x46d045,_0x243450))[_0xc1c7('0x44')](handleError(_0x46d045,null));};exports[_0xc1c7('0x45')]=function(_0x7131b1,_0x46a1b5){var _0x2c09de={'raw':!![],'where':{'id':_0x7131b1[_0xc1c7('0x46')]['id']}},_0xd5e06a={};_0xd5e06a[_0xc1c7('0x30')]=_[_0xc1c7('0x32')](db['WhatsappQueueReport'][_0xc1c7('0x2e')]);_0xd5e06a[_0xc1c7('0x31')]=_['keys'](_0x7131b1['query']);_0xd5e06a[_0xc1c7('0x33')]=_[_0xc1c7('0x34')](_0xd5e06a[_0xc1c7('0x30')],_0xd5e06a[_0xc1c7('0x31')]);_0x2c09de[_0xc1c7('0x36')]=_['intersection'](_0xd5e06a[_0xc1c7('0x30')],qs[_0xc1c7('0x35')](_0x7131b1['query']['fields']));_0x2c09de['attributes']=_0x2c09de[_0xc1c7('0x36')][_0xc1c7('0x37')]?_0x2c09de[_0xc1c7('0x36')]:_0xd5e06a['model'];if(_0x7131b1[_0xc1c7('0x31')][_0xc1c7('0x42')]){_0x2c09de['include']=[{'all':!![]}];}_0x2c09de=_[_0xc1c7('0x40')]({},_0x2c09de,_0x7131b1[_0xc1c7('0x41')]);return db[_0xc1c7('0x2d')][_0xc1c7('0x47')](_0x2c09de)[_0xc1c7('0x27')](handleEntityNotFound(_0x46a1b5,null))[_0xc1c7('0x27')](respondWithResult(_0x46a1b5,null))[_0xc1c7('0x44')](handleError(_0x46a1b5,null));};exports[_0xc1c7('0x48')]=function(_0x35141f,_0x3ec5de){return db[_0xc1c7('0x2d')][_0xc1c7('0x48')](_0x35141f[_0xc1c7('0x49')],{})[_0xc1c7('0x27')](respondWithResult(_0x3ec5de,0xc9))[_0xc1c7('0x44')](handleError(_0x3ec5de,null));};exports[_0xc1c7('0x26')]=function(_0x2967b7,_0x1addc8){if(_0x2967b7['body']['id']){delete _0x2967b7[_0xc1c7('0x49')]['id'];}return db['WhatsappQueueReport'][_0xc1c7('0x47')]({'where':{'id':_0x2967b7[_0xc1c7('0x46')]['id']}})[_0xc1c7('0x27')](handleEntityNotFound(_0x1addc8,null))['then'](saveUpdates(_0x2967b7[_0xc1c7('0x49')],null))[_0xc1c7('0x27')](respondWithResult(_0x1addc8,null))['catch'](handleError(_0x1addc8,null));};exports['destroy']=function(_0x5c96cc,_0x302185){return db[_0xc1c7('0x2d')]['find']({'where':{'id':_0x5c96cc[_0xc1c7('0x46')]['id']}})[_0xc1c7('0x27')](handleEntityNotFound(_0x302185,null))[_0xc1c7('0x27')](removeEntity(_0x302185,null))[_0xc1c7('0x44')](handleError(_0x302185,null));};exports[_0xc1c7('0x4a')]=function(_0x13569a,_0x4cad6a){return db[_0xc1c7('0x2d')]['describe']()[_0xc1c7('0x27')](respondWithResult(_0x4cad6a,null))[_0xc1c7('0x44')](handleError(_0x4cad6a,null));};
\ No newline at end of file
+var _0xeffd=['model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','catch','show','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','set','Content-Range','json','reject','update','then','destroy','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','type'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xeffd,0x6b));var _0xdeff=function(_0x469e03,_0x185b44){_0x469e03=_0x469e03-0x0;var _0x378638=_0xeffd[_0x469e03];return _0x378638;};'use strict';var emlformat=require(_0xdeff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdeff('0x1'));var jsonpatch=require(_0xdeff('0x2'));var rp=require(_0xdeff('0x3'));var moment=require(_0xdeff('0x4'));var BPromise=require(_0xdeff('0x5'));var Mustache=require(_0xdeff('0x6'));var util=require(_0xdeff('0x7'));var path=require(_0xdeff('0x8'));var sox=require(_0xdeff('0x9'));var csv=require(_0xdeff('0xa'));var ejs=require(_0xdeff('0xb'));var fs=require('fs');var fs_extra=require(_0xdeff('0xc'));var _=require(_0xdeff('0xd'));var squel=require(_0xdeff('0xe'));var crypto=require(_0xdeff('0xf'));var jsforce=require(_0xdeff('0x10'));var deskjs=require(_0xdeff('0x11'));var toCsv=require('to-csv');var querystring=require(_0xdeff('0x12'));var Papa=require(_0xdeff('0x13'));var Redis=require(_0xdeff('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdeff('0x15'));var as=require(_0xdeff('0x16'));var hardwareService=require(_0xdeff('0x17'));var logger=require(_0xdeff('0x18'))(_0xdeff('0x19'));var utils=require(_0xdeff('0x1a'));var config=require(_0xdeff('0x1b'));var licenseUtil=require(_0xdeff('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x461699,_0x116bf9){_0x116bf9=_0x116bf9||0xcc;return function(_0x4952f2){if(_0x4952f2){return _0x461699[_0xdeff('0x1d')](_0x116bf9);}return _0x461699['status'](_0x116bf9)['end']();};}function respondWithResult(_0x3e56a1,_0x47410f){_0x47410f=_0x47410f||0xc8;return function(_0x1585e8){if(_0x1585e8){return _0x3e56a1[_0xdeff('0x1e')](_0x47410f)['json'](_0x1585e8);}};}function respondWithFilteredResult(_0x826132,_0x314ded){return function(_0xea6c4){if(_0xea6c4){var _0x391633=typeof _0x314ded[_0xdeff('0x1f')]===_0xdeff('0x20')&&typeof _0x314ded['limit']==='undefined';var _0x7440af=_0xea6c4['count'];var _0x5c9837=_0x391633?0x0:_0x314ded[_0xdeff('0x1f')];var _0x369e13=_0x391633?_0xea6c4['count']:_0x314ded[_0xdeff('0x1f')]+_0x314ded[_0xdeff('0x21')];var _0x1ab1fa;if(_0x369e13>=_0x7440af){_0x369e13=_0x7440af;_0x1ab1fa=0xc8;}else{_0x1ab1fa=0xce;}_0x826132[_0xdeff('0x1e')](_0x1ab1fa);return _0x826132[_0xdeff('0x22')](_0xdeff('0x23'),_0x5c9837+'-'+_0x369e13+'/'+_0x7440af)[_0xdeff('0x24')](_0xea6c4);}return null;};}function patchUpdates(_0x919c93){return function(_0x488faa){try{jsonpatch['apply'](_0x488faa,_0x919c93,!![]);}catch(_0x56cb84){return BPromise[_0xdeff('0x25')](_0x56cb84);}return _0x488faa['save']();};}function saveUpdates(_0x189627,_0x91c0b4){return function(_0x543653){if(_0x543653){return _0x543653[_0xdeff('0x26')](_0x189627)[_0xdeff('0x27')](function(_0x4eb2a8){return _0x4eb2a8;});}return null;};}function removeEntity(_0x5dbe96,_0x3b2554){return function(_0x15c425){if(_0x15c425){return _0x15c425[_0xdeff('0x28')]()[_0xdeff('0x27')](function(){_0x5dbe96[_0xdeff('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb08f19,_0x412db3){return function(_0x3741fb){if(!_0x3741fb){_0xb08f19[_0xdeff('0x1d')](0x194);}return _0x3741fb;};}function handleError(_0x16974b,_0x35823c){_0x35823c=_0x35823c||0x1f4;return function(_0x3d0111){logger['error'](_0x3d0111[_0xdeff('0x29')]);if(_0x3d0111[_0xdeff('0x2a')]){delete _0x3d0111['name'];}_0x16974b['status'](_0x35823c)[_0xdeff('0x2b')](_0x3d0111);};}exports[_0xdeff('0x2c')]=function(_0x16b2d0,_0xcb819c){var _0x533069={},_0xf9b278={},_0xbc75ee={'count':0x0,'rows':[]};var _0x4e0ff2=_[_0xdeff('0x2d')](db[_0xdeff('0x2e')][_0xdeff('0x2f')],function(_0x5045b8){return{'name':_0x5045b8['fieldName'],'type':_0x5045b8[_0xdeff('0x30')]['key']};});_0xf9b278[_0xdeff('0x31')]=_[_0xdeff('0x2d')](_0x4e0ff2,_0xdeff('0x2a'));_0xf9b278['query']=_[_0xdeff('0x32')](_0x16b2d0['query']);_0xf9b278['filters']=_[_0xdeff('0x33')](_0xf9b278[_0xdeff('0x31')],_0xf9b278[_0xdeff('0x34')]);_0x533069[_0xdeff('0x35')]=_['intersection'](_0xf9b278[_0xdeff('0x31')],qs[_0xdeff('0x36')](_0x16b2d0[_0xdeff('0x34')][_0xdeff('0x36')]));_0x533069[_0xdeff('0x35')]=_0x533069[_0xdeff('0x35')][_0xdeff('0x37')]?_0x533069['attributes']:_0xf9b278[_0xdeff('0x31')];if(!_0x16b2d0['query'][_0xdeff('0x38')](_0xdeff('0x39'))){_0x533069[_0xdeff('0x21')]=qs[_0xdeff('0x21')](_0x16b2d0[_0xdeff('0x34')][_0xdeff('0x21')]);_0x533069['offset']=qs[_0xdeff('0x1f')](_0x16b2d0[_0xdeff('0x34')]['offset']);}_0x533069[_0xdeff('0x3a')]=qs[_0xdeff('0x3b')](_0x16b2d0[_0xdeff('0x34')][_0xdeff('0x3b')]);_0x533069[_0xdeff('0x3c')]=qs[_0xdeff('0x3d')](_[_0xdeff('0x3e')](_0x16b2d0[_0xdeff('0x34')],_0xf9b278['filters']),_0x4e0ff2);if(_0x16b2d0[_0xdeff('0x34')]['filter']){_0x533069[_0xdeff('0x3c')]=_[_0xdeff('0x3f')](_0x533069[_0xdeff('0x3c')],{'$or':_['map'](_0x4e0ff2,function(_0x443550){if(_0x443550[_0xdeff('0x30')]!==_0xdeff('0x40')){var _0x467ce0={};_0x467ce0[_0x443550[_0xdeff('0x2a')]]={'$like':'%'+_0x16b2d0['query'][_0xdeff('0x41')]+'%'};return _0x467ce0;}})});}_0x533069=_['merge']({},_0x533069,_0x16b2d0[_0xdeff('0x42')]);var _0x14f1d0={'where':_0x533069['where']};return db[_0xdeff('0x2e')][_0xdeff('0x43')](_0x14f1d0)[_0xdeff('0x27')](function(_0x2e9dcd){_0xbc75ee[_0xdeff('0x43')]=_0x2e9dcd;if(_0x16b2d0['query'][_0xdeff('0x44')]){_0x533069[_0xdeff('0x45')]=[{'all':!![]}];}return db[_0xdeff('0x2e')][_0xdeff('0x46')](_0x533069);})[_0xdeff('0x27')](function(_0x5dfbb3){_0xbc75ee['rows']=_0x5dfbb3;return _0xbc75ee;})[_0xdeff('0x27')](respondWithFilteredResult(_0xcb819c,_0x533069))[_0xdeff('0x47')](handleError(_0xcb819c,null));};exports[_0xdeff('0x48')]=function(_0x318e77,_0x3c4fd2){var _0x289f70={'raw':!![],'where':{'id':_0x318e77['params']['id']}},_0x2cd68a={};_0x2cd68a[_0xdeff('0x31')]=_[_0xdeff('0x32')](db[_0xdeff('0x2e')]['rawAttributes']);_0x2cd68a[_0xdeff('0x34')]=_[_0xdeff('0x32')](_0x318e77[_0xdeff('0x34')]);_0x2cd68a[_0xdeff('0x3d')]=_['intersection'](_0x2cd68a[_0xdeff('0x31')],_0x2cd68a[_0xdeff('0x34')]);_0x289f70[_0xdeff('0x35')]=_[_0xdeff('0x33')](_0x2cd68a[_0xdeff('0x31')],qs[_0xdeff('0x36')](_0x318e77[_0xdeff('0x34')][_0xdeff('0x36')]));_0x289f70['attributes']=_0x289f70[_0xdeff('0x35')][_0xdeff('0x37')]?_0x289f70[_0xdeff('0x35')]:_0x2cd68a[_0xdeff('0x31')];if(_0x318e77[_0xdeff('0x34')]['includeAll']){_0x289f70[_0xdeff('0x45')]=[{'all':!![]}];}_0x289f70=_[_0xdeff('0x3f')]({},_0x289f70,_0x318e77[_0xdeff('0x42')]);return db[_0xdeff('0x2e')][_0xdeff('0x49')](_0x289f70)['then'](handleEntityNotFound(_0x3c4fd2,null))[_0xdeff('0x27')](respondWithResult(_0x3c4fd2,null))['catch'](handleError(_0x3c4fd2,null));};exports[_0xdeff('0x4a')]=function(_0x10e4ba,_0x1bf17c){return db[_0xdeff('0x2e')][_0xdeff('0x4a')](_0x10e4ba[_0xdeff('0x4b')],{})['then'](respondWithResult(_0x1bf17c,0xc9))['catch'](handleError(_0x1bf17c,null));};exports[_0xdeff('0x26')]=function(_0xf91a72,_0x3dc206){if(_0xf91a72['body']['id']){delete _0xf91a72['body']['id'];}return db[_0xdeff('0x2e')][_0xdeff('0x49')]({'where':{'id':_0xf91a72['params']['id']}})[_0xdeff('0x27')](handleEntityNotFound(_0x3dc206,null))[_0xdeff('0x27')](saveUpdates(_0xf91a72[_0xdeff('0x4b')],null))['then'](respondWithResult(_0x3dc206,null))[_0xdeff('0x47')](handleError(_0x3dc206,null));};exports[_0xdeff('0x28')]=function(_0x1ca376,_0x59ae32){return db[_0xdeff('0x2e')][_0xdeff('0x49')]({'where':{'id':_0x1ca376[_0xdeff('0x4c')]['id']}})[_0xdeff('0x27')](handleEntityNotFound(_0x59ae32,null))[_0xdeff('0x27')](removeEntity(_0x59ae32,null))[_0xdeff('0x47')](handleError(_0x59ae32,null));};exports[_0xdeff('0x4d')]=function(_0x578185,_0x4517d1){return db[_0xdeff('0x2e')]['describe']()[_0xdeff('0x27')](respondWithResult(_0x4517d1,null))[_0xdeff('0x47')](handleError(_0x4517d1,null));};
\ No newline at end of file
index c10d9f1..7071bfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff8c=['exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','rimraf','./whatsappQueueReport.attributes'];(function(_0x44468b,_0x340bb0){var _0x3fd01b=function(_0x45f421){while(--_0x45f421){_0x44468b['push'](_0x44468b['shift']());}};_0x3fd01b(++_0x340bb0);}(_0xff8c,0x164));var _0xcff8=function(_0x380016,_0x178dd6){_0x380016=_0x380016-0x0;var _0x5c7ac0=_0xff8c[_0x380016];return _0x5c7ac0;};'use strict';var _=require(_0xcff8('0x0'));var util=require('util');var logger=require(_0xcff8('0x1'))(_0xcff8('0x2'));var moment=require(_0xcff8('0x3'));var BPromise=require(_0xcff8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcff8('0x5'));var config=require('../../config/environment');var attributes=require(_0xcff8('0x6'));module[_0xcff8('0x7')]=function(_0x326346,_0x124149){return _0x326346['define'](_0xcff8('0x8'),attributes,{'tableName':_0xcff8('0x9'),'paranoid':![],'indexes':[{'name':_0xcff8('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3ae=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x505a9f,_0x561c36){var _0x339093=function(_0x33cbe8){while(--_0x33cbe8){_0x505a9f['push'](_0x505a9f['shift']());}};_0x339093(++_0x561c36);}(_0xf3ae,0x76));var _0xef3a=function(_0x145dca,_0x105079){_0x145dca=_0x145dca-0x0;var _0x1509cf=_0xf3ae[_0x145dca];return _0x1509cf;};'use strict';var _=require(_0xef3a('0x0'));var util=require(_0xef3a('0x1'));var logger=require(_0xef3a('0x2'))(_0xef3a('0x3'));var moment=require(_0xef3a('0x4'));var BPromise=require(_0xef3a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xef3a('0x6'));var config=require('../../config/environment');var attributes=require(_0xef3a('0x7'));module[_0xef3a('0x8')]=function(_0x351ff5,_0x3dd1b1){return _0x351ff5[_0xef3a('0x9')](_0xef3a('0xa'),attributes,{'tableName':_0xef3a('0xb'),'paranoid':![],'indexes':[{'name':_0xef3a('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 2a66f17..44b8740 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x118c=['update','body','raw','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','info','result','catch','options','stringify','UpdateWhatsappQueueReport','WhatsappQueueReport'];(function(_0x2b28db,_0x5e3df3){var _0x1a8e54=function(_0x2fa31f){while(--_0x2fa31f){_0x2b28db['push'](_0x2b28db['shift']());}};_0x1a8e54(++_0x5e3df3);}(_0x118c,0x15a));var _0xc118=function(_0x15b58b,_0x270745){_0x15b58b=_0x15b58b-0x0;var _0x3563e9=_0x118c[_0x15b58b];return _0x3563e9;};'use strict';var _=require(_0xc118('0x0'));var util=require(_0xc118('0x1'));var moment=require(_0xc118('0x2'));var BPromise=require(_0xc118('0x3'));var rs=require(_0xc118('0x4'));var fs=require('fs');var Redis=require(_0xc118('0x5'));var db=require(_0xc118('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc118('0x7'))(_0xc118('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc118('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x460be0,_0x199ef5,_0x44b811){return new BPromise(function(_0x50b961,_0x350132){return client[_0xc118('0xa')](_0x460be0,_0x44b811)[_0xc118('0xb')](function(_0xed8ab3){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x199ef5,_0xc118('0xc'));logger[_0xc118('0xd')](_0xc118('0xe'),_0x199ef5,'request\x20sent',JSON['stringify'](_0xed8ab3));if(_0xed8ab3[_0xc118('0xf')]){if(_0xed8ab3[_0xc118('0xf')][_0xc118('0x10')]===0x1f4){logger[_0xc118('0xf')](_0xc118('0x11'),_0x199ef5,_0xed8ab3[_0xc118('0xf')][_0xc118('0x12')]);return _0x350132(_0xed8ab3[_0xc118('0xf')]['message']);}logger[_0xc118('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x199ef5,_0xed8ab3[_0xc118('0xf')][_0xc118('0x12')]);return _0x50b961(_0xed8ab3[_0xc118('0xf')][_0xc118('0x12')]);}else{logger[_0xc118('0x13')](_0xc118('0x11'),_0x199ef5,_0xc118('0xc'));_0x50b961(_0xed8ab3[_0xc118('0x14')][_0xc118('0x12')]);}})[_0xc118('0x15')](function(_0x5eb5df){logger[_0xc118('0xf')](_0xc118('0x11'),_0x199ef5,_0x5eb5df);_0x350132(_0x5eb5df);});});}exports['CreateWhatsappQueueReport']=function(_0x3d96f7){var _0x35f1cc=this;return new Promise(function(_0x14de60,_0x3d1534){return db['WhatsappQueueReport']['create'](_0x3d96f7['body'],{'raw':_0x3d96f7[_0xc118('0x16')]?_0x3d96f7['options']['raw']===undefined?!![]:![]:!![]})[_0xc118('0xb')](function(_0x4c4fa4){logger['info']('CreateWhatsappQueueReport',_0x3d96f7);logger['debug']('CreateWhatsappQueueReport',_0x3d96f7,JSON[_0xc118('0x17')](_0x4c4fa4));_0x14de60(_0x4c4fa4);})[_0xc118('0x15')](function(_0x515b54){logger[_0xc118('0xf')]('CreateWhatsappQueueReport',_0x515b54[_0xc118('0x12')],_0x3d96f7);_0x3d1534(_0x35f1cc[_0xc118('0xf')](0x1f4,_0x515b54[_0xc118('0x12')]));});});};exports[_0xc118('0x18')]=function(_0xad1223){var _0x5539ac=this;return new Promise(function(_0xa25cf8,_0x439e16){return db[_0xc118('0x19')][_0xc118('0x1a')](_0xad1223[_0xc118('0x1b')],{'raw':_0xad1223[_0xc118('0x16')]?_0xad1223[_0xc118('0x16')][_0xc118('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xad1223[_0xc118('0x16')]?_0xad1223['options']['where']||null:null,'attributes':_0xad1223[_0xc118('0x16')]?_0xad1223[_0xc118('0x16')][_0xc118('0x1d')]||null:null,'limit':_0xad1223[_0xc118('0x16')]?_0xad1223[_0xc118('0x16')][_0xc118('0x1e')]||null:null})[_0xc118('0xb')](function(_0x227702){logger['info'](_0xc118('0x18'),_0xad1223);logger[_0xc118('0xd')]('UpdateWhatsappQueueReport',_0xad1223,JSON[_0xc118('0x17')](_0x227702));_0xa25cf8(_0x227702);})['catch'](function(_0x5f4873){logger[_0xc118('0xf')](_0xc118('0x18'),_0x5f4873['message'],_0xad1223);_0x439e16(_0x5539ac[_0xc118('0xf')](0x1f4,_0x5f4873[_0xc118('0x12')]));});});};
\ No newline at end of file
+var _0x388c=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','CreateWhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','WhatsappQueueReport','update','where','limit'];(function(_0xc8d68c,_0x391f87){var _0x53ec69=function(_0x16a2ef){while(--_0x16a2ef){_0xc8d68c['push'](_0xc8d68c['shift']());}};_0x53ec69(++_0x391f87);}(_0x388c,0x132));var _0xc388=function(_0x3b7807,_0x546809){_0x3b7807=_0x3b7807-0x0;var _0x3b722f=_0x388c[_0x3b7807];return _0x3b722f;};'use strict';var _=require('lodash');var util=require(_0xc388('0x0'));var moment=require(_0xc388('0x1'));var BPromise=require(_0xc388('0x2'));var rs=require(_0xc388('0x3'));var fs=require('fs');var Redis=require(_0xc388('0x4'));var db=require(_0xc388('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc388('0x6'))(_0xc388('0x7'));var config=require(_0xc388('0x8'));var jayson=require(_0xc388('0x9'));var client=jayson[_0xc388('0xa')][_0xc388('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd06583,_0x5baa8c,_0x31827f){return new BPromise(function(_0xd2253a,_0x1b48ab){return client['request'](_0xd06583,_0x31827f)[_0xc388('0xc')](function(_0xf95afb){logger[_0xc388('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5baa8c,_0xc388('0xe'));logger[_0xc388('0xf')](_0xc388('0x10'),_0x5baa8c,_0xc388('0xe'),JSON[_0xc388('0x11')](_0xf95afb));if(_0xf95afb[_0xc388('0x12')]){if(_0xf95afb[_0xc388('0x12')][_0xc388('0x13')]===0x1f4){logger[_0xc388('0x12')](_0xc388('0x14'),_0x5baa8c,_0xf95afb['error'][_0xc388('0x15')]);return _0x1b48ab(_0xf95afb['error'][_0xc388('0x15')]);}logger[_0xc388('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5baa8c,_0xf95afb[_0xc388('0x12')]['message']);return _0xd2253a(_0xf95afb[_0xc388('0x12')][_0xc388('0x15')]);}else{logger[_0xc388('0xd')](_0xc388('0x14'),_0x5baa8c,_0xc388('0xe'));_0xd2253a(_0xf95afb[_0xc388('0x16')]['message']);}})[_0xc388('0x17')](function(_0x5a5efe){logger['error'](_0xc388('0x14'),_0x5baa8c,_0x5a5efe);_0x1b48ab(_0x5a5efe);});});}exports[_0xc388('0x18')]=function(_0x4f9942){var _0x308a29=this;return new Promise(function(_0x299a2e,_0x5b6a7d){return db['WhatsappQueueReport'][_0xc388('0x19')](_0x4f9942[_0xc388('0x1a')],{'raw':_0x4f9942['options']?_0x4f9942[_0xc388('0x1b')][_0xc388('0x1c')]===undefined?!![]:![]:!![]})[_0xc388('0xc')](function(_0x445852){logger[_0xc388('0xd')](_0xc388('0x18'),_0x4f9942);logger[_0xc388('0xf')](_0xc388('0x18'),_0x4f9942,JSON[_0xc388('0x11')](_0x445852));_0x299a2e(_0x445852);})[_0xc388('0x17')](function(_0x428ac5){logger[_0xc388('0x12')](_0xc388('0x18'),_0x428ac5[_0xc388('0x15')],_0x4f9942);_0x5b6a7d(_0x308a29['error'](0x1f4,_0x428ac5[_0xc388('0x15')]));});});};exports[_0xc388('0x1d')]=function(_0x577ad1){var _0x1bb7d8=this;return new Promise(function(_0x54f830,_0x4ab24e){return db[_0xc388('0x1e')][_0xc388('0x1f')](_0x577ad1[_0xc388('0x1a')],{'raw':_0x577ad1[_0xc388('0x1b')]?_0x577ad1[_0xc388('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x577ad1['options']?_0x577ad1[_0xc388('0x1b')][_0xc388('0x20')]||null:null,'attributes':_0x577ad1[_0xc388('0x1b')]?_0x577ad1['options']['attributes']||null:null,'limit':_0x577ad1['options']?_0x577ad1['options'][_0xc388('0x21')]||null:null})[_0xc388('0xc')](function(_0x24eede){logger[_0xc388('0xd')](_0xc388('0x1d'),_0x577ad1);logger[_0xc388('0xf')]('UpdateWhatsappQueueReport',_0x577ad1,JSON['stringify'](_0x24eede));_0x54f830(_0x24eede);})['catch'](function(_0x1438d6){logger[_0xc388('0x12')](_0xc388('0x1d'),_0x1438d6['message'],_0x577ad1);_0x4ab24e(_0x1bb7d8[_0xc388('0x12')](0x1f4,_0x1438d6['message']));});});};
\ No newline at end of file
index 25d6c63..4a1face 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f8a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create','update','delete','util','Router'];(function(_0x17170b,_0x351ff9){var _0x216447=function(_0x5b5f51){while(--_0x5b5f51){_0x17170b['push'](_0x17170b['shift']());}};_0x216447(++_0x351ff9);}(_0x3f8a,0x1de));var _0xa3f8=function(_0x5c33b7,_0xdfd18e){_0x5c33b7=_0x5c33b7-0x0;var _0x4dc885=_0x3f8a[_0x5c33b7];return _0x4dc885;};'use strict';var multer=require('multer');var util=require(_0xa3f8('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa3f8('0x1')]();var fs_extra=require(_0xa3f8('0x2'));var auth=require(_0xa3f8('0x3'));var interaction=require(_0xa3f8('0x4'));var config=require(_0xa3f8('0x5'));var controller=require(_0xa3f8('0x6'));router[_0xa3f8('0x7')]('/',auth[_0xa3f8('0x8')](),controller['index']);router['get'](_0xa3f8('0x9'),auth[_0xa3f8('0x8')](),controller['describe']);router['get'](_0xa3f8('0xa'),auth[_0xa3f8('0x8')](),controller['show']);router[_0xa3f8('0xb')]('/',auth[_0xa3f8('0x8')](),controller[_0xa3f8('0xc')]);router['put']('/:id',auth[_0xa3f8('0x8')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0xe')]('/:id',auth[_0xa3f8('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x88d0=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update'];(function(_0x4e668b,_0x35b443){var _0xba75aa=function(_0x2d1e29){while(--_0x2d1e29){_0x4e668b['push'](_0x4e668b['shift']());}};_0xba75aa(++_0x35b443);}(_0x88d0,0x1a3));var _0x088d=function(_0x1c34e7,_0x33f9a8){_0x1c34e7=_0x1c34e7-0x0;var _0x378cb1=_0x88d0[_0x1c34e7];return _0x378cb1;};'use strict';var multer=require(_0x088d('0x0'));var util=require(_0x088d('0x1'));var path=require(_0x088d('0x2'));var timeout=require(_0x088d('0x3'));var express=require(_0x088d('0x4'));var router=express[_0x088d('0x5')]();var fs_extra=require(_0x088d('0x6'));var auth=require(_0x088d('0x7'));var interaction=require(_0x088d('0x8'));var config=require(_0x088d('0x9'));var controller=require(_0x088d('0xa'));router[_0x088d('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x088d('0xc'),auth[_0x088d('0xd')](),controller[_0x088d('0xe')]);router[_0x088d('0xb')](_0x088d('0xf'),auth[_0x088d('0xd')](),controller[_0x088d('0x10')]);router[_0x088d('0x11')]('/',auth[_0x088d('0xd')](),controller[_0x088d('0x12')]);router[_0x088d('0x13')](_0x088d('0xf'),auth['isAuthenticated'](),controller[_0x088d('0x14')]);router['delete'](_0x088d('0xf'),auth[_0x088d('0xd')](),controller[_0x088d('0x15')]);module['exports']=router;
\ No newline at end of file
index 0e4a0de..f92869b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f4c=['agent','DATE','sequelize','exports','STRING','ENUM','account'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8f4c,0x113));var _0xc8f4=function(_0x38f5c0,_0x57b250){_0x38f5c0=_0x38f5c0-0x0;var _0x54f13a=_0x8f4c[_0x38f5c0];return _0x54f13a;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'uniqueid':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc8f4('0x3')](_0xc8f4('0x4'),_0xc8f4('0x5'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xc8f4('0x6')]}};
\ No newline at end of file
+var _0xbd8e=['queue','DATE','sequelize','exports','account'];(function(_0x31d753,_0x3c3c50){var _0x552584=function(_0x4c9c40){while(--_0x4c9c40){_0x31d753['push'](_0x31d753['shift']());}};_0x552584(++_0x3c3c50);}(_0xbd8e,0x1b5));var _0xebd8=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xbd8e[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xebd8('0x0'));module[_0xebd8('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xebd8('0x2'),'agent',_0xebd8('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xebd8('0x4')]}};
\ No newline at end of file
index 1fff26f..3b989ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47a0=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','order','sort','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x1b8d72,_0x201a8b){var _0x1e4bb1=function(_0x27d5ed){while(--_0x27d5ed){_0x1b8d72['push'](_0x1b8d72['shift']());}};_0x1e4bb1(++_0x201a8b);}(_0x47a0,0x15a));var _0x047a=function(_0x37747f,_0x180d76){_0x37747f=_0x37747f-0x0;var _0x1d2aea=_0x47a0[_0x37747f];return _0x1d2aea;};'use strict';var emlformat=require(_0x047a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x047a('0x1'));var jsonpatch=require(_0x047a('0x2'));var rp=require(_0x047a('0x3'));var moment=require('moment');var BPromise=require(_0x047a('0x4'));var Mustache=require(_0x047a('0x5'));var util=require('util');var path=require('path');var sox=require(_0x047a('0x6'));var csv=require(_0x047a('0x7'));var ejs=require(_0x047a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x047a('0x9'));var squel=require(_0x047a('0xa'));var crypto=require(_0x047a('0xb'));var jsforce=require(_0x047a('0xc'));var deskjs=require(_0x047a('0xd'));var toCsv=require(_0x047a('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x047a('0xe'));var authService=require(_0x047a('0xf'));var qs=require(_0x047a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x047a('0x11'));var logger=require(_0x047a('0x12'))(_0x047a('0x13'));var utils=require('../../config/utils');var config=require(_0x047a('0x14'));var licenseUtil=require(_0x047a('0x15'));var db=require(_0x047a('0x16'))['db'];function respondWithStatusCode(_0xaaaa7e,_0x237de2){_0x237de2=_0x237de2||0xcc;return function(_0x24c8a0){if(_0x24c8a0){return _0xaaaa7e[_0x047a('0x17')](_0x237de2);}return _0xaaaa7e[_0x047a('0x18')](_0x237de2)[_0x047a('0x19')]();};}function respondWithResult(_0x579f74,_0x190b5e){_0x190b5e=_0x190b5e||0xc8;return function(_0x2b04fb){if(_0x2b04fb){return _0x579f74[_0x047a('0x18')](_0x190b5e)[_0x047a('0x1a')](_0x2b04fb);}};}function respondWithFilteredResult(_0x236a9d,_0x5bb3e7){return function(_0x2eef6d){if(_0x2eef6d){var _0x4abe74=typeof _0x5bb3e7[_0x047a('0x1b')]===_0x047a('0x1c')&&typeof _0x5bb3e7[_0x047a('0x1d')]===_0x047a('0x1c');var _0x5ada47=_0x2eef6d[_0x047a('0x1e')];var _0x1c0263=_0x4abe74?0x0:_0x5bb3e7[_0x047a('0x1b')];var _0x33aa9f=_0x4abe74?_0x2eef6d[_0x047a('0x1e')]:_0x5bb3e7[_0x047a('0x1b')]+_0x5bb3e7[_0x047a('0x1d')];var _0x2cf2e3;if(_0x33aa9f>=_0x5ada47){_0x33aa9f=_0x5ada47;_0x2cf2e3=0xc8;}else{_0x2cf2e3=0xce;}_0x236a9d['status'](_0x2cf2e3);return _0x236a9d['set'](_0x047a('0x1f'),_0x1c0263+'-'+_0x33aa9f+'/'+_0x5ada47)['json'](_0x2eef6d);}return null;};}function patchUpdates(_0x599620){return function(_0x576815){try{jsonpatch[_0x047a('0x20')](_0x576815,_0x599620,!![]);}catch(_0x418bf1){return BPromise['reject'](_0x418bf1);}return _0x576815[_0x047a('0x21')]();};}function saveUpdates(_0x3d4fb3,_0x3efb61){return function(_0x1679dc){if(_0x1679dc){return _0x1679dc[_0x047a('0x22')](_0x3d4fb3)['then'](function(_0x31854d){return _0x31854d;});}return null;};}function removeEntity(_0x331a66,_0x1847cd){return function(_0x3d612e){if(_0x3d612e){return _0x3d612e[_0x047a('0x23')]()[_0x047a('0x24')](function(){_0x331a66[_0x047a('0x18')](0xcc)[_0x047a('0x19')]();});}};}function handleEntityNotFound(_0x346138,_0x598782){return function(_0x235d62){if(!_0x235d62){_0x346138['sendStatus'](0x194);}return _0x235d62;};}function handleError(_0x126717,_0x3c1489){_0x3c1489=_0x3c1489||0x1f4;return function(_0x1fb48d){logger[_0x047a('0x25')](_0x1fb48d[_0x047a('0x26')]);if(_0x1fb48d['name']){delete _0x1fb48d['name'];}_0x126717[_0x047a('0x18')](_0x3c1489)[_0x047a('0x27')](_0x1fb48d);};}exports[_0x047a('0x28')]=function(_0x31effd,_0x638742){var _0xe89c9f={},_0x5cbbba={},_0x3ff100={'count':0x0,'rows':[]};var _0x25f22b=_[_0x047a('0x29')](db[_0x047a('0x2a')][_0x047a('0x2b')],function(_0x31404f){return{'name':_0x31404f[_0x047a('0x2c')],'type':_0x31404f[_0x047a('0x2d')][_0x047a('0x2e')]};});_0x5cbbba[_0x047a('0x2f')]=_['map'](_0x25f22b,_0x047a('0x30'));_0x5cbbba[_0x047a('0x31')]=_[_0x047a('0x32')](_0x31effd[_0x047a('0x31')]);_0x5cbbba[_0x047a('0x33')]=_[_0x047a('0x34')](_0x5cbbba[_0x047a('0x2f')],_0x5cbbba['query']);_0xe89c9f[_0x047a('0x35')]=_[_0x047a('0x34')](_0x5cbbba['model'],qs[_0x047a('0x36')](_0x31effd[_0x047a('0x31')][_0x047a('0x36')]));_0xe89c9f['attributes']=_0xe89c9f[_0x047a('0x35')]['length']?_0xe89c9f[_0x047a('0x35')]:_0x5cbbba['model'];if(!_0x31effd[_0x047a('0x31')]['hasOwnProperty']('nolimit')){_0xe89c9f[_0x047a('0x1d')]=qs['limit'](_0x31effd[_0x047a('0x31')]['limit']);_0xe89c9f[_0x047a('0x1b')]=qs[_0x047a('0x1b')](_0x31effd[_0x047a('0x31')][_0x047a('0x1b')]);}_0xe89c9f[_0x047a('0x37')]=qs[_0x047a('0x38')](_0x31effd['query']['sort']);_0xe89c9f['where']=qs[_0x047a('0x33')](_[_0x047a('0x39')](_0x31effd['query'],_0x5cbbba[_0x047a('0x33')]),_0x25f22b);if(_0x31effd['query'][_0x047a('0x3a')]){_0xe89c9f['where']=_[_0x047a('0x3b')](_0xe89c9f['where'],{'$or':_[_0x047a('0x29')](_0x25f22b,function(_0xf0258){if(_0xf0258[_0x047a('0x2d')]!==_0x047a('0x3c')){var _0x36a6cd={};_0x36a6cd[_0xf0258[_0x047a('0x30')]]={'$like':'%'+_0x31effd[_0x047a('0x31')][_0x047a('0x3a')]+'%'};return _0x36a6cd;}})});}_0xe89c9f=_['merge']({},_0xe89c9f,_0x31effd[_0x047a('0x3d')]);var _0x36b6bf={'where':_0xe89c9f['where']};return db['WhatsappTransferReport'][_0x047a('0x1e')](_0x36b6bf)['then'](function(_0x211b1c){_0x3ff100[_0x047a('0x1e')]=_0x211b1c;if(_0x31effd[_0x047a('0x31')][_0x047a('0x3e')]){_0xe89c9f['include']=[{'all':!![]}];}return db[_0x047a('0x2a')][_0x047a('0x3f')](_0xe89c9f);})[_0x047a('0x24')](function(_0x278476){_0x3ff100[_0x047a('0x40')]=_0x278476;return _0x3ff100;})[_0x047a('0x24')](respondWithFilteredResult(_0x638742,_0xe89c9f))[_0x047a('0x41')](handleError(_0x638742,null));};exports[_0x047a('0x42')]=function(_0x5ed1b1,_0x1c0022){var _0x4e3351={'raw':!![],'where':{'id':_0x5ed1b1[_0x047a('0x43')]['id']}},_0x2491a3={};_0x2491a3[_0x047a('0x2f')]=_[_0x047a('0x32')](db['WhatsappTransferReport'][_0x047a('0x2b')]);_0x2491a3[_0x047a('0x31')]=_[_0x047a('0x32')](_0x5ed1b1[_0x047a('0x31')]);_0x2491a3['filters']=_[_0x047a('0x34')](_0x2491a3[_0x047a('0x2f')],_0x2491a3['query']);_0x4e3351[_0x047a('0x35')]=_[_0x047a('0x34')](_0x2491a3[_0x047a('0x2f')],qs[_0x047a('0x36')](_0x5ed1b1['query']['fields']));_0x4e3351[_0x047a('0x35')]=_0x4e3351[_0x047a('0x35')][_0x047a('0x44')]?_0x4e3351[_0x047a('0x35')]:_0x2491a3[_0x047a('0x2f')];if(_0x5ed1b1[_0x047a('0x31')][_0x047a('0x3e')]){_0x4e3351['include']=[{'all':!![]}];}_0x4e3351=_[_0x047a('0x3b')]({},_0x4e3351,_0x5ed1b1['options']);return db[_0x047a('0x2a')][_0x047a('0x45')](_0x4e3351)[_0x047a('0x24')](handleEntityNotFound(_0x1c0022,null))[_0x047a('0x24')](respondWithResult(_0x1c0022,null))[_0x047a('0x41')](handleError(_0x1c0022,null));};exports[_0x047a('0x46')]=function(_0x323cd4,_0x15820e){return db[_0x047a('0x2a')][_0x047a('0x46')](_0x323cd4[_0x047a('0x47')],{})[_0x047a('0x24')](respondWithResult(_0x15820e,0xc9))['catch'](handleError(_0x15820e,null));};exports[_0x047a('0x22')]=function(_0x241418,_0x11777b){if(_0x241418[_0x047a('0x47')]['id']){delete _0x241418[_0x047a('0x47')]['id'];}return db[_0x047a('0x2a')][_0x047a('0x45')]({'where':{'id':_0x241418[_0x047a('0x43')]['id']}})[_0x047a('0x24')](handleEntityNotFound(_0x11777b,null))['then'](saveUpdates(_0x241418['body'],null))[_0x047a('0x24')](respondWithResult(_0x11777b,null))[_0x047a('0x41')](handleError(_0x11777b,null));};exports[_0x047a('0x23')]=function(_0x227854,_0xf50872){return db[_0x047a('0x2a')][_0x047a('0x45')]({'where':{'id':_0x227854[_0x047a('0x43')]['id']}})[_0x047a('0x24')](handleEntityNotFound(_0xf50872,null))[_0x047a('0x24')](removeEntity(_0xf50872,null))['catch'](handleError(_0xf50872,null));};exports['describe']=function(_0x26bbaf,_0x4b2643){return db[_0x047a('0x2a')][_0x047a('0x48')]()[_0x047a('0x24')](respondWithResult(_0x4b2643,null))['catch'](handleError(_0x4b2643,null));};
\ No newline at end of file
+var _0xb8ba=['sendStatus','end','json','offset','limit','undefined','count','status','set','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','merge','options','WhatsappTransferReport','include','findAll','catch','includeAll','find','create','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x117f7b,_0x75e132){var _0x53d335=function(_0x2a591e){while(--_0x2a591e){_0x117f7b['push'](_0x117f7b['shift']());}};_0x53d335(++_0x75e132);}(_0xb8ba,0x1a9));var _0xab8b=function(_0x2258ee,_0x2888d2){_0x2258ee=_0x2258ee-0x0;var _0x56726c=_0xb8ba[_0x2258ee];return _0x56726c;};'use strict';var emlformat=require(_0xab8b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xab8b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab8b('0x2'));var moment=require(_0xab8b('0x3'));var BPromise=require(_0xab8b('0x4'));var Mustache=require('mustache');var util=require(_0xab8b('0x5'));var path=require(_0xab8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xab8b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab8b('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xab8b('0x9'));var deskjs=require(_0xab8b('0xa'));var toCsv=require(_0xab8b('0xb'));var querystring=require(_0xab8b('0xc'));var Papa=require(_0xab8b('0xd'));var Redis=require(_0xab8b('0xe'));var authService=require(_0xab8b('0xf'));var qs=require(_0xab8b('0x10'));var as=require(_0xab8b('0x11'));var hardwareService=require(_0xab8b('0x12'));var logger=require(_0xab8b('0x13'))(_0xab8b('0x14'));var utils=require(_0xab8b('0x15'));var config=require(_0xab8b('0x16'));var licenseUtil=require(_0xab8b('0x17'));var db=require(_0xab8b('0x18'))['db'];function respondWithStatusCode(_0x4e5eb6,_0x2ae07e){_0x2ae07e=_0x2ae07e||0xcc;return function(_0xd8287f){if(_0xd8287f){return _0x4e5eb6[_0xab8b('0x19')](_0x2ae07e);}return _0x4e5eb6['status'](_0x2ae07e)[_0xab8b('0x1a')]();};}function respondWithResult(_0x23faad,_0x4f1795){_0x4f1795=_0x4f1795||0xc8;return function(_0x141df2){if(_0x141df2){return _0x23faad['status'](_0x4f1795)[_0xab8b('0x1b')](_0x141df2);}};}function respondWithFilteredResult(_0x539f8f,_0x51dc77){return function(_0x25a531){if(_0x25a531){var _0xaa9d4c=typeof _0x51dc77[_0xab8b('0x1c')]==='undefined'&&typeof _0x51dc77[_0xab8b('0x1d')]===_0xab8b('0x1e');var _0x247297=_0x25a531[_0xab8b('0x1f')];var _0x458aa5=_0xaa9d4c?0x0:_0x51dc77['offset'];var _0x1833f9=_0xaa9d4c?_0x25a531[_0xab8b('0x1f')]:_0x51dc77[_0xab8b('0x1c')]+_0x51dc77[_0xab8b('0x1d')];var _0xd0bf54;if(_0x1833f9>=_0x247297){_0x1833f9=_0x247297;_0xd0bf54=0xc8;}else{_0xd0bf54=0xce;}_0x539f8f[_0xab8b('0x20')](_0xd0bf54);return _0x539f8f[_0xab8b('0x21')]('Content-Range',_0x458aa5+'-'+_0x1833f9+'/'+_0x247297)[_0xab8b('0x1b')](_0x25a531);}return null;};}function patchUpdates(_0x6ef179){return function(_0x4815bc){try{jsonpatch['apply'](_0x4815bc,_0x6ef179,!![]);}catch(_0x78bcbe){return BPromise[_0xab8b('0x22')](_0x78bcbe);}return _0x4815bc[_0xab8b('0x23')]();};}function saveUpdates(_0x49c901,_0x698ddf){return function(_0x28b095){if(_0x28b095){return _0x28b095[_0xab8b('0x24')](_0x49c901)[_0xab8b('0x25')](function(_0x5cc398){return _0x5cc398;});}return null;};}function removeEntity(_0x5dffab,_0x3b594f){return function(_0x47edba){if(_0x47edba){return _0x47edba[_0xab8b('0x26')]()[_0xab8b('0x25')](function(){_0x5dffab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23b79a,_0x5e091d){return function(_0x56858a){if(!_0x56858a){_0x23b79a[_0xab8b('0x19')](0x194);}return _0x56858a;};}function handleError(_0x577fc0,_0x2a0237){_0x2a0237=_0x2a0237||0x1f4;return function(_0x47b6b5){logger[_0xab8b('0x27')](_0x47b6b5[_0xab8b('0x28')]);if(_0x47b6b5[_0xab8b('0x29')]){delete _0x47b6b5[_0xab8b('0x29')];}_0x577fc0[_0xab8b('0x20')](_0x2a0237)[_0xab8b('0x2a')](_0x47b6b5);};}exports[_0xab8b('0x2b')]=function(_0x303324,_0x1dfacb){var _0x1485ef={},_0x4e2f4e={},_0x1c184e={'count':0x0,'rows':[]};var _0x281ca0=_[_0xab8b('0x2c')](db['WhatsappTransferReport'][_0xab8b('0x2d')],function(_0x139f70){return{'name':_0x139f70[_0xab8b('0x2e')],'type':_0x139f70[_0xab8b('0x2f')][_0xab8b('0x30')]};});_0x4e2f4e[_0xab8b('0x31')]=_[_0xab8b('0x2c')](_0x281ca0,_0xab8b('0x29'));_0x4e2f4e['query']=_[_0xab8b('0x32')](_0x303324[_0xab8b('0x33')]);_0x4e2f4e[_0xab8b('0x34')]=_[_0xab8b('0x35')](_0x4e2f4e[_0xab8b('0x31')],_0x4e2f4e[_0xab8b('0x33')]);_0x1485ef[_0xab8b('0x36')]=_['intersection'](_0x4e2f4e[_0xab8b('0x31')],qs['fields'](_0x303324[_0xab8b('0x33')][_0xab8b('0x37')]));_0x1485ef[_0xab8b('0x36')]=_0x1485ef[_0xab8b('0x36')][_0xab8b('0x38')]?_0x1485ef[_0xab8b('0x36')]:_0x4e2f4e[_0xab8b('0x31')];if(!_0x303324[_0xab8b('0x33')][_0xab8b('0x39')](_0xab8b('0x3a'))){_0x1485ef['limit']=qs[_0xab8b('0x1d')](_0x303324['query'][_0xab8b('0x1d')]);_0x1485ef[_0xab8b('0x1c')]=qs[_0xab8b('0x1c')](_0x303324[_0xab8b('0x33')][_0xab8b('0x1c')]);}_0x1485ef[_0xab8b('0x3b')]=qs['sort'](_0x303324['query']['sort']);_0x1485ef[_0xab8b('0x3c')]=qs['filters'](_['pick'](_0x303324[_0xab8b('0x33')],_0x4e2f4e[_0xab8b('0x34')]),_0x281ca0);if(_0x303324[_0xab8b('0x33')][_0xab8b('0x3d')]){_0x1485ef[_0xab8b('0x3c')]=_['merge'](_0x1485ef[_0xab8b('0x3c')],{'$or':_[_0xab8b('0x2c')](_0x281ca0,function(_0x4cf11c){if(_0x4cf11c[_0xab8b('0x2f')]!==_0xab8b('0x3e')){var _0x17b5c1={};_0x17b5c1[_0x4cf11c[_0xab8b('0x29')]]={'$like':'%'+_0x303324[_0xab8b('0x33')]['filter']+'%'};return _0x17b5c1;}})});}_0x1485ef=_[_0xab8b('0x3f')]({},_0x1485ef,_0x303324[_0xab8b('0x40')]);var _0x31387b={'where':_0x1485ef[_0xab8b('0x3c')]};return db[_0xab8b('0x41')][_0xab8b('0x1f')](_0x31387b)[_0xab8b('0x25')](function(_0x321370){_0x1c184e[_0xab8b('0x1f')]=_0x321370;if(_0x303324[_0xab8b('0x33')]['includeAll']){_0x1485ef[_0xab8b('0x42')]=[{'all':!![]}];}return db[_0xab8b('0x41')][_0xab8b('0x43')](_0x1485ef);})[_0xab8b('0x25')](function(_0x1a4817){_0x1c184e['rows']=_0x1a4817;return _0x1c184e;})[_0xab8b('0x25')](respondWithFilteredResult(_0x1dfacb,_0x1485ef))[_0xab8b('0x44')](handleError(_0x1dfacb,null));};exports['show']=function(_0x121490,_0x49da28){var _0x1d4f86={'raw':!![],'where':{'id':_0x121490['params']['id']}},_0x4f4e99={};_0x4f4e99[_0xab8b('0x31')]=_[_0xab8b('0x32')](db['WhatsappTransferReport'][_0xab8b('0x2d')]);_0x4f4e99[_0xab8b('0x33')]=_['keys'](_0x121490[_0xab8b('0x33')]);_0x4f4e99[_0xab8b('0x34')]=_[_0xab8b('0x35')](_0x4f4e99[_0xab8b('0x31')],_0x4f4e99[_0xab8b('0x33')]);_0x1d4f86[_0xab8b('0x36')]=_[_0xab8b('0x35')](_0x4f4e99['model'],qs[_0xab8b('0x37')](_0x121490[_0xab8b('0x33')][_0xab8b('0x37')]));_0x1d4f86[_0xab8b('0x36')]=_0x1d4f86['attributes'][_0xab8b('0x38')]?_0x1d4f86[_0xab8b('0x36')]:_0x4f4e99[_0xab8b('0x31')];if(_0x121490[_0xab8b('0x33')][_0xab8b('0x45')]){_0x1d4f86['include']=[{'all':!![]}];}_0x1d4f86=_[_0xab8b('0x3f')]({},_0x1d4f86,_0x121490[_0xab8b('0x40')]);return db['WhatsappTransferReport'][_0xab8b('0x46')](_0x1d4f86)[_0xab8b('0x25')](handleEntityNotFound(_0x49da28,null))[_0xab8b('0x25')](respondWithResult(_0x49da28,null))[_0xab8b('0x44')](handleError(_0x49da28,null));};exports[_0xab8b('0x47')]=function(_0x156f31,_0x368550){return db['WhatsappTransferReport'][_0xab8b('0x47')](_0x156f31['body'],{})['then'](respondWithResult(_0x368550,0xc9))['catch'](handleError(_0x368550,null));};exports[_0xab8b('0x24')]=function(_0x77cfac,_0x5d25db){if(_0x77cfac[_0xab8b('0x48')]['id']){delete _0x77cfac[_0xab8b('0x48')]['id'];}return db[_0xab8b('0x41')][_0xab8b('0x46')]({'where':{'id':_0x77cfac[_0xab8b('0x49')]['id']}})[_0xab8b('0x25')](handleEntityNotFound(_0x5d25db,null))['then'](saveUpdates(_0x77cfac[_0xab8b('0x48')],null))['then'](respondWithResult(_0x5d25db,null))[_0xab8b('0x44')](handleError(_0x5d25db,null));};exports[_0xab8b('0x26')]=function(_0x276131,_0x5c2ba9){return db[_0xab8b('0x41')]['find']({'where':{'id':_0x276131[_0xab8b('0x49')]['id']}})[_0xab8b('0x25')](handleEntityNotFound(_0x5c2ba9,null))['then'](removeEntity(_0x5c2ba9,null))[_0xab8b('0x44')](handleError(_0x5c2ba9,null));};exports[_0xab8b('0x4a')]=function(_0x37e10d,_0x126a0f){return db[_0xab8b('0x41')]['describe']()[_0xab8b('0x25')](respondWithResult(_0x126a0f,null))['catch'](handleError(_0x126a0f,null));};
\ No newline at end of file
index defdb19..0b12111 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf8e=['./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xb4167,_0xebf65b){var _0x3675d0=function(_0x1f1133){while(--_0x1f1133){_0xb4167['push'](_0xb4167['shift']());}};_0x3675d0(++_0xebf65b);}(_0xbf8e,0x75));var _0xebf8=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xbf8e[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xebf8('0x0'));var util=require(_0xebf8('0x1'));var logger=require(_0xebf8('0x2'))(_0xebf8('0x3'));var moment=require('moment');var BPromise=require(_0xebf8('0x4'));var rp=require(_0xebf8('0x5'));var fs=require('fs');var path=require(_0xebf8('0x6'));var rimraf=require(_0xebf8('0x7'));var config=require(_0xebf8('0x8'));var attributes=require(_0xebf8('0x9'));module[_0xebf8('0xa')]=function(_0x157358,_0x58ae47){return _0x157358[_0xebf8('0xb')]('WhatsappTransferReport',attributes,{'tableName':_0xebf8('0xc'),'paranoid':![],'indexes':[{'name':_0xebf8('0xd'),'fields':[_0xebf8('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb487=['request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid','lodash','util','api','moment'];(function(_0x3f7a63,_0x5241b){var _0x47d551=function(_0x6ec2dc){while(--_0x6ec2dc){_0x3f7a63['push'](_0x3f7a63['shift']());}};_0x47d551(++_0x5241b);}(_0xb487,0x10d));var _0x7b48=function(_0x2aa188,_0x2b2943){_0x2aa188=_0x2aa188-0x0;var _0x41cebb=_0xb487[_0x2aa188];return _0x41cebb;};'use strict';var _=require(_0x7b48('0x0'));var util=require(_0x7b48('0x1'));var logger=require('../../config/logger')(_0x7b48('0x2'));var moment=require(_0x7b48('0x3'));var BPromise=require('bluebird');var rp=require(_0x7b48('0x4'));var fs=require('fs');var path=require(_0x7b48('0x5'));var rimraf=require(_0x7b48('0x6'));var config=require(_0x7b48('0x7'));var attributes=require(_0x7b48('0x8'));module[_0x7b48('0x9')]=function(_0x183fd7,_0x3cb854){return _0x183fd7[_0x7b48('0xa')]('WhatsappTransferReport',attributes,{'tableName':_0x7b48('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7b48('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 2b9c135..77931ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf937=['lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x480ee3,_0x2b4309){var _0x409556=function(_0xe3c49b){while(--_0xe3c49b){_0x480ee3['push'](_0x480ee3['shift']());}};_0x409556(++_0x2b4309);}(_0xf937,0x1e4));var _0x7f93=function(_0x8bb4c1,_0x2d6e53){_0x8bb4c1=_0x8bb4c1-0x0;var _0x67a6e1=_0xf937[_0x8bb4c1];return _0x67a6e1;};'use strict';var _=require(_0x7f93('0x0'));var util=require(_0x7f93('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7f93('0x2'));var fs=require('fs');var Redis=require(_0x7f93('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f93('0x4'));var logger=require(_0x7f93('0x5'))(_0x7f93('0x6'));var config=require(_0x7f93('0x7'));var jayson=require(_0x7f93('0x8'));var client=jayson[_0x7f93('0x9')][_0x7f93('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x585d7e,_0x5a8d97,_0x232bce){return new BPromise(function(_0x3a2b7d,_0x1427fd){return client[_0x7f93('0xb')](_0x585d7e,_0x232bce)['then'](function(_0x27dded){logger[_0x7f93('0xc')](_0x7f93('0xd'),_0x5a8d97,_0x7f93('0xe'));logger[_0x7f93('0xf')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x5a8d97,'request\x20sent',JSON[_0x7f93('0x10')](_0x27dded));if(_0x27dded[_0x7f93('0x11')]){if(_0x27dded['error'][_0x7f93('0x12')]===0x1f4){logger[_0x7f93('0x11')](_0x7f93('0xd'),_0x5a8d97,_0x27dded[_0x7f93('0x11')][_0x7f93('0x13')]);return _0x1427fd(_0x27dded[_0x7f93('0x11')][_0x7f93('0x13')]);}logger['error'](_0x7f93('0xd'),_0x5a8d97,_0x27dded[_0x7f93('0x11')][_0x7f93('0x13')]);return _0x3a2b7d(_0x27dded[_0x7f93('0x11')][_0x7f93('0x13')]);}else{logger[_0x7f93('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5a8d97,'request\x20sent');_0x3a2b7d(_0x27dded[_0x7f93('0x14')][_0x7f93('0x13')]);}})[_0x7f93('0x15')](function(_0x5018cd){logger[_0x7f93('0x11')](_0x7f93('0xd'),_0x5a8d97,_0x5018cd);_0x1427fd(_0x5018cd);});});}
\ No newline at end of file
+var _0xe9dc=['http','request','then','WhatsappTransferReport,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xe9dc,0x1d6));var _0xce9d=function(_0x12a755,_0x280b7c){_0x12a755=_0x12a755-0x0;var _0x24ba2f=_0xe9dc[_0x12a755];return _0x24ba2f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xce9d('0x0'));var BPromise=require('bluebird');var rs=require(_0xce9d('0x1'));var fs=require('fs');var Redis=require(_0xce9d('0x2'));var db=require(_0xce9d('0x3'))['db'];var utils=require(_0xce9d('0x4'));var logger=require(_0xce9d('0x5'))(_0xce9d('0x6'));var config=require(_0xce9d('0x7'));var jayson=require(_0xce9d('0x8'));var client=jayson[_0xce9d('0x9')][_0xce9d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c3e34,_0x1ab2fd,_0x513827){return new BPromise(function(_0x5cb4ed,_0x454b9f){return client[_0xce9d('0xb')](_0x2c3e34,_0x513827)[_0xce9d('0xc')](function(_0x5a6dbb){logger['info'](_0xce9d('0xd'),_0x1ab2fd,'request\x20sent');logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x1ab2fd,'request\x20sent',JSON[_0xce9d('0xe')](_0x5a6dbb));if(_0x5a6dbb[_0xce9d('0xf')]){if(_0x5a6dbb['error'][_0xce9d('0x10')]===0x1f4){logger['error'](_0xce9d('0xd'),_0x1ab2fd,_0x5a6dbb[_0xce9d('0xf')][_0xce9d('0x11')]);return _0x454b9f(_0x5a6dbb['error'][_0xce9d('0x11')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x1ab2fd,_0x5a6dbb['error'][_0xce9d('0x11')]);return _0x5cb4ed(_0x5a6dbb['error'][_0xce9d('0x11')]);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x1ab2fd,'request\x20sent');_0x5cb4ed(_0x5a6dbb[_0xce9d('0x12')][_0xce9d('0x11')]);}})[_0xce9d('0x13')](function(_0x55dcb8){logger[_0xce9d('0xf')](_0xce9d('0xd'),_0x1ab2fd,_0x55dcb8);_0x454b9f(_0x55dcb8);});});}
\ No newline at end of file
index 85540ed..3386bd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc838=['exitCode','length','map','pm2_env','Online\x20apps:','online','Offline\x20apps:','join','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','then','default','listen','info','start','filter'];(function(_0x21edb7,_0x287951){var _0x16db99=function(_0x5835f6){while(--_0x5835f6){_0x21edb7['push'](_0x21edb7['shift']());}};_0x16db99(++_0x287951);}(_0xc838,0xbd));var _0x8c83=function(_0x3a9791,_0x26fa32){_0x3a9791=_0x3a9791-0x0;var _0x825855=_0xc838[_0x3a9791];return _0x825855;};'use strict';var _=require(_0x8c83('0x0'));var db=require(_0x8c83('0x1'))['db'];var seedDb=require(_0x8c83('0x2'));var checkLicense=require(_0x8c83('0x3'));var rpc=require(_0x8c83('0x4'));var config=require(_0x8c83('0x5'));var logger=require(_0x8c83('0x6'))(_0x8c83('0x7'));var pm2=require(_0x8c83('0x8'));var pm2Config=require(_0x8c83('0x9'));var schedule=require(_0x8c83('0xa'));var chat=require(_0x8c83('0xb'));var whatsapp=require(_0x8c83('0xc'));var transcribe=require(_0x8c83('0xd'));var provider=require(_0x8c83('0xe'));function main(){return db['sequelize']['sync']()[_0x8c83('0xf')](function(){if(config['seedDB']){return seedDb[_0x8c83('0x10')]();}})[_0x8c83('0xf')](function(){return checkLicense[_0x8c83('0x10')]();})[_0x8c83('0xf')](function(){return rpc[_0x8c83('0x11')]();})[_0x8c83('0xf')](function(_0x2e547f){logger[_0x8c83('0x12')](_0x2e547f);return chat[_0x8c83('0x13')]();})[_0x8c83('0xf')](function(){return whatsapp[_0x8c83('0x13')]();})['then'](function(){return schedule[_0x8c83('0x13')]();})['then'](function(){return transcribe['start']();})[_0x8c83('0xf')](function(){return provider['start']();})[_0x8c83('0xf')](function(_0x113c7b){logger[_0x8c83('0x12')](_0x113c7b);return pm2[_0x8c83('0x13')](pm2Config);})[_0x8c83('0xf')](function(_0x1aaac5){var _0x325468=_0x1aaac5[_0x8c83('0x14')](function(_0x1ac932){return typeof _0x1ac932[_0x8c83('0x15')]==='number'&&_0x1ac932[_0x8c83('0x15')]>=0x0;});if(_0x325468[_0x8c83('0x16')]>0x0){throw new Error(_0x325468['length']+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x8c83('0x17')](_0x325468,function(_0x4e3da8){return'\x22'+_0x4e3da8[_0x8c83('0x18')]['name']+'\x22';}));}logger['info'](_0x8c83('0x19'),_['map'](_[_0x8c83('0x14')](_0x1aaac5,{'status':_0x8c83('0x1a')}),'name')['join']());logger[_0x8c83('0x12')](_0x8c83('0x1b'),_['map'](_[_0x8c83('0x14')](_0x1aaac5,function(_0x18f718){return _0x18f718['status']!==_0x8c83('0x1a');}),'name')[_0x8c83('0x1c')]()||_0x8c83('0x1d'));console[_0x8c83('0x1e')](_0x8c83('0x1f'));})[_0x8c83('0x20')](function(_0x5f4793){console['log'](_0x8c83('0x21'),_0x5f4793);logger[_0x8c83('0x22')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x5f4793);process['exit'](0x1);});}main();
\ No newline at end of file
+var _0x2cd3=['./config/environment','./config/logger','app','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','filter','exitCode','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','online','Offline\x20apps:','join','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','exit','lodash','./config/seedDB','./config/license','./rpc'];(function(_0x398533,_0xa4a211){var _0x3cf263=function(_0x1728c6){while(--_0x1728c6){_0x398533['push'](_0x398533['shift']());}};_0x3cf263(++_0xa4a211);}(_0x2cd3,0xf1));var _0x32cd=function(_0x22bee0,_0x412ecb){_0x22bee0=_0x22bee0-0x0;var _0x2d295b=_0x2cd3[_0x22bee0];return _0x2d295b;};'use strict';var _=require(_0x32cd('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0x32cd('0x1'));var checkLicense=require(_0x32cd('0x2'));var rpc=require(_0x32cd('0x3'));var config=require(_0x32cd('0x4'));var logger=require(_0x32cd('0x5'))(_0x32cd('0x6'));var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require(_0x32cd('0x7'));var chat=require(_0x32cd('0x8'));var whatsapp=require(_0x32cd('0x9'));var transcribe=require(_0x32cd('0xa'));var provider=require(_0x32cd('0xb'));function main(){return db[_0x32cd('0xc')][_0x32cd('0xd')]()[_0x32cd('0xe')](function(){if(config[_0x32cd('0xf')]){return seedDb[_0x32cd('0x10')]();}})[_0x32cd('0xe')](function(){return checkLicense[_0x32cd('0x10')]();})[_0x32cd('0xe')](function(){return rpc[_0x32cd('0x11')]();})[_0x32cd('0xe')](function(_0x164ad8){logger[_0x32cd('0x12')](_0x164ad8);return chat[_0x32cd('0x13')]();})['then'](function(){return whatsapp['start']();})[_0x32cd('0xe')](function(){return schedule['start']();})['then'](function(){return transcribe[_0x32cd('0x13')]();})[_0x32cd('0xe')](function(){return provider[_0x32cd('0x13')]();})[_0x32cd('0xe')](function(_0x1a80b7){logger[_0x32cd('0x12')](_0x1a80b7);return pm2[_0x32cd('0x13')](pm2Config);})['then'](function(_0x51b452){var _0x4f35ec=_0x51b452[_0x32cd('0x14')](function(_0x149448){return typeof _0x149448[_0x32cd('0x15')]==='number'&&_0x149448[_0x32cd('0x15')]>=0x0;});if(_0x4f35ec['length']>0x0){throw new Error(_0x4f35ec['length']+_0x32cd('0x16')+_[_0x32cd('0x17')](_0x4f35ec,function(_0x3f9c9c){return'\x22'+_0x3f9c9c[_0x32cd('0x18')][_0x32cd('0x19')]+'\x22';}));}logger[_0x32cd('0x12')]('Online\x20apps:',_[_0x32cd('0x17')](_[_0x32cd('0x14')](_0x51b452,{'status':_0x32cd('0x1a')}),'name')['join']());logger[_0x32cd('0x12')](_0x32cd('0x1b'),_[_0x32cd('0x17')](_[_0x32cd('0x14')](_0x51b452,function(_0x14b3fe){return _0x14b3fe['status']!==_0x32cd('0x1a');}),_0x32cd('0x19'))[_0x32cd('0x1c')]()||_0x32cd('0x1d'));console[_0x32cd('0x1e')](_0x32cd('0x1f'));})[_0x32cd('0x20')](function(_0x8755bd){console['log'](_0x32cd('0x21'),_0x8755bd);logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x8755bd);process[_0x32cd('0x22')](0x1);});}main();
\ No newline at end of file
index 14719c5..b710599 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41a=['passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','User','name','then','status','json','Wrong\x20credentials.','startsWith','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','length','splice','unshift','join','promisify','sign','secret','verify','secrets','session','randomBytes','now','toString','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','util','moment','role','fullname','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','lastPauseAt','allowmessenger'];(function(_0x292a0b,_0x3b2a29){var _0x2f3ccc=function(_0x337cff){while(--_0x337cff){_0x292a0b['push'](_0x292a0b['shift']());}};_0x2f3ccc(++_0x3b2a29);}(_0xa41a,0x6b));var _0xaa41=function(_0x237346,_0x469e11){_0x237346=_0x237346-0x0;var _0x4de860=_0xa41a[_0x237346];return _0x4de860;};'use strict';var db=require(_0xaa41('0x0'))['db'];var config=require(_0xaa41('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xaa41('0x2'));var encryptor=require(_0xaa41('0x3'));var _=require(_0xaa41('0x4'));var jwt=require(_0xaa41('0x5'));var expressJwt=require(_0xaa41('0x6'));var compose=require(_0xaa41('0x7'));var basicAuth=require(_0xaa41('0x8'));var crypto=require(_0xaa41('0x9'));var BPromise=require('bluebird');var util=require(_0xaa41('0xa'));var moment=require(_0xaa41('0xb'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xaa41('0xc'),_0xaa41('0xd'),'name',_0xaa41('0xe'),_0xaa41('0xf'),_0xaa41('0x10'),_0xaa41('0x11'),_0xaa41('0x12'),_0xaa41('0x13'),_0xaa41('0x14'),_0xaa41('0x15'),_0xaa41('0x16'),'smsPause',_0xaa41('0x17'),_0xaa41('0x18'),'showWebBar','lastLoginAt',_0xaa41('0x19'),'crudPermissions',_0xaa41('0x1a'),_0xaa41('0x1b'),_0xaa41('0x1c'),_0xaa41('0x1d'),_0xaa41('0x1e'),'phoneBarDnd',_0xaa41('0x1f'),_0xaa41('0x20'),_0xaa41('0x21'),_0xaa41('0x22'),_0xaa41('0x23'),_0xaa41('0x24'),_0xaa41('0x25'),'hotdesk',_0xaa41('0x26'),_0xaa41('0x27'),_0xaa41('0x28'),_0xaa41('0x29'),_0xaa41('0x2a'),_0xaa41('0x2b'),_0xaa41('0x2c'),_0xaa41('0x2d'),_0xaa41('0x2e'),'selectRecallMeCampaign','chatAutoanswer',_0xaa41('0x2f'),_0xaa41('0x30'),_0xaa41('0x31'),'smsAutoanswer',_0xaa41('0x32'),_0xaa41('0x33'),'openchannelAutoanswerDelay','faxAutoanswer',_0xaa41('0x34'),'whatsappAutoanswer',_0xaa41('0x35')];exports[_0xaa41('0x36')]=function(){return this[_0xaa41('0x37')](!![])[_0xaa41('0x38')](function(_0x1d623c,_0x4eb01f,_0x43c430){if(_0x1d623c[_0xaa41('0x39')]){_0x43c430();}else{return db[_0xaa41('0x3a')][_0xaa41('0x3b')]({'where':{'id':_0x1d623c[_0xaa41('0x3c')]['id']},'attributes':['id',_0xaa41('0x3d'),'disposition'],'raw':!![]})['then'](function(_0x16aec5){if(_0x16aec5&&_0x16aec5['closed']){return _0x4eb01f['status'](_0x16aec5[_0xaa41('0x3e')]==='unmanaged'?0x195:0x193)['json']({'message':_0x16aec5[_0xaa41('0x3e')]===_0xaa41('0x3f')?_0xaa41('0x40'):_0xaa41('0x41')});}else{_0x43c430();}})[_0xaa41('0x42')](function(_0xa7269f){_0x43c430(_0xa7269f);});}});};exports['isAuthenticated']=function isAuthenticated(_0x30a174){return compose()[_0xaa41('0x38')](function(_0x63c18c,_0x9a16e3,_0x1d8c2b){var _0x4466a3;if(_0x63c18c[_0xaa41('0x43')][_0xaa41('0x44')]){if(_['startsWith'](_0x63c18c[_0xaa41('0x43')]['authorization'],'Basic')){var _0x714537=basicAuth(_0x63c18c);db[_0xaa41('0x45')]['find']({'where':{'name':_0x714537[_0xaa41('0x46')]}})[_0xaa41('0x47')](function(_0x4e3b44){if(!_0x4e3b44||!_0x4e3b44['authenticate'](_0x714537['pass'])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x4a')});}_0x63c18c[_0xaa41('0x39')]={'id':_0x4e3b44['id']};_0x1d8c2b();})['catch'](function(_0x289c4a){_0x1d8c2b(_0x289c4a);});}else if(_[_0xaa41('0x4b')](_0x63c18c[_0xaa41('0x43')]['authorization'],_0xaa41('0x4c'))){validateJwt(_0x63c18c,_0x9a16e3,_0x1d8c2b);}else{if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x63c18c[_0xaa41('0x4d')][_0xaa41('0x4e')]){try{var _0x57fe1d={'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};verifyJwt(_0x63c18c[_0xaa41('0x4d')]['apikey'],_0x57fe1d)[_0xaa41('0x47')](function(_0x48335f){return db[_0xaa41('0x45')][_0xaa41('0x50')]({'where':{'id':_0x48335f[_0xaa41('0x51')]}})['then'](function(_0x526377){_0x4466a3=_0x526377;return db['Setting'][_0xaa41('0x3b')]({'where':{'id':0x1},'attributes':[_0xaa41('0x52'),_0xaa41('0x53')],'raw':!![]});})[_0xaa41('0x47')](function(_0x4fbb92){if(!_0x4466a3||!_['isEqual'](_0x4466a3[_0xaa41('0x54')],_0x48335f[_0xaa41('0x55')])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x56')});}if(_0x4466a3[_0xaa41('0x57')]){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}if(_0x4466a3[_0xaa41('0x59')]){if(_0x4fbb92[_0xaa41('0x53')]>0x0){if(moment(_0x4466a3[_0xaa41('0x5a')])['add'](_0x4fbb92['blockDuration'],_0xaa41('0x5b'))>moment()){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}}else{return _0x9a16e3['status'](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});}}_0x63c18c[_0xaa41('0x39')]={'id':_0x4466a3['id']};_0x1d8c2b();});})[_0xaa41('0x42')](function(){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});});}catch(_0x21f204){_0x1d8c2b(_0x21f204);}}else if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5c')});}})[_0xaa41('0x38')](function(_0x398c35,_0xc84fb8,_0x1e2eb2){if(_0x398c35['user']){db['User'][_0xaa41('0x50')]({'where':{'id':_0x398c35['user']['id']},'attributes':userAttributes})[_0xaa41('0x47')](function(_0x215896){if(!_0x215896){return _0xc84fb8[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x5d')});}_0x398c35[_0xaa41('0x39')]=_0x215896;_0x1e2eb2();})[_0xaa41('0x42')](function(_0x5ee74c){_0x1e2eb2(_0x5ee74c);});}else if(_0x30a174){_0x1e2eb2();}else{return _0xc84fb8[_0xaa41('0x48')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xaa41('0x5e')]=function canUpdate(){return compose()['use'](function(_0x57240d,_0x5274c9,_0x3bad48){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x198716){if(_0x198716['update']){_0x3bad48();}else{return _0x5274c9['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})[_0xaa41('0x42')](function(_0x2af8ba){_0x3bad48(_0x2af8ba);});});};exports[_0xaa41('0x60')]=function isWebrtcLicence(){return compose()[_0xaa41('0x38')](function(_0x258096,_0x37bf5d,_0x2fa6ec){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x22d512){if(_0x22d512[_0xaa41('0x61')]){_0x2fa6ec();}else{return _0x37bf5d[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})['catch'](function(_0x406824){_0x2fa6ec(_0x406824);});});};exports[_0xaa41('0x62')]=function(_0x1f50c,_0x2288f8,_0x57d1f6){_0x1f50c[_0xaa41('0x62')]=!![];return _0x57d1f6();};exports['signToken']=function signToken(_0x49fedd){return signJwt(_0x49fedd);};exports[_0xaa41('0x63')]=function(_0xe0eec0,_0x3e16ef){if(!_0xe0eec0['user']){return _0x3e16ef[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x64')});}var _0x48fa37={'payload':{'id':_0xe0eec0[_0xaa41('0x39')]['id'],'role':_0xe0eec0[_0xaa41('0x39')][_0xaa41('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x48fa37)[_0xaa41('0x47')](function(_0x37fbe2){_0x3e16ef[_0xaa41('0x65')](_0xaa41('0x66'),_0x37fbe2);_0x3e16ef[_0xaa41('0x67')]('/dashboards/general');})[_0xaa41('0x42')](function(_0x5bef5f){return _0x3e16ef['status'](0x1f4)[_0xaa41('0x68')](_0x5bef5f);});};exports[_0xaa41('0x69')]=function(_0x3fef3e){if(_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x54')])||_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x6b')])){return null;}else{return createJwt(_0x3fef3e);}};exports[_0xaa41('0x6c')]=function(_0x519e39){_0x519e39[_0xaa41('0x54')]=generateNonce();_0x519e39[_0xaa41('0x6b')]=generateIssuedAt();return createJwt(_0x519e39);};exports[_0xaa41('0x6d')]=function(_0x4f9e92,_0x2e0f53){var _0x35f664=_0x4f9e92['query'][_0xaa41('0x4e')];if(_0x35f664){var _0xd36d1a={'nonce':_0x2e0f53[_0xaa41('0x54')],'iat':_0x2e0f53['apiKeyIat'],'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};return verifyJwt(_0x35f664,_0xd36d1a)['then'](function(){return generateApiKey(_0x2e0f53);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xaa41('0x6e')]=function(_0x3cd14f){var _0x3a29d2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3a29d2['test'](_0x3cd14f))throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0xaa41('0x71'));return;};exports[_0xaa41('0x72')]=function(_0x2abb78,_0x5ccdc5,_0x2ae70c){var _0x57cb70=encryptor['decryptString'](_0x5ccdc5)[_0xaa41('0x73')](',');for(var _0x52ae7f=0x0;_0x52ae7f<_0x2ae70c;_0x52ae7f++){if(!_0x57cb70[_0x52ae7f])break;if(_0x2abb78[_0xaa41('0x74')]()===_0x57cb70[_0x52ae7f][_0xaa41('0x74')]()){var _0x169ddf=util['format'](_0xaa41('0x75'),_0x2ae70c);if(_0x2ae70c===0x1){_0x169ddf=_0xaa41('0x76');}throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0x169ddf);}}return;};exports[_0xaa41('0x77')]=function(_0x332a3c,_0xc56018){var _0x337059=_0xc56018?encryptor[_0xaa41('0x78')](_0xc56018)['split'](','):[];if(_0x337059[_0xaa41('0x79')]===0x5){_0x337059[_0xaa41('0x7a')](-0x1,0x1);}_0x337059[_0xaa41('0x7b')](_0x332a3c);return encryptor['encryptString'](_0x337059[_0xaa41('0x7c')](','));};function signJwt(_0x2caf5c){var _0x157898=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x7e')],{'context':jwt});var _0xfbe748=_0x2caf5c[_0xaa41('0x7f')]||config['secrets']['session'];return new BPromise(function(_0x5cb34d,_0x540325){_0x157898(_0x2caf5c['payload'],_0xfbe748,_0x2caf5c['options'])[_0xaa41('0x47')](function(_0x50b598){_0x5cb34d(_0x50b598);})['catch'](function(_0x24c6f3){_0x540325(_0x24c6f3);});});}function verifyJwt(_0x40a524,_0x1a877b,_0x312eee){var _0x5cabc4=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x80')],{'context':jwt});var _0x1ddb6c=_0x312eee||config[_0xaa41('0x81')][_0xaa41('0x82')];return new BPromise(function(_0x41ca40,_0x46ebcd){_0x5cabc4(_0x40a524,_0x1ddb6c,_0x1a877b)[_0xaa41('0x47')](function(_0x1795d1){_0x41ca40(_0x1795d1);})['catch'](function(_0x185600){_0x46ebcd(_0x185600);});});}function generateNonce(){return crypto[_0xaa41('0x83')](0x10)['toString']('hex');}function generateIssuedAt(){return Math['floor'](Date[_0xaa41('0x84')]()/0x3e8)['toString']();}function createJwt(_0x1eac4a){var _0x5c8028={'payload':{'iat':_0x1eac4a[_0xaa41('0x6b')],'nonce':_0x1eac4a[_0xaa41('0x54')]},'options':{'algorithm':'HS512','subject':_0x1eac4a['id'][_0xaa41('0x85')](),'issuer':hardwareConf[_0xaa41('0x4f')](),'audience':hardwareConf[_0xaa41('0x4f')]()}};return signJwt(_0x5c8028)[_0xaa41('0x47')](function(_0x5a2683){return{'iat':_0x1eac4a['apiKeyIat'],'nonce':_0x1eac4a[_0xaa41('0x54')],'token':_0x5a2683};});}
\ No newline at end of file
+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(_0x51b7e1,_0x2c89ff){var _0x1361f9=function(_0x1d9072){while(--_0x1d9072){_0x51b7e1['push'](_0x51b7e1['shift']());}};_0x1361f9(++_0x2c89ff);}(_0x34e8,0x12c));var _0x834e=function(_0x1c6fe6,_0x393c3c){_0x1c6fe6=_0x1c6fe6-0x0;var _0x5a1a5c=_0x34e8[_0x1c6fe6];return _0x5a1a5c;};'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
index 4ca3eaa..86d48fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7a6=['createDecipher','data','final','close','encryptString','secret','createCipher','utf8','base64','crypto','bluebird','lodash','../../config/environment','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','filter','indexOf','encryptFile','createWriteStream','update','write','end','binary','unlink','decryptFile'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0xe7a6,0x149));var _0x6e7a=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe7a6[_0x59ee6f];return _0x4c0979;};'use strict';var crypto=require(_0x6e7a('0x0'));var fs=require('fs');var BPromise=require(_0x6e7a('0x1'));var _=require(_0x6e7a('0x2'));var config=require(_0x6e7a('0x3'));var logger=require('../../config/logger')(_0x6e7a('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x6e7a('0x5')][_0x6e7a('0x6')],'algorithm':_0x6e7a('0x7')};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0x6e7a('0x8')][_0x6e7a('0x9')]){var isSupported=isAlgorithmSupported(config[_0x6e7a('0x8')][_0x6e7a('0x9')]);if(isSupported){fileOptions[_0x6e7a('0x9')]=config[_0x6e7a('0x8')][_0x6e7a('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x6e7a('0xa')](',\x20');logger[_0x6e7a('0xb')](config[_0x6e7a('0x8')][_0x6e7a('0x9')],_0x6e7a('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x5cd6c7){return AES_SUPPORTED_RX['test'](_0x5cd6c7);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x6e7a('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x3c0963){return getSupportedCiphers()[_0x6e7a('0xe')](_0x3c0963)>-0x1;}function combineOptions(_0x181174){var _0x4dddf8={};for(var _0x15bdef in fileOptions){if(fileOptions['hasOwnProperty'](_0x15bdef)){_0x4dddf8[_0x15bdef]=fileOptions[_0x15bdef];}}if(_0x181174){for(var _0x512cb8 in _0x181174){if(_0x181174['hasOwnProperty'](_0x512cb8)){_0x4dddf8[_0x512cb8]=_0x181174[_0x512cb8];}}}return _0x4dddf8;}exports[_0x6e7a('0xf')]=function(_0x28c689,_0x1f3cba,_0x57ba8a,_0x25aafa){return new BPromise(function(_0x6d42f4,_0x8bb61){_0x25aafa=combineOptions(_0x25aafa);var _0x176ae5=new Buffer(_0x57ba8a);var _0x9580b6=fs['createReadStream'](_0x28c689);var _0x4a8e67=fs[_0x6e7a('0x10')](_0x1f3cba);var _0x3efef7=crypto['createCipher'](_0x25aafa[_0x6e7a('0x9')],_0x176ae5);_0x9580b6['on']('data',function(_0x4acc90){var _0x38a04a=new Buffer(_0x3efef7[_0x6e7a('0x11')](_0x4acc90),'binary');_0x4a8e67[_0x6e7a('0x12')](_0x38a04a);});_0x9580b6['on'](_0x6e7a('0x13'),function(){try{var _0x5bd90a=new Buffer(_0x3efef7['final'](_0x6e7a('0x14')),'binary');_0x4a8e67[_0x6e7a('0x12')](_0x5bd90a);_0x4a8e67['end']();_0x4a8e67['on']('close',function(){return _0x6d42f4(_0x1f3cba);});}catch(_0x9b5303){fs[_0x6e7a('0x15')](_0x1f3cba);return _0x8bb61(_0x9b5303);}});});};exports[_0x6e7a('0x16')]=function(_0x538b7e,_0x147dae,_0x53bd32,_0x1bfa80){return new BPromise(function(_0x5a0c1e,_0xbdb34){_0x1bfa80=combineOptions(_0x1bfa80);var _0x5d832f=new Buffer(_0x53bd32);var _0x2253c2=fs['createReadStream'](_0x538b7e);var _0x167cd1=fs['createWriteStream'](_0x147dae);var _0x157199=crypto[_0x6e7a('0x17')](_0x1bfa80[_0x6e7a('0x9')],_0x5d832f);_0x2253c2['on'](_0x6e7a('0x18'),function(_0x28f464){var _0x32f2a9=new Buffer(_0x157199[_0x6e7a('0x11')](_0x28f464),'binary');_0x167cd1[_0x6e7a('0x12')](_0x32f2a9);});_0x2253c2['on'](_0x6e7a('0x13'),function(){try{var _0x996a69=new Buffer(_0x157199[_0x6e7a('0x19')]('binary'),'binary');_0x167cd1['write'](_0x996a69);_0x167cd1[_0x6e7a('0x13')]();_0x167cd1['on'](_0x6e7a('0x1a'),function(){return _0x5a0c1e(_0x147dae);});}catch(_0x115a0f){fs['unlink'](_0x147dae);return _0xbdb34(_0x115a0f);}});});};exports[_0x6e7a('0x1b')]=function(_0x5638ed,_0x409285,_0x5534c0){var _0x5be4ec=_0x5534c0||stringOptions[_0x6e7a('0x9')];var _0xdbdd86=_0x409285||stringOptions[_0x6e7a('0x1c')];var _0x50e1ce=crypto[_0x6e7a('0x1d')](_0x5be4ec,_0xdbdd86);var _0x4add80=_0x50e1ce[_0x6e7a('0x11')](_0x5638ed,_0x6e7a('0x1e'),_0x6e7a('0x1f'));_0x4add80+=_0x50e1ce['final'](_0x6e7a('0x1f'));return _0x4add80;};exports['decryptString']=function(_0x3e0201,_0x313e90,_0x1e9dfa){var _0x538db3=_0x1e9dfa||stringOptions['algorithm'];var _0x2b9e81=_0x313e90||stringOptions[_0x6e7a('0x1c')];var _0x150d67=crypto[_0x6e7a('0x17')](_0x538db3,_0x2b9e81);var _0x50a7d7=_0x150d67['update'](_0x3e0201,_0x6e7a('0x1f'),_0x6e7a('0x1e'));_0x50a7d7+=_0x150d67[_0x6e7a('0x19')](_0x6e7a('0x1e'));return _0x50a7d7;};
\ No newline at end of file
+var _0xf0bf=['join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher','data','binary','write','end','final','close','decryptFile','createWriteStream','update','encryptString','secret','utf8','base64','decryptString','createDecipher','crypto','bluebird','lodash','../../config/environment','app','session','aes-256-ctr','encrypt','algorithm'];(function(_0x17c669,_0x189cd9){var _0x34e5b7=function(_0x47c8d1){while(--_0x47c8d1){_0x17c669['push'](_0x17c669['shift']());}};_0x34e5b7(++_0x189cd9);}(_0xf0bf,0xa1));var _0xff0b=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0xf0bf[_0x23b655];return _0x364b32;};'use strict';var crypto=require(_0xff0b('0x0'));var fs=require('fs');var BPromise=require(_0xff0b('0x1'));var _=require(_0xff0b('0x2'));var config=require(_0xff0b('0x3'));var logger=require('../../config/logger')(_0xff0b('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xff0b('0x5')],'algorithm':_0xff0b('0x6')};const fileOptions={'algorithm':'aes192'};if(config[_0xff0b('0x7')]&&config[_0xff0b('0x7')][_0xff0b('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xff0b('0x8')]);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0xff0b('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xff0b('0x9')](',\x20');logger[_0xff0b('0xa')](config[_0xff0b('0x7')][_0xff0b('0x8')],_0xff0b('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x4968a7){return AES_SUPPORTED_RX[_0xff0b('0xc')](_0x4968a7);}function getSupportedCiphers(){return crypto[_0xff0b('0xd')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x5037e6){return getSupportedCiphers()[_0xff0b('0xe')](_0x5037e6)>-0x1;}function combineOptions(_0x49d5ed){var _0x5c0411={};for(var _0x18529e in fileOptions){if(fileOptions[_0xff0b('0xf')](_0x18529e)){_0x5c0411[_0x18529e]=fileOptions[_0x18529e];}}if(_0x49d5ed){for(var _0x3cb0b2 in _0x49d5ed){if(_0x49d5ed[_0xff0b('0xf')](_0x3cb0b2)){_0x5c0411[_0x3cb0b2]=_0x49d5ed[_0x3cb0b2];}}}return _0x5c0411;}exports[_0xff0b('0x10')]=function(_0x3f3f24,_0x33bc88,_0x2ad688,_0x10c34){return new BPromise(function(_0x25e15b,_0x58ff65){_0x10c34=combineOptions(_0x10c34);var _0x4f7d4f=new Buffer(_0x2ad688);var _0x4e1dcd=fs[_0xff0b('0x11')](_0x3f3f24);var _0x24150d=fs['createWriteStream'](_0x33bc88);var _0x2c0bef=crypto[_0xff0b('0x12')](_0x10c34['algorithm'],_0x4f7d4f);_0x4e1dcd['on'](_0xff0b('0x13'),function(_0x4448c0){var _0x154014=new Buffer(_0x2c0bef['update'](_0x4448c0),_0xff0b('0x14'));_0x24150d[_0xff0b('0x15')](_0x154014);});_0x4e1dcd['on'](_0xff0b('0x16'),function(){try{var _0x2e77e3=new Buffer(_0x2c0bef[_0xff0b('0x17')](_0xff0b('0x14')),_0xff0b('0x14'));_0x24150d[_0xff0b('0x15')](_0x2e77e3);_0x24150d[_0xff0b('0x16')]();_0x24150d['on'](_0xff0b('0x18'),function(){return _0x25e15b(_0x33bc88);});}catch(_0x3656ea){fs['unlink'](_0x33bc88);return _0x58ff65(_0x3656ea);}});});};exports[_0xff0b('0x19')]=function(_0x26e0ce,_0x4e8d9b,_0x2a5d8f,_0x2ab940){return new BPromise(function(_0x23262c,_0x3040d7){_0x2ab940=combineOptions(_0x2ab940);var _0x2f2b65=new Buffer(_0x2a5d8f);var _0x5f3514=fs[_0xff0b('0x11')](_0x26e0ce);var _0x11e95c=fs[_0xff0b('0x1a')](_0x4e8d9b);var _0x23c22b=crypto['createDecipher'](_0x2ab940['algorithm'],_0x2f2b65);_0x5f3514['on'](_0xff0b('0x13'),function(_0x4a0ddb){var _0x2d1d75=new Buffer(_0x23c22b[_0xff0b('0x1b')](_0x4a0ddb),_0xff0b('0x14'));_0x11e95c[_0xff0b('0x15')](_0x2d1d75);});_0x5f3514['on'](_0xff0b('0x16'),function(){try{var _0x18cb53=new Buffer(_0x23c22b[_0xff0b('0x17')](_0xff0b('0x14')),_0xff0b('0x14'));_0x11e95c[_0xff0b('0x15')](_0x18cb53);_0x11e95c[_0xff0b('0x16')]();_0x11e95c['on']('close',function(){return _0x23262c(_0x4e8d9b);});}catch(_0x4907bf){fs['unlink'](_0x4e8d9b);return _0x3040d7(_0x4907bf);}});});};exports[_0xff0b('0x1c')]=function(_0x56f946,_0x5eaaec,_0x326f5c){var _0x19bb7e=_0x326f5c||stringOptions[_0xff0b('0x8')];var _0x29dad6=_0x5eaaec||stringOptions[_0xff0b('0x1d')];var _0x2d2750=crypto['createCipher'](_0x19bb7e,_0x29dad6);var _0x2eafd0=_0x2d2750[_0xff0b('0x1b')](_0x56f946,_0xff0b('0x1e'),'base64');_0x2eafd0+=_0x2d2750['final'](_0xff0b('0x1f'));return _0x2eafd0;};exports[_0xff0b('0x20')]=function(_0x54db05,_0x17daf6,_0x3fd6dd){var _0x17e4b0=_0x3fd6dd||stringOptions[_0xff0b('0x8')];var _0x4abd50=_0x17daf6||stringOptions[_0xff0b('0x1d')];var _0xd392b7=crypto[_0xff0b('0x21')](_0x17e4b0,_0x4abd50);var _0x411d3c=_0xd392b7[_0xff0b('0x1b')](_0x54db05,_0xff0b('0x1f'),'utf8');_0x411d3c+=_0xd392b7[_0xff0b('0x17')](_0xff0b('0x1e'));return _0x411d3c;};
\ No newline at end of file
index 4c1f342..e448f89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0ce=['bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','Empty','length','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip\x20finished','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','util','path','lodash','to-csv'];(function(_0x7c0e1b,_0x33d811){var _0x234e8f=function(_0x48347d){while(--_0x48347d){_0x7c0e1b['push'](_0x7c0e1b['shift']());}};_0x234e8f(++_0x33d811);}(_0xb0ce,0x134));var _0xeb0c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb0ce[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0xeb0c('0x0'));var path=require(_0xeb0c('0x1'));var _=require(_0xeb0c('0x2'));var csv=require(_0xeb0c('0x3'));var fs=require('fs');var BPromise=require(_0xeb0c('0x4'));var zipdir=require(_0xeb0c('0x5'));var rimraf=require(_0xeb0c('0x6'));var db=require(_0xeb0c('0x7'))['db'];var dbH=require(_0xeb0c('0x7'))[_0xeb0c('0x8')];var logger=require(_0xeb0c('0x9'))(_0xeb0c('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xeb0c('0xb')][0x2]);var QUERY=process[_0xeb0c('0xb')][0x3];var PATH=process[_0xeb0c('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x55ffd6,_0x569db6){var _0x38b786={'status':_0x55ffd6};var _0x3766f9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x569db6){_0x38b786[_0xeb0c('0xc')]=_0x569db6;}return db[_0xeb0c('0xd')][_0xeb0c('0xe')](_0x38b786,_0x3766f9);}function main(){var _0x112fd8=0x1388;var _0x3efdbd;logger[_0xeb0c('0xf')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xeb0c('0x10')));return db[_0xeb0c('0x11')][_0xeb0c('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xeb0c('0x13'),_0xeb0c('0x14')]})[_0xeb0c('0x15')](function(_0x1abff2){if(_0x1abff2){_0x3efdbd=_0x1abff2;_0x112fd8=_0x3efdbd[_0xeb0c('0x14')]||0x1388;}})['then'](function(){return dbH[_0xeb0c('0x16')][_0xeb0c('0x17')](util[_0xeb0c('0x18')](_0xeb0c('0x19'),QUERY),{'type':dbH[_0xeb0c('0x16')]['QueryTypes'][_0xeb0c('0x1a')]});})[_0xeb0c('0x15')](function(_0x537767){if(!_0x537767[0x0]['num']){return analyticExtractedReport(_0xeb0c('0x1b'));}var _0x43962c=[];var _0x27958a=0x0;if(_0x3efdbd[_0xeb0c('0x13')]){if(_0x537767&&_0x537767[_0xeb0c('0x1c')]){var _0x5e40e3=_['range'](_0x537767[0x0][_0xeb0c('0x1d')]/_0x112fd8);var _0x194ac2=Number[_0xeb0c('0x1e')](_0x537767[0x0][_0xeb0c('0x1d')]/_0x112fd8)?_0x537767[0x0][_0xeb0c('0x1d')]%_0x112fd8:0x0;_0x5e40e3[_0xeb0c('0x1f')](function(_0x5a9eb2){if(_0x5a9eb2>0x0){_0x27958a+=_0x112fd8;}_0x43962c[_0xeb0c('0x20')](dbH[_0xeb0c('0x16')][_0xeb0c('0x17')](util[_0xeb0c('0x18')](_0xeb0c('0x21'),QUERY,_0x112fd8,_0x27958a),{'type':dbH['sequelize'][_0xeb0c('0x22')][_0xeb0c('0x1a')]}));});if(_0x194ac2>0x0){_0x27958a+=_0x112fd8;_0x43962c[_0xeb0c('0x20')](dbH[_0xeb0c('0x16')][_0xeb0c('0x17')](util[_0xeb0c('0x18')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x194ac2,_0x27958a),{'type':dbH['sequelize'][_0xeb0c('0x22')][_0xeb0c('0x1a')]}));}}}else{_0x43962c[_0xeb0c('0x20')](dbH[_0xeb0c('0x16')][_0xeb0c('0x17')](QUERY,{'type':dbH[_0xeb0c('0x16')]['QueryTypes']['SELECT']}));}var _0x3809b6=path[_0xeb0c('0x23')](PATH);var _0x45e714=path[_0xeb0c('0x24')](PATH,_0xeb0c('0x25'));var _0x50b052=_0x3efdbd[_0xeb0c('0x13')]&&_0x43962c[_0xeb0c('0x1c')]>0x1;var _0x37b7da=[];if(!fs[_0xeb0c('0x26')](path[_0xeb0c('0x27')](_0x3809b6,_0x45e714))&&_0x50b052){fs[_0xeb0c('0x28')](path[_0xeb0c('0x27')](_0x3809b6,_0x45e714));}return BPromise[_0xeb0c('0x29')](_0x43962c,function(_0x12148b){_0x37b7da[_0xeb0c('0x20')](_0x12148b);})[_0xeb0c('0x15')](function(){for(var _0x27b445=0x0;_0x27b445<_0x37b7da[_0xeb0c('0x1c')];_0x27b445+=0x1){var _0x57de7d;var _0x2ca123=_0x37b7da[_0x27b445];if(_0x50b052){_0x57de7d=path[_0xeb0c('0x27')](_0x3809b6,_0x45e714,util[_0xeb0c('0x18')](_0xeb0c('0x2a'),_0x45e714,_0x27b445,_0xeb0c('0x2b')));}else{_0x57de7d=path[_0xeb0c('0x27')](_0x3809b6,util[_0xeb0c('0x18')](_0xeb0c('0x2c'),_0x45e714,_0xeb0c('0x2b')));}fs['writeFileSync'](_0x57de7d,csv(_0x2ca123));}})[_0xeb0c('0x15')](function(){if(_0x50b052){return new Promise(function(_0x446671){zipdir(path[_0xeb0c('0x27')](_0x3809b6,_0x45e714),{'saveTo':path[_0xeb0c('0x27')](_0x3809b6,util[_0xeb0c('0x18')]('%s.%s',_0x45e714,'zip'))},function(_0x59fb38,_0x172447){rimraf(path[_0xeb0c('0x27')](_0x3809b6,_0x45e714),function(){});_0x446671(_0xeb0c('0x2d'));});});}})[_0xeb0c('0x15')](function(){logger[_0xeb0c('0xf')](util[_0xeb0c('0x18')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xeb0c('0x10')));return analyticExtractedReport(_0xeb0c('0x2e'),_0x50b052?util[_0xeb0c('0x18')](_0xeb0c('0x2c'),_0x45e714,_0x50b052?_0xeb0c('0x2f'):_0xeb0c('0x2b')):null);});})[_0xeb0c('0x30')](function(_0x11d728){logger[_0xeb0c('0xf')](util[_0xeb0c('0x18')](_0xeb0c('0x31'),EXTRACTED_REPORT_ID,_0xeb0c('0x10')),util[_0xeb0c('0x32')](_0x11d728,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xeb0c('0x33')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x49ec=['analytics','argv','savename','AnalyticExtractedReport','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','mkdirSync','join','%s%d.%s','%s.%s','csv','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','Failed','finally','exit','util','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH'];(function(_0x581814,_0x1a3246){var _0x557505=function(_0x344a7b){while(--_0x344a7b){_0x581814['push'](_0x581814['shift']());}};_0x557505(++_0x1a3246);}(_0x49ec,0xc1));var _0xc49e=function(_0x2b611e,_0x4441ab){_0x2b611e=_0x2b611e-0x0;var _0xb3823d=_0x49ec[_0x2b611e];return _0xb3823d;};'use strict';var util=require(_0xc49e('0x0'));var path=require('path');var _=require(_0xc49e('0x1'));var csv=require(_0xc49e('0x2'));var fs=require('fs');var BPromise=require(_0xc49e('0x3'));var zipdir=require(_0xc49e('0x4'));var rimraf=require('rimraf');var db=require(_0xc49e('0x5'))['db'];var dbH=require(_0xc49e('0x5'))[_0xc49e('0x6')];var logger=require('../../config/logger')(_0xc49e('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xc49e('0x8')][0x2]);var QUERY=process[_0xc49e('0x8')][0x3];var PATH=process[_0xc49e('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x304131,_0x27cca0){var _0xbcb88e={'status':_0x304131};var _0x62424e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x27cca0){_0xbcb88e[_0xc49e('0x9')]=_0x27cca0;}return db[_0xc49e('0xa')]['update'](_0xbcb88e,_0x62424e);}function main(){var _0xc319d0=0x1388;var _0x1b2097;logger[_0xc49e('0xb')](util['format'](_0xc49e('0xc'),EXTRACTED_REPORT_ID,_0xc49e('0xd')));return db[_0xc49e('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc49e('0xf'),_0xc49e('0x10')]})[_0xc49e('0x11')](function(_0x4d4355){if(_0x4d4355){_0x1b2097=_0x4d4355;_0xc319d0=_0x1b2097[_0xc49e('0x10')]||0x1388;}})[_0xc49e('0x11')](function(){return dbH[_0xc49e('0x12')][_0xc49e('0x13')](util[_0xc49e('0x14')](_0xc49e('0x15'),QUERY),{'type':dbH['sequelize'][_0xc49e('0x16')][_0xc49e('0x17')]});})[_0xc49e('0x11')](function(_0x460ee4){if(!_0x460ee4[0x0][_0xc49e('0x18')]){return analyticExtractedReport(_0xc49e('0x19'));}var _0x2ac199=[];var _0x3b0f8b=0x0;if(_0x1b2097[_0xc49e('0xf')]){if(_0x460ee4&&_0x460ee4[_0xc49e('0x1a')]){var _0x34fba3=_['range'](_0x460ee4[0x0][_0xc49e('0x18')]/_0xc319d0);var _0x9216bd=Number[_0xc49e('0x1b')](_0x460ee4[0x0][_0xc49e('0x18')]/_0xc319d0)?_0x460ee4[0x0][_0xc49e('0x18')]%_0xc319d0:0x0;_0x34fba3[_0xc49e('0x1c')](function(_0x401231){if(_0x401231>0x0){_0x3b0f8b+=_0xc319d0;}_0x2ac199[_0xc49e('0x1d')](dbH[_0xc49e('0x12')][_0xc49e('0x13')](util[_0xc49e('0x14')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xc319d0,_0x3b0f8b),{'type':dbH[_0xc49e('0x12')][_0xc49e('0x16')][_0xc49e('0x17')]}));});if(_0x9216bd>0x0){_0x3b0f8b+=_0xc319d0;_0x2ac199[_0xc49e('0x1d')](dbH[_0xc49e('0x12')]['query'](util['format'](_0xc49e('0x1e'),QUERY,_0x9216bd,_0x3b0f8b),{'type':dbH[_0xc49e('0x12')][_0xc49e('0x16')][_0xc49e('0x17')]}));}}}else{_0x2ac199['push'](dbH[_0xc49e('0x12')][_0xc49e('0x13')](QUERY,{'type':dbH[_0xc49e('0x12')]['QueryTypes'][_0xc49e('0x17')]}));}var _0x367c16=path[_0xc49e('0x1f')](PATH);var _0x90f58a=path[_0xc49e('0x20')](PATH,_0xc49e('0x21'));var _0x1ce1f1=_0x1b2097[_0xc49e('0xf')]&&_0x2ac199[_0xc49e('0x1a')]>0x1;var _0x39f684=[];if(!fs[_0xc49e('0x22')](path['join'](_0x367c16,_0x90f58a))&&_0x1ce1f1){fs[_0xc49e('0x23')](path[_0xc49e('0x24')](_0x367c16,_0x90f58a));}return BPromise['each'](_0x2ac199,function(_0x28b099){_0x39f684[_0xc49e('0x1d')](_0x28b099);})[_0xc49e('0x11')](function(){for(var _0x345de2=0x0;_0x345de2<_0x39f684[_0xc49e('0x1a')];_0x345de2+=0x1){var _0x5c73b2;var _0x3e68cb=_0x39f684[_0x345de2];if(_0x1ce1f1){_0x5c73b2=path[_0xc49e('0x24')](_0x367c16,_0x90f58a,util[_0xc49e('0x14')](_0xc49e('0x25'),_0x90f58a,_0x345de2,'csv'));}else{_0x5c73b2=path[_0xc49e('0x24')](_0x367c16,util[_0xc49e('0x14')](_0xc49e('0x26'),_0x90f58a,_0xc49e('0x27')));}fs[_0xc49e('0x28')](_0x5c73b2,csv(_0x3e68cb));}})[_0xc49e('0x11')](function(){if(_0x1ce1f1){return new Promise(function(_0x151ae2){zipdir(path[_0xc49e('0x24')](_0x367c16,_0x90f58a),{'saveTo':path[_0xc49e('0x24')](_0x367c16,util[_0xc49e('0x14')](_0xc49e('0x26'),_0x90f58a,_0xc49e('0x29')))},function(_0xb542b9,_0x44f923){rimraf(path[_0xc49e('0x24')](_0x367c16,_0x90f58a),function(){});_0x151ae2(_0xc49e('0x2a'));});});}})[_0xc49e('0x11')](function(){logger[_0xc49e('0xb')](util[_0xc49e('0x14')](_0xc49e('0x2b'),EXTRACTED_REPORT_ID,_0xc49e('0xd')));return analyticExtractedReport(_0xc49e('0x2c'),_0x1ce1f1?util['format']('%s.%s',_0x90f58a,_0x1ce1f1?_0xc49e('0x29'):_0xc49e('0x27')):null);});})[_0xc49e('0x2d')](function(_0x4a0764){logger[_0xc49e('0xb')](util[_0xc49e('0x14')](_0xc49e('0x2e'),EXTRACTED_REPORT_ID,_0xc49e('0xd')),util['inspect'](_0x4a0764,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc49e('0x2f'));})[_0xc49e('0x30')](function(){process[_0xc49e('0x31')](EXIT_CODE);});}main();
\ No newline at end of file
index 4d99d2d..148b269 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa80d=['isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','%s.%s','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','value','auto','body','push','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','length','pageBreak','before','margin','landscape','footer','black','right','num','split','splitSizePdf','then','range'];(function(_0x334274,_0x13375e){var _0x56ad14=function(_0x1cc03a){while(--_0x1cc03a){_0x334274['push'](_0x334274['shift']());}};_0x56ad14(++_0x13375e);}(_0xa80d,0x90));var _0xda80=function(_0x320bb7,_0x547954){_0x320bb7=_0x320bb7-0x0;var _0x17537d=_0xa80d[_0x320bb7];return _0x17537d;};'use strict';var _=require(_0xda80('0x0'));var fs=require('fs');var util=require(_0xda80('0x1'));var path=require(_0xda80('0x2'));var moment=require(_0xda80('0x3'));var htmlToPdfmake=require(_0xda80('0x4'));var PdfPrinter=require(_0xda80('0x5'));var zipdir=require(_0xda80('0x6'));var rimraf=require('rimraf');var JSDOM=require(_0xda80('0x7'))[_0xda80('0x8')];var window=new JSDOM('')[_0xda80('0x9')];var BPromise=require(_0xda80('0xa'));var db=require('../../mysqldb')['db'];var dbH=require(_0xda80('0xb'))[_0xda80('0xc')];var logger=require('../../config/logger')(_0xda80('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0xda80('0xe')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xda80('0xe')][0x5];var FORMAT=_0xda80('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3ec1d2,_0x381408){var _0x2092d8={'status':_0x3ec1d2};var _0x5ea0e1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x381408){_0x2092d8[_0xda80('0x10')]=_0x381408;}return db[_0xda80('0x11')]['update'](_0x2092d8,_0x5ea0e1);}function getHeaders(_0x4e7742){return _[_0xda80('0x12')](_0x4e7742,function(_0x46feb2){return{'text':_0x46feb2,'style':_0xda80('0x13')};});}function getRows(_0x2efe62,_0xcdbc55){return _[_0xda80('0x12')](_0xcdbc55,function(_0x982cad){return _(_0x982cad)[_0xda80('0x14')](_0x2efe62)[_0xda80('0x12')](function(_0x9bd51a){return _0x9bd51a?_[_0xda80('0x15')](_0x9bd51a):'';})[_0xda80('0x16')]();});}function createTable(_0x548767,_0x6c9765){var _0x54aaec={'widths':_['fill'](Array(_0x548767['length']),0x91),'heights':function(_0x36acad){return _0x36acad===0x0?_0xda80('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x397692=getHeaders(_0x548767);_0x54aaec[_0xda80('0x18')][_0xda80('0x19')](_0x397692);var _0x5bb3e6=getRows(_0x548767,_0x6c9765);_0x54aaec[_0xda80('0x18')]=_0x54aaec[_0xda80('0x18')]['concat'](_0x5bb3e6);return _0x54aaec;}function createTables(_0x3fd0b6){var _0x4469f3=[];var _0x90b253=_[_0xda80('0x1a')](Object['keys'](_0x3fd0b6[0x0]),0x5);_0x90b253[_0xda80('0x1b')](function(_0x52caf0){_0x4469f3['push'](createTable(_0x52caf0,_0x3fd0b6));});return _0x4469f3;}function getPDFDocDefinition(_0x45762f){var _0x5918ec=util[_0xda80('0x1c')](_0xda80('0x1d'),NAME,EXTRACTED_REPORT[_0xda80('0x1e')],moment(EXTRACTED_REPORT[_0xda80('0x1f')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xda80('0x20')])['format'](FORMAT));var _0x325ddc=[];for(var _0x55b794=0x0;_0x55b794<_0x45762f[_0xda80('0x21')];_0x55b794++){var _0x237cba=[];if(_0x55b794===0x0){_0x237cba['push']({'text':_0x5918ec,'style':'header'});}var _0x383741={'table':_0x45762f[_0x55b794]};if(_0x55b794>0x0){_0x383741[_0xda80('0x22')]=_0xda80('0x23');_0x383741[_0xda80('0x24')]=[0x0,0x46,0x0,0x0];}_0x237cba['push'](_0x383741);_0x325ddc[_0xda80('0x19')](_0x237cba);}return{'pageSize':'A4','pageOrientation':_0xda80('0x25'),'content':_0x325ddc,'footer':function(_0xf8b4da,_0x13aaf0){return{'text':_0xf8b4da[_0xda80('0x15')]()+'\x20/\x20'+_0x13aaf0,'style':_0xda80('0x26')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xda80('0x27')},'footer':{'alignment':_0xda80('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xe63477){var _0x106818=0x1388;var _0x1a01f1;if(!_0xe63477[0x0][_0xda80('0x29')]){return analyticExtractedReport('Empty');}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xda80('0x2a'),_0xda80('0x2b')]})[_0xda80('0x2c')](function(_0x465a0a){if(_0x465a0a){_0x1a01f1=_0x465a0a;_0x106818=_0x1a01f1['splitSizePdf']||0x3e8;}})[_0xda80('0x2c')](function(){var _0x32a949=[];var _0x1a50ab=0x0;if(_0x1a01f1[_0xda80('0x2a')]){if(_0xe63477&&_0xe63477[_0xda80('0x21')]){var _0x3e8298=_[_0xda80('0x2d')](_0xe63477[0x0][_0xda80('0x29')]/_0x106818);var _0x2ca5b3=Number[_0xda80('0x2e')](_0xe63477[0x0]['num']/_0x106818)?_0xe63477[0x0][_0xda80('0x29')]%_0x106818:0x0;_0x3e8298[_0xda80('0x1b')](function(_0x4a99be){if(_0x4a99be>0x0){_0x1a50ab+=_0x106818;}_0x32a949[_0xda80('0x19')](dbH[_0xda80('0x2f')][_0xda80('0x30')](util[_0xda80('0x1c')](_0xda80('0x31'),QUERY,_0x106818,_0x1a50ab),{'type':dbH['sequelize'][_0xda80('0x32')]['SELECT']}));});if(_0x2ca5b3>0x0){_0x1a50ab+=_0x106818;_0x32a949['push'](dbH[_0xda80('0x2f')][_0xda80('0x30')](util[_0xda80('0x1c')](_0xda80('0x31'),QUERY,_0x2ca5b3,_0x1a50ab),{'type':dbH['sequelize'][_0xda80('0x32')][_0xda80('0x33')]}));}}}else{_0x32a949['push'](dbH[_0xda80('0x2f')][_0xda80('0x30')](QUERY,{'type':dbH[_0xda80('0x2f')][_0xda80('0x32')][_0xda80('0x33')]}));}var _0x29c239=path[_0xda80('0x34')](PATH);var _0x50b702=path[_0xda80('0x35')](PATH,_0xda80('0x36'));var _0x3bd636=_0x1a01f1[_0xda80('0x2a')]&&_0x32a949['length']>0x1;var _0x165c35=[];if(!fs[_0xda80('0x37')](path[_0xda80('0x38')](_0x29c239,_0x50b702))&&_0x3bd636){fs[_0xda80('0x39')](path[_0xda80('0x38')](_0x29c239,_0x50b702));}return BPromise[_0xda80('0x3a')](_0x32a949,function(_0x4fee0c){_0x165c35[_0xda80('0x19')](_0x4fee0c);})['then'](function(){var _0x44ed8a=[];for(var _0x4d58b5=0x0;_0x4d58b5<_0x165c35[_0xda80('0x21')];_0x4d58b5+=0x1){var _0x30336f=_0x165c35[_0x4d58b5];var _0x214e0c=createTables(_[_0xda80('0x3b')](_0x30336f));var _0x440094;var _0x107fc8=getPDFDocDefinition(_0x214e0c);var _0x19c319=getPDFPrinter();var _0x595791=_0x19c319[_0xda80('0x3c')](_0x107fc8);if(_0x3bd636){_0x440094=path[_0xda80('0x38')](_0x29c239,_0x50b702,util[_0xda80('0x1c')](_0xda80('0x3d'),_0x50b702,_0x4d58b5,_0xda80('0x3e')));}else{_0x440094=path[_0xda80('0x38')](_0x29c239,util['format']('%s.%s',_0x50b702,'pdf'));}_0x44ed8a[_0xda80('0x19')](writePDFDocument(_0x595791,_0x440094));}return Promise[_0xda80('0x3f')](_0x44ed8a);})[_0xda80('0x2c')](function(){if(_0x3bd636){return new Promise(function(_0x5551f5){zipdir(path['join'](_0x29c239,_0x50b702),{'saveTo':path['join'](_0x29c239,util[_0xda80('0x1c')]('%s.%s',_0x50b702,_0xda80('0x40')))},function(){rimraf(path['join'](_0x29c239,_0x50b702),function(){});_0x5551f5(_0xda80('0x41'));});});}})[_0xda80('0x2c')](function(){if(!_0x3bd636)return;rimraf(path['join'](_0x29c239,_0x50b702),function(){});})[_0xda80('0x2c')](function(){logger[_0xda80('0x42')](util['format'](_0xda80('0x43'),EXTRACTED_REPORT_ID,_0xda80('0x44')));return analyticExtractedReport(_0xda80('0x45'),_0x3bd636?util[_0xda80('0x1c')](_0xda80('0x46'),_0x50b702,_0x3bd636?_0xda80('0x40'):_0xda80('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xda80('0x1c')](_0xda80('0x47'),EXTRACTED_REPORT_ID,_0xda80('0x44')));return db[_0xda80('0x11')][_0xda80('0x48')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xda80('0x2c')](function(_0x6c514c){EXTRACTED_REPORT=_0x6c514c;return dbH[_0xda80('0x2f')][_0xda80('0x30')](util[_0xda80('0x1c')](_0xda80('0x49'),QUERY),{'type':dbH[_0xda80('0x2f')][_0xda80('0x32')][_0xda80('0x33')]});})[_0xda80('0x2c')](extractReport)[_0xda80('0x4a')](function(_0x2fbc97){logger[_0xda80('0x42')](util['format'](_0xda80('0x4b'),EXTRACTED_REPORT_ID,'PDF'),util[_0xda80('0x4c')](_0x2fbc97,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xda80('0x4d'));})[_0xda80('0x4e')](function(){process[_0xda80('0x4f')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1ce126=new PdfPrinter({'Arial':{'normal':__dirname+_0xda80('0x50'),'bold':__dirname+_0xda80('0x51'),'italics':__dirname+_0xda80('0x52'),'bolditalics':__dirname+_0xda80('0x53')}});return _0x1ce126;}function getPDFDocDefinitionFromHTML(_0x6c9d60,_0x520850){var _0x46f451=util[_0xda80('0x1c')](_0xda80('0x54'),_0x520850['channel'],_0x520850[_0xda80('0x55')]);var _0x434049=moment()[_0xda80('0x1c')](_0xda80('0x56'))[_0xda80('0x15')]();var _0x31a1d2=htmlToPdfmake(_0x6c9d60,{'window':window,'tableAutoSize':!![]});return{'content':[_0x31a1d2],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xda80('0x57'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xda80('0x57'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xda80('0x57')}},'header':function(){return[{'text':_0xda80('0x58'),'style':'header'}];},'footer':function(_0x3aae0b,_0x2379a8){return[{'text':util[_0xda80('0x1c')](_0xda80('0x59'),_0x46f451,_0x3aae0b,_0x2379a8,_0x434049),'style':_0xda80('0x26')}];}};}function writePDFDocument(_0x2050ea,_0xa0c887){return new Promise(function(_0x108652,_0x39c8a4){var _0x1456ee=_0x2050ea[_0xda80('0x5a')](fs['createWriteStream'](_0xa0c887));_0x1456ee['on']('finish',function(){_0x108652(_0xda80('0x5b'));});_0x1456ee['on'](_0xda80('0x5c'),function(_0x247b29){_0x39c8a4(_0x247b29);});_0x2050ea[_0xda80('0x5d')]();});}exports[_0xda80('0x5e')]=function(_0x5b86cd,_0x1818b5){var _0x565c43=getPDFPrinter();var _0x561d6b=getPDFDocDefinitionFromHTML(_0x5b86cd,_0x1818b5);var _0x1b813d=_0x565c43[_0xda80('0x3c')](_0x561d6b);return writePDFDocument(_0x1b813d,_0x1818b5[_0xda80('0x2')])[_0xda80('0x4a')](function(_0x1360eb){throw _0x1360eb;});};
\ No newline at end of file
+var _0x9b3d=['Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','createPdfFromHTML','lodash','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','value','fill','length','auto','push','body','concat','chunk','forEach','format','startDate','endDate','header','pageBreak','before','margin','landscape','toString','\x20/\x20','footer','Arial','black','right','num','Setting','find','split','splitSizePdf','then','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','sequelize','QueryTypes','dirname','basename','.pdf','existsSync','join','each','flatten','createPdfKitDocument','%s%d.%s','%s.%s','pdf','all','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch'];(function(_0x6d070a,_0x47e825){var _0x2c065d=function(_0xd0565c){while(--_0xd0565c){_0x6d070a['push'](_0x6d070a['shift']());}};_0x2c065d(++_0x47e825);}(_0x9b3d,0x133));var _0xd9b3=function(_0x1e72d7,_0x46057b){_0x1e72d7=_0x1e72d7-0x0;var _0x5a8f0e=_0x9b3d[_0x1e72d7];return _0x5a8f0e;};'use strict';var _=require(_0xd9b3('0x0'));var fs=require('fs');var util=require(_0xd9b3('0x1'));var path=require(_0xd9b3('0x2'));var moment=require(_0xd9b3('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xd9b3('0x4'));var zipdir=require(_0xd9b3('0x5'));var rimraf=require(_0xd9b3('0x6'));var JSDOM=require('jsdom')[_0xd9b3('0x7')];var window=new JSDOM('')[_0xd9b3('0x8')];var BPromise=require(_0xd9b3('0x9'));var db=require(_0xd9b3('0xa'))['db'];var dbH=require('../../mysqldb')[_0xd9b3('0xb')];var logger=require(_0xd9b3('0xc'))(_0xd9b3('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0xd9b3('0xe')][0x2]);var QUERY=process[_0xd9b3('0xe')][0x3];var PATH=process[_0xd9b3('0xe')][0x4];var NAME=process[_0xd9b3('0xe')][0x5];var FORMAT=_0xd9b3('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5f3a89,_0x538cac){var _0x1db6e2={'status':_0x5f3a89};var _0x417591={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x538cac){_0x1db6e2[_0xd9b3('0x10')]=_0x538cac;}return db[_0xd9b3('0x11')][_0xd9b3('0x12')](_0x1db6e2,_0x417591);}function getHeaders(_0x1a83d7){return _[_0xd9b3('0x13')](_0x1a83d7,function(_0x358e3b){return{'text':_0x358e3b,'style':'tableHeader'};});}function getRows(_0x542b89,_0x2ed1b3){return _[_0xd9b3('0x13')](_0x2ed1b3,function(_0x3d0ffe){return _(_0x3d0ffe)[_0xd9b3('0x14')](_0x542b89)[_0xd9b3('0x13')](function(_0x2013a9){return _0x2013a9?_['toString'](_0x2013a9):'';})[_0xd9b3('0x15')]();});}function createTable(_0x484910,_0x11c5e0){var _0xee9a9e={'widths':_[_0xd9b3('0x16')](Array(_0x484910[_0xd9b3('0x17')]),0x91),'heights':function(_0x49b9b8){return _0x49b9b8===0x0?_0xd9b3('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1ba301=getHeaders(_0x484910);_0xee9a9e['body'][_0xd9b3('0x19')](_0x1ba301);var _0x4d49c3=getRows(_0x484910,_0x11c5e0);_0xee9a9e[_0xd9b3('0x1a')]=_0xee9a9e['body'][_0xd9b3('0x1b')](_0x4d49c3);return _0xee9a9e;}function createTables(_0x5a344c){var _0x478956=[];var _0x1c6ff5=_[_0xd9b3('0x1c')](Object['keys'](_0x5a344c[0x0]),0x5);_0x1c6ff5[_0xd9b3('0x1d')](function(_0x48c483){_0x478956[_0xd9b3('0x19')](createTable(_0x48c483,_0x5a344c));});return _0x478956;}function getPDFDocDefinition(_0x57a06e){var _0x22bba8=util[_0xd9b3('0x1e')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xd9b3('0x1f')])[_0xd9b3('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0xd9b3('0x20')])['format'](FORMAT));var _0x5a5993=[];for(var _0x534b75=0x0;_0x534b75<_0x57a06e[_0xd9b3('0x17')];_0x534b75++){var _0x5d3bac=[];if(_0x534b75===0x0){_0x5d3bac[_0xd9b3('0x19')]({'text':_0x22bba8,'style':_0xd9b3('0x21')});}var _0x4a092a={'table':_0x57a06e[_0x534b75]};if(_0x534b75>0x0){_0x4a092a[_0xd9b3('0x22')]=_0xd9b3('0x23');_0x4a092a[_0xd9b3('0x24')]=[0x0,0x46,0x0,0x0];}_0x5d3bac[_0xd9b3('0x19')](_0x4a092a);_0x5a5993[_0xd9b3('0x19')](_0x5d3bac);}return{'pageSize':'A4','pageOrientation':_0xd9b3('0x25'),'content':_0x5a5993,'footer':function(_0x1cc655,_0x515aa9){return{'text':_0x1cc655[_0xd9b3('0x26')]()+_0xd9b3('0x27')+_0x515aa9,'style':_0xd9b3('0x28')};},'defaultStyle':{'font':_0xd9b3('0x29')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xd9b3('0x2a')},'footer':{'alignment':_0xd9b3('0x2b'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x14bb6f){var _0x52edee=0x1388;var _0x289cd4;if(!_0x14bb6f[0x0][_0xd9b3('0x2c')]){return analyticExtractedReport('Empty');}return db[_0xd9b3('0x2d')][_0xd9b3('0x2e')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd9b3('0x2f'),_0xd9b3('0x30')]})[_0xd9b3('0x31')](function(_0x43d4bd){if(_0x43d4bd){_0x289cd4=_0x43d4bd;_0x52edee=_0x289cd4['splitSizePdf']||0x3e8;}})['then'](function(){var _0x50052e=[];var _0x591cb8=0x0;if(_0x289cd4[_0xd9b3('0x2f')]){if(_0x14bb6f&&_0x14bb6f[_0xd9b3('0x17')]){var _0x3a9b77=_['range'](_0x14bb6f[0x0][_0xd9b3('0x2c')]/_0x52edee);var _0x8001d2=Number[_0xd9b3('0x32')](_0x14bb6f[0x0]['num']/_0x52edee)?_0x14bb6f[0x0][_0xd9b3('0x2c')]%_0x52edee:0x0;_0x3a9b77[_0xd9b3('0x1d')](function(_0x1d217b){if(_0x1d217b>0x0){_0x591cb8+=_0x52edee;}_0x50052e[_0xd9b3('0x19')](dbH['sequelize'][_0xd9b3('0x33')](util[_0xd9b3('0x1e')](_0xd9b3('0x34'),QUERY,_0x52edee,_0x591cb8),{'type':dbH['sequelize']['QueryTypes'][_0xd9b3('0x35')]}));});if(_0x8001d2>0x0){_0x591cb8+=_0x52edee;_0x50052e[_0xd9b3('0x19')](dbH['sequelize'][_0xd9b3('0x33')](util[_0xd9b3('0x1e')](_0xd9b3('0x34'),QUERY,_0x8001d2,_0x591cb8),{'type':dbH[_0xd9b3('0x36')][_0xd9b3('0x37')][_0xd9b3('0x35')]}));}}}else{_0x50052e[_0xd9b3('0x19')](dbH['sequelize'][_0xd9b3('0x33')](QUERY,{'type':dbH[_0xd9b3('0x36')][_0xd9b3('0x37')][_0xd9b3('0x35')]}));}var _0x5823d7=path[_0xd9b3('0x38')](PATH);var _0x358c64=path[_0xd9b3('0x39')](PATH,_0xd9b3('0x3a'));var _0xc0a316=_0x289cd4[_0xd9b3('0x2f')]&&_0x50052e[_0xd9b3('0x17')]>0x1;var _0x5d0b71=[];if(!fs[_0xd9b3('0x3b')](path[_0xd9b3('0x3c')](_0x5823d7,_0x358c64))&&_0xc0a316){fs['mkdirSync'](path[_0xd9b3('0x3c')](_0x5823d7,_0x358c64));}return BPromise[_0xd9b3('0x3d')](_0x50052e,function(_0x43eb7b){_0x5d0b71[_0xd9b3('0x19')](_0x43eb7b);})[_0xd9b3('0x31')](function(){var _0x441811=[];for(var _0x31942e=0x0;_0x31942e<_0x5d0b71[_0xd9b3('0x17')];_0x31942e+=0x1){var _0x5ece77=_0x5d0b71[_0x31942e];var _0x14dfa0=createTables(_[_0xd9b3('0x3e')](_0x5ece77));var _0x4817f7;var _0x2a4210=getPDFDocDefinition(_0x14dfa0);var _0x3b37e1=getPDFPrinter();var _0x54ed60=_0x3b37e1[_0xd9b3('0x3f')](_0x2a4210);if(_0xc0a316){_0x4817f7=path[_0xd9b3('0x3c')](_0x5823d7,_0x358c64,util['format'](_0xd9b3('0x40'),_0x358c64,_0x31942e,'pdf'));}else{_0x4817f7=path[_0xd9b3('0x3c')](_0x5823d7,util['format'](_0xd9b3('0x41'),_0x358c64,_0xd9b3('0x42')));}_0x441811[_0xd9b3('0x19')](writePDFDocument(_0x54ed60,_0x4817f7));}return Promise[_0xd9b3('0x43')](_0x441811);})[_0xd9b3('0x31')](function(){if(_0xc0a316){return new Promise(function(_0x2c61f1){zipdir(path[_0xd9b3('0x3c')](_0x5823d7,_0x358c64),{'saveTo':path[_0xd9b3('0x3c')](_0x5823d7,util[_0xd9b3('0x1e')](_0xd9b3('0x41'),_0x358c64,'zip'))},function(){rimraf(path['join'](_0x5823d7,_0x358c64),function(){});_0x2c61f1(_0xd9b3('0x44'));});});}})[_0xd9b3('0x31')](function(){if(!_0xc0a316)return;rimraf(path['join'](_0x5823d7,_0x358c64),function(){});})[_0xd9b3('0x31')](function(){logger[_0xd9b3('0x45')](util['format'](_0xd9b3('0x46'),EXTRACTED_REPORT_ID,_0xd9b3('0x47')));return analyticExtractedReport('Completed',_0xc0a316?util['format'](_0xd9b3('0x41'),_0x358c64,_0xc0a316?_0xd9b3('0x48'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xd9b3('0x45')](util[_0xd9b3('0x1e')](_0xd9b3('0x49'),EXTRACTED_REPORT_ID,_0xd9b3('0x47')));return db[_0xd9b3('0x11')][_0xd9b3('0x4a')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xd9b3('0x31')](function(_0x48ff8f){EXTRACTED_REPORT=_0x48ff8f;return dbH[_0xd9b3('0x36')][_0xd9b3('0x33')](util[_0xd9b3('0x1e')](_0xd9b3('0x4b'),QUERY),{'type':dbH[_0xd9b3('0x36')][_0xd9b3('0x37')][_0xd9b3('0x35')]});})[_0xd9b3('0x31')](extractReport)[_0xd9b3('0x4c')](function(_0x22b085){logger[_0xd9b3('0x45')](util['format'](_0xd9b3('0x4d'),EXTRACTED_REPORT_ID,_0xd9b3('0x47')),util[_0xd9b3('0x4e')](_0x22b085,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd9b3('0x4f'));})[_0xd9b3('0x50')](function(){process[_0xd9b3('0x51')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x32480f=new PdfPrinter({'Arial':{'normal':__dirname+_0xd9b3('0x52'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xd9b3('0x53'),'bolditalics':__dirname+_0xd9b3('0x54')}});return _0x32480f;}function getPDFDocDefinitionFromHTML(_0x5781e6,_0x764d8a){var _0x1dd7c0=util['format'](_0xd9b3('0x55'),_0x764d8a[_0xd9b3('0x56')],_0x764d8a[_0xd9b3('0x57')]);var _0x41bd42=moment()['format'](_0xd9b3('0x58'))[_0xd9b3('0x26')]();var _0xb4acc5=htmlToPdfmake(_0x5781e6,{'window':window,'tableAutoSize':!![]});return{'content':[_0xb4acc5],'defaultStyle':{'font':_0xd9b3('0x29')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xd9b3('0x59'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xd9b3('0x59'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xd9b3('0x59')}},'header':function(){return[{'text':_0xd9b3('0x5a'),'style':_0xd9b3('0x21')}];},'footer':function(_0x398141,_0x1f7b25){return[{'text':util[_0xd9b3('0x1e')](_0xd9b3('0x5b'),_0x1dd7c0,_0x398141,_0x1f7b25,_0x41bd42),'style':'footer'}];}};}function writePDFDocument(_0x423664,_0xe8c198){return new Promise(function(_0x5080f5,_0x44367e){var _0x5c3ebd=_0x423664[_0xd9b3('0x5c')](fs[_0xd9b3('0x5d')](_0xe8c198));_0x5c3ebd['on']('finish',function(){_0x5080f5(_0xd9b3('0x5e'));});_0x5c3ebd['on']('error',function(_0x186750){_0x44367e(_0x186750);});_0x423664['end']();});}exports[_0xd9b3('0x5f')]=function(_0x203048,_0x1ad1e5){var _0x6e100b=getPDFPrinter();var _0x3d9579=getPDFDocDefinitionFromHTML(_0x203048,_0x1ad1e5);var _0x2b7f57=_0x6e100b[_0xd9b3('0x3f')](_0x3d9579);return writePDFDocument(_0x2b7f57,_0x1ad1e5['path'])[_0xd9b3('0x4c')](function(_0x4c5844){throw _0x4c5844;});};
\ No newline at end of file
index 53b4956..ef2d4c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x311e=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','query','dirname','basename','existsSync','join','mkdirSync','then','xlsx','%s.%s','binary','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','path','lodash','json2xls','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','sequelize','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x311e,0x17d));var _0xe311=function(_0x43d1cb,_0x3a7797){_0x43d1cb=_0x43d1cb-0x0;var _0x457711=_0x311e[_0x43d1cb];return _0x457711;};'use strict';var util=require('util');var path=require(_0xe311('0x0'));var _=require(_0xe311('0x1'));var fs=require('fs');var json2xls=require(_0xe311('0x2'));var BPromise=require('bluebird');var zipdir=require(_0xe311('0x3'));var rimraf=require(_0xe311('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0xe311('0x5'))[_0xe311('0x6')];var logger=require(_0xe311('0x7'))(_0xe311('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xe311('0x9')][0x2]);var QUERY=process[_0xe311('0x9')][0x3];var PATH=process[_0xe311('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xf0ecf6,_0x53a386){var _0x172690={'status':_0xf0ecf6};var _0x4512ce={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x53a386){_0x172690[_0xe311('0xa')]=_0x53a386;}return db['AnalyticExtractedReport'][_0xe311('0xb')](_0x172690,_0x4512ce);}function main(){var _0x429d98=0x1388;var _0x1273f5;logger['info'](util['format'](_0xe311('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xe311('0xd')][_0xe311('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe311('0xf'),'splitSizeXlsx']})['then'](function(_0x23dbe2){if(_0x23dbe2){_0x1273f5=_0x23dbe2;_0x429d98=_0x1273f5[_0xe311('0x10')]||0x1388;}})['then'](function(){return dbH[_0xe311('0x11')]['query'](util[_0xe311('0x12')](_0xe311('0x13'),QUERY),{'type':dbH['sequelize'][_0xe311('0x14')][_0xe311('0x15')]});})['then'](function(_0xaab8c4){if(!_0xaab8c4[0x0][_0xe311('0x16')]){return analyticExtractedReport(_0xe311('0x17'));}var _0x199e57=[];var _0xe1edfe=0x0;if(_0x1273f5[_0xe311('0xf')]){if(_0xaab8c4&&_0xaab8c4[_0xe311('0x18')]){var _0x5a1250=_['range'](_0xaab8c4[0x0][_0xe311('0x16')]/_0x429d98);var _0x9dcd03=Number[_0xe311('0x19')](_0xaab8c4[0x0][_0xe311('0x16')]/_0x429d98)?_0xaab8c4[0x0]['num']%_0x429d98:0x0;_0x5a1250[_0xe311('0x1a')](function(_0x39d1ef){if(_0x39d1ef>0x0){_0xe1edfe+=_0x429d98;}_0x199e57[_0xe311('0x1b')](dbH[_0xe311('0x11')]['query'](util[_0xe311('0x12')](_0xe311('0x1c'),QUERY,_0x429d98,_0xe1edfe),{'type':dbH[_0xe311('0x11')][_0xe311('0x14')][_0xe311('0x15')]}));});if(_0x9dcd03>0x0){_0xe1edfe+=_0x429d98;_0x199e57[_0xe311('0x1b')](dbH[_0xe311('0x11')]['query'](util[_0xe311('0x12')](_0xe311('0x1c'),QUERY,_0x9dcd03,_0xe1edfe),{'type':dbH[_0xe311('0x11')][_0xe311('0x14')][_0xe311('0x15')]}));}}}else{_0x199e57['push'](dbH[_0xe311('0x11')][_0xe311('0x1d')](QUERY,{'type':dbH[_0xe311('0x11')][_0xe311('0x14')][_0xe311('0x15')]}));}var _0x408bd6=path[_0xe311('0x1e')](PATH);var _0x4d1745=path[_0xe311('0x1f')](PATH,'.xlsx');var _0x1d3e40=_0x1273f5['split']&&_0x199e57[_0xe311('0x18')]>0x1;var _0x20c227=[];if(!fs[_0xe311('0x20')](path[_0xe311('0x21')](_0x408bd6,_0x4d1745))&&_0x1d3e40){fs[_0xe311('0x22')](path[_0xe311('0x21')](_0x408bd6,_0x4d1745));}return BPromise['each'](_0x199e57,function(_0x157424){_0x20c227[_0xe311('0x1b')](_0x157424);})[_0xe311('0x23')](function(){for(var _0x4447a1=0x0;_0x4447a1<_0x20c227[_0xe311('0x18')];_0x4447a1+=0x1){var _0x21fe81;var _0x30d1cb=_0x20c227[_0x4447a1];if(_0x1d3e40){_0x21fe81=path['join'](_0x408bd6,_0x4d1745,util['format']('%s%d.%s',_0x4d1745,_0x4447a1,_0xe311('0x24')));}else{_0x21fe81=path['join'](_0x408bd6,util[_0xe311('0x12')](_0xe311('0x25'),_0x4d1745,_0xe311('0x24')));}fs['writeFileSync'](_0x21fe81,json2xls(_0x30d1cb),_0xe311('0x26'));}})[_0xe311('0x23')](function(){if(_0x1d3e40){return new Promise(function(_0x5c7dba){zipdir(path[_0xe311('0x21')](_0x408bd6,_0x4d1745),{'saveTo':path[_0xe311('0x21')](_0x408bd6,util['format'](_0xe311('0x25'),_0x4d1745,_0xe311('0x27')))},function(_0x1fd9bb,_0x30a089){rimraf(path[_0xe311('0x21')](_0x408bd6,_0x4d1745),function(){});_0x5c7dba(_0xe311('0x28'));});});}})['then'](function(){logger[_0xe311('0x29')](util['format'](_0xe311('0x2a'),EXTRACTED_REPORT_ID,_0xe311('0x2b')));return analyticExtractedReport(_0xe311('0x2c'),_0x1d3e40?util[_0xe311('0x12')](_0xe311('0x25'),_0x4d1745,_0x1d3e40?_0xe311('0x27'):_0xe311('0x24')):null);});})['catch'](function(_0x4b5ebc){logger[_0xe311('0x29')](util[_0xe311('0x12')](_0xe311('0x2d'),EXTRACTED_REPORT_ID,'XLSX'),util[_0xe311('0x2e')](_0x4b5ebc,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe311('0x2f'));})[_0xe311('0x30')](function(){process[_0xe311('0x31')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xe3bb=['bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','range','isInteger','push','dirname','existsSync','mkdirSync','join','%s%d.%s','binary','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','json2xls'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xe3bb,0x1c8));var _0xbe3b=function(_0xec74fe,_0x2dce88){_0xec74fe=_0xec74fe-0x0;var _0x50bda2=_0xe3bb[_0xec74fe];return _0x50bda2;};'use strict';var util=require(_0xbe3b('0x0'));var path=require(_0xbe3b('0x1'));var _=require(_0xbe3b('0x2'));var fs=require('fs');var json2xls=require(_0xbe3b('0x3'));var BPromise=require(_0xbe3b('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xbe3b('0x5'));var db=require(_0xbe3b('0x6'))['db'];var dbH=require(_0xbe3b('0x6'))[_0xbe3b('0x7')];var logger=require(_0xbe3b('0x8'))(_0xbe3b('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xbe3b('0xa')][0x3];var PATH=process[_0xbe3b('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x577b78,_0xb3865d){var _0x2d4c37={'status':_0x577b78};var _0x28651e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xb3865d){_0x2d4c37[_0xbe3b('0xb')]=_0xb3865d;}return db[_0xbe3b('0xc')]['update'](_0x2d4c37,_0x28651e);}function main(){var _0xa980c5=0x1388;var _0x2b2ed2;logger[_0xbe3b('0xd')](util[_0xbe3b('0xe')](_0xbe3b('0xf'),EXTRACTED_REPORT_ID,_0xbe3b('0x10')));return db[_0xbe3b('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbe3b('0x12'),_0xbe3b('0x13')]})[_0xbe3b('0x14')](function(_0x1023d3){if(_0x1023d3){_0x2b2ed2=_0x1023d3;_0xa980c5=_0x2b2ed2['splitSizeXlsx']||0x1388;}})[_0xbe3b('0x14')](function(){return dbH[_0xbe3b('0x15')][_0xbe3b('0x16')](util[_0xbe3b('0xe')](_0xbe3b('0x17'),QUERY),{'type':dbH['sequelize'][_0xbe3b('0x18')][_0xbe3b('0x19')]});})[_0xbe3b('0x14')](function(_0x2d268e){if(!_0x2d268e[0x0][_0xbe3b('0x1a')]){return analyticExtractedReport('Empty');}var _0x4498ce=[];var _0x226ec2=0x0;if(_0x2b2ed2['split']){if(_0x2d268e&&_0x2d268e[_0xbe3b('0x1b')]){var _0x8a9957=_[_0xbe3b('0x1c')](_0x2d268e[0x0]['num']/_0xa980c5);var _0x3383f4=Number[_0xbe3b('0x1d')](_0x2d268e[0x0][_0xbe3b('0x1a')]/_0xa980c5)?_0x2d268e[0x0][_0xbe3b('0x1a')]%_0xa980c5:0x0;_0x8a9957['forEach'](function(_0x83c6a0){if(_0x83c6a0>0x0){_0x226ec2+=_0xa980c5;}_0x4498ce[_0xbe3b('0x1e')](dbH[_0xbe3b('0x15')][_0xbe3b('0x16')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xa980c5,_0x226ec2),{'type':dbH[_0xbe3b('0x15')][_0xbe3b('0x18')]['SELECT']}));});if(_0x3383f4>0x0){_0x226ec2+=_0xa980c5;_0x4498ce['push'](dbH[_0xbe3b('0x15')][_0xbe3b('0x16')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3383f4,_0x226ec2),{'type':dbH[_0xbe3b('0x15')][_0xbe3b('0x18')]['SELECT']}));}}}else{_0x4498ce[_0xbe3b('0x1e')](dbH['sequelize'][_0xbe3b('0x16')](QUERY,{'type':dbH[_0xbe3b('0x15')]['QueryTypes']['SELECT']}));}var _0x8b6cf0=path[_0xbe3b('0x1f')](PATH);var _0x3d81c3=path['basename'](PATH,'.xlsx');var _0x11b4fe=_0x2b2ed2[_0xbe3b('0x12')]&&_0x4498ce[_0xbe3b('0x1b')]>0x1;var _0x408e82=[];if(!fs[_0xbe3b('0x20')](path['join'](_0x8b6cf0,_0x3d81c3))&&_0x11b4fe){fs[_0xbe3b('0x21')](path[_0xbe3b('0x22')](_0x8b6cf0,_0x3d81c3));}return BPromise['each'](_0x4498ce,function(_0x32c2b3){_0x408e82[_0xbe3b('0x1e')](_0x32c2b3);})['then'](function(){for(var _0x1d068d=0x0;_0x1d068d<_0x408e82[_0xbe3b('0x1b')];_0x1d068d+=0x1){var _0x5a9405;var _0x42449c=_0x408e82[_0x1d068d];if(_0x11b4fe){_0x5a9405=path[_0xbe3b('0x22')](_0x8b6cf0,_0x3d81c3,util[_0xbe3b('0xe')](_0xbe3b('0x23'),_0x3d81c3,_0x1d068d,'xlsx'));}else{_0x5a9405=path['join'](_0x8b6cf0,util[_0xbe3b('0xe')]('%s.%s',_0x3d81c3,'xlsx'));}fs['writeFileSync'](_0x5a9405,json2xls(_0x42449c),_0xbe3b('0x24'));}})[_0xbe3b('0x14')](function(){if(_0x11b4fe){return new Promise(function(_0x1d8a69){zipdir(path['join'](_0x8b6cf0,_0x3d81c3),{'saveTo':path['join'](_0x8b6cf0,util['format'](_0xbe3b('0x25'),_0x3d81c3,'zip'))},function(_0x12ee28,_0x4f98bc){rimraf(path[_0xbe3b('0x22')](_0x8b6cf0,_0x3d81c3),function(){});_0x1d8a69('zip\x20finished');});});}})[_0xbe3b('0x14')](function(){logger[_0xbe3b('0xd')](util[_0xbe3b('0xe')](_0xbe3b('0x26'),EXTRACTED_REPORT_ID,_0xbe3b('0x10')));return analyticExtractedReport('Completed',_0x11b4fe?util[_0xbe3b('0xe')]('%s.%s',_0x3d81c3,_0x11b4fe?_0xbe3b('0x27'):'xlsx'):null);});})[_0xbe3b('0x28')](function(_0x553c60){logger['info'](util[_0xbe3b('0xe')](_0xbe3b('0x29'),EXTRACTED_REPORT_ID,_0xbe3b('0x10')),util[_0xbe3b('0x2a')](_0x553c60,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbe3b('0x2b'));})[_0xbe3b('0x2c')](function(){process[_0xbe3b('0x2d')](EXIT_CODE);});}main();
\ No newline at end of file
index f94cc78..ba98794 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec18=['splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','models','Interval','then','intervals','VoiceExtension','findAll','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','playback','priority','extensions','extension','find','push','type','CDR(type)=%s','context','inbound','CDR(routeid)=','VoiceExtensionId','outbound','Set','CDR(destination)=','cutdigits','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-PROGRESS=0','length','createdAt','updatedAt','*,*,*,*','interval','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1'];(function(_0x19d0b6,_0x85209a){var _0x16060b=function(_0x33d5d3){while(--_0x33d5d3){_0x19d0b6['push'](_0x19d0b6['shift']());}};_0x16060b(++_0x85209a);}(_0xec18,0xdb));var _0x8ec1=function(_0x5c4a9a,_0x50973c){_0x5c4a9a=_0x5c4a9a-0x0;var _0x295ee0=_0xec18[_0x5c4a9a];return _0x295ee0;};'use strict';var _=require(_0x8ec1('0x0'));var util=require('util');function rewrite(_0x3b24fa,_0x557c4b){var _0x36343e=this;return _0x3b24fa[_0x8ec1('0x1')][_0x8ec1('0x2')]['findAll']({'raw':!![]})[_0x8ec1('0x3')](function(_0x4ee5c4){_0x36343e[_0x8ec1('0x4')]=_0x4ee5c4;return _0x3b24fa['models'][_0x8ec1('0x5')][_0x8ec1('0x6')]({'where':{'IntervalId':_0x557c4b[_0x8ec1('0x7')]},'raw':!![]});})[_0x8ec1('0x3')](function(_0x350f89){return _0x3b24fa['models'][_0x8ec1('0x5')][_0x8ec1('0x6')]({'where':{'exten':{'$in':_[_0x8ec1('0x8')](_[_0x8ec1('0x9')](_0x350f89,_0x8ec1('0xa')))}},'order':[{'raw':_0x8ec1('0xb')}],'raw':!![]});})[_0x8ec1('0x3')](function(_0x3e796d){var _0x5574ba=_[_0x8ec1('0xc')](_0x3e796d,{'priority':'1'});var _0x3ea0b0=_['filter'](_0x3e796d,{'isApp':0x1});var _0x27364e=_['groupBy'](_0x3ea0b0,_0x8ec1('0xa'));var _0x4df9fd=['queue',_0x8ec1('0xd')];var _0x31828e=[];var _0x14e02b=[];for(var _0x1de84c in _0x27364e){if(_0x27364e['hasOwnProperty'](_0x1de84c)){_0x36343e[_0x8ec1('0xe')]=0x2;_0x36343e[_0x8ec1('0xf')]=[];_0x36343e[_0x8ec1('0x10')]=_[_0x8ec1('0x11')](_0x5574ba,{'exten':_0x27364e[_0x1de84c][0x0]['exten']});_0x36343e[_0x8ec1('0xf')][_0x8ec1('0x12')]({'type':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x13')],'app':'Set','appdata':util['format'](_0x8ec1('0x14'),_0x27364e[_0x1de84c][0x0][_0x8ec1('0x13')]),'context':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x15')],'exten':_0x27364e[_0x1de84c][0x0]['exten'],'priority':_0x36343e[_0x8ec1('0xe')]++,'VoiceExtensionId':_0x27364e[_0x1de84c][0x0]['VoiceExtensionId']});if(_0x27364e[_0x1de84c][0x0][_0x8ec1('0x13')]===_0x8ec1('0x16')){_0x36343e[_0x8ec1('0xf')]['push']({'type':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x13')],'app':'Set','appdata':_0x8ec1('0x17')+_0x27364e[_0x1de84c][0x0][_0x8ec1('0x18')],'context':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x15')],'exten':_0x27364e[_0x1de84c][0x0][_0x8ec1('0xa')],'priority':_0x36343e['priority']++,'VoiceExtensionId':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x18')]});}else if(_0x27364e[_0x1de84c][0x0][_0x8ec1('0x13')]===_0x8ec1('0x19')){if(_0x36343e[_0x8ec1('0x10')]){_0x36343e[_0x8ec1('0xf')]['push']({'type':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x13')],'app':_0x8ec1('0x1a'),'appdata':_0x8ec1('0x1b')+(_0x36343e[_0x8ec1('0x10')]['cutdigits']?'${EXTEN:'+_0x36343e[_0x8ec1('0x10')][_0x8ec1('0x1c')]+'}':'${EXTEN}'),'context':_0x27364e[_0x1de84c][0x0]['context'],'exten':_0x27364e[_0x1de84c][0x0][_0x8ec1('0xa')],'priority':_0x36343e[_0x8ec1('0xe')]++,'VoiceExtensionId':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x18')]});}_0x36343e[_0x8ec1('0xf')][_0x8ec1('0x12')]({'type':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x13')],'app':_0x8ec1('0x1a'),'appdata':_0x8ec1('0x17')+_0x27364e[_0x1de84c][0x0]['VoiceExtensionId'],'context':_0x27364e[_0x1de84c][0x0]['context'],'exten':_0x27364e[_0x1de84c][0x0][_0x8ec1('0xa')],'priority':_0x36343e['priority']++,'VoiceExtensionId':_0x27364e[_0x1de84c][0x0]['VoiceExtensionId']});var _0x1c7460=_0x36343e['priority']++;_0x36343e[_0x8ec1('0xf')][_0x8ec1('0x12')]({'type':_0x27364e[_0x1de84c][0x0]['type'],'app':'ExecIf','appdata':_0x8ec1('0x1d')+(_0x1c7460+0x2)+_0x8ec1('0x1e')+(_0x1c7460+0x1)+')','context':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x15')],'exten':_0x27364e[_0x1de84c][0x0][_0x8ec1('0xa')],'priority':_0x1c7460,'VoiceExtensionId':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x18')]});if(_0x36343e[_0x8ec1('0x10')]){_0x36343e[_0x8ec1('0xf')][_0x8ec1('0x12')]({'type':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x13')],'app':'Set','appdata':_0x36343e[_0x8ec1('0x10')]['cutdigits']?_0x8ec1('0x1f')+_0x36343e[_0x8ec1('0x10')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x15')],'exten':_0x27364e[_0x1de84c][0x0][_0x8ec1('0xa')],'priority':_0x36343e[_0x8ec1('0xe')]++,'VoiceExtensionId':_0x27364e[_0x1de84c][0x0]['VoiceExtensionId']});}_0x36343e[_0x8ec1('0xf')][_0x8ec1('0x12')]({'type':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x13')],'app':_0x8ec1('0x1a'),'appdata':_0x8ec1('0x20')+_0x27364e[_0x1de84c][0x0][_0x8ec1('0x18')],'context':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x15')],'exten':_0x27364e[_0x1de84c][0x0][_0x8ec1('0xa')],'priority':_0x36343e[_0x8ec1('0xe')]++,'VoiceExtensionId':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x18')]});if(_0x36343e['extension']&&_0x36343e['extension'][_0x8ec1('0x21')](_0x8ec1('0x22'))&&_0x36343e['extension'][_0x8ec1('0x22')]!==_0x8ec1('0x23')){_0x36343e[_0x8ec1('0xf')]['push']({'type':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x13')],'app':_0x8ec1('0x1a'),'appdata':_0x8ec1('0x24'),'context':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x15')],'exten':_0x27364e[_0x1de84c][0x0][_0x8ec1('0xa')],'priority':_0x36343e['priority']++,'VoiceExtensionId':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x18')]});_0x36343e[_0x8ec1('0xf')]['push']({'type':_0x27364e[_0x1de84c][0x0]['type'],'app':_0x8ec1('0x1a'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x36343e[_0x8ec1('0x10')][_0x8ec1('0x22')]||_0x8ec1('0x25'),'context':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x15')],'exten':_0x27364e[_0x1de84c][0x0][_0x8ec1('0xa')],'priority':_0x36343e[_0x8ec1('0xe')]++,'VoiceExtensionId':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x18')]});}}_0x36343e[_0x8ec1('0xf')][_0x8ec1('0x12')]({'type':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x13')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x15')],'exten':_0x27364e[_0x1de84c][0x0]['exten'],'priority':_0x36343e[_0x8ec1('0xe')]++,'VoiceExtensionId':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x18')]});_0x36343e[_0x8ec1('0xf')][_0x8ec1('0x12')]({'type':_0x27364e[_0x1de84c][0x0]['type'],'app':'Set','appdata':_0x8ec1('0x26'),'context':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x15')],'exten':_0x27364e[_0x1de84c][0x0]['exten'],'priority':_0x36343e[_0x8ec1('0xe')]++,'VoiceExtensionId':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x18')]});_0x36343e[_0x8ec1('0xf')][_0x8ec1('0x12')]({'type':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x13')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x27364e[_0x1de84c][0x0]['context'],'exten':_0x27364e[_0x1de84c][0x0][_0x8ec1('0xa')],'priority':_0x36343e['priority']++,'VoiceExtensionId':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x18')]});for(var _0x170811=0x0,_0x4957df=0x0;_0x170811<_0x27364e[_0x1de84c][_0x8ec1('0x27')];_0x170811+=0x1,_0x4957df=0x0){var _0x3478c7=_0x27364e[_0x1de84c][_0x170811];if(_0x3478c7[_0x8ec1('0x13')]){_0x3478c7['type']=_0x3478c7[_0x8ec1('0x13')]['toLowerCase']();}var _0x8e27d2=[];var _0x3f8d21=[];delete _0x3478c7['id'];delete _0x3478c7[_0x8ec1('0x28')];delete _0x3478c7[_0x8ec1('0x29')];var _0x4aedd0=_0x3478c7['interval']!==_0x8ec1('0x2a')?[_0x3478c7[_0x8ec1('0x2b')]]:_0x3478c7[_0x8ec1('0x7')]?_[_0x8ec1('0x9')](_[_0x8ec1('0xc')](_0x36343e['intervals'],{'IntervalId':_0x3478c7[_0x8ec1('0x7')]}),_0x8ec1('0x2b')):[];if(_0x3478c7['hasOwnProperty'](_0x8ec1('0x2c'))){if(_0x3478c7[_0x8ec1('0x2c')]&&_0x3478c7[_0x8ec1('0x2c')]!=='--'){_0x8e27d2[_0x8ec1('0x12')]({'type':_0x3478c7['type'],'app':_0x8ec1('0x1a'),'appdata':_0x8ec1('0x2d')+_0x3478c7['tag'],'context':_0x3478c7['context'],'exten':_0x3478c7[_0x8ec1('0xa')],'priority':_0x4aedd0[_0x8ec1('0x27')]+_0x36343e['priority']+_0x4957df++,'VoiceExtensionId':_0x3478c7[_0x8ec1('0x18')]});}}if(_0x3478c7['type']===_0x8ec1('0x19')&&_0x3478c7[_0x8ec1('0x21')](_0x8ec1('0x2e'))){if(_0x3478c7[_0x8ec1('0x2e')]){_0x8e27d2[_0x8ec1('0x12')]({'type':_0x3478c7[_0x8ec1('0x13')],'app':_0x8ec1('0x2f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x3478c7['callerID']+')','context':_0x3478c7['context'],'exten':_0x3478c7['exten'],'priority':_0x4aedd0[_0x8ec1('0x27')]+_0x36343e[_0x8ec1('0xe')]+_0x4957df++,'VoiceExtensionId':_0x3478c7[_0x8ec1('0x18')]});}else{_0x8e27d2['push']({'type':_0x3478c7[_0x8ec1('0x13')],'app':'ExecIf','appdata':_0x8ec1('0x30'),'context':_0x3478c7[_0x8ec1('0x15')],'exten':_0x3478c7[_0x8ec1('0xa')],'priority':_0x4aedd0[_0x8ec1('0x27')]+_0x36343e[_0x8ec1('0xe')]+_0x4957df++,'VoiceExtensionId':_0x3478c7['VoiceExtensionId']});}}if(_0x3478c7['hasOwnProperty'](_0x8ec1('0x31'))){if(_0x4df9fd[_0x8ec1('0x32')](_0x3478c7[_0x8ec1('0x33')]['toLowerCase']())>=0x0&&_0x3478c7[_0x8ec1('0x34')]!==_0x8ec1('0x35')){if(_0x3478c7['answer']){_0x8e27d2[_0x8ec1('0x12')]({'type':_0x3478c7['type'],'app':'ExecIf','appdata':_0x8ec1('0x36'),'context':_0x3478c7['context'],'exten':_0x3478c7['exten'],'priority':_0x4aedd0[_0x8ec1('0x27')]+_0x36343e[_0x8ec1('0xe')]+_0x4957df++,'VoiceExtensionId':_0x3478c7[_0x8ec1('0x18')]});_0x8e27d2['push']({'type':_0x3478c7[_0x8ec1('0x13')],'app':_0x8ec1('0x1a'),'appdata':_0x8ec1('0x37'),'context':_0x3478c7[_0x8ec1('0x15')],'exten':_0x3478c7['exten'],'priority':_0x4aedd0[_0x8ec1('0x27')]+_0x36343e['priority']+_0x4957df++,'VoiceExtensionId':_0x3478c7[_0x8ec1('0x18')]});}else{_0x8e27d2[_0x8ec1('0x12')]({'type':_0x3478c7[_0x8ec1('0x13')],'app':_0x8ec1('0x2f'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3478c7[_0x8ec1('0x15')],'exten':_0x3478c7[_0x8ec1('0xa')],'priority':_0x4aedd0[_0x8ec1('0x27')]+_0x36343e['priority']+_0x4957df++,'VoiceExtensionId':_0x3478c7[_0x8ec1('0x18')]});_0x8e27d2['push']({'type':_0x3478c7[_0x8ec1('0x13')],'app':_0x8ec1('0x1a'),'appdata':_0x8ec1('0x38'),'context':_0x3478c7['context'],'exten':_0x3478c7[_0x8ec1('0xa')],'priority':_0x4aedd0[_0x8ec1('0x27')]+_0x36343e[_0x8ec1('0xe')]+_0x4957df++,'VoiceExtensionId':_0x3478c7[_0x8ec1('0x18')]});}}}for(var _0x1d385c=0x0;_0x1d385c<_0x4aedd0[_0x8ec1('0x27')];_0x1d385c+=0x1){var _0x19613d=_0x36343e[_0x8ec1('0xe')]+_0x4aedd0[_0x8ec1('0x27')];var _0x1ddfe9=_0x1d385c===_0x4aedd0[_0x8ec1('0x27')]-0x1?_0x36343e[_0x8ec1('0xe')]+_0x8e27d2[_0x8ec1('0x27')]+_0x3f8d21[_0x8ec1('0x27')]+0x2:_0x36343e[_0x8ec1('0xe')]+_0x1d385c+0x1;_0x8e27d2[_0x8ec1('0x39')](_0x1d385c,0x0,{'type':_0x3478c7[_0x8ec1('0x13')],'app':'GotoIfTime','appdata':_0x4aedd0[_0x1d385c]+'?'+_0x3478c7[_0x8ec1('0x15')]+',${EXTEN},'+_0x19613d+':'+_0x3478c7[_0x8ec1('0x15')]+_0x8ec1('0x3a')+_0x1ddfe9,'exten':_0x3478c7[_0x8ec1('0xa')],'context':_0x3478c7[_0x8ec1('0x15')],'priority':_0x36343e[_0x8ec1('0xe')]+_0x1d385c,'VoiceExtensionId':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x18')]});}_0x3478c7[_0x8ec1('0xe')]=_0x8e27d2[_0x8ec1('0x27')]?_[_0x8ec1('0x3b')](_0x8e27d2)[_0x8ec1('0xe')]+0x1:_0x36343e[_0x8ec1('0xe')];_0x36343e[_0x8ec1('0xe')]=(_0x3f8d21[_0x8ec1('0x27')]?_[_0x8ec1('0x3b')](_0x3f8d21)[_0x8ec1('0xe')]:_0x3478c7[_0x8ec1('0xe')])+0x1;_0x36343e[_0x8ec1('0xf')]=_[_0x8ec1('0x3c')](_0x36343e['extensions'],_0x8e27d2,[_0x3478c7],_0x3f8d21);}_0x36343e[_0x8ec1('0xf')][_0x8ec1('0x12')]({'type':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x13')],'app':_0x8ec1('0x3d'),'exten':_0x27364e[_0x1de84c][0x0]['exten'],'context':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x15')],'priority':_0x36343e[_0x8ec1('0xe')],'VoiceExtensionId':_0x27364e[_0x1de84c][0x0][_0x8ec1('0x18')]});_0x31828e[_0x8ec1('0x12')](_0x27364e[_0x1de84c][0x0][_0x8ec1('0x18')]);_0x14e02b=_[_0x8ec1('0x3c')](_0x14e02b,_0x36343e[_0x8ec1('0xf')]);}}return _0x3b24fa[_0x8ec1('0x3e')](function(_0x280d66){return _0x3b24fa['models'][_0x8ec1('0x5')][_0x8ec1('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x31828e}},'transaction':_0x280d66})[_0x8ec1('0x3')](function(_0x54423f){return _0x3b24fa[_0x8ec1('0x1')][_0x8ec1('0x5')][_0x8ec1('0x40')](_[_0x8ec1('0x41')](_0x14e02b,_0x8ec1('0xe')),{'transaction':_0x280d66});});});})[_0x8ec1('0x42')](function(_0x27e1aa){console[_0x8ec1('0x43')](_0x27e1aa);});}exports[_0x8ec1('0x44')]=rewrite;
\ No newline at end of file
+var _0x9438=['push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','createdAt','updatedAt','interval','*,*,*,*','intervals','tag','CDR(tag)=','hasOwnProperty','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','transaction','destroy','bulkCreate','error','rewrite','lodash','models','Interval','findAll','then','VoiceExtension','IntervalId','uniq','map','groupBy','exten','priority','extensions','extension','find'];(function(_0x213a44,_0x3a9c9c){var _0x14851d=function(_0x5de465){while(--_0x5de465){_0x213a44['push'](_0x213a44['shift']());}};_0x14851d(++_0x3a9c9c);}(_0x9438,0x1aa));var _0x8943=function(_0x522d04,_0x4eb44e){_0x522d04=_0x522d04-0x0;var _0x2b5c31=_0x9438[_0x522d04];return _0x2b5c31;};'use strict';var _=require(_0x8943('0x0'));var util=require('util');function rewrite(_0x190cb6,_0x4781cb){var _0xc096f7=this;return _0x190cb6[_0x8943('0x1')][_0x8943('0x2')][_0x8943('0x3')]({'raw':!![]})[_0x8943('0x4')](function(_0x1d1847){_0xc096f7['intervals']=_0x1d1847;return _0x190cb6[_0x8943('0x1')][_0x8943('0x5')][_0x8943('0x3')]({'where':{'IntervalId':_0x4781cb[_0x8943('0x6')]},'raw':!![]});})[_0x8943('0x4')](function(_0x47966b){return _0x190cb6[_0x8943('0x1')][_0x8943('0x5')][_0x8943('0x3')]({'where':{'exten':{'$in':_[_0x8943('0x7')](_[_0x8943('0x8')](_0x47966b,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x8943('0x4')](function(_0x165320){var _0x5ce0e9=_['filter'](_0x165320,{'priority':'1'});var _0x39bcc1=_['filter'](_0x165320,{'isApp':0x1});var _0x26192a=_[_0x8943('0x9')](_0x39bcc1,_0x8943('0xa'));var _0x5936ab=['queue','playback'];var _0x1ccf23=[];var _0x4834a9=[];for(var _0x405071 in _0x26192a){if(_0x26192a['hasOwnProperty'](_0x405071)){_0xc096f7[_0x8943('0xb')]=0x2;_0xc096f7[_0x8943('0xc')]=[];_0xc096f7[_0x8943('0xd')]=_[_0x8943('0xe')](_0x5ce0e9,{'exten':_0x26192a[_0x405071][0x0][_0x8943('0xa')]});_0xc096f7[_0x8943('0xc')][_0x8943('0xf')]({'type':_0x26192a[_0x405071][0x0][_0x8943('0x10')],'app':_0x8943('0x11'),'appdata':util[_0x8943('0x12')](_0x8943('0x13'),_0x26192a[_0x405071][0x0][_0x8943('0x10')]),'context':_0x26192a[_0x405071][0x0][_0x8943('0x14')],'exten':_0x26192a[_0x405071][0x0]['exten'],'priority':_0xc096f7[_0x8943('0xb')]++,'VoiceExtensionId':_0x26192a[_0x405071][0x0][_0x8943('0x15')]});if(_0x26192a[_0x405071][0x0][_0x8943('0x10')]==='inbound'){_0xc096f7[_0x8943('0xc')]['push']({'type':_0x26192a[_0x405071][0x0][_0x8943('0x10')],'app':_0x8943('0x11'),'appdata':_0x8943('0x16')+_0x26192a[_0x405071][0x0][_0x8943('0x15')],'context':_0x26192a[_0x405071][0x0][_0x8943('0x14')],'exten':_0x26192a[_0x405071][0x0][_0x8943('0xa')],'priority':_0xc096f7[_0x8943('0xb')]++,'VoiceExtensionId':_0x26192a[_0x405071][0x0][_0x8943('0x15')]});}else if(_0x26192a[_0x405071][0x0][_0x8943('0x10')]===_0x8943('0x17')){if(_0xc096f7[_0x8943('0xd')]){_0xc096f7[_0x8943('0xc')][_0x8943('0xf')]({'type':_0x26192a[_0x405071][0x0][_0x8943('0x10')],'app':_0x8943('0x11'),'appdata':_0x8943('0x18')+(_0xc096f7[_0x8943('0xd')][_0x8943('0x19')]?_0x8943('0x1a')+_0xc096f7[_0x8943('0xd')][_0x8943('0x19')]+'}':_0x8943('0x1b')),'context':_0x26192a[_0x405071][0x0][_0x8943('0x14')],'exten':_0x26192a[_0x405071][0x0][_0x8943('0xa')],'priority':_0xc096f7[_0x8943('0xb')]++,'VoiceExtensionId':_0x26192a[_0x405071][0x0][_0x8943('0x15')]});}_0xc096f7[_0x8943('0xc')]['push']({'type':_0x26192a[_0x405071][0x0][_0x8943('0x10')],'app':'Set','appdata':_0x8943('0x16')+_0x26192a[_0x405071][0x0][_0x8943('0x15')],'context':_0x26192a[_0x405071][0x0][_0x8943('0x14')],'exten':_0x26192a[_0x405071][0x0][_0x8943('0xa')],'priority':_0xc096f7[_0x8943('0xb')]++,'VoiceExtensionId':_0x26192a[_0x405071][0x0][_0x8943('0x15')]});var _0x34343c=_0xc096f7['priority']++;_0xc096f7[_0x8943('0xc')][_0x8943('0xf')]({'type':_0x26192a[_0x405071][0x0][_0x8943('0x10')],'app':_0x8943('0x1c'),'appdata':_0x8943('0x1d')+(_0x34343c+0x2)+_0x8943('0x1e')+(_0x34343c+0x1)+')','context':_0x26192a[_0x405071][0x0]['context'],'exten':_0x26192a[_0x405071][0x0][_0x8943('0xa')],'priority':_0x34343c,'VoiceExtensionId':_0x26192a[_0x405071][0x0]['VoiceExtensionId']});if(_0xc096f7[_0x8943('0xd')]){_0xc096f7[_0x8943('0xc')]['push']({'type':_0x26192a[_0x405071][0x0][_0x8943('0x10')],'app':_0x8943('0x11'),'appdata':_0xc096f7[_0x8943('0xd')]['cutdigits']?_0x8943('0x1f')+_0xc096f7[_0x8943('0xd')][_0x8943('0x19')]+'}':'CDR(prefix)=noprefix','context':_0x26192a[_0x405071][0x0]['context'],'exten':_0x26192a[_0x405071][0x0][_0x8943('0xa')],'priority':_0xc096f7[_0x8943('0xb')]++,'VoiceExtensionId':_0x26192a[_0x405071][0x0]['VoiceExtensionId']});}_0xc096f7['extensions'][_0x8943('0xf')]({'type':_0x26192a[_0x405071][0x0][_0x8943('0x10')],'app':'Set','appdata':_0x8943('0x20')+_0x26192a[_0x405071][0x0][_0x8943('0x15')],'context':_0x26192a[_0x405071][0x0][_0x8943('0x14')],'exten':_0x26192a[_0x405071][0x0][_0x8943('0xa')],'priority':_0xc096f7[_0x8943('0xb')]++,'VoiceExtensionId':_0x26192a[_0x405071][0x0][_0x8943('0x15')]});if(_0xc096f7[_0x8943('0xd')]&&_0xc096f7[_0x8943('0xd')]['hasOwnProperty'](_0x8943('0x21'))&&_0xc096f7[_0x8943('0xd')]['recordingFormat']!=='none'){_0xc096f7['extensions']['push']({'type':_0x26192a[_0x405071][0x0]['type'],'app':_0x8943('0x11'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x26192a[_0x405071][0x0][_0x8943('0x14')],'exten':_0x26192a[_0x405071][0x0][_0x8943('0xa')],'priority':_0xc096f7[_0x8943('0xb')]++,'VoiceExtensionId':_0x26192a[_0x405071][0x0][_0x8943('0x15')]});_0xc096f7[_0x8943('0xc')]['push']({'type':_0x26192a[_0x405071][0x0][_0x8943('0x10')],'app':_0x8943('0x11'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xc096f7[_0x8943('0xd')][_0x8943('0x21')]||_0x8943('0x22'),'context':_0x26192a[_0x405071][0x0][_0x8943('0x14')],'exten':_0x26192a[_0x405071][0x0][_0x8943('0xa')],'priority':_0xc096f7['priority']++,'VoiceExtensionId':_0x26192a[_0x405071][0x0]['VoiceExtensionId']});}}_0xc096f7[_0x8943('0xc')][_0x8943('0xf')]({'type':_0x26192a[_0x405071][0x0][_0x8943('0x10')],'app':_0x8943('0x11'),'appdata':_0x8943('0x23'),'context':_0x26192a[_0x405071][0x0][_0x8943('0x14')],'exten':_0x26192a[_0x405071][0x0]['exten'],'priority':_0xc096f7[_0x8943('0xb')]++,'VoiceExtensionId':_0x26192a[_0x405071][0x0][_0x8943('0x15')]});_0xc096f7[_0x8943('0xc')][_0x8943('0xf')]({'type':_0x26192a[_0x405071][0x0][_0x8943('0x10')],'app':'Set','appdata':_0x8943('0x24'),'context':_0x26192a[_0x405071][0x0][_0x8943('0x14')],'exten':_0x26192a[_0x405071][0x0]['exten'],'priority':_0xc096f7[_0x8943('0xb')]++,'VoiceExtensionId':_0x26192a[_0x405071][0x0][_0x8943('0x15')]});_0xc096f7['extensions'][_0x8943('0xf')]({'type':_0x26192a[_0x405071][0x0][_0x8943('0x10')],'app':_0x8943('0x11'),'appdata':'MONITOR_OPTIONS=ab','context':_0x26192a[_0x405071][0x0][_0x8943('0x14')],'exten':_0x26192a[_0x405071][0x0][_0x8943('0xa')],'priority':_0xc096f7[_0x8943('0xb')]++,'VoiceExtensionId':_0x26192a[_0x405071][0x0][_0x8943('0x15')]});for(var _0x31bf9c=0x0,_0x1af48b=0x0;_0x31bf9c<_0x26192a[_0x405071][_0x8943('0x25')];_0x31bf9c+=0x1,_0x1af48b=0x0){var _0x42e7a2=_0x26192a[_0x405071][_0x31bf9c];if(_0x42e7a2['type']){_0x42e7a2[_0x8943('0x10')]=_0x42e7a2[_0x8943('0x10')]['toLowerCase']();}var _0x22eadf=[];var _0x3584dc=[];delete _0x42e7a2['id'];delete _0x42e7a2[_0x8943('0x26')];delete _0x42e7a2[_0x8943('0x27')];var _0x5d3a70=_0x42e7a2[_0x8943('0x28')]!==_0x8943('0x29')?[_0x42e7a2[_0x8943('0x28')]]:_0x42e7a2[_0x8943('0x6')]?_['map'](_['filter'](_0xc096f7[_0x8943('0x2a')],{'IntervalId':_0x42e7a2[_0x8943('0x6')]}),'interval'):[];if(_0x42e7a2['hasOwnProperty'](_0x8943('0x2b'))){if(_0x42e7a2[_0x8943('0x2b')]&&_0x42e7a2['tag']!=='--'){_0x22eadf[_0x8943('0xf')]({'type':_0x42e7a2['type'],'app':_0x8943('0x11'),'appdata':_0x8943('0x2c')+_0x42e7a2[_0x8943('0x2b')],'context':_0x42e7a2[_0x8943('0x14')],'exten':_0x42e7a2[_0x8943('0xa')],'priority':_0x5d3a70[_0x8943('0x25')]+_0xc096f7[_0x8943('0xb')]+_0x1af48b++,'VoiceExtensionId':_0x42e7a2[_0x8943('0x15')]});}}if(_0x42e7a2[_0x8943('0x10')]===_0x8943('0x17')&&_0x42e7a2[_0x8943('0x2d')](_0x8943('0x2e'))){if(_0x42e7a2[_0x8943('0x2e')]){_0x22eadf[_0x8943('0xf')]({'type':_0x42e7a2[_0x8943('0x10')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x42e7a2[_0x8943('0x2e')]+')','context':_0x42e7a2['context'],'exten':_0x42e7a2[_0x8943('0xa')],'priority':_0x5d3a70['length']+_0xc096f7[_0x8943('0xb')]+_0x1af48b++,'VoiceExtensionId':_0x42e7a2[_0x8943('0x15')]});}else{_0x22eadf[_0x8943('0xf')]({'type':_0x42e7a2[_0x8943('0x10')],'app':'ExecIf','appdata':_0x8943('0x2f'),'context':_0x42e7a2['context'],'exten':_0x42e7a2['exten'],'priority':_0x5d3a70[_0x8943('0x25')]+_0xc096f7[_0x8943('0xb')]+_0x1af48b++,'VoiceExtensionId':_0x42e7a2[_0x8943('0x15')]});}}if(_0x42e7a2[_0x8943('0x2d')]('answer')){if(_0x5936ab[_0x8943('0x30')](_0x42e7a2['app']['toLowerCase']())>=0x0&&_0x42e7a2[_0x8943('0x31')]!==_0x8943('0x32')){if(_0x42e7a2['answer']){_0x22eadf[_0x8943('0xf')]({'type':_0x42e7a2['type'],'app':_0x8943('0x1c'),'appdata':_0x8943('0x33'),'context':_0x42e7a2[_0x8943('0x14')],'exten':_0x42e7a2[_0x8943('0xa')],'priority':_0x5d3a70[_0x8943('0x25')]+_0xc096f7[_0x8943('0xb')]+_0x1af48b++,'VoiceExtensionId':_0x42e7a2['VoiceExtensionId']});_0x22eadf[_0x8943('0xf')]({'type':_0x42e7a2[_0x8943('0x10')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x42e7a2[_0x8943('0x14')],'exten':_0x42e7a2[_0x8943('0xa')],'priority':_0x5d3a70['length']+_0xc096f7[_0x8943('0xb')]+_0x1af48b++,'VoiceExtensionId':_0x42e7a2[_0x8943('0x15')]});}else{_0x22eadf[_0x8943('0xf')]({'type':_0x42e7a2[_0x8943('0x10')],'app':_0x8943('0x1c'),'appdata':_0x8943('0x34'),'context':_0x42e7a2[_0x8943('0x14')],'exten':_0x42e7a2[_0x8943('0xa')],'priority':_0x5d3a70[_0x8943('0x25')]+_0xc096f7[_0x8943('0xb')]+_0x1af48b++,'VoiceExtensionId':_0x42e7a2[_0x8943('0x15')]});_0x22eadf[_0x8943('0xf')]({'type':_0x42e7a2[_0x8943('0x10')],'app':_0x8943('0x11'),'appdata':_0x8943('0x35'),'context':_0x42e7a2[_0x8943('0x14')],'exten':_0x42e7a2[_0x8943('0xa')],'priority':_0x5d3a70[_0x8943('0x25')]+_0xc096f7[_0x8943('0xb')]+_0x1af48b++,'VoiceExtensionId':_0x42e7a2[_0x8943('0x15')]});}}}for(var _0x53c7c7=0x0;_0x53c7c7<_0x5d3a70[_0x8943('0x25')];_0x53c7c7+=0x1){var _0x24389a=_0xc096f7['priority']+_0x5d3a70[_0x8943('0x25')];var _0x6b239c=_0x53c7c7===_0x5d3a70[_0x8943('0x25')]-0x1?_0xc096f7['priority']+_0x22eadf[_0x8943('0x25')]+_0x3584dc[_0x8943('0x25')]+0x2:_0xc096f7['priority']+_0x53c7c7+0x1;_0x22eadf[_0x8943('0x36')](_0x53c7c7,0x0,{'type':_0x42e7a2[_0x8943('0x10')],'app':_0x8943('0x37'),'appdata':_0x5d3a70[_0x53c7c7]+'?'+_0x42e7a2[_0x8943('0x14')]+',${EXTEN},'+_0x24389a+':'+_0x42e7a2[_0x8943('0x14')]+_0x8943('0x38')+_0x6b239c,'exten':_0x42e7a2['exten'],'context':_0x42e7a2[_0x8943('0x14')],'priority':_0xc096f7[_0x8943('0xb')]+_0x53c7c7,'VoiceExtensionId':_0x26192a[_0x405071][0x0][_0x8943('0x15')]});}_0x42e7a2['priority']=_0x22eadf['length']?_[_0x8943('0x39')](_0x22eadf)['priority']+0x1:_0xc096f7[_0x8943('0xb')];_0xc096f7[_0x8943('0xb')]=(_0x3584dc[_0x8943('0x25')]?_['last'](_0x3584dc)[_0x8943('0xb')]:_0x42e7a2[_0x8943('0xb')])+0x1;_0xc096f7['extensions']=_['concat'](_0xc096f7[_0x8943('0xc')],_0x22eadf,[_0x42e7a2],_0x3584dc);}_0xc096f7[_0x8943('0xc')][_0x8943('0xf')]({'type':_0x26192a[_0x405071][0x0][_0x8943('0x10')],'app':'Hangup','exten':_0x26192a[_0x405071][0x0]['exten'],'context':_0x26192a[_0x405071][0x0][_0x8943('0x14')],'priority':_0xc096f7[_0x8943('0xb')],'VoiceExtensionId':_0x26192a[_0x405071][0x0][_0x8943('0x15')]});_0x1ccf23['push'](_0x26192a[_0x405071][0x0][_0x8943('0x15')]);_0x4834a9=_['concat'](_0x4834a9,_0xc096f7['extensions']);}}return _0x190cb6[_0x8943('0x3a')](function(_0x3b72a4){return _0x190cb6['models'][_0x8943('0x5')][_0x8943('0x3b')]({'where':{'VoiceExtensionId':{'$in':_0x1ccf23}},'transaction':_0x3b72a4})[_0x8943('0x4')](function(_0x1da822){return _0x190cb6['models'][_0x8943('0x5')][_0x8943('0x3c')](_['sortBy'](_0x4834a9,_0x8943('0xb')),{'transaction':_0x3b72a4});});});})['catch'](function(_0x18a471){console[_0x8943('0x3d')](_0x18a471);});}exports[_0x8943('0x3e')]=rewrite;
\ No newline at end of file
index 403f056..d10ca4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7472=['all','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','message','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','bluebird','util','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','defaults','redis','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','insert','cm_hopper','scheduledAt','ContactId','createdAt','updatedAt','select','field','toString','NOW()','from','cm_contacts','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','into','fromQuery','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','str','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','query','onlyIfOpen','sequelize','VoiceQueueId','BlackLists'];(function(_0x279b22,_0x41b255){var _0x576a99=function(_0x297168){while(--_0x297168){_0x279b22['push'](_0x279b22['shift']());}};_0x576a99(++_0x41b255);}(_0x7472,0x1c0));var _0x2747=function(_0x3d6f01,_0x27a2f7){_0x3d6f01=_0x3d6f01-0x0;var _0x2d6c1f=_0x7472[_0x3d6f01];return _0x2d6c1f;};'use strict';var BPromise=require(_0x2747('0x0'));var util=require(_0x2747('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x2747('0x2'));var Papa=require('papaparse');var Redis=require(_0x2747('0x3'));var db=require(_0x2747('0x4'))['db'];var config=require(_0x2747('0x5'));var logger=require(_0x2747('0x6'))('api');config['redis']=_[_0x2747('0x7')](config[_0x2747('0x8')],{'host':_0x2747('0x9'),'port':0x18eb});var socket=require(_0x2747('0xa'))(new Redis(config[_0x2747('0x8')]));require('../../../api/cmContact/cmContact.socket')[_0x2747('0xb')](socket);try{if(!process[_0x2747('0xc')][0x2]||process[_0x2747('0xc')][0x2]===_0x2747('0xd')||process['argv'][0x2]===_0x2747('0xe')){throw new Error(_0x2747('0xf'));}var FILEPATH=process[_0x2747('0xc')][0x2];if(!process[_0x2747('0xc')][0x3]||process[_0x2747('0xc')][0x3]===_0x2747('0xd')||process[_0x2747('0xc')][0x3]===_0x2747('0xe')||!process[_0x2747('0xc')][0x4]||process[_0x2747('0xc')][0x4]==='undefined'||process[_0x2747('0xc')][0x4]===_0x2747('0xe')){throw new Error(_0x2747('0x10'));}var FIELDS=_['zipObject'](process[_0x2747('0xc')][0x3]['split'](','),process['argv'][0x4][_0x2747('0x11')](','));if(!process[_0x2747('0xc')][0x5]||process[_0x2747('0xc')][0x5]===_0x2747('0xd')||process['argv'][0x5]===_0x2747('0xe')){throw new Error(_0x2747('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x2747('0xc')][0x6]&&process[_0x2747('0xc')][0x6]!==_0x2747('0xd')&&process['argv'][0x6]!=='null'?process[_0x2747('0xc')][0x6]:null;var DUPLICATES=process[_0x2747('0xc')][0x7]&&process[_0x2747('0xc')][0x7]!=='undefined'&&process[_0x2747('0xc')][0x7]!==_0x2747('0xe')?process[_0x2747('0xc')][0x7]:null;if(!process[_0x2747('0xc')][0x8]||process['argv'][0x8]===_0x2747('0xd')||process[_0x2747('0xc')][0x8]===_0x2747('0xe')){throw new Error(_0x2747('0x13'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x4050fc){logger[_0x2747('0x14')](_0x4050fc);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(_0x683ec7,_0x466274,_0x523158,_0x2af1df){var _0x355894={'message':_0x466274};_0x355894[_0x683ec7]=!![];if(_0x523158){_0x355894['contact']=_0x523158;}if(_0x2af1df){_0x355894['index']=_0x2af1df;}return _0x355894;}function isEmail(_0x14889f){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x14889f);}function checkRow(_0x17acd9,_0x4adeb6,_0x3eb073){return new BPromise(function(_0x34b82a,_0x4197ff){if(_[_0x2747('0x15')](_0x17acd9)){return _0x4197ff(handleCheckRowError(_0x2747('0x14'),_0x2747('0x16'),null,_0x3eb073));}if(_0x17acd9[_0x2747('0x17')]&&_0x17acd9[_0x2747('0x17')][_0x2747('0x18')]){var _0x200e61=_[_0x2747('0x19')](_0x17acd9[_0x2747('0x17')],'message')[_0x2747('0x1a')](';');return _0x4197ff(handleCheckRowError('error',_0x200e61,null,_0x3eb073));}var _0x5ba6dc={};for(var _0x57e69c in FIELDS){if(FIELDS['hasOwnProperty'](_0x57e69c)&&FIELDS[_0x57e69c]){_0x5ba6dc[_0x57e69c]=_0x17acd9[_0x2747('0x1b')][0x0][FIELDS[_0x57e69c]]||_0x17acd9['data'][0x0]['\ufeff'+FIELDS[_0x57e69c]];}}if(!_0x5ba6dc[_0x2747('0x1c')]){return _0x4197ff(handleCheckRowError('error',_0x2747('0x1d'),null,_0x3eb073));}if(!_0x5ba6dc[_0x2747('0x1e')]){return _0x4197ff(handleCheckRowError(_0x2747('0x14'),_0x2747('0x1f'),null,_0x3eb073));}if(_0x5ba6dc[_0x2747('0x20')]){var _0x2b2fc7=moment(_0x5ba6dc[_0x2747('0x20')],_0x2747('0x21'));if(!_0x2b2fc7[_0x2747('0x22')]()){return _0x4197ff(handleCheckRowError(_0x2747('0x14'),_0x2747('0x23'),null,_0x3eb073));}}if(_0x5ba6dc[_0x2747('0x24')]){if(!isEmail(_0x5ba6dc['email'])){return _0x4197ff(handleCheckRowError('error',_0x2747('0x25'),null,_0x3eb073));}}_0x5ba6dc[_0x2747('0x26')]=LISTID;_0x5ba6dc['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x2747('0x18')]&&_0x4adeb6){var _0x41a559={};for(var _0x9a5f17=0x0,_0x49b9bd=DUPLICATES['length'];_0x9a5f17<_0x49b9bd;_0x9a5f17+=0x1){_0x41a559[DUPLICATES[_0x9a5f17]]=_0x5ba6dc[DUPLICATES[_0x9a5f17]];}var _0x3508f9=_[_0x2747('0x27')](_0x4adeb6,_0x41a559);if(_0x3508f9){return _0x4197ff(handleCheckRowError(_0x2747('0x28'),_0x2747('0x29'),_0x3508f9,_0x3eb073));}}return db[_0x2747('0x2a')][_0x2747('0x2b')](_0x5ba6dc,{'raw':!![],'hooks':![],'fields':_[_0x2747('0x2c')](_0x5ba6dc)})[_0x2747('0x2d')](function(_0x28a664){if(DUPLICATES&&DUPLICATES[_0x2747('0x18')]&&_0x4adeb6){_0x4adeb6[_0x2747('0x2e')](_['pick'](_0x5ba6dc,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x28a664['id'];return _0x34b82a();})[_0x2747('0x2f')](function(_0x769089){return _0x4197ff(handleCheckRowError(_0x2747('0x14'),_0x2747('0x30')+(_0x769089['message']||JSON[_0x2747('0x31')](_0x769089)),null,_0x3eb073));});});}function checkHopper(){function _0x31b18a(){return function(_0x270667){logger[_0x2747('0x14')](_0x2747('0x32'),'checkHopper',util['inspect'](_0x270667,{'showHidden':![],'depth':null}));};}var _0x50826e=function(_0x4ed473,_0x4055e8){var _0x384748=squel[_0x2747('0x33')]()['into'](_0x2747('0x34'))['fromQuery'](['phone',_0x2747('0x35'),_0x2747('0x36'),_0x2747('0x26'),_0x4055e8,_0x2747('0x37'),_0x2747('0x38')],squel[_0x2747('0x39')]()[_0x2747('0x3a')]('phone','phone')[_0x2747('0x3a')]('NOW()',_0x2747('0x35'))[_0x2747('0x3a')]('id',_0x2747('0x36'))[_0x2747('0x3a')](LISTID[_0x2747('0x3b')](),'ListId')[_0x2747('0x3a')](_0x4ed473['id']['toString'](),_0x4055e8)[_0x2747('0x3a')]('NOW()',_0x2747('0x37'))[_0x2747('0x3a')](_0x2747('0x3c'),_0x2747('0x38'))[_0x2747('0x3d')](_0x2747('0x3e'))[_0x2747('0x3f')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID['toString']())[_0x2747('0x3f')](_0x2747('0x40'))[_0x2747('0x3f')](_0x2747('0x41'),squel[_0x2747('0x39')]()[_0x2747('0x3a')](_0x2747('0x1e'))[_0x2747('0x3d')]('cm_hopper')[_0x2747('0x3f')](_0x4055e8+_0x2747('0x42'),_0x4ed473['id'][_0x2747('0x3b')]())))[_0x2747('0x3b')]();return _0x384748;};var _0x2a4dc2=function(_0x3f3257,_0x8d751b){var _0x1b38bb=squel['insert']()[_0x2747('0x43')]('cm_hopper')[_0x2747('0x44')]([_0x2747('0x1e'),_0x2747('0x35'),_0x2747('0x36'),'ListId',_0x8d751b,_0x2747('0x37'),_0x2747('0x38')],squel[_0x2747('0x39')]()[_0x2747('0x3a')](_0x2747('0x1e'),_0x2747('0x1e'))['field'](_0x2747('0x3c'),_0x2747('0x35'))[_0x2747('0x3a')]('id',_0x2747('0x36'))[_0x2747('0x3a')](LISTID[_0x2747('0x3b')](),_0x2747('0x26'))[_0x2747('0x3a')](_0x3f3257['id'][_0x2747('0x3b')](),_0x8d751b)['field']('NOW()',_0x2747('0x37'))['field'](_0x2747('0x3c'),'updatedAt')[_0x2747('0x3d')](_0x2747('0x3e'))[_0x2747('0x3f')](_0x2747('0x45'))[_0x2747('0x3f')](_0x2747('0x46'),LISTID[_0x2747('0x3b')]())[_0x2747('0x3f')]('id\x20IN\x20?',squel[_0x2747('0x47')](hopperContacts))[_0x2747('0x3f')](_0x2747('0x40'))[_0x2747('0x3f')](_0x2747('0x41'),squel['select']()[_0x2747('0x3a')]('calleridnum')['from']('cm_hopper_final')['where'](_0x8d751b+_0x2747('0x42'),_0x3f3257['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x2747('0x39')]()['field']('phone')[_0x2747('0x3d')](_0x2747('0x34'))['where'](_0x8d751b+_0x2747('0x42'),_0x3f3257['id'][_0x2747('0x3b')]())))[_0x2747('0x3b')]();return _0x1b38bb;};function _0x77bc9c(_0x325b3c,_0x3ecb7e){var _0x9c686a=squel[_0x2747('0x33')]()[_0x2747('0x43')]('cm_hopper')['fromQuery']([_0x2747('0x1e'),_0x2747('0x35'),_0x2747('0x36'),_0x2747('0x26'),_0x3ecb7e,_0x2747('0x37'),'updatedAt'],squel['select']()[_0x2747('0x3a')]('phone',_0x2747('0x1e'))[_0x2747('0x3a')](_0x2747('0x3c'),_0x2747('0x35'))[_0x2747('0x3a')]('id',_0x2747('0x36'))[_0x2747('0x3a')](LISTID['toString'](),_0x2747('0x26'))[_0x2747('0x3a')](_0x325b3c['id'][_0x2747('0x3b')](),_0x3ecb7e)['field'](_0x2747('0x3c'),'createdAt')[_0x2747('0x3a')](_0x2747('0x3c'),'updatedAt')['from']('cm_contacts')[_0x2747('0x3f')](_0x2747('0x45'))[_0x2747('0x3f')](_0x2747('0x46'),LISTID[_0x2747('0x3b')]())[_0x2747('0x3f')](_0x2747('0x48'),squel[_0x2747('0x47')](hopperContacts))[_0x2747('0x3f')](_0x2747('0x40')))[_0x2747('0x3b')]();return _0x9c686a;}function _0x52e236(_0x3ad062,_0x1ed863){var _0x18f844=squel[_0x2747('0x33')]()['into'](_0x2747('0x49'))['fromQuery']([_0x2747('0x1e'),_0x2747('0x36'),_0x2747('0x26'),_0x1ed863,_0x2747('0x37'),'updatedAt'],squel['select']()[_0x2747('0x3a')](_0x2747('0x1e'),_0x2747('0x1e'))[_0x2747('0x3a')]('id',_0x2747('0x36'))[_0x2747('0x3a')](LISTID[_0x2747('0x3b')](),_0x2747('0x26'))[_0x2747('0x3a')](_0x3ad062['id'][_0x2747('0x3b')](),_0x1ed863)[_0x2747('0x3a')]('NOW()','createdAt')['field'](_0x2747('0x3c'),_0x2747('0x38'))[_0x2747('0x3d')](_0x2747('0x3e'))[_0x2747('0x3f')](_0x2747('0x45'))[_0x2747('0x3f')](_0x2747('0x46'),LISTID[_0x2747('0x3b')]())['where'](_0x2747('0x48'),squel[_0x2747('0x47')](hopperContacts))[_0x2747('0x3f')](_0x2747('0x40')))['toString']();return _0x18f844;}return db[_0x2747('0x4a')][_0x2747('0x4b')]({'where':{'type':_0x2747('0x4c')},'attributes':['id',_0x2747('0x4d')],'include':[{'model':db[_0x2747('0x4e')],'as':_0x2747('0x4f'),'where':{'id':LISTID}}]})[_0x2747('0x2d')](function(_0x441bef){var _0x4b1751=[];if(_0x441bef){var _0x3d706e;for(var _0x409c03=0x0,_0x56220b;_0x409c03<_0x441bef[_0x2747('0x18')];_0x409c03+=0x1){_0x56220b=_0x441bef[_0x409c03][_0x2747('0x50')]({'plain':!![]});switch(_0x56220b['dialCheckDuplicateType']){case _0x2747('0x51'):_0x4b1751[_0x2747('0x2e')](db['sequelize'][_0x2747('0x52')](_0x2a4dc2(_0x56220b,'VoiceQueueId'))[_0x2747('0x2d')](function(){})[_0x2747('0x2f')](_0x31b18a()));break;case _0x2747('0x53'):_0x4b1751[_0x2747('0x2e')](db[_0x2747('0x54')]['query'](_0x50826e(_0x56220b,_0x2747('0x55')))[_0x2747('0x2d')](function(){})[_0x2747('0x2f')](_0x31b18a()));break;default:_0x4b1751[_0x2747('0x2e')](db[_0x2747('0x54')]['query'](_0x77bc9c(_0x56220b,'VoiceQueueId'))[_0x2747('0x2d')](function(){})[_0x2747('0x2f')](_0x31b18a()));}}}return _0x4b1751;})['all']()[_0x2747('0x2d')](function(){return db[_0x2747('0x4a')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x2747('0x4e')],'as':_0x2747('0x56'),'where':{'id':LISTID}}]})[_0x2747('0x2d')](function(_0x21ce2f){var _0x34b499=[];if(_0x21ce2f){var _0x5dd170;for(var _0xbc39b7=0x0,_0x84d51;_0xbc39b7<_0x21ce2f[_0x2747('0x18')];_0xbc39b7+=0x1){_0x84d51=_0x21ce2f[_0xbc39b7][_0x2747('0x50')]({'plain':!![]});_0x34b499[_0x2747('0x2e')](db[_0x2747('0x54')]['query'](_0x52e236(_0x84d51,_0x2747('0x55')))['then'](function(){})[_0x2747('0x2f')](_0x31b18a()));}}return _0x34b499;})[_0x2747('0x57')]();})[_0x2747('0x2d')](function(){return db[_0x2747('0x58')][_0x2747('0x4b')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x2747('0x4e')],'as':_0x2747('0x4f'),'where':{'id':LISTID}}]})[_0x2747('0x2d')](function(_0xed8d59){var _0x10ddb1=[];if(_0xed8d59){for(var _0x298102=0x0,_0x238f9d;_0x298102<_0xed8d59['length'];_0x298102+=0x1){_0x238f9d=_0xed8d59[_0x298102][_0x2747('0x50')]({'plain':!![]});switch(_0x238f9d[_0x2747('0x4d')]){case _0x2747('0x51'):_0x10ddb1[_0x2747('0x2e')](db[_0x2747('0x54')][_0x2747('0x52')](_0x2a4dc2(_0x238f9d,_0x2747('0x59')))[_0x2747('0x2d')](function(){})[_0x2747('0x2f')](_0x31b18a()));break;case _0x2747('0x53'):_0x10ddb1['push'](db[_0x2747('0x54')][_0x2747('0x52')](_0x50826e(_0x238f9d,_0x2747('0x59')))[_0x2747('0x2d')](function(){})[_0x2747('0x2f')](_0x31b18a()));break;default:_0x10ddb1[_0x2747('0x2e')](db[_0x2747('0x54')]['query'](_0x77bc9c(_0x238f9d,_0x2747('0x59')))[_0x2747('0x2d')](function(){})[_0x2747('0x2f')](_0x31b18a()));}}}return _0x10ddb1;})[_0x2747('0x57')]();})['then'](function(){return db[_0x2747('0x58')][_0x2747('0x4b')]({'attributes':['id'],'include':[{'model':db[_0x2747('0x4e')],'as':_0x2747('0x56'),'where':{'id':LISTID}}]})[_0x2747('0x2d')](function(_0xa518a0){var _0x27dfeb=[];if(_0xa518a0){for(var _0x6aec7e=0x0,_0x7a3c31;_0x6aec7e<_0xa518a0['length'];_0x6aec7e+=0x1){_0x7a3c31=_0xa518a0[_0x6aec7e][_0x2747('0x50')]({'plain':!![]});_0x27dfeb['push'](db[_0x2747('0x54')][_0x2747('0x52')](_0x52e236(_0x7a3c31,'CampaignId'))[_0x2747('0x2d')](function(){})[_0x2747('0x2f')](_0x31b18a()));}}return _0x27dfeb;})['all']();})[_0x2747('0x2f')](function(_0x37ccc1){logger[_0x2747('0x14')](_0x2747('0x5a'),_0x2747('0x5b'),_0x37ccc1[_0x2747('0x5c')]);});}var processPromises=function(_0x23e74f){return BPromise['all'](promises)[_0x2747('0x2d')](function(_0x55b487){})[_0x2747('0x2f')](function(_0x2ebd4d){logger['error'](_0x2747('0x5d'),JSON[_0x2747('0x31')](_0x2ebd4d));})[_0x2747('0x5e')](function(){socket[_0x2747('0x5f')](_0x2747('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x23e74f){return _0x23e74f[_0x2747('0x61')]();}});};var endCsv=function(){return BPromise[_0x2747('0x62')]()[_0x2747('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0x2747('0x2d')](function(){socket[_0x2747('0x5f')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x2747('0x63')](FILEPATH);}catch(_0x701853){logger[_0x2747('0x14')](_0x2747('0x64'),JSON[_0x2747('0x31')](_0x701853));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x2747('0x65')](_0x2747('0x66'));endCsv();});function main(){return BPromise[_0x2747('0x62')]()[_0x2747('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x2747('0x11')](',');return db[_0x2747('0x2a')][_0x2747('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1e7421){var _0x52ed25=fs[_0x2747('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x2747('0x68')](_0x52ed25,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1891c3,_0x583d42){total+=0x1;var _0x4fc6ef=total;promises['push'](checkRow(_0x1891c3,_0x1e7421,_0x4fc6ef)[_0x2747('0x2d')](function(){success+=0x1;})[_0x2747('0x2f')](function(_0x523908){if(_0x523908[_0x2747('0x14')]){errors+=0x1;delete _0x523908['error'];}else if(_0x523908[_0x2747('0x28')]){duplicates+=0x1;delete _0x523908['duplicate'];}rows[_0x2747('0x2e')](_0x523908);}));if(total%0xc8===0x0){_0x583d42[_0x2747('0x69')]();return processPromises(_0x583d42);}},'complete':function(){return processPromises()[_0x2747('0x2d')](function(){logger[_0x2747('0x65')](_0x2747('0x6a'));endCsv();});},'error':function(_0x151e2a,_0x24ab21){logger[_0x2747('0x65')]('CSV\x20parse\x20error',JSON[_0x2747('0x31')](_0x151e2a));endCsv();}});})[_0x2747('0x2f')](function(_0x48ee0c){logger[_0x2747('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x2747('0x31')](_0x48ee0c));});}main();
\ No newline at end of file
+var _0xb058=['phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','Duplicate\x20Contact','CmContact','create','keys','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','inspect','insert','into','cm_hopper','scheduledAt','ContactId','createdAt','updatedAt','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','select','\x20=\x20?','str','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','id\x20IN\x20?','cm_hopper_black','fromQuery','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','push','query','then','onlyIfOpen','sequelize','VoiceQueueId','BlackLists','get','all','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','stringify','finally','contact:csv_','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','register','argv','null','undefined','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','data','firstName'];(function(_0x11f474,_0x1f3238){var _0x2696a4=function(_0x46d25b){while(--_0x46d25b){_0x11f474['push'](_0x11f474['shift']());}};_0x2696a4(++_0x1f3238);}(_0xb058,0x138));var _0x8b05=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xb058[_0x47e7cb];return _0x2a8874;};'use strict';var BPromise=require(_0x8b05('0x0'));var util=require(_0x8b05('0x1'));var _=require(_0x8b05('0x2'));var fs=require('fs');var squel=require(_0x8b05('0x3'));var Papa=require(_0x8b05('0x4'));var Redis=require(_0x8b05('0x5'));var db=require(_0x8b05('0x6'))['db'];var config=require(_0x8b05('0x7'));var logger=require(_0x8b05('0x8'))(_0x8b05('0x9'));config['redis']=_[_0x8b05('0xa')](config[_0x8b05('0xb')],{'host':_0x8b05('0xc'),'port':0x18eb});var socket=require(_0x8b05('0xd'))(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0x8b05('0xe')](socket);try{if(!process[_0x8b05('0xf')][0x2]||process['argv'][0x2]==='undefined'||process[_0x8b05('0xf')][0x2]===_0x8b05('0x10')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x8b05('0xf')][0x2];if(!process[_0x8b05('0xf')][0x3]||process['argv'][0x3]===_0x8b05('0x11')||process[_0x8b05('0xf')][0x3]==='null'||!process['argv'][0x4]||process[_0x8b05('0xf')][0x4]===_0x8b05('0x11')||process[_0x8b05('0xf')][0x4]===_0x8b05('0x10')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x8b05('0x12')](process[_0x8b05('0xf')][0x3]['split'](','),process[_0x8b05('0xf')][0x4][_0x8b05('0x13')](','));if(!process[_0x8b05('0xf')][0x5]||process[_0x8b05('0xf')][0x5]===_0x8b05('0x11')||process[_0x8b05('0xf')][0x5]===_0x8b05('0x10')){throw new Error(_0x8b05('0x14'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x8b05('0xf')][0x6]&&process[_0x8b05('0xf')][0x6]!=='undefined'&&process[_0x8b05('0xf')][0x6]!==_0x8b05('0x10')?process[_0x8b05('0xf')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x8b05('0xf')][0x7]!==_0x8b05('0x11')&&process[_0x8b05('0xf')][0x7]!=='null'?process[_0x8b05('0xf')][0x7]:null;if(!process[_0x8b05('0xf')][0x8]||process[_0x8b05('0xf')][0x8]==='undefined'||process[_0x8b05('0xf')][0x8]===_0x8b05('0x10')){throw new Error(_0x8b05('0x15'));}var SOCKET_TIMESTAMP=process[_0x8b05('0xf')][0x8];}catch(_0x387a44){logger['error'](_0x387a44);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(_0x36df56,_0x813642,_0xce470,_0x1745e2){var _0x3a944b={'message':_0x813642};_0x3a944b[_0x36df56]=!![];if(_0xce470){_0x3a944b[_0x8b05('0x16')]=_0xce470;}if(_0x1745e2){_0x3a944b[_0x8b05('0x17')]=_0x1745e2;}return _0x3a944b;}function isEmail(_0x59ea4d){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))*$/[_0x8b05('0x18')](_0x59ea4d);}function checkRow(_0x54815b,_0x23e6f7,_0x5e335e){return new BPromise(function(_0x3544d0,_0x5049c2){if(_[_0x8b05('0x19')](_0x54815b)){return _0x5049c2(handleCheckRowError(_0x8b05('0x1a'),_0x8b05('0x1b'),null,_0x5e335e));}if(_0x54815b['errors']&&_0x54815b[_0x8b05('0x1c')]['length']){var _0x4ce6ed=_[_0x8b05('0x1d')](_0x54815b[_0x8b05('0x1c')],_0x8b05('0x1e'))['join'](';');return _0x5049c2(handleCheckRowError('error',_0x4ce6ed,null,_0x5e335e));}var _0xc21edf={};for(var _0x38e8dc in FIELDS){if(FIELDS['hasOwnProperty'](_0x38e8dc)&&FIELDS[_0x38e8dc]){_0xc21edf[_0x38e8dc]=_0x54815b[_0x8b05('0x1f')][0x0][FIELDS[_0x38e8dc]]||_0x54815b[_0x8b05('0x1f')][0x0]['\ufeff'+FIELDS[_0x38e8dc]];}}if(!_0xc21edf[_0x8b05('0x20')]){return _0x5049c2(handleCheckRowError(_0x8b05('0x1a'),'firstName\x20not\x20specified!',null,_0x5e335e));}if(!_0xc21edf[_0x8b05('0x21')]){return _0x5049c2(handleCheckRowError(_0x8b05('0x1a'),_0x8b05('0x22'),null,_0x5e335e));}if(_0xc21edf['birthDate']){var _0xe3fbe6=moment(_0xc21edf[_0x8b05('0x23')],_0x8b05('0x24'));if(!_0xe3fbe6[_0x8b05('0x25')]()){return _0x5049c2(handleCheckRowError('error',_0x8b05('0x26'),null,_0x5e335e));}}if(_0xc21edf[_0x8b05('0x27')]){if(!isEmail(_0xc21edf[_0x8b05('0x27')])){return _0x5049c2(handleCheckRowError(_0x8b05('0x1a'),_0x8b05('0x28'),null,_0x5e335e));}}_0xc21edf[_0x8b05('0x29')]=LISTID;_0xc21edf[_0x8b05('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x23e6f7){var _0x4af6ed={};for(var _0x1307c9=0x0,_0x7166d=DUPLICATES[_0x8b05('0x2b')];_0x1307c9<_0x7166d;_0x1307c9+=0x1){_0x4af6ed[DUPLICATES[_0x1307c9]]=_0xc21edf[DUPLICATES[_0x1307c9]];}var _0x4936f7=_[_0x8b05('0x2c')](_0x23e6f7,_0x4af6ed);if(_0x4936f7){return _0x5049c2(handleCheckRowError('duplicate',_0x8b05('0x2d'),_0x4936f7,_0x5e335e));}}return db[_0x8b05('0x2e')][_0x8b05('0x2f')](_0xc21edf,{'raw':!![],'hooks':![],'fields':_[_0x8b05('0x30')](_0xc21edf)})['then'](function(_0x42afb1){if(DUPLICATES&&DUPLICATES[_0x8b05('0x2b')]&&_0x23e6f7){_0x23e6f7['push'](_[_0x8b05('0x31')](_0xc21edf,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x42afb1['id'];return _0x3544d0();})[_0x8b05('0x32')](function(_0x1c51b3){return _0x5049c2(handleCheckRowError(_0x8b05('0x1a'),_0x8b05('0x33')+(_0x1c51b3[_0x8b05('0x1e')]||JSON['stringify'](_0x1c51b3)),null,_0x5e335e));});});}function checkHopper(){function _0x359afe(){return function(_0x4a0351){logger[_0x8b05('0x1a')](_0x8b05('0x34'),'checkHopper',util[_0x8b05('0x35')](_0x4a0351,{'showHidden':![],'depth':null}));};}var _0x43aec3=function(_0x27a0fc,_0x5e5e11){var _0xc19854=squel[_0x8b05('0x36')]()[_0x8b05('0x37')](_0x8b05('0x38'))['fromQuery']([_0x8b05('0x21'),_0x8b05('0x39'),_0x8b05('0x3a'),'ListId',_0x5e5e11,_0x8b05('0x3b'),_0x8b05('0x3c')],squel['select']()[_0x8b05('0x3d')](_0x8b05('0x21'),_0x8b05('0x21'))['field'](_0x8b05('0x3e'),_0x8b05('0x39'))[_0x8b05('0x3d')]('id','ContactId')[_0x8b05('0x3d')](LISTID[_0x8b05('0x3f')](),_0x8b05('0x29'))[_0x8b05('0x3d')](_0x27a0fc['id'][_0x8b05('0x3f')](),_0x5e5e11)[_0x8b05('0x3d')]('NOW()',_0x8b05('0x3b'))['field'](_0x8b05('0x3e'),_0x8b05('0x3c'))[_0x8b05('0x40')](_0x8b05('0x41'))['where'](_0x8b05('0x42'))['where'](_0x8b05('0x43'),LISTID[_0x8b05('0x3f')]())[_0x8b05('0x44')](_0x8b05('0x45'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x8b05('0x46')]()['field'](_0x8b05('0x21'))[_0x8b05('0x40')](_0x8b05('0x38'))[_0x8b05('0x44')](_0x5e5e11+_0x8b05('0x47'),_0x27a0fc['id'][_0x8b05('0x3f')]())))[_0x8b05('0x3f')]();return _0xc19854;};var _0xd45c12=function(_0x176ee6,_0x19329a){var _0x5c083f=squel[_0x8b05('0x36')]()[_0x8b05('0x37')](_0x8b05('0x38'))['fromQuery']([_0x8b05('0x21'),_0x8b05('0x39'),'ContactId','ListId',_0x19329a,_0x8b05('0x3b'),_0x8b05('0x3c')],squel['select']()[_0x8b05('0x3d')](_0x8b05('0x21'),'phone')[_0x8b05('0x3d')](_0x8b05('0x3e'),_0x8b05('0x39'))['field']('id','ContactId')[_0x8b05('0x3d')](LISTID['toString'](),'ListId')['field'](_0x176ee6['id'][_0x8b05('0x3f')](),_0x19329a)[_0x8b05('0x3d')](_0x8b05('0x3e'),_0x8b05('0x3b'))[_0x8b05('0x3d')]('NOW()',_0x8b05('0x3c'))[_0x8b05('0x40')]('cm_contacts')[_0x8b05('0x44')](_0x8b05('0x42'))[_0x8b05('0x44')]('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x8b05('0x48')](hopperContacts))[_0x8b05('0x44')](_0x8b05('0x45'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x8b05('0x46')]()[_0x8b05('0x3d')]('calleridnum')[_0x8b05('0x40')](_0x8b05('0x49'))[_0x8b05('0x44')](_0x19329a+'\x20=\x20?',_0x176ee6['id'][_0x8b05('0x3f')]()))[_0x8b05('0x44')](_0x8b05('0x4a'),squel[_0x8b05('0x46')]()[_0x8b05('0x3d')]('phone')[_0x8b05('0x40')](_0x8b05('0x38'))[_0x8b05('0x44')](_0x19329a+_0x8b05('0x47'),_0x176ee6['id'][_0x8b05('0x3f')]())))[_0x8b05('0x3f')]();return _0x5c083f;};function _0x333bd7(_0x5a81c5,_0x1b09af){var _0x4f8d7a=squel[_0x8b05('0x36')]()[_0x8b05('0x37')](_0x8b05('0x38'))['fromQuery']([_0x8b05('0x21'),'scheduledAt','ContactId','ListId',_0x1b09af,_0x8b05('0x3b'),_0x8b05('0x3c')],squel[_0x8b05('0x46')]()[_0x8b05('0x3d')](_0x8b05('0x21'),_0x8b05('0x21'))[_0x8b05('0x3d')](_0x8b05('0x3e'),'scheduledAt')[_0x8b05('0x3d')]('id','ContactId')[_0x8b05('0x3d')](LISTID[_0x8b05('0x3f')](),_0x8b05('0x29'))[_0x8b05('0x3d')](_0x5a81c5['id'][_0x8b05('0x3f')](),_0x1b09af)[_0x8b05('0x3d')]('NOW()',_0x8b05('0x3b'))[_0x8b05('0x3d')](_0x8b05('0x3e'),_0x8b05('0x3c'))[_0x8b05('0x40')]('cm_contacts')[_0x8b05('0x44')](_0x8b05('0x42'))['where'](_0x8b05('0x43'),LISTID[_0x8b05('0x3f')]())['where'](_0x8b05('0x4b'),squel[_0x8b05('0x48')](hopperContacts))[_0x8b05('0x44')](_0x8b05('0x45')))['toString']();return _0x4f8d7a;}function _0x12eb12(_0x55e113,_0x3e5fff){var _0xba82d5=squel[_0x8b05('0x36')]()[_0x8b05('0x37')](_0x8b05('0x4c'))[_0x8b05('0x4d')](['phone',_0x8b05('0x3a'),_0x8b05('0x29'),_0x3e5fff,_0x8b05('0x3b'),'updatedAt'],squel[_0x8b05('0x46')]()[_0x8b05('0x3d')](_0x8b05('0x21'),_0x8b05('0x21'))[_0x8b05('0x3d')]('id',_0x8b05('0x3a'))[_0x8b05('0x3d')](LISTID[_0x8b05('0x3f')](),_0x8b05('0x29'))[_0x8b05('0x3d')](_0x55e113['id'][_0x8b05('0x3f')](),_0x3e5fff)['field'](_0x8b05('0x3e'),_0x8b05('0x3b'))[_0x8b05('0x3d')](_0x8b05('0x3e'),_0x8b05('0x3c'))['from'](_0x8b05('0x41'))['where'](_0x8b05('0x42'))[_0x8b05('0x44')](_0x8b05('0x43'),LISTID[_0x8b05('0x3f')]())[_0x8b05('0x44')](_0x8b05('0x4b'),squel[_0x8b05('0x48')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x8b05('0x3f')]();return _0xba82d5;}return db[_0x8b05('0x4e')][_0x8b05('0x4f')]({'where':{'type':_0x8b05('0x50')},'attributes':['id',_0x8b05('0x51')],'include':[{'model':db[_0x8b05('0x52')],'as':_0x8b05('0x53'),'where':{'id':LISTID}}]})['then'](function(_0x3187f1){var _0x1bbf78=[];if(_0x3187f1){var _0x218e17;for(var _0x30c087=0x0,_0x195c3d;_0x30c087<_0x3187f1[_0x8b05('0x2b')];_0x30c087+=0x1){_0x195c3d=_0x3187f1[_0x30c087]['get']({'plain':!![]});switch(_0x195c3d[_0x8b05('0x51')]){case _0x8b05('0x54'):_0x1bbf78[_0x8b05('0x55')](db['sequelize'][_0x8b05('0x56')](_0xd45c12(_0x195c3d,'VoiceQueueId'))[_0x8b05('0x57')](function(){})[_0x8b05('0x32')](_0x359afe()));break;case _0x8b05('0x58'):_0x1bbf78[_0x8b05('0x55')](db[_0x8b05('0x59')][_0x8b05('0x56')](_0x43aec3(_0x195c3d,_0x8b05('0x5a')))[_0x8b05('0x57')](function(){})[_0x8b05('0x32')](_0x359afe()));break;default:_0x1bbf78[_0x8b05('0x55')](db['sequelize'][_0x8b05('0x56')](_0x333bd7(_0x195c3d,_0x8b05('0x5a')))['then'](function(){})[_0x8b05('0x32')](_0x359afe()));}}}return _0x1bbf78;})['all']()[_0x8b05('0x57')](function(){return db[_0x8b05('0x4e')][_0x8b05('0x4f')]({'where':{'type':_0x8b05('0x50')},'attributes':['id'],'include':[{'model':db[_0x8b05('0x52')],'as':_0x8b05('0x5b'),'where':{'id':LISTID}}]})[_0x8b05('0x57')](function(_0x56f8af){var _0x1d29b5=[];if(_0x56f8af){var _0x47392f;for(var _0x56d814=0x0,_0x566cc8;_0x56d814<_0x56f8af[_0x8b05('0x2b')];_0x56d814+=0x1){_0x566cc8=_0x56f8af[_0x56d814][_0x8b05('0x5c')]({'plain':!![]});_0x1d29b5[_0x8b05('0x55')](db['sequelize'][_0x8b05('0x56')](_0x12eb12(_0x566cc8,_0x8b05('0x5a')))[_0x8b05('0x57')](function(){})[_0x8b05('0x32')](_0x359afe()));}}return _0x1d29b5;})[_0x8b05('0x5d')]();})['then'](function(){return db[_0x8b05('0x5e')][_0x8b05('0x4f')]({'attributes':['id',_0x8b05('0x51')],'include':[{'model':db[_0x8b05('0x52')],'as':_0x8b05('0x53'),'where':{'id':LISTID}}]})[_0x8b05('0x57')](function(_0x64a6cf){var _0x452207=[];if(_0x64a6cf){for(var _0x5b3322=0x0,_0x54eee4;_0x5b3322<_0x64a6cf[_0x8b05('0x2b')];_0x5b3322+=0x1){_0x54eee4=_0x64a6cf[_0x5b3322][_0x8b05('0x5c')]({'plain':!![]});switch(_0x54eee4[_0x8b05('0x51')]){case _0x8b05('0x54'):_0x452207[_0x8b05('0x55')](db[_0x8b05('0x59')]['query'](_0xd45c12(_0x54eee4,_0x8b05('0x5f')))[_0x8b05('0x57')](function(){})[_0x8b05('0x32')](_0x359afe()));break;case _0x8b05('0x58'):_0x452207[_0x8b05('0x55')](db[_0x8b05('0x59')][_0x8b05('0x56')](_0x43aec3(_0x54eee4,_0x8b05('0x5f')))[_0x8b05('0x57')](function(){})['catch'](_0x359afe()));break;default:_0x452207[_0x8b05('0x55')](db[_0x8b05('0x59')]['query'](_0x333bd7(_0x54eee4,_0x8b05('0x5f')))[_0x8b05('0x57')](function(){})[_0x8b05('0x32')](_0x359afe()));}}}return _0x452207;})['all']();})[_0x8b05('0x57')](function(){return db['Campaign'][_0x8b05('0x4f')]({'attributes':['id'],'include':[{'model':db[_0x8b05('0x52')],'as':_0x8b05('0x5b'),'where':{'id':LISTID}}]})[_0x8b05('0x57')](function(_0x2961d3){var _0x36b9b1=[];if(_0x2961d3){for(var _0x150fa0=0x0,_0x220854;_0x150fa0<_0x2961d3[_0x8b05('0x2b')];_0x150fa0+=0x1){_0x220854=_0x2961d3[_0x150fa0][_0x8b05('0x5c')]({'plain':!![]});_0x36b9b1[_0x8b05('0x55')](db['sequelize']['query'](_0x12eb12(_0x220854,_0x8b05('0x5f')))[_0x8b05('0x57')](function(){})[_0x8b05('0x32')](_0x359afe()));}}return _0x36b9b1;})['all']();})[_0x8b05('0x32')](function(_0xd5e454){logger[_0x8b05('0x1a')](_0x8b05('0x60'),_0x8b05('0x61'),_0xd5e454['message']);});}var processPromises=function(_0x25e2b6){return BPromise[_0x8b05('0x5d')](promises)[_0x8b05('0x57')](function(_0xe6449c){})[_0x8b05('0x32')](function(_0x513fb7){logger[_0x8b05('0x1a')]('Error\x20processing\x20rows\x20block:',JSON[_0x8b05('0x62')](_0x513fb7));})[_0x8b05('0x63')](function(){socket['emit'](_0x8b05('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x25e2b6){return _0x25e2b6['resume']();}});};var endCsv=function(){return BPromise['resolve']()[_0x8b05('0x57')](function(){if(hopperContacts){return checkHopper();}})[_0x8b05('0x57')](function(){socket[_0x8b05('0x65')](_0x8b05('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x8b05('0x66')](FILEPATH);}catch(_0x278fa9){logger['error'](_0x8b05('0x67'),JSON[_0x8b05('0x62')](_0x278fa9));}finally{process[_0x8b05('0x68')](0x0);}});};process['on'](_0x8b05('0x69'),function(){logger[_0x8b05('0x6a')](_0x8b05('0x6b'));endCsv();});function main(){return BPromise[_0x8b05('0x6c')]()[_0x8b05('0x57')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x8b05('0x13')](',');return db[_0x8b05('0x2e')][_0x8b05('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x8b05('0x57')](function(_0x55056a){var _0x582d9e=fs[_0x8b05('0x6d')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x8b05('0x6e')](_0x582d9e,{'header':!![],'skipEmptyLines':!![],'step':function(_0x264bc3,_0x4cdb3d){total+=0x1;var _0xd12f64=total;promises[_0x8b05('0x55')](checkRow(_0x264bc3,_0x55056a,_0xd12f64)[_0x8b05('0x57')](function(){success+=0x1;})[_0x8b05('0x32')](function(_0x18a394){if(_0x18a394[_0x8b05('0x1a')]){errors+=0x1;delete _0x18a394[_0x8b05('0x1a')];}else if(_0x18a394[_0x8b05('0x6f')]){duplicates+=0x1;delete _0x18a394['duplicate'];}rows[_0x8b05('0x55')](_0x18a394);}));if(total%0xc8===0x0){_0x4cdb3d[_0x8b05('0x70')]();return processPromises(_0x4cdb3d);}},'complete':function(){return processPromises()['then'](function(){logger[_0x8b05('0x6a')](_0x8b05('0x71'));endCsv();});},'error':function(_0x78d460,_0x4d2cb1){logger[_0x8b05('0x6a')](_0x8b05('0x72'),JSON[_0x8b05('0x62')](_0x78d460));endCsv();}});})[_0x8b05('0x32')](function(_0x364eaa){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x8b05('0x62')](_0x364eaa));});}main();
\ No newline at end of file
index b048827..5b6d399 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc17b=['all','AdditionalPhones','split','isNil','filter','CmContactHasItem','then','update','create','PHONE','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','priority','recallme','select','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','ListId','cm_contacts','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','scheduledat','UserId','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','id\x20IN\x20?','MIN(id)','info','Received\x20SIGINT','error','message','exit','errors','code','sequelize','query','spread','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists.CmListId=','catch','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','utcOffset','set','offset','dialTimezone','main','stringify','send','start','binding','clone','root','server/files/tmp','.csv','includes','ContactItemType','findAll','name','_description','header','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','each','contactId','contactTypeId','orderBy','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','redis','defaults','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','length','push'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xc17b,0xa2));var _0xbc17=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xc17b[_0x13e741];return _0x3f8bb3;};'use strict';var fs=require('fs');var path=require(_0xbc17('0x0'));var _=require(_0xbc17('0x1'));var Papa=require(_0xbc17('0x2'));var util=require(_0xbc17('0x3'));var BPromise=require(_0xbc17('0x4'));var moment=require(_0xbc17('0x5'));var squel=require(_0xbc17('0x6'));var Redis=require(_0xbc17('0x7'));var db=require(_0xbc17('0x8'))['db'];var config=require('../../../config/environment');var shared=require(_0xbc17('0x9'));var logger=require(_0xbc17('0xa'))('import');config[_0xbc17('0xb')]=_[_0xbc17('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbc17('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xbc17('0xd')](_0xbc17('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xbc17('0xd')](_0xbc17('0xe'));function isEmail(_0x17ee30){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))*$/[_0xbc17('0xf')](_0x17ee30);}function selectNotIn(_0x37369f,_0x1beda5,_0x3678ac,_0x3c5d04,_0xdb1b9){return squel['select']()[_0xbc17('0x10')](_0xbc17('0x11'))[_0xbc17('0x12')](_0x3c5d04)[_0xbc17('0x13')](_0x1beda5,null,_0x1beda5+_0xbc17('0x14')+_0x3c5d04+'.'+_0x3678ac)[_0xbc17('0x15')](_0x3c5d04+'.'+_0x3678ac+_0xbc17('0x16')+_0x37369f+'.'+_0x3678ac)[_0xbc17('0x15')](_0x1beda5+_0xbc17('0x17')+_0xdb1b9[_0xbc17('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x2d203e,_0x46e5a6){promisesAdditionalPhones=[];return db[_0xbc17('0x18')]['findAll']({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x13a93c){if(_0x13a93c!==null){var _0x165b46=[];for(var _0x21110d=0x0;_0x21110d<_0x13a93c[_0xbc17('0x19')];_0x21110d++){var _0x585913=_0x13a93c[_0x21110d];_0x165b46[_0xbc17('0x1a')](insertAdditionalPhones(_0x585913));}}Promise[_0xbc17('0x1b')](_0x165b46)['then'](function(){_0x2d203e({'val':0x1});});});});}function insertAdditionalPhones(_0x3612c1){return new Promise(function(_0xa838df,_0x1b7976){var _0x17a766=_0x3612c1[_0xbc17('0x1c')];var _0x5efc74=_0x17a766[_0xbc17('0x1d')](';');var _0xd63ab4=[];orderBy=0x0;for(var _0x4a4d88=0x0;_0x4a4d88<_0x5efc74[_0xbc17('0x19')];_0x4a4d88++){_0xd63ab4['push'](splitAdditionalPhone(_0x3612c1['id'],_0x5efc74[_0x4a4d88]));}Promise['all'](_0xd63ab4)['then'](function(){_0xa838df({'val':_0x5efc74[_0xbc17('0x19')]});});});}function splitAdditionalPhone(_0x1709bb,_0x3edef6){return new Promise(function(_0x5f1810,_0x5afa8d){var _0x3170c6=_0x3edef6[_0xbc17('0x1d')](':');var _0x2a8617=_0x3170c6[0x0];var _0x164bc9=_0x3170c6[0x1];if(!_[_0xbc17('0x1e')](_0x164bc9)){var _0x2ecaf2=_0x164bc9['split']('|');var _0x3f5f5f=[];for(var _0x25f130=0x0;_0x25f130<_0x2ecaf2['length'];_0x25f130++){if(_0x2ecaf2[_0x25f130]!==''){var _0x135bf0=_[_0xbc17('0x1f')](promisesAdditionalPhones,{'contactId':_0x1709bb,'phone':_0x2ecaf2[_0x25f130]});if(_0x135bf0[_0xbc17('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0xbc17('0x1a')]({'contactId':_0x1709bb,'contactTypeId':_0x2a8617,'phone':_0x2ecaf2[_0x25f130],'orderBy':orderBy});}}}_0x5f1810({'ok':0x1});}else _0x5f1810({'res':0x0});});}function createAdditionalPhone(_0x21a623,_0x1a2d14,_0x4bd3e0,_0x404270){var _0x30729c='';var _0x149f91='';var _0x4db02f=_0x4bd3e0[_0xbc17('0x1d')]('§');_0x30729c=_0x4db02f[0x0];if(_0x4db02f[_0xbc17('0x19')]==0x2)_0x149f91=_0x4db02f[0x1];return new Promise(function(_0x54454f,_0x583145){return db[_0xbc17('0x20')]['findOne']({'where':{'CmContactId':_0x21a623,'item':_0x30729c}})[_0xbc17('0x21')](function(_0x170323){if(_0x170323){return db[_0xbc17('0x20')][_0xbc17('0x22')]({'ItemTypeId':_0x1a2d14,'description':_0x149f91,'OrderBy':_0x404270},{'where':{'CmContactId':_0x21a623,'item':_0x30729c}})[_0xbc17('0x21')](function(_0x2fca4c){_0x54454f({'res':'updated'});});}else{return db['CmContactHasItem'][_0xbc17('0x23')]({'CmContactId':_0x21a623,'item':_0x30729c,'description':_0x149f91,'ItemTypeId':_0x1a2d14,'OrderBy':_0x404270,'ItemClass':_0xbc17('0x24')})[_0xbc17('0x21')](function(_0x5073e9){_0x54454f({'res':_0xbc17('0x25')});});}});});}function insertCmHopper(_0x4fa935,_0x3db02f,_0x30d79c,_0x31102b,_0x2d5c55){var _0x5b3829=[_0xbc17('0x26'),'cm_contacts.scheduledat',_0xbc17('0x27'),_0xbc17('0x28'),_0x3db02f+'.'+_0x31102b,_0xbc17('0x29'),_0xbc17('0x2a'),_0xbc17('0x2b'),'cm_contacts.UserId','\x22'+_0x2d5c55+'\x22'];return squel[_0xbc17('0x2c')]()[_0xbc17('0x2d')](_0xbc17('0x2e'))[_0xbc17('0x2f')]([_0xbc17('0x11'),'scheduledat',_0xbc17('0x30'),'ListId',_0x31102b,_0xbc17('0x31'),_0xbc17('0x32'),_0xbc17('0x33'),'UserId',_0xbc17('0x34')],squel[_0xbc17('0x35')]()[_0xbc17('0x36')](_0x5b3829)[_0xbc17('0x12')](_0x3db02f)[_0xbc17('0x13')]('cm_contacts',null,_0xbc17('0x37')+_0x3db02f+_0xbc17('0x38'))[_0xbc17('0x13')](_0x30d79c,null,_0x30d79c+_0xbc17('0x14')+_0x3db02f+'.'+_0x31102b)[_0xbc17('0x15')](_0x3db02f+_0xbc17('0x39'),_0x4fa935)[_0xbc17('0x15')](_0xbc17('0x3a'),NOW)[_0xbc17('0x15')](_0xbc17('0x3b'),selectNotIn(_0x3db02f,_0x30d79c,_0x31102b,_0xbc17('0x2e'),[_0xbc17('0x3c'),_0xbc17('0x3d')]))[_0xbc17('0x15')](_0xbc17('0x3b'),selectNotIn(_0x3db02f,_0x30d79c,_0x31102b,'cm_hopper',[_0xbc17('0x3c')])))[_0xbc17('0x3e')]();}function insertCmHopperBlack(_0x41adef,_0x1c0f8b,_0x33e3be,_0x4daba6){var _0x5e5d32=[_0xbc17('0x26'),'cm_contacts.id',_0xbc17('0x28'),_0x1c0f8b+'.'+_0x4daba6,'cm_contacts.createdAt',_0xbc17('0x2a')];return squel['insert']()[_0xbc17('0x2d')](_0xbc17('0x3f'))['fromQuery']([_0xbc17('0x11'),_0xbc17('0x30'),_0xbc17('0x40'),_0x4daba6,_0xbc17('0x31'),'updatedAt'],squel['select']()[_0xbc17('0x36')](_0x5e5d32)['from'](_0x1c0f8b)[_0xbc17('0x13')](_0xbc17('0x41'),null,_0xbc17('0x37')+_0x1c0f8b+'.CmListId')[_0xbc17('0x13')](_0x33e3be,null,_0x33e3be+'.id\x20=\x20'+_0x1c0f8b+'.'+_0x4daba6)['where'](_0x1c0f8b+_0xbc17('0x39'),_0x41adef)[_0xbc17('0x15')](_0xbc17('0x3a'),NOW)[_0xbc17('0x15')](_0xbc17('0x3b'),squel['select']()[_0xbc17('0x10')](_0xbc17('0x11'))[_0xbc17('0x12')](_0xbc17('0x3f'))['where'](_0xbc17('0x42'),_0x41adef)[_0xbc17('0x15')](_0x4daba6+_0xbc17('0x16')+_0x1c0f8b+'.'+_0x4daba6)))[_0xbc17('0x3e')]();}function insertTzCmHopper(_0x5382b1,_0x3bf819,_0x4736ba,_0x573b82,_0x34593e,_0x43dd07){var _0x3a185d=[_0xbc17('0x26'),_0xbc17('0x43')+_0x43dd07+'.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.id',_0xbc17('0x28'),_0x3bf819+'.'+_0x573b82,'cm_contacts.createdAt',_0xbc17('0x2a'),_0xbc17('0x2b'),'cm_contacts.UserId','\x22'+_0x34593e+'\x22'];var _0x5db05f=squel['insert']()[_0xbc17('0x2d')](_0xbc17('0x2e'))[_0xbc17('0x2f')]([_0xbc17('0x11'),_0xbc17('0x44'),_0xbc17('0x30'),_0xbc17('0x40'),_0x573b82,_0xbc17('0x31'),_0xbc17('0x32'),_0xbc17('0x33'),_0xbc17('0x45'),'recallme'],squel['select']()[_0xbc17('0x36')](_0x3a185d)[_0xbc17('0x12')](_0x3bf819)[_0xbc17('0x13')]('cm_contacts',null,_0xbc17('0x37')+_0x3bf819+_0xbc17('0x38'))[_0xbc17('0x13')](_0x4736ba,null,_0x4736ba+_0xbc17('0x14')+_0x3bf819+'.'+_0x573b82)[_0xbc17('0x13')](_0x43dd07,null,_0x43dd07+_0xbc17('0x14')+_0x3bf819+'.'+_0x573b82)[_0xbc17('0x15')](_0x3bf819+'.CmListId\x20=\x20?',_0x5382b1)['where'](_0xbc17('0x3a'),NOW)[_0xbc17('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3bf819,_0x4736ba,_0x573b82,_0xbc17('0x2e'),[_0xbc17('0x3c'),_0xbc17('0x3d')]))['where'](_0xbc17('0x3b'),selectNotIn(_0x3bf819,_0x4736ba,_0x573b82,_0xbc17('0x2e'),[_0xbc17('0x3c')])))[_0xbc17('0x3e')]();return _0x5db05f;}function insertTzCmHopperBlack(_0xdcd20c,_0x533a01,_0x5ba952,_0x218125){var _0x450248=[_0xbc17('0x26'),_0xbc17('0x27'),_0xbc17('0x28'),_0x533a01+'.'+_0x218125,_0xbc17('0x29'),_0xbc17('0x2a')];return squel['insert']()[_0xbc17('0x2d')](_0xbc17('0x3f'))[_0xbc17('0x2f')]([_0xbc17('0x11'),_0xbc17('0x30'),_0xbc17('0x40'),_0x218125,_0xbc17('0x31'),_0xbc17('0x32')],squel[_0xbc17('0x35')]()['fields'](_0x450248)['from'](_0x533a01)['join'](_0xbc17('0x41'),null,_0xbc17('0x37')+_0x533a01+_0xbc17('0x38'))[_0xbc17('0x13')](_0x5ba952,null,_0x5ba952+_0xbc17('0x14')+_0x533a01+'.'+_0x218125)[_0xbc17('0x15')](_0x533a01+_0xbc17('0x39'),_0xdcd20c)[_0xbc17('0x15')](_0xbc17('0x3a'),NOW)[_0xbc17('0x15')](_0xbc17('0x3b'),squel[_0xbc17('0x35')]()['field'](_0xbc17('0x11'))[_0xbc17('0x12')](_0xbc17('0x3f'))[_0xbc17('0x15')](_0xbc17('0x42'),_0xdcd20c)[_0xbc17('0x15')](_0x218125+_0xbc17('0x16')+_0x533a01+'.'+_0x218125)))[_0xbc17('0x3e')]();}function insertCmHopperAdditionalPhones(_0x47d40a){var _0x509d64=[_0xbc17('0x46'),_0xbc17('0x47'),_0xbc17('0x48'),_0xbc17('0x49'),_0xbc17('0x4a')];return squel[_0xbc17('0x2c')]()[_0xbc17('0x2d')](_0xbc17('0x4b'))[_0xbc17('0x2f')]([_0xbc17('0x4c'),'phone',_0xbc17('0x4d'),_0xbc17('0x31'),_0xbc17('0x32')],squel['select']()[_0xbc17('0x36')](_0x509d64)[_0xbc17('0x12')](_0xbc17('0x2e'))[_0xbc17('0x13')](_0xbc17('0x41'),null,_0xbc17('0x4e'))[_0xbc17('0x13')](_0xbc17('0x4f'),null,_0xbc17('0x50'))['where'](_0xbc17('0x51'),_0x47d40a)[_0xbc17('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xbc17('0x3e')]();}function insertCmContact(_0x241edf,_0x38ebbf,_0x49272c,_0x22aa3d){var _0x1cbbf1=_[_0xbc17('0x52')](_[_0xbc17('0x53')](_0x22aa3d),[_0xbc17('0x40'),_0xbc17('0x54'),_0xbc17('0x31'),_0xbc17('0x32')]);return squel[_0xbc17('0x2c')]()[_0xbc17('0x2d')](_0xbc17('0x41'))[_0xbc17('0x2f')](_0x1cbbf1,squel[_0xbc17('0x35')]()['fields'](_0x1cbbf1)[_0xbc17('0x12')](_0x38ebbf)['where']('('+_0x49272c['join'](',')+')\x20NOT\x20IN\x20?',squel[_0xbc17('0x35')]()[_0xbc17('0x36')](_0x49272c)['from'](_0xbc17('0x41'))[_0xbc17('0x15')](_0xbc17('0x42'),_0x241edf)[_0xbc17('0x15')]('deletedAt\x20IS\x20NULL'))[_0xbc17('0x15')](_0xbc17('0x55'),squel[_0xbc17('0x35')]()[_0xbc17('0x10')](_0xbc17('0x56'),'min_id')['from'](_0x38ebbf)['group'](_0x49272c[_0xbc17('0x13')](','))))[_0xbc17('0x3e')]();}function handleStop(){logger[_0xbc17('0x57')](_0xbc17('0x58'));stopped=!![];}function handleUncaughtException(_0xefca36){logger[_0xbc17('0x59')](_0xefca36[_0xbc17('0x5a')]);process[_0xbc17('0x5b')](0x1);}function handleError(_0x38aed4,_0x6dddc){stats[_0xbc17('0x5c')][_0xbc17('0x1a')]({'name':_0x6dddc[_0xbc17('0x5d')],'message':_0x6dddc[_0xbc17('0x5a')],'row':_0x38aed4});}function handleQuery(_0x3bf72a){logger[_0xbc17('0x57')](_0x3bf72a);return db[_0xbc17('0x5e')][_0xbc17('0x5f')](_0x3bf72a)[_0xbc17('0x60')](function(_0x58d479){results['push'](_0x58d479);})['catch'](function(_0x544f84){logger[_0xbc17('0x59')](_0x544f84[_0xbc17('0x5a')]);});}function updateTzCampaigns(_0x336e1d){return new Promise(function(_0x28a064,_0x2b6e51){var _0x376d71=squel[_0xbc17('0x35')]()[_0xbc17('0x36')]([_0xbc17('0x61'),_0xbc17('0x62')])[_0xbc17('0x12')](_0xbc17('0x63'))[_0xbc17('0x13')]('campaigns_has_cm_lists',null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0xbc17('0x15')](_0xbc17('0x64')+_0x336e1d);db['sequelize'][_0xbc17('0x5f')](_0x376d71[_0xbc17('0x3e')]())[_0xbc17('0x60')](function(_0x23b648){var _0x2c6dd1=[];for(var _0x2cde5c=0x0;_0x2cde5c<_0x23b648[_0xbc17('0x19')];_0x2cde5c++){_0x2c6dd1[_0xbc17('0x1a')](getTimezoneData(_0x23b648[_0x2cde5c],tmp_campaigns));}BPromise['all'](_0x2c6dd1)[_0xbc17('0x21')](function(){_0x28a064({'val':0x1});});})[_0xbc17('0x65')](function(_0x1f9929){logger[_0xbc17('0x59')](_0x1f9929[_0xbc17('0x5a')]);_0x28a064({'val':0x0});});});}function updateTzVoiceQueues(_0x43398d){return new Promise(function(_0x1bab01,_0xda9005){var _0x118678=squel['select']()[_0xbc17('0x36')]([_0xbc17('0x66'),_0xbc17('0x67')])[_0xbc17('0x12')]('voice_queues')[_0xbc17('0x13')](_0xbc17('0x68'),null,_0xbc17('0x69'))[_0xbc17('0x15')](_0xbc17('0x6a')+_0x43398d);db[_0xbc17('0x5e')]['query'](_0x118678[_0xbc17('0x3e')]())[_0xbc17('0x60')](function(_0x21312f){var _0x423722=[];for(var _0x308bb9=0x0;_0x308bb9<_0x21312f[_0xbc17('0x19')];_0x308bb9++){_0x423722[_0xbc17('0x1a')](getTimezoneData(_0x21312f[_0x308bb9],tmp_voice_queues));}BPromise[_0xbc17('0x1b')](_0x423722)['then'](function(){_0x1bab01({'val':0x1});});})[_0xbc17('0x65')](function(_0x2c2708){logger[_0xbc17('0x59')](_0x2c2708[_0xbc17('0x5a')]);_0x1bab01({'val':0x0});});});}function getTimezoneData(_0x5553b5,_0x1ce64e){return new Promise(function(_0x20cd3b,_0x4ab1d0){var _0x218841=shared[_0xbc17('0x6b')];var _0x262bfe=_0x218841[_0x5553b5['dialTimezone']];if(_['isNil'](_0x262bfe)){_0x20cd3b({'ret':0x1});}else{var _0xa6b134=_0x262bfe[_0xbc17('0x6c')];var _0x5c0138=squel[_0xbc17('0x2c')]()[_0xbc17('0x2d')](_0x1ce64e)[_0xbc17('0x6d')]('id',_0x5553b5['id'])[_0xbc17('0x6d')](_0xbc17('0x6e'),_0xa6b134)[_0xbc17('0x6d')](_0xbc17('0x6f'),_0x5553b5[_0xbc17('0x6f')])[_0xbc17('0x3e')]();return db[_0xbc17('0x5e')][_0xbc17('0x5f')](_0x5c0138)[_0xbc17('0x60')](function(_0x3a88af){_0x20cd3b({'ret':0x1});})[_0xbc17('0x65')](function(_0x517076){logger[_0xbc17('0x59')](_0x517076['message']);_0x4ab1d0({'ret':0x1});});}});}function handleTZQuery(_0x916cf6){logger[_0xbc17('0x57')](_0x916cf6);return db[_0xbc17('0x5e')][_0xbc17('0x5f')](_0x916cf6)[_0xbc17('0x60')](function(_0xa1a320){})[_0xbc17('0x65')](function(_0x1bc6bb){logger[_0xbc17('0x59')](_0x1bc6bb[_0xbc17('0x5a')]);});}function main(_0xc1e00b,_0x5d3284,_0x2336c0,_0x49f09e){logger[_0xbc17('0x57')](_0xbc17('0x70'),_0xc1e00b,JSON[_0xbc17('0x71')](_0x5d3284));process[_0xbc17('0x72')](_0xbc17('0x73'));var _0x7fd59a=_0x5d3284[_0xbc17('0x74')];var _0x239219=_[_0xbc17('0x75')](_0x7fd59a);var _0xb4482f=_0x5d3284['socket_timestamp'];var _0x1bbae6=path['join'](config[_0xbc17('0x76')],_0xbc17('0x77'),_0xb4482f+_0xbc17('0x78'));hasTZ=_[_0xbc17('0x53')](_0x7fd59a)[_0xbc17('0x79')]('dialTimezone');var _0x4ca54a=_['keys'](_0x7fd59a)['join']();logger[_0xbc17('0x57')]('header',_0x4ca54a);db[_0xbc17('0x7a')][_0xbc17('0x7b')]({'raw':!![],'attributes':['id','name']})[_0xbc17('0x21')](function(_0x4fbb2c){for(var _0x7c2e24=0x0;_0x7c2e24<_0x4fbb2c[_0xbc17('0x19')];_0x7c2e24++){if(_0x4fbb2c[_0x7c2e24][_0xbc17('0x7c')]in _0x7fd59a){contactItemTypes[_0xbc17('0x1a')](_0x4fbb2c[_0x7c2e24]);delete _0x239219[_0x4fbb2c[_0x7c2e24][_0xbc17('0x7c')]];hasAdditionalPhones=!![];}for(var _0x15a4b6 in _0x7fd59a){if(_0x4fbb2c[_0x7c2e24][_0xbc17('0x7c')]+_0xbc17('0x7d')===_0x15a4b6){phoneDescriptions[_0xbc17('0x1a')]({'itemTypeId':_0x4fbb2c[_0x7c2e24]['id'],'description':_0x15a4b6});delete _0x239219[_0x15a4b6];}}}if(hasAdditionalPhones)_0x239219[_0xbc17('0x1c')]='';var _0x49f671=_[_0xbc17('0x53')](_0x239219)[_0xbc17('0x13')]();logger[_0xbc17('0x57')](_0xbc17('0x7e'),_0x49f671);fs[_0xbc17('0x7f')](_0x1bbae6,_0x49f671+'\x0a');Papa[_0xbc17('0x80')](fs[_0xbc17('0x81')](_0xc1e00b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3c37c0,_0x7970fd){try{for(var _0x5a05e5=0x0,_0x271fa1=[];_0x5a05e5<_0x3c37c0[_0xbc17('0x82')][_0xbc17('0x19')];_0x5a05e5++){stats[_0xbc17('0x83')]+=0x1;if(_0x3c37c0[_0xbc17('0x5c')][_0x5a05e5]){handleError(_0x3c37c0['data'][_0x5a05e5],_0x3c37c0[_0xbc17('0x5c')][_0x5a05e5]);}else{var _0x4c66bd=[];var _0x1158d5=[];var _0x3108bd={};for(var _0x557d39 in _0x7fd59a){let _0x14f76a=contactItemTypes[_0xbc17('0x84')](_0x1d0949=>_0x1d0949[_0xbc17('0x7c')]===_0x557d39);let _0x3970fb=contactItemTypes[_0xbc17('0x84')](_0x52d278=>_0x52d278[_0xbc17('0x7c')]+_0xbc17('0x7d')===_0x557d39);if(_[_0xbc17('0x1e')](_0x14f76a)&&_[_0xbc17('0x1e')](_0x3970fb)){if(_0x7fd59a[_0xbc17('0x85')](_0x557d39)){if(_0x3c37c0['data'][_0x5a05e5][_0x7fd59a[_0x557d39]]){var _0x2dacc2=_[_0xbc17('0x86')](_0x3c37c0[_0xbc17('0x82')][_0x5a05e5][_0x7fd59a[_0x557d39]][_0xbc17('0x87')](/"/g,'\x27'));switch(_0x557d39){case _0xbc17('0x44'):var _0x8fe5a0=moment(_0x2dacc2,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x8fe5a0['isValid']()){_0x271fa1[_0xbc17('0x1a')]('\x22'+_0x2dacc2+'\x22');}else{_0x4c66bd[_0xbc17('0x1a')](_0xbc17('0x88'));}break;case _0xbc17('0x33'):var _0x262768=parseInt(_0x2dacc2);_0x2dacc2=_['isNaN'](_0x262768)||_0x262768<0x0||_0x262768>0x4?_0x49f09e?0x3:0x2:_0x262768;_0x271fa1[_0xbc17('0x1a')]('\x22'+_0x2dacc2+'\x22');break;case'UserId':var _0x5e8044=parseInt(_0x2dacc2);if(_[_0xbc17('0x89')](_0x5e8044)&&_[_0xbc17('0x79')](_0x2336c0,_0x5e8044)){_0x271fa1[_0xbc17('0x1a')]('\x22'+_0x5e8044+'\x22');}else{_0x4c66bd[_0xbc17('0x1a')](_0xbc17('0x8a'));}break;case _0xbc17('0x8b'):if(isEmail(_0x2dacc2)){_0x271fa1[_0xbc17('0x1a')]('\x22'+_0x2dacc2+'\x22');}else{_0x4c66bd['push']('email\x20wrong\x20format');}break;case _0xbc17('0x8c'):var _0x428631=moment(_0x2dacc2,_0xbc17('0x8d'),!![]);if(_0x428631[_0xbc17('0x8e')]()){_0x271fa1[_0xbc17('0x1a')]('\x22'+_0x2dacc2+'\x22');}else{_0x4c66bd['push'](_0xbc17('0x8f'));}break;case _0xbc17('0x6f'):var _0x2295e3=shared[_0xbc17('0x6b')];var _0x131e84=_0x2295e3[_0x2dacc2];if(!_['isNil'](_0x131e84)){var _0x19039c=_0x131e84[_0xbc17('0x6c')];_0x271fa1['push']('\x22'+_0x2dacc2+'\x22');_0x271fa1[_0xbc17('0x1a')]('\x22'+_0x19039c+'\x22');}break;default:_0x271fa1[_0xbc17('0x1a')]('\x22'+_0x2dacc2+'\x22');}}else{switch(_0x557d39){case _0xbc17('0x90'):case _0xbc17('0x11'):_0x4c66bd[_0xbc17('0x1a')](_0x557d39+'\x20not\x20specified');break;default:_0x271fa1['push']('\x22\x22');}}}}else{var _0x1643aa='';if(!_[_0xbc17('0x1e')](_0x14f76a)){if(!_0x3108bd['hasOwnProperty'](_0x14f76a['id'])){if(!_['isNil'](_0x3c37c0[_0xbc17('0x82')][_0x5a05e5][_0x7fd59a[_0x557d39]])){var _0x2dacc2=_[_0xbc17('0x86')](_0x3c37c0[_0xbc17('0x82')][_0x5a05e5][_0x7fd59a[_0x557d39]][_0xbc17('0x87')](/"/g,'\x27'));var _0x300b59=phoneDescriptions[_0xbc17('0x84')](_0x2964f2=>_0x2964f2[_0xbc17('0x91')]===_0x14f76a['id']);if(!_[_0xbc17('0x1e')](_0x300b59)){var _0x28965c=_[_0xbc17('0x86')](_0x3c37c0[_0xbc17('0x82')][_0x5a05e5][_0x7fd59a[_0x300b59[_0xbc17('0x92')]]][_0xbc17('0x87')](/"/g,'\x27'));if(!_[_0xbc17('0x1e')](_0x28965c))_0x2dacc2=_0x2dacc2+'§'+_0x28965c;}if(_0x1643aa=='')_0x1643aa=_0x2dacc2;else _0x1643aa+='|'+_0x2dacc2;}_0x1158d5[_0xbc17('0x1a')](_0x14f76a['id']+':'+_0x1643aa);_0x3108bd[_0x14f76a['id']]=0x1;}}}}if(hasAdditionalPhones){_0x271fa1['push']('\x22'+_0x1158d5[_0xbc17('0x13')](';')+'\x22');}if(_0x4c66bd[_0xbc17('0x19')]){handleError(_0x3c37c0[_0xbc17('0x82')][_0x5a05e5],{'code':_0xbc17('0x93'),'message':_0x4c66bd['join']()});}else{fs[_0xbc17('0x94')](_0x1bbae6,_0x271fa1[_0xbc17('0x13')]()+'\x0a');}_0x271fa1=[];}if(!(stats['rows']%0xc8)){socket[_0xbc17('0x95')](_0xbc17('0x96')+_0xb4482f,stats);stats[_0xbc17('0x5c')]=[];}}if(stopped){logger[_0xbc17('0x57')]('Abort\x20parser');_0x7970fd[_0xbc17('0x97')]();}}catch(_0x249cd8){handleError(_0x3c37c0['data'][_0x5a05e5],{'code':_0xbc17('0x98'),'message':_0x249cd8[_0xbc17('0x5a')]});logger[_0xbc17('0x59')](_0xbc17('0x99'),_0x249cd8[_0xbc17('0x5a')]);}},'complete':function(){try{var _0x5e4eb8=[];var _0x572454=[];var _0x4e882a=_0xbc17('0x41');if(_0x5d3284[_0xbc17('0x9a')]&&_0x5d3284[_0xbc17('0x9a')][_0xbc17('0x19')]){_0x4e882a=_0xbc17('0x9b')+_0xb4482f;_0x5e4eb8[_0xbc17('0x1a')](_0xbc17('0x9c')+_0x4e882a+_0xbc17('0x9d'));}tmp_campaigns=_0xbc17('0x9e')+_0xb4482f;tmp_voice_queues=_0xbc17('0x9f')+_0xb4482f;_0x572454[_0xbc17('0x1a')](_0xbc17('0x9c')+tmp_campaigns+_0xbc17('0xa0'));_0x572454['push']('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise['each'](_0x572454,handleTZQuery)['then'](function(_0x4d2e1e){updateTzCampaigns(_0x5d3284['ListId'])['then'](function(_0x524b4f){updateTzVoiceQueues(_0x5d3284[_0xbc17('0x40')])['then'](function(_0x13ce00){if(hasTZ)_0x49f671=_0x49f671[_0xbc17('0x87')](_0xbc17('0x6f'),_0xbc17('0xa1'));var _0x5e3515=util[_0xbc17('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',_0x1bbae6,_0x4e882a,_0x49f671,_0x5d3284[_0xbc17('0x40')],_0x5d3284[_0xbc17('0x54')]||null,NOW,NOW);if(_[_0xbc17('0x1e')](_0x7fd59a['scheduledat'])){_0x5e3515+=_0xbc17('0xa2');}_0x5e4eb8['push'](_0x5e3515);if(_0x5d3284[_0xbc17('0x9a')]&&_0x5d3284[_0xbc17('0x9a')][_0xbc17('0x19')]){_0x5e4eb8[_0xbc17('0x1a')](insertCmContact(_0x5d3284[_0xbc17('0x40')],_0x4e882a,_0x5d3284[_0xbc17('0x9a')],_0x7fd59a));_0x5e4eb8[_0xbc17('0x1a')](_0xbc17('0xa3')+_0x4e882a+';');}BPromise[_0xbc17('0xa4')](_0x5e4eb8,handleQuery)[_0xbc17('0x21')](function(_0x4c7735){BPromise['all']([handleAdditionalPhones()])[_0xbc17('0x21')](function(){_0x5e4eb8=[];for(var _0x5b1bfa=0x0;_0x5b1bfa<promisesAdditionalPhones[_0xbc17('0x19')];_0x5b1bfa++){if(promisesAdditionalPhones[_0x5b1bfa][_0xbc17('0x11')]!='§'){_0x5e4eb8[_0xbc17('0x1a')](createAdditionalPhone(promisesAdditionalPhones[_0x5b1bfa][_0xbc17('0xa5')],promisesAdditionalPhones[_0x5b1bfa][_0xbc17('0xa6')],promisesAdditionalPhones[_0x5b1bfa][_0xbc17('0x11')],promisesAdditionalPhones[_0x5b1bfa][_0xbc17('0xa7')]));}}BPromise[_0xbc17('0x1b')](_0x5e4eb8)['then'](function(){_0x5e4eb8=[];if(hasTZ){_0x5e4eb8[_0xbc17('0x1a')](insertTzCmHopper(_0x5d3284[_0xbc17('0x40')],_0xbc17('0x68'),_0xbc17('0xa8'),_0xbc17('0xa9'),_0x49f09e,tmp_voice_queues));_0x5e4eb8[_0xbc17('0x1a')](insertTzCmHopperBlack(_0x5d3284[_0xbc17('0x40')],_0xbc17('0xaa'),_0xbc17('0xa8'),_0xbc17('0xa9')));_0x5e4eb8[_0xbc17('0x1a')](insertTzCmHopper(_0x5d3284[_0xbc17('0x40')],_0xbc17('0xab'),_0xbc17('0x63'),_0xbc17('0xac'),_0x49f09e,tmp_campaigns));_0x5e4eb8[_0xbc17('0x1a')](insertTzCmHopperBlack(_0x5d3284[_0xbc17('0x40')],_0xbc17('0xad'),_0xbc17('0x63'),'CampaignId'));_0x5e4eb8[_0xbc17('0x1a')](insertCmHopperAdditionalPhones(_0x5d3284['ListId']));}else{_0x5e4eb8[_0xbc17('0x1a')](insertCmHopper(_0x5d3284[_0xbc17('0x40')],'voice_queues_has_cm_lists',_0xbc17('0xa8'),_0xbc17('0xa9'),_0x49f09e));_0x5e4eb8['push'](insertCmHopperBlack(_0x5d3284['ListId'],_0xbc17('0xaa'),'voice_queues',_0xbc17('0xa9')));_0x5e4eb8['push'](insertCmHopper(_0x5d3284[_0xbc17('0x40')],_0xbc17('0xab'),_0xbc17('0x63'),_0xbc17('0xac'),_0x49f09e));_0x5e4eb8[_0xbc17('0x1a')](insertCmHopperBlack(_0x5d3284[_0xbc17('0x40')],_0xbc17('0xad'),_0xbc17('0x63'),_0xbc17('0xac')));_0x5e4eb8['push'](insertCmHopperAdditionalPhones(_0x5d3284[_0xbc17('0x40')]));}_0x5e4eb8['push'](_0xbc17('0xa3')+tmp_campaigns+';');_0x5e4eb8[_0xbc17('0x1a')](_0xbc17('0xa3')+tmp_voice_queues+';');BPromise[_0xbc17('0xa4')](_0x5e4eb8,handleQuery)[_0xbc17('0x21')](function(_0x2bb8b0){stats[_0xbc17('0xae')]=!![];stats[_0xbc17('0xaf')]=_0x5d3284['duplicates']&&_0x5d3284[_0xbc17('0x9a')][_0xbc17('0x19')]?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket[_0xbc17('0x95')](_0xbc17('0x96')+_0xb4482f,stats);fs[_0xbc17('0xb0')](_0xc1e00b);fs[_0xbc17('0xb0')](_0x1bbae6);process[_0xbc17('0x5b')](0x0);})['catch'](function(_0xc8eaa3){logger[_0xbc17('0x59')](_0xc8eaa3[_0xbc17('0x5a')]);process['exit'](0x1);});});});})[_0xbc17('0x65')](function(_0xaa8b98){logger['error'](_0xaa8b98[_0xbc17('0x5a')]);process[_0xbc17('0x5b')](0x1);});});});});}catch(_0x197027){logger[_0xbc17('0x59')](_0xbc17('0xb1'),_0x197027[_0xbc17('0x5a')]);process[_0xbc17('0x5b')](0x1);}},'error':function(_0x1bc9e1,_0x40068a,_0x1e4068,_0x2d24ba){throw new Error(_0x2d24ba);}});});}function validate(){if(process[_0xbc17('0xb2')]&&process['argv'][_0xbc17('0x19')]<0x4){throw new Error(_0xbc17('0xb3'));}var _0x1745f4=path[_0xbc17('0x13')](config['root'],_0xbc17('0x77'),process[_0xbc17('0xb2')][0x2]);if(!fs[_0xbc17('0xb4')](_0x1745f4)){throw new Error(_0xbc17('0xb5'));}var _0x10c349={};try{_0x10c349=JSON['parse'](process[_0xbc17('0xb2')][0x3]);if(!_0x10c349[_0xbc17('0x74')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x10c349['binding'][_0xbc17('0x11')]){throw new Error(_0xbc17('0xb6'));}if(!_0x10c349['binding'][_0xbc17('0x90')]){throw new Error(_0xbc17('0xb7'));}var _0x515be4=0x0;if(_0x10c349[_0xbc17('0x74')][_0xbc17('0x45')]){_0x515be4=0x1;}if(!_0x10c349['ListId']){throw new Error(_0xbc17('0xb8'));}}catch(_0xfd2338){throw new Error(_0xbc17('0xb9'));}var _0x4b0170=[];try{_0x4b0170=_['map'](JSON['parse'](process[_0xbc17('0xb2')][0x4]),'id');}catch(_0x58618e){logger[_0xbc17('0x57')](_0xbc17('0xba'));}main(_0x1745f4,_0x10c349,_0x4b0170,_0x515be4);}validate();process['on'](_0xbc17('0xbb'),handleStop);process['on'](_0xbc17('0xbc'),handleUncaughtException);
\ No newline at end of file
+var _0xb0c8=['redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','CmContact','findAll','AdditionalPhones','then','length','push','all','split','filter','CmContactHasItem','update','create','PHONE','inserted','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','scheduledat','ListId','createdAt','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone','insert','cm_hopper_black','fromQuery','updatedAt','.CmListId','.CmListId\x20=\x20?','ListId\x20=\x20?','toString','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','ContactId','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','code','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','isNil','utcOffset','set','offset','main','send','start','binding','clone','socket_timestamp','.csv','includes','keys','name','_description','header','writeFileSync','parse','createReadStream','rows','data','find','hasOwnProperty','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','trim','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','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','DROP\x20TABLE\x20','each','contactId','contactTypeId','orderBy','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','affectedRows','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','server/files/tmp','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','uncaughtException','lodash','papaparse','util','squel','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger'];(function(_0x416348,_0x236738){var _0x3e7acf=function(_0x127c4c){while(--_0x127c4c){_0x416348['push'](_0x416348['shift']());}};_0x3e7acf(++_0x236738);}(_0xb0c8,0x168));var _0x8b0c=function(_0x533893,_0xec81ea){_0x533893=_0x533893-0x0;var _0x16781a=_0xb0c8[_0x533893];return _0x16781a;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x8b0c('0x0'));var Papa=require(_0x8b0c('0x1'));var util=require(_0x8b0c('0x2'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0x8b0c('0x3'));var Redis=require(_0x8b0c('0x4'));var db=require(_0x8b0c('0x5'))['db'];var config=require('../../../config/environment');var shared=require(_0x8b0c('0x6'));var logger=require(_0x8b0c('0x7'))('import');config[_0x8b0c('0x8')]=_[_0x8b0c('0x9')](config[_0x8b0c('0x8')],{'host':_0x8b0c('0xa'),'port':0x18eb});var socket=require(_0x8b0c('0xb'))(new Redis(config[_0x8b0c('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x8b0c('0xc')](_0x8b0c('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x8b0c('0xd'));function isEmail(_0x428d59){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))*$/[_0x8b0c('0xe')](_0x428d59);}function selectNotIn(_0x35a2d8,_0x4312b2,_0x36e16b,_0x2bcc81,_0x5aa528){return squel[_0x8b0c('0xf')]()[_0x8b0c('0x10')](_0x8b0c('0x11'))[_0x8b0c('0x12')](_0x2bcc81)[_0x8b0c('0x13')](_0x4312b2,null,_0x4312b2+_0x8b0c('0x14')+_0x2bcc81+'.'+_0x36e16b)[_0x8b0c('0x15')](_0x2bcc81+'.'+_0x36e16b+_0x8b0c('0x16')+_0x35a2d8+'.'+_0x36e16b)['where'](_0x4312b2+'.dialCheckDuplicateType\x20IN\x20('+_0x5aa528[_0x8b0c('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x32245e,_0x32a300){promisesAdditionalPhones=[];return db[_0x8b0c('0x17')][_0x8b0c('0x18')]({'raw':!![],'attributes':['id',_0x8b0c('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x8b0c('0x1a')](function(_0x238028){if(_0x238028!==null){var _0x4525cc=[];for(var _0x38b9ba=0x0;_0x38b9ba<_0x238028[_0x8b0c('0x1b')];_0x38b9ba++){var _0x452c7e=_0x238028[_0x38b9ba];_0x4525cc[_0x8b0c('0x1c')](insertAdditionalPhones(_0x452c7e));}}Promise[_0x8b0c('0x1d')](_0x4525cc)['then'](function(){_0x32245e({'val':0x1});});});});}function insertAdditionalPhones(_0x4eb044){return new Promise(function(_0x4a152d,_0x2fc716){var _0x49e60d=_0x4eb044[_0x8b0c('0x19')];var _0x58684b=_0x49e60d[_0x8b0c('0x1e')](';');var _0x20cff9=[];orderBy=0x0;for(var _0xa1b796=0x0;_0xa1b796<_0x58684b[_0x8b0c('0x1b')];_0xa1b796++){_0x20cff9[_0x8b0c('0x1c')](splitAdditionalPhone(_0x4eb044['id'],_0x58684b[_0xa1b796]));}Promise['all'](_0x20cff9)[_0x8b0c('0x1a')](function(){_0x4a152d({'val':_0x58684b[_0x8b0c('0x1b')]});});});}function splitAdditionalPhone(_0x5100ee,_0x2e6208){return new Promise(function(_0x446538,_0xef3e7b){var _0x2ed218=_0x2e6208[_0x8b0c('0x1e')](':');var _0x44944e=_0x2ed218[0x0];var _0x3dc40b=_0x2ed218[0x1];if(!_['isNil'](_0x3dc40b)){var _0x8b7093=_0x3dc40b['split']('|');var _0x1b2e2b=[];for(var _0x4ebd4c=0x0;_0x4ebd4c<_0x8b7093[_0x8b0c('0x1b')];_0x4ebd4c++){if(_0x8b7093[_0x4ebd4c]!==''){var _0x1f7cd6=_[_0x8b0c('0x1f')](promisesAdditionalPhones,{'contactId':_0x5100ee,'phone':_0x8b7093[_0x4ebd4c]});if(_0x1f7cd6[_0x8b0c('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x8b0c('0x1c')]({'contactId':_0x5100ee,'contactTypeId':_0x44944e,'phone':_0x8b7093[_0x4ebd4c],'orderBy':orderBy});}}}_0x446538({'ok':0x1});}else _0x446538({'res':0x0});});}function createAdditionalPhone(_0x5ca6a2,_0x19aac1,_0x582fc9,_0x499e2e){var _0x317409='';var _0x374e6d='';var _0x2d7e87=_0x582fc9[_0x8b0c('0x1e')]('§');_0x317409=_0x2d7e87[0x0];if(_0x2d7e87[_0x8b0c('0x1b')]==0x2)_0x374e6d=_0x2d7e87[0x1];return new Promise(function(_0x1eddf7,_0x536d99){return db[_0x8b0c('0x20')]['findOne']({'where':{'CmContactId':_0x5ca6a2,'item':_0x317409}})[_0x8b0c('0x1a')](function(_0x1a5138){if(_0x1a5138){return db[_0x8b0c('0x20')][_0x8b0c('0x21')]({'ItemTypeId':_0x19aac1,'description':_0x374e6d,'OrderBy':_0x499e2e},{'where':{'CmContactId':_0x5ca6a2,'item':_0x317409}})[_0x8b0c('0x1a')](function(_0xe4fbe5){_0x1eddf7({'res':'updated'});});}else{return db[_0x8b0c('0x20')][_0x8b0c('0x22')]({'CmContactId':_0x5ca6a2,'item':_0x317409,'description':_0x374e6d,'ItemTypeId':_0x19aac1,'OrderBy':_0x499e2e,'ItemClass':_0x8b0c('0x23')})[_0x8b0c('0x1a')](function(_0x5e780a){_0x1eddf7({'res':_0x8b0c('0x24')});});}});});}function insertCmHopper(_0x4c9f7d,_0x544986,_0x3f96fd,_0x251fa2,_0x45b88b){var _0x31bc82=['cm_contacts.phone',_0x8b0c('0x25'),_0x8b0c('0x26'),_0x8b0c('0x27'),_0x544986+'.'+_0x251fa2,_0x8b0c('0x28'),_0x8b0c('0x29'),_0x8b0c('0x2a'),_0x8b0c('0x2b'),'\x22'+_0x45b88b+'\x22'];return squel['insert']()[_0x8b0c('0x2c')](_0x8b0c('0x2d'))['fromQuery']([_0x8b0c('0x11'),_0x8b0c('0x2e'),'ContactId',_0x8b0c('0x2f'),_0x251fa2,_0x8b0c('0x30'),'updatedAt','priority',_0x8b0c('0x31'),_0x8b0c('0x32')],squel[_0x8b0c('0xf')]()[_0x8b0c('0x33')](_0x31bc82)[_0x8b0c('0x12')](_0x544986)['join'](_0x8b0c('0x34'),null,_0x8b0c('0x35')+_0x544986+'.CmListId')['join'](_0x3f96fd,null,_0x3f96fd+_0x8b0c('0x14')+_0x544986+'.'+_0x251fa2)[_0x8b0c('0x15')](_0x544986+'.CmListId\x20=\x20?',_0x4c9f7d)['where'](_0x8b0c('0x36'),NOW)['where'](_0x8b0c('0x37'),selectNotIn(_0x544986,_0x3f96fd,_0x251fa2,_0x8b0c('0x2d'),[_0x8b0c('0x38'),_0x8b0c('0x39')]))[_0x8b0c('0x15')](_0x8b0c('0x37'),selectNotIn(_0x544986,_0x3f96fd,_0x251fa2,_0x8b0c('0x2d'),[_0x8b0c('0x38')])))['toString']();}function insertCmHopperBlack(_0x31427c,_0x11d89e,_0x4d1c24,_0xf30190){var _0x2c2a29=[_0x8b0c('0x3a'),_0x8b0c('0x26'),'cm_contacts.ListId',_0x11d89e+'.'+_0xf30190,_0x8b0c('0x28'),'cm_contacts.updatedAt'];return squel[_0x8b0c('0x3b')]()[_0x8b0c('0x2c')](_0x8b0c('0x3c'))[_0x8b0c('0x3d')](['phone','ContactId',_0x8b0c('0x2f'),_0xf30190,_0x8b0c('0x30'),_0x8b0c('0x3e')],squel['select']()['fields'](_0x2c2a29)[_0x8b0c('0x12')](_0x11d89e)['join'](_0x8b0c('0x34'),null,_0x8b0c('0x35')+_0x11d89e+_0x8b0c('0x3f'))[_0x8b0c('0x13')](_0x4d1c24,null,_0x4d1c24+_0x8b0c('0x14')+_0x11d89e+'.'+_0xf30190)[_0x8b0c('0x15')](_0x11d89e+_0x8b0c('0x40'),_0x31427c)[_0x8b0c('0x15')](_0x8b0c('0x36'),NOW)[_0x8b0c('0x15')](_0x8b0c('0x37'),squel[_0x8b0c('0xf')]()[_0x8b0c('0x10')](_0x8b0c('0x11'))[_0x8b0c('0x12')](_0x8b0c('0x3c'))[_0x8b0c('0x15')](_0x8b0c('0x41'),_0x31427c)['where'](_0xf30190+_0x8b0c('0x16')+_0x11d89e+'.'+_0xf30190)))[_0x8b0c('0x42')]();}function insertTzCmHopper(_0x2ba1fb,_0x10539e,_0x8f4ebb,_0x2a8e9f,_0xe840f,_0x5857bb){var _0x173f20=[_0x8b0c('0x3a'),_0x8b0c('0x43')+_0x5857bb+_0x8b0c('0x44'),_0x8b0c('0x26'),_0x8b0c('0x27'),_0x10539e+'.'+_0x2a8e9f,_0x8b0c('0x28'),'cm_contacts.updatedAt',_0x8b0c('0x2a'),'cm_contacts.UserId','\x22'+_0xe840f+'\x22'];var _0xe04a78=squel[_0x8b0c('0x3b')]()['into'](_0x8b0c('0x2d'))[_0x8b0c('0x3d')](['phone',_0x8b0c('0x2e'),'ContactId','ListId',_0x2a8e9f,_0x8b0c('0x30'),_0x8b0c('0x3e'),'priority',_0x8b0c('0x31'),_0x8b0c('0x32')],squel[_0x8b0c('0xf')]()[_0x8b0c('0x33')](_0x173f20)[_0x8b0c('0x12')](_0x10539e)[_0x8b0c('0x13')](_0x8b0c('0x34'),null,_0x8b0c('0x35')+_0x10539e+'.CmListId')[_0x8b0c('0x13')](_0x8f4ebb,null,_0x8f4ebb+_0x8b0c('0x14')+_0x10539e+'.'+_0x2a8e9f)['join'](_0x5857bb,null,_0x5857bb+'.id\x20=\x20'+_0x10539e+'.'+_0x2a8e9f)[_0x8b0c('0x15')](_0x10539e+'.CmListId\x20=\x20?',_0x2ba1fb)[_0x8b0c('0x15')](_0x8b0c('0x36'),NOW)[_0x8b0c('0x15')](_0x8b0c('0x37'),selectNotIn(_0x10539e,_0x8f4ebb,_0x2a8e9f,_0x8b0c('0x2d'),[_0x8b0c('0x38'),_0x8b0c('0x39')]))[_0x8b0c('0x15')](_0x8b0c('0x37'),selectNotIn(_0x10539e,_0x8f4ebb,_0x2a8e9f,_0x8b0c('0x2d'),[_0x8b0c('0x38')])))['toString']();return _0xe04a78;}function insertTzCmHopperBlack(_0x22e9db,_0xd1eab3,_0x304965,_0x4dc714){var _0x3d89fb=[_0x8b0c('0x3a'),_0x8b0c('0x26'),_0x8b0c('0x27'),_0xd1eab3+'.'+_0x4dc714,_0x8b0c('0x28'),_0x8b0c('0x29')];return squel[_0x8b0c('0x3b')]()[_0x8b0c('0x2c')](_0x8b0c('0x3c'))['fromQuery']([_0x8b0c('0x11'),_0x8b0c('0x45'),_0x8b0c('0x2f'),_0x4dc714,'createdAt',_0x8b0c('0x3e')],squel[_0x8b0c('0xf')]()[_0x8b0c('0x33')](_0x3d89fb)[_0x8b0c('0x12')](_0xd1eab3)[_0x8b0c('0x13')](_0x8b0c('0x34'),null,'cm_contacts.ListId\x20=\x20'+_0xd1eab3+_0x8b0c('0x3f'))[_0x8b0c('0x13')](_0x304965,null,_0x304965+_0x8b0c('0x14')+_0xd1eab3+'.'+_0x4dc714)[_0x8b0c('0x15')](_0xd1eab3+_0x8b0c('0x40'),_0x22e9db)[_0x8b0c('0x15')](_0x8b0c('0x36'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x8b0c('0x10')](_0x8b0c('0x11'))[_0x8b0c('0x12')]('cm_hopper_black')['where'](_0x8b0c('0x41'),_0x22e9db)['where'](_0x4dc714+_0x8b0c('0x16')+_0xd1eab3+'.'+_0x4dc714)))[_0x8b0c('0x42')]();}function insertCmHopperAdditionalPhones(_0x20a6bd){var _0x486007=['cm_hopper.id',_0x8b0c('0x46'),'cm_contact_has_items.OrderBy',_0x8b0c('0x47'),'cm_contact_has_items.updatedAt'];return squel['insert']()[_0x8b0c('0x2c')](_0x8b0c('0x48'))['fromQuery']([_0x8b0c('0x49'),_0x8b0c('0x11'),_0x8b0c('0x4a'),_0x8b0c('0x30'),_0x8b0c('0x3e')],squel[_0x8b0c('0xf')]()[_0x8b0c('0x33')](_0x486007)[_0x8b0c('0x12')](_0x8b0c('0x2d'))['join'](_0x8b0c('0x34'),null,_0x8b0c('0x4b'))[_0x8b0c('0x13')](_0x8b0c('0x4c'),null,_0x8b0c('0x4d'))['where'](_0x8b0c('0x4e'),_0x20a6bd)[_0x8b0c('0x15')](_0x8b0c('0x36'),NOW))['toString']();}function insertCmContact(_0x1e492c,_0x1d7322,_0xe2623e,_0x2fda1e){var _0x13eac8=_[_0x8b0c('0x4f')](_['keys'](_0x2fda1e),[_0x8b0c('0x2f'),_0x8b0c('0x50'),'createdAt',_0x8b0c('0x3e')]);return squel[_0x8b0c('0x3b')]()['into'](_0x8b0c('0x34'))['fromQuery'](_0x13eac8,squel['select']()[_0x8b0c('0x33')](_0x13eac8)[_0x8b0c('0x12')](_0x1d7322)['where']('('+_0xe2623e[_0x8b0c('0x13')](',')+_0x8b0c('0x51'),squel['select']()['fields'](_0xe2623e)['from'](_0x8b0c('0x34'))[_0x8b0c('0x15')]('ListId\x20=\x20?',_0x1e492c)[_0x8b0c('0x15')](_0x8b0c('0x52')))['where']('id\x20IN\x20?',squel[_0x8b0c('0xf')]()[_0x8b0c('0x10')](_0x8b0c('0x53'),_0x8b0c('0x54'))['from'](_0x1d7322)[_0x8b0c('0x55')](_0xe2623e[_0x8b0c('0x13')](','))))[_0x8b0c('0x42')]();}function handleStop(){logger[_0x8b0c('0x56')](_0x8b0c('0x57'));stopped=!![];}function handleUncaughtException(_0x143d70){logger[_0x8b0c('0x58')](_0x143d70[_0x8b0c('0x59')]);process[_0x8b0c('0x5a')](0x1);}function handleError(_0x28d2bd,_0x1a6d88){stats['errors'][_0x8b0c('0x1c')]({'name':_0x1a6d88[_0x8b0c('0x5b')],'message':_0x1a6d88[_0x8b0c('0x59')],'row':_0x28d2bd});}function handleQuery(_0x3e3d36){logger[_0x8b0c('0x56')](_0x3e3d36);return db[_0x8b0c('0x5c')][_0x8b0c('0x5d')](_0x3e3d36)[_0x8b0c('0x5e')](function(_0x16e560){results[_0x8b0c('0x1c')](_0x16e560);})[_0x8b0c('0x5f')](function(_0x399879){logger[_0x8b0c('0x58')](_0x399879[_0x8b0c('0x59')]);});}function updateTzCampaigns(_0x15570f){return new Promise(function(_0x23c2ea,_0x4be421){var _0x4d32b6=squel[_0x8b0c('0xf')]()[_0x8b0c('0x33')]([_0x8b0c('0x60'),_0x8b0c('0x61')])[_0x8b0c('0x12')](_0x8b0c('0x62'))[_0x8b0c('0x13')](_0x8b0c('0x63'),null,_0x8b0c('0x64'))[_0x8b0c('0x15')](_0x8b0c('0x65')+_0x15570f);db[_0x8b0c('0x5c')][_0x8b0c('0x5d')](_0x4d32b6[_0x8b0c('0x42')]())[_0x8b0c('0x5e')](function(_0x4cc052){var _0x3de6a7=[];for(var _0x2112d5=0x0;_0x2112d5<_0x4cc052[_0x8b0c('0x1b')];_0x2112d5++){_0x3de6a7[_0x8b0c('0x1c')](getTimezoneData(_0x4cc052[_0x2112d5],tmp_campaigns));}BPromise[_0x8b0c('0x1d')](_0x3de6a7)[_0x8b0c('0x1a')](function(){_0x23c2ea({'val':0x1});});})[_0x8b0c('0x5f')](function(_0xa766f4){logger[_0x8b0c('0x58')](_0xa766f4[_0x8b0c('0x59')]);_0x23c2ea({'val':0x0});});});}function updateTzVoiceQueues(_0x4f39a0){return new Promise(function(_0x476e98,_0x3f8508){var _0x13b890=squel[_0x8b0c('0xf')]()[_0x8b0c('0x33')]([_0x8b0c('0x66'),_0x8b0c('0x67')])[_0x8b0c('0x12')](_0x8b0c('0x68'))['join']('voice_queues_has_cm_lists',null,_0x8b0c('0x69'))[_0x8b0c('0x15')](_0x8b0c('0x6a')+_0x4f39a0);db['sequelize'][_0x8b0c('0x5d')](_0x13b890[_0x8b0c('0x42')]())[_0x8b0c('0x5e')](function(_0x105c52){var _0x26cb24=[];for(var _0x4f5bfb=0x0;_0x4f5bfb<_0x105c52[_0x8b0c('0x1b')];_0x4f5bfb++){_0x26cb24[_0x8b0c('0x1c')](getTimezoneData(_0x105c52[_0x4f5bfb],tmp_voice_queues));}BPromise[_0x8b0c('0x1d')](_0x26cb24)['then'](function(){_0x476e98({'val':0x1});});})['catch'](function(_0x143e43){logger[_0x8b0c('0x58')](_0x143e43[_0x8b0c('0x59')]);_0x476e98({'val':0x0});});});}function getTimezoneData(_0x32a119,_0x3549a6){return new Promise(function(_0xf76201,_0x48b558){var _0x43cee9=shared[_0x8b0c('0x6b')];var _0x46341f=_0x43cee9[_0x32a119[_0x8b0c('0x6c')]];if(_[_0x8b0c('0x6d')](_0x46341f)){_0xf76201({'ret':0x1});}else{var _0x230d1f=_0x46341f[_0x8b0c('0x6e')];var _0x326bb7=squel[_0x8b0c('0x3b')]()[_0x8b0c('0x2c')](_0x3549a6)['set']('id',_0x32a119['id'])[_0x8b0c('0x6f')](_0x8b0c('0x70'),_0x230d1f)[_0x8b0c('0x6f')](_0x8b0c('0x6c'),_0x32a119['dialTimezone'])[_0x8b0c('0x42')]();return db[_0x8b0c('0x5c')]['query'](_0x326bb7)[_0x8b0c('0x5e')](function(_0x1e4df8){_0xf76201({'ret':0x1});})[_0x8b0c('0x5f')](function(_0x53d8f4){logger[_0x8b0c('0x58')](_0x53d8f4[_0x8b0c('0x59')]);_0x48b558({'ret':0x1});});}});}function handleTZQuery(_0x4b6fd7){logger['info'](_0x4b6fd7);return db[_0x8b0c('0x5c')][_0x8b0c('0x5d')](_0x4b6fd7)[_0x8b0c('0x5e')](function(_0x297f5f){})[_0x8b0c('0x5f')](function(_0x1a52de){logger[_0x8b0c('0x58')](_0x1a52de[_0x8b0c('0x59')]);});}function main(_0xe62b0c,_0x14a140,_0xc7005,_0x73512c){logger['info'](_0x8b0c('0x71'),_0xe62b0c,JSON['stringify'](_0x14a140));process[_0x8b0c('0x72')](_0x8b0c('0x73'));var _0x1842e9=_0x14a140[_0x8b0c('0x74')];var _0x2f6bf2=_[_0x8b0c('0x75')](_0x1842e9);var _0x4440d6=_0x14a140[_0x8b0c('0x76')];var _0x2a4529=path[_0x8b0c('0x13')](config['root'],'server/files/tmp',_0x4440d6+_0x8b0c('0x77'));hasTZ=_['keys'](_0x1842e9)[_0x8b0c('0x78')]('dialTimezone');var _0x5a78ee=_[_0x8b0c('0x79')](_0x1842e9)['join']();logger[_0x8b0c('0x56')]('header',_0x5a78ee);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0x8b0c('0x7a')]})[_0x8b0c('0x1a')](function(_0x4e03f6){for(var _0x41bcd3=0x0;_0x41bcd3<_0x4e03f6[_0x8b0c('0x1b')];_0x41bcd3++){if(_0x4e03f6[_0x41bcd3][_0x8b0c('0x7a')]in _0x1842e9){contactItemTypes[_0x8b0c('0x1c')](_0x4e03f6[_0x41bcd3]);delete _0x2f6bf2[_0x4e03f6[_0x41bcd3][_0x8b0c('0x7a')]];hasAdditionalPhones=!![];}for(var _0x59b418 in _0x1842e9){if(_0x4e03f6[_0x41bcd3][_0x8b0c('0x7a')]+_0x8b0c('0x7b')===_0x59b418){phoneDescriptions['push']({'itemTypeId':_0x4e03f6[_0x41bcd3]['id'],'description':_0x59b418});delete _0x2f6bf2[_0x59b418];}}}if(hasAdditionalPhones)_0x2f6bf2[_0x8b0c('0x19')]='';var _0x288850=_['keys'](_0x2f6bf2)['join']();logger[_0x8b0c('0x56')](_0x8b0c('0x7c'),_0x288850);fs[_0x8b0c('0x7d')](_0x2a4529,_0x288850+'\x0a');Papa[_0x8b0c('0x7e')](fs[_0x8b0c('0x7f')](_0xe62b0c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x566d95,_0x55f22e){try{for(var _0x36cb3e=0x0,_0x119946=[];_0x36cb3e<_0x566d95['data'][_0x8b0c('0x1b')];_0x36cb3e++){stats[_0x8b0c('0x80')]+=0x1;if(_0x566d95['errors'][_0x36cb3e]){handleError(_0x566d95[_0x8b0c('0x81')][_0x36cb3e],_0x566d95['errors'][_0x36cb3e]);}else{var _0x3b6294=[];var _0x4a22af=[];var _0xc66890={};for(var _0x19deeb in _0x1842e9){let _0x4729e2=contactItemTypes[_0x8b0c('0x82')](_0x2f3246=>_0x2f3246['name']===_0x19deeb);let _0x3c8fa8=contactItemTypes['find'](_0x4f4afe=>_0x4f4afe[_0x8b0c('0x7a')]+_0x8b0c('0x7b')===_0x19deeb);if(_[_0x8b0c('0x6d')](_0x4729e2)&&_[_0x8b0c('0x6d')](_0x3c8fa8)){if(_0x1842e9[_0x8b0c('0x83')](_0x19deeb)){if(_0x566d95[_0x8b0c('0x81')][_0x36cb3e][_0x1842e9[_0x19deeb]]){var _0x2d78fc=_['trim'](_0x566d95['data'][_0x36cb3e][_0x1842e9[_0x19deeb]][_0x8b0c('0x84')](/"/g,'\x27'));switch(_0x19deeb){case _0x8b0c('0x2e'):var _0x196e06=moment(_0x2d78fc,_0x8b0c('0xd'),!![]);if(_0x196e06['isValid']()){_0x119946[_0x8b0c('0x1c')]('\x22'+_0x2d78fc+'\x22');}else{_0x3b6294['push'](_0x8b0c('0x85'));}break;case'priority':var _0x408a97=parseInt(_0x2d78fc);_0x2d78fc=_[_0x8b0c('0x86')](_0x408a97)||_0x408a97<0x0||_0x408a97>0x4?_0x73512c?0x3:0x2:_0x408a97;_0x119946['push']('\x22'+_0x2d78fc+'\x22');break;case _0x8b0c('0x31'):var _0x2655e5=parseInt(_0x2d78fc);if(_[_0x8b0c('0x87')](_0x2655e5)&&_[_0x8b0c('0x78')](_0xc7005,_0x2655e5)){_0x119946[_0x8b0c('0x1c')]('\x22'+_0x2655e5+'\x22');}else{_0x3b6294[_0x8b0c('0x1c')](_0x8b0c('0x88'));}break;case'email':if(isEmail(_0x2d78fc)){_0x119946[_0x8b0c('0x1c')]('\x22'+_0x2d78fc+'\x22');}else{_0x3b6294[_0x8b0c('0x1c')](_0x8b0c('0x89'));}break;case _0x8b0c('0x8a'):var _0x56120a=moment(_0x2d78fc,_0x8b0c('0x8b'),!![]);if(_0x56120a[_0x8b0c('0x8c')]()){_0x119946['push']('\x22'+_0x2d78fc+'\x22');}else{_0x3b6294[_0x8b0c('0x1c')](_0x8b0c('0x8d'));}break;case _0x8b0c('0x6c'):var _0x3cc2f2=shared['timezones'];var _0x5846b7=_0x3cc2f2[_0x2d78fc];if(!_['isNil'](_0x5846b7)){var _0x25f382=_0x5846b7[_0x8b0c('0x6e')];_0x119946[_0x8b0c('0x1c')]('\x22'+_0x2d78fc+'\x22');_0x119946[_0x8b0c('0x1c')]('\x22'+_0x25f382+'\x22');}break;default:_0x119946[_0x8b0c('0x1c')]('\x22'+_0x2d78fc+'\x22');}}else{switch(_0x19deeb){case'firstName':case'phone':_0x3b6294[_0x8b0c('0x1c')](_0x19deeb+_0x8b0c('0x8e'));break;default:_0x119946[_0x8b0c('0x1c')]('\x22\x22');}}}}else{var _0x4ec33f='';if(!_[_0x8b0c('0x6d')](_0x4729e2)){if(!_0xc66890[_0x8b0c('0x83')](_0x4729e2['id'])){if(!_[_0x8b0c('0x6d')](_0x566d95[_0x8b0c('0x81')][_0x36cb3e][_0x1842e9[_0x19deeb]])){var _0x2d78fc=_[_0x8b0c('0x8f')](_0x566d95[_0x8b0c('0x81')][_0x36cb3e][_0x1842e9[_0x19deeb]][_0x8b0c('0x84')](/"/g,'\x27'));var _0x4970a7=phoneDescriptions['find'](_0xae9879=>_0xae9879[_0x8b0c('0x90')]===_0x4729e2['id']);if(!_[_0x8b0c('0x6d')](_0x4970a7)){var _0x48cdfa=_[_0x8b0c('0x8f')](_0x566d95[_0x8b0c('0x81')][_0x36cb3e][_0x1842e9[_0x4970a7[_0x8b0c('0x91')]]][_0x8b0c('0x84')](/"/g,'\x27'));if(!_[_0x8b0c('0x6d')](_0x48cdfa))_0x2d78fc=_0x2d78fc+'§'+_0x48cdfa;}if(_0x4ec33f=='')_0x4ec33f=_0x2d78fc;else _0x4ec33f+='|'+_0x2d78fc;}_0x4a22af['push'](_0x4729e2['id']+':'+_0x4ec33f);_0xc66890[_0x4729e2['id']]=0x1;}}}}if(hasAdditionalPhones){_0x119946[_0x8b0c('0x1c')]('\x22'+_0x4a22af[_0x8b0c('0x13')](';')+'\x22');}if(_0x3b6294['length']){handleError(_0x566d95[_0x8b0c('0x81')][_0x36cb3e],{'code':_0x8b0c('0x92'),'message':_0x3b6294[_0x8b0c('0x13')]()});}else{fs[_0x8b0c('0x93')](_0x2a4529,_0x119946['join']()+'\x0a');}_0x119946=[];}if(!(stats[_0x8b0c('0x80')]%0xc8)){socket[_0x8b0c('0x94')](_0x8b0c('0x95')+_0x4440d6,stats);stats['errors']=[];}}if(stopped){logger['info']('Abort\x20parser');_0x55f22e['abort']();}}catch(_0x4609fd){handleError(_0x566d95['data'][_0x36cb3e],{'code':_0x8b0c('0x96'),'message':_0x4609fd['message']});logger[_0x8b0c('0x58')](_0x8b0c('0x97'),_0x4609fd[_0x8b0c('0x59')]);}},'complete':function(){try{var _0x1480f8=[];var _0x3e41b6=[];var _0x19061e='cm_contacts';if(_0x14a140['duplicates']&&_0x14a140[_0x8b0c('0x98')]['length']){_0x19061e=_0x8b0c('0x99')+_0x4440d6;_0x1480f8[_0x8b0c('0x1c')](_0x8b0c('0x9a')+_0x19061e+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x8b0c('0x9b')+_0x4440d6;tmp_voice_queues=_0x8b0c('0x9c')+_0x4440d6;_0x3e41b6['push'](_0x8b0c('0x9a')+tmp_campaigns+_0x8b0c('0x9d'));_0x3e41b6[_0x8b0c('0x1c')](_0x8b0c('0x9a')+tmp_voice_queues+_0x8b0c('0x9d'));BPromise['each'](_0x3e41b6,handleTZQuery)['then'](function(_0x2d30c4){updateTzCampaigns(_0x14a140[_0x8b0c('0x2f')])[_0x8b0c('0x1a')](function(_0x153099){updateTzVoiceQueues(_0x14a140['ListId'])[_0x8b0c('0x1a')](function(_0x57b674){if(hasTZ)_0x288850=_0x288850[_0x8b0c('0x84')]('dialTimezone',_0x8b0c('0x9e'));var _0x430c53=util[_0x8b0c('0xc')](_0x8b0c('0x9f'),_0x2a4529,_0x19061e,_0x288850,_0x14a140[_0x8b0c('0x2f')],_0x14a140[_0x8b0c('0x50')]||null,NOW,NOW);if(_[_0x8b0c('0x6d')](_0x1842e9[_0x8b0c('0x2e')])){_0x430c53+=',\x20scheduledAt\x20=\x20NOW()';}_0x1480f8[_0x8b0c('0x1c')](_0x430c53);if(_0x14a140[_0x8b0c('0x98')]&&_0x14a140[_0x8b0c('0x98')][_0x8b0c('0x1b')]){_0x1480f8[_0x8b0c('0x1c')](insertCmContact(_0x14a140[_0x8b0c('0x2f')],_0x19061e,_0x14a140[_0x8b0c('0x98')],_0x1842e9));_0x1480f8[_0x8b0c('0x1c')](_0x8b0c('0xa0')+_0x19061e+';');}BPromise[_0x8b0c('0xa1')](_0x1480f8,handleQuery)[_0x8b0c('0x1a')](function(_0x12fc35){BPromise[_0x8b0c('0x1d')]([handleAdditionalPhones()])[_0x8b0c('0x1a')](function(){_0x1480f8=[];for(var _0x369c8a=0x0;_0x369c8a<promisesAdditionalPhones[_0x8b0c('0x1b')];_0x369c8a++){if(promisesAdditionalPhones[_0x369c8a][_0x8b0c('0x11')]!='§'){_0x1480f8['push'](createAdditionalPhone(promisesAdditionalPhones[_0x369c8a][_0x8b0c('0xa2')],promisesAdditionalPhones[_0x369c8a][_0x8b0c('0xa3')],promisesAdditionalPhones[_0x369c8a][_0x8b0c('0x11')],promisesAdditionalPhones[_0x369c8a][_0x8b0c('0xa4')]));}}BPromise[_0x8b0c('0x1d')](_0x1480f8)[_0x8b0c('0x1a')](function(){_0x1480f8=[];if(hasTZ){_0x1480f8[_0x8b0c('0x1c')](insertTzCmHopper(_0x14a140['ListId'],_0x8b0c('0xa5'),_0x8b0c('0x68'),_0x8b0c('0xa6'),_0x73512c,tmp_voice_queues));_0x1480f8[_0x8b0c('0x1c')](insertTzCmHopperBlack(_0x14a140['ListId'],_0x8b0c('0xa7'),_0x8b0c('0x68'),_0x8b0c('0xa6')));_0x1480f8[_0x8b0c('0x1c')](insertTzCmHopper(_0x14a140['ListId'],'campaigns_has_cm_lists','campaigns',_0x8b0c('0xa8'),_0x73512c,tmp_campaigns));_0x1480f8['push'](insertTzCmHopperBlack(_0x14a140[_0x8b0c('0x2f')],'campaigns_has_cm_blacklists',_0x8b0c('0x62'),_0x8b0c('0xa8')));_0x1480f8[_0x8b0c('0x1c')](insertCmHopperAdditionalPhones(_0x14a140[_0x8b0c('0x2f')]));}else{_0x1480f8[_0x8b0c('0x1c')](insertCmHopper(_0x14a140[_0x8b0c('0x2f')],_0x8b0c('0xa5'),_0x8b0c('0x68'),_0x8b0c('0xa6'),_0x73512c));_0x1480f8[_0x8b0c('0x1c')](insertCmHopperBlack(_0x14a140[_0x8b0c('0x2f')],_0x8b0c('0xa7'),_0x8b0c('0x68'),_0x8b0c('0xa6')));_0x1480f8[_0x8b0c('0x1c')](insertCmHopper(_0x14a140[_0x8b0c('0x2f')],_0x8b0c('0x63'),_0x8b0c('0x62'),'CampaignId',_0x73512c));_0x1480f8['push'](insertCmHopperBlack(_0x14a140['ListId'],_0x8b0c('0xa9'),_0x8b0c('0x62'),'CampaignId'));_0x1480f8[_0x8b0c('0x1c')](insertCmHopperAdditionalPhones(_0x14a140[_0x8b0c('0x2f')]));}_0x1480f8[_0x8b0c('0x1c')](_0x8b0c('0xa0')+tmp_campaigns+';');_0x1480f8[_0x8b0c('0x1c')](_0x8b0c('0xa0')+tmp_voice_queues+';');BPromise[_0x8b0c('0xa1')](_0x1480f8,handleQuery)[_0x8b0c('0x1a')](function(_0x546c85){stats['finish']=!![];stats[_0x8b0c('0xaa')]=_0x14a140[_0x8b0c('0x98')]&&_0x14a140[_0x8b0c('0x98')][_0x8b0c('0x1b')]?results[0x2]['affectedRows']:results[0x0][_0x8b0c('0xaa')];socket[_0x8b0c('0x94')](_0x8b0c('0x95')+_0x4440d6,stats);fs[_0x8b0c('0xab')](_0xe62b0c);fs[_0x8b0c('0xab')](_0x2a4529);process['exit'](0x0);})['catch'](function(_0xd427a2){logger['error'](_0xd427a2[_0x8b0c('0x59')]);process['exit'](0x1);});});});})[_0x8b0c('0x5f')](function(_0x49b317){logger[_0x8b0c('0x58')](_0x49b317[_0x8b0c('0x59')]);process[_0x8b0c('0x5a')](0x1);});});});});}catch(_0x1fb813){logger[_0x8b0c('0x58')](_0x8b0c('0xac'),_0x1fb813['message']);process[_0x8b0c('0x5a')](0x1);}},'error':function(_0x343eaf,_0x4bbb76,_0x37ed17,_0x3dc7e3){throw new Error(_0x3dc7e3);}});});}function validate(){if(process['argv']&&process[_0x8b0c('0xad')][_0x8b0c('0x1b')]<0x4){throw new Error(_0x8b0c('0xae'));}var _0x354cb8=path[_0x8b0c('0x13')](config['root'],_0x8b0c('0xaf'),process[_0x8b0c('0xad')][0x2]);if(!fs[_0x8b0c('0xb0')](_0x354cb8)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x4ee77f={};try{_0x4ee77f=JSON['parse'](process[_0x8b0c('0xad')][0x3]);if(!_0x4ee77f[_0x8b0c('0x74')]){throw new Error(_0x8b0c('0xb1'));}if(!_0x4ee77f[_0x8b0c('0x74')][_0x8b0c('0x11')]){throw new Error(_0x8b0c('0xb2'));}if(!_0x4ee77f[_0x8b0c('0x74')][_0x8b0c('0xb3')]){throw new Error(_0x8b0c('0xb4'));}var _0x4cf05c=0x0;if(_0x4ee77f['binding'][_0x8b0c('0x31')]){_0x4cf05c=0x1;}if(!_0x4ee77f[_0x8b0c('0x2f')]){throw new Error(_0x8b0c('0xb5'));}}catch(_0x3dd824){throw new Error(_0x8b0c('0xb6'));}var _0x1561aa=[];try{_0x1561aa=_['map'](JSON['parse'](process[_0x8b0c('0xad')][0x4]),'id');}catch(_0x3b6c5a){logger['info']('No\x20agent\x20available');}main(_0x354cb8,_0x4ee77f,_0x1561aa,_0x4cf05c);}validate();process['on']('SIGINT',handleStop);process['on'](_0x8b0c('0xb7'),handleUncaughtException);
\ No newline at end of file
index ced5f16..266d712 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf92=['cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','createdAt','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_hopper_black','ListId','ListId\x20=\x20?','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','updatedAt','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId','min_id','group','info','Received\x20SIGINT','exit','errors','code','message','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','_description','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','trim','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','description','replace','SystemRow','appendFileSync','contact:import:','Abort\x20parser','abort','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;',',\x20scheduledAt\x20=\x20NOW()','contactTypeId','each','finish','emit','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','format','cm_contacts_temp_','YYYYMMDDHHmmss','test','field','from','join','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','isNil','phone','AdditionalPhones','push','all','catch','error','split','length','then','CmContactHasItem','findOne','updated','create','PHONE','inserted','CmContact','CmHopper','update','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt'];(function(_0xc1fc49,_0x31601c){var _0x6c4f23=function(_0x3755d6){while(--_0x3755d6){_0xc1fc49['push'](_0xc1fc49['shift']());}};_0x6c4f23(++_0x31601c);}(_0xdf92,0x10c));var _0x2df9=function(_0x5aa6ce,_0x578f3b){_0x5aa6ce=_0x5aa6ce-0x0;var _0x4a1818=_0xdf92[_0x5aa6ce];return _0x4a1818;};'use strict';var fs=require('fs');var path=require(_0x2df9('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0x2df9('0x1'));var BPromise=require(_0x2df9('0x2'));var moment=require(_0x2df9('0x3'));var squel=require(_0x2df9('0x4'));var Redis=require(_0x2df9('0x5'));var db=require(_0x2df9('0x6'))['db'];var config=require(_0x2df9('0x7'));var logger=require(_0x2df9('0x8'))(_0x2df9('0x9'));config[_0x2df9('0xa')]=_['defaults'](config[_0x2df9('0xa')],{'host':_0x2df9('0xb'),'port':0x18eb});var socket=require(_0x2df9('0xc'))(new Redis(config[_0x2df9('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()[_0x2df9('0xd')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x2df9('0xe')+moment()[_0x2df9('0xd')](_0x2df9('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x5e4fa3){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))*$/[_0x2df9('0x10')](_0x5e4fa3);}function selectNotIn(_0x1f8a98,_0x1354e5,_0xe7c27a,_0x10e5f9,_0x4e304b){return squel['select']()[_0x2df9('0x11')]('phone')[_0x2df9('0x12')](_0x10e5f9)[_0x2df9('0x13')](_0x1354e5,null,_0x1354e5+'.id\x20=\x20'+_0x10e5f9+'.'+_0xe7c27a)['where'](_0x10e5f9+'.'+_0xe7c27a+_0x2df9('0x14')+_0x1f8a98+'.'+_0xe7c27a)[_0x2df9('0x15')](_0x1354e5+_0x2df9('0x16')+_0x4e304b[_0x2df9('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5737dc,_0x2dc037){promisesAdditionalPhones=[];promisesContact=[];return db[_0x2df9('0x17')][_0x2df9('0x18')](_0x2df9('0x19')+tempTableName)[_0x2df9('0x1a')](function(_0x544736){if(_0x544736!==null){var _0x1a955a=[];for(var _0x42e773=0x0;_0x42e773<_0x544736['length'];_0x42e773++){var _0x3eb28b=_0x544736[_0x42e773];if(!_[_0x2df9('0x1b')](_0x3eb28b[_0x2df9('0x1c')])){if(!_[_0x2df9('0x1b')](_0x3eb28b[_0x2df9('0x1d')]))_0x1a955a[_0x2df9('0x1e')](insertAdditionalPhones(_0x3eb28b));promisesContact['push']({'contact':_0x3eb28b});}}}Promise[_0x2df9('0x1f')](_0x1a955a)['then'](function(){_0x5737dc({'val':0x1});});})[_0x2df9('0x20')](function(_0x52cb44){logger[_0x2df9('0x21')](_0x52cb44['message']);});});}function insertAdditionalPhones(_0x1512ee){return new Promise(function(_0x41535f,_0x2bf7ff){var _0x110d9b=_0x1512ee[_0x2df9('0x1d')];if(_[_0x2df9('0x1b')](_0x110d9b))_0x2bf7ff({'val':0x0});else{var _0x254a24=_0x110d9b[_0x2df9('0x22')](';');var _0x4b70f5=[];orderBy=0x0;for(var _0x5a1586=0x0;_0x5a1586<_0x254a24[_0x2df9('0x23')];_0x5a1586++){_0x4b70f5['push'](splitAdditionalPhone(_0x1512ee['id'],_0x254a24[_0x5a1586]));}Promise[_0x2df9('0x1f')](_0x4b70f5)[_0x2df9('0x24')](function(){_0x41535f({'val':_0x254a24[_0x2df9('0x23')]});});}});}function splitAdditionalPhone(_0x294fea,_0x41150b){return new Promise(function(_0x392a10,_0x5cfcfa){var _0x5c77a0=_0x41150b['split'](':');var _0x59c2bb=_0x5c77a0[0x0];var _0x5d0a20=_0x5c77a0[0x1];if(_0x5d0a20!==''){var _0x438331=_0x5d0a20[_0x2df9('0x22')]('|');var _0x30c9d2=[];for(var _0x19855e=0x0;_0x19855e<_0x438331[_0x2df9('0x23')];_0x19855e++){if(_0x438331[_0x19855e]!==''){var _0x84464c=_['filter'](promisesAdditionalPhones,{'contactId':_0x294fea,'phone':_0x438331[_0x19855e]});if(_0x84464c[_0x2df9('0x23')]==0x0){orderBy++;promisesAdditionalPhones[_0x2df9('0x1e')]({'contactId':_0x294fea,'contactTypeId':_0x59c2bb,'phone':_0x438331[_0x19855e],'orderBy':orderBy});}}}_0x392a10({'ok':0x1});}else _0x392a10({'res':0x0});});}function createAdditionalPhone(_0x4fb250,_0x22437a,_0x588fe5,_0x214b70){var _0x48e33b='';var _0xec5c9f='';var _0x564aed=_0x588fe5[_0x2df9('0x22')]('§');_0x48e33b=_0x564aed[0x0];if(_0x564aed[_0x2df9('0x23')]==0x2)_0xec5c9f=_0x564aed[0x1];return new Promise(function(_0x5687ab,_0x1e06c6){return db[_0x2df9('0x25')][_0x2df9('0x26')]({'where':{'CmContactId':_0x4fb250,'item':_0x48e33b}})[_0x2df9('0x24')](function(_0x5d96f6){if(_0x5d96f6){return db[_0x2df9('0x25')]['update']({'ItemTypeId':_0x22437a,'description':_0xec5c9f,'OrderBy':_0x214b70},{'where':{'CmContactId':_0x4fb250,'item':_0x48e33b}})[_0x2df9('0x24')](function(_0x3f0a65){_0x5687ab({'res':_0x2df9('0x27')});});}else{return db[_0x2df9('0x25')][_0x2df9('0x28')]({'CmContactId':_0x4fb250,'item':_0x48e33b,'ItemTypeId':_0x22437a,'description':_0xec5c9f,'OrderBy':_0x214b70,'ItemClass':_0x2df9('0x29')})['then'](function(_0xe80ee0){_0x5687ab({'res':_0x2df9('0x2a')});});}});});}function updateContact(_0x4ea06a){return new Promise(function(_0x2957b4,_0x90ec05){var _0x366c60=_0x4ea06a['id'];delete _0x4ea06a['id'];return db[_0x2df9('0x2b')]['update'](_0x4ea06a,{'where':{'id':_0x366c60}})['then'](function(_0x40adff){updatedRows+=0x1;return db[_0x2df9('0x2c')][_0x2df9('0x2d')]({'phone':_0x4ea06a[_0x2df9('0x1c')]},{'where':{'ContactId':_0x366c60}})[_0x2df9('0x24')](function(_0x37c693){_0x2957b4({'ret':'OK'});});});});}function insertCmHopper(_0x1cef4a,_0x4ca5d8,_0x10c42f,_0xe3af8a,_0x3f720e){var _0x5cf2c7=[_0x2df9('0x2e'),_0x2df9('0x2f'),_0x2df9('0x30'),_0x2df9('0x31'),_0x4ca5d8+'.'+_0xe3af8a,_0x2df9('0x32'),_0x2df9('0x33'),'cm_contacts.priority',_0x2df9('0x34'),'\x22'+_0x3f720e+'\x22'];return squel[_0x2df9('0x35')]()[_0x2df9('0x36')]('cm_hopper')[_0x2df9('0x37')]([_0x2df9('0x1c'),_0x2df9('0x38'),_0x2df9('0x39'),'ListId',_0xe3af8a,_0x2df9('0x3a'),'updatedAt','priority',_0x2df9('0x3b'),_0x2df9('0x3c')],squel[_0x2df9('0x3d')]()[_0x2df9('0x3e')](_0x5cf2c7)['from'](_0x4ca5d8)[_0x2df9('0x13')](_0x2df9('0x3f'),null,_0x2df9('0x40')+_0x4ca5d8+_0x2df9('0x41'))[_0x2df9('0x13')](_0x10c42f,null,_0x10c42f+_0x2df9('0x42')+_0x4ca5d8+'.'+_0xe3af8a)[_0x2df9('0x15')](_0x4ca5d8+_0x2df9('0x43'),_0x1cef4a)[_0x2df9('0x15')](_0x2df9('0x44'),NOW)[_0x2df9('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4ca5d8,_0x10c42f,_0xe3af8a,_0x2df9('0x45'),[_0x2df9('0x46'),_0x2df9('0x47')]))[_0x2df9('0x15')](_0x2df9('0x48'),selectNotIn(_0x4ca5d8,_0x10c42f,_0xe3af8a,_0x2df9('0x45'),['\x22always\x22'])))[_0x2df9('0x49')]();}function insertCmHopperBlack(_0x3b9c9c,_0x49036c,_0x3d1bfa,_0x5cded2){var _0xee9410=[_0x2df9('0x2e'),_0x2df9('0x30'),_0x2df9('0x31'),_0x49036c+'.'+_0x5cded2,_0x2df9('0x32'),_0x2df9('0x33')];return squel[_0x2df9('0x35')]()[_0x2df9('0x36')](_0x2df9('0x4a'))[_0x2df9('0x37')]([_0x2df9('0x1c'),_0x2df9('0x39'),_0x2df9('0x4b'),_0x5cded2,_0x2df9('0x3a'),'updatedAt'],squel[_0x2df9('0x3d')]()['fields'](_0xee9410)['from'](_0x49036c)['join']('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x49036c+_0x2df9('0x41'))[_0x2df9('0x13')](_0x3d1bfa,null,_0x3d1bfa+_0x2df9('0x42')+_0x49036c+'.'+_0x5cded2)[_0x2df9('0x15')](_0x49036c+_0x2df9('0x43'),_0x3b9c9c)[_0x2df9('0x15')](_0x2df9('0x44'),NOW)[_0x2df9('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x2df9('0x3d')]()['field'](_0x2df9('0x1c'))[_0x2df9('0x12')](_0x2df9('0x4a'))['where'](_0x2df9('0x4c'),_0x3b9c9c)[_0x2df9('0x15')](_0x5cded2+'\x20=\x20?',_0x49036c+'.'+_0x5cded2)))[_0x2df9('0x49')]();}function insertCmHopperAdditionalPhones(_0x51ee59){var _0x400d44=['cm_hopper.id','cm_contact_has_items.item',_0x2df9('0x4d'),_0x2df9('0x4e'),'cm_contact_has_items.updatedAt'];return squel[_0x2df9('0x35')]()[_0x2df9('0x36')](_0x2df9('0x4f'))['fromQuery']([_0x2df9('0x50'),_0x2df9('0x1c'),_0x2df9('0x51'),_0x2df9('0x3a'),_0x2df9('0x52')],squel[_0x2df9('0x3d')]()[_0x2df9('0x3e')](_0x400d44)[_0x2df9('0x12')](_0x2df9('0x45'))[_0x2df9('0x13')](_0x2df9('0x3f'),null,_0x2df9('0x53'))[_0x2df9('0x13')](_0x2df9('0x54'),null,_0x2df9('0x55'))[_0x2df9('0x15')](_0x2df9('0x56'),_0x51ee59)[_0x2df9('0x15')](_0x2df9('0x44'),NOW))['toString']();}function insertCmContact(_0x206713,_0x2efdef,_0xef6af2,_0x37ce18){var _0x25b25c=_['concat'](_[_0x2df9('0x57')](_0x37ce18),[_0x2df9('0x4b'),_0x2df9('0x58'),_0x2df9('0x3a'),_0x2df9('0x52')]);return squel[_0x2df9('0x35')]()[_0x2df9('0x36')]('cm_contacts')['fromQuery'](_0x25b25c,squel[_0x2df9('0x3d')]()[_0x2df9('0x3e')](_0x25b25c)[_0x2df9('0x12')](_0x2efdef)[_0x2df9('0x15')]('('+_0xef6af2[_0x2df9('0x13')](',')+')\x20NOT\x20IN\x20?',squel[_0x2df9('0x3d')]()[_0x2df9('0x3e')](_0xef6af2)[_0x2df9('0x12')]('cm_contacts')[_0x2df9('0x15')]('ListId\x20=\x20?',_0x206713))[_0x2df9('0x15')]('id\x20IN\x20?',squel[_0x2df9('0x3d')]()[_0x2df9('0x11')]('MIN(id)',_0x2df9('0x59'))[_0x2df9('0x12')](_0x2efdef)[_0x2df9('0x5a')](_0xef6af2[_0x2df9('0x13')](','))))[_0x2df9('0x49')]();}function handleStop(){logger[_0x2df9('0x5b')](_0x2df9('0x5c'));stopped=!![];}function handleUncaughtException(_0x389070){logger[_0x2df9('0x21')](_0x389070['message']);process[_0x2df9('0x5d')](0x1);}function handleError(_0x296151,_0x1da3fd){stats[_0x2df9('0x5e')][_0x2df9('0x1e')]({'name':_0x1da3fd[_0x2df9('0x5f')],'message':_0x1da3fd[_0x2df9('0x60')],'row':_0x296151});}function handleQuery(_0x1202e6){logger[_0x2df9('0x5b')](_0x1202e6);return db['sequelize'][_0x2df9('0x18')](_0x1202e6)[_0x2df9('0x1a')](function(_0x3688fd){results[_0x2df9('0x1e')](_0x3688fd);})['catch'](function(_0x25e0a4){logger[_0x2df9('0x21')](_0x25e0a4[_0x2df9('0x60')]);});}function main(_0x2835df,_0x2045fd,_0x238f6d,_0x321bd8){logger['info'](_0x2df9('0x61'),_0x2835df,JSON[_0x2df9('0x62')](_0x2045fd));process[_0x2df9('0x63')](_0x2df9('0x64'));var _0x475848=_0x2045fd[_0x2df9('0x65')];var _0x28e3d9=_['clone'](_0x475848);var _0x5a0188=_0x2045fd[_0x2df9('0x66')];var _0x3a97d9=path['join'](config[_0x2df9('0x67')],_0x2df9('0x68'),_0x5a0188+_0x2df9('0x69'));logger['info'](_0x2df9('0x6a'),_0x2045fd);db[_0x2df9('0x6b')][_0x2df9('0x6c')]({'raw':!![],'attributes':['id',_0x2df9('0x6d')]})[_0x2df9('0x24')](function(_0x29d080){for(var _0x4268a1=0x0;_0x4268a1<_0x29d080[_0x2df9('0x23')];_0x4268a1++){if(_0x29d080[_0x4268a1][_0x2df9('0x6d')]in _0x475848){contactItemTypes[_0x2df9('0x1e')](_0x29d080[_0x4268a1]);delete _0x28e3d9[_0x29d080[_0x4268a1][_0x2df9('0x6d')]];hasAdditionalPhones=!![];}for(var _0x4df79c in _0x475848){if(_0x29d080[_0x4268a1][_0x2df9('0x6d')]+_0x2df9('0x6e')===_0x4df79c){phoneDescriptions[_0x2df9('0x1e')]({'itemTypeId':_0x29d080[_0x4268a1]['id'],'description':_0x4df79c});delete _0x28e3d9[_0x4df79c];}}}if(hasAdditionalPhones)_0x28e3d9[_0x2df9('0x1d')]='';var _0x3eb170=_[_0x2df9('0x57')](_0x28e3d9)['join']();logger[_0x2df9('0x5b')]('header',_0x3eb170);fs[_0x2df9('0x6f')](_0x3a97d9,_0x3eb170+'\x0a');Papa[_0x2df9('0x70')](fs[_0x2df9('0x71')](_0x2835df),{'header':!![],'skipEmptyLines':!![],'step':function(_0x360c91,_0x2ec150){try{for(var _0x542124=0x0,_0x43459c=[];_0x542124<_0x360c91[_0x2df9('0x72')]['length'];_0x542124++){stats[_0x2df9('0x73')]+=0x1;if(_0x360c91[_0x2df9('0x5e')][_0x542124]){handleError(_0x360c91[_0x2df9('0x72')][_0x542124],_0x360c91[_0x2df9('0x5e')][_0x542124]);}else{var _0x21828d=[];var _0x56d5f2=[];var _0x3b42b1={};for(var _0x106822 in _0x475848){let _0x2e0d98=contactItemTypes[_0x2df9('0x74')](_0x57601b=>_0x57601b[_0x2df9('0x6d')]===_0x106822);let _0x47048a=contactItemTypes[_0x2df9('0x74')](_0x264f7f=>_0x264f7f['name']+_0x2df9('0x6e')===_0x106822);if(_[_0x2df9('0x1b')](_0x2e0d98)&&_[_0x2df9('0x1b')](_0x47048a)){if(_0x475848[_0x2df9('0x75')](_0x106822)){if(_0x360c91[_0x2df9('0x72')][_0x542124][_0x475848[_0x106822]]){var _0x27ffb9=_[_0x2df9('0x76')](_0x360c91['data'][_0x542124][_0x475848[_0x106822]]['replace'](/"/g,'\x27'));switch(_0x106822){case _0x2df9('0x38'):var _0x20bb7e=moment(_0x27ffb9,_0x2df9('0x77'),!![]);if(_0x20bb7e[_0x2df9('0x78')]()){_0x43459c[_0x2df9('0x1e')]('\x22'+_0x27ffb9+'\x22');}else{_0x21828d[_0x2df9('0x1e')](_0x2df9('0x79'));}break;case _0x2df9('0x7a'):var _0x18c81b=parseInt(_0x27ffb9);_0x27ffb9=_[_0x2df9('0x7b')](_0x18c81b)||_0x18c81b<0x0||_0x18c81b>0x4?_0x321bd8?0x3:0x2:_0x18c81b;_0x43459c[_0x2df9('0x1e')]('\x22'+_0x27ffb9+'\x22');break;case _0x2df9('0x3b'):var _0x26f977=parseInt(_0x27ffb9);if(_['isNumber'](_0x26f977)&&_[_0x2df9('0x7c')](_0x238f6d,_0x26f977)){_0x43459c[_0x2df9('0x1e')]('\x22'+_0x26f977+'\x22');}else{_0x21828d['push'](_0x2df9('0x7d'));}break;case _0x2df9('0x7e'):if(isEmail(_0x27ffb9)){_0x43459c[_0x2df9('0x1e')]('\x22'+_0x27ffb9+'\x22');}else{_0x21828d[_0x2df9('0x1e')](_0x2df9('0x7f'));}break;case'dateOfBirth':var _0x1e6ac2=moment(_0x27ffb9,_0x2df9('0x80'),!![]);if(_0x1e6ac2[_0x2df9('0x78')]()){_0x43459c[_0x2df9('0x1e')]('\x22'+_0x27ffb9+'\x22');}else{_0x21828d[_0x2df9('0x1e')](_0x2df9('0x81'));}break;default:_0x43459c[_0x2df9('0x1e')]('\x22'+_0x27ffb9+'\x22');}}else{switch(_0x106822){case _0x2df9('0x82'):case _0x2df9('0x1c'):_0x21828d['push'](_0x106822+_0x2df9('0x83'));break;default:_0x43459c[_0x2df9('0x1e')]('\x22\x22');}}}}else{var _0x2d378b='';if(!_[_0x2df9('0x1b')](_0x2e0d98)){if(!_0x3b42b1[_0x2df9('0x75')](_0x2e0d98['id'])){for(var _0x4740e6=0x0;_0x4740e6<_0x475848[_0x106822][_0x2df9('0x23')];_0x4740e6++){var _0x27ffb9=_[_0x2df9('0x76')](_0x360c91['data'][_0x542124][_0x475848[_0x106822][_0x4740e6]]['replace'](/"/g,'\x27'));var _0x6bc48=phoneDescriptions[_0x2df9('0x74')](_0x1118fe=>_0x1118fe[_0x2df9('0x84')]===_0x2e0d98['id']);if(!_['isNil'](_0x6bc48)){var _0x17bc1b=_[_0x2df9('0x76')](_0x360c91[_0x2df9('0x72')][_0x542124][_0x475848[_0x6bc48[_0x2df9('0x85')]][0x0]][_0x2df9('0x86')](/"/g,'\x27'));if(!_[_0x2df9('0x1b')](_0x17bc1b))_0x27ffb9=_0x27ffb9+'§'+_0x17bc1b;}if(_0x2d378b=='')_0x2d378b=_0x27ffb9;else _0x2d378b+='|'+_0x27ffb9;}_0x56d5f2['push'](_0x2e0d98['id']+':'+_0x2d378b);_0x3b42b1[_0x2e0d98['id']]=0x1;}}}}if(hasAdditionalPhones){_0x43459c[_0x2df9('0x1e')]('\x22'+_0x56d5f2[_0x2df9('0x13')](';')+'\x22');}if(_0x21828d[_0x2df9('0x23')]){handleError(_0x360c91['data'][_0x542124],{'code':_0x2df9('0x87'),'message':_0x21828d['join']()});}else{fs[_0x2df9('0x88')](_0x3a97d9,_0x43459c[_0x2df9('0x13')]()+'\x0a');}_0x43459c=[];}if(!(stats[_0x2df9('0x73')]%0xc8)){socket['emit'](_0x2df9('0x89')+_0x5a0188,stats);stats[_0x2df9('0x5e')]=[];}}if(stopped){logger[_0x2df9('0x5b')](_0x2df9('0x8a'));_0x2ec150[_0x2df9('0x8b')]();}}catch(_0x30af67){handleError(_0x360c91[_0x2df9('0x72')][_0x542124],{'code':_0x2df9('0x8c'),'message':_0x30af67[_0x2df9('0x60')]});logger[_0x2df9('0x21')](_0x2df9('0x8d'),_0x30af67['message']);}},'complete':function(){try{var _0x211ad2=[];var _0x5ea36f=tempTableName;_0x211ad2[_0x2df9('0x1e')](_0x2df9('0x8e')+_0x5ea36f+_0x2df9('0x8f'));logger[_0x2df9('0x5b')]('CIS\x20len',contactItemTypes[_0x2df9('0x23')]);var _0x1b274e=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x3a97d9,_0x5ea36f,_0x3eb170,_0x2045fd['ListId'],_0x2045fd[_0x2df9('0x58')]||null,NOW,NOW);if(_[_0x2df9('0x1b')](_0x475848['scheduledat'])){_0x1b274e+=_0x2df9('0x90');}_0x211ad2[_0x2df9('0x1e')](_0x1b274e);BPromise['each'](_0x211ad2,handleQuery)[_0x2df9('0x24')](function(_0x31dc6b){BPromise[_0x2df9('0x1f')]([handleAdditionalPhones()])[_0x2df9('0x24')](function(){_0x211ad2=[];for(var _0x108089=0x0;_0x108089<promisesContact[_0x2df9('0x23')];_0x108089++){_0x211ad2[_0x2df9('0x1e')](updateContact(promisesContact[_0x108089]['contact']));}BPromise[_0x2df9('0x1f')](_0x211ad2)[_0x2df9('0x24')](function(){_0x211ad2=[];for(var _0x384663=0x0;_0x384663<promisesAdditionalPhones['length'];_0x384663++){_0x211ad2['push'](createAdditionalPhone(promisesAdditionalPhones[_0x384663]['contactId'],promisesAdditionalPhones[_0x384663][_0x2df9('0x91')],promisesAdditionalPhones[_0x384663][_0x2df9('0x1c')],promisesAdditionalPhones[_0x384663]['orderBy']));}BPromise[_0x2df9('0x1f')](_0x211ad2)[_0x2df9('0x24')](function(){_0x211ad2=[];_0x211ad2[_0x2df9('0x1e')](insertCmHopperAdditionalPhones(_0x2045fd[_0x2df9('0x4b')]));_0x211ad2[_0x2df9('0x1e')]('DROP\x20TABLE\x20'+_0x5ea36f+';');BPromise[_0x2df9('0x92')](_0x211ad2,handleQuery)[_0x2df9('0x24')](function(_0x345d20){stats[_0x2df9('0x93')]=!![];stats['affectedRows']=updatedRows;socket[_0x2df9('0x94')](_0x2df9('0x89')+_0x5a0188,stats);fs['unlink'](_0x2835df);fs[_0x2df9('0x95')](_0x3a97d9);process[_0x2df9('0x5d')](0x0);})[_0x2df9('0x20')](function(_0x4c0efc){logger[_0x2df9('0x21')](_0x4c0efc[_0x2df9('0x60')]);process[_0x2df9('0x5d')](0x1);});});});});})[_0x2df9('0x20')](function(_0x2adbc5){logger[_0x2df9('0x21')](_0x2adbc5[_0x2df9('0x60')]);process[_0x2df9('0x5d')](0x1);});}catch(_0x39ae10){logger[_0x2df9('0x21')](_0x2df9('0x96'),_0x39ae10[_0x2df9('0x60')]);process[_0x2df9('0x5d')](0x1);}},'error':function(_0x367a96,_0x2ebeb1,_0x25cfd5,_0x9c6374){throw new Error(_0x9c6374);}});});}function validate(){if(process[_0x2df9('0x97')]&&process[_0x2df9('0x97')][_0x2df9('0x23')]<0x4){throw new Error(_0x2df9('0x98'));}var _0x1159ed=path[_0x2df9('0x13')](config[_0x2df9('0x67')],_0x2df9('0x68'),process[_0x2df9('0x97')][0x2]);if(!fs[_0x2df9('0x99')](_0x1159ed)){throw new Error(_0x2df9('0x9a'));}var _0x42112f={};try{_0x42112f=JSON[_0x2df9('0x70')](process[_0x2df9('0x97')][0x3]);if(!_0x42112f[_0x2df9('0x65')]){throw new Error(_0x2df9('0x9b'));}var _0x12505e=0x0;if(_0x42112f[_0x2df9('0x65')][_0x2df9('0x3b')]){_0x12505e=0x1;}if(!_0x42112f[_0x2df9('0x4b')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x3c5925){throw new Error(_0x2df9('0x9c'));}var _0x1000d5=[];try{_0x1000d5=_[_0x2df9('0x9d')](JSON['parse'](process[_0x2df9('0x97')][0x4]),'id');}catch(_0x279eb6){logger[_0x2df9('0x5b')](_0x2df9('0x9e'));}main(_0x1159ed,_0x42112f,_0x1000d5,_0x12505e);}validate();process['on'](_0x2df9('0x9f'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
+var _0x1527=['trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','description','replace','SystemRow','appendFileSync','contact:import:','Abort\x20parser','SystemError','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()','contact','orderBy','DROP\x20TABLE\x20','finish','affectedRows','unlink','complete','arguments\x20<filename>\x20<parameters>\x20<agents>','root','argv','existsSync','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','No\x20agent\x20available','lodash','papaparse','util','bluebird','ioredis','../../../mysqldb','../../../config/logger','import','defaults','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','from','join','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','phone','isNil','push','all','catch','error','AdditionalPhones','split','length','then','filter','CmContactHasItem','update','updated','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.phone','cm_hopper_black','\x20=\x20?','cm_hopper.id','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','exit','errors','message','spread','main','stringify','start','binding','clone','socket_timestamp','server/files/tmp','.csv','body','ContactItemType','findAll','name','_description','header','parse','createReadStream','data','rows','find','hasOwnProperty'];(function(_0x4d718d,_0x4e4e92){var _0x51a9d2=function(_0xdff4a7){while(--_0xdff4a7){_0x4d718d['push'](_0x4d718d['shift']());}};_0x51a9d2(++_0x4e4e92);}(_0x1527,0xc1));var _0x7152=function(_0x138d06,_0x33edf2){_0x138d06=_0x138d06-0x0;var _0x1a01eb=_0x1527[_0x138d06];return _0x1a01eb;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x7152('0x0'));var Papa=require(_0x7152('0x1'));var util=require(_0x7152('0x2'));var BPromise=require(_0x7152('0x3'));var moment=require('moment');var squel=require('squel');var Redis=require(_0x7152('0x4'));var db=require(_0x7152('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x7152('0x6'))(_0x7152('0x7'));config['redis']=_[_0x7152('0x8')](config[_0x7152('0x9')],{'host':_0x7152('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7152('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x7152('0xb')](_0x7152('0xc'));var tempTableName=_0x7152('0xd')+moment()[_0x7152('0xb')](_0x7152('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x5750e6){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))*$/[_0x7152('0xf')](_0x5750e6);}function selectNotIn(_0x24b460,_0xb4f00f,_0x332883,_0x236f60,_0x5cae05){return squel[_0x7152('0x10')]()[_0x7152('0x11')]('phone')[_0x7152('0x12')](_0x236f60)[_0x7152('0x13')](_0xb4f00f,null,_0xb4f00f+'.id\x20=\x20'+_0x236f60+'.'+_0x332883)['where'](_0x236f60+'.'+_0x332883+'\x20=\x20'+_0x24b460+'.'+_0x332883)[_0x7152('0x14')](_0xb4f00f+_0x7152('0x15')+_0x5cae05[_0x7152('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x49d976,_0x50d53b){promisesAdditionalPhones=[];promisesContact=[];return db[_0x7152('0x16')][_0x7152('0x17')](_0x7152('0x18')+tempTableName)['spread'](function(_0x589716){if(_0x589716!==null){var _0x171191=[];for(var _0x58ce3e=0x0;_0x58ce3e<_0x589716['length'];_0x58ce3e++){var _0x1ab8f7=_0x589716[_0x58ce3e];if(!_['isNil'](_0x1ab8f7[_0x7152('0x19')])){if(!_[_0x7152('0x1a')](_0x1ab8f7['AdditionalPhones']))_0x171191['push'](insertAdditionalPhones(_0x1ab8f7));promisesContact[_0x7152('0x1b')]({'contact':_0x1ab8f7});}}}Promise[_0x7152('0x1c')](_0x171191)['then'](function(){_0x49d976({'val':0x1});});})[_0x7152('0x1d')](function(_0x9216ad){logger[_0x7152('0x1e')](_0x9216ad['message']);});});}function insertAdditionalPhones(_0x4bb541){return new Promise(function(_0x1720c9,_0x14b63d){var _0x2f37a7=_0x4bb541[_0x7152('0x1f')];if(_[_0x7152('0x1a')](_0x2f37a7))_0x14b63d({'val':0x0});else{var _0x566bf7=_0x2f37a7[_0x7152('0x20')](';');var _0x149c64=[];orderBy=0x0;for(var _0x241c98=0x0;_0x241c98<_0x566bf7[_0x7152('0x21')];_0x241c98++){_0x149c64[_0x7152('0x1b')](splitAdditionalPhone(_0x4bb541['id'],_0x566bf7[_0x241c98]));}Promise['all'](_0x149c64)[_0x7152('0x22')](function(){_0x1720c9({'val':_0x566bf7[_0x7152('0x21')]});});}});}function splitAdditionalPhone(_0xf019d5,_0x15bc75){return new Promise(function(_0x3448e7,_0xf42a6e){var _0x3bd935=_0x15bc75[_0x7152('0x20')](':');var _0x578576=_0x3bd935[0x0];var _0x4671bf=_0x3bd935[0x1];if(_0x4671bf!==''){var _0x421a8c=_0x4671bf[_0x7152('0x20')]('|');var _0x3aff43=[];for(var _0x36c73b=0x0;_0x36c73b<_0x421a8c['length'];_0x36c73b++){if(_0x421a8c[_0x36c73b]!==''){var _0x286194=_[_0x7152('0x23')](promisesAdditionalPhones,{'contactId':_0xf019d5,'phone':_0x421a8c[_0x36c73b]});if(_0x286194[_0x7152('0x21')]==0x0){orderBy++;promisesAdditionalPhones[_0x7152('0x1b')]({'contactId':_0xf019d5,'contactTypeId':_0x578576,'phone':_0x421a8c[_0x36c73b],'orderBy':orderBy});}}}_0x3448e7({'ok':0x1});}else _0x3448e7({'res':0x0});});}function createAdditionalPhone(_0x437fa1,_0x2b0b2b,_0x51fb5c,_0x1d71f4){var _0x37b821='';var _0x2e22bf='';var _0x39ae3b=_0x51fb5c[_0x7152('0x20')]('§');_0x37b821=_0x39ae3b[0x0];if(_0x39ae3b[_0x7152('0x21')]==0x2)_0x2e22bf=_0x39ae3b[0x1];return new Promise(function(_0x160db3,_0xb312dd){return db[_0x7152('0x24')]['findOne']({'where':{'CmContactId':_0x437fa1,'item':_0x37b821}})[_0x7152('0x22')](function(_0x20563f){if(_0x20563f){return db['CmContactHasItem'][_0x7152('0x25')]({'ItemTypeId':_0x2b0b2b,'description':_0x2e22bf,'OrderBy':_0x1d71f4},{'where':{'CmContactId':_0x437fa1,'item':_0x37b821}})[_0x7152('0x22')](function(_0x583500){_0x160db3({'res':_0x7152('0x26')});});}else{return db[_0x7152('0x24')][_0x7152('0x27')]({'CmContactId':_0x437fa1,'item':_0x37b821,'ItemTypeId':_0x2b0b2b,'description':_0x2e22bf,'OrderBy':_0x1d71f4,'ItemClass':_0x7152('0x28')})[_0x7152('0x22')](function(_0x1fd81e){_0x160db3({'res':_0x7152('0x29')});});}});});}function updateContact(_0x578115){return new Promise(function(_0x4bf305,_0x153aa9){var _0x446a50=_0x578115['id'];delete _0x578115['id'];return db[_0x7152('0x2a')][_0x7152('0x25')](_0x578115,{'where':{'id':_0x446a50}})['then'](function(_0x27c05b){updatedRows+=0x1;return db[_0x7152('0x2b')][_0x7152('0x25')]({'phone':_0x578115[_0x7152('0x19')]},{'where':{'ContactId':_0x446a50}})[_0x7152('0x22')](function(_0x199b26){_0x4bf305({'ret':'OK'});});});});}function insertCmHopper(_0xafc1a5,_0xf8bd12,_0x3a7742,_0xd9a54d,_0x48f2d7){var _0x2ff914=['cm_contacts.phone',_0x7152('0x2c'),_0x7152('0x2d'),_0x7152('0x2e'),_0xf8bd12+'.'+_0xd9a54d,_0x7152('0x2f'),_0x7152('0x30'),_0x7152('0x31'),_0x7152('0x32'),'\x22'+_0x48f2d7+'\x22'];return squel[_0x7152('0x33')]()[_0x7152('0x34')](_0x7152('0x35'))[_0x7152('0x36')]([_0x7152('0x19'),_0x7152('0x37'),_0x7152('0x38'),_0x7152('0x39'),_0xd9a54d,_0x7152('0x3a'),_0x7152('0x3b'),_0x7152('0x3c'),_0x7152('0x3d'),_0x7152('0x3e')],squel[_0x7152('0x10')]()[_0x7152('0x3f')](_0x2ff914)[_0x7152('0x12')](_0xf8bd12)[_0x7152('0x13')](_0x7152('0x40'),null,_0x7152('0x41')+_0xf8bd12+_0x7152('0x42'))[_0x7152('0x13')](_0x3a7742,null,_0x3a7742+_0x7152('0x43')+_0xf8bd12+'.'+_0xd9a54d)['where'](_0xf8bd12+_0x7152('0x44'),_0xafc1a5)[_0x7152('0x14')](_0x7152('0x45'),NOW)[_0x7152('0x14')](_0x7152('0x46'),selectNotIn(_0xf8bd12,_0x3a7742,_0xd9a54d,_0x7152('0x35'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x7152('0x14')](_0x7152('0x46'),selectNotIn(_0xf8bd12,_0x3a7742,_0xd9a54d,_0x7152('0x35'),[_0x7152('0x47')])))[_0x7152('0x48')]();}function insertCmHopperBlack(_0x2371d7,_0x3249d5,_0x4cc0e5,_0x5b4e8c){var _0x5d317f=[_0x7152('0x49'),_0x7152('0x2d'),_0x7152('0x2e'),_0x3249d5+'.'+_0x5b4e8c,_0x7152('0x2f'),_0x7152('0x30')];return squel[_0x7152('0x33')]()[_0x7152('0x34')](_0x7152('0x4a'))[_0x7152('0x36')]([_0x7152('0x19'),_0x7152('0x38'),_0x7152('0x39'),_0x5b4e8c,_0x7152('0x3a'),'updatedAt'],squel[_0x7152('0x10')]()[_0x7152('0x3f')](_0x5d317f)['from'](_0x3249d5)['join'](_0x7152('0x40'),null,_0x7152('0x41')+_0x3249d5+_0x7152('0x42'))[_0x7152('0x13')](_0x4cc0e5,null,_0x4cc0e5+'.id\x20=\x20'+_0x3249d5+'.'+_0x5b4e8c)[_0x7152('0x14')](_0x3249d5+'.CmListId\x20=\x20?',_0x2371d7)['where'](_0x7152('0x45'),NOW)[_0x7152('0x14')](_0x7152('0x46'),squel['select']()[_0x7152('0x11')]('phone')['from'](_0x7152('0x4a'))[_0x7152('0x14')]('ListId\x20=\x20?',_0x2371d7)[_0x7152('0x14')](_0x5b4e8c+_0x7152('0x4b'),_0x3249d5+'.'+_0x5b4e8c)))[_0x7152('0x48')]();}function insertCmHopperAdditionalPhones(_0x5902da){var _0x45145f=[_0x7152('0x4c'),'cm_contact_has_items.item','cm_contact_has_items.OrderBy',_0x7152('0x4d'),_0x7152('0x4e')];return squel[_0x7152('0x33')]()['into']('cm_hopper_additional_phones')[_0x7152('0x36')](['CmHopperId','phone',_0x7152('0x4f'),_0x7152('0x3a'),_0x7152('0x3b')],squel[_0x7152('0x10')]()['fields'](_0x45145f)[_0x7152('0x12')](_0x7152('0x35'))['join']('cm_contacts',null,_0x7152('0x50'))[_0x7152('0x13')](_0x7152('0x51'),null,_0x7152('0x52'))[_0x7152('0x14')](_0x7152('0x53'),_0x5902da)[_0x7152('0x14')](_0x7152('0x45'),NOW))[_0x7152('0x48')]();}function insertCmContact(_0x5dded9,_0x439b45,_0x75bb02,_0x581bfe){var _0x2469db=_[_0x7152('0x54')](_[_0x7152('0x55')](_0x581bfe),[_0x7152('0x39'),_0x7152('0x56'),'createdAt','updatedAt']);return squel[_0x7152('0x33')]()[_0x7152('0x34')]('cm_contacts')[_0x7152('0x36')](_0x2469db,squel[_0x7152('0x10')]()['fields'](_0x2469db)[_0x7152('0x12')](_0x439b45)[_0x7152('0x14')]('('+_0x75bb02[_0x7152('0x13')](',')+_0x7152('0x57'),squel[_0x7152('0x10')]()[_0x7152('0x3f')](_0x75bb02)['from'](_0x7152('0x40'))['where'](_0x7152('0x58'),_0x5dded9))[_0x7152('0x14')](_0x7152('0x59'),squel[_0x7152('0x10')]()[_0x7152('0x11')](_0x7152('0x5a'),_0x7152('0x5b'))[_0x7152('0x12')](_0x439b45)[_0x7152('0x5c')](_0x75bb02['join'](','))))[_0x7152('0x48')]();}function handleStop(){logger[_0x7152('0x5d')](_0x7152('0x5e'));stopped=!![];}function handleUncaughtException(_0x3490e0){logger[_0x7152('0x1e')](_0x3490e0['message']);process[_0x7152('0x5f')](0x1);}function handleError(_0x4284a7,_0xe1fd4e){stats[_0x7152('0x60')][_0x7152('0x1b')]({'name':_0xe1fd4e['code'],'message':_0xe1fd4e[_0x7152('0x61')],'row':_0x4284a7});}function handleQuery(_0x19fc7a){logger[_0x7152('0x5d')](_0x19fc7a);return db[_0x7152('0x16')]['query'](_0x19fc7a)[_0x7152('0x62')](function(_0x276a8e){results[_0x7152('0x1b')](_0x276a8e);})[_0x7152('0x1d')](function(_0x6456ed){logger[_0x7152('0x1e')](_0x6456ed[_0x7152('0x61')]);});}function main(_0x175925,_0x46fc6f,_0x1466ee,_0x25628c){logger[_0x7152('0x5d')](_0x7152('0x63'),_0x175925,JSON[_0x7152('0x64')](_0x46fc6f));process['send'](_0x7152('0x65'));var _0x32d255=_0x46fc6f[_0x7152('0x66')];var _0x4a20ab=_[_0x7152('0x67')](_0x32d255);var _0x1bffe1=_0x46fc6f[_0x7152('0x68')];var _0x8bcf44=path[_0x7152('0x13')](config['root'],_0x7152('0x69'),_0x1bffe1+_0x7152('0x6a'));logger[_0x7152('0x5d')](_0x7152('0x6b'),_0x46fc6f);db[_0x7152('0x6c')][_0x7152('0x6d')]({'raw':!![],'attributes':['id',_0x7152('0x6e')]})['then'](function(_0x36b2e8){for(var _0x5c1b01=0x0;_0x5c1b01<_0x36b2e8[_0x7152('0x21')];_0x5c1b01++){if(_0x36b2e8[_0x5c1b01][_0x7152('0x6e')]in _0x32d255){contactItemTypes[_0x7152('0x1b')](_0x36b2e8[_0x5c1b01]);delete _0x4a20ab[_0x36b2e8[_0x5c1b01][_0x7152('0x6e')]];hasAdditionalPhones=!![];}for(var _0x51e27c in _0x32d255){if(_0x36b2e8[_0x5c1b01][_0x7152('0x6e')]+_0x7152('0x6f')===_0x51e27c){phoneDescriptions[_0x7152('0x1b')]({'itemTypeId':_0x36b2e8[_0x5c1b01]['id'],'description':_0x51e27c});delete _0x4a20ab[_0x51e27c];}}}if(hasAdditionalPhones)_0x4a20ab['AdditionalPhones']='';var _0x46e036=_['keys'](_0x4a20ab)[_0x7152('0x13')]();logger[_0x7152('0x5d')](_0x7152('0x70'),_0x46e036);fs['writeFileSync'](_0x8bcf44,_0x46e036+'\x0a');Papa[_0x7152('0x71')](fs[_0x7152('0x72')](_0x175925),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3ae527,_0xf81f4b){try{for(var _0xa542a9=0x0,_0x47aa7d=[];_0xa542a9<_0x3ae527[_0x7152('0x73')][_0x7152('0x21')];_0xa542a9++){stats[_0x7152('0x74')]+=0x1;if(_0x3ae527[_0x7152('0x60')][_0xa542a9]){handleError(_0x3ae527[_0x7152('0x73')][_0xa542a9],_0x3ae527['errors'][_0xa542a9]);}else{var _0x40c05d=[];var _0x5de750=[];var _0x178eef={};for(var _0x116766 in _0x32d255){let _0xc78140=contactItemTypes[_0x7152('0x75')](_0x5a4efc=>_0x5a4efc[_0x7152('0x6e')]===_0x116766);let _0x2ee20b=contactItemTypes[_0x7152('0x75')](_0x51f16b=>_0x51f16b[_0x7152('0x6e')]+_0x7152('0x6f')===_0x116766);if(_['isNil'](_0xc78140)&&_[_0x7152('0x1a')](_0x2ee20b)){if(_0x32d255[_0x7152('0x76')](_0x116766)){if(_0x3ae527['data'][_0xa542a9][_0x32d255[_0x116766]]){var _0x4ec58c=_[_0x7152('0x77')](_0x3ae527[_0x7152('0x73')][_0xa542a9][_0x32d255[_0x116766]]['replace'](/"/g,'\x27'));switch(_0x116766){case _0x7152('0x37'):var _0x10a6dd=moment(_0x4ec58c,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x10a6dd[_0x7152('0x78')]()){_0x47aa7d[_0x7152('0x1b')]('\x22'+_0x4ec58c+'\x22');}else{_0x40c05d['push'](_0x7152('0x79'));}break;case _0x7152('0x3c'):var _0x4b9bf2=parseInt(_0x4ec58c);_0x4ec58c=_[_0x7152('0x7a')](_0x4b9bf2)||_0x4b9bf2<0x0||_0x4b9bf2>0x4?_0x25628c?0x3:0x2:_0x4b9bf2;_0x47aa7d[_0x7152('0x1b')]('\x22'+_0x4ec58c+'\x22');break;case _0x7152('0x3d'):var _0x453fc6=parseInt(_0x4ec58c);if(_['isNumber'](_0x453fc6)&&_['includes'](_0x1466ee,_0x453fc6)){_0x47aa7d[_0x7152('0x1b')]('\x22'+_0x453fc6+'\x22');}else{_0x40c05d[_0x7152('0x1b')](_0x7152('0x7b'));}break;case _0x7152('0x7c'):if(isEmail(_0x4ec58c)){_0x47aa7d[_0x7152('0x1b')]('\x22'+_0x4ec58c+'\x22');}else{_0x40c05d[_0x7152('0x1b')](_0x7152('0x7d'));}break;case'dateOfBirth':var _0x1baf3b=moment(_0x4ec58c,'YYYY-MM-DD',!![]);if(_0x1baf3b[_0x7152('0x78')]()){_0x47aa7d[_0x7152('0x1b')]('\x22'+_0x4ec58c+'\x22');}else{_0x40c05d[_0x7152('0x1b')](_0x7152('0x7e'));}break;default:_0x47aa7d['push']('\x22'+_0x4ec58c+'\x22');}}else{switch(_0x116766){case _0x7152('0x7f'):case _0x7152('0x19'):_0x40c05d[_0x7152('0x1b')](_0x116766+_0x7152('0x80'));break;default:_0x47aa7d[_0x7152('0x1b')]('\x22\x22');}}}}else{var _0x427ef0='';if(!_[_0x7152('0x1a')](_0xc78140)){if(!_0x178eef[_0x7152('0x76')](_0xc78140['id'])){for(var _0x3b15d4=0x0;_0x3b15d4<_0x32d255[_0x116766]['length'];_0x3b15d4++){var _0x4ec58c=_[_0x7152('0x77')](_0x3ae527[_0x7152('0x73')][_0xa542a9][_0x32d255[_0x116766][_0x3b15d4]]['replace'](/"/g,'\x27'));var _0x5e53f5=phoneDescriptions[_0x7152('0x75')](_0xc3253b=>_0xc3253b[_0x7152('0x81')]===_0xc78140['id']);if(!_[_0x7152('0x1a')](_0x5e53f5)){var _0x48e05d=_[_0x7152('0x77')](_0x3ae527[_0x7152('0x73')][_0xa542a9][_0x32d255[_0x5e53f5[_0x7152('0x82')]][0x0]][_0x7152('0x83')](/"/g,'\x27'));if(!_['isNil'](_0x48e05d))_0x4ec58c=_0x4ec58c+'§'+_0x48e05d;}if(_0x427ef0=='')_0x427ef0=_0x4ec58c;else _0x427ef0+='|'+_0x4ec58c;}_0x5de750[_0x7152('0x1b')](_0xc78140['id']+':'+_0x427ef0);_0x178eef[_0xc78140['id']]=0x1;}}}}if(hasAdditionalPhones){_0x47aa7d[_0x7152('0x1b')]('\x22'+_0x5de750[_0x7152('0x13')](';')+'\x22');}if(_0x40c05d[_0x7152('0x21')]){handleError(_0x3ae527[_0x7152('0x73')][_0xa542a9],{'code':_0x7152('0x84'),'message':_0x40c05d[_0x7152('0x13')]()});}else{fs[_0x7152('0x85')](_0x8bcf44,_0x47aa7d[_0x7152('0x13')]()+'\x0a');}_0x47aa7d=[];}if(!(stats[_0x7152('0x74')]%0xc8)){socket['emit'](_0x7152('0x86')+_0x1bffe1,stats);stats['errors']=[];}}if(stopped){logger[_0x7152('0x5d')](_0x7152('0x87'));_0xf81f4b['abort']();}}catch(_0x337be8){handleError(_0x3ae527[_0x7152('0x73')][_0xa542a9],{'code':_0x7152('0x88'),'message':_0x337be8[_0x7152('0x61')]});logger[_0x7152('0x1e')]('step',_0x337be8['message']);}},'complete':function(){try{var _0x5d7780=[];var _0x1dfa9c=tempTableName;_0x5d7780[_0x7152('0x1b')](_0x7152('0x89')+_0x1dfa9c+_0x7152('0x8a'));logger[_0x7152('0x5d')](_0x7152('0x8b'),contactItemTypes[_0x7152('0x21')]);var _0x133a66=util['format'](_0x7152('0x8c'),_0x8bcf44,_0x1dfa9c,_0x46e036,_0x46fc6f[_0x7152('0x39')],_0x46fc6f[_0x7152('0x56')]||null,NOW,NOW);if(_['isNil'](_0x32d255['scheduledat'])){_0x133a66+=_0x7152('0x8d');}_0x5d7780['push'](_0x133a66);BPromise['each'](_0x5d7780,handleQuery)[_0x7152('0x22')](function(_0x1808be){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x5d7780=[];for(var _0x12996e=0x0;_0x12996e<promisesContact['length'];_0x12996e++){_0x5d7780[_0x7152('0x1b')](updateContact(promisesContact[_0x12996e][_0x7152('0x8e')]));}BPromise[_0x7152('0x1c')](_0x5d7780)[_0x7152('0x22')](function(){_0x5d7780=[];for(var _0x152d89=0x0;_0x152d89<promisesAdditionalPhones[_0x7152('0x21')];_0x152d89++){_0x5d7780[_0x7152('0x1b')](createAdditionalPhone(promisesAdditionalPhones[_0x152d89]['contactId'],promisesAdditionalPhones[_0x152d89]['contactTypeId'],promisesAdditionalPhones[_0x152d89]['phone'],promisesAdditionalPhones[_0x152d89][_0x7152('0x8f')]));}BPromise[_0x7152('0x1c')](_0x5d7780)[_0x7152('0x22')](function(){_0x5d7780=[];_0x5d7780[_0x7152('0x1b')](insertCmHopperAdditionalPhones(_0x46fc6f[_0x7152('0x39')]));_0x5d7780[_0x7152('0x1b')](_0x7152('0x90')+_0x1dfa9c+';');BPromise['each'](_0x5d7780,handleQuery)[_0x7152('0x22')](function(_0x236797){stats[_0x7152('0x91')]=!![];stats[_0x7152('0x92')]=updatedRows;socket['emit'](_0x7152('0x86')+_0x1bffe1,stats);fs[_0x7152('0x93')](_0x175925);fs[_0x7152('0x93')](_0x8bcf44);process[_0x7152('0x5f')](0x0);})[_0x7152('0x1d')](function(_0x549c9c){logger[_0x7152('0x1e')](_0x549c9c[_0x7152('0x61')]);process[_0x7152('0x5f')](0x1);});});});});})[_0x7152('0x1d')](function(_0x2c4158){logger[_0x7152('0x1e')](_0x2c4158[_0x7152('0x61')]);process[_0x7152('0x5f')](0x1);});}catch(_0x10cc61){logger[_0x7152('0x1e')](_0x7152('0x94'),_0x10cc61[_0x7152('0x61')]);process[_0x7152('0x5f')](0x1);}},'error':function(_0x4e3d07,_0x3f7076,_0x44276d,_0x1a7732){throw new Error(_0x1a7732);}});});}function validate(){if(process['argv']&&process['argv']['length']<0x4){throw new Error(_0x7152('0x95'));}var _0x2b976e=path[_0x7152('0x13')](config[_0x7152('0x96')],_0x7152('0x69'),process[_0x7152('0x97')][0x2]);if(!fs[_0x7152('0x98')](_0x2b976e)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x3f8971={};try{_0x3f8971=JSON[_0x7152('0x71')](process[_0x7152('0x97')][0x3]);if(!_0x3f8971[_0x7152('0x66')]){throw new Error(_0x7152('0x99'));}var _0x56e7d3=0x0;if(_0x3f8971[_0x7152('0x66')][_0x7152('0x3d')]){_0x56e7d3=0x1;}if(!_0x3f8971['ListId']){throw new Error(_0x7152('0x9a'));}}catch(_0x2ef0fd){throw new Error('body\x20id\x20mandatory');}var _0x5bd259=[];try{_0x5bd259=_['map'](JSON[_0x7152('0x71')](process['argv'][0x4]),'id');}catch(_0x300f1b){logger[_0x7152('0x5d')](_0x7152('0x9b'));}main(_0x2b976e,_0x3f8971,_0x5bd259,_0x56e7d3);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
index 093e77b..3cfe4dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb15b=['starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','Outbound\x20Call','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','Call\x20To','destexten','Queue','queue','UniqueId','uniqueid','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','destcalleridnum','***\x20Time\x20Info\x20***','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','Called\x20Number','Member\x20Name'];(function(_0x3c93f3,_0x5ef8f2){var _0x1cc695=function(_0x37023a){while(--_0x37023a){_0x3c93f3['push'](_0x3c93f3['shift']());}};_0x1cc695(++_0x5ef8f2);}(_0xb15b,0x1ad));var _0xbb15=function(_0x26e53c,_0x2b4484){_0x26e53c=_0x26e53c-0x0;var _0x3b469f=_0xb15b[_0x26e53c];return _0x3b469f;};'use strict';exports[_0xbb15('0x0')]=function(_0x3442a0,_0xda147){var _0x4ee7fd=[{'type':_0xbb15('0x1'),'content':_0xbb15('0x2'),'variableName':null}];switch(_0x3442a0[_0xbb15('0x3')]()){case'voice':switch(_0xda147[_0xbb15('0x3')]()){case _0xbb15('0x4'):_0x4ee7fd[_0xbb15('0x5')]({'type':_0xbb15('0x6'),'content':'','variableName':'queue'});_0x4ee7fd['push']({'type':_0xbb15('0x6'),'content':'','variableName':'calleridnum'});break;case'outbound':_0x4ee7fd['push']({'type':_0xbb15('0x1'),'content':_0xbb15('0x7'),'variableName':null});_0x4ee7fd[_0xbb15('0x5')]({'type':_0xbb15('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x4ee7fd;};exports[_0xbb15('0x8')]=function(_0x4293d5,_0x28b887){var _0x42e0af=[];switch(_0x4293d5[_0xbb15('0x3')]()){case'voice':switch(_0x28b887['toLowerCase']()){case _0xbb15('0x4'):_0x42e0af=[{'type':'string','content':_0xbb15('0x9'),'key':null,'keyType':null,'variableName':null},{'type':_0xbb15('0xa'),'content':'','key':'Caller\x20Number','keyType':_0xbb15('0x6'),'variableName':'calleridnum'},{'type':_0xbb15('0xa'),'content':'','key':_0xbb15('0xb'),'keyType':'variable','variableName':'calleridname'},{'type':_0xbb15('0xa'),'content':'','key':_0xbb15('0xc'),'keyType':_0xbb15('0x6'),'variableName':_0xbb15('0xd')},{'type':_0xbb15('0xa'),'content':'','key':_0xbb15('0xe'),'keyType':_0xbb15('0x6'),'variableName':_0xbb15('0xf')},{'type':_0xbb15('0xa'),'content':'','key':_0xbb15('0x10'),'keyType':_0xbb15('0x6'),'variableName':_0xbb15('0x11')},{'type':_0xbb15('0xa'),'content':'','key':'Date','keyType':_0xbb15('0x6'),'variableName':'agentcalledAt'},{'type':'string','content':_0xbb15('0x12'),'key':null,'keyType':null,'variableName':null},{'type':_0xbb15('0xa'),'content':'','key':_0xbb15('0x13'),'keyType':_0xbb15('0x6'),'variableName':_0xbb15('0x14')},{'type':'keyValue','content':'','key':'Agent\x20Number','keyType':'variable','variableName':_0xbb15('0x15')},{'type':_0xbb15('0x1'),'content':_0xbb15('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0xbb15('0xa'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':_0xbb15('0x17')},{'type':_0xbb15('0xa'),'content':'','key':_0xbb15('0x18'),'keyType':'variable','variableName':_0xbb15('0x19')},{'type':_0xbb15('0xa'),'content':'','key':_0xbb15('0x1a'),'keyType':_0xbb15('0x6'),'variableName':_0xbb15('0x1b')},{'type':'keyValue','content':'','key':_0xbb15('0x1c'),'keyType':_0xbb15('0x6'),'variableName':_0xbb15('0x1d')},{'type':_0xbb15('0xa'),'content':'','key':_0xbb15('0x1e'),'keyType':'variable','variableName':'talktime'}];break;case'outbound':_0x42e0af=[{'type':_0xbb15('0x1'),'content':_0xbb15('0x9'),'variableName':null},{'type':_0xbb15('0xa'),'content':'','key':_0xbb15('0x1f'),'keyType':_0xbb15('0x6'),'keyContent':'','variableName':_0xbb15('0x15')},{'type':_0xbb15('0xa'),'content':'','key':_0xbb15('0x20'),'keyType':'variable','keyContent':'','variableName':'membername'},{'type':_0xbb15('0xa'),'content':'','key':_0xbb15('0x10'),'keyType':_0xbb15('0x6'),'keyContent':'','variableName':_0xbb15('0x11')},{'type':'keyValue','content':'','key':'Date','keyType':_0xbb15('0x6'),'keyContent':'','variableName':_0xbb15('0x21')},{'type':'string','content':_0xbb15('0x16')},{'type':_0xbb15('0xa'),'content':'','key':_0xbb15('0x22'),'keyType':_0xbb15('0x6'),'keyContent':'','variableName':_0xbb15('0x23')},{'type':'keyValue','content':'','key':_0xbb15('0x24'),'keyType':_0xbb15('0x6'),'keyContent':'','variableName':_0xbb15('0x25')},{'type':_0xbb15('0xa'),'content':'','key':_0xbb15('0x26'),'keyType':_0xbb15('0x6'),'keyContent':'','variableName':_0xbb15('0x27')},{'type':'keyValue','content':'','key':_0xbb15('0x28'),'keyType':_0xbb15('0x6'),'keyContent':'','variableName':_0xbb15('0x29')}];break;}}return _0x42e0af;};
\ No newline at end of file
+var _0x6f9b=['push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Queue','uniqueid','Date','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Talk\x20Time','talktime','membername','UniqueId','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','answertime','endtime','Duration','Billable\x20Time','getSubjects','voice','toLowerCase','inbound'];(function(_0x1237be,_0xeab638){var _0x4c2da7=function(_0x4f4d3c){while(--_0x4f4d3c){_0x1237be['push'](_0x1237be['shift']());}};_0x4c2da7(++_0xeab638);}(_0x6f9b,0xec));var _0xb6f9=function(_0x517df3,_0x50daa6){_0x517df3=_0x517df3-0x0;var _0x6adb98=_0x6f9b[_0x517df3];return _0x6adb98;};'use strict';exports[_0xb6f9('0x0')]=function(_0x22ca4b,_0x4f51b9){var _0x27b219=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x22ca4b['toLowerCase']()){case _0xb6f9('0x1'):switch(_0x4f51b9[_0xb6f9('0x2')]()){case _0xb6f9('0x3'):_0x27b219[_0xb6f9('0x4')]({'type':_0xb6f9('0x5'),'content':'','variableName':_0xb6f9('0x6')});_0x27b219[_0xb6f9('0x4')]({'type':_0xb6f9('0x5'),'content':'','variableName':_0xb6f9('0x7')});break;case _0xb6f9('0x8'):_0x27b219[_0xb6f9('0x4')]({'type':_0xb6f9('0x9'),'content':_0xb6f9('0xa'),'variableName':null});_0x27b219['push']({'type':_0xb6f9('0x5'),'content':'','variableName':_0xb6f9('0xb')});break;}}return _0x27b219;};exports['getDescriptions']=function(_0x3bd916,_0x423187){var _0x3d5e5f=[];switch(_0x3bd916['toLowerCase']()){case _0xb6f9('0x1'):switch(_0x423187[_0xb6f9('0x2')]()){case'inbound':_0x3d5e5f=[{'type':'string','content':_0xb6f9('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xb6f9('0xd'),'content':'','key':_0xb6f9('0xe'),'keyType':'variable','variableName':'calleridnum'},{'type':_0xb6f9('0xd'),'content':'','key':_0xb6f9('0xf'),'keyType':'variable','variableName':_0xb6f9('0x10')},{'type':_0xb6f9('0xd'),'content':'','key':'Call\x20To','keyType':'variable','variableName':'destexten'},{'type':_0xb6f9('0xd'),'content':'','key':_0xb6f9('0x11'),'keyType':_0xb6f9('0x5'),'variableName':_0xb6f9('0x6')},{'type':_0xb6f9('0xd'),'content':'','key':'UniqueId','keyType':_0xb6f9('0x5'),'variableName':_0xb6f9('0x12')},{'type':_0xb6f9('0xd'),'content':'','key':_0xb6f9('0x13'),'keyType':_0xb6f9('0x5'),'variableName':_0xb6f9('0x14')},{'type':_0xb6f9('0x9'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xb6f9('0xd'),'content':'','key':_0xb6f9('0x15'),'keyType':'variable','variableName':_0xb6f9('0x16')},{'type':_0xb6f9('0xd'),'content':'','key':_0xb6f9('0x17'),'keyType':'variable','variableName':'destcalleridnum'},{'type':_0xb6f9('0x9'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xb6f9('0x18'),'keyType':_0xb6f9('0x5'),'variableName':_0xb6f9('0x14')},{'type':_0xb6f9('0xd'),'content':'','key':_0xb6f9('0x19'),'keyType':'variable','variableName':_0xb6f9('0x1a')},{'type':_0xb6f9('0xd'),'content':'','key':_0xb6f9('0x1b'),'keyType':_0xb6f9('0x5'),'variableName':_0xb6f9('0x1c')},{'type':_0xb6f9('0xd'),'content':'','key':'Hold\x20Time','keyType':_0xb6f9('0x5'),'variableName':'holdtime'},{'type':_0xb6f9('0xd'),'content':'','key':_0xb6f9('0x1d'),'keyType':_0xb6f9('0x5'),'variableName':_0xb6f9('0x1e')}];break;case _0xb6f9('0x8'):_0x3d5e5f=[{'type':_0xb6f9('0x9'),'content':_0xb6f9('0xc'),'variableName':null},{'type':_0xb6f9('0xd'),'content':'','key':'Called\x20Number','keyType':_0xb6f9('0x5'),'keyContent':'','variableName':_0xb6f9('0xb')},{'type':_0xb6f9('0xd'),'content':'','key':'Member\x20Name','keyType':_0xb6f9('0x5'),'keyContent':'','variableName':_0xb6f9('0x1f')},{'type':'keyValue','content':'','key':_0xb6f9('0x20'),'keyType':_0xb6f9('0x5'),'keyContent':'','variableName':_0xb6f9('0x12')},{'type':_0xb6f9('0xd'),'content':'','key':_0xb6f9('0x13'),'keyType':_0xb6f9('0x5'),'keyContent':'','variableName':_0xb6f9('0x21')},{'type':'string','content':_0xb6f9('0x22')},{'type':'keyValue','content':'','key':_0xb6f9('0x23'),'keyType':_0xb6f9('0x5'),'keyContent':'','variableName':_0xb6f9('0x24')},{'type':_0xb6f9('0xd'),'content':'','key':'Complete\x20Time','keyType':'variable','keyContent':'','variableName':_0xb6f9('0x25')},{'type':'keyValue','content':'','key':_0xb6f9('0x26'),'keyType':'variable','keyContent':'','variableName':'duration'},{'type':_0xb6f9('0xd'),'content':'','key':_0xb6f9('0x27'),'keyType':_0xb6f9('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x3d5e5f;};
\ No newline at end of file
index 68a8728..0b317b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bab=['html','fax','mobile','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','name','role','stringify','null','Interaction','then','catch','error','user','query','clone','body','omit'];(function(_0x454f02,_0x32ce79){var _0x3369f7=function(_0x4c455c){while(--_0x4c455c){_0x454f02['push'](_0x454f02['shift']());}};_0x3369f7(++_0x32ce79);}(_0x9bab,0x1bd));var _0xb9ba=function(_0x1c9c0a,_0x5daa17){_0x1c9c0a=_0x1c9c0a-0x0;var _0x22df2b=_0x9bab[_0x1c9c0a];return _0x22df2b;};'use strict';var _=require('lodash');var db=require(_0xb9ba('0x0'))['db'];var loggers={'openchannel':require(_0xb9ba('0x1'))(_0xb9ba('0x2')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0xb9ba('0x1'))(_0xb9ba('0x3')),'sms':require(_0xb9ba('0x1'))('sms-interactions'),'chat':require(_0xb9ba('0x1'))('chat-interactions'),'whatsapp':require(_0xb9ba('0x1'))(_0xb9ba('0x4'))};function getInteractionId(_0x4a7d92,_0x55730d,_0x4a3b65){if(_0x4a7d92&&_0x4a7d92[_[_0xb9ba('0x5')](_0x4a3b65)+_0xb9ba('0x6')]){return _0x4a7d92[_[_0xb9ba('0x5')](_0x4a3b65)+'InteractionId'];}else if(_0x4a7d92&&_0x4a7d92['id']){return _0x4a7d92['id'];}else if(_0x55730d&&_0x55730d['id']){return _0x55730d['id'];}else{return _0xb9ba('0x7');}}function log(_0x1dbe5e,_0x4456fc,_0x1dd804,_0x16a322,_0x157263,_0x7533b){loggers[_0x157263[_0xb9ba('0x8')]()][_0x1dbe5e]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x7533b[_0xb9ba('0x9')](),_0x4456fc?_0x4456fc['id']:null,_0x4456fc?_0x4456fc[_0xb9ba('0xa')]:null,_0x4456fc?_0x4456fc[_0xb9ba('0xb')]:null,getInteractionId(_0x1dd804,_0x16a322,_0x157263),_0x1dd804?JSON[_0xb9ba('0xc')](_0x1dd804):_0xb9ba('0xd'));}function updateUser(_0x235412,_0x298337,_0x26739a,_0xff61fd,_0x2be9a1){db[_[_0xb9ba('0x5')](_0xff61fd)+_0xb9ba('0xe')]['findOne']({'where':{'id':getInteractionId(_0x298337,_0x26739a,_0xff61fd)}})[_0xb9ba('0xf')](function(_0x5a710e){if(_0x5a710e){return _0x5a710e['update']({'UserId':_0x235412?_0x235412['id']:null});}})[_0xb9ba('0xf')](function(_0x8ad7d2){if(_0x8ad7d2){log('info',_0x235412,_0x298337,_0x26739a,_0xff61fd,_0x2be9a1);}})[_0xb9ba('0x10')](function(){log(_0xb9ba('0x11'),_0x235412,_0x298337,_0x26739a,_0xff61fd,_0x2be9a1);});}exports['tracked']=function(_0x3cdc7e,_0x2122cf){return function(_0x4db35b,_0x3db89e,_0x77f776){var _0x4fdfcc=_0x4db35b[_0xb9ba('0x12')];var _0x5ca5cc={};var _0x1db607=_0x4db35b[_0xb9ba('0x13')];if(_0x5ca5cc){_0x5ca5cc=_[_0xb9ba('0x14')](_0x4db35b[_0xb9ba('0x15')]);_0x5ca5cc=_[_0xb9ba('0x16')](_0x5ca5cc,['body',_0xb9ba('0x17'),'phone',_0xb9ba('0x18'),_0xb9ba('0x19')]);}updateUser(_0x4fdfcc,_0x5ca5cc,_0x1db607,_0x3cdc7e,_0x2122cf);_0x77f776(null);};};
\ No newline at end of file
+var _0xa1fa=['findOne','then','update','catch','error','user','clone','body','omit','fax','mobile','../../mysqldb','openchannel-interactions','../../config/logger','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','name','stringify','null'];(function(_0x179439,_0x10b1de){var _0x12bb62=function(_0x3f7d56){while(--_0x3f7d56){_0x179439['push'](_0x179439['shift']());}};_0x12bb62(++_0x10b1de);}(_0xa1fa,0x105));var _0xaa1f=function(_0x41199a,_0x24f307){_0x41199a=_0x41199a-0x0;var _0x143cad=_0xa1fa[_0x41199a];return _0x143cad;};'use strict';var _=require('lodash');var db=require(_0xaa1f('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xaa1f('0x1')),'mail':require(_0xaa1f('0x2'))('mail-interactions'),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0xaa1f('0x2'))(_0xaa1f('0x3')),'chat':require(_0xaa1f('0x2'))(_0xaa1f('0x4')),'whatsapp':require(_0xaa1f('0x2'))(_0xaa1f('0x5'))};function getInteractionId(_0x51d1c7,_0x5bf6df,_0x31c4f0){if(_0x51d1c7&&_0x51d1c7[_[_0xaa1f('0x6')](_0x31c4f0)+_0xaa1f('0x7')]){return _0x51d1c7[_[_0xaa1f('0x6')](_0x31c4f0)+_0xaa1f('0x7')];}else if(_0x51d1c7&&_0x51d1c7['id']){return _0x51d1c7['id'];}else if(_0x5bf6df&&_0x5bf6df['id']){return _0x5bf6df['id'];}else{return _0xaa1f('0x8');}}function log(_0x47ee0c,_0x17c664,_0x2d98fb,_0x537633,_0x23bc14,_0x4e0d82){loggers[_0x23bc14[_0xaa1f('0x9')]()][_0x47ee0c]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4e0d82[_0xaa1f('0xa')](),_0x17c664?_0x17c664['id']:null,_0x17c664?_0x17c664[_0xaa1f('0xb')]:null,_0x17c664?_0x17c664['role']:null,getInteractionId(_0x2d98fb,_0x537633,_0x23bc14),_0x2d98fb?JSON[_0xaa1f('0xc')](_0x2d98fb):_0xaa1f('0xd'));}function updateUser(_0x35679d,_0x550a09,_0x126d60,_0x5abaa9,_0x4f8519){db[_[_0xaa1f('0x6')](_0x5abaa9)+'Interaction'][_0xaa1f('0xe')]({'where':{'id':getInteractionId(_0x550a09,_0x126d60,_0x5abaa9)}})[_0xaa1f('0xf')](function(_0x3c556e){if(_0x3c556e){return _0x3c556e[_0xaa1f('0x10')]({'UserId':_0x35679d?_0x35679d['id']:null});}})['then'](function(_0x191cc4){if(_0x191cc4){log('info',_0x35679d,_0x550a09,_0x126d60,_0x5abaa9,_0x4f8519);}})[_0xaa1f('0x11')](function(){log(_0xaa1f('0x12'),_0x35679d,_0x550a09,_0x126d60,_0x5abaa9,_0x4f8519);});}exports['tracked']=function(_0x62c80c,_0x24f1d5){return function(_0x15e8ba,_0x988517,_0x1f25b5){var _0x48ceb5=_0x15e8ba[_0xaa1f('0x13')];var _0x35cfd5={};var _0x374d5e=_0x15e8ba['query'];if(_0x35cfd5){_0x35cfd5=_[_0xaa1f('0x14')](_0x15e8ba[_0xaa1f('0x15')]);_0x35cfd5=_[_0xaa1f('0x16')](_0x35cfd5,['body','html','phone',_0xaa1f('0x17'),_0xaa1f('0x18')]);}updateUser(_0x48ceb5,_0x35cfd5,_0x374d5e,_0x62c80c,_0x24f1d5);_0x1f25b5(null);};};
\ No newline at end of file
index 217de9f..a8b4261 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa973=['crypto','composable-middleware','../../mysqldb','../../config/environment','data1','license','createDecipher','aes-256-ctr','%s:%s:%s','update','final','utf8','parse','hasOwnProperty','use','License','findOne','then','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user'];(function(_0x41c49e,_0x4e9e2c){var _0x648a67=function(_0xfd5118){while(--_0xfd5118){_0x41c49e['push'](_0x41c49e['shift']());}};_0x648a67(++_0x4e9e2c);}(_0xa973,0xd0));var _0x3a97=function(_0x49dd7e,_0x48b1e5){_0x49dd7e=_0x49dd7e-0x0;var _0x4c4f6e=_0xa973[_0x49dd7e];return _0x4c4f6e;};'use strict';var crypto=require(_0x3a97('0x0'));var util=require('util');var compose=require(_0x3a97('0x1'));var db=require(_0x3a97('0x2'))['db'];var config=require(_0x3a97('0x3'));function getValueFromLicense(_0x12d645,_0x5e1cd1){if(_0x12d645&&_0x5e1cd1){if(_0x5e1cd1['data1']&&_0x5e1cd1['license']){var _0x1ed4a4=_0x5e1cd1[_0x3a97('0x4')];var _0x46e38e=_0x5e1cd1[_0x3a97('0x5')];var _0x1ad1a1=_0x1ed4a4['split']('-')[0x4];var _0x4441a9=_0x1ed4a4['split']('-')[0x0];var _0x33eb0a=crypto[_0x3a97('0x6')](_0x3a97('0x7'),util['format'](_0x3a97('0x8'),_0x1ad1a1,_0x1ed4a4,_0x4441a9));var _0x2c055a=_0x33eb0a[_0x3a97('0x9')](_0x46e38e,'base64','utf8');_0x2c055a+=_0x33eb0a[_0x3a97('0xa')](_0x3a97('0xb'));var _0x3b7a4e=JSON[_0x3a97('0xc')](_0x2c055a);return _0x3b7a4e[_0x3a97('0xd')](_0x12d645)?_0x3b7a4e[_0x12d645]:null;}}return null;}function isLimit(_0x4cd34f,_0x4486ea,_0x1e4208,_0x1c14cc){var _0x415d8d=_0x4486ea;return compose()[_0x3a97('0xe')](function(_0x18aeed,_0x13d657,_0x1e5be8){return db[_0x3a97('0xf')][_0x3a97('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x3a97('0x11')](function(_0x388c8d){var _0x48f63b=getValueFromLicense(_0x4cd34f,_0x388c8d);return _0x48f63b?_0x48f63b:_0x415d8d;})[_0x3a97('0x11')](function(_0x327524){_0x415d8d=_0x327524;return _0x1e4208['count'](_0x1c14cc);})[_0x3a97('0x11')](function(_0x4fb55b){if(_0x4fb55b>=_0x415d8d){return _0x13d657[_0x3a97('0x12')](0x193)[_0x3a97('0x13')]({'message':util[_0x3a97('0x14')](_0x3a97('0x15'),_0x4cd34f)});}_0x1e5be8();})[_0x3a97('0x16')](function(_0x1e3098){_0x1e5be8(_0x1e3098);});});}function isUserLimit(){return isLimit(_0x3a97('0x17'),0x1,db[_0x3a97('0x18')],{'where':{'$or':[{'role':'admin'},{'role':_0x3a97('0x19')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
+var _0xd737=['aes-256-ctr','%s:%s:%s','update','utf8','final','parse','use','License','findOne','then','count','status','json','format','catch','users','admin','user','util','composable-middleware','../../mysqldb','data1','license','split'];(function(_0x3a060a,_0xf8626d){var _0x45a20c=function(_0xa73fce){while(--_0xa73fce){_0x3a060a['push'](_0x3a060a['shift']());}};_0x45a20c(++_0xf8626d);}(_0xd737,0x8a));var _0x7d73=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0xd737[_0x15b399];return _0x199f2d;};'use strict';var crypto=require('crypto');var util=require(_0x7d73('0x0'));var compose=require(_0x7d73('0x1'));var db=require(_0x7d73('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0xb01bf3,_0xf3726d){if(_0xb01bf3&&_0xf3726d){if(_0xf3726d[_0x7d73('0x3')]&&_0xf3726d[_0x7d73('0x4')]){var _0x4077a8=_0xf3726d[_0x7d73('0x3')];var _0x41441b=_0xf3726d[_0x7d73('0x4')];var _0x42ab1c=_0x4077a8[_0x7d73('0x5')]('-')[0x4];var _0x3b197a=_0x4077a8[_0x7d73('0x5')]('-')[0x0];var _0x5d5d1d=crypto['createDecipher'](_0x7d73('0x6'),util['format'](_0x7d73('0x7'),_0x42ab1c,_0x4077a8,_0x3b197a));var _0x1150bd=_0x5d5d1d[_0x7d73('0x8')](_0x41441b,'base64',_0x7d73('0x9'));_0x1150bd+=_0x5d5d1d[_0x7d73('0xa')]('utf8');var _0xee22eb=JSON[_0x7d73('0xb')](_0x1150bd);return _0xee22eb['hasOwnProperty'](_0xb01bf3)?_0xee22eb[_0xb01bf3]:null;}}return null;}function isLimit(_0x5e4722,_0x1d22b6,_0x40b9b0,_0x4c0cfb){var _0x208996=_0x1d22b6;return compose()[_0x7d73('0xc')](function(_0x4a6c78,_0x96953f,_0x22c633){return db[_0x7d73('0xd')][_0x7d73('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x7d73('0xf')](function(_0x583fc2){var _0x52e673=getValueFromLicense(_0x5e4722,_0x583fc2);return _0x52e673?_0x52e673:_0x208996;})[_0x7d73('0xf')](function(_0x4556c7){_0x208996=_0x4556c7;return _0x40b9b0[_0x7d73('0x10')](_0x4c0cfb);})[_0x7d73('0xf')](function(_0x5a140b){if(_0x5a140b>=_0x208996){return _0x96953f[_0x7d73('0x11')](0x193)[_0x7d73('0x12')]({'message':util[_0x7d73('0x13')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x5e4722)});}_0x22c633();})[_0x7d73('0x14')](function(_0x38b2ec){_0x22c633(_0x38b2ec);});});}function isUserLimit(){return isLimit(_0x7d73('0x15'),0x1,db['User'],{'where':{'$or':[{'role':_0x7d73('0x16')},{'role':_0x7d73('0x17')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
index 1a29a43..42e7d00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8622=['operator','$eq','$between','value','includes','$gt','add','days','format','YYYY-MM-DD','castTo','text','CAST(','$ne','$notIn','\x20OR\x20','field','$in','IN\x20?','=\x20?','<>\x20?','LIKE\x20?','$lt','<\x20?','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','$endsWith','utcOffset','hours','minutes','seconds','moment','parseSearch','sqlOperator','startsWith','and','replace','[$and]','split','length','slice','shift','match','filter','indexOf','map','conditions','push','buildExpression','DATE'];(function(_0x31b5b2,_0x5ab927){var _0x364f13=function(_0x163bd0){while(--_0x163bd0){_0x31b5b2['push'](_0x31b5b2['shift']());}};_0x364f13(++_0x5ab927);}(_0x8622,0x92));var _0x2862=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8622[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var moment=require(_0x2862('0x0'));exports[_0x2862('0x1')]=function(_0x4741c4){var _0x2ff26f={'conditions':[]};_0x2ff26f[_0x2862('0x2')]=_[_0x2862('0x3')](_0x4741c4,'[$or]')?'or':_0x2862('0x4');var _0x48aa22=_0x4741c4[_0x2862('0x5')](_0x2862('0x6'),'')[_0x2862('0x5')]('[$or]','')[_0x2862('0x7')]('||');for(var _0x942498=0x0;_0x942498<_0x48aa22[_0x2862('0x8')];_0x942498++){var _0x567733=_0x48aa22[_0x942498][_0x2862('0x7')](':=');var _0x12ec5c=_0x567733[0x0];var _0x23c067=_0x567733[_0x2862('0x9')](0x1);_0x23c067['forEach'](function(_0x2cfd10){var _0x5be9ce=_0x2cfd10[_0x2862('0x7')]('[')[_0x2862('0xa')]();var _0xb8cf8d=_0x2cfd10[_0x2862('0xb')](/\[(.*?)\]/g);_0xb8cf8d['forEach'](function(_0x1d2fdb){var _0x367ad2=_0x1d2fdb['split']('[')[_0x2862('0xc')](function(_0x5e6647){return _0x5e6647[_0x2862('0xd')](']')>-0x1;})[_0x2862('0xe')](function(_0x305f90){return _0x305f90['split'](']')[0x0];})[0x0];_0x2ff26f[_0x2862('0xf')][_0x2862('0x10')]({'field':_0x12ec5c,'operator':_0x5be9ce,'value':_0x367ad2});});});}return _0x2ff26f;};exports[_0x2862('0x11')]=function(_0x4c4a2a,_0x538d4e,_0x234e52){var _0x36aac7={};if(_0x538d4e===_0x2862('0x12')){if(_0x234e52[_0x2862('0x13')]===_0x2862('0x14')){_0x234e52['operator']=_0x2862('0x15');_0x234e52['value']+=','+_0x234e52[_0x2862('0x16')];}else if(_[_0x2862('0x17')]([_0x2862('0x18'),'$lte'],_0x234e52[_0x2862('0x13')])){_0x234e52[_0x2862('0x16')]=moment(_0x234e52[_0x2862('0x16')])[_0x2862('0x19')](0x1,_0x2862('0x1a'))[_0x2862('0x1b')](_0x2862('0x1c'));}}if(_0x234e52[_0x2862('0x1d')]){_0x538d4e=_0x234e52['castTo'];_0x36aac7[_0x2862('0x1e')]=_0x2862('0x1f')+_0x4c4a2a+'.'+_0x234e52['field']+'\x20AS\x20'+_0x234e52[_0x2862('0x1d')]+')\x20'+parseOperator(_0x234e52[_0x2862('0x13')]);}else{_0x36aac7[_0x2862('0x1e')]=_0x4c4a2a+'.'+_0x234e52['field']+'\x20'+parseOperator(_0x234e52['operator']);}if(_[_0x2862('0x17')]([_0x2862('0x20'),_0x2862('0x21')],_0x234e52[_0x2862('0x13')]))_0x36aac7[_0x2862('0x1e')]='('+_0x36aac7[_0x2862('0x1e')]+_0x2862('0x22')+_0x4c4a2a+'.'+_0x234e52[_0x2862('0x23')]+'\x20IS\x20NULL)';_0x36aac7[_0x2862('0x16')]=parseValue(_0x538d4e,_0x234e52[_0x2862('0x13')],_0x234e52[_0x2862('0x16')]);return _0x36aac7;};function parseOperator(_0x5ae3ba){var _0x85b6e3;switch(_0x5ae3ba){case _0x2862('0x24'):_0x85b6e3=_0x2862('0x25');break;case'$notIn':_0x85b6e3='NOT\x20IN\x20?';break;case'$eq':_0x85b6e3=_0x2862('0x26');break;case _0x2862('0x20'):_0x85b6e3=_0x2862('0x27');break;case'$substring':case'$startsWith':case'$endsWith':_0x85b6e3=_0x2862('0x28');break;case _0x2862('0x29'):_0x85b6e3=_0x2862('0x2a');break;case _0x2862('0x18'):_0x85b6e3='>\x20?';break;case _0x2862('0x2b'):_0x85b6e3=_0x2862('0x2c');break;case _0x2862('0x2d'):_0x85b6e3=_0x2862('0x2e');break;case _0x2862('0x15'):_0x85b6e3=_0x2862('0x2f');break;}return _0x85b6e3;}function parseValue(_0x154a83,_0x24b23f,_0x39201c){var _0x55ea4f={'start':undefined,'end':undefined};switch(_0x24b23f){case _0x2862('0x24'):case _0x2862('0x21'):_0x55ea4f[_0x2862('0x30')]=_0x39201c['split'](',');break;case _0x2862('0x31'):_0x55ea4f['start']='%'+_0x39201c+'%';break;case'$startsWith':_0x55ea4f[_0x2862('0x30')]=_0x39201c+'%';break;case _0x2862('0x32'):_0x55ea4f[_0x2862('0x30')]='%'+_0x39201c;break;case _0x2862('0x15'):var _0x4ae70c=_0x39201c[_0x2862('0x7')](',');var _0x39201c=_0x4ae70c['shift']();var _0x43da7a=_0x4ae70c['pop']();if(_0x154a83===_0x2862('0x12')){_0x39201c=moment(_0x39201c)[_0x2862('0x33')](0x0,!![])[_0x2862('0x1b')]();_0x43da7a=moment(_0x43da7a)['utcOffset'](0x0,!![])[_0x2862('0x19')](0x17,_0x2862('0x34'))['add'](0x3b,_0x2862('0x35'))[_0x2862('0x19')](0x3b,_0x2862('0x36'))[_0x2862('0x1b')]();}_0x55ea4f={'start':_0x39201c,'end':_0x43da7a};break;default:_0x55ea4f[_0x2862('0x30')]=_0x39201c;break;}return _0x55ea4f;}
\ No newline at end of file
+var _0xde2a=['<>\x20?','$startsWith','$endsWith','LIKE\x20?','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','$substring','start','utcOffset','minutes','lodash','startsWith','[$or]','and','replace','[$and]','length','split','forEach','shift','match','push','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?'];(function(_0x43b96b,_0x3bc895){var _0x3f6e99=function(_0x339fc4){while(--_0x339fc4){_0x43b96b['push'](_0x43b96b['shift']());}};_0x3f6e99(++_0x3bc895);}(_0xde2a,0x16b));var _0xade2=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0xde2a[_0x4eafed];return _0x159c85;};'use strict';var _=require(_0xade2('0x0'));var moment=require('moment');exports['parseSearch']=function(_0x466b26){var _0x1e0e44={'conditions':[]};_0x1e0e44['sqlOperator']=_[_0xade2('0x1')](_0x466b26,_0xade2('0x2'))?'or':_0xade2('0x3');var _0x2e7685=_0x466b26[_0xade2('0x4')](_0xade2('0x5'),'')[_0xade2('0x4')](_0xade2('0x2'),'')['split']('||');for(var _0x1cec1a=0x0;_0x1cec1a<_0x2e7685[_0xade2('0x6')];_0x1cec1a++){var _0x210810=_0x2e7685[_0x1cec1a][_0xade2('0x7')](':=');var _0x41590d=_0x210810[0x0];var _0x3cfc6e=_0x210810['slice'](0x1);_0x3cfc6e[_0xade2('0x8')](function(_0x21d3f1){var _0x3e9600=_0x21d3f1[_0xade2('0x7')]('[')[_0xade2('0x9')]();var _0xf0a97b=_0x21d3f1[_0xade2('0xa')](/\[(.*?)\]/g);_0xf0a97b['forEach'](function(_0x420113){var _0x269658=_0x420113['split']('[')['filter'](function(_0xb027cc){return _0xb027cc['indexOf'](']')>-0x1;})['map'](function(_0x34319e){return _0x34319e[_0xade2('0x7')](']')[0x0];})[0x0];_0x1e0e44['conditions'][_0xade2('0xb')]({'field':_0x41590d,'operator':_0x3e9600,'value':_0x269658});});});}return _0x1e0e44;};exports['buildExpression']=function(_0x35a46a,_0x4476f3,_0x322ef1){var _0x55c815={};if(_0x4476f3===_0xade2('0xc')){if(_0x322ef1[_0xade2('0xd')]===_0xade2('0xe')){_0x322ef1[_0xade2('0xd')]=_0xade2('0xf');_0x322ef1[_0xade2('0x10')]+=','+_0x322ef1[_0xade2('0x10')];}else if(_[_0xade2('0x11')]([_0xade2('0x12'),_0xade2('0x13')],_0x322ef1[_0xade2('0xd')])){_0x322ef1['value']=moment(_0x322ef1[_0xade2('0x10')])[_0xade2('0x14')](0x1,_0xade2('0x15'))[_0xade2('0x16')](_0xade2('0x17'));}}if(_0x322ef1[_0xade2('0x18')]){_0x4476f3=_0x322ef1[_0xade2('0x18')];_0x55c815[_0xade2('0x19')]=_0xade2('0x1a')+_0x35a46a+'.'+_0x322ef1[_0xade2('0x1b')]+_0xade2('0x1c')+_0x322ef1[_0xade2('0x18')]+')\x20'+parseOperator(_0x322ef1['operator']);}else{_0x55c815[_0xade2('0x19')]=_0x35a46a+'.'+_0x322ef1[_0xade2('0x1b')]+'\x20'+parseOperator(_0x322ef1[_0xade2('0xd')]);}if(_['includes']([_0xade2('0x1d'),_0xade2('0x1e')],_0x322ef1[_0xade2('0xd')]))_0x55c815[_0xade2('0x19')]='('+_0x55c815[_0xade2('0x19')]+_0xade2('0x1f')+_0x35a46a+'.'+_0x322ef1[_0xade2('0x1b')]+_0xade2('0x20');_0x55c815['value']=parseValue(_0x4476f3,_0x322ef1[_0xade2('0xd')],_0x322ef1['value']);return _0x55c815;};function parseOperator(_0x124108){var _0x342b8a;switch(_0x124108){case _0xade2('0x21'):_0x342b8a=_0xade2('0x22');break;case'$notIn':_0x342b8a=_0xade2('0x23');break;case _0xade2('0xe'):_0x342b8a=_0xade2('0x24');break;case _0xade2('0x1d'):_0x342b8a=_0xade2('0x25');break;case'$substring':case _0xade2('0x26'):case _0xade2('0x27'):_0x342b8a=_0xade2('0x28');break;case'$lt':_0x342b8a=_0xade2('0x29');break;case _0xade2('0x12'):_0x342b8a=_0xade2('0x2a');break;case _0xade2('0x13'):_0x342b8a=_0xade2('0x2b');break;case _0xade2('0x2c'):_0x342b8a=_0xade2('0x2d');break;case _0xade2('0xf'):_0x342b8a='BETWEEN\x20?\x20AND\x20?';break;}return _0x342b8a;}function parseValue(_0x484ca8,_0x2bc38c,_0x332942){var _0x511f6e={'start':undefined,'end':undefined};switch(_0x2bc38c){case _0xade2('0x21'):case _0xade2('0x1e'):_0x511f6e['start']=_0x332942[_0xade2('0x7')](',');break;case _0xade2('0x2e'):_0x511f6e[_0xade2('0x2f')]='%'+_0x332942+'%';break;case'$startsWith':_0x511f6e[_0xade2('0x2f')]=_0x332942+'%';break;case'$endsWith':_0x511f6e['start']='%'+_0x332942;break;case _0xade2('0xf'):var _0x488675=_0x332942['split'](',');var _0x332942=_0x488675[_0xade2('0x9')]();var _0x26b6cf=_0x488675['pop']();if(_0x484ca8===_0xade2('0xc')){_0x332942=moment(_0x332942)[_0xade2('0x30')](0x0,!![])[_0xade2('0x16')]();_0x26b6cf=moment(_0x26b6cf)[_0xade2('0x30')](0x0,!![])[_0xade2('0x14')](0x17,'hours')['add'](0x3b,_0xade2('0x31'))[_0xade2('0x14')](0x3b,'seconds')[_0xade2('0x16')]();}_0x511f6e={'start':_0x332942,'end':_0x26b6cf};break;default:_0x511f6e[_0xade2('0x2f')]=_0x332942;break;}return _0x511f6e;}
\ No newline at end of file
index 713bba4..1fe5120 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef6=['split','filters','isEmpty','forOwn','type','DATE','isPlainObject','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','offset','sort','indexOf','cast','col','priority','unsigned','ASC','omit','isString','isArray','length','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','join','getOptions','$id','query','model','intersection','attributes','fields','nolimit','limit','order','where','pick','filter','object','columns','value','merge','map','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','includes'];(function(_0x1942a8,_0x32f37f){var _0x382446=function(_0x3c85b2){while(--_0x3c85b2){_0x1942a8['push'](_0x1942a8['shift']());}};_0x382446(++_0x32f37f);}(_0x8ef6,0xf2));var _0x68ef=function(_0x20e4bd,_0x3c2c9e){_0x20e4bd=_0x20e4bd-0x0;var _0xbde1cc=_0x8ef6[_0x20e4bd];return _0xbde1cc;};'use strict';var _=require(_0x68ef('0x0'));var sequelize=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x279e08){var _0x2cc97b=['ne'];try{var _0x44e0d3=JSON[_0x68ef('0x3')](_0x279e08);var _0x4a72b8=Object[_0x68ef('0x4')](_0x44e0d3)[0x0];return _0x2cc97b[_0x68ef('0x5')](_0x4a72b8);}catch(_0xbab618){return![];}}function getOperatorValue(_0x2ac782){var _0x4d26e3=JSON['parse'](_0x2ac782);var _0x3c2ff3=Object[_0x68ef('0x4')](_0x4d26e3)[0x0];var _0x2de776=_0x4d26e3[_0x3c2ff3];return{['$'+_0x3c2ff3]:_0x2de776};}exports['fields']=function(_0x228967){var _0x31007e=null;if(_0x228967){_0x31007e=_0x228967[_0x68ef('0x6')](',');}return _0x31007e;};exports[_0x68ef('0x7')]=function(_0x112b18,_0x51554d){var _0x304a60={};if(!_[_0x68ef('0x8')](_0x112b18)){_[_0x68ef('0x9')](_0x112b18,function(_0x255c85,_0x3afc1d){try{if(_0x51554d){var _0xfa6763=_['find'](_0x51554d,{'name':_0x3afc1d})||{};if(hasSequelizeOperator(_0x255c85)){_0x304a60[_0x3afc1d]=getOperatorValue(_0x255c85);}else if(_0xfa6763[_0x68ef('0xa')]===_0x68ef('0xb')&&_[_0x68ef('0xc')](_0x255c85)){var _0x454ef4=JSON[_0x68ef('0x3')](_0x255c85);var _0x288cc9={'$gte':moment(moment(_0x454ef4['$gte'])[_0x68ef('0xd')](_0x68ef('0xe')))[_0x68ef('0xf')]()['format'](),'$lte':moment(moment(_0x454ef4[_0x68ef('0x10')])[_0x68ef('0xd')](_0x68ef('0xe')))['utc']()[_0x68ef('0x11')](0x1,'s')[_0x68ef('0xd')]()};_0x304a60[_0x3afc1d]=_0x288cc9;}else if(_0xfa6763[_0x68ef('0x12')]===_0x68ef('0x13')){_0x304a60[_0x3afc1d]=_0x255c85;}else{_0x304a60[_0x3afc1d]=_['isArray'](_0x255c85)?_0x255c85:JSON[_0x68ef('0x3')](_0x255c85);}}else{_0x304a60[_0x3afc1d]=_['isArray'](_0x255c85)?_0x255c85:JSON['parse'](_0x255c85);}}catch(_0x2633c1){_0x304a60[_0x3afc1d]=_0x255c85[_0x68ef('0x6')](',');}});}return _0x304a60;};exports['limit']=function(_0x527870){_0x527870=parseInt(_0x527870,0xa);if(!_0x527870||_0x527870<0x0){_0x527870=LIMIT_VALUE;}return _0x527870;};exports[_0x68ef('0x14')]=function(_0x2cd92c){_0x2cd92c=parseInt(_0x2cd92c,0xa);if(!_0x2cd92c||_0x2cd92c<0x0){_0x2cd92c=0x0;}return _0x2cd92c;};exports[_0x68ef('0x15')]=function(_0x4fad1c){var _0x1dc49c,_0x36a4cb=null;if(_0x4fad1c){_0x1dc49c=_0x4fad1c[_0x68ef('0x6')](',');_0x36a4cb=_['map'](_0x1dc49c,function(_0x3c46d4){if(_0x3c46d4[_0x68ef('0x16')]('-')===0x0){return[_0x3c46d4==='priority'?sequelize[_0x68ef('0x17')](sequelize[_0x68ef('0x18')](_0x68ef('0x19')),'unsigned'):_0x3c46d4['substr'](0x1),'DESC'];}else{return[_0x3c46d4===_0x68ef('0x19')?sequelize[_0x68ef('0x17')](sequelize[_0x68ef('0x18')](_0x68ef('0x19')),_0x68ef('0x1a')):_0x3c46d4,_0x68ef('0x1b')];}});}return _0x36a4cb;};exports[_0x68ef('0x1c')]=function(_0x49374f,_0x65fd09){if(_[_0x68ef('0x8')](_0x49374f)){return _0x49374f;}if(_['isArray'](_0x49374f)){for(var _0x178460=0x0;_0x178460<_0x49374f['length'];_0x178460+=0x1){_0x49374f[_0x178460]=this['omit'](_0x49374f[_0x178460],_0x65fd09);}return _0x49374f;}if(!_['isObject'](_0x49374f)){return _0x49374f;}if(_[_0x68ef('0x1d')](_0x65fd09)){_0x65fd09=[_0x65fd09];}if(!_[_0x68ef('0x1e')](_0x65fd09)){return _0x49374f;}for(var _0x123041=0x0;_0x123041<_0x65fd09[_0x68ef('0x1f')];_0x123041+=0x1){_['unset'](_0x49374f,_0x65fd09[_0x123041]);}for(var _0x4a0550 in _0x49374f){if(_0x49374f[_0x68ef('0x20')](_0x4a0550)){_0x49374f[_0x4a0550]=this[_0x68ef('0x1c')](_0x49374f[_0x4a0550],_0x65fd09);}}return _0x49374f;};exports[_0x68ef('0x21')]=function(_0x263b30){return _0x263b30[_0x68ef('0x22')](RegExp(_0x68ef('0x23')))?!![]:![];};exports[_0x68ef('0x24')]=function(_0x4579cb){return _0x4579cb['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x68ef('0x25')]=function(_0x4314bd){var _0x132d9e=[];_0x4314bd['split'](/[ ,]+/)[_0x68ef('0x26')](function(_0x523120){_0x523120=_0x523120[_0x68ef('0x27')](/([^:]")"+/g,'$1');_0x523120='+'+_0x523120+'*';var _0x17588a=/[ `!@#$%^&*()_\-?~]/;if(_0x523120['match'](_0x17588a))_0x523120='\x22'+_0x523120+'\x22';_0x132d9e['push'](_0x523120);});return _0x132d9e[_0x68ef('0x28')]('\x20');};exports[_0x68ef('0x29')]=function(_0x4b8fc8,_0xf58fa1,_0x8c0a06){var _0x2d67be={},_0x2d1e9f={};if(_0xf58fa1['query'][_0x68ef('0x2a')]){_0xf58fa1[_0x68ef('0x2b')]['id']=_0xf58fa1['query'][_0x68ef('0x2a')];delete _0xf58fa1['query'][_0x68ef('0x2a')];}_0x2d67be[_0x68ef('0x2c')]=_['map'](_0x4b8fc8,_0x68ef('0x12'));_0x2d67be['query']=_[_0x68ef('0x4')](_0xf58fa1['query']);_0x2d67be[_0x68ef('0x7')]=_[_0x68ef('0x2d')](_0x2d67be[_0x68ef('0x2c')],_0x2d67be['query']);_0x2d1e9f[_0x68ef('0x2e')]=_['intersection'](_0x2d67be[_0x68ef('0x2c')],this['fields'](_0xf58fa1[_0x68ef('0x2b')][_0x68ef('0x2f')]));_0x2d1e9f[_0x68ef('0x2e')]=_0x2d1e9f[_0x68ef('0x2e')][_0x68ef('0x1f')]?_0x2d1e9f[_0x68ef('0x2e')]:_0x2d67be['model'];if(!_0xf58fa1[_0x68ef('0x2b')][_0x68ef('0x20')](_0x68ef('0x30'))){_0x2d1e9f['limit']=this[_0x68ef('0x31')](_0xf58fa1[_0x68ef('0x2b')][_0x68ef('0x31')]);_0x2d1e9f['offset']=this['offset'](_0xf58fa1[_0x68ef('0x2b')][_0x68ef('0x14')]);}_0x2d1e9f[_0x68ef('0x32')]=this[_0x68ef('0x15')](_0xf58fa1[_0x68ef('0x2b')][_0x68ef('0x15')]);_0x2d1e9f[_0x68ef('0x33')]=this['filters'](_[_0x68ef('0x34')](_0xf58fa1[_0x68ef('0x2b')],_0x2d67be[_0x68ef('0x7')]),_0x4b8fc8);if(_0xf58fa1[_0x68ef('0x2b')]['filter']){var _0x3cb156=_0x4b8fc8;var _0x3a2f53=_0xf58fa1[_0x68ef('0x2b')][_0x68ef('0x35')];if(typeof _0x3a2f53===_0x68ef('0x36')){_0x3cb156=_[_0x68ef('0x35')](_0x4b8fc8,function(_0x558efb){return _[_0x68ef('0x5')](_0x3a2f53[_0x68ef('0x37')],_0x558efb[_0x68ef('0x12')]);});_0x3a2f53=_0x3a2f53[_0x68ef('0x38')];}_0x2d1e9f[_0x68ef('0x33')]=_[_0x68ef('0x39')](_0x2d1e9f[_0x68ef('0x33')],{'$or':_[_0x68ef('0x3a')](_0x3cb156,function(_0xc687ab){if(_0xc687ab['type']!==_0x68ef('0x3b')){if(_0x8c0a06){return sequelize[_0x68ef('0x33')](sequelize['fn'](_0x68ef('0x3c'),sequelize[_0x68ef('0x18')](_0xc687ab[_0x68ef('0x12')])),{'$like':sequelize['fn'](_0x68ef('0x3c'),'%'+_0xf58fa1[_0x68ef('0x2b')]['filter']+'%')});}else{var _0xb3d396={};_0xb3d396[_0xc687ab['name']]={'$like':'%'+_0xf58fa1[_0x68ef('0x2b')][_0x68ef('0x35')]+'%'};return _0xb3d396;}}})});}_0x2d1e9f=_[_0x68ef('0x39')]({},_0x2d1e9f,_0xf58fa1[_0x68ef('0x3d')]);return _0x2d1e9f;};
\ No newline at end of file
+var _0xd67b=['attributes','nolimit','offset','sort','where','filter','object','columns','value','merge','lower','options','sequelize','includes','parse','keys','fields','split','filters','forOwn','find','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','$lte','subtract','name','isArray','limit','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','isEmpty','length','isString','unset','hasOwnProperty','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','push','getOptions','$id','query','model','intersection'];(function(_0x206f02,_0x36f322){var _0x8a2663=function(_0x5ac031){while(--_0x5ac031){_0x206f02['push'](_0x206f02['shift']());}};_0x8a2663(++_0x36f322);}(_0xd67b,0x133));var _0xbd67=function(_0x2f8eef,_0x378150){_0x2f8eef=_0x2f8eef-0x0;var _0x4ad692=_0xd67b[_0x2f8eef];return _0x4ad692;};'use strict';var _=require('lodash');var sequelize=require(_0xbd67('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1da24d){var _0x280954=['ne'];try{var _0x317e33=JSON['parse'](_0x1da24d);var _0x40e384=Object['keys'](_0x317e33)[0x0];return _0x280954[_0xbd67('0x1')](_0x40e384);}catch(_0x5a827b){return![];}}function getOperatorValue(_0x309962){var _0xa5c384=JSON[_0xbd67('0x2')](_0x309962);var _0x27b016=Object[_0xbd67('0x3')](_0xa5c384)[0x0];var _0x72f9ac=_0xa5c384[_0x27b016];return{['$'+_0x27b016]:_0x72f9ac};}exports[_0xbd67('0x4')]=function(_0xfad775){var _0x1da7f1=null;if(_0xfad775){_0x1da7f1=_0xfad775[_0xbd67('0x5')](',');}return _0x1da7f1;};exports[_0xbd67('0x6')]=function(_0x3a7f43,_0x283f2f){var _0x52b981={};if(!_['isEmpty'](_0x3a7f43)){_[_0xbd67('0x7')](_0x3a7f43,function(_0x5aad7a,_0x388d95){try{if(_0x283f2f){var _0xb6b4b5=_[_0xbd67('0x8')](_0x283f2f,{'name':_0x388d95})||{};if(hasSequelizeOperator(_0x5aad7a)){_0x52b981[_0x388d95]=getOperatorValue(_0x5aad7a);}else if(_0xb6b4b5[_0xbd67('0x9')]===_0xbd67('0xa')&&_[_0xbd67('0xb')](_0x5aad7a)){var _0x3621ad=JSON[_0xbd67('0x2')](_0x5aad7a);var _0x341b2b={'$gte':moment(moment(_0x3621ad[_0xbd67('0xc')])['format'](_0xbd67('0xd')))[_0xbd67('0xe')]()[_0xbd67('0xf')](),'$lte':moment(moment(_0x3621ad[_0xbd67('0x10')])[_0xbd67('0xf')](_0xbd67('0xd')))[_0xbd67('0xe')]()[_0xbd67('0x11')](0x1,'s')[_0xbd67('0xf')]()};_0x52b981[_0x388d95]=_0x341b2b;}else if(_0xb6b4b5[_0xbd67('0x12')]==='uniqueid'){_0x52b981[_0x388d95]=_0x5aad7a;}else{_0x52b981[_0x388d95]=_['isArray'](_0x5aad7a)?_0x5aad7a:JSON[_0xbd67('0x2')](_0x5aad7a);}}else{_0x52b981[_0x388d95]=_[_0xbd67('0x13')](_0x5aad7a)?_0x5aad7a:JSON[_0xbd67('0x2')](_0x5aad7a);}}catch(_0x47d066){_0x52b981[_0x388d95]=_0x5aad7a[_0xbd67('0x5')](',');}});}return _0x52b981;};exports[_0xbd67('0x14')]=function(_0x357ff2){_0x357ff2=parseInt(_0x357ff2,0xa);if(!_0x357ff2||_0x357ff2<0x0){_0x357ff2=LIMIT_VALUE;}return _0x357ff2;};exports['offset']=function(_0x5906a2){_0x5906a2=parseInt(_0x5906a2,0xa);if(!_0x5906a2||_0x5906a2<0x0){_0x5906a2=0x0;}return _0x5906a2;};exports['sort']=function(_0x1f9193){var _0x4609b7,_0xb3f67f=null;if(_0x1f9193){_0x4609b7=_0x1f9193['split'](',');_0xb3f67f=_[_0xbd67('0x15')](_0x4609b7,function(_0x40ec96){if(_0x40ec96[_0xbd67('0x16')]('-')===0x0){return[_0x40ec96===_0xbd67('0x17')?sequelize[_0xbd67('0x18')](sequelize[_0xbd67('0x19')]('priority'),_0xbd67('0x1a')):_0x40ec96[_0xbd67('0x1b')](0x1),_0xbd67('0x1c')];}else{return[_0x40ec96===_0xbd67('0x17')?sequelize[_0xbd67('0x18')](sequelize[_0xbd67('0x19')](_0xbd67('0x17')),_0xbd67('0x1a')):_0x40ec96,_0xbd67('0x1d')];}});}return _0xb3f67f;};exports[_0xbd67('0x1e')]=function(_0x46b7ff,_0x57602d){if(_[_0xbd67('0x1f')](_0x46b7ff)){return _0x46b7ff;}if(_['isArray'](_0x46b7ff)){for(var _0x25bf7a=0x0;_0x25bf7a<_0x46b7ff[_0xbd67('0x20')];_0x25bf7a+=0x1){_0x46b7ff[_0x25bf7a]=this[_0xbd67('0x1e')](_0x46b7ff[_0x25bf7a],_0x57602d);}return _0x46b7ff;}if(!_['isObject'](_0x46b7ff)){return _0x46b7ff;}if(_[_0xbd67('0x21')](_0x57602d)){_0x57602d=[_0x57602d];}if(!_[_0xbd67('0x13')](_0x57602d)){return _0x46b7ff;}for(var _0x4dfa19=0x0;_0x4dfa19<_0x57602d[_0xbd67('0x20')];_0x4dfa19+=0x1){_[_0xbd67('0x22')](_0x46b7ff,_0x57602d[_0x4dfa19]);}for(var _0x374f1b in _0x46b7ff){if(_0x46b7ff[_0xbd67('0x23')](_0x374f1b)){_0x46b7ff[_0x374f1b]=this[_0xbd67('0x1e')](_0x46b7ff[_0x374f1b],_0x57602d);}}return _0x46b7ff;};exports['isNumeric']=function(_0x5975dc){return _0x5975dc[_0xbd67('0x24')](RegExp(_0xbd67('0x25')))?!![]:![];};exports[_0xbd67('0x26')]=function(_0x44eced){return _0x44eced[_0xbd67('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0xbd67('0x27')]=function(_0x256137){var _0x2e123e=[];_0x256137[_0xbd67('0x5')](/[ ,]+/)[_0xbd67('0x28')](function(_0x5cb0ce){_0x5cb0ce=_0x5cb0ce['replace'](/([^:]")"+/g,'$1');_0x5cb0ce='+'+_0x5cb0ce+'*';var _0x5fcae8=/[ `!@#$%^&*()_\-?~]/;if(_0x5cb0ce[_0xbd67('0x24')](_0x5fcae8))_0x5cb0ce='\x22'+_0x5cb0ce+'\x22';_0x2e123e[_0xbd67('0x29')](_0x5cb0ce);});return _0x2e123e['join']('\x20');};exports[_0xbd67('0x2a')]=function(_0x15da85,_0xb3f593,_0x484989){var _0x4d1ce3={},_0x5186eb={};if(_0xb3f593['query'][_0xbd67('0x2b')]){_0xb3f593[_0xbd67('0x2c')]['id']=_0xb3f593[_0xbd67('0x2c')]['$id'];delete _0xb3f593['query'][_0xbd67('0x2b')];}_0x4d1ce3[_0xbd67('0x2d')]=_[_0xbd67('0x15')](_0x15da85,_0xbd67('0x12'));_0x4d1ce3[_0xbd67('0x2c')]=_[_0xbd67('0x3')](_0xb3f593['query']);_0x4d1ce3[_0xbd67('0x6')]=_[_0xbd67('0x2e')](_0x4d1ce3[_0xbd67('0x2d')],_0x4d1ce3['query']);_0x5186eb[_0xbd67('0x2f')]=_['intersection'](_0x4d1ce3[_0xbd67('0x2d')],this[_0xbd67('0x4')](_0xb3f593['query'][_0xbd67('0x4')]));_0x5186eb[_0xbd67('0x2f')]=_0x5186eb[_0xbd67('0x2f')][_0xbd67('0x20')]?_0x5186eb[_0xbd67('0x2f')]:_0x4d1ce3[_0xbd67('0x2d')];if(!_0xb3f593['query'][_0xbd67('0x23')](_0xbd67('0x30'))){_0x5186eb[_0xbd67('0x14')]=this[_0xbd67('0x14')](_0xb3f593[_0xbd67('0x2c')]['limit']);_0x5186eb['offset']=this[_0xbd67('0x31')](_0xb3f593[_0xbd67('0x2c')][_0xbd67('0x31')]);}_0x5186eb['order']=this[_0xbd67('0x32')](_0xb3f593[_0xbd67('0x2c')][_0xbd67('0x32')]);_0x5186eb[_0xbd67('0x33')]=this['filters'](_['pick'](_0xb3f593['query'],_0x4d1ce3['filters']),_0x15da85);if(_0xb3f593['query'][_0xbd67('0x34')]){var _0x5a6b2d=_0x15da85;var _0x4d08a6=_0xb3f593['query'][_0xbd67('0x34')];if(typeof _0x4d08a6===_0xbd67('0x35')){_0x5a6b2d=_[_0xbd67('0x34')](_0x15da85,function(_0x2ca134){return _['includes'](_0x4d08a6[_0xbd67('0x36')],_0x2ca134[_0xbd67('0x12')]);});_0x4d08a6=_0x4d08a6[_0xbd67('0x37')];}_0x5186eb[_0xbd67('0x33')]=_[_0xbd67('0x38')](_0x5186eb[_0xbd67('0x33')],{'$or':_[_0xbd67('0x15')](_0x5a6b2d,function(_0x532c9b){if(_0x532c9b[_0xbd67('0x9')]!=='VIRTUAL'){if(_0x484989){return sequelize[_0xbd67('0x33')](sequelize['fn'](_0xbd67('0x39'),sequelize[_0xbd67('0x19')](_0x532c9b[_0xbd67('0x12')])),{'$like':sequelize['fn'](_0xbd67('0x39'),'%'+_0xb3f593[_0xbd67('0x2c')][_0xbd67('0x34')]+'%')});}else{var _0xfe170b={};_0xfe170b[_0x532c9b['name']]={'$like':'%'+_0xb3f593[_0xbd67('0x2c')][_0xbd67('0x34')]+'%'};return _0xfe170b;}}})});}_0x5186eb=_['merge']({},_0x5186eb,_0xb3f593[_0xbd67('0x3a')]);return _0x5186eb;};
\ No newline at end of file
index 8d622fc..3b333e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x2a9b9b,_0x3801e5){var _0x592dc4=function(_0x4e9689){while(--_0x4e9689){_0x2a9b9b['push'](_0x2a9b9b['shift']());}};_0x592dc4(++_0x3801e5);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());};
\ 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(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 5091bb2..777783e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c09=['replace','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','filter','family','IPv4','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','join','createHash','md5','update','digest','hex','licenseToken','test','win32','utf8'];(function(_0x4e139c,_0x389082){var _0x3b7887=function(_0x4ed478){while(--_0x4ed478){_0x4e139c['push'](_0x4e139c['shift']());}};_0x3b7887(++_0x389082);}(_0x4c09,0xea));var _0x94c0=function(_0x3abdf8,_0x1d1aef){_0x3abdf8=_0x3abdf8-0x0;var _0xd62e3d=_0x4c09[_0x3abdf8];return _0xd62e3d;};'use strict';var _=require(_0x94c0('0x0'));var os=require('os');var crypto=require(_0x94c0('0x1'));var machine=require(_0x94c0('0x2'));var exec=require(_0x94c0('0x3'))[_0x94c0('0x4')];var config=require(_0x94c0('0x5'));function getInterfaces(){var _0x5beca9=[];var _0x167331=os[_0x94c0('0x6')]();var _0x417f78=_[_0x94c0('0x7')](_[_0x94c0('0x8')](_0x167331));for(var _0x4fb7bc=0x0;_0x4fb7bc<_0x417f78['length'];_0x4fb7bc++){var _0x44ec18=_0x167331[_0x417f78[_0x4fb7bc]][_0x94c0('0x9')](function(_0x596a06){return _0x596a06[_0x94c0('0xa')]===_0x94c0('0xb')&&_0x596a06['internal']===![];});_0x5beca9=_0x5beca9[_0x94c0('0xc')](_0x44ec18);}return _0x5beca9;}function getFirstInterface(){var _0x1166d4=_[_0x94c0('0xd')](getInterfaces());return{'macAddress':_0x1166d4&&_0x1166d4[_0x94c0('0xe')]?_0x1166d4[_0x94c0('0xe')]:_0x94c0('0xf'),'ipAddress':_0x1166d4&&_0x1166d4[_0x94c0('0x10')]?_0x1166d4[_0x94c0('0x10')]:'127.0.0.1'};}exports[_0x94c0('0x11')]=getFirstInterface;function getCPUhash(){var _0x2a2349=_[_0x94c0('0x7')](os[_0x94c0('0x12')]()[_0x94c0('0x13')](function(_0x856032){return _0x856032['model'];}))[_0x94c0('0x14')](':');return crypto[_0x94c0('0x15')](_0x94c0('0x16'))[_0x94c0('0x17')](_0x2a2349)[_0x94c0('0x18')](_0x94c0('0x19'));}exports['getUuid']=function(){var _0x91846f=os['platform']();var _0x3bc007=/[0-9a-f-]{36}/;if(config[_0x94c0('0x1a')]&&_0x3bc007[_0x94c0('0x1b')](config[_0x94c0('0x1a')])){return config['licenseToken'];}else if(_0x91846f===_0x94c0('0x1c')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x94c0('0x1d')})[_0x94c0('0x1e')]('\x0d\x0a','');}else{var _0x31d2e7=getFirstInterface();var _0x10418a=getCPUhash();var _0x4411d4=_0x10418a+'|'+os['hostname']()+'|'+_0x31d2e7['macAddress']+'|'+_0x31d2e7[_0x94c0('0x1f')];var _0x1bf7db=crypto[_0x94c0('0x15')](_0x94c0('0x16'))[_0x94c0('0x17')](_0x4411d4)[_0x94c0('0x18')](_0x94c0('0x19'));return _0x1bf7db[_0x94c0('0x20')](0x0,0x8)+'-'+_0x1bf7db[_0x94c0('0x20')](0x8,0xc)+'-'+_0x1bf7db[_0x94c0('0x20')](0xc,0x10)+'-'+_0x1bf7db[_0x94c0('0x20')](0x10,0x14)+'-'+_0x1bf7db[_0x94c0('0x20')](0x14);}};
\ No newline at end of file
+var _0xe5a3=['orderBy','keys','length','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','model','join','update','digest','getUuid','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','md5','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces'];(function(_0x395b81,_0x444d6e){var _0x6628d=function(_0x37b756){while(--_0x37b756){_0x395b81['push'](_0x395b81['shift']());}};_0x6628d(++_0x444d6e);}(_0xe5a3,0x16b));var _0x3e5a=function(_0x282844,_0x51621b){_0x282844=_0x282844-0x0;var _0x15f2cf=_0xe5a3[_0x282844];return _0x15f2cf;};'use strict';var _=require(_0x3e5a('0x0'));var os=require('os');var crypto=require(_0x3e5a('0x1'));var machine=require(_0x3e5a('0x2'));var exec=require(_0x3e5a('0x3'))[_0x3e5a('0x4')];var config=require(_0x3e5a('0x5'));function getInterfaces(){var _0x3a973d=[];var _0x498957=os[_0x3e5a('0x6')]();var _0x5a9f6c=_[_0x3e5a('0x7')](_[_0x3e5a('0x8')](_0x498957));for(var _0x54f94a=0x0;_0x54f94a<_0x5a9f6c[_0x3e5a('0x9')];_0x54f94a++){var _0x4fe806=_0x498957[_0x5a9f6c[_0x54f94a]][_0x3e5a('0xa')](function(_0x1ba20){return _0x1ba20[_0x3e5a('0xb')]===_0x3e5a('0xc')&&_0x1ba20[_0x3e5a('0xd')]===![];});_0x3a973d=_0x3a973d[_0x3e5a('0xe')](_0x4fe806);}return _0x3a973d;}function getFirstInterface(){var _0x193544=_['head'](getInterfaces());return{'macAddress':_0x193544&&_0x193544[_0x3e5a('0xf')]?_0x193544[_0x3e5a('0xf')]:_0x3e5a('0x10'),'ipAddress':_0x193544&&_0x193544[_0x3e5a('0x11')]?_0x193544[_0x3e5a('0x11')]:_0x3e5a('0x12')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x388f25=_[_0x3e5a('0x7')](os[_0x3e5a('0x13')]()[_0x3e5a('0x14')](function(_0x288555){return _0x288555[_0x3e5a('0x15')];}))[_0x3e5a('0x16')](':');return crypto['createHash']('md5')[_0x3e5a('0x17')](_0x388f25)[_0x3e5a('0x18')]('hex');}exports[_0x3e5a('0x19')]=function(){var _0x130daf=os[_0x3e5a('0x1a')]();var _0xb4a4c2=/[0-9a-f-]{36}/;if(config[_0x3e5a('0x1b')]&&_0xb4a4c2[_0x3e5a('0x1c')](config[_0x3e5a('0x1b')])){return config[_0x3e5a('0x1b')];}else if(_0x130daf==='win32'){return exec(_0x3e5a('0x1d'),{'encoding':_0x3e5a('0x1e')})[_0x3e5a('0x1f')]('\x0d\x0a','');}else{var _0x123042=getFirstInterface();var _0x42e5bb=getCPUhash();var _0x12a6f6=_0x42e5bb+'|'+os[_0x3e5a('0x20')]()+'|'+_0x123042[_0x3e5a('0x21')]+'|'+_0x123042['ipAddress'];var _0x58c9f9=crypto['createHash'](_0x3e5a('0x22'))['update'](_0x12a6f6)[_0x3e5a('0x18')](_0x3e5a('0x23'));return _0x58c9f9[_0x3e5a('0x24')](0x0,0x8)+'-'+_0x58c9f9['substring'](0x8,0xc)+'-'+_0x58c9f9[_0x3e5a('0x24')](0xc,0x10)+'-'+_0x58c9f9[_0x3e5a('0x24')](0x10,0x14)+'-'+_0x58c9f9[_0x3e5a('0x24')](0x14);}};
\ No newline at end of file
index c141a88..bff2387 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d74=['toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','findOrCreate','util','moment','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','data2','then','active','license','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','info','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0x8d74,0x1a3));var _0x48d7=function(_0x3c0162,_0x12fe0f){_0x3c0162=_0x3c0162-0x0;var _0x5b323b=_0x8d74[_0x3c0162];return _0x5b323b;};'use strict';var util=require(_0x48d7('0x0'));var moment=require(_0x48d7('0x1'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0x48d7('0x2'))(module,_0x48d7('0x3'));var db=require(_0x48d7('0x4'))['db'];var encryptor=require(_0x48d7('0x5'));var hardware=require(_0x48d7('0x6'));var logger=require(_0x48d7('0x7'))('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1e2642){return new BPromise(function(_0xc49a89,_0x5f4eb5){var _0x1340bf=util[_0x48d7('0x8')]('%s/api/servers/%s/check?version=%s',HOST,_0x1e2642,module[_0x48d7('0x9')][_0x48d7('0x3')]);if(oldToken){_0x1340bf=util[_0x48d7('0x8')](_0x48d7('0xa'),HOST,_0x1e2642,module[_0x48d7('0x9')][_0x48d7('0x3')],oldToken);}var _0x5a8236={'uri':_0x1340bf,'method':_0x48d7('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x5a8236)['then'](function(_0x373b82){_0xc49a89(_0x373b82);})[_0x48d7('0xc')](function(_0x5dcc2d){_0x5f4eb5(_0x5dcc2d);});});}function manageLicense(_0x5b45f6,_0x374a2b){var _0x230eb2=_0x374a2b[_0x48d7('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x230eb2[_0x48d7('0xe')]!==_0x5b45f6&&!_0x230eb2[_0x48d7('0xf')]){oldToken=_0x230eb2['data1'];}httpRequest(_0x5b45f6)[_0x48d7('0x10')](function(_0x3087bc){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3087bc[_0x48d7('0x11')]){isOldTokenSent=![];if(!_0x230eb2[_0x48d7('0x12')]&&_0x230eb2['license']!=_0x3087bc[_0x48d7('0x12')]||_0x230eb2[_0x48d7('0x12')]&&_0x230eb2['data2']){logger['info'](_0x48d7('0x13'));}if(_0x230eb2[_0x48d7('0x12')]&&!_0x230eb2[_0x48d7('0xf')]&&_0x230eb2[_0x48d7('0x12')]!=_0x3087bc[_0x48d7('0x12')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x230eb2['license']&&!_0x230eb2['data2']&&_0x230eb2[_0x48d7('0x12')]==_0x3087bc[_0x48d7('0x12')]){return _0x374a2b;}return _0x374a2b[_0x48d7('0x14')]({'data1':_0x5b45f6,'data2':null,'license':_0x3087bc['license']});}else{if(_0x3087bc['license']||_0x230eb2[_0x48d7('0x12')]){if(!_0x230eb2[_0x48d7('0xf')]){if(_0x230eb2[_0x48d7('0xe')]==_0x5b45f6){GRAY_PERIOD_REASON=_0x48d7('0x15');logger[_0x48d7('0x16')](_0x48d7('0x17'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x48d7('0x16')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x230eb2[_0x48d7('0xe')],_0x5b45f6);}logger[_0x48d7('0x16')](_0x48d7('0x18'),GRAY_PERIOD_REASON[_0x48d7('0x19')](),moment()[_0x48d7('0x8')]('YYYY-MM-DD\x20HH:mm'));return _0x374a2b['update']({'data2':encryptor[_0x48d7('0x1a')](moment()['format'](_0x48d7('0x1b')))});}else{if(moment()[_0x48d7('0x1c')](encryptor[_0x48d7('0x1d')](_0x230eb2[_0x48d7('0xf')]),_0x48d7('0x1e'))>DAYS){logger['info'](_0x48d7('0x1f'),moment()[_0x48d7('0x8')](_0x48d7('0x1b')));isOldTokenSent=![];return _0x374a2b[_0x48d7('0x14')]({'data1':_0x5b45f6,'data2':null,'license':null});}}}else{if(_0x230eb2[_0x48d7('0xe')]!=_0x5b45f6){logger[_0x48d7('0x16')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x230eb2['data1'],_0x5b45f6);return _0x374a2b['update']({'data1':_0x5b45f6,'data2':null,'license':null});}}}return _0x374a2b;})[_0x48d7('0x10')](function(_0x195ac3){_0x374a2b=_0x195ac3;})[_0x48d7('0xc')](function(_0x2b8350){logger[_0x48d7('0x20')](_0x2b8350[_0x48d7('0x21')]);})[_0x48d7('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x48d7('0x23')](),_0x374a2b);},TIME);});}function defaultLicense(){var _0xab21ab=hardware[_0x48d7('0x23')]();if(_0xab21ab){return db['License'][_0x48d7('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0xab21ab}})['spread'](function(_0x399c77,_0x18101c){logger[_0x48d7('0x16')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0xab21ab);manageLicense(_0xab21ab,_0x399c77);})[_0x48d7('0xc')](function(_0x48b1a8){logger['error'](_0x48b1a8[_0x48d7('0x21')]);});}}exports['default']=defaultLicense;
\ No newline at end of file
+var _0x20f7=['format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','update','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com'];(function(_0x418305,_0xcf9d75){var _0x39a433=function(_0x44dbfb){while(--_0x44dbfb){_0x418305['push'](_0x418305['shift']());}};_0x39a433(++_0xcf9d75);}(_0x20f7,0x13d));var _0x720f=function(_0x164fdd,_0x571315){_0x164fdd=_0x164fdd-0x0;var _0x3735ea=_0x20f7[_0x164fdd];return _0x3735ea;};'use strict';var util=require(_0x720f('0x0'));var moment=require(_0x720f('0x1'));var rp=require(_0x720f('0x2'));var BPromise=require(_0x720f('0x3'));var pkginfo=require(_0x720f('0x4'))(module,_0x720f('0x5'));var db=require(_0x720f('0x6'))['db'];var encryptor=require(_0x720f('0x7'));var hardware=require(_0x720f('0x8'));var logger=require('../logger')(_0x720f('0x9'));var HOST=_0x720f('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x47d0f2){return new BPromise(function(_0x1748ff,_0x40af36){var _0x574611=util[_0x720f('0xb')](_0x720f('0xc'),HOST,_0x47d0f2,module[_0x720f('0xd')][_0x720f('0x5')]);if(oldToken){_0x574611=util[_0x720f('0xb')](_0x720f('0xe'),HOST,_0x47d0f2,module[_0x720f('0xd')][_0x720f('0x5')],oldToken);}var _0x187a86={'uri':_0x574611,'method':_0x720f('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x187a86)[_0x720f('0x10')](function(_0x25a34f){_0x1748ff(_0x25a34f);})[_0x720f('0x11')](function(_0x230251){_0x40af36(_0x230251);});});}function manageLicense(_0x368be7,_0x115caa){var _0x41f9e7=_0x115caa['get']({'plain':!![]});if(!isOldTokenSent&&_0x41f9e7[_0x720f('0x12')]!==_0x368be7&&!_0x41f9e7[_0x720f('0x13')]){oldToken=_0x41f9e7[_0x720f('0x12')];}httpRequest(_0x368be7)[_0x720f('0x10')](function(_0x5b8b6f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5b8b6f[_0x720f('0x14')]){isOldTokenSent=![];if(!_0x41f9e7[_0x720f('0x9')]&&_0x41f9e7[_0x720f('0x9')]!=_0x5b8b6f[_0x720f('0x9')]||_0x41f9e7['license']&&_0x41f9e7['data2']){logger[_0x720f('0x15')](_0x720f('0x16'));}if(_0x41f9e7[_0x720f('0x9')]&&!_0x41f9e7[_0x720f('0x13')]&&_0x41f9e7[_0x720f('0x9')]!=_0x5b8b6f[_0x720f('0x9')]){logger[_0x720f('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x41f9e7[_0x720f('0x9')]&&!_0x41f9e7['data2']&&_0x41f9e7['license']==_0x5b8b6f[_0x720f('0x9')]){return _0x115caa;}return _0x115caa['update']({'data1':_0x368be7,'data2':null,'license':_0x5b8b6f['license']});}else{if(_0x5b8b6f[_0x720f('0x9')]||_0x41f9e7[_0x720f('0x9')]){if(!_0x41f9e7[_0x720f('0x13')]){if(_0x41f9e7[_0x720f('0x12')]==_0x368be7){GRAY_PERIOD_REASON=_0x720f('0x17');logger[_0x720f('0x15')](_0x720f('0x18'));}else{GRAY_PERIOD_REASON=_0x720f('0x19');logger['info'](_0x720f('0x1a'),_0x41f9e7[_0x720f('0x12')],_0x368be7);}logger[_0x720f('0x15')](_0x720f('0x1b'),GRAY_PERIOD_REASON[_0x720f('0x1c')](),moment()[_0x720f('0xb')](_0x720f('0x1d')));return _0x115caa['update']({'data2':encryptor['encryptString'](moment()[_0x720f('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x720f('0x1e')](encryptor[_0x720f('0x1f')](_0x41f9e7[_0x720f('0x13')]),'days')>DAYS){logger[_0x720f('0x15')]('DEMO\x20START\x20AT\x20%s',moment()[_0x720f('0xb')](_0x720f('0x1d')));isOldTokenSent=![];return _0x115caa[_0x720f('0x20')]({'data1':_0x368be7,'data2':null,'license':null});}}}else{if(_0x41f9e7[_0x720f('0x12')]!=_0x368be7){logger[_0x720f('0x15')](_0x720f('0x1a'),_0x41f9e7[_0x720f('0x12')],_0x368be7);return _0x115caa[_0x720f('0x20')]({'data1':_0x368be7,'data2':null,'license':null});}}}return _0x115caa;})[_0x720f('0x10')](function(_0x2a941a){_0x115caa=_0x2a941a;})[_0x720f('0x11')](function(_0x1cd459){logger['error'](_0x1cd459[_0x720f('0x21')]);})[_0x720f('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x720f('0x23')](),_0x115caa);},TIME);});}function defaultLicense(){var _0x50e1cb=hardware['getUuid']();if(_0x50e1cb){return db[_0x720f('0x24')][_0x720f('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x50e1cb}})[_0x720f('0x26')](function(_0x440809,_0x418a0b){logger[_0x720f('0x15')](_0x720f('0x27'),_0x50e1cb);manageLicense(_0x50e1cb,_0x440809);})[_0x720f('0x11')](function(_0x56297e){logger['error'](_0x56297e['message']);});}}exports[_0x720f('0x28')]=defaultLicense;
\ No newline at end of file
index cde15c5..1faa800 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1fa=['2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License','find','defaults','then','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','days','grayReason','changed','disabled','message','User','findAll','role','COUNT','count','admin','users','user','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','moment','bluebird','./hardware','../../mysqldb'];(function(_0x1e2e19,_0x9e7767){var _0x26ae44=function(_0x47bbd1){while(--_0x47bbd1){_0x1e2e19['push'](_0x1e2e19['shift']());}};_0x26ae44(++_0x9e7767);}(_0xc1fa,0xdd));var _0xac1f=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0xc1fa[_0x218972];return _0x1bb1a8;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xac1f('0x0'));var BPromise=require(_0xac1f('0x1'));var hardware=require(_0xac1f('0x2'));var encryptor=require('../../components/encryptor');var db=require(_0xac1f('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xac1f('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xac1f('0x5'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xac1f('0x6'),'machineUuid':hardware[_0xac1f('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x108351){return new BPromise(function(_0x52eaca,_0x4bbb7e){return db[_0xac1f('0x8')][_0xac1f('0x9')](_[_0xac1f('0xa')](_0x108351,{'raw':!![],'where':{'id':0x1}}))[_0xac1f('0xb')](function(_0x37b4cf){return checkLicense(_0x37b4cf,null);})[_0xac1f('0xb')](function(_0x3331d3){_0x52eaca(_0x3331d3);return;})['catch'](function(_0x3b761d){_0x4bbb7e(_0x3b761d);});});}function checkLicense(_0x21f829,_0x33d958){if(!_0x21f829){demoLicense[_0xac1f('0xc')]=_0x21f829[_0xac1f('0xd')];return demoLicense;}try{var _0x3935ad=_0x33d958||_0x21f829[_0xac1f('0xe')];if(_[_0xac1f('0xf')](_0x3935ad)){throw new Error(_0xac1f('0x10'));}var _0x13afcb=_0x21f829[_0xac1f('0xd')];var _0x4391e3=_0x21f829[_0xac1f('0x11')];var _0x2c2b2b=_0x13afcb[_0xac1f('0x12')]('-')[0x4];var _0x2a38a0=_0x13afcb[_0xac1f('0x12')]('-')[0x0];var _0xfb1acd=encryptor[_0xac1f('0x13')](_0x3935ad,util[_0xac1f('0x14')](_0xac1f('0x15'),_0x2c2b2b,_0x13afcb,_0x2a38a0));var _0x427dd5=JSON[_0xac1f('0x16')](_0xfb1acd);_0x427dd5[_0xac1f('0x17')]=![];_0x427dd5[_0xac1f('0xc')]=_0x13afcb;_0x427dd5[_0xac1f('0x18')]=hardware[_0xac1f('0x7')]();if(_0x4391e3){var _0x4bbc07=encryptor[_0xac1f('0x13')](_0x4391e3);_0x427dd5[_0xac1f('0x19')]=_0x4bbc07;_0x427dd5['deadline']=moment(_0x4bbc07)['add'](0x7,_0xac1f('0x1a'))[_0xac1f('0x14')]();_0x427dd5[_0xac1f('0x1b')]=_0x427dd5[_0xac1f('0xc')]!=_0x427dd5[_0xac1f('0x18')]?_0xac1f('0x1c'):_0xac1f('0x1d');}return _0x427dd5;}catch(_0x418c07){breakingLicense[_0xac1f('0xc')]=_0x21f829['data1'];breakingLicense[_0xac1f('0x1e')]=_0x418c07['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x26dedc,_0x1f9016){getLicense()[_0xac1f('0xb')](function(_0x144866){return db[_0xac1f('0x1f')][_0xac1f('0x20')]({'attributes':[_0xac1f('0x21'),[db['sequelize']['fn'](_0xac1f('0x22'),db['sequelize']['col'](_0xac1f('0x21'))),_0xac1f('0x23')]],'group':'role','where':{'role':{'$or':[_0xac1f('0x24'),'user','telephone']}},'raw':!![]})[_0xac1f('0xb')](function(_0x30674f){var _0x505cb9={'user':_0x144866[_0xac1f('0x25')]||0x0,'telephone':_0x144866['telephones']||0x0};_0x30674f['forEach'](function(_0x3ee3f6){var _0x271302=_0x3ee3f6[_0xac1f('0x21')]==='admin'?_0xac1f('0x26'):_0x3ee3f6[_0xac1f('0x21')];_0x505cb9[_0x271302]-=_0x3ee3f6[_0xac1f('0x23')];if(_0x505cb9[_0x271302]<0x0)_0x505cb9[_0x271302]=0x0;});_0x26dedc(_0x505cb9);return;});})['catch'](function(_0x57ab83){_0x1f9016(_0x57ab83);});});}function checkUserLimits(_0x49d4b5){return new BPromise(function(_0x7174e1,_0x1fe0e9){getLimits()['then'](function(_0x594615){var _0x1f68e5=_[_0xac1f('0x27')](_[_0xac1f('0x28')](_0x49d4b5,_0xac1f('0x21')),[_0xac1f('0x24'),_0xac1f('0x26'),'telephone']);var _0x3e03f5=(_0x1f68e5['admin']||0x0)+(_0x1f68e5[_0xac1f('0x26')]||0x0);var _0xef57b0=_0x1f68e5[_0xac1f('0x29')]||0x0;if(_0x3e03f5>_0x594615[_0xac1f('0x26')])return _0x1fe0e9(_0xac1f('0x2a'));if(_0xef57b0>_0x594615[_0xac1f('0x29')])return _0x1fe0e9(_0xac1f('0x2b'));return _0x7174e1();})['catch'](function(_0x5b7bf){_0x1fe0e9(_0x5b7bf);});});}module[_0xac1f('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0x72f7=['catch','uuid','data1','license','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','add','grayReason','disabled','message','findAll','role','sequelize','COUNT','col','admin','user','telephone','users','telephones','forEach','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','getUuid','License','then'];(function(_0x1eab24,_0x43a169){var _0x14d790=function(_0x3d36a0){while(--_0x3d36a0){_0x1eab24['push'](_0x1eab24['shift']());}};_0x14d790(++_0x43a169);}(_0x72f7,0x73));var _0x772f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72f7[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x772f('0x0'));var _=require(_0x772f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var hardware=require(_0x772f('0x2'));var encryptor=require(_0x772f('0x3'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x772f('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x772f('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x150453){return new BPromise(function(_0x521733,_0x215788){return db[_0x772f('0x6')]['find'](_['defaults'](_0x150453,{'raw':!![],'where':{'id':0x1}}))[_0x772f('0x7')](function(_0x1840dd){return checkLicense(_0x1840dd,null);})['then'](function(_0x177b7e){_0x521733(_0x177b7e);return;})[_0x772f('0x8')](function(_0x5ea3ca){_0x215788(_0x5ea3ca);});});}function checkLicense(_0x424251,_0x7bbc91){if(!_0x424251){demoLicense[_0x772f('0x9')]=_0x424251[_0x772f('0xa')];return demoLicense;}try{var _0x2ac733=_0x7bbc91||_0x424251[_0x772f('0xb')];if(_['isEmpty'](_0x2ac733)){throw new Error(_0x772f('0xc'));}var _0x30e35f=_0x424251[_0x772f('0xa')];var _0x4a4eec=_0x424251[_0x772f('0xd')];var _0xd7731b=_0x30e35f['split']('-')[0x4];var _0x14bb7f=_0x30e35f[_0x772f('0xe')]('-')[0x0];var _0xd19f78=encryptor[_0x772f('0xf')](_0x2ac733,util[_0x772f('0x10')](_0x772f('0x11'),_0xd7731b,_0x30e35f,_0x14bb7f));var _0x1d5d36=JSON[_0x772f('0x12')](_0xd19f78);_0x1d5d36[_0x772f('0x13')]=![];_0x1d5d36[_0x772f('0x9')]=_0x30e35f;_0x1d5d36[_0x772f('0x14')]=hardware['getUuid']();if(_0x4a4eec){var _0x344486=encryptor[_0x772f('0xf')](_0x4a4eec);_0x1d5d36[_0x772f('0x15')]=_0x344486;_0x1d5d36['deadline']=moment(_0x344486)[_0x772f('0x16')](0x7,'days')[_0x772f('0x10')]();_0x1d5d36[_0x772f('0x17')]=_0x1d5d36[_0x772f('0x9')]!=_0x1d5d36[_0x772f('0x14')]?'changed':_0x772f('0x18');}return _0x1d5d36;}catch(_0x53fe94){breakingLicense[_0x772f('0x9')]=_0x424251['data1'];breakingLicense[_0x772f('0x19')]=_0x53fe94[_0x772f('0x19')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5e93b5,_0x1d6650){getLicense()['then'](function(_0xa5f619){return db['User'][_0x772f('0x1a')]({'attributes':[_0x772f('0x1b'),[db[_0x772f('0x1c')]['fn'](_0x772f('0x1d'),db[_0x772f('0x1c')][_0x772f('0x1e')](_0x772f('0x1b'))),'count']],'group':'role','where':{'role':{'$or':[_0x772f('0x1f'),_0x772f('0x20'),_0x772f('0x21')]}},'raw':!![]})[_0x772f('0x7')](function(_0x44590a){var _0x31d593={'user':_0xa5f619[_0x772f('0x22')]||0x0,'telephone':_0xa5f619[_0x772f('0x23')]||0x0};_0x44590a[_0x772f('0x24')](function(_0x361d8a){var _0x5e2080=_0x361d8a[_0x772f('0x1b')]===_0x772f('0x1f')?_0x772f('0x20'):_0x361d8a[_0x772f('0x1b')];_0x31d593[_0x5e2080]-=_0x361d8a['count'];if(_0x31d593[_0x5e2080]<0x0)_0x31d593[_0x5e2080]=0x0;});_0x5e93b5(_0x31d593);return;});})[_0x772f('0x8')](function(_0x18920b){_0x1d6650(_0x18920b);});});}function checkUserLimits(_0x35ea36){return new BPromise(function(_0x574e31,_0x8758c0){getLimits()[_0x772f('0x7')](function(_0x4f1950){var _0x3f71ba=_['pick'](_[_0x772f('0x25')](_0x35ea36,_0x772f('0x1b')),[_0x772f('0x1f'),'user',_0x772f('0x21')]);var _0x1180d7=(_0x3f71ba['admin']||0x0)+(_0x3f71ba[_0x772f('0x20')]||0x0);var _0xed550e=_0x3f71ba[_0x772f('0x21')]||0x0;if(_0x1180d7>_0x4f1950[_0x772f('0x20')])return _0x8758c0(_0x772f('0x26'));if(_0xed550e>_0x4f1950[_0x772f('0x21')])return _0x8758c0(_0x772f('0x27'));return _0x574e31();})[_0x772f('0x8')](function(_0x13d0b7){_0x8758c0(_0x13d0b7);});});}module[_0x772f('0x28')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index 80cfeef..aa407d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8952=['app-id','secret','http://localhost:9000','myappanuglar-secret'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8952,0x17e));var _0x2895=function(_0x5d791f,_0x2da7d4){_0x5d791f=_0x5d791f-0x0;var _0x1a7f5f=_0x8952[_0x5d791f];return _0x1a7f5f;};'use strict';module['exports']={'DOMAIN':_0x2895('0x0'),'SESSION_SECRET':_0x2895('0x1'),'GOOGLE_ID':_0x2895('0x2'),'GOOGLE_SECRET':_0x2895('0x3'),'DEBUG':''};
\ No newline at end of file
+var _0x7708=['http://localhost:9000','app-id','exports'];(function(_0x4a6191,_0x282ade){var _0x1b3113=function(_0x53360b){while(--_0x53360b){_0x4a6191['push'](_0x4a6191['shift']());}};_0x1b3113(++_0x282ade);}(_0x7708,0x188));var _0x8770=function(_0xe1a3a5,_0xd3e341){_0xe1a3a5=_0xe1a3a5-0x0;var _0x362646=_0x7708[_0xe1a3a5];return _0x362646;};'use strict';module[_0x8770('0x0')]={'DOMAIN':_0x8770('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x8770('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
index 2fbd3b0..35155b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3232=['../utils/loggers'];(function(_0x326cc6,_0x217a9a){var _0xbe3626=function(_0x80f109){while(--_0x80f109){_0x326cc6['push'](_0x326cc6['shift']());}};_0xbe3626(++_0x217a9a);}(_0x3232,0x140));var _0x2323=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x3232[_0x187ee1];return _0x388160;};'use strict';var fileLogger=require(_0x2323('0x0'))['fileLogger'];module['exports']=fileLogger;
\ No newline at end of file
+var _0xbb79=['fileLogger'];(function(_0x253d49,_0x1dfd21){var _0x483c82=function(_0xc4d3bb){while(--_0xc4d3bb){_0x253d49['push'](_0x253d49['shift']());}};_0x483c82(++_0x1dfd21);}(_0xbb79,0x184));var _0x9bb7=function(_0x44cb8d,_0x160dee){_0x44cb8d=_0x44cb8d-0x0;var _0x2d20f7=_0xbb79[_0x44cb8d];return _0x2d20f7;};'use strict';var fileLogger=require('../utils/loggers')[_0x9bb7('0x0')];module['exports']=fileLogger;
\ No newline at end of file
index 99fa337..35485d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98ff=['xdr','../../services/xdr/index.js','exports','path','join','agi','email','../../services/email/index.js','routing','../../services/routing/index.js'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x98ff,0xf3));var _0xf98f=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x98ff[_0x220dbb];return _0x2b77de;};'use strict';var path=require(_0xf98f('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0xf98f('0x1')](__dirname,'../../services/express/index.js')},{'name':'ami','script':path[_0xf98f('0x1')](__dirname,'../../services/ami/index.js')},{'name':_0xf98f('0x2'),'script':path[_0xf98f('0x1')](__dirname,'../../services/agi/index.js')},{'name':_0xf98f('0x3'),'script':path['join'](__dirname,_0xf98f('0x4'))},{'name':_0xf98f('0x5'),'script':path[_0xf98f('0x1')](__dirname,_0xf98f('0x6'))},{'name':_0xf98f('0x7'),'script':path[_0xf98f('0x1')](__dirname,_0xf98f('0x8'))}]};module[_0xf98f('0x9')]=config;
\ No newline at end of file
+var _0xafea=['routing','../../services/xdr/index.js','exports','path','express','ami','../../services/ami/index.js','agi','join','../../services/agi/index.js','email'];(function(_0x3baa57,_0x3a33a9){var _0x1ccb8d=function(_0x4ed4d1){while(--_0x4ed4d1){_0x3baa57['push'](_0x3baa57['shift']());}};_0x1ccb8d(++_0x3a33a9);}(_0xafea,0x9d));var _0xaafe=function(_0x306824,_0x192b24){_0x306824=_0x306824-0x0;var _0x286bf3=_0xafea[_0x306824];return _0x286bf3;};'use strict';var path=require(_0xaafe('0x0'));var os=require('os');var config={'apps':[{'name':_0xaafe('0x1'),'script':path['join'](__dirname,'../../services/express/index.js')},{'name':_0xaafe('0x2'),'script':path['join'](__dirname,_0xaafe('0x3'))},{'name':_0xaafe('0x4'),'script':path[_0xaafe('0x5')](__dirname,_0xaafe('0x6'))},{'name':_0xaafe('0x7'),'script':path[_0xaafe('0x5')](__dirname,'../../services/email/index.js')},{'name':_0xaafe('0x8'),'script':path[_0xaafe('0x5')](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path[_0xaafe('0x5')](__dirname,_0xaafe('0x9'))}]};module[_0xaafe('0xa')]=config;
\ No newline at end of file
index 196ad1d..005a34f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcae6=['then','stop','restart','disconnect','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','start'];(function(_0x198622,_0x5a611a){var _0x5a524d=function(_0x208916){while(--_0x208916){_0x198622['push'](_0x198622['shift']());}};_0x5a524d(++_0x5a611a);}(_0xcae6,0x135));var _0x6cae=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0xcae6[_0x3ba924];return _0x4cc1df;};'use strict';var pm2=require(_0x6cae('0x0'));var BPromise=require(_0x6cae('0x1'));var config=require(_0x6cae('0x2'));function connect(){return new BPromise(function(_0x35d62b,_0xd3374){return pm2[_0x6cae('0x3')](function(_0x3ac82e){if(_0x3ac82e){return _0xd3374(_0x3ac82e);}return _0x35d62b(_0x6cae('0x4'));});});};exports[_0x6cae('0x5')]=function(_0x12602f){return connect()[_0x6cae('0x6')](function(){return new BPromise(function(_0x48a4be,_0x46e576){return pm2['start'](_0x12602f,function(_0x3c3261,_0x3d1706){if(_0x3c3261){return _0x46e576(_0x3c3261);}pm2['disconnect']();return _0x48a4be(_0x3d1706);});});});};exports[_0x6cae('0x7')]=function(_0x2d2503){return connect()['then'](function(){return new BPromise(function(_0x136223,_0x4dfe9d){return pm2[_0x6cae('0x7')](_0x2d2503,function(_0x5701e2,_0x4879a9){if(_0x5701e2){return _0x4dfe9d(_0x5701e2);}pm2['disconnect']();return _0x136223(_0x4879a9);});});});};exports[_0x6cae('0x8')]=function(_0x2e384c){return connect()['then'](function(){return new BPromise(function(_0x440b94,_0x2079cf){return pm2[_0x6cae('0x8')](_0x2e384c,function(_0x178e93,_0x294aa4){if(_0x178e93){return _0x2079cf(_0x178e93);}pm2[_0x6cae('0x9')]();return _0x440b94(_0x294aa4);});});});};exports[_0x6cae('0xa')]=function(){return connect()[_0x6cae('0x6')](function(){return new BPromise(function(_0x5fbdc0,_0x2cca53){return pm2[_0x6cae('0xa')](function(_0xaf4863,_0x3c496c){if(_0xaf4863){return _0x2cca53(_0xaf4863);}pm2[_0x6cae('0x9')]();return _0x5fbdc0(_0x3c496c);});});});};exports['describe']=function(_0x515a86){return connect()[_0x6cae('0x6')](function(){return new BPromise(function(_0x2cf443,_0x58526a){return pm2[_0x6cae('0xb')](_0x515a86,function(_0x20da83,_0xf4b182){if(_0x20da83){return _0x58526a(_0x20da83);}pm2[_0x6cae('0x9')]();return _0x2cf443(_0xf4b182);});});});};exports[_0x6cae('0xc')]=function(_0x2d49df){return connect()[_0x6cae('0x6')](function(){return new BPromise(function(_0x2da22a,_0x4e2571){return pm2['delete'](_0x2d49df,function(_0x4c8c46,_0x23f955){if(_0x4c8c46){return _0x4e2571(_0x4c8c46);}pm2[_0x6cae('0x9')]();return _0x2da22a(_0x23f955);});});});};exports[_0x6cae('0xd')]=function(){return connect()['then'](function(){return new BPromise(function(_0x3b3052,_0x251e89){return pm2['dump'](function(_0x1ec675){if(_0x1ec675){return _0x251e89(_0x1ec675);}return _0x3b3052(_0x6cae('0xe'));});});});};
\ No newline at end of file
+var _0x000b=['connect','connected','start','then','disconnect','stop','list','describe','delete','dump','saved','pm2','bluebird','./config'];(function(_0x307c31,_0x56f837){var _0x824d01=function(_0x47bcb4){while(--_0x47bcb4){_0x307c31['push'](_0x307c31['shift']());}};_0x824d01(++_0x56f837);}(_0x000b,0x1cb));var _0xb000=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x000b[_0x24259d];return _0x5a701;};'use strict';var pm2=require(_0xb000('0x0'));var BPromise=require(_0xb000('0x1'));var config=require(_0xb000('0x2'));function connect(){return new BPromise(function(_0x2c62a5,_0x37a7f3){return pm2[_0xb000('0x3')](function(_0x33f69e){if(_0x33f69e){return _0x37a7f3(_0x33f69e);}return _0x2c62a5(_0xb000('0x4'));});});};exports[_0xb000('0x5')]=function(_0x5c5ee9){return connect()[_0xb000('0x6')](function(){return new BPromise(function(_0x28d87d,_0x5c3830){return pm2['start'](_0x5c5ee9,function(_0x5dbc41,_0x441a34){if(_0x5dbc41){return _0x5c3830(_0x5dbc41);}pm2[_0xb000('0x7')]();return _0x28d87d(_0x441a34);});});});};exports[_0xb000('0x8')]=function(_0x526713){return connect()[_0xb000('0x6')](function(){return new BPromise(function(_0xc70cf7,_0x5b5a82){return pm2['stop'](_0x526713,function(_0x49a2ce,_0x1aaf41){if(_0x49a2ce){return _0x5b5a82(_0x49a2ce);}pm2[_0xb000('0x7')]();return _0xc70cf7(_0x1aaf41);});});});};exports['restart']=function(_0x46076c){return connect()[_0xb000('0x6')](function(){return new BPromise(function(_0x3c50a0,_0x449a96){return pm2['restart'](_0x46076c,function(_0x1cba6c,_0x583974){if(_0x1cba6c){return _0x449a96(_0x1cba6c);}pm2['disconnect']();return _0x3c50a0(_0x583974);});});});};exports[_0xb000('0x9')]=function(){return connect()[_0xb000('0x6')](function(){return new BPromise(function(_0x5aeb27,_0x356297){return pm2[_0xb000('0x9')](function(_0x49d19a,_0x85f3a3){if(_0x49d19a){return _0x356297(_0x49d19a);}pm2[_0xb000('0x7')]();return _0x5aeb27(_0x85f3a3);});});});};exports[_0xb000('0xa')]=function(_0xa7d092){return connect()[_0xb000('0x6')](function(){return new BPromise(function(_0x5d15a9,_0x525bed){return pm2[_0xb000('0xa')](_0xa7d092,function(_0x113ffd,_0x71dc86){if(_0x113ffd){return _0x525bed(_0x113ffd);}pm2[_0xb000('0x7')]();return _0x5d15a9(_0x71dc86);});});});};exports['delete']=function(_0x168c9a){return connect()[_0xb000('0x6')](function(){return new BPromise(function(_0x532061,_0x482b61){return pm2[_0xb000('0xb')](_0x168c9a,function(_0x2cc65d,_0x6fb9b5){if(_0x2cc65d){return _0x482b61(_0x2cc65d);}pm2[_0xb000('0x7')]();return _0x532061(_0x6fb9b5);});});});};exports[_0xb000('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5835eb,_0x28155e){return pm2['dump'](function(_0xdd479d){if(_0xdd479d){return _0x28155e(_0xdd479d);}return _0x5835eb(_0xb000('0xd'));});});});};
\ No newline at end of file
index e6c17cb..aa09291 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa78b=['YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','Setting','chatTimeout','then','findAll','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','timeout'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xa78b,0x1a8));var _0xba78=function(_0x3005b9,_0x5f009f){_0x3005b9=_0x3005b9-0x0;var _0xef310c=_0xa78b[_0x3005b9];return _0xef310c;};'use strict';var _=require(_0xba78('0x0'));var moment=require(_0xba78('0x1'));var Redis=require(_0xba78('0x2'));var util=require('util');var config=require(_0xba78('0x3'));var db=require(_0xba78('0x4'))['db'];var logger=require(_0xba78('0x5'))('schedule');config[_0xba78('0x6')]=_[_0xba78('0x7')](config['redis'],{'host':_0xba78('0x8'),'port':0x18eb});var io=require(_0xba78('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x22df75=0x0;var _0x3050a5=[];return db[_0xba78('0xa')]['find']({'raw':!![],'attributes':['id',_0xba78('0xb')],'where':{'id':0x1}})[_0xba78('0xc')](function(_0x1ec75d){_0x22df75=_0x1ec75d[_0xba78('0xb')];if(_0x22df75){return db['ChatInteraction'][_0xba78('0xd')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x1ec75d[_0xba78('0xb')],_0xba78('0xe'))}}});}else{return[];}})[_0xba78('0xc')](function(_0x995353){if(_0x995353&&_0x995353[_0xba78('0xf')]){_0x3050a5=_[_0xba78('0x10')](_0x995353||[],'id');logger[_0xba78('0x11')](_0xba78('0x12'),_0x3050a5[_0xba78('0x13')]());return db[_0xba78('0x14')][_0xba78('0x15')]({'closeReason':_0xba78('0x16'),'disposition':_0xba78('0x17'),'closed':!![],'closedAt':moment()['format'](_0xba78('0x18'))},{'where':{'id':_0x3050a5}});}})['then'](function(){if(_0x3050a5&&_0x3050a5[_0xba78('0xf')]){logger['info'](_0xba78('0x19'),_0x3050a5[_0xba78('0x13')]());for(var _0x1a777d=0x0;_0x1a777d<_0x3050a5[_0xba78('0xf')];_0x1a777d++){io['emit'](_0xba78('0x1a'),{'id':_0x3050a5[_0x1a777d],'closed':!![]});}}})[_0xba78('0x1b')](function(_0x280d93){logger[_0xba78('0x1c')](_0xba78('0x1d'),_0x280d93?util[_0xba78('0x1e')](_0x280d93,{'showHidden':![],'depth':null}):'');});}exports[_0xba78('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x4ac1=['../logger','schedule','defaults','redis','localhost','socket.io-emitter','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','length','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','info','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','moment','ioredis','util','../../config/environment','../../mysqldb'];(function(_0x55e847,_0x418bac){var _0x1c1e4c=function(_0x5826f5){while(--_0x5826f5){_0x55e847['push'](_0x55e847['shift']());}};_0x1c1e4c(++_0x418bac);}(_0x4ac1,0x100));var _0x14ac=function(_0x5a96b2,_0x37e19b){_0x5a96b2=_0x5a96b2-0x0;var _0x13c671=_0x4ac1[_0x5a96b2];return _0x13c671;};'use strict';var _=require('lodash');var moment=require(_0x14ac('0x0'));var Redis=require(_0x14ac('0x1'));var util=require(_0x14ac('0x2'));var config=require(_0x14ac('0x3'));var db=require(_0x14ac('0x4'))['db'];var logger=require(_0x14ac('0x5'))(_0x14ac('0x6'));config['redis']=_[_0x14ac('0x7')](config[_0x14ac('0x8')],{'host':_0x14ac('0x9'),'port':0x18eb});var io=require(_0x14ac('0xa'))(new Redis(config[_0x14ac('0x8')]));function closeInteractions(){var _0x38f647=0x0;var _0x4a4a12=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0x14ac('0xb')],'where':{'id':0x1}})[_0x14ac('0xc')](function(_0x366010){_0x38f647=_0x366010['chatTimeout'];if(_0x38f647){return db[_0x14ac('0xd')][_0x14ac('0xe')]({'raw':!![],'attributes':['id',_0x14ac('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x14ac('0x10')](_0x366010[_0x14ac('0xb')],'minutes')}}});}else{return[];}})['then'](function(_0xd6bd77){if(_0xd6bd77&&_0xd6bd77[_0x14ac('0x11')]){_0x4a4a12=_['map'](_0xd6bd77||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x4a4a12[_0x14ac('0x12')]());return db[_0x14ac('0xd')][_0x14ac('0x13')]({'closeReason':_0x14ac('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x14ac('0x15')](_0x14ac('0x16'))},{'where':{'id':_0x4a4a12}});}})['then'](function(){if(_0x4a4a12&&_0x4a4a12[_0x14ac('0x11')]){logger[_0x14ac('0x17')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x4a4a12[_0x14ac('0x12')]());for(var _0x141da6=0x0;_0x141da6<_0x4a4a12[_0x14ac('0x11')];_0x141da6++){io[_0x14ac('0x18')](_0x14ac('0x19'),{'id':_0x4a4a12[_0x141da6],'closed':!![]});}}})[_0x14ac('0x1a')](function(_0x4fdbc1){logger['error'](_0x14ac('0x1b'),_0x4fdbc1?util[_0x14ac('0x1c')](_0x4fdbc1,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index e623849..9060961 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fab=['startAllRefreshIntervals'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x6fab,0x1ae));var _0xb6fa=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0x6fab[_0x277107];return _0x1da046;};'use strict';function start(){var _0x4a6d0e=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x4a6d0e[_0xb6fa('0x0')]();}module['exports']={'intervals':{},'start':start};
\ No newline at end of file
+var _0x5c14=['startAllRefreshIntervals','exports'];(function(_0x4ef4b9,_0x254545){var _0x2cc08a=function(_0x10e203){while(--_0x10e203){_0x4ef4b9['push'](_0x4ef4b9['shift']());}};_0x2cc08a(++_0x254545);}(_0x5c14,0x110));var _0x45c1=function(_0x37f605,_0x5ca76e){_0x37f605=_0x37f605-0x0;var _0x4f1aff=_0x5c14[_0x37f605];return _0x4f1aff;};'use strict';function start(){var _0x1e1434=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x1e1434[_0x45c1('0x0')]();}module[_0x45c1('0x1')]={'intervals':{},'start':start};
\ No newline at end of file
index 78c76c4..188e509 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x200a=['error\x20mail','isNil','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','CloudProvider','keys','jobs','map','toString','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','cron','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update\x20cron','run','lodash','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','name','Smtp','user','bcc','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','extname','zip','existsSync','status','Sent','message','attachments','text','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','email\x20sent','catch'];(function(_0x569ddd,_0x43e315){var _0x314b5e=function(_0x54c996){while(--_0x54c996){_0x569ddd['push'](_0x569ddd['shift']());}};_0x314b5e(++_0x43e315);}(_0x200a,0x78));var _0xa200=function(_0x311f44,_0x1d7f5b){_0x311f44=_0x311f44-0x0;var _0x46f1e6=_0x200a[_0x311f44];return _0x46f1e6;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0xa200('0x0'));var moment=require('moment');var CronJobManager=require(_0xa200('0x1'));var jayson=require(_0xa200('0x2'));var BPromise=require(_0xa200('0x3'));var logger=require('../logger')(_0xa200('0x4'));var db=require(_0xa200('0x5'))['db'];var analyticCustomReportController=require(_0xa200('0x6'));var analyticDefaultReportController=require(_0xa200('0x7'));var client=jayson['client'][_0xa200('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x14579b,_0x8ec7f4){return function(){logger[_0xa200('0x9')](_0xa200('0xa'),_0x14579b[_0xa200('0xb')]);var _0x3eaa05=!![];var _0x5c257e=_0x14579b['MailAccount'][_0xa200('0xc')]();var _0x1bf39a={'account':_0x5c257e,'message':{'from':util[_0xa200('0xd')](_0xa200('0xe'),_0x14579b[_0xa200('0xf')][_0xa200('0x10')],_0x14579b[_0xa200('0xf')]['email']||_0x14579b[_0xa200('0xf')][_0xa200('0x11')][_0xa200('0x12')]),'to':_0x14579b['email'],'cc':_0x14579b['cc'],'bcc':_0x14579b[_0xa200('0x13')],'subject':util[_0xa200('0xd')]('Report\x20%s\x20last\x20%s\x20%s',_0x8ec7f4[_0xa200('0x10')],_0x14579b[_0xa200('0x14')],_0x14579b[_0xa200('0x15')])}};var _0x21d079=path[_0xa200('0x16')](__dirname,_0xa200('0x17'));var _0x3b94be=_0x8ec7f4[_0xa200('0x18')];var _0x5719c9=util[_0xa200('0xd')]('%s.%s',path[_0xa200('0x19')](_0x8ec7f4[_0xa200('0x18')],path[_0xa200('0x1a')](_0x8ec7f4[_0xa200('0x18')])),_0xa200('0x1b'));var _0x570afb=path[_0xa200('0x16')](_0x21d079,_0x3b94be);var _0x3844f1=path[_0xa200('0x16')](_0x21d079,_0x5719c9);if(fs[_0xa200('0x1c')](_0x570afb)){_0x8ec7f4[_0xa200('0x1d')]=_0xa200('0x1e');_0x1bf39a[_0xa200('0x1f')][_0xa200('0x20')]=[{'filename':_0x3b94be,'path':_0x570afb}];_0x1bf39a['message'][_0xa200('0x21')]=util[_0xa200('0xd')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xa200('0x22')](_0x8ec7f4,null,0x2));}else if(fs['existsSync'](_0x3844f1)){_0x8ec7f4[_0xa200('0x1d')]=_0xa200('0x1e');_0x1bf39a[_0xa200('0x1f')][_0xa200('0x20')]=[{'filename':_0x5719c9,'path':_0x3844f1}];}else{_0x1bf39a[_0xa200('0x1f')][_0xa200('0x21')]=_0xa200('0x23');if(!_0x14579b[_0xa200('0x24')]){_0x3eaa05=![];logger[_0xa200('0x9')](_0xa200('0x25'));}}if(_0x3eaa05){return client[_0xa200('0x26')](_0xa200('0x27'),_0x1bf39a)[_0xa200('0x28')](function(_0x264d6f){if(_0x264d6f[_0xa200('0x29')]){return logger[_0xa200('0x29')]('error\x20mail',JSON['stringify'](_0x264d6f));}return logger['info'](_0xa200('0x2a'));})[_0xa200('0x2b')](function(_0x2f4a42){return logger['error'](_0xa200('0x2c'),JSON[_0xa200('0x22')](_0x2f4a42));});}};}function handleError(){return function(_0x59d711){return logger[_0xa200('0x29')](JSON['stringify'](_0x59d711));};}function handleResult(_0x1f1ae4){return function(_0x48ef12){logger['info']('data',JSON[_0xa200('0x22')](_0x48ef12));if(_0x1f1ae4[_0xa200('0xf')]&&_0x1f1ae4['MailAccount'][_0xa200('0x11')]&&!_[_0xa200('0x2d')](_0x1f1ae4[_0xa200('0xb')])){setTimeout(handleSendEmail(_0x1f1ae4,_0x48ef12),0x3c*0x3e8);}};}function handleJob(_0x2b2be1){return function(){try{if(_['isNil'](_0x2b2be1[_0xa200('0x14')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xa200('0x2d')](_0x2b2be1[_0xa200('0x15')])){return logger[_0xa200('0x9')]('subtractUnit\x20null\x20or\x20undefined');}var _0x3b5847={'startDate':moment()[_0xa200('0x2e')](_0x2b2be1[_0xa200('0x14')],_0x2b2be1[_0xa200('0x15')])[_0xa200('0xd')](_0xa200('0x2f')),'endDate':moment()[_0xa200('0xd')](_0xa200('0x2f')),'type':'scheduled','output':_0x2b2be1[_0xa200('0x30')],'name':_0x2b2be1[_0xa200('0x10')]};if(!_['isNil'](_0x2b2be1[_0xa200('0x31')])){logger[_0xa200('0x9')](_0xa200('0x32'),_0x2b2be1[_0xa200('0x31')]);return analyticDefaultReportController[_0xa200('0x33')]({'id':_0x2b2be1[_0xa200('0x31')]},_0x3b5847)[_0xa200('0x28')](handleResult(_0x2b2be1))[_0xa200('0x2b')](handleError());}if(!_['isNil'](_0x2b2be1[_0xa200('0x34')])){logger[_0xa200('0x9')](_0xa200('0x35'),_0x2b2be1[_0xa200('0x34')]);return analyticCustomReportController['runReport']({'id':_0x2b2be1[_0xa200('0x34')]},_0x3b5847)[_0xa200('0x28')](handleResult(_0x2b2be1))['catch'](handleError());}}catch(_0x4563cd){logger['error'](JSON['stringify'](_0x4563cd));}return logger[_0xa200('0x9')](_0xa200('0x36'));};}function getJobs(_0x2b30f6){var _0x367593={};if(_0x2b30f6){_0x367593['id']=_0x2b30f6;}return db[_0xa200('0x37')][_0xa200('0x38')]({'where':_0x367593,'include':[{'model':db[_0xa200('0xf')],'attributes':['id',_0xa200('0x10'),_0xa200('0xb')],'include':[{'model':db['MailServerOut'],'as':_0xa200('0x11'),'include':[{'model':db[_0xa200('0x39')],'as':'CloudProvider'}]}]}]})[_0xa200('0x28')](function(_0x1a75ac){var _0x9c84b6=_[_0xa200('0x3a')](manager[_0xa200('0x3b')]);var _0x1563eb=_[_0xa200('0x3c')](_0x1a75ac,function(_0x5eedda){return _0x5eedda['id'][_0xa200('0x3d')]();});var _0x577c9b=_['keyBy'](_0x1a75ac,function(_0x269009){return _0x269009['id'][_0xa200('0x3d')]();});var _0x320f5b=_0x2b30f6?_0x1563eb:_['difference'](_0x1563eb,_0x9c84b6);var _0x201df8=_[_0xa200('0x3e')](_0x1563eb,_0x9c84b6);var _0x16ebe8=_['difference'](_0x9c84b6,_0x1563eb);var _0x1f61ba;var _0x429ec4;for(_0x1f61ba=0x0;_0x1f61ba<_0x16ebe8[_0xa200('0x3f')]&&!_0x2b30f6;_0x1f61ba+=0x1){_0x429ec4=_0x16ebe8[_0x1f61ba]['toString']();if(manager[_0xa200('0x40')](_0x429ec4)){manager[_0xa200('0x41')](_0x429ec4);manager[_0xa200('0x42')](_0x429ec4);logger['info'](_0xa200('0x43'),_0x429ec4);}}logger['info'](_0xa200('0x44'),JSON[_0xa200('0x22')](_0x320f5b));for(_0x1f61ba=0x0;_0x1f61ba<_0x320f5b[_0xa200('0x3f')];_0x1f61ba+=0x1){_0x429ec4=_0x320f5b[_0x1f61ba][_0xa200('0x3d')]();logger[_0xa200('0x9')](_0xa200('0x45'),_0x429ec4);if(_0x2b30f6){logger[_0xa200('0x9')](_0xa200('0x46'),_0x2b30f6);logger[_0xa200('0x9')](JSON[_0xa200('0x22')](_0x577c9b[_0x429ec4]));BPromise[_0xa200('0x47')]()[_0xa200('0x28')](handleJob(_0x577c9b[_0x429ec4]));logger[_0xa200('0x9')]('run\x20job',_0x577c9b[_0x429ec4][_0xa200('0x10')],_0x577c9b[_0x429ec4][_0xa200('0x48')]);}else if(_0x577c9b[_0x429ec4]['cron']&&_0x577c9b[_0x429ec4]['active']&&moment()[_0xa200('0x49')](_0x577c9b[_0x429ec4][_0xa200('0x4a')],_0x577c9b[_0x429ec4][_0xa200('0x4b')])){manager[_0xa200('0x4c')](_0x429ec4,_0x577c9b[_0x429ec4][_0xa200('0x48')],handleJob(_0x577c9b[_0x429ec4]));manager[_0xa200('0x4d')](_0x429ec4);logger[_0xa200('0x9')](_0xa200('0x4e'),_0x577c9b[_0x429ec4][_0xa200('0x10')],_0x577c9b[_0x429ec4][_0xa200('0x48')]);}else if(manager[_0xa200('0x40')](_0x429ec4)){manager[_0xa200('0x41')](_0x429ec4);manager[_0xa200('0x42')](_0x429ec4);logger['info'](_0xa200('0x4f'),_0x577c9b[_0x429ec4]['name'],_0x577c9b[_0x429ec4][_0xa200('0x48')]);}}for(_0x1f61ba=0x0,_0x429ec4;_0x1f61ba<_0x201df8[_0xa200('0x3f')]&&!_0x2b30f6;_0x1f61ba+=0x1){_0x429ec4=_0x201df8[_0x1f61ba]['toString']();if(manager[_0xa200('0x40')](_0x429ec4)){if(_0x577c9b[_0x429ec4][_0xa200('0x48')]&&_0x577c9b[_0x429ec4]['active']&&moment()[_0xa200('0x49')](_0x577c9b[_0x429ec4][_0xa200('0x4a')],_0x577c9b[_0x429ec4][_0xa200('0x4b')])){manager['update'](_0x429ec4,_0x577c9b[_0x429ec4][_0xa200('0x48')],handleJob(_0x577c9b[_0x429ec4]));logger[_0xa200('0x9')](_0xa200('0x50'),_0x577c9b[_0x429ec4]['name'],_0x577c9b[_0x429ec4][_0xa200('0x48')]);}else{manager[_0xa200('0x41')](_0x429ec4);manager[_0xa200('0x42')](_0x429ec4);logger[_0xa200('0x9')](_0xa200('0x4f'),_0x577c9b[_0x429ec4][_0xa200('0x10')],_0x577c9b[_0x429ec4][_0xa200('0x48')]);}}}})[_0xa200('0x2b')](function(_0x5c0f3e){logger[_0xa200('0x29')](JSON[_0xa200('0x22')](_0x5c0f3e));});}exports[_0xa200('0x51')]=function(_0x54bc26){return getJobs(_0x54bc26);};exports[_0xa200('0x4d')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x12ca=['client','info','email','MailAccount','format','\x22%s\x22\x20<%s>','user','bcc','name','join','../../files/reports','savename','%s.%s','extname','zip','existsSync','status','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','Smtp','isNil','subtractNumber','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','findAll','MailServerOut','CloudProvider','keys','jobs','toString','keyBy','difference','intersection','length','exists','stop','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','endAt','update','deleteJob','stop\x20cron','util','path','lodash','moment','cron-job-manager','jayson/promise','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller'];(function(_0x538134,_0x1c9ed1){var _0x4ae86f=function(_0x8da2ba){while(--_0x8da2ba){_0x538134['push'](_0x538134['shift']());}};_0x4ae86f(++_0x1c9ed1);}(_0x12ca,0x14a));var _0xa12c=function(_0x4e08da,_0x596944){_0x4e08da=_0x4e08da-0x0;var _0x2193f0=_0x12ca[_0x4e08da];return _0x2193f0;};'use strict';var fs=require('fs');var util=require(_0xa12c('0x0'));var path=require(_0xa12c('0x1'));var _=require(_0xa12c('0x2'));var moment=require(_0xa12c('0x3'));var CronJobManager=require(_0xa12c('0x4'));var jayson=require(_0xa12c('0x5'));var BPromise=require('bluebird');var logger=require(_0xa12c('0x6'))('schedule');var db=require(_0xa12c('0x7'))['db'];var analyticCustomReportController=require(_0xa12c('0x8'));var analyticDefaultReportController=require(_0xa12c('0x9'));var client=jayson[_0xa12c('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x574d53,_0x22fac2){return function(){logger[_0xa12c('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x574d53[_0xa12c('0xc')]);var _0x2cbc2a=!![];var _0x488a1b=_0x574d53[_0xa12c('0xd')]['getSmtpOptions']();var _0x16c727={'account':_0x488a1b,'message':{'from':util[_0xa12c('0xe')](_0xa12c('0xf'),_0x574d53[_0xa12c('0xd')]['name'],_0x574d53[_0xa12c('0xd')]['email']||_0x574d53[_0xa12c('0xd')]['Smtp'][_0xa12c('0x10')]),'to':_0x574d53['email'],'cc':_0x574d53['cc'],'bcc':_0x574d53[_0xa12c('0x11')],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x22fac2[_0xa12c('0x12')],_0x574d53['subtractNumber'],_0x574d53['subtractUnit'])}};var _0x54d296=path[_0xa12c('0x13')](__dirname,_0xa12c('0x14'));var _0x4b7180=_0x22fac2[_0xa12c('0x15')];var _0x24ce12=util[_0xa12c('0xe')](_0xa12c('0x16'),path['basename'](_0x22fac2[_0xa12c('0x15')],path[_0xa12c('0x17')](_0x22fac2[_0xa12c('0x15')])),_0xa12c('0x18'));var _0x4d9c54=path[_0xa12c('0x13')](_0x54d296,_0x4b7180);var _0x1fdc93=path[_0xa12c('0x13')](_0x54d296,_0x24ce12);if(fs[_0xa12c('0x19')](_0x4d9c54)){_0x22fac2[_0xa12c('0x1a')]='Sent';_0x16c727[_0xa12c('0x1b')]['attachments']=[{'filename':_0x4b7180,'path':_0x4d9c54}];_0x16c727[_0xa12c('0x1b')][_0xa12c('0x1c')]=util[_0xa12c('0xe')](_0xa12c('0x1d'),JSON[_0xa12c('0x1e')](_0x22fac2,null,0x2));}else if(fs[_0xa12c('0x19')](_0x1fdc93)){_0x22fac2[_0xa12c('0x1a')]=_0xa12c('0x1f');_0x16c727[_0xa12c('0x1b')][_0xa12c('0x20')]=[{'filename':_0x24ce12,'path':_0x1fdc93}];}else{_0x16c727[_0xa12c('0x1b')][_0xa12c('0x1c')]=_0xa12c('0x21');if(!_0x574d53[_0xa12c('0x22')]){_0x2cbc2a=![];logger[_0xa12c('0xb')](_0xa12c('0x23'));}}if(_0x2cbc2a){return client[_0xa12c('0x24')](_0xa12c('0x25'),_0x16c727)[_0xa12c('0x26')](function(_0x483115){if(_0x483115['error']){return logger[_0xa12c('0x27')](_0xa12c('0x28'),JSON[_0xa12c('0x1e')](_0x483115));}return logger[_0xa12c('0xb')](_0xa12c('0x29'));})[_0xa12c('0x2a')](function(_0x3d57d1){return logger['error']('error\x20mail',JSON[_0xa12c('0x1e')](_0x3d57d1));});}};}function handleError(){return function(_0x2820fb){return logger[_0xa12c('0x27')](JSON[_0xa12c('0x1e')](_0x2820fb));};}function handleResult(_0xa00329){return function(_0xd17c8f){logger[_0xa12c('0xb')](_0xa12c('0x2b'),JSON[_0xa12c('0x1e')](_0xd17c8f));if(_0xa00329[_0xa12c('0xd')]&&_0xa00329['MailAccount'][_0xa12c('0x2c')]&&!_[_0xa12c('0x2d')](_0xa00329['email'])){setTimeout(handleSendEmail(_0xa00329,_0xd17c8f),0x3c*0x3e8);}};}function handleJob(_0x29af95){return function(){try{if(_[_0xa12c('0x2d')](_0x29af95[_0xa12c('0x2e')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xa12c('0x2d')](_0x29af95[_0xa12c('0x2f')])){return logger[_0xa12c('0xb')](_0xa12c('0x30'));}var _0x571ac3={'startDate':moment()[_0xa12c('0x31')](_0x29af95[_0xa12c('0x2e')],_0x29af95[_0xa12c('0x2f')])['format'](_0xa12c('0x32')),'endDate':moment()[_0xa12c('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xa12c('0x33'),'output':_0x29af95[_0xa12c('0x34')],'name':_0x29af95[_0xa12c('0x12')]};if(!_[_0xa12c('0x2d')](_0x29af95[_0xa12c('0x35')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x29af95[_0xa12c('0x35')]);return analyticDefaultReportController[_0xa12c('0x36')]({'id':_0x29af95[_0xa12c('0x35')]},_0x571ac3)[_0xa12c('0x26')](handleResult(_0x29af95))[_0xa12c('0x2a')](handleError());}if(!_[_0xa12c('0x2d')](_0x29af95['CustomReportId'])){logger['info'](_0xa12c('0x37'),_0x29af95[_0xa12c('0x38')]);return analyticCustomReportController[_0xa12c('0x36')]({'id':_0x29af95[_0xa12c('0x38')]},_0x571ac3)['then'](handleResult(_0x29af95))[_0xa12c('0x2a')](handleError());}}catch(_0x50b37d){logger[_0xa12c('0x27')](JSON[_0xa12c('0x1e')](_0x50b37d));}return logger[_0xa12c('0xb')](_0xa12c('0x39'));};}function getJobs(_0x53c103){var _0x26d3bd={};if(_0x53c103){_0x26d3bd['id']=_0x53c103;}return db['Schedule'][_0xa12c('0x3a')]({'where':_0x26d3bd,'include':[{'model':db[_0xa12c('0xd')],'attributes':['id',_0xa12c('0x12'),_0xa12c('0xc')],'include':[{'model':db[_0xa12c('0x3b')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0xa12c('0x3c')}]}]}]})[_0xa12c('0x26')](function(_0x3e736f){var _0x4b41c2=_[_0xa12c('0x3d')](manager[_0xa12c('0x3e')]);var _0xe5a356=_['map'](_0x3e736f,function(_0x1c0c8a){return _0x1c0c8a['id'][_0xa12c('0x3f')]();});var _0x1f7316=_[_0xa12c('0x40')](_0x3e736f,function(_0x274c7c){return _0x274c7c['id'][_0xa12c('0x3f')]();});var _0x17b491=_0x53c103?_0xe5a356:_[_0xa12c('0x41')](_0xe5a356,_0x4b41c2);var _0x1b7672=_[_0xa12c('0x42')](_0xe5a356,_0x4b41c2);var _0x331783=_[_0xa12c('0x41')](_0x4b41c2,_0xe5a356);var _0x26224c;var _0x5770c3;for(_0x26224c=0x0;_0x26224c<_0x331783[_0xa12c('0x43')]&&!_0x53c103;_0x26224c+=0x1){_0x5770c3=_0x331783[_0x26224c][_0xa12c('0x3f')]();if(manager[_0xa12c('0x44')](_0x5770c3)){manager[_0xa12c('0x45')](_0x5770c3);manager['deleteJob'](_0x5770c3);logger[_0xa12c('0xb')]('delete\x20cron',_0x5770c3);}}logger[_0xa12c('0xb')]('toRun',JSON['stringify'](_0x17b491));for(_0x26224c=0x0;_0x26224c<_0x17b491[_0xa12c('0x43')];_0x26224c+=0x1){_0x5770c3=_0x17b491[_0x26224c][_0xa12c('0x3f')]();logger[_0xa12c('0xb')](_0xa12c('0x46'),_0x5770c3);if(_0x53c103){logger[_0xa12c('0xb')](_0xa12c('0x47'),_0x53c103);logger['info'](JSON['stringify'](_0x1f7316[_0x5770c3]));BPromise[_0xa12c('0x48')]()[_0xa12c('0x26')](handleJob(_0x1f7316[_0x5770c3]));logger['info'](_0xa12c('0x49'),_0x1f7316[_0x5770c3][_0xa12c('0x12')],_0x1f7316[_0x5770c3][_0xa12c('0x4a')]);}else if(_0x1f7316[_0x5770c3][_0xa12c('0x4a')]&&_0x1f7316[_0x5770c3][_0xa12c('0x4b')]&&moment()[_0xa12c('0x4c')](_0x1f7316[_0x5770c3][_0xa12c('0x4d')],_0x1f7316[_0x5770c3]['endAt'])){manager[_0xa12c('0x4e')](_0x5770c3,_0x1f7316[_0x5770c3]['cron'],handleJob(_0x1f7316[_0x5770c3]));manager[_0xa12c('0x4f')](_0x5770c3);logger['info'](_0xa12c('0x50'),_0x1f7316[_0x5770c3][_0xa12c('0x12')],_0x1f7316[_0x5770c3][_0xa12c('0x4a')]);}else if(manager[_0xa12c('0x44')](_0x5770c3)){manager[_0xa12c('0x45')](_0x5770c3);manager['deleteJob'](_0x5770c3);logger[_0xa12c('0xb')]('stop\x20cron',_0x1f7316[_0x5770c3][_0xa12c('0x12')],_0x1f7316[_0x5770c3][_0xa12c('0x4a')]);}}for(_0x26224c=0x0,_0x5770c3;_0x26224c<_0x1b7672[_0xa12c('0x43')]&&!_0x53c103;_0x26224c+=0x1){_0x5770c3=_0x1b7672[_0x26224c][_0xa12c('0x3f')]();if(manager[_0xa12c('0x44')](_0x5770c3)){if(_0x1f7316[_0x5770c3][_0xa12c('0x4a')]&&_0x1f7316[_0x5770c3][_0xa12c('0x4b')]&&moment()['isBetween'](_0x1f7316[_0x5770c3][_0xa12c('0x4d')],_0x1f7316[_0x5770c3][_0xa12c('0x51')])){manager[_0xa12c('0x52')](_0x5770c3,_0x1f7316[_0x5770c3][_0xa12c('0x4a')],handleJob(_0x1f7316[_0x5770c3]));logger[_0xa12c('0xb')]('update\x20cron',_0x1f7316[_0x5770c3]['name'],_0x1f7316[_0x5770c3]['cron']);}else{manager[_0xa12c('0x45')](_0x5770c3);manager[_0xa12c('0x53')](_0x5770c3);logger[_0xa12c('0xb')](_0xa12c('0x54'),_0x1f7316[_0x5770c3][_0xa12c('0x12')],_0x1f7316[_0x5770c3][_0xa12c('0x4a')]);}}}})[_0xa12c('0x2a')](function(_0x475dde){logger[_0xa12c('0x27')](JSON[_0xa12c('0x1e')](_0x475dde));});}exports['run']=function(_0x465c88){return getJobs(_0x465c88);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 024949c..6b85277 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x693f=['name','SequelizeValidationError','error','inspect','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','Cloud\x20Provider\x20not\x20available','forEach','push','all','start','lodash','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','Comprehend','detectSentiment','substring','info','transcribeName','data1','data2','transcribeRegion','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','then','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','catch'];(function(_0x381a54,_0x575db7){var _0x1119ce=function(_0x1b2a25){while(--_0x1b2a25){_0x381a54['push'](_0x381a54['shift']());}};_0x1119ce(++_0x575db7);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};var _=require(_0xf693('0x0'));var AWS=require(_0xf693('0x1'));var rp=require(_0xf693('0x2'));var util=require(_0xf693('0x3'));var BPromise=require('bluebird');var db=require(_0xf693('0x4'))['db'];var logger=require(_0xf693('0x5'))(_0xf693('0x6'));function getTranscriptionJob(_0x1d272f,_0x3d2e05,_0x6e749b,_0x42578c){return new Promise(function(_0x4b4d39,_0x1d3b17){var _0x33305c=new AWS['TranscribeService']({'accessKeyId':_0x3d2e05,'secretAccessKey':_0x1d272f,'region':_0x6e749b});_0x33305c[_0xf693('0x7')]({'TranscriptionJobName':_0x42578c},function(_0x594505,_0x38e78a){if(_0x594505){return _0x1d3b17(_0x594505);}else{return _0x4b4d39(_0x38e78a);}});});}function sentiment(_0x4ae88f,_0x3dfb0d,_0x17075d,_0x48984a,_0x4b09d6){return new Promise(function(_0x5d9159,_0x38b847){var _0x527cd9=new AWS[(_0xf693('0x8'))]({'accessKeyId':_0x3dfb0d,'secretAccessKey':_0x4ae88f,'region':_0x17075d});_0x527cd9[_0xf693('0x9')]({'Text':_0x48984a,'LanguageCode':_0x4b09d6[_0xf693('0xa')](0x0,0x2)},function(_0x1dc0da,_0x1f9205){if(_0x1dc0da){return _0x38b847(_0x1dc0da);}else{return _0x5d9159(_0x1f9205);}});});}function checkTranscribeJob(_0x5a5a35,_0x5d0d4c,_0xd08be1){var _0x38bd65;return new BPromise(function(_0x4c9ab7,_0x25d3f6){logger[_0xf693('0xb')](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x5a5a35['id'],_0x5a5a35[_0xf693('0xc')]));return getTranscriptionJob(_0xd08be1[_0xf693('0xd')],_0xd08be1[_0xf693('0xe')],_0x5d0d4c[_0xf693('0xf')],_0x5a5a35[_0xf693('0xc')])['then'](function(_0x1d9278){logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x11'),_0x5a5a35['id'],_0x5a5a35[_0xf693('0xc')],_0x1d9278[_0xf693('0x12')]['TranscriptionJobStatus']));if(!_0x5a5a35['fileText']){switch(_0x1d9278['TranscriptionJob'][_0xf693('0x13')]){case _0xf693('0x14'):var _0x3f4d4d={'transcribeStatus':_0x1d9278[_0xf693('0x12')][_0xf693('0x13')],'fileUri':_0x1d9278['TranscriptionJob'][_0xf693('0x15')][_0xf693('0x16')]};logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x17'),_0x5a5a35['id']));return rp({'uri':_0x1d9278[_0xf693('0x12')][_0xf693('0x15')][_0xf693('0x16')],'json':!![]})['then'](function(_0x505ada){logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x18'),_0x5a5a35['id']));if(_0x505ada&&_0x505ada[_0xf693('0x19')]&&_0x505ada[_0xf693('0x19')][_0xf693('0x1a')]&&_0x505ada['results'][_0xf693('0x1a')][_0xf693('0x1b')]){_0x3f4d4d[_0xf693('0x1c')]='';for(var _0x414a3f=0x0;_0x414a3f<_0x505ada['results'][_0xf693('0x1a')][_0xf693('0x1b')];_0x414a3f++){_0x3f4d4d[_0xf693('0x1c')]+=_0x505ada[_0xf693('0x19')][_0xf693('0x1a')][_0x414a3f][_0xf693('0x1d')]+'';}}return _0x5a5a35[_0xf693('0x1e')](_0x3f4d4d);})[_0xf693('0x1f')](function(){logger[_0xf693('0xb')](util[_0xf693('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5a5a35['id']));if(!_0x5a5a35[_0xf693('0x20')]){throw new db[(_0xf693('0x21'))][(_0xf693('0x22'))](_0xf693('0x23'));}if(!_0x5d0d4c[_0xf693('0x24')]||!_0x5d0d4c[_0xf693('0x25')]||!_0x5d0d4c[_0xf693('0x26')]||!_0x5d0d4c[_0xf693('0x27')]||!_0x5d0d4c['bucket']){throw new db[(_0xf693('0x21'))][(_0xf693('0x22'))](_0xf693('0x28'));}if(!_0x3f4d4d[_0xf693('0x1c')]){throw new Error('Transcript\x20not\x20available');}if(_0x5d0d4c['sentimentAccountId']===_0xd08be1['id']){return _0xd08be1;}else{return db[_0xf693('0x29')][_0xf693('0x2a')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xf693('0x1f')](function(_0x3f6bb5){if(!_0x3f6bb5){throw new db[(_0xf693('0x21'))][(_0xf693('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3f6bb5[_0xf693('0xd')]||!_0x3f6bb5[_0xf693('0xe')]){throw new db[(_0xf693('0x21'))][(_0xf693('0x22'))](_0xf693('0x2b'));}_0x38bd65=_0x3f6bb5;logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x2c'),_0x5a5a35['id']));return sentiment(_0x38bd65['data1'],_0x38bd65[_0xf693('0xe')],_0x5d0d4c[_0xf693('0x26')],_0x3f4d4d[_0xf693('0x1c')],_0x5d0d4c[_0xf693('0x27')]);})[_0xf693('0x1f')](function(_0x192f20){logger['info'](util['format'](_0xf693('0x2d'),_0x5a5a35['id']));return _0x5a5a35[_0xf693('0x1e')]({'sentiment':_0x192f20[_0xf693('0x2e')],'sPositive':_0x192f20['SentimentScore'][_0xf693('0x2f')],'sNegative':_0x192f20[_0xf693('0x30')][_0xf693('0x31')],'sMixed':_0x192f20[_0xf693('0x30')][_0xf693('0x32')],'sNeutral':_0x192f20['SentimentScore'][_0xf693('0x33')]});})[_0xf693('0x1f')](function(){logger[_0xf693('0xb')](util['format'](_0xf693('0x34'),_0x5a5a35['id']));_0x4c9ab7();});case'FAILED':return _0x5a5a35[_0xf693('0x1e')]({'transcribeStatus':_0xf693('0x35'),'failureReason':_0x1d9278[_0xf693('0x12')][_0xf693('0x36')]})[_0xf693('0x1f')](function(){logger['info'](util[_0xf693('0x10')](_0xf693('0x34'),_0x5a5a35['id']));_0x4c9ab7();});default:logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x37'),_0x5a5a35['id']));break;}}else{return BPromise[_0xf693('0x38')]()[_0xf693('0x1f')](function(){if(!_0x5a5a35[_0xf693('0x20')]){throw new db[(_0xf693('0x21'))]['ValidationError'](_0xf693('0x23'));}if(!_0x5d0d4c['sentiment']||!_0x5d0d4c['sentimentAccountId']||!_0x5d0d4c[_0xf693('0x26')]||!_0x5d0d4c[_0xf693('0x27')]||!_0x5d0d4c[_0xf693('0x39')]){throw new db['Sequelize'][(_0xf693('0x22'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x5a5a35[_0xf693('0x1c')]){throw new Error('Transcript\x20not\x20available');}if(_0x5d0d4c[_0xf693('0x25')]===_0xd08be1['id']){return _0xd08be1;}else{return db[_0xf693('0x29')][_0xf693('0x2a')]({'where':{'id':_settings[_0xf693('0x25')]}});}})[_0xf693('0x1f')](function(_0x47bc1b){if(!_0x47bc1b){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x47bc1b[_0xf693('0xd')]||!_0x47bc1b[_0xf693('0xe')]){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x38bd65=_0x47bc1b;logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x2c'),_0x5a5a35['id']));return sentiment(_0x38bd65[_0xf693('0xd')],_0x38bd65['data2'],_0x5d0d4c[_0xf693('0x26')],_0x5a5a35[_0xf693('0x1c')],_0x5d0d4c[_0xf693('0x27')]);})['then'](function(_0x40a47c){logger[_0xf693('0xb')](util['format'](_0xf693('0x2d'),_0x5a5a35['id']));return _0x5a5a35[_0xf693('0x1e')]({'sentiment':_0x40a47c['Sentiment'],'sPositive':_0x40a47c[_0xf693('0x30')][_0xf693('0x2f')],'sNegative':_0x40a47c['SentimentScore'][_0xf693('0x31')],'sMixed':_0x40a47c[_0xf693('0x30')][_0xf693('0x32')],'sNeutral':_0x40a47c[_0xf693('0x30')]['Neutral'],'transcribeStatus':_0xf693('0x14')});})[_0xf693('0x1f')](function(){logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x34'),_0x5a5a35['id']));_0x4c9ab7();});}})[_0xf693('0x3a')](function(_0x4a6266){if(_0x4a6266){if(!_0x4a6266[_0xf693('0x3b')]||_0x4a6266[_0xf693('0x3b')]!==_0xf693('0x3c')){logger[_0xf693('0x3d')](util[_0xf693('0x10')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x5a5a35['id']),util[_0xf693('0x3e')](_0x4a6266,{'showHidden':![],'depth':null}));}}_0x4c9ab7();});});}function checkTranscribe(){var _0x14e256;var _0x5b66a4;var _0x1952fb;return db['VoiceRecording']['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xf693('0x1f')](function(_0x178cca){if(!_0x178cca||!_0x178cca[_0xf693('0x1b')]){throw new db[(_0xf693('0x21'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x14e256=_0x178cca;return db[_0xf693('0x3f')]['findOne']({'where':{'id':0x1}});})[_0xf693('0x1f')](function(_0x2fe232){if(!_0x2fe232){throw new db[(_0xf693('0x21'))]['ValidationError'](_0xf693('0x40'));}_0x5b66a4=_0x2fe232;if(!_0x5b66a4[_0xf693('0x6')]||!_0x5b66a4[_0xf693('0x41')]||!_0x5b66a4[_0xf693('0xf')]||!_0x5b66a4[_0xf693('0x27')]||!_0x5b66a4[_0xf693('0x39')]){throw new db['Sequelize']['ValidationError'](_0xf693('0x42'));}return db['CloudProvider']['findOne']({'where':{'id':_0x5b66a4[_0xf693('0x41')]}});})[_0xf693('0x1f')](function(_0x4ed7fa){if(!_0x4ed7fa){throw new db[(_0xf693('0x21'))][(_0xf693('0x22'))](_0xf693('0x43'));}if(!_0x4ed7fa[_0xf693('0xd')]||!_0x4ed7fa['data2']){throw new db['Sequelize'][(_0xf693('0x22'))](_0xf693('0x2b'));}_0x1952fb=_0x4ed7fa;var _0x1361ac=[];_0x14e256[_0xf693('0x44')](function(_0x54fb64){_0x1361ac[_0xf693('0x45')](checkTranscribeJob(_0x54fb64,_0x5b66a4,_0x1952fb));});return BPromise[_0xf693('0x46')](_0x1361ac);})['catch'](function(_0x22044c){if(_0x22044c){if(!_0x22044c[_0xf693('0x3b')]||_0x22044c[_0xf693('0x3b')]!==_0xf693('0x3c')){logger[_0xf693('0x3d')](util[_0xf693('0x3e')](_0x22044c,{'showHidden':![],'depth':null}));}}});}exports[_0xf693('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x43c8=['sentimentRegion','update','Sentiment','SentimentScore','Negative','Mixed','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','resolve','bucket','Transcript\x20not\x20available','Positive','Neutral','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','start','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','TranscriptFileUri','Transcript','transcripts','results','length','transcript','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis'];(function(_0x1b4d0c,_0x5f1350){var _0x30d5b7=function(_0x270510){while(--_0x270510){_0x1b4d0c['push'](_0x1b4d0c['shift']());}};_0x30d5b7(++_0x5f1350);}(_0x43c8,0xaf));var _0x843c=function(_0x16d089,_0x19d480){_0x16d089=_0x16d089-0x0;var _0x2658a2=_0x43c8[_0x16d089];return _0x2658a2;};var _=require('lodash');var AWS=require(_0x843c('0x0'));var rp=require('request-promise');var util=require(_0x843c('0x1'));var BPromise=require(_0x843c('0x2'));var db=require(_0x843c('0x3'))['db'];var logger=require(_0x843c('0x4'))(_0x843c('0x5'));function getTranscriptionJob(_0x199998,_0x3ca11e,_0x4d6199,_0x160368){return new Promise(function(_0x3fc72f,_0xc5913e){var _0x15bb1f=new AWS[(_0x843c('0x6'))]({'accessKeyId':_0x3ca11e,'secretAccessKey':_0x199998,'region':_0x4d6199});_0x15bb1f['getTranscriptionJob']({'TranscriptionJobName':_0x160368},function(_0x327327,_0x41f56d){if(_0x327327){return _0xc5913e(_0x327327);}else{return _0x3fc72f(_0x41f56d);}});});}function sentiment(_0x508789,_0x2b065f,_0x566777,_0x4eed13,_0x204fdb){return new Promise(function(_0x5f0005,_0x3a360e){var _0x11f460=new AWS[(_0x843c('0x7'))]({'accessKeyId':_0x2b065f,'secretAccessKey':_0x508789,'region':_0x566777});_0x11f460[_0x843c('0x8')]({'Text':_0x4eed13,'LanguageCode':_0x204fdb['substring'](0x0,0x2)},function(_0x35aca1,_0x3ae315){if(_0x35aca1){return _0x3a360e(_0x35aca1);}else{return _0x5f0005(_0x3ae315);}});});}function checkTranscribeJob(_0x349e23,_0xe0ae48,_0x231ce1){var _0x34e297;return new BPromise(function(_0x33ff2c,_0x1037bd){logger[_0x843c('0x9')](util[_0x843c('0xa')](_0x843c('0xb'),_0x349e23['id'],_0x349e23[_0x843c('0xc')]));return getTranscriptionJob(_0x231ce1[_0x843c('0xd')],_0x231ce1[_0x843c('0xe')],_0xe0ae48[_0x843c('0xf')],_0x349e23['transcribeName'])[_0x843c('0x10')](function(_0x2c013c){logger[_0x843c('0x9')](util[_0x843c('0xa')](_0x843c('0x11'),_0x349e23['id'],_0x349e23['transcribeName'],_0x2c013c[_0x843c('0x12')][_0x843c('0x13')]));if(!_0x349e23[_0x843c('0x14')]){switch(_0x2c013c[_0x843c('0x12')]['TranscriptionJobStatus']){case _0x843c('0x15'):var _0x44b41a={'transcribeStatus':_0x2c013c[_0x843c('0x12')][_0x843c('0x13')],'fileUri':_0x2c013c[_0x843c('0x12')]['Transcript'][_0x843c('0x16')]};logger['info'](util[_0x843c('0xa')]('[RECORDING:%d]\x20Get\x20transcript',_0x349e23['id']));return rp({'uri':_0x2c013c[_0x843c('0x12')][_0x843c('0x17')]['TranscriptFileUri'],'json':!![]})[_0x843c('0x10')](function(_0x30c897){logger[_0x843c('0x9')](util[_0x843c('0xa')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x349e23['id']));if(_0x30c897&&_0x30c897['results']&&_0x30c897['results'][_0x843c('0x18')]&&_0x30c897[_0x843c('0x19')][_0x843c('0x18')][_0x843c('0x1a')]){_0x44b41a[_0x843c('0x14')]='';for(var _0x35c3b1=0x0;_0x35c3b1<_0x30c897[_0x843c('0x19')]['transcripts'][_0x843c('0x1a')];_0x35c3b1++){_0x44b41a[_0x843c('0x14')]+=_0x30c897[_0x843c('0x19')]['transcripts'][_0x35c3b1][_0x843c('0x1b')]+'';}}return _0x349e23['update'](_0x44b41a);})[_0x843c('0x10')](function(){logger[_0x843c('0x9')](util[_0x843c('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x349e23['id']));if(!_0x349e23[_0x843c('0x1c')]){throw new db[(_0x843c('0x1d'))][(_0x843c('0x1e'))](_0x843c('0x1f'));}if(!_0xe0ae48[_0x843c('0x20')]||!_0xe0ae48[_0x843c('0x21')]||!_0xe0ae48['sentimentRegion']||!_0xe0ae48[_0x843c('0x22')]||!_0xe0ae48['bucket']){throw new db[(_0x843c('0x1d'))][(_0x843c('0x1e'))](_0x843c('0x23'));}if(!_0x44b41a[_0x843c('0x14')]){throw new Error('Transcript\x20not\x20available');}if(_0xe0ae48[_0x843c('0x21')]===_0x231ce1['id']){return _0x231ce1;}else{return db[_0x843c('0x24')][_0x843c('0x25')]({'where':{'id':_settings[_0x843c('0x21')]}});}})[_0x843c('0x10')](function(_0x129d46){if(!_0x129d46){throw new db[(_0x843c('0x1d'))][(_0x843c('0x1e'))](_0x843c('0x26'));}if(!_0x129d46[_0x843c('0xd')]||!_0x129d46[_0x843c('0xe')]){throw new db[(_0x843c('0x1d'))]['ValidationError'](_0x843c('0x27'));}_0x34e297=_0x129d46;logger['info'](util[_0x843c('0xa')](_0x843c('0x28'),_0x349e23['id']));return sentiment(_0x34e297['data1'],_0x34e297[_0x843c('0xe')],_0xe0ae48[_0x843c('0x29')],_0x44b41a[_0x843c('0x14')],_0xe0ae48['language']);})[_0x843c('0x10')](function(_0x770e0b){logger['info'](util[_0x843c('0xa')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x349e23['id']));return _0x349e23[_0x843c('0x2a')]({'sentiment':_0x770e0b[_0x843c('0x2b')],'sPositive':_0x770e0b[_0x843c('0x2c')]['Positive'],'sNegative':_0x770e0b[_0x843c('0x2c')][_0x843c('0x2d')],'sMixed':_0x770e0b[_0x843c('0x2c')][_0x843c('0x2e')],'sNeutral':_0x770e0b[_0x843c('0x2c')]['Neutral']});})[_0x843c('0x10')](function(){logger[_0x843c('0x9')](util[_0x843c('0xa')](_0x843c('0x2f'),_0x349e23['id']));_0x33ff2c();});case _0x843c('0x30'):return _0x349e23[_0x843c('0x2a')]({'transcribeStatus':'FAILED','failureReason':_0x2c013c[_0x843c('0x12')][_0x843c('0x31')]})[_0x843c('0x10')](function(){logger[_0x843c('0x9')](util[_0x843c('0xa')](_0x843c('0x2f'),_0x349e23['id']));_0x33ff2c();});default:logger[_0x843c('0x9')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x349e23['id']));break;}}else{return BPromise[_0x843c('0x32')]()[_0x843c('0x10')](function(){if(!_0x349e23[_0x843c('0x1c')]){throw new db['Sequelize'][(_0x843c('0x1e'))](_0x843c('0x1f'));}if(!_0xe0ae48[_0x843c('0x20')]||!_0xe0ae48[_0x843c('0x21')]||!_0xe0ae48[_0x843c('0x29')]||!_0xe0ae48['language']||!_0xe0ae48[_0x843c('0x33')]){throw new db[(_0x843c('0x1d'))][(_0x843c('0x1e'))](_0x843c('0x23'));}if(!_0x349e23[_0x843c('0x14')]){throw new Error(_0x843c('0x34'));}if(_0xe0ae48[_0x843c('0x21')]===_0x231ce1['id']){return _0x231ce1;}else{return db[_0x843c('0x24')][_0x843c('0x25')]({'where':{'id':_settings[_0x843c('0x21')]}});}})[_0x843c('0x10')](function(_0x6017d6){if(!_0x6017d6){throw new db[(_0x843c('0x1d'))][(_0x843c('0x1e'))](_0x843c('0x26'));}if(!_0x6017d6['data1']||!_0x6017d6['data2']){throw new db['Sequelize'][(_0x843c('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x34e297=_0x6017d6;logger[_0x843c('0x9')](util[_0x843c('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x349e23['id']));return sentiment(_0x34e297[_0x843c('0xd')],_0x34e297['data2'],_0xe0ae48['sentimentRegion'],_0x349e23['fileText'],_0xe0ae48[_0x843c('0x22')]);})['then'](function(_0x1d89a1){logger[_0x843c('0x9')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x349e23['id']));return _0x349e23[_0x843c('0x2a')]({'sentiment':_0x1d89a1[_0x843c('0x2b')],'sPositive':_0x1d89a1[_0x843c('0x2c')][_0x843c('0x35')],'sNegative':_0x1d89a1[_0x843c('0x2c')]['Negative'],'sMixed':_0x1d89a1[_0x843c('0x2c')]['Mixed'],'sNeutral':_0x1d89a1[_0x843c('0x2c')][_0x843c('0x36')],'transcribeStatus':_0x843c('0x15')});})[_0x843c('0x10')](function(){logger[_0x843c('0x9')](util[_0x843c('0xa')](_0x843c('0x2f'),_0x349e23['id']));_0x33ff2c();});}})[_0x843c('0x37')](function(_0x1a98fb){if(_0x1a98fb){if(!_0x1a98fb[_0x843c('0x38')]||_0x1a98fb[_0x843c('0x38')]!==_0x843c('0x39')){logger[_0x843c('0x3a')](util[_0x843c('0xa')](_0x843c('0x3b'),_0x349e23['id']),util[_0x843c('0x3c')](_0x1a98fb,{'showHidden':![],'depth':null}));}}_0x33ff2c();});});}function checkTranscribe(){var _0x25945b;var _0x4a7b7f;var _0x2cf09b;return db[_0x843c('0x3d')][_0x843c('0x3e')]({'where':{'transcribeStatus':_0x843c('0x3f')}})[_0x843c('0x10')](function(_0x573754){if(!_0x573754||!_0x573754[_0x843c('0x1a')]){throw new db['Sequelize'][(_0x843c('0x1e'))]('No\x20transcribe\x20job\x20to\x20check');}_0x25945b=_0x573754;return db[_0x843c('0x40')][_0x843c('0x25')]({'where':{'id':0x1}});})[_0x843c('0x10')](function(_0x24cfe5){if(!_0x24cfe5){throw new db[(_0x843c('0x1d'))][(_0x843c('0x1e'))](_0x843c('0x41'));}_0x4a7b7f=_0x24cfe5;if(!_0x4a7b7f[_0x843c('0x5')]||!_0x4a7b7f[_0x843c('0x42')]||!_0x4a7b7f[_0x843c('0xf')]||!_0x4a7b7f['language']||!_0x4a7b7f[_0x843c('0x33')]){throw new db[(_0x843c('0x1d'))][(_0x843c('0x1e'))](_0x843c('0x43'));}return db[_0x843c('0x24')][_0x843c('0x25')]({'where':{'id':_0x4a7b7f[_0x843c('0x42')]}});})[_0x843c('0x10')](function(_0x29fe16){if(!_0x29fe16){throw new db[(_0x843c('0x1d'))]['ValidationError'](_0x843c('0x26'));}if(!_0x29fe16[_0x843c('0xd')]||!_0x29fe16[_0x843c('0xe')]){throw new db['Sequelize'][(_0x843c('0x1e'))](_0x843c('0x27'));}_0x2cf09b=_0x29fe16;var _0xa1965=[];_0x25945b[_0x843c('0x44')](function(_0x3d2d2d){_0xa1965[_0x843c('0x45')](checkTranscribeJob(_0x3d2d2d,_0x4a7b7f,_0x2cf09b));});return BPromise[_0x843c('0x46')](_0xa1965);})[_0x843c('0x37')](function(_0x481d5d){if(_0x481d5d){if(!_0x481d5d['name']||_0x481d5d[_0x843c('0x38')]!==_0x843c('0x39')){logger[_0x843c('0x3a')](util['inspect'](_0x481d5d,{'showHidden':![],'depth':null}));}}});}exports[_0x843c('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 2263f64..f7796da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50b8=['../logger','redis','defaults','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','then','join','update','system','timeout','format','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','start','lodash','moment','ioredis','util'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x50b8,0x9d));var _0x850b=function(_0xdea867,_0x4ba85f){_0xdea867=_0xdea867-0x0;var _0x585a73=_0x50b8[_0xdea867];return _0x585a73;};'use strict';var _=require(_0x850b('0x0'));var moment=require(_0x850b('0x1'));var Redis=require(_0x850b('0x2'));var util=require(_0x850b('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x850b('0x4'))('schedule');config[_0x850b('0x5')]=_[_0x850b('0x6')](config['redis'],{'host':_0x850b('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x4c2884=[];return db[_0x850b('0x8')][_0x850b('0x9')]({'raw':!![],'attributes':['id',_0x850b('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x850b('0xb')](0x18,'hours')}}})[_0x850b('0xc')](function(_0xc25315){if(_0xc25315&&_0xc25315['length']){_0x4c2884=_['map'](_0xc25315||[],'id');logger['info']('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x4c2884[_0x850b('0xd')]());return db['WhatsappInteraction'][_0x850b('0xe')]({'closeReason':_0x850b('0xf'),'disposition':_0x850b('0x10'),'closed':!![],'closedAt':moment()[_0x850b('0x11')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x4c2884}});}})[_0x850b('0xc')](function(){if(_0x4c2884&&_0x4c2884[_0x850b('0x12')]){logger['info'](_0x850b('0x13'),_0x4c2884['join']());for(var _0x500269=0x0;_0x500269<_0x4c2884[_0x850b('0x12')];_0x500269++){io[_0x850b('0x14')](_0x850b('0x15'),{'id':_0x4c2884[_0x500269],'closed':!![]});}}})['catch'](function(_0x4deef6){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x4deef6?util['inspect'](_0x4deef6,{'showHidden':![],'depth':null}):'');});}exports[_0x850b('0x16')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x3a5a=['../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','findAll','lastMsgAt','subtract','hours','then','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','system','format','YYYY-MM-DD\x20HH:mm:ss','length','info','emit','catch','error','inspect','lodash','moment','ioredis','../../config/environment'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x3a5a,0x1bc));var _0xa3a5=function(_0x1a5403,_0x357228){_0x1a5403=_0x1a5403-0x0;var _0x46566f=_0x3a5a[_0x1a5403];return _0x46566f;};'use strict';var _=require(_0xa3a5('0x0'));var moment=require(_0xa3a5('0x1'));var Redis=require(_0xa3a5('0x2'));var util=require('util');var config=require(_0xa3a5('0x3'));var db=require(_0xa3a5('0x4'))['db'];var logger=require(_0xa3a5('0x5'))('schedule');config[_0xa3a5('0x6')]=_[_0xa3a5('0x7')](config[_0xa3a5('0x6')],{'host':_0xa3a5('0x8'),'port':0x18eb});var io=require(_0xa3a5('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x4f14cb=[];return db['WhatsappInteraction'][_0xa3a5('0xa')]({'raw':!![],'attributes':['id',_0xa3a5('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xa3a5('0xc')](0x18,_0xa3a5('0xd'))}}})[_0xa3a5('0xe')](function(_0x1ba8e9){if(_0x1ba8e9&&_0x1ba8e9['length']){_0x4f14cb=_[_0xa3a5('0xf')](_0x1ba8e9||[],'id');logger['info'](_0xa3a5('0x10'),_0x4f14cb[_0xa3a5('0x11')]());return db[_0xa3a5('0x12')]['update']({'closeReason':_0xa3a5('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xa3a5('0x14')](_0xa3a5('0x15'))},{'where':{'id':_0x4f14cb}});}})[_0xa3a5('0xe')](function(){if(_0x4f14cb&&_0x4f14cb[_0xa3a5('0x16')]){logger[_0xa3a5('0x17')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x4f14cb[_0xa3a5('0x11')]());for(var _0x384e14=0x0;_0x384e14<_0x4f14cb[_0xa3a5('0x16')];_0x384e14++){io[_0xa3a5('0x18')]('whatsappInteraction:update',{'id':_0x4f14cb[_0x384e14],'closed':!![]});}}})[_0xa3a5('0x19')](function(_0x108d14){logger[_0xa3a5('0x1a')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x108d14?util[_0xa3a5('0x1b')](_0x108d14,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index e5c9d4c..79c8168 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe318=['finished\x20populating','hopper1','hopper2','catch','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','then','log','CmHopper','destroy','bulkCreate'];(function(_0x41436a,_0xe305){var _0x76bf16=function(_0x98d177){while(--_0x98d177){_0x41436a['push'](_0x41436a['shift']());}};_0x76bf16(++_0xe305);}(_0xe318,0x1e0));var _0x8e31=function(_0x3f623c,_0x540098){_0x3f623c=_0x3f623c-0x0;var _0x49a01f=_0xe318[_0x3f623c];return _0x49a01f;};'use strict';var util=require('util');var db=require(_0x8e31('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x8e31('0x1')]({'id':i,'firstName':_0x8e31('0x2')+i,'lastName':_0x8e31('0x3')+i,'phone':0xf879fb460+i,'email':_0x8e31('0x4')+i+_0x8e31('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8e31('0x6')](),'updatedAt':Date[_0x8e31('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x8e31('0x1')]({'id':i,'firstName':_0x8e31('0x2')+i,'lastName':_0x8e31('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x8e31('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x8e31('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x8e31('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8e31('0x6')](),'updatedAt':Date['now']()});}db[_0x8e31('0x7')]['destroy']({'where':{}})['then'](function(){return db[_0x8e31('0x7')]['bulkCreate'](contacts);})[_0x8e31('0x8')](function(){console[_0x8e31('0x9')]('finished\x20populating','contacts1');return db[_0x8e31('0xa')][_0x8e31('0xb')]({'where':{}});})[_0x8e31('0x8')](function(){return db[_0x8e31('0xa')][_0x8e31('0xc')](hopper);})[_0x8e31('0x8')](function(){console[_0x8e31('0x9')](_0x8e31('0xd'),_0x8e31('0xe'));return db[_0x8e31('0x7')][_0x8e31('0xc')](contacts2);})[_0x8e31('0x8')](function(){console[_0x8e31('0x9')](_0x8e31('0xd'),'contacts2');return db['CmHopper'][_0x8e31('0xc')](hopper2);})[_0x8e31('0x8')](function(){console[_0x8e31('0x9')](_0x8e31('0xd'),_0x8e31('0xf'));})[_0x8e31('0x10')](function(_0x52c9d4){console[_0x8e31('0x9')](_0x52c9d4);});
\ No newline at end of file
+var _0x7da5=['log','hopper1','hopper2','catch','util','../mysqldb','Innocenzo','innocenzo.biondo','@xcally.com','push','now','Biondo','CmContact','destroy','bulkCreate','finished\x20populating','contacts1','CmHopper','then'];(function(_0x4e6680,_0x3bca06){var _0x3c1119=function(_0x4009fc){while(--_0x4009fc){_0x4e6680['push'](_0x4e6680['shift']());}};_0x3c1119(++_0x3bca06);}(_0x7da5,0xe8));var _0x57da=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x7da5[_0x5bd426];return _0x23a7eb;};'use strict';var util=require(_0x57da('0x0'));var db=require(_0x57da('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x57da('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x57da('0x3')+i+_0x57da('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x57da('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x57da('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x57da('0x6')](),'updatedAt':Date[_0x57da('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x57da('0x5')]({'id':i,'firstName':_0x57da('0x2')+i,'lastName':_0x57da('0x7')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x57da('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x57da('0x6')]()});}db[_0x57da('0x8')][_0x57da('0x9')]({'where':{}})['then'](function(){return db[_0x57da('0x8')][_0x57da('0xa')](contacts);})['then'](function(){console['log'](_0x57da('0xb'),_0x57da('0xc'));return db[_0x57da('0xd')][_0x57da('0x9')]({'where':{}});})['then'](function(){return db[_0x57da('0xd')][_0x57da('0xa')](hopper);})[_0x57da('0xe')](function(){console[_0x57da('0xf')](_0x57da('0xb'),_0x57da('0x10'));return db[_0x57da('0x8')][_0x57da('0xa')](contacts2);})[_0x57da('0xe')](function(){console[_0x57da('0xf')](_0x57da('0xb'),'contacts2');return db[_0x57da('0xd')]['bulkCreate'](hopper2);})[_0x57da('0xe')](function(){console[_0x57da('0xf')](_0x57da('0xb'),_0x57da('0x11'));})[_0x57da('0x12')](function(_0x28f4bd){console[_0x57da('0xf')](_0x28f4bd);});
\ No newline at end of file
index a85ef4c..b9a2d79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1398=['/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','%s%s@xcally.com','agent','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt'];(function(_0x2af0bd,_0x30c3ac){var _0x1f52cd=function(_0x3101ee){while(--_0x3101ee){_0x2af0bd['push'](_0x2af0bd['shift']());}};_0x1f52cd(++_0x30c3ac);}(_0x1398,0x10c));var _0x8139=function(_0x2ff370,_0x8c07b1){_0x2ff370=_0x2ff370-0x0;var _0x1d2bae=_0x1398[_0x2ff370];return _0x1d2bae;};'use strict';var util=require(_0x8139('0x0'));var db=require(_0x8139('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x8139('0x2')]({'name':util[_0x8139('0x3')]('%s%s','agent',i),'fullname':util[_0x8139('0x3')](_0x8139('0x4'),'agent',i),'email':util[_0x8139('0x3')](_0x8139('0x5'),_0x8139('0x6'),i),'role':_0x8139('0x6'),'password':'password','internal':0xfa0+i,'type':'friend','transport':[_0x8139('0x7'),'ws','wss'],'disallow':[_0x8139('0x8')],'allow':[_0x8139('0x9')],'defaultuser':util[_0x8139('0x3')]('%s%s',_0x8139('0x6'),i),'encryption':_0x8139('0xa'),'avpf':_0x8139('0xa'),'force_avp':_0x8139('0xa'),'icesupport':'yes','dtlsenable':_0x8139('0xa'),'dtlsverify':'no','dtlscertfile':_0x8139('0xb'),'dtlsprivatekey':_0x8139('0xc'),'dtlssetup':_0x8139('0xd'),'callerid':util[_0x8139('0x3')](_0x8139('0xe'),util['format']('%s%s',_0x8139('0x6'),i),0xfa0+i)});}db['User'][_0x8139('0xf')](users)[_0x8139('0x10')](function(){console[_0x8139('0x11')](_0x8139('0x12'));})[_0x8139('0x13')](function(_0x100181){console[_0x8139('0x11')](_0x100181);});
\ No newline at end of file
+var _0x50a2=['push','format','agent','%s%s','%s%s@xcally.com','password','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate','log','add\x20user','util','../mysqldb'];(function(_0xd3b176,_0x5b5d10){var _0x225676=function(_0x190163){while(--_0x190163){_0xd3b176['push'](_0xd3b176['shift']());}};_0x225676(++_0x5b5d10);}(_0x50a2,0x11e));var _0x250a=function(_0x3ebe5d,_0x3e96d3){_0x3ebe5d=_0x3ebe5d-0x0;var _0x1a6013=_0x50a2[_0x3ebe5d];return _0x1a6013;};'use strict';var util=require(_0x250a('0x0'));var db=require(_0x250a('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x250a('0x2')]({'name':util[_0x250a('0x3')]('%s%s',_0x250a('0x4'),i),'fullname':util[_0x250a('0x3')](_0x250a('0x5'),_0x250a('0x4'),i),'email':util['format'](_0x250a('0x6'),_0x250a('0x4'),i),'role':_0x250a('0x4'),'password':_0x250a('0x7'),'internal':0xfa0+i,'type':'friend','transport':['udp','ws',_0x250a('0x8')],'disallow':['all'],'allow':[_0x250a('0x9')],'defaultuser':util[_0x250a('0x3')]('%s%s','agent',i),'encryption':_0x250a('0xa'),'avpf':_0x250a('0xa'),'force_avp':_0x250a('0xa'),'icesupport':'yes','dtlsenable':_0x250a('0xa'),'dtlsverify':'no','dtlscertfile':_0x250a('0xb'),'dtlsprivatekey':_0x250a('0xc'),'dtlssetup':_0x250a('0xd'),'callerid':util['format'](_0x250a('0xe'),util[_0x250a('0x3')](_0x250a('0x5'),_0x250a('0x4'),i),0xfa0+i)});}db['User'][_0x250a('0xf')](users)['then'](function(){console[_0x250a('0x10')](_0x250a('0x11'));})['catch'](function(_0x23b624){console['log'](_0x23b624);});
\ No newline at end of file
index 2001d95..8c9a652 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6edc=['user_has_sms_interactions:remove','OpenchannelInteractions','removeWhatsappInteractions','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','Agents','User','name','role','telephone','agent','type','ivr','UserProfileSection','findOne','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','Telephones','Trunks','findAll','IvrCampaigns','UserProfileResource','resourceId','map','Campaign','where','format','%s:queue:%s','length','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','OpenchannelQueue','user','voice:inbound','FaxQueue','OpenchannelQueues','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','fax','sms','whatsapp','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions'];(function(_0x3421da,_0x503306){var _0x3a7ae1=function(_0x7540a6){while(--_0x7540a6){_0x3421da['push'](_0x3421da['shift']());}};_0x3a7ae1(++_0x503306);}(_0x6edc,0x138));var _0xc6ed=function(_0x4dd5e2,_0x58195d){_0x4dd5e2=_0x4dd5e2-0x0;var _0x41c7db=_0x6edc[_0x4dd5e2];return _0x41c7db;};'use strict';var _=require(_0xc6ed('0x0'));var util=require(_0xc6ed('0x1'));var BPromise=require(_0xc6ed('0x2'));var db=require(_0xc6ed('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0xc6ed('0x4'),'model':db[_0xc6ed('0x5')],'attributes':['id',_0xc6ed('0x6'),_0xc6ed('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xc6ed('0x6')],'where':{'role':_0xc6ed('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xc6ed('0x6')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xc6ed('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xc6ed('0xa')],'where':{'type':_0xc6ed('0xb')}};function getAssociatedResources(_0x31049e,_0x33114,_0x496e6a){return db[_0xc6ed('0xc')][_0xc6ed('0xd')]({'where':{'name':_0x31049e,'userProfileId':_0x33114},'raw':!![]})[_0xc6ed('0xe')](function(_0x4943be){if(_0x4943be){if(_0x4943be['autoAssociation']){switch(_0x31049e){case _0xc6ed('0xf'):case _0xc6ed('0x10'):case _0xc6ed('0x11'):case _0xc6ed('0x12'):case _0xc6ed('0x13'):case'OpenchannelQueues':case _0xc6ed('0x14'):return db[_0x496e6a]['findAll'](queryQueues);case _0xc6ed('0x15'):return db[_0x496e6a]['findAll'](queryTelephones);case _0xc6ed('0x16'):return db[_0x496e6a][_0xc6ed('0x17')](queryTrunks);case _0xc6ed('0x18'):return db[_0x496e6a]['findAll'](queryCampaigns);}}else{return db[_0xc6ed('0x19')][_0xc6ed('0x17')]({'attributes':[_0xc6ed('0x1a')],'where':{'sectionId':_0x4943be['id']},'raw':!![]})['then'](function(_0x55065e){if(_0x55065e){var _0x596897={'where':{'id':_[_0xc6ed('0x1b')](_0x55065e,_0xc6ed('0x1a'))},'raw':!![]};switch(_0x496e6a){case _0xc6ed('0x5'):_0x596897['where'][_0xc6ed('0x7')]=_0xc6ed('0x8');break;case _0xc6ed('0x1c'):_0x596897[_0xc6ed('0x1d')]['type']='ivr';break;}return db[_0x496e6a][_0xc6ed('0x17')](_0x596897);}else{return[];}});}}else{return[];}})[_0xc6ed('0xe')](function(_0x38ea12){return _0x38ea12;});}function joinOrLeaveQueues(_0x2317db,_0x41c5e8,_0x2ebb09,_0x28a334){_0x2317db[_0x41c5e8](util[_0xc6ed('0x1e')](_0xc6ed('0x1f'),_0x2ebb09,_0x28a334[_0xc6ed('0x6')]));if(_0x28a334[_0xc6ed('0x4')]){for(var _0x776f5=0x0;_0x776f5<_0x28a334[_0xc6ed('0x4')][_0xc6ed('0x20')];_0x776f5+=0x1){_0x2317db[_0x41c5e8](util['format']('user:%s',_0x28a334[_0xc6ed('0x4')][_0x776f5]['name']));}}}function joinOrLeave(_0x565705,_0x327fbf,_0x487461){var _0x2e6804;if(_0x565705[_0xc6ed('0x21')][_0xc6ed('0x22')]['id']){db['User']['find']({'attributes':['id','name',_0xc6ed('0x7'),_0xc6ed('0x23')],'where':{'id':_0x565705[_0xc6ed('0x21')][_0xc6ed('0x22')]['id']},'include':[{'model':db[_0xc6ed('0x24')],'as':_0xc6ed('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xc6ed('0x26')],'as':_0xc6ed('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xc6ed('0x28')],'as':_0xc6ed('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xc6ed('0x2a')],'as':_0xc6ed('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc6ed('0x2c')],'as':_0xc6ed('0x2d'),'attributes':['id'],'raw':!![]}]})[_0xc6ed('0xe')](function(_0x3f636f){if(_0x3f636f){_0x2e6804=_0x3f636f;_0x565705[_0x327fbf](util['format'](_0xc6ed('0x2e'),_0x3f636f[_0xc6ed('0x6')]));var _0x979b48=[];switch(_0x3f636f[_0xc6ed('0x7')]){case _0xc6ed('0x2f'):_0x565705[_0x327fbf]('voice:inbound');_0x565705[_0x327fbf](_0xc6ed('0x30'));if(queryQueues[_0xc6ed('0x31')](_0xc6ed('0x32'))){delete queryQueues[_0xc6ed('0x32')];}_0x979b48[_0xc6ed('0x33')](db[_0xc6ed('0x34')][_0xc6ed('0x17')](queryQueues));_0x979b48[_0xc6ed('0x33')](db[_0xc6ed('0x35')][_0xc6ed('0x17')](queryQueues));_0x979b48[_0xc6ed('0x33')](db['FaxQueue'][_0xc6ed('0x17')](queryQueues));_0x979b48[_0xc6ed('0x33')](db[_0xc6ed('0x36')][_0xc6ed('0x17')](queryQueues));_0x979b48[_0xc6ed('0x33')](db['MailQueue'][_0xc6ed('0x17')](queryQueues));_0x979b48['push'](db[_0xc6ed('0x37')][_0xc6ed('0x17')](queryQueues));_0x979b48['push'](db['WhatsappQueue'][_0xc6ed('0x17')](queryQueues));_0x979b48[_0xc6ed('0x33')](db['User'][_0xc6ed('0x17')](queryTelephones));_0x979b48[_0xc6ed('0x33')](db['Trunk']['findAll'](queryTrunks));_0x979b48[_0xc6ed('0x33')](db[_0xc6ed('0x1c')]['findAll'](queryCampaigns));_0x979b48[_0xc6ed('0x33')](db[_0xc6ed('0x5')][_0xc6ed('0x17')](queryAgents));break;case _0xc6ed('0x38'):_0x565705[_0x327fbf](_0xc6ed('0x39'));_0x565705[_0x327fbf](_0xc6ed('0x30'));_0x979b48[_0xc6ed('0x33')](getAssociatedResources(_0xc6ed('0xf'),_0x3f636f['userProfileId'],_0xc6ed('0x34')));_0x979b48['push'](getAssociatedResources(_0xc6ed('0x10'),_0x3f636f[_0xc6ed('0x23')],'ChatQueue'));_0x979b48[_0xc6ed('0x33')](getAssociatedResources(_0xc6ed('0x11'),_0x3f636f[_0xc6ed('0x23')],_0xc6ed('0x3a')));_0x979b48[_0xc6ed('0x33')](getAssociatedResources(_0xc6ed('0x12'),_0x3f636f['userProfileId'],_0xc6ed('0x36')));_0x979b48['push'](getAssociatedResources(_0xc6ed('0x13'),_0x3f636f[_0xc6ed('0x23')],'MailQueue'));_0x979b48['push'](getAssociatedResources(_0xc6ed('0x3b'),_0x3f636f[_0xc6ed('0x23')],_0xc6ed('0x37')));_0x979b48[_0xc6ed('0x33')](getAssociatedResources(_0xc6ed('0x14'),_0x3f636f[_0xc6ed('0x23')],'WhatsappQueue'));_0x979b48['push'](getAssociatedResources(_0xc6ed('0x15'),_0x3f636f[_0xc6ed('0x23')],_0xc6ed('0x5')));_0x979b48[_0xc6ed('0x33')](getAssociatedResources(_0xc6ed('0x16'),_0x3f636f[_0xc6ed('0x23')],_0xc6ed('0x3c')));_0x979b48[_0xc6ed('0x33')](getAssociatedResources(_0xc6ed('0x18'),_0x3f636f[_0xc6ed('0x23')],'Campaign'));_0x979b48[_0xc6ed('0x33')](db[_0xc6ed('0x5')]['findAll'](queryAgents));break;case _0xc6ed('0x9'):_0x565705[_0x327fbf]('voice:inbound');_0x565705[_0x327fbf](_0xc6ed('0x30'));_0x979b48[_0xc6ed('0x33')](_0x3f636f[_0xc6ed('0x3d')]({'attributes':['id',_0xc6ed('0x6')]}));_0x979b48['push'](_0x3f636f[_0xc6ed('0x3e')]({'attributes':['id',_0xc6ed('0x6')]}));_0x979b48['push'](_0x3f636f[_0xc6ed('0x3f')]({'attributes':['id',_0xc6ed('0x6')]}));_0x979b48['push'](_0x3f636f[_0xc6ed('0x40')]({'attributes':['id',_0xc6ed('0x6')]}));_0x979b48[_0xc6ed('0x33')](_0x3f636f[_0xc6ed('0x41')]({'attributes':['id',_0xc6ed('0x6')]}));_0x979b48[_0xc6ed('0x33')](_0x3f636f[_0xc6ed('0x42')]({'attributes':['id',_0xc6ed('0x6')]}));_0x979b48[_0xc6ed('0x33')](_0x3f636f['getWhatsappQueues']({'attributes':['id',_0xc6ed('0x6')]}));break;}return BPromise[_0xc6ed('0x43')](_0x979b48);}})[_0xc6ed('0xe')](function(_0x5735fe){if(_0x5735fe&&_0x5735fe[_0xc6ed('0x20')]){for(var _0x1c7394=0x0;_0x1c7394<_0x5735fe[_0xc6ed('0x20')];_0x1c7394+=0x1){for(var _0x925c6b=0x0;_0x925c6b<_0x5735fe[_0x1c7394][_0xc6ed('0x20')];_0x925c6b+=0x1){switch(_0x1c7394){case 0x0:joinOrLeaveQueues(_0x565705,_0x327fbf,_0xc6ed('0x44'),_0x5735fe[_0x1c7394][_0x925c6b]);break;case 0x1:joinOrLeaveQueues(_0x565705,_0x327fbf,'chat',_0x5735fe[_0x1c7394][_0x925c6b]);break;case 0x2:joinOrLeaveQueues(_0x565705,_0x327fbf,_0xc6ed('0x45'),_0x5735fe[_0x1c7394][_0x925c6b]);break;case 0x3:joinOrLeaveQueues(_0x565705,_0x327fbf,_0xc6ed('0x46'),_0x5735fe[_0x1c7394][_0x925c6b]);break;case 0x4:joinOrLeaveQueues(_0x565705,_0x327fbf,'mail',_0x5735fe[_0x1c7394][_0x925c6b]);break;case 0x5:joinOrLeaveQueues(_0x565705,_0x327fbf,'openchannel',_0x5735fe[_0x1c7394][_0x925c6b]);break;case 0x6:joinOrLeaveQueues(_0x565705,_0x327fbf,_0xc6ed('0x47'),_0x5735fe[_0x1c7394][_0x925c6b]);break;case 0x7:if(_0x2e6804['role']!==_0xc6ed('0x9'))_0x565705[_0x327fbf](util[_0xc6ed('0x1e')](_0xc6ed('0x48'),_0x5735fe[_0x1c7394][_0x925c6b][_0xc6ed('0x6')]));break;case 0x8:if(_0x2e6804[_0xc6ed('0x7')]!==_0xc6ed('0x9'))_0x565705[_0x327fbf](util[_0xc6ed('0x1e')](_0xc6ed('0x49'),_0x5735fe[_0x1c7394][_0x925c6b][_0xc6ed('0x6')]));break;case 0x9:if(_0x2e6804[_0xc6ed('0x7')]!==_0xc6ed('0x9'))_0x565705[_0x327fbf](util['format']('campaign:%s:%s',_0x5735fe[_0x1c7394][_0x925c6b]['type'],_0x5735fe[_0x1c7394][_0x925c6b][_0xc6ed('0x6')]));break;case 0xa:_0x565705[_0x327fbf](util['format']('user:%s',_0x5735fe[_0x1c7394][_0x925c6b][_0xc6ed('0x6')]));break;}}}}})[_0xc6ed('0xe')](function(){if(_0x327fbf===_0xc6ed('0x4a')){var _0x4c41d9=_[_0xc6ed('0x1b')](_0x2e6804[_0xc6ed('0x25')],'id');return _0x2e6804[_0xc6ed('0x4b')](_0x4c41d9)[_0xc6ed('0xe')](function(){for(var _0x373df8=0x0;_0x373df8<_0x4c41d9[_0xc6ed('0x20')];_0x373df8+=0x1){_0x487461[_0xc6ed('0x4c')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x4c41d9[_0x373df8]),'UserId':Number(_0x2e6804['id'])});}});}})[_0xc6ed('0xe')](function(){if(_0x327fbf===_0xc6ed('0x4a')){var _0x5a68c4=_['map'](_0x2e6804[_0xc6ed('0x27')],'id');return _0x2e6804['removeMailInteractions'](_0x5a68c4)[_0xc6ed('0xe')](function(){for(var _0x1fa5e1=0x0;_0x1fa5e1<_0x5a68c4[_0xc6ed('0x20')];_0x1fa5e1+=0x1){_0x487461[_0xc6ed('0x4c')](_0xc6ed('0x4d'),{'MailInteractionId':Number(_0x5a68c4[_0x1fa5e1]),'UserId':Number(_0x2e6804['id'])});}});}})[_0xc6ed('0xe')](function(){if(_0x327fbf===_0xc6ed('0x4a')){var _0x3dd7f4=_['map'](_0x2e6804[_0xc6ed('0x29')],'id');return _0x2e6804['removeFaxInteractions'](_0x3dd7f4)[_0xc6ed('0xe')](function(){for(var _0xe79e7a=0x0;_0xe79e7a<_0x3dd7f4[_0xc6ed('0x20')];_0xe79e7a+=0x1){_0x487461[_0xc6ed('0x4c')](_0xc6ed('0x4e'),{'FaxInteractionId':Number(_0x3dd7f4[_0xe79e7a]),'UserId':Number(_0x2e6804['id'])});}});}})[_0xc6ed('0xe')](function(){if(_0x327fbf==='leave'){var _0x3b8f87=_['map'](_0x2e6804[_0xc6ed('0x2b')],'id');return _0x2e6804[_0xc6ed('0x4f')](_0x3b8f87)[_0xc6ed('0xe')](function(){for(var _0x3f1ff7=0x0;_0x3f1ff7<_0x3b8f87[_0xc6ed('0x20')];_0x3f1ff7+=0x1){_0x487461['emit'](_0xc6ed('0x50'),{'SmsInteractionId':Number(_0x3b8f87[_0x3f1ff7]),'UserId':Number(_0x2e6804['id'])});}});}})[_0xc6ed('0xe')](function(){if(_0x327fbf===_0xc6ed('0x4a')){var _0x3d7593=_[_0xc6ed('0x1b')](_0x2e6804[_0xc6ed('0x51')],'id');return _0x2e6804['removeOpenchannelInteractions'](_0x3d7593)['then'](function(){for(var _0xb53412=0x0;_0xb53412<_0x3d7593[_0xc6ed('0x20')];_0xb53412+=0x1){_0x487461['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x3d7593[_0xb53412]),'UserId':Number(_0x2e6804['id'])});}});}})[_0xc6ed('0xe')](function(){if(_0x327fbf==='leave'){var _0xab8cd=_[_0xc6ed('0x1b')](_0x2e6804[_0xc6ed('0x2d')],'id');return _0x2e6804[_0xc6ed('0x52')](_0xab8cd)[_0xc6ed('0xe')](function(){for(var _0xdc1989=0x0;_0xdc1989<_0xab8cd[_0xc6ed('0x20')];_0xdc1989+=0x1){_0x487461[_0xc6ed('0x4c')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0xab8cd[_0xdc1989]),'UserId':Number(_0x2e6804['id'])});}});}})[_0xc6ed('0x53')](function(_0x380184){_0x565705[_0xc6ed('0x54')](_0x380184);});}}function onDisconnect(_0x8de267,_0x38f7e7){joinOrLeave(_0x8de267,'leave',_0x38f7e7);}function onConnect(_0x52e300){joinOrLeave(_0x52e300,_0xc6ed('0x55'));}exports[_0xc6ed('0x56')]=function(_0x25c421){_0x25c421['on'](_0xc6ed('0x57'),function(_0x27482b){_0x27482b[_0xc6ed('0x58')](0x0);_0x27482b[_0xc6ed('0x59')]=_0x27482b[_0xc6ed('0x5a')][_0xc6ed('0x57')][_0xc6ed('0x5b')]+':'+_0x27482b[_0xc6ed('0x5a')][_0xc6ed('0x57')][_0xc6ed('0x5c')];_0x27482b[_0xc6ed('0x5d')]=new Date();_0x27482b[_0xc6ed('0x54')]=function(_0x311bd7){console[_0xc6ed('0x54')](_0xc6ed('0x5e')+_0x27482b[_0xc6ed('0x5f')][_0xc6ed('0x6')]+'['+_0x27482b['address']+']',_0x311bd7);};_0x27482b['on']('disconnect',function(){onDisconnect(_0x27482b,_0x25c421);_0x27482b[_0xc6ed('0x54')](_0xc6ed('0x60'));});onConnect(_0x27482b);_0x27482b[_0xc6ed('0x54')](_0xc6ed('0x61'));});};
\ No newline at end of file
+var _0x6ac2=['VoiceQueues','ChatQueues','FaxQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','UserProfileResource','resourceId','where','Campaign','format','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','WhatsappInteraction','WhatsappInteractions','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:inbound','SmsQueues','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','map','ChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','OpenchannelInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','setMaxListeners','address','request','connection','remoteAddress','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','User','role','telephone','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation'];(function(_0x41d853,_0xf2796){var _0x45dc7c=function(_0x4f3160){while(--_0x4f3160){_0x41d853['push'](_0x41d853['shift']());}};_0x45dc7c(++_0xf2796);}(_0x6ac2,0x184));var _0x26ac=function(_0x26dc96,_0x527980){_0x26dc96=_0x26dc96-0x0;var _0x19c90f=_0x6ac2[_0x26dc96];return _0x19c90f;};'use strict';var _=require(_0x26ac('0x0'));var util=require('util');var BPromise=require(_0x26ac('0x1'));var db=require(_0x26ac('0x2'))['db'];var config=require(_0x26ac('0x3'));var queryQueues={'attributes':['id',_0x26ac('0x4')],'include':[{'as':_0x26ac('0x5'),'model':db[_0x26ac('0x6')],'attributes':['id','name',_0x26ac('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x26ac('0x4')],'where':{'role':_0x26ac('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x26ac('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x26ac('0x4')],'where':{'role':_0x26ac('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x26ac('0x4'),_0x26ac('0xa')],'where':{'type':_0x26ac('0xb')}};function getAssociatedResources(_0x50816d,_0x59fea6,_0x27ff15){return db[_0x26ac('0xc')][_0x26ac('0xd')]({'where':{'name':_0x50816d,'userProfileId':_0x59fea6},'raw':!![]})[_0x26ac('0xe')](function(_0x59f3fc){if(_0x59f3fc){if(_0x59f3fc[_0x26ac('0xf')]){switch(_0x50816d){case _0x26ac('0x10'):case _0x26ac('0x11'):case _0x26ac('0x12'):case'SmsQueues':case'MailQueues':case _0x26ac('0x13'):case _0x26ac('0x14'):return db[_0x27ff15][_0x26ac('0x15')](queryQueues);case _0x26ac('0x16'):return db[_0x27ff15][_0x26ac('0x15')](queryTelephones);case _0x26ac('0x17'):return db[_0x27ff15][_0x26ac('0x15')](queryTrunks);case'IvrCampaigns':return db[_0x27ff15][_0x26ac('0x15')](queryCampaigns);}}else{return db[_0x26ac('0x18')][_0x26ac('0x15')]({'attributes':[_0x26ac('0x19')],'where':{'sectionId':_0x59f3fc['id']},'raw':!![]})['then'](function(_0x1febf6){if(_0x1febf6){var _0x1ae5aa={'where':{'id':_['map'](_0x1febf6,_0x26ac('0x19'))},'raw':!![]};switch(_0x27ff15){case _0x26ac('0x6'):_0x1ae5aa[_0x26ac('0x1a')][_0x26ac('0x7')]='telephone';break;case _0x26ac('0x1b'):_0x1ae5aa[_0x26ac('0x1a')]['type']='ivr';break;}return db[_0x27ff15][_0x26ac('0x15')](_0x1ae5aa);}else{return[];}});}}else{return[];}})[_0x26ac('0xe')](function(_0x482801){return _0x482801;});}function joinOrLeaveQueues(_0x754fce,_0x59788b,_0x54e0dd,_0x55a4a6){_0x754fce[_0x59788b](util[_0x26ac('0x1c')]('%s:queue:%s',_0x54e0dd,_0x55a4a6[_0x26ac('0x4')]));if(_0x55a4a6[_0x26ac('0x5')]){for(var _0x3c75c1=0x0;_0x3c75c1<_0x55a4a6[_0x26ac('0x5')][_0x26ac('0x1d')];_0x3c75c1+=0x1){_0x754fce[_0x59788b](util[_0x26ac('0x1c')](_0x26ac('0x1e'),_0x55a4a6[_0x26ac('0x5')][_0x3c75c1][_0x26ac('0x4')]));}}}function joinOrLeave(_0x5da4eb,_0x43bce8,_0x18b83c){var _0x2b8299;if(_0x5da4eb[_0x26ac('0x1f')][_0x26ac('0x20')]['id']){db[_0x26ac('0x6')][_0x26ac('0x21')]({'attributes':['id',_0x26ac('0x4'),_0x26ac('0x7'),_0x26ac('0x22')],'where':{'id':_0x5da4eb['handshake']['query']['id']},'include':[{'model':db[_0x26ac('0x23')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x26ac('0x24')],'as':_0x26ac('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x26ac('0x26')],'as':_0x26ac('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x26ac('0x28')],'as':_0x26ac('0x29'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x26ac('0x2a')],'as':_0x26ac('0x2b'),'attributes':['id'],'raw':!![]}]})[_0x26ac('0xe')](function(_0x4d873e){if(_0x4d873e){_0x2b8299=_0x4d873e;_0x5da4eb[_0x43bce8](util['format'](_0x26ac('0x1e'),_0x4d873e[_0x26ac('0x4')]));var _0x387970=[];switch(_0x4d873e[_0x26ac('0x7')]){case'admin':_0x5da4eb[_0x43bce8]('voice:inbound');_0x5da4eb[_0x43bce8](_0x26ac('0x2c'));if(queryQueues[_0x26ac('0x2d')](_0x26ac('0x2e'))){delete queryQueues[_0x26ac('0x2e')];}_0x387970[_0x26ac('0x2f')](db[_0x26ac('0x30')][_0x26ac('0x15')](queryQueues));_0x387970[_0x26ac('0x2f')](db[_0x26ac('0x31')][_0x26ac('0x15')](queryQueues));_0x387970['push'](db[_0x26ac('0x32')][_0x26ac('0x15')](queryQueues));_0x387970['push'](db[_0x26ac('0x33')][_0x26ac('0x15')](queryQueues));_0x387970[_0x26ac('0x2f')](db[_0x26ac('0x34')][_0x26ac('0x15')](queryQueues));_0x387970[_0x26ac('0x2f')](db[_0x26ac('0x35')][_0x26ac('0x15')](queryQueues));_0x387970[_0x26ac('0x2f')](db[_0x26ac('0x36')][_0x26ac('0x15')](queryQueues));_0x387970[_0x26ac('0x2f')](db['User'][_0x26ac('0x15')](queryTelephones));_0x387970[_0x26ac('0x2f')](db[_0x26ac('0x37')]['findAll'](queryTrunks));_0x387970[_0x26ac('0x2f')](db['Campaign'][_0x26ac('0x15')](queryCampaigns));_0x387970[_0x26ac('0x2f')](db['User'][_0x26ac('0x15')](queryAgents));break;case _0x26ac('0x38'):_0x5da4eb[_0x43bce8](_0x26ac('0x39'));_0x5da4eb[_0x43bce8](_0x26ac('0x2c'));_0x387970[_0x26ac('0x2f')](getAssociatedResources(_0x26ac('0x10'),_0x4d873e['userProfileId'],_0x26ac('0x30')));_0x387970['push'](getAssociatedResources(_0x26ac('0x11'),_0x4d873e['userProfileId'],_0x26ac('0x31')));_0x387970['push'](getAssociatedResources('FaxQueues',_0x4d873e[_0x26ac('0x22')],_0x26ac('0x32')));_0x387970[_0x26ac('0x2f')](getAssociatedResources(_0x26ac('0x3a'),_0x4d873e[_0x26ac('0x22')],_0x26ac('0x33')));_0x387970['push'](getAssociatedResources('MailQueues',_0x4d873e[_0x26ac('0x22')],_0x26ac('0x34')));_0x387970[_0x26ac('0x2f')](getAssociatedResources('OpenchannelQueues',_0x4d873e['userProfileId'],_0x26ac('0x35')));_0x387970[_0x26ac('0x2f')](getAssociatedResources('WhatsappQueues',_0x4d873e['userProfileId'],_0x26ac('0x36')));_0x387970[_0x26ac('0x2f')](getAssociatedResources(_0x26ac('0x16'),_0x4d873e['userProfileId'],'User'));_0x387970['push'](getAssociatedResources('Trunks',_0x4d873e[_0x26ac('0x22')],_0x26ac('0x37')));_0x387970[_0x26ac('0x2f')](getAssociatedResources(_0x26ac('0x3b'),_0x4d873e[_0x26ac('0x22')],_0x26ac('0x1b')));_0x387970[_0x26ac('0x2f')](db[_0x26ac('0x6')][_0x26ac('0x15')](queryAgents));break;case'agent':_0x5da4eb[_0x43bce8](_0x26ac('0x39'));_0x5da4eb[_0x43bce8](_0x26ac('0x2c'));_0x387970[_0x26ac('0x2f')](_0x4d873e[_0x26ac('0x3c')]({'attributes':['id',_0x26ac('0x4')]}));_0x387970[_0x26ac('0x2f')](_0x4d873e[_0x26ac('0x3d')]({'attributes':['id',_0x26ac('0x4')]}));_0x387970[_0x26ac('0x2f')](_0x4d873e[_0x26ac('0x3e')]({'attributes':['id',_0x26ac('0x4')]}));_0x387970[_0x26ac('0x2f')](_0x4d873e[_0x26ac('0x3f')]({'attributes':['id',_0x26ac('0x4')]}));_0x387970['push'](_0x4d873e[_0x26ac('0x40')]({'attributes':['id',_0x26ac('0x4')]}));_0x387970[_0x26ac('0x2f')](_0x4d873e['getOpenchannelQueues']({'attributes':['id',_0x26ac('0x4')]}));_0x387970[_0x26ac('0x2f')](_0x4d873e[_0x26ac('0x41')]({'attributes':['id',_0x26ac('0x4')]}));break;}return BPromise[_0x26ac('0x42')](_0x387970);}})[_0x26ac('0xe')](function(_0x4f8235){if(_0x4f8235&&_0x4f8235['length']){for(var _0x39ccd1=0x0;_0x39ccd1<_0x4f8235[_0x26ac('0x1d')];_0x39ccd1+=0x1){for(var _0x14bc65=0x0;_0x14bc65<_0x4f8235[_0x39ccd1][_0x26ac('0x1d')];_0x14bc65+=0x1){switch(_0x39ccd1){case 0x0:joinOrLeaveQueues(_0x5da4eb,_0x43bce8,_0x26ac('0x43'),_0x4f8235[_0x39ccd1][_0x14bc65]);break;case 0x1:joinOrLeaveQueues(_0x5da4eb,_0x43bce8,_0x26ac('0x44'),_0x4f8235[_0x39ccd1][_0x14bc65]);break;case 0x2:joinOrLeaveQueues(_0x5da4eb,_0x43bce8,_0x26ac('0x45'),_0x4f8235[_0x39ccd1][_0x14bc65]);break;case 0x3:joinOrLeaveQueues(_0x5da4eb,_0x43bce8,_0x26ac('0x46'),_0x4f8235[_0x39ccd1][_0x14bc65]);break;case 0x4:joinOrLeaveQueues(_0x5da4eb,_0x43bce8,_0x26ac('0x47'),_0x4f8235[_0x39ccd1][_0x14bc65]);break;case 0x5:joinOrLeaveQueues(_0x5da4eb,_0x43bce8,_0x26ac('0x48'),_0x4f8235[_0x39ccd1][_0x14bc65]);break;case 0x6:joinOrLeaveQueues(_0x5da4eb,_0x43bce8,'whatsapp',_0x4f8235[_0x39ccd1][_0x14bc65]);break;case 0x7:if(_0x2b8299['role']!==_0x26ac('0x9'))_0x5da4eb[_0x43bce8](util[_0x26ac('0x1c')](_0x26ac('0x49'),_0x4f8235[_0x39ccd1][_0x14bc65]['name']));break;case 0x8:if(_0x2b8299[_0x26ac('0x7')]!==_0x26ac('0x9'))_0x5da4eb[_0x43bce8](util[_0x26ac('0x1c')](_0x26ac('0x4a'),_0x4f8235[_0x39ccd1][_0x14bc65][_0x26ac('0x4')]));break;case 0x9:if(_0x2b8299[_0x26ac('0x7')]!==_0x26ac('0x9'))_0x5da4eb[_0x43bce8](util[_0x26ac('0x1c')](_0x26ac('0x4b'),_0x4f8235[_0x39ccd1][_0x14bc65][_0x26ac('0xa')],_0x4f8235[_0x39ccd1][_0x14bc65][_0x26ac('0x4')]));break;case 0xa:_0x5da4eb[_0x43bce8](util[_0x26ac('0x1c')](_0x26ac('0x1e'),_0x4f8235[_0x39ccd1][_0x14bc65][_0x26ac('0x4')]));break;}}}}})['then'](function(){if(_0x43bce8==='leave'){var _0x382c=_[_0x26ac('0x4c')](_0x2b8299[_0x26ac('0x4d')],'id');return _0x2b8299['removeChatInteractions'](_0x382c)[_0x26ac('0xe')](function(){for(var _0x2e4442=0x0;_0x2e4442<_0x382c[_0x26ac('0x1d')];_0x2e4442+=0x1){_0x18b83c[_0x26ac('0x4e')](_0x26ac('0x4f'),{'ChatInteractionId':Number(_0x382c[_0x2e4442]),'UserId':Number(_0x2b8299['id'])});}});}})[_0x26ac('0xe')](function(){if(_0x43bce8===_0x26ac('0x50')){var _0x11e7bf=_[_0x26ac('0x4c')](_0x2b8299[_0x26ac('0x25')],'id');return _0x2b8299[_0x26ac('0x51')](_0x11e7bf)[_0x26ac('0xe')](function(){for(var _0xe67cf1=0x0;_0xe67cf1<_0x11e7bf[_0x26ac('0x1d')];_0xe67cf1+=0x1){_0x18b83c[_0x26ac('0x4e')](_0x26ac('0x52'),{'MailInteractionId':Number(_0x11e7bf[_0xe67cf1]),'UserId':Number(_0x2b8299['id'])});}});}})[_0x26ac('0xe')](function(){if(_0x43bce8===_0x26ac('0x50')){var _0x54cc6a=_['map'](_0x2b8299[_0x26ac('0x27')],'id');return _0x2b8299[_0x26ac('0x53')](_0x54cc6a)[_0x26ac('0xe')](function(){for(var _0x3fd32a=0x0;_0x3fd32a<_0x54cc6a['length'];_0x3fd32a+=0x1){_0x18b83c[_0x26ac('0x4e')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x54cc6a[_0x3fd32a]),'UserId':Number(_0x2b8299['id'])});}});}})[_0x26ac('0xe')](function(){if(_0x43bce8==='leave'){var _0xe8ebf0=_[_0x26ac('0x4c')](_0x2b8299['SmsInteractions'],'id');return _0x2b8299[_0x26ac('0x54')](_0xe8ebf0)['then'](function(){for(var _0x319418=0x0;_0x319418<_0xe8ebf0[_0x26ac('0x1d')];_0x319418+=0x1){_0x18b83c[_0x26ac('0x4e')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0xe8ebf0[_0x319418]),'UserId':Number(_0x2b8299['id'])});}});}})[_0x26ac('0xe')](function(){if(_0x43bce8===_0x26ac('0x50')){var _0x33603f=_['map'](_0x2b8299[_0x26ac('0x55')],'id');return _0x2b8299[_0x26ac('0x56')](_0x33603f)[_0x26ac('0xe')](function(){for(var _0x305dc4=0x0;_0x305dc4<_0x33603f['length'];_0x305dc4+=0x1){_0x18b83c[_0x26ac('0x4e')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x33603f[_0x305dc4]),'UserId':Number(_0x2b8299['id'])});}});}})[_0x26ac('0xe')](function(){if(_0x43bce8==='leave'){var _0x25e314=_['map'](_0x2b8299[_0x26ac('0x2b')],'id');return _0x2b8299[_0x26ac('0x57')](_0x25e314)[_0x26ac('0xe')](function(){for(var _0x56ee85=0x0;_0x56ee85<_0x25e314[_0x26ac('0x1d')];_0x56ee85+=0x1){_0x18b83c['emit'](_0x26ac('0x58'),{'WhatsappInteractionId':Number(_0x25e314[_0x56ee85]),'UserId':Number(_0x2b8299['id'])});}});}})['catch'](function(_0x137fa0){_0x5da4eb[_0x26ac('0x59')](_0x137fa0);});}}function onDisconnect(_0x812058,_0x2faf22){joinOrLeave(_0x812058,'leave',_0x2faf22);}function onConnect(_0x3eb920){joinOrLeave(_0x3eb920,_0x26ac('0x5a'));}exports['default']=function(_0x55bf35){_0x55bf35['on']('connection',function(_0x2850b6){_0x2850b6[_0x26ac('0x5b')](0x0);_0x2850b6[_0x26ac('0x5c')]=_0x2850b6[_0x26ac('0x5d')][_0x26ac('0x5e')][_0x26ac('0x5f')]+':'+_0x2850b6['request'][_0x26ac('0x5e')]['remotePort'];_0x2850b6['connectedAt']=new Date();_0x2850b6['log']=function(_0x3d35b6){console[_0x26ac('0x59')](_0x26ac('0x60')+_0x2850b6[_0x26ac('0x61')][_0x26ac('0x4')]+'['+_0x2850b6[_0x26ac('0x5c')]+']',_0x3d35b6);};_0x2850b6['on'](_0x26ac('0x62'),function(){onDisconnect(_0x2850b6,_0x55bf35);_0x2850b6[_0x26ac('0x59')](_0x26ac('0x63'));});onConnect(_0x2850b6);_0x2850b6[_0x26ac('0x59')](_0x26ac('0x64'));});};
\ No newline at end of file
index e004c2e..225cff7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf5d=['afterUpdate','closedinteraction','FaxInteraction','Fax','FaxMessage','MailInteraction','Mail','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','catch','get','channel','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format','SIP/%s','name','agent','offlineMessage','opened','closed','changed','substatus','User','find','fullname','email','internal','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','client','http','Chat','ChatInteraction','ChatMessage','afterCreate','newmessage','ChatOfflineMessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','newinteraction'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xaf5d,0x161));var _0xdaf5=function(_0x438d0d,_0x5a7876){_0x438d0d=_0x438d0d-0x0;var _0x3ba717=_0xaf5d[_0x438d0d];return _0x3ba717;};'use strict';var util=require(_0xdaf5('0x0'));var db=require(_0xdaf5('0x1'))['db'];var jayson=require(_0xdaf5('0x2'));var logger=require('../logger')('triggers');var client=jayson[_0xdaf5('0x3')][_0xdaf5('0x4')]({'port':0x232a});var triggers=[{'channel':_0xdaf5('0x5'),'model':'ChatInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xdaf5('0x5'),'model':_0xdaf5('0x6'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xdaf5('0x5'),'model':_0xdaf5('0x7'),'event':_0xdaf5('0x8'),'condition':_0xdaf5('0x9'),'callback':afterCreateMessage},{'channel':'Chat','model':_0xdaf5('0xa'),'event':_0xdaf5('0x8'),'condition':_0xdaf5('0x9'),'callback':afterCreateOfflineMessage},{'channel':_0xdaf5('0xb'),'model':'SmsInteraction','event':_0xdaf5('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xdaf5('0xb'),'model':_0xdaf5('0xc'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xdaf5('0xb'),'model':_0xdaf5('0xd'),'event':'afterCreate','condition':_0xdaf5('0x9'),'callback':afterCreateMessage},{'channel':_0xdaf5('0xe'),'model':_0xdaf5('0xf'),'event':_0xdaf5('0x8'),'condition':_0xdaf5('0x10'),'callback':afterCreate},{'channel':_0xdaf5('0xe'),'model':_0xdaf5('0xf'),'event':_0xdaf5('0x11'),'condition':_0xdaf5('0x12'),'callback':afterUpdate},{'channel':_0xdaf5('0xe'),'model':'WhatsappMessage','event':_0xdaf5('0x8'),'condition':_0xdaf5('0x9'),'callback':afterCreateMessage},{'channel':'Fax','model':_0xdaf5('0x13'),'event':_0xdaf5('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':'Fax','model':_0xdaf5('0x13'),'event':_0xdaf5('0x11'),'condition':_0xdaf5('0x12'),'callback':afterUpdate},{'channel':_0xdaf5('0x14'),'model':_0xdaf5('0x15'),'event':_0xdaf5('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0xdaf5('0x16'),'event':_0xdaf5('0x8'),'condition':_0xdaf5('0x10'),'callback':afterCreate},{'channel':_0xdaf5('0x17'),'model':_0xdaf5('0x16'),'event':'afterUpdate','condition':_0xdaf5('0x12'),'callback':afterUpdate},{'channel':'Mail','model':_0xdaf5('0x18'),'event':'afterCreate','condition':_0xdaf5('0x9'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0xdaf5('0x19'),'event':_0xdaf5('0x8'),'condition':_0xdaf5('0x10'),'callback':afterCreate},{'channel':_0xdaf5('0x1a'),'model':_0xdaf5('0x19'),'event':_0xdaf5('0x11'),'condition':_0xdaf5('0x12'),'callback':afterUpdate},{'channel':_0xdaf5('0x1a'),'model':_0xdaf5('0x1b'),'event':'afterCreate','condition':_0xdaf5('0x9'),'callback':afterCreateMessage}];function request(_0x396da9){return client[_0xdaf5('0x1c')](_0xdaf5('0x1d'),_0x396da9)[_0xdaf5('0x1e')](function(_0x4734b6){logger[_0xdaf5('0x1f')](_0xdaf5('0x20'),'EventManager',_0x4734b6);if(_0x4734b6[_0xdaf5('0x21')]){if(_0x4734b6[_0xdaf5('0x21')]['code']===0x1f4){logger[_0xdaf5('0x21')](_0xdaf5('0x20'),'EventManager',_0x4734b6[_0xdaf5('0x21')]);}}})[_0xdaf5('0x22')](function(_0x491065){logger[_0xdaf5('0x21')]('Trigger,\x20%s',_0xdaf5('0x1d'),_0x491065);});}function afterCreateMessage(_0x44e645){return function(_0x1cba00){_0x1cba00=_0x1cba00[_0xdaf5('0x23')]({'plain':!![]});_0x1cba00[_0xdaf5('0x24')]=_0x44e645;_0x1cba00[_0xdaf5('0x25')]=_0x44e645;_0x1cba00[_0xdaf5('0x26')]=_0x1cba00[_0xdaf5('0x27')];Promise[_0xdaf5('0x28')]()[_0xdaf5('0x1e')](function(){if(typeof _0x1cba00[_0xdaf5('0x29')]===_0xdaf5('0x2a'))return null;var _0x30e9f9=_0xdaf5('0x2b')+_0x1cba00[_0xdaf5('0x29')];return db[_0xdaf5('0x2c')][_0xdaf5('0x2d')](_0x30e9f9,{'type':db[_0xdaf5('0x2e')][_0xdaf5('0x2f')][_0xdaf5('0x30')],'raw':!![]});})[_0xdaf5('0x1e')](function(_0x3cf10d){if(_0x3cf10d){_0x1cba00[_0xdaf5('0x31')]=_0x3cf10d[0x0];}if(typeof _0x1cba00['UserId']===_0xdaf5('0x2a'))return;return getAgent(_0x1cba00[_0xdaf5('0x32')]);})[_0xdaf5('0x1e')](function(_0x25cd9c){if(_0x25cd9c){_0x1cba00[_0xdaf5('0x33')]=util[_0xdaf5('0x34')](_0xdaf5('0x35'),_0x25cd9c[_0xdaf5('0x36')]);_0x1cba00[_0xdaf5('0x37')]=_0x25cd9c;_0x1cba00[_0xdaf5('0x24')]=_0x44e645;return request({'event':'incomingmessage','message':_0x1cba00});}else{return request({'event':'outgoingmessage','message':_0x1cba00});}})[_0xdaf5('0x22')](function(_0x1caf66){logger[_0xdaf5('0x21')](_0xdaf5('0x20'),'AfterCreateMessage',_0x1caf66);});};}function afterCreateOfflineMessage(_0x4e78ed){return function(_0x9087db){_0x9087db=_0x9087db['get']({'plain':!![]});_0x9087db[_0xdaf5('0x24')]=_0x4e78ed;_0x9087db[_0xdaf5('0x25')]=_0x4e78ed;_0x9087db[_0xdaf5('0x26')]=_0xdaf5('0x38');return request({'event':_0x9087db[_0xdaf5('0x26')],'message':_0x9087db});};}function afterCreate(_0xd4d77e,_0x587cf2){return function(_0x2e28ea){_0x2e28ea=_0x2e28ea[_0xdaf5('0x23')]({'plain':!![]});_0x2e28ea[_0xdaf5('0x24')]=_0xd4d77e;_0x2e28ea[_0xdaf5('0x25')]=_0xd4d77e;_0x2e28ea['event']=_0xdaf5('0x39');Promise[_0xdaf5('0x28')]()[_0xdaf5('0x1e')](function(){var _0x932ead=_0xdaf5('0x2b')+_0x2e28ea['ContactId'];return db[_0xdaf5('0x2c')]['query'](_0x932ead,{'type':db[_0xdaf5('0x2e')]['QueryTypes'][_0xdaf5('0x30')],'raw':!![]});})[_0xdaf5('0x1e')](function(_0x2223f2){if(_0x2223f2){_0x2e28ea[_0xdaf5('0x31')]=_0x2223f2[0x0];}if(typeof _0x2e28ea[_0xdaf5('0x32')]==='undefined')return;return getAgent(_0x2e28ea[_0xdaf5('0x32')]);})[_0xdaf5('0x1e')](function(_0x5c54c7){if(_0x5c54c7){_0x2e28ea['interface']=util['format'](_0xdaf5('0x35'),_0x5c54c7[_0xdaf5('0x36')]);_0x2e28ea[_0xdaf5('0x37')]=_0x5c54c7;}return request({'event':_0x587cf2,'message':_0x2e28ea});})['catch'](function(_0x459396){logger['error']('Trigger,\x20%s','AfterCreate',_0x459396);});};}function afterUpdate(_0x266b66){return function(_0x29ebcb){var _0x4c48db=_0x29ebcb['changed'](_0xdaf5('0x3a'))&&_0x29ebcb[_0xdaf5('0x3a')];var _0x2c8055=_0x29ebcb[_0xdaf5('0x3b')](_0xdaf5('0x3c'));if(_0x4c48db||_0x2c8055){var _0x4e21a9=_0x4c48db?_0xdaf5('0x12'):_0xdaf5('0x3c');var _0x3af5e2=_0x29ebcb[_0xdaf5('0x23')]({'plain':!![]});_0x3af5e2[_0xdaf5('0x24')]=_0x266b66;_0x3af5e2[_0xdaf5('0x25')]=_0x266b66;_0x3af5e2[_0xdaf5('0x26')]=_0x4c48db?_0xdaf5('0x3a'):_0xdaf5('0x3c');var _0x12b21b=_0xdaf5('0x2b')+_0x3af5e2[_0xdaf5('0x29')];return db[_0xdaf5('0x2c')][_0xdaf5('0x2d')](_0x12b21b,{'type':db[_0xdaf5('0x2e')][_0xdaf5('0x2f')][_0xdaf5('0x30')],'raw':!![]})[_0xdaf5('0x1e')](function(_0x23d983){if(_0x23d983){_0x3af5e2[_0xdaf5('0x31')]=_0x23d983[0x0];}if(typeof _0x3af5e2[_0xdaf5('0x32')]===_0xdaf5('0x2a'))return;return getAgent(_0x3af5e2[_0xdaf5('0x32')]);})['then'](function(_0xae7930){if(_0xae7930){_0x3af5e2[_0xdaf5('0x33')]=util[_0xdaf5('0x34')]('SIP/%s',_0xae7930[_0xdaf5('0x36')]);_0x3af5e2[_0xdaf5('0x37')]=_0xae7930;}return request({'event':_0x4e21a9,'message':_0x3af5e2});})[_0xdaf5('0x22')](function(_0x454b66){logger[_0xdaf5('0x21')]('Trigger,\x20%s','AfterUpdate',_0x454b66);});}};}function getAgent(_0x2412d1){return db[_0xdaf5('0x3d')][_0xdaf5('0x3e')]({'where':{'id':_0x2412d1},'attributes':['id',_0xdaf5('0x36'),_0xdaf5('0x3f'),_0xdaf5('0x40'),_0xdaf5('0x41')],'raw':!![]})[_0xdaf5('0x1e')](function(_0x2416d6){return _0x2416d6;});}exports[_0xdaf5('0x42')]=function(){for(var _0x4a2c2b=0x0;_0x4a2c2b<triggers[_0xdaf5('0x43')];_0x4a2c2b+=0x1){if(db[_0xdaf5('0x44')](triggers[_0x4a2c2b]['model'])){db[triggers[_0x4a2c2b][_0xdaf5('0x45')]][_0xdaf5('0x46')](triggers[_0x4a2c2b][_0xdaf5('0x26')],triggers[_0x4a2c2b][_0xdaf5('0x47')](triggers[_0x4a2c2b][_0xdaf5('0x24')][_0xdaf5('0x48')](),triggers[_0x4a2c2b][_0xdaf5('0x49')]));}}};
\ No newline at end of file
+var _0x1576=['query','SELECT','contact','UserId','interface','format','SIP/%s','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','offlineMessage','opened','sequelize','Sequelize','QueryTypes','closed','substatus','User','find','fullname','internal','default','length','model','callback','toLowerCase','condition','util','jayson/promise','../logger','client','http','Chat','ChatInteraction','afterCreate','newinteraction','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','WhatsappInteraction','Whatsapp','afterUpdate','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','then','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','event','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'];(function(_0x10efc6,_0x381f0e){var _0x419582=function(_0x244322){while(--_0x244322){_0x10efc6['push'](_0x10efc6['shift']());}};_0x419582(++_0x381f0e);}(_0x1576,0x135));var _0x6157=function(_0x540fca,_0x54263f){_0x540fca=_0x540fca-0x0;var _0x15e0cc=_0x1576[_0x540fca];return _0x15e0cc;};'use strict';var util=require(_0x6157('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x6157('0x1'));var logger=require(_0x6157('0x2'))('triggers');var client=jayson[_0x6157('0x3')][_0x6157('0x4')]({'port':0x232a});var triggers=[{'channel':_0x6157('0x5'),'model':_0x6157('0x6'),'event':_0x6157('0x7'),'condition':_0x6157('0x8'),'callback':afterCreate},{'channel':_0x6157('0x5'),'model':_0x6157('0x6'),'event':'afterUpdate','condition':_0x6157('0x9'),'callback':afterUpdate},{'channel':_0x6157('0x5'),'model':_0x6157('0xa'),'event':'afterCreate','condition':_0x6157('0xb'),'callback':afterCreateMessage},{'channel':'Chat','model':'ChatOfflineMessage','event':_0x6157('0x7'),'condition':_0x6157('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0x6157('0xc'),'model':_0x6157('0xd'),'event':_0x6157('0x7'),'condition':_0x6157('0x8'),'callback':afterCreate},{'channel':'Sms','model':_0x6157('0xd'),'event':'afterUpdate','condition':_0x6157('0x9'),'callback':afterUpdate},{'channel':_0x6157('0xc'),'model':_0x6157('0xe'),'event':'afterCreate','condition':_0x6157('0xb'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x6157('0xf'),'event':'afterCreate','condition':_0x6157('0x8'),'callback':afterCreate},{'channel':_0x6157('0x10'),'model':_0x6157('0xf'),'event':_0x6157('0x11'),'condition':_0x6157('0x9'),'callback':afterUpdate},{'channel':_0x6157('0x10'),'model':_0x6157('0x12'),'event':_0x6157('0x7'),'condition':_0x6157('0xb'),'callback':afterCreateMessage},{'channel':_0x6157('0x13'),'model':_0x6157('0x14'),'event':'afterCreate','condition':_0x6157('0x8'),'callback':afterCreate},{'channel':'Fax','model':_0x6157('0x14'),'event':_0x6157('0x11'),'condition':_0x6157('0x9'),'callback':afterUpdate},{'channel':_0x6157('0x13'),'model':_0x6157('0x15'),'event':_0x6157('0x7'),'condition':_0x6157('0xb'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x6157('0x16'),'event':_0x6157('0x7'),'condition':_0x6157('0x8'),'callback':afterCreate},{'channel':_0x6157('0x17'),'model':'MailInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':_0x6157('0x7'),'condition':_0x6157('0xb'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x6157('0x18'),'event':_0x6157('0x7'),'condition':_0x6157('0x8'),'callback':afterCreate},{'channel':_0x6157('0x19'),'model':'OpenchannelInteraction','event':'afterUpdate','condition':_0x6157('0x9'),'callback':afterUpdate},{'channel':_0x6157('0x19'),'model':_0x6157('0x1a'),'event':_0x6157('0x7'),'condition':_0x6157('0xb'),'callback':afterCreateMessage}];function request(_0x57a287){return client[_0x6157('0x1b')](_0x6157('0x1c'),_0x57a287)[_0x6157('0x1d')](function(_0x25c167){logger['info'](_0x6157('0x1e'),_0x6157('0x1c'),_0x25c167);if(_0x25c167['error']){if(_0x25c167[_0x6157('0x1f')][_0x6157('0x20')]===0x1f4){logger['error'](_0x6157('0x1e'),_0x6157('0x1c'),_0x25c167[_0x6157('0x1f')]);}}})[_0x6157('0x21')](function(_0x221872){logger['error']('Trigger,\x20%s',_0x6157('0x1c'),_0x221872);});}function afterCreateMessage(_0x3aa439){return function(_0x143721){_0x143721=_0x143721[_0x6157('0x22')]({'plain':!![]});_0x143721[_0x6157('0x23')]=_0x3aa439;_0x143721[_0x6157('0x24')]=_0x3aa439;_0x143721[_0x6157('0x25')]=_0x143721['direction'];Promise['resolve']()[_0x6157('0x1d')](function(){if(typeof _0x143721[_0x6157('0x26')]===_0x6157('0x27'))return null;var _0x1f2f89=_0x6157('0x28')+_0x143721[_0x6157('0x26')];return db['sequelize'][_0x6157('0x29')](_0x1f2f89,{'type':db['Sequelize']['QueryTypes'][_0x6157('0x2a')],'raw':!![]});})[_0x6157('0x1d')](function(_0x2253de){if(_0x2253de){_0x143721[_0x6157('0x2b')]=_0x2253de[0x0];}if(typeof _0x143721[_0x6157('0x2c')]===_0x6157('0x27'))return;return getAgent(_0x143721[_0x6157('0x2c')]);})[_0x6157('0x1d')](function(_0x54e9cc){if(_0x54e9cc){_0x143721[_0x6157('0x2d')]=util[_0x6157('0x2e')](_0x6157('0x2f'),_0x54e9cc[_0x6157('0x30')]);_0x143721[_0x6157('0x31')]=_0x54e9cc;_0x143721[_0x6157('0x23')]=_0x3aa439;return request({'event':_0x6157('0x32'),'message':_0x143721});}else{return request({'event':_0x6157('0x33'),'message':_0x143721});}})[_0x6157('0x21')](function(_0x1eea63){logger[_0x6157('0x1f')](_0x6157('0x1e'),_0x6157('0x34'),_0x1eea63);});};}function afterCreateOfflineMessage(_0x4af19b){return function(_0x56706e){_0x56706e=_0x56706e[_0x6157('0x22')]({'plain':!![]});_0x56706e[_0x6157('0x23')]=_0x4af19b;_0x56706e[_0x6157('0x24')]=_0x4af19b;_0x56706e[_0x6157('0x25')]=_0x6157('0x35');return request({'event':_0x56706e[_0x6157('0x25')],'message':_0x56706e});};}function afterCreate(_0x33248b,_0x3811eb){return function(_0x32b113){_0x32b113=_0x32b113[_0x6157('0x22')]({'plain':!![]});_0x32b113[_0x6157('0x23')]=_0x33248b;_0x32b113[_0x6157('0x24')]=_0x33248b;_0x32b113[_0x6157('0x25')]=_0x6157('0x36');Promise['resolve']()[_0x6157('0x1d')](function(){var _0x1ae693=_0x6157('0x28')+_0x32b113['ContactId'];return db[_0x6157('0x37')][_0x6157('0x29')](_0x1ae693,{'type':db[_0x6157('0x38')][_0x6157('0x39')][_0x6157('0x2a')],'raw':!![]});})['then'](function(_0x1a78de){if(_0x1a78de){_0x32b113[_0x6157('0x2b')]=_0x1a78de[0x0];}if(typeof _0x32b113['UserId']==='undefined')return;return getAgent(_0x32b113[_0x6157('0x2c')]);})[_0x6157('0x1d')](function(_0x357c6c){if(_0x357c6c){_0x32b113['interface']=util[_0x6157('0x2e')]('SIP/%s',_0x357c6c[_0x6157('0x30')]);_0x32b113[_0x6157('0x31')]=_0x357c6c;}return request({'event':_0x3811eb,'message':_0x32b113});})[_0x6157('0x21')](function(_0x19d144){logger['error'](_0x6157('0x1e'),'AfterCreate',_0x19d144);});};}function afterUpdate(_0x2e02c1){return function(_0x4dea0c){var _0x4d563c=_0x4dea0c['changed']('closed')&&_0x4dea0c[_0x6157('0x3a')];var _0x305c38=_0x4dea0c['changed'](_0x6157('0x3b'));if(_0x4d563c||_0x305c38){var _0xab62ab=_0x4d563c?_0x6157('0x9'):_0x6157('0x3b');var _0x5e0882=_0x4dea0c[_0x6157('0x22')]({'plain':!![]});_0x5e0882[_0x6157('0x23')]=_0x2e02c1;_0x5e0882[_0x6157('0x24')]=_0x2e02c1;_0x5e0882[_0x6157('0x25')]=_0x4d563c?_0x6157('0x3a'):_0x6157('0x3b');var _0x41ea6b=_0x6157('0x28')+_0x5e0882['ContactId'];return db[_0x6157('0x37')][_0x6157('0x29')](_0x41ea6b,{'type':db[_0x6157('0x38')][_0x6157('0x39')][_0x6157('0x2a')],'raw':!![]})[_0x6157('0x1d')](function(_0x305a3f){if(_0x305a3f){_0x5e0882['contact']=_0x305a3f[0x0];}if(typeof _0x5e0882[_0x6157('0x2c')]===_0x6157('0x27'))return;return getAgent(_0x5e0882[_0x6157('0x2c')]);})[_0x6157('0x1d')](function(_0x3416a8){if(_0x3416a8){_0x5e0882[_0x6157('0x2d')]=util['format'](_0x6157('0x2f'),_0x3416a8[_0x6157('0x30')]);_0x5e0882[_0x6157('0x31')]=_0x3416a8;}return request({'event':_0xab62ab,'message':_0x5e0882});})[_0x6157('0x21')](function(_0x234a53){logger[_0x6157('0x1f')](_0x6157('0x1e'),'AfterUpdate',_0x234a53);});}};}function getAgent(_0x358ed2){return db[_0x6157('0x3c')][_0x6157('0x3d')]({'where':{'id':_0x358ed2},'attributes':['id','name',_0x6157('0x3e'),'email',_0x6157('0x3f')],'raw':!![]})[_0x6157('0x1d')](function(_0x4fdf5a){return _0x4fdf5a;});}exports[_0x6157('0x40')]=function(){for(var _0x4f4d0a=0x0;_0x4f4d0a<triggers[_0x6157('0x41')];_0x4f4d0a+=0x1){if(db['hasOwnProperty'](triggers[_0x4f4d0a][_0x6157('0x42')])){db[triggers[_0x4f4d0a]['model']]['hook'](triggers[_0x4f4d0a][_0x6157('0x25')],triggers[_0x4f4d0a][_0x6157('0x43')](triggers[_0x4f4d0a][_0x6157('0x23')][_0x6157('0x44')](),triggers[_0x4f4d0a][_0x6157('0x45')]));}}};
\ No newline at end of file
index b3d857c..bc1ffa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe59=['mail','chat','fax','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','role','User','agent','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice'];(function(_0xba9f86,_0x1e988b){var _0x2a25ce=function(_0x1f47e1){while(--_0x1f47e1){_0xba9f86['push'](_0xba9f86['shift']());}};_0x2a25ce(++_0x1e988b);}(_0xfe59,0xc3));var _0x9fe5=function(_0x11614b,_0x397feb){_0x11614b=_0x11614b-0x0;var _0x622e93=_0xfe59[_0x11614b];return _0x622e93;};'use strict';var _=require(_0x9fe5('0x0'));var BPromise=require(_0x9fe5('0x1'));var db=require(_0x9fe5('0x2'))['db'];var util=require(_0x9fe5('0x3'));var channels=[_0x9fe5('0x4'),_0x9fe5('0x5'),_0x9fe5('0x6'),_0x9fe5('0x7'),'sms',_0x9fe5('0x8'),_0x9fe5('0x9')];exports[_0x9fe5('0xa')]=function(){return channels;};exports[_0x9fe5('0xb')]=function(_0x5dea7b){_0x5dea7b=_0x5dea7b[_0x9fe5('0xc')]();return _[_0x9fe5('0xd')](channels,_0x5dea7b);};exports[_0x9fe5('0xe')]=function(_0x942f04,_0x140c7c,_0x526347,_0x23224f){var _0x8ba9cb={'loginAttempts':_0x140c7c,'blocked':_0x526347};if(!_[_0x9fe5('0xf')](_0x23224f)){_0x8ba9cb[_0x9fe5('0x10')]=_0x23224f;}return _0x942f04['updateAttributes'](_0x8ba9cb);};exports['getLicense']=function(_0xe072ff){return new BPromise(function(_0x4beaa8,_0x3c4b5e){var _0x300a91=0x0;if(_0xe072ff[_0x9fe5('0x11')]!=='agent'){_0x4beaa8(_0xe072ff);}db[_0x9fe5('0x12')]['count']({'where':{'role':_0x9fe5('0x13'),'online':!![],'id':{'$ne':_0xe072ff['id']}}})[_0x9fe5('0x14')](function(_0x497c9e){_0x300a91=_0x497c9e;return util[_0x9fe5('0x15')]();})[_0x9fe5('0x14')](function(_0x305007){if(_0x305007&&_0x305007[_0x9fe5('0x16')]&&_0x300a91>=_0x305007[_0x9fe5('0x16')]){throw Error(_0x9fe5('0x17'));}_0x4beaa8(_0xe072ff);})[_0x9fe5('0x18')](function(_0x1de06f){_0x3c4b5e(_0x1de06f);});});};
\ No newline at end of file
+var _0xd1e7=['then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb','./license/util','voice','chat','fax','openchannel','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count'];(function(_0x3bb348,_0x144786){var _0x4c206d=function(_0x21aae4){while(--_0x21aae4){_0x3bb348['push'](_0x3bb348['shift']());}};_0x4c206d(++_0x144786);}(_0xd1e7,0x101));var _0x7d1e=function(_0x57b45a,_0x443923){_0x57b45a=_0x57b45a-0x0;var _0x185ecb=_0xd1e7[_0x57b45a];return _0x185ecb;};'use strict';var _=require(_0x7d1e('0x0'));var BPromise=require('bluebird');var db=require(_0x7d1e('0x1'))['db'];var util=require(_0x7d1e('0x2'));var channels=[_0x7d1e('0x3'),'mail',_0x7d1e('0x4'),_0x7d1e('0x5'),'sms','whatsapp',_0x7d1e('0x6')];exports['getChannels']=function(){return channels;};exports[_0x7d1e('0x7')]=function(_0xab4801){_0xab4801=_0xab4801[_0x7d1e('0x8')]();return _[_0x7d1e('0x9')](channels,_0xab4801);};exports[_0x7d1e('0xa')]=function(_0x3bcdd5,_0x29c810,_0x38902f,_0x64e8f6){var _0xcf9ae1={'loginAttempts':_0x29c810,'blocked':_0x38902f};if(!_[_0x7d1e('0xb')](_0x64e8f6)){_0xcf9ae1[_0x7d1e('0xc')]=_0x64e8f6;}return _0x3bcdd5[_0x7d1e('0xd')](_0xcf9ae1);};exports[_0x7d1e('0xe')]=function(_0x49641){return new BPromise(function(_0x18861c,_0x174161){var _0x39af55=0x0;if(_0x49641[_0x7d1e('0xf')]!==_0x7d1e('0x10')){_0x18861c(_0x49641);}db[_0x7d1e('0x11')][_0x7d1e('0x12')]({'where':{'role':_0x7d1e('0x10'),'online':!![],'id':{'$ne':_0x49641['id']}}})[_0x7d1e('0x13')](function(_0x22a60b){_0x39af55=_0x22a60b;return util[_0x7d1e('0xe')]();})[_0x7d1e('0x13')](function(_0x23f3ad){if(_0x23f3ad&&_0x23f3ad[_0x7d1e('0x14')]&&_0x39af55>=_0x23f3ad[_0x7d1e('0x14')]){throw Error(_0x7d1e('0x15'));}_0x18861c(_0x49641);})[_0x7d1e('0x16')](function(_0x252388){_0x174161(_0x252388);});});};
\ No newline at end of file
index d2e4de1..ce82974 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x750a=['Error','inherits','Bad\x20Request','Forbidden','OutOfInterval','stack','status','exports','../config/logger','message','Internal\x20Server\x20Error','name'];(function(_0x43fe43,_0x40a903){var _0x3f5541=function(_0x1e6254){while(--_0x1e6254){_0x43fe43['push'](_0x43fe43['shift']());}};_0x3f5541(++_0x40a903);}(_0x750a,0x140));var _0xa750=function(_0x1bd718,_0x56a5f9){_0x1bd718=_0x1bd718-0x0;var _0x345b71=_0x750a[_0x1bd718];return _0x345b71;};'use strict';var util=require('util');var logger=require(_0xa750('0x0'))('api');var APIError=function(_0x499583,_0x139fa5){this[_0xa750('0x1')]=_0x499583||_0xa750('0x2');this[_0xa750('0x3')]=_0x139fa5||_0xa750('0x4');util[_0xa750('0x5')](APIError,Error);};var APIBadRequestError=function(_0x562911){this[_0xa750('0x1')]=_0x562911||_0xa750('0x6');this[_0xa750('0x3')]=_0xa750('0x6');util[_0xa750('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x3d7c43){this['message']=_0x3d7c43||'Entity\x20not\x20found';this[_0xa750('0x3')]='Not\x20Found';util[_0xa750('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x1760f5){switch(_0x1760f5){case'Bad\x20Request':return 0x190;case _0xa750('0x7'),_0xa750('0x8'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x5aca9c){return function(_0xcb62ae){logger['error'](_0xcb62ae[_0xa750('0x9')]);var _0x5adaae=getStatusCode(_0xcb62ae['name']);if(_0xcb62ae[_0xa750('0x3')])delete _0xcb62ae[_0xa750('0x3')];return _0x5aca9c[_0xa750('0xa')](_0x5adaae)['send'](_0xcb62ae);};}module[_0xa750('0xb')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
+var _0x9c44=['Forbidden','OutOfInterval','status','exports','api','message','Internal\x20Server\x20Error','name','Bad\x20Request','inherits','Entity\x20not\x20found','Not\x20Found'];(function(_0x59dc79,_0x3be0a9){var _0x1a94a0=function(_0x12982a){while(--_0x12982a){_0x59dc79['push'](_0x59dc79['shift']());}};_0x1a94a0(++_0x3be0a9);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'use strict';var util=require('util');var logger=require('../config/logger')(_0x49c4('0x0'));var APIError=function(_0x18bf2d,_0x26844b){this[_0x49c4('0x1')]=_0x18bf2d||_0x49c4('0x2');this[_0x49c4('0x3')]=_0x26844b||'Error';util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x41a183){this['message']=_0x41a183||_0x49c4('0x4');this[_0x49c4('0x3')]=_0x49c4('0x4');util[_0x49c4('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x436234){this['message']=_0x436234||_0x49c4('0x6');this[_0x49c4('0x3')]=_0x49c4('0x7');util[_0x49c4('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x4c7d3a){switch(_0x4c7d3a){case'Bad\x20Request':return 0x190;case _0x49c4('0x8'),_0x49c4('0x9'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0xb611a1){return function(_0x459d09){logger['error'](_0x459d09['stack']);var _0x1d19bf=getStatusCode(_0x459d09[_0x49c4('0x3')]);if(_0x459d09['name'])delete _0x459d09[_0x49c4('0x3')];return _0xb611a1[_0x49c4('0xa')](_0x1d19bf)['send'](_0x459d09);};}module[_0x49c4('0xb')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
index 482e4e8..714b464 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e94=['status','render','json','send','exports','404'];(function(_0x2ada08,_0x5cca4a){var _0x5cf9fb=function(_0x425d1c){while(--_0x425d1c){_0x2ada08['push'](_0x2ada08['shift']());}};_0x5cf9fb(++_0x5cca4a);}(_0x0e94,0x88));var _0x40e9=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x0e94[_0x53ccf2];return _0x5a2964;};'use strict';module[_0x40e9('0x0')][0x194]=function pageNotFound(_0x2e9d75,_0x1b1cb2){var _0x14356d=_0x40e9('0x1');var _0xbbf461=0x194;var _0x362f96={'status':_0xbbf461};_0x1b1cb2[_0x40e9('0x2')](_0x362f96[_0x40e9('0x2')]);_0x1b1cb2[_0x40e9('0x3')](_0x14356d,{},function(_0x2723d3,_0xf5f45c){if(_0x2723d3){return _0x1b1cb2[_0x40e9('0x2')](_0x362f96['status'])[_0x40e9('0x4')](_0x362f96);}_0x1b1cb2[_0x40e9('0x5')](_0xf5f45c);});};
\ No newline at end of file
+var _0x2fee=['exports','404','status','render','json','send'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x2fee,0x11a));var _0xe2fe=function(_0x20099a,_0x2bf584){_0x20099a=_0x20099a-0x0;var _0x2c3649=_0x2fee[_0x20099a];return _0x2c3649;};'use strict';module[_0xe2fe('0x0')][0x194]=function pageNotFound(_0x52529f,_0xf0331c){var _0x527fbd=_0xe2fe('0x1');var _0x5dd7b6=0x194;var _0x35d241={'status':_0x5dd7b6};_0xf0331c[_0xe2fe('0x2')](_0x35d241['status']);_0xf0331c[_0xe2fe('0x3')](_0x527fbd,{},function(_0x2676cd,_0x128ac4){if(_0x2676cd){return _0xf0331c['status'](_0x35d241[_0xe2fe('0x2')])[_0xe2fe('0x4')](_0x35d241);}_0xf0331c[_0xe2fe('0x5')](_0x128ac4);});};
\ No newline at end of file
index 1b83990..b920976 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3764=['../api/smsInteraction/smsInteraction.model','SmsMessage','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../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','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/license/license.model','../api/campaign/campaign.model','../api/migration/migration.model','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileResource','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','hasOne','UserId','userSetting','cascade','hasMany','Recordings','VoiceQueuesRt','Extensions','CmHopperFinal','ReportAgentPreview','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteraction','FaxInteractions','MailInteractions','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','OpenchannelInteraction','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','UserVoicePrefix','UserChatQueue','SmsQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','Applications','Sounds','moh_has_sounds','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','CloudProviderId','restrict','MailServerOut','Imap','Smtp','Dispositions','CannedAnswer','Answers','MailMessage','List','ListId','Template','mandatoryDispositionPauseId','UserMailQueue','team_has_mail_queues','Account','Contact','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachment','Attachments','Interaction','ChatWebsiteId','TagId','Items','FaxAccountId','Interactions','Exntensions','FaxApplication','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','team_has_openchannel_queues','ChatMessage','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','Members','ChatProactiveAction','CompanyId','Phones','CmContactId','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Action','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','SmsApplications','Schedule','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','MetricId','Configurations','AccountId','Subjects','FieldId','Subject','SubjectId','Description','DescriptionId','Field','SugarcrmAccount','Descriptions','VariableId','DeskConfiguration','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerConfiguration','VtigerAccount','Dynamics365Account','Dynamics365Configuration','FreshsalesAccount','FromId','ChatInternalMessage','ToId','JscriptyQuestionReport','SessionId','ProjectId','team_has_whatsapp_queues','TeamVoicePrefix','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ChatTransferReport','FromChatWebsiteId','ToAgent','ToChatQueueId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappMessage','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','user','exports','sequelize','lodash','jstz','determine','xcall','mysql','utf8mb4','utf8_general_ci','sequelizeHistory','defaultsDeep','xC@LL1234','127.0.0.1','name','utf8','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','SmsAccount','SmsApplication'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x3764,0x1b0));var _0x4376=function(_0x26464b,_0x23a579){_0x26464b=_0x26464b-0x0;var _0x36ea35=_0x3764[_0x26464b];return _0x36ea35;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x4376('0x0'));var _=require(_0x4376('0x1'));var jstz=require(_0x4376('0x2'));var timezone=jstz[_0x4376('0x3')]();config['sequelize']=_['defaultsDeep'](config[_0x4376('0x0')],{'database':'motion2','username':_0x4376('0x4'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x4376('0x5'),'dialectOptions':{'charset':_0x4376('0x6')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x4376('0x7')}}});config[_0x4376('0x8')]=_[_0x4376('0x9')](config[_0x4376('0x8')],{'database':'motion2','username':'xcall','password':_0x4376('0xa'),'options':{'host':_0x4376('0xb'),'port':0xcea,'dialect':_0x4376('0x5'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x4376('0xc')](),'define':{'charset':_0x4376('0xd'),'collate':_0x4376('0x7')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x4376('0xe')],config[_0x4376('0x0')][_0x4376('0xf')],config['sequelize'][_0x4376('0x10')],config['sequelize'][_0x4376('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x4376('0xe')],config[_0x4376('0x8')][_0x4376('0xf')],config[_0x4376('0x8')][_0x4376('0x10')],config['sequelizeHistory'][_0x4376('0x11')])};db[_0x4376('0x12')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x14'));db[_0x4376('0x15')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x16'));db['VoiceContext']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x17'));db[_0x4376('0x18')]=db[_0x4376('0x0')]['import'](_0x4376('0x19'));db[_0x4376('0x1a')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x1b'));db[_0x4376('0x1c')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x1d'));db[_0x4376('0x1e')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x1f'));db[_0x4376('0x20')]=db['sequelize']['import'](_0x4376('0x21'));db[_0x4376('0x22')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x23'));db['VoiceMailMessage']=db['sequelize'][_0x4376('0x13')](_0x4376('0x24'));db[_0x4376('0x25')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/voiceCallReport/voiceCallReport.model');db[_0x4376('0x26')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0x4376('0x27')]=db[_0x4376('0x0')]['import'](_0x4376('0x28'));db[_0x4376('0x29')]=db[_0x4376('0x0')]['import']('../api/voiceQueueReport/voiceQueueReport.model');db[_0x4376('0x2a')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x2b'));db[_0x4376('0x2c')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x2d'));db[_0x4376('0x2e')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x4376('0x2f')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x4376('0x30')]=db[_0x4376('0x0')]['import'](_0x4376('0x31'));db['UserChatQueue']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x32'));db['UserMailQueue']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x33'));db[_0x4376('0x34')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x35'));db[_0x4376('0x36')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x37'));db[_0x4376('0x38')]=db['sequelize'][_0x4376('0x13')](_0x4376('0x39'));db[_0x4376('0x3a')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x3b'));db[_0x4376('0x3c')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x3d'));db['MailServerOut']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x3e'));db['MailAccount']=db[_0x4376('0x0')]['import'](_0x4376('0x3f'));db[_0x4376('0x40')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/mailQueue/mailQueue.model');db[_0x4376('0x41')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x42'));db[_0x4376('0x43')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db['sequelize'][_0x4376('0x13')](_0x4376('0x44'));db[_0x4376('0x45')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x46'));db[_0x4376('0x47')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/mailQueueReport/mailQueueReport.model');db[_0x4376('0x48')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x49'));db[_0x4376('0x4a')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0x4376('0x0')]['import'](_0x4376('0x4b'));db['FaxApplication']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x4c'));db[_0x4376('0x4d')]=db['sequelize'][_0x4376('0x13')](_0x4376('0x4e'));db[_0x4376('0x4f')]=db['sequelize']['import'](_0x4376('0x50'));db[_0x4376('0x51')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/faxQueue/faxQueue.model');db['FaxQueueReport']=db[_0x4376('0x0')][_0x4376('0x13')]('../api/faxQueueReport/faxQueueReport.model');db[_0x4376('0x52')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/smsAccount/smsAccount.model');db[_0x4376('0x53')]=db['sequelize'][_0x4376('0x13')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x54'));db[_0x4376('0x55')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/smsMessage/smsMessage.model');db['SmsQueue']=db[_0x4376('0x0')][_0x4376('0x13')]('../api/smsQueue/smsQueue.model');db['OpenchannelAccount']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x56'));db[_0x4376('0x57')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x58'));db['OpenchannelInteraction']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x59'));db[_0x4376('0x5a')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x5b'));db[_0x4376('0x5c')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0x4376('0x5d')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x5e'));db[_0x4376('0x5f')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x60'));db[_0x4376('0x61')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x62'));db['ChatInteraction']=db['sequelize']['import'](_0x4376('0x63'));db['ChatMessage']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x64'));db[_0x4376('0x65')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x66'));db[_0x4376('0x67')]=db[_0x4376('0x0')]['import']('../api/chatQueue/chatQueue.model');db[_0x4376('0x68')]=db[_0x4376('0x0')]['import'](_0x4376('0x69'));db['ChatProactiveAction']=db[_0x4376('0x0')]['import'](_0x4376('0x6a'));db[_0x4376('0x6b')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/cmCompany/cmCompany.model');db[_0x4376('0x6c')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x6d'));db[_0x4376('0x6e')]=db['sequelize'][_0x4376('0x13')](_0x4376('0x6f'));db['CmHopperBlack']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x70'));db['CmHopperFinal']=db[_0x4376('0x0')]['import'](_0x4376('0x71'));db[_0x4376('0x72')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x73'));db[_0x4376('0x74')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x75'));db['Action']=db[_0x4376('0x0')]['import'](_0x4376('0x76'));db[_0x4376('0x77')]=db[_0x4376('0x0')]['import'](_0x4376('0x78'));db['CannedAnswer']=db['sequelize'][_0x4376('0x13')]('../api/cannedAnswer/cannedAnswer.model');db[_0x4376('0x79')]=db[_0x4376('0x0')]['import'](_0x4376('0x7a'));db[_0x4376('0x7b')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x7c'));db[_0x4376('0x7d')]=db[_0x4376('0x0')]['import'](_0x4376('0x7e'));db[_0x4376('0x7f')]=db['sequelize'][_0x4376('0x13')](_0x4376('0x80'));db[_0x4376('0x81')]=db[_0x4376('0x0')]['import'](_0x4376('0x82'));db[_0x4376('0x83')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x84'));db['Schedule']=db['sequelize']['import'](_0x4376('0x85'));db[_0x4376('0x86')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x87'));db[_0x4376('0x88')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/tag/tag.model');db[_0x4376('0x89')]=db[_0x4376('0x0')]['import'](_0x4376('0x8a'));db[_0x4376('0x8b')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/cmContactHasItem/cmContactHasItem.model');db['CmHopperAdditionalPhone']=db['sequelize'][_0x4376('0x13')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db['Template']=db['sequelize']['import'](_0x4376('0x8c'));db[_0x4376('0x8d')]=db['sequelize'][_0x4376('0x13')](_0x4376('0x8e'));db[_0x4376('0x8f')]=db['sequelize'][_0x4376('0x13')](_0x4376('0x90'));db['Integration']=db[_0x4376('0x0')][_0x4376('0x13')]('../api/integration/integration.model');db[_0x4376('0x91')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x92'));db[_0x4376('0x93')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x4376('0x94')]=db['sequelize'][_0x4376('0x13')](_0x4376('0x95'));db['AnalyticExtractedReport']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x96'));db[_0x4376('0x97')]=db['sequelize']['import'](_0x4376('0x98'));db['AnalyticFieldReport']=db[_0x4376('0x0')][_0x4376('0x13')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0x4376('0x0')]['import'](_0x4376('0x99'));db[_0x4376('0x9a')]=db[_0x4376('0x0')]['import'](_0x4376('0x9b'));db[_0x4376('0x9c')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x9d'));db[_0x4376('0x9e')]=db[_0x4376('0x0')]['import'](_0x4376('0x9f'));db['SugarcrmAccount']=db[_0x4376('0x0')][_0x4376('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x4376('0xa0')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x4376('0xa1')]=db[_0x4376('0x0')]['import'](_0x4376('0xa2'));db[_0x4376('0xa3')]=db[_0x4376('0x0')]['import'](_0x4376('0xa4'));db['DeskConfiguration']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xa5'));db[_0x4376('0xa6')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xa7'));db[_0x4376('0xa8')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xa9'));db[_0x4376('0xaa')]=db['sequelize'][_0x4376('0x13')](_0x4376('0xab'));db[_0x4376('0xac')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xad'));db[_0x4376('0xae')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xaf'));db[_0x4376('0xb0')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x4376('0xb1')]=db[_0x4376('0x0')]['import'](_0x4376('0xb2'));db[_0x4376('0xb3')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xb4'));db[_0x4376('0xb5')]=db['sequelize']['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xb6'));db['VtigerAccount']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xb7'));db['VtigerConfiguration']=db['sequelize'][_0x4376('0x13')](_0x4376('0xb8'));db[_0x4376('0xb9')]=db['sequelize'][_0x4376('0x13')](_0x4376('0xba'));db[_0x4376('0xbb')]=db['sequelize']['import'](_0x4376('0xbc'));db[_0x4376('0xbd')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xbe'));db[_0x4376('0xbf')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xc0'));db['Dynamics365Account']=db[_0x4376('0x0')][_0x4376('0x13')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xc1'));db[_0x4376('0xc2')]=db['sequelize'][_0x4376('0x13')](_0x4376('0xc3'));db['FreshsalesAccount']=db[_0x4376('0x0')]['import'](_0x4376('0xc4'));db[_0x4376('0xc5')]=db[_0x4376('0x0')]['import'](_0x4376('0xc6'));db[_0x4376('0xc7')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xc8'));db[_0x4376('0xc9')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xca'));db[_0x4376('0xcb')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xcc'));db[_0x4376('0xcd')]=db[_0x4376('0x0')]['import'](_0x4376('0xce'));db['ChatInternalMessage']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xcf'));db[_0x4376('0xd0')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db['JscriptyQuestionReport']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xd1'));db[_0x4376('0xd2')]=db[_0x4376('0x0')]['import'](_0x4376('0xd3'));db[_0x4376('0xd4')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xd5'));db[_0x4376('0xd6')]=db['sequelize'][_0x4376('0x13')](_0x4376('0xd7'));db[_0x4376('0xd8')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/jscriptyProject/jscriptyProject.model');db[_0x4376('0xd9')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xda'));db['SquareOdbc']=db[_0x4376('0x0')]['import'](_0x4376('0xdb'));db[_0x4376('0xdc')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xdd'));db[_0x4376('0xde')]=db['sequelize'][_0x4376('0x13')](_0x4376('0xdf'));db['SquareMessage']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xe0'));db[_0x4376('0xe1')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/team/team.model');db['License']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xe2'));db['Campaign']=db['sequelize'][_0x4376('0x13')](_0x4376('0xe3'));db['Migration']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xe4'));db['Attachment']=db[_0x4376('0x0')]['import'](_0x4376('0xe5'));db['Plugin']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xe6'));db[_0x4376('0xe7')]=db['sequelize'][_0x4376('0x13')]('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xe8'));db[_0x4376('0xe9')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/faxTransferReport/faxTransferReport.model');db[_0x4376('0xea')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xeb'));db[_0x4376('0xec')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xed'));db[_0x4376('0xee')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xef'));db['VoicePrefix']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xf0'));db[_0x4376('0xf1')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0x4376('0x0')]['import']('../api/userProfileSection/userProfileSection.model');db[_0x4376('0xf2')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db[_0x4376('0x0')][_0x4376('0x13')]('../api/userNotification/userNotification.model');db[_0x4376('0xf3')]=db[_0x4376('0x0')]['import']('../api/whatsappAccount/whatsappAccount.model');db[_0x4376('0xf4')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xf5'));db[_0x4376('0xf6')]=db['sequelize'][_0x4376('0x13')](_0x4376('0xf7'));db['WhatsappMessage']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xf8'));db[_0x4376('0xf9')]=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0xfa'));db[_0x4376('0xfb')]=db[_0x4376('0x0')]['import'](_0x4376('0xfc'));db[_0x4376('0xfd')]=db[_0x4376('0x0')][_0x4376('0x13')]('../api/whatsappQueue/whatsappQueue.model');db[_0x4376('0xfe')]=db['sequelize'][_0x4376('0x13')](_0x4376('0xff'));db['TeamVoiceQueue']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x100'));db['TeamVoicePrefix']=db[_0x4376('0x0')][_0x4376('0x13')](_0x4376('0x101'));db['UserVoicePrefix']=db[_0x4376('0x0')]['import'](_0x4376('0x102'));db[_0x4376('0x103')]=db['sequelize'][_0x4376('0x13')]('../api/user-setting/user-setting.model');db[_0x4376('0x12')][_0x4376('0x104')](db['VoiceMail'],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0x4376('0x105')});db[_0x4376('0x12')]['hasOne'](db['UserSetting'],{'as':_0x4376('0x106'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x105')});db[_0x4376('0x12')][_0x4376('0x108')](db[_0x4376('0x1e')],{'as':_0x4376('0x109'),'foreignKey':_0x4376('0x105')});db['User'][_0x4376('0x108')](db[_0x4376('0x2f')],{'as':_0x4376('0x10a'),'foreignKey':_0x4376('0x105')});db[_0x4376('0x12')][_0x4376('0x108')](db[_0x4376('0x18')],{'as':_0x4376('0x10b'),'onDelete':_0x4376('0x107'),'hooks':!![]});db[_0x4376('0x12')][_0x4376('0x108')](db[_0x4376('0x10c')],{'as':'HopperFinals','foreignKey':'UserId'});db[_0x4376('0x12')][_0x4376('0x108')](db[_0x4376('0x72')],{'as':'HopperHistory','foreignKey':'UserId'});db[_0x4376('0x12')][_0x4376('0x108')](db[_0x4376('0x10d')],{'as':_0x4376('0x10d'),'foreignKey':_0x4376('0x105')});db[_0x4376('0x12')][_0x4376('0x108')](db['OpenchannelInteraction'],{'as':_0x4376('0x10e'),'foreignKey':_0x4376('0x105')});db['User'][_0x4376('0x108')](db[_0x4376('0x10f')],{'as':_0x4376('0x110'),'foreignKey':_0x4376('0x105')});db['User'][_0x4376('0x108')](db[_0x4376('0x111')],{'as':'SmsInteractions','foreignKey':_0x4376('0x105')});db[_0x4376('0x12')][_0x4376('0x108')](db[_0x4376('0x4d')],{'as':_0x4376('0x112'),'foreignKey':_0x4376('0x105')});db[_0x4376('0x12')]['hasMany'](db[_0x4376('0x43')],{'as':_0x4376('0x113'),'foreignKey':_0x4376('0x105')});db[_0x4376('0x12')][_0x4376('0x108')](db[_0x4376('0xf6')],{'as':'WhatsappInteractions','foreignKey':_0x4376('0x105')});db[_0x4376('0x12')][_0x4376('0x108')](db['UserNotification'],{'as':'UserNotifications','foreignKey':_0x4376('0x114')});db[_0x4376('0x12')][_0x4376('0x115')](db[_0x4376('0xf1')],{'as':_0x4376('0xf1'),'foreignKey':_0x4376('0x116')});db[_0x4376('0x12')][_0x4376('0x117')](db['ChatGroup'],{'as':_0x4376('0x118'),'through':_0x4376('0x119')});db[_0x4376('0x12')][_0x4376('0x117')](db[_0x4376('0x6c')],{'as':_0x4376('0x11a'),'through':_0x4376('0x11b')});db[_0x4376('0x12')][_0x4376('0x117')](db[_0x4376('0xee')],{'as':_0x4376('0x11c'),'through':'cm_user_has_lists'});db[_0x4376('0x12')][_0x4376('0x117')](db[_0x4376('0xe1')],{'through':_0x4376('0x11d')});db['User'][_0x4376('0x117')](db[_0x4376('0x43')],{'as':_0x4376('0x113'),'through':'user_has_mail_interactions'});db[_0x4376('0x12')]['belongsToMany'](db[_0x4376('0x10f')],{'as':_0x4376('0x110'),'through':_0x4376('0x11e')});db[_0x4376('0x12')][_0x4376('0x117')](db[_0x4376('0x4d')],{'as':_0x4376('0x112'),'through':_0x4376('0x11f')});db[_0x4376('0x12')][_0x4376('0x117')](db['SmsInteraction'],{'as':_0x4376('0x120'),'through':_0x4376('0x121')});db[_0x4376('0x12')][_0x4376('0x117')](db[_0x4376('0x122')],{'as':'OpenchannelInteractions','through':_0x4376('0x123')});db[_0x4376('0x12')][_0x4376('0x117')](db['WhatsappInteraction'],{'as':_0x4376('0x124'),'through':_0x4376('0x125')});db['User'][_0x4376('0x117')](db[_0x4376('0x1c')],{'as':_0x4376('0x126'),'through':_0x4376('0x30'),'required':![]});db['User']['belongsToMany'](db[_0x4376('0x127')],{'as':_0x4376('0x128'),'through':_0x4376('0x129'),'required':![]});db[_0x4376('0x12')]['belongsToMany'](db[_0x4376('0x40')],{'as':'MailQueues','through':'UserMailQueue','required':![]});db[_0x4376('0x12')]['belongsToMany'](db[_0x4376('0x67')],{'as':'ChatQueues','through':_0x4376('0x12a'),'required':![],'hooks':!![]});db[_0x4376('0x12')]['belongsToMany'](db[_0x4376('0x51')],{'as':'FaxQueues','through':_0x4376('0x34'),'required':![]});db['User'][_0x4376('0x117')](db[_0x4376('0x12b')],{'as':_0x4376('0x12c'),'through':_0x4376('0x36'),'required':![]});db[_0x4376('0x12')][_0x4376('0x117')](db[_0x4376('0x5c')],{'as':_0x4376('0x12d'),'through':_0x4376('0x38'),'required':![]});db['User'][_0x4376('0x117')](db[_0x4376('0xfd')],{'as':_0x4376('0x12e'),'through':_0x4376('0x3a'),'required':![]});db[_0x4376('0x12')][_0x4376('0x117')](db[_0x4376('0xee')],{'through':_0x4376('0x12f')});db[_0x4376('0x12')]['belongsToMany'](db['ChatWebsite'],{'as':_0x4376('0x130'),'through':_0x4376('0x131')});db[_0x4376('0x12')][_0x4376('0x117')](db[_0x4376('0x132')],{'as':_0x4376('0x133'),'through':_0x4376('0x134')});db[_0x4376('0x12')][_0x4376('0x117')](db[_0x4376('0x135')],{'as':_0x4376('0x136'),'through':_0x4376('0x137')});db[_0x4376('0x12')][_0x4376('0x117')](db[_0x4376('0x138')],{'as':_0x4376('0x139'),'through':'user_has_openchannel_accounts'});db[_0x4376('0x12')][_0x4376('0x117')](db['SmsAccount'],{'as':'SmsAccounts','through':_0x4376('0x13a')});db[_0x4376('0x12')][_0x4376('0x117')](db[_0x4376('0xf3')],{'as':_0x4376('0x13b'),'through':_0x4376('0x13c')});db[_0x4376('0x12')][_0x4376('0x117')](db[_0x4376('0xdc')],{'as':_0x4376('0x13d'),'through':_0x4376('0x13e')});db[_0x4376('0x15')][_0x4376('0x108')](db[_0x4376('0x18')],{'as':_0x4376('0x13f'),'onDelete':_0x4376('0x107'),'foreignKey':'ChanSpyId'});db['VoiceContext'][_0x4376('0x108')](db[_0x4376('0x18')],{'onDelete':_0x4376('0x107')});db[_0x4376('0x18')][_0x4376('0x108')](db[_0x4376('0x18')],{'as':_0x4376('0x140'),'onDelete':'cascade'});db['VoiceMusicOnHold'][_0x4376('0x117')](db['Sound'],{'as':_0x4376('0x141'),'through':_0x4376('0x142')});db[_0x4376('0x1c')][_0x4376('0x108')](db[_0x4376('0x2f')],{'as':'Members','foreignKey':_0x4376('0x143')});db['VoiceQueue'][_0x4376('0x108')](db[_0x4376('0x6e')],{'as':_0x4376('0x144'),'foreignKey':_0x4376('0x143')});db[_0x4376('0x1c')][_0x4376('0x108')](db['CmHopperFinal'],{'as':_0x4376('0x145'),'foreignKey':_0x4376('0x143')});db[_0x4376('0x1c')][_0x4376('0x108')](db[_0x4376('0x72')],{'as':_0x4376('0x146'),'foreignKey':_0x4376('0x143')});db[_0x4376('0x1c')][_0x4376('0x108')](db[_0x4376('0x10d')],{'as':_0x4376('0x10d'),'foreignKey':_0x4376('0x143')});db['VoiceQueue'][_0x4376('0x108')](db[_0x4376('0x147')],{'as':_0x4376('0x148'),'foreignKey':_0x4376('0x143')});db[_0x4376('0x1c')][_0x4376('0x108')](db[_0x4376('0xd2')],{'as':_0x4376('0x149'),'foreignKey':_0x4376('0x143')});db[_0x4376('0x1c')][_0x4376('0x115')](db['Trunk'],{'as':_0x4376('0x2c'),'foreignKey':_0x4376('0x14a')});db[_0x4376('0x1c')]['belongsTo'](db[_0x4376('0x2c')],{'as':'TrunkBackup','foreignKey':_0x4376('0x14b')});db[_0x4376('0x1c')][_0x4376('0x115')](db[_0x4376('0x7d')],{'as':_0x4376('0x7d'),'foreignKey':_0x4376('0x14c')});db[_0x4376('0x1c')][_0x4376('0x115')](db[_0x4376('0x7f')],{'as':_0x4376('0x14d'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4376('0x1c')][_0x4376('0x117')](db[_0x4376('0xee')],{'as':_0x4376('0x11c'),'through':_0x4376('0x14e')});db['VoiceQueue']['belongsToMany'](db[_0x4376('0x12')],{'as':_0x4376('0x14f'),'through':_0x4376('0x30')});db[_0x4376('0x1c')][_0x4376('0x117')](db[_0x4376('0xe1')],{'as':_0x4376('0x150'),'through':_0x4376('0x151')});db[_0x4376('0x1c')][_0x4376('0x117')](db[_0x4376('0xee')],{'as':_0x4376('0x152'),'through':_0x4376('0x153')});db[_0x4376('0x1e')][_0x4376('0x115')](db['User'],{'as':'User','foreignKey':_0x4376('0x105')});db[_0x4376('0x20')]['belongsTo'](db['User'],{'as':_0x4376('0x12'),'foreignKey':'UserId'});db['VoiceMail'][_0x4376('0x108')](db[_0x4376('0x154')],{'as':_0x4376('0x155'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x156'),'sourceKey':_0x4376('0x157')});db[_0x4376('0x154')]['belongsTo'](db[_0x4376('0x22')],{'foreignKey':_0x4376('0x156'),'targetKey':_0x4376('0x157')});db[_0x4376('0x25')][_0x4376('0x108')](db['VoiceQueueReport'],{'as':_0x4376('0x158'),'foreignKey':_0x4376('0x159'),'constraints':![]});db[_0x4376('0x25')][_0x4376('0x108')](db[_0x4376('0x27')],{'as':_0x4376('0x15a'),'foreignKey':_0x4376('0x159'),'constraints':![]});db[_0x4376('0x25')][_0x4376('0x115')](db[_0x4376('0x12')],{'as':'User','foreignKey':_0x4376('0x105')});db[_0x4376('0x25')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x4376('0x15b')});db[_0x4376('0x3c')]['belongsTo'](db[_0x4376('0x135')],{'as':_0x4376('0x135'),'foreignKey':_0x4376('0x15c')});db[_0x4376('0x3c')][_0x4376('0x115')](db['CloudProvider'],{'as':_0x4376('0xfe'),'foreignKey':_0x4376('0x15d'),'onDelete':_0x4376('0x15e')});db[_0x4376('0x15f')][_0x4376('0x115')](db[_0x4376('0x135')],{'as':_0x4376('0x135'),'foreignKey':_0x4376('0x15c')});db[_0x4376('0x15f')][_0x4376('0x115')](db[_0x4376('0xfe')],{'as':_0x4376('0xfe'),'foreignKey':_0x4376('0x15d'),'onDelete':_0x4376('0x15e')});db[_0x4376('0x135')][_0x4376('0x104')](db[_0x4376('0x3c')],{'as':_0x4376('0x160'),'onDelete':'cascade'});db[_0x4376('0x135')][_0x4376('0x104')](db['MailServerOut'],{'as':_0x4376('0x161'),'onDelete':_0x4376('0x107')});db[_0x4376('0x135')][_0x4376('0x108')](db[_0x4376('0x79')],{'as':_0x4376('0x162'),'foreignKey':'MailAccountId','onDelete':_0x4376('0x107')});db[_0x4376('0x135')]['hasMany'](db[_0x4376('0x163')],{'as':_0x4376('0x164'),'foreignKey':_0x4376('0x15c')});db[_0x4376('0x135')]['hasMany'](db[_0x4376('0x165')],{'as':_0x4376('0x155'),'foreignKey':_0x4376('0x15c')});db[_0x4376('0x135')][_0x4376('0x108')](db[_0x4376('0x43')],{'as':'Interactions'});db[_0x4376('0x135')]['hasMany'](db['MailApplication'],{'as':_0x4376('0x140')});db[_0x4376('0x135')]['belongsTo'](db[_0x4376('0xee')],{'as':_0x4376('0x166'),'foreignKey':_0x4376('0x167')});db[_0x4376('0x135')][_0x4376('0x115')](db[_0x4376('0x168')],{'as':_0x4376('0x168'),'foreignKey':'TemplateId'});db['MailAccount'][_0x4376('0x115')](db[_0x4376('0x7f')],{'as':'mandatoryDispositionPause','foreignKey':_0x4376('0x169')});db[_0x4376('0x135')]['belongsToMany'](db[_0x4376('0x12')],{'as':_0x4376('0x14f'),'through':_0x4376('0x137')});db[_0x4376('0x40')]['belongsToMany'](db['User'],{'as':_0x4376('0x14f'),'through':_0x4376('0x16a')});db[_0x4376('0x40')]['belongsToMany'](db[_0x4376('0xe1')],{'through':_0x4376('0x16b'),'as':_0x4376('0x150')});db[_0x4376('0x43')]['hasMany'](db['MailMessage'],{'as':'Messages','onDelete':_0x4376('0x107'),'foreignKey':'MailInteractionId'});db[_0x4376('0x43')][_0x4376('0x115')](db['MailAccount'],{'as':_0x4376('0x16c'),'foreignKey':_0x4376('0x15c')});db[_0x4376('0x43')][_0x4376('0x115')](db[_0x4376('0x6c')],{'as':_0x4376('0x16d'),'foreignKey':_0x4376('0x15b')});db['MailInteraction']['belongsTo'](db[_0x4376('0x12')],{'as':_0x4376('0x16e'),'foreignKey':'UserId'});db[_0x4376('0x43')][_0x4376('0x117')](db[_0x4376('0x88')],{'through':_0x4376('0x16f'),'as':_0x4376('0x170')});db['MailInteraction']['belongsToMany'](db[_0x4376('0x88')],{'through':_0x4376('0x16f'),'as':_0x4376('0x171')});db[_0x4376('0x43')][_0x4376('0x117')](db[_0x4376('0x12')],{'as':_0x4376('0x172'),'through':'user_has_mail_interactions','foreignKey':_0x4376('0x173')});db[_0x4376('0x165')][_0x4376('0x108')](db[_0x4376('0x174')],{'as':_0x4376('0x175'),'onDelete':_0x4376('0x107')});db[_0x4376('0x165')][_0x4376('0x115')](db[_0x4376('0x12')],{'as':_0x4376('0x12')});db[_0x4376('0x165')]['belongsTo'](db['CmContact'],{'onDelete':_0x4376('0x107'),'as':_0x4376('0x16d')});db['MailMessage'][_0x4376('0x115')](db[_0x4376('0x43')],{'as':_0x4376('0x176'),'foreignKey':'MailInteractionId'});db[_0x4376('0x165')][_0x4376('0x115')](db[_0x4376('0x135')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x4376('0x165')][_0x4376('0x115')](db[_0x4376('0x5d')],{'as':'ChatWebsite','foreignKey':_0x4376('0x177')});db[_0x4376('0x165')][_0x4376('0x115')](db[_0x4376('0x65')],{'as':_0x4376('0x65'),'foreignKey':'ChatOfflineMessageId'});db[_0x4376('0x45')][_0x4376('0x115')](db[_0x4376('0x12')],{'onDelete':_0x4376('0x15e')});db[_0x4376('0x45')][_0x4376('0x115')](db[_0x4376('0x40')],{'onDelete':_0x4376('0x15e')});db[_0x4376('0x45')][_0x4376('0x115')](db[_0x4376('0x135')],{'onDelete':_0x4376('0x15e')});db[_0x4376('0x45')][_0x4376('0x115')](db['Interval'],{'onDelete':_0x4376('0x15e'),'foreignKey':'IntervalId'});db['MailApplication'][_0x4376('0x115')](db[_0x4376('0x88')],{'onDelete':_0x4376('0x15e'),'foreignKey':_0x4376('0x178')});db[_0x4376('0x47')][_0x4376('0x115')](db[_0x4376('0x135')],{});db['MailQueueReport']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x4376('0x167')});db[_0x4376('0x47')][_0x4376('0x115')](db[_0x4376('0x6c')],{'as':_0x4376('0x16d'),'foreignKey':_0x4376('0x15b')});db[_0x4376('0x47')][_0x4376('0x115')](db[_0x4376('0x43')],{});db['MailQueueReport'][_0x4376('0x115')](db['MailMessage'],{});db['MailQueueReport']['belongsTo'](db[_0x4376('0x12')],{});db['MailQueueReport'][_0x4376('0x115')](db[_0x4376('0x40')],{});db[_0x4376('0x48')]['hasMany'](db[_0x4376('0x4a')],{'as':_0x4376('0x179'),'onDelete':_0x4376('0x107')});db[_0x4376('0x132')][_0x4376('0x108')](db['Disposition'],{'as':_0x4376('0x162'),'foreignKey':_0x4376('0x17a'),'onDelete':_0x4376('0x107')});db[_0x4376('0x132')][_0x4376('0x108')](db[_0x4376('0x163')],{'as':_0x4376('0x164'),'foreignKey':_0x4376('0x17a')});db[_0x4376('0x132')][_0x4376('0x108')](db[_0x4376('0x4d')],{'as':_0x4376('0x17b')});db[_0x4376('0x132')][_0x4376('0x108')](db['FaxApplication'],{'as':_0x4376('0x140')});db[_0x4376('0x132')][_0x4376('0x108')](db['VoiceExtension'],{'as':_0x4376('0x17c'),'onDelete':'cascade'});db[_0x4376('0x132')][_0x4376('0x108')](db['FaxMessage'],{'as':_0x4376('0x155')});db[_0x4376('0x132')][_0x4376('0x115')](db[_0x4376('0x2c')],{'as':_0x4376('0x2c')});db[_0x4376('0x132')][_0x4376('0x115')](db[_0x4376('0xee')],{'as':'List','foreignKey':_0x4376('0x167')});db[_0x4376('0x132')][_0x4376('0x115')](db[_0x4376('0x7f')],{'as':_0x4376('0x14d'),'foreignKey':_0x4376('0x169')});db[_0x4376('0x132')][_0x4376('0x117')](db[_0x4376('0x12')],{'as':'Agents','through':'user_has_fax_accounts'});db[_0x4376('0x17d')][_0x4376('0x115')](db[_0x4376('0x12')],{'onDelete':_0x4376('0x15e')});db['FaxApplication'][_0x4376('0x115')](db[_0x4376('0x51')],{'onDelete':'restrict'});db['FaxApplication'][_0x4376('0x115')](db[_0x4376('0x132')],{'onDelete':'restrict'});db['FaxApplication']['belongsTo'](db[_0x4376('0x88')],{'onDelete':_0x4376('0x15e'),'foreignKey':_0x4376('0x178')});db[_0x4376('0x4d')]['hasMany'](db[_0x4376('0x4f')],{'as':_0x4376('0x155'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x17e')});db[_0x4376('0x4d')]['belongsTo'](db[_0x4376('0x132')],{'as':_0x4376('0x16c'),'foreignKey':'FaxAccountId'});db[_0x4376('0x4d')][_0x4376('0x115')](db[_0x4376('0x6c')],{'as':_0x4376('0x16d'),'foreignKey':_0x4376('0x15b')});db['FaxInteraction'][_0x4376('0x115')](db[_0x4376('0x12')],{'as':_0x4376('0x16e'),'foreignKey':_0x4376('0x105')});db['FaxInteraction']['belongsToMany'](db[_0x4376('0x88')],{'through':_0x4376('0x17f'),'as':'Tags'});db[_0x4376('0x4d')][_0x4376('0x117')](db[_0x4376('0x88')],{'through':_0x4376('0x17f'),'as':_0x4376('0x171')});db[_0x4376('0x4d')][_0x4376('0x117')](db['User'],{'as':_0x4376('0x172'),'through':_0x4376('0x11f'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x4376('0x115')](db[_0x4376('0x12')],{'onDelete':_0x4376('0x107'),'as':_0x4376('0x12')});db[_0x4376('0x4f')][_0x4376('0x115')](db[_0x4376('0x4d')],{'as':_0x4376('0x176'),'foreignKey':_0x4376('0x17e')});db[_0x4376('0x4f')]['belongsTo'](db[_0x4376('0x6c')],{'onDelete':_0x4376('0x107'),'as':_0x4376('0x16d')});db[_0x4376('0x4f')][_0x4376('0x115')](db[_0x4376('0x174')],{'as':'Attachment','foreignKey':_0x4376('0x180')});db[_0x4376('0x4f')]['belongsTo'](db[_0x4376('0x132')],{'as':'Account','foreignKey':_0x4376('0x17a')});db[_0x4376('0x51')][_0x4376('0x117')](db['User'],{'as':_0x4376('0x14f'),'through':'UserFaxQueue'});db[_0x4376('0x51')][_0x4376('0x117')](db[_0x4376('0xe1')],{'through':_0x4376('0x181'),'as':_0x4376('0x150')});db[_0x4376('0x182')][_0x4376('0x115')](db['FaxAccount'],{});db['FaxQueueReport'][_0x4376('0x115')](db[_0x4376('0xee')],{'as':_0x4376('0x166'),'foreignKey':_0x4376('0x167')});db['FaxQueueReport']['belongsTo'](db[_0x4376('0x6c')],{'as':_0x4376('0x16d'),'foreignKey':_0x4376('0x15b')});db[_0x4376('0x182')][_0x4376('0x115')](db[_0x4376('0x4d')],{});db[_0x4376('0x182')][_0x4376('0x115')](db[_0x4376('0x4f')],{});db[_0x4376('0x182')]['belongsTo'](db[_0x4376('0x12')],{});db['FaxQueueReport'][_0x4376('0x115')](db[_0x4376('0x51')],{});db[_0x4376('0x52')]['hasMany'](db[_0x4376('0x79')],{'as':_0x4376('0x162'),'foreignKey':'SmsAccountId','onDelete':_0x4376('0x107')});db[_0x4376('0x52')][_0x4376('0x108')](db[_0x4376('0x163')],{'as':_0x4376('0x164'),'foreignKey':_0x4376('0x183')});db[_0x4376('0x52')][_0x4376('0x108')](db[_0x4376('0x55')],{'as':_0x4376('0x155'),'foreignKey':_0x4376('0x183')});db['SmsAccount']['hasMany'](db[_0x4376('0x111')],{'as':'Interactions'});db[_0x4376('0x52')][_0x4376('0x108')](db[_0x4376('0x53')],{'as':_0x4376('0x140')});db[_0x4376('0x52')][_0x4376('0x115')](db[_0x4376('0xee')],{'as':'List','foreignKey':'ListId'});db['SmsAccount']['belongsTo'](db[_0x4376('0x7f')],{'as':'mandatoryDispositionPause','foreignKey':_0x4376('0x169')});db['SmsAccount']['belongsToMany'](db[_0x4376('0x12')],{'as':_0x4376('0x14f'),'through':_0x4376('0x13a')});db[_0x4376('0x53')]['belongsTo'](db[_0x4376('0x12')],{'onDelete':_0x4376('0x15e')});db['SmsApplication'][_0x4376('0x115')](db['SmsQueue'],{'onDelete':_0x4376('0x15e')});db[_0x4376('0x53')][_0x4376('0x115')](db[_0x4376('0x52')],{'onDelete':_0x4376('0x15e')});db[_0x4376('0x53')][_0x4376('0x115')](db[_0x4376('0x7d')],{'onDelete':_0x4376('0x15e'),'foreignKey':_0x4376('0x14c')});db['SmsApplication'][_0x4376('0x115')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x4376('0x178')});db[_0x4376('0x111')][_0x4376('0x108')](db[_0x4376('0x55')],{'as':_0x4376('0x155'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x184')});db[_0x4376('0x111')][_0x4376('0x115')](db[_0x4376('0x52')],{'as':'Account','foreignKey':_0x4376('0x183')});db[_0x4376('0x111')][_0x4376('0x115')](db[_0x4376('0x6c')],{'as':_0x4376('0x16d'),'foreignKey':_0x4376('0x15b')});db[_0x4376('0x111')]['belongsTo'](db[_0x4376('0x12')],{'as':_0x4376('0x16e'),'foreignKey':_0x4376('0x105')});db[_0x4376('0x111')]['belongsToMany'](db['Tag'],{'through':_0x4376('0x185'),'as':_0x4376('0x170')});db[_0x4376('0x111')]['belongsToMany'](db[_0x4376('0x88')],{'through':_0x4376('0x185'),'as':_0x4376('0x171')});db[_0x4376('0x111')][_0x4376('0x117')](db[_0x4376('0x12')],{'as':_0x4376('0x172'),'through':_0x4376('0x121'),'foreignKey':_0x4376('0x184')});db[_0x4376('0x55')][_0x4376('0x115')](db[_0x4376('0x12')],{'as':_0x4376('0x12')});db[_0x4376('0x55')]['belongsTo'](db[_0x4376('0x6c')],{'onDelete':_0x4376('0x107'),'as':'Contact'});db[_0x4376('0x55')][_0x4376('0x115')](db['SmsInteraction'],{'onDelete':_0x4376('0x107'),'as':_0x4376('0x176'),'foreignKey':_0x4376('0x184')});db[_0x4376('0x55')][_0x4376('0x115')](db[_0x4376('0x52')],{'as':_0x4376('0x16c'),'foreignKey':_0x4376('0x183')});db[_0x4376('0x12b')][_0x4376('0x117')](db['User'],{'as':'Agents','through':_0x4376('0x36'),'foreignKey':_0x4376('0x186')});db[_0x4376('0x12b')]['belongsToMany'](db[_0x4376('0xe1')],{'through':_0x4376('0x187'),'as':_0x4376('0x150')});db['OpenchannelAccount']['hasMany'](db[_0x4376('0x79')],{'as':_0x4376('0x162'),'foreignKey':'OpenchannelAccountId','onDelete':'cascade'});db[_0x4376('0x138')]['hasMany'](db[_0x4376('0x163')],{'as':_0x4376('0x164'),'foreignKey':_0x4376('0x188')});db[_0x4376('0x138')][_0x4376('0x108')](db['OpenchannelInteraction'],{'as':_0x4376('0x17b'),'foreignKey':_0x4376('0x188')});db[_0x4376('0x138')][_0x4376('0x108')](db[_0x4376('0x5a')],{'as':'Messages','foreignKey':_0x4376('0x188')});db[_0x4376('0x138')][_0x4376('0x108')](db[_0x4376('0x57')],{'as':_0x4376('0x140'),'foreignKey':_0x4376('0x188')});db[_0x4376('0x138')][_0x4376('0x115')](db['CmList'],{'as':_0x4376('0x166'),'foreignKey':_0x4376('0x167')});db[_0x4376('0x138')][_0x4376('0x115')](db[_0x4376('0x7f')],{'as':_0x4376('0x14d'),'foreignKey':_0x4376('0x169')});db['OpenchannelAccount'][_0x4376('0x117')](db['User'],{'as':_0x4376('0x14f'),'through':_0x4376('0x189')});db[_0x4376('0x57')][_0x4376('0x115')](db[_0x4376('0x12')],{'onDelete':_0x4376('0x15e')});db[_0x4376('0x57')][_0x4376('0x115')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db[_0x4376('0x57')][_0x4376('0x115')](db[_0x4376('0x138')],{'onDelete':'restrict','foreignKey':_0x4376('0x188')});db['OpenchannelApplication']['belongsTo'](db['Interval'],{'onDelete':_0x4376('0x15e'),'foreignKey':_0x4376('0x14c')});db[_0x4376('0x57')][_0x4376('0x115')](db[_0x4376('0x88')],{'onDelete':_0x4376('0x15e'),'foreignKey':_0x4376('0x178')});db[_0x4376('0x122')][_0x4376('0x108')](db[_0x4376('0x5a')],{'as':_0x4376('0x155'),'onDelete':'cascade','foreignKey':_0x4376('0x18a')});db['OpenchannelInteraction'][_0x4376('0x115')](db['OpenchannelAccount'],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0x4376('0x122')][_0x4376('0x115')](db[_0x4376('0x6c')],{'as':'Contact','foreignKey':_0x4376('0x15b')});db[_0x4376('0x122')][_0x4376('0x115')](db[_0x4376('0x12')],{'as':_0x4376('0x16e'),'foreignKey':_0x4376('0x105')});db[_0x4376('0x122')][_0x4376('0x117')](db[_0x4376('0x88')],{'through':_0x4376('0x18b'),'as':_0x4376('0x170')});db['OpenchannelInteraction'][_0x4376('0x117')](db[_0x4376('0x88')],{'through':_0x4376('0x18b'),'as':_0x4376('0x171')});db[_0x4376('0x122')]['belongsToMany'](db[_0x4376('0x12')],{'as':'Users','through':_0x4376('0x123'),'foreignKey':_0x4376('0x18a')});db['OpenchannelMessage'][_0x4376('0x115')](db['User'],{'onDelete':_0x4376('0x107'),'as':'User'});db[_0x4376('0x5a')]['belongsTo'](db[_0x4376('0x6c')],{'onDelete':'cascade','as':_0x4376('0x16d')});db[_0x4376('0x5a')][_0x4376('0x115')](db[_0x4376('0x122')],{'onDelete':_0x4376('0x107'),'as':_0x4376('0x176'),'foreignKey':'OpenchannelInteractionId'});db[_0x4376('0x5a')][_0x4376('0x115')](db[_0x4376('0x174')],{'as':_0x4376('0x174'),'foreignKey':'AttachmentId'});db[_0x4376('0x5a')]['belongsTo'](db[_0x4376('0x138')],{'as':_0x4376('0x16c'),'foreignKey':_0x4376('0x188')});db[_0x4376('0x5c')][_0x4376('0x117')](db['User'],{'as':_0x4376('0x14f'),'through':_0x4376('0x38'),'foreignKey':_0x4376('0x18c')});db['OpenchannelQueue']['belongsToMany'](db[_0x4376('0xe1')],{'through':_0x4376('0x18d'),'as':'Teams'});db['ChatWebsite'][_0x4376('0x108')](db[_0x4376('0x79')],{'as':_0x4376('0x162'),'foreignKey':_0x4376('0x177'),'onDelete':_0x4376('0x107')});db[_0x4376('0x5d')]['hasMany'](db[_0x4376('0x163')],{'as':_0x4376('0x164'),'foreignKey':_0x4376('0x177')});db[_0x4376('0x5d')][_0x4376('0x108')](db['ChatProactiveAction'],{'as':'ProactiveActions'});db['ChatWebsite'][_0x4376('0x108')](db[_0x4376('0x10f')],{'as':_0x4376('0x17b')});db[_0x4376('0x5d')][_0x4376('0x108')](db[_0x4376('0x61')],{'as':'Applications'});db['ChatWebsite']['hasMany'](db[_0x4376('0x18e')],{'as':_0x4376('0x155')});db[_0x4376('0x5d')][_0x4376('0x115')](db['CmList'],{'as':_0x4376('0x166'),'foreignKey':_0x4376('0x167')});db[_0x4376('0x5d')][_0x4376('0x115')](db[_0x4376('0x7d')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x4376('0x5d')]['belongsTo'](db[_0x4376('0x135')],{'as':'MailAccount','foreignKey':_0x4376('0x15c')});db[_0x4376('0x5d')]['belongsTo'](db[_0x4376('0x7f')],{'as':_0x4376('0x14d'),'foreignKey':_0x4376('0x169')});db[_0x4376('0x5d')][_0x4376('0x117')](db[_0x4376('0x12')],{'as':'Agents','through':'user_has_chat_websites'});db['OpenchannelQueueReport']['belongsTo'](db[_0x4376('0x138')],{});db[_0x4376('0x5f')][_0x4376('0x115')](db['CmList'],{'as':_0x4376('0x166'),'foreignKey':'ListId'});db[_0x4376('0x5f')][_0x4376('0x115')](db[_0x4376('0x6c')],{'as':_0x4376('0x16d'),'foreignKey':_0x4376('0x15b')});db[_0x4376('0x5f')][_0x4376('0x115')](db[_0x4376('0x122')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x4376('0x5a')],{});db[_0x4376('0x5f')][_0x4376('0x115')](db['User'],{});db[_0x4376('0x5f')]['belongsTo'](db[_0x4376('0x5c')],{});db['ChatApplication'][_0x4376('0x115')](db[_0x4376('0x12')],{'as':_0x4376('0x18f'),'foreignKey':_0x4376('0x105'),'onDelete':'restrict'});db[_0x4376('0x61')][_0x4376('0x115')](db['ChatQueue'],{'as':_0x4376('0x190'),'foreignKey':_0x4376('0x191'),'onDelete':_0x4376('0x15e')});db['ChatApplication'][_0x4376('0x115')](db['ChatWebsite'],{'as':_0x4376('0x192'),'foreignKey':_0x4376('0x177'),'onDelete':_0x4376('0x15e')});db[_0x4376('0x61')][_0x4376('0x115')](db[_0x4376('0x88')],{'onDelete':_0x4376('0x15e'),'foreignKey':'TagId'});db['ChatInteraction'][_0x4376('0x108')](db[_0x4376('0x18e')],{'as':'Messages','onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x193')});db['ChatInteraction']['belongsTo'](db['ChatWebsite'],{'as':'Account','foreignKey':_0x4376('0x177')});db[_0x4376('0x10f')][_0x4376('0x115')](db[_0x4376('0x6c')],{'as':_0x4376('0x16d'),'foreignKey':_0x4376('0x15b')});db['ChatInteraction']['belongsTo'](db[_0x4376('0x12')],{'as':'Owner','foreignKey':_0x4376('0x105')});db[_0x4376('0x10f')][_0x4376('0x117')](db[_0x4376('0x88')],{'through':_0x4376('0x194'),'as':_0x4376('0x170')});db[_0x4376('0x10f')][_0x4376('0x117')](db[_0x4376('0x88')],{'through':_0x4376('0x194'),'as':'ThroughTags'});db['ChatInteraction']['belongsToMany'](db[_0x4376('0x12')],{'as':_0x4376('0x172'),'through':_0x4376('0x11e'),'foreignKey':_0x4376('0x193')});db['ChatMessage'][_0x4376('0x115')](db[_0x4376('0x12')],{'onDelete':_0x4376('0x107'),'as':_0x4376('0x12')});db['ChatMessage'][_0x4376('0x115')](db['CmContact'],{'onDelete':'cascade','as':_0x4376('0x16d'),'foreignKey':'ContactId'});db[_0x4376('0x18e')]['belongsTo'](db[_0x4376('0x10f')],{'onDelete':_0x4376('0x107'),'as':_0x4376('0x176'),'foreignKey':_0x4376('0x193')});db['ChatMessage'][_0x4376('0x115')](db[_0x4376('0x174')],{'as':_0x4376('0x174'),'foreignKey':_0x4376('0x180')});db[_0x4376('0x18e')][_0x4376('0x115')](db['ChatWebsite'],{'as':_0x4376('0x16c'),'foreignKey':_0x4376('0x177')});db[_0x4376('0x65')][_0x4376('0x108')](db[_0x4376('0x174')],{'as':_0x4376('0x175'),'foreignKey':_0x4376('0x195'),'onDelete':_0x4376('0x107'),'hooks':!![]});db['ChatOfflineMessage'][_0x4376('0x115')](db[_0x4376('0x6c')],{'onDelete':'cascade','as':_0x4376('0x16d'),'foreignKey':_0x4376('0x15b')});db[_0x4376('0x65')][_0x4376('0x115')](db[_0x4376('0x5d')],{'as':_0x4376('0x16c'),'foreignKey':_0x4376('0x177')});db[_0x4376('0x67')][_0x4376('0x117')](db[_0x4376('0x12')],{'as':'Agents','through':_0x4376('0x12a'),'hooks':!![]});db['ChatQueue'][_0x4376('0x117')](db[_0x4376('0xe1')],{'through':'team_has_chat_queues','as':_0x4376('0x150')});db[_0x4376('0x68')][_0x4376('0x108')](db['ChatInternalMessage'],{'as':_0x4376('0x155'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db['ChatGroup'][_0x4376('0x117')](db['User'],{'as':_0x4376('0x196'),'through':_0x4376('0x119')});db[_0x4376('0x197')][_0x4376('0x115')](db[_0x4376('0x5d')],{'as':'Website','foreignKey':'ChatWebsiteId'});db['CmCompany']['hasMany'](db[_0x4376('0x6c')],{'as':'Contacts','foreignKey':_0x4376('0x198')});db[_0x4376('0x6c')][_0x4376('0x108')](db[_0x4376('0x8b')],{'as':_0x4376('0x199'),'foreignKey':_0x4376('0x19a')});db[_0x4376('0x6c')][_0x4376('0x108')](db[_0x4376('0x6e')],{'as':_0x4376('0x144'),'foreignKey':_0x4376('0x15b')});db[_0x4376('0x6c')][_0x4376('0x108')](db[_0x4376('0x10c')],{'as':'HopperFinals','foreignKey':_0x4376('0x15b')});db[_0x4376('0x6c')][_0x4376('0x108')](db[_0x4376('0x72')],{'as':_0x4376('0x146'),'foreignKey':_0x4376('0x15b')});db[_0x4376('0x6c')][_0x4376('0x108')](db[_0x4376('0x10d')],{'as':_0x4376('0x10d'),'foreignKey':'ContactId'});db['CmContact'][_0x4376('0x108')](db[_0x4376('0xd2')],{'as':'JscriptySessions','foreignKey':_0x4376('0x15b')});db[_0x4376('0x6c')]['hasMany'](db[_0x4376('0x122')],{'as':_0x4376('0x10e'),'foreignKey':'ContactId','onDelete':_0x4376('0x15e')});db[_0x4376('0x6c')][_0x4376('0x108')](db[_0x4376('0x10f')],{'as':_0x4376('0x110'),'foreignKey':_0x4376('0x15b'),'onDelete':_0x4376('0x15e')});db[_0x4376('0x6c')][_0x4376('0x108')](db[_0x4376('0x111')],{'as':_0x4376('0x120'),'foreignKey':'ContactId','onDelete':_0x4376('0x15e')});db[_0x4376('0x6c')][_0x4376('0x108')](db['FaxInteraction'],{'as':_0x4376('0x112'),'foreignKey':_0x4376('0x15b'),'onDelete':_0x4376('0x15e')});db[_0x4376('0x6c')][_0x4376('0x108')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x4376('0x15b'),'onDelete':_0x4376('0x15e')});db[_0x4376('0x6c')][_0x4376('0x115')](db[_0x4376('0x6b')],{'as':'Company','foreignKey':_0x4376('0x198')});db['CmContact'][_0x4376('0x115')](db[_0x4376('0xee')],{'as':_0x4376('0x166'),'foreignKey':_0x4376('0x167'),'onDelete':_0x4376('0x107')});db['CmContact'][_0x4376('0x117')](db['User'],{'as':_0x4376('0x172'),'through':'cm_user_has_contacts'});db[_0x4376('0x6c')][_0x4376('0x117')](db[_0x4376('0x88')],{'as':_0x4376('0x170'),'through':'cm_contact_has_tags'});db[_0x4376('0x6c')][_0x4376('0x117')](db['Tag'],{'through':_0x4376('0x19b'),'as':_0x4376('0x171')});db[_0x4376('0x6e')][_0x4376('0x108')](db[_0x4376('0x19c')],{'as':_0x4376('0x19d'),'foreignKey':_0x4376('0x19e')});db[_0x4376('0x6e')]['belongsTo'](db[_0x4376('0x6c')],{'as':_0x4376('0x16d'),'foreignKey':_0x4376('0x15b'),'onDelete':'cascade'});db[_0x4376('0x6e')][_0x4376('0x115')](db[_0x4376('0xee')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db[_0x4376('0x6e')][_0x4376('0x115')](db[_0x4376('0x12')],{'as':_0x4376('0x18f'),'foreignKey':_0x4376('0x105')});db['CmHopper'][_0x4376('0x115')](db[_0x4376('0x1c')],{'as':_0x4376('0x190'),'foreignKey':_0x4376('0x143'),'onDelete':_0x4376('0x107')});db[_0x4376('0x6e')][_0x4376('0x115')](db['Campaign'],{'as':_0x4376('0x19f'),'foreignKey':_0x4376('0x1a0'),'onDelete':_0x4376('0x107')});db[_0x4376('0x6e')][_0x4376('0x115')](db['User'],{'as':_0x4376('0x16e'),'foreignKey':'OwnerId'});db[_0x4376('0x147')][_0x4376('0x115')](db['CmContact'],{'as':'Contact','foreignKey':_0x4376('0x15b'),'onDelete':'cascade'});db['CmHopperBlack'][_0x4376('0x115')](db[_0x4376('0xee')],{'as':_0x4376('0x166'),'foreignKey':_0x4376('0x167'),'onDelete':_0x4376('0x107')});db[_0x4376('0x147')][_0x4376('0x115')](db['VoiceQueue'],{'as':_0x4376('0x190'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x4376('0x147')][_0x4376('0x115')](db['Campaign'],{'as':_0x4376('0x19f'),'foreignKey':_0x4376('0x1a0'),'onDelete':'cascade'});db[_0x4376('0x77')]['hasMany'](db[_0x4376('0x7b')],{'as':{'plural':_0x4376('0x1a1'),'singular':_0x4376('0x1a2')},'foreignKey':_0x4376('0x1a3'),'onDelete':_0x4376('0x107'),'hooks':!![]});db[_0x4376('0x77')][_0x4376('0x108')](db[_0x4376('0x7b')],{'as':{'plural':_0x4376('0x1a4'),'singular':_0x4376('0x1a5')},'foreignKey':_0x4376('0x1a6'),'onDelete':'cascade','hooks':!![]});db[_0x4376('0x77')][_0x4376('0x108')](db[_0x4376('0x1a7')],{'as':_0x4376('0x1a8'),'foreignKey':_0x4376('0x1a9'),'onDelete':_0x4376('0x107'),'hooks':!![]});db[_0x4376('0x79')][_0x4376('0x108')](db[_0x4376('0x79')],{'as':_0x4376('0x162'),'foreignKey':_0x4376('0x1aa'),'onDelete':_0x4376('0x107')});db['Interval'][_0x4376('0x108')](db[_0x4376('0x7d')],{'as':_0x4376('0x1ab'),'foreignKey':_0x4376('0x14c'),'onDelete':_0x4376('0x107'),'hooks':!![],'required':![]});db[_0x4376('0x7d')][_0x4376('0x108')](db[_0x4376('0x18')],{'as':'Extensions','foreignKey':_0x4376('0x14c'),'onDelete':_0x4376('0x15e')});db[_0x4376('0x7d')][_0x4376('0x108')](db[_0x4376('0x45')],{'as':_0x4376('0x1ac'),'foreignKey':'IntervalId'});db[_0x4376('0x7d')][_0x4376('0x108')](db[_0x4376('0x61')],{'as':_0x4376('0x1ad'),'foreignKey':_0x4376('0x14c')});db[_0x4376('0x7d')][_0x4376('0x108')](db[_0x4376('0x17d')],{'as':'FaxApplications','foreignKey':_0x4376('0x14c')});db[_0x4376('0x7d')][_0x4376('0x108')](db[_0x4376('0x53')],{'as':_0x4376('0x1ae'),'foreignKey':_0x4376('0x14c')});db[_0x4376('0x1af')][_0x4376('0x115')](db[_0x4376('0x135')],{});db[_0x4376('0x1af')]['belongsTo'](db['AnalyticDefaultReport'],{'foreignKey':_0x4376('0x1b0')});db['Schedule'][_0x4376('0x115')](db[_0x4376('0x93')],{'foreignKey':_0x4376('0x1b1')});db[_0x4376('0x86')]['belongsToMany'](db[_0x4376('0x1a')],{'as':_0x4376('0x1b2'),'through':'moh_has_sounds','onDelete':_0x4376('0x15e')});db[_0x4376('0x88')][_0x4376('0x117')](db['CmContact'],{'through':_0x4376('0x19b')});db['Tag'][_0x4376('0x117')](db['ChatInteraction'],{'through':_0x4376('0x194')});db['Tag'][_0x4376('0x117')](db[_0x4376('0x43')],{'through':_0x4376('0x16f')});db[_0x4376('0x88')]['belongsToMany'](db[_0x4376('0x111')],{'through':'sms_interaction_has_tags'});db[_0x4376('0x88')]['belongsToMany'](db[_0x4376('0x4d')],{'through':_0x4376('0x17f')});db[_0x4376('0x88')]['belongsToMany'](db[_0x4376('0x122')],{'through':_0x4376('0x18b')});db[_0x4376('0x88')][_0x4376('0x117')](db[_0x4376('0xf6')],{'through':_0x4376('0x1b3')});db[_0x4376('0x8b')]['belongsTo'](db[_0x4376('0x89')],{'as':_0x4376('0x1b4'),'foreignKey':_0x4376('0x1b5')});db[_0x4376('0x19c')]['belongsTo'](db['CmHopper'],{'as':_0x4376('0x1b6'),'foreignKey':_0x4376('0x19e')});db[_0x4376('0x8b')][_0x4376('0x115')](db[_0x4376('0x6c')],{'as':'Contact','foreignKey':_0x4376('0x19a')});db[_0x4376('0x8d')][_0x4376('0x108')](db[_0x4376('0x7b')],{'as':{'plural':_0x4376('0x1b7'),'singular':_0x4376('0x1b8')},'foreignKey':_0x4376('0x1b9'),'onDelete':_0x4376('0x107'),'hooks':!![]});db[_0x4376('0x8d')][_0x4376('0x108')](db[_0x4376('0x7b')],{'as':{'plural':_0x4376('0x1ba'),'singular':_0x4376('0x1bb')},'foreignKey':_0x4376('0x1bc'),'onDelete':'cascade','hooks':!![]});db[_0x4376('0x8d')][_0x4376('0x108')](db['Action'],{'as':_0x4376('0x1a8'),'foreignKey':_0x4376('0x1bd'),'onDelete':_0x4376('0x107'),'hooks':!![]});db[_0x4376('0x93')][_0x4376('0x108')](db[_0x4376('0x1be')],{'as':_0x4376('0x1bf'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1b1'),'hooks':!![]});db[_0x4376('0x94')][_0x4376('0x108')](db[_0x4376('0x1be')],{'as':'Fields','onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1b0')});db['AnalyticMetric']['hasMany'](db[_0x4376('0x1be')],{'as':_0x4376('0x1bf'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0x4376('0x1be')][_0x4376('0x115')](db[_0x4376('0x97')],{'foreignKey':_0x4376('0x1c0')});db['SalesforceAccount'][_0x4376('0x108')](db[_0x4376('0x9c')],{'as':_0x4376('0x1c1'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c2')});db[_0x4376('0x9c')][_0x4376('0x108')](db[_0x4376('0x9e')],{'as':_0x4376('0x1c3'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x4376('0x9c')]['hasMany'](db[_0x4376('0x9e')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x4376('0x9c')]['hasMany'](db['SalesforceField'],{'as':_0x4376('0x1bf'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c4')});db[_0x4376('0x9c')]['belongsTo'](db[_0x4376('0x9a')],{'as':_0x4376('0x16c'),'foreignKey':_0x4376('0x1c2')});db[_0x4376('0x9e')][_0x4376('0x108')](db[_0x4376('0x9e')],{'as':_0x4376('0x1c5'),'foreignKey':_0x4376('0x1c6')});db[_0x4376('0x9e')][_0x4376('0x108')](db[_0x4376('0x9e')],{'as':_0x4376('0x1c7'),'foreignKey':_0x4376('0x1c8')});db[_0x4376('0x9e')][_0x4376('0x108')](db[_0x4376('0x9e')],{'as':_0x4376('0x1c9'),'foreignKey':_0x4376('0x1c4')});db[_0x4376('0x9e')][_0x4376('0x115')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x4376('0x1ca')][_0x4376('0x108')](db[_0x4376('0xa0')],{'as':_0x4376('0x1c1'),'onDelete':'cascade','foreignKey':_0x4376('0x1c2')});db[_0x4376('0xa0')][_0x4376('0x108')](db[_0x4376('0xa1')],{'as':_0x4376('0x1c3'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c6')});db[_0x4376('0xa0')]['hasMany'](db[_0x4376('0xa1')],{'as':_0x4376('0x1cb'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0x4376('0x108')](db[_0x4376('0xa1')],{'as':_0x4376('0x1bf'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c4')});db[_0x4376('0xa0')][_0x4376('0x115')](db['SugarcrmAccount'],{'as':_0x4376('0x16c'),'foreignKey':_0x4376('0x1c2')});db['SugarcrmField'][_0x4376('0x108')](db[_0x4376('0xa1')],{'as':'Subject','foreignKey':_0x4376('0x1c6')});db[_0x4376('0xa1')][_0x4376('0x108')](db[_0x4376('0xa1')],{'as':_0x4376('0x1c7'),'foreignKey':_0x4376('0x1c8')});db['SugarcrmField'][_0x4376('0x108')](db['SugarcrmField'],{'as':_0x4376('0x1c9'),'foreignKey':'FieldId'});db['SugarcrmField'][_0x4376('0x115')](db[_0x4376('0x8f')],{'as':'Variable','foreignKey':_0x4376('0x1cc')});db['DeskAccount'][_0x4376('0x108')](db[_0x4376('0x1cd')],{'as':_0x4376('0x1c1'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c2')});db[_0x4376('0x1cd')][_0x4376('0x108')](db[_0x4376('0xa6')],{'as':_0x4376('0x1c3'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c6')});db[_0x4376('0x1cd')][_0x4376('0x108')](db['DeskField'],{'as':_0x4376('0x1cb'),'onDelete':_0x4376('0x107'),'foreignKey':'DescriptionId'});db[_0x4376('0x1cd')][_0x4376('0x108')](db['DeskField'],{'as':_0x4376('0x1bf'),'onDelete':_0x4376('0x107'),'foreignKey':'FieldId'});db[_0x4376('0x1cd')][_0x4376('0x115')](db[_0x4376('0xa3')],{'as':_0x4376('0x16c'),'foreignKey':_0x4376('0x1c2')});db[_0x4376('0x1cd')]['belongsToMany'](db[_0x4376('0x88')],{'through':_0x4376('0x1ce')});db[_0x4376('0xa6')][_0x4376('0x108')](db[_0x4376('0xa6')],{'as':_0x4376('0x1c5'),'foreignKey':'SubjectId'});db[_0x4376('0xa6')]['hasMany'](db[_0x4376('0xa6')],{'as':_0x4376('0x1c7'),'foreignKey':_0x4376('0x1c8')});db[_0x4376('0xa6')][_0x4376('0x108')](db['DeskField'],{'as':_0x4376('0x1c9'),'foreignKey':_0x4376('0x1c4')});db[_0x4376('0xa6')][_0x4376('0x115')](db[_0x4376('0x8f')],{'as':_0x4376('0x8f'),'foreignKey':_0x4376('0x1cc')});db['ZohoAccount'][_0x4376('0x108')](db[_0x4376('0xaa')],{'as':_0x4376('0x1c1'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c2')});db[_0x4376('0xaa')][_0x4376('0x108')](db[_0x4376('0xac')],{'as':_0x4376('0x1c3'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c6')});db[_0x4376('0xaa')][_0x4376('0x108')](db['ZohoField'],{'as':_0x4376('0x1cb'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c8')});db[_0x4376('0xaa')]['hasMany'](db[_0x4376('0xac')],{'as':_0x4376('0x1bf'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c4')});db[_0x4376('0xaa')][_0x4376('0x115')](db[_0x4376('0xa8')],{'as':'Account','foreignKey':_0x4376('0x1c2')});db[_0x4376('0xac')]['hasMany'](db['ZohoField'],{'as':'Subject','foreignKey':_0x4376('0x1c6')});db[_0x4376('0xac')][_0x4376('0x108')](db[_0x4376('0xac')],{'as':'Description','foreignKey':_0x4376('0x1c8')});db[_0x4376('0xac')][_0x4376('0x108')](db[_0x4376('0xac')],{'as':_0x4376('0x1c9'),'foreignKey':_0x4376('0x1c4')});db[_0x4376('0xac')][_0x4376('0x115')](db[_0x4376('0x8f')],{'as':_0x4376('0x8f'),'foreignKey':_0x4376('0x1cc')});db[_0x4376('0xae')][_0x4376('0x108')](db[_0x4376('0xb0')],{'as':_0x4376('0x1c1'),'onDelete':_0x4376('0x107'),'foreignKey':'AccountId'});db['ZendeskConfiguration']['hasMany'](db[_0x4376('0xb1')],{'as':_0x4376('0x1c3'),'foreignKey':_0x4376('0x1c6')});db[_0x4376('0xb0')][_0x4376('0x108')](db[_0x4376('0xb1')],{'as':_0x4376('0x1cb'),'foreignKey':'DescriptionId'});db[_0x4376('0xb0')][_0x4376('0x108')](db[_0x4376('0xb1')],{'as':'Fields','foreignKey':_0x4376('0x1c4')});db['ZendeskConfiguration'][_0x4376('0x115')](db[_0x4376('0xae')],{'as':'Account','foreignKey':_0x4376('0x1c2')});db[_0x4376('0xb0')]['belongsToMany'](db[_0x4376('0x88')],{'through':_0x4376('0x1cf')});db[_0x4376('0xb1')][_0x4376('0x108')](db[_0x4376('0xb1')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x4376('0xb1')][_0x4376('0x108')](db[_0x4376('0xb1')],{'as':'Description','foreignKey':_0x4376('0x1c8')});db['ZendeskField'][_0x4376('0x108')](db[_0x4376('0xb1')],{'as':_0x4376('0x1c9'),'foreignKey':_0x4376('0x1c4')});db[_0x4376('0xb1')][_0x4376('0x115')](db[_0x4376('0x8f')],{'as':_0x4376('0x8f'),'foreignKey':_0x4376('0x1cc')});db['FreshdeskAccount']['hasMany'](db['FreshdeskConfiguration'],{'as':_0x4376('0x1c1'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c2')});db[_0x4376('0xb5')][_0x4376('0x108')](db[_0x4376('0x1d0')],{'as':_0x4376('0x1c3'),'onDelete':_0x4376('0x107'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0x4376('0x108')](db[_0x4376('0x1d0')],{'as':_0x4376('0x1cb'),'onDelete':'cascade','foreignKey':_0x4376('0x1c8')});db[_0x4376('0xb5')][_0x4376('0x108')](db[_0x4376('0x1d0')],{'as':_0x4376('0x1bf'),'onDelete':'cascade','foreignKey':_0x4376('0x1c4')});db['FreshdeskConfiguration']['belongsTo'](db['FreshdeskAccount'],{'as':_0x4376('0x16c'),'foreignKey':'AccountId'});db['FreshdeskConfiguration']['belongsToMany'](db[_0x4376('0x88')],{'through':_0x4376('0x1d1')});db[_0x4376('0x1d0')][_0x4376('0x108')](db[_0x4376('0x1d0')],{'as':'Subject','foreignKey':'SubjectId'});db['FreshdeskField'][_0x4376('0x108')](db[_0x4376('0x1d0')],{'as':_0x4376('0x1c7'),'foreignKey':'DescriptionId'});db[_0x4376('0x1d0')][_0x4376('0x108')](db[_0x4376('0x1d0')],{'as':_0x4376('0x1c9'),'foreignKey':'FieldId'});db[_0x4376('0x1d0')][_0x4376('0x115')](db[_0x4376('0x8f')],{'as':'Variable','foreignKey':_0x4376('0x1cc')});db['VtigerAccount'][_0x4376('0x108')](db[_0x4376('0x1d2')],{'as':_0x4376('0x1c1'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c2')});db[_0x4376('0x1d2')][_0x4376('0x108')](db[_0x4376('0xb9')],{'as':_0x4376('0x1c3'),'foreignKey':_0x4376('0x1c6')});db[_0x4376('0x1d2')][_0x4376('0x108')](db[_0x4376('0xb9')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x4376('0x1d2')]['hasMany'](db[_0x4376('0xb9')],{'as':_0x4376('0x1bf'),'foreignKey':_0x4376('0x1c4')});db['VtigerConfiguration'][_0x4376('0x115')](db[_0x4376('0x1d3')],{'as':_0x4376('0x16c'),'foreignKey':'AccountId'});db[_0x4376('0xb9')]['hasMany'](db['VtigerField'],{'as':_0x4376('0x1c5'),'foreignKey':_0x4376('0x1c6')});db[_0x4376('0xb9')][_0x4376('0x108')](db[_0x4376('0xb9')],{'as':'Description','foreignKey':_0x4376('0x1c8')});db[_0x4376('0xb9')]['hasMany'](db[_0x4376('0xb9')],{'as':_0x4376('0x1c9'),'foreignKey':_0x4376('0x1c4')});db[_0x4376('0xb9')][_0x4376('0x115')](db['Variable'],{'as':'Variable','foreignKey':_0x4376('0x1cc')});db[_0x4376('0xbb')][_0x4376('0x108')](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c2')});db[_0x4376('0xbd')][_0x4376('0x108')](db['ServicenowField'],{'as':_0x4376('0x1c3'),'foreignKey':_0x4376('0x1c6')});db['ServicenowConfiguration'][_0x4376('0x108')](db['ServicenowField'],{'as':_0x4376('0x1cb'),'foreignKey':_0x4376('0x1c8')});db[_0x4376('0xbd')][_0x4376('0x108')](db[_0x4376('0xbf')],{'as':'Fields','foreignKey':_0x4376('0x1c4')});db[_0x4376('0xbd')]['belongsTo'](db[_0x4376('0xbb')],{'as':_0x4376('0x16c'),'foreignKey':'AccountId'});db[_0x4376('0xbf')][_0x4376('0x108')](db[_0x4376('0xbf')],{'as':_0x4376('0x1c5'),'foreignKey':_0x4376('0x1c6')});db[_0x4376('0xbf')][_0x4376('0x108')](db[_0x4376('0xbf')],{'as':_0x4376('0x1c7'),'foreignKey':'DescriptionId'});db[_0x4376('0xbf')]['hasMany'](db['ServicenowField'],{'as':_0x4376('0x1c9'),'foreignKey':'FieldId'});db[_0x4376('0xbf')]['belongsTo'](db[_0x4376('0x8f')],{'as':_0x4376('0x8f'),'foreignKey':_0x4376('0x1cc')});db[_0x4376('0x1d4')]['hasMany'](db[_0x4376('0x1d5')],{'as':_0x4376('0x1c1'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c2')});db[_0x4376('0x1d4')]['belongsTo'](db['CloudProvider'],{'as':'CloudProvider','foreignKey':'CloudProviderId'});db[_0x4376('0x1d5')][_0x4376('0x108')](db['Dynamics365Field'],{'as':_0x4376('0x1c3'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c6')});db['Dynamics365Configuration']['hasMany'](db[_0x4376('0xc2')],{'as':_0x4376('0x1cb'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c8')});db['Dynamics365Configuration'][_0x4376('0x108')](db[_0x4376('0xc2')],{'as':_0x4376('0x1bf'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c4')});db[_0x4376('0x1d5')]['belongsTo'](db['Dynamics365Account'],{'as':_0x4376('0x16c'),'foreignKey':'AccountId'});db[_0x4376('0xc2')][_0x4376('0x108')](db[_0x4376('0xc2')],{'as':_0x4376('0x1c5'),'foreignKey':_0x4376('0x1c6')});db['Dynamics365Field']['hasMany'](db[_0x4376('0xc2')],{'as':_0x4376('0x1c7'),'foreignKey':'DescriptionId'});db['Dynamics365Field'][_0x4376('0x108')](db[_0x4376('0xc2')],{'as':_0x4376('0x1c9'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0x4376('0x115')](db['Variable'],{'as':'Variable','foreignKey':_0x4376('0x1cc')});db[_0x4376('0x1d6')]['hasMany'](db[_0x4376('0xc5')],{'as':_0x4376('0x1c1'),'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1c2')});db[_0x4376('0xc5')][_0x4376('0x108')](db[_0x4376('0xc7')],{'as':_0x4376('0x1c3'),'foreignKey':_0x4376('0x1c6')});db[_0x4376('0xc5')][_0x4376('0x108')](db[_0x4376('0xc7')],{'as':_0x4376('0x1cb'),'foreignKey':_0x4376('0x1c8')});db[_0x4376('0xc5')]['hasMany'](db[_0x4376('0xc7')],{'as':_0x4376('0x1bf'),'foreignKey':_0x4376('0x1c4')});db[_0x4376('0xc5')][_0x4376('0x115')](db['FreshsalesAccount'],{'as':_0x4376('0x16c'),'foreignKey':_0x4376('0x1c2')});db['FreshsalesField'][_0x4376('0x108')](db[_0x4376('0xc7')],{'as':_0x4376('0x1c5'),'foreignKey':_0x4376('0x1c6')});db['FreshsalesField'][_0x4376('0x108')](db[_0x4376('0xc7')],{'as':_0x4376('0x1c7'),'foreignKey':_0x4376('0x1c8')});db[_0x4376('0xc7')][_0x4376('0x108')](db[_0x4376('0xc7')],{'as':_0x4376('0x1c9'),'foreignKey':_0x4376('0x1c4')});db[_0x4376('0xc7')][_0x4376('0x115')](db[_0x4376('0x8f')],{'as':_0x4376('0x8f'),'foreignKey':_0x4376('0x1cc')});db[_0x4376('0xcd')][_0x4376('0x115')](db[_0x4376('0x5d')],{});db['ChatQueueReport'][_0x4376('0x115')](db[_0x4376('0xee')],{'as':_0x4376('0x166'),'foreignKey':'ListId'});db[_0x4376('0xcd')][_0x4376('0x115')](db[_0x4376('0x6c')],{'as':_0x4376('0x16d'),'foreignKey':_0x4376('0x15b')});db[_0x4376('0xcd')]['belongsTo'](db['ChatInteraction'],{});db[_0x4376('0xcd')][_0x4376('0x115')](db[_0x4376('0x18e')],{});db[_0x4376('0xcd')][_0x4376('0x115')](db[_0x4376('0x12')],{});db[_0x4376('0xcd')][_0x4376('0x115')](db[_0x4376('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x4376('0x12')],{'onDelete':'cascade','foreignKey':_0x4376('0x1d7')});db[_0x4376('0x1d8')][_0x4376('0x115')](db[_0x4376('0x12')],{'onDelete':_0x4376('0x107'),'foreignKey':_0x4376('0x1d9')});db[_0x4376('0xd2')][_0x4376('0x108')](db[_0x4376('0x1da')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x4376('0xd2')]['hasMany'](db[_0x4376('0xd0')],{'foreignKey':_0x4376('0x1db'),'onDelete':_0x4376('0x107')});db['SmsQueueReport'][_0x4376('0x115')](db[_0x4376('0x52')],{});db[_0x4376('0xd4')]['belongsTo'](db[_0x4376('0xee')],{'as':'List','foreignKey':_0x4376('0x167')});db['SmsQueueReport'][_0x4376('0x115')](db[_0x4376('0x6c')],{'as':_0x4376('0x16d'),'foreignKey':'ContactId'});db[_0x4376('0xd4')]['belongsTo'](db[_0x4376('0x111')],{});db[_0x4376('0xd4')][_0x4376('0x115')](db[_0x4376('0x55')],{});db[_0x4376('0xd4')][_0x4376('0x115')](db[_0x4376('0x12')],{});db[_0x4376('0xd4')]['belongsTo'](db['SmsQueue'],{});db[_0x4376('0xd8')]['hasMany'](db[_0x4376('0xd2')],{'foreignKey':_0x4376('0x1dc')});db[_0x4376('0xd8')][_0x4376('0x108')](db[_0x4376('0x1da')],{'foreignKey':_0x4376('0x1dc')});db[_0x4376('0xd8')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x4376('0x1dc')});db[_0x4376('0xdc')][_0x4376('0x117')](db[_0x4376('0x12')],{'as':_0x4376('0x172'),'through':'user_has_square_projects'});db[_0x4376('0xe1')][_0x4376('0x117')](db[_0x4376('0x12')],{'as':_0x4376('0x14f'),'through':_0x4376('0x11d')});db[_0x4376('0xe1')][_0x4376('0x117')](db[_0x4376('0x1c')],{'through':_0x4376('0x151'),'as':_0x4376('0x126')});db[_0x4376('0xe1')]['belongsToMany'](db[_0x4376('0x40')],{'through':_0x4376('0x16b'),'as':'MailQueues'});db[_0x4376('0xe1')][_0x4376('0x117')](db[_0x4376('0x67')],{'through':'team_has_chat_queues','as':'ChatQueues'});db['Team'][_0x4376('0x117')](db[_0x4376('0x51')],{'through':_0x4376('0x181'),'as':'FaxQueues'});db[_0x4376('0xe1')]['belongsToMany'](db[_0x4376('0x12b')],{'through':_0x4376('0x187'),'as':_0x4376('0x12c')});db[_0x4376('0xe1')][_0x4376('0x117')](db[_0x4376('0x5c')],{'through':_0x4376('0x18d'),'as':_0x4376('0x12d')});db[_0x4376('0xe1')][_0x4376('0x117')](db[_0x4376('0xfd')],{'through':_0x4376('0x1dd'),'as':'WhatsappQueues'});db[_0x4376('0xe1')]['belongsToMany'](db[_0x4376('0x127')],{'through':_0x4376('0x1de'),'as':_0x4376('0x128')});db['Campaign'][_0x4376('0x108')](db[_0x4376('0x6e')],{'as':'Hoppers','foreignKey':_0x4376('0x1a0')});db[_0x4376('0x19f')][_0x4376('0x108')](db[_0x4376('0x10c')],{'as':'HopperFinals','foreignKey':_0x4376('0x1a0')});db[_0x4376('0x19f')][_0x4376('0x108')](db[_0x4376('0x72')],{'as':'HopperHistories','foreignKey':_0x4376('0x1a0')});db[_0x4376('0x19f')]['hasMany'](db[_0x4376('0x147')],{'as':'HopperBlacks','foreignKey':_0x4376('0x1a0')});db[_0x4376('0x19f')][_0x4376('0x115')](db[_0x4376('0x2c')],{'as':_0x4376('0x2c'),'foreignKey':_0x4376('0x14a')});db[_0x4376('0x19f')]['belongsTo'](db[_0x4376('0x2c')],{'as':'TrunkBackup','foreignKey':_0x4376('0x14b')});db[_0x4376('0x19f')][_0x4376('0x115')](db[_0x4376('0x7d')],{'as':_0x4376('0x7d'),'foreignKey':_0x4376('0x14c')});db[_0x4376('0x19f')][_0x4376('0x115')](db[_0x4376('0xdc')],{'as':_0x4376('0xdc'),'foreignKey':_0x4376('0x1df')});db[_0x4376('0x19f')][_0x4376('0x117')](db['CmList'],{'as':_0x4376('0x11c'),'through':_0x4376('0x1e0')});db['Campaign'][_0x4376('0x117')](db[_0x4376('0xee')],{'as':_0x4376('0x152'),'through':_0x4376('0x1e1')});db[_0x4376('0x174')]['belongsTo'](db[_0x4376('0x65')],{'as':_0x4376('0x65'),'foreignKey':_0x4376('0x195')});db[_0x4376('0xe7')][_0x4376('0x115')](db[_0x4376('0x165')],{});db[_0x4376('0xe7')][_0x4376('0x115')](db[_0x4376('0x43')],{});db[_0x4376('0xe7')][_0x4376('0x115')](db[_0x4376('0x135')],{'foreignKey':'FromMailAccountId','as':_0x4376('0x1e2')});db[_0x4376('0xe7')]['belongsTo'](db[_0x4376('0x12')],{'foreignKey':_0x4376('0x1e3'),'as':_0x4376('0x1e4')});db['MailTransferReport'][_0x4376('0x115')](db[_0x4376('0x12')],{'foreignKey':_0x4376('0x1e5'),'as':'ToAgent'});db[_0x4376('0xe7')]['belongsTo'](db[_0x4376('0x40')],{'foreignKey':_0x4376('0x1e6'),'as':_0x4376('0x1e7')});db[_0x4376('0xe7')][_0x4376('0x115')](db[_0x4376('0x135')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db['ChatTransferReport'][_0x4376('0x115')](db['ChatMessage'],{});db[_0x4376('0x1e8')][_0x4376('0x115')](db['ChatInteraction'],{});db['ChatTransferReport'][_0x4376('0x115')](db[_0x4376('0x5d')],{'foreignKey':_0x4376('0x1e9'),'as':_0x4376('0x1e2')});db[_0x4376('0x1e8')][_0x4376('0x115')](db['User'],{'foreignKey':_0x4376('0x1e3'),'as':_0x4376('0x1e4')});db[_0x4376('0x1e8')][_0x4376('0x115')](db[_0x4376('0x12')],{'foreignKey':'ToUserId','as':_0x4376('0x1ea')});db[_0x4376('0x1e8')][_0x4376('0x115')](db[_0x4376('0x67')],{'foreignKey':_0x4376('0x1eb'),'as':'ToQueue'});db[_0x4376('0x1e8')]['belongsTo'](db[_0x4376('0x5d')],{'foreignKey':_0x4376('0x1ec'),'as':_0x4376('0x1ed')});db[_0x4376('0xe9')][_0x4376('0x115')](db[_0x4376('0x4f')],{});db['FaxTransferReport'][_0x4376('0x115')](db['FaxInteraction'],{});db[_0x4376('0xe9')][_0x4376('0x115')](db['FaxAccount'],{'foreignKey':_0x4376('0x1ee'),'as':_0x4376('0x1e2')});db[_0x4376('0xe9')]['belongsTo'](db['User'],{'foreignKey':_0x4376('0x1e3'),'as':_0x4376('0x1e4')});db[_0x4376('0xe9')][_0x4376('0x115')](db[_0x4376('0x12')],{'foreignKey':_0x4376('0x1e5'),'as':_0x4376('0x1ea')});db[_0x4376('0xe9')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x4376('0x1ef'),'as':_0x4376('0x1e7')});db['FaxTransferReport'][_0x4376('0x115')](db[_0x4376('0x132')],{'foreignKey':_0x4376('0x1f0'),'as':_0x4376('0x1ed')});db[_0x4376('0xea')][_0x4376('0x115')](db['OpenchannelMessage'],{});db['OpenchannelTransferReport'][_0x4376('0x115')](db['OpenchannelInteraction'],{});db[_0x4376('0xea')][_0x4376('0x115')](db[_0x4376('0x138')],{'foreignKey':_0x4376('0x1f1'),'as':_0x4376('0x1e2')});db[_0x4376('0xea')][_0x4376('0x115')](db[_0x4376('0x12')],{'foreignKey':'FromUserId','as':_0x4376('0x1e4')});db[_0x4376('0xea')][_0x4376('0x115')](db[_0x4376('0x12')],{'foreignKey':_0x4376('0x1e5'),'as':_0x4376('0x1ea')});db[_0x4376('0xea')][_0x4376('0x115')](db['OpenchannelQueue'],{'foreignKey':_0x4376('0x1f2'),'as':_0x4376('0x1e7')});db[_0x4376('0xea')][_0x4376('0x115')](db[_0x4376('0x138')],{'foreignKey':'ToOpenchannelAccountId','as':_0x4376('0x1ed')});db[_0x4376('0xec')][_0x4376('0x115')](db[_0x4376('0x55')],{});db[_0x4376('0xec')][_0x4376('0x115')](db['SmsInteraction'],{});db[_0x4376('0xec')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x4376('0x1f3'),'as':_0x4376('0x1e2')});db[_0x4376('0xec')]['belongsTo'](db[_0x4376('0x12')],{'foreignKey':_0x4376('0x1e3'),'as':'FromAgent'});db[_0x4376('0xec')][_0x4376('0x115')](db[_0x4376('0x12')],{'foreignKey':_0x4376('0x1e5'),'as':'ToAgent'});db[_0x4376('0xec')][_0x4376('0x115')](db['SmsQueue'],{'foreignKey':_0x4376('0x1f4'),'as':_0x4376('0x1e7')});db[_0x4376('0xec')][_0x4376('0x115')](db[_0x4376('0x52')],{'foreignKey':_0x4376('0x1f5'),'as':'ToAccount'});db['CmList']['hasMany'](db[_0x4376('0x79')],{'as':_0x4376('0x162'),'foreignKey':_0x4376('0x167'),'onDelete':'cascade'});db[_0x4376('0xee')]['hasMany'](db[_0x4376('0x74')],{'as':_0x4376('0x1f6'),'foreignKey':_0x4376('0x167')});db[_0x4376('0xee')]['hasMany'](db[_0x4376('0x6c')],{'as':_0x4376('0x11a'),'onDelete':'cascade','foreignKey':_0x4376('0x167')});db[_0x4376('0xee')][_0x4376('0x108')](db[_0x4376('0x10c')],{'as':'HopperFinals','foreignKey':_0x4376('0x167')});db['CmList'][_0x4376('0x108')](db[_0x4376('0x72')],{'as':_0x4376('0x1f7'),'foreignKey':_0x4376('0x167')});db[_0x4376('0xee')][_0x4376('0x108')](db['ReportAgentPreview'],{'as':_0x4376('0x10d'),'foreignKey':_0x4376('0x167')});db[_0x4376('0xee')][_0x4376('0x117')](db['VoiceQueue'],{'as':_0x4376('0x1f8'),'through':_0x4376('0x14e')});db[_0x4376('0xee')][_0x4376('0x117')](db[_0x4376('0x12')],{'as':_0x4376('0x14f'),'through':_0x4376('0x12f')});db[_0x4376('0x127')]['hasMany'](db[_0x4376('0x18')],{'as':_0x4376('0x10b'),'onDelete':_0x4376('0x107')});db['VoicePrefix'][_0x4376('0x117')](db[_0x4376('0x12')],{'as':_0x4376('0x14f'),'through':_0x4376('0x129')});db[_0x4376('0x127')][_0x4376('0x117')](db[_0x4376('0xe1')],{'through':_0x4376('0x1de'),'as':_0x4376('0x150')});db[_0x4376('0xf1')]['hasMany'](db['User'],{'as':'Users','foreignKey':'userProfileId'});db[_0x4376('0xf1')][_0x4376('0x108')](db['UserProfileSection'],{'as':_0x4376('0x1f9'),'foreignKey':_0x4376('0x116'),'onDelete':'cascade'});db['UserProfileSection']['hasMany'](db[_0x4376('0xf2')],{'as':_0x4376('0x1fa'),'foreignKey':_0x4376('0x1fb'),'onDelete':_0x4376('0x107')});db[_0x4376('0xf3')][_0x4376('0x108')](db[_0x4376('0x79')],{'as':_0x4376('0x162'),'foreignKey':_0x4376('0x1fc'),'onDelete':_0x4376('0x107')});db[_0x4376('0xf3')]['hasMany'](db[_0x4376('0x163')],{'as':'Answers','foreignKey':'WhatsappAccountId'});db[_0x4376('0xf3')][_0x4376('0x108')](db['WhatsappMessage'],{'as':_0x4376('0x155'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0x4376('0x108')](db[_0x4376('0xf6')],{'as':'Interactions'});db['WhatsappAccount']['hasMany'](db[_0x4376('0xf4')],{'as':_0x4376('0x140')});db[_0x4376('0xf3')][_0x4376('0x115')](db[_0x4376('0xee')],{'as':_0x4376('0x166'),'foreignKey':_0x4376('0x167')});db['WhatsappAccount'][_0x4376('0x115')](db[_0x4376('0x7f')],{'as':_0x4376('0x14d'),'foreignKey':_0x4376('0x169')});db[_0x4376('0xf3')][_0x4376('0x117')](db['User'],{'as':_0x4376('0x14f'),'through':_0x4376('0x13c')});db[_0x4376('0xf4')][_0x4376('0x115')](db['User'],{'onDelete':'restrict'});db[_0x4376('0xf4')][_0x4376('0x115')](db[_0x4376('0xfd')],{'onDelete':_0x4376('0x15e')});db['WhatsappApplication'][_0x4376('0x115')](db[_0x4376('0xf3')],{'onDelete':_0x4376('0x15e')});db['WhatsappApplication']['belongsTo'](db[_0x4376('0x7d')],{'onDelete':_0x4376('0x15e'),'foreignKey':'IntervalId'});db['WhatsappApplication'][_0x4376('0x115')](db[_0x4376('0x88')],{'onDelete':_0x4376('0x15e'),'foreignKey':'TagId'});db[_0x4376('0xf6')][_0x4376('0x108')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0x4376('0x107'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0x4376('0x115')](db[_0x4376('0xf3')],{'as':'Account','foreignKey':_0x4376('0x1fc')});db['WhatsappInteraction'][_0x4376('0x115')](db[_0x4376('0x6c')],{'as':'Contact','foreignKey':'ContactId'});db[_0x4376('0xf6')][_0x4376('0x115')](db['User'],{'as':_0x4376('0x16e'),'foreignKey':'UserId'});db['WhatsappInteraction'][_0x4376('0x117')](db['Tag'],{'through':_0x4376('0x1b3'),'as':_0x4376('0x170')});db['WhatsappInteraction']['belongsToMany'](db[_0x4376('0x88')],{'through':'whatsapp_interaction_has_tags','as':_0x4376('0x171')});db[_0x4376('0xf6')][_0x4376('0x117')](db[_0x4376('0x12')],{'as':_0x4376('0x172'),'through':'user_has_whatsapp_interactions','foreignKey':_0x4376('0x1fd')});db[_0x4376('0x1fe')][_0x4376('0x115')](db[_0x4376('0x12')],{'as':_0x4376('0x12')});db['WhatsappMessage'][_0x4376('0x115')](db['CmContact'],{'onDelete':_0x4376('0x107'),'as':_0x4376('0x16d')});db[_0x4376('0x1fe')][_0x4376('0x115')](db[_0x4376('0xf6')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x4376('0x1fd')});db[_0x4376('0x1fe')]['belongsTo'](db[_0x4376('0xf3')],{'as':'Account','foreignKey':_0x4376('0x1fc')});db['WhatsappQueueReport'][_0x4376('0x115')](db[_0x4376('0xf3')],{});db[_0x4376('0xf9')][_0x4376('0x115')](db[_0x4376('0xee')],{'as':_0x4376('0x166'),'foreignKey':_0x4376('0x167')});db[_0x4376('0xf9')][_0x4376('0x115')](db[_0x4376('0x6c')],{'as':_0x4376('0x16d'),'foreignKey':_0x4376('0x15b')});db[_0x4376('0xf9')][_0x4376('0x115')](db[_0x4376('0xf6')],{});db['WhatsappQueueReport'][_0x4376('0x115')](db['WhatsappQueue'],{});db[_0x4376('0xf9')][_0x4376('0x115')](db[_0x4376('0x1fe')],{});db[_0x4376('0xf9')][_0x4376('0x115')](db[_0x4376('0x12')],{});db['WhatsappTransferReport'][_0x4376('0x115')](db['WhatsappMessage'],{});db['WhatsappTransferReport'][_0x4376('0x115')](db['WhatsappInteraction'],{});db['WhatsappTransferReport'][_0x4376('0x115')](db[_0x4376('0xf3')],{'foreignKey':_0x4376('0x1ff'),'as':_0x4376('0x1e2')});db['WhatsappTransferReport'][_0x4376('0x115')](db[_0x4376('0xf3')],{'foreignKey':_0x4376('0x200'),'as':'ToAccount'});db[_0x4376('0xfb')][_0x4376('0x115')](db[_0x4376('0xfd')],{'foreignKey':_0x4376('0x201'),'as':_0x4376('0x1e7')});db[_0x4376('0xfb')][_0x4376('0x115')](db['User'],{'foreignKey':_0x4376('0x1e3'),'as':_0x4376('0x1e4')});db[_0x4376('0xfb')][_0x4376('0x115')](db['User'],{'foreignKey':_0x4376('0x1e5'),'as':_0x4376('0x1ea')});db[_0x4376('0xfd')][_0x4376('0x117')](db['User'],{'as':_0x4376('0x14f'),'through':_0x4376('0x3a'),'foreignKey':'WhatsappQueueId'});db[_0x4376('0xfd')][_0x4376('0x117')](db[_0x4376('0xe1')],{'through':_0x4376('0x1dd'),'as':_0x4376('0x150')});db['UserSetting']['belongsTo'](db[_0x4376('0x12')],{'as':_0x4376('0x202'),'foreignKey':'UserId','onDelete':_0x4376('0x107'),'hooks':!![]});db[_0x4376('0xfe')][_0x4376('0x104')](db[_0x4376('0x1d4')],{'as':_0x4376('0x1d4'),'onDelete':_0x4376('0x15e')});db['CloudProvider'][_0x4376('0x104')](db['MailServerIn'],{'as':_0x4376('0x160'),'onDelete':_0x4376('0x15e')});db[_0x4376('0xfe')]['hasOne'](db[_0x4376('0x15f')],{'as':'Smtp','onDelete':_0x4376('0x15e')});module[_0x4376('0x203')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0xef3c=['../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Migration','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','UserId','cascade','hasMany','VoiceRecording','Recordings','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','cm_user_has_contacts','Lists','cm_user_has_lists','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteractions','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','restrict','hasOne','Imap','Smtp','Dispositions','CannedAnswer','Answers','List','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','Attachment','Attachments','Interaction','ChatWebsite','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','MailQueueReport','ListId','FaxAccountId','Interactions','Exntensions','TagId','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsMessage','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','UserChatQueue','team_has_chat_queues','ChatGroupId','Members','Contacts','CompanyId','CmContactHasItem','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','OwnerId','CmHopperBlack','CampaignId','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','ChatApplications','FaxApplications','SmsApplications','CustomReportId','moh_has_sounds','ItemType','ItemTypeId','Hopper','CmContactId','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','Trigger','TriggerId','Fields','DefaultReportId','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','SugarcrmField','DeskConfiguration','int_desk_configuration_has_tags','ZohoConfiguration','ZohoField','ZendeskAccount','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','Dynamics365Account','Dynamics365Configuration','ChatQueueReport','ToId','SessionId','JscriptyProject','ProjectId','user_has_teams','team_has_whatsapp_queues','TrunkBackup','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromAgent','ToMailQueueId','FromChatWebsiteId','FromAccount','FromUserId','ToUserId','ToAgent','ToQueue','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','ToAccount','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','sectionId','WhatsappAccountId','WhatsappMessage','user_has_whatsapp_accounts','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','jstz','determine','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','xcall','name','password','username','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.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','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut'];(function(_0x1a73aa,_0x14decd){var _0x14b82b=function(_0x47c1d7){while(--_0x47c1d7){_0x1a73aa['push'](_0x1a73aa['shift']());}};_0x14b82b(++_0x14decd);}(_0xef3c,0x1c9));var _0xcef3=function(_0x5e5c35,_0x42f5e3){_0x5e5c35=_0x5e5c35-0x0;var _0x6b7604=_0xef3c[_0x5e5c35];return _0x6b7604;};'use strict';var config=require(_0xcef3('0x0'));var Sequelize=require(_0xcef3('0x1'));var _=require(_0xcef3('0x2'));var jstz=require(_0xcef3('0x3'));var timezone=jstz[_0xcef3('0x4')]();config[_0xcef3('0x1')]=_['defaultsDeep'](config[_0xcef3('0x1')],{'database':_0xcef3('0x5'),'username':'xcall','password':_0xcef3('0x6'),'options':{'host':_0xcef3('0x7'),'port':0xcea,'dialect':_0xcef3('0x8'),'dialectOptions':{'charset':_0xcef3('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xcef3('0xa'),'collate':_0xcef3('0xb')}}});config[_0xcef3('0xc')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':'motion2','username':_0xcef3('0xd'),'password':_0xcef3('0x6'),'options':{'host':_0xcef3('0x7'),'port':0xcea,'dialect':_0xcef3('0x8'),'dialectOptions':{'charset':_0xcef3('0x9')},'logging':![],'timezone':timezone[_0xcef3('0xe')](),'define':{'charset':_0xcef3('0xa'),'collate':_0xcef3('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xcef3('0x1')]['database'],config['sequelize']['username'],config[_0xcef3('0x1')][_0xcef3('0xf')],config[_0xcef3('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xcef3('0xc')]['database'],config[_0xcef3('0xc')][_0xcef3('0x10')],config[_0xcef3('0xc')]['password'],config[_0xcef3('0xc')]['options'])};db[_0xcef3('0x11')]=db[_0xcef3('0x1')]['import'](_0xcef3('0x12'));db[_0xcef3('0x13')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x15'));db[_0xcef3('0x16')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x17'));db[_0xcef3('0x18')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db[_0xcef3('0x1')]['import'](_0xcef3('0x19'));db[_0xcef3('0x1a')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x1b'));db['VoiceRecording']=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db['sequelize'][_0xcef3('0x14')]('../api/screenRecording/screenRecording.model');db[_0xcef3('0x1c')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x1d'));db[_0xcef3('0x1e')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x1f'));db[_0xcef3('0x20')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x21'));db['VoiceDialReport']=db['sequelize'][_0xcef3('0x14')]('../api/voiceDialReport/voiceDialReport.model');db[_0xcef3('0x22')]=db[_0xcef3('0x1')]['import'](_0xcef3('0x23'));db[_0xcef3('0x24')]=db['sequelize'][_0xcef3('0x14')](_0xcef3('0x25'));db[_0xcef3('0x26')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x27'));db['Trunk']=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x28'));db[_0xcef3('0x29')]=db[_0xcef3('0x1')]['import'](_0xcef3('0x2a'));db[_0xcef3('0x2b')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x2c'));db[_0xcef3('0x2d')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x2e'));db['UserChatQueue']=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/userChatQueue/userChatQueue.model');db[_0xcef3('0x2f')]=db[_0xcef3('0x1')]['import'](_0xcef3('0x30'));db[_0xcef3('0x31')]=db['sequelize'][_0xcef3('0x14')]('../api/userFaxQueue/userFaxQueue.model');db[_0xcef3('0x32')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x33'));db[_0xcef3('0x34')]=db['sequelize']['import'](_0xcef3('0x35'));db[_0xcef3('0x36')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x37'));db[_0xcef3('0x38')]=db['sequelize']['import'](_0xcef3('0x39'));db[_0xcef3('0x3a')]=db['sequelize']['import'](_0xcef3('0x3b'));db[_0xcef3('0x3c')]=db[_0xcef3('0x1')]['import']('../api/mailAccount/mailAccount.model');db[_0xcef3('0x3d')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/mailQueue/mailQueue.model');db[_0xcef3('0x3e')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x3f'));db[_0xcef3('0x40')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x41'));db[_0xcef3('0x42')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x43'));db[_0xcef3('0x44')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db['sequelize'][_0xcef3('0x14')](_0xcef3('0x45'));db[_0xcef3('0x46')]=db[_0xcef3('0x1')]['import'](_0xcef3('0x47'));db[_0xcef3('0x48')]=db[_0xcef3('0x1')]['import'](_0xcef3('0x49'));db[_0xcef3('0x4a')]=db['sequelize']['import'](_0xcef3('0x4b'));db[_0xcef3('0x4c')]=db[_0xcef3('0x1')]['import'](_0xcef3('0x4d'));db[_0xcef3('0x4e')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x4f'));db[_0xcef3('0x50')]=db['sequelize'][_0xcef3('0x14')]('../api/faxMessage/faxMessage.model');db[_0xcef3('0x51')]=db[_0xcef3('0x1')]['import'](_0xcef3('0x52'));db[_0xcef3('0x53')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db['sequelize']['import'](_0xcef3('0x54'));db[_0xcef3('0x55')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x56'));db['SmsMessage']=db[_0xcef3('0x1')]['import'](_0xcef3('0x57'));db[_0xcef3('0x58')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/smsQueue/smsQueue.model');db[_0xcef3('0x59')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x5a'));db[_0xcef3('0x5b')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x5c'));db[_0xcef3('0x5d')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x5e'));db[_0xcef3('0x5f')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x60'));db[_0xcef3('0x61')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/chatWebsite/chatWebsite.model');db[_0xcef3('0x62')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xcef3('0x63')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x64'));db[_0xcef3('0x65')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x66'));db[_0xcef3('0x67')]=db[_0xcef3('0x1')]['import']('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db['sequelize'][_0xcef3('0x14')](_0xcef3('0x68'));db[_0xcef3('0x69')]=db[_0xcef3('0x1')]['import'](_0xcef3('0x6a'));db[_0xcef3('0x6b')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x6c'));db[_0xcef3('0x6d')]=db['sequelize'][_0xcef3('0x14')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0xcef3('0x6e')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x6f'));db[_0xcef3('0x70')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x71'));db[_0xcef3('0x72')]=db[_0xcef3('0x1')]['import'](_0xcef3('0x73'));db['CmHopperBlack']=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x74'));db[_0xcef3('0x75')]=db['sequelize']['import']('../api/cmHopperFinal/cmHopperFinal.model');db[_0xcef3('0x76')]=db['sequelize'][_0xcef3('0x14')](_0xcef3('0x77'));db[_0xcef3('0x78')]=db[_0xcef3('0x1')]['import'](_0xcef3('0x79'));db['CmCustomField']=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x7a'));db[_0xcef3('0x7b')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x7c'));db[_0xcef3('0x7d')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x7e'));db['CannedAnswer']=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x7f'));db[_0xcef3('0x80')]=db['sequelize']['import'](_0xcef3('0x81'));db[_0xcef3('0x82')]=db[_0xcef3('0x1')]['import'](_0xcef3('0x83'));db[_0xcef3('0x84')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/interval/interval.model');db[_0xcef3('0x85')]=db[_0xcef3('0x1')]['import'](_0xcef3('0x86'));db[_0xcef3('0x87')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x88'));db[_0xcef3('0x89')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x8a'));db[_0xcef3('0x8b')]=db['sequelize']['import'](_0xcef3('0x8c'));db[_0xcef3('0x8d')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x8e'));db[_0xcef3('0x8f')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x90'));db[_0xcef3('0x91')]=db[_0xcef3('0x1')]['import'](_0xcef3('0x92'));db['CmContactHasItem']=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/cmContactHasItem/cmContactHasItem.model');db[_0xcef3('0x93')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x94'));db[_0xcef3('0x95')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/template/template.model');db['Trigger']=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x96'));db[_0xcef3('0x97')]=db['sequelize']['import'](_0xcef3('0x98'));db[_0xcef3('0x99')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x9a'));db[_0xcef3('0x9b')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/integrationReport/integrationReport.model');db[_0xcef3('0x9c')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x9d'));db[_0xcef3('0x9e')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xcef3('0x9f')]=db[_0xcef3('0x1')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xcef3('0xa0')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xa1'));db[_0xcef3('0xa2')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xa3'));db[_0xcef3('0xa4')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xa5'));db[_0xcef3('0xa6')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xcef3('0xa7')]=db['sequelize'][_0xcef3('0x14')](_0xcef3('0xa8'));db[_0xcef3('0xa9')]=db['sequelize'][_0xcef3('0x14')](_0xcef3('0xaa'));db[_0xcef3('0xab')]=db[_0xcef3('0x1')]['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xcef3('0xac')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xad'));db['SugarcrmField']=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xae'));db[_0xcef3('0xaf')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xb0'));db['DeskConfiguration']=db[_0xcef3('0x1')]['import'](_0xcef3('0xb1'));db[_0xcef3('0xb2')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xb3'));db[_0xcef3('0xb4')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xb5'));db['ZohoConfiguration']=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xb6'));db['ZohoField']=db['sequelize'][_0xcef3('0x14')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db['sequelize'][_0xcef3('0x14')](_0xcef3('0xb7'));db[_0xcef3('0xb8')]=db[_0xcef3('0x1')]['import'](_0xcef3('0xb9'));db['ZendeskField']=db[_0xcef3('0x1')]['import'](_0xcef3('0xba'));db[_0xcef3('0xbb')]=db['sequelize'][_0xcef3('0x14')](_0xcef3('0xbc'));db['FreshdeskConfiguration']=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xbd'));db[_0xcef3('0xbe')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xbf'));db[_0xcef3('0xc0')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xc1'));db[_0xcef3('0xc2')]=db[_0xcef3('0x1')]['import'](_0xcef3('0xc3'));db[_0xcef3('0xc4')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xc5'));db[_0xcef3('0xc6')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xc7'));db[_0xcef3('0xc8')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xc9'));db[_0xcef3('0xca')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xcb'));db['Dynamics365Account']=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db['sequelize'][_0xcef3('0x14')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xcef3('0xcc')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xcd'));db[_0xcef3('0xce')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xcef3('0xcf')]=db[_0xcef3('0x1')]['import'](_0xcef3('0xd0'));db[_0xcef3('0xd1')]=db[_0xcef3('0x1')]['import'](_0xcef3('0xd2'));db[_0xcef3('0x99')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x9a'));db[_0xcef3('0xd3')]=db[_0xcef3('0x1')]['import'](_0xcef3('0xd4'));db['ChatQueueReport']=db[_0xcef3('0x1')]['import']('../api/chatQueueReport/chatQueueReport.model');db[_0xcef3('0xd5')]=db[_0xcef3('0x1')]['import'](_0xcef3('0xd6'));db[_0xcef3('0xd7')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xcef3('0xd8')]=db['sequelize']['import'](_0xcef3('0xd9'));db[_0xcef3('0xda')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xdb'));db[_0xcef3('0xdc')]=db[_0xcef3('0x1')]['import'](_0xcef3('0xdd'));db[_0xcef3('0xde')]=db['sequelize']['import'](_0xcef3('0xdf'));db[_0xcef3('0xe0')]=db['sequelize']['import']('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db['sequelize'][_0xcef3('0x14')]('../api/jscriptyProject/jscriptyProject.model');db[_0xcef3('0xe1')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xe2'));db[_0xcef3('0xe3')]=db['sequelize'][_0xcef3('0x14')](_0xcef3('0xe4'));db[_0xcef3('0xe5')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xe6'));db['SquareRecording']=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/squareRecording/squareRecording.model');db[_0xcef3('0xe7')]=db['sequelize'][_0xcef3('0x14')](_0xcef3('0xe8'));db[_0xcef3('0xe9')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xea'));db[_0xcef3('0xeb')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/license/license.model');db[_0xcef3('0xec')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xed'));db[_0xcef3('0xee')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/migration/migration.model');db['Attachment']=db['sequelize']['import'](_0xcef3('0xef'));db[_0xcef3('0xf0')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xf1'));db[_0xcef3('0xf2')]=db['sequelize']['import'](_0xcef3('0xf3'));db[_0xcef3('0xf4')]=db['sequelize']['import'](_0xcef3('0xf5'));db[_0xcef3('0xf6')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/faxTransferReport/faxTransferReport.model');db[_0xcef3('0xf7')]=db[_0xcef3('0x1')]['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xcef3('0xf8')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xf9'));db[_0xcef3('0xfa')]=db['sequelize']['import'](_0xcef3('0xfb'));db['VoicePrefix']=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xfc'));db[_0xcef3('0xfd')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0xfe'));db[_0xcef3('0xff')]=db['sequelize'][_0xcef3('0x14')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/userProfileResource/userProfileResource.model');db[_0xcef3('0x100')]=db[_0xcef3('0x1')]['import']('../api/userNotification/userNotification.model');db[_0xcef3('0x101')]=db['sequelize'][_0xcef3('0x14')](_0xcef3('0x102'));db[_0xcef3('0x103')]=db['sequelize']['import']('../api/whatsappApplication/whatsappApplication.model');db[_0xcef3('0x104')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x105'));db['WhatsappMessage']=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/whatsappMessage/whatsappMessage.model');db[_0xcef3('0x106')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x107'));db[_0xcef3('0x108')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x109'));db[_0xcef3('0x10a')]=db[_0xcef3('0x1')][_0xcef3('0x14')]('../api/whatsappQueue/whatsappQueue.model');db[_0xcef3('0x10b')]=db['sequelize'][_0xcef3('0x14')](_0xcef3('0x10c'));db[_0xcef3('0x10d')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x10e'));db[_0xcef3('0x10f')]=db['sequelize'][_0xcef3('0x14')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0xcef3('0x110')]=db['sequelize']['import'](_0xcef3('0x111'));db[_0xcef3('0x112')]=db[_0xcef3('0x1')][_0xcef3('0x14')](_0xcef3('0x113'));db[_0xcef3('0x11')]['hasOne'](db['VoiceMail'],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0xcef3('0x114')});db[_0xcef3('0x11')]['hasOne'](db[_0xcef3('0x112')],{'as':'userSetting','onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x114')});db[_0xcef3('0x11')][_0xcef3('0x116')](db[_0xcef3('0x117')],{'as':_0xcef3('0x118'),'foreignKey':'UserId'});db[_0xcef3('0x11')][_0xcef3('0x116')](db[_0xcef3('0x2b')],{'as':'VoiceQueuesRt','foreignKey':_0xcef3('0x114')});db['User']['hasMany'](db[_0xcef3('0x18')],{'as':_0xcef3('0x119'),'onDelete':'cascade','hooks':!![]});db[_0xcef3('0x11')][_0xcef3('0x116')](db[_0xcef3('0x75')],{'as':_0xcef3('0x11a'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0xcef3('0x76')],{'as':_0xcef3('0x11b'),'foreignKey':_0xcef3('0x114')});db[_0xcef3('0x11')][_0xcef3('0x116')](db[_0xcef3('0x78')],{'as':_0xcef3('0x78'),'foreignKey':'UserId'});db[_0xcef3('0x11')][_0xcef3('0x116')](db[_0xcef3('0x5d')],{'as':_0xcef3('0x11c'),'foreignKey':'UserId'});db[_0xcef3('0x11')][_0xcef3('0x116')](db[_0xcef3('0x65')],{'as':_0xcef3('0x11d'),'foreignKey':_0xcef3('0x114')});db['User'][_0xcef3('0x116')](db[_0xcef3('0x55')],{'as':_0xcef3('0x11e'),'foreignKey':_0xcef3('0x114')});db[_0xcef3('0x11')]['hasMany'](db[_0xcef3('0x4e')],{'as':_0xcef3('0x11f'),'foreignKey':_0xcef3('0x114')});db[_0xcef3('0x11')]['hasMany'](db[_0xcef3('0x40')],{'as':'MailInteractions','foreignKey':_0xcef3('0x114')});db[_0xcef3('0x11')]['hasMany'](db[_0xcef3('0x104')],{'as':'WhatsappInteractions','foreignKey':_0xcef3('0x114')});db['User']['hasMany'](db[_0xcef3('0x100')],{'as':_0xcef3('0x120'),'foreignKey':_0xcef3('0x121')});db['User'][_0xcef3('0x122')](db[_0xcef3('0xfd')],{'as':_0xcef3('0xfd'),'foreignKey':_0xcef3('0x123')});db[_0xcef3('0x11')][_0xcef3('0x124')](db[_0xcef3('0x6b')],{'as':_0xcef3('0x125'),'through':_0xcef3('0x126')});db[_0xcef3('0x11')][_0xcef3('0x124')](db[_0xcef3('0x70')],{'as':'Contacts','through':_0xcef3('0x127')});db[_0xcef3('0x11')][_0xcef3('0x124')](db[_0xcef3('0xfa')],{'as':_0xcef3('0x128'),'through':_0xcef3('0x129')});db[_0xcef3('0x11')][_0xcef3('0x124')](db[_0xcef3('0xe9')],{'through':'user_has_teams'});db['User'][_0xcef3('0x124')](db[_0xcef3('0x40')],{'as':_0xcef3('0x12a'),'through':_0xcef3('0x12b')});db[_0xcef3('0x11')][_0xcef3('0x124')](db[_0xcef3('0x65')],{'as':_0xcef3('0x11d'),'through':_0xcef3('0x12c')});db[_0xcef3('0x11')][_0xcef3('0x124')](db[_0xcef3('0x4e')],{'as':_0xcef3('0x11f'),'through':_0xcef3('0x12d')});db[_0xcef3('0x11')][_0xcef3('0x124')](db['SmsInteraction'],{'as':_0xcef3('0x11e'),'through':_0xcef3('0x12e')});db[_0xcef3('0x11')][_0xcef3('0x124')](db[_0xcef3('0x5d')],{'as':_0xcef3('0x11c'),'through':_0xcef3('0x12f')});db[_0xcef3('0x11')][_0xcef3('0x124')](db[_0xcef3('0x104')],{'as':_0xcef3('0x130'),'through':'user_has_whatsapp_interactions'});db[_0xcef3('0x11')][_0xcef3('0x124')](db['VoiceQueue'],{'as':_0xcef3('0x131'),'through':'UserVoiceQueue','required':![]});db[_0xcef3('0x11')][_0xcef3('0x124')](db[_0xcef3('0x132')],{'as':_0xcef3('0x133'),'through':_0xcef3('0x110'),'required':![]});db[_0xcef3('0x11')][_0xcef3('0x124')](db[_0xcef3('0x3d')],{'as':_0xcef3('0x134'),'through':_0xcef3('0x2f'),'required':![]});db['User'][_0xcef3('0x124')](db['ChatQueue'],{'as':_0xcef3('0x135'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0xcef3('0x11')]['belongsToMany'](db[_0xcef3('0x51')],{'as':_0xcef3('0x136'),'through':_0xcef3('0x31'),'required':![]});db[_0xcef3('0x11')][_0xcef3('0x124')](db[_0xcef3('0x58')],{'as':_0xcef3('0x137'),'through':'UserSmsQueue','required':![]});db[_0xcef3('0x11')][_0xcef3('0x124')](db[_0xcef3('0x61')],{'as':_0xcef3('0x138'),'through':_0xcef3('0x34'),'required':![]});db[_0xcef3('0x11')][_0xcef3('0x124')](db[_0xcef3('0x10a')],{'as':_0xcef3('0x139'),'through':_0xcef3('0x36'),'required':![]});db[_0xcef3('0x11')][_0xcef3('0x124')](db[_0xcef3('0xfa')],{'through':'cm_user_has_lists'});db['User']['belongsToMany'](db['ChatWebsite'],{'as':_0xcef3('0x13a'),'through':_0xcef3('0x13b')});db['User'][_0xcef3('0x124')](db[_0xcef3('0x4a')],{'as':_0xcef3('0x13c'),'through':_0xcef3('0x13d')});db[_0xcef3('0x11')][_0xcef3('0x124')](db[_0xcef3('0x3c')],{'as':_0xcef3('0x13e'),'through':_0xcef3('0x13f')});db[_0xcef3('0x11')][_0xcef3('0x124')](db['OpenchannelAccount'],{'as':_0xcef3('0x140'),'through':_0xcef3('0x141')});db[_0xcef3('0x11')][_0xcef3('0x124')](db[_0xcef3('0x142')],{'as':_0xcef3('0x143'),'through':_0xcef3('0x144')});db[_0xcef3('0x11')][_0xcef3('0x124')](db[_0xcef3('0x101')],{'as':_0xcef3('0x145'),'through':'user_has_whatsapp_accounts'});db[_0xcef3('0x11')]['belongsToMany'](db['SquareProject'],{'as':_0xcef3('0x146'),'through':_0xcef3('0x147')});db[_0xcef3('0x13')][_0xcef3('0x116')](db[_0xcef3('0x18')],{'as':_0xcef3('0x148'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x149')});db[_0xcef3('0x16')][_0xcef3('0x116')](db[_0xcef3('0x18')],{'onDelete':_0xcef3('0x115')});db['VoiceExtension'][_0xcef3('0x116')](db[_0xcef3('0x18')],{'as':_0xcef3('0x14a'),'onDelete':_0xcef3('0x115')});db[_0xcef3('0x14b')][_0xcef3('0x124')](db[_0xcef3('0x8d')],{'as':_0xcef3('0x14c'),'through':'moh_has_sounds'});db[_0xcef3('0x1a')]['hasMany'](db[_0xcef3('0x2b')],{'as':'Members','foreignKey':_0xcef3('0x14d')});db[_0xcef3('0x1a')][_0xcef3('0x116')](db[_0xcef3('0x72')],{'as':_0xcef3('0x14e'),'foreignKey':'VoiceQueueId'});db[_0xcef3('0x1a')][_0xcef3('0x116')](db[_0xcef3('0x75')],{'as':_0xcef3('0x11a'),'foreignKey':_0xcef3('0x14d')});db[_0xcef3('0x1a')][_0xcef3('0x116')](db[_0xcef3('0x76')],{'as':_0xcef3('0x14f'),'foreignKey':_0xcef3('0x14d')});db['VoiceQueue'][_0xcef3('0x116')](db[_0xcef3('0x78')],{'as':_0xcef3('0x78'),'foreignKey':_0xcef3('0x14d')});db[_0xcef3('0x1a')][_0xcef3('0x116')](db['CmHopperBlack'],{'as':_0xcef3('0x150'),'foreignKey':'VoiceQueueId'});db[_0xcef3('0x1a')][_0xcef3('0x116')](db[_0xcef3('0xda')],{'as':_0xcef3('0x151'),'foreignKey':_0xcef3('0x14d')});db[_0xcef3('0x1a')][_0xcef3('0x122')](db['Trunk'],{'as':_0xcef3('0x152'),'foreignKey':_0xcef3('0x153')});db['VoiceQueue'][_0xcef3('0x122')](db[_0xcef3('0x152')],{'as':'TrunkBackup','foreignKey':_0xcef3('0x154')});db[_0xcef3('0x1a')][_0xcef3('0x122')](db[_0xcef3('0x84')],{'as':'Interval','foreignKey':_0xcef3('0x155')});db['VoiceQueue'][_0xcef3('0x122')](db[_0xcef3('0x85')],{'as':_0xcef3('0x156'),'foreignKey':_0xcef3('0x157')});db['VoiceQueue']['belongsToMany'](db[_0xcef3('0xfa')],{'as':_0xcef3('0x128'),'through':_0xcef3('0x158')});db['VoiceQueue']['belongsToMany'](db[_0xcef3('0x11')],{'as':_0xcef3('0x159'),'through':'UserVoiceQueue'});db['VoiceQueue'][_0xcef3('0x124')](db[_0xcef3('0xe9')],{'as':_0xcef3('0x15a'),'through':_0xcef3('0x10d')});db['VoiceQueue']['belongsToMany'](db[_0xcef3('0xfa')],{'as':'BlackLists','through':_0xcef3('0x15b')});db[_0xcef3('0x117')][_0xcef3('0x122')](db['User'],{'as':_0xcef3('0x11'),'foreignKey':'UserId'});db[_0xcef3('0x15c')][_0xcef3('0x122')](db[_0xcef3('0x11')],{'as':_0xcef3('0x11'),'foreignKey':_0xcef3('0x114')});db[_0xcef3('0x1c')][_0xcef3('0x116')](db[_0xcef3('0x1e')],{'as':_0xcef3('0x15d'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x15e'),'sourceKey':_0xcef3('0x15f')});db['VoiceMailMessage']['belongsTo'](db[_0xcef3('0x1c')],{'foreignKey':_0xcef3('0x15e'),'targetKey':_0xcef3('0x15f')});db['VoiceCallReport'][_0xcef3('0x116')](db[_0xcef3('0x24')],{'as':_0xcef3('0x160'),'foreignKey':_0xcef3('0x161'),'constraints':![]});db[_0xcef3('0x20')][_0xcef3('0x116')](db['VoiceAgentReport'],{'as':_0xcef3('0x162'),'foreignKey':_0xcef3('0x161'),'constraints':![]});db[_0xcef3('0x20')][_0xcef3('0x122')](db[_0xcef3('0x11')],{'as':'User','foreignKey':_0xcef3('0x114')});db['VoiceCallReport'][_0xcef3('0x122')](db[_0xcef3('0x70')],{'as':_0xcef3('0x163'),'foreignKey':_0xcef3('0x164')});db[_0xcef3('0x38')]['belongsTo'](db['MailAccount'],{'as':_0xcef3('0x3c'),'foreignKey':_0xcef3('0x165')});db['MailServerIn']['belongsTo'](db[_0xcef3('0x10b')],{'as':_0xcef3('0x10b'),'foreignKey':_0xcef3('0x166'),'onDelete':_0xcef3('0x167')});db['MailServerOut'][_0xcef3('0x122')](db[_0xcef3('0x3c')],{'as':_0xcef3('0x3c'),'foreignKey':_0xcef3('0x165')});db['MailServerOut']['belongsTo'](db[_0xcef3('0x10b')],{'as':'CloudProvider','foreignKey':_0xcef3('0x166'),'onDelete':_0xcef3('0x167')});db[_0xcef3('0x3c')][_0xcef3('0x168')](db[_0xcef3('0x38')],{'as':_0xcef3('0x169'),'onDelete':_0xcef3('0x115')});db[_0xcef3('0x3c')][_0xcef3('0x168')](db[_0xcef3('0x3a')],{'as':_0xcef3('0x16a'),'onDelete':_0xcef3('0x115')});db[_0xcef3('0x3c')][_0xcef3('0x116')](db['Disposition'],{'as':_0xcef3('0x16b'),'foreignKey':'MailAccountId','onDelete':_0xcef3('0x115')});db['MailAccount'][_0xcef3('0x116')](db[_0xcef3('0x16c')],{'as':_0xcef3('0x16d'),'foreignKey':_0xcef3('0x165')});db[_0xcef3('0x3c')]['hasMany'](db[_0xcef3('0x42')],{'as':_0xcef3('0x15d'),'foreignKey':_0xcef3('0x165')});db[_0xcef3('0x3c')]['hasMany'](db[_0xcef3('0x40')],{'as':'Interactions'});db[_0xcef3('0x3c')][_0xcef3('0x116')](db[_0xcef3('0x44')],{'as':_0xcef3('0x14a')});db[_0xcef3('0x3c')][_0xcef3('0x122')](db['CmList'],{'as':_0xcef3('0x16e'),'foreignKey':'ListId'});db['MailAccount'][_0xcef3('0x122')](db[_0xcef3('0x95')],{'as':_0xcef3('0x95'),'foreignKey':_0xcef3('0x16f')});db['MailAccount']['belongsTo'](db[_0xcef3('0x85')],{'as':_0xcef3('0x156'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xcef3('0x3c')][_0xcef3('0x124')](db[_0xcef3('0x11')],{'as':'Agents','through':_0xcef3('0x13f')});db['MailQueue'][_0xcef3('0x124')](db[_0xcef3('0x11')],{'as':_0xcef3('0x159'),'through':_0xcef3('0x2f')});db[_0xcef3('0x3d')]['belongsToMany'](db[_0xcef3('0xe9')],{'through':_0xcef3('0x170'),'as':'Teams'});db[_0xcef3('0x40')][_0xcef3('0x116')](db[_0xcef3('0x42')],{'as':_0xcef3('0x15d'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x171')});db['MailInteraction'][_0xcef3('0x122')](db[_0xcef3('0x3c')],{'as':_0xcef3('0x172'),'foreignKey':_0xcef3('0x165')});db['MailInteraction'][_0xcef3('0x122')](db[_0xcef3('0x70')],{'as':_0xcef3('0x163'),'foreignKey':_0xcef3('0x164')});db[_0xcef3('0x40')][_0xcef3('0x122')](db[_0xcef3('0x11')],{'as':_0xcef3('0x173'),'foreignKey':'UserId'});db[_0xcef3('0x40')][_0xcef3('0x124')](db[_0xcef3('0x8f')],{'through':'mail_interaction_has_tags','as':_0xcef3('0x174')});db['MailInteraction']['belongsToMany'](db[_0xcef3('0x8f')],{'through':_0xcef3('0x175'),'as':_0xcef3('0x176')});db['MailInteraction']['belongsToMany'](db['User'],{'as':_0xcef3('0x177'),'through':_0xcef3('0x12b'),'foreignKey':_0xcef3('0x171')});db[_0xcef3('0x42')]['hasMany'](db[_0xcef3('0x178')],{'as':_0xcef3('0x179'),'onDelete':_0xcef3('0x115')});db[_0xcef3('0x42')][_0xcef3('0x122')](db[_0xcef3('0x11')],{'as':'User'});db['MailMessage'][_0xcef3('0x122')](db[_0xcef3('0x70')],{'onDelete':_0xcef3('0x115'),'as':_0xcef3('0x163')});db['MailMessage'][_0xcef3('0x122')](db['MailInteraction'],{'as':_0xcef3('0x17a'),'foreignKey':_0xcef3('0x171')});db['MailMessage']['belongsTo'](db[_0xcef3('0x3c')],{'as':'Account','foreignKey':_0xcef3('0x165')});db[_0xcef3('0x42')][_0xcef3('0x122')](db['ChatWebsite'],{'as':_0xcef3('0x17b'),'foreignKey':_0xcef3('0x17c')});db[_0xcef3('0x42')]['belongsTo'](db['ChatOfflineMessage'],{'as':_0xcef3('0x17d'),'foreignKey':_0xcef3('0x17e')});db[_0xcef3('0x44')]['belongsTo'](db[_0xcef3('0x11')],{'onDelete':_0xcef3('0x167')});db[_0xcef3('0x44')][_0xcef3('0x122')](db[_0xcef3('0x3d')],{'onDelete':_0xcef3('0x167')});db[_0xcef3('0x44')][_0xcef3('0x122')](db[_0xcef3('0x3c')],{'onDelete':_0xcef3('0x167')});db[_0xcef3('0x44')][_0xcef3('0x122')](db[_0xcef3('0x84')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xcef3('0x44')]['belongsTo'](db['Tag'],{'onDelete':_0xcef3('0x167'),'foreignKey':'TagId'});db[_0xcef3('0x17f')][_0xcef3('0x122')](db[_0xcef3('0x3c')],{});db['MailQueueReport']['belongsTo'](db[_0xcef3('0xfa')],{'as':_0xcef3('0x16e'),'foreignKey':_0xcef3('0x180')});db[_0xcef3('0x17f')][_0xcef3('0x122')](db[_0xcef3('0x70')],{'as':_0xcef3('0x163'),'foreignKey':_0xcef3('0x164')});db[_0xcef3('0x17f')][_0xcef3('0x122')](db['MailInteraction'],{});db[_0xcef3('0x17f')][_0xcef3('0x122')](db[_0xcef3('0x42')],{});db['MailQueueReport'][_0xcef3('0x122')](db[_0xcef3('0x11')],{});db['MailQueueReport'][_0xcef3('0x122')](db[_0xcef3('0x3d')],{});db[_0xcef3('0x46')]['hasMany'](db['DashboardItem'],{'as':'Items','onDelete':_0xcef3('0x115')});db[_0xcef3('0x4a')]['hasMany'](db[_0xcef3('0x80')],{'as':'Dispositions','foreignKey':_0xcef3('0x181'),'onDelete':'cascade'});db[_0xcef3('0x4a')]['hasMany'](db[_0xcef3('0x16c')],{'as':_0xcef3('0x16d'),'foreignKey':'FaxAccountId'});db[_0xcef3('0x4a')][_0xcef3('0x116')](db[_0xcef3('0x4e')],{'as':_0xcef3('0x182')});db[_0xcef3('0x4a')]['hasMany'](db[_0xcef3('0x4c')],{'as':_0xcef3('0x14a')});db[_0xcef3('0x4a')][_0xcef3('0x116')](db['VoiceExtension'],{'as':_0xcef3('0x183'),'onDelete':_0xcef3('0x115')});db[_0xcef3('0x4a')][_0xcef3('0x116')](db[_0xcef3('0x50')],{'as':_0xcef3('0x15d')});db[_0xcef3('0x4a')][_0xcef3('0x122')](db[_0xcef3('0x152')],{'as':_0xcef3('0x152')});db[_0xcef3('0x4a')][_0xcef3('0x122')](db[_0xcef3('0xfa')],{'as':_0xcef3('0x16e'),'foreignKey':'ListId'});db[_0xcef3('0x4a')][_0xcef3('0x122')](db['Pause'],{'as':_0xcef3('0x156'),'foreignKey':_0xcef3('0x157')});db[_0xcef3('0x4a')][_0xcef3('0x124')](db[_0xcef3('0x11')],{'as':_0xcef3('0x159'),'through':_0xcef3('0x13d')});db[_0xcef3('0x4c')]['belongsTo'](db[_0xcef3('0x11')],{'onDelete':'restrict'});db[_0xcef3('0x4c')][_0xcef3('0x122')](db[_0xcef3('0x51')],{'onDelete':_0xcef3('0x167')});db[_0xcef3('0x4c')]['belongsTo'](db[_0xcef3('0x4a')],{'onDelete':_0xcef3('0x167')});db[_0xcef3('0x4c')][_0xcef3('0x122')](db[_0xcef3('0x8f')],{'onDelete':_0xcef3('0x167'),'foreignKey':_0xcef3('0x184')});db[_0xcef3('0x4e')][_0xcef3('0x116')](db[_0xcef3('0x50')],{'as':_0xcef3('0x15d'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x185')});db[_0xcef3('0x4e')][_0xcef3('0x122')](db[_0xcef3('0x4a')],{'as':'Account','foreignKey':_0xcef3('0x181')});db['FaxInteraction']['belongsTo'](db[_0xcef3('0x70')],{'as':_0xcef3('0x163'),'foreignKey':_0xcef3('0x164')});db[_0xcef3('0x4e')][_0xcef3('0x122')](db[_0xcef3('0x11')],{'as':_0xcef3('0x173'),'foreignKey':_0xcef3('0x114')});db[_0xcef3('0x4e')]['belongsToMany'](db[_0xcef3('0x8f')],{'through':_0xcef3('0x186'),'as':_0xcef3('0x174')});db[_0xcef3('0x4e')]['belongsToMany'](db[_0xcef3('0x8f')],{'through':_0xcef3('0x186'),'as':_0xcef3('0x176')});db[_0xcef3('0x4e')][_0xcef3('0x124')](db['User'],{'as':_0xcef3('0x177'),'through':_0xcef3('0x12d'),'foreignKey':_0xcef3('0x185')});db[_0xcef3('0x50')]['belongsTo'](db[_0xcef3('0x11')],{'onDelete':_0xcef3('0x115'),'as':_0xcef3('0x11')});db[_0xcef3('0x50')]['belongsTo'](db[_0xcef3('0x4e')],{'as':_0xcef3('0x17a'),'foreignKey':'FaxInteractionId'});db[_0xcef3('0x50')][_0xcef3('0x122')](db[_0xcef3('0x70')],{'onDelete':_0xcef3('0x115'),'as':_0xcef3('0x163')});db[_0xcef3('0x50')]['belongsTo'](db['Attachment'],{'as':_0xcef3('0x178'),'foreignKey':_0xcef3('0x187')});db[_0xcef3('0x50')][_0xcef3('0x122')](db['FaxAccount'],{'as':_0xcef3('0x172'),'foreignKey':_0xcef3('0x181')});db[_0xcef3('0x51')]['belongsToMany'](db[_0xcef3('0x11')],{'as':_0xcef3('0x159'),'through':_0xcef3('0x31')});db['FaxQueue']['belongsToMany'](db[_0xcef3('0xe9')],{'through':_0xcef3('0x188'),'as':_0xcef3('0x15a')});db[_0xcef3('0x53')][_0xcef3('0x122')](db[_0xcef3('0x4a')],{});db[_0xcef3('0x53')][_0xcef3('0x122')](db[_0xcef3('0xfa')],{'as':'List','foreignKey':_0xcef3('0x180')});db[_0xcef3('0x53')][_0xcef3('0x122')](db[_0xcef3('0x70')],{'as':'Contact','foreignKey':_0xcef3('0x164')});db['FaxQueueReport'][_0xcef3('0x122')](db[_0xcef3('0x4e')],{});db[_0xcef3('0x53')]['belongsTo'](db[_0xcef3('0x50')],{});db[_0xcef3('0x53')][_0xcef3('0x122')](db[_0xcef3('0x11')],{});db['FaxQueueReport'][_0xcef3('0x122')](db[_0xcef3('0x51')],{});db[_0xcef3('0x142')][_0xcef3('0x116')](db[_0xcef3('0x80')],{'as':_0xcef3('0x16b'),'foreignKey':_0xcef3('0x189'),'onDelete':_0xcef3('0x115')});db[_0xcef3('0x142')]['hasMany'](db[_0xcef3('0x16c')],{'as':_0xcef3('0x16d'),'foreignKey':_0xcef3('0x189')});db[_0xcef3('0x142')][_0xcef3('0x116')](db[_0xcef3('0x18a')],{'as':_0xcef3('0x15d'),'foreignKey':_0xcef3('0x189')});db[_0xcef3('0x142')]['hasMany'](db[_0xcef3('0x55')],{'as':_0xcef3('0x182')});db['SmsAccount']['hasMany'](db['SmsApplication'],{'as':_0xcef3('0x14a')});db['SmsAccount'][_0xcef3('0x122')](db[_0xcef3('0xfa')],{'as':_0xcef3('0x16e'),'foreignKey':_0xcef3('0x180')});db[_0xcef3('0x142')][_0xcef3('0x122')](db[_0xcef3('0x85')],{'as':_0xcef3('0x156'),'foreignKey':_0xcef3('0x157')});db[_0xcef3('0x142')][_0xcef3('0x124')](db[_0xcef3('0x11')],{'as':_0xcef3('0x159'),'through':'user_has_sms_accounts'});db[_0xcef3('0x18b')]['belongsTo'](db[_0xcef3('0x11')],{'onDelete':_0xcef3('0x167')});db[_0xcef3('0x18b')][_0xcef3('0x122')](db[_0xcef3('0x58')],{'onDelete':_0xcef3('0x167')});db[_0xcef3('0x18b')][_0xcef3('0x122')](db['SmsAccount'],{'onDelete':'restrict'});db['SmsApplication'][_0xcef3('0x122')](db[_0xcef3('0x84')],{'onDelete':_0xcef3('0x167'),'foreignKey':_0xcef3('0x155')});db[_0xcef3('0x18b')]['belongsTo'](db[_0xcef3('0x8f')],{'onDelete':_0xcef3('0x167'),'foreignKey':'TagId'});db['SmsInteraction']['hasMany'](db[_0xcef3('0x18a')],{'as':_0xcef3('0x15d'),'onDelete':'cascade','foreignKey':_0xcef3('0x18c')});db[_0xcef3('0x55')][_0xcef3('0x122')](db[_0xcef3('0x142')],{'as':'Account','foreignKey':_0xcef3('0x189')});db[_0xcef3('0x55')][_0xcef3('0x122')](db[_0xcef3('0x70')],{'as':'Contact','foreignKey':'ContactId'});db[_0xcef3('0x55')][_0xcef3('0x122')](db[_0xcef3('0x11')],{'as':_0xcef3('0x173'),'foreignKey':'UserId'});db[_0xcef3('0x55')][_0xcef3('0x124')](db[_0xcef3('0x8f')],{'through':_0xcef3('0x18d'),'as':_0xcef3('0x174')});db[_0xcef3('0x55')]['belongsToMany'](db[_0xcef3('0x8f')],{'through':_0xcef3('0x18d'),'as':'ThroughTags'});db[_0xcef3('0x55')]['belongsToMany'](db[_0xcef3('0x11')],{'as':_0xcef3('0x177'),'through':_0xcef3('0x12e'),'foreignKey':'SmsInteractionId'});db[_0xcef3('0x18a')][_0xcef3('0x122')](db['User'],{'as':_0xcef3('0x11')});db['SmsMessage'][_0xcef3('0x122')](db['CmContact'],{'onDelete':_0xcef3('0x115'),'as':_0xcef3('0x163')});db['SmsMessage']['belongsTo'](db[_0xcef3('0x55')],{'onDelete':_0xcef3('0x115'),'as':_0xcef3('0x17a'),'foreignKey':_0xcef3('0x18c')});db['SmsMessage'][_0xcef3('0x122')](db['SmsAccount'],{'as':_0xcef3('0x172'),'foreignKey':_0xcef3('0x189')});db['SmsQueue'][_0xcef3('0x124')](db[_0xcef3('0x11')],{'as':_0xcef3('0x159'),'through':_0xcef3('0x32'),'foreignKey':_0xcef3('0x18e')});db[_0xcef3('0x58')][_0xcef3('0x124')](db['Team'],{'through':_0xcef3('0x18f'),'as':_0xcef3('0x15a')});db['OpenchannelAccount'][_0xcef3('0x116')](db['Disposition'],{'as':'Dispositions','foreignKey':'OpenchannelAccountId','onDelete':_0xcef3('0x115')});db[_0xcef3('0x59')][_0xcef3('0x116')](db[_0xcef3('0x16c')],{'as':_0xcef3('0x16d'),'foreignKey':_0xcef3('0x190')});db[_0xcef3('0x59')][_0xcef3('0x116')](db['OpenchannelInteraction'],{'as':_0xcef3('0x182'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xcef3('0x116')](db[_0xcef3('0x5f')],{'as':_0xcef3('0x15d'),'foreignKey':_0xcef3('0x190')});db[_0xcef3('0x59')][_0xcef3('0x116')](db[_0xcef3('0x5b')],{'as':_0xcef3('0x14a'),'foreignKey':_0xcef3('0x190')});db['OpenchannelAccount'][_0xcef3('0x122')](db[_0xcef3('0xfa')],{'as':_0xcef3('0x16e'),'foreignKey':_0xcef3('0x180')});db['OpenchannelAccount'][_0xcef3('0x122')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xcef3('0x157')});db[_0xcef3('0x59')][_0xcef3('0x124')](db[_0xcef3('0x11')],{'as':_0xcef3('0x159'),'through':'user_has_openchannel_accounts'});db[_0xcef3('0x5b')][_0xcef3('0x122')](db['User'],{'onDelete':'restrict'});db['OpenchannelApplication'][_0xcef3('0x122')](db[_0xcef3('0x61')],{'onDelete':_0xcef3('0x167'),'foreignKey':_0xcef3('0x191')});db['OpenchannelApplication'][_0xcef3('0x122')](db[_0xcef3('0x59')],{'onDelete':_0xcef3('0x167'),'foreignKey':_0xcef3('0x190')});db['OpenchannelApplication'][_0xcef3('0x122')](db[_0xcef3('0x84')],{'onDelete':_0xcef3('0x167'),'foreignKey':_0xcef3('0x155')});db[_0xcef3('0x5b')][_0xcef3('0x122')](db[_0xcef3('0x8f')],{'onDelete':'restrict','foreignKey':_0xcef3('0x184')});db[_0xcef3('0x5d')][_0xcef3('0x116')](db[_0xcef3('0x5f')],{'as':_0xcef3('0x15d'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x192')});db[_0xcef3('0x5d')]['belongsTo'](db[_0xcef3('0x59')],{'as':_0xcef3('0x172'),'foreignKey':'OpenchannelAccountId'});db[_0xcef3('0x5d')][_0xcef3('0x122')](db[_0xcef3('0x70')],{'as':'Contact','foreignKey':_0xcef3('0x164')});db[_0xcef3('0x5d')][_0xcef3('0x122')](db[_0xcef3('0x11')],{'as':_0xcef3('0x173'),'foreignKey':'UserId'});db[_0xcef3('0x5d')][_0xcef3('0x124')](db[_0xcef3('0x8f')],{'through':_0xcef3('0x193'),'as':'Tags'});db['OpenchannelInteraction'][_0xcef3('0x124')](db['Tag'],{'through':_0xcef3('0x193'),'as':'ThroughTags'});db[_0xcef3('0x5d')][_0xcef3('0x124')](db[_0xcef3('0x11')],{'as':_0xcef3('0x177'),'through':_0xcef3('0x12f'),'foreignKey':_0xcef3('0x192')});db[_0xcef3('0x5f')][_0xcef3('0x122')](db['User'],{'onDelete':_0xcef3('0x115'),'as':_0xcef3('0x11')});db[_0xcef3('0x5f')][_0xcef3('0x122')](db[_0xcef3('0x70')],{'onDelete':_0xcef3('0x115'),'as':_0xcef3('0x163')});db[_0xcef3('0x5f')][_0xcef3('0x122')](db['OpenchannelInteraction'],{'onDelete':_0xcef3('0x115'),'as':_0xcef3('0x17a'),'foreignKey':_0xcef3('0x192')});db[_0xcef3('0x5f')][_0xcef3('0x122')](db['Attachment'],{'as':_0xcef3('0x178'),'foreignKey':_0xcef3('0x187')});db['OpenchannelMessage'][_0xcef3('0x122')](db[_0xcef3('0x59')],{'as':_0xcef3('0x172'),'foreignKey':_0xcef3('0x190')});db['OpenchannelQueue'][_0xcef3('0x124')](db[_0xcef3('0x11')],{'as':_0xcef3('0x159'),'through':_0xcef3('0x34'),'foreignKey':'OpenchannelQueueId'});db[_0xcef3('0x61')][_0xcef3('0x124')](db[_0xcef3('0xe9')],{'through':_0xcef3('0x194'),'as':_0xcef3('0x15a')});db[_0xcef3('0x17b')][_0xcef3('0x116')](db[_0xcef3('0x80')],{'as':_0xcef3('0x16b'),'foreignKey':_0xcef3('0x17c'),'onDelete':_0xcef3('0x115')});db[_0xcef3('0x17b')]['hasMany'](db[_0xcef3('0x16c')],{'as':_0xcef3('0x16d'),'foreignKey':_0xcef3('0x17c')});db[_0xcef3('0x17b')][_0xcef3('0x116')](db[_0xcef3('0x6d')],{'as':'ProactiveActions'});db[_0xcef3('0x17b')][_0xcef3('0x116')](db[_0xcef3('0x65')],{'as':'Interactions'});db[_0xcef3('0x17b')][_0xcef3('0x116')](db[_0xcef3('0x63')],{'as':_0xcef3('0x14a')});db[_0xcef3('0x17b')][_0xcef3('0x116')](db['ChatMessage'],{'as':_0xcef3('0x15d')});db[_0xcef3('0x17b')]['belongsTo'](db['CmList'],{'as':_0xcef3('0x16e'),'foreignKey':'ListId'});db[_0xcef3('0x17b')][_0xcef3('0x122')](db['Interval'],{'as':'Interval','foreignKey':_0xcef3('0x155')});db[_0xcef3('0x17b')]['belongsTo'](db[_0xcef3('0x3c')],{'as':_0xcef3('0x3c'),'foreignKey':'MailAccountId'});db[_0xcef3('0x17b')][_0xcef3('0x122')](db[_0xcef3('0x85')],{'as':_0xcef3('0x156'),'foreignKey':_0xcef3('0x157')});db[_0xcef3('0x17b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xcef3('0x13b')});db[_0xcef3('0x62')][_0xcef3('0x122')](db[_0xcef3('0x59')],{});db[_0xcef3('0x62')][_0xcef3('0x122')](db[_0xcef3('0xfa')],{'as':_0xcef3('0x16e'),'foreignKey':_0xcef3('0x180')});db[_0xcef3('0x62')][_0xcef3('0x122')](db['CmContact'],{'as':_0xcef3('0x163'),'foreignKey':_0xcef3('0x164')});db[_0xcef3('0x62')][_0xcef3('0x122')](db[_0xcef3('0x5d')],{});db[_0xcef3('0x62')]['belongsTo'](db[_0xcef3('0x5f')],{});db[_0xcef3('0x62')][_0xcef3('0x122')](db[_0xcef3('0x11')],{});db['OpenchannelQueueReport'][_0xcef3('0x122')](db[_0xcef3('0x61')],{});db[_0xcef3('0x63')]['belongsTo'](db[_0xcef3('0x11')],{'as':_0xcef3('0x195'),'foreignKey':'UserId','onDelete':_0xcef3('0x167')});db[_0xcef3('0x63')][_0xcef3('0x122')](db[_0xcef3('0x69')],{'as':_0xcef3('0x196'),'foreignKey':'ChatQueueId','onDelete':_0xcef3('0x167')});db[_0xcef3('0x63')][_0xcef3('0x122')](db['ChatWebsite'],{'as':_0xcef3('0x197'),'foreignKey':_0xcef3('0x17c'),'onDelete':_0xcef3('0x167')});db[_0xcef3('0x63')]['belongsTo'](db[_0xcef3('0x8f')],{'onDelete':'restrict','foreignKey':_0xcef3('0x184')});db['ChatInteraction']['hasMany'](db[_0xcef3('0x67')],{'as':_0xcef3('0x15d'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x198')});db['ChatInteraction'][_0xcef3('0x122')](db['ChatWebsite'],{'as':'Account','foreignKey':_0xcef3('0x17c')});db['ChatInteraction'][_0xcef3('0x122')](db[_0xcef3('0x70')],{'as':'Contact','foreignKey':_0xcef3('0x164')});db['ChatInteraction'][_0xcef3('0x122')](db['User'],{'as':'Owner','foreignKey':_0xcef3('0x114')});db[_0xcef3('0x65')][_0xcef3('0x124')](db[_0xcef3('0x8f')],{'through':'chat_interaction_has_tags','as':_0xcef3('0x174')});db['ChatInteraction'][_0xcef3('0x124')](db[_0xcef3('0x8f')],{'through':_0xcef3('0x199'),'as':_0xcef3('0x176')});db[_0xcef3('0x65')]['belongsToMany'](db[_0xcef3('0x11')],{'as':_0xcef3('0x177'),'through':_0xcef3('0x12c'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0xcef3('0x122')](db[_0xcef3('0x11')],{'onDelete':_0xcef3('0x115'),'as':_0xcef3('0x11')});db[_0xcef3('0x67')][_0xcef3('0x122')](db[_0xcef3('0x70')],{'onDelete':'cascade','as':_0xcef3('0x163'),'foreignKey':_0xcef3('0x164')});db[_0xcef3('0x67')][_0xcef3('0x122')](db[_0xcef3('0x65')],{'onDelete':'cascade','as':'Interaction','foreignKey':'ChatInteractionId'});db[_0xcef3('0x67')][_0xcef3('0x122')](db[_0xcef3('0x178')],{'as':_0xcef3('0x178'),'foreignKey':'AttachmentId'});db[_0xcef3('0x67')][_0xcef3('0x122')](db[_0xcef3('0x17b')],{'as':_0xcef3('0x172'),'foreignKey':_0xcef3('0x17c')});db[_0xcef3('0x17d')][_0xcef3('0x116')](db[_0xcef3('0x178')],{'as':_0xcef3('0x179'),'foreignKey':_0xcef3('0x17e'),'onDelete':_0xcef3('0x115'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0xcef3('0x70')],{'onDelete':_0xcef3('0x115'),'as':_0xcef3('0x163'),'foreignKey':_0xcef3('0x164')});db[_0xcef3('0x17d')][_0xcef3('0x122')](db['ChatWebsite'],{'as':_0xcef3('0x172'),'foreignKey':_0xcef3('0x17c')});db[_0xcef3('0x69')][_0xcef3('0x124')](db[_0xcef3('0x11')],{'as':_0xcef3('0x159'),'through':_0xcef3('0x19a'),'hooks':!![]});db[_0xcef3('0x69')][_0xcef3('0x124')](db[_0xcef3('0xe9')],{'through':_0xcef3('0x19b'),'as':_0xcef3('0x15a')});db['ChatGroup'][_0xcef3('0x116')](db[_0xcef3('0xd5')],{'as':_0xcef3('0x15d'),'foreignKey':_0xcef3('0x19c'),'onDelete':_0xcef3('0x115')});db['ChatGroup'][_0xcef3('0x124')](db[_0xcef3('0x11')],{'as':_0xcef3('0x19d'),'through':_0xcef3('0x126')});db[_0xcef3('0x6d')][_0xcef3('0x122')](db['ChatWebsite'],{'as':_0xcef3('0x197'),'foreignKey':_0xcef3('0x17c')});db[_0xcef3('0x6e')][_0xcef3('0x116')](db['CmContact'],{'as':_0xcef3('0x19e'),'foreignKey':_0xcef3('0x19f')});db[_0xcef3('0x70')][_0xcef3('0x116')](db[_0xcef3('0x1a0')],{'as':'Phones','foreignKey':'CmContactId'});db[_0xcef3('0x70')][_0xcef3('0x116')](db[_0xcef3('0x72')],{'as':_0xcef3('0x14e'),'foreignKey':_0xcef3('0x164')});db[_0xcef3('0x70')][_0xcef3('0x116')](db[_0xcef3('0x75')],{'as':_0xcef3('0x11a'),'foreignKey':_0xcef3('0x164')});db[_0xcef3('0x70')]['hasMany'](db['CmHopperHistory'],{'as':_0xcef3('0x14f'),'foreignKey':_0xcef3('0x164')});db[_0xcef3('0x70')][_0xcef3('0x116')](db[_0xcef3('0x78')],{'as':_0xcef3('0x78'),'foreignKey':_0xcef3('0x164')});db['CmContact'][_0xcef3('0x116')](db['JscriptySessionReport'],{'as':_0xcef3('0x151'),'foreignKey':'ContactId'});db['CmContact'][_0xcef3('0x116')](db['OpenchannelInteraction'],{'as':_0xcef3('0x11c'),'foreignKey':_0xcef3('0x164'),'onDelete':_0xcef3('0x167')});db['CmContact'][_0xcef3('0x116')](db['ChatInteraction'],{'as':_0xcef3('0x11d'),'foreignKey':_0xcef3('0x164'),'onDelete':_0xcef3('0x167')});db[_0xcef3('0x70')][_0xcef3('0x116')](db[_0xcef3('0x55')],{'as':_0xcef3('0x11e'),'foreignKey':_0xcef3('0x164'),'onDelete':_0xcef3('0x167')});db[_0xcef3('0x70')][_0xcef3('0x116')](db[_0xcef3('0x4e')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':_0xcef3('0x167')});db[_0xcef3('0x70')][_0xcef3('0x116')](db[_0xcef3('0x40')],{'as':_0xcef3('0x12a'),'foreignKey':_0xcef3('0x164'),'onDelete':_0xcef3('0x167')});db[_0xcef3('0x70')][_0xcef3('0x122')](db[_0xcef3('0x6e')],{'as':_0xcef3('0x1a1'),'foreignKey':_0xcef3('0x19f')});db[_0xcef3('0x70')][_0xcef3('0x122')](db['CmList'],{'as':_0xcef3('0x16e'),'foreignKey':_0xcef3('0x180'),'onDelete':_0xcef3('0x115')});db['CmContact'][_0xcef3('0x124')](db[_0xcef3('0x11')],{'as':_0xcef3('0x177'),'through':_0xcef3('0x127')});db[_0xcef3('0x70')][_0xcef3('0x124')](db[_0xcef3('0x8f')],{'as':_0xcef3('0x174'),'through':_0xcef3('0x1a2')});db[_0xcef3('0x70')][_0xcef3('0x124')](db[_0xcef3('0x8f')],{'through':_0xcef3('0x1a2'),'as':_0xcef3('0x176')});db[_0xcef3('0x72')]['hasMany'](db[_0xcef3('0x93')],{'as':_0xcef3('0x1a3'),'foreignKey':_0xcef3('0x1a4')});db[_0xcef3('0x72')][_0xcef3('0x122')](db['CmContact'],{'as':_0xcef3('0x163'),'foreignKey':_0xcef3('0x164'),'onDelete':_0xcef3('0x115')});db[_0xcef3('0x72')][_0xcef3('0x122')](db[_0xcef3('0xfa')],{'as':_0xcef3('0x16e'),'foreignKey':_0xcef3('0x180'),'onDelete':'cascade'});db[_0xcef3('0x72')][_0xcef3('0x122')](db[_0xcef3('0x11')],{'as':_0xcef3('0x195'),'foreignKey':_0xcef3('0x114')});db['CmHopper'][_0xcef3('0x122')](db[_0xcef3('0x1a')],{'as':_0xcef3('0x196'),'foreignKey':_0xcef3('0x14d'),'onDelete':'cascade'});db[_0xcef3('0x72')][_0xcef3('0x122')](db['Campaign'],{'as':_0xcef3('0xec'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0xcef3('0x72')][_0xcef3('0x122')](db['User'],{'as':_0xcef3('0x173'),'foreignKey':_0xcef3('0x1a5')});db[_0xcef3('0x1a6')][_0xcef3('0x122')](db[_0xcef3('0x70')],{'as':_0xcef3('0x163'),'foreignKey':'ContactId','onDelete':_0xcef3('0x115')});db[_0xcef3('0x1a6')]['belongsTo'](db[_0xcef3('0xfa')],{'as':_0xcef3('0x16e'),'foreignKey':_0xcef3('0x180'),'onDelete':_0xcef3('0x115')});db[_0xcef3('0x1a6')][_0xcef3('0x122')](db[_0xcef3('0x1a')],{'as':_0xcef3('0x196'),'foreignKey':_0xcef3('0x14d'),'onDelete':'cascade'});db[_0xcef3('0x1a6')][_0xcef3('0x122')](db['Campaign'],{'as':_0xcef3('0xec'),'foreignKey':_0xcef3('0x1a7'),'onDelete':_0xcef3('0x115')});db['Automation'][_0xcef3('0x116')](db[_0xcef3('0x82')],{'as':{'plural':_0xcef3('0x1a8'),'singular':_0xcef3('0x1a9')},'foreignKey':_0xcef3('0x1aa'),'onDelete':_0xcef3('0x115'),'hooks':!![]});db['Automation'][_0xcef3('0x116')](db[_0xcef3('0x82')],{'as':{'plural':'Any','singular':_0xcef3('0x1ab')},'foreignKey':_0xcef3('0x1ac'),'onDelete':_0xcef3('0x115'),'hooks':!![]});db['Automation'][_0xcef3('0x116')](db[_0xcef3('0x7b')],{'as':_0xcef3('0x1ad'),'foreignKey':_0xcef3('0x1ae'),'onDelete':_0xcef3('0x115'),'hooks':!![]});db[_0xcef3('0x80')][_0xcef3('0x116')](db['Disposition'],{'as':_0xcef3('0x16b'),'foreignKey':_0xcef3('0x1af'),'onDelete':_0xcef3('0x115')});db[_0xcef3('0x84')][_0xcef3('0x116')](db[_0xcef3('0x84')],{'as':_0xcef3('0x1b0'),'foreignKey':_0xcef3('0x155'),'onDelete':_0xcef3('0x115'),'hooks':!![],'required':![]});db[_0xcef3('0x84')][_0xcef3('0x116')](db['VoiceExtension'],{'as':'Extensions','foreignKey':_0xcef3('0x155'),'onDelete':'restrict'});db[_0xcef3('0x84')]['hasMany'](db[_0xcef3('0x44')],{'as':'MailApplications','foreignKey':_0xcef3('0x155')});db[_0xcef3('0x84')][_0xcef3('0x116')](db[_0xcef3('0x63')],{'as':_0xcef3('0x1b1'),'foreignKey':'IntervalId'});db[_0xcef3('0x84')][_0xcef3('0x116')](db[_0xcef3('0x4c')],{'as':_0xcef3('0x1b2'),'foreignKey':_0xcef3('0x155')});db['Interval'][_0xcef3('0x116')](db[_0xcef3('0x18b')],{'as':_0xcef3('0x1b3'),'foreignKey':_0xcef3('0x155')});db[_0xcef3('0x8b')][_0xcef3('0x122')](db['MailAccount'],{});db[_0xcef3('0x8b')][_0xcef3('0x122')](db[_0xcef3('0x9e')],{'foreignKey':'DefaultReportId'});db[_0xcef3('0x8b')][_0xcef3('0x122')](db[_0xcef3('0x9c')],{'foreignKey':_0xcef3('0x1b4')});db['Sound'][_0xcef3('0x124')](db[_0xcef3('0x14b')],{'as':'Mohs','through':_0xcef3('0x1b5'),'onDelete':_0xcef3('0x167')});db['Tag'][_0xcef3('0x124')](db[_0xcef3('0x70')],{'through':'cm_contact_has_tags'});db[_0xcef3('0x8f')][_0xcef3('0x124')](db[_0xcef3('0x65')],{'through':_0xcef3('0x199')});db[_0xcef3('0x8f')][_0xcef3('0x124')](db[_0xcef3('0x40')],{'through':_0xcef3('0x175')});db[_0xcef3('0x8f')][_0xcef3('0x124')](db[_0xcef3('0x55')],{'through':_0xcef3('0x18d')});db[_0xcef3('0x8f')][_0xcef3('0x124')](db[_0xcef3('0x4e')],{'through':'fax_interaction_has_tags'});db[_0xcef3('0x8f')][_0xcef3('0x124')](db[_0xcef3('0x5d')],{'through':_0xcef3('0x193')});db[_0xcef3('0x8f')]['belongsToMany'](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db['CmContactHasItem'][_0xcef3('0x122')](db['ContactItemType'],{'as':_0xcef3('0x1b6'),'foreignKey':_0xcef3('0x1b7')});db['CmHopperAdditionalPhone'][_0xcef3('0x122')](db[_0xcef3('0x72')],{'as':_0xcef3('0x1b8'),'foreignKey':_0xcef3('0x1a4')});db[_0xcef3('0x1a0')]['belongsTo'](db['CmContact'],{'as':_0xcef3('0x163'),'foreignKey':_0xcef3('0x1b9')});db['Trigger'][_0xcef3('0x116')](db[_0xcef3('0x82')],{'as':{'plural':_0xcef3('0x1ba'),'singular':_0xcef3('0x1bb')},'foreignKey':_0xcef3('0x1bc'),'onDelete':_0xcef3('0x115'),'hooks':!![]});db['Trigger'][_0xcef3('0x116')](db[_0xcef3('0x82')],{'as':{'plural':_0xcef3('0x1bd'),'singular':'AnyCondition'},'foreignKey':_0xcef3('0x1be'),'onDelete':_0xcef3('0x115'),'hooks':!![]});db[_0xcef3('0x1bf')]['hasMany'](db[_0xcef3('0x7b')],{'as':_0xcef3('0x1ad'),'foreignKey':_0xcef3('0x1c0'),'onDelete':_0xcef3('0x115'),'hooks':!![]});db[_0xcef3('0x9c')][_0xcef3('0x116')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1b4'),'hooks':!![]});db[_0xcef3('0x9e')][_0xcef3('0x116')](db[_0xcef3('0xa2')],{'as':_0xcef3('0x1c1'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1c2')});db[_0xcef3('0xa0')][_0xcef3('0x116')](db[_0xcef3('0xa2')],{'as':_0xcef3('0x1c1'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0xcef3('0xa2')][_0xcef3('0x122')](db[_0xcef3('0xa0')],{'foreignKey':_0xcef3('0x1c3')});db[_0xcef3('0xa6')][_0xcef3('0x116')](db[_0xcef3('0xa7')],{'as':_0xcef3('0x1c4'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1c5')});db[_0xcef3('0xa7')][_0xcef3('0x116')](db[_0xcef3('0xa9')],{'as':_0xcef3('0x1c6'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1c7')});db[_0xcef3('0xa7')]['hasMany'](db[_0xcef3('0xa9')],{'as':_0xcef3('0x1c8'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1c9')});db['SalesforceConfiguration'][_0xcef3('0x116')](db['SalesforceField'],{'as':_0xcef3('0x1c1'),'onDelete':'cascade','foreignKey':_0xcef3('0x1ca')});db[_0xcef3('0xa7')][_0xcef3('0x122')](db[_0xcef3('0xa6')],{'as':_0xcef3('0x172'),'foreignKey':_0xcef3('0x1c5')});db[_0xcef3('0xa9')][_0xcef3('0x116')](db[_0xcef3('0xa9')],{'as':_0xcef3('0x1cb'),'foreignKey':_0xcef3('0x1c7')});db[_0xcef3('0xa9')][_0xcef3('0x116')](db[_0xcef3('0xa9')],{'as':_0xcef3('0x1cc'),'foreignKey':_0xcef3('0x1c9')});db[_0xcef3('0xa9')][_0xcef3('0x116')](db[_0xcef3('0xa9')],{'as':_0xcef3('0x1cd'),'foreignKey':'FieldId'});db[_0xcef3('0xa9')][_0xcef3('0x122')](db[_0xcef3('0x97')],{'as':_0xcef3('0x97'),'foreignKey':_0xcef3('0x1ce')});db[_0xcef3('0xab')][_0xcef3('0x116')](db[_0xcef3('0xac')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xcef3('0xac')][_0xcef3('0x116')](db[_0xcef3('0x1cf')],{'as':'Subjects','onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1c7')});db['SugarcrmConfiguration']['hasMany'](db[_0xcef3('0x1cf')],{'as':_0xcef3('0x1c8'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1c9')});db[_0xcef3('0xac')]['hasMany'](db[_0xcef3('0x1cf')],{'as':_0xcef3('0x1c1'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1ca')});db['SugarcrmConfiguration'][_0xcef3('0x122')](db[_0xcef3('0xab')],{'as':_0xcef3('0x172'),'foreignKey':_0xcef3('0x1c5')});db['SugarcrmField'][_0xcef3('0x116')](db[_0xcef3('0x1cf')],{'as':_0xcef3('0x1cb'),'foreignKey':_0xcef3('0x1c7')});db[_0xcef3('0x1cf')][_0xcef3('0x116')](db[_0xcef3('0x1cf')],{'as':_0xcef3('0x1cc'),'foreignKey':_0xcef3('0x1c9')});db[_0xcef3('0x1cf')][_0xcef3('0x116')](db[_0xcef3('0x1cf')],{'as':_0xcef3('0x1cd'),'foreignKey':'FieldId'});db[_0xcef3('0x1cf')][_0xcef3('0x122')](db['Variable'],{'as':_0xcef3('0x97'),'foreignKey':'VariableId'});db[_0xcef3('0xaf')]['hasMany'](db[_0xcef3('0x1d0')],{'as':'Configurations','onDelete':_0xcef3('0x115'),'foreignKey':'AccountId'});db[_0xcef3('0x1d0')][_0xcef3('0x116')](db[_0xcef3('0xb2')],{'as':_0xcef3('0x1c6'),'onDelete':_0xcef3('0x115'),'foreignKey':'SubjectId'});db[_0xcef3('0x1d0')][_0xcef3('0x116')](db[_0xcef3('0xb2')],{'as':'Descriptions','onDelete':_0xcef3('0x115'),'foreignKey':'DescriptionId'});db[_0xcef3('0x1d0')][_0xcef3('0x116')](db['DeskField'],{'as':_0xcef3('0x1c1'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1ca')});db[_0xcef3('0x1d0')][_0xcef3('0x122')](db[_0xcef3('0xaf')],{'as':_0xcef3('0x172'),'foreignKey':'AccountId'});db[_0xcef3('0x1d0')][_0xcef3('0x124')](db[_0xcef3('0x8f')],{'through':_0xcef3('0x1d1')});db[_0xcef3('0xb2')][_0xcef3('0x116')](db[_0xcef3('0xb2')],{'as':'Subject','foreignKey':_0xcef3('0x1c7')});db[_0xcef3('0xb2')][_0xcef3('0x116')](db[_0xcef3('0xb2')],{'as':_0xcef3('0x1cc'),'foreignKey':'DescriptionId'});db['DeskField'][_0xcef3('0x116')](db[_0xcef3('0xb2')],{'as':_0xcef3('0x1cd'),'foreignKey':_0xcef3('0x1ca')});db[_0xcef3('0xb2')][_0xcef3('0x122')](db[_0xcef3('0x97')],{'as':'Variable','foreignKey':_0xcef3('0x1ce')});db['ZohoAccount'][_0xcef3('0x116')](db[_0xcef3('0x1d2')],{'as':'Configurations','onDelete':_0xcef3('0x115'),'foreignKey':'AccountId'});db[_0xcef3('0x1d2')][_0xcef3('0x116')](db['ZohoField'],{'as':_0xcef3('0x1c6'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1c7')});db[_0xcef3('0x1d2')][_0xcef3('0x116')](db[_0xcef3('0x1d3')],{'as':'Descriptions','onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1c9')});db[_0xcef3('0x1d2')][_0xcef3('0x116')](db['ZohoField'],{'as':'Fields','onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1ca')});db[_0xcef3('0x1d2')][_0xcef3('0x122')](db[_0xcef3('0xb4')],{'as':'Account','foreignKey':_0xcef3('0x1c5')});db['ZohoField'][_0xcef3('0x116')](db[_0xcef3('0x1d3')],{'as':_0xcef3('0x1cb'),'foreignKey':_0xcef3('0x1c7')});db[_0xcef3('0x1d3')][_0xcef3('0x116')](db[_0xcef3('0x1d3')],{'as':_0xcef3('0x1cc'),'foreignKey':_0xcef3('0x1c9')});db[_0xcef3('0x1d3')]['hasMany'](db[_0xcef3('0x1d3')],{'as':_0xcef3('0x1cd'),'foreignKey':_0xcef3('0x1ca')});db[_0xcef3('0x1d3')][_0xcef3('0x122')](db[_0xcef3('0x97')],{'as':_0xcef3('0x97'),'foreignKey':_0xcef3('0x1ce')});db[_0xcef3('0x1d4')][_0xcef3('0x116')](db[_0xcef3('0xb8')],{'as':_0xcef3('0x1c4'),'onDelete':'cascade','foreignKey':_0xcef3('0x1c5')});db[_0xcef3('0xb8')][_0xcef3('0x116')](db[_0xcef3('0x1d5')],{'as':'Subjects','foreignKey':_0xcef3('0x1c7')});db[_0xcef3('0xb8')]['hasMany'](db[_0xcef3('0x1d5')],{'as':_0xcef3('0x1c8'),'foreignKey':_0xcef3('0x1c9')});db[_0xcef3('0xb8')]['hasMany'](db[_0xcef3('0x1d5')],{'as':_0xcef3('0x1c1'),'foreignKey':'FieldId'});db[_0xcef3('0xb8')][_0xcef3('0x122')](db[_0xcef3('0x1d4')],{'as':_0xcef3('0x172'),'foreignKey':_0xcef3('0x1c5')});db['ZendeskConfiguration']['belongsToMany'](db[_0xcef3('0x8f')],{'through':_0xcef3('0x1d6')});db[_0xcef3('0x1d5')][_0xcef3('0x116')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0xcef3('0x1d5')]['hasMany'](db['ZendeskField'],{'as':_0xcef3('0x1cc'),'foreignKey':_0xcef3('0x1c9')});db[_0xcef3('0x1d5')][_0xcef3('0x116')](db['ZendeskField'],{'as':_0xcef3('0x1cd'),'foreignKey':'FieldId'});db[_0xcef3('0x1d5')][_0xcef3('0x122')](db['Variable'],{'as':_0xcef3('0x97'),'foreignKey':_0xcef3('0x1ce')});db['FreshdeskAccount'][_0xcef3('0x116')](db[_0xcef3('0x1d7')],{'as':_0xcef3('0x1c4'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1c5')});db[_0xcef3('0x1d7')][_0xcef3('0x116')](db[_0xcef3('0xbe')],{'as':_0xcef3('0x1c6'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1c7')});db[_0xcef3('0x1d7')]['hasMany'](db[_0xcef3('0xbe')],{'as':_0xcef3('0x1c8'),'onDelete':_0xcef3('0x115'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration']['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1ca')});db[_0xcef3('0x1d7')]['belongsTo'](db[_0xcef3('0xbb')],{'as':'Account','foreignKey':_0xcef3('0x1c5')});db['FreshdeskConfiguration'][_0xcef3('0x124')](db[_0xcef3('0x8f')],{'through':_0xcef3('0x1d8')});db[_0xcef3('0xbe')][_0xcef3('0x116')](db['FreshdeskField'],{'as':_0xcef3('0x1cb'),'foreignKey':_0xcef3('0x1c7')});db[_0xcef3('0xbe')][_0xcef3('0x116')](db[_0xcef3('0xbe')],{'as':'Description','foreignKey':_0xcef3('0x1c9')});db[_0xcef3('0xbe')][_0xcef3('0x116')](db[_0xcef3('0xbe')],{'as':_0xcef3('0x1cd'),'foreignKey':_0xcef3('0x1ca')});db[_0xcef3('0xbe')][_0xcef3('0x122')](db[_0xcef3('0x97')],{'as':_0xcef3('0x97'),'foreignKey':_0xcef3('0x1ce')});db[_0xcef3('0xc0')]['hasMany'](db[_0xcef3('0xc2')],{'as':_0xcef3('0x1c4'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1c5')});db[_0xcef3('0xc2')]['hasMany'](db[_0xcef3('0xc4')],{'as':'Subjects','foreignKey':_0xcef3('0x1c7')});db[_0xcef3('0xc2')][_0xcef3('0x116')](db[_0xcef3('0xc4')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xcef3('0xc2')]['hasMany'](db['VtigerField'],{'as':_0xcef3('0x1c1'),'foreignKey':_0xcef3('0x1ca')});db[_0xcef3('0xc2')]['belongsTo'](db[_0xcef3('0xc0')],{'as':_0xcef3('0x172'),'foreignKey':_0xcef3('0x1c5')});db[_0xcef3('0xc4')][_0xcef3('0x116')](db['VtigerField'],{'as':_0xcef3('0x1cb'),'foreignKey':'SubjectId'});db[_0xcef3('0xc4')]['hasMany'](db[_0xcef3('0xc4')],{'as':_0xcef3('0x1cc'),'foreignKey':_0xcef3('0x1c9')});db[_0xcef3('0xc4')][_0xcef3('0x116')](db[_0xcef3('0xc4')],{'as':_0xcef3('0x1cd'),'foreignKey':_0xcef3('0x1ca')});db[_0xcef3('0xc4')][_0xcef3('0x122')](db[_0xcef3('0x97')],{'as':'Variable','foreignKey':'VariableId'});db[_0xcef3('0xc6')][_0xcef3('0x116')](db[_0xcef3('0xc8')],{'as':_0xcef3('0x1c4'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1c5')});db['ServicenowConfiguration'][_0xcef3('0x116')](db[_0xcef3('0xca')],{'as':_0xcef3('0x1c6'),'foreignKey':'SubjectId'});db[_0xcef3('0xc8')][_0xcef3('0x116')](db[_0xcef3('0xca')],{'as':'Descriptions','foreignKey':_0xcef3('0x1c9')});db[_0xcef3('0xc8')][_0xcef3('0x116')](db[_0xcef3('0xca')],{'as':_0xcef3('0x1c1'),'foreignKey':_0xcef3('0x1ca')});db[_0xcef3('0xc8')][_0xcef3('0x122')](db[_0xcef3('0xc6')],{'as':_0xcef3('0x172'),'foreignKey':_0xcef3('0x1c5')});db[_0xcef3('0xca')][_0xcef3('0x116')](db['ServicenowField'],{'as':_0xcef3('0x1cb'),'foreignKey':_0xcef3('0x1c7')});db[_0xcef3('0xca')][_0xcef3('0x116')](db['ServicenowField'],{'as':_0xcef3('0x1cc'),'foreignKey':_0xcef3('0x1c9')});db[_0xcef3('0xca')][_0xcef3('0x116')](db[_0xcef3('0xca')],{'as':_0xcef3('0x1cd'),'foreignKey':_0xcef3('0x1ca')});db[_0xcef3('0xca')][_0xcef3('0x122')](db['Variable'],{'as':_0xcef3('0x97'),'foreignKey':_0xcef3('0x1ce')});db[_0xcef3('0x1d9')][_0xcef3('0x116')](db[_0xcef3('0x1da')],{'as':_0xcef3('0x1c4'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1c5')});db['Dynamics365Account']['belongsTo'](db['CloudProvider'],{'as':_0xcef3('0x10b'),'foreignKey':_0xcef3('0x166')});db['Dynamics365Configuration'][_0xcef3('0x116')](db[_0xcef3('0xcc')],{'as':_0xcef3('0x1c6'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1c7')});db[_0xcef3('0x1da')][_0xcef3('0x116')](db['Dynamics365Field'],{'as':_0xcef3('0x1c8'),'onDelete':'cascade','foreignKey':_0xcef3('0x1c9')});db[_0xcef3('0x1da')][_0xcef3('0x116')](db[_0xcef3('0xcc')],{'as':_0xcef3('0x1c1'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1ca')});db[_0xcef3('0x1da')]['belongsTo'](db['Dynamics365Account'],{'as':_0xcef3('0x172'),'foreignKey':_0xcef3('0x1c5')});db[_0xcef3('0xcc')][_0xcef3('0x116')](db[_0xcef3('0xcc')],{'as':_0xcef3('0x1cb'),'foreignKey':'SubjectId'});db['Dynamics365Field'][_0xcef3('0x116')](db[_0xcef3('0xcc')],{'as':_0xcef3('0x1cc'),'foreignKey':'DescriptionId'});db['Dynamics365Field']['hasMany'](db['Dynamics365Field'],{'as':_0xcef3('0x1cd'),'foreignKey':_0xcef3('0x1ca')});db['Dynamics365Field'][_0xcef3('0x122')](db['Variable'],{'as':_0xcef3('0x97'),'foreignKey':'VariableId'});db[_0xcef3('0xce')]['hasMany'](db[_0xcef3('0xcf')],{'as':_0xcef3('0x1c4'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1c5')});db['FreshsalesConfiguration']['hasMany'](db[_0xcef3('0xd1')],{'as':_0xcef3('0x1c6'),'foreignKey':'SubjectId'});db['FreshsalesConfiguration'][_0xcef3('0x116')](db[_0xcef3('0xd1')],{'as':'Descriptions','foreignKey':_0xcef3('0x1c9')});db[_0xcef3('0xcf')][_0xcef3('0x116')](db[_0xcef3('0xd1')],{'as':_0xcef3('0x1c1'),'foreignKey':_0xcef3('0x1ca')});db['FreshsalesConfiguration']['belongsTo'](db['FreshsalesAccount'],{'as':_0xcef3('0x172'),'foreignKey':_0xcef3('0x1c5')});db[_0xcef3('0xd1')][_0xcef3('0x116')](db['FreshsalesField'],{'as':_0xcef3('0x1cb'),'foreignKey':_0xcef3('0x1c7')});db[_0xcef3('0xd1')][_0xcef3('0x116')](db[_0xcef3('0xd1')],{'as':'Description','foreignKey':_0xcef3('0x1c9')});db[_0xcef3('0xd1')][_0xcef3('0x116')](db[_0xcef3('0xd1')],{'as':_0xcef3('0x1cd'),'foreignKey':_0xcef3('0x1ca')});db['FreshsalesField'][_0xcef3('0x122')](db['Variable'],{'as':_0xcef3('0x97'),'foreignKey':_0xcef3('0x1ce')});db[_0xcef3('0x1db')][_0xcef3('0x122')](db[_0xcef3('0x17b')],{});db[_0xcef3('0x1db')][_0xcef3('0x122')](db['CmList'],{'as':_0xcef3('0x16e'),'foreignKey':_0xcef3('0x180')});db['ChatQueueReport'][_0xcef3('0x122')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['ChatQueueReport'][_0xcef3('0x122')](db['ChatInteraction'],{});db[_0xcef3('0x1db')][_0xcef3('0x122')](db[_0xcef3('0x67')],{});db['ChatQueueReport'][_0xcef3('0x122')](db[_0xcef3('0x11')],{});db[_0xcef3('0x1db')][_0xcef3('0x122')](db[_0xcef3('0x69')],{});db[_0xcef3('0xd5')]['belongsTo'](db[_0xcef3('0x11')],{'onDelete':_0xcef3('0x115'),'foreignKey':'FromId'});db[_0xcef3('0xd5')][_0xcef3('0x122')](db[_0xcef3('0x11')],{'onDelete':'cascade','foreignKey':_0xcef3('0x1dc')});db[_0xcef3('0xda')][_0xcef3('0x116')](db[_0xcef3('0xd8')],{'foreignKey':_0xcef3('0x1dd'),'onDelete':_0xcef3('0x115')});db[_0xcef3('0xda')]['hasMany'](db[_0xcef3('0xd7')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xcef3('0xdc')][_0xcef3('0x122')](db[_0xcef3('0x142')],{});db[_0xcef3('0xdc')][_0xcef3('0x122')](db['CmList'],{'as':_0xcef3('0x16e'),'foreignKey':_0xcef3('0x180')});db['SmsQueueReport']['belongsTo'](db[_0xcef3('0x70')],{'as':'Contact','foreignKey':_0xcef3('0x164')});db[_0xcef3('0xdc')][_0xcef3('0x122')](db[_0xcef3('0x55')],{});db[_0xcef3('0xdc')][_0xcef3('0x122')](db[_0xcef3('0x18a')],{});db[_0xcef3('0xdc')][_0xcef3('0x122')](db[_0xcef3('0x11')],{});db[_0xcef3('0xdc')]['belongsTo'](db['SmsQueue'],{});db[_0xcef3('0x1de')]['hasMany'](db[_0xcef3('0xda')],{'foreignKey':_0xcef3('0x1df')});db['JscriptyProject'][_0xcef3('0x116')](db[_0xcef3('0xd8')],{'foreignKey':_0xcef3('0x1df')});db['JscriptyProject']['hasMany'](db[_0xcef3('0xd7')],{'foreignKey':_0xcef3('0x1df')});db['SquareProject']['belongsToMany'](db[_0xcef3('0x11')],{'as':_0xcef3('0x177'),'through':_0xcef3('0x147')});db[_0xcef3('0xe9')][_0xcef3('0x124')](db[_0xcef3('0x11')],{'as':_0xcef3('0x159'),'through':_0xcef3('0x1e0')});db['Team'][_0xcef3('0x124')](db[_0xcef3('0x1a')],{'through':'TeamVoiceQueue','as':_0xcef3('0x131')});db['Team']['belongsToMany'](db[_0xcef3('0x3d')],{'through':_0xcef3('0x170'),'as':_0xcef3('0x134')});db['Team'][_0xcef3('0x124')](db[_0xcef3('0x69')],{'through':'team_has_chat_queues','as':_0xcef3('0x135')});db[_0xcef3('0xe9')][_0xcef3('0x124')](db['FaxQueue'],{'through':_0xcef3('0x188'),'as':_0xcef3('0x136')});db[_0xcef3('0xe9')][_0xcef3('0x124')](db[_0xcef3('0x58')],{'through':_0xcef3('0x18f'),'as':_0xcef3('0x137')});db[_0xcef3('0xe9')][_0xcef3('0x124')](db[_0xcef3('0x61')],{'through':_0xcef3('0x194'),'as':_0xcef3('0x138')});db[_0xcef3('0xe9')]['belongsToMany'](db[_0xcef3('0x10a')],{'through':_0xcef3('0x1e1'),'as':_0xcef3('0x139')});db[_0xcef3('0xe9')][_0xcef3('0x124')](db[_0xcef3('0x132')],{'through':_0xcef3('0x10f'),'as':_0xcef3('0x133')});db['Campaign'][_0xcef3('0x116')](db[_0xcef3('0x72')],{'as':'Hoppers','foreignKey':_0xcef3('0x1a7')});db[_0xcef3('0xec')][_0xcef3('0x116')](db[_0xcef3('0x75')],{'as':'HopperFinals','foreignKey':_0xcef3('0x1a7')});db[_0xcef3('0xec')]['hasMany'](db[_0xcef3('0x76')],{'as':_0xcef3('0x14f'),'foreignKey':_0xcef3('0x1a7')});db[_0xcef3('0xec')][_0xcef3('0x116')](db[_0xcef3('0x1a6')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0xcef3('0xec')]['belongsTo'](db[_0xcef3('0x152')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0xcef3('0xec')][_0xcef3('0x122')](db['Trunk'],{'as':_0xcef3('0x1e2'),'foreignKey':_0xcef3('0x154')});db['Campaign'][_0xcef3('0x122')](db[_0xcef3('0x84')],{'as':_0xcef3('0x84'),'foreignKey':'IntervalId'});db[_0xcef3('0xec')]['belongsTo'](db[_0xcef3('0xe5')],{'as':_0xcef3('0xe5'),'foreignKey':_0xcef3('0x1e3')});db[_0xcef3('0xec')][_0xcef3('0x124')](db[_0xcef3('0xfa')],{'as':_0xcef3('0x128'),'through':_0xcef3('0x1e4')});db[_0xcef3('0xec')]['belongsToMany'](db[_0xcef3('0xfa')],{'as':_0xcef3('0x1e5'),'through':_0xcef3('0x1e6')});db[_0xcef3('0x178')][_0xcef3('0x122')](db['ChatOfflineMessage'],{'as':_0xcef3('0x17d'),'foreignKey':_0xcef3('0x17e')});db[_0xcef3('0xf2')][_0xcef3('0x122')](db['MailMessage'],{});db[_0xcef3('0xf2')][_0xcef3('0x122')](db['MailInteraction'],{});db[_0xcef3('0xf2')][_0xcef3('0x122')](db[_0xcef3('0x3c')],{'foreignKey':_0xcef3('0x1e7'),'as':'FromAccount'});db[_0xcef3('0xf2')][_0xcef3('0x122')](db[_0xcef3('0x11')],{'foreignKey':'FromUserId','as':_0xcef3('0x1e8')});db[_0xcef3('0xf2')][_0xcef3('0x122')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xcef3('0xf2')][_0xcef3('0x122')](db[_0xcef3('0x3d')],{'foreignKey':_0xcef3('0x1e9'),'as':'ToQueue'});db[_0xcef3('0xf2')]['belongsTo'](db[_0xcef3('0x3c')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0xcef3('0xf4')][_0xcef3('0x122')](db[_0xcef3('0x67')],{});db[_0xcef3('0xf4')]['belongsTo'](db[_0xcef3('0x65')],{});db['ChatTransferReport'][_0xcef3('0x122')](db[_0xcef3('0x17b')],{'foreignKey':_0xcef3('0x1ea'),'as':_0xcef3('0x1eb')});db[_0xcef3('0xf4')][_0xcef3('0x122')](db[_0xcef3('0x11')],{'foreignKey':_0xcef3('0x1ec'),'as':_0xcef3('0x1e8')});db[_0xcef3('0xf4')][_0xcef3('0x122')](db[_0xcef3('0x11')],{'foreignKey':_0xcef3('0x1ed'),'as':_0xcef3('0x1ee')});db[_0xcef3('0xf4')][_0xcef3('0x122')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0xcef3('0x1ef')});db[_0xcef3('0xf4')][_0xcef3('0x122')](db['ChatWebsite'],{'foreignKey':_0xcef3('0x1f0'),'as':'ToAccount'});db[_0xcef3('0xf6')][_0xcef3('0x122')](db[_0xcef3('0x50')],{});db['FaxTransferReport']['belongsTo'](db['FaxInteraction'],{});db['FaxTransferReport'][_0xcef3('0x122')](db[_0xcef3('0x4a')],{'foreignKey':'FromFaxAccountId','as':_0xcef3('0x1eb')});db[_0xcef3('0xf6')][_0xcef3('0x122')](db[_0xcef3('0x11')],{'foreignKey':_0xcef3('0x1ec'),'as':_0xcef3('0x1e8')});db[_0xcef3('0xf6')][_0xcef3('0x122')](db[_0xcef3('0x11')],{'foreignKey':_0xcef3('0x1ed'),'as':_0xcef3('0x1ee')});db[_0xcef3('0xf6')][_0xcef3('0x122')](db[_0xcef3('0x51')],{'foreignKey':_0xcef3('0x1f1'),'as':_0xcef3('0x1ef')});db['FaxTransferReport'][_0xcef3('0x122')](db[_0xcef3('0x4a')],{'foreignKey':_0xcef3('0x1f2'),'as':_0xcef3('0x1f3')});db[_0xcef3('0xf7')][_0xcef3('0x122')](db[_0xcef3('0x5f')],{});db['OpenchannelTransferReport'][_0xcef3('0x122')](db[_0xcef3('0x5d')],{});db['OpenchannelTransferReport'][_0xcef3('0x122')](db[_0xcef3('0x59')],{'foreignKey':'FromOpenchannelAccountId','as':_0xcef3('0x1eb')});db[_0xcef3('0xf7')][_0xcef3('0x122')](db[_0xcef3('0x11')],{'foreignKey':_0xcef3('0x1ec'),'as':_0xcef3('0x1e8')});db[_0xcef3('0xf7')][_0xcef3('0x122')](db['User'],{'foreignKey':_0xcef3('0x1ed'),'as':_0xcef3('0x1ee')});db[_0xcef3('0xf7')]['belongsTo'](db[_0xcef3('0x61')],{'foreignKey':_0xcef3('0x1f4'),'as':_0xcef3('0x1ef')});db[_0xcef3('0xf7')][_0xcef3('0x122')](db[_0xcef3('0x59')],{'foreignKey':_0xcef3('0x1f5'),'as':_0xcef3('0x1f3')});db[_0xcef3('0xf8')][_0xcef3('0x122')](db[_0xcef3('0x18a')],{});db[_0xcef3('0xf8')][_0xcef3('0x122')](db[_0xcef3('0x55')],{});db[_0xcef3('0xf8')][_0xcef3('0x122')](db[_0xcef3('0x142')],{'foreignKey':'FromSmsAccountId','as':_0xcef3('0x1eb')});db['SmsTransferReport'][_0xcef3('0x122')](db['User'],{'foreignKey':'FromUserId','as':_0xcef3('0x1e8')});db['SmsTransferReport'][_0xcef3('0x122')](db[_0xcef3('0x11')],{'foreignKey':_0xcef3('0x1ed'),'as':_0xcef3('0x1ee')});db['SmsTransferReport'][_0xcef3('0x122')](db[_0xcef3('0x58')],{'foreignKey':_0xcef3('0x1f6'),'as':_0xcef3('0x1ef')});db[_0xcef3('0xf8')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0xcef3('0x1f7'),'as':_0xcef3('0x1f3')});db[_0xcef3('0xfa')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0xcef3('0x180'),'onDelete':'cascade'});db['CmList'][_0xcef3('0x116')](db['CmCustomField'],{'as':_0xcef3('0x1f8'),'foreignKey':_0xcef3('0x180')});db['CmList'][_0xcef3('0x116')](db[_0xcef3('0x70')],{'as':_0xcef3('0x19e'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x180')});db[_0xcef3('0xfa')][_0xcef3('0x116')](db[_0xcef3('0x75')],{'as':_0xcef3('0x11a'),'foreignKey':_0xcef3('0x180')});db['CmList']['hasMany'](db['CmHopperHistory'],{'as':_0xcef3('0x11b'),'foreignKey':_0xcef3('0x180')});db[_0xcef3('0xfa')][_0xcef3('0x116')](db[_0xcef3('0x78')],{'as':_0xcef3('0x78'),'foreignKey':'ListId'});db[_0xcef3('0xfa')][_0xcef3('0x124')](db[_0xcef3('0x1a')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db['CmList']['belongsToMany'](db[_0xcef3('0x11')],{'as':_0xcef3('0x159'),'through':_0xcef3('0x129')});db['VoicePrefix'][_0xcef3('0x116')](db['VoiceExtension'],{'as':'Extensions','onDelete':_0xcef3('0x115')});db['VoicePrefix'][_0xcef3('0x124')](db[_0xcef3('0x11')],{'as':_0xcef3('0x159'),'through':_0xcef3('0x110')});db[_0xcef3('0x132')][_0xcef3('0x124')](db[_0xcef3('0xe9')],{'through':_0xcef3('0x10f'),'as':'Teams'});db['UserProfile'][_0xcef3('0x116')](db[_0xcef3('0x11')],{'as':_0xcef3('0x177'),'foreignKey':_0xcef3('0x123')});db[_0xcef3('0xfd')][_0xcef3('0x116')](db[_0xcef3('0xff')],{'as':'UserProfileSections','foreignKey':_0xcef3('0x123'),'onDelete':_0xcef3('0x115')});db[_0xcef3('0xff')][_0xcef3('0x116')](db['UserProfileResource'],{'as':'Resources','foreignKey':_0xcef3('0x1f9'),'onDelete':_0xcef3('0x115')});db[_0xcef3('0x101')][_0xcef3('0x116')](db[_0xcef3('0x80')],{'as':_0xcef3('0x16b'),'foreignKey':_0xcef3('0x1fa'),'onDelete':_0xcef3('0x115')});db[_0xcef3('0x101')]['hasMany'](db[_0xcef3('0x16c')],{'as':_0xcef3('0x16d'),'foreignKey':'WhatsappAccountId'});db[_0xcef3('0x101')][_0xcef3('0x116')](db[_0xcef3('0x1fb')],{'as':'Messages','foreignKey':_0xcef3('0x1fa')});db['WhatsappAccount'][_0xcef3('0x116')](db[_0xcef3('0x104')],{'as':_0xcef3('0x182')});db[_0xcef3('0x101')]['hasMany'](db['WhatsappApplication'],{'as':'Applications'});db[_0xcef3('0x101')][_0xcef3('0x122')](db[_0xcef3('0xfa')],{'as':_0xcef3('0x16e'),'foreignKey':_0xcef3('0x180')});db[_0xcef3('0x101')]['belongsTo'](db[_0xcef3('0x85')],{'as':'mandatoryDispositionPause','foreignKey':_0xcef3('0x157')});db[_0xcef3('0x101')][_0xcef3('0x124')](db['User'],{'as':_0xcef3('0x159'),'through':_0xcef3('0x1fc')});db[_0xcef3('0x103')][_0xcef3('0x122')](db[_0xcef3('0x11')],{'onDelete':'restrict'});db[_0xcef3('0x103')][_0xcef3('0x122')](db[_0xcef3('0x10a')],{'onDelete':_0xcef3('0x167')});db['WhatsappApplication']['belongsTo'](db[_0xcef3('0x101')],{'onDelete':_0xcef3('0x167')});db[_0xcef3('0x103')]['belongsTo'](db[_0xcef3('0x84')],{'onDelete':_0xcef3('0x167'),'foreignKey':_0xcef3('0x155')});db[_0xcef3('0x103')][_0xcef3('0x122')](db[_0xcef3('0x8f')],{'onDelete':_0xcef3('0x167'),'foreignKey':_0xcef3('0x184')});db['WhatsappInteraction'][_0xcef3('0x116')](db[_0xcef3('0x1fb')],{'as':_0xcef3('0x15d'),'onDelete':_0xcef3('0x115'),'foreignKey':_0xcef3('0x1fd')});db[_0xcef3('0x104')][_0xcef3('0x122')](db['WhatsappAccount'],{'as':_0xcef3('0x172'),'foreignKey':_0xcef3('0x1fa')});db[_0xcef3('0x104')][_0xcef3('0x122')](db[_0xcef3('0x70')],{'as':_0xcef3('0x163'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0xcef3('0x122')](db['User'],{'as':'Owner','foreignKey':_0xcef3('0x114')});db[_0xcef3('0x104')][_0xcef3('0x124')](db[_0xcef3('0x8f')],{'through':_0xcef3('0x1fe'),'as':_0xcef3('0x174')});db[_0xcef3('0x104')]['belongsToMany'](db[_0xcef3('0x8f')],{'through':_0xcef3('0x1fe'),'as':_0xcef3('0x176')});db[_0xcef3('0x104')]['belongsToMany'](db[_0xcef3('0x11')],{'as':_0xcef3('0x177'),'through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db['WhatsappMessage']['belongsTo'](db['User'],{'as':_0xcef3('0x11')});db['WhatsappMessage']['belongsTo'](db[_0xcef3('0x70')],{'onDelete':_0xcef3('0x115'),'as':_0xcef3('0x163')});db[_0xcef3('0x1fb')][_0xcef3('0x122')](db[_0xcef3('0x104')],{'onDelete':_0xcef3('0x115'),'as':'Interaction','foreignKey':'WhatsappInteractionId'});db[_0xcef3('0x1fb')][_0xcef3('0x122')](db['WhatsappAccount'],{'as':_0xcef3('0x172'),'foreignKey':_0xcef3('0x1fa')});db[_0xcef3('0x106')][_0xcef3('0x122')](db[_0xcef3('0x101')],{});db[_0xcef3('0x106')][_0xcef3('0x122')](db[_0xcef3('0xfa')],{'as':_0xcef3('0x16e'),'foreignKey':_0xcef3('0x180')});db['WhatsappQueueReport'][_0xcef3('0x122')](db[_0xcef3('0x70')],{'as':_0xcef3('0x163'),'foreignKey':'ContactId'});db[_0xcef3('0x106')][_0xcef3('0x122')](db[_0xcef3('0x104')],{});db[_0xcef3('0x106')][_0xcef3('0x122')](db[_0xcef3('0x10a')],{});db[_0xcef3('0x106')][_0xcef3('0x122')](db[_0xcef3('0x1fb')],{});db[_0xcef3('0x106')][_0xcef3('0x122')](db[_0xcef3('0x11')],{});db[_0xcef3('0x108')]['belongsTo'](db[_0xcef3('0x1fb')],{});db[_0xcef3('0x108')]['belongsTo'](db[_0xcef3('0x104')],{});db[_0xcef3('0x108')][_0xcef3('0x122')](db[_0xcef3('0x101')],{'foreignKey':_0xcef3('0x1ff'),'as':_0xcef3('0x1eb')});db[_0xcef3('0x108')][_0xcef3('0x122')](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':_0xcef3('0x1f3')});db['WhatsappTransferReport'][_0xcef3('0x122')](db[_0xcef3('0x10a')],{'foreignKey':_0xcef3('0x200'),'as':_0xcef3('0x1ef')});db['WhatsappTransferReport'][_0xcef3('0x122')](db[_0xcef3('0x11')],{'foreignKey':_0xcef3('0x1ec'),'as':_0xcef3('0x1e8')});db[_0xcef3('0x108')][_0xcef3('0x122')](db[_0xcef3('0x11')],{'foreignKey':_0xcef3('0x1ed'),'as':_0xcef3('0x1ee')});db['WhatsappQueue'][_0xcef3('0x124')](db[_0xcef3('0x11')],{'as':_0xcef3('0x159'),'through':_0xcef3('0x36'),'foreignKey':_0xcef3('0x201')});db[_0xcef3('0x10a')]['belongsToMany'](db[_0xcef3('0xe9')],{'through':_0xcef3('0x1e1'),'as':_0xcef3('0x15a')});db['UserSetting']['belongsTo'](db['User'],{'as':_0xcef3('0x202'),'foreignKey':_0xcef3('0x114'),'onDelete':_0xcef3('0x115'),'hooks':!![]});db[_0xcef3('0x10b')][_0xcef3('0x168')](db[_0xcef3('0x1d9')],{'as':_0xcef3('0x1d9'),'onDelete':_0xcef3('0x167')});db[_0xcef3('0x10b')]['hasOne'](db['MailServerIn'],{'as':_0xcef3('0x169'),'onDelete':_0xcef3('0x167')});db[_0xcef3('0x10b')][_0xcef3('0x168')](db[_0xcef3('0x3a')],{'as':_0xcef3('0x16a'),'onDelete':_0xcef3('0x167')});module[_0xcef3('0x203')]={'db':db,'dbH':dbH};
\ No newline at end of file
index 26ebc2c..a976e1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cbb=['./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','./api/intSalesforceField','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','./api/attachment','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','/api/userNotifications','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','/api/logs','/apidoc','static','root','/www','join','/demo','snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','/index.html','path','./errors','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','./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/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatOfflineMessage','/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/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','./api/trigger','/api/integrations','/api/integrations/reports','/api/analytics/custom_reports'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5cbb,0x19d));var _0xb5cb=function(_0x2e6e68,_0x121d35){_0x2e6e68=_0x2e6e68-0x0;var _0x519059=_0x5cbb[_0x2e6e68];return _0x519059;};'use strict';var path=require(_0xb5cb('0x0'));var express=require('express');var errors=require(_0xb5cb('0x1'));var config=require('./config/environment');var setupLoggers=require(_0xb5cb('0x2'))[_0xb5cb('0x3')];var clientSideLogs=require(_0xb5cb('0x4'));exports[_0xb5cb('0x5')]=function(_0x5e8af5){return setupLoggers(_0x5e8af5)[_0xb5cb('0x6')](function(){_0x5e8af5['use'](_0xb5cb('0x7'),require(_0xb5cb('0x8')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xa'),require(_0xb5cb('0xb')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xc'),require(_0xb5cb('0xd')));_0x5e8af5['use'](_0xb5cb('0xe'),require('./api/voiceExtension'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xf'),require(_0xb5cb('0x10')));_0x5e8af5['use']('/api/voice/queues',require(_0xb5cb('0x11')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x12'),require(_0xb5cb('0x13')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x14'),require('./api/screenRecording'));_0x5e8af5['use'](_0xb5cb('0x15'),require(_0xb5cb('0x16')));_0x5e8af5['use'](_0xb5cb('0x17'),require(_0xb5cb('0x18')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x19'),require(_0xb5cb('0x1a')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x1b'),require(_0xb5cb('0x1c')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x1d'),require(_0xb5cb('0x1e')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x1f'),require(_0xb5cb('0x20')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x21'),require(_0xb5cb('0x22')));_0x5e8af5['use'](_0xb5cb('0x23'),require('./api/trunk'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x24'),require(_0xb5cb('0x25')));_0x5e8af5['use'](_0xb5cb('0x26'),require(_0xb5cb('0x27')));_0x5e8af5['use'](_0xb5cb('0x28'),require(_0xb5cb('0x29')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x2a'),require(_0xb5cb('0x2b')));_0x5e8af5['use'](_0xb5cb('0x2c'),require(_0xb5cb('0x2d')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x2e'),require(_0xb5cb('0x2f')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x30'),require(_0xb5cb('0x31')));_0x5e8af5[_0xb5cb('0x9')]('/api/mail/applications',require('./api/mailApplication'));_0x5e8af5[_0xb5cb('0x9')]('/api/mail/reports/queue',require(_0xb5cb('0x32')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x33'),require(_0xb5cb('0x34')));_0x5e8af5['use'](_0xb5cb('0x35'),require(_0xb5cb('0x36')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x37'),require(_0xb5cb('0x38')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x39'),require(_0xb5cb('0x3a')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x3b'),require(_0xb5cb('0x3c')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x3d'),require(_0xb5cb('0x3e')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x3f'),require(_0xb5cb('0x40')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x41'),require('./api/faxQueueReport'));_0x5e8af5['use'](_0xb5cb('0x42'),require('./api/smsAccount'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x43'),require('./api/smsApplication'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x44'),require(_0xb5cb('0x45')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x46'),require(_0xb5cb('0x47')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x48'),require('./api/smsQueue'));_0x5e8af5[_0xb5cb('0x9')]('/api/openchannel/accounts',require(_0xb5cb('0x49')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x4a'),require(_0xb5cb('0x4b')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x4c'),require(_0xb5cb('0x4d')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x4e'),require(_0xb5cb('0x4f')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x50'),require(_0xb5cb('0x51')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x52'),require(_0xb5cb('0x53')));_0x5e8af5['use'](_0xb5cb('0x54'),require(_0xb5cb('0x55')));_0x5e8af5[_0xb5cb('0x9')]('/api/chat/applications',require(_0xb5cb('0x56')));_0x5e8af5['use']('/api/chat/interactions',require(_0xb5cb('0x57')));_0x5e8af5['use'](_0xb5cb('0x58'),require('./api/chatMessage'));_0x5e8af5['use']('/api/chat/offline_messages',require(_0xb5cb('0x59')));_0x5e8af5['use']('/api/chat/queues',require('./api/chatQueue'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x5a'),require(_0xb5cb('0x5b')));_0x5e8af5[_0xb5cb('0x9')]('/api/chat/proactive_actions',require(_0xb5cb('0x5c')));_0x5e8af5['use'](_0xb5cb('0x5d'),require(_0xb5cb('0x5e')));_0x5e8af5['use'](_0xb5cb('0x5f'),require(_0xb5cb('0x60')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x61'),require(_0xb5cb('0x62')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x63'),require(_0xb5cb('0x64')));_0x5e8af5['use']('/api/cm/hopper_final',require(_0xb5cb('0x65')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x66'),require(_0xb5cb('0x67')));_0x5e8af5[_0xb5cb('0x9')]('/api/cm/custom_fields',require(_0xb5cb('0x68')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x69'),require('./api/action'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x6a'),require(_0xb5cb('0x6b')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x6c'),require(_0xb5cb('0x6d')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x6e'),require('./api/disposition'));_0x5e8af5['use'](_0xb5cb('0x6f'),require(_0xb5cb('0x70')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x71'),require(_0xb5cb('0x72')));_0x5e8af5['use'](_0xb5cb('0x73'),require(_0xb5cb('0x74')));_0x5e8af5['use'](_0xb5cb('0x75'),require('./api/cdr'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x76'),require(_0xb5cb('0x77')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x78'),require(_0xb5cb('0x79')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x7a'),require('./api/sound'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x7b'),require(_0xb5cb('0x7c')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x7d'),require(_0xb5cb('0x7e')));_0x5e8af5['use']('/api/cm_contact_has_items',require(_0xb5cb('0x7f')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x80'),require(_0xb5cb('0x81')));_0x5e8af5[_0xb5cb('0x9')]('/api/templates',require(_0xb5cb('0x82')));_0x5e8af5['use']('/api/triggers',require(_0xb5cb('0x83')));_0x5e8af5[_0xb5cb('0x9')]('/api/variables',require('./api/variable'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x84'),require('./api/integration'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x85'),require('./api/integrationReport'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x86'),require(_0xb5cb('0x87')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x88'),require(_0xb5cb('0x89')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x8a'),require('./api/analyticExtractedReport'));_0x5e8af5[_0xb5cb('0x9')]('/api/analytics/metrics',require(_0xb5cb('0x8b')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x8c'),require('./api/analyticFieldReport'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x8d'),require(_0xb5cb('0x8e')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x8f'),require(_0xb5cb('0x90')));_0x5e8af5[_0xb5cb('0x9')]('/api/integrations/salesforce/configurations',require(_0xb5cb('0x91')));_0x5e8af5[_0xb5cb('0x9')]('/api/integrations/salesforce/fields',require(_0xb5cb('0x92')));_0x5e8af5[_0xb5cb('0x9')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x5e8af5[_0xb5cb('0x9')]('/api/integrations/sugarcrm/configurations',require(_0xb5cb('0x93')));_0x5e8af5['use'](_0xb5cb('0x94'),require(_0xb5cb('0x95')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x96'),require(_0xb5cb('0x97')));_0x5e8af5['use']('/api/integrations/desk/configurations',require(_0xb5cb('0x98')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x99'),require('./api/intDeskField'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x9a'),require(_0xb5cb('0x9b')));_0x5e8af5[_0xb5cb('0x9')]('/api/integrations/zoho/configurations',require(_0xb5cb('0x9c')));_0x5e8af5[_0xb5cb('0x9')]('/api/integrations/zoho/fields',require(_0xb5cb('0x9d')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x9e'),require(_0xb5cb('0x9f')));_0x5e8af5[_0xb5cb('0x9')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xa0'),require(_0xb5cb('0xa1')));_0x5e8af5['use'](_0xb5cb('0xa2'),require(_0xb5cb('0xa3')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xa4'),require(_0xb5cb('0xa5')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xa6'),require(_0xb5cb('0xa7')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xa8'),require('./api/intVtigerAccount'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xa9'),require(_0xb5cb('0xaa')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xab'),require(_0xb5cb('0xac')));_0x5e8af5[_0xb5cb('0x9')]('/api/integrations/servicenow/accounts',require(_0xb5cb('0xad')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xae'),require('./api/intServicenowConfiguration'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xaf'),require(_0xb5cb('0xb0')));_0x5e8af5[_0xb5cb('0x9')]('/api/integrations/dynamics365/accounts',require(_0xb5cb('0xb1')));_0x5e8af5[_0xb5cb('0x9')]('/api/integrations/dynamics365/configurations',require(_0xb5cb('0xb2')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xb3'),require('./api/intDynamics365Field'));_0x5e8af5[_0xb5cb('0x9')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x5e8af5['use'](_0xb5cb('0xb4'),require(_0xb5cb('0xb5')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xb6'),require(_0xb5cb('0xb7')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xb8'),require(_0xb5cb('0xb9')));_0x5e8af5['use'](_0xb5cb('0xba'),require(_0xb5cb('0xbb')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xbc'),require(_0xb5cb('0xbd')));_0x5e8af5[_0xb5cb('0x9')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x5e8af5[_0xb5cb('0x9')]('/api/jscripty/questions/reports',require(_0xb5cb('0xbe')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xbf'),require(_0xb5cb('0xc0')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xc1'),require('./api/smsQueueReport'));_0x5e8af5[_0xb5cb('0x9')]('/api/square/reports',require('./api/squareReport'));_0x5e8af5[_0xb5cb('0x9')]('/api/square/details/reports',require(_0xb5cb('0xc2')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xc3'),require(_0xb5cb('0xc4')));_0x5e8af5['use'](_0xb5cb('0xc5'),require(_0xb5cb('0xc6')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xc7'),require('./api/squareOdbc'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xc8'),require(_0xb5cb('0xc9')));_0x5e8af5[_0xb5cb('0x9')]('/api/square/recordings',require(_0xb5cb('0xca')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xcb'),require(_0xb5cb('0xcc')));_0x5e8af5['use'](_0xb5cb('0xcd'),require(_0xb5cb('0xce')));_0x5e8af5['use']('/api/license',require(_0xb5cb('0xcf')));_0x5e8af5['use'](_0xb5cb('0xd0'),require(_0xb5cb('0xd1')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xd2'),require(_0xb5cb('0xd3')));_0x5e8af5['use']('/api/attachments',require(_0xb5cb('0xd4')));_0x5e8af5[_0xb5cb('0x9')]('/api/plugins',require(_0xb5cb('0xd5')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xd6'),require('./api/mailTransferReport'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xd7'),require('./api/chatTransferReport'));_0x5e8af5[_0xb5cb('0x9')]('/api/fax/reports/transfer',require(_0xb5cb('0xd8')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xd9'),require(_0xb5cb('0xda')));_0x5e8af5['use'](_0xb5cb('0xdb'),require(_0xb5cb('0xdc')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xdd'),require(_0xb5cb('0xde')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xdf'),require(_0xb5cb('0xe0')));_0x5e8af5['use']('/api/userProfiles',require(_0xb5cb('0xe1')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xe2'),require('./api/userProfileSection'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xe3'),require('./api/userProfileResource'));_0x5e8af5['use'](_0xb5cb('0xe4'),require('./api/userNotification'));_0x5e8af5['use']('/api/whatsapp/accounts',require(_0xb5cb('0xe5')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xe6'),require('./api/whatsappApplication'));_0x5e8af5['use'](_0xb5cb('0xe7'),require(_0xb5cb('0xe8')));_0x5e8af5[_0xb5cb('0x9')]('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xe9'),require(_0xb5cb('0xea')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xeb'),require('./api/whatsappTransferReport'));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xec'),require(_0xb5cb('0xed')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xee'),require(_0xb5cb('0xef')));_0x5e8af5['use']('/api/realtime',require(_0xb5cb('0xf0')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xf1'),require(_0xb5cb('0xf2')));_0x5e8af5['use'](_0xb5cb('0xf3'),require(_0xb5cb('0xf4')));_0x5e8af5['use'](_0xb5cb('0xf5'),require(_0xb5cb('0xf6')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xf7'),require(_0xb5cb('0xf8')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xf9'),require(_0xb5cb('0xfa')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0xfb'),require(_0xb5cb('0xfc')));_0x5e8af5['use'](_0xb5cb('0xfd'),require(_0xb5cb('0xfe')));_0x5e8af5[_0xb5cb('0x9')]('/api/system',require(_0xb5cb('0xff')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x100'),require(_0xb5cb('0x101')));_0x5e8af5['use'](_0xb5cb('0x102'),require('./api/webbar'));_0x5e8af5['use'](_0xb5cb('0x103'),clientSideLogs);_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x104'),express[_0xb5cb('0x105')](path['join'](config[_0xb5cb('0x106')],'/apidoc')));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x107'),express[_0xb5cb('0x105')](path[_0xb5cb('0x108')](config[_0xb5cb('0x106')],_0xb5cb('0x107'))));_0x5e8af5['use'](_0xb5cb('0x109'),express[_0xb5cb('0x105')](path['join'](config[_0xb5cb('0x106')],_0xb5cb('0x109'))));_0x5e8af5['use']('/snippet',express[_0xb5cb('0x105')](path[_0xb5cb('0x108')](config['root'],_0xb5cb('0x10a'),_0xb5cb('0x10b'))));_0x5e8af5[_0xb5cb('0x9')](_0xb5cb('0x10c'),express[_0xb5cb('0x105')](path['join'](config[_0xb5cb('0x106')],_0xb5cb('0x10d'))));_0x5e8af5[_0xb5cb('0x10e')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xb5cb('0x10f')](errors[0x194]);_0x5e8af5[_0xb5cb('0x10e')]('/*')['get'](function(_0x2fad6c,_0x2d063c){_0x2d063c[_0xb5cb('0x110')](path['resolve'](_0x5e8af5[_0xb5cb('0x10f')]('appPath')+_0xb5cb('0x111')));});return _0x5e8af5;});};
\ No newline at end of file
+var _0xc39b=['./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','/api/webbar','/api/logs','/apidoc','join','root','/www','/demo','static','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','path','./config/environment','./utils/client-side-logger','./api/client-side-logs','default','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','./api/faxAccount','/api/fax/applications','/api/fax/interactions','/api/fax/messages','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/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/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','/api/cm/contacts','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmCustomField','/api/actions','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmHopperAdditionalPhone','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','./api/intServicenowAccount','/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/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix'];(function(_0x1d030b,_0x45e6f3){var _0x219309=function(_0x2ee4e8){while(--_0x2ee4e8){_0x1d030b['push'](_0x1d030b['shift']());}};_0x219309(++_0x45e6f3);}(_0xc39b,0x12e));var _0xbc39=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xc39b[_0x209941];return _0x1e8729;};'use strict';var path=require(_0xbc39('0x0'));var express=require('express');var errors=require('./errors');var config=require(_0xbc39('0x1'));var setupLoggers=require(_0xbc39('0x2'))['setupLoggers'];var clientSideLogs=require(_0xbc39('0x3'));exports[_0xbc39('0x4')]=function(_0x2c43b5){return setupLoggers(_0x2c43b5)['then'](function(){_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x6'),require(_0xbc39('0x7')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x8'),require(_0xbc39('0x9')));_0x2c43b5[_0xbc39('0x5')]('/api/voice/contexts',require(_0xbc39('0xa')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xb'),require(_0xbc39('0xc')));_0x2c43b5['use'](_0xbc39('0xd'),require('./api/voiceMusicOnHold'));_0x2c43b5['use'](_0xbc39('0xe'),require(_0xbc39('0xf')));_0x2c43b5[_0xbc39('0x5')]('/api/voice/recordings',require(_0xbc39('0x10')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x11'),require(_0xbc39('0x12')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x13'),require('./api/voiceMail'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x14'),require(_0xbc39('0x15')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x16'),require(_0xbc39('0x17')));_0x2c43b5['use']('/api/voice/dials/reports',require(_0xbc39('0x18')));_0x2c43b5[_0xbc39('0x5')]('/api/voice/agents/reports',require(_0xbc39('0x19')));_0x2c43b5['use'](_0xbc39('0x1a'),require(_0xbc39('0x1b')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x1c'),require('./api/memberReport'));_0x2c43b5[_0xbc39('0x5')]('/api/trunks',require(_0xbc39('0x1d')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x1e'),require(_0xbc39('0x1f')));_0x2c43b5['use']('/api/mail/out_servers',require(_0xbc39('0x20')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x21'),require(_0xbc39('0x22')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x23'),require(_0xbc39('0x24')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x25'),require(_0xbc39('0x26')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x27'),require(_0xbc39('0x28')));_0x2c43b5[_0xbc39('0x5')]('/api/mail/messages',require(_0xbc39('0x29')));_0x2c43b5[_0xbc39('0x5')]('/api/mail/applications',require(_0xbc39('0x2a')));_0x2c43b5['use'](_0xbc39('0x2b'),require(_0xbc39('0x2c')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x2d'),require(_0xbc39('0x2e')));_0x2c43b5['use']('/api/dashboards/items',require(_0xbc39('0x2f')));_0x2c43b5[_0xbc39('0x5')]('/api/fax/accounts',require(_0xbc39('0x30')));_0x2c43b5['use'](_0xbc39('0x31'),require('./api/faxApplication'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x32'),require('./api/faxInteraction'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x33'),require('./api/faxMessage'));_0x2c43b5['use']('/api/fax/queues',require(_0xbc39('0x34')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x35'),require(_0xbc39('0x36')));_0x2c43b5['use'](_0xbc39('0x37'),require(_0xbc39('0x38')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x39'),require(_0xbc39('0x3a')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x3b'),require(_0xbc39('0x3c')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x3d'),require(_0xbc39('0x3e')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x3f'),require(_0xbc39('0x40')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x41'),require('./api/openchannelAccount'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x42'),require(_0xbc39('0x43')));_0x2c43b5[_0xbc39('0x5')]('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x44'),require('./api/openchannelMessage'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x45'),require(_0xbc39('0x46')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x47'),require(_0xbc39('0x48')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x49'),require(_0xbc39('0x4a')));_0x2c43b5['use'](_0xbc39('0x4b'),require(_0xbc39('0x4c')));_0x2c43b5[_0xbc39('0x5')]('/api/chat/interactions',require(_0xbc39('0x4d')));_0x2c43b5['use']('/api/chat/messages',require(_0xbc39('0x4e')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x4f'),require(_0xbc39('0x50')));_0x2c43b5[_0xbc39('0x5')]('/api/chat/queues',require(_0xbc39('0x51')));_0x2c43b5[_0xbc39('0x5')]('/api/chat/groups',require(_0xbc39('0x52')));_0x2c43b5['use'](_0xbc39('0x53'),require('./api/chatProactiveAction'));_0x2c43b5[_0xbc39('0x5')]('/api/cm/companies',require('./api/cmCompany'));_0x2c43b5['use'](_0xbc39('0x54'),require('./api/cmContact'));_0x2c43b5[_0xbc39('0x5')]('/api/cm/hopper',require(_0xbc39('0x55')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x56'),require(_0xbc39('0x57')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x58'),require(_0xbc39('0x59')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x5a'),require('./api/cmHopperHistory'));_0x2c43b5[_0xbc39('0x5')]('/api/cm/custom_fields',require(_0xbc39('0x5b')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x5c'),require('./api/action'));_0x2c43b5['use'](_0xbc39('0x5d'),require('./api/automation'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x5e'),require(_0xbc39('0x5f')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x60'),require(_0xbc39('0x61')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x62'),require(_0xbc39('0x63')));_0x2c43b5[_0xbc39('0x5')]('/api/intervals',require(_0xbc39('0x64')));_0x2c43b5['use'](_0xbc39('0x65'),require('./api/pause'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x66'),require(_0xbc39('0x67')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x68'),require(_0xbc39('0x69')));_0x2c43b5['use'](_0xbc39('0x6a'),require('./api/schedule'));_0x2c43b5[_0xbc39('0x5')]('/api/sounds',require(_0xbc39('0x6b')));_0x2c43b5['use'](_0xbc39('0x6c'),require(_0xbc39('0x6d')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x6e'),require(_0xbc39('0x6f')));_0x2c43b5[_0xbc39('0x5')]('/api/cm_contact_has_items',require('./api/cmContactHasItem'));_0x2c43b5[_0xbc39('0x5')]('/api/cm_hopper_additional_phones',require(_0xbc39('0x70')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x71'),require('./api/template'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x72'),require(_0xbc39('0x73')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x74'),require(_0xbc39('0x75')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x76'),require('./api/integration'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x77'),require('./api/integrationReport'));_0x2c43b5[_0xbc39('0x5')]('/api/analytics/custom_reports',require(_0xbc39('0x78')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x79'),require(_0xbc39('0x7a')));_0x2c43b5[_0xbc39('0x5')]('/api/analytics/extracted_reports',require(_0xbc39('0x7b')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x7c'),require(_0xbc39('0x7d')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x7e'),require(_0xbc39('0x7f')));_0x2c43b5['use']('/api/analytics/tree_reports',require(_0xbc39('0x80')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x81'),require(_0xbc39('0x82')));_0x2c43b5[_0xbc39('0x5')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x83'),require(_0xbc39('0x84')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x85'),require(_0xbc39('0x86')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x87'),require(_0xbc39('0x88')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x89'),require(_0xbc39('0x8a')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x8b'),require(_0xbc39('0x8c')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x8d'),require(_0xbc39('0x8e')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x8f'),require(_0xbc39('0x90')));_0x2c43b5[_0xbc39('0x5')]('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x2c43b5['use'](_0xbc39('0x91'),require(_0xbc39('0x92')));_0x2c43b5[_0xbc39('0x5')]('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x93'),require(_0xbc39('0x94')));_0x2c43b5['use']('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x2c43b5['use'](_0xbc39('0x95'),require('./api/intZendeskField'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x96'),require(_0xbc39('0x97')));_0x2c43b5[_0xbc39('0x5')]('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x2c43b5[_0xbc39('0x5')]('/api/integrations/freshdesk/fields',require(_0xbc39('0x98')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x99'),require('./api/intVtigerAccount'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0x9a'),require(_0xbc39('0x9b')));_0x2c43b5['use']('/api/integrations/vtiger/fields',require(_0xbc39('0x9c')));_0x2c43b5[_0xbc39('0x5')]('/api/integrations/servicenow/accounts',require(_0xbc39('0x9d')));_0x2c43b5['use'](_0xbc39('0x9e'),require(_0xbc39('0x9f')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xa0'),require(_0xbc39('0xa1')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xa2'),require(_0xbc39('0xa3')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xa4'),require(_0xbc39('0xa5')));_0x2c43b5['use'](_0xbc39('0xa6'),require(_0xbc39('0xa7')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xa8'),require('./api/intFreshsalesAccount'));_0x2c43b5[_0xbc39('0x5')]('/api/integrations/freshsales/configurations',require(_0xbc39('0xa9')));_0x2c43b5['use'](_0xbc39('0xaa'),require('./api/intFreshsalesField'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xab'),require('./api/network'));_0x2c43b5['use']('/api/chat/reports/queue',require(_0xbc39('0xac')));_0x2c43b5['use']('/api/chat/internal/messages',require(_0xbc39('0xad')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xae'),require('./api/jscriptyAnswerReport'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xaf'),require('./api/jscriptyQuestionReport'));_0x2c43b5[_0xbc39('0x5')]('/api/jscripty/sessions/reports',require(_0xbc39('0xb0')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xb1'),require('./api/smsQueueReport'));_0x2c43b5['use'](_0xbc39('0xb2'),require(_0xbc39('0xb3')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xb4'),require(_0xbc39('0xb5')));_0x2c43b5['use']('/api/jscripty/projects',require(_0xbc39('0xb6')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xb7'),require('./api/setting'));_0x2c43b5['use'](_0xbc39('0xb8'),require(_0xbc39('0xb9')));_0x2c43b5[_0xbc39('0x5')]('/api/square/projects',require(_0xbc39('0xba')));_0x2c43b5['use'](_0xbc39('0xbb'),require(_0xbc39('0xbc')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xbd'),require('./api/squareMessage'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xbe'),require('./api/team'));_0x2c43b5['use'](_0xbc39('0xbf'),require(_0xbc39('0xc0')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xc1'),require(_0xbc39('0xc2')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xc3'),require('./api/migration'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xc4'),require('./api/attachment'));_0x2c43b5[_0xbc39('0x5')]('/api/plugins',require('./api/plugin'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xc5'),require(_0xbc39('0xc6')));_0x2c43b5['use'](_0xbc39('0xc7'),require(_0xbc39('0xc8')));_0x2c43b5['use'](_0xbc39('0xc9'),require('./api/faxTransferReport'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xca'),require('./api/openchannelTransferReport'));_0x2c43b5['use'](_0xbc39('0xcb'),require(_0xbc39('0xcc')));_0x2c43b5[_0xbc39('0x5')]('/api/cm/lists',require(_0xbc39('0xcd')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xce'),require(_0xbc39('0xcf')));_0x2c43b5[_0xbc39('0x5')]('/api/userProfiles',require(_0xbc39('0xd0')));_0x2c43b5['use']('/api/userProfile/sections',require(_0xbc39('0xd1')));_0x2c43b5['use'](_0xbc39('0xd2'),require(_0xbc39('0xd3')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xd4'),require(_0xbc39('0xd5')));_0x2c43b5[_0xbc39('0x5')]('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x2c43b5[_0xbc39('0x5')]('/api/whatsapp/applications',require(_0xbc39('0xd6')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xd7'),require(_0xbc39('0xd8')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xd9'),require('./api/whatsappMessage'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xda'),require(_0xbc39('0xdb')));_0x2c43b5[_0xbc39('0x5')]('/api/whatsapp/reports/transfer',require(_0xbc39('0xdc')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xdd'),require(_0xbc39('0xde')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xdf'),require(_0xbc39('0xe0')));_0x2c43b5[_0xbc39('0x5')]('/api/realtime',require('./api/realtime'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xe1'),require(_0xbc39('0xe2')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xe3'),require('./api/authLocal'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xe4'),require(_0xbc39('0xe5')));_0x2c43b5['use'](_0xbc39('0xe6'),require(_0xbc39('0xe7')));_0x2c43b5[_0xbc39('0x5')]('/api/jira',require(_0xbc39('0xe8')));_0x2c43b5['use']('/api/rpc',require(_0xbc39('0xe9')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xea'),require(_0xbc39('0xeb')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xec'),require(_0xbc39('0xed')));_0x2c43b5[_0xbc39('0x5')]('/api/pm2',require(_0xbc39('0xee')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xef'),require('./api/webbar'));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xf0'),clientSideLogs);_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xf1'),express['static'](path[_0xbc39('0xf2')](config[_0xbc39('0xf3')],_0xbc39('0xf1'))));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xf4'),express['static'](path['join'](config[_0xbc39('0xf3')],_0xbc39('0xf4'))));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xf5'),express['static'](path[_0xbc39('0xf2')](config[_0xbc39('0xf3')],_0xbc39('0xf5'))));_0x2c43b5['use']('/snippet',express[_0xbc39('0xf6')](path[_0xbc39('0xf2')](config['root'],'snippet','3.0.0')));_0x2c43b5[_0xbc39('0x5')](_0xbc39('0xf7'),express[_0xbc39('0xf6')](path['join'](config[_0xbc39('0xf3')],_0xbc39('0xf8'))));_0x2c43b5[_0xbc39('0xf9')](_0xbc39('0xfa'))[_0xbc39('0xfb')](errors[0x194]);_0x2c43b5[_0xbc39('0xf9')]('/*')['get'](function(_0x1aca04,_0x59ffa3){_0x59ffa3['sendFile'](path[_0xbc39('0xfc')](_0x2c43b5[_0xbc39('0xfb')](_0xbc39('0xfd'))+_0xbc39('0xfe')));});return _0x2c43b5;});};
\ No newline at end of file
index 1f96e2b..4dbd646 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x873a=['../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','port','rpc','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/user/user.rpc','../api/voiceExtension/voiceExtension.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/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc'];(function(_0x4f856c,_0x19a07e){var _0xbe2ce=function(_0x2aa5ab){while(--_0x2aa5ab){_0x4f856c['push'](_0x4f856c['shift']());}};_0xbe2ce(++_0x19a07e);}(_0x873a,0x1c2));var _0xa873=function(_0x3108c0,_0x2c877d){_0x3108c0=_0x3108c0-0x0;var _0x3c7533=_0x873a[_0x3108c0];return _0x3c7533;};'use strict';var jayson=require(_0xa873('0x0'));var _=require(_0xa873('0x1'));var config=require(_0xa873('0x2'));exports['listen']=function(){return new Promise(function(_0x1de6be,_0x5733ee){var _0x52c086={};_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x4')));_0x52c086=_['merge'](_0x52c086,require(_0xa873('0x5')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/voiceQueue/voiceQueue.rpc'));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/voiceRecording/voiceRecording.rpc'));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x6')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x7')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x8')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x9')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0xa')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/trunk/trunk.rpc'));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x52c086=_['merge'](_0x52c086,require(_0xa873('0xb')));_0x52c086=_['merge'](_0x52c086,require(_0xa873('0xc')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/mailQueue/mailQueue.rpc'));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0xd')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/mailMessage/mailMessage.rpc'));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0xe')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0xf')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/faxApplication/faxApplication.rpc'));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/faxInteraction/faxInteraction.rpc'));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/faxMessage/faxMessage.rpc'));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x10')));_0x52c086=_['merge'](_0x52c086,require(_0xa873('0x11')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x12')));_0x52c086=_['merge'](_0x52c086,require(_0xa873('0x13')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x14')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x15')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x16')));_0x52c086=_['merge'](_0x52c086,require(_0xa873('0x17')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x18')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x19')));_0x52c086=_['merge'](_0x52c086,require(_0xa873('0x1a')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/chatInteraction/chatInteraction.rpc'));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/chatMessage/chatMessage.rpc'));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x1b')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/cmContact/cmContact.rpc'));_0x52c086=_['merge'](_0x52c086,require(_0xa873('0x1c')));_0x52c086=_['merge'](_0x52c086,require(_0xa873('0x1d')));_0x52c086=_['merge'](_0x52c086,require(_0xa873('0x1e')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x1f')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x20')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x21')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x22')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x23')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x24')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x25')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x26')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x27')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x28')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x29')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x2a')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x2b')));_0x52c086=_['merge'](_0x52c086,require(_0xa873('0x2c')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x2d')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x2e')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x2f')));_0x52c086=_['merge'](_0x52c086,require(_0xa873('0x30')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x31')));_0x52c086=_['merge'](_0x52c086,require(_0xa873('0x32')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x33')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x34')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/setting/setting.rpc'));_0x52c086=_['merge'](_0x52c086,require('../api/squareOdbc/squareOdbc.rpc'));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x35')));_0x52c086=_['merge'](_0x52c086,require(_0xa873('0x36')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x37')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x38')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x39')));_0x52c086=_['merge'](_0x52c086,require(_0xa873('0x3a')));_0x52c086=_['merge'](_0x52c086,require(_0xa873('0x3b')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x3c')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x52c086=_[_0xa873('0x3')](_0x52c086,require(_0xa873('0x3d')));_0x52c086=_[_0xa873('0x3')](_0x52c086,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x569591=jayson[_0xa873('0x3e')](_0x52c086)[_0xa873('0x3f')]();var _0x3e15d9=config['rpc'][_0xa873('0x40')]||config[_0xa873('0x40')]+0x1;var _0xe2110c=config[_0xa873('0x41')]['ip']||'localhost';_0x569591['on'](_0xa873('0x42'),function(_0x2493e3){return _0x5733ee(_0x2493e3);});_0x569591[_0xa873('0x43')](_0x3e15d9,_0xe2110c,function(){console[_0xa873('0x44')](_0xa873('0x45'),_0xe2110c,_0x3e15d9);require(_0xa873('0x46'))[_0xa873('0x47')]();return _0x1de6be(_0xa873('0x48')+_0xe2110c+':'+_0x3e15d9);});});};
\ No newline at end of file
+var _0x2149=['../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','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/userVoiceQueueRt/userVoiceQueueRt.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/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x2149,0x1e3));var _0x9214=function(_0x5deb16,_0x366e7f){_0x5deb16=_0x5deb16-0x0;var _0x5ce816=_0x2149[_0x5deb16];return _0x5ce816;};'use strict';var jayson=require(_0x9214('0x0'));var _=require(_0x9214('0x1'));var config=require(_0x9214('0x2'));exports[_0x9214('0x3')]=function(){return new Promise(function(_0x406794,_0x59188b){var _0x33c05b={};_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require('../api/user/user.rpc'));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x5')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x6')));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0x7')));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0x8')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0x9')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require('../api/memberReport/memberReport.rpc'));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0xa')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0xb')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0xc')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0xd')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0xe')));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0xf')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x10')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x11')));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0x12')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x13')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x14')));_0x33c05b=_['merge'](_0x33c05b,require('../api/faxInteraction/faxInteraction.rpc'));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require('../api/faxMessage/faxMessage.rpc'));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x15')));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0x16')));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0x17')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x18')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require('../api/smsMessage/smsMessage.rpc'));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x19')));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0x1a')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x1b')));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0x1c')));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0x1d')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x1e')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require('../api/chatQueue/chatQueue.rpc'));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0x1f')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x20')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x21')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x22')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x23')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x24')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x25')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x26')));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0x27')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x28')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require('../api/template/template.rpc'));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x29')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x2a')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x2b')));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0x2c')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x2d')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x2e')));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0x2f')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0x30')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x31')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x32')));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0x33')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x34')));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0x35')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x36')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require('../api/setting/setting.rpc'));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x37')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require('../api/squareProject/squareProject.rpc'));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x38')));_0x33c05b=_['merge'](_0x33c05b,require('../api/squareMessage/squareMessage.rpc'));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x39')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x3a')));_0x33c05b=_['merge'](_0x33c05b,require(_0x9214('0x3b')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x3c')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x3d')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x3e')));_0x33c05b=_[_0x9214('0x4')](_0x33c05b,require(_0x9214('0x3f')));var _0x320a40=jayson[_0x9214('0x40')](_0x33c05b)[_0x9214('0x41')]();var _0xb4c4eb=config['rpc']['port']||config[_0x9214('0x42')]+0x1;var _0x3e73c4=config[_0x9214('0x43')]['ip']||_0x9214('0x44');_0x320a40['on']('error',function(_0x2eeb5a){return _0x59188b(_0x2eeb5a);});_0x320a40['listen'](_0xb4c4eb,_0x3e73c4,function(){console[_0x9214('0x45')](_0x9214('0x46'),_0x3e73c4,_0xb4c4eb);require(_0x9214('0x47'))[_0x9214('0x48')]();return _0x406794(_0x9214('0x49')+_0x3e73c4+':'+_0xb4c4eb);});});};
\ No newline at end of file
index a65c072..949d5bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x475e=['headers','ready','toLowerCase','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','replace','result=','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','function','write','prototype','sync','answer','sendRequest','getData','beep','format','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setPriority','SET\x20PRIORITY\x20%s','hangup','HANGUP','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','util','./reply','call','setEncoding','setTimeout'];(function(_0x64aff8,_0x106082){var _0x5488a3=function(_0x36969c){while(--_0x36969c){_0x64aff8['push'](_0x64aff8['shift']());}};_0x5488a3(++_0x106082);}(_0x475e,0x8b));var _0xe475=function(_0x5da457,_0x5c9db1){_0x5da457=_0x5da457-0x0;var _0x5c8b02=_0x475e[_0x5da457];return _0x5c8b02;};'use strict';var util=require(_0xe475('0x0'));var _=require('lodash');var EventEmitter=require('events')['EventEmitter'];var AGIReply=require(_0xe475('0x1'));var AGIError=require('./error');function AGIChannel(_0x11bc3b){var _0xa6ef86=this,_0x164f02=new AGIReply(),_0x2dfec4=![],_0x154ed3={};EventEmitter[_0xe475('0x2')](_0xa6ef86);_0x11bc3b[_0xe475('0x3')]('utf8');_0x11bc3b[_0xe475('0x4')](0x8*0x3c*0x3c*0x3e8);_0x164f02[_0xe475('0x3')]('utf8');_0x164f02['on'](_0xe475('0x5'),function(_0x24e903){for(var _0x15ce33 in _0x24e903){_0xa6ef86[_0x15ce33]=_0x24e903[_0x15ce33];}_0xa6ef86['emit'](_0xe475('0x6'));});_0x164f02['on']('line',function(_0x4d0ad6){if(_0x4d0ad6[_0xe475('0x7')]()=='hangup'){_0xa6ef86[_0xe475('0x8')]('hangup');return;}if(_0x4d0ad6[_0xe475('0x9')](0x0,0xb)==_0xe475('0xa')){_0x2dfec4=!![];}if(_0x2dfec4){_0x154ed3['rx']+=_0x4d0ad6+'\x0a';if(_0x4d0ad6[_0xe475('0xb')](_0xe475('0xc'))!=-0x1){_0x2dfec4=![];}}else{_0x154ed3['rx']=_0x4d0ad6;}if(_0x2dfec4){return;}if(typeof _0x154ed3['cb']=='function'){var _0x33d7b7=_0x154ed3['rx'][_0xe475('0x9')](0x0,0x3),_0x2fa035=null,_0x17fc78=null;_0x33d7b7=parseInt(_0x33d7b7);if(isNaN(_0x33d7b7)){_0x154ed3['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xe475('0xd')});return;}if(_0x33d7b7!=0xc8){_0x154ed3['cb'](null,{'code':_0x33d7b7,'result':-0x1,'extra':'KO'});return;}_0x2fa035=_0x154ed3['rx'][_0xe475('0x9')](0x4)[_0xe475('0xe')](_0xe475('0xf'),'');if(_0x2fa035['indexOf']('\x20')!=-0x1){_0x2fa035=_0x2fa035['substr'](0x0,_0x2fa035['indexOf']('\x20'));}if(_[_0xe475('0x10')](_0x2fa035,'-1')){_0x2fa035=parseInt(_0x2fa035);}_0x17fc78=_0x154ed3['rx']['split']('\x20');if(_0x17fc78['length']==0x3){_0x17fc78=_0x17fc78[0x2][_0xe475('0x9')](0x1,_0x17fc78[0x2][_0xe475('0x11')]-0x1);}else if(_0x17fc78[_0xe475('0x11')]>0x3){var _0x15d3b6=/\((.+)\)/;var _0x597d5e=_0x154ed3['rx'][_0xe475('0x12')](_0x15d3b6);if(_0x597d5e){_0x17fc78=_0x597d5e[0x1];}else{_0x17fc78=null;}}else{_0x17fc78=null;}_0x154ed3['cb'](null,{'code':_0x33d7b7,'result':_0x2fa035,'extra':_0x17fc78});}});_0x11bc3b['on']('error',function(_0x5a8929){_0xa6ef86[_0xe475('0x8')](_0xe475('0x13'),new AGIError(_0xe475('0x14'),_0x5a8929[_0xe475('0x15')]));});_0x11bc3b['on'](_0xe475('0x16'),function(){_0xa6ef86['emit'](_0xe475('0x16'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x11bc3b['on'](_0xe475('0x17'),function(){_0xa6ef86['emit'](_0xe475('0x17'),new AGIError(_0xe475('0x18')));_0x11bc3b[_0xe475('0x19')]();});_0x11bc3b[_0xe475('0x1a')](_0x164f02);this[_0xe475('0x1b')]=function(_0x40ac58,_0x3ae342){var _0x40ac58=_0x40ac58||'',_0x3ae342=typeof _0x3ae342==_0xe475('0x1c')?_0x3ae342:new Function();_0x154ed3={'tx':_0x40ac58,'rx':'','cb':_0x3ae342};_0x11bc3b[_0xe475('0x1d')](_0x40ac58+'\x0a');},this['close']=function(){_0x11bc3b[_0xe475('0x19')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xe475('0x1e')]['sendRequest']=function(_0x599964){return this['command'][_0xe475('0x1f')](this,_0x599964);};AGIChannel[_0xe475('0x1e')][_0xe475('0x20')]=function(){return this[_0xe475('0x21')]('ANSWER');};AGIChannel['prototype'][_0xe475('0x22')]=function(_0x13599a,_0x40ccce,_0x321237){_0x13599a=_0x13599a===undefined?_0xe475('0x23'):_0x13599a;_0x40ccce=_0x40ccce===undefined?'5':_0x40ccce;_0x321237=_0x321237===undefined?'1':_0x321237;return this[_0xe475('0x21')](util[_0xe475('0x24')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x13599a,_0x40ccce*0x3e8,_0x321237));};AGIChannel['prototype']['noop']=function(_0x139865){_0x139865=_0x139865||_0xe475('0x25');return this[_0xe475('0x21')](util[_0xe475('0x24')](_0xe475('0x26'),_0x139865));};AGIChannel['prototype'][_0xe475('0x27')]=function(_0x3f0c3b,_0x1f5ee5){if(_[_0xe475('0x28')](_0x1f5ee5)){return this[_0xe475('0x21')](util[_0xe475('0x24')](_0xe475('0x29'),_0x3f0c3b,_0x1f5ee5[_0xe475('0x2a')](',')));}return this['sendRequest'](util[_0xe475('0x24')](_0xe475('0x29'),_0x3f0c3b,_0x1f5ee5));};AGIChannel['prototype'][_0xe475('0x2b')]=function(_0x104c6b){return this[_0xe475('0x21')](util[_0xe475('0x24')](_0xe475('0x2c'),_0x104c6b));};AGIChannel['prototype']['setExtension']=function(_0x6656f3){return this['sendRequest'](util[_0xe475('0x24')]('SET\x20EXTENSION\x20%s',_0x6656f3));};AGIChannel[_0xe475('0x1e')][_0xe475('0x2d')]=function(_0x3ab018){return this[_0xe475('0x21')](util[_0xe475('0x24')](_0xe475('0x2e'),_0x3ab018));};AGIChannel[_0xe475('0x1e')][_0xe475('0x2f')]=function(){return this['sendRequest'](_0xe475('0x30'));};AGIChannel[_0xe475('0x1e')][_0xe475('0x31')]=function(_0x3467f9,_0x20f483){var _0x4bf4e4=_[_0xe475('0x32')](_0x20f483)||_[_0xe475('0x33')](_0x20f483)?_0x20f483[_0xe475('0x34')]():_0x20f483;return this[_0xe475('0x21')](util[_0xe475('0x24')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x3467f9,_0x4bf4e4?_0x4bf4e4['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xe475('0x1e')][_0xe475('0x35')]=function(_0x3e727e,_0x552607){return this[_0xe475('0x21')](util[_0xe475('0x24')](_0xe475('0x36'),_0x3e727e,_0x552607));};AGIChannel['prototype'][_0xe475('0x37')]=function(_0x4c02b9,_0xbff959){return this[_0xe475('0x21')](util[_0xe475('0x24')](_0xe475('0x38'),_0x4c02b9,_0xbff959));};AGIChannel['prototype']['sayPhonetic']=function(_0x19a1b8,_0x2f8e4f){return this[_0xe475('0x21')](util[_0xe475('0x24')](_0xe475('0x39'),_0x19a1b8,_0x2f8e4f));};AGIChannel[_0xe475('0x1e')][_0xe475('0x3a')]=function(_0x2797b2,_0x2f741e,_0xac8cd8){_0x2f741e=_0x2f741e||this[_0xe475('0x3b')];_0xac8cd8=_0xac8cd8||0x1;this[_0xe475('0x2b')](_0x2797b2);this[_0xe475('0x3c')](_0x2f741e);this['setPriority'](_0xac8cd8);return this[_0xe475('0x3d')](util[_0xe475('0x24')](_0xe475('0x3e'),_0x2797b2,_0x2f741e,_0xac8cd8));};AGIChannel[_0xe475('0x1e')][_0xe475('0x3f')]=function(_0x2a9641){return this[_0xe475('0x21')](util['format'](_0xe475('0x40'),_0x2a9641));};AGIChannel[_0xe475('0x1e')][_0xe475('0x41')]=function(_0x21ac91,_0x3adcfb,_0x3ca744,_0x11e5f2,_0x826c89,_0x3f6866){_0x3adcfb=_0x3adcfb||_0xe475('0x42');_0x3ca744=_0x3ca744||'';_0x11e5f2=_0x11e5f2===undefined?-0x1:_0x11e5f2==='-1'?-0x1:_0x11e5f2*0x3e8;_0x826c89=_0x826c89===undefined?'':'s='+_0x826c89;_0x3f6866=_0x3f6866?_0xe475('0x43'):'';return this['sendRequest'](util[_0xe475('0x24')](_0xe475('0x44'),_0x21ac91,_0x3adcfb,_0x3ca744,_0x11e5f2,_0x3f6866,_0x826c89));};AGIChannel[_0xe475('0x1e')][_0xe475('0x45')]=function(_0x26ed30,_0x4324d8){_0x4324d8=_0x4324d8||'';return this['sendRequest'](util[_0xe475('0x24')](_0xe475('0x46'),_0x26ed30,_0x4324d8));};AGIChannel[_0xe475('0x1e')][_0xe475('0x47')]=function(_0x44113f){return this[_0xe475('0x27')]('AGI',_0x44113f);};AGIChannel['prototype']['wait']=function(_0x2f980e){return this[_0xe475('0x27')]('WAIT',_0x2f980e);};AGIChannel['prototype'][_0xe475('0x13')]=function(_0x579a00,_0x1fe6e6){this['noop'](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x579a00['id'],_0x579a00['label'],_0x1fe6e6));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
+var _0x1b9b=['substr','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sync','answer','ANSWER','getData','beep','sendRequest','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','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','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','recordFile','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter','./reply','./error','setEncoding','utf8','headers','emit','ready','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','result=','indexOf'];(function(_0x4c9f6a,_0xcb2cb2){var _0x5df5b9=function(_0x303cf2){while(--_0x303cf2){_0x4c9f6a['push'](_0x4c9f6a['shift']());}};_0x5df5b9(++_0xcb2cb2);}(_0x1b9b,0x89));var _0xb1b9=function(_0x838b67,_0x5d9ab8){_0x838b67=_0x838b67-0x0;var _0x9d1946=_0x1b9b[_0x838b67];return _0x9d1946;};'use strict';var util=require(_0xb1b9('0x0'));var _=require('lodash');var EventEmitter=require(_0xb1b9('0x1'))[_0xb1b9('0x2')];var AGIReply=require(_0xb1b9('0x3'));var AGIError=require(_0xb1b9('0x4'));function AGIChannel(_0x5bfef6){var _0x38f77a=this,_0x411464=new AGIReply(),_0x597f8f=![],_0x5c24be={};EventEmitter['call'](_0x38f77a);_0x5bfef6[_0xb1b9('0x5')](_0xb1b9('0x6'));_0x5bfef6['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x411464[_0xb1b9('0x5')](_0xb1b9('0x6'));_0x411464['on'](_0xb1b9('0x7'),function(_0x55dc7b){for(var _0x175f77 in _0x55dc7b){_0x38f77a[_0x175f77]=_0x55dc7b[_0x175f77];}_0x38f77a[_0xb1b9('0x8')](_0xb1b9('0x9'));});_0x411464['on']('line',function(_0x178bb4){if(_0x178bb4['toLowerCase']()==_0xb1b9('0xa')){_0x38f77a['emit'](_0xb1b9('0xa'));return;}if(_0x178bb4[_0xb1b9('0xb')](0x0,0xb)==_0xb1b9('0xc')){_0x597f8f=!![];}if(_0x597f8f){_0x5c24be['rx']+=_0x178bb4+'\x0a';if(_0x178bb4[_0xb1b9('0xd')](_0xb1b9('0xe'))!=-0x1){_0x597f8f=![];}}else{_0x5c24be['rx']=_0x178bb4;}if(_0x597f8f){return;}if(typeof _0x5c24be['cb']==_0xb1b9('0xf')){var _0x470740=_0x5c24be['rx'][_0xb1b9('0xb')](0x0,0x3),_0x2fcc30=null,_0x517373=null;_0x470740=parseInt(_0x470740);if(isNaN(_0x470740)){_0x5c24be['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xb1b9('0x10')});return;}if(_0x470740!=0xc8){_0x5c24be['cb'](null,{'code':_0x470740,'result':-0x1,'extra':'KO'});return;}_0x2fcc30=_0x5c24be['rx'][_0xb1b9('0xb')](0x4)['replace'](_0xb1b9('0x11'),'');if(_0x2fcc30[_0xb1b9('0x12')]('\x20')!=-0x1){_0x2fcc30=_0x2fcc30[_0xb1b9('0x13')](0x0,_0x2fcc30[_0xb1b9('0x12')]('\x20'));}if(_[_0xb1b9('0x14')](_0x2fcc30,'-1')){_0x2fcc30=parseInt(_0x2fcc30);}_0x517373=_0x5c24be['rx'][_0xb1b9('0x15')]('\x20');if(_0x517373['length']==0x3){_0x517373=_0x517373[0x2][_0xb1b9('0xb')](0x1,_0x517373[0x2]['length']-0x1);}else if(_0x517373[_0xb1b9('0x16')]>0x3){var _0xa09e06=/\((.+)\)/;var _0x44896f=_0x5c24be['rx'][_0xb1b9('0x17')](_0xa09e06);if(_0x44896f){_0x517373=_0x44896f[0x1];}else{_0x517373=null;}}else{_0x517373=null;}_0x5c24be['cb'](null,{'code':_0x470740,'result':_0x2fcc30,'extra':_0x517373});}});_0x5bfef6['on']('error',function(_0x110426){_0x38f77a[_0xb1b9('0x8')](_0xb1b9('0x18'),new AGIError('E_AGI_SOCKET_ERROR',_0x110426[_0xb1b9('0x19')]));});_0x5bfef6['on'](_0xb1b9('0x1a'),function(){_0x38f77a[_0xb1b9('0x8')](_0xb1b9('0x1a'),new AGIError(_0xb1b9('0x1b')));});_0x5bfef6['on']('timeout',function(){_0x38f77a['emit']('timeout',new AGIError(_0xb1b9('0x1c')));_0x5bfef6[_0xb1b9('0x1d')]();});_0x5bfef6[_0xb1b9('0x1e')](_0x411464);this[_0xb1b9('0x1f')]=function(_0x1d1049,_0x1fae00){var _0x1d1049=_0x1d1049||'',_0x1fae00=typeof _0x1fae00==_0xb1b9('0xf')?_0x1fae00:new Function();_0x5c24be={'tx':_0x1d1049,'rx':'','cb':_0x1fae00};_0x5bfef6[_0xb1b9('0x20')](_0x1d1049+'\x0a');},this[_0xb1b9('0x1a')]=function(){_0x5bfef6['destroy']();};}util[_0xb1b9('0x21')](AGIChannel,EventEmitter);AGIChannel[_0xb1b9('0x22')]['sendRequest']=function(_0x1556e5){return this['command'][_0xb1b9('0x23')](this,_0x1556e5);};AGIChannel['prototype'][_0xb1b9('0x24')]=function(){return this['sendRequest'](_0xb1b9('0x25'));};AGIChannel[_0xb1b9('0x22')][_0xb1b9('0x26')]=function(_0xf08444,_0x60a509,_0x5f45e8){_0xf08444=_0xf08444===undefined?_0xb1b9('0x27'):_0xf08444;_0x60a509=_0x60a509===undefined?'5':_0x60a509;_0x5f45e8=_0x5f45e8===undefined?'1':_0x5f45e8;return this[_0xb1b9('0x28')](util[_0xb1b9('0x29')](_0xb1b9('0x2a'),_0xf08444,_0x60a509*0x3e8,_0x5f45e8));};AGIChannel[_0xb1b9('0x22')][_0xb1b9('0x2b')]=function(_0xcdf0cd){_0xcdf0cd=_0xcdf0cd||'NO\x20MESSAGE';return this['sendRequest'](util['format'](_0xb1b9('0x2c'),_0xcdf0cd));};AGIChannel[_0xb1b9('0x22')][_0xb1b9('0x2d')]=function(_0x42b558,_0x452e38){if(_[_0xb1b9('0x2e')](_0x452e38)){return this[_0xb1b9('0x28')](util[_0xb1b9('0x29')](_0xb1b9('0x2f'),_0x42b558,_0x452e38[_0xb1b9('0x30')](',')));}return this[_0xb1b9('0x28')](util[_0xb1b9('0x29')]('EXEC\x20%s\x20%s',_0x42b558,_0x452e38));};AGIChannel[_0xb1b9('0x22')][_0xb1b9('0x31')]=function(_0x703713){return this[_0xb1b9('0x28')](util['format'](_0xb1b9('0x32'),_0x703713));};AGIChannel[_0xb1b9('0x22')][_0xb1b9('0x33')]=function(_0x156013){return this[_0xb1b9('0x28')](util[_0xb1b9('0x29')](_0xb1b9('0x34'),_0x156013));};AGIChannel['prototype'][_0xb1b9('0x35')]=function(_0x33f328){return this[_0xb1b9('0x28')](util['format'](_0xb1b9('0x36'),_0x33f328));};AGIChannel[_0xb1b9('0x22')][_0xb1b9('0xa')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0xb1b9('0x22')][_0xb1b9('0x37')]=function(_0x2a4c54,_0x388295){var _0x593675=_[_0xb1b9('0x38')](_0x388295)||_[_0xb1b9('0x39')](_0x388295)?_0x388295[_0xb1b9('0x3a')]():_0x388295;return this[_0xb1b9('0x28')](util[_0xb1b9('0x29')](_0xb1b9('0x3b'),_0x2a4c54,_0x593675?_0x593675['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xb1b9('0x22')][_0xb1b9('0x3c')]=function(_0xc20305,_0x1cfbe8){return this[_0xb1b9('0x28')](util[_0xb1b9('0x29')](_0xb1b9('0x3d'),_0xc20305,_0x1cfbe8));};AGIChannel[_0xb1b9('0x22')][_0xb1b9('0x3e')]=function(_0x3f8d83,_0x1e09cd){return this[_0xb1b9('0x28')](util[_0xb1b9('0x29')](_0xb1b9('0x3f'),_0x3f8d83,_0x1e09cd));};AGIChannel['prototype']['sayPhonetic']=function(_0x24b9a1,_0x30c96e){return this[_0xb1b9('0x28')](util[_0xb1b9('0x29')](_0xb1b9('0x40'),_0x24b9a1,_0x30c96e));};AGIChannel[_0xb1b9('0x22')][_0xb1b9('0x41')]=function(_0x4a8118,_0x270f07,_0xab826a){_0x270f07=_0x270f07||this[_0xb1b9('0x42')];_0xab826a=_0xab826a||0x1;this[_0xb1b9('0x31')](_0x4a8118);this['setExtension'](_0x270f07);this[_0xb1b9('0x35')](_0xab826a);return this[_0xb1b9('0x2b')](util['format'](_0xb1b9('0x43'),_0x4a8118,_0x270f07,_0xab826a));};AGIChannel[_0xb1b9('0x22')]['getVariable']=function(_0xf74e27){return this[_0xb1b9('0x28')](util[_0xb1b9('0x29')]('GET\x20VARIABLE\x20\x22%s\x22',_0xf74e27));};AGIChannel['prototype'][_0xb1b9('0x44')]=function(_0x2f6e9f,_0x20fa82,_0x4b482a,_0x3ba5af,_0x474a91,_0x303c15){_0x20fa82=_0x20fa82||'wav';_0x4b482a=_0x4b482a||'';_0x3ba5af=_0x3ba5af===undefined?-0x1:_0x3ba5af==='-1'?-0x1:_0x3ba5af*0x3e8;_0x474a91=_0x474a91===undefined?'':'s='+_0x474a91;_0x303c15=_0x303c15?'BEEP':'';return this[_0xb1b9('0x28')](util[_0xb1b9('0x29')](_0xb1b9('0x45'),_0x2f6e9f,_0x20fa82,_0x4b482a,_0x3ba5af,_0x303c15,_0x474a91));};AGIChannel['prototype']['streamFile']=function(_0x4ebec9,_0x1626e0){_0x1626e0=_0x1626e0||'';return this[_0xb1b9('0x28')](util[_0xb1b9('0x29')](_0xb1b9('0x46'),_0x4ebec9,_0x1626e0));};AGIChannel[_0xb1b9('0x22')][_0xb1b9('0x47')]=function(_0xc5c52e){return this[_0xb1b9('0x2d')](_0xb1b9('0x48'),_0xc5c52e);};AGIChannel[_0xb1b9('0x22')][_0xb1b9('0x49')]=function(_0x3f436e){return this[_0xb1b9('0x2d')](_0xb1b9('0x4a'),_0x3f436e);};AGIChannel['prototype'][_0xb1b9('0x18')]=function(_0x22dd39,_0x29880d){this[_0xb1b9('0x2b')](util[_0xb1b9('0x29')](_0xb1b9('0x4b'),_0x22dd39['id'],_0x22dd39[_0xb1b9('0x4c')],_0x29880d));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xb1b9('0x4d')]=AGIChannel;
\ No newline at end of file
index 07054f1..3fca5a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0150=['name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','push','format','apply','message'];(function(_0x14d8c2,_0x2b10f8){var _0x34e72e=function(_0x5435ab){while(--_0x5435ab){_0x14d8c2['push'](_0x14d8c2['shift']());}};_0x34e72e(++_0x2b10f8);}(_0x0150,0x101));var _0x0015=function(_0x13cf5a,_0x3d9d6f){_0x13cf5a=_0x13cf5a-0x0;var _0x3d8963=_0x0150[_0x13cf5a];return _0x3d8963;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x0015('0x0'),'E_AGI_ARGUMENT_PORT':_0x0015('0x1'),'E_AGI_SERVER_ERROR':_0x0015('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x0015('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x0015('0x4'),'E_AGI_SOCKET_ERROR':_0x0015('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x0015('0x6'),'E_AGI_COMMAND_EMPTY':_0x0015('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x0015('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x1b5a6c){var _0x1b5a6c=_0x1b5a6c||null,_0x3710db=_0x3710db||[],_0x2243e6=0x1,_0x8c742a='';if(!error[_0x1b5a6c]){_0x1b5a6c='E_AGI_UNDEFINED';}_0x3710db[_0x0015('0x9')](error[_0x1b5a6c]);while(arguments[_0x2243e6]){_0x3710db[_0x0015('0x9')](arguments[_0x2243e6]);_0x2243e6++;}_0x8c742a=util[_0x0015('0xa')][_0x0015('0xb')](util,_0x3710db);this[_0x0015('0xc')]=_0x8c742a;this[_0x0015('0xd')]=_0x1b5a6c;}module[_0x0015('0xe')]=AGIError;
\ No newline at end of file
+var _0xd283=['exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name'];(function(_0x5df3e7,_0x5f2393){var _0x5e7c78=function(_0x437b9a){while(--_0x437b9a){_0x5df3e7['push'](_0x5df3e7['shift']());}};_0x5e7c78(++_0x5f2393);}(_0xd283,0xf8));var _0x3d28=function(_0x2c13c8,_0x3f7122){_0x2c13c8=_0x2c13c8-0x0;var _0x1ce1b3=_0xd283[_0x2c13c8];return _0x1ce1b3;};'use strict';var util=require(_0x3d28('0x0'));var error={'E_AGI_UNDEFINED':_0x3d28('0x1'),'E_AGI_ARGUMENT_PORT':_0x3d28('0x2'),'E_AGI_SERVER_ERROR':_0x3d28('0x3'),'E_AGI_SERVER_CLOSE':_0x3d28('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x3d28('0x5'),'E_AGI_SOCKET_ERROR':_0x3d28('0x6'),'E_AGI_SOCKET_CLOSE':_0x3d28('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x3d28('0x8'),'E_AGI_COMMAND_EMPTY':_0x3d28('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x3d28('0xa'),'E_AGI_IVR_ENTRY':_0x3d28('0xb')};function AGIError(_0x2775c0){var _0x2775c0=_0x2775c0||null,_0x252b98=_0x252b98||[],_0x1ad1f2=0x1,_0x1f789b='';if(!error[_0x2775c0]){_0x2775c0=_0x3d28('0xc');}_0x252b98['push'](error[_0x2775c0]);while(arguments[_0x1ad1f2]){_0x252b98[_0x3d28('0xd')](arguments[_0x1ad1f2]);_0x1ad1f2++;}_0x1f789b=util[_0x3d28('0xe')][_0x3d28('0xf')](util,_0x252b98);this[_0x3d28('0x10')]=_0x1f789b;this[_0x3d28('0x11')]=_0x2775c0;}module[_0x3d28('0x12')]=AGIError;
\ No newline at end of file
index b3d662f..7c98dca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa59d=['error','E_AGI_SERVER_ERROR','message','parse','projectUpdate','exports','lodash','events','EventEmitter','ioredis','../../config/environment','redis','subscribe','agi','emit'];(function(_0x464970,_0x4e7758){var _0x20289b=function(_0x7b8e1d){while(--_0x7b8e1d){_0x464970['push'](_0x464970['shift']());}};_0x20289b(++_0x4e7758);}(_0xa59d,0x8d));var _0xda59=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa59d[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xda59('0x0'));var EventEmitter=require(_0xda59('0x1'))[_0xda59('0x2')];var Redis=require(_0xda59('0x3'));var AGIError=require('./error');var config=require(_0xda59('0x4'));config[_0xda59('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xda59('0x5')]);sub[_0xda59('0x6')](_0xda59('0x7'),function(_0x1a4997){if(_0x1a4997)return eventEmitter[_0xda59('0x8')](_0xda59('0x9'),new AGIError(_0xda59('0xa'),_0x1a4997));});sub['on'](_0xda59('0xb'),function(_0x21ae7c,_0x265efc){if(_0x21ae7c!==_0xda59('0x7'))return;try{var _0x28b67c=JSON[_0xda59('0xc')](_0x265efc);eventEmitter[_0xda59('0x8')](_0xda59('0xd'),_0x28b67c);}catch(_0x191a59){eventEmitter[_0xda59('0x8')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x191a59));}});module[_0xda59('0xe')]={'EventEmitter':eventEmitter};
\ No newline at end of file
+var _0x6e86=['exports','lodash','events','EventEmitter','ioredis','../../config/environment','defaults','redis','subscribe','agi','emit','error','message','projectUpdate','E_AGI_SERVER_ERROR'];(function(_0x4692c3,_0x5b73a8){var _0x14c0c2=function(_0x470e5d){while(--_0x470e5d){_0x4692c3['push'](_0x4692c3['shift']());}};_0x14c0c2(++_0x5b73a8);}(_0x6e86,0x12d));var _0x66e8=function(_0x16066e,_0x31e151){_0x16066e=_0x16066e-0x0;var _0x52a12e=_0x6e86[_0x16066e];return _0x52a12e;};'use strict';var _=require(_0x66e8('0x0'));var EventEmitter=require(_0x66e8('0x1'))[_0x66e8('0x2')];var Redis=require(_0x66e8('0x3'));var AGIError=require('./error');var config=require(_0x66e8('0x4'));config['redis']=_[_0x66e8('0x5')](config[_0x66e8('0x6')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0x66e8('0x7')](_0x66e8('0x8'),function(_0x2c4e5d){if(_0x2c4e5d)return eventEmitter[_0x66e8('0x9')](_0x66e8('0xa'),new AGIError('E_AGI_SERVER_ERROR',_0x2c4e5d));});sub['on'](_0x66e8('0xb'),function(_0x400fa8,_0x354d44){if(_0x400fa8!==_0x66e8('0x8'))return;try{var _0x534943=JSON['parse'](_0x354d44);eventEmitter[_0x66e8('0x9')](_0x66e8('0xc'),_0x534943);}catch(_0x278879){eventEmitter[_0x66e8('0x9')]('error',new AGIError(_0x66e8('0xd'),_0x278879));}});module[_0x66e8('0xe')]={'EventEmitter':eventEmitter};
\ No newline at end of file
index 3a66e9a..51ccfc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1b5=['info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','target','traverseBFS','vswitch','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','../../../config/logger','agi','menu','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','relations','getVertex'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0xf1b5,0xda));var _0x5f1b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf1b5[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var logger=require(_0x5f1b('0x0'))(_0x5f1b('0x1'));var verticesWithRetry=[_0x5f1b('0x2'),'getdigits',_0x5f1b('0x3')];var Graph=function(){this[_0x5f1b('0x4')]={};this[_0x5f1b('0x5')]={};this[_0x5f1b('0x6')]=0x0;};Graph[_0x5f1b('0x7')][_0x5f1b('0x8')]=function(_0x1bf4b8){this[_0x5f1b('0x4')][_0x1bf4b8['id']]=_0x1bf4b8;this['edges'][_0x1bf4b8['id']]=[];};Graph[_0x5f1b('0x7')][_0x5f1b('0x9')]=function(_0x35086c,_0x161cb4,_0x523d6a){this[_0x5f1b('0x5')][_0x35086c][_0x5f1b('0xa')]({'target':_0x161cb4,'condition':_0x523d6a});this[_0x5f1b('0x6')]+=0x1;};Graph[_0x5f1b('0x7')][_0x5f1b('0xb')]=function(){return _['size'](this[_0x5f1b('0x4')]);};Graph[_0x5f1b('0x7')][_0x5f1b('0xc')]=function(){return this[_0x5f1b('0x6')];};Graph[_0x5f1b('0x7')][_0x5f1b('0xd')]=function(_0xa7630e){return this[_0x5f1b('0x4')][_0xa7630e];};Graph['prototype']['traverseBFS']=function(_0x4c1ef4,_0x115e8a){if(!this[_0x5f1b('0x4')][_0x4c1ef4]){return logger[_0x5f1b('0xe')](_0x5f1b('0xf'));}var _0x1df17d=_0x115e8a(this[_0x5f1b('0x4')][_0x4c1ef4]);if(!_0x1df17d){return logger['info'](_0x5f1b('0x10'));}if(this[_0x5f1b('0x5')][_0x4c1ef4][_0x5f1b('0x11')]===0x0){return logger['info'](_0x5f1b('0x12'));}for(var _0xf734ed=0x0,_0x443020=[],_0x466501=![];_0xf734ed<this[_0x5f1b('0x5')][_0x4c1ef4][_0x5f1b('0x11')];_0xf734ed+=0x1){if(this[_0x5f1b('0x5')][_0x4c1ef4][_0xf734ed][_0x5f1b('0x13')]){_0x443020=this['edges'][_0x4c1ef4][_0xf734ed][_0x5f1b('0x13')][_0x5f1b('0x14')](',');for(var _0x403686=0x0;_0x403686<_0x443020[_0x5f1b('0x11')];_0x403686+=0x1){if(this[_0x5f1b('0x4')][_0x4c1ef4][_0x5f1b('0x15')]==='vswitch'&&_0x443020[_0x403686]==='-'){_0x466501=this[_0x5f1b('0x5')][_0x4c1ef4][_0xf734ed]['target'];logger['info']('default',_0x443020[_0x403686],this[_0x5f1b('0x5')][_0x4c1ef4][_0xf734ed][_0x5f1b('0x16')]);}else if(this['vertices'][_0x4c1ef4][_0x5f1b('0x15')]===_0x5f1b('0x2')&&_0x443020[_0x403686]==='i'){_0x466501=this['edges'][_0x4c1ef4][_0xf734ed][_0x5f1b('0x16')];logger['info']('invalid',_0x443020[_0x403686],this[_0x5f1b('0x5')][_0x4c1ef4][_0xf734ed][_0x5f1b('0x16')]);}if(_0x443020[_0x403686]===_0x1df17d){return this['traverseBFS'](this[_0x5f1b('0x5')][_0x4c1ef4][_0xf734ed][_0x5f1b('0x16')],_0x115e8a);}}}else{return this[_0x5f1b('0x17')](this[_0x5f1b('0x5')][_0x4c1ef4][_0xf734ed][_0x5f1b('0x16')],_0x115e8a);}}if(_0x443020[_0x5f1b('0x11')]){if(this[_0x5f1b('0x4')][_0x4c1ef4][_0x5f1b('0x15')]===_0x5f1b('0x18')){if(_0x466501){return this[_0x5f1b('0x17')](_0x466501,_0x115e8a);}return logger[_0x5f1b('0xe')](_0x5f1b('0x19'));}else if(_[_0x5f1b('0x1a')](verticesWithRetry,this[_0x5f1b('0x4')][_0x4c1ef4][_0x5f1b('0x15')])){if(_0x1df17d==='-'){return logger['info'](_0x5f1b('0x1b'));}if(_0x466501&&_0x1df17d!=='t'){return this[_0x5f1b('0x17')](_0x466501,_0x115e8a);}return this[_0x5f1b('0x17')](_0x4c1ef4,_0x115e8a);}return logger[_0x5f1b('0xe')](_0x5f1b('0x1c'));}};module['exports']=Graph;
\ No newline at end of file
+var _0xdfd8=['agi','menu','getsecretdigits','numberOfEdges','prototype','addVertex','vertices','edges','push','size','getVertex','info','no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available','length','condition','split','agicommand','vswitch','default','target','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','lodash','../../../config/logger'];(function(_0x388704,_0x1c1289){var _0x33a953=function(_0x1ecdad){while(--_0x1ecdad){_0x388704['push'](_0x388704['shift']());}};_0x33a953(++_0x1c1289);}(_0xdfd8,0x12a));var _0x8dfd=function(_0x478b73,_0x37107a){_0x478b73=_0x478b73-0x0;var _0x537704=_0xdfd8[_0x478b73];return _0x537704;};'use strict';var _=require(_0x8dfd('0x0'));var logger=require(_0x8dfd('0x1'))(_0x8dfd('0x2'));var verticesWithRetry=[_0x8dfd('0x3'),'getdigits',_0x8dfd('0x4')];var Graph=function(){this['vertices']={};this['edges']={};this[_0x8dfd('0x5')]=0x0;};Graph[_0x8dfd('0x6')][_0x8dfd('0x7')]=function(_0x11b070){this[_0x8dfd('0x8')][_0x11b070['id']]=_0x11b070;this[_0x8dfd('0x9')][_0x11b070['id']]=[];};Graph[_0x8dfd('0x6')]['addEdge']=function(_0x378117,_0x4771e2,_0x1532d0){this['edges'][_0x378117][_0x8dfd('0xa')]({'target':_0x4771e2,'condition':_0x1532d0});this[_0x8dfd('0x5')]+=0x1;};Graph['prototype'][_0x8dfd('0xb')]=function(){return _['size'](this[_0x8dfd('0x8')]);};Graph[_0x8dfd('0x6')]['relations']=function(){return this[_0x8dfd('0x5')];};Graph[_0x8dfd('0x6')][_0x8dfd('0xc')]=function(_0x1a9245){return this[_0x8dfd('0x8')][_0x1a9245];};Graph[_0x8dfd('0x6')]['traverseBFS']=function(_0x451331,_0x265469){if(!this[_0x8dfd('0x8')][_0x451331]){return logger[_0x8dfd('0xd')](_0x8dfd('0xe'));}var _0x592e7e=_0x265469(this[_0x8dfd('0x8')][_0x451331]);if(!_0x592e7e){return logger['info'](_0x8dfd('0xf'));}if(this[_0x8dfd('0x9')][_0x451331]['length']===0x0){return logger[_0x8dfd('0xd')](_0x8dfd('0x10'));}for(var _0x5ae2bb=0x0,_0xba3542=[],_0x58b82f=![];_0x5ae2bb<this[_0x8dfd('0x9')][_0x451331][_0x8dfd('0x11')];_0x5ae2bb+=0x1){if(this[_0x8dfd('0x9')][_0x451331][_0x5ae2bb][_0x8dfd('0x12')]){_0xba3542=this['edges'][_0x451331][_0x5ae2bb]['condition'][_0x8dfd('0x13')](',');for(var _0x2a9335=0x0;_0x2a9335<_0xba3542[_0x8dfd('0x11')];_0x2a9335+=0x1){if(this[_0x8dfd('0x8')][_0x451331][_0x8dfd('0x14')]===_0x8dfd('0x15')&&_0xba3542[_0x2a9335]==='-'){_0x58b82f=this['edges'][_0x451331][_0x5ae2bb]['target'];logger['info'](_0x8dfd('0x16'),_0xba3542[_0x2a9335],this[_0x8dfd('0x9')][_0x451331][_0x5ae2bb]['target']);}else if(this[_0x8dfd('0x8')][_0x451331][_0x8dfd('0x14')]===_0x8dfd('0x3')&&_0xba3542[_0x2a9335]==='i'){_0x58b82f=this[_0x8dfd('0x9')][_0x451331][_0x5ae2bb][_0x8dfd('0x17')];logger[_0x8dfd('0xd')](_0x8dfd('0x18'),_0xba3542[_0x2a9335],this[_0x8dfd('0x9')][_0x451331][_0x5ae2bb][_0x8dfd('0x17')]);}if(_0xba3542[_0x2a9335]===_0x592e7e){return this[_0x8dfd('0x19')](this[_0x8dfd('0x9')][_0x451331][_0x5ae2bb][_0x8dfd('0x17')],_0x265469);}}}else{return this[_0x8dfd('0x19')](this[_0x8dfd('0x9')][_0x451331][_0x5ae2bb][_0x8dfd('0x17')],_0x265469);}}if(_0xba3542['length']){if(this['vertices'][_0x451331][_0x8dfd('0x14')]==='vswitch'){if(_0x58b82f){return this[_0x8dfd('0x19')](_0x58b82f,_0x265469);}return logger[_0x8dfd('0xd')](_0x8dfd('0x1a'));}else if(_[_0x8dfd('0x1b')](verticesWithRetry,this[_0x8dfd('0x8')][_0x451331][_0x8dfd('0x14')])){if(_0x592e7e==='-'){return logger['info'](_0x8dfd('0x1c'));}if(_0x58b82f&&_0x592e7e!=='t'){return this[_0x8dfd('0x19')](_0x58b82f,_0x265469);}return this[_0x8dfd('0x19')](_0x451331,_0x265469);}return logger[_0x8dfd('0xd')]('condition\x20not\x20found');}};module[_0x8dfd('0x1d')]=Graph;
\ No newline at end of file
index f70326a..af5ba94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd58=['defaults','127.0.0.1','projectUpdate','nextTick','stack','deleted','push','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','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','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','handleNotFound','production','handleUnpublished','initialize','voice','callysquare','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','listening','connection','lodash','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','EventEmitter'];(function(_0x3fc6a3,_0x19f611){var _0x396c02=function(_0x2c17b4){while(--_0x2c17b4){_0x3fc6a3['push'](_0x3fc6a3['shift']());}};_0x396c02(++_0x19f611);}(_0xbd58,0x127));var _0x8bd5=function(_0x66b8ce,_0x51046d){_0x66b8ce=_0x66b8ce-0x0;var _0x30767b=_0xbd58[_0x66b8ce];return _0x30767b;};'use strict';var _=require(_0x8bd5('0x0'));var syncho=require('syncho');var util=require(_0x8bd5('0x1'));var config=require(_0x8bd5('0x2'));var logger=require(_0x8bd5('0x3'))(_0x8bd5('0x4'));var utilLicense=require(_0x8bd5('0x5'));var rpc=require(_0x8bd5('0x6'));var Project=require(_0x8bd5('0x7'));var AGIEmitter=require(_0x8bd5('0x8'))[_0x8bd5('0x9')];var projects=[];config[_0x8bd5('0x4')]=_[_0x8bd5('0xa')](config['agi'],{'ip':_0x8bd5('0xb'),'port':0x11dd});AGIEmitter['on'](_0x8bd5('0xc'),projectUpdateHandler);function connectionHandler(_0x536a00){process[_0x8bd5('0xd')](function(){syncho(function(){try{setChannelVariables(_0x536a00);agiHandler(_0x536a00);}catch(_0x5aebf4){logger['error'](_0x5aebf4[_0x8bd5('0xe')]);}});});}function projectUpdateHandler(_0x3ecfd8){try{var _0x943d24=_['findIndex'](projects,['id',_0x3ecfd8['id']]);if(_0x943d24>-0x1){if(_0x3ecfd8[_0x8bd5('0xf')]===!![]){projects['splice'](_0x943d24,0x1);}else{projects[_0x943d24]=_0x3ecfd8;}}else{projects[_0x8bd5('0x10')](_0x3ecfd8);}}catch(_0x45ae19){logger[_0x8bd5('0x11')](_0x45ae19[_0x8bd5('0xe')]);}}function listeningHandler(){console[_0x8bd5('0x12')](_0x8bd5('0x13'),config[_0x8bd5('0x4')][_0x8bd5('0x14')]);logger[_0x8bd5('0x15')](util[_0x8bd5('0x16')](_0x8bd5('0x17'),config[_0x8bd5('0x4')]['ip'],config[_0x8bd5('0x4')]['port']));}function errorHandler(_0x8f2665){if(_0x8f2665&&_0x8f2665[_0x8bd5('0x18')]&&_0x8f2665[_0x8bd5('0x19')]){logger[_0x8bd5('0x11')](util['format'](_0x8bd5('0x1a'),_0x8f2665[_0x8bd5('0x18')],_0x8f2665[_0x8bd5('0x19')]));}else{logger[_0x8bd5('0x11')](util[_0x8bd5('0x16')](_0x8bd5('0x1b'),_0x8f2665[_0x8bd5('0xe')]));}}function closeHandler(){logger[_0x8bd5('0x15')](util[_0x8bd5('0x16')](_0x8bd5('0x1c'),this[_0x8bd5('0x1d')],this[_0x8bd5('0x1e')],this[_0x8bd5('0x1f')],this[_0x8bd5('0x20')],this[_0x8bd5('0x21')]));try{createSquareReport(this);}catch(_0x43fe24){logger['error'](_0x43fe24['stack']);}}function timeoutHandler(){logger[_0x8bd5('0x15')](util[_0x8bd5('0x16')](_0x8bd5('0x22'),this[_0x8bd5('0x1d')],this[_0x8bd5('0x1e')],this[_0x8bd5('0x1f')],this[_0x8bd5('0x20')],this[_0x8bd5('0x21')]));}function hangupHandler(){logger[_0x8bd5('0x15')](util[_0x8bd5('0x16')](_0x8bd5('0x23'),this['arg_1'],this[_0x8bd5('0x1e')],this[_0x8bd5('0x1f')],this['dnid'],this[_0x8bd5('0x21')]));this[_0x8bd5('0x24')]=!![];}function createSquareReport(_0x46b731,_0x3cf184){rpc[_0x8bd5('0x25')](_0x46b731)[_0x8bd5('0x26')](function(_0x2ed257){if(_0x3cf184){_0x3cf184(null,_0x2ed257);}})[_0x8bd5('0x27')](function(_0x2a363c){if(_0x3cf184){_0x3cf184(null,_0x2a363c);}});}function setChannelVariables(_0x353129){for(var _0x45f1a7 in _0x353129){if(_0x353129[_0x8bd5('0x28')](_0x45f1a7)){if(_0x45f1a7[_0x8bd5('0x29')](_0x8bd5('0x2a'))===0x0){_0x353129[_0x45f1a7[_0x8bd5('0x2b')](0x4)]=_0x353129[_0x45f1a7];delete _0x353129[_0x45f1a7];}}}}function agiHandler(_0x230c37){logger['debug'](_0x8bd5('0x2c'),JSON[_0x8bd5('0x2d')](_0x230c37,null,0x2));logger[_0x8bd5('0x15')](util[_0x8bd5('0x16')](_0x8bd5('0x2e'),_0x230c37['arg_1'],_0x230c37[_0x8bd5('0x1e')],_0x230c37[_0x8bd5('0x1f')],_0x230c37[_0x8bd5('0x20')],_0x230c37[_0x8bd5('0x21')]));_0x230c37['on']('error',errorHandler);_0x230c37['on'](_0x8bd5('0x2f'),closeHandler);_0x230c37['on'](_0x8bd5('0x30'),timeoutHandler);_0x230c37[_0x8bd5('0x24')]=![];_0x230c37['on'](_0x8bd5('0x31'),hangupHandler);var _0x1dbe6d=_['find'](projects,[_0x8bd5('0x18'),_0x230c37[_0x8bd5('0x1d')]]);if(!_0x1dbe6d)return Project[_0x8bd5('0x32')](_0x230c37);if(!_0x1dbe6d[_0x8bd5('0x33')])return Project[_0x8bd5('0x34')](_0x230c37);return Project[_0x8bd5('0x35')](_0x1dbe6d,_0x230c37);}function main(){var _0x7fffaa;return utilLicense['getLicense']()[_0x8bd5('0x26')](function(_0xbc3aaa){if(!_0xbc3aaa)return;if(_0xbc3aaa[_0x8bd5('0x36')]){if(_0xbc3aaa[_0x8bd5('0x37')]&&_0xbc3aaa[_0x8bd5('0x37')]>0x0){logger[_0x8bd5('0x15')](util[_0x8bd5('0x16')]('[LICENSE]\x20CHANNELS:\x20%s',_0xbc3aaa[_0x8bd5('0x37')]));_0x7fffaa=_0xbc3aaa['callysquare'];}else{logger[_0x8bd5('0x15')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x8bd5('0x15')](_0x8bd5('0x38'));_0x7fffaa=-0x1;}})[_0x8bd5('0x26')](function(){return Project[_0x8bd5('0x39')]();})[_0x8bd5('0x26')](function(_0x518e24){projects=_0x518e24;return;})[_0x8bd5('0x27')](function(_0x49a4f1){logger[_0x8bd5('0x11')](_0x8bd5('0x3a'),_0x49a4f1[_0x8bd5('0xe')]);})['finally'](function(){var _0x51b7eb=require('./server')(config[_0x8bd5('0x4')]['port'],config[_0x8bd5('0x4')]['ip'],_0x7fffaa);_0x51b7eb['on'](_0x8bd5('0x11'),errorHandler);_0x51b7eb['on'](_0x8bd5('0x3b'),listeningHandler);_0x51b7eb['on'](_0x8bd5('0x3c'),connectionHandler);_0x51b7eb['on'](_0x8bd5('0x2f'),closeHandler);});}main();
\ No newline at end of file
+var _0xbcf3=['[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','catch','hasOwnProperty','indexOf','substring','debug','variables','close','timeout','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','connection','syncho','util','../../config/logger','agi','../../config/license/util','./project','./events','EventEmitter','127.0.0.1','projectUpdate','nextTick','stack','findIndex','deleted','splice','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','message','error','[ERROR]\x20%s','arg_1','callerid','dnid'];(function(_0x53715c,_0xcd9b3f){var _0x5e0434=function(_0x3363d5){while(--_0x3363d5){_0x53715c['push'](_0x53715c['shift']());}};_0x5e0434(++_0xcd9b3f);}(_0xbcf3,0xfe));var _0x3bcf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbcf3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var syncho=require(_0x3bcf('0x0'));var util=require(_0x3bcf('0x1'));var config=require('../../config/environment');var logger=require(_0x3bcf('0x2'))(_0x3bcf('0x3'));var utilLicense=require(_0x3bcf('0x4'));var rpc=require('./rpc');var Project=require(_0x3bcf('0x5'));var AGIEmitter=require(_0x3bcf('0x6'))[_0x3bcf('0x7')];var projects=[];config['agi']=_['defaults'](config[_0x3bcf('0x3')],{'ip':_0x3bcf('0x8'),'port':0x11dd});AGIEmitter['on'](_0x3bcf('0x9'),projectUpdateHandler);function connectionHandler(_0x171fd6){process[_0x3bcf('0xa')](function(){syncho(function(){try{setChannelVariables(_0x171fd6);agiHandler(_0x171fd6);}catch(_0x1b8dda){logger['error'](_0x1b8dda[_0x3bcf('0xb')]);}});});}function projectUpdateHandler(_0x3d976f){try{var _0x1c35fe=_[_0x3bcf('0xc')](projects,['id',_0x3d976f['id']]);if(_0x1c35fe>-0x1){if(_0x3d976f[_0x3bcf('0xd')]===!![]){projects[_0x3bcf('0xe')](_0x1c35fe,0x1);}else{projects[_0x1c35fe]=_0x3d976f;}}else{projects['push'](_0x3d976f);}}catch(_0x2b5d7a){logger['error'](_0x2b5d7a[_0x3bcf('0xb')]);}}function listeningHandler(){console['log'](_0x3bcf('0xf'),config['agi'][_0x3bcf('0x10')]);logger[_0x3bcf('0x11')](util[_0x3bcf('0x12')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x3bcf('0x3')]['ip'],config[_0x3bcf('0x3')][_0x3bcf('0x10')]));}function errorHandler(_0x5ee929){if(_0x5ee929&&_0x5ee929[_0x3bcf('0x13')]&&_0x5ee929[_0x3bcf('0x14')]){logger[_0x3bcf('0x15')](util[_0x3bcf('0x12')]('[%s]\x20%s',_0x5ee929['name'],_0x5ee929['message']));}else{logger['error'](util[_0x3bcf('0x12')](_0x3bcf('0x16'),_0x5ee929[_0x3bcf('0xb')]));}}function closeHandler(){logger[_0x3bcf('0x11')](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x3bcf('0x17')],this['calleridname'],this[_0x3bcf('0x18')],this[_0x3bcf('0x19')],this['uniqueid']));try{createSquareReport(this);}catch(_0x38cde4){logger[_0x3bcf('0x15')](_0x38cde4[_0x3bcf('0xb')]);}}function timeoutHandler(){logger[_0x3bcf('0x11')](util[_0x3bcf('0x12')](_0x3bcf('0x1a'),this[_0x3bcf('0x17')],this[_0x3bcf('0x1b')],this['callerid'],this[_0x3bcf('0x19')],this[_0x3bcf('0x1c')]));}function hangupHandler(){logger['info'](util['format'](_0x3bcf('0x1d'),this[_0x3bcf('0x17')],this[_0x3bcf('0x1b')],this[_0x3bcf('0x18')],this[_0x3bcf('0x19')],this['uniqueid']));this[_0x3bcf('0x1e')]=!![];}function createSquareReport(_0x3d4827,_0x1075a2){rpc['createSquareReport'](_0x3d4827)[_0x3bcf('0x1f')](function(_0x3ed76e){if(_0x1075a2){_0x1075a2(null,_0x3ed76e);}})[_0x3bcf('0x20')](function(_0x3ca83b){if(_0x1075a2){_0x1075a2(null,_0x3ca83b);}});}function setChannelVariables(_0x539f1c){for(var _0x4652f5 in _0x539f1c){if(_0x539f1c[_0x3bcf('0x21')](_0x4652f5)){if(_0x4652f5[_0x3bcf('0x22')]('agi_')===0x0){_0x539f1c[_0x4652f5[_0x3bcf('0x23')](0x4)]=_0x539f1c[_0x4652f5];delete _0x539f1c[_0x4652f5];}}}}function agiHandler(_0x25c43a){logger[_0x3bcf('0x24')](_0x3bcf('0x25'),JSON['stringify'](_0x25c43a,null,0x2));logger['info'](util[_0x3bcf('0x12')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x25c43a[_0x3bcf('0x17')],_0x25c43a['calleridname'],_0x25c43a[_0x3bcf('0x18')],_0x25c43a['dnid'],_0x25c43a[_0x3bcf('0x1c')]));_0x25c43a['on'](_0x3bcf('0x15'),errorHandler);_0x25c43a['on'](_0x3bcf('0x26'),closeHandler);_0x25c43a['on'](_0x3bcf('0x27'),timeoutHandler);_0x25c43a[_0x3bcf('0x1e')]=![];_0x25c43a['on'](_0x3bcf('0x28'),hangupHandler);var _0x1e86be=_[_0x3bcf('0x29')](projects,[_0x3bcf('0x13'),_0x25c43a[_0x3bcf('0x17')]]);if(!_0x1e86be)return Project[_0x3bcf('0x2a')](_0x25c43a);if(!_0x1e86be[_0x3bcf('0x2b')])return Project[_0x3bcf('0x2c')](_0x25c43a);return Project[_0x3bcf('0x2d')](_0x1e86be,_0x25c43a);}function main(){var _0x5a2c5a;return utilLicense[_0x3bcf('0x2e')]()[_0x3bcf('0x1f')](function(_0x4f9a12){if(!_0x4f9a12)return;if(_0x4f9a12['voice']){if(_0x4f9a12[_0x3bcf('0x2f')]&&_0x4f9a12[_0x3bcf('0x2f')]>0x0){logger['info'](util[_0x3bcf('0x12')]('[LICENSE]\x20CHANNELS:\x20%s',_0x4f9a12['callysquare']));_0x5a2c5a=_0x4f9a12[_0x3bcf('0x2f')];}else{logger[_0x3bcf('0x11')](_0x3bcf('0x30'));}}else{logger['info'](_0x3bcf('0x31'));_0x5a2c5a=-0x1;}})[_0x3bcf('0x1f')](function(){return Project[_0x3bcf('0x32')]();})['then'](function(_0x4b3bb2){projects=_0x4b3bb2;return;})[_0x3bcf('0x20')](function(_0x1058c0){logger[_0x3bcf('0x15')](_0x3bcf('0x33'),_0x1058c0[_0x3bcf('0xb')]);})[_0x3bcf('0x34')](function(){var _0x2eba97=require(_0x3bcf('0x35'))(config[_0x3bcf('0x3')][_0x3bcf('0x10')],config[_0x3bcf('0x3')]['ip'],_0x5a2c5a);_0x2eba97['on'](_0x3bcf('0x15'),errorHandler);_0x2eba97['on'](_0x3bcf('0x36'),listeningHandler);_0x2eba97['on'](_0x3bcf('0x37'),connectionHandler);_0x2eba97['on'](_0x3bcf('0x26'),closeHandler);});}main();
\ No newline at end of file
index 5e9e5dd..1bbb6c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59ff=['jayson/promise','client','http','then','error','message','result','catch','sendMailMessage','SendMail'];(function(_0x20fceb,_0x44c7c6){var _0x43523a=function(_0x460466){while(--_0x460466){_0x20fceb['push'](_0x20fceb['shift']());}};_0x43523a(++_0x44c7c6);}(_0x59ff,0x122));var _0xf59f=function(_0x163f4d,_0x12469f){_0x163f4d=_0x163f4d-0x0;var _0x41320d=_0x59ff[_0x163f4d];return _0x41320d;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xf59f('0x0'));var client=jayson[_0xf59f('0x1')][_0xf59f('0x2')]({'port':0x232b});function request(_0x49ba1e,_0x49759f){return new BPromise(function(_0x56318e,_0x75cb32){return client['request'](_0x49ba1e,_0x49759f)[_0xf59f('0x3')](function(_0x5c3d47){if(_0x5c3d47[_0xf59f('0x4')]){return _0x75cb32(_0x5c3d47['error'][_0xf59f('0x5')]);}else{return _0x56318e(_0x5c3d47[_0xf59f('0x6')]);}})[_0xf59f('0x7')](function(_0x2f6ae4){return _0x75cb32(_0x2f6ae4);});});}exports[_0xf59f('0x8')]=function(_0x3a3a00,_0x49ab99){return request(_0xf59f('0x9'),{'account':_0x3a3a00,'message':_0x49ab99});};
\ No newline at end of file
+var _0xa045=['message','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error'];(function(_0x1f3443,_0x3bc887){var _0x46f954=function(_0x4578cd){while(--_0x4578cd){_0x1f3443['push'](_0x1f3443['shift']());}};_0x46f954(++_0x3bc887);}(_0xa045,0x101));var _0x5a04=function(_0x395816,_0x408365){_0x395816=_0x395816-0x0;var _0x7c08b0=_0xa045[_0x395816];return _0x7c08b0;};'use strict';var BPromise=require(_0x5a04('0x0'));var jayson=require(_0x5a04('0x1'));var client=jayson[_0x5a04('0x2')][_0x5a04('0x3')]({'port':0x232b});function request(_0x598b56,_0x1739ff){return new BPromise(function(_0x3c8530,_0x5685c7){return client[_0x5a04('0x4')](_0x598b56,_0x1739ff)[_0x5a04('0x5')](function(_0xf362ca){if(_0xf362ca[_0x5a04('0x6')]){return _0x5685c7(_0xf362ca[_0x5a04('0x6')][_0x5a04('0x7')]);}else{return _0x3c8530(_0xf362ca['result']);}})[_0x5a04('0x8')](function(_0x5943ac){return _0x5685c7(_0x5943ac);});});}exports[_0x5a04('0x9')]=function(_0xd8346,_0x2bd74f){return request(_0x5a04('0xa'),{'account':_0xd8346,'message':_0x2bd74f});};
\ No newline at end of file
index dbf8885..71f6bbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2e9=['Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','../../config/logger','agi','./rpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','retry','maxRetry','addVertex','omit','isArray','length','target','value','toJson','mxGraphModel','start','debug','root','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','uniqueid','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','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','calleridname','dnid','traverseBFS','vertex','[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'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa2e9,0x1b4));var _0x9a2e=function(_0x5b1c50,_0x56e694){_0x5b1c50=_0x5b1c50-0x0;var _0x2d379b=_0xa2e9[_0x5b1c50];return _0x2d379b;};'use strict';var _=require(_0x9a2e('0x0'));var moment=require(_0x9a2e('0x1'));var parser=require(_0x9a2e('0x2'));var util=require(_0x9a2e('0x3'));var logger=require(_0x9a2e('0x4'))(_0x9a2e('0x5'));var rpc=require(_0x9a2e('0x6'));var mailRpc=require('./mailRpc');var Graph=require(_0x9a2e('0x7'));var Vertices=require(_0x9a2e('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x9a2e('0x9')]()[_0x9a2e('0xa')](function(_0x209394){logger[_0x9a2e('0xb')](_0x9a2e('0xc'),_0x209394[_0x9a2e('0xd')]);return[];});}function addVertex(_0x4bc28c,_0x3a094f,_0x49973f){_0x3a094f[_0x9a2e('0xe')]=_0x49973f;if(_0x3a094f['hasOwnProperty'](_0x9a2e('0xf'))){_0x3a094f[_0x9a2e('0x10')]=parseInt(_0x3a094f[_0x9a2e('0xf')],0xa);}_0x4bc28c[_0x9a2e('0x11')](_[_0x9a2e('0x12')](_0x3a094f,'mxCell'));}function initGraph(_0x2e9da3,_0x3556fd){var _0x4cd165=new Graph();for(var _0x4701d0 in _0x2e9da3){if(_0x2e9da3['hasOwnProperty'](_0x4701d0)){if(_[_0x9a2e('0x13')](_0x2e9da3[_0x4701d0])){for(var _0x323272=0x0;_0x323272<_0x2e9da3[_0x4701d0][_0x9a2e('0x14')];_0x323272+=0x1){addVertex(_0x4cd165,_0x2e9da3[_0x4701d0][_0x323272],_0x4701d0);}}else{addVertex(_0x4cd165,_0x2e9da3[_0x4701d0],_0x4701d0);}}}for(var _0x5ac48b=0x0;_0x5ac48b<_0x3556fd['length'];_0x5ac48b+=0x1){if(_0x3556fd[_0x5ac48b]['source']&&_0x3556fd[_0x5ac48b][_0x9a2e('0x15')]){_0x4cd165['addEdge'](_0x3556fd[_0x5ac48b]['source'],_0x3556fd[_0x5ac48b]['target'],_0x3556fd[_0x5ac48b][_0x9a2e('0x16')]);}}return _0x4cd165;}function getRoot(_0x4701cf){return parser[_0x9a2e('0x17')](_0x4701cf,{'object':!![]})[_0x9a2e('0x18')]['root'];}function inspect(_0x183489){return util['inspect'](_0x183489,{'showHidden':![],'depth':null});}function initialize(_0x323628,_0x45e3b3){var _0x44d897=getRoot(_0x323628['production']);if(!_0x44d897||!_0x44d897[_0x9a2e('0x19')])return;var _0xadb5d4,_0x270775,_0x33bef6;logger[_0x9a2e('0x1a')](_0x9a2e('0x1b'),JSON[_0x9a2e('0x1c')](_0x44d897,null,0x2));_0x45e3b3[_0x9a2e('0x1d')]=moment()[_0x9a2e('0x1e')](_0x9a2e('0x1f'));_0xadb5d4=initGraph(_[_0x9a2e('0x12')](_0x44d897,_0x9a2e('0x20')),_0x44d897[_0x9a2e('0x20')]);_0x270775=new Vertices(_0x45e3b3,rpc,mailRpc);logger[_0x9a2e('0x21')](util[_0x9a2e('0x1e')](_0x9a2e('0x22'),_0x45e3b3[_0x9a2e('0x23')],_0x45e3b3['calleridname'],_0x45e3b3[_0x9a2e('0x24')],_0x45e3b3['dnid'],_0x45e3b3[_0x9a2e('0x25')]));_0xadb5d4['traverseBFS'](_0x44d897[_0x9a2e('0x19')]['id'],function(_0x3cebe7){try{_0x3cebe7=_0x270775[_0x9a2e('0x26')](_0x3cebe7);logger[_0x9a2e('0x1a')]('vertex',JSON['stringify'](_0x3cebe7,null,0x2));if(_0x3cebe7[_0x9a2e('0xe')]===_0x9a2e('0x27')){logger[_0x9a2e('0x21')](_0x9a2e('0x28'));_0x45e3b3[_0x9a2e('0x29')]=_0x3cebe7[_0x9a2e('0x29')]||_0x45e3b3[_0x9a2e('0x29')];_0x45e3b3[_0x9a2e('0x2a')]=_0x3cebe7[_0x9a2e('0x2a')];_0x45e3b3[_0x9a2e('0x2b')]=_0x3cebe7['priority']?_0x3cebe7[_0x9a2e('0x2b')]-0x1:0x1;return null;}else if(_0x3cebe7&&_0x270775[_0x3cebe7[_0x9a2e('0xe')]]){_0x33bef6=_0x270775[_0x3cebe7[_0x9a2e('0xe')]](_0x3cebe7);logger[_0x9a2e('0x21')](_0x9a2e('0x2c'),JSON['stringify'](_0x33bef6,null,0x2));if(_0x33bef6&&_0x33bef6[_0x9a2e('0x2d')]===AGI_CODE_SUCCESS&&_0x33bef6[_0x9a2e('0x2e')]!==AGI_RESULT_ERROR&&!_0x45e3b3[_0x9a2e('0x2f')]){logger[_0x9a2e('0x1a')](_0x9a2e('0x2c'),inspect(_0x33bef6));return _[_0x9a2e('0x30')](_0x33bef6[_0x9a2e('0x2e')])?null:_0x33bef6['result']['toString']();}else{logger[_0x9a2e('0xb')](_0x9a2e('0x2c'),inspect(_0x33bef6));return null;}}else{logger[_0x9a2e('0xb')](_0x9a2e('0x31'));return null;}}catch(_0x1bfa5d){logger['error'](_0x1bfa5d[_0x9a2e('0xd')]);return null;}});if(_0x44d897[_0x9a2e('0x32')]){logger[_0x9a2e('0x21')](util[_0x9a2e('0x1e')](_0x9a2e('0x33'),_0x45e3b3[_0x9a2e('0x23')],_0x45e3b3[_0x9a2e('0x34')],_0x45e3b3[_0x9a2e('0x24')],_0x45e3b3[_0x9a2e('0x35')],_0x45e3b3[_0x9a2e('0x25')]));_0xadb5d4[_0x9a2e('0x36')](_0x44d897['finally']['id'],function(_0x171e52){try{_0x171e52=_0x270775[_0x9a2e('0x26')](_0x171e52);logger['debug'](_0x9a2e('0x37'),JSON['stringify'](_0x171e52,null,0x2));if(_0x171e52&&_0x270775[_0x171e52[_0x9a2e('0xe')]]){_0x33bef6=_0x270775[_0x171e52['agicommand']](_0x171e52);if(_0x33bef6){logger[_0x9a2e('0x1a')](_0x9a2e('0x2c'),inspect(_0x33bef6));return _['isUndefined'](_0x33bef6['result'])?null:_0x33bef6['result']['toString']();}else{logger[_0x9a2e('0xb')](_0x9a2e('0x2c'),inspect(_0x33bef6));return null;}}else{logger[_0x9a2e('0xb')](_0x9a2e('0x31'));return null;}}catch(_0x5ea09d){logger['error'](_0x5ea09d[_0x9a2e('0xd')]);return null;}});}logger[_0x9a2e('0x21')](util['format'](_0x9a2e('0x38'),_0x45e3b3['arg_1'],_0x45e3b3[_0x9a2e('0x34')],_0x45e3b3[_0x9a2e('0x24')],_0x45e3b3[_0x9a2e('0x35')],_0x45e3b3[_0x9a2e('0x25')]));logger[_0x9a2e('0x21')](util[_0x9a2e('0x1e')](_0x9a2e('0x39'),_0x45e3b3[_0x9a2e('0x29')],_0x45e3b3['extension'],parseInt(_0x45e3b3[_0x9a2e('0x2b')],0xa)+0x1));_0x45e3b3[_0x9a2e('0x3a')](_0x45e3b3['context'],_0x45e3b3[_0x9a2e('0x2a')],parseInt(_0x45e3b3[_0x9a2e('0x2b')],0xa)+0x1);_0x45e3b3[_0x9a2e('0x3b')]();}function handleNotFound(_0x4384b7){logger['error'](util[_0x9a2e('0x1e')]('Project\x20%s\x20not\x20found',_0x4384b7[_0x9a2e('0x23')]));_0x4384b7[_0x9a2e('0x3a')](_0x4384b7[_0x9a2e('0x29')],_0x4384b7[_0x9a2e('0x2a')],parseInt(_0x4384b7[_0x9a2e('0x2b')],0xa)+0x1);_0x4384b7['close']();}function handleUnpublished(_0x2ce402){logger[_0x9a2e('0xb')](util['format'](_0x9a2e('0x3c'),_0x2ce402[_0x9a2e('0x23')]));_0x2ce402[_0x9a2e('0x3a')](_0x2ce402[_0x9a2e('0x29')],_0x2ce402[_0x9a2e('0x2a')],parseInt(_0x2ce402[_0x9a2e('0x2b')],0xa)+0x1);_0x2ce402[_0x9a2e('0x3b')]();}module[_0x9a2e('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
+var _0x5d0a=['debug','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','traverseBFS','clear','gotoc','context','extension','priority','response','evtHangup','result','error','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','isUndefined','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','exports','lodash','moment','xml2json','util','../../config/logger','./rpc','./graph','./vertices','getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','target','addEdge','source','value','mxGraphModel','root','production'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0x5d0a,0x11a));var _0xa5d0=function(_0x5d4908,_0x1d0983){_0x5d4908=_0x5d4908-0x0;var _0x310aa3=_0x5d0a[_0x5d4908];return _0x310aa3;};'use strict';var _=require(_0xa5d0('0x0'));var moment=require(_0xa5d0('0x1'));var parser=require(_0xa5d0('0x2'));var util=require(_0xa5d0('0x3'));var logger=require(_0xa5d0('0x4'))('agi');var rpc=require(_0xa5d0('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0xa5d0('0x6'));var Vertices=require(_0xa5d0('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xa5d0('0x8')]()[_0xa5d0('0x9')](function(_0x5171d3){logger['error'](_0xa5d0('0xa'),_0x5171d3[_0xa5d0('0xb')]);return[];});}function addVertex(_0x5198ed,_0x49350b,_0x1494db){_0x49350b[_0xa5d0('0xc')]=_0x1494db;if(_0x49350b[_0xa5d0('0xd')](_0xa5d0('0xe'))){_0x49350b[_0xa5d0('0xf')]=parseInt(_0x49350b[_0xa5d0('0xe')],0xa);}_0x5198ed[_0xa5d0('0x10')](_[_0xa5d0('0x11')](_0x49350b,_0xa5d0('0x12')));}function initGraph(_0x120916,_0x1a6597){var _0x45f8a7=new Graph();for(var _0x2f8fd6 in _0x120916){if(_0x120916[_0xa5d0('0xd')](_0x2f8fd6)){if(_[_0xa5d0('0x13')](_0x120916[_0x2f8fd6])){for(var _0xae5671=0x0;_0xae5671<_0x120916[_0x2f8fd6]['length'];_0xae5671+=0x1){addVertex(_0x45f8a7,_0x120916[_0x2f8fd6][_0xae5671],_0x2f8fd6);}}else{addVertex(_0x45f8a7,_0x120916[_0x2f8fd6],_0x2f8fd6);}}}for(var _0x233a01=0x0;_0x233a01<_0x1a6597[_0xa5d0('0x14')];_0x233a01+=0x1){if(_0x1a6597[_0x233a01]['source']&&_0x1a6597[_0x233a01][_0xa5d0('0x15')]){_0x45f8a7[_0xa5d0('0x16')](_0x1a6597[_0x233a01][_0xa5d0('0x17')],_0x1a6597[_0x233a01][_0xa5d0('0x15')],_0x1a6597[_0x233a01][_0xa5d0('0x18')]);}}return _0x45f8a7;}function getRoot(_0x4fa52b){return parser['toJson'](_0x4fa52b,{'object':!![]})[_0xa5d0('0x19')][_0xa5d0('0x1a')];}function inspect(_0x5d6ada){return util['inspect'](_0x5d6ada,{'showHidden':![],'depth':null});}function initialize(_0x181dfa,_0x3eb38e){var _0x26d8af=getRoot(_0x181dfa[_0xa5d0('0x1b')]);if(!_0x26d8af||!_0x26d8af['start'])return;var _0x123f64,_0x525849,_0x50d5f1;logger[_0xa5d0('0x1c')]('root',JSON[_0xa5d0('0x1d')](_0x26d8af,null,0x2));_0x3eb38e[_0xa5d0('0x1e')]=moment()['format'](_0xa5d0('0x1f'));_0x123f64=initGraph(_['omit'](_0x26d8af,_0xa5d0('0x12')),_0x26d8af[_0xa5d0('0x12')]);_0x525849=new Vertices(_0x3eb38e,rpc,mailRpc);logger[_0xa5d0('0x20')](util[_0xa5d0('0x21')](_0xa5d0('0x22'),_0x3eb38e[_0xa5d0('0x23')],_0x3eb38e[_0xa5d0('0x24')],_0x3eb38e['callerid'],_0x3eb38e[_0xa5d0('0x25')],_0x3eb38e[_0xa5d0('0x26')]));_0x123f64[_0xa5d0('0x27')](_0x26d8af['start']['id'],function(_0x32ee81){try{_0x32ee81=_0x525849[_0xa5d0('0x28')](_0x32ee81);logger[_0xa5d0('0x1c')]('vertex',JSON[_0xa5d0('0x1d')](_0x32ee81,null,0x2));if(_0x32ee81['agicommand']===_0xa5d0('0x29')){logger[_0xa5d0('0x20')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x3eb38e[_0xa5d0('0x2a')]=_0x32ee81[_0xa5d0('0x2a')]||_0x3eb38e['context'];_0x3eb38e[_0xa5d0('0x2b')]=_0x32ee81['extension'];_0x3eb38e[_0xa5d0('0x2c')]=_0x32ee81[_0xa5d0('0x2c')]?_0x32ee81[_0xa5d0('0x2c')]-0x1:0x1;return null;}else if(_0x32ee81&&_0x525849[_0x32ee81[_0xa5d0('0xc')]]){_0x50d5f1=_0x525849[_0x32ee81[_0xa5d0('0xc')]](_0x32ee81);logger[_0xa5d0('0x20')](_0xa5d0('0x2d'),JSON['stringify'](_0x50d5f1,null,0x2));if(_0x50d5f1&&_0x50d5f1['code']===AGI_CODE_SUCCESS&&_0x50d5f1['result']!==AGI_RESULT_ERROR&&!_0x3eb38e[_0xa5d0('0x2e')]){logger[_0xa5d0('0x1c')](_0xa5d0('0x2d'),inspect(_0x50d5f1));return _['isUndefined'](_0x50d5f1['result'])?null:_0x50d5f1[_0xa5d0('0x2f')]['toString']();}else{logger[_0xa5d0('0x30')](_0xa5d0('0x2d'),inspect(_0x50d5f1));return null;}}else{logger[_0xa5d0('0x30')](_0xa5d0('0x31'));return null;}}catch(_0x424d5f){logger[_0xa5d0('0x30')](_0x424d5f['stack']);return null;}});if(_0x26d8af[_0xa5d0('0x32')]){logger['info'](util['format'](_0xa5d0('0x33'),_0x3eb38e[_0xa5d0('0x23')],_0x3eb38e[_0xa5d0('0x24')],_0x3eb38e['callerid'],_0x3eb38e[_0xa5d0('0x25')],_0x3eb38e['uniqueid']));_0x123f64[_0xa5d0('0x27')](_0x26d8af['finally']['id'],function(_0x3a141a){try{_0x3a141a=_0x525849[_0xa5d0('0x28')](_0x3a141a);logger['debug'](_0xa5d0('0x34'),JSON[_0xa5d0('0x1d')](_0x3a141a,null,0x2));if(_0x3a141a&&_0x525849[_0x3a141a[_0xa5d0('0xc')]]){_0x50d5f1=_0x525849[_0x3a141a[_0xa5d0('0xc')]](_0x3a141a);if(_0x50d5f1){logger[_0xa5d0('0x1c')](_0xa5d0('0x2d'),inspect(_0x50d5f1));return _[_0xa5d0('0x35')](_0x50d5f1[_0xa5d0('0x2f')])?null:_0x50d5f1[_0xa5d0('0x2f')][_0xa5d0('0x36')]();}else{logger[_0xa5d0('0x30')](_0xa5d0('0x2d'),inspect(_0x50d5f1));return null;}}else{logger[_0xa5d0('0x30')](_0xa5d0('0x31'));return null;}}catch(_0x196920){logger['error'](_0x196920['stack']);return null;}});}logger[_0xa5d0('0x20')](util[_0xa5d0('0x21')](_0xa5d0('0x37'),_0x3eb38e['arg_1'],_0x3eb38e[_0xa5d0('0x24')],_0x3eb38e[_0xa5d0('0x38')],_0x3eb38e['dnid'],_0x3eb38e['uniqueid']));logger[_0xa5d0('0x20')](util[_0xa5d0('0x21')](_0xa5d0('0x39'),_0x3eb38e[_0xa5d0('0x2a')],_0x3eb38e[_0xa5d0('0x2b')],parseInt(_0x3eb38e['priority'],0xa)+0x1));_0x3eb38e[_0xa5d0('0x3a')](_0x3eb38e['context'],_0x3eb38e[_0xa5d0('0x2b')],parseInt(_0x3eb38e[_0xa5d0('0x2c')],0xa)+0x1);_0x3eb38e[_0xa5d0('0x3b')]();}function handleNotFound(_0x11bcb0){logger[_0xa5d0('0x30')](util[_0xa5d0('0x21')](_0xa5d0('0x3c'),_0x11bcb0[_0xa5d0('0x23')]));_0x11bcb0[_0xa5d0('0x3a')](_0x11bcb0[_0xa5d0('0x2a')],_0x11bcb0[_0xa5d0('0x2b')],parseInt(_0x11bcb0['priority'],0xa)+0x1);_0x11bcb0[_0xa5d0('0x3b')]();}function handleUnpublished(_0x2cf294){logger['error'](util[_0xa5d0('0x21')]('Project\x20%s\x20not\x20published',_0x2cf294[_0xa5d0('0x23')]));_0x2cf294[_0xa5d0('0x3a')](_0x2cf294[_0xa5d0('0x2a')],_0x2cf294['extension'],parseInt(_0x2cf294['priority'],0xa)+0x1);_0x2cf294[_0xa5d0('0x3b')]();}module[_0xa5d0('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
index de3b08f..87a3ed1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c83=['prototype','_transform','\x0d\x0a\x0d\x0a','indexOf','split','slice','trim','length','emit','headers','substring','exports','stream','Transform','_localBuffer','inherits'];(function(_0x5f5859,_0x448152){var _0x58ab8c=function(_0x1c331f){while(--_0x1c331f){_0x5f5859['push'](_0x5f5859['shift']());}};_0x58ab8c(++_0x448152);}(_0x1c83,0x16c));var _0x31c8=function(_0x491952,_0x16251a){_0x491952=_0x491952-0x0;var _0x429ebf=_0x1c83[_0x491952];return _0x429ebf;};'use strict';var util=require('util');var Transform=require(_0x31c8('0x0'))[_0x31c8('0x1')];function AGIReply(_0x533496){Transform['call'](this,_0x533496);this[_0x31c8('0x2')]='';this['_inBody']=![];}util[_0x31c8('0x3')](AGIReply,Transform);AGIReply[_0x31c8('0x4')][_0x31c8('0x5')]=function(_0x5258f9,_0x1bb165,_0x20d8c7){var _0x375a22='\x0a',_0x1adf53=['\x0a\x0a',_0x31c8('0x6')],_0x17e8eb=-0x1,_0x160029=-0x1,_0x115b57='',_0x331082=0x0,_0x2eba29='',_0x44dc8c='';this[_0x31c8('0x2')]+=_0x5258f9['toString']();_0x2eba29=this[_0x31c8('0x2')];if(!this['_inBody']){_0x331082=0x0;while(_0x1adf53[_0x331082]){while((_0x160029=_0x2eba29[_0x31c8('0x7')](_0x1adf53[_0x331082]))!=-0x1){_0x115b57=_0x1adf53[_0x331082];_0x44dc8c=_0x2eba29['substring'](0x0,_0x160029);_0x2eba29=_0x2eba29['substring'](_0x160029+_0x115b57['length']);var _0x50f51c=_0x44dc8c[_0x31c8('0x8')](_0x375a22),_0x5df3bc=0x0,_0x4b77d1={},_0x28875='',_0x640148='',_0x3a8b5d=-0x1;while(_0x50f51c[_0x5df3bc]){_0x3a8b5d=_0x50f51c[_0x5df3bc][_0x31c8('0x7')](':');if(_0x3a8b5d!=-0x1){_0x28875=_0x50f51c[_0x5df3bc][_0x31c8('0x9')](0x0,_0x3a8b5d)['trim']();_0x640148=_0x50f51c[_0x5df3bc][_0x31c8('0x9')](_0x3a8b5d+0x1)[_0x31c8('0xa')]();if(_0x28875[_0x31c8('0xb')]>0x0){_0x4b77d1[_0x28875]=_0x640148;}}else{}_0x5df3bc++;}this[_0x31c8('0xc')](_0x31c8('0xd'),_0x4b77d1);this['_inBody']=!![];}_0x331082++;}this[_0x31c8('0x2')]=_0x2eba29;}else{while((_0x17e8eb=_0x2eba29['indexOf'](_0x375a22))!=-0x1){_0x44dc8c=_0x2eba29[_0x31c8('0xe')](0x0,_0x17e8eb);this[_0x31c8('0xc')]('line',_0x44dc8c);_0x2eba29=_0x2eba29[_0x31c8('0xe')](_0x17e8eb+_0x375a22['length']);}this[_0x31c8('0x2')]=_0x2eba29;}_0x20d8c7();};module[_0x31c8('0xf')]=AGIReply;
\ No newline at end of file
+var _0x7d3f=['call','_localBuffer','_inBody','inherits','prototype','_transform','toString','indexOf','substring','length','split','trim','emit','headers','util','stream'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0x7d3f,0x16e));var _0xf7d3=function(_0x4c3ffe,_0x457374){_0x4c3ffe=_0x4c3ffe-0x0;var _0x28d3eb=_0x7d3f[_0x4c3ffe];return _0x28d3eb;};'use strict';var util=require(_0xf7d3('0x0'));var Transform=require(_0xf7d3('0x1'))['Transform'];function AGIReply(_0xcd16e0){Transform[_0xf7d3('0x2')](this,_0xcd16e0);this[_0xf7d3('0x3')]='';this[_0xf7d3('0x4')]=![];}util[_0xf7d3('0x5')](AGIReply,Transform);AGIReply[_0xf7d3('0x6')][_0xf7d3('0x7')]=function(_0x74d426,_0x280f79,_0x3bb1d9){var _0x5cd8ca='\x0a',_0x4e0767=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x1fe61a=-0x1,_0x5d586e=-0x1,_0x224857='',_0x23ff46=0x0,_0x579cb8='',_0x4ebd2a='';this[_0xf7d3('0x3')]+=_0x74d426[_0xf7d3('0x8')]();_0x579cb8=this[_0xf7d3('0x3')];if(!this[_0xf7d3('0x4')]){_0x23ff46=0x0;while(_0x4e0767[_0x23ff46]){while((_0x5d586e=_0x579cb8[_0xf7d3('0x9')](_0x4e0767[_0x23ff46]))!=-0x1){_0x224857=_0x4e0767[_0x23ff46];_0x4ebd2a=_0x579cb8[_0xf7d3('0xa')](0x0,_0x5d586e);_0x579cb8=_0x579cb8[_0xf7d3('0xa')](_0x5d586e+_0x224857[_0xf7d3('0xb')]);var _0x4b8a57=_0x4ebd2a[_0xf7d3('0xc')](_0x5cd8ca),_0x21872d=0x0,_0x22bef8={},_0x2e4e84='',_0x15b1d6='',_0x508a2c=-0x1;while(_0x4b8a57[_0x21872d]){_0x508a2c=_0x4b8a57[_0x21872d]['indexOf'](':');if(_0x508a2c!=-0x1){_0x2e4e84=_0x4b8a57[_0x21872d]['slice'](0x0,_0x508a2c)[_0xf7d3('0xd')]();_0x15b1d6=_0x4b8a57[_0x21872d]['slice'](_0x508a2c+0x1)[_0xf7d3('0xd')]();if(_0x2e4e84[_0xf7d3('0xb')]>0x0){_0x22bef8[_0x2e4e84]=_0x15b1d6;}}else{}_0x21872d++;}this[_0xf7d3('0xe')](_0xf7d3('0xf'),_0x22bef8);this['_inBody']=!![];}_0x23ff46++;}this['_localBuffer']=_0x579cb8;}else{while((_0x1fe61a=_0x579cb8[_0xf7d3('0x9')](_0x5cd8ca))!=-0x1){_0x4ebd2a=_0x579cb8[_0xf7d3('0xa')](0x0,_0x1fe61a);this['emit']('line',_0x4ebd2a);_0x579cb8=_0x579cb8[_0xf7d3('0xa')](_0x1fe61a+_0x5cd8ca['length']);}this[_0xf7d3('0x3')]=_0x579cb8;}_0x3bb1d9();};module['exports']=AGIReply;
\ No newline at end of file
index 1bd831f..25aa7c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3164=['CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','then','CreateCmContact','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','lodash','moment','jayson/promise','client','http','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','email','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport'];(function(_0x3d469c,_0x12086f){var _0x40749b=function(_0x20132c){while(--_0x20132c){_0x3d469c['push'](_0x3d469c['shift']());}};_0x40749b(++_0x12086f);}(_0x3164,0x182));var _0x4316=function(_0x41b6a3,_0x58d1b1){_0x41b6a3=_0x41b6a3-0x0;var _0x524f0f=_0x3164[_0x41b6a3];return _0x524f0f;};'use strict';var _=require(_0x4316('0x0'));var moment=require(_0x4316('0x1'));var jayson=require(_0x4316('0x2'));var client=jayson[_0x4316('0x3')][_0x4316('0x4')]({'port':0x2329});function request(_0x588480,_0x2534d3){return new Promise(function(_0x2355a6,_0x1235d9){return client['request'](_0x588480,_0x2534d3)['then'](function(_0x27bfc8){if(_0x27bfc8[_0x4316('0x5')]){return _0x1235d9(_0x27bfc8[_0x4316('0x5')][_0x4316('0x6')]);}else{return _0x2355a6(_0x27bfc8[_0x4316('0x7')]);}})[_0x4316('0x8')](function(_0x1bcd38){return _0x1235d9(_0x1bcd38);});});}exports[_0x4316('0x9')]=function(){return request(_0x4316('0xa'),{'options':{'raw':![],'attributes':['id',_0x4316('0xb'),_0x4316('0xc')]}});};exports[_0x4316('0xd')]=function(_0xb370dc){return request(_0x4316('0xe'),{'options':{'raw':![],'where':{'name':_0xb370dc},'attributes':['production']}});};exports[_0x4316('0xf')]=function(_0x446361){return request(_0x4316('0x10'),{'options':{'raw':![],'where':{'id':_0x446361},'include':[{'model':_0x4316('0x11'),'as':'Smtp','include':[{'model':_0x4316('0x12'),'as':_0x4316('0x12')}]}],'attributes':['id',_0x4316('0xb'),_0x4316('0x13')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x2fdbee){return request('ShowSquareProject',{'options':{'where':{'id':_0x2fdbee},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x266777){return request(_0x4316('0x14'),{'options':{'where':{'id':_0x266777},'attributes':['name']}});};exports[_0x4316('0x15')]=function(_0x486a64){return request(_0x4316('0x16'),{'options':{'where':{'id':_0x486a64},'attributes':[_0x4316('0xb')]}});};exports[_0x4316('0x17')]=function(_0x1caa59){return request(_0x4316('0x18'),{'options':{'where':{'id':_0x1caa59},'attributes':[_0x4316('0x19')]}});};exports[_0x4316('0x1a')]=function(_0x38e68c){return request(_0x4316('0x1b'),{'options':{'where':{'id':_0x38e68c},'attributes':[_0x4316('0xb')]}});};exports['getContactByPhone']=function(_0x43069f){return request(_0x4316('0x1c'),{'options':{'where':{'phone':_0x43069f['phone']},'attributes':['id']}});};exports['getTrunkById']=function(_0x40f660){return request(_0x4316('0x1d'),{'options':{'where':{'id':_0x40f660},'attributes':[_0x4316('0xb')]}});};exports[_0x4316('0x1e')]=function(_0x247866){return request('ShowSound',{'options':{'where':{'id':_0x247866},'attributes':[_0x4316('0x1f')]}});};exports[_0x4316('0x20')]=function(_0x599c48){return request(_0x4316('0x21'),{'options':{'raw':![],'where':{'id':_0x599c48},'include':[{'model':_0x4316('0x22'),'as':_0x4316('0x23')}]}});};exports['getSmsAccountById']=function(_0x1736d0){return request(_0x4316('0x24'),{'options':{'where':{'id':_0x1736d0},'attributes':['id',_0x4316('0xb')]}});};exports['createSmsMessage']=function(_0x3b994a){return request(_0x4316('0x25'),{'body':_0x3b994a});};exports[_0x4316('0x26')]=function(_0x2d2bda){return request(_0x4316('0x27'),{'body':_0x2d2bda});};exports[_0x4316('0x28')]=function(_0x1f7e8d){return request(_0x4316('0x29'),{'body':_[_0x4316('0x2a')](_0x1f7e8d,{'project_name':_0x1f7e8d[_0x4316('0x2b')],'prev_project_name':_0x1f7e8d[_0x4316('0x2c')]||'','is_subproject':_0x1f7e8d[_0x4316('0x2c')]?!![]:![],'leaveAt':moment()[_0x4316('0x2d')](_0x4316('0x2e'))})});};exports[_0x4316('0x2f')]=function(_0x31cd5f){return request(_0x4316('0x30'),{'body':_0x31cd5f});};exports['createSquareMessage']=function(_0x522ced){return request(_0x4316('0x31'),{'body':_0x522ced});};exports[_0x4316('0x32')]=function(_0xa8dd01){return request(_0x4316('0x33'),{'options':{'raw':![],'where':{'phone':_0xa8dd01[_0x4316('0x34')],'ListId':_0xa8dd01['ListId']}}})[_0x4316('0x35')](function(_0x4b13aa){if(_0x4b13aa){return _0x4b13aa;}return request(_0x4316('0x36'),{'body':_0xa8dd01});});};exports['getPauseById']=function(_0x46df48){return request('ShowPause',{'options':{'where':{'id':_0x46df48},'attributes':[_0x4316('0xb')]}});};exports[_0x4316('0x37')]=function(_0x4f88a2,_0x22eedf){return request('LoginUser',{'body':{'interface':_0x22eedf},'options':{'where':_0x4f88a2}});};exports[_0x4316('0x38')]=function(_0x1b3db9,_0x2d7e64,_0x261908){return request(_0x4316('0x39'),{'body':{'type':_0x2d7e64,'uniqueid':_0x261908},'options':{'where':_0x1b3db9}});};exports[_0x4316('0x3a')]=function(_0x3bcbee){return request(_0x4316('0x3b'),{'body':{},'options':{'where':_0x3bcbee}});};exports['agentLogout']=function(_0x9bf1ff){return request(_0x4316('0x3c'),{'body':{},'options':{'where':_0x9bf1ff}});};
\ No newline at end of file
+var _0xc090=['getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','lodash','moment','jayson/promise','client','http','then','message','catch','getSquareProjects','name','production','getMailAccountById','ShowMailAccount','CloudProvider','getSquareProjectById','ShowSquareProject'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc090,0x112));var _0x0c09=function(_0x9e02e,_0x2dbe7e){_0x9e02e=_0x9e02e-0x0;var _0x2d1ee8=_0xc090[_0x9e02e];return _0x2d1ee8;};'use strict';var _=require(_0x0c09('0x0'));var moment=require(_0x0c09('0x1'));var jayson=require(_0x0c09('0x2'));var client=jayson[_0x0c09('0x3')][_0x0c09('0x4')]({'port':0x2329});function request(_0x1b296d,_0x289436){return new Promise(function(_0x260c36,_0x11984f){return client['request'](_0x1b296d,_0x289436)[_0x0c09('0x5')](function(_0x31863d){if(_0x31863d['error']){return _0x11984f(_0x31863d['error'][_0x0c09('0x6')]);}else{return _0x260c36(_0x31863d['result']);}})[_0x0c09('0x7')](function(_0x2854d8){return _0x11984f(_0x2854d8);});});}exports[_0x0c09('0x8')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0x0c09('0x9'),_0x0c09('0xa')]}});};exports['getSquareProject']=function(_0x86df5){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x86df5},'attributes':[_0x0c09('0xa')]}});};exports[_0x0c09('0xb')]=function(_0x273b07){return request(_0x0c09('0xc'),{'options':{'raw':![],'where':{'id':_0x273b07},'include':[{'model':'MailServerOut','as':'Smtp','include':[{'model':'CloudProvider','as':_0x0c09('0xd')}]}],'attributes':['id','name','email'],'smtp':!![]}});};exports[_0x0c09('0xe')]=function(_0x4cc121){return request(_0x0c09('0xf'),{'options':{'where':{'id':_0x4cc121},'attributes':[_0x0c09('0x9')]}});};exports[_0x0c09('0x10')]=function(_0xeb18fb){return request(_0x0c09('0x11'),{'options':{'where':{'id':_0xeb18fb},'attributes':[_0x0c09('0x9')]}});};exports[_0x0c09('0x12')]=function(_0x2dcdae){return request(_0x0c09('0x13'),{'options':{'where':{'id':_0x2dcdae},'attributes':[_0x0c09('0x9')]}});};exports['getSquareOdbcById']=function(_0x3ea66e){return request(_0x0c09('0x14'),{'options':{'where':{'id':_0x3ea66e},'attributes':[_0x0c09('0x15')]}});};exports[_0x0c09('0x16')]=function(_0x20ad8a){return request(_0x0c09('0x17'),{'options':{'where':{'id':_0x20ad8a},'attributes':[_0x0c09('0x9')]}});};exports[_0x0c09('0x18')]=function(_0xffc47){return request(_0x0c09('0x19'),{'options':{'where':{'phone':_0xffc47[_0x0c09('0x1a')]},'attributes':['id']}});};exports[_0x0c09('0x1b')]=function(_0x519eea){return request(_0x0c09('0x1c'),{'options':{'where':{'id':_0x519eea},'attributes':[_0x0c09('0x9')]}});};exports['getSoundById']=function(_0x522184){return request(_0x0c09('0x1d'),{'options':{'where':{'id':_0x522184},'attributes':[_0x0c09('0x1e')]}});};exports[_0x0c09('0x1f')]=function(_0x48c124){return request(_0x0c09('0x20'),{'options':{'raw':![],'where':{'id':_0x48c124},'include':[{'model':_0x0c09('0x21'),'as':_0x0c09('0x22')}]}});};exports['getSmsAccountById']=function(_0x301938){return request('ShowSmsAccount',{'options':{'where':{'id':_0x301938},'attributes':['id',_0x0c09('0x9')]}});};exports[_0x0c09('0x23')]=function(_0x3aaabf){return request(_0x0c09('0x24'),{'body':_0x3aaabf});};exports[_0x0c09('0x25')]=function(_0x3fc5e4){return request(_0x0c09('0x26'),{'body':_0x3fc5e4});};exports[_0x0c09('0x27')]=function(_0x4c7f0b){return request('CreateSquareReport',{'body':_[_0x0c09('0x28')](_0x4c7f0b,{'project_name':_0x4c7f0b[_0x0c09('0x29')],'prev_project_name':_0x4c7f0b[_0x0c09('0x2a')]||'','is_subproject':_0x4c7f0b[_0x0c09('0x2a')]?!![]:![],'leaveAt':moment()[_0x0c09('0x2b')](_0x0c09('0x2c'))})});};exports[_0x0c09('0x2d')]=function(_0x49d07a){return request('CreateSquareRecording',{'body':_0x49d07a});};exports[_0x0c09('0x2e')]=function(_0x454dea){return request(_0x0c09('0x2f'),{'body':_0x454dea});};exports[_0x0c09('0x30')]=function(_0x2ce4e9){return request(_0x0c09('0x31'),{'options':{'raw':![],'where':{'phone':_0x2ce4e9[_0x0c09('0x1a')],'ListId':_0x2ce4e9[_0x0c09('0x32')]}}})[_0x0c09('0x5')](function(_0xbd37e1){if(_0xbd37e1){return _0xbd37e1;}return request('CreateCmContact',{'body':_0x2ce4e9});});};exports['getPauseById']=function(_0x19b277){return request(_0x0c09('0x33'),{'options':{'where':{'id':_0x19b277},'attributes':['name']}});};exports[_0x0c09('0x34')]=function(_0x252f4c,_0x178b29){return request(_0x0c09('0x35'),{'body':{'interface':_0x178b29},'options':{'where':_0x252f4c}});};exports[_0x0c09('0x36')]=function(_0x4550a4,_0x548e1a,_0x30407a){return request(_0x0c09('0x37'),{'body':{'type':_0x548e1a,'uniqueid':_0x30407a},'options':{'where':_0x4550a4}});};exports[_0x0c09('0x38')]=function(_0x54c428){return request(_0x0c09('0x39'),{'body':{},'options':{'where':_0x54c428}});};exports['agentLogout']=function(_0x575677){return request('LogoutUser',{'body':{},'options':{'where':_0x575677}});};
\ No newline at end of file
index a4ace91..f2c9fb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x280b=['./polly','./lex'];(function(_0x1b41e4,_0x23d986){var _0x470641=function(_0x58952e){while(--_0x58952e){_0x1b41e4['push'](_0x1b41e4['shift']());}};_0x470641(++_0x23d986);}(_0x280b,0xce));var _0xb280=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x280b[_0x6c993a];return _0x27f547;};var polly=require(_0xb280('0x0'));var lex=require(_0xb280('0x1'));module['exports']={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0xf981=['./lex','exports','./polly'];(function(_0x15abda,_0x234403){var _0x494528=function(_0xb2cab5){while(--_0xb2cab5){_0x15abda['push'](_0x15abda['shift']());}};_0x494528(++_0x234403);}(_0xf981,0xe6));var _0x1f98=function(_0x4b530a,_0xe29621){_0x4b530a=_0x4b530a-0x0;var _0x54fb6d=_0xf981[_0x4b530a];return _0x54fb6d;};var polly=require(_0x1f98('0x0'));var lex=require(_0x1f98('0x1'));module[_0x1f98('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
index 6c6d4a1..8522911 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var lex=require('./lib/api');module['exports']=function(_0x352a8d,_0x2a91b2,_0x4611be,_0x20aa4b,_0x447096,_0x192d48){return lex(_0x352a8d,_0x2a91b2,_0x4611be,_0x20aa4b,_0x447096,_0x192d48);};
\ No newline at end of file
+var _0x41bb=['exports','./lib/api'];(function(_0x1ce272,_0x4924ed){var _0x416eb6=function(_0x422e14){while(--_0x422e14){_0x1ce272['push'](_0x1ce272['shift']());}};_0x416eb6(++_0x4924ed);}(_0x41bb,0xc5));var _0xb41b=function(_0x52568e,_0x1698a4){_0x52568e=_0x52568e-0x0;var _0x5c64d7=_0x41bb[_0x52568e];return _0x5c64d7;};'use strict';var lex=require(_0xb41b('0x0'));module[_0xb41b('0x1')]=function(_0x4ef2f1,_0x428431,_0x4d5578,_0x30ea75,_0x1c9d36,_0x148333){return lex(_0x4ef2f1,_0x428431,_0x4d5578,_0x30ea75,_0x1c9d36,_0x148333);};
\ No newline at end of file
index 1e11c82..366bc03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x4aa213,_0x4c3cdc){var _0x3a53f=function(_0xe2753){while(--_0xe2753){_0x4aa213['push'](_0x4aa213['shift']());}};_0x3a53f(++_0x4c3cdc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x184586,_0xa2951e){var _0x268eb7=function(_0x5c7796){while(--_0x5c7796){_0x184586['push'](_0x184586['shift']());}};_0x268eb7(++_0xa2951e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 d67ea69..67f97d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb707=['exports','./lib/api'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xb707,0x10d));var _0x7b70=function(_0x271abe,_0x547fb5){_0x271abe=_0x271abe-0x0;var _0x2f1144=_0xb707[_0x271abe];return _0x2f1144;};'use strict';var polly=require(_0x7b70('0x0'));module[_0x7b70('0x1')]=function(_0x25738e,_0x1dc239,_0x48f5b7,_0x38c086,_0x1a033e,_0x7e16d2,_0x44ea8a){return polly(_0x25738e,_0x1dc239,_0x48f5b7,_0x38c086,_0x1a033e,_0x7e16d2,_0x44ea8a);};
\ No newline at end of file
+var _0x729f=['exports'];(function(_0xca48b5,_0x546b5a){var _0xc5390f=function(_0x40a1b7){while(--_0x40a1b7){_0xca48b5['push'](_0xca48b5['shift']());}};_0xc5390f(++_0x546b5a);}(_0x729f,0x1d4));var _0xf729=function(_0x1d350e,_0x40760c){_0x1d350e=_0x1d350e-0x0;var _0x306e96=_0x729f[_0x1d350e];return _0x306e96;};'use strict';var polly=require('./lib/api');module[_0xf729('0x0')]=function(_0x26d565,_0x4cd0fb,_0x7353df,_0x5c0832,_0x4ee1cd,_0x224acf,_0x38b880){return polly(_0x26d565,_0x4cd0fb,_0x7353df,_0x5c0832,_0x4ee1cd,_0x224acf,_0x38b880);};
\ No newline at end of file
index b6c121f..182e908 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2eca=['bluebird','randomstring','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','path'];(function(_0x2cc711,_0x300328){var _0x31a52e=function(_0x588378){while(--_0x588378){_0x2cc711['push'](_0x2cc711['shift']());}};_0x31a52e(++_0x300328);}(_0x2eca,0x8f));var _0xa2ec=function(_0x36fa31,_0x33ddeb){_0x36fa31=_0x36fa31-0x0;var _0x191e7d=_0x2eca[_0x36fa31];return _0x191e7d;};'use strict';var fs=require('fs');var path=require(_0xa2ec('0x0'));var BPromise=require(_0xa2ec('0x1'));var rs=require(_0xa2ec('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x549524,_0x323b32,_0x4977c9){return new BPromise(function(_0x21a801,_0x3edd52){_0x549524['synthesizeSpeech'](_0x323b32,function(_0x591417,_0x56cd7e){if(_0x591417){_0x3edd52(_0x591417);}else if(_0x56cd7e){if(_0x56cd7e[_0xa2ec('0x3')]instanceof Buffer){fs[_0xa2ec('0x4')](_0x4977c9,_0x56cd7e[_0xa2ec('0x3')],function(_0x5ecaa1){if(_0x5ecaa1){_0x3edd52(_0x5ecaa1);}else{_0x21a801();}});}else{_0x3edd52(new Error(_0xa2ec('0x5')));}}else{_0x3edd52(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xa2ec('0x6')]=function(_0x9dba17,_0x270b04,_0x4761ea,_0x48dc88,_0x1fd5c7,_0x48cf6a,_0x552eff){var _0x5aa459=new AWS['Polly']({'accessKeyId':_0x9dba17,'secretAccessKey':_0x270b04,'region':_0x4761ea});var _0x59783f={'Text':_0x1fd5c7,'TextType':_0x48cf6a||_0xa2ec('0x7'),'OutputFormat':'mp3','VoiceId':_0x48dc88};return pollyResult(_0x5aa459,_0x59783f,_0x552eff);};
\ No newline at end of file
+var _0xabdf=['aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3','bluebird','randomstring'];(function(_0x1fea3c,_0x2bf91c){var _0x50bb50=function(_0x5d5311){while(--_0x5d5311){_0x1fea3c['push'](_0x1fea3c['shift']());}};_0x50bb50(++_0x2bf91c);}(_0xabdf,0x134));var _0xfabd=function(_0x2caaef,_0x3c19ed){_0x2caaef=_0x2caaef-0x0;var _0xd011f8=_0xabdf[_0x2caaef];return _0xd011f8;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xfabd('0x0'));var rs=require(_0xfabd('0x1'));var AWS=require(_0xfabd('0x2'));function pollyResult(_0x5d629f,_0xb42c6,_0x30b657){return new BPromise(function(_0x25862a,_0x3529c0){_0x5d629f[_0xfabd('0x3')](_0xb42c6,function(_0x540706,_0x58c354){if(_0x540706){_0x3529c0(_0x540706);}else if(_0x58c354){if(_0x58c354['AudioStream']instanceof Buffer){fs[_0xfabd('0x4')](_0x30b657,_0x58c354[_0xfabd('0x5')],function(_0x557490){if(_0x557490){_0x3529c0(_0x557490);}else{_0x25862a();}});}else{_0x3529c0(new Error(_0xfabd('0x6')));}}else{_0x3529c0(new Error(_0xfabd('0x7')));}});});}module['exports']=function(_0x50eb18,_0xaff29d,_0x303ac5,_0x48e6db,_0x2a856d,_0x1c1a05,_0x4efd41){var _0x586839=new AWS['Polly']({'accessKeyId':_0x50eb18,'secretAccessKey':_0xaff29d,'region':_0x303ac5});var _0x1302c0={'Text':_0x2a856d,'TextType':_0x1c1a05||_0xfabd('0x8'),'OutputFormat':_0xfabd('0x9'),'VoiceId':_0x48e6db};return pollyResult(_0x586839,_0x1302c0,_0x4efd41);};
\ No newline at end of file
index 9f92304..1c82c14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc34f=['exports'];(function(_0x3290c8,_0x2365c0){var _0x54918c=function(_0x960872){while(--_0x960872){_0x3290c8['push'](_0x3290c8['shift']());}};_0x54918c(++_0x2365c0);}(_0xc34f,0x14d));var _0xfc34=function(_0xb93da8,_0x3a628b){_0xb93da8=_0xb93da8-0x0;var _0x5362fd=_0xc34f[_0xb93da8];return _0x5362fd;};'use strict';var asr=require('./lib/api');module[_0xfc34('0x0')]=function(_0x2f4df1,_0x349e86,_0x41c3bd,_0x218c6d){return asr(_0x2f4df1,_0x349e86,_0x41c3bd);};
\ No newline at end of file
+var _0x6278=['./lib/api'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x6278,0x177));var _0x8627=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0x6278[_0x31a576];return _0x30b1d3;};'use strict';var asr=require(_0x8627('0x0'));module['exports']=function(_0x39c0fc,_0x4dedad,_0x1ff351,_0x44a9c3){return asr(_0x39c0fc,_0x4dedad,_0x1ff351);};
\ No newline at end of file
index 13a6e5c..53f4f2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16d2=['lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined'];(function(_0x526c4c,_0x349e87){var _0xade133=function(_0x2b4c1c){while(--_0x2b4c1c){_0x526c4c['push'](_0x526c4c['shift']());}};_0xade133(++_0x349e87);}(_0x16d2,0x123));var _0x216d=function(_0x3c126c,_0x22f353){_0x3c126c=_0x3c126c-0x0;var _0x3b89e4=_0x16d2[_0x3c126c];return _0x3b89e4;};'use strict';var url=require(_0x216d('0x0'));var BPromise=require(_0x216d('0x1'));var fs=require('fs');var host=_0x216d('0x2');module[_0x216d('0x3')]=function(_0x1688cc,_0x3a2589,_0x34cf5b){return new BPromise(function(_0x239b49,_0xfd7306){var _0x593bb0;if(typeof _0x1688cc!==_0x216d('0x4')||_0x1688cc[_0x216d('0x5')]===0x0){return _0xfd7306(_0x216d('0x6'));}if(typeof _0x3a2589!==_0x216d('0x4')||_0x3a2589[_0x216d('0x5')]===0x0){return _0xfd7306(_0x216d('0x7'));}if(typeof _0x34cf5b!==_0x216d('0x8')&&(typeof _0x34cf5b!==_0x216d('0x4')||_0x34cf5b['length']===0x0)){return _0xfd7306(_0x216d('0x9'));}try{_0x593bb0=fs[_0x216d('0xa')](_0x1688cc)[_0x216d('0xb')](_0x216d('0xc'));}catch(_0x301058){return _0xfd7306(_0x301058);}return _0x239b49({'method':_0x216d('0xd'),'uri':host+'/v1/speech:recognize?key='+_0x3a2589,'body':{'config':{'encoding':_0x216d('0xe'),'sampleRateHertz':'8000','languageCode':_0x34cf5b},'audio':{'content':_0x593bb0}},'json':!![]});});};
\ No newline at end of file
+var _0x3e25=['toString','base64','POST','/v1/speech:recognize?key=','8000','url','bluebird','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x3e25,0x14f));var _0x53e2=function(_0x767c8c,_0x419bb3){_0x767c8c=_0x767c8c-0x0;var _0x556773=_0x3e25[_0x767c8c];return _0x556773;};'use strict';var url=require(_0x53e2('0x0'));var BPromise=require(_0x53e2('0x1'));var fs=require('fs');var host=_0x53e2('0x2');module['exports']=function(_0x7d9aaf,_0x4ac459,_0x3faa27){return new BPromise(function(_0x54366b,_0x36545f){var _0x2e0130;if(typeof _0x7d9aaf!==_0x53e2('0x3')||_0x7d9aaf[_0x53e2('0x4')]===0x0){return _0x36545f(_0x53e2('0x5'));}if(typeof _0x4ac459!==_0x53e2('0x3')||_0x4ac459[_0x53e2('0x4')]===0x0){return _0x36545f(_0x53e2('0x6'));}if(typeof _0x3faa27!==_0x53e2('0x7')&&(typeof _0x3faa27!==_0x53e2('0x3')||_0x3faa27[_0x53e2('0x4')]===0x0)){return _0x36545f(_0x53e2('0x8'));}try{_0x2e0130=fs[_0x53e2('0x9')](_0x7d9aaf)[_0x53e2('0xa')](_0x53e2('0xb'));}catch(_0x1b3c38){return _0x36545f(_0x1b3c38);}return _0x54366b({'method':_0x53e2('0xc'),'uri':host+_0x53e2('0xd')+_0x4ac459,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x53e2('0xe'),'languageCode':_0x3faa27},'audio':{'content':_0x2e0130}},'json':!![]});});};
\ No newline at end of file
index 34fd7f7..9f7b520 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaa7=['exports','./asr'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xcaa7,0x171));var _0x7caa=function(_0x1d397c,_0x2a80a8){_0x1d397c=_0x1d397c-0x0;var _0x1df016=_0xcaa7[_0x1d397c];return _0x1df016;};var asr=require(_0x7caa('0x0'));module[_0x7caa('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x2b18=['exports','./asr'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x2b18,0x6f));var _0x82b1=function(_0x38dc02,_0x3522d1){_0x38dc02=_0x38dc02-0x0;var _0x1a6fd6=_0x2b18[_0x38dc02];return _0x1a6fd6;};var asr=require(_0x82b1('0x0'));module[_0x82b1('0x1')]={'asr':asr};
\ No newline at end of file
index dfc9fe8..1361e3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe690=['tmp','generate','.wav','writeFileSync','then','unlink','chmodSync','777','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','text:synthesize','POST','resolve','audioContent','base64','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','.mp3','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','languageCode','queryText','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','sestekNDA','text','channelData','AudioFromTts','Data','dirName','bluebird','dialogflow','http','md5','querystring','request-promise','randomstring','google-tts-api','url','util','./aws','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','path','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','download\x20error','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert'];(function(_0x21e79a,_0x5a7990){var _0x506c02=function(_0x566c95){while(--_0x566c95){_0x21e79a['push'](_0x21e79a['shift']());}};_0x506c02(++_0x5a7990);}(_0xe690,0xe4));var _0x0e69=function(_0x1ac1aa,_0x9b0360){_0x1ac1aa=_0x1ac1aa-0x0;var _0x4812e2=_0xe690[_0x1ac1aa];return _0x4812e2;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x0e69('0x0'));var dialogflow=require(_0x0e69('0x1'));var fs=require('fs');var http=require(_0x0e69('0x2'));var https=require('https');var md5=require(_0x0e69('0x3'));var path=require('path');var querystring=require(_0x0e69('0x4'));var rp=require(_0x0e69('0x5'));var rs=require(_0x0e69('0x6'));var sox=require('sox');var tts=require(_0x0e69('0x7'));var urlParse=require(_0x0e69('0x8'))['parse'];var util=require(_0x0e69('0x9'));var aws=require(_0x0e69('0xa'));var google=require(_0x0e69('0xb'));var sestek=require(_0x0e69('0xc'));var tilde=require(_0x0e69('0xd'));var logger=require('../../../config/logger')(_0x0e69('0xe'));var ISPEECH_API=_0x0e69('0xf');function downloadFile(_0x505c36,_0x1a30cc){return new BPromise(function(_0x4f3a9f,_0x4d78a1){var _0x5c3a62=urlParse(_0x505c36);var _0x9961cf=_0x5c3a62[_0x0e69('0x10')]===_0x0e69('0x11')?https:http;var _0x3b8cb7={'host':_0x5c3a62['host'],'path':_0x5c3a62[_0x0e69('0x12')],'headers':{'user-agent':_0x0e69('0x13')}};_0x9961cf[_0x0e69('0x14')](_0x3b8cb7,function(_0x16f18b){if(_0x16f18b[_0x0e69('0x15')]!==0xc8){logger[_0x0e69('0x16')](_0x0e69('0x17')+_0x505c36+_0x0e69('0x18')+_0x16f18b['statusCode']+'\x20('+_0x16f18b[_0x0e69('0x19')]+')');_0x4d78a1(new Error(_0x0e69('0x17')+_0x505c36+_0x0e69('0x18')+_0x16f18b['statusCode']+'\x20('+_0x16f18b[_0x0e69('0x19')]+')'));return;}var _0x55f020=fs['createWriteStream'](_0x1a30cc);_0x55f020['on'](_0x0e69('0x1a'),function(){logger[_0x0e69('0x1b')](_0x0e69('0x1c'));_0x55f020[_0x0e69('0x1d')](_0x4f3a9f);});_0x55f020['on']('error',function(_0x31930e){fs['unlink'](_0x1a30cc);logger['error'](_0x0e69('0x1e'),_0x31930e);_0x4d78a1(_0x31930e);});_0x16f18b[_0x0e69('0x1f')](_0x55f020);})['on'](_0x0e69('0x16'),function(_0x36ca49){logger[_0x0e69('0x16')](_0x36ca49);_0x4d78a1(_0x36ca49);})[_0x0e69('0x20')]();});}function uploadFile(_0x2da173){return new BPromise(function(_0x3dedc0,_0x26bd65){var _0x16f6dd=urlParse(_0x2da173);var _0x1e2184=_0x16f6dd[_0x0e69('0x10')]===_0x0e69('0x11')?https:http;var _0x2712ae={'host':_0x16f6dd['host'],'path':_0x16f6dd['path'],'headers':{'user-agent':_0x0e69('0x13')}};_0x1e2184[_0x0e69('0x14')](_0x2712ae,function(_0x388f13){if(_0x388f13[_0x0e69('0x15')]!==0xc8){_0x26bd65(new Error(_0x0e69('0x17')+_0x2da173+'\x20failed,\x20status\x20code\x20=\x20'+_0x388f13[_0x0e69('0x15')]+'\x20('+_0x388f13[_0x0e69('0x19')]+')'));return;}var _0x5713c7='';_0x388f13['on'](_0x0e69('0x21'),function(_0x37075c){_0x5713c7+=_0x37075c;});_0x388f13['on'](_0x0e69('0x20'),function(){_0x3dedc0(_0x5713c7);});})['on'](_0x0e69('0x16'),function(_0x601e1e){_0x26bd65(_0x601e1e);})[_0x0e69('0x20')]();});}function convertFile(_0x30b694,_0x1699ac){return new BPromise(function(_0x367a76,_0x1243f0){var _0x4c82f1=sox[_0x0e69('0x22')](_0x30b694,_0x1699ac,{'sampleRate':0x1f40,'format':_0x0e69('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4c82f1['on']('error',function(_0x407e06){logger[_0x0e69('0x16')](_0x0e69('0x24'),_0x407e06);_0x1243f0(_0x407e06);});_0x4c82f1['on'](_0x0e69('0x20'),function(){logger[_0x0e69('0x1b')](_0x0e69('0x25'));_0x367a76();});_0x4c82f1['start']();});}function base64Decode(_0x486663,_0x10ce42){var _0x5bd421=path['resolve'](__dirname,_0x0e69('0x26'),rs[_0x0e69('0x27')](0x4)+_0x0e69('0x28'));fs[_0x0e69('0x29')](_0x5bd421,_0x486663,'base64');return convertFile(_0x5bd421,_0x10ce42)[_0x0e69('0x2a')](function(){try{fs[_0x0e69('0x2b')](_0x5bd421);fs[_0x0e69('0x2c')](_0x10ce42,_0x0e69('0x2d'));}catch(_0x26c764){logger[_0x0e69('0x16')](_0x26c764);}return _0x10ce42[_0x0e69('0x2e')]('.')[0x0];});}function base64Encode(_0x4d59b5){var _0x3abb61=fs[_0x0e69('0x2f')](_0x4d59b5);return new Buffer(_0x3abb61)['toString']('base64');}exports[_0x0e69('0x30')]=function(_0x583f84,_0x504d4b,_0x489fa6,_0x2e54b7,_0x4a143b,_0x16e8ab){var _0x2e3730,_0x1d0e53;var _0x418945=_0x0e69('0x31');var _0x34580c=_0x0e69('0x32')+_0x583f84;var _0x393f39={};if(_0x504d4b===_0x0e69('0x33')){_0x393f39[_0x0e69('0x34')]={'ssml':_0x489fa6};}else{_0x393f39[_0x0e69('0x34')]={'text':_0x489fa6};};_0x393f39[_0x0e69('0x35')]={'languageCode':_0x2e54b7,'ssmlGender':_0x4a143b};_0x393f39[_0x0e69('0x36')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x5ebf81={'url':_0x418945+_0x0e69('0x37')+_0x34580c,'method':_0x0e69('0x38'),'json':!![],'body':_0x393f39};return rp(_0x5ebf81)['then'](function(_0x4c7d55){return new BPromise(function(_0x51f097,_0x49adb1){_0x2e3730=path[_0x0e69('0x39')](__dirname,_0x0e69('0x26'),rs[_0x0e69('0x27')](0x4)+'.mp3');var _0x1f1497=Buffer['from'](_0x4c7d55[_0x0e69('0x3a')],_0x0e69('0x3b'));return fs['writeFile'](_0x2e3730,_0x1f1497,function(_0x426b85){_0x49adb1(_0x426b85);},function(_0x35ba29){fs[_0x0e69('0x2c')](_0x2e3730,_0x0e69('0x2d'));_0x51f097(_0x35ba29);});});})[_0x0e69('0x2a')](function(_0x36739f){_0x1d0e53=path[_0x0e69('0x39')](__dirname,'tmp',rs[_0x0e69('0x27')](0x4)+_0x0e69('0x28'));return convertFile(_0x2e3730,_0x1d0e53);})[_0x0e69('0x2a')](function(){try{fs[_0x0e69('0x2b')](_0x2e3730);fs['chmodSync'](_0x1d0e53,_0x0e69('0x2d'));}catch(_0x5626f8){logger['error'](_0x5626f8);}logger['info'](_0x0e69('0x3c'),_0x1d0e53[_0x0e69('0x2e')]('.')[0x0]);return _0x1d0e53[_0x0e69('0x2e')]('.')[0x0];});};exports['googleTTS']=function(_0x4afa48,_0x35645d){var _0x99277=_0x0e69('0x3d');var _0x22b4a2,_0x12c559;var _0x4c5814;var _0x4c4d28={'encoding':_0x0e69('0x3e'),'method':'POST','timeout':0x2710,'url':_0x99277,'headers':{'Content-Type':_0x0e69('0x3f')},'body':_0x0e69('0x40')+encodeURIComponent(JSON[_0x0e69('0x41')]([[[_0x0e69('0x42'),JSON['stringify']([_0x4afa48,_0x35645d||'en',![],_0x0e69('0x43')]),null,_0x0e69('0x44')]]]))};return rp(_0x4c4d28)['then'](function(_0x10cc72){try{_0x4c5814=eval(_0x10cc72[_0x0e69('0x45')](0x5))[0x0][0x2];}catch(_0x2c8cac){throw new Error(_0x0e69('0x46')+_0x10cc72[_0x0e69('0x21')]);}if(!_0x4c5814){if(_0x4afa48[_0x0e69('0x47')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x35645d+'\x22\x20might\x20not\x20exist');}}try{_0x4c5814=eval(_0x4c5814)[0x0];}catch(_0x304acf){throw new Error(_0x0e69('0x46')+res[_0x0e69('0x21')]);}const _0x7030e5=_0x4c5814;_0x22b4a2=path[_0x0e69('0x39')](__dirname,'tmp',rs[_0x0e69('0x27')](0x4)+_0x0e69('0x48'));fs[_0x0e69('0x29')](_0x22b4a2,_0x4c5814,{'encoding':_0x0e69('0x3b')});_0x12c559=path[_0x0e69('0x39')](__dirname,'tmp',rs[_0x0e69('0x27')](0x4)+_0x0e69('0x28'));return convertFile(_0x22b4a2,_0x12c559);})['then'](function(){try{fs[_0x0e69('0x2b')](_0x22b4a2);fs[_0x0e69('0x2c')](_0x12c559,'777');}catch(_0x51d5ba){logger[_0x0e69('0x16')](_0x51d5ba);}logger['info']('goggleTTS\x20path',_0x12c559['split']('.')[0x0]);return _0x12c559[_0x0e69('0x2e')]('.')[0x0];});};exports['googleASR']=function(_0x218a45,_0x16c907,_0x463b52){return google[_0x0e69('0x49')](_0x218a45,_0x16c907,_0x463b52)[_0x0e69('0x2a')](function(_0x725a5e){logger['info'](_0x725a5e[_0x0e69('0x4a')]);return rp(_0x725a5e);})[_0x0e69('0x2a')](function(_0x1a4821){var _0x1653cb='';var _0x372b9b=0x0;try{fs[_0x0e69('0x2b')](_0x218a45);}catch(_0x19a426){logger[_0x0e69('0x16')](_0x19a426);}if(_0x1a4821&&_0x1a4821['results']){_0x1653cb=_0x1a4821[_0x0e69('0x4b')][_0x0e69('0x4c')](function(_0xe13e0c){return _0xe13e0c&&_0xe13e0c['alternatives'][0x0]&&_0xe13e0c[_0x0e69('0x4d')][0x0][_0x0e69('0x4e')]?_0xe13e0c[_0x0e69('0x4d')][0x0][_0x0e69('0x4e')]:'';})[_0x0e69('0x4f')]('\x0a');_0x372b9b=_0x1a4821[_0x0e69('0x4b')]['map'](function(_0x188cca){return _0x188cca&&_0x188cca[_0x0e69('0x4d')][0x0]&&_0x188cca[_0x0e69('0x4d')][0x0][_0x0e69('0x50')]?_0x188cca['alternatives'][0x0][_0x0e69('0x50')]:0x0;})[_0x0e69('0x4f')]('\x0a');}logger[_0x0e69('0x1b')](_0x0e69('0x51'),_0x1653cb);logger[_0x0e69('0x1b')](_0x0e69('0x52'),_0x372b9b);return{'transcript':_0x1653cb,'confidence':_0x372b9b};})[_0x0e69('0x53')](function(_0x226aba){logger['error']('[%s]\x20%s:%s',_0x226aba[_0x0e69('0x15')],_0x226aba[_0x0e69('0x54')],_0x226aba[_0x0e69('0x55')]);});};exports[_0x0e69('0x56')]=function(_0x592e8e,_0x4b484b,_0x51df06,_0x54c388){var _0x63c086=apiai(_0x4b484b,{'language':_0x54c388||'en'});return _0x63c086[_0x0e69('0x57')](_0x51df06,{'sessionId':md5(_0x592e8e)})[_0x0e69('0x2a')](function(_0x54e87c){logger[_0x0e69('0x1b')](JSON[_0x0e69('0x41')](_0x54e87c));return{'source':_0x54e87c[_0x0e69('0x58')][_0x0e69('0x59')],'resolvedQuery':_0x54e87c[_0x0e69('0x58')][_0x0e69('0x5a')],'action':_0x54e87c[_0x0e69('0x58')][_0x0e69('0x5b')],'actionIncomplete':_0x54e87c[_0x0e69('0x58')][_0x0e69('0x5c')],'speech':_0x54e87c['result'][_0x0e69('0x5d')][_0x0e69('0x5e')],'score':_0x54e87c[_0x0e69('0x58')][_0x0e69('0x5f')],'statusCode':_0x54e87c[_0x0e69('0x60')][_0x0e69('0x61')],'endConversation':_0x54e87c[_0x0e69('0x58')][_0x0e69('0x62')][_0x0e69('0x63')]||![],'isFallbackIntent':_0x54e87c[_0x0e69('0x58')]['metadata']['isFallbackIntent']};});};exports[_0x0e69('0x64')]=function(_0x1034f7,_0x3d2eab,_0xa43242,_0x93d48e,_0xe07c47,_0x4c1a39){var _0x4ec495=_0x93d48e[_0x0e69('0x65')](/\\n/g,'\x0a');var _0x130f41={'credentials':{'private_key':_0x4ec495,'client_email':_0xa43242}};var _0xd7ae45=new dialogflow[(_0x0e69('0x66'))](_0x130f41);var _0x318ec1=_0xd7ae45[_0x0e69('0x67')](_0x3d2eab,md5(_0x1034f7));var _0x33a422={'session':_0x318ec1,'queryInput':{'text':{'text':_0xe07c47,'languageCode':_0x4c1a39}}};return _0xd7ae45['detectIntent'](_0x33a422)[_0x0e69('0x2a')](function(_0x5a559a){if(_0x5a559a&&_0x5a559a[_0x0e69('0x47')]){logger[_0x0e69('0x1b')](_0x0e69('0x68'),JSON[_0x0e69('0x41')](_0x5a559a));var _0x2a7ee7=_0x5a559a[0x0];if(_0x2a7ee7){var _0x32655d={'action':_0x2a7ee7[_0x0e69('0x69')][_0x0e69('0x5b')],'allRequiredParamsPresent':_0x2a7ee7[_0x0e69('0x69')][_0x0e69('0x6a')],'endConversation':_0x2a7ee7['queryResult']['diagnosticInfo']&&_0x2a7ee7[_0x0e69('0x69')][_0x0e69('0x6b')]['fields']?_0x2a7ee7['queryResult'][_0x0e69('0x6b')][_0x0e69('0x6c')][_0x0e69('0x6d')][_0x0e69('0x6e')]:![],'fulfillmentText':_0x2a7ee7['queryResult']['fulfillmentText'],'intentName':_0x2a7ee7[_0x0e69('0x69')][_0x0e69('0x6f')][_0x0e69('0x54')],'intentDisplayName':_0x2a7ee7['queryResult'][_0x0e69('0x6f')]['displayName'],'isFallbackIntent':_0x2a7ee7[_0x0e69('0x69')][_0x0e69('0x6f')]['isFallback'],'languageCode':_0x2a7ee7[_0x0e69('0x69')][_0x0e69('0x70')],'queryText':_0x2a7ee7['queryResult'][_0x0e69('0x71')],'responseId':_0x2a7ee7['responseId'],'score':_0x2a7ee7[_0x0e69('0x69')][_0x0e69('0x72')],'speech':_0x2a7ee7[_0x0e69('0x69')][_0x0e69('0x73')],'providerResponse':JSON[_0x0e69('0x41')](_0x5a559a)};return _0x32655d;}}});};exports[_0x0e69('0x74')]=function(_0x2a9369,_0x18e7d4,_0x36911a,_0x12a738){return tilde['asr'](_0x2a9369,_0x18e7d4,_0x36911a,_0x12a738)[_0x0e69('0x2a')](function(_0x18c97e){try{fs['unlink'](_0x2a9369);}catch(_0x26e4f1){logger[_0x0e69('0x16')](_0x26e4f1);}logger['info'](_0x0e69('0x75'),_0x18c97e[_0x0e69('0x4e')]);logger[_0x0e69('0x1b')]('Tilde\x20ASR\x20confidence',_0x18c97e['confidence']);return _0x18c97e;});};exports[_0x0e69('0x76')]=function(_0x462391,_0x1bc01c,_0x469ac3,_0x50e8f4,_0x5ddbf5,_0x188cf5){var _0xc99787=path[_0x0e69('0x39')](__dirname,_0x0e69('0x26'),rs['generate'](0x4)+_0x0e69('0x48'));var _0x11055a;return aws[_0x0e69('0x77')](_0x462391,_0x1bc01c,_0x469ac3,_0x50e8f4,_0x5ddbf5,_0x188cf5,_0xc99787)[_0x0e69('0x2a')](function(){_0x11055a=path['resolve'](__dirname,'tmp',rs[_0x0e69('0x27')](0x4)+_0x0e69('0x28'));return convertFile(_0xc99787,_0x11055a);})['then'](function(){try{fs['unlink'](_0xc99787);fs[_0x0e69('0x2c')](_0x11055a,_0x0e69('0x2d'));}catch(_0xa83dcd){logger[_0x0e69('0x16')](_0xa83dcd);}return _0x11055a[_0x0e69('0x2e')]('.')[0x0];});};exports['awsLex']=function(_0x4e5815,_0x8f763e,_0xf17fe2,_0x29c8db,_0x57f1ad,_0x4d6f6f){return aws[_0x0e69('0x78')](_0x4e5815,_0x8f763e,_0xf17fe2,_0x29c8db,_0x57f1ad,_0x4d6f6f)[_0x0e69('0x2a')](function(_0x2e49aa){logger[_0x0e69('0x1b')](JSON[_0x0e69('0x41')](_0x2e49aa));return _0x2e49aa;});};exports[_0x0e69('0x79')]=function(_0xa54fef,_0x58ebe8,_0x5a5ca0,_0x3434e0){var _0x1cd350=util[_0x0e69('0x7a')](_0x0e69('0x7b'),ISPEECH_API,_0xa54fef,encodeURIComponent(_0x58ebe8),_0x5a5ca0,_0x3434e0);var _0x7a4cfc=path[_0x0e69('0x39')](__dirname,_0x0e69('0x26'),rs[_0x0e69('0x27')](0x4)+_0x0e69('0x48'));var _0x18f148;return downloadFile(_0x1cd350,_0x7a4cfc)[_0x0e69('0x2a')](function(){_0x18f148=path[_0x0e69('0x39')](__dirname,_0x0e69('0x26'),rs[_0x0e69('0x27')](0x4)+_0x0e69('0x28'));return convertFile(_0x7a4cfc,_0x18f148);})['then'](function(){try{fs[_0x0e69('0x2b')](_0x7a4cfc);fs[_0x0e69('0x2c')](_0x18f148,_0x0e69('0x2d'));}catch(_0x248f7b){logger[_0x0e69('0x16')](_0x248f7b);}return _0x18f148[_0x0e69('0x2e')]('.')[0x0];});};exports[_0x0e69('0x7c')]=function(_0x243847,_0x277724,_0x304bc4,_0x5c2564){var _0x2c08ed=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x277724,_0x304bc4,base64Encode(_0x243847),_0x5c2564?util[_0x0e69('0x7a')](_0x0e69('0x7d'),encodeURIComponent(_0x5c2564)):_0x0e69('0x7e'));return uploadFile(_0x2c08ed)[_0x0e69('0x2a')](function(_0x10fb47){return querystring['parse'](_0x10fb47);});};exports[_0x0e69('0x7f')]=function(_0x361a76,_0x5c02f1){return sestek['nda'](_0x361a76,_0x5c02f1)[_0x0e69('0x2a')](function(_0x1e450c){logger[_0x0e69('0x1b')](JSON[_0x0e69('0x41')](_0x1e450c));var _0x12d519={'speech':_0x1e450c[_0x0e69('0x80')],'action':_0x1e450c[_0x0e69('0x81')]?_0x1e450c['channelData']['CustomAction']:undefined,'actiondata':_0x1e450c['channelData']?_0x1e450c[_0x0e69('0x81')]['CustomActionData']:undefined};if(_0x1e450c[_0x0e69('0x81')]&&_0x1e450c[_0x0e69('0x81')][_0x0e69('0x82')]){return base64Decode(_0x1e450c[_0x0e69('0x81')]['AudioFromTts'][_0x0e69('0x83')],path[_0x0e69('0x39')](__dirname,_0x0e69('0x26'),rs[_0x0e69('0x27')](0x4)+_0x0e69('0x28')))[_0x0e69('0x2a')](function(_0xf41d13){_0x12d519['audiofile']=_0xf41d13;return _0x12d519;});}return _0x12d519;});};exports[_0x0e69('0x84')]=function(){return __dirname;};
\ No newline at end of file
+var _0xac6b=['replace','SessionsClient','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','http','md5','path','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','get','statusCode','statusMessage','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','https:','host','WHAT_EVER','end','transcode','wav','error\x20convert','resolve','tmp','generate','.wav','then','chmodSync','777','split','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','POST','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','writeFileSync','goggleTTS\x20path','googleASR','results','map','alternatives','transcript','join','confidence','catch','[%s]\x20%s:%s','name','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2'];(function(_0x441199,_0xb73e4){var _0x16a478=function(_0xdd73fa){while(--_0xdd73fa){_0x441199['push'](_0x441199['shift']());}};_0x16a478(++_0xb73e4);}(_0xac6b,0x130));var _0xbac6=function(_0x18438a,_0x265881){_0x18438a=_0x18438a-0x0;var _0x2726d9=_0xac6b[_0x18438a];return _0x2726d9;};'use strict';var apiai=require(_0xbac6('0x0'));var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xbac6('0x1'));var https=require('https');var md5=require(_0xbac6('0x2'));var path=require(_0xbac6('0x3'));var querystring=require('querystring');var rp=require(_0xbac6('0x4'));var rs=require(_0xbac6('0x5'));var sox=require(_0xbac6('0x6'));var tts=require(_0xbac6('0x7'));var urlParse=require(_0xbac6('0x8'))[_0xbac6('0x9')];var util=require(_0xbac6('0xa'));var aws=require(_0xbac6('0xb'));var google=require(_0xbac6('0xc'));var sestek=require(_0xbac6('0xd'));var tilde=require(_0xbac6('0xe'));var logger=require(_0xbac6('0xf'))('agi');var ISPEECH_API=_0xbac6('0x10');function downloadFile(_0x11bda2,_0x33a5a5){return new BPromise(function(_0x523a08,_0x4aae8f){var _0xd7e4aa=urlParse(_0x11bda2);var _0xe4f1fc=_0xd7e4aa[_0xbac6('0x11')]==='https:'?https:http;var _0x560ac7={'host':_0xd7e4aa['host'],'path':_0xd7e4aa[_0xbac6('0x3')],'headers':{'user-agent':'WHAT_EVER'}};_0xe4f1fc[_0xbac6('0x12')](_0x560ac7,function(_0x48f927){if(_0x48f927[_0xbac6('0x13')]!==0xc8){logger['error']('request\x20to\x20'+_0x11bda2+'\x20failed,\x20status\x20code\x20=\x20'+_0x48f927[_0xbac6('0x13')]+'\x20('+_0x48f927[_0xbac6('0x14')]+')');_0x4aae8f(new Error(_0xbac6('0x15')+_0x11bda2+_0xbac6('0x16')+_0x48f927[_0xbac6('0x13')]+'\x20('+_0x48f927[_0xbac6('0x14')]+')'));return;}var _0x7a4988=fs['createWriteStream'](_0x33a5a5);_0x7a4988['on']('finish',function(){logger[_0xbac6('0x17')](_0xbac6('0x18'));_0x7a4988[_0xbac6('0x19')](_0x523a08);});_0x7a4988['on'](_0xbac6('0x1a'),function(_0xa92edd){fs[_0xbac6('0x1b')](_0x33a5a5);logger[_0xbac6('0x1a')](_0xbac6('0x1c'),_0xa92edd);_0x4aae8f(_0xa92edd);});_0x48f927[_0xbac6('0x1d')](_0x7a4988);})['on'](_0xbac6('0x1a'),function(_0x2e822d){logger[_0xbac6('0x1a')](_0x2e822d);_0x4aae8f(_0x2e822d);})['end']();});}function uploadFile(_0x562596){return new BPromise(function(_0x574cd5,_0x57d184){var _0x260267=urlParse(_0x562596);var _0x3c2604=_0x260267[_0xbac6('0x11')]===_0xbac6('0x1e')?https:http;var _0x3a3ec7={'host':_0x260267[_0xbac6('0x1f')],'path':_0x260267[_0xbac6('0x3')],'headers':{'user-agent':_0xbac6('0x20')}};_0x3c2604[_0xbac6('0x12')](_0x3a3ec7,function(_0x16c713){if(_0x16c713[_0xbac6('0x13')]!==0xc8){_0x57d184(new Error(_0xbac6('0x15')+_0x562596+'\x20failed,\x20status\x20code\x20=\x20'+_0x16c713[_0xbac6('0x13')]+'\x20('+_0x16c713[_0xbac6('0x14')]+')'));return;}var _0x3da6fd='';_0x16c713['on']('data',function(_0x144458){_0x3da6fd+=_0x144458;});_0x16c713['on'](_0xbac6('0x21'),function(){_0x574cd5(_0x3da6fd);});})['on'](_0xbac6('0x1a'),function(_0x35f2f2){_0x57d184(_0x35f2f2);})[_0xbac6('0x21')]();});}function convertFile(_0x4dbf9f,_0x5e7fce){return new BPromise(function(_0x194a36,_0x519f65){var _0x35783f=sox[_0xbac6('0x22')](_0x4dbf9f,_0x5e7fce,{'sampleRate':0x1f40,'format':_0xbac6('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x35783f['on'](_0xbac6('0x1a'),function(_0x156fd5){logger[_0xbac6('0x1a')](_0xbac6('0x24'),_0x156fd5);_0x519f65(_0x156fd5);});_0x35783f['on'](_0xbac6('0x21'),function(){logger[_0xbac6('0x17')]('finish\x20to\x20convert');_0x194a36();});_0x35783f['start']();});}function base64Decode(_0x23084a,_0x72d7cd){var _0x159cb0=path[_0xbac6('0x25')](__dirname,_0xbac6('0x26'),rs[_0xbac6('0x27')](0x4)+_0xbac6('0x28'));fs['writeFileSync'](_0x159cb0,_0x23084a,'base64');return convertFile(_0x159cb0,_0x72d7cd)[_0xbac6('0x29')](function(){try{fs['unlink'](_0x159cb0);fs[_0xbac6('0x2a')](_0x72d7cd,_0xbac6('0x2b'));}catch(_0x5d218a){logger[_0xbac6('0x1a')](_0x5d218a);}return _0x72d7cd[_0xbac6('0x2c')]('.')[0x0];});}function base64Encode(_0x91f9a0){var _0x2bcdb4=fs[_0xbac6('0x2d')](_0x91f9a0);return new Buffer(_0x2bcdb4)[_0xbac6('0x2e')](_0xbac6('0x2f'));}exports[_0xbac6('0x30')]=function(_0x24a4a5,_0x6e5616,_0x35b2e8,_0x5c98e5,_0x44f377,_0x156e72){var _0x54f906,_0x1bece;var _0x5dd76e=_0xbac6('0x31');var _0x4054ea='?key='+_0x24a4a5;var _0x15f65d={};if(_0x6e5616===_0xbac6('0x32')){_0x15f65d[_0xbac6('0x33')]={'ssml':_0x35b2e8};}else{_0x15f65d[_0xbac6('0x33')]={'text':_0x35b2e8};};_0x15f65d[_0xbac6('0x34')]={'languageCode':_0x5c98e5,'ssmlGender':_0x44f377};_0x15f65d['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x27cafc={'url':_0x5dd76e+'text:synthesize'+_0x4054ea,'method':_0xbac6('0x35'),'json':!![],'body':_0x15f65d};return rp(_0x27cafc)[_0xbac6('0x29')](function(_0x22a633){return new BPromise(function(_0x53eb7b,_0x2158b1){_0x54f906=path['resolve'](__dirname,_0xbac6('0x26'),rs['generate'](0x4)+_0xbac6('0x36'));var _0xbf5554=Buffer[_0xbac6('0x37')](_0x22a633[_0xbac6('0x38')],_0xbac6('0x2f'));return fs[_0xbac6('0x39')](_0x54f906,_0xbf5554,function(_0xf6ae){_0x2158b1(_0xf6ae);},function(_0x34a9d9){fs[_0xbac6('0x2a')](_0x54f906,'777');_0x53eb7b(_0x34a9d9);});});})[_0xbac6('0x29')](function(_0x31eb99){_0x1bece=path['resolve'](__dirname,_0xbac6('0x26'),rs[_0xbac6('0x27')](0x4)+'.wav');return convertFile(_0x54f906,_0x1bece);})[_0xbac6('0x29')](function(){try{fs[_0xbac6('0x1b')](_0x54f906);fs[_0xbac6('0x2a')](_0x1bece,_0xbac6('0x2b'));}catch(_0x2d744f){logger[_0xbac6('0x1a')](_0x2d744f);}logger[_0xbac6('0x17')](_0xbac6('0x3a'),_0x1bece[_0xbac6('0x2c')]('.')[0x0]);return _0x1bece['split']('.')[0x0];});};exports[_0xbac6('0x3b')]=function(_0x28094b,_0x4f88a0){var _0x9c3e1b=_0xbac6('0x3c');var _0x38998a,_0x303a0c;var _0x3ac8d4;var _0x1c6fe4={'encoding':_0xbac6('0x3d'),'method':_0xbac6('0x35'),'timeout':0x2710,'url':_0x9c3e1b,'headers':{'Content-Type':_0xbac6('0x3e')},'body':_0xbac6('0x3f')+encodeURIComponent(JSON[_0xbac6('0x40')]([[[_0xbac6('0x41'),JSON[_0xbac6('0x40')]([_0x28094b,_0x4f88a0||'en',![],_0xbac6('0x42')]),null,_0xbac6('0x43')]]]))};return rp(_0x1c6fe4)[_0xbac6('0x29')](function(_0x5dc81c){try{_0x3ac8d4=eval(_0x5dc81c['slice'](0x5))[0x0][0x2];}catch(_0x2a2218){throw new Error(_0xbac6('0x44')+_0x5dc81c[_0xbac6('0x45')]);}if(!_0x3ac8d4){if(_0x28094b[_0xbac6('0x46')]>0xc8){throw new Error(_0xbac6('0x47'));}else{throw new Error(_0xbac6('0x48')+_0x4f88a0+'\x22\x20might\x20not\x20exist');}}try{_0x3ac8d4=eval(_0x3ac8d4)[0x0];}catch(_0xbc054d){throw new Error(_0xbac6('0x44')+res[_0xbac6('0x45')]);}const _0x417840=_0x3ac8d4;_0x38998a=path['resolve'](__dirname,_0xbac6('0x26'),rs[_0xbac6('0x27')](0x4)+_0xbac6('0x36'));fs[_0xbac6('0x49')](_0x38998a,_0x3ac8d4,{'encoding':_0xbac6('0x2f')});_0x303a0c=path[_0xbac6('0x25')](__dirname,_0xbac6('0x26'),rs[_0xbac6('0x27')](0x4)+_0xbac6('0x28'));return convertFile(_0x38998a,_0x303a0c);})[_0xbac6('0x29')](function(){try{fs[_0xbac6('0x1b')](_0x38998a);fs['chmodSync'](_0x303a0c,_0xbac6('0x2b'));}catch(_0x22f669){logger['error'](_0x22f669);}logger[_0xbac6('0x17')](_0xbac6('0x4a'),_0x303a0c[_0xbac6('0x2c')]('.')[0x0]);return _0x303a0c[_0xbac6('0x2c')]('.')[0x0];});};exports[_0xbac6('0x4b')]=function(_0x29eee7,_0x1a3628,_0x2bd40b){return google['asr'](_0x29eee7,_0x1a3628,_0x2bd40b)[_0xbac6('0x29')](function(_0x359c29){logger[_0xbac6('0x17')](_0x359c29['uri']);return rp(_0x359c29);})[_0xbac6('0x29')](function(_0x40bcb8){var _0x158c94='';var _0x4060db=0x0;try{fs[_0xbac6('0x1b')](_0x29eee7);}catch(_0x4697d1){logger[_0xbac6('0x1a')](_0x4697d1);}if(_0x40bcb8&&_0x40bcb8['results']){_0x158c94=_0x40bcb8[_0xbac6('0x4c')][_0xbac6('0x4d')](function(_0x48d57d){return _0x48d57d&&_0x48d57d[_0xbac6('0x4e')][0x0]&&_0x48d57d['alternatives'][0x0][_0xbac6('0x4f')]?_0x48d57d[_0xbac6('0x4e')][0x0][_0xbac6('0x4f')]:'';})[_0xbac6('0x50')]('\x0a');_0x4060db=_0x40bcb8['results'][_0xbac6('0x4d')](function(_0x266233){return _0x266233&&_0x266233[_0xbac6('0x4e')][0x0]&&_0x266233[_0xbac6('0x4e')][0x0][_0xbac6('0x51')]?_0x266233[_0xbac6('0x4e')][0x0]['confidence']:0x0;})[_0xbac6('0x50')]('\x0a');}logger['info']('googleASR\x20transcription',_0x158c94);logger['info']('googleASR\x20confidence',_0x4060db);return{'transcript':_0x158c94,'confidence':_0x4060db};})[_0xbac6('0x52')](function(_0x3ee577){logger[_0xbac6('0x1a')](_0xbac6('0x53'),_0x3ee577[_0xbac6('0x13')],_0x3ee577[_0xbac6('0x54')],_0x3ee577['message']);});};exports['googleDialogflow']=function(_0x2728a7,_0x158101,_0xb6f740,_0x95e69b){var _0x4b27cf=apiai(_0x158101,{'language':_0x95e69b||'en'});return _0x4b27cf[_0xbac6('0x55')](_0xb6f740,{'sessionId':md5(_0x2728a7)})[_0xbac6('0x29')](function(_0x476da){logger[_0xbac6('0x17')](JSON[_0xbac6('0x40')](_0x476da));return{'source':_0x476da['result']['source'],'resolvedQuery':_0x476da[_0xbac6('0x56')][_0xbac6('0x57')],'action':_0x476da['result'][_0xbac6('0x58')],'actionIncomplete':_0x476da[_0xbac6('0x56')][_0xbac6('0x59')],'speech':_0x476da[_0xbac6('0x56')][_0xbac6('0x5a')][_0xbac6('0x5b')],'score':_0x476da['result']['score'],'statusCode':_0x476da[_0xbac6('0x5c')][_0xbac6('0x5d')],'endConversation':_0x476da[_0xbac6('0x56')][_0xbac6('0x5e')][_0xbac6('0x5f')]||![],'isFallbackIntent':_0x476da[_0xbac6('0x56')]['metadata'][_0xbac6('0x60')]};});};exports[_0xbac6('0x61')]=function(_0x4d6a2b,_0x513465,_0xaded1e,_0x5a83d4,_0x43f07e,_0x730f66){var _0x3ae41b=_0x5a83d4[_0xbac6('0x62')](/\\n/g,'\x0a');var _0x98bdd2={'credentials':{'private_key':_0x3ae41b,'client_email':_0xaded1e}};var _0x2a6051=new dialogflow[(_0xbac6('0x63'))](_0x98bdd2);var _0x2c9399=_0x2a6051[_0xbac6('0x64')](_0x513465,md5(_0x4d6a2b));var _0x1e95eb={'session':_0x2c9399,'queryInput':{'text':{'text':_0x43f07e,'languageCode':_0x730f66}}};return _0x2a6051[_0xbac6('0x65')](_0x1e95eb)['then'](function(_0xe6c84a){if(_0xe6c84a&&_0xe6c84a[_0xbac6('0x46')]){logger[_0xbac6('0x17')]('Dialogflow\x20V2\x20response:',JSON[_0xbac6('0x40')](_0xe6c84a));var _0x3c3ae5=_0xe6c84a[0x0];if(_0x3c3ae5){var _0x49f971={'action':_0x3c3ae5[_0xbac6('0x66')][_0xbac6('0x58')],'allRequiredParamsPresent':_0x3c3ae5[_0xbac6('0x66')][_0xbac6('0x67')],'endConversation':_0x3c3ae5[_0xbac6('0x66')][_0xbac6('0x68')]&&_0x3c3ae5[_0xbac6('0x66')][_0xbac6('0x68')]['fields']?_0x3c3ae5[_0xbac6('0x66')][_0xbac6('0x68')][_0xbac6('0x69')][_0xbac6('0x6a')]['boolValue']:![],'fulfillmentText':_0x3c3ae5[_0xbac6('0x66')][_0xbac6('0x6b')],'intentName':_0x3c3ae5[_0xbac6('0x66')][_0xbac6('0x6c')][_0xbac6('0x54')],'intentDisplayName':_0x3c3ae5[_0xbac6('0x66')][_0xbac6('0x6c')][_0xbac6('0x6d')],'isFallbackIntent':_0x3c3ae5['queryResult'][_0xbac6('0x6c')][_0xbac6('0x6e')],'languageCode':_0x3c3ae5[_0xbac6('0x66')]['languageCode'],'queryText':_0x3c3ae5[_0xbac6('0x66')][_0xbac6('0x6f')],'responseId':_0x3c3ae5[_0xbac6('0x70')],'score':_0x3c3ae5[_0xbac6('0x66')][_0xbac6('0x71')],'speech':_0x3c3ae5[_0xbac6('0x66')][_0xbac6('0x6b')],'providerResponse':JSON[_0xbac6('0x40')](_0xe6c84a)};return _0x49f971;}}});};exports[_0xbac6('0x72')]=function(_0xad115c,_0x5cdf2c,_0x48acef,_0x2648bf){return tilde[_0xbac6('0x73')](_0xad115c,_0x5cdf2c,_0x48acef,_0x2648bf)['then'](function(_0x32f778){try{fs[_0xbac6('0x1b')](_0xad115c);}catch(_0x359ae2){logger[_0xbac6('0x1a')](_0x359ae2);}logger['info'](_0xbac6('0x74'),_0x32f778[_0xbac6('0x4f')]);logger['info'](_0xbac6('0x75'),_0x32f778['confidence']);return _0x32f778;});};exports[_0xbac6('0x76')]=function(_0x3aeef9,_0x3172de,_0x48b14b,_0x1f8af0,_0xc97ebe,_0x407da3){var _0x2041d9=path[_0xbac6('0x25')](__dirname,_0xbac6('0x26'),rs[_0xbac6('0x27')](0x4)+'.mp3');var _0x38c76a;return aws[_0xbac6('0x77')](_0x3aeef9,_0x3172de,_0x48b14b,_0x1f8af0,_0xc97ebe,_0x407da3,_0x2041d9)[_0xbac6('0x29')](function(){_0x38c76a=path['resolve'](__dirname,_0xbac6('0x26'),rs[_0xbac6('0x27')](0x4)+_0xbac6('0x28'));return convertFile(_0x2041d9,_0x38c76a);})['then'](function(){try{fs[_0xbac6('0x1b')](_0x2041d9);fs[_0xbac6('0x2a')](_0x38c76a,'777');}catch(_0x16cacd){logger[_0xbac6('0x1a')](_0x16cacd);}return _0x38c76a[_0xbac6('0x2c')]('.')[0x0];});};exports[_0xbac6('0x78')]=function(_0x4f2d72,_0x52d7a3,_0x3af665,_0x3fa5b5,_0x29cf9a,_0x2a4b4e){return aws[_0xbac6('0x79')](_0x4f2d72,_0x52d7a3,_0x3af665,_0x3fa5b5,_0x29cf9a,_0x2a4b4e)[_0xbac6('0x29')](function(_0x1bfb7b){logger[_0xbac6('0x17')](JSON[_0xbac6('0x40')](_0x1bfb7b));return _0x1bfb7b;});};exports[_0xbac6('0x7a')]=function(_0x4d75b0,_0x15cc1f,_0x2887a8,_0x4b2609){var _0xd9634=util[_0xbac6('0x7b')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x4d75b0,encodeURIComponent(_0x15cc1f),_0x2887a8,_0x4b2609);var _0x43e353=path[_0xbac6('0x25')](__dirname,'tmp',rs['generate'](0x4)+_0xbac6('0x36'));var _0x163e20;return downloadFile(_0xd9634,_0x43e353)[_0xbac6('0x29')](function(){_0x163e20=path['resolve'](__dirname,'tmp',rs[_0xbac6('0x27')](0x4)+_0xbac6('0x28'));return convertFile(_0x43e353,_0x163e20);})[_0xbac6('0x29')](function(){try{fs[_0xbac6('0x1b')](_0x43e353);fs[_0xbac6('0x2a')](_0x163e20,_0xbac6('0x2b'));}catch(_0xe8495a){logger[_0xbac6('0x1a')](_0xe8495a);}return _0x163e20[_0xbac6('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x474e22,_0x1cb327,_0x23fe96,_0x42addd){var _0xe2eb43=util[_0xbac6('0x7b')](_0xbac6('0x7c'),ISPEECH_API,_0x1cb327,_0x23fe96,base64Encode(_0x474e22),_0x42addd?util[_0xbac6('0x7b')]('model=%s',encodeURIComponent(_0x42addd)):_0xbac6('0x7d'));return uploadFile(_0xe2eb43)[_0xbac6('0x29')](function(_0x3f9b92){return querystring['parse'](_0x3f9b92);});};exports[_0xbac6('0x7e')]=function(_0x12a287,_0xe59519){return sestek['nda'](_0x12a287,_0xe59519)[_0xbac6('0x29')](function(_0x287a1e){logger['info'](JSON[_0xbac6('0x40')](_0x287a1e));var _0x5be171={'speech':_0x287a1e['text'],'action':_0x287a1e[_0xbac6('0x7f')]?_0x287a1e[_0xbac6('0x7f')][_0xbac6('0x80')]:undefined,'actiondata':_0x287a1e[_0xbac6('0x7f')]?_0x287a1e[_0xbac6('0x7f')][_0xbac6('0x81')]:undefined};if(_0x287a1e[_0xbac6('0x7f')]&&_0x287a1e[_0xbac6('0x7f')][_0xbac6('0x82')]){return base64Decode(_0x287a1e[_0xbac6('0x7f')]['AudioFromTts'][_0xbac6('0x83')],path[_0xbac6('0x25')](__dirname,_0xbac6('0x26'),rs['generate'](0x4)+_0xbac6('0x28')))[_0xbac6('0x29')](function(_0x524cbd){_0x5be171[_0xbac6('0x84')]=_0x524cbd;return _0x5be171;});}return _0x5be171;});};exports[_0xbac6('0x85')]=function(){return __dirname;};
\ No newline at end of file
index f9fa2be..19f242f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6fc=['./nda','exports'];(function(_0x4a6d3e,_0x1dca88){var _0x88c6a4=function(_0x4162b9){while(--_0x4162b9){_0x4a6d3e['push'](_0x4a6d3e['shift']());}};_0x88c6a4(++_0x1dca88);}(_0xa6fc,0xd2));var _0xca6f=function(_0x586bb1,_0x736491){_0x586bb1=_0x586bb1-0x0;var _0x3f68e7=_0xa6fc[_0x586bb1];return _0x3f68e7;};var nda=require(_0xca6f('0x0'));module[_0xca6f('0x1')]={'nda':nda};
\ No newline at end of file
+var _0xe9f0=['exports','./nda'];(function(_0x3e026c,_0xaaa1a8){var _0x34a436=function(_0x4f233d){while(--_0x4f233d){_0x3e026c['push'](_0x3e026c['shift']());}};_0x34a436(++_0xaaa1a8);}(_0xe9f0,0x143));var _0x0e9f=function(_0x575e6d,_0x1e19ac){_0x575e6d=_0x575e6d-0x0;var _0x5d4dfd=_0xe9f0[_0x575e6d];return _0x5d4dfd;};var nda=require(_0x0e9f('0x0'));module[_0x0e9f('0x1')]={'nda':nda};
\ No newline at end of file
index 0415590..99d7b43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x630e=['Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','resolve','ndauth_url','/token','password','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','calleridname','dnid','text'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x630e,0x1af));var _0xe630=function(_0x4344e5,_0x12ac2b){_0x4344e5=_0x4344e5-0x0;var _0x134ad9=_0x630e[_0x4344e5];return _0x134ad9;};'use strict';var rp=require(_0xe630('0x0'));var url=require('url');var logger=require(_0xe630('0x1'))('agi');module['exports']=function(_0x36902e,_0x143cb6){var _0x12449c={'method':'POST','uri':url[_0xe630('0x2')](_0x143cb6[_0xe630('0x3')],_0xe630('0x4')),'form':{'grant_type':_0xe630('0x5'),'username':_0x143cb6[_0xe630('0x6')],'password':_0x143cb6['password']},'json':!![]};return rp(_0x12449c)[_0xe630('0x7')](function(_0x34bad4){var _0x5a73ad={'method':_0xe630('0x8'),'uri':url['resolve'](_0x143cb6[_0xe630('0x9')],_0xe630('0xa')),'body':{'type':_0x143cb6[_0xe630('0xb')]||'message','channelId':'Nda','conversation':{'id':_0x36902e[_0xe630('0xc')]},'from':{'id':_0x36902e[_0xe630('0xd')],'name':_0x36902e[_0xe630('0xe')]},'recipient':{'id':_0x36902e[_0xe630('0xf')],'name':_0x36902e['extension']},'text':_0x143cb6[_0xe630('0x10')],'channelData':{}},'headers':{'Authorization':_0xe630('0x11')+_0x34bad4[_0xe630('0x12')]},'json':!![]};if(_0x143cb6[_0xe630('0x13')]){_0x5a73ad[_0xe630('0x14')][_0xe630('0x15')][_0xe630('0x16')]=_0x143cb6[_0xe630('0x13')];}if(_0x143cb6[_0xe630('0x17')]=='1'){_0x5a73ad[_0xe630('0x14')][_0xe630('0x15')][_0xe630('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe630('0x19')};}if(_0x143cb6['custom_action']){_0x5a73ad[_0xe630('0x14')][_0xe630('0x15')][_0xe630('0x1a')]=_0x143cb6[_0xe630('0x1b')];if(_0x143cb6[_0xe630('0x1c')]){_0x5a73ad[_0xe630('0x14')][_0xe630('0x15')][_0xe630('0x1d')]=_0x143cb6[_0xe630('0x1c')];}}logger[_0xe630('0x1e')](JSON[_0xe630('0x1f')](_0x5a73ad));return rp(_0x5a73ad);});};
\ No newline at end of file
+var _0xbefe=['AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','url','agi','exports','POST','resolve','ndauth_url','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','extension','text','Bearer\x20','access_token','project','ndagenerate_audio','body','channelData'];(function(_0x46bb73,_0x44f394){var _0x44f271=function(_0x2a96bc){while(--_0x2a96bc){_0x46bb73['push'](_0x46bb73['shift']());}};_0x44f271(++_0x44f394);}(_0xbefe,0x168));var _0xebef=function(_0x21cda3,_0x17b90a){_0x21cda3=_0x21cda3-0x0;var _0x558dc3=_0xbefe[_0x21cda3];return _0x558dc3;};'use strict';var rp=require('request-promise');var url=require(_0xebef('0x0'));var logger=require('../../../../../config/logger')(_0xebef('0x1'));module[_0xebef('0x2')]=function(_0x2f814c,_0x2cd3bf){var _0x1da4cd={'method':_0xebef('0x3'),'uri':url[_0xebef('0x4')](_0x2cd3bf[_0xebef('0x5')],'/token'),'form':{'grant_type':_0xebef('0x6'),'username':_0x2cd3bf[_0xebef('0x7')],'password':_0x2cd3bf[_0xebef('0x6')]},'json':!![]};return rp(_0x1da4cd)['then'](function(_0x4286bf){var _0x2fbd2c={'method':'POST','uri':url['resolve'](_0x2cd3bf[_0xebef('0x8')],_0xebef('0x9')),'body':{'type':_0x2cd3bf[_0xebef('0xa')]||_0xebef('0xb'),'channelId':_0xebef('0xc'),'conversation':{'id':_0x2f814c[_0xebef('0xd')]},'from':{'id':_0x2f814c[_0xebef('0xe')],'name':_0x2f814c[_0xebef('0xf')]},'recipient':{'id':_0x2f814c['dnid'],'name':_0x2f814c[_0xebef('0x10')]},'text':_0x2cd3bf[_0xebef('0x11')],'channelData':{}},'headers':{'Authorization':_0xebef('0x12')+_0x4286bf[_0xebef('0x13')]},'json':!![]};if(_0x2cd3bf[_0xebef('0x14')]){_0x2fbd2c['body']['channelData']['ProjectName']=_0x2cd3bf['project'];}if(_0x2cd3bf[_0xebef('0x15')]=='1'){_0x2fbd2c[_0xebef('0x16')][_0xebef('0x17')][_0xebef('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xebef('0x19')};}if(_0x2cd3bf[_0xebef('0x1a')]){_0x2fbd2c['body'][_0xebef('0x17')][_0xebef('0x1b')]=_0x2cd3bf[_0xebef('0x1a')];if(_0x2cd3bf[_0xebef('0x1c')]){_0x2fbd2c[_0xebef('0x16')][_0xebef('0x17')][_0xebef('0x1d')]=_0x2cd3bf[_0xebef('0x1c')];}}logger[_0xebef('0x1e')](JSON[_0xebef('0x1f')](_0x2fbd2c));return rp(_0x2fbd2c);});};
\ No newline at end of file
index 5c1e87c..a3b79d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafe2=['./lib/api','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xafe2,0x82));var _0x2afe=function(_0x4abd9f,_0x9276fe){_0x4abd9f=_0x4abd9f-0x0;var _0x49cc02=_0xafe2[_0x4abd9f];return _0x49cc02;};'use strict';var asr=require(_0x2afe('0x0'));module[_0x2afe('0x1')]=function(_0x1e1853,_0x278443,_0x5261aa,_0x49a714){return asr(_0x1e1853,_0x278443,_0x5261aa,_0x49a714);};
\ No newline at end of file
+var _0x7911=['exports','./lib/api'];(function(_0x2acb6d,_0x8e88e3){var _0x5a3a46=function(_0x70ffaa){while(--_0x70ffaa){_0x2acb6d['push'](_0x2acb6d['shift']());}};_0x5a3a46(++_0x8e88e3);}(_0x7911,0x8d));var _0x1791=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x7911[_0x1035c1];return _0x308d67;};'use strict';var asr=require(_0x1791('0x0'));module[_0x1791('0x1')]=function(_0x4ecc3b,_0xb19471,_0x45a4a0,_0x22ca35){return asr(_0x4ecc3b,_0xb19471,_0x45a4a0,_0x22ca35);};
\ No newline at end of file
index 7f4dc32..b1757ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddcb=['status','result','final','transcript','hypotheses','likelihood','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','open','message','close','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','send','stringify','data','EOS','error','parse'];(function(_0x144b4f,_0x911352){var _0xd12095=function(_0x4736b6){while(--_0x4736b6){_0x144b4f['push'](_0x144b4f['shift']());}};_0xd12095(++_0x911352);}(_0xddcb,0x15e));var _0xbddc=function(_0x47e717,_0x498e68){_0x47e717=_0x47e717-0x0;var _0x47d0ff=_0xddcb[_0x47e717];return _0x47d0ff;};'use strict';var BPromise=require(_0xbddc('0x0'));var _=require(_0xbddc('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xbddc('0x2'));var logger=require(_0xbddc('0x3'))(_0xbddc('0x4'));module[_0xbddc('0x5')]=function(_0x153745,_0x2ff523,_0x3bc7ba,_0x7b0c84){return new BPromise(function(_0x4a4826,_0x4f750c){logger[_0xbddc('0x6')](_0xbddc('0x7'),_0x7b0c84||_0xbddc('0x8'));var _0x8c6334=new WebSocket(_0x7b0c84||_0xbddc('0x8'),{'perMessageDeflate':![]});var _0x5ccced='';var _0x13ec75='0';var _0x5de477='1';var _0xd05e4f=_0xbddc('0x9');function _0x25cbc4(_0x456a9e){var _0x4cf522=crypto['createHash'](_0xbddc('0xa'));_0x4cf522[_0xbddc('0xb')](_0x456a9e);return _0x4cf522[_0xbddc('0xc')]('hex');}function _0x5f2648(){try{logger['info'](_0xbddc('0xd'));var _0x40803e=moment()['unix']();var _0x2af05a=_0x25cbc4(_0x40803e+_0x2ff523+_0x3bc7ba);_0x8c6334[_0xbddc('0xe')](JSON[_0xbddc('0xf')]({'appID':_0x2ff523,'timestamp':_0x40803e,'appKey':_0x2af05a}));var _0xdead9c=fs['createReadStream'](_0x153745);_0xdead9c['on'](_0xbddc('0x10'),function(_0x5bf96a){_0x8c6334[_0xbddc('0xe')](_0x5bf96a);});_0xdead9c['on']('close',function(){_0x8c6334['send'](_0xbddc('0x11'));});}catch(_0x2f591b){logger[_0xbddc('0x12')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x2f591b));_0x8c6334['terminate']();}}function _0x78175e(_0x1e8b67){try{if(_0x1e8b67){var _0x8539a2=JSON[_0xbddc('0x13')](_0x1e8b67);switch(_0x8539a2[_0xbddc('0x14')]){case 0x0:if(_0x8539a2[_0xbddc('0x15')]){if(_0x8539a2[_0xbddc('0x15')][_0xbddc('0x16')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x8539a2[_0xbddc('0x15')]['hypotheses']));_0x5ccced=_0x8539a2['result']['hypotheses'][0x0][_0xbddc('0x17')];_0x13ec75=_0x8539a2[_0xbddc('0x15')][_0xbddc('0x18')][0x0][_0xbddc('0x19')];_0x5de477='0';_0xd05e4f=_0xbddc('0x1a');_0x8c6334[_0xbddc('0x1b')]();}}break;case 0x1:logger[_0xbddc('0x6')](_0xbddc('0x9'));_0x5de477='1';_0xd05e4f='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xbddc('0x6')](_0xbddc('0x1c'));_0x5de477='2';_0xd05e4f=_0xbddc('0x1c');break;case 0x9:logger[_0xbddc('0x6')](_0xbddc('0x1d'));_0x5de477='9';_0xd05e4f=_0xbddc('0x1d');break;case 0xa:logger['info'](_0xbddc('0x1e'));_0x5de477='10';_0xd05e4f=_0xbddc('0x1e');break;case 0xb:logger[_0xbddc('0x6')](_0xbddc('0x1f'));_0x5de477='11';_0xd05e4f=_0xbddc('0x1f');}}}catch(_0x1c2d1f){logger[_0xbddc('0x12')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xbddc('0xf')](_0x1c2d1f));_0x8c6334[_0xbddc('0x1b')]();}}function _0xf00379(){logger[_0xbddc('0x6')](_0xbddc('0x20'));_0x4a4826({'transcript':_0x5ccced,'confidence':_0x13ec75,'status':_0x5de477,'status_message':_0xd05e4f});}function _0x44c7fb(_0x4edb5b){logger[_0xbddc('0x12')](_0xbddc('0x21'));if(!_['isNil'](_0x4edb5b)){logger[_0xbddc('0x12')](_['isObject'](_0x4edb5b)?JSON[_0xbddc('0xf')](_0x4edb5b):_0x4edb5b);}}_0x8c6334['on'](_0xbddc('0x22'),_0x5f2648);_0x8c6334['on'](_0xbddc('0x23'),_0x78175e);_0x8c6334['on'](_0xbddc('0x24'),_0xf00379);_0x8c6334['on'](_0xbddc('0x12'),_0x44c7fb);});};
\ No newline at end of file
+var _0xe6b6=['digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','status','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.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','lodash','moment','crypto','../../../../../../config/logger','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update'];(function(_0x4cef1a,_0x4d77ca){var _0xe8dac7=function(_0x16916e){while(--_0x16916e){_0x4cef1a['push'](_0x4cef1a['shift']());}};_0xe8dac7(++_0x4d77ca);}(_0xe6b6,0x114));var _0x6e6b=function(_0x143670,_0x1b35d8){_0x143670=_0x143670-0x0;var _0x2fe397=_0xe6b6[_0x143670];return _0x2fe397;};'use strict';var BPromise=require('bluebird');var _=require(_0x6e6b('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x6e6b('0x1'));var crypto=require(_0x6e6b('0x2'));var logger=require(_0x6e6b('0x3'))('agi');module[_0x6e6b('0x4')]=function(_0x308e28,_0x763aa2,_0x581208,_0x35668e){return new BPromise(function(_0x8a6b4c,_0x442b1e){logger[_0x6e6b('0x5')]('Tilde\x20URI',_0x35668e||_0x6e6b('0x6'));var _0x21f937=new WebSocket(_0x35668e||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x25a003='';var _0x1f6bce='0';var _0x1af74b='1';var _0x4232a9=_0x6e6b('0x7');function _0x49d5c5(_0x23c6ff){var _0x3c298d=crypto[_0x6e6b('0x8')](_0x6e6b('0x9'));_0x3c298d[_0x6e6b('0xa')](_0x23c6ff);return _0x3c298d[_0x6e6b('0xb')](_0x6e6b('0xc'));}function _0x560373(){try{logger['info'](_0x6e6b('0xd'));var _0x36a88d=moment()[_0x6e6b('0xe')]();var _0x37ad7e=_0x49d5c5(_0x36a88d+_0x763aa2+_0x581208);_0x21f937[_0x6e6b('0xf')](JSON[_0x6e6b('0x10')]({'appID':_0x763aa2,'timestamp':_0x36a88d,'appKey':_0x37ad7e}));var _0x4ef3c5=fs['createReadStream'](_0x308e28);_0x4ef3c5['on'](_0x6e6b('0x11'),function(_0x5317e7){_0x21f937[_0x6e6b('0xf')](_0x5317e7);});_0x4ef3c5['on'](_0x6e6b('0x12'),function(){_0x21f937[_0x6e6b('0xf')](_0x6e6b('0x13'));});}catch(_0x2fc3f7){logger['error'](_0x6e6b('0x14'),JSON[_0x6e6b('0x10')](_0x2fc3f7));_0x21f937[_0x6e6b('0x15')]();}}function _0x50df99(_0x4d90a1){try{if(_0x4d90a1){var _0x5b3a69=JSON['parse'](_0x4d90a1);switch(_0x5b3a69[_0x6e6b('0x16')]){case 0x0:if(_0x5b3a69[_0x6e6b('0x17')]){if(_0x5b3a69[_0x6e6b('0x17')][_0x6e6b('0x18')]){logger[_0x6e6b('0x5')](_0x6e6b('0x19'),JSON['stringify'](_0x5b3a69[_0x6e6b('0x17')][_0x6e6b('0x1a')]));_0x25a003=_0x5b3a69[_0x6e6b('0x17')][_0x6e6b('0x1a')][0x0][_0x6e6b('0x1b')];_0x1f6bce=_0x5b3a69[_0x6e6b('0x17')][_0x6e6b('0x1a')][0x0][_0x6e6b('0x1c')];_0x1af74b='0';_0x4232a9=_0x6e6b('0x1d');_0x21f937[_0x6e6b('0x15')]();}}break;case 0x1:logger[_0x6e6b('0x5')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x1af74b='1';_0x4232a9=_0x6e6b('0x7');break;case 0x2:logger['info'](_0x6e6b('0x1e'));_0x1af74b='2';_0x4232a9='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x6e6b('0x5')](_0x6e6b('0x1f'));_0x1af74b='9';_0x4232a9=_0x6e6b('0x1f');break;case 0xa:logger[_0x6e6b('0x5')](_0x6e6b('0x20'));_0x1af74b='10';_0x4232a9=_0x6e6b('0x20');break;case 0xb:logger['info'](_0x6e6b('0x21'));_0x1af74b='11';_0x4232a9='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x2d8c29){logger[_0x6e6b('0x22')](_0x6e6b('0x23'),JSON[_0x6e6b('0x10')](_0x2d8c29));_0x21f937[_0x6e6b('0x15')]();}}function _0x4ca86a(){logger[_0x6e6b('0x5')](_0x6e6b('0x24'));_0x8a6b4c({'transcript':_0x25a003,'confidence':_0x1f6bce,'status':_0x1af74b,'status_message':_0x4232a9});}function _0x2168e0(_0x1a1be5){logger[_0x6e6b('0x22')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x6e6b('0x25')](_0x1a1be5)){logger['error'](_[_0x6e6b('0x26')](_0x1a1be5)?JSON[_0x6e6b('0x10')](_0x1a1be5):_0x1a1be5);}}_0x21f937['on'](_0x6e6b('0x27'),_0x560373);_0x21f937['on'](_0x6e6b('0x28'),_0x50df99);_0x21f937['on']('close',_0x4ca86a);_0x21f937['on']('error',_0x2168e0);});};
\ No newline at end of file
index b8944db..04f2343 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda95=['exports','./asr'];(function(_0x4c8be7,_0x2d1f9f){var _0x13b337=function(_0x5e9292){while(--_0x5e9292){_0x4c8be7['push'](_0x4c8be7['shift']());}};_0x13b337(++_0x2d1f9f);}(_0xda95,0x10f));var _0x5da9=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xda95[_0x2dea24];return _0x309d58;};var asr=require(_0x5da9('0x0'));module[_0x5da9('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x91ab=['./asr','exports'];(function(_0x58952f,_0xeed25f){var _0x3217ca=function(_0x3fda09){while(--_0x3fda09){_0x58952f['push'](_0x58952f['shift']());}};_0x3217ca(++_0xeed25f);}(_0x91ab,0x1b0));var _0xb91a=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x91ab[_0x3054be];return _0x3df150;};var asr=require(_0xb91a('0x0'));module[_0xb91a('0x1')]={'asr':asr};
\ No newline at end of file
index f01eb50..11d78d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x5448a9,_0x4764da){var _0x1924af=function(_0x34f9bf){while(--_0x34f9bf){_0x5448a9['push'](_0x5448a9['shift']());}};_0x1924af(++_0x4764da);}(_0xe706,0xa3));var _0x6e70=function(_0x5e4fdc,_0x183475){_0x5e4fdc=_0x5e4fdc-0x0;var _0xe2d401=_0xe706[_0x5e4fdc];return _0xe2d401;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);};
\ No newline at end of file
+var _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x506846,_0x5b9836){var _0x432459=function(_0x8c3c96){while(--_0x8c3c96){_0x506846['push'](_0x506846['shift']());}};_0x432459(++_0x5b9836);}(_0x34e8,0x12c));var _0x834e=function(_0x4c5c1e,_0x5f1dbb){_0x4c5c1e=_0x4c5c1e-0x0;var _0x1c2806=_0x34e8[_0x4c5c1e];return _0x1c2806;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);};
\ No newline at end of file
index 8167b70..54b7f8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ec7=['template_id','sendMail\x20message','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','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','host','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','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','util','lodash','odbc','mustache','request-promise','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawBody','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','IntervalId','interval','map','Intervals','format','open','error','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','includes','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','saveRestApiResult','hasOwnProperty','%s.%s','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','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','createSquareDetailsReport','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','forEach','keys','%s_ROWS_COUNT','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','NOBEEP','recordFile','google\x20%s\x20file\x20created','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appsecret\x20configured','beep','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','getIntervals','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','ispeech\x20TTS\x20is\x20unreachable','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','replace','escape_digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject'];(function(_0x18e2af,_0x5035f6){var _0x5cb409=function(_0x109ee9){while(--_0x109ee9){_0x18e2af['push'](_0x18e2af['shift']());}};_0x5cb409(++_0x5035f6);}(_0x8ec7,0x1f1));var _0x78ec=function(_0x5ad190,_0xd39c9e){_0x5ad190=_0x5ad190-0x0;var _0x518ed3=_0x8ec7[_0x5ad190];return _0x518ed3;};'use strict';var fs=require('fs');var util=require(_0x78ec('0x0'));var _=require(_0x78ec('0x1'));var sh=require('shelljs');var odbc=require(_0x78ec('0x2'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require(_0x78ec('0x3'));var rp=require(_0x78ec('0x4'));var logger=require('../../config/logger')(_0x78ec('0x5'));var config=require(_0x78ec('0x6'));var shared=require(_0x78ec('0x7'));var scripts=require(_0x78ec('0x8'));var FILES_PATH=_0x78ec('0x9');var recursiveMapAttributes=['rawHeaders',_0x78ec('0xa')];var verticesWithRetry=['menu',_0x78ec('0xb'),_0x78ec('0xc')];var AGIVertices=function(_0x264abb,_0x582b7b,_0x367c80){this[_0x78ec('0xd')]=_0x264abb;this[_0x78ec('0xe')]=_0x582b7b;this[_0x78ec('0xf')]=_0x367c80;};AGIVertices[_0x78ec('0x10')]['getVariable']=function(_0x4cfdc7,_0x283aa2){this[_0x78ec('0xe')][_0x78ec('0x11')](_0x4cfdc7)['then'](function(_0xee3f5){_0x283aa2(null,_0xee3f5?_0xee3f5[_0x78ec('0x12')]:![]);})[_0x78ec('0x13')](function(_0x7313ab){_0x283aa2(_0x7313ab);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x14')]=function(_0x7f90e1,_0x380afc){this[_0x78ec('0xe')][_0x78ec('0x15')](_0x7f90e1)[_0x78ec('0x16')](function(_0x503d09){_0x380afc(null,_0x503d09?_0x503d09[_0x78ec('0x12')]:![]);})[_0x78ec('0x13')](function(_0x3c179b){_0x380afc(_0x3c179b);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x17')]=function(_0x56df02,_0x4f9ffd){this['rpc']['getSquareProjectById'](_0x56df02)[_0x78ec('0x16')](function(_0x3c46c1){_0x4f9ffd(null,_0x3c46c1?_0x3c46c1[_0x78ec('0x12')]:![]);})[_0x78ec('0x13')](function(_0x162332){_0x4f9ffd(_0x162332);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x18')]=function(_0x396a6d,_0x23f588){this['rpc'][_0x78ec('0x19')](_0x396a6d)[_0x78ec('0x16')](function(_0xa25947){_0x23f588(null,_0xa25947?_0xa25947['dsn']:![]);})[_0x78ec('0x13')](function(_0x49a31a){_0x23f588(_0x49a31a);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x1a')]=function(_0x491f04,_0x1f86ff){this['rpc'][_0x78ec('0x1b')](_0x491f04)[_0x78ec('0x16')](function(_0x2f20f7){_0x1f86ff(null,_0x2f20f7?_0x2f20f7[_0x78ec('0x12')]:![]);})[_0x78ec('0x13')](function(_0x5c2180){_0x1f86ff(_0x5c2180);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x1c')]=function(_0x1e1086,_0x297bf4){this[_0x78ec('0xe')][_0x78ec('0x1d')](_0x1e1086)[_0x78ec('0x16')](function(_0x347b39){_0x297bf4(null,_0x347b39?_0x347b39['name']:![]);})['catch'](function(_0x2f2f9e){_0x297bf4(_0x2f2f9e);});};AGIVertices['prototype'][_0x78ec('0x1e')]=function(_0x1f30c2,_0x5d46ec){var _0x1a7f6e=this;this[_0x78ec('0xe')][_0x78ec('0x1f')](_0x1f30c2)['then'](function(_0x4f57e0){_0x5d46ec(null,_0x4f57e0?_0x1a7f6e[_0x78ec('0x20')](_0x4f57e0['save_name']):![]);})[_0x78ec('0x13')](function(_0x2749d3){_0x5d46ec(_0x2749d3);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x21')]=function(_0x16de6d,_0x13b1f3){this[_0x78ec('0xe')][_0x78ec('0x22')](_0x16de6d)[_0x78ec('0x16')](function(_0x2b2cf5){_0x13b1f3(null,_0x2b2cf5?_0x2b2cf5:![]);})['catch'](function(_0x41a5b7){_0x13b1f3(_0x41a5b7);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x23')]=function(_0x169e7e,_0x34dd4d,_0x1a6f2b){this[_0x78ec('0xf')]['sendMailMessage'](_0x169e7e,_0x34dd4d)[_0x78ec('0x16')](function(){_0x1a6f2b(null);})['catch'](function(_0x88521f){_0x1a6f2b(_0x88521f);});};AGIVertices[_0x78ec('0x10')]['getIntervals']=function(_0x219d4c,_0x147e43){this[_0x78ec('0xe')]['getIntervalById'](_0x219d4c)[_0x78ec('0x16')](function(_0x1fd366){if(_0x1fd366){if(_0x1fd366[_0x78ec('0x24')]){_0x147e43(null,[_0x1fd366[_0x78ec('0x25')]]);}else{_0x147e43(null,_[_0x78ec('0x26')](_0x1fd366[_0x78ec('0x27')],_0x78ec('0x25')));}}else{_0x147e43(null,![]);}})['catch'](function(_0x50580f){_0x147e43(_0x50580f);});};AGIVertices[_0x78ec('0x10')]['getSoundPath']=function(_0xd3bbd3){return util[_0x78ec('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0xd3bbd3);};AGIVertices[_0x78ec('0x10')]['getQueryOdbc']=function(_0x59f56f,_0x15a158,_0x2093f3){odbc[_0x78ec('0x29')](_0x59f56f,function(_0x5493e0){if(_0x5493e0){logger[_0x78ec('0x2a')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x5493e0);_0x2093f3(_0x5493e0);}else{logger['info'](_0x78ec('0x2b'));odbc[_0x78ec('0x2c')](_0x15a158,function(_0x43a11c,_0x395f63){if(_0x43a11c){logger[_0x78ec('0x2d')](_0x78ec('0x2e'),_0x15a158);_0x2093f3(_0x43a11c);}else{logger[_0x78ec('0x2d')](_0x78ec('0x2f'),_0x15a158);odbc[_0x78ec('0x30')](function(_0x195523){if(_0x195523){logger[_0x78ec('0x2a')](_0x78ec('0x31'),_0x195523);}_0x2093f3(null,_0x395f63);});}});}});};AGIVertices[_0x78ec('0x10')]['getSmsAccount']=function(_0x7828b4,_0xd84302){this[_0x78ec('0xe')][_0x78ec('0x32')](_0x7828b4)[_0x78ec('0x16')](function(_0x2784f2){_0xd84302(null,_0x2784f2?_0x2784f2:![]);})['catch'](function(_0x2c8794){_0xd84302(_0x2c8794);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x33')]=function(_0x4349ed,_0x339747){this[_0x78ec('0xe')]['createSmsMessage'](_0x4349ed)[_0x78ec('0x16')](function(_0x2b0b03){_0x339747(null,_0x2b0b03);})[_0x78ec('0x13')](function(_0x263af0){_0x339747(_0x263af0);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x2e87ae,_0x5b7f66,_0x269ec9){this[_0x78ec('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0x78ec('0xd')][_0x78ec('0x34')],'node':_0x2e87ae[_0x78ec('0x35')],'application':_0x2e87ae[_0x78ec('0x36')],'data':_0x5b7f66||null,'project_name':this[_0x78ec('0xd')][_0x78ec('0x37')],'callerid':this[_0x78ec('0xd')]['callerid']})[_0x78ec('0x16')](function(_0x3834cf){if(_0x269ec9){_0x269ec9(null,_0x3834cf);}})[_0x78ec('0x13')](function(_0x42bdd0){if(_0x269ec9){_0x269ec9(_0x42bdd0);}});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x38')]=function(_0x56e785,_0x2d2ed5,_0x57d437,_0x409ee7){this[_0x78ec('0xe')]['createSquareRecording']({'uniqueid':this['channel']['uniqueid'],'callerid':this['channel'][_0x78ec('0x39')],'calleridname':this[_0x78ec('0xd')][_0x78ec('0x3a')],'context':this[_0x78ec('0xd')][_0x78ec('0x3b')],'extension':this['channel'][_0x78ec('0x3c')],'priority':this[_0x78ec('0xd')][_0x78ec('0x3d')],'accountcode':this[_0x78ec('0xd')][_0x78ec('0x3e')],'dnid':this[_0x78ec('0xd')][_0x78ec('0x3f')],'projectName':this[_0x78ec('0xd')][_0x78ec('0x37')],'saveName':_0x2d2ed5,'filename':_0x56e785[_0x78ec('0x40')]||_0x2d2ed5,'savePath':_0x57d437})[_0x78ec('0x16')](function(_0x3608f0){_0x409ee7(null,_0x3608f0);})[_0x78ec('0x13')](function(_0x1be311){_0x409ee7(_0x1be311);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x41')]=function(_0x28f279,_0x259f07,_0x1db52b,_0x36f5cd,_0x414a85){this[_0x78ec('0xe')][_0x78ec('0x41')]({'uniqueid':this[_0x78ec('0xd')][_0x78ec('0x34')],'body':_0x28f279,'direction':_0x259f07,'providerName':_0x1db52b,'providerResponse':_0x36f5cd})['then'](function(_0x1c7696){if(_0x414a85){_0x414a85(null,_0x1c7696);}})['catch'](function(_0x446176){if(_0x414a85){_0x414a85(_0x446176);}});};AGIVertices[_0x78ec('0x10')]['createCmContact']=function(_0x1360ef,_0x51d35a){this[_0x78ec('0xe')][_0x78ec('0x42')]({'firstName':_[_0x78ec('0x43')](_0x1360ef[_0x78ec('0x12')])||_[_0x78ec('0x44')](_0x1360ef['name'])?_0x78ec('0x45')+Math['random']():_0x1360ef['name'],'lastName':_[_0x78ec('0x43')](_0x1360ef[_0x78ec('0x46')])||_[_0x78ec('0x44')](_0x1360ef['lastName'])?null:_0x1360ef[_0x78ec('0x46')],'phone':_0x1360ef[_0x78ec('0x47')],'ListId':_0x1360ef[_0x78ec('0x48')],'scheduledat':_0x1360ef[_0x78ec('0x49')],'callbackUniqueid':this[_0x78ec('0xd')][_0x78ec('0x34')],'tags':_0x78ec('0x4a'),'description':'Callback\x20scheduled\x20at\x20'+_0x1360ef['scheduledAt'][_0x78ec('0x4b')](),'priority':_0x1360ef[_0x78ec('0x4c')]})['then'](function(_0x31740a){_0x51d35a(null,_0x31740a);})[_0x78ec('0x13')](function(_0x3c70d1){_0x51d35a(_0x3c70d1);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x4d')]=function(_0x2ab0f3,_0x47f564){this[_0x78ec('0xe')][_0x78ec('0x4e')](_0x2ab0f3)[_0x78ec('0x16')](function(_0x4ca756){_0x47f564(null,_0x4ca756?_0x4ca756['name']:![]);})['catch'](function(_0x1a4993){_0x47f564(_0x1a4993);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x4f')]=function(_0x2935f2,_0x15cfe2,_0x3eb9e0){var _0x18fcd4={'role':_0x78ec('0x50')};_0x18fcd4[_0x2935f2]=this[_0x78ec('0xd')][_0x78ec('0x39')];this[_0x78ec('0xe')][_0x78ec('0x4f')](_0x18fcd4,_0x15cfe2,this['channel'][_0x78ec('0x34')])[_0x78ec('0x16')](function(_0x25daca){_0x3eb9e0(null,_['isNil'](_0x25daca)?![]:!![]);})[_0x78ec('0x13')](function(_0x447146){logger[_0x78ec('0x2a')](_0x447146);_0x3eb9e0(null,![]);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x51')]=function(_0xeee34c,_0x5e9600){var _0x42ca32={'role':_0x78ec('0x50')};_0x42ca32[_0xeee34c]=this[_0x78ec('0xd')][_0x78ec('0x39')];this['rpc'][_0x78ec('0x51')](_0x42ca32)[_0x78ec('0x16')](function(_0x49973a){_0x5e9600(null,_['isNil'](_0x49973a)?![]:!![]);})['catch'](function(_0x47fa93){logger['error'](_0x47fa93);_0x5e9600(null,![]);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x52')]=function(_0x2f9421,_0x307bbe){var _0xe9d4e={'role':_0x78ec('0x50')};_0xe9d4e[_0x2f9421]=this[_0x78ec('0xd')]['callerid'];this[_0x78ec('0xe')][_0x78ec('0x52')](_0xe9d4e)[_0x78ec('0x16')](function(_0x3873c4){_0x307bbe(null,_[_0x78ec('0x44')](_0x3873c4)?![]:!![]);})[_0x78ec('0x13')](function(_0x3f97b4){logger['error'](_0x3f97b4);_0x307bbe(null,![]);});};AGIVertices[_0x78ec('0x10')]['agentLogin']=function(_0x119c02,_0x2ee8d5){var _0x19454d={'role':'agent'};_0x19454d[_0x119c02]=this[_0x78ec('0xd')]['callerid'];var _0x3117d8=_0x119c02!='internal'?util[_0x78ec('0x28')](_0x78ec('0x53'),_0x78ec('0x54'),this[_0x78ec('0xd')][_0x78ec('0x39')]):undefined;this[_0x78ec('0xe')][_0x78ec('0x55')](_0x19454d,_0x3117d8)[_0x78ec('0x16')](function(_0x3f7212){_0x2ee8d5(null,_[_0x78ec('0x44')](_0x3f7212)?![]:!![]);})[_0x78ec('0x13')](function(_0x5938ef){logger[_0x78ec('0x2a')](_0x5938ef);_0x2ee8d5(null,![]);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x56')]=function(_0x19ba76,_0xad52){sh[_0x78ec('0x57')](_[_0x78ec('0x58')](_0x19ba76),function(_0x3a9c54,_0x365a8f){var _0x451a21=_0x365a8f['replace'](/(\r\n|\n|\r)/gm,'');_0xad52(null,_0x451a21);});};AGIVertices['prototype'][_0x78ec('0x59')]=function(_0x259423,_0x434849){scripts[_0x78ec('0x59')](_0x259423[_0x78ec('0x5a')],_0x259423[_0x78ec('0x5b')]||'text',_0x259423[_0x78ec('0x5c')],_0x259423[_0x78ec('0x5d')]||_0x78ec('0x5e'),_0x259423[_0x78ec('0x5f')]||'MALE',_0x259423[_0x78ec('0x60')]||_0x78ec('0x61'))[_0x78ec('0x16')](function(_0x197150){_0x434849(null,_0x197150);})['catch'](function(_0x38ea87){_0x434849(_0x38ea87);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x62')]=function(_0x3f7937,_0x33bdbf){scripts['googleTTS'](_0x3f7937[_0x78ec('0x5c')],_0x3f7937[_0x78ec('0x63')]||'en',0x1)['then'](function(_0xd983b){_0x33bdbf(null,_0xd983b);})[_0x78ec('0x13')](function(_0x2b9996){_0x33bdbf(_0x2b9996);});};AGIVertices['prototype'][_0x78ec('0x64')]=function(_0x1bf6fe,_0x15762f){var _0x2e6fe9={'uri':_0x1bf6fe[_0x78ec('0x65')],'method':_0x1bf6fe[_0x78ec('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1bf6fe[_0x78ec('0x67')])===_0x78ec('0x68')&&parseInt(_0x1bf6fe[_0x78ec('0x67')])>=0x1?parseInt(_0x1bf6fe[_0x78ec('0x67')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST','PUT'],_0x2e6fe9[_0x78ec('0x66')][_0x78ec('0x69')]())){try{_0x2e6fe9[_0x78ec('0x6a')]=_0x1bf6fe[_0x78ec('0xa')]?JSON[_0x78ec('0x6b')](_0x1bf6fe[_0x78ec('0xa')]):{};}catch(_0x55af78){logger[_0x78ec('0x2a')](_0x78ec('0x6c'),_0x55af78);}}try{_0x2e6fe9[_0x78ec('0x6d')]=_0x1bf6fe['rawHeaders']?JSON[_0x78ec('0x6b')](_0x1bf6fe[_0x78ec('0x6e')]):{};}catch(_0x453a63){logger['error'](_0x78ec('0x6f'),_0x453a63);}if(_0x1bf6fe[_0x78ec('0x70')]){try{var _0x10ddc2=require(_0x1bf6fe[_0x78ec('0x70')])['sync'](this,_0x2e6fe9);_0x2e6fe9[_0x78ec('0x71')]=Mustache[_0x78ec('0x72')](_0x1bf6fe[_0x78ec('0x65')],_0x10ddc2,{},['$$','$$']);if(_0x2e6fe9[_0x78ec('0x6d')]){_0x2e6fe9[_0x78ec('0x6d')]=JSON[_0x78ec('0x6b')](Mustache[_0x78ec('0x72')](JSON[_0x78ec('0x73')](_0x2e6fe9[_0x78ec('0x6d')]),_0x10ddc2,{},['$$','$$']));}if(_0x2e6fe9[_0x78ec('0x6a')]){_0x2e6fe9['body']=JSON[_0x78ec('0x6b')](Mustache[_0x78ec('0x72')](JSON[_0x78ec('0x73')](_0x2e6fe9[_0x78ec('0x6a')]),_0x10ddc2,{},['$$','$$']));}}catch(_0x4589d4){logger[_0x78ec('0x2a')](_0x78ec('0x74'),_0x4589d4);}}rp(_0x2e6fe9)[_0x78ec('0x16')](function(_0x3dbddf){var _0x467ffc={'statusCode':_0x3dbddf[_0x78ec('0x75')]||0xc8,'statusMessage':_0x3dbddf['statusMessage']||'OK','headers':_0x3dbddf[_0x78ec('0x6d')]||{},'body':_0x3dbddf['body']||{}};_0x15762f(null,_0x467ffc);})[_0x78ec('0x13')](function(_0x3a0c82){var _0xaafffe={'statusCode':_0x3a0c82[_0x78ec('0x75')]||0x1f4,'statusMessage':_0x3a0c82[_0x78ec('0x76')]||_0x78ec('0x77'),'headers':_0x3a0c82[_0x78ec('0x78')][_0x78ec('0x6d')]||{},'body':_0x3a0c82[_0x78ec('0x78')][_0x78ec('0x6a')]||{}};_0x15762f(null,_0xaafffe);});};AGIVertices[_0x78ec('0x10')]['googleDialogflow']=function(_0x53dc48,_0x4aff59){scripts[_0x78ec('0x79')](this[_0x78ec('0xd')][_0x78ec('0x34')],_0x53dc48[_0x78ec('0x7a')],_0x53dc48['text'],_0x53dc48[_0x78ec('0x7b')]||'en')[_0x78ec('0x16')](function(_0x46d87d){_0x4aff59(null,_0x46d87d);})[_0x78ec('0x13')](function(_0x3e860e){_0x4aff59(_0x3e860e);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x7c')]=function(_0xf5d2e0,_0x323cd6){scripts['googleDialogflowV2'](this['channel'][_0x78ec('0x34')],_0xf5d2e0['dialogflowV2_project_id'],_0xf5d2e0[_0x78ec('0x7d')],_0xf5d2e0[_0x78ec('0x7e')],_0xf5d2e0[_0x78ec('0x5c')],_0xf5d2e0[_0x78ec('0x7f')]||'en')[_0x78ec('0x16')](function(_0x123697){_0x323cd6(null,_0x123697);})[_0x78ec('0x13')](function(_0x2a6990){_0x323cd6(_0x2a6990);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x80')]=function(_0x497214,_0x2a83be){scripts[_0x78ec('0x80')](this['channel'],_0x497214)[_0x78ec('0x16')](function(_0x5aff03){_0x2a83be(null,_0x5aff03);})['catch'](function(_0xcce745){_0x2a83be(_0xcce745);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x81')]=function(_0x2d1a29,_0x307a13){scripts[_0x78ec('0x81')](_0x2d1a29[_0x78ec('0x7a')],_0x2d1a29[_0x78ec('0x5c')],_0x2d1a29[_0x78ec('0x82')]||_0x78ec('0x5e'),_0x2d1a29[_0x78ec('0x83')])[_0x78ec('0x16')](function(_0xd0ea07){_0x307a13(null,_0xd0ea07);})[_0x78ec('0x13')](function(_0x10751a){_0x307a13(_0x10751a);});};AGIVertices[_0x78ec('0x10')]['ispeechASR']=function(_0x13fa68,_0xc91535,_0x5abda8){scripts[_0x78ec('0x84')](_0xc91535,_0x13fa68['key'],_0x13fa68['ispeech_asr_language']||_0x78ec('0x5e'),this[_0x78ec('0x85')](_0x13fa68[_0x78ec('0x86')])?_0x13fa68['model']:undefined)[_0x78ec('0x16')](function(_0x42630c){_0x5abda8(null,_0x42630c);})[_0x78ec('0x13')](function(_0x17965f){_0x5abda8(_0x17965f);});};AGIVertices[_0x78ec('0x10')]['awsPolly']=function(_0x1c0813,_0xec1862){scripts[_0x78ec('0x87')](_0x1c0813[_0x78ec('0x88')],_0x1c0813[_0x78ec('0x89')],_0x1c0813[_0x78ec('0x8a')],_0x1c0813['aws_polly_voice']||'Amy',_0x1c0813[_0x78ec('0x5c')],_0x1c0813[_0x78ec('0x8b')]||_0x78ec('0x5c'))[_0x78ec('0x16')](function(_0x2973e2){_0xec1862(null,_0x2973e2);})[_0x78ec('0x13')](function(_0x569c85){_0xec1862(_0x569c85);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x8c')]=function(_0xeeee1,_0x29a4d2){scripts[_0x78ec('0x8c')](this[_0x78ec('0xd')][_0x78ec('0x34')],_0xeeee1[_0x78ec('0x88')],_0xeeee1[_0x78ec('0x89')],_0xeeee1[_0x78ec('0x8d')],_0xeeee1[_0x78ec('0x5c')],_0xeeee1[_0x78ec('0x8e')])[_0x78ec('0x16')](function(_0x491cc4){_0x29a4d2(null,_0x491cc4);})[_0x78ec('0x13')](function(_0xc622e7){_0x29a4d2(_0xc622e7);});};AGIVertices['prototype'][_0x78ec('0x8f')]=function(_0x4e5cc2,_0x35aa71,_0xae5eb){scripts['googleASR'](_0x35aa71,_0x4e5cc2['key'],_0x4e5cc2[_0x78ec('0x90')]||_0x78ec('0x5e'))[_0x78ec('0x16')](function(_0x3581aa){_0xae5eb(null,_0x3581aa);})[_0x78ec('0x13')](function(_0x328edb){_0xae5eb(_0x328edb);});};AGIVertices['prototype'][_0x78ec('0x91')]=function(_0x4f50bc,_0x1ef9ab,_0x51b992){scripts[_0x78ec('0x91')](_0x1ef9ab,_0x4f50bc['appid'],_0x4f50bc[_0x78ec('0x92')],_0x4f50bc[_0x78ec('0x71')])[_0x78ec('0x16')](function(_0x20fa7f){_0x51b992(null,_0x20fa7f);})['catch'](function(_0x2d7227){_0x51b992(_0x2d7227);});};AGIVertices[_0x78ec('0x10')][_0x78ec('0x93')]=function(_0x5aa0fc){var _0x2a0ced=_[_0x78ec('0x94')](verticesWithRetry,_0x5aa0fc['agicommand'])?_0x5aa0fc:_[_0x78ec('0x95')](_0x5aa0fc);for(var _0x2b8fad in _0x2a0ced){if(_0x2a0ced['hasOwnProperty'](_0x2b8fad)){if(_0x2a0ced[_0x2b8fad]&&_[_0x78ec('0x96')](_0x2a0ced[_0x2b8fad])){if(_[_0x78ec('0x94')](recursiveMapAttributes,_0x2b8fad)){_0x2a0ced[_0x2b8fad]=this[_0x78ec('0x97')](_0x2a0ced[_0x2b8fad]);}else{_0x2a0ced[_0x2b8fad]=this[_0x78ec('0x98')](_0x2a0ced[_0x2b8fad]);}}}}return _0x2a0ced;};AGIVertices[_0x78ec('0x10')]['recursiveNodeIndex']=function(_0x28a869){for(var _0x2b805f in _0x28a869){if(_0x28a869['hasOwnProperty'](_0x2b805f)){if(_['isPlainObject'](_0x28a869[_0x2b805f])){this[_0x78ec('0x99')](_0x28a869[_0x2b805f]);}else if(_[_0x78ec('0x9a')](_0x28a869[_0x2b805f])){for(var _0x4e7431=0x0;_0x4e7431<_0x28a869[_0x2b805f][_0x78ec('0x9b')];_0x4e7431++){this['recursiveNodeIndex'](_0x28a869[_0x2b805f][_0x4e7431]);}}else if(_['isString'](_0x28a869[_0x2b805f])){_0x28a869[_0x2b805f]=this[_0x78ec('0x98')](_0x28a869[_0x2b805f]);}}}};AGIVertices['prototype'][_0x78ec('0x9c')]=function(_0x5012e8,_0x1f1463){for(var _0x178552 in _0x5012e8){if(_0x5012e8[_0x78ec('0x9d')](_0x178552)){if(_['isPlainObject'](_0x5012e8[_0x178552])){if(!_['isEmpty'](_0x5012e8[_0x178552])){this[_0x78ec('0x9c')](_0x5012e8[_0x178552],util[_0x78ec('0x28')]('%s.%s',_0x1f1463,_0x178552));}}else if(_[_0x78ec('0x9a')](_0x5012e8[_0x178552])){for(var _0x58b451=0x0;_0x58b451<_0x5012e8[_0x178552][_0x78ec('0x9b')];_0x58b451++){this[_0x78ec('0x9c')](_0x5012e8[_0x178552][_0x58b451],util['format'](_0x78ec('0x9e'),_0x1f1463,_0x178552+'['+_0x58b451+']'));}}else{if(!_[_0x78ec('0x44')](_0x5012e8[_0x178552])){this[_0x78ec('0xd')][_0x78ec('0x9f')](util[_0x78ec('0x28')]('%s.%s',_0x1f1463,_0x178552),_0x5012e8[_0x178552]);}}}}};AGIVertices[_0x78ec('0x10')][_0x78ec('0x97')]=function(_0x2c3f29){try{var _0xd94b59=JSON[_0x78ec('0x6b')](_0x2c3f29);this[_0x78ec('0x99')](_0xd94b59);return JSON[_0x78ec('0x73')](_0xd94b59);}catch(_0x4ba328){return this[_0x78ec('0x98')](_0x2c3f29);}};AGIVertices[_0x78ec('0x10')]['replaceAllVariables']=function(_0x16316c){var _0x1127c8=_0x16316c[_0x78ec('0xa0')]('{');for(var _0x18d132=0x1;_0x18d132<_0x1127c8['length'];_0x18d132+=0x1){var _0x2be7a2=_0x1127c8[_0x18d132][_0x78ec('0xa0')]('}');if(_0x2be7a2[_0x78ec('0x9b')]>0x1){_0x16316c=_0x16316c[_0x78ec('0xa1')]('{'+_0x2be7a2[0x0]+'}',this[_0x78ec('0xd')][_0x78ec('0xa2')](_0x2be7a2[0x0])[_0x78ec('0xa3')]||_0x2be7a2[0x0]);}}if(_0x1127c8[_0x78ec('0x9b')]===0x1){return _0x16316c[_0x78ec('0x4b')]();}return this[_0x78ec('0x98')](_0x16316c);};AGIVertices['prototype'][_0x78ec('0xa4')]=function(_0x3e2fa1,_0x1e2055){var _0x430357=this[_0x78ec('0xd')][_0x78ec('0xa2')](_0x3e2fa1);if(_0x430357['result']===-0x1){return _0x430357;}logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0xa5'),_0x1e2055,_0x430357[_0x78ec('0xa3')]));return this[_0x78ec('0xd')][_0x78ec('0x9f')](_0x1e2055,_0x430357['extra']);};AGIVertices[_0x78ec('0x10')][_0x78ec('0x85')]=function(_0x454e3f){return _0x454e3f&&_0x454e3f!=='0'&&_0x454e3f!=='-1'&&_0x454e3f!=='';};AGIVertices['prototype'][_0x78ec('0xa6')]=function(_0x2159a4){this['createSquareDetailsReport'][_0x78ec('0xa7')](this,_0x2159a4,'-');_0x2159a4[_0x78ec('0xa8')]=_0x2159a4[_0x78ec('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x78ec('0x10')][_0x78ec('0xa9')]=function(_0x34f6ee){logger['info'](util[_0x78ec('0x28')](_0x78ec('0xaa'),_0x34f6ee[_0x78ec('0x35')]));if(!this[_0x78ec('0x85')](_0x34f6ee[_0x78ec('0x5c')])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0xac'));}var _0x1c0ffe='\x22'+_0x34f6ee['text']+'\x22';if(this[_0x78ec('0x85')](_0x34f6ee[_0x78ec('0x78')])){_0x1c0ffe+=','+_0x34f6ee[_0x78ec('0x78')];}var _0x43149e=this[_0x78ec('0xd')][_0x78ec('0x57')](_0x78ec('0xad'),_0x1c0ffe);if(_0x43149e[_0x78ec('0xae')]===-0x1){return _0x43149e;}return this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0xaf'),_0x1c0ffe));};AGIVertices[_0x78ec('0x10')][_0x78ec('0xb0')]=function(_0x1c8c76){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0xb1'),_0x1c8c76['label']));if(!this['isConfigured'](_0x1c8c76[_0x78ec('0xb2')])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0xb3'));}var _0x27c4f4=_0x1c8c76[_0x78ec('0xb2')];if(this[_0x78ec('0x85')](_0x1c8c76[_0x78ec('0x78')])){_0x27c4f4+=','+_0x1c8c76['options'];}var _0x21c720=this['channel'][_0x78ec('0x57')]('MRCPRecog',_0x27c4f4);if(_0x21c720[_0x78ec('0xae')]===-0x1){return _0x21c720;}var _0x52a63d=this['getAndSetVariable'](_0x78ec('0xb4'),'MRCP_RECOG_CONFIDENCE');if(_0x52a63d[_0x78ec('0xae')]===-0x1){return _0x52a63d;}var _0x490e71=this['getAndSetVariable']('RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT');if(_0x490e71[_0x78ec('0xae')]===-0x1){return _0x490e71;}var _0x58de05=this[_0x78ec('0xa4')](_0x78ec('0xb5'),_0x78ec('0xb6'));if(_0x58de05[_0x78ec('0xae')]===-0x1){return _0x58de05;}return this[_0x78ec('0xd')][_0x78ec('0xab')](util['format'](_0x78ec('0xb7'),_0x27c4f4));};AGIVertices[_0x78ec('0x10')][_0x78ec('0x5')]=function(_0x1c2759){logger['info'](util[_0x78ec('0x28')](_0x78ec('0xb8'),_0x1c2759[_0x78ec('0x35')]));return this['channel'][_0x78ec('0x5')]([_0x1c2759[_0x78ec('0xb9')],_0x1c2759['args']]);};AGIVertices[_0x78ec('0x10')][_0x78ec('0xba')]=function(_0x52669b){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0xbb'),_0x52669b[_0x78ec('0x35')]));if(this['isConfigured'](_0x52669b['timeout'])){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x52669b['timeout']));var _0x4be6fd=this[_0x78ec('0xd')]['wait'](_0x52669b['timeout']);if(_0x4be6fd['result']===-0x1){return _0x4be6fd;}}return this[_0x78ec('0xd')][_0x78ec('0xba')]();};AGIVertices[_0x78ec('0x10')][_0x78ec('0x4a')]=function(_0x581ae4){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0xbc'),_0x581ae4[_0x78ec('0x35')]));if(!this[_0x78ec('0x85')](_0x581ae4[_0x78ec('0x48')])){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x581ae4,'no\x20list\x20selected');}_0x581ae4['scheduledAt']=moment();if(this['isConfigured'](_0x581ae4[_0x78ec('0xbd')])){_0x581ae4['scheduledAt']=moment()[_0x78ec('0xbe')](_0x581ae4[_0x78ec('0xbd')],_0x78ec('0xbf'));}if(!this['isConfigured'](_0x581ae4[_0x78ec('0x4c')])){_0x581ae4['callback_priority']=0x2;}this[_0x78ec('0x42')][_0x78ec('0xa7')](this,_0x581ae4);return this['channel'][_0x78ec('0xab')](util[_0x78ec('0x28')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x581ae4[_0x78ec('0x47')],_0x581ae4[_0x78ec('0x48')],_0x581ae4[_0x78ec('0x49')]));};AGIVertices[_0x78ec('0x10')][_0x78ec('0xc0')]=function(_0x1d6211){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0xc1'),_0x1d6211[_0x78ec('0x35')]));var _0x249769=this[_0x78ec('0xd')][_0x78ec('0x57')](_0x1d6211[_0x78ec('0xc2')],_0x1d6211[_0x78ec('0x78')]);if(_0x249769[_0x78ec('0xae')]===-0x1){return _0x249769;}return this[_0x78ec('0xd')][_0x78ec('0xab')](util['format'](_0x78ec('0xc3'),_0x1d6211[_0x78ec('0xc2')],_0x1d6211['options']));};AGIVertices[_0x78ec('0x10')][_0x78ec('0xc4')]=function(_0xf3ef4){logger[_0x78ec('0x2d')](util['format'](_0x78ec('0xc5'),_0xf3ef4[_0x78ec('0x35')]));if(!this[_0x78ec('0x85')](_0xf3ef4[_0x78ec('0x5c')])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0xac'));}var _0x564892='\x22'+_0xf3ef4[_0x78ec('0x5c')]+'\x22';if(this['isConfigured'](_0xf3ef4['options'])){_0x564892+=','+_0xf3ef4[_0x78ec('0x78')];}var _0x25eafb=this[_0x78ec('0xd')]['exec']('MRCPSynth',_0x564892);if(_0x25eafb[_0x78ec('0xae')]===-0x1){return _0x25eafb;}return this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0xaf'),_0x564892));};AGIVertices[_0x78ec('0x10')]['sestektts']=function(_0x4f88c2){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x4f88c2[_0x78ec('0x35')]));if(!this['isConfigured'](_0x4f88c2[_0x78ec('0x5c')])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0xac'));}var _0x4f7a26='\x22'+_0x4f88c2[_0x78ec('0x5c')]+'\x22';if(this[_0x78ec('0x85')](_0x4f88c2[_0x78ec('0x78')])){_0x4f7a26+=','+_0x4f88c2['options'];}var _0x3d8cc4=this[_0x78ec('0xd')][_0x78ec('0x57')](_0x78ec('0xad'),_0x4f7a26);if(_0x3d8cc4[_0x78ec('0xae')]===-0x1){return _0x3d8cc4;}return this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0xaf'),_0x4f7a26));};AGIVertices[_0x78ec('0x10')][_0x78ec('0xc6')]=function(_0x190a11){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0xc7'),_0x190a11[_0x78ec('0x35')]));if(!this[_0x78ec('0x85')](_0x190a11['grammar'])){return this[_0x78ec('0xd')][_0x78ec('0xab')]('no\x20grammar\x20configured');}var _0x54693e=_0x190a11['grammar'];if(this[_0x78ec('0x85')](_0x190a11[_0x78ec('0x78')])){_0x54693e+=','+_0x190a11['options'];}var _0x2c5c56=this[_0x78ec('0xd')]['exec'](_0x78ec('0xc8'),_0x54693e);if(_0x2c5c56[_0x78ec('0xae')]===-0x1){return _0x2c5c56;}var _0x3c3dc4=this[_0x78ec('0xa4')](_0x78ec('0xb4'),_0x78ec('0xc9'));if(_0x3c3dc4[_0x78ec('0xae')]===-0x1){return _0x3c3dc4;}var _0x54cc39=this[_0x78ec('0xa4')]('RECOG_INPUT()',_0x78ec('0xca'));if(_0x54cc39[_0x78ec('0xae')]===-0x1){return _0x54cc39;}var _0x17639c=this[_0x78ec('0xa4')]('RECOG_INSTANCE()',_0x78ec('0xcb'));if(_0x17639c[_0x78ec('0xae')]===-0x1){return _0x17639c;}return this[_0x78ec('0xd')][_0x78ec('0xab')](util['format'](_0x78ec('0xb7'),_0x54693e));};AGIVertices[_0x78ec('0x10')][_0x78ec('0xcc')]=function(_0x32fb9){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0xcd'),_0x32fb9['label']));if(!this[_0x78ec('0x85')](_0x32fb9[_0x78ec('0xb2')])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0xb3'));}var _0x5b9eed=_0x32fb9['grammar'];if(this[_0x78ec('0x85')](_0x32fb9[_0x78ec('0x78')])){_0x5b9eed+=','+_0x32fb9[_0x78ec('0x78')];}var _0x19166d=this[_0x78ec('0xd')]['exec'](_0x78ec('0xc8'),_0x5b9eed);if(_0x19166d[_0x78ec('0xae')]===-0x1){return _0x19166d;}var _0x5ce355=this[_0x78ec('0xa4')](_0x78ec('0xb4'),_0x78ec('0xce'));if(_0x5ce355[_0x78ec('0xae')]===-0x1){return _0x5ce355;}var _0x1afd26=this[_0x78ec('0xa4')]('RECOG_INPUT()',_0x78ec('0xcf'));if(_0x1afd26[_0x78ec('0xae')]===-0x1){return _0x1afd26;}var _0x32c972=this[_0x78ec('0xa4')]('RECOG_INSTANCE()',_0x78ec('0xd0'));if(_0x32c972[_0x78ec('0xae')]===-0x1){return _0x32c972;}return this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0xb7'),_0x5b9eed));};AGIVertices['prototype'][_0x78ec('0xd1')]=function(_0x227ff8){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0xd2'),_0x227ff8['label']));if(!this['isConfigured'](_0x227ff8[_0x78ec('0xd3')])){return this[_0x78ec('0xd')]['error'](_0x227ff8,_0x78ec('0xd4'));}var _0x1951be=this[_0x78ec('0x18')][_0x78ec('0xa7')](this,_0x227ff8[_0x78ec('0xd3')]);if(!_0x1951be){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x227ff8,_0x78ec('0xd5'));}if(!this[_0x78ec('0x85')](_0x227ff8[_0x78ec('0x2c')])){return this[_0x78ec('0xd')]['error'](_0x227ff8,_0x78ec('0xd6'));}var _0x1aae34=_0x227ff8[_0x78ec('0x2c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0xd7'),_0x1aae34));var _0x49fff8=this['getQueryOdbc'][_0x78ec('0xa7')](this,_0x1951be,_0x1aae34);this[_0x78ec('0xd8')][_0x78ec('0xa7')](this,_0x227ff8,_0x1aae34);if(!this[_0x78ec('0x85')](_0x227ff8['variable_id'])){return this['channel']['noop'](_0x78ec('0xd9'));}var _0x551866=this['getVariable']['sync'](this,_0x227ff8[_0x78ec('0xda')]);if(!_0x551866){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x227ff8,'no\x20variable\x20found');}var _0xf6ee97=this;_0x49fff8[_0x78ec('0xdb')](function(_0x301f88,_0x104734){Object[_0x78ec('0xdc')](_0x301f88)[_0x78ec('0xdb')](function(_0x6b166){_0xf6ee97[_0x78ec('0xd')][_0x78ec('0x9f')](util['format']('%s[%s][%s]',_0x551866,_0x104734,_0x6b166),_0x301f88[_0x6b166]);});});this[_0x78ec('0xd')][_0x78ec('0x9f')](util[_0x78ec('0x28')](_0x78ec('0xdd'),_0x551866),_0x49fff8[_0x78ec('0x9b')]);return this[_0x78ec('0xd')]['noop'](util[_0x78ec('0x28')]('variable\x20%s\x20set',_0x551866));};AGIVertices[_0x78ec('0x10')][_0x78ec('0xde')]=function(_0x4f1b43){logger['debug'](util[_0x78ec('0x28')](_0x78ec('0xdf'),_0x4f1b43['label']));if(!this[_0x78ec('0x85')](_0x4f1b43[_0x78ec('0xe0')])){return this[_0x78ec('0xd')]['error'](_0x4f1b43,_0x78ec('0xe1'));}var _0x37dc39=this[_0x78ec('0x1a')][_0x78ec('0xa7')](this,_0x4f1b43[_0x78ec('0xe0')]);if(!_0x37dc39){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x4f1b43,'no\x20user\x20found');}var _0x5bbc99=this[_0x78ec('0xd')][_0x78ec('0x57')](_0x78ec('0xe2'),[util[_0x78ec('0x28')](_0x78ec('0xe3'),_0x37dc39),_0x4f1b43[_0x78ec('0x67')],_0x4f1b43['opts'],_0x4f1b43[_0x78ec('0x65')]]);if(_0x5bbc99[_0x78ec('0xae')]===-0x1){return _0x5bbc99;}return this[_0x78ec('0xd')][_0x78ec('0xab')](util['format'](_0x78ec('0xe4'),_0x78ec('0xe2')));};AGIVertices['prototype']['dialogflow']=function(_0x21fd6c){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0xe5'),_0x21fd6c['label']));if(!this[_0x78ec('0x85')](_0x21fd6c[_0x78ec('0x7a')])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0xe6'));}if(!this[_0x78ec('0x85')](_0x21fd6c[_0x78ec('0x5c')])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0xac'));}this['channel'][_0x78ec('0xe7')]=!![];this[_0x78ec('0xd8')](_0x21fd6c);this['createSquareMessage'](_0x21fd6c[_0x78ec('0x5c')],'in','','');this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0xe8'),_0x21fd6c['text']));var _0x362588=this[_0x78ec('0x79')]['sync'](this,_0x21fd6c);if(_0x362588){for(var _0x40a3bd in _0x362588){if(_0x362588[_0x78ec('0x9d')](_0x40a3bd)){this[_0x78ec('0xd')][_0x78ec('0x9f')](util[_0x78ec('0x28')](_0x78ec('0xe9'),_0x40a3bd[_0x78ec('0x69')]()),_0x362588[_0x40a3bd]);}}this[_0x78ec('0x41')](_0x362588[_0x78ec('0xea')],_0x78ec('0xeb'),_0x78ec('0xec'),'');return this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0xed'),_0x362588[_0x78ec('0xea')]));}return this[_0x78ec('0xd')]['error'](_0x21fd6c,_0x78ec('0xee'));};AGIVertices[_0x78ec('0x10')]['dialogflowV2']=function(_0x5ae49a){logger[_0x78ec('0x2d')](util['format'](_0x78ec('0xef'),_0x5ae49a[_0x78ec('0x35')]));if(!this[_0x78ec('0x85')](_0x5ae49a[_0x78ec('0xf0')])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0xf1'));}if(!this[_0x78ec('0x85')](_0x5ae49a['client_email'])){return this[_0x78ec('0xd')]['noop'](_0x78ec('0xf2'));}if(!this[_0x78ec('0x85')](_0x5ae49a[_0x78ec('0x7e')])){return this['channel'][_0x78ec('0xab')]('no\x20private_key\x20configured');}if(!this[_0x78ec('0x85')](_0x5ae49a[_0x78ec('0x7f')])){return this['channel']['noop']('no\x20anguage\x20configured');}if(!this[_0x78ec('0x85')](_0x5ae49a[_0x78ec('0x5c')])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0xac'));}this['channel'][_0x78ec('0xe7')]=!![];this[_0x78ec('0xd8')](_0x5ae49a);this[_0x78ec('0x41')](_0x5ae49a[_0x78ec('0x5c')],'in','','');this[_0x78ec('0xd')]['noop'](util[_0x78ec('0x28')]('Trying\x20DialogflowV2:\x20%s',_0x5ae49a['text']));var _0x2382a1=this[_0x78ec('0x7c')][_0x78ec('0xa7')](this,_0x5ae49a);if(_0x2382a1){for(var _0x209f21 in _0x2382a1){if(_0x2382a1[_0x78ec('0x9d')](_0x209f21)){if(_0x209f21!==_0x78ec('0xf3')){this[_0x78ec('0xd')][_0x78ec('0x9f')](util['format'](_0x78ec('0xe9'),_0x209f21[_0x78ec('0x69')]()),_0x2382a1[_0x209f21]);}}}this['createSquareMessage'](_0x2382a1[_0x78ec('0xea')],_0x78ec('0xeb'),_0x78ec('0xf4'),_0x2382a1['providerResponse']);return this[_0x78ec('0xd')][_0x78ec('0xab')](util['format'](_0x78ec('0xf5'),_0x2382a1[_0x78ec('0xea')]));}return this[_0x78ec('0xd')]['error'](_0x5ae49a,_0x78ec('0xf6'));};AGIVertices[_0x78ec('0x10')]['sesteknda']=function(_0x32dba4){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0xf7'),_0x32dba4[_0x78ec('0x35')]));if(!this[_0x78ec('0x85')](_0x32dba4[_0x78ec('0xf8')])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0xf9'));}if(!this[_0x78ec('0x85')](_0x32dba4['username'])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0xfa'));}if(!this['isConfigured'](_0x32dba4[_0x78ec('0xfb')])){return this['channel']['noop'](_0x78ec('0xfc'));}if(!this[_0x78ec('0x85')](_0x32dba4[_0x78ec('0xfd')])){return this['channel'][_0x78ec('0xab')](_0x78ec('0xac'));}this['channel'][_0x78ec('0xe7')]=!![];this[_0x78ec('0xd8')](_0x32dba4);this[_0x78ec('0x41')](_0x32dba4[_0x78ec('0x5c')],'in','','');this[_0x78ec('0xd')]['noop'](util[_0x78ec('0x28')](_0x78ec('0xfe'),_0x32dba4[_0x78ec('0x5c')]));var _0x3f9ff7=this[_0x78ec('0x80')][_0x78ec('0xa7')](this,_0x32dba4);if(_0x3f9ff7){for(var _0xd65c09 in _0x3f9ff7){if(_0x3f9ff7[_0x78ec('0x9d')](_0xd65c09)){this['channel'][_0x78ec('0x9f')](util['format'](_0x78ec('0xff'),_0xd65c09[_0x78ec('0x69')]()),_0x3f9ff7[_0xd65c09]);}}this['createSquareMessage'](_0x3f9ff7[_0x78ec('0xea')],_0x78ec('0xeb'),'sesteknda','');if(_0x3f9ff7['audiofile']){this[_0x78ec('0xd')][_0x78ec('0xab')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x3f9ff7[_0x78ec('0x100')]));var _0x526f75=this[_0x78ec('0xd')]['streamFile'](_0x3f9ff7[_0x78ec('0x100')]);try{fs[_0x78ec('0x101')](_0x3f9ff7['audiofile']+_0x78ec('0x102'));}catch(_0x5dbcef){logger[_0x78ec('0x2a')](_0x5dbcef);}return _0x526f75;}else{return this['channel'][_0x78ec('0xab')](util['format'](_0x78ec('0x103'),_0x3f9ff7['speech']));}}return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x32dba4,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x78ec('0x10')][_0x78ec('0x104')]=function(_0x39a3a1){logger['info'](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x39a3a1[_0x78ec('0x35')]));return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0x104'));};AGIVertices[_0x78ec('0x10')][_0x78ec('0x105')]=function(_0x1f99f3){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x106'),_0x1f99f3['label']));var _0x491d24='';if(_0x1f99f3[_0x78ec('0x107')]){if(!this['isConfigured'](_0x1f99f3[_0x78ec('0x107')])){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x1f99f3,_0x78ec('0x108'));}else{var _0x415e13=parseInt(_0x1f99f3[_0x78ec('0x107')],0xa);if(isNaN(_0x415e13)){_0x491d24=_0x1f99f3['trunk_id'];}else{_0x491d24=this[_0x78ec('0x1c')]['sync'](this,_0x1f99f3['trunk_id']);if(!_0x491d24){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x1f99f3,'no\x20trunk\x20found');}}}}else if(_0x1f99f3[_0x78ec('0x109')]){_0x491d24=_0x1f99f3[_0x78ec('0x109')];}else{return this['channel'][_0x78ec('0x2a')](_0x1f99f3,_0x78ec('0x108'));}var _0x5ce7a5=this[_0x78ec('0xd')][_0x78ec('0x57')]('DIAL',[util[_0x78ec('0x28')](_0x78ec('0x10a'),_0x491d24,_0x1f99f3['phone']),_0x1f99f3['timeout'],_0x1f99f3[_0x78ec('0x10b')],_0x1f99f3['url']]);if(_0x5ce7a5['result']===-0x1){return _0x5ce7a5;}return this['channel']['noop'](util[_0x78ec('0x28')]('Executed\x20command\x20%s',_0x78ec('0xe2')));};AGIVertices[_0x78ec('0x10')][_0x78ec('0x10c')]=function(_0x1758ab){logger[_0x78ec('0x2d')](util['format'](_0x78ec('0x10d'),_0x1758ab[_0x78ec('0x35')]));return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0x10c'));};AGIVertices[_0x78ec('0x10')]['getdigits']=function(_0x65ea04){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x10e'),_0x65ea04['label']));if(_0x65ea04[_0x78ec('0xa8')]===0x0){return this[_0x78ec('0xa6')](_0x65ea04);}_0x65ea04[_0x78ec('0xa8')]-=0x1;if(!this[_0x78ec('0x85')](_0x65ea04[_0x78ec('0x10f')])){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x65ea04,'no\x20file\x20audio\x20selected');}var _0xb88f40=this[_0x78ec('0x1e')]['sync'](this,_0x65ea04[_0x78ec('0x10f')]);if(!_0xb88f40){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x65ea04,'no\x20file\x20audio\x20found');}if(!this[_0x78ec('0x85')](_0x65ea04[_0x78ec('0xda')])){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x78ec('0xd9'));}var _0x47aea7=this['channel']['getData'](_0xb88f40,_0x65ea04[_0x78ec('0x110')],_0x65ea04[_0x78ec('0x111')]);var _0x1122ca=_0x47aea7[_0x78ec('0xae')]?_0x47aea7['result'][_0x78ec('0x4b')]():'';logger[_0x78ec('0x2d')](_0x78ec('0x112'),JSON['stringify'](_0x47aea7));if(_0x47aea7[_0x78ec('0xae')]===-0x1){this[_0x78ec('0xd8')][_0x78ec('0xa7')](this,_0x65ea04,_0x1122ca);return _0x47aea7;}else if(_0x47aea7[_0x78ec('0xa3')]==='timeout'){_0x47aea7['result']=_0x1122ca[_0x78ec('0x9b')]>=parseInt(_0x65ea04[_0x78ec('0x113')])?'x':'i';}else{_0x47aea7[_0x78ec('0xae')]=_0x1122ca['length']>=parseInt(_0x65ea04[_0x78ec('0x113')])&&_0x1122ca['length']<=parseInt(_0x65ea04['maxdigit'])?'x':'i';}var _0x390ca7=this[_0x78ec('0xa2')][_0x78ec('0xa7')](this,_0x65ea04[_0x78ec('0xda')]);if(!_0x390ca7){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x65ea04,_0x78ec('0x114'));}this['channel'][_0x78ec('0x9f')](_0x390ca7,_0x1122ca);if(this[_0x78ec('0x85')](_0x65ea04[_0x78ec('0x115')])){var _0x5a92a6=parseInt(_0x65ea04['hiddendigitsnum'],0xa);var _0x390a56=rs[_0x78ec('0x116')]({'charset':'*','length':_0x5a92a6});var _0x39658f=_0x1122ca[_0x78ec('0x9b')];if(_0x39658f>0x0){if(_0x39658f>_0x5a92a6){this[_0x78ec('0xd8')][_0x78ec('0xa7')](this,_0x65ea04,_0x65ea04[_0x78ec('0x117')]==='first'?_0x390a56+_0x1122ca[_0x78ec('0x118')](_0x5a92a6):_0x1122ca[_0x78ec('0x118')](0x0,_0x39658f-_0x5a92a6)+_0x390a56);}else{this['createSquareDetailsReport'][_0x78ec('0xa7')](this,_0x65ea04,rs[_0x78ec('0x116')]({'charset':'*','length':_0x39658f}));}}else{this[_0x78ec('0xd8')][_0x78ec('0xa7')](this,_0x65ea04,'');}}else{this['createSquareDetailsReport'][_0x78ec('0xa7')](this,_0x65ea04,_0x1122ca);}return _0x47aea7;};AGIVertices[_0x78ec('0x10')]['getsecretdigits']=function(_0x1d13d2){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x119'),_0x1d13d2[_0x78ec('0x35')]));return this[_0x78ec('0xb')](_0x1d13d2);};AGIVertices[_0x78ec('0x10')]['goal']=function(_0x5994d4){logger[_0x78ec('0x2d')](util['format'](_0x78ec('0x11a'),_0x5994d4[_0x78ec('0x35')]));this['createSquareDetailsReport'][_0x78ec('0xa7')](this,_0x5994d4,_0x5994d4['goalname']);return this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x11b'),_0x5994d4[_0x78ec('0x11c')]));};AGIVertices[_0x78ec('0x10')]['awspolly']=function(_0x26e743){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x11d'),_0x26e743['label']));if(!this['isConfigured'](_0x26e743['aws_access_key_id'])||!this['isConfigured'](_0x26e743['aws_secret_access_key'])){return this[_0x78ec('0xd')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x26e743['text'])){return this['channel']['noop'](_0x78ec('0xac'));}this[_0x78ec('0xd')]['noop'](util['format'](_0x78ec('0x11e'),_0x26e743[_0x78ec('0x5c')]));var _0x6bc391=this['awsPolly']['sync'](this,_0x26e743);if(_0x6bc391){this['channel']['noop'](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x6bc391));var _0x4eac29=this['channel']['streamFile'](_0x6bc391);try{fs[_0x78ec('0x101')](_0x6bc391+'.wav');}catch(_0x2b0c45){logger[_0x78ec('0x2a')](_0x2b0c45);}return _0x4eac29;}return this[_0x78ec('0xd')]['error'](_0x26e743,_0x78ec('0x11f'));};AGIVertices[_0x78ec('0x10')][_0x78ec('0x120')]=function(_0x5c14e8){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x5c14e8[_0x78ec('0x35')]));if(!this[_0x78ec('0x85')](_0x5c14e8['aws_access_key_id'])||!this[_0x78ec('0x85')](_0x5c14e8[_0x78ec('0x89')])){return this[_0x78ec('0xd')][_0x78ec('0xab')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x78ec('0x85')](_0x5c14e8['aws_bot_name'])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0x121'));}if(!this[_0x78ec('0x85')](_0x5c14e8[_0x78ec('0x5c')])){return this['channel'][_0x78ec('0xab')]('no\x20text\x20configured');}this[_0x78ec('0xd')][_0x78ec('0xe7')]=!![];this[_0x78ec('0xd8')](_0x5c14e8);this[_0x78ec('0x41')](_0x5c14e8[_0x78ec('0x5c')],'in','','');this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x122'),_0x5c14e8['text']));var _0x363cd4=this['awsLex'][_0x78ec('0xa7')](this,_0x5c14e8);if(_0x363cd4){for(var _0x8940fb in _0x363cd4){if(_0x363cd4[_0x78ec('0x9d')](_0x8940fb)&&_[_0x78ec('0x96')](_0x363cd4[_0x8940fb])){this[_0x78ec('0xd')][_0x78ec('0x9f')](util['format']('AWS_LEX_%s',_0x8940fb[_0x78ec('0x69')]()),_0x363cd4[_0x8940fb]);}}if(_['isNil'](_0x363cd4[_0x78ec('0x76')])){return this['channel'][_0x78ec('0xab')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this['createSquareMessage'](_0x363cd4[_0x78ec('0x76')],_0x78ec('0xeb'),_0x78ec('0x123'),'');return this['channel'][_0x78ec('0xab')](util[_0x78ec('0x28')]('Amazon\x20Lex\x20Result\x20%s',_0x363cd4[_0x78ec('0x76')]));}}return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x5c14e8,_0x78ec('0x124'));};AGIVertices[_0x78ec('0x10')][_0x78ec('0x125')]=function(_0x2b26d0){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x2b26d0[_0x78ec('0x35')],_0x2b26d0[_0x78ec('0x67')]));if(!this[_0x78ec('0x85')](_0x2b26d0[_0x78ec('0x7a')])){return this[_0x78ec('0xd')]['noop'](_0x78ec('0xe6'));}var _0x309195=_0x78ec('0x126');var _0x33f7b2=util[_0x78ec('0x28')](_0x78ec('0x127'),FILES_PATH,rs['generate'](0x4));var _0x294981=util[_0x78ec('0x28')](_0x78ec('0x9e'),_0x33f7b2,_0x309195);var _0x3e1fea=!![];if(_0x2b26d0['beep']===_0x78ec('0x128')){_0x3e1fea=![];}var _0x470778=this[_0x78ec('0xd')][_0x78ec('0x129')](_0x33f7b2,_0x309195,_0x2b26d0['intKey'],_0x2b26d0[_0x78ec('0x67')],undefined,_0x3e1fea);if(_0x470778[_0x78ec('0xae')]!==-0x1){this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x12a'),_0x294981));var _0x487f4c=this[_0x78ec('0x8f')][_0x78ec('0xa7')](this,_0x2b26d0,_0x294981);if(_0x487f4c){for(var _0x1ca097 in _0x487f4c){if(_0x487f4c[_0x78ec('0x9d')](_0x1ca097)){this['channel'][_0x78ec('0x9f')](util[_0x78ec('0x28')]('GOOGLE_ASR_%s',_0x1ca097[_0x78ec('0x69')]()),_0x487f4c[_0x1ca097]);}}return this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')]('GoogleASR\x20Result\x20%s',JSON[_0x78ec('0x73')](_0x487f4c)));}}return _0x470778;};AGIVertices[_0x78ec('0x10')][_0x78ec('0x12b')]=function(_0x93bc00){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x12c'),_0x93bc00[_0x78ec('0x35')]));if(!this[_0x78ec('0x85')](_0x93bc00[_0x78ec('0x12d')])){return this[_0x78ec('0xd')][_0x78ec('0xab')]('no\x20appid\x20configured');}if(!this[_0x78ec('0x85')](_0x93bc00['appsecret'])){return this['channel']['noop'](_0x78ec('0x12e'));}var _0x29164a=_0x78ec('0x126');var _0x44757e=util[_0x78ec('0x28')](_0x78ec('0x127'),FILES_PATH,rs[_0x78ec('0x116')](0x4));var _0x52879f=util[_0x78ec('0x28')](_0x78ec('0x9e'),_0x44757e,_0x29164a);var _0x3a14d8=!![];if(_0x93bc00[_0x78ec('0x12f')]===_0x78ec('0x128')){_0x3a14d8=![];}var _0x444b9b=this[_0x78ec('0xd')][_0x78ec('0x129')](_0x44757e,_0x29164a,_0x93bc00[_0x78ec('0x130')],_0x93bc00[_0x78ec('0x67')],undefined,_0x3a14d8);if(_0x444b9b['result']!==-0x1){this[_0x78ec('0xd')]['noop'](util[_0x78ec('0x28')](_0x78ec('0x131'),_0x52879f));var _0x41356d=this[_0x78ec('0x91')][_0x78ec('0xa7')](this,_0x93bc00,_0x52879f);if(_0x41356d){for(var _0x4041ad in _0x41356d){if(_0x41356d[_0x78ec('0x9d')](_0x4041ad)){this[_0x78ec('0xd')][_0x78ec('0x9f')](util[_0x78ec('0x28')](_0x78ec('0x132'),_0x4041ad[_0x78ec('0x69')]()),_0x41356d[_0x4041ad]);}}return this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x133'),JSON[_0x78ec('0x73')](_0x41356d)));}}return _0x444b9b;};AGIVertices[_0x78ec('0x10')][_0x78ec('0x134')]=function(_0x20a050){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x135'),_0x20a050[_0x78ec('0x35')]));return this[_0x78ec('0xd')][_0x78ec('0x136')](_0x20a050[_0x78ec('0x3b')],_0x20a050[_0x78ec('0x3c')],_0x20a050[_0x78ec('0x3d')]);};AGIVertices['prototype'][_0x78ec('0x137')]=function(_0x4f8a51){logger[_0x78ec('0x2d')](util['format'](_0x78ec('0x138'),_0x4f8a51['label']));if(!this[_0x78ec('0x85')](_0x4f8a51[_0x78ec('0x139')])){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x4f8a51,_0x78ec('0x13a'));}try{var _0x230b06=eval(_0x4f8a51[_0x78ec('0x139')])?'true':_0x78ec('0x13b');this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')]('EVAL\x20CONDITION\x20%s\x20%s',_0x4f8a51['condition'],_0x230b06));return{'code':0xc8,'result':_0x230b06};}catch(_0x8fa201){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype'][_0x78ec('0x13c')]=function(_0x5655ea){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x13d'),_0x5655ea[_0x78ec('0x35')]));if(!this[_0x78ec('0x85')](_0x5655ea['interval_id'])){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x5655ea,'no\x20interval\x20configured');}var _0x489f25=this[_0x78ec('0x13e')][_0x78ec('0xa7')](this,_0x5655ea[_0x78ec('0x13f')]);if(!_0x489f25){return this[_0x78ec('0xd')]['error'](_0x5655ea,_0x78ec('0x140'));}for(var _0x413328=0x0;_0x413328<_0x489f25[_0x78ec('0x9b')];_0x413328+=0x1){var _0x2815b2=this['channel']['getVariable'](util[_0x78ec('0x28')](_0x78ec('0x141'),_0x489f25[_0x413328]));if(_0x2815b2[_0x78ec('0xae')]===-0x1){return _0x2815b2;}logger[_0x78ec('0x2d')](util[_0x78ec('0x28')]('IFTIME\x20%s\x20%s',_0x489f25[_0x413328],_0x2815b2[_0x78ec('0xa3')]));if(_0x2815b2[_0x78ec('0xa3')]==='true'){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x142'),_0x489f25[_0x413328],_0x78ec('0x143')));this['channel'][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x142'),_0x489f25[_0x413328],_0x78ec('0x143')));return{'code':0xc8,'result':_0x78ec('0x143')};}else{logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x142'),_0x489f25[_0x413328],_0x78ec('0x13b')));this['channel'][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x142'),_0x489f25[_0x413328],'false'));}}return{'code':0xc8,'result':_0x78ec('0x13b')};};AGIVertices[_0x78ec('0x10')][_0x78ec('0x144')]=function(_0x6cb004){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x145'),_0x6cb004['label']));return this[_0x78ec('0xd')][_0x78ec('0x144')]();};AGIVertices['prototype'][_0x78ec('0x146')]=function(_0x3e3641){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x147'),_0x3e3641['label']));if(!this[_0x78ec('0x85')](_0x3e3641[_0x78ec('0x7a')])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0xe6'));}var _0x463779='wav';var _0x2d4fc2=util[_0x78ec('0x28')](_0x78ec('0x127'),FILES_PATH,rs[_0x78ec('0x116')](0x4));var _0x32724e=util[_0x78ec('0x28')](_0x78ec('0x9e'),_0x2d4fc2,_0x463779);var _0x1df22f=!![];if(_0x3e3641[_0x78ec('0x12f')]===_0x78ec('0x128')){_0x1df22f=![];}var _0x162256=this[_0x78ec('0xd')][_0x78ec('0x129')](_0x2d4fc2,_0x463779,_0x3e3641['intKey'],_0x3e3641[_0x78ec('0x67')],undefined,_0x1df22f);if(_0x162256[_0x78ec('0xae')]!==-0x1){this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x148'),_0x32724e));var _0x534876=this[_0x78ec('0x84')][_0x78ec('0xa7')](this,_0x3e3641,_0x32724e);if(_0x534876){for(var _0x26cbb4 in _0x534876){if(_0x534876[_0x78ec('0x9d')](_0x26cbb4)){this[_0x78ec('0xd')][_0x78ec('0x9f')](util[_0x78ec('0x28')](_0x78ec('0x149'),_0x26cbb4[_0x78ec('0x69')]()),_0x534876[_0x26cbb4]);}}return this['channel']['noop'](util[_0x78ec('0x28')](_0x78ec('0x14a'),JSON[_0x78ec('0x73')](_0x534876)));}}return _0x162256;};AGIVertices[_0x78ec('0x10')][_0x78ec('0x14b')]=function(_0x3cb957){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x14c'),_0x3cb957[_0x78ec('0x35')]));if(!this[_0x78ec('0x85')](_0x3cb957[_0x78ec('0x7a')])){return this[_0x78ec('0xd')]['noop'](_0x78ec('0xe6'));}if(!this[_0x78ec('0x85')](_0x3cb957[_0x78ec('0x5c')])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0xac'));}this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x14d'),_0x3cb957[_0x78ec('0x5c')]));var _0x33c291=this['ispeechTTS']['sync'](this,_0x3cb957);if(_0x33c291){this[_0x78ec('0xd')]['noop'](util[_0x78ec('0x28')](_0x78ec('0x148'),_0x33c291));var _0x1ad4a4=this[_0x78ec('0xd')][_0x78ec('0x14e')](_0x33c291,_0x3cb957['intKey']);try{fs[_0x78ec('0x101')](_0x33c291+_0x78ec('0x102'));}catch(_0x540aa7){logger['error'](_0x540aa7);}return _0x1ad4a4;}return this['channel'][_0x78ec('0x2a')](_0x3cb957,_0x78ec('0x14f'));};AGIVertices[_0x78ec('0x10')]['login']=function(_0x3824c4){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x3824c4[_0x78ec('0x35')]));if(!this[_0x78ec('0x85')](_0x3824c4[_0x78ec('0x150')])){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x3824c4,'no\x20find\x20by\x20configured');}logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x151'),this['channel'][_0x78ec('0x39')],_0x3824c4[_0x78ec('0x150')]));var _0x4bf479=this[_0x78ec('0x55')]['sync'](this,_0x3824c4[_0x78ec('0x150')]);if(_0x4bf479){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x78ec('0xd')][_0x78ec('0x39')],_0x3824c4[_0x78ec('0x150')]));this['channel'][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x152'),this[_0x78ec('0xd')][_0x78ec('0x39')],_0x3824c4[_0x78ec('0x150')]));return{'code':0xc8,'result':_0x78ec('0x153')};}else{logger['info'](util[_0x78ec('0x28')](_0x78ec('0x154'),this[_0x78ec('0xd')][_0x78ec('0x39')],_0x3824c4[_0x78ec('0x150')]));this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x154'),this[_0x78ec('0xd')][_0x78ec('0x39')],_0x3824c4[_0x78ec('0x150')]));return{'code':0xc8,'result':_0x78ec('0x155')};}};AGIVertices[_0x78ec('0x10')][_0x78ec('0x156')]=function(_0x135c99){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x157'),_0x135c99[_0x78ec('0x35')]));if(!this['isConfigured'](_0x135c99[_0x78ec('0x150')])){return this[_0x78ec('0xd')]['error'](_0x135c99,_0x78ec('0x158'));}logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x151'),this['channel'][_0x78ec('0x39')],_0x135c99[_0x78ec('0x150')]));var _0x3376aa=this[_0x78ec('0x52')][_0x78ec('0xa7')](this,_0x135c99[_0x78ec('0x150')]);if(_0x3376aa){logger['info'](util[_0x78ec('0x28')](_0x78ec('0x152'),this[_0x78ec('0xd')][_0x78ec('0x39')],_0x135c99[_0x78ec('0x150')]));this[_0x78ec('0xd')]['noop'](util[_0x78ec('0x28')](_0x78ec('0x152'),this[_0x78ec('0xd')]['callerid'],_0x135c99[_0x78ec('0x150')]));return{'code':0xc8,'result':'success'};}else{logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x154'),this[_0x78ec('0xd')][_0x78ec('0x39')],_0x135c99[_0x78ec('0x150')]));this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x154'),this['channel'][_0x78ec('0x39')],_0x135c99[_0x78ec('0x150')]));return{'code':0xc8,'result':_0x78ec('0x155')};}};AGIVertices[_0x78ec('0x10')][_0x78ec('0x159')]=function(_0x10321c){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x15a'),_0x10321c[_0x78ec('0x35')]));if(!this[_0x78ec('0x85')](_0x10321c[_0x78ec('0x15b')])){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x10321c,_0x78ec('0x15c'));}this[_0x78ec('0xd')][_0x78ec('0xab')](util['format'](_0x78ec('0x15d'),_0x10321c[_0x78ec('0x15b')]));var _0x4ca91c=eval(_0x10321c['operation']);if(!this[_0x78ec('0x85')](_0x10321c[_0x78ec('0xda')])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0xd9'));}var _0x704f42=this[_0x78ec('0xa2')]['sync'](this,_0x10321c['variable_id']);if(!_0x704f42){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x10321c,_0x78ec('0x114'));}if(_['isArray'](_0x4ca91c)){var _0x29aa93=this;_0x4ca91c['forEach'](function(_0x1e35d7,_0x1ef003){_0x29aa93[_0x78ec('0xd')][_0x78ec('0x9f')](util[_0x78ec('0x28')](_0x78ec('0x15e'),_0x704f42,_0x1ef003),_0x1e35d7);});return this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x15f'),_0x704f42));}else{return this[_0x78ec('0xd')][_0x78ec('0x9f')](_0x704f42,_0x4ca91c);}};AGIVertices['prototype']['menu']=function(_0x5b0e14){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x160'),_0x5b0e14[_0x78ec('0x35')]));if(_0x5b0e14[_0x78ec('0xa8')]===0x0){return this['maxRetry'](_0x5b0e14);}_0x5b0e14[_0x78ec('0xa8')]-=0x1;if(!this[_0x78ec('0x85')](_0x5b0e14[_0x78ec('0x10f')])){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x5b0e14,_0x78ec('0x161'));}var _0x115c90=this['getSound'][_0x78ec('0xa7')](this,_0x5b0e14['file_id']);if(!_0x115c90){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x5b0e14,_0x78ec('0x162'));}var _0xae25c9=this[_0x78ec('0xd')]['getData'](_0x115c90,_0x5b0e14['response'],_0x5b0e14[_0x78ec('0x163')]);var _0x4e78b7=_0xae25c9[_0x78ec('0xae')];if(_0xae25c9[_0x78ec('0xae')]===-0x1){this[_0x78ec('0xd8')][_0x78ec('0xa7')](this,_0x5b0e14,'-1');return _0xae25c9;}else if(_0xae25c9[_0x78ec('0xa3')]===_0x78ec('0x67')){_0xae25c9[_0x78ec('0xae')]=_0xae25c9[_0x78ec('0xae')]['length']>0x0?_0xae25c9['result']:'t';}else if(_['isEmpty'](_0xae25c9[_0x78ec('0xae')])){_0xae25c9[_0x78ec('0xae')]='#';_0x4e78b7='#';}if(!this['isConfigured'](_0x5b0e14[_0x78ec('0xda')])){this['channel'][_0x78ec('0xab')](_0x78ec('0xd9'));}else{var _0x52f43b=this[_0x78ec('0xa2')][_0x78ec('0xa7')](this,_0x5b0e14[_0x78ec('0xda')]);if(!_0x52f43b){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x5b0e14,_0x78ec('0x114'));}this[_0x78ec('0xd')][_0x78ec('0x9f')](_0x52f43b,_0x4e78b7);}this[_0x78ec('0xd8')][_0x78ec('0xa7')](this,_0x5b0e14,_0x4e78b7);return _0xae25c9;};AGIVertices[_0x78ec('0x10')]['noop']=function(_0x2b5462){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x164'),_0x2b5462[_0x78ec('0x35')]));return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x2b5462[_0x78ec('0x165')]||_0x2b5462['label']);};AGIVertices[_0x78ec('0x10')][_0x78ec('0x166')]=function(_0x5c5c4d){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x167'),_0x5c5c4d[_0x78ec('0x35')]));if(!this['isConfigured'](_0x5c5c4d[_0x78ec('0x150')])){return this['channel']['error'](_0x5c5c4d,_0x78ec('0x158'));}logger['info'](util[_0x78ec('0x28')](_0x78ec('0x151'),this[_0x78ec('0xd')][_0x78ec('0x39')],_0x5c5c4d[_0x78ec('0x150')]));var _0xb41ea1=this['getPause'][_0x78ec('0xa7')](this,_0x5c5c4d['pause_id']);var _0x32e959=this[_0x78ec('0x4f')][_0x78ec('0xa7')](this,_0x5c5c4d[_0x78ec('0x150')],_0xb41ea1);if(_0x32e959){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x152'),this[_0x78ec('0xd')][_0x78ec('0x39')],_0x5c5c4d[_0x78ec('0x150')]));this['channel']['noop'](util[_0x78ec('0x28')](_0x78ec('0x152'),this['channel'][_0x78ec('0x39')],_0x5c5c4d['findBy']));return{'code':0xc8,'result':_0x78ec('0x153')};}else{logger['info'](util[_0x78ec('0x28')](_0x78ec('0x154'),this[_0x78ec('0xd')][_0x78ec('0x39')],_0x5c5c4d[_0x78ec('0x150')]));this[_0x78ec('0xd')]['noop'](util[_0x78ec('0x28')](_0x78ec('0x152'),this[_0x78ec('0xd')][_0x78ec('0x39')],_0x5c5c4d['findBy']));return{'code':0xc8,'result':_0x78ec('0x155')};}};AGIVertices[_0x78ec('0x10')][_0x78ec('0x168')]=function(_0x4d50f6){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x169'),_0x4d50f6[_0x78ec('0x35')]));if(!this['isConfigured'](_0x4d50f6[_0x78ec('0x10f')])){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x4d50f6,'no\x20file\x20audio\x20selected');}var _0x4a9062=this[_0x78ec('0x1e')][_0x78ec('0xa7')](this,_0x4d50f6[_0x78ec('0x10f')]);if(!_0x4a9062){return this['channel']['error'](_0x4d50f6,_0x78ec('0x162'));}var _0x3eed60=this[_0x78ec('0xd')][_0x78ec('0x57')](_0x78ec('0x16a'),[_0x4a9062,_0x4d50f6[_0x78ec('0x10b')]]);if(_0x3eed60[_0x78ec('0xae')]===-0x1){return _0x3eed60;}return this[_0x78ec('0xd')][_0x78ec('0xab')](util['format'](_0x78ec('0xc3'),'PLAYBACK',_0x4a9062));};AGIVertices[_0x78ec('0x10')]['queue']=function(_0x3df20c){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x16b'),_0x3df20c[_0x78ec('0x35')]));if(!this['isConfigured'](_0x3df20c[_0x78ec('0x16c')])){return this[_0x78ec('0xd')]['error'](_0x3df20c,_0x78ec('0x16d'));}var _0x3f475d='';var _0x1034b1=parseInt(_0x3df20c[_0x78ec('0x16c')],0xa);if(isNaN(_0x1034b1)){_0x3f475d=_0x3df20c[_0x78ec('0x16c')];}else{_0x3f475d=this[_0x78ec('0x14')][_0x78ec('0xa7')](this,_0x3df20c[_0x78ec('0x16c')]);if(!_0x3f475d){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x3df20c,'no\x20queue\x20found');}}var _0x5d76f9='';if(this[_0x78ec('0x85')](_0x3df20c[_0x78ec('0x10f')])){var _0x397056=this[_0x78ec('0x1e')]['sync'](this,_0x3df20c[_0x78ec('0x10f')]);if(_0x397056){_0x5d76f9=_0x397056;}}this[_0x78ec('0xd8')][_0x78ec('0xa7')](this,_0x3df20c,_0x3f475d);if(_0x3df20c[_0x78ec('0x10b')][_0x78ec('0x16e')]('x')<0x0){_0x3df20c['opts']+='x';}if(_0x3df20c['opts'][_0x78ec('0x16e')]('X')<0x0){_0x3df20c[_0x78ec('0x10b')]+='X';}this[_0x78ec('0xd')][_0x78ec('0x9f')](_0x78ec('0x16f'),_0x3f475d?_0x3f475d[_0x78ec('0x170')]():'');var _0xd0eb19=this['channel'][_0x78ec('0x57')]('QUEUE',[_0x3f475d,_0x3df20c[_0x78ec('0x10b')],_0x3df20c[_0x78ec('0x65')],_0x5d76f9,_0x3df20c['timeout'],_0x3df20c['agi'],_0x3df20c[_0x78ec('0x171')],_0x3df20c[_0x78ec('0x172')],'',_0x3df20c['position']]);if(_0xd0eb19['result']===-0x1){return _0xd0eb19;}return this[_0x78ec('0xd')][_0x78ec('0xab')](util['format'](_0x78ec('0xc3'),_0x78ec('0x173'),_0x3f475d));};AGIVertices[_0x78ec('0x10')][_0x78ec('0x174')]=function(_0x30433e){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x175'),_0x30433e[_0x78ec('0x35')]));var _0x2b3383=_0x30433e[_0x78ec('0x176')]||_0x78ec('0x126');var _0x135966=util[_0x78ec('0x28')](_0x78ec('0x177'),this[_0x78ec('0xd')][_0x78ec('0x34')],rs[_0x78ec('0x116')](0x5));var _0x10d671=util['format'](_0x78ec('0x178'),FILES_PATH,_0x135966,_0x2b3383);var _0x1b0958=util['format']('%s/recordings/%s',FILES_PATH,_0x135966);this[_0x78ec('0x38')][_0x78ec('0xa7')](this,_0x30433e,_0x135966,_0x10d671);this[_0x78ec('0xd')]['setVariable'](_0x78ec('0x179'),_0x135966);logger[_0x78ec('0x2d')](_0x78ec('0x17a'),_0x1b0958,_0x2b3383,_0x30433e['escape_digits'],_0x30433e[_0x78ec('0x67')]);return this['channel'][_0x78ec('0x129')](_0x1b0958,_0x2b3383,_0x30433e['escape_digits'],_0x30433e[_0x78ec('0x67')],undefined,!![]);};AGIVertices[_0x78ec('0x10')]['restapi']=function(_0x5bb6a1){logger[_0x78ec('0x2d')](util['format'](_0x78ec('0x17b'),_0x5bb6a1[_0x78ec('0x35')]));if(!this['isConfigured'](_0x5bb6a1[_0x78ec('0x65')])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0x17c'));}var _0x838763=this['restAPI'][_0x78ec('0xa7')](this,_0x5bb6a1);logger[_0x78ec('0x2d')](util[_0x78ec('0x28')]('Response:',util['inspect'](_0x838763,{'showHidden':![],'depth':null})));if(!this[_0x78ec('0x85')](_0x5bb6a1[_0x78ec('0xda')])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0x17d'));}var _0x34a2e3=this['getVariable'][_0x78ec('0xa7')](this,_0x5bb6a1[_0x78ec('0xda')]);if(!_0x34a2e3){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x5bb6a1,_0x78ec('0x114'));}this[_0x78ec('0xd')][_0x78ec('0x9f')](util[_0x78ec('0x28')](_0x78ec('0x17e'),_0x34a2e3),_0x838763[_0x78ec('0x75')]?_0x838763[_0x78ec('0x75')]:_0x78ec('0x17f'));this['channel']['setVariable'](util[_0x78ec('0x28')](_0x78ec('0x180'),_0x34a2e3),_0x838763[_0x78ec('0x181')]?_0x838763[_0x78ec('0x181')]:'OK');if(_0x838763[_0x78ec('0x6a')]){try{this['saveRestApiResult'](_0x838763[_0x78ec('0x6a')],_0x34a2e3);}catch(_0x13c754){logger['error'](util[_0x78ec('0x28')](_0x78ec('0x182'),_0x34a2e3));}}return this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x183'),_0x34a2e3));};AGIVertices[_0x78ec('0x10')][_0x78ec('0x184')]=function(_0x5be066){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x185'),_0x5be066[_0x78ec('0x35')]));return this[_0x78ec('0xd')]['sayDigits'](_0x5be066['digits'][_0x78ec('0x186')](/\s+/g,''),_0x5be066[_0x78ec('0x187')]);};AGIVertices[_0x78ec('0x10')]['saynumber']=function(_0x27c6dc){logger['info'](util[_0x78ec('0x28')](_0x78ec('0x188'),_0x27c6dc[_0x78ec('0x35')]));return this[_0x78ec('0xd')][_0x78ec('0x189')](_0x27c6dc[_0x78ec('0x68')][_0x78ec('0x186')](/\s+/g,''),_0x27c6dc[_0x78ec('0x187')]);};AGIVertices[_0x78ec('0x10')][_0x78ec('0x18a')]=function(_0x3aa4d4){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x3aa4d4[_0x78ec('0x35')]));return this[_0x78ec('0xd')][_0x78ec('0x18b')](_0x3aa4d4[_0x78ec('0x5c')],_0x3aa4d4[_0x78ec('0x187')]);};AGIVertices[_0x78ec('0x10')][_0x78ec('0x18c')]=function(_0x2e6dda){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x2e6dda[_0x78ec('0x35')]));if(!this['isConfigured'](_0x2e6dda[_0x78ec('0x18d')])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0x18e'));}var _0x58045a=this[_0x78ec('0x21')]['sync'](this,_0x2e6dda['account_id']);if(!_0x58045a||!_0x58045a[_0x78ec('0x18f')]){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x2e6dda,_0x78ec('0x190'));}var _0x235c0e={'from':util[_0x78ec('0x28')](_0x78ec('0x191'),_0x58045a[_0x78ec('0x12')],_0x58045a[_0x78ec('0x192')]||_0x58045a[_0x78ec('0x18f')]['user']),'to':_0x2e6dda['to']||'','cc':_0x2e6dda['cc']||'','bcc':_0x2e6dda[_0x78ec('0x193')]||'','subject':_0x2e6dda[_0x78ec('0x194')],'html':_0x2e6dda['text'],'text':_0x2e6dda['text']};if(this[_0x78ec('0x85')](_0x2e6dda[_0x78ec('0x195')])){}logger['debug'](_0x78ec('0x196'),JSON[_0x78ec('0x73')](_0x235c0e));this[_0x78ec('0xd8')][_0x78ec('0xa7')](this,_0x2e6dda,_0x2e6dda[_0x78ec('0x18d')]);this[_0x78ec('0xd')]['noop'](util[_0x78ec('0x28')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x58045a[_0x78ec('0x12')]));this['sendMailMessage']['sync'](this,_0x58045a[_0x78ec('0x197')],_0x235c0e);return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0x198'));};AGIVertices['prototype'][_0x78ec('0x199')]=function(_0x55eccf){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x55eccf[_0x78ec('0x35')]));return this['channel']['noop'](_0x78ec('0x19a'));};AGIVertices[_0x78ec('0x10')]['sendSMS']=function(_0x119472){logger['info'](util[_0x78ec('0x28')](_0x78ec('0x19b'),_0x119472[_0x78ec('0x35')]));if(!this[_0x78ec('0x85')](_0x119472[_0x78ec('0x19c')])){return this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0x19d'));}var _0x44cf87=this['getSmsAccount']['sync'](this,_0x119472['sms_account_id']);if(!_0x44cf87){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x119472,'no\x20sms\x20account\x20found');}var _0x54780b={'body':_0x119472[_0x78ec('0x19e')],'phone':_0x119472['to']||'','SmsAccountId':_0x44cf87['id']};logger['debug'](_0x78ec('0x19f'),JSON[_0x78ec('0x73')](_0x54780b));this[_0x78ec('0xd8')][_0x78ec('0xa7')](this,_0x119472,_0x119472[_0x78ec('0x19c')]);this['channel'][_0x78ec('0xab')](util[_0x78ec('0x28')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x44cf87['name']));this[_0x78ec('0x33')][_0x78ec('0xa7')](this,_0x54780b);return this['channel'][_0x78ec('0xab')](_0x78ec('0x1a0'));};AGIVertices[_0x78ec('0x10')][_0x78ec('0x1a1')]=function(_0x3a9db4){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x1a2'),_0x3a9db4['label']));if(!this['isConfigured'](_0x3a9db4[_0x78ec('0xda')])){return this['channel'][_0x78ec('0x2a')](_0x3a9db4,_0x78ec('0x1a3'));}var _0x2c611f=this[_0x78ec('0xa2')]['sync'](this,_0x3a9db4[_0x78ec('0xda')]);if(!_0x2c611f){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x3a9db4,_0x78ec('0x114'));}return this[_0x78ec('0xd')][_0x78ec('0x9f')](_0x2c611f,_0x3a9db4[_0x78ec('0x1a4')]);};AGIVertices['prototype']['start']=function(_0x54a53a){logger[_0x78ec('0x2d')](util['format'](_0x78ec('0x1a5'),_0x54a53a['label']));this['channel'][_0x78ec('0xab')](_0x78ec('0x1a6'));if(_0x54a53a[_0x78ec('0xba')]===_0x78ec('0x1a7')){this[_0x78ec('0xd')][_0x78ec('0xab')](_0x78ec('0x1a8'));return this[_0x78ec('0xd')]['answer']();}return this[_0x78ec('0xd')][_0x78ec('0xab')]('Skipped\x20Answer');};AGIVertices[_0x78ec('0x10')][_0x78ec('0x1a9')]=function(_0x407f66){logger['info'](util[_0x78ec('0x28')](_0x78ec('0x1aa'),_0x407f66[_0x78ec('0x35')]));if(!this[_0x78ec('0x85')](_0x407f66[_0x78ec('0x1ab')])){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x407f66,_0x78ec('0x1ac'));}var _0x3dbd66=this['getSquareProject']['sync'](this,_0x407f66[_0x78ec('0x1ab')]);if(!this[_0x78ec('0x85')](_0x3dbd66)){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x407f66,util[_0x78ec('0x28')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x407f66[_0x78ec('0x1ab')]));}if(_0x3dbd66===this[_0x78ec('0xd')]['arg_1']){return this['channel']['error'](_0x407f66,_0x78ec('0x1ad'));}this[_0x78ec('0xd8')][_0x78ec('0xa7')](this,_0x407f66,_0x3dbd66);var _0x40c545=this[_0x78ec('0xd')][_0x78ec('0x57')](_0x78ec('0x1ae'),util[_0x78ec('0x28')](_0x78ec('0x1af'),config[_0x78ec('0x5')][_0x78ec('0x1b0')]||'127.0.0.1',_0x3dbd66,this[_0x78ec('0xd')][_0x78ec('0x37')]));if(_0x40c545['result']===-0x1){return _0x40c545;}return this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0xc3'),_0x78ec('0x1ae'),_0x3dbd66));};AGIVertices[_0x78ec('0x10')]['system']=function(_0x8a7b98){logger['info'](util['format'](_0x78ec('0x1b1'),_0x8a7b98[_0x78ec('0x35')]));var _0x41378b=this[_0x78ec('0x56')][_0x78ec('0xa7')](this,_0x8a7b98[_0x78ec('0xb9')]);this[_0x78ec('0xd8')][_0x78ec('0xa7')](this,_0x8a7b98,_0x8a7b98['command']);if(this[_0x78ec('0x85')](_0x8a7b98[_0x78ec('0xda')])){var _0x78505b=this['getVariable']['sync'](this,_0x8a7b98['variable_id']);if(_0x78505b){this[_0x78ec('0xd')]['setVariable'](_0x78505b,_0x41378b);return this[_0x78ec('0xd')][_0x78ec('0xab')](util['format'](_0x78ec('0x1b2'),_0x8a7b98[_0x78ec('0xb9')],_0x78505b));}}return this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x1b3'),_0x8a7b98[_0x78ec('0xb9')]));};AGIVertices['prototype'][_0x78ec('0x1b4')]=function(_0x104c86){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x1b5'),_0x104c86[_0x78ec('0x35')]));_0x104c86[_0x78ec('0x5c')]=_0x104c86[_0x78ec('0x5c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x78ec('0x85')](_0x104c86[_0x78ec('0x5a')])){return this[_0x78ec('0xd')]['noop']('no\x20apiKey\x20configured');}if(!this[_0x78ec('0x85')](_0x104c86['text'])){return this['channel'][_0x78ec('0xab')](_0x78ec('0xac'));}this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x1b6'),_0x104c86[_0x78ec('0x5c')]));var _0x26fcc2=this[_0x78ec('0x59')][_0x78ec('0xa7')](this,_0x104c86);if(_0x26fcc2){this[_0x78ec('0xd')][_0x78ec('0xab')](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x26fcc2));var _0x363f38=this[_0x78ec('0xd')][_0x78ec('0x14e')](_0x26fcc2);try{fs[_0x78ec('0x101')](_0x26fcc2+'.wav');}catch(_0x2578fa){logger[_0x78ec('0x2a')](_0x2578fa);}return _0x363f38;}return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x104c86,_0x78ec('0x1b7'));};AGIVertices['prototype'][_0x78ec('0x1b8')]=function(_0x361d3a){logger['info'](util['format'](_0x78ec('0x1b9'),_0x361d3a['label']));_0x361d3a[_0x78ec('0x5c')]=_0x361d3a[_0x78ec('0x5c')][_0x78ec('0x186')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x361d3a['text'])){return this['channel'][_0x78ec('0xab')]('no\x20text\x20configured');}this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x1ba'),_0x361d3a[_0x78ec('0x5c')]));var _0x528365=this[_0x78ec('0x62')][_0x78ec('0xa7')](this,_0x361d3a);if(_0x528365){this[_0x78ec('0xd')][_0x78ec('0xab')](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x528365));var _0x100d7c=this[_0x78ec('0xd')]['streamFile'](_0x528365);try{fs[_0x78ec('0x101')](_0x528365+'.wav');}catch(_0x5341ba){logger[_0x78ec('0x2a')](_0x5341ba);}return _0x100d7c;}return this['channel'][_0x78ec('0x2a')](_0x361d3a,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x78ec('0x10')][_0x78ec('0x1bb')]=function(_0xd2d003){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x1bc'),_0xd2d003[_0x78ec('0x35')]));if(!this[_0x78ec('0x85')](_0xd2d003[_0x78ec('0x150')])){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0xd2d003,'no\x20find\x20by\x20configured');}logger[_0x78ec('0x2d')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0xd2d003[_0x78ec('0x150')]));var _0x996d1c=this[_0x78ec('0x51')][_0x78ec('0xa7')](this,_0xd2d003['findBy']);if(_0x996d1c){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x78ec('0xd')][_0x78ec('0x39')],_0xd2d003[_0x78ec('0x150')]));this[_0x78ec('0xd')][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x152'),this[_0x78ec('0xd')][_0x78ec('0x39')],_0xd2d003[_0x78ec('0x150')]));return{'code':0xc8,'result':'success'};}else{logger[_0x78ec('0x2d')](util['format'](_0x78ec('0x154'),this[_0x78ec('0xd')][_0x78ec('0x39')],_0xd2d003[_0x78ec('0x150')]));this['channel'][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0x154'),this['channel'][_0x78ec('0x39')],_0xd2d003[_0x78ec('0x150')]));return{'code':0xc8,'result':_0x78ec('0x155')};}};AGIVertices[_0x78ec('0x10')]['voicemail']=function(_0x1d29f0){logger['info'](util[_0x78ec('0x28')](_0x78ec('0x1bd'),_0x1d29f0['label']));var _0x18b693=this[_0x78ec('0xd')][_0x78ec('0x57')](_0x78ec('0x1be'),[_0x1d29f0[_0x78ec('0x1bf')],_0x1d29f0[_0x78ec('0x78')]]);if(_0x18b693[_0x78ec('0xae')]===-0x1){return _0x18b693;}return this['channel'][_0x78ec('0xab')](util[_0x78ec('0x28')](_0x78ec('0xc3'),_0x78ec('0x1be'),_0x1d29f0[_0x78ec('0x1bf')]));};AGIVertices[_0x78ec('0x10')][_0x78ec('0x1c0')]=function(_0x3cd8e7){logger[_0x78ec('0x2d')](util[_0x78ec('0x28')](_0x78ec('0x1c1'),_0x3cd8e7['label']));if(!this['isConfigured'](_0x3cd8e7['variable_id'])){return this[_0x78ec('0xd')][_0x78ec('0x2a')](_0x3cd8e7,_0x78ec('0x1a3'));}var _0x4084a2=this['getVariable'][_0x78ec('0xa7')](this,_0x3cd8e7['variable_id']);if(!_0x4084a2){return this['channel'][_0x78ec('0x2a')](_0x3cd8e7,_0x78ec('0x114'));}var _0x1b4d66=this['channel'][_0x78ec('0xa2')](_0x4084a2);return{'code':0xc8,'result':_0x1b4d66[_0x78ec('0xa3')]?_0x1b4d66[_0x78ec('0xa3')]:'-'};};String[_0x78ec('0x10')][_0x78ec('0xa1')]=function(_0x23d36c,_0x1dca13){return this[_0x78ec('0xa0')](_0x23d36c)['join'](_0x1dca13);};module[_0x78ec('0x1c2')]=AGIVertices;
\ No newline at end of file
+var _0x8369=['Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','RECOG_INSTANCE()','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','out','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','message','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','intKey','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','operation','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','wav','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','subject','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','answer','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/logger','../../config/environment','../../config/environment/shared','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','getVariableById','name','catch','prototype','getVoiceQueue','getVoiceQueueById','then','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','interval','map','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','format','%s/%s@from-sip/n','LOCAL','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','number','timeout','includes','toUpperCase','body','rawBody','parse','computedVariables','sync','uri','headers','stringify','render','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','googleASR','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','MRCPSynth','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','MRCPRecog','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','exec','application'];(function(_0x56ea49,_0x3d863e){var _0x27947e=function(_0x3c43b2){while(--_0x3c43b2){_0x56ea49['push'](_0x56ea49['shift']());}};_0x27947e(++_0x3d863e);}(_0x8369,0x10b));var _0x9836=function(_0x4856ec,_0x5af921){_0x4856ec=_0x4856ec-0x0;var _0x36212c=_0x8369[_0x4856ec];return _0x36212c;};'use strict';var fs=require('fs');var util=require(_0x9836('0x0'));var _=require(_0x9836('0x1'));var sh=require(_0x9836('0x2'));var odbc=require(_0x9836('0x3'))();var rs=require(_0x9836('0x4'));var moment=require(_0x9836('0x5'));var Mustache=require(_0x9836('0x6'));var rp=require('request-promise');var logger=require(_0x9836('0x7'))('agi');var config=require(_0x9836('0x8'));var shared=require(_0x9836('0x9'));var scripts=require('./scripts');var FILES_PATH=_0x9836('0xa');var recursiveMapAttributes=[_0x9836('0xb'),'rawBody'];var verticesWithRetry=[_0x9836('0xc'),_0x9836('0xd'),_0x9836('0xe')];var AGIVertices=function(_0x2482d8,_0x584531,_0x30bc66){this[_0x9836('0xf')]=_0x2482d8;this[_0x9836('0x10')]=_0x584531;this[_0x9836('0x11')]=_0x30bc66;};AGIVertices['prototype'][_0x9836('0x12')]=function(_0x242e79,_0xf1819d){this[_0x9836('0x10')][_0x9836('0x13')](_0x242e79)['then'](function(_0x267b5d){_0xf1819d(null,_0x267b5d?_0x267b5d[_0x9836('0x14')]:![]);})[_0x9836('0x15')](function(_0x173f75){_0xf1819d(_0x173f75);});};AGIVertices[_0x9836('0x16')][_0x9836('0x17')]=function(_0x2f38fb,_0x32e6c2){this['rpc'][_0x9836('0x18')](_0x2f38fb)[_0x9836('0x19')](function(_0xdf3628){_0x32e6c2(null,_0xdf3628?_0xdf3628['name']:![]);})[_0x9836('0x15')](function(_0x53bda0){_0x32e6c2(_0x53bda0);});};AGIVertices[_0x9836('0x16')]['getSquareProject']=function(_0x32282a,_0x22f9b5){this[_0x9836('0x10')][_0x9836('0x1a')](_0x32282a)[_0x9836('0x19')](function(_0x2afe17){_0x22f9b5(null,_0x2afe17?_0x2afe17['name']:![]);})[_0x9836('0x15')](function(_0x45bd78){_0x22f9b5(_0x45bd78);});};AGIVertices['prototype'][_0x9836('0x1b')]=function(_0x351347,_0x25b5fc){this['rpc'][_0x9836('0x1c')](_0x351347)['then'](function(_0x472ab4){_0x25b5fc(null,_0x472ab4?_0x472ab4[_0x9836('0x1d')]:![]);})[_0x9836('0x15')](function(_0x454a4d){_0x25b5fc(_0x454a4d);});};AGIVertices[_0x9836('0x16')]['getUser']=function(_0x552f3c,_0x4e51b9){this[_0x9836('0x10')][_0x9836('0x1e')](_0x552f3c)[_0x9836('0x19')](function(_0x5eb775){_0x4e51b9(null,_0x5eb775?_0x5eb775[_0x9836('0x14')]:![]);})[_0x9836('0x15')](function(_0x110044){_0x4e51b9(_0x110044);});};AGIVertices[_0x9836('0x16')]['getTrunk']=function(_0x242b10,_0x16e918){this[_0x9836('0x10')][_0x9836('0x1f')](_0x242b10)[_0x9836('0x19')](function(_0x59ece2){_0x16e918(null,_0x59ece2?_0x59ece2[_0x9836('0x14')]:![]);})[_0x9836('0x15')](function(_0x5bb349){_0x16e918(_0x5bb349);});};AGIVertices[_0x9836('0x16')]['getSound']=function(_0xedb9b7,_0x535e8c){var _0x4e3e4b=this;this['rpc'][_0x9836('0x20')](_0xedb9b7)[_0x9836('0x19')](function(_0x4440e9){_0x535e8c(null,_0x4440e9?_0x4e3e4b[_0x9836('0x21')](_0x4440e9[_0x9836('0x22')]):![]);})[_0x9836('0x15')](function(_0x29102a){_0x535e8c(_0x29102a);});};AGIVertices['prototype'][_0x9836('0x23')]=function(_0x4468ea,_0x358ad5){this[_0x9836('0x10')][_0x9836('0x24')](_0x4468ea)[_0x9836('0x19')](function(_0x46e8da){_0x358ad5(null,_0x46e8da?_0x46e8da:![]);})[_0x9836('0x15')](function(_0x3eaab4){_0x358ad5(_0x3eaab4);});};AGIVertices['prototype'][_0x9836('0x25')]=function(_0xc2d47a,_0x16f7cf,_0x462c05){this[_0x9836('0x11')][_0x9836('0x25')](_0xc2d47a,_0x16f7cf)[_0x9836('0x19')](function(){_0x462c05(null);})[_0x9836('0x15')](function(_0x5d3862){_0x462c05(_0x5d3862);});};AGIVertices['prototype'][_0x9836('0x26')]=function(_0x2d6705,_0x3440d){this['rpc']['getIntervalById'](_0x2d6705)['then'](function(_0x39335b){if(_0x39335b){if(_0x39335b['IntervalId']){_0x3440d(null,[_0x39335b[_0x9836('0x27')]]);}else{_0x3440d(null,_[_0x9836('0x28')](_0x39335b['Intervals'],'interval'));}}else{_0x3440d(null,![]);}})[_0x9836('0x15')](function(_0x3e19a1){_0x3440d(_0x3e19a1);});};AGIVertices[_0x9836('0x16')][_0x9836('0x21')]=function(_0x21031e){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x21031e);};AGIVertices[_0x9836('0x16')][_0x9836('0x29')]=function(_0x1fc14b,_0x40d95f,_0x41c03a){odbc[_0x9836('0x2a')](_0x1fc14b,function(_0x55e642){if(_0x55e642){logger[_0x9836('0x2b')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x55e642);_0x41c03a(_0x55e642);}else{logger[_0x9836('0x2c')](_0x9836('0x2d'));odbc[_0x9836('0x2e')](_0x40d95f,function(_0x365d14,_0x1ec857){if(_0x365d14){logger[_0x9836('0x2c')](_0x9836('0x2f'),_0x40d95f);_0x41c03a(_0x365d14);}else{logger['info'](_0x9836('0x30'),_0x40d95f);odbc[_0x9836('0x31')](function(_0xb6bb57){if(_0xb6bb57){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0xb6bb57);}_0x41c03a(null,_0x1ec857);});}});}});};AGIVertices['prototype'][_0x9836('0x32')]=function(_0x4d0525,_0x4841f9){this[_0x9836('0x10')][_0x9836('0x33')](_0x4d0525)[_0x9836('0x19')](function(_0x714c08){_0x4841f9(null,_0x714c08?_0x714c08:![]);})[_0x9836('0x15')](function(_0x3b8943){_0x4841f9(_0x3b8943);});};AGIVertices[_0x9836('0x16')]['createSmsMessage']=function(_0x2d4030,_0x437893){this[_0x9836('0x10')][_0x9836('0x34')](_0x2d4030)[_0x9836('0x19')](function(_0x593e36){_0x437893(null,_0x593e36);})[_0x9836('0x15')](function(_0x4eafd8){_0x437893(_0x4eafd8);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x829dff,_0x1d717e,_0x474c28){this[_0x9836('0x10')][_0x9836('0x35')]({'uniqueid':this[_0x9836('0xf')]['uniqueid'],'node':_0x829dff[_0x9836('0x36')],'application':_0x829dff[_0x9836('0x37')],'data':_0x1d717e||null,'project_name':this[_0x9836('0xf')][_0x9836('0x38')],'callerid':this[_0x9836('0xf')][_0x9836('0x39')]})[_0x9836('0x19')](function(_0x2060b7){if(_0x474c28){_0x474c28(null,_0x2060b7);}})[_0x9836('0x15')](function(_0x552336){if(_0x474c28){_0x474c28(_0x552336);}});};AGIVertices['prototype'][_0x9836('0x3a')]=function(_0x511820,_0x5c174c,_0x19d2f3,_0x8344e2){this[_0x9836('0x10')][_0x9836('0x3a')]({'uniqueid':this[_0x9836('0xf')][_0x9836('0x3b')],'callerid':this['channel'][_0x9836('0x39')],'calleridname':this['channel'][_0x9836('0x3c')],'context':this['channel']['context'],'extension':this[_0x9836('0xf')]['extension'],'priority':this[_0x9836('0xf')][_0x9836('0x3d')],'accountcode':this[_0x9836('0xf')][_0x9836('0x3e')],'dnid':this[_0x9836('0xf')][_0x9836('0x3f')],'projectName':this[_0x9836('0xf')][_0x9836('0x38')],'saveName':_0x5c174c,'filename':_0x511820[_0x9836('0x40')]||_0x5c174c,'savePath':_0x19d2f3})[_0x9836('0x19')](function(_0xf6022a){_0x8344e2(null,_0xf6022a);})[_0x9836('0x15')](function(_0x4a75ce){_0x8344e2(_0x4a75ce);});};AGIVertices[_0x9836('0x16')][_0x9836('0x41')]=function(_0x23d4ec,_0x33419e,_0x2d810b,_0x5858e2,_0x8ab44e){this['rpc'][_0x9836('0x41')]({'uniqueid':this[_0x9836('0xf')][_0x9836('0x3b')],'body':_0x23d4ec,'direction':_0x33419e,'providerName':_0x2d810b,'providerResponse':_0x5858e2})[_0x9836('0x19')](function(_0x4937b3){if(_0x8ab44e){_0x8ab44e(null,_0x4937b3);}})[_0x9836('0x15')](function(_0x2f6464){if(_0x8ab44e){_0x8ab44e(_0x2f6464);}});};AGIVertices[_0x9836('0x16')][_0x9836('0x42')]=function(_0x1e7568,_0x5c4cc6){this[_0x9836('0x10')]['createCmContact']({'firstName':_[_0x9836('0x43')](_0x1e7568[_0x9836('0x14')])||_[_0x9836('0x44')](_0x1e7568[_0x9836('0x14')])?'callback_'+Math['random']():_0x1e7568[_0x9836('0x14')],'lastName':_[_0x9836('0x43')](_0x1e7568[_0x9836('0x45')])||_['isNil'](_0x1e7568[_0x9836('0x45')])?null:_0x1e7568[_0x9836('0x45')],'phone':_0x1e7568[_0x9836('0x46')],'ListId':_0x1e7568[_0x9836('0x47')],'scheduledat':_0x1e7568[_0x9836('0x48')],'callbackUniqueid':this[_0x9836('0xf')]['uniqueid'],'tags':_0x9836('0x49'),'description':_0x9836('0x4a')+_0x1e7568[_0x9836('0x48')][_0x9836('0x4b')](),'priority':_0x1e7568[_0x9836('0x4c')]})[_0x9836('0x19')](function(_0x5390dc){_0x5c4cc6(null,_0x5390dc);})[_0x9836('0x15')](function(_0x10ae30){_0x5c4cc6(_0x10ae30);});};AGIVertices['prototype'][_0x9836('0x4d')]=function(_0x38a52d,_0x441494){this['rpc'][_0x9836('0x4e')](_0x38a52d)[_0x9836('0x19')](function(_0x1d4e2d){_0x441494(null,_0x1d4e2d?_0x1d4e2d['name']:![]);})[_0x9836('0x15')](function(_0x30d482){_0x441494(_0x30d482);});};AGIVertices[_0x9836('0x16')]['agentPause']=function(_0x1f511a,_0x279165,_0x346fac){var _0x5b4cc5={'role':'agent'};_0x5b4cc5[_0x1f511a]=this['channel'][_0x9836('0x39')];this['rpc'][_0x9836('0x4f')](_0x5b4cc5,_0x279165,this['channel'][_0x9836('0x3b')])[_0x9836('0x19')](function(_0x5f51ea){_0x346fac(null,_[_0x9836('0x44')](_0x5f51ea)?![]:!![]);})['catch'](function(_0x26f14){logger[_0x9836('0x2b')](_0x26f14);_0x346fac(null,![]);});};AGIVertices[_0x9836('0x16')][_0x9836('0x50')]=function(_0x4757cf,_0x2e715c){var _0x50fb01={'role':_0x9836('0x51')};_0x50fb01[_0x4757cf]=this[_0x9836('0xf')][_0x9836('0x39')];this[_0x9836('0x10')][_0x9836('0x50')](_0x50fb01)[_0x9836('0x19')](function(_0x50560f){_0x2e715c(null,_[_0x9836('0x44')](_0x50560f)?![]:!![]);})['catch'](function(_0x79e576){logger['error'](_0x79e576);_0x2e715c(null,![]);});};AGIVertices[_0x9836('0x16')][_0x9836('0x52')]=function(_0x5cb368,_0x410058){var _0x1c352d={'role':_0x9836('0x51')};_0x1c352d[_0x5cb368]=this[_0x9836('0xf')][_0x9836('0x39')];this[_0x9836('0x10')][_0x9836('0x52')](_0x1c352d)['then'](function(_0x29c35d){_0x410058(null,_[_0x9836('0x44')](_0x29c35d)?![]:!![]);})['catch'](function(_0x4493b0){logger[_0x9836('0x2b')](_0x4493b0);_0x410058(null,![]);});};AGIVertices[_0x9836('0x16')][_0x9836('0x53')]=function(_0x299bc2,_0x3c3453){var _0x42294c={'role':_0x9836('0x51')};_0x42294c[_0x299bc2]=this[_0x9836('0xf')][_0x9836('0x39')];var _0x413b09=_0x299bc2!='internal'?util[_0x9836('0x54')](_0x9836('0x55'),_0x9836('0x56'),this['channel'][_0x9836('0x39')]):undefined;this[_0x9836('0x10')]['agentLogin'](_0x42294c,_0x413b09)[_0x9836('0x19')](function(_0x3665b0){_0x3c3453(null,_[_0x9836('0x44')](_0x3665b0)?![]:!![]);})['catch'](function(_0x22c8af){logger['error'](_0x22c8af);_0x3c3453(null,![]);});};AGIVertices[_0x9836('0x16')][_0x9836('0x57')]=function(_0x2e89b2,_0x340b9e){sh['exec'](_[_0x9836('0x58')](_0x2e89b2),function(_0x5cdfbd,_0x3315a4){var _0x4c990a=_0x3315a4[_0x9836('0x59')](/(\r\n|\n|\r)/gm,'');_0x340b9e(null,_0x4c990a);});};AGIVertices[_0x9836('0x16')]['googleCloudTTS']=function(_0x3bb6b4,_0x46d59f){scripts[_0x9836('0x5a')](_0x3bb6b4[_0x9836('0x5b')],_0x3bb6b4[_0x9836('0x5c')]||_0x9836('0x5d'),_0x3bb6b4[_0x9836('0x5d')],_0x3bb6b4['languageCode']||_0x9836('0x5e'),_0x3bb6b4[_0x9836('0x5f')]||_0x9836('0x60'),_0x3bb6b4[_0x9836('0x61')]||_0x9836('0x62'))[_0x9836('0x19')](function(_0x54b906){_0x46d59f(null,_0x54b906);})[_0x9836('0x15')](function(_0x260762){_0x46d59f(_0x260762);});};AGIVertices[_0x9836('0x16')][_0x9836('0x63')]=function(_0x2bc521,_0x543978){scripts[_0x9836('0x63')](_0x2bc521[_0x9836('0x5d')],_0x2bc521[_0x9836('0x64')]||'en',0x1)[_0x9836('0x19')](function(_0x405650){_0x543978(null,_0x405650);})[_0x9836('0x15')](function(_0x1ac587){_0x543978(_0x1ac587);});};AGIVertices[_0x9836('0x16')][_0x9836('0x65')]=function(_0x1b615d,_0x4e307b){var _0x4908f1={'uri':_0x1b615d[_0x9836('0x66')],'method':_0x1b615d[_0x9836('0x67')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1b615d['timeout'])===_0x9836('0x68')&&parseInt(_0x1b615d['timeout'])>=0x1?parseInt(_0x1b615d[_0x9836('0x69')])*0x3e8:0x5*0x3e8};if(_[_0x9836('0x6a')](['POST','PUT'],_0x4908f1[_0x9836('0x67')][_0x9836('0x6b')]())){try{_0x4908f1[_0x9836('0x6c')]=_0x1b615d[_0x9836('0x6d')]?JSON[_0x9836('0x6e')](_0x1b615d['rawBody']):{};}catch(_0x23b28a){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x23b28a);}}try{_0x4908f1['headers']=_0x1b615d[_0x9836('0xb')]?JSON['parse'](_0x1b615d[_0x9836('0xb')]):{};}catch(_0x293abb){logger[_0x9836('0x2b')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x293abb);}if(_0x1b615d[_0x9836('0x6f')]){try{var _0x5b3460=require(_0x1b615d[_0x9836('0x6f')])[_0x9836('0x70')](this,_0x4908f1);_0x4908f1[_0x9836('0x71')]=Mustache['render'](_0x1b615d[_0x9836('0x66')],_0x5b3460,{},['$$','$$']);if(_0x4908f1[_0x9836('0x72')]){_0x4908f1['headers']=JSON[_0x9836('0x6e')](Mustache['render'](JSON[_0x9836('0x73')](_0x4908f1[_0x9836('0x72')]),_0x5b3460,{},['$$','$$']));}if(_0x4908f1[_0x9836('0x6c')]){_0x4908f1['body']=JSON[_0x9836('0x6e')](Mustache[_0x9836('0x74')](JSON[_0x9836('0x73')](_0x4908f1[_0x9836('0x6c')]),_0x5b3460,{},['$$','$$']));}}catch(_0x46ead4){logger[_0x9836('0x2b')](_0x9836('0x75'),_0x46ead4);}}rp(_0x4908f1)[_0x9836('0x19')](function(_0x3dcc40){var _0xd7eff1={'statusCode':_0x3dcc40[_0x9836('0x76')]||0xc8,'statusMessage':_0x3dcc40['statusMessage']||'OK','headers':_0x3dcc40['headers']||{},'body':_0x3dcc40[_0x9836('0x6c')]||{}};_0x4e307b(null,_0xd7eff1);})[_0x9836('0x15')](function(_0x49d763){var _0x1b6e64={'statusCode':_0x49d763['statusCode']||0x1f4,'statusMessage':_0x49d763['message']||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x49d763[_0x9836('0x77')][_0x9836('0x72')]||{},'body':_0x49d763[_0x9836('0x77')][_0x9836('0x6c')]||{}};_0x4e307b(null,_0x1b6e64);});};AGIVertices[_0x9836('0x16')][_0x9836('0x78')]=function(_0x177ca8,_0x2cfbb0){scripts[_0x9836('0x78')](this[_0x9836('0xf')][_0x9836('0x3b')],_0x177ca8[_0x9836('0x79')],_0x177ca8['text'],_0x177ca8[_0x9836('0x7a')]||'en')[_0x9836('0x19')](function(_0x5e3711){_0x2cfbb0(null,_0x5e3711);})[_0x9836('0x15')](function(_0x3dc314){_0x2cfbb0(_0x3dc314);});};AGIVertices[_0x9836('0x16')][_0x9836('0x7b')]=function(_0x5d9f61,_0x1e4595){scripts[_0x9836('0x7b')](this[_0x9836('0xf')][_0x9836('0x3b')],_0x5d9f61['dialogflowV2_project_id'],_0x5d9f61['client_email'],_0x5d9f61[_0x9836('0x7c')],_0x5d9f61[_0x9836('0x5d')],_0x5d9f61['dialogflowV2_language']||'en')['then'](function(_0x1f9307){_0x1e4595(null,_0x1f9307);})[_0x9836('0x15')](function(_0x460b6c){_0x1e4595(_0x460b6c);});};AGIVertices[_0x9836('0x16')][_0x9836('0x7d')]=function(_0x5e8889,_0x34d619){scripts[_0x9836('0x7d')](this['channel'],_0x5e8889)['then'](function(_0xbb3efc){_0x34d619(null,_0xbb3efc);})[_0x9836('0x15')](function(_0x249cb1){_0x34d619(_0x249cb1);});};AGIVertices[_0x9836('0x16')][_0x9836('0x7e')]=function(_0x5ad757,_0x3433b0){scripts[_0x9836('0x7e')](_0x5ad757[_0x9836('0x79')],_0x5ad757[_0x9836('0x5d')],_0x5ad757[_0x9836('0x7f')]||_0x9836('0x5e'),_0x5ad757['speed'])['then'](function(_0x1b9f1d){_0x3433b0(null,_0x1b9f1d);})[_0x9836('0x15')](function(_0x3d4b4e){_0x3433b0(_0x3d4b4e);});};AGIVertices['prototype'][_0x9836('0x80')]=function(_0x567202,_0x5433c2,_0x580884){scripts[_0x9836('0x80')](_0x5433c2,_0x567202[_0x9836('0x79')],_0x567202['ispeech_asr_language']||_0x9836('0x5e'),this['isConfigured'](_0x567202['model'])?_0x567202[_0x9836('0x81')]:undefined)['then'](function(_0x40f59c){_0x580884(null,_0x40f59c);})[_0x9836('0x15')](function(_0x4bd837){_0x580884(_0x4bd837);});};AGIVertices['prototype'][_0x9836('0x82')]=function(_0x13045d,_0x23e3ea){scripts['awsPolly'](_0x13045d[_0x9836('0x83')],_0x13045d[_0x9836('0x84')],_0x13045d[_0x9836('0x85')],_0x13045d[_0x9836('0x86')]||'Amy',_0x13045d[_0x9836('0x5d')],_0x13045d[_0x9836('0x87')]||_0x9836('0x5d'))[_0x9836('0x19')](function(_0x3eb146){_0x23e3ea(null,_0x3eb146);})[_0x9836('0x15')](function(_0x4a7abf){_0x23e3ea(_0x4a7abf);});};AGIVertices[_0x9836('0x16')]['awsLex']=function(_0x32b2eb,_0x1472af){scripts[_0x9836('0x88')](this[_0x9836('0xf')]['uniqueid'],_0x32b2eb[_0x9836('0x83')],_0x32b2eb[_0x9836('0x84')],_0x32b2eb[_0x9836('0x89')],_0x32b2eb[_0x9836('0x5d')],_0x32b2eb['aws_bot_name'])[_0x9836('0x19')](function(_0x511fdf){_0x1472af(null,_0x511fdf);})[_0x9836('0x15')](function(_0x250ec3){_0x1472af(_0x250ec3);});};AGIVertices[_0x9836('0x16')][_0x9836('0x8a')]=function(_0x33e35b,_0x280b8d,_0x1d1dc9){scripts[_0x9836('0x8a')](_0x280b8d,_0x33e35b[_0x9836('0x79')],_0x33e35b['google_asr_language']||'en-US')[_0x9836('0x19')](function(_0x1d3881){_0x1d1dc9(null,_0x1d3881);})['catch'](function(_0x1948d2){_0x1d1dc9(_0x1948d2);});};AGIVertices['prototype'][_0x9836('0x8b')]=function(_0x598900,_0x18704d,_0x5a214a){scripts[_0x9836('0x8b')](_0x18704d,_0x598900[_0x9836('0x8c')],_0x598900[_0x9836('0x8d')],_0x598900[_0x9836('0x71')])[_0x9836('0x19')](function(_0x11d1f3){_0x5a214a(null,_0x11d1f3);})['catch'](function(_0x52795a){_0x5a214a(_0x52795a);});};AGIVertices[_0x9836('0x16')][_0x9836('0x8e')]=function(_0x50c71a){var _0x322f42=_[_0x9836('0x6a')](verticesWithRetry,_0x50c71a[_0x9836('0x37')])?_0x50c71a:_[_0x9836('0x8f')](_0x50c71a);for(var _0x134628 in _0x322f42){if(_0x322f42[_0x9836('0x90')](_0x134628)){if(_0x322f42[_0x134628]&&_[_0x9836('0x91')](_0x322f42[_0x134628])){if(_[_0x9836('0x6a')](recursiveMapAttributes,_0x134628)){_0x322f42[_0x134628]=this[_0x9836('0x92')](_0x322f42[_0x134628]);}else{_0x322f42[_0x134628]=this[_0x9836('0x93')](_0x322f42[_0x134628]);}}}}return _0x322f42;};AGIVertices[_0x9836('0x16')][_0x9836('0x94')]=function(_0x2877f0){for(var _0x50acb8 in _0x2877f0){if(_0x2877f0[_0x9836('0x90')](_0x50acb8)){if(_[_0x9836('0x95')](_0x2877f0[_0x50acb8])){this[_0x9836('0x94')](_0x2877f0[_0x50acb8]);}else if(_[_0x9836('0x96')](_0x2877f0[_0x50acb8])){for(var _0x1fd680=0x0;_0x1fd680<_0x2877f0[_0x50acb8][_0x9836('0x97')];_0x1fd680++){this[_0x9836('0x94')](_0x2877f0[_0x50acb8][_0x1fd680]);}}else if(_[_0x9836('0x91')](_0x2877f0[_0x50acb8])){_0x2877f0[_0x50acb8]=this['replaceAllVariables'](_0x2877f0[_0x50acb8]);}}}};AGIVertices[_0x9836('0x16')][_0x9836('0x98')]=function(_0x217a60,_0x5134ad){for(var _0x530229 in _0x217a60){if(_0x217a60[_0x9836('0x90')](_0x530229)){if(_[_0x9836('0x95')](_0x217a60[_0x530229])){if(!_[_0x9836('0x43')](_0x217a60[_0x530229])){this['saveRestApiResult'](_0x217a60[_0x530229],util[_0x9836('0x54')](_0x9836('0x99'),_0x5134ad,_0x530229));}}else if(_[_0x9836('0x96')](_0x217a60[_0x530229])){for(var _0x243afb=0x0;_0x243afb<_0x217a60[_0x530229][_0x9836('0x97')];_0x243afb++){this[_0x9836('0x98')](_0x217a60[_0x530229][_0x243afb],util[_0x9836('0x54')]('%s.%s',_0x5134ad,_0x530229+'['+_0x243afb+']'));}}else{if(!_[_0x9836('0x44')](_0x217a60[_0x530229])){this[_0x9836('0xf')][_0x9836('0x9a')](util['format']('%s.%s',_0x5134ad,_0x530229),_0x217a60[_0x530229]);}}}}};AGIVertices[_0x9836('0x16')][_0x9836('0x92')]=function(_0x5ac543){try{var _0x4a887d=JSON[_0x9836('0x6e')](_0x5ac543);this[_0x9836('0x94')](_0x4a887d);return JSON[_0x9836('0x73')](_0x4a887d);}catch(_0x906ec4){return this[_0x9836('0x93')](_0x5ac543);}};AGIVertices['prototype'][_0x9836('0x93')]=function(_0x25de1d){var _0x525d16=_0x25de1d['split']('{');for(var _0x4ab9ce=0x1;_0x4ab9ce<_0x525d16[_0x9836('0x97')];_0x4ab9ce+=0x1){var _0x2e14b0=_0x525d16[_0x4ab9ce][_0x9836('0x9b')]('}');if(_0x2e14b0[_0x9836('0x97')]>0x1){_0x25de1d=_0x25de1d['replaceAll']('{'+_0x2e14b0[0x0]+'}',this[_0x9836('0xf')][_0x9836('0x12')](_0x2e14b0[0x0])[_0x9836('0x9c')]||_0x2e14b0[0x0]);}}if(_0x525d16[_0x9836('0x97')]===0x1){return _0x25de1d[_0x9836('0x4b')]();}return this['replaceAllVariables'](_0x25de1d);};AGIVertices['prototype'][_0x9836('0x9d')]=function(_0x239d52,_0x2a2b9d){var _0x5b55a3=this['channel']['getVariable'](_0x239d52);if(_0x5b55a3[_0x9836('0x9e')]===-0x1){return _0x5b55a3;}logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x9f'),_0x2a2b9d,_0x5b55a3[_0x9836('0x9c')]));return this['channel'][_0x9836('0x9a')](_0x2a2b9d,_0x5b55a3[_0x9836('0x9c')]);};AGIVertices[_0x9836('0x16')][_0x9836('0xa0')]=function(_0x11c052){return _0x11c052&&_0x11c052!=='0'&&_0x11c052!=='-1'&&_0x11c052!=='';};AGIVertices[_0x9836('0x16')][_0x9836('0xa1')]=function(_0x30cc1d){this[_0x9836('0x35')][_0x9836('0x70')](this,_0x30cc1d,'-');_0x30cc1d[_0x9836('0xa2')]=_0x30cc1d[_0x9836('0xa1')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x9836('0x16')][_0x9836('0xa3')]=function(_0x392b2f){logger['info'](util[_0x9836('0x54')](_0x9836('0xa4'),_0x392b2f['label']));if(!this[_0x9836('0xa0')](_0x392b2f[_0x9836('0x5d')])){return this[_0x9836('0xf')][_0x9836('0xa5')]('no\x20text\x20configured');}var _0x1fd545='\x22'+_0x392b2f['text']+'\x22';if(this[_0x9836('0xa0')](_0x392b2f['options'])){_0x1fd545+=','+_0x392b2f['options'];}var _0x283255=this['channel']['exec'](_0x9836('0xa6'),_0x1fd545);if(_0x283255[_0x9836('0x9e')]===-0x1){return _0x283255;}return this['channel'][_0x9836('0xa5')](util[_0x9836('0x54')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1fd545));};AGIVertices[_0x9836('0x16')]['mrcprecog']=function(_0x23a7e7){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0xa7'),_0x23a7e7['label']));if(!this[_0x9836('0xa0')](_0x23a7e7['grammar'])){return this[_0x9836('0xf')][_0x9836('0xa5')]('no\x20grammar\x20configured');}var _0x113759=_0x23a7e7['grammar'];if(this[_0x9836('0xa0')](_0x23a7e7[_0x9836('0x77')])){_0x113759+=','+_0x23a7e7[_0x9836('0x77')];}var _0x5bb63=this[_0x9836('0xf')]['exec'](_0x9836('0xa8'),_0x113759);if(_0x5bb63[_0x9836('0x9e')]===-0x1){return _0x5bb63;}var _0x473b1e=this[_0x9836('0x9d')]('RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE');if(_0x473b1e['result']===-0x1){return _0x473b1e;}var _0x18f52b=this['getAndSetVariable']('RECOG_INPUT()',_0x9836('0xa9'));if(_0x18f52b[_0x9836('0x9e')]===-0x1){return _0x18f52b;}var _0x92906d=this[_0x9836('0x9d')]('RECOG_INSTANCE()',_0x9836('0xaa'));if(_0x92906d[_0x9836('0x9e')]===-0x1){return _0x92906d;}return this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0xab'),_0x113759));};AGIVertices['prototype'][_0x9836('0xac')]=function(_0x33ca48){logger[_0x9836('0x2c')](util['format'](_0x9836('0xad'),_0x33ca48[_0x9836('0x36')]));return this[_0x9836('0xf')][_0x9836('0xac')]([_0x33ca48['command'],_0x33ca48['args']]);};AGIVertices[_0x9836('0x16')]['answer']=function(_0x41f8bc){logger[_0x9836('0x2c')](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x41f8bc['label']));if(this[_0x9836('0xa0')](_0x41f8bc['timeout'])){logger[_0x9836('0x2c')](util['format'](_0x9836('0xae'),_0x41f8bc[_0x9836('0x69')]));var _0x34dcf0=this[_0x9836('0xf')][_0x9836('0xaf')](_0x41f8bc[_0x9836('0x69')]);if(_0x34dcf0['result']===-0x1){return _0x34dcf0;}}return this[_0x9836('0xf')]['answer']();};AGIVertices[_0x9836('0x16')]['callback']=function(_0x251590){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0xb0'),_0x251590[_0x9836('0x36')]));if(!this[_0x9836('0xa0')](_0x251590[_0x9836('0x47')])){return this[_0x9836('0xf')]['error'](_0x251590,_0x9836('0xb1'));}_0x251590[_0x9836('0x48')]=moment();if(this[_0x9836('0xa0')](_0x251590['delay'])){_0x251590[_0x9836('0x48')]=moment()[_0x9836('0xb2')](_0x251590[_0x9836('0xb3')],_0x9836('0xb4'));}if(!this[_0x9836('0xa0')](_0x251590[_0x9836('0x4c')])){_0x251590[_0x9836('0x4c')]=0x2;}this[_0x9836('0x42')]['sync'](this,_0x251590);return this[_0x9836('0xf')][_0x9836('0xa5')](util['format'](_0x9836('0xb5'),_0x251590['phone'],_0x251590[_0x9836('0x47')],_0x251590[_0x9836('0x48')]));};AGIVertices['prototype'][_0x9836('0xb6')]=function(_0xdd3fb3){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0xb7'),_0xdd3fb3[_0x9836('0x36')]));var _0x378c1c=this[_0x9836('0xf')][_0x9836('0xb8')](_0xdd3fb3[_0x9836('0xb9')],_0xdd3fb3[_0x9836('0x77')]);if(_0x378c1c[_0x9836('0x9e')]===-0x1){return _0x378c1c;}return this[_0x9836('0xf')]['noop'](util[_0x9836('0x54')](_0x9836('0xba'),_0xdd3fb3[_0x9836('0xb9')],_0xdd3fb3[_0x9836('0x77')]));};AGIVertices[_0x9836('0x16')]['lumenvoxtts']=function(_0x24497e){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0xbb'),_0x24497e[_0x9836('0x36')]));if(!this[_0x9836('0xa0')](_0x24497e[_0x9836('0x5d')])){return this['channel'][_0x9836('0xa5')](_0x9836('0xbc'));}var _0x66cec1='\x22'+_0x24497e[_0x9836('0x5d')]+'\x22';if(this[_0x9836('0xa0')](_0x24497e[_0x9836('0x77')])){_0x66cec1+=','+_0x24497e['options'];}var _0x244215=this[_0x9836('0xf')][_0x9836('0xb8')]('MRCPSynth',_0x66cec1);if(_0x244215[_0x9836('0x9e')]===-0x1){return _0x244215;}return this[_0x9836('0xf')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x66cec1));};AGIVertices[_0x9836('0x16')][_0x9836('0xbd')]=function(_0x323e57){logger[_0x9836('0x2c')](util[_0x9836('0x54')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x323e57['label']));if(!this['isConfigured'](_0x323e57['text'])){return this[_0x9836('0xf')][_0x9836('0xa5')]('no\x20text\x20configured');}var _0x1e6ad1='\x22'+_0x323e57['text']+'\x22';if(this[_0x9836('0xa0')](_0x323e57[_0x9836('0x77')])){_0x1e6ad1+=','+_0x323e57[_0x9836('0x77')];}var _0x5e136e=this[_0x9836('0xf')][_0x9836('0xb8')]('MRCPSynth',_0x1e6ad1);if(_0x5e136e[_0x9836('0x9e')]===-0x1){return _0x5e136e;}return this[_0x9836('0xf')]['noop'](util['format'](_0x9836('0xbe'),_0x1e6ad1));};AGIVertices[_0x9836('0x16')][_0x9836('0xbf')]=function(_0x4662f8){logger[_0x9836('0x2c')](util['format'](_0x9836('0xc0'),_0x4662f8[_0x9836('0x36')]));if(!this[_0x9836('0xa0')](_0x4662f8[_0x9836('0xc1')])){return this[_0x9836('0xf')][_0x9836('0xa5')](_0x9836('0xc2'));}var _0x44531f=_0x4662f8[_0x9836('0xc1')];if(this['isConfigured'](_0x4662f8[_0x9836('0x77')])){_0x44531f+=','+_0x4662f8[_0x9836('0x77')];}var _0x4f45bf=this['channel'][_0x9836('0xb8')](_0x9836('0xa8'),_0x44531f);if(_0x4f45bf[_0x9836('0x9e')]===-0x1){return _0x4f45bf;}var _0x5c5092=this[_0x9836('0x9d')](_0x9836('0xc3'),_0x9836('0xc4'));if(_0x5c5092[_0x9836('0x9e')]===-0x1){return _0x5c5092;}var _0xfac15e=this[_0x9836('0x9d')](_0x9836('0xc5'),_0x9836('0xc6'));if(_0xfac15e[_0x9836('0x9e')]===-0x1){return _0xfac15e;}var _0x46a9d6=this[_0x9836('0x9d')]('RECOG_INSTANCE()',_0x9836('0xc7'));if(_0x46a9d6[_0x9836('0x9e')]===-0x1){return _0x46a9d6;}return this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0xab'),_0x44531f));};AGIVertices[_0x9836('0x16')]['sestekasr']=function(_0x5061dc){logger['info'](util['format'](_0x9836('0xc8'),_0x5061dc[_0x9836('0x36')]));if(!this[_0x9836('0xa0')](_0x5061dc[_0x9836('0xc1')])){return this['channel'][_0x9836('0xa5')](_0x9836('0xc2'));}var _0x2284cf=_0x5061dc['grammar'];if(this[_0x9836('0xa0')](_0x5061dc['options'])){_0x2284cf+=','+_0x5061dc[_0x9836('0x77')];}var _0x2f38db=this['channel'][_0x9836('0xb8')](_0x9836('0xa8'),_0x2284cf);if(_0x2f38db['result']===-0x1){return _0x2f38db;}var _0x226cb3=this[_0x9836('0x9d')](_0x9836('0xc3'),_0x9836('0xc9'));if(_0x226cb3[_0x9836('0x9e')]===-0x1){return _0x226cb3;}var _0x3568eb=this[_0x9836('0x9d')](_0x9836('0xc5'),_0x9836('0xca'));if(_0x3568eb[_0x9836('0x9e')]===-0x1){return _0x3568eb;}var _0x1d5e78=this[_0x9836('0x9d')](_0x9836('0xcb'),'SESTEK_ASR_INSTANCE');if(_0x1d5e78[_0x9836('0x9e')]===-0x1){return _0x1d5e78;}return this['channel'][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0xab'),_0x2284cf));};AGIVertices[_0x9836('0x16')]['database']=function(_0x49ccd5){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0xcc'),_0x49ccd5[_0x9836('0x36')]));if(!this[_0x9836('0xa0')](_0x49ccd5['odbc_id'])){return this['channel'][_0x9836('0x2b')](_0x49ccd5,_0x9836('0xcd'));}var _0x5a0a89=this['getSquareOdbc']['sync'](this,_0x49ccd5[_0x9836('0xce')]);if(!_0x5a0a89){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x49ccd5,_0x9836('0xcf'));}if(!this[_0x9836('0xa0')](_0x49ccd5['query'])){return this[_0x9836('0xf')]['error'](_0x49ccd5,_0x9836('0xd0'));}var _0xf26b2c=_0x49ccd5[_0x9836('0x2e')][_0x9836('0x59')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util['format'](_0x9836('0xd1'),_0xf26b2c));var _0x58b034=this['getQueryOdbc'][_0x9836('0x70')](this,_0x5a0a89,_0xf26b2c);this[_0x9836('0x35')][_0x9836('0x70')](this,_0x49ccd5,_0xf26b2c);if(!this[_0x9836('0xa0')](_0x49ccd5[_0x9836('0xd2')])){return this['channel']['noop'](_0x9836('0xd3'));}var _0x5f248f=this['getVariable'][_0x9836('0x70')](this,_0x49ccd5[_0x9836('0xd2')]);if(!_0x5f248f){return this[_0x9836('0xf')]['error'](_0x49ccd5,_0x9836('0xd4'));}var _0x176d13=this;_0x58b034[_0x9836('0xd5')](function(_0x378917,_0x42aaa3){Object[_0x9836('0xd6')](_0x378917)[_0x9836('0xd5')](function(_0x4b55bd){_0x176d13['channel'][_0x9836('0x9a')](util[_0x9836('0x54')](_0x9836('0xd7'),_0x5f248f,_0x42aaa3,_0x4b55bd),_0x378917[_0x4b55bd]);});});this['channel'][_0x9836('0x9a')](util['format']('%s_ROWS_COUNT',_0x5f248f),_0x58b034[_0x9836('0x97')]);return this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0xd8'),_0x5f248f));};AGIVertices[_0x9836('0x16')][_0x9836('0xd9')]=function(_0x1e2b8c){logger['debug'](util[_0x9836('0x54')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x1e2b8c['label']));if(!this['isConfigured'](_0x1e2b8c[_0x9836('0xda')])){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x1e2b8c,_0x9836('0xdb'));}var _0x339a73=this[_0x9836('0xdc')][_0x9836('0x70')](this,_0x1e2b8c[_0x9836('0xda')]);if(!_0x339a73){return this['channel'][_0x9836('0x2b')](_0x1e2b8c,_0x9836('0xdd'));}var _0x2318e5=this[_0x9836('0xf')][_0x9836('0xb8')](_0x9836('0xde'),[util[_0x9836('0x54')](_0x9836('0xdf'),_0x339a73),_0x1e2b8c['timeout'],_0x1e2b8c[_0x9836('0xe0')],_0x1e2b8c[_0x9836('0x66')]]);if(_0x2318e5[_0x9836('0x9e')]===-0x1){return _0x2318e5;}return this[_0x9836('0xf')]['noop'](util[_0x9836('0x54')](_0x9836('0xe1'),_0x9836('0xde')));};AGIVertices[_0x9836('0x16')][_0x9836('0xe2')]=function(_0x17a9cd){logger[_0x9836('0x2c')](util[_0x9836('0x54')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x17a9cd[_0x9836('0x36')]));if(!this[_0x9836('0xa0')](_0x17a9cd[_0x9836('0x79')])){return this[_0x9836('0xf')][_0x9836('0xa5')](_0x9836('0xe3'));}if(!this[_0x9836('0xa0')](_0x17a9cd[_0x9836('0x5d')])){return this[_0x9836('0xf')][_0x9836('0xa5')](_0x9836('0xbc'));}this[_0x9836('0xf')][_0x9836('0xe4')]=!![];this['createSquareDetailsReport'](_0x17a9cd);this[_0x9836('0x41')](_0x17a9cd[_0x9836('0x5d')],'in','','');this[_0x9836('0xf')][_0x9836('0xa5')](util['format'](_0x9836('0xe5'),_0x17a9cd[_0x9836('0x5d')]));var _0x103065=this[_0x9836('0x78')][_0x9836('0x70')](this,_0x17a9cd);if(_0x103065){for(var _0x5b6389 in _0x103065){if(_0x103065[_0x9836('0x90')](_0x5b6389)){this[_0x9836('0xf')][_0x9836('0x9a')](util[_0x9836('0x54')]('DIALOGFLOW_%s',_0x5b6389[_0x9836('0x6b')]()),_0x103065[_0x5b6389]);}}this[_0x9836('0x41')](_0x103065[_0x9836('0xe6')],'out','dialogflow','');return this['channel'][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0xe7'),_0x103065[_0x9836('0xe6')]));}return this[_0x9836('0xf')][_0x9836('0x2b')](_0x17a9cd,_0x9836('0xe8'));};AGIVertices[_0x9836('0x16')][_0x9836('0xe9')]=function(_0x22b5ca){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0xea'),_0x22b5ca[_0x9836('0x36')]));if(!this['isConfigured'](_0x22b5ca[_0x9836('0xeb')])){return this[_0x9836('0xf')][_0x9836('0xa5')](_0x9836('0xec'));}if(!this[_0x9836('0xa0')](_0x22b5ca[_0x9836('0xed')])){return this[_0x9836('0xf')]['noop'](_0x9836('0xee'));}if(!this[_0x9836('0xa0')](_0x22b5ca[_0x9836('0x7c')])){return this[_0x9836('0xf')][_0x9836('0xa5')](_0x9836('0xef'));}if(!this[_0x9836('0xa0')](_0x22b5ca['dialogflowV2_language'])){return this[_0x9836('0xf')][_0x9836('0xa5')](_0x9836('0xf0'));}if(!this[_0x9836('0xa0')](_0x22b5ca['text'])){return this[_0x9836('0xf')][_0x9836('0xa5')](_0x9836('0xbc'));}this[_0x9836('0xf')][_0x9836('0xe4')]=!![];this[_0x9836('0x35')](_0x22b5ca);this[_0x9836('0x41')](_0x22b5ca[_0x9836('0x5d')],'in','','');this[_0x9836('0xf')][_0x9836('0xa5')](util['format'](_0x9836('0xf1'),_0x22b5ca[_0x9836('0x5d')]));var _0x2c0994=this[_0x9836('0x7b')][_0x9836('0x70')](this,_0x22b5ca);if(_0x2c0994){for(var _0x5ce7f7 in _0x2c0994){if(_0x2c0994[_0x9836('0x90')](_0x5ce7f7)){if(_0x5ce7f7!==_0x9836('0xf2')){this[_0x9836('0xf')][_0x9836('0x9a')](util[_0x9836('0x54')](_0x9836('0xf3'),_0x5ce7f7[_0x9836('0x6b')]()),_0x2c0994[_0x5ce7f7]);}}}this[_0x9836('0x41')](_0x2c0994[_0x9836('0xe6')],_0x9836('0xf4'),_0x9836('0xe9'),_0x2c0994[_0x9836('0xf2')]);return this[_0x9836('0xf')]['noop'](util[_0x9836('0x54')](_0x9836('0xf5'),_0x2c0994[_0x9836('0xe6')]));}return this[_0x9836('0xf')]['error'](_0x22b5ca,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x9836('0x16')][_0x9836('0xf6')]=function(_0xed73a5){logger['info'](util[_0x9836('0x54')](_0x9836('0xf7'),_0xed73a5[_0x9836('0x36')]));if(!this[_0x9836('0xa0')](_0xed73a5[_0x9836('0xf8')])){return this[_0x9836('0xf')]['noop']('no\x20ndauth\x20url\x20configured');}if(!this[_0x9836('0xa0')](_0xed73a5[_0x9836('0xf9')])){return this[_0x9836('0xf')]['noop']('no\x20username\x20configured');}if(!this['isConfigured'](_0xed73a5[_0x9836('0xfa')])){return this[_0x9836('0xf')]['noop'](_0x9836('0xfb'));}if(!this['isConfigured'](_0xed73a5['ndassistant_url'])){return this['channel'][_0x9836('0xa5')](_0x9836('0xbc'));}this['channel'][_0x9836('0xe4')]=!![];this[_0x9836('0x35')](_0xed73a5);this[_0x9836('0x41')](_0xed73a5['text'],'in','','');this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0xfc'),_0xed73a5[_0x9836('0x5d')]));var _0x1fea15=this[_0x9836('0x7d')][_0x9836('0x70')](this,_0xed73a5);if(_0x1fea15){for(var _0x77339e in _0x1fea15){if(_0x1fea15[_0x9836('0x90')](_0x77339e)){this['channel'][_0x9836('0x9a')](util[_0x9836('0x54')](_0x9836('0xfd'),_0x77339e[_0x9836('0x6b')]()),_0x1fea15[_0x77339e]);}}this[_0x9836('0x41')](_0x1fea15['speech'],_0x9836('0xf4'),_0x9836('0xf6'),'');if(_0x1fea15[_0x9836('0xfe')]){this[_0x9836('0xf')][_0x9836('0xa5')](util['format'](_0x9836('0xff'),_0x1fea15['audiofile']));var _0x33d7de=this[_0x9836('0xf')][_0x9836('0x100')](_0x1fea15[_0x9836('0xfe')]);try{fs[_0x9836('0x101')](_0x1fea15[_0x9836('0xfe')]+_0x9836('0x102'));}catch(_0x2b8886){logger[_0x9836('0x2b')](_0x2b8886);}return _0x33d7de;}else{return this[_0x9836('0xf')]['noop'](util[_0x9836('0x54')]('SestekNDA\x20Result\x20%s',_0x1fea15[_0x9836('0xe6')]));}}return this['channel']['error'](_0xed73a5,_0x9836('0x103'));};AGIVertices[_0x9836('0x16')][_0x9836('0x104')]=function(_0x5a62c8){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x105'),_0x5a62c8[_0x9836('0x36')]));return this[_0x9836('0xf')][_0x9836('0xa5')]('end');};AGIVertices[_0x9836('0x16')][_0x9836('0x106')]=function(_0x5151c3){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x107'),_0x5151c3[_0x9836('0x36')]));var _0x2e8872='';if(_0x5151c3[_0x9836('0x108')]){if(!this[_0x9836('0xa0')](_0x5151c3['trunk_id'])){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x5151c3,_0x9836('0x109'));}else{var _0x403210=parseInt(_0x5151c3[_0x9836('0x108')],0xa);if(isNaN(_0x403210)){_0x2e8872=_0x5151c3['trunk_id'];}else{_0x2e8872=this['getTrunk'][_0x9836('0x70')](this,_0x5151c3['trunk_id']);if(!_0x2e8872){return this['channel'][_0x9836('0x2b')](_0x5151c3,_0x9836('0x10a'));}}}}else if(_0x5151c3['trunk_name']){_0x2e8872=_0x5151c3[_0x9836('0x10b')];}else{return this[_0x9836('0xf')]['error'](_0x5151c3,_0x9836('0x109'));}var _0x51f2f4=this[_0x9836('0xf')][_0x9836('0xb8')]('DIAL',[util['format'](_0x9836('0x10c'),_0x2e8872,_0x5151c3[_0x9836('0x46')]),_0x5151c3[_0x9836('0x69')],_0x5151c3['opts'],_0x5151c3[_0x9836('0x66')]]);if(_0x51f2f4['result']===-0x1){return _0x51f2f4;}return this['channel'][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0xe1'),'DIAL'));};AGIVertices[_0x9836('0x16')]['finally']=function(_0x1a37b5){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x10d'),_0x1a37b5[_0x9836('0x36')]));return this[_0x9836('0xf')][_0x9836('0xa5')]('finally');};AGIVertices[_0x9836('0x16')][_0x9836('0xd')]=function(_0xcf7cc8){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x10e'),_0xcf7cc8[_0x9836('0x36')]));if(_0xcf7cc8[_0x9836('0xa2')]===0x0){return this[_0x9836('0xa1')](_0xcf7cc8);}_0xcf7cc8[_0x9836('0xa2')]-=0x1;if(!this[_0x9836('0xa0')](_0xcf7cc8[_0x9836('0x10f')])){return this[_0x9836('0xf')]['error'](_0xcf7cc8,_0x9836('0x110'));}var _0x46d085=this[_0x9836('0x111')]['sync'](this,_0xcf7cc8[_0x9836('0x10f')]);if(!_0x46d085){return this['channel'][_0x9836('0x2b')](_0xcf7cc8,_0x9836('0x112'));}if(!this[_0x9836('0xa0')](_0xcf7cc8[_0x9836('0xd2')])){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x9836('0xd3'));}var _0x5a0742=this[_0x9836('0xf')]['getData'](_0x46d085,_0xcf7cc8[_0x9836('0x113')],_0xcf7cc8[_0x9836('0x114')]);var _0x43276d=_0x5a0742[_0x9836('0x9e')]?_0x5a0742['result'][_0x9836('0x4b')]():'';logger[_0x9836('0x2c')]('test',JSON[_0x9836('0x73')](_0x5a0742));if(_0x5a0742[_0x9836('0x9e')]===-0x1){this[_0x9836('0x35')][_0x9836('0x70')](this,_0xcf7cc8,_0x43276d);return _0x5a0742;}else if(_0x5a0742[_0x9836('0x9c')]===_0x9836('0x69')){_0x5a0742['result']=_0x43276d[_0x9836('0x97')]>=parseInt(_0xcf7cc8[_0x9836('0x115')])?'x':'i';}else{_0x5a0742['result']=_0x43276d[_0x9836('0x97')]>=parseInt(_0xcf7cc8['mindigit'])&&_0x43276d[_0x9836('0x97')]<=parseInt(_0xcf7cc8[_0x9836('0x114')])?'x':'i';}var _0x2af390=this[_0x9836('0x12')]['sync'](this,_0xcf7cc8[_0x9836('0xd2')]);if(!_0x2af390){return this[_0x9836('0xf')][_0x9836('0x2b')](_0xcf7cc8,_0x9836('0xd4'));}this[_0x9836('0xf')]['setVariable'](_0x2af390,_0x43276d);if(this[_0x9836('0xa0')](_0xcf7cc8['hiddendigitsnum'])){var _0x3304c3=parseInt(_0xcf7cc8[_0x9836('0x116')],0xa);var _0x218eef=rs[_0x9836('0x117')]({'charset':'*','length':_0x3304c3});var _0x4c630d=_0x43276d['length'];if(_0x4c630d>0x0){if(_0x4c630d>_0x3304c3){this[_0x9836('0x35')][_0x9836('0x70')](this,_0xcf7cc8,_0xcf7cc8[_0x9836('0x118')]==='first'?_0x218eef+_0x43276d[_0x9836('0x119')](_0x3304c3):_0x43276d[_0x9836('0x119')](0x0,_0x4c630d-_0x3304c3)+_0x218eef);}else{this[_0x9836('0x35')][_0x9836('0x70')](this,_0xcf7cc8,rs['generate']({'charset':'*','length':_0x4c630d}));}}else{this[_0x9836('0x35')]['sync'](this,_0xcf7cc8,'');}}else{this['createSquareDetailsReport'][_0x9836('0x70')](this,_0xcf7cc8,_0x43276d);}return _0x5a0742;};AGIVertices[_0x9836('0x16')]['getsecretdigits']=function(_0x35642f){logger[_0x9836('0x2c')](util[_0x9836('0x54')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x35642f[_0x9836('0x36')]));return this[_0x9836('0xd')](_0x35642f);};AGIVertices[_0x9836('0x16')][_0x9836('0x11a')]=function(_0x41b69e){logger[_0x9836('0x2c')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x41b69e['label']));this['createSquareDetailsReport'][_0x9836('0x70')](this,_0x41b69e,_0x41b69e[_0x9836('0x11b')]);return this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x11c'),_0x41b69e[_0x9836('0x11b')]));};AGIVertices[_0x9836('0x16')][_0x9836('0x11d')]=function(_0x5054bb){logger['info'](util[_0x9836('0x54')](_0x9836('0x11e'),_0x5054bb[_0x9836('0x36')]));if(!this['isConfigured'](_0x5054bb['aws_access_key_id'])||!this[_0x9836('0xa0')](_0x5054bb[_0x9836('0x84')])){return this['channel']['noop'](_0x9836('0x11f'));}if(!this[_0x9836('0xa0')](_0x5054bb[_0x9836('0x5d')])){return this[_0x9836('0xf')][_0x9836('0xa5')](_0x9836('0xbc'));}this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x120'),_0x5054bb[_0x9836('0x5d')]));var _0x119c44=this[_0x9836('0x82')][_0x9836('0x70')](this,_0x5054bb);if(_0x119c44){this['channel'][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x121'),_0x119c44));var _0x2b9ea7=this['channel'][_0x9836('0x100')](_0x119c44);try{fs['unlink'](_0x119c44+'.wav');}catch(_0x211421){logger[_0x9836('0x2b')](_0x211421);}return _0x2b9ea7;}return this[_0x9836('0xf')][_0x9836('0x2b')](_0x5054bb,_0x9836('0x122'));};AGIVertices[_0x9836('0x16')]['awslex']=function(_0x3eff1a){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x123'),_0x3eff1a['label']));if(!this[_0x9836('0xa0')](_0x3eff1a[_0x9836('0x83')])||!this['isConfigured'](_0x3eff1a[_0x9836('0x84')])){return this[_0x9836('0xf')]['noop'](_0x9836('0x11f'));}if(!this[_0x9836('0xa0')](_0x3eff1a[_0x9836('0x124')])){return this['channel']['noop'](_0x9836('0x125'));}if(!this['isConfigured'](_0x3eff1a[_0x9836('0x5d')])){return this[_0x9836('0xf')][_0x9836('0xa5')](_0x9836('0xbc'));}this['channel'][_0x9836('0xe4')]=!![];this[_0x9836('0x35')](_0x3eff1a);this[_0x9836('0x41')](_0x3eff1a[_0x9836('0x5d')],'in','','');this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x126'),_0x3eff1a[_0x9836('0x5d')]));var _0x5c4247=this['awsLex']['sync'](this,_0x3eff1a);if(_0x5c4247){for(var _0x15dd0c in _0x5c4247){if(_0x5c4247[_0x9836('0x90')](_0x15dd0c)&&_['isString'](_0x5c4247[_0x15dd0c])){this['channel'][_0x9836('0x9a')](util[_0x9836('0x54')](_0x9836('0x127'),_0x15dd0c[_0x9836('0x6b')]()),_0x5c4247[_0x15dd0c]);}}if(_['isNil'](_0x5c4247['message'])){return this[_0x9836('0xf')][_0x9836('0xa5')](_0x9836('0x128'));}else{this['createSquareMessage'](_0x5c4247[_0x9836('0x129')],_0x9836('0xf4'),_0x9836('0x12a'),'');return this['channel'][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x12b'),_0x5c4247['message']));}}return this[_0x9836('0xf')][_0x9836('0x2b')](_0x3eff1a,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x9836('0x16')][_0x9836('0x12c')]=function(_0x13f640){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x12d'),_0x13f640[_0x9836('0x36')],_0x13f640[_0x9836('0x69')]));if(!this['isConfigured'](_0x13f640['key'])){return this[_0x9836('0xf')]['noop'](_0x9836('0xe3'));}var _0x1bcd63='wav';var _0x23f647=util[_0x9836('0x54')](_0x9836('0x12e'),FILES_PATH,rs[_0x9836('0x117')](0x4));var _0x48502c=util['format'](_0x9836('0x99'),_0x23f647,_0x1bcd63);var _0x390738=!![];if(_0x13f640[_0x9836('0x12f')]==='NOBEEP'){_0x390738=![];}var _0x51cff2=this[_0x9836('0xf')][_0x9836('0x130')](_0x23f647,_0x1bcd63,_0x13f640['intKey'],_0x13f640['timeout'],undefined,_0x390738);if(_0x51cff2[_0x9836('0x9e')]!==-0x1){this[_0x9836('0xf')]['noop'](util['format'](_0x9836('0x131'),_0x48502c));var _0xe8a5db=this[_0x9836('0x8a')]['sync'](this,_0x13f640,_0x48502c);if(_0xe8a5db){for(var _0x7d9793 in _0xe8a5db){if(_0xe8a5db['hasOwnProperty'](_0x7d9793)){this['channel'][_0x9836('0x9a')](util[_0x9836('0x54')](_0x9836('0x132'),_0x7d9793[_0x9836('0x6b')]()),_0xe8a5db[_0x7d9793]);}}return this['channel'][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x133'),JSON[_0x9836('0x73')](_0xe8a5db)));}}return _0x51cff2;};AGIVertices['prototype'][_0x9836('0x134')]=function(_0x42317d){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x135'),_0x42317d[_0x9836('0x36')]));if(!this['isConfigured'](_0x42317d[_0x9836('0x8c')])){return this[_0x9836('0xf')][_0x9836('0xa5')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0x42317d['appsecret'])){return this[_0x9836('0xf')][_0x9836('0xa5')](_0x9836('0x136'));}var _0x5d7c9e='wav';var _0x2ba326=util[_0x9836('0x54')]('%s/recordings/%s',FILES_PATH,rs[_0x9836('0x117')](0x4));var _0x5eeded=util[_0x9836('0x54')](_0x9836('0x99'),_0x2ba326,_0x5d7c9e);var _0xe8954c=!![];if(_0x42317d[_0x9836('0x12f')]===_0x9836('0x137')){_0xe8954c=![];}var _0x1f018d=this['channel'][_0x9836('0x130')](_0x2ba326,_0x5d7c9e,_0x42317d['intKey'],_0x42317d['timeout'],undefined,_0xe8954c);if(_0x1f018d['result']!==-0x1){this[_0x9836('0xf')]['noop'](util[_0x9836('0x54')](_0x9836('0x138'),_0x5eeded));var _0xc7c903=this[_0x9836('0x8b')]['sync'](this,_0x42317d,_0x5eeded);if(_0xc7c903){for(var _0xfa9bd4 in _0xc7c903){if(_0xc7c903[_0x9836('0x90')](_0xfa9bd4)){this[_0x9836('0xf')][_0x9836('0x9a')](util[_0x9836('0x54')](_0x9836('0x139'),_0xfa9bd4[_0x9836('0x6b')]()),_0xc7c903[_0xfa9bd4]);}}return this[_0x9836('0xf')]['noop'](util[_0x9836('0x54')](_0x9836('0x13a'),JSON['stringify'](_0xc7c903)));}}return _0x1f018d;};AGIVertices[_0x9836('0x16')][_0x9836('0x13b')]=function(_0x295a27){logger['info'](util[_0x9836('0x54')](_0x9836('0x13c'),_0x295a27[_0x9836('0x36')]));return this[_0x9836('0xf')][_0x9836('0x13d')](_0x295a27['context'],_0x295a27[_0x9836('0x13e')],_0x295a27[_0x9836('0x3d')]);};AGIVertices['prototype'][_0x9836('0x13f')]=function(_0x55fd9f){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x140'),_0x55fd9f[_0x9836('0x36')]));if(!this[_0x9836('0xa0')](_0x55fd9f['condition'])){return this[_0x9836('0xf')]['error'](_0x55fd9f,_0x9836('0x141'));}try{var _0x29d273=eval(_0x55fd9f['condition'])?_0x9836('0x142'):_0x9836('0x143');this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x144'),_0x55fd9f['condition'],_0x29d273));return{'code':0xc8,'result':_0x29d273};}catch(_0x3f05eb){return{'code':0xc8,'result':_0x9836('0x143')};}};AGIVertices[_0x9836('0x16')][_0x9836('0x145')]=function(_0x5f9edb){logger[_0x9836('0x2c')](util['format'](_0x9836('0x146'),_0x5f9edb[_0x9836('0x36')]));if(!this[_0x9836('0xa0')](_0x5f9edb['interval_id'])){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x5f9edb,'no\x20interval\x20configured');}var _0x199b52=this['getIntervals'][_0x9836('0x70')](this,_0x5f9edb[_0x9836('0x147')]);if(!_0x199b52){return this['channel'][_0x9836('0x2b')](_0x5f9edb,_0x9836('0x148'));}for(var _0x2a8e14=0x0;_0x2a8e14<_0x199b52[_0x9836('0x97')];_0x2a8e14+=0x1){var _0x38d711=this[_0x9836('0xf')][_0x9836('0x12')](util[_0x9836('0x54')](_0x9836('0x149'),_0x199b52[_0x2a8e14]));if(_0x38d711[_0x9836('0x9e')]===-0x1){return _0x38d711;}logger[_0x9836('0x2c')](util[_0x9836('0x54')]('IFTIME\x20%s\x20%s',_0x199b52[_0x2a8e14],_0x38d711[_0x9836('0x9c')]));if(_0x38d711[_0x9836('0x9c')]===_0x9836('0x142')){logger['info'](util[_0x9836('0x54')](_0x9836('0x14a'),_0x199b52[_0x2a8e14],_0x9836('0x142')));this['channel'][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x14a'),_0x199b52[_0x2a8e14],_0x9836('0x142')));return{'code':0xc8,'result':_0x9836('0x142')};}else{logger[_0x9836('0x2c')](util[_0x9836('0x54')]('IFTIME\x20%s\x20%s',_0x199b52[_0x2a8e14],_0x9836('0x143')));this[_0x9836('0xf')]['noop'](util['format'](_0x9836('0x14a'),_0x199b52[_0x2a8e14],_0x9836('0x143')));}}return{'code':0xc8,'result':_0x9836('0x143')};};AGIVertices[_0x9836('0x16')][_0x9836('0x14b')]=function(_0x228997){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x14c'),_0x228997[_0x9836('0x36')]));return this['channel']['hangup']();};AGIVertices[_0x9836('0x16')][_0x9836('0x14d')]=function(_0x214d3e){logger[_0x9836('0x2c')](util['format'](_0x9836('0x14e'),_0x214d3e['label']));if(!this[_0x9836('0xa0')](_0x214d3e[_0x9836('0x79')])){return this[_0x9836('0xf')][_0x9836('0xa5')](_0x9836('0xe3'));}var _0x5294ce='wav';var _0x3850c9=util[_0x9836('0x54')](_0x9836('0x12e'),FILES_PATH,rs['generate'](0x4));var _0x5cc712=util['format']('%s.%s',_0x3850c9,_0x5294ce);var _0x2f3c0d=!![];if(_0x214d3e[_0x9836('0x12f')]===_0x9836('0x137')){_0x2f3c0d=![];}var _0x524be1=this['channel'][_0x9836('0x130')](_0x3850c9,_0x5294ce,_0x214d3e[_0x9836('0x14f')],_0x214d3e['timeout'],undefined,_0x2f3c0d);if(_0x524be1['result']!==-0x1){this[_0x9836('0xf')]['noop'](util['format'](_0x9836('0x150'),_0x5cc712));var _0x427dd1=this[_0x9836('0x80')]['sync'](this,_0x214d3e,_0x5cc712);if(_0x427dd1){for(var _0x40e3f0 in _0x427dd1){if(_0x427dd1[_0x9836('0x90')](_0x40e3f0)){this[_0x9836('0xf')]['setVariable'](util['format']('ISPEECH_ASR_%s',_0x40e3f0['toUpperCase']()),_0x427dd1[_0x40e3f0]);}}return this[_0x9836('0xf')][_0x9836('0xa5')](util['format'](_0x9836('0x151'),JSON[_0x9836('0x73')](_0x427dd1)));}}return _0x524be1;};AGIVertices[_0x9836('0x16')][_0x9836('0x152')]=function(_0x3fcfd1){logger[_0x9836('0x2c')](util['format'](_0x9836('0x153'),_0x3fcfd1[_0x9836('0x36')]));if(!this[_0x9836('0xa0')](_0x3fcfd1[_0x9836('0x79')])){return this[_0x9836('0xf')][_0x9836('0xa5')](_0x9836('0xe3'));}if(!this[_0x9836('0xa0')](_0x3fcfd1[_0x9836('0x5d')])){return this[_0x9836('0xf')]['noop'](_0x9836('0xbc'));}this['channel'][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x154'),_0x3fcfd1['text']));var _0x5bdee7=this[_0x9836('0x7e')][_0x9836('0x70')](this,_0x3fcfd1);if(_0x5bdee7){this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x150'),_0x5bdee7));var _0x185068=this[_0x9836('0xf')]['streamFile'](_0x5bdee7,_0x3fcfd1[_0x9836('0x14f')]);try{fs[_0x9836('0x101')](_0x5bdee7+'.wav');}catch(_0x104241){logger[_0x9836('0x2b')](_0x104241);}return _0x185068;}return this[_0x9836('0xf')][_0x9836('0x2b')](_0x3fcfd1,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x9836('0x16')][_0x9836('0x155')]=function(_0x358364){logger[_0x9836('0x2c')](util['format'](_0x9836('0x156'),_0x358364[_0x9836('0x36')]));if(!this[_0x9836('0xa0')](_0x358364['findBy'])){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x358364,_0x9836('0x157'));}logger[_0x9836('0x2c')](util[_0x9836('0x54')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x358364[_0x9836('0x158')]));var _0x3ba875=this['agentLogin'][_0x9836('0x70')](this,_0x358364[_0x9836('0x158')]);if(_0x3ba875){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x159'),this[_0x9836('0xf')]['callerid'],_0x358364[_0x9836('0x158')]));this[_0x9836('0xf')][_0x9836('0xa5')](util['format'](_0x9836('0x159'),this['channel']['callerid'],_0x358364[_0x9836('0x158')]));return{'code':0xc8,'result':_0x9836('0x15a')};}else{logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x15b'),this[_0x9836('0xf')][_0x9836('0x39')],_0x358364[_0x9836('0x158')]));this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x15b'),this[_0x9836('0xf')][_0x9836('0x39')],_0x358364[_0x9836('0x158')]));return{'code':0xc8,'result':_0x9836('0x15c')};}};AGIVertices['prototype'][_0x9836('0x15d')]=function(_0x5aee70){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x15e'),_0x5aee70['label']));if(!this[_0x9836('0xa0')](_0x5aee70[_0x9836('0x158')])){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x5aee70,_0x9836('0x157'));}logger['info'](util[_0x9836('0x54')](_0x9836('0x15f'),this[_0x9836('0xf')][_0x9836('0x39')],_0x5aee70[_0x9836('0x158')]));var _0xce9e43=this[_0x9836('0x52')][_0x9836('0x70')](this,_0x5aee70['findBy']);if(_0xce9e43){logger[_0x9836('0x2c')](util['format'](_0x9836('0x159'),this['channel']['callerid'],_0x5aee70[_0x9836('0x158')]));this['channel']['noop'](util[_0x9836('0x54')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9836('0xf')]['callerid'],_0x5aee70['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x9836('0x54')](_0x9836('0x15b'),this['channel']['callerid'],_0x5aee70['findBy']));this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x15b'),this[_0x9836('0xf')][_0x9836('0x39')],_0x5aee70[_0x9836('0x158')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x9836('0x16')][_0x9836('0x160')]=function(_0x2048cb){logger[_0x9836('0x2c')](util[_0x9836('0x54')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x2048cb[_0x9836('0x36')]));if(!this[_0x9836('0xa0')](_0x2048cb[_0x9836('0x161')])){return this[_0x9836('0xf')]['error'](_0x2048cb,'no\x20operation\x20configured');}this[_0x9836('0xf')][_0x9836('0xa5')](util['format']('math\x20%s',_0x2048cb[_0x9836('0x161')]));var _0x43041c=eval(_0x2048cb[_0x9836('0x161')]);if(!this[_0x9836('0xa0')](_0x2048cb[_0x9836('0xd2')])){return this[_0x9836('0xf')][_0x9836('0xa5')](_0x9836('0xd3'));}var _0x3f7b77=this[_0x9836('0x12')]['sync'](this,_0x2048cb[_0x9836('0xd2')]);if(!_0x3f7b77){return this['channel'][_0x9836('0x2b')](_0x2048cb,_0x9836('0xd4'));}if(_[_0x9836('0x96')](_0x43041c)){var _0x12190a=this;_0x43041c['forEach'](function(_0x46622c,_0x4e2185){_0x12190a[_0x9836('0xf')][_0x9836('0x9a')](util[_0x9836('0x54')](_0x9836('0x162'),_0x3f7b77,_0x4e2185),_0x46622c);});return this['channel']['noop'](util[_0x9836('0x54')]('variable\x20%s[key]\x20set',_0x3f7b77));}else{return this[_0x9836('0xf')][_0x9836('0x9a')](_0x3f7b77,_0x43041c);}};AGIVertices[_0x9836('0x16')]['menu']=function(_0x2d911e){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x163'),_0x2d911e[_0x9836('0x36')]));if(_0x2d911e[_0x9836('0xa2')]===0x0){return this[_0x9836('0xa1')](_0x2d911e);}_0x2d911e['retry']-=0x1;if(!this[_0x9836('0xa0')](_0x2d911e[_0x9836('0x10f')])){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x2d911e,_0x9836('0x110'));}var _0x19432e=this[_0x9836('0x111')][_0x9836('0x70')](this,_0x2d911e[_0x9836('0x10f')]);if(!_0x19432e){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x2d911e,_0x9836('0x112'));}var _0x5105ce=this['channel']['getData'](_0x19432e,_0x2d911e['response'],_0x2d911e['digit']);var _0x241d39=_0x5105ce[_0x9836('0x9e')];if(_0x5105ce[_0x9836('0x9e')]===-0x1){this[_0x9836('0x35')]['sync'](this,_0x2d911e,'-1');return _0x5105ce;}else if(_0x5105ce['extra']===_0x9836('0x69')){_0x5105ce[_0x9836('0x9e')]=_0x5105ce[_0x9836('0x9e')][_0x9836('0x97')]>0x0?_0x5105ce[_0x9836('0x9e')]:'t';}else if(_[_0x9836('0x43')](_0x5105ce[_0x9836('0x9e')])){_0x5105ce[_0x9836('0x9e')]='#';_0x241d39='#';}if(!this[_0x9836('0xa0')](_0x2d911e[_0x9836('0xd2')])){this[_0x9836('0xf')][_0x9836('0xa5')](_0x9836('0xd3'));}else{var _0x2f46ef=this['getVariable'][_0x9836('0x70')](this,_0x2d911e[_0x9836('0xd2')]);if(!_0x2f46ef){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x2d911e,_0x9836('0xd4'));}this[_0x9836('0xf')][_0x9836('0x9a')](_0x2f46ef,_0x241d39);}this[_0x9836('0x35')][_0x9836('0x70')](this,_0x2d911e,_0x241d39);return _0x5105ce;};AGIVertices[_0x9836('0x16')][_0x9836('0xa5')]=function(_0x1b6006){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x164'),_0x1b6006[_0x9836('0x36')]));return this['channel'][_0x9836('0xa5')](_0x1b6006[_0x9836('0x165')]||_0x1b6006['label']);};AGIVertices[_0x9836('0x16')][_0x9836('0x166')]=function(_0x525453){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x167'),_0x525453[_0x9836('0x36')]));if(!this[_0x9836('0xa0')](_0x525453[_0x9836('0x158')])){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x525453,_0x9836('0x157'));}logger[_0x9836('0x2c')](util['format'](_0x9836('0x15f'),this[_0x9836('0xf')][_0x9836('0x39')],_0x525453[_0x9836('0x158')]));var _0x1c76ab=this[_0x9836('0x4d')][_0x9836('0x70')](this,_0x525453['pause_id']);var _0x446704=this['agentPause'][_0x9836('0x70')](this,_0x525453[_0x9836('0x158')],_0x1c76ab);if(_0x446704){logger['info'](util[_0x9836('0x54')](_0x9836('0x159'),this[_0x9836('0xf')][_0x9836('0x39')],_0x525453['findBy']));this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x159'),this['channel']['callerid'],_0x525453['findBy']));return{'code':0xc8,'result':_0x9836('0x15a')};}else{logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x15b'),this[_0x9836('0xf')]['callerid'],_0x525453['findBy']));this['channel'][_0x9836('0xa5')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x9836('0xf')][_0x9836('0x39')],_0x525453[_0x9836('0x158')]));return{'code':0xc8,'result':_0x9836('0x15c')};}};AGIVertices[_0x9836('0x16')][_0x9836('0x168')]=function(_0x8155a){logger[_0x9836('0x2c')](util[_0x9836('0x54')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x8155a['label']));if(!this[_0x9836('0xa0')](_0x8155a[_0x9836('0x10f')])){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x8155a,_0x9836('0x110'));}var _0x5def0f=this[_0x9836('0x111')][_0x9836('0x70')](this,_0x8155a[_0x9836('0x10f')]);if(!_0x5def0f){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x8155a,_0x9836('0x112'));}var _0x3dfdef=this[_0x9836('0xf')][_0x9836('0xb8')](_0x9836('0x169'),[_0x5def0f,_0x8155a[_0x9836('0xe0')]]);if(_0x3dfdef['result']===-0x1){return _0x3dfdef;}return this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')]('Executed\x20command\x20%s\x20%s',_0x9836('0x169'),_0x5def0f));};AGIVertices[_0x9836('0x16')][_0x9836('0x16a')]=function(_0x27b94e){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x16b'),_0x27b94e['label']));if(!this[_0x9836('0xa0')](_0x27b94e[_0x9836('0x16c')])){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x27b94e,'no\x20queue\x20selected');}var _0x5a5bf7='';var _0x521558=parseInt(_0x27b94e[_0x9836('0x16c')],0xa);if(isNaN(_0x521558)){_0x5a5bf7=_0x27b94e[_0x9836('0x16c')];}else{_0x5a5bf7=this[_0x9836('0x17')][_0x9836('0x70')](this,_0x27b94e[_0x9836('0x16c')]);if(!_0x5a5bf7){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x27b94e,'no\x20queue\x20found');}}var _0x446e3b='';if(this[_0x9836('0xa0')](_0x27b94e[_0x9836('0x10f')])){var _0x25119c=this[_0x9836('0x111')][_0x9836('0x70')](this,_0x27b94e['file_id']);if(_0x25119c){_0x446e3b=_0x25119c;}}this[_0x9836('0x35')][_0x9836('0x70')](this,_0x27b94e,_0x5a5bf7);if(_0x27b94e['opts'][_0x9836('0x16d')]('x')<0x0){_0x27b94e[_0x9836('0xe0')]+='x';}if(_0x27b94e[_0x9836('0xe0')][_0x9836('0x16d')]('X')<0x0){_0x27b94e[_0x9836('0xe0')]+='X';}this[_0x9836('0xf')][_0x9836('0x9a')](_0x9836('0x16e'),_0x5a5bf7?_0x5a5bf7[_0x9836('0x16f')]():'');var _0x18369b=this[_0x9836('0xf')][_0x9836('0xb8')](_0x9836('0x170'),[_0x5a5bf7,_0x27b94e[_0x9836('0xe0')],_0x27b94e['url'],_0x446e3b,_0x27b94e[_0x9836('0x69')],_0x27b94e[_0x9836('0xac')],_0x27b94e['macro'],_0x27b94e[_0x9836('0x171')],'',_0x27b94e[_0x9836('0x172')]]);if(_0x18369b[_0x9836('0x9e')]===-0x1){return _0x18369b;}return this['channel'][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0xba'),_0x9836('0x170'),_0x5a5bf7));};AGIVertices['prototype'][_0x9836('0x173')]=function(_0x188b01){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x174'),_0x188b01['label']));var _0x5aa663=_0x188b01[_0x9836('0x175')]||_0x9836('0x176');var _0x507314=util[_0x9836('0x54')](_0x9836('0x177'),this['channel'][_0x9836('0x3b')],rs[_0x9836('0x117')](0x5));var _0x4fbb44=util['format'](_0x9836('0x178'),FILES_PATH,_0x507314,_0x5aa663);var _0x3075fe=util[_0x9836('0x54')](_0x9836('0x12e'),FILES_PATH,_0x507314);this[_0x9836('0x3a')][_0x9836('0x70')](this,_0x188b01,_0x507314,_0x4fbb44);this[_0x9836('0xf')][_0x9836('0x9a')](_0x9836('0x179'),_0x507314);logger[_0x9836('0x2c')](_0x9836('0x17a'),_0x3075fe,_0x5aa663,_0x188b01[_0x9836('0x17b')],_0x188b01[_0x9836('0x69')]);return this[_0x9836('0xf')][_0x9836('0x130')](_0x3075fe,_0x5aa663,_0x188b01[_0x9836('0x17b')],_0x188b01[_0x9836('0x69')],undefined,!![]);};AGIVertices[_0x9836('0x16')][_0x9836('0x17c')]=function(_0x1be5c4){logger['info'](util[_0x9836('0x54')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x1be5c4[_0x9836('0x36')]));if(!this[_0x9836('0xa0')](_0x1be5c4['url'])){return this[_0x9836('0xf')][_0x9836('0xa5')]('no\x20url\x20configured');}var _0x1c4178=this['restAPI'][_0x9836('0x70')](this,_0x1be5c4);logger[_0x9836('0x2c')](util[_0x9836('0x54')]('Response:',util[_0x9836('0x17d')](_0x1c4178,{'showHidden':![],'depth':null})));if(!this[_0x9836('0xa0')](_0x1be5c4[_0x9836('0xd2')])){return this[_0x9836('0xf')][_0x9836('0xa5')](_0x9836('0x17e'));}var _0x54d7a1=this[_0x9836('0x12')][_0x9836('0x70')](this,_0x1be5c4['variable_id']);if(!_0x54d7a1){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x1be5c4,_0x9836('0xd4'));}this[_0x9836('0xf')]['setVariable'](util[_0x9836('0x54')]('%s_STATUS_CODE',_0x54d7a1),_0x1c4178[_0x9836('0x76')]?_0x1c4178[_0x9836('0x76')]:_0x9836('0x17f'));this[_0x9836('0xf')][_0x9836('0x9a')](util[_0x9836('0x54')](_0x9836('0x180'),_0x54d7a1),_0x1c4178['statusMessage']?_0x1c4178['statusMessage']:'OK');if(_0x1c4178[_0x9836('0x6c')]){try{this[_0x9836('0x98')](_0x1c4178[_0x9836('0x6c')],_0x54d7a1);}catch(_0x276e89){logger[_0x9836('0x2b')](util['format'](_0x9836('0x181'),_0x54d7a1));}}return this[_0x9836('0xf')][_0x9836('0xa5')](util['format'](_0x9836('0xd8'),_0x54d7a1));};AGIVertices[_0x9836('0x16')][_0x9836('0x182')]=function(_0x514103){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x183'),_0x514103[_0x9836('0x36')]));return this[_0x9836('0xf')][_0x9836('0x184')](_0x514103[_0x9836('0x185')][_0x9836('0x59')](/\s+/g,''),_0x514103[_0x9836('0x17b')]);};AGIVertices['prototype'][_0x9836('0x186')]=function(_0x3466bf){logger['info'](util[_0x9836('0x54')](_0x9836('0x187'),_0x3466bf[_0x9836('0x36')]));return this[_0x9836('0xf')]['sayNumber'](_0x3466bf['number'][_0x9836('0x59')](/\s+/g,''),_0x3466bf[_0x9836('0x17b')]);};AGIVertices[_0x9836('0x16')][_0x9836('0x188')]=function(_0x236e34){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x189'),_0x236e34[_0x9836('0x36')]));return this[_0x9836('0xf')][_0x9836('0x18a')](_0x236e34[_0x9836('0x5d')],_0x236e34['escape_digits']);};AGIVertices[_0x9836('0x16')]['sendMail']=function(_0xe6b33e){logger['info'](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0xe6b33e[_0x9836('0x36')]));if(!this[_0x9836('0xa0')](_0xe6b33e[_0x9836('0x18b')])){return this[_0x9836('0xf')]['noop'](_0x9836('0x18c'));}var _0x2534c5=this['getMailAccount'][_0x9836('0x70')](this,_0xe6b33e['account_id']);if(!_0x2534c5||!_0x2534c5[_0x9836('0x18d')]){return this[_0x9836('0xf')]['error'](_0xe6b33e,_0x9836('0x18e'));}var _0x236c99={'from':util[_0x9836('0x54')](_0x9836('0x18f'),_0x2534c5[_0x9836('0x14')],_0x2534c5[_0x9836('0x190')]||_0x2534c5[_0x9836('0x18d')][_0x9836('0x191')]),'to':_0xe6b33e['to']||'','cc':_0xe6b33e['cc']||'','bcc':_0xe6b33e['bcc']||'','subject':_0xe6b33e[_0x9836('0x192')],'html':_0xe6b33e[_0x9836('0x5d')],'text':_0xe6b33e[_0x9836('0x5d')]};if(this[_0x9836('0xa0')](_0xe6b33e[_0x9836('0x193')])){}logger[_0x9836('0x194')](_0x9836('0x195'),JSON[_0x9836('0x73')](_0x236c99));this[_0x9836('0x35')]['sync'](this,_0xe6b33e,_0xe6b33e[_0x9836('0x18b')]);this[_0x9836('0xf')][_0x9836('0xa5')](util['format'](_0x9836('0x196'),_0x2534c5[_0x9836('0x14')]));this[_0x9836('0x25')]['sync'](this,_0x2534c5[_0x9836('0x197')],_0x236c99);return this[_0x9836('0xf')][_0x9836('0xa5')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x9836('0x16')][_0x9836('0x198')]=function(_0x1ba9bf){logger['info'](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x1ba9bf[_0x9836('0x36')]));return this[_0x9836('0xf')]['noop'](_0x9836('0x199'));};AGIVertices[_0x9836('0x16')][_0x9836('0x19a')]=function(_0x4fa527){logger['info'](util[_0x9836('0x54')](_0x9836('0x19b'),_0x4fa527['label']));if(!this[_0x9836('0xa0')](_0x4fa527['sms_account_id'])){return this[_0x9836('0xf')]['noop'](_0x9836('0x19c'));}var _0x3bdca4=this[_0x9836('0x32')][_0x9836('0x70')](this,_0x4fa527[_0x9836('0x19d')]);if(!_0x3bdca4){return this['channel']['error'](_0x4fa527,_0x9836('0x19e'));}var _0x33522a={'body':_0x4fa527['sms_text'],'phone':_0x4fa527['to']||'','SmsAccountId':_0x3bdca4['id']};logger[_0x9836('0x194')](_0x9836('0x19f'),JSON[_0x9836('0x73')](_0x33522a));this[_0x9836('0x35')][_0x9836('0x70')](this,_0x4fa527,_0x4fa527['sms_account_id']);this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x1a0'),_0x3bdca4[_0x9836('0x14')]));this[_0x9836('0x34')][_0x9836('0x70')](this,_0x33522a);return this[_0x9836('0xf')][_0x9836('0xa5')](_0x9836('0x1a1'));};AGIVertices[_0x9836('0x16')][_0x9836('0x1a2')]=function(_0x47dadd){logger[_0x9836('0x2c')](util['format'](_0x9836('0x1a3'),_0x47dadd['label']));if(!this['isConfigured'](_0x47dadd[_0x9836('0xd2')])){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x47dadd,_0x9836('0x1a4'));}var _0x1a4ed5=this[_0x9836('0x12')][_0x9836('0x70')](this,_0x47dadd[_0x9836('0xd2')]);if(!_0x1a4ed5){return this[_0x9836('0xf')][_0x9836('0x2b')](_0x47dadd,_0x9836('0xd4'));}return this[_0x9836('0xf')][_0x9836('0x9a')](_0x1a4ed5,_0x47dadd['variable_value']);};AGIVertices[_0x9836('0x16')][_0x9836('0x1a5')]=function(_0x1e9cb8){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x1a6'),_0x1e9cb8['label']));this[_0x9836('0xf')]['noop'](_0x9836('0x1a7'));if(_0x1e9cb8['answer']===_0x9836('0x1a8')){this['channel'][_0x9836('0xa5')](_0x9836('0x1a9'));return this[_0x9836('0xf')][_0x9836('0x1aa')]();}return this['channel'][_0x9836('0xa5')]('Skipped\x20Answer');};AGIVertices['prototype']['subproject']=function(_0x6472f9){logger[_0x9836('0x2c')](util[_0x9836('0x54')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x6472f9['label']));if(!this[_0x9836('0xa0')](_0x6472f9['project_id'])){return this[_0x9836('0xf')]['error'](_0x6472f9,'no\x20subproject\x20selected');}var _0x116d08=this[_0x9836('0x1ab')][_0x9836('0x70')](this,_0x6472f9['project_id']);if(!this['isConfigured'](_0x116d08)){return this['channel'][_0x9836('0x2b')](_0x6472f9,util[_0x9836('0x54')](_0x9836('0x1ac'),_0x6472f9[_0x9836('0x1ad')]));}if(_0x116d08===this[_0x9836('0xf')][_0x9836('0x38')]){return this['channel'][_0x9836('0x2b')](_0x6472f9,_0x9836('0x1ae'));}this[_0x9836('0x35')][_0x9836('0x70')](this,_0x6472f9,_0x116d08);var _0x3bf51e=this['channel'][_0x9836('0xb8')](_0x9836('0x1af'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x9836('0xac')][_0x9836('0x1b0')]||_0x9836('0x1b1'),_0x116d08,this[_0x9836('0xf')][_0x9836('0x38')]));if(_0x3bf51e[_0x9836('0x9e')]===-0x1){return _0x3bf51e;}return this[_0x9836('0xf')]['noop'](util[_0x9836('0x54')]('Executed\x20command\x20%s\x20%s',_0x9836('0x1af'),_0x116d08));};AGIVertices[_0x9836('0x16')][_0x9836('0x1b2')]=function(_0x27e4da){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x1b3'),_0x27e4da[_0x9836('0x36')]));var _0xa7dc7=this[_0x9836('0x57')][_0x9836('0x70')](this,_0x27e4da[_0x9836('0x1b4')]);this[_0x9836('0x35')][_0x9836('0x70')](this,_0x27e4da,_0x27e4da[_0x9836('0x1b4')]);if(this[_0x9836('0xa0')](_0x27e4da[_0x9836('0xd2')])){var _0x4c7d3b=this[_0x9836('0x12')][_0x9836('0x70')](this,_0x27e4da[_0x9836('0xd2')]);if(_0x4c7d3b){this['channel'][_0x9836('0x9a')](_0x4c7d3b,_0xa7dc7);return this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x1b5'),_0x27e4da['command'],_0x4c7d3b));}}return this['channel']['noop'](util[_0x9836('0x54')](_0x9836('0x1b6'),_0x27e4da['command']));};AGIVertices[_0x9836('0x16')][_0x9836('0x1b7')]=function(_0x57a8d1){logger[_0x9836('0x2c')](util[_0x9836('0x54')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x57a8d1[_0x9836('0x36')]));_0x57a8d1[_0x9836('0x5d')]=_0x57a8d1['text'][_0x9836('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x9836('0xa0')](_0x57a8d1[_0x9836('0x5b')])){return this[_0x9836('0xf')][_0x9836('0xa5')]('no\x20apiKey\x20configured');}if(!this[_0x9836('0xa0')](_0x57a8d1[_0x9836('0x5d')])){return this['channel'][_0x9836('0xa5')](_0x9836('0xbc'));}this[_0x9836('0xf')][_0x9836('0xa5')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x57a8d1[_0x9836('0x5d')]));var _0x365820=this['googleCloudTTS']['sync'](this,_0x57a8d1);if(_0x365820){this['channel'][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x1b8'),_0x365820));var _0x18383c=this[_0x9836('0xf')][_0x9836('0x100')](_0x365820);try{fs[_0x9836('0x101')](_0x365820+_0x9836('0x102'));}catch(_0x179fa3){logger[_0x9836('0x2b')](_0x179fa3);}return _0x18383c;}return this['channel'][_0x9836('0x2b')](_0x57a8d1,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x9836('0x16')]['tts']=function(_0x214d33){logger['info'](util[_0x9836('0x54')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x214d33[_0x9836('0x36')]));_0x214d33[_0x9836('0x5d')]=_0x214d33[_0x9836('0x5d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x9836('0xa0')](_0x214d33[_0x9836('0x5d')])){return this['channel'][_0x9836('0xa5')](_0x9836('0xbc'));}this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x1b9'),_0x214d33[_0x9836('0x5d')]));var _0x53c063=this['googleTTS'][_0x9836('0x70')](this,_0x214d33);if(_0x53c063){this['channel'][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0x1ba'),_0x53c063));var _0xde0101=this[_0x9836('0xf')][_0x9836('0x100')](_0x53c063);try{fs[_0x9836('0x101')](_0x53c063+_0x9836('0x102'));}catch(_0x4c7914){logger[_0x9836('0x2b')](_0x4c7914);}return _0xde0101;}return this['channel'][_0x9836('0x2b')](_0x214d33,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['unpause']=function(_0x2811a0){logger[_0x9836('0x2c')](util['format'](_0x9836('0x1bb'),_0x2811a0[_0x9836('0x36')]));if(!this['isConfigured'](_0x2811a0[_0x9836('0x158')])){return this[_0x9836('0xf')]['error'](_0x2811a0,_0x9836('0x157'));}logger[_0x9836('0x2c')](util['format'](_0x9836('0x15f'),this[_0x9836('0xf')][_0x9836('0x39')],_0x2811a0[_0x9836('0x158')]));var _0x1f5a64=this[_0x9836('0x50')]['sync'](this,_0x2811a0[_0x9836('0x158')]);if(_0x1f5a64){logger[_0x9836('0x2c')](util['format'](_0x9836('0x159'),this[_0x9836('0xf')][_0x9836('0x39')],_0x2811a0['findBy']));this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9836('0xf')][_0x9836('0x39')],_0x2811a0[_0x9836('0x158')]));return{'code':0xc8,'result':'success'};}else{logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x15b'),this[_0x9836('0xf')][_0x9836('0x39')],_0x2811a0[_0x9836('0x158')]));this['channel'][_0x9836('0xa5')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9836('0xf')]['callerid'],_0x2811a0[_0x9836('0x158')]));return{'code':0xc8,'result':_0x9836('0x15c')};}};AGIVertices[_0x9836('0x16')][_0x9836('0x1bc')]=function(_0x53471f){logger[_0x9836('0x2c')](util[_0x9836('0x54')](_0x9836('0x1bd'),_0x53471f['label']));var _0x476bf5=this['channel']['exec']('VOICEMAIL',[_0x53471f[_0x9836('0x1be')],_0x53471f[_0x9836('0x77')]]);if(_0x476bf5[_0x9836('0x9e')]===-0x1){return _0x476bf5;}return this[_0x9836('0xf')][_0x9836('0xa5')](util[_0x9836('0x54')](_0x9836('0xba'),_0x9836('0x1bf'),_0x53471f[_0x9836('0x1be')]));};AGIVertices['prototype'][_0x9836('0x1c0')]=function(_0xa56138){logger['info'](util[_0x9836('0x54')](_0x9836('0x1c1'),_0xa56138['label']));if(!this[_0x9836('0xa0')](_0xa56138['variable_id'])){return this['channel'][_0x9836('0x2b')](_0xa56138,_0x9836('0x1a4'));}var _0xe32903=this[_0x9836('0x12')][_0x9836('0x70')](this,_0xa56138[_0x9836('0xd2')]);if(!_0xe32903){return this[_0x9836('0xf')][_0x9836('0x2b')](_0xa56138,_0x9836('0xd4'));}var _0x4729d3=this[_0x9836('0xf')][_0x9836('0x12')](_0xe32903);return{'code':0xc8,'result':_0x4729d3['extra']?_0x4729d3['extra']:'-'};};String[_0x9836('0x16')][_0x9836('0x1c2')]=function(_0x2fdf1f,_0x2fda3e){return this['split'](_0x2fdf1f)[_0x9836('0x1c3')](_0x2fda3e);};module[_0x9836('0x1c4')]=AGIVertices;
\ No newline at end of file
index fb4d20b..2164618 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6632=['[%s][TIMER][STOP][AGENT:%s]','[ACW][TIMERS]','stringify','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','bind','hanguprequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','channels','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message'];(function(_0x281dde,_0x3ec0ae){var _0x353977=function(_0x27ce91){while(--_0x27ce91){_0x281dde['push'](_0x281dde['shift']());}};_0x353977(++_0x3ec0ae);}(_0x6632,0x116));var _0x2663=function(_0x3c3296,_0x319220){_0x3c3296=_0x3c3296-0x0;var _0x435899=_0x6632[_0x3c3296];return _0x435899;};'use strict';var util=require('util');var _=require(_0x2663('0x0'));var moment=require(_0x2663('0x1'));var ami=require(_0x2663('0x2'));var logger=require(_0x2663('0x3'))(_0x2663('0x4'));var RpcUser=require(_0x2663('0x5'));var RpcVoiceAgentReport=require(_0x2663('0x6'));function Acw(_0x5f5109){this[_0x2663('0x7')]=_0x5f5109[_0x2663('0x7')];this[_0x2663('0x8')]=_0x5f5109[_0x2663('0x8')];this['timers']=_0x5f5109[_0x2663('0x9')];this['channels']={};ami['on'](_0x2663('0xa'),this['syncAgentConnect'][_0x2663('0xb')](this));ami['on'](_0x2663('0xc'),this['syncHangupRequest'][_0x2663('0xb')](this));ami['on'](_0x2663('0xd'),this[_0x2663('0xe')][_0x2663('0xb')](this));ami['on'](_0x2663('0xf'),this[_0x2663('0x10')][_0x2663('0xb')](this));ami['on'](_0x2663('0x11'),this[_0x2663('0x12')][_0x2663('0xb')](this));ami['on']('blindtransfer',this[_0x2663('0x13')]['bind'](this));ami['on'](_0x2663('0x14'),this[_0x2663('0x15')][_0x2663('0xb')](this));}function getDiff(_0x1cee99){var _0x5704ac=moment()[_0x2663('0x16')](0x0);var _0x2a5e8e=moment(_0x1cee99)[_0x2663('0x16')](0x0);return _0x5704ac[_0x2663('0x17')](_0x2a5e8e,_0x2663('0x18'));}Acw[_0x2663('0x19')][_0x2663('0x1a')]=function(_0x4b92cc){try{var _0x2a4891=this;var _0x34deb6=this[_0x2663('0x1b')][_0x4b92cc][_0x2663('0x1c')];var _0xa9f74a=this['channels'][_0x4b92cc][_0x2663('0x1d')];var _0x457b30=this['voiceQueues'][_0xa9f74a];var _0x2fe8c3=![];var _0x4d48b7='ACW';if(_0x457b30[_0x2663('0x1e')]){if(_0x457b30[_0x2663('0x1f')][_0x2663('0x20')]){_0x2fe8c3=!![];_0x4d48b7=_0x457b30['mandatoryDispositionPause'][_0x2663('0x20')];}}ami[_0x2663('0x21')]({'action':_0x2663('0x22'),'interface':_0x34deb6,'paused':!![],'reason':_0x4d48b7})[_0x2663('0x23')](function(_0x4ee2ce){if(_0x2a4891[_0x2663('0x8')][_0x34deb6]){return RpcUser[_0x2663('0x24')](_0x2a4891['agents'][_0x34deb6]['id'])[_0x2663('0x23')](function(_0x5f21dc){if(_0x5f21dc&&!_0x5f21dc['voicePause']){logger[_0x2663('0x25')](_0x2663('0x26'),_0x4b92cc,_0x34deb6,_0xa9f74a);var _0x2ac71e=_0x2a4891['channels'][_0x4b92cc][_0x2663('0x27')]&&_0x2a4891['channels'][_0x4b92cc][_0x2663('0x28')]?_0x2a4891[_0x2663('0x1b')][_0x4b92cc]['destlinkedid']:_0x4b92cc;return RpcUser[_0x2663('0x29')](_0x2a4891[_0x2663('0x8')][_0x34deb6],_0x4d48b7,_0x2ac71e)[_0x2663('0x23')](function(_0x19bd60){if(!_0x2fe8c3){_0x2a4891[_0x2663('0x9')][_0x34deb6]={};logger[_0x2663('0x25')](_0x2663('0x2a'),_0x4b92cc,_0x2a4891[_0x2663('0x7')][_0xa9f74a][_0x2663('0x2b')],_0x34deb6,_0xa9f74a);_0x2a4891[_0x2663('0x9')][_0x34deb6][_0x2663('0x2c')]=setTimeout(_0x2a4891[_0x2663('0x2d')][_0x2663('0xb')](_0x2a4891,_0x34deb6),_0x2a4891[_0x2663('0x7')][_0xa9f74a][_0x2663('0x2b')]*0x3e8);_0x2a4891[_0x2663('0x9')][_0x34deb6]['lastPauseAt']=moment()['format'](_0x2663('0x2e'));_0x2a4891[_0x2663('0x9')][_0x34deb6][_0x2663('0x2f')]=_0x4b92cc;_0x2a4891['timers'][_0x34deb6][_0x2663('0x1d')]=_0xa9f74a;_0x2a4891['timers'][_0x34deb6][_0x2663('0x30')]=function(){var _0x550fdd=getDiff(_0x2a4891[_0x2663('0x9')][_0x34deb6]['lastPauseAt']);clearTimeout(_0x2a4891[_0x2663('0x9')][_0x34deb6][_0x2663('0x2c')]);_0x2a4891[_0x2663('0x9')][_0x34deb6]['timer']=![];RpcVoiceAgentReport[_0x2663('0x31')]({'acwtime':_0x550fdd},_0x2a4891['timers'][_0x34deb6][_0x2663('0x2f')],_0x34deb6)['then'](function(_0x5f26ef){logger[_0x2663('0x25')](_0x2663('0x32'),_0x4b92cc,_0x550fdd,_0x5f26ef);})[_0x2663('0x33')](function(_0x2cd0af){logger[_0x2663('0x34')](_0x2663('0x35'),_0x4b92cc,_0x2cd0af);});delete _0x2a4891[_0x2663('0x9')][_0x34deb6];};}});}else{logger[_0x2663('0x25')](_0x2663('0x36'),_0x4b92cc,_0x34deb6,_0xa9f74a);}});}})['catch'](function(_0xd14f90){logger[_0x2663('0x34')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x4b92cc,_0x2a4891['voiceQueues'][_0xa9f74a][_0x2663('0x2b')],_0x34deb6,_0xa9f74a);})[_0x2663('0x37')](function(){delete _0x2a4891[_0x2663('0x1b')][_0x4b92cc];});}catch(_0x5dc570){logger[_0x2663('0x34')](_0x2663('0x38'),_0x5dc570[_0x2663('0x39')]);}};Acw[_0x2663('0x19')][_0x2663('0x2d')]=function(_0x965b91){try{var _0x559707=this;if(_0x559707[_0x2663('0x9')][_0x965b91]){_0x559707[_0x2663('0x9')][_0x965b91][_0x2663('0x2c')]=![];var _0x5cb6fe=_0x559707[_0x2663('0x9')][_0x965b91][_0x2663('0x2f')];var _0x2d48b5=_0x559707[_0x2663('0x9')][_0x965b91][_0x2663('0x1d')];var _0x399fbd=_0x559707[_0x2663('0x7')][_0x2d48b5][_0x2663('0x2b')];logger[_0x2663('0x25')](_0x2663('0x3a'),_0x5cb6fe,_0x965b91);RpcUser['saveUnpause'](this[_0x2663('0x8')][_0x965b91]);RpcVoiceAgentReport[_0x2663('0x31')]({'acwtime':_0x399fbd,'agentacw':!![]},_0x5cb6fe,_0x965b91)[_0x2663('0x23')](function(_0x3522e1){logger[_0x2663('0x25')](_0x2663('0x32'),_0x5cb6fe,_0x399fbd,_0x3522e1);})[_0x2663('0x33')](function(_0x397283){logger[_0x2663('0x34')](_0x2663('0x35'),_0x5cb6fe,_0x397283);});}else{logger[_0x2663('0x34')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x965b91);if(_0x559707['timers']){logger[_0x2663('0x25')](_0x2663('0x3b'),JSON[_0x2663('0x3c')](_0x559707[_0x2663('0x9')]));}}}catch(_0x35c431){logger[_0x2663('0x34')]('[ACW][STOP]\x20%s',_0x35c431['message']);}};Acw['prototype'][_0x2663('0x3d')]=function(_0x2ab6eb){try{if(this[_0x2663('0x7')][_0x2ab6eb[_0x2663('0x1d')]]&&(this[_0x2663('0x7')][_0x2ab6eb[_0x2663('0x1d')]][_0x2663('0x4')]||this[_0x2663('0x7')][_0x2ab6eb['queue']][_0x2663('0x1e')])){if(this[_0x2663('0x8')][_0x2ab6eb['interface']]){this[_0x2663('0x1b')][_0x2ab6eb[_0x2663('0x2f')]]={'queue':_0x2ab6eb[_0x2663('0x1d')],'interface':_0x2ab6eb[_0x2663('0x1c')],'destlinkedid':_0x2ab6eb[_0x2663('0x28')]};}}}catch(_0x23a03b){logger['error'](_0x2663('0x3e'),_0x23a03b[_0x2663('0x39')]);}};Acw[_0x2663('0x19')][_0x2663('0x15')]=function(_0x659c82){try{if(this['voiceQueues'][_0x659c82[_0x2663('0x1d')]]&&(this[_0x2663('0x7')][_0x659c82[_0x2663('0x1d')]][_0x2663('0x4')]||this[_0x2663('0x7')][_0x659c82[_0x2663('0x1d')]]['mandatoryDisposition'])){if(this[_0x2663('0x8')][_0x659c82[_0x2663('0x1c')]]){this['channels'][_0x659c82['uniqueid']]={'queue':_0x659c82[_0x2663('0x1d')],'interface':_0x659c82[_0x2663('0x1c')]};}}}catch(_0x3cae35){logger[_0x2663('0x34')](_0x2663('0x3f'),_0x3cae35['message']);}};Acw[_0x2663('0x19')][_0x2663('0x40')]=function(_0x58038e){try{if(this[_0x2663('0x1b')][_0x58038e[_0x2663('0x2f')]]&&_[_0x2663('0x41')](this[_0x2663('0x1b')][_0x58038e[_0x2663('0x2f')]]['attended'])){logger[_0x2663('0x25')](_0x2663('0x42'),_0x58038e[_0x2663('0x2f')]);this[_0x2663('0x1a')](_0x58038e['uniqueid']);}else if(this[_0x2663('0x1b')][_0x58038e[_0x2663('0x43')]]&&_[_0x2663('0x41')](this[_0x2663('0x1b')][_0x58038e[_0x2663('0x43')]][_0x2663('0x27')])){logger[_0x2663('0x25')](_0x2663('0x44'),_0x58038e[_0x2663('0x43')]);this['startAcw'](_0x58038e[_0x2663('0x43')]);}}catch(_0x3bbb9b){logger[_0x2663('0x34')](_0x2663('0x45'),_0x3bbb9b[_0x2663('0x39')]);}};Acw[_0x2663('0x19')][_0x2663('0xe')]=function(_0x53c76d){try{if(this[_0x2663('0x1b')][_0x53c76d[_0x2663('0x2f')]]&&this[_0x2663('0x1b')][_0x53c76d[_0x2663('0x2f')]][_0x2663('0x27')]){logger[_0x2663('0x25')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x53c76d[_0x2663('0x2f')]);this[_0x2663('0x1a')](_0x53c76d[_0x2663('0x2f')]);}else if(this[_0x2663('0x1b')][_0x53c76d[_0x2663('0x43')]]&&this[_0x2663('0x1b')][_0x53c76d[_0x2663('0x43')]][_0x2663('0x27')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x53c76d[_0x2663('0x43')]);this[_0x2663('0x1a')](_0x53c76d['linkedid']);}}catch(_0x3e72da){logger[_0x2663('0x34')](_0x2663('0x46'),_0x3e72da['message']);}};Acw[_0x2663('0x19')][_0x2663('0x12')]=function(_0x545382){try{if(!_['isNil'](this[_0x2663('0x1b')][_0x545382[_0x2663('0x47')]])){this[_0x2663('0x1a')](_0x545382['transfereeuniqueid']);if(this['channels'][_0x545382['secondtransfereruniqueid']]){this[_0x2663('0x1b')][_0x545382[_0x2663('0x48')]][_0x2663('0x27')]=!![];this['channels'][_0x545382[_0x2663('0x49')]]=this[_0x2663('0x1b')][_0x545382[_0x2663('0x48')]];delete this[_0x2663('0x1b')][_0x545382['secondtransfereruniqueid']];}}else if(!_[_0x2663('0x4a')](this[_0x2663('0x1b')][_0x545382[_0x2663('0x49')]])){this[_0x2663('0x1a')](_0x545382[_0x2663('0x49')]);if(this[_0x2663('0x1b')][_0x545382[_0x2663('0x4b')]]){this['channels'][_0x545382[_0x2663('0x4b')]]['attended']=!![];this[_0x2663('0x1b')][_0x545382[_0x2663('0x47')]]=this[_0x2663('0x1b')][_0x545382[_0x2663('0x4b')]];delete this['channels'][_0x545382[_0x2663('0x4b')]];}}}catch(_0x2f510a){logger[_0x2663('0x34')](_0x2663('0x4c'),_0x2f510a[_0x2663('0x39')]);}};Acw[_0x2663('0x19')]['syncBlindTransfer']=function(_0x56af1d){try{if(this['channels'][_0x56af1d['transfereruniqueid']]){logger[_0x2663('0x25')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x2663('0x3c')](_0x56af1d[_0x2663('0x4d')]));this[_0x2663('0x1a')](_0x56af1d[_0x2663('0x4d')]);}else if(this[_0x2663('0x1b')][_0x56af1d[_0x2663('0x4e')]]){logger[_0x2663('0x25')]('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x56af1d[_0x2663('0x4e')]));this[_0x2663('0x1a')](_0x56af1d['transfererlinkedid']);}}catch(_0x1dbdd5){logger[_0x2663('0x34')](_0x2663('0x4f'),_0x1dbdd5['message']);}};Acw[_0x2663('0x19')]['syncAgentRingNoAnswer']=function(_0x2a7df9){try{if(this['voiceQueues'][_0x2a7df9['queue']]&&this[_0x2663('0x7')][_0x2a7df9[_0x2663('0x1d')]]['autopause']===_0x2663('0x50')){if(this[_0x2663('0x8')][_0x2a7df9[_0x2663('0x1c')]]){logger[_0x2663('0x25')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x2a7df9[_0x2663('0x2f')],_0x2a7df9[_0x2663('0x1c')],_0x2a7df9[_0x2663('0x1d')]);return RpcUser[_0x2663('0x29')](this['agents'][_0x2a7df9[_0x2663('0x1c')]],_0x2663('0x51'),_0x2a7df9[_0x2663('0x2f')]);}}}catch(_0x1b7834){logger[_0x2663('0x34')](_0x2663('0x52'),_0x1b7834[_0x2663('0x39')]);}};module[_0x2663('0x53')]=Acw;
\ No newline at end of file
+var _0xd44c=['[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','bind','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','mandatoryDispositionPause','name','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','timer','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','queue','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][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]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','mandatoryDisposition'];(function(_0x2ebecc,_0x529e3f){var _0x3e4dfe=function(_0x49052e){while(--_0x49052e){_0x2ebecc['push'](_0x2ebecc['shift']());}};_0x3e4dfe(++_0x529e3f);}(_0xd44c,0xc8));var _0xcd44=function(_0x5c811c,_0x313b25){_0x5c811c=_0x5c811c-0x0;var _0x5df3af=_0xd44c[_0x5c811c];return _0x5df3af;};'use strict';var util=require(_0xcd44('0x0'));var _=require('lodash');var moment=require(_0xcd44('0x1'));var ami=require(_0xcd44('0x2'));var logger=require('../../../config/logger')(_0xcd44('0x3'));var RpcUser=require(_0xcd44('0x4'));var RpcVoiceAgentReport=require(_0xcd44('0x5'));function Acw(_0xb28ead){this[_0xcd44('0x6')]=_0xb28ead[_0xcd44('0x6')];this[_0xcd44('0x7')]=_0xb28ead['agents'];this[_0xcd44('0x8')]=_0xb28ead[_0xcd44('0x8')];this[_0xcd44('0x9')]={};ami['on'](_0xcd44('0xa'),this[_0xcd44('0xb')]['bind'](this));ami['on'](_0xcd44('0xc'),this['syncHangupRequest']['bind'](this));ami['on'](_0xcd44('0xd'),this[_0xcd44('0xe')]['bind'](this));ami['on'](_0xcd44('0xf'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0xcd44('0x10'),this[_0xcd44('0x11')][_0xcd44('0x12')](this));ami['on'](_0xcd44('0x13'),this[_0xcd44('0x14')]['bind'](this));ami['on'](_0xcd44('0x15'),this[_0xcd44('0x16')]['bind'](this));}function getDiff(_0x18bc85){var _0x3a1b12=moment()[_0xcd44('0x17')](0x0);var _0x16bc26=moment(_0x18bc85)[_0xcd44('0x17')](0x0);return _0x3a1b12[_0xcd44('0x18')](_0x16bc26,_0xcd44('0x19'));}Acw[_0xcd44('0x1a')][_0xcd44('0x1b')]=function(_0x2479fc){try{var _0x110d37=this;var _0x7c17c=this[_0xcd44('0x9')][_0x2479fc][_0xcd44('0x1c')];var _0x2816ee=this[_0xcd44('0x9')][_0x2479fc]['queue'];var _0x10fc11=this[_0xcd44('0x6')][_0x2816ee];var _0x1bb918=![];var _0x4fe773='ACW';if(_0x10fc11['mandatoryDisposition']){if(_0x10fc11[_0xcd44('0x1d')][_0xcd44('0x1e')]){_0x1bb918=!![];_0x4fe773=_0x10fc11[_0xcd44('0x1d')][_0xcd44('0x1e')];}}ami['Action']({'action':'QueuePause','interface':_0x7c17c,'paused':!![],'reason':_0x4fe773})[_0xcd44('0x1f')](function(_0xcfeafb){if(_0x110d37[_0xcd44('0x7')][_0x7c17c]){return RpcUser[_0xcd44('0x20')](_0x110d37[_0xcd44('0x7')][_0x7c17c]['id'])[_0xcd44('0x1f')](function(_0x3d39fa){if(_0x3d39fa&&!_0x3d39fa[_0xcd44('0x21')]){logger[_0xcd44('0x22')](_0xcd44('0x23'),_0x2479fc,_0x7c17c,_0x2816ee);var _0x3e2b5d=_0x110d37[_0xcd44('0x9')][_0x2479fc][_0xcd44('0x24')]&&_0x110d37[_0xcd44('0x9')][_0x2479fc][_0xcd44('0x25')]?_0x110d37['channels'][_0x2479fc]['destlinkedid']:_0x2479fc;return RpcUser['savePause'](_0x110d37[_0xcd44('0x7')][_0x7c17c],_0x4fe773,_0x3e2b5d)[_0xcd44('0x1f')](function(_0x3240a9){if(!_0x1bb918){_0x110d37[_0xcd44('0x8')][_0x7c17c]={};logger[_0xcd44('0x22')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2479fc,_0x110d37[_0xcd44('0x6')][_0x2816ee]['acwTimeout'],_0x7c17c,_0x2816ee);_0x110d37[_0xcd44('0x8')][_0x7c17c][_0xcd44('0x26')]=setTimeout(_0x110d37[_0xcd44('0x27')][_0xcd44('0x12')](_0x110d37,_0x7c17c),_0x110d37['voiceQueues'][_0x2816ee][_0xcd44('0x28')]*0x3e8);_0x110d37['timers'][_0x7c17c][_0xcd44('0x29')]=moment()[_0xcd44('0x2a')](_0xcd44('0x2b'));_0x110d37[_0xcd44('0x8')][_0x7c17c]['uniqueid']=_0x2479fc;_0x110d37[_0xcd44('0x8')][_0x7c17c][_0xcd44('0x2c')]=_0x2816ee;_0x110d37[_0xcd44('0x8')][_0x7c17c]['updateAcw']=function(){var _0x334411=getDiff(_0x110d37[_0xcd44('0x8')][_0x7c17c]['lastPauseAt']);clearTimeout(_0x110d37[_0xcd44('0x8')][_0x7c17c][_0xcd44('0x26')]);_0x110d37[_0xcd44('0x8')][_0x7c17c][_0xcd44('0x26')]=![];RpcVoiceAgentReport[_0xcd44('0x2d')]({'acwtime':_0x334411},_0x110d37['timers'][_0x7c17c][_0xcd44('0x2e')],_0x7c17c)[_0xcd44('0x1f')](function(_0x2e947f){logger[_0xcd44('0x22')](_0xcd44('0x2f'),_0x2479fc,_0x334411,_0x2e947f);})[_0xcd44('0x30')](function(_0x339d05){logger[_0xcd44('0x31')](_0xcd44('0x32'),_0x2479fc,_0x339d05);});delete _0x110d37[_0xcd44('0x8')][_0x7c17c];};}});}else{logger[_0xcd44('0x22')](_0xcd44('0x33'),_0x2479fc,_0x7c17c,_0x2816ee);}});}})[_0xcd44('0x30')](function(_0x112e2b){logger[_0xcd44('0x31')](_0xcd44('0x34'),_0x2479fc,_0x110d37['voiceQueues'][_0x2816ee][_0xcd44('0x28')],_0x7c17c,_0x2816ee);})[_0xcd44('0x35')](function(){delete _0x110d37['channels'][_0x2479fc];});}catch(_0x39db11){logger['error'](_0xcd44('0x36'),_0x39db11[_0xcd44('0x37')]);}};Acw[_0xcd44('0x1a')][_0xcd44('0x27')]=function(_0x2edc6c){try{var _0x593964=this;if(_0x593964[_0xcd44('0x8')][_0x2edc6c]){_0x593964[_0xcd44('0x8')][_0x2edc6c]['timer']=![];var _0x29cbff=_0x593964[_0xcd44('0x8')][_0x2edc6c][_0xcd44('0x2e')];var _0x136d3c=_0x593964[_0xcd44('0x8')][_0x2edc6c][_0xcd44('0x2c')];var _0x5417be=_0x593964['voiceQueues'][_0x136d3c][_0xcd44('0x28')];logger['info'](_0xcd44('0x38'),_0x29cbff,_0x2edc6c);RpcUser[_0xcd44('0x39')](this[_0xcd44('0x7')][_0x2edc6c]);RpcVoiceAgentReport[_0xcd44('0x2d')]({'acwtime':_0x5417be,'agentacw':!![]},_0x29cbff,_0x2edc6c)['then'](function(_0x5a7ba3){logger[_0xcd44('0x22')](_0xcd44('0x2f'),_0x29cbff,_0x5417be,_0x5a7ba3);})[_0xcd44('0x30')](function(_0x3dca9c){logger[_0xcd44('0x31')]('[%s][UPDATE][ERRORS:%s]',_0x29cbff,_0x3dca9c);});}else{logger[_0xcd44('0x31')](_0xcd44('0x3a'),_0x2edc6c);if(_0x593964['timers']){logger[_0xcd44('0x22')](_0xcd44('0x3b'),JSON[_0xcd44('0x3c')](_0x593964['timers']));}}}catch(_0x3b83a5){logger[_0xcd44('0x31')](_0xcd44('0x3d'),_0x3b83a5[_0xcd44('0x37')]);}};Acw['prototype'][_0xcd44('0xb')]=function(_0x14385f){try{if(this['voiceQueues'][_0x14385f[_0xcd44('0x2c')]]&&(this['voiceQueues'][_0x14385f[_0xcd44('0x2c')]]['acw']||this['voiceQueues'][_0x14385f[_0xcd44('0x2c')]]['mandatoryDisposition'])){if(this[_0xcd44('0x7')][_0x14385f['interface']]){this[_0xcd44('0x9')][_0x14385f[_0xcd44('0x2e')]]={'queue':_0x14385f['queue'],'interface':_0x14385f[_0xcd44('0x1c')],'destlinkedid':_0x14385f[_0xcd44('0x25')]};}}}catch(_0x5b85bc){logger[_0xcd44('0x31')](_0xcd44('0x3e'),_0x5b85bc['message']);}};Acw['prototype'][_0xcd44('0x16')]=function(_0x370a39){try{if(this[_0xcd44('0x6')][_0x370a39['queue']]&&(this['voiceQueues'][_0x370a39['queue']][_0xcd44('0x3')]||this[_0xcd44('0x6')][_0x370a39[_0xcd44('0x2c')]][_0xcd44('0x3f')])){if(this[_0xcd44('0x7')][_0x370a39[_0xcd44('0x1c')]]){this[_0xcd44('0x9')][_0x370a39[_0xcd44('0x2e')]]={'queue':_0x370a39[_0xcd44('0x2c')],'interface':_0x370a39[_0xcd44('0x1c')]};}}}catch(_0x1e68dc){logger[_0xcd44('0x31')](_0xcd44('0x40'),_0x1e68dc[_0xcd44('0x37')]);}};Acw['prototype'][_0xcd44('0x41')]=function(_0x477c32){try{if(this[_0xcd44('0x9')][_0x477c32[_0xcd44('0x2e')]]&&_[_0xcd44('0x42')](this['channels'][_0x477c32[_0xcd44('0x2e')]]['attended'])){logger['info'](_0xcd44('0x43'),_0x477c32[_0xcd44('0x2e')]);this[_0xcd44('0x1b')](_0x477c32['uniqueid']);}else if(this['channels'][_0x477c32[_0xcd44('0x44')]]&&_[_0xcd44('0x42')](this['channels'][_0x477c32['linkedid']][_0xcd44('0x24')])){logger[_0xcd44('0x22')](_0xcd44('0x45'),_0x477c32['linkedid']);this['startAcw'](_0x477c32['linkedid']);}}catch(_0xe27e81){logger[_0xcd44('0x31')]('[ACW][syncHangupRequest]\x20%s',_0xe27e81[_0xcd44('0x37')]);}};Acw[_0xcd44('0x1a')]['syncHangup']=function(_0x13abda){try{if(this['channels'][_0x13abda[_0xcd44('0x2e')]]&&this[_0xcd44('0x9')][_0x13abda[_0xcd44('0x2e')]]['attended']){logger['info'](_0xcd44('0x46'),_0x13abda[_0xcd44('0x2e')]);this[_0xcd44('0x1b')](_0x13abda[_0xcd44('0x2e')]);}else if(this[_0xcd44('0x9')][_0x13abda[_0xcd44('0x44')]]&&this[_0xcd44('0x9')][_0x13abda[_0xcd44('0x44')]][_0xcd44('0x24')]){logger[_0xcd44('0x22')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x13abda[_0xcd44('0x44')]);this[_0xcd44('0x1b')](_0x13abda[_0xcd44('0x44')]);}}catch(_0x77f669){logger[_0xcd44('0x31')](_0xcd44('0x47'),_0x77f669[_0xcd44('0x37')]);}};Acw[_0xcd44('0x1a')][_0xcd44('0x11')]=function(_0x5db403){try{if(!_['isNil'](this[_0xcd44('0x9')][_0x5db403['transfereeuniqueid']])){this[_0xcd44('0x1b')](_0x5db403[_0xcd44('0x48')]);if(this[_0xcd44('0x9')][_0x5db403[_0xcd44('0x49')]]){this[_0xcd44('0x9')][_0x5db403['secondtransfereruniqueid']]['attended']=!![];this[_0xcd44('0x9')][_0x5db403[_0xcd44('0x4a')]]=this[_0xcd44('0x9')][_0x5db403['secondtransfereruniqueid']];delete this[_0xcd44('0x9')][_0x5db403[_0xcd44('0x49')]];}}else if(!_[_0xcd44('0x4b')](this[_0xcd44('0x9')][_0x5db403[_0xcd44('0x4a')]])){this[_0xcd44('0x1b')](_0x5db403[_0xcd44('0x4a')]);if(this[_0xcd44('0x9')][_0x5db403['origtransfereruniqueid']]){this[_0xcd44('0x9')][_0x5db403[_0xcd44('0x4c')]][_0xcd44('0x24')]=!![];this[_0xcd44('0x9')][_0x5db403['transfereeuniqueid']]=this['channels'][_0x5db403['origtransfereruniqueid']];delete this['channels'][_0x5db403[_0xcd44('0x4c')]];}}}catch(_0x4e47f9){logger[_0xcd44('0x31')](_0xcd44('0x4d'),_0x4e47f9[_0xcd44('0x37')]);}};Acw[_0xcd44('0x1a')][_0xcd44('0x14')]=function(_0x33f9fc){try{if(this[_0xcd44('0x9')][_0x33f9fc[_0xcd44('0x4e')]]){logger[_0xcd44('0x22')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x33f9fc[_0xcd44('0x4e')]));this['startAcw'](_0x33f9fc[_0xcd44('0x4e')]);}else if(this[_0xcd44('0x9')][_0x33f9fc[_0xcd44('0x4f')]]){logger[_0xcd44('0x22')](_0xcd44('0x50'),JSON[_0xcd44('0x3c')](_0x33f9fc[_0xcd44('0x4f')]));this[_0xcd44('0x1b')](_0x33f9fc['transfererlinkedid']);}}catch(_0x365652){logger[_0xcd44('0x31')](_0xcd44('0x51'),_0x365652[_0xcd44('0x37')]);}};Acw[_0xcd44('0x1a')][_0xcd44('0x52')]=function(_0x41184f){try{if(this[_0xcd44('0x6')][_0x41184f[_0xcd44('0x2c')]]&&this[_0xcd44('0x6')][_0x41184f[_0xcd44('0x2c')]][_0xcd44('0x53')]===_0xcd44('0x54')){if(this['agents'][_0x41184f[_0xcd44('0x1c')]]){logger[_0xcd44('0x22')](_0xcd44('0x55'),_0x41184f[_0xcd44('0x2e')],_0x41184f['interface'],_0x41184f['queue']);return RpcUser['savePause'](this[_0xcd44('0x7')][_0x41184f[_0xcd44('0x1c')]],_0xcd44('0x56'),_0x41184f['uniqueid']);}}}catch(_0x3aab0f){logger[_0xcd44('0x31')](_0xcd44('0x57'),_0x3aab0f[_0xcd44('0x37')]);}};module['exports']=Acw;
\ No newline at end of file
index 810eb42..4cd2b85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x46e310,_0x12c74e){var _0x3a9ae3=function(_0x1b296f){while(--_0x1b296f){_0x46e310['push'](_0x46e310['shift']());}};_0x3a9ae3(++_0x12c74e);}(_0x757a,0xde));var _0xa757=function(_0x1bf1b4,_0x23ddf7){_0x1bf1b4=_0x1bf1b4-0x0;var _0x350701=_0x757a[_0x1bf1b4];return _0x350701;};'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
+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(_0x1aca4a,_0x11b8d6){var _0x465bd5=function(_0x141a46){while(--_0x141a46){_0x1aca4a['push'](_0x1aca4a['shift']());}};_0x465bd5(++_0x11b8d6);}(_0x757a,0xde));var _0xa757=function(_0x1528b8,_0x140701){_0x1528b8=_0x1528b8-0x0;var _0x31d057=_0x757a[_0x1528b8];return _0x31d057;};'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 2d8de03..7343cfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x3b8aa4,_0xf5e302){var _0x828df9=function(_0x38da48){while(--_0x38da48){_0x3b8aa4['push'](_0x3b8aa4['shift']());}};_0x828df9(++_0xf5e302);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5e1f0f,_0x45a0e7){_0x5e1f0f=_0x5e1f0f-0x0;var _0x99c34a=_0xbdb7[_0x5e1f0f];return _0x99c34a;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client;
\ No newline at end of file
+var _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0xe706,0xa3));var _0x6e70=function(_0x499eaf,_0x560a5a){_0x499eaf=_0x499eaf-0x0;var _0x2fa121=_0xe706[_0x499eaf];return _0x2fa121;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client;
\ No newline at end of file
index b4948f8..696d408 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4026=['uniqueid','Contact','phone','number','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','VoiceQueueId','CampaignId','idHopper','firstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','dialCutDigit','queue','exports','util','lodash','moment','isNil','string','voiceQueue'];(function(_0x1b1e54,_0x505537){var _0x5642c8=function(_0x174b40){while(--_0x174b40){_0x1b1e54['push'](_0x1b1e54['shift']());}};_0x5642c8(++_0x505537);}(_0x4026,0xa6));var _0x6402=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4026[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x6402('0x0'));var _=require(_0x6402('0x1'));var moment=require(_0x6402('0x2'));function checkNameSurname(_0x445f1d,_0x22fc65,_0x3e70ba){var _0x4c656c='';if(!_[_0x6402('0x3')](_0x22fc65)&&_0x6402('0x4')===typeof _0x22fc65){_0x4c656c+=_0x22fc65;}if(!_[_0x6402('0x3')](_0x3e70ba)&&'string'===typeof _0x3e70ba){_0x4c656c+='\x20'+_0x3e70ba;}if(_0x4c656c!==''){return _0x4c656c;}return _0x445f1d;}function Action(_0x2afd9c,_0x4a2087,_0x2e3ea3){this[_0x6402('0x5')]=_0x2afd9c;this[_0x6402('0x6')]=_0x2e3ea3||undefined;this['name']=checkNameSurname(_0x4a2087[_0x6402('0x7')][_0x6402('0x8')],_0x4a2087['Contact']['firstName'],_0x4a2087[_0x6402('0x7')]['lastName']);this[_0x6402('0x9')]=_0x4a2087[_0x6402('0x8')];this['queue']=_0x2afd9c[_0x6402('0xa')];this[_0x6402('0xb')]=_0x4a2087[_0x6402('0xb')]||![];this[_0x6402('0xc')]=_0x2afd9c['type'];this['dialQueueTimeout']=_0x2afd9c[_0x6402('0xd')]||0x3;this[_0x6402('0xe')]=_0x4a2087[_0x6402('0xe')];this['countbusyretry']=_0x4a2087[_0x6402('0xf')];this[_0x6402('0x10')]=_0x4a2087['countcongestionretry'];this[_0x6402('0x11')]=_0x4a2087[_0x6402('0x11')];this['countnosuchnumberretry']=_0x4a2087[_0x6402('0x12')];this[_0x6402('0x13')]=_0x4a2087['countdropretry'];this[_0x6402('0x14')]=_0x4a2087[_0x6402('0x14')];this[_0x6402('0x15')]=_0x4a2087['countmachineretry'];this[_0x6402('0x16')]=_0x4a2087[_0x6402('0x16')];this[_0x6402('0x17')]=_0x4a2087[_0x6402('0x17')];this[_0x6402('0x18')]=_0x4a2087['ListId'];this['UserId']=_0x4a2087['UserId'];this[_0x6402('0x19')]=_0x4a2087[_0x6402('0x19')];this[_0x6402('0x1a')]=_0x4a2087[_0x6402('0x1a')];this[_0x6402('0x1b')]=_0x4a2087['id'];this['ContactFirstName']=_0x4a2087[_0x6402('0x7')][_0x6402('0x1c')]||'';this[_0x6402('0x1d')]=moment()['format'](_0x6402('0x1e'));this['callback']=_0x4a2087[_0x6402('0x1f')];this[_0x6402('0x20')]=_0x4a2087['callbackuniqueid'];this[_0x6402('0x21')]=_0x4a2087[_0x6402('0x21')];this[_0x6402('0x22')]=_0x4a2087[_0x6402('0x22')];this[_0x6402('0x23')]='';this[_0x6402('0x24')]='';}Action[_0x6402('0x25')]['getCaller']=function(){return util[_0x6402('0x26')](_0x6402('0x27'),this[_0x6402('0xa')],this['voiceQueue'][_0x6402('0x28')]>0x0?this[_0x6402('0x9')]['substring'](this[_0x6402('0x5')][_0x6402('0x28')]):this[_0x6402('0x9')]);};Action['prototype']['getQueue']=function(){return this[_0x6402('0x29')];};module[_0x6402('0x2a')]=Action;
\ No newline at end of file
+var _0x4654=['callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','queue','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x4654,0x11a));var _0x4465=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4654[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x4465('0x0'));var _=require(_0x4465('0x1'));var moment=require(_0x4465('0x2'));function checkNameSurname(_0x409507,_0x456d54,_0x2e859f){var _0x4e651a='';if(!_[_0x4465('0x3')](_0x456d54)&&_0x4465('0x4')===typeof _0x456d54){_0x4e651a+=_0x456d54;}if(!_['isNil'](_0x2e859f)&&_0x4465('0x4')===typeof _0x2e859f){_0x4e651a+='\x20'+_0x2e859f;}if(_0x4e651a!==''){return _0x4e651a;}return _0x409507;}function Action(_0x187212,_0x108667,_0x37793a){this[_0x4465('0x5')]=_0x187212;this[_0x4465('0x6')]=_0x37793a||undefined;this[_0x4465('0x7')]=checkNameSurname(_0x108667[_0x4465('0x8')][_0x4465('0x9')],_0x108667[_0x4465('0x8')][_0x4465('0xa')],_0x108667[_0x4465('0x8')][_0x4465('0xb')]);this[_0x4465('0xc')]=_0x108667[_0x4465('0x9')];this['queue']=_0x187212[_0x4465('0x7')];this['active']=_0x108667[_0x4465('0xd')]||![];this[_0x4465('0xe')]=_0x187212[_0x4465('0xe')];this[_0x4465('0xf')]=_0x187212['dialQueueTimeout']||0x3;this['scheduledat']=_0x108667['scheduledat'];this['countbusyretry']=_0x108667[_0x4465('0x10')];this['countcongestionretry']=_0x108667[_0x4465('0x11')];this[_0x4465('0x12')]=_0x108667[_0x4465('0x12')];this['countnosuchnumberretry']=_0x108667[_0x4465('0x13')];this[_0x4465('0x14')]=_0x108667['countdropretry'];this[_0x4465('0x15')]=_0x108667[_0x4465('0x15')];this[_0x4465('0x16')]=_0x108667['countmachineretry'];this['countagentrejectretry']=_0x108667[_0x4465('0x17')];this[_0x4465('0x18')]=_0x108667[_0x4465('0x18')];this['ListId']=_0x108667[_0x4465('0x19')];this[_0x4465('0x1a')]=_0x108667[_0x4465('0x1a')];this[_0x4465('0x1b')]=_0x108667['VoiceQueueId'];this[_0x4465('0x1c')]=_0x108667[_0x4465('0x1c')];this[_0x4465('0x1d')]=_0x108667['id'];this['ContactFirstName']=_0x108667[_0x4465('0x8')][_0x4465('0xa')]||'';this[_0x4465('0x1e')]=moment()[_0x4465('0x1f')](_0x4465('0x20'));this[_0x4465('0x21')]=_0x108667[_0x4465('0x21')];this['callbackuniqueid']=_0x108667[_0x4465('0x22')];this[_0x4465('0x23')]=_0x108667[_0x4465('0x23')];this[_0x4465('0x24')]=_0x108667['recallme'];this[_0x4465('0x25')]='';this[_0x4465('0x26')]='';}Action[_0x4465('0x27')][_0x4465('0x28')]=function(){return util['format'](_0x4465('0x29'),this[_0x4465('0x7')],this[_0x4465('0x5')][_0x4465('0x2a')]>0x0?this['number']['substring'](this[_0x4465('0x5')]['dialCutDigit']):this[_0x4465('0xc')]);};Action['prototype'][_0x4465('0x2b')]=function(){return this[_0x4465('0x2c')];};module['exports']=Action;
\ No newline at end of file
index 1187eb5..3058566 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x762e=['format','ringtime','holdtime','responsetime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','seconds','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','starttime','answertime'];(function(_0x3a3cd6,_0x8e111e){var _0x120930=function(_0x2a03e0){while(--_0x2a03e0){_0x3a3cd6['push'](_0x3a3cd6['shift']());}};_0x120930(++_0x8e111e);}(_0x762e,0xea));var _0xe762=function(_0x4ca4bb,_0x319153){_0x4ca4bb=_0x4ca4bb-0x0;var _0x55b3b2=_0x762e[_0x4ca4bb];return _0x55b3b2;};'use strict';var util=require(_0xe762('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x107dda,_0x59083d){var _0x509957=moment(_0x107dda)[_0xe762('0x1')](0x0);var _0x151d86=moment(_0x59083d)[_0xe762('0x1')](0x0);return _0x509957['diff'](_0x151d86,_0xe762('0x2'));}function AgentComplete(_0x9ec3dc,_0x48995a){this['state']=0x4;this[_0xe762('0x3')]=_0xe762('0x4');this[_0xe762('0x5')]=_0x9ec3dc[_0xe762('0x5')];this[_0xe762('0x6')]=_0x9ec3dc[_0xe762('0x6')];this['campaigntype']=_0x9ec3dc[_0xe762('0x6')]===_0xe762('0x7')?_0xe762('0x8'):_0x9ec3dc[_0xe762('0x6')];this[_0xe762('0x9')]=_0x9ec3dc[_0xe762('0x9')];this[_0xe762('0xa')]=_0x9ec3dc['countcongestionretry'];this[_0xe762('0xb')]=_0x9ec3dc[_0xe762('0xb')];this[_0xe762('0xc')]=_0x9ec3dc['countbusyretry']+_0x9ec3dc[_0xe762('0xa')]+_0x9ec3dc['countnoanswerretry']+_0x9ec3dc[_0xe762('0xd')]+_0x9ec3dc['countdropretry']+_0x9ec3dc[_0xe762('0xe')]+_0x9ec3dc[_0xe762('0xf')]+_0x9ec3dc[_0xe762('0x10')];this['countnosuchnumberretry']=_0x9ec3dc['countnosuchnumberretry'];this[_0xe762('0x11')]=_0x9ec3dc[_0xe762('0x11')];this[_0xe762('0xe')]=_0x9ec3dc[_0xe762('0xe')];this[_0xe762('0xf')]=_0x9ec3dc[_0xe762('0xf')];this[_0xe762('0x10')]=_0x9ec3dc[_0xe762('0x10')];this['uniqueid']=_0x48995a[_0xe762('0x12')];this[_0xe762('0x13')]=_0x9ec3dc[_0xe762('0x14')];this[_0xe762('0x15')]=_0x9ec3dc['number'];this[_0xe762('0x16')]=_0x9ec3dc[_0xe762('0x16')];this['responsetime']=_0x9ec3dc['responsetime'];this['answertime']=_0x9ec3dc[_0xe762('0x17')];this['endtime']=moment()[_0xe762('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe762('0x19')]=getSeconds(_0x9ec3dc['responsetime'],_0x9ec3dc[_0xe762('0x16')]);this[_0xe762('0x1a')]=getSeconds(_0x9ec3dc[_0xe762('0x17')],_0x9ec3dc[_0xe762('0x1b')]);this[_0xe762('0x1c')]=getSeconds(this['endtime'],_0x9ec3dc['answertime']);this['queue']=_0x48995a['queue'];this[_0xe762('0x1d')]=_0x48995a[_0xe762('0x1d')];this[_0xe762('0x1e')]=_0x48995a[_0xe762('0x1e')];this[_0xe762('0x1f')]=_0x9ec3dc['callback'];this[_0xe762('0x20')]=_0x9ec3dc[_0xe762('0x20')];this[_0xe762('0x21')]=_0x9ec3dc[_0xe762('0x21')];this[_0xe762('0x22')]=_0x9ec3dc[_0xe762('0x22')];this[_0xe762('0x23')]=_0x9ec3dc[_0xe762('0x23')];this[_0xe762('0x24')]=_0x9ec3dc[_0xe762('0x24')];this[_0xe762('0x25')]=_0x9ec3dc['UserId'];this['VoiceQueueId']=_0x9ec3dc[_0xe762('0x26')];this['CampaignId']=_0x9ec3dc[_0xe762('0x27')];this[_0xe762('0x28')]=_0x9ec3dc['originatecalleridnum']||'';this[_0xe762('0x29')]=_0x9ec3dc[_0xe762('0x29')]||'';}module[_0xe762('0x2a')]=AgentComplete;
\ No newline at end of file
+var _0x2e2c=['countdropretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','countmachineretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x204e6f,_0x2e5ffd){var _0x8813f=function(_0x423c2d){while(--_0x423c2d){_0x204e6f['push'](_0x204e6f['shift']());}};_0x8813f(++_0x2e5ffd);}(_0x2e2c,0x160));var _0xc2e2=function(_0x3a1cca,_0xf9cf7e){_0x3a1cca=_0x3a1cca-0x0;var _0x53b71c=_0x2e2c[_0x3a1cca];return _0x53b71c;};'use strict';var util=require(_0xc2e2('0x0'));var _=require(_0xc2e2('0x1'));var moment=require(_0xc2e2('0x2'));function getSeconds(_0x4307f4,_0x4752ef){var _0x3994aa=moment(_0x4307f4)[_0xc2e2('0x3')](0x0);var _0x5a32f1=moment(_0x4752ef)['milliseconds'](0x0);return _0x3994aa['diff'](_0x5a32f1,_0xc2e2('0x4'));}function AgentComplete(_0x3888d1,_0x273fdf){this[_0xc2e2('0x5')]=0x4;this[_0xc2e2('0x6')]=_0xc2e2('0x7');this['scheduledat']=_0x3888d1[_0xc2e2('0x8')];this['type']=_0x3888d1[_0xc2e2('0x9')];this[_0xc2e2('0xa')]=_0x3888d1['type']===_0xc2e2('0xb')?_0xc2e2('0xc'):_0x3888d1['type'];this[_0xc2e2('0xd')]=_0x3888d1['countbusyretry'];this[_0xc2e2('0xe')]=_0x3888d1[_0xc2e2('0xe')];this[_0xc2e2('0xf')]=_0x3888d1[_0xc2e2('0xf')];this['countglobal']=_0x3888d1['countbusyretry']+_0x3888d1[_0xc2e2('0xe')]+_0x3888d1[_0xc2e2('0xf')]+_0x3888d1['countnosuchnumberretry']+_0x3888d1[_0xc2e2('0x10')]+_0x3888d1['countabandonedretry']+_0x3888d1['countmachineretry']+_0x3888d1[_0xc2e2('0x11')];this['countnosuchnumberretry']=_0x3888d1[_0xc2e2('0x12')];this[_0xc2e2('0x10')]=_0x3888d1[_0xc2e2('0x10')];this[_0xc2e2('0x13')]=_0x3888d1[_0xc2e2('0x13')];this[_0xc2e2('0x14')]=_0x3888d1[_0xc2e2('0x14')];this[_0xc2e2('0x11')]=_0x3888d1[_0xc2e2('0x11')];this[_0xc2e2('0x15')]=_0x273fdf[_0xc2e2('0x15')];this[_0xc2e2('0x16')]=_0x3888d1['name'];this[_0xc2e2('0x17')]=_0x3888d1[_0xc2e2('0x18')];this[_0xc2e2('0x19')]=_0x3888d1[_0xc2e2('0x19')];this['responsetime']=_0x3888d1[_0xc2e2('0x1a')];this[_0xc2e2('0x1b')]=_0x3888d1['answertime'];this[_0xc2e2('0x1c')]=moment()[_0xc2e2('0x1d')](_0xc2e2('0x1e'));this[_0xc2e2('0x1f')]=getSeconds(_0x3888d1[_0xc2e2('0x1a')],_0x3888d1[_0xc2e2('0x19')]);this[_0xc2e2('0x20')]=getSeconds(_0x3888d1[_0xc2e2('0x1b')],_0x3888d1[_0xc2e2('0x1a')]);this['talktime']=getSeconds(this[_0xc2e2('0x1c')],_0x3888d1['answertime']);this[_0xc2e2('0xc')]=_0x273fdf[_0xc2e2('0xc')];this['membername']=_0x273fdf[_0xc2e2('0x21')];this[_0xc2e2('0x22')]=_0x273fdf[_0xc2e2('0x22')];this['callback']=_0x3888d1[_0xc2e2('0x23')];this['callbackuniqueid']=_0x3888d1['callbackuniqueid'];this[_0xc2e2('0x24')]=_0x3888d1['callbackat'];this[_0xc2e2('0x25')]=_0x3888d1['recallme'];this[_0xc2e2('0x26')]=_0x3888d1[_0xc2e2('0x26')];this[_0xc2e2('0x27')]=_0x3888d1[_0xc2e2('0x27')];this[_0xc2e2('0x28')]=_0x3888d1[_0xc2e2('0x28')];this['VoiceQueueId']=_0x3888d1[_0xc2e2('0x29')];this[_0xc2e2('0x2a')]=_0x3888d1['CampaignId'];this[_0xc2e2('0x2b')]=_0x3888d1[_0xc2e2('0x2b')]||'';this['originatecalleridname']=_0x3888d1[_0xc2e2('0x2c')]||'';}module[_0xc2e2('0x2d')]=AgentComplete;
\ No newline at end of file
index 20d431e..3a86100 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d17=['diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds'];(function(_0x5ac6f1,_0x5df1d4){var _0xc53891=function(_0xca8af4){while(--_0xca8af4){_0x5ac6f1['push'](_0x5ac6f1['shift']());}};_0xc53891(++_0x5df1d4);}(_0x2d17,0x17e));var _0x72d1=function(_0x2eb871,_0x452c8a){_0x2eb871=_0x2eb871-0x0;var _0xf2537a=_0x2d17[_0x2eb871];return _0xf2537a;};'use strict';var util=require(_0x72d1('0x0'));var _=require(_0x72d1('0x1'));var moment=require('moment');function getSeconds(_0x12f23c,_0x4727f9){var _0x531f4e=moment(_0x12f23c)[_0x72d1('0x2')](0x0);var _0x38fec7=moment(_0x4727f9)['milliseconds'](0x0);return _0x531f4e[_0x72d1('0x3')](_0x38fec7,'seconds');}function Final(_0x39150f){this['uniqueid']=_0x39150f[_0x72d1('0x4')];this[_0x72d1('0x5')]=_0x39150f['scheduledat'];this[_0x72d1('0x6')]=_0x39150f[_0x72d1('0x6')];this[_0x72d1('0x7')]=_0x39150f['type']===_0x72d1('0x8')?_0x72d1('0x9'):_0x39150f[_0x72d1('0x6')];this['countbusyretry']=_0x39150f[_0x72d1('0xa')];this[_0x72d1('0xb')]=_0x39150f[_0x72d1('0xb')];this[_0x72d1('0xc')]=_0x39150f[_0x72d1('0xc')];this[_0x72d1('0xd')]=_0x39150f[_0x72d1('0xa')]+_0x39150f[_0x72d1('0xb')]+_0x39150f[_0x72d1('0xc')]+_0x39150f[_0x72d1('0xe')]+_0x39150f['countdropretry']+_0x39150f[_0x72d1('0xf')]+_0x39150f[_0x72d1('0x10')]+_0x39150f[_0x72d1('0x11')];this[_0x72d1('0xe')]=_0x39150f[_0x72d1('0xe')];this[_0x72d1('0x12')]=_0x39150f[_0x72d1('0x12')];this[_0x72d1('0xf')]=_0x39150f[_0x72d1('0xf')];this[_0x72d1('0x10')]=_0x39150f[_0x72d1('0x10')];this[_0x72d1('0x11')]=_0x39150f[_0x72d1('0x11')];this['queue']=_0x39150f[_0x72d1('0x9')];this['calleridname']=_0x39150f[_0x72d1('0x13')];this[_0x72d1('0x14')]=_0x39150f['calleridnum'];this[_0x72d1('0x15')]=_0x39150f[_0x72d1('0x15')];this[_0x72d1('0x16')]=_0x39150f['responsetime'];this['endtime']=_0x39150f[_0x72d1('0x16')];this[_0x72d1('0x17')]=_0x39150f[_0x72d1('0x17')]||0x0;this[_0x72d1('0x18')]=_0x39150f[_0x72d1('0x18')]||0x0;this[_0x72d1('0x19')]=_0x39150f[_0x72d1('0x19')]||0x0;this['callback']=_0x39150f[_0x72d1('0x1a')];this['callbackuniqueid']=_0x39150f['callbackuniqueid'];this['callbackat']=_0x39150f['callbackat'];this[_0x72d1('0x1b')]=_0x39150f[_0x72d1('0x1b')];this['ContactId']=_0x39150f[_0x72d1('0x1c')];this[_0x72d1('0x1d')]=_0x39150f[_0x72d1('0x1d')];this[_0x72d1('0x1e')]=_0x39150f[_0x72d1('0x1e')];this['VoiceQueueId']=_0x39150f['VoiceQueueId'];this[_0x72d1('0x1f')]=_0x39150f[_0x72d1('0x1f')];this[_0x72d1('0x20')]=_0x39150f[_0x72d1('0x20')]||'';this[_0x72d1('0x21')]=_0x39150f[_0x72d1('0x21')]||'';}module[_0x72d1('0x22')]=Final;
\ No newline at end of file
+var _0x99c9=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue'];(function(_0x4f89d6,_0x1672dc){var _0x1e2b7d=function(_0xe17bd4){while(--_0xe17bd4){_0x4f89d6['push'](_0x4f89d6['shift']());}};_0x1e2b7d(++_0x1672dc);}(_0x99c9,0x13c));var _0x999c=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x99c9[_0x819464];return _0x49dcc0;};'use strict';var util=require(_0x999c('0x0'));var _=require(_0x999c('0x1'));var moment=require(_0x999c('0x2'));function getSeconds(_0x23d5a4,_0x2bb83d){var _0x16a7a3=moment(_0x23d5a4)[_0x999c('0x3')](0x0);var _0x52dc75=moment(_0x2bb83d)[_0x999c('0x3')](0x0);return _0x16a7a3[_0x999c('0x4')](_0x52dc75,_0x999c('0x5'));}function Final(_0x347ee0){this[_0x999c('0x6')]=_0x347ee0[_0x999c('0x6')];this[_0x999c('0x7')]=_0x347ee0[_0x999c('0x7')];this[_0x999c('0x8')]=_0x347ee0[_0x999c('0x8')];this[_0x999c('0x9')]=_0x347ee0[_0x999c('0x8')]===_0x999c('0xa')?_0x999c('0xb'):_0x347ee0['type'];this[_0x999c('0xc')]=_0x347ee0[_0x999c('0xc')];this['countcongestionretry']=_0x347ee0[_0x999c('0xd')];this[_0x999c('0xe')]=_0x347ee0[_0x999c('0xe')];this[_0x999c('0xf')]=_0x347ee0[_0x999c('0xc')]+_0x347ee0[_0x999c('0xd')]+_0x347ee0[_0x999c('0xe')]+_0x347ee0[_0x999c('0x10')]+_0x347ee0[_0x999c('0x11')]+_0x347ee0[_0x999c('0x12')]+_0x347ee0[_0x999c('0x13')]+_0x347ee0[_0x999c('0x14')];this['countnosuchnumberretry']=_0x347ee0[_0x999c('0x10')];this[_0x999c('0x11')]=_0x347ee0['countdropretry'];this['countabandonedretry']=_0x347ee0['countabandonedretry'];this[_0x999c('0x13')]=_0x347ee0[_0x999c('0x13')];this[_0x999c('0x14')]=_0x347ee0[_0x999c('0x14')];this[_0x999c('0xb')]=_0x347ee0['queue'];this[_0x999c('0x15')]=_0x347ee0[_0x999c('0x15')];this[_0x999c('0x16')]=_0x347ee0[_0x999c('0x16')];this[_0x999c('0x17')]=_0x347ee0['starttime'];this[_0x999c('0x18')]=_0x347ee0[_0x999c('0x18')];this[_0x999c('0x19')]=_0x347ee0[_0x999c('0x18')];this[_0x999c('0x1a')]=_0x347ee0['ringtime']||0x0;this[_0x999c('0x1b')]=_0x347ee0[_0x999c('0x1b')]||0x0;this[_0x999c('0x1c')]=_0x347ee0[_0x999c('0x1c')]||0x0;this[_0x999c('0x1d')]=_0x347ee0[_0x999c('0x1d')];this['callbackuniqueid']=_0x347ee0[_0x999c('0x1e')];this[_0x999c('0x1f')]=_0x347ee0[_0x999c('0x1f')];this[_0x999c('0x20')]=_0x347ee0[_0x999c('0x20')];this[_0x999c('0x21')]=_0x347ee0[_0x999c('0x21')];this[_0x999c('0x22')]=_0x347ee0[_0x999c('0x22')];this[_0x999c('0x23')]=_0x347ee0[_0x999c('0x23')];this['VoiceQueueId']=_0x347ee0[_0x999c('0x24')];this[_0x999c('0x25')]=_0x347ee0[_0x999c('0x25')];this[_0x999c('0x26')]=_0x347ee0[_0x999c('0x26')]||'';this[_0x999c('0x27')]=_0x347ee0['originatecalleridname']||'';}module[_0x999c('0x28')]=Final;
\ No newline at end of file
index b6b9a6e..aab0a74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4cf=['ListId','UserId','VoiceQueueId','CampaignId','exports','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x548200,_0x3241b8){var _0x1a6d74=function(_0x412f84){while(--_0x412f84){_0x548200['push'](_0x548200['shift']());}};_0x1a6d74(++_0x3241b8);}(_0xe4cf,0x1d9));var _0xfe4c=function(_0x594d91,_0x589ecb){_0x594d91=_0x594d91-0x0;var _0x30f528=_0xe4cf[_0x594d91];return _0x30f528;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x8cce36,_0x54ffea){var _0x3d4ae7=moment(_0x8cce36)['milliseconds'](0x0);var _0x3149bf=moment(_0x54ffea)['milliseconds'](0x0);return _0x3d4ae7['diff'](_0x3149bf,_0xfe4c('0x0'));}function Hangup(_0x3eeb7d,_0x56b0b3){this[_0xfe4c('0x1')]=0x4;this[_0xfe4c('0x2')]='Answer';this[_0xfe4c('0x3')]=_0x3eeb7d[_0xfe4c('0x3')];this[_0xfe4c('0x4')]=_0x3eeb7d[_0xfe4c('0x4')];this[_0xfe4c('0x5')]=_0x3eeb7d[_0xfe4c('0x4')]===_0xfe4c('0x6')?'queue':_0x3eeb7d[_0xfe4c('0x4')];this[_0xfe4c('0x7')]=_0x3eeb7d[_0xfe4c('0x7')];this[_0xfe4c('0x8')]=_0x3eeb7d[_0xfe4c('0x8')];this[_0xfe4c('0x9')]=_0x3eeb7d[_0xfe4c('0x9')];this[_0xfe4c('0xa')]=_0x3eeb7d[_0xfe4c('0x7')]+_0x3eeb7d[_0xfe4c('0x8')]+_0x3eeb7d[_0xfe4c('0x9')]+_0x3eeb7d['countnosuchnumberretry']+_0x3eeb7d[_0xfe4c('0xb')]+_0x3eeb7d[_0xfe4c('0xc')]+_0x3eeb7d[_0xfe4c('0xd')]+_0x3eeb7d['countagentrejectretry'];this[_0xfe4c('0xe')]=_0x3eeb7d[_0xfe4c('0xe')];this[_0xfe4c('0xb')]=_0x3eeb7d[_0xfe4c('0xb')];this[_0xfe4c('0xc')]=_0x3eeb7d[_0xfe4c('0xc')];this[_0xfe4c('0xd')]=_0x3eeb7d[_0xfe4c('0xd')];this[_0xfe4c('0xf')]=_0x3eeb7d[_0xfe4c('0xf')];this[_0xfe4c('0x10')]=_0x56b0b3[_0xfe4c('0x10')];this[_0xfe4c('0x11')]=_0x3eeb7d[_0xfe4c('0x12')];this['calleridnum']=_0x3eeb7d['number'];this[_0xfe4c('0x13')]=_0x3eeb7d[_0xfe4c('0x13')];this[_0xfe4c('0x14')]=_0x3eeb7d[_0xfe4c('0x14')];this[_0xfe4c('0x15')]=moment()[_0xfe4c('0x16')](_0xfe4c('0x17'));this[_0xfe4c('0x18')]=getSeconds(_0x3eeb7d[_0xfe4c('0x14')],_0x3eeb7d[_0xfe4c('0x13')]);this[_0xfe4c('0x19')]=0x0;this[_0xfe4c('0x1a')]=getSeconds(this[_0xfe4c('0x15')],_0x3eeb7d['responsetime']);this['queue']=_0x3eeb7d[_0xfe4c('0x1b')];this['membername']='IVR';this['reason']=_0x56b0b3[_0xfe4c('0x1c')];this[_0xfe4c('0x1d')]=_0x3eeb7d['callback'];this[_0xfe4c('0x1e')]=_0x3eeb7d['callbackuniqueid'];this['callbackat']=_0x3eeb7d[_0xfe4c('0x1f')];this[_0xfe4c('0x20')]=_0x3eeb7d[_0xfe4c('0x20')];this['ContactId']=_0x3eeb7d[_0xfe4c('0x21')];this['ListId']=_0x3eeb7d[_0xfe4c('0x22')];this['UserId']=_0x3eeb7d[_0xfe4c('0x23')];this[_0xfe4c('0x24')]=_0x3eeb7d[_0xfe4c('0x24')];this['CampaignId']=_0x3eeb7d[_0xfe4c('0x25')];}module[_0xfe4c('0x26')]=Hangup;
\ No newline at end of file
+var _0x70dc=['lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util'];(function(_0x5dbb3e,_0x4b494d){var _0x138d23=function(_0x414fb4){while(--_0x414fb4){_0x5dbb3e['push'](_0x5dbb3e['shift']());}};_0x138d23(++_0x4b494d);}(_0x70dc,0xaf));var _0xc70d=function(_0x14382e,_0x1c29f4){_0x14382e=_0x14382e-0x0;var _0x3ac508=_0x70dc[_0x14382e];return _0x3ac508;};'use strict';var util=require(_0xc70d('0x0'));var _=require(_0xc70d('0x1'));var moment=require(_0xc70d('0x2'));function getSeconds(_0x24ca65,_0x36fc99){var _0x118038=moment(_0x24ca65)[_0xc70d('0x3')](0x0);var _0x49d52c=moment(_0x36fc99)['milliseconds'](0x0);return _0x118038[_0xc70d('0x4')](_0x49d52c,_0xc70d('0x5'));}function Hangup(_0x340a7e,_0x3f6325){this[_0xc70d('0x6')]=0x4;this[_0xc70d('0x7')]=_0xc70d('0x8');this[_0xc70d('0x9')]=_0x340a7e[_0xc70d('0x9')];this[_0xc70d('0xa')]=_0x340a7e[_0xc70d('0xa')];this[_0xc70d('0xb')]=_0x340a7e[_0xc70d('0xa')]==='outbound'?_0xc70d('0xc'):_0x340a7e[_0xc70d('0xa')];this['countbusyretry']=_0x340a7e[_0xc70d('0xd')];this[_0xc70d('0xe')]=_0x340a7e[_0xc70d('0xe')];this[_0xc70d('0xf')]=_0x340a7e[_0xc70d('0xf')];this['countglobal']=_0x340a7e[_0xc70d('0xd')]+_0x340a7e[_0xc70d('0xe')]+_0x340a7e[_0xc70d('0xf')]+_0x340a7e[_0xc70d('0x10')]+_0x340a7e['countdropretry']+_0x340a7e['countabandonedretry']+_0x340a7e[_0xc70d('0x11')]+_0x340a7e[_0xc70d('0x12')];this['countnosuchnumberretry']=_0x340a7e[_0xc70d('0x10')];this['countdropretry']=_0x340a7e[_0xc70d('0x13')];this[_0xc70d('0x14')]=_0x340a7e['countabandonedretry'];this['countmachineretry']=_0x340a7e[_0xc70d('0x11')];this['countagentrejectretry']=_0x340a7e[_0xc70d('0x12')];this[_0xc70d('0x15')]=_0x3f6325[_0xc70d('0x15')];this[_0xc70d('0x16')]=_0x340a7e['name'];this[_0xc70d('0x17')]=_0x340a7e[_0xc70d('0x18')];this[_0xc70d('0x19')]=_0x340a7e[_0xc70d('0x19')];this['responsetime']=_0x340a7e[_0xc70d('0x1a')];this[_0xc70d('0x1b')]=moment()['format'](_0xc70d('0x1c'));this[_0xc70d('0x1d')]=getSeconds(_0x340a7e['responsetime'],_0x340a7e[_0xc70d('0x19')]);this['holdtime']=0x0;this[_0xc70d('0x1e')]=getSeconds(this[_0xc70d('0x1b')],_0x340a7e[_0xc70d('0x1a')]);this[_0xc70d('0xc')]=_0x340a7e['queue'];this[_0xc70d('0x1f')]='IVR';this[_0xc70d('0x20')]=_0x3f6325[_0xc70d('0x21')];this['callback']=_0x340a7e[_0xc70d('0x22')];this[_0xc70d('0x23')]=_0x340a7e[_0xc70d('0x23')];this[_0xc70d('0x24')]=_0x340a7e['callbackat'];this['recallme']=_0x340a7e[_0xc70d('0x25')];this[_0xc70d('0x26')]=_0x340a7e['ContactId'];this['ListId']=_0x340a7e[_0xc70d('0x27')];this[_0xc70d('0x28')]=_0x340a7e[_0xc70d('0x28')];this[_0xc70d('0x29')]=_0x340a7e[_0xc70d('0x29')];this[_0xc70d('0x2a')]=_0x340a7e[_0xc70d('0x2a')];}module[_0xc70d('0x2b')]=Hangup;
\ No newline at end of file
index 72486e3..7bfaa2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ab5=['util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports'];(function(_0x33c8e3,_0x311d5d){var _0x2a14bc=function(_0x48b968){while(--_0x48b968){_0x33c8e3['push'](_0x33c8e3['shift']());}};_0x2a14bc(++_0x311d5d);}(_0x0ab5,0xde));var _0x50ab=function(_0x540949,_0x1dfd05){_0x540949=_0x540949-0x0;var _0x4d5b3c=_0x0ab5[_0x540949];return _0x4d5b3c;};'use strict';var util=require(_0x50ab('0x0'));var _=require(_0x50ab('0x1'));var moment=require(_0x50ab('0x2'));function getSeconds(_0x4ae0fa,_0x211a3a){var _0x209b90=moment(_0x4ae0fa)['milliseconds'](0x0);var _0x4c25cf=moment(_0x211a3a)[_0x50ab('0x3')](0x0);return _0x209b90[_0x50ab('0x4')](_0x4c25cf,_0x50ab('0x5'));}function History(_0x1cac5b){this[_0x50ab('0x6')]=_0x1cac5b[_0x50ab('0x6')];this[_0x50ab('0x7')]=_0x1cac5b[_0x50ab('0x7')]||undefined;this[_0x50ab('0x8')]=_0x1cac5b[_0x50ab('0x8')];this['campaigntype']=_0x1cac5b[_0x50ab('0x8')]===_0x50ab('0x9')?_0x50ab('0xa'):_0x1cac5b[_0x50ab('0x8')];this[_0x50ab('0xb')]=_0x1cac5b[_0x50ab('0xb')];this[_0x50ab('0xc')]=_0x1cac5b['countcongestionretry'];this[_0x50ab('0xd')]=_0x1cac5b[_0x50ab('0xd')];this['countglobal']=_0x1cac5b[_0x50ab('0xb')]+_0x1cac5b[_0x50ab('0xc')]+_0x1cac5b['countnoanswerretry']+_0x1cac5b[_0x50ab('0xe')]+_0x1cac5b[_0x50ab('0xf')]+_0x1cac5b[_0x50ab('0x10')]+_0x1cac5b['countmachineretry']+_0x1cac5b[_0x50ab('0x11')];this[_0x50ab('0xe')]=_0x1cac5b[_0x50ab('0xe')];this['countdropretry']=_0x1cac5b['countdropretry'];this['countabandonedretry']=_0x1cac5b[_0x50ab('0x10')];this['countmachineretry']=_0x1cac5b['countmachineretry'];this[_0x50ab('0x11')]=_0x1cac5b[_0x50ab('0x11')];this[_0x50ab('0xa')]=_0x1cac5b[_0x50ab('0xa')];this[_0x50ab('0x12')]=_0x1cac5b[_0x50ab('0x13')];this[_0x50ab('0x14')]=_0x1cac5b[_0x50ab('0x15')];this[_0x50ab('0x16')]=_0x1cac5b['starttime'];this['responsetime']=_0x1cac5b[_0x50ab('0x17')];this[_0x50ab('0x18')]=_0x1cac5b[_0x50ab('0x17')];this['ringtime']=getSeconds(_0x1cac5b['responsetime'],_0x1cac5b[_0x50ab('0x16')]);this[_0x50ab('0x19')]=0x0;this[_0x50ab('0x1a')]=0x0;this[_0x50ab('0x1b')]=_0x1cac5b[_0x50ab('0x1b')];this[_0x50ab('0x1c')]=_0x1cac5b['callbackuniqueid'];this[_0x50ab('0x1d')]=_0x1cac5b['callbackat'];this['recallme']=_0x1cac5b['recallme'];this['ContactId']=_0x1cac5b[_0x50ab('0x1e')];this[_0x50ab('0x1f')]=_0x1cac5b['ListId'];this[_0x50ab('0x20')]=_0x1cac5b['UserId'];this[_0x50ab('0x21')]=_0x1cac5b[_0x50ab('0x21')];this[_0x50ab('0x22')]=_0x1cac5b[_0x50ab('0x22')];this['originatecalleridnum']=_0x1cac5b['originatecalleridnum']||'';this[_0x50ab('0x23')]=_0x1cac5b['originatecalleridname']||'';}module[_0x50ab('0x24')]=History;
\ No newline at end of file
+var _0xbb9f=['lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbb9f,0x1b7));var _0xfbb9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb9f[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xfbb9('0x0'));var _=require(_0xfbb9('0x1'));var moment=require(_0xfbb9('0x2'));function getSeconds(_0x459bc5,_0x1d97db){var _0x5e87bf=moment(_0x459bc5)[_0xfbb9('0x3')](0x0);var _0x596b70=moment(_0x1d97db)['milliseconds'](0x0);return _0x5e87bf[_0xfbb9('0x4')](_0x596b70,'seconds');}function History(_0x2470e1){this[_0xfbb9('0x5')]=_0x2470e1[_0xfbb9('0x5')];this[_0xfbb9('0x6')]=_0x2470e1[_0xfbb9('0x6')]||undefined;this[_0xfbb9('0x7')]=_0x2470e1[_0xfbb9('0x7')];this[_0xfbb9('0x8')]=_0x2470e1[_0xfbb9('0x7')]===_0xfbb9('0x9')?_0xfbb9('0xa'):_0x2470e1[_0xfbb9('0x7')];this[_0xfbb9('0xb')]=_0x2470e1['countbusyretry'];this[_0xfbb9('0xc')]=_0x2470e1[_0xfbb9('0xc')];this['countnoanswerretry']=_0x2470e1['countnoanswerretry'];this[_0xfbb9('0xd')]=_0x2470e1[_0xfbb9('0xb')]+_0x2470e1[_0xfbb9('0xc')]+_0x2470e1[_0xfbb9('0xe')]+_0x2470e1[_0xfbb9('0xf')]+_0x2470e1[_0xfbb9('0x10')]+_0x2470e1[_0xfbb9('0x11')]+_0x2470e1[_0xfbb9('0x12')]+_0x2470e1[_0xfbb9('0x13')];this[_0xfbb9('0xf')]=_0x2470e1[_0xfbb9('0xf')];this[_0xfbb9('0x10')]=_0x2470e1[_0xfbb9('0x10')];this[_0xfbb9('0x11')]=_0x2470e1['countabandonedretry'];this[_0xfbb9('0x12')]=_0x2470e1[_0xfbb9('0x12')];this[_0xfbb9('0x13')]=_0x2470e1[_0xfbb9('0x13')];this[_0xfbb9('0xa')]=_0x2470e1[_0xfbb9('0xa')];this[_0xfbb9('0x14')]=_0x2470e1[_0xfbb9('0x15')];this[_0xfbb9('0x16')]=_0x2470e1[_0xfbb9('0x17')];this[_0xfbb9('0x18')]=_0x2470e1[_0xfbb9('0x18')];this[_0xfbb9('0x19')]=_0x2470e1[_0xfbb9('0x19')];this[_0xfbb9('0x1a')]=_0x2470e1[_0xfbb9('0x19')];this[_0xfbb9('0x1b')]=getSeconds(_0x2470e1[_0xfbb9('0x19')],_0x2470e1['starttime']);this['holdtime']=0x0;this[_0xfbb9('0x1c')]=0x0;this[_0xfbb9('0x1d')]=_0x2470e1['callback'];this['callbackuniqueid']=_0x2470e1[_0xfbb9('0x1e')];this[_0xfbb9('0x1f')]=_0x2470e1['callbackat'];this[_0xfbb9('0x20')]=_0x2470e1[_0xfbb9('0x20')];this[_0xfbb9('0x21')]=_0x2470e1[_0xfbb9('0x21')];this[_0xfbb9('0x22')]=_0x2470e1[_0xfbb9('0x22')];this[_0xfbb9('0x23')]=_0x2470e1['UserId'];this[_0xfbb9('0x24')]=_0x2470e1['VoiceQueueId'];this[_0xfbb9('0x25')]=_0x2470e1['CampaignId'];this['originatecalleridnum']=_0x2470e1['originatecalleridnum']||'';this[_0xfbb9('0x26')]=_0x2470e1[_0xfbb9('0x26')]||'';}module[_0xfbb9('0x27')]=History;
\ No newline at end of file
index 14f5154..79b6743 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b96=['XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','createdAt','updatedAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','[originate][error]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countnoanswerretry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','dialNoAnswerRetryFrequency','reason\x203\x20ringing\x20no\x20answer','Busy','reason\x205\x20busy','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Success','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','dialPredictiveInterval','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','busyFactor','erlangCallToSecond','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','[Originate][historyBlacklist]','inBlackList','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\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','bluebird','moment','md5','ioredis','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/cmHopperAdditionalPhone','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','varset','syncVarSet','syncQueueMember','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','type','outbound','strategy','answered','loggedIn','sumBillable','sumDuration','sumHoldTime','total','abandoned','loggedInDb','dialMethod','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangBusyFactor','Trunk','active','callerid','format','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','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','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','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','seconds','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','length','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','talking','waiting','pTalking','sendMessageOneNotActive','available','NOT_ACTIVE','debug','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','checkIsBlackList','resolve','then','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','checkIsBlackListIvr','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','notFound','saveInDb','pick','ContactId','ListId','UserId','CampaignId','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','unmonitored','createHistory','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','state','HangupInAMD','AMD','custom:amd','Machine','countmachineretry','amd','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','[rescheduleContact][Machine]','membername','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countglobal','countcongestionretry','countdropretry','countabandonedretry','countagentrejectretry','reason19\x20machine....','createStateFinal','minutes','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agent','agiafterat','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','dialQueueProject2','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','queueCallerAbandonCreateState','add','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','syncNewExten','actionid','locked','stateinterface','rrmemory','queueBooked','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','syncQueueStatusComplete','run','[unlock][syncQueueStatusComplete]','_rr','[booked][RR]','Agent:\x20','unlockRR','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','Failure','push','Action','iftime\x20%s,%s','true','command','content','indexOf','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','launchHandleIvr','handleIvr','syncQueueSummary','dialActive','dialGlobalInterval','throttle','filter','dialPreviewRecallmeReminder','online','reachable','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','dialTimezone','[syncCampaigns]','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialAgiAfterHangupAgent','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x0b96,0xa5));var _0x60b9=function(_0x1ed010,_0x734e0b){_0x1ed010=_0x1ed010-0x0;var _0x6e22bf=_0x0b96[_0x1ed010];return _0x6e22bf;};'use strict';var util=require(_0x60b9('0x0'));var _=require(_0x60b9('0x1'));var BPromise=require(_0x60b9('0x2'));var uuid=require('uuid');var moment=require(_0x60b9('0x3'));var rr=require('rr');var md5=require(_0x60b9('0x4'));var Redis=require(_0x60b9('0x5'));var ut=require('../preview/util/util');var config=require(_0x60b9('0x6'));var logger=require(_0x60b9('0x7'))('dialer');var loggerBooked=require(_0x60b9('0x7'))(_0x60b9('0x8'));var loggerPredictive=require(_0x60b9('0x7'))(_0x60b9('0x9'));var loggerPredictiveCalls=require(_0x60b9('0x7'))(_0x60b9('0xa'));var loggerSyncQueueSummary=require(_0x60b9('0x7'))('syncQueueSummary');var ami=require(_0x60b9('0xb'));config['redis']=_['defaults'](config[_0x60b9('0xc')],{'host':_0x60b9('0xd'),'port':0x18eb});var io=require(_0x60b9('0xe'))(new Redis(config[_0x60b9('0xc')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x60b9('0xf'));var cmHopperFinal=require(_0x60b9('0x10'));var cmHopperAdditionalPhone=require(_0x60b9('0x11'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x60b9('0x12'));var RpcSetting=require(_0x60b9('0x13'));var Action=require(_0x60b9('0x14'));var History=require(_0x60b9('0x15'));var Final=require(_0x60b9('0x16'));var AgentComplete=require(_0x60b9('0x17'));var QueueCallerAbandon=require(_0x60b9('0x18'));var Hangup=require(_0x60b9('0x19'));var ipAgi=process[_0x60b9('0x1a')][_0x60b9('0x1b')]||_0x60b9('0x1c');var strategy={'rrmemory':'rrmemory','roundrobin':_0x60b9('0x1d')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x60b9('0x1e')][_0x60b9('0x1f')]=function(_0x20834a){this[_0x60b9('0x20')]=this['tail']?this[_0x60b9('0x20')][_0x60b9('0x21')](_0x20834a):_0x20834a();};function Dialer(_0x17d74c,_0x265402){this['sequence']=new Sequence();this['preview']=_0x265402;this[_0x60b9('0x22')]=_0x17d74c[_0x60b9('0x22')];this[_0x60b9('0x23')]=_0x17d74c[_0x60b9('0x23')];this[_0x60b9('0x24')]=_0x17d74c[_0x60b9('0x24')];this[_0x60b9('0x25')]=_0x17d74c['trunks'];this[_0x60b9('0x26')]=config['maxNumberOriginate']||0x2;this[_0x60b9('0x27')]={};this[_0x60b9('0x28')]={};this[_0x60b9('0x29')]={};this[_0x60b9('0x2a')]={};this['optionPredictive']={};this[_0x60b9('0x2b')]={};this[_0x60b9('0x2c')]={};this[_0x60b9('0x2d')]={};this['queueBooked']={};this[_0x60b9('0x2e')]={};ami['on']('agentconnect',this[_0x60b9('0x2f')][_0x60b9('0x30')](this));ami['on'](_0x60b9('0x31'),this[_0x60b9('0x32')][_0x60b9('0x30')](this));ami['on']('originateresponse',this[_0x60b9('0x33')][_0x60b9('0x30')](this));ami['on'](_0x60b9('0x34'),this[_0x60b9('0x35')]['bind'](this));ami['on'](_0x60b9('0x36'),this['syncQueueSummary'][_0x60b9('0x30')](this));ami['on'](_0x60b9('0x37'),this[_0x60b9('0x38')][_0x60b9('0x30')](this));ami['on'](_0x60b9('0x39'),this[_0x60b9('0x3a')][_0x60b9('0x30')](this));ami['on']('newexten',this['syncNewExten'][_0x60b9('0x30')](this));ami['on'](_0x60b9('0x3b'),this[_0x60b9('0x3c')][_0x60b9('0x30')](this));ami['on']('queuemember',this[_0x60b9('0x3d')][_0x60b9('0x30')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0x60b9('0x30')](this));this[_0x60b9('0x3e')]();this[_0x60b9('0x3f')]();RpcSetting[_0x60b9('0x40')]()['then'](function(_0x2395b9){previewRecallmeReminderInterval=_0x2395b9[_0x60b9('0x41')];});}function isNotNull(_0x322817){return _0x322817!==null&&!_[_0x60b9('0x42')](_0x322817);}function checkIsLoggedIn(_0x616121,_0x21f0ef){return function(){if(_0x21f0ef<=0x0){_0x616121[_0x60b9('0x43')]='AGENTS_NOT_LOGGED';throw _0x616121[_0x60b9('0x44')]+_0x60b9('0x45');}};}function isActive(_0x238b8e){return _0x238b8e;}function checkIsActive(_0x21eb8f,_0x27a82c){return function(){if(!isActive(_0x27a82c)){_0x21eb8f[_0x60b9('0x43')]='NOT_ACTIVE';throw _0x21eb8f['name']+_0x60b9('0x46');}};}function checkInterval(_0x77339d){return function(){if(!isNotNull(_0x77339d[_0x60b9('0x47')])){_0x77339d[_0x60b9('0x43')]=_0x60b9('0x48');throw _0x77339d['name']+_0x60b9('0x49');}if(!isNotNull(_0x77339d[_0x60b9('0x47')][_0x60b9('0x4a')])){_0x77339d['message']=_0x60b9('0x48');throw _0x77339d['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x60b9('0x4b')](_0x77339d[_0x60b9('0x47')][_0x60b9('0x4a')]))){_0x77339d[_0x60b9('0x43')]='INTERVAL_IS_NULL';throw _0x77339d[_0x60b9('0x44')]+_0x60b9('0x49');}};}function msgResponse(_0x30ec15,_0x135967,_0x397e68){return{'action':_0x30ec15,'response':_0x135967,'message':_0x397e68,'stack':_0x397e68};}function myreject(_0x585c81){return function(_0x573ab2){return _0x585c81(msgResponse(_0x60b9('0x4c'),_0x60b9('0x4d'),JSON[_0x60b9('0x4e')](_0x573ab2)));};}function getSeconds(_0x21f8dc,_0x5060e0){var _0x3c5344=moment(_0x21f8dc)[_0x60b9('0x4f')](0x0);var _0x23d4a8=moment(_0x5060e0)[_0x60b9('0x4f')](0x0);return _0x3c5344[_0x60b9('0x50')](_0x23d4a8,'seconds');}function emit(_0x178605,_0x3e84b0,_0xa97764){io['to'](_0x178605)[_0x60b9('0x51')](_0x3e84b0,_0xa97764);}function emitVoiceQueueSummary(_0x20f6e7){if(_0x20f6e7[_0x60b9('0x52')]===_0x60b9('0x53')){var _0x45482c={'id':_0x20f6e7['id'],'name':_0x20f6e7['name'],'strategy':_0x20f6e7[_0x60b9('0x54')],'answered':_0x20f6e7[_0x60b9('0x55')],'available':_0x20f6e7['available'],'loggedIn':_0x20f6e7[_0x60b9('0x56')],'pTalking':_0x20f6e7['pTalking'],'sumBillable':_0x20f6e7[_0x60b9('0x57')],'sumDuration':_0x20f6e7[_0x60b9('0x58')],'sumHoldTime':_0x20f6e7[_0x60b9('0x59')]||0x0,'talking':_0x20f6e7['talking'],'total':_0x20f6e7[_0x60b9('0x5a')],'type':_0x20f6e7['type'],'unmanaged':_0x20f6e7['unmanaged'],'abandoned':_0x20f6e7[_0x60b9('0x5b')],'waiting':_0x20f6e7['waiting'],'loggedInDb':_0x20f6e7[_0x60b9('0x5c')],'dialActive':_0x20f6e7['dialActive'],'dialMethod':_0x20f6e7[_0x60b9('0x5d')],'dialOriginateCallerIdName':_0x20f6e7['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x20f6e7['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x20f6e7['dialOriginateTimeout'],'dialPrefix':_0x20f6e7[_0x60b9('0x5e')],'outboundAnswerAgiCallsDay':_0x20f6e7[_0x60b9('0x5f')],'outboundAnswerCallsDay':_0x20f6e7[_0x60b9('0x60')],'outboundBlacklistCallsDay':_0x20f6e7['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x20f6e7[_0x60b9('0x61')],'outboundCongestionCallsDay':_0x20f6e7[_0x60b9('0x62')],'outboundDropCallsDayACS':_0x20f6e7['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x20f6e7[_0x60b9('0x63')],'outboundDropCallsDayTimeout':_0x20f6e7[_0x60b9('0x64')],'outboundNoAnswerCallsDay':_0x20f6e7['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x20f6e7[_0x60b9('0x65')],'outboundOriginateFailureCallsDay':_0x20f6e7[_0x60b9('0x66')],'outboundReCallsDay':_0x20f6e7[_0x60b9('0x67')],'outboundRejectCallsDay':_0x20f6e7[_0x60b9('0x68')],'outboundUnknownCallsDay':_0x20f6e7['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x20f6e7[_0x60b9('0x69')],'predictiveIntervalAvgHoldtime':_0x20f6e7['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x20f6e7[_0x60b9('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x20f6e7[_0x60b9('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x20f6e7[_0x60b9('0x6c')],'predictiveIntervalErlangCalls':_0x20f6e7[_0x60b9('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x20f6e7['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x20f6e7[_0x60b9('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x20f6e7['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x20f6e7[_0x60b9('0x6f')],'predictiveIntervalAvailable':_0x20f6e7['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x20f6e7[_0x60b9('0x70')],'message':_0x20f6e7[_0x60b9('0x43')],'originated':_0x20f6e7[_0x60b9('0x71')],'erlangCalls':_0x20f6e7[_0x60b9('0x72')],'erlangCallToSecond':_0x20f6e7['erlangCallToSecond'],'erlangAbandonmentRate':_0x20f6e7['erlangAbandonmentRate'],'erlangBusyFactor':_0x20f6e7[_0x60b9('0x73')],'startPredictive':_0x20f6e7[_0x60b9('0x2b')],'startProgressive':_0x20f6e7['startProgressive']};if(_0x20f6e7['Trunk']){_0x45482c[_0x60b9('0x74')]={'id':_0x20f6e7[_0x60b9('0x74')]['id'],'name':_0x20f6e7['Trunk']['name'],'active':_0x20f6e7[_0x60b9('0x74')][_0x60b9('0x75')],'callerid':_0x20f6e7[_0x60b9('0x74')][_0x60b9('0x76')]};}if(_0x20f6e7['Interval']){_0x45482c[_0x60b9('0x47')]={'id':_0x20f6e7[_0x60b9('0x47')]['id'],'name':_0x20f6e7[_0x60b9('0x47')][_0x60b9('0x44')]};}var _0x350e57=md5(JSON['stringify'](_0x45482c));if(_0x20f6e7[_0x60b9('0x4')]!==_0x350e57){_0x20f6e7[_0x60b9('0x4')]=_0x350e57;emit(util[_0x60b9('0x77')]('voice:queue:%s',_0x45482c[_0x60b9('0x44')]),_0x60b9('0x78'),_0x45482c);}}}function emitCampaignSummary(_0x2cfe24){if(_0x2cfe24['type']==='ivr'){emit(util['format'](_0x60b9('0x79'),_0x2cfe24[_0x60b9('0x44')]),_0x60b9('0x7a'),_0x2cfe24);}}function checkGetDataPredictive(_0x3eca10){if(isNotNull(_0x3eca10)&&!_[_0x60b9('0x4b')](_0x3eca10)){loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x7c'));loggerPredictive['info'](_0x60b9('0x7d'),_0x3eca10[_0x60b9('0x70')]);loggerPredictive['info'](_0x60b9('0x7e'),_0x3eca10[_0x60b9('0x69')]);loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x7f'),_0x3eca10[_0x60b9('0x6c')]);loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x80'),_0x3eca10['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x60b9('0x7b')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3eca10[_0x60b9('0x81')]);loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x82'),_0x3eca10[_0x60b9('0x6a')]);loggerPredictive['info'](_0x60b9('0x83'));if(_0x3eca10[_0x60b9('0x70')]>0x0){if(!_['isUndefined'](_0x3eca10[_0x60b9('0x6a')])&&_0x3eca10[_0x60b9('0x6a')]>0x0){return!![];}loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x84'));if(!_[_0x60b9('0x42')](_0x3eca10[_0x60b9('0x81')])&&_0x3eca10[_0x60b9('0x81')]>0x0){return!![];}loggerPredictive[_0x60b9('0x7b')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x85'));}}else{loggerPredictive[_0x60b9('0x7b')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x194b1d){return function(_0x5ea0f2){loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x86'));loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x87'),_0x5ea0f2[_0x60b9('0x72')]);loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x88'),_0x5ea0f2['erlangCallToSecond']);loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x89'),_0x5ea0f2['erlangAbandonmentRate']);loggerPredictive[_0x60b9('0x7b')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5ea0f2[_0x60b9('0x73')]);loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x89'),_0x5ea0f2[_0x60b9('0x8a')]);loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x83'));_[_0x60b9('0x8b')](_0x194b1d,_0x5ea0f2);};}function getDiff(_0x3f0a75){var _0x91eee2=moment()[_0x60b9('0x4f')](0x0);var _0x2ecdf0=moment(_0x3f0a75)['milliseconds'](0x0);return _0x91eee2['diff'](_0x2ecdf0,_0x60b9('0x8c'));}function ifInterval(_0x1ecf45,_0x3935e4){if(_[_0x60b9('0x42')](_0x3935e4)){return![];}return getDiff(_0x3935e4)<_0x1ecf45*0x3c;}function freeVariablesPredictive(_0x2985c9){if(isNotNull(_0x2985c9)){if(!_['isUndefined'](_0x2985c9[_0x60b9('0x2c')])){_0x2985c9['startProgressive']=undefined;loggerPredictive[_0x60b9('0x7b')](_0x2985c9[_0x60b9('0x44')],'clearing\x20variable\x20start\x20progressive');}if(!_['isUndefined'](_0x2985c9[_0x60b9('0x2b')])){_0x2985c9[_0x60b9('0x2b')]=undefined;loggerPredictive[_0x60b9('0x7b')](_0x2985c9['name'],_0x60b9('0x8d'));}if(!_[_0x60b9('0x42')](_0x2985c9['handlePredictive'])){clearInterval(_0x2985c9[_0x60b9('0x8e')]);_0x2985c9[_0x60b9('0x8e')]=undefined;loggerPredictive[_0x60b9('0x7b')](_0x2985c9[_0x60b9('0x44')],_0x60b9('0x8f'));}}}function erlangb(_0x76a160,_0x46dd51){if(_0x46dd51===0x0){return 0x0;}var _0x5939ee=0x1;for(var _0x321125=0x1;_0x321125<=_0x46dd51;_0x321125+=0x1){_0x5939ee=0x1+_0x5939ee*_0x321125/_0x76a160;}return 0x1/_0x5939ee;}function isVoiceQueueOutbound(_0x330a6d){return _0x330a6d==='outbound';}function isNotPreview(_0x508636){return _0x508636!==_0x60b9('0x90');}function isCampaignIvr(_0x50e6a7){return _0x50e6a7===_0x60b9('0x91');}function getCallerId(_0x4a5039,_0x3b2988,_0x5954cc){if(!_['isUndefined'](_0x5954cc)&&typeof _0x5954cc===_0x60b9('0x92')&&!_[_0x60b9('0x4b')](_0x5954cc)){if(!_[_0x60b9('0x42')](_0x3b2988)&&typeof _0x3b2988===_0x60b9('0x92')&&!_[_0x60b9('0x4b')](_0x3b2988)){return util[_0x60b9('0x77')]('\x22%s\x22\x20<%s>',_0x3b2988,_0x5954cc);}return util[_0x60b9('0x77')](_0x60b9('0x93'),_0x5954cc,_0x5954cc);}if(!_[_0x60b9('0x42')](_0x4a5039)&&typeof _0x4a5039===_0x60b9('0x92')&&!_[_0x60b9('0x4b')](_0x4a5039)){return _0x4a5039;}return _0x60b9('0x94');}function loggerCatchQueueSummary(_0x8c4353,_0x2804ef){return function(_0x417efb){freeVariablesPredictive(_0x2804ef);emitVoiceQueueSummary(_0x2804ef);emitCampaignSummary(_0x2804ef);loggerSyncQueueSummary['debug'](_0x8c4353,util[_0x60b9('0x95')](_0x417efb,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4394ef,_0x3359ed){return function(_0x58a898){loggerPredictive['error'](_0x3359ed[_0x60b9('0x44')],_0x4394ef);loggerPredictive[_0x60b9('0x96')](_0x58a898['stack']);freeVariablesPredictive(_0x3359ed);};}function loggerCatch(_0x5355f5){return function(_0x1c389a){logger['error'](_0x5355f5,util[_0x60b9('0x95')](_0x1c389a,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x52d1be){return _0x52d1be&&!_[_0x60b9('0x42')](_0x52d1be)&&_0x52d1be[_0x60b9('0x97')]>0x0;}function decremetOriginate(_0x4c0a9c){if(!_[_0x60b9('0x42')](_0x4c0a9c)&&_0x4c0a9c!==null){if(typeof _0x4c0a9c[_0x60b9('0x71')]!==_0x60b9('0x98')){if(_0x4c0a9c[_0x60b9('0x71')]>0x0){_0x4c0a9c[_0x60b9('0x71')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x60b9('0x96')](_0x60b9('0x99'));}}function checkContactLowerLimitOriginate(_0x4eab94,_0x3949c5,_0x5b6b38){if(_0x3949c5>_0x5b6b38){for(var _0x1cb500=0x0;_0x1cb500<_0x3949c5-_0x5b6b38;_0x1cb500+=0x1){decremetOriginate(_0x4eab94);}}}function loggerGetContactDialer(_0x56e077,_0x1e64e3,_0x28fe49){return function(_0x4678c){checkContactLowerLimitOriginate(_0x1e64e3,_0x28fe49,0x0);logger[_0x60b9('0x96')](_0x56e077,util[_0x60b9('0x95')](_0x4678c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1131de){return function(_0x46fc68){if(isNotNull(_0x46fc68)&&isNotNull(_0x46fc68[0x0])){if(_0x46fc68[0x0][_0x60b9('0x9a')]>0x0){_0x1131de[_0x60b9('0x43')]=_0x60b9('0x9b');logger['info'](_0x60b9('0x9c')+_0x1131de[_0x60b9('0x44')],_0x46fc68[0x0][_0x60b9('0x9a')],'contacts');}else{_0x1131de[_0x60b9('0x43')]=_0x60b9('0x9d');logger['info'](_0x60b9('0x9e')+_0x1131de[_0x60b9('0x44')]);}}};}function notSendMessagesQueue(_0x54e9f8){if(_0x54e9f8['sendMessageOneNotActive']){freeVariablesPredictive(_0x54e9f8);if(_0x54e9f8[_0x60b9('0x71')]===0x0&&_0x54e9f8[_0x60b9('0x9f')]===0x0&&_0x54e9f8[_0x60b9('0xa0')]===0x0&&(_0x54e9f8[_0x60b9('0xa1')]||0x0)===0x0){_0x54e9f8[_0x60b9('0xa2')]=![];_0x54e9f8[_0x60b9('0xa3')]=0x0;_0x54e9f8['message']=_0x60b9('0xa4');loggerSyncQueueSummary[_0x60b9('0xa5')](_0x60b9('0xa6'),_0x54e9f8[_0x60b9('0x44')],_0x60b9('0xa7'));}else{_0x54e9f8[_0x60b9('0x43')]=_0x60b9('0xa8');loggerSyncQueueSummary[_0x60b9('0xa5')](_0x60b9('0xa6'),_0x54e9f8[_0x60b9('0x44')],'is\x20disactive');}emitVoiceQueueSummary(_0x54e9f8);}}function notSendMessagesCampaign(_0x24f236){if(_0x24f236['sendMessageOneNotActive']){if(_0x24f236[_0x60b9('0x71')]===0x0){_0x24f236[_0x60b9('0xa2')]=![];_0x24f236['message']=_0x60b9('0xa4');loggerSyncQueueSummary[_0x60b9('0xa5')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x24f236[_0x60b9('0x44')],'is\x20not\x20active');}else{_0x24f236[_0x60b9('0x43')]=_0x60b9('0xa8');loggerSyncQueueSummary[_0x60b9('0xa5')](_0x60b9('0xa9'),_0x24f236[_0x60b9('0x44')],'is\x20disactive');}emitCampaignSummary(_0x24f236);}}function createObjHistory(_0xc2e937,_0x54627c,_0x4d1b38,_0x290ba3,_0x2721d0){_0xc2e937[_0x60b9('0x43')]=_0x4d1b38;var _0x54520e=new Action(_0xc2e937,_0x54627c);var _0x1ec2f1=new History(_0x54520e);_0x1ec2f1['state']=_0x290ba3;_0x1ec2f1[_0x60b9('0xaa')]=_0x2721d0;_0x1ec2f1[_0x60b9('0xab')]=_0x54520e[_0x60b9('0xac')];return _0x1ec2f1;}Dialer['prototype'][_0x60b9('0x3f')]=function(){var _0x24691c=this;setInterval(function(){_0x24691c[_0x60b9('0xad')](_0x24691c[_0x60b9('0x2a')],_0x60b9('0xae'));_0x24691c[_0x60b9('0xad')](_0x24691c['actions'],_0x60b9('0xaf'));},0x32c8);};Dialer['prototype'][_0x60b9('0xad')]=function(_0x1909dd,_0xd072be){var _0x2a77de=this;for(var _0x3176fb in _0x1909dd){if(typeof _0x1909dd[_0x3176fb]!==_0x60b9('0x98')){this['sequence'][_0x60b9('0x1f')](function(){if(!_['isNil'](_0x1909dd[_0x3176fb])){return ami['Action']({'action':_0x60b9('0xb0'),'channel':_0x1909dd[_0x3176fb][_0x60b9('0xb1')]})[_0x60b9('0xb2')](function(_0x4791c8){if(_0x4791c8[_0x60b9('0x43')]===_0x60b9('0xb3')){setTimeout(function(){if(_0x1909dd[_0x3176fb]&&_0x1909dd[_0x3176fb][_0x60b9('0x52')]!==_0x60b9('0x91')){_0x2a77de[_0x60b9('0xb4')](_0x2a77de[_0x60b9('0x22')][_0x1909dd[_0x3176fb][_0x60b9('0xb5')]]);logger[_0x60b9('0x96')](_0x60b9('0xb6'),_0xd072be,_0x3176fb,_0x1909dd[_0x3176fb][_0x60b9('0xb5')]);delete _0x1909dd[_0x3176fb];}if(_0x1909dd[_0x3176fb]&&_0x1909dd[_0x3176fb][_0x60b9('0x52')]===_0x60b9('0x91')){_0x2a77de['updateOriginated'](_0x2a77de[_0x60b9('0x23')][_0x1909dd[_0x3176fb][_0x60b9('0xb5')]]);logger[_0x60b9('0x96')](_0x60b9('0xb7'),_0xd072be,_0x3176fb,_0x1909dd[_0x3176fb][_0x60b9('0xb5')]);delete _0x1909dd[_0x3176fb];}},0x2328);}});}});}}};Dialer[_0x60b9('0x1e')]['countReScheduled']=function(_0x4ab0c2){return BPromise['resolve']()['then'](cmHopper[_0x60b9('0xb8')](_0x4ab0c2))[_0x60b9('0xb2')](loggerCatch(_0x60b9('0xb9')));};Dialer[_0x60b9('0x1e')][_0x60b9('0xba')]=function(_0x4fd76e){return BPromise[_0x60b9('0xbb')]()[_0x60b9('0xbc')](cmHopperBlack[_0x60b9('0xba')](_0x4fd76e))['catch'](loggerCatch(_0x60b9('0xbd')));};Dialer[_0x60b9('0x1e')][_0x60b9('0xbe')]=function(_0x47475a,_0x52f56e,_0x485434){return BPromise[_0x60b9('0xbb')]()[_0x60b9('0xbc')](cmHopperAdditionalPhone[_0x60b9('0xbe')](_0x47475a,_0x52f56e,_0x485434))[_0x60b9('0xb2')](loggerCatch(_0x60b9('0xbf')));};Dialer[_0x60b9('0x1e')][_0x60b9('0xc0')]=function(_0x154082,_0x4e5215,_0x5ba673){return BPromise[_0x60b9('0xbb')]()['then'](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x154082,_0x4e5215,_0x5ba673))[_0x60b9('0xb2')](loggerCatch('[swapAdditionalPhone]\x20'));};Dialer[_0x60b9('0x1e')][_0x60b9('0xc1')]=function(_0x4a17fb){return BPromise[_0x60b9('0xbb')]()[_0x60b9('0xbc')](cmHopperBlack[_0x60b9('0xc1')](_0x4a17fb))[_0x60b9('0xb2')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x60b9('0x1e')]['averageHandleTime']=function(_0x2b7c31){return BPromise[_0x60b9('0xbb')]()[_0x60b9('0xbc')](cmHopperHistory[_0x60b9('0xc2')](_0x2b7c31))[_0x60b9('0xb2')](loggerCatch(_0x60b9('0xc3')));};Dialer[_0x60b9('0x1e')][_0x60b9('0xc4')]=function(_0x5a6c62){return BPromise['resolve']()['then'](cmHopper[_0x60b9('0xc4')](_0x5a6c62))[_0x60b9('0xb2')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype'][_0x60b9('0xc5')]=function(_0x1f0df7,_0x340e34,_0x1b8550){return BPromise[_0x60b9('0xbb')]()[_0x60b9('0xbc')](cmHopper['unlockContact'](_0x1f0df7,_0x340e34,_0x1b8550))[_0x60b9('0xb2')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x60b9('0x1e')][_0x60b9('0xc6')]=function(_0x234bec,_0x32482c,_0x1dafbc,_0x1a0ec3,_0x4ad508){return BPromise[_0x60b9('0xbb')]()[_0x60b9('0xbc')](cmHopper[_0x60b9('0xc6')](_0x234bec,_0x32482c,_0x1dafbc,_0x1a0ec3))[_0x60b9('0xb2')](function(_0x19b7ab){_0x4ad508[_0x60b9('0xc7')]-=_0x1dafbc;_0x4ad508[_0x60b9('0xc7')]=_0x4ad508[_0x60b9('0xc7')]>0x0?_0x4ad508['temp']:0x0;loggerCatch(_0x60b9('0xc8'))(_0x19b7ab);});};Dialer[_0x60b9('0x1e')][_0x60b9('0xc9')]=function(_0x27a302,_0x157354,_0x11a9f5,_0x5ee17e){return BPromise[_0x60b9('0xbb')]()[_0x60b9('0xbc')](cmHopper[_0x60b9('0xc9')](_0x27a302,_0x157354,_0x11a9f5))['catch'](function(_0x25395c){_0x5ee17e['temp']-=_0x157354;_0x5ee17e[_0x60b9('0xc7')]=_0x5ee17e[_0x60b9('0xc7')]>0x0?_0x5ee17e['temp']:0x0;loggerCatch(_0x60b9('0xca'))(_0x25395c);});};Dialer[_0x60b9('0x1e')][_0x60b9('0xcb')]=function(_0x46d2b2){return BPromise[_0x60b9('0xbb')]()[_0x60b9('0xbc')](voiceQueueRt[_0x60b9('0xcb')](_0x46d2b2))['catch'](loggerCatch(_0x60b9('0xcc')));};Dialer[_0x60b9('0x1e')][_0x60b9('0xcd')]=function(_0x398b61){return BPromise['resolve']()[_0x60b9('0xbc')](cmHopper[_0x60b9('0xcd')](_0x398b61))['catch'](loggerCatch(_0x60b9('0xce')));};Dialer[_0x60b9('0x1e')]['createHistory']=function(_0x1aa881){return BPromise[_0x60b9('0xbb')]()[_0x60b9('0xbc')](cmHopperHistory['createHistory'](_0x1aa881))[_0x60b9('0xb2')](loggerCatch('[createHistory]\x20'));};Dialer[_0x60b9('0x1e')][_0x60b9('0xb4')]=function(_0x31c080){if(!_[_0x60b9('0x42')](_0x31c080)&&_0x31c080!==null){if(typeof _0x31c080[_0x60b9('0x71')]!=='undefined'){if(_0x31c080[_0x60b9('0x71')]>0x0){_0x31c080[_0x60b9('0x71')]-=0x1;}else{logger[_0x60b9('0x96')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x60b9('0x1e')]['loggerHandler']=function(_0x316ced,_0x3054ba){var _0x1bdfc1=this;return function(_0x43e881){_0x1bdfc1[_0x60b9('0xb4')](_0x3054ba);logger[_0x60b9('0x96')](_0x316ced,util['inspect'](_0x43e881,{'showHidden':![],'depth':null}));};};Dialer[_0x60b9('0x1e')]['emptyContact']=function(_0x251529,_0x5ebead,_0x40a311){var _0x2eeea5={'state':0x19,'statedesc':_0x60b9('0xcf')};this[_0x60b9('0xb4')](_0x5ebead);this[_0x60b9('0xd0')](_['merge'](_0x2eeea5,_[_0x60b9('0xd1')](_0x40a311,[_0x60b9('0xd2'),_0x60b9('0xd3'),_0x60b9('0xd4'),'VoiceQueueId',_0x60b9('0xd5')])),'[emptyContact][createHistory]',_0x60b9('0xd6'));logger[_0x60b9('0x96')](_0x251529);};Dialer[_0x60b9('0x1e')][_0x60b9('0xd7')]=function(_0x336a2b){return _0x336a2b==='Success';};Dialer[_0x60b9('0x1e')][_0x60b9('0xd8')]=function(_0x11bd60){return!_[_0x60b9('0x42')](_0x11bd60)&&_0x11bd60&&!_[_0x60b9('0x42')](_0x11bd60['name'])&&!_[_0x60b9('0x42')](_0x11bd60['active'])&&_0x11bd60[_0x60b9('0x75')]&&(this[_0x60b9('0x25')][util['format'](_0x60b9('0xd9'),_0x11bd60[_0x60b9('0x44')])][_0x60b9('0xb0')]==='reachable'||this[_0x60b9('0x25')][util[_0x60b9('0x77')](_0x60b9('0xd9'),_0x11bd60[_0x60b9('0x44')])][_0x60b9('0xb0')]===_0x60b9('0xda'));};Dialer[_0x60b9('0x1e')][_0x60b9('0xd0')]=function(_0x71b48c,_0x33f39a,_0x902e7f){this[_0x60b9('0xdb')](_0x71b48c)['catch'](loggerCatch(_0x33f39a));this[_0x60b9('0xcd')](_0x71b48c)[_0x60b9('0xb2')](loggerCatch(_0x902e7f));};Dialer[_0x60b9('0x1e')]['syncVarSet']=function(_0x1ac50d){var _0x47ca9d=this[_0x60b9('0x2a')][_0x1ac50d[_0x60b9('0xdc')]];var _0x3c36ee;if(!_[_0x60b9('0xdd')](_0x1ac50d)&&!_[_0x60b9('0xdd')](_0x1ac50d[_0x60b9('0xde')])&&!_[_0x60b9('0xdd')](_0x1ac50d['variable'][_0x60b9('0xdf')])&&_0x1ac50d[_0x60b9('0xe0')]===_0x60b9('0xe1')&&_0x47ca9d){if(_0x47ca9d[_0x60b9('0x52')]!==_0x60b9('0x91')&&this[_0x60b9('0x22')][_0x47ca9d[_0x60b9('0xb5')]][_0x60b9('0xe2')]&&_0x1ac50d[_0x60b9('0xe3')]===_0x60b9('0xe4')){delete this['uniqueId'][_0x1ac50d[_0x60b9('0xdc')]];this[_0x60b9('0xb4')](this['voiceQueues'][_0x47ca9d['queue']]);this['voiceQueues'][_0x47ca9d[_0x60b9('0xb5')]][_0x60b9('0x60')]+=0x1;this[_0x60b9('0x22')][_0x47ca9d[_0x60b9('0xb5')]]['outboundAnswerAgiCallsDay']+=0x1;_0x3c36ee=new Hangup(_0x47ca9d,_0x1ac50d);_0x3c36ee[_0x60b9('0xe5')]=0x12;_0x3c36ee['statedesc']=_0x60b9('0xe6');_0x3c36ee['membername']=_0x60b9('0xe7');ami[_0x60b9('0x51')](_0x60b9('0xe8'),ut['buildObj'](_0x3c36ee,'amd'));this[_0x60b9('0xd0')](_0x3c36ee,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0x47ca9d['type']!==_0x60b9('0x91')&&this[_0x60b9('0x22')][_0x47ca9d[_0x60b9('0xb5')]][_0x60b9('0xe2')]&&_0x1ac50d[_0x60b9('0xe3')]==='MACHINE'){var _0x4da186=this;return new BPromise(function(_0x1d77ab,_0x58135a){delete _0x4da186['uniqueId'][_0x1ac50d[_0x60b9('0xdc')]];_0x4da186['updateOriginated'](_0x4da186[_0x60b9('0x22')][_0x47ca9d[_0x60b9('0xb5')]]);_0x4da186[_0x60b9('0x22')][_0x47ca9d[_0x60b9('0xb5')]][_0x60b9('0x60')]+=0x1;_0x4da186[_0x60b9('0x22')][_0x47ca9d[_0x60b9('0xb5')]][_0x60b9('0x5f')]+=0x1;var _0x28ca5d=_0x4da186[_0x60b9('0x22')][_0x47ca9d['queue']];var _0x25712d=new Hangup(_0x47ca9d,_0x1ac50d);_0x25712d['state']=0x13;_0x25712d['statedesc']=_0x60b9('0xe9');_0x25712d['membername']=_0x60b9('0xe7');_0x25712d[_0x60b9('0xea')]+=0x1;_0x25712d['countglobal']+=0x1;_0x25712d[_0x60b9('0xeb')]=!![];ami[_0x60b9('0x51')](_0x60b9('0xe8'),ut[_0x60b9('0xec')](_0x25712d,_0x60b9('0xeb')));_0x4da186[_0x60b9('0xdb')](_0x25712d)['catch'](loggerCatch(_0x60b9('0xed')));if(_0x25712d[_0x60b9('0xee')]+_0x25712d['countcongestionretry']+_0x25712d['countnoanswerretry']+_0x25712d[_0x60b9('0xef')]+_0x25712d['countdropretry']+_0x25712d['countabandonedretry']+_0x25712d['countmachineretry']+_0x25712d['countagentrejectretry']>=_0x28ca5d[_0x60b9('0xf0')]){_0x4da186[_0x60b9('0xf1')](_0x25712d,_0x1d77ab,_0x58135a,'reason19\x20machine....');}else{if(_0x25712d[_0x60b9('0xea')]>=_0x28ca5d[_0x60b9('0xf2')]){_0x4da186['createStateFinal'](_0x25712d,_0x1d77ab,_0x58135a,_0x60b9('0xf3'));}else{_0x4da186[_0x60b9('0xc4')]({'active':![],'countmachineretry':_0x25712d[_0x60b9('0xea')],'scheduledat':moment()['add'](_0x28ca5d[_0x60b9('0xf4')],'minutes')[_0x60b9('0x77')](_0x60b9('0xf5')),'ContactId':_0x25712d[_0x60b9('0xd2')],'ListId':_0x25712d['ListId'],'VoiceQueueId':_0x25712d[_0x60b9('0xf6')]||undefined,'CampaignId':_0x25712d[_0x60b9('0xd5')]||undefined})[_0x60b9('0xb2')](loggerCatch(_0x60b9('0xf7')));_0x1d77ab({'reschedule':0x1});}}});}if(_0x47ca9d[_0x60b9('0x52')]===_0x60b9('0x91')&&this[_0x60b9('0x23')][_0x47ca9d['queue']][_0x60b9('0xe2')]&&_0x1ac50d[_0x60b9('0xe3')]==='HANGUP'){delete this[_0x60b9('0x2a')][_0x1ac50d[_0x60b9('0xdc')]];this[_0x60b9('0xb4')](this[_0x60b9('0x23')][_0x47ca9d['queue']]);_0x3c36ee=new Hangup(_0x47ca9d,_0x1ac50d);_0x3c36ee['state']=0x12;_0x3c36ee['statedesc']=_0x60b9('0xe6');_0x3c36ee[_0x60b9('0xf8')]=_0x60b9('0xe7');ami[_0x60b9('0x51')]('custom:amd',ut[_0x60b9('0xec')](_0x3c36ee,_0x60b9('0xeb')));this[_0x60b9('0xd0')](_0x3c36ee,_0x60b9('0xf9'),_0x60b9('0xfa'));}if(_0x47ca9d['type']===_0x60b9('0x91')&&this['campaigns'][_0x47ca9d[_0x60b9('0xb5')]]['dialAMDActive']&&_0x1ac50d[_0x60b9('0xe3')]==='MACHINE'){var _0x4da186=this;return new BPromise(function(_0x30cbee,_0x2fbcc4){delete _0x4da186[_0x60b9('0x2a')][_0x1ac50d[_0x60b9('0xdc')]];_0x4da186[_0x60b9('0xb4')](_0x4da186[_0x60b9('0x23')][_0x47ca9d[_0x60b9('0xb5')]]);_0x4da186[_0x60b9('0x23')][_0x47ca9d['queue']]['outboundAnswerCallsDay']+=0x1;_0x4da186[_0x60b9('0x23')][_0x47ca9d[_0x60b9('0xb5')]][_0x60b9('0x5f')]+=0x1;var _0x5fb9a0=_0x4da186['campaigns'][_0x47ca9d[_0x60b9('0xb5')]];var _0x27cca9=new Hangup(_0x47ca9d,_0x1ac50d);_0x27cca9[_0x60b9('0xe5')]=0x13;_0x27cca9['statedesc']=_0x60b9('0xe9');_0x27cca9[_0x60b9('0xf8')]=_0x60b9('0xe7');_0x27cca9['countmachineretry']+=0x1;_0x27cca9[_0x60b9('0xfb')]+=0x1;_0x27cca9[_0x60b9('0xeb')]=!![];ami['emit'](_0x60b9('0xe8'),ut[_0x60b9('0xec')](_0x27cca9,_0x60b9('0xeb')));_0x4da186[_0x60b9('0xdb')](_0x27cca9)[_0x60b9('0xb2')](loggerCatch(_0x60b9('0xed')));if(_0x27cca9[_0x60b9('0xee')]+_0x27cca9[_0x60b9('0xfc')]+_0x27cca9['countnoanswerretry']+_0x27cca9['countnosuchnumberretry']+_0x27cca9[_0x60b9('0xfd')]+_0x27cca9[_0x60b9('0xfe')]+_0x27cca9[_0x60b9('0xea')]+_0x27cca9[_0x60b9('0xff')]>=_0x5fb9a0[_0x60b9('0xf0')]){_0x4da186[_0x60b9('0xf1')](_0x27cca9,_0x30cbee,_0x2fbcc4,_0x60b9('0x100'));}else{if(_0x27cca9[_0x60b9('0xea')]>=_0x5fb9a0['dialMachineMaxRetry']){_0x4da186[_0x60b9('0x101')](_0x27cca9,_0x30cbee,_0x2fbcc4,_0x60b9('0xf3'));}else{_0x4da186[_0x60b9('0xc4')]({'active':![],'countmachineretry':_0x27cca9[_0x60b9('0xea')],'scheduledat':moment()['add'](_0x5fb9a0[_0x60b9('0xf4')],_0x60b9('0x102'))[_0x60b9('0x77')](_0x60b9('0xf5')),'ContactId':_0x27cca9[_0x60b9('0xd2')],'ListId':_0x27cca9[_0x60b9('0xd3')],'VoiceQueueId':_0x27cca9[_0x60b9('0xf6')]||undefined,'CampaignId':_0x27cca9[_0x60b9('0xd5')]||undefined})[_0x60b9('0xb2')](loggerCatch(_0x60b9('0xf7')));_0x30cbee({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x60b9('0x3a')]=function(_0x2f407c){var _0x3c0c91=this['uniqueId'][_0x2f407c[_0x60b9('0xdc')]];var _0x502d39=this;var _0x21d72c;if(_0x3c0c91&&_0x3c0c91[_0x60b9('0x52')]===_0x60b9('0x91')){delete this[_0x60b9('0x2a')][_0x2f407c[_0x60b9('0xdc')]];this['updateOriginated'](this[_0x60b9('0x23')][_0x3c0c91['queue']]);this[_0x60b9('0x23')][_0x3c0c91[_0x60b9('0xb5')]][_0x60b9('0x103')]+=0x1;_0x21d72c=new Hangup(_0x3c0c91,_0x2f407c);this[_0x60b9('0xdb')](_0x21d72c)[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x104')));this[_0x60b9('0xcd')](_0x21d72c)['catch'](loggerCatch(_0x60b9('0x105')));}if(_0x3c0c91&&_0x3c0c91[_0x60b9('0x52')]!==_0x60b9('0x91')&&isNotNull(this[_0x60b9('0x22')][_0x3c0c91['queue']][_0x60b9('0x106')])){delete this[_0x60b9('0x2a')][_0x2f407c['uniqueid']];this[_0x60b9('0xb4')](this['voiceQueues'][_0x3c0c91[_0x60b9('0xb5')]]);this[_0x60b9('0x22')][_0x3c0c91[_0x60b9('0xb5')]]['outboundAnswerCallsDay']+=0x1;this[_0x60b9('0x22')][_0x3c0c91[_0x60b9('0xb5')]][_0x60b9('0x5f')]+=0x1;_0x21d72c=new Hangup(_0x3c0c91,_0x2f407c);_0x21d72c[_0x60b9('0xe5')]=0x10;_0x21d72c[_0x60b9('0xaa')]=_0x60b9('0x107');_0x21d72c['membername']=_0x60b9('0x108');this[_0x60b9('0xdb')](_0x21d72c)[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x104')));this['moveContactManagedDialer'](_0x21d72c)[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x105')));}if(_0x3c0c91&&_0x3c0c91['type']!=='ivr'&&!isNotNull(this[_0x60b9('0x22')][_0x3c0c91[_0x60b9('0xb5')]][_0x60b9('0x106')])){delete this[_0x60b9('0x2a')][_0x2f407c[_0x60b9('0xdc')]];this[_0x60b9('0xb4')](this['voiceQueues'][_0x3c0c91['queue']]);this[_0x60b9('0x22')][_0x3c0c91[_0x60b9('0xb5')]]['outboundUnknownCallsDay']+=0x1;_0x21d72c=new Hangup(_0x3c0c91,_0x2f407c);_0x21d72c['state']=0xc;_0x21d72c[_0x60b9('0xaa')]=_0x2f407c[_0x60b9('0x109')];_0x21d72c[_0x60b9('0xf8')]=_0x60b9('0x10a');this['createHistory'](_0x21d72c)[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x104')));this[_0x60b9('0xcd')](_0x21d72c)[_0x60b9('0xb2')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x60b9('0x1e')][_0x60b9('0x35')]=function(_0x3ad7b6){var _0x22e72b=this[_0x60b9('0x2a')][_0x3ad7b6['uniqueid']];var _0x224046=this;if(this[_0x60b9('0x22')][_0x3ad7b6['queue']]){if(_0x22e72b&&_0x22e72b[_0x60b9('0x52')]!=='ivr'){delete this[_0x60b9('0x2a')][_0x3ad7b6[_0x60b9('0xdc')]];this[_0x60b9('0x22')][_0x3ad7b6[_0x60b9('0xb5')]][_0x60b9('0x60')]+=0x1;var _0x8e50dc=new AgentComplete(_0x22e72b,_0x3ad7b6);if(_0x3ad7b6[_0x60b9('0x10b')]===_0x60b9('0x10c')){_0x8e50dc[_0x60b9('0x10d')]=this[_0x60b9('0x22')][_0x3ad7b6[_0x60b9('0xb5')]]['dialQueueProject2']&&this['voiceQueues'][_0x3ad7b6[_0x60b9('0xb5')]]['dialAgiAfterHangupAgent']?moment()[_0x60b9('0x77')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x60b9('0xdb')](_0x8e50dc)[_0x60b9('0xb2')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x60b9('0xcd')](_0x8e50dc)[_0x60b9('0xb2')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0x60b9('0x2f')]=function(_0x5e362e){if(this[_0x60b9('0x22')][_0x5e362e[_0x60b9('0xb5')]]){if(this['uniqueId'][_0x5e362e[_0x60b9('0xdc')]]&&this[_0x60b9('0x2a')][_0x5e362e['uniqueid']]['type']!==_0x60b9('0x91')){this['updateOriginated'](this[_0x60b9('0x22')][_0x5e362e[_0x60b9('0xb5')]]);this[_0x60b9('0x2a')][_0x5e362e[_0x60b9('0xdc')]][_0x60b9('0x10e')]=moment()[_0x60b9('0x77')](_0x60b9('0xf5'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x1449b6,_0x3b938d){this[_0x60b9('0xdb')](_0x1449b6)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x3b938d==0x0){this[_0x60b9('0xcd')](_0x1449b6)[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x10f')));}};Dialer['prototype'][_0x60b9('0x32')]=function(_0x49e377){var _0xa0d925=this[_0x60b9('0x2a')][_0x49e377[_0x60b9('0xdc')]];var _0xed6cbb=this;var _0x13933e=![];var _0x32939c;var _0x5ac423;if(this[_0x60b9('0x22')][_0x49e377[_0x60b9('0xb5')]]){if(_0xa0d925&&_0xa0d925['type']!=='ivr'){delete this[_0x60b9('0x2a')][_0x49e377[_0x60b9('0xdc')]];this[_0x60b9('0xb4')](this[_0x60b9('0x22')][_0x49e377['queue']]);_0xa0d925[_0x60b9('0x110')]=moment()[_0x60b9('0x77')]('YYYY-MM-DD\x20HH:mm:ss');var _0x442678=new QueueCallerAbandon(_0xa0d925,_0x49e377);if(getSeconds(_0xa0d925[_0x60b9('0x110')],_0xa0d925[_0x60b9('0x111')])>=_0xa0d925[_0x60b9('0x112')]){this[_0x60b9('0x22')][_0x49e377[_0x60b9('0xb5')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x60b9('0x22')][_0x49e377[_0x60b9('0xb5')]][_0x60b9('0x64')]+=0x1;this[_0x60b9('0x22')][_0x49e377[_0x60b9('0xb5')]][_0x60b9('0x113')]+=0x1;_0x442678[_0x60b9('0xe5')]=0xa;_0x442678[_0x60b9('0xaa')]='Drop';_0x442678[_0x60b9('0x114')]=_0x60b9('0x115');_0x442678['agiafterat']=this[_0x60b9('0x22')][_0x49e377[_0x60b9('0xb5')]][_0x60b9('0x116')]?moment()['format'](_0x60b9('0xf5')):undefined;_0x442678[_0x60b9('0xfd')]+=0x1;_0x442678['countglobal']+=0x1;_0x32939c=this['voiceQueues'][_0x49e377[_0x60b9('0xb5')]][_0x60b9('0x117')];_0x5ac423=this['voiceQueues'][_0x49e377['queue']][_0x60b9('0x118')];_0xed6cbb[_0x60b9('0xbe')](_0x442678,_0x442678[_0x60b9('0xe5')],_0xa0d925[_0x60b9('0x119')])['then'](function(_0x1708c1){_0x13933e=_0x1708c1[_0x60b9('0x11a')]==0x1;if(_0x442678[_0x60b9('0xfd')]>=_0xed6cbb['voiceQueues'][_0x49e377[_0x60b9('0xb5')]]['dialDropMaxRetry']){_0xed6cbb[_0x60b9('0x11b')](_0x442678,_0x1708c1[_0x60b9('0x11a')]);}else{_0xed6cbb[_0x60b9('0xc4')]({'active':![],'countdropretry':_0x442678[_0x60b9('0xfd')],'scheduledat':moment()[_0x60b9('0x11c')](_0xed6cbb[_0x60b9('0x22')][_0x49e377['queue']][_0x60b9('0x117')],_0x60b9('0x102'))[_0x60b9('0x77')](_0x60b9('0xf5')),'ContactId':_0xa0d925[_0x60b9('0xd2')],'ListId':_0xa0d925[_0x60b9('0xd3')],'VoiceQueueId':_0xa0d925[_0x60b9('0xf6')]||undefined,'CampaignId':_0xa0d925[_0x60b9('0xd5')]||undefined})[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x11d')));var _0x851285=new History(_0x442678);_0x851285['state']=0xa;_0x851285['statedesc']=_0x60b9('0x11e');_0x851285['starttime']=moment()[_0x60b9('0x77')](_0x60b9('0xf5'));_0x851285[_0x60b9('0xab')]=_0x851285['starttime'];_0x851285[_0x60b9('0x11f')]=_0x442678[_0x60b9('0x11f')];_0x851285[_0x60b9('0x120')]=_0x442678[_0x60b9('0x120')];_0xed6cbb[_0x60b9('0xdb')](_0x851285)[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x121')));}})[_0x60b9('0xbc')](function(_0x4cba51){if(_0x13933e)_0xed6cbb[_0x60b9('0xc0')](_0x442678,_0x32939c,_0x5ac423)[_0x60b9('0xbc')](function(_0x285a05){return 0x1;});});}else{this[_0x60b9('0x22')][_0x49e377[_0x60b9('0xb5')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x60b9('0x22')][_0x49e377[_0x60b9('0xb5')]]['outboundDropCallsDayCallersExit']+=0x1;_0x442678[_0x60b9('0xe5')]=0xb;_0x442678[_0x60b9('0xaa')]=_0x60b9('0x122');_0x442678['dropreason']=_0x60b9('0x123');_0x442678['countabandonedretry']+=0x1;_0x442678[_0x60b9('0xfb')]+=0x1;_0x32939c=this[_0x60b9('0x22')][_0x49e377[_0x60b9('0xb5')]][_0x60b9('0x124')];_0x5ac423=this[_0x60b9('0x22')][_0x49e377[_0x60b9('0xb5')]]['callAdditionalPhoneAfterMin'];_0xed6cbb['verifyAdditionalPhones'](_0x442678,_0x442678[_0x60b9('0xe5')],_0xa0d925[_0x60b9('0x119')])[_0x60b9('0xbc')](function(_0x31ba73){if(_0x442678[_0x60b9('0xfe')]>=_0xed6cbb['voiceQueues'][_0x49e377[_0x60b9('0xb5')]][_0x60b9('0x125')]){_0xed6cbb[_0x60b9('0x11b')](_0x442678,_0x31ba73[_0x60b9('0x11a')]);}else{_0xed6cbb[_0x60b9('0xc4')]({'active':![],'countabandonedretry':_0x442678[_0x60b9('0xfe')],'scheduledat':moment()['add'](_0xed6cbb['voiceQueues'][_0x49e377['queue']][_0x60b9('0x124')],'minutes')[_0x60b9('0x77')](_0x60b9('0xf5')),'ContactId':_0xa0d925[_0x60b9('0xd2')],'ListId':_0xa0d925[_0x60b9('0xd3')],'VoiceQueueId':_0xa0d925['VoiceQueueId']||undefined,'CampaignId':_0xa0d925[_0x60b9('0xd5')]||undefined})['catch'](loggerCatch(_0x60b9('0x126')));var _0x232781=new History(_0x442678);_0x232781[_0x60b9('0xe5')]=0xb;_0x232781[_0x60b9('0xaa')]=_0x60b9('0x122');_0x232781[_0x60b9('0xac')]=moment()[_0x60b9('0x77')](_0x60b9('0xf5'));_0x232781[_0x60b9('0xab')]=_0x232781[_0x60b9('0xac')];_0x232781[_0x60b9('0x11f')]=_0x442678[_0x60b9('0x11f')];_0x232781[_0x60b9('0x120')]=_0x442678[_0x60b9('0x120')];_0xed6cbb[_0x60b9('0xdb')](_0x232781)[_0x60b9('0xb2')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x60b9('0xbc')](function(_0x2bf30e){if(_0x13933e)_0xed6cbb[_0x60b9('0xc0')](_0x442678,_0x32939c,_0x5ac423)[_0x60b9('0xbc')](function(_0x505f63){return 0x1;});});}}}};Dialer[_0x60b9('0x1e')][_0x60b9('0x127')]=function(_0x42101e){if(this[_0x60b9('0x28')][_0x42101e[_0x60b9('0xdc')]]){this[_0x60b9('0x28')][_0x42101e[_0x60b9('0xdc')]][_0x60b9('0xb1')]=_0x42101e[_0x60b9('0xb1')];}if(this['uniqueId'][_0x42101e[_0x60b9('0xdc')]]){this[_0x60b9('0x2a')][_0x42101e[_0x60b9('0xdc')]][_0x60b9('0xb1')]=_0x42101e['channel'];}};Dialer[_0x60b9('0x1e')][_0x60b9('0x3d')]=function(_0x306099){if(strategy[this[_0x60b9('0x22')][this['actions'][_0x306099[_0x60b9('0x128')]]['queue']]['strategy']]===_0x60b9('0x1d')){if(this[_0x60b9('0x28')][_0x306099[_0x60b9('0x128')]]&&_[_0x60b9('0xdd')](this[_0x60b9('0x28')][_0x306099['actionid']][_0x60b9('0x129')])&&_0x306099[_0x60b9('0xb0')]==='1'&&_0x306099['paused']==='0'){if(this['agents'][_0x306099[_0x60b9('0x12a')]]){if(!this[_0x60b9('0x24')][_0x306099[_0x60b9('0x12a')]][_0x60b9('0x129')]){this[_0x60b9('0x24')][_0x306099[_0x60b9('0x12a')]][_0x60b9('0x129')]=!![];this[_0x60b9('0x28')][_0x306099['actionid']][_0x60b9('0x129')]=!![];this[_0x60b9('0x28')][_0x306099['actionid']][_0x60b9('0x12a')]=_0x306099['stateinterface'];}}}}else if((strategy[this[_0x60b9('0x22')][this[_0x60b9('0x28')][_0x306099[_0x60b9('0x128')]][_0x60b9('0xb5')]][_0x60b9('0x54')]]||_0x60b9('0x12b'))===_0x60b9('0x12b')){if(this['actions'][_0x306099[_0x60b9('0x128')]]){if(this[_0x60b9('0x24')][_0x306099[_0x60b9('0x12a')]]){this[_0x60b9('0x28')][_0x306099[_0x60b9('0x128')]][_0x60b9('0x12a')]=_0x306099[_0x60b9('0x12a')];if(_[_0x60b9('0xdd')](this[_0x60b9('0x12c')][this[_0x60b9('0x28')][_0x306099[_0x60b9('0x128')]][_0x60b9('0xb5')]])){this[_0x60b9('0x12c')][this[_0x60b9('0x28')][_0x306099['actionid']][_0x60b9('0xb5')]]=[];}this[_0x60b9('0x12c')][this[_0x60b9('0x28')][_0x306099[_0x60b9('0x128')]]['queue']]['push'](_[_0x60b9('0x8b')](_[_0x60b9('0xd1')](this[_0x60b9('0x28')][_0x306099[_0x60b9('0x128')]],[_0x60b9('0x12d'),_0x60b9('0x12a')]),{'status':_0x306099[_0x60b9('0xb0')],'paused':_0x306099[_0x60b9('0x12e')]}));}}}};function unlockQueueStatus(_0x4155e9,_0xa365c6){setTimeout(function(){if(_['isUndefined'](_0x4155e9[_0x60b9('0x12f')])){loggerBooked[_0x60b9('0x96')](_0x60b9('0x130'),_0xa365c6);}_0x4155e9[_0x60b9('0x12f')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0xa365c6,JSON[_0x60b9('0x4e')](_['pick'](_0x4155e9,[_0x60b9('0x44'),_0x60b9('0x12f')])));},0x1f3);}Dialer['prototype'][_0x60b9('0x131')]=function(_0x3da77c){var _0x456fb5=this;var _0x5b2e7e=_0x456fb5[_0x60b9('0x22')][_0x456fb5[_0x60b9('0x28')][_0x3da77c['actionid']][_0x60b9('0xb5')]];if(strategy[this[_0x60b9('0x22')][this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xb5')]][_0x60b9('0x54')]]===_0x60b9('0x1d')){if(this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]]&&this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0x12a')]){this['preview'][_0x60b9('0x132')](this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]]['idHopper'],this[_0x60b9('0x28')][_0x3da77c['actionid']]['stateinterface'])['catch'](function(_0x5d4d69){logger[_0x60b9('0x96')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x60b9('0x95')](_0x5d4d69,{'showHidden':![],'depth':null}));})[_0x60b9('0x21')](function(){_0x456fb5[_0x60b9('0xb4')](_0x456fb5[_0x60b9('0x22')][_0x456fb5['actions'][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xb5')]]);_0x456fb5[_0x60b9('0x24')][_0x456fb5[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0x12a')]][_0x60b9('0x129')]=![];delete _0x456fb5[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]];unlockQueueStatus(_0x5b2e7e);});}else{this[_0x60b9('0xb4')](this[_0x60b9('0x22')][this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xb5')]]);this[_0x60b9('0xc4')]({'active':![],'ContactId':this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]]['ContactId'],'ListId':this[_0x60b9('0x28')][_0x3da77c['actionid']]['ListId'],'VoiceQueueId':this[_0x60b9('0x28')][_0x3da77c['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x60b9('0x28')][_0x3da77c['actionid']][_0x60b9('0xd5')]||undefined})[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x133')));delete this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]];unlockQueueStatus(_0x5b2e7e);}}else if((strategy[this[_0x60b9('0x22')][this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xb5')]][_0x60b9('0x54')]]||'rrmemory')===_0x60b9('0x12b')){var _0x9d43e1;if(this['actions'][_0x3da77c[_0x60b9('0x128')]]&&!_['isEmpty'](this[_0x60b9('0x12c')][this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xb5')]])){if(this[_0x60b9('0x2e')][_0x456fb5[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xb5')]]){this['queueBookedRR'][_0x456fb5[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]]['queue']]=this[_0x60b9('0x2e')][this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]]['queue']]?this[_0x60b9('0x2e')][this[_0x60b9('0x28')][_0x3da77c['actionid']][_0x60b9('0xb5')]]:this[_0x60b9('0x12c')][this[_0x60b9('0x28')][_0x3da77c['actionid']][_0x60b9('0xb5')]]?this[_0x60b9('0x12c')][this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xb5')]][_0x60b9('0x134')]||0x0:0x0;}this[_0x60b9('0x12c')][this['actions'][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xb5')]][_0x60b9('0x134')]=this[_0x60b9('0x2e')][this[_0x60b9('0x28')][_0x3da77c['actionid']]['queue']];for(var _0x4cf6ee=0x0;_0x4cf6ee<this[_0x60b9('0x12c')][this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xb5')]][_0x60b9('0x97')];_0x4cf6ee+=0x1){_0x9d43e1=rr(this[_0x60b9('0x12c')][this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xb5')]]);this[_0x60b9('0x2e')][_0x456fb5[_0x60b9('0x28')][_0x3da77c['actionid']][_0x60b9('0xb5')]]=this['queueBooked'][this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xb5')]][_0x60b9('0x134')];if(_0x9d43e1[_0x60b9('0xb0')]==='1'&&_0x9d43e1[_0x60b9('0x12e')]==='0'){break;}}if(!_[_0x60b9('0xdd')](_0x9d43e1)){this[_0x60b9('0x24')][_0x9d43e1[_0x60b9('0x12a')]]['unlockRR']=_[_0x60b9('0x42')](this[_0x60b9('0x24')][_0x9d43e1[_0x60b9('0x12a')]]['unlockRR'])?!![]:this[_0x60b9('0x24')][_0x9d43e1[_0x60b9('0x12a')]]['unlockRR'];}loggerBooked[_0x60b9('0x7b')](_0x60b9('0x135'),_0x3da77c[_0x60b9('0x128')],_0x60b9('0x136'),JSON['stringify'](_[_0x60b9('0xd1')](this['agents'][_0x9d43e1[_0x60b9('0x12a')]],[_0x60b9('0x44'),_0x60b9('0x137')])),_0x60b9('0x138'),JSON[_0x60b9('0x4e')](_0x9d43e1[_0x60b9('0x12d')]));if(!_['isNil'](_0x9d43e1)&&_0x9d43e1[_0x60b9('0xb0')]==='1'&&_0x9d43e1[_0x60b9('0x12e')]==='0'&&this[_0x60b9('0x24')][_0x9d43e1['stateinterface']][_0x60b9('0x137')]){this[_0x60b9('0x24')][_0x9d43e1[_0x60b9('0x12a')]][_0x60b9('0x137')]=![];this[_0x60b9('0x12c')][_0x456fb5[_0x60b9('0x28')][_0x3da77c['actionid']][_0x60b9('0xb5')]]=[];this[_0x60b9('0x90')]['run'](_0x9d43e1[_0x60b9('0x12d')],_0x9d43e1[_0x60b9('0x12a')])['catch'](function(_0x2faa92){logger[_0x60b9('0x96')](_0x60b9('0x139'),util['inspect'](_0x2faa92,{'showHidden':![],'depth':null}));})['finally'](function(){_0x456fb5['updateOriginated'](_0x456fb5[_0x60b9('0x22')][_0x456fb5[_0x60b9('0x28')][_0x3da77c['actionid']][_0x60b9('0xb5')]]);setTimeout(function(){_0x456fb5[_0x60b9('0x24')][_0x9d43e1[_0x60b9('0x12a')]][_0x60b9('0x137')]=!![];loggerBooked[_0x60b9('0x7b')]('[booked][RR][finaly]',_0x3da77c['actionid'],'Agent:\x20',JSON[_0x60b9('0x4e')](_[_0x60b9('0xd1')](_0x456fb5[_0x60b9('0x24')][_0x9d43e1[_0x60b9('0x12a')]],[_0x60b9('0x44'),_0x60b9('0x137')])),'contactAgent-idHopper:\x20',JSON[_0x60b9('0x4e')](_0x9d43e1[_0x60b9('0x12d')]));},0xc7);delete _0x456fb5[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]];unlockQueueStatus(_0x5b2e7e,_0x3da77c['actionid']);});}else{loggerBooked['info'](_0x60b9('0x13a'));this['updateOriginated'](this['voiceQueues'][this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xb5')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x3da77c[_0x60b9('0x128')]]['ContactId'],'ListId':this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xd3')],'VoiceQueueId':this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xf6')]||undefined,'CampaignId':this['actions'][_0x3da77c['actionid']][_0x60b9('0xd5')]||undefined})[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x133')));delete this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]];unlockQueueStatus(_0x5b2e7e);}}else{loggerBooked[_0x60b9('0x7b')](_0x60b9('0x13b'));this[_0x60b9('0xb4')](this['voiceQueues'][this['actions'][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xb5')]]);this[_0x60b9('0xc4')]({'active':![],'ContactId':this['actions'][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xd2')],'ListId':this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xd3')],'VoiceQueueId':this[_0x60b9('0x28')][_0x3da77c['actionid']][_0x60b9('0xf6')]||undefined,'CampaignId':this[_0x60b9('0x28')][_0x3da77c['actionid']][_0x60b9('0xd5')]||undefined})[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x13c')));delete this[_0x60b9('0x28')][_0x3da77c['actionid']];unlockQueueStatus(_0x5b2e7e);}}else{loggerBooked[_0x60b9('0x7b')](_0x60b9('0x13d'));this[_0x60b9('0xb4')](this['voiceQueues'][this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x3da77c['actionid']][_0x60b9('0xd2')],'ListId':this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]]['ListId'],'VoiceQueueId':this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]][_0x60b9('0xf6')]||undefined,'CampaignId':this[_0x60b9('0x28')][_0x3da77c['actionid']][_0x60b9('0xd5')]||undefined})[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x13e')));delete this[_0x60b9('0x28')][_0x3da77c[_0x60b9('0x128')]];unlockQueueStatus(_0x5b2e7e);}};Dialer[_0x60b9('0x1e')][_0x60b9('0x3e')]=function(){var _0x27e77c=this;return BPromise['resolve']()[_0x60b9('0xbc')](cmHopper[_0x60b9('0x13f')]({}))[_0x60b9('0xbc')](function(){setInterval(function(){_0x27e77c[_0x60b9('0x140')]();},0x3e8);});};Dialer[_0x60b9('0x1e')][_0x60b9('0x141')]=function(_0x2cc6b7){var _0x338be6=this;return function(){if(!_0x338be6['isTrunkReachable'](_0x2cc6b7[_0x60b9('0x74')])){if(!_0x338be6['isTrunkReachable'](_0x2cc6b7[_0x60b9('0x142')])){_0x2cc6b7[_0x60b9('0x43')]=_0x60b9('0x143');throw _0x2cc6b7[_0x60b9('0x44')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x60b9('0x1e')][_0x60b9('0x144')]=function(_0x4188e3,_0x248654,_0x201aad,_0x589346){var _0x470933=this;return function(){var _0x41d0b5=!![];return _0x470933[_0x60b9('0x145')](_0x4188e3,_0x248654,_0x201aad,_0x589346,_0x41d0b5);};};Dialer[_0x60b9('0x1e')][_0x60b9('0x146')]=function(_0x3122d1,_0x23c23e,_0x561e3c,_0x4edd04){var _0x182f0c=this;return function(){var _0x1042cc=![];return _0x182f0c[_0x60b9('0x145')](_0x3122d1[_0x60b9('0x4a')],_0x23c23e,_0x561e3c,_0x4edd04,_0x1042cc);};};Dialer[_0x60b9('0x1e')][_0x60b9('0x145')]=function(_0x5d2108,_0x53eeb0,_0x4a085e,_0x3b75aa,_0x1e9c4f){var _0x55eb4c=[];return new BPromise(function(_0x43b4e1,_0x3ee0ce){if(!isNotNull(_0x5d2108)){_0x3b75aa[_0x60b9('0x43')]=_0x60b9('0x48');return _0x3ee0ce(msgResponse(_0x60b9('0x145'),'Failure',_0x4a085e+_0x60b9('0x147')));}if(_[_0x60b9('0x4b')](_0x5d2108)){_0x3b75aa['message']=_0x60b9('0x148');return _0x3ee0ce(msgResponse(_0x60b9('0x145'),'Failure',_0x4a085e+_0x60b9('0x149')));}if(_0x53eeb0&&_[_0x60b9('0x42')](config[_0x60b9('0x14a')][_0x53eeb0])){_0x3b75aa[_0x60b9('0x43')]=_0x60b9('0x14b');return _0x3ee0ce(msgResponse(_0x60b9('0x145'),_0x60b9('0x14c'),_0x4a085e+'\x20Timezone\x20unknow\x20'+_0x53eeb0));}if(_['isArray'](_0x5d2108)){for(var _0x4f03a4=0x0;_0x4f03a4<_0x5d2108[_0x60b9('0x97')];_0x4f03a4+=0x1){_0x55eb4c[_0x60b9('0x14d')](ami[_0x60b9('0x14e')]({'action':'command','command':util[_0x60b9('0x77')](_0x60b9('0x14f'),_0x5d2108[_0x4f03a4]['interval'],!_[_0x60b9('0x42')](config[_0x60b9('0x14a')][_0x53eeb0])?_0x53eeb0:'')})['then'](function(_0x3a53bc){return _0x3a53bc['content']['indexOf'](_0x60b9('0x150'))>=0x0;})['catch'](myreject(_0x3ee0ce)));}}else{_0x55eb4c[_0x60b9('0x14d')](ami[_0x60b9('0x14e')]({'action':_0x60b9('0x151'),'command':util[_0x60b9('0x77')](_0x60b9('0x14f'),_0x5d2108,!_['isUndefined'](config['timezones'][_0x53eeb0])?_0x53eeb0:'')})['then'](function(_0x147454){return _0x147454[_0x60b9('0x152')][_0x60b9('0x153')](_0x60b9('0x150'))>=0x0;})[_0x60b9('0xb2')](myreject(_0x3ee0ce)));}BPromise['all'](_0x55eb4c)[_0x60b9('0xbc')](function(_0x3d9a4c){var _0x9fdc6=_['some'](_0x3d9a4c);if(_0x9fdc6){return _0x43b4e1(_0x9fdc6);}else{_0x3b75aa[_0x60b9('0x43')]=_0x1e9c4f?_0x60b9('0x154'):'INTERVAL_IS_OVERTIME';return _0x3ee0ce(msgResponse(_0x60b9('0x155'),_0x60b9('0x14c'),_0x60b9('0x156')+_0x1e9c4f+'\x20'+_0x4a085e+_0x60b9('0x157')+util[_0x60b9('0x95')](_0x5d2108,{'showHidden':![],'depth':null})+_0x60b9('0x158')+_0x53eeb0));}})[_0x60b9('0xb2')](function(_0x6ef24a){return _0x3ee0ce(msgResponse('ifTime',_0x60b9('0x14c'),JSON[_0x60b9('0x4e')](_0x6ef24a)));});});};Dialer[_0x60b9('0x1e')][_0x60b9('0x159')]=function(_0x1a2d80){var _0x2e265d=this;return function(){switch(_0x1a2d80[_0x60b9('0x5d')]){case _0x60b9('0x15a'):freeVariablesPredictive(_0x1a2d80);_0x2e265d[_0x60b9('0x15b')](_0x1a2d80,0x1);break;case _0x60b9('0x15c'):freeVariablesPredictive(_0x1a2d80);_0x2e265d[_0x60b9('0x15b')](_0x1a2d80,_0x1a2d80[_0x60b9('0x15d')]);break;case'predictive':_0x2e265d[_0x60b9('0x9')](_0x1a2d80);break;case _0x60b9('0x8'):freeVariablesPredictive(_0x1a2d80);_0x2e265d['handlePower'](_0x1a2d80,0x1);break;default:freeVariablesPredictive(_0x1a2d80);logger[_0x60b9('0x96')](_0x60b9('0x15e'),_0x1a2d80[_0x60b9('0x44')],'method\x20not\x20recognized');}};};Dialer[_0x60b9('0x1e')][_0x60b9('0x15f')]=function(_0x491715){var _0x13dc81=this;return function(){_0x13dc81[_0x60b9('0x160')](_0x491715);};};Dialer[_0x60b9('0x1e')][_0x60b9('0x161')]=function(_0x6d02df){var _0x4d4a7e=this;if(isNotPreview(_0x6d02df[_0x60b9('0x5d')])){if(isVoiceQueueOutbound(_0x6d02df[_0x60b9('0x52')])&&isActive(_0x6d02df[_0x60b9('0x162')])){_0x6d02df[_0x60b9('0xa2')]=!![];BPromise['resolve']()['then'](checkIsLoggedIn(_0x6d02df,_0x6d02df[_0x60b9('0x56')]))[_0x60b9('0xbc')](checkIsActive(_0x6d02df,_0x6d02df[_0x60b9('0x162')]))['then'](checkInterval(_0x6d02df))[_0x60b9('0xbc')](_0x4d4a7e[_0x60b9('0x141')](_0x6d02df))[_0x60b9('0xbc')](_0x4d4a7e[_0x60b9('0x144')](_0x6d02df[_0x60b9('0x163')],_0x6d02df['dialTimezone'],_0x6d02df['name'],_0x6d02df))[_0x60b9('0xbc')](_0x4d4a7e[_0x60b9('0x146')](_0x6d02df[_0x60b9('0x47')],_0x6d02df['dialTimezone'],_0x6d02df[_0x60b9('0x44')],_0x6d02df))[_0x60b9('0xbc')](_0x4d4a7e[_0x60b9('0x159')](_0x6d02df))[_0x60b9('0xb2')](loggerCatchQueueSummary('[syncQueueSummary]',_0x6d02df));}else{notSendMessagesQueue(_0x6d02df);}}else{freeVariablesPredictive(_0x6d02df);}};Dialer[_0x60b9('0x1e')]['syncQueueSummaryComplete']=_[_0x60b9('0x164')](function(){var _0x41fb3a=_[_0x60b9('0x165')](this[_0x60b9('0x22')],function(_0x1d396a){return _0x1d396a[_0x60b9('0x166')];});var _0x2c0be7=_[_0x60b9('0x165')](this[_0x60b9('0x24')],function(_0x15e9dd){return _0x15e9dd[_0x60b9('0x167')]&&_0x15e9dd[_0x60b9('0xb0')]===_0x60b9('0x168');});if(_0x41fb3a[_0x60b9('0x97')]>0x0&&_0x2c0be7[_0x60b9('0x97')]>0x0){return BPromise['resolve']()['then'](cmHopper[_0x60b9('0x169')](_[_0x60b9('0x16a')](_0x41fb3a,'id'),previewRecallmeReminderInterval,_[_0x60b9('0x16a')](_0x2c0be7,'id')))[_0x60b9('0xbc')](function(_0xc515b1){for(var _0x20f3cf=0x0;_0x20f3cf<_0xc515b1[_0x60b9('0x97')];_0x20f3cf++){var _0xe267bd=_0xc515b1[_0x20f3cf][_0x60b9('0x16b')]['name'];if(_0xe267bd)io['to'](util[_0x60b9('0x77')](_0x60b9('0x16c'),_0xe267bd))['emit'](_0x60b9('0x16d'),{'hopper':_0xc515b1[_0x20f3cf]});}})['catch'](function(_0x5bc026){logger[_0x60b9('0x96')](_0x60b9('0x16e'),_0x5bc026);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x60b9('0x1e')][_0x60b9('0x140')]=function(){var _0x599767=this;var _0x152fbd;for(var _0x158504 in this['campaigns']){if(typeof this[_0x60b9('0x23')][_0x158504]!==_0x60b9('0x98')){_0x152fbd=this[_0x60b9('0x23')][_0x158504];if(isCampaignIvr(_0x152fbd['type'])&&isActive(_0x152fbd['active'])){_0x152fbd[_0x60b9('0xa2')]=!![];BPromise[_0x60b9('0xbb')]()[_0x60b9('0xbc')](checkIsActive(_0x152fbd,_0x152fbd['active']))[_0x60b9('0xbc')](checkInterval(_0x152fbd))['then'](_0x599767[_0x60b9('0x141')](_0x152fbd))[_0x60b9('0xbc')](_0x599767[_0x60b9('0x144')](_0x152fbd['dialGlobalInterval'],_0x152fbd['dialTimezone'],_0x152fbd['name'],_0x152fbd))[_0x60b9('0xbc')](_0x599767[_0x60b9('0x146')](_0x152fbd[_0x60b9('0x47')],_0x152fbd[_0x60b9('0x16f')],_0x152fbd[_0x60b9('0x44')],_0x152fbd))[_0x60b9('0xbc')](_0x599767['launchHandleIvr'](_0x152fbd))['catch'](loggerCatchQueueSummary(_0x60b9('0x170'),_0x152fbd));}else{notSendMessagesCampaign(_0x152fbd);}}}};function getCallerIdRandom(_0x1a9385,_0x3928f0){var _0x265a38;var _0x4e6a34;var _0x459d6e;if(_0x3928f0<=0x0){_0x3928f0=0x1;}_0x265a38=new RegExp('\x5cw{0,'+_0x3928f0+'}$');_0x4e6a34=Math[_0x60b9('0x171')](0xa,_0x3928f0-0x1);_0x459d6e=Math[_0x60b9('0x171')](0xa,_0x3928f0)-0x1;return util[_0x60b9('0x77')]('%s',_[_0x60b9('0x172')](_0x1a9385,_0x265a38,_[_0x60b9('0x173')](_0x4e6a34,_0x459d6e)));}function extractCalleridName(_0x504c0d){var _0x315b32=_0x504c0d[_0x60b9('0x174')](/"(.*?)"/);return _0x315b32?_0x315b32[0x1]:_0x504c0d;}function extractCalleridNumber(_0x30464e){var _0x1a0c18=_0x30464e[_0x60b9('0x174')](/<(.*?)>/);return _0x1a0c18?_0x1a0c18[0x1]:_0x30464e;}Dialer[_0x60b9('0x1e')]['actionOriginate']=function(_0x4f03ca,_0x2053ca){var _0xda9111=this;var _0x604fbc=uuid['v4']();this[_0x60b9('0x28')][_0x604fbc]=new Action(_0x4f03ca,_0x2053ca,_0x604fbc);return new BPromise(function(_0x526998,_0x48f7df){if(_['isUndefined'](_0x4f03ca)&&typeof _0x4f03ca!==_0x60b9('0x175')){return _0x48f7df(msgResponse(_0x60b9('0x176'),'Failure',_0x60b9('0x177')));}if(_[_0x60b9('0x42')](_0x2053ca['phone'])||_0x2053ca[_0x60b9('0x178')]===null){return _0x48f7df(msgResponse('originate','Failure','contact\x20is\x20undefine'));}var _0x2a1942={'XMD-CALLERID':_0xda9111[_0x60b9('0x28')][_0x604fbc][_0x60b9('0x179')](),'XMD-AGI':_0x4f03ca[_0x60b9('0x106')]?util[_0x60b9('0x77')](_0x60b9('0x17a'),ipAgi,_0x4f03ca['dialQueueProject']):_0x60b9('0x17b'),'XMD-AGIAFTER':_0x4f03ca[_0x60b9('0x116')]?util[_0x60b9('0x77')](_0x60b9('0x17a'),ipAgi,_0x4f03ca[_0x60b9('0x116')]):'NONE','XMD-QUEUE':_0x4f03ca[_0x60b9('0x52')]===_0x60b9('0x53')?util['format']('\x22%s,%s%s,,,%s\x22',_0x4f03ca[_0x60b9('0x44')],_0x4f03ca[_0x60b9('0x17c')]||'',_0x4f03ca[_0x60b9('0x17d')]?'c':'',_0x4f03ca[_0x60b9('0x112')]||0x3):_0x60b9('0x17b'),'XMD-CONTACTID':_0x2053ca[_0x60b9('0xd2')],'XMD-CDRTYPE':_0x60b9('0x17e'),'CALLERID(all)':_0xda9111[_0x60b9('0x28')][_0x604fbc]['getCaller'](),'XMD-AMD':_0x4f03ca[_0x60b9('0xe2')]?_0x60b9('0x17f'):_0x60b9('0x17b'),'XMD-DESTINATION':_0x60b9('0xe1')};if(_0x4f03ca[_0x60b9('0xe2')]){_0x2a1942[_0x60b9('0x180')]=_0x4f03ca[_0x60b9('0x181')]||0x9c4;_0x2a1942['XMD-AMDGREETING']=_0x4f03ca['dialAMDGreeting']||0x5dc;_0x2a1942[_0x60b9('0x182')]=_0x4f03ca[_0x60b9('0x183')]||0x320;_0x2a1942[_0x60b9('0x184')]=_0x4f03ca[_0x60b9('0x185')]||0x1388;_0x2a1942[_0x60b9('0x186')]=_0x4f03ca['dialAMDMinWordLength']||0x64;_0x2a1942['XMD-AMDBETWEENWORDSSILENCE']=_0x4f03ca[_0x60b9('0x187')]||0x32;_0x2a1942[_0x60b9('0x188')]=_0x4f03ca['dialAMDMaximumNumberOfWords']||0x3;_0x2a1942[_0x60b9('0x189')]=_0x4f03ca['dialAMDSilenceThreshold']||0x100;_0x2a1942[_0x60b9('0x18a')]=_0x4f03ca[_0x60b9('0x18b')]||0x1388;}if(_0x4f03ca[_0x60b9('0x52')]===_0x60b9('0x53')){_0x2a1942[_0x60b9('0x18c')]=_0x2053ca[_0x60b9('0xf6')];}else{_0x2a1942[_0x60b9('0x18d')]=_0x2053ca[_0x60b9('0xd5')];}for(var _0x49fa60 in _0x2053ca['Contact']){if(typeof _0x2053ca['Contact'][_0x49fa60]!==_0x60b9('0x98')){if(isNotNull(_0x2053ca[_0x60b9('0x18e')][_0x49fa60])&&_0x49fa60!=='id'&&_0x49fa60!=='tags'&&_0x49fa60!==_0x60b9('0x18f')&&_0x49fa60!==_0x60b9('0x190')){_0x2a1942[util[_0x60b9('0x77')](_0x60b9('0x191'),_0x60b9('0x192'),_[_0x60b9('0x193')](_0x49fa60))]=_0x2053ca[_0x60b9('0x18e')][_0x49fa60];}}}var _0x32f7c4=_0xda9111[_0x60b9('0xd8')](_0x4f03ca[_0x60b9('0x74')])?getCallerId(_0x4f03ca['Trunk'][_0x60b9('0x76')],_0x4f03ca[_0x60b9('0x194')],_0x4f03ca[_0x60b9('0x195')]>0x0?getCallerIdRandom(_0x4f03ca[_0x60b9('0x196')],_0x4f03ca[_0x60b9('0x195')]):_0x4f03ca['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x4f03ca['TrunkBackup'])?_0x4f03ca['Trunk'][_0x60b9('0x76')]:_0x4f03ca[_0x60b9('0x142')][_0x60b9('0x76')],_0x4f03ca['dialOriginateCallerIdName'],_0x4f03ca['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4f03ca[_0x60b9('0x196')],_0x4f03ca['dialRandomLastDigitCallerIdNumber']):_0x4f03ca[_0x60b9('0x196')]);if(_0x32f7c4){_0x2a1942[_0x60b9('0x197')]=_0xda9111['actions'][_0x604fbc]['originatecalleridname']=extractCalleridName(_0x32f7c4);_0x2a1942[_0x60b9('0x198')]=_0x2053ca[_0x60b9('0x178')];}return ami[_0x60b9('0x14e')]({'actionid':_0x604fbc,'action':_0x60b9('0x176'),'channel':_0xda9111['isTrunkReachable'](_0x4f03ca[_0x60b9('0x74')])?util[_0x60b9('0x77')](_0x60b9('0x199'),_0x4f03ca[_0x60b9('0x74')][_0x60b9('0x44')],isNotNull(_0x4f03ca[_0x60b9('0x5e')])?_0x4f03ca['dialPrefix'][_0x60b9('0x19a')]()||'':'',_0x4f03ca[_0x60b9('0x19b')]>0x0?_0x2053ca[_0x60b9('0x178')][_0x60b9('0x19c')](_0x4f03ca[_0x60b9('0x19b')]):_0x2053ca[_0x60b9('0x178')]):util[_0x60b9('0x77')](_0x60b9('0x199'),_['isNil'](_0x4f03ca[_0x60b9('0x142')])?_0x4f03ca[_0x60b9('0x74')][_0x60b9('0x44')]:_0x4f03ca[_0x60b9('0x142')][_0x60b9('0x44')],isNotNull(_0x4f03ca[_0x60b9('0x5e')])?_0x4f03ca[_0x60b9('0x5e')]['trim']()||'':'',_0x4f03ca[_0x60b9('0x19b')]>0x0?_0x2053ca['phone']['substring'](_0x4f03ca[_0x60b9('0x19b')]):_0x2053ca[_0x60b9('0x178')]),'callerid':_0x32f7c4,'Exten':_0x60b9('0xe1'),'Context':_0x60b9('0x19d'),'Priority':'1','variable':_0x2a1942,'timeout':(_0x4f03ca[_0x60b9('0x19e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x604fbc})[_0x60b9('0xbc')](function(_0x3d12cc){return _0x526998(_0x3d12cc);})[_0x60b9('0xb2')](function(_0x47fece){_0x4f03ca[_0x60b9('0x66')]+=0x1;var _0x380ad7=new History(_0xda9111[_0x60b9('0x28')][_0x604fbc]);logger[_0x60b9('0x96')](util[_0x60b9('0x77')](_0x60b9('0x19f'),JSON[_0x60b9('0x4e')](_0x47fece)));_0x380ad7[_0x60b9('0xe5')]=0xe;_0x380ad7[_0x60b9('0xaa')]='OriginateError';_0x380ad7[_0x60b9('0xac')]=moment()[_0x60b9('0x77')](_0x60b9('0xf5'));_0x380ad7[_0x60b9('0xab')]=_0x380ad7[_0x60b9('0xac')];_0xda9111['createHistory'](_0x380ad7)[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x1a0')));_0xda9111[_0x60b9('0xcd')](_0x380ad7)[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x1a0')))[_0x60b9('0x21')](function(){delete _0xda9111[_0x60b9('0x28')][_0x604fbc];return _0x48f7df(msgResponse('originate',_0x60b9('0x4d'),'originate\x20action\x20Error'));});});});};Dialer[_0x60b9('0x1e')][_0x60b9('0x33')]=function(_0x26398b){var _0x663a46=this[_0x60b9('0x28')][_0x26398b[_0x60b9('0x128')]];if(_0x663a46){delete this[_0x60b9('0x28')][_0x26398b['actionid']];_0x663a46['responsetime']=moment()[_0x60b9('0x77')](_0x60b9('0xf5'));var _0x1bd1f4=_0x663a46[_0x60b9('0x52')]===_0x60b9('0x91')?this[_0x60b9('0x23')][_0x663a46['queue']]:this[_0x60b9('0x22')][_0x663a46[_0x60b9('0x1a1')]()];if(!this[_0x60b9('0xd7')](_0x26398b[_0x60b9('0x1a2')])){this[_0x60b9('0xb4')](_0x1bd1f4);return this[_0x60b9('0x1a3')](_0x663a46,_0x1bd1f4,_0x26398b)[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x1a4')));}this[_0x60b9('0x2a')][_0x26398b[_0x60b9('0xdc')]]=_0x663a46;}};Dialer[_0x60b9('0x1e')][_0x60b9('0x1a5')]=function(_0x42f2fd,_0x33c6c9,_0x1ed517){var _0x1fda1a=new History(_0x33c6c9);if(_0x1fda1a[_0x60b9('0xee')]+_0x1fda1a[_0x60b9('0xfc')]+_0x1fda1a[_0x60b9('0x1a6')]+_0x1fda1a[_0x60b9('0xef')]+_0x1fda1a[_0x60b9('0xfd')]+_0x1fda1a[_0x60b9('0xfe')]+_0x1fda1a['countmachineretry']+_0x1fda1a[_0x60b9('0xff')]>=_0x1ed517['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x42f2fd){case 0x3:if(_0x1fda1a['countnoanswerretry']>=_0x1ed517[_0x60b9('0x1a7')]-0x1){return!![];}this[_0x60b9('0xc4')]({'active':![],'countnoanswerretry':_0x1fda1a[_0x60b9('0x1a6')]+=0x1,'scheduledat':moment()[_0x60b9('0x11c')](_0x1ed517['dialNoAnswerRetryFrequency'],_0x60b9('0x102'))['format'](_0x60b9('0xf5')),'ContactId':_0x1fda1a[_0x60b9('0xd2')],'ListId':_0x1fda1a['ListId'],'VoiceQueueId':_0x1fda1a[_0x60b9('0xf6')]||undefined,'CampaignId':_0x1fda1a[_0x60b9('0xd5')]||undefined})[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x1a8')));break;case 0x5:if(_0x1fda1a[_0x60b9('0xee')]>=_0x1ed517[_0x60b9('0x1a9')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x1fda1a[_0x60b9('0xee')]+=0x1,'scheduledat':moment()[_0x60b9('0x11c')](_0x1ed517[_0x60b9('0x1aa')],_0x60b9('0x102'))[_0x60b9('0x77')](_0x60b9('0xf5')),'ContactId':_0x1fda1a[_0x60b9('0xd2')],'ListId':_0x1fda1a[_0x60b9('0xd3')],'VoiceQueueId':_0x1fda1a[_0x60b9('0xf6')]||undefined,'CampaignId':_0x1fda1a[_0x60b9('0xd5')]||undefined})[_0x60b9('0xb2')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x1fda1a[_0x60b9('0xfc')]>=_0x1ed517[_0x60b9('0x1ab')]-0x1){return!![];}this[_0x60b9('0xc4')]({'active':![],'countcongestionretry':_0x1fda1a[_0x60b9('0xfc')]+=0x1,'scheduledat':moment()[_0x60b9('0x11c')](_0x1ed517[_0x60b9('0x1ac')],'minutes')[_0x60b9('0x77')](_0x60b9('0xf5')),'ContactId':_0x1fda1a['ContactId'],'ListId':_0x1fda1a[_0x60b9('0xd3')],'VoiceQueueId':_0x1fda1a[_0x60b9('0xf6')]||undefined,'CampaignId':_0x1fda1a[_0x60b9('0xd5')]||undefined})[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x1ad')));break;case 0x0:if(_0x1fda1a[_0x60b9('0xef')]>=_0x1ed517[_0x60b9('0x1ae')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x1fda1a['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x1ed517[_0x60b9('0x1af')],_0x60b9('0x102'))[_0x60b9('0x77')](_0x60b9('0xf5')),'ContactId':_0x1fda1a[_0x60b9('0xd2')],'ListId':_0x1fda1a[_0x60b9('0xd3')],'VoiceQueueId':_0x1fda1a[_0x60b9('0xf6')]||undefined,'CampaignId':_0x1fda1a[_0x60b9('0xd5')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x1fda1a[_0x60b9('0xfd')]>=_0x1ed517[_0x60b9('0x1b0')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x1fda1a[_0x60b9('0xfd')]+=0x1,'scheduledat':moment()['add'](_0x1ed517['dialDropRetryFrequency'],_0x60b9('0x102'))[_0x60b9('0x77')](_0x60b9('0xf5')),'ContactId':_0x1fda1a[_0x60b9('0xd2')],'ListId':_0x1fda1a[_0x60b9('0xd3')],'VoiceQueueId':_0x1fda1a[_0x60b9('0xf6')]||undefined,'CampaignId':_0x1fda1a[_0x60b9('0xd5')]||undefined})['catch'](loggerCatch(_0x60b9('0x11d')));break;case 0xb:if(_0x1fda1a[_0x60b9('0xfe')]>=_0x1ed517[_0x60b9('0x125')]-0x1){return!![];}this[_0x60b9('0xc4')]({'active':![],'countabandonedretry':_0x1fda1a['countabandonedretry']+=0x1,'scheduledat':moment()[_0x60b9('0x11c')](_0x1ed517[_0x60b9('0x124')],_0x60b9('0x102'))[_0x60b9('0x77')](_0x60b9('0xf5')),'ContactId':_0x1fda1a['ContactId'],'ListId':_0x1fda1a[_0x60b9('0xd3')],'VoiceQueueId':_0x1fda1a['VoiceQueueId']||undefined,'CampaignId':_0x1fda1a['CampaignId']||undefined})[_0x60b9('0xb2')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x1fda1a[_0x60b9('0xea')]>=_0x1ed517['dialMachineMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x1fda1a[_0x60b9('0xea')]+=0x1,'scheduledat':moment()[_0x60b9('0x11c')](_0x1ed517[_0x60b9('0xf4')],_0x60b9('0x102'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1fda1a[_0x60b9('0xd2')],'ListId':_0x1fda1a['ListId'],'VoiceQueueId':_0x1fda1a['VoiceQueueId']||undefined,'CampaignId':_0x1fda1a[_0x60b9('0xd5')]||undefined})['catch'](loggerCatch(_0x60b9('0xf7')));break;case 0x14:if(_0x1fda1a[_0x60b9('0xff')]>=_0x1ed517['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x60b9('0xc4')]({'active':![],'countagentrejectretry':_0x1fda1a[_0x60b9('0xff')]+=0x1,'scheduledat':moment()[_0x60b9('0x11c')](_0x1ed517[_0x60b9('0x1b1')],_0x60b9('0x102'))[_0x60b9('0x77')](_0x60b9('0xf5')),'ContactId':_0x1fda1a[_0x60b9('0xd2')],'ListId':_0x1fda1a[_0x60b9('0xd3')],'VoiceQueueId':_0x1fda1a[_0x60b9('0xf6')]||undefined,'CampaignId':_0x1fda1a['CampaignId']||undefined})[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x1b2')));break;default:return!![];}};Dialer[_0x60b9('0x1e')][_0x60b9('0x1a3')]=function(_0x2a8009,_0x2d50a7,_0x13938c){var _0x36aa40=this;var _0x151de0=new History(_0x2a8009);var _0xe98869=![];var _0x4c6745;var _0x204da9;return new BPromise(function(_0x57937f,_0x319b9f){if(_['isUndefined'](_0x2d50a7)&&typeof _0x2d50a7!==_0x60b9('0x175')){return _0x319b9f(msgResponse(_0x60b9('0x1b3'),_0x60b9('0x14c'),_0x60b9('0x1b4')));}if(_['isUndefined'](_0x13938c)&&typeof _0x13938c!==_0x60b9('0x175')){return _0x319b9f(msgResponse(_0x60b9('0x1b3'),_0x60b9('0x14c'),_0x60b9('0x1b5')));}_0x36aa40['verifyAdditionalPhones'](_0x151de0,_0x13938c[_0x60b9('0x10b')],_0x2d50a7)[_0x60b9('0xbc')](function(_0x31126d){if(_0x31126d[_0x60b9('0x11a')]==0x1)_0xe98869=!![];switch(_0x13938c[_0x60b9('0x10b')]){case'0':_0x2d50a7['outboundNoSuchCallsDay']+=0x1;_0x151de0['state']=0x0;_0x151de0[_0x60b9('0xaa')]=_0x60b9('0x1b6');_0x151de0[_0x60b9('0xef')]+=0x1;_0x151de0[_0x60b9('0xfb')]+=0x1;ami[_0x60b9('0x51')](_0x60b9('0x1b7'),ut['buildObj'](_0x2a8009,'nosuchnumber'));_0x4c6745=_0x2d50a7[_0x60b9('0x1af')];_0x204da9=_0x2d50a7[_0x60b9('0x118')];_0x36aa40[_0x60b9('0xdb')](_0x151de0)[_0x60b9('0xb2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x36aa40[_0x60b9('0x1a5')](0x0,_0x2a8009,_0x2d50a7)&&!_0xe98869){if(_0x151de0['countnosuchnumberretry']>=_0x2d50a7['dialNoSuchNumberMaxRetry']){_0x36aa40[_0x60b9('0x101')](_0x151de0,_0x57937f,_0x319b9f,_0x60b9('0x1b8'));}else{_0x36aa40['stateGlobal'](_0x151de0,_0x57937f,_0x319b9f,_0x60b9('0x1b8'));}}break;case'3':_0x2d50a7['outboundNoAnswerCallsDay']+=0x1;_0x151de0[_0x60b9('0xe5')]=0x3;_0x151de0[_0x60b9('0xaa')]='NoAnswer';_0x151de0[_0x60b9('0x1a6')]+=0x1;_0x151de0[_0x60b9('0xfb')]+=0x1;ami[_0x60b9('0x51')](_0x60b9('0x1b9'),ut['buildObj'](_0x2a8009,_0x60b9('0x1ba')));_0x4c6745=_0x2d50a7[_0x60b9('0x1bb')];_0x204da9=_0x2d50a7['callAdditionalPhoneAfterMin'];_0x36aa40[_0x60b9('0xdb')](_0x151de0)[_0x60b9('0xb2')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x36aa40[_0x60b9('0x1a5')](0x3,_0x2a8009,_0x2d50a7)&&!_0xe98869){if(_0x151de0['countnoanswerretry']>=_0x2d50a7[_0x60b9('0x1a7')]){_0x36aa40[_0x60b9('0x101')](_0x151de0,_0x57937f,_0x319b9f,_0x60b9('0x1bc'));}else{_0x36aa40[_0x60b9('0xf1')](_0x151de0,_0x57937f,_0x319b9f,_0x60b9('0x1bc'));}}break;case'5':_0x2d50a7[_0x60b9('0x61')]+=0x1;_0x151de0[_0x60b9('0xe5')]=0x5;_0x151de0['statedesc']=_0x60b9('0x1bd');_0x151de0[_0x60b9('0xee')]+=0x1;_0x151de0['countglobal']+=0x1;ami[_0x60b9('0x51')]('custom:agentbusy',ut[_0x60b9('0xec')](_0x2a8009,'busy'));_0x4c6745=_0x2d50a7[_0x60b9('0x1aa')];_0x204da9=_0x2d50a7[_0x60b9('0x118')];_0x36aa40['createHistory'](_0x151de0)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x36aa40[_0x60b9('0x1a5')](0x5,_0x2a8009,_0x2d50a7)&&!_0xe98869){if(_0x151de0[_0x60b9('0xee')]>=_0x2d50a7[_0x60b9('0x1a9')]){_0x36aa40[_0x60b9('0x101')](_0x151de0,_0x57937f,_0x319b9f,'reason\x205\x20busy');}else{_0x36aa40['stateGlobal'](_0x151de0,_0x57937f,_0x319b9f,_0x60b9('0x1be'));}}break;case'8':_0x2d50a7[_0x60b9('0x62')]+=0x1;_0x151de0[_0x60b9('0xe5')]=0x8;_0x151de0['statedesc']='Congestion';_0x151de0[_0x60b9('0xfc')]+=0x1;_0x151de0['countglobal']+=0x1;_0x4c6745=_0x2d50a7['dialCongestionRetryFrequency'];_0x204da9=_0x2d50a7[_0x60b9('0x118')];ami[_0x60b9('0x51')](_0x60b9('0x1bf'),ut[_0x60b9('0xec')](_0x2a8009,'congestion'));_0x36aa40['createHistory'](_0x151de0)[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x1c0')));if(_0x36aa40['checkRetriveMax'](0x8,_0x2a8009,_0x2d50a7)&&!_0xe98869){if(_0x151de0[_0x60b9('0xfc')]>=_0x2d50a7[_0x60b9('0x1ab')]){_0x36aa40[_0x60b9('0x101')](_0x151de0,_0x57937f,_0x319b9f,_0x60b9('0x1c1'));}else{_0x36aa40[_0x60b9('0xf1')](_0x151de0,_0x57937f,_0x319b9f,_0x60b9('0x1c1'));}}break;case'11':_0x2d50a7[_0x60b9('0x1c2')]+=0x1;_0x151de0[_0x60b9('0xe5')]=0xb;_0x151de0[_0x60b9('0xaa')]='Abandoned';_0x151de0[_0x60b9('0xfe')]+=0x1;_0x151de0[_0x60b9('0xfb')]+=0x1;_0x4c6745=_0x2d50a7['dialAbandonedRetryFrequency'];_0x204da9=_0x2d50a7['callAdditionalPhoneAfterMin'];_0x36aa40['createHistory'](_0x151de0)[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x1c3')));if(_0x36aa40[_0x60b9('0x1a5')](0xb,_0x2a8009,_0x2d50a7)&&!_0xe98869){if(_0x151de0[_0x60b9('0xfe')]>=_0x2d50a7[_0x60b9('0x125')]){_0x36aa40[_0x60b9('0x101')](_0x151de0,_0x57937f,_0x319b9f,_0x60b9('0x1c4'));}else{_0x36aa40[_0x60b9('0xf1')](_0x151de0,_0x57937f,_0x319b9f,_0x60b9('0x1c4'));}}break;case'20':_0x2d50a7[_0x60b9('0x68')]+=0x1;_0x151de0[_0x60b9('0xe5')]=0x14;_0x151de0[_0x60b9('0xaa')]=_0x60b9('0x1c5');_0x151de0[_0x60b9('0xff')]+=0x1;_0x151de0[_0x60b9('0xfb')]+=0x1;_0x4c6745=_0x2d50a7['dialAgentRejectRetryFrequency'];_0x204da9=_0x2d50a7[_0x60b9('0x118')];ami[_0x60b9('0x51')](_0x60b9('0x1c6'),ut[_0x60b9('0xec')](_0x2a8009,_0x60b9('0x1c7')));_0x36aa40[_0x60b9('0xdb')](_0x151de0)[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x1c8')));if(_0x36aa40[_0x60b9('0x1a5')](0x14,_0x2a8009,_0x2d50a7)&&!_0xe98869){if(_0x151de0[_0x60b9('0xff')]>=_0x2d50a7[_0x60b9('0x1c9')]){_0x36aa40[_0x60b9('0x101')](_0x151de0,_0x57937f,_0x319b9f,_0x60b9('0x1ca'));}else{_0x36aa40['stateGlobal'](_0x151de0,_0x57937f,_0x319b9f,_0x60b9('0x1ca'));}}break;default:_0x2d50a7['outboundUnknownCallsDay']+=0x1;_0x151de0[_0x60b9('0xe5')]=0xc;_0x151de0[_0x60b9('0xaa')]=_0x13938c[_0x60b9('0x10b')];_0x4c6745=_0x2d50a7['dialAgentRejectRetryFrequency'];_0x204da9=_0x2d50a7['callAdditionalPhoneAfterMin'];_0x36aa40[_0x60b9('0xdb')](_0x151de0)[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x1cb')));if(_0x36aa40[_0x60b9('0x1a5')](_0x13938c[_0x60b9('0x10b')],_0x2a8009,_0x2d50a7)&&!_0xe98869){if(_0x151de0[_0x60b9('0xee')]+_0x151de0[_0x60b9('0xfc')]+_0x151de0[_0x60b9('0x1a6')]+_0x151de0[_0x60b9('0xef')]+_0x151de0['countdropretry']+_0x151de0['countabandonedretry']+_0x151de0[_0x60b9('0xea')]+_0x151de0[_0x60b9('0xff')]>=_0x2d50a7[_0x60b9('0xf0')]){_0x36aa40['stateGlobal'](_0x151de0,_0x57937f,_0x319b9f,_0x13938c['reason']);}else{_0x36aa40['createStateFinal'](_0x151de0,_0x57937f,_0x319b9f,_0x13938c[_0x60b9('0x10b')]);}}}})[_0x60b9('0xbc')](function(_0x5b1fdc){if(_0xe98869){_0x36aa40[_0x60b9('0xc0')](_0x151de0,_0x4c6745,_0x204da9)[_0x60b9('0xbc')](function(_0xce61f7){return _0x57937f(0x1);});}});});};Dialer[_0x60b9('0x1e')][_0x60b9('0xf1')]=function(_0xa415ac,_0x2cfe63,_0x27696f,_0x395f5f){var _0x30e416=new Final(_0xa415ac);_0x30e416[_0x60b9('0xe5')]=0xf;_0x30e416[_0x60b9('0xaa')]='Global';this[_0x60b9('0x101')](_0x30e416,_0x2cfe63,_0x27696f,_0x395f5f);};Dialer[_0x60b9('0x1e')][_0x60b9('0x101')]=function(_0x3a717d,_0x382803,_0x5ab29c,_0x198879){this[_0x60b9('0xcd')](_0x3a717d)[_0x60b9('0xbc')](function(){return _0x382803(msgResponse(_0x60b9('0x1b3'),_0x60b9('0x1cc'),_0x198879));})[_0x60b9('0xb2')](function(){return _0x5ab29c(msgResponse(_0x60b9('0x1cd'),'Failure','contact\x20not\x20moved'));});};Dialer['prototype'][_0x60b9('0x9')]=function(_0x3195b6){var _0x94da5f=_0x3195b6[_0x60b9('0x1ce')]/0x64;var _0x345144=_0x3195b6[_0x60b9('0x64')]/(_0x3195b6[_0x60b9('0x64')]+_0x3195b6[_0x60b9('0x60')]);var _0x23ad9e=Math['round'](_0x3195b6[_0x60b9('0x1cf')]*(_0x3195b6[_0x60b9('0x1d0')]/0x64));var _0x4f56b4=Math[_0x60b9('0x1d1')](_0x3195b6[_0x60b9('0x1cf')]*(_0x3195b6[_0x60b9('0x1d2')]/0x64));var _0x449120=_0x3195b6[_0x60b9('0xa3')]+_0x3195b6[_0x60b9('0x9f')];var _0x85e65f=Math[_0x60b9('0x1d3')](_0x3195b6['erlangCalls']*_0x3195b6['erlangAbandonmentRate']*_0x3195b6['predictiveIntervalHitRate']*_0x3195b6[_0x60b9('0x1d4')]);if(_[_0x60b9('0x42')](_0x3195b6[_0x60b9('0x2c')])){if(!_['isUndefined'](_0x3195b6[_0x60b9('0x2b')])){_0x3195b6[_0x60b9('0x2b')]=undefined;loggerPredictive[_0x60b9('0x96')]('[startMethodPredictive][StartProgressive]',_0x60b9('0x1d5'));}if(!_[_0x60b9('0x42')](_0x3195b6[_0x60b9('0x8e')])){loggerPredictive[_0x60b9('0x96')](_0x60b9('0x1d6'),_0x60b9('0x1d7'));clearInterval(_0x3195b6['handlePredictive']);_0x3195b6[_0x60b9('0x8e')]=undefined;}_0x3195b6[_0x60b9('0x2c')]=moment()[_0x60b9('0x77')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x3195b6[_0x60b9('0x44')],_0x60b9('0x1d8'),_0x3195b6[_0x60b9('0x2c')]);this[_0x60b9('0x15b')](_0x3195b6,0x1);}else if(ifInterval(_0x3195b6['dialPredictiveInterval'],_0x3195b6[_0x60b9('0x2c')])){this[_0x60b9('0x15b')](_0x3195b6,0x1);loggerPredictiveCalls[_0x60b9('0x7b')](_0x60b9('0x1d9'),_0x3195b6['startProgressive'],_0x3195b6[_0x60b9('0x44')]);_0x3195b6['erlangCalls']=0x0;_0x3195b6[_0x60b9('0x113')]=0x0;}else if(_0x94da5f<_0x345144&&_0x3195b6[_0x60b9('0x1da')]===_0x60b9('0x1db')){freeVariablesPredictive(_0x3195b6);loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x1dc'),_0x60b9('0x1dd'),_0x345144,_0x60b9('0x2c'),_0x3195b6[_0x60b9('0x44')]);}else if(_0x85e65f<_0x3195b6[_0x60b9('0x113')]&&_0x3195b6['dialPredictiveOptimization']===_0x60b9('0x1db')){freeVariablesPredictive(_0x3195b6);loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x1de'),'Max\x20Drop\x20',_0x85e65f,'Drop\x20in\x20this\x20interval',_0x3195b6[_0x60b9('0x113')],'startProgressive',_0x3195b6['name']);}else if(!ifInterval(_0x3195b6[_0x60b9('0x1df')],_0x3195b6[_0x60b9('0x2c')])&&_[_0x60b9('0x42')](_0x3195b6['startPredictive'])&&!_[_0x60b9('0x42')](_0x3195b6[_0x60b9('0x2c')])){_0x3195b6['startPredictive']=moment()[_0x60b9('0x77')](_0x60b9('0xf5'));loggerPredictive[_0x60b9('0x7b')](_0x3195b6[_0x60b9('0x44')],'started\x20in\x20predictive\x20at',_0x3195b6[_0x60b9('0x2b')]);this[_0x60b9('0x1e0')](_0x3195b6[_0x60b9('0x1df')])['then'](this[_0x60b9('0x1e1')](_0x3195b6))[_0x60b9('0xbc')](mergeDataErlangB(_0x3195b6))[_0x60b9('0xbc')](this[_0x60b9('0x1e2')](_0x3195b6))[_0x60b9('0xb2')](loggerCatchPredictive(_0x60b9('0x1e3'),_0x3195b6));}else if(!ifInterval(_0x3195b6[_0x60b9('0x1df')],_0x3195b6[_0x60b9('0x2b')])){_0x3195b6[_0x60b9('0x113')]=0x0;_0x3195b6[_0x60b9('0x2b')]=moment()[_0x60b9('0x77')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x60b9('0x7b')](_0x3195b6[_0x60b9('0x44')],'recalculate\x20predictive\x20at',_0x3195b6[_0x60b9('0x2b')]);clearInterval(_0x3195b6[_0x60b9('0x8e')]);_0x3195b6['handlePredictive']=undefined;this[_0x60b9('0x1e0')](_0x3195b6[_0x60b9('0x1df')])['then'](this[_0x60b9('0x1e1')](_0x3195b6))[_0x60b9('0xbc')](mergeDataErlangB(_0x3195b6))[_0x60b9('0xbc')](this[_0x60b9('0x1e2')](_0x3195b6))[_0x60b9('0xb2')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x3195b6));}else if(_0x3195b6[_0x60b9('0x1cf')]&&_0x449120<_0x3195b6['predictiveIntervalAvailable']-_0x4f56b4){freeVariablesPredictive(_0x3195b6);loggerPredictive[_0x60b9('0x7b')](_0x3195b6[_0x60b9('0x44')],_0x60b9('0x1e4'),_0x449120,_0x60b9('0x1e5'),_0x3195b6[_0x60b9('0x1cf')],'-',_0x4f56b4,'=',_0x3195b6[_0x60b9('0x1cf')]-_0x4f56b4,')');}else if(_0x3195b6[_0x60b9('0x1cf')]&&_0x449120>_0x3195b6[_0x60b9('0x1cf')]+_0x23ad9e){freeVariablesPredictive(_0x3195b6);loggerPredictive[_0x60b9('0x7b')](_0x3195b6['name'],_0x60b9('0x1e4'),_0x449120,_0x60b9('0x1e6'),_0x3195b6[_0x60b9('0x1cf')],'+',_0x23ad9e,'=',_0x3195b6['predictiveIntervalAvailable']+_0x23ad9e,')');}};Dialer['prototype']['getDataPredictive']=function(_0x5a0912){var _0xc4cec9=this;return function(_0x2e9b5d){return new BPromise(function(_0x25b4c1,_0x4d5969){_[_0x60b9('0x8b')](_0x5a0912,_0x2e9b5d[0x0]);if(checkGetDataPredictive(_0x2e9b5d[0x0])){var _0x289eff=_0x5a0912['predictiveIntervalAvailable']=_0x5a0912['talking']+_0x5a0912[_0x60b9('0xa3')];var _0x17b90d=_0x5a0912[_0x60b9('0x1df')]*0x3c;var _0x26ce7a=_0x2e9b5d[0x0][_0x60b9('0x6a')]+_0x2e9b5d[0x0][_0x60b9('0x81')];var _0x9f12d7=(_0x2e9b5d[0x0][_0x60b9('0x69')]+_0x2e9b5d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2e9b5d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2e9b5d[0x0]['predictiveIntervalTotalCalls'];_0x5a0912[_0x60b9('0x6e')]=_0x9f12d7>0x0?_0x9f12d7:0x1;switch(_0x5a0912['dialPredictiveOptimization']){case _0x60b9('0x1db'):var _0xbadd4=_0x5a0912[_0x60b9('0x1ce')]/0x64;return _0xc4cec9[_0x60b9('0x1e7')](_0x289eff,_0x17b90d,_0x26ce7a,_0x9f12d7,_0xbadd4)[_0x60b9('0xbc')](function(_0x1f8c65){return _0x25b4c1(_0x1f8c65);});case _0x60b9('0x1e8'):var _0x1ee42e=_0x5a0912['dialPredictiveOptimizationPercentage']/0x64;return _0xc4cec9['busyFactor'](_0x289eff,_0x17b90d,_0x26ce7a,_0x9f12d7,_0x1ee42e)['then'](function(_0x3b4a1d){return _0x25b4c1(_0x3b4a1d);});default:return _0x4d5969(msgResponse(_0x60b9('0x1e9'),'Failure',_0x60b9('0x1ea')));}}else{return _0x4d5969(msgResponse(_0x60b9('0x1e9'),_0x60b9('0x14c'),_0x60b9('0x1eb')));}});};};Dialer[_0x60b9('0x1e')][_0x60b9('0x1ec')]=function(_0x32d0d4){var _0x3e4ebd=this;return function(_0x1bfc82){return new BPromise(function(_0x5d3f1f,_0x4ec6c0){_['merge'](_0x32d0d4,_0x1bfc82[0x0]);if(checkGetDataPredictive(_0x1bfc82[0x0])){loggerPredictive[_0x60b9('0x7b')](JSON[_0x60b9('0x4e')](_0x1bfc82[0x0]));if(_0x32d0d4[_0x60b9('0x1da')]===_0x60b9('0x1db')){return _0x3e4ebd['getVoiceQueueRtPauses'](_0x32d0d4['id'])['then'](function(_0x178d05){var _0x4836fd=_0x32d0d4[_0x60b9('0x56')]-_0x178d05[0x0]['outboundQueuePauses'];var _0x4aa272=_0x32d0d4['dialPredictiveInterval']*0x3c;var _0x19f21a=_0x1bfc82[0x0]['predictiveIntervalAvgTalktime']+_0x1bfc82[0x0][_0x60b9('0x81')];var _0x48c32d=(_0x1bfc82[0x0][_0x60b9('0x69')]+_0x1bfc82[0x0][_0x60b9('0x6c')]+_0x1bfc82[0x0][_0x60b9('0x6b')])/_0x1bfc82[0x0][_0x60b9('0x70')];var _0x51449c=_0x32d0d4['dialPredictiveOptimizationPercentage']/0x64;_0x32d0d4[_0x60b9('0x6f')]=_0x178d05[0x0][_0x60b9('0x1ed')]||0x0;_0x32d0d4[_0x60b9('0x6e')]=_0x48c32d>0x0?_0x48c32d:0x1;return _0x3e4ebd[_0x60b9('0x1e7')](_0x4836fd,_0x4aa272,_0x19f21a,_0x48c32d,_0x51449c);})['then'](function(_0x3bfa6a){return _0x5d3f1f(_0x3bfa6a);})[_0x60b9('0xb2')](function(_0x598f91){return _0x4ec6c0(msgResponse(_0x60b9('0x1ee'),_0x60b9('0x14c'),JSON[_0x60b9('0x4e')](_0x598f91)));});}if(_0x32d0d4[_0x60b9('0x1da')]===_0x60b9('0x1e8')){return _0x3e4ebd[_0x60b9('0xcb')](_0x32d0d4['id'])[_0x60b9('0xbc')](function(_0x54b04e){var _0x3831f1=_0x32d0d4[_0x60b9('0x56')]-_0x54b04e[0x0][_0x60b9('0x1ed')];var _0x48935d=_0x32d0d4[_0x60b9('0x1df')]*0x3c;var _0x244ac1=_0x1bfc82[0x0][_0x60b9('0x6a')]+_0x1bfc82[0x0][_0x60b9('0x81')];var _0x71f99d=(_0x1bfc82[0x0][_0x60b9('0x69')]+_0x1bfc82[0x0][_0x60b9('0x6c')]+_0x1bfc82[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1bfc82[0x0][_0x60b9('0x70')];var _0x4ef676=_0x32d0d4['dialPredictiveOptimizationPercentage']/0x64;_0x32d0d4['predictiveIntervalPauses']=_0x54b04e[0x0][_0x60b9('0x1ed')]||0x0;_0x32d0d4[_0x60b9('0x6e')]=_0x71f99d>0x0?_0x71f99d:0x1;return _0x3e4ebd[_0x60b9('0x1ef')](_0x3831f1,_0x48935d,_0x244ac1,_0x71f99d,_0x4ef676);})[_0x60b9('0xbc')](function(_0x3ec2a3){return _0x5d3f1f(_0x3ec2a3);})['catch'](function(_0x20cf79){return _0x4ec6c0(msgResponse(_0x60b9('0x1ee'),_0x60b9('0x14c'),JSON[_0x60b9('0x4e')](_0x20cf79)));});}}else{return _0x4ec6c0(msgResponse(_0x60b9('0x1e9'),_0x60b9('0x14c'),_0x60b9('0x1eb')));}});};};Dialer[_0x60b9('0x1e')][_0x60b9('0x1e2')]=function(_0x1eacf6){var _0x3b3962=this;return function(){var _0x16f1eb=0x0;var _0x2f1b8e=Math[_0x60b9('0x1d3')](_0x1eacf6[_0x60b9('0x1f0')]*0x3e8);if(_0x2f1b8e>0x0){_0x2f1b8e=_0x2f1b8e<0x64?0x64:_0x2f1b8e;loggerPredictive[_0x60b9('0x7b')](_0x1eacf6[_0x60b9('0x44')],_0x60b9('0x1f1'),_0x2f1b8e,_0x60b9('0x4f'));_0x1eacf6[_0x60b9('0x8e')]=setInterval(function(){_0x3b3962[_0x60b9('0x8e')](_0x1eacf6);loggerPredictiveCalls[_0x60b9('0x7b')]('[handlePredictive]',_0x16f1eb+=0x1);},_0x2f1b8e);}else{loggerPredictive[_0x60b9('0x7b')](_0x1eacf6['name'],_0x60b9('0x1f2'));}};};Dialer[_0x60b9('0x1e')][_0x60b9('0x1f3')]=function(_0x415ab6,_0x32f26c){var _0x1b4694=this;return function(_0x2f4df1){if(_[_0x60b9('0x4b')](_0x2f4df1)){if(_['isNil'](_0x32f26c[_0x60b9('0xd4')])||!_0x32f26c[_0x60b9('0x1f4')]){if(_0x415ab6[_0x60b9('0x5d')]===_0x60b9('0x8')){_0x415ab6[_0x60b9('0x12f')]=_['isUndefined'](_0x415ab6[_0x60b9('0x12f')])?!![]:_0x415ab6[_0x60b9('0x12f')];var _0x1370e6=uuid['v4']();_0x1b4694[_0x60b9('0x28')][_0x1370e6]=new Action(_0x415ab6,_0x32f26c,_0x1370e6);loggerBooked[_0x60b9('0x7b')]('[booked][checkContactBlack]',_0x1370e6,_0x60b9('0x1f5'),JSON['stringify'](_0x415ab6[_0x60b9('0x12f')]),_0x60b9('0x1f6'),_0x415ab6[_0x60b9('0x44')]);if(_0x415ab6['queueStatusComplete']){_0x415ab6['queueStatusComplete']=![];_0x1b4694[_0x60b9('0x12c')][_0x1b4694['actions'][_0x1370e6][_0x60b9('0xb5')]]=[];ami[_0x60b9('0x14e')]({'actionid':_0x1370e6,'action':_0x60b9('0x1f7'),'queue':_0x415ab6[_0x60b9('0x44')]})[_0x60b9('0xb2')](function(){_0x1b4694[_0x60b9('0xb4')](_0x415ab6);_0x1b4694['rescheduleContact']({'active':![],'ContactId':_0x1b4694[_0x60b9('0x28')][_0x1370e6]['ContactId'],'ListId':_0x1b4694[_0x60b9('0x28')][_0x1370e6][_0x60b9('0xd3')],'VoiceQueueId':_0x1b4694[_0x60b9('0x28')][_0x1370e6][_0x60b9('0xf6')]||undefined,'CampaignId':_0x1b4694[_0x60b9('0x28')][_0x1370e6][_0x60b9('0xd5')]||undefined})['catch'](loggerCatch(_0x60b9('0x1f8')));delete _0x1b4694[_0x60b9('0x28')][_0x1370e6];});}else{loggerBooked[_0x60b9('0x7b')]('[booked][checkContactBlack][else]',JSON[_0x60b9('0x4e')](_0x415ab6[_0x60b9('0x12f')]),_0x60b9('0x1f6'),_0x415ab6[_0x60b9('0x44')]);_0x1b4694['updateOriginated'](_0x415ab6);_0x1b4694[_0x60b9('0xc4')]({'active':![],'ContactId':_0x1b4694['actions'][_0x1370e6]['ContactId'],'ListId':_0x1b4694[_0x60b9('0x28')][_0x1370e6]['ListId'],'VoiceQueueId':_0x1b4694['actions'][_0x1370e6][_0x60b9('0xf6')]||undefined,'CampaignId':_0x1b4694[_0x60b9('0x28')][_0x1370e6][_0x60b9('0xd5')]||undefined})['catch'](loggerCatch(_0x60b9('0x1f8')));delete _0x1b4694[_0x60b9('0x28')][_0x1370e6];}}else{return _0x1b4694[_0x60b9('0x1f9')](_0x415ab6,_0x32f26c);}}else{if(getDiff(_0x32f26c['scheduledat'])<_0x415ab6[_0x60b9('0x1fa')]*0x3c){if(_0x32f26c[_0x60b9('0x16b')]&&!_0x32f26c[_0x60b9('0x16b')][_0x60b9('0x1fb')]){_0x1b4694['preview'][_0x60b9('0x132')](_0x32f26c['id'])[_0x60b9('0x21')](function(){_0x1b4694['updateOriginated'](_0x415ab6);});}else{_0x1b4694['unlockContact']({'active':![]},_0x32f26c['id'],0x1)['finally'](function(){_0x1b4694[_0x60b9('0xb4')](_0x415ab6);});}}else{_0x415ab6['outboundReCallsDay']+=0x1;_0x1b4694[_0x60b9('0xb4')](_0x415ab6);if(_0x415ab6[_0x60b9('0x1fc')]){_0x1b4694[_0x60b9('0xc4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x32f26c[_0x60b9('0xd2')],'ListId':_0x32f26c[_0x60b9('0xd3')],'VoiceQueueId':_0x32f26c[_0x60b9('0xf6')]||undefined,'CampaignId':_0x32f26c[_0x60b9('0xd5')]||undefined})[_0x60b9('0xb2')](loggerCatch(_0x60b9('0x1fd')));_0x1b4694['createHistory'](createObjHistory(_0x415ab6,_0x32f26c,_0x60b9('0x1fe'),0x17,_0x60b9('0x1ff')))['catch'](loggerCatch(_0x60b9('0x200')));}else{_0x1b4694[_0x60b9('0xd0')](createObjHistory(_0x415ab6,_0x32f26c,_0x60b9('0x201'),0x16,_0x60b9('0x202')),_0x60b9('0x203'),_0x60b9('0x204'));}}}}else{_0x415ab6[_0x60b9('0x205')]+=0x1;_0x1b4694[_0x60b9('0xd0')](createObjHistory(_0x415ab6,_0x32f26c,'BLACKLIST',0xd,_0x60b9('0x206')),_0x60b9('0x207'),'[Originate][MoveBlacklist]');throw _0x60b9('0x208');}};};Dialer['prototype'][_0x60b9('0x160')]=function(_0x17cdc9){var _0x5c0a12=this;var _0x783810=_0x17cdc9['limitCalls']-_0x17cdc9[_0x60b9('0x71')]-_0x17cdc9['temp'];emitCampaignSummary(_0x17cdc9);if(_0x783810>0x0){if(_0x783810>this['maxNumberOriginate']){_0x783810=this[_0x60b9('0x26')];}_0x17cdc9[_0x60b9('0xc7')]+=_0x783810;this[_0x60b9('0xc9')](_0x17cdc9['id'],_0x783810,_0x17cdc9[_0x60b9('0x209')],_0x17cdc9)[_0x60b9('0xbc')](function(_0x103184){_0x17cdc9['temp']-=_0x783810;_0x17cdc9[_0x60b9('0xc7')]=_0x17cdc9[_0x60b9('0xc7')]>0x0?_0x17cdc9[_0x60b9('0xc7')]:0x0;if(!checkContactEmpty(_0x103184)){_0x17cdc9[_0x60b9('0x43')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x60b9('0x7b')]('[getContactCampaign2][Empty]'+_0x17cdc9[_0x60b9('0x44')]);}else{_0x17cdc9['originated']+=_0x103184[_0x60b9('0x97')];_0x17cdc9[_0x60b9('0x43')]=_0x60b9('0x20a');for(var _0x5d00de=0x0;_0x5d00de<_0x103184[_0x60b9('0x97')];_0x5d00de+=0x1){_0x17cdc9[_0x60b9('0x20b')]+=0x1;if(_[_0x60b9('0xdd')](_0x103184[_0x5d00de])||_[_0x60b9('0xdd')](_0x103184[_0x5d00de][_0x60b9('0x18e')])||_[_0x60b9('0xdd')](_0x103184[_0x5d00de][_0x60b9('0x178')])){_0x5c0a12[_0x60b9('0x20c')](_0x60b9('0x20d'),_0x17cdc9,_0x103184[_0x5d00de]);}else{_0x5c0a12['checkIsBlackListIvr'](_[_0x60b9('0xd1')](_0x103184[_0x5d00de],['CampaignId',_0x60b9('0x20e')]))['then'](_0x5c0a12[_0x60b9('0x1f3')](_0x17cdc9,_0x103184[_0x5d00de]))[_0x60b9('0xb2')](_0x5c0a12[_0x60b9('0x20f')](_0x60b9('0x210'),_0x17cdc9));}}}})[_0x60b9('0xb2')](loggerGetContactDialer('[getContactCampaign2]',_0x17cdc9,_0x783810));}};Dialer[_0x60b9('0x1e')][_0x60b9('0x15b')]=function(_0x247c8f,_0x5671a6){var _0x499b55=this;var _0x3cea7f=[];var _0x2a9f3a=_0x5671a6>=0x1?_0x5671a6:0x1;if(_0x247c8f['dialMethod']===_0x60b9('0x8')){_0x2a9f3a=0x1;}var _0x5afe5d=Math[_0x60b9('0x1d3')](_0x247c8f[_0x60b9('0xa3')]*_0x2a9f3a)-_0x247c8f['originated']-_0x247c8f[_0x60b9('0xc7')];emitVoiceQueueSummary(_0x247c8f);if(_0x247c8f[_0x60b9('0x211')]>0x0){var _0xf95f72=_0x247c8f[_0x60b9('0x211')]-_0x247c8f[_0x60b9('0x71')]-_0x247c8f[_0x60b9('0x9f')]-_0x247c8f[_0x60b9('0xc7')]-_0x247c8f[_0x60b9('0xa1')];if(_0x5afe5d>_0xf95f72){_0x5afe5d=_0xf95f72;}}if(_0x5afe5d>0x0){if(_0x247c8f[_0x60b9('0x5d')]==='booked'){_0x5afe5d=0x1;}if(_0x5afe5d>this[_0x60b9('0x26')]){_0x5afe5d=this[_0x60b9('0x26')];}_0x247c8f[_0x60b9('0xc7')]+=_0x5afe5d;for(var _0x346b3d in this[_0x60b9('0x24')]){if(typeof this[_0x60b9('0x24')][_0x346b3d]!==_0x60b9('0x98')){if(this[_0x60b9('0x24')][_0x346b3d][_0x60b9('0xe5')]===_0x60b9('0x212')&&this[_0x60b9('0x24')][_0x346b3d]['status']===_0x60b9('0x168')){_0x3cea7f[_0x60b9('0x14d')](this[_0x60b9('0x24')][_0x346b3d]['id']);}}}this[_0x60b9('0xc6')](_0x247c8f['id'],_0x3cea7f,_0x5afe5d,_0x247c8f['dialOrderByScheduledAt'],_0x247c8f)[_0x60b9('0xbc')](function(_0x11db57){_0x247c8f[_0x60b9('0xc7')]-=_0x5afe5d;_0x247c8f[_0x60b9('0xc7')]=_0x247c8f['temp']>0x0?_0x247c8f[_0x60b9('0xc7')]:0x0;if(!checkContactEmpty(_0x11db57)){_0x499b55[_0x60b9('0xb8')](_0x247c8f)['then'](sendMessageReschedule(_0x247c8f))['catch'](loggerCatch(_0x60b9('0xb9')));}else{_0x247c8f['originated']+=_0x11db57['length'];_0x247c8f[_0x60b9('0x43')]=_0x247c8f[_0x60b9('0x5d')]===_0x60b9('0x8')?'ACTIVE':_0x60b9('0x20a');for(var _0x4ce59b=0x0;_0x4ce59b<_0x11db57[_0x60b9('0x97')];_0x4ce59b+=0x1){if(_[_0x60b9('0xdd')](_0x11db57[_0x4ce59b])||_['isNil'](_0x11db57[_0x4ce59b][_0x60b9('0x18e')])||_[_0x60b9('0xdd')](_0x11db57[_0x4ce59b][_0x60b9('0x178')])){_0x499b55[_0x60b9('0x20c')](_0x60b9('0x20d'),_0x247c8f,_0x11db57[_0x4ce59b]);}else{_0x499b55[_0x60b9('0xba')](_[_0x60b9('0xd1')](_0x11db57[_0x4ce59b],[_0x60b9('0xf6'),_0x60b9('0x20e')]))[_0x60b9('0xbc')](_0x499b55[_0x60b9('0x1f3')](_0x247c8f,_0x11db57[_0x4ce59b]))[_0x60b9('0xb2')](_0x499b55['loggerHandler'](_0x60b9('0x20d'),_0x247c8f));}}}})[_0x60b9('0xb2')](loggerGetContactDialer(_0x60b9('0x213'),_0x247c8f,_0x5afe5d));}};Dialer[_0x60b9('0x1e')][_0x60b9('0x8e')]=function(_0x27d7a8){if(_0x27d7a8[_0x60b9('0x211')]>0x0){var _0x2766e2=_0x27d7a8[_0x60b9('0x211')]-_0x27d7a8[_0x60b9('0x71')]-_0x27d7a8[_0x60b9('0x9f')];if(_0x2766e2>0x0){this['tryOriginatePredictive'](_0x27d7a8);}else{loggerPredictiveCalls[_0x60b9('0x7b')](_0x60b9('0x214'));}}else{this[_0x60b9('0x215')](_0x27d7a8);}};Dialer[_0x60b9('0x1e')][_0x60b9('0x215')]=function(_0x1280ee){var _0x1fa2af=this;var _0x307bdc=[];_0x1280ee['originated']+=0x1;for(var _0x560fe9 in this[_0x60b9('0x24')]){if(typeof this[_0x60b9('0x24')][_0x560fe9]!==_0x60b9('0x98')){if(this[_0x60b9('0x24')][_0x560fe9][_0x60b9('0xe5')]===_0x60b9('0x212')&&this[_0x60b9('0x24')][_0x560fe9][_0x60b9('0xb0')]===_0x60b9('0x168')){_0x307bdc[_0x60b9('0x14d')](this[_0x60b9('0x24')][_0x560fe9]['id']);}}}this[_0x60b9('0xc6')](_0x1280ee['id'],_0x307bdc,0x1,_0x1280ee['dialOrderByScheduledAt'],_0x1280ee)['then'](function(_0x47729d){if(!checkContactEmpty(_0x47729d)){checkContactLowerLimitOriginate(_0x1280ee,0x1,0x0);_0x1fa2af['countReScheduled'](_0x1280ee)[_0x60b9('0xbc')](sendMessageReschedule(_0x1280ee))[_0x60b9('0xb2')](loggerCatch(_0x60b9('0xb9')));}else{_0x1280ee['message']='RUNNING';if(_['isNil'](_0x47729d[0x0])||_[_0x60b9('0xdd')](_0x47729d[0x0][_0x60b9('0x18e')])||_[_0x60b9('0xdd')](_0x47729d[0x0][_0x60b9('0x178')])){_0x1fa2af['emptyContact'](_0x60b9('0x20d'),_0x1280ee,_0x47729d[0x0]);}else{_0x1fa2af[_0x60b9('0xba')](_[_0x60b9('0xd1')](_0x47729d[0x0],[_0x60b9('0xf6'),'Contact.phone']))[_0x60b9('0xbc')](_0x1fa2af[_0x60b9('0x1f3')](_0x1280ee,_0x47729d[0x0]))['catch'](_0x1fa2af[_0x60b9('0x20f')](_0x60b9('0x216'),_0x1280ee));}}})['catch'](loggerGetContactDialer(_0x60b9('0x217'),_0x1280ee,0x1));emitVoiceQueueSummary(_0x1280ee);};Dialer[_0x60b9('0x1e')][_0x60b9('0x1e7')]=function(_0x530026,_0x139033,_0x360542,_0x5291c8,_0x26758e,_0x8a3d74){loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x218'));loggerPredictive['info'](_0x60b9('0x219'),_0x530026);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x139033);loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x21a'),_0x360542);loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x21b'),_0x5291c8);loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x21c'),_0x26758e);loggerPredictive[_0x60b9('0x7b')]('---------------------------');return new BPromise(function(_0x525379,_0x2c4dc7){if(_0x530026<=0x0||isNaN(_0x530026)){return _0x2c4dc7(msgResponse('[abandonmentRate]',_0x60b9('0x4d'),_0x60b9('0x21d')+_0x530026));}if(_0x360542<=0x0||isNaN(_0x360542)){return _0x2c4dc7(msgResponse(_0x60b9('0x21e'),'Error',_0x60b9('0x21f')+_0x360542));}if(_0x5291c8<=0x0||isNaN(_0x5291c8)){return _0x2c4dc7(msgResponse(_0x60b9('0x21e'),_0x60b9('0x4d'),_0x60b9('0x220')+_0x5291c8));}if(_0x139033<=0x0||isNaN(_0x139033)){return _0x2c4dc7(msgResponse(_0x60b9('0x21e'),_0x60b9('0x4d'),_0x60b9('0x221')+_0x139033));}if(_0x26758e<=0x0||isNaN(_0x26758e)){return _0x2c4dc7(msgResponse('[abandonmentRate]',_0x60b9('0x4d'),_0x60b9('0x222')+_0x26758e));}_0x8a3d74=_0x8a3d74||0x0;var _0x2d3edc=0x1/_0x360542;var _0x794f7f=0x0;var _0x12e96b=0x0;var _0x6fc787=0x0;var _0x3754e3=0x0;for(var _0x15ea20=0x0;_0x6fc787<_0x26758e;_0x15ea20+=0x1){_0x12e96b=_0x15ea20/_0x139033;_0x794f7f=(_0x5291c8*_0x12e96b+_0x8a3d74)/_0x2d3edc;_0x6fc787=erlangb(_0x794f7f,_0x530026);_0x3754e3=_0x794f7f/_0x530026*(0x1-erlangb(_0x794f7f,_0x530026));}return _0x525379({'erlangCalls':_0x15ea20,'erlangCallToSecond':_0x139033/_0x15ea20,'erlangAbandonmentRate':_0x6fc787,'erlangBusyFactor':_0x3754e3});});};Dialer[_0x60b9('0x1e')][_0x60b9('0x1ef')]=function(_0x308273,_0x5a57c5,_0xec3e22,_0x48239f,_0x5c772e,_0x254a41){loggerPredictive['info'](_0x60b9('0x223'));loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x219'),_0x308273);loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x224'),_0x5a57c5);loggerPredictive[_0x60b9('0x7b')]('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',_0xec3e22);loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x21b'),_0x48239f);loggerPredictive[_0x60b9('0x7b')](_0x60b9('0x225'),_0x5c772e);loggerPredictive['info'](_0x60b9('0x83'));return new BPromise(function(_0x5d54bc,_0x54899b){if(_0x308273<=0x0||isNaN(_0x308273)){return _0x54899b(msgResponse(_0x60b9('0x226'),_0x60b9('0x4d'),_0x60b9('0x21d')+_0x308273));}if(_0xec3e22<=0x0||isNaN(_0xec3e22)){return _0x54899b(msgResponse(_0x60b9('0x226'),_0x60b9('0x4d'),_0x60b9('0x21f')+_0xec3e22));}if(_0x48239f<=0x0||isNaN(_0x48239f)){return _0x54899b(msgResponse(_0x60b9('0x226'),_0x60b9('0x4d'),'p\x20=\x20'+_0x48239f));}if(_0x5a57c5<=0x0||isNaN(_0x5a57c5)){return _0x54899b(msgResponse(_0x60b9('0x226'),_0x60b9('0x4d'),_0x60b9('0x221')+_0x5a57c5));}if(_0x5c772e<=0x0||isNaN(_0x5c772e)){return _0x54899b(msgResponse(_0x60b9('0x226'),_0x60b9('0x4d'),_0x60b9('0x227')+_0x5c772e));}_0x254a41=_0x254a41||0x0;var _0xd695f7=0x1/_0xec3e22;var _0x1e26c6=0x0;var _0x4a6e8c=0x0;var _0xe276=0x0;var _0x4846ff=0x0;for(var _0x47d152=0x0;_0x4846ff<_0x5c772e;_0x47d152+=0x1){_0x4a6e8c=_0x47d152/_0x5a57c5;_0x1e26c6=(_0x48239f*_0x4a6e8c+_0x254a41)/_0xd695f7;_0xe276=erlangb(_0x1e26c6,_0x308273);_0x4846ff=_0x1e26c6/_0x308273*(0x1-erlangb(_0x1e26c6,_0x308273));}return _0x5d54bc({'erlangCalls':_0x47d152,'erlangCallToSecond':_0x5a57c5/_0x47d152,'erlangAbandonmentRate':_0xe276,'erlangBusyFactor':_0x4846ff});});};module[_0x60b9('0x228')]=Dialer;
\ No newline at end of file
+var _0xc901=['state','statedesc','HangupInAMD','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','MACHINE','Machine','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','YYYY-MM-DD\x20HH:mm:ss','ContactId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','dialGlobalMaxRetry','[syncHangupIvr][createHistory]','AnswerAGI','AGI','[syncHangupIvr]','dialQueueProject','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','TIMEOUT','countdropretry','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','minutes','[rescheduleContact][Drop]','starttime','calleridname','[syncAgentComplete][createHistory][10]','Abandoned','dropreason','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','calleridnum','actionid','locked','paused','stateinterface','rrmemory','push','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Intervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','true','content','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','Queue','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','checkPreviewRecallReminder','undefined','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','ACTIVE','xcally-motion-dialer','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','XMD-CAMPAIGNID','Contact','tags','createdAt','%s%s','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','dialOriginateTimeout','[originate][error]','originate\x20action\x20Error','getQueue','response','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','countcongestionretry','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','dialBusyRetryFrequency','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','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','Drop\x20in\x20this\x20interval','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','startMethodPredictive','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','voicePause','[rescheduleContact][dialRecallInQueue]','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','[getContactCampaign2][Empty]','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','[actionOriginate]\x20','tryOriginatePredictive','[handlePredictive][limitChannel]','RUNNING','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','Ts\x20=\x20','[abandonmentRate]','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','util','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./queueCallerAbandon','./hangup','env','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','syncQueueSummary','syncQueueSummaryComplete','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','outbound','strategy','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','abandoned','waiting','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','format','voice:queue:%s','voice_queue:save','campaign:save','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','info','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\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','handlePredictive','preview','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','endtime','clearZombieChannels','uniqueId','[uniqueid]','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','type','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','resolve','checkIsBlackList','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','pick','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','active','SIP/%s','reachable','unmonitored','variable','amdstatus','exten','dialAMDActive','value','HANGUP','uniqueid'];(function(_0xd4b570,_0x57c71c){var _0x44d795=function(_0x2f9c3e){while(--_0x2f9c3e){_0xd4b570['push'](_0xd4b570['shift']());}};_0x44d795(++_0x57c71c);}(_0xc901,0x142));var _0x1c90=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc901[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0x1c90('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var md5=require(_0x1c90('0x1'));var Redis=require(_0x1c90('0x2'));var ut=require('../preview/util/util');var config=require(_0x1c90('0x3'));var logger=require(_0x1c90('0x4'))(_0x1c90('0x5'));var loggerBooked=require(_0x1c90('0x4'))(_0x1c90('0x6'));var loggerPredictive=require(_0x1c90('0x4'))(_0x1c90('0x7'));var loggerPredictiveCalls=require(_0x1c90('0x4'))(_0x1c90('0x8'));var loggerSyncQueueSummary=require(_0x1c90('0x4'))('syncQueueSummary');var ami=require(_0x1c90('0x9'));config[_0x1c90('0xa')]=_[_0x1c90('0xb')](config[_0x1c90('0xa')],{'host':_0x1c90('0xc'),'port':0x18eb});var io=require(_0x1c90('0xd'))(new Redis(config[_0x1c90('0xa')]));var cmHopper=require(_0x1c90('0xe'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperAdditionalPhone=require(_0x1c90('0xf'));var cmHopperBlack=require(_0x1c90('0x10'));var voiceQueueRt=require(_0x1c90('0x11'));var RpcSetting=require('../rpc/setting');var Action=require('./action');var History=require(_0x1c90('0x12'));var Final=require(_0x1c90('0x13'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x1c90('0x14'));var Hangup=require(_0x1c90('0x15'));var ipAgi=process[_0x1c90('0x16')]['XCALLY_IP_AGI']||_0x1c90('0x17');var strategy={'rrmemory':'rrmemory','roundrobin':_0x1c90('0x18')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x1c90('0x19')][_0x1c90('0x1a')]=function(_0x42d8a4){this['tail']=this[_0x1c90('0x1b')]?this['tail'][_0x1c90('0x1c')](_0x42d8a4):_0x42d8a4();};function Dialer(_0x142a80,_0x5f1025){this[_0x1c90('0x1d')]=new Sequence();this['preview']=_0x5f1025;this['voiceQueues']=_0x142a80[_0x1c90('0x1e')];this['campaigns']=_0x142a80[_0x1c90('0x1f')];this[_0x1c90('0x20')]=_0x142a80[_0x1c90('0x20')];this[_0x1c90('0x21')]=_0x142a80['trunks'];this[_0x1c90('0x22')]=config['maxNumberOriginate']||0x2;this['channels']={};this[_0x1c90('0x23')]={};this[_0x1c90('0x24')]={};this['uniqueId']={};this[_0x1c90('0x25')]={};this[_0x1c90('0x26')]={};this[_0x1c90('0x27')]={};this[_0x1c90('0x28')]={};this[_0x1c90('0x29')]={};this[_0x1c90('0x2a')]={};ami['on']('agentconnect',this[_0x1c90('0x2b')][_0x1c90('0x2c')](this));ami['on'](_0x1c90('0x2d'),this[_0x1c90('0x2e')][_0x1c90('0x2c')](this));ami['on'](_0x1c90('0x2f'),this[_0x1c90('0x30')]['bind'](this));ami['on'](_0x1c90('0x31'),this[_0x1c90('0x32')][_0x1c90('0x2c')](this));ami['on']('custom:queuesummary',this[_0x1c90('0x33')][_0x1c90('0x2c')](this));ami['on']('custom:queuesummarycomplete',this[_0x1c90('0x34')][_0x1c90('0x2c')](this));ami['on']('hangup',this[_0x1c90('0x35')][_0x1c90('0x2c')](this));ami['on'](_0x1c90('0x36'),this[_0x1c90('0x37')][_0x1c90('0x2c')](this));ami['on'](_0x1c90('0x38'),this[_0x1c90('0x39')][_0x1c90('0x2c')](this));ami['on']('queuemember',this[_0x1c90('0x3a')][_0x1c90('0x2c')](this));ami['on'](_0x1c90('0x3b'),this[_0x1c90('0x3c')][_0x1c90('0x2c')](this));this[_0x1c90('0x3d')]();this[_0x1c90('0x3e')]();RpcSetting[_0x1c90('0x3f')]()[_0x1c90('0x40')](function(_0x244029){previewRecallmeReminderInterval=_0x244029[_0x1c90('0x41')];});}function isNotNull(_0x4dbe4a){return _0x4dbe4a!==null&&!_[_0x1c90('0x42')](_0x4dbe4a);}function checkIsLoggedIn(_0xb74892,_0x50ad09){return function(){if(_0x50ad09<=0x0){_0xb74892[_0x1c90('0x43')]='AGENTS_NOT_LOGGED';throw _0xb74892[_0x1c90('0x44')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x3f1c92){return _0x3f1c92;}function checkIsActive(_0x5d19f6,_0x25d534){return function(){if(!isActive(_0x25d534)){_0x5d19f6[_0x1c90('0x43')]='NOT_ACTIVE';throw _0x5d19f6[_0x1c90('0x44')]+_0x1c90('0x45');}};}function checkInterval(_0x5ef159){return function(){if(!isNotNull(_0x5ef159[_0x1c90('0x46')])){_0x5ef159[_0x1c90('0x43')]=_0x1c90('0x47');throw _0x5ef159[_0x1c90('0x44')]+_0x1c90('0x48');}if(!isNotNull(_0x5ef159['Interval']['Intervals'])){_0x5ef159['message']='INTERVAL_IS_NULL';throw _0x5ef159['name']+_0x1c90('0x48');}if(!isNotNull(_[_0x1c90('0x49')](_0x5ef159[_0x1c90('0x46')]['Intervals']))){_0x5ef159[_0x1c90('0x43')]='INTERVAL_IS_NULL';throw _0x5ef159[_0x1c90('0x44')]+_0x1c90('0x48');}};}function msgResponse(_0x56278e,_0x59ddbe,_0x4111b6){return{'action':_0x56278e,'response':_0x59ddbe,'message':_0x4111b6,'stack':_0x4111b6};}function myreject(_0x2a0a45){return function(_0x45af29){return _0x2a0a45(msgResponse(_0x1c90('0x4a'),_0x1c90('0x4b'),JSON[_0x1c90('0x4c')](_0x45af29)));};}function getSeconds(_0x1645b0,_0x4f0a45){var _0x508025=moment(_0x1645b0)[_0x1c90('0x4d')](0x0);var _0x221816=moment(_0x4f0a45)[_0x1c90('0x4d')](0x0);return _0x508025[_0x1c90('0x4e')](_0x221816,_0x1c90('0x4f'));}function emit(_0x33df0a,_0x1d38f2,_0x1ce496){io['to'](_0x33df0a)[_0x1c90('0x50')](_0x1d38f2,_0x1ce496);}function emitVoiceQueueSummary(_0xd8eab5){if(_0xd8eab5['type']===_0x1c90('0x51')){var _0x4b151d={'id':_0xd8eab5['id'],'name':_0xd8eab5['name'],'strategy':_0xd8eab5[_0x1c90('0x52')],'answered':_0xd8eab5['answered'],'available':_0xd8eab5['available'],'loggedIn':_0xd8eab5[_0x1c90('0x53')],'pTalking':_0xd8eab5[_0x1c90('0x54')],'sumBillable':_0xd8eab5['sumBillable'],'sumDuration':_0xd8eab5[_0x1c90('0x55')],'sumHoldTime':_0xd8eab5[_0x1c90('0x56')]||0x0,'talking':_0xd8eab5[_0x1c90('0x57')],'total':_0xd8eab5[_0x1c90('0x58')],'type':_0xd8eab5['type'],'unmanaged':_0xd8eab5['unmanaged'],'abandoned':_0xd8eab5[_0x1c90('0x59')],'waiting':_0xd8eab5[_0x1c90('0x5a')],'loggedInDb':_0xd8eab5['loggedInDb'],'dialActive':_0xd8eab5[_0x1c90('0x5b')],'dialMethod':_0xd8eab5['dialMethod'],'dialOriginateCallerIdName':_0xd8eab5[_0x1c90('0x5c')],'dialOriginateCallerIdNumber':_0xd8eab5[_0x1c90('0x5d')],'dialOriginateTimeout':_0xd8eab5['dialOriginateTimeout'],'dialPrefix':_0xd8eab5[_0x1c90('0x5e')],'outboundAnswerAgiCallsDay':_0xd8eab5[_0x1c90('0x5f')],'outboundAnswerCallsDay':_0xd8eab5[_0x1c90('0x60')],'outboundBlacklistCallsDay':_0xd8eab5[_0x1c90('0x61')],'outboundBusyCallsDay':_0xd8eab5[_0x1c90('0x62')],'outboundCongestionCallsDay':_0xd8eab5[_0x1c90('0x63')],'outboundDropCallsDayACS':_0xd8eab5[_0x1c90('0x64')],'outboundDropCallsDayCallersExit':_0xd8eab5[_0x1c90('0x65')],'outboundDropCallsDayTimeout':_0xd8eab5[_0x1c90('0x66')],'outboundNoAnswerCallsDay':_0xd8eab5[_0x1c90('0x67')],'outboundNoSuchCallsDay':_0xd8eab5[_0x1c90('0x68')],'outboundOriginateFailureCallsDay':_0xd8eab5['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0xd8eab5[_0x1c90('0x69')],'outboundRejectCallsDay':_0xd8eab5['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0xd8eab5[_0x1c90('0x6a')],'predictiveIntervalAnsweredCalls':_0xd8eab5['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0xd8eab5['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0xd8eab5[_0x1c90('0x6b')],'predictiveIntervalDroppedCallsCallersExit':_0xd8eab5[_0x1c90('0x6c')],'predictiveIntervalDroppedCallsTimeout':_0xd8eab5[_0x1c90('0x6d')],'predictiveIntervalErlangCalls':_0xd8eab5[_0x1c90('0x6e')],'predictiveIntervalErlangCallsDroppedCalls':_0xd8eab5[_0x1c90('0x6f')],'predictiveIntervalHitRate':_0xd8eab5[_0x1c90('0x70')],'predictiveIntervalMultiplicativeFactor':_0xd8eab5[_0x1c90('0x71')],'predictiveIntervalPauses':_0xd8eab5[_0x1c90('0x72')],'predictiveIntervalAvailable':_0xd8eab5[_0x1c90('0x73')],'predictiveIntervalTotalCalls':_0xd8eab5['predictiveIntervalTotalCalls'],'message':_0xd8eab5['message'],'originated':_0xd8eab5[_0x1c90('0x74')],'erlangCalls':_0xd8eab5[_0x1c90('0x75')],'erlangCallToSecond':_0xd8eab5[_0x1c90('0x76')],'erlangAbandonmentRate':_0xd8eab5[_0x1c90('0x77')],'erlangBusyFactor':_0xd8eab5[_0x1c90('0x78')],'startPredictive':_0xd8eab5[_0x1c90('0x26')],'startProgressive':_0xd8eab5[_0x1c90('0x27')]};if(_0xd8eab5[_0x1c90('0x79')]){_0x4b151d['Trunk']={'id':_0xd8eab5[_0x1c90('0x79')]['id'],'name':_0xd8eab5[_0x1c90('0x79')][_0x1c90('0x44')],'active':_0xd8eab5['Trunk']['active'],'callerid':_0xd8eab5[_0x1c90('0x79')]['callerid']};}if(_0xd8eab5[_0x1c90('0x46')]){_0x4b151d['Interval']={'id':_0xd8eab5['Interval']['id'],'name':_0xd8eab5[_0x1c90('0x46')][_0x1c90('0x44')]};}var _0x4b26f0=md5(JSON['stringify'](_0x4b151d));if(_0xd8eab5[_0x1c90('0x1')]!==_0x4b26f0){_0xd8eab5['md5']=_0x4b26f0;emit(util[_0x1c90('0x7a')](_0x1c90('0x7b'),_0x4b151d[_0x1c90('0x44')]),_0x1c90('0x7c'),_0x4b151d);}}}function emitCampaignSummary(_0x4f7076){if(_0x4f7076['type']==='ivr'){emit(util[_0x1c90('0x7a')]('campaign:ivr:%s',_0x4f7076[_0x1c90('0x44')]),_0x1c90('0x7d'),_0x4f7076);}}function checkGetDataPredictive(_0x50794e){if(isNotNull(_0x50794e)&&!_[_0x1c90('0x49')](_0x50794e)){loggerPredictive['info'](_0x1c90('0x7e'));loggerPredictive['info'](_0x1c90('0x7f'),_0x50794e[_0x1c90('0x80')]);loggerPredictive[_0x1c90('0x81')](_0x1c90('0x82'),_0x50794e['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x1c90('0x81')](_0x1c90('0x83'),_0x50794e[_0x1c90('0x6d')]);loggerPredictive[_0x1c90('0x81')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x50794e[_0x1c90('0x6c')]);loggerPredictive[_0x1c90('0x81')](_0x1c90('0x84'),_0x50794e[_0x1c90('0x85')]);loggerPredictive['info'](_0x1c90('0x86'),_0x50794e[_0x1c90('0x6b')]);loggerPredictive['info'](_0x1c90('0x87'));if(_0x50794e[_0x1c90('0x80')]>0x0){if(!_[_0x1c90('0x42')](_0x50794e['predictiveIntervalAvgTalktime'])&&_0x50794e['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x1c90('0x81')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x1c90('0x42')](_0x50794e[_0x1c90('0x85')])&&_0x50794e[_0x1c90('0x85')]>0x0){return!![];}loggerPredictive[_0x1c90('0x81')](_0x1c90('0x88'));}else{loggerPredictive[_0x1c90('0x81')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x7c9d23){return function(_0x38fa40){loggerPredictive['info'](_0x1c90('0x89'));loggerPredictive[_0x1c90('0x81')](_0x1c90('0x8a'),_0x38fa40[_0x1c90('0x75')]);loggerPredictive[_0x1c90('0x81')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x38fa40[_0x1c90('0x76')]);loggerPredictive[_0x1c90('0x81')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x38fa40[_0x1c90('0x77')]);loggerPredictive[_0x1c90('0x81')](_0x1c90('0x8b'),_0x38fa40[_0x1c90('0x78')]);loggerPredictive['info'](_0x1c90('0x8c'),_0x38fa40['erlangAbandonmentRate']);loggerPredictive[_0x1c90('0x81')](_0x1c90('0x87'));_[_0x1c90('0x8d')](_0x7c9d23,_0x38fa40);};}function getDiff(_0x17fbd3){var _0x41706b=moment()['milliseconds'](0x0);var _0x46cf42=moment(_0x17fbd3)[_0x1c90('0x4d')](0x0);return _0x41706b[_0x1c90('0x4e')](_0x46cf42,_0x1c90('0x4f'));}function ifInterval(_0x312d88,_0x580ddd){if(_['isUndefined'](_0x580ddd)){return![];}return getDiff(_0x580ddd)<_0x312d88*0x3c;}function freeVariablesPredictive(_0x43dc81){if(isNotNull(_0x43dc81)){if(!_['isUndefined'](_0x43dc81[_0x1c90('0x27')])){_0x43dc81[_0x1c90('0x27')]=undefined;loggerPredictive[_0x1c90('0x81')](_0x43dc81[_0x1c90('0x44')],_0x1c90('0x8e'));}if(!_[_0x1c90('0x42')](_0x43dc81[_0x1c90('0x26')])){_0x43dc81[_0x1c90('0x26')]=undefined;loggerPredictive[_0x1c90('0x81')](_0x43dc81[_0x1c90('0x44')],'clearing\x20variable\x20start\x20predictive');}if(!_['isUndefined'](_0x43dc81[_0x1c90('0x8f')])){clearInterval(_0x43dc81[_0x1c90('0x8f')]);_0x43dc81[_0x1c90('0x8f')]=undefined;loggerPredictive[_0x1c90('0x81')](_0x43dc81['name'],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x4fb432,_0x64fd5c){if(_0x64fd5c===0x0){return 0x0;}var _0x325a83=0x1;for(var _0x103fff=0x1;_0x103fff<=_0x64fd5c;_0x103fff+=0x1){_0x325a83=0x1+_0x325a83*_0x103fff/_0x4fb432;}return 0x1/_0x325a83;}function isVoiceQueueOutbound(_0x756203){return _0x756203===_0x1c90('0x51');}function isNotPreview(_0x479e06){return _0x479e06!==_0x1c90('0x90');}function isCampaignIvr(_0x54eed4){return _0x54eed4===_0x1c90('0x91');}function getCallerId(_0x2b3e1c,_0x5b0556,_0x4155cf){if(!_[_0x1c90('0x42')](_0x4155cf)&&typeof _0x4155cf===_0x1c90('0x92')&&!_[_0x1c90('0x49')](_0x4155cf)){if(!_['isUndefined'](_0x5b0556)&&typeof _0x5b0556==='string'&&!_[_0x1c90('0x49')](_0x5b0556)){return util['format'](_0x1c90('0x93'),_0x5b0556,_0x4155cf);}return util[_0x1c90('0x7a')](_0x1c90('0x93'),_0x4155cf,_0x4155cf);}if(!_[_0x1c90('0x42')](_0x2b3e1c)&&typeof _0x2b3e1c===_0x1c90('0x92')&&!_[_0x1c90('0x49')](_0x2b3e1c)){return _0x2b3e1c;}return _0x1c90('0x94');}function loggerCatchQueueSummary(_0x33c172,_0x297655){return function(_0x35d9cf){freeVariablesPredictive(_0x297655);emitVoiceQueueSummary(_0x297655);emitCampaignSummary(_0x297655);loggerSyncQueueSummary[_0x1c90('0x95')](_0x33c172,util[_0x1c90('0x96')](_0x35d9cf,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2b693b,_0x47c1af){return function(_0x28d75e){loggerPredictive[_0x1c90('0x97')](_0x47c1af[_0x1c90('0x44')],_0x2b693b);loggerPredictive[_0x1c90('0x97')](_0x28d75e['stack']);freeVariablesPredictive(_0x47c1af);};}function loggerCatch(_0x4cb5bd){return function(_0x132895){logger['error'](_0x4cb5bd,util[_0x1c90('0x96')](_0x132895,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x55ac04){return _0x55ac04&&!_['isUndefined'](_0x55ac04)&&_0x55ac04['length']>0x0;}function decremetOriginate(_0x32d3b4){if(!_['isUndefined'](_0x32d3b4)&&_0x32d3b4!==null){if(typeof _0x32d3b4[_0x1c90('0x74')]!=='undefined'){if(_0x32d3b4[_0x1c90('0x74')]>0x0){_0x32d3b4[_0x1c90('0x74')]-=0x1;}else{logger[_0x1c90('0x97')](_0x1c90('0x98'));}}}else{logger[_0x1c90('0x97')](_0x1c90('0x99'));}}function checkContactLowerLimitOriginate(_0x107abb,_0x4ab8a7,_0x11c793){if(_0x4ab8a7>_0x11c793){for(var _0x52d4b8=0x0;_0x52d4b8<_0x4ab8a7-_0x11c793;_0x52d4b8+=0x1){decremetOriginate(_0x107abb);}}}function loggerGetContactDialer(_0x56f955,_0x4ef44e,_0x251a70){return function(_0x28d642){checkContactLowerLimitOriginate(_0x4ef44e,_0x251a70,0x0);logger[_0x1c90('0x97')](_0x56f955,util['inspect'](_0x28d642,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3c4601){return function(_0x230a96){if(isNotNull(_0x230a96)&&isNotNull(_0x230a96[0x0])){if(_0x230a96[0x0][_0x1c90('0x9a')]>0x0){_0x3c4601[_0x1c90('0x43')]='RESCHEDULED_CONTACTS';logger[_0x1c90('0x81')](_0x1c90('0x9b')+_0x3c4601[_0x1c90('0x44')],_0x230a96[0x0][_0x1c90('0x9a')],_0x1c90('0x9c'));}else{_0x3c4601[_0x1c90('0x43')]=_0x1c90('0x9d');logger[_0x1c90('0x81')](_0x1c90('0x9e')+_0x3c4601[_0x1c90('0x44')]);}}};}function notSendMessagesQueue(_0x229792){if(_0x229792['sendMessageOneNotActive']){freeVariablesPredictive(_0x229792);if(_0x229792[_0x1c90('0x74')]===0x0&&_0x229792[_0x1c90('0x57')]===0x0&&_0x229792[_0x1c90('0x5a')]===0x0&&(_0x229792[_0x1c90('0x54')]||0x0)===0x0){_0x229792[_0x1c90('0x9f')]=![];_0x229792[_0x1c90('0xa0')]=0x0;_0x229792['message']='NOT_ACTIVE';loggerSyncQueueSummary['debug'](_0x1c90('0xa1'),_0x229792[_0x1c90('0x44')],_0x1c90('0xa2'));}else{_0x229792[_0x1c90('0x43')]=_0x1c90('0xa3');loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x229792[_0x1c90('0x44')],_0x1c90('0xa4'));}emitVoiceQueueSummary(_0x229792);}}function notSendMessagesCampaign(_0x46bf53){if(_0x46bf53[_0x1c90('0x9f')]){if(_0x46bf53[_0x1c90('0x74')]===0x0){_0x46bf53[_0x1c90('0x9f')]=![];_0x46bf53[_0x1c90('0x43')]=_0x1c90('0xa5');loggerSyncQueueSummary[_0x1c90('0x95')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x46bf53['name'],'is\x20not\x20active');}else{_0x46bf53[_0x1c90('0x43')]=_0x1c90('0xa3');loggerSyncQueueSummary['debug'](_0x1c90('0xa6'),_0x46bf53['name'],_0x1c90('0xa4'));}emitCampaignSummary(_0x46bf53);}}function createObjHistory(_0x1ce353,_0x407eb9,_0x4e72d3,_0x50e8ff,_0xf66964){_0x1ce353[_0x1c90('0x43')]=_0x4e72d3;var _0x47cde0=new Action(_0x1ce353,_0x407eb9);var _0x5307cd=new History(_0x47cde0);_0x5307cd['state']=_0x50e8ff;_0x5307cd['statedesc']=_0xf66964;_0x5307cd[_0x1c90('0xa7')]=_0x47cde0['starttime'];return _0x5307cd;}Dialer[_0x1c90('0x19')][_0x1c90('0x3e')]=function(){var _0x41f989=this;setInterval(function(){_0x41f989[_0x1c90('0xa8')](_0x41f989[_0x1c90('0xa9')],_0x1c90('0xaa'));_0x41f989[_0x1c90('0xa8')](_0x41f989[_0x1c90('0x23')],_0x1c90('0xab'));},0x32c8);};Dialer[_0x1c90('0x19')][_0x1c90('0xa8')]=function(_0x13ea69,_0x707967){var _0x422ad3=this;for(var _0x5b0c05 in _0x13ea69){if(typeof _0x13ea69[_0x5b0c05]!=='undefined'){this[_0x1c90('0x1d')][_0x1c90('0x1a')](function(){if(!_[_0x1c90('0xac')](_0x13ea69[_0x5b0c05])){return ami[_0x1c90('0xad')]({'action':_0x1c90('0xae'),'channel':_0x13ea69[_0x5b0c05][_0x1c90('0xaf')]})[_0x1c90('0xb0')](function(_0x25f8a9){if(_0x25f8a9[_0x1c90('0x43')]===_0x1c90('0xb1')){setTimeout(function(){if(_0x13ea69[_0x5b0c05]&&_0x13ea69[_0x5b0c05][_0x1c90('0xb2')]!==_0x1c90('0x91')){_0x422ad3[_0x1c90('0xb3')](_0x422ad3[_0x1c90('0x1e')][_0x13ea69[_0x5b0c05]['queue']]);logger[_0x1c90('0x97')](_0x1c90('0xb4'),_0x707967,_0x5b0c05,_0x13ea69[_0x5b0c05][_0x1c90('0xb5')]);delete _0x13ea69[_0x5b0c05];}if(_0x13ea69[_0x5b0c05]&&_0x13ea69[_0x5b0c05][_0x1c90('0xb2')]===_0x1c90('0x91')){_0x422ad3[_0x1c90('0xb3')](_0x422ad3[_0x1c90('0x1f')][_0x13ea69[_0x5b0c05][_0x1c90('0xb5')]]);logger['error'](_0x1c90('0xb6'),_0x707967,_0x5b0c05,_0x13ea69[_0x5b0c05][_0x1c90('0xb5')]);delete _0x13ea69[_0x5b0c05];}},0x2328);}});}});}}};Dialer[_0x1c90('0x19')][_0x1c90('0xb7')]=function(_0x1c5ceb){return BPromise['resolve']()[_0x1c90('0x40')](cmHopper['countReScheduled'](_0x1c5ceb))[_0x1c90('0xb0')](loggerCatch(_0x1c90('0xb8')));};Dialer[_0x1c90('0x19')]['checkIsBlackList']=function(_0x35f33f){return BPromise[_0x1c90('0xb9')]()[_0x1c90('0x40')](cmHopperBlack[_0x1c90('0xba')](_0x35f33f))[_0x1c90('0xb0')](loggerCatch('[checkIsBlackList]\x20'));};Dialer['prototype']['verifyAdditionalPhones']=function(_0x64c2fc,_0x339f45,_0x1dcfdb){return BPromise[_0x1c90('0xb9')]()['then'](cmHopperAdditionalPhone[_0x1c90('0xbb')](_0x64c2fc,_0x339f45,_0x1dcfdb))['catch'](loggerCatch(_0x1c90('0xbc')));};Dialer['prototype'][_0x1c90('0xbd')]=function(_0x288251,_0x53a1a2,_0x3ec314){return BPromise[_0x1c90('0xb9')]()[_0x1c90('0x40')](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x288251,_0x53a1a2,_0x3ec314))[_0x1c90('0xb0')](loggerCatch(_0x1c90('0xbe')));};Dialer[_0x1c90('0x19')][_0x1c90('0xbf')]=function(_0x26d1e3){return BPromise[_0x1c90('0xb9')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x26d1e3))[_0x1c90('0xb0')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype'][_0x1c90('0xc0')]=function(_0xa8168b){return BPromise[_0x1c90('0xb9')]()[_0x1c90('0x40')](cmHopperHistory[_0x1c90('0xc1')](_0xa8168b))[_0x1c90('0xb0')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x1c90('0x19')][_0x1c90('0xc2')]=function(_0xca0b3b){return BPromise[_0x1c90('0xb9')]()[_0x1c90('0x40')](cmHopper[_0x1c90('0xc2')](_0xca0b3b))[_0x1c90('0xb0')](loggerCatch(_0x1c90('0xc3')));};Dialer[_0x1c90('0x19')][_0x1c90('0xc4')]=function(_0x33ffb0,_0xe3a57c,_0x1262a7){return BPromise['resolve']()[_0x1c90('0x40')](cmHopper['unlockContact'](_0x33ffb0,_0xe3a57c,_0x1262a7))['catch'](loggerCatch('[unlockContact]\x20'));};Dialer[_0x1c90('0x19')][_0x1c90('0xc5')]=function(_0x59e4b1,_0x50a6d4,_0x1cd3fe,_0x1d32a5,_0x512e43){return BPromise[_0x1c90('0xb9')]()[_0x1c90('0x40')](cmHopper[_0x1c90('0xc5')](_0x59e4b1,_0x50a6d4,_0x1cd3fe,_0x1d32a5))['catch'](function(_0x357789){_0x512e43['temp']-=_0x1cd3fe;_0x512e43[_0x1c90('0xc6')]=_0x512e43[_0x1c90('0xc6')]>0x0?_0x512e43[_0x1c90('0xc6')]:0x0;loggerCatch(_0x1c90('0xc7'))(_0x357789);});};Dialer[_0x1c90('0x19')]['getContactDialerIvr']=function(_0x279bad,_0x4daebc,_0x3fd68f,_0x4ede70){return BPromise[_0x1c90('0xb9')]()[_0x1c90('0x40')](cmHopper[_0x1c90('0xc8')](_0x279bad,_0x4daebc,_0x3fd68f))['catch'](function(_0x26a53e){_0x4ede70[_0x1c90('0xc6')]-=_0x4daebc;_0x4ede70[_0x1c90('0xc6')]=_0x4ede70['temp']>0x0?_0x4ede70[_0x1c90('0xc6')]:0x0;loggerCatch(_0x1c90('0xc9'))(_0x26a53e);});};Dialer[_0x1c90('0x19')][_0x1c90('0xca')]=function(_0x22e789){return BPromise[_0x1c90('0xb9')]()[_0x1c90('0x40')](voiceQueueRt[_0x1c90('0xca')](_0x22e789))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x1c90('0x19')][_0x1c90('0xcb')]=function(_0x1a2df9){return BPromise[_0x1c90('0xb9')]()['then'](cmHopper[_0x1c90('0xcb')](_0x1a2df9))[_0x1c90('0xb0')](loggerCatch(_0x1c90('0xcc')));};Dialer[_0x1c90('0x19')][_0x1c90('0xcd')]=function(_0x43c502){return BPromise[_0x1c90('0xb9')]()[_0x1c90('0x40')](cmHopperHistory[_0x1c90('0xcd')](_0x43c502))[_0x1c90('0xb0')](loggerCatch(_0x1c90('0xce')));};Dialer[_0x1c90('0x19')][_0x1c90('0xb3')]=function(_0x277eba){if(!_[_0x1c90('0x42')](_0x277eba)&&_0x277eba!==null){if(typeof _0x277eba[_0x1c90('0x74')]!=='undefined'){if(_0x277eba['originated']>0x0){_0x277eba[_0x1c90('0x74')]-=0x1;}else{logger['error'](_0x1c90('0xcf'));}}}else{logger[_0x1c90('0x97')](_0x1c90('0xd0'));}};Dialer[_0x1c90('0x19')]['loggerHandler']=function(_0x2afeb5,_0x2fabb3){var _0x3780da=this;return function(_0x1fc325){_0x3780da[_0x1c90('0xb3')](_0x2fabb3);logger[_0x1c90('0x97')](_0x2afeb5,util[_0x1c90('0x96')](_0x1fc325,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x1c90('0xd1')]=function(_0xc09203,_0x517459,_0x245bae){var _0x1776be={'state':0x19,'statedesc':_0x1c90('0xd2')};this[_0x1c90('0xb3')](_0x517459);this[_0x1c90('0xd3')](_['merge'](_0x1776be,_[_0x1c90('0xd4')](_0x245bae,['ContactId',_0x1c90('0xd5'),'UserId',_0x1c90('0xd6'),_0x1c90('0xd7')])),_0x1c90('0xd8'),_0x1c90('0xd9'));logger[_0x1c90('0x97')](_0xc09203);};Dialer[_0x1c90('0x19')][_0x1c90('0xda')]=function(_0x56c236){return _0x56c236==='Success';};Dialer[_0x1c90('0x19')][_0x1c90('0xdb')]=function(_0x4ca9cd){return!_[_0x1c90('0x42')](_0x4ca9cd)&&_0x4ca9cd&&!_[_0x1c90('0x42')](_0x4ca9cd[_0x1c90('0x44')])&&!_[_0x1c90('0x42')](_0x4ca9cd[_0x1c90('0xdc')])&&_0x4ca9cd[_0x1c90('0xdc')]&&(this[_0x1c90('0x21')][util['format'](_0x1c90('0xdd'),_0x4ca9cd[_0x1c90('0x44')])][_0x1c90('0xae')]===_0x1c90('0xde')||this[_0x1c90('0x21')][util['format'](_0x1c90('0xdd'),_0x4ca9cd[_0x1c90('0x44')])][_0x1c90('0xae')]===_0x1c90('0xdf'));};Dialer['prototype']['saveInDb']=function(_0x1caa3c,_0x5790ea,_0x159e8f){this[_0x1c90('0xcd')](_0x1caa3c)[_0x1c90('0xb0')](loggerCatch(_0x5790ea));this[_0x1c90('0xcb')](_0x1caa3c)['catch'](loggerCatch(_0x159e8f));};Dialer[_0x1c90('0x19')]['syncVarSet']=function(_0x427000){var _0x3c412b=this[_0x1c90('0xa9')][_0x427000['uniqueid']];var _0x412fc8;if(!_['isNil'](_0x427000)&&!_[_0x1c90('0xac')](_0x427000[_0x1c90('0xe0')])&&!_[_0x1c90('0xac')](_0x427000['variable'][_0x1c90('0xe1')])&&_0x427000[_0x1c90('0xe2')]==='xcally-motion-dialer'&&_0x3c412b){if(_0x3c412b[_0x1c90('0xb2')]!==_0x1c90('0x91')&&this[_0x1c90('0x1e')][_0x3c412b[_0x1c90('0xb5')]][_0x1c90('0xe3')]&&_0x427000[_0x1c90('0xe4')]===_0x1c90('0xe5')){delete this[_0x1c90('0xa9')][_0x427000[_0x1c90('0xe6')]];this[_0x1c90('0xb3')](this[_0x1c90('0x1e')][_0x3c412b[_0x1c90('0xb5')]]);this[_0x1c90('0x1e')][_0x3c412b[_0x1c90('0xb5')]]['outboundAnswerCallsDay']+=0x1;this[_0x1c90('0x1e')][_0x3c412b['queue']][_0x1c90('0x5f')]+=0x1;_0x412fc8=new Hangup(_0x3c412b,_0x427000);_0x412fc8[_0x1c90('0xe7')]=0x12;_0x412fc8[_0x1c90('0xe8')]=_0x1c90('0xe9');_0x412fc8[_0x1c90('0xea')]=_0x1c90('0xeb');ami[_0x1c90('0x50')](_0x1c90('0xec'),ut[_0x1c90('0xed')](_0x412fc8,'amd'));this[_0x1c90('0xd3')](_0x412fc8,_0x1c90('0xee'),'[syncHangupInAMD]');}if(_0x3c412b[_0x1c90('0xb2')]!=='ivr'&&this[_0x1c90('0x1e')][_0x3c412b[_0x1c90('0xb5')]][_0x1c90('0xe3')]&&_0x427000[_0x1c90('0xe4')]===_0x1c90('0xef')){var _0x3b6ed2=this;return new BPromise(function(_0x1250be,_0x3eb79b){delete _0x3b6ed2[_0x1c90('0xa9')][_0x427000[_0x1c90('0xe6')]];_0x3b6ed2['updateOriginated'](_0x3b6ed2[_0x1c90('0x1e')][_0x3c412b[_0x1c90('0xb5')]]);_0x3b6ed2[_0x1c90('0x1e')][_0x3c412b[_0x1c90('0xb5')]]['outboundAnswerCallsDay']+=0x1;_0x3b6ed2[_0x1c90('0x1e')][_0x3c412b[_0x1c90('0xb5')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x3d7367=_0x3b6ed2[_0x1c90('0x1e')][_0x3c412b[_0x1c90('0xb5')]];var _0x1e9d4a=new Hangup(_0x3c412b,_0x427000);_0x1e9d4a[_0x1c90('0xe7')]=0x13;_0x1e9d4a['statedesc']=_0x1c90('0xf0');_0x1e9d4a[_0x1c90('0xea')]=_0x1c90('0xeb');_0x1e9d4a[_0x1c90('0xf1')]+=0x1;_0x1e9d4a[_0x1c90('0xf2')]+=0x1;_0x1e9d4a[_0x1c90('0xf3')]=!![];ami[_0x1c90('0x50')]('custom:amd',ut['buildObj'](_0x1e9d4a,_0x1c90('0xf3')));_0x3b6ed2[_0x1c90('0xcd')](_0x1e9d4a)[_0x1c90('0xb0')](loggerCatch(_0x1c90('0xf4')));if(_0x1e9d4a[_0x1c90('0xf5')]+_0x1e9d4a['countcongestionretry']+_0x1e9d4a[_0x1c90('0xf6')]+_0x1e9d4a[_0x1c90('0xf7')]+_0x1e9d4a['countdropretry']+_0x1e9d4a['countabandonedretry']+_0x1e9d4a['countmachineretry']+_0x1e9d4a[_0x1c90('0xf8')]>=_0x3d7367['dialGlobalMaxRetry']){_0x3b6ed2[_0x1c90('0xf9')](_0x1e9d4a,_0x1250be,_0x3eb79b,_0x1c90('0xfa'));}else{if(_0x1e9d4a[_0x1c90('0xf1')]>=_0x3d7367[_0x1c90('0xfb')]){_0x3b6ed2[_0x1c90('0xfc')](_0x1e9d4a,_0x1250be,_0x3eb79b,_0x1c90('0xfd'));}else{_0x3b6ed2['rescheduleContact']({'active':![],'countmachineretry':_0x1e9d4a['countmachineretry'],'scheduledat':moment()[_0x1c90('0xfe')](_0x3d7367['dialMachineRetryFrequency'],'minutes')['format'](_0x1c90('0xff')),'ContactId':_0x1e9d4a[_0x1c90('0x100')],'ListId':_0x1e9d4a[_0x1c90('0xd5')],'VoiceQueueId':_0x1e9d4a[_0x1c90('0xd6')]||undefined,'CampaignId':_0x1e9d4a[_0x1c90('0xd7')]||undefined})[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x101')));_0x1250be({'reschedule':0x1});}}});}if(_0x3c412b[_0x1c90('0xb2')]===_0x1c90('0x91')&&this[_0x1c90('0x1f')][_0x3c412b[_0x1c90('0xb5')]][_0x1c90('0xe3')]&&_0x427000[_0x1c90('0xe4')]===_0x1c90('0xe5')){delete this['uniqueId'][_0x427000[_0x1c90('0xe6')]];this[_0x1c90('0xb3')](this[_0x1c90('0x1f')][_0x3c412b[_0x1c90('0xb5')]]);_0x412fc8=new Hangup(_0x3c412b,_0x427000);_0x412fc8[_0x1c90('0xe7')]=0x12;_0x412fc8['statedesc']=_0x1c90('0xe9');_0x412fc8[_0x1c90('0xea')]='AMD';ami[_0x1c90('0x50')](_0x1c90('0xec'),ut[_0x1c90('0xed')](_0x412fc8,_0x1c90('0xf3')));this['saveInDb'](_0x412fc8,_0x1c90('0x102'),_0x1c90('0x103'));}if(_0x3c412b[_0x1c90('0xb2')]==='ivr'&&this[_0x1c90('0x1f')][_0x3c412b[_0x1c90('0xb5')]][_0x1c90('0xe3')]&&_0x427000[_0x1c90('0xe4')]===_0x1c90('0xef')){var _0x3b6ed2=this;return new BPromise(function(_0x593b5b,_0x5421d0){delete _0x3b6ed2[_0x1c90('0xa9')][_0x427000[_0x1c90('0xe6')]];_0x3b6ed2['updateOriginated'](_0x3b6ed2['campaigns'][_0x3c412b['queue']]);_0x3b6ed2[_0x1c90('0x1f')][_0x3c412b[_0x1c90('0xb5')]][_0x1c90('0x60')]+=0x1;_0x3b6ed2['campaigns'][_0x3c412b[_0x1c90('0xb5')]][_0x1c90('0x5f')]+=0x1;var _0x53cfa7=_0x3b6ed2[_0x1c90('0x1f')][_0x3c412b[_0x1c90('0xb5')]];var _0x1a0531=new Hangup(_0x3c412b,_0x427000);_0x1a0531['state']=0x13;_0x1a0531[_0x1c90('0xe8')]='Machine';_0x1a0531[_0x1c90('0xea')]=_0x1c90('0xeb');_0x1a0531[_0x1c90('0xf1')]+=0x1;_0x1a0531[_0x1c90('0xf2')]+=0x1;_0x1a0531[_0x1c90('0xf3')]=!![];ami[_0x1c90('0x50')](_0x1c90('0xec'),ut['buildObj'](_0x1a0531,_0x1c90('0xf3')));_0x3b6ed2[_0x1c90('0xcd')](_0x1a0531)[_0x1c90('0xb0')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1a0531[_0x1c90('0xf5')]+_0x1a0531['countcongestionretry']+_0x1a0531['countnoanswerretry']+_0x1a0531['countnosuchnumberretry']+_0x1a0531['countdropretry']+_0x1a0531['countabandonedretry']+_0x1a0531['countmachineretry']+_0x1a0531[_0x1c90('0xf8')]>=_0x53cfa7[_0x1c90('0x104')]){_0x3b6ed2[_0x1c90('0xf9')](_0x1a0531,_0x593b5b,_0x5421d0,_0x1c90('0xfa'));}else{if(_0x1a0531[_0x1c90('0xf1')]>=_0x53cfa7[_0x1c90('0xfb')]){_0x3b6ed2['createStateFinal'](_0x1a0531,_0x593b5b,_0x5421d0,'reason\x2019\x20machine....');}else{_0x3b6ed2[_0x1c90('0xc2')]({'active':![],'countmachineretry':_0x1a0531[_0x1c90('0xf1')],'scheduledat':moment()[_0x1c90('0xfe')](_0x53cfa7['dialMachineRetryFrequency'],'minutes')[_0x1c90('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1a0531['ContactId'],'ListId':_0x1a0531[_0x1c90('0xd5')],'VoiceQueueId':_0x1a0531[_0x1c90('0xd6')]||undefined,'CampaignId':_0x1a0531['CampaignId']||undefined})['catch'](loggerCatch(_0x1c90('0x101')));_0x593b5b({'reschedule':0x1});}}});}}};Dialer[_0x1c90('0x19')][_0x1c90('0x35')]=function(_0x30ce9f){var _0x3850b4=this[_0x1c90('0xa9')][_0x30ce9f[_0x1c90('0xe6')]];var _0x2ad1f8=this;var _0x5f5ba9;if(_0x3850b4&&_0x3850b4[_0x1c90('0xb2')]===_0x1c90('0x91')){delete this[_0x1c90('0xa9')][_0x30ce9f[_0x1c90('0xe6')]];this[_0x1c90('0xb3')](this['campaigns'][_0x3850b4[_0x1c90('0xb5')]]);this[_0x1c90('0x1f')][_0x3850b4[_0x1c90('0xb5')]]['ivrAnswerCallsDay']+=0x1;_0x5f5ba9=new Hangup(_0x3850b4,_0x30ce9f);this[_0x1c90('0xcd')](_0x5f5ba9)[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x105')));this[_0x1c90('0xcb')](_0x5f5ba9)[_0x1c90('0xb0')](loggerCatch('[syncHangupIvr]'));}if(_0x3850b4&&_0x3850b4[_0x1c90('0xb2')]!==_0x1c90('0x91')&&isNotNull(this[_0x1c90('0x1e')][_0x3850b4[_0x1c90('0xb5')]]['dialQueueProject'])){delete this['uniqueId'][_0x30ce9f[_0x1c90('0xe6')]];this['updateOriginated'](this['voiceQueues'][_0x3850b4[_0x1c90('0xb5')]]);this[_0x1c90('0x1e')][_0x3850b4[_0x1c90('0xb5')]][_0x1c90('0x60')]+=0x1;this[_0x1c90('0x1e')][_0x3850b4[_0x1c90('0xb5')]][_0x1c90('0x5f')]+=0x1;_0x5f5ba9=new Hangup(_0x3850b4,_0x30ce9f);_0x5f5ba9[_0x1c90('0xe7')]=0x10;_0x5f5ba9['statedesc']=_0x1c90('0x106');_0x5f5ba9[_0x1c90('0xea')]=_0x1c90('0x107');this['createHistory'](_0x5f5ba9)[_0x1c90('0xb0')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x1c90('0xcb')](_0x5f5ba9)[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x108')));}if(_0x3850b4&&_0x3850b4[_0x1c90('0xb2')]!=='ivr'&&!isNotNull(this[_0x1c90('0x1e')][_0x3850b4['queue']][_0x1c90('0x109')])){delete this[_0x1c90('0xa9')][_0x30ce9f[_0x1c90('0xe6')]];this[_0x1c90('0xb3')](this[_0x1c90('0x1e')][_0x3850b4[_0x1c90('0xb5')]]);this['voiceQueues'][_0x3850b4[_0x1c90('0xb5')]][_0x1c90('0x6a')]+=0x1;_0x5f5ba9=new Hangup(_0x3850b4,_0x30ce9f);_0x5f5ba9[_0x1c90('0xe7')]=0xc;_0x5f5ba9[_0x1c90('0xe8')]=_0x30ce9f[_0x1c90('0x10a')];_0x5f5ba9[_0x1c90('0xea')]=_0x1c90('0x10b');this[_0x1c90('0xcd')](_0x5f5ba9)[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x105')));this[_0x1c90('0xcb')](_0x5f5ba9)[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x108')));}};Dialer['prototype'][_0x1c90('0x32')]=function(_0x17f7d6){var _0x3f1be5=this[_0x1c90('0xa9')][_0x17f7d6[_0x1c90('0xe6')]];var _0x28b3e0=this;if(this[_0x1c90('0x1e')][_0x17f7d6[_0x1c90('0xb5')]]){if(_0x3f1be5&&_0x3f1be5[_0x1c90('0xb2')]!==_0x1c90('0x91')){delete this[_0x1c90('0xa9')][_0x17f7d6[_0x1c90('0xe6')]];this[_0x1c90('0x1e')][_0x17f7d6['queue']]['outboundAnswerCallsDay']+=0x1;var _0x353bd9=new AgentComplete(_0x3f1be5,_0x17f7d6);if(_0x17f7d6[_0x1c90('0x10c')]===_0x1c90('0x10d')){_0x353bd9[_0x1c90('0x10e')]=this[_0x1c90('0x1e')][_0x17f7d6['queue']][_0x1c90('0x10f')]&&this[_0x1c90('0x1e')][_0x17f7d6[_0x1c90('0xb5')]]['dialAgiAfterHangupAgent']?moment()[_0x1c90('0x7a')](_0x1c90('0xff')):undefined;}this[_0x1c90('0xcd')](_0x353bd9)[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x110')));this[_0x1c90('0xcb')](_0x353bd9)[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x111')));}}};Dialer['prototype'][_0x1c90('0x2b')]=function(_0x59aca2){if(this[_0x1c90('0x1e')][_0x59aca2[_0x1c90('0xb5')]]){if(this['uniqueId'][_0x59aca2[_0x1c90('0xe6')]]&&this[_0x1c90('0xa9')][_0x59aca2['uniqueid']][_0x1c90('0xb2')]!==_0x1c90('0x91')){this[_0x1c90('0xb3')](this[_0x1c90('0x1e')][_0x59aca2['queue']]);this[_0x1c90('0xa9')][_0x59aca2['uniqueid']]['answertime']=moment()[_0x1c90('0x7a')](_0x1c90('0xff'));}}};Dialer[_0x1c90('0x19')]['queueCallerAbandonCreateState']=function(_0x33b2b4,_0x14ece5){this['createHistory'](_0x33b2b4)[_0x1c90('0xb0')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x14ece5==0x0){this[_0x1c90('0xcb')](_0x33b2b4)[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x112')));}};Dialer[_0x1c90('0x19')][_0x1c90('0x2e')]=function(_0xcea446){var _0x3f6aac=this['uniqueId'][_0xcea446[_0x1c90('0xe6')]];var _0x4c301f=this;var _0xd24d6a=![];var _0x10ab40;var _0x5dd59f;if(this[_0x1c90('0x1e')][_0xcea446['queue']]){if(_0x3f6aac&&_0x3f6aac[_0x1c90('0xb2')]!==_0x1c90('0x91')){delete this[_0x1c90('0xa9')][_0xcea446[_0x1c90('0xe6')]];this[_0x1c90('0xb3')](this[_0x1c90('0x1e')][_0xcea446[_0x1c90('0xb5')]]);_0x3f6aac[_0x1c90('0x113')]=moment()[_0x1c90('0x7a')](_0x1c90('0xff'));var _0x5e12da=new QueueCallerAbandon(_0x3f6aac,_0xcea446);if(getSeconds(_0x3f6aac[_0x1c90('0x113')],_0x3f6aac[_0x1c90('0x114')])>=_0x3f6aac[_0x1c90('0x115')]){this[_0x1c90('0x1e')][_0xcea446[_0x1c90('0xb5')]][_0x1c90('0x6d')]+=0x1;this['voiceQueues'][_0xcea446[_0x1c90('0xb5')]][_0x1c90('0x66')]+=0x1;this['voiceQueues'][_0xcea446[_0x1c90('0xb5')]][_0x1c90('0x6f')]+=0x1;_0x5e12da[_0x1c90('0xe7')]=0xa;_0x5e12da[_0x1c90('0xe8')]=_0x1c90('0x116');_0x5e12da['dropreason']=_0x1c90('0x117');_0x5e12da[_0x1c90('0x10e')]=this[_0x1c90('0x1e')][_0xcea446[_0x1c90('0xb5')]][_0x1c90('0x10f')]?moment()[_0x1c90('0x7a')](_0x1c90('0xff')):undefined;_0x5e12da[_0x1c90('0x118')]+=0x1;_0x5e12da[_0x1c90('0xf2')]+=0x1;_0x10ab40=this[_0x1c90('0x1e')][_0xcea446[_0x1c90('0xb5')]][_0x1c90('0x119')];_0x5dd59f=this[_0x1c90('0x1e')][_0xcea446[_0x1c90('0xb5')]][_0x1c90('0x11a')];_0x4c301f[_0x1c90('0xbb')](_0x5e12da,_0x5e12da['state'],_0x3f6aac[_0x1c90('0x11b')])[_0x1c90('0x40')](function(_0x2b5388){_0xd24d6a=_0x2b5388[_0x1c90('0x11c')]==0x1;if(_0x5e12da[_0x1c90('0x118')]>=_0x4c301f['voiceQueues'][_0xcea446[_0x1c90('0xb5')]][_0x1c90('0x11d')]){_0x4c301f[_0x1c90('0x11e')](_0x5e12da,_0x2b5388[_0x1c90('0x11c')]);}else{_0x4c301f[_0x1c90('0xc2')]({'active':![],'countdropretry':_0x5e12da[_0x1c90('0x118')],'scheduledat':moment()[_0x1c90('0xfe')](_0x4c301f['voiceQueues'][_0xcea446[_0x1c90('0xb5')]][_0x1c90('0x119')],_0x1c90('0x11f'))[_0x1c90('0x7a')](_0x1c90('0xff')),'ContactId':_0x3f6aac[_0x1c90('0x100')],'ListId':_0x3f6aac[_0x1c90('0xd5')],'VoiceQueueId':_0x3f6aac[_0x1c90('0xd6')]||undefined,'CampaignId':_0x3f6aac[_0x1c90('0xd7')]||undefined})[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x120')));var _0x17d518=new History(_0x5e12da);_0x17d518[_0x1c90('0xe7')]=0xa;_0x17d518[_0x1c90('0xe8')]=_0x1c90('0x116');_0x17d518['starttime']=moment()[_0x1c90('0x7a')](_0x1c90('0xff'));_0x17d518[_0x1c90('0xa7')]=_0x17d518[_0x1c90('0x121')];_0x17d518[_0x1c90('0x122')]=_0x5e12da[_0x1c90('0x122')];_0x17d518['calleridnum']=_0x5e12da['calleridnum'];_0x4c301f['createHistory'](_0x17d518)[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x123')));}})[_0x1c90('0x40')](function(_0x36ed98){if(_0xd24d6a)_0x4c301f['swapAdditionalPhones'](_0x5e12da,_0x10ab40,_0x5dd59f)[_0x1c90('0x40')](function(_0x41cb98){return 0x1;});});}else{this['voiceQueues'][_0xcea446['queue']][_0x1c90('0x6c')]+=0x1;this[_0x1c90('0x1e')][_0xcea446[_0x1c90('0xb5')]][_0x1c90('0x65')]+=0x1;_0x5e12da[_0x1c90('0xe7')]=0xb;_0x5e12da['statedesc']=_0x1c90('0x124');_0x5e12da[_0x1c90('0x125')]=_0x1c90('0x126');_0x5e12da[_0x1c90('0x127')]+=0x1;_0x5e12da[_0x1c90('0xf2')]+=0x1;_0x10ab40=this['voiceQueues'][_0xcea446['queue']][_0x1c90('0x128')];_0x5dd59f=this[_0x1c90('0x1e')][_0xcea446['queue']][_0x1c90('0x11a')];_0x4c301f[_0x1c90('0xbb')](_0x5e12da,_0x5e12da[_0x1c90('0xe7')],_0x3f6aac['voiceQueue'])[_0x1c90('0x40')](function(_0x362467){if(_0x5e12da[_0x1c90('0x127')]>=_0x4c301f[_0x1c90('0x1e')][_0xcea446[_0x1c90('0xb5')]][_0x1c90('0x129')]){_0x4c301f[_0x1c90('0x11e')](_0x5e12da,_0x362467['additional']);}else{_0x4c301f[_0x1c90('0xc2')]({'active':![],'countabandonedretry':_0x5e12da['countabandonedretry'],'scheduledat':moment()[_0x1c90('0xfe')](_0x4c301f['voiceQueues'][_0xcea446[_0x1c90('0xb5')]][_0x1c90('0x128')],_0x1c90('0x11f'))[_0x1c90('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3f6aac['ContactId'],'ListId':_0x3f6aac['ListId'],'VoiceQueueId':_0x3f6aac[_0x1c90('0xd6')]||undefined,'CampaignId':_0x3f6aac[_0x1c90('0xd7')]||undefined})[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x12a')));var _0x303d80=new History(_0x5e12da);_0x303d80[_0x1c90('0xe7')]=0xb;_0x303d80[_0x1c90('0xe8')]=_0x1c90('0x124');_0x303d80[_0x1c90('0x121')]=moment()['format'](_0x1c90('0xff'));_0x303d80[_0x1c90('0xa7')]=_0x303d80['starttime'];_0x303d80[_0x1c90('0x122')]=_0x5e12da[_0x1c90('0x122')];_0x303d80[_0x1c90('0x12b')]=_0x5e12da['calleridnum'];_0x4c301f[_0x1c90('0xcd')](_0x303d80)[_0x1c90('0xb0')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x1c90('0x40')](function(_0x574496){if(_0xd24d6a)_0x4c301f[_0x1c90('0xbd')](_0x5e12da,_0x10ab40,_0x5dd59f)['then'](function(_0x25afcc){return 0x1;});});}}}};Dialer['prototype'][_0x1c90('0x37')]=function(_0x51c613){if(this['actions'][_0x51c613[_0x1c90('0xe6')]]){this[_0x1c90('0x23')][_0x51c613[_0x1c90('0xe6')]][_0x1c90('0xaf')]=_0x51c613[_0x1c90('0xaf')];}if(this['uniqueId'][_0x51c613['uniqueid']]){this[_0x1c90('0xa9')][_0x51c613['uniqueid']][_0x1c90('0xaf')]=_0x51c613[_0x1c90('0xaf')];}};Dialer[_0x1c90('0x19')][_0x1c90('0x3a')]=function(_0x38fdd1){if(strategy[this[_0x1c90('0x1e')][this[_0x1c90('0x23')][_0x38fdd1[_0x1c90('0x12c')]][_0x1c90('0xb5')]][_0x1c90('0x52')]]===_0x1c90('0x18')){if(this[_0x1c90('0x23')][_0x38fdd1['actionid']]&&_['isNil'](this['actions'][_0x38fdd1['actionid']][_0x1c90('0x12d')])&&_0x38fdd1['status']==='1'&&_0x38fdd1[_0x1c90('0x12e')]==='0'){if(this['agents'][_0x38fdd1[_0x1c90('0x12f')]]){if(!this[_0x1c90('0x20')][_0x38fdd1[_0x1c90('0x12f')]]['locked']){this[_0x1c90('0x20')][_0x38fdd1['stateinterface']]['locked']=!![];this[_0x1c90('0x23')][_0x38fdd1[_0x1c90('0x12c')]][_0x1c90('0x12d')]=!![];this[_0x1c90('0x23')][_0x38fdd1[_0x1c90('0x12c')]][_0x1c90('0x12f')]=_0x38fdd1[_0x1c90('0x12f')];}}}}else if((strategy[this[_0x1c90('0x1e')][this[_0x1c90('0x23')][_0x38fdd1[_0x1c90('0x12c')]][_0x1c90('0xb5')]][_0x1c90('0x52')]]||_0x1c90('0x130'))==='rrmemory'){if(this[_0x1c90('0x23')][_0x38fdd1[_0x1c90('0x12c')]]){if(this[_0x1c90('0x20')][_0x38fdd1['stateinterface']]){this[_0x1c90('0x23')][_0x38fdd1[_0x1c90('0x12c')]][_0x1c90('0x12f')]=_0x38fdd1[_0x1c90('0x12f')];if(_[_0x1c90('0xac')](this[_0x1c90('0x29')][this[_0x1c90('0x23')][_0x38fdd1[_0x1c90('0x12c')]]['queue']])){this[_0x1c90('0x29')][this[_0x1c90('0x23')][_0x38fdd1['actionid']]['queue']]=[];}this['queueBooked'][this[_0x1c90('0x23')][_0x38fdd1[_0x1c90('0x12c')]][_0x1c90('0xb5')]][_0x1c90('0x131')](_[_0x1c90('0x8d')](_[_0x1c90('0xd4')](this['actions'][_0x38fdd1[_0x1c90('0x12c')]],['idHopper',_0x1c90('0x12f')]),{'status':_0x38fdd1[_0x1c90('0xae')],'paused':_0x38fdd1[_0x1c90('0x12e')]}));}}}};function unlockQueueStatus(_0x1f05d7,_0x329ffc){setTimeout(function(){if(_[_0x1c90('0x42')](_0x1f05d7['queueStatusComplete'])){loggerBooked['error'](_0x1c90('0x132'),_0x329ffc);}_0x1f05d7[_0x1c90('0x133')]=!![];loggerBooked[_0x1c90('0x81')](_0x1c90('0x134'),_0x329ffc,JSON['stringify'](_[_0x1c90('0xd4')](_0x1f05d7,[_0x1c90('0x44'),_0x1c90('0x133')])));},0x1f3);}Dialer['prototype'][_0x1c90('0x3c')]=function(_0x3cf85d){var _0x59ed94=this;var _0xf84ca8=_0x59ed94[_0x1c90('0x1e')][_0x59ed94[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xb5')]];if(strategy[this[_0x1c90('0x1e')][this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xb5')]]['strategy']]==='roundrobin'){if(this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]]&&this[_0x1c90('0x23')][_0x3cf85d['actionid']][_0x1c90('0x12f')]){this[_0x1c90('0x90')][_0x1c90('0x135')](this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0x136')],this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]]['stateinterface'])[_0x1c90('0xb0')](function(_0x20aed2){logger[_0x1c90('0x97')](_0x1c90('0x137'),util[_0x1c90('0x96')](_0x20aed2,{'showHidden':![],'depth':null}));})[_0x1c90('0x1c')](function(){_0x59ed94[_0x1c90('0xb3')](_0x59ed94[_0x1c90('0x1e')][_0x59ed94['actions'][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xb5')]]);_0x59ed94[_0x1c90('0x20')][_0x59ed94[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0x12f')]][_0x1c90('0x12d')]=![];delete _0x59ed94[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]];unlockQueueStatus(_0xf84ca8);});}else{this[_0x1c90('0xb3')](this[_0x1c90('0x1e')][this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xb5')]]);this[_0x1c90('0xc2')]({'active':![],'ContactId':this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0x100')],'ListId':this[_0x1c90('0x23')][_0x3cf85d['actionid']]['ListId'],'VoiceQueueId':this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xd6')]||undefined,'CampaignId':this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xd7')]||undefined})[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x138')));delete this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]];unlockQueueStatus(_0xf84ca8);}}else if((strategy[this['voiceQueues'][this['actions'][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xb5')]]['strategy']]||_0x1c90('0x130'))===_0x1c90('0x130')){var _0x125769;if(this['actions'][_0x3cf85d[_0x1c90('0x12c')]]&&!_[_0x1c90('0x49')](this[_0x1c90('0x29')][this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xb5')]])){if(this['queueBookedRR'][_0x59ed94[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xb5')]]){this[_0x1c90('0x2a')][_0x59ed94[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xb5')]]=this[_0x1c90('0x2a')][this[_0x1c90('0x23')][_0x3cf85d['actionid']]['queue']]?this[_0x1c90('0x2a')][this[_0x1c90('0x23')][_0x3cf85d['actionid']][_0x1c90('0xb5')]]:this[_0x1c90('0x29')][this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xb5')]]?this[_0x1c90('0x29')][this['actions'][_0x3cf85d['actionid']][_0x1c90('0xb5')]][_0x1c90('0x139')]||0x0:0x0;}this[_0x1c90('0x29')][this[_0x1c90('0x23')][_0x3cf85d['actionid']][_0x1c90('0xb5')]]['_rr']=this[_0x1c90('0x2a')][this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xb5')]];for(var _0x1f2aa8=0x0;_0x1f2aa8<this[_0x1c90('0x29')][this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]]['queue']][_0x1c90('0x13a')];_0x1f2aa8+=0x1){_0x125769=rr(this['queueBooked'][this['actions'][_0x3cf85d[_0x1c90('0x12c')]]['queue']]);this[_0x1c90('0x2a')][_0x59ed94['actions'][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xb5')]]=this[_0x1c90('0x29')][this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xb5')]][_0x1c90('0x139')];if(_0x125769[_0x1c90('0xae')]==='1'&&_0x125769[_0x1c90('0x12e')]==='0'){break;}}if(!_[_0x1c90('0xac')](_0x125769)){this[_0x1c90('0x20')][_0x125769[_0x1c90('0x12f')]][_0x1c90('0x13b')]=_[_0x1c90('0x42')](this[_0x1c90('0x20')][_0x125769[_0x1c90('0x12f')]][_0x1c90('0x13b')])?!![]:this[_0x1c90('0x20')][_0x125769[_0x1c90('0x12f')]]['unlockRR'];}loggerBooked['info'](_0x1c90('0x13c'),_0x3cf85d['actionid'],_0x1c90('0x13d'),JSON[_0x1c90('0x4c')](_[_0x1c90('0xd4')](this[_0x1c90('0x20')][_0x125769['stateinterface']],['name',_0x1c90('0x13b')])),'contactAgent-idHopper:\x20',JSON[_0x1c90('0x4c')](_0x125769['idHopper']));if(!_[_0x1c90('0xac')](_0x125769)&&_0x125769[_0x1c90('0xae')]==='1'&&_0x125769[_0x1c90('0x12e')]==='0'&&this[_0x1c90('0x20')][_0x125769[_0x1c90('0x12f')]][_0x1c90('0x13b')]){this[_0x1c90('0x20')][_0x125769[_0x1c90('0x12f')]][_0x1c90('0x13b')]=![];this[_0x1c90('0x29')][_0x59ed94[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xb5')]]=[];this['preview'][_0x1c90('0x135')](_0x125769['idHopper'],_0x125769['stateinterface'])['catch'](function(_0x464109){logger[_0x1c90('0x97')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x1c90('0x96')](_0x464109,{'showHidden':![],'depth':null}));})[_0x1c90('0x1c')](function(){_0x59ed94[_0x1c90('0xb3')](_0x59ed94[_0x1c90('0x1e')][_0x59ed94[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xb5')]]);setTimeout(function(){_0x59ed94[_0x1c90('0x20')][_0x125769[_0x1c90('0x12f')]][_0x1c90('0x13b')]=!![];loggerBooked['info'](_0x1c90('0x13e'),_0x3cf85d[_0x1c90('0x12c')],_0x1c90('0x13d'),JSON[_0x1c90('0x4c')](_[_0x1c90('0xd4')](_0x59ed94[_0x1c90('0x20')][_0x125769[_0x1c90('0x12f')]],['name',_0x1c90('0x13b')])),_0x1c90('0x13f'),JSON[_0x1c90('0x4c')](_0x125769[_0x1c90('0x136')]));},0xc7);delete _0x59ed94[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]];unlockQueueStatus(_0xf84ca8,_0x3cf85d['actionid']);});}else{loggerBooked[_0x1c90('0x81')](_0x1c90('0x140'));this['updateOriginated'](this['voiceQueues'][this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xb5')]]);this[_0x1c90('0xc2')]({'active':![],'ContactId':this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0x100')],'ListId':this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xd5')],'VoiceQueueId':this['actions'][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xd6')]||undefined,'CampaignId':this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xd7')]||undefined})[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x138')));delete this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]];unlockQueueStatus(_0xf84ca8);}}else{loggerBooked[_0x1c90('0x81')]('[booked][unlock2]');this[_0x1c90('0xb3')](this[_0x1c90('0x1e')][this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]]['queue']]);this[_0x1c90('0xc2')]({'active':![],'ContactId':this['actions'][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0x100')],'ListId':this[_0x1c90('0x23')][_0x3cf85d['actionid']]['ListId'],'VoiceQueueId':this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xd6')]||undefined,'CampaignId':this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xd7')]||undefined})[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x141')));delete this[_0x1c90('0x23')][_0x3cf85d['actionid']];unlockQueueStatus(_0xf84ca8);}}else{loggerBooked[_0x1c90('0x81')](_0x1c90('0x142'));this['updateOriginated'](this['voiceQueues'][this['actions'][_0x3cf85d[_0x1c90('0x12c')]]['queue']]);this[_0x1c90('0xc2')]({'active':![],'ContactId':this['actions'][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0x100')],'ListId':this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xd5')],'VoiceQueueId':this[_0x1c90('0x23')][_0x3cf85d[_0x1c90('0x12c')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x3cf85d[_0x1c90('0x12c')]][_0x1c90('0xd7')]||undefined})['catch'](loggerCatch(_0x1c90('0x143')));delete this[_0x1c90('0x23')][_0x3cf85d['actionid']];unlockQueueStatus(_0xf84ca8);}};Dialer[_0x1c90('0x19')]['loopCampaigns']=function(){var _0x1c71d5=this;return BPromise[_0x1c90('0xb9')]()['then'](cmHopper['resetActiveCalls']({}))[_0x1c90('0x40')](function(){setInterval(function(){_0x1c71d5[_0x1c90('0x144')]();},0x3e8);});};Dialer[_0x1c90('0x19')][_0x1c90('0x145')]=function(_0x1aeb4b){var _0x1d18ca=this;return function(){if(!_0x1d18ca['isTrunkReachable'](_0x1aeb4b[_0x1c90('0x79')])){if(!_0x1d18ca['isTrunkReachable'](_0x1aeb4b[_0x1c90('0x146')])){_0x1aeb4b[_0x1c90('0x43')]=_0x1c90('0x147');throw _0x1aeb4b[_0x1c90('0x44')]+_0x1c90('0x148');}}};};Dialer[_0x1c90('0x19')][_0x1c90('0x149')]=function(_0x1dd673,_0x6bf8a9,_0x2b8b34,_0xa04c06){var _0x39db48=this;return function(){var _0x251f3e=!![];return _0x39db48[_0x1c90('0x14a')](_0x1dd673,_0x6bf8a9,_0x2b8b34,_0xa04c06,_0x251f3e);};};Dialer[_0x1c90('0x19')][_0x1c90('0x14b')]=function(_0x697d46,_0x58aa90,_0x41b784,_0x3f9f55){var _0x56d70a=this;return function(){var _0x10d77b=![];return _0x56d70a[_0x1c90('0x14a')](_0x697d46[_0x1c90('0x14c')],_0x58aa90,_0x41b784,_0x3f9f55,_0x10d77b);};};Dialer[_0x1c90('0x19')][_0x1c90('0x14a')]=function(_0x2bc04e,_0x37128d,_0x5ac562,_0x569321,_0xeee590){var _0x1855fa=[];return new BPromise(function(_0x266f0b,_0x33798b){if(!isNotNull(_0x2bc04e)){_0x569321[_0x1c90('0x43')]=_0x1c90('0x47');return _0x33798b(msgResponse(_0x1c90('0x14a'),_0x1c90('0x14d'),_0x5ac562+_0x1c90('0x14e')));}if(_[_0x1c90('0x49')](_0x2bc04e)){_0x569321[_0x1c90('0x43')]=_0x1c90('0x14f');return _0x33798b(msgResponse(_0x1c90('0x14a'),_0x1c90('0x14d'),_0x5ac562+_0x1c90('0x150')));}if(_0x37128d&&_[_0x1c90('0x42')](config[_0x1c90('0x151')][_0x37128d])){_0x569321[_0x1c90('0x43')]=_0x1c90('0x152');return _0x33798b(msgResponse('ifTime','Failure',_0x5ac562+_0x1c90('0x153')+_0x37128d));}if(_[_0x1c90('0x154')](_0x2bc04e)){for(var _0x403cb1=0x0;_0x403cb1<_0x2bc04e[_0x1c90('0x13a')];_0x403cb1+=0x1){_0x1855fa[_0x1c90('0x131')](ami['Action']({'action':_0x1c90('0x155'),'command':util[_0x1c90('0x7a')](_0x1c90('0x156'),_0x2bc04e[_0x403cb1][_0x1c90('0x157')],!_[_0x1c90('0x42')](config[_0x1c90('0x151')][_0x37128d])?_0x37128d:'')})[_0x1c90('0x40')](function(_0x5c7579){return _0x5c7579['content']['indexOf'](_0x1c90('0x158'))>=0x0;})[_0x1c90('0xb0')](myreject(_0x33798b)));}}else{_0x1855fa[_0x1c90('0x131')](ami[_0x1c90('0xad')]({'action':_0x1c90('0x155'),'command':util[_0x1c90('0x7a')](_0x1c90('0x156'),_0x2bc04e,!_[_0x1c90('0x42')](config[_0x1c90('0x151')][_0x37128d])?_0x37128d:'')})[_0x1c90('0x40')](function(_0x5678f5){return _0x5678f5[_0x1c90('0x159')]['indexOf'](_0x1c90('0x158'))>=0x0;})[_0x1c90('0xb0')](myreject(_0x33798b)));}BPromise['all'](_0x1855fa)[_0x1c90('0x40')](function(_0xc1c594){var _0x4484fe=_[_0x1c90('0x15a')](_0xc1c594);if(_0x4484fe){return _0x266f0b(_0x4484fe);}else{_0x569321[_0x1c90('0x43')]=_0xeee590?_0x1c90('0x15b'):_0x1c90('0x15c');return _0x33798b(msgResponse('[ifTime][promiseAll]',_0x1c90('0x14d'),_0x1c90('0x15d')+_0xeee590+'\x20'+_0x5ac562+'\x20Interval\x20is\x20overtime:\x20'+util[_0x1c90('0x96')](_0x2bc04e,{'showHidden':![],'depth':null})+_0x1c90('0x15e')+_0x37128d));}})[_0x1c90('0xb0')](function(_0x3aa961){return _0x33798b(msgResponse(_0x1c90('0x14a'),'Failure',JSON[_0x1c90('0x4c')](_0x3aa961)));});});};Dialer[_0x1c90('0x19')][_0x1c90('0x15f')]=function(_0x58f304){var _0x1f6b24=this;return function(){switch(_0x58f304[_0x1c90('0x160')]){case _0x1c90('0x161'):freeVariablesPredictive(_0x58f304);_0x1f6b24[_0x1c90('0x162')](_0x58f304,0x1);break;case _0x1c90('0x163'):freeVariablesPredictive(_0x58f304);_0x1f6b24['handlePower'](_0x58f304,_0x58f304['dialPowerLevel']);break;case _0x1c90('0x7'):_0x1f6b24[_0x1c90('0x7')](_0x58f304);break;case _0x1c90('0x6'):freeVariablesPredictive(_0x58f304);_0x1f6b24[_0x1c90('0x162')](_0x58f304,0x1);break;default:freeVariablesPredictive(_0x58f304);logger[_0x1c90('0x97')](_0x1c90('0x164'),_0x58f304[_0x1c90('0x44')],'method\x20not\x20recognized');}};};Dialer[_0x1c90('0x19')][_0x1c90('0x165')]=function(_0x194d5b){var _0x42856d=this;return function(){_0x42856d[_0x1c90('0x166')](_0x194d5b);};};Dialer[_0x1c90('0x19')][_0x1c90('0x33')]=function(_0x5b22bb){var _0x158e91=this;if(isNotPreview(_0x5b22bb[_0x1c90('0x160')])){if(isVoiceQueueOutbound(_0x5b22bb[_0x1c90('0xb2')])&&isActive(_0x5b22bb[_0x1c90('0x5b')])){_0x5b22bb[_0x1c90('0x9f')]=!![];BPromise[_0x1c90('0xb9')]()[_0x1c90('0x40')](checkIsLoggedIn(_0x5b22bb,_0x5b22bb[_0x1c90('0x53')]))[_0x1c90('0x40')](checkIsActive(_0x5b22bb,_0x5b22bb[_0x1c90('0x5b')]))[_0x1c90('0x40')](checkInterval(_0x5b22bb))[_0x1c90('0x40')](_0x158e91['checkIsTrunkReachable'](_0x5b22bb))['then'](_0x158e91['checkIfTime'](_0x5b22bb[_0x1c90('0x167')],_0x5b22bb[_0x1c90('0x168')],_0x5b22bb[_0x1c90('0x44')],_0x5b22bb))[_0x1c90('0x40')](_0x158e91[_0x1c90('0x14b')](_0x5b22bb[_0x1c90('0x46')],_0x5b22bb[_0x1c90('0x168')],_0x5b22bb[_0x1c90('0x44')],_0x5b22bb))[_0x1c90('0x40')](_0x158e91[_0x1c90('0x15f')](_0x5b22bb))[_0x1c90('0xb0')](loggerCatchQueueSummary(_0x1c90('0x169'),_0x5b22bb));}else{notSendMessagesQueue(_0x5b22bb);}}else{freeVariablesPredictive(_0x5b22bb);}};Dialer[_0x1c90('0x19')][_0x1c90('0x34')]=_[_0x1c90('0x16a')](function(){var _0x3fac34=_[_0x1c90('0x16b')](this[_0x1c90('0x1e')],function(_0x108575){return _0x108575[_0x1c90('0x16c')];});var _0x3b30c2=_[_0x1c90('0x16b')](this['agents'],function(_0x80cf91){return _0x80cf91[_0x1c90('0x16d')]&&_0x80cf91['status']===_0x1c90('0xde');});if(_0x3fac34[_0x1c90('0x13a')]>0x0&&_0x3b30c2[_0x1c90('0x13a')]>0x0){return BPromise[_0x1c90('0xb9')]()[_0x1c90('0x40')](cmHopper[_0x1c90('0x16e')](_[_0x1c90('0x16f')](_0x3fac34,'id'),previewRecallmeReminderInterval,_[_0x1c90('0x16f')](_0x3b30c2,'id')))[_0x1c90('0x40')](function(_0x4b48ed){for(var _0x2edbf9=0x0;_0x2edbf9<_0x4b48ed[_0x1c90('0x13a')];_0x2edbf9++){var _0x31ad49=_0x4b48ed[_0x2edbf9][_0x1c90('0x170')][_0x1c90('0x44')];if(_0x31ad49)io['to'](util[_0x1c90('0x7a')]('user:%s',_0x31ad49))[_0x1c90('0x50')](_0x1c90('0x171'),{'hopper':_0x4b48ed[_0x2edbf9]});}})['catch'](function(_0xd3671a){logger['error'](_0x1c90('0x172'),_0xd3671a);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype']['syncCampaigns']=function(){var _0x5b6822=this;var _0x7d5938;for(var _0x2b99cb in this[_0x1c90('0x1f')]){if(typeof this[_0x1c90('0x1f')][_0x2b99cb]!==_0x1c90('0x173')){_0x7d5938=this[_0x1c90('0x1f')][_0x2b99cb];if(isCampaignIvr(_0x7d5938['type'])&&isActive(_0x7d5938[_0x1c90('0xdc')])){_0x7d5938['sendMessageOneNotActive']=!![];BPromise[_0x1c90('0xb9')]()[_0x1c90('0x40')](checkIsActive(_0x7d5938,_0x7d5938[_0x1c90('0xdc')]))[_0x1c90('0x40')](checkInterval(_0x7d5938))[_0x1c90('0x40')](_0x5b6822[_0x1c90('0x145')](_0x7d5938))['then'](_0x5b6822[_0x1c90('0x149')](_0x7d5938[_0x1c90('0x167')],_0x7d5938[_0x1c90('0x168')],_0x7d5938[_0x1c90('0x44')],_0x7d5938))[_0x1c90('0x40')](_0x5b6822[_0x1c90('0x14b')](_0x7d5938[_0x1c90('0x46')],_0x7d5938[_0x1c90('0x168')],_0x7d5938[_0x1c90('0x44')],_0x7d5938))[_0x1c90('0x40')](_0x5b6822[_0x1c90('0x165')](_0x7d5938))[_0x1c90('0xb0')](loggerCatchQueueSummary(_0x1c90('0x174'),_0x7d5938));}else{notSendMessagesCampaign(_0x7d5938);}}}};function getCallerIdRandom(_0xb8dc76,_0x2382f6){var _0x46e72a;var _0x2cdd03;var _0xc3b5dc;if(_0x2382f6<=0x0){_0x2382f6=0x1;}_0x46e72a=new RegExp(_0x1c90('0x175')+_0x2382f6+'}$');_0x2cdd03=Math[_0x1c90('0x176')](0xa,_0x2382f6-0x1);_0xc3b5dc=Math['pow'](0xa,_0x2382f6)-0x1;return util['format']('%s',_[_0x1c90('0x177')](_0xb8dc76,_0x46e72a,_[_0x1c90('0x178')](_0x2cdd03,_0xc3b5dc)));}function extractCalleridName(_0x159328){var _0x501cc9=_0x159328[_0x1c90('0x179')](/"(.*?)"/);return _0x501cc9?_0x501cc9[0x1]:_0x159328;}function extractCalleridNumber(_0x222006){var _0x1f3ead=_0x222006[_0x1c90('0x179')](/<(.*?)>/);return _0x1f3ead?_0x1f3ead[0x1]:_0x222006;}Dialer['prototype'][_0x1c90('0x17a')]=function(_0x9cdaf0,_0x466a78){var _0x5efb4b=this;var _0x1b15ad=uuid['v4']();this['actions'][_0x1b15ad]=new Action(_0x9cdaf0,_0x466a78,_0x1b15ad);return new BPromise(function(_0x4b8c7a,_0x48a3f5){if(_[_0x1c90('0x42')](_0x9cdaf0)&&typeof _0x9cdaf0!==_0x1c90('0x17b')){return _0x48a3f5(msgResponse(_0x1c90('0x17c'),_0x1c90('0x14d'),_0x1c90('0x17d')));}if(_[_0x1c90('0x42')](_0x466a78[_0x1c90('0x17e')])||_0x466a78[_0x1c90('0x17e')]===null){return _0x48a3f5(msgResponse(_0x1c90('0x17c'),_0x1c90('0x14d'),_0x1c90('0x17f')));}var _0x5bca4a={'XMD-CALLERID':_0x5efb4b[_0x1c90('0x23')][_0x1b15ad]['getCaller'](),'XMD-AGI':_0x9cdaf0[_0x1c90('0x109')]?util[_0x1c90('0x7a')](_0x1c90('0x180'),ipAgi,_0x9cdaf0['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x9cdaf0[_0x1c90('0x10f')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x9cdaf0[_0x1c90('0x10f')]):_0x1c90('0x181'),'XMD-QUEUE':_0x9cdaf0[_0x1c90('0xb2')]==='outbound'?util[_0x1c90('0x7a')](_0x1c90('0x182'),_0x9cdaf0[_0x1c90('0x44')],_0x9cdaf0[_0x1c90('0x183')]||'',_0x9cdaf0['dialAgiAfterHangupAgent']?'c':'',_0x9cdaf0[_0x1c90('0x115')]||0x3):'NONE','XMD-CONTACTID':_0x466a78['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x5efb4b[_0x1c90('0x23')][_0x1b15ad][_0x1c90('0x184')](),'XMD-AMD':_0x9cdaf0[_0x1c90('0xe3')]?_0x1c90('0x185'):_0x1c90('0x181'),'XMD-DESTINATION':_0x1c90('0x186')};if(_0x9cdaf0[_0x1c90('0xe3')]){_0x5bca4a['XMD-AMDINITIALSILENCE']=_0x9cdaf0['dialAMDInitialSilence']||0x9c4;_0x5bca4a[_0x1c90('0x187')]=_0x9cdaf0[_0x1c90('0x188')]||0x5dc;_0x5bca4a[_0x1c90('0x189')]=_0x9cdaf0['dialAMDAfterGreetingSilence']||0x320;_0x5bca4a[_0x1c90('0x18a')]=_0x9cdaf0[_0x1c90('0x18b')]||0x1388;_0x5bca4a[_0x1c90('0x18c')]=_0x9cdaf0[_0x1c90('0x18d')]||0x64;_0x5bca4a[_0x1c90('0x18e')]=_0x9cdaf0[_0x1c90('0x18f')]||0x32;_0x5bca4a[_0x1c90('0x190')]=_0x9cdaf0['dialAMDMaximumNumberOfWords']||0x3;_0x5bca4a[_0x1c90('0x191')]=_0x9cdaf0['dialAMDSilenceThreshold']||0x100;_0x5bca4a[_0x1c90('0x192')]=_0x9cdaf0['dialAMDMaximumWordLength']||0x1388;}if(_0x9cdaf0[_0x1c90('0xb2')]===_0x1c90('0x51')){_0x5bca4a['XMD-VOICEQUEUEID']=_0x466a78[_0x1c90('0xd6')];}else{_0x5bca4a[_0x1c90('0x193')]=_0x466a78[_0x1c90('0xd7')];}for(var _0x1e220d in _0x466a78[_0x1c90('0x194')]){if(typeof _0x466a78[_0x1c90('0x194')][_0x1e220d]!=='undefined'){if(isNotNull(_0x466a78[_0x1c90('0x194')][_0x1e220d])&&_0x1e220d!=='id'&&_0x1e220d!==_0x1c90('0x195')&&_0x1e220d!==_0x1c90('0x196')&&_0x1e220d!=='updatedAt'){_0x5bca4a[util[_0x1c90('0x7a')](_0x1c90('0x197'),'XMD-',_['toUpper'](_0x1e220d))]=_0x466a78[_0x1c90('0x194')][_0x1e220d];}}}var _0xebc036=_0x5efb4b[_0x1c90('0xdb')](_0x9cdaf0[_0x1c90('0x79')])?getCallerId(_0x9cdaf0[_0x1c90('0x79')][_0x1c90('0x198')],_0x9cdaf0[_0x1c90('0x5c')],_0x9cdaf0[_0x1c90('0x199')]>0x0?getCallerIdRandom(_0x9cdaf0[_0x1c90('0x5d')],_0x9cdaf0[_0x1c90('0x199')]):_0x9cdaf0['dialOriginateCallerIdNumber']):getCallerId(_[_0x1c90('0xac')](_0x9cdaf0[_0x1c90('0x146')])?_0x9cdaf0[_0x1c90('0x79')][_0x1c90('0x198')]:_0x9cdaf0[_0x1c90('0x146')]['callerid'],_0x9cdaf0[_0x1c90('0x5c')],_0x9cdaf0[_0x1c90('0x199')]>0x0?getCallerIdRandom(_0x9cdaf0[_0x1c90('0x5d')],_0x9cdaf0['dialRandomLastDigitCallerIdNumber']):_0x9cdaf0[_0x1c90('0x5d')]);if(_0xebc036){_0x5bca4a[_0x1c90('0x19a')]=_0x5efb4b[_0x1c90('0x23')][_0x1b15ad]['originatecalleridname']=extractCalleridName(_0xebc036);_0x5bca4a[_0x1c90('0x19b')]=_0x466a78[_0x1c90('0x17e')];}return ami[_0x1c90('0xad')]({'actionid':_0x1b15ad,'action':_0x1c90('0x17c'),'channel':_0x5efb4b[_0x1c90('0xdb')](_0x9cdaf0[_0x1c90('0x79')])?util[_0x1c90('0x7a')](_0x1c90('0x19c'),_0x9cdaf0[_0x1c90('0x79')][_0x1c90('0x44')],isNotNull(_0x9cdaf0[_0x1c90('0x5e')])?_0x9cdaf0[_0x1c90('0x5e')][_0x1c90('0x19d')]()||'':'',_0x9cdaf0[_0x1c90('0x19e')]>0x0?_0x466a78[_0x1c90('0x17e')][_0x1c90('0x19f')](_0x9cdaf0[_0x1c90('0x19e')]):_0x466a78[_0x1c90('0x17e')]):util[_0x1c90('0x7a')](_0x1c90('0x19c'),_[_0x1c90('0xac')](_0x9cdaf0['TrunkBackup'])?_0x9cdaf0[_0x1c90('0x79')][_0x1c90('0x44')]:_0x9cdaf0[_0x1c90('0x146')][_0x1c90('0x44')],isNotNull(_0x9cdaf0[_0x1c90('0x5e')])?_0x9cdaf0[_0x1c90('0x5e')][_0x1c90('0x19d')]()||'':'',_0x9cdaf0['dialCutDigit']>0x0?_0x466a78[_0x1c90('0x17e')]['substring'](_0x9cdaf0[_0x1c90('0x19e')]):_0x466a78['phone']),'callerid':_0xebc036,'Exten':_0x1c90('0x186'),'Context':'from-sip','Priority':'1','variable':_0x5bca4a,'timeout':(_0x9cdaf0[_0x1c90('0x1a0')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1b15ad})[_0x1c90('0x40')](function(_0x57229c){return _0x4b8c7a(_0x57229c);})[_0x1c90('0xb0')](function(_0x484f11){_0x9cdaf0['outboundOriginateFailureCallsDay']+=0x1;var _0x17cd6f=new History(_0x5efb4b[_0x1c90('0x23')][_0x1b15ad]);logger[_0x1c90('0x97')](util[_0x1c90('0x7a')]('[originateError]:\x20%s',JSON[_0x1c90('0x4c')](_0x484f11)));_0x17cd6f[_0x1c90('0xe7')]=0xe;_0x17cd6f[_0x1c90('0xe8')]='OriginateError';_0x17cd6f['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x17cd6f[_0x1c90('0xa7')]=_0x17cd6f[_0x1c90('0x121')];_0x5efb4b[_0x1c90('0xcd')](_0x17cd6f)['catch'](loggerCatch('[originate][error]'));_0x5efb4b[_0x1c90('0xcb')](_0x17cd6f)[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x1a1')))[_0x1c90('0x1c')](function(){delete _0x5efb4b[_0x1c90('0x23')][_0x1b15ad];return _0x48a3f5(msgResponse(_0x1c90('0x17c'),_0x1c90('0x4b'),_0x1c90('0x1a2')));});});});};Dialer[_0x1c90('0x19')]['syncOriginateResponse']=function(_0x4f9462){var _0x337f3e=this[_0x1c90('0x23')][_0x4f9462[_0x1c90('0x12c')]];if(_0x337f3e){delete this[_0x1c90('0x23')][_0x4f9462['actionid']];_0x337f3e['responsetime']=moment()[_0x1c90('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');var _0xe3fa32=_0x337f3e['type']===_0x1c90('0x91')?this[_0x1c90('0x1f')][_0x337f3e['queue']]:this['voiceQueues'][_0x337f3e[_0x1c90('0x1a3')]()];if(!this['isSuccess'](_0x4f9462[_0x1c90('0x1a4')])){this[_0x1c90('0xb3')](_0xe3fa32);return this['callProgressDetecting'](_0x337f3e,_0xe3fa32,_0x4f9462)[_0x1c90('0xb0')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x1c90('0xa9')][_0x4f9462[_0x1c90('0xe6')]]=_0x337f3e;}};Dialer[_0x1c90('0x19')]['checkRetriveMax']=function(_0x156cc7,_0x415c6b,_0x5ea31d){var _0x5c0972=new History(_0x415c6b);if(_0x5c0972['countbusyretry']+_0x5c0972['countcongestionretry']+_0x5c0972[_0x1c90('0xf6')]+_0x5c0972[_0x1c90('0xf7')]+_0x5c0972[_0x1c90('0x118')]+_0x5c0972[_0x1c90('0x127')]+_0x5c0972[_0x1c90('0xf1')]+_0x5c0972[_0x1c90('0xf8')]>=_0x5ea31d[_0x1c90('0x104')]-0x1){return!![];}switch(_0x156cc7){case 0x3:if(_0x5c0972['countnoanswerretry']>=_0x5ea31d[_0x1c90('0x1a5')]-0x1){return!![];}this[_0x1c90('0xc2')]({'active':![],'countnoanswerretry':_0x5c0972[_0x1c90('0xf6')]+=0x1,'scheduledat':moment()[_0x1c90('0xfe')](_0x5ea31d[_0x1c90('0x1a6')],_0x1c90('0x11f'))['format'](_0x1c90('0xff')),'ContactId':_0x5c0972[_0x1c90('0x100')],'ListId':_0x5c0972[_0x1c90('0xd5')],'VoiceQueueId':_0x5c0972[_0x1c90('0xd6')]||undefined,'CampaignId':_0x5c0972[_0x1c90('0xd7')]||undefined})[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x1a7')));break;case 0x5:if(_0x5c0972[_0x1c90('0xf5')]>=_0x5ea31d[_0x1c90('0x1a8')]-0x1){return!![];}this[_0x1c90('0xc2')]({'active':![],'countbusyretry':_0x5c0972['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x5ea31d['dialBusyRetryFrequency'],_0x1c90('0x11f'))[_0x1c90('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5c0972[_0x1c90('0x100')],'ListId':_0x5c0972[_0x1c90('0xd5')],'VoiceQueueId':_0x5c0972[_0x1c90('0xd6')]||undefined,'CampaignId':_0x5c0972['CampaignId']||undefined})[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x1a9')));break;case 0x8:if(_0x5c0972[_0x1c90('0x1aa')]>=_0x5ea31d[_0x1c90('0x1ab')]-0x1){return!![];}this[_0x1c90('0xc2')]({'active':![],'countcongestionretry':_0x5c0972['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x5ea31d[_0x1c90('0x1ac')],_0x1c90('0x11f'))[_0x1c90('0x7a')](_0x1c90('0xff')),'ContactId':_0x5c0972[_0x1c90('0x100')],'ListId':_0x5c0972['ListId'],'VoiceQueueId':_0x5c0972[_0x1c90('0xd6')]||undefined,'CampaignId':_0x5c0972[_0x1c90('0xd7')]||undefined})[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x1ad')));break;case 0x0:if(_0x5c0972['countnosuchnumberretry']>=_0x5ea31d[_0x1c90('0x1ae')]-0x1){return!![];}else{this[_0x1c90('0xc2')]({'active':![],'countnosuchnumberretry':_0x5c0972['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x1c90('0xfe')](_0x5ea31d[_0x1c90('0x1af')],'minutes')[_0x1c90('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5c0972[_0x1c90('0x100')],'ListId':_0x5c0972[_0x1c90('0xd5')],'VoiceQueueId':_0x5c0972[_0x1c90('0xd6')]||undefined,'CampaignId':_0x5c0972['CampaignId']||undefined})[_0x1c90('0xb0')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x5c0972['countdropretry']>=_0x5ea31d['dialDropMaxRetry']-0x1){return!![];}this[_0x1c90('0xc2')]({'active':![],'countdropretry':_0x5c0972['countdropretry']+=0x1,'scheduledat':moment()[_0x1c90('0xfe')](_0x5ea31d[_0x1c90('0x119')],_0x1c90('0x11f'))[_0x1c90('0x7a')](_0x1c90('0xff')),'ContactId':_0x5c0972[_0x1c90('0x100')],'ListId':_0x5c0972[_0x1c90('0xd5')],'VoiceQueueId':_0x5c0972[_0x1c90('0xd6')]||undefined,'CampaignId':_0x5c0972[_0x1c90('0xd7')]||undefined})[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x120')));break;case 0xb:if(_0x5c0972[_0x1c90('0x127')]>=_0x5ea31d[_0x1c90('0x129')]-0x1){return!![];}this[_0x1c90('0xc2')]({'active':![],'countabandonedretry':_0x5c0972[_0x1c90('0x127')]+=0x1,'scheduledat':moment()[_0x1c90('0xfe')](_0x5ea31d[_0x1c90('0x128')],'minutes')[_0x1c90('0x7a')](_0x1c90('0xff')),'ContactId':_0x5c0972[_0x1c90('0x100')],'ListId':_0x5c0972[_0x1c90('0xd5')],'VoiceQueueId':_0x5c0972['VoiceQueueId']||undefined,'CampaignId':_0x5c0972[_0x1c90('0xd7')]||undefined})[_0x1c90('0xb0')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x5c0972['countmachineretry']>=_0x5ea31d[_0x1c90('0xfb')]-0x1){return!![];}this[_0x1c90('0xc2')]({'active':![],'countmachineretry':_0x5c0972[_0x1c90('0xf1')]+=0x1,'scheduledat':moment()[_0x1c90('0xfe')](_0x5ea31d['dialMachineRetryFrequency'],_0x1c90('0x11f'))[_0x1c90('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5c0972['ContactId'],'ListId':_0x5c0972[_0x1c90('0xd5')],'VoiceQueueId':_0x5c0972['VoiceQueueId']||undefined,'CampaignId':_0x5c0972[_0x1c90('0xd7')]||undefined})['catch'](loggerCatch(_0x1c90('0x101')));break;case 0x14:if(_0x5c0972[_0x1c90('0xf8')]>=_0x5ea31d[_0x1c90('0x1b0')]-0x1){return!![];}this[_0x1c90('0xc2')]({'active':![],'countagentrejectretry':_0x5c0972['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x1c90('0xfe')](_0x5ea31d[_0x1c90('0x1b1')],_0x1c90('0x11f'))[_0x1c90('0x7a')](_0x1c90('0xff')),'ContactId':_0x5c0972['ContactId'],'ListId':_0x5c0972[_0x1c90('0xd5')],'VoiceQueueId':_0x5c0972[_0x1c90('0xd6')]||undefined,'CampaignId':_0x5c0972[_0x1c90('0xd7')]||undefined})[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x1b2')));break;default:return!![];}};Dialer[_0x1c90('0x19')][_0x1c90('0x1b3')]=function(_0x2c9422,_0x12a283,_0x44bf74){var _0x3dc4b4=this;var _0x3986cf=new History(_0x2c9422);var _0x1628c1=![];var _0x3199fa;var _0x141603;return new BPromise(function(_0x20e728,_0x46bf3c){if(_[_0x1c90('0x42')](_0x12a283)&&typeof _0x12a283!==_0x1c90('0x17b')){return _0x46bf3c(msgResponse(_0x1c90('0x1b4'),_0x1c90('0x14d'),_0x1c90('0x1b5')));}if(_['isUndefined'](_0x44bf74)&&typeof _0x44bf74!=='object'){return _0x46bf3c(msgResponse(_0x1c90('0x1b4'),_0x1c90('0x14d'),_0x1c90('0x1b6')));}_0x3dc4b4[_0x1c90('0xbb')](_0x3986cf,_0x44bf74[_0x1c90('0x10c')],_0x12a283)[_0x1c90('0x40')](function(_0x3d1d62){if(_0x3d1d62[_0x1c90('0x11c')]==0x1)_0x1628c1=!![];switch(_0x44bf74['reason']){case'0':_0x12a283[_0x1c90('0x68')]+=0x1;_0x3986cf[_0x1c90('0xe7')]=0x0;_0x3986cf[_0x1c90('0xe8')]=_0x1c90('0x1b7');_0x3986cf['countnosuchnumberretry']+=0x1;_0x3986cf[_0x1c90('0xf2')]+=0x1;ami[_0x1c90('0x50')](_0x1c90('0x1b8'),ut[_0x1c90('0xed')](_0x2c9422,_0x1c90('0x1b9')));_0x3199fa=_0x12a283[_0x1c90('0x1af')];_0x141603=_0x12a283[_0x1c90('0x11a')];_0x3dc4b4['createHistory'](_0x3986cf)['catch'](loggerCatch(_0x1c90('0xf4')));if(_0x3dc4b4[_0x1c90('0x1ba')](0x0,_0x2c9422,_0x12a283)&&!_0x1628c1){if(_0x3986cf[_0x1c90('0xf7')]>=_0x12a283['dialNoSuchNumberMaxRetry']){_0x3dc4b4[_0x1c90('0xfc')](_0x3986cf,_0x20e728,_0x46bf3c,'reason\x200\x20no\x20such\x20number....');}else{_0x3dc4b4[_0x1c90('0xf9')](_0x3986cf,_0x20e728,_0x46bf3c,_0x1c90('0x1bb'));}}break;case'3':_0x12a283[_0x1c90('0x67')]+=0x1;_0x3986cf[_0x1c90('0xe7')]=0x3;_0x3986cf[_0x1c90('0xe8')]=_0x1c90('0x1bc');_0x3986cf[_0x1c90('0xf6')]+=0x1;_0x3986cf['countglobal']+=0x1;ami[_0x1c90('0x50')](_0x1c90('0x1bd'),ut[_0x1c90('0xed')](_0x2c9422,_0x1c90('0x1be')));_0x3199fa=_0x12a283[_0x1c90('0x1a6')];_0x141603=_0x12a283[_0x1c90('0x11a')];_0x3dc4b4['createHistory'](_0x3986cf)[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x1bf')));if(_0x3dc4b4[_0x1c90('0x1ba')](0x3,_0x2c9422,_0x12a283)&&!_0x1628c1){if(_0x3986cf[_0x1c90('0xf6')]>=_0x12a283['dialNoAnswerMaxRetry']){_0x3dc4b4[_0x1c90('0xfc')](_0x3986cf,_0x20e728,_0x46bf3c,_0x1c90('0x1c0'));}else{_0x3dc4b4['stateGlobal'](_0x3986cf,_0x20e728,_0x46bf3c,_0x1c90('0x1c0'));}}break;case'5':_0x12a283['outboundBusyCallsDay']+=0x1;_0x3986cf['state']=0x5;_0x3986cf[_0x1c90('0xe8')]=_0x1c90('0x1c1');_0x3986cf[_0x1c90('0xf5')]+=0x1;_0x3986cf[_0x1c90('0xf2')]+=0x1;ami['emit'](_0x1c90('0x1c2'),ut[_0x1c90('0xed')](_0x2c9422,_0x1c90('0x1c3')));_0x3199fa=_0x12a283[_0x1c90('0x1c4')];_0x141603=_0x12a283['callAdditionalPhoneAfterMin'];_0x3dc4b4[_0x1c90('0xcd')](_0x3986cf)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x3dc4b4['checkRetriveMax'](0x5,_0x2c9422,_0x12a283)&&!_0x1628c1){if(_0x3986cf[_0x1c90('0xf5')]>=_0x12a283['dialBusyMaxRetry']){_0x3dc4b4['createStateFinal'](_0x3986cf,_0x20e728,_0x46bf3c,_0x1c90('0x1c5'));}else{_0x3dc4b4[_0x1c90('0xf9')](_0x3986cf,_0x20e728,_0x46bf3c,'reason\x205\x20busy');}}break;case'8':_0x12a283['outboundCongestionCallsDay']+=0x1;_0x3986cf[_0x1c90('0xe7')]=0x8;_0x3986cf[_0x1c90('0xe8')]=_0x1c90('0x1c6');_0x3986cf[_0x1c90('0x1aa')]+=0x1;_0x3986cf['countglobal']+=0x1;_0x3199fa=_0x12a283[_0x1c90('0x1ac')];_0x141603=_0x12a283['callAdditionalPhoneAfterMin'];ami[_0x1c90('0x50')](_0x1c90('0x1c7'),ut['buildObj'](_0x2c9422,_0x1c90('0x1c8')));_0x3dc4b4[_0x1c90('0xcd')](_0x3986cf)[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x1c9')));if(_0x3dc4b4['checkRetriveMax'](0x8,_0x2c9422,_0x12a283)&&!_0x1628c1){if(_0x3986cf[_0x1c90('0x1aa')]>=_0x12a283[_0x1c90('0x1ab')]){_0x3dc4b4['createStateFinal'](_0x3986cf,_0x20e728,_0x46bf3c,_0x1c90('0x1ca'));}else{_0x3dc4b4[_0x1c90('0xf9')](_0x3986cf,_0x20e728,_0x46bf3c,_0x1c90('0x1ca'));}}break;case'11':_0x12a283[_0x1c90('0x1cb')]+=0x1;_0x3986cf[_0x1c90('0xe7')]=0xb;_0x3986cf[_0x1c90('0xe8')]=_0x1c90('0x124');_0x3986cf['countabandonedretry']+=0x1;_0x3986cf['countglobal']+=0x1;_0x3199fa=_0x12a283[_0x1c90('0x128')];_0x141603=_0x12a283[_0x1c90('0x11a')];_0x3dc4b4[_0x1c90('0xcd')](_0x3986cf)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x3dc4b4['checkRetriveMax'](0xb,_0x2c9422,_0x12a283)&&!_0x1628c1){if(_0x3986cf[_0x1c90('0x127')]>=_0x12a283['dialAbandonedMaxRetry']){_0x3dc4b4['createStateFinal'](_0x3986cf,_0x20e728,_0x46bf3c,_0x1c90('0x1cc'));}else{_0x3dc4b4[_0x1c90('0xf9')](_0x3986cf,_0x20e728,_0x46bf3c,_0x1c90('0x1cc'));}}break;case'20':_0x12a283[_0x1c90('0x1cd')]+=0x1;_0x3986cf[_0x1c90('0xe7')]=0x14;_0x3986cf[_0x1c90('0xe8')]=_0x1c90('0x1ce');_0x3986cf['countagentrejectretry']+=0x1;_0x3986cf['countglobal']+=0x1;_0x3199fa=_0x12a283[_0x1c90('0x1b1')];_0x141603=_0x12a283['callAdditionalPhoneAfterMin'];ami['emit'](_0x1c90('0x1cf'),ut[_0x1c90('0xed')](_0x2c9422,'agentreject'));_0x3dc4b4[_0x1c90('0xcd')](_0x3986cf)['catch'](loggerCatch(_0x1c90('0x1d0')));if(_0x3dc4b4[_0x1c90('0x1ba')](0x14,_0x2c9422,_0x12a283)&&!_0x1628c1){if(_0x3986cf['countagentrejectretry']>=_0x12a283[_0x1c90('0x1b0')]){_0x3dc4b4[_0x1c90('0xfc')](_0x3986cf,_0x20e728,_0x46bf3c,'reason\x2020\x20agentreject');}else{_0x3dc4b4['stateGlobal'](_0x3986cf,_0x20e728,_0x46bf3c,_0x1c90('0x1d1'));}}break;default:_0x12a283[_0x1c90('0x6a')]+=0x1;_0x3986cf['state']=0xc;_0x3986cf[_0x1c90('0xe8')]=_0x44bf74[_0x1c90('0x10c')];_0x3199fa=_0x12a283[_0x1c90('0x1b1')];_0x141603=_0x12a283[_0x1c90('0x11a')];_0x3dc4b4['createHistory'](_0x3986cf)['catch'](loggerCatch(_0x1c90('0x1d2')));if(_0x3dc4b4[_0x1c90('0x1ba')](_0x44bf74[_0x1c90('0x10c')],_0x2c9422,_0x12a283)&&!_0x1628c1){if(_0x3986cf[_0x1c90('0xf5')]+_0x3986cf[_0x1c90('0x1aa')]+_0x3986cf[_0x1c90('0xf6')]+_0x3986cf[_0x1c90('0xf7')]+_0x3986cf[_0x1c90('0x118')]+_0x3986cf[_0x1c90('0x127')]+_0x3986cf[_0x1c90('0xf1')]+_0x3986cf[_0x1c90('0xf8')]>=_0x12a283[_0x1c90('0x104')]){_0x3dc4b4[_0x1c90('0xf9')](_0x3986cf,_0x20e728,_0x46bf3c,_0x44bf74[_0x1c90('0x10c')]);}else{_0x3dc4b4['createStateFinal'](_0x3986cf,_0x20e728,_0x46bf3c,_0x44bf74[_0x1c90('0x10c')]);}}}})[_0x1c90('0x40')](function(_0x459fd1){if(_0x1628c1){_0x3dc4b4[_0x1c90('0xbd')](_0x3986cf,_0x3199fa,_0x141603)[_0x1c90('0x40')](function(_0x1010e3){return _0x20e728(0x1);});}});});};Dialer[_0x1c90('0x19')][_0x1c90('0xf9')]=function(_0x5f19a4,_0x31cdd7,_0x28ff90,_0x2efba9){var _0x67c477=new Final(_0x5f19a4);_0x67c477['state']=0xf;_0x67c477['statedesc']=_0x1c90('0x1d3');this['createStateFinal'](_0x67c477,_0x31cdd7,_0x28ff90,_0x2efba9);};Dialer[_0x1c90('0x19')][_0x1c90('0xfc')]=function(_0x1cb7a0,_0x1b1a97,_0x2ecb8e,_0x50e71c){this[_0x1c90('0xcb')](_0x1cb7a0)[_0x1c90('0x40')](function(){return _0x1b1a97(msgResponse(_0x1c90('0x1b4'),_0x1c90('0x1d4'),_0x50e71c));})['catch'](function(){return _0x2ecb8e(msgResponse(_0x1c90('0x1d5'),_0x1c90('0x14d'),_0x1c90('0x1d6')));});};Dialer['prototype']['predictive']=function(_0x4b5bd2){var _0x23e3ed=_0x4b5bd2[_0x1c90('0x1d7')]/0x64;var _0x14bded=_0x4b5bd2[_0x1c90('0x66')]/(_0x4b5bd2[_0x1c90('0x66')]+_0x4b5bd2['outboundAnswerCallsDay']);var _0x482f3b=Math[_0x1c90('0x1d8')](_0x4b5bd2[_0x1c90('0x73')]*(_0x4b5bd2[_0x1c90('0x1d9')]/0x64));var _0x53226a=Math[_0x1c90('0x1d8')](_0x4b5bd2[_0x1c90('0x73')]*(_0x4b5bd2[_0x1c90('0x1da')]/0x64));var _0x13995f=_0x4b5bd2[_0x1c90('0xa0')]+_0x4b5bd2[_0x1c90('0x57')];var _0x3775a4=Math[_0x1c90('0x1db')](_0x4b5bd2[_0x1c90('0x75')]*_0x4b5bd2[_0x1c90('0x77')]*_0x4b5bd2[_0x1c90('0x70')]*_0x4b5bd2['predictiveIntervalMultiplicativeFactor']);if(_[_0x1c90('0x42')](_0x4b5bd2[_0x1c90('0x27')])){if(!_['isUndefined'](_0x4b5bd2[_0x1c90('0x26')])){_0x4b5bd2[_0x1c90('0x26')]=undefined;loggerPredictive[_0x1c90('0x97')](_0x1c90('0x1dc'),_0x1c90('0x1dd'));}if(!_[_0x1c90('0x42')](_0x4b5bd2[_0x1c90('0x8f')])){loggerPredictive[_0x1c90('0x97')](_0x1c90('0x1dc'),_0x1c90('0x1de'));clearInterval(_0x4b5bd2['handlePredictive']);_0x4b5bd2['handlePredictive']=undefined;}_0x4b5bd2['startProgressive']=moment()[_0x1c90('0x7a')](_0x1c90('0xff'));loggerPredictive[_0x1c90('0x81')](_0x4b5bd2[_0x1c90('0x44')],_0x1c90('0x1df'),_0x4b5bd2[_0x1c90('0x27')]);this[_0x1c90('0x162')](_0x4b5bd2,0x1);}else if(ifInterval(_0x4b5bd2[_0x1c90('0x1e0')],_0x4b5bd2['startProgressive'])){this[_0x1c90('0x162')](_0x4b5bd2,0x1);loggerPredictiveCalls[_0x1c90('0x81')](_0x1c90('0x1e1'),_0x4b5bd2[_0x1c90('0x27')],_0x4b5bd2[_0x1c90('0x44')]);_0x4b5bd2[_0x1c90('0x75')]=0x0;_0x4b5bd2[_0x1c90('0x6f')]=0x0;}else if(_0x23e3ed<_0x14bded&&_0x4b5bd2[_0x1c90('0x1e2')]===_0x1c90('0x1e3')){freeVariablesPredictive(_0x4b5bd2);loggerPredictive[_0x1c90('0x81')](_0x1c90('0x1e4'),'Dropped\x20calls\x20day',_0x14bded,'startProgressive',_0x4b5bd2[_0x1c90('0x44')]);}else if(_0x3775a4<_0x4b5bd2[_0x1c90('0x6f')]&&_0x4b5bd2['dialPredictiveOptimization']===_0x1c90('0x1e3')){freeVariablesPredictive(_0x4b5bd2);loggerPredictive[_0x1c90('0x81')](_0x1c90('0x1e5'),_0x1c90('0x1e6'),_0x3775a4,_0x1c90('0x1e7'),_0x4b5bd2[_0x1c90('0x6f')],_0x1c90('0x27'),_0x4b5bd2[_0x1c90('0x44')]);}else if(!ifInterval(_0x4b5bd2['dialPredictiveInterval'],_0x4b5bd2[_0x1c90('0x27')])&&_[_0x1c90('0x42')](_0x4b5bd2['startPredictive'])&&!_['isUndefined'](_0x4b5bd2[_0x1c90('0x27')])){_0x4b5bd2[_0x1c90('0x26')]=moment()[_0x1c90('0x7a')](_0x1c90('0xff'));loggerPredictive['info'](_0x4b5bd2[_0x1c90('0x44')],'started\x20in\x20predictive\x20at',_0x4b5bd2[_0x1c90('0x26')]);this[_0x1c90('0xc0')](_0x4b5bd2[_0x1c90('0x1e0')])[_0x1c90('0x40')](this[_0x1c90('0x1e8')](_0x4b5bd2))[_0x1c90('0x40')](mergeDataErlangB(_0x4b5bd2))[_0x1c90('0x40')](this['startMethodPredictive'](_0x4b5bd2))[_0x1c90('0xb0')](loggerCatchPredictive(_0x1c90('0x1e9'),_0x4b5bd2));}else if(!ifInterval(_0x4b5bd2[_0x1c90('0x1e0')],_0x4b5bd2[_0x1c90('0x26')])){_0x4b5bd2['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x4b5bd2[_0x1c90('0x26')]=moment()[_0x1c90('0x7a')](_0x1c90('0xff'));loggerPredictive[_0x1c90('0x81')](_0x4b5bd2[_0x1c90('0x44')],_0x1c90('0x1ea'),_0x4b5bd2[_0x1c90('0x26')]);clearInterval(_0x4b5bd2['handlePredictive']);_0x4b5bd2[_0x1c90('0x8f')]=undefined;this[_0x1c90('0xc0')](_0x4b5bd2[_0x1c90('0x1e0')])[_0x1c90('0x40')](this[_0x1c90('0x1e8')](_0x4b5bd2))[_0x1c90('0x40')](mergeDataErlangB(_0x4b5bd2))[_0x1c90('0x40')](this['startMethodPredictive'](_0x4b5bd2))['catch'](loggerCatchPredictive(_0x1c90('0x1eb'),_0x4b5bd2));}else if(_0x4b5bd2[_0x1c90('0x73')]&&_0x13995f<_0x4b5bd2['predictiveIntervalAvailable']-_0x53226a){freeVariablesPredictive(_0x4b5bd2);loggerPredictive[_0x1c90('0x81')](_0x4b5bd2[_0x1c90('0x44')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x13995f,_0x1c90('0x1ec'),_0x4b5bd2['predictiveIntervalAvailable'],'-',_0x53226a,'=',_0x4b5bd2[_0x1c90('0x73')]-_0x53226a,')');}else if(_0x4b5bd2['predictiveIntervalAvailable']&&_0x13995f>_0x4b5bd2[_0x1c90('0x73')]+_0x482f3b){freeVariablesPredictive(_0x4b5bd2);loggerPredictive[_0x1c90('0x81')](_0x4b5bd2[_0x1c90('0x44')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x13995f,')\x20are\x20more\x20than\x20threshold\x20(',_0x4b5bd2[_0x1c90('0x73')],'+',_0x482f3b,'=',_0x4b5bd2['predictiveIntervalAvailable']+_0x482f3b,')');}};Dialer['prototype'][_0x1c90('0x1e8')]=function(_0x1faa54){var _0x177209=this;return function(_0x588e45){return new BPromise(function(_0xf487f3,_0xc06960){_[_0x1c90('0x8d')](_0x1faa54,_0x588e45[0x0]);if(checkGetDataPredictive(_0x588e45[0x0])){var _0x1f35f8=_0x1faa54[_0x1c90('0x73')]=_0x1faa54[_0x1c90('0x57')]+_0x1faa54[_0x1c90('0xa0')];var _0x5e94a0=_0x1faa54[_0x1c90('0x1e0')]*0x3c;var _0x514c33=_0x588e45[0x0]['predictiveIntervalAvgTalktime']+_0x588e45[0x0]['predictiveIntervalAvgHoldtime'];var _0x43d6cd=(_0x588e45[0x0][_0x1c90('0x1ed')]+_0x588e45[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x588e45[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x588e45[0x0][_0x1c90('0x80')];_0x1faa54[_0x1c90('0x70')]=_0x43d6cd>0x0?_0x43d6cd:0x1;switch(_0x1faa54[_0x1c90('0x1e2')]){case _0x1c90('0x1e3'):var _0x1770f9=_0x1faa54[_0x1c90('0x1d7')]/0x64;return _0x177209[_0x1c90('0x1ee')](_0x1f35f8,_0x5e94a0,_0x514c33,_0x43d6cd,_0x1770f9)[_0x1c90('0x40')](function(_0x378499){return _0xf487f3(_0x378499);});case _0x1c90('0x1ef'):var _0xf26d7b=_0x1faa54[_0x1c90('0x1d7')]/0x64;return _0x177209[_0x1c90('0x1f0')](_0x1f35f8,_0x5e94a0,_0x514c33,_0x43d6cd,_0xf26d7b)[_0x1c90('0x40')](function(_0x4bd64d){return _0xf487f3(_0x4bd64d);});default:return _0xc06960(msgResponse(_0x1c90('0x1f1'),_0x1c90('0x14d'),'Unknown\x20Predictive'));}}else{return _0xc06960(msgResponse(_0x1c90('0x1f1'),_0x1c90('0x14d'),_0x1c90('0x1f2')));}});};};Dialer[_0x1c90('0x19')][_0x1c90('0x1f3')]=function(_0x283a46){var _0x219e90=this;return function(_0x12fa70){return new BPromise(function(_0x538d8d,_0x3111b0){_[_0x1c90('0x8d')](_0x283a46,_0x12fa70[0x0]);if(checkGetDataPredictive(_0x12fa70[0x0])){loggerPredictive['info'](JSON[_0x1c90('0x4c')](_0x12fa70[0x0]));if(_0x283a46[_0x1c90('0x1e2')]===_0x1c90('0x1e3')){return _0x219e90[_0x1c90('0xca')](_0x283a46['id'])['then'](function(_0x3e6922){var _0x56eac0=_0x283a46[_0x1c90('0x53')]-_0x3e6922[0x0]['outboundQueuePauses'];var _0x4c70d6=_0x283a46['dialPredictiveInterval']*0x3c;var _0x3d77dc=_0x12fa70[0x0][_0x1c90('0x6b')]+_0x12fa70[0x0]['predictiveIntervalAvgHoldtime'];var _0x1a284b=(_0x12fa70[0x0][_0x1c90('0x1ed')]+_0x12fa70[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x12fa70[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x12fa70[0x0][_0x1c90('0x80')];var _0x335f69=_0x283a46[_0x1c90('0x1d7')]/0x64;_0x283a46[_0x1c90('0x72')]=_0x3e6922[0x0][_0x1c90('0x1f4')]||0x0;_0x283a46[_0x1c90('0x70')]=_0x1a284b>0x0?_0x1a284b:0x1;return _0x219e90[_0x1c90('0x1ee')](_0x56eac0,_0x4c70d6,_0x3d77dc,_0x1a284b,_0x335f69);})[_0x1c90('0x40')](function(_0x3e096e){return _0x538d8d(_0x3e096e);})['catch'](function(_0x58cf41){return _0x3111b0(msgResponse(_0x1c90('0x1f5'),_0x1c90('0x14d'),JSON[_0x1c90('0x4c')](_0x58cf41)));});}if(_0x283a46[_0x1c90('0x1e2')]===_0x1c90('0x1ef')){return _0x219e90[_0x1c90('0xca')](_0x283a46['id'])['then'](function(_0x3f61c6){var _0x121992=_0x283a46[_0x1c90('0x53')]-_0x3f61c6[0x0][_0x1c90('0x1f4')];var _0x29f05b=_0x283a46[_0x1c90('0x1e0')]*0x3c;var _0x58488b=_0x12fa70[0x0][_0x1c90('0x6b')]+_0x12fa70[0x0][_0x1c90('0x85')];var _0x38a2c7=(_0x12fa70[0x0][_0x1c90('0x1ed')]+_0x12fa70[0x0][_0x1c90('0x6d')]+_0x12fa70[0x0][_0x1c90('0x6c')])/_0x12fa70[0x0][_0x1c90('0x80')];var _0x3f4eec=_0x283a46[_0x1c90('0x1d7')]/0x64;_0x283a46[_0x1c90('0x72')]=_0x3f61c6[0x0][_0x1c90('0x1f4')]||0x0;_0x283a46[_0x1c90('0x70')]=_0x38a2c7>0x0?_0x38a2c7:0x1;return _0x219e90[_0x1c90('0x1f0')](_0x121992,_0x29f05b,_0x58488b,_0x38a2c7,_0x3f4eec);})[_0x1c90('0x40')](function(_0x5488e9){return _0x538d8d(_0x5488e9);})['catch'](function(_0x5d38f1){return _0x3111b0(msgResponse(_0x1c90('0x1f5'),_0x1c90('0x14d'),JSON['stringify'](_0x5d38f1)));});}}else{return _0x3111b0(msgResponse('[getDataPredictive]',_0x1c90('0x14d'),'check\x20failure'));}});};};Dialer['prototype'][_0x1c90('0x1f6')]=function(_0x5d6e38){var _0x3e844c=this;return function(){var _0x451bb1=0x0;var _0x468270=Math[_0x1c90('0x1db')](_0x5d6e38[_0x1c90('0x76')]*0x3e8);if(_0x468270>0x0){_0x468270=_0x468270<0x64?0x64:_0x468270;loggerPredictive['info'](_0x5d6e38[_0x1c90('0x44')],'one\x20call\x20every:',_0x468270,_0x1c90('0x4d'));_0x5d6e38[_0x1c90('0x8f')]=setInterval(function(){_0x3e844c['handlePredictive'](_0x5d6e38);loggerPredictiveCalls['info'](_0x1c90('0x1f7'),_0x451bb1+=0x1);},_0x468270);}else{loggerPredictive[_0x1c90('0x81')](_0x5d6e38[_0x1c90('0x44')],_0x1c90('0x1f8'));}};};Dialer['prototype'][_0x1c90('0x1f9')]=function(_0x11c147,_0x49fa83){var _0xc7bddc=this;return function(_0x4c38e9){if(_[_0x1c90('0x49')](_0x4c38e9)){if(_[_0x1c90('0xac')](_0x49fa83[_0x1c90('0x1fa')])||!_0x49fa83[_0x1c90('0x1fb')]){if(_0x11c147['dialMethod']==='booked'){_0x11c147[_0x1c90('0x133')]=_[_0x1c90('0x42')](_0x11c147[_0x1c90('0x133')])?!![]:_0x11c147['queueStatusComplete'];var _0x53fa18=uuid['v4']();_0xc7bddc['actions'][_0x53fa18]=new Action(_0x11c147,_0x49fa83,_0x53fa18);loggerBooked[_0x1c90('0x81')](_0x1c90('0x1fc'),_0x53fa18,_0x1c90('0x1fd'),JSON[_0x1c90('0x4c')](_0x11c147[_0x1c90('0x133')]),_0x1c90('0x1fe'),_0x11c147[_0x1c90('0x44')]);if(_0x11c147[_0x1c90('0x133')]){_0x11c147[_0x1c90('0x133')]=![];_0xc7bddc[_0x1c90('0x29')][_0xc7bddc[_0x1c90('0x23')][_0x53fa18]['queue']]=[];ami[_0x1c90('0xad')]({'actionid':_0x53fa18,'action':_0x1c90('0x1ff'),'queue':_0x11c147['name']})[_0x1c90('0xb0')](function(){_0xc7bddc['updateOriginated'](_0x11c147);_0xc7bddc[_0x1c90('0xc2')]({'active':![],'ContactId':_0xc7bddc[_0x1c90('0x23')][_0x53fa18][_0x1c90('0x100')],'ListId':_0xc7bddc[_0x1c90('0x23')][_0x53fa18][_0x1c90('0xd5')],'VoiceQueueId':_0xc7bddc['actions'][_0x53fa18][_0x1c90('0xd6')]||undefined,'CampaignId':_0xc7bddc['actions'][_0x53fa18][_0x1c90('0xd7')]||undefined})[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x200')));delete _0xc7bddc[_0x1c90('0x23')][_0x53fa18];});}else{loggerBooked[_0x1c90('0x81')](_0x1c90('0x201'),JSON['stringify'](_0x11c147[_0x1c90('0x133')]),_0x1c90('0x1fe'),_0x11c147[_0x1c90('0x44')]);_0xc7bddc[_0x1c90('0xb3')](_0x11c147);_0xc7bddc['rescheduleContact']({'active':![],'ContactId':_0xc7bddc[_0x1c90('0x23')][_0x53fa18]['ContactId'],'ListId':_0xc7bddc[_0x1c90('0x23')][_0x53fa18]['ListId'],'VoiceQueueId':_0xc7bddc[_0x1c90('0x23')][_0x53fa18][_0x1c90('0xd6')]||undefined,'CampaignId':_0xc7bddc[_0x1c90('0x23')][_0x53fa18][_0x1c90('0xd7')]||undefined})[_0x1c90('0xb0')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0xc7bddc[_0x1c90('0x23')][_0x53fa18];}}else{return _0xc7bddc['actionOriginate'](_0x11c147,_0x49fa83);}}else{if(getDiff(_0x49fa83['scheduledat'])<_0x11c147['dialRecallMeTimeout']*0x3c){if(_0x49fa83[_0x1c90('0x170')]&&!_0x49fa83['Agent'][_0x1c90('0x202')]){_0xc7bddc[_0x1c90('0x90')][_0x1c90('0x135')](_0x49fa83['id'])[_0x1c90('0x1c')](function(){_0xc7bddc['updateOriginated'](_0x11c147);});}else{_0xc7bddc[_0x1c90('0xc4')]({'active':![]},_0x49fa83['id'],0x1)[_0x1c90('0x1c')](function(){_0xc7bddc[_0x1c90('0xb3')](_0x11c147);});}}else{_0x11c147[_0x1c90('0x69')]+=0x1;_0xc7bddc['updateOriginated'](_0x11c147);if(_0x11c147['dialRecallInQueue']){_0xc7bddc['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x49fa83[_0x1c90('0x100')],'ListId':_0x49fa83['ListId'],'VoiceQueueId':_0x49fa83[_0x1c90('0xd6')]||undefined,'CampaignId':_0x49fa83[_0x1c90('0xd7')]||undefined})[_0x1c90('0xb0')](loggerCatch(_0x1c90('0x203')));_0xc7bddc[_0x1c90('0xcd')](createObjHistory(_0x11c147,_0x49fa83,'RECALLINQUEUE',0x17,'RecallInQueue'))['catch'](loggerCatch(_0x1c90('0x204')));}else{_0xc7bddc[_0x1c90('0xd3')](createObjHistory(_0x11c147,_0x49fa83,'RECALLFAILEDTIMEOUT',0x16,_0x1c90('0x205')),_0x1c90('0x206'),_0x1c90('0x207'));}}}}else{_0x11c147[_0x1c90('0x61')]+=0x1;_0xc7bddc[_0x1c90('0xd3')](createObjHistory(_0x11c147,_0x49fa83,'BLACKLIST',0xd,'Blacklist'),_0x1c90('0x208'),_0x1c90('0x209'));throw _0x1c90('0x20a');}};};Dialer[_0x1c90('0x19')][_0x1c90('0x166')]=function(_0x1aa5a7){var _0x57e057=this;var _0x3cb88e=_0x1aa5a7[_0x1c90('0x20b')]-_0x1aa5a7[_0x1c90('0x74')]-_0x1aa5a7[_0x1c90('0xc6')];emitCampaignSummary(_0x1aa5a7);if(_0x3cb88e>0x0){if(_0x3cb88e>this['maxNumberOriginate']){_0x3cb88e=this[_0x1c90('0x22')];}_0x1aa5a7['temp']+=_0x3cb88e;this[_0x1c90('0xc8')](_0x1aa5a7['id'],_0x3cb88e,_0x1aa5a7['dialOrderByScheduledAt'],_0x1aa5a7)['then'](function(_0x3ca09f){_0x1aa5a7[_0x1c90('0xc6')]-=_0x3cb88e;_0x1aa5a7[_0x1c90('0xc6')]=_0x1aa5a7[_0x1c90('0xc6')]>0x0?_0x1aa5a7[_0x1c90('0xc6')]:0x0;if(!checkContactEmpty(_0x3ca09f)){_0x1aa5a7[_0x1c90('0x43')]=_0x1c90('0x9d');logger[_0x1c90('0x81')](_0x1c90('0x20c')+_0x1aa5a7[_0x1c90('0x44')]);}else{_0x1aa5a7[_0x1c90('0x74')]+=_0x3ca09f[_0x1c90('0x13a')];_0x1aa5a7[_0x1c90('0x43')]='RUNNING';for(var _0x24d443=0x0;_0x24d443<_0x3ca09f[_0x1c90('0x13a')];_0x24d443+=0x1){_0x1aa5a7['ivrTotalCallsDays']+=0x1;if(_[_0x1c90('0xac')](_0x3ca09f[_0x24d443])||_[_0x1c90('0xac')](_0x3ca09f[_0x24d443]['Contact'])||_['isNil'](_0x3ca09f[_0x24d443]['phone'])){_0x57e057[_0x1c90('0xd1')]('[actionOriginate]\x20',_0x1aa5a7,_0x3ca09f[_0x24d443]);}else{_0x57e057[_0x1c90('0xbf')](_[_0x1c90('0xd4')](_0x3ca09f[_0x24d443],['CampaignId',_0x1c90('0x20d')]))[_0x1c90('0x40')](_0x57e057[_0x1c90('0x1f9')](_0x1aa5a7,_0x3ca09f[_0x24d443]))['catch'](_0x57e057[_0x1c90('0x20e')](_0x1c90('0x20f'),_0x1aa5a7));}}}})[_0x1c90('0xb0')](loggerGetContactDialer(_0x1c90('0x210'),_0x1aa5a7,_0x3cb88e));}};Dialer[_0x1c90('0x19')][_0x1c90('0x162')]=function(_0x53e25b,_0x493733){var _0x27472c=this;var _0x3e24da=[];var _0x10cf69=_0x493733>=0x1?_0x493733:0x1;if(_0x53e25b[_0x1c90('0x160')]===_0x1c90('0x6')){_0x10cf69=0x1;}var _0x186545=Math[_0x1c90('0x1db')](_0x53e25b[_0x1c90('0xa0')]*_0x10cf69)-_0x53e25b['originated']-_0x53e25b[_0x1c90('0xc6')];emitVoiceQueueSummary(_0x53e25b);if(_0x53e25b[_0x1c90('0x211')]>0x0){var _0x7af702=_0x53e25b[_0x1c90('0x211')]-_0x53e25b[_0x1c90('0x74')]-_0x53e25b['talking']-_0x53e25b['temp']-_0x53e25b['pTalking'];if(_0x186545>_0x7af702){_0x186545=_0x7af702;}}if(_0x186545>0x0){if(_0x53e25b[_0x1c90('0x160')]===_0x1c90('0x6')){_0x186545=0x1;}if(_0x186545>this['maxNumberOriginate']){_0x186545=this[_0x1c90('0x22')];}_0x53e25b[_0x1c90('0xc6')]+=_0x186545;for(var _0xa705e1 in this[_0x1c90('0x20')]){if(typeof this[_0x1c90('0x20')][_0xa705e1]!==_0x1c90('0x173')){if(this['agents'][_0xa705e1][_0x1c90('0xe7')]===_0x1c90('0x212')&&this[_0x1c90('0x20')][_0xa705e1][_0x1c90('0xae')]===_0x1c90('0xde')){_0x3e24da['push'](this[_0x1c90('0x20')][_0xa705e1]['id']);}}}this[_0x1c90('0xc5')](_0x53e25b['id'],_0x3e24da,_0x186545,_0x53e25b[_0x1c90('0x213')],_0x53e25b)[_0x1c90('0x40')](function(_0x284481){_0x53e25b[_0x1c90('0xc6')]-=_0x186545;_0x53e25b['temp']=_0x53e25b[_0x1c90('0xc6')]>0x0?_0x53e25b[_0x1c90('0xc6')]:0x0;if(!checkContactEmpty(_0x284481)){_0x27472c[_0x1c90('0xb7')](_0x53e25b)['then'](sendMessageReschedule(_0x53e25b))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x53e25b[_0x1c90('0x74')]+=_0x284481[_0x1c90('0x13a')];_0x53e25b['message']=_0x53e25b[_0x1c90('0x160')]===_0x1c90('0x6')?_0x1c90('0x185'):'RUNNING';for(var _0xce4617=0x0;_0xce4617<_0x284481[_0x1c90('0x13a')];_0xce4617+=0x1){if(_[_0x1c90('0xac')](_0x284481[_0xce4617])||_[_0x1c90('0xac')](_0x284481[_0xce4617][_0x1c90('0x194')])||_['isNil'](_0x284481[_0xce4617][_0x1c90('0x17e')])){_0x27472c[_0x1c90('0xd1')]('[actionOriginate]\x20',_0x53e25b,_0x284481[_0xce4617]);}else{_0x27472c[_0x1c90('0xba')](_['pick'](_0x284481[_0xce4617],[_0x1c90('0xd6'),'Contact.phone']))['then'](_0x27472c[_0x1c90('0x1f9')](_0x53e25b,_0x284481[_0xce4617]))[_0x1c90('0xb0')](_0x27472c['loggerHandler'](_0x1c90('0x214'),_0x53e25b));}}}})[_0x1c90('0xb0')](loggerGetContactDialer('[getContactDialer2]',_0x53e25b,_0x186545));}};Dialer[_0x1c90('0x19')][_0x1c90('0x8f')]=function(_0x130086){if(_0x130086['dialLimitQueue']>0x0){var _0x1f649e=_0x130086['dialLimitQueue']-_0x130086['originated']-_0x130086[_0x1c90('0x57')];if(_0x1f649e>0x0){this[_0x1c90('0x215')](_0x130086);}else{loggerPredictiveCalls[_0x1c90('0x81')](_0x1c90('0x216'));}}else{this[_0x1c90('0x215')](_0x130086);}};Dialer[_0x1c90('0x19')][_0x1c90('0x215')]=function(_0x4991bb){var _0x32b7f8=this;var _0x3be99c=[];_0x4991bb[_0x1c90('0x74')]+=0x1;for(var _0x137684 in this[_0x1c90('0x20')]){if(typeof this['agents'][_0x137684]!=='undefined'){if(this[_0x1c90('0x20')][_0x137684][_0x1c90('0xe7')]===_0x1c90('0x212')&&this[_0x1c90('0x20')][_0x137684][_0x1c90('0xae')]===_0x1c90('0xde')){_0x3be99c[_0x1c90('0x131')](this[_0x1c90('0x20')][_0x137684]['id']);}}}this[_0x1c90('0xc5')](_0x4991bb['id'],_0x3be99c,0x1,_0x4991bb['dialOrderByScheduledAt'],_0x4991bb)['then'](function(_0x31c915){if(!checkContactEmpty(_0x31c915)){checkContactLowerLimitOriginate(_0x4991bb,0x1,0x0);_0x32b7f8[_0x1c90('0xb7')](_0x4991bb)['then'](sendMessageReschedule(_0x4991bb))['catch'](loggerCatch(_0x1c90('0xb8')));}else{_0x4991bb[_0x1c90('0x43')]=_0x1c90('0x217');if(_[_0x1c90('0xac')](_0x31c915[0x0])||_['isNil'](_0x31c915[0x0][_0x1c90('0x194')])||_[_0x1c90('0xac')](_0x31c915[0x0][_0x1c90('0x17e')])){_0x32b7f8[_0x1c90('0xd1')](_0x1c90('0x214'),_0x4991bb,_0x31c915[0x0]);}else{_0x32b7f8['checkIsBlackList'](_[_0x1c90('0xd4')](_0x31c915[0x0],[_0x1c90('0xd6'),'Contact.phone']))[_0x1c90('0x40')](_0x32b7f8[_0x1c90('0x1f9')](_0x4991bb,_0x31c915[0x0]))[_0x1c90('0xb0')](_0x32b7f8['loggerHandler'](_0x1c90('0x218'),_0x4991bb));}}})[_0x1c90('0xb0')](loggerGetContactDialer(_0x1c90('0x219'),_0x4991bb,0x1));emitVoiceQueueSummary(_0x4991bb);};Dialer[_0x1c90('0x19')]['abandonmentRate']=function(_0x2f38e0,_0x4dd73c,_0x2676e0,_0x17b106,_0x15386e,_0x3354a3){loggerPredictive[_0x1c90('0x81')](_0x1c90('0x21a'));loggerPredictive[_0x1c90('0x81')](_0x1c90('0x21b'),_0x2f38e0);loggerPredictive[_0x1c90('0x81')](_0x1c90('0x21c'),_0x4dd73c);loggerPredictive[_0x1c90('0x81')]('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',_0x2676e0);loggerPredictive[_0x1c90('0x81')](_0x1c90('0x21d'),_0x17b106);loggerPredictive[_0x1c90('0x81')](_0x1c90('0x21e'),_0x15386e);loggerPredictive[_0x1c90('0x81')](_0x1c90('0x87'));return new BPromise(function(_0x2c4b7f,_0x5bc4a0){if(_0x2f38e0<=0x0||isNaN(_0x2f38e0)){return _0x5bc4a0(msgResponse('[abandonmentRate]',_0x1c90('0x4b'),_0x1c90('0x21f')+_0x2f38e0));}if(_0x2676e0<=0x0||isNaN(_0x2676e0)){return _0x5bc4a0(msgResponse('[abandonmentRate]',_0x1c90('0x4b'),_0x1c90('0x220')+_0x2676e0));}if(_0x17b106<=0x0||isNaN(_0x17b106)){return _0x5bc4a0(msgResponse(_0x1c90('0x221'),_0x1c90('0x4b'),'p\x20=\x20'+_0x17b106));}if(_0x4dd73c<=0x0||isNaN(_0x4dd73c)){return _0x5bc4a0(msgResponse(_0x1c90('0x221'),'Error',_0x1c90('0x222')+_0x4dd73c));}if(_0x15386e<=0x0||isNaN(_0x15386e)){return _0x5bc4a0(msgResponse('[abandonmentRate]',_0x1c90('0x4b'),_0x1c90('0x223')+_0x15386e));}_0x3354a3=_0x3354a3||0x0;var _0x629f6=0x1/_0x2676e0;var _0x2a1318=0x0;var _0x446bd0=0x0;var _0x52c850=0x0;var _0x1f6d06=0x0;for(var _0x594e80=0x0;_0x52c850<_0x15386e;_0x594e80+=0x1){_0x446bd0=_0x594e80/_0x4dd73c;_0x2a1318=(_0x17b106*_0x446bd0+_0x3354a3)/_0x629f6;_0x52c850=erlangb(_0x2a1318,_0x2f38e0);_0x1f6d06=_0x2a1318/_0x2f38e0*(0x1-erlangb(_0x2a1318,_0x2f38e0));}return _0x2c4b7f({'erlangCalls':_0x594e80,'erlangCallToSecond':_0x4dd73c/_0x594e80,'erlangAbandonmentRate':_0x52c850,'erlangBusyFactor':_0x1f6d06});});};Dialer['prototype']['busyFactor']=function(_0x24251f,_0x368e8e,_0x2cd39b,_0x5e3408,_0xa2b0e6,_0x523e4a){loggerPredictive[_0x1c90('0x81')](_0x1c90('0x224'));loggerPredictive[_0x1c90('0x81')](_0x1c90('0x21b'),_0x24251f);loggerPredictive[_0x1c90('0x81')](_0x1c90('0x21c'),_0x368e8e);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',_0x2cd39b);loggerPredictive[_0x1c90('0x81')](_0x1c90('0x21d'),_0x5e3408);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xa2b0e6);loggerPredictive[_0x1c90('0x81')](_0x1c90('0x87'));return new BPromise(function(_0x3d5e84,_0x58d21d){if(_0x24251f<=0x0||isNaN(_0x24251f)){return _0x58d21d(msgResponse(_0x1c90('0x225'),_0x1c90('0x4b'),'m\x20=\x20'+_0x24251f));}if(_0x2cd39b<=0x0||isNaN(_0x2cd39b)){return _0x58d21d(msgResponse(_0x1c90('0x225'),_0x1c90('0x4b'),'Ts\x20=\x20'+_0x2cd39b));}if(_0x5e3408<=0x0||isNaN(_0x5e3408)){return _0x58d21d(msgResponse(_0x1c90('0x225'),_0x1c90('0x4b'),_0x1c90('0x226')+_0x5e3408));}if(_0x368e8e<=0x0||isNaN(_0x368e8e)){return _0x58d21d(msgResponse(_0x1c90('0x225'),_0x1c90('0x4b'),_0x1c90('0x222')+_0x368e8e));}if(_0xa2b0e6<=0x0||isNaN(_0xa2b0e6)){return _0x58d21d(msgResponse(_0x1c90('0x225'),_0x1c90('0x4b'),_0x1c90('0x227')+_0xa2b0e6));}_0x523e4a=_0x523e4a||0x0;var _0x143f51=0x1/_0x2cd39b;var _0x3d584b=0x0;var _0x39a5a0=0x0;var _0x23f1bc=0x0;var _0x4566dd=0x0;for(var _0xe1c711=0x0;_0x4566dd<_0xa2b0e6;_0xe1c711+=0x1){_0x39a5a0=_0xe1c711/_0x368e8e;_0x3d584b=(_0x5e3408*_0x39a5a0+_0x523e4a)/_0x143f51;_0x23f1bc=erlangb(_0x3d584b,_0x24251f);_0x4566dd=_0x3d584b/_0x24251f*(0x1-erlangb(_0x3d584b,_0x24251f));}return _0x3d5e84({'erlangCalls':_0xe1c711,'erlangCallToSecond':_0x368e8e/_0xe1c711,'erlangAbandonmentRate':_0x23f1bc,'erlangBusyFactor':_0x4566dd});});};module[_0x1c90('0x228')]=Dialer;
\ No newline at end of file
index 003155c..6f515bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a25=['outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0x0a25,0x15f));var _0x50a2=function(_0x122e16,_0x2aee15){_0x122e16=_0x122e16-0x0;var _0x505165=_0x0a25[_0x122e16];return _0x505165;};'use strict';var util=require(_0x50a2('0x0'));var _=require(_0x50a2('0x1'));var moment=require(_0x50a2('0x2'));function getSeconds(_0x4e4338,_0x22e101){var _0x3abb58=moment(_0x4e4338)[_0x50a2('0x3')](0x0);var _0x2ab92f=moment(_0x22e101)[_0x50a2('0x3')](0x0);return _0x3abb58[_0x50a2('0x4')](_0x2ab92f,_0x50a2('0x5'));}function QueueCallerAbandon(_0x3f595f,_0x240a35){this['scheduledat']=_0x3f595f[_0x50a2('0x6')];this[_0x50a2('0x7')]=_0x3f595f[_0x50a2('0x7')];this[_0x50a2('0x8')]=_0x3f595f[_0x50a2('0x7')]===_0x50a2('0x9')?_0x50a2('0xa'):_0x3f595f[_0x50a2('0x7')];this[_0x50a2('0xb')]=_0x3f595f[_0x50a2('0xb')];this['countcongestionretry']=_0x3f595f[_0x50a2('0xc')];this[_0x50a2('0xd')]=_0x3f595f['countnoanswerretry'];this[_0x50a2('0xe')]=_0x3f595f['countbusyretry']+_0x3f595f[_0x50a2('0xc')]+_0x3f595f[_0x50a2('0xd')]+_0x3f595f[_0x50a2('0xf')]+_0x3f595f[_0x50a2('0x10')]+_0x3f595f[_0x50a2('0x11')]+_0x3f595f[_0x50a2('0x12')]+_0x3f595f[_0x50a2('0x13')];this[_0x50a2('0xf')]=_0x3f595f['countnosuchnumberretry'];this['countdropretry']=_0x3f595f[_0x50a2('0x10')];this[_0x50a2('0x11')]=_0x3f595f['countabandonedretry'];this[_0x50a2('0x12')]=_0x3f595f[_0x50a2('0x12')];this[_0x50a2('0x13')]=_0x3f595f[_0x50a2('0x13')];this[_0x50a2('0x14')]=_0x240a35[_0x50a2('0x14')];this['calleridname']=_0x3f595f[_0x50a2('0x15')];this[_0x50a2('0x16')]=_0x3f595f[_0x50a2('0x17')];this[_0x50a2('0x18')]=_0x3f595f[_0x50a2('0x18')];this[_0x50a2('0x19')]=_0x3f595f[_0x50a2('0x19')];this[_0x50a2('0x1a')]=_0x3f595f[_0x50a2('0x1a')];this[_0x50a2('0x1b')]=this[_0x50a2('0x1a')];this[_0x50a2('0x1c')]=getSeconds(_0x3f595f[_0x50a2('0x19')],_0x3f595f[_0x50a2('0x18')]);this[_0x50a2('0x1d')]=getSeconds(this[_0x50a2('0x1a')],_0x3f595f[_0x50a2('0x19')]);this[_0x50a2('0x1e')]=0x0;this[_0x50a2('0xa')]=_0x240a35[_0x50a2('0xa')];this['membername']=_0x240a35[_0x50a2('0x1f')];this[_0x50a2('0x20')]=_0x240a35[_0x50a2('0x20')];this[_0x50a2('0x21')]=_0x3f595f[_0x50a2('0x21')];this[_0x50a2('0x22')]=_0x3f595f[_0x50a2('0x22')];this[_0x50a2('0x23')]=_0x3f595f['callbackat'];this[_0x50a2('0x24')]=_0x3f595f[_0x50a2('0x24')];this[_0x50a2('0x25')]=_0x3f595f[_0x50a2('0x25')];this[_0x50a2('0x26')]=_0x3f595f['ListId'];this[_0x50a2('0x27')]=_0x3f595f[_0x50a2('0x27')];this[_0x50a2('0x28')]=_0x3f595f[_0x50a2('0x28')];this['CampaignId']=_0x3f595f[_0x50a2('0x29')];this[_0x50a2('0x2a')]=_0x3f595f['originatecalleridnum']||'';this['originatecalleridname']=_0x3f595f[_0x50a2('0x2b')]||'';}module[_0x50a2('0x2c')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x3cbd=['number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum'];(function(_0x518043,_0x33b06f){var _0x44e319=function(_0xec91ca){while(--_0xec91ca){_0x518043['push'](_0x518043['shift']());}};_0x44e319(++_0x33b06f);}(_0x3cbd,0x191));var _0xd3cb=function(_0x46da41,_0x3ae289){_0x46da41=_0x46da41-0x0;var _0x121015=_0x3cbd[_0x46da41];return _0x121015;};'use strict';var util=require(_0xd3cb('0x0'));var _=require(_0xd3cb('0x1'));var moment=require('moment');function getSeconds(_0x403215,_0xbabca9){var _0x35959d=moment(_0x403215)['milliseconds'](0x0);var _0x285e4f=moment(_0xbabca9)[_0xd3cb('0x2')](0x0);return _0x35959d[_0xd3cb('0x3')](_0x285e4f,'seconds');}function QueueCallerAbandon(_0x19a23e,_0xca8509){this[_0xd3cb('0x4')]=_0x19a23e['scheduledat'];this['type']=_0x19a23e[_0xd3cb('0x5')];this['campaigntype']=_0x19a23e['type']===_0xd3cb('0x6')?_0xd3cb('0x7'):_0x19a23e['type'];this[_0xd3cb('0x8')]=_0x19a23e[_0xd3cb('0x8')];this['countcongestionretry']=_0x19a23e[_0xd3cb('0x9')];this['countnoanswerretry']=_0x19a23e['countnoanswerretry'];this[_0xd3cb('0xa')]=_0x19a23e[_0xd3cb('0x8')]+_0x19a23e[_0xd3cb('0x9')]+_0x19a23e['countnoanswerretry']+_0x19a23e[_0xd3cb('0xb')]+_0x19a23e[_0xd3cb('0xc')]+_0x19a23e[_0xd3cb('0xd')]+_0x19a23e[_0xd3cb('0xe')]+_0x19a23e[_0xd3cb('0xf')];this[_0xd3cb('0xb')]=_0x19a23e['countnosuchnumberretry'];this['countdropretry']=_0x19a23e[_0xd3cb('0xc')];this[_0xd3cb('0xd')]=_0x19a23e[_0xd3cb('0xd')];this['countmachineretry']=_0x19a23e[_0xd3cb('0xe')];this[_0xd3cb('0xf')]=_0x19a23e[_0xd3cb('0xf')];this[_0xd3cb('0x10')]=_0xca8509[_0xd3cb('0x10')];this['calleridname']=_0x19a23e[_0xd3cb('0x11')];this[_0xd3cb('0x12')]=_0x19a23e[_0xd3cb('0x13')];this[_0xd3cb('0x14')]=_0x19a23e[_0xd3cb('0x14')];this[_0xd3cb('0x15')]=_0x19a23e[_0xd3cb('0x15')];this['droptime']=_0x19a23e[_0xd3cb('0x16')];this[_0xd3cb('0x17')]=this[_0xd3cb('0x16')];this[_0xd3cb('0x18')]=getSeconds(_0x19a23e['responsetime'],_0x19a23e[_0xd3cb('0x14')]);this[_0xd3cb('0x19')]=getSeconds(this[_0xd3cb('0x16')],_0x19a23e['responsetime']);this[_0xd3cb('0x1a')]=0x0;this['queue']=_0xca8509[_0xd3cb('0x7')];this[_0xd3cb('0x1b')]=_0xca8509[_0xd3cb('0x1c')];this[_0xd3cb('0x1d')]=_0xca8509[_0xd3cb('0x1d')];this[_0xd3cb('0x1e')]=_0x19a23e[_0xd3cb('0x1e')];this[_0xd3cb('0x1f')]=_0x19a23e['callbackuniqueid'];this['callbackat']=_0x19a23e[_0xd3cb('0x20')];this[_0xd3cb('0x21')]=_0x19a23e['recallme'];this[_0xd3cb('0x22')]=_0x19a23e[_0xd3cb('0x22')];this[_0xd3cb('0x23')]=_0x19a23e[_0xd3cb('0x23')];this[_0xd3cb('0x24')]=_0x19a23e['UserId'];this[_0xd3cb('0x25')]=_0x19a23e[_0xd3cb('0x25')];this['CampaignId']=_0x19a23e[_0xd3cb('0x26')];this[_0xd3cb('0x27')]=_0x19a23e[_0xd3cb('0x27')]||'';this[_0xd3cb('0x28')]=_0x19a23e[_0xd3cb('0x28')]||'';}module[_0xd3cb('0x29')]=QueueCallerAbandon;
\ No newline at end of file
index 1b2d893..0c2c95a 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(_0xa2fc0a,_0x56e8a3){var _0x42a57f=function(_0x341ca1){while(--_0x341ca1){_0xa2fc0a['push'](_0xa2fc0a['shift']());}};_0x42a57f(++_0x56e8a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x138a44,_0x17e197){var _0x503516=function(_0x30eb89){while(--_0x30eb89){_0x138a44['push'](_0x138a44['shift']());}};_0x503516(++_0x17e197);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 f34de79..c34b4f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2f8=['syncOriginateResponse','prototype','context','from-voip-provider','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncNewExten','hasOwnProperty','operation','status','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','filename','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','merge','pick','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','variablesAction','Action','ext','isTrunkReachable','active','isNil','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./action','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','originateresponse'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd2f8,0x152));var _0x8d2f=function(_0x2d0fc7,_0x273339){_0x2d0fc7=_0x2d0fc7-0x0;var _0xe84c0c=_0xd2f8[_0x2d0fc7];return _0xe84c0c;};'use strict';var util=require(_0x8d2f('0x0'));var _=require(_0x8d2f('0x1'));var BPromise=require('bluebird');var uuid=require(_0x8d2f('0x2'));var moment=require(_0x8d2f('0x3'));var path=require(_0x8d2f('0x4'));var tiff2pdf=require(_0x8d2f('0x5'));var gs=require(_0x8d2f('0x6'));var logger=require(_0x8d2f('0x7'))(_0x8d2f('0x8'));var ami=require('../ami');var rpcDb=require(_0x8d2f('0x9'));var Channel=require(_0x8d2f('0xa'));var ut=require('./util/util');var Action=require(_0x8d2f('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x8d2f('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x252b72){this[_0x8d2f('0xd')]={};this[_0x8d2f('0xe')]=_0x252b72['faxAccounts'];this[_0x8d2f('0xf')]=_0x252b72[_0x8d2f('0xf')];this[_0x8d2f('0x10')]={};ami['on'](_0x8d2f('0x11'),this[_0x8d2f('0x12')][_0x8d2f('0x13')](this));ami['on'](_0x8d2f('0x14'),this[_0x8d2f('0x15')][_0x8d2f('0x13')](this));ami['on'](_0x8d2f('0x16'),this[_0x8d2f('0x17')][_0x8d2f('0x13')](this));ami['on'](_0x8d2f('0x18'),this['syncNewExten'][_0x8d2f('0x13')](this));ami['on'](_0x8d2f('0x19'),this[_0x8d2f('0x1a')][_0x8d2f('0x13')](this));ami['on'](_0x8d2f('0x1b'),this[_0x8d2f('0x1c')][_0x8d2f('0x13')](this));ami['on']('hangup',this[_0x8d2f('0x1d')][_0x8d2f('0x13')](this));ami['on'](_0x8d2f('0x1e'),this[_0x8d2f('0x1f')][_0x8d2f('0x13')](this));}Fax[_0x8d2f('0x20')][_0x8d2f('0x12')]=function(_0x24cc9c){if(_0x24cc9c[_0x8d2f('0x21')]===_0x8d2f('0x22')){for(var _0x9801aa in this[_0x8d2f('0xe')]){if(this[_0x8d2f('0xe')]['hasOwnProperty'](_0x9801aa)){if(_0x24cc9c['exten']===this['faxAccounts'][_0x9801aa][_0x8d2f('0x23')]){this[_0x8d2f('0xd')][_0x24cc9c[_0x8d2f('0x24')]]={};this['channels'][_0x24cc9c[_0x8d2f('0x24')]][_0x8d2f('0x25')]=_0x24cc9c[_0x8d2f('0x25')];this[_0x8d2f('0xd')][_0x24cc9c[_0x8d2f('0x24')]]['id']=this[_0x8d2f('0xe')][_0x9801aa]['id'];this[_0x8d2f('0xd')][_0x24cc9c[_0x8d2f('0x24')]]['name']=this['faxAccounts'][_0x9801aa][_0x8d2f('0x26')];logger[_0x8d2f('0x27')](_0x24cc9c[_0x8d2f('0x24')],_0x8d2f('0x28'));}}}}if(this[_0x8d2f('0x10')][_0x24cc9c[_0x8d2f('0x24')]]){this[_0x8d2f('0xd')][_0x24cc9c['uniqueid']]={};this[_0x8d2f('0xd')][_0x24cc9c[_0x8d2f('0x24')]][_0x8d2f('0x25')]=_0x24cc9c[_0x8d2f('0x25')];logger[_0x8d2f('0x27')](_0x24cc9c['uniqueid'],_0x8d2f('0x28'));}};Fax['prototype'][_0x8d2f('0x15')]=function(_0x5e96ea){if(this[_0x8d2f('0xd')][_0x5e96ea[_0x8d2f('0x24')]]){for(var _0x2ea0a9 in _0x5e96ea[_0x8d2f('0x29')]){if(_0x5e96ea[_0x8d2f('0x29')]['hasOwnProperty'](_0x2ea0a9)){this[_0x8d2f('0xd')][_0x5e96ea['uniqueid']][_0x2ea0a9]=_0x5e96ea[_0x8d2f('0x2a')];}}}};Fax[_0x8d2f('0x20')][_0x8d2f('0x17')]=function(_0x5b291c){if(this[_0x8d2f('0xd')][_0x5b291c[_0x8d2f('0x24')]]){this[_0x8d2f('0xd')][_0x5b291c[_0x8d2f('0x24')]][_0x8d2f('0x2b')]=_0x5b291c[_0x8d2f('0x2b')];this[_0x8d2f('0xd')][_0x5b291c['uniqueid']][_0x8d2f('0x2c')]=_0x5b291c[_0x8d2f('0x2c')];}};Fax[_0x8d2f('0x20')][_0x8d2f('0x2d')]=function(_0x38a11d){if(this[_0x8d2f('0xd')][_0x38a11d[_0x8d2f('0x24')]]){for(var _0x495f88 in _0x38a11d[_0x8d2f('0x29')]){if(_0x38a11d[_0x8d2f('0x29')][_0x8d2f('0x2e')](_0x495f88)){this[_0x8d2f('0xd')][_0x38a11d[_0x8d2f('0x24')]][_0x495f88]=_0x38a11d[_0x8d2f('0x2a')];}}}};Fax[_0x8d2f('0x20')][_0x8d2f('0x1a')]=function(_0x5e588e){if(this[_0x8d2f('0xd')][_0x5e588e[_0x8d2f('0x24')]]){this['channels'][_0x5e588e[_0x8d2f('0x24')]]['operation']=_0x5e588e[_0x8d2f('0x2f')];this['channels'][_0x5e588e[_0x8d2f('0x24')]][_0x8d2f('0x30')]=_0x5e588e['status'];this['channels'][_0x5e588e[_0x8d2f('0x24')]][_0x8d2f('0x23')]=_0x5e588e['localstationid'];this[_0x8d2f('0xd')][_0x5e588e['uniqueid']]['filename']=_0x5e588e['filename'];logger['info'](_0x5e588e[_0x8d2f('0x24')],_0x8d2f('0x31'));}};Fax[_0x8d2f('0x20')][_0x8d2f('0x1c')]=function(_0x437ddc){var _0x3ee1e6=this;if(this[_0x8d2f('0xd')][_0x437ddc['uniqueid']]){var _0x35a798=this[_0x8d2f('0xd')][_0x437ddc[_0x8d2f('0x24')]]['id'];this['channels'][_0x437ddc[_0x8d2f('0x24')]][_0x8d2f('0x32')]=_0x437ddc[_0x8d2f('0x32')];this[_0x8d2f('0xd')][_0x437ddc[_0x8d2f('0x24')]][_0x8d2f('0x33')]=_0x437ddc[_0x8d2f('0x33')];this[_0x8d2f('0xd')][_0x437ddc['uniqueid']]['localstationid']=_0x437ddc[_0x8d2f('0x23')];this['channels'][_0x437ddc[_0x8d2f('0x24')]]['resolution']=_0x437ddc[_0x8d2f('0x34')];this['channels'][_0x437ddc[_0x8d2f('0x24')]][_0x8d2f('0x35')]=_0x437ddc[_0x8d2f('0x35')];this['channels'][_0x437ddc[_0x8d2f('0x24')]][_0x8d2f('0x36')]=_0x437ddc[_0x8d2f('0x36')];this['channels'][_0x437ddc['uniqueid']]['calleridnum']=_0x437ddc[_0x8d2f('0x37')];if(this[_0x8d2f('0xd')][_0x437ddc[_0x8d2f('0x24')]][_0x8d2f('0x33')]>0x0){tiff2pdf(_0x437ddc[_0x8d2f('0x36')],_0x8d2f('0x38'),function(_0x353a1b){logger['info'](_0x437ddc['uniqueid'],_0x8d2f('0x39'),_0x353a1b[_0x8d2f('0x3a')]);attachment[_0x8d2f('0x3b')]({'name':path[_0x8d2f('0x3c')](_0x437ddc[_0x8d2f('0x36')])[_0x8d2f('0x26')],'basename':path[_0x8d2f('0x3c')](_0x437ddc[_0x8d2f('0x36')])[_0x8d2f('0x26')]+_0x8d2f('0x3d'),'type':_0x8d2f('0x3e')})[_0x8d2f('0x3f')](function(_0x16c27c){faxAccount[_0x8d2f('0x40')](_0x35a798,{'from':_0x437ddc['calleridnum'],'mapKey':_0x8d2f('0x8'),'body':path[_0x8d2f('0x3c')](_0x437ddc[_0x8d2f('0x36')])[_0x8d2f('0x26')]+_0x8d2f('0x3d'),'AttachmentId':_0x16c27c['id']})['catch'](function(_0x472fcd){logger[_0x8d2f('0x41')](_0x437ddc[_0x8d2f('0x24')],_0x8d2f('0x42'),JSON[_0x8d2f('0x43')](_0x472fcd));});})[_0x8d2f('0x44')](function(_0x1b722c){logger[_0x8d2f('0x41')](_0x437ddc[_0x8d2f('0x24')],'\x20receiveFax\x20',JSON[_0x8d2f('0x43')](_0x1b722c));});});}logger[_0x8d2f('0x27')](_0x437ddc[_0x8d2f('0x24')],_0x8d2f('0x45'));}};Fax[_0x8d2f('0x20')][_0x8d2f('0x1f')]=function(_0x576469){if(this[_0x8d2f('0x10')][_0x576469['uniqueid']]){_[_0x8d2f('0x46')](this[_0x8d2f('0xd')][_0x576469['uniqueid']],_[_0x8d2f('0x47')](_0x576469,['response',_0x8d2f('0x48')]));}};function updateStatus(_0x434102){if(_0x434102[_0x8d2f('0x49')]){faxMessage['update'](_0x434102[_0x8d2f('0x49')],{'failMessage':_0x8d2f('0x4a')})[_0x8d2f('0x3f')](function(_0x122b21){ut[_0x8d2f('0x4b')](_0x8d2f('0x4c'),_0x122b21);})[_0x8d2f('0x44')](function(_0x36e2d9){ut['logger'](_0x8d2f('0x4d'),_0x36e2d9);});}else{ut['logger'](_0x8d2f('0x4e'));}}Fax[_0x8d2f('0x20')]['updateStatus']=function(_0x479605,_0xbd3b13,_0xd570af){var _0x55428a=this;var _0x5cf18={};if(_0xbd3b13){_0x5cf18={'read':_0xbd3b13};}else{_0x5cf18={'failMessage':_0xd570af};}if(this[_0x8d2f('0x10')][_0x479605][_0x8d2f('0x49')]){faxMessage[_0x8d2f('0x4f')](this[_0x8d2f('0x10')][_0x479605][_0x8d2f('0x49')],_0x5cf18)[_0x8d2f('0x3f')](function(_0x1d9381){ut[_0x8d2f('0x4b')](_0x8d2f('0x50'),_0x1d9381);})[_0x8d2f('0x44')](function(_0x12f88e){ut['logger'](_0x8d2f('0x51'),_0x12f88e);})[_0x8d2f('0x52')](function(){delete _0x55428a[_0x8d2f('0xd')][_0x479605];delete _0x55428a[_0x8d2f('0x10')][_0x479605];});}else{ut['logger'](_0x8d2f('0x53'));delete this['channels'][_0x479605];delete this[_0x8d2f('0x10')][_0x479605];}};Fax[_0x8d2f('0x20')][_0x8d2f('0x1d')]=function(_0x1d2a84){var _0x197157=this;if(this[_0x8d2f('0xd')][_0x1d2a84[_0x8d2f('0x24')]]){if(this[_0x8d2f('0x10')][_0x1d2a84[_0x8d2f('0x24')]]){this[_0x8d2f('0xd')][_0x1d2a84[_0x8d2f('0x24')]]['id']=this['actions'][_0x1d2a84['uniqueid']]['id'];this[_0x8d2f('0xd')][_0x1d2a84['uniqueid']]['name']=this[_0x8d2f('0x10')][_0x1d2a84[_0x8d2f('0x24')]][_0x8d2f('0x26')];}logger['info'](_0x1d2a84[_0x8d2f('0x24')],this[_0x8d2f('0x10')][_0x1d2a84[_0x8d2f('0x24')]]?_0x8d2f('0x54'):_0x8d2f('0x55'),JSON[_0x8d2f('0x43')](this[_0x8d2f('0xd')][_0x1d2a84[_0x8d2f('0x24')]]));if(this['actions'][_0x1d2a84[_0x8d2f('0x24')]]){if(this[_0x8d2f('0xd')][_0x1d2a84['uniqueid']][_0x8d2f('0x56')]>0x0&&this[_0x8d2f('0xd')][_0x1d2a84[_0x8d2f('0x24')]]['faxstatus']===_0x8d2f('0x57')){this[_0x8d2f('0x58')](_0x1d2a84[_0x8d2f('0x24')],!![]);}else{this[_0x8d2f('0x58')](_0x1d2a84[_0x8d2f('0x24')],![],this[_0x8d2f('0xd')][_0x1d2a84[_0x8d2f('0x24')]][_0x8d2f('0x59')]?'SENDING\x20FAILED:\x20'+this[_0x8d2f('0xd')][_0x1d2a84[_0x8d2f('0x24')]]['faxstatusstring']:_0x8d2f('0x5a'));}}}};Fax[_0x8d2f('0x20')][_0x8d2f('0x5b')]=function(_0x75580c){var _0x50c5c8=this;return new BPromise(function(_0x157d4e,_0x1b1c89){_0x50c5c8[_0x8d2f('0x5c')](_0x75580c,_0x50c5c8[_0x8d2f('0xe')][_0x75580c[_0x8d2f('0x5d')]])[_0x8d2f('0x3f')](function(_0x332d71){ut['logger'](_0x8d2f('0x5e'),_0x332d71);_0x157d4e(ut[_0x8d2f('0x3a')](_0x8d2f('0x5f')));})[_0x8d2f('0x44')](function(_0x2e2f6f){ut[_0x8d2f('0x4b')](_0x8d2f('0x60'),_0x2e2f6f);updateStatus(_0x75580c);_0x1b1c89(ut['message'](_0x8d2f('0x61')));});});};Fax['prototype'][_0x8d2f('0x62')]=function(_0x33676c){var _0x45c2e1=this;return new BPromise(function(_0x728478,_0x40491b){var _0x441dcb=_0x45c2e1[_0x8d2f('0x63')](_0x45c2e1[_0x8d2f('0xe')][_0x33676c[_0x8d2f('0x5d')]]['Trunk'],_0x33676c);if(_0x441dcb['isValid']){_0x728478(ut[_0x8d2f('0x3a')](_0x8d2f('0x64')));}else{_0x40491b(ut[_0x8d2f('0x3a')](_0x441dcb[_0x8d2f('0x3a')]));}});};function originate(_0x1ebc69,_0xbc8ef1,_0x807bea){return new BPromise(function(_0x25850c,_0x26bbcb){if(_0x807bea){var _0x2597d2=util[_0x8d2f('0x65')](_0x8d2f('0x66'),path['parse'](_0x1ebc69[_0x8d2f('0x4')])[_0x8d2f('0x26')],_0x1ebc69[_0x8d2f('0x4')]);gs[_0x8d2f('0x67')](_0x2597d2)[_0x8d2f('0x3f')](function(){_0x1ebc69[_0x8d2f('0x4')]=util[_0x8d2f('0x65')](_0x8d2f('0x68'),path[_0x8d2f('0x3c')](_0x1ebc69['path'])[_0x8d2f('0x69')],path[_0x8d2f('0x3c')](_0x1ebc69[_0x8d2f('0x4')])[_0x8d2f('0x26')]);_0xbc8ef1['XMF-PATH']=_0x1ebc69['path'];ut['logger'](_0x8d2f('0x6a'),'');ami['Action'](ut[_0x8d2f('0x6b')](_0x1ebc69,_0xbc8ef1))['then'](function(_0x3a5011){_0x25850c(_0x3a5011);})[_0x8d2f('0x44')](function(_0x4b7335){_0x26bbcb(_0x4b7335);});})[_0x8d2f('0x44')](function(_0x4589d8){_0x26bbcb(_0x4589d8);});}else{ami[_0x8d2f('0x6c')](ut[_0x8d2f('0x6b')](_0x1ebc69,_0xbc8ef1))[_0x8d2f('0x3f')](function(_0x2bd46){_0x25850c(_0x2bd46);})[_0x8d2f('0x44')](function(_0x2a0707){_0x26bbcb(_0x2a0707);});}});}Fax['prototype'][_0x8d2f('0x5c')]=function(_0x11084f,_0x2e6e1e){var _0xbe05=this;return new BPromise(function(_0x49802b,_0x4087ba){var _0x1c7315=uuid['v4']();var _0x3e2ccd=ut['addVariables'](_0x11084f,_0x2e6e1e);_0xbe05[_0x8d2f('0x10')][_0x1c7315]=new Action(_0x1c7315,_0x2e6e1e,_0x11084f);var _0x5895a6=_0xbe05['actions'][_0x1c7315];if(path['parse'](_0x11084f[_0x8d2f('0x4')])[_0x8d2f('0x6d')]===_0x8d2f('0x3d')){originate(_0x5895a6,_0x3e2ccd,!![])[_0x8d2f('0x3f')](function(_0x5fee9f){_0x49802b(_0x5fee9f);})[_0x8d2f('0x44')](function(_0x3be553){_0x4087ba(_0x3be553);});}else{originate(_0x5895a6,_0x3e2ccd,![])[_0x8d2f('0x3f')](function(_0x2ed64f){_0x49802b(_0x2ed64f);})[_0x8d2f('0x44')](function(_0x1fc565){_0x4087ba(_0x1fc565);});}});};Fax[_0x8d2f('0x20')][_0x8d2f('0x6e')]=function(_0x3f9db8){return!_['isNil'](_0x3f9db8)&&!_['isNil'](_0x3f9db8[_0x8d2f('0x26')])&&!_['isNil'](_0x3f9db8[_0x8d2f('0x6f')])&&_0x3f9db8[_0x8d2f('0x6f')]&&!_[_0x8d2f('0x70')](this[_0x8d2f('0xf')][util[_0x8d2f('0x65')](_0x8d2f('0x71'),_0x3f9db8[_0x8d2f('0x26')])])&&!_[_0x8d2f('0x70')](this['trunks'][util['format'](_0x8d2f('0x71'),_0x3f9db8[_0x8d2f('0x26')])][_0x8d2f('0x30')])&&(this['trunks'][util[_0x8d2f('0x65')](_0x8d2f('0x71'),_0x3f9db8[_0x8d2f('0x26')])][_0x8d2f('0x30')]==='reachable'||this['trunks'][util[_0x8d2f('0x65')]('SIP/%s',_0x3f9db8[_0x8d2f('0x26')])][_0x8d2f('0x30')]===_0x8d2f('0x72'));};Fax[_0x8d2f('0x20')][_0x8d2f('0x63')]=function(_0x1eef92,_0x193be4){if(!this[_0x8d2f('0x6e')](_0x1eef92)){ut[_0x8d2f('0x4b')](_0x8d2f('0x73'),_[_0x8d2f('0x70')](_0x1eef92)?'':_0x1eef92[_0x8d2f('0x26')]+_0x8d2f('0x74'));return{'isValid':![],'message':_0x8d2f('0x75')};}if(_['isNil'](_0x193be4['fax'])){ut[_0x8d2f('0x4b')](_0x8d2f('0x76'),JSON[_0x8d2f('0x43')](_0x193be4));return{'isValid':![],'message':_0x8d2f('0x77')};}if(_[_0x8d2f('0x70')](_0x193be4[_0x8d2f('0x4')])){ut[_0x8d2f('0x4b')](_0x8d2f('0x78'),JSON[_0x8d2f('0x43')](_0x193be4));return{'isValid':![],'message':_0x8d2f('0x79')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x8d2f('0x7a')]=Fax;
\ No newline at end of file
+var _0xdb71=['Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','execute','%s/%s.tif','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','syncVarSet','syncNewState','bind','newexten','syncNewExten','faxstatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','localstationid','channel','uniqueid','name','info','\x20syncNewchannel\x20','channelstate','channelstatedesc','variable','value','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','then','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','updateStatus','faxstatusstring','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]'];(function(_0x37ee78,_0x93dfdf){var _0x4a1022=function(_0x798969){while(--_0x798969){_0x37ee78['push'](_0x37ee78['shift']());}};_0x4a1022(++_0x93dfdf);}(_0xdb71,0x1e0));var _0x1db7=function(_0x2b3db1,_0x505a1f){_0x2b3db1=_0x2b3db1-0x0;var _0x5b8e64=_0xdb71[_0x2b3db1];return _0x5b8e64;};'use strict';var util=require(_0x1db7('0x0'));var _=require(_0x1db7('0x1'));var BPromise=require(_0x1db7('0x2'));var uuid=require(_0x1db7('0x3'));var moment=require(_0x1db7('0x4'));var path=require(_0x1db7('0x5'));var tiff2pdf=require(_0x1db7('0x6'));var gs=require(_0x1db7('0x7'));var logger=require('../../../config/logger')('fax');var ami=require('../ami');var rpcDb=require(_0x1db7('0x8'));var Channel=require(_0x1db7('0x9'));var ut=require(_0x1db7('0xa'));var Action=require(_0x1db7('0xb'));var faxAccount=require(_0x1db7('0xc'));var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x158971){this[_0x1db7('0xd')]={};this[_0x1db7('0xe')]=_0x158971[_0x1db7('0xe')];this[_0x1db7('0xf')]=_0x158971['trunks'];this[_0x1db7('0x10')]={};ami['on'](_0x1db7('0x11'),this[_0x1db7('0x12')]['bind'](this));ami['on']('varset',this[_0x1db7('0x13')]['bind'](this));ami['on']('newstate',this[_0x1db7('0x14')][_0x1db7('0x15')](this));ami['on'](_0x1db7('0x16'),this[_0x1db7('0x17')][_0x1db7('0x15')](this));ami['on'](_0x1db7('0x18'),this['syncFaxStatus'][_0x1db7('0x15')](this));ami['on'](_0x1db7('0x19'),this[_0x1db7('0x1a')][_0x1db7('0x15')](this));ami['on'](_0x1db7('0x1b'),this[_0x1db7('0x1c')]['bind'](this));ami['on'](_0x1db7('0x1d'),this[_0x1db7('0x1e')]['bind'](this));}Fax[_0x1db7('0x1f')]['syncNewchannel']=function(_0x2dd1b3){if(_0x2dd1b3[_0x1db7('0x20')]==='from-voip-provider'){for(var _0x93ed03 in this['faxAccounts']){if(this[_0x1db7('0xe')][_0x1db7('0x21')](_0x93ed03)){if(_0x2dd1b3[_0x1db7('0x22')]===this[_0x1db7('0xe')][_0x93ed03][_0x1db7('0x23')]){this[_0x1db7('0xd')][_0x2dd1b3['uniqueid']]={};this[_0x1db7('0xd')][_0x2dd1b3['uniqueid']][_0x1db7('0x24')]=_0x2dd1b3[_0x1db7('0x24')];this['channels'][_0x2dd1b3[_0x1db7('0x25')]]['id']=this[_0x1db7('0xe')][_0x93ed03]['id'];this[_0x1db7('0xd')][_0x2dd1b3[_0x1db7('0x25')]][_0x1db7('0x26')]=this[_0x1db7('0xe')][_0x93ed03][_0x1db7('0x26')];logger[_0x1db7('0x27')](_0x2dd1b3[_0x1db7('0x25')],_0x1db7('0x28'));}}}}if(this['actions'][_0x2dd1b3['uniqueid']]){this[_0x1db7('0xd')][_0x2dd1b3[_0x1db7('0x25')]]={};this['channels'][_0x2dd1b3[_0x1db7('0x25')]][_0x1db7('0x24')]=_0x2dd1b3[_0x1db7('0x24')];logger[_0x1db7('0x27')](_0x2dd1b3[_0x1db7('0x25')],_0x1db7('0x28'));}};Fax[_0x1db7('0x1f')][_0x1db7('0x13')]=function(_0x2ac157){if(this[_0x1db7('0xd')][_0x2ac157['uniqueid']]){for(var _0x3b2e93 in _0x2ac157['variable']){if(_0x2ac157['variable'][_0x1db7('0x21')](_0x3b2e93)){this['channels'][_0x2ac157[_0x1db7('0x25')]][_0x3b2e93]=_0x2ac157['value'];}}}};Fax[_0x1db7('0x1f')][_0x1db7('0x14')]=function(_0x38c562){if(this[_0x1db7('0xd')][_0x38c562[_0x1db7('0x25')]]){this[_0x1db7('0xd')][_0x38c562[_0x1db7('0x25')]][_0x1db7('0x29')]=_0x38c562[_0x1db7('0x29')];this['channels'][_0x38c562[_0x1db7('0x25')]][_0x1db7('0x2a')]=_0x38c562[_0x1db7('0x2a')];}};Fax[_0x1db7('0x1f')]['syncNewExten']=function(_0x3d3aca){if(this[_0x1db7('0xd')][_0x3d3aca[_0x1db7('0x25')]]){for(var _0x2955e0 in _0x3d3aca['variable']){if(_0x3d3aca[_0x1db7('0x2b')]['hasOwnProperty'](_0x2955e0)){this[_0x1db7('0xd')][_0x3d3aca[_0x1db7('0x25')]][_0x2955e0]=_0x3d3aca[_0x1db7('0x2c')];}}}};Fax[_0x1db7('0x1f')]['syncFaxStatus']=function(_0x4aca71){if(this[_0x1db7('0xd')][_0x4aca71[_0x1db7('0x25')]]){this[_0x1db7('0xd')][_0x4aca71[_0x1db7('0x25')]][_0x1db7('0x2d')]=_0x4aca71[_0x1db7('0x2d')];this[_0x1db7('0xd')][_0x4aca71[_0x1db7('0x25')]][_0x1db7('0x2e')]=_0x4aca71['status'];this['channels'][_0x4aca71[_0x1db7('0x25')]][_0x1db7('0x23')]=_0x4aca71[_0x1db7('0x23')];this['channels'][_0x4aca71[_0x1db7('0x25')]][_0x1db7('0x2f')]=_0x4aca71[_0x1db7('0x2f')];logger[_0x1db7('0x27')](_0x4aca71[_0x1db7('0x25')],'\x20syncFaxStatus\x20');}};Fax['prototype'][_0x1db7('0x1a')]=function(_0x599192){var _0x2b2748=this;if(this['channels'][_0x599192[_0x1db7('0x25')]]){var _0x4771d3=this[_0x1db7('0xd')][_0x599192[_0x1db7('0x25')]]['id'];this[_0x1db7('0xd')][_0x599192[_0x1db7('0x25')]][_0x1db7('0x30')]=_0x599192['remotestationid'];this[_0x1db7('0xd')][_0x599192[_0x1db7('0x25')]][_0x1db7('0x31')]=_0x599192[_0x1db7('0x31')];this[_0x1db7('0xd')][_0x599192[_0x1db7('0x25')]][_0x1db7('0x23')]=_0x599192['localstationid'];this['channels'][_0x599192[_0x1db7('0x25')]][_0x1db7('0x32')]=_0x599192[_0x1db7('0x32')];this['channels'][_0x599192[_0x1db7('0x25')]][_0x1db7('0x33')]=_0x599192[_0x1db7('0x33')];this[_0x1db7('0xd')][_0x599192[_0x1db7('0x25')]]['filename']=_0x599192[_0x1db7('0x2f')];this[_0x1db7('0xd')][_0x599192[_0x1db7('0x25')]][_0x1db7('0x34')]=_0x599192['calleridnum'];if(this[_0x1db7('0xd')][_0x599192['uniqueid']][_0x1db7('0x31')]>0x0){tiff2pdf(_0x599192[_0x1db7('0x2f')],_0x1db7('0x35'),function(_0xa43b4c){logger[_0x1db7('0x27')](_0x599192[_0x1db7('0x25')],_0x1db7('0x36'),_0xa43b4c[_0x1db7('0x37')]);attachment['create']({'name':path['parse'](_0x599192[_0x1db7('0x2f')])[_0x1db7('0x26')],'basename':path[_0x1db7('0x38')](_0x599192[_0x1db7('0x2f')])['name']+_0x1db7('0x39'),'type':'application/pdf'})[_0x1db7('0x3a')](function(_0x4c5c83){faxAccount[_0x1db7('0x3b')](_0x4771d3,{'from':_0x599192['calleridnum'],'mapKey':_0x1db7('0x3c'),'body':path['parse'](_0x599192[_0x1db7('0x2f')])[_0x1db7('0x26')]+_0x1db7('0x39'),'AttachmentId':_0x4c5c83['id']})[_0x1db7('0x3d')](function(_0x155e1c){logger[_0x1db7('0x3e')](_0x599192[_0x1db7('0x25')],_0x1db7('0x3f'),JSON[_0x1db7('0x40')](_0x155e1c));});})['catch'](function(_0x17ea29){logger[_0x1db7('0x3e')](_0x599192[_0x1db7('0x25')],_0x1db7('0x41'),JSON[_0x1db7('0x40')](_0x17ea29));});});}logger[_0x1db7('0x27')](_0x599192[_0x1db7('0x25')],'\x20receiveFax\x20');}};Fax[_0x1db7('0x1f')][_0x1db7('0x1e')]=function(_0x4e39a5){if(this[_0x1db7('0x10')][_0x4e39a5[_0x1db7('0x25')]]){_[_0x1db7('0x42')](this[_0x1db7('0xd')][_0x4e39a5[_0x1db7('0x25')]],_['pick'](_0x4e39a5,['response',_0x1db7('0x43')]));}};function updateStatus(_0x1f978c){if(_0x1f978c[_0x1db7('0x44')]){faxMessage[_0x1db7('0x45')](_0x1f978c['AttachmentId'],{'failMessage':_0x1db7('0x46')})['then'](function(_0x2398a6){ut[_0x1db7('0x47')]('[Fax][Message][Error][Updated]',_0x2398a6);})[_0x1db7('0x3d')](function(_0x31f7d7){ut[_0x1db7('0x47')](_0x1db7('0x48'),_0x31f7d7);});}else{ut['logger'](_0x1db7('0x49'));}}Fax[_0x1db7('0x1f')]['updateStatus']=function(_0x39f807,_0x46e702,_0x2cfffe){var _0x4cb02f=this;var _0x111a44={};if(_0x46e702){_0x111a44={'read':_0x46e702};}else{_0x111a44={'failMessage':_0x2cfffe};}if(this[_0x1db7('0x10')][_0x39f807]['AttachmentId']){faxMessage[_0x1db7('0x45')](this[_0x1db7('0x10')][_0x39f807]['AttachmentId'],_0x111a44)[_0x1db7('0x3a')](function(_0x4f7f95){ut[_0x1db7('0x47')](_0x1db7('0x4a'),_0x4f7f95);})['catch'](function(_0x3336f7){ut[_0x1db7('0x47')]('[Fax][Message][NoUpdate1]',_0x3336f7);})['finally'](function(){delete _0x4cb02f['channels'][_0x39f807];delete _0x4cb02f[_0x1db7('0x10')][_0x39f807];});}else{ut[_0x1db7('0x47')](_0x1db7('0x4b'));delete this['channels'][_0x39f807];delete this[_0x1db7('0x10')][_0x39f807];}};Fax[_0x1db7('0x1f')]['syncHangup']=function(_0x2693d1){var _0x5f5753=this;if(this['channels'][_0x2693d1[_0x1db7('0x25')]]){if(this[_0x1db7('0x10')][_0x2693d1[_0x1db7('0x25')]]){this['channels'][_0x2693d1[_0x1db7('0x25')]]['id']=this[_0x1db7('0x10')][_0x2693d1[_0x1db7('0x25')]]['id'];this[_0x1db7('0xd')][_0x2693d1['uniqueid']][_0x1db7('0x26')]=this[_0x1db7('0x10')][_0x2693d1[_0x1db7('0x25')]][_0x1db7('0x26')];}logger['info'](_0x2693d1[_0x1db7('0x25')],this[_0x1db7('0x10')][_0x2693d1[_0x1db7('0x25')]]?_0x1db7('0x4c'):_0x1db7('0x4d'),JSON[_0x1db7('0x40')](this[_0x1db7('0xd')][_0x2693d1[_0x1db7('0x25')]]));if(this[_0x1db7('0x10')][_0x2693d1[_0x1db7('0x25')]]){if(this[_0x1db7('0xd')][_0x2693d1[_0x1db7('0x25')]][_0x1db7('0x4e')]>0x0&&this[_0x1db7('0xd')][_0x2693d1[_0x1db7('0x25')]][_0x1db7('0x18')]==='SUCCESS'){this[_0x1db7('0x4f')](_0x2693d1[_0x1db7('0x25')],!![]);}else{this[_0x1db7('0x4f')](_0x2693d1['uniqueid'],![],this[_0x1db7('0xd')][_0x2693d1[_0x1db7('0x25')]][_0x1db7('0x50')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x2693d1['uniqueid']][_0x1db7('0x50')]:_0x1db7('0x51'));}}}};Fax['prototype'][_0x1db7('0x52')]=function(_0x2b8e12){var _0x23768f=this;return new BPromise(function(_0x2e24cb,_0x26ea09){_0x23768f[_0x1db7('0x53')](_0x2b8e12,_0x23768f['faxAccounts'][_0x2b8e12['FaxAccountId']])['then'](function(_0x1f954a){ut[_0x1db7('0x47')](_0x1db7('0x54'),_0x1f954a);_0x2e24cb(ut['message'](_0x1db7('0x55')));})[_0x1db7('0x3d')](function(_0x19c955){ut[_0x1db7('0x47')]('[Fax][execOriginate][failure]',_0x19c955);updateStatus(_0x2b8e12);_0x26ea09(ut[_0x1db7('0x37')](_0x1db7('0x56')));});});};Fax[_0x1db7('0x1f')][_0x1db7('0x57')]=function(_0x23461b){var _0x4a7bab=this;return new BPromise(function(_0x4f16c0,_0x10c1ce){var _0x1863e0=_0x4a7bab[_0x1db7('0x58')](_0x4a7bab[_0x1db7('0xe')][_0x23461b[_0x1db7('0x59')]][_0x1db7('0x5a')],_0x23461b);if(_0x1863e0[_0x1db7('0x5b')]){_0x4f16c0(ut[_0x1db7('0x37')](_0x1db7('0x5c')));}else{_0x10c1ce(ut[_0x1db7('0x37')](_0x1863e0[_0x1db7('0x37')]));}});};function originate(_0x51ee35,_0xd02642,_0x39d037){return new BPromise(function(_0xf3f91c,_0x130e38){if(_0x39d037){var _0x2fc785=util[_0x1db7('0x5d')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x1db7('0x38')](_0x51ee35[_0x1db7('0x5')])['name'],_0x51ee35['path']);gs[_0x1db7('0x5e')](_0x2fc785)[_0x1db7('0x3a')](function(){_0x51ee35[_0x1db7('0x5')]=util[_0x1db7('0x5d')](_0x1db7('0x5f'),path[_0x1db7('0x38')](_0x51ee35[_0x1db7('0x5')])['dir'],path[_0x1db7('0x38')](_0x51ee35[_0x1db7('0x5')])[_0x1db7('0x26')]);_0xd02642['XMF-PATH']=_0x51ee35['path'];ut[_0x1db7('0x47')](_0x1db7('0x60'),'');ami[_0x1db7('0x61')](ut[_0x1db7('0x62')](_0x51ee35,_0xd02642))[_0x1db7('0x3a')](function(_0x12e018){_0xf3f91c(_0x12e018);})[_0x1db7('0x3d')](function(_0x26849c){_0x130e38(_0x26849c);});})[_0x1db7('0x3d')](function(_0x271e1e){_0x130e38(_0x271e1e);});}else{ami[_0x1db7('0x61')](ut['variablesAction'](_0x51ee35,_0xd02642))[_0x1db7('0x3a')](function(_0x448884){_0xf3f91c(_0x448884);})['catch'](function(_0x200cb4){_0x130e38(_0x200cb4);});}});}Fax[_0x1db7('0x1f')][_0x1db7('0x53')]=function(_0x587e88,_0x4bac57){var _0x3d8767=this;return new BPromise(function(_0x143ba9,_0x10839f){var _0x35cd07=uuid['v4']();var _0x348e7a=ut[_0x1db7('0x63')](_0x587e88,_0x4bac57);_0x3d8767[_0x1db7('0x10')][_0x35cd07]=new Action(_0x35cd07,_0x4bac57,_0x587e88);var _0x3c5372=_0x3d8767['actions'][_0x35cd07];if(path[_0x1db7('0x38')](_0x587e88[_0x1db7('0x5')])['ext']===_0x1db7('0x39')){originate(_0x3c5372,_0x348e7a,!![])['then'](function(_0x138970){_0x143ba9(_0x138970);})[_0x1db7('0x3d')](function(_0x594907){_0x10839f(_0x594907);});}else{originate(_0x3c5372,_0x348e7a,![])[_0x1db7('0x3a')](function(_0x16375a){_0x143ba9(_0x16375a);})[_0x1db7('0x3d')](function(_0x307dac){_0x10839f(_0x307dac);});}});};Fax[_0x1db7('0x1f')]['isTrunkReachable']=function(_0x3c9018){return!_[_0x1db7('0x64')](_0x3c9018)&&!_[_0x1db7('0x64')](_0x3c9018[_0x1db7('0x26')])&&!_[_0x1db7('0x64')](_0x3c9018[_0x1db7('0x65')])&&_0x3c9018[_0x1db7('0x65')]&&!_['isNil'](this[_0x1db7('0xf')][util[_0x1db7('0x5d')](_0x1db7('0x66'),_0x3c9018[_0x1db7('0x26')])])&&!_[_0x1db7('0x64')](this['trunks'][util[_0x1db7('0x5d')]('SIP/%s',_0x3c9018[_0x1db7('0x26')])][_0x1db7('0x2e')])&&(this[_0x1db7('0xf')][util[_0x1db7('0x5d')](_0x1db7('0x66'),_0x3c9018[_0x1db7('0x26')])]['status']===_0x1db7('0x67')||this[_0x1db7('0xf')][util['format'](_0x1db7('0x66'),_0x3c9018[_0x1db7('0x26')])][_0x1db7('0x2e')]===_0x1db7('0x68'));};Fax[_0x1db7('0x1f')]['checkTrunk']=function(_0xe1baf3,_0x35ae02){if(!this[_0x1db7('0x69')](_0xe1baf3)){ut[_0x1db7('0x47')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x1db7('0x64')](_0xe1baf3)?'':_0xe1baf3[_0x1db7('0x26')]+_0x1db7('0x6a'));return{'isValid':![],'message':_0x1db7('0x6b')};}if(_[_0x1db7('0x64')](_0x35ae02[_0x1db7('0x3c')])){ut[_0x1db7('0x47')](_0x1db7('0x6c'),JSON[_0x1db7('0x40')](_0x35ae02));return{'isValid':![],'message':_0x1db7('0x6d')};}if(_['isNil'](_0x35ae02[_0x1db7('0x5')])){ut[_0x1db7('0x47')](_0x1db7('0x6e'),JSON[_0x1db7('0x40')](_0x35ae02));return{'isValid':![],'message':_0x1db7('0x6f')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x1db7('0x70')]=Fax;
\ No newline at end of file
index 25c1aa0..d0ba62c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1454=['then','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','../rpc/faxAccount','error','inspect','resolve'];(function(_0x2b4643,_0x5a04fb){var _0x275808=function(_0x3e73be){while(--_0x3e73be){_0x2b4643['push'](_0x2b4643['shift']());}};_0x275808(++_0x5a04fb);}(_0x1454,0xdf));var _0x4145=function(_0x59b834,_0x44e12f){_0x59b834=_0x59b834-0x0;var _0x75108e=_0x1454[_0x59b834];return _0x75108e;};'use strict';var util=require(_0x4145('0x0'));var BPromise=require(_0x4145('0x1'));var logger=require(_0x4145('0x2'))(_0x4145('0x3'));var _=require('lodash');var faxAccount=require(_0x4145('0x4'));function loggerCatch(_0x671dc7){return function(_0x41d65d){logger[_0x4145('0x5')](_0x671dc7,util[_0x4145('0x6')](_0x41d65d,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x39375f,_0x3f3782){return BPromise[_0x4145('0x7')]()[_0x4145('0x8')](faxAccount['notify'](_0x39375f,_0x3f3782))[_0x4145('0x9')](loggerCatch(_0x4145('0xa')));};
\ No newline at end of file
+var _0x1ee6=['inspect','notify','resolve','then','catch','[Notify]\x20','util','bluebird','../../../config/logger','../rpc/faxAccount','error'];(function(_0x1a68dd,_0x168fdd){var _0x564bc7=function(_0x36b497){while(--_0x36b497){_0x1a68dd['push'](_0x1a68dd['shift']());}};_0x564bc7(++_0x168fdd);}(_0x1ee6,0x192));var _0x61ee=function(_0x4c5f91,_0x21b12a){_0x4c5f91=_0x4c5f91-0x0;var _0x34fea5=_0x1ee6[_0x4c5f91];return _0x34fea5;};'use strict';var util=require(_0x61ee('0x0'));var BPromise=require(_0x61ee('0x1'));var logger=require(_0x61ee('0x2'))('preview');var _=require('lodash');var faxAccount=require(_0x61ee('0x3'));function loggerCatch(_0x1065fd){return function(_0x1319be){logger[_0x61ee('0x4')](_0x1065fd,util[_0x61ee('0x5')](_0x1319be,{'showHidden':![],'depth':null}));};}exports[_0x61ee('0x6')]=function(_0x4925c7,_0x1067d6){return BPromise[_0x61ee('0x7')]()[_0x61ee('0x8')](faxAccount[_0x61ee('0x6')](_0x4925c7,_0x1067d6))[_0x61ee('0x9')](loggerCatch(_0x61ee('0xa')));};
\ No newline at end of file
index 4ddc6ee..8e7ebac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9909=['child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','fax'];(function(_0x410e36,_0x3f4d26){var _0x2cbffc=function(_0x2c831f){while(--_0x2c831f){_0x410e36['push'](_0x410e36['shift']());}};_0x2cbffc(++_0x3f4d26);}(_0x9909,0x1a4));var _0x9990=function(_0x1b9feb,_0x2751d3){_0x1b9feb=_0x1b9feb-0x0;var _0x3746fc=_0x9909[_0x1b9feb];return _0x3746fc;};'use strict';var util=require(_0x9990('0x0'));var logger=require(_0x9990('0x1'))(_0x9990('0x2'));var BPromise=require('bluebird');var exec=require(_0x9990('0x3'))[_0x9990('0x4')];exports[_0x9990('0x5')]=function(_0x1107c){return new BPromise(function(_0x4959fc,_0x3daaf6){exec(_0x1107c,function(_0x1bea89,_0x312594,_0xc450c){logger[_0x9990('0x6')](_0x9990('0x7'),_0x312594);if(_0x1bea89){logger[_0x9990('0x6')](_0x9990('0x7'),_0x9990('0x8'),util['inspect'](_0x1bea89,{'showHidden':![],'depth':null}),_0x312594,_0xc450c);_0x3daaf6(_0x1bea89);}_0x4959fc(_0x312594);});});};
\ No newline at end of file
+var _0x8b3f=['info','util','../../../../config/logger','bluebird','child_process','exec','Exec\x20gs'];(function(_0x4affa0,_0x5c1dc2){var _0x535ebb=function(_0x5c0aed){while(--_0x5c0aed){_0x4affa0['push'](_0x4affa0['shift']());}};_0x535ebb(++_0x5c1dc2);}(_0x8b3f,0x9b));var _0xf8b3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8b3f[_0x2641f9];return _0x585741;};'use strict';var util=require(_0xf8b3('0x0'));var logger=require(_0xf8b3('0x1'))('fax');var BPromise=require(_0xf8b3('0x2'));var exec=require(_0xf8b3('0x3'))[_0xf8b3('0x4')];exports['execute']=function(_0x2129f9){return new BPromise(function(_0x3eef6e,_0x3a5df6){exec(_0x2129f9,function(_0x4cc41c,_0x1061b4,_0xacb262){logger['info'](_0xf8b3('0x5'),_0x1061b4);if(_0x4cc41c){logger[_0xf8b3('0x6')](_0xf8b3('0x5'),'\x20Error\x20:',util['inspect'](_0x4cc41c,{'showHidden':![],'depth':null}),_0x1061b4,_0xacb262);_0x3a5df6(_0x4cc41c);}_0x3eef6e(_0x1061b4);});});};
\ No newline at end of file
index deb71be..c7a81e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c07=['xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','channel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c07,0x99));var _0x79c0=function(_0x3e1573,_0x2cb4c8){_0x3e1573=_0x3e1573-0x0;var _0x28ef61=_0x9c07[_0x3e1573];return _0x28ef61;};'use strict';var util=require(_0x79c0('0x0'));var _=require(_0x79c0('0x1'));var moment=require(_0x79c0('0x2'));var logger=require(_0x79c0('0x3'))(_0x79c0('0x4'));exports[_0x79c0('0x5')]=function(_0x1d863d){return{'message':_0x1d863d};};exports['logger']=function(_0x34e30c,_0x3e249e){logger[_0x79c0('0x6')](_0x34e30c,util[_0x79c0('0x7')](_0x3e249e,{'showHidden':![],'depth':null}));};exports[_0x79c0('0x8')]=function(_0x46ea5e,_0x52b627){var _0x40734b={'XMF-ECM':_0x52b627[_0x79c0('0x9')],'XMF-HEADERINFO':_0x52b627[_0x79c0('0xa')],'XMF-MINRATE':_0x52b627[_0x79c0('0xb')],'XMF-MAXRATE':_0x52b627[_0x79c0('0xc')],'XMF-MODEM':util[_0x79c0('0xd')](_0x79c0('0xe'),_0x52b627['modem']),'XMF-GATEWAY':_0x52b627[_0x79c0('0xf')],'XMF-FAXDETECT':_0x52b627[_0x79c0('0x10')],'XMF-T38TIMEOUT':_0x52b627[_0x79c0('0x11')],'XMF-LOCALSTATIONID':_0x52b627[_0x79c0('0x12')],'XMF-PATH':_0x46ea5e[_0x79c0('0x13')]};return _0x40734b;};exports['variablesAction']=function(_0x5ab64f,_0x4bbae1){return{'actionid':_0x5ab64f[_0x79c0('0x14')],'action':'originate','channel':_0x5ab64f[_0x79c0('0x15')],'Exten':_0x79c0('0x16'),'Context':_0x79c0('0x17'),'Priority':'1','callerid':util['format'](_0x79c0('0x18'),_0x5ab64f[_0x79c0('0xa')]?_0x5ab64f['headerinfo']:'',_0x5ab64f[_0x79c0('0x12')]),'variable':_0x4bbae1,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5ab64f['uniqueid']};};
\ No newline at end of file
+var _0x8012=['uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','fax','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','gateway','faxdetect','t38timeout','localstationid','path','variablesAction'];(function(_0x3f74b2,_0x3fa94b){var _0x5c620f=function(_0x532eb1){while(--_0x532eb1){_0x3f74b2['push'](_0x3f74b2['shift']());}};_0x5c620f(++_0x3fa94b);}(_0x8012,0x186));var _0x2801=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x8012[_0x2dadb9];return _0x2f0097;};'use strict';var util=require(_0x2801('0x0'));var _=require(_0x2801('0x1'));var moment=require(_0x2801('0x2'));var logger=require('../../../../config/logger')(_0x2801('0x3'));exports['message']=function(_0x462246){return{'message':_0x462246};};exports[_0x2801('0x4')]=function(_0x5014c7,_0x439399){logger[_0x2801('0x5')](_0x5014c7,util[_0x2801('0x6')](_0x439399,{'showHidden':![],'depth':null}));};exports[_0x2801('0x7')]=function(_0x402964,_0x14e9c9){var _0x339565={'XMF-ECM':_0x14e9c9[_0x2801('0x8')],'XMF-HEADERINFO':_0x14e9c9[_0x2801('0x9')],'XMF-MINRATE':_0x14e9c9[_0x2801('0xa')],'XMF-MAXRATE':_0x14e9c9[_0x2801('0xb')],'XMF-MODEM':util['format']('\x22%s\x22',_0x14e9c9['modem']),'XMF-GATEWAY':_0x14e9c9[_0x2801('0xc')],'XMF-FAXDETECT':_0x14e9c9[_0x2801('0xd')],'XMF-T38TIMEOUT':_0x14e9c9[_0x2801('0xe')],'XMF-LOCALSTATIONID':_0x14e9c9[_0x2801('0xf')],'XMF-PATH':_0x402964[_0x2801('0x10')]};return _0x339565;};exports[_0x2801('0x11')]=function(_0x8f3c98,_0x1f42a5){return{'actionid':_0x8f3c98[_0x2801('0x12')],'action':_0x2801('0x13'),'channel':_0x8f3c98[_0x2801('0x14')],'Exten':_0x2801('0x15'),'Context':_0x2801('0x16'),'Priority':'1','callerid':util['format'](_0x2801('0x17'),_0x8f3c98[_0x2801('0x9')]?_0x8f3c98[_0x2801('0x9')]:'',_0x8f3c98[_0x2801('0xf')]),'variable':_0x1f42a5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x8f3c98[_0x2801('0x12')]};};
\ No newline at end of file
index 7df0882..9eedc90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b5a=['./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','inspect','listen','sync','error','[index.js][main]','bluebird','util','moment','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount'];(function(_0x2c5250,_0x40f071){var _0xb4e325=function(_0x1bd0d1){while(--_0x1bd0d1){_0x2c5250['push'](_0x2c5250['shift']());}};_0xb4e325(++_0x40f071);}(_0x9b5a,0x14f));var _0xa9b5=function(_0x507d15,_0xc42971){_0x507d15=_0x507d15-0x0;var _0x592252=_0x9b5a[_0x507d15];return _0x592252;};'use strict';var BPromise=require(_0xa9b5('0x0'));var util=require(_0xa9b5('0x1'));var moment=require(_0xa9b5('0x2'));var server=require('./server');var Realtime=require(_0xa9b5('0x3'));var Report=require(_0xa9b5('0x4'));var Acw=require(_0xa9b5('0x5'));var Trigger=require(_0xa9b5('0x6'));var Dialer=require(_0xa9b5('0x7'));var Preview=require(_0xa9b5('0x8'));var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xa9b5('0x9'));var voiceCallReport=require(_0xa9b5('0xa'));var trunk=require(_0xa9b5('0xb'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xa9b5('0xc'));var voiceExtension=require(_0xa9b5('0xd'));var faxAccount=require(_0xa9b5('0xe'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xa9b5('0xf'));var sugarcrm=require(_0xa9b5('0x10'));var freshdesk=require(_0xa9b5('0x11'));var desk=require(_0xa9b5('0x12'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xa9b5('0x13'));var freshsales=require(_0xa9b5('0x14'));var servicenow=require(_0xa9b5('0x15'));var dynamics365=require(_0xa9b5('0x16'));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(_0xa9b5('0x17'))(_0xa9b5('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xa9b5('0x19')](_0xa9b5('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xa9b5('0x19')](_0xa9b5('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xa9b5('0x1b')]()['then'](user['getAgents']())[_0xa9b5('0x1c')](realtime[_0xa9b5('0x1d')]())[_0xa9b5('0x1c')](user[_0xa9b5('0x1e')]())[_0xa9b5('0x1c')](realtime[_0xa9b5('0x1f')]())[_0xa9b5('0x1c')](trunk[_0xa9b5('0x20')]())['then'](realtime[_0xa9b5('0x21')]())[_0xa9b5('0x1c')](voiceQueue[_0xa9b5('0x22')]())[_0xa9b5('0x1c')](realtime[_0xa9b5('0x23')]())[_0xa9b5('0x1c')](trigger['getTriggers']())[_0xa9b5('0x1c')](realtime[_0xa9b5('0x24')]())['then'](template[_0xa9b5('0x25')]())['then'](realtime[_0xa9b5('0x26')]())[_0xa9b5('0x1c')](zendesk['getZendeskAccounts']())[_0xa9b5('0x1c')](realtime[_0xa9b5('0x27')]())[_0xa9b5('0x1c')](salesforce[_0xa9b5('0x28')]())['then'](realtime['initSalesforceAccounts']())[_0xa9b5('0x1c')](sugarcrm[_0xa9b5('0x29')]())[_0xa9b5('0x1c')](realtime[_0xa9b5('0x2a')]())[_0xa9b5('0x1c')](freshdesk[_0xa9b5('0x2b')]())[_0xa9b5('0x1c')](realtime['initFreshdeskAccounts']())[_0xa9b5('0x1c')](desk['getDeskAccounts']())[_0xa9b5('0x1c')](realtime['initDeskAccounts']())[_0xa9b5('0x1c')](zoho[_0xa9b5('0x2c')]())['then'](realtime[_0xa9b5('0x2d')]())[_0xa9b5('0x1c')](vtiger[_0xa9b5('0x2e')]())[_0xa9b5('0x1c')](realtime[_0xa9b5('0x2f')]())[_0xa9b5('0x1c')](freshsales[_0xa9b5('0x30')]())[_0xa9b5('0x1c')](realtime[_0xa9b5('0x31')]())[_0xa9b5('0x1c')](servicenow[_0xa9b5('0x32')]())[_0xa9b5('0x1c')](realtime[_0xa9b5('0x33')]())[_0xa9b5('0x1c')](dynamics365[_0xa9b5('0x34')]())[_0xa9b5('0x1c')](realtime[_0xa9b5('0x35')]())[_0xa9b5('0x1c')](campaign['getCampaigns']())[_0xa9b5('0x1c')](realtime[_0xa9b5('0x36')]())[_0xa9b5('0x1c')](voiceExtension[_0xa9b5('0x37')]())[_0xa9b5('0x1c')](realtime[_0xa9b5('0x38')]())[_0xa9b5('0x1c')](faxAccount['getFaxAccounts']())[_0xa9b5('0x1c')](realtime['initFaxAccounts']())[_0xa9b5('0x1c')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xa9b5('0x1c')](voiceQueueReport[_0xa9b5('0x39')]())[_0xa9b5('0x1c')](realtime['initVoiceQueueReports']())[_0xa9b5('0x1c')](cmHopperHistory[_0xa9b5('0x3a')]())[_0xa9b5('0x1c')](realtime[_0xa9b5('0x3b')]())[_0xa9b5('0x1c')](cmHopperHistory[_0xa9b5('0x3c')]())[_0xa9b5('0x1c')](realtime[_0xa9b5('0x3d')]())['then'](voiceCallReport[_0xa9b5('0x3e')]())[_0xa9b5('0x1c')](realtime[_0xa9b5('0x3f')]())[_0xa9b5('0x40')](function(_0x184ae5){logger['error']('[index.js][initParams]',util[_0xa9b5('0x41')](_0x184ae5,{'showHidden':![],'depth':null}));});}function main(){return server[_0xa9b5('0x42')](realtime,preview,fax)['then'](function(_0x46c43b){return initRealtime();})[_0xa9b5('0x1c')](function(){return initParams();})[_0xa9b5('0x1c')](function(){report[_0xa9b5('0x43')]();setInterval(initRealtime,0x1388);})[_0xa9b5('0x40')](function(_0x7d7fc4){logger[_0xa9b5('0x44')](_0xa9b5('0x45'),util[_0xa9b5('0x41')](_0x7d7fc4,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
+var _0xe92b=['./rpc/trigger','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','hour','resolve','getAgents','then','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','initVoiceQueueReports','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','sync','[index.js][main]','bluebird','util','moment','./server','./report','./acw','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport'];(function(_0x4742fc,_0x28f4a2){var _0x270d39=function(_0x1dd3d9){while(--_0x1dd3d9){_0x4742fc['push'](_0x4742fc['shift']());}};_0x270d39(++_0x28f4a2);}(_0xe92b,0xb2));var _0xbe92=function(_0x1d39f6,_0x146f4a){_0x1d39f6=_0x1d39f6-0x0;var _0x3dbd7a=_0xe92b[_0x1d39f6];return _0x3dbd7a;};'use strict';var BPromise=require(_0xbe92('0x0'));var util=require(_0xbe92('0x1'));var moment=require(_0xbe92('0x2'));var server=require(_0xbe92('0x3'));var Realtime=require('./realtime');var Report=require(_0xbe92('0x4'));var Acw=require(_0xbe92('0x5'));var Trigger=require('./trigger');var Dialer=require(_0xbe92('0x6'));var Preview=require(_0xbe92('0x7'));var Fax=require('./fax');var user=require(_0xbe92('0x8'));var voiceQueue=require(_0xbe92('0x9'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xbe92('0xa'));var trunk=require('./rpc/trunk');var trigger=require(_0xbe92('0xb'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xbe92('0xc'));var voiceExtension=require(_0xbe92('0xd'));var faxAccount=require(_0xbe92('0xe'));var zendesk=require(_0xbe92('0xf'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xbe92('0x10'));var desk=require(_0xbe92('0x11'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xbe92('0x12'));var freshsales=require(_0xbe92('0x13'));var servicenow=require(_0xbe92('0x14'));var dynamics365=require(_0xbe92('0x15'));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('../../config/logger')(_0xbe92('0x16'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xbe92('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xbe92('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xbe92('0x18')]()['then'](user[_0xbe92('0x19')]())[_0xbe92('0x1a')](realtime[_0xbe92('0x1b')]())['then'](user[_0xbe92('0x1c')]())[_0xbe92('0x1a')](realtime['initTelephones']())[_0xbe92('0x1a')](trunk[_0xbe92('0x1d')]())[_0xbe92('0x1a')](realtime[_0xbe92('0x1e')]())[_0xbe92('0x1a')](voiceQueue[_0xbe92('0x1f')]())[_0xbe92('0x1a')](realtime[_0xbe92('0x20')]())['then'](trigger[_0xbe92('0x21')]())[_0xbe92('0x1a')](realtime[_0xbe92('0x22')]())[_0xbe92('0x1a')](template['getTemplates']())[_0xbe92('0x1a')](realtime['initTemplates']())['then'](zendesk[_0xbe92('0x23')]())['then'](realtime['initZendeskAccounts']())[_0xbe92('0x1a')](salesforce['getSalesforceAccounts']())[_0xbe92('0x1a')](realtime[_0xbe92('0x24')]())[_0xbe92('0x1a')](sugarcrm[_0xbe92('0x25')]())[_0xbe92('0x1a')](realtime['initSugarcrmAccounts']())[_0xbe92('0x1a')](freshdesk[_0xbe92('0x26')]())[_0xbe92('0x1a')](realtime[_0xbe92('0x27')]())[_0xbe92('0x1a')](desk[_0xbe92('0x28')]())['then'](realtime['initDeskAccounts']())[_0xbe92('0x1a')](zoho[_0xbe92('0x29')]())[_0xbe92('0x1a')](realtime[_0xbe92('0x2a')]())[_0xbe92('0x1a')](vtiger['getVtigerAccounts']())[_0xbe92('0x1a')](realtime[_0xbe92('0x2b')]())[_0xbe92('0x1a')](freshsales[_0xbe92('0x2c')]())[_0xbe92('0x1a')](realtime[_0xbe92('0x2d')]())[_0xbe92('0x1a')](servicenow[_0xbe92('0x2e')]())[_0xbe92('0x1a')](realtime[_0xbe92('0x2f')]())[_0xbe92('0x1a')](dynamics365['getDynamics365Accounts']())[_0xbe92('0x1a')](realtime[_0xbe92('0x30')]())[_0xbe92('0x1a')](campaign['getCampaigns']())[_0xbe92('0x1a')](realtime[_0xbe92('0x31')]())[_0xbe92('0x1a')](voiceExtension[_0xbe92('0x32')]())[_0xbe92('0x1a')](realtime[_0xbe92('0x33')]())[_0xbe92('0x1a')](faxAccount['getFaxAccounts']())[_0xbe92('0x1a')](realtime['initFaxAccounts']())[_0xbe92('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0xbe92('0x18')]()[_0xbe92('0x1a')](voiceQueueReport['getVoiceQueueReports']())[_0xbe92('0x1a')](realtime[_0xbe92('0x34')]())[_0xbe92('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0xbe92('0x1a')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0xbe92('0x35')]())[_0xbe92('0x1a')](realtime[_0xbe92('0x36')]())['then'](voiceCallReport[_0xbe92('0x37')]())[_0xbe92('0x1a')](realtime[_0xbe92('0x38')]())[_0xbe92('0x39')](function(_0x823aee){logger[_0xbe92('0x3a')](_0xbe92('0x3b'),util[_0xbe92('0x3c')](_0x823aee,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xbe92('0x1a')](function(_0x1762ed){return initRealtime();})[_0xbe92('0x1a')](function(){return initParams();})[_0xbe92('0x1a')](function(){report[_0xbe92('0x3d')]();setInterval(initRealtime,0x1388);})[_0xbe92('0x39')](function(_0x556193){logger[_0xbe92('0x3a')](_0xbe92('0x3e'),util['inspect'](_0x556193,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
index d0a2a6c..42f9422 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x485d98,_0x43e513){var _0x423ae4=function(_0x52c027){while(--_0x52c027){_0x485d98['push'](_0x485d98['shift']());}};_0x423ae4(++_0x43e513);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x33c637,_0x597c26){_0x33c637=_0x33c637-0x0;var _0x14aa20=_0xcb91[_0x33c637];return _0x14aa20;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent;
\ No newline at end of file
+var _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(_0xe6b0d1,_0x4a56a3){var _0x4b7193=function(_0x52c611){while(--_0x52c611){_0xe6b0d1['push'](_0xe6b0d1['shift']());}};_0x4b7193(++_0x4a56a3);}(_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 b2c28a1..312b81d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda27=['TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x32659d,_0x58ece9){var _0x10d610=function(_0x35bded){while(--_0x35bded){_0x32659d['push'](_0x32659d['shift']());}};_0x10d610(++_0x58ece9);}(_0xda27,0x13c));var _0x7da2=function(_0x1469ee,_0x1ed8b5){_0x1469ee=_0x1469ee-0x0;var _0x35be1c=_0xda27[_0x1469ee];return _0x35be1c;};'use strict';function Campaign(_0xc627d){this['id']=_0xc627d['id']||0x0;this[_0x7da2('0x0')]=_0xc627d[_0x7da2('0x0')]||'';this[_0x7da2('0x1')]=_0xc627d[_0x7da2('0x1')]||_0x7da2('0x2');this[_0x7da2('0x3')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x7da2('0x4')]=0x0;this['message']='';this[_0x7da2('0x5')]=!![];this['active']=_0xc627d[_0x7da2('0x6')];this[_0x7da2('0x7')]=_0xc627d[_0x7da2('0x7')];this[_0x7da2('0x8')]=_0xc627d[_0x7da2('0x8')]||null;this[_0x7da2('0x9')]=_0xc627d[_0x7da2('0x9')]?_0xc627d[_0x7da2('0x9')]:null;this[_0x7da2('0xa')]=_0xc627d['dialOriginateCallerIdName'];this[_0x7da2('0xb')]=_0xc627d[_0x7da2('0xb')];this[_0x7da2('0xc')]=_0xc627d[_0x7da2('0xc')]||0x1e;this['dialCongestionMaxRetry']=_0xc627d['dialCongestionMaxRetry'];this[_0x7da2('0xd')]=_0xc627d[_0x7da2('0xd')];this[_0x7da2('0xe')]=_0xc627d[_0x7da2('0xe')];this[_0x7da2('0xf')]=_0xc627d[_0x7da2('0xf')];this[_0x7da2('0x10')]=_0xc627d[_0x7da2('0x10')];this[_0x7da2('0x11')]=_0xc627d[_0x7da2('0x11')];this[_0x7da2('0x12')]=_0xc627d[_0x7da2('0x12')];this[_0x7da2('0x13')]=_0xc627d[_0x7da2('0x13')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0xc627d[_0x7da2('0x14')]||0x96;this[_0x7da2('0x15')]=_0xc627d['dialDropMaxRetry']||0x3;this[_0x7da2('0x16')]=_0xc627d[_0x7da2('0x16')]||0x96;this['dialAbandonedMaxRetry']=_0xc627d[_0x7da2('0x17')]||0x3;this[_0x7da2('0x18')]=_0xc627d[_0x7da2('0x18')]||0x96;this[_0x7da2('0x19')]=_0xc627d[_0x7da2('0x19')]||0x3;this[_0x7da2('0x1a')]=_0xc627d[_0x7da2('0x1a')]||0x96;this[_0x7da2('0x1b')]=_0xc627d[_0x7da2('0x1b')]||0x3;this[_0x7da2('0x1c')]=_0xc627d[_0x7da2('0x1c')]||0x96;this[_0x7da2('0x1d')]=_0xc627d[_0x7da2('0x1d')]||_0x7da2('0x1e');this[_0x7da2('0x1f')]=_0xc627d[_0x7da2('0x1f')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0xc627d[_0x7da2('0x20')]||undefined;this['dialCutDigit']=_0xc627d[_0x7da2('0x21')]||undefined;this[_0x7da2('0x22')]=_0xc627d[_0x7da2('0x22')]?_0xc627d[_0x7da2('0x22')]:undefined;this['Trunk']=_0xc627d[_0x7da2('0x23')]?_0xc627d['Trunk']:undefined;this[_0x7da2('0x24')]=_0xc627d[_0x7da2('0x24')]?_0xc627d[_0x7da2('0x24')]:undefined;this[_0x7da2('0x25')]=_0xc627d[_0x7da2('0x25')]?_0xc627d['SquareProject']:undefined;this[_0x7da2('0x26')]=_0xc627d['SquareProject']?_0xc627d['SquareProject']['name']:undefined;this[_0x7da2('0x27')]=_0xc627d[_0x7da2('0x27')]||![];this['dialAMDInitialSilence']=_0xc627d[_0x7da2('0x28')];this['dialAMDGreeting']=_0xc627d[_0x7da2('0x29')];this[_0x7da2('0x2a')]=_0xc627d[_0x7da2('0x2a')];this[_0x7da2('0x2b')]=_0xc627d[_0x7da2('0x2b')];this['dialAMDMinWordLength']=_0xc627d[_0x7da2('0x2c')];this[_0x7da2('0x2d')]=_0xc627d[_0x7da2('0x2d')];this[_0x7da2('0x2e')]=_0xc627d[_0x7da2('0x2e')];this[_0x7da2('0x2f')]=_0xc627d[_0x7da2('0x2f')];this[_0x7da2('0x30')]=_0xc627d[_0x7da2('0x30')];}module[_0x7da2('0x31')]=Campaign;
\ No newline at end of file
+var _0x4ad3=['dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry'];(function(_0x7a1166,_0x27f462){var _0x4b0e18=function(_0x1c5052){while(--_0x1c5052){_0x7a1166['push'](_0x7a1166['shift']());}};_0x4b0e18(++_0x27f462);}(_0x4ad3,0x1b0));var _0x34ad=function(_0x26aee4,_0x530ead){_0x26aee4=_0x26aee4-0x0;var _0x2e1048=_0x4ad3[_0x26aee4];return _0x2e1048;};'use strict';function Campaign(_0x25b86b){this['id']=_0x25b86b['id']||0x0;this[_0x34ad('0x0')]=_0x25b86b['name']||'';this[_0x34ad('0x1')]=_0x25b86b[_0x34ad('0x1')]||'campaign';this[_0x34ad('0x2')]=0x0;this['temp']=0x0;this[_0x34ad('0x3')]=0x0;this[_0x34ad('0x4')]=0x0;this['message']='';this[_0x34ad('0x5')]=!![];this[_0x34ad('0x6')]=_0x25b86b[_0x34ad('0x6')];this[_0x34ad('0x7')]=_0x25b86b[_0x34ad('0x7')];this[_0x34ad('0x8')]=_0x25b86b[_0x34ad('0x8')]||null;this[_0x34ad('0x9')]=_0x25b86b['dialGlobalInterval']?_0x25b86b[_0x34ad('0x9')]:null;this['dialOriginateCallerIdName']=_0x25b86b[_0x34ad('0xa')];this[_0x34ad('0xb')]=_0x25b86b['dialOriginateCallerIdNumber'];this[_0x34ad('0xc')]=_0x25b86b[_0x34ad('0xc')]||0x1e;this[_0x34ad('0xd')]=_0x25b86b[_0x34ad('0xd')];this['dialCongestionRetryFrequency']=_0x25b86b[_0x34ad('0xe')];this['dialBusyMaxRetry']=_0x25b86b[_0x34ad('0xf')];this['dialBusyRetryFrequency']=_0x25b86b[_0x34ad('0x10')];this[_0x34ad('0x11')]=_0x25b86b[_0x34ad('0x11')];this[_0x34ad('0x12')]=_0x25b86b['dialNoAnswerRetryFrequency'];this[_0x34ad('0x13')]=_0x25b86b[_0x34ad('0x13')];this['dialNoSuchNumberMaxRetry']=_0x25b86b[_0x34ad('0x14')]||0x3;this[_0x34ad('0x15')]=_0x25b86b['dialNoSuchNumberRetryFrequency']||0x96;this[_0x34ad('0x16')]=_0x25b86b['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x25b86b[_0x34ad('0x17')]||0x96;this[_0x34ad('0x18')]=_0x25b86b[_0x34ad('0x18')]||0x3;this[_0x34ad('0x19')]=_0x25b86b[_0x34ad('0x19')]||0x96;this[_0x34ad('0x1a')]=_0x25b86b[_0x34ad('0x1a')]||0x3;this[_0x34ad('0x1b')]=_0x25b86b[_0x34ad('0x1b')]||0x96;this['dialAgentRejectMaxRetry']=_0x25b86b[_0x34ad('0x1c')]||0x3;this[_0x34ad('0x1d')]=_0x25b86b[_0x34ad('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x25b86b[_0x34ad('0x1e')]||_0x34ad('0x1f');this[_0x34ad('0x20')]=_0x25b86b[_0x34ad('0x20')]||undefined;this[_0x34ad('0x21')]=_0x25b86b['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x34ad('0x22')]=_0x25b86b[_0x34ad('0x22')]||undefined;this[_0x34ad('0x23')]=_0x25b86b[_0x34ad('0x23')]?_0x25b86b['TrunkBackup']:undefined;this[_0x34ad('0x24')]=_0x25b86b[_0x34ad('0x24')]?_0x25b86b[_0x34ad('0x24')]:undefined;this[_0x34ad('0x25')]=_0x25b86b[_0x34ad('0x25')]?_0x25b86b[_0x34ad('0x25')]:undefined;this[_0x34ad('0x26')]=_0x25b86b[_0x34ad('0x26')]?_0x25b86b[_0x34ad('0x26')]:undefined;this['dialQueueProject']=_0x25b86b[_0x34ad('0x26')]?_0x25b86b[_0x34ad('0x26')][_0x34ad('0x0')]:undefined;this['dialAMDActive']=_0x25b86b[_0x34ad('0x27')]||![];this['dialAMDInitialSilence']=_0x25b86b[_0x34ad('0x28')];this[_0x34ad('0x29')]=_0x25b86b[_0x34ad('0x29')];this['dialAMDAfterGreetingSilence']=_0x25b86b[_0x34ad('0x2a')];this[_0x34ad('0x2b')]=_0x25b86b[_0x34ad('0x2b')];this[_0x34ad('0x2c')]=_0x25b86b[_0x34ad('0x2c')];this[_0x34ad('0x2d')]=_0x25b86b[_0x34ad('0x2d')];this[_0x34ad('0x2e')]=_0x25b86b[_0x34ad('0x2e')];this[_0x34ad('0x2f')]=_0x25b86b[_0x34ad('0x2f')];this[_0x34ad('0x30')]=_0x25b86b[_0x34ad('0x30')];}module[_0x34ad('0x31')]=Campaign;
\ No newline at end of file
index 79b1177..03f66e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa509=['answered','endtime','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','accountcode','context','uniqueid','linkedid'];(function(_0x53a13d,_0x5899f9){var _0x255033=function(_0x24b895){while(--_0x24b895){_0x53a13d['push'](_0x53a13d['shift']());}};_0x255033(++_0x5899f9);}(_0xa509,0x12f));var _0x9a50=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa509[_0x20a584];return _0x4b41a8;};'use strict';function Channel(){this[_0x9a50('0x0')]=null;this[_0x9a50('0x1')]='';this[_0x9a50('0x2')]='';this[_0x9a50('0x3')]=0x0;this['calleridname']='';this[_0x9a50('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x9a50('0x5')]=0x0;this[_0x9a50('0x6')]='';this[_0x9a50('0x7')]=0x0;this[_0x9a50('0x8')]=0x0;this['exten']=0x0;this[_0x9a50('0x9')]=![];this['answertime']=null;this[_0x9a50('0xa')]=null;this['unmanaged']=![];this['abandoned']=![];this['lastapplication']='';this['lastdata']='';this[_0x9a50('0xb')]=0x0;this[_0x9a50('0xc')]=0x0;this[_0x9a50('0xd')]=0x0;this[_0x9a50('0xe')]=null;this[_0x9a50('0xf')]=null;this[_0x9a50('0x10')]=null;this[_0x9a50('0x11')]=![];this[_0x9a50('0x12')]=null;this[_0x9a50('0x13')]=null;this[_0x9a50('0x14')]=[];this[_0x9a50('0x15')]=undefined;this[_0x9a50('0x16')]=undefined;this[_0x9a50('0x17')]=undefined;this[_0x9a50('0x18')]=0x0;}module[_0x9a50('0x19')]=Channel;
\ No newline at end of file
+var _0x434b=['answered','answertime','endtime','unmanaged','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','monitorFilename','queue','transferconnectedlinenum','transferType','destinationchannel','calleridnum','connectedlinenum','accountcode','context','uniqueid','linkedid','exten'];(function(_0x28c663,_0x4dbc16){var _0x35b0c3=function(_0x4211d2){while(--_0x4211d2){_0x28c663['push'](_0x28c663['shift']());}};_0x35b0c3(++_0x4dbc16);}(_0x434b,0x17f));var _0xb434=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x434b[_0x101e7b];return _0x4995c0;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0xb434('0x0')]='';this[_0xb434('0x1')]=0x0;this['calleridname']='';this[_0xb434('0x2')]=undefined;this['connectedlinename']=undefined;this[_0xb434('0x3')]=0x0;this[_0xb434('0x4')]='';this[_0xb434('0x5')]=0x0;this[_0xb434('0x6')]=0x0;this[_0xb434('0x7')]=0x0;this[_0xb434('0x8')]=![];this[_0xb434('0x9')]=null;this[_0xb434('0xa')]=null;this[_0xb434('0xb')]=![];this['abandoned']=![];this[_0xb434('0xc')]='';this[_0xb434('0xd')]='';this[_0xb434('0xe')]=0x0;this[_0xb434('0xf')]=0x0;this[_0xb434('0x10')]=0x0;this[_0xb434('0x11')]=null;this[_0xb434('0x12')]=null;this['disposition']=null;this['monitor']=![];this[_0xb434('0x13')]=null;this[_0xb434('0x14')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0xb434('0x15')]=undefined;this[_0xb434('0x16')]=undefined;this['mohtime']=0x0;}module['exports']=Channel;
\ No newline at end of file
index e00d02c..f101f43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa195=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa195,0x195));var _0x5a19=function(_0x32cee8,_0x43ad8d){_0x32cee8=_0x32cee8-0x0;var _0x519a1a=_0xa195[_0x32cee8];return _0x519a1a;};'use strict';function DeskAccount(_0x1e9d64){this['id']=_0x1e9d64['id']||0x0;this['name']=_0x1e9d64[_0x5a19('0x0')]||'';this['username']=_0x1e9d64[_0x5a19('0x1')]||'';this[_0x5a19('0x2')]=_0x1e9d64[_0x5a19('0x2')]||'';this['authType']=_0x1e9d64[_0x5a19('0x3')]||'';this[_0x5a19('0x4')]=_0x1e9d64[_0x5a19('0x4')]||'';this[_0x5a19('0x5')]=_0x1e9d64[_0x5a19('0x5')]||'';this[_0x5a19('0x6')]=_0x1e9d64['consumerSecret']||'';this['token']=_0x1e9d64[_0x5a19('0x7')]||'';this[_0x5a19('0x8')]=_0x1e9d64[_0x5a19('0x8')]||'';this[_0x5a19('0x9')]=_0x1e9d64[_0x5a19('0x9')]||'';this['serverUrl']=_0x1e9d64[_0x5a19('0xa')]||'';this[_0x5a19('0xb')]=_0x1e9d64['Configurations']||{};}module[_0x5a19('0xc')]=DeskAccount;
\ No newline at end of file
+var _0x2d53=['Configurations','exports','name','username','remoteUri','authType','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x3e5932,_0x34f629){var _0x4e9a8e=function(_0x1917b1){while(--_0x1917b1){_0x3e5932['push'](_0x3e5932['shift']());}};_0x4e9a8e(++_0x34f629);}(_0x2d53,0x13a));var _0x32d5=function(_0x29436c,_0x260a6a){_0x29436c=_0x29436c-0x0;var _0x3760a2=_0x2d53[_0x29436c];return _0x3760a2;};'use strict';function DeskAccount(_0x14dbf0){this['id']=_0x14dbf0['id']||0x0;this[_0x32d5('0x0')]=_0x14dbf0['name']||'';this[_0x32d5('0x1')]=_0x14dbf0['username']||'';this[_0x32d5('0x2')]=_0x14dbf0['remoteUri']||'';this[_0x32d5('0x3')]=_0x14dbf0[_0x32d5('0x3')]||'';this['password']=_0x14dbf0['password']||'';this[_0x32d5('0x4')]=_0x14dbf0['consumerKey']||'';this['consumerSecret']=_0x14dbf0[_0x32d5('0x5')]||'';this[_0x32d5('0x6')]=_0x14dbf0[_0x32d5('0x6')]||'';this['tokenSecret']=_0x14dbf0[_0x32d5('0x7')]||'';this['type']=_0x14dbf0[_0x32d5('0x8')]||'';this[_0x32d5('0x9')]=_0x14dbf0['serverUrl']||'';this[_0x32d5('0xa')]=_0x14dbf0[_0x32d5('0xa')]||{};}module[_0x32d5('0xb')]=DeskAccount;
\ No newline at end of file
index ff95763..c4d9209 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d15=['modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x6d15,0xd0));var _0x56d1=function(_0x5c92d4,_0x39f20d){_0x5c92d4=_0x5c92d4-0x0;var _0x3e1121=_0x6d15[_0x5c92d4];return _0x3e1121;};'use strict';function Dynamics365Account(_0x4633ae){this['id']=_0x4633ae['id']||0x0;this[_0x56d1('0x0')]=_0x4633ae[_0x56d1('0x0')]||'';this['username']=_0x4633ae[_0x56d1('0x1')]||'';this[_0x56d1('0x2')]=_0x4633ae[_0x56d1('0x2')]||'';this[_0x56d1('0x3')]=_0x4633ae[_0x56d1('0x3')]||'';this['tenantId']=_0x4633ae[_0x56d1('0x4')]||'';this[_0x56d1('0x5')]=_0x4633ae[_0x56d1('0x5')]||'';this[_0x56d1('0x6')]=_0x4633ae[_0x56d1('0x6')]||{};this[_0x56d1('0x7')]=_0x4633ae['serverUrl']||'';this['modernAuthentication']=_0x4633ae[_0x56d1('0x8')]||![];this[_0x56d1('0x9')]=_0x4633ae['Configurations']||{};this[_0x56d1('0xa')]=_0x4633ae[_0x56d1('0xa')]||{};}module[_0x56d1('0xb')]=Dynamics365Account;
\ No newline at end of file
+var _0xd0d0=['tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri'];(function(_0x90aec5,_0x522cb2){var _0x5e3af2=function(_0x3314b6){while(--_0x3314b6){_0x90aec5['push'](_0x90aec5['shift']());}};_0x5e3af2(++_0x522cb2);}(_0xd0d0,0x1ac));var _0x0d0d=function(_0x98d987,_0x8035f9){_0x98d987=_0x98d987-0x0;var _0x371b08=_0xd0d0[_0x98d987];return _0x371b08;};'use strict';function Dynamics365Account(_0x4a5643){this['id']=_0x4a5643['id']||0x0;this[_0x0d0d('0x0')]=_0x4a5643['name']||'';this[_0x0d0d('0x1')]=_0x4a5643[_0x0d0d('0x1')]||'';this[_0x0d0d('0x2')]=_0x4a5643[_0x0d0d('0x2')]||'';this[_0x0d0d('0x3')]=_0x4a5643[_0x0d0d('0x3')]||'';this[_0x0d0d('0x4')]=_0x4a5643[_0x0d0d('0x4')]||'';this['clientId']=_0x4a5643[_0x0d0d('0x5')]||'';this['clientSecret']=_0x4a5643[_0x0d0d('0x6')]||{};this[_0x0d0d('0x7')]=_0x4a5643[_0x0d0d('0x7')]||'';this['modernAuthentication']=_0x4a5643[_0x0d0d('0x8')]||![];this[_0x0d0d('0x9')]=_0x4a5643[_0x0d0d('0x9')]||{};this[_0x0d0d('0xa')]=_0x4a5643[_0x0d0d('0xa')]||{};}module[_0x0d0d('0xb')]=Dynamics365Account;
\ No newline at end of file
index ad9dcf5..57545a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed74=['tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','minrate','maxrate','modem','v17,v27,v29','gateway'];(function(_0x498334,_0x27b6fe){var _0x13bb70=function(_0x4087b1){while(--_0x4087b1){_0x498334['push'](_0x498334['shift']());}};_0x13bb70(++_0x27b6fe);}(_0xed74,0x75));var _0x4ed7=function(_0x248a43,_0x59e52a){_0x248a43=_0x248a43-0x0;var _0x451379=_0xed74[_0x248a43];return _0x451379;};'use strict';function FaxAccount(_0x59bdb1){this['id']=_0x59bdb1['id']||0x0;this[_0x4ed7('0x0')]=_0x59bdb1[_0x4ed7('0x0')]||'';this['description']=_0x59bdb1[_0x4ed7('0x1')];this[_0x4ed7('0x2')]=_0x59bdb1[_0x4ed7('0x2')];this[_0x4ed7('0x3')]=_0x59bdb1[_0x4ed7('0x3')];this['localstationid']=_0x59bdb1['localstationid'];this[_0x4ed7('0x4')]=_0x59bdb1[_0x4ed7('0x4')]||0x960;this['maxrate']=_0x59bdb1[_0x4ed7('0x5')]||0x3840;this[_0x4ed7('0x6')]=_0x59bdb1[_0x4ed7('0x6')]||_0x4ed7('0x7');this[_0x4ed7('0x8')]=_0x59bdb1[_0x4ed7('0x8')]||'no';this['faxdetect']=_0x59bdb1['faxdetect']||'no';this['t38timeout']=_0x59bdb1['t38timeout']||0x1388;this[_0x4ed7('0x9')]=_0x59bdb1[_0x4ed7('0x9')]||'SIP';this[_0x4ed7('0xa')]=_0x59bdb1[_0x4ed7('0xa')]?_0x59bdb1[_0x4ed7('0xa')]:undefined;this[_0x4ed7('0xb')]=_0x59bdb1[_0x4ed7('0xb')];this['key']=_0x59bdb1[_0x4ed7('0xc')];}module[_0x4ed7('0xd')]=FaxAccount;
\ No newline at end of file
+var _0x24a0=['headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm'];(function(_0x4d093a,_0x15d59c){var _0x5d7227=function(_0x4e2fee){while(--_0x4e2fee){_0x4d093a['push'](_0x4d093a['shift']());}};_0x5d7227(++_0x15d59c);}(_0x24a0,0x74));var _0x024a=function(_0x56f923,_0x56a028){_0x56f923=_0x56f923-0x0;var _0x4ae2b7=_0x24a0[_0x56f923];return _0x4ae2b7;};'use strict';function FaxAccount(_0x11eeff){this['id']=_0x11eeff['id']||0x0;this['name']=_0x11eeff[_0x024a('0x0')]||'';this[_0x024a('0x1')]=_0x11eeff[_0x024a('0x1')];this[_0x024a('0x2')]=_0x11eeff['ecm'];this['headerinfo']=_0x11eeff[_0x024a('0x3')];this[_0x024a('0x4')]=_0x11eeff['localstationid'];this[_0x024a('0x5')]=_0x11eeff[_0x024a('0x5')]||0x960;this[_0x024a('0x6')]=_0x11eeff[_0x024a('0x6')]||0x3840;this[_0x024a('0x7')]=_0x11eeff['modem']||_0x024a('0x8');this[_0x024a('0x9')]=_0x11eeff[_0x024a('0x9')]||'no';this[_0x024a('0xa')]=_0x11eeff['faxdetect']||'no';this[_0x024a('0xb')]=_0x11eeff['t38timeout']||0x1388;this[_0x024a('0xc')]=_0x11eeff[_0x024a('0xc')]||_0x024a('0xd');this[_0x024a('0xe')]=_0x11eeff['Trunk']?_0x11eeff[_0x024a('0xe')]:undefined;this['ListId']=_0x11eeff[_0x024a('0xf')];this[_0x024a('0x10')]=_0x11eeff[_0x024a('0x10')];}module['exports']=FaxAccount;
\ No newline at end of file
index c7b79dd..40ef5cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8ee=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x59a78d,_0x28336c){var _0x3741df=function(_0x2baef7){while(--_0x2baef7){_0x59a78d['push'](_0x59a78d['shift']());}};_0x3741df(++_0x28336c);}(_0xe8ee,0x16b));var _0xee8e=function(_0x49037e,_0x50e9d5){_0x49037e=_0x49037e-0x0;var _0x33e07f=_0xe8ee[_0x49037e];return _0x33e07f;};'use strict';function FreshdeskAccount(_0x48a189){this['id']=_0x48a189['id']||0x0;this[_0xee8e('0x0')]=_0x48a189[_0xee8e('0x0')]||'';this['username']=_0x48a189[_0xee8e('0x1')]||'';this[_0xee8e('0x2')]=_0x48a189[_0xee8e('0x3')]||'';this[_0xee8e('0x4')]=_0x48a189['remoteUri']||'';this['serverUrl']=_0x48a189[_0xee8e('0x5')]||'';this[_0xee8e('0x6')]=_0x48a189[_0xee8e('0x6')]||{};}module[_0xee8e('0x7')]=FreshdeskAccount;
\ No newline at end of file
+var _0xa201=['exports','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x425699,_0x34558f){var _0x5341e9=function(_0x394ff7){while(--_0x394ff7){_0x425699['push'](_0x425699['shift']());}};_0x5341e9(++_0x34558f);}(_0xa201,0x145));var _0x1a20=function(_0x779d4d,_0x5c0aa0){_0x779d4d=_0x779d4d-0x0;var _0x1194ec=_0xa201[_0x779d4d];return _0x1194ec;};'use strict';function FreshdeskAccount(_0x5c0414){this['id']=_0x5c0414['id']||0x0;this['name']=_0x5c0414['name']||'';this['username']=_0x5c0414['username']||'';this[_0x1a20('0x0')]=_0x5c0414[_0x1a20('0x1')]||'';this['remoteUri']=_0x5c0414[_0x1a20('0x2')]||'';this[_0x1a20('0x3')]=_0x5c0414[_0x1a20('0x3')]||'';this['Configurations']=_0x5c0414[_0x1a20('0x4')]||{};}module[_0x1a20('0x5')]=FreshdeskAccount;
\ No newline at end of file
index 1733c6c..bf93a6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c42=['username','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x1044e5,_0x498e01){var _0x5ad0dd=function(_0x458548){while(--_0x458548){_0x1044e5['push'](_0x1044e5['shift']());}};_0x5ad0dd(++_0x498e01);}(_0x0c42,0x191));var _0x20c4=function(_0x3f9288,_0x4e8527){_0x3f9288=_0x3f9288-0x0;var _0x41120f=_0x0c42[_0x3f9288];return _0x41120f;};'use strict';function FreshsalesAccount(_0x42957c){this['id']=_0x42957c['id']||0x0;this[_0x20c4('0x0')]=_0x42957c[_0x20c4('0x0')]||'';this[_0x20c4('0x1')]=_0x42957c[_0x20c4('0x1')]||'';this['apiKey']=_0x42957c['token']||'';this[_0x20c4('0x2')]=_0x42957c[_0x20c4('0x2')]||'';this[_0x20c4('0x3')]=_0x42957c[_0x20c4('0x3')]||'';this[_0x20c4('0x4')]=_0x42957c['Configurations']||{};}module[_0x20c4('0x5')]=FreshsalesAccount;
\ No newline at end of file
+var _0xf5a7=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xf5a7,0x133));var _0x7f5a=function(_0x1f96c6,_0x10fba3){_0x1f96c6=_0x1f96c6-0x0;var _0x4a3bc3=_0xf5a7[_0x1f96c6];return _0x4a3bc3;};'use strict';function FreshsalesAccount(_0x227d06){this['id']=_0x227d06['id']||0x0;this[_0x7f5a('0x0')]=_0x227d06['name']||'';this[_0x7f5a('0x1')]=_0x227d06[_0x7f5a('0x1')]||'';this[_0x7f5a('0x2')]=_0x227d06[_0x7f5a('0x3')]||'';this[_0x7f5a('0x4')]=_0x227d06[_0x7f5a('0x4')]||'';this[_0x7f5a('0x5')]=_0x227d06[_0x7f5a('0x5')]||'';this[_0x7f5a('0x6')]=_0x227d06['Configurations']||{};}module[_0x7f5a('0x7')]=FreshsalesAccount;
\ No newline at end of file
index e2f843a..e1c7e88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf11=['accountcode','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','type','inbound','calleridnum','calleridname','queue','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum'];(function(_0x1c8b86,_0x5454e7){var _0x56cb1f=function(_0x8713c3){while(--_0x8713c3){_0x1c8b86['push'](_0x1c8b86['shift']());}};_0x56cb1f(++_0x5454e7);}(_0xcf11,0x13b));var _0x1cf1=function(_0xaedc8f,_0x2487db){_0xaedc8f=_0xaedc8f-0x0;var _0x2e1d6f=_0xcf11[_0xaedc8f];return _0x2e1d6f;};'use strict';function QueueReport(){this[_0x1cf1('0x0')]=_0x1cf1('0x1');this['uniqueid']='';this[_0x1cf1('0x2')]='';this[_0x1cf1('0x3')]='';this[_0x1cf1('0x4')]='';this['queuecallerjoinAt']=null;this[_0x1cf1('0x5')]=null;this[_0x1cf1('0x6')]=0x1;this['count']=0x1;this[_0x1cf1('0x7')]=![];this[_0x1cf1('0x8')]=null;this[_0x1cf1('0x9')]=![];this[_0x1cf1('0xa')]=null;this[_0x1cf1('0xb')]=![];this['queuecallerexitAt']=null;this[_0x1cf1('0xc')]=0x1;this[_0x1cf1('0xd')]='';this[_0x1cf1('0xe')]='';this['connectedlinename']='';this[_0x1cf1('0xf')]='';this['context']='';this[_0x1cf1('0x10')]='';this[_0x1cf1('0x11')]='';this[_0x1cf1('0x12')]=0x0;this[_0x1cf1('0x13')]=![];this[_0x1cf1('0x14')]='';this[_0x1cf1('0x15')]='voice';this['mohtime']=0x0;this['variables']={};}module['exports']=QueueReport;
\ No newline at end of file
+var _0x9690=['queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','channel','connectedlinename','context','exten','holdtime','assigned','lastAssignedTo','motionChannel','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','queue','queuecallerleaveAt','position','count'];(function(_0xeff2c3,_0x3a5a82){var _0x2cade6=function(_0x5a26a1){while(--_0x5a26a1){_0xeff2c3['push'](_0xeff2c3['shift']());}};_0x2cade6(++_0x3a5a82);}(_0x9690,0x1ad));var _0x0969=function(_0x136ba9,_0x15e1fa){_0x136ba9=_0x136ba9-0x0;var _0x5a7f45=_0x9690[_0x136ba9];return _0x5a7f45;};'use strict';function QueueReport(){this[_0x0969('0x0')]=_0x0969('0x1');this[_0x0969('0x2')]='';this[_0x0969('0x3')]='';this['calleridname']='';this[_0x0969('0x4')]='';this['queuecallerjoinAt']=null;this[_0x0969('0x5')]=null;this[_0x0969('0x6')]=0x1;this[_0x0969('0x7')]=0x1;this[_0x0969('0x8')]=![];this['queuecallerabandonAt']=null;this[_0x0969('0x9')]=![];this[_0x0969('0xa')]=null;this['queuecallerexit']=![];this[_0x0969('0xb')]=null;this['originalposition']=0x1;this[_0x0969('0xc')]='';this['connectedlinenum']='';this[_0x0969('0xd')]='';this['accountcode']='';this[_0x0969('0xe')]='';this[_0x0969('0xf')]='';this['priority']='';this[_0x0969('0x10')]=0x0;this[_0x0969('0x11')]=![];this[_0x0969('0x12')]='';this[_0x0969('0x13')]='voice';this[_0x0969('0x14')]=0x0;this[_0x0969('0x15')]={};}module[_0x0969('0x16')]=QueueReport;
\ No newline at end of file
index 59acf83..1a4ac8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2186=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x8544ec,_0x520707){var _0x875391=function(_0x5eb641){while(--_0x5eb641){_0x8544ec['push'](_0x8544ec['shift']());}};_0x875391(++_0x520707);}(_0x2186,0x18e));var _0x6218=function(_0x979efb,_0x42d022){_0x979efb=_0x979efb-0x0;var _0x177e1d=_0x2186[_0x979efb];return _0x177e1d;};'use strict';function SalesforceAccount(_0x458be8){this['id']=_0x458be8['id']||0x0;this[_0x6218('0x0')]=_0x458be8[_0x6218('0x0')]||'';this[_0x6218('0x1')]=_0x458be8['username']||'';this[_0x6218('0x2')]=_0x458be8[_0x6218('0x2')]||'';this[_0x6218('0x3')]=_0x458be8['password']||'';this[_0x6218('0x4')]=_0x458be8['clientId']||'';this['clientSecret']=_0x458be8[_0x6218('0x5')]||'';this[_0x6218('0x6')]=_0x458be8[_0x6218('0x6')]||'';this[_0x6218('0x7')]=_0x458be8[_0x6218('0x7')]||_0x6218('0x8');this[_0x6218('0x9')]=_0x458be8[_0x6218('0x9')]||'';this[_0x6218('0xa')]=_0x458be8[_0x6218('0xa')]||{};}module[_0x6218('0xb')]=SalesforceAccount;
\ No newline at end of file
+var _0xc3b7=['remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc3b7,0x1b6));var _0x7c3b=function(_0x665570,_0x3d6fdd){_0x665570=_0x665570-0x0;var _0x4d43f2=_0xc3b7[_0x665570];return _0x4d43f2;};'use strict';function SalesforceAccount(_0x30eeb5){this['id']=_0x30eeb5['id']||0x0;this[_0x7c3b('0x0')]=_0x30eeb5[_0x7c3b('0x0')]||'';this['username']=_0x30eeb5[_0x7c3b('0x1')]||'';this[_0x7c3b('0x2')]=_0x30eeb5[_0x7c3b('0x2')]||'';this['password']=_0x30eeb5[_0x7c3b('0x3')]||'';this[_0x7c3b('0x4')]=_0x30eeb5[_0x7c3b('0x4')]||'';this[_0x7c3b('0x5')]=_0x30eeb5[_0x7c3b('0x5')]||'';this[_0x7c3b('0x6')]=_0x30eeb5[_0x7c3b('0x6')]||'';this[_0x7c3b('0x7')]=_0x30eeb5[_0x7c3b('0x7')]||'integrationTab';this[_0x7c3b('0x8')]=_0x30eeb5[_0x7c3b('0x8')]||'';this[_0x7c3b('0x9')]=_0x30eeb5[_0x7c3b('0x9')]||{};}module['exports']=SalesforceAccount;
\ No newline at end of file
index e1d10de..ae3ac96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc7f=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x4c76a7,_0x3dc773){var _0x4d9879=function(_0x4dfe70){while(--_0x4dfe70){_0x4c76a7['push'](_0x4c76a7['shift']());}};_0x4d9879(++_0x3dc773);}(_0xbc7f,0xb2));var _0xfbc7=function(_0x5c0a3b,_0x474712){_0x5c0a3b=_0x5c0a3b-0x0;var _0x30aece=_0xbc7f[_0x5c0a3b];return _0x30aece;};'use strict';function ServicenowAccount(_0x3794c1){this['id']=_0x3794c1['id']||0x0;this['name']=_0x3794c1[_0xfbc7('0x0')]||'';this['username']=_0x3794c1[_0xfbc7('0x1')]||'';this[_0xfbc7('0x2')]=_0x3794c1[_0xfbc7('0x2')]||'';this['remoteUri']=_0x3794c1[_0xfbc7('0x3')]||'';this['serverUrl']=_0x3794c1[_0xfbc7('0x4')]||'';this[_0xfbc7('0x5')]=_0x3794c1['Configurations']||{};}module[_0xfbc7('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0x75cf=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x256f2f,_0x27005b){var _0x5cef30=function(_0x2ec946){while(--_0x2ec946){_0x256f2f['push'](_0x256f2f['shift']());}};_0x5cef30(++_0x27005b);}(_0x75cf,0x1a4));var _0xf75c=function(_0x4d5205,_0x2c3de1){_0x4d5205=_0x4d5205-0x0;var _0x3b3e1b=_0x75cf[_0x4d5205];return _0x3b3e1b;};'use strict';function ServicenowAccount(_0x2231a1){this['id']=_0x2231a1['id']||0x0;this[_0xf75c('0x0')]=_0x2231a1[_0xf75c('0x0')]||'';this['username']=_0x2231a1[_0xf75c('0x1')]||'';this[_0xf75c('0x2')]=_0x2231a1[_0xf75c('0x2')]||'';this[_0xf75c('0x3')]=_0x2231a1[_0xf75c('0x3')]||'';this[_0xf75c('0x4')]=_0x2231a1[_0xf75c('0x4')]||'';this[_0xf75c('0x5')]=_0x2231a1[_0xf75c('0x5')]||{};}module[_0xf75c('0x6')]=ServicenowAccount;
\ No newline at end of file
index 8bf027d..39d45a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d6a=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x57b9d1,_0x1a1a23){var _0xeb5051=function(_0x599386){while(--_0x599386){_0x57b9d1['push'](_0x57b9d1['shift']());}};_0xeb5051(++_0x1a1a23);}(_0x1d6a,0x68));var _0xa1d6=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1d6a[_0x4b369d];return _0x571a98;};'use strict';function SugarcrmAccount(_0xb0d949){this['id']=_0xb0d949['id']||0x0;this['name']=_0xb0d949[_0xa1d6('0x0')]||'';this[_0xa1d6('0x1')]=_0xb0d949['username']||'';this['password']=_0xb0d949[_0xa1d6('0x2')]||'';this[_0xa1d6('0x3')]=_0xb0d949[_0xa1d6('0x3')]||'';this[_0xa1d6('0x4')]=_0xb0d949[_0xa1d6('0x4')]||'';this[_0xa1d6('0x5')]=_0xb0d949[_0xa1d6('0x5')]||{};}module[_0xa1d6('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0xd79e=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x56eb11,_0x22611c){var _0x2b9439=function(_0x1edb89){while(--_0x1edb89){_0x56eb11['push'](_0x56eb11['shift']());}};_0x2b9439(++_0x22611c);}(_0xd79e,0x16d));var _0xed79=function(_0x263f1b,_0x52dd99){_0x263f1b=_0x263f1b-0x0;var _0x396b48=_0xd79e[_0x263f1b];return _0x396b48;};'use strict';function SugarcrmAccount(_0x58789b){this['id']=_0x58789b['id']||0x0;this[_0xed79('0x0')]=_0x58789b[_0xed79('0x0')]||'';this[_0xed79('0x1')]=_0x58789b[_0xed79('0x1')]||'';this[_0xed79('0x2')]=_0x58789b[_0xed79('0x2')]||'';this[_0xed79('0x3')]=_0x58789b[_0xed79('0x3')]||'';this[_0xed79('0x4')]=_0x58789b[_0xed79('0x4')]||'';this[_0xed79('0x5')]=_0x58789b[_0xed79('0x5')]||{};}module[_0xed79('0x6')]=SugarcrmAccount;
\ No newline at end of file
index 4c4da33..1fe3b80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb910=['status','address','exports','name','accountcode','state','unknown','stateTime'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0xb910,0x12b));var _0x0b91=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xb910[_0x2f1762];return _0x8ab21;};'use strict';function Telephone(_0x596b26){this['id']=_0x596b26['id']||0x0;this[_0x0b91('0x0')]=_0x596b26[_0x0b91('0x0')]||'';this[_0x0b91('0x1')]=_0x596b26[_0x0b91('0x1')]||'';this[_0x0b91('0x2')]=_0x0b91('0x3');this[_0x0b91('0x4')]=0x0;this[_0x0b91('0x5')]=_0x0b91('0x3');this[_0x0b91('0x6')]='';}module[_0x0b91('0x7')]=Telephone;
\ No newline at end of file
+var _0x5080=['accountcode','status','address','exports','name'];(function(_0x387862,_0x3c5c4e){var _0x16d405=function(_0x113b00){while(--_0x113b00){_0x387862['push'](_0x387862['shift']());}};_0x16d405(++_0x3c5c4e);}(_0x5080,0x158));var _0x0508=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x5080[_0x3bf83f];return _0x22c4a9;};'use strict';function Telephone(_0x4f9868){this['id']=_0x4f9868['id']||0x0;this[_0x0508('0x0')]=_0x4f9868[_0x0508('0x0')]||'';this['accountcode']=_0x4f9868[_0x0508('0x1')]||'';this['state']='unknown';this['stateTime']=0x0;this[_0x0508('0x2')]='unknown';this[_0x0508('0x3')]='';}module[_0x0508('0x4')]=Telephone;
\ No newline at end of file
index 469a4c5..33c5bf6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['exports','name'];(function(_0x46cef5,_0x1b38ef){var _0x4bae18=function(_0x3351d4){while(--_0x3351d4){_0x46cef5['push'](_0x46cef5['shift']());}};_0x4bae18(++_0x1b38ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
+var _0xa9e0=['exports','name'];(function(_0x4c66e5,_0x2d98c2){var _0x5894b1=function(_0xf38189){while(--_0xf38189){_0x4c66e5['push'](_0x4c66e5['shift']());}};_0x5894b1(++_0x2d98c2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 8da898d..24b5be7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0x592cbc,_0x5ec030){var _0x39b8d9=function(_0x39055c){while(--_0x39055c){_0x592cbc['push'](_0x592cbc['shift']());}};_0x39b8d9(++_0x5ec030);}(_0xb7e7,0x121));var _0x7b7e=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xb7e7[_0x17928f];return _0x500b63;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('0x6')]=Trigger;
\ No newline at end of file
+var _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x43626c,_0x59cded){var _0x5b90fd=function(_0x4bd624){while(--_0x4bd624){_0x43626c['push'](_0x43626c['shift']());}};_0x5b90fd(++_0x59cded);}(_0xda2d,0x102));var _0xdda2=function(_0x4e15ff,_0x50a793){_0x4e15ff=_0x4e15ff-0x0;var _0x4d1e27=_0xda2d[_0x4e15ff];return _0x4d1e27;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger;
\ No newline at end of file
index dc62257..3844ffb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fa1=['host','domain','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','stateTime','unknown','registry','split'];(function(_0x3f1e4e,_0x1b3d58){var _0x28edb7=function(_0x53032b){while(--_0x53032b){_0x3f1e4e['push'](_0x3f1e4e['shift']());}};_0x28edb7(++_0x1b3d58);}(_0x4fa1,0x71));var _0x14fa=function(_0x4d03e2,_0x169891){_0x4d03e2=_0x4d03e2-0x0;var _0x751980=_0x4fa1[_0x4d03e2];return _0x751980;};'use strict';function Trunk(_0x3c510c){this['id']=_0x3c510c['id']||0x0;this[_0x14fa('0x0')]=_0x3c510c[_0x14fa('0x0')]||![];this[_0x14fa('0x1')]=_0x3c510c['name']||'';this[_0x14fa('0x2')]='unknown';this[_0x14fa('0x3')]=0x0;this['status']=_0x14fa('0x4');this[_0x14fa('0x5')]=_0x3c510c[_0x14fa('0x5')]&&_0x3c510c[_0x14fa('0x5')]['indexOf'](':')?_0x3c510c['registry'][_0x14fa('0x6')](':')[0x0]:'';this[_0x14fa('0x7')]='';this['port']='';this[_0x14fa('0x8')]='';this['domainport']='';this[_0x14fa('0x9')]='';this[_0x14fa('0xa')]=_0x14fa('0x4');this[_0x14fa('0xb')]='';this[_0x14fa('0xc')]='';this['defaultuser']=_0x3c510c[_0x14fa('0xd')]||'';}module[_0x14fa('0xe')]=Trunk;
\ No newline at end of file
+var _0xa2a3=['defaultuser','exports','active','name','state','status','registry','split','refresh','stateRegistry','unknown','registrationtime','address'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa2a3,0x106));var _0x3a2a=function(_0x4fd540,_0x4de6c7){_0x4fd540=_0x4fd540-0x0;var _0x735bb2=_0xa2a3[_0x4fd540];return _0x735bb2;};'use strict';function Trunk(_0xe3d938){this['id']=_0xe3d938['id']||0x0;this[_0x3a2a('0x0')]=_0xe3d938[_0x3a2a('0x0')]||![];this[_0x3a2a('0x1')]=_0xe3d938['name']||'';this[_0x3a2a('0x2')]='unknown';this['stateTime']=0x0;this[_0x3a2a('0x3')]='unknown';this[_0x3a2a('0x4')]=_0xe3d938['registry']&&_0xe3d938['registry']['indexOf'](':')?_0xe3d938[_0x3a2a('0x4')][_0x3a2a('0x5')](':')[0x0]:'';this['host']='';this['port']='';this['domain']='';this['domainport']='';this[_0x3a2a('0x6')]='';this[_0x3a2a('0x7')]=_0x3a2a('0x8');this[_0x3a2a('0x9')]='';this[_0x3a2a('0xa')]='';this[_0x3a2a('0xb')]=_0xe3d938[_0x3a2a('0xb')]||'';}module[_0x3a2a('0xc')]=Trunk;
\ No newline at end of file
index 5c5172a..76624fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa853=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x590565,_0x3a7d5b){var _0xaae98d=function(_0xa8283f){while(--_0xa8283f){_0x590565['push'](_0x590565['shift']());}};_0xaae98d(++_0x3a7d5b);}(_0xa853,0x1da));var _0x3a85=function(_0x4f1315,_0x2bf97d){_0x4f1315=_0x4f1315-0x0;var _0x52df38=_0xa853[_0x4f1315];return _0x52df38;};'use strict';function voiceExtension(_0x2ca0a5){this['id']=_0x2ca0a5['id']||0x0;this[_0x3a85('0x0')]=_0x2ca0a5['exten']||'';this[_0x3a85('0x1')]=_0x2ca0a5[_0x3a85('0x1')]||_0x3a85('0x2');this[_0x3a85('0x3')]=_0x2ca0a5[_0x3a85('0x3')]||![];}module[_0x3a85('0x4')]=voiceExtension;
\ No newline at end of file
+var _0x650c=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x10d060,_0x8a1d1f){var _0x40137c=function(_0x442c2a){while(--_0x442c2a){_0x10d060['push'](_0x10d060['shift']());}};_0x40137c(++_0x8a1d1f);}(_0x650c,0x189));var _0xc650=function(_0x1cbbb0,_0x5357db){_0x1cbbb0=_0x1cbbb0-0x0;var _0xbb3cfb=_0x650c[_0x1cbbb0];return _0xbb3cfb;};'use strict';function voiceExtension(_0x1ba87e){this['id']=_0x1ba87e['id']||0x0;this[_0xc650('0x0')]=_0x1ba87e[_0xc650('0x0')]||'';this[_0xc650('0x1')]=_0x1ba87e[_0xc650('0x1')]||_0xc650('0x2');this[_0xc650('0x3')]=_0x1ba87e[_0xc650('0x3')]||![];}module[_0xc650('0x4')]=voiceExtension;
\ No newline at end of file
index a54db23..1b4abd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c13=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','invalid','unavailable','ringing','onhold','wav','rrmemory','roundrobin','name','monitor_format','type','inbound','talking','total','sumHoldTime','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x5c13,0xb8));var _0x35c1=function(_0x5817e6,_0x44a2d0){_0x5817e6=_0x5817e6-0x0;var _0x51916a=_0x5c13[_0x5817e6];return _0x51916a;};'use strict';var statusDesc=['unknown',_0x35c1('0x0'),_0x35c1('0x1'),'busy',_0x35c1('0x2'),_0x35c1('0x3'),_0x35c1('0x4'),'ringinuse',_0x35c1('0x5')];var monitorFormat={'wav':_0x35c1('0x6'),'wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':_0x35c1('0x7'),'roundrobin':_0x35c1('0x8')};function VoiceQueue(_0x41f231){this['id']=_0x41f231['id']||0x0;this[_0x35c1('0x9')]=_0x41f231['name']||'';this[_0x35c1('0xa')]=_0x41f231[_0x35c1('0xa')]||'';this[_0x35c1('0xb')]=_0x41f231['type']||_0x35c1('0xc');this['waiting']=0x0;this[_0x35c1('0xd')]=0x0;this[_0x35c1('0xe')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0x35c1('0xf')]=0x0;this['sumBillable']=0x0;this[_0x35c1('0x10')]=0x0;this[_0x35c1('0x11')]=0x0;this[_0x35c1('0x12')]=0x0;this['available']=0x0;this[_0x35c1('0x13')]=_0x41f231[_0x35c1('0x13')]||![];this['acwTimeout']=_0x41f231[_0x35c1('0x14')]||0xa;this[_0x35c1('0x15')]=_0x41f231[_0x35c1('0x15')]||'no';this[_0x35c1('0x16')]=!![];this[_0x35c1('0x17')]='';this[_0x35c1('0x18')]=0x0;this[_0x35c1('0x19')]=0x0;this[_0x35c1('0x1a')]=_0x41f231[_0x35c1('0x1a')]||null;this[_0x35c1('0x1b')]=_0x41f231[_0x35c1('0x1b')]?_0x41f231['dialGlobalInterval']:null;this['dialActive']=_0x41f231[_0x35c1('0x1c')];this[_0x35c1('0x1d')]=_0x41f231[_0x35c1('0x1d')]||_0x35c1('0x1e');this[_0x35c1('0x1f')]=_0x41f231[_0x35c1('0x1f')]||0x0;this[_0x35c1('0x20')]=_0x41f231[_0x35c1('0x20')]||0x0;this[_0x35c1('0x21')]=_0x41f231['dialPowerLevel']||0x1;this[_0x35c1('0x22')]=_0x41f231['dialPredictiveOptimization']||_0x35c1('0x23');this['dialPredictiveOptimizationPercentage']=_0x41f231[_0x35c1('0x24')]||0.03;this[_0x35c1('0x25')]=_0x41f231[_0x35c1('0x25')]||0x258;this[_0x35c1('0x26')]=_0x41f231[_0x35c1('0x26')]||'anonymous';this[_0x35c1('0x27')]=_0x41f231[_0x35c1('0x27')]||_0x35c1('0x28');this[_0x35c1('0x29')]=_0x41f231[_0x35c1('0x29')]||0x1e;this[_0x35c1('0x2a')]=_0x41f231[_0x35c1('0x2a')]||_0x35c1('0x2b');this[_0x35c1('0x2c')]=_0x41f231[_0x35c1('0x2c')]||0x3;this[_0x35c1('0x2d')]=_0x41f231[_0x35c1('0x2d')]||undefined;this[_0x35c1('0x2e')]=_0x41f231[_0x35c1('0x2e')]||0x3;this['dialCongestionRetryFrequency']=_0x41f231[_0x35c1('0x2f')]||0x96;this[_0x35c1('0x30')]=_0x41f231[_0x35c1('0x30')]||0x3;this['dialBusyRetryFrequency']=_0x41f231[_0x35c1('0x31')]||0x96;this['dialNoAnswerMaxRetry']=_0x41f231['dialNoAnswerMaxRetry']||0x3;this[_0x35c1('0x32')]=_0x41f231['dialNoAnswerRetryFrequency']||0x96;this[_0x35c1('0x33')]=_0x41f231['dialNoSuchNumberMaxRetry']||0x3;this[_0x35c1('0x34')]=_0x41f231[_0x35c1('0x34')]||0x96;this[_0x35c1('0x35')]=_0x41f231[_0x35c1('0x35')]||0x3;this['dialDropRetryFrequency']=_0x41f231[_0x35c1('0x36')]||0x96;this[_0x35c1('0x37')]=_0x41f231[_0x35c1('0x37')]||0x3;this['dialAbandonedRetryFrequency']=_0x41f231[_0x35c1('0x38')]||0x96;this[_0x35c1('0x39')]=_0x41f231[_0x35c1('0x39')]||0x3;this[_0x35c1('0x3a')]=_0x41f231['dialMachineRetryFrequency']||0x96;this[_0x35c1('0x3b')]=_0x41f231[_0x35c1('0x3b')]||0x3;this[_0x35c1('0x3c')]=_0x41f231[_0x35c1('0x3c')]||0x96;this[_0x35c1('0x3d')]=_0x41f231[_0x35c1('0x3d')]||0x3;this['dialGlobalMaxRetry']=_0x41f231['dialGlobalMaxRetry']||0x4;this[_0x35c1('0x3e')]=_0x41f231['Trunk']?_0x41f231[_0x35c1('0x3e')]:undefined;this['TrunkBackup']=_0x41f231[_0x35c1('0x3f')]?_0x41f231[_0x35c1('0x3f')]:undefined;this['dialPrefix']=_0x41f231[_0x35c1('0x40')]||undefined;this[_0x35c1('0x41')]=_0x41f231[_0x35c1('0x41')]?_0x41f231[_0x35c1('0x41')]:undefined;this[_0x35c1('0x42')]=_0x41f231[_0x35c1('0x42')]||_0x35c1('0x43');this[_0x35c1('0x44')]=_0x41f231[_0x35c1('0x44')]||undefined;this[_0x35c1('0x45')]=_0x41f231[_0x35c1('0x45')]||undefined;this[_0x35c1('0x46')]=strategy[_0x41f231[_0x35c1('0x46')]]||_0x35c1('0x7');this[_0x35c1('0x47')]=!![];this[_0x35c1('0x48')]=_0x41f231[_0x35c1('0x48')]||![];this[_0x35c1('0x49')]=_0x41f231['dialAMDInitialSilence'];this[_0x35c1('0x4a')]=_0x41f231[_0x35c1('0x4a')];this[_0x35c1('0x4b')]=_0x41f231[_0x35c1('0x4b')];this[_0x35c1('0x4c')]=_0x41f231[_0x35c1('0x4c')];this['dialAMDMinWordLength']=_0x41f231[_0x35c1('0x4d')];this[_0x35c1('0x4e')]=_0x41f231[_0x35c1('0x4e')];this[_0x35c1('0x4f')]=_0x41f231['dialAMDMaximumNumberOfWords'];this[_0x35c1('0x50')]=_0x41f231['dialAMDSilenceThreshold'];this[_0x35c1('0x51')]=_0x41f231[_0x35c1('0x51')];this[_0x35c1('0x52')]=0x0;this[_0x35c1('0x53')]=0x0;this[_0x35c1('0x54')]=_0x41f231['timeout'];this[_0x35c1('0x55')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0x35c1('0x56')]=0x0;this[_0x35c1('0x57')]=0x0;this[_0x35c1('0x58')]=0x0;this[_0x35c1('0x59')]=0x0;this[_0x35c1('0x5a')]=0x0;this[_0x35c1('0x5b')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x35c1('0x5c')]=0x0;this['outboundReCallsDay']=0x0;this[_0x35c1('0x5d')]=0x0;this[_0x35c1('0x5e')]=undefined;this[_0x35c1('0x5f')]=undefined;this[_0x35c1('0x60')]=undefined;this[_0x35c1('0x61')]=1.05;this[_0x35c1('0x62')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x35c1('0x63')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x35c1('0x64')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x35c1('0x65')]=_0x41f231[_0x35c1('0x66')]||0x14;this['predictiveIntervalMinThreshold']=_0x41f231[_0x35c1('0x66')]||0xa;this[_0x35c1('0x67')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x35c1('0x68')]=0x1;this[_0x35c1('0x69')]=0x0;this[_0x35c1('0x6a')]=0x0;this[_0x35c1('0x6b')]=0x0;this['erlangBusyFactor']=0x0;this[_0x35c1('0x6c')]=_0x41f231[_0x35c1('0x6c')]||0x1e;this[_0x35c1('0x6d')]=_0x41f231[_0x35c1('0x6d')]||![];this[_0x35c1('0x6e')]=!!_0x41f231[_0x35c1('0x6e')]||![];this[_0x35c1('0x6f')]=!!_0x41f231['dialPreviewRecallmeReminder']||![];this[_0x35c1('0x70')]=_0x41f231[_0x35c1('0x70')]||undefined;this[_0x35c1('0x71')]=_0x41f231[_0x35c1('0x71')]||![];this['dialAgiAfterHangupAgent']=_0x41f231[_0x35c1('0x72')]||![];this['monitor_format']=monitorFormat[_0x41f231[_0x35c1('0xa')]]?monitorFormat[_0x41f231[_0x35c1('0xa')]]:undefined;this['mandatoryDisposition']=_0x41f231[_0x35c1('0x73')]||![];this[_0x35c1('0x74')]=_0x41f231[_0x35c1('0x74')]?_0x41f231[_0x35c1('0x74')]:undefined;}module[_0x35c1('0x75')]=VoiceQueue;
\ No newline at end of file
+var _0x1605=['originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acwTimeout','autopause','sendMessageOneNotActive','message'];(function(_0x721133,_0x23c4ab){var _0x380b84=function(_0x32223c){while(--_0x32223c){_0x721133['push'](_0x721133['shift']());}};_0x380b84(++_0x23c4ab);}(_0x1605,0x160));var _0x5160=function(_0x3486cc,_0x5e171b){_0x3486cc=_0x3486cc-0x0;var _0x54d8e5=_0x1605[_0x3486cc];return _0x54d8e5;};'use strict';var statusDesc=[_0x5160('0x0'),_0x5160('0x1'),_0x5160('0x2'),_0x5160('0x3'),_0x5160('0x4'),_0x5160('0x5'),_0x5160('0x6'),_0x5160('0x7'),_0x5160('0x8')];var monitorFormat={'wav':_0x5160('0x9'),'wav49':_0x5160('0xa'),'gsm':_0x5160('0xb')};var strategy={'rrmemory':_0x5160('0xc'),'roundrobin':_0x5160('0xd')};function VoiceQueue(_0x219235){this['id']=_0x219235['id']||0x0;this[_0x5160('0xe')]=_0x219235['name']||'';this[_0x5160('0xf')]=_0x219235[_0x5160('0xf')]||'';this['type']=_0x219235[_0x5160('0x10')]||_0x5160('0x11');this[_0x5160('0x12')]=0x0;this[_0x5160('0x13')]=0x0;this[_0x5160('0x14')]=0x0;this['answered']=0x0;this[_0x5160('0x15')]=0x0;this[_0x5160('0x16')]=0x0;this[_0x5160('0x17')]=0x0;this[_0x5160('0x18')]=0x0;this[_0x5160('0x19')]=0x0;this[_0x5160('0x1a')]=0x0;this[_0x5160('0x1b')]=0x0;this['acw']=_0x219235['acw']||![];this[_0x5160('0x1c')]=_0x219235[_0x5160('0x1c')]||0xa;this[_0x5160('0x1d')]=_0x219235[_0x5160('0x1d')]||'no';this[_0x5160('0x1e')]=!![];this[_0x5160('0x1f')]='';this[_0x5160('0x20')]=0x0;this[_0x5160('0x21')]=0x0;this[_0x5160('0x22')]=_0x219235[_0x5160('0x22')]||null;this['dialGlobalInterval']=_0x219235['dialGlobalInterval']?_0x219235[_0x5160('0x23')]:null;this[_0x5160('0x24')]=_0x219235['dialActive'];this[_0x5160('0x25')]=_0x219235[_0x5160('0x25')]||_0x5160('0x26');this[_0x5160('0x27')]=_0x219235[_0x5160('0x27')]||0x0;this[_0x5160('0x28')]=_0x219235[_0x5160('0x28')]||0x0;this[_0x5160('0x29')]=_0x219235[_0x5160('0x29')]||0x1;this[_0x5160('0x2a')]=_0x219235['dialPredictiveOptimization']||_0x5160('0x2b');this[_0x5160('0x2c')]=_0x219235[_0x5160('0x2c')]||0.03;this[_0x5160('0x2d')]=_0x219235['dialPredictiveInterval']||0x258;this[_0x5160('0x2e')]=_0x219235[_0x5160('0x2e')]||_0x5160('0x2f');this['dialOriginateCallerIdNumber']=_0x219235[_0x5160('0x30')]||_0x5160('0x2f');this[_0x5160('0x31')]=_0x219235['dialOriginateTimeout']||0x1e;this[_0x5160('0x32')]=_0x219235[_0x5160('0x32')]||'tTxX';this[_0x5160('0x33')]=_0x219235[_0x5160('0x33')]||0x3;this[_0x5160('0x34')]=_0x219235['dialQueueProject']||undefined;this[_0x5160('0x35')]=_0x219235[_0x5160('0x35')]||0x3;this[_0x5160('0x36')]=_0x219235['dialCongestionRetryFrequency']||0x96;this[_0x5160('0x37')]=_0x219235['dialBusyMaxRetry']||0x3;this[_0x5160('0x38')]=_0x219235[_0x5160('0x38')]||0x96;this[_0x5160('0x39')]=_0x219235[_0x5160('0x39')]||0x3;this[_0x5160('0x3a')]=_0x219235[_0x5160('0x3a')]||0x96;this[_0x5160('0x3b')]=_0x219235['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x219235[_0x5160('0x3c')]||0x96;this[_0x5160('0x3d')]=_0x219235[_0x5160('0x3d')]||0x3;this[_0x5160('0x3e')]=_0x219235[_0x5160('0x3e')]||0x96;this[_0x5160('0x3f')]=_0x219235['dialAbandonedMaxRetry']||0x3;this[_0x5160('0x40')]=_0x219235[_0x5160('0x40')]||0x96;this[_0x5160('0x41')]=_0x219235[_0x5160('0x41')]||0x3;this[_0x5160('0x42')]=_0x219235[_0x5160('0x42')]||0x96;this['dialAgentRejectMaxRetry']=_0x219235[_0x5160('0x43')]||0x3;this[_0x5160('0x44')]=_0x219235['dialAgentRejectRetryFrequency']||0x96;this[_0x5160('0x45')]=_0x219235[_0x5160('0x45')]||0x3;this[_0x5160('0x46')]=_0x219235[_0x5160('0x46')]||0x4;this[_0x5160('0x47')]=_0x219235[_0x5160('0x47')]?_0x219235[_0x5160('0x47')]:undefined;this[_0x5160('0x48')]=_0x219235[_0x5160('0x48')]?_0x219235[_0x5160('0x48')]:undefined;this[_0x5160('0x49')]=_0x219235[_0x5160('0x49')]||undefined;this[_0x5160('0x4a')]=_0x219235[_0x5160('0x4a')]?_0x219235['Interval']:undefined;this[_0x5160('0x4b')]=_0x219235[_0x5160('0x4b')]||_0x5160('0x4c');this[_0x5160('0x4d')]=_0x219235[_0x5160('0x4d')]||undefined;this[_0x5160('0x4e')]=_0x219235['dialCutDigit']||undefined;this[_0x5160('0x4f')]=strategy[_0x219235[_0x5160('0x4f')]]||_0x5160('0xc');this[_0x5160('0x50')]=!![];this[_0x5160('0x51')]=_0x219235['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x219235['dialAMDInitialSilence'];this[_0x5160('0x52')]=_0x219235[_0x5160('0x52')];this['dialAMDAfterGreetingSilence']=_0x219235[_0x5160('0x53')];this['dialAMDTotalAnalysisTime']=_0x219235[_0x5160('0x54')];this[_0x5160('0x55')]=_0x219235[_0x5160('0x55')];this[_0x5160('0x56')]=_0x219235[_0x5160('0x56')];this[_0x5160('0x57')]=_0x219235[_0x5160('0x57')];this[_0x5160('0x58')]=_0x219235[_0x5160('0x58')];this[_0x5160('0x59')]=_0x219235['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0x5160('0x5a')]=0x0;this[_0x5160('0x5b')]=_0x219235[_0x5160('0x5b')];this['outboundAnswerCallsDay']=0x0;this[_0x5160('0x5c')]=0x0;this[_0x5160('0x5d')]=0x0;this[_0x5160('0x5e')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x5160('0x5f')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x5160('0x60')]=0x0;this[_0x5160('0x61')]=0x0;this[_0x5160('0x62')]=0x0;this[_0x5160('0x63')]=0x0;this[_0x5160('0x64')]=0x0;this[_0x5160('0x65')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x5160('0x66')]=undefined;this['startPredictive']=undefined;this[_0x5160('0x67')]=undefined;this[_0x5160('0x68')]=1.05;this[_0x5160('0x69')]=0x0;this[_0x5160('0x6a')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x5160('0x6b')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0x5160('0x6c')]=0x0;this[_0x5160('0x6d')]=_0x219235[_0x5160('0x6e')]||0x14;this[_0x5160('0x6f')]=_0x219235[_0x5160('0x6e')]||0xa;this[_0x5160('0x70')]=0x0;this[_0x5160('0x71')]=0x0;this[_0x5160('0x72')]=0x1;this[_0x5160('0x73')]=0x0;this[_0x5160('0x74')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x5160('0x75')]=0x0;this[_0x5160('0x76')]=_0x219235[_0x5160('0x76')]||0x1e;this[_0x5160('0x77')]=_0x219235[_0x5160('0x77')]||![];this[_0x5160('0x78')]=!!_0x219235[_0x5160('0x78')]||![];this[_0x5160('0x79')]=!!_0x219235['dialPreviewRecallmeReminder']||![];this[_0x5160('0x7a')]=_0x219235[_0x5160('0x7a')]||undefined;this[_0x5160('0x7b')]=_0x219235[_0x5160('0x7b')]||![];this[_0x5160('0x7c')]=_0x219235[_0x5160('0x7c')]||![];this[_0x5160('0xf')]=monitorFormat[_0x219235[_0x5160('0xf')]]?monitorFormat[_0x219235['monitor_format']]:undefined;this[_0x5160('0x7d')]=_0x219235[_0x5160('0x7d')]||![];this[_0x5160('0x7e')]=_0x219235['mandatoryDispositionPause']?_0x219235[_0x5160('0x7e')]:undefined;}module[_0x5160('0x7f')]=VoiceQueue;
\ No newline at end of file
index 9d6c056..48657eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbca8=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0xe89fd4,_0x269e35){var _0x568007=function(_0x40bced){while(--_0x40bced){_0xe89fd4['push'](_0xe89fd4['shift']());}};_0x568007(++_0x269e35);}(_0xbca8,0xf7));var _0x8bca=function(_0x2322c3,_0x3404e5){_0x2322c3=_0x2322c3-0x0;var _0xec0a77=_0xbca8[_0x2322c3];return _0xec0a77;};'use strict';function VtigerAccount(_0x3fb477){this['id']=_0x3fb477['id']||0x0;this[_0x8bca('0x0')]=_0x3fb477[_0x8bca('0x0')]||'';this[_0x8bca('0x1')]=_0x3fb477[_0x8bca('0x1')]||'';this['accessKey']=_0x3fb477[_0x8bca('0x2')]||'';this[_0x8bca('0x3')]=_0x3fb477['remoteUri']||'';this[_0x8bca('0x4')]=_0x3fb477[_0x8bca('0x4')]||'';this[_0x8bca('0x5')]=_0x3fb477[_0x8bca('0x5')]||{};}module[_0x8bca('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0x0092=['name','username','accessKey','remoteUri','serverUrl','exports'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x0092,0x1ec));var _0x2009=function(_0x13d9ac,_0x193a78){_0x13d9ac=_0x13d9ac-0x0;var _0x348a17=_0x0092[_0x13d9ac];return _0x348a17;};'use strict';function VtigerAccount(_0x16a236){this['id']=_0x16a236['id']||0x0;this['name']=_0x16a236[_0x2009('0x0')]||'';this[_0x2009('0x1')]=_0x16a236['username']||'';this[_0x2009('0x2')]=_0x16a236['accessKey']||'';this[_0x2009('0x3')]=_0x16a236[_0x2009('0x3')]||'';this[_0x2009('0x4')]=_0x16a236[_0x2009('0x4')]||'';this['Configurations']=_0x16a236['Configurations']||{};}module[_0x2009('0x5')]=VtigerAccount;
\ No newline at end of file
index 3b391c9..bbc4c9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8561=['authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8561,0x17c));var _0x1856=function(_0x3be379,_0x3b33cf){_0x3be379=_0x3be379-0x0;var _0xf389d=_0x8561[_0x3be379];return _0xf389d;};'use strict';function ZendeskAccount(_0x14a2f3){this['id']=_0x14a2f3['id']||0x0;this[_0x1856('0x0')]=_0x14a2f3[_0x1856('0x0')]||'';this['username']=_0x14a2f3[_0x1856('0x1')]||'';this['password']=_0x14a2f3[_0x1856('0x2')]||'';this[_0x1856('0x3')]=_0x14a2f3[_0x1856('0x3')]||'';this['remoteUri']=_0x14a2f3[_0x1856('0x4')]||'';this[_0x1856('0x5')]=_0x14a2f3[_0x1856('0x5')]||'';this[_0x1856('0x6')]=_0x14a2f3[_0x1856('0x6')]||_0x1856('0x7');this['serverUrl']=_0x14a2f3[_0x1856('0x8')]||'';this['Configurations']=_0x14a2f3[_0x1856('0x9')]||{};}module[_0x1856('0xa')]=ZendeskAccount;
\ No newline at end of file
+var _0x918f=['type','integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri','authType'];(function(_0x1b9cd5,_0x103dc4){var _0x4c74ca=function(_0x460b5e){while(--_0x460b5e){_0x1b9cd5['push'](_0x1b9cd5['shift']());}};_0x4c74ca(++_0x103dc4);}(_0x918f,0xa4));var _0xf918=function(_0xcfcbaa,_0x369d95){_0xcfcbaa=_0xcfcbaa-0x0;var _0x157ed0=_0x918f[_0xcfcbaa];return _0x157ed0;};'use strict';function ZendeskAccount(_0x41b649){this['id']=_0x41b649['id']||0x0;this[_0xf918('0x0')]=_0x41b649['name']||'';this['username']=_0x41b649[_0xf918('0x1')]||'';this[_0xf918('0x2')]=_0x41b649[_0xf918('0x2')]||'';this['token']=_0x41b649[_0xf918('0x3')]||'';this[_0xf918('0x4')]=_0x41b649[_0xf918('0x4')]||'';this[_0xf918('0x5')]=_0x41b649['authType']||'';this[_0xf918('0x6')]=_0x41b649[_0xf918('0x6')]||_0xf918('0x7');this[_0xf918('0x8')]=_0x41b649[_0xf918('0x8')]||'';this['Configurations']=_0x41b649[_0xf918('0x9')]||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
index 7f750e1..f1df6d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x322a=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x25cb3e,_0x2b4637){var _0x297c82=function(_0x48c5b9){while(--_0x48c5b9){_0x25cb3e['push'](_0x25cb3e['shift']());}};_0x297c82(++_0x2b4637);}(_0x322a,0x79));var _0xa322=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0x322a[_0x18afca];return _0x11603f;};'use strict';function ZohoAccount(_0x32ffaf){this['id']=_0x32ffaf['id']||0x0;this[_0xa322('0x0')]=_0x32ffaf[_0xa322('0x0')]||'';this['description']=_0x32ffaf[_0xa322('0x1')]||'';this['host']=_0x32ffaf[_0xa322('0x2')]||'';this[_0xa322('0x3')]=_0x32ffaf[_0xa322('0x3')]||'';this[_0xa322('0x4')]=_0x32ffaf[_0xa322('0x4')]||'';this[_0xa322('0x5')]=_0x32ffaf[_0xa322('0x5')]||'';this[_0xa322('0x6')]=_0x32ffaf[_0xa322('0x6')]||'';this['code']=_0x32ffaf[_0xa322('0x7')]||'';this[_0xa322('0x8')]=_0x32ffaf[_0xa322('0x8')]||'';this['Configurations']=_0x32ffaf[_0xa322('0x9')]||{};}module[_0xa322('0xa')]=ZohoAccount;
\ No newline at end of file
+var _0x0d59=['exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x622fab,_0x5c953e){var _0xf0501f=function(_0x42d0f2){while(--_0x42d0f2){_0x622fab['push'](_0x622fab['shift']());}};_0xf0501f(++_0x5c953e);}(_0x0d59,0x1c4));var _0x90d5=function(_0x36909d,_0x2795f1){_0x36909d=_0x36909d-0x0;var _0x1fd29d=_0x0d59[_0x36909d];return _0x1fd29d;};'use strict';function ZohoAccount(_0x2f7b27){this['id']=_0x2f7b27['id']||0x0;this[_0x90d5('0x0')]=_0x2f7b27[_0x90d5('0x0')]||'';this[_0x90d5('0x1')]=_0x2f7b27[_0x90d5('0x1')]||'';this[_0x90d5('0x2')]=_0x2f7b27[_0x90d5('0x2')]||'';this['zone']=_0x2f7b27[_0x90d5('0x3')]||'';this[_0x90d5('0x4')]=_0x2f7b27[_0x90d5('0x4')]||'';this[_0x90d5('0x5')]=_0x2f7b27[_0x90d5('0x5')]||'';this[_0x90d5('0x6')]=_0x2f7b27[_0x90d5('0x6')]||'';this[_0x90d5('0x7')]=_0x2f7b27[_0x90d5('0x7')]||'';this['refreshToken']=_0x2f7b27[_0x90d5('0x8')]||'';this['Configurations']=_0x2f7b27[_0x90d5('0x9')]||{};}module[_0x90d5('0xa')]=ZohoAccount;
\ No newline at end of file
index 80efcdd..5ba179b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfff0=['recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','lodash','moment','isNil','string','uniqueid','queue','type','dialAnswer','membername','Agent','name','channelAgent','format','SIP/%s','calleridname','phone','Contact','firstName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xfff0,0x139));var _0x0fff=function(_0x28c329,_0x3aa84c){_0x28c329=_0x28c329-0x0;var _0x4b3fe0=_0xfff0[_0x28c329];return _0x4b3fe0;};'use strict';var util=require('util');var _=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));function checkNameSurname(_0x148db8,_0x527213,_0x37165b){var _0x1f4065='';if(!_[_0x0fff('0x2')](_0x527213)&&'string'===typeof _0x527213){_0x1f4065+=_0x527213;}if(!_[_0x0fff('0x2')](_0x37165b)&&_0x0fff('0x3')===typeof _0x37165b){_0x1f4065+='\x20'+_0x37165b;}if(_0x1f4065!==''){return _0x1f4065;}return _0x148db8;}function Action(_0x53c517,_0x33c813,_0x4c2221,_0x2f1d2b,_0x586dc5){this[_0x0fff('0x4')]=_0x4c2221||undefined;this['idContact']=_0x53c517['id'];this[_0x0fff('0x5')]=_0x33c813['name'];this[_0x0fff('0x6')]=_0x33c813[_0x0fff('0x6')];this['campaigntype']=_0x0fff('0x5');this[_0x0fff('0x7')]=![];this[_0x0fff('0x8')]=_[_0x0fff('0x2')](_0x53c517[_0x0fff('0x9')])?undefined:_0x53c517[_0x0fff('0x9')][_0x0fff('0xa')];this[_0x0fff('0xb')]=this[_0x0fff('0x8')]?util[_0x0fff('0xc')](_0x0fff('0xd'),this['membername']):_0x2f1d2b||undefined;this[_0x0fff('0xe')]=checkNameSurname(_0x53c517['Contact'][_0x0fff('0xf')],_0x53c517[_0x0fff('0x10')][_0x0fff('0x11')],_0x53c517[_0x0fff('0x10')]['lastName']);this['active']=_0x53c517[_0x0fff('0x12')]||![];this['calleridnum']=_0x53c517['phone'];this['scheduledat']=_0x53c517[_0x0fff('0x13')];this[_0x0fff('0x14')]=_0x53c517['countbusyretry']||0x0;this[_0x0fff('0x15')]=_0x53c517[_0x0fff('0x15')]||0x0;this['countnoanswerretry']=_0x53c517['countnoanswerretry']||0x0;this['countglobal']=(_0x53c517[_0x0fff('0x14')]||0x0)+(_0x53c517[_0x0fff('0x15')]||0x0)+(_0x53c517[_0x0fff('0x16')]||0x0)+(_0x53c517[_0x0fff('0x17')]||0x0)+(_0x53c517[_0x0fff('0x18')]||0x0)+(_0x53c517[_0x0fff('0x19')]||0x0)+(_0x53c517['countmachineretry']||0x0)+(_0x53c517[_0x0fff('0x1a')]||0x0);this[_0x0fff('0x17')]=_0x53c517[_0x0fff('0x17')]||0x0;this['countdropretry']=_0x53c517['countdropretry']||0x0;this[_0x0fff('0x19')]=_0x53c517[_0x0fff('0x19')]||0x0;this[_0x0fff('0x1b')]=_0x53c517[_0x0fff('0x1b')]||0x0;this['countagentrejectretry']=_0x53c517[_0x0fff('0x1a')]||0x0;this[_0x0fff('0x1c')]=_0x53c517[_0x0fff('0x1c')];this[_0x0fff('0x1d')]=_0x53c517[_0x0fff('0x1d')];this[_0x0fff('0x1e')]=_0x53c517['callbackat'];this[_0x0fff('0x1f')]=_0x53c517[_0x0fff('0x1f')];this[_0x0fff('0x20')]=_0x53c517[_0x0fff('0x20')];this[_0x0fff('0x21')]=_0x53c517[_0x0fff('0x21')];this['UserId']=_[_0x0fff('0x2')](_0x53c517[_0x0fff('0x9')])?_0x53c517[_0x0fff('0x22')]:_0x53c517[_0x0fff('0x9')]['id'];this[_0x0fff('0x23')]=_0x53c517[_0x0fff('0x23')];this[_0x0fff('0x24')]='';this[_0x0fff('0x25')]='';}Action[_0x0fff('0x26')][_0x0fff('0x27')]=function(){return util[_0x0fff('0xc')](_0x0fff('0x28'),this['calleridname'],this[_0x0fff('0x29')]);};module[_0x0fff('0x2a')]=Action;
\ No newline at end of file
+var _0x3423=['Agent','membername','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','prototype','getCaller','format','calleridname','number','exports','moment','isNil','string','uniqueid','idContact','queue','name','type'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3342('0x0'));function checkNameSurname(_0x16bdb3,_0x3477de,_0x3b763d){var _0x21bdc2='';if(!_[_0x3342('0x1')](_0x3477de)&&_0x3342('0x2')===typeof _0x3477de){_0x21bdc2+=_0x3477de;}if(!_[_0x3342('0x1')](_0x3b763d)&&_0x3342('0x2')===typeof _0x3b763d){_0x21bdc2+='\x20'+_0x3b763d;}if(_0x21bdc2!==''){return _0x21bdc2;}return _0x16bdb3;}function Action(_0x19206f,_0x467453,_0x2ccbe0,_0x29c40c,_0x420d4b){this[_0x3342('0x3')]=_0x2ccbe0||undefined;this[_0x3342('0x4')]=_0x19206f['id'];this[_0x3342('0x5')]=_0x467453[_0x3342('0x6')];this[_0x3342('0x7')]=_0x467453['type'];this['campaigntype']=_0x3342('0x5');this['dialAnswer']=![];this['membername']=_['isNil'](_0x19206f['Agent'])?undefined:_0x19206f[_0x3342('0x8')][_0x3342('0x6')];this['channelAgent']=this[_0x3342('0x9')]?util['format'](_0x3342('0xa'),this[_0x3342('0x9')]):_0x29c40c||undefined;this['calleridname']=checkNameSurname(_0x19206f[_0x3342('0xb')][_0x3342('0xc')],_0x19206f[_0x3342('0xb')][_0x3342('0xd')],_0x19206f[_0x3342('0xb')][_0x3342('0xe')]);this[_0x3342('0xf')]=_0x19206f['active']||![];this[_0x3342('0x10')]=_0x19206f[_0x3342('0xc')];this['scheduledat']=_0x19206f[_0x3342('0x11')];this[_0x3342('0x12')]=_0x19206f['countbusyretry']||0x0;this['countcongestionretry']=_0x19206f[_0x3342('0x13')]||0x0;this[_0x3342('0x14')]=_0x19206f[_0x3342('0x14')]||0x0;this[_0x3342('0x15')]=(_0x19206f[_0x3342('0x12')]||0x0)+(_0x19206f[_0x3342('0x13')]||0x0)+(_0x19206f[_0x3342('0x14')]||0x0)+(_0x19206f[_0x3342('0x16')]||0x0)+(_0x19206f[_0x3342('0x17')]||0x0)+(_0x19206f['countabandonedretry']||0x0)+(_0x19206f[_0x3342('0x18')]||0x0)+(_0x19206f[_0x3342('0x19')]||0x0);this[_0x3342('0x16')]=_0x19206f['countnosuchnumberretry']||0x0;this[_0x3342('0x17')]=_0x19206f[_0x3342('0x17')]||0x0;this['countabandonedretry']=_0x19206f[_0x3342('0x1a')]||0x0;this[_0x3342('0x18')]=_0x19206f['countmachineretry']||0x0;this[_0x3342('0x19')]=_0x19206f['countagentrejectretry']||0x0;this[_0x3342('0x1b')]=_0x19206f[_0x3342('0x1b')];this[_0x3342('0x1c')]=_0x19206f[_0x3342('0x1c')];this[_0x3342('0x1d')]=_0x19206f[_0x3342('0x1d')];this[_0x3342('0x1e')]=_0x19206f[_0x3342('0x1e')];this['ContactId']=_0x19206f[_0x3342('0x1f')];this['ListId']=_0x19206f['ListId'];this[_0x3342('0x20')]=_['isNil'](_0x19206f['Agent'])?_0x19206f[_0x3342('0x20')]:_0x19206f['Agent']['id'];this[_0x3342('0x21')]=_0x19206f['VoiceQueueId'];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x3342('0x22')][_0x3342('0x23')]=function(){return util[_0x3342('0x24')]('\x22%s\x22\x20<%s>',this[_0x3342('0x25')],this[_0x3342('0x26')]);};module[_0x3342('0x27')]=Action;
\ No newline at end of file
index 392f7ec..afb8f41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c7b=['predictiveIntervalMultiplicativeFactor','message','originated','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','info','voice_queue_presence:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','preview','booked','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','ListId','catch','No\x20such\x20channel','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','clearZombieChannels','[action]','size','agentReadyId','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','createCustomerHistory','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','dialGlobalMaxRetry','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','[16]','Answer','talktime','sumBillable','BUSY','outboundBusyCallsDay','countbusyretry','Busy','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyRetryFrequency','NOANSWER','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','activeContact','countagentrejectretry','custom:agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','linkedid','[callProgressDetectingCustomer][machine]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','Congestion','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','status','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','merge','starttime','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','lookAgent','logLookAgent','clone','isFailure','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','transfer','[syncHangup][talking][transfer]','destuniqueid','syncHangupRequest','variables','filterKey','keys','variable','addVariable','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','moment','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hanguprequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6c7b,0x10b));var _0xb6c7=function(_0xe765dc,_0x2bba35){_0xe765dc=_0xe765dc-0x0;var _0x46c741=_0x6c7b[_0xe765dc];return _0x46c741;};'use strict';var util=require(_0xb6c7('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xb6c7('0x1'));var md5=require('md5');var Redis=require(_0xb6c7('0x2'));var config=require(_0xb6c7('0x3'));var logger=require(_0xb6c7('0x4'))('preview');var loggerAction=require(_0xb6c7('0x4'))(_0xb6c7('0x5'));var ami=require(_0xb6c7('0x6'));var rpcDb=require(_0xb6c7('0x7'));var cmHopperAdditionalPhone=require(_0xb6c7('0x8'));var Action=require('./action');var ut=require(_0xb6c7('0x9'));config[_0xb6c7('0xa')]=_[_0xb6c7('0xb')](config[_0xb6c7('0xa')],{'host':_0xb6c7('0xc'),'port':0x18eb});var io=require(_0xb6c7('0xd'))(new Redis(config[_0xb6c7('0xa')]));var Sequence=function(){};Sequence[_0xb6c7('0xe')]['enqueue']=function(_0x5cff81){this[_0xb6c7('0xf')]=this[_0xb6c7('0xf')]?this[_0xb6c7('0xf')][_0xb6c7('0x10')](_0x5cff81):_0x5cff81();};function Preview(_0x12e92f){this[_0xb6c7('0x11')]=new Sequence();this[_0xb6c7('0x12')]=_0x12e92f['voiceQueues'];this[_0xb6c7('0x13')]=_0x12e92f[_0xb6c7('0x13')];this[_0xb6c7('0x14')]={};this[_0xb6c7('0x15')]=_0x12e92f[_0xb6c7('0x15')];this[_0xb6c7('0x16')]=0x0;ami['on'](_0xb6c7('0x17'),this['syncOriginateResponse'][_0xb6c7('0x18')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0xb6c7('0x19'),this['syncHangupRequest'][_0xb6c7('0x18')](this));ami['on'](_0xb6c7('0x1a'),this[_0xb6c7('0x1b')][_0xb6c7('0x18')](this));ami['on'](_0xb6c7('0x1c'),this[_0xb6c7('0x1d')][_0xb6c7('0x18')](this));ami['on'](_0xb6c7('0x1e'),this[_0xb6c7('0x1f')][_0xb6c7('0x18')](this));ami['on'](_0xb6c7('0x20'),this[_0xb6c7('0x21')][_0xb6c7('0x18')](this));ami['on']('blindtransfer',this[_0xb6c7('0x22')][_0xb6c7('0x18')](this));this['loopCampaigns'](this[_0xb6c7('0x12')]);}function emit(_0x5a1c0a,_0x37f7cb,_0x5b7ebf){io['to'](_0x5a1c0a)[_0xb6c7('0x23')](_0x37f7cb,_0x5b7ebf);}function emitCampaignPreview(_0x4f2960){if(_0x4f2960[_0xb6c7('0x24')]===_0xb6c7('0x25')){var _0x4a4788={'id':_0x4f2960['id'],'name':_0x4f2960[_0xb6c7('0x26')],'strategy':_0x4f2960[_0xb6c7('0x27')],'answered':_0x4f2960[_0xb6c7('0x28')],'available':_0x4f2960[_0xb6c7('0x29')],'loggedIn':_0x4f2960[_0xb6c7('0x2a')],'pTalking':_0x4f2960[_0xb6c7('0x2b')],'sumBillable':_0x4f2960['sumBillable'],'sumDuration':_0x4f2960[_0xb6c7('0x2c')],'sumHoldTime':_0x4f2960[_0xb6c7('0x2d')]||0x0,'talking':_0x4f2960[_0xb6c7('0x2e')],'total':_0x4f2960[_0xb6c7('0x2f')],'type':_0x4f2960['type'],'unmanaged':_0x4f2960[_0xb6c7('0x30')],'abandoned':_0x4f2960[_0xb6c7('0x31')],'waiting':_0x4f2960['waiting'],'loggedInDb':_0x4f2960[_0xb6c7('0x32')],'dialActive':_0x4f2960[_0xb6c7('0x33')],'dialMethod':_0x4f2960[_0xb6c7('0x34')],'dialOriginateCallerIdName':_0x4f2960[_0xb6c7('0x35')],'dialOriginateCallerIdNumber':_0x4f2960['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x4f2960[_0xb6c7('0x36')],'dialPrefix':_0x4f2960['dialPrefix'],'outboundAnswerAgiCallsDay':_0x4f2960[_0xb6c7('0x37')],'outboundAnswerCallsDay':_0x4f2960[_0xb6c7('0x38')],'outboundBlacklistCallsDay':_0x4f2960[_0xb6c7('0x39')],'outboundBusyCallsDay':_0x4f2960['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x4f2960['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x4f2960['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x4f2960[_0xb6c7('0x3a')],'outboundDropCallsDayTimeout':_0x4f2960[_0xb6c7('0x3b')],'outboundNoAnswerCallsDay':_0x4f2960[_0xb6c7('0x3c')],'outboundNoSuchCallsDay':_0x4f2960[_0xb6c7('0x3d')],'outboundOriginateFailureCallsDay':_0x4f2960[_0xb6c7('0x3e')],'outboundReCallsDay':_0x4f2960[_0xb6c7('0x3f')],'outboundRejectCallsDay':_0x4f2960[_0xb6c7('0x40')],'outboundUnknownCallsDay':_0x4f2960[_0xb6c7('0x41')],'outboundAbandonedCallsDay':_0x4f2960[_0xb6c7('0x42')],'predictiveIntervalAnsweredCalls':_0x4f2960[_0xb6c7('0x43')],'predictiveIntervalAvgHoldtime':_0x4f2960['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x4f2960[_0xb6c7('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x4f2960['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x4f2960[_0xb6c7('0x45')],'predictiveIntervalErlangCalls':_0x4f2960[_0xb6c7('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x4f2960[_0xb6c7('0x47')],'predictiveIntervalHitRate':_0x4f2960[_0xb6c7('0x48')],'predictiveIntervalMultiplicativeFactor':_0x4f2960[_0xb6c7('0x49')],'predictiveIntervalPauses':_0x4f2960['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x4f2960['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x4f2960['predictiveIntervalTotalCalls'],'message':_0x4f2960[_0xb6c7('0x4a')],'originated':_0x4f2960[_0xb6c7('0x4b')],'erlangCalls':_0x4f2960['erlangCalls'],'erlangCallToSecond':_0x4f2960[_0xb6c7('0x4c')],'erlangAbandonmentRate':_0x4f2960[_0xb6c7('0x4d')],'erlangBusyFactor':_0x4f2960['erlangBusyFactor'],'startPredictive':_0x4f2960[_0xb6c7('0x4e')],'startProgressive':_0x4f2960[_0xb6c7('0x4f')]};if(_0x4f2960[_0xb6c7('0x50')]){_0x4a4788[_0xb6c7('0x50')]={'id':_0x4f2960[_0xb6c7('0x50')]['id'],'name':_0x4f2960[_0xb6c7('0x50')]['name'],'active':_0x4f2960[_0xb6c7('0x50')][_0xb6c7('0x51')],'callerid':_0x4f2960[_0xb6c7('0x50')][_0xb6c7('0x52')]};}if(_0x4f2960[_0xb6c7('0x53')]){_0x4a4788[_0xb6c7('0x53')]={'id':_0x4f2960[_0xb6c7('0x53')]['id'],'name':_0x4f2960['Interval']['name']};}var _0x3bae95=md5(JSON[_0xb6c7('0x54')](_0x4a4788));if(_0x4f2960[_0xb6c7('0x55')]!==_0x3bae95){_0x4f2960[_0xb6c7('0x55')]=_0x3bae95;emit(util[_0xb6c7('0x56')](_0xb6c7('0x57'),_0x4a4788[_0xb6c7('0x26')]),_0xb6c7('0x58'),_0x4a4788);}}}function emitVoiceQueueChannelRemove(_0x203818){logger[_0xb6c7('0x59')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xb6c7('0x54')](_0x203818));emit(util['format']('voice:queue:%s',_0x203818[_0xb6c7('0x26')]),'voice_queue_channel:remove',_0x203818);io[_0xb6c7('0x23')](_0xb6c7('0x5a'),_0x203818);}function notSendMessagesQueue(_0x53f831){if(_0x53f831[_0xb6c7('0x5b')]){if(_0x53f831[_0xb6c7('0x4b')]===0x0&&_0x53f831[_0xb6c7('0x2b')]===0x0){_0x53f831[_0xb6c7('0x5b')]=![];_0x53f831[_0xb6c7('0x29')]=0x0;_0x53f831['paused']=0x0;_0x53f831['message']=_0xb6c7('0x5c');ut[_0xb6c7('0x5d')](_0xb6c7('0x5e'),_0x53f831[_0xb6c7('0x26')]+'\x20is\x20not\x20active');}else{_0x53f831['message']=_0xb6c7('0x5f');ut[_0xb6c7('0x5d')](_0xb6c7('0x5e'),_0x53f831[_0xb6c7('0x26')]+_0xb6c7('0x60'));}emitCampaignPreview(_0x53f831);}}Preview['prototype']['loopCampaigns']=function(){var _0x5c057c=this;setInterval(function(){_0x5c057c[_0xb6c7('0x61')]();},0x7cf);};Preview[_0xb6c7('0xe')][_0xb6c7('0x61')]=function(){var _0x5050c9=this[_0xb6c7('0x12')];this[_0xb6c7('0x16')]+=0x1;for(var _0x51ede4 in _0x5050c9){if(_0x5050c9[_0xb6c7('0x62')](_0x51ede4)&&(_0x5050c9[_0x51ede4][_0xb6c7('0x34')]===_0xb6c7('0x63')||_0x5050c9[_0x51ede4][_0xb6c7('0x34')]===_0xb6c7('0x64'))&&_0x5050c9[_0x51ede4]['type']===_0xb6c7('0x25')){if(this[_0xb6c7('0x16')]>0x7){this[_0xb6c7('0x16')]=0x0;this['clearZombieChannels']();}}if(_0x5050c9['hasOwnProperty'](_0x51ede4)&&_0x5050c9[_0x51ede4][_0xb6c7('0x34')]===_0xb6c7('0x63')&&_0x5050c9[_0x51ede4][_0xb6c7('0x24')]==='outbound'){if(_0x5050c9[_0x51ede4]['dialActive']){this['setMessage'](_0x5050c9[_0x51ede4]);if(_0x5050c9[_0x51ede4][_0xb6c7('0x65')])this[_0xb6c7('0x66')](_0x5050c9[_0x51ede4]);}else{notSendMessagesQueue(_0x5050c9[_0x51ede4]);}}}};Preview[_0xb6c7('0xe')][_0xb6c7('0x67')]=function(_0x281247){var _0x332093=this;this[_0xb6c7('0x11')]['enqueue'](function(){if(!_[_0xb6c7('0x68')](_0x332093[_0xb6c7('0x14')][_0x281247])){loggerAction[_0xb6c7('0x59')](_0xb6c7('0x69'),_0x281247,_0xb6c7('0x6a'),_0x332093['actions'][_0x281247][_0xb6c7('0x6b')],_0xb6c7('0x6c'),JSON[_0xb6c7('0x54')](_0x332093[_0xb6c7('0x12')][_0x332093[_0xb6c7('0x14')][_0x281247][_0xb6c7('0x6b')]]['originated']),_0xb6c7('0x6d'),JSON[_0xb6c7('0x54')](_0x332093[_0xb6c7('0x12')][_0x332093[_0xb6c7('0x14')][_0x281247][_0xb6c7('0x6b')]][_0xb6c7('0x2b')]),JSON[_0xb6c7('0x54')](_0x332093['actions'][_0x281247]['dialAnswer']),JSON['stringify'](_[_0xb6c7('0x6e')](_0x332093[_0xb6c7('0x14')][_0x281247],[_0xb6c7('0x6f'),_0xb6c7('0x70'),_0xb6c7('0x71'),_0xb6c7('0x72')])));return ami['Action']({'action':'status','channel':_0x332093[_0xb6c7('0x14')][_0x281247]['channel']})[_0xb6c7('0x73')](function(_0x8c5b9c){if(_0x8c5b9c[_0xb6c7('0x4a')]===_0xb6c7('0x74')){setTimeout(function(){if(_0x332093[_0xb6c7('0x14')][_0x281247]){ut['updateOriginated'](_0x332093[_0xb6c7('0x12')][_0x332093['actions'][_0x281247][_0xb6c7('0x6b')]],_0xb6c7('0x75'));if(_0x332093[_0xb6c7('0x14')][_0x281247][_0xb6c7('0x76')]===!![]){ut[_0xb6c7('0x77')](_0x332093['campaignsPreview'][_0x332093[_0xb6c7('0x14')][_0x281247][_0xb6c7('0x6b')]],_0xb6c7('0x75'));ut[_0xb6c7('0x78')](_0xb6c7('0x79')+_0x281247,_0x332093[_0xb6c7('0x14')][_0x281247][_0xb6c7('0x6b')]);}ut[_0xb6c7('0x78')]('[Dialer][checkChannel][Preview]'+_0x281247,_0x332093[_0xb6c7('0x14')][_0x281247][_0xb6c7('0x6b')]);delete _0x332093[_0xb6c7('0x14')][_0x281247];}},0x2328);}});}});};Preview[_0xb6c7('0xe')][_0xb6c7('0x7a')]=function(){var _0x360bb3=this;loggerAction['info'](_0xb6c7('0x7b'),_[_0xb6c7('0x7c')](this[_0xb6c7('0x14')]));for(var _0x1c47db in this['actions']){if(_0x360bb3[_0xb6c7('0x14')][_0xb6c7('0x62')](_0x1c47db)){_0x360bb3[_0xb6c7('0x67')](_0x1c47db);}}};Preview[_0xb6c7('0xe')][_0xb6c7('0x66')]=function(_0x17658a){var _0x11d67a=this;rpcDb['getContactRecallMe'](_0x17658a['id'],ut[_0xb6c7('0x7d')](this[_0xb6c7('0x15')]))[_0xb6c7('0x7e')](function(_0x550376){if(!_[_0xb6c7('0x68')](_0x550376)){for(var _0x1412ef=0x0;_0x1412ef<_0x550376[_0xb6c7('0x7f')];_0x1412ef+=0x1){if(ut[_0xb6c7('0x80')](_0x550376[_0x1412ef][_0xb6c7('0x81')])<_0x17658a['dialRecallMeTimeout']*0x3c){if(_0x550376[_0x1412ef][_0xb6c7('0x82')]&&!_0x550376[_0x1412ef][_0xb6c7('0x82')][_0xb6c7('0x83')]){_0x11d67a[_0xb6c7('0x84')](_0x550376[_0x1412ef]['id'])[_0xb6c7('0x7e')](ut[_0xb6c7('0x85')]('[RecallMe]'))[_0xb6c7('0x73')](ut[_0xb6c7('0x85')]('[RecallMe]'));}else{rpcDb[_0xb6c7('0x86')](_0x550376[_0x1412ef]['id']);}}else{var _0x1a41f7=new Action(_0x550376[_0x1412ef],_0x17658a);_0x1a41f7['starttime']=moment()[_0xb6c7('0x56')](_0xb6c7('0x87'));_0x17658a[_0xb6c7('0x3f')]+=0x1;ut[_0xb6c7('0x88')](_0x1a41f7,0x17,_0xb6c7('0x89'));if(_0x17658a[_0xb6c7('0x8a')]){rpcDb[_0xb6c7('0x8b')](ut['createBody'](_0x550376[_0x1412ef]));rpcDb['createCustomerHistory'](_0x1a41f7,_0xb6c7('0x8c'));}else{ut['logCustomer'](_0x1a41f7,0x16,_0xb6c7('0x8d'));rpcDb['createCustomerHistory'](_0x1a41f7,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x1a41f7,_0xb6c7('0x8e'));}}}}})['catch'](ut[_0xb6c7('0x85')]('[getContactRecallMe]'));};Preview[_0xb6c7('0xe')]['setMessage']=function(_0x46495d){_0x46495d[_0xb6c7('0x5b')]=!![];if(ut['IsNotLoggedIn'](_0x46495d['loggedIn'])){_0x46495d[_0xb6c7('0x4a')]=_0xb6c7('0x8f');}else if(!ut[_0xb6c7('0x90')](_0x46495d[_0xb6c7('0x33')])){_0x46495d[_0xb6c7('0x4a')]=_0xb6c7('0x5c');}else if(!this[_0xb6c7('0x91')](_0x46495d[_0xb6c7('0x50')])){if(!this[_0xb6c7('0x91')](_0x46495d['TrunkBackup'])){_0x46495d[_0xb6c7('0x4a')]=_0xb6c7('0x92');}else{_0x46495d['message']=_0xb6c7('0x93');}}else{_0x46495d['message']='ACTIVE';}emitCampaignPreview(_0x46495d);};Preview[_0xb6c7('0xe')][_0xb6c7('0x94')]=function(_0x4cbac2,_0x71b69f,_0x7e7bfa){var _0x5685fe=this;var _0x286dfc=this[_0xb6c7('0x14')][_0x71b69f];var _0x55a63e=this[_0xb6c7('0x12')][_0x286dfc[_0xb6c7('0x6b')]];var _0x515794;var _0x39080f=![];var _0x5237a4=0x2;var _0x267e41=0x3;if(_0x55a63e){switch(_0x7e7bfa){case'1':_0x55a63e[_0xb6c7('0x3d')]+=0x1;_0x286dfc[_0xb6c7('0x95')]+=0x1;_0x286dfc[_0xb6c7('0x96')]=ut[_0xb6c7('0x97')](_0x286dfc);ut[_0xb6c7('0x88')](_0x286dfc,0x0,_0xb6c7('0x98'));ami[_0xb6c7('0x23')](_0xb6c7('0x99'),ut[_0xb6c7('0x9a')](_0x286dfc,_0xb6c7('0x9b')));rpcDb[_0xb6c7('0x9c')](_0x286dfc,_0xb6c7('0x9d'));_0x5685fe[_0xb6c7('0x9e')](_0x286dfc,'0',_0x55a63e)[_0xb6c7('0x7e')](function(_0x1f4830){_0x39080f=_0x1f4830[_0xb6c7('0x9f')]==0x1;_0x5237a4=_0x55a63e[_0xb6c7('0xa0')];_0x267e41=_0x55a63e['callAdditionalPhoneAfterMin'];if(!_0x39080f){if(ut['totalGlobal'](_0x286dfc)>=_0x55a63e[_0xb6c7('0xa1')]){_0x515794=ut['cloneAction'](_0x286dfc,0xf,_0xb6c7('0xa2'));rpcDb[_0xb6c7('0xa3')](_0x515794,_0xb6c7('0xa4'));}else{if(_0x286dfc[_0xb6c7('0x95')]>=_0x55a63e[_0xb6c7('0xa5')]){rpcDb['createCustomerFinal'](_0x286dfc,_0xb6c7('0xa4'));}else{rpcDb[_0xb6c7('0xa6')](ut[_0xb6c7('0xa7')](_0x286dfc,_0xb6c7('0x95'),_0x55a63e[_0xb6c7('0xa0')]),_0x286dfc[_0xb6c7('0xa8')],_0x286dfc['activeContact']);}}delete this[_0xb6c7('0x14')][_0x4cbac2['linkedid']];}else{_0x286dfc[_0xb6c7('0x95')]++;logger[_0xb6c7('0x59')](_0xb6c7('0xa9'),_0x286dfc[_0xb6c7('0x95')]);logger[_0xb6c7('0x59')]('id',_0x286dfc[_0xb6c7('0xaa')]);_0x5685fe[_0xb6c7('0xab')]({'id':_0x286dfc[_0xb6c7('0xaa')],'field':{'countnosuchnumberretry':_0x286dfc[_0xb6c7('0x95')]}})[_0xb6c7('0x7e')](function(){_0x5685fe[_0xb6c7('0xac')](_0x286dfc,_0x5237a4,_0x267e41)[_0xb6c7('0x7e')](function(){});});}});break;case _0xb6c7('0xad'):var _0x111958=moment()[_0xb6c7('0x56')](_0xb6c7('0x87'));_0x286dfc[_0xb6c7('0xae')]=_0x111958;_0x286dfc[_0xb6c7('0xaf')]=_0x111958;_0x286dfc[_0xb6c7('0x76')]=!![];_0x55a63e[_0xb6c7('0x2b')]+=0x1;logger[_0xb6c7('0x59')](_0xb6c7('0xb0'),_0x286dfc[_0xb6c7('0xb1')],_0xb6c7('0xb2'),_0x55a63e[_0xb6c7('0x26')],_0xb6c7('0x6d'),_0x55a63e[_0xb6c7('0x2b')]);ami[_0xb6c7('0x23')](_0xb6c7('0xb3'),ut[_0xb6c7('0x9a')](_0x286dfc,_0xb6c7('0xb4'),this[_0xb6c7('0x12')][_0x286dfc[_0xb6c7('0x6b')]]));if(_0x55a63e[_0xb6c7('0xb5')]){ami[_0xb6c7('0x23')](_0xb6c7('0xb6'),ut[_0xb6c7('0xb7')](_0x286dfc));}break;case'16':ami[_0xb6c7('0x23')]('custom:agentcomplete',ut[_0xb6c7('0x9a')](_0x286dfc,'complete',this[_0xb6c7('0x12')][_0x286dfc[_0xb6c7('0x6b')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x286dfc,_0xb6c7('0xb8')));_0x55a63e[_0xb6c7('0x38')]+=0x1;_0x55a63e[_0xb6c7('0x2f')]+=0x1;_0x55a63e[_0xb6c7('0x28')]+=0x1;ut['decrementTalkink'](_0x55a63e,_0xb6c7('0xb9'));_0x286dfc[_0xb6c7('0x96')]=ut[_0xb6c7('0x97')](_0x286dfc);ut[_0xb6c7('0x88')](_0x286dfc,0x4,_0xb6c7('0xba'));rpcDb[_0xb6c7('0x9c')](_0x286dfc,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xb6c7('0xa3')](_0x286dfc,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x286dfc);_0x55a63e['sumDuration']+=_0x286dfc[_0xb6c7('0xbb')];_0x55a63e[_0xb6c7('0xbc')]+=_0x286dfc[_0xb6c7('0xbb')];logger[_0xb6c7('0x59')]('[syncHangup][talking][decrement]',_0x286dfc['uniqueid'],_0xb6c7('0xb2'),_0x55a63e['name'],_0xb6c7('0x6d'),_0x55a63e[_0xb6c7('0x2b')]);delete this[_0xb6c7('0x14')][_0x4cbac2['linkedid']];break;case _0xb6c7('0xbd'):_0x55a63e[_0xb6c7('0xbe')]+=0x1;_0x286dfc[_0xb6c7('0xbf')]+=0x1;_0x286dfc['countglobal']=ut[_0xb6c7('0x97')](_0x286dfc);ut['logCustomer'](_0x286dfc,0x5,_0xb6c7('0xc0'));_0x5237a4=_0x55a63e['dialBusyRetryFrequency'];_0x267e41=_0x55a63e[_0xb6c7('0xc1')];ami[_0xb6c7('0x23')]('custom:agentbusy',ut['buildObj'](_0x286dfc,_0xb6c7('0xc2')));rpcDb[_0xb6c7('0x9c')](_0x286dfc,_0xb6c7('0xc3'));_0x5685fe[_0xb6c7('0x9e')](_0x286dfc,'5',_0x55a63e)[_0xb6c7('0x7e')](function(_0x55ac4d){_0x39080f=_0x55ac4d[_0xb6c7('0x9f')]==0x1;if(!_0x39080f){if(ut['totalGlobal'](_0x286dfc)>=_0x55a63e['dialGlobalMaxRetry']){_0x515794=ut[_0xb6c7('0xc4')](_0x286dfc,0xf,_0xb6c7('0xa2'));rpcDb[_0xb6c7('0xa3')](_0x515794,_0xb6c7('0xc5'));}else{if(_0x286dfc['countbusyretry']>=_0x55a63e['dialBusyMaxRetry']){rpcDb[_0xb6c7('0xa3')](_0x286dfc,_0xb6c7('0xc3'));}else{rpcDb[_0xb6c7('0xa6')](ut[_0xb6c7('0xa7')](_0x286dfc,_0xb6c7('0xbf'),_0x55a63e[_0xb6c7('0xc6')]),_0x286dfc[_0xb6c7('0xa8')],_0x286dfc['activeContact']);}}}else{_0x286dfc['countbusyretry']++;_0x5685fe['incrementPreviewCounters']({'id':_0x286dfc[_0xb6c7('0xaa')],'field':{'countbusyretry':_0x286dfc[_0xb6c7('0xbf')]}})['then'](function(){_0x5685fe[_0xb6c7('0xac')](_0x286dfc,_0x5237a4,_0x267e41)[_0xb6c7('0x7e')](function(){});});}});break;case _0xb6c7('0xc7'):_0x55a63e[_0xb6c7('0x3c')]+=0x1;_0x286dfc['countnoanswerretry']+=0x1;_0x286dfc['countglobal']=ut[_0xb6c7('0x97')](_0x286dfc);ut['logCustomer'](_0x286dfc,0x3,_0xb6c7('0xc8'));_0x5237a4=_0x55a63e['dialNoAnswerRetryFrequency'];_0x267e41=_0x55a63e['callAdditionalPhoneAfterMin'];ami['emit'](_0xb6c7('0xc9'),ut['buildObj'](_0x286dfc,_0xb6c7('0xca')));rpcDb['createCustomerHistory'](_0x286dfc,_0xb6c7('0xcb'));_0x5685fe['verifyAdditionalPhones'](_0x286dfc,'3',_0x55a63e)[_0xb6c7('0x7e')](function(_0x428c4a){_0x39080f=_0x428c4a[_0xb6c7('0x9f')]==0x1;if(!_0x39080f){if(ut[_0xb6c7('0x97')](_0x286dfc)>=_0x55a63e['dialGlobalMaxRetry']){_0x515794=ut['cloneAction'](_0x286dfc,0xf,_0xb6c7('0xa2'));rpcDb[_0xb6c7('0xa3')](_0x515794,_0xb6c7('0xcc'));}else{if(_0x286dfc[_0xb6c7('0xcd')]>=_0x55a63e[_0xb6c7('0xce')]){rpcDb[_0xb6c7('0xa3')](_0x286dfc,_0xb6c7('0xcb'));}else{rpcDb[_0xb6c7('0xa6')](ut[_0xb6c7('0xa7')](_0x286dfc,_0xb6c7('0xcd'),_0x55a63e[_0xb6c7('0xcf')]),_0x286dfc[_0xb6c7('0xa8')],_0x286dfc['activeContact']);}}}else{_0x286dfc[_0xb6c7('0xcd')]++;_0x5685fe[_0xb6c7('0xab')]({'id':_0x286dfc[_0xb6c7('0xaa')],'field':{'countnoanswerretry':_0x286dfc[_0xb6c7('0xcd')]}})['then'](function(){_0x5685fe['swapAdditionalPhones'](_0x286dfc,_0x5237a4,_0x267e41)[_0xb6c7('0x7e')](function(){});});}});break;case _0xb6c7('0xd0'):_0x55a63e[_0xb6c7('0xd1')]+=0x1;_0x286dfc['countcongestionretry']+=0x1;_0x286dfc[_0xb6c7('0x96')]=ut[_0xb6c7('0x97')](_0x286dfc);ut['logCustomer'](_0x286dfc,0x8,'Congestion');_0x5237a4=_0x55a63e['dialCongestionRetryFrequency'];_0x267e41=_0x55a63e['callAdditionalPhoneAfterMin'];ami['emit']('custom:agentcongestion',ut[_0xb6c7('0x9a')](_0x286dfc,_0xb6c7('0xd2')));rpcDb[_0xb6c7('0x9c')](_0x286dfc,'[callProgressDetectingCustomer][logCongestion]');_0x5685fe[_0xb6c7('0x9e')](_0x286dfc,'8',_0x55a63e)[_0xb6c7('0x7e')](function(_0x1d0b3a){_0x39080f=_0x1d0b3a['additional']==0x1;if(!_0x39080f){if(ut['totalGlobal'](_0x286dfc)>=_0x55a63e[_0xb6c7('0xa1')]){_0x515794=ut['cloneAction'](_0x286dfc,0xf,_0xb6c7('0xa2'));rpcDb[_0xb6c7('0xa3')](_0x515794,_0xb6c7('0xd3'));}else{if(_0x286dfc[_0xb6c7('0xd4')]>=_0x55a63e['dialCongestionMaxRetry']){rpcDb[_0xb6c7('0xa3')](_0x286dfc,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xb6c7('0xa6')](ut['scheduledAt'](_0x286dfc,_0xb6c7('0xd4'),_0x55a63e[_0xb6c7('0xc6')]),_0x286dfc[_0xb6c7('0xa8')],_0x286dfc[_0xb6c7('0xd5')]);}}}else{_0x286dfc[_0xb6c7('0xd4')]++;_0x5685fe[_0xb6c7('0xab')]({'id':_0x286dfc[_0xb6c7('0xaa')],'field':{'countcongestionretry':_0x286dfc[_0xb6c7('0xd4')]}})['then'](function(){_0x5685fe[_0xb6c7('0xac')](_0x286dfc,_0x5237a4,_0x267e41)['then'](function(){});});}});break;case'CANCEL':_0x55a63e[_0xb6c7('0x40')]+=0x1;_0x286dfc[_0xb6c7('0xd6')]+=0x1;_0x286dfc[_0xb6c7('0x96')]=ut[_0xb6c7('0x97')](_0x286dfc);ut[_0xb6c7('0x88')](_0x286dfc,0x14,'AgentReject');_0x5237a4=_0x55a63e['dialAgentRejectRetryFrequency'];_0x267e41=_0x55a63e[_0xb6c7('0xc1')];ami[_0xb6c7('0x23')](_0xb6c7('0xd7'),ut[_0xb6c7('0x9a')](_0x286dfc,'agentreject'));rpcDb['createCustomerHistory'](_0x286dfc,_0xb6c7('0xd8'));_0x5685fe['verifyAdditionalPhones'](_0x286dfc,'20',_0x55a63e)['then'](function(_0x50f547){_0x39080f=_0x50f547[_0xb6c7('0x9f')]==0x1;if(!_0x39080f){if(ut[_0xb6c7('0x97')](_0x286dfc)>=_0x55a63e[_0xb6c7('0xa1')]){_0x515794=ut[_0xb6c7('0xc4')](_0x286dfc,0x14,_0xb6c7('0xd9'));rpcDb[_0xb6c7('0xa3')](_0x515794,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x286dfc[_0xb6c7('0xd6')]>=_0x55a63e['dialAgentRejectMaxRetry']){rpcDb[_0xb6c7('0xa3')](_0x286dfc,_0xb6c7('0xda'));}else{rpcDb['rescheduleContact'](ut[_0xb6c7('0xa7')](_0x286dfc,_0xb6c7('0xd6'),_0x55a63e[_0xb6c7('0xdb')]),_0x286dfc[_0xb6c7('0xa8')],_0x286dfc[_0xb6c7('0xd5')]);}}}else{_0x286dfc[_0xb6c7('0xcd')]++;_0x5685fe[_0xb6c7('0xab')]({'id':_0x286dfc['idContact'],'field':{'countnoanswerretry':_0x286dfc[_0xb6c7('0xcd')]}})['then'](function(){_0x5685fe[_0xb6c7('0xac')](_0x286dfc,_0x5237a4,_0x267e41)[_0xb6c7('0x7e')](function(){});});}});break;case _0xb6c7('0xdc'):_0x55a63e[_0xb6c7('0x42')]+=0x1;_0x286dfc[_0xb6c7('0xdd')]+=0x1;_0x286dfc[_0xb6c7('0x96')]=ut[_0xb6c7('0x97')](_0x286dfc);ut['logCustomer'](_0x286dfc,0xb,_0xb6c7('0xde'));rpcDb[_0xb6c7('0x9c')](_0x286dfc,'[callProgressDetectingCustomer][logAbandoned]');_0x5685fe[_0xb6c7('0x9e')](_0x286dfc,'11',_0x55a63e)[_0xb6c7('0x7e')](function(_0x3d36ba){_0x39080f=_0x3d36ba[_0xb6c7('0x9f')]==0x1;if(!_0x39080f){if(ut['totalGlobal'](_0x286dfc)>=_0x55a63e[_0xb6c7('0xa1')]){_0x515794=ut[_0xb6c7('0xc4')](_0x286dfc,0xf,_0xb6c7('0xa2'));rpcDb[_0xb6c7('0xa3')](_0x515794,_0xb6c7('0xdf'));}else{if(_0x286dfc[_0xb6c7('0xe0')]>=_0x55a63e[_0xb6c7('0xe1')]){rpcDb[_0xb6c7('0xa3')](_0x286dfc,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xb6c7('0xa6')](ut[_0xb6c7('0xa7')](_0x286dfc,_0xb6c7('0xdd'),_0x55a63e[_0xb6c7('0xe2')]),_0x286dfc[_0xb6c7('0xa8')],_0x286dfc['activeContact']);}}}else{_0x286dfc[_0xb6c7('0xcd')]++;_0x5685fe[_0xb6c7('0xab')]({'id':_0x286dfc[_0xb6c7('0xaa')],'field':{'countnoanswerretry':_0x286dfc[_0xb6c7('0xcd')]}})[_0xb6c7('0x7e')](function(){_0x5685fe['swapAdditionalPhones'](_0x286dfc,_0x5237a4,_0x267e41)[_0xb6c7('0x7e')](function(){});});}});break;case'18':_0x55a63e[_0xb6c7('0x41')]+=0x1;_0x286dfc[_0xb6c7('0xe3')]+=0x1;_0x286dfc['countglobal']=ut[_0xb6c7('0x97')](_0x286dfc);ut[_0xb6c7('0x88')](_0x286dfc,0x12,_0x4cbac2[_0xb6c7('0xe4')]||_0x4cbac2[_0xb6c7('0xe5')]);ami[_0xb6c7('0x23')](_0xb6c7('0xe6'),ut[_0xb6c7('0x9a')](_0x286dfc,_0xb6c7('0xe7')));rpcDb[_0xb6c7('0x9c')](_0x286dfc,_0xb6c7('0xe8'));_0x5685fe['verifyAdditionalPhones'](_0x286dfc,'18',_0x55a63e)[_0xb6c7('0x7e')](function(_0xc1a49c){_0x39080f=_0xc1a49c['additional']==0x1;if(!_0x39080f){if(ut[_0xb6c7('0x97')](_0x286dfc)>=_0x55a63e[_0xb6c7('0xa1')]){_0x515794=ut[_0xb6c7('0xc4')](_0x286dfc,0x12,_0xb6c7('0xa2'));rpcDb[_0xb6c7('0xa3')](_0x515794,_0xb6c7('0xe8'));}else{rpcDb['createCustomerFinal'](_0x286dfc,_0xb6c7('0xe8'));}}else{_0x286dfc[_0xb6c7('0xcd')]++;_0x5685fe[_0xb6c7('0xab')]({'id':_0x286dfc[_0xb6c7('0xaa')],'field':{'countnoanswerretry':_0x286dfc[_0xb6c7('0xcd')]}})[_0xb6c7('0x7e')](function(){_0x5685fe['swapAdditionalPhones'](_0x286dfc,_0x5237a4,_0x267e41)[_0xb6c7('0x7e')](function(){});});}});delete this[_0xb6c7('0x14')][_0x4cbac2[_0xb6c7('0xe9')]];break;case'19':_0x55a63e[_0xb6c7('0x41')]+=0x1;_0x286dfc[_0xb6c7('0x96')]=ut[_0xb6c7('0x97')](_0x286dfc);ut['logCustomer'](_0x286dfc,0x13,_0x4cbac2[_0xb6c7('0xe4')]||_0x4cbac2[_0xb6c7('0xe5')]);ami[_0xb6c7('0x23')](_0xb6c7('0xe6'),ut[_0xb6c7('0x9a')](_0x286dfc,_0xb6c7('0xe7')));rpcDb['createCustomerHistory'](_0x286dfc,_0xb6c7('0xea'));_0x5685fe['verifyAdditionalPhones'](_0x286dfc,'18',_0x55a63e)[_0xb6c7('0x7e')](function(_0x4b3c3a){_0x39080f=_0x4b3c3a[_0xb6c7('0x9f')]==0x1;if(!_0x39080f){if(ut[_0xb6c7('0x97')](_0x286dfc)>=_0x55a63e[_0xb6c7('0xa1')]){_0x515794=ut[_0xb6c7('0xc4')](_0x286dfc,0xf,_0xb6c7('0xa2'));rpcDb['createCustomerFinal'](_0x515794,_0xb6c7('0xea'));}else{rpcDb['createCustomerFinal'](_0x286dfc,_0xb6c7('0xea'));}}else{_0x286dfc['countnoanswerretry']++;_0x5685fe[_0xb6c7('0xab')]({'id':_0x286dfc[_0xb6c7('0xaa')],'field':{'countnoanswerretry':_0x286dfc['countnoanswerretry']}})[_0xb6c7('0x7e')](function(){_0x5685fe['swapAdditionalPhones'](_0x286dfc,_0x5237a4,_0x267e41)[_0xb6c7('0x7e')](function(){});});}});delete this[_0xb6c7('0x14')][_0x4cbac2['linkedid']];break;default:if(_0x286dfc[_0xb6c7('0x76')]){ut[_0xb6c7('0x77')](_0x55a63e,'[default]');ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x55a63e['name'],_0x4cbac2);}_0x55a63e[_0xb6c7('0x41')]+=0x1;_0x286dfc[_0xb6c7('0x96')]=ut[_0xb6c7('0x97')](_0x286dfc);ut[_0xb6c7('0x88')](_0x286dfc,0xc,_0x4cbac2[_0xb6c7('0xe4')]||_0x4cbac2[_0xb6c7('0xe5')]);_0x5237a4=_0x55a63e[_0xb6c7('0xdb')];_0x267e41=_0x55a63e[_0xb6c7('0xc1')];rpcDb[_0xb6c7('0x9c')](_0x286dfc,_0xb6c7('0xeb'));_0x5685fe[_0xb6c7('0x9e')](_0x286dfc,'20',_0x55a63e)[_0xb6c7('0x7e')](function(_0x4dd46f){_0x39080f=_0x4dd46f[_0xb6c7('0x9f')]==0x1;if(!_0x39080f){if(ut[_0xb6c7('0x97')](_0x286dfc)>=_0x55a63e[_0xb6c7('0xa1')]){_0x515794=ut[_0xb6c7('0xc4')](_0x286dfc,0xf,_0xb6c7('0xa2'));rpcDb[_0xb6c7('0xa3')](_0x515794,_0xb6c7('0xec'));}else{rpcDb[_0xb6c7('0xa3')](_0x286dfc,_0xb6c7('0xec'));}delete this['actions'][_0x4cbac2[_0xb6c7('0xe9')]];}else{_0x5685fe['swapAdditionalPhones'](_0x286dfc,_0x5237a4,_0x267e41)[_0xb6c7('0x7e')](function(_0x2e830b){});}});}if(!(_0x286dfc[_0xb6c7('0x76')]&&_0x7e7bfa==='16')){ut[_0xb6c7('0xed')](_0x55a63e,'[callProgressDetectingCustomer]');logger['info'](_0xb6c7('0xee'),_0x286dfc[_0xb6c7('0xb1')],_0xb6c7('0xb2'),_0x55a63e[_0xb6c7('0x26')],'originated:\x20',_0x55a63e[_0xb6c7('0x4b')]);}if(_0x7e7bfa!==_0xb6c7('0xad')){delete this[_0xb6c7('0x14')][_0x4cbac2['linkedid']];delete this['actions'][_0x4cbac2[_0xb6c7('0xef')]];}}};Preview[_0xb6c7('0xe')][_0xb6c7('0xf0')]=function(_0x48e65b,_0x5b52e0,_0x519328){if(_[_0xb6c7('0xf1')](_0x5b52e0)&&_0xb6c7('0xf2')!==typeof _0x5b52e0){return;}if(_[_0xb6c7('0xf1')](_0x519328)&&_0xb6c7('0xf2')!==typeof _0x519328){return;}switch(_0x519328[_0xb6c7('0xf3')]){case'0':ut['logAgent'](_0x48e65b,0x0,'NoSuchNumber');rpcDb[_0xb6c7('0xf4')](_0x48e65b,_0xb6c7('0xf5'));break;case'3':ut['logAgent'](_0x48e65b,0x3,_0xb6c7('0xc8'));rpcDb[_0xb6c7('0xf4')](_0x48e65b,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xb6c7('0xf6')](_0x48e65b,0x5,_0xb6c7('0xc0'));rpcDb[_0xb6c7('0xf4')](_0x48e65b,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xb6c7('0xf6')](_0x48e65b,0x8,_0xb6c7('0xf7'));rpcDb[_0xb6c7('0xf4')](_0x48e65b,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0xb6c7('0xf6')](_0x48e65b,0x16,_0xb6c7('0xf8'));rpcDb[_0xb6c7('0xf4')](_0x48e65b,_0xb6c7('0xf9'));break;default:ut[_0xb6c7('0xf6')](_0x48e65b,0xc,_0x519328[_0xb6c7('0xf3')]);rpcDb['createAgentHistory'](_0x48e65b,'[callProgressDetectingAgent][logCongestion]');}ut[_0xb6c7('0xed')](_0x5b52e0,_0xb6c7('0xfa'));logger[_0xb6c7('0x59')]('[originated][decrement][callProgressDetectingAgent]',_0x48e65b[_0xb6c7('0xb1')],_0xb6c7('0xb2'),_0x5b52e0[_0xb6c7('0x26')],_0xb6c7('0x6c'),_0x5b52e0[_0xb6c7('0x4b')]);delete this['actions'][_0x48e65b[_0xb6c7('0xb1')]];};Preview[_0xb6c7('0xe')]['verifyAdditionalPhones']=function(_0xc961bf,_0x20c6ef,_0x17c1d6){return BPromise[_0xb6c7('0xfb')]()['then'](cmHopperAdditionalPhone[_0xb6c7('0x9e')](_0xc961bf,_0x20c6ef,_0x17c1d6))[_0xb6c7('0x73')](logger[_0xb6c7('0x59')](_0xb6c7('0xfc')));};Preview[_0xb6c7('0xe')]['swapAdditionalPhones']=function(_0x56212a,_0x1773e0,_0x49ca58){return BPromise[_0xb6c7('0xfb')]()[_0xb6c7('0x7e')](cmHopperAdditionalPhone[_0xb6c7('0xac')](_0x56212a,_0x1773e0,_0x49ca58))[_0xb6c7('0x73')](logger[_0xb6c7('0x59')](_0xb6c7('0xfd')));};Preview[_0xb6c7('0xe')][_0xb6c7('0xab')]=function(_0x5a7e7){return BPromise[_0xb6c7('0xfb')]()[_0xb6c7('0x7e')](cmHopperAdditionalPhone[_0xb6c7('0xab')](_0x5a7e7))['catch'](logger['info'](_0xb6c7('0xfe')));};Preview[_0xb6c7('0xe')][_0xb6c7('0xff')]=function(_0x550f99,_0x44e74a,_0x96666c,_0x1c7638,_0x350d9a){var _0x51b9b2=this;return new BPromise(function(_0x3b0a7f,_0x599fe4){if(_[_0xb6c7('0x68')](_0x44e74a)||_[_0xb6c7('0x68')](_0x44e74a[_0xb6c7('0x100')])||_['isNil'](_0x44e74a[_0xb6c7('0x101')])||_[_0xb6c7('0x68')](_0x44e74a[_0xb6c7('0x71')])){_0x599fe4(ut[_0xb6c7('0x4a')](_0xb6c7('0x102'),_0x1c7638,_0x350d9a));return;}var _0x44dd19=uuid['v4']();var _0x1f2776=_0x51b9b2[_0xb6c7('0x12')][_0x44e74a['Queue'][_0xb6c7('0x26')]];var _0x227980=_0x96666c?_0x51b9b2[_0xb6c7('0x15')][_0x96666c]['id']:undefined;_0x51b9b2[_0xb6c7('0x14')][_0x44dd19]=new Action(_0x44e74a,_0x1f2776,_0x44dd19,_0x96666c,_0x227980);var _0x5dd7b1=_0x51b9b2[_0xb6c7('0x14')][_0x44dd19];_0x5dd7b1[_0xb6c7('0xa8')]=_0x1c7638;_0x5dd7b1[_0xb6c7('0xd5')]=_0x350d9a;_0x5dd7b1['lookAgent']=_0x96666c;if(_[_0xb6c7('0x103')](_0x550f99)){_0x51b9b2[_0xb6c7('0x104')](_0x5dd7b1,_0x1f2776,_0x44e74a,_0x96666c)[_0xb6c7('0x7e')](function(_0x535b43){logger[_0xb6c7('0x59')](_0xb6c7('0x105'),_0xb6c7('0x106')+_0x5dd7b1['queue']+_0xb6c7('0x107')+_0x5dd7b1[_0xb6c7('0xaa')],JSON[_0xb6c7('0x54')](_0x535b43));ami['emit'](_0xb6c7('0x108'),ut[_0xb6c7('0x9a')](_0x5dd7b1,_0xb6c7('0x109'),_0x51b9b2[_0xb6c7('0x12')][_0x5dd7b1['queue']]));_0x3b0a7f(ut[_0xb6c7('0x4a')](_0xb6c7('0x10a')));})[_0xb6c7('0x73')](function(_0x5bcccf){ut[_0xb6c7('0x5d')](_0xb6c7('0x10b'),_0x5bcccf);_0x599fe4(ut[_0xb6c7('0x4a')](_0xb6c7('0x10c'),_0x1c7638,_0x350d9a));});}else{_0x1f2776[_0xb6c7('0x39')]+=0x1;ut[_0xb6c7('0x10d')](_0x5dd7b1);rpcDb[_0xb6c7('0x10e')](_0x5dd7b1,'[Blacklist][error]');delete _0x51b9b2[_0xb6c7('0x14')][_0x44dd19];_0x599fe4(ut['message'](_0xb6c7('0x10f'),_0x1c7638,_0x350d9a));}});};Preview[_0xb6c7('0xe')]['isTrunkReachable']=function(_0x27418b){return!_[_0xb6c7('0x68')](_0x27418b)&&!_[_0xb6c7('0x68')](_0x27418b[_0xb6c7('0x26')])&&!_[_0xb6c7('0x68')](_0x27418b['active'])&&_0x27418b[_0xb6c7('0x51')]&&!_[_0xb6c7('0x68')](this['trunks'][util[_0xb6c7('0x56')]('SIP/%s',_0x27418b[_0xb6c7('0x26')])])&&!_[_0xb6c7('0x68')](this['trunks'][util[_0xb6c7('0x56')](_0xb6c7('0x110'),_0x27418b[_0xb6c7('0x26')])][_0xb6c7('0x111')])&&(this[_0xb6c7('0x13')][util[_0xb6c7('0x56')]('SIP/%s',_0x27418b[_0xb6c7('0x26')])]['status']==='reachable'||this[_0xb6c7('0x13')][util[_0xb6c7('0x56')](_0xb6c7('0x110'),_0x27418b[_0xb6c7('0x26')])]['status']===_0xb6c7('0x112'));};Preview['prototype'][_0xb6c7('0x84')]=function(_0x4e4619,_0x3031d6){var _0x575b2d=this;return new BPromise(function(_0x51e0cd,_0xf8bb5c){_0x575b2d[_0xb6c7('0x113')](_0x4e4619,_0x3031d6)['then'](function(_0x530e99){_0x51e0cd(_[_0xb6c7('0x6e')](_0x530e99,[_0xb6c7('0x4a')]));})[_0xb6c7('0x73')](function(_0x15e98d){if(_0x15e98d[_0xb6c7('0x114')]){rpcDb[_0xb6c7('0x115')](_0x4e4619);}if(_0x15e98d['active']){rpcDb[_0xb6c7('0x86')](_0x4e4619);}_0xf8bb5c(_[_0xb6c7('0x6e')](_0x15e98d,[_0xb6c7('0x4a')]));});});};Preview[_0xb6c7('0xe')][_0xb6c7('0x113')]=function(_0x3aef19,_0xb8197a){var _0x3b88ab=this;return new BPromise(function(_0x3ef4da,_0x4996fc){var _0x1b7e43,_0x423728;rpcDb[_0xb6c7('0x116')](_0x3aef19)[_0xb6c7('0x7e')](function(_0x198dce){if(!_[_0xb6c7('0x68')](_0x198dce[0x0])){_0x423728=_0x198dce[0x0][_0xb6c7('0x117')]?![]:!![];_0x1b7e43=_0x198dce[0x0][_0xb6c7('0x117')]?!![]:![];_0x1b7e43=_0xb8197a?!![]:_0x1b7e43;}var _0x44df34=_0x3b88ab[_0xb6c7('0x118')](_0x198dce);if(_0x44df34[_0xb6c7('0x119')]){rpcDb[_0xb6c7('0x11a')](_['pick'](_0x198dce[0x0],['VoiceQueueId',_0xb6c7('0x101')]))[_0xb6c7('0x7e')](function(_0x2ff87f){_0x3b88ab[_0xb6c7('0xff')](_0x2ff87f,_0x198dce[0x0],_0xb8197a,_0x423728,_0x1b7e43)[_0xb6c7('0x7e')](function(_0x4bdbbf){_0x3ef4da(_0x4bdbbf);})[_0xb6c7('0x73')](function(_0x144096){_0x4996fc(_0x144096);});})[_0xb6c7('0x73')](function(_0x3a68d6){ut['logger'](_0xb6c7('0x11b'),_0x3a68d6);_0x4996fc(ut['message'](_0xb6c7('0x11c'),_0x423728,_0x1b7e43));});}else{_0x4996fc(ut[_0xb6c7('0x4a')](_0x44df34['message'],_0x423728,_0x1b7e43));}})[_0xb6c7('0x73')](function(_0x1edcfa){ut[_0xb6c7('0x5d')](_0xb6c7('0x11d'),_0x1edcfa);_0x4996fc(ut[_0xb6c7('0x4a')](_0xb6c7('0x11c'),![],!![]));});});};Preview['prototype']['validateContact']=function(_0x45b912){if(_[_0xb6c7('0x68')](_0x45b912)||_[_0xb6c7('0x103')](_0x45b912)||!_[_0xb6c7('0x68')](_0x45b912[0x0][_0xb6c7('0x82')])&&_['isNil'](_0x45b912[0x0][_0xb6c7('0x82')][_0xb6c7('0x26')])){ut[_0xb6c7('0x5d')](_0xb6c7('0x11e'),_0x45b912);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x41b5c3=this['campaignsPreview'][_0x45b912[0x0][_0xb6c7('0x6a')][_0xb6c7('0x26')]];_0x41b5c3[_0xb6c7('0x4a')]='ACTIVE';if(_[_0xb6c7('0x68')](_0x41b5c3)){ut[_0xb6c7('0x5d')](_0xb6c7('0x11f'),_0x41b5c3);return{'isValid':![],'message':_0xb6c7('0x120')};}if(!this[_0xb6c7('0x91')](_0x41b5c3['Trunk'])){ut[_0xb6c7('0x5d')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0xb6c7('0x121')+_0x41b5c3[_0xb6c7('0x26')]+_0xb6c7('0x122'));if(!this[_0xb6c7('0x91')](_0x41b5c3[_0xb6c7('0x123')])){ut[_0xb6c7('0x5d')](_0xb6c7('0x124'),_0x41b5c3['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xb6c7('0x125')};}}if(!ut[_0xb6c7('0x90')](_0x41b5c3['dialActive'])){ut['logger'](_0xb6c7('0x126'),_0x41b5c3['name']+'\x20Not\x20Active');return{'isValid':![],'message':_0xb6c7('0x121')+_0x41b5c3[_0xb6c7('0x26')]+_0xb6c7('0x127')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xb6c7('0xe')][_0xb6c7('0x104')]=function(_0x5be7bf,_0x8ec4ae,_0x149c38,_0x1df48a){var _0x51ed9c=this;return new BPromise(function(_0x2d782e,_0x194a4a){var _0x2351a1=_0x5be7bf[_0xb6c7('0xb1')];var _0x5983de=_0x51ed9c['isTrunkReachable'](_0x8ec4ae[_0xb6c7('0x50')])?util[_0xb6c7('0x56')](_0xb6c7('0x128'),_0x8ec4ae['Trunk'][_0xb6c7('0x26')],_[_0xb6c7('0x68')](_0x8ec4ae[_0xb6c7('0x129')])?'':_0x8ec4ae[_0xb6c7('0x129')][_0xb6c7('0x12a')]()||'',_0x8ec4ae[_0xb6c7('0x12b')]>0x0?_0x149c38[_0xb6c7('0x101')][_0xb6c7('0x12c')](_0x8ec4ae['dialCutDigit']):_0x149c38[_0xb6c7('0x101')]):util[_0xb6c7('0x56')]('SIP/%s/%s%s',_[_0xb6c7('0x68')](_0x8ec4ae[_0xb6c7('0x123')])?_0x8ec4ae[_0xb6c7('0x50')]['name']:_0x8ec4ae['TrunkBackup']['name'],_[_0xb6c7('0x68')](_0x8ec4ae['dialPrefix'])?'':_0x8ec4ae[_0xb6c7('0x129')][_0xb6c7('0x12a')]()||'',_0x8ec4ae[_0xb6c7('0x12b')]>0x0?_0x149c38[_0xb6c7('0x101')][_0xb6c7('0x12c')](_0x8ec4ae[_0xb6c7('0x12b')]):_0x149c38[_0xb6c7('0x101')]);var _0x1c797c=_0x51ed9c['isTrunkReachable'](_0x8ec4ae['Trunk'])?ut[_0xb6c7('0x12d')](_0x8ec4ae['Trunk'][_0xb6c7('0x52')],_0x8ec4ae[_0xb6c7('0x35')],_0x8ec4ae[_0xb6c7('0x12e')]>0x0?ut[_0xb6c7('0x12f')](_0x8ec4ae[_0xb6c7('0x130')],_0x8ec4ae[_0xb6c7('0x12e')]):_0x8ec4ae[_0xb6c7('0x130')]):ut[_0xb6c7('0x12d')](_[_0xb6c7('0x68')](_0x8ec4ae[_0xb6c7('0x123')])?_0x8ec4ae[_0xb6c7('0x50')][_0xb6c7('0x52')]:_0x8ec4ae[_0xb6c7('0x123')]['callerid'],_0x8ec4ae['dialOriginateCallerIdName'],_0x8ec4ae[_0xb6c7('0x12e')]>0x0?ut[_0xb6c7('0x12f')](_0x8ec4ae[_0xb6c7('0x130')],_0x8ec4ae[_0xb6c7('0x12e')]):_0x8ec4ae[_0xb6c7('0x130')]);if(_0x1c797c){_0x5be7bf[_0xb6c7('0x131')]=ut['extractCalleridName'](_0x1c797c);_0x5be7bf[_0xb6c7('0x132')]=ut[_0xb6c7('0x133')](_0x1c797c);}var _0x56b9ad=ut[_0xb6c7('0x134')](_0x8ec4ae,_0x149c38,_0x5983de,_0x1c797c,_0x2351a1,_0x5be7bf);_[_0xb6c7('0x135')](_0x5be7bf,ut['toLowerVariables'](_0x56b9ad));_0x5be7bf[_0xb6c7('0x136')]=moment()[_0xb6c7('0x56')](_0xb6c7('0x87'));ami['Action'](ut[_0xb6c7('0x137')](_0x5be7bf,_0x8ec4ae,_0x56b9ad,_0x5be7bf[_0xb6c7('0xd5')],_0x1df48a))[_0xb6c7('0x7e')](function(_0x8e4cc8){_0x8ec4ae['originated']+=0x1;logger[_0xb6c7('0x59')](_0xb6c7('0x138'),_0x2351a1,_0xb6c7('0xb2'),_0x8ec4ae['name'],_0xb6c7('0x6c'),_0x8ec4ae['originated']);_0x2d782e(_0x8e4cc8);})['catch'](function(_0x39ca54){ut['logAgent'](_0x5be7bf,0xe,_0xb6c7('0x139'));rpcDb[_0xb6c7('0xf4')](_0x5be7bf,_0xb6c7('0x13a'));_0x194a4a(_0x39ca54);});});};Preview[_0xb6c7('0xe')][_0xb6c7('0x1d')]=function(_0x1e29f9){if(this[_0xb6c7('0x14')][_0x1e29f9[_0xb6c7('0xe9')]]){this[_0xb6c7('0x14')][_0x1e29f9[_0xb6c7('0xe9')]]['channel']=_0x1e29f9['channel'];}};Preview[_0xb6c7('0xe')]['syncOriginateResponse']=function(_0x4e9c66){var _0x441dbf=this;var _0x2d8701=this['actions'][_0x4e9c66['actionid']];if(_0x2d8701){if(_0x2d8701['lookAgent']&&this[_0xb6c7('0x15')][_0x2d8701[_0xb6c7('0x13b')]]){ut[_0xb6c7('0x13c')](_0x2d8701,this[_0xb6c7('0x15')][_0x2d8701[_0xb6c7('0x13b')]][_0xb6c7('0x26')],this[_0xb6c7('0x15')][_0x2d8701[_0xb6c7('0x13b')]]['id']);}var _0x3770a9=_[_0xb6c7('0x13d')](_0x2d8701);_0x3770a9[_0xb6c7('0xae')]=moment()[_0xb6c7('0x56')](_0xb6c7('0x87'));var _0x1bb7a2=_0x441dbf[_0xb6c7('0x12')][_0x2d8701[_0xb6c7('0x6b')]];if(ut[_0xb6c7('0x13e')](_0x4e9c66['response'])){if(_0x2d8701['unlockAgent']){rpcDb[_0xb6c7('0x115')](_0x2d8701[_0xb6c7('0xaa')]);}if(_0x2d8701[_0xb6c7('0xd5')]){rpcDb[_0xb6c7('0x86')](_0x2d8701[_0xb6c7('0xaa')]);}ami[_0xb6c7('0x23')](_0xb6c7('0x13f'),ut[_0xb6c7('0x9a')](_0x2d8701,'rejected',this[_0xb6c7('0x12')][_0x2d8701[_0xb6c7('0x6b')]]));this['callProgressDetectingAgent'](_0x3770a9,_0x1bb7a2,_0x4e9c66);}else{_0x2d8701['starttime']=moment()[_0xb6c7('0x56')](_0xb6c7('0x87'));ut['logAgent'](_0x3770a9,0x4,_0xb6c7('0xba'));rpcDb[_0xb6c7('0xf4')](_0x3770a9,_0xb6c7('0x140'));}}};Preview['prototype'][_0xb6c7('0x141')]=function(_0x477b5b){var _0x4b7b1a=this;var _0x3da788=this[_0xb6c7('0x14')][_0x477b5b[_0xb6c7('0xe9')]];var _0xe70183;if(_0x3da788){_0xe70183=this[_0xb6c7('0x12')][_0x3da788[_0xb6c7('0x6b')]];logger[_0xb6c7('0x59')](_0xb6c7('0x142'),_0x477b5b[_0xb6c7('0xe9')],'\x20Queue',_0xe70183[_0xb6c7('0x26')],_0xb6c7('0x6d'),_0xe70183[_0xb6c7('0x2b')]);}if(this['actions'][_0x477b5b[_0xb6c7('0xe9')]]&&_0x477b5b[_0xb6c7('0xe9')]!==_0x477b5b['uniqueid']){if(_0x477b5b[_0xb6c7('0x143')]==='16'&&this['actions'][_0x477b5b[_0xb6c7('0xe9')]][_0xb6c7('0x76')]){this[_0xb6c7('0x94')](_0x477b5b,_0x477b5b[_0xb6c7('0xe9')],_0x477b5b[_0xb6c7('0x143')]);}else if(this[_0xb6c7('0x14')][_0x477b5b[_0xb6c7('0xe9')]][_0xb6c7('0x76')]){logger['info'](_0xb6c7('0x144'),_0x477b5b[_0xb6c7('0xe9')],_0x477b5b[_0xb6c7('0x143')],_0xb6c7('0xb2'),_0xe70183[_0xb6c7('0x26')],_0xb6c7('0x6d'),_0xe70183['pTalking']);this[_0xb6c7('0x94')](_0x477b5b,_0x477b5b[_0xb6c7('0xe9')],_0x477b5b[_0xb6c7('0x143')]);}}else if(_0x3da788&&_['isNil'](_0x3da788[_0xb6c7('0x145')])&&_0xe70183['dialQueueProject']&&_0x477b5b['linkedid']===_0x477b5b['uniqueid']&&_[_0xb6c7('0x68')](_0x477b5b[_0xb6c7('0xf3')])&&_0x477b5b['cause']==='16'&&_0x477b5b['channelstate']==='6'&&_[_0xb6c7('0xf1')](_0x3da788[_0xb6c7('0x146')])){if(_0x3da788['unlockAgent']){rpcDb[_0xb6c7('0x115')](_0x3da788[_0xb6c7('0xaa')]);}if(_0x3da788['activeContact']){rpcDb['disableContact'](_0x3da788[_0xb6c7('0xaa')]);}_0x477b5b['reason']='22';this['callProgressDetectingAgent'](_0x3da788,_0xe70183,_0x477b5b);}else if(_0x3da788&&_0x3da788[_0xb6c7('0x146')]){if(_0x477b5b['cause']==='16'&&this[_0xb6c7('0x14')][_0x477b5b[_0xb6c7('0xe9')]][_0xb6c7('0x76')]){logger[_0xb6c7('0x59')](_0xb6c7('0x147'),_0x477b5b['linkedid'],_0x477b5b[_0xb6c7('0x143')],_0xb6c7('0xb2'),_0xe70183[_0xb6c7('0x26')],_0xb6c7('0x6d'),_0xe70183[_0xb6c7('0x2b')]);this['callProgressDetectingCustomer'](_0x477b5b,_0x477b5b[_0xb6c7('0xe9')],_0x477b5b[_0xb6c7('0x143')]);}else if(this[_0xb6c7('0x14')][_0x477b5b[_0xb6c7('0xe9')]][_0xb6c7('0x76')]){logger[_0xb6c7('0x59')](_0xb6c7('0x144'),_0x477b5b[_0xb6c7('0xe9')],_0x477b5b[_0xb6c7('0x143')],'\x20Queue',_0xe70183[_0xb6c7('0x26')],'pTalking:\x20',_0xe70183['pTalking']);this[_0xb6c7('0x94')](_0x477b5b,_0x477b5b[_0xb6c7('0xe9')],_0x477b5b[_0xb6c7('0x143')]);}}};Preview[_0xb6c7('0xe')][_0xb6c7('0x1b')]=function(_0x228cd0){if(this[_0xb6c7('0x14')][_0x228cd0[_0xb6c7('0xef')]]&&_0x228cd0['destlinkedid']!==_0x228cd0[_0xb6c7('0x148')]){this['callProgressDetectingCustomer'](_0x228cd0,_0x228cd0[_0xb6c7('0xef')],_0x228cd0[_0xb6c7('0xe5')]);}};Preview[_0xb6c7('0xe')][_0xb6c7('0x149')]=function(_0x26d4b5){if(this[_0xb6c7('0x14')][_0x26d4b5[_0xb6c7('0xe9')]]&&_0x26d4b5[_0xb6c7('0xe9')]!==_0x26d4b5['uniqueid']&&!this[_0xb6c7('0x14')][_0x26d4b5[_0xb6c7('0xe9')]]['dialAnswer']){if(_0x26d4b5[_0xb6c7('0x143')]==='1'){this['callProgressDetectingCustomer'](_0x26d4b5,_0x26d4b5[_0xb6c7('0xe9')],_0x26d4b5[_0xb6c7('0x143')]);}}};Preview[_0xb6c7('0xe')]['addVariable']=function(_0x2afccf,_0x2c568d,_0x5eabb8){if(this['actions'][_0x2afccf]){if(_['isNil'](this[_0xb6c7('0x14')][_0x2afccf][_0xb6c7('0x14a')])){this[_0xb6c7('0x14')][_0x2afccf]['variables']={};}this[_0xb6c7('0x14')][_0x2afccf][_0xb6c7('0x14a')][_0x2c568d]=_0x5eabb8;}};Preview[_0xb6c7('0xe')][_0xb6c7('0x1f')]=function(_0x1730db){try{if(!_[_0xb6c7('0x68')](_0x1730db)){if(ut[_0xb6c7('0x14b')](_[_0xb6c7('0x14c')](_0x1730db[_0xb6c7('0x14d')])[0x0])){this[_0xb6c7('0x14e')](_0x1730db['uniqueid'],_[_0xb6c7('0x14c')](_0x1730db[_0xb6c7('0x14d')])[0x0],_0x1730db['value']);}}}catch(_0x2f75df){logger[_0xb6c7('0x14f')](_0xb6c7('0x150'),util['inspect'](_0x2f75df,{'showHidden':![],'depth':null}));}};Preview[_0xb6c7('0xe')][_0xb6c7('0x21')]=function(_0x15d8b8){if(_0x15d8b8){if(this[_0xb6c7('0x14')][_0x15d8b8[_0xb6c7('0x151')]]){this[_0xb6c7('0x14')][_0x15d8b8[_0xb6c7('0x151')]][_0xb6c7('0x146')]=!![];}}};Preview['prototype'][_0xb6c7('0x22')]=function(_0x2fab4b){if(_0x2fab4b){if(this[_0xb6c7('0x14')][_0x2fab4b[_0xb6c7('0x152')]]){this[_0xb6c7('0x14')][_0x2fab4b[_0xb6c7('0x152')]][_0xb6c7('0x146')]=!![];}}};module[_0xb6c7('0x153')]=Preview;
\ No newline at end of file
+var _0x6aa7=['syncOriginateResponse','actionid','lookAgent','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','transfer','[syncHangup][talking][transfer]','destuniqueid','variables','filterKey','keys','variable','addVariable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','uuid','moment','md5','../../../config/environment','../../../config/logger','preview','../ami','../rpc/cmHopperAdditionalPhone','./action','./util/util','defaults','redis','localhost','prototype','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','bind','syncHangup','syncHangupRequest','dialend','newexten','syncNewExten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','type','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCallToSecond','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','message','DEACTIVATED','hasOwnProperty','booked','outbound','clearZombieChannels','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','catch','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','setMessage','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','ANSWER','responsetime','answertime','uniqueid','\x20Queue','connect','acw','custom:agentConnectPreview','buildAcw','complete','outboundAnswerCallsDay','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','outboundBusyCallsDay','countbusyretry','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','rescheduleContact','incrementPreviewCounters','countglobal','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','CONGESTION','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','CANCEL','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','countagentrejectretry','swapAdditionalPhones','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','decrementTalkink','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','object','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','execRun','unlock','unlockContact','getContactPreview','validateContact','isValid','checkIsBlackList','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Queue','Empty\x20Campaign','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','campaign\x20Name:\x20','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialCutDigit','trim','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]'];(function(_0xf3f8c2,_0x4bb048){var _0x5a4c2b=function(_0x1a22ea){while(--_0x1a22ea){_0xf3f8c2['push'](_0xf3f8c2['shift']());}};_0x5a4c2b(++_0x4bb048);}(_0x6aa7,0x178));var _0x76aa=function(_0x680ce1,_0x9f3543){_0x680ce1=_0x680ce1-0x0;var _0x219fbb=_0x6aa7[_0x680ce1];return _0x219fbb;};'use strict';var util=require(_0x76aa('0x0'));var _=require('lodash');var BPromise=require(_0x76aa('0x1'));var uuid=require(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var md5=require(_0x76aa('0x4'));var Redis=require('ioredis');var config=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0x76aa('0x8'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0x76aa('0x9'));var Action=require(_0x76aa('0xa'));var ut=require(_0x76aa('0xb'));config['redis']=_[_0x76aa('0xc')](config[_0x76aa('0xd')],{'host':_0x76aa('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x76aa('0xd')]));var Sequence=function(){};Sequence[_0x76aa('0xf')][_0x76aa('0x10')]=function(_0x16cb50){this[_0x76aa('0x11')]=this[_0x76aa('0x11')]?this[_0x76aa('0x11')][_0x76aa('0x12')](_0x16cb50):_0x16cb50();};function Preview(_0xd6327){this[_0x76aa('0x13')]=new Sequence();this['campaignsPreview']=_0xd6327[_0x76aa('0x14')];this['trunks']=_0xd6327[_0x76aa('0x15')];this[_0x76aa('0x16')]={};this[_0x76aa('0x17')]=_0xd6327[_0x76aa('0x17')];this[_0x76aa('0x18')]=0x0;ami['on']('originateresponse',this['syncOriginateResponse'][_0x76aa('0x19')](this));ami['on']('hangup',this[_0x76aa('0x1a')][_0x76aa('0x19')](this));ami['on']('hanguprequest',this[_0x76aa('0x1b')]['bind'](this));ami['on'](_0x76aa('0x1c'),this['syncDialEnd'][_0x76aa('0x19')](this));ami['on'](_0x76aa('0x1d'),this[_0x76aa('0x1e')][_0x76aa('0x19')](this));ami['on'](_0x76aa('0x1f'),this[_0x76aa('0x20')]['bind'](this));ami['on']('attendedtransfer',this[_0x76aa('0x21')][_0x76aa('0x19')](this));ami['on'](_0x76aa('0x22'),this[_0x76aa('0x23')][_0x76aa('0x19')](this));this[_0x76aa('0x24')](this[_0x76aa('0x25')]);}function emit(_0x2eaf48,_0x385157,_0x5990c1){io['to'](_0x2eaf48)[_0x76aa('0x26')](_0x385157,_0x5990c1);}function emitCampaignPreview(_0x21064c){if(_0x21064c[_0x76aa('0x27')]==='outbound'){var _0x41463a={'id':_0x21064c['id'],'name':_0x21064c[_0x76aa('0x28')],'strategy':_0x21064c[_0x76aa('0x29')],'answered':_0x21064c[_0x76aa('0x2a')],'available':_0x21064c[_0x76aa('0x2b')],'loggedIn':_0x21064c[_0x76aa('0x2c')],'pTalking':_0x21064c[_0x76aa('0x2d')],'sumBillable':_0x21064c[_0x76aa('0x2e')],'sumDuration':_0x21064c[_0x76aa('0x2f')],'sumHoldTime':_0x21064c[_0x76aa('0x30')]||0x0,'talking':_0x21064c[_0x76aa('0x31')],'total':_0x21064c[_0x76aa('0x32')],'type':_0x21064c[_0x76aa('0x27')],'unmanaged':_0x21064c['unmanaged'],'abandoned':_0x21064c[_0x76aa('0x33')],'waiting':_0x21064c[_0x76aa('0x34')],'loggedInDb':_0x21064c[_0x76aa('0x35')],'dialActive':_0x21064c[_0x76aa('0x36')],'dialMethod':_0x21064c[_0x76aa('0x37')],'dialOriginateCallerIdName':_0x21064c[_0x76aa('0x38')],'dialOriginateCallerIdNumber':_0x21064c[_0x76aa('0x39')],'dialOriginateTimeout':_0x21064c[_0x76aa('0x3a')],'dialPrefix':_0x21064c[_0x76aa('0x3b')],'outboundAnswerAgiCallsDay':_0x21064c[_0x76aa('0x3c')],'outboundAnswerCallsDay':_0x21064c['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x21064c[_0x76aa('0x3d')],'outboundBusyCallsDay':_0x21064c['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x21064c[_0x76aa('0x3e')],'outboundDropCallsDayACS':_0x21064c[_0x76aa('0x3f')],'outboundDropCallsDayCallersExit':_0x21064c[_0x76aa('0x40')],'outboundDropCallsDayTimeout':_0x21064c[_0x76aa('0x41')],'outboundNoAnswerCallsDay':_0x21064c[_0x76aa('0x42')],'outboundNoSuchCallsDay':_0x21064c[_0x76aa('0x43')],'outboundOriginateFailureCallsDay':_0x21064c[_0x76aa('0x44')],'outboundReCallsDay':_0x21064c[_0x76aa('0x45')],'outboundRejectCallsDay':_0x21064c[_0x76aa('0x46')],'outboundUnknownCallsDay':_0x21064c[_0x76aa('0x47')],'outboundAbandonedCallsDay':_0x21064c['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x21064c[_0x76aa('0x48')],'predictiveIntervalAvgHoldtime':_0x21064c[_0x76aa('0x49')],'predictiveIntervalAvgTalktime':_0x21064c[_0x76aa('0x4a')],'predictiveIntervalDroppedCallsCallersExit':_0x21064c[_0x76aa('0x4b')],'predictiveIntervalDroppedCallsTimeout':_0x21064c[_0x76aa('0x4c')],'predictiveIntervalErlangCalls':_0x21064c[_0x76aa('0x4d')],'predictiveIntervalErlangCallsDroppedCalls':_0x21064c[_0x76aa('0x4e')],'predictiveIntervalHitRate':_0x21064c['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x21064c[_0x76aa('0x4f')],'predictiveIntervalPauses':_0x21064c[_0x76aa('0x50')],'predictiveIntervalAvailable':_0x21064c['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x21064c[_0x76aa('0x51')],'message':_0x21064c['message'],'originated':_0x21064c[_0x76aa('0x52')],'erlangCalls':_0x21064c['erlangCalls'],'erlangCallToSecond':_0x21064c[_0x76aa('0x53')],'erlangAbandonmentRate':_0x21064c['erlangAbandonmentRate'],'erlangBusyFactor':_0x21064c['erlangBusyFactor'],'startPredictive':_0x21064c[_0x76aa('0x54')],'startProgressive':_0x21064c[_0x76aa('0x55')]};if(_0x21064c[_0x76aa('0x56')]){_0x41463a[_0x76aa('0x56')]={'id':_0x21064c['Trunk']['id'],'name':_0x21064c['Trunk'][_0x76aa('0x28')],'active':_0x21064c[_0x76aa('0x56')][_0x76aa('0x57')],'callerid':_0x21064c[_0x76aa('0x56')][_0x76aa('0x58')]};}if(_0x21064c['Interval']){_0x41463a[_0x76aa('0x59')]={'id':_0x21064c['Interval']['id'],'name':_0x21064c['Interval'][_0x76aa('0x28')]};}var _0x36d64e=md5(JSON[_0x76aa('0x5a')](_0x41463a));if(_0x21064c[_0x76aa('0x4')]!==_0x36d64e){_0x21064c['md5']=_0x36d64e;emit(util[_0x76aa('0x5b')](_0x76aa('0x5c'),_0x41463a[_0x76aa('0x28')]),'voice_queue:save',_0x41463a);}}}function emitVoiceQueueChannelRemove(_0x113770){logger[_0x76aa('0x5d')](_0x76aa('0x5e'),JSON[_0x76aa('0x5a')](_0x113770));emit(util[_0x76aa('0x5b')](_0x76aa('0x5c'),_0x113770[_0x76aa('0x28')]),_0x76aa('0x5f'),_0x113770);io[_0x76aa('0x26')]('voice_queue_presence:remove',_0x113770);}function notSendMessagesQueue(_0x1525cb){if(_0x1525cb[_0x76aa('0x60')]){if(_0x1525cb[_0x76aa('0x52')]===0x0&&_0x1525cb[_0x76aa('0x2d')]===0x0){_0x1525cb[_0x76aa('0x60')]=![];_0x1525cb[_0x76aa('0x2b')]=0x0;_0x1525cb['paused']=0x0;_0x1525cb['message']=_0x76aa('0x61');ut[_0x76aa('0x62')](_0x76aa('0x63'),_0x1525cb[_0x76aa('0x28')]+'\x20is\x20not\x20active');}else{_0x1525cb[_0x76aa('0x64')]=_0x76aa('0x65');ut[_0x76aa('0x62')](_0x76aa('0x63'),_0x1525cb[_0x76aa('0x28')]+'\x20is\x20deactivated');}emitCampaignPreview(_0x1525cb);}}Preview[_0x76aa('0xf')]['loopCampaigns']=function(){var _0xbb3136=this;setInterval(function(){_0xbb3136['syncCampaigns']();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x144f0a=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x5be7ce in _0x144f0a){if(_0x144f0a[_0x76aa('0x66')](_0x5be7ce)&&(_0x144f0a[_0x5be7ce][_0x76aa('0x37')]===_0x76aa('0x7')||_0x144f0a[_0x5be7ce][_0x76aa('0x37')]===_0x76aa('0x67'))&&_0x144f0a[_0x5be7ce]['type']===_0x76aa('0x68')){if(this[_0x76aa('0x18')]>0x7){this[_0x76aa('0x18')]=0x0;this[_0x76aa('0x69')]();}}if(_0x144f0a[_0x76aa('0x66')](_0x5be7ce)&&_0x144f0a[_0x5be7ce]['dialMethod']===_0x76aa('0x7')&&_0x144f0a[_0x5be7ce][_0x76aa('0x27')]==='outbound'){if(_0x144f0a[_0x5be7ce][_0x76aa('0x36')]){this['setMessage'](_0x144f0a[_0x5be7ce]);if(_0x144f0a[_0x5be7ce][_0x76aa('0x6a')])this[_0x76aa('0x6b')](_0x144f0a[_0x5be7ce]);}else{notSendMessagesQueue(_0x144f0a[_0x5be7ce]);}}}};Preview[_0x76aa('0xf')][_0x76aa('0x6c')]=function(_0x2d0bc4){var _0x3e0315=this;this[_0x76aa('0x13')][_0x76aa('0x10')](function(){if(!_[_0x76aa('0x6d')](_0x3e0315[_0x76aa('0x16')][_0x2d0bc4])){loggerAction['info'](_0x76aa('0x6e'),_0x2d0bc4,'Queue',_0x3e0315[_0x76aa('0x16')][_0x2d0bc4][_0x76aa('0x6f')],_0x76aa('0x70'),JSON[_0x76aa('0x5a')](_0x3e0315['campaignsPreview'][_0x3e0315['actions'][_0x2d0bc4][_0x76aa('0x6f')]]['originated']),_0x76aa('0x71'),JSON[_0x76aa('0x5a')](_0x3e0315[_0x76aa('0x25')][_0x3e0315[_0x76aa('0x16')][_0x2d0bc4][_0x76aa('0x6f')]][_0x76aa('0x2d')]),JSON['stringify'](_0x3e0315['actions'][_0x2d0bc4][_0x76aa('0x72')]),JSON[_0x76aa('0x5a')](_[_0x76aa('0x73')](_0x3e0315[_0x76aa('0x16')][_0x2d0bc4],[_0x76aa('0x74'),_0x76aa('0x75'),'VoiceQueueId',_0x76aa('0x76')])));return ami[_0x76aa('0x77')]({'action':_0x76aa('0x78'),'channel':_0x3e0315['actions'][_0x2d0bc4][_0x76aa('0x79')]})['catch'](function(_0x2a663a){if(_0x2a663a['message']===_0x76aa('0x7a')){setTimeout(function(){if(_0x3e0315[_0x76aa('0x16')][_0x2d0bc4]){ut[_0x76aa('0x7b')](_0x3e0315[_0x76aa('0x25')][_0x3e0315[_0x76aa('0x16')][_0x2d0bc4][_0x76aa('0x6f')]],_0x76aa('0x7c'));if(_0x3e0315['actions'][_0x2d0bc4][_0x76aa('0x72')]===!![]){ut['decrementTalkink'](_0x3e0315[_0x76aa('0x25')][_0x3e0315[_0x76aa('0x16')][_0x2d0bc4][_0x76aa('0x6f')]],_0x76aa('0x7c'));ut[_0x76aa('0x7d')](_0x76aa('0x7e')+_0x2d0bc4,_0x3e0315[_0x76aa('0x16')][_0x2d0bc4]['queue']);}ut[_0x76aa('0x7d')](_0x76aa('0x7f')+_0x2d0bc4,_0x3e0315[_0x76aa('0x16')][_0x2d0bc4][_0x76aa('0x6f')]);delete _0x3e0315['actions'][_0x2d0bc4];}},0x2328);}});}});};Preview[_0x76aa('0xf')][_0x76aa('0x69')]=function(){var _0x8dc601=this;loggerAction[_0x76aa('0x5d')](_0x76aa('0x80'),_[_0x76aa('0x81')](this['actions']));for(var _0x295b2c in this[_0x76aa('0x16')]){if(_0x8dc601[_0x76aa('0x16')][_0x76aa('0x66')](_0x295b2c)){_0x8dc601[_0x76aa('0x6c')](_0x295b2c);}}};Preview[_0x76aa('0xf')][_0x76aa('0x6b')]=function(_0x51893b){var _0x4910fb=this;rpcDb[_0x76aa('0x82')](_0x51893b['id'],ut[_0x76aa('0x83')](this['agents']))[_0x76aa('0x84')](function(_0x1e6f3c){if(!_['isNil'](_0x1e6f3c)){for(var _0x3354b6=0x0;_0x3354b6<_0x1e6f3c[_0x76aa('0x85')];_0x3354b6+=0x1){if(ut[_0x76aa('0x86')](_0x1e6f3c[_0x3354b6][_0x76aa('0x87')])<_0x51893b[_0x76aa('0x88')]*0x3c){if(_0x1e6f3c[_0x3354b6][_0x76aa('0x89')]&&!_0x1e6f3c[_0x3354b6][_0x76aa('0x89')][_0x76aa('0x8a')]){_0x4910fb[_0x76aa('0x8b')](_0x1e6f3c[_0x3354b6]['id'])['then'](ut[_0x76aa('0x8c')]('[RecallMe]'))[_0x76aa('0x8d')](ut[_0x76aa('0x8c')](_0x76aa('0x8e')));}else{rpcDb[_0x76aa('0x8f')](_0x1e6f3c[_0x3354b6]['id']);}}else{var _0x343cf1=new Action(_0x1e6f3c[_0x3354b6],_0x51893b);_0x343cf1[_0x76aa('0x90')]=moment()[_0x76aa('0x5b')](_0x76aa('0x91'));_0x51893b[_0x76aa('0x45')]+=0x1;ut['logCustomer'](_0x343cf1,0x17,_0x76aa('0x92'));if(_0x51893b[_0x76aa('0x93')]){rpcDb[_0x76aa('0x94')](ut[_0x76aa('0x95')](_0x1e6f3c[_0x3354b6]));rpcDb[_0x76aa('0x96')](_0x343cf1,_0x76aa('0x97'));}else{ut[_0x76aa('0x98')](_0x343cf1,0x16,_0x76aa('0x99'));rpcDb['createCustomerHistory'](_0x343cf1,_0x76aa('0x9a'));rpcDb['createCustomerFinal'](_0x343cf1,_0x76aa('0x9a'));}}}}})[_0x76aa('0x8d')](ut[_0x76aa('0x8c')](_0x76aa('0x9b')));};Preview[_0x76aa('0xf')][_0x76aa('0x9c')]=function(_0x2bfb46){_0x2bfb46['sendMessageOneNotActive']=!![];if(ut[_0x76aa('0x9d')](_0x2bfb46[_0x76aa('0x2c')])){_0x2bfb46['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0x76aa('0x9e')](_0x2bfb46[_0x76aa('0x36')])){_0x2bfb46['message']=_0x76aa('0x61');}else if(!this[_0x76aa('0x9f')](_0x2bfb46[_0x76aa('0x56')])){if(!this['isTrunkReachable'](_0x2bfb46[_0x76aa('0xa0')])){_0x2bfb46['message']=_0x76aa('0xa1');}else{_0x2bfb46[_0x76aa('0x64')]=_0x76aa('0xa2');}}else{_0x2bfb46[_0x76aa('0x64')]='ACTIVE';}emitCampaignPreview(_0x2bfb46);};Preview['prototype'][_0x76aa('0xa3')]=function(_0x4dfeb3,_0x2a8fd3,_0x28feb2){var _0x368a95=this;var _0x43a2af=this[_0x76aa('0x16')][_0x2a8fd3];var _0x30837c=this[_0x76aa('0x25')][_0x43a2af[_0x76aa('0x6f')]];var _0xa19c1c;var _0x54390f=![];var _0x7d02e7=0x2;var _0x1eadee=0x3;if(_0x30837c){switch(_0x28feb2){case'1':_0x30837c[_0x76aa('0x43')]+=0x1;_0x43a2af[_0x76aa('0xa4')]+=0x1;_0x43a2af['countglobal']=ut['totalGlobal'](_0x43a2af);ut['logCustomer'](_0x43a2af,0x0,_0x76aa('0xa5'));ami['emit'](_0x76aa('0xa6'),ut[_0x76aa('0xa7')](_0x43a2af,_0x76aa('0xa8')));rpcDb[_0x76aa('0x96')](_0x43a2af,'[callProgressDetectingCustomer][logNoSuch]');_0x368a95[_0x76aa('0xa9')](_0x43a2af,'0',_0x30837c)['then'](function(_0x358aa7){_0x54390f=_0x358aa7[_0x76aa('0xaa')]==0x1;_0x7d02e7=_0x30837c[_0x76aa('0xab')];_0x1eadee=_0x30837c[_0x76aa('0xac')];if(!_0x54390f){if(ut[_0x76aa('0xad')](_0x43a2af)>=_0x30837c['dialGlobalMaxRetry']){_0xa19c1c=ut[_0x76aa('0xae')](_0x43a2af,0xf,_0x76aa('0xaf'));rpcDb[_0x76aa('0xb0')](_0xa19c1c,_0x76aa('0xb1'));}else{if(_0x43a2af[_0x76aa('0xa4')]>=_0x30837c[_0x76aa('0xb2')]){rpcDb[_0x76aa('0xb0')](_0x43a2af,_0x76aa('0xb1'));}else{rpcDb['rescheduleContact'](ut[_0x76aa('0xb3')](_0x43a2af,_0x76aa('0xa4'),_0x30837c['dialNoSuchNumberRetryFrequency']),_0x43a2af[_0x76aa('0xb4')],_0x43a2af[_0x76aa('0xb5')]);}}delete this[_0x76aa('0x16')][_0x4dfeb3[_0x76aa('0xb6')]];}else{_0x43a2af[_0x76aa('0xa4')]++;logger[_0x76aa('0x5d')](_0x76aa('0xb7'),_0x43a2af['countnosuchnumberretry']);logger[_0x76aa('0x5d')]('id',_0x43a2af['idContact']);_0x368a95['incrementPreviewCounters']({'id':_0x43a2af[_0x76aa('0xb8')],'field':{'countnosuchnumberretry':_0x43a2af[_0x76aa('0xa4')]}})['then'](function(){_0x368a95['swapAdditionalPhones'](_0x43a2af,_0x7d02e7,_0x1eadee)[_0x76aa('0x84')](function(){});});}});break;case _0x76aa('0xb9'):var _0xd4cbe1=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x43a2af[_0x76aa('0xba')]=_0xd4cbe1;_0x43a2af[_0x76aa('0xbb')]=_0xd4cbe1;_0x43a2af[_0x76aa('0x72')]=!![];_0x30837c['pTalking']+=0x1;logger[_0x76aa('0x5d')]('[syncHangup][talking][increment]',_0x43a2af[_0x76aa('0xbc')],_0x76aa('0xbd'),_0x30837c[_0x76aa('0x28')],_0x76aa('0x71'),_0x30837c[_0x76aa('0x2d')]);ami['emit']('custom:agentconnect',ut[_0x76aa('0xa7')](_0x43a2af,_0x76aa('0xbe'),this[_0x76aa('0x25')][_0x43a2af['queue']]));if(_0x30837c[_0x76aa('0xbf')]){ami[_0x76aa('0x26')](_0x76aa('0xc0'),ut[_0x76aa('0xc1')](_0x43a2af));}break;case'16':ami[_0x76aa('0x26')]('custom:agentcomplete',ut[_0x76aa('0xa7')](_0x43a2af,'complete',this[_0x76aa('0x25')][_0x43a2af[_0x76aa('0x6f')]]));emitVoiceQueueChannelRemove(ut[_0x76aa('0xa7')](_0x43a2af,_0x76aa('0xc2')));_0x30837c[_0x76aa('0xc3')]+=0x1;_0x30837c[_0x76aa('0x32')]+=0x1;_0x30837c['answered']+=0x1;ut['decrementTalkink'](_0x30837c,'[16]');_0x43a2af['countglobal']=ut['totalGlobal'](_0x43a2af);ut[_0x76aa('0x98')](_0x43a2af,0x4,_0x76aa('0xc4'));rpcDb['createCustomerHistory'](_0x43a2af,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0x43a2af,_0x76aa('0xc5'));rpcDb[_0x76aa('0xc6')](_0x43a2af);_0x30837c[_0x76aa('0x2f')]+=_0x43a2af['talktime'];_0x30837c['sumBillable']+=_0x43a2af[_0x76aa('0xc7')];logger[_0x76aa('0x5d')](_0x76aa('0xc8'),_0x43a2af[_0x76aa('0xbc')],_0x76aa('0xbd'),_0x30837c['name'],'pTalking:\x20',_0x30837c[_0x76aa('0x2d')]);delete this['actions'][_0x4dfeb3['linkedid']];break;case'BUSY':_0x30837c[_0x76aa('0xc9')]+=0x1;_0x43a2af[_0x76aa('0xca')]+=0x1;_0x43a2af['countglobal']=ut[_0x76aa('0xad')](_0x43a2af);ut[_0x76aa('0x98')](_0x43a2af,0x5,'Busy');_0x7d02e7=_0x30837c[_0x76aa('0xcb')];_0x1eadee=_0x30837c[_0x76aa('0xac')];ami[_0x76aa('0x26')](_0x76aa('0xcc'),ut[_0x76aa('0xa7')](_0x43a2af,_0x76aa('0xcd')));rpcDb[_0x76aa('0x96')](_0x43a2af,_0x76aa('0xce'));_0x368a95[_0x76aa('0xa9')](_0x43a2af,'5',_0x30837c)['then'](function(_0x84bc91){_0x54390f=_0x84bc91[_0x76aa('0xaa')]==0x1;if(!_0x54390f){if(ut['totalGlobal'](_0x43a2af)>=_0x30837c[_0x76aa('0xcf')]){_0xa19c1c=ut[_0x76aa('0xae')](_0x43a2af,0xf,_0x76aa('0xaf'));rpcDb['createCustomerFinal'](_0xa19c1c,_0x76aa('0xd0'));}else{if(_0x43a2af[_0x76aa('0xca')]>=_0x30837c['dialBusyMaxRetry']){rpcDb[_0x76aa('0xb0')](_0x43a2af,_0x76aa('0xce'));}else{rpcDb[_0x76aa('0xd1')](ut['scheduledAt'](_0x43a2af,_0x76aa('0xca'),_0x30837c[_0x76aa('0xcb')]),_0x43a2af['unlockAgent'],_0x43a2af['activeContact']);}}}else{_0x43a2af['countbusyretry']++;_0x368a95[_0x76aa('0xd2')]({'id':_0x43a2af[_0x76aa('0xb8')],'field':{'countbusyretry':_0x43a2af[_0x76aa('0xca')]}})[_0x76aa('0x84')](function(){_0x368a95['swapAdditionalPhones'](_0x43a2af,_0x7d02e7,_0x1eadee)['then'](function(){});});}});break;case'NOANSWER':_0x30837c[_0x76aa('0x42')]+=0x1;_0x43a2af['countnoanswerretry']+=0x1;_0x43a2af[_0x76aa('0xd3')]=ut[_0x76aa('0xad')](_0x43a2af);ut['logCustomer'](_0x43a2af,0x3,_0x76aa('0xd4'));_0x7d02e7=_0x30837c[_0x76aa('0xd5')];_0x1eadee=_0x30837c['callAdditionalPhoneAfterMin'];ami[_0x76aa('0x26')](_0x76aa('0xd6'),ut[_0x76aa('0xa7')](_0x43a2af,_0x76aa('0xd7')));rpcDb[_0x76aa('0x96')](_0x43a2af,_0x76aa('0xd8'));_0x368a95['verifyAdditionalPhones'](_0x43a2af,'3',_0x30837c)[_0x76aa('0x84')](function(_0x4f5ded){_0x54390f=_0x4f5ded['additional']==0x1;if(!_0x54390f){if(ut['totalGlobal'](_0x43a2af)>=_0x30837c['dialGlobalMaxRetry']){_0xa19c1c=ut['cloneAction'](_0x43a2af,0xf,_0x76aa('0xaf'));rpcDb[_0x76aa('0xb0')](_0xa19c1c,_0x76aa('0xd9'));}else{if(_0x43a2af[_0x76aa('0xda')]>=_0x30837c['dialNoAnswerMaxRetry']){rpcDb[_0x76aa('0xb0')](_0x43a2af,_0x76aa('0xd8'));}else{rpcDb[_0x76aa('0xd1')](ut[_0x76aa('0xb3')](_0x43a2af,_0x76aa('0xda'),_0x30837c['dialNoAnswerRetryFrequency']),_0x43a2af[_0x76aa('0xb4')],_0x43a2af[_0x76aa('0xb5')]);}}}else{_0x43a2af[_0x76aa('0xda')]++;_0x368a95[_0x76aa('0xd2')]({'id':_0x43a2af[_0x76aa('0xb8')],'field':{'countnoanswerretry':_0x43a2af[_0x76aa('0xda')]}})[_0x76aa('0x84')](function(){_0x368a95['swapAdditionalPhones'](_0x43a2af,_0x7d02e7,_0x1eadee)[_0x76aa('0x84')](function(){});});}});break;case _0x76aa('0xdb'):_0x30837c['outboundCongestionCallsDay']+=0x1;_0x43a2af['countcongestionretry']+=0x1;_0x43a2af[_0x76aa('0xd3')]=ut[_0x76aa('0xad')](_0x43a2af);ut['logCustomer'](_0x43a2af,0x8,_0x76aa('0xdc'));_0x7d02e7=_0x30837c['dialCongestionRetryFrequency'];_0x1eadee=_0x30837c[_0x76aa('0xac')];ami['emit'](_0x76aa('0xdd'),ut[_0x76aa('0xa7')](_0x43a2af,_0x76aa('0xde')));rpcDb[_0x76aa('0x96')](_0x43a2af,_0x76aa('0xdf'));_0x368a95['verifyAdditionalPhones'](_0x43a2af,'8',_0x30837c)[_0x76aa('0x84')](function(_0x54bfd7){_0x54390f=_0x54bfd7[_0x76aa('0xaa')]==0x1;if(!_0x54390f){if(ut[_0x76aa('0xad')](_0x43a2af)>=_0x30837c['dialGlobalMaxRetry']){_0xa19c1c=ut['cloneAction'](_0x43a2af,0xf,_0x76aa('0xaf'));rpcDb[_0x76aa('0xb0')](_0xa19c1c,_0x76aa('0xe0'));}else{if(_0x43a2af[_0x76aa('0xe1')]>=_0x30837c['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x43a2af,_0x76aa('0xdf'));}else{rpcDb['rescheduleContact'](ut[_0x76aa('0xb3')](_0x43a2af,'countcongestionretry',_0x30837c[_0x76aa('0xcb')]),_0x43a2af[_0x76aa('0xb4')],_0x43a2af['activeContact']);}}}else{_0x43a2af[_0x76aa('0xe1')]++;_0x368a95['incrementPreviewCounters']({'id':_0x43a2af['idContact'],'field':{'countcongestionretry':_0x43a2af[_0x76aa('0xe1')]}})[_0x76aa('0x84')](function(){_0x368a95['swapAdditionalPhones'](_0x43a2af,_0x7d02e7,_0x1eadee)[_0x76aa('0x84')](function(){});});}});break;case _0x76aa('0xe2'):_0x30837c[_0x76aa('0x46')]+=0x1;_0x43a2af['countagentrejectretry']+=0x1;_0x43a2af[_0x76aa('0xd3')]=ut[_0x76aa('0xad')](_0x43a2af);ut[_0x76aa('0x98')](_0x43a2af,0x14,_0x76aa('0xe3'));_0x7d02e7=_0x30837c[_0x76aa('0xe4')];_0x1eadee=_0x30837c[_0x76aa('0xac')];ami[_0x76aa('0x26')](_0x76aa('0xe5'),ut[_0x76aa('0xa7')](_0x43a2af,_0x76aa('0xe6')));rpcDb[_0x76aa('0x96')](_0x43a2af,_0x76aa('0xe7'));_0x368a95['verifyAdditionalPhones'](_0x43a2af,'20',_0x30837c)[_0x76aa('0x84')](function(_0x2e69b3){_0x54390f=_0x2e69b3['additional']==0x1;if(!_0x54390f){if(ut[_0x76aa('0xad')](_0x43a2af)>=_0x30837c[_0x76aa('0xcf')]){_0xa19c1c=ut['cloneAction'](_0x43a2af,0x14,'AgentReject');rpcDb[_0x76aa('0xb0')](_0xa19c1c,_0x76aa('0xe8'));}else{if(_0x43a2af['countagentrejectretry']>=_0x30837c[_0x76aa('0xe9')]){rpcDb[_0x76aa('0xb0')](_0x43a2af,_0x76aa('0xe8'));}else{rpcDb['rescheduleContact'](ut[_0x76aa('0xb3')](_0x43a2af,_0x76aa('0xea'),_0x30837c['dialAgentRejectRetryFrequency']),_0x43a2af[_0x76aa('0xb4')],_0x43a2af[_0x76aa('0xb5')]);}}}else{_0x43a2af[_0x76aa('0xda')]++;_0x368a95[_0x76aa('0xd2')]({'id':_0x43a2af[_0x76aa('0xb8')],'field':{'countnoanswerretry':_0x43a2af[_0x76aa('0xda')]}})['then'](function(){_0x368a95[_0x76aa('0xeb')](_0x43a2af,_0x7d02e7,_0x1eadee)['then'](function(){});});}});break;case _0x76aa('0xec'):_0x30837c[_0x76aa('0xed')]+=0x1;_0x43a2af[_0x76aa('0xee')]+=0x1;_0x43a2af['countglobal']=ut['totalGlobal'](_0x43a2af);ut[_0x76aa('0x98')](_0x43a2af,0xb,_0x76aa('0xef'));rpcDb[_0x76aa('0x96')](_0x43a2af,_0x76aa('0xf0'));_0x368a95[_0x76aa('0xa9')](_0x43a2af,'11',_0x30837c)[_0x76aa('0x84')](function(_0x4f7dd4){_0x54390f=_0x4f7dd4['additional']==0x1;if(!_0x54390f){if(ut[_0x76aa('0xad')](_0x43a2af)>=_0x30837c[_0x76aa('0xcf')]){_0xa19c1c=ut[_0x76aa('0xae')](_0x43a2af,0xf,_0x76aa('0xaf'));rpcDb['createCustomerFinal'](_0xa19c1c,_0x76aa('0xf0'));}else{if(_0x43a2af['countabandonedetry']>=_0x30837c['dialAbandonedMaxRety']){rpcDb[_0x76aa('0xb0')](_0x43a2af,_0x76aa('0xf0'));}else{rpcDb[_0x76aa('0xd1')](ut['scheduledAt'](_0x43a2af,_0x76aa('0xee'),_0x30837c[_0x76aa('0xf1')]),_0x43a2af[_0x76aa('0xb4')],_0x43a2af[_0x76aa('0xb5')]);}}}else{_0x43a2af[_0x76aa('0xda')]++;_0x368a95[_0x76aa('0xd2')]({'id':_0x43a2af[_0x76aa('0xb8')],'field':{'countnoanswerretry':_0x43a2af['countnoanswerretry']}})[_0x76aa('0x84')](function(){_0x368a95[_0x76aa('0xeb')](_0x43a2af,_0x7d02e7,_0x1eadee)[_0x76aa('0x84')](function(){});});}});break;case'18':_0x30837c[_0x76aa('0x47')]+=0x1;_0x43a2af[_0x76aa('0xf2')]+=0x1;_0x43a2af[_0x76aa('0xd3')]=ut['totalGlobal'](_0x43a2af);ut[_0x76aa('0x98')](_0x43a2af,0x12,_0x4dfeb3[_0x76aa('0xf3')]||_0x4dfeb3[_0x76aa('0xf4')]);ami[_0x76aa('0x26')]('custom:amd',ut[_0x76aa('0xa7')](_0x43a2af,_0x76aa('0xf5')));rpcDb[_0x76aa('0x96')](_0x43a2af,_0x76aa('0xf6'));_0x368a95[_0x76aa('0xa9')](_0x43a2af,'18',_0x30837c)['then'](function(_0x203bc2){_0x54390f=_0x203bc2[_0x76aa('0xaa')]==0x1;if(!_0x54390f){if(ut['totalGlobal'](_0x43a2af)>=_0x30837c['dialGlobalMaxRetry']){_0xa19c1c=ut[_0x76aa('0xae')](_0x43a2af,0x12,_0x76aa('0xaf'));rpcDb[_0x76aa('0xb0')](_0xa19c1c,_0x76aa('0xf6'));}else{rpcDb[_0x76aa('0xb0')](_0x43a2af,_0x76aa('0xf6'));}}else{_0x43a2af['countnoanswerretry']++;_0x368a95[_0x76aa('0xd2')]({'id':_0x43a2af[_0x76aa('0xb8')],'field':{'countnoanswerretry':_0x43a2af[_0x76aa('0xda')]}})[_0x76aa('0x84')](function(){_0x368a95[_0x76aa('0xeb')](_0x43a2af,_0x7d02e7,_0x1eadee)[_0x76aa('0x84')](function(){});});}});delete this['actions'][_0x4dfeb3[_0x76aa('0xb6')]];break;case'19':_0x30837c[_0x76aa('0x47')]+=0x1;_0x43a2af[_0x76aa('0xd3')]=ut[_0x76aa('0xad')](_0x43a2af);ut[_0x76aa('0x98')](_0x43a2af,0x13,_0x4dfeb3[_0x76aa('0xf3')]||_0x4dfeb3['dialstatus']);ami[_0x76aa('0x26')]('custom:amd',ut[_0x76aa('0xa7')](_0x43a2af,'amd'));rpcDb[_0x76aa('0x96')](_0x43a2af,_0x76aa('0xf7'));_0x368a95['verifyAdditionalPhones'](_0x43a2af,'18',_0x30837c)[_0x76aa('0x84')](function(_0x85a254){_0x54390f=_0x85a254[_0x76aa('0xaa')]==0x1;if(!_0x54390f){if(ut['totalGlobal'](_0x43a2af)>=_0x30837c[_0x76aa('0xcf')]){_0xa19c1c=ut[_0x76aa('0xae')](_0x43a2af,0xf,'Global');rpcDb[_0x76aa('0xb0')](_0xa19c1c,_0x76aa('0xf7'));}else{rpcDb[_0x76aa('0xb0')](_0x43a2af,_0x76aa('0xf7'));}}else{_0x43a2af[_0x76aa('0xda')]++;_0x368a95[_0x76aa('0xd2')]({'id':_0x43a2af['idContact'],'field':{'countnoanswerretry':_0x43a2af[_0x76aa('0xda')]}})[_0x76aa('0x84')](function(){_0x368a95[_0x76aa('0xeb')](_0x43a2af,_0x7d02e7,_0x1eadee)[_0x76aa('0x84')](function(){});});}});delete this[_0x76aa('0x16')][_0x4dfeb3[_0x76aa('0xb6')]];break;default:if(_0x43a2af[_0x76aa('0x72')]){ut[_0x76aa('0xf8')](_0x30837c,_0x76aa('0xf9'));ut[_0x76aa('0x7d')](_0x76aa('0xfa')+_0x30837c['name'],_0x4dfeb3);}_0x30837c[_0x76aa('0x47')]+=0x1;_0x43a2af[_0x76aa('0xd3')]=ut[_0x76aa('0xad')](_0x43a2af);ut[_0x76aa('0x98')](_0x43a2af,0xc,_0x4dfeb3[_0x76aa('0xf3')]||_0x4dfeb3[_0x76aa('0xf4')]);_0x7d02e7=_0x30837c[_0x76aa('0xe4')];_0x1eadee=_0x30837c[_0x76aa('0xac')];rpcDb['createCustomerHistory'](_0x43a2af,_0x76aa('0xfb'));_0x368a95['verifyAdditionalPhones'](_0x43a2af,'20',_0x30837c)[_0x76aa('0x84')](function(_0xae171){_0x54390f=_0xae171[_0x76aa('0xaa')]==0x1;if(!_0x54390f){if(ut['totalGlobal'](_0x43a2af)>=_0x30837c[_0x76aa('0xcf')]){_0xa19c1c=ut[_0x76aa('0xae')](_0x43a2af,0xf,_0x76aa('0xaf'));rpcDb[_0x76aa('0xb0')](_0xa19c1c,_0x76aa('0xfc'));}else{rpcDb['createCustomerFinal'](_0x43a2af,_0x76aa('0xfc'));}delete this['actions'][_0x4dfeb3[_0x76aa('0xb6')]];}else{_0x368a95[_0x76aa('0xeb')](_0x43a2af,_0x7d02e7,_0x1eadee)['then'](function(_0x172866){});}});}if(!(_0x43a2af[_0x76aa('0x72')]&&_0x28feb2==='16')){ut[_0x76aa('0x7b')](_0x30837c,_0x76aa('0xfd'));logger[_0x76aa('0x5d')](_0x76aa('0xfe'),_0x43a2af[_0x76aa('0xbc')],_0x76aa('0xbd'),_0x30837c['name'],_0x76aa('0x70'),_0x30837c[_0x76aa('0x52')]);}if(_0x28feb2!==_0x76aa('0xb9')){delete this[_0x76aa('0x16')][_0x4dfeb3[_0x76aa('0xb6')]];delete this[_0x76aa('0x16')][_0x4dfeb3[_0x76aa('0xff')]];}}};Preview[_0x76aa('0xf')]['callProgressDetectingAgent']=function(_0x37331b,_0x28a40a,_0x13d96a){if(_['isUndefined'](_0x28a40a)&&_0x76aa('0x100')!==typeof _0x28a40a){return;}if(_[_0x76aa('0x101')](_0x13d96a)&&_0x76aa('0x100')!==typeof _0x13d96a){return;}switch(_0x13d96a[_0x76aa('0x102')]){case'0':ut[_0x76aa('0x103')](_0x37331b,0x0,'NoSuchNumber');rpcDb[_0x76aa('0x104')](_0x37331b,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x76aa('0x103')](_0x37331b,0x3,_0x76aa('0xd4'));rpcDb[_0x76aa('0x104')](_0x37331b,_0x76aa('0x105'));break;case'5':ut[_0x76aa('0x103')](_0x37331b,0x5,'Busy');rpcDb[_0x76aa('0x104')](_0x37331b,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x76aa('0x103')](_0x37331b,0x8,_0x76aa('0xdc'));rpcDb[_0x76aa('0x104')](_0x37331b,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x76aa('0x103')](_0x37331b,0x16,'AnswerAGI');rpcDb[_0x76aa('0x104')](_0x37331b,_0x76aa('0x106'));break;default:ut[_0x76aa('0x103')](_0x37331b,0xc,_0x13d96a[_0x76aa('0x102')]);rpcDb[_0x76aa('0x104')](_0x37331b,_0x76aa('0x107'));}ut['updateOriginated'](_0x28a40a,_0x76aa('0x108'));logger[_0x76aa('0x5d')](_0x76aa('0x109'),_0x37331b[_0x76aa('0xbc')],_0x76aa('0xbd'),_0x28a40a[_0x76aa('0x28')],_0x76aa('0x70'),_0x28a40a[_0x76aa('0x52')]);delete this[_0x76aa('0x16')][_0x37331b[_0x76aa('0xbc')]];};Preview[_0x76aa('0xf')][_0x76aa('0xa9')]=function(_0x17e02c,_0x1f187c,_0x347f45){return BPromise[_0x76aa('0x10a')]()[_0x76aa('0x84')](cmHopperAdditionalPhone[_0x76aa('0xa9')](_0x17e02c,_0x1f187c,_0x347f45))['catch'](logger[_0x76aa('0x5d')]('[verifyAdditionalPhone]\x20'));};Preview[_0x76aa('0xf')][_0x76aa('0xeb')]=function(_0x4a093b,_0x191435,_0x5305f1){return BPromise[_0x76aa('0x10a')]()[_0x76aa('0x84')](cmHopperAdditionalPhone[_0x76aa('0xeb')](_0x4a093b,_0x191435,_0x5305f1))['catch'](logger[_0x76aa('0x5d')]('[swapAdditionalPhone]\x20'));};Preview['prototype'][_0x76aa('0xd2')]=function(_0x5a06b0){return BPromise[_0x76aa('0x10a')]()['then'](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x5a06b0))[_0x76aa('0x8d')](logger[_0x76aa('0x5d')](_0x76aa('0x10b')));};Preview[_0x76aa('0xf')][_0x76aa('0x10c')]=function(_0x357f87,_0x434634,_0x3fd2e2,_0x334615,_0x167f5c){var _0x43e020=this;return new BPromise(function(_0x2769c6,_0x903d98){if(_[_0x76aa('0x6d')](_0x434634)||_['isNil'](_0x434634[_0x76aa('0x10d')])||_[_0x76aa('0x6d')](_0x434634[_0x76aa('0x10e')])||_[_0x76aa('0x6d')](_0x434634['VoiceQueueId'])){_0x903d98(ut[_0x76aa('0x64')]('Contact\x20is\x20undefined',_0x334615,_0x167f5c));return;}var _0x3c556c=uuid['v4']();var _0x4dc018=_0x43e020[_0x76aa('0x25')][_0x434634['Queue'][_0x76aa('0x28')]];var _0x490090=_0x3fd2e2?_0x43e020[_0x76aa('0x17')][_0x3fd2e2]['id']:undefined;_0x43e020['actions'][_0x3c556c]=new Action(_0x434634,_0x4dc018,_0x3c556c,_0x3fd2e2,_0x490090);var _0xa473c7=_0x43e020[_0x76aa('0x16')][_0x3c556c];_0xa473c7['unlockAgent']=_0x334615;_0xa473c7[_0x76aa('0xb5')]=_0x167f5c;_0xa473c7['lookAgent']=_0x3fd2e2;if(_[_0x76aa('0x10f')](_0x357f87)){_0x43e020['execCall'](_0xa473c7,_0x4dc018,_0x434634,_0x3fd2e2)[_0x76aa('0x84')](function(_0x5648ab){logger['info'](_0x76aa('0x110'),_0x76aa('0x111')+_0xa473c7[_0x76aa('0x6f')]+_0x76aa('0x112')+_0xa473c7[_0x76aa('0xb8')],JSON[_0x76aa('0x5a')](_0x5648ab));ami[_0x76aa('0x26')](_0x76aa('0x113'),ut[_0x76aa('0xa7')](_0xa473c7,_0x76aa('0x114'),_0x43e020['campaignsPreview'][_0xa473c7[_0x76aa('0x6f')]]));_0x2769c6(ut[_0x76aa('0x64')](_0x76aa('0x115')));})[_0x76aa('0x8d')](function(_0x1db1ce){ut[_0x76aa('0x62')](_0x76aa('0x116'),_0x1db1ce);_0x903d98(ut[_0x76aa('0x64')](_0x76aa('0x117'),_0x334615,_0x167f5c));});}else{_0x4dc018[_0x76aa('0x3d')]+=0x1;ut[_0x76aa('0x118')](_0xa473c7);rpcDb[_0x76aa('0x119')](_0xa473c7,_0x76aa('0x11a'));delete _0x43e020[_0x76aa('0x16')][_0x3c556c];_0x903d98(ut['message']('Contact\x20in\x20black\x20List',_0x334615,_0x167f5c));}});};Preview[_0x76aa('0xf')][_0x76aa('0x9f')]=function(_0x2630f8){return!_['isNil'](_0x2630f8)&&!_['isNil'](_0x2630f8[_0x76aa('0x28')])&&!_[_0x76aa('0x6d')](_0x2630f8[_0x76aa('0x57')])&&_0x2630f8['active']&&!_[_0x76aa('0x6d')](this[_0x76aa('0x15')][util['format']('SIP/%s',_0x2630f8['name'])])&&!_[_0x76aa('0x6d')](this[_0x76aa('0x15')][util[_0x76aa('0x5b')]('SIP/%s',_0x2630f8[_0x76aa('0x28')])][_0x76aa('0x78')])&&(this['trunks'][util['format'](_0x76aa('0x11b'),_0x2630f8[_0x76aa('0x28')])][_0x76aa('0x78')]==='reachable'||this[_0x76aa('0x15')][util[_0x76aa('0x5b')]('SIP/%s',_0x2630f8[_0x76aa('0x28')])][_0x76aa('0x78')]==='unmonitored');};Preview[_0x76aa('0xf')][_0x76aa('0x8b')]=function(_0x4b0d8a,_0x2b9978){var _0x4df504=this;return new BPromise(function(_0x54fdb8,_0x159215){_0x4df504[_0x76aa('0x11c')](_0x4b0d8a,_0x2b9978)[_0x76aa('0x84')](function(_0x131c5e){_0x54fdb8(_[_0x76aa('0x73')](_0x131c5e,[_0x76aa('0x64')]));})[_0x76aa('0x8d')](function(_0x159a87){if(_0x159a87[_0x76aa('0x11d')]){rpcDb[_0x76aa('0x11e')](_0x4b0d8a);}if(_0x159a87['active']){rpcDb['disableContact'](_0x4b0d8a);}_0x159215(_[_0x76aa('0x73')](_0x159a87,[_0x76aa('0x64')]));});});};Preview[_0x76aa('0xf')][_0x76aa('0x11c')]=function(_0x1436e8,_0x2c396f){var _0x498278=this;return new BPromise(function(_0x395b34,_0x139553){var _0x17f15e,_0x29fbf6;rpcDb[_0x76aa('0x11f')](_0x1436e8)[_0x76aa('0x84')](function(_0x1c8cf5){if(!_['isNil'](_0x1c8cf5[0x0])){_0x29fbf6=_0x1c8cf5[0x0]['recallme']?![]:!![];_0x17f15e=_0x1c8cf5[0x0]['recallme']?!![]:![];_0x17f15e=_0x2c396f?!![]:_0x17f15e;}var _0x369b1b=_0x498278[_0x76aa('0x120')](_0x1c8cf5);if(_0x369b1b[_0x76aa('0x121')]){rpcDb[_0x76aa('0x122')](_[_0x76aa('0x73')](_0x1c8cf5[0x0],['VoiceQueueId','phone']))[_0x76aa('0x84')](function(_0x2c6127){_0x498278[_0x76aa('0x10c')](_0x2c6127,_0x1c8cf5[0x0],_0x2c396f,_0x29fbf6,_0x17f15e)[_0x76aa('0x84')](function(_0xe6e51a){_0x395b34(_0xe6e51a);})['catch'](function(_0x349c64){_0x139553(_0x349c64);});})['catch'](function(_0x278be5){ut['logger']('[Preview][checkIsBlackList]',_0x278be5);_0x139553(ut[_0x76aa('0x64')]('Call\x20unsuccessful',_0x29fbf6,_0x17f15e));});}else{_0x139553(ut[_0x76aa('0x64')](_0x369b1b[_0x76aa('0x64')],_0x29fbf6,_0x17f15e));}})[_0x76aa('0x8d')](function(_0x2ab1b7){ut[_0x76aa('0x62')](_0x76aa('0x123'),_0x2ab1b7);_0x139553(ut[_0x76aa('0x64')](_0x76aa('0x124'),![],!![]));});});};Preview['prototype'][_0x76aa('0x120')]=function(_0x37fba1){if(_[_0x76aa('0x6d')](_0x37fba1)||_[_0x76aa('0x10f')](_0x37fba1)||!_[_0x76aa('0x6d')](_0x37fba1[0x0]['Agent'])&&_[_0x76aa('0x6d')](_0x37fba1[0x0]['Agent'][_0x76aa('0x28')])){ut['logger'](_0x76aa('0x125'),_0x37fba1);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x2fba73=this['campaignsPreview'][_0x37fba1[0x0][_0x76aa('0x126')][_0x76aa('0x28')]];_0x2fba73[_0x76aa('0x64')]='ACTIVE';if(_['isNil'](_0x2fba73)){ut[_0x76aa('0x62')]('[Preview][validateContact][Empty\x20Campaign]',_0x2fba73);return{'isValid':![],'message':_0x76aa('0x127')};}if(!this[_0x76aa('0x9f')](_0x2fba73[_0x76aa('0x56')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20'+_0x2fba73['name']+_0x76aa('0x128'));if(!this[_0x76aa('0x9f')](_0x2fba73[_0x76aa('0xa0')])){ut[_0x76aa('0x62')](_0x76aa('0x129'),_0x2fba73[_0x76aa('0x28')]+_0x76aa('0x12a'));return{'isValid':![],'message':_0x76aa('0x12b')};}}if(!ut[_0x76aa('0x9e')](_0x2fba73[_0x76aa('0x36')])){ut[_0x76aa('0x62')](_0x76aa('0x12c'),_0x2fba73[_0x76aa('0x28')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x76aa('0x12d')+_0x2fba73['name']+_0x76aa('0x12e')};}return{'isValid':!![],'message':_0x76aa('0x12f')};};Preview[_0x76aa('0xf')][_0x76aa('0x130')]=function(_0x654c1b,_0x117def,_0x1aab2f,_0x23fe4f){var _0x2c4744=this;return new BPromise(function(_0x1bdc5c,_0x1ae06a){var _0x50f9a4=_0x654c1b['uniqueid'];var _0x319ded=_0x2c4744[_0x76aa('0x9f')](_0x117def['Trunk'])?util[_0x76aa('0x5b')](_0x76aa('0x131'),_0x117def[_0x76aa('0x56')][_0x76aa('0x28')],_[_0x76aa('0x6d')](_0x117def[_0x76aa('0x3b')])?'':_0x117def[_0x76aa('0x3b')]['trim']()||'',_0x117def[_0x76aa('0x132')]>0x0?_0x1aab2f[_0x76aa('0x10e')]['substring'](_0x117def['dialCutDigit']):_0x1aab2f[_0x76aa('0x10e')]):util[_0x76aa('0x5b')](_0x76aa('0x131'),_[_0x76aa('0x6d')](_0x117def[_0x76aa('0xa0')])?_0x117def[_0x76aa('0x56')][_0x76aa('0x28')]:_0x117def[_0x76aa('0xa0')][_0x76aa('0x28')],_[_0x76aa('0x6d')](_0x117def[_0x76aa('0x3b')])?'':_0x117def[_0x76aa('0x3b')][_0x76aa('0x133')]()||'',_0x117def['dialCutDigit']>0x0?_0x1aab2f['phone'][_0x76aa('0x134')](_0x117def[_0x76aa('0x132')]):_0x1aab2f[_0x76aa('0x10e')]);var _0x2affc8=_0x2c4744['isTrunkReachable'](_0x117def['Trunk'])?ut[_0x76aa('0x135')](_0x117def[_0x76aa('0x56')][_0x76aa('0x58')],_0x117def['dialOriginateCallerIdName'],_0x117def['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x117def[_0x76aa('0x39')],_0x117def['dialRandomLastDigitCallerIdNumber']):_0x117def[_0x76aa('0x39')]):ut[_0x76aa('0x135')](_[_0x76aa('0x6d')](_0x117def[_0x76aa('0xa0')])?_0x117def[_0x76aa('0x56')][_0x76aa('0x58')]:_0x117def[_0x76aa('0xa0')][_0x76aa('0x58')],_0x117def[_0x76aa('0x38')],_0x117def[_0x76aa('0x136')]>0x0?ut[_0x76aa('0x137')](_0x117def[_0x76aa('0x39')],_0x117def[_0x76aa('0x136')]):_0x117def[_0x76aa('0x39')]);if(_0x2affc8){_0x654c1b[_0x76aa('0x138')]=ut[_0x76aa('0x139')](_0x2affc8);_0x654c1b['originatecalleridnum']=ut[_0x76aa('0x13a')](_0x2affc8);}var _0x5e8cec=ut[_0x76aa('0x13b')](_0x117def,_0x1aab2f,_0x319ded,_0x2affc8,_0x50f9a4,_0x654c1b);_['merge'](_0x654c1b,ut[_0x76aa('0x13c')](_0x5e8cec));_0x654c1b['starttime']=moment()[_0x76aa('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut[_0x76aa('0x13d')](_0x654c1b,_0x117def,_0x5e8cec,_0x654c1b[_0x76aa('0xb5')],_0x23fe4f))[_0x76aa('0x84')](function(_0x44668d){_0x117def[_0x76aa('0x52')]+=0x1;logger[_0x76aa('0x5d')]('[originated][increment]',_0x50f9a4,_0x76aa('0xbd'),_0x117def[_0x76aa('0x28')],_0x76aa('0x70'),_0x117def[_0x76aa('0x52')]);_0x1bdc5c(_0x44668d);})['catch'](function(_0x3655dd){ut[_0x76aa('0x103')](_0x654c1b,0xe,_0x76aa('0x13e'));rpcDb[_0x76aa('0x104')](_0x654c1b,_0x76aa('0x13f'));_0x1ae06a(_0x3655dd);});});};Preview[_0x76aa('0xf')][_0x76aa('0x1e')]=function(_0x1a6de3){if(this[_0x76aa('0x16')][_0x1a6de3[_0x76aa('0xb6')]]){this[_0x76aa('0x16')][_0x1a6de3[_0x76aa('0xb6')]]['channel']=_0x1a6de3['channel'];}};Preview[_0x76aa('0xf')][_0x76aa('0x140')]=function(_0x31900c){var _0x37c09b=this;var _0x2969d3=this[_0x76aa('0x16')][_0x31900c[_0x76aa('0x141')]];if(_0x2969d3){if(_0x2969d3[_0x76aa('0x142')]&&this[_0x76aa('0x17')][_0x2969d3[_0x76aa('0x142')]]){ut[_0x76aa('0x143')](_0x2969d3,this['agents'][_0x2969d3[_0x76aa('0x142')]]['name'],this[_0x76aa('0x17')][_0x2969d3[_0x76aa('0x142')]]['id']);}var _0x278bac=_[_0x76aa('0x144')](_0x2969d3);_0x278bac[_0x76aa('0xba')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x3056ad=_0x37c09b['campaignsPreview'][_0x2969d3[_0x76aa('0x6f')]];if(ut[_0x76aa('0x145')](_0x31900c[_0x76aa('0x146')])){if(_0x2969d3[_0x76aa('0xb4')]){rpcDb[_0x76aa('0x11e')](_0x2969d3['idContact']);}if(_0x2969d3['activeContact']){rpcDb[_0x76aa('0x8f')](_0x2969d3[_0x76aa('0xb8')]);}ami[_0x76aa('0x26')](_0x76aa('0x147'),ut[_0x76aa('0xa7')](_0x2969d3,_0x76aa('0x148'),this[_0x76aa('0x25')][_0x2969d3[_0x76aa('0x6f')]]));this[_0x76aa('0x149')](_0x278bac,_0x3056ad,_0x31900c);}else{_0x2969d3[_0x76aa('0x90')]=moment()['format'](_0x76aa('0x91'));ut[_0x76aa('0x103')](_0x278bac,0x4,'Answer');rpcDb[_0x76aa('0x104')](_0x278bac,_0x76aa('0x14a'));}}};Preview[_0x76aa('0xf')][_0x76aa('0x1a')]=function(_0x1a5297){var _0x487c28=this;var _0x44bfb3=this['actions'][_0x1a5297[_0x76aa('0xb6')]];var _0x32d853;if(_0x44bfb3){_0x32d853=this[_0x76aa('0x25')][_0x44bfb3[_0x76aa('0x6f')]];logger['info'](_0x76aa('0x14b'),_0x1a5297[_0x76aa('0xb6')],_0x76aa('0xbd'),_0x32d853[_0x76aa('0x28')],_0x76aa('0x71'),_0x32d853[_0x76aa('0x2d')]);}if(this[_0x76aa('0x16')][_0x1a5297[_0x76aa('0xb6')]]&&_0x1a5297[_0x76aa('0xb6')]!==_0x1a5297[_0x76aa('0xbc')]){if(_0x1a5297[_0x76aa('0x14c')]==='16'&&this[_0x76aa('0x16')][_0x1a5297[_0x76aa('0xb6')]][_0x76aa('0x72')]){this['callProgressDetectingCustomer'](_0x1a5297,_0x1a5297['linkedid'],_0x1a5297[_0x76aa('0x14c')]);}else if(this[_0x76aa('0x16')][_0x1a5297['linkedid']][_0x76aa('0x72')]){logger['info'](_0x76aa('0x14d'),_0x1a5297[_0x76aa('0xb6')],_0x1a5297[_0x76aa('0x14c')],_0x76aa('0xbd'),_0x32d853[_0x76aa('0x28')],_0x76aa('0x71'),_0x32d853[_0x76aa('0x2d')]);this[_0x76aa('0xa3')](_0x1a5297,_0x1a5297['linkedid'],_0x1a5297[_0x76aa('0x14c')]);}}else if(_0x44bfb3&&_[_0x76aa('0x6d')](_0x44bfb3['statedesc'])&&_0x32d853['dialQueueProject']&&_0x1a5297[_0x76aa('0xb6')]===_0x1a5297[_0x76aa('0xbc')]&&_[_0x76aa('0x6d')](_0x1a5297[_0x76aa('0x102')])&&_0x1a5297[_0x76aa('0x14c')]==='16'&&_0x1a5297['channelstate']==='6'&&_[_0x76aa('0x101')](_0x44bfb3['transfer'])){if(_0x44bfb3[_0x76aa('0xb4')]){rpcDb[_0x76aa('0x11e')](_0x44bfb3[_0x76aa('0xb8')]);}if(_0x44bfb3[_0x76aa('0xb5')]){rpcDb[_0x76aa('0x8f')](_0x44bfb3[_0x76aa('0xb8')]);}_0x1a5297[_0x76aa('0x102')]='22';this[_0x76aa('0x149')](_0x44bfb3,_0x32d853,_0x1a5297);}else if(_0x44bfb3&&_0x44bfb3[_0x76aa('0x14e')]){if(_0x1a5297[_0x76aa('0x14c')]==='16'&&this[_0x76aa('0x16')][_0x1a5297[_0x76aa('0xb6')]][_0x76aa('0x72')]){logger['info'](_0x76aa('0x14f'),_0x1a5297['linkedid'],_0x1a5297['cause'],'\x20Queue',_0x32d853[_0x76aa('0x28')],'pTalking:\x20',_0x32d853['pTalking']);this['callProgressDetectingCustomer'](_0x1a5297,_0x1a5297['linkedid'],_0x1a5297[_0x76aa('0x14c')]);}else if(this[_0x76aa('0x16')][_0x1a5297['linkedid']][_0x76aa('0x72')]){logger[_0x76aa('0x5d')](_0x76aa('0x14d'),_0x1a5297['linkedid'],_0x1a5297['cause'],'\x20Queue',_0x32d853[_0x76aa('0x28')],'pTalking:\x20',_0x32d853[_0x76aa('0x2d')]);this[_0x76aa('0xa3')](_0x1a5297,_0x1a5297['linkedid'],_0x1a5297[_0x76aa('0x14c')]);}}};Preview[_0x76aa('0xf')]['syncDialEnd']=function(_0x2b10fd){if(this[_0x76aa('0x16')][_0x2b10fd[_0x76aa('0xff')]]&&_0x2b10fd[_0x76aa('0xff')]!==_0x2b10fd[_0x76aa('0x150')]){this[_0x76aa('0xa3')](_0x2b10fd,_0x2b10fd[_0x76aa('0xff')],_0x2b10fd[_0x76aa('0xf4')]);}};Preview['prototype'][_0x76aa('0x1b')]=function(_0x9e4831){if(this[_0x76aa('0x16')][_0x9e4831[_0x76aa('0xb6')]]&&_0x9e4831[_0x76aa('0xb6')]!==_0x9e4831[_0x76aa('0xbc')]&&!this[_0x76aa('0x16')][_0x9e4831[_0x76aa('0xb6')]][_0x76aa('0x72')]){if(_0x9e4831[_0x76aa('0x14c')]==='1'){this['callProgressDetectingCustomer'](_0x9e4831,_0x9e4831[_0x76aa('0xb6')],_0x9e4831[_0x76aa('0x14c')]);}}};Preview[_0x76aa('0xf')]['addVariable']=function(_0x5baab3,_0x5bd9f1,_0x1592d0){if(this[_0x76aa('0x16')][_0x5baab3]){if(_['isNil'](this[_0x76aa('0x16')][_0x5baab3]['variables'])){this['actions'][_0x5baab3][_0x76aa('0x151')]={};}this[_0x76aa('0x16')][_0x5baab3]['variables'][_0x5bd9f1]=_0x1592d0;}};Preview[_0x76aa('0xf')][_0x76aa('0x20')]=function(_0x60ba1f){try{if(!_['isNil'](_0x60ba1f)){if(ut[_0x76aa('0x152')](_[_0x76aa('0x153')](_0x60ba1f[_0x76aa('0x154')])[0x0])){this[_0x76aa('0x155')](_0x60ba1f[_0x76aa('0xbc')],_[_0x76aa('0x153')](_0x60ba1f[_0x76aa('0x154')])[0x0],_0x60ba1f[_0x76aa('0x156')]);}}}catch(_0x472573){logger[_0x76aa('0x157')](_0x76aa('0x158'),util['inspect'](_0x472573,{'showHidden':![],'depth':null}));}};Preview[_0x76aa('0xf')][_0x76aa('0x21')]=function(_0xf0c2e9){if(_0xf0c2e9){if(this['actions'][_0xf0c2e9['transfertargetlinkedid']]){this[_0x76aa('0x16')][_0xf0c2e9[_0x76aa('0x159')]][_0x76aa('0x14e')]=!![];}}};Preview['prototype'][_0x76aa('0x23')]=function(_0x38fcbf){if(_0x38fcbf){if(this[_0x76aa('0x16')][_0x38fcbf[_0x76aa('0x15a')]]){this[_0x76aa('0x16')][_0x38fcbf[_0x76aa('0x15a')]][_0x76aa('0x14e')]=!![];}}};module[_0x76aa('0x15b')]=Preview;
\ No newline at end of file
index eb144c6..43898e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8775=['../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','exten','xcally-motion-preview','assigned','queuecallerexitreason','COMPLETED','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','lodash','../rpc/cmHopper'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x8775,0x1f4));var _0x5877=function(_0x1ae78f,_0x122ed2){_0x1ae78f=_0x1ae78f-0x0;var _0x5baf80=_0x8775[_0x1ae78f];return _0x5baf80;};'use strict';var util=require(_0x5877('0x0'));var BPromise=require('bluebird');var logger=require(_0x5877('0x1'))('preview');var _=require(_0x5877('0x2'));var cmHopper=require(_0x5877('0x3'));var cmHopperFinal=require(_0x5877('0x4'));var cmHopperHistory=require(_0x5877('0x5'));var cmHopperBlack=require(_0x5877('0x6'));var voiceQueueRt=require(_0x5877('0x7'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x5877('0x8'));function loggerCatch(_0x9246b9){return function(_0x164fc1){logger[_0x5877('0x9')](_0x9246b9,util[_0x5877('0xa')](_0x164fc1,{'showHidden':![],'depth':null}));};}function create(_0x484318){return BPromise[_0x5877('0xb')]()['then'](cmHopperHistory[_0x5877('0xc')](_0x484318))[_0x5877('0xd')](loggerCatch(_0x5877('0xe')));}function createAgent(_0x385424){return BPromise[_0x5877('0xb')]()[_0x5877('0xf')](agentReportPreview[_0x5877('0xc')](_0x385424))[_0x5877('0xd')](loggerCatch(_0x5877('0xe')));}function moveContact(_0x4820f0){return BPromise['resolve']()[_0x5877('0xf')](cmHopper[_0x5877('0x10')](_0x4820f0,!![]))[_0x5877('0xd')](loggerCatch(_0x5877('0x11')));}exports[_0x5877('0x12')]=function(_0x52c1aa){return BPromise[_0x5877('0xb')]()[_0x5877('0xf')](cmHopperBlack[_0x5877('0x12')](_0x52c1aa))[_0x5877('0xd')](loggerCatch(_0x5877('0x13')));};exports[_0x5877('0x14')]=function(_0x49d143){return BPromise[_0x5877('0xb')]()[_0x5877('0xf')](cmHopper[_0x5877('0x14')](_0x49d143))['catch'](loggerCatch(_0x5877('0x15')));};exports[_0x5877('0xc')]=function(_0x13053c,_0x42d0c1){create(_0x13053c)[_0x5877('0xd')](loggerCatch(_0x42d0c1));moveContact(_0x13053c)[_0x5877('0xd')](loggerCatch(_0x42d0c1));};exports[_0x5877('0x16')]=function(_0xf61eb,_0x406c1c){createAgent(_0xf61eb)[_0x5877('0xd')](loggerCatch(_0x406c1c));};exports[_0x5877('0x17')]=function(_0x4cc09f,_0x1efd03){create(_0x4cc09f)[_0x5877('0xd')](loggerCatch(_0x1efd03));};exports[_0x5877('0x18')]=function(_0x386b27,_0xef83c7){moveContact(_0x386b27)[_0x5877('0xd')](loggerCatch(_0xef83c7));};exports[_0x5877('0x19')]=function(_0x43cd7a,_0x24bd2b,_0x2f4636){if(_0x24bd2b){_0x43cd7a[_0x5877('0x1a')]=null;}if(_0x2f4636){_0x43cd7a[_0x5877('0x1b')]=![];}return BPromise['resolve']()[_0x5877('0xf')](cmHopper['rescheduleContact'](_0x43cd7a))['catch'](loggerCatch(_0x5877('0x1c')));};exports[_0x5877('0x1d')]=function(_0x1df240){return BPromise['resolve']()[_0x5877('0xf')](cmHopper[_0x5877('0x1d')](_0x1df240))[_0x5877('0xd')](loggerCatch(_0x5877('0x1e')));};exports[_0x5877('0x1f')]=function(_0x1d807e){return BPromise[_0x5877('0xb')]()[_0x5877('0xf')](cmHopper['unlockContact']({'UserId':null},_0x1d807e,0x1))[_0x5877('0xd')](loggerCatch(_0x5877('0x20')));};exports[_0x5877('0x21')]=function(_0x29efee){return BPromise[_0x5877('0xb')]()[_0x5877('0xf')](cmHopper['unlockContact']({'active':![]},_0x29efee,0x1))[_0x5877('0xd')](loggerCatch(_0x5877('0x22')));};exports[_0x5877('0x23')]=function(_0x24aec9){var _0x1f64f1={};_0x1f64f1[_0x5877('0x24')]=_0x24aec9[_0x5877('0x24')];_0x1f64f1[_0x5877('0x25')]=_0x24aec9['uniqueid'];_0x1f64f1[_0x5877('0x26')]=_0x24aec9[_0x5877('0x26')];_0x1f64f1[_0x5877('0x27')]=_0x24aec9[_0x5877('0x27')];_0x1f64f1[_0x5877('0x28')]=_0x24aec9['queue'];_0x1f64f1[_0x5877('0x29')]=_0x24aec9['answertime'];_0x1f64f1[_0x5877('0x2a')]=_0x24aec9['answertime'];_0x1f64f1[_0x5877('0x2b')]=0x1;_0x1f64f1[_0x5877('0x2c')]=_0x24aec9['endtime'];_0x1f64f1[_0x5877('0x2d')]=_0x24aec9[_0x5877('0x2e')];_0x1f64f1['context']='from-sip';_0x1f64f1[_0x5877('0x2f')]=_0x5877('0x30');_0x1f64f1['holdtime']=0x0;_0x1f64f1[_0x5877('0x31')]=0x1;_0x1f64f1['lastAssignedTo']=_0x24aec9['membername'];_0x1f64f1[_0x5877('0x32')]=_0x5877('0x33');return BPromise[_0x5877('0xb')]()[_0x5877('0xf')](voiceQueueReport['create'](_0x1f64f1))[_0x5877('0xd')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x5877('0x34')]=function(_0x4854cf,_0x5d242f){return BPromise[_0x5877('0xb')]()[_0x5877('0xf')](cmHopper[_0x5877('0x34')](_0x4854cf,_0x5d242f))['catch'](loggerCatch(_0x5877('0x35')));};exports[_0x5877('0x36')]=function(_0x5be6d3){return BPromise['resolve']()[_0x5877('0xf')](cmHopper[_0x5877('0x19')](_0x5be6d3,!![],!![]))[_0x5877('0xd')](loggerCatch(_0x5877('0x37')));};
\ No newline at end of file
+var _0xe098=['createHistory','catch','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/agentReportPreview','../rpc/voiceQueueReport','then'];(function(_0x2057c6,_0x57a55e){var _0x498778=function(_0x11607d){while(--_0x11607d){_0x2057c6['push'](_0x2057c6['shift']());}};_0x498778(++_0x57a55e);}(_0xe098,0xfe));var _0x8e09=function(_0x2f2fc0,_0x226bc9){_0x2f2fc0=_0x2f2fc0-0x0;var _0x51540b=_0xe098[_0x2f2fc0];return _0x51540b;};'use strict';var util=require(_0x8e09('0x0'));var BPromise=require(_0x8e09('0x1'));var logger=require(_0x8e09('0x2'))(_0x8e09('0x3'));var _=require(_0x8e09('0x4'));var cmHopper=require(_0x8e09('0x5'));var cmHopperFinal=require(_0x8e09('0x6'));var cmHopperHistory=require(_0x8e09('0x7'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x8e09('0x8'));var voiceQueueReport=require(_0x8e09('0x9'));function loggerCatch(_0x448959){return function(_0x230c37){logger['error'](_0x448959,util['inspect'](_0x230c37,{'showHidden':![],'depth':null}));};}function create(_0x284224){return BPromise['resolve']()[_0x8e09('0xa')](cmHopperHistory[_0x8e09('0xb')](_0x284224))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x572dfa){return BPromise['resolve']()[_0x8e09('0xa')](agentReportPreview[_0x8e09('0xb')](_0x572dfa))[_0x8e09('0xc')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x5a7eaf){return BPromise[_0x8e09('0xd')]()['then'](cmHopper[_0x8e09('0xe')](_0x5a7eaf,!![]))[_0x8e09('0xc')](loggerCatch(_0x8e09('0xf')));}exports[_0x8e09('0x10')]=function(_0x3ed873){return BPromise[_0x8e09('0xd')]()['then'](cmHopperBlack[_0x8e09('0x10')](_0x3ed873))[_0x8e09('0xc')](loggerCatch(_0x8e09('0x11')));};exports[_0x8e09('0x12')]=function(_0x39fcba){return BPromise['resolve']()['then'](cmHopper[_0x8e09('0x12')](_0x39fcba))[_0x8e09('0xc')](loggerCatch(_0x8e09('0x13')));};exports['createHistory']=function(_0x2e7031,_0x1ce372){create(_0x2e7031)[_0x8e09('0xc')](loggerCatch(_0x1ce372));moveContact(_0x2e7031)[_0x8e09('0xc')](loggerCatch(_0x1ce372));};exports[_0x8e09('0x14')]=function(_0x1ee988,_0x294bbf){createAgent(_0x1ee988)['catch'](loggerCatch(_0x294bbf));};exports['createCustomerHistory']=function(_0x2e7a1b,_0x51c162){create(_0x2e7a1b)['catch'](loggerCatch(_0x51c162));};exports[_0x8e09('0x15')]=function(_0xcb39c4,_0x4728d7){moveContact(_0xcb39c4)['catch'](loggerCatch(_0x4728d7));};exports[_0x8e09('0x16')]=function(_0x44195b,_0x4aec7b,_0x428af3){if(_0x4aec7b){_0x44195b[_0x8e09('0x17')]=null;}if(_0x428af3){_0x44195b[_0x8e09('0x18')]=![];}return BPromise[_0x8e09('0xd')]()[_0x8e09('0xa')](cmHopper[_0x8e09('0x16')](_0x44195b))[_0x8e09('0xc')](loggerCatch(_0x8e09('0x19')));};exports[_0x8e09('0x1a')]=function(_0x2b0b37){return BPromise[_0x8e09('0xd')]()[_0x8e09('0xa')](cmHopper[_0x8e09('0x1a')](_0x2b0b37))[_0x8e09('0xc')](loggerCatch('[countReScheduled]\x20'));};exports[_0x8e09('0x1b')]=function(_0x4ccc42){return BPromise[_0x8e09('0xd')]()[_0x8e09('0xa')](cmHopper[_0x8e09('0x1b')]({'UserId':null},_0x4ccc42,0x1))[_0x8e09('0xc')](loggerCatch(_0x8e09('0x1c')));};exports['disableContact']=function(_0x29228f){return BPromise['resolve']()[_0x8e09('0xa')](cmHopper['unlockContact']({'active':![]},_0x29228f,0x1))[_0x8e09('0xc')](loggerCatch(_0x8e09('0x1d')));};exports['crateCustomerReportQueue']=function(_0x26edf7){var _0x38c65e={};_0x38c65e[_0x8e09('0x1e')]=_0x26edf7[_0x8e09('0x1e')];_0x38c65e[_0x8e09('0x1f')]=_0x26edf7['uniqueid'];_0x38c65e[_0x8e09('0x20')]=_0x26edf7[_0x8e09('0x20')];_0x38c65e['calleridname']=_0x26edf7[_0x8e09('0x21')];_0x38c65e[_0x8e09('0x22')]=_0x26edf7[_0x8e09('0x22')];_0x38c65e[_0x8e09('0x23')]=_0x26edf7['answertime'];_0x38c65e[_0x8e09('0x24')]=_0x26edf7[_0x8e09('0x25')];_0x38c65e[_0x8e09('0x26')]=0x1;_0x38c65e[_0x8e09('0x27')]=_0x26edf7[_0x8e09('0x28')];_0x38c65e['connectedlinename']=_0x26edf7[_0x8e09('0x29')];_0x38c65e[_0x8e09('0x2a')]=_0x8e09('0x2b');_0x38c65e['exten']=_0x8e09('0x2c');_0x38c65e[_0x8e09('0x2d')]=0x0;_0x38c65e[_0x8e09('0x2e')]=0x1;_0x38c65e[_0x8e09('0x2f')]=_0x26edf7['membername'];_0x38c65e['queuecallerexitreason']=_0x8e09('0x30');return BPromise[_0x8e09('0xd')]()[_0x8e09('0xa')](voiceQueueReport[_0x8e09('0x31')](_0x38c65e))[_0x8e09('0xc')](loggerCatch(_0x8e09('0x32')));};exports[_0x8e09('0x33')]=function(_0x53f279,_0x3fe6e1){return BPromise[_0x8e09('0xd')]()['then'](cmHopper[_0x8e09('0x33')](_0x53f279,_0x3fe6e1))[_0x8e09('0xc')](loggerCatch(_0x8e09('0x34')));};exports['rescheduleContactInQueue']=function(_0x3d12b8){return BPromise[_0x8e09('0xd')]()[_0x8e09('0xa')](cmHopper[_0x8e09('0x16')](_0x3d12b8,!![],!![]))[_0x8e09('0xc')](loggerCatch('[rescheduleContactInQueue]\x20'));};
\ No newline at end of file
index cb8f680..1b52a47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d50=['XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','state','statedesc','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','scheduledat','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','reachable','getDiff','seconds','createBody','CampaignId','type','campaigntype','dialAnswer','callback','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','bridgepeer','\x5cw{0,','random','extractCalleridName','match','extractCalleridNumber','util','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','loggerCatch','inspect','loggerError','logger2','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','Queue','calleridnum','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','NONE','dialQueueProject2','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','%s%s'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x1d50,0x169));var _0x01d5=function(_0x4a97b0,_0x527f23){_0x4a97b0=_0x4a97b0-0x0;var _0x267932=_0x1d50[_0x4a97b0];return _0x267932;};'use strict';var util=require(_0x01d5('0x0'));var _=require('lodash');var moment=require(_0x01d5('0x1'));var logger=require(_0x01d5('0x2'))(_0x01d5('0x3'));var ipAgi=process[_0x01d5('0x4')][_0x01d5('0x5')]||'127.0.0.1';function getSeconds(_0x5747ac,_0x175e03){var _0x5f56e6=moment(_0x5747ac)[_0x01d5('0x6')](0x0);var _0xc10ed9=moment(_0x175e03)[_0x01d5('0x6')](0x0);return _0x5f56e6[_0x01d5('0x7')](_0xc10ed9,'seconds');}exports[_0x01d5('0x8')]=function(_0x503a28){return function(_0x51a88b){logger['error'](_0x503a28,util[_0x01d5('0x9')](_0x51a88b,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x2d870b,_0x3e5c1d){logger['info'](_0x2d870b,util[_0x01d5('0x9')](_0x3e5c1d,{'showHidden':![],'depth':null}));};exports[_0x01d5('0xa')]=function(_0x4bb29f,_0x36f45c){logger['error'](_0x4bb29f,util[_0x01d5('0x9')](_0x36f45c,{'showHidden':![],'depth':null}));};exports[_0x01d5('0xb')]=function(_0x5238de){return function(_0x2752bf){logger['info'](_0x5238de,util[_0x01d5('0x9')](_0x2752bf,{'showHidden':![],'depth':null}));};};exports[_0x01d5('0xc')]=function(_0x1e658f,_0x164645,_0x122c66){return{'message':_0x1e658f,'unlock':_0x164645,'active':_0x122c66};};exports['getCallerId']=function(_0x588452,_0x1a6750,_0x51fd39){if(!_[_0x01d5('0xd')](_0x51fd39)&&_0x01d5('0xe')===typeof _0x51fd39&&!_[_0x01d5('0xf')](_0x51fd39)){if(!_[_0x01d5('0xd')](_0x1a6750)&&_0x01d5('0xe')===typeof _0x1a6750&&!_[_0x01d5('0xf')](_0x1a6750)){return util[_0x01d5('0x10')]('\x22%s\x22\x20<%s>',_0x1a6750,_0x51fd39);}return util[_0x01d5('0x10')](_0x01d5('0x11'),_0x51fd39,_0x51fd39);}if(!_[_0x01d5('0xd')](_0x588452)&&_0x01d5('0xe')===typeof _0x588452&&!_['isEmpty'](_0x588452)){return _0x588452;}return _0x01d5('0x12');};exports['isActive']=function(_0x56ad04){if(_[_0x01d5('0x13')](_0x56ad04)){return![];}return _0x56ad04;};exports['addVariables']=function(_0xa2dec2,_0xda58b8,_0x6db666,_0x21fef0,_0x3688e1,_0x45fb41){var _0x2697ff={'XMD-QUEUE':_0xda58b8['Queue']?_0xda58b8[_0x01d5('0x14')]['name']:'','XMD-CALLERID':_0x21fef0,'XMD-CALLERID-PREVIEW':_0x45fb41?util['format'](_0x01d5('0x11'),_0x45fb41['calleridname'],_0x45fb41[_0x01d5('0x15')]):_0x21fef0,'XMD-DIALID':_0x3688e1,'XMD-CONTACTID':_0xda58b8['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x21fef0,'XMD-VOICEQUEUEID':_0xda58b8[_0x01d5('0x16')],'XMD-DIALCHANNEL':_0x6db666,'XMD-DIALTIMEOUT':_0xa2dec2[_0x01d5('0x17')]||0x1e,'XMD-DIALOPTIONS':util[_0x01d5('0x10')](_0x01d5('0x18'),_0xa2dec2['dialQueueProject2']?'g':'',_[_0x01d5('0xf')](_0xa2dec2[_0x01d5('0x19')])?'':_0x01d5('0x1a')),'XMD-DIALURL':_0xa2dec2['dialPreviewUrl']||'','XMD-AGI':_0xa2dec2[_0x01d5('0x1b')]?util[_0x01d5('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0xa2dec2[_0x01d5('0x1b')]):_0x01d5('0x1c'),'XMD-AGIAFTER':_0xa2dec2[_0x01d5('0x1d')]?util[_0x01d5('0x10')](_0x01d5('0x1e'),ipAgi,_0xa2dec2[_0x01d5('0x1d')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x45fb41?_0x45fb41[_0x01d5('0x1f')]:'','XMD-ORIGINATECALLERIDNAME':_0x45fb41?_0x45fb41[_0x01d5('0x20')]:'','XMD-DESTINATION':_0x01d5('0x21'),'SIPADDHEADER':_0x01d5('0x22')};if(!_[_0x01d5('0xf')](_0xa2dec2[_0x01d5('0x19')])){_0x2697ff[util[_0x01d5('0x10')]('%s',_0x01d5('0x23'))]=_0xa2dec2[_0x01d5('0x19')];_0x2697ff[util[_0x01d5('0x10')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x3688e1;}if(_0xda58b8&&_0xda58b8[_0x01d5('0x24')]){for(var _0x5799f1 in _0xda58b8[_0x01d5('0x24')]){if(_0xda58b8[_0x01d5('0x24')][_0x01d5('0x25')](_0x5799f1)){if(!_[_0x01d5('0x13')](_0xda58b8['Contact'][_0x5799f1])&&_0x5799f1!=='id'&&_0x5799f1!==_0x01d5('0x26')&&_0x5799f1!==_0x01d5('0x27')&&_0x5799f1!=='updatedAt'){_0x2697ff[util[_0x01d5('0x10')](_0x01d5('0x28'),_0x01d5('0x29'),_[_0x01d5('0x2a')](_0x5799f1))]=_0xda58b8[_0x01d5('0x24')][_0x5799f1];}}}}return _0x2697ff;};exports[_0x01d5('0x2b')]=function(_0x50225f){var _0x14796f={};for(var _0x37f847 in _0x50225f){if(_0x50225f[_0x01d5('0x25')](_0x37f847)){_0x14796f[util[_0x01d5('0x10')]('%s',_[_0x01d5('0x2c')](_0x37f847))]=_0x50225f[_0x37f847];}}return{'variables':_0x14796f};};exports[_0x01d5('0x2d')]=function(_0x35cbf1,_0x5ae32b){if(!_['isNil'](_0x35cbf1)){if(_0x35cbf1[_0x01d5('0x25')]('originated')){if(_0x35cbf1[_0x01d5('0x2e')]>0x0){_0x35cbf1[_0x01d5('0x2e')]-=0x1;}else{logger[_0x01d5('0x2f')](_0x01d5('0x30'),_0x5ae32b);}}}else{logger[_0x01d5('0x2f')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x5ae32b);}};exports['logBlacklist']=function(_0x485c98){var _0x5d4ae4=moment()[_0x01d5('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x485c98[_0x01d5('0x31')]=0xd;_0x485c98[_0x01d5('0x32')]='Blacklist';_0x485c98[_0x01d5('0x33')]=_0x5d4ae4;_0x485c98[_0x01d5('0x34')]=_0x5d4ae4;_0x485c98[_0x01d5('0x35')]=_0x5d4ae4;};exports[_0x01d5('0x36')]=function(_0x3f0752,_0x48d16f,_0x1799a1){var _0x3e498d=moment()[_0x01d5('0x10')](_0x01d5('0x37'));_0x3f0752[_0x01d5('0x31')]=_0x48d16f;_0x3f0752[_0x01d5('0x32')]=_0x1799a1;_0x3f0752[_0x01d5('0x34')]=_0x3e498d;_0x3f0752[_0x01d5('0x38')]=getSeconds(_0x3f0752[_0x01d5('0x34')],_0x3f0752[_0x01d5('0x33')]);};exports[_0x01d5('0x39')]=function(_0x1e8dc6,_0x52c2d8,_0x4779d1){_0x1e8dc6[_0x01d5('0x3a')]=_0x52c2d8;_0x1e8dc6[_0x01d5('0x3b')]=_0x4779d1;};exports[_0x01d5('0x3c')]=function(_0x3ba7e8,_0x4a3a8b,_0x270298){var _0x451b7c=moment()['format'](_0x01d5('0x37'));_0x3ba7e8[_0x01d5('0x31')]=_0x4a3a8b;_0x3ba7e8[_0x01d5('0x32')]=_0x270298;_0x3ba7e8[_0x01d5('0x34')]=_0x3ba7e8[_0x01d5('0x34')]?_0x3ba7e8[_0x01d5('0x34')]:_0x451b7c;_0x3ba7e8['endtime']=_0x3ba7e8[_0x01d5('0x35')]?_0x3ba7e8[_0x01d5('0x35')]:_0x451b7c;_0x3ba7e8[_0x01d5('0x38')]=getSeconds(_0x3ba7e8[_0x01d5('0x34')]||0x0,_0x3ba7e8[_0x01d5('0x33')]||0x0);_0x3ba7e8[_0x01d5('0x3d')]=_0x3ba7e8[_0x01d5('0x3e')]?getSeconds(_0x3ba7e8['endtime'],_0x3ba7e8[_0x01d5('0x3e')]):0x0;};exports[_0x01d5('0x3f')]=function(_0x3bdbda){return _0x3bdbda===_0x01d5('0x40');};exports[_0x01d5('0x41')]=function(_0x21d1fe,_0x2337ed,_0x138c90,_0x4e0120,_0x30a95f){var _0x5e3bec=_0x4e0120?_0x01d5('0x42'):_0x21d1fe[_0x01d5('0x43')];_0x5e3bec=_0x30a95f?_0x01d5('0x44'):_0x5e3bec;return{'actionid':_0x21d1fe[_0x01d5('0x45')],'action':_0x01d5('0x46'),'channel':_0x21d1fe[_0x01d5('0x47')],'callerid':util[_0x01d5('0x10')](_0x01d5('0x11'),_0x5e3bec,_0x21d1fe['calleridnum']),'Exten':'xcally-motion-preview','Context':_0x01d5('0x48'),'Priority':'1','variable':_0x138c90,'timeout':(_0x2337ed[_0x01d5('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x21d1fe[_0x01d5('0x45')]};};exports['totalGlobal']=function(_0x4e3eb6){return _0x4e3eb6[_0x01d5('0x4a')]+_0x4e3eb6[_0x01d5('0x4b')]+_0x4e3eb6[_0x01d5('0x4c')]+_0x4e3eb6[_0x01d5('0x4d')]+_0x4e3eb6[_0x01d5('0x4e')];};exports['cloneAction']=function(_0x20c310){var _0x2ffb76=_[_0x01d5('0x4f')](_0x20c310);_0x2ffb76[_0x01d5('0x31')]=0xf;_0x2ffb76[_0x01d5('0x32')]='Global';return _0x2ffb76;};exports['scheduledAt']=function(_0x12b399,_0x4e75cf,_0x51c474){var _0x2d4863={};_0x2d4863[_0x4e75cf]=_0x12b399[_0x4e75cf];_0x2d4863['active']=![];_0x2d4863[_0x01d5('0x50')]=moment()[_0x01d5('0x51')](_0x51c474,_0x01d5('0x52'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2d4863[_0x01d5('0x53')]=_0x12b399[_0x01d5('0x53')];_0x2d4863[_0x01d5('0x54')]=_0x12b399[_0x01d5('0x54')];_0x2d4863['VoiceQueueId']=_0x12b399[_0x01d5('0x16')]||undefined;return _0x2d4863;};exports[_0x01d5('0x55')]=function(_0x12db64,_0x42b4d8){if(!_[_0x01d5('0x13')](_0x12db64)){if(_0x12db64['pTalking']>0x0){_0x12db64[_0x01d5('0x56')]-=0x1;}else{logger['error'](_0x42b4d8,_0x01d5('0x57'));}}else{logger['error'](_0x42b4d8,_0x01d5('0x58'));}};exports['IsNotLoggedIn']=function(_0x3ce33a){if(_0x3ce33a<=0x0){return!![];}return![];};exports[_0x01d5('0x59')]=function(_0x352fa3,_0x1515c8,_0x48559a){_0x352fa3[_0x01d5('0x5a')]=_0x1515c8;_0x352fa3['name']=_0x352fa3[_0x01d5('0x5b')];_0x352fa3[_0x01d5('0x5c')]=_0x352fa3[_0x01d5('0x47')];_0x352fa3[_0x01d5('0x5d')]=_0x01d5('0x5e');if(_0x48559a){_0x352fa3['mandatoryDisposition']=_0x48559a[_0x01d5('0x5f')];}return _0x352fa3;};exports[_0x01d5('0x60')]=function(_0x5e45ac){var _0x357f3c={};_0x357f3c[_0x01d5('0x5b')]=_0x5e45ac[_0x01d5('0x5b')];_0x357f3c[_0x01d5('0x5c')]=_0x5e45ac['channelAgent'];_0x357f3c[_0x01d5('0x45')]=_0x5e45ac[_0x01d5('0x45')];return _0x357f3c;};exports[_0x01d5('0x61')]=function(_0x267476){var _0x4fd19c=[];for(var _0x283e89 in _0x267476){if(_0x267476['hasOwnProperty'](_0x283e89)){if(!_[_0x01d5('0x13')](_0x267476[_0x283e89])&&_0x267476[_0x283e89][_0x01d5('0x31')]===_0x01d5('0x62')&&_0x267476[_0x283e89]['status']===_0x01d5('0x63')){_0x4fd19c['push'](_0x267476[_0x283e89]['id']);}}}return _0x4fd19c;};exports[_0x01d5('0x64')]=function(_0x7ae49e){var _0x3c05b2=moment()[_0x01d5('0x6')](0x0);var _0x39f75a=moment(_0x7ae49e)[_0x01d5('0x6')](0x0);return _0x3c05b2['diff'](_0x39f75a,_0x01d5('0x65'));};exports[_0x01d5('0x66')]=function(_0x18a00e){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x18a00e['ContactId'],'ListId':_0x18a00e[_0x01d5('0x54')],'VoiceQueueId':_0x18a00e['VoiceQueueId']||undefined,'CampaignId':_0x18a00e[_0x01d5('0x67')]||undefined};};exports['filterKey']=function(_0x2be572){if(_0x2be572===_0x01d5('0x45')||_0x2be572==='idContact'||_0x2be572===_0x01d5('0x5b')||_0x2be572===_0x01d5('0x68')||_0x2be572===_0x01d5('0x69')||_0x2be572===_0x01d5('0x6a')||_0x2be572==='membername'||_0x2be572===_0x01d5('0x47')||_0x2be572==='calleridname'||_0x2be572==='active'||_0x2be572===_0x01d5('0x15')||_0x2be572===_0x01d5('0x50')||_0x2be572===_0x01d5('0x4a')||_0x2be572==='countcongestionretry'||_0x2be572===_0x01d5('0x4c')||_0x2be572==='countglobal'||_0x2be572===_0x01d5('0x6b')||_0x2be572==='callbackuniqueid'||_0x2be572==='callbackat'||_0x2be572==='recallme'||_0x2be572===_0x01d5('0x53')||_0x2be572==='ListId'||_0x2be572==='UserId'||_0x2be572===_0x01d5('0x16')||_0x2be572==='sipcallid'||_0x2be572===_0x01d5('0x6c')||_0x2be572===_0x01d5('0x6d')||_0x2be572==='xmd-phone'||_0x2be572===_0x01d5('0x6e')||_0x2be572===_0x01d5('0x6f')||_0x2be572===_0x01d5('0x70')||_0x2be572===_0x01d5('0x71')||_0x2be572===_0x01d5('0x72')||_0x2be572===_0x01d5('0x73')||_0x2be572===_0x01d5('0x74')||_0x2be572===_0x01d5('0x75')||_0x2be572===_0x01d5('0x76')||_0x2be572===_0x01d5('0x77')||_0x2be572==='xmd-agi'||_0x2be572===_0x01d5('0x78')||_0x2be572===_0x01d5('0x79')||_0x2be572==='rtpaudioqosjitter'||_0x2be572===_0x01d5('0x7a')||_0x2be572===_0x01d5('0x7b')||_0x2be572===_0x01d5('0x7c')||_0x2be572===_0x01d5('0x7d')||_0x2be572===_0x01d5('0x7e')||_0x2be572===_0x01d5('0x78')||_0x2be572===_0x01d5('0x79')||_0x2be572===_0x01d5('0x7f')||_0x2be572===_0x01d5('0x7a')||_0x2be572===_0x01d5('0x7b')||_0x2be572===_0x01d5('0x7c')||_0x2be572==='rtpaudioqosrtt'||_0x2be572===_0x01d5('0x7e')||_0x2be572===_0x01d5('0x80')||_0x2be572==='bridgepvtcallid'||_0x2be572==='state'||_0x2be572===_0x01d5('0x32')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x3689c3,_0x473814){var _0x3c4371,_0x320d1b,_0x56abfd;if(_0x473814<=0x0){_0x473814=0x1;}_0x3c4371=new RegExp(_0x01d5('0x81')+_0x473814+'}$');_0x320d1b=Math['pow'](0xa,_0x473814-0x1);_0x56abfd=Math['pow'](0xa,_0x473814)-0x1;return util[_0x01d5('0x10')]('%s',_['replace'](_0x3689c3,_0x3c4371,_[_0x01d5('0x82')](_0x320d1b,_0x56abfd)));};exports[_0x01d5('0x83')]=function(_0x3df193){var _0x287d34=_0x3df193[_0x01d5('0x84')](/"(.*?)"/);return _0x287d34?_0x287d34[0x1]:_0x3df193;};exports[_0x01d5('0x85')]=function(_0x1bb788){var _0x4105f0=_0x1bb788[_0x01d5('0x84')](/<(.*?)>/);return _0x4105f0?_0x4105f0[0x1]:_0x1bb788;};
\ No newline at end of file
+var _0x8a4d=['moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','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','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','statedesc','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','state','starttime','logLookAgent','membername','UserId','ringtime','talktime','isFailure','Failure','variablesAction','RECALL','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','motionChannel','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countnoanswerretry','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','util','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8a4d,0x8c));var _0xd8a4=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0x8a4d[_0x31eb67];return _0x2a8cb8;};'use strict';var util=require(_0xd8a4('0x0'));var _=require(_0xd8a4('0x1'));var moment=require(_0xd8a4('0x2'));var logger=require(_0xd8a4('0x3'))(_0xd8a4('0x4'));var ipAgi=process[_0xd8a4('0x5')][_0xd8a4('0x6')]||_0xd8a4('0x7');function getSeconds(_0x3358ea,_0x2c9fde){var _0x57b6b2=moment(_0x3358ea)[_0xd8a4('0x8')](0x0);var _0xc740b1=moment(_0x2c9fde)[_0xd8a4('0x8')](0x0);return _0x57b6b2[_0xd8a4('0x9')](_0xc740b1,_0xd8a4('0xa'));}exports[_0xd8a4('0xb')]=function(_0x119b7c){return function(_0x4d472c){logger[_0xd8a4('0xc')](_0x119b7c,util[_0xd8a4('0xd')](_0x4d472c,{'showHidden':![],'depth':null}));};};exports[_0xd8a4('0xe')]=function(_0x81238,_0x142300){logger[_0xd8a4('0xf')](_0x81238,util[_0xd8a4('0xd')](_0x142300,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x1810ff,_0x405ee8){logger['error'](_0x1810ff,util[_0xd8a4('0xd')](_0x405ee8,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0xa3468){return function(_0x3a38d8){logger[_0xd8a4('0xf')](_0xa3468,util[_0xd8a4('0xd')](_0x3a38d8,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x293055,_0x436895,_0x5efeed){return{'message':_0x293055,'unlock':_0x436895,'active':_0x5efeed};};exports['getCallerId']=function(_0x37f074,_0x45dd8f,_0x566b41){if(!_[_0xd8a4('0x10')](_0x566b41)&&_0xd8a4('0x11')===typeof _0x566b41&&!_[_0xd8a4('0x12')](_0x566b41)){if(!_[_0xd8a4('0x10')](_0x45dd8f)&&_0xd8a4('0x11')===typeof _0x45dd8f&&!_[_0xd8a4('0x12')](_0x45dd8f)){return util[_0xd8a4('0x13')](_0xd8a4('0x14'),_0x45dd8f,_0x566b41);}return util[_0xd8a4('0x13')](_0xd8a4('0x14'),_0x566b41,_0x566b41);}if(!_['isUndefined'](_0x37f074)&&_0xd8a4('0x11')===typeof _0x37f074&&!_[_0xd8a4('0x12')](_0x37f074)){return _0x37f074;}return _0xd8a4('0x15');};exports[_0xd8a4('0x16')]=function(_0x1bcec8){if(_[_0xd8a4('0x17')](_0x1bcec8)){return![];}return _0x1bcec8;};exports[_0xd8a4('0x18')]=function(_0xff9d4d,_0x4b020d,_0x201482,_0x2b0eb0,_0x1ec1a0,_0x6927d8){var _0x451284={'XMD-QUEUE':_0x4b020d[_0xd8a4('0x19')]?_0x4b020d['Queue'][_0xd8a4('0x1a')]:'','XMD-CALLERID':_0x2b0eb0,'XMD-CALLERID-PREVIEW':_0x6927d8?util[_0xd8a4('0x13')](_0xd8a4('0x14'),_0x6927d8[_0xd8a4('0x1b')],_0x6927d8[_0xd8a4('0x1c')]):_0x2b0eb0,'XMD-DIALID':_0x1ec1a0,'XMD-CONTACTID':_0x4b020d[_0xd8a4('0x1d')],'XMD-CDRTYPE':_0xd8a4('0x1e'),'CALLERID(all)':_0x2b0eb0,'XMD-VOICEQUEUEID':_0x4b020d[_0xd8a4('0x1f')],'XMD-DIALCHANNEL':_0x201482,'XMD-DIALTIMEOUT':_0xff9d4d[_0xd8a4('0x20')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xd8a4('0x21'),_0xff9d4d['dialQueueProject2']?'g':'',_[_0xd8a4('0x12')](_0xff9d4d[_0xd8a4('0x22')])?'':_0xd8a4('0x23')),'XMD-DIALURL':_0xff9d4d['dialPreviewUrl']||'','XMD-AGI':_0xff9d4d[_0xd8a4('0x24')]?util[_0xd8a4('0x13')](_0xd8a4('0x25'),ipAgi,_0xff9d4d[_0xd8a4('0x24')]):_0xd8a4('0x26'),'XMD-AGIAFTER':_0xff9d4d[_0xd8a4('0x27')]?util[_0xd8a4('0x13')](_0xd8a4('0x25'),ipAgi,_0xff9d4d['dialQueueProject2']):_0xd8a4('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x6927d8?_0x6927d8[_0xd8a4('0x28')]:'','XMD-ORIGINATECALLERIDNAME':_0x6927d8?_0x6927d8[_0xd8a4('0x29')]:'','XMD-DESTINATION':_0xd8a4('0x2a'),'SIPADDHEADER':_0xd8a4('0x2b')};if(!_[_0xd8a4('0x12')](_0xff9d4d[_0xd8a4('0x22')])){_0x451284[util[_0xd8a4('0x13')]('%s',_0xd8a4('0x2c'))]=_0xff9d4d[_0xd8a4('0x22')];_0x451284[util[_0xd8a4('0x13')]('%s',_0xd8a4('0x2d'))]=_0x1ec1a0;}if(_0x4b020d&&_0x4b020d[_0xd8a4('0x2e')]){for(var _0x5163c1 in _0x4b020d[_0xd8a4('0x2e')]){if(_0x4b020d[_0xd8a4('0x2e')][_0xd8a4('0x2f')](_0x5163c1)){if(!_[_0xd8a4('0x17')](_0x4b020d[_0xd8a4('0x2e')][_0x5163c1])&&_0x5163c1!=='id'&&_0x5163c1!==_0xd8a4('0x30')&&_0x5163c1!==_0xd8a4('0x31')&&_0x5163c1!=='updatedAt'){_0x451284[util[_0xd8a4('0x13')](_0xd8a4('0x32'),_0xd8a4('0x33'),_[_0xd8a4('0x34')](_0x5163c1))]=_0x4b020d['Contact'][_0x5163c1];}}}}return _0x451284;};exports[_0xd8a4('0x35')]=function(_0x4f0457){var _0x370c50={};for(var _0x314e69 in _0x4f0457){if(_0x4f0457[_0xd8a4('0x2f')](_0x314e69)){_0x370c50[util[_0xd8a4('0x13')]('%s',_[_0xd8a4('0x36')](_0x314e69))]=_0x4f0457[_0x314e69];}}return{'variables':_0x370c50};};exports[_0xd8a4('0x37')]=function(_0x398f39,_0x3cfb8c){if(!_[_0xd8a4('0x17')](_0x398f39)){if(_0x398f39['hasOwnProperty'](_0xd8a4('0x38'))){if(_0x398f39[_0xd8a4('0x38')]>0x0){_0x398f39[_0xd8a4('0x38')]-=0x1;}else{logger['error'](_0xd8a4('0x39'),_0x3cfb8c);}}}else{logger[_0xd8a4('0xc')](_0xd8a4('0x3a'),_0x3cfb8c);}};exports[_0xd8a4('0x3b')]=function(_0x479ab5){var _0x360309=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x479ab5['state']=0xd;_0x479ab5[_0xd8a4('0x3c')]='Blacklist';_0x479ab5['starttime']=_0x360309;_0x479ab5[_0xd8a4('0x3d')]=_0x360309;_0x479ab5[_0xd8a4('0x3e')]=_0x360309;};exports['logAgent']=function(_0x1c83db,_0x16bdba,_0x29a8d5){var _0x1193ec=moment()[_0xd8a4('0x13')](_0xd8a4('0x3f'));_0x1c83db[_0xd8a4('0x40')]=_0x16bdba;_0x1c83db[_0xd8a4('0x3c')]=_0x29a8d5;_0x1c83db['responsetime']=_0x1193ec;_0x1c83db['ringtime']=getSeconds(_0x1c83db[_0xd8a4('0x3d')],_0x1c83db[_0xd8a4('0x41')]);};exports[_0xd8a4('0x42')]=function(_0x170e40,_0x76ba3a,_0x7ef8e3){_0x170e40[_0xd8a4('0x43')]=_0x76ba3a;_0x170e40[_0xd8a4('0x44')]=_0x7ef8e3;};exports['logCustomer']=function(_0x3bfb4b,_0x34c915,_0x5c07e8){var _0x5b8e02=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3bfb4b[_0xd8a4('0x40')]=_0x34c915;_0x3bfb4b[_0xd8a4('0x3c')]=_0x5c07e8;_0x3bfb4b[_0xd8a4('0x3d')]=_0x3bfb4b[_0xd8a4('0x3d')]?_0x3bfb4b[_0xd8a4('0x3d')]:_0x5b8e02;_0x3bfb4b['endtime']=_0x3bfb4b['endtime']?_0x3bfb4b[_0xd8a4('0x3e')]:_0x5b8e02;_0x3bfb4b[_0xd8a4('0x45')]=getSeconds(_0x3bfb4b[_0xd8a4('0x3d')]||0x0,_0x3bfb4b[_0xd8a4('0x41')]||0x0);_0x3bfb4b[_0xd8a4('0x46')]=_0x3bfb4b['answertime']?getSeconds(_0x3bfb4b['endtime'],_0x3bfb4b['answertime']):0x0;};exports[_0xd8a4('0x47')]=function(_0x51148e){return _0x51148e===_0xd8a4('0x48');};exports[_0xd8a4('0x49')]=function(_0x29796f,_0x2d77e9,_0xc5cfb9,_0x5a8c80,_0x2ef4e0){var _0x305585=_0x5a8c80?_0xd8a4('0x4a'):_0x29796f[_0xd8a4('0x1b')];_0x305585=_0x2ef4e0?'BOOKED':_0x305585;return{'actionid':_0x29796f[_0xd8a4('0x4b')],'action':_0xd8a4('0x4c'),'channel':_0x29796f[_0xd8a4('0x4d')],'callerid':util[_0xd8a4('0x13')](_0xd8a4('0x14'),_0x305585,_0x29796f['calleridnum']),'Exten':'xcally-motion-preview','Context':_0xd8a4('0x4e'),'Priority':'1','variable':_0xc5cfb9,'timeout':(_0x2d77e9[_0xd8a4('0x4f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x29796f[_0xd8a4('0x4b')]};};exports[_0xd8a4('0x50')]=function(_0x2093af){return _0x2093af[_0xd8a4('0x51')]+_0x2093af[_0xd8a4('0x52')]+_0x2093af['countnoanswerretry']+_0x2093af['countagentrejectretry']+_0x2093af[_0xd8a4('0x53')];};exports[_0xd8a4('0x54')]=function(_0x1254c4){var _0x5f3f1d=_[_0xd8a4('0x55')](_0x1254c4);_0x5f3f1d[_0xd8a4('0x40')]=0xf;_0x5f3f1d['statedesc']=_0xd8a4('0x56');return _0x5f3f1d;};exports['scheduledAt']=function(_0x32b9bf,_0x299809,_0x52ce0d){var _0x51a2a2={};_0x51a2a2[_0x299809]=_0x32b9bf[_0x299809];_0x51a2a2['active']=![];_0x51a2a2[_0xd8a4('0x57')]=moment()[_0xd8a4('0x58')](_0x52ce0d,_0xd8a4('0x59'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x51a2a2['ContactId']=_0x32b9bf[_0xd8a4('0x1d')];_0x51a2a2['ListId']=_0x32b9bf[_0xd8a4('0x5a')];_0x51a2a2['VoiceQueueId']=_0x32b9bf[_0xd8a4('0x1f')]||undefined;return _0x51a2a2;};exports[_0xd8a4('0x5b')]=function(_0x2546a4,_0x5dcdb5){if(!_[_0xd8a4('0x17')](_0x2546a4)){if(_0x2546a4['pTalking']>0x0){_0x2546a4[_0xd8a4('0x5c')]-=0x1;}else{logger[_0xd8a4('0xc')](_0x5dcdb5,_0xd8a4('0x5d'));}}else{logger[_0xd8a4('0xc')](_0x5dcdb5,_0xd8a4('0x5e'));}};exports[_0xd8a4('0x5f')]=function(_0x1360af){if(_0x1360af<=0x0){return!![];}return![];};exports[_0xd8a4('0x60')]=function(_0xb73406,_0x851380,_0x2416d4){_0xb73406[_0xd8a4('0x61')]=_0x851380;_0xb73406['name']=_0xb73406[_0xd8a4('0x62')];_0xb73406[_0xd8a4('0x63')]=_0xb73406[_0xd8a4('0x4d')];_0xb73406[_0xd8a4('0x64')]='voice';if(_0x2416d4){_0xb73406[_0xd8a4('0x65')]=_0x2416d4[_0xd8a4('0x65')];}return _0xb73406;};exports[_0xd8a4('0x66')]=function(_0x5c81df){var _0x9a0e7a={};_0x9a0e7a[_0xd8a4('0x62')]=_0x5c81df[_0xd8a4('0x62')];_0x9a0e7a[_0xd8a4('0x63')]=_0x5c81df[_0xd8a4('0x4d')];_0x9a0e7a[_0xd8a4('0x4b')]=_0x5c81df['uniqueid'];return _0x9a0e7a;};exports[_0xd8a4('0x67')]=function(_0x4226c3){var _0x5807ef=[];for(var _0x28adaa in _0x4226c3){if(_0x4226c3[_0xd8a4('0x2f')](_0x28adaa)){if(!_[_0xd8a4('0x17')](_0x4226c3[_0x28adaa])&&_0x4226c3[_0x28adaa][_0xd8a4('0x40')]===_0xd8a4('0x68')&&_0x4226c3[_0x28adaa][_0xd8a4('0x69')]===_0xd8a4('0x6a')){_0x5807ef['push'](_0x4226c3[_0x28adaa]['id']);}}}return _0x5807ef;};exports['getDiff']=function(_0x1a264b){var _0x3f1baa=moment()[_0xd8a4('0x8')](0x0);var _0x555ced=moment(_0x1a264b)[_0xd8a4('0x8')](0x0);return _0x3f1baa[_0xd8a4('0x9')](_0x555ced,_0xd8a4('0xa'));};exports[_0xd8a4('0x6b')]=function(_0x35f133){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x35f133[_0xd8a4('0x1d')],'ListId':_0x35f133[_0xd8a4('0x5a')],'VoiceQueueId':_0x35f133[_0xd8a4('0x1f')]||undefined,'CampaignId':_0x35f133[_0xd8a4('0x6c')]||undefined};};exports[_0xd8a4('0x6d')]=function(_0x36bf99){if(_0x36bf99===_0xd8a4('0x4b')||_0x36bf99===_0xd8a4('0x6e')||_0x36bf99===_0xd8a4('0x62')||_0x36bf99===_0xd8a4('0x6f')||_0x36bf99===_0xd8a4('0x70')||_0x36bf99===_0xd8a4('0x71')||_0x36bf99===_0xd8a4('0x43')||_0x36bf99===_0xd8a4('0x4d')||_0x36bf99===_0xd8a4('0x1b')||_0x36bf99==='active'||_0x36bf99===_0xd8a4('0x1c')||_0x36bf99===_0xd8a4('0x57')||_0x36bf99===_0xd8a4('0x51')||_0x36bf99==='countcongestionretry'||_0x36bf99===_0xd8a4('0x72')||_0x36bf99===_0xd8a4('0x73')||_0x36bf99==='callback'||_0x36bf99===_0xd8a4('0x74')||_0x36bf99===_0xd8a4('0x75')||_0x36bf99===_0xd8a4('0x76')||_0x36bf99==='ContactId'||_0x36bf99==='ListId'||_0x36bf99==='UserId'||_0x36bf99===_0xd8a4('0x1f')||_0x36bf99===_0xd8a4('0x77')||_0x36bf99==='xmd-voicequeueid'||_0x36bf99==='xmd-queue'||_0x36bf99==='xmd-phone'||_0x36bf99===_0xd8a4('0x78')||_0x36bf99===_0xd8a4('0x79')||_0x36bf99===_0xd8a4('0x7a')||_0x36bf99===_0xd8a4('0x7b')||_0x36bf99==='xmd-dialid'||_0x36bf99==='xmd-dialchannel'||_0x36bf99===_0xd8a4('0x7c')||_0x36bf99===_0xd8a4('0x7d')||_0x36bf99==='xmd-callerid'||_0x36bf99===_0xd8a4('0x7e')||_0x36bf99===_0xd8a4('0x7f')||_0x36bf99==='rtpaudioqos'||_0x36bf99===_0xd8a4('0x80')||_0x36bf99===_0xd8a4('0x81')||_0x36bf99===_0xd8a4('0x82')||_0x36bf99===_0xd8a4('0x83')||_0x36bf99===_0xd8a4('0x84')||_0x36bf99===_0xd8a4('0x85')||_0x36bf99==='rtpaudioqosrttbridged'||_0x36bf99==='rtpaudioqos'||_0x36bf99===_0xd8a4('0x80')||_0x36bf99==='rtpaudioqosjitter'||_0x36bf99===_0xd8a4('0x82')||_0x36bf99===_0xd8a4('0x83')||_0x36bf99===_0xd8a4('0x84')||_0x36bf99==='rtpaudioqosrtt'||_0x36bf99===_0xd8a4('0x86')||_0x36bf99===_0xd8a4('0x87')||_0x36bf99==='bridgepvtcallid'||_0x36bf99===_0xd8a4('0x40')||_0x36bf99===_0xd8a4('0x3c')){return![];}return!![];};exports[_0xd8a4('0x88')]=function(_0x340639,_0x368ee2){var _0x37e92f,_0x59f763,_0xadcda4;if(_0x368ee2<=0x0){_0x368ee2=0x1;}_0x37e92f=new RegExp(_0xd8a4('0x89')+_0x368ee2+'}$');_0x59f763=Math['pow'](0xa,_0x368ee2-0x1);_0xadcda4=Math[_0xd8a4('0x8a')](0xa,_0x368ee2)-0x1;return util[_0xd8a4('0x13')]('%s',_[_0xd8a4('0x8b')](_0x340639,_0x37e92f,_[_0xd8a4('0x8c')](_0x59f763,_0xadcda4)));};exports['extractCalleridName']=function(_0x4b292f){var _0x1c085=_0x4b292f['match'](/"(.*?)"/);return _0x1c085?_0x1c085[0x1]:_0x4b292f;};exports['extractCalleridNumber']=function(_0x5bb4e3){var _0x4fd27d=_0x5bb4e3[_0xd8a4('0x8d')](/<(.*?)>/);return _0x4fd27d?_0x4fd27d[0x1]:_0x5bb4e3;};
\ No newline at end of file
index 7470d4b..2bfec6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33c8=['queuepause','voicequeuechannel','string','number','boolean','queueremove'];(function(_0x470bfb,_0x389787){var _0x2f5d97=function(_0x3431b4){while(--_0x3431b4){_0x470bfb['push'](_0x470bfb['shift']());}};_0x2f5d97(++_0x389787);}(_0x33c8,0x1be));var _0x833c=function(_0x6cea06,_0x5e8d14){_0x6cea06=_0x6cea06-0x0;var _0x3c86d4=_0x33c8[_0x6cea06];return _0x3c86d4;};'use strict';exports['queueadd']={'queue':{'type':_0x833c('0x0'),'required':!![]},'interface':{'type':_0x833c('0x0'),'required':!![]},'membername':{'type':_0x833c('0x0'),'required':!![]},'penalty':{'type':_0x833c('0x1'),'required':![]},'paused':{'type':_0x833c('0x2'),'required':![]}};exports[_0x833c('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x833c('0x0'),'required':!![]}};exports[_0x833c('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x833c('0x2')},'reason':{'type':_0x833c('0x0'),'required':![]}};exports['reload']={'module':{'type':_0x833c('0x0'),'required':![]}};exports[_0x833c('0x5')]={'uniqueid':{'type':_0x833c('0x0'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x833c('0x0'),'required':!![]},'filename':{'type':_0x833c('0x0')},'format':{'type':_0x833c('0x0')},'mixmonitorid':{'type':_0x833c('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x833c('0x0'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x833c('0x0'),'required':!![]},'context':{'type':'string'}};
\ No newline at end of file
+var _0x7656=['voicequeuechannel','voicequeuechannelhangup','queueadd','string','number','boolean'];(function(_0x3cde60,_0x2cd24d){var _0x5178f0=function(_0x44bf52){while(--_0x44bf52){_0x3cde60['push'](_0x3cde60['shift']());}};_0x5178f0(++_0x2cd24d);}(_0x7656,0x146));var _0x6765=function(_0x3de2e0,_0x5d5bbe){_0x3de2e0=_0x3de2e0-0x0;var _0x26c69b=_0x7656[_0x3de2e0];return _0x26c69b;};'use strict';exports[_0x6765('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x6765('0x1'),'required':!![]},'membername':{'type':_0x6765('0x1'),'required':!![]},'penalty':{'type':_0x6765('0x2'),'required':![]},'paused':{'type':_0x6765('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x6765('0x1'),'required':!![]},'interface':{'type':_0x6765('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x6765('0x1'),'required':!![]},'paused':{'type':_0x6765('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x6765('0x1'),'required':![]}};exports[_0x6765('0x4')]={'uniqueid':{'type':_0x6765('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x6765('0x1'),'required':!![]},'filename':{'type':_0x6765('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x6765('0x1')}};exports[_0x6765('0x5')]={'uniqueid':{'type':_0x6765('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x6765('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}};
\ No newline at end of file
index 571769c..ded1c18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88f5=['SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','bluebird','util','lodash','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','interface','format','name','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','unmanaged','abandoned','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isNil','isUndefined','initTrunks','initVoiceQueues','initTriggers','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','seconds','queuecallercompleteAt','queuecallerexitAt','diff','queuecallerjoinAt','initVoiceCallReports','duration','disposition','ANSWERED','dialQueueProject'];(function(_0x1a6524,_0x3e3f45){var _0x1d1658=function(_0x21fc17){while(--_0x21fc17){_0x1a6524['push'](_0x1a6524['shift']());}};_0x1d1658(++_0x3e3f45);}(_0x88f5,0x6d));var _0x588f=function(_0x5cbb30,_0x5590d9){_0x5cbb30=_0x5cbb30-0x0;var _0x422ae0=_0x88f5[_0x5cbb30];return _0x422ae0;};'use strict';var BPromise=require(_0x588f('0x0'));var util=require(_0x588f('0x1'));var _=require(_0x588f('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Telephone=require(_0x588f('0x3'));var Trunk=require(_0x588f('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x588f('0x5'));var Template=require(_0x588f('0x6'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x588f('0x7'));var ZendeskAccount=require(_0x588f('0x8'));var SalesforceAccount=require(_0x588f('0x9'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x588f('0xa'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x588f('0xb'));var Dynamics365Account=require(_0x588f('0xc'));var FreshsalesAccount=require(_0x588f('0xd'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x588f('0xe')]={};this[_0x588f('0xf')]={};this[_0x588f('0x10')]={};this[_0x588f('0x11')]={};this[_0x588f('0x12')]={};this[_0x588f('0x13')]={};this[_0x588f('0x14')]={};this[_0x588f('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x588f('0x16')]={};this[_0x588f('0x17')]={};this[_0x588f('0x18')]={};this['outboundChannels']={};this[_0x588f('0x19')]={};this[_0x588f('0x1a')]={};this[_0x588f('0x1b')]={};this['salesforceAccounts']={};this[_0x588f('0x1c')]={};this['freshdeskAccounts']={};this[_0x588f('0x1d')]={};this[_0x588f('0x1e')]={};this[_0x588f('0x1f')]={};this[_0x588f('0x20')]={};this[_0x588f('0x21')]={};this[_0x588f('0x22')]={};this[_0x588f('0x23')]={};};function freeIsNotKey(_0x2a2132,_0xd55028,_0x19da9f){var _0x272399=_[_0x588f('0x24')](_0x2a2132,function(_0x26f8c1,_0x4bda9f){return _0x26f8c1[_0x19da9f];});for(var _0x59fd3a in _0xd55028){if(_0xd55028[_0x588f('0x25')](_0x59fd3a)){if(!_0x272399[_0x59fd3a]){delete _0xd55028[_0x59fd3a];}}}}function freeIsNotKeySip(_0x363c6e,_0x3e562a){var _0x2b2700=_[_0x588f('0x24')](_0x363c6e,function(_0x587db3,_0x12b2e7){return util['format'](_0x588f('0x26'),_0x587db3['name']);});for(var _0x22f71a in _0x3e562a){if(_0x3e562a[_0x588f('0x25')](_0x22f71a)){if(!_0x2b2700[_0x22f71a]){delete _0x3e562a[_0x22f71a];}}}}function freeIsNotKeyAgent(_0x191943,_0x4d27dd){var _0x541c43=_[_0x588f('0x24')](_0x191943,function(_0x16fb0a,_0x5e270e){var _0x2b0d06=_['isNil'](_0x16fb0a[_0x588f('0x27')])?util[_0x588f('0x28')](_0x588f('0x26'),_0x16fb0a[_0x588f('0x29')]):_0x16fb0a[_0x588f('0x27')];return _0x2b0d06;});for(var _0x3668cd in _0x4d27dd){if(_0x4d27dd[_0x588f('0x25')](_0x3668cd)){if(!_0x541c43[_0x3668cd]){delete _0x4d27dd[_0x3668cd];}}}}function clearVoiceCallReports(_0x3c340d){_0x3c340d[_0x588f('0x2a')]=0x0;_0x3c340d[_0x588f('0x2b')]=0x0;_0x3c340d[_0x588f('0x2c')]=0x0;_0x3c340d[_0x588f('0x2d')]=0x0;_0x3c340d[_0x588f('0x2e')]=0x0;}function clearCampaigns(_0x20b2bc){if(!_[_0x588f('0x2f')](_0x20b2bc)){for(var _0x427a16 in _0x20b2bc){if(_0x20b2bc[_0x588f('0x25')](_0x427a16)){_0x20b2bc[_0x427a16][_0x588f('0x30')]=0x0;_0x20b2bc[_0x427a16]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2f92ba){if(!_[_0x588f('0x2f')](_0x2f92ba)){for(var _0x330983 in _0x2f92ba){if(_0x2f92ba[_0x588f('0x25')](_0x330983)){_0x2f92ba[_0x330983][_0x588f('0x2a')]=0x0;_0x2f92ba[_0x330983][_0x588f('0x2b')]=0x0;_0x2f92ba[_0x330983][_0x588f('0x31')]=0x0;_0x2f92ba[_0x330983][_0x588f('0x32')]=0x0;_0x2f92ba[_0x330983][_0x588f('0x2c')]=0x0;_0x2f92ba[_0x330983]['sumDuration']=0x0;_0x2f92ba[_0x330983][_0x588f('0x2e')]=0x0;_0x2f92ba[_0x330983]['outboundAnswerAgiCallsDay']=0x0;_0x2f92ba[_0x330983][_0x588f('0x33')]=0x0;_0x2f92ba[_0x330983][_0x588f('0x34')]=0x0;_0x2f92ba[_0x330983][_0x588f('0x35')]=0x0;_0x2f92ba[_0x330983]['outboundNoSuchCallsDay']=0x0;_0x2f92ba[_0x330983][_0x588f('0x36')]=0x0;_0x2f92ba[_0x330983][_0x588f('0x37')]=0x0;_0x2f92ba[_0x330983][_0x588f('0x38')]=0x0;_0x2f92ba[_0x330983][_0x588f('0x39')]=0x0;_0x2f92ba[_0x330983][_0x588f('0x3a')]=0x0;_0x2f92ba[_0x330983]['outboundRejectCallsDay']=0x0;_0x2f92ba[_0x330983][_0x588f('0x3b')]=0x0;_0x2f92ba[_0x330983]['outboundAnswerAgiCallsDay']=0x0;_0x2f92ba[_0x330983][_0x588f('0x3c')]=0x0;_0x2f92ba[_0x330983][_0x588f('0x3d')]=!![];}}}}Realtime[_0x588f('0x3e')][_0x588f('0x3f')]=function(_0x239f2c,_0x56106f){for(var _0x2c6c7b in _0x56106f){if(_0x239f2c[_0x588f('0x25')](_0x2c6c7b)){_0x239f2c[_0x2c6c7b]=_0x56106f[_0x2c6c7b];}}};Realtime[_0x588f('0x3e')][_0x588f('0x40')]=function(){var _0x34ea40=this;return function(_0x381e97){if(_0x381e97){freeIsNotKeyAgent(_0x381e97,_0x34ea40[_0x588f('0xe')]);for(var _0x555706=0x0,_0x1a4f37={},_0x159fc5={};_0x555706<_0x381e97[_0x588f('0x41')];_0x555706+=0x1){_0x1a4f37=_0x381e97[_0x555706];var _0x588d7b=_[_0x588f('0x42')](_0x1a4f37[_0x588f('0x27')])?util['format'](_0x588f('0x26'),_0x1a4f37[_0x588f('0x29')]):_0x1a4f37['interface'];if(_[_0x588f('0x43')](_0x34ea40['agents'][_0x588d7b])){_0x34ea40[_0x588f('0xe')][_0x588d7b]=new Agent(_0x1a4f37);}else{_0x34ea40[_0x588f('0x3f')](_0x34ea40['agents'][_0x588d7b],_0x1a4f37);}}}return _0x34ea40[_0x588f('0xe')];};};Realtime['prototype']['initTelephones']=function(){var _0x3d4756=this;return function(_0x4a1495){if(_0x4a1495){freeIsNotKeySip(_0x4a1495,_0x3d4756[_0x588f('0xf')]);for(var _0x51de16=0x0,_0x11389e={},_0x642d53={};_0x51de16<_0x4a1495[_0x588f('0x41')];_0x51de16+=0x1){_0x11389e=_0x4a1495[_0x51de16];if(_[_0x588f('0x43')](_0x3d4756[_0x588f('0xf')][util['format'](_0x588f('0x26'),_0x11389e[_0x588f('0x29')])])){_0x3d4756[_0x588f('0xf')][util[_0x588f('0x28')](_0x588f('0x26'),_0x11389e[_0x588f('0x29')])]=new Telephone(_0x11389e);}else{_0x3d4756['mergeFromDatabase'](_0x3d4756['telephones'][util[_0x588f('0x28')](_0x588f('0x26'),_0x11389e[_0x588f('0x29')])],_0x11389e);}}}return _0x3d4756[_0x588f('0xf')];};};Realtime[_0x588f('0x3e')][_0x588f('0x44')]=function(){var _0x2ae950=this;return function(_0x5ea1cf){if(_0x5ea1cf){freeIsNotKeySip(_0x5ea1cf,_0x2ae950[_0x588f('0x10')]);for(var _0x11f3a6=0x0,_0x11b05c={},_0xf7f5b0={};_0x11f3a6<_0x5ea1cf[_0x588f('0x41')];_0x11f3a6+=0x1){_0x11b05c=_0x5ea1cf[_0x11f3a6];if(_[_0x588f('0x43')](_0x2ae950[_0x588f('0x10')][util[_0x588f('0x28')](_0x588f('0x26'),_0x11b05c[_0x588f('0x29')])])){_0x2ae950[_0x588f('0x10')][util[_0x588f('0x28')](_0x588f('0x26'),_0x11b05c[_0x588f('0x29')])]=new Trunk(_0x11b05c);}else{_0x2ae950[_0x588f('0x3f')](_0x2ae950[_0x588f('0x10')][util[_0x588f('0x28')](_0x588f('0x26'),_0x11b05c[_0x588f('0x29')])],_0x11b05c);}}}return _0x2ae950[_0x588f('0x10')];};};Realtime[_0x588f('0x3e')][_0x588f('0x45')]=function(){var _0x58e2a3=this;return function(_0xd86559){if(_0xd86559){freeIsNotKey(_0xd86559,_0x58e2a3['voiceQueues'],'name');for(var _0x2e3d6a=0x0,_0x4eb534={},_0xcd40ca={};_0x2e3d6a<_0xd86559[_0x588f('0x41')];_0x2e3d6a+=0x1){_0x4eb534=_0xd86559[_0x2e3d6a];if(_[_0x588f('0x43')](_0x58e2a3[_0x588f('0x11')][_0x4eb534[_0x588f('0x29')]])){_0x58e2a3[_0x588f('0x11')][_0x4eb534['name']]=new VoiceQueue(_0x4eb534);}else{_0x58e2a3[_0x588f('0x3f')](_0x58e2a3['voiceQueues'][_0x4eb534[_0x588f('0x29')]],_0x4eb534);}}}return _0x58e2a3[_0x588f('0x11')];};};Realtime[_0x588f('0x3e')][_0x588f('0x46')]=function(){var _0x40e21c=this;return function(_0x2ef5db){if(_0x2ef5db){freeIsNotKey(_0x2ef5db,_0x40e21c['triggers'],'id');for(var _0x39618d=0x0,_0xacb30d={},_0x20ed87={};_0x39618d<_0x2ef5db[_0x588f('0x41')];_0x39618d+=0x1){_0xacb30d=_0x2ef5db[_0x39618d];if(_['isUndefined'](_0x40e21c['triggers'][_0xacb30d['id']])){_0x40e21c[_0x588f('0x12')][_0xacb30d['id']]=new Trigger(_0xacb30d);}else{_0x40e21c[_0x588f('0x3f')](_0x40e21c[_0x588f('0x12')][_0xacb30d['id']],_0xacb30d);}}}return _0x40e21c[_0x588f('0x12')];};};Realtime[_0x588f('0x3e')]['initTemplates']=function(){var _0x156a27=this;return function(_0x27c1c2){if(_0x27c1c2){freeIsNotKey(_0x27c1c2,_0x156a27[_0x588f('0x14')],'id');for(var _0x4078aa=0x0,_0x46faf9={},_0x3ff7d0={};_0x4078aa<_0x27c1c2[_0x588f('0x41')];_0x4078aa+=0x1){_0x46faf9=_0x27c1c2[_0x4078aa];if(_[_0x588f('0x43')](_0x156a27[_0x588f('0x14')][_0x46faf9['id']])){_0x156a27[_0x588f('0x14')][_0x46faf9['id']]=new Template(_0x46faf9);}else{_0x156a27[_0x588f('0x3f')](_0x156a27[_0x588f('0x14')][_0x46faf9['id']],_0x46faf9);}}}return _0x156a27[_0x588f('0x14')];};};Realtime[_0x588f('0x3e')][_0x588f('0x47')]=function(){var _0x435115=this;return function(_0x1f2672){if(_0x1f2672){freeIsNotKey(_0x1f2672,_0x435115[_0x588f('0x1b')],'id');for(var _0x1a474e=0x0,_0x267091={},_0x3072b8={};_0x1a474e<_0x1f2672[_0x588f('0x41')];_0x1a474e+=0x1){_0x267091=_0x1f2672[_0x1a474e];if(_[_0x588f('0x43')](_0x435115[_0x588f('0x1b')][_0x267091['id']])){_0x435115[_0x588f('0x1b')][_0x267091['id']]=new ZendeskAccount(_0x267091);}else{_0x435115[_0x588f('0x3f')](_0x435115[_0x588f('0x1b')][_0x267091['id']],_0x267091);}}}return _0x435115[_0x588f('0x1b')];};};Realtime[_0x588f('0x3e')][_0x588f('0x48')]=function(){var _0x18f4ac=this;return function(_0xb333a1){if(_0xb333a1){freeIsNotKey(_0xb333a1,_0x18f4ac[_0x588f('0x49')],'id');for(var _0x4b7d4d=0x0,_0x574822={},_0x1c5093={};_0x4b7d4d<_0xb333a1['length'];_0x4b7d4d+=0x1){_0x574822=_0xb333a1[_0x4b7d4d];if(_['isUndefined'](_0x18f4ac[_0x588f('0x49')][_0x574822['id']])){_0x18f4ac[_0x588f('0x49')][_0x574822['id']]=new SalesforceAccount(_0x574822);}else{_0x18f4ac[_0x588f('0x3f')](_0x18f4ac[_0x588f('0x49')][_0x574822['id']],_0x574822);}}}return _0x18f4ac[_0x588f('0x49')];};};Realtime[_0x588f('0x3e')][_0x588f('0x4a')]=function(){var _0x5ad5f5=this;return function(_0x1571c3){if(_0x1571c3){freeIsNotKey(_0x1571c3,_0x5ad5f5[_0x588f('0x4b')],'id');for(var _0x490d45=0x0,_0x54d86e={},_0x54c82d={};_0x490d45<_0x1571c3['length'];_0x490d45+=0x1){_0x54d86e=_0x1571c3[_0x490d45];if(_[_0x588f('0x43')](_0x5ad5f5['freshdeskAccounts'][_0x54d86e['id']])){_0x5ad5f5[_0x588f('0x4b')][_0x54d86e['id']]=new FreshdeskAccount(_0x54d86e);}else{_0x5ad5f5['mergeFromDatabase'](_0x5ad5f5[_0x588f('0x4b')][_0x54d86e['id']],_0x54d86e);}}}return _0x5ad5f5['freshdeskAccounts'];};};Realtime[_0x588f('0x3e')][_0x588f('0x4c')]=function(){var _0x257280=this;return function(_0x4b7c6b){if(_0x4b7c6b){freeIsNotKey(_0x4b7c6b,_0x257280[_0x588f('0x1d')],'id');for(var _0x472d87=0x0,_0xe7457d={},_0x22e2d9={};_0x472d87<_0x4b7c6b['length'];_0x472d87+=0x1){_0xe7457d=_0x4b7c6b[_0x472d87];if(_[_0x588f('0x43')](_0x257280[_0x588f('0x1d')][_0xe7457d['id']])){_0x257280[_0x588f('0x1d')][_0xe7457d['id']]=new ZohoAccount(_0xe7457d);}else{_0x257280[_0x588f('0x3f')](_0x257280[_0x588f('0x1d')][_0xe7457d['id']],_0xe7457d);}}}return _0x257280[_0x588f('0x1d')];};};Realtime[_0x588f('0x3e')]['initDeskAccounts']=function(){var _0x3bdb13=this;return function(_0xc9133){if(_0xc9133){freeIsNotKey(_0xc9133,_0x3bdb13[_0x588f('0x1e')],'id');for(var _0x380a00=0x0,_0xefb3ec={},_0x298dc6={};_0x380a00<_0xc9133[_0x588f('0x41')];_0x380a00+=0x1){_0xefb3ec=_0xc9133[_0x380a00];if(_[_0x588f('0x43')](_0x3bdb13[_0x588f('0x1e')][_0xefb3ec['id']])){_0x3bdb13[_0x588f('0x1e')][_0xefb3ec['id']]=new DeskAccount(_0xefb3ec);}else{_0x3bdb13[_0x588f('0x3f')](_0x3bdb13['deskAccounts'][_0xefb3ec['id']],_0xefb3ec);}}}return _0x3bdb13['deskAccounts'];};};Realtime[_0x588f('0x3e')][_0x588f('0x4d')]=function(){var _0x739809=this;return function(_0x4526b3){if(_0x4526b3){freeIsNotKey(_0x4526b3,_0x739809[_0x588f('0x1c')],'id');for(var _0x47e32e=0x0,_0x15e9bb={},_0x2b61db={};_0x47e32e<_0x4526b3['length'];_0x47e32e+=0x1){_0x15e9bb=_0x4526b3[_0x47e32e];if(_[_0x588f('0x43')](_0x739809[_0x588f('0x1c')][_0x15e9bb['id']])){_0x739809[_0x588f('0x1c')][_0x15e9bb['id']]=new SugarcrmAccount(_0x15e9bb);}else{_0x739809['mergeFromDatabase'](_0x739809[_0x588f('0x1c')][_0x15e9bb['id']],_0x15e9bb);}}}return _0x739809[_0x588f('0x1c')];};};Realtime[_0x588f('0x3e')]['initVtigerAccounts']=function(){var _0x324b73=this;return function(_0x4cc09a){if(_0x4cc09a){freeIsNotKey(_0x4cc09a,_0x324b73[_0x588f('0x1f')],'id');for(var _0x4f0325=0x0,_0x381aaf={},_0x3ee2d8={};_0x4f0325<_0x4cc09a['length'];_0x4f0325+=0x1){_0x381aaf=_0x4cc09a[_0x4f0325];if(_[_0x588f('0x43')](_0x324b73['vtigerAccounts'][_0x381aaf['id']])){_0x324b73['vtigerAccounts'][_0x381aaf['id']]=new VtigerAccount(_0x381aaf);}else{_0x324b73[_0x588f('0x3f')](_0x324b73[_0x588f('0x1f')][_0x381aaf['id']],_0x381aaf);}}}return _0x324b73[_0x588f('0x1f')];};};Realtime[_0x588f('0x3e')]['initServicenowAccounts']=function(){var _0x1b1818=this;return function(_0x287efd){if(_0x287efd){freeIsNotKey(_0x287efd,_0x1b1818[_0x588f('0x20')],'id');for(var _0x425e9d=0x0,_0x47ba3e={},_0x43b16e={};_0x425e9d<_0x287efd[_0x588f('0x41')];_0x425e9d+=0x1){_0x47ba3e=_0x287efd[_0x425e9d];if(_[_0x588f('0x43')](_0x1b1818[_0x588f('0x20')][_0x47ba3e['id']])){_0x1b1818[_0x588f('0x20')][_0x47ba3e['id']]=new ServicenowAccount(_0x47ba3e);}else{_0x1b1818['mergeFromDatabase'](_0x1b1818[_0x588f('0x20')][_0x47ba3e['id']],_0x47ba3e);}}}return _0x1b1818[_0x588f('0x20')];};};Realtime[_0x588f('0x3e')][_0x588f('0x4e')]=function(){var _0x23ddf1=this;return function(_0x524e2d){if(_0x524e2d){freeIsNotKey(_0x524e2d,_0x23ddf1[_0x588f('0x21')],'id');for(var _0x12c5d4=0x0,_0x270d31={},_0x186b36={};_0x12c5d4<_0x524e2d[_0x588f('0x41')];_0x12c5d4+=0x1){_0x270d31=_0x524e2d[_0x12c5d4];if(_[_0x588f('0x43')](_0x23ddf1[_0x588f('0x21')][_0x270d31['id']])){_0x23ddf1[_0x588f('0x21')][_0x270d31['id']]=new Dynamics365Account(_0x270d31);}else{_0x23ddf1[_0x588f('0x3f')](_0x23ddf1[_0x588f('0x21')][_0x270d31['id']],_0x270d31);}}}return _0x23ddf1[_0x588f('0x21')];};};Realtime['prototype'][_0x588f('0x4f')]=function(){var _0x39e394=this;return function(_0x368e97){if(_0x368e97){freeIsNotKey(_0x368e97,_0x39e394[_0x588f('0x22')],'id');for(var _0x18d760=0x0,_0xfb7bf6={},_0xa87e8={};_0x18d760<_0x368e97['length'];_0x18d760+=0x1){_0xfb7bf6=_0x368e97[_0x18d760];if(_[_0x588f('0x43')](_0x39e394['freshsalesAccounts'][_0xfb7bf6['id']])){_0x39e394[_0x588f('0x22')][_0xfb7bf6['id']]=new FreshsalesAccount(_0xfb7bf6);}else{_0x39e394[_0x588f('0x3f')](_0x39e394['freshsalesAccounts'][_0xfb7bf6['id']],_0xfb7bf6);}}}return _0x39e394[_0x588f('0x22')];};};Realtime[_0x588f('0x3e')][_0x588f('0x50')]=function(){var _0x1214e3=this;return function(_0x4b4292){for(var _0xebdb78=0x0;_0xebdb78<_0x4b4292[_0x588f('0x41')];_0xebdb78+=0x1){_['merge'](_0x1214e3[_0x588f('0x11')][_0x4b4292[_0xebdb78][_0x588f('0x29')]],_0x4b4292[_0xebdb78]);}return _0x1214e3[_0x588f('0x11')];};};Realtime['prototype'][_0x588f('0x51')]=function(){var _0x3c818a=this;return function(_0x81ae03){clearVoiceQueues(_0x3c818a[_0x588f('0x11')]);if(_0x81ae03){_0x81ae03=_[_0x588f('0x52')](_0x81ae03,'uniqueid');for(var _0x258dca in _0x81ae03){if(_0x81ae03[_0x588f('0x25')](_0x258dca)){var _0x51f6b1={};for(var _0x1270cc=0x0;_0x1270cc<_0x81ae03[_0x258dca]['length'];_0x1270cc+=0x1){var _0x9e6bda=_0x81ae03[_0x258dca][_0x1270cc][_0x588f('0x53')];if(_0x3c818a[_0x588f('0x11')][_0x9e6bda]){if(_0x81ae03[_0x258dca][_0x1270cc][_0x588f('0x54')]){_0x3c818a[_0x588f('0x11')][_0x9e6bda]['unmanaged']+=0x1;}if(_0x81ae03[_0x258dca][_0x1270cc][_0x588f('0x55')]){_0x3c818a[_0x588f('0x11')][_0x9e6bda][_0x588f('0x32')]+=0x1;}_0x3c818a[_0x588f('0x11')][_0x9e6bda][_0x588f('0x2c')]+=moment(_0x81ae03[_0x258dca][_0x1270cc][_0x588f('0x56')])['diff'](moment(_0x81ae03[_0x258dca][_0x1270cc]['queuecallerjoinAt']),_0x588f('0x57'))||0x0;if(_0x1270cc===_0x81ae03[_0x258dca]['length']-0x1){_0x3c818a[_0x588f('0x11')][_0x9e6bda][_0x588f('0x2d')]+=moment(_0x81ae03[_0x258dca][_0x1270cc][_0x588f('0x58')]||_0x81ae03[_0x258dca][_0x1270cc]['queuecallerabandonAt']||_0x81ae03[_0x258dca][_0x1270cc][_0x588f('0x59')])[_0x588f('0x5a')](moment(_0x81ae03[_0x258dca][_0x1270cc][_0x588f('0x5b')]),_0x588f('0x57'))||0x0;_0x3c818a[_0x588f('0x11')][_0x9e6bda][_0x588f('0x2a')]+=0x1;if(_0x81ae03[_0x258dca][_0x1270cc]['queuecallercomplete']){_0x3c818a['voiceQueues'][_0x9e6bda]['answered']+=0x1;_0x3c818a[_0x588f('0x11')][_0x9e6bda][_0x588f('0x2e')]+=moment(_0x81ae03[_0x258dca][_0x1270cc]['queuecallercompleteAt'])[_0x588f('0x5a')](moment(_0x81ae03[_0x258dca][_0x1270cc]['queuecallerleaveAt']),_0x588f('0x57'))||0x0;}}else{_0x3c818a['voiceQueues'][_0x9e6bda][_0x588f('0x2d')]+=_0x3c818a[_0x588f('0x11')][_0x9e6bda][_0x588f('0x2c')]||0x0;}}}}}}return _0x3c818a[_0x588f('0x11')];};};Realtime[_0x588f('0x3e')][_0x588f('0x5c')]=function(){var _0x4d01e1=this;return function(_0x526035){clearVoiceCallReports(_0x4d01e1[_0x588f('0x15')]);if(_0x526035){for(var _0x1e7950=0x0;_0x1e7950<_0x526035[_0x588f('0x41')];_0x1e7950+=0x1){_0x4d01e1[_0x588f('0x15')][_0x588f('0x2a')]+=0x1;_0x4d01e1[_0x588f('0x15')][_0x588f('0x2d')]+=_0x526035[_0x1e7950][_0x588f('0x5d')];if(_0x526035[_0x1e7950][_0x588f('0x5e')]===_0x588f('0x5f')){_0x4d01e1[_0x588f('0x15')]['answered']+=0x1;_0x4d01e1[_0x588f('0x15')]['sumHoldTime']+=_0x526035[_0x1e7950]['duration']-_0x526035[_0x1e7950]['billableseconds']||0x0;_0x4d01e1['outbound']['sumBillable']+=_0x526035[_0x1e7950]['billableseconds'];}}}return _0x4d01e1[_0x588f('0x15')];};};Realtime[_0x588f('0x3e')]['initCampaigns']=function(){var _0x113b3f=this;return function(_0x329425){if(_0x329425){freeIsNotKey(_0x329425,_0x113b3f[_0x588f('0x13')],_0x588f('0x29'));for(var _0x1d86da=0x0,_0x313465={};_0x1d86da<_0x329425[_0x588f('0x41')];_0x1d86da+=0x1){_0x313465=_0x329425[_0x1d86da];if(_[_0x588f('0x43')](_0x113b3f[_0x588f('0x13')][_0x313465[_0x588f('0x29')]])){_0x113b3f[_0x588f('0x13')][_0x313465[_0x588f('0x29')]]=new Campaign(_0x313465);}else{_0x113b3f[_0x588f('0x3f')](_0x113b3f[_0x588f('0x13')][_0x313465[_0x588f('0x29')]],_0x313465);_0x113b3f[_0x588f('0x13')][_0x313465[_0x588f('0x29')]][_0x588f('0x60')]=_0x313465[_0x588f('0x61')]?_0x313465[_0x588f('0x61')][_0x588f('0x29')]:undefined;}}}return _0x113b3f[_0x588f('0x13')];};};Realtime[_0x588f('0x3e')][_0x588f('0x62')]=function(){var _0x422750=this;return function(_0x215260){if(_0x215260){freeIsNotKey(_0x215260,_0x422750[_0x588f('0x16')],'id');for(var _0x100718=0x0,_0x4dbe46={};_0x100718<_0x215260[_0x588f('0x41')];_0x100718+=0x1){_0x4dbe46=_0x215260[_0x100718];if(_[_0x588f('0x43')](_0x422750[_0x588f('0x16')][_0x4dbe46['id']])){_0x422750['voiceExtensions'][_0x4dbe46['id']]=new VoiceExtension(_0x4dbe46);}else{_0x422750[_0x588f('0x3f')](_0x422750[_0x588f('0x16')][_0x4dbe46['id']],_0x4dbe46);}}}return _0x422750[_0x588f('0x16')];};};Realtime['prototype'][_0x588f('0x63')]=function(){var _0x482f0e=this;return function(_0x450b7a){clearCampaigns(_0x482f0e['campaigns']);for(var _0xed878=0x0;_0xed878<_0x450b7a[_0x588f('0x41')];_0xed878+=0x1){_[_0x588f('0x64')](_0x482f0e[_0x588f('0x13')][_0x450b7a[_0xed878][_0x588f('0x29')]],_0x450b7a[_0xed878]);}return _0x482f0e[_0x588f('0x13')];};};Realtime[_0x588f('0x3e')][_0x588f('0x65')]=function(){var _0x2b6c10=this;return function(_0x3bcfe0){if(_0x3bcfe0){freeIsNotKey(_0x3bcfe0,_0x2b6c10['faxAccounts'],'id');for(var _0x234e55=0x0,_0x3d8612={},_0x1add37={};_0x234e55<_0x3bcfe0[_0x588f('0x41')];_0x234e55+=0x1){_0x3d8612=_0x3bcfe0[_0x234e55];if(_[_0x588f('0x43')](_0x2b6c10[_0x588f('0x23')][_0x3d8612['id']])){_0x2b6c10[_0x588f('0x23')][_0x3d8612['id']]=new FaxAccount(_0x3d8612);}else{_0x2b6c10['mergeFromDatabase'](_0x2b6c10[_0x588f('0x23')][_0x3d8612['id']],_0x3d8612);}}}return _0x2b6c10['faxAccounts'];};};module[_0x588f('0x66')]=Realtime;
\ No newline at end of file
+var _0x8d19=['abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','bluebird','moment','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','trunks','voiceQueues','triggers','campaigns','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','isNil','interface','total','answered','sumHoldTime','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','unmanaged','sumDuration','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','name','isUndefined','telephones','initTrunks','initVoiceQueues','initTriggers','templates','initSalesforceAccounts','freshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerabandon'];(function(_0x5b92a8,_0x411a2f){var _0x338fd3=function(_0x5dbb2e){while(--_0x5dbb2e){_0x5b92a8['push'](_0x5b92a8['shift']());}};_0x338fd3(++_0x411a2f);}(_0x8d19,0x15a));var _0x98d1=function(_0x1ac6e5,_0x40f47f){_0x1ac6e5=_0x1ac6e5-0x0;var _0x5877dc=_0x8d19[_0x1ac6e5];return _0x5877dc;};'use strict';var BPromise=require(_0x98d1('0x0'));var util=require('util');var _=require('lodash');var moment=require(_0x98d1('0x1'));var Agent=require('../model/agent');var Telephone=require(_0x98d1('0x2'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x98d1('0x3'));var Trigger=require(_0x98d1('0x4'));var Template=require(_0x98d1('0x5'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x98d1('0x6'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x98d1('0x7'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x98d1('0x8'));var ZohoAccount=require(_0x98d1('0x9'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x98d1('0xa'));var ServicenowAccount=require(_0x98d1('0xb'));var Dynamics365Account=require(_0x98d1('0xc'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x98d1('0xd'));var Realtime=function(){this[_0x98d1('0xe')]={};this['telephones']={};this[_0x98d1('0xf')]={};this[_0x98d1('0x10')]={};this[_0x98d1('0x11')]={};this[_0x98d1('0x12')]={};this['templates']={};this[_0x98d1('0x13')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x98d1('0x14')]={};this[_0x98d1('0x15')]={};this[_0x98d1('0x16')]={};this[_0x98d1('0x17')]={};this[_0x98d1('0x18')]={};this['settings']={};this[_0x98d1('0x19')]={};this[_0x98d1('0x1a')]={};this[_0x98d1('0x1b')]={};this['freshdeskAccounts']={};this[_0x98d1('0x1c')]={};this[_0x98d1('0x1d')]={};this[_0x98d1('0x1e')]={};this[_0x98d1('0x1f')]={};this[_0x98d1('0x20')]={};this[_0x98d1('0x21')]={};this[_0x98d1('0x22')]={};};function freeIsNotKey(_0x41126e,_0x1609ab,_0x260ee6){var _0x493bf0=_[_0x98d1('0x23')](_0x41126e,function(_0x24148e,_0x1e1e26){return _0x24148e[_0x260ee6];});for(var _0xac0d3 in _0x1609ab){if(_0x1609ab[_0x98d1('0x24')](_0xac0d3)){if(!_0x493bf0[_0xac0d3]){delete _0x1609ab[_0xac0d3];}}}}function freeIsNotKeySip(_0x34f9cc,_0x1a5cb4){var _0x5e41fb=_['mapKeys'](_0x34f9cc,function(_0x298be1,_0x4e7770){return util[_0x98d1('0x25')](_0x98d1('0x26'),_0x298be1['name']);});for(var _0x538d84 in _0x1a5cb4){if(_0x1a5cb4[_0x98d1('0x24')](_0x538d84)){if(!_0x5e41fb[_0x538d84]){delete _0x1a5cb4[_0x538d84];}}}}function freeIsNotKeyAgent(_0x37f8a3,_0x5ee866){var _0x2bddee=_[_0x98d1('0x23')](_0x37f8a3,function(_0x3d255e,_0x48faee){var _0x236a0e=_[_0x98d1('0x27')](_0x3d255e[_0x98d1('0x28')])?util[_0x98d1('0x25')]('SIP/%s',_0x3d255e['name']):_0x3d255e[_0x98d1('0x28')];return _0x236a0e;});for(var _0x127b6b in _0x5ee866){if(_0x5ee866[_0x98d1('0x24')](_0x127b6b)){if(!_0x2bddee[_0x127b6b]){delete _0x5ee866[_0x127b6b];}}}}function clearVoiceCallReports(_0x3798e9){_0x3798e9[_0x98d1('0x29')]=0x0;_0x3798e9[_0x98d1('0x2a')]=0x0;_0x3798e9[_0x98d1('0x2b')]=0x0;_0x3798e9['sumDuration']=0x0;_0x3798e9[_0x98d1('0x2c')]=0x0;}function clearCampaigns(_0xfc40d0){if(!_['isEmpty'](_0xfc40d0)){for(var _0x4f43d8 in _0xfc40d0){if(_0xfc40d0[_0x98d1('0x24')](_0x4f43d8)){_0xfc40d0[_0x4f43d8][_0x98d1('0x2d')]=0x0;_0xfc40d0[_0x4f43d8][_0x98d1('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x4be57e){if(!_[_0x98d1('0x2f')](_0x4be57e)){for(var _0xde291c in _0x4be57e){if(_0x4be57e[_0x98d1('0x24')](_0xde291c)){_0x4be57e[_0xde291c][_0x98d1('0x29')]=0x0;_0x4be57e[_0xde291c]['answered']=0x0;_0x4be57e[_0xde291c][_0x98d1('0x30')]=0x0;_0x4be57e[_0xde291c]['abandoned']=0x0;_0x4be57e[_0xde291c][_0x98d1('0x2b')]=0x0;_0x4be57e[_0xde291c][_0x98d1('0x31')]=0x0;_0x4be57e[_0xde291c][_0x98d1('0x2c')]=0x0;_0x4be57e[_0xde291c]['outboundAnswerAgiCallsDay']=0x0;_0x4be57e[_0xde291c][_0x98d1('0x32')]=0x0;_0x4be57e[_0xde291c][_0x98d1('0x33')]=0x0;_0x4be57e[_0xde291c][_0x98d1('0x34')]=0x0;_0x4be57e[_0xde291c][_0x98d1('0x35')]=0x0;_0x4be57e[_0xde291c]['outboundUnknownCallsDay']=0x0;_0x4be57e[_0xde291c][_0x98d1('0x36')]=0x0;_0x4be57e[_0xde291c][_0x98d1('0x37')]=0x0;_0x4be57e[_0xde291c][_0x98d1('0x38')]=0x0;_0x4be57e[_0xde291c][_0x98d1('0x39')]=0x0;_0x4be57e[_0xde291c][_0x98d1('0x3a')]=0x0;_0x4be57e[_0xde291c][_0x98d1('0x3b')]=0x0;_0x4be57e[_0xde291c][_0x98d1('0x3c')]=0x0;_0x4be57e[_0xde291c][_0x98d1('0x3d')]=0x0;_0x4be57e[_0xde291c][_0x98d1('0x3e')]=!![];}}}}Realtime[_0x98d1('0x3f')][_0x98d1('0x40')]=function(_0x559d27,_0x4ee106){for(var _0x5d0d28 in _0x4ee106){if(_0x559d27[_0x98d1('0x24')](_0x5d0d28)){_0x559d27[_0x5d0d28]=_0x4ee106[_0x5d0d28];}}};Realtime[_0x98d1('0x3f')]['initAgents']=function(){var _0x3f43a6=this;return function(_0x39c4fd){if(_0x39c4fd){freeIsNotKeyAgent(_0x39c4fd,_0x3f43a6[_0x98d1('0xe')]);for(var _0x2212c4=0x0,_0x58c973={},_0x5d6a9e={};_0x2212c4<_0x39c4fd[_0x98d1('0x41')];_0x2212c4+=0x1){_0x58c973=_0x39c4fd[_0x2212c4];var _0x1e114f=_['isNil'](_0x58c973[_0x98d1('0x28')])?util['format'](_0x98d1('0x26'),_0x58c973[_0x98d1('0x42')]):_0x58c973[_0x98d1('0x28')];if(_[_0x98d1('0x43')](_0x3f43a6[_0x98d1('0xe')][_0x1e114f])){_0x3f43a6[_0x98d1('0xe')][_0x1e114f]=new Agent(_0x58c973);}else{_0x3f43a6[_0x98d1('0x40')](_0x3f43a6['agents'][_0x1e114f],_0x58c973);}}}return _0x3f43a6[_0x98d1('0xe')];};};Realtime['prototype']['initTelephones']=function(){var _0x5a38bd=this;return function(_0x3bb242){if(_0x3bb242){freeIsNotKeySip(_0x3bb242,_0x5a38bd[_0x98d1('0x44')]);for(var _0x58c623=0x0,_0x1f5f31={},_0xc625d2={};_0x58c623<_0x3bb242[_0x98d1('0x41')];_0x58c623+=0x1){_0x1f5f31=_0x3bb242[_0x58c623];if(_[_0x98d1('0x43')](_0x5a38bd[_0x98d1('0x44')][util[_0x98d1('0x25')](_0x98d1('0x26'),_0x1f5f31[_0x98d1('0x42')])])){_0x5a38bd[_0x98d1('0x44')][util[_0x98d1('0x25')](_0x98d1('0x26'),_0x1f5f31['name'])]=new Telephone(_0x1f5f31);}else{_0x5a38bd[_0x98d1('0x40')](_0x5a38bd[_0x98d1('0x44')][util[_0x98d1('0x25')]('SIP/%s',_0x1f5f31[_0x98d1('0x42')])],_0x1f5f31);}}}return _0x5a38bd['telephones'];};};Realtime[_0x98d1('0x3f')][_0x98d1('0x45')]=function(){var _0x5e3d0d=this;return function(_0x45a22b){if(_0x45a22b){freeIsNotKeySip(_0x45a22b,_0x5e3d0d[_0x98d1('0xf')]);for(var _0x43414d=0x0,_0x5a7cda={},_0x203441={};_0x43414d<_0x45a22b[_0x98d1('0x41')];_0x43414d+=0x1){_0x5a7cda=_0x45a22b[_0x43414d];if(_[_0x98d1('0x43')](_0x5e3d0d[_0x98d1('0xf')][util[_0x98d1('0x25')]('SIP/%s',_0x5a7cda[_0x98d1('0x42')])])){_0x5e3d0d[_0x98d1('0xf')][util[_0x98d1('0x25')](_0x98d1('0x26'),_0x5a7cda[_0x98d1('0x42')])]=new Trunk(_0x5a7cda);}else{_0x5e3d0d[_0x98d1('0x40')](_0x5e3d0d['trunks'][util[_0x98d1('0x25')](_0x98d1('0x26'),_0x5a7cda['name'])],_0x5a7cda);}}}return _0x5e3d0d['trunks'];};};Realtime[_0x98d1('0x3f')][_0x98d1('0x46')]=function(){var _0x4e8fdb=this;return function(_0x2b92ef){if(_0x2b92ef){freeIsNotKey(_0x2b92ef,_0x4e8fdb[_0x98d1('0x10')],_0x98d1('0x42'));for(var _0x54c4f8=0x0,_0x52bc59={},_0x16c70b={};_0x54c4f8<_0x2b92ef[_0x98d1('0x41')];_0x54c4f8+=0x1){_0x52bc59=_0x2b92ef[_0x54c4f8];if(_[_0x98d1('0x43')](_0x4e8fdb[_0x98d1('0x10')][_0x52bc59[_0x98d1('0x42')]])){_0x4e8fdb[_0x98d1('0x10')][_0x52bc59[_0x98d1('0x42')]]=new VoiceQueue(_0x52bc59);}else{_0x4e8fdb[_0x98d1('0x40')](_0x4e8fdb[_0x98d1('0x10')][_0x52bc59[_0x98d1('0x42')]],_0x52bc59);}}}return _0x4e8fdb[_0x98d1('0x10')];};};Realtime[_0x98d1('0x3f')][_0x98d1('0x47')]=function(){var _0x112ce5=this;return function(_0x4c2552){if(_0x4c2552){freeIsNotKey(_0x4c2552,_0x112ce5['triggers'],'id');for(var _0x648644=0x0,_0x18b625={},_0x11b109={};_0x648644<_0x4c2552[_0x98d1('0x41')];_0x648644+=0x1){_0x18b625=_0x4c2552[_0x648644];if(_[_0x98d1('0x43')](_0x112ce5[_0x98d1('0x11')][_0x18b625['id']])){_0x112ce5[_0x98d1('0x11')][_0x18b625['id']]=new Trigger(_0x18b625);}else{_0x112ce5['mergeFromDatabase'](_0x112ce5[_0x98d1('0x11')][_0x18b625['id']],_0x18b625);}}}return _0x112ce5[_0x98d1('0x11')];};};Realtime[_0x98d1('0x3f')]['initTemplates']=function(){var _0x3f7396=this;return function(_0x2251c6){if(_0x2251c6){freeIsNotKey(_0x2251c6,_0x3f7396[_0x98d1('0x48')],'id');for(var _0xea75ff=0x0,_0xd87005={},_0x2cc798={};_0xea75ff<_0x2251c6[_0x98d1('0x41')];_0xea75ff+=0x1){_0xd87005=_0x2251c6[_0xea75ff];if(_[_0x98d1('0x43')](_0x3f7396[_0x98d1('0x48')][_0xd87005['id']])){_0x3f7396['templates'][_0xd87005['id']]=new Template(_0xd87005);}else{_0x3f7396['mergeFromDatabase'](_0x3f7396[_0x98d1('0x48')][_0xd87005['id']],_0xd87005);}}}return _0x3f7396[_0x98d1('0x48')];};};Realtime[_0x98d1('0x3f')]['initZendeskAccounts']=function(){var _0x812659=this;return function(_0x350db2){if(_0x350db2){freeIsNotKey(_0x350db2,_0x812659[_0x98d1('0x19')],'id');for(var _0x3325f7=0x0,_0x41ce68={},_0x378713={};_0x3325f7<_0x350db2[_0x98d1('0x41')];_0x3325f7+=0x1){_0x41ce68=_0x350db2[_0x3325f7];if(_[_0x98d1('0x43')](_0x812659[_0x98d1('0x19')][_0x41ce68['id']])){_0x812659[_0x98d1('0x19')][_0x41ce68['id']]=new ZendeskAccount(_0x41ce68);}else{_0x812659[_0x98d1('0x40')](_0x812659[_0x98d1('0x19')][_0x41ce68['id']],_0x41ce68);}}}return _0x812659[_0x98d1('0x19')];};};Realtime[_0x98d1('0x3f')][_0x98d1('0x49')]=function(){var _0xcc517f=this;return function(_0x19d9e9){if(_0x19d9e9){freeIsNotKey(_0x19d9e9,_0xcc517f[_0x98d1('0x1a')],'id');for(var _0x3c5d00=0x0,_0x34d1d3={},_0x27c20d={};_0x3c5d00<_0x19d9e9[_0x98d1('0x41')];_0x3c5d00+=0x1){_0x34d1d3=_0x19d9e9[_0x3c5d00];if(_[_0x98d1('0x43')](_0xcc517f['salesforceAccounts'][_0x34d1d3['id']])){_0xcc517f['salesforceAccounts'][_0x34d1d3['id']]=new SalesforceAccount(_0x34d1d3);}else{_0xcc517f[_0x98d1('0x40')](_0xcc517f[_0x98d1('0x1a')][_0x34d1d3['id']],_0x34d1d3);}}}return _0xcc517f[_0x98d1('0x1a')];};};Realtime[_0x98d1('0x3f')]['initFreshdeskAccounts']=function(){var _0x1ae984=this;return function(_0x3a0901){if(_0x3a0901){freeIsNotKey(_0x3a0901,_0x1ae984[_0x98d1('0x4a')],'id');for(var _0x1119c7=0x0,_0x4a3da2={},_0x1d5a66={};_0x1119c7<_0x3a0901['length'];_0x1119c7+=0x1){_0x4a3da2=_0x3a0901[_0x1119c7];if(_[_0x98d1('0x43')](_0x1ae984['freshdeskAccounts'][_0x4a3da2['id']])){_0x1ae984[_0x98d1('0x4a')][_0x4a3da2['id']]=new FreshdeskAccount(_0x4a3da2);}else{_0x1ae984[_0x98d1('0x40')](_0x1ae984[_0x98d1('0x4a')][_0x4a3da2['id']],_0x4a3da2);}}}return _0x1ae984['freshdeskAccounts'];};};Realtime[_0x98d1('0x3f')][_0x98d1('0x4b')]=function(){var _0x1a043e=this;return function(_0x13df08){if(_0x13df08){freeIsNotKey(_0x13df08,_0x1a043e['zohoAccounts'],'id');for(var _0x181322=0x0,_0x1bcbce={},_0x267b25={};_0x181322<_0x13df08[_0x98d1('0x41')];_0x181322+=0x1){_0x1bcbce=_0x13df08[_0x181322];if(_['isUndefined'](_0x1a043e[_0x98d1('0x1c')][_0x1bcbce['id']])){_0x1a043e[_0x98d1('0x1c')][_0x1bcbce['id']]=new ZohoAccount(_0x1bcbce);}else{_0x1a043e[_0x98d1('0x40')](_0x1a043e[_0x98d1('0x1c')][_0x1bcbce['id']],_0x1bcbce);}}}return _0x1a043e['zohoAccounts'];};};Realtime[_0x98d1('0x3f')]['initDeskAccounts']=function(){var _0x4f4aee=this;return function(_0x1172b0){if(_0x1172b0){freeIsNotKey(_0x1172b0,_0x4f4aee[_0x98d1('0x1d')],'id');for(var _0x441c42=0x0,_0x2ee7fe={},_0x502918={};_0x441c42<_0x1172b0['length'];_0x441c42+=0x1){_0x2ee7fe=_0x1172b0[_0x441c42];if(_[_0x98d1('0x43')](_0x4f4aee[_0x98d1('0x1d')][_0x2ee7fe['id']])){_0x4f4aee['deskAccounts'][_0x2ee7fe['id']]=new DeskAccount(_0x2ee7fe);}else{_0x4f4aee[_0x98d1('0x40')](_0x4f4aee[_0x98d1('0x1d')][_0x2ee7fe['id']],_0x2ee7fe);}}}return _0x4f4aee[_0x98d1('0x1d')];};};Realtime[_0x98d1('0x3f')][_0x98d1('0x4c')]=function(){var _0x42473=this;return function(_0x5c3bc0){if(_0x5c3bc0){freeIsNotKey(_0x5c3bc0,_0x42473[_0x98d1('0x1b')],'id');for(var _0x409bf5=0x0,_0x59ba71={},_0x7f93a={};_0x409bf5<_0x5c3bc0[_0x98d1('0x41')];_0x409bf5+=0x1){_0x59ba71=_0x5c3bc0[_0x409bf5];if(_[_0x98d1('0x43')](_0x42473[_0x98d1('0x1b')][_0x59ba71['id']])){_0x42473[_0x98d1('0x1b')][_0x59ba71['id']]=new SugarcrmAccount(_0x59ba71);}else{_0x42473[_0x98d1('0x40')](_0x42473[_0x98d1('0x1b')][_0x59ba71['id']],_0x59ba71);}}}return _0x42473['sugarcrmAccounts'];};};Realtime[_0x98d1('0x3f')][_0x98d1('0x4d')]=function(){var _0x10c25d=this;return function(_0x46ce6c){if(_0x46ce6c){freeIsNotKey(_0x46ce6c,_0x10c25d['vtigerAccounts'],'id');for(var _0x5c1126=0x0,_0xf7bcda={},_0x48e927={};_0x5c1126<_0x46ce6c[_0x98d1('0x41')];_0x5c1126+=0x1){_0xf7bcda=_0x46ce6c[_0x5c1126];if(_[_0x98d1('0x43')](_0x10c25d[_0x98d1('0x1e')][_0xf7bcda['id']])){_0x10c25d['vtigerAccounts'][_0xf7bcda['id']]=new VtigerAccount(_0xf7bcda);}else{_0x10c25d[_0x98d1('0x40')](_0x10c25d[_0x98d1('0x1e')][_0xf7bcda['id']],_0xf7bcda);}}}return _0x10c25d['vtigerAccounts'];};};Realtime[_0x98d1('0x3f')][_0x98d1('0x4e')]=function(){var _0x3347cf=this;return function(_0x34c3df){if(_0x34c3df){freeIsNotKey(_0x34c3df,_0x3347cf['servicenowAccounts'],'id');for(var _0x36facc=0x0,_0x6d7386={},_0x3879a6={};_0x36facc<_0x34c3df[_0x98d1('0x41')];_0x36facc+=0x1){_0x6d7386=_0x34c3df[_0x36facc];if(_['isUndefined'](_0x3347cf[_0x98d1('0x1f')][_0x6d7386['id']])){_0x3347cf[_0x98d1('0x1f')][_0x6d7386['id']]=new ServicenowAccount(_0x6d7386);}else{_0x3347cf[_0x98d1('0x40')](_0x3347cf[_0x98d1('0x1f')][_0x6d7386['id']],_0x6d7386);}}}return _0x3347cf[_0x98d1('0x1f')];};};Realtime[_0x98d1('0x3f')][_0x98d1('0x4f')]=function(){var _0x4685d7=this;return function(_0x61b4f){if(_0x61b4f){freeIsNotKey(_0x61b4f,_0x4685d7['dynamics365Accounts'],'id');for(var _0x51628d=0x0,_0x25561a={},_0x56b481={};_0x51628d<_0x61b4f[_0x98d1('0x41')];_0x51628d+=0x1){_0x25561a=_0x61b4f[_0x51628d];if(_[_0x98d1('0x43')](_0x4685d7[_0x98d1('0x20')][_0x25561a['id']])){_0x4685d7['dynamics365Accounts'][_0x25561a['id']]=new Dynamics365Account(_0x25561a);}else{_0x4685d7[_0x98d1('0x40')](_0x4685d7['dynamics365Accounts'][_0x25561a['id']],_0x25561a);}}}return _0x4685d7[_0x98d1('0x20')];};};Realtime[_0x98d1('0x3f')]['initFreshsalesAccounts']=function(){var _0xc7fb1=this;return function(_0x5b80e3){if(_0x5b80e3){freeIsNotKey(_0x5b80e3,_0xc7fb1['freshsalesAccounts'],'id');for(var _0x109787=0x0,_0x5b703d={},_0xc493ce={};_0x109787<_0x5b80e3[_0x98d1('0x41')];_0x109787+=0x1){_0x5b703d=_0x5b80e3[_0x109787];if(_[_0x98d1('0x43')](_0xc7fb1[_0x98d1('0x21')][_0x5b703d['id']])){_0xc7fb1[_0x98d1('0x21')][_0x5b703d['id']]=new FreshsalesAccount(_0x5b703d);}else{_0xc7fb1[_0x98d1('0x40')](_0xc7fb1[_0x98d1('0x21')][_0x5b703d['id']],_0x5b703d);}}}return _0xc7fb1[_0x98d1('0x21')];};};Realtime[_0x98d1('0x3f')][_0x98d1('0x50')]=function(){var _0x17d982=this;return function(_0x107cd1){for(var _0x5b617d=0x0;_0x5b617d<_0x107cd1[_0x98d1('0x41')];_0x5b617d+=0x1){_['merge'](_0x17d982[_0x98d1('0x10')][_0x107cd1[_0x5b617d][_0x98d1('0x42')]],_0x107cd1[_0x5b617d]);}return _0x17d982['voiceQueues'];};};Realtime['prototype'][_0x98d1('0x51')]=function(){var _0x171200=this;return function(_0x41f3bb){clearVoiceQueues(_0x171200[_0x98d1('0x10')]);if(_0x41f3bb){_0x41f3bb=_[_0x98d1('0x52')](_0x41f3bb,_0x98d1('0x53'));for(var _0xbfe3d0 in _0x41f3bb){if(_0x41f3bb[_0x98d1('0x24')](_0xbfe3d0)){var _0x3ccc02={};for(var _0x2008b4=0x0;_0x2008b4<_0x41f3bb[_0xbfe3d0][_0x98d1('0x41')];_0x2008b4+=0x1){var _0x238b22=_0x41f3bb[_0xbfe3d0][_0x2008b4][_0x98d1('0x54')];if(_0x171200['voiceQueues'][_0x238b22]){if(_0x41f3bb[_0xbfe3d0][_0x2008b4]['queuecallerexit']){_0x171200[_0x98d1('0x10')][_0x238b22]['unmanaged']+=0x1;}if(_0x41f3bb[_0xbfe3d0][_0x2008b4][_0x98d1('0x55')]){_0x171200[_0x98d1('0x10')][_0x238b22][_0x98d1('0x56')]+=0x1;}_0x171200[_0x98d1('0x10')][_0x238b22]['sumHoldTime']+=moment(_0x41f3bb[_0xbfe3d0][_0x2008b4][_0x98d1('0x57')])[_0x98d1('0x58')](moment(_0x41f3bb[_0xbfe3d0][_0x2008b4][_0x98d1('0x59')]),_0x98d1('0x5a'))||0x0;if(_0x2008b4===_0x41f3bb[_0xbfe3d0][_0x98d1('0x41')]-0x1){_0x171200['voiceQueues'][_0x238b22][_0x98d1('0x31')]+=moment(_0x41f3bb[_0xbfe3d0][_0x2008b4][_0x98d1('0x5b')]||_0x41f3bb[_0xbfe3d0][_0x2008b4][_0x98d1('0x5c')]||_0x41f3bb[_0xbfe3d0][_0x2008b4][_0x98d1('0x5d')])[_0x98d1('0x58')](moment(_0x41f3bb[_0xbfe3d0][_0x2008b4][_0x98d1('0x59')]),_0x98d1('0x5a'))||0x0;_0x171200[_0x98d1('0x10')][_0x238b22]['total']+=0x1;if(_0x41f3bb[_0xbfe3d0][_0x2008b4][_0x98d1('0x5e')]){_0x171200[_0x98d1('0x10')][_0x238b22]['answered']+=0x1;_0x171200[_0x98d1('0x10')][_0x238b22][_0x98d1('0x2c')]+=moment(_0x41f3bb[_0xbfe3d0][_0x2008b4]['queuecallercompleteAt'])[_0x98d1('0x58')](moment(_0x41f3bb[_0xbfe3d0][_0x2008b4]['queuecallerleaveAt']),_0x98d1('0x5a'))||0x0;}}else{_0x171200[_0x98d1('0x10')][_0x238b22][_0x98d1('0x31')]+=_0x171200[_0x98d1('0x10')][_0x238b22][_0x98d1('0x2b')]||0x0;}}}}}}return _0x171200['voiceQueues'];};};Realtime[_0x98d1('0x3f')][_0x98d1('0x5f')]=function(){var _0x5823d=this;return function(_0x32f9ef){clearVoiceCallReports(_0x5823d[_0x98d1('0x13')]);if(_0x32f9ef){for(var _0x3c77f2=0x0;_0x3c77f2<_0x32f9ef['length'];_0x3c77f2+=0x1){_0x5823d[_0x98d1('0x13')][_0x98d1('0x29')]+=0x1;_0x5823d['outbound'][_0x98d1('0x31')]+=_0x32f9ef[_0x3c77f2][_0x98d1('0x60')];if(_0x32f9ef[_0x3c77f2][_0x98d1('0x61')]===_0x98d1('0x62')){_0x5823d[_0x98d1('0x13')][_0x98d1('0x2a')]+=0x1;_0x5823d[_0x98d1('0x13')][_0x98d1('0x2b')]+=_0x32f9ef[_0x3c77f2][_0x98d1('0x60')]-_0x32f9ef[_0x3c77f2][_0x98d1('0x63')]||0x0;_0x5823d[_0x98d1('0x13')][_0x98d1('0x2c')]+=_0x32f9ef[_0x3c77f2][_0x98d1('0x63')];}}}return _0x5823d[_0x98d1('0x13')];};};Realtime[_0x98d1('0x3f')][_0x98d1('0x64')]=function(){var _0xca829=this;return function(_0x3759c5){if(_0x3759c5){freeIsNotKey(_0x3759c5,_0xca829[_0x98d1('0x12')],_0x98d1('0x42'));for(var _0x1d5cbc=0x0,_0x14cc11={};_0x1d5cbc<_0x3759c5[_0x98d1('0x41')];_0x1d5cbc+=0x1){_0x14cc11=_0x3759c5[_0x1d5cbc];if(_['isUndefined'](_0xca829[_0x98d1('0x12')][_0x14cc11['name']])){_0xca829[_0x98d1('0x12')][_0x14cc11[_0x98d1('0x42')]]=new Campaign(_0x14cc11);}else{_0xca829[_0x98d1('0x40')](_0xca829[_0x98d1('0x12')][_0x14cc11[_0x98d1('0x42')]],_0x14cc11);_0xca829[_0x98d1('0x12')][_0x14cc11[_0x98d1('0x42')]][_0x98d1('0x65')]=_0x14cc11[_0x98d1('0x66')]?_0x14cc11[_0x98d1('0x66')][_0x98d1('0x42')]:undefined;}}}return _0xca829[_0x98d1('0x12')];};};Realtime['prototype'][_0x98d1('0x67')]=function(){var _0x1b6fbf=this;return function(_0xc31285){if(_0xc31285){freeIsNotKey(_0xc31285,_0x1b6fbf['voiceExtensions'],'id');for(var _0x3325a7=0x0,_0x4c0280={};_0x3325a7<_0xc31285['length'];_0x3325a7+=0x1){_0x4c0280=_0xc31285[_0x3325a7];if(_[_0x98d1('0x43')](_0x1b6fbf[_0x98d1('0x14')][_0x4c0280['id']])){_0x1b6fbf[_0x98d1('0x14')][_0x4c0280['id']]=new VoiceExtension(_0x4c0280);}else{_0x1b6fbf['mergeFromDatabase'](_0x1b6fbf['voiceExtensions'][_0x4c0280['id']],_0x4c0280);}}}return _0x1b6fbf['voiceExtensions'];};};Realtime[_0x98d1('0x3f')][_0x98d1('0x68')]=function(){var _0x15bd88=this;return function(_0x3f1575){clearCampaigns(_0x15bd88[_0x98d1('0x12')]);for(var _0x59ab36=0x0;_0x59ab36<_0x3f1575['length'];_0x59ab36+=0x1){_[_0x98d1('0x69')](_0x15bd88[_0x98d1('0x12')][_0x3f1575[_0x59ab36][_0x98d1('0x42')]],_0x3f1575[_0x59ab36]);}return _0x15bd88[_0x98d1('0x12')];};};Realtime[_0x98d1('0x3f')][_0x98d1('0x6a')]=function(){var _0x45254a=this;return function(_0x342727){if(_0x342727){freeIsNotKey(_0x342727,_0x45254a[_0x98d1('0x22')],'id');for(var _0x36b531=0x0,_0x2cc62c={},_0x37574b={};_0x36b531<_0x342727[_0x98d1('0x41')];_0x36b531+=0x1){_0x2cc62c=_0x342727[_0x36b531];if(_['isUndefined'](_0x45254a[_0x98d1('0x22')][_0x2cc62c['id']])){_0x45254a['faxAccounts'][_0x2cc62c['id']]=new FaxAccount(_0x2cc62c);}else{_0x45254a['mergeFromDatabase'](_0x45254a['faxAccounts'][_0x2cc62c['id']],_0x2cc62c);}}}return _0x45254a['faxAccounts'];};};module[_0x98d1('0x6b')]=Realtime;
\ No newline at end of file
index 596071e..3262e3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9fe=['custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindTransfer','attendedTransfer','name','isNil','find','interface','SIP/%s','length','connectedlinenum','accountcode','lastAssignedTo','format','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','getAgentByInternal','keys','getCallType','split','outbound','destination','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','linkedid','transfers','transfereelinkedid','type','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','exten','calleridname','connectedlinename','originatecalleridnum','isArray','forEach','substring','mobile','phone','indexOf','transfererlinkedid','exports','lodash','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind'];(function(_0x3735f9,_0x1ae262){var _0x1ad32=function(_0x3a73ae){while(--_0x3a73ae){_0x3735f9['push'](_0x3735f9['shift']());}};_0x1ad32(++_0x1ae262);}(_0xc9fe,0x1b6));var _0xec9f=function(_0x3a77bf,_0x402f3e){_0x3a77bf=_0x3a77bf-0x0;var _0x2b7d73=_0xc9fe[_0x3a77bf];return _0x2b7d73;};'use strict';var _=require(_0xec9f('0x0'));var moment=require(_0xec9f('0x1'));var util=require(_0xec9f('0x2'));var config=require('../../../config/environment');var ami=require(_0xec9f('0x3'));var RpcVoiceAgentReport=require(_0xec9f('0x4'));var RpcVoiceCallReport=require(_0xec9f('0x5'));var RpcVoiceDialReport=require(_0xec9f('0x6'));var RpcMemberReport=require(_0xec9f('0x7'));var RpcVoiceQueueReport=require(_0xec9f('0x8'));var RpcVoiceRecording=require(_0xec9f('0x9'));var RpcVoiceTransferReport=require(_0xec9f('0xa'));var VoiceQueueReport=require(_0xec9f('0xb'));var VoiceCallReport=require(_0xec9f('0xc'));var VoiceAgentReport=require(_0xec9f('0xd'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xec9f('0xe'));function Report(_0x3e1940){this['realtime']=_0x3e1940;this['agents']=_0x3e1940[_0xec9f('0xf')];this[_0xec9f('0x10')]=_0x3e1940[_0xec9f('0x10')];}Report[_0xec9f('0x11')][_0xec9f('0x12')]=function(_0xba5562){var _0x46fb93=new VoiceQueueReport(this[_0xec9f('0x13')]);var _0xb7cbd2=new VoiceAgentReport(this[_0xec9f('0x13')]);var _0xfc778b=new VoiceDialReport(this[_0xec9f('0x13')]);var _0x4c084b=new VoiceCallReport(this[_0xec9f('0x13')]);var _0x1e340a=new UserReport(this['realtime']);if(config[_0xec9f('0x14')]&&config['xdr'][_0xec9f('0x15')]){ami['on'](_0xec9f('0x16'),this[_0xec9f('0x17')]['bind'](this));ami['on'](_0xec9f('0x18'),this[_0xec9f('0x19')][_0xec9f('0x1a')](this));ami['on'](_0xec9f('0x1b'),this[_0xec9f('0x1c')]['bind'](this));ami['on']('custom:voiceDialReport',this[_0xec9f('0x1d')][_0xec9f('0x1a')](this));ami['on']('blindtransfer',this[_0xec9f('0x1e')][_0xec9f('0x1a')](this));ami['on']('attendedtransfer',this[_0xec9f('0x1f')][_0xec9f('0x1a')](this));}};Report[_0xec9f('0x11')]['findAgent']=function(_0x38829b){var _0x5ed0bf;_0x5ed0bf=_['find'](this['agents'],function(_0x19d37c){return _0x19d37c['accountcode']==_0x38829b||_0x19d37c[_0xec9f('0x20')]==_0x38829b;});if(_[_0xec9f('0x21')](_0x5ed0bf)){var _0x5c57d1=_['find'](this[_0xec9f('0x10')],function(_0x52b6ed){return _0x52b6ed['accountcode']==_0x38829b||_0x52b6ed['name']==_0x38829b;});if(_0x5c57d1){_0x5ed0bf=_[_0xec9f('0x22')](this[_0xec9f('0xf')],function(_0x5b3115){return _0x5b3115[_0xec9f('0x23')]==util['format'](_0xec9f('0x24'),_0x5c57d1[_0xec9f('0x20')]);});}}return _0x5ed0bf;};Report[_0xec9f('0x11')][_0xec9f('0x17')]=function(_0x198fe0){for(var _0x5c3ea2=0x0;_0x5c3ea2<_0x198fe0[_0xec9f('0x25')];_0x5c3ea2+=0x1){var _0x437f80=this['findAgent'](_0x198fe0[_0x5c3ea2][_0xec9f('0x26')]);if(_0x437f80){_0x198fe0[_0x5c3ea2][_0xec9f('0x27')]=_0x437f80[_0xec9f('0x27')];_0x198fe0[_0x5c3ea2]['assigned']=!![];_0x198fe0[_0x5c3ea2][_0xec9f('0x28')]=_0x437f80['name'];_0x198fe0[_0x5c3ea2][_0xec9f('0x23')]=_[_0xec9f('0x21')](_0x437f80[_0xec9f('0x23')])?util[_0xec9f('0x29')](_0xec9f('0x24'),_0x437f80['name']):_0x437f80[_0xec9f('0x23')];if(_0x198fe0[_0x5c3ea2]['queuecallercomplete']){_0x198fe0[_0x5c3ea2][_0xec9f('0x2a')]=moment()[_0xec9f('0x29')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x198fe0[_0x5c3ea2][_0xec9f('0x2b')]){_0x198fe0[_0x5c3ea2][_0xec9f('0x2c')]=moment()[_0xec9f('0x29')](_0xec9f('0x2d'));}RpcMemberReport[_0xec9f('0x17')](_0x198fe0[_0x5c3ea2]);}RpcVoiceQueueReport[_0xec9f('0x2e')](_0x198fe0[_0x5c3ea2]);}};function extractCalleridNumber(_0x7740a4){var _0x5c8c1e=_0x7740a4[_0xec9f('0x2f')](/<(.*?)>/);return _0x5c8c1e?_0x5c8c1e[0x1]:_0x7740a4;}Report[_0xec9f('0x11')][_0xec9f('0x30')]=function(_0x1fb039){for(var _0x154e65=0x0;_0x154e65<Object[_0xec9f('0x31')](this[_0xec9f('0xf')])[_0xec9f('0x25')];_0x154e65++){var _0x40a1a3=Object['keys'](this[_0xec9f('0xf')])[_0x154e65];var _0xba69b7=this[_0xec9f('0xf')][_0x40a1a3];if(_0xba69b7[_0xec9f('0x27')]===Number(_0x1fb039))return _0xba69b7;}return null;};Report[_0xec9f('0x11')][_0xec9f('0x32')]=function(_0xe23887){var _0xa00094=_0xe23887['channel'][_0xec9f('0x33')]('-')[0x0];var _0x47fbbf=this[_0xec9f('0xf')][_0xa00094];if(!_0x47fbbf)_0x47fbbf=this[_0xec9f('0x30')](_0xe23887['calleridnum']);return!_0x47fbbf?_0xec9f('0x34'):'internal';};Report[_0xec9f('0x11')][_0xec9f('0x19')]=function(_0x54612e){_0x54612e[_0xec9f('0x35')]=_0x54612e[_0xec9f('0x35')]||_0x54612e['exten'];if(_0x54612e['type']==_0xec9f('0x36')){_0x54612e[_0xec9f('0x37')]=_0xec9f('0x38');_0x54612e[_0xec9f('0x39')]=_0x54612e['queue'];if(_0x54612e[_0xec9f('0x3a')]==_0xec9f('0x3b')){_0x54612e['accountcode']='';_0x54612e[_0xec9f('0x35')]=extractCalleridNumber(_0x54612e[_0xec9f('0x3c')]);}else if(_0x54612e[_0xec9f('0x3a')]==_0xec9f('0x3d')){if(_0x54612e[_0xec9f('0x35')]==_0xec9f('0x3e')){_0x54612e[_0xec9f('0x35')]=extractCalleridNumber(_0x54612e[_0xec9f('0x3f')]);_0x54612e[_0xec9f('0x40')]=_0x54612e['originatecalleridnum'];_0x54612e[_0xec9f('0x41')]=[_0x54612e['channel'],_0x54612e[_0xec9f('0x42')]=_0x54612e[_0xec9f('0x41')]][0x0];_0x54612e[_0xec9f('0x3c')]=_0x54612e[_0xec9f('0x3f')];}else{_0x54612e[_0xec9f('0x35')]=_0x54612e[_0xec9f('0x40')];_0x54612e[_0xec9f('0x40')]=_0x54612e['originatecalleridnum'];if(_0x54612e[_0xec9f('0x43')]==_0xec9f('0x44')){_0x54612e[_0xec9f('0x27')]=_0x54612e[_0xec9f('0x26')];}else{_0x54612e[_0xec9f('0x27')]='';}}}}else{_0x54612e[_0xec9f('0x3c')]=util['format'](_0xec9f('0x45'),_0x54612e['calleridname'],_0x54612e['calleridnum']);}if(RpcVoiceTransferReport['transfers'][_0x54612e[_0xec9f('0x46')]]){var _0x5cceb3=RpcVoiceTransferReport[_0xec9f('0x47')][_0x54612e[_0xec9f('0x46')]];_0x5cceb3[_0xec9f('0x48')]=_0x54612e['uniqueid'];RpcVoiceTransferReport['blindTransfer'](_0x5cceb3);delete RpcVoiceTransferReport[_0xec9f('0x47')][_0x54612e[_0xec9f('0x46')]];}if(_['isNil'](_0x54612e[_0xec9f('0x49')])){_0x54612e['type']=this[_0xec9f('0x32')](_0x54612e);}if(_[_0xec9f('0x21')](_0x54612e[_0xec9f('0x4a')])){var _0x41d531=_0x54612e[_0xec9f('0x42')]['split']('-')[0x0];var _0x590053=this[_0xec9f('0xf')][_0x41d531];if(!_0x590053)_0x590053=this[_0xec9f('0x30')](_0x54612e[_0xec9f('0x27')]);if(_0x590053){_0x54612e[_0xec9f('0x4a')]=_0x590053['id'];_0x54612e[_0xec9f('0x4b')]=_0x590053[_0xec9f('0x20')];}}RpcVoiceCallReport[_0xec9f('0x2e')](_0x54612e);if(_0x54612e[_0xec9f('0x4c')]){for(var _0xcfc9e8=0x0;_0xcfc9e8<_0x54612e[_0xec9f('0x4d')][_0xec9f('0x25')];_0xcfc9e8+=0x1){_0x54612e[_0xec9f('0x4e')]=_0x54612e[_0xec9f('0x4d')][_0xcfc9e8][_0xec9f('0x4f')];_0x54612e[_0xec9f('0x50')]=_0x54612e['monitors'][_0xcfc9e8][_0xec9f('0x50')];if(_0x54612e[_0xec9f('0x51')]==_0xec9f('0x3e')){_0x54612e[_0xec9f('0x40')]=_0x54612e['connectedlinenum'];_0x54612e[_0xec9f('0x52')]=_0x54612e['connectedlinename'];_0x54612e[_0xec9f('0x26')]=_0x54612e['accountcode'];_0x54612e[_0xec9f('0x53')]=_0x54612e[_0xec9f('0x4b')];_0x54612e[_0xec9f('0x51')]=_0x54612e[_0xec9f('0x54')];}else if(_0x54612e[_0xec9f('0x51')]=='xcally-motion-dialer'){_0x54612e[_0xec9f('0x40')]=_0x54612e['destination'];_0x54612e['exten']=_0x54612e[_0xec9f('0x54')];}RpcVoiceRecording['create'](_0x54612e);}}};Report[_0xec9f('0x11')][_0xec9f('0x1c')]=function(_0x27ec53){if(_[_0xec9f('0x55')](_0x27ec53)){_0x27ec53[_0xec9f('0x56')](function(_0x25a123){RpcVoiceAgentReport[_0xec9f('0x2e')](_0x25a123);});}else{RpcVoiceAgentReport[_0xec9f('0x2e')](_0x27ec53);}};Report[_0xec9f('0x11')][_0xec9f('0x1d')]=function(_0x47e44a){RpcVoiceDialReport[_0xec9f('0x2e')](_0x47e44a);var _0x4cf115;var _0x1f609b;var _0x36b1b3=_0x47e44a[_0xec9f('0x42')];if(_['startsWith'](_0x36b1b3,'Local')){_0x1f609b=_0x36b1b3[_0xec9f('0x57')](_0x36b1b3['indexOf']('/')+0x1,_0x36b1b3['indexOf']('@'));_0x4cf115=_[_0xec9f('0x22')](this[_0xec9f('0xf')],function(_0x56bafa){return _0x56bafa[_0xec9f('0x58')]==_0x1f609b||_0x56bafa[_0xec9f('0x59')]==_0x1f609b||_0x56bafa[_0xec9f('0x27')]==_0x1f609b;});}else{_0x1f609b=_0x36b1b3[_0xec9f('0x57')](_0x36b1b3[_0xec9f('0x5a')]('/')+0x1,_0x36b1b3['lastIndexOf']('-'));_0x4cf115=this['findAgent'](_0x1f609b);}if(_0x4cf115){_0x47e44a[_0xec9f('0x23')]=_[_0xec9f('0x21')](_0x4cf115[_0xec9f('0x23')])?util[_0xec9f('0x29')]('SIP/%s',_0x4cf115[_0xec9f('0x20')]):_0x4cf115['interface'];_0x47e44a[_0xec9f('0x4b')]=_0x4cf115[_0xec9f('0x20')];_0x47e44a[_0xec9f('0x27')]=_0x4cf115[_0xec9f('0x27')];RpcMemberReport[_0xec9f('0x1d')](_0x47e44a);}};Report[_0xec9f('0x11')]['blindTransfer']=function(_0x5527b4){RpcVoiceTransferReport[_0xec9f('0x47')][_0x5527b4[_0xec9f('0x5b')]]=_0x5527b4;};Report[_0xec9f('0x11')][_0xec9f('0x1f')]=function(_0x4344fc){RpcVoiceTransferReport[_0xec9f('0x1f')](_0x4344fc);};module[_0xec9f('0x5c')]=Report;
\ No newline at end of file
+var _0x321a=['exten','dialer','lastapplication','queue','lastdata','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','destinationchannel','channel','originatecalleridnum','disposition','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','uniqueid','type','UserId','membername','monitor','monitors','filename','createdAt','connectedlinename','xcally-motion-dialer','voiceAgentReport','startsWith','Local','substring','indexOf','phone','lastIndexOf','transfererlinkedid','lodash','moment','util','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','find','accountcode','isNil','name','interface','format','findAgent','assigned','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','keys','length','getCallType','split','getAgentByInternal','calleridnum','internal','destination'];(function(_0x29e910,_0x3d13e8){var _0xf5c96=function(_0x103754){while(--_0x103754){_0x29e910['push'](_0x29e910['shift']());}};_0xf5c96(++_0x3d13e8);}(_0x321a,0x1dc));var _0xa321=function(_0x52d0e8,_0x3500b4){_0x52d0e8=_0x52d0e8-0x0;var _0x2beaa5=_0x321a[_0x52d0e8];return _0x2beaa5;};'use strict';var _=require(_0xa321('0x0'));var moment=require(_0xa321('0x1'));var util=require(_0xa321('0x2'));var config=require(_0xa321('0x3'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xa321('0x4'));var RpcVoiceCallReport=require(_0xa321('0x5'));var RpcVoiceDialReport=require(_0xa321('0x6'));var RpcMemberReport=require(_0xa321('0x7'));var RpcVoiceQueueReport=require(_0xa321('0x8'));var RpcVoiceRecording=require(_0xa321('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xa321('0xa'));var VoiceCallReport=require(_0xa321('0xb'));var VoiceAgentReport=require(_0xa321('0xc'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xa321('0xd'));function Report(_0x1ce736){this[_0xa321('0xe')]=_0x1ce736;this[_0xa321('0xf')]=_0x1ce736[_0xa321('0xf')];this['telephones']=_0x1ce736[_0xa321('0x10')];}Report[_0xa321('0x11')][_0xa321('0x12')]=function(_0x3b79e6){var _0x46dc08=new VoiceQueueReport(this[_0xa321('0xe')]);var _0x43d444=new VoiceAgentReport(this[_0xa321('0xe')]);var _0x5a2fdf=new VoiceDialReport(this[_0xa321('0xe')]);var _0x25899f=new VoiceCallReport(this[_0xa321('0xe')]);var _0x397a73=new UserReport(this[_0xa321('0xe')]);if(config[_0xa321('0x13')]&&config[_0xa321('0x13')][_0xa321('0x14')]){ami['on']('custom:voiceQueueReport',this[_0xa321('0x15')][_0xa321('0x16')](this));ami['on'](_0xa321('0x17'),this[_0xa321('0x18')]['bind'](this));ami['on'](_0xa321('0x19'),this['voiceAgentReport'][_0xa321('0x16')](this));ami['on'](_0xa321('0x1a'),this[_0xa321('0x1b')]['bind'](this));ami['on']('blindtransfer',this[_0xa321('0x1c')]['bind'](this));ami['on'](_0xa321('0x1d'),this[_0xa321('0x1e')][_0xa321('0x16')](this));}};Report[_0xa321('0x11')]['findAgent']=function(_0x597714){var _0x25f192;_0x25f192=_[_0xa321('0x1f')](this[_0xa321('0xf')],function(_0x32dd96){return _0x32dd96[_0xa321('0x20')]==_0x597714||_0x32dd96['name']==_0x597714;});if(_[_0xa321('0x21')](_0x25f192)){var _0x1be8d2=_[_0xa321('0x1f')](this['telephones'],function(_0x4a0330){return _0x4a0330[_0xa321('0x20')]==_0x597714||_0x4a0330[_0xa321('0x22')]==_0x597714;});if(_0x1be8d2){_0x25f192=_[_0xa321('0x1f')](this['agents'],function(_0x2a482f){return _0x2a482f[_0xa321('0x23')]==util[_0xa321('0x24')]('SIP/%s',_0x1be8d2['name']);});}}return _0x25f192;};Report['prototype'][_0xa321('0x15')]=function(_0x434377){for(var _0x412c34=0x0;_0x412c34<_0x434377['length'];_0x412c34+=0x1){var _0x4ccb50=this[_0xa321('0x25')](_0x434377[_0x412c34]['connectedlinenum']);if(_0x4ccb50){_0x434377[_0x412c34][_0xa321('0x20')]=_0x4ccb50['accountcode'];_0x434377[_0x412c34][_0xa321('0x26')]=!![];_0x434377[_0x412c34]['lastAssignedTo']=_0x4ccb50['name'];_0x434377[_0x412c34][_0xa321('0x23')]=_[_0xa321('0x21')](_0x4ccb50['interface'])?util[_0xa321('0x24')](_0xa321('0x27'),_0x4ccb50['name']):_0x4ccb50['interface'];if(_0x434377[_0x412c34]['queuecallercomplete']){_0x434377[_0x412c34]['queuecallercompleteAt']=moment()[_0xa321('0x24')](_0xa321('0x28'));}if(_0x434377[_0x412c34][_0xa321('0x29')]){_0x434377[_0x412c34][_0xa321('0x2a')]=moment()[_0xa321('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x434377[_0x412c34]);}RpcVoiceQueueReport[_0xa321('0x2b')](_0x434377[_0x412c34]);}};function extractCalleridNumber(_0x4c89b9){var _0x18eaaa=_0x4c89b9['match'](/<(.*?)>/);return _0x18eaaa?_0x18eaaa[0x1]:_0x4c89b9;}Report['prototype']['getAgentByInternal']=function(_0x21cd8c){for(var _0x409cf3=0x0;_0x409cf3<Object[_0xa321('0x2c')](this[_0xa321('0xf')])[_0xa321('0x2d')];_0x409cf3++){var _0x1ca844=Object['keys'](this[_0xa321('0xf')])[_0x409cf3];var _0x379be8=this[_0xa321('0xf')][_0x1ca844];if(_0x379be8['accountcode']===Number(_0x21cd8c))return _0x379be8;}return null;};Report[_0xa321('0x11')][_0xa321('0x2e')]=function(_0xc2547b){var _0x55c8d6=_0xc2547b['channel'][_0xa321('0x2f')]('-')[0x0];var _0x58970d=this[_0xa321('0xf')][_0x55c8d6];if(!_0x58970d)_0x58970d=this[_0xa321('0x30')](_0xc2547b[_0xa321('0x31')]);return!_0x58970d?'outbound':_0xa321('0x32');};Report[_0xa321('0x11')][_0xa321('0x18')]=function(_0x4bad7f){_0x4bad7f[_0xa321('0x33')]=_0x4bad7f[_0xa321('0x33')]||_0x4bad7f[_0xa321('0x34')];if(_0x4bad7f['type']==_0xa321('0x35')){_0x4bad7f[_0xa321('0x36')]=_0xa321('0x37');_0x4bad7f[_0xa321('0x38')]=_0x4bad7f[_0xa321('0x37')];if(_0x4bad7f['context']==_0xa321('0x39')){_0x4bad7f[_0xa321('0x20')]='';_0x4bad7f['destination']=extractCalleridNumber(_0x4bad7f[_0xa321('0x3a')]);}else if(_0x4bad7f['context']=='from-sip'){if(_0x4bad7f[_0xa321('0x33')]==_0xa321('0x3b')){_0x4bad7f[_0xa321('0x33')]=extractCalleridNumber(_0x4bad7f[_0xa321('0x3c')]);_0x4bad7f['calleridnum']=_0x4bad7f['originatecalleridnum'];_0x4bad7f[_0xa321('0x3d')]=[_0x4bad7f[_0xa321('0x3e')],_0x4bad7f[_0xa321('0x3e')]=_0x4bad7f[_0xa321('0x3d')]][0x0];_0x4bad7f['callerid']=_0x4bad7f[_0xa321('0x3c')];}else{_0x4bad7f['destination']=_0x4bad7f[_0xa321('0x31')];_0x4bad7f['calleridnum']=_0x4bad7f[_0xa321('0x3f')];if(_0x4bad7f[_0xa321('0x40')]=='ANSWERED'){_0x4bad7f['accountcode']=_0x4bad7f[_0xa321('0x41')];}else{_0x4bad7f['accountcode']='';}}}}else{_0x4bad7f['callerid']=util[_0xa321('0x24')](_0xa321('0x42'),_0x4bad7f[_0xa321('0x43')],_0x4bad7f['calleridnum']);}if(RpcVoiceTransferReport[_0xa321('0x44')][_0x4bad7f[_0xa321('0x45')]]){var _0x3a0fd5=RpcVoiceTransferReport[_0xa321('0x44')][_0x4bad7f[_0xa321('0x45')]];_0x3a0fd5['transfereelinkedid']=_0x4bad7f[_0xa321('0x46')];RpcVoiceTransferReport['blindTransfer'](_0x3a0fd5);delete RpcVoiceTransferReport[_0xa321('0x44')][_0x4bad7f['linkedid']];}if(_[_0xa321('0x21')](_0x4bad7f[_0xa321('0x47')])){_0x4bad7f[_0xa321('0x47')]=this['getCallType'](_0x4bad7f);}if(_[_0xa321('0x21')](_0x4bad7f[_0xa321('0x48')])){var _0x1a01c6=_0x4bad7f[_0xa321('0x3e')][_0xa321('0x2f')]('-')[0x0];var _0x381d74=this['agents'][_0x1a01c6];if(!_0x381d74)_0x381d74=this['getAgentByInternal'](_0x4bad7f[_0xa321('0x20')]);if(_0x381d74){_0x4bad7f[_0xa321('0x48')]=_0x381d74['id'];_0x4bad7f[_0xa321('0x49')]=_0x381d74['name'];}}RpcVoiceCallReport[_0xa321('0x2b')](_0x4bad7f);if(_0x4bad7f[_0xa321('0x4a')]){for(var _0x347005=0x0;_0x347005<_0x4bad7f[_0xa321('0x4b')]['length'];_0x347005+=0x1){_0x4bad7f['monitorFilename']=_0x4bad7f[_0xa321('0x4b')][_0x347005][_0xa321('0x4c')];_0x4bad7f[_0xa321('0x4d')]=_0x4bad7f[_0xa321('0x4b')][_0x347005]['createdAt'];if(_0x4bad7f[_0xa321('0x34')]==_0xa321('0x3b')){_0x4bad7f[_0xa321('0x31')]=_0x4bad7f[_0xa321('0x41')];_0x4bad7f[_0xa321('0x43')]=_0x4bad7f[_0xa321('0x4e')];_0x4bad7f['connectedlinenum']=_0x4bad7f[_0xa321('0x20')];_0x4bad7f[_0xa321('0x4e')]=_0x4bad7f[_0xa321('0x49')];_0x4bad7f['exten']=_0x4bad7f[_0xa321('0x3f')];}else if(_0x4bad7f[_0xa321('0x34')]==_0xa321('0x4f')){_0x4bad7f['calleridnum']=_0x4bad7f[_0xa321('0x33')];_0x4bad7f[_0xa321('0x34')]=_0x4bad7f[_0xa321('0x3f')];}RpcVoiceRecording[_0xa321('0x2b')](_0x4bad7f);}}};Report[_0xa321('0x11')][_0xa321('0x50')]=function(_0x19c28e){if(_['isArray'](_0x19c28e)){_0x19c28e['forEach'](function(_0x4fba52){RpcVoiceAgentReport['create'](_0x4fba52);});}else{RpcVoiceAgentReport['create'](_0x19c28e);}};Report[_0xa321('0x11')][_0xa321('0x1b')]=function(_0x21000e){RpcVoiceDialReport[_0xa321('0x2b')](_0x21000e);var _0x5b0f45;var _0x22b067;var _0x2b03fd=_0x21000e[_0xa321('0x3e')];if(_[_0xa321('0x51')](_0x2b03fd,_0xa321('0x52'))){_0x22b067=_0x2b03fd[_0xa321('0x53')](_0x2b03fd[_0xa321('0x54')]('/')+0x1,_0x2b03fd[_0xa321('0x54')]('@'));_0x5b0f45=_['find'](this[_0xa321('0xf')],function(_0x2f1dcb){return _0x2f1dcb['mobile']==_0x22b067||_0x2f1dcb[_0xa321('0x55')]==_0x22b067||_0x2f1dcb[_0xa321('0x20')]==_0x22b067;});}else{_0x22b067=_0x2b03fd[_0xa321('0x53')](_0x2b03fd[_0xa321('0x54')]('/')+0x1,_0x2b03fd[_0xa321('0x56')]('-'));_0x5b0f45=this[_0xa321('0x25')](_0x22b067);}if(_0x5b0f45){_0x21000e[_0xa321('0x23')]=_[_0xa321('0x21')](_0x5b0f45[_0xa321('0x23')])?util['format'](_0xa321('0x27'),_0x5b0f45[_0xa321('0x22')]):_0x5b0f45[_0xa321('0x23')];_0x21000e[_0xa321('0x49')]=_0x5b0f45[_0xa321('0x22')];_0x21000e[_0xa321('0x20')]=_0x5b0f45['accountcode'];RpcMemberReport[_0xa321('0x1b')](_0x21000e);}};Report[_0xa321('0x11')]['blindTransfer']=function(_0x210066){RpcVoiceTransferReport['transfers'][_0x210066[_0xa321('0x57')]]=_0x210066;};Report[_0xa321('0x11')][_0xa321('0x1e')]=function(_0x3d2b8d){RpcVoiceTransferReport[_0xa321('0x1e')](_0x3d2b8d);};module['exports']=Report;
\ No newline at end of file
index c66cece..060da19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ae1=['defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','actionDeviceStateList','[userReport][devicestatelist]','inspect','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','debug','[userReport][registry]','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','toLowerCase','inuse','state','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','startsWith','Local','substring','indexOf','find','phone','accountcode','local','updateStatusRealtime','isNotNull','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','registered','status','address','telephone:save','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','moment','util','ioredis','bluebird','../../../config/environment','ami','../ami','redis'];(function(_0xaabe65,_0x4af613){var _0x23049e=function(_0x1d7913){while(--_0x1d7913){_0xaabe65['push'](_0xaabe65['shift']());}};_0x23049e(++_0x4af613);}(_0x0ae1,0x134));var _0x10ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ae1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require(_0x10ae('0x0'));var util=require(_0x10ae('0x1'));var Redis=require(_0x10ae('0x2'));var BPromise=require(_0x10ae('0x3'));var config=require(_0x10ae('0x4'));var logger=require('../../../config/logger')(_0x10ae('0x5'));var ami=require(_0x10ae('0x6'));config[_0x10ae('0x7')]=_[_0x10ae('0x8')](config[_0x10ae('0x7')],{'host':_0x10ae('0x9'),'port':0x18eb});var io=require(_0x10ae('0xa'))(new Redis(config[_0x10ae('0x7')]));function UserReport(_0x10329b){this[_0x10ae('0xb')]=_0x10329b['trunks'];this[_0x10ae('0xc')]=_0x10329b[_0x10ae('0xc')];this[_0x10ae('0xd')]=_0x10329b['telephones'];ami['on'](_0x10ae('0xe'),this[_0x10ae('0xf')][_0x10ae('0x10')](this));ami['on'](_0x10ae('0x11'),this[_0x10ae('0xf')][_0x10ae('0x10')](this));ami['on'](_0x10ae('0x12'),this[_0x10ae('0x13')][_0x10ae('0x10')](this));ami['on'](_0x10ae('0x14'),this[_0x10ae('0x15')][_0x10ae('0x10')](this));return this[_0x10ae('0x16')]();}function showSipRegistrations(){Promise[_0x10ae('0x17')]()[_0x10ae('0x18')](ami[_0x10ae('0x19')]())[_0x10ae('0x1a')](function(_0x291e4f){logger[_0x10ae('0x1b')]('[userReport][sipshowregistry]',util['inspect'](_0x291e4f,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x10ae('0x17')]()[_0x10ae('0x18')](ami[_0x10ae('0x1c')]())[_0x10ae('0x1a')](function(_0x506202){logger[_0x10ae('0x1b')](_0x10ae('0x1d'),util[_0x10ae('0x1e')](_0x506202,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x10ae('0x17')]()[_0x10ae('0x18')](ami[_0x10ae('0x1f')]())[_0x10ae('0x1a')](function(_0x7ab242){logger[_0x10ae('0x1b')](_0x10ae('0x20'),util[_0x10ae('0x1e')](_0x7ab242,{'showHidden':![],'depth':null}));});}UserReport[_0x10ae('0x21')][_0x10ae('0x16')]=function(){setInterval(function(){BPromise[_0x10ae('0x17')]()[_0x10ae('0x18')](showSipRegistrations())[_0x10ae('0x18')](listDeviceStates())[_0x10ae('0x18')](showPeersStatus());},0x32c8);};UserReport[_0x10ae('0x21')]['isNotNull']=function(_0xa927c8){return _0xa927c8!==null&&!_[_0x10ae('0x22')](_0xa927c8);};UserReport[_0x10ae('0x21')]['emit']=function(_0x2c2556,_0x1500b6,_0x450983){io['to'](_0x2c2556)[_0x10ae('0x23')](_0x1500b6,_0x450983);};UserReport['prototype'][_0x10ae('0xf')]=function(_0x4f35ae){try{if(this['isNotNull'](_0x4f35ae)){logger[_0x10ae('0x24')](_0x10ae('0x25'),_0x4f35ae[_0x10ae('0x26')],_0x4f35ae['state']);logger[_0x10ae('0x27')](_0x10ae('0x28'),util[_0x10ae('0x1e')](_0x4f35ae,{'showHidden':![],'depth':null}));var _0x34061c=_['find'](this[_0x10ae('0xb')],{'defaultuser':_0x4f35ae['username']});if(_0x34061c){_0x4f35ae['stateRegistry']=_0x4f35ae['state'];_[_0x10ae('0x29')](_0x34061c,_[_0x10ae('0x2a')](_0x4f35ae,[_0x10ae('0x2b'),_0x10ae('0x2c'),'username','state']));logger[_0x10ae('0x27')](_0x10ae('0x2d'),util[_0x10ae('0x1e')](_0x34061c,{'showHidden':![],'depth':null}));this['emit'](util[_0x10ae('0x2e')]('trunk:%s',_0x34061c[_0x10ae('0x2f')]),_0x10ae('0x30'),_0x34061c);}}}catch(_0x4bc489){logger[_0x10ae('0x1b')](_0x10ae('0x28'),util[_0x10ae('0x1e')](_0x4bc489,{'showHidden':![],'depth':null}));}};UserReport[_0x10ae('0x21')][_0x10ae('0x13')]=function(_0x3c910c){try{if(this['isNotNull'](_0x3c910c)){logger['info'](_0x10ae('0x31'),_0x3c910c[_0x10ae('0x32')],_0x3c910c['state']);logger[_0x10ae('0x27')](_0x10ae('0x33'),util[_0x10ae('0x1e')](_0x3c910c,{'showHidden':![],'depth':null}));if(this[_0x10ae('0xc')][_0x3c910c['device']]){if(!this[_0x10ae('0xc')][_0x3c910c[_0x10ae('0x32')]]['local']||_0x3c910c['state'][_0x10ae('0x34')]()==_0x10ae('0x35')){this[_0x10ae('0xc')][_0x3c910c[_0x10ae('0x32')]]['local']=![];if(this[_0x10ae('0xc')][_0x3c910c['device']][_0x10ae('0x36')]!==_0x3c910c['state'][_0x10ae('0x34')]()){this['agents'][_0x3c910c[_0x10ae('0x32')]][_0x10ae('0x37')]=_['toNumber'](moment()[_0x10ae('0x2e')]('x'));}this['agents'][_0x3c910c['device']][_0x10ae('0x36')]=_0x3c910c[_0x10ae('0x36')][_0x10ae('0x34')]();this[_0x10ae('0xc')][_0x3c910c[_0x10ae('0x32')]]['updateStatusRealtime'](_0x3c910c);}}else if(this[_0x10ae('0xd')][_0x3c910c[_0x10ae('0x32')]]){if(this['telephones'][_0x3c910c[_0x10ae('0x32')]][_0x10ae('0x36')]!==_0x3c910c['state'][_0x10ae('0x34')]()){this[_0x10ae('0xd')][_0x3c910c['device']][_0x10ae('0x37')]=_[_0x10ae('0x38')](moment()[_0x10ae('0x2e')]('x'));}this[_0x10ae('0xd')][_0x3c910c[_0x10ae('0x32')]][_0x10ae('0x36')]=_0x3c910c[_0x10ae('0x36')]['toLowerCase']();logger[_0x10ae('0x27')](_0x10ae('0x39'),util[_0x10ae('0x1e')](this[_0x10ae('0xd')][_0x3c910c[_0x10ae('0x32')]],{'showHidden':![],'depth':null}));this[_0x10ae('0x23')](util[_0x10ae('0x2e')](_0x10ae('0x3a'),this[_0x10ae('0xd')][_0x3c910c[_0x10ae('0x32')]][_0x10ae('0x2f')]),'telephone:save',this['telephones'][_0x3c910c[_0x10ae('0x32')]]);}else if(this[_0x10ae('0xb')][_0x3c910c[_0x10ae('0x32')]]){if(this[_0x10ae('0xb')][_0x3c910c[_0x10ae('0x32')]][_0x10ae('0x36')]!==_0x3c910c[_0x10ae('0x36')][_0x10ae('0x34')]()){this['trunks'][_0x3c910c[_0x10ae('0x32')]][_0x10ae('0x37')]=_[_0x10ae('0x38')](moment()['format']('x'));}this[_0x10ae('0xb')][_0x3c910c[_0x10ae('0x32')]][_0x10ae('0x36')]=_0x3c910c[_0x10ae('0x36')]['toLowerCase']();logger[_0x10ae('0x27')](_0x10ae('0x3b'),util['inspect'](this['trunks'][_0x3c910c[_0x10ae('0x32')]],{'showHidden':![],'depth':null}));this[_0x10ae('0x23')](util[_0x10ae('0x2e')](_0x10ae('0x3c'),this[_0x10ae('0xb')][_0x3c910c['device']][_0x10ae('0x2f')]),_0x10ae('0x30'),this[_0x10ae('0xb')][_0x3c910c[_0x10ae('0x32')]]);}else if(_[_0x10ae('0x3d')](_0x3c910c[_0x10ae('0x32')],_0x10ae('0x3e'))){var _0x4e64b4=_0x3c910c['device'];var _0x5ba9eb=_0x4e64b4[_0x10ae('0x3f')](_0x4e64b4[_0x10ae('0x40')]('/')+0x1,_0x4e64b4[_0x10ae('0x40')]('@'));var _0x5aa850=_[_0x10ae('0x41')](this[_0x10ae('0xc')],function(_0x2b6644){return _0x2b6644['mobile']==_0x5ba9eb||_0x2b6644[_0x10ae('0x42')]==_0x5ba9eb||_0x2b6644[_0x10ae('0x43')]==_0x5ba9eb;});if(_0x5aa850){if(_0x5aa850[_0x10ae('0x36')]!==_0x3c910c['state']['toLowerCase']()){_0x5aa850[_0x10ae('0x37')]=_[_0x10ae('0x38')](moment()[_0x10ae('0x2e')]('x'));}_0x5aa850[_0x10ae('0x36')]=_0x3c910c[_0x10ae('0x36')][_0x10ae('0x34')]();_0x5aa850[_0x10ae('0x44')]=!![];_0x5aa850[_0x10ae('0x45')](_0x3c910c);}}}}catch(_0x13f0e8){logger[_0x10ae('0x1b')]('[userReport][devicestatechange]',util[_0x10ae('0x1e')](_0x13f0e8,{'showHidden':![],'depth':null}));}};UserReport[_0x10ae('0x21')]['syncPeerStatus']=function(_0xdbe1a3){try{if(this[_0x10ae('0x46')](_0xdbe1a3)&&this[_0x10ae('0x46')](_0xdbe1a3['peerstatus'])){logger[_0x10ae('0x24')](_0x10ae('0x47'),_0xdbe1a3[_0x10ae('0x48')],_0xdbe1a3['address'],_0xdbe1a3['peerstatus']);logger['debug']('[userReport][peerstatus]',util[_0x10ae('0x1e')](_0xdbe1a3,{'showHidden':![],'depth':null}));if(this[_0x10ae('0xc')][_0xdbe1a3[_0x10ae('0x48')]]){if(!this['agents'][_0xdbe1a3[_0x10ae('0x48')]][_0x10ae('0x44')]||_0xdbe1a3[_0x10ae('0x14')][_0x10ae('0x34')]()==_0x10ae('0x49')){this['agents'][_0xdbe1a3[_0x10ae('0x48')]][_0x10ae('0x44')]=![];this[_0x10ae('0xc')][_0xdbe1a3[_0x10ae('0x48')]][_0x10ae('0x4a')]=_0xdbe1a3[_0x10ae('0x14')][_0x10ae('0x34')]();this[_0x10ae('0xc')][_0xdbe1a3[_0x10ae('0x48')]]['address']=_0xdbe1a3[_0x10ae('0x4b')];this[_0x10ae('0xc')][_0xdbe1a3[_0x10ae('0x48')]][_0x10ae('0x45')](_0xdbe1a3);}}else if(this[_0x10ae('0xd')][_0xdbe1a3[_0x10ae('0x48')]]){this[_0x10ae('0xd')][_0xdbe1a3['peer']]['status']=_0xdbe1a3[_0x10ae('0x14')][_0x10ae('0x34')]();this[_0x10ae('0xd')][_0xdbe1a3['peer']][_0x10ae('0x4b')]=_0xdbe1a3[_0x10ae('0x4b')];logger[_0x10ae('0x27')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x10ae('0x1e')](this['telephones'][_0xdbe1a3['peer']],{'showHidden':![],'depth':null}));this[_0x10ae('0x23')](util[_0x10ae('0x2e')](_0x10ae('0x3a'),this[_0x10ae('0xd')][_0xdbe1a3[_0x10ae('0x48')]][_0x10ae('0x2f')]),_0x10ae('0x4c'),this[_0x10ae('0xd')][_0xdbe1a3['peer']]);}else if(this[_0x10ae('0xb')][_0xdbe1a3[_0x10ae('0x48')]]){this[_0x10ae('0xb')][_0xdbe1a3[_0x10ae('0x48')]][_0x10ae('0x4a')]=_0xdbe1a3[_0x10ae('0x14')]['toLowerCase']();this[_0x10ae('0xb')][_0xdbe1a3['peer']]['address']=_0xdbe1a3[_0x10ae('0x4b')];logger[_0x10ae('0x27')](_0x10ae('0x4d'),util['inspect'](this['trunks'][_0xdbe1a3['peer']],{'showHidden':![],'depth':null}));this[_0x10ae('0x23')](util[_0x10ae('0x2e')](_0x10ae('0x3c'),this[_0x10ae('0xb')][_0xdbe1a3[_0x10ae('0x48')]][_0x10ae('0x2f')]),'trunk:save',this['trunks'][_0xdbe1a3[_0x10ae('0x48')]]);}}}catch(_0x460fa4){logger['error'](_0x10ae('0x4e'),util[_0x10ae('0x1e')](_0x460fa4,{'showHidden':![],'depth':null}));}};module['exports']=UserReport;
\ No newline at end of file
+var _0xab8e=['actionDeviceStateList','error','[userReport][devicestatelist]','resolve','actionSipPeerStatus','syncRealtimeShow','prototype','isNotNull','isUndefined','emit','username','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','state','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','syncDeviceState','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','debug','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','indexOf','mobile','phone','accountcode','peerstatus','peer','[userReport][peerstatus]','registered','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','status','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','ioredis','bluebird','../../../config/environment','ami','../ami','localhost','socket.io-emitter','redis','trunks','agents','telephones','syncRegistry','registry','bind','devicestatechange','syncPeerStatus','then','actionSipShowRegistry','catch','[userReport][sipshowregistry]','inspect'];(function(_0x4d109a,_0x3ccc53){var _0x556282=function(_0x553ad){while(--_0x553ad){_0x4d109a['push'](_0x4d109a['shift']());}};_0x556282(++_0x3ccc53);}(_0xab8e,0xc9));var _0xeab8=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xab8e[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require('lodash');var moment=require('moment');var util=require('util');var Redis=require(_0xeab8('0x0'));var BPromise=require(_0xeab8('0x1'));var config=require(_0xeab8('0x2'));var logger=require('../../../config/logger')(_0xeab8('0x3'));var ami=require(_0xeab8('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0xeab8('0x5'),'port':0x18eb});var io=require(_0xeab8('0x6'))(new Redis(config[_0xeab8('0x7')]));function UserReport(_0x4443a6){this['trunks']=_0x4443a6[_0xeab8('0x8')];this[_0xeab8('0x9')]=_0x4443a6[_0xeab8('0x9')];this[_0xeab8('0xa')]=_0x4443a6[_0xeab8('0xa')];ami['on']('registryentry',this[_0xeab8('0xb')]['bind'](this));ami['on'](_0xeab8('0xc'),this[_0xeab8('0xb')][_0xeab8('0xd')](this));ami['on'](_0xeab8('0xe'),this['syncDeviceState'][_0xeab8('0xd')](this));ami['on']('peerstatus',this[_0xeab8('0xf')][_0xeab8('0xd')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise['resolve']()[_0xeab8('0x10')](ami[_0xeab8('0x11')]())[_0xeab8('0x12')](function(_0x15e883){logger['error'](_0xeab8('0x13'),util[_0xeab8('0x14')](_0x15e883,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0xeab8('0x10')](ami[_0xeab8('0x15')]())[_0xeab8('0x12')](function(_0x529e38){logger[_0xeab8('0x16')](_0xeab8('0x17'),util['inspect'](_0x529e38,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xeab8('0x18')]()['then'](ami[_0xeab8('0x19')]())[_0xeab8('0x12')](function(_0x1aefed){logger[_0xeab8('0x16')]('[userReport][sippeerstatus]',util[_0xeab8('0x14')](_0x1aefed,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0xeab8('0x1a')]=function(){setInterval(function(){BPromise[_0xeab8('0x18')]()[_0xeab8('0x10')](showSipRegistrations())['then'](listDeviceStates())[_0xeab8('0x10')](showPeersStatus());},0x32c8);};UserReport[_0xeab8('0x1b')][_0xeab8('0x1c')]=function(_0xe604e8){return _0xe604e8!==null&&!_[_0xeab8('0x1d')](_0xe604e8);};UserReport[_0xeab8('0x1b')][_0xeab8('0x1e')]=function(_0x2df80b,_0x2bb46a,_0x47f290){io['to'](_0x2df80b)[_0xeab8('0x1e')](_0x2bb46a,_0x47f290);};UserReport[_0xeab8('0x1b')][_0xeab8('0xb')]=function(_0x5f11e3){try{if(this[_0xeab8('0x1c')](_0x5f11e3)){logger['info']('[userReport][registry]\x20registry:%s\x20state:%s',_0x5f11e3[_0xeab8('0x1f')],_0x5f11e3['state']);logger['debug'](_0xeab8('0x20'),util[_0xeab8('0x14')](_0x5f11e3,{'showHidden':![],'depth':null}));var _0x291fc3=_[_0xeab8('0x21')](this[_0xeab8('0x8')],{'defaultuser':_0x5f11e3[_0xeab8('0x1f')]});if(_0x291fc3){_0x5f11e3[_0xeab8('0x22')]=_0x5f11e3['state'];_[_0xeab8('0x23')](_0x291fc3,_[_0xeab8('0x24')](_0x5f11e3,[_0xeab8('0x25'),_0xeab8('0x26'),'username',_0xeab8('0x27')]));logger['debug'](_0xeab8('0x28'),util[_0xeab8('0x14')](_0x291fc3,{'showHidden':![],'depth':null}));this[_0xeab8('0x1e')](util[_0xeab8('0x29')](_0xeab8('0x2a'),_0x291fc3[_0xeab8('0x2b')]),_0xeab8('0x2c'),_0x291fc3);}}}catch(_0xbef78b){logger['error'](_0xeab8('0x20'),util['inspect'](_0xbef78b,{'showHidden':![],'depth':null}));}};UserReport[_0xeab8('0x1b')][_0xeab8('0x2d')]=function(_0x1f0342){try{if(this['isNotNull'](_0x1f0342)){logger[_0xeab8('0x2e')](_0xeab8('0x2f'),_0x1f0342[_0xeab8('0x30')],_0x1f0342[_0xeab8('0x27')]);logger[_0xeab8('0x31')](_0xeab8('0x32'),util['inspect'](_0x1f0342,{'showHidden':![],'depth':null}));if(this['agents'][_0x1f0342[_0xeab8('0x30')]]){if(!this[_0xeab8('0x9')][_0x1f0342['device']][_0xeab8('0x33')]||_0x1f0342['state'][_0xeab8('0x34')]()==_0xeab8('0x35')){this[_0xeab8('0x9')][_0x1f0342[_0xeab8('0x30')]][_0xeab8('0x33')]=![];if(this[_0xeab8('0x9')][_0x1f0342['device']][_0xeab8('0x27')]!==_0x1f0342[_0xeab8('0x27')][_0xeab8('0x34')]()){this[_0xeab8('0x9')][_0x1f0342[_0xeab8('0x30')]][_0xeab8('0x36')]=_[_0xeab8('0x37')](moment()[_0xeab8('0x29')]('x'));}this[_0xeab8('0x9')][_0x1f0342[_0xeab8('0x30')]][_0xeab8('0x27')]=_0x1f0342['state'][_0xeab8('0x34')]();this[_0xeab8('0x9')][_0x1f0342[_0xeab8('0x30')]][_0xeab8('0x38')](_0x1f0342);}}else if(this[_0xeab8('0xa')][_0x1f0342[_0xeab8('0x30')]]){if(this[_0xeab8('0xa')][_0x1f0342[_0xeab8('0x30')]]['state']!==_0x1f0342[_0xeab8('0x27')][_0xeab8('0x34')]()){this[_0xeab8('0xa')][_0x1f0342[_0xeab8('0x30')]][_0xeab8('0x36')]=_['toNumber'](moment()[_0xeab8('0x29')]('x'));}this[_0xeab8('0xa')][_0x1f0342[_0xeab8('0x30')]][_0xeab8('0x27')]=_0x1f0342[_0xeab8('0x27')][_0xeab8('0x34')]();logger[_0xeab8('0x31')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0xeab8('0x14')](this[_0xeab8('0xa')][_0x1f0342[_0xeab8('0x30')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xeab8('0x29')]('telephone:%s',this[_0xeab8('0xa')][_0x1f0342['device']]['name']),_0xeab8('0x39'),this['telephones'][_0x1f0342['device']]);}else if(this[_0xeab8('0x8')][_0x1f0342['device']]){if(this[_0xeab8('0x8')][_0x1f0342[_0xeab8('0x30')]]['state']!==_0x1f0342[_0xeab8('0x27')]['toLowerCase']()){this[_0xeab8('0x8')][_0x1f0342[_0xeab8('0x30')]][_0xeab8('0x36')]=_['toNumber'](moment()['format']('x'));}this['trunks'][_0x1f0342['device']][_0xeab8('0x27')]=_0x1f0342[_0xeab8('0x27')][_0xeab8('0x34')]();logger[_0xeab8('0x31')](_0xeab8('0x3a'),util['inspect'](this[_0xeab8('0x8')][_0x1f0342[_0xeab8('0x30')]],{'showHidden':![],'depth':null}));this[_0xeab8('0x1e')](util[_0xeab8('0x29')](_0xeab8('0x2a'),this[_0xeab8('0x8')][_0x1f0342[_0xeab8('0x30')]][_0xeab8('0x2b')]),'trunk:save',this[_0xeab8('0x8')][_0x1f0342['device']]);}else if(_[_0xeab8('0x3b')](_0x1f0342[_0xeab8('0x30')],_0xeab8('0x3c'))){var _0x52bc28=_0x1f0342['device'];var _0xaae092=_0x52bc28['substring'](_0x52bc28[_0xeab8('0x3d')]('/')+0x1,_0x52bc28[_0xeab8('0x3d')]('@'));var _0x16e8db=_[_0xeab8('0x21')](this[_0xeab8('0x9')],function(_0x31d1f9){return _0x31d1f9[_0xeab8('0x3e')]==_0xaae092||_0x31d1f9[_0xeab8('0x3f')]==_0xaae092||_0x31d1f9[_0xeab8('0x40')]==_0xaae092;});if(_0x16e8db){if(_0x16e8db[_0xeab8('0x27')]!==_0x1f0342[_0xeab8('0x27')]['toLowerCase']()){_0x16e8db['stateTime']=_['toNumber'](moment()[_0xeab8('0x29')]('x'));}_0x16e8db['state']=_0x1f0342[_0xeab8('0x27')][_0xeab8('0x34')]();_0x16e8db['local']=!![];_0x16e8db['updateStatusRealtime'](_0x1f0342);}}}}catch(_0x279e77){logger[_0xeab8('0x16')](_0xeab8('0x32'),util[_0xeab8('0x14')](_0x279e77,{'showHidden':![],'depth':null}));}};UserReport[_0xeab8('0x1b')][_0xeab8('0xf')]=function(_0x1d8b52){try{if(this[_0xeab8('0x1c')](_0x1d8b52)&&this[_0xeab8('0x1c')](_0x1d8b52[_0xeab8('0x41')])){logger[_0xeab8('0x2e')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x1d8b52[_0xeab8('0x42')],_0x1d8b52['address'],_0x1d8b52[_0xeab8('0x41')]);logger[_0xeab8('0x31')](_0xeab8('0x43'),util['inspect'](_0x1d8b52,{'showHidden':![],'depth':null}));if(this[_0xeab8('0x9')][_0x1d8b52[_0xeab8('0x42')]]){if(!this[_0xeab8('0x9')][_0x1d8b52[_0xeab8('0x42')]][_0xeab8('0x33')]||_0x1d8b52['peerstatus'][_0xeab8('0x34')]()==_0xeab8('0x44')){this['agents'][_0x1d8b52[_0xeab8('0x42')]][_0xeab8('0x33')]=![];this['agents'][_0x1d8b52[_0xeab8('0x42')]]['status']=_0x1d8b52[_0xeab8('0x41')]['toLowerCase']();this['agents'][_0x1d8b52[_0xeab8('0x42')]][_0xeab8('0x45')]=_0x1d8b52[_0xeab8('0x45')];this[_0xeab8('0x9')][_0x1d8b52['peer']][_0xeab8('0x38')](_0x1d8b52);}}else if(this['telephones'][_0x1d8b52['peer']]){this[_0xeab8('0xa')][_0x1d8b52[_0xeab8('0x42')]]['status']=_0x1d8b52[_0xeab8('0x41')][_0xeab8('0x34')]();this[_0xeab8('0xa')][_0x1d8b52[_0xeab8('0x42')]][_0xeab8('0x45')]=_0x1d8b52[_0xeab8('0x45')];logger[_0xeab8('0x31')](_0xeab8('0x46'),util[_0xeab8('0x14')](this[_0xeab8('0xa')][_0x1d8b52['peer']],{'showHidden':![],'depth':null}));this[_0xeab8('0x1e')](util[_0xeab8('0x29')](_0xeab8('0x47'),this['telephones'][_0x1d8b52[_0xeab8('0x42')]]['name']),_0xeab8('0x39'),this[_0xeab8('0xa')][_0x1d8b52[_0xeab8('0x42')]]);}else if(this[_0xeab8('0x8')][_0x1d8b52[_0xeab8('0x42')]]){this[_0xeab8('0x8')][_0x1d8b52[_0xeab8('0x42')]][_0xeab8('0x48')]=_0x1d8b52[_0xeab8('0x41')][_0xeab8('0x34')]();this[_0xeab8('0x8')][_0x1d8b52['peer']][_0xeab8('0x45')]=_0x1d8b52['address'];logger[_0xeab8('0x31')](_0xeab8('0x49'),util['inspect'](this[_0xeab8('0x8')][_0x1d8b52[_0xeab8('0x42')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xeab8('0x29')]('trunk:%s',this[_0xeab8('0x8')][_0x1d8b52[_0xeab8('0x42')]][_0xeab8('0x2b')]),_0xeab8('0x2c'),this[_0xeab8('0x8')][_0x1d8b52['peer']]);}}}catch(_0x3eb203){logger[_0xeab8('0x16')](_0xeab8('0x43'),util[_0xeab8('0x14')](_0x3eb203,{'showHidden':![],'depth':null}));}};module['exports']=UserReport;
\ No newline at end of file
index fceda97..6d71c44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fd3=['socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','bind','agentconnect','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','syncAgentCalled','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','inspect','isUndefined','destuniqueid','format','called','queue','mandatoryDisposition','type','inbound','voice','event','privilege','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','YYYY-MM-DD\x20HH:mm:ss','connectedlinename','connectedlinenum','destchannelstatedesc','holdtime','lastevent','connect','routealias','merge','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentringnoanswer','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','error','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','agentconnectAt','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acwtime','omit','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost'];(function(_0x140698,_0x34192b){var _0x8e8f9f=function(_0x1bacae){while(--_0x1bacae){_0x140698['push'](_0x140698['shift']());}};_0x8e8f9f(++_0x34192b);}(_0x1fd3,0x93));var _0x31fd=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x1fd3[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0x31fd('0x0'));var moment=require(_0x31fd('0x1'));var util=require('util');var Redis=require(_0x31fd('0x2'));var config=require(_0x31fd('0x3'));var logger=require(_0x31fd('0x4'))('ami');var ami=require(_0x31fd('0x5'));config[_0x31fd('0x6')]=_[_0x31fd('0x7')](config[_0x31fd('0x6')],{'host':_0x31fd('0x8'),'port':0x18eb});var io=require(_0x31fd('0x9'))(new Redis(config['redis']));function VoiceAgentReport(_0x2a3e8f){this[_0x31fd('0xa')]={};this[_0x31fd('0xb')]=_0x2a3e8f['channels'];this['voiceQueues']=_0x2a3e8f[_0x31fd('0xc')];this[_0x31fd('0xd')]=_0x2a3e8f[_0x31fd('0xd')];this[_0x31fd('0xe')]={};ami['on'](_0x31fd('0xf'),this['syncAgentCalled'][_0x31fd('0x10')](this));ami['on'](_0x31fd('0x11'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this[_0x31fd('0x12')][_0x31fd('0x10')](this));ami['on'](_0x31fd('0x13'),this[_0x31fd('0x14')][_0x31fd('0x10')](this));ami['on'](_0x31fd('0x15'),this[_0x31fd('0x16')][_0x31fd('0x10')](this));ami['on'](_0x31fd('0x17'),this[_0x31fd('0x18')]['bind'](this));ami['on'](_0x31fd('0x19'),this[_0x31fd('0x1a')]['bind'](this));ami['on'](_0x31fd('0x1b'),this[_0x31fd('0x1c')][_0x31fd('0x10')](this));ami['on'](_0x31fd('0x1d'),this[_0x31fd('0x1e')]['bind'](this));ami['on'](_0x31fd('0x1f'),this[_0x31fd('0x20')]['bind'](this));ami['on'](_0x31fd('0x21'),this[_0x31fd('0x22')][_0x31fd('0x10')](this));}VoiceAgentReport[_0x31fd('0x23')][_0x31fd('0x24')]=function(_0x3a1fc1,_0x523128,_0x3fe201){io['to'](_0x3a1fc1)[_0x31fd('0x24')](_0x523128,_0x3fe201);};VoiceAgentReport['prototype'][_0x31fd('0x25')]=function(_0x5db819){return _0x5db819!==null&&!_['isUndefined'](_0x5db819);};VoiceAgentReport['prototype'][_0x31fd('0x26')]=function(_0x4f9f02){try{if(this[_0x31fd('0x25')](_0x4f9f02)){logger[_0x31fd('0x27')](_0x31fd('0x28'),_0x4f9f02['uniqueid'],_0x4f9f02[_0x31fd('0x29')],_0x4f9f02['destuniqueid']);logger['debug'](_0x31fd('0x2a'),_0x4f9f02[_0x31fd('0x2b')],util[_0x31fd('0x2c')](_0x4f9f02,{'showHidden':![],'depth':null}));if(_[_0x31fd('0x2d')](this[_0x31fd('0xa')][_0x4f9f02[_0x31fd('0x2b')]])){this[_0x31fd('0xa')][_0x4f9f02['uniqueid']]={};}if(_[_0x31fd('0x2d')](this['channels'][_0x4f9f02[_0x31fd('0x2b')]][_0x4f9f02[_0x31fd('0x2e')]])){this[_0x31fd('0xa')][_0x4f9f02[_0x31fd('0x2b')]][_0x4f9f02[_0x31fd('0x2e')]]={'agentcalledAt':moment()[_0x31fd('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x31fd('0x30'),'mandatoryDisposition':this['voiceQueues'][_0x4f9f02[_0x31fd('0x31')]]?this['voiceQueues'][_0x4f9f02[_0x31fd('0x31')]][_0x31fd('0x32')]||![]:![],'type':this[_0x31fd('0xc')][_0x4f9f02[_0x31fd('0x31')]]?this[_0x31fd('0xc')][_0x4f9f02[_0x31fd('0x31')]][_0x31fd('0x33')]||_0x31fd('0x34'):'inbound','variables':this[_0x31fd('0xe')][_0x4f9f02[_0x31fd('0x2b')]],'motionChannel':_0x31fd('0x35')};}_['merge'](this['channels'][_0x4f9f02[_0x31fd('0x2b')]][_0x4f9f02[_0x31fd('0x2e')]],_['omit'](_0x4f9f02,[_0x31fd('0x36'),_0x31fd('0x37')]));logger[_0x31fd('0x38')](_0x31fd('0x39'),_0x4f9f02[_0x31fd('0x2b')],util['inspect'](this[_0x31fd('0xa')][_0x4f9f02[_0x31fd('0x2b')]][_0x4f9f02['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x31fd('0x24')](_0x31fd('0x3a'),this[_0x31fd('0xa')][_0x4f9f02[_0x31fd('0x2b')]][_0x4f9f02[_0x31fd('0x2e')]]);var _0x5604fe={'id':this['agents'][_0x4f9f02['interface']]['id'],'calleridnum':this[_0x31fd('0xa')][_0x4f9f02[_0x31fd('0x2b')]][_0x4f9f02[_0x31fd('0x2e')]][_0x31fd('0x3b')],'queue':this['channels'][_0x4f9f02[_0x31fd('0x2b')]][_0x4f9f02[_0x31fd('0x2e')]][_0x31fd('0x31')],'variables':this['channels'][_0x4f9f02[_0x31fd('0x2b')]][_0x4f9f02[_0x31fd('0x2e')]]['variables']};logger[_0x31fd('0x38')](_0x31fd('0x3c'),_0x4f9f02[_0x31fd('0x2b')],util[_0x31fd('0x2c')](_0x5604fe,{'showHidden':![],'depth':null}));this[_0x31fd('0x24')](util[_0x31fd('0x2f')](_0x31fd('0x3d'),_0x4f9f02[_0x31fd('0x29')]),_0x31fd('0x3e'),_0x5604fe);}}catch(_0x373162){logger['error'](_0x31fd('0x3f'),_0x4f9f02[_0x31fd('0x2b')],util[_0x31fd('0x2c')](_0x373162,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentConnect']=function(_0x18069d){try{if(this[_0x31fd('0x25')](_0x18069d)){if(this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]]){logger['debug']('[%s][voiceAgentReport][agentconnect]\x20event:',_0x18069d[_0x31fd('0x2b')],util[_0x31fd('0x2c')](_0x18069d,{'showHidden':![],'depth':null}));for(var _0x37241f in this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]]){if(this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]]['hasOwnProperty'](_0x37241f)){if(_0x18069d[_0x31fd('0x2e')]===_0x37241f){logger['info'](_0x31fd('0x40'),_0x18069d['uniqueid'],_0x18069d[_0x31fd('0x29')],_0x18069d[_0x31fd('0x2e')]);this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x37241f]['agentconnectAt']=moment()[_0x31fd('0x2f')](_0x31fd('0x41'));this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x37241f][_0x31fd('0x42')]=_0x18069d['connectedlinename'];this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x37241f][_0x31fd('0x43')]=_0x18069d[_0x31fd('0x43')];this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x37241f]['destchannelstate']=_0x18069d['destchannelstate'];this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x37241f][_0x31fd('0x44')]=_0x18069d[_0x31fd('0x44')];this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x37241f][_0x31fd('0x45')]=_0x18069d['holdtime'];this['channels'][_0x18069d['uniqueid']][_0x37241f][_0x31fd('0x46')]=_0x31fd('0x47');if(this[_0x31fd('0xb')][this['channels'][_0x18069d[_0x31fd('0x2b')]][_0x37241f][_0x31fd('0x2b')]]){var _0x484017=this['voiceChannels'][this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x37241f][_0x31fd('0x2b')]][_0x31fd('0x48')];this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x37241f][_0x31fd('0x48')]=_0x484017;_0x18069d[_0x31fd('0x48')]=_0x484017;}_[_0x31fd('0x49')](this[_0x31fd('0xd')][_0x18069d[_0x31fd('0x4a')]],_[_0x31fd('0x4b')](_0x18069d,[_0x31fd('0x31'),_0x31fd('0x4c'),_0x31fd('0x48')]));logger[_0x31fd('0x38')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x18069d[_0x31fd('0x2b')],util['inspect'](this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x18069d[_0x31fd('0x2e')]],{'showHidden':![],'depth':null}));ami['emit'](_0x31fd('0x4d'),this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x18069d['destuniqueid']]);logger[_0x31fd('0x38')](_0x31fd('0x4e'),_0x18069d[_0x31fd('0x2b')],util[_0x31fd('0x2c')](this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x18069d[_0x31fd('0x2e')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x31fd('0x2f')]('user:%s',_0x18069d[_0x31fd('0x29')]),_0x31fd('0x4f'),this['channels'][_0x18069d[_0x31fd('0x2b')]][_0x18069d[_0x31fd('0x2e')]]);}else if(!this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x37241f][_0x31fd('0x50')]&&!this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x37241f][_0x31fd('0x15')]){logger[_0x31fd('0x27')](_0x31fd('0x51'),_0x18069d[_0x31fd('0x2b')],this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x37241f][_0x31fd('0x29')],_0x37241f);this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x37241f]['agentringnoanswer']=!![];this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x37241f][_0x31fd('0x52')]=moment()['format'](_0x31fd('0x41'));this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x37241f]['answeredelsewheredestinationuniqueid']=_0x18069d['destuniqueid'];this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x37241f]['answeredelsewheremembername']=_0x18069d[_0x31fd('0x29')];this[_0x31fd('0xa')][_0x18069d['uniqueid']][_0x37241f][_0x31fd('0x46')]=_0x31fd('0x53');this['channels'][_0x18069d[_0x31fd('0x2b')]][_0x37241f][_0x31fd('0x54')]=_0x31fd('0x53');logger[_0x31fd('0x38')](_0x31fd('0x55'),_0x18069d[_0x31fd('0x2b')],util['inspect'](this[_0x31fd('0xa')][_0x18069d[_0x31fd('0x2b')]][_0x37241f],{'showHidden':![],'depth':null}));ami[_0x31fd('0x24')](_0x31fd('0x56'),this['channels'][_0x18069d[_0x31fd('0x2b')]][_0x37241f]);}}}}}}catch(_0x4d045f){logger[_0x31fd('0x57')](_0x31fd('0x58'),_0x18069d['uniqueid'],util[_0x31fd('0x2c')](_0x4d045f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x31fd('0x23')][_0x31fd('0x12')]=function(_0x5ebe75){try{if(this[_0x31fd('0x25')](_0x5ebe75)){logger[_0x31fd('0x38')](_0x31fd('0x59'),_0x5ebe75['uniqueid'],util['inspect'](_0x5ebe75,{'showHidden':![],'depth':null}));if(this[_0x31fd('0xa')][_0x5ebe75[_0x31fd('0x2b')]]&&this['channels'][_0x5ebe75['uniqueid']][_0x5ebe75[_0x31fd('0x2e')]]){logger[_0x31fd('0x27')](_0x31fd('0x5a'),_0x5ebe75[_0x31fd('0x2b')],_0x5ebe75[_0x31fd('0x29')],_0x5ebe75[_0x31fd('0x2e')]);this['channels'][_0x5ebe75['uniqueid']][_0x5ebe75[_0x31fd('0x2e')]][_0x31fd('0x50')]=!![];this['channels'][_0x5ebe75['uniqueid']][_0x5ebe75[_0x31fd('0x2e')]][_0x31fd('0x52')]=moment()[_0x31fd('0x2f')](_0x31fd('0x41'));this[_0x31fd('0xa')][_0x5ebe75[_0x31fd('0x2b')]][_0x5ebe75[_0x31fd('0x2e')]][_0x31fd('0x46')]=_0x31fd('0x5b');this[_0x31fd('0xa')][_0x5ebe75['uniqueid']][_0x5ebe75[_0x31fd('0x2e')]][_0x31fd('0x54')]=_0x31fd('0x5b');logger[_0x31fd('0x38')](_0x31fd('0x5c'),_0x5ebe75[_0x31fd('0x2b')],util[_0x31fd('0x2c')](this['channels'][_0x5ebe75[_0x31fd('0x2b')]][_0x5ebe75[_0x31fd('0x2e')]],{'showHidden':![],'depth':null}));ami[_0x31fd('0x24')](_0x31fd('0x5d'),this[_0x31fd('0xa')][_0x5ebe75[_0x31fd('0x2b')]][_0x5ebe75[_0x31fd('0x2e')]]);}}}catch(_0x926de){logger['error']('[%s][voiceAgentReport][agentringnoanswer]',_0x5ebe75[_0x31fd('0x2b')],util[_0x31fd('0x2c')](_0x926de,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x31fd('0x23')][_0x31fd('0x14')]=function(_0x47e864){try{if(this[_0x31fd('0x25')](_0x47e864)){logger[_0x31fd('0x38')](_0x31fd('0x5e'),_0x47e864['uniqueid'],util['inspect'](_0x47e864,{'showHidden':![],'depth':null}));if(this[_0x31fd('0xa')][_0x47e864[_0x31fd('0x2b')]]){for(var _0x3753df in this[_0x31fd('0xa')][_0x47e864[_0x31fd('0x2b')]]){if(this[_0x31fd('0xa')][_0x47e864[_0x31fd('0x2b')]][_0x31fd('0x5f')](_0x3753df)&&!this[_0x31fd('0xa')][_0x47e864['uniqueid']][_0x3753df]['agentringnoanswer']&&!this[_0x31fd('0xa')][_0x47e864[_0x31fd('0x2b')]][_0x3753df][_0x31fd('0x15')]){logger[_0x31fd('0x27')](_0x31fd('0x60'),_0x47e864[_0x31fd('0x2b')],this['channels'][_0x47e864[_0x31fd('0x2b')]][_0x3753df]['membername'],_0x3753df);this[_0x31fd('0xa')][_0x47e864[_0x31fd('0x2b')]][_0x3753df]['agentringnoanswer']=!![];this[_0x31fd('0xa')][_0x47e864[_0x31fd('0x2b')]][_0x3753df][_0x31fd('0x52')]=moment()[_0x31fd('0x2f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x31fd('0xa')][_0x47e864[_0x31fd('0x2b')]][_0x3753df]['lastevent']='abandoned';this['channels'][_0x47e864[_0x31fd('0x2b')]][_0x3753df][_0x31fd('0x54')]='abandoned';logger[_0x31fd('0x38')](_0x31fd('0x61'),_0x47e864[_0x31fd('0x2b')],util[_0x31fd('0x2c')](this[_0x31fd('0xa')][_0x47e864['uniqueid']][_0x3753df],{'showHidden':![],'depth':null}));ami[_0x31fd('0x24')](_0x31fd('0x62'),this[_0x31fd('0xa')][_0x47e864[_0x31fd('0x2b')]][_0x3753df]);}}}}}catch(_0x436186){logger[_0x31fd('0x57')](_0x31fd('0x63'),_0x47e864[_0x31fd('0x2b')],util[_0x31fd('0x2c')](_0x436186,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x31fd('0x23')][_0x31fd('0x16')]=function(_0x5c1b6f){try{if(this[_0x31fd('0x25')](_0x5c1b6f)){logger[_0x31fd('0x38')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x5c1b6f['uniqueid'],util['inspect'](_0x5c1b6f,{'showHidden':![],'depth':null}));if(this['channels'][_0x5c1b6f[_0x31fd('0x2b')]]){for(var _0x375d33 in this[_0x31fd('0xa')][_0x5c1b6f['uniqueid']]){if(this['channels'][_0x5c1b6f[_0x31fd('0x2b')]]['hasOwnProperty'](_0x375d33)){if(this[_0x31fd('0xa')][_0x5c1b6f['uniqueid']][_0x375d33][_0x31fd('0x64')]&&!this['channels'][_0x5c1b6f[_0x31fd('0x2b')]][_0x375d33][_0x31fd('0x15')]){logger[_0x31fd('0x27')](_0x31fd('0x65'),_0x5c1b6f[_0x31fd('0x2b')],this[_0x31fd('0xa')][_0x5c1b6f['uniqueid']][_0x375d33]['membername'],_0x375d33);this['channels'][_0x5c1b6f['uniqueid']][_0x375d33][_0x31fd('0x15')]=!![];this[_0x31fd('0xa')][_0x5c1b6f[_0x31fd('0x2b')]][_0x375d33][_0x31fd('0x66')]=moment()[_0x31fd('0x2f')](_0x31fd('0x41'));this[_0x31fd('0xa')][_0x5c1b6f[_0x31fd('0x2b')]][_0x375d33][_0x31fd('0x46')]=_0x31fd('0x67');this['channels'][_0x5c1b6f['uniqueid']][_0x375d33][_0x31fd('0x54')]=_0x5c1b6f[_0x31fd('0x54')]==_0x31fd('0x68')?_0x31fd('0x69'):_0x5c1b6f[_0x31fd('0x54')];this[_0x31fd('0xa')][_0x5c1b6f[_0x31fd('0x2b')]][_0x375d33][_0x31fd('0x6a')]=_0x5c1b6f[_0x31fd('0x6a')];if(this[_0x31fd('0xc')][_0x5c1b6f['queue']]&&this['voiceQueues'][_0x5c1b6f[_0x31fd('0x31')]]['acw']){this['channels'][_0x5c1b6f[_0x31fd('0x2b')]][_0x375d33][_0x31fd('0x6b')]=this[_0x31fd('0xc')][_0x5c1b6f[_0x31fd('0x31')]]['acwTimeout'];this[_0x31fd('0xa')][_0x5c1b6f[_0x31fd('0x2b')]][_0x375d33]['agentacw']=!![];}this[_0x31fd('0xd')][_0x5c1b6f['interface']]=_[_0x31fd('0x6c')](this[_0x31fd('0xd')][_0x5c1b6f['interface']],[_0x31fd('0x31'),'destconnectedlinenum']);logger[_0x31fd('0x38')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x5c1b6f[_0x31fd('0x2b')],util['inspect'](this[_0x31fd('0xa')][_0x5c1b6f[_0x31fd('0x2b')]][_0x375d33],{'showHidden':![],'depth':null}));ami[_0x31fd('0x24')](_0x31fd('0x6d'),this['channels'][_0x5c1b6f[_0x31fd('0x2b')]][_0x375d33]);logger['debug'](_0x31fd('0x6e'),_0x5c1b6f[_0x31fd('0x2b')],util[_0x31fd('0x2c')]({'id':this[_0x31fd('0xd')][_0x5c1b6f[_0x31fd('0x4a')]]['id'],'destaccountcode':_0x5c1b6f['destaccountcode']},{'showHidden':![],'depth':null}));this[_0x31fd('0x24')](util[_0x31fd('0x2f')](_0x31fd('0x3d'),_0x5c1b6f[_0x31fd('0x29')]),'user:agentcomplete',{'id':this[_0x31fd('0xd')][_0x5c1b6f['interface']]['id'],'destaccountcode':_0x5c1b6f[_0x31fd('0x6f')]});}}}}}}catch(_0x35147c){logger[_0x31fd('0x57')]('[%s][voiceAgentReport][agentcomplete]',_0x5c1b6f['uniqueid'],util[_0x31fd('0x2c')](_0x35147c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x31fd('0x18')]=function(_0x2ad706){try{if(this['isNotNull'](_0x2ad706)){logger['debug'](_0x31fd('0x70'),_0x2ad706['uniqueid'],util['inspect'](_0x2ad706,{'showHidden':![],'depth':null}));this[_0x31fd('0x71')](_0x2ad706[_0x31fd('0x2b')],_[_0x31fd('0x72')](_0x2ad706[_0x31fd('0x73')])[0x0],_0x2ad706['value']);if(this[_0x31fd('0xa')][_0x2ad706[_0x31fd('0x2b')]]){for(var _0x26475f in this[_0x31fd('0xa')][_0x2ad706[_0x31fd('0x2b')]]){if(this[_0x31fd('0xa')][_0x2ad706[_0x31fd('0x2b')]][_0x31fd('0x5f')](_0x26475f)){logger[_0x31fd('0x27')]('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x2ad706['uniqueid'],_0x26475f,_['keys'](_0x2ad706[_0x31fd('0x73')])[0x0],_0x2ad706[_0x31fd('0x74')]);if(_[_0x31fd('0x2d')](this[_0x31fd('0xa')][_0x2ad706['uniqueid']][_0x26475f][_0x31fd('0xe')])){this[_0x31fd('0xa')][_0x2ad706['uniqueid']][_0x26475f][_0x31fd('0xe')]={};}this[_0x31fd('0xa')][_0x2ad706[_0x31fd('0x2b')]][_0x26475f][_0x31fd('0xe')]=this[_0x31fd('0xe')][_0x2ad706[_0x31fd('0x2b')]];}}}}}catch(_0x3589ba){logger[_0x31fd('0x57')](_0x31fd('0x75'),_0x2ad706[_0x31fd('0x2b')],util[_0x31fd('0x2c')](_0x3589ba,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x31fd('0x23')]['addVariable']=function(_0x5ee39d,_0xc206b6,_0x3f0122){var _0x49cd5b=[_0x31fd('0x76'),'rtpaudioqosbridged',_0x31fd('0x77'),_0x31fd('0x78'),_0x31fd('0x79'),'rtpaudioqoslossbridged',_0x31fd('0x7a'),'rtpaudioqosrttbridged',_0x31fd('0x7b'),'sipuri',_0x31fd('0x7c'),_0x31fd('0x7d'),_0x31fd('0x7e'),_0x31fd('0x7f'),'memberinterface',_0x31fd('0x80'),_0x31fd('0x29'),_0x31fd('0x81'),_0x31fd('0x82')];if(!_[_0x31fd('0x83')](_0xc206b6)&&!_['includes'](_0x49cd5b,_0xc206b6)){if(_[_0x31fd('0x2d')](this['variables'][_0x5ee39d])){this[_0x31fd('0xe')][_0x5ee39d]={};}this[_0x31fd('0xe')][_0x5ee39d][_0xc206b6]=_0x3f0122;}};VoiceAgentReport[_0x31fd('0x23')][_0x31fd('0x1a')]=function(_0x4ae327){try{if(this[_0x31fd('0x25')](_0x4ae327)){logger[_0x31fd('0x38')](_0x31fd('0x84'),_0x4ae327[_0x31fd('0x2b')],util[_0x31fd('0x2c')](_0x4ae327,{'showHidden':![],'depth':null}));if(this[_0x31fd('0xa')][_0x4ae327[_0x31fd('0x2b')]]){for(var _0x313326 in this[_0x31fd('0xa')][_0x4ae327[_0x31fd('0x2b')]]){if(this[_0x31fd('0xa')][_0x4ae327[_0x31fd('0x2b')]][_0x31fd('0x5f')](_0x313326)){if(this['channels'][_0x4ae327[_0x31fd('0x2b')]][_0x313326][_0x31fd('0x54')]==_0x31fd('0x68')&&this['channels'][_0x4ae327[_0x31fd('0x2b')]][_0x313326][_0x31fd('0x15')]){logger[_0x31fd('0x27')](_0x31fd('0x85'),_0x4ae327[_0x31fd('0x2b')],_0x313326);this['channels'][_0x4ae327[_0x31fd('0x2b')]][_0x313326][_0x31fd('0x66')]=moment()['format'](_0x31fd('0x41'));}}}logger[_0x31fd('0x38')](_0x31fd('0x86'),_0x4ae327[_0x31fd('0x2b')],util[_0x31fd('0x2c')](_['values'](this[_0x31fd('0xa')][_0x4ae327[_0x31fd('0x2b')]]),{'showHidden':![],'depth':null}));ami['emit']('custom:voiceAgentReport',_[_0x31fd('0x87')](this[_0x31fd('0xa')][_0x4ae327[_0x31fd('0x2b')]]));delete this['channels'][_0x4ae327[_0x31fd('0x2b')]];}if(this[_0x31fd('0xe')][_0x4ae327['uniqueid']]){delete this[_0x31fd('0xe')][_0x4ae327[_0x31fd('0x2b')]];}}}catch(_0x170f80){logger[_0x31fd('0x57')](_0x31fd('0x88'),_0x4ae327[_0x31fd('0x2b')],util[_0x31fd('0x2c')](_0x170f80,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x31fd('0x23')][_0x31fd('0x20')]=function(_0x45622c){try{if(this[_0x31fd('0x25')](_0x45622c)){logger[_0x31fd('0x38')](_0x31fd('0x89'),_0x45622c[_0x31fd('0x2b')],util[_0x31fd('0x2c')](_0x45622c,{'showHidden':![],'depth':null}));if(this['channels'][_0x45622c[_0x31fd('0x8a')]]){for(var _0x2ec5ca in this[_0x31fd('0xa')][_0x45622c['transfereeuniqueid']]){if(this[_0x31fd('0xa')][_0x45622c[_0x31fd('0x8a')]][_0x31fd('0x5f')](_0x2ec5ca)){if(_0x45622c[_0x31fd('0x8b')]===_0x2ec5ca){logger['info']('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x45622c[_0x31fd('0x2b')],this[_0x31fd('0xa')][_0x45622c['transfereeuniqueid']][_0x2ec5ca]['membername'],_0x2ec5ca);var _0x127ec3=moment();this['channels'][_0x45622c[_0x31fd('0x8a')]][_0x2ec5ca][_0x31fd('0x15')]=!![];this[_0x31fd('0xa')][_0x45622c['transfereeuniqueid']][_0x2ec5ca][_0x31fd('0x66')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x31fd('0xa')][_0x45622c[_0x31fd('0x8a')]][_0x2ec5ca]['lastevent']=_0x31fd('0x67');this[_0x31fd('0xa')][_0x45622c[_0x31fd('0x8a')]][_0x2ec5ca][_0x31fd('0x54')]=_0x31fd('0x68');this[_0x31fd('0xa')][_0x45622c[_0x31fd('0x8a')]][_0x2ec5ca][_0x31fd('0x6a')]=_0x127ec3[_0x31fd('0x8c')](this[_0x31fd('0xa')][_0x45622c[_0x31fd('0x8a')]][_0x2ec5ca][_0x31fd('0x64')],_0x31fd('0x8d'));}}}}if(this[_0x31fd('0xa')][_0x45622c[_0x31fd('0x8e')]]){var _0x57bceb=this[_0x31fd('0xa')][_0x45622c[_0x31fd('0x8e')]];this[_0x31fd('0xa')][_0x45622c[_0x31fd('0x8e')]]=this[_0x31fd('0xa')][_0x45622c[_0x31fd('0x8a')]];this[_0x31fd('0xa')][_0x45622c[_0x31fd('0x8a')]]=_0x57bceb;}}}catch(_0x17ddea){logger[_0x31fd('0x57')]('[%s][voiceAgentReport][attendedtransfer]',_0x45622c[_0x31fd('0x2b')],util[_0x31fd('0x2c')](_0x17ddea,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x31fd('0x23')]['syncBlindTransfer']=function(_0x5687d9){try{if(this[_0x31fd('0x25')](_0x5687d9)){logger[_0x31fd('0x38')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x5687d9[_0x31fd('0x2b')],util[_0x31fd('0x2c')](_0x5687d9,{'showHidden':![],'depth':null}));if(this[_0x31fd('0xa')][_0x5687d9['transfereeuniqueid']]){for(var _0xc8f766 in this[_0x31fd('0xa')][_0x5687d9[_0x31fd('0x8a')]]){if(this[_0x31fd('0xa')][_0x5687d9[_0x31fd('0x8a')]][_0x31fd('0x5f')](_0xc8f766)){if(_0x5687d9[_0x31fd('0x8f')]===_0xc8f766){logger['info'](_0x31fd('0x90'),_0x5687d9['uniqueid'],this[_0x31fd('0xa')][_0x5687d9[_0x31fd('0x8a')]][_0xc8f766][_0x31fd('0x29')],_0xc8f766);var _0x53610f=moment();this[_0x31fd('0xa')][_0x5687d9[_0x31fd('0x8a')]][_0xc8f766][_0x31fd('0x15')]=!![];this[_0x31fd('0xa')][_0x5687d9['transfereeuniqueid']][_0xc8f766]['agentcompleteAt']=_0x53610f;this[_0x31fd('0xa')][_0x5687d9[_0x31fd('0x8a')]][_0xc8f766][_0x31fd('0x46')]=_0x31fd('0x67');this[_0x31fd('0xa')][_0x5687d9[_0x31fd('0x8a')]][_0xc8f766][_0x31fd('0x54')]=_0x31fd('0x68');this[_0x31fd('0xa')][_0x5687d9[_0x31fd('0x8a')]][_0xc8f766][_0x31fd('0x6a')]=_0x53610f[_0x31fd('0x8c')](this[_0x31fd('0xa')][_0x5687d9[_0x31fd('0x8a')]][_0xc8f766][_0x31fd('0x64')],_0x31fd('0x8d'));}}}}}}catch(_0x29d031){logger[_0x31fd('0x57')]('[%s][voiceAgentReport][blindtransfer]',_0x5687d9['uniqueid'],util[_0x31fd('0x2c')](_0x29d031,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x31fd('0x23')][_0x31fd('0x1c')]=function(_0x5aef43){var _0x131972='';try{if(this[_0x31fd('0x25')](_0x5aef43)){logger[_0x31fd('0x38')](_0x31fd('0x91'),_0x5aef43[_0x31fd('0x2b')],util[_0x31fd('0x2c')](_0x5aef43,{'showHidden':![],'depth':null}));if(_0x5aef43[_0x31fd('0x92')]){_0x131972=_0x5aef43[_0x31fd('0x92')][_0x31fd('0x93')](0x0,_0x5aef43[_0x31fd('0x92')][_0x31fd('0x94')]('-'));if(this[_0x31fd('0xd')][_0x131972]){logger[_0x31fd('0x27')](_0x31fd('0x95'),_0x5aef43[_0x31fd('0x2b')],_0x131972);this['agents'][_0x131972]['onhold']=!![];}}}}catch(_0x2aef94){logger['error'](_0x31fd('0x96'),_0x5aef43[_0x31fd('0x2b')],util[_0x31fd('0x2c')](_0x2aef94,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x31fd('0x1e')]=function(_0x1bbc97){var _0x368976='';try{if(this[_0x31fd('0x25')](_0x1bbc97)){logger[_0x31fd('0x38')](_0x31fd('0x97'),_0x1bbc97['uniqueid'],util[_0x31fd('0x2c')](_0x1bbc97,{'showHidden':![],'depth':null}));if(_0x1bbc97[_0x31fd('0x92')]){_0x368976=_0x1bbc97[_0x31fd('0x92')][_0x31fd('0x93')](0x0,_0x1bbc97[_0x31fd('0x92')][_0x31fd('0x94')]('-'));if(this['agents'][_0x368976]){logger[_0x31fd('0x27')](_0x31fd('0x98'),_0x1bbc97[_0x31fd('0x2b')],_0x368976);this[_0x31fd('0xd')][_0x368976][_0x31fd('0x99')]=![];}}}}catch(_0x2e1e57){logger['error'](_0x31fd('0x9a'),_0x1bbc97['uniqueid'],util[_0x31fd('0x2c')](_0x2e1e57,{'showHidden':![],'depth':null}));}};module[_0x31fd('0x9b')]=VoiceAgentReport;
\ No newline at end of file
+var _0xfcb6=['origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','transfer','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','syncMusicOnHoldStart','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','defaults','redis','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncAgentComplete','varset','hangup','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','syncBlindTransfer','prototype','emit','isNotNull','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','debug','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','inspect','isUndefined','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','voice','merge','omit','event','privilege','custom:agentcalled','interface','calleridnum','user:%s','membername','user:called','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','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','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','error','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','talktime','acw','acwtime','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','destaccountcode','[%s][voiceAgentReport][agentcomplete]','addVariable','keys','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variable','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','transfereeuniqueid'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xfcb6,0xad));var _0x6fcb=function(_0x35d775,_0x25431e){_0x35d775=_0x35d775-0x0;var _0x59384d=_0xfcb6[_0x35d775];return _0x59384d;};'use strict';var _=require(_0x6fcb('0x0'));var moment=require(_0x6fcb('0x1'));var util=require(_0x6fcb('0x2'));var Redis=require(_0x6fcb('0x3'));var config=require(_0x6fcb('0x4'));var logger=require(_0x6fcb('0x5'))(_0x6fcb('0x6'));var ami=require('../ami');config['redis']=_[_0x6fcb('0x7')](config[_0x6fcb('0x8')],{'host':_0x6fcb('0x9'),'port':0x18eb});var io=require(_0x6fcb('0xa'))(new Redis(config[_0x6fcb('0x8')]));function VoiceAgentReport(_0x12cca3){this[_0x6fcb('0xb')]={};this[_0x6fcb('0xc')]=_0x12cca3[_0x6fcb('0xb')];this['voiceQueues']=_0x12cca3[_0x6fcb('0xd')];this[_0x6fcb('0xe')]=_0x12cca3['agents'];this[_0x6fcb('0xf')]={};ami['on'](_0x6fcb('0x10'),this[_0x6fcb('0x11')]['bind'](this));ami['on']('agentconnect',this['syncAgentConnect'][_0x6fcb('0x12')](this));ami['on'](_0x6fcb('0x13'),this[_0x6fcb('0x14')]['bind'](this));ami['on'](_0x6fcb('0x15'),this['syncQueueCallerAbandon'][_0x6fcb('0x12')](this));ami['on'](_0x6fcb('0x16'),this[_0x6fcb('0x17')][_0x6fcb('0x12')](this));ami['on'](_0x6fcb('0x18'),this['syncVarSet']['bind'](this));ami['on'](_0x6fcb('0x19'),this[_0x6fcb('0x1a')][_0x6fcb('0x12')](this));ami['on'](_0x6fcb('0x1b'),this['syncMusicOnHoldStart'][_0x6fcb('0x12')](this));ami['on'](_0x6fcb('0x1c'),this[_0x6fcb('0x1d')][_0x6fcb('0x12')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x6fcb('0x12')](this));ami['on']('blindtransfer',this[_0x6fcb('0x1e')][_0x6fcb('0x12')](this));}VoiceAgentReport[_0x6fcb('0x1f')]['emit']=function(_0x447b3f,_0x101db0,_0x2dd108){io['to'](_0x447b3f)[_0x6fcb('0x20')](_0x101db0,_0x2dd108);};VoiceAgentReport[_0x6fcb('0x1f')]['isNotNull']=function(_0x4c880d){return _0x4c880d!==null&&!_['isUndefined'](_0x4c880d);};VoiceAgentReport[_0x6fcb('0x1f')][_0x6fcb('0x11')]=function(_0x198d86){try{if(this[_0x6fcb('0x21')](_0x198d86)){logger[_0x6fcb('0x22')](_0x6fcb('0x23'),_0x198d86['uniqueid'],_0x198d86['membername'],_0x198d86['destuniqueid']);logger[_0x6fcb('0x24')](_0x6fcb('0x25'),_0x198d86[_0x6fcb('0x26')],util[_0x6fcb('0x27')](_0x198d86,{'showHidden':![],'depth':null}));if(_[_0x6fcb('0x28')](this[_0x6fcb('0xb')][_0x198d86[_0x6fcb('0x26')]])){this[_0x6fcb('0xb')][_0x198d86[_0x6fcb('0x26')]]={};}if(_[_0x6fcb('0x28')](this[_0x6fcb('0xb')][_0x198d86[_0x6fcb('0x26')]][_0x198d86[_0x6fcb('0x29')]])){this['channels'][_0x198d86['uniqueid']][_0x198d86['destuniqueid']]={'agentcalledAt':moment()[_0x6fcb('0x2a')](_0x6fcb('0x2b')),'lastevent':_0x6fcb('0x2c'),'mandatoryDisposition':this[_0x6fcb('0xd')][_0x198d86['queue']]?this[_0x6fcb('0xd')][_0x198d86[_0x6fcb('0x2d')]]['mandatoryDisposition']||![]:![],'type':this[_0x6fcb('0xd')][_0x198d86[_0x6fcb('0x2d')]]?this[_0x6fcb('0xd')][_0x198d86[_0x6fcb('0x2d')]][_0x6fcb('0x2e')]||_0x6fcb('0x2f'):_0x6fcb('0x2f'),'variables':this[_0x6fcb('0xf')][_0x198d86[_0x6fcb('0x26')]],'motionChannel':_0x6fcb('0x30')};}_[_0x6fcb('0x31')](this[_0x6fcb('0xb')][_0x198d86[_0x6fcb('0x26')]][_0x198d86[_0x6fcb('0x29')]],_[_0x6fcb('0x32')](_0x198d86,[_0x6fcb('0x33'),_0x6fcb('0x34')]));logger[_0x6fcb('0x24')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x198d86['uniqueid'],util[_0x6fcb('0x27')](this[_0x6fcb('0xb')][_0x198d86['uniqueid']][_0x198d86[_0x6fcb('0x29')]],{'showHidden':![],'depth':null}));ami['emit'](_0x6fcb('0x35'),this[_0x6fcb('0xb')][_0x198d86[_0x6fcb('0x26')]][_0x198d86[_0x6fcb('0x29')]]);var _0x258512={'id':this[_0x6fcb('0xe')][_0x198d86[_0x6fcb('0x36')]]['id'],'calleridnum':this[_0x6fcb('0xb')][_0x198d86[_0x6fcb('0x26')]][_0x198d86['destuniqueid']][_0x6fcb('0x37')],'queue':this[_0x6fcb('0xb')][_0x198d86[_0x6fcb('0x26')]][_0x198d86[_0x6fcb('0x29')]][_0x6fcb('0x2d')],'variables':this[_0x6fcb('0xb')][_0x198d86[_0x6fcb('0x26')]][_0x198d86[_0x6fcb('0x29')]][_0x6fcb('0xf')]};logger[_0x6fcb('0x24')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x198d86[_0x6fcb('0x26')],util[_0x6fcb('0x27')](_0x258512,{'showHidden':![],'depth':null}));this[_0x6fcb('0x20')](util[_0x6fcb('0x2a')](_0x6fcb('0x38'),_0x198d86[_0x6fcb('0x39')]),_0x6fcb('0x3a'),_0x258512);}}catch(_0x4218c4){logger['error']('[%s][voiceAgentReport][agentcalled]',_0x198d86[_0x6fcb('0x26')],util[_0x6fcb('0x27')](_0x4218c4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6fcb('0x1f')]['syncAgentConnect']=function(_0x2e18cd){try{if(this['isNotNull'](_0x2e18cd)){if(this['channels'][_0x2e18cd[_0x6fcb('0x26')]]){logger[_0x6fcb('0x24')](_0x6fcb('0x3b'),_0x2e18cd[_0x6fcb('0x26')],util[_0x6fcb('0x27')](_0x2e18cd,{'showHidden':![],'depth':null}));for(var _0xe70ca9 in this[_0x6fcb('0xb')][_0x2e18cd[_0x6fcb('0x26')]]){if(this['channels'][_0x2e18cd[_0x6fcb('0x26')]][_0x6fcb('0x3c')](_0xe70ca9)){if(_0x2e18cd[_0x6fcb('0x29')]===_0xe70ca9){logger['info'](_0x6fcb('0x3d'),_0x2e18cd[_0x6fcb('0x26')],_0x2e18cd[_0x6fcb('0x39')],_0x2e18cd[_0x6fcb('0x29')]);this['channels'][_0x2e18cd[_0x6fcb('0x26')]][_0xe70ca9][_0x6fcb('0x3e')]=moment()[_0x6fcb('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x2e18cd[_0x6fcb('0x26')]][_0xe70ca9][_0x6fcb('0x3f')]=_0x2e18cd[_0x6fcb('0x3f')];this[_0x6fcb('0xb')][_0x2e18cd[_0x6fcb('0x26')]][_0xe70ca9]['connectedlinenum']=_0x2e18cd['connectedlinenum'];this[_0x6fcb('0xb')][_0x2e18cd[_0x6fcb('0x26')]][_0xe70ca9][_0x6fcb('0x40')]=_0x2e18cd[_0x6fcb('0x40')];this['channels'][_0x2e18cd[_0x6fcb('0x26')]][_0xe70ca9]['destchannelstatedesc']=_0x2e18cd[_0x6fcb('0x41')];this[_0x6fcb('0xb')][_0x2e18cd[_0x6fcb('0x26')]][_0xe70ca9]['holdtime']=_0x2e18cd[_0x6fcb('0x42')];this[_0x6fcb('0xb')][_0x2e18cd[_0x6fcb('0x26')]][_0xe70ca9][_0x6fcb('0x43')]=_0x6fcb('0x44');if(this['voiceChannels'][this[_0x6fcb('0xb')][_0x2e18cd[_0x6fcb('0x26')]][_0xe70ca9][_0x6fcb('0x26')]]){var _0xb0b70a=this[_0x6fcb('0xc')][this[_0x6fcb('0xb')][_0x2e18cd[_0x6fcb('0x26')]][_0xe70ca9][_0x6fcb('0x26')]][_0x6fcb('0x45')];this[_0x6fcb('0xb')][_0x2e18cd['uniqueid']][_0xe70ca9]['routealias']=_0xb0b70a;_0x2e18cd[_0x6fcb('0x45')]=_0xb0b70a;}_[_0x6fcb('0x31')](this[_0x6fcb('0xe')][_0x2e18cd['interface']],_[_0x6fcb('0x46')](_0x2e18cd,['queue',_0x6fcb('0x47'),_0x6fcb('0x45')]));logger['debug'](_0x6fcb('0x48'),_0x2e18cd[_0x6fcb('0x26')],util['inspect'](this['channels'][_0x2e18cd['uniqueid']][_0x2e18cd['destuniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0x6fcb('0x49'),this[_0x6fcb('0xb')][_0x2e18cd[_0x6fcb('0x26')]][_0x2e18cd[_0x6fcb('0x29')]]);logger[_0x6fcb('0x24')](_0x6fcb('0x4a'),_0x2e18cd[_0x6fcb('0x26')],util[_0x6fcb('0x27')](this[_0x6fcb('0xb')][_0x2e18cd[_0x6fcb('0x26')]][_0x2e18cd[_0x6fcb('0x29')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x6fcb('0x2a')](_0x6fcb('0x38'),_0x2e18cd[_0x6fcb('0x39')]),_0x6fcb('0x4b'),this[_0x6fcb('0xb')][_0x2e18cd[_0x6fcb('0x26')]][_0x2e18cd[_0x6fcb('0x29')]]);}else if(!this['channels'][_0x2e18cd[_0x6fcb('0x26')]][_0xe70ca9]['agentringnoanswer']&&!this['channels'][_0x2e18cd[_0x6fcb('0x26')]][_0xe70ca9]['agentcomplete']){logger[_0x6fcb('0x22')](_0x6fcb('0x4c'),_0x2e18cd['uniqueid'],this['channels'][_0x2e18cd[_0x6fcb('0x26')]][_0xe70ca9]['membername'],_0xe70ca9);this[_0x6fcb('0xb')][_0x2e18cd[_0x6fcb('0x26')]][_0xe70ca9]['agentringnoanswer']=!![];this[_0x6fcb('0xb')][_0x2e18cd[_0x6fcb('0x26')]][_0xe70ca9][_0x6fcb('0x4d')]=moment()[_0x6fcb('0x2a')](_0x6fcb('0x2b'));this[_0x6fcb('0xb')][_0x2e18cd['uniqueid']][_0xe70ca9]['answeredelsewheredestinationuniqueid']=_0x2e18cd[_0x6fcb('0x29')];this[_0x6fcb('0xb')][_0x2e18cd[_0x6fcb('0x26')]][_0xe70ca9]['answeredelsewheremembername']=_0x2e18cd[_0x6fcb('0x39')];this[_0x6fcb('0xb')][_0x2e18cd['uniqueid']][_0xe70ca9][_0x6fcb('0x43')]=_0x6fcb('0x4e');this[_0x6fcb('0xb')][_0x2e18cd['uniqueid']][_0xe70ca9][_0x6fcb('0x4f')]=_0x6fcb('0x4e');logger[_0x6fcb('0x24')](_0x6fcb('0x50'),_0x2e18cd['uniqueid'],util[_0x6fcb('0x27')](this[_0x6fcb('0xb')][_0x2e18cd[_0x6fcb('0x26')]][_0xe70ca9],{'showHidden':![],'depth':null}));ami[_0x6fcb('0x20')](_0x6fcb('0x51'),this['channels'][_0x2e18cd[_0x6fcb('0x26')]][_0xe70ca9]);}}}}}}catch(_0x50a41e){logger['error'](_0x6fcb('0x52'),_0x2e18cd[_0x6fcb('0x26')],util[_0x6fcb('0x27')](_0x50a41e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6fcb('0x1f')][_0x6fcb('0x14')]=function(_0x123ed4){try{if(this[_0x6fcb('0x21')](_0x123ed4)){logger[_0x6fcb('0x24')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x123ed4[_0x6fcb('0x26')],util['inspect'](_0x123ed4,{'showHidden':![],'depth':null}));if(this[_0x6fcb('0xb')][_0x123ed4[_0x6fcb('0x26')]]&&this[_0x6fcb('0xb')][_0x123ed4[_0x6fcb('0x26')]][_0x123ed4[_0x6fcb('0x29')]]){logger[_0x6fcb('0x22')](_0x6fcb('0x53'),_0x123ed4[_0x6fcb('0x26')],_0x123ed4[_0x6fcb('0x39')],_0x123ed4[_0x6fcb('0x29')]);this[_0x6fcb('0xb')][_0x123ed4[_0x6fcb('0x26')]][_0x123ed4[_0x6fcb('0x29')]][_0x6fcb('0x13')]=!![];this[_0x6fcb('0xb')][_0x123ed4['uniqueid']][_0x123ed4[_0x6fcb('0x29')]]['agentringnoanswerAt']=moment()['format'](_0x6fcb('0x2b'));this[_0x6fcb('0xb')][_0x123ed4[_0x6fcb('0x26')]][_0x123ed4[_0x6fcb('0x29')]][_0x6fcb('0x43')]=_0x6fcb('0x54');this['channels'][_0x123ed4['uniqueid']][_0x123ed4[_0x6fcb('0x29')]][_0x6fcb('0x4f')]=_0x6fcb('0x54');logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x123ed4['uniqueid'],util[_0x6fcb('0x27')](this[_0x6fcb('0xb')][_0x123ed4[_0x6fcb('0x26')]][_0x123ed4[_0x6fcb('0x29')]],{'showHidden':![],'depth':null}));ami[_0x6fcb('0x20')](_0x6fcb('0x55'),this[_0x6fcb('0xb')][_0x123ed4[_0x6fcb('0x26')]][_0x123ed4['destuniqueid']]);}}}catch(_0x29e4c1){logger['error'](_0x6fcb('0x56'),_0x123ed4[_0x6fcb('0x26')],util[_0x6fcb('0x27')](_0x29e4c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6fcb('0x1f')][_0x6fcb('0x57')]=function(_0x2fca7f){try{if(this['isNotNull'](_0x2fca7f)){logger['debug'](_0x6fcb('0x58'),_0x2fca7f['uniqueid'],util[_0x6fcb('0x27')](_0x2fca7f,{'showHidden':![],'depth':null}));if(this[_0x6fcb('0xb')][_0x2fca7f['uniqueid']]){for(var _0x5069c4 in this[_0x6fcb('0xb')][_0x2fca7f['uniqueid']]){if(this[_0x6fcb('0xb')][_0x2fca7f['uniqueid']]['hasOwnProperty'](_0x5069c4)&&!this[_0x6fcb('0xb')][_0x2fca7f[_0x6fcb('0x26')]][_0x5069c4]['agentringnoanswer']&&!this[_0x6fcb('0xb')][_0x2fca7f[_0x6fcb('0x26')]][_0x5069c4]['agentcomplete']){logger[_0x6fcb('0x22')](_0x6fcb('0x59'),_0x2fca7f['uniqueid'],this[_0x6fcb('0xb')][_0x2fca7f['uniqueid']][_0x5069c4][_0x6fcb('0x39')],_0x5069c4);this['channels'][_0x2fca7f['uniqueid']][_0x5069c4][_0x6fcb('0x13')]=!![];this[_0x6fcb('0xb')][_0x2fca7f[_0x6fcb('0x26')]][_0x5069c4][_0x6fcb('0x4d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x6fcb('0xb')][_0x2fca7f[_0x6fcb('0x26')]][_0x5069c4][_0x6fcb('0x43')]=_0x6fcb('0x5a');this[_0x6fcb('0xb')][_0x2fca7f[_0x6fcb('0x26')]][_0x5069c4][_0x6fcb('0x4f')]=_0x6fcb('0x5a');logger[_0x6fcb('0x24')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x2fca7f['uniqueid'],util[_0x6fcb('0x27')](this[_0x6fcb('0xb')][_0x2fca7f[_0x6fcb('0x26')]][_0x5069c4],{'showHidden':![],'depth':null}));ami[_0x6fcb('0x20')](_0x6fcb('0x5b'),this[_0x6fcb('0xb')][_0x2fca7f[_0x6fcb('0x26')]][_0x5069c4]);}}}}}catch(_0xadb50a){logger[_0x6fcb('0x5c')](_0x6fcb('0x5d'),_0x2fca7f['uniqueid'],util['inspect'](_0xadb50a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentComplete']=function(_0x4636f5){try{if(this['isNotNull'](_0x4636f5)){logger[_0x6fcb('0x24')](_0x6fcb('0x5e'),_0x4636f5[_0x6fcb('0x26')],util['inspect'](_0x4636f5,{'showHidden':![],'depth':null}));if(this[_0x6fcb('0xb')][_0x4636f5[_0x6fcb('0x26')]]){for(var _0x183e7f in this[_0x6fcb('0xb')][_0x4636f5[_0x6fcb('0x26')]]){if(this[_0x6fcb('0xb')][_0x4636f5[_0x6fcb('0x26')]][_0x6fcb('0x3c')](_0x183e7f)){if(this[_0x6fcb('0xb')][_0x4636f5[_0x6fcb('0x26')]][_0x183e7f][_0x6fcb('0x3e')]&&!this[_0x6fcb('0xb')][_0x4636f5[_0x6fcb('0x26')]][_0x183e7f][_0x6fcb('0x16')]){logger[_0x6fcb('0x22')](_0x6fcb('0x5f'),_0x4636f5[_0x6fcb('0x26')],this[_0x6fcb('0xb')][_0x4636f5[_0x6fcb('0x26')]][_0x183e7f]['membername'],_0x183e7f);this['channels'][_0x4636f5[_0x6fcb('0x26')]][_0x183e7f]['agentcomplete']=!![];this[_0x6fcb('0xb')][_0x4636f5[_0x6fcb('0x26')]][_0x183e7f][_0x6fcb('0x60')]=moment()[_0x6fcb('0x2a')](_0x6fcb('0x2b'));this[_0x6fcb('0xb')][_0x4636f5[_0x6fcb('0x26')]][_0x183e7f][_0x6fcb('0x43')]='complete';this[_0x6fcb('0xb')][_0x4636f5[_0x6fcb('0x26')]][_0x183e7f][_0x6fcb('0x4f')]=_0x4636f5[_0x6fcb('0x4f')]=='transfer'?'agent':_0x4636f5['reason'];this[_0x6fcb('0xb')][_0x4636f5[_0x6fcb('0x26')]][_0x183e7f][_0x6fcb('0x61')]=_0x4636f5[_0x6fcb('0x61')];if(this[_0x6fcb('0xd')][_0x4636f5[_0x6fcb('0x2d')]]&&this[_0x6fcb('0xd')][_0x4636f5[_0x6fcb('0x2d')]][_0x6fcb('0x62')]){this['channels'][_0x4636f5[_0x6fcb('0x26')]][_0x183e7f][_0x6fcb('0x63')]=this[_0x6fcb('0xd')][_0x4636f5[_0x6fcb('0x2d')]][_0x6fcb('0x64')];this['channels'][_0x4636f5[_0x6fcb('0x26')]][_0x183e7f][_0x6fcb('0x65')]=!![];}this['agents'][_0x4636f5[_0x6fcb('0x36')]]=_[_0x6fcb('0x32')](this[_0x6fcb('0xe')][_0x4636f5['interface']],[_0x6fcb('0x2d'),_0x6fcb('0x47')]);logger[_0x6fcb('0x24')](_0x6fcb('0x66'),_0x4636f5['uniqueid'],util[_0x6fcb('0x27')](this['channels'][_0x4636f5['uniqueid']][_0x183e7f],{'showHidden':![],'depth':null}));ami[_0x6fcb('0x20')](_0x6fcb('0x67'),this[_0x6fcb('0xb')][_0x4636f5['uniqueid']][_0x183e7f]);logger[_0x6fcb('0x24')](_0x6fcb('0x68'),_0x4636f5[_0x6fcb('0x26')],util[_0x6fcb('0x27')]({'id':this['agents'][_0x4636f5['interface']]['id'],'destaccountcode':_0x4636f5['destaccountcode']},{'showHidden':![],'depth':null}));this[_0x6fcb('0x20')](util[_0x6fcb('0x2a')](_0x6fcb('0x38'),_0x4636f5[_0x6fcb('0x39')]),_0x6fcb('0x69'),{'id':this[_0x6fcb('0xe')][_0x4636f5[_0x6fcb('0x36')]]['id'],'destaccountcode':_0x4636f5[_0x6fcb('0x6a')]});}}}}}}catch(_0xdef352){logger[_0x6fcb('0x5c')](_0x6fcb('0x6b'),_0x4636f5[_0x6fcb('0x26')],util[_0x6fcb('0x27')](_0xdef352,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6fcb('0x1f')]['syncVarSet']=function(_0x422117){try{if(this[_0x6fcb('0x21')](_0x422117)){logger[_0x6fcb('0x24')]('[%s][voiceAgentReport][varset]\x20event:',_0x422117[_0x6fcb('0x26')],util['inspect'](_0x422117,{'showHidden':![],'depth':null}));this[_0x6fcb('0x6c')](_0x422117['uniqueid'],_[_0x6fcb('0x6d')](_0x422117['variable'])[0x0],_0x422117[_0x6fcb('0x6e')]);if(this['channels'][_0x422117['uniqueid']]){for(var _0x2f0602 in this['channels'][_0x422117[_0x6fcb('0x26')]]){if(this[_0x6fcb('0xb')][_0x422117[_0x6fcb('0x26')]][_0x6fcb('0x3c')](_0x2f0602)){logger[_0x6fcb('0x22')](_0x6fcb('0x6f'),_0x422117[_0x6fcb('0x26')],_0x2f0602,_[_0x6fcb('0x6d')](_0x422117[_0x6fcb('0x70')])[0x0],_0x422117[_0x6fcb('0x6e')]);if(_[_0x6fcb('0x28')](this['channels'][_0x422117[_0x6fcb('0x26')]][_0x2f0602][_0x6fcb('0xf')])){this['channels'][_0x422117[_0x6fcb('0x26')]][_0x2f0602][_0x6fcb('0xf')]={};}this[_0x6fcb('0xb')][_0x422117[_0x6fcb('0x26')]][_0x2f0602][_0x6fcb('0xf')]=this[_0x6fcb('0xf')][_0x422117['uniqueid']];}}}}}catch(_0x394121){logger[_0x6fcb('0x5c')](_0x6fcb('0x71'),_0x422117[_0x6fcb('0x26')],util['inspect'](_0x394121,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6fcb('0x1f')][_0x6fcb('0x6c')]=function(_0x37305f,_0x3fe514,_0x847f7){var _0x5bed80=[_0x6fcb('0x72'),'rtpaudioqosbridged',_0x6fcb('0x73'),_0x6fcb('0x74'),_0x6fcb('0x75'),'rtpaudioqoslossbridged',_0x6fcb('0x76'),_0x6fcb('0x77'),_0x6fcb('0x78'),'sipuri','bridgepeer','bridgepvtcallid','membercalls',_0x6fcb('0x79'),_0x6fcb('0x7a'),_0x6fcb('0x7b'),_0x6fcb('0x39'),_0x6fcb('0x7c'),_0x6fcb('0x7d')];if(!_[_0x6fcb('0x7e')](_0x3fe514)&&!_['includes'](_0x5bed80,_0x3fe514)){if(_[_0x6fcb('0x28')](this[_0x6fcb('0xf')][_0x37305f])){this[_0x6fcb('0xf')][_0x37305f]={};}this[_0x6fcb('0xf')][_0x37305f][_0x3fe514]=_0x847f7;}};VoiceAgentReport[_0x6fcb('0x1f')]['syncHangup']=function(_0x6b468b){try{if(this['isNotNull'](_0x6b468b)){logger[_0x6fcb('0x24')](_0x6fcb('0x7f'),_0x6b468b['uniqueid'],util['inspect'](_0x6b468b,{'showHidden':![],'depth':null}));if(this[_0x6fcb('0xb')][_0x6b468b['uniqueid']]){for(var _0x3dd5bf in this['channels'][_0x6b468b[_0x6fcb('0x26')]]){if(this['channels'][_0x6b468b['uniqueid']][_0x6fcb('0x3c')](_0x3dd5bf)){if(this[_0x6fcb('0xb')][_0x6b468b[_0x6fcb('0x26')]][_0x3dd5bf]['reason']=='transfer'&&this[_0x6fcb('0xb')][_0x6b468b[_0x6fcb('0x26')]][_0x3dd5bf]['agentcomplete']){logger[_0x6fcb('0x22')](_0x6fcb('0x80'),_0x6b468b[_0x6fcb('0x26')],_0x3dd5bf);this[_0x6fcb('0xb')][_0x6b468b[_0x6fcb('0x26')]][_0x3dd5bf]['agentcompleteAt']=moment()['format'](_0x6fcb('0x2b'));}}}logger['debug'](_0x6fcb('0x81'),_0x6b468b['uniqueid'],util[_0x6fcb('0x27')](_[_0x6fcb('0x82')](this[_0x6fcb('0xb')][_0x6b468b[_0x6fcb('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x6fcb('0x20')](_0x6fcb('0x83'),_[_0x6fcb('0x82')](this[_0x6fcb('0xb')][_0x6b468b['uniqueid']]));delete this[_0x6fcb('0xb')][_0x6b468b['uniqueid']];}if(this['variables'][_0x6b468b[_0x6fcb('0x26')]]){delete this[_0x6fcb('0xf')][_0x6b468b['uniqueid']];}}}catch(_0x30044d){logger[_0x6fcb('0x5c')](_0x6fcb('0x84'),_0x6b468b['uniqueid'],util[_0x6fcb('0x27')](_0x30044d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6fcb('0x1f')][_0x6fcb('0x85')]=function(_0xc8cd80){try{if(this[_0x6fcb('0x21')](_0xc8cd80)){logger[_0x6fcb('0x24')]('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0xc8cd80[_0x6fcb('0x26')],util[_0x6fcb('0x27')](_0xc8cd80,{'showHidden':![],'depth':null}));if(this['channels'][_0xc8cd80[_0x6fcb('0x86')]]){for(var _0x5a685b in this[_0x6fcb('0xb')][_0xc8cd80[_0x6fcb('0x86')]]){if(this['channels'][_0xc8cd80[_0x6fcb('0x86')]][_0x6fcb('0x3c')](_0x5a685b)){if(_0xc8cd80[_0x6fcb('0x87')]===_0x5a685b){logger[_0x6fcb('0x22')](_0x6fcb('0x88'),_0xc8cd80[_0x6fcb('0x26')],this[_0x6fcb('0xb')][_0xc8cd80[_0x6fcb('0x86')]][_0x5a685b]['membername'],_0x5a685b);var _0x221d61=moment();this[_0x6fcb('0xb')][_0xc8cd80[_0x6fcb('0x86')]][_0x5a685b][_0x6fcb('0x16')]=!![];this[_0x6fcb('0xb')][_0xc8cd80['transfereeuniqueid']][_0x5a685b][_0x6fcb('0x60')]=moment()['format'](_0x6fcb('0x2b'));this['channels'][_0xc8cd80[_0x6fcb('0x86')]][_0x5a685b]['lastevent']=_0x6fcb('0x89');this['channels'][_0xc8cd80['transfereeuniqueid']][_0x5a685b][_0x6fcb('0x4f')]=_0x6fcb('0x8a');this[_0x6fcb('0xb')][_0xc8cd80[_0x6fcb('0x86')]][_0x5a685b]['talktime']=_0x221d61['diff'](this[_0x6fcb('0xb')][_0xc8cd80['transfereeuniqueid']][_0x5a685b][_0x6fcb('0x3e')],_0x6fcb('0x8b'));}}}}if(this[_0x6fcb('0xb')][_0xc8cd80[_0x6fcb('0x8c')]]){var _0xb2bdfe=this[_0x6fcb('0xb')][_0xc8cd80['secondtransfereruniqueid']];this[_0x6fcb('0xb')][_0xc8cd80['secondtransfereruniqueid']]=this[_0x6fcb('0xb')][_0xc8cd80[_0x6fcb('0x86')]];this['channels'][_0xc8cd80[_0x6fcb('0x86')]]=_0xb2bdfe;}}}catch(_0x119fa4){logger[_0x6fcb('0x5c')]('[%s][voiceAgentReport][attendedtransfer]',_0xc8cd80[_0x6fcb('0x26')],util[_0x6fcb('0x27')](_0x119fa4,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncBlindTransfer']=function(_0x2594fb){try{if(this[_0x6fcb('0x21')](_0x2594fb)){logger[_0x6fcb('0x24')](_0x6fcb('0x8d'),_0x2594fb[_0x6fcb('0x26')],util[_0x6fcb('0x27')](_0x2594fb,{'showHidden':![],'depth':null}));if(this[_0x6fcb('0xb')][_0x2594fb[_0x6fcb('0x86')]]){for(var _0x5b2338 in this[_0x6fcb('0xb')][_0x2594fb['transfereeuniqueid']]){if(this[_0x6fcb('0xb')][_0x2594fb[_0x6fcb('0x86')]]['hasOwnProperty'](_0x5b2338)){if(_0x2594fb[_0x6fcb('0x8e')]===_0x5b2338){logger[_0x6fcb('0x22')](_0x6fcb('0x8f'),_0x2594fb[_0x6fcb('0x26')],this['channels'][_0x2594fb[_0x6fcb('0x86')]][_0x5b2338]['membername'],_0x5b2338);var _0x251a29=moment();this[_0x6fcb('0xb')][_0x2594fb['transfereeuniqueid']][_0x5b2338][_0x6fcb('0x16')]=!![];this[_0x6fcb('0xb')][_0x2594fb[_0x6fcb('0x86')]][_0x5b2338][_0x6fcb('0x60')]=_0x251a29;this[_0x6fcb('0xb')][_0x2594fb[_0x6fcb('0x86')]][_0x5b2338][_0x6fcb('0x43')]=_0x6fcb('0x89');this[_0x6fcb('0xb')][_0x2594fb[_0x6fcb('0x86')]][_0x5b2338]['reason']=_0x6fcb('0x8a');this[_0x6fcb('0xb')][_0x2594fb['transfereeuniqueid']][_0x5b2338][_0x6fcb('0x61')]=_0x251a29['diff'](this[_0x6fcb('0xb')][_0x2594fb[_0x6fcb('0x86')]][_0x5b2338]['agentconnectAt'],_0x6fcb('0x8b'));}}}}}}catch(_0x3005e7){logger[_0x6fcb('0x5c')]('[%s][voiceAgentReport][blindtransfer]',_0x2594fb[_0x6fcb('0x26')],util[_0x6fcb('0x27')](_0x3005e7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6fcb('0x1f')][_0x6fcb('0x90')]=function(_0x916470){var _0x515aca='';try{if(this['isNotNull'](_0x916470)){logger[_0x6fcb('0x24')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x916470['uniqueid'],util[_0x6fcb('0x27')](_0x916470,{'showHidden':![],'depth':null}));if(_0x916470[_0x6fcb('0x91')]){_0x515aca=_0x916470[_0x6fcb('0x91')][_0x6fcb('0x92')](0x0,_0x916470[_0x6fcb('0x91')][_0x6fcb('0x93')]('-'));if(this['agents'][_0x515aca]){logger[_0x6fcb('0x22')](_0x6fcb('0x94'),_0x916470[_0x6fcb('0x26')],_0x515aca);this[_0x6fcb('0xe')][_0x515aca][_0x6fcb('0x95')]=!![];}}}}catch(_0x3c021e){logger['error'](_0x6fcb('0x96'),_0x916470[_0x6fcb('0x26')],util[_0x6fcb('0x27')](_0x3c021e,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6fcb('0x1d')]=function(_0x24d82){var _0x3ba626='';try{if(this['isNotNull'](_0x24d82)){logger['debug'](_0x6fcb('0x97'),_0x24d82[_0x6fcb('0x26')],util[_0x6fcb('0x27')](_0x24d82,{'showHidden':![],'depth':null}));if(_0x24d82[_0x6fcb('0x91')]){_0x3ba626=_0x24d82[_0x6fcb('0x91')][_0x6fcb('0x92')](0x0,_0x24d82[_0x6fcb('0x91')][_0x6fcb('0x93')]('-'));if(this[_0x6fcb('0xe')][_0x3ba626]){logger['info']('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x24d82['uniqueid'],_0x3ba626);this[_0x6fcb('0xe')][_0x3ba626][_0x6fcb('0x95')]=![];}}}}catch(_0xc8199b){logger[_0x6fcb('0x5c')](_0x6fcb('0x98'),_0x24d82['uniqueid'],util[_0x6fcb('0x27')](_0xc8199b,{'showHidden':![],'depth':null}));}};module[_0x6fcb('0x99')]=VoiceAgentReport;
\ No newline at end of file
index 78342e3..eb4eb5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f62=['linkedid','merge','context','from-sip','channel','xcally-motion-preview','split','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','accountcode','error','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','pick','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','OutgoingSpoolFailed','application','toLowerCase','applicationdata','appdata','startsWith','queue','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','keys','lastapplication','lastdata','match','type','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','holdtime','connectedlinename','UserId','answertime','diff','destinationchannel','toNumber','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','replace','.WAV','monitorFilename','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','variable','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','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','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','mixmonitor_filename','parse','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','transferType','then','undefined','isEmpty','getSettings','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','moment','path','ioredis','../../../config/environment','../ami','../model/channel','../rpc/setting','set','agi','dial','playback','voicemail','NO\x20ANSWER','ANSWERED','FAILED','defaults','redis','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9f62,0x154));var _0x29f6=function(_0x17f732,_0x826856){_0x17f732=_0x17f732-0x0;var _0x1efc93=_0x9f62[_0x17f732];return _0x1efc93;};'use strict';var _=require('lodash');var moment=require(_0x29f6('0x0'));var util=require('util');var path=require(_0x29f6('0x1'));var Redis=require(_0x29f6('0x2'));var config=require(_0x29f6('0x3'));var logger=require('../../../config/logger')('ami');var ami=require(_0x29f6('0x4'));var Channel=require(_0x29f6('0x5'));var RpcSetting=require(_0x29f6('0x6'));var applications=[_0x29f6('0x7'),'queue',_0x29f6('0x8'),_0x29f6('0x9'),_0x29f6('0xa'),_0x29f6('0xb')];var dispositions=[_0x29f6('0xc'),'FAILED','FAILED','NO\x20ANSWER','NO\x20ANSWER',_0x29f6('0xc'),_0x29f6('0xd'),'BUSY','FAILED',_0x29f6('0xe'),_0x29f6('0xe')];config['redis']=_[_0x29f6('0xf')](config[_0x29f6('0x10')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0x57b2d2){this[_0x29f6('0x11')]=_0x57b2d2[_0x29f6('0x11')];this[_0x29f6('0x12')]=_0x57b2d2[_0x29f6('0x12')];this[_0x29f6('0x13')]={};ami['on'](_0x29f6('0x14'),this[_0x29f6('0x15')][_0x29f6('0x16')](this));ami['on'](_0x29f6('0x17'),this[_0x29f6('0x15')][_0x29f6('0x16')](this));ami['on'](_0x29f6('0x18'),this[_0x29f6('0x19')][_0x29f6('0x16')](this));ami['on'](_0x29f6('0x1a'),this[_0x29f6('0x1b')][_0x29f6('0x16')](this));ami['on']('varset',this['syncVarSet'][_0x29f6('0x16')](this));ami['on'](_0x29f6('0x1c'),this[_0x29f6('0x1d')]['bind'](this));ami['on'](_0x29f6('0x1e'),this[_0x29f6('0x1f')]['bind'](this));ami['on'](_0x29f6('0x20'),this[_0x29f6('0x21')][_0x29f6('0x16')](this));ami['on'](_0x29f6('0x22'),this[_0x29f6('0x23')][_0x29f6('0x16')](this));ami['on']('musiconholdstart',this[_0x29f6('0x24')]['bind'](this));ami['on']('musiconholdstop',this[_0x29f6('0x25')][_0x29f6('0x16')](this));try{logger[_0x29f6('0x26')](_0x29f6('0x27'));ami['actionCoreShowChannels']();}catch(_0x2c672e){logger['error'](_0x29f6('0x28'),util[_0x29f6('0x29')](_0x2c672e,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x29f6('0x2a')][_0x29f6('0x2b')]=function(_0x4fc725){return _0x4fc725!==null&&!_[_0x29f6('0x2c')](_0x4fc725);};VoiceCallReport[_0x29f6('0x2a')]['emit']=function(_0x1401fb,_0x45f792,_0x2519ac){io['to'](_0x1401fb)[_0x29f6('0x2d')](_0x45f792,_0x2519ac);};VoiceCallReport[_0x29f6('0x2a')][_0x29f6('0x1f')]=function(_0x23c630){try{if(this['isNotNull'](_0x23c630)){logger[_0x29f6('0x26')](_0x29f6('0x2e'),_0x23c630[_0x29f6('0x2f')],_0x23c630[_0x29f6('0x30')],_0x23c630[_0x29f6('0x31')]);logger[_0x29f6('0x32')](_0x29f6('0x33'),_0x23c630[_0x29f6('0x2f')],util[_0x29f6('0x29')](_0x23c630,{'showHidden':![],'depth':null}));if(_0x23c630[_0x29f6('0x2f')]===_0x23c630[_0x29f6('0x34')]){if(!_[_0x29f6('0x2c')](this[_0x29f6('0x11')][_0x23c630[_0x29f6('0x2f')]])){_[_0x29f6('0x35')](this[_0x29f6('0x11')][_0x23c630[_0x29f6('0x2f')]],_['pick'](_0x23c630,_['keys'](this[_0x29f6('0x11')][_0x23c630['uniqueid']])));}}if(_0x23c630[_0x29f6('0x36')]===_0x29f6('0x37')){if(this[_0x29f6('0x12')][_0x23c630[_0x29f6('0x38')]['split']('-')[0x0]]){if(_0x23c630['exten']==_0x29f6('0x39')){this[_0x29f6('0x12')][_0x23c630[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]][_0x29f6('0x3b')]=_0x23c630[_0x29f6('0x3c')];this[_0x29f6('0x2d')](util[_0x29f6('0x3d')](_0x29f6('0x3e'),this[_0x29f6('0x12')][_0x23c630[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]][_0x29f6('0x3f')]),_0x29f6('0x40'),{'destaccountcode':this['agents'][_0x23c630['channel'][_0x29f6('0x3a')]('-')[0x0]][_0x29f6('0x41')],'destconnectedlinenum':_0x23c630[_0x29f6('0x3c')]});}}}}}catch(_0x5416dc){logger[_0x29f6('0x42')](_0x29f6('0x43'),_0x23c630[_0x29f6('0x2f')],util[_0x29f6('0x29')](_0x5416dc,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x29f6('0x2a')]['syncNewChannel']=function(_0x7695ee){try{if(this[_0x29f6('0x2b')](_0x7695ee)){logger[_0x29f6('0x32')](_0x29f6('0x44'),_0x7695ee['uniqueid'],util[_0x29f6('0x29')](_0x7695ee,{'showHidden':![],'depth':null}));if(this[_0x29f6('0x11')][_0x7695ee[_0x29f6('0x2f')]])return;if(_0x7695ee[_0x29f6('0x38')]==='OutgoingSpoolFailed')return;if(_0x7695ee['uniqueid']!==_0x7695ee[_0x29f6('0x34')]&&!this['blindTransfers'][_0x7695ee[_0x29f6('0x34')]])return;logger['info'](_0x29f6('0x45'),_0x7695ee['uniqueid'],_0x7695ee[_0x29f6('0x36')],_0x7695ee[_0x29f6('0x46')]);this['channels'][_0x7695ee[_0x29f6('0x2f')]]=new Channel();this['channels'][_0x7695ee[_0x29f6('0x2f')]][_0x29f6('0x47')]=moment()['format'](_0x29f6('0x48'));this[_0x29f6('0x11')][_0x7695ee[_0x29f6('0x2f')]][_0x29f6('0x49')]=dispositions[_['toNumber'](_0x7695ee[_0x29f6('0x4a')])];_[_0x29f6('0x35')](this[_0x29f6('0x11')][_0x7695ee[_0x29f6('0x2f')]],_[_0x29f6('0x4b')](_0x7695ee,_['keys'](this[_0x29f6('0x11')][_0x7695ee['uniqueid']])));if(_0x7695ee[_0x29f6('0x36')]==='from-sip'){if(this[_0x29f6('0x12')][_0x7695ee[_0x29f6('0x38')]['split']('-')[0x0]]){if(_[_0x29f6('0x2c')](this[_0x29f6('0x12')][_0x7695ee[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]]['destconnectedlinenum'])){this[_0x29f6('0x12')][_0x7695ee[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]]['destconnectedlinenum']=_0x7695ee[_0x29f6('0x46')];logger['debug'](_0x29f6('0x4c'),_0x7695ee['uniqueid'],util['inspect']({'id':this['agents'][_0x7695ee[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0x29f6('0x12')][_0x7695ee[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]][_0x29f6('0x41')],'destconnectedlinenum':_0x7695ee[_0x29f6('0x46')]},{'showHidden':![],'depth':null}));this[_0x29f6('0x2d')](util[_0x29f6('0x3d')](_0x29f6('0x3e'),this['agents'][_0x7695ee['channel'][_0x29f6('0x3a')]('-')[0x0]][_0x29f6('0x3f')]),_0x29f6('0x40'),{'id':this[_0x29f6('0x12')][_0x7695ee['channel'][_0x29f6('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0x29f6('0x12')][_0x7695ee['channel'][_0x29f6('0x3a')]('-')[0x0]][_0x29f6('0x41')],'destconnectedlinenum':_0x7695ee[_0x29f6('0x46')]});}}}}}catch(_0x2776ac){logger[_0x29f6('0x42')](_0x29f6('0x4d'),_0x7695ee[_0x29f6('0x2f')],util[_0x29f6('0x29')](_0x2776ac,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x29f6('0x2a')][_0x29f6('0x15')]=function(_0x204a6e){try{if(this[_0x29f6('0x2b')](_0x204a6e)){logger['debug'](_0x29f6('0x4e'),_0x204a6e[_0x29f6('0x2f')],util[_0x29f6('0x29')](_0x204a6e,{'showHidden':![],'depth':null}));if(_0x204a6e[_0x29f6('0x38')]===_0x29f6('0x4f')||_0x204a6e['exten']==='h')return;if(_0x204a6e[_0x29f6('0x2f')]===_0x204a6e['linkedid']||this['blindTransfers'][_0x204a6e[_0x29f6('0x34')]]){_0x204a6e[_0x29f6('0x50')]=_0x204a6e[_0x29f6('0x50')][_0x29f6('0x51')]();_0x204a6e[_0x29f6('0x52')]=_0x204a6e['appdata']||_0x204a6e[_0x29f6('0x52')];if(_0x204a6e[_0x29f6('0x53')]&&!_0x204a6e['appdata'][_0x29f6('0x54')]('CDR(routeAlias)')&&_0x204a6e[_0x29f6('0x50')]!==_0x29f6('0x55')){_0x204a6e[_0x29f6('0x52')]=_0x204a6e[_0x29f6('0x52')]['toLowerCase']();}logger[_0x29f6('0x26')](_0x29f6('0x56'),_0x204a6e[_0x29f6('0x2f')],_0x204a6e[_0x29f6('0x50')],_0x204a6e[_0x29f6('0x52')]);if(_[_0x29f6('0x2c')](this[_0x29f6('0x11')][_0x204a6e['uniqueid']])){this[_0x29f6('0x11')][_0x204a6e[_0x29f6('0x2f')]]=new Channel();this[_0x29f6('0x11')][_0x204a6e[_0x29f6('0x2f')]][_0x29f6('0x47')]=_0x204a6e[_0x29f6('0x57')]?moment()[_0x29f6('0x58')](moment[_0x29f6('0x57')](_0x204a6e[_0x29f6('0x57')])[_0x29f6('0x59')](),'seconds')['format'](_0x29f6('0x48')):moment()[_0x29f6('0x3d')](_0x29f6('0x48'));this['channels'][_0x204a6e[_0x29f6('0x2f')]]['disposition']='NO\x20ANSWER';}_[_0x29f6('0x35')](this[_0x29f6('0x11')][_0x204a6e['uniqueid']],_['pick'](_0x204a6e,_[_0x29f6('0x5a')](this[_0x29f6('0x11')][_0x204a6e[_0x29f6('0x2f')]])));if(_['includes'](applications,_0x204a6e[_0x29f6('0x50')])){this[_0x29f6('0x11')][_0x204a6e[_0x29f6('0x2f')]][_0x29f6('0x5b')]=_0x204a6e[_0x29f6('0x50')];this[_0x29f6('0x11')][_0x204a6e[_0x29f6('0x2f')]][_0x29f6('0x5c')]=_0x204a6e[_0x29f6('0x52')];if(_0x204a6e[_0x29f6('0x50')]===_0x29f6('0x7')&&_[_0x29f6('0x54')](_0x204a6e[_0x29f6('0x52')]['toLowerCase'](),'cdr(')){var _0x2bd7d9=_0x204a6e['applicationdata'][_0x29f6('0x3a')]('=');var _0x316666=_0x2bd7d9[0x0][_0x29f6('0x51')]()[_0x29f6('0x5d')](/cdr\((.*)\)/);if(_0x316666){if(_0x316666[0x1]===_0x29f6('0x5e')&&!_['isNil'](this[_0x29f6('0x11')][_0x204a6e[_0x29f6('0x2f')]][_0x316666[0x1]]))return;this[_0x29f6('0x11')][_0x204a6e[_0x29f6('0x2f')]][_0x316666[0x1]]=_0x2bd7d9[0x1];}}else if(_0x204a6e[_0x29f6('0x50')]==='queue'){this[_0x29f6('0x11')][_0x204a6e['uniqueid']]['queue']=_0x204a6e[_0x29f6('0x52')][_0x29f6('0x3a')](',')[0x0];}}}}}catch(_0x5526b6){logger[_0x29f6('0x42')](_0x29f6('0x5f'),_0x204a6e['uniqueid'],util[_0x29f6('0x29')](_0x5526b6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x29f6('0x2a')][_0x29f6('0x1b')]=function(_0x2f54eb){try{if(this[_0x29f6('0x2b')](_0x2f54eb)){logger[_0x29f6('0x26')](_0x29f6('0x60'),_0x2f54eb['uniqueid'],_0x2f54eb[_0x29f6('0x34')],_0x2f54eb['calleridname'],_0x2f54eb[_0x29f6('0x31')]);logger['debug']('[%s][voiceCallReport][newstate]\x20event:',_0x2f54eb[_0x29f6('0x2f')],util[_0x29f6('0x29')](_0x2f54eb,{'showHidden':![],'depth':null}));if(_0x2f54eb[_0x29f6('0x4a')]!=='6')return;if(_0x2f54eb['uniqueid']!==_0x2f54eb[_0x29f6('0x34')]){var _0x373cf6=moment();if(this[_0x29f6('0x11')][_0x2f54eb['linkedid']]){if(!this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x34')]][_0x29f6('0x61')]){this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x34')]][_0x29f6('0x61')]=!![];this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x34')]]['answertime']=_0x373cf6[_0x29f6('0x3d')](_0x29f6('0x48'));if(this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x34')]][_0x29f6('0x47')]){this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x34')]][_0x29f6('0x62')]=_0x373cf6['diff'](this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x34')]]['starttime'],_0x29f6('0x59'));}}this['channels'][_0x2f54eb[_0x29f6('0x34')]][_0x29f6('0x34')]=_0x2f54eb['uniqueid'];if(_0x2f54eb[_0x29f6('0x31')]!==_0x29f6('0x39')){this['channels'][_0x2f54eb['linkedid']]['connectedlinenum']=_0x2f54eb[_0x29f6('0x31')];}this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x34')]][_0x29f6('0x63')]=_0x2f54eb[_0x29f6('0x30')];this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x34')]]['destinationchannel']=_0x2f54eb[_0x29f6('0x38')];this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x34')]][_0x29f6('0x49')]=dispositions[_['toNumber'](_0x2f54eb[_0x29f6('0x4a')])];if(this[_0x29f6('0x12')][_0x2f54eb[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]]){this[_0x29f6('0x11')][_0x2f54eb['linkedid']][_0x29f6('0x64')]=this[_0x29f6('0x12')][_0x2f54eb[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]]['id'];this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x34')]]['membername']=this[_0x29f6('0x12')][_0x2f54eb['channel']['split']('-')[0x0]]['name'];}}if(this[_0x29f6('0x11')][_0x2f54eb['uniqueid']]){if(!this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x2f')]][_0x29f6('0x61')]){this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x2f')]][_0x29f6('0x61')]=!![];this[_0x29f6('0x11')][_0x2f54eb['uniqueid']][_0x29f6('0x65')]=_0x373cf6['format'](_0x29f6('0x48'));if(this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x2f')]][_0x29f6('0x47')]){this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x2f')]][_0x29f6('0x62')]=_0x373cf6[_0x29f6('0x66')](this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x2f')]][_0x29f6('0x47')],_0x29f6('0x59'));}}if(_0x2f54eb['calleridnum']!=='xcally-motion-preview'){this['channels'][_0x2f54eb[_0x29f6('0x2f')]][_0x29f6('0x3c')]=_0x2f54eb['calleridnum'];}this[_0x29f6('0x11')][_0x2f54eb['uniqueid']][_0x29f6('0x63')]=_0x2f54eb[_0x29f6('0x30')];this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x2f')]][_0x29f6('0x67')]=_0x2f54eb[_0x29f6('0x38')];this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x2f')]][_0x29f6('0x49')]=dispositions[_[_0x29f6('0x68')](_0x2f54eb['channelstate'])];}}else{if(this[_0x29f6('0x11')][_0x2f54eb['uniqueid']]){if(this[_0x29f6('0x12')][_0x2f54eb[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]]){this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x2f')]][_0x29f6('0x64')]=this[_0x29f6('0x12')][_0x2f54eb[_0x29f6('0x38')]['split']('-')[0x0]]['id'];this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x2f')]]['membername']=this['agents'][_0x2f54eb[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]][_0x29f6('0x3f')];}}}if(_0x2f54eb[_0x29f6('0x36')]===_0x29f6('0x37')){if(this[_0x29f6('0x12')][_0x2f54eb[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]]){this[_0x29f6('0x12')][_0x2f54eb[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]][_0x29f6('0x3b')]=_0x2f54eb['exten'];var _0x4b9631,_0x2e2f16;if(this[_0x29f6('0x11')][_0x2f54eb['uniqueid']]){_0x4b9631=this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x2f')]][_0x29f6('0x69')];_0x2e2f16=this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x2f')]][_0x29f6('0x55')];}else if(this[_0x29f6('0x11')][_0x2f54eb['linkedid']]){_0x4b9631=this[_0x29f6('0x11')][_0x2f54eb[_0x29f6('0x34')]][_0x29f6('0x69')];_0x2e2f16=this['channels'][_0x2f54eb[_0x29f6('0x34')]][_0x29f6('0x55')];}logger['debug'](_0x29f6('0x6a'),_0x2f54eb[_0x29f6('0x2f')],util['inspect']({'id':this[_0x29f6('0x12')][_0x2f54eb['channel'][_0x29f6('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0x29f6('0x12')][_0x2f54eb[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]][_0x29f6('0x41')],'destconnectedlinenum':_0x2f54eb[_0x29f6('0x46')],'routealias':_0x4b9631,'queue':_0x2e2f16||undefined},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x29f6('0x3e'),this[_0x29f6('0x12')][_0x2f54eb['channel'][_0x29f6('0x3a')]('-')[0x0]]['name']),_0x29f6('0x40'),{'id':this[_0x29f6('0x12')][_0x2f54eb[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x29f6('0x12')][_0x2f54eb[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x2f54eb[_0x29f6('0x46')],'routealias':_0x4b9631,'queue':_0x2e2f16||undefined});}}}}catch(_0x365b6d){logger[_0x29f6('0x42')]('[%s][voiceCallReport][newstate]',_0x2f54eb['uniqueid'],util['inspect'](_0x365b6d,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x29f6('0x6b')]=function(_0x4b01f6,_0x537a8d){try{if(this['channels'][_0x4b01f6]){logger[_0x29f6('0x26')](_0x29f6('0x6c'),_0x4b01f6,_0x537a8d);this[_0x29f6('0x11')][_0x4b01f6][_0x29f6('0x6d')]=!![];if(_[_0x29f6('0x6e')](_0x537a8d,'.wav49')){_0x537a8d=_0x537a8d[_0x29f6('0x6f')]('.wav49',_0x29f6('0x70'));}this[_0x29f6('0x11')][_0x4b01f6][_0x29f6('0x71')]=_0x537a8d;var _0x13a81b=_['find'](this['channels'][_0x4b01f6][_0x29f6('0x72')],{'filename':_0x537a8d});if(_[_0x29f6('0x73')](_0x13a81b)){this[_0x29f6('0x11')][_0x4b01f6]['monitors'][_0x29f6('0x74')]({'filename':_0x537a8d,'createdAt':moment()[_0x29f6('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x29f6('0x75')});}}}catch(_0x3b29ba){logger[_0x29f6('0x42')](_0x29f6('0x76'),_0x4b01f6,util[_0x29f6('0x29')](_0x3b29ba,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x29f6('0x2a')][_0x29f6('0x77')]=function(_0x1602e4){try{if(this[_0x29f6('0x2b')](_0x1602e4)){logger[_0x29f6('0x32')]('[%s][voiceCallReport][varset]\x20event:',_0x1602e4[_0x29f6('0x2f')],util['inspect'](_0x1602e4,{'showHidden':![],'depth':null}));if(this['channels'][_0x1602e4['uniqueid']]&&_0x1602e4[_0x29f6('0x38')]!=_0x29f6('0x4f')){if(this['isNotNull'](_0x1602e4['variable'])){if(this[_0x29f6('0x2b')](_0x1602e4[_0x29f6('0x78')]['mixmonitor_filename'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x1602e4['uniqueid'],_0x1602e4[_0x29f6('0x79')]);this['syncMixMonitorFilename'](_0x1602e4[_0x29f6('0x2f')],_0x1602e4[_0x29f6('0x79')]);}else if(this['isNotNull'](_0x1602e4[_0x29f6('0x78')][_0x29f6('0x7a')])){logger['info'](_0x29f6('0x7b'),_0x1602e4[_0x29f6('0x2f')],_0x1602e4[_0x29f6('0x79')]);this[_0x29f6('0x11')][_0x1602e4[_0x29f6('0x2f')]][_0x29f6('0x31')]=_0x1602e4[_0x29f6('0x79')];}else if(this[_0x29f6('0x2b')](_0x1602e4[_0x29f6('0x78')][_0x29f6('0x7c')])){logger[_0x29f6('0x26')](_0x29f6('0x7d'),_0x1602e4[_0x29f6('0x2f')],_0x1602e4[_0x29f6('0x79')]);this['channels'][_0x1602e4[_0x29f6('0x2f')]][_0x29f6('0x7e')]=_0x1602e4[_0x29f6('0x79')];}else if(this[_0x29f6('0x2b')](_0x1602e4[_0x29f6('0x78')][_0x29f6('0x7f')])){logger[_0x29f6('0x26')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x1602e4[_0x29f6('0x2f')],_0x1602e4['value']);this[_0x29f6('0x11')][_0x1602e4[_0x29f6('0x2f')]][_0x29f6('0x5e')]=_0x1602e4[_0x29f6('0x79')];}else if(this[_0x29f6('0x2b')](_0x1602e4[_0x29f6('0x78')][_0x29f6('0x80')])){logger[_0x29f6('0x26')](_0x29f6('0x81'),_0x1602e4['uniqueid'],_0x1602e4[_0x29f6('0x79')][_0x29f6('0x3a')](',')[0x0]);this['channels'][_0x1602e4['uniqueid']][_0x29f6('0x55')]=_0x1602e4[_0x29f6('0x79')][_0x29f6('0x3a')](',')[0x0];}else if(this[_0x29f6('0x2b')](_0x1602e4['variable'][_0x29f6('0x82')])){logger[_0x29f6('0x26')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x1602e4[_0x29f6('0x2f')],_0x1602e4[_0x29f6('0x79')]);this[_0x29f6('0x11')][_0x1602e4[_0x29f6('0x2f')]][_0x29f6('0x83')]=_0x1602e4[_0x29f6('0x79')];}else if(this[_0x29f6('0x2b')](_0x1602e4[_0x29f6('0x78')][_0x29f6('0x84')])){logger[_0x29f6('0x26')](_0x29f6('0x85'),_0x1602e4[_0x29f6('0x2f')],_0x1602e4[_0x29f6('0x79')]);this['channels'][_0x1602e4[_0x29f6('0x2f')]][_0x29f6('0x86')]=_0x1602e4[_0x29f6('0x79')];}else if(this[_0x29f6('0x2b')](_0x1602e4['variable'][_0x29f6('0x87')])){logger[_0x29f6('0x26')](_0x29f6('0x88'),_0x1602e4['uniqueid'],_0x1602e4[_0x29f6('0x79')]);this[_0x29f6('0x11')][_0x1602e4['uniqueid']][_0x29f6('0x89')]=_0x1602e4[_0x29f6('0x79')];}else if(this[_0x29f6('0x2b')](_0x1602e4[_0x29f6('0x78')][_0x29f6('0x8a')])){logger[_0x29f6('0x26')](_0x29f6('0x8b'),_0x1602e4[_0x29f6('0x2f')],_0x1602e4[_0x29f6('0x79')]);this[_0x29f6('0x11')][_0x1602e4[_0x29f6('0x2f')]]['queue']=_0x1602e4['value'];}else if(this[_0x29f6('0x2b')](_0x1602e4[_0x29f6('0x78')][_0x29f6('0x8c')])){logger[_0x29f6('0x26')](_0x29f6('0x8d'),_0x1602e4[_0x29f6('0x2f')],_0x1602e4[_0x29f6('0x79')]);this[_0x29f6('0x11')][_0x1602e4['uniqueid']]['sipcalluniqueid']=_0x1602e4['value'];}}}else if(this[_0x29f6('0x2b')](_0x1602e4[_0x29f6('0x78')][_0x29f6('0x8e')])){if(_0x1602e4[_0x29f6('0x79')]){var _0x5e0010=path[_0x29f6('0x8f')](_0x1602e4[_0x29f6('0x79')])['name'];logger[_0x29f6('0x26')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x5e0010,_0x1602e4[_0x29f6('0x79')]);this[_0x29f6('0x6b')](_0x5e0010,_0x1602e4[_0x29f6('0x79')]);}}else if(this[_0x29f6('0x11')][_0x1602e4['linkedid']]){if(this[_0x29f6('0x2b')](_0x1602e4['variable'])){if(this[_0x29f6('0x2b')](_0x1602e4[_0x29f6('0x78')][_0x29f6('0x8c')])){logger[_0x29f6('0x26')](_0x29f6('0x8d'),_0x1602e4[_0x29f6('0x34')],_0x1602e4['value']);this['channels'][_0x1602e4[_0x29f6('0x34')]]['sipcalllinkedid']=_0x1602e4['value'];}}}}}catch(_0xcdc249){logger['error'](_0x29f6('0x90'),_0x1602e4[_0x29f6('0x2f')],util[_0x29f6('0x29')](_0xcdc249,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x29f6('0x2a')][_0x29f6('0x1d')]=function(_0x35846c){try{if(this['isNotNull'](_0x35846c)){logger[_0x29f6('0x32')](_0x29f6('0x91'),_0x35846c[_0x29f6('0x2f')],util[_0x29f6('0x29')](_0x35846c,{'showHidden':![],'depth':null}));if(this[_0x29f6('0x13')][_0x35846c[_0x29f6('0x34')]]){if(this[_0x29f6('0x11')][this[_0x29f6('0x13')][_0x35846c[_0x29f6('0x34')]][_0x29f6('0x34')]]){this[_0x29f6('0x11')][this['blindTransfers'][_0x35846c[_0x29f6('0x34')]][_0x29f6('0x34')]]['uniqueid']=_0x35846c[_0x29f6('0x2f')];this[_0x29f6('0x11')][this[_0x29f6('0x13')][_0x35846c['linkedid']]['linkedid']][_0x29f6('0x61')]=this[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]][_0x29f6('0x61')];this[_0x29f6('0x11')][this[_0x29f6('0x13')][_0x35846c['linkedid']][_0x29f6('0x34')]][_0x29f6('0x65')]=this['channels'][_0x35846c['uniqueid']]['answertime'];this[_0x29f6('0x11')][this['blindTransfers'][_0x35846c[_0x29f6('0x34')]]['linkedid']][_0x29f6('0x67')]=this[_0x29f6('0x11')][this[_0x29f6('0x13')][_0x35846c[_0x29f6('0x34')]][_0x29f6('0x34')]]['channel'];this[_0x29f6('0x11')][this['blindTransfers'][_0x35846c[_0x29f6('0x34')]][_0x29f6('0x34')]][_0x29f6('0x49')]=this[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]][_0x29f6('0x49')];this[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]]=this['channels'][this[_0x29f6('0x13')][_0x35846c['linkedid']][_0x29f6('0x34')]];delete this[_0x29f6('0x11')][this['blindTransfers'][_0x35846c[_0x29f6('0x34')]]['linkedid']];}else if(this[_0x29f6('0x11')][this[_0x29f6('0x13')][_0x35846c['linkedid']][_0x29f6('0x2f')]]){this[_0x29f6('0x11')][this['blindTransfers'][_0x35846c[_0x29f6('0x34')]][_0x29f6('0x2f')]][_0x29f6('0x2f')]=[this[_0x29f6('0x11')][this[_0x29f6('0x13')][_0x35846c[_0x29f6('0x34')]][_0x29f6('0x2f')]][_0x29f6('0x34')],this['channels'][this[_0x29f6('0x13')][_0x35846c[_0x29f6('0x34')]][_0x29f6('0x2f')]][_0x29f6('0x34')]=this['channels'][this[_0x29f6('0x13')][_0x35846c[_0x29f6('0x34')]][_0x29f6('0x2f')]][_0x29f6('0x2f')]][0x0];this[_0x29f6('0x11')][this['blindTransfers'][_0x35846c['linkedid']][_0x29f6('0x2f')]][_0x29f6('0x61')]=this['channels'][_0x35846c[_0x29f6('0x2f')]]['answered'];this['channels'][this[_0x29f6('0x13')][_0x35846c['linkedid']][_0x29f6('0x2f')]][_0x29f6('0x65')]=this[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]]['answertime'];this[_0x29f6('0x11')][this[_0x29f6('0x13')][_0x35846c[_0x29f6('0x34')]][_0x29f6('0x2f')]][_0x29f6('0x67')]=this[_0x29f6('0x11')][this['blindTransfers'][_0x35846c['linkedid']][_0x29f6('0x2f')]][_0x29f6('0x38')];this[_0x29f6('0x11')][this[_0x29f6('0x13')][_0x35846c[_0x29f6('0x34')]][_0x29f6('0x2f')]][_0x29f6('0x49')]=this[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]][_0x29f6('0x49')];this[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]]=this[_0x29f6('0x11')][this[_0x29f6('0x13')][_0x35846c[_0x29f6('0x34')]]['uniqueid']];delete this[_0x29f6('0x11')][this[_0x29f6('0x13')][_0x35846c[_0x29f6('0x34')]][_0x29f6('0x2f')]];}}if(this[_0x29f6('0x11')][_0x35846c['uniqueid']]){logger[_0x29f6('0x26')](_0x29f6('0x92'),_0x35846c[_0x29f6('0x2f')],_0x35846c['cause-txt']);var _0x2378b8=moment();this[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]][_0x29f6('0x93')]=_0x2378b8['format'](_0x29f6('0x48'));this['channels'][_0x35846c[_0x29f6('0x2f')]]['duration']=_0x2378b8[_0x29f6('0x66')](this[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]][_0x29f6('0x47')],'seconds');if(this[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]][_0x29f6('0x61')]){this[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]][_0x29f6('0x94')]=_0x2378b8[_0x29f6('0x66')](this[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]][_0x29f6('0x65')],_0x29f6('0x59'));this[_0x29f6('0x11')][_0x35846c['uniqueid']][_0x29f6('0x62')]=this[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]][_0x29f6('0x57')]-this[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]][_0x29f6('0x94')];}if(_0x35846c[_0x29f6('0x36')]==='from-sip'){if(this[_0x29f6('0x12')][_0x35846c['channel']['split']('-')[0x0]]){this[_0x29f6('0x12')][_0x35846c['channel'][_0x29f6('0x3a')]('-')[0x0]]=_[_0x29f6('0x95')](this['agents'][_0x35846c[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]],[_0x29f6('0x3b')]);logger[_0x29f6('0x32')](_0x29f6('0x96'),_0x35846c[_0x29f6('0x2f')],util[_0x29f6('0x29')]({'id':this['agents'][_0x35846c[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0x29f6('0x12')][_0x35846c[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]][_0x29f6('0x41')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x29f6('0x3d')](_0x29f6('0x3e'),this['agents'][_0x35846c[_0x29f6('0x38')][_0x29f6('0x3a')]('-')[0x0]]['name']),_0x29f6('0x97'),{'id':this[_0x29f6('0x12')][_0x35846c['channel'][_0x29f6('0x3a')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x35846c['channel'][_0x29f6('0x3a')]('-')[0x0]][_0x29f6('0x41')]});for(var _0x35cdca=0x0;_0x35cdca<Object[_0x29f6('0x5a')](this['agents'])['length'];_0x35cdca++){var _0x5235cb=Object[_0x29f6('0x5a')](this[_0x29f6('0x12')])[_0x35cdca];var _0x26ade6=this[_0x29f6('0x12')][_0x5235cb];if(_0x26ade6[_0x29f6('0x41')]===Number(_0x35846c[_0x29f6('0x3c')])){this[_0x29f6('0x2d')](util[_0x29f6('0x3d')](_0x29f6('0x3e'),_0x26ade6[_0x29f6('0x3f')]),_0x29f6('0x97'),{'id':_0x26ade6['id'],'destaccountcode':_0x26ade6[_0x29f6('0x41')],'transfer':this['channels'][_0x35846c['uniqueid']][_0x29f6('0x98')]});break;}}}}var _0x3b83ee=this;Promise['resolve']()[_0x29f6('0x99')](function(){var _0x3c9d00=_0x3b83ee['channels'][_0x35846c['uniqueid']];if(typeof _0x3c9d00['transferType']===_0x29f6('0x9a'))return;if(_[_0x29f6('0x9b')](_0x3c9d00[_0x29f6('0x72')]))return;return RpcSetting[_0x29f6('0x9c')]()['then'](function(_0x2c501a){if(!_0x2c501a[_0x29f6('0x9d')])return;return Promise[_0x29f6('0x9e')]()[_0x29f6('0x99')](function(){return ami[_0x29f6('0x9f')]({'action':_0x29f6('0xa0'),'channel':_0x3c9d00[_0x29f6('0x38')]})[_0x29f6('0xa1')](function(){});})[_0x29f6('0x99')](function(){return ami['Action']({'action':_0x29f6('0xa0'),'channel':_0x3c9d00[_0x29f6('0x67')]})[_0x29f6('0xa1')](function(){})[_0x29f6('0xa2')](function(){var _0x59fb2a=_0x3b83ee['agents'][_0x3c9d00[_0x29f6('0x67')][_0x29f6('0x3a')]('-')[0x0]];if(!_0x59fb2a)return;io[_0x29f6('0x2d')](_0x29f6('0xa3'),{'agentId':_0x59fb2a['id'],'uniqueid':_0x3c9d00[_0x29f6('0x2f')]});});});});})['then'](function(){if(_0x35846c[_0x29f6('0xa4')]===_0x29f6('0xa5')){_0x3b83ee[_0x29f6('0x13')][_0x35846c[_0x29f6('0x2f')]]=_0x35846c;}else{if(_0x3b83ee[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]][_0x29f6('0x5e')]==='outbound'&&_0x3b83ee[_0x29f6('0x13')][_0x35846c[_0x29f6('0x2f')]]){_0x3b83ee[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]]['uniqueid']=[_0x3b83ee[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]][_0x29f6('0x34')],_0x3b83ee[_0x29f6('0x11')][_0x35846c['uniqueid']][_0x29f6('0x34')]=_0x3b83ee[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]]['uniqueid']][0x0];delete _0x3b83ee[_0x29f6('0x13')][_0x35846c[_0x29f6('0x2f')]];}}logger[_0x29f6('0x32')](_0x29f6('0xa6'),_0x35846c['uniqueid'],util[_0x29f6('0x29')](_0x3b83ee[_0x29f6('0x11')][_0x35846c['uniqueid']],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceCallReport',_0x3b83ee[_0x29f6('0x11')][_0x35846c[_0x29f6('0x2f')]]);delete _0x3b83ee['channels'][_0x35846c[_0x29f6('0x2f')]];});}}}catch(_0x171342){logger[_0x29f6('0x42')](_0x29f6('0xa7'),_0x35846c[_0x29f6('0x2f')],util['inspect'](_0x171342,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x29f6('0x2a')][_0x29f6('0x21')]=function(_0x1207f7){try{if(this[_0x29f6('0x2b')](_0x1207f7)){logger[_0x29f6('0x26')](_0x29f6('0xa8'),_0x1207f7[_0x29f6('0x2f')],_0x1207f7[_0x29f6('0xa9')],_0x1207f7[_0x29f6('0xaa')]);logger[_0x29f6('0x32')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x1207f7[_0x29f6('0x2f')],util[_0x29f6('0x29')](_0x1207f7,{'showHidden':![],'depth':null}));var _0x56bfe5;if(this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xab')]]){this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xab')]][_0x29f6('0xac')]=_0x1207f7['origtransferercalleridnum'];this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xab')]][_0x29f6('0xad')]=_0x1207f7['transfertargetcalleridnum'];if(this['channels'][_0x1207f7[_0x29f6('0xae')]]){_0x56bfe5=this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xae')]];this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xae')]]=this[_0x29f6('0x11')][_0x1207f7['transfereeuniqueid']];this['channels'][_0x1207f7[_0x29f6('0xab')]]=_0x56bfe5;}this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xae')]][_0x29f6('0x98')]=_0x29f6('0xaf');}else if(this[_0x29f6('0x11')][_0x1207f7['transfertargetuniqueid']]){this['channels'][_0x1207f7[_0x29f6('0xb0')]][_0x29f6('0xac')]=_0x1207f7[_0x29f6('0xa9')];this['channels'][_0x1207f7['transfertargetuniqueid']]['transferconnectedlinenum']=_0x1207f7[_0x29f6('0xaa')];if(this['channels'][_0x1207f7[_0x29f6('0xb1')]]){_0x56bfe5=this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xb1')]];this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xb1')]]=this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xb0')]];this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xb0')]]=_0x56bfe5;}this['channels'][_0x1207f7[_0x29f6('0xb0')]][_0x29f6('0x98')]='ATTENDED';}if((this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xb1')]]||this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xb2')]])&&this['channels'][_0x1207f7['secondtransfereruniqueid']]){var _0x128fa0=_[_0x29f6('0xb3')]([this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xb1')]],this[_0x29f6('0x11')][_0x1207f7['origtransfererlinkedid']],this['channels'][_0x1207f7[_0x29f6('0xae')]]],function(_0x216ad8){return _0x216ad8&&_0x216ad8['type']==='outbound'&&_0x216ad8['routeid'];});if(_0x128fa0){if(this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xb1')]])this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xb1')]][_0x29f6('0x98')]='ATTENDED';if(this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xb2')]])this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xb2')]][_0x29f6('0x98')]='ATTENDED';this[_0x29f6('0x11')][_0x1207f7[_0x29f6('0xae')]][_0x29f6('0x98')]=_0x29f6('0xaf');}}}}catch(_0x2ed291){logger[_0x29f6('0x42')](_0x29f6('0xb4'),_0x1207f7[_0x29f6('0x2f')],util['inspect'](_0x2ed291,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x29f6('0x2a')][_0x29f6('0x23')]=function(_0x540e3a){try{if(this[_0x29f6('0x2b')](_0x540e3a)){logger[_0x29f6('0x26')](_0x29f6('0xb5'),_0x540e3a['uniqueid'],_0x540e3a['transfereecalleridnum'],_0x540e3a['extension']);logger['debug'](_0x29f6('0xb6'),_0x540e3a[_0x29f6('0x2f')],util[_0x29f6('0x29')](_0x540e3a,{'showHidden':![],'depth':null}));if(this[_0x29f6('0x11')][_0x540e3a[_0x29f6('0xab')]]){this[_0x29f6('0x11')][_0x540e3a[_0x29f6('0xab')]][_0x29f6('0xac')]=_0x540e3a[_0x29f6('0xb7')];this[_0x29f6('0x11')][_0x540e3a['transfereeuniqueid']][_0x29f6('0xad')]=_0x540e3a['extension'];this[_0x29f6('0x11')][_0x540e3a[_0x29f6('0xab')]][_0x29f6('0x98')]=_0x29f6('0xb8');this[_0x29f6('0x1d')]({'event':_0x29f6('0xa5'),'uniqueid':_0x540e3a[_0x29f6('0xab')],'linkedid':_0x540e3a[_0x29f6('0xb9')],'context':_0x540e3a[_0x29f6('0x36')],'channel':_0x540e3a['transfererchannel']});}else{this['channels'][_0x540e3a[_0x29f6('0xb9')]]['transferType']=_0x29f6('0xb8');this[_0x29f6('0x1d')]({'event':_0x29f6('0xa5'),'uniqueid':_0x540e3a[_0x29f6('0xb9')],'linkedid':_0x540e3a[_0x29f6('0xab')],'context':_0x540e3a['context'],'channel':_0x540e3a[_0x29f6('0xba')]});}}}catch(_0x5cc588){logger[_0x29f6('0x42')](_0x29f6('0xbb'),_0x540e3a[_0x29f6('0x2f')],util[_0x29f6('0x29')](_0x5cc588,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x29f6('0x2a')][_0x29f6('0x24')]=function(_0x346ece){try{if(this[_0x29f6('0x2b')](_0x346ece)){logger[_0x29f6('0x32')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x346ece[_0x29f6('0x2f')],util['inspect'](_0x346ece,{'showHidden':![],'depth':null}));if(this[_0x29f6('0x11')][_0x346ece[_0x29f6('0x2f')]]){if(!_['isNil'](this['channels'][_0x346ece[_0x29f6('0x2f')]][_0x29f6('0x65')])){this['channels'][_0x346ece[_0x29f6('0x2f')]][_0x29f6('0xbc')]=moment()[_0x29f6('0x3d')](_0x29f6('0x48'));logger[_0x29f6('0x26')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x346ece['uniqueid'],this[_0x29f6('0x11')][_0x346ece['uniqueid']][_0x29f6('0xbc')]);}}}}catch(_0x354dba){logger['error'](_0x29f6('0xbd'),_0x346ece[_0x29f6('0x2f')],util['inspect'](_0x354dba,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x29f6('0x2a')][_0x29f6('0x25')]=function(_0x5eb090){try{if(this['isNotNull'](_0x5eb090)){logger[_0x29f6('0x32')](_0x29f6('0xbe'),_0x5eb090[_0x29f6('0x2f')],util[_0x29f6('0x29')](_0x5eb090,{'showHidden':![],'depth':null}));if(this[_0x29f6('0x11')][_0x5eb090[_0x29f6('0x2f')]]){if(!_[_0x29f6('0x73')](this[_0x29f6('0x11')][_0x5eb090[_0x29f6('0x2f')]][_0x29f6('0xbc')])){this[_0x29f6('0x11')][_0x5eb090[_0x29f6('0x2f')]][_0x29f6('0xbf')]+=moment()[_0x29f6('0xc0')](0x0)[_0x29f6('0x66')](this[_0x29f6('0x11')][_0x5eb090[_0x29f6('0x2f')]][_0x29f6('0xbc')],_0x29f6('0x59'));logger[_0x29f6('0x26')](_0x29f6('0xc1'),_0x5eb090['uniqueid'],this[_0x29f6('0x11')][_0x5eb090[_0x29f6('0x2f')]][_0x29f6('0xbf')]);delete this[_0x29f6('0x11')][_0x5eb090['uniqueid']]['mohstarttime'];}}}}catch(_0xad9431){logger[_0x29f6('0x42')](_0x29f6('0xc2'),_0x5eb090['uniqueid'],util[_0x29f6('0x29')](_0xad9431,{'showHidden':![],'depth':null}));}};module[_0x29f6('0xc3')]=VoiceCallReport;
\ No newline at end of file
+var _0xd0bb=['answered','answertime','holdtime','calleridname','destinationchannel','UserId','membername','diff','connectedlinename','routealias','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','replace','.wav49','.WAV','monitorFilename','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','xmd-callerid','callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-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','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','length','user:agentcomplete','transferType','resolve','then','isEmpty','stopRecordingOnTransfer','Action','catch','StopMixMonitor','finally','webbar:stopmonitors','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','origtransferercalleridnum','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','transfertargetcalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','outbound','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','extension','BLIND','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','exports','lodash','moment','util','ioredis','../../../config/logger','ami','../model/channel','set','queue','agi','dial','playback','NO\x20ANSWER','FAILED','BUSY','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','bind','newchannel','syncNewChannel','newstate','varset','syncVarSet','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','debug','[%s][voiceCallReport][newcallerid]\x20event:','inspect','linkedid','merge','pick','keys','context','from-sip','channel','split','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','error','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newchannel]','syncNewExten','[%s][voiceCallReport][newexten]\x20event:','application','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','lastapplication','lastdata','toLowerCase','cdr(','match','type','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridnum','[%s][voiceCallReport][newstate]\x20event:'];(function(_0x382468,_0x58c017){var _0x6ccd19=function(_0x4be140){while(--_0x4be140){_0x382468['push'](_0x382468['shift']());}};_0x6ccd19(++_0x58c017);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x4cb095,_0x58da07){_0x4cb095=_0x4cb095-0x0;var _0x2b565d=_0xd0bb[_0x4cb095];return _0x2b565d;};'use strict';var _=require(_0xbd0b('0x0'));var moment=require(_0xbd0b('0x1'));var util=require(_0xbd0b('0x2'));var path=require('path');var Redis=require(_0xbd0b('0x3'));var config=require('../../../config/environment');var logger=require(_0xbd0b('0x4'))(_0xbd0b('0x5'));var ami=require('../ami');var Channel=require(_0xbd0b('0x6'));var RpcSetting=require('../rpc/setting');var applications=[_0xbd0b('0x7'),_0xbd0b('0x8'),_0xbd0b('0x9'),_0xbd0b('0xa'),_0xbd0b('0xb'),'voicemail'];var dispositions=[_0xbd0b('0xc'),_0xbd0b('0xd'),_0xbd0b('0xd'),_0xbd0b('0xc'),_0xbd0b('0xc'),'NO\x20ANSWER','ANSWERED',_0xbd0b('0xe'),_0xbd0b('0xd'),'FAILED',_0xbd0b('0xd')];config[_0xbd0b('0xf')]=_['defaults'](config[_0xbd0b('0xf')],{'host':_0xbd0b('0x10'),'port':0x18eb});var io=require(_0xbd0b('0x11'))(new Redis(config[_0xbd0b('0xf')]));function VoiceCallReport(_0x2621bf){this[_0xbd0b('0x12')]=_0x2621bf[_0xbd0b('0x12')];this[_0xbd0b('0x13')]=_0x2621bf[_0xbd0b('0x13')];this[_0xbd0b('0x14')]={};ami['on'](_0xbd0b('0x15'),this['syncNewExten'][_0xbd0b('0x16')](this));ami['on']('newexten',this['syncNewExten'][_0xbd0b('0x16')](this));ami['on'](_0xbd0b('0x17'),this[_0xbd0b('0x18')][_0xbd0b('0x16')](this));ami['on'](_0xbd0b('0x19'),this['syncNewState']['bind'](this));ami['on'](_0xbd0b('0x1a'),this[_0xbd0b('0x1b')][_0xbd0b('0x16')](this));ami['on'](_0xbd0b('0x1c'),this[_0xbd0b('0x1d')][_0xbd0b('0x16')](this));ami['on']('newcallerid',this[_0xbd0b('0x1e')]['bind'](this));ami['on'](_0xbd0b('0x1f'),this[_0xbd0b('0x20')][_0xbd0b('0x16')](this));ami['on'](_0xbd0b('0x21'),this['syncBlindTransfer'][_0xbd0b('0x16')](this));ami['on'](_0xbd0b('0x22'),this[_0xbd0b('0x23')]['bind'](this));ami['on'](_0xbd0b('0x24'),this['syncMusicOnHoldStop'][_0xbd0b('0x16')](this));try{logger[_0xbd0b('0x25')](_0xbd0b('0x26'));ami[_0xbd0b('0x27')]();}catch(_0x297c85){logger['error'](_0xbd0b('0x28'),util['inspect'](_0x297c85,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xbd0b('0x29')][_0xbd0b('0x2a')]=function(_0x4b0924){return _0x4b0924!==null&&!_[_0xbd0b('0x2b')](_0x4b0924);};VoiceCallReport[_0xbd0b('0x29')][_0xbd0b('0x2c')]=function(_0x4fe9ed,_0x382f76,_0x1b46a3){io['to'](_0x4fe9ed)[_0xbd0b('0x2c')](_0x382f76,_0x1b46a3);};VoiceCallReport[_0xbd0b('0x29')][_0xbd0b('0x1e')]=function(_0x122893){try{if(this['isNotNull'](_0x122893)){logger[_0xbd0b('0x25')](_0xbd0b('0x2d'),_0x122893[_0xbd0b('0x2e')],_0x122893['calleridname'],_0x122893['calleridnum']);logger[_0xbd0b('0x2f')](_0xbd0b('0x30'),_0x122893[_0xbd0b('0x2e')],util[_0xbd0b('0x31')](_0x122893,{'showHidden':![],'depth':null}));if(_0x122893[_0xbd0b('0x2e')]===_0x122893[_0xbd0b('0x32')]){if(!_[_0xbd0b('0x2b')](this['channels'][_0x122893[_0xbd0b('0x2e')]])){_[_0xbd0b('0x33')](this['channels'][_0x122893['uniqueid']],_[_0xbd0b('0x34')](_0x122893,_[_0xbd0b('0x35')](this['channels'][_0x122893[_0xbd0b('0x2e')]])));}}if(_0x122893[_0xbd0b('0x36')]===_0xbd0b('0x37')){if(this[_0xbd0b('0x13')][_0x122893[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]]){if(_0x122893['exten']==_0xbd0b('0x3a')){this[_0xbd0b('0x13')][_0x122893[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]][_0xbd0b('0x3b')]=_0x122893[_0xbd0b('0x3c')];this[_0xbd0b('0x2c')](util[_0xbd0b('0x3d')](_0xbd0b('0x3e'),this[_0xbd0b('0x13')][_0x122893[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]][_0xbd0b('0x3f')]),_0xbd0b('0x40'),{'destaccountcode':this['agents'][_0x122893[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x122893[_0xbd0b('0x3c')]});}}}}}catch(_0x1145b6){logger[_0xbd0b('0x41')](_0xbd0b('0x42'),_0x122893[_0xbd0b('0x2e')],util[_0xbd0b('0x31')](_0x1145b6,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xbd0b('0x18')]=function(_0x11cf5a){try{if(this[_0xbd0b('0x2a')](_0x11cf5a)){logger[_0xbd0b('0x2f')](_0xbd0b('0x43'),_0x11cf5a['uniqueid'],util['inspect'](_0x11cf5a,{'showHidden':![],'depth':null}));if(this[_0xbd0b('0x12')][_0x11cf5a[_0xbd0b('0x2e')]])return;if(_0x11cf5a[_0xbd0b('0x38')]===_0xbd0b('0x44'))return;if(_0x11cf5a['uniqueid']!==_0x11cf5a['linkedid']&&!this[_0xbd0b('0x14')][_0x11cf5a['linkedid']])return;logger[_0xbd0b('0x25')](_0xbd0b('0x45'),_0x11cf5a[_0xbd0b('0x2e')],_0x11cf5a[_0xbd0b('0x36')],_0x11cf5a[_0xbd0b('0x46')]);this[_0xbd0b('0x12')][_0x11cf5a[_0xbd0b('0x2e')]]=new Channel();this[_0xbd0b('0x12')][_0x11cf5a[_0xbd0b('0x2e')]][_0xbd0b('0x47')]=moment()[_0xbd0b('0x3d')](_0xbd0b('0x48'));this[_0xbd0b('0x12')][_0x11cf5a[_0xbd0b('0x2e')]][_0xbd0b('0x49')]=dispositions[_[_0xbd0b('0x4a')](_0x11cf5a[_0xbd0b('0x4b')])];_[_0xbd0b('0x33')](this['channels'][_0x11cf5a[_0xbd0b('0x2e')]],_[_0xbd0b('0x34')](_0x11cf5a,_[_0xbd0b('0x35')](this[_0xbd0b('0x12')][_0x11cf5a[_0xbd0b('0x2e')]])));if(_0x11cf5a[_0xbd0b('0x36')]===_0xbd0b('0x37')){if(this[_0xbd0b('0x13')][_0x11cf5a[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]]){if(_[_0xbd0b('0x2b')](this[_0xbd0b('0x13')][_0x11cf5a['channel'][_0xbd0b('0x39')]('-')[0x0]]['destconnectedlinenum'])){this['agents'][_0x11cf5a[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]][_0xbd0b('0x3b')]=_0x11cf5a['exten'];logger[_0xbd0b('0x2f')](_0xbd0b('0x4c'),_0x11cf5a[_0xbd0b('0x2e')],util[_0xbd0b('0x31')]({'id':this[_0xbd0b('0x13')][_0x11cf5a['channel'][_0xbd0b('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0xbd0b('0x13')][_0x11cf5a[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]][_0xbd0b('0x4d')],'destconnectedlinenum':_0x11cf5a[_0xbd0b('0x46')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xbd0b('0x3d')](_0xbd0b('0x3e'),this[_0xbd0b('0x13')][_0x11cf5a[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]][_0xbd0b('0x3f')]),_0xbd0b('0x40'),{'id':this[_0xbd0b('0x13')][_0x11cf5a[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0xbd0b('0x13')][_0x11cf5a[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]][_0xbd0b('0x4d')],'destconnectedlinenum':_0x11cf5a[_0xbd0b('0x46')]});}}}}}catch(_0x2dd416){logger[_0xbd0b('0x41')](_0xbd0b('0x4e'),_0x11cf5a[_0xbd0b('0x2e')],util[_0xbd0b('0x31')](_0x2dd416,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbd0b('0x29')][_0xbd0b('0x4f')]=function(_0x915d2c){try{if(this['isNotNull'](_0x915d2c)){logger[_0xbd0b('0x2f')](_0xbd0b('0x50'),_0x915d2c['uniqueid'],util['inspect'](_0x915d2c,{'showHidden':![],'depth':null}));if(_0x915d2c['channel']===_0xbd0b('0x44')||_0x915d2c['exten']==='h')return;if(_0x915d2c[_0xbd0b('0x2e')]===_0x915d2c[_0xbd0b('0x32')]||this[_0xbd0b('0x14')][_0x915d2c[_0xbd0b('0x32')]]){_0x915d2c['application']=_0x915d2c[_0xbd0b('0x51')]['toLowerCase']();_0x915d2c[_0xbd0b('0x52')]=_0x915d2c['appdata']||_0x915d2c['applicationdata'];if(_0x915d2c[_0xbd0b('0x53')]&&!_0x915d2c[_0xbd0b('0x53')][_0xbd0b('0x54')](_0xbd0b('0x55'))&&_0x915d2c[_0xbd0b('0x51')]!==_0xbd0b('0x8')){_0x915d2c[_0xbd0b('0x52')]=_0x915d2c[_0xbd0b('0x52')]['toLowerCase']();}logger['info'](_0xbd0b('0x56'),_0x915d2c[_0xbd0b('0x2e')],_0x915d2c['application'],_0x915d2c['applicationdata']);if(_[_0xbd0b('0x2b')](this[_0xbd0b('0x12')][_0x915d2c[_0xbd0b('0x2e')]])){this[_0xbd0b('0x12')][_0x915d2c['uniqueid']]=new Channel();this[_0xbd0b('0x12')][_0x915d2c[_0xbd0b('0x2e')]][_0xbd0b('0x47')]=_0x915d2c[_0xbd0b('0x57')]?moment()['subtract'](moment[_0xbd0b('0x57')](_0x915d2c[_0xbd0b('0x57')])['seconds'](),_0xbd0b('0x58'))[_0xbd0b('0x3d')](_0xbd0b('0x48')):moment()[_0xbd0b('0x3d')](_0xbd0b('0x48'));this[_0xbd0b('0x12')][_0x915d2c[_0xbd0b('0x2e')]][_0xbd0b('0x49')]='NO\x20ANSWER';}_[_0xbd0b('0x33')](this[_0xbd0b('0x12')][_0x915d2c[_0xbd0b('0x2e')]],_[_0xbd0b('0x34')](_0x915d2c,_[_0xbd0b('0x35')](this[_0xbd0b('0x12')][_0x915d2c['uniqueid']])));if(_['includes'](applications,_0x915d2c[_0xbd0b('0x51')])){this[_0xbd0b('0x12')][_0x915d2c['uniqueid']][_0xbd0b('0x59')]=_0x915d2c[_0xbd0b('0x51')];this[_0xbd0b('0x12')][_0x915d2c[_0xbd0b('0x2e')]][_0xbd0b('0x5a')]=_0x915d2c['applicationdata'];if(_0x915d2c[_0xbd0b('0x51')]===_0xbd0b('0x7')&&_[_0xbd0b('0x54')](_0x915d2c[_0xbd0b('0x52')][_0xbd0b('0x5b')](),_0xbd0b('0x5c'))){var _0x19e3c0=_0x915d2c[_0xbd0b('0x52')][_0xbd0b('0x39')]('=');var _0x21a22a=_0x19e3c0[0x0][_0xbd0b('0x5b')]()[_0xbd0b('0x5d')](/cdr\((.*)\)/);if(_0x21a22a){if(_0x21a22a[0x1]===_0xbd0b('0x5e')&&!_[_0xbd0b('0x5f')](this[_0xbd0b('0x12')][_0x915d2c[_0xbd0b('0x2e')]][_0x21a22a[0x1]]))return;this[_0xbd0b('0x12')][_0x915d2c['uniqueid']][_0x21a22a[0x1]]=_0x19e3c0[0x1];}}else if(_0x915d2c[_0xbd0b('0x51')]===_0xbd0b('0x8')){this[_0xbd0b('0x12')][_0x915d2c[_0xbd0b('0x2e')]]['queue']=_0x915d2c['applicationdata'][_0xbd0b('0x39')](',')[0x0];}}}}}catch(_0x45c6b5){logger[_0xbd0b('0x41')](_0xbd0b('0x60'),_0x915d2c[_0xbd0b('0x2e')],util['inspect'](_0x45c6b5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbd0b('0x29')]['syncNewState']=function(_0xfed870){try{if(this[_0xbd0b('0x2a')](_0xfed870)){logger[_0xbd0b('0x25')](_0xbd0b('0x61'),_0xfed870[_0xbd0b('0x2e')],_0xfed870[_0xbd0b('0x32')],_0xfed870['calleridname'],_0xfed870[_0xbd0b('0x62')]);logger[_0xbd0b('0x2f')](_0xbd0b('0x63'),_0xfed870[_0xbd0b('0x2e')],util['inspect'](_0xfed870,{'showHidden':![],'depth':null}));if(_0xfed870[_0xbd0b('0x4b')]!=='6')return;if(_0xfed870[_0xbd0b('0x2e')]!==_0xfed870[_0xbd0b('0x32')]){var _0x31cc3c=moment();if(this[_0xbd0b('0x12')][_0xfed870['linkedid']]){if(!this['channels'][_0xfed870[_0xbd0b('0x32')]]['answered']){this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x32')]][_0xbd0b('0x64')]=!![];this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x32')]][_0xbd0b('0x65')]=_0x31cc3c['format'](_0xbd0b('0x48'));if(this['channels'][_0xfed870[_0xbd0b('0x32')]]['starttime']){this['channels'][_0xfed870['linkedid']][_0xbd0b('0x66')]=_0x31cc3c['diff'](this['channels'][_0xfed870[_0xbd0b('0x32')]][_0xbd0b('0x47')],'seconds');}}this[_0xbd0b('0x12')][_0xfed870['linkedid']]['linkedid']=_0xfed870[_0xbd0b('0x2e')];if(_0xfed870[_0xbd0b('0x62')]!==_0xbd0b('0x3a')){this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x32')]][_0xbd0b('0x3c')]=_0xfed870[_0xbd0b('0x62')];}this[_0xbd0b('0x12')][_0xfed870['linkedid']]['connectedlinename']=_0xfed870[_0xbd0b('0x67')];this['channels'][_0xfed870[_0xbd0b('0x32')]][_0xbd0b('0x68')]=_0xfed870[_0xbd0b('0x38')];this['channels'][_0xfed870[_0xbd0b('0x32')]][_0xbd0b('0x49')]=dispositions[_['toNumber'](_0xfed870[_0xbd0b('0x4b')])];if(this[_0xbd0b('0x13')][_0xfed870[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]]){this[_0xbd0b('0x12')][_0xfed870['linkedid']][_0xbd0b('0x69')]=this[_0xbd0b('0x13')][_0xfed870[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]]['id'];this['channels'][_0xfed870[_0xbd0b('0x32')]][_0xbd0b('0x6a')]=this['agents'][_0xfed870[_0xbd0b('0x38')]['split']('-')[0x0]][_0xbd0b('0x3f')];}}if(this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x2e')]]){if(!this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x2e')]]['answered']){this['channels'][_0xfed870['uniqueid']][_0xbd0b('0x64')]=!![];this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x2e')]]['answertime']=_0x31cc3c[_0xbd0b('0x3d')](_0xbd0b('0x48'));if(this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x2e')]][_0xbd0b('0x47')]){this['channels'][_0xfed870[_0xbd0b('0x2e')]]['holdtime']=_0x31cc3c[_0xbd0b('0x6b')](this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x2e')]][_0xbd0b('0x47')],_0xbd0b('0x58'));}}if(_0xfed870[_0xbd0b('0x62')]!==_0xbd0b('0x3a')){this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x2e')]][_0xbd0b('0x3c')]=_0xfed870['calleridnum'];}this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x2e')]][_0xbd0b('0x6c')]=_0xfed870[_0xbd0b('0x67')];this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x2e')]][_0xbd0b('0x68')]=_0xfed870['channel'];this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x2e')]][_0xbd0b('0x49')]=dispositions[_['toNumber'](_0xfed870[_0xbd0b('0x4b')])];}}else{if(this['channels'][_0xfed870[_0xbd0b('0x2e')]]){if(this[_0xbd0b('0x13')][_0xfed870[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]]){this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x2e')]]['UserId']=this[_0xbd0b('0x13')][_0xfed870[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]]['id'];this[_0xbd0b('0x12')][_0xfed870['uniqueid']][_0xbd0b('0x6a')]=this['agents'][_0xfed870[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]][_0xbd0b('0x3f')];}}}if(_0xfed870[_0xbd0b('0x36')]===_0xbd0b('0x37')){if(this[_0xbd0b('0x13')][_0xfed870[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]]){this[_0xbd0b('0x13')][_0xfed870[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]][_0xbd0b('0x3b')]=_0xfed870[_0xbd0b('0x46')];var _0x50b868,_0x39740c;if(this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x2e')]]){_0x50b868=this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x2e')]][_0xbd0b('0x6d')];_0x39740c=this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x2e')]][_0xbd0b('0x8')];}else if(this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x32')]]){_0x50b868=this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x32')]]['routealias'];_0x39740c=this[_0xbd0b('0x12')][_0xfed870[_0xbd0b('0x32')]][_0xbd0b('0x8')];}logger[_0xbd0b('0x2f')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0xfed870[_0xbd0b('0x2e')],util[_0xbd0b('0x31')]({'id':this[_0xbd0b('0x13')][_0xfed870[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0xfed870['channel'][_0xbd0b('0x39')]('-')[0x0]][_0xbd0b('0x4d')],'destconnectedlinenum':_0xfed870[_0xbd0b('0x46')],'routealias':_0x50b868,'queue':_0x39740c||undefined},{'showHidden':![],'depth':null}));this['emit'](util[_0xbd0b('0x3d')](_0xbd0b('0x3e'),this[_0xbd0b('0x13')][_0xfed870['channel'][_0xbd0b('0x39')]('-')[0x0]]['name']),'user:agentconnect',{'id':this[_0xbd0b('0x13')][_0xfed870['channel']['split']('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0xbd0b('0x13')][_0xfed870['channel'][_0xbd0b('0x39')]('-')[0x0]][_0xbd0b('0x4d')],'destconnectedlinenum':_0xfed870['exten'],'routealias':_0x50b868,'queue':_0x39740c||undefined});}}}}catch(_0x1ddc8c){logger[_0xbd0b('0x41')](_0xbd0b('0x6e'),_0xfed870[_0xbd0b('0x2e')],util[_0xbd0b('0x31')](_0x1ddc8c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xbd0b('0x6f')]=function(_0x45624c,_0x534b7b){try{if(this[_0xbd0b('0x12')][_0x45624c]){logger[_0xbd0b('0x25')](_0xbd0b('0x70'),_0x45624c,_0x534b7b);this[_0xbd0b('0x12')][_0x45624c][_0xbd0b('0x71')]=!![];if(_[_0xbd0b('0x72')](_0x534b7b,'.wav49')){_0x534b7b=_0x534b7b[_0xbd0b('0x73')](_0xbd0b('0x74'),_0xbd0b('0x75'));}this[_0xbd0b('0x12')][_0x45624c][_0xbd0b('0x76')]=_0x534b7b;var _0x2849dc=_[_0xbd0b('0x77')](this[_0xbd0b('0x12')][_0x45624c][_0xbd0b('0x78')],{'filename':_0x534b7b});if(_['isNil'](_0x2849dc)){this[_0xbd0b('0x12')][_0x45624c]['monitors'][_0xbd0b('0x79')]({'filename':_0x534b7b,'createdAt':moment()[_0xbd0b('0x3d')](_0xbd0b('0x48')),'mixmonitorid':'','status':_0xbd0b('0x7a')});}}}catch(_0x3a35f3){logger[_0xbd0b('0x41')](_0xbd0b('0x7b'),_0x45624c,util[_0xbd0b('0x31')](_0x3a35f3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbd0b('0x29')][_0xbd0b('0x1b')]=function(_0x453a58){try{if(this[_0xbd0b('0x2a')](_0x453a58)){logger['debug'](_0xbd0b('0x7c'),_0x453a58['uniqueid'],util[_0xbd0b('0x31')](_0x453a58,{'showHidden':![],'depth':null}));if(this[_0xbd0b('0x12')][_0x453a58['uniqueid']]&&_0x453a58[_0xbd0b('0x38')]!=_0xbd0b('0x44')){if(this[_0xbd0b('0x2a')](_0x453a58[_0xbd0b('0x7d')])){if(this[_0xbd0b('0x2a')](_0x453a58[_0xbd0b('0x7d')][_0xbd0b('0x7e')])){logger[_0xbd0b('0x25')](_0xbd0b('0x7f'),_0x453a58[_0xbd0b('0x2e')],_0x453a58[_0xbd0b('0x80')]);this[_0xbd0b('0x6f')](_0x453a58['uniqueid'],_0x453a58[_0xbd0b('0x80')]);}else if(this[_0xbd0b('0x2a')](_0x453a58['variable'][_0xbd0b('0x81')])){logger[_0xbd0b('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x453a58[_0xbd0b('0x2e')],_0x453a58['value']);this[_0xbd0b('0x12')][_0x453a58['uniqueid']][_0xbd0b('0x62')]=_0x453a58[_0xbd0b('0x80')];}else if(this[_0xbd0b('0x2a')](_0x453a58[_0xbd0b('0x7d')][_0xbd0b('0x82')])){logger[_0xbd0b('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x453a58['uniqueid'],_0x453a58[_0xbd0b('0x80')]);this[_0xbd0b('0x12')][_0x453a58[_0xbd0b('0x2e')]][_0xbd0b('0x83')]=_0x453a58[_0xbd0b('0x80')];}else if(this[_0xbd0b('0x2a')](_0x453a58[_0xbd0b('0x7d')]['xmd-cdrtype'])){logger[_0xbd0b('0x25')](_0xbd0b('0x84'),_0x453a58[_0xbd0b('0x2e')],_0x453a58['value']);this[_0xbd0b('0x12')][_0x453a58[_0xbd0b('0x2e')]][_0xbd0b('0x5e')]=_0x453a58['value'];}else if(this[_0xbd0b('0x2a')](_0x453a58['variable'][_0xbd0b('0x85')])){logger[_0xbd0b('0x25')](_0xbd0b('0x86'),_0x453a58[_0xbd0b('0x2e')],_0x453a58['value']['split'](',')[0x0]);this[_0xbd0b('0x12')][_0x453a58['uniqueid']][_0xbd0b('0x8')]=_0x453a58['value']['split'](',')[0x0];}else if(this[_0xbd0b('0x2a')](_0x453a58[_0xbd0b('0x7d')][_0xbd0b('0x87')])){logger[_0xbd0b('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x453a58[_0xbd0b('0x2e')],_0x453a58[_0xbd0b('0x80')]);this[_0xbd0b('0x12')][_0x453a58[_0xbd0b('0x2e')]]['originatecalleridnum']=_0x453a58[_0xbd0b('0x80')];}else if(this[_0xbd0b('0x2a')](_0x453a58[_0xbd0b('0x7d')][_0xbd0b('0x88')])){logger['info'](_0xbd0b('0x89'),_0x453a58[_0xbd0b('0x2e')],_0x453a58[_0xbd0b('0x80')]);this['channels'][_0x453a58[_0xbd0b('0x2e')]][_0xbd0b('0x8a')]=_0x453a58[_0xbd0b('0x80')];}else if(this[_0xbd0b('0x2a')](_0x453a58[_0xbd0b('0x7d')][_0xbd0b('0x8b')])){logger[_0xbd0b('0x25')](_0xbd0b('0x8c'),_0x453a58[_0xbd0b('0x2e')],_0x453a58[_0xbd0b('0x80')]);this['channels'][_0x453a58['uniqueid']][_0xbd0b('0x8d')]=_0x453a58[_0xbd0b('0x80')];}else if(this['isNotNull'](_0x453a58[_0xbd0b('0x7d')][_0xbd0b('0x8e')])){logger[_0xbd0b('0x25')](_0xbd0b('0x8f'),_0x453a58['uniqueid'],_0x453a58['value']);this[_0xbd0b('0x12')][_0x453a58[_0xbd0b('0x2e')]][_0xbd0b('0x8')]=_0x453a58['value'];}else if(this[_0xbd0b('0x2a')](_0x453a58[_0xbd0b('0x7d')][_0xbd0b('0x90')])){logger[_0xbd0b('0x25')](_0xbd0b('0x91'),_0x453a58['uniqueid'],_0x453a58[_0xbd0b('0x80')]);this[_0xbd0b('0x12')][_0x453a58[_0xbd0b('0x2e')]]['sipcalluniqueid']=_0x453a58[_0xbd0b('0x80')];}}}else if(this[_0xbd0b('0x2a')](_0x453a58['variable'][_0xbd0b('0x7e')])){if(_0x453a58[_0xbd0b('0x80')]){var _0x2e5cfb=path[_0xbd0b('0x92')](_0x453a58[_0xbd0b('0x80')])['name'];logger[_0xbd0b('0x25')](_0xbd0b('0x7f'),_0x2e5cfb,_0x453a58[_0xbd0b('0x80')]);this[_0xbd0b('0x6f')](_0x2e5cfb,_0x453a58['value']);}}else if(this[_0xbd0b('0x12')][_0x453a58[_0xbd0b('0x32')]]){if(this[_0xbd0b('0x2a')](_0x453a58[_0xbd0b('0x7d')])){if(this[_0xbd0b('0x2a')](_0x453a58[_0xbd0b('0x7d')][_0xbd0b('0x90')])){logger[_0xbd0b('0x25')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x453a58[_0xbd0b('0x32')],_0x453a58['value']);this[_0xbd0b('0x12')][_0x453a58[_0xbd0b('0x32')]][_0xbd0b('0x93')]=_0x453a58[_0xbd0b('0x80')];}}}}}catch(_0x1f8e3b){logger['error'](_0xbd0b('0x94'),_0x453a58['uniqueid'],util[_0xbd0b('0x31')](_0x1f8e3b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncHangup']=function(_0x40b95b){try{if(this[_0xbd0b('0x2a')](_0x40b95b)){logger['debug'](_0xbd0b('0x95'),_0x40b95b['uniqueid'],util[_0xbd0b('0x31')](_0x40b95b,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x40b95b[_0xbd0b('0x32')]]){if(this[_0xbd0b('0x12')][this[_0xbd0b('0x14')][_0x40b95b[_0xbd0b('0x32')]][_0xbd0b('0x32')]]){this['channels'][this['blindTransfers'][_0x40b95b[_0xbd0b('0x32')]][_0xbd0b('0x32')]][_0xbd0b('0x2e')]=_0x40b95b['uniqueid'];this[_0xbd0b('0x12')][this[_0xbd0b('0x14')][_0x40b95b[_0xbd0b('0x32')]][_0xbd0b('0x32')]]['answered']=this[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]][_0xbd0b('0x64')];this['channels'][this[_0xbd0b('0x14')][_0x40b95b[_0xbd0b('0x32')]][_0xbd0b('0x32')]]['answertime']=this[_0xbd0b('0x12')][_0x40b95b['uniqueid']][_0xbd0b('0x65')];this[_0xbd0b('0x12')][this[_0xbd0b('0x14')][_0x40b95b[_0xbd0b('0x32')]][_0xbd0b('0x32')]][_0xbd0b('0x68')]=this[_0xbd0b('0x12')][this[_0xbd0b('0x14')][_0x40b95b['linkedid']]['linkedid']]['channel'];this[_0xbd0b('0x12')][this[_0xbd0b('0x14')][_0x40b95b[_0xbd0b('0x32')]][_0xbd0b('0x32')]]['disposition']=this[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]][_0xbd0b('0x49')];this[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]]=this[_0xbd0b('0x12')][this[_0xbd0b('0x14')][_0x40b95b[_0xbd0b('0x32')]][_0xbd0b('0x32')]];delete this['channels'][this[_0xbd0b('0x14')][_0x40b95b['linkedid']]['linkedid']];}else if(this[_0xbd0b('0x12')][this[_0xbd0b('0x14')][_0x40b95b[_0xbd0b('0x32')]][_0xbd0b('0x2e')]]){this[_0xbd0b('0x12')][this['blindTransfers'][_0x40b95b[_0xbd0b('0x32')]][_0xbd0b('0x2e')]][_0xbd0b('0x2e')]=[this[_0xbd0b('0x12')][this[_0xbd0b('0x14')][_0x40b95b[_0xbd0b('0x32')]][_0xbd0b('0x2e')]][_0xbd0b('0x32')],this[_0xbd0b('0x12')][this[_0xbd0b('0x14')][_0x40b95b[_0xbd0b('0x32')]][_0xbd0b('0x2e')]][_0xbd0b('0x32')]=this[_0xbd0b('0x12')][this[_0xbd0b('0x14')][_0x40b95b[_0xbd0b('0x32')]]['uniqueid']][_0xbd0b('0x2e')]][0x0];this[_0xbd0b('0x12')][this['blindTransfers'][_0x40b95b[_0xbd0b('0x32')]][_0xbd0b('0x2e')]]['answered']=this[_0xbd0b('0x12')][_0x40b95b['uniqueid']][_0xbd0b('0x64')];this[_0xbd0b('0x12')][this[_0xbd0b('0x14')][_0x40b95b[_0xbd0b('0x32')]][_0xbd0b('0x2e')]][_0xbd0b('0x65')]=this['channels'][_0x40b95b['uniqueid']]['answertime'];this[_0xbd0b('0x12')][this[_0xbd0b('0x14')][_0x40b95b[_0xbd0b('0x32')]][_0xbd0b('0x2e')]][_0xbd0b('0x68')]=this['channels'][this[_0xbd0b('0x14')][_0x40b95b[_0xbd0b('0x32')]][_0xbd0b('0x2e')]]['channel'];this['channels'][this[_0xbd0b('0x14')][_0x40b95b['linkedid']][_0xbd0b('0x2e')]][_0xbd0b('0x49')]=this[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]][_0xbd0b('0x49')];this[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]]=this[_0xbd0b('0x12')][this[_0xbd0b('0x14')][_0x40b95b['linkedid']]['uniqueid']];delete this['channels'][this[_0xbd0b('0x14')][_0x40b95b[_0xbd0b('0x32')]][_0xbd0b('0x2e')]];}}if(this[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]]){logger['info']('[%s][voiceCallReport][hangup]\x20reason:%s',_0x40b95b[_0xbd0b('0x2e')],_0x40b95b[_0xbd0b('0x96')]);var _0x268c6d=moment();this[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]][_0xbd0b('0x97')]=_0x268c6d[_0xbd0b('0x3d')](_0xbd0b('0x48'));this['channels'][_0x40b95b[_0xbd0b('0x2e')]][_0xbd0b('0x57')]=_0x268c6d['diff'](this[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]][_0xbd0b('0x47')],_0xbd0b('0x58'));if(this['channels'][_0x40b95b['uniqueid']]['answered']){this[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]][_0xbd0b('0x98')]=_0x268c6d[_0xbd0b('0x6b')](this[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]]['answertime'],_0xbd0b('0x58'));this[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]][_0xbd0b('0x66')]=this[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]][_0xbd0b('0x57')]-this[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]][_0xbd0b('0x98')];}if(_0x40b95b[_0xbd0b('0x36')]===_0xbd0b('0x37')){if(this[_0xbd0b('0x13')][_0x40b95b[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]]){this['agents'][_0x40b95b[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]]=_[_0xbd0b('0x99')](this[_0xbd0b('0x13')][_0x40b95b[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]],[_0xbd0b('0x3b')]);logger[_0xbd0b('0x2f')](_0xbd0b('0x9a'),_0x40b95b[_0xbd0b('0x2e')],util[_0xbd0b('0x31')]({'id':this['agents'][_0x40b95b[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0xbd0b('0x13')][_0x40b95b[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]][_0xbd0b('0x4d')]},{'showHidden':![],'depth':null}));this[_0xbd0b('0x2c')](util['format']('user:%s',this[_0xbd0b('0x13')][_0x40b95b['channel'][_0xbd0b('0x39')]('-')[0x0]][_0xbd0b('0x3f')]),'user:agentcomplete',{'id':this['agents'][_0x40b95b[_0xbd0b('0x38')][_0xbd0b('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0xbd0b('0x13')][_0x40b95b['channel'][_0xbd0b('0x39')]('-')[0x0]]['accountcode']});for(var _0x58504a=0x0;_0x58504a<Object['keys'](this[_0xbd0b('0x13')])[_0xbd0b('0x9b')];_0x58504a++){var _0x5a7f4b=Object[_0xbd0b('0x35')](this[_0xbd0b('0x13')])[_0x58504a];var _0x386542=this[_0xbd0b('0x13')][_0x5a7f4b];if(_0x386542[_0xbd0b('0x4d')]===Number(_0x40b95b[_0xbd0b('0x3c')])){this[_0xbd0b('0x2c')](util[_0xbd0b('0x3d')]('user:%s',_0x386542[_0xbd0b('0x3f')]),_0xbd0b('0x9c'),{'id':_0x386542['id'],'destaccountcode':_0x386542[_0xbd0b('0x4d')],'transfer':this[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]][_0xbd0b('0x9d')]});break;}}}}var _0x48e117=this;Promise[_0xbd0b('0x9e')]()[_0xbd0b('0x9f')](function(){var _0x24648c=_0x48e117[_0xbd0b('0x12')][_0x40b95b['uniqueid']];if(typeof _0x24648c['transferType']==='undefined')return;if(_[_0xbd0b('0xa0')](_0x24648c[_0xbd0b('0x78')]))return;return RpcSetting['getSettings']()[_0xbd0b('0x9f')](function(_0x27972c){if(!_0x27972c[_0xbd0b('0xa1')])return;return Promise[_0xbd0b('0x9e')]()[_0xbd0b('0x9f')](function(){return ami[_0xbd0b('0xa2')]({'action':'StopMixMonitor','channel':_0x24648c[_0xbd0b('0x38')]})[_0xbd0b('0xa3')](function(){});})[_0xbd0b('0x9f')](function(){return ami[_0xbd0b('0xa2')]({'action':_0xbd0b('0xa4'),'channel':_0x24648c[_0xbd0b('0x68')]})[_0xbd0b('0xa3')](function(){})[_0xbd0b('0xa5')](function(){var _0x350b16=_0x48e117['agents'][_0x24648c[_0xbd0b('0x68')]['split']('-')[0x0]];if(!_0x350b16)return;io[_0xbd0b('0x2c')](_0xbd0b('0xa6'),{'agentId':_0x350b16['id'],'uniqueid':_0x24648c[_0xbd0b('0x2e')]});});});});})[_0xbd0b('0x9f')](function(){if(_0x40b95b['event']===_0xbd0b('0xa7')){_0x48e117[_0xbd0b('0x14')][_0x40b95b[_0xbd0b('0x2e')]]=_0x40b95b;}else{if(_0x48e117[_0xbd0b('0x12')][_0x40b95b['uniqueid']][_0xbd0b('0x5e')]==='outbound'&&_0x48e117[_0xbd0b('0x14')][_0x40b95b[_0xbd0b('0x2e')]]){_0x48e117[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]]['uniqueid']=[_0x48e117[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]][_0xbd0b('0x32')],_0x48e117[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]][_0xbd0b('0x32')]=_0x48e117[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]][_0xbd0b('0x2e')]][0x0];delete _0x48e117[_0xbd0b('0x14')][_0x40b95b[_0xbd0b('0x2e')]];}}logger[_0xbd0b('0x2f')](_0xbd0b('0xa8'),_0x40b95b[_0xbd0b('0x2e')],util[_0xbd0b('0x31')](_0x48e117[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]],{'showHidden':![],'depth':null}));ami[_0xbd0b('0x2c')]('custom:voiceCallReport',_0x48e117[_0xbd0b('0x12')][_0x40b95b[_0xbd0b('0x2e')]]);delete _0x48e117['channels'][_0x40b95b[_0xbd0b('0x2e')]];});}}}catch(_0x222290){logger[_0xbd0b('0x41')](_0xbd0b('0xa9'),_0x40b95b[_0xbd0b('0x2e')],util[_0xbd0b('0x31')](_0x222290,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xbd0b('0x20')]=function(_0x2b5201){try{if(this[_0xbd0b('0x2a')](_0x2b5201)){logger[_0xbd0b('0x25')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x2b5201['uniqueid'],_0x2b5201[_0xbd0b('0xaa')],_0x2b5201['transfertargetcalleridnum']);logger[_0xbd0b('0x2f')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x2b5201['uniqueid'],util[_0xbd0b('0x31')](_0x2b5201,{'showHidden':![],'depth':null}));var _0xa39e71;if(this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xab')]]){this['channels'][_0x2b5201[_0xbd0b('0xab')]][_0xbd0b('0xac')]=_0x2b5201['origtransferercalleridnum'];this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xab')]][_0xbd0b('0xad')]=_0x2b5201['transfertargetcalleridnum'];if(this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xae')]]){_0xa39e71=this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xae')]];this['channels'][_0x2b5201[_0xbd0b('0xae')]]=this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xab')]];this['channels'][_0x2b5201[_0xbd0b('0xab')]]=_0xa39e71;}this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xae')]][_0xbd0b('0x9d')]=_0xbd0b('0xaf');}else if(this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xb0')]]){this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xb0')]][_0xbd0b('0xac')]=_0x2b5201[_0xbd0b('0xaa')];this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xb0')]]['transferconnectedlinenum']=_0x2b5201[_0xbd0b('0xb1')];if(this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xb2')]]){_0xa39e71=this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xb2')]];this['channels'][_0x2b5201[_0xbd0b('0xb2')]]=this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xb0')]];this['channels'][_0x2b5201[_0xbd0b('0xb0')]]=_0xa39e71;}this['channels'][_0x2b5201[_0xbd0b('0xb0')]][_0xbd0b('0x9d')]='ATTENDED';}if((this['channels'][_0x2b5201[_0xbd0b('0xb2')]]||this['channels'][_0x2b5201[_0xbd0b('0xb3')]])&&this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xae')]]){var _0x3561d3=_[_0xbd0b('0xb4')]([this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xb2')]],this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xb3')]],this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xae')]]],function(_0x569043){return _0x569043&&_0x569043['type']===_0xbd0b('0xb5')&&_0x569043['routeid'];});if(_0x3561d3){if(this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xb2')]])this[_0xbd0b('0x12')][_0x2b5201['origtransfereruniqueid']][_0xbd0b('0x9d')]=_0xbd0b('0xaf');if(this[_0xbd0b('0x12')][_0x2b5201[_0xbd0b('0xb3')]])this[_0xbd0b('0x12')][_0x2b5201['origtransfererlinkedid']][_0xbd0b('0x9d')]=_0xbd0b('0xaf');this[_0xbd0b('0x12')][_0x2b5201['secondtransfereruniqueid']]['transferType']=_0xbd0b('0xaf');}}}}catch(_0x4616ab){logger['error'](_0xbd0b('0xb6'),_0x2b5201[_0xbd0b('0x2e')],util[_0xbd0b('0x31')](_0x4616ab,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbd0b('0x29')]['syncBlindTransfer']=function(_0x3fe025){try{if(this[_0xbd0b('0x2a')](_0x3fe025)){logger[_0xbd0b('0x25')](_0xbd0b('0xb7'),_0x3fe025['uniqueid'],_0x3fe025[_0xbd0b('0xb8')],_0x3fe025['extension']);logger[_0xbd0b('0x2f')](_0xbd0b('0xb9'),_0x3fe025['uniqueid'],util[_0xbd0b('0x31')](_0x3fe025,{'showHidden':![],'depth':null}));if(this['channels'][_0x3fe025['transfereeuniqueid']]){this[_0xbd0b('0x12')][_0x3fe025['transfereeuniqueid']][_0xbd0b('0xac')]=_0x3fe025[_0xbd0b('0xb8')];this[_0xbd0b('0x12')][_0x3fe025['transfereeuniqueid']]['transferconnectedlinenum']=_0x3fe025[_0xbd0b('0xba')];this[_0xbd0b('0x12')][_0x3fe025[_0xbd0b('0xab')]][_0xbd0b('0x9d')]=_0xbd0b('0xbb');this[_0xbd0b('0x1d')]({'event':_0xbd0b('0xa7'),'uniqueid':_0x3fe025[_0xbd0b('0xab')],'linkedid':_0x3fe025[_0xbd0b('0xbc')],'context':_0x3fe025[_0xbd0b('0x36')],'channel':_0x3fe025['transfererchannel']});}else{this[_0xbd0b('0x12')][_0x3fe025[_0xbd0b('0xbc')]]['transferType']=_0xbd0b('0xbb');this['syncHangup']({'event':_0xbd0b('0xa7'),'uniqueid':_0x3fe025[_0xbd0b('0xbc')],'linkedid':_0x3fe025[_0xbd0b('0xab')],'context':_0x3fe025[_0xbd0b('0x36')],'channel':_0x3fe025['transfererchannel']});}}}catch(_0x22f791){logger[_0xbd0b('0x41')](_0xbd0b('0xbd'),_0x3fe025[_0xbd0b('0x2e')],util['inspect'](_0x22f791,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbd0b('0x29')][_0xbd0b('0x23')]=function(_0x53e0cc){try{if(this[_0xbd0b('0x2a')](_0x53e0cc)){logger[_0xbd0b('0x2f')](_0xbd0b('0xbe'),_0x53e0cc[_0xbd0b('0x2e')],util['inspect'](_0x53e0cc,{'showHidden':![],'depth':null}));if(this[_0xbd0b('0x12')][_0x53e0cc[_0xbd0b('0x2e')]]){if(!_[_0xbd0b('0x5f')](this['channels'][_0x53e0cc[_0xbd0b('0x2e')]][_0xbd0b('0x65')])){this[_0xbd0b('0x12')][_0x53e0cc['uniqueid']][_0xbd0b('0xbf')]=moment()[_0xbd0b('0x3d')](_0xbd0b('0x48'));logger[_0xbd0b('0x25')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x53e0cc['uniqueid'],this[_0xbd0b('0x12')][_0x53e0cc['uniqueid']][_0xbd0b('0xbf')]);}}}}catch(_0x283f7b){logger[_0xbd0b('0x41')]('[%s][voiceCallReport][musiconholdstart]',_0x53e0cc['uniqueid'],util['inspect'](_0x283f7b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xbd0b('0xc0')]=function(_0x50a5d7){try{if(this[_0xbd0b('0x2a')](_0x50a5d7)){logger[_0xbd0b('0x2f')](_0xbd0b('0xc1'),_0x50a5d7[_0xbd0b('0x2e')],util['inspect'](_0x50a5d7,{'showHidden':![],'depth':null}));if(this[_0xbd0b('0x12')][_0x50a5d7[_0xbd0b('0x2e')]]){if(!_[_0xbd0b('0x5f')](this['channels'][_0x50a5d7[_0xbd0b('0x2e')]][_0xbd0b('0xbf')])){this[_0xbd0b('0x12')][_0x50a5d7[_0xbd0b('0x2e')]][_0xbd0b('0xc2')]+=moment()[_0xbd0b('0xc3')](0x0)['diff'](this[_0xbd0b('0x12')][_0x50a5d7[_0xbd0b('0x2e')]][_0xbd0b('0xbf')],_0xbd0b('0x58'));logger['info']('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x50a5d7[_0xbd0b('0x2e')],this[_0xbd0b('0x12')][_0x50a5d7[_0xbd0b('0x2e')]][_0xbd0b('0xc2')]);delete this[_0xbd0b('0x12')][_0x50a5d7[_0xbd0b('0x2e')]][_0xbd0b('0xbf')];}}}}catch(_0x1ab9a1){logger[_0xbd0b('0x41')]('[%s][voiceCallReport][musiconholdstop]',_0x50a5d7[_0xbd0b('0x2e')],util[_0xbd0b('0x31')](_0x1ab9a1,{'showHidden':![],'depth':null}));}};module[_0xbd0b('0xc4')]=VoiceCallReport;
\ No newline at end of file
index 2edf125..e2604d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ca=['syncVarSet','hangup','prototype','isNotNull','emit','debug','inspect','merge','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','lastIndexOf','omit','event','info','membername','interface','voice:outbound','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','voice_outbound_channel:save','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','variable','value','outboundrouteid','isUndefined','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','endtime','diff','starttime','seconds','complete','total','holdtime','sumHoldTime','billableseconds','sumDuration','duration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','linkedid','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','set','applicationdata','appdata','toLowerCase','startsWith','cdr(','split','[%s][voiceDialReport][newexten]','lodash','util','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','syncDialBegin','bind','dialend','syncDialEnd','varset'];(function(_0x291d48,_0x447456){var _0x4ea2fb=function(_0x385544){while(--_0x385544){_0x291d48['push'](_0x291d48['shift']());}};_0x4ea2fb(++_0x447456);}(_0x24ca,0x1bc));var _0xa24c=function(_0x36feb2,_0x53abef){_0x36feb2=_0x36feb2-0x0;var _0x292b43=_0x24ca[_0x36feb2];return _0x292b43;};'use strict';var _=require(_0xa24c('0x0'));var moment=require('moment');var util=require(_0xa24c('0x1'));var Redis=require(_0xa24c('0x2'));var config=require(_0xa24c('0x3'));var logger=require('../../../config/logger')(_0xa24c('0x4'));var ami=require(_0xa24c('0x5'));config[_0xa24c('0x6')]=_[_0xa24c('0x7')](config[_0xa24c('0x6')],{'host':_0xa24c('0x8'),'port':0x18eb});var io=require(_0xa24c('0x9'))(new Redis(config[_0xa24c('0x6')]));function VoiceDialReport(_0x2dd348){this[_0xa24c('0xa')]=_0x2dd348[_0xa24c('0xb')];this['outbound']=_0x2dd348[_0xa24c('0xc')];this[_0xa24c('0xd')]={};this[_0xa24c('0xe')]={};ami['on']('dialbegin',this[_0xa24c('0xf')][_0xa24c('0x10')](this));ami['on'](_0xa24c('0x11'),this[_0xa24c('0x12')][_0xa24c('0x10')](this));ami['on'](_0xa24c('0x13'),this[_0xa24c('0x14')][_0xa24c('0x10')](this));ami['on'](_0xa24c('0x15'),this['syncHangup'][_0xa24c('0x10')](this));}VoiceDialReport[_0xa24c('0x16')][_0xa24c('0x17')]=function(_0x2c2af8){return _0x2c2af8!==null&&!_['isUndefined'](_0x2c2af8);};VoiceDialReport[_0xa24c('0x16')][_0xa24c('0x18')]=function(_0x26ff28,_0x2fcd8b,_0x1cb08e){io['to'](_0x26ff28)[_0xa24c('0x18')](_0x2fcd8b,_0x1cb08e);};VoiceDialReport[_0xa24c('0x16')]['syncDialBegin']=function(_0x47a063){try{if(this[_0xa24c('0x17')](_0x47a063)){logger[_0xa24c('0x19')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x47a063['uniqueid'],util[_0xa24c('0x1a')](_0x47a063,{'showHidden':![],'depth':null}));if(this[_0xa24c('0xa')][_0x47a063['uniqueid']]){_[_0xa24c('0x1b')](this['channels'][_0x47a063[_0xa24c('0x1c')]],{'starttime':moment()[_0xa24c('0x1d')](_0xa24c('0x1e')),'lastevent':_0xa24c('0x1f'),'interface':_0x47a063['channel'][_0xa24c('0x20')](0x0,_0x47a063[_0xa24c('0x21')][_0xa24c('0x22')]('-')),'membername':_0x47a063['channel']['substring'](_0x47a063['channel']['lastIndexOf']('/')+0x1,_0x47a063[_0xa24c('0x21')][_0xa24c('0x22')]('-'))},_[_0xa24c('0x23')](_0x47a063,[_0xa24c('0x24'),'privilege']));logger[_0xa24c('0x25')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x47a063[_0xa24c('0x1c')],this[_0xa24c('0xa')][_0x47a063['uniqueid']][_0xa24c('0x26')],this[_0xa24c('0xa')][_0x47a063[_0xa24c('0x1c')]][_0xa24c('0x27')]);logger[_0xa24c('0x19')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x47a063[_0xa24c('0x1c')],util['inspect'](this[_0xa24c('0xa')][_0x47a063[_0xa24c('0x1c')]],{'showHidden':![],'depth':null}));if(this[_0xa24c('0xd')][_0x47a063['uniqueid']])_[_0xa24c('0x1b')](this[_0xa24c('0xa')][_0x47a063[_0xa24c('0x1c')]],this[_0xa24c('0xd')][_0x47a063[_0xa24c('0x1c')]]);this[_0xa24c('0x18')](_0xa24c('0x28'),'voice_outbound_channel:save',this[_0xa24c('0xa')][_0x47a063[_0xa24c('0x1c')]]);logger[_0xa24c('0x19')](_0xa24c('0x29'),_0x47a063['uniqueid'],util[_0xa24c('0x1a')](this[_0xa24c('0xa')][_0x47a063[_0xa24c('0x1c')]],{'showHidden':![],'depth':null}));ami['emit'](_0xa24c('0x2a'),this[_0xa24c('0xa')][_0x47a063[_0xa24c('0x1c')]]);}}}catch(_0x4ae35c){logger[_0xa24c('0x2b')]('[%s][voiceDialReport][dialbegin]',_0x47a063[_0xa24c('0x1c')],util[_0xa24c('0x1a')](_0x4ae35c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xa24c('0x16')]['syncDialEnd']=function(_0x1f52f8){try{if(this[_0xa24c('0x17')](_0x1f52f8)){logger[_0xa24c('0x19')]('[%s][voiceDialReport][dialend]\x20event:',_0x1f52f8[_0xa24c('0x1c')],util['inspect'](_0x1f52f8,{'showHidden':![],'depth':null}));if(this[_0xa24c('0xa')][_0x1f52f8[_0xa24c('0x1c')]]){this['channels'][_0x1f52f8['uniqueid']][_0xa24c('0x2c')]=_0x1f52f8[_0xa24c('0x2c')];if(_0x1f52f8[_0xa24c('0x2c')]===_0xa24c('0x2d')){this[_0xa24c('0xa')][_0x1f52f8[_0xa24c('0x1c')]][_0xa24c('0x2e')]=_0x1f52f8['connectedlinenum'];this[_0xa24c('0xa')][_0x1f52f8[_0xa24c('0x1c')]][_0xa24c('0x2f')]=_0x1f52f8[_0xa24c('0x2f')];this[_0xa24c('0xa')][_0x1f52f8[_0xa24c('0x1c')]][_0xa24c('0x30')]=moment()[_0xa24c('0x1d')](_0xa24c('0x1e'));this[_0xa24c('0xa')][_0x1f52f8['uniqueid']][_0xa24c('0x31')]=_0xa24c('0x32');logger[_0xa24c('0x25')](_0xa24c('0x33'),_0x1f52f8['uniqueid'],_0x1f52f8['channel'][_0xa24c('0x20')](_0x1f52f8['channel'][_0xa24c('0x22')]('/')+0x1,_0x1f52f8[_0xa24c('0x21')][_0xa24c('0x22')]('-')));logger[_0xa24c('0x19')](_0xa24c('0x34'),_0x1f52f8['uniqueid'],util['inspect'](this[_0xa24c('0xa')][_0x1f52f8[_0xa24c('0x1c')]],{'showHidden':![],'depth':null}));ami[_0xa24c('0x18')](_0xa24c('0x35'),this[_0xa24c('0xa')][_0x1f52f8[_0xa24c('0x1c')]]);}logger['debug']('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x1f52f8[_0xa24c('0x1c')],util[_0xa24c('0x1a')](this[_0xa24c('0xa')][_0x1f52f8[_0xa24c('0x1c')]],{'showHidden':![],'depth':null}));this[_0xa24c('0x18')]('voice:outbound',_0xa24c('0x36'),this[_0xa24c('0xa')][_0x1f52f8['uniqueid']]);}}}catch(_0x599627){logger[_0xa24c('0x2b')](_0xa24c('0x37'),_0x1f52f8[_0xa24c('0x1c')],util['inspect'](_0x599627,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xa24c('0x14')]=function(_0x32af67){try{if(this[_0xa24c('0x17')](_0x32af67)){logger[_0xa24c('0x19')](_0xa24c('0x38'),_0x32af67[_0xa24c('0x1c')],util[_0xa24c('0x1a')](_0x32af67,{'showHidden':![],'depth':null}));this[_0xa24c('0x39')](_0x32af67['uniqueid'],_['keys'](_0x32af67[_0xa24c('0x3a')])[0x0],_0x32af67[_0xa24c('0x3b')]);if(this[_0xa24c('0x17')](_0x32af67['variable'])&&this[_0xa24c('0x17')](_0x32af67[_0xa24c('0x3a')][_0xa24c('0x3c')])){if(_[_0xa24c('0x3d')](this[_0xa24c('0xa')][_0x32af67[_0xa24c('0x1c')]])){this[_0xa24c('0xa')][_0x32af67[_0xa24c('0x1c')]]={'routeId':_0x32af67[_0xa24c('0x3b')],'variables':this[_0xa24c('0xe')][_0x32af67['uniqueid']],'motionChannel':_0xa24c('0x3e')};logger[_0xa24c('0x25')](_0xa24c('0x3f'),_0x32af67['uniqueid'],_0x32af67[_0xa24c('0x3a')][_0xa24c('0x3c')],_[_0xa24c('0x40')](_0x32af67[_0xa24c('0x3a')])[0x0],_0x32af67[_0xa24c('0x3b')]);logger[_0xa24c('0x19')](_0xa24c('0x41'),_0x32af67[_0xa24c('0x1c')],util[_0xa24c('0x1a')](this[_0xa24c('0xa')][_0x32af67[_0xa24c('0x1c')]],{'showHidden':![],'depth':null}));this['emit'](_0xa24c('0x28'),_0xa24c('0x36'),this[_0xa24c('0xa')][_0x32af67[_0xa24c('0x1c')]]);}}}}catch(_0x1a1d02){logger[_0xa24c('0x2b')](_0xa24c('0x42'),_0x32af67[_0xa24c('0x1c')],util[_0xa24c('0x1a')](_0x1a1d02,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['addVariable']=function(_0x1e73f8,_0x5c14df,_0xc078ef){var _0x1f436c=['rtpaudioqos',_0xa24c('0x43'),_0xa24c('0x44'),_0xa24c('0x45'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0xa24c('0x46'),'rtpaudioqosrttbridged',_0xa24c('0x47'),_0xa24c('0x48'),_0xa24c('0x49'),_0xa24c('0x4a'),_0xa24c('0x4b'),_0xa24c('0x4c'),_0xa24c('0x4d'),_0xa24c('0x4e'),_0xa24c('0x26'),_0xa24c('0x4f'),'memberrealtime'];if(!_[_0xa24c('0x50')](_0x5c14df)&&!_[_0xa24c('0x51')](_0x1f436c,_0x5c14df)){if(_[_0xa24c('0x3d')](this['variables'][_0x1e73f8])){this['variables'][_0x1e73f8]={};}this['variables'][_0x1e73f8][_0x5c14df]=_0xc078ef;}};VoiceDialReport[_0xa24c('0x16')]['syncHangup']=function(_0x4757ff){try{if(this[_0xa24c('0x17')](_0x4757ff)){logger['debug'](_0xa24c('0x52'),_0x4757ff[_0xa24c('0x1c')],util[_0xa24c('0x1a')](_0x4757ff,{'showHidden':![],'depth':null}));if(this[_0xa24c('0xa')][_0x4757ff[_0xa24c('0x1c')]]){logger[_0xa24c('0x25')](_0xa24c('0x53'),_0x4757ff[_0xa24c('0x1c')],_0x4757ff['cause-txt']);this[_0xa24c('0xa')][_0x4757ff['uniqueid']]['endtime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x4757ff[_0xa24c('0x1c')]]['duration']=moment(this[_0xa24c('0xa')][_0x4757ff[_0xa24c('0x1c')]][_0xa24c('0x54')])[_0xa24c('0x55')](this[_0xa24c('0xa')][_0x4757ff[_0xa24c('0x1c')]][_0xa24c('0x56')],_0xa24c('0x57'));this[_0xa24c('0xa')][_0x4757ff[_0xa24c('0x1c')]][_0xa24c('0x31')]=_0xa24c('0x58');this[_0xa24c('0xc')][_0xa24c('0x59')]+=0x1;if(this[_0xa24c('0xa')][_0x4757ff['uniqueid']][_0xa24c('0x30')]){this[_0xa24c('0xc')]['answered']+=0x1;this[_0xa24c('0xa')][_0x4757ff[_0xa24c('0x1c')]][_0xa24c('0x5a')]=moment(this[_0xa24c('0xa')][_0x4757ff['uniqueid']]['answertime'])[_0xa24c('0x55')](this['channels'][_0x4757ff['uniqueid']][_0xa24c('0x56')],_0xa24c('0x57'));this[_0xa24c('0xa')][_0x4757ff[_0xa24c('0x1c')]]['billableseconds']=moment(this['channels'][_0x4757ff[_0xa24c('0x1c')]]['endtime'])['diff'](this[_0xa24c('0xa')][_0x4757ff[_0xa24c('0x1c')]][_0xa24c('0x30')],'seconds');this[_0xa24c('0xc')][_0xa24c('0x5b')]+=this['channels'][_0x4757ff[_0xa24c('0x1c')]][_0xa24c('0x5a')]||0x0;this[_0xa24c('0xc')]['sumBillable']+=this[_0xa24c('0xa')][_0x4757ff[_0xa24c('0x1c')]][_0xa24c('0x5c')];}this[_0xa24c('0xc')][_0xa24c('0x5d')]+=this['channels'][_0x4757ff[_0xa24c('0x1c')]][_0xa24c('0x5e')];logger[_0xa24c('0x19')](_0xa24c('0x5f'),_0x4757ff[_0xa24c('0x1c')],util[_0xa24c('0x1a')](this[_0xa24c('0xa')][_0x4757ff['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xa24c('0x18')](_0xa24c('0x60'),this['channels'][_0x4757ff[_0xa24c('0x1c')]]);logger[_0xa24c('0x19')](_0xa24c('0x61'),_0x4757ff[_0xa24c('0x1c')],util[_0xa24c('0x1a')](this[_0xa24c('0xa')][_0x4757ff[_0xa24c('0x1c')]],{'showHidden':![],'depth':null}));ami[_0xa24c('0x18')](_0xa24c('0x62'),this[_0xa24c('0xa')][_0x4757ff['uniqueid']]);logger[_0xa24c('0x19')](_0xa24c('0x63'),_0x4757ff[_0xa24c('0x1c')],util['inspect'](this[_0xa24c('0xa')][_0x4757ff[_0xa24c('0x1c')]],{'showHidden':![],'depth':null}));this[_0xa24c('0x18')]('voice:outbound',_0xa24c('0x64'),this[_0xa24c('0xc')]);logger[_0xa24c('0x25')](_0xa24c('0x65'),JSON[_0xa24c('0x66')](this[_0xa24c('0xa')][_0x4757ff['uniqueid']]));logger['debug'](_0xa24c('0x67'),_0x4757ff['uniqueid'],util[_0xa24c('0x1a')](this[_0xa24c('0xa')][_0x4757ff[_0xa24c('0x1c')]],{'showHidden':![],'depth':null}));this[_0xa24c('0x18')](_0xa24c('0x28'),'voice_outbound_channel:remove',this[_0xa24c('0xa')][_0x4757ff[_0xa24c('0x1c')]]);delete this[_0xa24c('0xa')][_0x4757ff[_0xa24c('0x1c')]];}else if(this[_0xa24c('0xa')][_0x4757ff[_0xa24c('0x68')]]){this['channels'][_0x4757ff[_0xa24c('0x68')]][_0xa24c('0x1c')]=this[_0xa24c('0xa')][_0x4757ff[_0xa24c('0x68')]]['destuniqueid'];}if(this[_0xa24c('0xe')][_0x4757ff['uniqueid']]){delete this[_0xa24c('0xe')][_0x4757ff[_0xa24c('0x1c')]];}}}catch(_0x342442){logger[_0xa24c('0x2b')]('[%s][voiceDialReport][hangup]',_0x4757ff[_0xa24c('0x1c')],util[_0xa24c('0x1a')](_0x342442,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xa24c('0x69')]=function(_0x168a8b){try{if(this[_0xa24c('0x17')](_0x168a8b)){logger[_0xa24c('0x19')](_0xa24c('0x6a'),_0x168a8b[_0xa24c('0x1c')],util[_0xa24c('0x1a')](_0x168a8b,{'showHidden':![],'depth':null}));if(_0x168a8b[_0xa24c('0x6b')]['toLowerCase']()===_0xa24c('0x6c')){_0x168a8b[_0xa24c('0x6d')]=(_0x168a8b[_0xa24c('0x6e')]||_0x168a8b[_0xa24c('0x6d')])[_0xa24c('0x6f')]();if(_[_0xa24c('0x70')](_0x168a8b[_0xa24c('0x6d')],_0xa24c('0x71'))){if(_[_0xa24c('0x3d')](this[_0xa24c('0xd')][_0x168a8b[_0xa24c('0x1c')]]))this['applications'][_0x168a8b[_0xa24c('0x1c')]]={};logger[_0xa24c('0x25')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x168a8b[_0xa24c('0x1c')],_0x168a8b[_0xa24c('0x6b')],_0x168a8b[_0xa24c('0x6d')]);var _0x4f0f11=_0x168a8b['applicationdata'][_0xa24c('0x72')]('=');var _0x4c9b19=_0x4f0f11[0x0]['match'](/cdr\((.*)\)/);if(_0x4c9b19)this[_0xa24c('0xd')][_0x168a8b[_0xa24c('0x1c')]][_0x4c9b19[0x1]]=_0x4f0f11[0x1];}}}}catch(_0x106178){logger[_0xa24c('0x2b')](_0xa24c('0x73'),_0x168a8b[_0xa24c('0x1c')],util['inspect'](_0x106178,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
+var _0xafc4=['variables','dialbegin','syncDialBegin','bind','syncVarSet','syncHangup','prototype','isNotNull','isUndefined','emit','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','lastIndexOf','omit','event','privilege','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','interface','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','info','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','value','variable','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','endtime','diff','starttime','seconds','complete','total','answered','holdtime','billableseconds','sumHoldTime','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','voice_outbound:save','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','split','match','[%s][voiceDialReport][newexten]','exports','lodash','util','../../../config/environment','../../../config/logger','ami','../ami','localhost','socket.io-emitter','redis','channels','outboundChannels','outbound','applications'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xafc4,0x69));var _0x4afc=function(_0x1bcbec,_0x259fdb){_0x1bcbec=_0x1bcbec-0x0;var _0x1ddcee=_0xafc4[_0x1bcbec];return _0x1ddcee;};'use strict';var _=require(_0x4afc('0x0'));var moment=require('moment');var util=require(_0x4afc('0x1'));var Redis=require('ioredis');var config=require(_0x4afc('0x2'));var logger=require(_0x4afc('0x3'))(_0x4afc('0x4'));var ami=require(_0x4afc('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0x4afc('0x6'),'port':0x18eb});var io=require(_0x4afc('0x7'))(new Redis(config[_0x4afc('0x8')]));function VoiceDialReport(_0x1bb281){this[_0x4afc('0x9')]=_0x1bb281[_0x4afc('0xa')];this['outbound']=_0x1bb281[_0x4afc('0xb')];this[_0x4afc('0xc')]={};this[_0x4afc('0xd')]={};ami['on'](_0x4afc('0xe'),this[_0x4afc('0xf')][_0x4afc('0x10')](this));ami['on']('dialend',this['syncDialEnd'][_0x4afc('0x10')](this));ami['on']('varset',this[_0x4afc('0x11')][_0x4afc('0x10')](this));ami['on']('hangup',this[_0x4afc('0x12')][_0x4afc('0x10')](this));}VoiceDialReport[_0x4afc('0x13')][_0x4afc('0x14')]=function(_0x1d8f98){return _0x1d8f98!==null&&!_[_0x4afc('0x15')](_0x1d8f98);};VoiceDialReport[_0x4afc('0x13')][_0x4afc('0x16')]=function(_0x5effb4,_0x26f3f1,_0x429fd8){io['to'](_0x5effb4)[_0x4afc('0x16')](_0x26f3f1,_0x429fd8);};VoiceDialReport[_0x4afc('0x13')]['syncDialBegin']=function(_0x4e32e8){try{if(this[_0x4afc('0x14')](_0x4e32e8)){logger['debug'](_0x4afc('0x17'),_0x4e32e8[_0x4afc('0x18')],util[_0x4afc('0x19')](_0x4e32e8,{'showHidden':![],'depth':null}));if(this[_0x4afc('0x9')][_0x4e32e8[_0x4afc('0x18')]]){_[_0x4afc('0x1a')](this[_0x4afc('0x9')][_0x4e32e8[_0x4afc('0x18')]],{'starttime':moment()[_0x4afc('0x1b')](_0x4afc('0x1c')),'lastevent':_0x4afc('0x1d'),'interface':_0x4e32e8['channel'][_0x4afc('0x1e')](0x0,_0x4e32e8[_0x4afc('0x1f')][_0x4afc('0x20')]('-')),'membername':_0x4e32e8[_0x4afc('0x1f')]['substring'](_0x4e32e8[_0x4afc('0x1f')][_0x4afc('0x20')]('/')+0x1,_0x4e32e8[_0x4afc('0x1f')][_0x4afc('0x20')]('-'))},_[_0x4afc('0x21')](_0x4e32e8,[_0x4afc('0x22'),_0x4afc('0x23')]));logger['info'](_0x4afc('0x24'),_0x4e32e8[_0x4afc('0x18')],this['channels'][_0x4e32e8[_0x4afc('0x18')]]['membername'],this[_0x4afc('0x9')][_0x4e32e8[_0x4afc('0x18')]][_0x4afc('0x25')]);logger[_0x4afc('0x26')](_0x4afc('0x27'),_0x4e32e8[_0x4afc('0x18')],util[_0x4afc('0x19')](this[_0x4afc('0x9')][_0x4e32e8[_0x4afc('0x18')]],{'showHidden':![],'depth':null}));if(this[_0x4afc('0xc')][_0x4e32e8[_0x4afc('0x18')]])_[_0x4afc('0x1a')](this[_0x4afc('0x9')][_0x4e32e8['uniqueid']],this[_0x4afc('0xc')][_0x4e32e8[_0x4afc('0x18')]]);this[_0x4afc('0x16')]('voice:outbound','voice_outbound_channel:save',this['channels'][_0x4e32e8[_0x4afc('0x18')]]);logger[_0x4afc('0x26')]('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x4e32e8[_0x4afc('0x18')],util[_0x4afc('0x19')](this['channels'][_0x4e32e8['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0x4afc('0x28'),this[_0x4afc('0x9')][_0x4e32e8[_0x4afc('0x18')]]);}}}catch(_0x46357b){logger[_0x4afc('0x29')](_0x4afc('0x2a'),_0x4e32e8['uniqueid'],util[_0x4afc('0x19')](_0x46357b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4afc('0x13')][_0x4afc('0x2b')]=function(_0x2f178c){try{if(this[_0x4afc('0x14')](_0x2f178c)){logger[_0x4afc('0x26')](_0x4afc('0x2c'),_0x2f178c[_0x4afc('0x18')],util['inspect'](_0x2f178c,{'showHidden':![],'depth':null}));if(this[_0x4afc('0x9')][_0x2f178c['uniqueid']]){this['channels'][_0x2f178c[_0x4afc('0x18')]][_0x4afc('0x2d')]=_0x2f178c[_0x4afc('0x2d')];if(_0x2f178c[_0x4afc('0x2d')]===_0x4afc('0x2e')){this[_0x4afc('0x9')][_0x2f178c['uniqueid']][_0x4afc('0x2f')]=_0x2f178c[_0x4afc('0x2f')];this[_0x4afc('0x9')][_0x2f178c[_0x4afc('0x18')]][_0x4afc('0x30')]=_0x2f178c[_0x4afc('0x30')];this['channels'][_0x2f178c[_0x4afc('0x18')]][_0x4afc('0x31')]=moment()[_0x4afc('0x1b')](_0x4afc('0x1c'));this['channels'][_0x2f178c['uniqueid']][_0x4afc('0x32')]=_0x4afc('0x33');logger[_0x4afc('0x34')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x2f178c['uniqueid'],_0x2f178c[_0x4afc('0x1f')]['substring'](_0x2f178c['channel'][_0x4afc('0x20')]('/')+0x1,_0x2f178c[_0x4afc('0x1f')][_0x4afc('0x20')]('-')));logger[_0x4afc('0x26')](_0x4afc('0x35'),_0x2f178c[_0x4afc('0x18')],util[_0x4afc('0x19')](this[_0x4afc('0x9')][_0x2f178c[_0x4afc('0x18')]],{'showHidden':![],'depth':null}));ami[_0x4afc('0x16')](_0x4afc('0x36'),this[_0x4afc('0x9')][_0x2f178c[_0x4afc('0x18')]]);}logger[_0x4afc('0x26')](_0x4afc('0x37'),_0x2f178c['uniqueid'],util[_0x4afc('0x19')](this[_0x4afc('0x9')][_0x2f178c[_0x4afc('0x18')]],{'showHidden':![],'depth':null}));this[_0x4afc('0x16')](_0x4afc('0x38'),_0x4afc('0x39'),this[_0x4afc('0x9')][_0x2f178c['uniqueid']]);}}}catch(_0x5e97f4){logger['error'](_0x4afc('0x3a'),_0x2f178c[_0x4afc('0x18')],util['inspect'](_0x5e97f4,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4afc('0x13')][_0x4afc('0x11')]=function(_0x8ba5e6){try{if(this[_0x4afc('0x14')](_0x8ba5e6)){logger['debug'](_0x4afc('0x3b'),_0x8ba5e6[_0x4afc('0x18')],util[_0x4afc('0x19')](_0x8ba5e6,{'showHidden':![],'depth':null}));this[_0x4afc('0x3c')](_0x8ba5e6[_0x4afc('0x18')],_[_0x4afc('0x3d')](_0x8ba5e6['variable'])[0x0],_0x8ba5e6[_0x4afc('0x3e')]);if(this['isNotNull'](_0x8ba5e6[_0x4afc('0x3f')])&&this[_0x4afc('0x14')](_0x8ba5e6[_0x4afc('0x3f')]['outboundrouteid'])){if(_['isUndefined'](this[_0x4afc('0x9')][_0x8ba5e6[_0x4afc('0x18')]])){this[_0x4afc('0x9')][_0x8ba5e6[_0x4afc('0x18')]]={'routeId':_0x8ba5e6[_0x4afc('0x3e')],'variables':this[_0x4afc('0xd')][_0x8ba5e6[_0x4afc('0x18')]],'motionChannel':_0x4afc('0x40')};logger['info'](_0x4afc('0x41'),_0x8ba5e6[_0x4afc('0x18')],_0x8ba5e6['variable'][_0x4afc('0x42')],_['keys'](_0x8ba5e6[_0x4afc('0x3f')])[0x0],_0x8ba5e6[_0x4afc('0x3e')]);logger[_0x4afc('0x26')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x8ba5e6[_0x4afc('0x18')],util[_0x4afc('0x19')](this[_0x4afc('0x9')][_0x8ba5e6[_0x4afc('0x18')]],{'showHidden':![],'depth':null}));this[_0x4afc('0x16')](_0x4afc('0x38'),'voice_outbound_channel:save',this['channels'][_0x8ba5e6['uniqueid']]);}}}}catch(_0x32f3b9){logger[_0x4afc('0x29')](_0x4afc('0x43'),_0x8ba5e6[_0x4afc('0x18')],util[_0x4afc('0x19')](_0x32f3b9,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4afc('0x13')][_0x4afc('0x3c')]=function(_0x41d690,_0x25347e,_0x464f94){var _0x48dbe3=[_0x4afc('0x44'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x4afc('0x45'),'rtpaudioqosloss',_0x4afc('0x46'),_0x4afc('0x47'),_0x4afc('0x48'),_0x4afc('0x49'),'sipuri',_0x4afc('0x4a'),'bridgepvtcallid',_0x4afc('0x4b'),_0x4afc('0x4c'),_0x4afc('0x4d'),_0x4afc('0x4e'),_0x4afc('0x4f'),_0x4afc('0x50'),_0x4afc('0x51')];if(!_[_0x4afc('0x52')](_0x25347e)&&!_[_0x4afc('0x53')](_0x48dbe3,_0x25347e)){if(_[_0x4afc('0x15')](this[_0x4afc('0xd')][_0x41d690])){this[_0x4afc('0xd')][_0x41d690]={};}this['variables'][_0x41d690][_0x25347e]=_0x464f94;}};VoiceDialReport[_0x4afc('0x13')][_0x4afc('0x12')]=function(_0x33ff7c){try{if(this[_0x4afc('0x14')](_0x33ff7c)){logger[_0x4afc('0x26')](_0x4afc('0x54'),_0x33ff7c[_0x4afc('0x18')],util[_0x4afc('0x19')](_0x33ff7c,{'showHidden':![],'depth':null}));if(this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x18')]]){logger[_0x4afc('0x34')](_0x4afc('0x55'),_0x33ff7c[_0x4afc('0x18')],_0x33ff7c['cause-txt']);this[_0x4afc('0x9')][_0x33ff7c['uniqueid']][_0x4afc('0x56')]=moment()[_0x4afc('0x1b')](_0x4afc('0x1c'));this[_0x4afc('0x9')][_0x33ff7c['uniqueid']]['duration']=moment(this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x18')]]['endtime'])[_0x4afc('0x57')](this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x18')]][_0x4afc('0x58')],_0x4afc('0x59'));this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x18')]][_0x4afc('0x32')]=_0x4afc('0x5a');this[_0x4afc('0xb')][_0x4afc('0x5b')]+=0x1;if(this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x18')]][_0x4afc('0x31')]){this['outbound'][_0x4afc('0x5c')]+=0x1;this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x18')]][_0x4afc('0x5d')]=moment(this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x18')]][_0x4afc('0x31')])['diff'](this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x18')]]['starttime'],'seconds');this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x18')]][_0x4afc('0x5e')]=moment(this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x18')]][_0x4afc('0x56')])[_0x4afc('0x57')](this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x18')]][_0x4afc('0x31')],'seconds');this['outbound'][_0x4afc('0x5f')]+=this[_0x4afc('0x9')][_0x33ff7c['uniqueid']][_0x4afc('0x5d')]||0x0;this[_0x4afc('0xb')]['sumBillable']+=this['channels'][_0x33ff7c[_0x4afc('0x18')]][_0x4afc('0x5e')];}this[_0x4afc('0xb')]['sumDuration']+=this[_0x4afc('0x9')][_0x33ff7c['uniqueid']]['duration'];logger[_0x4afc('0x26')](_0x4afc('0x60'),_0x33ff7c[_0x4afc('0x18')],util[_0x4afc('0x19')](this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x18')]],{'showHidden':![],'depth':null}));ami[_0x4afc('0x16')](_0x4afc('0x61'),this[_0x4afc('0x9')][_0x33ff7c['uniqueid']]);logger[_0x4afc('0x26')](_0x4afc('0x62'),_0x33ff7c[_0x4afc('0x18')],util['inspect'](this['channels'][_0x33ff7c['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x4afc('0x16')](_0x4afc('0x63'),this[_0x4afc('0x9')][_0x33ff7c['uniqueid']]);logger[_0x4afc('0x26')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x33ff7c['uniqueid'],util['inspect'](this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x18')]],{'showHidden':![],'depth':null}));this[_0x4afc('0x16')]('voice:outbound',_0x4afc('0x64'),this[_0x4afc('0xb')]);logger[_0x4afc('0x34')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0x4afc('0x65')](this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x18')]]));logger[_0x4afc('0x26')](_0x4afc('0x66'),_0x33ff7c['uniqueid'],util['inspect'](this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x18')]],{'showHidden':![],'depth':null}));this[_0x4afc('0x16')]('voice:outbound',_0x4afc('0x67'),this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x18')]]);delete this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x18')]];}else if(this['channels'][_0x33ff7c[_0x4afc('0x68')]]){this[_0x4afc('0x9')][_0x33ff7c['linkedid']][_0x4afc('0x18')]=this[_0x4afc('0x9')][_0x33ff7c[_0x4afc('0x68')]]['destuniqueid'];}if(this[_0x4afc('0xd')][_0x33ff7c[_0x4afc('0x18')]]){delete this[_0x4afc('0xd')][_0x33ff7c[_0x4afc('0x18')]];}}}catch(_0x428c61){logger[_0x4afc('0x29')](_0x4afc('0x69'),_0x33ff7c[_0x4afc('0x18')],util['inspect'](_0x428c61,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4afc('0x13')]['syncNewExten']=function(_0x5a0a78){try{if(this[_0x4afc('0x14')](_0x5a0a78)){logger[_0x4afc('0x26')](_0x4afc('0x6a'),_0x5a0a78['uniqueid'],util['inspect'](_0x5a0a78,{'showHidden':![],'depth':null}));if(_0x5a0a78[_0x4afc('0x6b')][_0x4afc('0x6c')]()===_0x4afc('0x6d')){_0x5a0a78[_0x4afc('0x6e')]=(_0x5a0a78[_0x4afc('0x6f')]||_0x5a0a78[_0x4afc('0x6e')])[_0x4afc('0x6c')]();if(_[_0x4afc('0x70')](_0x5a0a78[_0x4afc('0x6e')],_0x4afc('0x71'))){if(_[_0x4afc('0x15')](this[_0x4afc('0xc')][_0x5a0a78[_0x4afc('0x18')]]))this[_0x4afc('0xc')][_0x5a0a78[_0x4afc('0x18')]]={};logger[_0x4afc('0x34')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x5a0a78[_0x4afc('0x18')],_0x5a0a78[_0x4afc('0x6b')],_0x5a0a78[_0x4afc('0x6e')]);var _0x18bf7c=_0x5a0a78[_0x4afc('0x6e')][_0x4afc('0x72')]('=');var _0x3fddd1=_0x18bf7c[0x0][_0x4afc('0x73')](/cdr\((.*)\)/);if(_0x3fddd1)this[_0x4afc('0xc')][_0x5a0a78['uniqueid']][_0x3fddd1[0x1]]=_0x18bf7c[0x1];}}}}catch(_0x352f0c){logger[_0x4afc('0x29')](_0x4afc('0x74'),_0x5a0a78[_0x4afc('0x18')],util['inspect'](_0x352f0c,{'showHidden':![],'depth':null}));}};module[_0x4afc('0x75')]=VoiceDialReport;
\ No newline at end of file
index 070a56c..aec2786 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ac3=['[voiceQueueReport][queues]','then','isNotNull','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','available','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','inbound','YYYY-MM-DD\x20HH:mm:ss','position','routealias','merge','pick','keys','push','syncQueueCallerAbandon','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','[%s][voiceQueueReport][queuecallerleave]','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','[%s][voiceQueueReport][agentcomplete]','assigned','queuecallerexitAt','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','queuecallerexit','add','FORWARDTRANSFER','transfertype','transferexten','destexten','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','linkedid','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','value','variable','CONTINUE','TIMEOUT','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queueposition','EXITWITHKEY','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','handleHangup','length','queuecallerjoinAt','seconds','diff','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','syncHangup','cause','cause-txt','transferid','transferuniqueid','secondtransfereruniqueid','transfereeuniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','ATTENDED','origtransfereruniqueid','origtransfererexten','[%s][voiceQueueReport][attendedtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','transfererchannel','[%s][voiceQueueReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','mohstarttime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','application','applicationdata','appdata','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','moment','util','md5','ioredis','../../../config/logger','ami','../ami','../model/queueReport','redis','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','syncVarSet','hangup','fullybooted','syncFullyBooted','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','clearZombieChannels','switch','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','clearqueuereport','emit','emitVoiceQueueChannelSave','debug',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','name','voice_queue_channel:save','voice_queue_presence:save','emitVoiceQueueChannelRemove','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','answered','loggedIn','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','Trunk','callerid','Interval','stringify','[voiceQueueReport][','voice:queue:%s','isUndefined','queues'];(function(_0x542857,_0x18f281){var _0x1ec421=function(_0x334273){while(--_0x334273){_0x542857['push'](_0x542857['shift']());}};_0x1ec421(++_0x18f281);}(_0x6ac3,0x8c));var _0x36ac=function(_0x12641b,_0x218312){_0x12641b=_0x12641b-0x0;var _0x5e82cf=_0x6ac3[_0x12641b];return _0x5e82cf;};'use strict';var _=require('lodash');var moment=require(_0x36ac('0x0'));var util=require(_0x36ac('0x1'));var md5=require(_0x36ac('0x2'));var Redis=require(_0x36ac('0x3'));var config=require('../../../config/environment');var logger=require(_0x36ac('0x4'))(_0x36ac('0x5'));var ami=require(_0x36ac('0x6'));var QueueReport=require(_0x36ac('0x7'));config[_0x36ac('0x8')]=_['defaults'](config[_0x36ac('0x8')],{'host':_0x36ac('0x9'),'port':0x18eb});var io=require(_0x36ac('0xa'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x36ac('0xb')][_0x36ac('0xc')]=function(_0xc36cdb){this[_0x36ac('0xd')]=this[_0x36ac('0xd')]?this['tail']['finally'](_0xc36cdb):_0xc36cdb();};function VoiceQueueReport(_0x4f0702){this[_0x36ac('0xe')]=new Sequence();this[_0x36ac('0xf')]={};this[_0x36ac('0x10')]=_0x4f0702['agents'];this[_0x36ac('0x11')]=_0x4f0702[_0x36ac('0x12')];this['voiceQueues']=_0x4f0702[_0x36ac('0x13')];this[_0x36ac('0x14')]=!![];this['campaigns']=_0x4f0702[_0x36ac('0x15')];this[_0x36ac('0x16')]={};ami['on'](_0x36ac('0x17'),this[_0x36ac('0x18')]['bind'](this));ami['on'](_0x36ac('0x19'),this[_0x36ac('0x1a')][_0x36ac('0x1b')](this));ami['on'](_0x36ac('0x1c'),this[_0x36ac('0x1d')][_0x36ac('0x1b')](this));ami['on'](_0x36ac('0x1e'),this['syncQueueCallerAbandon'][_0x36ac('0x1b')](this));ami['on'](_0x36ac('0x1f'),this[_0x36ac('0x20')][_0x36ac('0x1b')](this));ami['on'](_0x36ac('0x21'),this[_0x36ac('0x22')]['bind'](this));ami['on'](_0x36ac('0x23'),this[_0x36ac('0x24')][_0x36ac('0x1b')](this));ami['on']('varset',this[_0x36ac('0x25')]['bind'](this));ami['on'](_0x36ac('0x26'),this['syncHangup'][_0x36ac('0x1b')](this));ami['on'](_0x36ac('0x27'),this[_0x36ac('0x28')][_0x36ac('0x1b')](this));ami['on'](_0x36ac('0x29'),this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0x36ac('0x2a'),this[_0x36ac('0x2b')][_0x36ac('0x1b')](this));ami['on'](_0x36ac('0x2c'),this[_0x36ac('0x2d')][_0x36ac('0x1b')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x36ac('0x1b')](this));this[_0x36ac('0x2e')]();this[_0x36ac('0x2f')]();}function clearChannels(_0x2d9824){if(!_[_0x36ac('0x30')](_0x2d9824)){for(var _0x54a54d in _0x2d9824){if(_0x2d9824[_0x36ac('0x31')](_0x54a54d)){delete _0x2d9824[_0x54a54d];}}}}function clearCampaigns(_0x17abe8){if(!_['isEmpty'](_0x17abe8)){for(var _0x1fdae9 in _0x17abe8){if(_0x17abe8['hasOwnProperty'](_0x1fdae9)){_0x17abe8[_0x1fdae9][_0x36ac('0x32')]=0x0;}}}}function clearVoiceQueues(_0x17966c){if(!_[_0x36ac('0x30')](_0x17966c)){for(var _0x1cd5b8 in _0x17966c){if(_0x17966c[_0x36ac('0x31')](_0x1cd5b8)){_0x17966c[_0x1cd5b8]['originated']=0x0;_0x17966c[_0x1cd5b8][_0x36ac('0x33')]=0x0;_0x17966c[_0x1cd5b8][_0x36ac('0x34')]=0x0;_0x17966c[_0x1cd5b8][_0x36ac('0x35')]=0x0;_0x17966c[_0x1cd5b8]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x1756da){if(!_[_0x36ac('0x30')](_0x1756da)){for(var _0x1542d1 in _0x1756da){if(_0x1756da['hasOwnProperty'](_0x1542d1)){_0x1756da[_0x1542d1]['unlockRR']=!![];}}}}VoiceQueueReport[_0x36ac('0xb')][_0x36ac('0x36')]=function(){var _0x5daae8=this;for(var _0x2d1607 in this[_0x36ac('0x11')]){if(this['channels'][_0x36ac('0x31')](_0x2d1607)&&!this[_0x36ac('0x11')][_0x2d1607][_0x36ac('0x37')]){this[_0x36ac('0xe')][_0x36ac('0xc')](function(){if(!_[_0x36ac('0x38')](_0x5daae8['channels'][_0x2d1607])){return ami[_0x36ac('0x39')]({'action':_0x36ac('0x3a'),'channel':_0x5daae8['channels'][_0x2d1607][_0x36ac('0x3b')]})[_0x36ac('0x3c')](function(_0x3f5d5b){if(_0x3f5d5b[_0x36ac('0x3d')]===_0x36ac('0x3e')){setTimeout(function(){if(_0x5daae8['channels'][_0x2d1607]){delete _0x5daae8[_0x36ac('0x11')][_0x2d1607];logger[_0x36ac('0x3f')](_0x36ac('0x40'),_0x2d1607,util[_0x36ac('0x41')](_0x3f5d5b,{'showHidden':![],'depth':null}));}if(_0x5daae8['queueReports'][_0x2d1607]){delete _0x5daae8[_0x36ac('0xf')][_0x2d1607];logger[_0x36ac('0x3f')](_0x36ac('0x42'),_0x2d1607,util[_0x36ac('0x41')](_0x3f5d5b,{'showHidden':![],'depth':null}));}if(_0x5daae8[_0x36ac('0x16')][_0x2d1607]){delete _0x5daae8[_0x36ac('0x16')][_0x2d1607];logger['error']('[%s][voiceQueueReport][checkVariables]',_0x2d1607,util[_0x36ac('0x41')](_0x3f5d5b,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x36ac('0xb')][_0x36ac('0x28')]=function(){logger[_0x36ac('0x3f')](_0x36ac('0x43'));clearChannels(this['channels']);this[_0x36ac('0x44')](this['queueReports']);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x36ac('0x13')]);clearCampaigns(this[_0x36ac('0x15')]);};VoiceQueueReport['prototype'][_0x36ac('0x44')]=function(_0x1c8c62){var _0xed5be2=this;if(!_['isEmpty'](_0x1c8c62)){for(var _0x5a7387 in _0x1c8c62){if(_0x1c8c62[_0x36ac('0x31')](_0x5a7387)){_0xed5be2['emitVoiceQueueChannelRemove'](_0x1c8c62[_0x5a7387],_0x36ac('0x45'));delete _0x1c8c62[_0x5a7387];}}}};VoiceQueueReport[_0x36ac('0xb')]['emit']=function(_0x3a6e3a,_0x2d1129,_0x32b0b8){io['to'](_0x3a6e3a)[_0x36ac('0x46')](_0x2d1129,_0x32b0b8);};VoiceQueueReport['prototype'][_0x36ac('0x47')]=function(_0x35f9d3,_0x1577c1){logger[_0x36ac('0x48')]('[%s][voiceQueueReport]['+_0x1577c1+_0x36ac('0x49'),_0x35f9d3[_0x36ac('0x4a')],util[_0x36ac('0x41')](_0x35f9d3,{'showHidden':![],'depth':null}));this[_0x36ac('0x46')](util[_0x36ac('0x4b')]('voice:queue:%s',_0x35f9d3[_0x36ac('0x4c')]),_0x36ac('0x4d'),_0x35f9d3);io[_0x36ac('0x46')](_0x36ac('0x4e'),_0x35f9d3);};VoiceQueueReport[_0x36ac('0xb')][_0x36ac('0x4f')]=function(_0x36122b,_0x43e4fa){logger[_0x36ac('0x48')]('[%s][voiceQueueReport]['+_0x43e4fa+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x36122b[_0x36ac('0x4a')],util[_0x36ac('0x41')](_0x36122b,{'showHidden':![],'depth':null}));if(_0x36122b[_0x36ac('0x50')]===_0x36ac('0x51'))return;this[_0x36ac('0x46')](util['format']('voice:queue:%s',_0x36122b[_0x36ac('0x4c')]),_0x36ac('0x52'),_0x36122b);io['emit'](_0x36ac('0x53'),_0x36122b);};VoiceQueueReport['prototype'][_0x36ac('0x54')]=function(_0x5439d4,_0x416f51){if(_0x5439d4[_0x36ac('0x55')]==='inbound'){var _0x3980ef={'id':_0x5439d4['id'],'name':_0x5439d4[_0x36ac('0x4c')],'strategy':_0x5439d4['strategy'],'answered':_0x5439d4[_0x36ac('0x56')],'available':_0x5439d4['available'],'loggedIn':_0x5439d4[_0x36ac('0x57')],'pTalking':_0x5439d4['pTalking'],'sumBillable':_0x5439d4[_0x36ac('0x58')],'sumDuration':_0x5439d4[_0x36ac('0x59')],'sumHoldTime':_0x5439d4[_0x36ac('0x5a')]||0x0,'talking':_0x5439d4[_0x36ac('0x33')],'total':_0x5439d4[_0x36ac('0x5b')],'type':_0x5439d4[_0x36ac('0x55')],'unmanaged':_0x5439d4[_0x36ac('0x5c')],'abandoned':_0x5439d4[_0x36ac('0x5d')],'waiting':_0x5439d4['waiting']};if(_0x5439d4[_0x36ac('0x5e')]){_0x3980ef[_0x36ac('0x5e')]={'id':_0x5439d4['Trunk']['id'],'name':_0x5439d4[_0x36ac('0x5e')][_0x36ac('0x4c')],'active':_0x5439d4[_0x36ac('0x5e')]['active'],'callerid':_0x5439d4[_0x36ac('0x5e')][_0x36ac('0x5f')]};}if(_0x5439d4[_0x36ac('0x60')]){_0x3980ef['Interval']={'id':_0x5439d4['Interval']['id'],'name':_0x5439d4[_0x36ac('0x60')][_0x36ac('0x4c')]};}var _0x150fa1=md5(JSON[_0x36ac('0x61')](_0x3980ef));if(_0x5439d4['md5']!==_0x150fa1){_0x5439d4[_0x36ac('0x2')]=_0x150fa1;logger['debug'](_0x36ac('0x62')+_0x416f51+']\x20sending\x20voice_queue:save\x20event:',util[_0x36ac('0x41')](_0x3980ef,{'showHidden':![],'depth':null}));this['emit'](util[_0x36ac('0x4b')](_0x36ac('0x63'),_0x3980ef[_0x36ac('0x4c')]),'voice_queue:save',_0x3980ef);}}};VoiceQueueReport[_0x36ac('0xb')]['isNotNull']=function(_0x32c4ea){return _0x32c4ea!==null&&!_[_0x36ac('0x64')](_0x32c4ea);};VoiceQueueReport[_0x36ac('0xb')][_0x36ac('0x2f')]=function(){var _0x44fead=this;setInterval(function(){_0x44fead['clearZombieChannels']();ami[_0x36ac('0x39')]({'action':_0x36ac('0x65')})['catch'](function(_0x61406d){logger[_0x36ac('0x3f')](_0x36ac('0x66'),util[_0x36ac('0x41')](_0x61406d,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x36ac('0xb')]['loopQueueSummary']=function(){var _0x4f67c8=this;setInterval(function(){if(_0x4f67c8[_0x36ac('0x14')]){return ami[_0x36ac('0x39')]({'action':_0x36ac('0x17')})[_0x36ac('0x67')](function(){_0x4f67c8[_0x36ac('0x14')]=![];})[_0x36ac('0x3c')](function(_0x37650c){logger['error']('[voiceQueueReport][queuesummary]',util[_0x36ac('0x41')](_0x37650c,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x36ac('0xb')][_0x36ac('0x18')]=function(_0x52b98b){try{if(this[_0x36ac('0x68')](_0x52b98b)&&this[_0x36ac('0x68')](_0x52b98b[_0x36ac('0x69')])){logger[_0x36ac('0x48')](_0x36ac('0x6a'),util[_0x36ac('0x41')](_0x52b98b,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x52b98b[_0x36ac('0x69')]]){logger[_0x36ac('0x6b')](_0x36ac('0x6c'),_0x52b98b[_0x36ac('0x69')]);var _0x5db6bf=_[_0x36ac('0x6d')](this[_0x36ac('0x11')],_0x36ac('0x69'))[_0x52b98b[_0x36ac('0x69')]]||0x0;var _0x31cdd7=_0x5db6bf-_0x52b98b[_0x36ac('0x6e')];if(this[_0x36ac('0x13')][_0x52b98b[_0x36ac('0x69')]][_0x36ac('0x35')]!==_[_0x36ac('0x6f')](_0x52b98b[_0x36ac('0x6e')])||this[_0x36ac('0x13')][_0x52b98b[_0x36ac('0x69')]]['loggedIn']!==_['toNumber'](_0x52b98b['loggedin'])||this[_0x36ac('0x13')][_0x52b98b[_0x36ac('0x69')]][_0x36ac('0x70')]!==_[_0x36ac('0x6f')](_0x52b98b[_0x36ac('0x70')])||this[_0x36ac('0x13')][_0x52b98b[_0x36ac('0x69')]][_0x36ac('0x33')]!==_0x31cdd7){this[_0x36ac('0x13')][_0x52b98b[_0x36ac('0x69')]]['waiting']=_[_0x36ac('0x6f')](_0x52b98b[_0x36ac('0x6e')]);this['voiceQueues'][_0x52b98b[_0x36ac('0x69')]]['loggedIn']=_[_0x36ac('0x6f')](_0x52b98b[_0x36ac('0x71')]);this['voiceQueues'][_0x52b98b[_0x36ac('0x69')]][_0x36ac('0x70')]=_[_0x36ac('0x6f')](_0x52b98b[_0x36ac('0x70')]);this[_0x36ac('0x13')][_0x52b98b[_0x36ac('0x69')]][_0x36ac('0x33')]=_0x31cdd7>0x0?_0x31cdd7:0x0;this[_0x36ac('0x13')][_0x52b98b['queue']][_0x36ac('0x33')]=this[_0x36ac('0x13')][_0x52b98b['queue']][_0x36ac('0x33')]>_[_0x36ac('0x6f')](_0x52b98b[_0x36ac('0x71')])?_[_0x36ac('0x6f')](_0x52b98b[_0x36ac('0x71')]):this[_0x36ac('0x13')][_0x52b98b[_0x36ac('0x69')]][_0x36ac('0x33')];this['emitVoiceQueueSummary'](this[_0x36ac('0x13')][_0x52b98b['queue']],_0x36ac('0x17'));}logger[_0x36ac('0x48')](_0x36ac('0x72'),util['inspect'](this[_0x36ac('0x13')][_0x52b98b[_0x36ac('0x69')]],{'showHidden':![],'depth':null}));ami[_0x36ac('0x46')](_0x36ac('0x73'),this['voiceQueues'][_0x52b98b[_0x36ac('0x69')]]);}}}catch(_0x1d8e6d){logger[_0x36ac('0x3f')](_0x36ac('0x74'),util['inspect'](_0x1d8e6d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x36ac('0x1a')]=function(_0x2ea171){logger[_0x36ac('0x48')](_0x36ac('0x75'),util[_0x36ac('0x41')](_0x2ea171,{'showHidden':![],'depth':null}));ami['emit'](_0x36ac('0x76'),{});this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0x36ac('0x1d')]=function(_0xb4ec3b){try{if(this['isNotNull'](_0xb4ec3b)){logger[_0x36ac('0x48')](_0x36ac('0x77'),_0xb4ec3b[_0x36ac('0x4a')],util[_0x36ac('0x41')](_0xb4ec3b,{'showHidden':![],'depth':null}));if(_[_0x36ac('0x64')](this[_0x36ac('0xf')][_0xb4ec3b[_0x36ac('0x4a')]]))this[_0x36ac('0xf')][_0xb4ec3b[_0x36ac('0x4a')]]=[];if(_[_0x36ac('0x64')](this[_0x36ac('0x11')][_0xb4ec3b['uniqueid']]))this[_0x36ac('0x11')][_0xb4ec3b[_0x36ac('0x4a')]]={};var _0x321d5e=new QueueReport();_0x321d5e['name']=_0xb4ec3b[_0x36ac('0x69')];_0x321d5e[_0x36ac('0x55')]=this[_0x36ac('0x13')][_0x321d5e['name']]&&this[_0x36ac('0x13')][_0x321d5e['name']]['type']?this['voiceQueues'][_0x321d5e['name']][_0x36ac('0x55')]||_0x36ac('0x78'):_0x36ac('0x78');_0x321d5e[_0x36ac('0x69')]=_0xb4ec3b[_0x36ac('0x69')];_0x321d5e['queuecallerjoinAt']=moment()[_0x36ac('0x4b')](_0x36ac('0x79'));_0x321d5e['position']=_0xb4ec3b[_0x36ac('0x7a')];_0x321d5e['count']=_0xb4ec3b['count'];_0x321d5e[_0x36ac('0x4a')]=_0xb4ec3b[_0x36ac('0x4a')];_0x321d5e[_0x36ac('0x7b')]=this['channels'][_0xb4ec3b[_0x36ac('0x4a')]][_0x36ac('0x7b')];logger[_0x36ac('0x6b')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x321d5e[_0x36ac('0x4c')],_0x321d5e[_0x36ac('0x55')]);_[_0x36ac('0x7c')](_0x321d5e,_[_0x36ac('0x7d')](_0xb4ec3b,_[_0x36ac('0x7e')](_0x321d5e)));this[_0x36ac('0xf')][_0xb4ec3b[_0x36ac('0x4a')]][_0x36ac('0x7f')](_0x321d5e);this[_0x36ac('0x11')][_0xb4ec3b[_0x36ac('0x4a')]]=_0x321d5e;this[_0x36ac('0x47')](_0x321d5e,_0x36ac('0x1c'));}}catch(_0x2906ab){logger[_0x36ac('0x3f')](_0x36ac('0x77'),_0xb4ec3b[_0x36ac('0x4a')],util[_0x36ac('0x41')](_0x2906ab,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x36ac('0xb')][_0x36ac('0x80')]=function(_0x54d04b){try{if(this['isNotNull'](_0x54d04b)){logger[_0x36ac('0x48')]('[%s][voiceQueueReport][queuecallerabandon]',_0x54d04b['uniqueid'],util['inspect'](_0x54d04b,{'showHidden':![],'depth':null}));if(this[_0x36ac('0xf')][_0x54d04b[_0x36ac('0x4a')]]){var _0x1dcfed=_[_0x36ac('0x81')](this[_0x36ac('0xf')][_0x54d04b[_0x36ac('0x4a')]]);_0x1dcfed[_0x36ac('0x82')]=![];_0x1dcfed[_0x36ac('0x83')]=null;_0x1dcfed[_0x36ac('0x84')]=_0x54d04b[_0x36ac('0x84')];_0x1dcfed['originalposition']=_0x54d04b[_0x36ac('0x85')];_0x1dcfed['queuecallerabandon']=!![];_0x1dcfed[_0x36ac('0x86')]=moment()[_0x36ac('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x1dcfed[_0x36ac('0x50')]=_0x36ac('0x87');_0x1dcfed[_0x36ac('0x88')]=null;logger[_0x36ac('0x6b')](_0x36ac('0x89'),_0x1dcfed[_0x36ac('0x4c')],_0x1dcfed['type']);this[_0x36ac('0x11')][_0x54d04b['uniqueid']]=_0x1dcfed;this['emitVoiceQueueChannelRemove'](_0x1dcfed,_0x36ac('0x1e'));}}}catch(_0x412da4){logger[_0x36ac('0x3f')](_0x36ac('0x8a'),_0x54d04b[_0x36ac('0x4a')],util[_0x36ac('0x41')](_0x412da4,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x36ac('0x20')]=function(_0x51f2ff){try{if(this[_0x36ac('0x68')](_0x51f2ff)){logger[_0x36ac('0x48')](_0x36ac('0x8b'),_0x51f2ff[_0x36ac('0x4a')],util['inspect'](_0x51f2ff,{'showHidden':![],'depth':null}));if(this[_0x36ac('0xf')][_0x51f2ff['uniqueid']]){var _0x2840f0=_['last'](this[_0x36ac('0xf')][_0x51f2ff[_0x36ac('0x4a')]]);_0x2840f0['queuecallerleaveAt']=moment()[_0x36ac('0x4b')](_0x36ac('0x79'));_0x2840f0[_0x36ac('0x8c')]=_0x51f2ff['connectedlinenum'];_0x2840f0['connectedlinename']=_0x51f2ff[_0x36ac('0x8d')];logger[_0x36ac('0x6b')](_0x36ac('0x8e'),_0x2840f0[_0x36ac('0x4c')],_0x2840f0['type'],_0x51f2ff['connectedlinenum'],_0x51f2ff[_0x36ac('0x8d')]);this[_0x36ac('0x11')][_0x51f2ff[_0x36ac('0x4a')]]=_0x2840f0;this['emitVoiceQueueChannelSave'](_0x2840f0,_0x36ac('0x1f'));}}}catch(_0x4f81da){logger[_0x36ac('0x3f')](_0x36ac('0x8b'),_0x51f2ff[_0x36ac('0x4a')],util['inspect'](_0x4f81da,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x36ac('0xb')][_0x36ac('0x24')]=function(_0xb8a420){try{if(this['isNotNull'](_0xb8a420)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0xb8a420[_0x36ac('0x4a')],util['inspect'](_0xb8a420,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xb8a420[_0x36ac('0x4a')]]){var _0x473ae3=_[_0x36ac('0x81')](this[_0x36ac('0xf')][_0xb8a420[_0x36ac('0x4a')]]);_0x473ae3[_0x36ac('0x82')]=!![];_0x473ae3['queuecallerexitreason']=_0x36ac('0x8f');logger[_0x36ac('0x6b')](_0x36ac('0x90'),_0x473ae3[_0x36ac('0x4c')],_0x473ae3[_0x36ac('0x55')]);}}}catch(_0x23ad66){logger[_0x36ac('0x3f')](_0x36ac('0x91'),_0xb8a420[_0x36ac('0x4a')],util['inspect'](_0x23ad66,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x36ac('0xb')][_0x36ac('0x22')]=function(_0x49a9db){try{if(this[_0x36ac('0x68')](_0x49a9db)){logger[_0x36ac('0x48')](_0x36ac('0x92'),_0x49a9db[_0x36ac('0x4a')],util[_0x36ac('0x41')](_0x49a9db,{'showHidden':![],'depth':null}));if(this[_0x36ac('0xf')][_0x49a9db[_0x36ac('0x4a')]]){var _0x42440c=_[_0x36ac('0x81')](this['queueReports'][_0x49a9db[_0x36ac('0x4a')]]);_0x42440c[_0x36ac('0x1e')]=![];_0x42440c[_0x36ac('0x86')]=null;_0x42440c[_0x36ac('0x93')]=!![];_0x42440c[_0x36ac('0x88')]=_0x49a9db['membername'];_0x42440c[_0x36ac('0x84')]=_0x49a9db[_0x36ac('0x84')];_0x42440c[_0x36ac('0x82')]=!![];_0x42440c['queuecallerexit']=![];_0x42440c[_0x36ac('0x94')]=null;if(!_0x42440c[_0x36ac('0x95')]){if(_0x49a9db[_0x36ac('0x96')]=='transfer'){_0x42440c[_0x36ac('0x50')]='COMPLETED';logger[_0x36ac('0x6b')](_0x36ac('0x97'),_0x42440c['name'],_0x42440c[_0x36ac('0x55')]);}else{if(_[_0x36ac('0x98')](_0x49a9db[_0x36ac('0x3b')][_0x36ac('0x99')](),_0x36ac('0x9a'))){if(this[_0x36ac('0xf')][_0x49a9db['linkedid']]){var _0x4695ac=_[_0x36ac('0x81')](this[_0x36ac('0xf')][_0x49a9db['linkedid']]);_0x4695ac[_0x36ac('0x82')]=![];_0x4695ac[_0x36ac('0x9b')]=!![];_0x4695ac[_0x36ac('0x94')]=moment(_0x42440c['queuecallerjoinAt'])[_0x36ac('0x9c')](_0x49a9db[_0x36ac('0x84')],'seconds')[_0x36ac('0x4b')](_0x36ac('0x79'));_0x4695ac[_0x36ac('0x50')]=_0x36ac('0x9d');_0x4695ac[_0x36ac('0x95')]=!![];_0x4695ac[_0x36ac('0x9e')]='FORWARD';_0x4695ac[_0x36ac('0x9f')]=_0x49a9db[_0x36ac('0xa0')];_0x4695ac['transferuniqueid']=_0x49a9db[_0x36ac('0x4a')];logger['info'](_0x36ac('0xa1'),_0x4695ac[_0x36ac('0x4c')],_0x4695ac[_0x36ac('0x55')]);var _0x1e95d1=this['queueReports'][_0x49a9db[_0x36ac('0xa2')]];this[_0x36ac('0xf')][_0x49a9db[_0x36ac('0xa2')]]=this[_0x36ac('0xf')][_0x49a9db['uniqueid']];this[_0x36ac('0xf')][_0x49a9db[_0x36ac('0x4a')]]=_0x1e95d1;}}else{_0x42440c[_0x36ac('0x50')]=_0x36ac('0xa3')+_0x49a9db[_0x36ac('0x96')][_0x36ac('0xa4')]();logger[_0x36ac('0x6b')](_0x36ac('0xa5'),_0x42440c[_0x36ac('0x4c')],_0x42440c[_0x36ac('0x55')],_0x42440c[_0x36ac('0x50')]);}}}this[_0x36ac('0x11')][_0x49a9db[_0x36ac('0x4a')]]=_0x42440c;this[_0x36ac('0x4f')](_0x42440c,_0x36ac('0x21'));}}}catch(_0x29c495){logger[_0x36ac('0x3f')](_0x36ac('0x92'),_0x49a9db['uniqueid'],util['inspect'](_0x29c495,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x36ac('0xb')][_0x36ac('0x25')]=function(_0x503b6c){try{if(this[_0x36ac('0x68')](_0x503b6c)){logger[_0x36ac('0x48')](_0x36ac('0xa6'),_0x503b6c[_0x36ac('0x4a')],util[_0x36ac('0x41')](_0x503b6c,{'showHidden':![],'depth':null}));this['addVariable'](_0x503b6c[_0x36ac('0x4a')],_[_0x36ac('0x7e')](_0x503b6c['variable'])[0x0],_0x503b6c[_0x36ac('0xa7')]);if(this[_0x36ac('0xf')][_0x503b6c[_0x36ac('0x4a')]]){var _0x447fc8=_['last'](this['queueReports'][_0x503b6c['uniqueid']]);if(_0x447fc8){if(this['isNotNull'](_0x503b6c[_0x36ac('0xa8')])&&this[_0x36ac('0x68')](_0x503b6c[_0x36ac('0xa8')]['queuestatus'])){switch(_0x503b6c[_0x36ac('0xa7')]){case _0x36ac('0xa9'):_0x447fc8[_0x36ac('0x9b')]=![];_0x447fc8['queuecallerexitAt']=null;break;case _0x36ac('0xaa'):_0x447fc8['lastevent']=_0x36ac('0xab');_0x447fc8[_0x36ac('0x9b')]=!![];_0x447fc8[_0x36ac('0x94')]=moment()[_0x36ac('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x447fc8[_0x36ac('0xac')]=moment()['format'](_0x36ac('0x79'));logger[_0x36ac('0x48')](_0x36ac('0xad'),_0x503b6c[_0x36ac('0x4a')],util['inspect'](_0x447fc8,{'showHidden':![],'depth':null}));ami[_0x36ac('0x46')]('custom:timeout',_0x447fc8);break;default:_0x447fc8[_0x36ac('0x9b')]=!![];_0x447fc8['queuecallerexitAt']=moment()[_0x36ac('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x447fc8[_0x36ac('0xac')]=moment()['format'](_0x36ac('0x79'));}_0x447fc8['queuecallerabandon']=![];_0x447fc8[_0x36ac('0x86')]=null;_0x447fc8[_0x36ac('0x50')]=_0x503b6c[_0x36ac('0xa7')];this[_0x36ac('0x11')][_0x503b6c[_0x36ac('0x4a')]]=_0x447fc8;this['emitVoiceQueueChannelRemove'](_0x447fc8,'varset');}else if(this[_0x36ac('0x68')](_0x503b6c['variable'])&&this[_0x36ac('0x68')](_0x503b6c[_0x36ac('0xa8')][_0x36ac('0xae')])){if(!_0x447fc8[_0x36ac('0x1e')]){_0x447fc8[_0x36ac('0x9b')]=!![];_0x447fc8['queuecallerexitAt']=moment()[_0x36ac('0x4b')](_0x36ac('0x79'));_0x447fc8[_0x36ac('0x50')]=_0x36ac('0xaf');_0x447fc8[_0x36ac('0xac')]=moment()[_0x36ac('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x36ac('0x11')][_0x503b6c[_0x36ac('0x4a')]]=_0x447fc8;}}logger[_0x36ac('0x6b')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x503b6c[_0x36ac('0x4a')],_0x447fc8[_0x36ac('0x4c')],_0x447fc8[_0x36ac('0x55')],_[_0x36ac('0x7e')](_0x503b6c[_0x36ac('0xa8')])[0x0],_0x503b6c[_0x36ac('0xa7')]);_0x447fc8['variables']=this[_0x36ac('0x16')][_0x503b6c[_0x36ac('0x4a')]];}}}}catch(_0x11a0bc){logger[_0x36ac('0x3f')]('[%s][voiceQueueReport][varset]',_0x503b6c[_0x36ac('0x4a')],util[_0x36ac('0x41')](_0x11a0bc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x36ac('0xb')]['addVariable']=function(_0x5a3643,_0x928368,_0x1397ae){var _0x299689=[_0x36ac('0xb0'),_0x36ac('0xb1'),_0x36ac('0xb2'),_0x36ac('0xb3'),_0x36ac('0xb4'),_0x36ac('0xb5'),'rtpaudioqosrtt',_0x36ac('0xb6'),_0x36ac('0xb7'),_0x36ac('0xb8'),_0x36ac('0xb9'),_0x36ac('0xba'),_0x36ac('0xbb'),_0x36ac('0xbc'),'memberinterface',_0x36ac('0xbd'),'membername',_0x36ac('0xbe'),_0x36ac('0xbf')];if(!_['isNil'](_0x928368)&&!_['includes'](_0x299689,_0x928368)){if(_['isUndefined'](this['variables'][_0x5a3643])){this[_0x36ac('0x16')][_0x5a3643]={};}this[_0x36ac('0x16')][_0x5a3643][_0x928368]=_0x1397ae;}};VoiceQueueReport[_0x36ac('0xb')][_0x36ac('0xc0')]=function(_0x414405,_0x55056b,_0x54d7f8){var _0x29061c={};for(var _0x3abc44=0x0;_0x3abc44<this[_0x36ac('0xf')][_0x414405][_0x36ac('0xc1')];_0x3abc44+=0x1){_0x29061c=this['queueReports'][_0x414405][_0x3abc44];if(this[_0x36ac('0x13')][_0x29061c[_0x36ac('0x69')]]){if(_0x29061c['queuecallerexit']&&_0x29061c[_0x36ac('0x95')]!=!![]){this[_0x36ac('0x13')][_0x29061c['queue']][_0x36ac('0x5c')]+=0x1;}if(_0x29061c[_0x36ac('0x1e')]){this['voiceQueues'][_0x29061c[_0x36ac('0x69')]][_0x36ac('0x5d')]+=0x1;}this[_0x36ac('0x13')][_0x29061c['queue']][_0x36ac('0x5a')]+=moment(_0x29061c['queuecallerleaveAt'])['diff'](_0x29061c[_0x36ac('0xc2')],_0x36ac('0xc3'))||0x0;if(_0x3abc44===this[_0x36ac('0xf')][_0x414405][_0x36ac('0xc1')]-0x1){this[_0x36ac('0x13')][_0x29061c[_0x36ac('0x69')]][_0x36ac('0x59')]+=moment()['milliseconds'](0x0)[_0x36ac('0xc4')](_0x29061c[_0x36ac('0xc2')],_0x36ac('0xc3'));this['voiceQueues'][_0x29061c['queue']][_0x36ac('0x5b')]+=0x1;if(_0x29061c[_0x36ac('0x82')]){this[_0x36ac('0x13')][_0x29061c['queue']]['answered']+=0x1;this[_0x36ac('0x13')][_0x29061c[_0x36ac('0x69')]][_0x36ac('0x58')]+=moment()[_0x36ac('0xc5')](0x0)[_0x36ac('0xc4')](_0x29061c[_0x36ac('0xac')],_0x36ac('0xc3'));_0x29061c[_0x36ac('0x83')]=moment()[_0x36ac('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x29061c['queuecallerexit']=![];_0x29061c[_0x36ac('0x94')]=null;}if(_0x29061c[_0x36ac('0x9b')]&&_0x29061c[_0x36ac('0x95')]!=!![]){_0x29061c['lastevent']=_0x36ac('0x5c');logger[_0x36ac('0x48')](_0x36ac('0xc6'),_0x414405,util['inspect'](_0x29061c,{'showHidden':![],'depth':null}));ami[_0x36ac('0x46')](_0x36ac('0xc7'),_0x29061c);}if(_0x29061c[_0x36ac('0x1e')]){_0x29061c[_0x36ac('0xc8')]='abandoned';logger[_0x36ac('0x48')](_0x36ac('0xc9'),_0x414405,util[_0x36ac('0x41')](_0x29061c,{'showHidden':![],'depth':null}));ami[_0x36ac('0x46')](_0x36ac('0xca'),_0x29061c);}}else{this[_0x36ac('0x13')][_0x29061c['queue']][_0x36ac('0x59')]+=this['voiceQueues'][_0x29061c[_0x36ac('0x69')]][_0x36ac('0x5a')];}logger[_0x36ac('0x6b')](_0x36ac('0xcb'),_0x414405,_0x29061c[_0x36ac('0x4c')],_0x29061c[_0x36ac('0x55')],_0x55056b);if(_0x54d7f8&&_0x29061c['queuecallerexitreason']===_0x36ac('0x51')){_0x29061c[_0x36ac('0x50')]=_0x36ac('0x8f');}this[_0x36ac('0x11')][_0x414405]=_0x29061c;this['emitVoiceQueueChannelRemove'](_0x29061c,_0x36ac('0x26'));this[_0x36ac('0x54')](this['voiceQueues'][_0x29061c['queue']],_0x36ac('0x26'));}}logger[_0x36ac('0x48')](_0x36ac('0xcc'),_0x414405,util[_0x36ac('0x41')](this[_0x36ac('0xf')][_0x414405],{'showHidden':![],'depth':null}));ami[_0x36ac('0x46')](_0x36ac('0xcd'),this[_0x36ac('0xf')][_0x414405]);if(_0x29061c['queuecallerexitreason']==='ATTENDEDTRANSFER')return;delete this['queueReports'][_0x414405];delete this[_0x36ac('0x11')][_0x414405];if(this[_0x36ac('0x16')][_0x414405]){delete this[_0x36ac('0x16')][_0x414405];}};VoiceQueueReport[_0x36ac('0xb')][_0x36ac('0xce')]=function(_0x1f3911){try{if(this['isNotNull'](_0x1f3911)){logger['debug']('[%s][voiceQueueReport][hangup]',_0x1f3911[_0x36ac('0x4a')],util[_0x36ac('0x41')](_0x1f3911,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1f3911[_0x36ac('0x4a')]]){return this[_0x36ac('0xc0')](_0x1f3911['uniqueid'],_0x1f3911['cause-txt']);}if(this['queueReports'][_0x1f3911[_0x36ac('0xa2')]]){if(_0x1f3911[_0x36ac('0xcf')]==='21'){return;}return this[_0x36ac('0xc0')](_0x1f3911[_0x36ac('0xa2')],_0x1f3911[_0x36ac('0xd0')],!![]);}var _0x3b6eca=Object[_0x36ac('0x7e')](this[_0x36ac('0xf')]);for(var _0x4a607d=0x0;_0x4a607d<_0x3b6eca[_0x36ac('0xc1')];_0x4a607d++){var _0x33e14e=_[_0x36ac('0x81')](this['queueReports'][_0x3b6eca[_0x4a607d]]);if(_0x33e14e&&_0x33e14e[_0x36ac('0xd1')]===_0x1f3911[_0x36ac('0x4a')]){return this[_0x36ac('0xc0')](_0x33e14e['uniqueid'],_0x1f3911[_0x36ac('0xd0')],!![]);}}}}catch(_0x2df0bc){logger['error']('[%s][voiceQueueReport][hangup]',_0x1f3911[_0x36ac('0x4a')],util[_0x36ac('0x41')](_0x2df0bc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x36ac('0xb')][_0x36ac('0x2d')]=function(_0x3561dc){try{if(this['isNotNull'](_0x3561dc)){logger['debug']('[%s][voiceQueueReport][attendedtransfer]',_0x3561dc[_0x36ac('0x4a')],util[_0x36ac('0x41')](_0x3561dc,{'showHidden':![],'depth':null}));var _0x630849;var _0x1b1d0d;var _0x10184f;if(this[_0x36ac('0xf')][_0x3561dc['transfereeuniqueid']]){_0x630849=_[_0x36ac('0x81')](this[_0x36ac('0xf')][_0x3561dc['transfereeuniqueid']]);_0x630849[_0x36ac('0x9f')]=_0x3561dc['secondtransfererexten'];_0x630849[_0x36ac('0xd2')]=_0x3561dc['secondtransfereruniqueid'];_0x630849[_0x36ac('0x50')]=_0x36ac('0x51');_0x630849['transfer']=!![];_0x630849[_0x36ac('0x9e')]='ATTENDED';if(this[_0x36ac('0xf')][_0x3561dc['secondtransfereruniqueid']]){_0x10184f=this['queueReports'][_0x3561dc['secondtransfereruniqueid']];this['queueReports'][_0x3561dc[_0x36ac('0xd3')]]=this[_0x36ac('0xf')][_0x3561dc[_0x36ac('0xd4')]];this[_0x36ac('0xf')][_0x3561dc[_0x36ac('0xd4')]]=_0x10184f;_0x1b1d0d=_[_0x36ac('0x81')](this[_0x36ac('0xf')][_0x3561dc[_0x36ac('0xd4')]]);_0x1b1d0d[_0x36ac('0x37')]=!![];}logger[_0x36ac('0x6b')](_0x36ac('0xd5'),_0x3561dc[_0x36ac('0x4a')],_0x630849['name'],_0x630849[_0x36ac('0x55')],_0x630849[_0x36ac('0x9f')],_0x630849[_0x36ac('0xd2')]);}else if(this['queueReports'][_0x3561dc[_0x36ac('0xd6')]]){_0x630849=_[_0x36ac('0x81')](this['queueReports'][_0x3561dc[_0x36ac('0xd6')]]);_0x630849[_0x36ac('0x9f')]=_0x3561dc['origtransfererexten'];_0x630849['transferuniqueid']=_0x3561dc['origtransfereruniqueid'];_0x630849[_0x36ac('0x50')]=_0x36ac('0x51');_0x630849['transfer']=!![];_0x630849[_0x36ac('0x9e')]=_0x36ac('0xd7');if(this['queueReports'][_0x3561dc['origtransfereruniqueid']]){_0x10184f=this[_0x36ac('0xf')][_0x3561dc[_0x36ac('0xd8')]];this[_0x36ac('0xf')][_0x3561dc[_0x36ac('0xd8')]]=this[_0x36ac('0xf')][_0x3561dc[_0x36ac('0xd6')]];this['queueReports'][_0x3561dc[_0x36ac('0xd6')]]=_0x10184f;_0x1b1d0d=_['last'](this[_0x36ac('0xf')][_0x3561dc[_0x36ac('0xd6')]]);_0x1b1d0d['switch']=!![];}logger[_0x36ac('0x6b')](_0x36ac('0xd5'),_0x3561dc[_0x36ac('0x4a')],_0x630849[_0x36ac('0x4c')],_0x630849['type'],_0x630849['transferexten'],_0x630849[_0x36ac('0xd2')]);}else if(this[_0x36ac('0xf')][_0x3561dc[_0x36ac('0xd8')]]){_0x630849=_[_0x36ac('0x81')](this[_0x36ac('0xf')][_0x3561dc[_0x36ac('0xd8')]]);_0x630849[_0x36ac('0x9f')]=_0x3561dc[_0x36ac('0xd9')];_0x630849['transferuniqueid']=_0x3561dc[_0x36ac('0xd8')];_0x630849[_0x36ac('0x50')]=_0x36ac('0x51');_0x630849['transfer']=!![];_0x630849['transfertype']=_0x36ac('0xd7');_0x630849['switch']=!![];_0x630849[_0x36ac('0xd1')]=_0x3561dc[_0x36ac('0xd4')];}else if(this[_0x36ac('0xf')][_0x3561dc[_0x36ac('0xd3')]]){_0x630849=_[_0x36ac('0x81')](this[_0x36ac('0xf')][_0x3561dc[_0x36ac('0xd3')]]);_0x630849[_0x36ac('0x9f')]=_0x3561dc['secondtransfererexten'];_0x630849[_0x36ac('0xd2')]=_0x3561dc[_0x36ac('0xd3')];_0x630849[_0x36ac('0x50')]='ATTENDEDTRANSFER';_0x630849[_0x36ac('0x95')]=!![];_0x630849[_0x36ac('0x9e')]=_0x36ac('0xd7');_0x630849[_0x36ac('0x37')]=!![];_0x630849[_0x36ac('0xd1')]=_0x3561dc[_0x36ac('0xd6')];}}}catch(_0x35a208){logger[_0x36ac('0x3f')](_0x36ac('0xda'),_0x3561dc['uniqueid'],util['inspect'](_0x35a208,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x36ac('0xb')]['syncBlindTransfer']=function(_0x8f710b){try{if(this[_0x36ac('0x68')](_0x8f710b)){logger[_0x36ac('0x48')]('[%s][voiceQueueReport][blindtransfer]',_0x8f710b[_0x36ac('0x4a')],util[_0x36ac('0x41')](_0x8f710b,{'showHidden':![],'depth':null}));if(this[_0x36ac('0xf')][_0x8f710b['transfereeuniqueid']]){var _0x53fe21=_[_0x36ac('0x81')](this['queueReports'][_0x8f710b['transfereeuniqueid']]);_0x53fe21[_0x36ac('0x50')]=_0x36ac('0xdb');_0x53fe21[_0x36ac('0x95')]=!![];_0x53fe21[_0x36ac('0x9e')]=_0x36ac('0xdc');_0x53fe21['transferexten']=_0x8f710b[_0x36ac('0xdd')];_0x53fe21[_0x36ac('0xd2')]=_0x8f710b[_0x36ac('0xd4')];logger[_0x36ac('0x6b')](_0x36ac('0xde'),_0x8f710b[_0x36ac('0x4a')],_0x53fe21[_0x36ac('0x4c')],_0x53fe21['type'],_0x53fe21[_0x36ac('0x9f')],_0x53fe21[_0x36ac('0xd2')]);this[_0x36ac('0xce')]({'event':'BlindTransfer','uniqueid':_0x8f710b[_0x36ac('0xd4')],'context':_0x8f710b[_0x36ac('0xdf')],'channel':_0x8f710b[_0x36ac('0xe0')]});}}}catch(_0x3ba2a8){logger['error'](_0x36ac('0xe1'),_0x8f710b[_0x36ac('0x4a')],util[_0x36ac('0x41')](_0x3ba2a8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x36ac('0xb')][_0x36ac('0xe2')]=function(_0x5c770e){try{if(this['isNotNull'](_0x5c770e)){logger[_0x36ac('0x48')](_0x36ac('0xe3'),_0x5c770e[_0x36ac('0x4a')],util['inspect'](_0x5c770e,{'showHidden':![],'depth':null}));if(this[_0x36ac('0xf')][_0x5c770e[_0x36ac('0x4a')]]){var _0x3fc4aa=_['last'](this[_0x36ac('0xf')][_0x5c770e['uniqueid']]);if(!_['isNil'](_0x3fc4aa[_0x36ac('0xac')])){_0x3fc4aa['mohstarttime']=moment()[_0x36ac('0x4b')](_0x36ac('0x79'));logger['info'](_0x36ac('0xe4'),_0x5c770e['uniqueid'],_0x3fc4aa['mohstarttime']);}}}}catch(_0x79fe06){logger[_0x36ac('0x3f')]('[%s][voiceQueueReport][musiconholdstart]',_0x5c770e[_0x36ac('0x4a')],util[_0x36ac('0x41')](_0x79fe06,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x36ac('0xb')]['syncMusicOnHoldStop']=function(_0x5b04d3){try{if(this[_0x36ac('0x68')](_0x5b04d3)){logger[_0x36ac('0x48')](_0x36ac('0xe5'),_0x5b04d3[_0x36ac('0x4a')],util[_0x36ac('0x41')](_0x5b04d3,{'showHidden':![],'depth':null}));if(this[_0x36ac('0xf')][_0x5b04d3[_0x36ac('0x4a')]]){var _0x2a02b5=_['last'](this['queueReports'][_0x5b04d3['uniqueid']]);if(!_[_0x36ac('0x38')](_0x2a02b5['mohstarttime'])){_0x2a02b5[_0x36ac('0xe6')]+=moment()[_0x36ac('0xc5')](0x0)[_0x36ac('0xc4')](_0x2a02b5[_0x36ac('0xe7')],_0x36ac('0xc3'));logger['info'](_0x36ac('0xe8'),_0x5b04d3[_0x36ac('0x4a')],_0x2a02b5[_0x36ac('0xe6')]);delete _0x2a02b5[_0x36ac('0xe7')];}}}}catch(_0x4e4aaf){logger['error'](_0x36ac('0xe5'),_0x5b04d3[_0x36ac('0x4a')],util['inspect'](_0x4e4aaf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x36ac('0xb')][_0x36ac('0xe9')]=function(_0x3144b7){try{if(this[_0x36ac('0x68')](_0x3144b7)){logger[_0x36ac('0x48')]('[%s][voiceQueueReport][newexten]\x20event:',_0x3144b7[_0x36ac('0x4a')],util[_0x36ac('0x41')](_0x3144b7,{'showHidden':![],'depth':null}));if(_0x3144b7[_0x36ac('0xea')]['toLowerCase']()==='set'){_0x3144b7[_0x36ac('0xeb')]=_0x3144b7[_0x36ac('0xec')]&&_0x3144b7[_0x36ac('0xec')]['startsWith']('CDR(routeAlias)')?_0x3144b7[_0x36ac('0xec')]:(_0x3144b7[_0x36ac('0xec')]||_0x3144b7['applicationdata'])['toLowerCase']();if(_['startsWith'](_0x3144b7['applicationdata'][_0x36ac('0x99')](),'cdr(')){logger[_0x36ac('0x6b')](_0x36ac('0xed'),_0x3144b7['uniqueid'],_0x3144b7['application'],_0x3144b7[_0x36ac('0xeb')]);if(_['isUndefined'](this['channels'][_0x3144b7[_0x36ac('0x4a')]]))this['channels'][_0x3144b7['uniqueid']]={};var _0x297a1a=_0x3144b7['applicationdata'][_0x36ac('0xee')]('=');var _0x2871a7=_0x297a1a[0x0][_0x36ac('0x99')]()[_0x36ac('0xef')](/cdr\((.*)\)/);if(_0x2871a7)this['channels'][_0x3144b7['uniqueid']][_0x2871a7[0x1]]=_0x297a1a[0x1];}}}}catch(_0x490a03){logger[_0x36ac('0x3f')](_0x36ac('0xf0'),_0x3144b7[_0x36ac('0x4a')],util[_0x36ac('0x41')](_0x490a03,{'showHidden':![],'depth':null}));}};module[_0x36ac('0xf1')]=VoiceQueueReport;
\ No newline at end of file
+var _0x53d6=['talking','pTalking','unlockRR','prototype','clearZombieChannels','switch','isNil','Action','status','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','[%s][voiceQueueReport][checkQueueReport]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','debug','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','available','loggedIn','sumBillable','sumDuration','sumHoldTime','unmanaged','waiting','Trunk','active','callerid','Interval','md5','[voiceQueueReport][','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','then','[voiceQueueReport][queuesummary]','queue','countBy','toNumber','loggedin','callers','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','position','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','keys','push','queuecallerjoin','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','originalposition','YYYY-MM-DD\x20HH:mm:ss','ABANDONED','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][queuecallerleave]','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','queuecallerabandonAt','assigned','lastAssignedTo','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','local/','linkedid','holdtime','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','reason','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][agentcomplete]','[%s][voiceQueueReport][varset]','addVariable','variable','queuestatus','value','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','handleHangup','length','abandoned','diff','queuecallerjoinAt','milliseconds','total','answered','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','cause-txt','cause','transferid','transfereeuniqueid','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedtransfer]','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','extension','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','application','split','[%s][voiceQueueReport][newexten]','lodash','moment','ioredis','../../../config/logger','redis','enqueue','tail','finally','sequence','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','hasOwnProperty','originated','isEmpty'];(function(_0x4c9ef9,_0x5656c3){var _0x169055=function(_0x2c4a74){while(--_0x2c4a74){_0x4c9ef9['push'](_0x4c9ef9['shift']());}};_0x169055(++_0x5656c3);}(_0x53d6,0x1ae));var _0x653d=function(_0x2390e5,_0x369025){_0x2390e5=_0x2390e5-0x0;var _0xa6038f=_0x53d6[_0x2390e5];return _0xa6038f;};'use strict';var _=require(_0x653d('0x0'));var moment=require(_0x653d('0x1'));var util=require('util');var md5=require('md5');var Redis=require(_0x653d('0x2'));var config=require('../../../config/environment');var logger=require(_0x653d('0x3'))('ami');var ami=require('../ami');var QueueReport=require('../model/queueReport');config[_0x653d('0x4')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x653d('0x4')]));var Sequence=function(){};Sequence['prototype'][_0x653d('0x5')]=function(_0x4cb1f4){this[_0x653d('0x6')]=this[_0x653d('0x6')]?this[_0x653d('0x6')][_0x653d('0x7')](_0x4cb1f4):_0x4cb1f4();};function VoiceQueueReport(_0x3315d9){this[_0x653d('0x8')]=new Sequence();this['queueReports']={};this[_0x653d('0x9')]=_0x3315d9[_0x653d('0x9')];this[_0x653d('0xa')]=_0x3315d9[_0x653d('0xb')];this[_0x653d('0xc')]=_0x3315d9[_0x653d('0xc')];this[_0x653d('0xd')]=!![];this[_0x653d('0xe')]=_0x3315d9[_0x653d('0xe')];this[_0x653d('0xf')]={};ami['on'](_0x653d('0x10'),this[_0x653d('0x11')][_0x653d('0x12')](this));ami['on'](_0x653d('0x13'),this[_0x653d('0x14')][_0x653d('0x12')](this));ami['on']('queuecallerjoin',this[_0x653d('0x15')][_0x653d('0x12')](this));ami['on'](_0x653d('0x16'),this[_0x653d('0x17')][_0x653d('0x12')](this));ami['on'](_0x653d('0x18'),this[_0x653d('0x19')][_0x653d('0x12')](this));ami['on'](_0x653d('0x1a'),this[_0x653d('0x1b')][_0x653d('0x12')](this));ami['on'](_0x653d('0x1c'),this[_0x653d('0x1d')]['bind'](this));ami['on'](_0x653d('0x1e'),this[_0x653d('0x1f')]['bind'](this));ami['on']('hangup',this[_0x653d('0x20')][_0x653d('0x12')](this));ami['on'](_0x653d('0x21'),this[_0x653d('0x22')][_0x653d('0x12')](this));ami['on'](_0x653d('0x23'),this[_0x653d('0x24')][_0x653d('0x12')](this));ami['on']('musiconholdstop',this[_0x653d('0x25')][_0x653d('0x12')](this));ami['on'](_0x653d('0x26'),this[_0x653d('0x27')][_0x653d('0x12')](this));ami['on']('blindtransfer',this[_0x653d('0x28')]['bind'](this));this[_0x653d('0x29')]();this[_0x653d('0x2a')]();}function clearChannels(_0x5ad5de){if(!_['isEmpty'](_0x5ad5de)){for(var _0x93bb0b in _0x5ad5de){if(_0x5ad5de[_0x653d('0x2b')](_0x93bb0b)){delete _0x5ad5de[_0x93bb0b];}}}}function clearCampaigns(_0x41011f){if(!_['isEmpty'](_0x41011f)){for(var _0x582af6 in _0x41011f){if(_0x41011f[_0x653d('0x2b')](_0x582af6)){_0x41011f[_0x582af6][_0x653d('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x198faa){if(!_[_0x653d('0x2d')](_0x198faa)){for(var _0x3d5fba in _0x198faa){if(_0x198faa[_0x653d('0x2b')](_0x3d5fba)){_0x198faa[_0x3d5fba]['originated']=0x0;_0x198faa[_0x3d5fba][_0x653d('0x2e')]=0x0;_0x198faa[_0x3d5fba][_0x653d('0x2f')]=0x0;_0x198faa[_0x3d5fba]['waiting']=0x0;_0x198faa[_0x3d5fba]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x1b2879){if(!_[_0x653d('0x2d')](_0x1b2879)){for(var _0x3b5c0e in _0x1b2879){if(_0x1b2879['hasOwnProperty'](_0x3b5c0e)){_0x1b2879[_0x3b5c0e][_0x653d('0x30')]=!![];}}}}VoiceQueueReport[_0x653d('0x31')][_0x653d('0x32')]=function(){var _0x10e61d=this;for(var _0x482e6d in this[_0x653d('0xa')]){if(this[_0x653d('0xa')]['hasOwnProperty'](_0x482e6d)&&!this[_0x653d('0xa')][_0x482e6d][_0x653d('0x33')]){this[_0x653d('0x8')]['enqueue'](function(){if(!_[_0x653d('0x34')](_0x10e61d[_0x653d('0xa')][_0x482e6d])){return ami[_0x653d('0x35')]({'action':_0x653d('0x36'),'channel':_0x10e61d[_0x653d('0xa')][_0x482e6d]['channel']})[_0x653d('0x37')](function(_0x132900){if(_0x132900[_0x653d('0x38')]===_0x653d('0x39')){setTimeout(function(){if(_0x10e61d[_0x653d('0xa')][_0x482e6d]){delete _0x10e61d[_0x653d('0xa')][_0x482e6d];logger[_0x653d('0x3a')](_0x653d('0x3b'),_0x482e6d,util[_0x653d('0x3c')](_0x132900,{'showHidden':![],'depth':null}));}if(_0x10e61d[_0x653d('0x3d')][_0x482e6d]){delete _0x10e61d['queueReports'][_0x482e6d];logger['error'](_0x653d('0x3e'),_0x482e6d,util[_0x653d('0x3c')](_0x132900,{'showHidden':![],'depth':null}));}if(_0x10e61d[_0x653d('0xf')][_0x482e6d]){delete _0x10e61d[_0x653d('0xf')][_0x482e6d];logger[_0x653d('0x3a')]('[%s][voiceQueueReport][checkVariables]',_0x482e6d,util[_0x653d('0x3c')](_0x132900,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x653d('0x31')][_0x653d('0x22')]=function(){logger[_0x653d('0x3a')](_0x653d('0x3f'));clearChannels(this['channels']);this[_0x653d('0x40')](this[_0x653d('0x3d')]);clearAgentBooked(this[_0x653d('0x9')]);clearVoiceQueues(this[_0x653d('0xc')]);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0x653d('0x31')][_0x653d('0x40')]=function(_0x549bae){var _0x418eec=this;if(!_['isEmpty'](_0x549bae)){for(var _0x21fec2 in _0x549bae){if(_0x549bae['hasOwnProperty'](_0x21fec2)){_0x418eec[_0x653d('0x41')](_0x549bae[_0x21fec2],_0x653d('0x42'));delete _0x549bae[_0x21fec2];}}}};VoiceQueueReport['prototype'][_0x653d('0x43')]=function(_0x424f4f,_0xc816de,_0x471912){io['to'](_0x424f4f)[_0x653d('0x43')](_0xc816de,_0x471912);};VoiceQueueReport['prototype'][_0x653d('0x44')]=function(_0x39db73,_0x2cfd78){logger['debug'](_0x653d('0x45')+_0x2cfd78+_0x653d('0x46'),_0x39db73[_0x653d('0x47')],util[_0x653d('0x3c')](_0x39db73,{'showHidden':![],'depth':null}));this[_0x653d('0x43')](util[_0x653d('0x48')](_0x653d('0x49'),_0x39db73[_0x653d('0x4a')]),_0x653d('0x4b'),_0x39db73);io[_0x653d('0x43')](_0x653d('0x4c'),_0x39db73);};VoiceQueueReport[_0x653d('0x31')][_0x653d('0x41')]=function(_0x5b026e,_0x39d5a5){logger[_0x653d('0x4d')](_0x653d('0x45')+_0x39d5a5+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x5b026e[_0x653d('0x47')],util[_0x653d('0x3c')](_0x5b026e,{'showHidden':![],'depth':null}));if(_0x5b026e[_0x653d('0x4e')]===_0x653d('0x4f'))return;this[_0x653d('0x43')](util['format'](_0x653d('0x49'),_0x5b026e[_0x653d('0x4a')]),'voice_queue_channel:remove',_0x5b026e);io[_0x653d('0x43')](_0x653d('0x50'),_0x5b026e);};VoiceQueueReport[_0x653d('0x31')][_0x653d('0x51')]=function(_0x5c4deb,_0x403c79){if(_0x5c4deb[_0x653d('0x52')]===_0x653d('0x53')){var _0x177173={'id':_0x5c4deb['id'],'name':_0x5c4deb['name'],'strategy':_0x5c4deb['strategy'],'answered':_0x5c4deb['answered'],'available':_0x5c4deb[_0x653d('0x54')],'loggedIn':_0x5c4deb[_0x653d('0x55')],'pTalking':_0x5c4deb['pTalking'],'sumBillable':_0x5c4deb[_0x653d('0x56')],'sumDuration':_0x5c4deb[_0x653d('0x57')],'sumHoldTime':_0x5c4deb[_0x653d('0x58')]||0x0,'talking':_0x5c4deb['talking'],'total':_0x5c4deb['total'],'type':_0x5c4deb[_0x653d('0x52')],'unmanaged':_0x5c4deb[_0x653d('0x59')],'abandoned':_0x5c4deb['abandoned'],'waiting':_0x5c4deb[_0x653d('0x5a')]};if(_0x5c4deb['Trunk']){_0x177173[_0x653d('0x5b')]={'id':_0x5c4deb[_0x653d('0x5b')]['id'],'name':_0x5c4deb[_0x653d('0x5b')][_0x653d('0x4a')],'active':_0x5c4deb[_0x653d('0x5b')][_0x653d('0x5c')],'callerid':_0x5c4deb[_0x653d('0x5b')][_0x653d('0x5d')]};}if(_0x5c4deb[_0x653d('0x5e')]){_0x177173[_0x653d('0x5e')]={'id':_0x5c4deb[_0x653d('0x5e')]['id'],'name':_0x5c4deb['Interval'][_0x653d('0x4a')]};}var _0x463c3c=md5(JSON['stringify'](_0x177173));if(_0x5c4deb[_0x653d('0x5f')]!==_0x463c3c){_0x5c4deb[_0x653d('0x5f')]=_0x463c3c;logger['debug'](_0x653d('0x60')+_0x403c79+']\x20sending\x20voice_queue:save\x20event:',util[_0x653d('0x3c')](_0x177173,{'showHidden':![],'depth':null}));this['emit'](util[_0x653d('0x48')](_0x653d('0x49'),_0x177173[_0x653d('0x4a')]),_0x653d('0x61'),_0x177173);}}};VoiceQueueReport[_0x653d('0x31')][_0x653d('0x62')]=function(_0x2af58f){return _0x2af58f!==null&&!_[_0x653d('0x63')](_0x2af58f);};VoiceQueueReport[_0x653d('0x31')][_0x653d('0x2a')]=function(){var _0x276941=this;setInterval(function(){_0x276941['clearZombieChannels']();ami['Action']({'action':_0x653d('0x64')})[_0x653d('0x37')](function(_0x2ecd97){logger[_0x653d('0x3a')](_0x653d('0x65'),util['inspect'](_0x2ecd97,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x653d('0x31')][_0x653d('0x29')]=function(){var _0x1a8c74=this;setInterval(function(){if(_0x1a8c74[_0x653d('0xd')]){return ami[_0x653d('0x35')]({'action':'queuesummary'})[_0x653d('0x66')](function(){_0x1a8c74[_0x653d('0xd')]=![];})[_0x653d('0x37')](function(_0x384b0c){logger[_0x653d('0x3a')](_0x653d('0x67'),util[_0x653d('0x3c')](_0x384b0c,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x653d('0x31')][_0x653d('0x11')]=function(_0x3c6960){try{if(this[_0x653d('0x62')](_0x3c6960)&&this['isNotNull'](_0x3c6960['queue'])){logger[_0x653d('0x4d')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x653d('0x3c')](_0x3c6960,{'showHidden':![],'depth':null}));if(this[_0x653d('0xc')][_0x3c6960[_0x653d('0x68')]]){logger['info']('[voiceQueueReport][queuesummary]\x20name:%s',_0x3c6960[_0x653d('0x68')]);var _0x119555=_[_0x653d('0x69')](this['channels'],_0x653d('0x68'))[_0x3c6960[_0x653d('0x68')]]||0x0;var _0x364b16=_0x119555-_0x3c6960['callers'];if(this[_0x653d('0xc')][_0x3c6960['queue']][_0x653d('0x5a')]!==_[_0x653d('0x6a')](_0x3c6960['callers'])||this['voiceQueues'][_0x3c6960[_0x653d('0x68')]]['loggedIn']!==_[_0x653d('0x6a')](_0x3c6960[_0x653d('0x6b')])||this[_0x653d('0xc')][_0x3c6960[_0x653d('0x68')]][_0x653d('0x54')]!==_[_0x653d('0x6a')](_0x3c6960['available'])||this[_0x653d('0xc')][_0x3c6960['queue']][_0x653d('0x2e')]!==_0x364b16){this['voiceQueues'][_0x3c6960[_0x653d('0x68')]][_0x653d('0x5a')]=_[_0x653d('0x6a')](_0x3c6960[_0x653d('0x6c')]);this['voiceQueues'][_0x3c6960[_0x653d('0x68')]][_0x653d('0x55')]=_['toNumber'](_0x3c6960[_0x653d('0x6b')]);this['voiceQueues'][_0x3c6960['queue']]['available']=_[_0x653d('0x6a')](_0x3c6960['available']);this[_0x653d('0xc')][_0x3c6960[_0x653d('0x68')]][_0x653d('0x2e')]=_0x364b16>0x0?_0x364b16:0x0;this[_0x653d('0xc')][_0x3c6960[_0x653d('0x68')]][_0x653d('0x2e')]=this[_0x653d('0xc')][_0x3c6960[_0x653d('0x68')]][_0x653d('0x2e')]>_[_0x653d('0x6a')](_0x3c6960[_0x653d('0x6b')])?_[_0x653d('0x6a')](_0x3c6960[_0x653d('0x6b')]):this['voiceQueues'][_0x3c6960[_0x653d('0x68')]][_0x653d('0x2e')];this[_0x653d('0x51')](this[_0x653d('0xc')][_0x3c6960[_0x653d('0x68')]],_0x653d('0x10'));}logger[_0x653d('0x4d')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x653d('0x3c')](this[_0x653d('0xc')][_0x3c6960[_0x653d('0x68')]],{'showHidden':![],'depth':null}));ami['emit'](_0x653d('0x6d'),this['voiceQueues'][_0x3c6960[_0x653d('0x68')]]);}}}catch(_0x209627){logger[_0x653d('0x3a')](_0x653d('0x67'),util['inspect'](_0x209627,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x653d('0x31')][_0x653d('0x14')]=function(_0x1ab5d4){logger[_0x653d('0x4d')](_0x653d('0x6e'),util[_0x653d('0x3c')](_0x1ab5d4,{'showHidden':![],'depth':null}));ami['emit'](_0x653d('0x6f'),{});this[_0x653d('0xd')]=!![];};VoiceQueueReport['prototype'][_0x653d('0x15')]=function(_0x1a9a0){try{if(this[_0x653d('0x62')](_0x1a9a0)){logger[_0x653d('0x4d')](_0x653d('0x70'),_0x1a9a0[_0x653d('0x47')],util[_0x653d('0x3c')](_0x1a9a0,{'showHidden':![],'depth':null}));if(_[_0x653d('0x63')](this[_0x653d('0x3d')][_0x1a9a0[_0x653d('0x47')]]))this['queueReports'][_0x1a9a0['uniqueid']]=[];if(_[_0x653d('0x63')](this[_0x653d('0xa')][_0x1a9a0['uniqueid']]))this[_0x653d('0xa')][_0x1a9a0[_0x653d('0x47')]]={};var _0x590b7e=new QueueReport();_0x590b7e['name']=_0x1a9a0['queue'];_0x590b7e[_0x653d('0x52')]=this[_0x653d('0xc')][_0x590b7e[_0x653d('0x4a')]]&&this[_0x653d('0xc')][_0x590b7e['name']][_0x653d('0x52')]?this[_0x653d('0xc')][_0x590b7e['name']][_0x653d('0x52')]||_0x653d('0x53'):'inbound';_0x590b7e['queue']=_0x1a9a0['queue'];_0x590b7e['queuecallerjoinAt']=moment()[_0x653d('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x590b7e[_0x653d('0x71')]=_0x1a9a0[_0x653d('0x71')];_0x590b7e['count']=_0x1a9a0['count'];_0x590b7e[_0x653d('0x47')]=_0x1a9a0[_0x653d('0x47')];_0x590b7e['routealias']=this['channels'][_0x1a9a0[_0x653d('0x47')]][_0x653d('0x72')];logger[_0x653d('0x73')](_0x653d('0x74'),_0x590b7e['name'],_0x590b7e[_0x653d('0x52')]);_['merge'](_0x590b7e,_[_0x653d('0x75')](_0x1a9a0,_[_0x653d('0x76')](_0x590b7e)));this['queueReports'][_0x1a9a0['uniqueid']][_0x653d('0x77')](_0x590b7e);this['channels'][_0x1a9a0[_0x653d('0x47')]]=_0x590b7e;this[_0x653d('0x44')](_0x590b7e,_0x653d('0x78'));}}catch(_0x35ebce){logger[_0x653d('0x3a')](_0x653d('0x70'),_0x1a9a0[_0x653d('0x47')],util['inspect'](_0x35ebce,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x2d228e){try{if(this[_0x653d('0x62')](_0x2d228e)){logger[_0x653d('0x4d')](_0x653d('0x79'),_0x2d228e[_0x653d('0x47')],util['inspect'](_0x2d228e,{'showHidden':![],'depth':null}));if(this[_0x653d('0x3d')][_0x2d228e[_0x653d('0x47')]]){var _0x1e2c4c=_[_0x653d('0x7a')](this[_0x653d('0x3d')][_0x2d228e[_0x653d('0x47')]]);_0x1e2c4c[_0x653d('0x7b')]=![];_0x1e2c4c[_0x653d('0x7c')]=null;_0x1e2c4c['holdtime']=_0x2d228e['holdtime'];_0x1e2c4c[_0x653d('0x7d')]=_0x2d228e[_0x653d('0x7d')];_0x1e2c4c[_0x653d('0x16')]=!![];_0x1e2c4c['queuecallerabandonAt']=moment()[_0x653d('0x48')](_0x653d('0x7e'));_0x1e2c4c['queuecallerexitreason']=_0x653d('0x7f');_0x1e2c4c['lastAssignedTo']=null;logger[_0x653d('0x73')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x1e2c4c[_0x653d('0x4a')],_0x1e2c4c[_0x653d('0x52')]);this[_0x653d('0xa')][_0x2d228e[_0x653d('0x47')]]=_0x1e2c4c;this['emitVoiceQueueChannelRemove'](_0x1e2c4c,_0x653d('0x16'));}}}catch(_0x1c3706){logger[_0x653d('0x3a')](_0x653d('0x79'),_0x2d228e[_0x653d('0x47')],util[_0x653d('0x3c')](_0x1c3706,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x653d('0x31')]['syncQueueCallerLeave']=function(_0xd45933){try{if(this[_0x653d('0x62')](_0xd45933)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0xd45933[_0x653d('0x47')],util[_0x653d('0x3c')](_0xd45933,{'showHidden':![],'depth':null}));if(this[_0x653d('0x3d')][_0xd45933[_0x653d('0x47')]]){var _0x565bd4=_[_0x653d('0x7a')](this[_0x653d('0x3d')][_0xd45933[_0x653d('0x47')]]);_0x565bd4[_0x653d('0x80')]=moment()[_0x653d('0x48')](_0x653d('0x7e'));_0x565bd4['connectedlinenum']=_0xd45933[_0x653d('0x81')];_0x565bd4[_0x653d('0x82')]=_0xd45933[_0x653d('0x82')];logger['info'](_0x653d('0x83'),_0x565bd4[_0x653d('0x4a')],_0x565bd4[_0x653d('0x52')],_0xd45933[_0x653d('0x81')],_0xd45933[_0x653d('0x82')]);this[_0x653d('0xa')][_0xd45933['uniqueid']]=_0x565bd4;this[_0x653d('0x44')](_0x565bd4,_0x653d('0x18'));}}}catch(_0x826cb9){logger[_0x653d('0x3a')](_0x653d('0x84'),_0xd45933[_0x653d('0x47')],util['inspect'](_0x826cb9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x653d('0x1d')]=function(_0x2cde2f){try{if(this[_0x653d('0x62')](_0x2cde2f)){logger[_0x653d('0x4d')](_0x653d('0x85'),_0x2cde2f[_0x653d('0x47')],util[_0x653d('0x3c')](_0x2cde2f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2cde2f['uniqueid']]){var _0xeb0fe0=_[_0x653d('0x7a')](this[_0x653d('0x3d')][_0x2cde2f[_0x653d('0x47')]]);_0xeb0fe0[_0x653d('0x7b')]=!![];_0xeb0fe0[_0x653d('0x4e')]=_0x653d('0x86');logger[_0x653d('0x73')](_0x653d('0x87'),_0xeb0fe0[_0x653d('0x4a')],_0xeb0fe0['type']);}}}catch(_0x70821c){logger['error'](_0x653d('0x85'),_0x2cde2f[_0x653d('0x47')],util[_0x653d('0x3c')](_0x70821c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x653d('0x31')][_0x653d('0x1b')]=function(_0x445a1c){try{if(this['isNotNull'](_0x445a1c)){logger[_0x653d('0x4d')]('[%s][voiceQueueReport][agentcomplete]',_0x445a1c[_0x653d('0x47')],util[_0x653d('0x3c')](_0x445a1c,{'showHidden':![],'depth':null}));if(this[_0x653d('0x3d')][_0x445a1c[_0x653d('0x47')]]){var _0x2c7f39=_[_0x653d('0x7a')](this[_0x653d('0x3d')][_0x445a1c[_0x653d('0x47')]]);_0x2c7f39['queuecallerabandon']=![];_0x2c7f39[_0x653d('0x88')]=null;_0x2c7f39[_0x653d('0x89')]=!![];_0x2c7f39[_0x653d('0x8a')]=_0x445a1c['membername'];_0x2c7f39['holdtime']=_0x445a1c['holdtime'];_0x2c7f39[_0x653d('0x7b')]=!![];_0x2c7f39[_0x653d('0x8b')]=![];_0x2c7f39[_0x653d('0x8c')]=null;if(!_0x2c7f39[_0x653d('0x8d')]){if(_0x445a1c['reason']=='transfer'){_0x2c7f39[_0x653d('0x4e')]=_0x653d('0x8e');logger[_0x653d('0x73')](_0x653d('0x8f'),_0x2c7f39['name'],_0x2c7f39[_0x653d('0x52')]);}else{if(_['startsWith'](_0x445a1c['channel']['toLowerCase'](),_0x653d('0x90'))){if(this['queueReports'][_0x445a1c[_0x653d('0x91')]]){var _0x53434b=_[_0x653d('0x7a')](this[_0x653d('0x3d')][_0x445a1c[_0x653d('0x91')]]);_0x53434b['queuecallercomplete']=![];_0x53434b[_0x653d('0x8b')]=!![];_0x53434b['queuecallerexitAt']=moment(_0x2c7f39['queuecallerjoinAt'])['add'](_0x445a1c[_0x653d('0x92')],_0x653d('0x93'))['format'](_0x653d('0x7e'));_0x53434b[_0x653d('0x4e')]=_0x653d('0x94');_0x53434b[_0x653d('0x8d')]=!![];_0x53434b[_0x653d('0x95')]=_0x653d('0x96');_0x53434b[_0x653d('0x97')]=_0x445a1c['destexten'];_0x53434b['transferuniqueid']=_0x445a1c[_0x653d('0x47')];logger['info'](_0x653d('0x98'),_0x53434b['name'],_0x53434b[_0x653d('0x52')]);var _0x1dc999=this['queueReports'][_0x445a1c['linkedid']];this[_0x653d('0x3d')][_0x445a1c[_0x653d('0x91')]]=this[_0x653d('0x3d')][_0x445a1c['uniqueid']];this['queueReports'][_0x445a1c['uniqueid']]=_0x1dc999;}}else{_0x2c7f39[_0x653d('0x4e')]=_0x653d('0x99')+_0x445a1c[_0x653d('0x9a')][_0x653d('0x9b')]();logger[_0x653d('0x73')](_0x653d('0x9c'),_0x2c7f39[_0x653d('0x4a')],_0x2c7f39[_0x653d('0x52')],_0x2c7f39[_0x653d('0x4e')]);}}}this['channels'][_0x445a1c[_0x653d('0x47')]]=_0x2c7f39;this[_0x653d('0x41')](_0x2c7f39,_0x653d('0x1a'));}}}catch(_0x563781){logger[_0x653d('0x3a')](_0x653d('0x9d'),_0x445a1c[_0x653d('0x47')],util[_0x653d('0x3c')](_0x563781,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x653d('0x31')][_0x653d('0x1f')]=function(_0xb07be2){try{if(this[_0x653d('0x62')](_0xb07be2)){logger['debug'](_0x653d('0x9e'),_0xb07be2['uniqueid'],util[_0x653d('0x3c')](_0xb07be2,{'showHidden':![],'depth':null}));this[_0x653d('0x9f')](_0xb07be2['uniqueid'],_[_0x653d('0x76')](_0xb07be2[_0x653d('0xa0')])[0x0],_0xb07be2['value']);if(this[_0x653d('0x3d')][_0xb07be2['uniqueid']]){var _0x4d5bdf=_[_0x653d('0x7a')](this['queueReports'][_0xb07be2[_0x653d('0x47')]]);if(_0x4d5bdf){if(this[_0x653d('0x62')](_0xb07be2['variable'])&&this[_0x653d('0x62')](_0xb07be2[_0x653d('0xa0')][_0x653d('0xa1')])){switch(_0xb07be2[_0x653d('0xa2')]){case'CONTINUE':_0x4d5bdf[_0x653d('0x8b')]=![];_0x4d5bdf[_0x653d('0x8c')]=null;break;case _0x653d('0xa3'):_0x4d5bdf[_0x653d('0xa4')]=_0x653d('0xa5');_0x4d5bdf[_0x653d('0x8b')]=!![];_0x4d5bdf['queuecallerexitAt']=moment()['format'](_0x653d('0x7e'));_0x4d5bdf[_0x653d('0x80')]=moment()[_0x653d('0x48')](_0x653d('0x7e'));logger[_0x653d('0x4d')](_0x653d('0xa6'),_0xb07be2[_0x653d('0x47')],util[_0x653d('0x3c')](_0x4d5bdf,{'showHidden':![],'depth':null}));ami['emit'](_0x653d('0xa7'),_0x4d5bdf);break;default:_0x4d5bdf[_0x653d('0x8b')]=!![];_0x4d5bdf['queuecallerexitAt']=moment()[_0x653d('0x48')](_0x653d('0x7e'));_0x4d5bdf[_0x653d('0x80')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4d5bdf[_0x653d('0x16')]=![];_0x4d5bdf['queuecallerabandonAt']=null;_0x4d5bdf[_0x653d('0x4e')]=_0xb07be2[_0x653d('0xa2')];this[_0x653d('0xa')][_0xb07be2[_0x653d('0x47')]]=_0x4d5bdf;this['emitVoiceQueueChannelRemove'](_0x4d5bdf,_0x653d('0x1e'));}else if(this[_0x653d('0x62')](_0xb07be2['variable'])&&this['isNotNull'](_0xb07be2[_0x653d('0xa0')][_0x653d('0xa8')])){if(!_0x4d5bdf[_0x653d('0x16')]){_0x4d5bdf[_0x653d('0x8b')]=!![];_0x4d5bdf['queuecallerexitAt']=moment()[_0x653d('0x48')](_0x653d('0x7e'));_0x4d5bdf[_0x653d('0x4e')]=_0x653d('0xa9');_0x4d5bdf[_0x653d('0x80')]=moment()[_0x653d('0x48')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x653d('0xa')][_0xb07be2['uniqueid']]=_0x4d5bdf;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0xb07be2[_0x653d('0x47')],_0x4d5bdf[_0x653d('0x4a')],_0x4d5bdf[_0x653d('0x52')],_[_0x653d('0x76')](_0xb07be2[_0x653d('0xa0')])[0x0],_0xb07be2[_0x653d('0xa2')]);_0x4d5bdf[_0x653d('0xf')]=this['variables'][_0xb07be2[_0x653d('0x47')]];}}}}catch(_0x21e81e){logger[_0x653d('0x3a')]('[%s][voiceQueueReport][varset]',_0xb07be2['uniqueid'],util[_0x653d('0x3c')](_0x21e81e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x653d('0x31')][_0x653d('0x9f')]=function(_0x3b88bc,_0x46821b,_0x497d1a){var _0x419cae=[_0x653d('0xaa'),_0x653d('0xab'),_0x653d('0xac'),'rtpaudioqosjitterbridged',_0x653d('0xad'),_0x653d('0xae'),_0x653d('0xaf'),'rtpaudioqosrttbridged',_0x653d('0xb0'),_0x653d('0xb1'),_0x653d('0xb2'),_0x653d('0xb3'),_0x653d('0xb4'),_0x653d('0xb5'),_0x653d('0xb6'),_0x653d('0xb7'),'membername',_0x653d('0xb8'),_0x653d('0xb9')];if(!_['isNil'](_0x46821b)&&!_[_0x653d('0xba')](_0x419cae,_0x46821b)){if(_[_0x653d('0x63')](this[_0x653d('0xf')][_0x3b88bc])){this['variables'][_0x3b88bc]={};}this['variables'][_0x3b88bc][_0x46821b]=_0x497d1a;}};VoiceQueueReport[_0x653d('0x31')][_0x653d('0xbb')]=function(_0x23c403,_0x163c97,_0xa27d0f){var _0x58dc7a={};for(var _0x48f8c6=0x0;_0x48f8c6<this[_0x653d('0x3d')][_0x23c403][_0x653d('0xbc')];_0x48f8c6+=0x1){_0x58dc7a=this[_0x653d('0x3d')][_0x23c403][_0x48f8c6];if(this[_0x653d('0xc')][_0x58dc7a[_0x653d('0x68')]]){if(_0x58dc7a[_0x653d('0x8b')]&&_0x58dc7a['transfer']!=!![]){this[_0x653d('0xc')][_0x58dc7a[_0x653d('0x68')]][_0x653d('0x59')]+=0x1;}if(_0x58dc7a[_0x653d('0x16')]){this[_0x653d('0xc')][_0x58dc7a[_0x653d('0x68')]][_0x653d('0xbd')]+=0x1;}this[_0x653d('0xc')][_0x58dc7a[_0x653d('0x68')]][_0x653d('0x58')]+=moment(_0x58dc7a[_0x653d('0x80')])[_0x653d('0xbe')](_0x58dc7a[_0x653d('0xbf')],_0x653d('0x93'))||0x0;if(_0x48f8c6===this[_0x653d('0x3d')][_0x23c403][_0x653d('0xbc')]-0x1){this[_0x653d('0xc')][_0x58dc7a[_0x653d('0x68')]][_0x653d('0x57')]+=moment()[_0x653d('0xc0')](0x0)[_0x653d('0xbe')](_0x58dc7a[_0x653d('0xbf')],_0x653d('0x93'));this[_0x653d('0xc')][_0x58dc7a[_0x653d('0x68')]][_0x653d('0xc1')]+=0x1;if(_0x58dc7a[_0x653d('0x7b')]){this[_0x653d('0xc')][_0x58dc7a[_0x653d('0x68')]][_0x653d('0xc2')]+=0x1;this['voiceQueues'][_0x58dc7a[_0x653d('0x68')]][_0x653d('0x56')]+=moment()[_0x653d('0xc0')](0x0)[_0x653d('0xbe')](_0x58dc7a[_0x653d('0x80')],'seconds');_0x58dc7a['queuecallercompleteAt']=moment()[_0x653d('0x48')](_0x653d('0x7e'));_0x58dc7a['queuecallerexit']=![];_0x58dc7a[_0x653d('0x8c')]=null;}if(_0x58dc7a['queuecallerexit']&&_0x58dc7a['transfer']!=!![]){_0x58dc7a['lastevent']=_0x653d('0x59');logger[_0x653d('0x4d')](_0x653d('0xc3'),_0x23c403,util[_0x653d('0x3c')](_0x58dc7a,{'showHidden':![],'depth':null}));ami['emit'](_0x653d('0xc4'),_0x58dc7a);}if(_0x58dc7a[_0x653d('0x16')]){_0x58dc7a[_0x653d('0xa4')]=_0x653d('0xbd');logger[_0x653d('0x4d')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x23c403,util['inspect'](_0x58dc7a,{'showHidden':![],'depth':null}));ami[_0x653d('0x43')]('custom:queuecallerabandon',_0x58dc7a);}}else{this[_0x653d('0xc')][_0x58dc7a[_0x653d('0x68')]][_0x653d('0x57')]+=this[_0x653d('0xc')][_0x58dc7a[_0x653d('0x68')]][_0x653d('0x58')];}logger[_0x653d('0x73')](_0x653d('0xc5'),_0x23c403,_0x58dc7a[_0x653d('0x4a')],_0x58dc7a[_0x653d('0x52')],_0x163c97);if(_0xa27d0f&&_0x58dc7a[_0x653d('0x4e')]===_0x653d('0x4f')){_0x58dc7a[_0x653d('0x4e')]=_0x653d('0x86');}this[_0x653d('0xa')][_0x23c403]=_0x58dc7a;this['emitVoiceQueueChannelRemove'](_0x58dc7a,_0x653d('0xc6'));this[_0x653d('0x51')](this['voiceQueues'][_0x58dc7a[_0x653d('0x68')]],_0x653d('0xc6'));}}logger[_0x653d('0x4d')](_0x653d('0xc7'),_0x23c403,util[_0x653d('0x3c')](this[_0x653d('0x3d')][_0x23c403],{'showHidden':![],'depth':null}));ami['emit'](_0x653d('0xc8'),this[_0x653d('0x3d')][_0x23c403]);if(_0x58dc7a['queuecallerexitreason']==='ATTENDEDTRANSFER')return;delete this['queueReports'][_0x23c403];delete this[_0x653d('0xa')][_0x23c403];if(this[_0x653d('0xf')][_0x23c403]){delete this[_0x653d('0xf')][_0x23c403];}};VoiceQueueReport[_0x653d('0x31')]['syncHangup']=function(_0x14eabb){try{if(this[_0x653d('0x62')](_0x14eabb)){logger[_0x653d('0x4d')](_0x653d('0xc9'),_0x14eabb['uniqueid'],util[_0x653d('0x3c')](_0x14eabb,{'showHidden':![],'depth':null}));if(this[_0x653d('0x3d')][_0x14eabb[_0x653d('0x47')]]){return this[_0x653d('0xbb')](_0x14eabb[_0x653d('0x47')],_0x14eabb[_0x653d('0xca')]);}if(this[_0x653d('0x3d')][_0x14eabb[_0x653d('0x91')]]){if(_0x14eabb[_0x653d('0xcb')]==='21'){return;}return this['handleHangup'](_0x14eabb[_0x653d('0x91')],_0x14eabb['cause-txt'],!![]);}var _0x24c19b=Object[_0x653d('0x76')](this[_0x653d('0x3d')]);for(var _0x42b158=0x0;_0x42b158<_0x24c19b[_0x653d('0xbc')];_0x42b158++){var _0x22106c=_[_0x653d('0x7a')](this[_0x653d('0x3d')][_0x24c19b[_0x42b158]]);if(_0x22106c&&_0x22106c[_0x653d('0xcc')]===_0x14eabb[_0x653d('0x47')]){return this[_0x653d('0xbb')](_0x22106c[_0x653d('0x47')],_0x14eabb[_0x653d('0xca')],!![]);}}}}catch(_0x4bcaf4){logger[_0x653d('0x3a')]('[%s][voiceQueueReport][hangup]',_0x14eabb[_0x653d('0x47')],util['inspect'](_0x4bcaf4,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x653d('0x27')]=function(_0xf6d99c){try{if(this[_0x653d('0x62')](_0xf6d99c)){logger[_0x653d('0x4d')]('[%s][voiceQueueReport][attendedtransfer]',_0xf6d99c['uniqueid'],util[_0x653d('0x3c')](_0xf6d99c,{'showHidden':![],'depth':null}));var _0x3f4f53;var _0x210958;var _0x425a72;if(this['queueReports'][_0xf6d99c[_0x653d('0xcd')]]){_0x3f4f53=_[_0x653d('0x7a')](this['queueReports'][_0xf6d99c[_0x653d('0xcd')]]);_0x3f4f53['transferexten']=_0xf6d99c[_0x653d('0xce')];_0x3f4f53[_0x653d('0xcf')]=_0xf6d99c[_0x653d('0xd0')];_0x3f4f53[_0x653d('0x4e')]=_0x653d('0x4f');_0x3f4f53[_0x653d('0x8d')]=!![];_0x3f4f53[_0x653d('0x95')]=_0x653d('0xd1');if(this[_0x653d('0x3d')][_0xf6d99c[_0x653d('0xd0')]]){_0x425a72=this['queueReports'][_0xf6d99c[_0x653d('0xd0')]];this['queueReports'][_0xf6d99c['secondtransfereruniqueid']]=this['queueReports'][_0xf6d99c[_0x653d('0xcd')]];this[_0x653d('0x3d')][_0xf6d99c['transfereeuniqueid']]=_0x425a72;_0x210958=_[_0x653d('0x7a')](this[_0x653d('0x3d')][_0xf6d99c[_0x653d('0xcd')]]);_0x210958['switch']=!![];}logger[_0x653d('0x73')](_0x653d('0xd2'),_0xf6d99c[_0x653d('0x47')],_0x3f4f53['name'],_0x3f4f53[_0x653d('0x52')],_0x3f4f53[_0x653d('0x97')],_0x3f4f53[_0x653d('0xcf')]);}else if(this[_0x653d('0x3d')][_0xf6d99c[_0x653d('0xd3')]]){_0x3f4f53=_[_0x653d('0x7a')](this[_0x653d('0x3d')][_0xf6d99c[_0x653d('0xd3')]]);_0x3f4f53[_0x653d('0x97')]=_0xf6d99c[_0x653d('0xd4')];_0x3f4f53['transferuniqueid']=_0xf6d99c[_0x653d('0xd5')];_0x3f4f53[_0x653d('0x4e')]=_0x653d('0x4f');_0x3f4f53[_0x653d('0x8d')]=!![];_0x3f4f53['transfertype']=_0x653d('0xd1');if(this[_0x653d('0x3d')][_0xf6d99c['origtransfereruniqueid']]){_0x425a72=this[_0x653d('0x3d')][_0xf6d99c[_0x653d('0xd5')]];this[_0x653d('0x3d')][_0xf6d99c[_0x653d('0xd5')]]=this[_0x653d('0x3d')][_0xf6d99c[_0x653d('0xd3')]];this['queueReports'][_0xf6d99c[_0x653d('0xd3')]]=_0x425a72;_0x210958=_['last'](this[_0x653d('0x3d')][_0xf6d99c['transfertargetuniqueid']]);_0x210958[_0x653d('0x33')]=!![];}logger[_0x653d('0x73')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0xf6d99c[_0x653d('0x47')],_0x3f4f53[_0x653d('0x4a')],_0x3f4f53[_0x653d('0x52')],_0x3f4f53[_0x653d('0x97')],_0x3f4f53[_0x653d('0xcf')]);}else if(this[_0x653d('0x3d')][_0xf6d99c['origtransfereruniqueid']]){_0x3f4f53=_[_0x653d('0x7a')](this['queueReports'][_0xf6d99c[_0x653d('0xd5')]]);_0x3f4f53[_0x653d('0x97')]=_0xf6d99c[_0x653d('0xd4')];_0x3f4f53[_0x653d('0xcf')]=_0xf6d99c[_0x653d('0xd5')];_0x3f4f53['queuecallerexitreason']=_0x653d('0x4f');_0x3f4f53[_0x653d('0x8d')]=!![];_0x3f4f53['transfertype']=_0x653d('0xd1');_0x3f4f53[_0x653d('0x33')]=!![];_0x3f4f53['transferid']=_0xf6d99c[_0x653d('0xcd')];}else if(this[_0x653d('0x3d')][_0xf6d99c[_0x653d('0xd0')]]){_0x3f4f53=_[_0x653d('0x7a')](this['queueReports'][_0xf6d99c[_0x653d('0xd0')]]);_0x3f4f53['transferexten']=_0xf6d99c[_0x653d('0xce')];_0x3f4f53[_0x653d('0xcf')]=_0xf6d99c[_0x653d('0xd0')];_0x3f4f53[_0x653d('0x4e')]='ATTENDEDTRANSFER';_0x3f4f53[_0x653d('0x8d')]=!![];_0x3f4f53[_0x653d('0x95')]=_0x653d('0xd1');_0x3f4f53[_0x653d('0x33')]=!![];_0x3f4f53['transferid']=_0xf6d99c[_0x653d('0xd3')];}}}catch(_0x41c168){logger[_0x653d('0x3a')](_0x653d('0xd6'),_0xf6d99c[_0x653d('0x47')],util['inspect'](_0x41c168,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x653d('0x28')]=function(_0x4180fe){try{if(this['isNotNull'](_0x4180fe)){logger[_0x653d('0x4d')](_0x653d('0xd7'),_0x4180fe[_0x653d('0x47')],util[_0x653d('0x3c')](_0x4180fe,{'showHidden':![],'depth':null}));if(this[_0x653d('0x3d')][_0x4180fe[_0x653d('0xcd')]]){var _0x55153d=_['last'](this['queueReports'][_0x4180fe[_0x653d('0xcd')]]);_0x55153d[_0x653d('0x4e')]=_0x653d('0xd8');_0x55153d[_0x653d('0x8d')]=!![];_0x55153d[_0x653d('0x95')]='BLIND';_0x55153d[_0x653d('0x97')]=_0x4180fe[_0x653d('0xd9')];_0x55153d[_0x653d('0xcf')]=_0x4180fe[_0x653d('0xcd')];logger['info']('[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x4180fe['uniqueid'],_0x55153d[_0x653d('0x4a')],_0x55153d['type'],_0x55153d[_0x653d('0x97')],_0x55153d[_0x653d('0xcf')]);this['syncHangup']({'event':_0x653d('0xda'),'uniqueid':_0x4180fe[_0x653d('0xcd')],'context':_0x4180fe[_0x653d('0xdb')],'channel':_0x4180fe[_0x653d('0xdc')]});}}}catch(_0x5dd6d6){logger['error'](_0x653d('0xd7'),_0x4180fe['uniqueid'],util['inspect'](_0x5dd6d6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x653d('0x31')][_0x653d('0x24')]=function(_0x3aef98){try{if(this['isNotNull'](_0x3aef98)){logger[_0x653d('0x4d')](_0x653d('0xdd'),_0x3aef98['uniqueid'],util[_0x653d('0x3c')](_0x3aef98,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3aef98[_0x653d('0x47')]]){var _0xa3c607=_[_0x653d('0x7a')](this[_0x653d('0x3d')][_0x3aef98['uniqueid']]);if(!_[_0x653d('0x34')](_0xa3c607[_0x653d('0x80')])){_0xa3c607[_0x653d('0xde')]=moment()[_0x653d('0x48')](_0x653d('0x7e'));logger[_0x653d('0x73')](_0x653d('0xdf'),_0x3aef98[_0x653d('0x47')],_0xa3c607[_0x653d('0xde')]);}}}}catch(_0x2076d6){logger[_0x653d('0x3a')]('[%s][voiceQueueReport][musiconholdstart]',_0x3aef98[_0x653d('0x47')],util['inspect'](_0x2076d6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x653d('0x31')][_0x653d('0x25')]=function(_0x3f5b2b){try{if(this[_0x653d('0x62')](_0x3f5b2b)){logger[_0x653d('0x4d')](_0x653d('0xe0'),_0x3f5b2b[_0x653d('0x47')],util['inspect'](_0x3f5b2b,{'showHidden':![],'depth':null}));if(this[_0x653d('0x3d')][_0x3f5b2b[_0x653d('0x47')]]){var _0x1ba675=_[_0x653d('0x7a')](this[_0x653d('0x3d')][_0x3f5b2b['uniqueid']]);if(!_[_0x653d('0x34')](_0x1ba675[_0x653d('0xde')])){_0x1ba675[_0x653d('0xe1')]+=moment()['milliseconds'](0x0)['diff'](_0x1ba675[_0x653d('0xde')],_0x653d('0x93'));logger[_0x653d('0x73')](_0x653d('0xe2'),_0x3f5b2b[_0x653d('0x47')],_0x1ba675[_0x653d('0xe1')]);delete _0x1ba675[_0x653d('0xde')];}}}}catch(_0xea0b7f){logger[_0x653d('0x3a')]('[%s][voiceQueueReport][musiconholdstop]',_0x3f5b2b[_0x653d('0x47')],util[_0x653d('0x3c')](_0xea0b7f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x653d('0x31')][_0x653d('0xe3')]=function(_0xb5a535){try{if(this['isNotNull'](_0xb5a535)){logger['debug'](_0x653d('0xe4'),_0xb5a535['uniqueid'],util['inspect'](_0xb5a535,{'showHidden':![],'depth':null}));if(_0xb5a535['application'][_0x653d('0xe5')]()===_0x653d('0xe6')){_0xb5a535[_0x653d('0xe7')]=_0xb5a535[_0x653d('0xe8')]&&_0xb5a535[_0x653d('0xe8')][_0x653d('0xe9')]('CDR(routeAlias)')?_0xb5a535[_0x653d('0xe8')]:(_0xb5a535[_0x653d('0xe8')]||_0xb5a535[_0x653d('0xe7')])[_0x653d('0xe5')]();if(_[_0x653d('0xe9')](_0xb5a535[_0x653d('0xe7')][_0x653d('0xe5')](),_0x653d('0xea'))){logger['info']('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0xb5a535[_0x653d('0x47')],_0xb5a535[_0x653d('0xeb')],_0xb5a535['applicationdata']);if(_[_0x653d('0x63')](this[_0x653d('0xa')][_0xb5a535['uniqueid']]))this[_0x653d('0xa')][_0xb5a535['uniqueid']]={};var _0x353344=_0xb5a535[_0x653d('0xe7')][_0x653d('0xec')]('=');var _0xd29699=_0x353344[0x0][_0x653d('0xe5')]()['match'](/cdr\((.*)\)/);if(_0xd29699)this[_0x653d('0xa')][_0xb5a535[_0x653d('0x47')]][_0xd29699[0x1]]=_0x353344[0x1];}}}}catch(_0x4de7bf){logger['error'](_0x653d('0xed'),_0xb5a535[_0x653d('0x47')],util[_0x653d('0x3c')](_0x4de7bf,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
index fb837d3..78f6ab1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1de=['campaign','CreateReportAgentPreview'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xe1de,0x122));var _0xee1d=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xe1de[_0x15bc81];return _0x59440e;};'use strict';var client=require('../client');exports['createHistory']=function(_0x6a97ea){return function(){_0x6a97ea[_0xee1d('0x0')]=_0x6a97ea['queue'];return client['Request'](_0xee1d('0x1'),{'body':_0x6a97ea,'log':_0xee1d('0x1')});};};
\ No newline at end of file
+var _0xee77=['queue','CreateReportAgentPreview','../client','createHistory','campaign'];(function(_0x56fc41,_0x550632){var _0x2de570=function(_0x1d52c7){while(--_0x1d52c7){_0x56fc41['push'](_0x56fc41['shift']());}};_0x2de570(++_0x550632);}(_0xee77,0x19c));var _0x7ee7=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xee77[_0x2cfb58];return _0xd99951;};'use strict';var client=require(_0x7ee7('0x0'));exports[_0x7ee7('0x1')]=function(_0x2a794b){return function(){_0x2a794b[_0x7ee7('0x2')]=_0x2a794b[_0x7ee7('0x3')];return client['Request'](_0x7ee7('0x4'),{'body':_0x2a794b,'log':'CreateReportAgentPreview'});};};
\ No newline at end of file
index bc3e7bc..90d933a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0972=['CreateAttachment','create','Request'];(function(_0x211308,_0x55e902){var _0x3384bf=function(_0xa5afe8){while(--_0xa5afe8){_0x211308['push'](_0x211308['shift']());}};_0x3384bf(++_0x55e902);}(_0x0972,0x64));var _0x2097=function(_0x5aa359,_0xc6a064){_0x5aa359=_0x5aa359-0x0;var _0x20a356=_0x0972[_0x5aa359];return _0x20a356;};'use strict';var client=require('../client');exports[_0x2097('0x0')]=function(_0x517422){return client[_0x2097('0x1')]('CreateAttachment',{'body':_0x517422,'log':_0x2097('0x2')});};
\ No newline at end of file
+var _0x3ce9=['CreateAttachment','../client','Request'];(function(_0x4c2408,_0x20d8b1){var _0x4d83b1=function(_0x3de38c){while(--_0x3de38c){_0x4c2408['push'](_0x4c2408['shift']());}};_0x4d83b1(++_0x20d8b1);}(_0x3ce9,0x85));var _0x93ce=function(_0x45e539,_0x20bc9e){_0x45e539=_0x45e539-0x0;var _0x456fc9=_0x3ce9[_0x45e539];return _0x456fc9;};'use strict';var client=require(_0x93ce('0x0'));exports['create']=function(_0x268509){return client[_0x93ce('0x1')](_0x93ce('0x2'),{'body':_0x268509,'log':_0x93ce('0x2')});};
\ No newline at end of file
index 48b28a6..01f8971 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(_0x1aed80,_0x3ca6f6){var _0x43961e=function(_0x43bf2b){while(--_0x43bf2b){_0x1aed80['push'](_0x1aed80['shift']());}};_0x43961e(++_0x3ca6f6);}(_0x2ef3,0xba));var _0x32ef=function(_0x4bf37c,_0x5b3c66){_0x4bf37c=_0x4bf37c-0x0;var _0x5b9843=_0x2ef3[_0x4bf37c];return _0x5b9843;};'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 _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(_0x2440fe,_0x281a11){var _0x5cf734=function(_0x38e12b){while(--_0x38e12b){_0x2440fe['push'](_0x2440fe['shift']());}};_0x5cf734(++_0x281a11);}(_0x2ef3,0xba));var _0x32ef=function(_0x560268,_0x2ba8e6){_0x560268=_0x560268-0x0;var _0x1e618d=_0x2ef3[_0x560268];return _0x1e618d;};'use strict';var client=require(_0x32ef('0x0'));exports[_0x32ef('0x1')]=function(){return function(){return client[_0x32ef('0x2')](_0x32ef('0x3'),{'options':{'raw':![],'attributes':['id',_0x32ef('0x4'),_0x32ef('0x5'),'active',_0x32ef('0x6'),_0x32ef('0x7'),'dialOriginateCallerIdNumber',_0x32ef('0x8'),_0x32ef('0x9'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'dialAMDActive',_0x32ef('0x18'),'dialAMDGreeting',_0x32ef('0x19'),'dialAMDTotalAnalysisTime',_0x32ef('0x1a'),_0x32ef('0x1b'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x32ef('0x1c'),'dialOrderByScheduledAt',_0x32ef('0x1d'),_0x32ef('0x1e'),_0x32ef('0x1f')],'include':[{'model':_0x32ef('0x20'),'as':'Trunk','attributes':['id','name','callerid',_0x32ef('0x21')]},{'model':_0x32ef('0x20'),'as':_0x32ef('0x22'),'attributes':['id','name','callerid',_0x32ef('0x21')]},{'model':_0x32ef('0x23'),'as':_0x32ef('0x23'),'attributes':['id','name'],'include':[{'model':_0x32ef('0x23'),'as':_0x32ef('0x24'),'attributes':['id','name',_0x32ef('0x25')]}]},{'model':_0x32ef('0x26'),'as':_0x32ef('0x26'),'attributes':['id',_0x32ef('0x4')]}]},'log':_0x32ef('0x27')});};};
\ No newline at end of file
index 840ad92..fa6d3c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fde=['CreateCmContact','getContacts','GetCmContact','Request'];(function(_0x44baaf,_0x2f9960){var _0x1dddd3=function(_0x32110d){while(--_0x32110d){_0x44baaf['push'](_0x44baaf['shift']());}};_0x1dddd3(++_0x2f9960);}(_0x7fde,0x11b));var _0xe7fd=function(_0x1643ba,_0x28d441){_0x1643ba=_0x1643ba-0x0;var _0x1389c0=_0x7fde[_0x1643ba];return _0x1389c0;};'use strict';var client=require('../client');exports['createContact']=function(_0x4f44a3){return function(){return client[_0xe7fd('0x0')](_0xe7fd('0x1'),{'body':_0x4f44a3,'log':_0xe7fd('0x1')});};};exports[_0xe7fd('0x2')]=function(_0xbeab16){return function(){return client[_0xe7fd('0x0')](_0xe7fd('0x3'),{'options':_0xbeab16,'log':_0xe7fd('0x3')});};};
\ No newline at end of file
+var _0x6164=['createContact','Request','CreateCmContact','GetCmContact'];(function(_0x44ded7,_0x3ba04a){var _0xec38c6=function(_0x251bcc){while(--_0x251bcc){_0x44ded7['push'](_0x44ded7['shift']());}};_0xec38c6(++_0x3ba04a);}(_0x6164,0x1ec));var _0x4616=function(_0xf34109,_0x380779){_0xf34109=_0xf34109-0x0;var _0x570bfc=_0x6164[_0xf34109];return _0x570bfc;};'use strict';var client=require('../client');exports[_0x4616('0x0')]=function(_0x3515be){return function(){return client[_0x4616('0x1')]('CreateCmContact',{'body':_0x3515be,'log':_0x4616('0x2')});};};exports['getContacts']=function(_0x442964){return function(){return client['Request'](_0x4616('0x3'),{'options':_0x442964,'log':_0x4616('0x3')});};};
\ No newline at end of file
index 0330271..7ba46f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe78=['handlePreviewRecallNotifications','../client','GetCmHopper','CmContact','Contact','getCmHopper','updateContacts','UpdateCmHopper','YYYY-MM-DD\x20HH:mm:ss','Request','CampaignId','DestroyCmHopper','GetContactDialer','DESC','scheduledat','ASC','getContactDialerIvr','priority','GetContactDialerIvr','moveContactManagedDialer','campaign','MoveContactManagedDialer','ListId','VoiceQueueId','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','User','Agent','name','VoiceQueue','Queue','unlockContact','getContactRecallMe','GetContactRecallMe','format','voicePause','resetActiveCalls','ResetActiveCalls'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xfe78,0x119));var _0x8fe7=function(_0x40a57f,_0x34d3f8){_0x40a57f=_0x40a57f-0x0;var _0x2f0743=_0xfe78[_0x40a57f];return _0x2f0743;};'use strict';var client=require(_0x8fe7('0x0'));var moment=require('moment');exports['getContacts']=function(_0x94cb9a,_0x132531){return function(){return client['Request'](_0x8fe7('0x1'),{'options':{'where':{'VoiceQueueId':_0x94cb9a},'include':[{'model':_0x8fe7('0x2'),'as':_0x8fe7('0x3')}],'limit':_0x132531,'raw':![]},'log':_0x8fe7('0x4')});};};exports[_0x8fe7('0x5')]=function(_0x58f2be,_0x4713cb,_0x50b021){return function(){return client['Request'](_0x8fe7('0x6'),{'body':_0x58f2be,'options':{'where':{'VoiceQueueId':_0x4713cb,'scheduledat':{'$lte':moment()['format'](_0x8fe7('0x7'))}},'limit':_0x50b021},'log':_0x8fe7('0x6')});};};exports['rescheduleContact']=function(_0x5342f6){return function(){return client[_0x8fe7('0x8')](_0x8fe7('0x6'),{'body':_0x5342f6,'options':{'where':{'ContactId':_0x5342f6['ContactId'],'ListId':_0x5342f6['ListId'],'VoiceQueueId':_0x5342f6['VoiceQueueId'],'CampaignId':_0x5342f6[_0x8fe7('0x9')]}},'log':'rescheduleContact'});};};exports['destroyContact']=function(_0x3e51d4,_0x5cfc84,_0x31518f){return function(){return client[_0x8fe7('0x8')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x3e51d4,'ListId':_0x5cfc84,'ContactId':_0x31518f}},'log':_0x8fe7('0xa')});};};exports['getContactDialer']=function(_0x3abe7f,_0x356a14,_0x4cd385,_0x367594){return function(){return client['Request'](_0x8fe7('0xb'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x3abe7f,'active':![],'scheduledat':{'$lte':moment()['format'](_0x8fe7('0x7'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x356a14}}]},'order':[['priority',_0x8fe7('0xc')],[_0x8fe7('0xd'),_0x367594],['id',_0x8fe7('0xe')]],'raw':!![],'limit':_0x4cd385},'log':'GetContactDialer'});};};exports[_0x8fe7('0xf')]=function(_0x39ee9b,_0xb01f19,_0x21b80e){return function(){return client['Request'](_0x8fe7('0xb'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x39ee9b,'active':![],'scheduledat':{'$lte':moment()['format'](_0x8fe7('0x7'))}},'include':[{'model':_0x8fe7('0x2'),'as':_0x8fe7('0x3')}],'order':[[_0x8fe7('0x10'),_0x8fe7('0xc')],[_0x8fe7('0xd'),_0x21b80e],['id',_0x8fe7('0xe')]],'raw':!![],'limit':_0xb01f19},'log':_0x8fe7('0x11')});};};exports[_0x8fe7('0x12')]=function(_0x35c3a4,_0x1a8835){return function(){_0x35c3a4[_0x8fe7('0x13')]=_0x35c3a4['queue'];return client['Request'](_0x8fe7('0x14'),{'body':_0x35c3a4,'options':{'where':{'ContactId':_0x35c3a4['ContactId'],'ListId':_0x35c3a4[_0x8fe7('0x15')],'VoiceQueueId':_0x35c3a4[_0x8fe7('0x16')],'CampaignId':_0x35c3a4[_0x8fe7('0x9')],'active':_0x1a8835?undefined:!![]}},'log':_0x8fe7('0x14')});};};exports[_0x8fe7('0x17')]=function(_0x4053db){return function(){return client['Request'](_0x8fe7('0x18'),{'options':{'where':{'VoiceQueueId':_0x4053db['id']?_0x4053db['id']||null:null}},'log':'countReScheduled'});};};exports[_0x8fe7('0x19')]=function(_0x2879d4){return function(){return client['Request'](_0x8fe7('0x1a'),{'options':{'where':{'id':_0x2879d4},'include':[{'model':_0x8fe7('0x2'),'as':_0x8fe7('0x3')},{'model':_0x8fe7('0x1b'),'as':_0x8fe7('0x1c'),'attributes':['id',_0x8fe7('0x1d')]},{'model':_0x8fe7('0x1e'),'as':_0x8fe7('0x1f'),'attributes':['id',_0x8fe7('0x1d')]}],'raw':!![]},'log':_0x8fe7('0x4')});};};exports[_0x8fe7('0x20')]=function(_0x2478b2,_0x5ce72d,_0x26df11){return function(){return client[_0x8fe7('0x8')](_0x8fe7('0x6'),{'body':_0x2478b2,'options':{'where':{'id':_0x5ce72d},'limit':_0x26df11},'log':'UpdateCmHopper'});};};exports[_0x8fe7('0x21')]=function(_0x2f8ff6,_0x3eb047){return function(){return client[_0x8fe7('0x8')](_0x8fe7('0x22'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x2f8ff6,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x8fe7('0x23')](_0x8fe7('0x7'))},'UserId':{'$in':_0x3eb047}},'order':[[_0x8fe7('0x10'),_0x8fe7('0xc')],[_0x8fe7('0xd'),'DESC'],['id','ASC']],'include':[{'model':_0x8fe7('0x2'),'as':_0x8fe7('0x3')},{'model':_0x8fe7('0x1b'),'as':_0x8fe7('0x1c'),'attributes':['id',_0x8fe7('0x1d'),_0x8fe7('0x24')]}],'group':'db.CmHopper.UserId','raw':!![]},'log':'GetContactDialer'});};};exports[_0x8fe7('0x25')]=function(_0x4c80fe){return function(){return client[_0x8fe7('0x8')](_0x8fe7('0x26'),{'body':_0x4c80fe,'options':{},'log':_0x8fe7('0x26')});};};exports[_0x8fe7('0x27')]=function(_0x568565,_0x515251,_0x2de94d){return function(){return client[_0x8fe7('0x8')]('CmHopperHandlePreviewRecallNotifications',{'body':{'where':{'voiceQueueIds':_0x568565,'interval':_0x515251,'availableAgentsIds':_0x2de94d}},'log':'handlePreviewRecallNotifications'});};};
\ No newline at end of file
+var _0x1dac=['priority','DESC','scheduledat','ASC','getContactDialerIvr','CmContact','GetContactDialerIvr','moveContactManagedDialer','queue','ContactId','VoiceQueueId','MoveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','User','Agent','name','VoiceQueue','Queue','unlockContact','getContactRecallMe','db.CmHopper.UserId','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','CmHopperHandlePreviewRecallNotifications','../client','moment','GetCmHopper','Contact','getCmHopper','updateContacts','Request','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ListId','CampaignId','destroyContact','getContactDialer','GetContactDialer'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x1dac,0xa0));var _0xc1da=function(_0x5e2ac7,_0x45265d){_0x5e2ac7=_0x5e2ac7-0x0;var _0x4fb946=_0x1dac[_0x5e2ac7];return _0x4fb946;};'use strict';var client=require(_0xc1da('0x0'));var moment=require(_0xc1da('0x1'));exports['getContacts']=function(_0x13f118,_0x3a31a8){return function(){return client['Request'](_0xc1da('0x2'),{'options':{'where':{'VoiceQueueId':_0x13f118},'include':[{'model':'CmContact','as':_0xc1da('0x3')}],'limit':_0x3a31a8,'raw':![]},'log':_0xc1da('0x4')});};};exports[_0xc1da('0x5')]=function(_0xb3bfcf,_0x243a46,_0x142b43){return function(){return client[_0xc1da('0x6')](_0xc1da('0x7'),{'body':_0xb3bfcf,'options':{'where':{'VoiceQueueId':_0x243a46,'scheduledat':{'$lte':moment()[_0xc1da('0x8')](_0xc1da('0x9'))}},'limit':_0x142b43},'log':_0xc1da('0x7')});};};exports[_0xc1da('0xa')]=function(_0x431cde){return function(){return client['Request'](_0xc1da('0x7'),{'body':_0x431cde,'options':{'where':{'ContactId':_0x431cde['ContactId'],'ListId':_0x431cde[_0xc1da('0xb')],'VoiceQueueId':_0x431cde['VoiceQueueId'],'CampaignId':_0x431cde[_0xc1da('0xc')]}},'log':_0xc1da('0xa')});};};exports[_0xc1da('0xd')]=function(_0x1ba8d3,_0x41704d,_0x4abc15){return function(){return client[_0xc1da('0x6')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x1ba8d3,'ListId':_0x41704d,'ContactId':_0x4abc15}},'log':'DestroyCmHopper'});};};exports[_0xc1da('0xe')]=function(_0x55b10a,_0x4936fc,_0x57ff99,_0x5b4a4e){return function(){return client[_0xc1da('0x6')](_0xc1da('0xf'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x55b10a,'active':![],'scheduledat':{'$lte':moment()['format'](_0xc1da('0x9'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x4936fc}}]},'order':[[_0xc1da('0x10'),_0xc1da('0x11')],[_0xc1da('0x12'),_0x5b4a4e],['id',_0xc1da('0x13')]],'raw':!![],'limit':_0x57ff99},'log':_0xc1da('0xf')});};};exports[_0xc1da('0x14')]=function(_0x1fb7d6,_0x50c118,_0x1ecf33){return function(){return client[_0xc1da('0x6')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x1fb7d6,'active':![],'scheduledat':{'$lte':moment()[_0xc1da('0x8')](_0xc1da('0x9'))}},'include':[{'model':_0xc1da('0x15'),'as':_0xc1da('0x3')}],'order':[[_0xc1da('0x10'),_0xc1da('0x11')],[_0xc1da('0x12'),_0x1ecf33],['id',_0xc1da('0x13')]],'raw':!![],'limit':_0x50c118},'log':_0xc1da('0x16')});};};exports[_0xc1da('0x17')]=function(_0x46873c,_0x3808e8){return function(){_0x46873c['campaign']=_0x46873c[_0xc1da('0x18')];return client[_0xc1da('0x6')]('MoveContactManagedDialer',{'body':_0x46873c,'options':{'where':{'ContactId':_0x46873c[_0xc1da('0x19')],'ListId':_0x46873c['ListId'],'VoiceQueueId':_0x46873c[_0xc1da('0x1a')],'CampaignId':_0x46873c[_0xc1da('0xc')],'active':_0x3808e8?undefined:!![]}},'log':_0xc1da('0x1b')});};};exports[_0xc1da('0x1c')]=function(_0x39c67b){return function(){return client[_0xc1da('0x6')](_0xc1da('0x1d'),{'options':{'where':{'VoiceQueueId':_0x39c67b['id']?_0x39c67b['id']||null:null}},'log':'countReScheduled'});};};exports[_0xc1da('0x1e')]=function(_0x231868){return function(){return client['Request'](_0xc1da('0x1f'),{'options':{'where':{'id':_0x231868},'include':[{'model':_0xc1da('0x15'),'as':'Contact'},{'model':_0xc1da('0x20'),'as':_0xc1da('0x21'),'attributes':['id',_0xc1da('0x22')]},{'model':_0xc1da('0x23'),'as':_0xc1da('0x24'),'attributes':['id',_0xc1da('0x22')]}],'raw':!![]},'log':'getCmHopper'});};};exports[_0xc1da('0x25')]=function(_0x356d35,_0x227476,_0x588dfb){return function(){return client[_0xc1da('0x6')](_0xc1da('0x7'),{'body':_0x356d35,'options':{'where':{'id':_0x227476},'limit':_0x588dfb},'log':_0xc1da('0x7')});};};exports[_0xc1da('0x26')]=function(_0x31e074,_0x771e67){return function(){return client[_0xc1da('0x6')]('GetContactRecallMe',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x31e074,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{'$in':_0x771e67}},'order':[['priority',_0xc1da('0x11')],['scheduledat',_0xc1da('0x11')],['id',_0xc1da('0x13')]],'include':[{'model':'CmContact','as':_0xc1da('0x3')},{'model':_0xc1da('0x20'),'as':_0xc1da('0x21'),'attributes':['id',_0xc1da('0x22'),'voicePause']}],'group':_0xc1da('0x27'),'raw':!![]},'log':'GetContactDialer'});};};exports[_0xc1da('0x28')]=function(_0x3f5649){return function(){return client[_0xc1da('0x6')](_0xc1da('0x29'),{'body':_0x3f5649,'options':{},'log':_0xc1da('0x29')});};};exports[_0xc1da('0x2a')]=function(_0x4b6fe9,_0x51fca4,_0x174010){return function(){return client['Request'](_0xc1da('0x2b'),{'body':{'where':{'voiceQueueIds':_0x4b6fe9,'interval':_0x51fca4,'availableAgentsIds':_0x174010}},'log':_0xc1da('0x2a')});};};
\ No newline at end of file
index e68e2b3..378f308 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c48=['../client','moment','verifyAdditionalPhones','Request','VerifyAdditionalPhones','swapAdditionalPhones','incrementPreviewCounters','IncrementPreviewCounters'];(function(_0xd5592e,_0x2af7cd){var _0xe5c5c6=function(_0x596b79){while(--_0x596b79){_0xd5592e['push'](_0xd5592e['shift']());}};_0xe5c5c6(++_0x2af7cd);}(_0x0c48,0x190));var _0x80c4=function(_0x487f51,_0x268f8f){_0x487f51=_0x487f51-0x0;var _0xaf1452=_0x0c48[_0x487f51];return _0xaf1452;};'use strict';var client=require(_0x80c4('0x0'));var moment=require(_0x80c4('0x1'));exports[_0x80c4('0x2')]=function(_0x4fe7b1,_0x282e5a,_0x3ece0a){return function(){return client[_0x80c4('0x3')](_0x80c4('0x4'),{'body':_0x4fe7b1,'reason':_0x282e5a,'entity':_0x3ece0a,'log':_0x80c4('0x4')});};};exports[_0x80c4('0x5')]=function(_0x540c55,_0x2d36d6,_0xa5b26b){return function(){return client[_0x80c4('0x3')]('SwapAdditionalPhones',{'body':_0x540c55,'duration':_0x2d36d6,'waitTime':_0xa5b26b,'log':'SwapAdditionalPhones'});};};exports[_0x80c4('0x6')]=function(_0x2e1d32){return function(){return client['Request'](_0x80c4('0x7'),{'body':_0x2e1d32,'log':_0x80c4('0x7')});};};
\ No newline at end of file
+var _0x251a=['swapAdditionalPhones','SwapAdditionalPhones','incrementPreviewCounters','IncrementPreviewCounters','moment','verifyAdditionalPhones','Request'];(function(_0x916624,_0x46c188){var _0x257b61=function(_0xf2aad9){while(--_0xf2aad9){_0x916624['push'](_0x916624['shift']());}};_0x257b61(++_0x46c188);}(_0x251a,0x169));var _0xa251=function(_0x53ed59,_0x4beb34){_0x53ed59=_0x53ed59-0x0;var _0x5834ca=_0x251a[_0x53ed59];return _0x5834ca;};'use strict';var client=require('../client');var moment=require(_0xa251('0x0'));exports[_0xa251('0x1')]=function(_0x282974,_0x5f0f0e,_0x13aa5c){return function(){return client[_0xa251('0x2')]('VerifyAdditionalPhones',{'body':_0x282974,'reason':_0x5f0f0e,'entity':_0x13aa5c,'log':'VerifyAdditionalPhones'});};};exports[_0xa251('0x3')]=function(_0x20c800,_0x299c4a,_0x2d376d){return function(){return client['Request'](_0xa251('0x4'),{'body':_0x20c800,'duration':_0x299c4a,'waitTime':_0x2d376d,'log':'SwapAdditionalPhones'});};};exports[_0xa251('0x5')]=function(_0x76268){return function(){return client[_0xa251('0x2')](_0xa251('0x6'),{'body':_0x76268,'log':_0xa251('0x6')});};};
\ No newline at end of file
index d868dca..615badb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc29f=['phone','checkIsBlackListIvr','Request','CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList','GetCmHopperBlack'];(function(_0x32aebe,_0x43223){var _0x2a21db=function(_0x4bac1f){while(--_0x4bac1f){_0x32aebe['push'](_0x32aebe['shift']());}};_0x2a21db(++_0x43223);}(_0xc29f,0x115));var _0xfc29=function(_0x36736f,_0x43c886){_0x36736f=_0x36736f-0x0;var _0x1361e8=_0xc29f[_0x36736f];return _0x1361e8;};'use strict';var client=require(_0xfc29('0x0'));exports[_0xfc29('0x1')]=function(_0x4f4f4e){return function(){return client['Request'](_0xfc29('0x2'),{'options':{'where':{'VoiceQueueId':_0x4f4f4e['VoiceQueueId'],'phone':_0x4f4f4e[_0xfc29('0x3')]},'raw':![]},'log':_0xfc29('0x2')});};};exports[_0xfc29('0x4')]=function(_0x3e8a1c){return function(){return client[_0xfc29('0x5')](_0xfc29('0x2'),{'options':{'where':{'CampaignId':_0x3e8a1c[_0xfc29('0x6')],'phone':_0x3e8a1c[_0xfc29('0x3')]},'raw':![]},'log':_0xfc29('0x7')});};};
\ No newline at end of file
+var _0x1923=['phone','checkIsBlackListIvr','CampaignId','GetCmHopperBlackIvr','../client','Request','GetCmHopperBlack','VoiceQueueId'];(function(_0x5e317c,_0x3f5123){var _0x3ab763=function(_0x1b674b){while(--_0x1b674b){_0x5e317c['push'](_0x5e317c['shift']());}};_0x3ab763(++_0x3f5123);}(_0x1923,0xb4));var _0x3192=function(_0x10546b,_0x26b63c){_0x10546b=_0x10546b-0x0;var _0x18b8a3=_0x1923[_0x10546b];return _0x18b8a3;};'use strict';var client=require(_0x3192('0x0'));exports['checkIsBlackList']=function(_0x470c4e){return function(){return client[_0x3192('0x1')](_0x3192('0x2'),{'options':{'where':{'VoiceQueueId':_0x470c4e[_0x3192('0x3')],'phone':_0x470c4e[_0x3192('0x4')]},'raw':![]},'log':_0x3192('0x2')});};};exports[_0x3192('0x5')]=function(_0x395795){return function(){return client['Request'](_0x3192('0x2'),{'options':{'where':{'CampaignId':_0x395795[_0x3192('0x6')],'phone':_0x395795[_0x3192('0x4')]},'raw':![]},'log':_0x3192('0x7')});};};
\ No newline at end of file
index 3e334e7..8c00f87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8627=['queue','Request','CreateCmHopperFinal','campaign'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x8627,0x1e3));var _0x7862=function(_0x56bb11,_0xf08ce7){_0x56bb11=_0x56bb11-0x0;var _0x21d525=_0x8627[_0x56bb11];return _0x21d525;};'use strict';var client=require('../client');exports['createContact']=function(_0x812df5){return function(){_0x812df5[_0x7862('0x0')]=_0x812df5[_0x7862('0x1')];return client[_0x7862('0x2')](_0x7862('0x3'),{'body':_0x812df5,'log':_0x7862('0x3')});};};
\ No newline at end of file
+var _0xe1ae=['campaign','Request','../client'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xe1ae,0x14c));var _0xee1a=function(_0x39ce5a,_0x260622){_0x39ce5a=_0x39ce5a-0x0;var _0x46cd9a=_0xe1ae[_0x39ce5a];return _0x46cd9a;};'use strict';var client=require(_0xee1a('0x0'));exports['createContact']=function(_0x44a511){return function(){_0x44a511[_0xee1a('0x1')]=_0x44a511['queue'];return client[_0xee1a('0x2')]('CreateCmHopperFinal',{'body':_0x44a511,'log':'CreateCmHopperFinal'});};};
\ No newline at end of file
index d7a0ea8..1a04165 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8230=['subtract','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','format','getCampaignHopperHistory','GetCampaignHopperHistory','endOf','ivr','../client','moment','createHistory','campaign','queue','Request','CreateCmHopperHistory','AvgHandleTime'];(function(_0x2630d2,_0x38ede4){var _0x267c13=function(_0x896050){while(--_0x896050){_0x2630d2['push'](_0x2630d2['shift']());}};_0x267c13(++_0x38ede4);}(_0x8230,0x110));var _0x0823=function(_0x53e95e,_0x12a8c7){_0x53e95e=_0x53e95e-0x0;var _0x4f6f06=_0x8230[_0x53e95e];return _0x4f6f06;};'use strict';var client=require(_0x0823('0x0'));var moment=require(_0x0823('0x1'));exports[_0x0823('0x2')]=function(_0x5df814){return function(){_0x5df814[_0x0823('0x3')]=_0x5df814[_0x0823('0x4')];return client[_0x0823('0x5')](_0x0823('0x6'),{'body':_0x5df814,'log':_0x0823('0x6')});};};exports['avgHandleTime']=function(_0x5ed645){return function(){return client[_0x0823('0x5')](_0x0823('0x7'),{'options':{'where':{'endtime':{'$between':[moment()[_0x0823('0x8')](_0x5ed645,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()['format'](_0x0823('0x9'))]}},'raw':![]},'log':_0x0823('0xa')});};};exports[_0x0823('0xb')]=function(_0x324a8e){return function(){return client[_0x0823('0x5')](_0x0823('0xc'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0823('0xd')]('day')['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0x0823('0xe'))[_0x0823('0xf')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':'queue'},'raw':![]},'log':_0x0823('0xc')});};};exports[_0x0823('0x10')]=function(_0xc6faf4){return function(){return client['Request'](_0x0823('0x11'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0823('0xd')](_0x0823('0xe'))['format'](_0x0823('0x9')),moment()[_0x0823('0x12')](_0x0823('0xe'))[_0x0823('0xf')](_0x0823('0x9'))]},'campaigntype':_0x0823('0x13')},'raw':![]},'log':_0x0823('0x11')});};};
\ No newline at end of file
+var _0xb41b=['YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','startOf','endOf','day','GetVoiceQueueHopperHistory','ivr','moment','createHistory','queue','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','subtract','minutes','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb41b,0x1a6));var _0xbb41=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb41b[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');var moment=require(_0xbb41('0x0'));exports[_0xbb41('0x1')]=function(_0x9b621e){return function(){_0x9b621e['campaign']=_0x9b621e[_0xbb41('0x2')];return client[_0xbb41('0x3')](_0xbb41('0x4'),{'body':_0x9b621e,'log':_0xbb41('0x4')});};};exports[_0xbb41('0x5')]=function(_0x32e931){return function(){return client[_0xbb41('0x3')](_0xbb41('0x6'),{'options':{'where':{'endtime':{'$between':[moment()[_0xbb41('0x7')](_0x32e931,_0xbb41('0x8'))[_0xbb41('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['format'](_0xbb41('0xa'))]}},'raw':![]},'log':_0xbb41('0xb')});};};exports[_0xbb41('0xc')]=function(_0x495f73){return function(){return client[_0xbb41('0x3')]('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0xbb41('0xd')]('day')[_0xbb41('0x9')](_0xbb41('0xa')),moment()[_0xbb41('0xe')](_0xbb41('0xf'))[_0xbb41('0x9')](_0xbb41('0xa'))]},'campaigntype':_0xbb41('0x2')},'raw':![]},'log':_0xbb41('0x10')});};};exports['getCampaignHopperHistory']=function(_0x3885ec){return function(){return client[_0xbb41('0x3')]('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0xbb41('0xd')](_0xbb41('0xf'))[_0xbb41('0x9')](_0xbb41('0xa')),moment()[_0xbb41('0xe')](_0xbb41('0xf'))[_0xbb41('0x9')](_0xbb41('0xa'))]},'campaigntype':_0xbb41('0x11')},'raw':![]},'log':'GetCampaignHopperHistory'});};};
\ No newline at end of file
index 390fbdc..a96f487 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b77=['GetFaxAccount','description','ecm','headerinfo','minrate','maxrate','modem','gateway','faxdetect','t38timeout','TrunkId','ListId','key','Trunk','getFaxAccount','notify','NotifyFaxAccount','../client','getFaxAccounts','Request'];(function(_0x5f356b,_0x2ad03f){var _0x4d831b=function(_0x305aae){while(--_0x305aae){_0x5f356b['push'](_0x5f356b['shift']());}};_0x4d831b(++_0x2ad03f);}(_0x7b77,0x179));var _0x77b7=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x7b77[_0x62c958];return _0x57ec61;};'use strict';var client=require(_0x77b7('0x0'));exports[_0x77b7('0x1')]=function(){return function(){return client[_0x77b7('0x2')](_0x77b7('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x77b7('0x4'),_0x77b7('0x5'),_0x77b7('0x6'),'localstationid',_0x77b7('0x7'),_0x77b7('0x8'),_0x77b7('0x9'),_0x77b7('0xa'),_0x77b7('0xb'),_0x77b7('0xc'),'tech',_0x77b7('0xd'),_0x77b7('0xe'),_0x77b7('0xf')],'include':[{'model':'Trunk','as':_0x77b7('0x10'),'attributes':['id','name','callerid','active']}]},'log':_0x77b7('0x11')});};};exports[_0x77b7('0x12')]=function(_0x5e7f6a,_0xb2e5d4){return client[_0x77b7('0x2')](_0x77b7('0x13'),{'account':{'id':_0x5e7f6a},'body':_0xb2e5d4,'log':_0x77b7('0x13')});};
\ No newline at end of file
+var _0x8579=['callerid','active','Request','NotifyFaxAccount','../client','getFaxAccounts','GetFaxAccount','name','description','ecm','modem','gateway','faxdetect','t38timeout','tech','TrunkId','key','Trunk'];(function(_0x2ace95,_0x186b37){var _0x35ecfa=function(_0x26ce5a){while(--_0x26ce5a){_0x2ace95['push'](_0x2ace95['shift']());}};_0x35ecfa(++_0x186b37);}(_0x8579,0x16c));var _0x9857=function(_0x1b60c8,_0x93d0ff){_0x1b60c8=_0x1b60c8-0x0;var _0x3d4318=_0x8579[_0x1b60c8];return _0x3d4318;};'use strict';var client=require(_0x9857('0x0'));exports[_0x9857('0x1')]=function(){return function(){return client['Request'](_0x9857('0x2'),{'options':{'raw':![],'attributes':['id',_0x9857('0x3'),_0x9857('0x4'),_0x9857('0x5'),'headerinfo','localstationid','minrate','maxrate',_0x9857('0x6'),_0x9857('0x7'),_0x9857('0x8'),_0x9857('0x9'),_0x9857('0xa'),_0x9857('0xb'),'ListId',_0x9857('0xc')],'include':[{'model':_0x9857('0xd'),'as':_0x9857('0xd'),'attributes':['id',_0x9857('0x3'),_0x9857('0xe'),_0x9857('0xf')]}]},'log':'getFaxAccount'});};};exports['notify']=function(_0x59aa83,_0x19b442){return client[_0x9857('0x10')](_0x9857('0x11'),{'account':{'id':_0x59aa83},'body':_0x19b442,'log':_0x9857('0x11')});};
\ No newline at end of file
index 4a71e2e..0e358ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa02e=['Request','UpdateFaxMessage','../client','update'];(function(_0x44bb3f,_0x175b7c){var _0x13f04d=function(_0x167bdb){while(--_0x167bdb){_0x44bb3f['push'](_0x44bb3f['shift']());}};_0x13f04d(++_0x175b7c);}(_0xa02e,0x13a));var _0xea02=function(_0x4ad525,_0x3df193){_0x4ad525=_0x4ad525-0x0;var _0x4a071d=_0xa02e[_0x4ad525];return _0x4a071d;};'use strict';var client=require(_0xea02('0x0'));exports[_0xea02('0x1')]=function(_0x40301b,_0x237deb){return client[_0xea02('0x2')](_0xea02('0x3'),{'body':_0x237deb,'options':{'where':{'AttachmentId':_0x40301b}},'log':_0xea02('0x3')});};
\ No newline at end of file
+var _0x50a0=['update','Request','UpdateFaxMessage','../client'];(function(_0x204ed4,_0x17c2d3){var _0x262d9f=function(_0x403f3f){while(--_0x403f3f){_0x204ed4['push'](_0x204ed4['shift']());}};_0x262d9f(++_0x17c2d3);}(_0x50a0,0x193));var _0x050a=function(_0x314946,_0x5303c1){_0x314946=_0x314946-0x0;var _0x15d070=_0x50a0[_0x314946];return _0x15d070;};'use strict';var client=require(_0x050a('0x0'));exports[_0x050a('0x1')]=function(_0x4e2842,_0x4ac4a2){return client[_0x050a('0x2')]('UpdateFaxMessage',{'body':_0x4ac4a2,'options':{'where':{'AttachmentId':_0x4e2842}},'log':_0x050a('0x3')});};
\ No newline at end of file
index b570c6b..4080b66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x195e=['keyType','keyContent','Fields','idField','nameField','Tag','../../client','Request','GetDeskAccount','username','password','remoteUri','authType','type','serverUrl','DeskConfiguration','Configurations','name','DeskField','Subjects','content','variableName','Variable','key'];(function(_0xd060d,_0x418fed){var _0x310992=function(_0xf68979){while(--_0xf68979){_0xd060d['push'](_0xd060d['shift']());}};_0x310992(++_0x418fed);}(_0x195e,0x10e));var _0xe195=function(_0x4b8f2f,_0x5e2b59){_0x4b8f2f=_0x4b8f2f-0x0;var _0x4ab417=_0x195e[_0x4b8f2f];return _0x4ab417;};'use strict';var client=require(_0xe195('0x0'));exports['getDeskAccounts']=function(){return function(_0x882cc7){return client[_0xe195('0x1')](_0xe195('0x2'),{'options':{'raw':![],'attributes':['id','name','description',_0xe195('0x3'),_0xe195('0x4'),_0xe195('0x5'),_0xe195('0x6'),_0xe195('0x7'),_0xe195('0x8')],'include':[{'model':_0xe195('0x9'),'as':_0xe195('0xa'),'attributes':['id',_0xe195('0xb')],'include':[{'model':_0xe195('0xc'),'as':_0xe195('0xd'),'attributes':['id','type',_0xe195('0xe'),_0xe195('0xf')],'include':[{'model':_0xe195('0x10'),'as':_0xe195('0x10'),'attributes':['id','name']}]},{'model':_0xe195('0xc'),'as':'Descriptions','attributes':['id',_0xe195('0x7'),_0xe195('0xe'),_0xe195('0x11'),_0xe195('0x12'),_0xe195('0x13'),_0xe195('0xf')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xe195('0xb')]}]},{'model':'DeskField','as':_0xe195('0x14'),'attributes':['id',_0xe195('0x7'),'content',_0xe195('0x15'),_0xe195('0x16'),'customField',_0xe195('0xf')],'include':[{'model':_0xe195('0x10'),'as':_0xe195('0x10'),'attributes':['id',_0xe195('0xb')]}]},{'model':_0xe195('0x17'),'as':'Tags','attributes':['id','name']}]}]},'log':_0xe195('0x2')});};};
\ No newline at end of file
+var _0x2e30=['keyType','Fields','idField','nameField','customField','Tag','Tags','getDeskAccounts','Request','GetDeskAccount','name','description','username','password','type','serverUrl','DeskConfiguration','Configurations','DeskField','Subjects','content','variableName','Variable','Descriptions','key'];(function(_0x53aa2f,_0xc4287d){var _0x18ca89=function(_0x3c7ac6){while(--_0x3c7ac6){_0x53aa2f['push'](_0x53aa2f['shift']());}};_0x18ca89(++_0xc4287d);}(_0x2e30,0x1b0));var _0x02e3=function(_0x58c4bc,_0x436471){_0x58c4bc=_0x58c4bc-0x0;var _0x4a323d=_0x2e30[_0x58c4bc];return _0x4a323d;};'use strict';var client=require('../../client');exports[_0x02e3('0x0')]=function(){return function(_0x20e1e1){return client[_0x02e3('0x1')](_0x02e3('0x2'),{'options':{'raw':![],'attributes':['id',_0x02e3('0x3'),_0x02e3('0x4'),_0x02e3('0x5'),_0x02e3('0x6'),'remoteUri','authType',_0x02e3('0x7'),_0x02e3('0x8')],'include':[{'model':_0x02e3('0x9'),'as':_0x02e3('0xa'),'attributes':['id',_0x02e3('0x3')],'include':[{'model':_0x02e3('0xb'),'as':_0x02e3('0xc'),'attributes':['id',_0x02e3('0x7'),_0x02e3('0xd'),_0x02e3('0xe')],'include':[{'model':_0x02e3('0xf'),'as':'Variable','attributes':['id',_0x02e3('0x3')]}]},{'model':'DeskField','as':_0x02e3('0x10'),'attributes':['id',_0x02e3('0x7'),_0x02e3('0xd'),_0x02e3('0x11'),_0x02e3('0x12'),'keyContent',_0x02e3('0xe')],'include':[{'model':_0x02e3('0xf'),'as':_0x02e3('0xf'),'attributes':['id',_0x02e3('0x3')]}]},{'model':_0x02e3('0xb'),'as':_0x02e3('0x13'),'attributes':['id','type','content',_0x02e3('0x14'),_0x02e3('0x15'),_0x02e3('0x16'),_0x02e3('0xe')],'include':[{'model':'Variable','as':_0x02e3('0xf'),'attributes':['id',_0x02e3('0x3')]}]},{'model':_0x02e3('0x17'),'as':_0x02e3('0x18'),'attributes':['id','name']}]}]},'log':_0x02e3('0x2')});};};
\ No newline at end of file
index ab8a92b..5af5a32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd0c=['Dynamics365Field','variableName','Variable','Descriptions','type','content','key','keyContent','idField','nameField','customField','CloudProvider','data5','data7','../../client','Request','GetDynamics365Account','name','username','password','tenantId','clientId','clientSecret','description','modernAuthentication','ticketType','moduleCreate','additionalSearchContact'];(function(_0x190a73,_0x23e3b7){var _0x45971d=function(_0x2a8309){while(--_0x2a8309){_0x190a73['push'](_0x190a73['shift']());}};_0x45971d(++_0x23e3b7);}(_0xdd0c,0x1b2));var _0xcdd0=function(_0x364367,_0x3ab985){_0x364367=_0x364367-0x0;var _0x4d90b5=_0xdd0c[_0x364367];return _0x4d90b5;};'use strict';var client=require(_0xcdd0('0x0'));exports['getDynamics365Accounts']=function(){return function(_0x21d36f){return client[_0xcdd0('0x1')](_0xcdd0('0x2'),{'options':{'raw':![],'attributes':['id',_0xcdd0('0x3'),_0xcdd0('0x4'),_0xcdd0('0x5'),'remoteUri',_0xcdd0('0x6'),_0xcdd0('0x7'),_0xcdd0('0x8'),'serverUrl',_0xcdd0('0x9'),_0xcdd0('0xa')],'include':[{'model':'Dynamics365Configuration','as':'Configurations','attributes':['id',_0xcdd0('0x3'),_0xcdd0('0xb'),_0xcdd0('0xc'),_0xcdd0('0xd')],'include':[{'model':_0xcdd0('0xe'),'as':'Subjects','attributes':['id','type','content',_0xcdd0('0xf')],'include':[{'model':_0xcdd0('0x10'),'as':_0xcdd0('0x10'),'attributes':['id','name']}]},{'model':_0xcdd0('0xe'),'as':_0xcdd0('0x11'),'attributes':['id',_0xcdd0('0x12'),_0xcdd0('0x13'),_0xcdd0('0x14'),'keyType',_0xcdd0('0x15'),_0xcdd0('0xf')],'include':[{'model':_0xcdd0('0x10'),'as':_0xcdd0('0x10'),'attributes':['id','name']}]},{'model':_0xcdd0('0xe'),'as':'Fields','attributes':['id','type',_0xcdd0('0x13'),_0xcdd0('0x16'),_0xcdd0('0x17'),_0xcdd0('0x18'),_0xcdd0('0xf')],'include':[{'model':_0xcdd0('0x10'),'as':_0xcdd0('0x10'),'attributes':['id','name']}]}]},{'model':_0xcdd0('0x19'),'as':_0xcdd0('0x19'),'attributes':['id','data2',_0xcdd0('0x1a'),_0xcdd0('0x1b')]}]},'log':_0xcdd0('0x2')});};};
\ No newline at end of file
+var _0xf84c=['tenantId','clientId','clientSecret','serverUrl','description','modernAuthentication','Dynamics365Configuration','Configurations','ticketType','moduleCreate','additionalSearchContact','Subjects','variableName','Variable','name','Dynamics365Field','Descriptions','type','content','key','keyType','keyContent','Fields','nameField','CloudProvider','data2','data5','../../client','Request','GetDynamics365Account','username','password','remoteUri'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf84c,0x186));var _0xcf84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf84c[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xcf84('0x0'));exports['getDynamics365Accounts']=function(){return function(_0x3860aa){return client[_0xcf84('0x1')](_0xcf84('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xcf84('0x3'),_0xcf84('0x4'),_0xcf84('0x5'),_0xcf84('0x6'),_0xcf84('0x7'),_0xcf84('0x8'),_0xcf84('0x9'),_0xcf84('0xa'),_0xcf84('0xb')],'include':[{'model':_0xcf84('0xc'),'as':_0xcf84('0xd'),'attributes':['id','name',_0xcf84('0xe'),_0xcf84('0xf'),_0xcf84('0x10')],'include':[{'model':'Dynamics365Field','as':_0xcf84('0x11'),'attributes':['id','type','content',_0xcf84('0x12')],'include':[{'model':_0xcf84('0x13'),'as':_0xcf84('0x13'),'attributes':['id',_0xcf84('0x14')]}]},{'model':_0xcf84('0x15'),'as':_0xcf84('0x16'),'attributes':['id',_0xcf84('0x17'),_0xcf84('0x18'),_0xcf84('0x19'),_0xcf84('0x1a'),_0xcf84('0x1b'),_0xcf84('0x12')],'include':[{'model':'Variable','as':_0xcf84('0x13'),'attributes':['id',_0xcf84('0x14')]}]},{'model':_0xcf84('0x15'),'as':_0xcf84('0x1c'),'attributes':['id',_0xcf84('0x17'),_0xcf84('0x18'),'idField',_0xcf84('0x1d'),'customField',_0xcf84('0x12')],'include':[{'model':'Variable','as':_0xcf84('0x13'),'attributes':['id','name']}]}]},{'model':_0xcf84('0x1e'),'as':_0xcf84('0x1e'),'attributes':['id',_0xcf84('0x1f'),_0xcf84('0x20'),'data7']}]},'log':_0xcf84('0x2')});};};
\ No newline at end of file
index 6bc7387..58db557 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f4d=['../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','username','apiKey','remoteUri','FreshdeskConfiguration','Tag','FreshdeskField','type','content','Variable','Descriptions','keyType','keyContent','variableName','Fields','idField','nameField','customField'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x15a346,_0x46d825){_0x15a346=_0x15a346-0x0;var _0x275a0f=_0x9f4d[_0x15a346];return _0x275a0f;};'use strict';var client=require(_0xd9f4('0x0'));exports[_0xd9f4('0x1')]=function(){return function(_0x34f803){return client[_0xd9f4('0x2')](_0xd9f4('0x3'),{'options':{'raw':![],'attributes':['id',_0xd9f4('0x4'),_0xd9f4('0x5'),_0xd9f4('0x6'),_0xd9f4('0x7'),'serverUrl'],'include':[{'model':_0xd9f4('0x8'),'as':'Configurations','attributes':['id',_0xd9f4('0x4')],'include':[{'model':_0xd9f4('0x9'),'attributes':['id',_0xd9f4('0x4')]},{'model':_0xd9f4('0xa'),'as':'Subjects','attributes':['id',_0xd9f4('0xb'),_0xd9f4('0xc'),'variableName'],'include':[{'model':_0xd9f4('0xd'),'as':'Variable','attributes':['id',_0xd9f4('0x4')]}]},{'model':_0xd9f4('0xa'),'as':_0xd9f4('0xe'),'attributes':['id',_0xd9f4('0xb'),_0xd9f4('0xc'),'key',_0xd9f4('0xf'),_0xd9f4('0x10'),_0xd9f4('0x11')],'include':[{'model':_0xd9f4('0xd'),'as':_0xd9f4('0xd'),'attributes':['id',_0xd9f4('0x4')]}]},{'model':_0xd9f4('0xa'),'as':_0xd9f4('0x12'),'attributes':['id','type',_0xd9f4('0xc'),_0xd9f4('0x13'),_0xd9f4('0x14'),_0xd9f4('0x15'),_0xd9f4('0x11')],'include':[{'model':_0xd9f4('0xd'),'as':_0xd9f4('0xd'),'attributes':['id',_0xd9f4('0x4')]}]}]}]},'log':_0xd9f4('0x3')});};};
\ No newline at end of file
+var _0x8a5c=['idField','customField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','username','apiKey','remoteUri','FreshdeskConfiguration','Configurations','Tag','FreshdeskField','Subjects','content','variableName','Variable','Descriptions','type','keyContent','Fields'];(function(_0x583abb,_0x104950){var _0x5b4766=function(_0x2a5fec){while(--_0x2a5fec){_0x583abb['push'](_0x583abb['shift']());}};_0x5b4766(++_0x104950);}(_0x8a5c,0x136));var _0xc8a5=function(_0x4ace67,_0x2b851d){_0x4ace67=_0x4ace67-0x0;var _0x55ace6=_0x8a5c[_0x4ace67];return _0x55ace6;};'use strict';var client=require(_0xc8a5('0x0'));exports[_0xc8a5('0x1')]=function(){return function(_0x2a8a8d){return client[_0xc8a5('0x2')](_0xc8a5('0x3'),{'options':{'raw':![],'attributes':['id',_0xc8a5('0x4'),_0xc8a5('0x5'),_0xc8a5('0x6'),_0xc8a5('0x7'),'serverUrl'],'include':[{'model':_0xc8a5('0x8'),'as':_0xc8a5('0x9'),'attributes':['id','name'],'include':[{'model':_0xc8a5('0xa'),'attributes':['id',_0xc8a5('0x4')]},{'model':_0xc8a5('0xb'),'as':_0xc8a5('0xc'),'attributes':['id','type',_0xc8a5('0xd'),_0xc8a5('0xe')],'include':[{'model':_0xc8a5('0xf'),'as':_0xc8a5('0xf'),'attributes':['id',_0xc8a5('0x4')]}]},{'model':_0xc8a5('0xb'),'as':_0xc8a5('0x10'),'attributes':['id',_0xc8a5('0x11'),_0xc8a5('0xd'),'key','keyType',_0xc8a5('0x12'),'variableName'],'include':[{'model':_0xc8a5('0xf'),'as':_0xc8a5('0xf'),'attributes':['id',_0xc8a5('0x4')]}]},{'model':_0xc8a5('0xb'),'as':_0xc8a5('0x13'),'attributes':['id','type',_0xc8a5('0xd'),_0xc8a5('0x14'),'nameField',_0xc8a5('0x15'),_0xc8a5('0xe')],'include':[{'model':_0xc8a5('0xf'),'as':_0xc8a5('0xf'),'attributes':['id',_0xc8a5('0x4')]}]}]}]},'log':_0xc8a5('0x3')});};};
\ No newline at end of file
index cc46f50..221981b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11e5=['keyType','keyContent','GetFreshsalesccount','../../client','Request','name','username','apiKey','serverUrl','FreshsalesField','Subjects','variableName','Variable','Descriptions','type','content','key'];(function(_0x2b3015,_0x19ce71){var _0x3bed40=function(_0x4ca551){while(--_0x4ca551){_0x2b3015['push'](_0x2b3015['shift']());}};_0x3bed40(++_0x19ce71);}(_0x11e5,0x8b));var _0x511e=function(_0x4738b7,_0x9096f0){_0x4738b7=_0x4738b7-0x0;var _0x47cb9e=_0x11e5[_0x4738b7];return _0x47cb9e;};'use strict';var client=require(_0x511e('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0xfd6709){return client[_0x511e('0x1')]('GetFreshsalesAccount',{'options':{'raw':![],'attributes':['id',_0x511e('0x2'),_0x511e('0x3'),_0x511e('0x4'),'remoteUri',_0x511e('0x5')],'include':[{'model':'FreshsalesConfiguration','as':'Configurations','attributes':['id',_0x511e('0x2')],'include':[{'model':_0x511e('0x6'),'as':_0x511e('0x7'),'attributes':['id','type','content',_0x511e('0x8')],'include':[{'model':_0x511e('0x9'),'as':_0x511e('0x9'),'attributes':['id',_0x511e('0x2')]}]},{'model':_0x511e('0x6'),'as':_0x511e('0xa'),'attributes':['id',_0x511e('0xb'),_0x511e('0xc'),_0x511e('0xd'),_0x511e('0xe'),_0x511e('0xf'),'variableName'],'include':[{'model':_0x511e('0x9'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0x511e('0x10')});};};
\ No newline at end of file
+var _0x07e8=['Descriptions','key','keyType','keyContent','GetFreshsalesccount','../../client','getFreshsalesAccounts','GetFreshsalesAccount','username','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField','Subjects','type','content','variableName','Variable','name'];(function(_0x301c34,_0x15701e){var _0x1a8c5a=function(_0x297b4f){while(--_0x297b4f){_0x301c34['push'](_0x301c34['shift']());}};_0x1a8c5a(++_0x15701e);}(_0x07e8,0x10f));var _0x807e=function(_0x1697d5,_0x1130ae){_0x1697d5=_0x1697d5-0x0;var _0x12463b=_0x07e8[_0x1697d5];return _0x12463b;};'use strict';var client=require(_0x807e('0x0'));exports[_0x807e('0x1')]=function(){return function(_0x25e72e){return client['Request'](_0x807e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x807e('0x3'),'apiKey','remoteUri',_0x807e('0x4')],'include':[{'model':_0x807e('0x5'),'as':_0x807e('0x6'),'attributes':['id','name'],'include':[{'model':_0x807e('0x7'),'as':_0x807e('0x8'),'attributes':['id',_0x807e('0x9'),_0x807e('0xa'),_0x807e('0xb')],'include':[{'model':'Variable','as':_0x807e('0xc'),'attributes':['id',_0x807e('0xd')]}]},{'model':_0x807e('0x7'),'as':_0x807e('0xe'),'attributes':['id',_0x807e('0x9'),_0x807e('0xa'),_0x807e('0xf'),_0x807e('0x10'),_0x807e('0x11'),_0x807e('0xb')],'include':[{'model':_0x807e('0xc'),'as':_0x807e('0xc'),'attributes':['id',_0x807e('0xd')]}]}]}]},'log':_0x807e('0x12')});};};
\ No newline at end of file
index d48a1ba..b7caeff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2a6=['ticketType','leadId','additionalSearchContact','additionalSearchLead','SalesforceField','Subjects','Variable','Descriptions','Fields','GetSalesforceAccount','../../client','getSalesforceAccounts','Request','name','username','password','remoteUri','clientId','type','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate'];(function(_0x4fc476,_0xb7cdfd){var _0x2de7d8=function(_0x5c4f8f){while(--_0x5c4f8f){_0x4fc476['push'](_0x4fc476['shift']());}};_0x2de7d8(++_0xb7cdfd);}(_0xb2a6,0xf0));var _0x6b2a=function(_0x384710,_0xbd7b6){_0x384710=_0x384710-0x0;var _0x378275=_0xb2a6[_0x384710];return _0x378275;};'use strict';var client=require(_0x6b2a('0x0'));exports[_0x6b2a('0x1')]=function(){return function(_0x55e542){return client[_0x6b2a('0x2')]('GetSalesforceAccount',{'options':{'raw':![],'attributes':['id',_0x6b2a('0x3'),_0x6b2a('0x4'),_0x6b2a('0x5'),_0x6b2a('0x6'),_0x6b2a('0x7'),'clientSecret','securityToken','serverUrl',_0x6b2a('0x8')],'include':[{'model':_0x6b2a('0x9'),'as':_0x6b2a('0xa'),'attributes':['id',_0x6b2a('0x3'),_0x6b2a('0xb'),_0x6b2a('0xc'),_0x6b2a('0xd'),_0x6b2a('0xe'),'additionalSearchAccount',_0x6b2a('0xf'),_0x6b2a('0x10')],'include':[{'model':_0x6b2a('0x11'),'as':_0x6b2a('0x12'),'include':[{'model':'Variable','as':_0x6b2a('0x13'),'attributes':['id',_0x6b2a('0x3')]}]},{'model':_0x6b2a('0x11'),'as':_0x6b2a('0x14'),'include':[{'model':'Variable','as':_0x6b2a('0x13'),'attributes':['id',_0x6b2a('0x3')]}]},{'model':'SalesforceField','as':_0x6b2a('0x15'),'include':[{'model':_0x6b2a('0x13'),'as':_0x6b2a('0x13'),'attributes':['id',_0x6b2a('0x3')]}]}]}]},'log':_0x6b2a('0x16')});};};
\ No newline at end of file
+var _0x3145=['moduleSearch','moduleCreate','leadId','additionalSearchContact','additionalSearchLead','SalesforceField','Subjects','Variable','Descriptions','Fields','getSalesforceAccounts','Request','GetSalesforceAccount','name','username','password','remoteUri','clientSecret','serverUrl','type','SalesforceConfiguration'];(function(_0x66f5f4,_0x3309a7){var _0x308c0c=function(_0x34b905){while(--_0x34b905){_0x66f5f4['push'](_0x66f5f4['shift']());}};_0x308c0c(++_0x3309a7);}(_0x3145,0xc7));var _0x5314=function(_0x2fd5df,_0x68b58b){_0x2fd5df=_0x2fd5df-0x0;var _0x4ba342=_0x3145[_0x2fd5df];return _0x4ba342;};'use strict';var client=require('../../client');exports[_0x5314('0x0')]=function(){return function(_0x1cb8ee){return client[_0x5314('0x1')](_0x5314('0x2'),{'options':{'raw':![],'attributes':['id',_0x5314('0x3'),_0x5314('0x4'),_0x5314('0x5'),_0x5314('0x6'),'clientId',_0x5314('0x7'),'securityToken',_0x5314('0x8'),_0x5314('0x9')],'include':[{'model':_0x5314('0xa'),'as':'Configurations','attributes':['id',_0x5314('0x3'),_0x5314('0xb'),_0x5314('0xc'),'ticketType',_0x5314('0xd'),'additionalSearchAccount',_0x5314('0xe'),_0x5314('0xf')],'include':[{'model':_0x5314('0x10'),'as':_0x5314('0x11'),'include':[{'model':_0x5314('0x12'),'as':_0x5314('0x12'),'attributes':['id',_0x5314('0x3')]}]},{'model':_0x5314('0x10'),'as':_0x5314('0x13'),'include':[{'model':_0x5314('0x12'),'as':_0x5314('0x12'),'attributes':['id','name']}]},{'model':_0x5314('0x10'),'as':_0x5314('0x14'),'include':[{'model':_0x5314('0x12'),'as':_0x5314('0x12'),'attributes':['id',_0x5314('0x3')]}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
index 791677c..7ff3768 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31f0=['remoteUri','Subjects','type','content','variableName','Variable','ServicenowField','Descriptions','key','keyType','Fields','idField','nameField','customField','GetServicenowkAccount','../../client','GetServicenowAccount','name','description','username','email'];(function(_0x3bf98e,_0x3a9f1d){var _0x3ce656=function(_0x11ff06){while(--_0x11ff06){_0x3bf98e['push'](_0x3bf98e['shift']());}};_0x3ce656(++_0x3a9f1d);}(_0x31f0,0xb7));var _0x031f=function(_0x5a73c5,_0x3a8436){_0x5a73c5=_0x5a73c5-0x0;var _0x182f14=_0x31f0[_0x5a73c5];return _0x182f14;};'use strict';var client=require(_0x031f('0x0'));exports['getServicenowAccounts']=function(){return function(_0xc4ca54){return client['Request'](_0x031f('0x1'),{'options':{'raw':![],'attributes':['id',_0x031f('0x2'),_0x031f('0x3'),_0x031f('0x4'),'password',_0x031f('0x5'),_0x031f('0x6'),'serverUrl'],'include':[{'model':'ServicenowConfiguration','as':'Configurations','attributes':['id',_0x031f('0x2')],'include':[{'model':'ServicenowField','as':_0x031f('0x7'),'attributes':['id',_0x031f('0x8'),_0x031f('0x9'),_0x031f('0xa')],'include':[{'model':'Variable','as':_0x031f('0xb'),'attributes':['id',_0x031f('0x2')]}]},{'model':_0x031f('0xc'),'as':_0x031f('0xd'),'attributes':['id',_0x031f('0x8'),_0x031f('0x9'),_0x031f('0xe'),_0x031f('0xf'),'keyContent',_0x031f('0xa')],'include':[{'model':_0x031f('0xb'),'as':_0x031f('0xb'),'attributes':['id',_0x031f('0x2')]}]},{'model':_0x031f('0xc'),'as':_0x031f('0x10'),'attributes':['id',_0x031f('0x8'),'content',_0x031f('0x11'),_0x031f('0x12'),_0x031f('0x13'),_0x031f('0xa')],'include':[{'model':_0x031f('0xb'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0x031f('0x14')});};};
\ No newline at end of file
+var _0x57ca=['type','variableName','Variable','Descriptions','content','key','keyContent','Fields','nameField','customField','GetServicenowkAccount','getServicenowAccounts','GetServicenowAccount','name','description','username','password','remoteUri','serverUrl','ServicenowConfiguration','Configurations','ServicenowField','Subjects'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x57ca,0x108));var _0xa57c=function(_0x583771,_0x3778c5){_0x583771=_0x583771-0x0;var _0x2d7251=_0x57ca[_0x583771];return _0x2d7251;};'use strict';var client=require('../../client');exports[_0xa57c('0x0')]=function(){return function(_0x4ad696){return client['Request'](_0xa57c('0x1'),{'options':{'raw':![],'attributes':['id',_0xa57c('0x2'),_0xa57c('0x3'),_0xa57c('0x4'),_0xa57c('0x5'),'email',_0xa57c('0x6'),_0xa57c('0x7')],'include':[{'model':_0xa57c('0x8'),'as':_0xa57c('0x9'),'attributes':['id',_0xa57c('0x2')],'include':[{'model':_0xa57c('0xa'),'as':_0xa57c('0xb'),'attributes':['id',_0xa57c('0xc'),'content',_0xa57c('0xd')],'include':[{'model':'Variable','as':_0xa57c('0xe'),'attributes':['id',_0xa57c('0x2')]}]},{'model':'ServicenowField','as':_0xa57c('0xf'),'attributes':['id','type',_0xa57c('0x10'),_0xa57c('0x11'),'keyType',_0xa57c('0x12'),'variableName'],'include':[{'model':_0xa57c('0xe'),'as':_0xa57c('0xe'),'attributes':['id',_0xa57c('0x2')]}]},{'model':_0xa57c('0xa'),'as':_0xa57c('0x13'),'attributes':['id','type',_0xa57c('0x10'),'idField',_0xa57c('0x14'),_0xa57c('0x15'),_0xa57c('0xd')],'include':[{'model':_0xa57c('0xe'),'as':_0xa57c('0xe'),'attributes':['id',_0xa57c('0x2')]}]}]}]},'log':_0xa57c('0x16')});};};
\ No newline at end of file
index e332fb0..debe30d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['nameField','customField','../../client','getSugarcrmAccounts','GetSugarcrmAccount','name','password','remoteUri','serverUrl','SugarcrmConfiguration','Configurations','SugarcrmField','type','content','Variable','Descriptions','key','variableName','Fields','idField'];(function(_0x55ba11,_0x109cb5){var _0x3841cc=function(_0x4ee1da){while(--_0x4ee1da){_0x55ba11['push'](_0x55ba11['shift']());}};_0x3841cc(++_0x109cb5);}(_0x7a54,0x106));var _0x47a5=function(_0x5e6da7,_0x511e9b){_0x5e6da7=_0x5e6da7-0x0;var _0x1bd0d7=_0x7a54[_0x5e6da7];return _0x1bd0d7;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(){return function(_0x44b31e){return client['Request'](_0x47a5('0x2'),{'options':{'raw':![],'attributes':['id',_0x47a5('0x3'),'username',_0x47a5('0x4'),_0x47a5('0x5'),_0x47a5('0x6')],'include':[{'model':_0x47a5('0x7'),'as':_0x47a5('0x8'),'attributes':['id','name'],'include':[{'model':_0x47a5('0x9'),'as':'Subjects','attributes':['id',_0x47a5('0xa'),_0x47a5('0xb'),'variableName'],'include':[{'model':_0x47a5('0xc'),'as':'Variable','attributes':['id','name']}]},{'model':'SugarcrmField','as':_0x47a5('0xd'),'attributes':['id',_0x47a5('0xa'),'content',_0x47a5('0xe'),'keyType','keyContent',_0x47a5('0xf')],'include':[{'model':_0x47a5('0xc'),'as':_0x47a5('0xc'),'attributes':['id',_0x47a5('0x3')]}]},{'model':_0x47a5('0x9'),'as':_0x47a5('0x10'),'attributes':['id',_0x47a5('0xa'),'content',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0xf')],'include':[{'model':_0x47a5('0xc'),'as':_0x47a5('0xc'),'attributes':['id',_0x47a5('0x3')]}]}]}]},'log':_0x47a5('0x2')});};};
\ No newline at end of file
+var _0x14a0=['variableName','key','keyContent','Variable','SugarcrmField','Fields','idField','nameField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','username','password','SugarcrmConfiguration','Configurations','type','content'];(function(_0x1bfcfc,_0x140f5b){var _0x1041ff=function(_0x2d48fc){while(--_0x2d48fc){_0x1bfcfc['push'](_0x1bfcfc['shift']());}};_0x1041ff(++_0x140f5b);}(_0x14a0,0x8e));var _0x014a=function(_0x7a3c8f,_0x41acbc){_0x7a3c8f=_0x7a3c8f-0x0;var _0x584143=_0x14a0[_0x7a3c8f];return _0x584143;};'use strict';var client=require('../../client');exports[_0x014a('0x0')]=function(){return function(_0x451138){return client[_0x014a('0x1')](_0x014a('0x2'),{'options':{'raw':![],'attributes':['id',_0x014a('0x3'),_0x014a('0x4'),_0x014a('0x5'),'remoteUri','serverUrl'],'include':[{'model':_0x014a('0x6'),'as':_0x014a('0x7'),'attributes':['id',_0x014a('0x3')],'include':[{'model':'SugarcrmField','as':'Subjects','attributes':['id',_0x014a('0x8'),_0x014a('0x9'),_0x014a('0xa')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x014a('0x3')]}]},{'model':'SugarcrmField','as':'Descriptions','attributes':['id','type','content',_0x014a('0xb'),'keyType',_0x014a('0xc'),_0x014a('0xa')],'include':[{'model':'Variable','as':_0x014a('0xd'),'attributes':['id',_0x014a('0x3')]}]},{'model':_0x014a('0xe'),'as':_0x014a('0xf'),'attributes':['id',_0x014a('0x8'),_0x014a('0x9'),_0x014a('0x10'),_0x014a('0x11'),_0x014a('0x12'),_0x014a('0xa')],'include':[{'model':_0x014a('0xd'),'as':_0x014a('0xd'),'attributes':['id','name']}]}]}]},'log':_0x014a('0x2')});};};
\ No newline at end of file
index ceeca2c..5b4369b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e49=['getVtigerAccounts','GetVtigerAccount','name','description','accessKey','remoteUri','serverUrl','VtigerField','type','content','key','keyType','variableName','Variable','Fields','idField','nameField','customField','../../client'];(function(_0x5f1617,_0x46277b){var _0x3af5da=function(_0x15b934){while(--_0x15b934){_0x5f1617['push'](_0x5f1617['shift']());}};_0x3af5da(++_0x46277b);}(_0x6e49,0xaa));var _0x96e4=function(_0x2be5f5,_0x444e7a){_0x2be5f5=_0x2be5f5-0x0;var _0x53a331=_0x6e49[_0x2be5f5];return _0x53a331;};'use strict';var client=require(_0x96e4('0x0'));exports[_0x96e4('0x1')]=function(){return function(_0xaacaf8){return client['Request'](_0x96e4('0x2'),{'options':{'raw':![],'attributes':['id',_0x96e4('0x3'),_0x96e4('0x4'),'username',_0x96e4('0x5'),_0x96e4('0x6'),_0x96e4('0x7')],'include':[{'model':'VtigerConfiguration','as':'Configurations','attributes':['id',_0x96e4('0x3')],'include':[{'model':_0x96e4('0x8'),'as':'Subjects','attributes':['id',_0x96e4('0x9'),'content','variableName'],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x96e4('0x3')]}]},{'model':_0x96e4('0x8'),'as':'Descriptions','attributes':['id',_0x96e4('0x9'),_0x96e4('0xa'),_0x96e4('0xb'),_0x96e4('0xc'),'keyContent',_0x96e4('0xd')],'include':[{'model':_0x96e4('0xe'),'as':_0x96e4('0xe'),'attributes':['id',_0x96e4('0x3')]}]},{'model':_0x96e4('0x8'),'as':_0x96e4('0xf'),'attributes':['id','type',_0x96e4('0xa'),_0x96e4('0x10'),_0x96e4('0x11'),_0x96e4('0x12'),_0x96e4('0xd')],'include':[{'model':_0x96e4('0xe'),'as':_0x96e4('0xe'),'attributes':['id',_0x96e4('0x3')]}]}]}]},'log':'GetVtigerAccount'});};};
\ No newline at end of file
+var _0x4302=['customField','variableName','../../client','Request','GetVtigerAccount','name','description','username','accessKey','remoteUri','serverUrl','VtigerConfiguration','Subjects','Variable','VtigerField','Descriptions','type','content','key','keyContent','Fields','idField','nameField'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x4302,0xff));var _0x2430=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x4302[_0x580576];return _0x3f55a0;};'use strict';var client=require(_0x2430('0x0'));exports['getVtigerAccounts']=function(){return function(_0xd14934){return client[_0x2430('0x1')](_0x2430('0x2'),{'options':{'raw':![],'attributes':['id',_0x2430('0x3'),_0x2430('0x4'),_0x2430('0x5'),_0x2430('0x6'),_0x2430('0x7'),_0x2430('0x8')],'include':[{'model':_0x2430('0x9'),'as':'Configurations','attributes':['id',_0x2430('0x3')],'include':[{'model':'VtigerField','as':_0x2430('0xa'),'attributes':['id','type','content','variableName'],'include':[{'model':_0x2430('0xb'),'as':_0x2430('0xb'),'attributes':['id',_0x2430('0x3')]}]},{'model':_0x2430('0xc'),'as':_0x2430('0xd'),'attributes':['id',_0x2430('0xe'),_0x2430('0xf'),_0x2430('0x10'),'keyType',_0x2430('0x11'),'variableName'],'include':[{'model':_0x2430('0xb'),'as':_0x2430('0xb'),'attributes':['id','name']}]},{'model':_0x2430('0xc'),'as':_0x2430('0x12'),'attributes':['id',_0x2430('0xe'),'content',_0x2430('0x13'),_0x2430('0x14'),_0x2430('0x15'),_0x2430('0x16')],'include':[{'model':_0x2430('0xb'),'as':_0x2430('0xb'),'attributes':['id','name']}]}]}]},'log':_0x2430('0x2')});};};
\ No newline at end of file
index 8a3d243..b2f04f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf36c=['Variable','Descriptions','content','key','keyType','Fields','nameField','../../client','getZendeskAccounts','Request','GetZendeskAccount','name','username','password','serverUrl','type','ZendeskConfiguration','Configurations','Tag','ZendeskField','Subjects','variableName'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf36c,0x151));var _0xcf36=function(_0x370dd1,_0x4764bb){_0x370dd1=_0x370dd1-0x0;var _0x10e0a6=_0xf36c[_0x370dd1];return _0x10e0a6;};'use strict';var client=require(_0xcf36('0x0'));exports[_0xcf36('0x1')]=function(){return function(_0x70e6ef){return client[_0xcf36('0x2')](_0xcf36('0x3'),{'options':{'raw':![],'attributes':['id',_0xcf36('0x4'),_0xcf36('0x5'),_0xcf36('0x6'),'token','remoteUri','authType',_0xcf36('0x7'),_0xcf36('0x8')],'include':[{'model':_0xcf36('0x9'),'as':_0xcf36('0xa'),'attributes':['id',_0xcf36('0x4')],'include':[{'model':_0xcf36('0xb'),'attributes':['id','name']},{'model':_0xcf36('0xc'),'as':_0xcf36('0xd'),'attributes':['id',_0xcf36('0x8'),'content',_0xcf36('0xe')],'include':[{'model':_0xcf36('0xf'),'as':_0xcf36('0xf'),'attributes':['id',_0xcf36('0x4')]}]},{'model':_0xcf36('0xc'),'as':_0xcf36('0x10'),'attributes':['id',_0xcf36('0x8'),_0xcf36('0x11'),_0xcf36('0x12'),_0xcf36('0x13'),'keyContent',_0xcf36('0xe')],'include':[{'model':_0xcf36('0xf'),'as':_0xcf36('0xf'),'attributes':['id','name']}]},{'model':_0xcf36('0xc'),'as':_0xcf36('0x14'),'attributes':['id',_0xcf36('0x8'),_0xcf36('0x11'),'idField',_0xcf36('0x15'),'customField',_0xcf36('0xe')],'include':[{'model':_0xcf36('0xf'),'as':_0xcf36('0xf'),'attributes':['id',_0xcf36('0x4')]}]}]}]},'log':_0xcf36('0x3')});};};
\ No newline at end of file
+var _0xcce5=['Fields','idField','nameField','customField','../../client','getZendeskAccounts','Request','GetZendeskAccount','name','username','token','remoteUri','authType','serverUrl','type','ZendeskConfiguration','Configurations','Tag','ZendeskField','Subjects','content','variableName','Variable','key','keyType','keyContent'];(function(_0x1a1b57,_0xd7e773){var _0x394992=function(_0x34ba60){while(--_0x34ba60){_0x1a1b57['push'](_0x1a1b57['shift']());}};_0x394992(++_0xd7e773);}(_0xcce5,0x1a4));var _0x5cce=function(_0x36e642,_0x2f6005){_0x36e642=_0x36e642-0x0;var _0x35cc0c=_0xcce5[_0x36e642];return _0x35cc0c;};'use strict';var client=require(_0x5cce('0x0'));exports[_0x5cce('0x1')]=function(){return function(_0x31dfec){return client[_0x5cce('0x2')](_0x5cce('0x3'),{'options':{'raw':![],'attributes':['id',_0x5cce('0x4'),_0x5cce('0x5'),'password',_0x5cce('0x6'),_0x5cce('0x7'),_0x5cce('0x8'),_0x5cce('0x9'),_0x5cce('0xa')],'include':[{'model':_0x5cce('0xb'),'as':_0x5cce('0xc'),'attributes':['id',_0x5cce('0x4')],'include':[{'model':_0x5cce('0xd'),'attributes':['id',_0x5cce('0x4')]},{'model':_0x5cce('0xe'),'as':_0x5cce('0xf'),'attributes':['id',_0x5cce('0xa'),_0x5cce('0x10'),_0x5cce('0x11')],'include':[{'model':_0x5cce('0x12'),'as':_0x5cce('0x12'),'attributes':['id',_0x5cce('0x4')]}]},{'model':_0x5cce('0xe'),'as':'Descriptions','attributes':['id','type',_0x5cce('0x10'),_0x5cce('0x13'),_0x5cce('0x14'),_0x5cce('0x15'),_0x5cce('0x11')],'include':[{'model':_0x5cce('0x12'),'as':_0x5cce('0x12'),'attributes':['id',_0x5cce('0x4')]}]},{'model':_0x5cce('0xe'),'as':_0x5cce('0x16'),'attributes':['id',_0x5cce('0xa'),'content',_0x5cce('0x17'),_0x5cce('0x18'),_0x5cce('0x19'),_0x5cce('0x11')],'include':[{'model':_0x5cce('0x12'),'as':_0x5cce('0x12'),'attributes':['id',_0x5cce('0x4')]}]}]}]},'log':'GetZendeskAccount'});};};
\ No newline at end of file
index 0eaae71..3048f4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb683=['keyType','keyContent','nameField','customField','../../client','getZohoAccounts','Request','GetZohoAccount','zone','clientId','code','refreshToken','ZohoConfiguration','Configurations','name','moduleCreate','Subjects','type','content','variableName','Variable','ZohoField','key'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xb683,0x101));var _0x3b68=function(_0x3abce4,_0x34e488){_0x3abce4=_0x3abce4-0x0;var _0x2c25db=_0xb683[_0x3abce4];return _0x2c25db;};'use strict';var client=require(_0x3b68('0x0'));exports[_0x3b68('0x1')]=function(){return function(_0x440d0c){return client[_0x3b68('0x2')](_0x3b68('0x3'),{'options':{'raw':![],'attributes':['id','name','description','host',_0x3b68('0x4'),_0x3b68('0x5'),'clientSecret','serverUrl',_0x3b68('0x6'),_0x3b68('0x7')],'include':[{'model':_0x3b68('0x8'),'as':_0x3b68('0x9'),'attributes':['id',_0x3b68('0xa'),_0x3b68('0xb'),'moduleSearch','description'],'include':[{'model':'ZohoField','as':_0x3b68('0xc'),'attributes':['id',_0x3b68('0xd'),_0x3b68('0xe'),_0x3b68('0xf')],'include':[{'model':_0x3b68('0x10'),'as':_0x3b68('0x10'),'attributes':['id',_0x3b68('0xa')]}]},{'model':_0x3b68('0x11'),'as':'Descriptions','attributes':['id',_0x3b68('0xd'),_0x3b68('0xe'),_0x3b68('0x12'),_0x3b68('0x13'),_0x3b68('0x14'),_0x3b68('0xf')],'include':[{'model':_0x3b68('0x10'),'as':'Variable','attributes':['id',_0x3b68('0xa')]}]},{'model':_0x3b68('0x11'),'as':'Fields','attributes':['id','type',_0x3b68('0xe'),'idField',_0x3b68('0x15'),_0x3b68('0x16'),_0x3b68('0xf')],'include':[{'model':'Variable','as':_0x3b68('0x10'),'attributes':['id',_0x3b68('0xa')]}]}]}]},'log':_0x3b68('0x3')});};};
\ No newline at end of file
+var _0xf57a=['keyContent','variableName','Fields','content','idField','customField','../../client','getZohoAccounts','GetZohoAccount','name','description','zone','clientSecret','serverUrl','code','ZohoConfiguration','Configurations','moduleCreate','moduleSearch','ZohoField','Subjects','Variable','Descriptions','type','key'];(function(_0x1838f5,_0x1e3aec){var _0x1603a5=function(_0xde0179){while(--_0xde0179){_0x1838f5['push'](_0x1838f5['shift']());}};_0x1603a5(++_0x1e3aec);}(_0xf57a,0x132));var _0xaf57=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xf57a[_0x2235bf];return _0x4c3a64;};'use strict';var client=require(_0xaf57('0x0'));exports[_0xaf57('0x1')]=function(){return function(_0x19b1c9){return client['Request'](_0xaf57('0x2'),{'options':{'raw':![],'attributes':['id',_0xaf57('0x3'),_0xaf57('0x4'),'host',_0xaf57('0x5'),'clientId',_0xaf57('0x6'),_0xaf57('0x7'),_0xaf57('0x8'),'refreshToken'],'include':[{'model':_0xaf57('0x9'),'as':_0xaf57('0xa'),'attributes':['id',_0xaf57('0x3'),_0xaf57('0xb'),_0xaf57('0xc'),_0xaf57('0x4')],'include':[{'model':_0xaf57('0xd'),'as':_0xaf57('0xe'),'attributes':['id','type','content','variableName'],'include':[{'model':_0xaf57('0xf'),'as':'Variable','attributes':['id',_0xaf57('0x3')]}]},{'model':_0xaf57('0xd'),'as':_0xaf57('0x10'),'attributes':['id',_0xaf57('0x11'),'content',_0xaf57('0x12'),'keyType',_0xaf57('0x13'),_0xaf57('0x14')],'include':[{'model':_0xaf57('0xf'),'as':_0xaf57('0xf'),'attributes':['id',_0xaf57('0x3')]}]},{'model':'ZohoField','as':_0xaf57('0x15'),'attributes':['id',_0xaf57('0x11'),_0xaf57('0x16'),_0xaf57('0x17'),'nameField',_0xaf57('0x18'),_0xaf57('0x14')],'include':[{'model':_0xaf57('0xf'),'as':_0xaf57('0xf'),'attributes':['id',_0xaf57('0x3')]}]}]}]},'log':_0xaf57('0x2')});};};
\ No newline at end of file
index 56d8c76..51d1d1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa110=['diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','membername','interface','starttime','endtime','dialstring','moment','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','format','SIP/%s','TALKING','queuecallerleaveAt'];(function(_0x5b8e78,_0x1da6c0){var _0x255a99=function(_0x4e08c8){while(--_0x4e08c8){_0x5b8e78['push'](_0x5b8e78['shift']());}};_0x255a99(++_0x1da6c0);}(_0xa110,0x1f0));var _0x0a11=function(_0x53f15b,_0x32a2b5){_0x53f15b=_0x53f15b-0x0;var _0x3dfca0=_0xa110[_0x53f15b];return _0x3dfca0;};'use strict';var moment=require(_0x0a11('0x0'));var _=require('lodash');var util=require(_0x0a11('0x1'));var client=require(_0x0a11('0x2'));exports[_0x0a11('0x3')]=function(_0x2faf69){var _0x2b8813=_0x2faf69[_0x0a11('0x4')]||_0x2faf69[_0x0a11('0x5')];return client[_0x0a11('0x6')](_0x0a11('0x7'),{'body':{'channel':_0x0a11('0x8'),'membername':_0x2faf69[_0x0a11('0x9')],'interface':_['isNil'](_0x2faf69['interface'])?util[_0x0a11('0xa')](_0x0a11('0xb'),_0x2faf69[_0x0a11('0x9')]):_0x2faf69['interface'],'type':_0x0a11('0xc'),'enterAt':_0x2faf69[_0x0a11('0xd')],'exitAt':_0x2b8813,'duration':moment(_0x2b8813)[_0x0a11('0xe')](_0x2faf69[_0x0a11('0xd')],_0x0a11('0xf')),'data1':_0x0a11('0x10'),'data2':_0x2faf69[_0x0a11('0x11')],'data3':_0x2faf69[_0x0a11('0x12')],'data4':null,'data5':_0x2faf69[_0x0a11('0x13')],'role':_0x0a11('0x14'),'internal':_0x2faf69[_0x0a11('0x15')]?_[_0x0a11('0x16')](_0x2faf69[_0x0a11('0x15')]):undefined,'uniqueid':_0x2faf69[_0x0a11('0x17')]},'log':_0x0a11('0x7')});};exports[_0x0a11('0x18')]=function(_0x3fbd5f){return client[_0x0a11('0x6')](_0x0a11('0x7'),{'body':{'channel':_0x0a11('0x8'),'membername':_0x3fbd5f[_0x0a11('0x19')],'interface':_0x3fbd5f[_0x0a11('0x1a')],'type':_0x0a11('0xc'),'enterAt':_0x3fbd5f[_0x0a11('0x1b')],'exitAt':_0x3fbd5f[_0x0a11('0x1c')],'duration':moment(_0x3fbd5f[_0x0a11('0x1c')])['diff'](_0x3fbd5f[_0x0a11('0x1b')],_0x0a11('0xf'))>=0x0?moment(_0x3fbd5f[_0x0a11('0x1c')])['diff'](_0x3fbd5f[_0x0a11('0x1b')],'seconds'):null,'data1':'outbound','data2':_0x3fbd5f[_0x0a11('0x15')],'data3':_0x3fbd5f[_0x0a11('0x12')],'data4':_0x3fbd5f[_0x0a11('0x1d')]||null,'role':_0x0a11('0x14'),'internal':_0x3fbd5f['accountcode']?_[_0x0a11('0x16')](_0x3fbd5f['accountcode']):undefined,'uniqueid':_0x3fbd5f[_0x0a11('0x17')]},'log':'CreateMemberReport'});};
\ No newline at end of file
+var _0x76ba=['exten','dialstring','moment','lodash','util','voiceQueueReport','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','SIP/%s','TALKING','diff','seconds','inbound','calleridnum','queue','agent','accountcode','toNumber','uniqueid','starttime','endtime'];(function(_0x301cfe,_0x5eee00){var _0x364940=function(_0x1df3e3){while(--_0x1df3e3){_0x301cfe['push'](_0x301cfe['shift']());}};_0x364940(++_0x5eee00);}(_0x76ba,0x1ab));var _0xa76b=function(_0x2528f8,_0x304340){_0x2528f8=_0x2528f8-0x0;var _0x4cfea8=_0x76ba[_0x2528f8];return _0x4cfea8;};'use strict';var moment=require(_0xa76b('0x0'));var _=require(_0xa76b('0x1'));var util=require(_0xa76b('0x2'));var client=require('../client');exports[_0xa76b('0x3')]=function(_0x48676f){var _0x3d6411=_0x48676f['queuecallercompleteAt']||_0x48676f['queuecallerexitAt'];return client[_0xa76b('0x4')](_0xa76b('0x5'),{'body':{'channel':_0xa76b('0x6'),'membername':_0x48676f[_0xa76b('0x7')],'interface':_[_0xa76b('0x8')](_0x48676f[_0xa76b('0x9')])?util['format'](_0xa76b('0xa'),_0x48676f[_0xa76b('0x7')]):_0x48676f[_0xa76b('0x9')],'type':_0xa76b('0xb'),'enterAt':_0x48676f['queuecallerleaveAt'],'exitAt':_0x3d6411,'duration':moment(_0x3d6411)[_0xa76b('0xc')](_0x48676f['queuecallerleaveAt'],_0xa76b('0xd')),'data1':_0xa76b('0xe'),'data2':_0x48676f[_0xa76b('0xf')],'data3':_0x48676f['exten'],'data4':null,'data5':_0x48676f[_0xa76b('0x10')],'role':_0xa76b('0x11'),'internal':_0x48676f[_0xa76b('0x12')]?_[_0xa76b('0x13')](_0x48676f['accountcode']):undefined,'uniqueid':_0x48676f[_0xa76b('0x14')]},'log':_0xa76b('0x5')});};exports['voiceDialReport']=function(_0x284e9b){return client[_0xa76b('0x4')](_0xa76b('0x5'),{'body':{'channel':_0xa76b('0x6'),'membername':_0x284e9b['membername'],'interface':_0x284e9b['interface'],'type':_0xa76b('0xb'),'enterAt':_0x284e9b[_0xa76b('0x15')],'exitAt':_0x284e9b[_0xa76b('0x16')],'duration':moment(_0x284e9b[_0xa76b('0x16')])[_0xa76b('0xc')](_0x284e9b[_0xa76b('0x15')],_0xa76b('0xd'))>=0x0?moment(_0x284e9b['endtime'])[_0xa76b('0xc')](_0x284e9b['starttime'],_0xa76b('0xd')):null,'data1':'outbound','data2':_0x284e9b[_0xa76b('0x12')],'data3':_0x284e9b[_0xa76b('0x17')],'data4':_0x284e9b[_0xa76b('0x18')]||null,'role':_0xa76b('0x11'),'internal':_0x284e9b['accountcode']?_[_0xa76b('0x13')](_0x284e9b[_0xa76b('0x12')]):undefined,'uniqueid':_0x284e9b[_0xa76b('0x14')]},'log':_0xa76b('0x5')});};
\ No newline at end of file
index d067e4d..aa2ddc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87d5=['previewRecallmeReminderInterval','GetSettings','../client','Request','stopRecordingOnTransfer'];(function(_0x390733,_0x1e3d32){var _0x33beb9=function(_0x4491a3){while(--_0x4491a3){_0x390733['push'](_0x390733['shift']());}};_0x33beb9(++_0x1e3d32);}(_0x87d5,0x6b));var _0x587d=function(_0x505e7e,_0x3881eb){_0x505e7e=_0x505e7e-0x0;var _0x45303f=_0x87d5[_0x505e7e];return _0x45303f;};'use strict';var client=require(_0x587d('0x0'));exports['getSettings']=function(){return client[_0x587d('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x587d('0x2'),_0x587d('0x3')]},'log':_0x587d('0x4')});};
\ No newline at end of file
+var _0x1131=['previewRecallmeReminderInterval','GetSettings','getSettings'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x1131,0x71));var _0x1113=function(_0x9bef6d,_0x16775b){_0x9bef6d=_0x9bef6d-0x0;var _0x300f83=_0x1131[_0x9bef6d];return _0x300f83;};'use strict';var client=require('../client');exports[_0x1113('0x0')]=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x1113('0x1')]},'log':_0x1113('0x2')});};
\ No newline at end of file
index 94150e2..63f8d58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbac0=['../client','Request','GetTemplate','name'];(function(_0x324e58,_0x5667bf){var _0x41bda1=function(_0x370b04){while(--_0x370b04){_0x324e58['push'](_0x324e58['shift']());}};_0x41bda1(++_0x5667bf);}(_0xbac0,0x8c));var _0x0bac=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0xbac0[_0x25662e];return _0x59b7bc;};'use strict';var client=require(_0x0bac('0x0'));exports['getTemplates']=function(_0x3c2160){return function(_0x24e50c){return client[_0x0bac('0x1')](_0x0bac('0x2'),{'options':{'raw':!![],'attributes':['id',_0x0bac('0x3'),'html']},'log':_0x0bac('0x2')});};};
\ No newline at end of file
+var _0x382a=['../client','getTemplates','Request','GetTemplate','name','html'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x382a,0x120));var _0xa382=function(_0x40911a,_0x55ec99){_0x40911a=_0x40911a-0x0;var _0x27e8e3=_0x382a[_0x40911a];return _0x27e8e3;};'use strict';var client=require(_0xa382('0x0'));exports[_0xa382('0x1')]=function(_0x5924f0){return function(_0x210fea){return client[_0xa382('0x2')](_0xa382('0x3'),{'options':{'raw':!![],'attributes':['id',_0xa382('0x4'),_0xa382('0x5')]},'log':_0xa382('0x3')});};};
\ No newline at end of file
index 01d9663..4ae9aea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37c5=['value','AnyConditions','field','Actions','action','data2','data4','data5','data6','data7','../client','Request','GetTrigger','channel','status','AllConditions','operator'];(function(_0x1ae149,_0x3f0974){var _0x4f484d=function(_0x64bab8){while(--_0x64bab8){_0x1ae149['push'](_0x1ae149['shift']());}};_0x4f484d(++_0x3f0974);}(_0x37c5,0x14d));var _0x537c=function(_0x32dc6b,_0x1157df){_0x32dc6b=_0x32dc6b-0x0;var _0x3f2ceb=_0x37c5[_0x32dc6b];return _0x3f2ceb;};'use strict';var client=require(_0x537c('0x0'));exports['getTriggers']=function(_0xc96df1){return function(_0x601e3){return client[_0x537c('0x1')](_0x537c('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x537c('0x3'),_0x537c('0x4')],'include':[{'model':'Condition','as':_0x537c('0x5'),'attributes':['id','field',_0x537c('0x6'),_0x537c('0x7')]},{'model':'Condition','as':_0x537c('0x8'),'attributes':['id',_0x537c('0x9'),'operator',_0x537c('0x7')]},{'model':'Action','as':_0x537c('0xa'),'attributes':['id',_0x537c('0xb'),'data1',_0x537c('0xc'),'data3',_0x537c('0xd'),_0x537c('0xe'),_0x537c('0xf'),_0x537c('0x10')]}]},'log':'GetTrigger'});};};
\ No newline at end of file
+var _0x8c54=['value','Actions','data1','data2','data4','data5','data6','getTriggers','Request','GetTrigger','channel','status','Condition','AllConditions','operator','AnyConditions','field'];(function(_0x1da3de,_0x20b92a){var _0x1dd6ea=function(_0x4c632f){while(--_0x4c632f){_0x1da3de['push'](_0x1da3de['shift']());}};_0x1dd6ea(++_0x20b92a);}(_0x8c54,0x16c));var _0x48c5=function(_0x56a6c5,_0xa4a24b){_0x56a6c5=_0x56a6c5-0x0;var _0x9891e3=_0x8c54[_0x56a6c5];return _0x9891e3;};'use strict';var client=require('../client');exports[_0x48c5('0x0')]=function(_0x147071){return function(_0x433881){return client[_0x48c5('0x1')](_0x48c5('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x48c5('0x3'),_0x48c5('0x4')],'include':[{'model':_0x48c5('0x5'),'as':_0x48c5('0x6'),'attributes':['id','field',_0x48c5('0x7'),'value']},{'model':'Condition','as':_0x48c5('0x8'),'attributes':['id',_0x48c5('0x9'),_0x48c5('0x7'),_0x48c5('0xa')]},{'model':'Action','as':_0x48c5('0xb'),'attributes':['id','action',_0x48c5('0xc'),_0x48c5('0xd'),'data3',_0x48c5('0xe'),_0x48c5('0xf'),_0x48c5('0x10'),'data7']}]},'log':_0x48c5('0x2')});};};
\ No newline at end of file
index db678a4..31537c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbce8=['name','defaultuser','../client','getTrunks','Request','GetTrunk'];(function(_0x2a7c2a,_0x37cc9e){var _0x195732=function(_0x4d3902){while(--_0x4d3902){_0x2a7c2a['push'](_0x2a7c2a['shift']());}};_0x195732(++_0x37cc9e);}(_0xbce8,0x1ee));var _0x8bce=function(_0x30abff,_0x5f2c5f){_0x30abff=_0x30abff-0x0;var _0x4c571e=_0xbce8[_0x30abff];return _0x4c571e;};'use strict';var client=require(_0x8bce('0x0'));exports[_0x8bce('0x1')]=function(_0x45e180){return function(_0x54f05e){return client[_0x8bce('0x2')](_0x8bce('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x8bce('0x4'),'registry',_0x8bce('0x5')]},'log':_0x8bce('0x3')});};};
\ No newline at end of file
+var _0x1974=['GetTrunk','registry','defaultuser','Request'];(function(_0x443f79,_0x33e446){var _0x3847e4=function(_0x42fa01){while(--_0x42fa01){_0x443f79['push'](_0x443f79['shift']());}};_0x3847e4(++_0x33e446);}(_0x1974,0x1d3));var _0x4197=function(_0x42d17c,_0x543cf7){_0x42d17c=_0x42d17c-0x0;var _0x1d8842=_0x1974[_0x42d17c];return _0x1d8842;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x39d74e){return function(_0x503ae1){return client[_0x4197('0x0')](_0x4197('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x4197('0x2'),_0x4197('0x3')]},'log':_0x4197('0x1')});};};
\ No newline at end of file
index 3f081d1..0c5881e 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(_0xc1c673,_0x82e154){var _0x3367bd=function(_0x2f2b9e){while(--_0x2f2b9e){_0xc1c673['push'](_0xc1c673['shift']());}};_0x3367bd(++_0x82e154);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'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 _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x4f6dcc,_0xe34077){var _0x101c7d=function(_0x3e8bed){while(--_0x3e8bed){_0x4f6dcc['push'](_0x4f6dcc['shift']());}};_0x101c7d(++_0xe34077);}(_0x34e8,0x12c));var _0x834e=function(_0x1579e6,_0x1ba2e9){_0x1579e6=_0x1579e6-0x0;var _0x1ef5f5=_0x34e8[_0x1579e6];return _0x1ef5f5;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});};
\ No newline at end of file
index e6b1fa5..3ac9535 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf86a=['UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport','update','Request'];(function(_0x5407e0,_0x354130){var _0x2eaf02=function(_0x3504c4){while(--_0x3504c4){_0x5407e0['push'](_0x5407e0['shift']());}};_0x2eaf02(++_0x354130);}(_0xf86a,0xd9));var _0xaf86=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf86a[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xaf86('0x0'));exports[_0xaf86('0x1')]=function(_0x43ab5a){return client['Request'](_0xaf86('0x2'),{'body':_0x43ab5a,'log':_0xaf86('0x2')});};exports[_0xaf86('0x3')]=function(_0x3f29b4,_0x27d833,_0x49e7c5){return client[_0xaf86('0x4')](_0xaf86('0x5'),{'body':_0x3f29b4,'options':{'where':{'uniqueid':_0x27d833,'interface':_0x49e7c5,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
+var _0x2956=['create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport','../client'];(function(_0x5aed04,_0x218f3d){var _0x5826f1=function(_0x5411e3){while(--_0x5411e3){_0x5aed04['push'](_0x5aed04['shift']());}};_0x5826f1(++_0x218f3d);}(_0x2956,0x191));var _0x6295=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x2956[_0x4e9628];return _0x27bc8c;};'use strict';var client=require(_0x6295('0x0'));exports[_0x6295('0x1')]=function(_0x3d40f7){return client['Request'](_0x6295('0x2'),{'body':_0x3d40f7,'log':_0x6295('0x2')});};exports[_0x6295('0x3')]=function(_0x3178ce,_0x2a6ebf,_0x12a4d8){return client[_0x6295('0x4')](_0x6295('0x5'),{'body':_0x3178ce,'options':{'where':{'uniqueid':_0x2a6ebf,'interface':_0x12a4d8,'agentcomplete':!![]}},'log':_0x6295('0x5')});};
\ No newline at end of file
index e8ef003..f9faa2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x725e=['create','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client'];(function(_0x590c6e,_0x400ccb){var _0x1a93e3=function(_0x39a84e){while(--_0x39a84e){_0x590c6e['push'](_0x590c6e['shift']());}};_0x1a93e3(++_0x400ccb);}(_0x725e,0xf9));var _0xe725=function(_0x2a7a93,_0x5512c8){_0x2a7a93=_0x2a7a93-0x0;var _0x5e5a97=_0x725e[_0x2a7a93];return _0x5e5a97;};'use strict';var moment=require(_0xe725('0x0'));var util=require(_0xe725('0x1'));var _=require(_0xe725('0x2'));var client=require(_0xe725('0x3'));exports[_0xe725('0x4')]=function(_0x38dd8a){return client[_0xe725('0x5')](_0xe725('0x6'),{'body':_[_0xe725('0x7')](_0x38dd8a,{'source':_0x38dd8a[_0xe725('0x8')],'destinationcontext':_0x38dd8a['context'],'callerid':_0x38dd8a[_0xe725('0x9')],'amaflags':_0xe725('0xa')}),'log':'CreateVoiceCallReport'});};exports[_0xe725('0xb')]=function(){return function(){return client[_0xe725('0x5')]('GetVoiceCallReport',{'options':{'where':{'type':[_0xe725('0xc')],'createdAt':{'$between':[moment()[_0xe725('0xd')](_0xe725('0xe'))[_0xe725('0xf')](_0xe725('0x10')),moment()[_0xe725('0x11')](_0xe725('0xe'))[_0xe725('0xf')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xe725('0x12'),_0xe725('0x13'),_0xe725('0x14'),_0xe725('0x15')]},'log':_0xe725('0x16')});};};
\ No newline at end of file
+var _0x2b66=['outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','merge','calleridnum','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','Request'];(function(_0x21d4fa,_0x443586){var _0x5799a1=function(_0x3a65a4){while(--_0x3a65a4){_0x21d4fa['push'](_0x21d4fa['shift']());}};_0x5799a1(++_0x443586);}(_0x2b66,0x108));var _0x62b6=function(_0x1c2d28,_0x27f2c6){_0x1c2d28=_0x1c2d28-0x0;var _0x5606b2=_0x2b66[_0x1c2d28];return _0x5606b2;};'use strict';var moment=require(_0x62b6('0x0'));var util=require(_0x62b6('0x1'));var _=require(_0x62b6('0x2'));var client=require(_0x62b6('0x3'));exports[_0x62b6('0x4')]=function(_0x145bcd){return client['Request']('CreateVoiceCallReport',{'body':_[_0x62b6('0x5')](_0x145bcd,{'source':_0x145bcd[_0x62b6('0x6')],'destinationcontext':_0x145bcd['context'],'callerid':_0x145bcd[_0x62b6('0x7')],'amaflags':_0x62b6('0x8')}),'log':_0x62b6('0x9')});};exports[_0x62b6('0xa')]=function(){return function(){return client[_0x62b6('0xb')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x62b6('0xc')],'createdAt':{'$between':[moment()[_0x62b6('0xd')](_0x62b6('0xe'))[_0x62b6('0xf')](_0x62b6('0x10')),moment()[_0x62b6('0x11')](_0x62b6('0xe'))[_0x62b6('0xf')](_0x62b6('0x10'))]}},'attributes':[_0x62b6('0x12'),_0x62b6('0x13'),_0x62b6('0x14'),_0x62b6('0x15')]},'log':_0x62b6('0x16')});};};
\ No newline at end of file
index 94a9e8a..fcdfcf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80aa=['../client','create','Request','CreateVoiceDialReport'];(function(_0x169127,_0x424a28){var _0x298c62=function(_0x4abbd0){while(--_0x4abbd0){_0x169127['push'](_0x169127['shift']());}};_0x298c62(++_0x424a28);}(_0x80aa,0x64));var _0xa80a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x80aa[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xa80a('0x0'));exports[_0xa80a('0x1')]=function(_0x3cbb30){return client[_0xa80a('0x2')](_0xa80a('0x3'),{'body':_0x3cbb30,'log':_0xa80a('0x3')});};
\ No newline at end of file
+var _0xbf18=['CreateVoiceDialReport','../client','create','Request'];(function(_0x5ca72f,_0xccbe4e){var _0x406089=function(_0x3589d8){while(--_0x3589d8){_0x5ca72f['push'](_0x5ca72f['shift']());}};_0x406089(++_0xccbe4e);}(_0xbf18,0x119));var _0x8bf1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf18[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x8bf1('0x0'));exports[_0x8bf1('0x1')]=function(_0x42d9a4){return client[_0x8bf1('0x2')](_0x8bf1('0x3'),{'body':_0x42d9a4,'log':_0x8bf1('0x3')});};
\ No newline at end of file
index 2211cdd..5a94d1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefe3=['getVoiceExtensions','../client','exten','recordingFormat'];(function(_0x3620be,_0x1cca8b){var _0x13733e=function(_0x5ebb3a){while(--_0x5ebb3a){_0x3620be['push'](_0x3620be['shift']());}};_0x13733e(++_0x1cca8b);}(_0xefe3,0xf5));var _0x3efe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xefe3[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x3efe('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x3efe('0x1'),_0x3efe('0x2')],'where':{'VoiceExtensionId':null}},'log':_0x3efe('0x3')});};};
\ No newline at end of file
+var _0xffaa=['../client','getVoiceExtensions','Request','recordingFormat'];(function(_0x6e8e13,_0x4733e3){var _0x3ca77a=function(_0x5978a7){while(--_0x5978a7){_0x6e8e13['push'](_0x6e8e13['shift']());}};_0x3ca77a(++_0x4733e3);}(_0xffaa,0x130));var _0xaffa=function(_0x14d7e0,_0x5be4df){_0x14d7e0=_0x14d7e0-0x0;var _0x18730c=_0xffaa[_0x14d7e0];return _0x18730c;};'use strict';var client=require(_0xaffa('0x0'));exports[_0xaffa('0x1')]=function(){return function(){return client[_0xaffa('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten',_0xaffa('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xaffa('0x1')});};};
\ No newline at end of file
index 66577c9..317dd61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4936=['dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x4936,0x1d2));var _0x6493=function(_0x2a8da7,_0x84b943){_0x2a8da7=_0x2a8da7-0x0;var _0x3263a0=_0x4936[_0x2a8da7];return _0x3263a0;};'use strict';var client=require(_0x6493('0x0'));exports[_0x6493('0x1')]=function(){return function(){return client[_0x6493('0x2')](_0x6493('0x3'),{'options':{'raw':![],'attributes':['id',_0x6493('0x4'),'acw',_0x6493('0x5'),_0x6493('0x6'),_0x6493('0x7'),'type',_0x6493('0x8'),'dialMethod',_0x6493('0x9'),_0x6493('0xa'),_0x6493('0xb'),'dialPredictiveOptimization',_0x6493('0xc'),_0x6493('0xd'),_0x6493('0xe'),_0x6493('0xf'),_0x6493('0x10'),_0x6493('0x11'),_0x6493('0x12'),_0x6493('0x13'),_0x6493('0x14'),'dialCongestionRetryFrequency',_0x6493('0x15'),'dialBusyRetryFrequency',_0x6493('0x16'),_0x6493('0x17'),'dialGlobalMaxRetry',_0x6493('0x18'),_0x6493('0x19'),_0x6493('0x1a'),'dialCheckDuplicateType',_0x6493('0x1b'),_0x6493('0x1c'),_0x6493('0x1d'),_0x6493('0x1e'),_0x6493('0x1f'),'dialAMDMinWordLength',_0x6493('0x20'),'dialAMDMaximumNumberOfWords',_0x6493('0x21'),'dialAMDMaximumWordLength',_0x6493('0x22'),_0x6493('0x23'),_0x6493('0x24'),'dialOrderByScheduledAt',_0x6493('0x25'),_0x6493('0x26'),_0x6493('0x27'),_0x6493('0x7'),_0x6493('0x28'),_0x6493('0x29'),'dialCutDigit',_0x6493('0x2a'),_0x6493('0x2b'),_0x6493('0x2c'),'dialDropRetryFrequency',_0x6493('0x2d'),_0x6493('0x2e'),_0x6493('0x2f'),_0x6493('0x30'),'dialAgentRejectMaxRetry',_0x6493('0x31'),_0x6493('0x32'),_0x6493('0x33'),_0x6493('0x34'),_0x6493('0x35'),_0x6493('0x36'),'callAdditionalPhoneAfterMin'],'include':[{'model':_0x6493('0x37'),'as':_0x6493('0x37'),'attributes':['id',_0x6493('0x4'),'callerid',_0x6493('0x38')]},{'model':_0x6493('0x39'),'as':_0x6493('0x3a'),'attributes':['id','name']},{'model':'Trunk','as':_0x6493('0x3b'),'attributes':['id','name',_0x6493('0x3c'),'active']},{'model':'Interval','as':_0x6493('0x3d'),'attributes':['id',_0x6493('0x4')],'include':[{'model':_0x6493('0x3d'),'as':_0x6493('0x3e'),'attributes':['id','name',_0x6493('0x3f')]}]}]},'log':_0x6493('0x1')});};};
\ No newline at end of file
+var _0x3bc7=['dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','Interval','interval','../client','getVoiceQueues','Request','name','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDSilenceThreshold','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x2db29c,_0xdfad2c){var _0x54a99c=function(_0x4ddcf0){while(--_0x4ddcf0){_0x2db29c['push'](_0x2db29c['shift']());}};_0x54a99c(++_0xdfad2c);}(_0x3bc7,0x1c1));var _0x73bc=function(_0x585caa,_0x11f787){_0x585caa=_0x585caa-0x0;var _0x92c2df=_0x3bc7[_0x585caa];return _0x92c2df;};'use strict';var client=require(_0x73bc('0x0'));exports[_0x73bc('0x1')]=function(){return function(){return client[_0x73bc('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x73bc('0x3'),'acw',_0x73bc('0x4'),_0x73bc('0x5'),_0x73bc('0x6'),_0x73bc('0x7'),'dialActive',_0x73bc('0x8'),_0x73bc('0x9'),_0x73bc('0xa'),_0x73bc('0xb'),'dialPredictiveOptimization',_0x73bc('0xc'),'dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x73bc('0xd'),_0x73bc('0xe'),_0x73bc('0xf'),_0x73bc('0x10'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x73bc('0x11'),_0x73bc('0x12'),_0x73bc('0x13'),'dialNoAnswerRetryFrequency',_0x73bc('0x14'),_0x73bc('0x15'),_0x73bc('0x16'),_0x73bc('0x17'),_0x73bc('0x18'),_0x73bc('0x19'),'dialAMDInitialSilence',_0x73bc('0x1a'),_0x73bc('0x1b'),_0x73bc('0x1c'),_0x73bc('0x1d'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0x73bc('0x1e'),'dialAMDMaximumWordLength','timeout','dialRecallMeTimeout',_0x73bc('0x1f'),_0x73bc('0x20'),_0x73bc('0x21'),'dialAgiAfterHangupClient','dialQueueProject2',_0x73bc('0x6'),_0x73bc('0x22'),_0x73bc('0x23'),_0x73bc('0x24'),_0x73bc('0x25'),_0x73bc('0x26'),_0x73bc('0x27'),_0x73bc('0x28'),_0x73bc('0x29'),'dialAbandonedRetryFrequency',_0x73bc('0x2a'),'dialMachineRetryFrequency',_0x73bc('0x2b'),_0x73bc('0x2c'),'mandatoryDisposition','dialPredictiveIntervalMaxThreshold',_0x73bc('0x2d'),_0x73bc('0x2e'),_0x73bc('0x2f'),'callAdditionalPhoneAfterMin'],'include':[{'model':_0x73bc('0x30'),'as':'Trunk','attributes':['id',_0x73bc('0x3'),_0x73bc('0x31'),_0x73bc('0x32')]},{'model':_0x73bc('0x33'),'as':'mandatoryDispositionPause','attributes':['id',_0x73bc('0x3')]},{'model':_0x73bc('0x30'),'as':'TrunkBackup','attributes':['id',_0x73bc('0x3'),'callerid',_0x73bc('0x32')]},{'model':_0x73bc('0x34'),'as':_0x73bc('0x34'),'attributes':['id',_0x73bc('0x3')],'include':[{'model':_0x73bc('0x34'),'as':'Intervals','attributes':['id',_0x73bc('0x3'),_0x73bc('0x35')]}]}]},'log':_0x73bc('0x1')});};};
\ No newline at end of file
index 571492c..e28259c 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(_0x246a74,_0x4795bf){var _0x5ca7c3=function(_0x31bdb3){while(--_0x31bdb3){_0x246a74['push'](_0x246a74['shift']());}};_0x5ca7c3(++_0x4795bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
+var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x5cdcdd,_0x484acc){var _0x2f21c3=function(_0x1b259d){while(--_0x1b259d){_0x5cdcdd['push'](_0x5cdcdd['shift']());}};_0x2f21c3(++_0x484acc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 c05a789..ea02a1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc59b=['getVoiceQueueRtPauses','../client','Request','GetVoiceQueueRtPauses'];(function(_0x52e87c,_0x286b91){var _0x12ccbc=function(_0x7eab32){while(--_0x7eab32){_0x52e87c['push'](_0x52e87c['shift']());}};_0x12ccbc(++_0x286b91);}(_0xc59b,0x1a9));var _0xbc59=function(_0x6b9bd8,_0x2b18b1){_0x6b9bd8=_0x6b9bd8-0x0;var _0x5763f4=_0xc59b[_0x6b9bd8];return _0x5763f4;};'use strict';var client=require(_0xbc59('0x0'));exports['getVoiceQueueRtPauses']=function(_0x3e80b5){return function(){return client[_0xbc59('0x1')](_0xbc59('0x2'),{'options':{'where':{'VoiceQueueId':_0x3e80b5,'paused':!![]},'raw':!![]},'log':_0xbc59('0x3')});};};
\ No newline at end of file
+var _0x45af=['getVoiceQueueRtPauses','Request'];(function(_0x3cfe5e,_0x53bd47){var _0x3535cf=function(_0x2cba14){while(--_0x2cba14){_0x3cfe5e['push'](_0x3cfe5e['shift']());}};_0x3535cf(++_0x53bd47);}(_0x45af,0xc6));var _0xf45a=function(_0x2a691e,_0x22085d){_0x2a691e=_0x2a691e-0x0;var _0x332325=_0x45af[_0x2a691e];return _0x332325;};'use strict';var client=require('../client');exports[_0xf45a('0x0')]=function(_0x581985){return function(){return client[_0xf45a('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x581985,'paused':!![]},'raw':!![]},'log':_0xf45a('0x0')});};};
\ No newline at end of file
index b5b492c..4a4a0b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x590bd3,_0x3dff61){var _0x1294f7=function(_0x538e5a){while(--_0x538e5a){_0x590bd3['push'](_0x590bd3['shift']());}};_0x1294f7(++_0x3dff61);}(_0x7a54,0x106));var _0x47a5=function(_0x28c189,_0x21ed8a){_0x28c189=_0x28c189-0x0;var _0x1f8de1=_0x7a54[_0x28c189];return _0x1f8de1;};'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(_0x1d1def,_0xb96925){var _0x5c3505=function(_0x2adf15){while(--_0x2adf15){_0x1d1def['push'](_0x1d1def['shift']());}};_0x5c3505(++_0xb96925);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
index 9d03caa..5319d47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0198=['transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','isexternal','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','../client','transfers','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereecalleridnum','transfereecalleridname'];(function(_0x54b7d0,_0x299625){var _0x5e7900=function(_0x542b74){while(--_0x542b74){_0x54b7d0['push'](_0x54b7d0['shift']());}};_0x5e7900(++_0x299625);}(_0x0198,0x1ae));var _0x8019=function(_0x16bb4b,_0x5fe431){_0x16bb4b=_0x16bb4b-0x0;var _0x8aeb84=_0x0198[_0x16bb4b];return _0x8aeb84;};'use strict';var client=require(_0x8019('0x0'));exports[_0x8019('0x1')]={};exports['blindTransfer']=function(_0x51de23){return client[_0x8019('0x2')](_0x8019('0x3'),{'body':{'result':_0x51de23[_0x8019('0x4')],'transfererchannel':_0x51de23['transfererchannel'],'transferercalleridnum':_0x51de23[_0x8019('0x5')],'transferercalleridname':_0x51de23[_0x8019('0x6')],'transfererconnectedlinenum':_0x51de23[_0x8019('0x7')],'transfererconnectedlinename':_0x51de23[_0x8019('0x8')],'transfereraccountcode':_0x51de23[_0x8019('0x9')],'transferercontext':_0x51de23[_0x8019('0xa')],'transfererexten':_0x51de23['transfererexten'],'transfererlinkedid':_0x51de23[_0x8019('0xb')],'transfereechannel':_0x51de23['transfereechannel'],'transfereecalleridnum':_0x51de23[_0x8019('0xc')],'transfereecalleridname':_0x51de23[_0x8019('0xd')],'transfereeconnectedlinenum':_0x51de23['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x51de23[_0x8019('0xe')],'transfereeaccountcode':_0x51de23['transfereeaccountcode'],'transfereecontext':_0x51de23[_0x8019('0xf')],'transfereeexten':_0x51de23[_0x8019('0x10')],'transfereelinkedid':_0x51de23[_0x8019('0x11')],'isexternal':_0x51de23[_0x8019('0x12')],'context':_0x51de23['context'],'extension':_0x51de23['extension'],'type':_0x8019('0x13')},'log':_0x8019('0x3')});};exports[_0x8019('0x14')]=function(_0x564cce){return client[_0x8019('0x2')](_0x8019('0x3'),{'body':{'result':_0x564cce['result'],'transfererchannel':_0x564cce[_0x8019('0x15')],'transferercalleridnum':_0x564cce[_0x8019('0x16')],'transferercalleridname':_0x564cce[_0x8019('0x17')],'transfererconnectedlinenum':_0x564cce['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x564cce[_0x8019('0x18')],'transfereraccountcode':_0x564cce[_0x8019('0x19')],'transferercontext':_0x564cce[_0x8019('0x1a')],'transfererexten':_0x564cce[_0x8019('0x1b')],'transfererlinkedid':_0x564cce[_0x8019('0x1c')],'transfereechannel':_0x564cce[_0x8019('0x1d')],'transfereecalleridnum':_0x564cce[_0x8019('0x1e')],'transfereecalleridname':_0x564cce['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x564cce[_0x8019('0x1f')],'transfereeconnectedlinename':_0x564cce[_0x8019('0x20')],'transfereeaccountcode':_0x564cce[_0x8019('0x21')],'transfereecontext':_0x564cce['transfertargetcontext'],'transfereeexten':_0x564cce[_0x8019('0x22')],'transfereelinkedid':_0x564cce[_0x8019('0x23')],'isexternal':_0x564cce[_0x8019('0x12')],'context':_0x564cce[_0x8019('0x24')],'extension':_0x564cce['origtransfererexten'],'type':'attended'},'log':_0x8019('0x3')});};
\ No newline at end of file
+var _0x2abd=['transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetcalleridnum'];(function(_0x201c9f,_0x7dfbcd){var _0x29c025=function(_0x4914b2){while(--_0x4914b2){_0x201c9f['push'](_0x201c9f['shift']());}};_0x29c025(++_0x7dfbcd);}(_0x2abd,0x9f));var _0xd2ab=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2abd[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports[_0xd2ab('0x0')]={};exports[_0xd2ab('0x1')]=function(_0x47cbb9){return client[_0xd2ab('0x2')](_0xd2ab('0x3'),{'body':{'result':_0x47cbb9[_0xd2ab('0x4')],'transfererchannel':_0x47cbb9[_0xd2ab('0x5')],'transferercalleridnum':_0x47cbb9[_0xd2ab('0x6')],'transferercalleridname':_0x47cbb9[_0xd2ab('0x7')],'transfererconnectedlinenum':_0x47cbb9[_0xd2ab('0x8')],'transfererconnectedlinename':_0x47cbb9[_0xd2ab('0x9')],'transfereraccountcode':_0x47cbb9[_0xd2ab('0xa')],'transferercontext':_0x47cbb9['transferercontext'],'transfererexten':_0x47cbb9[_0xd2ab('0xb')],'transfererlinkedid':_0x47cbb9[_0xd2ab('0xc')],'transfereechannel':_0x47cbb9[_0xd2ab('0xd')],'transfereecalleridnum':_0x47cbb9['transfereecalleridnum'],'transfereecalleridname':_0x47cbb9['transfereecalleridname'],'transfereeconnectedlinenum':_0x47cbb9[_0xd2ab('0xe')],'transfereeconnectedlinename':_0x47cbb9['transfereeconnectedlinename'],'transfereeaccountcode':_0x47cbb9[_0xd2ab('0xf')],'transfereecontext':_0x47cbb9[_0xd2ab('0x10')],'transfereeexten':_0x47cbb9[_0xd2ab('0x11')],'transfereelinkedid':_0x47cbb9[_0xd2ab('0x12')],'isexternal':_0x47cbb9[_0xd2ab('0x13')],'context':_0x47cbb9[_0xd2ab('0x14')],'extension':_0x47cbb9[_0xd2ab('0x15')],'type':_0xd2ab('0x16')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x21b7b7){return client[_0xd2ab('0x2')](_0xd2ab('0x3'),{'body':{'result':_0x21b7b7[_0xd2ab('0x4')],'transfererchannel':_0x21b7b7[_0xd2ab('0x17')],'transferercalleridnum':_0x21b7b7[_0xd2ab('0x18')],'transferercalleridname':_0x21b7b7['origtransferercalleridname'],'transfererconnectedlinenum':_0x21b7b7[_0xd2ab('0x19')],'transfererconnectedlinename':_0x21b7b7[_0xd2ab('0x1a')],'transfereraccountcode':_0x21b7b7[_0xd2ab('0x1b')],'transferercontext':_0x21b7b7[_0xd2ab('0x1c')],'transfererexten':_0x21b7b7[_0xd2ab('0x1d')],'transfererlinkedid':_0x21b7b7['origtransfererlinkedid'],'transfereechannel':_0x21b7b7['transfertargetchannel'],'transfereecalleridnum':_0x21b7b7[_0xd2ab('0x1e')],'transfereecalleridname':_0x21b7b7['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x21b7b7['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x21b7b7['transfertargetconnectedlinename'],'transfereeaccountcode':_0x21b7b7[_0xd2ab('0x1f')],'transfereecontext':_0x21b7b7[_0xd2ab('0x20')],'transfereeexten':_0x21b7b7[_0xd2ab('0x21')],'transfereelinkedid':_0x21b7b7[_0xd2ab('0x22')],'isexternal':_0x21b7b7[_0xd2ab('0x13')],'context':_0x21b7b7[_0xd2ab('0x23')],'extension':_0x21b7b7[_0xd2ab('0x24')],'type':_0xd2ab('0x25')},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
index 1b69e2c..b3030a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc21e=['uniqueid','channel','filename','MixMonitor','ai(mixmonitorid)','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','push','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','map','destinationchannel','StopMixMonitor','status','stop','%s.%s','wav','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','Hangup','Redirect','exten','context','telephones','trunks','campaigns','run','event','Event\x20name\x20mandatory','emit','faxAccounts','send','checkAfterSend','server','http','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../ami','listen','format','%s/%s','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','then','message','catch','Command','Action','content','voiceQueues','strategy','answered','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','omit','undefined','values','channels'];(function(_0x22fd4d,_0x203d8f){var _0x860174=function(_0x41699a){while(--_0x41699a){_0x22fd4d['push'](_0x22fd4d['shift']());}};_0x860174(++_0x203d8f);}(_0xc21e,0x1ca));var _0xec21=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc21e[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0xec21('0x0'));var jayson=require(_0xec21('0x1'));var schema=require(_0xec21('0x2'));var BPromise=require(_0xec21('0x3'));var moment=require(_0xec21('0x4'));var config=require(_0xec21('0x5'));var properties=require('../properties');var ami=require(_0xec21('0x6'));exports[_0xec21('0x7')]=function(_0x10351e,_0xd94b5d,_0x7fce38){return new BPromise(function(_0x15699b,_0x406b66){var _0x2f15e7={'QueuePause':function(_0x51f6dc){return new Promise(function(_0x2b1396,_0x3d74a2){var _0x42090f=util[_0xec21('0x8')](_0xec21('0x9'),'SIP',_0x51f6dc[_0xec21('0xa')]);if(_0x10351e[_0xec21('0xb')]&&_0x10351e[_0xec21('0xb')][_0x42090f]&&_0x10351e['timers'][_0x42090f]['timer']){_0x10351e[_0xec21('0xb')][_0x42090f][_0xec21('0xc')]();}if(_0x10351e['agents'][_0x42090f]){_0x10351e[_0xec21('0xd')][_0x42090f][_0xec21('0xe')]({'statePause':_0x51f6dc[_0xec21('0xf')]?!![]:![]});}_0x2b1396({'code':0xc8,'message':_0xec21('0x10')});});},'Reload':function(_0xc1cca0){var _0x5ee9f6=this;return new Promise(function(_0x179b89,_0x55e74e){if(ami[_0xec21('0x11')]()==![]){return _0x55e74e(_0x5ee9f6[_0xec21('0x12')](0x1f4,[config[_0xec21('0x13')]['ip'],config['asterisk'][_0xec21('0x14')],_0xec21('0x15')][_0xec21('0x16')]('\x20')));}_0xc1cca0=_[_0xec21('0x17')](_0xc1cca0,_[_0xec21('0x18')](properties[_0xec21('0x19')]));_0xc1cca0[_0xec21('0x1a')]=_0xec21('0x1b');return ami['Action'](_0xc1cca0)[_0xec21('0x1c')](function(_0x2f805b){_0x179b89({'code':0xc8,'message':_0x2f805b[_0xec21('0x1d')]});})[_0xec21('0x1e')](function(_0x3ab226){_0x55e74e(_0x5ee9f6[_0xec21('0x12')](0x1f5,_0x3ab226[_0xec21('0x1d')]));});});},'Command':function(_0x2aff55){var _0x3c790e=this;return new Promise(function(_0x350443,_0x4f4b12){if(ami['isConnected']()==![]){return _0x4f4b12(_0x3c790e[_0xec21('0x12')](0x1f4,[config[_0xec21('0x13')]['ip'],config['asterisk']['username'],_0xec21('0x15')][_0xec21('0x16')]('\x20')));}_0x2aff55=_[_0xec21('0x17')](_0x2aff55,'command');_0x2aff55[_0xec21('0x1a')]=_0xec21('0x1f');return ami[_0xec21('0x20')](_0x2aff55)['then'](function(_0x20ede9){_0x350443({'code':0xc8,'message':_0x20ede9[_0xec21('0x21')]});})[_0xec21('0x1e')](function(_0x46fd9e){_0x4f4b12(_0x3c790e[_0xec21('0x12')](0x1f5,_0x46fd9e[_0xec21('0x1d')]));});});},'VoiceQueues':function(_0x5692b0){return new Promise(function(_0x3563dc,_0x26cdae){var _0x4cd699=[];for(var _0x19b556 in _0x10351e['voiceQueues']){if(_0x10351e[_0xec21('0x22')]['hasOwnProperty'](_0x19b556)){var _0x4ef840=_0x10351e[_0xec21('0x22')][_0x19b556];var _0x199974={'id':_0x4ef840['id'],'name':_0x4ef840[_0xec21('0xa')],'strategy':_0x4ef840[_0xec21('0x23')],'answered':_0x4ef840[_0xec21('0x24')],'available':_0x4ef840['available'],'loggedIn':_0x4ef840[_0xec21('0x25')],'pTalking':_0x4ef840['pTalking'],'sumBillable':_0x4ef840[_0xec21('0x26')],'sumDuration':_0x4ef840[_0xec21('0x27')],'sumHoldTime':_0x4ef840[_0xec21('0x28')]||0x0,'talking':_0x4ef840[_0xec21('0x29')],'total':_0x4ef840['total'],'type':_0x4ef840[_0xec21('0x2a')],'unmanaged':_0x4ef840[_0xec21('0x2b')],'abandoned':_0x4ef840[_0xec21('0x2c')],'waiting':_0x4ef840[_0xec21('0x2d')],'loggedInDb':_0x4ef840[_0xec21('0x2e')]};if(_0x4ef840[_0xec21('0x2a')]===_0xec21('0x2f')){_0x199974[_0xec21('0x30')]=_0x4ef840[_0xec21('0x30')];_0x199974[_0xec21('0x31')]=_0x4ef840[_0xec21('0x31')];_0x199974['dialOriginateCallerIdName']=_0x4ef840[_0xec21('0x32')];_0x199974[_0xec21('0x33')]=_0x4ef840[_0xec21('0x33')];_0x199974[_0xec21('0x34')]=_0x4ef840[_0xec21('0x34')];_0x199974['dialPrefix']=_0x4ef840[_0xec21('0x35')];_0x199974['temp']=_0x4ef840['temp'];_0x199974['outboundAnswerAgiCallsDay']=_0x4ef840[_0xec21('0x36')];_0x199974[_0xec21('0x37')]=_0x4ef840[_0xec21('0x37')];_0x199974[_0xec21('0x38')]=_0x4ef840[_0xec21('0x38')];_0x199974[_0xec21('0x39')]=_0x4ef840[_0xec21('0x39')];_0x199974[_0xec21('0x3a')]=_0x4ef840[_0xec21('0x3a')];_0x199974[_0xec21('0x3b')]=_0x4ef840[_0xec21('0x3b')];_0x199974[_0xec21('0x3c')]=_0x4ef840['outboundDropCallsDayCallersExit'];_0x199974[_0xec21('0x3d')]=_0x4ef840[_0xec21('0x3d')];_0x199974['outboundNoAnswerCallsDay']=_0x4ef840[_0xec21('0x3e')];_0x199974['outboundNoSuchCallsDay']=_0x4ef840['outboundNoSuchCallsDay'];_0x199974[_0xec21('0x3f')]=_0x4ef840['outboundOriginateFailureCallsDay'];_0x199974[_0xec21('0x40')]=_0x4ef840['outboundReCallsDay'];_0x199974[_0xec21('0x41')]=_0x4ef840[_0xec21('0x41')];_0x199974['outboundUnknownCallsDay']=_0x4ef840[_0xec21('0x42')];_0x199974[_0xec21('0x43')]=_0x4ef840[_0xec21('0x43')];_0x199974['predictiveIntervalAvgHoldtime']=_0x4ef840[_0xec21('0x44')];_0x199974[_0xec21('0x45')]=_0x4ef840[_0xec21('0x45')];_0x199974['predictiveIntervalDroppedCallsCallersExit']=_0x4ef840[_0xec21('0x46')];_0x199974[_0xec21('0x47')]=_0x4ef840[_0xec21('0x47')];_0x199974[_0xec21('0x48')]=_0x4ef840[_0xec21('0x48')];_0x199974['predictiveIntervalErlangCallsDroppedCalls']=_0x4ef840[_0xec21('0x49')];_0x199974[_0xec21('0x4a')]=_0x4ef840['predictiveIntervalHitRate'];_0x199974[_0xec21('0x4b')]=_0x4ef840['predictiveIntervalMultiplicativeFactor'];_0x199974[_0xec21('0x4c')]=_0x4ef840[_0xec21('0x4c')];_0x199974[_0xec21('0x4d')]=_0x4ef840['predictiveIntervalAvailable'];_0x199974[_0xec21('0x4e')]=_0x4ef840[_0xec21('0x4e')];_0x199974[_0xec21('0x1d')]=_0x4ef840[_0xec21('0x1d')];_0x199974['originated']=_0x4ef840['originated'];_0x199974[_0xec21('0x4f')]=_0x4ef840['erlangCalls'];_0x199974[_0xec21('0x50')]=_0x4ef840['erlangCallToSecond'];_0x199974[_0xec21('0x51')]=_0x4ef840['erlangAbandonmentRate'];_0x199974[_0xec21('0x52')]=_0x4ef840[_0xec21('0x52')];_0x199974['startPredictive']=_0x4ef840[_0xec21('0x53')];_0x199974[_0xec21('0x54')]=_0x4ef840['startProgressive'];}if(_0x4ef840[_0xec21('0x55')]){_0x199974[_0xec21('0x55')]={'id':_0x4ef840[_0xec21('0x55')]['id'],'name':_0x4ef840[_0xec21('0x55')][_0xec21('0xa')],'active':_0x4ef840[_0xec21('0x55')][_0xec21('0x56')],'callerid':_0x4ef840[_0xec21('0x55')][_0xec21('0x57')]};}if(_0x4ef840['Interval']){_0x199974['Interval']={'id':_0x4ef840[_0xec21('0x58')]['id'],'name':_0x4ef840[_0xec21('0x58')][_0xec21('0xa')]};}_0x4cd699['push'](_0x199974);}}_0x3563dc({'count':_0x4cd699[_0xec21('0x59')],'rows':_0x4cd699});});},'UpdateVoiceQueue':function(_0x3ded8d){return new Promise(function(_0x220648,_0x555d95){var _0x497af0=_['find'](_0x10351e[_0xec21('0x22')],{'id':parseInt(_0x3ded8d['id'])});var _0x1b518a=_[_0xec21('0x5a')](_0x3ded8d,['id']);if(_0x497af0){for(var _0x414a60 in _0x1b518a){if(typeof _0x1b518a[_0x414a60]!==_0xec21('0x5b')&&typeof _0x497af0[_0x414a60]!==_0xec21('0x5b')){_0x497af0[_0x414a60]=_0x1b518a[_0x414a60];}}_0x220648(_0x497af0);}else{_0x555d95();}});},'VoiceChannels':function(_0x25c2c8){return new Promise(function(_0x4cc15c,_0x1f9ace){var _0x21fe90=_[_0xec21('0x5c')](_0x10351e[_0xec21('0x5d')]);_0x4cc15c({'count':_0x21fe90[_0xec21('0x59')],'rows':_0x21fe90});});},'VoiceChannelMixMonitor':function(_0xf1216b){var _0x14f55e=this;return new Promise(function(_0x309c9b,_0x58cd1f){if(ami[_0xec21('0x11')]()==![]){return _0x58cd1f(_0x14f55e[_0xec21('0x12')](0x1f4,[config[_0xec21('0x13')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0xec21('0x16')]('\x20')));}var _0x1bf6a3=schema(properties['voicechannel'])[_0xec21('0x2')](_0xf1216b);if(_0x1bf6a3[_0xec21('0x59')]>0x0){return _0x58cd1f(_0x14f55e[_0xec21('0x12')](0x1f4,_['map'](_0x1bf6a3,_0xec21('0x1d'))['join'](',\x20')));}var _0x102f68=_['find'](_0x10351e[_0xec21('0x5d')],{'uniqueid':_0xf1216b[_0xec21('0x5e')]});if(_0x102f68&&_0x102f68[_0xec21('0x5f')]){var _0x11d96e=util[_0xec21('0x8')]('%s.%s',_0xf1216b[_0xec21('0x60')]||_0xf1216b['uniqueid'],_0xf1216b[_0xec21('0x8')]||'wav');return ami[_0xec21('0x20')]({'action':_0xec21('0x61'),'channel':_0x102f68[_0xec21('0x5f')],'file':_0x11d96e,'options':_0xec21('0x62')})[_0xec21('0x1c')](function(_0x32e3e9){var _0x4d692b=_[_0xec21('0x63')](_0x102f68[_0xec21('0x64')],{'filename':_0xec21('0x65')+_0x11d96e[_0xec21('0x66')]()});if(_['isNil'](_0x4d692b)){_0x102f68[_0xec21('0x64')][_0xec21('0x67')]({'filename':_0xec21('0x65')+_0x11d96e['toLowerCase'](),'createdAt':moment()['format'](_0xec21('0x68')),'mixmonitorid':_0x32e3e9['mixmonitorid'],'status':_0xec21('0x69')});}else{_0x4d692b[_0xec21('0x6a')]=_0x32e3e9['mixmonitorid'];_0x4d692b['status']=_0xec21('0x69');}_0x309c9b({'code':0xc8,'message':[_0xf1216b[_0xec21('0x5e')],_0xec21('0x6b'),_0x32e3e9[_0xec21('0x6a')]][_0xec21('0x16')]('\x20'),'mixmonitorid':_0x32e3e9[_0xec21('0x6a')]});})[_0xec21('0x1e')](function(_0x41e4f3){_0x58cd1f(_0x14f55e['error'](0x1f5,[_0xf1216b[_0xec21('0x5e')],_0x41e4f3['message'][_0xec21('0x66')]()]['join']('\x20')));});}else{return _0x58cd1f(_0x14f55e[_0xec21('0x12')](0x1f5,_0xec21('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x39c0a1){var _0x1006c8=this;return new Promise(function(_0xe89b76,_0x527976){if(ami['isConnected']()==![]){return _0x527976(_0x1006c8['error'](0x1f4,[config[_0xec21('0x13')]['ip'],config['asterisk'][_0xec21('0x14')],_0xec21('0x15')][_0xec21('0x16')]('\x20')));}var _0x42d245=schema(properties[_0xec21('0x6d')])[_0xec21('0x2')](_0x39c0a1);if(_0x42d245[_0xec21('0x59')]>0x0){return _0x527976(_0x1006c8[_0xec21('0x12')](0x1f4,_[_0xec21('0x6e')](_0x42d245,'message')[_0xec21('0x16')](',\x20')));}var _0x58e955=_[_0xec21('0x63')](_0x10351e[_0xec21('0x5d')],{'uniqueid':_0x39c0a1[_0xec21('0x5e')]});if(_0x58e955){return BPromise['resolve']()['then'](function(){if(_0x58e955[_0xec21('0x5f')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x58e955[_0xec21('0x5f')],'mixmonitorid':_0x39c0a1[_0xec21('0x6a')]})[_0xec21('0x1e')](function(_0x55ff27){});}})[_0xec21('0x1c')](function(){if(_0x58e955[_0xec21('0x6f')]){return ami[_0xec21('0x20')]({'action':_0xec21('0x70'),'channel':_0x58e955[_0xec21('0x6f')],'mixmonitorid':_0x39c0a1[_0xec21('0x6a')]})['catch'](function(_0x6db048){});}})[_0xec21('0x1c')](function(_0x3a4bd6){var _0x1b6078=_['find'](_0x58e955['monitors'],{'mixmonitorid':_0x39c0a1['mixmonitorid']});if(_0x1b6078){_0x1b6078[_0xec21('0x71')]=_0xec21('0x72');}})[_0xec21('0x1c')](function(){var _0xda541f=util[_0xec21('0x8')](_0xec21('0x73'),_0x39c0a1[_0xec21('0x60')]||_0x39c0a1[_0xec21('0x5e')],_0x39c0a1[_0xec21('0x8')]||_0xec21('0x74'));var _0x1fca8c=_[_0xec21('0x63')](_0x58e955[_0xec21('0x64')],{'filename':_0xec21('0x65')+_0xda541f[_0xec21('0x66')]()});if(_0x1fca8c){_0x1fca8c['status']=_0xec21('0x72');}})[_0xec21('0x1c')](function(){_0xe89b76({'code':0xc8,'message':[_0x39c0a1[_0xec21('0x5e')],_0xec21('0x75')]['join']('\x20')});})['catch'](function(_0x41c442){_0x527976(_0x1006c8[_0xec21('0x12')](0x1f5,[_0x39c0a1[_0xec21('0x5e')],_0x41c442[_0xec21('0x1d')]['toLowerCase']()][_0xec21('0x16')]('\x20')));});}else{return _0x527976(_0x1006c8['error'](0x1f5,_0xec21('0x6c')));}});},'VoiceQueuesChannels':function(_0x5d897e){return new Promise(function(_0x42bc2f,_0x1eec5a){var _0x1d4627=_['values'](_0x10351e['queueChannels']);_0x42bc2f({'count':_0x1d4627[_0xec21('0x59')],'rows':_0x1d4627});});},'VoiceQueuesChannel':function(_0x1b9ca3){var _0x5f1b99=this;return new Promise(function(_0x53a8c2,_0x44619b){var _0x1d7b6c=schema(properties['voicequeuechannel'])['validate'](_0x1b9ca3);if(_0x1d7b6c[_0xec21('0x59')]>0x0){return _0x44619b(_0x5f1b99[_0xec21('0x12')](0x1f4,_['map'](_0x1d7b6c,_0xec21('0x1d'))['join'](',\x20')));}var _0x4c5bb1=_[_0xec21('0x63')](_0x10351e[_0xec21('0x76')],{'uniqueid':_0x1b9ca3['uniqueid']});if(_0x4c5bb1){_0x53a8c2(_0x4c5bb1);}else{return _0x44619b(_0x5f1b99[_0xec21('0x12')](0x1f5,_0xec21('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x55fac0){var _0x352d85=this;return new Promise(function(_0x510d25,_0x5d822f){if(ami[_0xec21('0x11')]()==![]){return _0x5d822f(_0x352d85[_0xec21('0x12')](0x1f4,[config[_0xec21('0x13')]['ip'],config[_0xec21('0x13')][_0xec21('0x14')],_0xec21('0x15')][_0xec21('0x16')]('\x20')));}var _0x21949b=schema(properties[_0xec21('0x77')])['validate'](_0x55fac0);if(_0x21949b[_0xec21('0x59')]>0x0){return _0x5d822f(_0x352d85[_0xec21('0x12')](0x1f4,_['map'](_0x21949b,'message')[_0xec21('0x16')](',\x20')));}var _0x1d314b=_[_0xec21('0x63')](_0x10351e[_0xec21('0x76')],{'uniqueid':_0x55fac0[_0xec21('0x5e')]});if(_0x1d314b&&_0x1d314b[_0xec21('0x5f')]){return ami['Action']({'action':_0xec21('0x78'),'channel':_0x1d314b[_0xec21('0x5f')]})[_0xec21('0x1c')](function(_0x2f1449){_0x510d25({'code':0xc8,'message':[_0x55fac0[_0xec21('0x5e')],_0x2f1449[_0xec21('0x1d')][_0xec21('0x66')]()][_0xec21('0x16')]('\x20')});})[_0xec21('0x1e')](function(_0xe45274){_0x5d822f(_0x352d85[_0xec21('0x12')](0x1f5,[_0x55fac0[_0xec21('0x5e')],_0xe45274[_0xec21('0x1d')][_0xec21('0x66')]()]['join']('\x20')));});}else{return _0x5d822f(_0x352d85[_0xec21('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x405578){var _0xf2227c=this;return new Promise(function(_0x3898e8,_0x4617aa){if(ami[_0xec21('0x11')]()==![]){return _0x4617aa(_0xf2227c[_0xec21('0x12')](0x1f4,[config[_0xec21('0x13')]['ip'],config[_0xec21('0x13')][_0xec21('0x14')],'ami\x20disconnected'][_0xec21('0x16')]('\x20')));}var _0x2280e5=schema(properties['voicequeuechannelredirect'])[_0xec21('0x2')](_0x405578);if(_0x2280e5[_0xec21('0x59')]>0x0){return _0x4617aa(_0xf2227c[_0xec21('0x12')](0x1f4,_[_0xec21('0x6e')](_0x2280e5,_0xec21('0x1d'))[_0xec21('0x16')](',\x20')));}var _0x1109cc=_[_0xec21('0x63')](_0x10351e[_0xec21('0x76')],{'uniqueid':_0x405578[_0xec21('0x5e')]});if(_0x1109cc&&_0x1109cc[_0xec21('0x5f')]){return ami[_0xec21('0x20')]({'action':_0xec21('0x79'),'channel':_0x1109cc[_0xec21('0x5f')],'exten':_0x405578[_0xec21('0x7a')],'context':_0x405578['context']||_0x1109cc[_0xec21('0x7b')],'priority':0x1})[_0xec21('0x1c')](function(_0x137c10){_0x3898e8({'code':0xc8,'message':[_0x405578[_0xec21('0x5e')],_0x137c10[_0xec21('0x1d')][_0xec21('0x66')]()][_0xec21('0x16')]('\x20')});})['catch'](function(_0x2d93b0){_0x4617aa(_0xf2227c[_0xec21('0x12')](0x1f5,[_0x405578[_0xec21('0x5e')],_0x2d93b0[_0xec21('0x1d')]['toLowerCase']()][_0xec21('0x16')]('\x20')));});}else{return _0x4617aa(_0xf2227c['error'](0x1f5,_0xec21('0x6c')));}});},'Agents':function(_0x5c36ca){return new Promise(function(_0x131da5,_0x5b939c){var _0x4b13a3=_[_0xec21('0x5c')](_0x10351e[_0xec21('0xd')]);_0x131da5({'count':_0x4b13a3[_0xec21('0x59')],'rows':_0x4b13a3});});},'Telephones':function(_0xc8c11f){return new Promise(function(_0x2422e5,_0x708e7f){var _0x4dd684=_[_0xec21('0x5c')](_0x10351e[_0xec21('0x7c')]);_0x2422e5({'count':_0x4dd684['length'],'rows':_0x4dd684});});},'Trunks':function(_0x4e4a2f){return new Promise(function(_0x2cbd81,_0xfb706c){var _0x383e70=_['values'](_0x10351e[_0xec21('0x7d')]);_0x2cbd81({'count':_0x383e70[_0xec21('0x59')],'rows':_0x383e70});});},'OutboundChannels':function(_0x496fdc){return new Promise(function(_0x22aef5,_0x229ff5){var _0x12cd7b=_[_0xec21('0x5c')](_0x10351e['outboundChannels']);_0x22aef5({'count':_0x12cd7b[_0xec21('0x59')],'rows':_0x12cd7b});});},'Outbound':function(_0x43674d){return new Promise(function(_0xb3f47b,_0x169296){_0xb3f47b(_0x10351e[_0xec21('0x2f')]);});},'Campaigns':function(_0x512d4d){return new Promise(function(_0x48517e,_0xf409f4){var _0x4d812a=_[_0xec21('0x5c')](_0x10351e[_0xec21('0x7e')]);_0x48517e({'count':_0x4d812a[_0xec21('0x59')],'rows':_0x4d812a});});},'VoiceQueuesPreview':function(_0x1b49de){var _0x46feb7=this;return new Promise(function(_0x23c032,_0x3679d4){_0xd94b5d[_0xec21('0x7f')](_0x1b49de['id'])[_0xec21('0x1c')](function(_0x58491e){_0x23c032({'code':0xc8,'message':_0x58491e[_0xec21('0x1d')]});})[_0xec21('0x1e')](function(_0x4446f9){_0x3679d4(_0x46feb7[_0xec21('0x12')](0x1f4,_0x4446f9[_0xec21('0x1d')]));});});},'EventManager':function(_0x2ed2c7){var _0x408cf3=this;return new Promise(function(_0x48db5c,_0x478f76){if(!_0x2ed2c7[_0xec21('0x80')]){return _0x478f76(_0x408cf3[_0xec21('0x12')](0x1f4,_0xec21('0x81')));}ami[_0xec21('0x82')]('custom:'+_0x2ed2c7[_0xec21('0x80')],_0x2ed2c7[_0xec21('0x1d')]);_0x48db5c({'code':0xc8,'message':_0x2ed2c7});});},'FaxAccounts':function(_0x12389e){return new Promise(function(_0x31a4d3,_0x35e508){var _0x25ecc7=_[_0xec21('0x5c')](_0x10351e[_0xec21('0x83')]);_0x31a4d3({'count':_0x25ecc7['length'],'rows':_0x25ecc7});});},'SendFax':function(_0x384ba9){var _0x331b8b=this;return new Promise(function(_0x14c4fb,_0x33143a){_0x7fce38[_0xec21('0x84')](_0x384ba9)[_0xec21('0x1c')](function(_0x126526){_0x14c4fb({'code':0xc8,'message':_0x126526[_0xec21('0x1d')]});})[_0xec21('0x1e')](function(_0x1b8346){_0x33143a(_0x331b8b[_0xec21('0x12')](0x1f4,_0x1b8346[_0xec21('0x1d')]));});});},'CheckAfterSend':function(_0x494499){var _0x4b5cc4=this;return new Promise(function(_0x4795b2,_0x29d869){_0x7fce38[_0xec21('0x85')](_0x494499)['then'](function(_0x218e50){_0x4795b2({'code':0xc8,'message':_0x218e50[_0xec21('0x1d')]});})[_0xec21('0x1e')](function(_0x59eb56){_0x29d869(_0x4b5cc4[_0xec21('0x12')](0x1f4,_0x59eb56[_0xec21('0x1d')]));});});}};var _0x11de2d=jayson[_0xec21('0x86')](_0x2f15e7)[_0xec21('0x87')]();_0x11de2d['on'](_0xec21('0x12'),function(_0x397a2f){return _0x406b66(_0x397a2f);});_0x11de2d[_0xec21('0x7')](0x232a,'127.0.0.1',function(){console['log'](_0xec21('0x88'),0x232a);return _0x15699b(_0xec21('0x89')+0x232a);});});};
\ No newline at end of file
+var _0xa46e=['custom:','send','server','http','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','validate','bluebird','moment','../properties','listen','format','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','action','Reload','Action','message','catch','Command','then','content','hasOwnProperty','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','callerid','Interval','push','length','find','voiceQueues','omit','undefined','values','voicechannel','map','channels','uniqueid','%s.%s','filename','wav','channel','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','Hangup','Redirect','exten','telephones','trunks','outboundChannels','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa46e,0x8a));var _0xea46=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xa46e[_0x15c421];return _0x5e5ed5;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var jayson=require('jayson/promise');var schema=require(_0xea46('0x2'));var BPromise=require(_0xea46('0x3'));var moment=require(_0xea46('0x4'));var config=require('../../../config/environment');var properties=require(_0xea46('0x5'));var ami=require('../ami');exports[_0xea46('0x6')]=function(_0x47d633,_0x3599fc,_0x528404){return new BPromise(function(_0x10bee5,_0x3dc26f){var _0x5f1cd1={'QueuePause':function(_0x2d1b30){return new Promise(function(_0x42771a,_0xe7d428){var _0x3db7a2=util[_0xea46('0x7')]('%s/%s','SIP',_0x2d1b30['name']);if(_0x47d633[_0xea46('0x8')]&&_0x47d633[_0xea46('0x8')][_0x3db7a2]&&_0x47d633['timers'][_0x3db7a2][_0xea46('0x9')]){_0x47d633[_0xea46('0x8')][_0x3db7a2][_0xea46('0xa')]();}if(_0x47d633['agents'][_0x3db7a2]){_0x47d633[_0xea46('0xb')][_0x3db7a2][_0xea46('0xc')]({'statePause':_0x2d1b30['pause']?!![]:![]});}_0x42771a({'code':0xc8,'message':_0xea46('0xd')});});},'Reload':function(_0x1a4fe2){var _0x534aa3=this;return new Promise(function(_0x20955e,_0x4e4d3f){if(ami[_0xea46('0xe')]()==![]){return _0x4e4d3f(_0x534aa3[_0xea46('0xf')](0x1f4,[config[_0xea46('0x10')]['ip'],config[_0xea46('0x10')][_0xea46('0x11')],_0xea46('0x12')][_0xea46('0x13')]('\x20')));}_0x1a4fe2=_[_0xea46('0x14')](_0x1a4fe2,_[_0xea46('0x15')](properties['module']));_0x1a4fe2[_0xea46('0x16')]=_0xea46('0x17');return ami[_0xea46('0x18')](_0x1a4fe2)['then'](function(_0x58b4da){_0x20955e({'code':0xc8,'message':_0x58b4da[_0xea46('0x19')]});})[_0xea46('0x1a')](function(_0x5cf5dd){_0x4e4d3f(_0x534aa3['error'](0x1f5,_0x5cf5dd[_0xea46('0x19')]));});});},'Command':function(_0x9b7d04){var _0x4ff93d=this;return new Promise(function(_0x40316b,_0x16ae38){if(ami[_0xea46('0xe')]()==![]){return _0x16ae38(_0x4ff93d[_0xea46('0xf')](0x1f4,[config['asterisk']['ip'],config[_0xea46('0x10')]['username'],'ami\x20disconnected'][_0xea46('0x13')]('\x20')));}_0x9b7d04=_['pick'](_0x9b7d04,'command');_0x9b7d04['action']=_0xea46('0x1b');return ami[_0xea46('0x18')](_0x9b7d04)[_0xea46('0x1c')](function(_0x5beb44){_0x40316b({'code':0xc8,'message':_0x5beb44[_0xea46('0x1d')]});})['catch'](function(_0x12e688){_0x16ae38(_0x4ff93d[_0xea46('0xf')](0x1f5,_0x12e688['message']));});});},'VoiceQueues':function(_0xac33c3){return new Promise(function(_0x5480eb,_0x2b3a8f){var _0x114bf9=[];for(var _0xd4cf78 in _0x47d633['voiceQueues']){if(_0x47d633['voiceQueues'][_0xea46('0x1e')](_0xd4cf78)){var _0x38ac07=_0x47d633['voiceQueues'][_0xd4cf78];var _0x3b3928={'id':_0x38ac07['id'],'name':_0x38ac07['name'],'strategy':_0x38ac07[_0xea46('0x1f')],'answered':_0x38ac07['answered'],'available':_0x38ac07[_0xea46('0x20')],'loggedIn':_0x38ac07[_0xea46('0x21')],'pTalking':_0x38ac07[_0xea46('0x22')],'sumBillable':_0x38ac07[_0xea46('0x23')],'sumDuration':_0x38ac07[_0xea46('0x24')],'sumHoldTime':_0x38ac07[_0xea46('0x25')]||0x0,'talking':_0x38ac07['talking'],'total':_0x38ac07[_0xea46('0x26')],'type':_0x38ac07[_0xea46('0x27')],'unmanaged':_0x38ac07[_0xea46('0x28')],'abandoned':_0x38ac07['abandoned'],'waiting':_0x38ac07[_0xea46('0x29')],'loggedInDb':_0x38ac07[_0xea46('0x2a')]};if(_0x38ac07[_0xea46('0x27')]==='outbound'){_0x3b3928['dialActive']=_0x38ac07['dialActive'];_0x3b3928[_0xea46('0x2b')]=_0x38ac07[_0xea46('0x2b')];_0x3b3928[_0xea46('0x2c')]=_0x38ac07[_0xea46('0x2c')];_0x3b3928[_0xea46('0x2d')]=_0x38ac07[_0xea46('0x2d')];_0x3b3928[_0xea46('0x2e')]=_0x38ac07[_0xea46('0x2e')];_0x3b3928[_0xea46('0x2f')]=_0x38ac07[_0xea46('0x2f')];_0x3b3928[_0xea46('0x30')]=_0x38ac07['temp'];_0x3b3928[_0xea46('0x31')]=_0x38ac07[_0xea46('0x31')];_0x3b3928[_0xea46('0x32')]=_0x38ac07[_0xea46('0x32')];_0x3b3928[_0xea46('0x33')]=_0x38ac07[_0xea46('0x33')];_0x3b3928[_0xea46('0x34')]=_0x38ac07['outboundBusyCallsDay'];_0x3b3928[_0xea46('0x35')]=_0x38ac07[_0xea46('0x35')];_0x3b3928[_0xea46('0x36')]=_0x38ac07[_0xea46('0x36')];_0x3b3928[_0xea46('0x37')]=_0x38ac07['outboundDropCallsDayCallersExit'];_0x3b3928['outboundDropCallsDayTimeout']=_0x38ac07[_0xea46('0x38')];_0x3b3928[_0xea46('0x39')]=_0x38ac07['outboundNoAnswerCallsDay'];_0x3b3928[_0xea46('0x3a')]=_0x38ac07[_0xea46('0x3a')];_0x3b3928[_0xea46('0x3b')]=_0x38ac07[_0xea46('0x3b')];_0x3b3928['outboundReCallsDay']=_0x38ac07['outboundReCallsDay'];_0x3b3928[_0xea46('0x3c')]=_0x38ac07['outboundRejectCallsDay'];_0x3b3928[_0xea46('0x3d')]=_0x38ac07[_0xea46('0x3d')];_0x3b3928['predictiveIntervalAnsweredCalls']=_0x38ac07[_0xea46('0x3e')];_0x3b3928[_0xea46('0x3f')]=_0x38ac07['predictiveIntervalAvgHoldtime'];_0x3b3928[_0xea46('0x40')]=_0x38ac07[_0xea46('0x40')];_0x3b3928['predictiveIntervalDroppedCallsCallersExit']=_0x38ac07[_0xea46('0x41')];_0x3b3928[_0xea46('0x42')]=_0x38ac07[_0xea46('0x42')];_0x3b3928[_0xea46('0x43')]=_0x38ac07['predictiveIntervalErlangCalls'];_0x3b3928[_0xea46('0x44')]=_0x38ac07[_0xea46('0x44')];_0x3b3928[_0xea46('0x45')]=_0x38ac07[_0xea46('0x45')];_0x3b3928[_0xea46('0x46')]=_0x38ac07['predictiveIntervalMultiplicativeFactor'];_0x3b3928[_0xea46('0x47')]=_0x38ac07[_0xea46('0x47')];_0x3b3928['predictiveIntervalAvailable']=_0x38ac07[_0xea46('0x48')];_0x3b3928[_0xea46('0x49')]=_0x38ac07[_0xea46('0x49')];_0x3b3928[_0xea46('0x19')]=_0x38ac07['message'];_0x3b3928[_0xea46('0x4a')]=_0x38ac07[_0xea46('0x4a')];_0x3b3928[_0xea46('0x4b')]=_0x38ac07['erlangCalls'];_0x3b3928[_0xea46('0x4c')]=_0x38ac07[_0xea46('0x4c')];_0x3b3928[_0xea46('0x4d')]=_0x38ac07[_0xea46('0x4d')];_0x3b3928[_0xea46('0x4e')]=_0x38ac07[_0xea46('0x4e')];_0x3b3928[_0xea46('0x4f')]=_0x38ac07[_0xea46('0x4f')];_0x3b3928[_0xea46('0x50')]=_0x38ac07[_0xea46('0x50')];}if(_0x38ac07[_0xea46('0x51')]){_0x3b3928[_0xea46('0x51')]={'id':_0x38ac07[_0xea46('0x51')]['id'],'name':_0x38ac07[_0xea46('0x51')][_0xea46('0x52')],'active':_0x38ac07['Trunk']['active'],'callerid':_0x38ac07[_0xea46('0x51')][_0xea46('0x53')]};}if(_0x38ac07[_0xea46('0x54')]){_0x3b3928[_0xea46('0x54')]={'id':_0x38ac07['Interval']['id'],'name':_0x38ac07['Interval']['name']};}_0x114bf9[_0xea46('0x55')](_0x3b3928);}}_0x5480eb({'count':_0x114bf9[_0xea46('0x56')],'rows':_0x114bf9});});},'UpdateVoiceQueue':function(_0x53a4d9){return new Promise(function(_0x25a278,_0x29caf0){var _0x18039b=_[_0xea46('0x57')](_0x47d633[_0xea46('0x58')],{'id':parseInt(_0x53a4d9['id'])});var _0x5c5eed=_[_0xea46('0x59')](_0x53a4d9,['id']);if(_0x18039b){for(var _0x4bd3f2 in _0x5c5eed){if(typeof _0x5c5eed[_0x4bd3f2]!==_0xea46('0x5a')&&typeof _0x18039b[_0x4bd3f2]!==_0xea46('0x5a')){_0x18039b[_0x4bd3f2]=_0x5c5eed[_0x4bd3f2];}}_0x25a278(_0x18039b);}else{_0x29caf0();}});},'VoiceChannels':function(_0x45ee37){return new Promise(function(_0x875507,_0x9c26cf){var _0x1260d1=_[_0xea46('0x5b')](_0x47d633['channels']);_0x875507({'count':_0x1260d1[_0xea46('0x56')],'rows':_0x1260d1});});},'VoiceChannelMixMonitor':function(_0x1fa670){var _0x53215a=this;return new Promise(function(_0x2a1fca,_0x42e305){if(ami[_0xea46('0xe')]()==![]){return _0x42e305(_0x53215a['error'](0x1f4,[config['asterisk']['ip'],config[_0xea46('0x10')][_0xea46('0x11')],_0xea46('0x12')][_0xea46('0x13')]('\x20')));}var _0x4641bf=schema(properties[_0xea46('0x5c')])[_0xea46('0x2')](_0x1fa670);if(_0x4641bf[_0xea46('0x56')]>0x0){return _0x42e305(_0x53215a[_0xea46('0xf')](0x1f4,_[_0xea46('0x5d')](_0x4641bf,'message')[_0xea46('0x13')](',\x20')));}var _0x5c8cc3=_[_0xea46('0x57')](_0x47d633[_0xea46('0x5e')],{'uniqueid':_0x1fa670[_0xea46('0x5f')]});if(_0x5c8cc3&&_0x5c8cc3['channel']){var _0x41feff=util[_0xea46('0x7')](_0xea46('0x60'),_0x1fa670[_0xea46('0x61')]||_0x1fa670['uniqueid'],_0x1fa670['format']||_0xea46('0x62'));return ami[_0xea46('0x18')]({'action':'MixMonitor','channel':_0x5c8cc3[_0xea46('0x63')],'file':_0x41feff,'options':'ai(mixmonitorid)'})[_0xea46('0x1c')](function(_0x3830fe){var _0x389e22=_[_0xea46('0x57')](_0x5c8cc3[_0xea46('0x64')],{'filename':_0xea46('0x65')+_0x41feff[_0xea46('0x66')]()});if(_['isNil'](_0x389e22)){_0x5c8cc3['monitors'][_0xea46('0x55')]({'filename':'/var/spool/asterisk/monitor/'+_0x41feff[_0xea46('0x66')](),'createdAt':moment()[_0xea46('0x7')](_0xea46('0x67')),'mixmonitorid':_0x3830fe['mixmonitorid'],'status':_0xea46('0x68')});}else{_0x389e22['mixmonitorid']=_0x3830fe[_0xea46('0x69')];_0x389e22[_0xea46('0x6a')]='rec';}_0x2a1fca({'code':0xc8,'message':[_0x1fa670['uniqueid'],_0xea46('0x6b'),_0x3830fe[_0xea46('0x69')]][_0xea46('0x13')]('\x20'),'mixmonitorid':_0x3830fe['mixmonitorid']});})[_0xea46('0x1a')](function(_0x5b4847){_0x42e305(_0x53215a[_0xea46('0xf')](0x1f5,[_0x1fa670['uniqueid'],_0x5b4847[_0xea46('0x19')][_0xea46('0x66')]()][_0xea46('0x13')]('\x20')));});}else{return _0x42e305(_0x53215a[_0xea46('0xf')](0x1f5,_0xea46('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x4c5beb){var _0x3af50c=this;return new Promise(function(_0x2659bd,_0x455bc2){if(ami['isConnected']()==![]){return _0x455bc2(_0x3af50c['error'](0x1f4,[config[_0xea46('0x10')]['ip'],config[_0xea46('0x10')][_0xea46('0x11')],_0xea46('0x12')][_0xea46('0x13')]('\x20')));}var _0x175a42=schema(properties[_0xea46('0x5c')])[_0xea46('0x2')](_0x4c5beb);if(_0x175a42[_0xea46('0x56')]>0x0){return _0x455bc2(_0x3af50c[_0xea46('0xf')](0x1f4,_[_0xea46('0x5d')](_0x175a42,_0xea46('0x19'))[_0xea46('0x13')](',\x20')));}var _0x219776=_[_0xea46('0x57')](_0x47d633['channels'],{'uniqueid':_0x4c5beb[_0xea46('0x5f')]});if(_0x219776){return BPromise[_0xea46('0x6d')]()[_0xea46('0x1c')](function(){if(_0x219776[_0xea46('0x63')]){return ami['Action']({'action':_0xea46('0x6e'),'channel':_0x219776[_0xea46('0x63')],'mixmonitorid':_0x4c5beb['mixmonitorid']})[_0xea46('0x1a')](function(_0x419f86){});}})['then'](function(){if(_0x219776[_0xea46('0x6f')]){return ami[_0xea46('0x18')]({'action':_0xea46('0x6e'),'channel':_0x219776['destinationchannel'],'mixmonitorid':_0x4c5beb[_0xea46('0x69')]})[_0xea46('0x1a')](function(_0x214b85){});}})['then'](function(_0x4cdb8a){var _0x587bd3=_[_0xea46('0x57')](_0x219776[_0xea46('0x64')],{'mixmonitorid':_0x4c5beb[_0xea46('0x69')]});if(_0x587bd3){_0x587bd3[_0xea46('0x6a')]=_0xea46('0x70');}})['then'](function(){var _0x6b69e7=util['format'](_0xea46('0x60'),_0x4c5beb[_0xea46('0x61')]||_0x4c5beb[_0xea46('0x5f')],_0x4c5beb['format']||'wav');var _0x2b8a8b=_[_0xea46('0x57')](_0x219776['monitors'],{'filename':_0xea46('0x65')+_0x6b69e7[_0xea46('0x66')]()});if(_0x2b8a8b){_0x2b8a8b[_0xea46('0x6a')]=_0xea46('0x70');}})[_0xea46('0x1c')](function(){_0x2659bd({'code':0xc8,'message':[_0x4c5beb['uniqueid'],_0xea46('0x71')][_0xea46('0x13')]('\x20')});})[_0xea46('0x1a')](function(_0x199d96){_0x455bc2(_0x3af50c[_0xea46('0xf')](0x1f5,[_0x4c5beb[_0xea46('0x5f')],_0x199d96[_0xea46('0x19')][_0xea46('0x66')]()]['join']('\x20')));});}else{return _0x455bc2(_0x3af50c[_0xea46('0xf')](0x1f5,_0xea46('0x6c')));}});},'VoiceQueuesChannels':function(_0x26e982){return new Promise(function(_0x7f99b2,_0x24cc2c){var _0x3d258e=_[_0xea46('0x5b')](_0x47d633['queueChannels']);_0x7f99b2({'count':_0x3d258e['length'],'rows':_0x3d258e});});},'VoiceQueuesChannel':function(_0x2bc9f6){var _0x1202c6=this;return new Promise(function(_0x123444,_0x3ba634){var _0x10e0e1=schema(properties[_0xea46('0x72')])[_0xea46('0x2')](_0x2bc9f6);if(_0x10e0e1[_0xea46('0x56')]>0x0){return _0x3ba634(_0x1202c6[_0xea46('0xf')](0x1f4,_[_0xea46('0x5d')](_0x10e0e1,_0xea46('0x19'))['join'](',\x20')));}var _0x204435=_[_0xea46('0x57')](_0x47d633[_0xea46('0x73')],{'uniqueid':_0x2bc9f6[_0xea46('0x5f')]});if(_0x204435){_0x123444(_0x204435);}else{return _0x3ba634(_0x1202c6['error'](0x1f5,_0xea46('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x34f8f9){var _0x31604c=this;return new Promise(function(_0x12f788,_0x5d26eb){if(ami[_0xea46('0xe')]()==![]){return _0x5d26eb(_0x31604c[_0xea46('0xf')](0x1f4,[config[_0xea46('0x10')]['ip'],config[_0xea46('0x10')]['username'],_0xea46('0x12')][_0xea46('0x13')]('\x20')));}var _0x50253d=schema(properties['voicequeuechannelhangup'])[_0xea46('0x2')](_0x34f8f9);if(_0x50253d[_0xea46('0x56')]>0x0){return _0x5d26eb(_0x31604c[_0xea46('0xf')](0x1f4,_[_0xea46('0x5d')](_0x50253d,_0xea46('0x19'))[_0xea46('0x13')](',\x20')));}var _0x1d5b31=_[_0xea46('0x57')](_0x47d633[_0xea46('0x73')],{'uniqueid':_0x34f8f9[_0xea46('0x5f')]});if(_0x1d5b31&&_0x1d5b31[_0xea46('0x63')]){return ami[_0xea46('0x18')]({'action':_0xea46('0x74'),'channel':_0x1d5b31['channel']})[_0xea46('0x1c')](function(_0xa8bfed){_0x12f788({'code':0xc8,'message':[_0x34f8f9['uniqueid'],_0xa8bfed[_0xea46('0x19')][_0xea46('0x66')]()][_0xea46('0x13')]('\x20')});})[_0xea46('0x1a')](function(_0x4bba61){_0x5d26eb(_0x31604c[_0xea46('0xf')](0x1f5,[_0x34f8f9['uniqueid'],_0x4bba61[_0xea46('0x19')][_0xea46('0x66')]()][_0xea46('0x13')]('\x20')));});}else{return _0x5d26eb(_0x31604c[_0xea46('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x237779){var _0x4c6d71=this;return new Promise(function(_0x4017da,_0x3f6978){if(ami['isConnected']()==![]){return _0x3f6978(_0x4c6d71[_0xea46('0xf')](0x1f4,[config[_0xea46('0x10')]['ip'],config['asterisk'][_0xea46('0x11')],_0xea46('0x12')]['join']('\x20')));}var _0x5e7a2c=schema(properties['voicequeuechannelredirect'])['validate'](_0x237779);if(_0x5e7a2c[_0xea46('0x56')]>0x0){return _0x3f6978(_0x4c6d71[_0xea46('0xf')](0x1f4,_[_0xea46('0x5d')](_0x5e7a2c,_0xea46('0x19'))[_0xea46('0x13')](',\x20')));}var _0xe6c28b=_[_0xea46('0x57')](_0x47d633[_0xea46('0x73')],{'uniqueid':_0x237779['uniqueid']});if(_0xe6c28b&&_0xe6c28b[_0xea46('0x63')]){return ami[_0xea46('0x18')]({'action':_0xea46('0x75'),'channel':_0xe6c28b[_0xea46('0x63')],'exten':_0x237779[_0xea46('0x76')],'context':_0x237779['context']||_0xe6c28b['context'],'priority':0x1})[_0xea46('0x1c')](function(_0x7e3ea4){_0x4017da({'code':0xc8,'message':[_0x237779[_0xea46('0x5f')],_0x7e3ea4[_0xea46('0x19')][_0xea46('0x66')]()]['join']('\x20')});})[_0xea46('0x1a')](function(_0x1b2383){_0x3f6978(_0x4c6d71['error'](0x1f5,[_0x237779['uniqueid'],_0x1b2383[_0xea46('0x19')][_0xea46('0x66')]()][_0xea46('0x13')]('\x20')));});}else{return _0x3f6978(_0x4c6d71[_0xea46('0xf')](0x1f5,_0xea46('0x6c')));}});},'Agents':function(_0x478db1){return new Promise(function(_0x299a48,_0x4c75b5){var _0x391b01=_[_0xea46('0x5b')](_0x47d633[_0xea46('0xb')]);_0x299a48({'count':_0x391b01[_0xea46('0x56')],'rows':_0x391b01});});},'Telephones':function(_0x55e8fb){return new Promise(function(_0xab4bba,_0x35e967){var _0x23d13e=_[_0xea46('0x5b')](_0x47d633[_0xea46('0x77')]);_0xab4bba({'count':_0x23d13e[_0xea46('0x56')],'rows':_0x23d13e});});},'Trunks':function(_0x46419a){return new Promise(function(_0x11641b,_0x2855f8){var _0x59b475=_[_0xea46('0x5b')](_0x47d633[_0xea46('0x78')]);_0x11641b({'count':_0x59b475['length'],'rows':_0x59b475});});},'OutboundChannels':function(_0x5a8e1b){return new Promise(function(_0x237c32,_0x2fc069){var _0x1bbc4e=_['values'](_0x47d633[_0xea46('0x79')]);_0x237c32({'count':_0x1bbc4e[_0xea46('0x56')],'rows':_0x1bbc4e});});},'Outbound':function(_0x565a67){return new Promise(function(_0x5e477d,_0x2e96ad){_0x5e477d(_0x47d633[_0xea46('0x7a')]);});},'Campaigns':function(_0xdaeb0f){return new Promise(function(_0xde7410,_0x6af502){var _0x4799fe=_[_0xea46('0x5b')](_0x47d633[_0xea46('0x7b')]);_0xde7410({'count':_0x4799fe['length'],'rows':_0x4799fe});});},'VoiceQueuesPreview':function(_0x1bbc55){var _0x2e2679=this;return new Promise(function(_0x2f985a,_0x4e2c45){_0x3599fc[_0xea46('0x7c')](_0x1bbc55['id'])[_0xea46('0x1c')](function(_0x89c609){_0x2f985a({'code':0xc8,'message':_0x89c609[_0xea46('0x19')]});})['catch'](function(_0x394ae5){_0x4e2c45(_0x2e2679[_0xea46('0xf')](0x1f4,_0x394ae5[_0xea46('0x19')]));});});},'EventManager':function(_0x20c8a3){var _0x59698a=this;return new Promise(function(_0x1c934b,_0x5d2231){if(!_0x20c8a3[_0xea46('0x7d')]){return _0x5d2231(_0x59698a[_0xea46('0xf')](0x1f4,_0xea46('0x7e')));}ami[_0xea46('0x7f')](_0xea46('0x80')+_0x20c8a3[_0xea46('0x7d')],_0x20c8a3[_0xea46('0x19')]);_0x1c934b({'code':0xc8,'message':_0x20c8a3});});},'FaxAccounts':function(_0x4cd7dd){return new Promise(function(_0x33f5a3,_0x45a97d){var _0x857744=_[_0xea46('0x5b')](_0x47d633['faxAccounts']);_0x33f5a3({'count':_0x857744[_0xea46('0x56')],'rows':_0x857744});});},'SendFax':function(_0x4d0f53){var _0x20b4bf=this;return new Promise(function(_0x55bd35,_0x5d0b19){_0x528404[_0xea46('0x81')](_0x4d0f53)[_0xea46('0x1c')](function(_0x1d5e79){_0x55bd35({'code':0xc8,'message':_0x1d5e79[_0xea46('0x19')]});})[_0xea46('0x1a')](function(_0x4db97e){_0x5d0b19(_0x20b4bf[_0xea46('0xf')](0x1f4,_0x4db97e[_0xea46('0x19')]));});});},'CheckAfterSend':function(_0xe805bb){var _0x2ca531=this;return new Promise(function(_0xd8c75b,_0x2879bc){_0x528404['checkAfterSend'](_0xe805bb)[_0xea46('0x1c')](function(_0xd2bc4c){_0xd8c75b({'code':0xc8,'message':_0xd2bc4c['message']});})[_0xea46('0x1a')](function(_0x53abbb){_0x2879bc(_0x2ca531[_0xea46('0xf')](0x1f4,_0x53abbb[_0xea46('0x19')]));});});}};var _0x367f04=jayson[_0xea46('0x82')](_0x5f1cd1)[_0xea46('0x83')]();_0x367f04['on'](_0xea46('0xf'),function(_0x5e4e96){return _0x3dc26f(_0x5e4e96);});_0x367f04['listen'](0x232a,'127.0.0.1',function(){console['log'](_0xea46('0x84'),0x232a);return _0x10bee5('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
index 967afac..7dbdded 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a58=['<unknown>','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','user:%s','name','format','trigger:%s','toLowerCase','merge','length','lodash','util','../../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','union','resolve','then','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','Unknown','destcalleridname'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0x8a58,0x193));var _0x88a5=function(_0xdfde,_0x3932fa){_0xdfde=_0xdfde-0x0;var _0x50da09=_0x8a58[_0xdfde];return _0x50da09;};'use strict';var _=require(_0x88a5('0x0'));var BPromise=require('bluebird');var Redis=require('ioredis');var util=require(_0x88a5('0x1'));var config=require('../../../../config/environment');var logger=require(_0x88a5('0x2'))(_0x88a5('0x3'));var cmContactRpc=require('../../rpc/cmContact');config[_0x88a5('0x4')]=_[_0x88a5('0x5')](config[_0x88a5('0x4')],{'host':_0x88a5('0x6'),'port':0x18eb});var io=require(_0x88a5('0x7'))(new Redis(config[_0x88a5('0x4')]));function emit(_0x3e12a9,_0x3507c7,_0x53b8de,_0x857941,_0x587101){logger[_0x88a5('0x8')](_0x88a5('0x9'),_0x3e12a9,_0x3507c7['id'],_0x53b8de,_0x857941,JSON[_0x88a5('0xa')](_0x587101));io['to'](_0x53b8de)[_0x88a5('0xb')](_0x857941,_0x587101);}exports[_0x88a5('0xc')]=function(_0x4ce7ce,_0x571772,_0x366c51,_0x69d98f){var _0x9eb4e6,_0x5fde29;var _0x13b1e2={};var _0x3acc19;var _0x558058=Number(_0x366c51[_0x88a5('0xd')]);var _0x572191=_0x366c51['data2']?Boolean(Number(_0x366c51[_0x88a5('0xe')])):![];var _0x1778ca;var _0x5040fe=![];if(!_[_0x88a5('0xf')](_0x366c51[_0x88a5('0x10')])){if(_0x366c51[_0x88a5('0x10')]=='1')_0x5040fe=!![];}if(!_0x5040fe){if(_0x69d98f[_0x88a5('0x11')]){_0x13b1e2['id']=_0x69d98f['xmd-contactid'];}}if(!_0x13b1e2['id']){_0x13b1e2[_0x88a5('0x12')]=_0x558058;_0x1778ca=_0x366c51[_0x88a5('0x13')]&&_0x366c51[_0x88a5('0x13')]!=='0'?_0x366c51[_0x88a5('0x13')][_0x88a5('0x14')](','):[_0x88a5('0x15')];_0x13b1e2[_0x88a5('0x16')]=_[_0x88a5('0x17')](_0x1778ca,function(_0x4579ab){var _0x4912a7={};_0x4912a7[_0x4579ab]=_0x69d98f[_0x88a5('0x18')]?_0x69d98f[_0x88a5('0x19')]:_0x69d98f[_0x88a5('0x1a')];return _0x4912a7;});_0x3acc19=_0x69d98f[_0x88a5('0x18')]?_0x69d98f['destcalleridnum']:_0x69d98f[_0x88a5('0x1a')];}var _0x32d356=['id',_0x88a5('0x1b'),_0x88a5('0x1c'),_0x88a5('0x15'),_0x88a5('0x1d'),_0x88a5('0x1e'),_0x88a5('0x12'),_0x88a5('0x1f'),_0x88a5('0x20'),'updatedAt'];var _0x2fa5bf=_[_0x88a5('0x21')](_0x32d356,_0x1778ca);BPromise[_0x88a5('0x22')]()[_0x88a5('0x23')](cmContactRpc['getContacts']({'attributes':_0x2fa5bf,'where':_0x13b1e2,'phone':_0x3acc19}))['then'](function(_0x584991){_0x5fde29=_0x584991;if(!_[_0x88a5('0x24')](_0x5fde29)){if(_0x5fde29['length']===0x1){_0x9eb4e6=_0x5fde29[0x0];logger[_0x88a5('0x8')](_0x88a5('0x25'),_0x69d98f[_0x88a5('0x26')],_0x571772['id'],_0x9eb4e6['id']);}else{logger[_0x88a5('0x8')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x69d98f[_0x88a5('0x26')],_0x571772['id'],_['map'](_0x5fde29,'id')[_0x88a5('0x27')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0x69d98f['uniqueid'],_0x571772['id']);var _0x463d05={'ListId':_0x558058};var _0x498a92=_0x366c51[_0x88a5('0x28')]&&_0x366c51[_0x88a5('0x28')]!=='0'?_0x366c51[_0x88a5('0x28')]:_0x88a5('0x15');if(_0x572191){logger[_0x88a5('0x8')](_0x88a5('0x29'),_0x69d98f[_0x88a5('0x26')],_0x571772['id']);_0x463d05[_0x498a92]=_[_0x88a5('0xf')](_0x69d98f[_0x88a5('0x18')])?_0x69d98f[_0x88a5('0x1a')]:_0x69d98f['destcalleridnum'];if(_[_0x88a5('0xf')](_0x69d98f[_0x88a5('0x18')])){_0x463d05[_0x88a5('0x1b')]=_0x69d98f[_0x88a5('0x2a')]&&_0x69d98f[_0x88a5('0x2a')]!=='<unknown>'?_0x69d98f[_0x88a5('0x2a')]:_0x88a5('0x2b');}else{_0x463d05[_0x88a5('0x1b')]=_0x69d98f[_0x88a5('0x2c')]&&_0x69d98f[_0x88a5('0x2c')]!==_0x88a5('0x2d')?_0x69d98f[_0x88a5('0x2c')]:_0x88a5('0x2b');}return BPromise[_0x88a5('0x22')]()['then'](cmContactRpc['createContact'](_0x463d05))[_0x88a5('0x23')](function(_0xe884b8){_0x9eb4e6=_0xe884b8;_0x5fde29['push'](_0xe884b8);if(_0x9eb4e6){logger['info'](_0x88a5('0x2e'),_0x69d98f[_0x88a5('0x26')],_0x571772['id'],_0x9eb4e6['id']);}return;});}else{logger[_0x88a5('0x8')](_0x88a5('0x2f'),_0x69d98f[_0x88a5('0x26')],_0x571772['id']);_0x463d05[_0x498a92]=_[_0x88a5('0xf')](_0x69d98f['routeId'])?_0x69d98f['calleridnum']:_0x69d98f[_0x88a5('0x19')];if(_['isNil'](_0x69d98f['routeId'])){_0x463d05[_0x88a5('0x1b')]=_0x69d98f[_0x88a5('0x2a')]&&_0x69d98f[_0x88a5('0x2a')]!=='<unknown>'?_0x69d98f[_0x88a5('0x2a')]:_0x88a5('0x2b');}else{_0x463d05[_0x88a5('0x1b')]=_0x69d98f[_0x88a5('0x2c')]&&_0x69d98f[_0x88a5('0x2c')]!==_0x88a5('0x2d')?_0x69d98f['destcalleridname']:_0x88a5('0x2b');}_0x9eb4e6=_0x463d05;_0x5fde29[_0x88a5('0x30')](_0x463d05);return;}}})[_0x88a5('0x23')](function(){if(_0x4ce7ce){emit(_0x69d98f[_0x88a5('0x26')],_0x571772,util['format'](_0x88a5('0x31'),_0x4ce7ce[_0x88a5('0x32')]),util[_0x88a5('0x33')](_0x88a5('0x34'),_0x366c51['action'][_0x88a5('0x35')]()),{'evt':_[_0x88a5('0x36')](_0x69d98f,{'autoCreate':_0x572191}),'contact':_0x9eb4e6===undefined?{}:_0x9eb4e6,'contacts':_0x5fde29[_0x88a5('0x37')]===0x0?undefined:_0x5fde29});}});};
\ No newline at end of file
+var _0xa771=['firstName','calleridname','<unknown>','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','isNil','format','user:%s','name','action','toLowerCase','merge','ioredis','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','[CM][%s][%s]','stringify','emit','exec','data1','data2','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','lastName','mobile','fax','createdAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','info','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled'];(function(_0x2e2bed,_0x341b6e){var _0x79f129=function(_0x1c9b82){while(--_0x1c9b82){_0x2e2bed['push'](_0x2e2bed['shift']());}};_0x79f129(++_0x341b6e);}(_0xa771,0x1d7));var _0x1a77=function(_0x37b243,_0x425628){_0x37b243=_0x37b243-0x0;var _0x6375ad=_0xa771[_0x37b243];return _0x6375ad;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0x1a77('0x0'));var util=require('util');var config=require(_0x1a77('0x1'));var logger=require(_0x1a77('0x2'))(_0x1a77('0x3'));var cmContactRpc=require('../../rpc/cmContact');config[_0x1a77('0x4')]=_[_0x1a77('0x5')](config[_0x1a77('0x4')],{'host':_0x1a77('0x6'),'port':0x18eb});var io=require(_0x1a77('0x7'))(new Redis(config['redis']));function emit(_0x568781,_0x3bdac9,_0x4f17c9,_0x5f1e6d,_0x4b23ee){logger['info'](_0x1a77('0x8'),_0x568781,_0x3bdac9['id'],_0x4f17c9,_0x5f1e6d,JSON[_0x1a77('0x9')](_0x4b23ee));io['to'](_0x4f17c9)[_0x1a77('0xa')](_0x5f1e6d,_0x4b23ee);}exports[_0x1a77('0xb')]=function(_0x17c5de,_0x282a4e,_0x138d58,_0xfae893){var _0x2cb1e6,_0x260cf6;var _0x343516={};var _0x225319;var _0x429a5c=Number(_0x138d58[_0x1a77('0xc')]);var _0x8ec0bf=_0x138d58[_0x1a77('0xd')]?Boolean(Number(_0x138d58[_0x1a77('0xd')])):![];var _0x3065b6;var _0x1927b1=![];if(!_['isNil'](_0x138d58['data5'])){if(_0x138d58[_0x1a77('0xe')]=='1')_0x1927b1=!![];}if(!_0x1927b1){if(_0xfae893[_0x1a77('0xf')]){_0x343516['id']=_0xfae893[_0x1a77('0xf')];}}if(!_0x343516['id']){_0x343516[_0x1a77('0x10')]=_0x429a5c;_0x3065b6=_0x138d58[_0x1a77('0x11')]&&_0x138d58[_0x1a77('0x11')]!=='0'?_0x138d58[_0x1a77('0x11')][_0x1a77('0x12')](','):[_0x1a77('0x13')];_0x343516[_0x1a77('0x14')]=_[_0x1a77('0x15')](_0x3065b6,function(_0x524b6b){var _0x1064bc={};_0x1064bc[_0x524b6b]=_0xfae893[_0x1a77('0x16')]?_0xfae893[_0x1a77('0x17')]:_0xfae893[_0x1a77('0x18')];return _0x1064bc;});_0x225319=_0xfae893[_0x1a77('0x16')]?_0xfae893[_0x1a77('0x17')]:_0xfae893[_0x1a77('0x18')];}var _0x2b9001=['id','firstName',_0x1a77('0x19'),_0x1a77('0x13'),_0x1a77('0x1a'),_0x1a77('0x1b'),'ListId',_0x1a77('0x1c'),'scheduledAt','updatedAt'];var _0x13bf99=_[_0x1a77('0x1d')](_0x2b9001,_0x3065b6);BPromise[_0x1a77('0x1e')]()[_0x1a77('0x1f')](cmContactRpc['getContacts']({'attributes':_0x13bf99,'where':_0x343516,'phone':_0x225319}))[_0x1a77('0x1f')](function(_0x3e3c4b){_0x260cf6=_0x3e3c4b;if(!_[_0x1a77('0x20')](_0x260cf6)){if(_0x260cf6[_0x1a77('0x21')]===0x1){_0x2cb1e6=_0x260cf6[0x0];logger['info'](_0x1a77('0x22'),_0xfae893[_0x1a77('0x23')],_0x282a4e['id'],_0x2cb1e6['id']);}else{logger['info'](_0x1a77('0x24'),_0xfae893[_0x1a77('0x23')],_0x282a4e['id'],_[_0x1a77('0x15')](_0x260cf6,'id')[_0x1a77('0x25')](','));}return;}else{logger[_0x1a77('0x26')](_0x1a77('0x27'),_0xfae893[_0x1a77('0x23')],_0x282a4e['id']);var _0x5d61d8={'ListId':_0x429a5c};var _0x191899=_0x138d58[_0x1a77('0x28')]&&_0x138d58[_0x1a77('0x28')]!=='0'?_0x138d58[_0x1a77('0x28')]:_0x1a77('0x13');if(_0x8ec0bf){logger[_0x1a77('0x26')](_0x1a77('0x29'),_0xfae893[_0x1a77('0x23')],_0x282a4e['id']);_0x5d61d8[_0x191899]=_['isNil'](_0xfae893[_0x1a77('0x16')])?_0xfae893['calleridnum']:_0xfae893[_0x1a77('0x17')];if(_['isNil'](_0xfae893[_0x1a77('0x16')])){_0x5d61d8[_0x1a77('0x2a')]=_0xfae893[_0x1a77('0x2b')]&&_0xfae893[_0x1a77('0x2b')]!==_0x1a77('0x2c')?_0xfae893['calleridname']:_0x1a77('0x2d');}else{_0x5d61d8[_0x1a77('0x2a')]=_0xfae893[_0x1a77('0x2e')]&&_0xfae893['destcalleridname']!=='<unknown>'?_0xfae893[_0x1a77('0x2e')]:_0x1a77('0x2d');}return BPromise['resolve']()[_0x1a77('0x1f')](cmContactRpc['createContact'](_0x5d61d8))[_0x1a77('0x1f')](function(_0x2aa839){_0x2cb1e6=_0x2aa839;_0x260cf6[_0x1a77('0x2f')](_0x2aa839);if(_0x2cb1e6){logger[_0x1a77('0x26')](_0x1a77('0x30'),_0xfae893[_0x1a77('0x23')],_0x282a4e['id'],_0x2cb1e6['id']);}return;});}else{logger[_0x1a77('0x26')](_0x1a77('0x31'),_0xfae893[_0x1a77('0x23')],_0x282a4e['id']);_0x5d61d8[_0x191899]=_[_0x1a77('0x32')](_0xfae893[_0x1a77('0x16')])?_0xfae893[_0x1a77('0x18')]:_0xfae893[_0x1a77('0x17')];if(_[_0x1a77('0x32')](_0xfae893['routeId'])){_0x5d61d8[_0x1a77('0x2a')]=_0xfae893[_0x1a77('0x2b')]&&_0xfae893[_0x1a77('0x2b')]!=='<unknown>'?_0xfae893[_0x1a77('0x2b')]:'Unknown';}else{_0x5d61d8['firstName']=_0xfae893['destcalleridname']&&_0xfae893['destcalleridname']!==_0x1a77('0x2c')?_0xfae893[_0x1a77('0x2e')]:_0x1a77('0x2d');}_0x2cb1e6=_0x5d61d8;_0x260cf6[_0x1a77('0x2f')](_0x5d61d8);return;}}})['then'](function(){if(_0x17c5de){emit(_0xfae893[_0x1a77('0x23')],_0x282a4e,util[_0x1a77('0x33')](_0x1a77('0x34'),_0x17c5de[_0x1a77('0x35')]),util[_0x1a77('0x33')]('trigger:%s',_0x138d58[_0x1a77('0x36')][_0x1a77('0x37')]()),{'evt':_[_0x1a77('0x38')](_0xfae893,{'autoCreate':_0x8ec0bf}),'contact':_0x2cb1e6===undefined?{}:_0x2cb1e6,'contacts':_0x260cf6[_0x1a77('0x21')]===0x0?undefined:_0x260cf6});}});};
\ No newline at end of file
index a09fec9..33f3f75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x853e=['routeId','mailSubstatus','substatus','offlineMessage','equals','exports','lodash','mustache','./urlforward','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','salesforceAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','stringify','clone','motionChannel','undefined','checkTriggers','triggers','hasOwnProperty','status','checkTrigger','variables','Actions','length','interface','action','contactmanager','motionbar','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','windowWidth','800','data5','data6','600','winapp','winApplication','winArguments','format','trigger:%s:%s','merge','user:%s','name','trigger:%s','toLowerCase','exec','integration','queue','urlforward','script','parse','replace','channel','AllConditions','checkConditions','AnyConditions','field','account','chat','ChatWebsiteId','operator','upperFirst','AccountId','value','event','agent','membername','lastevent'];(function(_0x53d636,_0x3a8bea){var _0x20abab=function(_0x3b918c){while(--_0x3b918c){_0x53d636['push'](_0x53d636['shift']());}};_0x20abab(++_0x3a8bea);}(_0x853e,0x1ea));var _0xe853=function(_0x540dc6,_0x42c884){_0x540dc6=_0x540dc6-0x0;var _0x5e7e25=_0x853e[_0x540dc6];return _0x5e7e25;};'use strict';var util=require('util');var _=require(_0xe853('0x0'));var url=require('url');var Mustache=require(_0xe853('0x1'));var Redis=require('ioredis');var urlforward=require(_0xe853('0x2'));var integration=require('./integration');var cmContact=require(_0xe853('0x3'));var script=require(_0xe853('0x4'));var config=require(_0xe853('0x5'));var logger=require(_0xe853('0x6'))(_0xe853('0x7'));var ami=require('../ami');config[_0xe853('0x8')]=_[_0xe853('0x9')](config[_0xe853('0x8')],{'host':_0xe853('0xa'),'port':0x18eb});var io=require(_0xe853('0xb'))(new Redis(config[_0xe853('0x8')]));var operators={'equals':function(_0x1b7341,_0x116eed){return _0x1b7341==_0x116eed;},'not_equals':function(_0x213f17,_0x15bfe2){return _0x213f17!=_0x15bfe2;}};var barAndWebActions=['popup','url','winapp'];function Trigger(_0xd985c6){this['triggers']=_0xd985c6['triggers'];this[_0xe853('0xc')]=_0xd985c6[_0xe853('0xc')];this[_0xe853('0xd')]=_0xd985c6['voiceQueues'];this[_0xe853('0xe')]=_0xd985c6[_0xe853('0xe')];this[_0xe853('0xf')]=_0xd985c6[_0xe853('0xf')];this[_0xe853('0x10')]=_0xd985c6[_0xe853('0x10')];this[_0xe853('0x11')]=_0xd985c6['freshdeskAccounts'];this['salesforceAccounts']=_0xd985c6['salesforceAccounts'];this['sugarcrmAccounts']=_0xd985c6[_0xe853('0x12')];this[_0xe853('0x13')]=_0xd985c6[_0xe853('0x13')];this[_0xe853('0x14')]=_0xd985c6[_0xe853('0x14')];this[_0xe853('0x15')]=_0xd985c6[_0xe853('0x15')];this[_0xe853('0x16')]=_0xd985c6[_0xe853('0x16')];this[_0xe853('0x17')]=_0xd985c6[_0xe853('0x17')];this[_0xe853('0x18')]=_0xd985c6[_0xe853('0x18')];this[_0xe853('0x19')]={'zendesk':this[_0xe853('0x10')],'salesforce':this[_0xe853('0x1a')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xe853('0x12')],'zoho':this[_0xe853('0x13')],'desk':this[_0xe853('0x14')],'vtiger':this[_0xe853('0x15')],'dynamics365':this[_0xe853('0x17')],'freshsales':this[_0xe853('0x18')],'servicenow':this[_0xe853('0x16')]};ami['on'](_0xe853('0x1b'),this[_0xe853('0x1c')][_0xe853('0x1d')](this));ami['on'](_0xe853('0x1e'),this['syncCustomEvent'][_0xe853('0x1d')](this));ami['on'](_0xe853('0x1f'),this[_0xe853('0x1c')][_0xe853('0x1d')](this));ami['on'](_0xe853('0x20'),this[_0xe853('0x1c')][_0xe853('0x1d')](this));ami['on'](_0xe853('0x21'),this['syncCustomEvent'][_0xe853('0x1d')](this));ami['on'](_0xe853('0x22'),this[_0xe853('0x1c')][_0xe853('0x1d')](this));ami['on'](_0xe853('0x23'),this['syncCustomEvent'][_0xe853('0x1d')](this));ami['on'](_0xe853('0x24'),this['syncCustomEvent'][_0xe853('0x1d')](this));ami['on']('custom:agentreject',this[_0xe853('0x1c')]['bind'](this));ami['on']('custom:amd',this[_0xe853('0x1c')][_0xe853('0x1d')](this));ami['on'](_0xe853('0x25'),this[_0xe853('0x1c')][_0xe853('0x1d')](this));ami['on'](_0xe853('0x26'),this[_0xe853('0x1c')][_0xe853('0x1d')](this));ami['on'](_0xe853('0x27'),this[_0xe853('0x28')][_0xe853('0x1d')](this));ami['on']('custom:dialconnect',this[_0xe853('0x28')][_0xe853('0x1d')](this));ami['on']('custom:dialend',this[_0xe853('0x28')]['bind'](this));ami['on'](_0xe853('0x29'),this[_0xe853('0x1c')][_0xe853('0x1d')](this));ami['on']('custom:closedinteraction',this[_0xe853('0x1c')][_0xe853('0x1d')](this));ami['on'](_0xe853('0x2a'),this[_0xe853('0x1c')][_0xe853('0x1d')](this));ami['on'](_0xe853('0x2b'),this[_0xe853('0x1c')][_0xe853('0x1d')](this));ami['on'](_0xe853('0x2c'),this[_0xe853('0x1c')][_0xe853('0x1d')](this));ami['on']('custom:acceptmessage',this[_0xe853('0x1c')]['bind'](this));ami['on'](_0xe853('0x2d'),this[_0xe853('0x1c')][_0xe853('0x1d')](this));ami['on'](_0xe853('0x2e'),this['syncCustomEvent'][_0xe853('0x1d')](this));}Trigger[_0xe853('0x2f')][_0xe853('0x30')]=function(_0x3c769e,_0x3f794b,_0xbf08f9){logger['info'](_0x3c769e,_0x3f794b,JSON[_0xe853('0x31')](_0xbf08f9));io['to'](_0x3c769e)[_0xe853('0x30')](_0x3f794b,_0xbf08f9);};Trigger[_0xe853('0x2f')][_0xe853('0x1c')]=function(_0xc8b547){var _0x2dbf3b=_[_0xe853('0x32')](_0xc8b547);if(typeof _0x2dbf3b[_0xe853('0x33')]===_0xe853('0x34')){_0x2dbf3b['motionChannel']='voice';}this[_0xe853('0x35')](_0x2dbf3b);};Trigger[_0xe853('0x2f')][_0xe853('0x28')]=function(_0x5a37ab){if(this[_0xe853('0xc')][_0x5a37ab['interface']]){this['syncCustomEvent'](_0x5a37ab);}};Trigger['prototype'][_0xe853('0x35')]=function(_0x5b1fe4){var _0x3ae0cb;for(var _0x5ac611 in this[_0xe853('0x36')]){if(this[_0xe853('0x36')][_0xe853('0x37')](_0x5ac611)){if(this[_0xe853('0x36')][_0x5ac611][_0xe853('0x38')]){_0x3ae0cb=this[_0xe853('0x39')](this['triggers'][_0x5ac611],_0x5b1fe4);if(_0x3ae0cb){_['merge'](_0x5b1fe4,_0x5b1fe4[_0xe853('0x3a')]);for(var _0x59de1e=0x0,_0x280e54,_0xb54341,_0x13f117;_0x59de1e<this[_0xe853('0x36')][_0x5ac611][_0xe853('0x3b')][_0xe853('0x3c')];_0x59de1e+=0x1){_0x280e54=this[_0xe853('0x36')][_0x5ac611]['Actions'][_0x59de1e];if(this[_0xe853('0xc')][_0x5b1fe4[_0xe853('0x3d')]]){switch(_0x280e54[_0xe853('0x3e')]['toLowerCase']()){case _0xe853('0x3f'):break;case _0xe853('0x40'):case'browser':var _0x776043={};switch(barAndWebActions[_0x280e54[_0xe853('0x41')]]){case'popup':_0x776043[_0xe853('0x42')]=_0x280e54[_0xe853('0x43')];_0x776043[_0xe853('0x44')]=this[_0xe853('0xe')][_0x280e54['data2']]?Mustache[_0xe853('0x45')](this['templates'][_0x280e54[_0xe853('0x43')]][_0xe853('0x44')],_0x5b1fe4):_0xe853('0x46');break;case'url':_0x776043[_0xe853('0x47')]=this[_0xe853('0x48')](_0x280e54['data2'],_0x5b1fe4,_[_0xe853('0x49')](_0x280e54['data3'])?!![]:parseInt(_0x280e54[_0xe853('0x4a')],0xa));if(_[_0xe853('0x49')](_0x280e54[_0xe853('0x4b')])){_0x776043[_0xe853('0x4c')]='0';}else{_0x776043['uriLocation']=_0x280e54['data4'];_0x776043[_0xe853('0x4d')]=_[_0xe853('0x49')](_0x280e54['data5'])?_0xe853('0x4e'):_0x280e54[_0xe853('0x4f')];_0x776043['windowHeight']=_['isNil'](_0x280e54[_0xe853('0x50')])?_0xe853('0x51'):_0x280e54[_0xe853('0x50')];}break;case _0xe853('0x52'):_0x776043[_0xe853('0x53')]=_0x280e54[_0xe853('0x43')]?Mustache[_0xe853('0x45')](_0x280e54[_0xe853('0x43')],_0x5b1fe4):'';_0x776043[_0xe853('0x54')]=_0x280e54[_0xe853('0x4a')]?Mustache['render'](_0x280e54['data3'],_0x5b1fe4):'';break;}this[_0xe853('0x30')](util[_0xe853('0x55')]('user:%s',this[_0xe853('0xc')][_0x5b1fe4[_0xe853('0x3d')]]['name']),util[_0xe853('0x55')](_0xe853('0x56'),_0x280e54[_0xe853('0x3e')]['toLowerCase'](),barAndWebActions[_0x280e54[_0xe853('0x41')]]),_[_0xe853('0x57')](_0x776043,_0x5b1fe4));break;case'jscripty':this[_0xe853('0x30')](util[_0xe853('0x55')](_0xe853('0x58'),this[_0xe853('0xc')][_0x5b1fe4[_0xe853('0x3d')]][_0xe853('0x59')]),util[_0xe853('0x55')](_0xe853('0x5a'),_0x280e54['action'][_0xe853('0x5b')]()),_[_0xe853('0x57')]({'ProjectId':parseInt(_0x280e54[_0xe853('0x41')],0xa)},_0x5b1fe4));break;default:this[_0xe853('0x30')](util[_0xe853('0x55')](_0xe853('0x58'),this[_0xe853('0xc')][_0x5b1fe4[_0xe853('0x3d')]][_0xe853('0x59')]),util[_0xe853('0x55')](_0xe853('0x5a'),_0x280e54[_0xe853('0x3e')][_0xe853('0x5b')]()),_[_0xe853('0x57')]({},_0x280e54,_0x5b1fe4));}}switch(_0x280e54[_0xe853('0x3e')][_0xe853('0x5b')]()){case'contactmanager':cmContact[_0xe853('0x5c')](this['agents'][_0x5b1fe4[_0xe853('0x3d')]],this[_0xe853('0x36')][_0x5ac611],_0x280e54,_0x5b1fe4);break;case _0xe853('0x5d'):integration['exec'](_0x280e54,_0x5b1fe4,this[_0xe853('0x19')],this[_0xe853('0xc')][_0x5b1fe4['interface']],this['voiceQueues'][_0x5b1fe4[_0xe853('0x5e')]],this[_0xe853('0xf')][_0x5b1fe4['routeId']]);break;case _0xe853('0x5f'):urlforward[_0xe853('0x5c')](_0x280e54,_0x5b1fe4);break;case _0xe853('0x60'):script[_0xe853('0x5c')](_0x280e54,_0x5b1fe4);break;}}}}}}};Trigger[_0xe853('0x2f')][_0xe853('0x48')]=function(_0xd75177,_0x53e1a2,_0x8188fb){var _0x1a88f4=url[_0xe853('0x61')](Mustache[_0xe853('0x45')](_0xd75177,_0x53e1a2),!![]);if(_0x8188fb){_[_0xe853('0x57')](_0x1a88f4['query'],_0x53e1a2);}delete _0x1a88f4['search'];var _0x33d6b7=url[_0xe853('0x55')](_0x1a88f4);_0x33d6b7=_0x33d6b7[_0xe853('0x62')](/\/\?/g,'?');return _0x33d6b7;};Trigger[_0xe853('0x2f')][_0xe853('0x39')]=function(_0x14d636,_0x4f18ec){var _0x300587=!![];var _0x54b058=!![];var _0x444e1f=![];if(_0x14d636[_0xe853('0x63')]===_0x4f18ec['motionChannel']){_0x444e1f=!![];}if(_0x14d636[_0xe853('0x64')][_0xe853('0x3c')]){_0x300587=_['every'](_0x14d636[_0xe853('0x64')],this[_0xe853('0x65')](_0x4f18ec,_0x14d636[_0xe853('0x63')]));}if(_0x14d636['AnyConditions']['length']){_0x54b058=_['some'](_0x14d636[_0xe853('0x66')],this[_0xe853('0x65')](_0x4f18ec,_0x14d636[_0xe853('0x63')]));}return _0x444e1f&&_0x300587&&_0x54b058;};Trigger[_0xe853('0x2f')][_0xe853('0x65')]=function(_0x42869d,_0x3dd9b2){return function(_0x3ce284){switch(_0x3ce284[_0xe853('0x67')]){case _0xe853('0x68'):if(_0x42869d['channel']===_0x3dd9b2){if(_0x3dd9b2===_0xe853('0x69')){return _0x42869d[_0xe853('0x6a')]?operators[_0x3ce284[_0xe853('0x6b')]](Number(_0x3ce284['value']),_0x42869d[_0xe853('0x6a')]):![];}else{return _0x42869d[_[_0xe853('0x6c')](_0x3dd9b2)+_0xe853('0x6d')]?operators[_0x3ce284[_0xe853('0x6b')]](Number(_0x3ce284[_0xe853('0x6e')]),_0x42869d[_[_0xe853('0x6c')](_0x3dd9b2)+_0xe853('0x6d')]):![];}}break;case'interaction':case'message':if(_0x42869d[_0xe853('0x63')]===_0x3dd9b2){return _0x42869d[_0xe853('0x6f')]?operators[_0x3ce284[_0xe853('0x6b')]](_0x3ce284[_0xe853('0x6e')],_0x42869d[_0xe853('0x6f')]):![];}break;case _0xe853('0x5e'):return _0x42869d[_0xe853('0x5e')]?operators[_0x3ce284[_0xe853('0x6b')]](_0x3ce284['value'],_0x42869d[_0xe853('0x5e')]):![];case _0xe853('0x70'):return _0x42869d['membername']?operators[_0x3ce284[_0xe853('0x6b')]](_0x3ce284['value'],_0x42869d[_0xe853('0x71')]):![];case'lastevent':return _0x42869d['lastevent']?operators[_0x3ce284[_0xe853('0x6b')]](_0x3ce284['value'],_0x42869d[_0xe853('0x72')]):![];case'routeId':return _0x42869d['routeId']?operators[_0x3ce284[_0xe853('0x6b')]](_0x3ce284[_0xe853('0x6e')],_0x42869d[_0xe853('0x73')]):![];case _0xe853('0x74'):if(_0x3ce284['value']==='null')_0x3ce284[_0xe853('0x6e')]=null;return typeof _0x42869d['substatus']!==_0xe853('0x34')?operators[_0x3ce284[_0xe853('0x6b')]](_0x3ce284[_0xe853('0x6e')],_0x42869d[_0xe853('0x75')]):![];case _0xe853('0x76'):if(_0x42869d[_0xe853('0x63')]===_0x3dd9b2){return _0x3ce284[_0xe853('0x6e')]==='created'&&_0x3ce284[_0xe853('0x6b')]===_0xe853('0x77')?!![]:![];}break;}return![];};};module[_0xe853('0x78')]=Trigger;
\ No newline at end of file
+var _0x8200=['uriLocation','windowWidth','data5','800','windowHeight','data6','600','winapp','winApplication','winArguments','format','user:%s','name','data1','jscripty','trigger:%s','exec','integration','voiceQueues','queue','routeId','buildUri','parse','query','search','replace','AllConditions','length','checkConditions','AnyConditions','some','channel','field','account','chat','operator','value','upperFirst','AccountId','event','membername','lastevent','null','substatus','offlineMessage','created','exports','util','lodash','url','ioredis','./urlforward','./integration','./script','trigger','redis','defaults','popup','triggers','agents','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','deskAccounts','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','motionChannel','undefined','voice','checkTriggers','syncAgentDial','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','action','toLowerCase','contactmanager','motionbar','browser','TemplateId','html','data2','render','template\x20not\x20found','uri','isNil','data3','data4','location'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8200,0x11f));var _0x0820=function(_0x1b6e27,_0x1a5c32){_0x1b6e27=_0x1b6e27-0x0;var _0x264af4=_0x8200[_0x1b6e27];return _0x264af4;};'use strict';var util=require(_0x0820('0x0'));var _=require(_0x0820('0x1'));var url=require(_0x0820('0x2'));var Mustache=require('mustache');var Redis=require(_0x0820('0x3'));var urlforward=require(_0x0820('0x4'));var integration=require(_0x0820('0x5'));var cmContact=require('./cmContact');var script=require(_0x0820('0x6'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x0820('0x7'));var ami=require('../ami');config[_0x0820('0x8')]=_[_0x0820('0x9')](config[_0x0820('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0820('0x8')]));var operators={'equals':function(_0x5c98a8,_0x2c5639){return _0x5c98a8==_0x2c5639;},'not_equals':function(_0x3a62fb,_0x28e0ac){return _0x3a62fb!=_0x28e0ac;}};var barAndWebActions=[_0x0820('0xa'),_0x0820('0x2'),'winapp'];function Trigger(_0x5c7eb0){this[_0x0820('0xb')]=_0x5c7eb0[_0x0820('0xb')];this[_0x0820('0xc')]=_0x5c7eb0[_0x0820('0xc')];this['voiceQueues']=_0x5c7eb0['voiceQueues'];this[_0x0820('0xd')]=_0x5c7eb0[_0x0820('0xd')];this[_0x0820('0xe')]=_0x5c7eb0[_0x0820('0xe')];this['zendeskAccounts']=_0x5c7eb0[_0x0820('0xf')];this['freshdeskAccounts']=_0x5c7eb0[_0x0820('0x10')];this[_0x0820('0x11')]=_0x5c7eb0['salesforceAccounts'];this[_0x0820('0x12')]=_0x5c7eb0[_0x0820('0x12')];this[_0x0820('0x13')]=_0x5c7eb0[_0x0820('0x13')];this['deskAccounts']=_0x5c7eb0['deskAccounts'];this[_0x0820('0x14')]=_0x5c7eb0['vtigerAccounts'];this['servicenowAccounts']=_0x5c7eb0[_0x0820('0x15')];this[_0x0820('0x16')]=_0x5c7eb0[_0x0820('0x16')];this['freshsalesAccounts']=_0x5c7eb0[_0x0820('0x17')];this[_0x0820('0x18')]={'zendesk':this[_0x0820('0xf')],'salesforce':this[_0x0820('0x11')],'freshdesk':this[_0x0820('0x10')],'sugarcrm':this[_0x0820('0x12')],'zoho':this['zohoAccounts'],'desk':this[_0x0820('0x19')],'vtiger':this[_0x0820('0x14')],'dynamics365':this[_0x0820('0x16')],'freshsales':this[_0x0820('0x17')],'servicenow':this[_0x0820('0x15')]};ami['on']('custom:agentcalled',this[_0x0820('0x1a')]['bind'](this));ami['on']('custom:agentconnect',this[_0x0820('0x1a')][_0x0820('0x1b')](this));ami['on'](_0x0820('0x1c'),this[_0x0820('0x1a')][_0x0820('0x1b')](this));ami['on'](_0x0820('0x1d'),this['syncCustomEvent'][_0x0820('0x1b')](this));ami['on'](_0x0820('0x1e'),this[_0x0820('0x1a')][_0x0820('0x1b')](this));ami['on'](_0x0820('0x1f'),this[_0x0820('0x1a')][_0x0820('0x1b')](this));ami['on']('custom:agentbusy',this[_0x0820('0x1a')][_0x0820('0x1b')](this));ami['on'](_0x0820('0x20'),this[_0x0820('0x1a')][_0x0820('0x1b')](this));ami['on']('custom:agentreject',this[_0x0820('0x1a')]['bind'](this));ami['on'](_0x0820('0x21'),this[_0x0820('0x1a')][_0x0820('0x1b')](this));ami['on'](_0x0820('0x22'),this[_0x0820('0x1a')][_0x0820('0x1b')](this));ami['on'](_0x0820('0x23'),this['syncCustomEvent'][_0x0820('0x1b')](this));ami['on']('custom:dialbegin',this['syncAgentDial'][_0x0820('0x1b')](this));ami['on'](_0x0820('0x24'),this['syncAgentDial'][_0x0820('0x1b')](this));ami['on']('custom:dialend',this['syncAgentDial'][_0x0820('0x1b')](this));ami['on'](_0x0820('0x25'),this['syncCustomEvent'][_0x0820('0x1b')](this));ami['on'](_0x0820('0x26'),this['syncCustomEvent'][_0x0820('0x1b')](this));ami['on'](_0x0820('0x27'),this[_0x0820('0x1a')][_0x0820('0x1b')](this));ami['on'](_0x0820('0x28'),this['syncCustomEvent'][_0x0820('0x1b')](this));ami['on']('custom:outgoingmessage',this[_0x0820('0x1a')][_0x0820('0x1b')](this));ami['on'](_0x0820('0x29'),this['syncCustomEvent'][_0x0820('0x1b')](this));ami['on'](_0x0820('0x2a'),this['syncCustomEvent'][_0x0820('0x1b')](this));ami['on']('custom:offlineMessage',this[_0x0820('0x1a')]['bind'](this));}Trigger[_0x0820('0x2b')][_0x0820('0x2c')]=function(_0x47a2da,_0x5ca189,_0x33068c){logger[_0x0820('0x2d')](_0x47a2da,_0x5ca189,JSON['stringify'](_0x33068c));io['to'](_0x47a2da)[_0x0820('0x2c')](_0x5ca189,_0x33068c);};Trigger[_0x0820('0x2b')][_0x0820('0x1a')]=function(_0xbe39aa){var _0x1573b6=_['clone'](_0xbe39aa);if(typeof _0x1573b6[_0x0820('0x2e')]===_0x0820('0x2f')){_0x1573b6[_0x0820('0x2e')]=_0x0820('0x30');}this[_0x0820('0x31')](_0x1573b6);};Trigger[_0x0820('0x2b')][_0x0820('0x32')]=function(_0x17226f){if(this[_0x0820('0xc')][_0x17226f[_0x0820('0x33')]]){this[_0x0820('0x1a')](_0x17226f);}};Trigger[_0x0820('0x2b')]['checkTriggers']=function(_0x372cf4){var _0x2514ef;for(var _0x5a3863 in this[_0x0820('0xb')]){if(this[_0x0820('0xb')][_0x0820('0x34')](_0x5a3863)){if(this['triggers'][_0x5a3863][_0x0820('0x35')]){_0x2514ef=this[_0x0820('0x36')](this[_0x0820('0xb')][_0x5a3863],_0x372cf4);if(_0x2514ef){_[_0x0820('0x37')](_0x372cf4,_0x372cf4[_0x0820('0x38')]);for(var _0xe55f8=0x0,_0x214ded,_0x30a7db,_0x2ee323;_0xe55f8<this[_0x0820('0xb')][_0x5a3863][_0x0820('0x39')]['length'];_0xe55f8+=0x1){_0x214ded=this[_0x0820('0xb')][_0x5a3863][_0x0820('0x39')][_0xe55f8];if(this[_0x0820('0xc')][_0x372cf4[_0x0820('0x33')]]){switch(_0x214ded[_0x0820('0x3a')][_0x0820('0x3b')]()){case _0x0820('0x3c'):break;case _0x0820('0x3d'):case _0x0820('0x3e'):var _0x19f48f={};switch(barAndWebActions[_0x214ded['data1']]){case _0x0820('0xa'):_0x19f48f[_0x0820('0x3f')]=_0x214ded['data2'];_0x19f48f[_0x0820('0x40')]=this[_0x0820('0xd')][_0x214ded[_0x0820('0x41')]]?Mustache[_0x0820('0x42')](this[_0x0820('0xd')][_0x214ded[_0x0820('0x41')]]['html'],_0x372cf4):_0x0820('0x43');break;case _0x0820('0x2'):_0x19f48f[_0x0820('0x44')]=this['buildUri'](_0x214ded['data2'],_0x372cf4,_[_0x0820('0x45')](_0x214ded['data3'])?!![]:parseInt(_0x214ded[_0x0820('0x46')],0xa));if(_[_0x0820('0x45')](_0x214ded[_0x0820('0x47')])){_0x19f48f[_0x0820('0x48')]='0';}else{_0x19f48f[_0x0820('0x49')]=_0x214ded[_0x0820('0x47')];_0x19f48f[_0x0820('0x4a')]=_[_0x0820('0x45')](_0x214ded[_0x0820('0x4b')])?_0x0820('0x4c'):_0x214ded[_0x0820('0x4b')];_0x19f48f[_0x0820('0x4d')]=_[_0x0820('0x45')](_0x214ded[_0x0820('0x4e')])?_0x0820('0x4f'):_0x214ded[_0x0820('0x4e')];}break;case _0x0820('0x50'):_0x19f48f[_0x0820('0x51')]=_0x214ded['data2']?Mustache[_0x0820('0x42')](_0x214ded[_0x0820('0x41')],_0x372cf4):'';_0x19f48f[_0x0820('0x52')]=_0x214ded[_0x0820('0x46')]?Mustache['render'](_0x214ded[_0x0820('0x46')],_0x372cf4):'';break;}this[_0x0820('0x2c')](util[_0x0820('0x53')](_0x0820('0x54'),this[_0x0820('0xc')][_0x372cf4[_0x0820('0x33')]][_0x0820('0x55')]),util[_0x0820('0x53')]('trigger:%s:%s',_0x214ded[_0x0820('0x3a')][_0x0820('0x3b')](),barAndWebActions[_0x214ded[_0x0820('0x56')]]),_[_0x0820('0x37')](_0x19f48f,_0x372cf4));break;case _0x0820('0x57'):this[_0x0820('0x2c')](util[_0x0820('0x53')]('user:%s',this[_0x0820('0xc')][_0x372cf4['interface']][_0x0820('0x55')]),util['format'](_0x0820('0x58'),_0x214ded[_0x0820('0x3a')][_0x0820('0x3b')]()),_[_0x0820('0x37')]({'ProjectId':parseInt(_0x214ded[_0x0820('0x56')],0xa)},_0x372cf4));break;default:this['emit'](util[_0x0820('0x53')](_0x0820('0x54'),this[_0x0820('0xc')][_0x372cf4[_0x0820('0x33')]][_0x0820('0x55')]),util[_0x0820('0x53')](_0x0820('0x58'),_0x214ded[_0x0820('0x3a')][_0x0820('0x3b')]()),_[_0x0820('0x37')]({},_0x214ded,_0x372cf4));}}switch(_0x214ded['action'][_0x0820('0x3b')]()){case _0x0820('0x3c'):cmContact[_0x0820('0x59')](this[_0x0820('0xc')][_0x372cf4[_0x0820('0x33')]],this[_0x0820('0xb')][_0x5a3863],_0x214ded,_0x372cf4);break;case _0x0820('0x5a'):integration[_0x0820('0x59')](_0x214ded,_0x372cf4,this[_0x0820('0x18')],this['agents'][_0x372cf4[_0x0820('0x33')]],this[_0x0820('0x5b')][_0x372cf4[_0x0820('0x5c')]],this[_0x0820('0xe')][_0x372cf4[_0x0820('0x5d')]]);break;case'urlforward':urlforward[_0x0820('0x59')](_0x214ded,_0x372cf4);break;case'script':script[_0x0820('0x59')](_0x214ded,_0x372cf4);break;}}}}}}};Trigger[_0x0820('0x2b')][_0x0820('0x5e')]=function(_0x3667b3,_0x108ce5,_0x14d6dc){var _0x1c9f68=url[_0x0820('0x5f')](Mustache['render'](_0x3667b3,_0x108ce5),!![]);if(_0x14d6dc){_[_0x0820('0x37')](_0x1c9f68[_0x0820('0x60')],_0x108ce5);}delete _0x1c9f68[_0x0820('0x61')];var _0x3c9aae=url[_0x0820('0x53')](_0x1c9f68);_0x3c9aae=_0x3c9aae[_0x0820('0x62')](/\/\?/g,'?');return _0x3c9aae;};Trigger[_0x0820('0x2b')]['checkTrigger']=function(_0x1d33e8,_0x1073a0){var _0x45fdde=!![];var _0x1d8229=!![];var _0x2a6837=![];if(_0x1d33e8['channel']===_0x1073a0['motionChannel']){_0x2a6837=!![];}if(_0x1d33e8[_0x0820('0x63')][_0x0820('0x64')]){_0x45fdde=_['every'](_0x1d33e8[_0x0820('0x63')],this[_0x0820('0x65')](_0x1073a0,_0x1d33e8['channel']));}if(_0x1d33e8[_0x0820('0x66')][_0x0820('0x64')]){_0x1d8229=_[_0x0820('0x67')](_0x1d33e8['AnyConditions'],this[_0x0820('0x65')](_0x1073a0,_0x1d33e8[_0x0820('0x68')]));}return _0x2a6837&&_0x45fdde&&_0x1d8229;};Trigger[_0x0820('0x2b')]['checkConditions']=function(_0x37a1d2,_0x239fbd){return function(_0x809db0){switch(_0x809db0[_0x0820('0x69')]){case _0x0820('0x6a'):if(_0x37a1d2['channel']===_0x239fbd){if(_0x239fbd===_0x0820('0x6b')){return _0x37a1d2['ChatWebsiteId']?operators[_0x809db0[_0x0820('0x6c')]](Number(_0x809db0[_0x0820('0x6d')]),_0x37a1d2['ChatWebsiteId']):![];}else{return _0x37a1d2[_[_0x0820('0x6e')](_0x239fbd)+_0x0820('0x6f')]?operators[_0x809db0['operator']](Number(_0x809db0['value']),_0x37a1d2[_[_0x0820('0x6e')](_0x239fbd)+_0x0820('0x6f')]):![];}}break;case'interaction':case'message':if(_0x37a1d2[_0x0820('0x68')]===_0x239fbd){return _0x37a1d2[_0x0820('0x70')]?operators[_0x809db0['operator']](_0x809db0['value'],_0x37a1d2['event']):![];}break;case _0x0820('0x5c'):return _0x37a1d2[_0x0820('0x5c')]?operators[_0x809db0['operator']](_0x809db0[_0x0820('0x6d')],_0x37a1d2[_0x0820('0x5c')]):![];case'agent':return _0x37a1d2[_0x0820('0x71')]?operators[_0x809db0[_0x0820('0x6c')]](_0x809db0[_0x0820('0x6d')],_0x37a1d2[_0x0820('0x71')]):![];case _0x0820('0x72'):return _0x37a1d2[_0x0820('0x72')]?operators[_0x809db0[_0x0820('0x6c')]](_0x809db0[_0x0820('0x6d')],_0x37a1d2[_0x0820('0x72')]):![];case _0x0820('0x5d'):return _0x37a1d2['routeId']?operators[_0x809db0[_0x0820('0x6c')]](_0x809db0[_0x0820('0x6d')],_0x37a1d2[_0x0820('0x5d')]):![];case'mailSubstatus':if(_0x809db0[_0x0820('0x6d')]===_0x0820('0x73'))_0x809db0[_0x0820('0x6d')]=null;return typeof _0x37a1d2[_0x0820('0x74')]!==_0x0820('0x2f')?operators[_0x809db0['operator']](_0x809db0[_0x0820('0x6d')],_0x37a1d2[_0x0820('0x74')]):![];case _0x0820('0x75'):if(_0x37a1d2['channel']===_0x239fbd){return _0x809db0[_0x0820('0x6d')]===_0x0820('0x76')&&_0x809db0[_0x0820('0x6c')]==='equals'?!![]:![];}break;}return![];};};module[_0x0820('0x77')]=Trigger;
\ No newline at end of file
index 5e97599..bf3428f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['catch','stringify','unmanaged','lastevent','toUpperCase','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','localhost','validateEmail','info','Getting\x20agent\x20with\x20email','%s/users','then','total_entries','_embedded','entries','Agent\x20found!','format','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','debug','[HTTP]','GET','authType','basic','password','%s/token:%s','Basic\x20%s','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','work','map','length','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','toString','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','xCALLY','concat','Descriptions','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','integrationTab','%s/agent/tickets/%s'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x326f,0xd1));var _0xf326=function(_0xd5c036,_0x1f7a4d){_0xd5c036=_0xd5c036-0x0;var _0x4e1686=_0x326f[_0xd5c036];return _0x4e1686;};'use strict';var _=require(_0xf326('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xf326('0x1'));var Redis=require(_0xf326('0x2'));var intUtil=require(_0xf326('0x3'));var config=require(_0xf326('0x4'));var logger=require(_0xf326('0x5'))(_0xf326('0x6'));config[_0xf326('0x7')]=_[_0xf326('0x8')](config[_0xf326('0x7')],{'host':_0xf326('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf326('0x7')]));function emit(_0x3851eb,_0x165f95,_0x1e7b8a){io['to'](_0x3851eb)['emit'](_0x165f95,_0x1e7b8a);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x3bacf2,_0x1fc80e){if(intUtil[_0xf326('0xa')](_0x1fc80e)===!![]){logger[_0xf326('0xb')](_0xf326('0xc'),_0x1fc80e);return request({'uri':util['format'](_0xf326('0xd'),_0x3bacf2['remoteUri'])})[_0xf326('0xe')](function(_0x4aaf3a){if(_0x4aaf3a[_0xf326('0xf')]){return _['find'](_0x4aaf3a[_0xf326('0x10')][_0xf326('0x11')],{'email':_0x1fc80e});}})['then'](function(_0x342fe5){if(_0x342fe5){logger[_0xf326('0xb')](_0xf326('0x12'));return _0x342fe5;}else{logger[_0xf326('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf326('0x13')]('%s/users/me',_0x3bacf2['remoteUri'])});}});}else{logger[_0xf326('0xb')](_0xf326('0x14'));return request({'uri':util[_0xf326('0x13')](_0xf326('0x15'),_0x3bacf2[_0xf326('0x16')])});}}function request(_0x287a2a){logger[_0xf326('0x17')](_0xf326('0x18'),JSON['stringify'](_0x287a2a));return rp(_[_0xf326('0x8')](_0x287a2a,{'method':_0xf326('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x18bee3){var _0x31ffb9;if(_0x18bee3[_0xf326('0x1a')]===_0xf326('0x1b')){_0x31ffb9=util['format']('%s:%s',_0x18bee3['username'],_0x18bee3[_0xf326('0x1c')]);}else if(_0x18bee3[_0xf326('0x1a')]==='token'){_0x31ffb9=util['format'](_0xf326('0x1d'),_0x18bee3['username'],_0x18bee3['token']);}return util[_0xf326('0x13')](_0xf326('0x1e'),new Buffer(_0x31ffb9)['toString']('base64'));}function getEndUser(_0x19b8ba,_0xb1efcf,_0x5f21a2){logger[_0xf326('0xb')](_0xf326('0x1f'),_0x5f21a2);return request({'uri':util[_0xf326('0x13')](_0xf326('0x20'),_0x19b8ba[_0xf326('0x16')]),'qs':{'phone':_0x5f21a2}})[_0xf326('0xe')](function(_0x5ce532){if(_0x5ce532['total_entries']){logger['info'](_0xf326('0x21'));return _0x5ce532[_0xf326('0x10')][_0xf326('0x11')][0x0];}else{logger[_0xf326('0xb')](_0xf326('0x22'));return request({'uri':util[_0xf326('0x13')]('%s/customers',_0x19b8ba[_0xf326('0x16')]),'method':_0xf326('0x23'),'body':{'first_name':_0xb1efcf,'title':_0xb1efcf,'phone_numbers':[{'type':_0xf326('0x24'),'value':_0x5f21a2}]}});}});}function getTags(_0x581531,_0x1617d2){var _0x55ad0f=[];if(_0x581531&&_0x581531['length']>0x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});};
\ No newline at end of file
+var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','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','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x34b738,_0x4342df){var _0x267772=function(_0x297a5a){while(--_0x297a5a){_0x34b738['push'](_0x34b738['shift']());}};_0x267772(++_0x4342df);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});};
\ No newline at end of file
index d0a4209..d4b4859 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe6c=['nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incidents','getString','Subjects','Descriptions','/contacts(','/systemusers(','Fields','phonecall','callDirection','queue','assign','headers','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','data7','data2','resolve','CloudProvider','data5','clientId','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId','toUpperCase',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','POST','contacts','body','odata-entityid','substring','lastIndexOf','enduserId','calleridnum','telephone1','contacts?$select=','&$filter=','replace','%2b'];(function(_0x3f8f2e,_0x595be3){var _0xdf079f=function(_0x224def){while(--_0x224def){_0x3f8f2e['push'](_0x3f8f2e['shift']());}};_0xdf079f(++_0x595be3);}(_0xbe6c,0xa1));var _0xcbe6=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xbe6c[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0xcbe6('0x0'));var rp=require(_0xcbe6('0x1'));var util=require('util');var intUtil=require(_0xcbe6('0x2'));var md5=require(_0xcbe6('0x3'));var Redis=require(_0xcbe6('0x4'));var logger=require(_0xcbe6('0x5'))(_0xcbe6('0x6'));var config=require(_0xcbe6('0x7'));config[_0xcbe6('0x8')]=_[_0xcbe6('0x9')](config[_0xcbe6('0x8')],{'host':_0xcbe6('0xa'),'port':0x18eb});var io=require(_0xcbe6('0xb'))(new Redis(config[_0xcbe6('0x8')]));function getAuthToken(_0x5b24f6,_0x11b677,_0x3a3af6){if(_0x5b24f6[_0xcbe6('0xc')]){_0x5b24f6[_0xcbe6('0xd')]=_0x5b24f6['CloudProvider'][_0xcbe6('0xe')];_0x5b24f6['tenantId']=_0x5b24f6['CloudProvider'][_0xcbe6('0xf')];return Promise[_0xcbe6('0x10')](_0x5b24f6[_0xcbe6('0x11')][_0xcbe6('0x12')]);}var _0x3e2883={'method':'POST','uri':_0x11b677,'form':{'client_id':_0x5b24f6[_0xcbe6('0x13')],'resource':_0x5b24f6[_0xcbe6('0xd')],'username':_0x5b24f6[_0xcbe6('0x14')],'password':_0x5b24f6[_0xcbe6('0x15')],'grant_type':'password','client_secret':_0x5b24f6[_0xcbe6('0x16')]},'json':!![]};return rp(_0x3e2883)[_0xcbe6('0x17')](function(_0x3a3a39){return _0x3a3a39[_0xcbe6('0x18')];})[_0xcbe6('0x19')](function(_0xbaa760){logger[_0xcbe6('0x1a')]('['+[_0x3a3af6['toUpperCase']()]+_0xcbe6('0x1b'));return _0xbaa760[_0xcbe6('0x1c')];});}function getUser(_0x10a10c,_0x1c6f59,_0x16c0a7,_0x2471f2,_0x501f0c,_0x518d67){return new Promise(function(_0x4421f2,_0x83378c){return getAuthToken(_0x1c6f59,_0x2471f2,_0x518d67)[_0xcbe6('0x17')](function(_0x4ff422){var _0x299970={'method':_0xcbe6('0x1d'),'uri':_0x501f0c+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xcbe6('0x1e')+_0x4ff422,'OData-Version':_0xcbe6('0x1f')},'json':!![]};return rp(_0x299970);})['then'](function(_0x1f2143){var _0x34b4d8=_0x1f2143[_0xcbe6('0x20')];var _0x3296ef=![];var _0x3504e6=null;if(!_[_0xcbe6('0x21')](_0x16c0a7)){if(intUtil[_0xcbe6('0x22')](_0x16c0a7[_0xcbe6('0x23')])){_0x10a10c[_0xcbe6('0x24')]=_0x16c0a7[_0xcbe6('0x23')];for(_0x3504e6=0x0;_0x3504e6<_0x34b4d8[_0xcbe6('0x25')];_0x3504e6++){if(_0x34b4d8[_0x3504e6][_0xcbe6('0x26')]===_0x16c0a7[_0xcbe6('0x23')]&&!_0x34b4d8[_0x3504e6]['isdisabled']){_0x3296ef=!![];logger[_0xcbe6('0x27')]('['+[_0x518d67['toUpperCase']()]+_0xcbe6('0x28')+_0x34b4d8[_0x3504e6][_0xcbe6('0x29')]+'!');_0x10a10c[_0xcbe6('0x2a')]=_0x34b4d8[_0x3504e6][_0xcbe6('0x29')];}}}}if(!_0x3296ef){logger[_0xcbe6('0x27')]('['+[_0x518d67[_0xcbe6('0x2b')]()]+_0xcbe6('0x2c'));_0x10a10c[_0xcbe6('0x24')]=_0x1c6f59[_0xcbe6('0x14')];for(_0x3504e6=0x0;_0x3504e6<_0x34b4d8[_0xcbe6('0x25')];_0x3504e6++){if(_0x34b4d8[_0x3504e6]['internalemailaddress']===_0x1c6f59[_0xcbe6('0x14')]){_0x10a10c[_0xcbe6('0x2a')]=_0x34b4d8[_0x3504e6]['systemuserid'];}}}_0x4421f2(_0x10a10c);})[_0xcbe6('0x19')](function(_0x243aae){_0x83378c(_0x243aae[_0xcbe6('0x1c')]);});});}function createEndUser(_0x3dfe2d,_0x38ee68,_0x49b3e2,_0x5d1ba8,_0x46247e,_0x4fd77a,_0x10bad6){return new Promise(function(_0xdb6a4b,_0x142e70){return getAuthToken(_0x38ee68,_0x49b3e2,_0x4fd77a)[_0xcbe6('0x17')](function(_0xda55cd){var _0x138b69=_0x4fd77a[_0xcbe6('0x2d')]()===_0xcbe6('0x2e')?_0x46247e[_0xcbe6('0x2f')]:_0x46247e['calleridnum'];var _0x2562fe={'method':_0xcbe6('0x30'),'uri':_0x5d1ba8+_0xcbe6('0x31'),'body':{'fullname':_0x138b69,'firstname':_0x138b69,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x3dfe2d[_0xcbe6('0x2a')]+')'},'headers':{'Authorization':_0xcbe6('0x1e')+_0xda55cd,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x2562fe[_0xcbe6('0x32')][_0x10bad6]=_0x138b69;return rp(_0x2562fe);})[_0xcbe6('0x17')](function(_0x2752e1){var _0x2d6d50=_0x2752e1['headers'][_0xcbe6('0x33')];var _0x4fb0ec=_0x2d6d50[_0xcbe6('0x34')](_0x2d6d50[_0xcbe6('0x35')]('(')+0x1,_0x2d6d50[_0xcbe6('0x35')](')'));_0x3dfe2d[_0xcbe6('0x36')]=_0x4fb0ec;_0xdb6a4b(_0x3dfe2d);})[_0xcbe6('0x19')](function(_0x25da61){_0x142e70(_0x25da61[_0xcbe6('0x1c')]);});});}function getEndUser(_0x309b20,_0x353315,_0x94e806,_0x5e7a1d,_0x3fbe9b,_0x34e595,_0x25dbca,_0x4b834c){var _0xc1fb16=_0x34e595[_0xcbe6('0x2d')]()==='outbound'?_0x3fbe9b[_0xcbe6('0x2f')]:_0x3fbe9b[_0xcbe6('0x37')];return getAuthToken(_0x353315,_0x94e806,_0x34e595)[_0xcbe6('0x17')](function(_0x4c4219){_0x4b834c=_0x4b834c?_0x4b834c:_0xcbe6('0x38');var _0xd9b1cd={'method':'GET','uri':_0x5e7a1d+_0xcbe6('0x39')+_0x4b834c+_0xcbe6('0x3a')+_0x4b834c+'\x20eq\x20\x27'+_0xc1fb16[_0xcbe6('0x3b')]('+',_0xcbe6('0x3c'))+'\x27','headers':{'Authorization':_0xcbe6('0x1e')+_0x4c4219,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xd9b1cd);})['then'](function(_0x523c1e){var _0x19fefc=![];if(!_0x523c1e)return _0x19fefc;var _0x3f885b=_0x523c1e[_0xcbe6('0x20')];for(var _0x463ecf=0x0;_0x463ecf<_0x3f885b['length'];_0x463ecf++){if(_0x3f885b[_0x463ecf][_0x4b834c]===_0xc1fb16){_0x19fefc=!![];_0x309b20[_0xcbe6('0x36')]=_0x3f885b[_0x463ecf]['contactid'];}}return _0x19fefc;})['then'](function(_0x4e5f2d){if(_0x4e5f2d)return _0x309b20;if(_0x25dbca===_0xcbe6('0x3d')){logger[_0xcbe6('0x27')]('['+[_0x34e595[_0xcbe6('0x2b')]()]+_0xcbe6('0x3e'));return _0x309b20;}return createEndUser(_0x309b20,_0x353315,_0x94e806,_0x5e7a1d,_0x3fbe9b,_0x34e595,_0x4b834c)[_0xcbe6('0x17')](function(_0x13e2ec){logger[_0xcbe6('0x27')]('['+[_0x34e595[_0xcbe6('0x2b')]()]+_0xcbe6('0x3f'),_0x13e2ec[_0xcbe6('0x36')]);return _0x13e2ec;});});}function getCustomFields(_0x767acf,_0x47faa4,_0x25ee66){var _0x538958={};if(_0x767acf['length']>0x0){_[_0xcbe6('0x40')](_0x767acf,function(_0x450c05){if(_[_0xcbe6('0x41')](['string',_0xcbe6('0x42')],_0x450c05[_0xcbe6('0x43')])&&_0x450c05[_0xcbe6('0x44')]&&!_0x450c05[_0xcbe6('0x45')]){var _0xa6acf4=_0x450c05[_0xcbe6('0x46')][_0xcbe6('0x2d')]();var _0x5d39a4=_0xa6acf4[_0xcbe6('0x34')](0x0,_0xa6acf4[_0xcbe6('0x47')]('_'));var _0x3405f2=_0xa6acf4['substring'](_0xa6acf4[_0xcbe6('0x47')]('_')+0x1);if(_0x5d39a4===_0x25ee66){_0x538958[_0x3405f2]=_0x450c05[_0xcbe6('0x48')];}}});}return _0x538958;}function getTicket(_0x32e420,_0x55f94f,_0x449df0,_0x2d785b,_0x5ce3e9,_0x4b5072,_0x33dad3){return new Promise(function(_0x48b8f9,_0x56a97d){var _0x3b5a12;return getAuthToken(_0x55f94f,_0x449df0,_0x33dad3)[_0xcbe6('0x17')](function(_0x4d9dc9){if(_0x4b5072[_0xcbe6('0x49')]==='incident'){_0x3b5a12={'method':_0xcbe6('0x30'),'uri':_0x2d785b+_0xcbe6('0x4a'),'body':Object['assign']({},{'title':intUtil[_0xcbe6('0x4b')](_0x4b5072[_0xcbe6('0x4c')],_0x5ce3e9,'\x20'),'description':intUtil[_0xcbe6('0x4b')](_0x4b5072[_0xcbe6('0x4d')],_0x5ce3e9,'\x0a'),'customerid_contact@odata.bind':_0x32e420[_0xcbe6('0x36')]?_0xcbe6('0x4e')+_0x32e420[_0xcbe6('0x36')]+')':undefined,'ownerid@odata.bind':_0xcbe6('0x4f')+_0x32e420[_0xcbe6('0x2a')]+')','caseorigincode':'1'},getCustomFields(_0x4b5072[_0xcbe6('0x50')],_0x5ce3e9,_0x4b5072[_0xcbe6('0x49')])),'headers':{'Authorization':_0xcbe6('0x1e')+_0x4d9dc9,'OData-Version':_0xcbe6('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4b5072[_0xcbe6('0x49')]===_0xcbe6('0x51')){var _0x42c28e=_0x32e420[_0xcbe6('0x36')]?[{'partyid_systemuser@odata.bind':_0xcbe6('0x4f')+_0x32e420['userId']+')','participationtypemask':_0x32e420[_0xcbe6('0x52')]===_0xcbe6('0x53')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x32e420['enduserId']+')','participationtypemask':_0x32e420[_0xcbe6('0x52')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xcbe6('0x4f')+_0x32e420[_0xcbe6('0x2a')]+')','participationtypemask':_0x32e420[_0xcbe6('0x52')]===_0xcbe6('0x53')?0x2:0x1}];_0x3b5a12={'method':_0xcbe6('0x30'),'uri':_0x2d785b+'phonecalls','body':Object[_0xcbe6('0x54')]({},{'subject':intUtil[_0xcbe6('0x4b')](_0x4b5072['Subjects'],_0x5ce3e9,'\x20'),'phonenumber':String(_0x5ce3e9['calleridnum']),'description':intUtil[_0xcbe6('0x4b')](_0x4b5072['Descriptions'],_0x5ce3e9,'\x0a'),'regardingobjectid_contact@odata.bind':_0x32e420[_0xcbe6('0x36')]?_0xcbe6('0x4e')+_0x32e420[_0xcbe6('0x36')]+')':undefined,'ownerid@odata.bind':_0xcbe6('0x4f')+_0x32e420[_0xcbe6('0x2a')]+')','directioncode':_0x32e420[_0xcbe6('0x52')]==='queue'?![]:!![],'phonecall_activity_parties':_0x42c28e},getCustomFields(_0x4b5072[_0xcbe6('0x50')],_0x5ce3e9,_0x4b5072['ticketType'])),'headers':{'Authorization':_0xcbe6('0x1e')+_0x4d9dc9,'OData-Version':_0xcbe6('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3b5a12);})[_0xcbe6('0x17')](function(_0x5dc758){var _0x52670e=_0x5dc758[_0xcbe6('0x55')][_0xcbe6('0x33')];var _0x2e707c=_0x52670e['substring'](_0x52670e[_0xcbe6('0x35')]('(')+0x1,_0x52670e['lastIndexOf'](')'));_0x32e420['ticketId']=_0x2e707c;_0x48b8f9(_0x32e420);})['catch'](function(_0x5426ae){_0x56a97d(_0x5426ae[_0xcbe6('0x1c')]);});});}function emit(_0x5b1a94,_0x213768,_0x354f2b,_0x303dc0){var _0x3ce0a7={'uri':util[_0xcbe6('0x56')](_0xcbe6('0x57'),_0x5b1a94,_0x354f2b,_0x303dc0)};io['to'](util['format']('user:%s',_0x213768))[_0xcbe6('0x58')]('trigger:browser:url',_0x3ce0a7);}exports['cs']=function(_0x3d6888,_0x521547,_0xa7182f,_0x4f92bf,_0x37e3c9,_0x359689,_0x191cae,_0x12b43a){var _0x36a49e={};_0x359689[_0xcbe6('0xd')]=_0x359689[_0xcbe6('0xc')]?intUtil[_0xcbe6('0x59')](_0x359689['CloudProvider'][_0xcbe6('0xe')]):intUtil['stripTrailingSlash'](_0x359689[_0xcbe6('0xd')]);_0x359689['serverUrl']=intUtil[_0xcbe6('0x59')](_0x359689[_0xcbe6('0x5a')]);_0x36a49e[_0xcbe6('0x52')]=_0x12b43a===_0xcbe6('0x53')||_0x12b43a===_0xcbe6('0x5b')?_0xcbe6('0x53'):_0xcbe6('0x2e');var _0x2a970a=_0x359689[_0xcbe6('0xc')]?util[_0xcbe6('0x56')](_0xcbe6('0x5c'),_0x359689[_0xcbe6('0x11')][_0xcbe6('0xe')]):util['format'](_0xcbe6('0x5c'),_0x359689['remoteUri']);var _0x1fcb7f=util[_0xcbe6('0x56')](_0xcbe6('0x5d'),_0x359689[_0xcbe6('0x5e')]);var _0x4648ce=util[_0xcbe6('0x56')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x359689[_0xcbe6('0x5a')],_0x521547[_0xcbe6('0x5f')],md5(_0x521547[_0xcbe6('0x5f')]));if(_0x37e3c9&&_0x37e3c9['monitor_format']){logger[_0xcbe6('0x27')](_0xcbe6('0x60'),_0xcbe6('0x61'));_0x521547[_0xcbe6('0x62')]=_0x4648ce;}else if(_0x191cae&&_0x191cae[_0xcbe6('0x63')]&&_0x191cae[_0xcbe6('0x63')]!==_0xcbe6('0x64')){logger[_0xcbe6('0x27')](_0xcbe6('0x65'),_0xcbe6('0x61'));_0x521547[_0xcbe6('0x62')]=_0x4648ce;}else{_0x521547['recordingURL']='';}return getUser(_0x36a49e,_0x359689,_0x4f92bf,_0x1fcb7f,_0x2a970a,_0x12b43a)[_0xcbe6('0x17')](function(_0x609518){logger['info']('['+_0x12b43a['toUpperCase']()+_0xcbe6('0x66'),_0x609518[_0xcbe6('0x2a')]);logger[_0xcbe6('0x27')]('['+_0x12b43a[_0xcbe6('0x2b')]()+']\x20The\x20User\x20email\x20is:',_0x609518[_0xcbe6('0x24')]);return getEndUser(_0x609518,_0x359689,_0x1fcb7f,_0x2a970a,_0x521547,_0x12b43a,_0xa7182f[_0xcbe6('0x67')],_0xa7182f[_0xcbe6('0x68')]);})[_0xcbe6('0x17')](function(_0x11d542){logger[_0xcbe6('0x27')]('['+_0x12b43a[_0xcbe6('0x2b')]()+_0xcbe6('0x69'),_0x11d542['enduserId']);logger[_0xcbe6('0x27')]('['+_0x12b43a['toUpperCase']()+_0xcbe6('0x6a'),_0x521547[_0xcbe6('0x37')]);return getTicket(_0x11d542,_0x359689,_0x1fcb7f,_0x2a970a,_0x521547,_0xa7182f,_0x12b43a);})[_0xcbe6('0x17')](function(_0x4a50d1){logger[_0xcbe6('0x27')](util[_0xcbe6('0x56')]('['+_0x12b43a[_0xcbe6('0x2b')]()+_0xcbe6('0x6b'),_0xa7182f[_0xcbe6('0x49')],_0x4a50d1[_0xcbe6('0x6c')]));logger[_0xcbe6('0x27')](util['format']('['+_0x12b43a[_0xcbe6('0x2b')]()+']\x20Call\x20direction:\x20%s',_0x12b43a));if(_0x12b43a!=='unmanaged'){logger[_0xcbe6('0x27')]('['+_0x12b43a['toUpperCase']()+']',_0xcbe6('0x6d'));emit(_0x359689[_0xcbe6('0xd')],_0x4f92bf[_0xcbe6('0x6e')],_0xa7182f[_0xcbe6('0x49')],_0x4a50d1['ticketId']);}})['catch'](function(_0x440185){logger[_0xcbe6('0x1a')]('['+_0x12b43a[_0xcbe6('0x2b')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x440185['message']);});};
\ No newline at end of file
+var _0x1885=['additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','util','./util','md5','ioredis','dynamics365','redis','localhost','socket.io-emitter','modernAuthentication','CloudProvider','data7','tenantId','resolve','clientId','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','email','length','internalemailaddress','info','systemuserid','username','userId','toLowerCase','outbound','destcalleridnum','contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','calleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','%2b','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','includes','string','picklist','type','nameField','customField','idField','indexOf','ticketType','incident','POST','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','callDirection','queue','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','trigger:browser:url','stripTrailingSlash','remoteUri','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','userEmail','moduleCreate'];(function(_0xa5e9a7,_0xa90f98){var _0x50927d=function(_0x44bab7){while(--_0x44bab7){_0xa5e9a7['push'](_0xa5e9a7['shift']());}};_0x50927d(++_0xa90f98);}(_0x1885,0x6c));var _0x5188=function(_0x4c5376,_0x2cebfa){_0x4c5376=_0x4c5376-0x0;var _0x223416=_0x1885[_0x4c5376];return _0x223416;};'use strict';var _=require(_0x5188('0x0'));var rp=require(_0x5188('0x1'));var util=require(_0x5188('0x2'));var intUtil=require(_0x5188('0x3'));var md5=require(_0x5188('0x4'));var Redis=require(_0x5188('0x5'));var logger=require('../../../../config/logger')(_0x5188('0x6'));var config=require('../../../../config/environment');config[_0x5188('0x7')]=_['defaults'](config['redis'],{'host':_0x5188('0x8'),'port':0x18eb});var io=require(_0x5188('0x9'))(new Redis(config[_0x5188('0x7')]));function getAuthToken(_0x4d08ef,_0x8d1663,_0x14f1e8){if(_0x4d08ef[_0x5188('0xa')]){_0x4d08ef['remoteUri']=_0x4d08ef[_0x5188('0xb')][_0x5188('0xc')];_0x4d08ef[_0x5188('0xd')]=_0x4d08ef[_0x5188('0xb')]['data2'];return Promise[_0x5188('0xe')](_0x4d08ef[_0x5188('0xb')]['data5']);}var _0x5af13c={'method':'POST','uri':_0x8d1663,'form':{'client_id':_0x4d08ef[_0x5188('0xf')],'resource':_0x4d08ef['remoteUri'],'username':_0x4d08ef['username'],'password':_0x4d08ef['password'],'grant_type':'password','client_secret':_0x4d08ef[_0x5188('0x10')]},'json':!![]};return rp(_0x5af13c)[_0x5188('0x11')](function(_0x38e120){return _0x38e120[_0x5188('0x12')];})[_0x5188('0x13')](function(_0x532613){logger[_0x5188('0x14')]('['+[_0x14f1e8[_0x5188('0x15')]()]+_0x5188('0x16'));return _0x532613[_0x5188('0x17')];});}function getUser(_0x19fbea,_0x336db8,_0x1d113b,_0x5ab03e,_0x46bb16,_0x25f115){return new Promise(function(_0x1f9eee,_0x54c702){return getAuthToken(_0x336db8,_0x5ab03e,_0x25f115)['then'](function(_0x488a86){var _0x53cdbd={'method':_0x5188('0x18'),'uri':_0x46bb16+_0x5188('0x19'),'headers':{'Authorization':_0x5188('0x1a')+_0x488a86,'OData-Version':_0x5188('0x1b')},'json':!![]};return rp(_0x53cdbd);})[_0x5188('0x11')](function(_0x2ea9bc){var _0x532fa7=_0x2ea9bc[_0x5188('0x1c')];var _0x476a1c=![];var _0x4137fc=null;if(!_[_0x5188('0x1d')](_0x1d113b)){if(intUtil['validateEmail'](_0x1d113b[_0x5188('0x1e')])){_0x19fbea['userEmail']=_0x1d113b[_0x5188('0x1e')];for(_0x4137fc=0x0;_0x4137fc<_0x532fa7[_0x5188('0x1f')];_0x4137fc++){if(_0x532fa7[_0x4137fc][_0x5188('0x20')]===_0x1d113b[_0x5188('0x1e')]&&!_0x532fa7[_0x4137fc]['isdisabled']){_0x476a1c=!![];logger[_0x5188('0x21')]('['+[_0x25f115['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x532fa7[_0x4137fc][_0x5188('0x22')]+'!');_0x19fbea['userId']=_0x532fa7[_0x4137fc][_0x5188('0x22')];}}}}if(!_0x476a1c){logger['info']('['+[_0x25f115[_0x5188('0x15')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x19fbea['userEmail']=_0x336db8[_0x5188('0x23')];for(_0x4137fc=0x0;_0x4137fc<_0x532fa7[_0x5188('0x1f')];_0x4137fc++){if(_0x532fa7[_0x4137fc][_0x5188('0x20')]===_0x336db8[_0x5188('0x23')]){_0x19fbea[_0x5188('0x24')]=_0x532fa7[_0x4137fc][_0x5188('0x22')];}}}_0x1f9eee(_0x19fbea);})[_0x5188('0x13')](function(_0x2339df){_0x54c702(_0x2339df['message']);});});}function createEndUser(_0x2932cf,_0x48e46f,_0x5eba49,_0x141b18,_0x29a372,_0x102210,_0x5c2da3){return new Promise(function(_0x2681b1,_0x376587){return getAuthToken(_0x48e46f,_0x5eba49,_0x102210)['then'](function(_0x17fdab){var _0x54aa72=_0x102210[_0x5188('0x25')]()===_0x5188('0x26')?_0x29a372[_0x5188('0x27')]:_0x29a372['calleridnum'];var _0x46e9ab={'method':'POST','uri':_0x141b18+_0x5188('0x28'),'body':{'fullname':_0x54aa72,'firstname':_0x54aa72,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x5188('0x29')+_0x2932cf[_0x5188('0x24')]+')'},'headers':{'Authorization':_0x5188('0x1a')+_0x17fdab,'OData-Version':_0x5188('0x1b')},'json':!![],'resolveWithFullResponse':!![]};_0x46e9ab[_0x5188('0x2a')][_0x5c2da3]=_0x54aa72;return rp(_0x46e9ab);})[_0x5188('0x11')](function(_0x585555){var _0x5a589a=_0x585555[_0x5188('0x2b')][_0x5188('0x2c')];var _0x169eee=_0x5a589a[_0x5188('0x2d')](_0x5a589a['lastIndexOf']('(')+0x1,_0x5a589a[_0x5188('0x2e')](')'));_0x2932cf[_0x5188('0x2f')]=_0x169eee;_0x2681b1(_0x2932cf);})[_0x5188('0x13')](function(_0x14f621){_0x376587(_0x14f621[_0x5188('0x17')]);});});}function getEndUser(_0x505dfa,_0x4bf990,_0xfc2240,_0xebdf7,_0x2111e2,_0x1a32fc,_0x1665e4,_0x39f0cf){var _0x2abefb=_0x1a32fc[_0x5188('0x25')]()==='outbound'?_0x2111e2[_0x5188('0x27')]:_0x2111e2[_0x5188('0x30')];return getAuthToken(_0x4bf990,_0xfc2240,_0x1a32fc)['then'](function(_0x55621d){_0x39f0cf=_0x39f0cf?_0x39f0cf:_0x5188('0x31');var _0x3c2f01={'method':_0x5188('0x18'),'uri':_0xebdf7+_0x5188('0x32')+_0x39f0cf+_0x5188('0x33')+_0x39f0cf+_0x5188('0x34')+_0x2abefb['replace']('+',_0x5188('0x35'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x55621d,'If-None-Match':null,'OData-Version':_0x5188('0x1b')},'json':!![]};return rp(_0x3c2f01);})[_0x5188('0x11')](function(_0x18fc09){var _0x3c5572=![];if(!_0x18fc09)return _0x3c5572;var _0x1c1264=_0x18fc09[_0x5188('0x1c')];for(var _0x2161e6=0x0;_0x2161e6<_0x1c1264['length'];_0x2161e6++){if(_0x1c1264[_0x2161e6][_0x39f0cf]===_0x2abefb){_0x3c5572=!![];_0x505dfa['enduserId']=_0x1c1264[_0x2161e6]['contactid'];}}return _0x3c5572;})[_0x5188('0x11')](function(_0x1b5719){if(_0x1b5719)return _0x505dfa;if(_0x1665e4===_0x5188('0x36')){logger[_0x5188('0x21')]('['+[_0x1a32fc[_0x5188('0x15')]()]+_0x5188('0x37'));return _0x505dfa;}return createEndUser(_0x505dfa,_0x4bf990,_0xfc2240,_0xebdf7,_0x2111e2,_0x1a32fc,_0x39f0cf)[_0x5188('0x11')](function(_0x17eab5){logger[_0x5188('0x21')]('['+[_0x1a32fc['toUpperCase']()]+']\x20Enduser\x20created!',_0x17eab5[_0x5188('0x2f')]);return _0x17eab5;});});}function getCustomFields(_0x3ae1c0,_0x528867,_0x333ac6){var _0x19bff6={};if(_0x3ae1c0[_0x5188('0x1f')]>0x0){_['forEach'](_0x3ae1c0,function(_0x944de0){if(_[_0x5188('0x38')]([_0x5188('0x39'),_0x5188('0x3a')],_0x944de0[_0x5188('0x3b')])&&_0x944de0[_0x5188('0x3c')]&&!_0x944de0[_0x5188('0x3d')]){var _0x1390e1=_0x944de0[_0x5188('0x3e')]['toLowerCase']();var _0xa1b0eb=_0x1390e1[_0x5188('0x2d')](0x0,_0x1390e1[_0x5188('0x3f')]('_'));var _0x5d32bf=_0x1390e1[_0x5188('0x2d')](_0x1390e1[_0x5188('0x3f')]('_')+0x1);if(_0xa1b0eb===_0x333ac6){_0x19bff6[_0x5d32bf]=_0x944de0['content'];}}});}return _0x19bff6;}function getTicket(_0x29c095,_0x5a5631,_0x2f04bc,_0x3cb462,_0x25940a,_0x525a42,_0x4fd055){return new Promise(function(_0x39af51,_0x5ba7fe){var _0x3d1280;return getAuthToken(_0x5a5631,_0x2f04bc,_0x4fd055)['then'](function(_0x208b0e){if(_0x525a42[_0x5188('0x40')]===_0x5188('0x41')){_0x3d1280={'method':_0x5188('0x42'),'uri':_0x3cb462+_0x5188('0x43'),'body':Object[_0x5188('0x44')]({},{'title':intUtil[_0x5188('0x45')](_0x525a42[_0x5188('0x46')],_0x25940a,'\x20'),'description':intUtil[_0x5188('0x45')](_0x525a42[_0x5188('0x47')],_0x25940a,'\x0a'),'customerid_contact@odata.bind':_0x29c095['enduserId']?_0x5188('0x48')+_0x29c095[_0x5188('0x2f')]+')':undefined,'ownerid@odata.bind':_0x5188('0x29')+_0x29c095['userId']+')','caseorigincode':'1'},getCustomFields(_0x525a42[_0x5188('0x49')],_0x25940a,_0x525a42[_0x5188('0x40')])),'headers':{'Authorization':_0x5188('0x1a')+_0x208b0e,'OData-Version':_0x5188('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x525a42['ticketType']==='phonecall'){var _0x21be3b=_0x29c095[_0x5188('0x2f')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x29c095['userId']+')','participationtypemask':_0x29c095[_0x5188('0x4a')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x5188('0x48')+_0x29c095[_0x5188('0x2f')]+')','participationtypemask':_0x29c095[_0x5188('0x4a')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x5188('0x29')+_0x29c095[_0x5188('0x24')]+')','participationtypemask':_0x29c095[_0x5188('0x4a')]===_0x5188('0x4b')?0x2:0x1}];_0x3d1280={'method':_0x5188('0x42'),'uri':_0x3cb462+'phonecalls','body':Object[_0x5188('0x44')]({},{'subject':intUtil[_0x5188('0x45')](_0x525a42[_0x5188('0x46')],_0x25940a,'\x20'),'phonenumber':String(_0x25940a[_0x5188('0x30')]),'description':intUtil['getString'](_0x525a42[_0x5188('0x47')],_0x25940a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x29c095['enduserId']?_0x5188('0x48')+_0x29c095[_0x5188('0x2f')]+')':undefined,'ownerid@odata.bind':_0x5188('0x29')+_0x29c095[_0x5188('0x24')]+')','directioncode':_0x29c095['callDirection']===_0x5188('0x4b')?![]:!![],'phonecall_activity_parties':_0x21be3b},getCustomFields(_0x525a42[_0x5188('0x49')],_0x25940a,_0x525a42[_0x5188('0x40')])),'headers':{'Authorization':_0x5188('0x1a')+_0x208b0e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3d1280);})['then'](function(_0x332654){var _0x41ed97=_0x332654[_0x5188('0x2b')][_0x5188('0x2c')];var _0x132d00=_0x41ed97[_0x5188('0x2d')](_0x41ed97[_0x5188('0x2e')]('(')+0x1,_0x41ed97[_0x5188('0x2e')](')'));_0x29c095[_0x5188('0x4c')]=_0x132d00;_0x39af51(_0x29c095);})[_0x5188('0x13')](function(_0x6e064){_0x5ba7fe(_0x6e064[_0x5188('0x17')]);});});}function emit(_0x5d217b,_0x2a7940,_0x136a47,_0x13fe06){var _0x5808bd={'uri':util['format'](_0x5188('0x4d'),_0x5d217b,_0x136a47,_0x13fe06)};io['to'](util[_0x5188('0x4e')](_0x5188('0x4f'),_0x2a7940))['emit'](_0x5188('0x50'),_0x5808bd);}exports['cs']=function(_0x3ef1d0,_0x40a1b5,_0x262d0f,_0xeb42b6,_0x309f94,_0x18138c,_0x45b9a6,_0x1598ed){var _0x48d27a={};_0x18138c['remoteUri']=_0x18138c[_0x5188('0xa')]?intUtil['stripTrailingSlash'](_0x18138c['CloudProvider'][_0x5188('0xc')]):intUtil[_0x5188('0x51')](_0x18138c[_0x5188('0x52')]);_0x18138c[_0x5188('0x53')]=intUtil['stripTrailingSlash'](_0x18138c['serverUrl']);_0x48d27a[_0x5188('0x4a')]=_0x1598ed===_0x5188('0x4b')||_0x1598ed===_0x5188('0x54')?_0x5188('0x4b'):_0x5188('0x26');var _0x45962c=_0x18138c[_0x5188('0xa')]?util['format']('%s/api/data/v9.0/',_0x18138c[_0x5188('0xb')][_0x5188('0xc')]):util[_0x5188('0x4e')](_0x5188('0x55'),_0x18138c[_0x5188('0x52')]);var _0x1460a3=util[_0x5188('0x4e')](_0x5188('0x56'),_0x18138c[_0x5188('0xd')]);var _0xbc416=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x18138c[_0x5188('0x53')],_0x40a1b5[_0x5188('0x57')],md5(_0x40a1b5[_0x5188('0x57')]));if(_0x309f94&&_0x309f94[_0x5188('0x58')]){logger[_0x5188('0x21')]('[QUEUE]',_0x5188('0x59'));_0x40a1b5[_0x5188('0x5a')]=_0xbc416;}else if(_0x45b9a6&&_0x45b9a6['recordingFormat']&&_0x45b9a6[_0x5188('0x5b')]!==_0x5188('0x5c')){logger[_0x5188('0x21')](_0x5188('0x5d'),_0x5188('0x59'));_0x40a1b5[_0x5188('0x5a')]=_0xbc416;}else{_0x40a1b5[_0x5188('0x5a')]='';}return getUser(_0x48d27a,_0x18138c,_0xeb42b6,_0x1460a3,_0x45962c,_0x1598ed)['then'](function(_0x589f78){logger[_0x5188('0x21')]('['+_0x1598ed[_0x5188('0x15')]()+_0x5188('0x5e'),_0x589f78[_0x5188('0x24')]);logger['info']('['+_0x1598ed['toUpperCase']()+_0x5188('0x5f'),_0x589f78[_0x5188('0x60')]);return getEndUser(_0x589f78,_0x18138c,_0x1460a3,_0x45962c,_0x40a1b5,_0x1598ed,_0x262d0f[_0x5188('0x61')],_0x262d0f[_0x5188('0x62')]);})[_0x5188('0x11')](function(_0x187cc6){logger[_0x5188('0x21')]('['+_0x1598ed[_0x5188('0x15')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x187cc6[_0x5188('0x2f')]);logger[_0x5188('0x21')]('['+_0x1598ed['toUpperCase']()+_0x5188('0x63'),_0x40a1b5[_0x5188('0x30')]);return getTicket(_0x187cc6,_0x18138c,_0x1460a3,_0x45962c,_0x40a1b5,_0x262d0f,_0x1598ed);})[_0x5188('0x11')](function(_0x28c0a0){logger[_0x5188('0x21')](util[_0x5188('0x4e')]('['+_0x1598ed['toUpperCase']()+_0x5188('0x64'),_0x262d0f['ticketType'],_0x28c0a0['ticketId']));logger['info'](util['format']('['+_0x1598ed[_0x5188('0x15')]()+']\x20Call\x20direction:\x20%s',_0x1598ed));if(_0x1598ed!==_0x5188('0x54')){logger['info']('['+_0x1598ed['toUpperCase']()+']',_0x5188('0x65'));emit(_0x18138c['remoteUri'],_0xeb42b6[_0x5188('0x66')],_0x262d0f[_0x5188('0x40')],_0x28c0a0[_0x5188('0x4c')]);}})[_0x5188('0x13')](function(_0x173a14){logger[_0x5188('0x14')]('['+_0x1598ed[_0x5188('0x15')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x173a14[_0x5188('0x17')]);});};
\ No newline at end of file
index f0d3785..17d75c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6378=['calleridname','calleridnum','Subjects','<br>','Tags','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','Ticket\x20created!','validateEmail','then','length','Agent\x20found!','find','contact','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','idField','push','content','variable','variableName','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','unmanaged','lastevent','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lodash','util','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format'];(function(_0x49f24b,_0x2416fa){var _0x2059d0=function(_0x1cb03e){while(--_0x1cb03e){_0x49f24b['push'](_0x49f24b['shift']());}};_0x2059d0(++_0x2416fa);}(_0x6378,0x165));var _0x8637=function(_0x108bfd,_0x4a0458){_0x108bfd=_0x108bfd-0x0;var _0x2d1c9a=_0x6378[_0x108bfd];return _0x2d1c9a;};'use strict';var _=require(_0x8637('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x8637('0x1'));var Redis=require(_0x8637('0x2'));var intUtil=require(_0x8637('0x3'));var config=require('../../../../config/environment');var logger=require(_0x8637('0x4'))(_0x8637('0x5'));config[_0x8637('0x6')]=_[_0x8637('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8637('0x8'))(new Redis(config[_0x8637('0x6')]));var headers={'Content-Type':_0x8637('0x9'),'Accept':'application/json'};function emit(_0x19244a,_0x550ee1,_0x2ca60d){io['to'](_0x19244a)[_0x8637('0xa')](_0x550ee1,_0x2ca60d);}function getTicket(_0x4dd2e5,_0x33e482,_0x325e57,_0x5baafd,_0x413ab9){logger[_0x8637('0xb')](_0x8637('0xc'));var _0x2084a2=_[_0x8637('0xd')]({'responder_id':_0x33e482['id'],'requester_id':_0x325e57['id'],'name':util[_0x8637('0xe')]('Caller\x20-\x20%s',_0x413ab9[_0x8637('0xf')]),'phone':_0x413ab9[_0x8637('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x5baafd[_0x8637('0x11')],_0x413ab9,'\x20'),'description':intUtil['getString'](_0x5baafd['Descriptions'],_0x413ab9,_0x8637('0x12')),'tags':getTags(_0x5baafd[_0x8637('0x13')],'name')},getCustomFields(_0x5baafd[_0x8637('0x14')],_0x413ab9));_0x2084a2[_0x8637('0x15')]=_[_0x8637('0x16')](_[_0x8637('0x17')](_0x2084a2[_0x8637('0x15')],'id'),_0x8637('0x18'));return request({'uri':util[_0x8637('0xe')](_0x8637('0x19'),_0x4dd2e5[_0x8637('0x1a')]),'method':_0x8637('0x1b'),'body':_0x2084a2})['then'](function(_0xda658d){logger[_0x8637('0xb')](_0x8637('0x1c'));return _0xda658d;});}function getUser(_0x1295dc,_0x1fd871){if(intUtil[_0x8637('0x1d')](_0x1fd871)){return request({'uri':util['format']('%s/api/v2/agents',_0x1295dc[_0x8637('0x1a')]),'qs':{'email':_0x1fd871}})[_0x8637('0x1e')](function(_0x276a81){if(_0x276a81[_0x8637('0x1f')]){logger['info'](_0x8637('0x20'));return _[_0x8637('0x21')](_0x276a81,function(_0x4b99f5){return _0x4b99f5[_0x8637('0x22')]['email']===_0x1fd871;});}else{logger[_0x8637('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x8637('0xe')](_0x8637('0x23'),_0x1295dc[_0x8637('0x1a')])})[_0x8637('0x1e')](function(_0x2d2819){logger[_0x8637('0xb')](_0x8637('0x24'));return _0x2d2819;});}});}else{logger[_0x8637('0xb')](_0x8637('0x25'));return request({'uri':util['format'](_0x8637('0x23'),_0x1295dc[_0x8637('0x1a')])})['then'](function(_0x4e8b8d){logger[_0x8637('0xb')](_0x8637('0x24'));return _0x4e8b8d;});}}function getEndUser(_0x51caef,_0x39222a,_0x373c9c){logger[_0x8637('0xb')](_0x8637('0x26'),_0x373c9c);return request({'uri':util[_0x8637('0xe')](_0x8637('0x27'),_0x51caef[_0x8637('0x1a')]),'qs':{'phone':_0x373c9c}})[_0x8637('0x1e')](function(_0x321251){if(_0x321251[_0x8637('0x1f')]){logger[_0x8637('0xb')](_0x8637('0x28'));return _[_0x8637('0x21')](_0x321251,{'phone':_0x373c9c});}else{logger[_0x8637('0xb')](_0x8637('0x29'));return request({'uri':util['format']('%s/api/v2/contacts',_0x51caef[_0x8637('0x1a')]),'method':_0x8637('0x1b'),'body':{'name':_0x39222a,'phone':_0x373c9c}})['then'](function(_0x3e900d){logger['info'](_0x8637('0x2a'));return _0x3e900d;});}});}function getAuth(_0x13a4f5){return util[_0x8637('0xe')](_0x8637('0x2b'),new Buffer(_0x13a4f5['apiKey']+':X')[_0x8637('0x2c')](_0x8637('0x2d')));}function request(_0x345778){logger[_0x8637('0x2e')](_0x8637('0x2f'),JSON[_0x8637('0x30')](_0x345778));return rp(_[_0x8637('0x7')](_0x345778,{'method':_0x8637('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x2d73bc,_0x1da579){var _0x400755=[];if(_0x2d73bc&&_0x2d73bc[_0x8637('0x1f')]>0x0){_0x400755=_['map'](_0x2d73bc,_0x1da579);}return _0x400755;}function getCustomFields(_0x4ae8d5,_0x202b58){var _0x470503=[];var _0xb4d044={'custom_fields':[]};if(_0x4ae8d5[_0x8637('0x1f')]>0x0){_[_0x8637('0x32')](_0x4ae8d5,function(_0x132df6){if(_[_0x8637('0x33')]([_0x8637('0x34'),_0x8637('0x35')],_0x132df6[_0x8637('0x36')])&&_0x132df6['nameField']&&!_0x132df6[_0x8637('0x37')]){_0xb4d044[_0x132df6[_0x8637('0x38')][_0x8637('0x39')]()]=_0x132df6['content'][_0x8637('0x2c')]();}else if(_[_0x8637('0x33')]([_0x8637('0x34'),_0x8637('0x35')],_0x132df6[_0x8637('0x36')])&&_0x132df6[_0x8637('0x3a')]&&_0x132df6[_0x8637('0x37')]){_0xb4d044[_0x8637('0x15')][_0x8637('0x3b')]({'id':_0x132df6[_0x8637('0x3a')],'value':_0x132df6[_0x8637('0x3c')]['toString']()});}else if(_0x132df6[_0x8637('0x36')]===_0x8637('0x3d')&&_0x132df6['variableName']&&_0x132df6[_0x8637('0x3a')]&&_0x132df6['customField']){_0x202b58[_0x132df6[_0x8637('0x3e')]]&&_0xb4d044[_0x8637('0x15')][_0x8637('0x3b')]({'id':_0x132df6['idField'],'value':_0x202b58[_0x132df6['variableName']][_0x8637('0x2c')]()});}else if(_0x132df6['type']==='customVariable'&&_0x132df6[_0x8637('0x3f')]&&_0x132df6[_0x8637('0x3f')]['name']&&_0x132df6[_0x8637('0x3a')]&&_0x132df6[_0x8637('0x37')]){_0x202b58[_0x132df6[_0x8637('0x3f')][_0x8637('0x40')][_0x8637('0x39')]()]&&_0xb4d044[_0x8637('0x15')][_0x8637('0x3b')]({'id':_0x132df6[_0x8637('0x3a')],'value':_0x202b58[_0x132df6[_0x8637('0x3f')][_0x8637('0x40')][_0x8637('0x39')]()][_0x8637('0x2c')]()});}});}return _0xb4d044;}exports[_0x8637('0x41')]=function(_0x3b5559,_0x587ecb,_0x1b4cd8,_0x38d4a5,_0x24927c,_0x525c77){var _0x57d894,_0x1565cb;_0x525c77[_0x8637('0x1a')]=intUtil[_0x8637('0x42')](_0x525c77[_0x8637('0x1a')]);_0x525c77[_0x8637('0x43')]=intUtil[_0x8637('0x42')](_0x525c77[_0x8637('0x43')]);if(_0x24927c&&_0x24927c[_0x8637('0x44')]){logger['info'](_0x8637('0x45'),_0x8637('0x46'));_0x587ecb[_0x8637('0x47')]=util[_0x8637('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x525c77[_0x8637('0x43')],_0x587ecb['uniqueid'],md5(_0x587ecb['uniqueid']));}else{_0x587ecb[_0x8637('0x47')]='';}headers[_0x8637('0x48')]=getAuth(_0x525c77);return getUser(_0x525c77,_0x38d4a5[_0x8637('0x49')])[_0x8637('0x1e')](function(_0x3df1f3){_0x57d894=_0x3df1f3;logger[_0x8637('0xb')](_0x8637('0x4a'),_0x57d894['id']);return getEndUser(_0x525c77,_0x587ecb[_0x8637('0xf')],_0x587ecb[_0x8637('0x10')]);})[_0x8637('0x1e')](function(_0x143fcd){_0x1565cb=_0x143fcd;logger[_0x8637('0xb')](_0x8637('0x4b'),_0x1565cb['id']);return getTicket(_0x525c77,_0x57d894,_0x1565cb,_0x1b4cd8,_0x587ecb);})[_0x8637('0x1e')](function(_0x2238f8){if(_0x2238f8&&_0x2238f8['id']){logger[_0x8637('0xb')]('Ticket\x20created!');logger[_0x8637('0xb')]('The\x20Ticket\x20ID\x20is:',_0x2238f8['id']);logger['info'](_0x8637('0x45'),_0x8637('0x4c'));emit(util[_0x8637('0xe')](_0x8637('0x4d'),_0x38d4a5[_0x8637('0x40')]),_0x8637('0x4e'),{'uri':util[_0x8637('0xe')](_0x8637('0x4f'),_0x525c77[_0x8637('0x1a')],_0x2238f8['id'])});}})[_0x8637('0x50')](function(_0x289b7f){logger[_0x8637('0x51')](_0x8637('0x45'),JSON['stringify'](_0x289b7f));});};exports[_0x8637('0x52')]=function(_0x4411ca,_0x2f9e7c,_0x56a667,_0x31291c,_0x16caa9,_0x299c25,_0x37fb71){var _0x24b564,_0xd1712c;_0x299c25['remoteUri']=intUtil[_0x8637('0x42')](_0x299c25['remoteUri']);_0x299c25['serverUrl']=intUtil[_0x8637('0x42')](_0x299c25[_0x8637('0x43')]);if(_0x37fb71&&_0x37fb71[_0x8637('0x53')]&&_0x37fb71[_0x8637('0x53')]!==_0x8637('0x54')){logger[_0x8637('0xb')](_0x8637('0x55'),_0x8637('0x46'));_0x2f9e7c[_0x8637('0x47')]=util[_0x8637('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x299c25[_0x8637('0x43')],_0x2f9e7c[_0x8637('0x56')],md5(_0x2f9e7c[_0x8637('0x56')]));}headers[_0x8637('0x48')]=getAuth(_0x299c25);return getUser(_0x299c25,_0x31291c[_0x8637('0x49')])[_0x8637('0x1e')](function(_0x34fb70){_0x24b564=_0x34fb70;logger['info'](_0x8637('0x4a'),_0x24b564['id']);return getEndUser(_0x299c25,_0x2f9e7c[_0x8637('0x57')],_0x2f9e7c[_0x8637('0x58')]);})[_0x8637('0x1e')](function(_0x3a69eb){_0xd1712c=_0x3a69eb;logger[_0x8637('0xb')](_0x8637('0x4b'),_0xd1712c['id']);return getTicket(_0x299c25,_0x24b564,_0xd1712c,_0x56a667,_0x2f9e7c);})['then'](function(_0x444854){if(_0x444854&&_0x444854['id']){logger[_0x8637('0xb')](_0x8637('0x1c'));logger['info'](_0x8637('0x59'),_0x444854['id']);logger['info'](_0x8637('0x55'),_0x8637('0x4c'));emit(util['format'](_0x8637('0x4d'),_0x31291c[_0x8637('0x40')]),'trigger:browser:url',{'uri':util['format']('%s/helpdesk/tickets/%d',_0x299c25['remoteUri'],_0x444854['id'])});}})[_0x8637('0x50')](function(_0x5df900){logger[_0x8637('0x51')](_0x8637('0x55'),JSON[_0x8637('0x30')](_0x5df900));});};exports[_0x8637('0x5a')]=function(_0x4b3309,_0x56ccfe,_0x3236fa,_0x250ffe,_0x14ece0,_0x1d825b){var _0x10bc6b,_0x598474;_0x1d825b[_0x8637('0x1a')]=intUtil[_0x8637('0x42')](_0x1d825b[_0x8637('0x1a')]);_0x1d825b[_0x8637('0x43')]=intUtil['stripTrailingSlash'](_0x1d825b[_0x8637('0x43')]);if(_0x14ece0&&_0x14ece0[_0x8637('0x44')]){logger[_0x8637('0xb')]('['+_0x56ccfe[_0x8637('0x5b')]['toUpperCase']()+']',_0x8637('0x46'));_0x56ccfe[_0x8637('0x47')]=util[_0x8637('0xe')](_0x8637('0x5c'),_0x1d825b[_0x8637('0x43')],_0x56ccfe[_0x8637('0x56')],md5(_0x56ccfe[_0x8637('0x56')]));}else{_0x56ccfe[_0x8637('0x47')]='';}headers['Authorization']=getAuth(_0x1d825b);return getUser(_0x1d825b,'')[_0x8637('0x1e')](function(_0x137f60){_0x10bc6b=_0x137f60;logger[_0x8637('0xb')](_0x8637('0x4a'),_0x10bc6b['id']);return getEndUser(_0x1d825b,_0x56ccfe['calleridname'],_0x56ccfe[_0x8637('0x10')]);})[_0x8637('0x1e')](function(_0x1e7daf){_0x598474=_0x1e7daf;logger[_0x8637('0xb')](_0x8637('0x4b'),_0x598474['id']);return getTicket(_0x1d825b,_0x10bc6b,_0x598474,_0x3236fa,_0x56ccfe);})[_0x8637('0x1e')](function(_0x4634a7){if(_0x4634a7){logger[_0x8637('0xb')](_0x8637('0x1c'));logger[_0x8637('0xb')]('The\x20Ticket\x20ID\x20is:',_0x4634a7['id']);}})[_0x8637('0x50')](function(_0x874886){logger[_0x8637('0x51')]('['+_0x56ccfe[_0x8637('0x5b')]['toUpperCase']()+']',JSON[_0x8637('0x30')](_0x874886));});};
\ No newline at end of file
+var _0x7bf4=['Authorization','The\x20User\x20ID\x20is:','calleridname','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','catch','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','format','calleridnum','getString','Subjects','Descriptions','<br>','Tags','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','remoteUri','POST','then','info','Ticket\x20created!','validateEmail','length','Agent\x20found!','find','email','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','base64','[HTTP]','GET','map','includes','picklist','type','nameField','customField','toLowerCase','content','toString','string','idField','push','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x370752,_0x114958){var _0x1daba3=function(_0x288503){while(--_0x288503){_0x370752['push'](_0x370752['shift']());}};_0x1daba3(++_0x114958);}(_0x7bf4,0x188));var _0x47bf=function(_0x393b81,_0x430fba){_0x393b81=_0x393b81-0x0;var _0x259cd3=_0x7bf4[_0x393b81];return _0x259cd3;};'use strict';var _=require('lodash');var rp=require(_0x47bf('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x47bf('0x1'));var intUtil=require(_0x47bf('0x2'));var config=require(_0x47bf('0x3'));var logger=require(_0x47bf('0x4'))(_0x47bf('0x5'));config[_0x47bf('0x6')]=_[_0x47bf('0x7')](config[_0x47bf('0x6')],{'host':_0x47bf('0x8'),'port':0x18eb});var io=require(_0x47bf('0x9'))(new Redis(config[_0x47bf('0x6')]));var headers={'Content-Type':_0x47bf('0xa'),'Accept':_0x47bf('0xa')};function emit(_0x1fcdda,_0x2e782a,_0x499b65){io['to'](_0x1fcdda)[_0x47bf('0xb')](_0x2e782a,_0x499b65);}function getTicket(_0x3dca5d,_0x50889a,_0x2fa24b,_0x2060c1,_0x2e0b00){logger['info'](_0x47bf('0xc'));var _0x294e41=_['merge']({'responder_id':_0x50889a['id'],'requester_id':_0x2fa24b['id'],'name':util[_0x47bf('0xd')]('Caller\x20-\x20%s',_0x2e0b00['calleridname']),'phone':_0x2e0b00[_0x47bf('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x47bf('0xf')](_0x2060c1[_0x47bf('0x10')],_0x2e0b00,'\x20'),'description':intUtil['getString'](_0x2060c1[_0x47bf('0x11')],_0x2e0b00,_0x47bf('0x12')),'tags':getTags(_0x2060c1[_0x47bf('0x13')],'name')},getCustomFields(_0x2060c1[_0x47bf('0x14')],_0x2e0b00));_0x294e41[_0x47bf('0x15')]=_[_0x47bf('0x16')](_[_0x47bf('0x17')](_0x294e41[_0x47bf('0x15')],'id'),'value');return request({'uri':util['format'](_0x47bf('0x18'),_0x3dca5d[_0x47bf('0x19')]),'method':_0x47bf('0x1a'),'body':_0x294e41})[_0x47bf('0x1b')](function(_0x3a988a){logger[_0x47bf('0x1c')](_0x47bf('0x1d'));return _0x3a988a;});}function getUser(_0x436c1d,_0x503cb2){if(intUtil[_0x47bf('0x1e')](_0x503cb2)){return request({'uri':util['format']('%s/api/v2/agents',_0x436c1d[_0x47bf('0x19')]),'qs':{'email':_0x503cb2}})[_0x47bf('0x1b')](function(_0x20966d){if(_0x20966d[_0x47bf('0x1f')]){logger[_0x47bf('0x1c')](_0x47bf('0x20'));return _[_0x47bf('0x21')](_0x20966d,function(_0x4e5516){return _0x4e5516['contact'][_0x47bf('0x22')]===_0x503cb2;});}else{logger[_0x47bf('0x1c')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x47bf('0xd')](_0x47bf('0x23'),_0x436c1d['remoteUri'])})[_0x47bf('0x1b')](function(_0x23be78){logger['info']('Admin\x20account\x20selected.');return _0x23be78;});}});}else{logger[_0x47bf('0x1c')](_0x47bf('0x24'));return request({'uri':util[_0x47bf('0xd')]('%s/api/v2/agents/me',_0x436c1d['remoteUri'])})[_0x47bf('0x1b')](function(_0x5c39eb){logger[_0x47bf('0x1c')](_0x47bf('0x25'));return _0x5c39eb;});}}function getEndUser(_0x4a47ec,_0x1427cb,_0x505ea5){logger[_0x47bf('0x1c')](_0x47bf('0x26'),_0x505ea5);return request({'uri':util['format'](_0x47bf('0x27'),_0x4a47ec['remoteUri']),'qs':{'phone':_0x505ea5}})[_0x47bf('0x1b')](function(_0x209d3c){if(_0x209d3c[_0x47bf('0x1f')]){logger['info'](_0x47bf('0x28'));return _[_0x47bf('0x21')](_0x209d3c,{'phone':_0x505ea5});}else{logger[_0x47bf('0x1c')](_0x47bf('0x29'));return request({'uri':util[_0x47bf('0xd')](_0x47bf('0x27'),_0x4a47ec[_0x47bf('0x19')]),'method':_0x47bf('0x1a'),'body':{'name':_0x1427cb,'phone':_0x505ea5}})['then'](function(_0x50b716){logger[_0x47bf('0x1c')](_0x47bf('0x2a'));return _0x50b716;});}});}function getAuth(_0x5739dc){return util[_0x47bf('0xd')](_0x47bf('0x2b'),new Buffer(_0x5739dc['apiKey']+':X')['toString'](_0x47bf('0x2c')));}function request(_0x25aa15){logger['debug'](_0x47bf('0x2d'),JSON['stringify'](_0x25aa15));return rp(_[_0x47bf('0x7')](_0x25aa15,{'method':_0x47bf('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x25e2a8,_0x4aa0df){var _0x4b9673=[];if(_0x25e2a8&&_0x25e2a8['length']>0x0){_0x4b9673=_[_0x47bf('0x2f')](_0x25e2a8,_0x4aa0df);}return _0x4b9673;}function getCustomFields(_0x315553,_0xe56db8){var _0x1988d0=[];var _0x428b6f={'custom_fields':[]};if(_0x315553[_0x47bf('0x1f')]>0x0){_['forEach'](_0x315553,function(_0x50bb72){if(_[_0x47bf('0x30')](['string',_0x47bf('0x31')],_0x50bb72[_0x47bf('0x32')])&&_0x50bb72[_0x47bf('0x33')]&&!_0x50bb72[_0x47bf('0x34')]){_0x428b6f[_0x50bb72[_0x47bf('0x33')][_0x47bf('0x35')]()]=_0x50bb72[_0x47bf('0x36')][_0x47bf('0x37')]();}else if(_[_0x47bf('0x30')]([_0x47bf('0x38'),_0x47bf('0x31')],_0x50bb72[_0x47bf('0x32')])&&_0x50bb72[_0x47bf('0x39')]&&_0x50bb72['customField']){_0x428b6f[_0x47bf('0x15')][_0x47bf('0x3a')]({'id':_0x50bb72[_0x47bf('0x39')],'value':_0x50bb72[_0x47bf('0x36')][_0x47bf('0x37')]()});}else if(_0x50bb72[_0x47bf('0x32')]===_0x47bf('0x3b')&&_0x50bb72[_0x47bf('0x3c')]&&_0x50bb72[_0x47bf('0x39')]&&_0x50bb72[_0x47bf('0x34')]){_0xe56db8[_0x50bb72['variableName']]&&_0x428b6f['custom_fields'][_0x47bf('0x3a')]({'id':_0x50bb72[_0x47bf('0x39')],'value':_0xe56db8[_0x50bb72[_0x47bf('0x3c')]][_0x47bf('0x37')]()});}else if(_0x50bb72[_0x47bf('0x32')]===_0x47bf('0x3d')&&_0x50bb72[_0x47bf('0x3e')]&&_0x50bb72[_0x47bf('0x3e')]['name']&&_0x50bb72[_0x47bf('0x39')]&&_0x50bb72[_0x47bf('0x34')]){_0xe56db8[_0x50bb72[_0x47bf('0x3e')][_0x47bf('0x3f')][_0x47bf('0x35')]()]&&_0x428b6f[_0x47bf('0x15')][_0x47bf('0x3a')]({'id':_0x50bb72[_0x47bf('0x39')],'value':_0xe56db8[_0x50bb72[_0x47bf('0x3e')][_0x47bf('0x3f')][_0x47bf('0x35')]()][_0x47bf('0x37')]()});}});}return _0x428b6f;}exports[_0x47bf('0x40')]=function(_0x3f84ee,_0x1ead2b,_0x587c0d,_0x1304ba,_0x16b67b,_0x103a8b){var _0x8ca70e,_0x150c6a;_0x103a8b[_0x47bf('0x19')]=intUtil[_0x47bf('0x41')](_0x103a8b['remoteUri']);_0x103a8b[_0x47bf('0x42')]=intUtil[_0x47bf('0x41')](_0x103a8b[_0x47bf('0x42')]);if(_0x16b67b&&_0x16b67b[_0x47bf('0x43')]){logger[_0x47bf('0x1c')](_0x47bf('0x44'),_0x47bf('0x45'));_0x1ead2b[_0x47bf('0x46')]=util[_0x47bf('0xd')](_0x47bf('0x47'),_0x103a8b[_0x47bf('0x42')],_0x1ead2b[_0x47bf('0x48')],md5(_0x1ead2b[_0x47bf('0x48')]));}else{_0x1ead2b[_0x47bf('0x46')]='';}headers[_0x47bf('0x49')]=getAuth(_0x103a8b);return getUser(_0x103a8b,_0x1304ba['email'])[_0x47bf('0x1b')](function(_0x552c04){_0x8ca70e=_0x552c04;logger[_0x47bf('0x1c')](_0x47bf('0x4a'),_0x8ca70e['id']);return getEndUser(_0x103a8b,_0x1ead2b[_0x47bf('0x4b')],_0x1ead2b[_0x47bf('0xe')]);})[_0x47bf('0x1b')](function(_0x58ce58){_0x150c6a=_0x58ce58;logger[_0x47bf('0x1c')]('The\x20Enduser\x20ID\x20is:',_0x150c6a['id']);return getTicket(_0x103a8b,_0x8ca70e,_0x150c6a,_0x587c0d,_0x1ead2b);})[_0x47bf('0x1b')](function(_0x5659b3){if(_0x5659b3&&_0x5659b3['id']){logger[_0x47bf('0x1c')](_0x47bf('0x1d'));logger[_0x47bf('0x1c')]('The\x20Ticket\x20ID\x20is:',_0x5659b3['id']);logger['info'](_0x47bf('0x44'),_0x47bf('0x4c'));emit(util[_0x47bf('0xd')](_0x47bf('0x4d'),_0x1304ba[_0x47bf('0x3f')]),_0x47bf('0x4e'),{'uri':util[_0x47bf('0xd')](_0x47bf('0x4f'),_0x103a8b[_0x47bf('0x19')],_0x5659b3['id'])});}})['catch'](function(_0x429a96){logger[_0x47bf('0x50')](_0x47bf('0x44'),JSON[_0x47bf('0x51')](_0x429a96));});};exports[_0x47bf('0x52')]=function(_0x1ddda5,_0x21eebc,_0x445bcb,_0x40fa39,_0x4f25fe,_0x218902,_0x1efe4e){var _0x4627a0,_0x1eef7b;_0x218902['remoteUri']=intUtil[_0x47bf('0x41')](_0x218902['remoteUri']);_0x218902['serverUrl']=intUtil['stripTrailingSlash'](_0x218902[_0x47bf('0x42')]);if(_0x1efe4e&&_0x1efe4e[_0x47bf('0x53')]&&_0x1efe4e[_0x47bf('0x53')]!==_0x47bf('0x54')){logger[_0x47bf('0x1c')](_0x47bf('0x55'),_0x47bf('0x45'));_0x21eebc[_0x47bf('0x46')]=util['format'](_0x47bf('0x47'),_0x218902[_0x47bf('0x42')],_0x21eebc[_0x47bf('0x48')],md5(_0x21eebc[_0x47bf('0x48')]));}headers[_0x47bf('0x49')]=getAuth(_0x218902);return getUser(_0x218902,_0x40fa39[_0x47bf('0x22')])[_0x47bf('0x1b')](function(_0x359191){_0x4627a0=_0x359191;logger[_0x47bf('0x1c')](_0x47bf('0x4a'),_0x4627a0['id']);return getEndUser(_0x218902,_0x21eebc[_0x47bf('0x56')],_0x21eebc[_0x47bf('0x57')]);})[_0x47bf('0x1b')](function(_0x509194){_0x1eef7b=_0x509194;logger[_0x47bf('0x1c')]('The\x20Enduser\x20ID\x20is:',_0x1eef7b['id']);return getTicket(_0x218902,_0x4627a0,_0x1eef7b,_0x445bcb,_0x21eebc);})['then'](function(_0x5be883){if(_0x5be883&&_0x5be883['id']){logger[_0x47bf('0x1c')](_0x47bf('0x1d'));logger['info'](_0x47bf('0x58'),_0x5be883['id']);logger[_0x47bf('0x1c')](_0x47bf('0x55'),_0x47bf('0x4c'));emit(util[_0x47bf('0xd')](_0x47bf('0x4d'),_0x40fa39[_0x47bf('0x3f')]),_0x47bf('0x4e'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x218902['remoteUri'],_0x5be883['id'])});}})[_0x47bf('0x59')](function(_0x19009d){logger['error'](_0x47bf('0x55'),JSON[_0x47bf('0x51')](_0x19009d));});};exports['unmanaged']=function(_0x2a1475,_0x17aa96,_0x354b6f,_0x1a713c,_0x3b8cac,_0x38e46b){var _0x4c193f,_0x5c8c2a;_0x38e46b[_0x47bf('0x19')]=intUtil[_0x47bf('0x41')](_0x38e46b['remoteUri']);_0x38e46b[_0x47bf('0x42')]=intUtil[_0x47bf('0x41')](_0x38e46b[_0x47bf('0x42')]);if(_0x3b8cac&&_0x3b8cac['monitor_format']){logger['info']('['+_0x17aa96[_0x47bf('0x5a')][_0x47bf('0x5b')]()+']',_0x47bf('0x45'));_0x17aa96[_0x47bf('0x46')]=util[_0x47bf('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x38e46b[_0x47bf('0x42')],_0x17aa96[_0x47bf('0x48')],md5(_0x17aa96['uniqueid']));}else{_0x17aa96['recordingURL']='';}headers[_0x47bf('0x49')]=getAuth(_0x38e46b);return getUser(_0x38e46b,'')[_0x47bf('0x1b')](function(_0x4d0090){_0x4c193f=_0x4d0090;logger['info'](_0x47bf('0x4a'),_0x4c193f['id']);return getEndUser(_0x38e46b,_0x17aa96[_0x47bf('0x4b')],_0x17aa96[_0x47bf('0xe')]);})['then'](function(_0x4160fa){_0x5c8c2a=_0x4160fa;logger['info'](_0x47bf('0x5c'),_0x5c8c2a['id']);return getTicket(_0x38e46b,_0x4c193f,_0x5c8c2a,_0x354b6f,_0x17aa96);})['then'](function(_0x368860){if(_0x368860){logger[_0x47bf('0x1c')](_0x47bf('0x1d'));logger[_0x47bf('0x1c')](_0x47bf('0x58'),_0x368860['id']);}})['catch'](function(_0x2b125d){logger[_0x47bf('0x50')]('['+_0x17aa96[_0x47bf('0x5a')][_0x47bf('0x5b')]()+']',JSON[_0x47bf('0x51')](_0x2b125d));});};
\ No newline at end of file
index 12d891e..ba04c45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddde=['getString','adminId','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','user:%s','emit','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','md5','util','bluebird','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','GET','/api/selector/owners','Getting\x20admin\x20information','then','users','length','email','adminEmail','info','error','toUpperCase','message','headers','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','Requested\x20Resource\x20not\x20Found','catch','/api/lookup?q=','&f=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','format','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task'];(function(_0x47a891,_0xdf835b){var _0x6d69a8=function(_0x467d43){while(--_0x467d43){_0x47a891['push'](_0x47a891['shift']());}};_0x6d69a8(++_0xdf835b);}(_0xddde,0x168));var _0xeddd=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xddde[_0x40ac5e];return _0x2839d6;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xeddd('0x0'));var util=require(_0xeddd('0x1'));var moment=require('moment');var Promise=require(_0xeddd('0x2'));var Redis=require('ioredis');var intUtil=require(_0xeddd('0x3'));var config=require(_0xeddd('0x4'));var logger=require(_0xeddd('0x5'))(_0xeddd('0x6'));config[_0xeddd('0x7')]=_['defaults'](config[_0xeddd('0x7')],{'host':_0xeddd('0x8'),'port':0x18eb});var io=require(_0xeddd('0x9'))(new Redis(config[_0xeddd('0x7')]));function getAdminId(_0x90b3cd,_0x5741c9,_0x4ba9b4,_0x473c63){return new Promise(function(_0x4c17b2,_0x55659d){var _0x20674e=![];var _0x5b13f4={'method':_0xeddd('0xa'),'uri':_0x473c63+_0xeddd('0xb'),'json':!![]};_0x5b13f4['headers']=_0x4ba9b4;logger['info'](_0xeddd('0xc'));return rp(_0x5b13f4)[_0xeddd('0xd')](function(_0x200011){if(_0x200011){var _0x1f440a=_0x200011[_0xeddd('0xe')];var _0x37d10a=null;for(_0x37d10a=0x0;_0x37d10a<_0x1f440a[_0xeddd('0xf')];_0x37d10a++){if(_0x1f440a[_0x37d10a][_0xeddd('0x10')]===_0x90b3cd[_0xeddd('0x11')]){_0x90b3cd['adminId']=_0x1f440a[_0x37d10a]['id'];_0x20674e=!![];}}if(_0x20674e){logger[_0xeddd('0x12')]('Admin\x20found:',_0x90b3cd['adminId']);_0x4c17b2(_0x90b3cd);}else{_0x55659d({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x55659d({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x55bf67){logger[_0xeddd('0x13')]('['+[_0x5741c9[_0xeddd('0x14')]()]+']',_0x55bf67[_0xeddd('0x15')]);_0x55659d(_0x55bf67);});});}function getUser(_0x1254cd,_0x320788,_0x4441cd){return function(_0x1d6205){return new Promise(function(_0x41894e,_0x16bbff){var _0x125fcd={'method':'GET','uri':_0x4441cd+'/api/selector/owners','json':!![]};_0x125fcd[_0xeddd('0x16')]=_0x320788;logger[_0xeddd('0x12')](_0xeddd('0x17'));return rp(_0x125fcd)['then'](function(_0x5c15bf){if(_0x5c15bf){var _0x47ab9d=_0x5c15bf['users'];var _0x299d76=![];var _0x15493a=null;if(_0x1d6205[_0xeddd('0x18')]!==null){logger[_0xeddd('0x12')](_0xeddd('0x19'),_0x1d6205[_0xeddd('0x18')]);_0x1d6205[_0xeddd('0x1a')]=_0x1d6205[_0xeddd('0x18')];for(_0x15493a=0x0;_0x15493a<_0x47ab9d['length'];_0x15493a++){if(_0x47ab9d[_0x15493a][_0xeddd('0x10')]===_0x1d6205['agentEmail']){_0x299d76=!![];_0x1d6205[_0xeddd('0x1b')]=_0x47ab9d[_0x15493a]['id'];logger['info'](_0xeddd('0x1c'),_0x1d6205[_0xeddd('0x1b')]);}}}if(!_0x299d76){logger[_0xeddd('0x12')](_0xeddd('0x1d'));_0x1d6205[_0xeddd('0x1a')]=_0x1d6205[_0xeddd('0x11')];_0x1d6205['userId']=_0x1d6205['adminId'];_0x299d76=!![];}if(_0x299d76){_0x41894e(_0x1d6205);}else{_0x16bbff({'statusCode':0x194,'message':_0xeddd('0x1e')});}}else{_0x16bbff({'statusCode':0x194,'message':_0xeddd('0x1e')});}})[_0xeddd('0x1f')](function(_0x9345da){logger['error']('['+[_0x1254cd[_0xeddd('0x14')]()]+']',_0x9345da[_0xeddd('0x15')]);_0x16bbff(_0x9345da);});});};}function searchContact(_0x1e35b1,_0x512bc5,_0x2ee2ba,_0x2bf837){return new Promise(function(_0x428a16,_0x339ce6){var _0x1a538d={'method':'GET','headers':_0x512bc5,'uri':_0x1e35b1+_0xeddd('0x20')+_0x2bf837+_0xeddd('0x21')+_0x2ee2ba+_0xeddd('0x22'),'json':!![]};rp(_0x1a538d)[_0xeddd('0xd')](function(_0x947287){var _0x2c32df=_[_0xeddd('0x23')](_0x947287['contacts'][_0xeddd('0x24')],[_0x2ee2ba,_0x2bf837]);_0x428a16(_0x2c32df);})['catch'](function(_0x22bf96){_0x339ce6(_0x22bf96);});});}function getEndUser(_0x9eaaf2,_0x106f47,_0x210b79){return function(_0x359f7e){return new Promise(function(_0x36ed80,_0x13cbf9){logger[_0xeddd('0x12')](util['format'](_0xeddd('0x25'),_0x359f7e[_0xeddd('0x26')]));searchContact(_0x210b79,_0x106f47,_0xeddd('0x27'),_0x359f7e[_0xeddd('0x26')])[_0xeddd('0xd')](function(_0x4b7e1d){if(_0x4b7e1d){_0x359f7e[_0xeddd('0x28')]=_0x4b7e1d['id'];logger[_0xeddd('0x12')](_0xeddd('0x29'),_0x359f7e[_0xeddd('0x28')]);return _0x36ed80(_0x359f7e);}searchContact(_0x210b79,_0x106f47,_0xeddd('0x2a'),_0x359f7e['contactNumber'])[_0xeddd('0xd')](function(_0x499fc1){if(_0x499fc1){_0x359f7e[_0xeddd('0x28')]=_0x499fc1['id'];logger[_0xeddd('0x12')](_0xeddd('0x2b'),_0x359f7e[_0xeddd('0x28')]);return _0x36ed80(_0x359f7e);}createEndUser(_0x359f7e,_0x9eaaf2,_0x106f47,_0x210b79)[_0xeddd('0xd')](function(_0x55103b){logger['info'](_0xeddd('0x2c'),_0x55103b[_0xeddd('0x28')]);return _0x36ed80(_0x55103b);});});})[_0xeddd('0x1f')](function(_0x3b8e42){_0x13cbf9(_0x3b8e42);});});};}function createEndUser(_0x2ac21a,_0x3357cb,_0x47c965,_0x155d93){return new Promise(function(_0x1f7699,_0x2c8ea7){var _0x3c2827=moment();var _0x4ca22b={'method':'POST','uri':_0x155d93+_0xeddd('0x2d'),'body':{'contact':{'last_name':_0x2ac21a[_0xeddd('0x26')],'work_number':_0x2ac21a[_0xeddd('0x26')],'mobile_number':_0x2ac21a[_0xeddd('0x26')],'owner_id':_0x2ac21a[_0xeddd('0x1b')],'created_at':_0x3c2827[_0xeddd('0x2e')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x4ca22b[_0xeddd('0x16')]=_0x47c965;logger[_0xeddd('0x12')](_0xeddd('0x2f'));return rp(_0x4ca22b)[_0xeddd('0xd')](function(_0x1cf6a8){_0x2ac21a[_0xeddd('0x28')]=_0x1cf6a8[_0xeddd('0x30')]['id'];_0x1f7699(_0x2ac21a);})[_0xeddd('0x1f')](function(_0x575224){logger['error']('['+[_0x3357cb[_0xeddd('0x14')]()]+']',_0x575224['message']);_0x2c8ea7(_0x575224[_0xeddd('0x15')]);});});}function getTicket(_0x58a672,_0x9b03fb,_0x13bbd0,_0x20beb7,_0x12d4dd){return function(_0x259b68){logger[_0xeddd('0x12')](_0xeddd('0x31'));return new Promise(function(_0x4eda69,_0x4a2400){var _0x12b2b4=moment();var _0x2d4171={'method':'POST','uri':_0x13bbd0+'/api/tasks','body':{'title':intUtil['getString'](_0x20beb7['Subjects'],_0x12d4dd,'\x20'),'description':intUtil[_0xeddd('0x32')](_0x20beb7['Descriptions'],_0x12d4dd,'\x0a'),'owner_id':_0x259b68[_0xeddd('0x1b')],'creater_id':_0x259b68[_0xeddd('0x33')],'targetable_id':_0x259b68['endUserId'],'targetable_type':_0xeddd('0x34'),'created_at':_0x12b2b4[_0xeddd('0x2e')](_0xeddd('0x35')),'due_date':_0x12b2b4[_0xeddd('0x36')](0x1e,'m')['format'](_0xeddd('0x35'))},'json':!![]};_0x2d4171['headers']=_0x9b03fb;return rp(_0x2d4171)[_0xeddd('0xd')](function(_0x26a429){_0x259b68[_0xeddd('0x37')]=_0x26a429[_0xeddd('0x38')]['id'];logger[_0xeddd('0x12')]('Task\x20created:',_0x259b68['ticketId']);_0x4eda69(_0x259b68);})[_0xeddd('0x1f')](function(_0xb705f2){logger['error']('['+[_0x58a672[_0xeddd('0x14')]()]+']',_0xb705f2['message']);_0x4a2400(_0xb705f2['message']);});});};}function emit(_0x178b08,_0x5c32fc,_0x595110){var _0x3ccb60={'uri':_0x178b08+'/contacts/'+_0x595110};io['to'](util['format'](_0xeddd('0x39'),_0x5c32fc))[_0xeddd('0x3a')](_0xeddd('0x3b'),_0x3ccb60);}exports['cs']=function(_0x285b9e,_0x246c14,_0x3e1829,_0x2f80b1,_0x1b04dd,_0x4dbb5d,_0x24336b,_0x324892){var _0x23b839={};var _0x1f047b={'Authorization':'Token\x20token='+_0x4dbb5d[_0xeddd('0x3c')]};_0x4dbb5d[_0xeddd('0x3d')]=intUtil[_0xeddd('0x3e')](_0x4dbb5d[_0xeddd('0x3d')]);_0x4dbb5d[_0xeddd('0x3f')]=intUtil['stripTrailingSlash'](_0x4dbb5d['serverUrl']);var _0x2b8689=_0x4dbb5d[_0xeddd('0x3d')];_0x23b839[_0xeddd('0x11')]=_0x4dbb5d[_0xeddd('0x40')];_0x23b839[_0xeddd('0x26')]=_0x324892[_0xeddd('0x41')]()===_0xeddd('0x42')?_0x246c14[_0xeddd('0x43')]:_0x246c14[_0xeddd('0x44')];_0x23b839[_0xeddd('0x45')]=_0x324892===_0xeddd('0x46')||_0x324892==='unmanaged'?'queue':'outbound';if(_0x2f80b1){_0x23b839['agentEmail']=_0x2f80b1['email'];}var _0x282c78=util[_0xeddd('0x2e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4dbb5d[_0xeddd('0x3f')],_0x246c14['uniqueid'],md5(_0x246c14[_0xeddd('0x47')]));if(_0x1b04dd&&_0x1b04dd[_0xeddd('0x48')]){logger[_0xeddd('0x12')](_0xeddd('0x49'),_0xeddd('0x4a'));_0x246c14['recordingURL']=_0x282c78;}else if(_0x24336b&&_0x24336b['recordingFormat']&&_0x24336b['recordingFormat']!==_0xeddd('0x4b')){logger[_0xeddd('0x12')]('[OUTBOUND]',_0xeddd('0x4a'));_0x246c14[_0xeddd('0x4c')]=_0x282c78;}else{_0x246c14[_0xeddd('0x4c')]='';}return getAdminId(_0x23b839,_0x324892,_0x1f047b,_0x2b8689)[_0xeddd('0xd')](getUser(_0x324892,_0x1f047b,_0x2b8689))[_0xeddd('0xd')](getEndUser(_0x324892,_0x1f047b,_0x2b8689))['then'](getTicket(_0x324892,_0x1f047b,_0x2b8689,_0x3e1829,_0x246c14))[_0xeddd('0xd')](function(_0x56f980){logger[_0xeddd('0x12')](util['format'](_0xeddd('0x4d'),_0x56f980['ticketId']));if(_0x324892!==_0xeddd('0x4e')){logger['info']('['+[_0x324892[_0xeddd('0x14')]()]+']',_0xeddd('0x4f'));emit(_0x2b8689,_0x2f80b1[_0xeddd('0x50')],_0x56f980['endUserId']);}})['catch'](function(_0x595e7b){logger[_0xeddd('0x13')]('['+[_0x324892[_0xeddd('0x14')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xeddd('0x51')](_0x595e7b,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x891f=['Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','work_number','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','message','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','adminEmail','username','toLowerCase','destcalleridnum','calleridnum','callDirection','unmanaged','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','localhost','socket.io-emitter','redis','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','error','/api/lookup?q=','find','contacts','format'];(function(_0x10852d,_0x4cdcc6){var _0x13a8d6=function(_0x2ece16){while(--_0x2ece16){_0x10852d['push'](_0x10852d['shift']());}};_0x13a8d6(++_0x4cdcc6);}(_0x891f,0x133));var _0xf891=function(_0x565e46,_0x4ac4c9){_0x565e46=_0x565e46-0x0;var _0x21265a=_0x891f[_0x565e46];return _0x21265a;};'use strict';var _=require('lodash');var rp=require(_0xf891('0x0'));var md5=require(_0xf891('0x1'));var util=require(_0xf891('0x2'));var moment=require('moment');var Promise=require(_0xf891('0x3'));var Redis=require(_0xf891('0x4'));var intUtil=require(_0xf891('0x5'));var config=require(_0xf891('0x6'));var logger=require(_0xf891('0x7'))(_0xf891('0x8'));config['redis']=_[_0xf891('0x9')](config['redis'],{'host':_0xf891('0xa'),'port':0x18eb});var io=require(_0xf891('0xb'))(new Redis(config[_0xf891('0xc')]));function getAdminId(_0x552ee0,_0x598774,_0x222f88,_0x1c7ecf){return new Promise(function(_0xdba315,_0x4b489a){var _0x1e834c=![];var _0x116d14={'method':_0xf891('0xd'),'uri':_0x1c7ecf+_0xf891('0xe'),'json':!![]};_0x116d14[_0xf891('0xf')]=_0x222f88;logger[_0xf891('0x10')](_0xf891('0x11'));return rp(_0x116d14)[_0xf891('0x12')](function(_0x571339){if(_0x571339){var _0x1ebb68=_0x571339[_0xf891('0x13')];var _0x581222=null;for(_0x581222=0x0;_0x581222<_0x1ebb68[_0xf891('0x14')];_0x581222++){if(_0x1ebb68[_0x581222][_0xf891('0x15')]===_0x552ee0['adminEmail']){_0x552ee0[_0xf891('0x16')]=_0x1ebb68[_0x581222]['id'];_0x1e834c=!![];}}if(_0x1e834c){logger['info']('Admin\x20found:',_0x552ee0[_0xf891('0x16')]);_0xdba315(_0x552ee0);}else{_0x4b489a({'statusCode':0x194,'message':_0xf891('0x17')});}}else{_0x4b489a({'statusCode':0x194,'message':_0xf891('0x17')});}})[_0xf891('0x18')](function(_0x21ba81){logger['error']('['+[_0x598774[_0xf891('0x19')]()]+']',_0x21ba81['message']);_0x4b489a(_0x21ba81);});});}function getUser(_0x1f0b75,_0x4733b9,_0x2c7173){return function(_0x334bac){return new Promise(function(_0x449a2b,_0x4ff752){var _0x17ccb4={'method':_0xf891('0xd'),'uri':_0x2c7173+_0xf891('0xe'),'json':!![]};_0x17ccb4[_0xf891('0xf')]=_0x4733b9;logger['info']('Getting\x20user\x20list');return rp(_0x17ccb4)[_0xf891('0x12')](function(_0x15fe58){if(_0x15fe58){var _0x8b49fa=_0x15fe58[_0xf891('0x13')];var _0x51575a=![];var _0x3afca0=null;if(_0x334bac['agentEmail']!==null){logger['info'](_0xf891('0x1a'),_0x334bac[_0xf891('0x1b')]);_0x334bac[_0xf891('0x1c')]=_0x334bac['agentEmail'];for(_0x3afca0=0x0;_0x3afca0<_0x8b49fa['length'];_0x3afca0++){if(_0x8b49fa[_0x3afca0][_0xf891('0x15')]===_0x334bac['agentEmail']){_0x51575a=!![];_0x334bac[_0xf891('0x1d')]=_0x8b49fa[_0x3afca0]['id'];logger[_0xf891('0x10')](_0xf891('0x1e'),_0x334bac[_0xf891('0x1d')]);}}}if(!_0x51575a){logger['info'](_0xf891('0x1f'));_0x334bac[_0xf891('0x1c')]=_0x334bac['adminEmail'];_0x334bac[_0xf891('0x1d')]=_0x334bac[_0xf891('0x16')];_0x51575a=!![];}if(_0x51575a){_0x449a2b(_0x334bac);}else{_0x4ff752({'statusCode':0x194,'message':_0xf891('0x17')});}}else{_0x4ff752({'statusCode':0x194,'message':_0xf891('0x17')});}})[_0xf891('0x18')](function(_0x90e11d){logger[_0xf891('0x20')]('['+[_0x1f0b75['toUpperCase']()]+']',_0x90e11d['message']);_0x4ff752(_0x90e11d);});});};}function searchContact(_0x4c623a,_0x349788,_0x5017e5,_0x178bfa){return new Promise(function(_0x51e0a3,_0x4abfb6){var _0x3a77a8={'method':_0xf891('0xd'),'headers':_0x349788,'uri':_0x4c623a+_0xf891('0x21')+_0x178bfa+'&f='+_0x5017e5+'&entities=contact','json':!![]};rp(_0x3a77a8)[_0xf891('0x12')](function(_0x5b7fac){var _0x1dd9cf=_[_0xf891('0x22')](_0x5b7fac[_0xf891('0x23')][_0xf891('0x23')],[_0x5017e5,_0x178bfa]);_0x51e0a3(_0x1dd9cf);})['catch'](function(_0x3d0ab8){_0x4abfb6(_0x3d0ab8);});});}function getEndUser(_0x1379c8,_0x462195,_0x1dd47b){return function(_0x2e32b1){return new Promise(function(_0x3f503f,_0x49df30){logger[_0xf891('0x10')](util[_0xf891('0x24')](_0xf891('0x25'),_0x2e32b1[_0xf891('0x26')]));searchContact(_0x1dd47b,_0x462195,_0xf891('0x27'),_0x2e32b1[_0xf891('0x26')])['then'](function(_0x10af3a){if(_0x10af3a){_0x2e32b1[_0xf891('0x28')]=_0x10af3a['id'];logger[_0xf891('0x10')]('Contact\x20found\x20mobile_number:',_0x2e32b1[_0xf891('0x28')]);return _0x3f503f(_0x2e32b1);}searchContact(_0x1dd47b,_0x462195,_0xf891('0x29'),_0x2e32b1[_0xf891('0x26')])[_0xf891('0x12')](function(_0x5a7b99){if(_0x5a7b99){_0x2e32b1[_0xf891('0x28')]=_0x5a7b99['id'];logger[_0xf891('0x10')]('Contact\x20found\x20work_number:',_0x2e32b1[_0xf891('0x28')]);return _0x3f503f(_0x2e32b1);}createEndUser(_0x2e32b1,_0x1379c8,_0x462195,_0x1dd47b)[_0xf891('0x12')](function(_0x4aa3ad){logger[_0xf891('0x10')](_0xf891('0x2a'),_0x4aa3ad[_0xf891('0x28')]);return _0x3f503f(_0x4aa3ad);});});})[_0xf891('0x18')](function(_0x5aac9c){_0x49df30(_0x5aac9c);});});};}function createEndUser(_0x59fbbb,_0x569d45,_0x4f855e,_0xfe805e){return new Promise(function(_0x568f09,_0x22399c){var _0x1d6a12=moment();var _0x5aee24={'method':_0xf891('0x2b'),'uri':_0xfe805e+'/api/contacts','body':{'contact':{'last_name':_0x59fbbb[_0xf891('0x26')],'work_number':_0x59fbbb[_0xf891('0x26')],'mobile_number':_0x59fbbb['contactNumber'],'owner_id':_0x59fbbb[_0xf891('0x1d')],'created_at':_0x1d6a12[_0xf891('0x24')](_0xf891('0x2c'))}},'json':!![]};_0x5aee24[_0xf891('0xf')]=_0x4f855e;logger[_0xf891('0x10')](_0xf891('0x2d'));return rp(_0x5aee24)[_0xf891('0x12')](function(_0x20fc4c){_0x59fbbb['endUserId']=_0x20fc4c[_0xf891('0x2e')]['id'];_0x568f09(_0x59fbbb);})['catch'](function(_0x4c5d02){logger[_0xf891('0x20')]('['+[_0x569d45['toUpperCase']()]+']',_0x4c5d02[_0xf891('0x2f')]);_0x22399c(_0x4c5d02[_0xf891('0x2f')]);});});}function getTicket(_0x44d8ff,_0x34a20f,_0x467be0,_0xdeabe9,_0x1fc134){return function(_0x24f4e1){logger['info'](_0xf891('0x30'));return new Promise(function(_0x5bcc89,_0x120cc4){var _0x2ad794=moment();var _0xdf56e7={'method':_0xf891('0x2b'),'uri':_0x467be0+_0xf891('0x31'),'body':{'title':intUtil[_0xf891('0x32')](_0xdeabe9['Subjects'],_0x1fc134,'\x20'),'description':intUtil[_0xf891('0x32')](_0xdeabe9[_0xf891('0x33')],_0x1fc134,'\x0a'),'owner_id':_0x24f4e1[_0xf891('0x1d')],'creater_id':_0x24f4e1[_0xf891('0x16')],'targetable_id':_0x24f4e1[_0xf891('0x28')],'targetable_type':_0xf891('0x34'),'created_at':_0x2ad794[_0xf891('0x24')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x2ad794[_0xf891('0x35')](0x1e,'m')[_0xf891('0x24')](_0xf891('0x2c'))},'json':!![]};_0xdf56e7[_0xf891('0xf')]=_0x34a20f;return rp(_0xdf56e7)[_0xf891('0x12')](function(_0x35158a){_0x24f4e1[_0xf891('0x36')]=_0x35158a[_0xf891('0x37')]['id'];logger[_0xf891('0x10')](_0xf891('0x38'),_0x24f4e1['ticketId']);_0x5bcc89(_0x24f4e1);})[_0xf891('0x18')](function(_0x5d72ef){logger['error']('['+[_0x44d8ff[_0xf891('0x19')]()]+']',_0x5d72ef[_0xf891('0x2f')]);_0x120cc4(_0x5d72ef[_0xf891('0x2f')]);});});};}function emit(_0x323079,_0x26376b,_0x4142c4){var _0x18ba1a={'uri':_0x323079+_0xf891('0x39')+_0x4142c4};io['to'](util[_0xf891('0x24')](_0xf891('0x3a'),_0x26376b))[_0xf891('0x3b')](_0xf891('0x3c'),_0x18ba1a);}exports['cs']=function(_0x67fe83,_0xf0558e,_0x1eac8c,_0x34f1e2,_0xb98edd,_0x3ce506,_0xed0f4b,_0x319b2e){var _0x5b2afb={};var _0x2e28f={'Authorization':_0xf891('0x3d')+_0x3ce506[_0xf891('0x3e')]};_0x3ce506[_0xf891('0x3f')]=intUtil['stripTrailingSlash'](_0x3ce506[_0xf891('0x3f')]);_0x3ce506[_0xf891('0x40')]=intUtil['stripTrailingSlash'](_0x3ce506[_0xf891('0x40')]);var _0x6313f6=_0x3ce506[_0xf891('0x3f')];_0x5b2afb[_0xf891('0x41')]=_0x3ce506[_0xf891('0x42')];_0x5b2afb['contactNumber']=_0x319b2e[_0xf891('0x43')]()==='outbound'?_0xf0558e[_0xf891('0x44')]:_0xf0558e[_0xf891('0x45')];_0x5b2afb[_0xf891('0x46')]=_0x319b2e==='queue'||_0x319b2e===_0xf891('0x47')?_0xf891('0x48'):_0xf891('0x49');if(_0x34f1e2){_0x5b2afb['agentEmail']=_0x34f1e2[_0xf891('0x15')];}var _0x29bb06=util[_0xf891('0x24')](_0xf891('0x4a'),_0x3ce506[_0xf891('0x40')],_0xf0558e[_0xf891('0x4b')],md5(_0xf0558e['uniqueid']));if(_0xb98edd&&_0xb98edd['monitor_format']){logger[_0xf891('0x10')](_0xf891('0x4c'),_0xf891('0x4d'));_0xf0558e[_0xf891('0x4e')]=_0x29bb06;}else if(_0xed0f4b&&_0xed0f4b['recordingFormat']&&_0xed0f4b[_0xf891('0x4f')]!==_0xf891('0x50')){logger[_0xf891('0x10')](_0xf891('0x51'),'Recording\x20is\x20enabled!');_0xf0558e[_0xf891('0x4e')]=_0x29bb06;}else{_0xf0558e[_0xf891('0x4e')]='';}return getAdminId(_0x5b2afb,_0x319b2e,_0x2e28f,_0x6313f6)[_0xf891('0x12')](getUser(_0x319b2e,_0x2e28f,_0x6313f6))[_0xf891('0x12')](getEndUser(_0x319b2e,_0x2e28f,_0x6313f6))[_0xf891('0x12')](getTicket(_0x319b2e,_0x2e28f,_0x6313f6,_0x1eac8c,_0xf0558e))['then'](function(_0x2d4408){logger[_0xf891('0x10')](util[_0xf891('0x24')](_0xf891('0x52'),_0x2d4408[_0xf891('0x36')]));if(_0x319b2e!==_0xf891('0x47')){logger['info']('['+[_0x319b2e['toUpperCase']()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x6313f6,_0x34f1e2[_0xf891('0x53')],_0x2d4408['endUserId']);}})[_0xf891('0x18')](function(_0xf3e3b6){logger[_0xf891('0x20')]('['+[_0x319b2e[_0xf891('0x19')]()]+_0xf891('0x54'),util[_0xf891('0x55')](_0xf3e3b6,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 78c2ee8..4c61309 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd62a=['./vtiger','./freshsales','zendesk','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','data1','toLowerCase','find','outbound','log','EVENT\x20UNKNOWN','salesforce','sugarcrm','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xd62a,0x1db));var _0xad62=function(_0x15dea5,_0x11b31c){_0x15dea5=_0x15dea5-0x0;var _0x2798d9=_0xd62a[_0x15dea5];return _0x2798d9;};'use strict';var _=require(_0xad62('0x0'));var util=require(_0xad62('0x1'));var zendesk=require(_0xad62('0x2'));var salesforce=require(_0xad62('0x3'));var sugarcrm=require(_0xad62('0x4'));var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require('./desk');var vtiger=require(_0xad62('0x5'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0xad62('0x6'));var integrations=[_0xad62('0x7'),'salesforce','sugarcrm',_0xad62('0x8'),_0xad62('0x9'),_0xad62('0xa'),_0xad62('0xb'),_0xad62('0xc'),_0xad62('0xd'),_0xad62('0xe')];exports[_0xad62('0xf')]=function(_0x4f420d,_0x13224c,_0x29a149,_0x50d473,_0x3e40cd,_0x2ae254){if(_0x29a149){if(_['includes'](integrations,_0x4f420d[_0xad62('0x10')][_0xad62('0x11')]())){try{var _0x44fe7b=null;var _0xbb73a='';var _0x420b4c=_0x29a149[_0x4f420d['data1'][_0xad62('0x11')]()];if(_0x420b4c){var _0x4237e6=_0x420b4c[_0x4f420d['data2']];if(_0x4237e6){var _0x5de801=_[_0xad62('0x12')](_0x4237e6['Configurations'],{'id':parseInt(_0x4f420d['data3'],0xa)});if(_0x5de801){if(_0x50d473){if(_0x3e40cd&&_0x13224c['queue']){_0xbb73a='queue';}else if(_0x13224c['routeId']){_0xbb73a=_0xad62('0x13');}else{console[_0xad62('0x14')](_0xad62('0x15'),_0x13224c);}}else{_0xbb73a='unmanaged';}switch(_0x4f420d[_0xad62('0x10')][_0xad62('0x11')]()){case _0xad62('0x7'):zendesk[_0xbb73a](_0x4f420d,_0x13224c,_0x5de801,_0x50d473,_0x3e40cd,_0x4237e6,_0x2ae254);break;case _0xad62('0x16'):salesforce[_0xbb73a](_0x4f420d,_0x13224c,_0x5de801,_0x50d473,_0x3e40cd,_0x4237e6,_0x2ae254);break;case _0xad62('0x17'):sugarcrm[_0xbb73a](_0x4f420d,_0x13224c,_0x5de801,_0x50d473,_0x3e40cd,_0x4237e6,_0x2ae254);break;case'freshdesk':freshdesk[_0xbb73a](_0x4f420d,_0x13224c,_0x5de801,_0x50d473,_0x3e40cd,_0x4237e6,_0x2ae254);break;case _0xad62('0x9'):zoho[_0xbb73a](_0x4f420d,_0x13224c,_0x5de801,_0x50d473,_0x3e40cd,_0x4237e6,_0x2ae254);break;case _0xad62('0xa'):desk[_0xbb73a](_0x4f420d,_0x13224c,_0x5de801,_0x50d473,_0x3e40cd,_0x4237e6,_0x2ae254);break;case'vtiger':vtiger[_0xbb73a](_0x4f420d,_0x13224c,_0x5de801,_0x50d473,_0x3e40cd,_0x4237e6,_0x2ae254);break;case _0xad62('0xd'):freshsales['cs'](_0x4f420d,_0x13224c,_0x5de801,_0x50d473,_0x3e40cd,_0x4237e6,_0x2ae254,_0xbb73a);break;case _0xad62('0xe'):servicenow['cs'](_0x4f420d,_0x13224c,_0x5de801,_0x50d473,_0x3e40cd,_0x4237e6,_0x2ae254,_0xbb73a);break;case _0xad62('0xc'):dynamics365['cs'](_0x4f420d,_0x13224c,_0x5de801,_0x50d473,_0x3e40cd,_0x4237e6,_0x2ae254,_0xbb73a);break;default:console[_0xad62('0x14')](_0xad62('0x18'));}}else{_0x44fe7b=require(_0xad62('0x19'))(_0x4f420d['data1'][_0xad62('0x11')]());_0x44fe7b[_0xad62('0x1a')](_0xad62('0x1b'),util[_0xad62('0x1c')](_0xad62('0x1d'),_0x4f420d[_0xad62('0x10')]['toLowerCase'](),_0x4f420d['data3']));}}else{_0x44fe7b=require(_0xad62('0x19'))(_0x4f420d['data1'][_0xad62('0x11')]());_0x44fe7b[_0xad62('0x1a')]('[EXEC]',util[_0xad62('0x1c')]('%s\x20account\x20#%s\x20not\x20found',_0x4f420d['data1'][_0xad62('0x11')](),_0x4f420d['data2']));}}else{}}catch(_0x405a97){console[_0xad62('0x1a')](_0x405a97);}}}};
\ No newline at end of file
+var _0xca11=['data1','freshdesk','freshsales','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data2','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','zoho','desk','vtiger','servicenow','exec','includes','toLowerCase','Configurations','data3','queue','outbound','log'];(function(_0x2091f6,_0x3d400c){var _0x45c5b4=function(_0x131ef7){while(--_0x131ef7){_0x2091f6['push'](_0x2091f6['shift']());}};_0x45c5b4(++_0x3d400c);}(_0xca11,0x1d8));var _0x1ca1=function(_0x5da57b,_0x28accd){_0x5da57b=_0x5da57b-0x0;var _0xce4294=_0xca11[_0x5da57b];return _0xce4294;};'use strict';var _=require('lodash');var util=require(_0x1ca1('0x0'));var zendesk=require(_0x1ca1('0x1'));var salesforce=require(_0x1ca1('0x2'));var sugarcrm=require(_0x1ca1('0x3'));var freshdesk=require(_0x1ca1('0x4'));var zoho=require(_0x1ca1('0x5'));var desk=require('./desk');var vtiger=require(_0x1ca1('0x6'));var servicenow=require(_0x1ca1('0x7'));var dynamics365=require(_0x1ca1('0x8'));var freshsales=require('./freshsales');var integrations=[_0x1ca1('0x9'),_0x1ca1('0xa'),'sugarcrm','freshdesk',_0x1ca1('0xb'),_0x1ca1('0xc'),_0x1ca1('0xd'),'dynamics365','freshsales',_0x1ca1('0xe')];exports[_0x1ca1('0xf')]=function(_0xa8f05f,_0x58a6f5,_0x32dd8d,_0x2b931f,_0x32e082,_0x2eda51){if(_0x32dd8d){if(_[_0x1ca1('0x10')](integrations,_0xa8f05f['data1']['toLowerCase']())){try{var _0x3f33c1=null;var _0x1bf356='';var _0x15cf80=_0x32dd8d[_0xa8f05f['data1'][_0x1ca1('0x11')]()];if(_0x15cf80){var _0x503da0=_0x15cf80[_0xa8f05f['data2']];if(_0x503da0){var _0x9f6e5c=_['find'](_0x503da0[_0x1ca1('0x12')],{'id':parseInt(_0xa8f05f[_0x1ca1('0x13')],0xa)});if(_0x9f6e5c){if(_0x2b931f){if(_0x32e082&&_0x58a6f5[_0x1ca1('0x14')]){_0x1bf356=_0x1ca1('0x14');}else if(_0x58a6f5['routeId']){_0x1bf356=_0x1ca1('0x15');}else{console[_0x1ca1('0x16')]('EVENT\x20UNKNOWN',_0x58a6f5);}}else{_0x1bf356='unmanaged';}switch(_0xa8f05f[_0x1ca1('0x17')][_0x1ca1('0x11')]()){case _0x1ca1('0x9'):zendesk[_0x1bf356](_0xa8f05f,_0x58a6f5,_0x9f6e5c,_0x2b931f,_0x32e082,_0x503da0,_0x2eda51);break;case'salesforce':salesforce[_0x1bf356](_0xa8f05f,_0x58a6f5,_0x9f6e5c,_0x2b931f,_0x32e082,_0x503da0,_0x2eda51);break;case'sugarcrm':sugarcrm[_0x1bf356](_0xa8f05f,_0x58a6f5,_0x9f6e5c,_0x2b931f,_0x32e082,_0x503da0,_0x2eda51);break;case _0x1ca1('0x18'):freshdesk[_0x1bf356](_0xa8f05f,_0x58a6f5,_0x9f6e5c,_0x2b931f,_0x32e082,_0x503da0,_0x2eda51);break;case _0x1ca1('0xb'):zoho[_0x1bf356](_0xa8f05f,_0x58a6f5,_0x9f6e5c,_0x2b931f,_0x32e082,_0x503da0,_0x2eda51);break;case _0x1ca1('0xc'):desk[_0x1bf356](_0xa8f05f,_0x58a6f5,_0x9f6e5c,_0x2b931f,_0x32e082,_0x503da0,_0x2eda51);break;case'vtiger':vtiger[_0x1bf356](_0xa8f05f,_0x58a6f5,_0x9f6e5c,_0x2b931f,_0x32e082,_0x503da0,_0x2eda51);break;case _0x1ca1('0x19'):freshsales['cs'](_0xa8f05f,_0x58a6f5,_0x9f6e5c,_0x2b931f,_0x32e082,_0x503da0,_0x2eda51,_0x1bf356);break;case _0x1ca1('0xe'):servicenow['cs'](_0xa8f05f,_0x58a6f5,_0x9f6e5c,_0x2b931f,_0x32e082,_0x503da0,_0x2eda51,_0x1bf356);break;case'dynamics365':dynamics365['cs'](_0xa8f05f,_0x58a6f5,_0x9f6e5c,_0x2b931f,_0x32e082,_0x503da0,_0x2eda51,_0x1bf356);break;default:console['log'](_0x1ca1('0x1a'));}}else{_0x3f33c1=require(_0x1ca1('0x1b'))(_0xa8f05f[_0x1ca1('0x17')]['toLowerCase']());_0x3f33c1[_0x1ca1('0x1c')](_0x1ca1('0x1d'),util[_0x1ca1('0x1e')](_0x1ca1('0x1f'),_0xa8f05f[_0x1ca1('0x17')]['toLowerCase'](),_0xa8f05f[_0x1ca1('0x13')]));}}else{_0x3f33c1=require(_0x1ca1('0x1b'))(_0xa8f05f[_0x1ca1('0x17')][_0x1ca1('0x11')]());_0x3f33c1[_0x1ca1('0x1c')](_0x1ca1('0x1d'),util[_0x1ca1('0x1e')]('%s\x20account\x20#%s\x20not\x20found',_0xa8f05f[_0x1ca1('0x17')][_0x1ca1('0x11')](),_0xa8f05f[_0x1ca1('0x20')]));}}else{}}catch(_0x1ae167){console[_0x1ca1('0x1c')](_0x1ae167);}}}};
\ No newline at end of file
index 4b98cd1..dc49999 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd67f=['Variable','name','password','concat','securityToken','clientId','clientSecret','username','Connection\x20established.','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','assign','getString','Descriptions','ticketType','Task','utc','IsReminderSet','contact','WhoId','account','Case','endUserType','ContactId','AccountId','leadId','info','sobject','create','isNil','User','find','execute','then','Email','Agent\x20%s\x20found.','Name','resolve','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact_lead','cloneDeep','additionalSearchContact','merge','$or','length','additionalSearchLead','Lead','additionalSearchAccount','Account','Contact','lead','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','<unknown>','format','LastName','Company','No\x20Company','upperFirst','forEach','includes','picklist','idField','toString','variable','variableName','customVariable'];(function(_0x741222,_0x1f2f38){var _0xd9ca45=function(_0x5aec49){while(--_0x5aec49){_0x741222['push'](_0x741222['shift']());}};_0xd9ca45(++_0x1f2f38);}(_0xd67f,0x19e));var _0xfd67=function(_0x2e5199,_0x380f97){_0x2e5199=_0x2e5199-0x0;var _0x4bd06e=_0xd67f[_0x2e5199];return _0x4bd06e;};'use strict';var _=require(_0xfd67('0x0'));var rp=require(_0xfd67('0x1'));var moment=require(_0xfd67('0x2'));var BPromise=require(_0xfd67('0x3'));var md5=require(_0xfd67('0x4'));var jsforce=require(_0xfd67('0x5'));var util=require(_0xfd67('0x6'));var Redis=require(_0xfd67('0x7'));var intUtil=require(_0xfd67('0x8'));var config=require('../../../../config/environment');var logger=require(_0xfd67('0x9'))(_0xfd67('0xa'));config[_0xfd67('0xb')]=_['defaults'](config[_0xfd67('0xb')],{'host':_0xfd67('0xc'),'port':0x18eb});var io=require(_0xfd67('0xd'))(new Redis(config[_0xfd67('0xb')]));function emit(_0x72ccd,_0x202aa5,_0x18525e){io['to'](_0x72ccd)['emit'](_0x202aa5,_0x18525e);}function getTicket(_0x1f26af,_0x52ba21,_0x307a86,_0x3a39c6,_0x3f2951,_0x4def32,_0x5a156a,_0x39ddc8){var _0x592c7a=Object[_0xfd67('0xe')]({},{'OwnerId':_0x52ba21['id'],'Subject':intUtil['getString'](_0x3a39c6['Subjects'],_0x3f2951,'\x20'),'Description':intUtil[_0xfd67('0xf')](_0x3a39c6[_0xfd67('0x10')],_0x3f2951,'\x0a')},getCustomFields(_0x4def32,_0x3f2951));if(_0x307a86){if(_0x3a39c6[_0xfd67('0x11')]===_0xfd67('0x12')){_0x592c7a['ActivityDate']=moment[_0xfd67('0x13')]();_0x592c7a[_0xfd67('0x14')]=![];_0x592c7a['IsRecurrence']=![];if(_0x307a86['endUserType']===_0xfd67('0x15')||_0x307a86['endUserType']==='lead'){_0x592c7a[_0xfd67('0x16')]=_0x307a86['id'];}else if(_0x307a86['endUserType']===_0xfd67('0x17')){_0x592c7a['WhatId']=_0x307a86['id'];}}else if(_0x3a39c6['ticketType']===_0xfd67('0x18')){if(_0x307a86[_0xfd67('0x19')]===_0xfd67('0x15')){_0x592c7a[_0xfd67('0x1a')]=_0x307a86['id'];}else if(_0x307a86[_0xfd67('0x19')]==='account'){_0x592c7a[_0xfd67('0x1b')]=_0x307a86['id'];}else if(_0x307a86[_0xfd67('0x19')]==='lead'&&_0x3a39c6[_0xfd67('0x1c')]){_0x592c7a[_0x3a39c6['leadId']]=_0x307a86['id'];}else{logger[_0xfd67('0x1d')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x5a156a[_0xfd67('0x1e')](_0x3a39c6[_0xfd67('0x11')])[_0xfd67('0x1f')](_0x592c7a);}function getUser(_0xa8336f,_0x1229a9,_0x370de3){if(!_[_0xfd67('0x20')](_0x1229a9)&&intUtil['validateEmail'](_0x1229a9)){var _0x176d43={'Email':_0x1229a9};var _0x191bc7={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x370de3[_0xfd67('0x1e')](_0xfd67('0x21'))[_0xfd67('0x22')](_0x176d43,_0x191bc7)[_0xfd67('0x23')]()[_0xfd67('0x24')](function(_0x55830b){if(_0x55830b['length']){var _0xfb4ec2=_[_0xfd67('0x22')](_0x55830b,function(_0x293c44){return _0x293c44[_0xfd67('0x25')]===_0x1229a9;});if(_0xfb4ec2){logger[_0xfd67('0x1d')](_0xfd67('0x26'),_0x1229a9);return BPromise['resolve']({'id':_0xfb4ec2['Id'],'name':_0xfb4ec2[_0xfd67('0x27')]});}}else{logger[_0xfd67('0x1d')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x1229a9);return _0x370de3['identity']()['then'](function(_0x2a01cb){return BPromise[_0xfd67('0x28')]({'id':_0x2a01cb['user_id'],'name':_0x2a01cb[_0xfd67('0x29')]});});}});}else{logger[_0xfd67('0x1d')](_0xfd67('0x2a'),_0x1229a9);return _0x370de3[_0xfd67('0x2b')]()['then'](function(_0x280301){return BPromise['resolve']({'id':_0x280301['user_id'],'name':_0x280301[_0xfd67('0x29')]});});}}function getEndUser(_0xc0eef9,_0x5326cd,_0x1c1101,_0x52cc36,_0x1c43f8){var _0x45acfb={'$or':{'Phone':_0x52cc36}};var _0x5d5719={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xfd67('0x28')]()[_0xfd67('0x24')](function(){logger['info'](_0xfd67('0x2c'),_0x52cc36,_0x5326cd['moduleSearch']);switch(_0x5326cd['moduleSearch']){case _0xfd67('0x2d'):var _0x36946a=_[_0xfd67('0x2e')](_0x45acfb);if(_0x5326cd[_0xfd67('0x2f')]){var _0x5c50c2={};_0x5c50c2[_0x5326cd['additionalSearchContact']]=_0x52cc36;_[_0xfd67('0x30')](_0x36946a[_0xfd67('0x31')],_0x5c50c2);}return _0x1c43f8[_0xfd67('0x1e')]('Contact')['find'](_0x36946a,_0x5d5719)[_0xfd67('0x23')]()[_0xfd67('0x24')](function(_0x55ba64){if(_0x55ba64&&_0x55ba64[_0xfd67('0x32')]){return _0x55ba64;}else{var _0x29ad54=_[_0xfd67('0x2e')](_0x45acfb);if(_0x5326cd[_0xfd67('0x33')]){var _0x1d3edb={};_0x1d3edb[_0x5326cd[_0xfd67('0x33')]]=_0x52cc36;_[_0xfd67('0x30')](_0x29ad54['$or'],_0x1d3edb);}return _0x1c43f8['sobject'](_0xfd67('0x34'))[_0xfd67('0x22')](_0x29ad54,_0x5d5719);}});case'account_contact_lead':var _0x27357c=_[_0xfd67('0x2e')](_0x45acfb);if(_0x5326cd[_0xfd67('0x35')]){var _0x5c50c2={};_0x5c50c2[_0x5326cd[_0xfd67('0x35')]]=_0x52cc36;_[_0xfd67('0x30')](_0x27357c[_0xfd67('0x31')],_0x5c50c2);}return _0x1c43f8[_0xfd67('0x1e')](_0xfd67('0x36'))[_0xfd67('0x22')](_0x27357c,_0x5d5719)[_0xfd67('0x23')]()[_0xfd67('0x24')](function(_0x26bd0b){if(_0x26bd0b&&_0x26bd0b[_0xfd67('0x32')]){return _0x26bd0b;}else{var _0x5d03c9=_['cloneDeep'](_0x45acfb);if(_0x5326cd[_0xfd67('0x2f')]){var _0x2df85d={};_0x2df85d[_0x5326cd[_0xfd67('0x2f')]]=_0x52cc36;_[_0xfd67('0x30')](_0x5d03c9[_0xfd67('0x31')],_0x2df85d);}return _0x1c43f8[_0xfd67('0x1e')](_0xfd67('0x37'))[_0xfd67('0x22')](_0x5d03c9,_0x5d5719)[_0xfd67('0x24')](function(_0x97434f){if(_0x97434f&&_0x97434f['length']){return _0x97434f;}else{var _0x1eafb9=_[_0xfd67('0x2e')](_0x45acfb);if(_0x5326cd[_0xfd67('0x33')]){var _0x241f18={};_0x241f18[_0x5326cd[_0xfd67('0x33')]]=_0x52cc36;_[_0xfd67('0x30')](_0x1eafb9[_0xfd67('0x31')],_0x241f18);}return _0x1c43f8['sobject'](_0xfd67('0x34'))[_0xfd67('0x22')](_0x1eafb9,_0x5d5719);}});}});case _0xfd67('0x15'):var _0x36946a=_['cloneDeep'](_0x45acfb);if(_0x5326cd[_0xfd67('0x2f')]){var _0x5c50c2={};_0x5c50c2[_0x5326cd[_0xfd67('0x2f')]]=_0x52cc36;_[_0xfd67('0x30')](_0x36946a[_0xfd67('0x31')],_0x5c50c2);}return _0x1c43f8[_0xfd67('0x1e')](_0xfd67('0x37'))['find'](_0x36946a,_0x5d5719)[_0xfd67('0x23')]();case _0xfd67('0x38'):var _0x318972=_[_0xfd67('0x2e')](_0x45acfb);if(_0x5326cd[_0xfd67('0x33')]){var _0x5c50c2={};_0x5c50c2[_0x5326cd['additionalSearchLead']]=_0x52cc36;_[_0xfd67('0x30')](_0x318972['$or'],_0x5c50c2);}return _0x1c43f8['sobject'](_0xfd67('0x34'))[_0xfd67('0x22')](_0x318972,_0x5d5719);case _0xfd67('0x17'):var _0x27357c=_['cloneDeep'](_0x45acfb);if(_0x5326cd[_0xfd67('0x35')]){var _0x5c50c2={};_0x5c50c2[_0x5326cd[_0xfd67('0x35')]]=_0x52cc36;_[_0xfd67('0x30')](_0x27357c[_0xfd67('0x31')],_0x5c50c2);}return _0x1c43f8[_0xfd67('0x1e')](_0xfd67('0x36'))[_0xfd67('0x22')](_0x27357c,_0x5d5719);default:return null;}})[_0xfd67('0x24')](function(_0xa5766a){if(_0xa5766a&&_0xa5766a[_0xfd67('0x32')]){var _0x1e3625=_[_0xfd67('0x39')](_0xa5766a);if(_0x1e3625){return BPromise[_0xfd67('0x28')]({'id':_0x1e3625['Id'],'name':_0x1e3625[_0xfd67('0x27')],'phone':_0x1e3625[_0xfd67('0x3a')],'endUserType':_0x1e3625['attributes'][_0xfd67('0x3b')][_0xfd67('0x3c')]()});}}})[_0xfd67('0x24')](function(_0x3d56dd){if(_0x3d56dd){logger[_0xfd67('0x1d')](_0xfd67('0x3d'),_0x3d56dd[_0xfd67('0x19')],_0x52cc36);return BPromise[_0xfd67('0x28')](_0x3d56dd);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x52cc36);var _0x41e1dc={'Phone':_0x52cc36};if(_0x5326cd[_0xfd67('0x3e')]){if(_0x5326cd[_0xfd67('0x3e')]===_0xfd67('0x15')){logger[_0xfd67('0x1d')](_0xfd67('0x3f'),_0x52cc36,_0x5326cd[_0xfd67('0x3e')]);_0x41e1dc['LastName']=_0x1c1101!==_0xfd67('0x40')?_0x1c1101:util[_0xfd67('0x41')]('Caller\x20-\x20%s',_0x52cc36);}else if(_0x5326cd[_0xfd67('0x3e')]===_0xfd67('0x38')){logger[_0xfd67('0x1d')](_0xfd67('0x3f'),_0x52cc36,_0x5326cd[_0xfd67('0x3e')]);_0x41e1dc[_0xfd67('0x42')]=_0x1c1101!=='<unknown>'?_0x1c1101:util[_0xfd67('0x41')]('Caller\x20-\x20%s',_0x52cc36);_0x41e1dc[_0xfd67('0x43')]=_0xfd67('0x44');}else if(_0x5326cd[_0xfd67('0x3e')]===_0xfd67('0x17')){logger[_0xfd67('0x1d')](_0xfd67('0x3f'),_0x52cc36,_0x5326cd[_0xfd67('0x3e')]);_0x41e1dc[_0xfd67('0x27')]=_0x1c1101!=='<unknown>'?_0x1c1101:util[_0xfd67('0x41')]('Caller\x20-\x20%s',_0x52cc36);}else{return null;}}return _0x1c43f8['sobject'](_[_0xfd67('0x45')](_0x5326cd['moduleCreate']))[_0xfd67('0x1f')](_0x41e1dc)[_0xfd67('0x24')](function(_0x22d46b){return BPromise[_0xfd67('0x28')]({'id':_0x22d46b['id'],'endUserType':_0x5326cd[_0xfd67('0x3e')]});});}});}function getCustomFields(_0x51ab62,_0x4a837e){var _0x1b6f15={};if(_0x51ab62['length']>0x0){_[_0xfd67('0x46')](_0x51ab62,function(_0x23ddcb){if(_[_0xfd67('0x47')](['string',_0xfd67('0x48')],_0x23ddcb[_0xfd67('0x3b')])&&_0x23ddcb[_0xfd67('0x49')]){_0x1b6f15[_0x23ddcb[_0xfd67('0x49')]]=_0x23ddcb['content'][_0xfd67('0x4a')]();}else if(_0x23ddcb[_0xfd67('0x3b')]===_0xfd67('0x4b')&&_0x23ddcb[_0xfd67('0x4c')]&&_0x23ddcb['idField']){_0x4a837e[_0x23ddcb[_0xfd67('0x4c')]]&&(_0x1b6f15[_0x23ddcb['idField']]=_0x4a837e[_0x23ddcb['variableName']][_0xfd67('0x4a')]());}else if(_0x23ddcb[_0xfd67('0x3b')]===_0xfd67('0x4d')&&_0x23ddcb[_0xfd67('0x4e')]&&_0x23ddcb['Variable']['name']&&_0x23ddcb[_0xfd67('0x49')]){_0x4a837e[_0x23ddcb[_0xfd67('0x4e')][_0xfd67('0x4f')][_0xfd67('0x3c')]()]&&(_0x1b6f15[_0x23ddcb[_0xfd67('0x49')]]=_0x4a837e[_0x23ddcb[_0xfd67('0x4e')]['name'][_0xfd67('0x3c')]()][_0xfd67('0x4a')]());}});}return _0x1b6f15;}function getConnection(_0x33b8cf){var _0x3d65d7=_0x33b8cf[_0xfd67('0x50')][_0xfd67('0x51')](_0x33b8cf[_0xfd67('0x52')]);var _0x1fb6ac=new jsforce['Connection']({'oauth2':{'loginUrl':_0x33b8cf['remoteUri']||'https://login.salesforce.com','clientId':_0x33b8cf[_0xfd67('0x53')],'clientSecret':_0x33b8cf[_0xfd67('0x54')]}});return _0x1fb6ac['login'](_0x33b8cf[_0xfd67('0x55')],_0x3d65d7)[_0xfd67('0x24')](function(){logger[_0xfd67('0x1d')](_0xfd67('0x56'));return _0x1fb6ac;});}exports['queue']=function(_0x4ae72a,_0x25ff88,_0x1a8e72,_0x123950,_0xb9ee0e,_0x2bb7bd){var _0x35b21b,_0x2bb6a3,_0x2d6306,_0x257f9f;_0x2bb7bd[_0xfd67('0x57')]=intUtil[_0xfd67('0x58')](_0x2bb7bd[_0xfd67('0x57')]);_0x2bb7bd[_0xfd67('0x59')]=intUtil[_0xfd67('0x58')](_0x2bb7bd[_0xfd67('0x59')]);if(_0xb9ee0e&&_0xb9ee0e[_0xfd67('0x5a')]){logger['info'](_0xfd67('0x5b'),_0xfd67('0x5c'));_0x25ff88[_0xfd67('0x5d')]=util[_0xfd67('0x41')](_0xfd67('0x5e'),_0x2bb7bd[_0xfd67('0x57')],_0x25ff88[_0xfd67('0x5f')],md5(_0x25ff88[_0xfd67('0x5f')]));}else{_0x25ff88['recordingURL']='';}return getConnection(_0x2bb7bd)[_0xfd67('0x24')](function(_0x22f600){_0x257f9f=_0x22f600;return getUser(_0x2bb7bd,_0x123950[_0xfd67('0x60')],_0x257f9f);})['then'](function(_0x20ae44){_0x35b21b=_0x20ae44;return getEndUser(_0x2bb7bd,_0x1a8e72,_0x25ff88[_0xfd67('0x61')],_0x25ff88['calleridnum'],_0x257f9f);})['then'](function(_0x1ce078){_0x2bb6a3=_0x1ce078;return getTicket(_0x2bb7bd,_0x35b21b,_0x2bb6a3,_0x1a8e72,_0x25ff88,_0x1a8e72[_0xfd67('0x62')],_0x257f9f,_0xfd67('0x63'));})[_0xfd67('0x24')](function(_0x5660f3){_0x2d6306=_0x5660f3;logger[_0xfd67('0x1d')](_0xfd67('0x64'),_0x2d6306['id']);logger[_0xfd67('0x1d')](_0xfd67('0x65'),_0x2d6306['id'],_0x123950[_0xfd67('0x4f')],_0x2bb7bd[_0xfd67('0x3b')]);switch(_0x2bb7bd['type']){case _0xfd67('0x66'):emit(util[_0xfd67('0x41')](_0xfd67('0x67'),_0x123950['name']),_0xfd67('0x68'),{'recordId':_0x2d6306['id']});break;case _0xfd67('0x69'):emit(util[_0xfd67('0x41')]('user:%s',_0x123950[_0xfd67('0x4f')]),_0xfd67('0x6a'),{'uri':util[_0xfd67('0x41')](_0xfd67('0x6b'),_0x257f9f[_0xfd67('0x6c')],_0x2d6306['id'])});break;default:logger[_0xfd67('0x6d')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xfd67('0x6e')](function(_0xd6adcf){logger[_0xfd67('0x6d')]('[QUEUE]',_0xd6adcf);});};exports['outbound']=function(_0x2d6405,_0x4e17f3,_0x3ceec8,_0x33a50e,_0x1bf85b,_0x399949,_0x2e31e9){var _0x2c814e,_0x5200be,_0x21458b,_0x3b4099;_0x399949['serverUrl']=intUtil['stripTrailingSlash'](_0x399949[_0xfd67('0x57')]);_0x399949[_0xfd67('0x59')]=intUtil[_0xfd67('0x58')](_0x399949[_0xfd67('0x59')]);if(_0x2e31e9&&_0x2e31e9[_0xfd67('0x6f')]&&_0x2e31e9[_0xfd67('0x6f')]!==_0xfd67('0x70')){logger[_0xfd67('0x1d')](_0xfd67('0x71'),'Recording\x20is\x20enabled!');_0x4e17f3[_0xfd67('0x5d')]=util[_0xfd67('0x41')](_0xfd67('0x5e'),_0x399949['serverUrl'],_0x4e17f3['uniqueid'],md5(_0x4e17f3[_0xfd67('0x5f')]));}return getConnection(_0x399949)[_0xfd67('0x24')](function(_0x242a7c){_0x3b4099=_0x242a7c;return getUser(_0x399949,_0x33a50e[_0xfd67('0x60')],_0x3b4099);})[_0xfd67('0x24')](function(_0x11786b){_0x2c814e=_0x11786b;return getEndUser(_0x399949,_0x3ceec8,_0x4e17f3[_0xfd67('0x72')],_0x4e17f3[_0xfd67('0x73')],_0x3b4099);})[_0xfd67('0x24')](function(_0x90ee12){_0x5200be=_0x90ee12;return getTicket(_0x399949,_0x2c814e,_0x5200be,_0x3ceec8,_0x4e17f3,_0x3ceec8[_0xfd67('0x62')],_0x3b4099,'outbound');})[_0xfd67('0x24')](function(_0x2d4795){_0x21458b=_0x2d4795;logger[_0xfd67('0x1d')](_0xfd67('0x74'),_0x21458b['id']);logger[_0xfd67('0x1d')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x21458b['id'],_0x33a50e[_0xfd67('0x4f')],_0x399949[_0xfd67('0x3b')]);switch(_0x399949[_0xfd67('0x3b')]){case _0xfd67('0x66'):emit(util[_0xfd67('0x41')](_0xfd67('0x67'),_0x33a50e[_0xfd67('0x4f')]),'trigger:salesforce:display',{'recordId':_0x21458b['id']});break;case _0xfd67('0x69'):emit(util[_0xfd67('0x41')]('user:%s',_0x33a50e['name']),_0xfd67('0x6a'),{'uri':util[_0xfd67('0x41')](_0xfd67('0x6b'),_0x3b4099[_0xfd67('0x6c')],_0x21458b['id'])});break;default:logger[_0xfd67('0x6d')]('[OUTBOUND]',_0xfd67('0x75'));}})[_0xfd67('0x6e')](function(_0x456909){logger[_0xfd67('0x6d')](_0xfd67('0x71'),_0x456909);});};exports[_0xfd67('0x76')]=function(_0x141706,_0x23835e,_0xd0c705,_0x21aad9,_0x38c552,_0x1240e6){var _0x1475ff,_0x953f67,_0x5411cd,_0x2b3313;_0x1240e6[_0xfd67('0x57')]=intUtil[_0xfd67('0x58')](_0x1240e6[_0xfd67('0x57')]);_0x1240e6[_0xfd67('0x59')]=intUtil[_0xfd67('0x58')](_0x1240e6[_0xfd67('0x59')]);if(_0x38c552&&_0x38c552['monitor_format']){logger['info']('['+_0x23835e[_0xfd67('0x77')][_0xfd67('0x78')]()+']',_0xfd67('0x5c'));_0x23835e[_0xfd67('0x5d')]=util[_0xfd67('0x41')](_0xfd67('0x5e'),_0x1240e6[_0xfd67('0x57')],_0x23835e[_0xfd67('0x5f')],md5(_0x23835e['uniqueid']));}else{_0x23835e[_0xfd67('0x5d')]='';}return getConnection(_0x1240e6)[_0xfd67('0x24')](function(_0x20f321){_0x2b3313=_0x20f321;if(!_[_0xfd67('0x20')](_0x21aad9)){return getUser(_0x1240e6,_0x21aad9[_0xfd67('0x4f')],_0x2b3313);}else{return getUser(_0x1240e6,null,_0x2b3313);}})[_0xfd67('0x24')](function(_0x2ba9db){_0x1475ff=_0x2ba9db;return getEndUser(_0x1240e6,_0xd0c705,_0x23835e[_0xfd67('0x61')],_0x23835e[_0xfd67('0x79')],_0x2b3313);})[_0xfd67('0x24')](function(_0x59b9dd){_0x953f67=_0x59b9dd;return getTicket(_0x1240e6,_0x1475ff,_0x953f67,_0xd0c705,_0x23835e,_0xd0c705[_0xfd67('0x62')],_0x2b3313);})[_0xfd67('0x24')](function(_0x13a8ae){_0x5411cd=_0x13a8ae;logger[_0xfd67('0x1d')]('['+_0x23835e[_0xfd67('0x77')][_0xfd67('0x78')]()+_0xfd67('0x7a'),_0x5411cd['id']);logger['info']('['+_0x23835e['lastevent']['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x1240e6[_0xfd67('0x3b')]);})['catch'](function(_0x494920){logger[_0xfd67('0x6d')]('['+_0x23835e['lastevent'][_0xfd67('0x78')]()+']',_0x494920);});};
\ No newline at end of file
+var _0x8df6=['login','username','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','email','destcalleridname','newTab','[OUTBOUND]','unmanaged','lastevent','isNil','calleridname',']\x20Ticket\x20%s\x20created.','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','emit','assign','getString','Subjects','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','Case','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','cloneDeep','$or','Lead','account_contact_lead','additionalSearchAccount','Contact','additionalSearchLead','Account','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','Caller\x20-\x20%s','<unknown>','format','Company','No\x20Company','upperFirst','forEach','includes','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','remoteUri','clientId','clientSecret'];(function(_0x532c35,_0x378974){var _0x17a8e0=function(_0x2ec375){while(--_0x2ec375){_0x532c35['push'](_0x532c35['shift']());}};_0x17a8e0(++_0x378974);}(_0x8df6,0xa0));var _0x68df=function(_0x193094,_0x3d211b){_0x193094=_0x193094-0x0;var _0xaa46fb=_0x8df6[_0x193094];return _0xaa46fb;};'use strict';var _=require(_0x68df('0x0'));var rp=require(_0x68df('0x1'));var moment=require(_0x68df('0x2'));var BPromise=require('bluebird');var md5=require(_0x68df('0x3'));var jsforce=require(_0x68df('0x4'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x68df('0x5'));var config=require(_0x68df('0x6'));var logger=require(_0x68df('0x7'))(_0x68df('0x8'));config[_0x68df('0x9')]=_[_0x68df('0xa')](config[_0x68df('0x9')],{'host':_0x68df('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x68df('0x9')]));function emit(_0x3381e9,_0x236fe3,_0x51cebb){io['to'](_0x3381e9)[_0x68df('0xc')](_0x236fe3,_0x51cebb);}function getTicket(_0x49bfa5,_0x964d1d,_0x35092a,_0x6572b1,_0x2e065c,_0x45e23f,_0x532c2d,_0x3778c4){var _0x5afc6b=Object[_0x68df('0xd')]({},{'OwnerId':_0x964d1d['id'],'Subject':intUtil[_0x68df('0xe')](_0x6572b1[_0x68df('0xf')],_0x2e065c,'\x20'),'Description':intUtil['getString'](_0x6572b1['Descriptions'],_0x2e065c,'\x0a')},getCustomFields(_0x45e23f,_0x2e065c));if(_0x35092a){if(_0x6572b1[_0x68df('0x10')]===_0x68df('0x11')){_0x5afc6b[_0x68df('0x12')]=moment['utc']();_0x5afc6b[_0x68df('0x13')]=![];_0x5afc6b[_0x68df('0x14')]=![];if(_0x35092a[_0x68df('0x15')]===_0x68df('0x16')||_0x35092a[_0x68df('0x15')]===_0x68df('0x17')){_0x5afc6b[_0x68df('0x18')]=_0x35092a['id'];}else if(_0x35092a[_0x68df('0x15')]===_0x68df('0x19')){_0x5afc6b['WhatId']=_0x35092a['id'];}}else if(_0x6572b1[_0x68df('0x10')]===_0x68df('0x1a')){if(_0x35092a[_0x68df('0x15')]==='contact'){_0x5afc6b['ContactId']=_0x35092a['id'];}else if(_0x35092a[_0x68df('0x15')]===_0x68df('0x19')){_0x5afc6b[_0x68df('0x1b')]=_0x35092a['id'];}else if(_0x35092a[_0x68df('0x15')]===_0x68df('0x17')&&_0x6572b1[_0x68df('0x1c')]){_0x5afc6b[_0x6572b1['leadId']]=_0x35092a['id'];}else{logger[_0x68df('0x1d')](_0x68df('0x1e'));}}}return _0x532c2d[_0x68df('0x1f')](_0x6572b1[_0x68df('0x10')])[_0x68df('0x20')](_0x5afc6b);}function getUser(_0x48cf48,_0x13dee3,_0x4505da){if(!_['isNil'](_0x13dee3)&&intUtil[_0x68df('0x21')](_0x13dee3)){var _0x777d77={'Email':_0x13dee3};var _0x17acb1={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4505da['sobject'](_0x68df('0x22'))[_0x68df('0x23')](_0x777d77,_0x17acb1)[_0x68df('0x24')]()[_0x68df('0x25')](function(_0x5a9f67){if(_0x5a9f67[_0x68df('0x26')]){var _0x1b30b5=_[_0x68df('0x23')](_0x5a9f67,function(_0x59ad76){return _0x59ad76[_0x68df('0x27')]===_0x13dee3;});if(_0x1b30b5){logger[_0x68df('0x1d')](_0x68df('0x28'),_0x13dee3);return BPromise[_0x68df('0x29')]({'id':_0x1b30b5['Id'],'name':_0x1b30b5[_0x68df('0x2a')]});}}else{logger[_0x68df('0x1d')](_0x68df('0x2b'),_0x13dee3);return _0x4505da[_0x68df('0x2c')]()[_0x68df('0x25')](function(_0xa73e2f){return BPromise[_0x68df('0x29')]({'id':_0xa73e2f[_0x68df('0x2d')],'name':_0xa73e2f['display_name']});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x13dee3);return _0x4505da['identity']()[_0x68df('0x25')](function(_0x328233){return BPromise[_0x68df('0x29')]({'id':_0x328233['user_id'],'name':_0x328233[_0x68df('0x2e')]});});}}function getEndUser(_0x57fb95,_0x512079,_0x40a0d3,_0x458408,_0x1c4cf5){var _0x1356e7={'$or':{'Phone':_0x458408}};var _0x4b578d={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x68df('0x29')]()[_0x68df('0x25')](function(){logger[_0x68df('0x1d')](_0x68df('0x2f'),_0x458408,_0x512079[_0x68df('0x30')]);switch(_0x512079[_0x68df('0x30')]){case _0x68df('0x31'):var _0x5e2a04=_['cloneDeep'](_0x1356e7);if(_0x512079[_0x68df('0x32')]){var _0x4173bb={};_0x4173bb[_0x512079[_0x68df('0x32')]]=_0x458408;_[_0x68df('0x33')](_0x5e2a04['$or'],_0x4173bb);}return _0x1c4cf5['sobject']('Contact')[_0x68df('0x23')](_0x5e2a04,_0x4b578d)[_0x68df('0x24')]()[_0x68df('0x25')](function(_0x525cbf){if(_0x525cbf&&_0x525cbf[_0x68df('0x26')]){return _0x525cbf;}else{var _0x1bb55b=_[_0x68df('0x34')](_0x1356e7);if(_0x512079['additionalSearchLead']){var _0x5b5456={};_0x5b5456[_0x512079['additionalSearchLead']]=_0x458408;_['merge'](_0x1bb55b[_0x68df('0x35')],_0x5b5456);}return _0x1c4cf5[_0x68df('0x1f')](_0x68df('0x36'))[_0x68df('0x23')](_0x1bb55b,_0x4b578d);}});case _0x68df('0x37'):var _0x4313ec=_[_0x68df('0x34')](_0x1356e7);if(_0x512079[_0x68df('0x38')]){var _0x4173bb={};_0x4173bb[_0x512079['additionalSearchAccount']]=_0x458408;_[_0x68df('0x33')](_0x4313ec[_0x68df('0x35')],_0x4173bb);}return _0x1c4cf5[_0x68df('0x1f')]('Account')[_0x68df('0x23')](_0x4313ec,_0x4b578d)['execute']()['then'](function(_0x12d77d){if(_0x12d77d&&_0x12d77d[_0x68df('0x26')]){return _0x12d77d;}else{var _0x420e93=_[_0x68df('0x34')](_0x1356e7);if(_0x512079[_0x68df('0x32')]){var _0x1bcfa5={};_0x1bcfa5[_0x512079['additionalSearchContact']]=_0x458408;_[_0x68df('0x33')](_0x420e93[_0x68df('0x35')],_0x1bcfa5);}return _0x1c4cf5['sobject'](_0x68df('0x39'))[_0x68df('0x23')](_0x420e93,_0x4b578d)[_0x68df('0x25')](function(_0x4ee564){if(_0x4ee564&&_0x4ee564[_0x68df('0x26')]){return _0x4ee564;}else{var _0x4c6b52=_[_0x68df('0x34')](_0x1356e7);if(_0x512079[_0x68df('0x3a')]){var _0x358e67={};_0x358e67[_0x512079[_0x68df('0x3a')]]=_0x458408;_[_0x68df('0x33')](_0x4c6b52[_0x68df('0x35')],_0x358e67);}return _0x1c4cf5['sobject']('Lead')['find'](_0x4c6b52,_0x4b578d);}});}});case'contact':var _0x5e2a04=_['cloneDeep'](_0x1356e7);if(_0x512079[_0x68df('0x32')]){var _0x4173bb={};_0x4173bb[_0x512079[_0x68df('0x32')]]=_0x458408;_[_0x68df('0x33')](_0x5e2a04[_0x68df('0x35')],_0x4173bb);}return _0x1c4cf5['sobject'](_0x68df('0x39'))[_0x68df('0x23')](_0x5e2a04,_0x4b578d)[_0x68df('0x24')]();case _0x68df('0x17'):var _0x2d9f7a=_[_0x68df('0x34')](_0x1356e7);if(_0x512079[_0x68df('0x3a')]){var _0x4173bb={};_0x4173bb[_0x512079['additionalSearchLead']]=_0x458408;_[_0x68df('0x33')](_0x2d9f7a[_0x68df('0x35')],_0x4173bb);}return _0x1c4cf5['sobject'](_0x68df('0x36'))[_0x68df('0x23')](_0x2d9f7a,_0x4b578d);case'account':var _0x4313ec=_[_0x68df('0x34')](_0x1356e7);if(_0x512079[_0x68df('0x38')]){var _0x4173bb={};_0x4173bb[_0x512079[_0x68df('0x38')]]=_0x458408;_[_0x68df('0x33')](_0x4313ec[_0x68df('0x35')],_0x4173bb);}return _0x1c4cf5[_0x68df('0x1f')](_0x68df('0x3b'))[_0x68df('0x23')](_0x4313ec,_0x4b578d);default:return null;}})['then'](function(_0x39ff74){if(_0x39ff74&&_0x39ff74['length']){var _0x5b6370=_['first'](_0x39ff74);if(_0x5b6370){return BPromise['resolve']({'id':_0x5b6370['Id'],'name':_0x5b6370[_0x68df('0x2a')],'phone':_0x5b6370['Phone'],'endUserType':_0x5b6370[_0x68df('0x3c')][_0x68df('0x3d')][_0x68df('0x3e')]()});}}})['then'](function(_0x36a1b8){if(_0x36a1b8){logger['info'](_0x68df('0x3f'),_0x36a1b8[_0x68df('0x15')],_0x458408);return BPromise['resolve'](_0x36a1b8);}else{logger[_0x68df('0x1d')](_0x68df('0x40'),_0x458408);var _0x44381e={'Phone':_0x458408};if(_0x512079[_0x68df('0x41')]){if(_0x512079['moduleCreate']===_0x68df('0x16')){logger[_0x68df('0x1d')](_0x68df('0x42'),_0x458408,_0x512079['moduleCreate']);_0x44381e[_0x68df('0x43')]=_0x40a0d3!=='<unknown>'?_0x40a0d3:util['format'](_0x68df('0x44'),_0x458408);}else if(_0x512079[_0x68df('0x41')]===_0x68df('0x17')){logger[_0x68df('0x1d')](_0x68df('0x42'),_0x458408,_0x512079[_0x68df('0x41')]);_0x44381e[_0x68df('0x43')]=_0x40a0d3!==_0x68df('0x45')?_0x40a0d3:util[_0x68df('0x46')](_0x68df('0x44'),_0x458408);_0x44381e[_0x68df('0x47')]=_0x68df('0x48');}else if(_0x512079[_0x68df('0x41')]===_0x68df('0x19')){logger[_0x68df('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x458408,_0x512079[_0x68df('0x41')]);_0x44381e[_0x68df('0x2a')]=_0x40a0d3!=='<unknown>'?_0x40a0d3:util[_0x68df('0x46')](_0x68df('0x44'),_0x458408);}else{return null;}}return _0x1c4cf5['sobject'](_[_0x68df('0x49')](_0x512079[_0x68df('0x41')]))[_0x68df('0x20')](_0x44381e)[_0x68df('0x25')](function(_0x29971d){return BPromise['resolve']({'id':_0x29971d['id'],'endUserType':_0x512079[_0x68df('0x41')]});});}});}function getCustomFields(_0x3c048a,_0x364fa6){var _0x1f791a={};if(_0x3c048a[_0x68df('0x26')]>0x0){_[_0x68df('0x4a')](_0x3c048a,function(_0x36678b){if(_[_0x68df('0x4b')](['string','picklist'],_0x36678b[_0x68df('0x3d')])&&_0x36678b[_0x68df('0x4c')]){_0x1f791a[_0x36678b[_0x68df('0x4c')]]=_0x36678b[_0x68df('0x4d')][_0x68df('0x4e')]();}else if(_0x36678b[_0x68df('0x3d')]===_0x68df('0x4f')&&_0x36678b[_0x68df('0x50')]&&_0x36678b[_0x68df('0x4c')]){_0x364fa6[_0x36678b[_0x68df('0x50')]]&&(_0x1f791a[_0x36678b['idField']]=_0x364fa6[_0x36678b[_0x68df('0x50')]][_0x68df('0x4e')]());}else if(_0x36678b[_0x68df('0x3d')]===_0x68df('0x51')&&_0x36678b[_0x68df('0x52')]&&_0x36678b[_0x68df('0x52')][_0x68df('0x53')]&&_0x36678b[_0x68df('0x4c')]){_0x364fa6[_0x36678b['Variable'][_0x68df('0x53')][_0x68df('0x3e')]()]&&(_0x1f791a[_0x36678b[_0x68df('0x4c')]]=_0x364fa6[_0x36678b['Variable']['name'][_0x68df('0x3e')]()][_0x68df('0x4e')]());}});}return _0x1f791a;}function getConnection(_0x301354){var _0x59c597=_0x301354[_0x68df('0x54')][_0x68df('0x55')](_0x301354[_0x68df('0x56')]);var _0x4a7be3=new jsforce['Connection']({'oauth2':{'loginUrl':_0x301354[_0x68df('0x57')]||'https://login.salesforce.com','clientId':_0x301354[_0x68df('0x58')],'clientSecret':_0x301354[_0x68df('0x59')]}});return _0x4a7be3[_0x68df('0x5a')](_0x301354[_0x68df('0x5b')],_0x59c597)['then'](function(){logger[_0x68df('0x1d')]('Connection\x20established.');return _0x4a7be3;});}exports['queue']=function(_0x8e951c,_0x2397a0,_0xb4003f,_0x4a4d38,_0x599150,_0x4659f5){var _0x4e3e3f,_0x8e6099,_0x8378cd,_0x462b0a;_0x4659f5[_0x68df('0x5c')]=intUtil[_0x68df('0x5d')](_0x4659f5['serverUrl']);_0x4659f5['remoteUri']=intUtil[_0x68df('0x5d')](_0x4659f5[_0x68df('0x57')]);if(_0x599150&&_0x599150[_0x68df('0x5e')]){logger[_0x68df('0x1d')](_0x68df('0x5f'),_0x68df('0x60'));_0x2397a0[_0x68df('0x61')]=util[_0x68df('0x46')](_0x68df('0x62'),_0x4659f5[_0x68df('0x5c')],_0x2397a0[_0x68df('0x63')],md5(_0x2397a0[_0x68df('0x63')]));}else{_0x2397a0[_0x68df('0x61')]='';}return getConnection(_0x4659f5)[_0x68df('0x25')](function(_0x59e4e8){_0x462b0a=_0x59e4e8;return getUser(_0x4659f5,_0x4a4d38['email'],_0x462b0a);})['then'](function(_0x499a47){_0x4e3e3f=_0x499a47;return getEndUser(_0x4659f5,_0xb4003f,_0x2397a0['calleridname'],_0x2397a0[_0x68df('0x64')],_0x462b0a);})['then'](function(_0x5a82a8){_0x8e6099=_0x5a82a8;return getTicket(_0x4659f5,_0x4e3e3f,_0x8e6099,_0xb4003f,_0x2397a0,_0xb4003f[_0x68df('0x65')],_0x462b0a,'queue');})[_0x68df('0x25')](function(_0x561081){_0x8378cd=_0x561081;logger[_0x68df('0x1d')](_0x68df('0x66'),_0x8378cd['id']);logger[_0x68df('0x1d')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x8378cd['id'],_0x4a4d38[_0x68df('0x53')],_0x4659f5[_0x68df('0x3d')]);switch(_0x4659f5[_0x68df('0x3d')]){case'integrationTab':emit(util[_0x68df('0x46')](_0x68df('0x67'),_0x4a4d38['name']),_0x68df('0x68'),{'recordId':_0x8378cd['id']});break;case'newTab':emit(util[_0x68df('0x46')](_0x68df('0x67'),_0x4a4d38[_0x68df('0x53')]),_0x68df('0x69'),{'uri':util[_0x68df('0x46')](_0x68df('0x6a'),_0x462b0a[_0x68df('0x6b')],_0x8378cd['id'])});break;default:logger[_0x68df('0x6c')](_0x68df('0x6d'));}})[_0x68df('0x6e')](function(_0x3fd1a9){logger[_0x68df('0x6c')](_0x68df('0x5f'),_0x3fd1a9);});};exports[_0x68df('0x6f')]=function(_0x656b80,_0x41b638,_0x1a4b07,_0x457c0b,_0x323b9e,_0x3d32dc,_0x24f3f1){var _0x35b38c,_0x1e808d,_0xf62fb9,_0x435e0d;_0x3d32dc[_0x68df('0x5c')]=intUtil[_0x68df('0x5d')](_0x3d32dc[_0x68df('0x5c')]);_0x3d32dc['remoteUri']=intUtil[_0x68df('0x5d')](_0x3d32dc[_0x68df('0x57')]);if(_0x24f3f1&&_0x24f3f1['recordingFormat']&&_0x24f3f1[_0x68df('0x70')]!==_0x68df('0x71')){logger[_0x68df('0x1d')]('[OUTBOUND]',_0x68df('0x60'));_0x41b638[_0x68df('0x61')]=util['format'](_0x68df('0x62'),_0x3d32dc['serverUrl'],_0x41b638[_0x68df('0x63')],md5(_0x41b638[_0x68df('0x63')]));}return getConnection(_0x3d32dc)[_0x68df('0x25')](function(_0xc27488){_0x435e0d=_0xc27488;return getUser(_0x3d32dc,_0x457c0b[_0x68df('0x72')],_0x435e0d);})[_0x68df('0x25')](function(_0x3b1ca7){_0x35b38c=_0x3b1ca7;return getEndUser(_0x3d32dc,_0x1a4b07,_0x41b638[_0x68df('0x73')],_0x41b638['destcalleridnum'],_0x435e0d);})['then'](function(_0x15d6fa){_0x1e808d=_0x15d6fa;return getTicket(_0x3d32dc,_0x35b38c,_0x1e808d,_0x1a4b07,_0x41b638,_0x1a4b07[_0x68df('0x65')],_0x435e0d,_0x68df('0x6f'));})[_0x68df('0x25')](function(_0x4985ef){_0xf62fb9=_0x4985ef;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0xf62fb9['id']);logger[_0x68df('0x1d')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0xf62fb9['id'],_0x457c0b[_0x68df('0x53')],_0x3d32dc['type']);switch(_0x3d32dc[_0x68df('0x3d')]){case'integrationTab':emit(util[_0x68df('0x46')]('user:%s',_0x457c0b[_0x68df('0x53')]),_0x68df('0x68'),{'recordId':_0xf62fb9['id']});break;case _0x68df('0x74'):emit(util[_0x68df('0x46')]('user:%s',_0x457c0b[_0x68df('0x53')]),_0x68df('0x69'),{'uri':util['format'](_0x68df('0x6a'),_0x435e0d[_0x68df('0x6b')],_0xf62fb9['id'])});break;default:logger['error'](_0x68df('0x75'),'Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x468430){logger[_0x68df('0x6c')](_0x68df('0x75'),_0x468430);});};exports[_0x68df('0x76')]=function(_0x3a43cb,_0x46f6be,_0x378ad2,_0x3abef0,_0x590dcb,_0x15ccf2){var _0x116037,_0x25fd3b,_0x4e4037,_0x1a169b;_0x15ccf2[_0x68df('0x5c')]=intUtil[_0x68df('0x5d')](_0x15ccf2['serverUrl']);_0x15ccf2[_0x68df('0x57')]=intUtil[_0x68df('0x5d')](_0x15ccf2[_0x68df('0x57')]);if(_0x590dcb&&_0x590dcb[_0x68df('0x5e')]){logger[_0x68df('0x1d')]('['+_0x46f6be[_0x68df('0x77')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x46f6be[_0x68df('0x61')]=util[_0x68df('0x46')](_0x68df('0x62'),_0x15ccf2[_0x68df('0x5c')],_0x46f6be[_0x68df('0x63')],md5(_0x46f6be['uniqueid']));}else{_0x46f6be[_0x68df('0x61')]='';}return getConnection(_0x15ccf2)['then'](function(_0x32cb0d){_0x1a169b=_0x32cb0d;if(!_[_0x68df('0x78')](_0x3abef0)){return getUser(_0x15ccf2,_0x3abef0[_0x68df('0x53')],_0x1a169b);}else{return getUser(_0x15ccf2,null,_0x1a169b);}})[_0x68df('0x25')](function(_0x1cb43c){_0x116037=_0x1cb43c;return getEndUser(_0x15ccf2,_0x378ad2,_0x46f6be[_0x68df('0x79')],_0x46f6be[_0x68df('0x64')],_0x1a169b);})['then'](function(_0x3aaced){_0x25fd3b=_0x3aaced;return getTicket(_0x15ccf2,_0x116037,_0x25fd3b,_0x378ad2,_0x46f6be,_0x378ad2[_0x68df('0x65')],_0x1a169b);})[_0x68df('0x25')](function(_0x187e5d){_0x4e4037=_0x187e5d;logger[_0x68df('0x1d')]('['+_0x46f6be[_0x68df('0x77')]['toUpperCase']()+_0x68df('0x7a'),_0x4e4037['id']);logger[_0x68df('0x1d')]('['+_0x46f6be[_0x68df('0x77')][_0x68df('0x7b')]()+_0x68df('0x7c'),_0x15ccf2['type']);})[_0x68df('0x6e')](function(_0x4c5076){logger['error']('['+_0x46f6be[_0x68df('0x77')][_0x68df('0x7b')]()+']',_0x4c5076);});};
\ No newline at end of file
index 96642d6..ab6dc66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30b1=['label','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','user:%s','emit','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','format','%s/api/now/table/','isNil','calleridnum','callDirection','queue','unmanaged','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','ticketId','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','bluebird','util','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','],\x20getAdminUser\x20crm','catch','toUpperCase','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','user','endUserNumber','System','],\x20EndUser\x20schema','endUserId','message','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','forEach','includes','string','picklist','type','nameField','content','idField','customField','toLowerCase','toString','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','Subjects','getString','Descriptions','Fields','ticketNumber','number',']\x20getTicket\x20crm'];(function(_0x5778cc,_0x1fd884){var _0x439f9d=function(_0x10347a){while(--_0x10347a){_0x5778cc['push'](_0x5778cc['shift']());}};_0x439f9d(++_0x1fd884);}(_0x30b1,0x1c5));var _0x130b=function(_0x472930,_0x561bf7){_0x472930=_0x472930-0x0;var _0x54fd79=_0x30b1[_0x472930];return _0x54fd79;};'use strict';var _=require('lodash');var Promise=require(_0x130b('0x0'));var rp=require('request-promise');var util=require(_0x130b('0x1'));var md5=require('md5');var Redis=require('ioredis');var intUtil=require(_0x130b('0x2'));var config=require(_0x130b('0x3'));var logger=require(_0x130b('0x4'))(_0x130b('0x5'));config[_0x130b('0x6')]=_[_0x130b('0x7')](config[_0x130b('0x6')],{'host':_0x130b('0x8'),'port':0x18eb});var io=require(_0x130b('0x9'))(new Redis(config[_0x130b('0x6')]));function getAdminUser(_0x17c061,_0x3a50fc,_0x3111e7,_0x4856f4,_0x12cf73,_0x5b9258){return new Promise(function(_0x210d84,_0x29c9e2){var _0x182356={'method':_0x130b('0xa'),'uri':_0x4856f4+_0x130b('0xb')+'&'+_0x12cf73+'&'+_0x5b9258,'auth':_0x3a50fc,'json':!![]};return rp(_0x182356)[_0x130b('0xc')](function(_0x1bfce9){if(_0x1bfce9[_0x130b('0xd')][_0x130b('0xe')]>0x0){_0x3111e7[_0x130b('0xf')]=_0x1bfce9[_0x130b('0xd')][0x0][_0x130b('0x10')];}logger['info']('['+[_0x17c061['toUpperCase']()]+_0x130b('0x11'),_0x3111e7);_0x210d84(_0x3111e7);})[_0x130b('0x12')](function(_0x28c585){logger['error']('['+[_0x17c061[_0x130b('0x13')]()]+']',_0x28c585['message']);_0x29c9e2(_0x28c585['message']);});});}function getUser(_0x425b71,_0x197714,_0x3f4058,_0x5a09c9,_0x37fac2){return function(_0x209601){logger[_0x130b('0x14')]('['+[_0x425b71[_0x130b('0x13')]()]+_0x130b('0x15'),_0x209601);return new Promise(function(_0x47a727,_0x12e991){if(intUtil[_0x130b('0x16')](_0x209601['userEmail'])){var _0x666f07={'method':'GET','uri':_0x3f4058+'sys_user?sysparm_query=email%3D'+_0x209601[_0x130b('0x17')]+'&'+_0x5a09c9+'&'+_0x37fac2,'auth':_0x197714,'json':!![]};logger[_0x130b('0x14')]('['+[_0x425b71['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x666f07);return rp(_0x666f07)[_0x130b('0xc')](function(_0x2ae766){logger[_0x130b('0x14')]('['+[_0x425b71[_0x130b('0x13')]()]+_0x130b('0x18'),_0x2ae766);if(_0x2ae766[_0x130b('0xd')][_0x130b('0xe')]>0x0&&String(_0x2ae766['result'][0x0][_0x130b('0x19')])===_0x130b('0x1a')){_0x209601[_0x130b('0x1b')]=_0x2ae766[_0x130b('0xd')][0x0][_0x130b('0x10')];}else{_0x209601[_0x130b('0x1b')]=_0x209601['adminId'];_0x209601[_0x130b('0x17')]=_0x209601[_0x130b('0x1c')];}logger[_0x130b('0x14')]('['+[_0x425b71[_0x130b('0x13')]()]+_0x130b('0x1d'),_0x209601);_0x47a727(_0x209601);})[_0x130b('0x12')](function(_0x394b09){logger[_0x130b('0x1e')]('['+[_0x425b71[_0x130b('0x13')]()]+']',_0x394b09['message']);_0x12e991(_0x394b09['message']);});}else{logger[_0x130b('0x14')]('['+[_0x425b71['toUpperCase']()]+_0x130b('0x1f'));_0x209601[_0x130b('0x1b')]=_0x209601[_0x130b('0xf')];_0x209601[_0x130b('0x17')]=_0x209601[_0x130b('0x1c')];_0x47a727(_0x209601);}});};}function createEndUser(_0x23ba65,_0x6a65c8,_0x5df10e,_0x5c5265,_0x123a26){logger[_0x130b('0x14')]('['+[_0x23ba65[_0x130b('0x13')]()]+_0x130b('0x20'),_0x5df10e);return new Promise(function(_0x5ee5f5,_0x8dad05){var _0x43c453={'method':_0x130b('0x21'),'uri':_0x5c5265+'sys_user?'+_0x123a26,'body':{'user_name':_0x5df10e['endUserNumber'],'roles':_0x130b('0x22'),'first_name':_0x5df10e[_0x130b('0x23')],'active':'true','date_format':_0x130b('0x24'),'phone':_0x5df10e['endUserNumber']},'auth':_0x6a65c8,'json':!![]};return rp(_0x43c453)[_0x130b('0xc')](function(_0x2eec85){logger[_0x130b('0x14')]('['+[_0x23ba65['toUpperCase']()]+_0x130b('0x25'),_0x2eec85[_0x130b('0xd')]);_0x5df10e[_0x130b('0x26')]=_0x2eec85[_0x130b('0xd')][_0x130b('0x10')];_0x5ee5f5(_0x5df10e);})[_0x130b('0x12')](function(_0x39ff47){logger[_0x130b('0x1e')]('['+[_0x23ba65['toUpperCase']()]+']',_0x39ff47[_0x130b('0x27')]);_0x8dad05(_0x39ff47[_0x130b('0x27')]);});});}function getEndUser(_0x1217df,_0x327298,_0x156c75,_0x22009a,_0x20c6fd){return function(_0xbb248b){logger[_0x130b('0x14')]('['+[_0x1217df[_0x130b('0x13')]()]+_0x130b('0x28'),_0xbb248b);return new Promise(function(_0x50168d,_0x39e3c7){var _0x34e65e={'method':_0x130b('0xa'),'uri':_0x156c75+_0x130b('0x29')+_0xbb248b['endUserNumber']+'&'+_0x22009a+'&'+_0x20c6fd,'auth':_0x327298,'json':!![]};return rp(_0x34e65e)[_0x130b('0xc')](function(_0x504a75){if(_0x504a75[_0x130b('0xd')][_0x130b('0xe')]>0x0){_0xbb248b[_0x130b('0x26')]=_0x504a75[_0x130b('0xd')][0x0]['sys_id'];logger[_0x130b('0x14')]('['+[_0x1217df[_0x130b('0x13')]()]+'],\x20getEndUser\x20crm',_0xbb248b);_0x50168d(_0xbb248b);}else{return createEndUser(_0x1217df,_0x327298,_0xbb248b,_0x156c75,_0x22009a)[_0x130b('0xc')](function(_0x292146){logger['info']('['+[_0x1217df[_0x130b('0x13')]()]+'],\x20createEndUser\x20crm',_0x292146);_0x50168d(_0x292146);});}})[_0x130b('0x12')](function(_0x27e246){logger['error']('['+[_0x1217df['toUpperCase']()]+']',_0x27e246[_0x130b('0x27')]);_0x39e3c7(_0x27e246['message']);});});};}function getCustomFields(_0x2d6ce2,_0x4ed865){var _0x25c37c={};if(_0x2d6ce2[_0x130b('0xe')]>0x0){_[_0x130b('0x2a')](_0x2d6ce2,function(_0x44db42){if(_[_0x130b('0x2b')]([_0x130b('0x2c'),_0x130b('0x2d')],_0x44db42[_0x130b('0x2e')])&&_0x44db42[_0x130b('0x2f')]&&!_0x44db42['customField']){_0x25c37c[_0x44db42[_0x130b('0x2f')]['toLowerCase']()]=_0x44db42[_0x130b('0x30')]['toString']();}else if(_['includes'](['string',_0x130b('0x2d')],_0x44db42[_0x130b('0x2e')])&&_0x44db42[_0x130b('0x31')]&&_0x44db42[_0x130b('0x32')]){_0x25c37c[_0x44db42[_0x130b('0x31')][_0x130b('0x33')]()]=_0x44db42[_0x130b('0x30')][_0x130b('0x34')]();}else if(_0x44db42[_0x130b('0x2e')]==='variable'&&_0x44db42[_0x130b('0x35')]&&_0x44db42[_0x130b('0x31')]&&_0x44db42[_0x130b('0x32')]){_0x25c37c[_0x44db42['idField'][_0x130b('0x33')]()]=_0x4ed865[_0x44db42['variableName']][_0x130b('0x34')]();}else if(_0x44db42[_0x130b('0x2e')]===_0x130b('0x36')&&_0x44db42[_0x130b('0x37')]&&_0x44db42[_0x130b('0x37')]['name']&&_0x44db42[_0x130b('0x31')]&&_0x44db42[_0x130b('0x32')]){_0x25c37c[_0x44db42[_0x130b('0x31')][_0x130b('0x33')]()]=_0x4ed865[_0x44db42[_0x130b('0x37')][_0x130b('0x38')][_0x130b('0x33')]()][_0x130b('0x34')]();}});}return _0x25c37c;}function getTicket(_0x3b5dee,_0x32b2d5,_0x114e67,_0x9daf9b,_0x1fcdad,_0x58aaae){return function(_0x4b71de){logger[_0x130b('0x14')]('['+[_0x3b5dee[_0x130b('0x13')]()]+_0x130b('0x39'),_0x4b71de);return new Promise(function(_0x52f443,_0x49906b){var _0x97f4b6=_0x3b5dee[_0x130b('0x33')]()===_0x130b('0x3a')?_0x4b71de[_0x130b('0x1b')]:_0x4b71de[_0x130b('0x26')];var _0x5995b3={'method':'POST','uri':_0x114e67+_0x130b('0x3b')+'?'+_0x58aaae,'body':Object['assign']({},{'active':_0x130b('0x1a'),'caller_id':_0x97f4b6,'assigned_to':_0x4b71de[_0x130b('0x1b')],'short_description':intUtil['getString'](_0x9daf9b[_0x130b('0x3c')],_0x1fcdad,'\x20'),'description':intUtil[_0x130b('0x3d')](_0x9daf9b[_0x130b('0x3e')],_0x1fcdad,'\x0a')},getCustomFields(_0x9daf9b[_0x130b('0x3f')],_0x1fcdad)),'auth':_0x32b2d5,'json':!![]};return rp(_0x5995b3)['then'](function(_0x143d28){logger['info']('['+[_0x3b5dee[_0x130b('0x13')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x143d28[_0x130b('0xd')]);_0x4b71de['ticketId']=_0x143d28['result'][_0x130b('0x10')];_0x4b71de[_0x130b('0x40')]=_0x143d28['result'][_0x130b('0x41')];logger[_0x130b('0x14')]('['+[_0x3b5dee[_0x130b('0x13')]()]+_0x130b('0x42'),_0x4b71de);_0x52f443(_0x4b71de);})[_0x130b('0x12')](function(_0x240bcf){logger['error']('['+[_0x3b5dee[_0x130b('0x13')]()]+']',_0x240bcf[_0x130b('0x27')]);_0x49906b(_0x240bcf[_0x130b('0x27')]);});});};}function createRemoteTag(_0x4d45a1,_0x54234a,_0x1650c3,_0x478450){return new Promise(function(_0x2ed224,_0x32c71e){var _0x1f48cb={'method':'POST','uri':_0x1650c3+'label'+'?'+_0x478450,'body':{'short_description':_0x4d45a1,'global':!![],'active':!![],'name':_0x4d45a1},'auth':_0x54234a,'json':!![]};return rp(_0x1f48cb)[_0x130b('0xc')](function(_0x561fec){var _0xc347d1=_0x561fec[_0x130b('0xd')][_0x130b('0x10')];_0x2ed224(_0xc347d1);});});}function getRemoteTag(_0x3bf4b5,_0x5a04ce,_0x129edf,_0x584812,_0x48f957){return new Promise(function(_0x447fa7,_0x3346ce){var _0x2bae0f={'method':_0x130b('0xa'),'uri':_0x129edf+_0x130b('0x43')+'?sysparm_query=name%3D'+_0x3bf4b5+'&'+_0x584812,'auth':_0x5a04ce,'json':!![]};return rp(_0x2bae0f)[_0x130b('0xc')](function(_0x61ee60){if(_0x61ee60['result'][_0x130b('0xe')]>0x0){var _0x4257af=_0x61ee60[_0x130b('0xd')][0x0][_0x130b('0x10')];_0x447fa7(_0x4257af);}else{return createRemoteTag(_0x3bf4b5,_0x5a04ce,_0x129edf,_0x584812)[_0x130b('0xc')](function(_0x26b1fd){_0x447fa7(_0x26b1fd);});}});});}function assignTagToIncident(_0x507e63,_0x37183e,_0x51b453,_0x301898,_0x2f54e4){return new Promise(function(_0x5dbfcd,_0x2bc75c){var _0x5efcbe={'method':_0x130b('0x21'),'uri':_0x51b453+_0x130b('0x44')+'?'+_0x2f54e4,'body':{'label':_0x507e63,'table':_0x130b('0x3b'),'id_type':_0x130b('0x45'),'table_key':_0x301898['ticketId'],'title':_0x130b('0x46')+_0x301898[_0x130b('0x40')],'id_display':_0x301898[_0x130b('0x40')]},'auth':_0x37183e,'json':!![]};return rp(_0x5efcbe)[_0x130b('0xc')](function(_0x1e6ef0){_0x5dbfcd();})[_0x130b('0x12')](function(){_0x5dbfcd();});});}function manageTags(_0x778acf,_0x25ac69,_0x3213c0,_0x1744ca,_0x102d35,_0x3d45c4,_0x332244){return new Promise(function(_0x5db92d,_0x587971){var _0x5a1a95=[];_0x25ac69[_0x130b('0x2a')](function(_0x2d00ff){_0x5a1a95[_0x130b('0x47')](getRemoteTag(_0x2d00ff,_0x3213c0,_0x1744ca,_0x3d45c4,_0x332244));});return Promise[_0x130b('0x48')](_0x5a1a95)[_0x130b('0xc')](function(_0x4b1475){if(_0x4b1475[_0x130b('0xe')]){logger[_0x130b('0x14')]('['+[_0x778acf[_0x130b('0x13')]()]+_0x130b('0x49'),_0x4b1475);var _0x317d10=[];_0x4b1475['forEach'](function(_0x38393d){_0x317d10[_0x130b('0x47')](assignTagToIncident(_0x38393d,_0x3213c0,_0x1744ca,_0x102d35,_0x3d45c4));});return Promise[_0x130b('0x48')](_0x317d10)[_0x130b('0xc')](function(){_0x5db92d();})[_0x130b('0x12')](function(){_0x5db92d();});}else{_0x5db92d();}});});}function getTags(_0x35c351,_0x27f419,_0x164e79,_0x281749,_0x26d7be,_0x2aeca6){return function(_0x54e72d){return new Promise(function(_0x1985f2,_0x4b20bd){var _0x5eaac1=[];var _0x5cb29a=_0x281749['Tags'];if(_0x5cb29a&&_0x5cb29a['length']>0x0){_0x5eaac1=_[_0x130b('0x4a')](_0x5cb29a,'name');}if(_0x5eaac1[_0x130b('0xe')]>0x0){return manageTags(_0x35c351,_0x5eaac1,_0x27f419,_0x164e79,_0x54e72d,_0x26d7be,_0x2aeca6)['then'](function(){_0x1985f2(_0x54e72d);});}else{_0x1985f2(_0x54e72d);}});};}function emit(_0x556a35,_0xeac983,_0x5e2d16){var _0x58ca0c=_0x130b('0x4b')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x130b('0x4c')+_0x130b('0x4d');var _0x4a88c3={'uri':_0x556a35+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x5e2d16+_0x58ca0c};io['to'](util['format'](_0x130b('0x4e'),_0xeac983))[_0x130b('0x4f')]('trigger:browser:url',_0x4a88c3);}exports['cs']=function(_0x3161eb,_0x159cd9,_0x232a50,_0x1681ff,_0x268294,_0x38337d,_0xbbbf0f,_0x5a6604){var _0xaae834={};var _0x2ce26e={'user':_0x38337d['username'],'pass':_0x38337d[_0x130b('0x50')]};var _0x46adcc=_0x130b('0x51');var _0x4a3007=_0x130b('0x52');_0x38337d[_0x130b('0x53')]=intUtil['stripTrailingSlash'](_0x38337d[_0x130b('0x53')]);_0x38337d[_0x130b('0x54')]=intUtil['stripTrailingSlash'](_0x38337d[_0x130b('0x54')]);var _0x177241=util[_0x130b('0x55')](_0x130b('0x56'),_0x38337d[_0x130b('0x53')]);_0xaae834[_0x130b('0x17')]=!_[_0x130b('0x57')](_0x1681ff)?_0x1681ff['email']:null;_0xaae834[_0x130b('0x1c')]=_0x38337d['email'];_0xaae834[_0x130b('0x23')]=_0x5a6604[_0x130b('0x33')]()===_0x130b('0x3a')?_0x159cd9['destcalleridnum']:_0x159cd9[_0x130b('0x58')];_0xaae834[_0x130b('0x59')]=_0x5a6604===_0x130b('0x5a')||_0x5a6604===_0x130b('0x5b')?'queue':_0x130b('0x3a');var _0x2a921c=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x38337d['serverUrl'],_0x159cd9[_0x130b('0x5c')],md5(_0x159cd9[_0x130b('0x5c')]));if(_0x268294&&_0x268294['monitor_format']){logger['info'](_0x130b('0x5d'),_0x130b('0x5e'));_0x159cd9[_0x130b('0x5f')]=_0x2a921c;}else if(_0xbbbf0f&&_0xbbbf0f[_0x130b('0x60')]&&_0xbbbf0f['recordingFormat']!==_0x130b('0x61')){logger[_0x130b('0x14')](_0x130b('0x62'),_0x130b('0x5e'));_0x159cd9[_0x130b('0x5f')]=_0x2a921c;}else{_0x159cd9[_0x130b('0x5f')]='';}return getAdminUser(_0x5a6604,_0x2ce26e,_0xaae834,_0x177241,_0x4a3007,_0x46adcc)['then'](getUser(_0x5a6604,_0x2ce26e,_0x177241,_0x4a3007,_0x46adcc))[_0x130b('0xc')](getEndUser(_0x5a6604,_0x2ce26e,_0x177241,_0x4a3007,_0x46adcc))['then'](getTicket(_0x5a6604,_0x2ce26e,_0x177241,_0x232a50,_0x159cd9,_0x4a3007))['then'](function(_0x426bfc){logger[_0x130b('0x14')](util[_0x130b('0x55')](_0x130b('0x63'),_0x426bfc[_0x130b('0x64')]));logger[_0x130b('0x14')](util[_0x130b('0x55')](_0x130b('0x65'),_0x5a6604));if(_0x5a6604!=='unmanaged'){logger['info']('['+[_0x5a6604['toUpperCase']()]+']',_0x130b('0x66'));emit(_0x38337d[_0x130b('0x53')],_0x1681ff[_0x130b('0x38')],_0x426bfc[_0x130b('0x64')]);}})[_0x130b('0x12')](function(_0x566223){logger[_0x130b('0x1e')]('['+[_0x5a6604[_0x130b('0x13')]()]+_0x130b('0x67'),util['inspect'](_0x566223,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xabff=['Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','active','userId','sys_id','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','length','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','toLowerCase','toString','idField','customField','content','variable','variableName','customVariable','Variable','name','outbound','assign','true','getString','Subjects'];(function(_0x64b6e,_0x391478){var _0x5d4448=function(_0x56985d){while(--_0x56985d){_0x64b6e['push'](_0x64b6e['shift']());}};_0x5d4448(++_0x391478);}(_0xabff,0x91));var _0xfabf=function(_0x3bd1fd,_0x1472ce){_0x3bd1fd=_0x3bd1fd-0x0;var _0x28ea80=_0xabff[_0x3bd1fd];return _0x28ea80;};'use strict';var _=require(_0xfabf('0x0'));var Promise=require(_0xfabf('0x1'));var rp=require(_0xfabf('0x2'));var util=require(_0xfabf('0x3'));var md5=require(_0xfabf('0x4'));var Redis=require(_0xfabf('0x5'));var intUtil=require('./util');var config=require(_0xfabf('0x6'));var logger=require(_0xfabf('0x7'))(_0xfabf('0x8'));config[_0xfabf('0x9')]=_[_0xfabf('0xa')](config[_0xfabf('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfabf('0x9')]));function getAdminUser(_0x5cd608,_0x16b58d,_0xa82cae,_0x327997,_0x1932a5,_0x16afde){return new Promise(function(_0x4fcee9,_0x32a758){var _0x376845={'method':_0xfabf('0xb'),'uri':_0x327997+_0xfabf('0xc')+'&'+_0x1932a5+'&'+_0x16afde,'auth':_0x16b58d,'json':!![]};return rp(_0x376845)[_0xfabf('0xd')](function(_0x3be4ed){if(_0x3be4ed[_0xfabf('0xe')]['length']>0x0){_0xa82cae[_0xfabf('0xf')]=_0x3be4ed[_0xfabf('0xe')][0x0]['sys_id'];}logger[_0xfabf('0x10')]('['+[_0x5cd608[_0xfabf('0x11')]()]+_0xfabf('0x12'),_0xa82cae);_0x4fcee9(_0xa82cae);})[_0xfabf('0x13')](function(_0x2767d5){logger[_0xfabf('0x14')]('['+[_0x5cd608[_0xfabf('0x11')]()]+']',_0x2767d5[_0xfabf('0x15')]);_0x32a758(_0x2767d5[_0xfabf('0x15')]);});});}function getUser(_0x2c663b,_0x5e6896,_0x2177e1,_0x13275b,_0x5f0750){return function(_0x28e570){logger['info']('['+[_0x2c663b['toUpperCase']()]+_0xfabf('0x16'),_0x28e570);return new Promise(function(_0x857d69,_0x4c5817){if(intUtil[_0xfabf('0x17')](_0x28e570[_0xfabf('0x18')])){var _0x314ee6={'method':_0xfabf('0xb'),'uri':_0x2177e1+'sys_user?sysparm_query=email%3D'+_0x28e570[_0xfabf('0x18')]+'&'+_0x13275b+'&'+_0x5f0750,'auth':_0x5e6896,'json':!![]};logger['info']('['+[_0x2c663b['toUpperCase']()]+_0xfabf('0x19'),_0x314ee6);return rp(_0x314ee6)[_0xfabf('0xd')](function(_0x281f24){logger[_0xfabf('0x10')]('['+[_0x2c663b['toUpperCase']()]+'],\x20getUser\x20entity',_0x281f24);if(_0x281f24[_0xfabf('0xe')]['length']>0x0&&String(_0x281f24['result'][0x0][_0xfabf('0x1a')])==='true'){_0x28e570[_0xfabf('0x1b')]=_0x281f24[_0xfabf('0xe')][0x0][_0xfabf('0x1c')];}else{_0x28e570[_0xfabf('0x1b')]=_0x28e570[_0xfabf('0xf')];_0x28e570[_0xfabf('0x18')]=_0x28e570[_0xfabf('0x1d')];}logger[_0xfabf('0x10')]('['+[_0x2c663b[_0xfabf('0x11')]()]+'],\x20getUser\x20crm',_0x28e570);_0x857d69(_0x28e570);})[_0xfabf('0x13')](function(_0x1c3e78){logger['error']('['+[_0x2c663b[_0xfabf('0x11')]()]+']',_0x1c3e78['message']);_0x4c5817(_0x1c3e78['message']);});}else{logger['info']('['+[_0x2c663b['toUpperCase']()]+_0xfabf('0x1e'));_0x28e570[_0xfabf('0x1b')]=_0x28e570[_0xfabf('0xf')];_0x28e570[_0xfabf('0x18')]=_0x28e570[_0xfabf('0x1d')];_0x857d69(_0x28e570);}});};}function createEndUser(_0x587674,_0x355626,_0x1acf05,_0x58c8f9,_0x4a40c4){logger['info']('['+[_0x587674['toUpperCase']()]+_0xfabf('0x1f'),_0x1acf05);return new Promise(function(_0x573483,_0x3b3730){var _0x2eeffe={'method':_0xfabf('0x20'),'uri':_0x58c8f9+_0xfabf('0x21')+_0x4a40c4,'body':{'user_name':_0x1acf05['endUserNumber'],'roles':'user','first_name':_0x1acf05[_0xfabf('0x22')],'active':'true','date_format':_0xfabf('0x23'),'phone':_0x1acf05[_0xfabf('0x22')]},'auth':_0x355626,'json':!![]};return rp(_0x2eeffe)[_0xfabf('0xd')](function(_0x57c11c){logger[_0xfabf('0x10')]('['+[_0x587674['toUpperCase']()]+_0xfabf('0x24'),_0x57c11c['result']);_0x1acf05[_0xfabf('0x25')]=_0x57c11c['result'][_0xfabf('0x1c')];_0x573483(_0x1acf05);})[_0xfabf('0x13')](function(_0x2d67f4){logger[_0xfabf('0x14')]('['+[_0x587674[_0xfabf('0x11')]()]+']',_0x2d67f4['message']);_0x3b3730(_0x2d67f4[_0xfabf('0x15')]);});});}function getEndUser(_0x4f487a,_0x38a837,_0x5f4fea,_0x600e3e,_0x2facc9){return function(_0x5dc1e1){logger['info']('['+[_0x4f487a[_0xfabf('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x5dc1e1);return new Promise(function(_0x220f35,_0x393322){var _0x5a8ef9={'method':_0xfabf('0xb'),'uri':_0x5f4fea+_0xfabf('0x26')+_0x5dc1e1[_0xfabf('0x22')]+'&'+_0x600e3e+'&'+_0x2facc9,'auth':_0x38a837,'json':!![]};return rp(_0x5a8ef9)['then'](function(_0x273019){if(_0x273019['result'][_0xfabf('0x27')]>0x0){_0x5dc1e1['endUserId']=_0x273019[_0xfabf('0xe')][0x0][_0xfabf('0x1c')];logger[_0xfabf('0x10')]('['+[_0x4f487a['toUpperCase']()]+_0xfabf('0x28'),_0x5dc1e1);_0x220f35(_0x5dc1e1);}else{return createEndUser(_0x4f487a,_0x38a837,_0x5dc1e1,_0x5f4fea,_0x600e3e)[_0xfabf('0xd')](function(_0x111cd9){logger[_0xfabf('0x10')]('['+[_0x4f487a[_0xfabf('0x11')]()]+_0xfabf('0x29'),_0x111cd9);_0x220f35(_0x111cd9);});}})[_0xfabf('0x13')](function(_0x49a46f){logger[_0xfabf('0x14')]('['+[_0x4f487a[_0xfabf('0x11')]()]+']',_0x49a46f[_0xfabf('0x15')]);_0x393322(_0x49a46f['message']);});});};}function getCustomFields(_0x5b98f9,_0x4ddf36){var _0x2ec8cf={};if(_0x5b98f9[_0xfabf('0x27')]>0x0){_[_0xfabf('0x2a')](_0x5b98f9,function(_0x370619){if(_[_0xfabf('0x2b')]([_0xfabf('0x2c'),_0xfabf('0x2d')],_0x370619[_0xfabf('0x2e')])&&_0x370619[_0xfabf('0x2f')]&&!_0x370619['customField']){_0x2ec8cf[_0x370619['nameField'][_0xfabf('0x30')]()]=_0x370619['content'][_0xfabf('0x31')]();}else if(_[_0xfabf('0x2b')]([_0xfabf('0x2c'),'picklist'],_0x370619[_0xfabf('0x2e')])&&_0x370619[_0xfabf('0x32')]&&_0x370619[_0xfabf('0x33')]){_0x2ec8cf[_0x370619[_0xfabf('0x32')][_0xfabf('0x30')]()]=_0x370619[_0xfabf('0x34')][_0xfabf('0x31')]();}else if(_0x370619[_0xfabf('0x2e')]===_0xfabf('0x35')&&_0x370619[_0xfabf('0x36')]&&_0x370619[_0xfabf('0x32')]&&_0x370619[_0xfabf('0x33')]){_0x2ec8cf[_0x370619[_0xfabf('0x32')]['toLowerCase']()]=_0x4ddf36[_0x370619[_0xfabf('0x36')]][_0xfabf('0x31')]();}else if(_0x370619[_0xfabf('0x2e')]===_0xfabf('0x37')&&_0x370619[_0xfabf('0x38')]&&_0x370619['Variable']['name']&&_0x370619[_0xfabf('0x32')]&&_0x370619[_0xfabf('0x33')]){_0x2ec8cf[_0x370619[_0xfabf('0x32')][_0xfabf('0x30')]()]=_0x4ddf36[_0x370619[_0xfabf('0x38')][_0xfabf('0x39')][_0xfabf('0x30')]()][_0xfabf('0x31')]();}});}return _0x2ec8cf;}function getTicket(_0x21c395,_0x2fe609,_0x2d249a,_0x4434f8,_0x39c1fd,_0x3ece04){return function(_0x168e35){logger['info']('['+[_0x21c395[_0xfabf('0x11')]()]+']\x20getTicket\x20input\x20crm',_0x168e35);return new Promise(function(_0x2522f6,_0x3100a3){var _0x52ae7c=_0x21c395['toLowerCase']()===_0xfabf('0x3a')?_0x168e35[_0xfabf('0x1b')]:_0x168e35[_0xfabf('0x25')];var _0x3f284d={'method':_0xfabf('0x20'),'uri':_0x2d249a+'incident'+'?'+_0x3ece04,'body':Object[_0xfabf('0x3b')]({},{'active':_0xfabf('0x3c'),'caller_id':_0x52ae7c,'assigned_to':_0x168e35[_0xfabf('0x1b')],'short_description':intUtil[_0xfabf('0x3d')](_0x4434f8[_0xfabf('0x3e')],_0x39c1fd,'\x20'),'description':intUtil[_0xfabf('0x3d')](_0x4434f8[_0xfabf('0x3f')],_0x39c1fd,'\x0a')},getCustomFields(_0x4434f8['Fields'],_0x39c1fd)),'auth':_0x2fe609,'json':!![]};return rp(_0x3f284d)[_0xfabf('0xd')](function(_0x489d44){logger[_0xfabf('0x10')]('['+[_0x21c395[_0xfabf('0x11')]()]+_0xfabf('0x40'),_0x489d44[_0xfabf('0xe')]);_0x168e35[_0xfabf('0x41')]=_0x489d44['result']['sys_id'];_0x168e35['ticketNumber']=_0x489d44['result'][_0xfabf('0x42')];logger[_0xfabf('0x10')]('['+[_0x21c395[_0xfabf('0x11')]()]+_0xfabf('0x43'),_0x168e35);_0x2522f6(_0x168e35);})[_0xfabf('0x13')](function(_0x5b31e2){logger['error']('['+[_0x21c395[_0xfabf('0x11')]()]+']',_0x5b31e2['message']);_0x3100a3(_0x5b31e2[_0xfabf('0x15')]);});});};}function createRemoteTag(_0x41b30a,_0x18745c,_0x457f51,_0x5936ee){return new Promise(function(_0x39f8d5,_0x5585c0){var _0x31e18a={'method':_0xfabf('0x20'),'uri':_0x457f51+'label'+'?'+_0x5936ee,'body':{'short_description':_0x41b30a,'global':!![],'active':!![],'name':_0x41b30a},'auth':_0x18745c,'json':!![]};return rp(_0x31e18a)['then'](function(_0x111b90){var _0x28703b=_0x111b90['result'][_0xfabf('0x1c')];_0x39f8d5(_0x28703b);});});}function getRemoteTag(_0x379d12,_0x41ce3d,_0x5d5ef2,_0x2c3d3a,_0x2076d6){return new Promise(function(_0x35bddc,_0x4e198b){var _0x5ef561={'method':'GET','uri':_0x5d5ef2+_0xfabf('0x44')+_0xfabf('0x45')+_0x379d12+'&'+_0x2c3d3a,'auth':_0x41ce3d,'json':!![]};return rp(_0x5ef561)[_0xfabf('0xd')](function(_0x51a6d5){if(_0x51a6d5[_0xfabf('0xe')]['length']>0x0){var _0x171e29=_0x51a6d5[_0xfabf('0xe')][0x0][_0xfabf('0x1c')];_0x35bddc(_0x171e29);}else{return createRemoteTag(_0x379d12,_0x41ce3d,_0x5d5ef2,_0x2c3d3a)['then'](function(_0x425024){_0x35bddc(_0x425024);});}});});}function assignTagToIncident(_0x36e289,_0x504763,_0x57e7ba,_0x2eec34,_0x16f467){return new Promise(function(_0x1a10e6,_0x2fd165){var _0x55b36f={'method':_0xfabf('0x20'),'uri':_0x57e7ba+'label_entry'+'?'+_0x16f467,'body':{'label':_0x36e289,'table':_0xfabf('0x46'),'id_type':'Incident','table_key':_0x2eec34['ticketId'],'title':_0xfabf('0x47')+_0x2eec34['ticketNumber'],'id_display':_0x2eec34['ticketNumber']},'auth':_0x504763,'json':!![]};return rp(_0x55b36f)['then'](function(_0x573024){_0x1a10e6();})[_0xfabf('0x13')](function(){_0x1a10e6();});});}function manageTags(_0x38c7d7,_0x583dd2,_0xfaeea2,_0x21cc7b,_0x5d1fae,_0x3eaf7b,_0x4dbe3e){return new Promise(function(_0x37ac93,_0x4239d9){var _0x5d858c=[];_0x583dd2[_0xfabf('0x2a')](function(_0x377ed9){_0x5d858c[_0xfabf('0x48')](getRemoteTag(_0x377ed9,_0xfaeea2,_0x21cc7b,_0x3eaf7b,_0x4dbe3e));});return Promise[_0xfabf('0x49')](_0x5d858c)[_0xfabf('0xd')](function(_0x221a8a){if(_0x221a8a['length']){logger['info']('['+[_0x38c7d7[_0xfabf('0x11')]()]+_0xfabf('0x4a'),_0x221a8a);var _0x5344b1=[];_0x221a8a[_0xfabf('0x2a')](function(_0x3cd473){_0x5344b1[_0xfabf('0x48')](assignTagToIncident(_0x3cd473,_0xfaeea2,_0x21cc7b,_0x5d1fae,_0x3eaf7b));});return Promise[_0xfabf('0x49')](_0x5344b1)[_0xfabf('0xd')](function(){_0x37ac93();})[_0xfabf('0x13')](function(){_0x37ac93();});}else{_0x37ac93();}});});}function getTags(_0x3e6935,_0x1a3e27,_0x1830b4,_0x5a53a6,_0x21e970,_0x55bc21){return function(_0x52c44b){return new Promise(function(_0x4bd930,_0x372c5c){var _0x490b35=[];var _0x439d83=_0x5a53a6[_0xfabf('0x4b')];if(_0x439d83&&_0x439d83[_0xfabf('0x27')]>0x0){_0x490b35=_['map'](_0x439d83,'name');}if(_0x490b35[_0xfabf('0x27')]>0x0){return manageTags(_0x3e6935,_0x490b35,_0x1a3e27,_0x1830b4,_0x52c44b,_0x21e970,_0x55bc21)[_0xfabf('0xd')](function(){_0x4bd930(_0x52c44b);});}else{_0x4bd930(_0x52c44b);}});};}function emit(_0x11f1dd,_0x250f95,_0x5c4111){var _0x59e275='%26sysparm_record_target%3Dincident'+_0xfabf('0x4c')+_0xfabf('0x4d')+_0xfabf('0x4e');var _0x439b0d={'uri':_0x11f1dd+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x5c4111+_0x59e275};io['to'](util[_0xfabf('0x4f')]('user:%s',_0x250f95))['emit']('trigger:browser:url',_0x439b0d);}exports['cs']=function(_0x484dd7,_0x560aa1,_0x2df764,_0x4bb817,_0x47c73d,_0x1883ef,_0x1d9492,_0x240e51){var _0xcc33c0={};var _0x17f24e={'user':_0x1883ef[_0xfabf('0x50')],'pass':_0x1883ef[_0xfabf('0x51')]};var _0xd79325=_0xfabf('0x52');var _0x208e2d='sysparm_display_value=true';_0x1883ef[_0xfabf('0x53')]=intUtil[_0xfabf('0x54')](_0x1883ef[_0xfabf('0x53')]);_0x1883ef[_0xfabf('0x55')]=intUtil[_0xfabf('0x54')](_0x1883ef[_0xfabf('0x55')]);var _0x326187=util[_0xfabf('0x4f')](_0xfabf('0x56'),_0x1883ef[_0xfabf('0x53')]);_0xcc33c0['userEmail']=!_[_0xfabf('0x57')](_0x4bb817)?_0x4bb817[_0xfabf('0x58')]:null;_0xcc33c0['adminEmail']=_0x1883ef['email'];_0xcc33c0['endUserNumber']=_0x240e51[_0xfabf('0x30')]()===_0xfabf('0x3a')?_0x560aa1[_0xfabf('0x59')]:_0x560aa1[_0xfabf('0x5a')];_0xcc33c0[_0xfabf('0x5b')]=_0x240e51===_0xfabf('0x5c')||_0x240e51===_0xfabf('0x5d')?_0xfabf('0x5c'):'outbound';var _0x3d86a8=util[_0xfabf('0x4f')](_0xfabf('0x5e'),_0x1883ef['serverUrl'],_0x560aa1[_0xfabf('0x5f')],md5(_0x560aa1['uniqueid']));if(_0x47c73d&&_0x47c73d[_0xfabf('0x60')]){logger['info'](_0xfabf('0x61'),'Recording\x20is\x20enabled!');_0x560aa1[_0xfabf('0x62')]=_0x3d86a8;}else if(_0x1d9492&&_0x1d9492['recordingFormat']&&_0x1d9492[_0xfabf('0x63')]!=='none'){logger[_0xfabf('0x10')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x560aa1['recordingURL']=_0x3d86a8;}else{_0x560aa1['recordingURL']='';}return getAdminUser(_0x240e51,_0x17f24e,_0xcc33c0,_0x326187,_0x208e2d,_0xd79325)[_0xfabf('0xd')](getUser(_0x240e51,_0x17f24e,_0x326187,_0x208e2d,_0xd79325))[_0xfabf('0xd')](getEndUser(_0x240e51,_0x17f24e,_0x326187,_0x208e2d,_0xd79325))['then'](getTicket(_0x240e51,_0x17f24e,_0x326187,_0x2df764,_0x560aa1,_0x208e2d))[_0xfabf('0xd')](function(_0x81a1f2){logger[_0xfabf('0x10')](util['format'](_0xfabf('0x64'),_0x81a1f2[_0xfabf('0x41')]));logger['info'](util[_0xfabf('0x4f')]('call\x20direction:\x20%s',_0x240e51));if(_0x240e51!==_0xfabf('0x5d')){logger[_0xfabf('0x10')]('['+[_0x240e51[_0xfabf('0x11')]()]+']',_0xfabf('0x65'));emit(_0x1883ef['remoteUri'],_0x4bb817[_0xfabf('0x39')],_0x81a1f2[_0xfabf('0x41')]);}})['catch'](function(_0x207273){logger[_0xfabf('0x14')]('['+[_0x240e51['toUpperCase']()]+_0xfabf('0x66'),util[_0xfabf('0x67')](_0x207273,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index d1ace63..ff916d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacd1=['request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','Subjects','created_by','description','getString','Descriptions','date_start','toISOString','slice','duration_hours','duration_minutes','parent_type','Contacts','direction','length','forEach','push','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','first_name','debug','merge','map','string','nameField','customField','content','type','idField','custom_fields','variable','variableName','customVariable','Variable','toLowerCase','login','username','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','uri','%s/service/v4_1/rest.php','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','unmanaged','lastevent','toUpperCase','lodash'];(function(_0x15550a,_0x2f3e05){var _0x4e2e37=function(_0x4d045f){while(--_0x4d045f){_0x15550a['push'](_0x15550a['shift']());}};_0x4e2e37(++_0x2f3e05);}(_0xacd1,0xed));var _0x1acd=function(_0x102da0,_0x539e28){_0x102da0=_0x102da0-0x0;var _0x41361c=_0xacd1[_0x102da0];return _0x41361c;};'use strict';var _=require(_0x1acd('0x0'));var rp=require(_0x1acd('0x1'));var BPromise=require(_0x1acd('0x2'));var md5=require('md5');var util=require(_0x1acd('0x3'));var Redis=require(_0x1acd('0x4'));var intUtil=require(_0x1acd('0x5'));var config=require(_0x1acd('0x6'));var logger=require(_0x1acd('0x7'))('sugarcrm');config[_0x1acd('0x8')]=_[_0x1acd('0x9')](config[_0x1acd('0x8')],{'host':_0x1acd('0xa'),'port':0x18eb});var io=require(_0x1acd('0xb'))(new Redis(config[_0x1acd('0x8')]));var def={'method':_0x1acd('0xc'),'json':!![]};function emit(_0x2d65f8,_0x1e79ab,_0x29ca5e){io['to'](_0x2d65f8)['emit'](_0x1e79ab,_0x29ca5e);}function getTicket(_0x1932e6,_0x131f89,_0x100dbf,_0x3c8a19,_0x27a627,_0x2394dd,_0x37346f,_0x1b0d10){logger[_0x1acd('0xd')](_0x1acd('0xe'));var _0x138185=new Date();var _0x57b536=[{'name':_0x1acd('0xf'),'value':intUtil['getString'](_0x3c8a19[_0x1acd('0x10')],_0x27a627,'\x20')},{'name':'assigned_user_id','value':_0x131f89['id']},{'name':_0x1acd('0x11'),'value':_0x131f89['id']},{'name':_0x1acd('0x12'),'value':intUtil[_0x1acd('0x13')](_0x3c8a19[_0x1acd('0x14')],_0x27a627,'\x0a')},{'name':_0x1acd('0x15'),'value':_0x138185[_0x1acd('0x16')]()[_0x1acd('0x17')](0x0,0x13)['replace']('T','\x20')},{'name':_0x1acd('0x18'),'value':'0'},{'name':_0x1acd('0x19'),'value':'15'},{'name':'parent_id','value':_0x100dbf['id']},{'name':_0x1acd('0x1a'),'value':_0x1acd('0x1b')},{'name':'parent_name','value':_0x100dbf['name']},{'name':_0x1acd('0x1c'),'value':_0x1b0d10}];if(_0x2394dd[_0x1acd('0x1d')]){_[_0x1acd('0x1e')](_0x2394dd,function(_0x2675a7){if(_0x27a627[_0x2675a7['variableName']]){_0x57b536[_0x1acd('0x1f')]({'name':_0x2675a7['idField'],'value':_0x27a627[_0x2675a7['variableName']]});}});}return request({'form':{'method':'set_entry','input_type':_0x1acd('0x20'),'response_type':_0x1acd('0x20'),'rest_data':JSON[_0x1acd('0x21')]({'session':_0x37346f['id'],'module_name':_0x1acd('0x22'),'name_value_list':_0x57b536})}});}function getAuth(_0x562553){return util[_0x1acd('0x23')](_0x1acd('0x24'),new Buffer(_0x562553[_0x1acd('0x25')]+':X')[_0x1acd('0x26')](_0x1acd('0x27')));}function getServerInfo(_0x12533e){return request({'form':{'method':'get_server_info','input_type':_0x1acd('0x20'),'response_type':_0x1acd('0x20'),'rest_data':JSON[_0x1acd('0x21')]({'session':_0x12533e['id']})}});}function getUser(_0x10b342,_0x1bd036,_0x1cf631){if(!_[_0x1acd('0x28')](_0x1bd036)){logger['info'](_0x1acd('0x29'),_0x1bd036);return request({'form':{'method':'get_entry_list','input_type':_0x1acd('0x20'),'response_type':_0x1acd('0x20'),'rest_data':JSON[_0x1acd('0x21')]({'session':_0x1cf631['id'],'module_name':_0x1acd('0x2a'),'query':util['format'](_0x1acd('0x2b'),_0x1bd036),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1acd('0x2c')](function(_0x44050a){if(_0x44050a[_0x1acd('0x2d')][_0x1acd('0x1d')]){var _0x174564=_[_0x1acd('0x2e')](_0x44050a['entry_list'],function(_0x3d7cfc){return _0x3d7cfc[_0x1acd('0x2f')][_0x1acd('0x30')][_0x1acd('0x31')]===_0x1bd036;});if(_0x174564){logger[_0x1acd('0xd')](_0x1acd('0x32'));return BPromise[_0x1acd('0x33')]({'id':_0x174564[_0x1acd('0x2f')]['id'][_0x1acd('0x31')],'name':_0x174564['name_value_list'][_0x1acd('0xf')][_0x1acd('0x31')]});}}logger[_0x1acd('0xd')](_0x1acd('0x34'));return BPromise[_0x1acd('0x33')]({'id':_0x1cf631[_0x1acd('0x2f')][_0x1acd('0x35')][_0x1acd('0x31')],'name':_0x1cf631['name_value_list'][_0x1acd('0x30')][_0x1acd('0x31')]});});}else{logger[_0x1acd('0xd')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x1acd('0x33')]({'id':_0x1cf631['name_value_list'][_0x1acd('0x35')][_0x1acd('0x31')],'name':_0x1cf631[_0x1acd('0x2f')][_0x1acd('0x30')]['value']});}}function getEndUser(_0x42a336,_0x2fd603,_0x29d815,_0x1636f5){logger[_0x1acd('0xd')](_0x1acd('0x36'),_0x29d815);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x1acd('0x20'),'rest_data':JSON['stringify']({'session':_0x1636f5['id'],'module_name':_0x1acd('0x1b'),'query':util[_0x1acd('0x23')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x29d815),'order_by':'','offset':'0','select_fields':['id',_0x1acd('0xf'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1acd('0x2c')](function(_0x3f4740){if(_0x3f4740[_0x1acd('0x2d')][_0x1acd('0x1d')]){var _0xf4a98f=_[_0x1acd('0x2e')](_0x3f4740[_0x1acd('0x2d')],function(_0x379158){return _0x379158['name_value_list'][_0x1acd('0x37')][_0x1acd('0x31')]===_0x29d815;});if(_0xf4a98f){logger[_0x1acd('0xd')](_0x1acd('0x38'));return BPromise[_0x1acd('0x33')]({'id':_0xf4a98f[_0x1acd('0x2f')]['id'][_0x1acd('0x31')],'name':_0xf4a98f[_0x1acd('0x2f')]['name']['value'],'phone':_0xf4a98f[_0x1acd('0x2f')]['phone_home'][_0x1acd('0x31')]});}}else{logger['info'](_0x1acd('0x39'));return request({'form':{'method':'set_entry','input_type':_0x1acd('0x20'),'response_type':_0x1acd('0x20'),'rest_data':JSON[_0x1acd('0x21')]({'session':_0x1636f5['id'],'module_name':_0x1acd('0x1b'),'name_value_list':[{'name':'first_name','value':_0x2fd603!=='<unknown>'?_0x2fd603:util[_0x1acd('0x23')]('Caller\x20-\x20%s',_0x29d815)},{'name':_0x1acd('0x37'),'value':_0x29d815}]})}})[_0x1acd('0x2c')](function(_0x48edeb){logger[_0x1acd('0xd')](_0x1acd('0x3a'));return BPromise[_0x1acd('0x33')]({'id':_0x48edeb['id'],'name':_0x48edeb[_0x1acd('0x2d')][_0x1acd('0x3b')][_0x1acd('0x31')],'phone':_0x48edeb[_0x1acd('0x2d')][_0x1acd('0x37')]['value']});});}});}function request(_0x50f5cb){logger[_0x1acd('0x3c')]('[HTTP]',JSON[_0x1acd('0x21')](_0x50f5cb));return rp(_[_0x1acd('0x3d')](def,_0x50f5cb));}function getTags(_0xe36932,_0x126f78){var _0x48fadb=[];if(_0xe36932&&_0xe36932[_0x1acd('0x1d')]>0x0){_0x48fadb=_[_0x1acd('0x3e')](_0xe36932,_0x126f78);}return _0x48fadb;}function getCustomFields(_0x35d7a2,_0x30dd3f){var _0x28883a=[];var _0x87799a={'custom_fields':[]};if(_0x35d7a2['length']>0x0){_[_0x1acd('0x1e')](_0x35d7a2,function(_0x190316){if(_0x190316['type']===_0x1acd('0x3f')&&_0x190316[_0x1acd('0x40')]&&!_0x190316[_0x1acd('0x41')]){_0x87799a[_0x190316['nameField']['toLowerCase']()]=_0x190316[_0x1acd('0x42')]['toString']();}else if(_0x190316[_0x1acd('0x43')]===_0x1acd('0x3f')&&_0x190316[_0x1acd('0x44')]&&_0x190316['customField']){_0x87799a[_0x1acd('0x45')][_0x1acd('0x1f')]({'id':_0x190316['idField'],'value':_0x190316[_0x1acd('0x42')][_0x1acd('0x26')]()});}else if(_0x190316[_0x1acd('0x43')]===_0x1acd('0x46')&&_0x190316[_0x1acd('0x47')]&&_0x190316[_0x1acd('0x44')]&&_0x190316[_0x1acd('0x41')]){_0x30dd3f[_0x190316[_0x1acd('0x47')]]&&_0x87799a[_0x1acd('0x45')][_0x1acd('0x1f')]({'id':_0x190316['idField'],'value':_0x30dd3f[_0x190316[_0x1acd('0x47')]]['toString']()});}else if(_0x190316['type']===_0x1acd('0x48')&&_0x190316[_0x1acd('0x49')]&&_0x190316[_0x1acd('0x49')]['name']&&_0x190316[_0x1acd('0x44')]&&_0x190316[_0x1acd('0x41')]){_0x30dd3f[_0x190316[_0x1acd('0x49')][_0x1acd('0xf')][_0x1acd('0x4a')]()]&&_0x87799a[_0x1acd('0x45')][_0x1acd('0x1f')]({'id':_0x190316[_0x1acd('0x44')],'value':_0x30dd3f[_0x190316[_0x1acd('0x49')][_0x1acd('0xf')][_0x1acd('0x4a')]()]['toString']()});}});}return _0x87799a;}function getConnection(_0x2fb0c5){return request({'method':_0x1acd('0xc'),'form':{'method':_0x1acd('0x4b'),'input_type':'JSON','response_type':_0x1acd('0x20'),'rest_data':JSON[_0x1acd('0x21')]({'user_auth':{'user_name':_0x2fb0c5[_0x1acd('0x4c')],'password':_0x2fb0c5['password'],'encryption':'PLAIN'},'application':_0x1acd('0x4d')})}})['then'](function(_0x11b4ba){var _0x4b2f12=_0x11b4ba;if(_0x4b2f12['id']){def[_0x1acd('0x4e')]=_0x4b2f12['id'];return BPromise[_0x1acd('0x33')](_0x4b2f12);}else{throw new Error(util[_0x1acd('0x23')](_0x1acd('0x4f'),_0x2fb0c5['id']));}});}function setRelationship(_0x470001,_0x44a9f5,_0x52afd7,_0x1f4ab4){return request({'form':{'method':_0x1acd('0x50'),'input_type':_0x1acd('0x20'),'response_type':_0x1acd('0x20'),'rest_data':JSON[_0x1acd('0x21')]({'session':_0x470001['id'],'module_name':_0x1acd('0x22'),'module_id':_0x52afd7['id'],'link_field_name':_0x1f4ab4,'related_ids':[_0x44a9f5['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x1acd('0x51')]=function(_0xeaf218,_0x4163e2,_0x342c3e,_0x25a5ca,_0x275fb5,_0x129f97){var _0x43919b,_0x1f8083,_0x11ae96,_0x4ce05e;_0x129f97[_0x1acd('0x52')]=intUtil[_0x1acd('0x53')](_0x129f97[_0x1acd('0x52')]);_0x129f97[_0x1acd('0x54')]=intUtil[_0x1acd('0x53')](_0x129f97[_0x1acd('0x54')]);def['uri']=util['format']('%s/service/v4_1/rest.php',_0x129f97[_0x1acd('0x52')]);if(_0x275fb5&&_0x275fb5[_0x1acd('0x55')]){logger['info']('[QUEUE]',_0x1acd('0x56'));_0x4163e2['recordingURL']=util[_0x1acd('0x23')](_0x1acd('0x57'),_0x129f97[_0x1acd('0x54')],_0x4163e2['uniqueid'],md5(_0x4163e2[_0x1acd('0x58')]));}else{_0x4163e2[_0x1acd('0x59')]='';}return getConnection(_0x129f97)[_0x1acd('0x2c')](function(_0x583141){_0x4ce05e=_0x583141;return getUser(_0x129f97,_0x25a5ca['name'],_0x4ce05e);})[_0x1acd('0x2c')](function(_0x20eda4){_0x43919b=_0x20eda4;logger[_0x1acd('0xd')](_0x1acd('0x5a'),_0x43919b['id']);return getEndUser(_0x129f97,_0x4163e2[_0x1acd('0x5b')],_0x4163e2[_0x1acd('0x5c')],_0x4ce05e);})[_0x1acd('0x2c')](function(_0x307990){_0x1f8083=_0x307990;logger[_0x1acd('0xd')]('The\x20Enduser\x20ID\x20is:',_0x1f8083['id']);return getTicket(_0x129f97,_0x43919b,_0x1f8083,_0x342c3e,_0x4163e2,_0x342c3e[_0x1acd('0x5d')],_0x4ce05e,_0x1acd('0x5e'));})[_0x1acd('0x2c')](function(_0x3785ab){_0x11ae96=_0x3785ab;logger[_0x1acd('0xd')]('Ticket\x20created!');logger[_0x1acd('0xd')](_0x1acd('0x5f'),_0x11ae96['id']);return setRelationship(_0x4ce05e,_0x43919b,_0x11ae96,_0x1acd('0x60'));})[_0x1acd('0x2c')](function(){return setRelationship(_0x4ce05e,_0x1f8083,_0x11ae96,_0x1acd('0x61'));})['then'](function(){return getServerInfo(_0x4ce05e);})[_0x1acd('0x2c')](function(_0x21af79){var _0xdd3c7c=parseInt(_0x21af79[_0x1acd('0x62')][_0x1acd('0x63')](0x0));var _0x5bd69f=util[_0x1acd('0x23')](_0x1acd('0x64'),_0x129f97['remoteUri'],_0x11ae96['id']);if(_0xdd3c7c>0x6){_0x5bd69f=util[_0x1acd('0x23')](_0x1acd('0x65'),_0x129f97[_0x1acd('0x52')],_0x11ae96['id']);}logger[_0x1acd('0xd')](_0x1acd('0x66'),_0x1acd('0x67'));emit(util[_0x1acd('0x23')](_0x1acd('0x68'),_0x25a5ca[_0x1acd('0xf')]),_0x1acd('0x69'),{'uri':_0x5bd69f});})[_0x1acd('0x6a')](function(_0x24c6a1){logger[_0x1acd('0x6b')]('[QUEUE]',JSON[_0x1acd('0x21')](_0x24c6a1));});};exports['outbound']=function(_0x4f42ee,_0xcf52a0,_0x592d52,_0x52345a,_0x9c9e35,_0x5b329d,_0x152f06){var _0x106ba5,_0x47dacd,_0x2c8932,_0x416b7d;_0x5b329d[_0x1acd('0x52')]=intUtil[_0x1acd('0x53')](_0x5b329d[_0x1acd('0x52')]);_0x5b329d[_0x1acd('0x54')]=intUtil[_0x1acd('0x53')](_0x5b329d[_0x1acd('0x54')]);def[_0x1acd('0x6c')]=util[_0x1acd('0x23')](_0x1acd('0x6d'),_0x5b329d[_0x1acd('0x52')]);if(_0x152f06&&_0x152f06['recordingFormat']&&_0x152f06['recordingFormat']!==_0x1acd('0x6e')){logger[_0x1acd('0xd')](_0x1acd('0x6f'),_0x1acd('0x56'));_0xcf52a0[_0x1acd('0x59')]=util['format'](_0x1acd('0x57'),_0x5b329d['serverUrl'],_0xcf52a0['uniqueid'],md5(_0xcf52a0[_0x1acd('0x58')]));}return getConnection(_0x5b329d)[_0x1acd('0x2c')](function(_0x24dc11){_0x416b7d=_0x24dc11;return getUser(_0x5b329d,_0x52345a[_0x1acd('0xf')],_0x416b7d);})[_0x1acd('0x2c')](function(_0x39c662){_0x106ba5=_0x39c662;logger[_0x1acd('0xd')](_0x1acd('0x5a'),_0x106ba5['id']);return getEndUser(_0x5b329d,_0xcf52a0[_0x1acd('0x70')],_0xcf52a0[_0x1acd('0x71')],_0x416b7d);})[_0x1acd('0x2c')](function(_0x15cd03){_0x47dacd=_0x15cd03;logger[_0x1acd('0xd')](_0x1acd('0x72'),_0x47dacd['id']);return getTicket(_0x5b329d,_0x106ba5,_0x47dacd,_0x592d52,_0xcf52a0,_0x592d52['Fields'],_0x416b7d,'Outbound');})[_0x1acd('0x2c')](function(_0x5d9b9d){_0x2c8932=_0x5d9b9d;logger['info'](_0x1acd('0x73'));logger[_0x1acd('0xd')]('The\x20Ticket\x20ID\x20is:',_0x2c8932['id']);return setRelationship(_0x416b7d,_0x106ba5,_0x2c8932,_0x1acd('0x60'));})[_0x1acd('0x2c')](function(){return setRelationship(_0x416b7d,_0x47dacd,_0x2c8932,_0x1acd('0x61'));})[_0x1acd('0x2c')](function(){return getServerInfo(_0x416b7d);})[_0x1acd('0x2c')](function(_0x3b82f6){var _0x92528e=parseInt(_0x3b82f6[_0x1acd('0x62')]['charAt'](0x0));var _0x3caa1e=util[_0x1acd('0x23')](_0x1acd('0x64'),_0x5b329d[_0x1acd('0x52')],_0x2c8932['id']);if(_0x92528e>0x6){_0x3caa1e=util[_0x1acd('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5b329d[_0x1acd('0x52')],_0x2c8932['id']);}logger[_0x1acd('0xd')]('[OUTBOUND]',_0x1acd('0x67'));emit(util[_0x1acd('0x23')]('user:%s',_0x52345a[_0x1acd('0xf')]),_0x1acd('0x69'),{'uri':_0x3caa1e});})[_0x1acd('0x6a')](function(_0x2e5b13){logger[_0x1acd('0x6b')](_0x1acd('0x6f'),JSON[_0x1acd('0x21')](_0x2e5b13));});};exports[_0x1acd('0x74')]=function(_0x34508f,_0x2e5dbc,_0x1ebaa7,_0x469b0b,_0x2e5d3e,_0x3eb0bf){var _0x42847f,_0x4720fd,_0x4e761d,_0x337123;_0x3eb0bf[_0x1acd('0x52')]=intUtil['stripTrailingSlash'](_0x3eb0bf[_0x1acd('0x52')]);_0x3eb0bf[_0x1acd('0x54')]=intUtil['stripTrailingSlash'](_0x3eb0bf[_0x1acd('0x54')]);def[_0x1acd('0x6c')]=util[_0x1acd('0x23')](_0x1acd('0x6d'),_0x3eb0bf['remoteUri']);if(_0x2e5d3e&&_0x2e5d3e[_0x1acd('0x55')]){logger[_0x1acd('0xd')]('['+_0x2e5dbc[_0x1acd('0x75')][_0x1acd('0x76')]()+']','Recording\x20is\x20enabled!');_0x2e5dbc['recordingURL']=util['format'](_0x1acd('0x57'),_0x3eb0bf[_0x1acd('0x54')],_0x2e5dbc[_0x1acd('0x58')],md5(_0x2e5dbc[_0x1acd('0x58')]));}else{_0x2e5dbc[_0x1acd('0x59')]='';}return getConnection(_0x3eb0bf)[_0x1acd('0x2c')](function(_0x187cbe){_0x337123=_0x187cbe;if(!_[_0x1acd('0x28')](_0x469b0b)){return getUser(_0x3eb0bf,_0x469b0b[_0x1acd('0xf')],_0x337123);}else{return getUser(_0x3eb0bf,null,_0x337123);}})[_0x1acd('0x2c')](function(_0x484af8){_0x42847f=_0x484af8;logger['info'](_0x1acd('0x5a'),_0x42847f['id']);return getEndUser(_0x3eb0bf,_0x2e5dbc['calleridname'],_0x2e5dbc[_0x1acd('0x5c')],_0x337123);})[_0x1acd('0x2c')](function(_0x5600a0){_0x4720fd=_0x5600a0;logger[_0x1acd('0xd')](_0x1acd('0x72'),_0x4720fd['id']);return getTicket(_0x3eb0bf,_0x42847f,_0x4720fd,_0x1ebaa7,_0x2e5dbc,_0x1ebaa7[_0x1acd('0x5d')],_0x337123,_0x1acd('0x5e'));})[_0x1acd('0x2c')](function(_0x10eaa1){_0x4e761d=_0x10eaa1;logger[_0x1acd('0xd')](_0x1acd('0x73'));logger['info'](_0x1acd('0x5f'),_0x4e761d['id']);return setRelationship(_0x337123,_0x42847f,_0x4e761d,_0x1acd('0x60'));})[_0x1acd('0x2c')](function(){return setRelationship(_0x337123,_0x4720fd,_0x4e761d,_0x1acd('0x61'));})['then'](function(){return getServerInfo(_0x337123);})[_0x1acd('0x6a')](function(_0x267da3){logger[_0x1acd('0x6b')]('['+_0x2e5dbc[_0x1acd('0x75')][_0x1acd('0x76')]()+']',JSON[_0x1acd('0x21')](_0x267da3));});};
\ No newline at end of file
+var _0xcf61=['nameField','toLowerCase','type','customField','custom_fields','content','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','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:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','catch','unmanaged','error','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','direction','forEach','variableName','push','idField','set_entry','JSON','stringify','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','entry_list','length','find','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','<unknown>','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','string'];(function(_0x5f22d0,_0x84c069){var _0xed7d79=function(_0x561e23){while(--_0x561e23){_0x5f22d0['push'](_0x5f22d0['shift']());}};_0xed7d79(++_0x84c069);}(_0xcf61,0x1aa));var _0x1cf6=function(_0x318ae7,_0x2dbf4b){_0x318ae7=_0x318ae7-0x0;var _0x16857c=_0xcf61[_0x318ae7];return _0x16857c;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x1cf6('0x0'));var md5=require(_0x1cf6('0x1'));var util=require(_0x1cf6('0x2'));var Redis=require(_0x1cf6('0x3'));var intUtil=require(_0x1cf6('0x4'));var config=require(_0x1cf6('0x5'));var logger=require('../../../../config/logger')(_0x1cf6('0x6'));config[_0x1cf6('0x7')]=_[_0x1cf6('0x8')](config[_0x1cf6('0x7')],{'host':_0x1cf6('0x9'),'port':0x18eb});var io=require(_0x1cf6('0xa'))(new Redis(config[_0x1cf6('0x7')]));var def={'method':_0x1cf6('0xb'),'json':!![]};function emit(_0x533584,_0x484fdd,_0x10ef36){io['to'](_0x533584)[_0x1cf6('0xc')](_0x484fdd,_0x10ef36);}function getTicket(_0x515bb7,_0x47f757,_0x50deeb,_0x2ac8a4,_0x5018e3,_0x111bff,_0x4fbe9e,_0x4ab06e){logger[_0x1cf6('0xd')](_0x1cf6('0xe'));var _0x2eb3e7=new Date();var _0x38edf5=[{'name':_0x1cf6('0xf'),'value':intUtil[_0x1cf6('0x10')](_0x2ac8a4[_0x1cf6('0x11')],_0x5018e3,'\x20')},{'name':_0x1cf6('0x12'),'value':_0x47f757['id']},{'name':_0x1cf6('0x13'),'value':_0x47f757['id']},{'name':_0x1cf6('0x14'),'value':intUtil[_0x1cf6('0x10')](_0x2ac8a4[_0x1cf6('0x15')],_0x5018e3,'\x0a')},{'name':'date_start','value':_0x2eb3e7['toISOString']()[_0x1cf6('0x16')](0x0,0x13)[_0x1cf6('0x17')]('T','\x20')},{'name':_0x1cf6('0x18'),'value':'0'},{'name':_0x1cf6('0x19'),'value':'15'},{'name':_0x1cf6('0x1a'),'value':_0x50deeb['id']},{'name':_0x1cf6('0x1b'),'value':_0x1cf6('0x1c')},{'name':'parent_name','value':_0x50deeb[_0x1cf6('0xf')]},{'name':_0x1cf6('0x1d'),'value':_0x4ab06e}];if(_0x111bff['length']){_[_0x1cf6('0x1e')](_0x111bff,function(_0x54c085){if(_0x5018e3[_0x54c085[_0x1cf6('0x1f')]]){_0x38edf5[_0x1cf6('0x20')]({'name':_0x54c085[_0x1cf6('0x21')],'value':_0x5018e3[_0x54c085[_0x1cf6('0x1f')]]});}});}return request({'form':{'method':_0x1cf6('0x22'),'input_type':_0x1cf6('0x23'),'response_type':_0x1cf6('0x23'),'rest_data':JSON[_0x1cf6('0x24')]({'session':_0x4fbe9e['id'],'module_name':'Calls','name_value_list':_0x38edf5})}});}function getAuth(_0x2bbed5){return util[_0x1cf6('0x25')](_0x1cf6('0x26'),new Buffer(_0x2bbed5[_0x1cf6('0x27')]+':X')[_0x1cf6('0x28')](_0x1cf6('0x29')));}function getServerInfo(_0x76e2f2){return request({'form':{'method':_0x1cf6('0x2a'),'input_type':_0x1cf6('0x23'),'response_type':'JSON','rest_data':JSON[_0x1cf6('0x24')]({'session':_0x76e2f2['id']})}});}function getUser(_0x5cf8c2,_0x43383e,_0x40cd4f){if(!_[_0x1cf6('0x2b')](_0x43383e)){logger['info'](_0x1cf6('0x2c'),_0x43383e);return request({'form':{'method':_0x1cf6('0x2d'),'input_type':_0x1cf6('0x23'),'response_type':_0x1cf6('0x23'),'rest_data':JSON[_0x1cf6('0x24')]({'session':_0x40cd4f['id'],'module_name':_0x1cf6('0x2e'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x43383e),'order_by':'','offset':'0','select_fields':['id',_0x1cf6('0xf'),_0x1cf6('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x1b0599){if(_0x1b0599[_0x1cf6('0x30')][_0x1cf6('0x31')]){var _0x3da564=_[_0x1cf6('0x32')](_0x1b0599['entry_list'],function(_0x223a04){return _0x223a04[_0x1cf6('0x33')][_0x1cf6('0x2f')][_0x1cf6('0x34')]===_0x43383e;});if(_0x3da564){logger[_0x1cf6('0xd')]('Agent\x20found!');return BPromise[_0x1cf6('0x35')]({'id':_0x3da564[_0x1cf6('0x33')]['id'][_0x1cf6('0x34')],'name':_0x3da564[_0x1cf6('0x33')][_0x1cf6('0xf')][_0x1cf6('0x34')]});}}logger['info'](_0x1cf6('0x36'));return BPromise[_0x1cf6('0x35')]({'id':_0x40cd4f[_0x1cf6('0x33')]['user_id'][_0x1cf6('0x34')],'name':_0x40cd4f[_0x1cf6('0x33')][_0x1cf6('0x2f')][_0x1cf6('0x34')]});});}else{logger['info'](_0x1cf6('0x37'));return BPromise[_0x1cf6('0x35')]({'id':_0x40cd4f[_0x1cf6('0x33')][_0x1cf6('0x38')][_0x1cf6('0x34')],'name':_0x40cd4f['name_value_list'][_0x1cf6('0x2f')][_0x1cf6('0x34')]});}}function getEndUser(_0x1e806e,_0x172647,_0x5bf4f2,_0x555f1c){logger[_0x1cf6('0xd')](_0x1cf6('0x39'),_0x5bf4f2);return request({'form':{'method':_0x1cf6('0x2d'),'input_type':_0x1cf6('0x23'),'response_type':_0x1cf6('0x23'),'rest_data':JSON[_0x1cf6('0x24')]({'session':_0x555f1c['id'],'module_name':_0x1cf6('0x1c'),'query':util[_0x1cf6('0x25')](_0x1cf6('0x3a'),_0x5bf4f2),'order_by':'','offset':'0','select_fields':['id',_0x1cf6('0xf'),_0x1cf6('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1cf6('0x3c')](function(_0x31bdfd){if(_0x31bdfd['entry_list']['length']){var _0x413630=_[_0x1cf6('0x32')](_0x31bdfd[_0x1cf6('0x30')],function(_0x14781d){return _0x14781d[_0x1cf6('0x33')][_0x1cf6('0x3b')][_0x1cf6('0x34')]===_0x5bf4f2;});if(_0x413630){logger[_0x1cf6('0xd')](_0x1cf6('0x3d'));return BPromise[_0x1cf6('0x35')]({'id':_0x413630[_0x1cf6('0x33')]['id'][_0x1cf6('0x34')],'name':_0x413630['name_value_list'][_0x1cf6('0xf')][_0x1cf6('0x34')],'phone':_0x413630[_0x1cf6('0x33')][_0x1cf6('0x3b')][_0x1cf6('0x34')]});}}else{logger[_0x1cf6('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x1cf6('0x22'),'input_type':_0x1cf6('0x23'),'response_type':_0x1cf6('0x23'),'rest_data':JSON[_0x1cf6('0x24')]({'session':_0x555f1c['id'],'module_name':_0x1cf6('0x1c'),'name_value_list':[{'name':'first_name','value':_0x172647!==_0x1cf6('0x3e')?_0x172647:util[_0x1cf6('0x25')]('Caller\x20-\x20%s',_0x5bf4f2)},{'name':_0x1cf6('0x3b'),'value':_0x5bf4f2}]})}})['then'](function(_0x1f49e7){logger[_0x1cf6('0xd')](_0x1cf6('0x3f'));return BPromise[_0x1cf6('0x35')]({'id':_0x1f49e7['id'],'name':_0x1f49e7['entry_list'][_0x1cf6('0x40')]['value'],'phone':_0x1f49e7['entry_list'][_0x1cf6('0x3b')]['value']});});}});}function request(_0x4ea2be){logger[_0x1cf6('0x41')](_0x1cf6('0x42'),JSON[_0x1cf6('0x24')](_0x4ea2be));return rp(_[_0x1cf6('0x43')](def,_0x4ea2be));}function getTags(_0x1e3061,_0x48fc06){var _0x2306ef=[];if(_0x1e3061&&_0x1e3061[_0x1cf6('0x31')]>0x0){_0x2306ef=_[_0x1cf6('0x44')](_0x1e3061,_0x48fc06);}return _0x2306ef;}function getCustomFields(_0x3ca527,_0x13efc6){var _0x13c810=[];var _0x17623b={'custom_fields':[]};if(_0x3ca527[_0x1cf6('0x31')]>0x0){_[_0x1cf6('0x1e')](_0x3ca527,function(_0x4726b7){if(_0x4726b7['type']===_0x1cf6('0x45')&&_0x4726b7['nameField']&&!_0x4726b7['customField']){_0x17623b[_0x4726b7[_0x1cf6('0x46')][_0x1cf6('0x47')]()]=_0x4726b7['content'][_0x1cf6('0x28')]();}else if(_0x4726b7[_0x1cf6('0x48')]==='string'&&_0x4726b7[_0x1cf6('0x21')]&&_0x4726b7[_0x1cf6('0x49')]){_0x17623b[_0x1cf6('0x4a')][_0x1cf6('0x20')]({'id':_0x4726b7[_0x1cf6('0x21')],'value':_0x4726b7[_0x1cf6('0x4b')][_0x1cf6('0x28')]()});}else if(_0x4726b7[_0x1cf6('0x48')]===_0x1cf6('0x4c')&&_0x4726b7[_0x1cf6('0x1f')]&&_0x4726b7[_0x1cf6('0x21')]&&_0x4726b7['customField']){_0x13efc6[_0x4726b7['variableName']]&&_0x17623b[_0x1cf6('0x4a')][_0x1cf6('0x20')]({'id':_0x4726b7[_0x1cf6('0x21')],'value':_0x13efc6[_0x4726b7[_0x1cf6('0x1f')]][_0x1cf6('0x28')]()});}else if(_0x4726b7['type']===_0x1cf6('0x4d')&&_0x4726b7[_0x1cf6('0x4e')]&&_0x4726b7[_0x1cf6('0x4e')][_0x1cf6('0xf')]&&_0x4726b7[_0x1cf6('0x21')]&&_0x4726b7['customField']){_0x13efc6[_0x4726b7[_0x1cf6('0x4e')][_0x1cf6('0xf')][_0x1cf6('0x47')]()]&&_0x17623b[_0x1cf6('0x4a')]['push']({'id':_0x4726b7[_0x1cf6('0x21')],'value':_0x13efc6[_0x4726b7[_0x1cf6('0x4e')][_0x1cf6('0xf')][_0x1cf6('0x47')]()]['toString']()});}});}return _0x17623b;}function getConnection(_0x59f06b){return request({'method':_0x1cf6('0xb'),'form':{'method':_0x1cf6('0x4f'),'input_type':'JSON','response_type':_0x1cf6('0x23'),'rest_data':JSON[_0x1cf6('0x24')]({'user_auth':{'user_name':_0x59f06b[_0x1cf6('0x50')],'password':_0x59f06b[_0x1cf6('0x51')],'encryption':_0x1cf6('0x52')},'application':_0x1cf6('0x53')})}})[_0x1cf6('0x3c')](function(_0x2ddd26){var _0x1f6d29=_0x2ddd26;if(_0x1f6d29['id']){def[_0x1cf6('0x54')]=_0x1f6d29['id'];return BPromise[_0x1cf6('0x35')](_0x1f6d29);}else{throw new Error(util[_0x1cf6('0x25')]('Account\x20%d\x20is\x20not\x20valid',_0x59f06b['id']));}});}function setRelationship(_0x5c2ea9,_0x47e088,_0x2e382a,_0xa1e3fb){return request({'form':{'method':_0x1cf6('0x55'),'input_type':_0x1cf6('0x23'),'response_type':_0x1cf6('0x23'),'rest_data':JSON['stringify']({'session':_0x5c2ea9['id'],'module_name':'Calls','module_id':_0x2e382a['id'],'link_field_name':_0xa1e3fb,'related_ids':[_0x47e088['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x1cf6('0x56')]=function(_0x22969c,_0x5542bb,_0x5b25d3,_0x22ea6b,_0x4daa3f,_0x3887a2){var _0x6f58eb,_0xb9385a,_0x125999,_0x13a681;_0x3887a2[_0x1cf6('0x57')]=intUtil[_0x1cf6('0x58')](_0x3887a2[_0x1cf6('0x57')]);_0x3887a2['serverUrl']=intUtil[_0x1cf6('0x58')](_0x3887a2[_0x1cf6('0x59')]);def[_0x1cf6('0x5a')]=util['format'](_0x1cf6('0x5b'),_0x3887a2['remoteUri']);if(_0x4daa3f&&_0x4daa3f[_0x1cf6('0x5c')]){logger[_0x1cf6('0xd')]('[QUEUE]',_0x1cf6('0x5d'));_0x5542bb[_0x1cf6('0x5e')]=util[_0x1cf6('0x25')](_0x1cf6('0x5f'),_0x3887a2[_0x1cf6('0x59')],_0x5542bb[_0x1cf6('0x60')],md5(_0x5542bb['uniqueid']));}else{_0x5542bb[_0x1cf6('0x5e')]='';}return getConnection(_0x3887a2)[_0x1cf6('0x3c')](function(_0x3d8895){_0x13a681=_0x3d8895;return getUser(_0x3887a2,_0x22ea6b[_0x1cf6('0xf')],_0x13a681);})['then'](function(_0x4a417a){_0x6f58eb=_0x4a417a;logger[_0x1cf6('0xd')](_0x1cf6('0x61'),_0x6f58eb['id']);return getEndUser(_0x3887a2,_0x5542bb[_0x1cf6('0x62')],_0x5542bb[_0x1cf6('0x63')],_0x13a681);})[_0x1cf6('0x3c')](function(_0x17d8fb){_0xb9385a=_0x17d8fb;logger['info'](_0x1cf6('0x64'),_0xb9385a['id']);return getTicket(_0x3887a2,_0x6f58eb,_0xb9385a,_0x5b25d3,_0x5542bb,_0x5b25d3[_0x1cf6('0x65')],_0x13a681,_0x1cf6('0x66'));})[_0x1cf6('0x3c')](function(_0x5d9aa3){_0x125999=_0x5d9aa3;logger['info'](_0x1cf6('0x67'));logger[_0x1cf6('0xd')](_0x1cf6('0x68'),_0x125999['id']);return setRelationship(_0x13a681,_0x6f58eb,_0x125999,_0x1cf6('0x69'));})[_0x1cf6('0x3c')](function(){return setRelationship(_0x13a681,_0xb9385a,_0x125999,_0x1cf6('0x6a'));})[_0x1cf6('0x3c')](function(){return getServerInfo(_0x13a681);})['then'](function(_0xa50e4f){var _0x22223a=parseInt(_0xa50e4f[_0x1cf6('0x6b')][_0x1cf6('0x6c')](0x0));var _0x3d3db2=util[_0x1cf6('0x25')](_0x1cf6('0x6d'),_0x3887a2[_0x1cf6('0x57')],_0x125999['id']);if(_0x22223a>0x6){_0x3d3db2=util[_0x1cf6('0x25')](_0x1cf6('0x6e'),_0x3887a2[_0x1cf6('0x57')],_0x125999['id']);}logger[_0x1cf6('0xd')](_0x1cf6('0x6f'),_0x1cf6('0x70'));emit(util[_0x1cf6('0x25')](_0x1cf6('0x71'),_0x22ea6b['name']),'trigger:browser:url',{'uri':_0x3d3db2});})['catch'](function(_0x1636fb){logger['error'](_0x1cf6('0x6f'),JSON[_0x1cf6('0x24')](_0x1636fb));});};exports[_0x1cf6('0x72')]=function(_0x55a863,_0x3cde51,_0x10ed42,_0x584f2d,_0x32030e,_0x17cb6d,_0x8c5b7c){var _0x87107,_0x8126e7,_0x109a6b,_0x203856;_0x17cb6d[_0x1cf6('0x57')]=intUtil[_0x1cf6('0x58')](_0x17cb6d[_0x1cf6('0x57')]);_0x17cb6d['serverUrl']=intUtil[_0x1cf6('0x58')](_0x17cb6d[_0x1cf6('0x59')]);def[_0x1cf6('0x5a')]=util[_0x1cf6('0x25')](_0x1cf6('0x5b'),_0x17cb6d[_0x1cf6('0x57')]);if(_0x8c5b7c&&_0x8c5b7c['recordingFormat']&&_0x8c5b7c['recordingFormat']!==_0x1cf6('0x73')){logger[_0x1cf6('0xd')](_0x1cf6('0x74'),_0x1cf6('0x5d'));_0x3cde51['recordingURL']=util[_0x1cf6('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x17cb6d[_0x1cf6('0x59')],_0x3cde51[_0x1cf6('0x60')],md5(_0x3cde51[_0x1cf6('0x60')]));}return getConnection(_0x17cb6d)[_0x1cf6('0x3c')](function(_0x1ccda8){_0x203856=_0x1ccda8;return getUser(_0x17cb6d,_0x584f2d[_0x1cf6('0xf')],_0x203856);})['then'](function(_0x47c6c2){_0x87107=_0x47c6c2;logger[_0x1cf6('0xd')](_0x1cf6('0x61'),_0x87107['id']);return getEndUser(_0x17cb6d,_0x3cde51[_0x1cf6('0x75')],_0x3cde51[_0x1cf6('0x76')],_0x203856);})['then'](function(_0x15d724){_0x8126e7=_0x15d724;logger[_0x1cf6('0xd')](_0x1cf6('0x64'),_0x8126e7['id']);return getTicket(_0x17cb6d,_0x87107,_0x8126e7,_0x10ed42,_0x3cde51,_0x10ed42['Fields'],_0x203856,_0x1cf6('0x77'));})['then'](function(_0x2e08a7){_0x109a6b=_0x2e08a7;logger[_0x1cf6('0xd')](_0x1cf6('0x67'));logger[_0x1cf6('0xd')]('The\x20Ticket\x20ID\x20is:',_0x109a6b['id']);return setRelationship(_0x203856,_0x87107,_0x109a6b,_0x1cf6('0x69'));})[_0x1cf6('0x3c')](function(){return setRelationship(_0x203856,_0x8126e7,_0x109a6b,_0x1cf6('0x6a'));})[_0x1cf6('0x3c')](function(){return getServerInfo(_0x203856);})[_0x1cf6('0x3c')](function(_0x3dc979){var _0x3af5fc=parseInt(_0x3dc979['version']['charAt'](0x0));var _0x179171=util[_0x1cf6('0x25')](_0x1cf6('0x6d'),_0x17cb6d['remoteUri'],_0x109a6b['id']);if(_0x3af5fc>0x6){_0x179171=util[_0x1cf6('0x25')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x17cb6d[_0x1cf6('0x57')],_0x109a6b['id']);}logger['info'](_0x1cf6('0x74'),_0x1cf6('0x70'));emit(util[_0x1cf6('0x25')](_0x1cf6('0x71'),_0x584f2d['name']),'trigger:browser:url',{'uri':_0x179171});})[_0x1cf6('0x78')](function(_0x19a414){logger['error'](_0x1cf6('0x74'),JSON[_0x1cf6('0x24')](_0x19a414));});};exports[_0x1cf6('0x79')]=function(_0x440c36,_0x51dc7d,_0x3cd9f7,_0x56bd86,_0x5bbf87,_0xc8dd0){var _0x579062,_0x4b760a,_0x57b62e,_0x2c5bc5;_0xc8dd0[_0x1cf6('0x57')]=intUtil[_0x1cf6('0x58')](_0xc8dd0['remoteUri']);_0xc8dd0[_0x1cf6('0x59')]=intUtil[_0x1cf6('0x58')](_0xc8dd0['serverUrl']);def[_0x1cf6('0x5a')]=util[_0x1cf6('0x25')](_0x1cf6('0x5b'),_0xc8dd0[_0x1cf6('0x57')]);if(_0x5bbf87&&_0x5bbf87[_0x1cf6('0x5c')]){logger[_0x1cf6('0xd')]('['+_0x51dc7d['lastevent']['toUpperCase']()+']',_0x1cf6('0x5d'));_0x51dc7d[_0x1cf6('0x5e')]=util[_0x1cf6('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xc8dd0[_0x1cf6('0x59')],_0x51dc7d['uniqueid'],md5(_0x51dc7d[_0x1cf6('0x60')]));}else{_0x51dc7d[_0x1cf6('0x5e')]='';}return getConnection(_0xc8dd0)[_0x1cf6('0x3c')](function(_0x44385c){_0x2c5bc5=_0x44385c;if(!_[_0x1cf6('0x2b')](_0x56bd86)){return getUser(_0xc8dd0,_0x56bd86[_0x1cf6('0xf')],_0x2c5bc5);}else{return getUser(_0xc8dd0,null,_0x2c5bc5);}})[_0x1cf6('0x3c')](function(_0x5d8401){_0x579062=_0x5d8401;logger[_0x1cf6('0xd')](_0x1cf6('0x61'),_0x579062['id']);return getEndUser(_0xc8dd0,_0x51dc7d[_0x1cf6('0x62')],_0x51dc7d[_0x1cf6('0x63')],_0x2c5bc5);})[_0x1cf6('0x3c')](function(_0xee1bd5){_0x4b760a=_0xee1bd5;logger[_0x1cf6('0xd')](_0x1cf6('0x64'),_0x4b760a['id']);return getTicket(_0xc8dd0,_0x579062,_0x4b760a,_0x3cd9f7,_0x51dc7d,_0x3cd9f7[_0x1cf6('0x65')],_0x2c5bc5,_0x1cf6('0x66'));})['then'](function(_0xa8519c){_0x57b62e=_0xa8519c;logger['info'](_0x1cf6('0x67'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x57b62e['id']);return setRelationship(_0x2c5bc5,_0x579062,_0x57b62e,_0x1cf6('0x69'));})[_0x1cf6('0x3c')](function(){return setRelationship(_0x2c5bc5,_0x4b760a,_0x57b62e,_0x1cf6('0x6a'));})[_0x1cf6('0x3c')](function(){return getServerInfo(_0x2c5bc5);})[_0x1cf6('0x78')](function(_0x1a80e1){logger[_0x1cf6('0x7a')]('['+_0x51dc7d[_0x1cf6('0x7b')]['toUpperCase']()+']',JSON[_0x1cf6('0x24')](_0x1a80e1));});};
\ No newline at end of file
index ff7cdf5..d499e91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ca1=['format','%s:\x20%s','join','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key'];(function(_0x543c36,_0x5c406e){var _0x145185=function(_0xd81b88){while(--_0xd81b88){_0x543c36['push'](_0x543c36['shift']());}};_0x145185(++_0x5c406e);}(_0x1ca1,0x182));var _0x11ca=function(_0x754eba,_0x49309d){_0x754eba=_0x754eba-0x0;var _0x148536=_0x1ca1[_0x754eba];return _0x148536;};'use strict';var _=require(_0x11ca('0x0'));var util=require(_0x11ca('0x1'));exports[_0x11ca('0x2')]=function(_0x3e4ac7,_0x18855e,_0x27b8f9){var _0x19c33a=[];if(_0x3e4ac7[_0x11ca('0x3')]>0x0){var _0x4dd221=_[_0x11ca('0x4')](_0x3e4ac7,['id']);for(var _0x21a2f4=0x0;_0x21a2f4<_0x4dd221[_0x11ca('0x3')];_0x21a2f4++){var _0x573e21=_0x4dd221[_0x21a2f4];if(_0x573e21[_0x11ca('0x5')]===_0x11ca('0x6')){_0x19c33a[_0x11ca('0x7')](_0x573e21[_0x11ca('0x8')]);}else if(_0x573e21[_0x11ca('0x5')]===_0x11ca('0x9')&&_0x573e21[_0x11ca('0xa')]){_0x18855e[_0x573e21[_0x11ca('0xa')]]&&_0x19c33a[_0x11ca('0x7')](_0x18855e[_0x573e21['variableName']][_0x11ca('0xb')]());}else if(_0x573e21[_0x11ca('0x5')]===_0x11ca('0xc')&&_0x573e21[_0x11ca('0xd')]&&_0x573e21[_0x11ca('0xd')][_0x11ca('0xe')]){_0x18855e[_0x573e21[_0x11ca('0xd')][_0x11ca('0xe')][_0x11ca('0xf')]()]&&_0x19c33a[_0x11ca('0x7')](_0x18855e[_0x573e21[_0x11ca('0xd')][_0x11ca('0xe')][_0x11ca('0xf')]()][_0x11ca('0xb')]());}else if(_0x573e21[_0x11ca('0x5')]===_0x11ca('0x10')){if(_0x573e21[_0x11ca('0x11')]===_0x11ca('0x6')&&_0x573e21[_0x11ca('0x12')]){_0x19c33a['push'](util[_0x11ca('0x13')](_0x11ca('0x14'),_0x573e21['key'],_0x573e21['keyContent']));}else if(_0x573e21[_0x11ca('0x11')]===_0x11ca('0x9')&&_0x573e21['variableName']&&_0x573e21['key']){_0x18855e[_0x573e21['variableName']]&&_0x19c33a[_0x11ca('0x7')](util[_0x11ca('0x13')](_0x11ca('0x14'),_0x573e21['key'],_0x18855e[_0x573e21[_0x11ca('0xa')]]));}else if(_0x573e21[_0x11ca('0x11')]===_0x11ca('0xc')&&_0x573e21[_0x11ca('0xd')]&&_0x573e21['Variable']['name']&&_0x573e21[_0x11ca('0x12')]){_0x18855e[_0x573e21['Variable'][_0x11ca('0xe')][_0x11ca('0xf')]()]&&_0x19c33a[_0x11ca('0x7')](util[_0x11ca('0x13')](_0x11ca('0x14'),_0x573e21['key'],_0x18855e[_0x573e21['Variable'][_0x11ca('0xe')][_0x11ca('0xf')]()]));}}}}return _0x19c33a[_0x11ca('0x15')](_0x27b8f9);};exports[_0x11ca('0x16')]=function(_0x5346d8){var _0x38614d=_0x5346d8['slice'](-0x1);if(_0x38614d==='/'){_0x5346d8=_0x5346d8[_0x11ca('0x17')](0x0,_0x5346d8[_0x11ca('0x18')](_0x38614d));}return _0x5346d8;};exports[_0x11ca('0x19')]=function(_0x31a570){if(!_[_0x11ca('0x1a')](_0x31a570)&&_0x31a570!==''){var _0x4e9d93=/^(([^<>()\[\]\\.,;:\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 _0x4e9d93['test'](String(_0x31a570)[_0x11ca('0xf')]());}else{return![];}};
\ No newline at end of file
+var _0x584a=['%s:\x20%s','variable','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','test','util','getString','length','sortBy','string','push','content','variableName','customVariable','Variable','name','toLowerCase','toString','type','keyValue','keyType','key','format'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x584a,0xbe));var _0xa584=function(_0x4f74a5,_0x1fd979){_0x4f74a5=_0x4f74a5-0x0;var _0x5be8b2=_0x584a[_0x4f74a5];return _0x5be8b2;};'use strict';var _=require('lodash');var util=require(_0xa584('0x0'));exports[_0xa584('0x1')]=function(_0x4fef88,_0x41f0d9,_0x1ad10e){var _0x25a170=[];if(_0x4fef88[_0xa584('0x2')]>0x0){var _0x15dcba=_[_0xa584('0x3')](_0x4fef88,['id']);for(var _0x30c478=0x0;_0x30c478<_0x15dcba[_0xa584('0x2')];_0x30c478++){var _0x5616d2=_0x15dcba[_0x30c478];if(_0x5616d2['type']===_0xa584('0x4')){_0x25a170[_0xa584('0x5')](_0x5616d2[_0xa584('0x6')]);}else if(_0x5616d2['type']==='variable'&&_0x5616d2[_0xa584('0x7')]){_0x41f0d9[_0x5616d2[_0xa584('0x7')]]&&_0x25a170['push'](_0x41f0d9[_0x5616d2[_0xa584('0x7')]]['toString']());}else if(_0x5616d2['type']===_0xa584('0x8')&&_0x5616d2[_0xa584('0x9')]&&_0x5616d2[_0xa584('0x9')][_0xa584('0xa')]){_0x41f0d9[_0x5616d2[_0xa584('0x9')][_0xa584('0xa')][_0xa584('0xb')]()]&&_0x25a170['push'](_0x41f0d9[_0x5616d2[_0xa584('0x9')][_0xa584('0xa')]['toLowerCase']()][_0xa584('0xc')]());}else if(_0x5616d2[_0xa584('0xd')]===_0xa584('0xe')){if(_0x5616d2[_0xa584('0xf')]===_0xa584('0x4')&&_0x5616d2[_0xa584('0x10')]){_0x25a170[_0xa584('0x5')](util[_0xa584('0x11')](_0xa584('0x12'),_0x5616d2['key'],_0x5616d2['keyContent']));}else if(_0x5616d2[_0xa584('0xf')]===_0xa584('0x13')&&_0x5616d2['variableName']&&_0x5616d2['key']){_0x41f0d9[_0x5616d2[_0xa584('0x7')]]&&_0x25a170[_0xa584('0x5')](util[_0xa584('0x11')](_0xa584('0x12'),_0x5616d2[_0xa584('0x10')],_0x41f0d9[_0x5616d2[_0xa584('0x7')]]));}else if(_0x5616d2['keyType']===_0xa584('0x8')&&_0x5616d2['Variable']&&_0x5616d2['Variable'][_0xa584('0xa')]&&_0x5616d2[_0xa584('0x10')]){_0x41f0d9[_0x5616d2['Variable'][_0xa584('0xa')]['toLowerCase']()]&&_0x25a170['push'](util['format']('%s:\x20%s',_0x5616d2[_0xa584('0x10')],_0x41f0d9[_0x5616d2[_0xa584('0x9')][_0xa584('0xa')][_0xa584('0xb')]()]));}}}}return _0x25a170['join'](_0x1ad10e);};exports[_0xa584('0x14')]=function(_0x59b57a){var _0x225fd5=_0x59b57a['slice'](-0x1);if(_0x225fd5==='/'){_0x59b57a=_0x59b57a[_0xa584('0x15')](0x0,_0x59b57a[_0xa584('0x16')](_0x225fd5));}return _0x59b57a;};exports[_0xa584('0x17')]=function(_0x36c1ec){if(!_[_0xa584('0x18')](_0x36c1ec)&&_0x36c1ec!==''){var _0x12b823=/^(([^<>()\[\]\\.,;:\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 _0x12b823[_0xa584('0x19')](String(_0x36c1ec)['toLowerCase']());}else{return![];}};
\ No newline at end of file
index 8fab0fb..9a63c01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x49aab8,_0x2d3f2c){var _0xe85cb3=function(_0x3536eb){while(--_0x3536eb){_0x49aab8['push'](_0x49aab8['shift']());}};_0xe85cb3(++_0x2d3f2c);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});};
\ No newline at end of file
+var _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(_0xfbe06e,_0x2fb7ab){var _0x24e5b6=function(_0x48569f){while(--_0x48569f){_0xfbe06e['push'](_0xfbe06e['shift']());}};_0x24e5b6(++_0x2fb7ab);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});};
\ No newline at end of file
index 47f86fc..3e726c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bd7=['calleridname','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/users/me.json','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','password','%s:%s','username','token','Basic\x20%s','toString','base64','debug','defaults','map','includes','string','picklist','type','customField','nameField','toLowerCase','content','idField','custom_fields','push','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase'];(function(_0xb8f65,_0x5b3d4f){var _0x537221=function(_0x157d70){while(--_0x157d70){_0xb8f65['push'](_0xb8f65['shift']());}};_0x537221(++_0x5b3d4f);}(_0x6bd7,0x1ce));var _0x76bd=function(_0x5d1df9,_0x4a95bf){_0x5d1df9=_0x5d1df9-0x0;var _0x5d4feb=_0x6bd7[_0x5d1df9];return _0x5d4feb;};'use strict';var _=require(_0x76bd('0x0'));var rp=require(_0x76bd('0x1'));var md5=require(_0x76bd('0x2'));var util=require(_0x76bd('0x3'));var Redis=require(_0x76bd('0x4'));var intUtil=require(_0x76bd('0x5'));var config=require(_0x76bd('0x6'));var logger=require(_0x76bd('0x7'))(_0x76bd('0x8'));config[_0x76bd('0x9')]=_['defaults'](config[_0x76bd('0x9')],{'host':_0x76bd('0xa'),'port':0x18eb});var io=require(_0x76bd('0xb'))(new Redis(config[_0x76bd('0x9')]));function emit(_0x3d7acc,_0x4793c6,_0x499815){io['to'](_0x3d7acc)[_0x76bd('0xc')](_0x4793c6,_0x499815);}var headers={'Content-Type':'application/json','Accept':_0x76bd('0xd')};function getTicket(_0x3279d8,_0x35348f,_0x3ff82d,_0x26e376,_0x3aaaad){logger[_0x76bd('0xe')](_0x76bd('0xf'));return request({'uri':util[_0x76bd('0x10')](_0x76bd('0x11'),_0x3279d8[_0x76bd('0x12')]),'method':_0x76bd('0x13'),'body':{'ticket':_['merge']({'requester_id':_0x3ff82d['id'],'submitter_id':_0x35348f?_0x35348f['id']:undefined,'assignee_id':_0x35348f?_0x35348f['id']:undefined,'tags':getTags(_0x26e376[_0x76bd('0x14')],_0x76bd('0x15')),'subject':intUtil[_0x76bd('0x16')](_0x26e376[_0x76bd('0x17')],_0x3aaaad,'\x20'),'description':intUtil[_0x76bd('0x16')](_0x26e376[_0x76bd('0x18')],_0x3aaaad,'\x0a'),'comment':{'public':![],'body':intUtil[_0x76bd('0x16')](_0x26e376['Descriptions'],_0x3aaaad,'\x0a')}},getCustomFields(_0x26e376[_0x76bd('0x19')],_0x3aaaad))}})[_0x76bd('0x1a')](function(_0x40818b){logger[_0x76bd('0xe')]('Ticket\x20created!');return _0x40818b[_0x76bd('0x1b')];});}function getUser(_0x38cc49,_0x54180f){if(intUtil[_0x76bd('0x1c')](_0x54180f)){logger[_0x76bd('0xe')](_0x76bd('0x1d'),_0x54180f);return request({'uri':util[_0x76bd('0x10')]('%s/search.json',_0x38cc49['remoteUri']),'qs':{'query':util[_0x76bd('0x10')](_0x76bd('0x1e'),_0x54180f)}})['then'](function(_0x56ac0f){if(_0x56ac0f[_0x76bd('0x1f')]){logger[_0x76bd('0xe')](_0x76bd('0x20'));return _['find'](_0x56ac0f[_0x76bd('0x21')],{'email':_0x54180f,'role':_0x76bd('0x22')});}else{logger['info'](_0x76bd('0x23'));return request({'uri':util[_0x76bd('0x10')]('%s/users/me.json',_0x38cc49[_0x76bd('0x12')])})['then'](function(_0x49cb27){logger['info'](_0x76bd('0x24'));return _0x49cb27['user'];});}});}else{logger[_0x76bd('0xe')](_0x76bd('0x23'));return request({'uri':util[_0x76bd('0x10')](_0x76bd('0x25'),_0x38cc49[_0x76bd('0x12')])})[_0x76bd('0x1a')](function(_0x285465){logger[_0x76bd('0xe')]('Admin\x20account\x20selected.');return _0x285465[_0x76bd('0x26')];});}}function getEndUser(_0x27f895,_0x2790de,_0x510d71){logger['info'](_0x76bd('0x27'),_0x510d71);return request({'uri':util[_0x76bd('0x10')](_0x76bd('0x28'),_0x27f895[_0x76bd('0x12')]),'qs':{'query':util[_0x76bd('0x10')](_0x76bd('0x29'),_0x510d71)}})[_0x76bd('0x1a')](function(_0xc73380){var _0x408d19;if(_0xc73380[_0x76bd('0x21')][_0x76bd('0x2a')]){_0xc73380[_0x76bd('0x21')]=_[_0x76bd('0x2b')](_0xc73380[_0x76bd('0x21')],{'suspended':![],'role':_0x76bd('0x2c')});if(_0xc73380[_0x76bd('0x21')][_0x76bd('0x2a')]){_0x408d19=_[_0x76bd('0x2d')](_0xc73380[_0x76bd('0x21')]);}}if(_0x408d19){logger[_0x76bd('0xe')](_0x76bd('0x2e'));return _0x408d19;}else{logger['info'](_0x76bd('0x2f'));return request({'uri':util[_0x76bd('0x10')](_0x76bd('0x30'),_0x27f895['remoteUri']),'method':_0x76bd('0x13'),'body':{'user':{'role':'end-user','name':util[_0x76bd('0x10')](_0x76bd('0x31'),_0x2790de||_0x510d71),'phone':_0x510d71}}})[_0x76bd('0x1a')](function(_0x2d6b5d){logger['info']('Enduser\x20created.');return _0x2d6b5d[_0x76bd('0x26')];});}});}function getAuth(_0x3a7e45){var _0x4d68b0;if(_0x3a7e45[_0x76bd('0x32')]===_0x76bd('0x33')){_0x4d68b0=util[_0x76bd('0x10')](_0x76bd('0x34'),_0x3a7e45[_0x76bd('0x35')],_0x3a7e45[_0x76bd('0x33')]);}else if(_0x3a7e45['authType']===_0x76bd('0x36')){_0x4d68b0=util['format']('%s/token:%s',_0x3a7e45[_0x76bd('0x35')],_0x3a7e45[_0x76bd('0x36')]);}return util['format'](_0x76bd('0x37'),new Buffer(_0x4d68b0)[_0x76bd('0x38')](_0x76bd('0x39')));}function request(_0x54dc9a){logger[_0x76bd('0x3a')]('[HTTP]',JSON['stringify'](_0x54dc9a));return rp(_[_0x76bd('0x3b')](_0x54dc9a,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x50135d,_0x155d3e){var _0x22b1aa=[];if(_0x50135d&&_0x50135d['length']>0x0){_0x22b1aa=_[_0x76bd('0x3c')](_0x50135d,_0x155d3e);}return _0x22b1aa;}function getCustomFields(_0x41c24b,_0x414e2e){var _0xae11c8=[];var _0x2fa812={'custom_fields':[]};if(_0x41c24b['length']>0x0){_['forEach'](_0x41c24b,function(_0x5bbf21){if(_[_0x76bd('0x3d')]([_0x76bd('0x3e'),_0x76bd('0x3f')],_0x5bbf21[_0x76bd('0x40')])&&_0x5bbf21['nameField']&&!_0x5bbf21[_0x76bd('0x41')]){_0x2fa812[_0x5bbf21[_0x76bd('0x42')][_0x76bd('0x43')]()]=_0x5bbf21[_0x76bd('0x44')][_0x76bd('0x38')]();}else if(_['includes']([_0x76bd('0x3e'),_0x76bd('0x3f')],_0x5bbf21[_0x76bd('0x40')])&&_0x5bbf21[_0x76bd('0x45')]&&_0x5bbf21[_0x76bd('0x41')]){_0x2fa812[_0x76bd('0x46')][_0x76bd('0x47')]({'id':_0x5bbf21[_0x76bd('0x45')],'value':_0x5bbf21[_0x76bd('0x44')][_0x76bd('0x38')]()});}else if(_0x5bbf21['type']===_0x76bd('0x48')&&_0x5bbf21[_0x76bd('0x49')]&&_0x5bbf21[_0x76bd('0x45')]&&_0x5bbf21[_0x76bd('0x41')]){_0x414e2e[_0x5bbf21['variableName']]&&_0x2fa812['custom_fields']['push']({'id':_0x5bbf21[_0x76bd('0x45')],'value':_0x414e2e[_0x5bbf21[_0x76bd('0x49')]][_0x76bd('0x38')]()});}else if(_0x5bbf21[_0x76bd('0x40')]==='customVariable'&&_0x5bbf21['Variable']&&_0x5bbf21[_0x76bd('0x4a')][_0x76bd('0x15')]&&_0x5bbf21[_0x76bd('0x45')]&&_0x5bbf21['customField']){_0x414e2e[_0x5bbf21['Variable'][_0x76bd('0x15')][_0x76bd('0x43')]()]&&_0x2fa812['custom_fields'][_0x76bd('0x47')]({'id':_0x5bbf21[_0x76bd('0x45')],'value':_0x414e2e[_0x5bbf21[_0x76bd('0x4a')][_0x76bd('0x15')][_0x76bd('0x43')]()]['toString']()});}});}return _0x2fa812;}exports[_0x76bd('0x4b')]=function(_0xbe8ac5,_0x2e5773,_0x4ee174,_0x4397eb,_0x21b021,_0x153005){var _0x21c592,_0x2313bc;_0x153005['remoteUri']=intUtil[_0x76bd('0x4c')](_0x153005[_0x76bd('0x12')]);_0x153005[_0x76bd('0x4d')]=intUtil['stripTrailingSlash'](_0x153005[_0x76bd('0x4d')]);if(_0x21b021&&_0x21b021[_0x76bd('0x4e')]){logger[_0x76bd('0xe')](_0x76bd('0x4f'),'Recording\x20is\x20enabled!');_0x2e5773[_0x76bd('0x50')]=util['format'](_0x76bd('0x51'),_0x153005[_0x76bd('0x4d')],_0x2e5773[_0x76bd('0x52')],md5(_0x2e5773[_0x76bd('0x52')]));}else{_0x2e5773[_0x76bd('0x50')]='';}headers[_0x76bd('0x53')]=getAuth(_0x153005);return getUser(_0x153005,_0x4397eb[_0x76bd('0x54')])[_0x76bd('0x1a')](function(_0x2de98e){_0x21c592=_0x2de98e;logger[_0x76bd('0xe')](_0x76bd('0x55'),_0x21c592['id']);return getEndUser(_0x153005,_0x2e5773['calleridname'],_0x2e5773[_0x76bd('0x56')]);})[_0x76bd('0x1a')](function(_0x1adff3){_0x2313bc=_0x1adff3;logger[_0x76bd('0xe')]('The\x20Enduser\x20ID\x20is:',_0x2313bc['id']);return getTicket(_0x153005,_0x21c592,_0x2313bc,_0x4ee174,_0x2e5773);})['then'](function(_0x346e5a){if(_0x346e5a){logger[_0x76bd('0xe')](_0x76bd('0x57'),_0x346e5a['id']);switch(_0x153005['type']){case _0x76bd('0x58'):logger[_0x76bd('0xe')](_0x76bd('0x4f'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x76bd('0x59'),_0x153005[_0x76bd('0x12')],_0x21c592['id'],_0x346e5a['id']),'method':'POST'});case _0x76bd('0x5a'):logger[_0x76bd('0xe')]('[QUEUE]',_0x76bd('0x5b'));emit(util[_0x76bd('0x10')](_0x76bd('0x5c'),_0x4397eb['name']),_0x76bd('0x5d'),{'uri':util[_0x76bd('0x10')]('%s/agent/tickets/%s',_0x153005['remoteUri']['replace'](_0x76bd('0x5e'),''),_0x346e5a['id'])});break;default:logger[_0x76bd('0x5f')]('[QUEUE]',_0x76bd('0x60'));}}})[_0x76bd('0x61')](function(_0x1569c4){logger[_0x76bd('0x5f')](_0x76bd('0x62'),util[_0x76bd('0x63')](_0x1569c4,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x27edec,_0x34c243,_0x4ec410,_0x294ea4,_0x5b2bf6,_0x4e1630,_0x45154a){var _0x1a83bb,_0x9469e5;_0x4e1630[_0x76bd('0x12')]=intUtil[_0x76bd('0x4c')](_0x4e1630[_0x76bd('0x12')]);_0x4e1630[_0x76bd('0x4d')]=intUtil[_0x76bd('0x4c')](_0x4e1630[_0x76bd('0x4d')]);if(_0x45154a&&_0x45154a[_0x76bd('0x64')]&&_0x45154a[_0x76bd('0x64')]!==_0x76bd('0x65')){logger[_0x76bd('0xe')](_0x76bd('0x66'),_0x76bd('0x67'));_0x34c243[_0x76bd('0x50')]=util[_0x76bd('0x10')](_0x76bd('0x51'),_0x4e1630['serverUrl'],_0x34c243[_0x76bd('0x52')],md5(_0x34c243['uniqueid']));}headers[_0x76bd('0x53')]=getAuth(_0x4e1630);return getUser(_0x4e1630,_0x294ea4[_0x76bd('0x54')])[_0x76bd('0x1a')](function(_0x1f8de6){_0x1a83bb=_0x1f8de6;logger[_0x76bd('0xe')](_0x76bd('0x55'),_0x1a83bb['id']);return getEndUser(_0x4e1630,_0x34c243[_0x76bd('0x68')],_0x34c243[_0x76bd('0x69')]);})[_0x76bd('0x1a')](function(_0x398e0f){_0x9469e5=_0x398e0f;logger[_0x76bd('0xe')](_0x76bd('0x6a'),_0x9469e5['id']);return getTicket(_0x4e1630,_0x1a83bb,_0x9469e5,_0x4ec410,_0x34c243);})[_0x76bd('0x1a')](function(_0x3e9e60){if(_0x3e9e60){logger[_0x76bd('0xe')](_0x76bd('0x57'),_0x3e9e60['id']);switch(_0x4e1630['type']){case _0x76bd('0x58'):logger[_0x76bd('0xe')](_0x76bd('0x66'),_0x76bd('0x6b'));return request({'uri':util[_0x76bd('0x10')](_0x76bd('0x59'),_0x4e1630[_0x76bd('0x12')],_0x1a83bb['id'],_0x3e9e60['id']),'method':_0x76bd('0x13')});case'newTab':logger[_0x76bd('0xe')]('[OUTBOUND]',_0x76bd('0x5b'));emit(util[_0x76bd('0x10')](_0x76bd('0x5c'),_0x294ea4['name']),_0x76bd('0x5d'),{'uri':util[_0x76bd('0x10')](_0x76bd('0x6c'),_0x4e1630[_0x76bd('0x12')][_0x76bd('0x6d')](_0x76bd('0x5e'),''),_0x3e9e60['id'])});break;default:logger['error'](_0x76bd('0x66'),_0x76bd('0x60'));}}})[_0x76bd('0x61')](function(_0x29a9d7){logger[_0x76bd('0x5f')](_0x76bd('0x6e'),util[_0x76bd('0x63')](_0x29a9d7,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x1ef98a,_0x2e1cb6,_0x2fd06d,_0x3b08d8,_0x67821c,_0x58d591){var _0x58ab1f,_0x4871de;_0x58d591[_0x76bd('0x12')]=intUtil[_0x76bd('0x4c')](_0x58d591[_0x76bd('0x12')]);_0x58d591['serverUrl']=intUtil[_0x76bd('0x4c')](_0x58d591['serverUrl']);if(_0x67821c&&_0x67821c[_0x76bd('0x4e')]){logger[_0x76bd('0xe')]('['+_0x2e1cb6[_0x76bd('0x6f')][_0x76bd('0x70')]()+']',_0x76bd('0x67'));_0x2e1cb6[_0x76bd('0x50')]=util[_0x76bd('0x10')](_0x76bd('0x51'),_0x58d591[_0x76bd('0x4d')],_0x2e1cb6['uniqueid'],md5(_0x2e1cb6[_0x76bd('0x52')]));}else{_0x2e1cb6[_0x76bd('0x50')]='';}headers[_0x76bd('0x53')]=getAuth(_0x58d591);return getUser(_0x58d591)[_0x76bd('0x1a')](function(_0x51e153){_0x58ab1f=_0x51e153;logger[_0x76bd('0xe')](_0x76bd('0x55'),_0x58ab1f['id']);return getEndUser(_0x58d591,_0x2e1cb6[_0x76bd('0x71')],_0x2e1cb6[_0x76bd('0x56')]);})[_0x76bd('0x1a')](function(_0x1b8e01){_0x4871de=_0x1b8e01;logger[_0x76bd('0xe')](_0x76bd('0x6a'),_0x4871de['id']);return getTicket(_0x58d591,_0x58ab1f,_0x4871de,_0x2fd06d,_0x2e1cb6);})['then'](function(_0x44d01a){if(_0x44d01a){logger[_0x76bd('0xe')](_0x76bd('0x57'),_0x44d01a['id']);}})[_0x76bd('0x61')](function(_0x47a19d){logger['error']('['+_0x2e1cb6['lastevent'][_0x76bd('0x70')]()+']'+_0x76bd('0x72'),util[_0x76bd('0x63')](_0x47a19d,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xc044=['then','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','find','agent','%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','results','length','filter','end-user','first','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','defaults','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','idField','custom_fields','push','content','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','unmanaged','toUpperCase','calleridname','\x20Error\x20running\x20Zendesk\x20integration','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','name','getString','Subjects','Descriptions','Fields'];(function(_0x28509b,_0x5831ff){var _0x1e0b6=function(_0x37d8a2){while(--_0x37d8a2){_0x28509b['push'](_0x28509b['shift']());}};_0x1e0b6(++_0x5831ff);}(_0xc044,0x126));var _0x4c04=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xc044[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x4c04('0x0'));var util=require(_0x4c04('0x1'));var Redis=require(_0x4c04('0x2'));var intUtil=require('./util');var config=require(_0x4c04('0x3'));var logger=require(_0x4c04('0x4'))(_0x4c04('0x5'));config['redis']=_['defaults'](config[_0x4c04('0x6')],{'host':_0x4c04('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x3d1937,_0x14e9b3,_0xcd6884){io['to'](_0x3d1937)['emit'](_0x14e9b3,_0xcd6884);}var headers={'Content-Type':_0x4c04('0x8'),'Accept':_0x4c04('0x8')};function getTicket(_0x21e00d,_0x8948da,_0x4b3fd2,_0x35f9d3,_0x1b274c){logger[_0x4c04('0x9')](_0x4c04('0xa'));return request({'uri':util[_0x4c04('0xb')](_0x4c04('0xc'),_0x21e00d[_0x4c04('0xd')]),'method':_0x4c04('0xe'),'body':{'ticket':_[_0x4c04('0xf')]({'requester_id':_0x4b3fd2['id'],'submitter_id':_0x8948da?_0x8948da['id']:undefined,'assignee_id':_0x8948da?_0x8948da['id']:undefined,'tags':getTags(_0x35f9d3['Tags'],_0x4c04('0x10')),'subject':intUtil[_0x4c04('0x11')](_0x35f9d3[_0x4c04('0x12')],_0x1b274c,'\x20'),'description':intUtil[_0x4c04('0x11')](_0x35f9d3['Descriptions'],_0x1b274c,'\x0a'),'comment':{'public':![],'body':intUtil[_0x4c04('0x11')](_0x35f9d3[_0x4c04('0x13')],_0x1b274c,'\x0a')}},getCustomFields(_0x35f9d3[_0x4c04('0x14')],_0x1b274c))}})[_0x4c04('0x15')](function(_0x269cbd){logger[_0x4c04('0x9')]('Ticket\x20created!');return _0x269cbd['ticket'];});}function getUser(_0x5b464f,_0x724bcf){if(intUtil[_0x4c04('0x16')](_0x724bcf)){logger['info'](_0x4c04('0x17'),_0x724bcf);return request({'uri':util['format'](_0x4c04('0x18'),_0x5b464f['remoteUri']),'qs':{'query':util[_0x4c04('0xb')](_0x4c04('0x19'),_0x724bcf)}})['then'](function(_0x5e8923){if(_0x5e8923['count']){logger[_0x4c04('0x9')]('Agent\x20found!');return _[_0x4c04('0x1a')](_0x5e8923['results'],{'email':_0x724bcf,'role':_0x4c04('0x1b')});}else{logger[_0x4c04('0x9')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x4c04('0xb')](_0x4c04('0x1c'),_0x5b464f[_0x4c04('0xd')])})[_0x4c04('0x15')](function(_0x42cdce){logger[_0x4c04('0x9')](_0x4c04('0x1d'));return _0x42cdce[_0x4c04('0x1e')];});}});}else{logger['info'](_0x4c04('0x1f'));return request({'uri':util[_0x4c04('0xb')]('%s/users/me.json',_0x5b464f[_0x4c04('0xd')])})['then'](function(_0x1ff7c9){logger['info'](_0x4c04('0x1d'));return _0x1ff7c9[_0x4c04('0x1e')];});}}function getEndUser(_0x443a8e,_0x44bacc,_0x7aa08d){logger[_0x4c04('0x9')](_0x4c04('0x20'),_0x7aa08d);return request({'uri':util[_0x4c04('0xb')](_0x4c04('0x18'),_0x443a8e['remoteUri']),'qs':{'query':util[_0x4c04('0xb')](_0x4c04('0x21'),_0x7aa08d)}})[_0x4c04('0x15')](function(_0x45a72e){var _0x4ca79c;if(_0x45a72e[_0x4c04('0x22')][_0x4c04('0x23')]){_0x45a72e['results']=_[_0x4c04('0x24')](_0x45a72e[_0x4c04('0x22')],{'suspended':![],'role':_0x4c04('0x25')});if(_0x45a72e[_0x4c04('0x22')][_0x4c04('0x23')]){_0x4ca79c=_[_0x4c04('0x26')](_0x45a72e[_0x4c04('0x22')]);}}if(_0x4ca79c){logger['info']('Enduser\x20found!');return _0x4ca79c;}else{logger[_0x4c04('0x9')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x4c04('0xb')](_0x4c04('0x27'),_0x443a8e[_0x4c04('0xd')]),'method':_0x4c04('0xe'),'body':{'user':{'role':_0x4c04('0x25'),'name':util['format'](_0x4c04('0x28'),_0x44bacc||_0x7aa08d),'phone':_0x7aa08d}}})[_0x4c04('0x15')](function(_0x249a06){logger[_0x4c04('0x9')](_0x4c04('0x29'));return _0x249a06['user'];});}});}function getAuth(_0x440417){var _0x21bcb2;if(_0x440417[_0x4c04('0x2a')]===_0x4c04('0x2b')){_0x21bcb2=util['format']('%s:%s',_0x440417[_0x4c04('0x2c')],_0x440417[_0x4c04('0x2b')]);}else if(_0x440417[_0x4c04('0x2a')]==='token'){_0x21bcb2=util[_0x4c04('0xb')](_0x4c04('0x2d'),_0x440417['username'],_0x440417['token']);}return util[_0x4c04('0xb')](_0x4c04('0x2e'),new Buffer(_0x21bcb2)[_0x4c04('0x2f')](_0x4c04('0x30')));}function request(_0x391377){logger[_0x4c04('0x31')](_0x4c04('0x32'),JSON['stringify'](_0x391377));return rp(_[_0x4c04('0x33')](_0x391377,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0xa90a46,_0x142a85){var _0x5edffe=[];if(_0xa90a46&&_0xa90a46[_0x4c04('0x23')]>0x0){_0x5edffe=_[_0x4c04('0x34')](_0xa90a46,_0x142a85);}return _0x5edffe;}function getCustomFields(_0x1ee88e,_0x32c24b){var _0x361c5e=[];var _0x3c8efe={'custom_fields':[]};if(_0x1ee88e['length']>0x0){_[_0x4c04('0x35')](_0x1ee88e,function(_0x131f20){if(_[_0x4c04('0x36')]([_0x4c04('0x37'),_0x4c04('0x38')],_0x131f20[_0x4c04('0x39')])&&_0x131f20[_0x4c04('0x3a')]&&!_0x131f20[_0x4c04('0x3b')]){_0x3c8efe[_0x131f20['nameField'][_0x4c04('0x3c')]()]=_0x131f20['content'][_0x4c04('0x2f')]();}else if(_[_0x4c04('0x36')]([_0x4c04('0x37'),_0x4c04('0x38')],_0x131f20[_0x4c04('0x39')])&&_0x131f20[_0x4c04('0x3d')]&&_0x131f20[_0x4c04('0x3b')]){_0x3c8efe[_0x4c04('0x3e')][_0x4c04('0x3f')]({'id':_0x131f20[_0x4c04('0x3d')],'value':_0x131f20[_0x4c04('0x40')][_0x4c04('0x2f')]()});}else if(_0x131f20[_0x4c04('0x39')]===_0x4c04('0x41')&&_0x131f20[_0x4c04('0x42')]&&_0x131f20[_0x4c04('0x3d')]&&_0x131f20[_0x4c04('0x3b')]){_0x32c24b[_0x131f20[_0x4c04('0x42')]]&&_0x3c8efe['custom_fields'][_0x4c04('0x3f')]({'id':_0x131f20[_0x4c04('0x3d')],'value':_0x32c24b[_0x131f20[_0x4c04('0x42')]]['toString']()});}else if(_0x131f20[_0x4c04('0x39')]===_0x4c04('0x43')&&_0x131f20[_0x4c04('0x44')]&&_0x131f20[_0x4c04('0x44')][_0x4c04('0x10')]&&_0x131f20[_0x4c04('0x3d')]&&_0x131f20['customField']){_0x32c24b[_0x131f20['Variable'][_0x4c04('0x10')][_0x4c04('0x3c')]()]&&_0x3c8efe[_0x4c04('0x3e')][_0x4c04('0x3f')]({'id':_0x131f20['idField'],'value':_0x32c24b[_0x131f20[_0x4c04('0x44')][_0x4c04('0x10')]['toLowerCase']()][_0x4c04('0x2f')]()});}});}return _0x3c8efe;}exports['queue']=function(_0x3221d1,_0x1cd470,_0x4cc39a,_0x51b326,_0x4d20ea,_0x2280b5){var _0x1fae36,_0x593a3e;_0x2280b5[_0x4c04('0xd')]=intUtil[_0x4c04('0x45')](_0x2280b5[_0x4c04('0xd')]);_0x2280b5[_0x4c04('0x46')]=intUtil[_0x4c04('0x45')](_0x2280b5[_0x4c04('0x46')]);if(_0x4d20ea&&_0x4d20ea[_0x4c04('0x47')]){logger['info'](_0x4c04('0x48'),'Recording\x20is\x20enabled!');_0x1cd470['recordingURL']=util[_0x4c04('0xb')](_0x4c04('0x49'),_0x2280b5[_0x4c04('0x46')],_0x1cd470[_0x4c04('0x4a')],md5(_0x1cd470[_0x4c04('0x4a')]));}else{_0x1cd470[_0x4c04('0x4b')]='';}headers[_0x4c04('0x4c')]=getAuth(_0x2280b5);return getUser(_0x2280b5,_0x51b326[_0x4c04('0x4d')])[_0x4c04('0x15')](function(_0x3f2b2c){_0x1fae36=_0x3f2b2c;logger[_0x4c04('0x9')](_0x4c04('0x4e'),_0x1fae36['id']);return getEndUser(_0x2280b5,_0x1cd470['calleridname'],_0x1cd470[_0x4c04('0x4f')]);})[_0x4c04('0x15')](function(_0x1ec0f6){_0x593a3e=_0x1ec0f6;logger['info'](_0x4c04('0x50'),_0x593a3e['id']);return getTicket(_0x2280b5,_0x1fae36,_0x593a3e,_0x4cc39a,_0x1cd470);})[_0x4c04('0x15')](function(_0x54bee4){if(_0x54bee4){logger[_0x4c04('0x9')](_0x4c04('0x51'),_0x54bee4['id']);switch(_0x2280b5[_0x4c04('0x39')]){case _0x4c04('0x52'):logger['info'](_0x4c04('0x48'),_0x4c04('0x53'));return request({'uri':util['format'](_0x4c04('0x54'),_0x2280b5['remoteUri'],_0x1fae36['id'],_0x54bee4['id']),'method':_0x4c04('0xe')});case _0x4c04('0x55'):logger[_0x4c04('0x9')](_0x4c04('0x48'),_0x4c04('0x56'));emit(util[_0x4c04('0xb')](_0x4c04('0x57'),_0x51b326[_0x4c04('0x10')]),_0x4c04('0x58'),{'uri':util[_0x4c04('0xb')](_0x4c04('0x59'),_0x2280b5['remoteUri'][_0x4c04('0x5a')](_0x4c04('0x5b'),''),_0x54bee4['id'])});break;default:logger[_0x4c04('0x5c')](_0x4c04('0x48'),_0x4c04('0x5d'));}}})[_0x4c04('0x5e')](function(_0x32c211){logger[_0x4c04('0x5c')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x4c04('0x5f')](_0x32c211,{'showHidden':!![],'depth':null}));});};exports[_0x4c04('0x60')]=function(_0x16a9cb,_0x22ea10,_0x1327f5,_0x327371,_0x11532f,_0x1116e2,_0x393efd){var _0x599b4e,_0x4aff65;_0x1116e2[_0x4c04('0xd')]=intUtil[_0x4c04('0x45')](_0x1116e2['remoteUri']);_0x1116e2[_0x4c04('0x46')]=intUtil[_0x4c04('0x45')](_0x1116e2[_0x4c04('0x46')]);if(_0x393efd&&_0x393efd['recordingFormat']&&_0x393efd[_0x4c04('0x61')]!=='none'){logger[_0x4c04('0x9')](_0x4c04('0x62'),_0x4c04('0x63'));_0x22ea10[_0x4c04('0x4b')]=util[_0x4c04('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1116e2[_0x4c04('0x46')],_0x22ea10[_0x4c04('0x4a')],md5(_0x22ea10[_0x4c04('0x4a')]));}headers[_0x4c04('0x4c')]=getAuth(_0x1116e2);return getUser(_0x1116e2,_0x327371['email'])[_0x4c04('0x15')](function(_0x3948d1){_0x599b4e=_0x3948d1;logger[_0x4c04('0x9')](_0x4c04('0x4e'),_0x599b4e['id']);return getEndUser(_0x1116e2,_0x22ea10[_0x4c04('0x64')],_0x22ea10['destcalleridnum']);})[_0x4c04('0x15')](function(_0x167996){_0x4aff65=_0x167996;logger[_0x4c04('0x9')](_0x4c04('0x50'),_0x4aff65['id']);return getTicket(_0x1116e2,_0x599b4e,_0x4aff65,_0x1327f5,_0x22ea10);})[_0x4c04('0x15')](function(_0x3e1e36){if(_0x3e1e36){logger[_0x4c04('0x9')](_0x4c04('0x51'),_0x3e1e36['id']);switch(_0x1116e2['type']){case _0x4c04('0x52'):logger[_0x4c04('0x9')](_0x4c04('0x62'),_0x4c04('0x53'));return request({'uri':util[_0x4c04('0xb')](_0x4c04('0x54'),_0x1116e2[_0x4c04('0xd')],_0x599b4e['id'],_0x3e1e36['id']),'method':_0x4c04('0xe')});case'newTab':logger[_0x4c04('0x9')]('[OUTBOUND]',_0x4c04('0x56'));emit(util[_0x4c04('0xb')](_0x4c04('0x57'),_0x327371['name']),_0x4c04('0x58'),{'uri':util['format'](_0x4c04('0x59'),_0x1116e2[_0x4c04('0xd')]['replace'](_0x4c04('0x5b'),''),_0x3e1e36['id'])});break;default:logger[_0x4c04('0x5c')]('[OUTBOUND]',_0x4c04('0x5d'));}}})[_0x4c04('0x5e')](function(_0x3ca57d){logger[_0x4c04('0x5c')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x4c04('0x5f')](_0x3ca57d,{'showHidden':!![],'depth':null}));});};exports[_0x4c04('0x65')]=function(_0x2e334d,_0x3c5f3c,_0x954254,_0x3eddc2,_0x4d44b5,_0x10d3f6){var _0x1d5886,_0x4c0f5e;_0x10d3f6[_0x4c04('0xd')]=intUtil[_0x4c04('0x45')](_0x10d3f6['remoteUri']);_0x10d3f6[_0x4c04('0x46')]=intUtil[_0x4c04('0x45')](_0x10d3f6[_0x4c04('0x46')]);if(_0x4d44b5&&_0x4d44b5[_0x4c04('0x47')]){logger[_0x4c04('0x9')]('['+_0x3c5f3c['lastevent'][_0x4c04('0x66')]()+']',_0x4c04('0x63'));_0x3c5f3c['recordingURL']=util['format'](_0x4c04('0x49'),_0x10d3f6[_0x4c04('0x46')],_0x3c5f3c[_0x4c04('0x4a')],md5(_0x3c5f3c['uniqueid']));}else{_0x3c5f3c[_0x4c04('0x4b')]='';}headers[_0x4c04('0x4c')]=getAuth(_0x10d3f6);return getUser(_0x10d3f6)[_0x4c04('0x15')](function(_0x1b4ad0){_0x1d5886=_0x1b4ad0;logger['info'](_0x4c04('0x4e'),_0x1d5886['id']);return getEndUser(_0x10d3f6,_0x3c5f3c[_0x4c04('0x67')],_0x3c5f3c['calleridnum']);})[_0x4c04('0x15')](function(_0x4b51f1){_0x4c0f5e=_0x4b51f1;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4c0f5e['id']);return getTicket(_0x10d3f6,_0x1d5886,_0x4c0f5e,_0x954254,_0x3c5f3c);})[_0x4c04('0x15')](function(_0xb5e7b1){if(_0xb5e7b1){logger[_0x4c04('0x9')](_0x4c04('0x51'),_0xb5e7b1['id']);}})[_0x4c04('0x5e')](function(_0x30b286){logger[_0x4c04('0x5c')]('['+_0x3c5f3c['lastevent'][_0x4c04('0x66')]()+']'+_0x4c04('0x68'),util[_0x4c04('0x5f')](_0x30b286,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 2bbf9fb..4839347 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa07e=['Leads','What_Id','First_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','format','lastevent','Call_Result','complete','connect','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Call\x20ID\x20is:','unmanaged','monitor_format','toUpperCase','lodash','request-promise','md5','util','moment','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','forEach','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','ActiveUsers','isArrayLikeObject','users','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','data','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','https://www.zohoapis.','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','Last_Name'];(function(_0x5b4e51,_0x344ae8){var _0x51fd3a=function(_0x55af3a){while(--_0x55af3a){_0x5b4e51['push'](_0x5b4e51['shift']());}};_0x51fd3a(++_0x344ae8);}(_0xa07e,0xda));var _0xea07=function(_0x18cbc9,_0x29273b){_0x18cbc9=_0x18cbc9-0x0;var _0x5e49fd=_0xa07e[_0x18cbc9];return _0x5e49fd;};'use strict';var _=require(_0xea07('0x0'));var rp=require(_0xea07('0x1'));var md5=require(_0xea07('0x2'));var util=require(_0xea07('0x3'));var intUtil=require('./util');var moment=require(_0xea07('0x4'));var Redis=require('ioredis');var BPromise=require(_0xea07('0x5'));var config=require(_0xea07('0x6'));var logger=require(_0xea07('0x7'))('zoho');config[_0xea07('0x8')]=_[_0xea07('0x9')](config[_0xea07('0x8')],{'host':_0xea07('0xa'),'port':0x18eb});var io=require(_0xea07('0xb'))(new Redis(config[_0xea07('0x8')]));function emit(_0x263fd9,_0x1fb1f4,_0x30a1d6){io['to'](_0x263fd9)[_0xea07('0xc')](_0x1fb1f4,_0x30a1d6);}function request(_0x5b88ab){logger[_0xea07('0xd')](_0xea07('0xe'),JSON[_0xea07('0xf')](_0x5b88ab));return rp(_0x5b88ab);}function getCustomFields(_0x117248,_0x238a40){var _0x331625={};if(_0x117248['length']>0x0){_[_0xea07('0x10')](_0x117248,function(_0x2d1b75){if(_['includes'](['string',_0xea07('0x11')],_0x2d1b75[_0xea07('0x12')])&&_0x2d1b75[_0xea07('0x13')]){_0x331625[_0x2d1b75['idField']]=_0x2d1b75['content'][_0xea07('0x14')]();}else if(_0x2d1b75[_0xea07('0x12')]===_0xea07('0x15')&&_0x2d1b75[_0xea07('0x16')]&&_0x2d1b75[_0xea07('0x13')]&&_0x238a40[_0x2d1b75[_0xea07('0x16')]]){_0x331625[_0x2d1b75[_0xea07('0x13')]]=_0x238a40[_0x2d1b75[_0xea07('0x16')]][_0xea07('0x14')]();}else if(_0x2d1b75[_0xea07('0x12')]===_0xea07('0x17')&&_0x2d1b75[_0xea07('0x18')]&&_0x2d1b75[_0xea07('0x18')]['name']&&_0x2d1b75[_0xea07('0x13')]&&_0x238a40[_0x2d1b75[_0xea07('0x18')][_0xea07('0x19')][_0xea07('0x1a')]()]){_0x331625[_0x2d1b75[_0xea07('0x13')]]=_0x238a40[_0x2d1b75[_0xea07('0x18')]['name'][_0xea07('0x1a')]()][_0xea07('0x14')]();}});}return _0x331625;}function getName(_0xf2e662){if(_0xf2e662[_0xea07('0x1b')]('\x20')>0x0){var _0x17b327=_0xf2e662[_0xea07('0x1c')](/ (.+)/);if(_0x17b327[0x1]){return _0x17b327;}}return[_0xf2e662,_0xf2e662];}var accountsTokens={};function getAccessToken(_0x181364){return new Promise(function(_0xc571ce,_0x5cc221){if(!_['isNil'](accountsTokens[_0x181364['id']])&&!_[_0xea07('0x1d')](accountsTokens[_0x181364['id']][_0xea07('0x1e')])){if(moment()[_0xea07('0x1f')](accountsTokens[_0x181364['id']][_0xea07('0x20')])){_0xc571ce(accountsTokens[_0x181364['id']]['access_token']);}}var _0x3c3e20;switch(_0x181364[_0xea07('0x21')]){case'US':_0x3c3e20=_0xea07('0x22');break;case'AU':_0x3c3e20=_0xea07('0x23');break;case'EU':_0x3c3e20=_0xea07('0x24');break;case'IN':_0x3c3e20=_0xea07('0x25');break;case'CN':_0x3c3e20=_0xea07('0x26');break;default:_0x3c3e20=_0xea07('0x24');break;}var _0x2a69bf={'method':_0xea07('0x27'),'uri':_0x3c3e20+'/oauth/v2/token','qs':{'refresh_token':_0x181364[_0xea07('0x28')],'client_id':_0x181364[_0xea07('0x29')],'client_secret':_0x181364['clientSecret'],'grant_type':_0xea07('0x2a')},'json':!![]};return rp(_0x2a69bf)[_0xea07('0x2b')](function(_0xec24fa){accountsTokens[_0x181364['id']]={'access_token':_0xec24fa['access_token'],'expires_in':moment()[_0xea07('0x2c')](_0xec24fa[_0xea07('0x20')],_0xea07('0x2d'))};_0xc571ce(_0xec24fa[_0xea07('0x1e')]);})[_0xea07('0x2e')](function(_0x222dfb){logger[_0xea07('0x2f')](_0xea07('0x30'),_0x222dfb[_0xea07('0x31')]);_0x5cc221(_0x222dfb);});});}function getUser(_0x2dbf9b,_0x246957,_0x3cc35d,_0x55c39a){logger[_0xea07('0x32')](_0xea07('0x33'));return request({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x246957),'qs':{'type':_0xea07('0x34')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2dbf9b},'json':!![]})[_0xea07('0x2b')](function(_0x59c93d){if(_0x59c93d['users']){var _0x2cd086=-0x1;if(_[_0xea07('0x35')](_0x59c93d[_0xea07('0x36')])){if(!_[_0xea07('0x1d')](_0x55c39a)){_0x2cd086=_[_0xea07('0x37')](_0x59c93d[_0xea07('0x36')],function(_0x4d9943){return _0x4d9943[_0xea07('0x38')]===_0x55c39a;});}if(_0x2cd086>=0x0){logger[_0xea07('0x32')]('Agent\x20found!');}else{logger['info'](_0xea07('0x39'));_0x2cd086=_['findIndex'](_0x59c93d[_0xea07('0x36')],function(_0x257d8e){return _0x257d8e[_0xea07('0x3a')][_0xea07('0x19')]===_0xea07('0x3b');});}return _0x59c93d[_0xea07('0x36')][_0x2cd086];}else{if(_0x59c93d[_0xea07('0x3c')][_0xea07('0x3a')][_0xea07('0x19')]===_0xea07('0x3b')){logger[_0xea07('0x32')](_0xea07('0x39'));user=_0x59c93d[_0xea07('0x3c')];return user;}else{logger[_0xea07('0x2f')](_0xea07('0x3d'),JSON[_0xea07('0xf')](_0x59c93d));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xea07('0xf')](_0x59c93d));}}}else{logger['error'](_0xea07('0x3d'),JSON[_0xea07('0xf')](_0x59c93d));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xea07('0xf')](_0x59c93d));}})['catch'](function(_0x2846f9){console[_0xea07('0x2f')](_0x2846f9);});}function getZohoUser(_0x1f9519,_0x3c8e43){return new BPromise(function(_0x246ad5,_0x41af97){request(_0x1f9519)[_0xea07('0x2b')](function(_0x54ae47){var _0x20c56a=null;if(_0x54ae47){_0x20c56a=_0x54ae47[_0xea07('0x3e')][0x0];_0x20c56a[_0xea07('0x3f')]=_0x3c8e43;}_0x246ad5(_0x20c56a);})[_0xea07('0x2e')](function(_0x44ed61){_0x41af97(_0x44ed61);});});}function createEndUser(_0x94f0bd,_0x15b12a,_0x1a175f,_0x3bbf2a,_0x4f0f3b,_0x29ca3a){var _0x1a175f=getName(_0x1a175f);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x15b12a+_0xea07('0x40')+_[_0xea07('0x41')](_0x29ca3a[_0xea07('0x42')])+'s','body':{'data':[{'Last_Name':_0x1a175f[0x1],'First_Name':_0x1a175f[0x0],'Phone':_0x3bbf2a,'Owner':{'name':!_[_0xea07('0x1d')](_0x4f0f3b['role'][_0xea07('0x19')])?_0x4f0f3b[_0xea07('0x43')][_0xea07('0x19')]:!_[_0xea07('0x1d')](_0x4f0f3b[_0xea07('0x44')])?_0x4f0f3b[_0xea07('0x44')]+'\x20'+_0x4f0f3b['last_name']:_0x4f0f3b[_0xea07('0x45')],'id':_0x4f0f3b['id']}}]},'headers':{'Authorization':_0xea07('0x46')+_0x94f0bd},'json':!![]})[_0xea07('0x2b')](function(_0x42f7af){if(_0x42f7af&&_0x42f7af[_0xea07('0x3e')][0x0][_0xea07('0x47')]===_0xea07('0x48')){var _0x4eb6a7=_0x42f7af[_0xea07('0x3e')][0x0][_0xea07('0x49')];_0x4eb6a7[_0xea07('0x3f')]=_[_0xea07('0x41')](_0x29ca3a[_0xea07('0x42')])+'s';return _0x4eb6a7;}logger[_0xea07('0x2f')](_0xea07('0x3d'),JSON[_0xea07('0xf')](data));throw new Error(_0xea07('0x4a')+JSON[_0xea07('0xf')](data));})[_0xea07('0x2e')](function(_0x1efa93){console[_0xea07('0x4b')](_0xea07('0x4c'),_0x1efa93);});}function getEndUser(_0x22c966,_0x5f0667,_0x3eee88,_0x7a8adf,_0x2d63c8,_0x4f1874,_0x27311a){var _0x2cf297={'method':_0xea07('0x4d'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x22c966},'json':!![]};switch(_0x27311a[_0xea07('0x4e')]){case _0xea07('0x4f'):_0x2cf297['uri']=_0xea07('0x50')+_0x5f0667+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2d63c8+'))';return getZohoUser(_0x2cf297,_0xea07('0x51'))[_0xea07('0x2b')](function(_0x36e98d){if(_0x36e98d)return _0x36e98d;_0x2cf297[_0xea07('0x52')]='https://www.zohoapis.'+_0x5f0667+_0xea07('0x53')+_0x2d63c8+'))';return getZohoUser(_0x2cf297,'Leads')[_0xea07('0x2b')](function(_0x3a8052){if(_0x3a8052)return _0x3a8052;if(_0x27311a[_0xea07('0x42')]!=_0xea07('0x54')){return createEndUser(_0x22c966,_0x5f0667,_0x7a8adf,_0x2d63c8,_0x4f1874,_0x27311a);}else{return{};}});});break;case _0xea07('0x55'):_0x2cf297['uri']=_0xea07('0x50')+_0x5f0667+_0xea07('0x56')+_0x2d63c8+'))';return getZohoUser(_0x2cf297,_0xea07('0x51'))[_0xea07('0x2b')](function(_0x3c2e36){if(_0x3c2e36)return _0x3c2e36;if(_0x27311a[_0xea07('0x42')]!=_0xea07('0x54')){return createEndUser(_0x22c966,_0x5f0667,_0x7a8adf,_0x2d63c8,_0x4f1874,_0x27311a);}else{return{};}});break;case _0xea07('0x57'):_0x2cf297[_0xea07('0x52')]=_0xea07('0x50')+_0x5f0667+_0xea07('0x53')+_0x2d63c8+'))';return getZohoUser(_0x2cf297,'Leads')[_0xea07('0x2b')](function(_0x1fd0b2){if(_0x1fd0b2)return _0x1fd0b2;if(_0x27311a[_0xea07('0x42')]!=_0xea07('0x54')){return createEndUser(_0x22c966,_0x5f0667,_0x7a8adf,_0x2d63c8,_0x4f1874,_0x27311a);}else{return{};}});break;}}function getCall(_0x26ba2d,_0x171a7c,_0x53d518,_0x33853c,_0x19d9c4,_0x1358ac,_0x32f3dd,_0x56539a){logger[_0xea07('0x32')]('Creating\x20new\x20call...');var _0x39dd73={};_0x39dd73[_0xea07('0x58')]={'name':!_['isNil'](_0x33853c['role'][_0xea07('0x19')])&&!_[_0xea07('0x1d')](_0x33853c[_0xea07('0x3a')]['name'])&&_0x33853c[_0xea07('0x3a')][_0xea07('0x19')]===_0xea07('0x59')?_0x33853c[_0xea07('0x43')]['name']:!_[_0xea07('0x1d')](_0x33853c[_0xea07('0x44')])?_0x33853c[_0xea07('0x44')]+'\x20'+_0x33853c[_0xea07('0x45')]:_0x33853c[_0xea07('0x45')],'id':_0x33853c['id']};_0x39dd73[_0xea07('0x5a')]=intUtil[_0xea07('0x5b')](_0x1358ac[_0xea07('0x5c')],_0x32f3dd,'\x20');_0x39dd73[_0xea07('0x5d')]=intUtil[_0xea07('0x5b')](_0x1358ac[_0xea07('0x5e')],_0x32f3dd,'\x0a');if(_0x19d9c4[_0xea07('0x3f')]===_0xea07('0x51')){_0x39dd73[_0xea07('0x5f')]={'name':!_[_0xea07('0x1d')](_0x19d9c4[_0xea07('0x60')])?_0x19d9c4['Full_Name']:!_[_0xea07('0x1d')](_0x19d9c4['First_Name'])?_0x19d9c4['First_Name']+'\x20'+_0x19d9c4['Last_Name']:_0x19d9c4[_0xea07('0x61')],'id':_0x19d9c4['id']};}if(_0x19d9c4['enduserType']===_0xea07('0x62')){_0x39dd73[_0xea07('0x63')]={'name':!_[_0xea07('0x1d')](_0x19d9c4[_0xea07('0x60')])?_0x19d9c4['Full_Name']:!_[_0xea07('0x1d')](_0x19d9c4[_0xea07('0x64')])?_0x19d9c4['First_Name']+'\x20'+_0x19d9c4['Last_Name']:_0x19d9c4[_0xea07('0x61')],'id':_0x19d9c4['id']};_0x39dd73[_0xea07('0x65')]=_[_0xea07('0x41')](_0x19d9c4[_0xea07('0x3f')]);}if(_0x32f3dd[_0xea07('0x66')]){_0x39dd73[_0xea07('0x67')]=moment[_0xea07('0x68')](parseInt(_0x32f3dd[_0xea07('0x66')])*0x3e8)['format'](_0xea07('0x69'));}else if(_0x32f3dd[_0xea07('0x6a')]&&_0x32f3dd['endtime']){_0x39dd73[_0xea07('0x67')]=moment[_0xea07('0x68')](moment(_0x32f3dd[_0xea07('0x6b')],'YYYY-MM-DDTHH:mm:ss')[_0xea07('0x6c')](moment(_0x32f3dd[_0xea07('0x6d')],_0xea07('0x6e'))))[_0xea07('0x6f')]('mm:ss');}switch(_0x32f3dd[_0xea07('0x70')]){case'called':_0x39dd73[_0xea07('0x71')]='Called';break;case _0xea07('0x72'):case _0xea07('0x73'):_0x39dd73[_0xea07('0x71')]=_0xea07('0x74');break;case _0xea07('0x75'):_0x39dd73[_0xea07('0x71')]=_0xea07('0x76');break;case'abandoned':_0x39dd73[_0xea07('0x71')]=_0xea07('0x77');break;case _0xea07('0x78'):_0x39dd73['Call_Result']=_0xea07('0x79');default:}_0x39dd73[_0xea07('0x7a')]=(_0x56539a==='outbound'?moment(_0x32f3dd[_0xea07('0x6d')])[_0xea07('0x6f')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x32f3dd[_0xea07('0x7b')])[_0xea07('0x6f')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xea07('0x6f')]('YYYY-MM-DDTHH:mm:ss');_0x39dd73['Call_Type']=_0x56539a||_0xea07('0x7c');_0x39dd73=_[_0xea07('0x7d')](_0x39dd73,getCustomFields(_0x1358ac[_0xea07('0x7e')],_0x32f3dd));return request({'method':_0xea07('0x27'),'uri':_0xea07('0x50')+_0x171a7c+_0xea07('0x7f'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x26ba2d},'body':{'data':[_0x39dd73]},'json':!![]})[_0xea07('0x2b')](function(_0x57d457){if(_0x57d457&&_0x57d457[_0xea07('0x3e')][0x0][_0xea07('0x47')]==='SUCCESS'){logger['info'](_0xea07('0x80'));return{'id':_0x57d457[_0xea07('0x3e')][0x0][_0xea07('0x49')]['id']};}})['catch'](function(_0x267ded){logger[_0xea07('0x32')]('err',_0x267ded[_0xea07('0x31')]);console[_0xea07('0x4b')](_0xea07('0x81'),_0x267ded);});}exports[_0xea07('0x82')]=function(_0x3b0c85,_0x15da55,_0x2b41ce,_0x573263,_0x520811,_0x552b71){var _0xc52163,_0x2c2b0f,_0x523e94;_0x552b71['host']=intUtil['stripTrailingSlash'](_0x552b71[_0xea07('0x83')]);_0x552b71[_0xea07('0x84')]=intUtil[_0xea07('0x85')](_0x552b71[_0xea07('0x84')]);if(_0x520811&&_0x520811['monitor_format']){logger[_0xea07('0x32')](_0xea07('0x86'),_0xea07('0x87'));_0x15da55['recordingURL']=_0x552b71['serverUrl']+_0xea07('0x88')+_0x15da55[_0xea07('0x89')]+'/downloads?type=uniqueid&token='+md5(_0x15da55[_0xea07('0x89')]);}else{_0x15da55[_0xea07('0x8a')]='';}var _0x2f525c=_0x552b71['host']===_0xea07('0x8b')?'eu':_0xea07('0x8c');return getAccessToken(_0x552b71)['then'](function(_0x4e0b97){_0x523e94=_0x4e0b97;return getUser(_0x523e94,_0x2f525c,_0x552b71,_0x573263[_0xea07('0x38')]);})[_0xea07('0x2b')](function(_0x5e08b8){_0xc52163=_0x5e08b8;logger[_0xea07('0x32')](_0xea07('0x8d'),_0xc52163['id']);return getEndUser(_0x523e94,_0x2f525c,_0x552b71,_0x15da55[_0xea07('0x8e')],_0x15da55[_0xea07('0x8f')],_0xc52163,_0x2b41ce);})[_0xea07('0x2b')](function(_0xb14896){_0x2c2b0f=_0xb14896;return getCall(_0x523e94,_0x2f525c,_0x552b71,_0xc52163,_0x2c2b0f,_0x2b41ce,_0x15da55,_0xea07('0x7c'));})[_0xea07('0x2b')](function(_0x5d19b4){if(_0x5d19b4){logger[_0xea07('0x32')]('The\x20Call\x20ID\x20is:',_0x5d19b4['id']);logger[_0xea07('0x32')](_0xea07('0x86'),_0xea07('0x90'));emit(util['format'](_0xea07('0x91'),_0x573263[_0xea07('0x19')]),_0xea07('0x92'),{'uri':_0xea07('0x93')+_0x552b71[_0xea07('0x83')]+_0xea07('0x94')+_0x5d19b4['id']});}})[_0xea07('0x2e')](function(_0x1a158a){logger[_0xea07('0x2f')](_0xea07('0x86'),JSON[_0xea07('0xf')](_0x1a158a));});};exports[_0xea07('0x95')]=function(_0x3dbd96,_0x4b1547,_0x547fe7,_0x3c69ac,_0x1f44f9,_0x7e1e6d,_0x4538d9){var _0x49711a,_0x206772,_0x3e0986;_0x7e1e6d[_0xea07('0x83')]=intUtil[_0xea07('0x85')](_0x7e1e6d[_0xea07('0x83')]);_0x7e1e6d[_0xea07('0x84')]=intUtil['stripTrailingSlash'](_0x7e1e6d[_0xea07('0x84')]);if(_0x4538d9&&_0x4538d9[_0xea07('0x96')]&&_0x4538d9[_0xea07('0x96')]!=='none'){logger[_0xea07('0x32')](_0xea07('0x97'),_0xea07('0x87'));_0x4b1547[_0xea07('0x8a')]=_0x7e1e6d[_0xea07('0x84')]+'/api/voice/recordings/'+_0x4b1547[_0xea07('0x89')]+'/downloads?type=uniqueid&token='+md5(_0x4b1547[_0xea07('0x89')]);}var _0x467d44=_0x7e1e6d[_0xea07('0x83')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x7e1e6d)[_0xea07('0x2b')](function(_0x4b9d41){_0x3e0986=_0x4b9d41;return getUser(_0x3e0986,_0x467d44,_0x7e1e6d,_0x3c69ac['email']);})[_0xea07('0x2b')](function(_0x376b4a){_0x49711a=_0x376b4a;logger[_0xea07('0x32')]('The\x20User\x20ID\x20is:',_0x49711a['id']);return getEndUser(_0x3e0986,_0x467d44,_0x7e1e6d,_0x4b1547[_0xea07('0x98')],_0x4b1547[_0xea07('0x99')],_0x49711a,_0x547fe7);})[_0xea07('0x2b')](function(_0x269f1b){_0x206772=_0x269f1b;return getCall(_0x3e0986,_0x467d44,_0x7e1e6d,_0x49711a,_0x206772,_0x547fe7,_0x4b1547,'Outbound');})[_0xea07('0x2b')](function(_0x4d4ccf){if(_0x4d4ccf){logger[_0xea07('0x32')](_0xea07('0x9a'),_0x4d4ccf['id']);logger[_0xea07('0x32')]('[OUTBOUND]',_0xea07('0x90'));emit(util[_0xea07('0x6f')](_0xea07('0x91'),_0x3c69ac[_0xea07('0x19')]),_0xea07('0x92'),{'uri':_0xea07('0x93')+_0x7e1e6d[_0xea07('0x83')]+_0xea07('0x94')+_0x4d4ccf['id']});}})[_0xea07('0x2e')](function(_0xb72fc8){logger[_0xea07('0x2f')](_0xea07('0x97'),JSON[_0xea07('0xf')](_0xb72fc8));});};exports[_0xea07('0x9b')]=function(_0xb17957,_0x532208,_0x3ad0d0,_0x11b53d,_0x3df7aa,_0x2f2a09){var _0x27becb,_0x44cb72,_0x679a0e;_0x2f2a09['host']=intUtil[_0xea07('0x85')](_0x2f2a09[_0xea07('0x83')]);_0x2f2a09['serverUrl']=intUtil[_0xea07('0x85')](_0x2f2a09['serverUrl']);if(_0x3df7aa&&_0x3df7aa[_0xea07('0x9c')]){logger[_0xea07('0x32')]('['+_0x532208[_0xea07('0x70')][_0xea07('0x9d')]()+']',_0xea07('0x87'));_0x532208[_0xea07('0x8a')]=_0x2f2a09['serverUrl']+'/api/voice/recordings/'+_0x532208[_0xea07('0x89')]+'/downloads?type=uniqueid&token='+md5(_0x532208[_0xea07('0x89')]);}else{_0x532208['recordingURL']='';}var _0x1b0ecd=_0x2f2a09['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0x2f2a09)['then'](function(_0x345943){_0x679a0e=_0x345943;return getUser(_0x679a0e,_0x1b0ecd,_0x2f2a09);})[_0xea07('0x2b')](function(_0x566185){_0x27becb=_0x566185;logger[_0xea07('0x32')](_0xea07('0x8d'),_0x27becb['id']);return getEndUser(_0x679a0e,_0x1b0ecd,_0x2f2a09,_0x532208[_0xea07('0x8e')],_0x532208[_0xea07('0x8f')],_0x27becb,_0x3ad0d0);})[_0xea07('0x2b')](function(_0x462652){_0x44cb72=_0x462652;return getCall(_0x679a0e,_0x1b0ecd,_0x2f2a09,_0x27becb,_0x44cb72,_0x3ad0d0,_0x532208,'Inbound');})[_0xea07('0x2b')](function(_0x3c9761){if(_0x3c9761){logger[_0xea07('0x32')](_0xea07('0x9a'),_0x3c9761['id']);}})[_0xea07('0x2e')](function(_0x92439){logger[_0xea07('0x2f')]('['+_0x532208['lastevent']['toUpperCase']()+']',JSON[_0xea07('0xf')](_0x92439));});};
\ No newline at end of file
+var _0x44c8=['Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Call\x20ID\x20is:','unmanaged','toUpperCase','request-promise','md5','util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','localhost','socket.io-emitter','emit','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','then','expires_in','seconds','catch','error','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','contact','nothing','lead','Leads','Owner','Subject','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','Call_Duration','utc','talktime','mm:ss','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','err','stack','log','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum'];(function(_0x2c2105,_0x26f958){var _0x441787=function(_0x1b76dd){while(--_0x1b76dd){_0x2c2105['push'](_0x2c2105['shift']());}};_0x441787(++_0x26f958);}(_0x44c8,0xaa));var _0x844c=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x44c8[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require('lodash');var rp=require(_0x844c('0x0'));var md5=require(_0x844c('0x1'));var util=require(_0x844c('0x2'));var intUtil=require('./util');var moment=require(_0x844c('0x3'));var Redis=require(_0x844c('0x4'));var BPromise=require('bluebird');var config=require(_0x844c('0x5'));var logger=require(_0x844c('0x6'))(_0x844c('0x7'));config['redis']=_[_0x844c('0x8')](config[_0x844c('0x9')],{'host':_0x844c('0xa'),'port':0x18eb});var io=require(_0x844c('0xb'))(new Redis(config[_0x844c('0x9')]));function emit(_0x2ebf72,_0xf657aa,_0x54f2fd){io['to'](_0x2ebf72)[_0x844c('0xc')](_0xf657aa,_0x54f2fd);}function request(_0x45a6d0){logger['debug'](_0x844c('0xd'),JSON[_0x844c('0xe')](_0x45a6d0));return rp(_0x45a6d0);}function getCustomFields(_0x5b4584,_0x508f1b){var _0x208e32={};if(_0x5b4584[_0x844c('0xf')]>0x0){_[_0x844c('0x10')](_0x5b4584,function(_0x4ca4ac){if(_[_0x844c('0x11')]([_0x844c('0x12'),_0x844c('0x13')],_0x4ca4ac[_0x844c('0x14')])&&_0x4ca4ac[_0x844c('0x15')]){_0x208e32[_0x4ca4ac[_0x844c('0x15')]]=_0x4ca4ac['content'][_0x844c('0x16')]();}else if(_0x4ca4ac['type']===_0x844c('0x17')&&_0x4ca4ac[_0x844c('0x18')]&&_0x4ca4ac[_0x844c('0x15')]&&_0x508f1b[_0x4ca4ac[_0x844c('0x18')]]){_0x208e32[_0x4ca4ac[_0x844c('0x15')]]=_0x508f1b[_0x4ca4ac[_0x844c('0x18')]][_0x844c('0x16')]();}else if(_0x4ca4ac['type']===_0x844c('0x19')&&_0x4ca4ac[_0x844c('0x1a')]&&_0x4ca4ac[_0x844c('0x1a')][_0x844c('0x1b')]&&_0x4ca4ac['idField']&&_0x508f1b[_0x4ca4ac[_0x844c('0x1a')][_0x844c('0x1b')][_0x844c('0x1c')]()]){_0x208e32[_0x4ca4ac[_0x844c('0x15')]]=_0x508f1b[_0x4ca4ac['Variable'][_0x844c('0x1b')][_0x844c('0x1c')]()][_0x844c('0x16')]();}});}return _0x208e32;}function getName(_0x270034){if(_0x270034['indexOf']('\x20')>0x0){var _0x11d325=_0x270034[_0x844c('0x1d')](/ (.+)/);if(_0x11d325[0x1]){return _0x11d325;}}return[_0x270034,_0x270034];}var accountsTokens={};function getAccessToken(_0x20de1e){return new Promise(function(_0x499117,_0x3cc87d){if(!_[_0x844c('0x1e')](accountsTokens[_0x20de1e['id']])&&!_[_0x844c('0x1e')](accountsTokens[_0x20de1e['id']][_0x844c('0x1f')])){if(moment()['isBefore'](accountsTokens[_0x20de1e['id']]['expires_in'])){_0x499117(accountsTokens[_0x20de1e['id']]['access_token']);}}var _0xc96d09;switch(_0x20de1e['zone']){case'US':_0xc96d09=_0x844c('0x20');break;case'AU':_0xc96d09=_0x844c('0x21');break;case'EU':_0xc96d09='https://accounts.zoho.eu';break;case'IN':_0xc96d09=_0x844c('0x22');break;case'CN':_0xc96d09=_0x844c('0x23');break;default:_0xc96d09=_0x844c('0x24');break;}var _0x4e1319={'method':_0x844c('0x25'),'uri':_0xc96d09+_0x844c('0x26'),'qs':{'refresh_token':_0x20de1e[_0x844c('0x27')],'client_id':_0x20de1e[_0x844c('0x28')],'client_secret':_0x20de1e['clientSecret'],'grant_type':_0x844c('0x29')},'json':!![]};return rp(_0x4e1319)[_0x844c('0x2a')](function(_0x22d317){accountsTokens[_0x20de1e['id']]={'access_token':_0x22d317['access_token'],'expires_in':moment()['add'](_0x22d317[_0x844c('0x2b')],_0x844c('0x2c'))};_0x499117(_0x22d317[_0x844c('0x1f')]);})[_0x844c('0x2d')](function(_0x226ef1){logger[_0x844c('0x2e')]('Failing\x20creating\x20the\x20access_token',_0x226ef1['stack']);_0x3cc87d(_0x226ef1);});});}function getUser(_0x3d058f,_0x154901,_0x5d6b1a,_0x10a039){logger[_0x844c('0x2f')](_0x844c('0x30'));return request({'method':_0x844c('0x31'),'uri':util[_0x844c('0x32')](_0x844c('0x33'),_0x154901),'qs':{'type':_0x844c('0x34')},'headers':{'Authorization':_0x844c('0x35')+_0x3d058f},'json':!![]})[_0x844c('0x2a')](function(_0x154412){if(_0x154412[_0x844c('0x36')]){var _0x1176d5=-0x1;if(_[_0x844c('0x37')](_0x154412[_0x844c('0x36')])){if(!_[_0x844c('0x1e')](_0x10a039)){_0x1176d5=_[_0x844c('0x38')](_0x154412['users'],function(_0x5e6317){return _0x5e6317[_0x844c('0x39')]===_0x10a039;});}if(_0x1176d5>=0x0){logger[_0x844c('0x2f')](_0x844c('0x3a'));}else{logger[_0x844c('0x2f')](_0x844c('0x3b'));_0x1176d5=_[_0x844c('0x38')](_0x154412[_0x844c('0x36')],function(_0x289de3){return _0x289de3[_0x844c('0x3c')][_0x844c('0x1b')]===_0x844c('0x3d');});}return _0x154412[_0x844c('0x36')][_0x1176d5];}else{if(_0x154412[_0x844c('0x3e')]['profile']['name']==='Administrator'){logger[_0x844c('0x2f')](_0x844c('0x3b'));user=_0x154412[_0x844c('0x3e')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x154412));throw new Error(_0x844c('0x3f')+JSON[_0x844c('0xe')](_0x154412));}}}else{logger[_0x844c('0x2e')](_0x844c('0x40'),JSON[_0x844c('0xe')](_0x154412));throw new Error(_0x844c('0x3f')+JSON[_0x844c('0xe')](_0x154412));}})[_0x844c('0x2d')](function(_0x426f04){console[_0x844c('0x2e')](_0x426f04);});}function getZohoUser(_0x2f1b97,_0x472bf0){return new BPromise(function(_0x5c1409,_0x52a0ab){request(_0x2f1b97)[_0x844c('0x2a')](function(_0x5e1c75){var _0x5bb3dc=null;if(_0x5e1c75){_0x5bb3dc=_0x5e1c75[_0x844c('0x41')][0x0];_0x5bb3dc[_0x844c('0x42')]=_0x472bf0;}_0x5c1409(_0x5bb3dc);})[_0x844c('0x2d')](function(_0x5e5d81){_0x52a0ab(_0x5e5d81);});});}function createEndUser(_0x342511,_0x4198f2,_0x1808df,_0x1c4505,_0xfc1a51,_0x2fa8a1){var _0x1808df=getName(_0x1808df);return request({'method':_0x844c('0x25'),'uri':_0x844c('0x43')+_0x4198f2+_0x844c('0x44')+_[_0x844c('0x45')](_0x2fa8a1[_0x844c('0x46')])+'s','body':{'data':[{'Last_Name':_0x1808df[0x1],'First_Name':_0x1808df[0x0],'Phone':_0x1c4505,'Owner':{'name':!_[_0x844c('0x1e')](_0xfc1a51[_0x844c('0x47')][_0x844c('0x1b')])?_0xfc1a51[_0x844c('0x47')][_0x844c('0x1b')]:!_['isNil'](_0xfc1a51[_0x844c('0x48')])?_0xfc1a51[_0x844c('0x48')]+'\x20'+_0xfc1a51[_0x844c('0x49')]:_0xfc1a51['last_name'],'id':_0xfc1a51['id']}}]},'headers':{'Authorization':_0x844c('0x35')+_0x342511},'json':!![]})['then'](function(_0x1a9c99){if(_0x1a9c99&&_0x1a9c99[_0x844c('0x41')][0x0][_0x844c('0x4a')]===_0x844c('0x4b')){var _0x30d904=_0x1a9c99[_0x844c('0x41')][0x0][_0x844c('0x4c')];_0x30d904[_0x844c('0x42')]=_[_0x844c('0x45')](_0x2fa8a1[_0x844c('0x46')])+'s';return _0x30d904;}logger[_0x844c('0x2e')]('The\x20failing\x20result\x20is',JSON[_0x844c('0xe')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0x844c('0x2d')](function(_0x1ebf8c){console['log'](_0x844c('0x4d'),_0x1ebf8c);});}function getEndUser(_0x2e8ac4,_0x4a1188,_0xf10476,_0x5bac34,_0x2f712d,_0x10af2a,_0x30fbc0){var _0x48d708={'method':_0x844c('0x31'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2e8ac4},'json':!![]};switch(_0x30fbc0[_0x844c('0x4e')]){case _0x844c('0x4f'):_0x48d708[_0x844c('0x50')]='https://www.zohoapis.'+_0x4a1188+_0x844c('0x51')+_0x2f712d+'))';return getZohoUser(_0x48d708,_0x844c('0x52'))['then'](function(_0x4b6e6b){if(_0x4b6e6b)return _0x4b6e6b;_0x48d708[_0x844c('0x50')]=_0x844c('0x43')+_0x4a1188+_0x844c('0x53')+_0x2f712d+'))';return getZohoUser(_0x48d708,'Leads')[_0x844c('0x2a')](function(_0x383070){if(_0x383070)return _0x383070;if(_0x30fbc0[_0x844c('0x46')]!='nothing'){return createEndUser(_0x2e8ac4,_0x4a1188,_0x5bac34,_0x2f712d,_0x10af2a,_0x30fbc0);}else{return{};}});});break;case _0x844c('0x54'):_0x48d708[_0x844c('0x50')]='https://www.zohoapis.'+_0x4a1188+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2f712d+'))';return getZohoUser(_0x48d708,_0x844c('0x52'))[_0x844c('0x2a')](function(_0x481d12){if(_0x481d12)return _0x481d12;if(_0x30fbc0[_0x844c('0x46')]!=_0x844c('0x55')){return createEndUser(_0x2e8ac4,_0x4a1188,_0x5bac34,_0x2f712d,_0x10af2a,_0x30fbc0);}else{return{};}});break;case _0x844c('0x56'):_0x48d708[_0x844c('0x50')]='https://www.zohoapis.'+_0x4a1188+_0x844c('0x53')+_0x2f712d+'))';return getZohoUser(_0x48d708,_0x844c('0x57'))[_0x844c('0x2a')](function(_0x101f6e){if(_0x101f6e)return _0x101f6e;if(_0x30fbc0[_0x844c('0x46')]!=_0x844c('0x55')){return createEndUser(_0x2e8ac4,_0x4a1188,_0x5bac34,_0x2f712d,_0x10af2a,_0x30fbc0);}else{return{};}});break;}}function getCall(_0x1445b8,_0x5a96cc,_0x6113df,_0x7ccf9b,_0x491e5f,_0xf8c9e0,_0x187b2f,_0x4ebcf4){logger['info']('Creating\x20new\x20call...');var _0x3c4ff5={};_0x3c4ff5[_0x844c('0x58')]={'name':!_['isNil'](_0x7ccf9b[_0x844c('0x47')][_0x844c('0x1b')])&&!_[_0x844c('0x1e')](_0x7ccf9b[_0x844c('0x3c')][_0x844c('0x1b')])&&_0x7ccf9b['profile'][_0x844c('0x1b')]==='administrator'?_0x7ccf9b[_0x844c('0x47')]['name']:!_['isNil'](_0x7ccf9b[_0x844c('0x48')])?_0x7ccf9b[_0x844c('0x48')]+'\x20'+_0x7ccf9b[_0x844c('0x49')]:_0x7ccf9b[_0x844c('0x49')],'id':_0x7ccf9b['id']};_0x3c4ff5[_0x844c('0x59')]=intUtil[_0x844c('0x5a')](_0xf8c9e0[_0x844c('0x5b')],_0x187b2f,'\x20');_0x3c4ff5[_0x844c('0x5c')]=intUtil[_0x844c('0x5a')](_0xf8c9e0['Descriptions'],_0x187b2f,'\x0a');if(_0x491e5f[_0x844c('0x42')]===_0x844c('0x52')){_0x3c4ff5[_0x844c('0x5d')]={'name':!_[_0x844c('0x1e')](_0x491e5f[_0x844c('0x5e')])?_0x491e5f[_0x844c('0x5e')]:!_[_0x844c('0x1e')](_0x491e5f[_0x844c('0x5f')])?_0x491e5f[_0x844c('0x5f')]+'\x20'+_0x491e5f['Last_Name']:_0x491e5f[_0x844c('0x60')],'id':_0x491e5f['id']};}if(_0x491e5f[_0x844c('0x42')]===_0x844c('0x57')){_0x3c4ff5[_0x844c('0x61')]={'name':!_['isNil'](_0x491e5f[_0x844c('0x5e')])?_0x491e5f[_0x844c('0x5e')]:!_['isNil'](_0x491e5f[_0x844c('0x5f')])?_0x491e5f[_0x844c('0x5f')]+'\x20'+_0x491e5f[_0x844c('0x60')]:_0x491e5f[_0x844c('0x60')],'id':_0x491e5f['id']};_0x3c4ff5['$se_module']=_['startCase'](_0x491e5f[_0x844c('0x42')]);}if(_0x187b2f['talktime']){_0x3c4ff5[_0x844c('0x62')]=moment[_0x844c('0x63')](parseInt(_0x187b2f[_0x844c('0x64')])*0x3e8)[_0x844c('0x32')](_0x844c('0x65'));}else if(_0x187b2f[_0x844c('0x66')]&&_0x187b2f['endtime']){_0x3c4ff5[_0x844c('0x62')]=moment['utc'](moment(_0x187b2f[_0x844c('0x67')],'YYYY-MM-DDTHH:mm:ss')[_0x844c('0x68')](moment(_0x187b2f[_0x844c('0x69')],_0x844c('0x6a'))))[_0x844c('0x32')](_0x844c('0x65'));}switch(_0x187b2f[_0x844c('0x6b')]){case _0x844c('0x6c'):_0x3c4ff5[_0x844c('0x6d')]='Called';break;case _0x844c('0x6e'):case _0x844c('0x6f'):_0x3c4ff5[_0x844c('0x6d')]=_0x844c('0x70');break;case _0x844c('0x71'):_0x3c4ff5['Call_Result']=_0x844c('0x72');break;case _0x844c('0x73'):_0x3c4ff5[_0x844c('0x6d')]=_0x844c('0x74');break;case'timeout':_0x3c4ff5[_0x844c('0x6d')]=_0x844c('0x75');default:}_0x3c4ff5[_0x844c('0x76')]=(_0x4ebcf4==='outbound'?moment(_0x187b2f['starttime'])[_0x844c('0x32')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x187b2f[_0x844c('0x77')])['format'](_0x844c('0x6a')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x3c4ff5[_0x844c('0x78')]=_0x4ebcf4||_0x844c('0x79');_0x3c4ff5=_[_0x844c('0x7a')](_0x3c4ff5,getCustomFields(_0xf8c9e0[_0x844c('0x7b')],_0x187b2f));return request({'method':_0x844c('0x25'),'uri':_0x844c('0x43')+_0x5a96cc+_0x844c('0x7c'),'headers':{'Authorization':_0x844c('0x35')+_0x1445b8},'body':{'data':[_0x3c4ff5]},'json':!![]})[_0x844c('0x2a')](function(_0x1f18c2){if(_0x1f18c2&&_0x1f18c2[_0x844c('0x41')][0x0][_0x844c('0x4a')]==='SUCCESS'){logger['info']('Call\x20created!');return{'id':_0x1f18c2[_0x844c('0x41')][0x0][_0x844c('0x4c')]['id']};}})[_0x844c('0x2d')](function(_0x538e84){logger['info'](_0x844c('0x7d'),_0x538e84[_0x844c('0x7e')]);console[_0x844c('0x7f')](_0x844c('0x7d'),_0x538e84);});}exports['queue']=function(_0x300d0e,_0xa5ec9f,_0x49cafd,_0x393ad7,_0xde86f9,_0x5759f7){var _0x5db32e,_0x585a8d,_0x45db41;_0x5759f7[_0x844c('0x80')]=intUtil[_0x844c('0x81')](_0x5759f7[_0x844c('0x80')]);_0x5759f7[_0x844c('0x82')]=intUtil[_0x844c('0x81')](_0x5759f7['serverUrl']);if(_0xde86f9&&_0xde86f9[_0x844c('0x83')]){logger[_0x844c('0x2f')](_0x844c('0x84'),'Recording\x20is\x20enabled!');_0xa5ec9f[_0x844c('0x85')]=_0x5759f7[_0x844c('0x82')]+_0x844c('0x86')+_0xa5ec9f[_0x844c('0x87')]+_0x844c('0x88')+md5(_0xa5ec9f['uniqueid']);}else{_0xa5ec9f['recordingURL']='';}var _0x433fbd=_0x5759f7[_0x844c('0x80')]===_0x844c('0x89')?'eu':_0x844c('0x8a');return getAccessToken(_0x5759f7)[_0x844c('0x2a')](function(_0x166fc7){_0x45db41=_0x166fc7;return getUser(_0x45db41,_0x433fbd,_0x5759f7,_0x393ad7[_0x844c('0x39')]);})[_0x844c('0x2a')](function(_0x4b67d8){_0x5db32e=_0x4b67d8;logger[_0x844c('0x2f')](_0x844c('0x8b'),_0x5db32e['id']);return getEndUser(_0x45db41,_0x433fbd,_0x5759f7,_0xa5ec9f[_0x844c('0x8c')],_0xa5ec9f[_0x844c('0x8d')],_0x5db32e,_0x49cafd);})[_0x844c('0x2a')](function(_0x4ca0bb){_0x585a8d=_0x4ca0bb;return getCall(_0x45db41,_0x433fbd,_0x5759f7,_0x5db32e,_0x585a8d,_0x49cafd,_0xa5ec9f,_0x844c('0x79'));})[_0x844c('0x2a')](function(_0x49d4c1){if(_0x49d4c1){logger[_0x844c('0x2f')]('The\x20Call\x20ID\x20is:',_0x49d4c1['id']);logger[_0x844c('0x2f')](_0x844c('0x84'),_0x844c('0x8e'));emit(util[_0x844c('0x32')](_0x844c('0x8f'),_0x393ad7[_0x844c('0x1b')]),_0x844c('0x90'),{'uri':_0x844c('0x91')+_0x5759f7[_0x844c('0x80')]+_0x844c('0x92')+_0x49d4c1['id']});}})['catch'](function(_0x434a0a){logger[_0x844c('0x2e')]('[QUEUE]',JSON[_0x844c('0xe')](_0x434a0a));});};exports[_0x844c('0x93')]=function(_0x2fafed,_0x1c2e0b,_0x5a0035,_0x20f426,_0x4d2980,_0x4b7c90,_0x5bf533){var _0x198dd6,_0xbaf4f,_0x16da3f;_0x4b7c90[_0x844c('0x80')]=intUtil[_0x844c('0x81')](_0x4b7c90[_0x844c('0x80')]);_0x4b7c90[_0x844c('0x82')]=intUtil[_0x844c('0x81')](_0x4b7c90[_0x844c('0x82')]);if(_0x5bf533&&_0x5bf533[_0x844c('0x94')]&&_0x5bf533[_0x844c('0x94')]!==_0x844c('0x95')){logger['info'](_0x844c('0x96'),_0x844c('0x97'));_0x1c2e0b[_0x844c('0x85')]=_0x4b7c90['serverUrl']+_0x844c('0x86')+_0x1c2e0b[_0x844c('0x87')]+'/downloads?type=uniqueid&token='+md5(_0x1c2e0b[_0x844c('0x87')]);}var _0x48deb7=_0x4b7c90[_0x844c('0x80')]==='zoho.eu'?'eu':_0x844c('0x8a');return getAccessToken(_0x4b7c90)[_0x844c('0x2a')](function(_0x4dd44a){_0x16da3f=_0x4dd44a;return getUser(_0x16da3f,_0x48deb7,_0x4b7c90,_0x20f426[_0x844c('0x39')]);})[_0x844c('0x2a')](function(_0x378430){_0x198dd6=_0x378430;logger[_0x844c('0x2f')](_0x844c('0x8b'),_0x198dd6['id']);return getEndUser(_0x16da3f,_0x48deb7,_0x4b7c90,_0x1c2e0b['destcalleridname'],_0x1c2e0b[_0x844c('0x98')],_0x198dd6,_0x5a0035);})[_0x844c('0x2a')](function(_0x5c37d0){_0xbaf4f=_0x5c37d0;return getCall(_0x16da3f,_0x48deb7,_0x4b7c90,_0x198dd6,_0xbaf4f,_0x5a0035,_0x1c2e0b,'Outbound');})['then'](function(_0x37eab2){if(_0x37eab2){logger[_0x844c('0x2f')](_0x844c('0x99'),_0x37eab2['id']);logger['info'](_0x844c('0x96'),_0x844c('0x8e'));emit(util[_0x844c('0x32')](_0x844c('0x8f'),_0x20f426[_0x844c('0x1b')]),_0x844c('0x90'),{'uri':_0x844c('0x91')+_0x4b7c90['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x37eab2['id']});}})[_0x844c('0x2d')](function(_0x2d90fd){logger['error'](_0x844c('0x96'),JSON[_0x844c('0xe')](_0x2d90fd));});};exports[_0x844c('0x9a')]=function(_0x2d38a8,_0x2f189a,_0x5f3253,_0x4af4dc,_0x37ceaf,_0x5dd2eb){var _0xa2e2d6,_0x1b4da2,_0x1bb74b;_0x5dd2eb['host']=intUtil[_0x844c('0x81')](_0x5dd2eb['host']);_0x5dd2eb[_0x844c('0x82')]=intUtil[_0x844c('0x81')](_0x5dd2eb[_0x844c('0x82')]);if(_0x37ceaf&&_0x37ceaf['monitor_format']){logger[_0x844c('0x2f')]('['+_0x2f189a[_0x844c('0x6b')]['toUpperCase']()+']',_0x844c('0x97'));_0x2f189a['recordingURL']=_0x5dd2eb[_0x844c('0x82')]+_0x844c('0x86')+_0x2f189a['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x2f189a['uniqueid']);}else{_0x2f189a[_0x844c('0x85')]='';}var _0x2bce48=_0x5dd2eb[_0x844c('0x80')]===_0x844c('0x89')?'eu':'com';return getAccessToken(_0x5dd2eb)[_0x844c('0x2a')](function(_0x4d1950){_0x1bb74b=_0x4d1950;return getUser(_0x1bb74b,_0x2bce48,_0x5dd2eb);})[_0x844c('0x2a')](function(_0x286aeb){_0xa2e2d6=_0x286aeb;logger['info'](_0x844c('0x8b'),_0xa2e2d6['id']);return getEndUser(_0x1bb74b,_0x2bce48,_0x5dd2eb,_0x2f189a[_0x844c('0x8c')],_0x2f189a[_0x844c('0x8d')],_0xa2e2d6,_0x5f3253);})[_0x844c('0x2a')](function(_0x331fa6){_0x1b4da2=_0x331fa6;return getCall(_0x1bb74b,_0x2bce48,_0x5dd2eb,_0xa2e2d6,_0x1b4da2,_0x5f3253,_0x2f189a,_0x844c('0x79'));})['then'](function(_0x133ed1){if(_0x133ed1){logger['info'](_0x844c('0x99'),_0x133ed1['id']);}})[_0x844c('0x2d')](function(_0x4e8aea){logger[_0x844c('0x2e')]('['+_0x2f189a['lastevent'][_0x844c('0x9b')]()+']',JSON[_0x844c('0xe')](_0x4e8aea));});};
\ No newline at end of file
index dce0d42..cbe3255 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x310c=['mustache','trigger','exec','data2','Script','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'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x310c,0x78));var _0xc310=function(_0x32c08d,_0x11ea2e){_0x32c08d=_0x32c08d-0x0;var _0x41ef1c=_0x310c[_0x32c08d];return _0x41ef1c;};'use strict';var util=require(_0xc310('0x0'));var sh=require('shelljs');var Mustache=require(_0xc310('0x1'));var logger=require('../../../../config/logger')(_0xc310('0x2'));exports[_0xc310('0x3')]=function(_0x396102,_0x2bf592){var _0x45cd89=_0x396102[_0xc310('0x4')]?_0x396102[_0xc310('0x4')]:_0xc310('0x5');var _0x1bcebe=_0x396102[_0xc310('0x6')]?Mustache[_0xc310('0x7')](_0x396102[_0xc310('0x6')],_0x2bf592):_0x2bf592;sh[_0xc310('0x3')](_0x1bcebe,function(_0x406548,_0x21837d,_0xe6f569){if(_0x406548!==0x0){logger['error'](util[_0xc310('0x8')](_0xc310('0x9'),_0x45cd89,_0x1bcebe,_0x406548,_0xe6f569));}else{logger['info'](util[_0xc310('0x8')](_0xc310('0xa'),_0x45cd89,_0x1bcebe,_0x21837d));}});};
\ No newline at end of file
+var _0xc559=['../../../../config/logger','trigger','exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache'];(function(_0x1c72e7,_0x25ead1){var _0x92905c=function(_0x53b1d1){while(--_0x53b1d1){_0x1c72e7['push'](_0x1c72e7['shift']());}};_0x92905c(++_0x25ead1);}(_0xc559,0xfc));var _0x9c55=function(_0x258831,_0x93e007){_0x258831=_0x258831-0x0;var _0x202c19=_0xc559[_0x258831];return _0x202c19;};'use strict';var util=require(_0x9c55('0x0'));var sh=require(_0x9c55('0x1'));var Mustache=require(_0x9c55('0x2'));var logger=require(_0x9c55('0x3'))(_0x9c55('0x4'));exports[_0x9c55('0x5')]=function(_0x12328e,_0x34ed0e){var _0x26fa51=_0x12328e[_0x9c55('0x6')]?_0x12328e[_0x9c55('0x6')]:_0x9c55('0x7');var _0x21c8f0=_0x12328e[_0x9c55('0x8')]?Mustache[_0x9c55('0x9')](_0x12328e[_0x9c55('0x8')],_0x34ed0e):_0x34ed0e;sh[_0x9c55('0x5')](_0x21c8f0,function(_0x1e3d49,_0x21a8c5,_0x33c5c0){if(_0x1e3d49!==0x0){logger[_0x9c55('0xa')](util[_0x9c55('0xb')](_0x9c55('0xc'),_0x26fa51,_0x21c8f0,_0x1e3d49,_0x33c5c0));}else{logger[_0x9c55('0xd')](util[_0x9c55('0xb')](_0x9c55('0xe'),_0x26fa51,_0x21c8f0,_0x21a8c5));}});};
\ No newline at end of file
index e77481a..d5775c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2e=['PUT','data7','render','body','format','then','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','request-promise','lodash','mustache','../../../../config/logger','trigger','exec','toUpperCase','data2','number','data5','headers','error','stack','data1','GET','DELETE'];(function(_0x270913,_0xb25fb4){var _0x1e1dba=function(_0x1bbe82){while(--_0x1bbe82){_0x270913['push'](_0x270913['shift']());}};_0x1e1dba(++_0xb25fb4);}(_0x5f2e,0x178));var _0xe5f2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5f2e[_0x321bb2];return _0x9c12ed;};'use strict';var rp=require(_0xe5f2('0x0'));var util=require('util');var _=require(_0xe5f2('0x1'));var Mustache=require(_0xe5f2('0x2'));var logger=require(_0xe5f2('0x3'))(_0xe5f2('0x4'));exports[_0xe5f2('0x5')]=function(_0x66a0fa,_0x412f68){var _0x4f1095,_0x422d0a;var _0x33caea={'method':_0x66a0fa['data1'][_0xe5f2('0x6')](),'uri':Mustache['render'](_0x66a0fa[_0xe5f2('0x7')],_0x412f68),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x66a0fa['data5'])===_0xe5f2('0x8')&&parseInt(_0x66a0fa[_0xe5f2('0x9')])>=0x1&&parseInt(_0x66a0fa['data5'])<=0xa?parseInt(_0x66a0fa[_0xe5f2('0x9')])*0x3e8:0x5*0x3e8};try{_0x33caea[_0xe5f2('0xa')]=_0x66a0fa['data6']?JSON['parse'](Mustache['render'](_0x66a0fa['data6'],_0x412f68)):{};}catch(_0x426611){logger[_0xe5f2('0xb')](_0x426611[_0xe5f2('0xc')]);}switch(_0x66a0fa[_0xe5f2('0xd')]['toUpperCase']()){case _0xe5f2('0xe'):case _0xe5f2('0xf'):_0x4f1095=null;_0x33caea['qs']=_0x412f68;break;case'POST':case _0xe5f2('0x10'):if(_0x66a0fa[_0xe5f2('0x11')]){try{_0x4f1095=JSON['parse'](Mustache[_0xe5f2('0x12')](_0x66a0fa[_0xe5f2('0x11')],_0x412f68));_0x33caea[_0xe5f2('0x13')]=_0x4f1095;}catch(_0x59cd66){logger[_0xe5f2('0xb')](_0x59cd66[_0xe5f2('0xc')]);logger['error']('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x4f1095=_0x412f68;_0x33caea['body']=_0x4f1095;}break;}logger['info'](util[_0xe5f2('0x14')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x66a0fa[_0xe5f2('0xd')],_0x66a0fa['data2'],JSON['stringify'](_0x33caea)));rp(_0x33caea)[_0xe5f2('0x15')](function(_0x5e21a7){_0x4f1095=!_['isNil'](_0x4f1095)?',\x20request\x20body:\x20'+_0x4f1095:'';_0x422d0a=typeof _0x5e21a7[_0xe5f2('0x13')]==='object'?JSON['stringify'](_0x5e21a7[_0xe5f2('0x13')]):_0x5e21a7[_0xe5f2('0x13')];logger[_0xe5f2('0x16')](util[_0xe5f2('0x14')](_0xe5f2('0x17'),_0x66a0fa[_0xe5f2('0xd')],_0x66a0fa[_0xe5f2('0x7')],_0x5e21a7['statusCode'],_0x422d0a));})['catch'](function(_0x2d5522){logger[_0xe5f2('0xb')](util[_0xe5f2('0x14')](_0xe5f2('0x18'),_0x66a0fa[_0xe5f2('0xd')],_0x66a0fa['data2'],_0x2d5522[_0xe5f2('0x19')],_0x2d5522[_0xe5f2('0x1a')],_0x2d5522[_0xe5f2('0x1b')]));});};
\ No newline at end of file
+var _0x43af=['lodash','mustache','../../../../config/logger','exec','data1','toUpperCase','data2','data5','number','headers','parse','data6','stack','GET','DELETE','POST','data7','render','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','stringify','then',',\x20request\x20body:\x20','body','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util'];(function(_0x17d878,_0x208455){var _0x4eee59=function(_0x16bb1a){while(--_0x16bb1a){_0x17d878['push'](_0x17d878['shift']());}};_0x4eee59(++_0x208455);}(_0x43af,0x1ee));var _0xf43a=function(_0xf5da6c,_0x1cc958){_0xf5da6c=_0xf5da6c-0x0;var _0x143da3=_0x43af[_0xf5da6c];return _0x143da3;};'use strict';var rp=require(_0xf43a('0x0'));var util=require(_0xf43a('0x1'));var _=require(_0xf43a('0x2'));var Mustache=require(_0xf43a('0x3'));var logger=require(_0xf43a('0x4'))('trigger');exports[_0xf43a('0x5')]=function(_0x9caf6c,_0x471fc0){var _0x461686,_0x40a538;var _0x4dbec6={'method':_0x9caf6c[_0xf43a('0x6')][_0xf43a('0x7')](),'uri':Mustache['render'](_0x9caf6c[_0xf43a('0x8')],_0x471fc0),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x9caf6c[_0xf43a('0x9')])===_0xf43a('0xa')&&parseInt(_0x9caf6c[_0xf43a('0x9')])>=0x1&&parseInt(_0x9caf6c['data5'])<=0xa?parseInt(_0x9caf6c[_0xf43a('0x9')])*0x3e8:0x5*0x3e8};try{_0x4dbec6[_0xf43a('0xb')]=_0x9caf6c['data6']?JSON[_0xf43a('0xc')](Mustache['render'](_0x9caf6c[_0xf43a('0xd')],_0x471fc0)):{};}catch(_0xb53be){logger['error'](_0xb53be[_0xf43a('0xe')]);}switch(_0x9caf6c['data1'][_0xf43a('0x7')]()){case _0xf43a('0xf'):case _0xf43a('0x10'):_0x461686=null;_0x4dbec6['qs']=_0x471fc0;break;case _0xf43a('0x11'):case'PUT':if(_0x9caf6c[_0xf43a('0x12')]){try{_0x461686=JSON['parse'](Mustache[_0xf43a('0x13')](_0x9caf6c[_0xf43a('0x12')],_0x471fc0));_0x4dbec6['body']=_0x461686;}catch(_0x2c225b){logger['error'](_0x2c225b[_0xf43a('0xe')]);logger['error'](_0xf43a('0x14'));}}else{_0x461686=_0x471fc0;_0x4dbec6['body']=_0x461686;}break;}logger['info'](util[_0xf43a('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x9caf6c['data1'],_0x9caf6c[_0xf43a('0x8')],JSON[_0xf43a('0x16')](_0x4dbec6)));rp(_0x4dbec6)[_0xf43a('0x17')](function(_0x1de5c1){_0x461686=!_['isNil'](_0x461686)?_0xf43a('0x18')+_0x461686:'';_0x40a538=typeof _0x1de5c1[_0xf43a('0x19')]==='object'?JSON[_0xf43a('0x16')](_0x1de5c1['body']):_0x1de5c1[_0xf43a('0x19')];logger['info'](util[_0xf43a('0x15')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x9caf6c[_0xf43a('0x6')],_0x9caf6c[_0xf43a('0x8')],_0x1de5c1[_0xf43a('0x1a')],_0x40a538));})[_0xf43a('0x1b')](function(_0x3e59e1){logger['error'](util[_0xf43a('0x15')](_0xf43a('0x1c'),_0x9caf6c[_0xf43a('0x6')],_0x9caf6c[_0xf43a('0x8')],_0x3e59e1['statusCode'],_0x3e59e1[_0xf43a('0x1d')],_0x3e59e1[_0xf43a('0x1e')]));});};
\ No newline at end of file
index 68ad6c4..f454532 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3465=['rpc','message','result','catch','jayson/promise','bluebird','routing','client','http','Request','then','debug','error'];(function(_0x5a1fba,_0x54bd31){var _0x5bfa4a=function(_0x4a79c8){while(--_0x4a79c8){_0x5a1fba['push'](_0x5a1fba['shift']());}};_0x5bfa4a(++_0x54bd31);}(_0x3465,0xba));var _0x5346=function(_0x16697e,_0x112bf8){_0x16697e=_0x16697e-0x0;var _0x218ede=_0x3465[_0x16697e];return _0x218ede;};'use strict';var jayson=require(_0x5346('0x0'));var BPromise=require(_0x5346('0x1'));var logger=require('../../config/logger')(_0x5346('0x2'));var client=jayson[_0x5346('0x3')][_0x5346('0x4')]({'port':0x2329});client[_0x5346('0x5')]=function(_0x8d4721,_0x1e825c){return new BPromise(function(_0x3b877a,_0x299a50){return client['request'](_0x8d4721,_0x1e825c)[_0x5346('0x6')](function(_0x401d35){logger[_0x5346('0x7')]('rpc',_0x5346('0x2'),_0x8d4721,_0x1e825c,_0x401d35);if(_0x401d35['error']){logger[_0x5346('0x8')](_0x5346('0x9'),'routing',_0x8d4721,_0x401d35[_0x5346('0x8')][_0x5346('0xa')],_0x1e825c);return _0x299a50(_0x401d35[_0x5346('0x8')]['message']);}else{return _0x3b877a(_0x401d35[_0x5346('0xb')]);}})[_0x5346('0xc')](function(_0x25a3d1){logger[_0x5346('0x8')]('rpc',_0x5346('0x2'),_0x8d4721,_0x25a3d1,_0x1e825c);return _0x299a50(_0x25a3d1);});});};module['exports']=client;
\ No newline at end of file
+var _0x72ef=['rpc','exports','jayson/promise','bluebird','../../config/logger','client','http','then','debug','routing','error','message','result'];(function(_0x2ce6d5,_0x333e0c){var _0x32d272=function(_0x399f0b){while(--_0x399f0b){_0x2ce6d5['push'](_0x2ce6d5['shift']());}};_0x32d272(++_0x333e0c);}(_0x72ef,0x1f0));var _0xf72e=function(_0x372014,_0x52fff7){_0x372014=_0x372014-0x0;var _0x5e224f=_0x72ef[_0x372014];return _0x5e224f;};'use strict';var jayson=require(_0xf72e('0x0'));var BPromise=require(_0xf72e('0x1'));var logger=require(_0xf72e('0x2'))('routing');var client=jayson[_0xf72e('0x3')][_0xf72e('0x4')]({'port':0x2329});client['Request']=function(_0x807daf,_0x3516e6){return new BPromise(function(_0x33d125,_0x216da6){return client['request'](_0x807daf,_0x3516e6)[_0xf72e('0x5')](function(_0x43577c){logger[_0xf72e('0x6')]('rpc',_0xf72e('0x7'),_0x807daf,_0x3516e6,_0x43577c);if(_0x43577c['error']){logger[_0xf72e('0x8')]('rpc',_0xf72e('0x7'),_0x807daf,_0x43577c[_0xf72e('0x8')][_0xf72e('0x9')],_0x3516e6);return _0x216da6(_0x43577c[_0xf72e('0x8')][_0xf72e('0x9')]);}else{return _0x33d125(_0x43577c[_0xf72e('0xa')]);}})['catch'](function(_0x2dda2c){logger['error'](_0xf72e('0xb'),_0xf72e('0x7'),_0x807daf,_0x2dda2c,_0x3516e6);return _0x216da6(_0x2dda2c);});});};module[_0xf72e('0xc')]=client;
\ No newline at end of file
index 814493b..d45a41f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c06=['resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','error','./realtime','./rpc/mailAccount','../../config/logger','email'];(function(_0x2b23bc,_0x11f0b0){var _0x489467=function(_0x279391){while(--_0x279391){_0x2b23bc['push'](_0x2b23bc['shift']());}};_0x489467(++_0x11f0b0);}(_0x8c06,0x19c));var _0x68c0=function(_0x3ab1e5,_0x25623e){_0x3ab1e5=_0x3ab1e5-0x0;var _0x5553b0=_0x8c06[_0x3ab1e5];return _0x5553b0;};'use strict';var server=require('./server');var Realtime=require(_0x68c0('0x0'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x68c0('0x1'));var setting=require('./rpc/setting');var logger=require(_0x68c0('0x2'))(_0x68c0('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x68c0('0x4')]()[_0x68c0('0x5')](mailAccount[_0x68c0('0x6')]())[_0x68c0('0x5')](realtime[_0x68c0('0x7')]())[_0x68c0('0x5')](function(){email[_0x68c0('0x8')](realtime[_0x68c0('0x9')]);return realtime;});}function main(){return server[_0x68c0('0xa')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0x68c0('0xb')]();})['then'](function(_0x4672c2){return setInterval(initRealtime,_0x4672c2['loginMailFrequency']*0x3e8);})['catch'](function(_0x5b0c70){logger[_0x68c0('0xc')]('Email\x20service\x20initialization',_0x5b0c70);});}main();
\ No newline at end of file
+var _0x949b=['mailAccounts','listen','getSettings','loginMailFrequency','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','initMailAccounts','then','refresh'];(function(_0x3fa0fd,_0x23c7b3){var _0x1e93de=function(_0x54b300){while(--_0x54b300){_0x3fa0fd['push'](_0x3fa0fd['shift']());}};_0x1e93de(++_0x23c7b3);}(_0x949b,0xc5));var _0xb949=function(_0x280a5b,_0x465507){_0x280a5b=_0x280a5b-0x0;var _0x55961b=_0x949b[_0x280a5b];return _0x55961b;};'use strict';var server=require(_0xb949('0x0'));var Realtime=require(_0xb949('0x1'));var EmailChannel=require(_0xb949('0x2'));var mailAccount=require(_0xb949('0x3'));var setting=require(_0xb949('0x4'));var logger=require(_0xb949('0x5'))(_0xb949('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xb949('0x7')]()['then'](mailAccount['getMailAccounts']())['then'](realtime[_0xb949('0x8')]())[_0xb949('0x9')](function(){email[_0xb949('0xa')](realtime[_0xb949('0xb')]);return realtime;});}function main(){return server[_0xb949('0xc')](realtime,email)[_0xb949('0x9')](function(){return initRealtime();})[_0xb949('0x9')](function(){return setting[_0xb949('0xd')]();})[_0xb949('0x9')](function(_0x37358f){return setInterval(initRealtime,_0x37358f[_0xb949('0xe')]*0x3e8);})['catch'](function(_0x19fa6d){logger['error'](_0xb949('0xf'),_0x19fa6d);});}main();
\ No newline at end of file
index 6eec55c..76decad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3853=['smtp','prototype','emit','name','key','active','Imap','messageStatus','total','stringify','md5','mailAccount:update','hasOwnProperty','custom','service','provider','box','handleImapBox','bind','handleImapEnd','isNil','status','disabled','connected','messages','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','send','verifySmtp','Smtp','verified','verify','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts'];(function(_0x2da65a,_0x2e5148){var _0x3e0b35=function(_0x3620cc){while(--_0x3620cc){_0x2da65a['push'](_0x2da65a['shift']());}};_0x3e0b35(++_0x2e5148);}(_0x3853,0xd3));var _0x3385=function(_0x19a702,_0x50aad7){_0x19a702=_0x19a702-0x0;var _0x3560a9=_0x3853[_0x19a702];return _0x3560a9;};'use strict';var _=require(_0x3385('0x0'));var moment=require(_0x3385('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0x3385('0x2'));var config=require(_0x3385('0x3'));var logger=require(_0x3385('0x4'))(_0x3385('0x5'));config[_0x3385('0x6')]=_[_0x3385('0x7')](config[_0x3385('0x6')],{'host':_0x3385('0x8'),'port':0x18eb});var io=require(_0x3385('0x9'))(new Redis(config[_0x3385('0x6')]));var EmailImap=require(_0x3385('0xa'));var EmailSmtp=require(_0x3385('0xb'));var mailAccount=require(_0x3385('0xc'));var md5Accounts={};function EmailChannel(_0x4aceb1){logger[_0x3385('0xd')](_0x3385('0xe'));this['mailAccounts']=_0x4aceb1[_0x3385('0xf')];this[_0x3385('0x10')]={};this[_0x3385('0x11')]=new EmailSmtp();}EmailChannel[_0x3385('0x12')][_0x3385('0x13')]=function(_0x4e7cf8){var _0x54fe9c=this[_0x3385('0xf')][_0x4e7cf8];var _0x28c336={'id':_0x54fe9c['id'],'name':_0x54fe9c[_0x3385('0x14')],'key':_0x54fe9c[_0x3385('0x15')],'active':_0x54fe9c[_0x3385('0x16')],'Imap':{'status':_0x54fe9c[_0x3385('0x17')]['status'],'messageStatus':_0x54fe9c[_0x3385('0x17')][_0x3385('0x18')],'total':_0x54fe9c['Imap'][_0x3385('0x19')]}};if(_['isNil'](md5Accounts[_0x4e7cf8])){md5Accounts[_0x4e7cf8]={};}var _0x3bea59=md5(JSON[_0x3385('0x1a')](_0x28c336));if(md5Accounts[_0x4e7cf8][_0x3385('0x1b')]!==_0x3bea59){md5Accounts[_0x4e7cf8][_0x3385('0x1b')]=_0x3bea59;io['emit'](_0x3385('0x1c'),_0x28c336);}};EmailChannel[_0x3385('0x12')]['refresh']=function(_0x115c26){for(var _0x4611f6 in _0x115c26){if(_0x115c26[_0x3385('0x1d')](_0x4611f6)){if(_0x115c26[_0x4611f6][_0x3385('0x17')]&&_0x115c26[_0x4611f6][_0x3385('0x16')]){var _0x38bdb0=_0x115c26[_0x4611f6][_0x3385('0x17')];if(!_0x38bdb0['service']&&_0x115c26[_0x4611f6]['provider']!==_0x3385('0x1e'))_0x38bdb0[_0x3385('0x1f')]=_0x115c26[_0x4611f6][_0x3385('0x20')];if(!this[_0x3385('0x10')][_0x3385('0x1d')](_0x38bdb0['id'])){this[_0x3385('0x10')][_0x38bdb0['id']]=new EmailImap(_0x38bdb0,_0x115c26[_0x4611f6]['email']);this[_0x3385('0x10')][_0x38bdb0['id']]['on'](_0x3385('0x21'),this[_0x3385('0x22')][_0x3385('0x23')](this,_0x4611f6));this[_0x3385('0x10')][_0x38bdb0['id']]['on'](_0x3385('0x5'),this['handleImapEmail'][_0x3385('0x23')](this,_0x4611f6));this[_0x3385('0x10')][_0x38bdb0['id']]['on']('end',this[_0x3385('0x24')][_0x3385('0x23')](this,_0x4611f6));this[_0x3385('0x10')][_0x38bdb0['id']]['on']('error',this['handleImapError'][_0x3385('0x23')](this,_0x4611f6));}}else{if(_[_0x3385('0x25')](this[_0x3385('0xf')][_0x4611f6][_0x3385('0x17')])){this[_0x3385('0xf')][_0x4611f6]['Imap']={};}this[_0x3385('0xf')][_0x4611f6]['Imap'][_0x3385('0x26')]=_0x3385('0x27');this[_0x3385('0xf')][_0x4611f6]['Imap'][_0x3385('0x18')]='';this[_0x3385('0x13')](_0x4611f6);}}}};EmailChannel[_0x3385('0x12')][_0x3385('0x22')]=function(_0x509665,_0x50d701){if(this[_0x3385('0xf')][_0x509665]){this['mailAccounts'][_0x509665][_0x3385('0x17')]['status']=_0x3385('0x28');this[_0x3385('0xf')][_0x509665][_0x3385('0x17')]['messageStatus']=_0x50d701[_0x3385('0x14')];if(_0x50d701[_0x3385('0x29')]){this['mailAccounts'][_0x509665][_0x3385('0x17')][_0x3385('0x19')]=_0x50d701[_0x3385('0x29')][_0x3385('0x19')];}return this[_0x3385('0x13')](_0x509665);}};EmailChannel[_0x3385('0x12')]['handleImapEmail']=function(_0x5f3d48,_0x2d50bd){logger[_0x3385('0xd')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x2d50bd['firstName'],_0x2d50bd[_0x3385('0x2a')],_0x2d50bd[_0x3385('0x2b')],_0x5f3d48);if(this[_0x3385('0xf')][_0x5f3d48]){return mailAccount['notify'](_0x5f3d48,_0x2d50bd)[_0x3385('0x2c')](function(_0x398567){if(_0x398567){logger[_0x3385('0xd')](_0x3385('0x2d'));}})[_0x3385('0x2e')](function(_0x5c6b36){logger[_0x3385('0x2f')](_0x3385('0x30'),JSON[_0x3385('0x1a')](_0x5c6b36));});}};EmailChannel[_0x3385('0x12')][_0x3385('0x24')]=function(_0x2bb973){if(this[_0x3385('0xf')][_0x2bb973]&&this[_0x3385('0xf')][_0x2bb973][_0x3385('0x17')]){if(this[_0x3385('0x10')][this[_0x3385('0xf')][_0x2bb973][_0x3385('0x17')]['id']]){delete this[_0x3385('0x10')][this['mailAccounts'][_0x2bb973][_0x3385('0x17')]['id']];}this['mailAccounts'][_0x2bb973][_0x3385('0x17')][_0x3385('0x31')]=moment();this['emit'](_0x2bb973);}};EmailChannel[_0x3385('0x12')][_0x3385('0x32')]=function(_0x3853db,_0x524e24){if(this[_0x3385('0xf')][_0x3853db]){this[_0x3385('0xf')][_0x3853db][_0x3385('0x17')][_0x3385('0x26')]=_0x3385('0x2f');this[_0x3385('0xf')][_0x3853db][_0x3385('0x17')][_0x3385('0x18')]=_0x524e24;return this['emit'](_0x3853db);}};EmailChannel[_0x3385('0x12')]['sendMail']=function(_0x527753,_0x2cf242){return this[_0x3385('0x11')][_0x3385('0x33')](_0x527753,_0x2cf242);};EmailChannel['prototype'][_0x3385('0x34')]=function(_0x21fc63){var _0x1a3b87=this;if(this['mailAccounts'][_0x21fc63['id']]){if(_['isNil'](this[_0x3385('0xf')][_0x21fc63['id']]['Smtp'])){this['mailAccounts'][_0x21fc63['id']][_0x3385('0x35')]={};}this[_0x3385('0xf')][_0x21fc63['id']][_0x3385('0x35')][_0x3385('0x31')]=moment();return new BPromise(function(_0x10b6c5,_0x330967){return _0x1a3b87[_0x3385('0x11')]['verify'](_0x21fc63)[_0x3385('0x2c')](function(_0xd39012){_0x1a3b87[_0x3385('0xf')][_0x21fc63['id']][_0x3385('0x35')][_0x3385('0x26')]=_0x3385('0x36');_0x1a3b87[_0x3385('0xf')][_0x21fc63['id']][_0x3385('0x35')][_0x3385('0x18')]='';_0x1a3b87['emit'](_0x21fc63['id']);_0x10b6c5(_0xd39012);})['catch'](function(_0xaa4d98){_0x1a3b87[_0x3385('0xf')][_0x21fc63['id']]['Smtp']['status']=_0x3385('0x2f');_0x1a3b87[_0x3385('0xf')][_0x21fc63['id']]['Smtp'][_0x3385('0x18')]=_0xaa4d98;_0x1a3b87[_0x3385('0x13')](_0x21fc63['id']);_0x330967(_0xaa4d98);});});}return this[_0x3385('0x11')][_0x3385('0x37')](_0x21fc63);};module[_0x3385('0x38')]=EmailChannel;
\ No newline at end of file
+var _0x4eaa=['exports','lodash','moment','bluebird','md5','../../../config/environment','email','defaults','localhost','socket.io-emitter','redis','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','emit','name','key','active','Imap','status','messageStatus','total','mailAccount:update','prototype','hasOwnProperty','service','provider','custom','box','bind','handleImapEmail','handleImapEnd','error','handleImapError','isNil','disabled','handleImapBox','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','smtp','Smtp','then','verify'];(function(_0x37d6b8,_0x525b5b){var _0x318611=function(_0x484847){while(--_0x484847){_0x37d6b8['push'](_0x37d6b8['shift']());}};_0x318611(++_0x525b5b);}(_0x4eaa,0x6d));var _0xa4ea=function(_0x39c715,_0x4e5a98){_0x39c715=_0x39c715-0x0;var _0x4e5069=_0x4eaa[_0x39c715];return _0x4e5069;};'use strict';var _=require(_0xa4ea('0x0'));var moment=require(_0xa4ea('0x1'));var BPromise=require(_0xa4ea('0x2'));var md5=require(_0xa4ea('0x3'));var Redis=require('ioredis');var config=require(_0xa4ea('0x4'));var logger=require('../../../config/logger')(_0xa4ea('0x5'));config['redis']=_[_0xa4ea('0x6')](config['redis'],{'host':_0xa4ea('0x7'),'port':0x18eb});var io=require(_0xa4ea('0x8'))(new Redis(config[_0xa4ea('0x9')]));var EmailImap=require(_0xa4ea('0xa'));var EmailSmtp=require(_0xa4ea('0xb'));var mailAccount=require(_0xa4ea('0xc'));var md5Accounts={};function EmailChannel(_0x2ebd92){logger[_0xa4ea('0xd')]('start\x20email\x20channel');this[_0xa4ea('0xe')]=_0x2ebd92[_0xa4ea('0xe')];this[_0xa4ea('0xf')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0xa4ea('0x10')]=function(_0x460d22){var _0x585cf6=this['mailAccounts'][_0x460d22];var _0x41483={'id':_0x585cf6['id'],'name':_0x585cf6[_0xa4ea('0x11')],'key':_0x585cf6[_0xa4ea('0x12')],'active':_0x585cf6[_0xa4ea('0x13')],'Imap':{'status':_0x585cf6[_0xa4ea('0x14')][_0xa4ea('0x15')],'messageStatus':_0x585cf6[_0xa4ea('0x14')][_0xa4ea('0x16')],'total':_0x585cf6['Imap'][_0xa4ea('0x17')]}};if(_['isNil'](md5Accounts[_0x460d22])){md5Accounts[_0x460d22]={};}var _0x4ba247=md5(JSON['stringify'](_0x41483));if(md5Accounts[_0x460d22][_0xa4ea('0x3')]!==_0x4ba247){md5Accounts[_0x460d22][_0xa4ea('0x3')]=_0x4ba247;io[_0xa4ea('0x10')](_0xa4ea('0x18'),_0x41483);}};EmailChannel[_0xa4ea('0x19')]['refresh']=function(_0x2e8efd){for(var _0x3b2bf5 in _0x2e8efd){if(_0x2e8efd[_0xa4ea('0x1a')](_0x3b2bf5)){if(_0x2e8efd[_0x3b2bf5][_0xa4ea('0x14')]&&_0x2e8efd[_0x3b2bf5][_0xa4ea('0x13')]){var _0xf76750=_0x2e8efd[_0x3b2bf5][_0xa4ea('0x14')];if(!_0xf76750[_0xa4ea('0x1b')]&&_0x2e8efd[_0x3b2bf5][_0xa4ea('0x1c')]!==_0xa4ea('0x1d'))_0xf76750['service']=_0x2e8efd[_0x3b2bf5][_0xa4ea('0x1c')];if(!this[_0xa4ea('0xf')][_0xa4ea('0x1a')](_0xf76750['id'])){this[_0xa4ea('0xf')][_0xf76750['id']]=new EmailImap(_0xf76750,_0x2e8efd[_0x3b2bf5][_0xa4ea('0x5')]);this['imapAccounts'][_0xf76750['id']]['on'](_0xa4ea('0x1e'),this['handleImapBox'][_0xa4ea('0x1f')](this,_0x3b2bf5));this[_0xa4ea('0xf')][_0xf76750['id']]['on'](_0xa4ea('0x5'),this[_0xa4ea('0x20')][_0xa4ea('0x1f')](this,_0x3b2bf5));this['imapAccounts'][_0xf76750['id']]['on']('end',this[_0xa4ea('0x21')]['bind'](this,_0x3b2bf5));this[_0xa4ea('0xf')][_0xf76750['id']]['on'](_0xa4ea('0x22'),this[_0xa4ea('0x23')][_0xa4ea('0x1f')](this,_0x3b2bf5));}}else{if(_[_0xa4ea('0x24')](this[_0xa4ea('0xe')][_0x3b2bf5]['Imap'])){this[_0xa4ea('0xe')][_0x3b2bf5][_0xa4ea('0x14')]={};}this[_0xa4ea('0xe')][_0x3b2bf5][_0xa4ea('0x14')]['status']=_0xa4ea('0x25');this[_0xa4ea('0xe')][_0x3b2bf5][_0xa4ea('0x14')][_0xa4ea('0x16')]='';this[_0xa4ea('0x10')](_0x3b2bf5);}}}};EmailChannel['prototype'][_0xa4ea('0x26')]=function(_0x17ee52,_0x23f545){if(this[_0xa4ea('0xe')][_0x17ee52]){this[_0xa4ea('0xe')][_0x17ee52]['Imap'][_0xa4ea('0x15')]='connected';this['mailAccounts'][_0x17ee52]['Imap'][_0xa4ea('0x16')]=_0x23f545[_0xa4ea('0x11')];if(_0x23f545[_0xa4ea('0x27')]){this['mailAccounts'][_0x17ee52][_0xa4ea('0x14')][_0xa4ea('0x17')]=_0x23f545[_0xa4ea('0x27')][_0xa4ea('0x17')];}return this['emit'](_0x17ee52);}};EmailChannel[_0xa4ea('0x19')][_0xa4ea('0x20')]=function(_0x4349c2,_0x4638f1){logger[_0xa4ea('0xd')](_0xa4ea('0x28'),_0x4638f1['firstName'],_0x4638f1[_0xa4ea('0x29')],_0x4638f1[_0xa4ea('0x2a')],_0x4349c2);if(this['mailAccounts'][_0x4349c2]){return mailAccount[_0xa4ea('0x2b')](_0x4349c2,_0x4638f1)['then'](function(_0xbf8491){if(_0xbf8491){logger[_0xa4ea('0xd')](_0xa4ea('0x2c'));}})[_0xa4ea('0x2d')](function(_0x4a4a45){logger[_0xa4ea('0x22')](_0xa4ea('0x2e'),JSON[_0xa4ea('0x2f')](_0x4a4a45));});}};EmailChannel[_0xa4ea('0x19')][_0xa4ea('0x21')]=function(_0x538b22){if(this[_0xa4ea('0xe')][_0x538b22]&&this[_0xa4ea('0xe')][_0x538b22]['Imap']){if(this[_0xa4ea('0xf')][this[_0xa4ea('0xe')][_0x538b22][_0xa4ea('0x14')]['id']]){delete this[_0xa4ea('0xf')][this['mailAccounts'][_0x538b22][_0xa4ea('0x14')]['id']];}this['mailAccounts'][_0x538b22]['Imap'][_0xa4ea('0x30')]=moment();this['emit'](_0x538b22);}};EmailChannel[_0xa4ea('0x19')][_0xa4ea('0x23')]=function(_0x51147b,_0x40ca51){if(this[_0xa4ea('0xe')][_0x51147b]){this[_0xa4ea('0xe')][_0x51147b]['Imap']['status']=_0xa4ea('0x22');this[_0xa4ea('0xe')][_0x51147b][_0xa4ea('0x14')]['messageStatus']=_0x40ca51;return this[_0xa4ea('0x10')](_0x51147b);}};EmailChannel[_0xa4ea('0x19')]['sendMail']=function(_0x13514f,_0x2dd1a0){return this[_0xa4ea('0x31')]['send'](_0x13514f,_0x2dd1a0);};EmailChannel[_0xa4ea('0x19')]['verifySmtp']=function(_0x4987f8){var _0x333b87=this;if(this[_0xa4ea('0xe')][_0x4987f8['id']]){if(_[_0xa4ea('0x24')](this[_0xa4ea('0xe')][_0x4987f8['id']][_0xa4ea('0x32')])){this[_0xa4ea('0xe')][_0x4987f8['id']][_0xa4ea('0x32')]={};}this[_0xa4ea('0xe')][_0x4987f8['id']][_0xa4ea('0x32')][_0xa4ea('0x30')]=moment();return new BPromise(function(_0x506806,_0xb888e7){return _0x333b87[_0xa4ea('0x31')]['verify'](_0x4987f8)[_0xa4ea('0x33')](function(_0x13ff08){_0x333b87[_0xa4ea('0xe')][_0x4987f8['id']][_0xa4ea('0x32')][_0xa4ea('0x15')]='verified';_0x333b87[_0xa4ea('0xe')][_0x4987f8['id']][_0xa4ea('0x32')][_0xa4ea('0x16')]='';_0x333b87[_0xa4ea('0x10')](_0x4987f8['id']);_0x506806(_0x13ff08);})[_0xa4ea('0x2d')](function(_0x35a773){_0x333b87[_0xa4ea('0xe')][_0x4987f8['id']][_0xa4ea('0x32')]['status']=_0xa4ea('0x22');_0x333b87['mailAccounts'][_0x4987f8['id']][_0xa4ea('0x32')][_0xa4ea('0x16')]=_0x35a773;_0x333b87[_0xa4ea('0x10')](_0x4987f8['id']);_0xb888e7(_0x35a773);});});}return this['smtp'][_0xa4ea('0x34')](_0x4987f8);};module[_0xa4ea('0x35')]=EmailChannel;
\ No newline at end of file
index 92f7e7c..0b7a5da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d04=['handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','parser','emit','hasOwnProperty','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','./utils','../../../config/logger','email','getAccount','account','once','bind','end','handleEnd','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','generateXOAuth2Token','data5','password','authentication','host','port','tls','autotls','required','handleReady','openBox','handleOpenBox','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','error','handleFetchError'];(function(_0x14cc6a,_0x2b6614){var _0x1f3d51=function(_0x4e51fa){while(--_0x4e51fa){_0x14cc6a['push'](_0x14cc6a['shift']());}};_0x1f3d51(++_0x2b6614);}(_0x3d04,0xbe));var _0x43d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d04[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var Imap=require(_0x43d0('0x2'));var simpleParser=require(_0x43d0('0x3'))[_0x43d0('0x4')];var Iconv=require(_0x43d0('0x5'))[_0x43d0('0x6')];var EventEmitter=require(_0x43d0('0x7'))['EventEmitter'];var utils=require(_0x43d0('0x8'));var logger=require(_0x43d0('0x9'))(_0x43d0('0xa'));function EmailImap(_0x617bf,_0x5e284f){this['mailbox']='INBOX';this['account']=this[_0x43d0('0xb')](_0x617bf,_0x5e284f);this[_0x43d0('0x2')]=new Imap(this[_0x43d0('0xc')]);this[_0x43d0('0x2')][_0x43d0('0xd')]('ready',this['handleReady'][_0x43d0('0xe')](this));this['imap']['once'](_0x43d0('0xf'),this[_0x43d0('0x10')][_0x43d0('0xe')](this));this[_0x43d0('0x2')]['on']('error',this[_0x43d0('0x11')][_0x43d0('0xe')](this));this['imap'][_0x43d0('0x12')]();}util[_0x43d0('0x13')](EmailImap,EventEmitter);EmailImap[_0x43d0('0x14')]['getAccount']=function(_0xd262a8,_0x2454fa){var _0x436130={'connTimeout':_0xd262a8['connTimeout']?_0xd262a8[_0x43d0('0x15')]*0x3e8:0x2710,'authTimeout':_0xd262a8[_0x43d0('0x16')]?_0xd262a8[_0x43d0('0x16')]*0x3e8:0x1388};if(_0xd262a8[_0x43d0('0x17')]){_0x436130[_0x43d0('0x18')]=_0xd262a8['user'];_0x436130['email']=_0x2454fa||_0xd262a8[_0x43d0('0x18')]||_0x43d0('0x19');if(_0xd262a8[_0x43d0('0x1a')]){_0x436130['xoauth2']=utils[_0x43d0('0x1b')](_0xd262a8['CloudProvider'][_0x43d0('0x1c')],_0xd262a8[_0x43d0('0x18')]);}else{_0x436130[_0x43d0('0x1d')]=_0xd262a8['password'];}}else{if(_0xd262a8[_0x43d0('0x1e')]){_0x436130[_0x43d0('0x18')]=_0xd262a8['user'];_0x436130[_0x43d0('0x1d')]=_0xd262a8[_0x43d0('0x1d')];}}_0x436130[_0x43d0('0x1f')]=_0xd262a8[_0x43d0('0x1f')];_0x436130[_0x43d0('0x20')]=_0xd262a8[_0x43d0('0x20')]||0x3e1;if(_0xd262a8[_0x43d0('0x21')]){_0x436130[_0x43d0('0x21')]=!![];}else{_0x436130[_0x43d0('0x21')]=![];_0x436130[_0x43d0('0x22')]=_0x43d0('0x23');}return _0x436130;};EmailImap[_0x43d0('0x14')][_0x43d0('0x24')]=function(){this[_0x43d0('0x2')][_0x43d0('0x25')](this['mailbox'],![],this[_0x43d0('0x26')][_0x43d0('0xe')](this));};EmailImap['prototype'][_0x43d0('0x26')]=function(_0x5456ab,_0x29c111){if(_0x5456ab){this[_0x43d0('0x11')](_0x5456ab,!![]);}else{this['emit'](_0x43d0('0x27'),_0x29c111);this[_0x43d0('0x28')]();}};EmailImap['prototype'][_0x43d0('0x29')]=function(_0x4692bc){if(_0x4692bc){this[_0x43d0('0x11')](_0x4692bc,!![]);}else{this['imap'][_0x43d0('0xf')]();}};EmailImap[_0x43d0('0x14')][_0x43d0('0x28')]=function(){this[_0x43d0('0x2')][_0x43d0('0x2a')]([_0x43d0('0x2b')],this[_0x43d0('0x2c')]['bind'](this));};EmailImap[_0x43d0('0x14')][_0x43d0('0x2c')]=function(_0x6bc471,_0x5f3d38){if(_0x6bc471){this['handleError'](_0x6bc471,!![]);}else{if(_0x5f3d38['length']){try{var _0x3c1ea3=this[_0x43d0('0x2')][_0x43d0('0x2d')](_0x5f3d38,{'bodies':'','markSeen':!![]});_0x3c1ea3['on'](_0x43d0('0x2e'),this[_0x43d0('0x2f')][_0x43d0('0xe')](this));_0x3c1ea3['once'](_0x43d0('0x30'),this[_0x43d0('0x31')][_0x43d0('0xe')](this));_0x3c1ea3[_0x43d0('0xd')](_0x43d0('0xf'),this[_0x43d0('0x32')][_0x43d0('0xe')](this));}catch(_0x1bdd74){logger[_0x43d0('0x30')](_0x1bdd74);}}else{this[_0x43d0('0x2')][_0x43d0('0x33')](!![],this['handleCloseBox'][_0x43d0('0xe')](this));}}};EmailImap[_0x43d0('0x14')][_0x43d0('0x2f')]=function(_0x4058df){_0x4058df['on']('body',this[_0x43d0('0x34')]['bind'](this));_0x4058df[_0x43d0('0xd')](_0x43d0('0x35'),this['handleMessageAttributes'][_0x43d0('0xe')](this));_0x4058df[_0x43d0('0xd')](_0x43d0('0xf'),this[_0x43d0('0x36')][_0x43d0('0xe')](this));};EmailImap[_0x43d0('0x14')][_0x43d0('0x34')]=function(_0x21d26e){simpleParser(_0x21d26e,{'Iconv':Iconv},this[_0x43d0('0x37')][_0x43d0('0xe')](this));};EmailImap[_0x43d0('0x14')]['handleMessageAttributes']=function(){};EmailImap[_0x43d0('0x14')][_0x43d0('0x36')]=function(){};EmailImap[_0x43d0('0x14')][_0x43d0('0x37')]=function(_0x294828,_0x201453){if(_0x294828){logger[_0x43d0('0x30')](_0x294828);}else{var _0xf5b750=this;utils[_0x43d0('0x38')](this[_0x43d0('0xc')],_0x201453,function(_0x235fb2){_0xf5b750[_0x43d0('0x39')](_0x43d0('0xa'),_0x235fb2);});}};EmailImap[_0x43d0('0x14')]['handleFetchEnd']=function(){this[_0x43d0('0x2')][_0x43d0('0x33')](!![],this[_0x43d0('0x29')][_0x43d0('0xe')](this));};EmailImap[_0x43d0('0x14')][_0x43d0('0x31')]=function(_0x420256){this[_0x43d0('0x11')](_0x420256);this['imap']['closeBox'](!![],this[_0x43d0('0x29')]['bind'](this));};EmailImap['prototype'][_0x43d0('0x10')]=function(){this['emit'](_0x43d0('0xf'));};EmailImap['prototype'][_0x43d0('0x11')]=function(_0x51a257,_0x41c002){logger[_0x43d0('0x30')](_0x43d0('0x11'),this['account'][_0x43d0('0xa')],JSON['stringify'](_0x51a257));var _0x19ff9a='';if(_0x51a257){if(_0x51a257['textCode']){_0x19ff9a=_0x51a257['textCode'];}else{for(var _0x32fdcd in _0x51a257){if(_0x51a257[_0x43d0('0x3a')](_0x32fdcd)){_0x19ff9a+=_['upperFirst'](_0x32fdcd)+':\x20'+_0x51a257[_0x32fdcd]+'\x0a';}}}}if(_0x41c002){this[_0x43d0('0x2')][_0x43d0('0xf')]();}else{this[_0x43d0('0x39')](_0x43d0('0x30'),_0x19ff9a);this[_0x43d0('0x39')]('end');}};module[_0x43d0('0x3b')]=EmailImap;
\ No newline at end of file
+var _0x3024=['connTimeout','authTimeout','user','email','anonymous@xcally.com','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','port','tls','required','openBox','mailbox','handleOpenBox','emit','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','stringify','textCode','hasOwnProperty','upperFirst','lodash','util','mailparser','simpleParser','events','./utils','../../../config/logger','INBOX','account','getAccount','imap','once','handleReady','bind','end','handleEnd','error','handleError','connect','prototype'];(function(_0x180e57,_0x393367){var _0x3392a8=function(_0x469e6d){while(--_0x469e6d){_0x180e57['push'](_0x180e57['shift']());}};_0x3392a8(++_0x393367);}(_0x3024,0x64));var _0x4302=function(_0x3b2497,_0x487c52){_0x3b2497=_0x3b2497-0x0;var _0x10394b=_0x3024[_0x3b2497];return _0x10394b;};'use strict';var _=require(_0x4302('0x0'));var util=require(_0x4302('0x1'));var Imap=require('imap');var simpleParser=require(_0x4302('0x2'))[_0x4302('0x3')];var Iconv=require('iconv')['Iconv'];var EventEmitter=require(_0x4302('0x4'))['EventEmitter'];var utils=require(_0x4302('0x5'));var logger=require(_0x4302('0x6'))('email');function EmailImap(_0x13d051,_0x5f20){this['mailbox']=_0x4302('0x7');this[_0x4302('0x8')]=this[_0x4302('0x9')](_0x13d051,_0x5f20);this[_0x4302('0xa')]=new Imap(this[_0x4302('0x8')]);this[_0x4302('0xa')][_0x4302('0xb')]('ready',this[_0x4302('0xc')][_0x4302('0xd')](this));this[_0x4302('0xa')]['once'](_0x4302('0xe'),this[_0x4302('0xf')]['bind'](this));this[_0x4302('0xa')]['on'](_0x4302('0x10'),this[_0x4302('0x11')]['bind'](this));this[_0x4302('0xa')][_0x4302('0x12')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x4302('0x13')][_0x4302('0x9')]=function(_0x2b9821,_0x5b19ca){var _0x1b254c={'connTimeout':_0x2b9821[_0x4302('0x14')]?_0x2b9821['connTimeout']*0x3e8:0x2710,'authTimeout':_0x2b9821[_0x4302('0x15')]?_0x2b9821[_0x4302('0x15')]*0x3e8:0x1388};if(_0x2b9821['service']){_0x1b254c[_0x4302('0x16')]=_0x2b9821[_0x4302('0x16')];_0x1b254c[_0x4302('0x17')]=_0x5b19ca||_0x2b9821[_0x4302('0x16')]||_0x4302('0x18');if(_0x2b9821[_0x4302('0x19')]){_0x1b254c[_0x4302('0x1a')]=utils[_0x4302('0x1b')](_0x2b9821[_0x4302('0x1c')][_0x4302('0x1d')],_0x2b9821[_0x4302('0x16')]);}else{_0x1b254c[_0x4302('0x1e')]=_0x2b9821[_0x4302('0x1e')];}}else{if(_0x2b9821[_0x4302('0x1f')]){_0x1b254c['user']=_0x2b9821[_0x4302('0x16')];_0x1b254c['password']=_0x2b9821[_0x4302('0x1e')];}}_0x1b254c['host']=_0x2b9821['host'];_0x1b254c[_0x4302('0x20')]=_0x2b9821[_0x4302('0x20')]||0x3e1;if(_0x2b9821[_0x4302('0x21')]){_0x1b254c[_0x4302('0x21')]=!![];}else{_0x1b254c['tls']=![];_0x1b254c['autotls']=_0x4302('0x22');}return _0x1b254c;};EmailImap[_0x4302('0x13')][_0x4302('0xc')]=function(){this['imap'][_0x4302('0x23')](this[_0x4302('0x24')],![],this[_0x4302('0x25')][_0x4302('0xd')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x481a9d,_0x5a2952){if(_0x481a9d){this[_0x4302('0x11')](_0x481a9d,!![]);}else{this[_0x4302('0x26')]('box',_0x5a2952);this[_0x4302('0x27')]();}};EmailImap[_0x4302('0x13')][_0x4302('0x28')]=function(_0x5407b3){if(_0x5407b3){this[_0x4302('0x11')](_0x5407b3,!![]);}else{this['imap']['end']();}};EmailImap['prototype'][_0x4302('0x27')]=function(){this['imap'][_0x4302('0x29')]([_0x4302('0x2a')],this['handleReadUnseen'][_0x4302('0xd')](this));};EmailImap['prototype'][_0x4302('0x2b')]=function(_0x42abf4,_0x35ae42){if(_0x42abf4){this[_0x4302('0x11')](_0x42abf4,!![]);}else{if(_0x35ae42[_0x4302('0x2c')]){try{var _0x45474f=this[_0x4302('0xa')][_0x4302('0x2d')](_0x35ae42,{'bodies':'','markSeen':!![]});_0x45474f['on'](_0x4302('0x2e'),this['handleFetchMessage'][_0x4302('0xd')](this));_0x45474f[_0x4302('0xb')](_0x4302('0x10'),this[_0x4302('0x2f')]['bind'](this));_0x45474f[_0x4302('0xb')](_0x4302('0xe'),this[_0x4302('0x30')][_0x4302('0xd')](this));}catch(_0x31fa2c){logger['error'](_0x31fa2c);}}else{this[_0x4302('0xa')][_0x4302('0x31')](!![],this[_0x4302('0x28')][_0x4302('0xd')](this));}}};EmailImap[_0x4302('0x13')][_0x4302('0x32')]=function(_0x42c99e){_0x42c99e['on'](_0x4302('0x33'),this[_0x4302('0x34')]['bind'](this));_0x42c99e[_0x4302('0xb')]('attributes',this[_0x4302('0x35')]['bind'](this));_0x42c99e['once'](_0x4302('0xe'),this[_0x4302('0x36')][_0x4302('0xd')](this));};EmailImap['prototype'][_0x4302('0x34')]=function(_0x21974c){simpleParser(_0x21974c,{'Iconv':Iconv},this[_0x4302('0x37')][_0x4302('0xd')](this));};EmailImap['prototype'][_0x4302('0x35')]=function(){};EmailImap['prototype'][_0x4302('0x36')]=function(){};EmailImap[_0x4302('0x13')][_0x4302('0x37')]=function(_0x31e786,_0xffd1ca){if(_0x31e786){logger['error'](_0x31e786);}else{var _0x4748d9=this;utils['parser'](this['account'],_0xffd1ca,function(_0x59d3de){_0x4748d9[_0x4302('0x26')](_0x4302('0x17'),_0x59d3de);});}};EmailImap[_0x4302('0x13')][_0x4302('0x30')]=function(){this[_0x4302('0xa')][_0x4302('0x31')](!![],this[_0x4302('0x28')][_0x4302('0xd')](this));};EmailImap[_0x4302('0x13')][_0x4302('0x2f')]=function(_0x4b8275){this['handleError'](_0x4b8275);this[_0x4302('0xa')][_0x4302('0x31')](!![],this[_0x4302('0x28')][_0x4302('0xd')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x4302('0x26')](_0x4302('0xe'));};EmailImap[_0x4302('0x13')][_0x4302('0x11')]=function(_0x380b4d,_0x3469b0){logger['error'](_0x4302('0x11'),this['account'][_0x4302('0x17')],JSON[_0x4302('0x38')](_0x380b4d));var _0x30f0e7='';if(_0x380b4d){if(_0x380b4d[_0x4302('0x39')]){_0x30f0e7=_0x380b4d['textCode'];}else{for(var _0x368256 in _0x380b4d){if(_0x380b4d[_0x4302('0x3a')](_0x368256)){_0x30f0e7+=_[_0x4302('0x3b')](_0x368256)+':\x20'+_0x380b4d[_0x368256]+'\x0a';}}}}if(_0x3469b0){this[_0x4302('0xa')][_0x4302('0xe')]();}else{this['emit'](_0x4302('0x10'),_0x30f0e7);this[_0x4302('0x26')]('end');}};module['exports']=EmailImap;
\ No newline at end of file
index fa4fe4d..46d4e4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e73=['compile','sendMail','toString','verify','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','use'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x6e73,0x113));var _0x36e7=function(_0x166654,_0x3dc286){_0x166654=_0x166654-0x0;var _0x4a8dc1=_0x6e73[_0x166654];return _0x4a8dc1;};'use strict';var nodemailer=require(_0x36e7('0x0'));var inlineBase64=require(_0x36e7('0x1'));function EmailSmtp(){}EmailSmtp[_0x36e7('0x2')][_0x36e7('0x3')]=function(_0x3fc681,_0x101209){return new Promise(function(_0x30e2aa,_0x1f949b){var _0x58851b=nodemailer['createTransport'](_0x3fc681);_0x58851b[_0x36e7('0x4')](_0x36e7('0x5'),inlineBase64());_0x58851b[_0x36e7('0x6')](_0x101209,function(_0x24186d,_0x363453){if(_0x24186d){_0x1f949b(_0x24186d[_0x36e7('0x7')]());}else{_0x30e2aa(_0x363453);}});});};EmailSmtp[_0x36e7('0x2')][_0x36e7('0x8')]=function(_0x3f2e9a){return new Promise(function(_0x349943,_0x5419c9){var _0x476d9d=nodemailer['createTransport'](_0x3f2e9a);_0x476d9d[_0x36e7('0x8')](function(_0x25e221,_0x56b901){if(_0x25e221){_0x5419c9(_0x25e221[_0x36e7('0x7')]());}else{if(_0x56b901){_0x349943(_0x56b901);}else{_0x5419c9('Not\x20verifired');}}});});};module[_0x36e7('0x9')]=EmailSmtp;
\ No newline at end of file
+var _0x399d=['use','compile','sendMail','toString','prototype','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','send','createTransport'];(function(_0x421eeb,_0x3d3e3e){var _0x2c7371=function(_0x174b74){while(--_0x174b74){_0x421eeb['push'](_0x421eeb['shift']());}};_0x2c7371(++_0x3d3e3e);}(_0x399d,0x1d0));var _0xd399=function(_0x33b4f8,_0x2c2a4e){_0x33b4f8=_0x33b4f8-0x0;var _0x4d518d=_0x399d[_0x33b4f8];return _0x4d518d;};'use strict';var nodemailer=require(_0xd399('0x0'));var inlineBase64=require(_0xd399('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0xd399('0x2')]=function(_0x104898,_0x1a8103){return new Promise(function(_0x2cd883,_0x41d2a4){var _0x3c7d32=nodemailer[_0xd399('0x3')](_0x104898);_0x3c7d32[_0xd399('0x4')](_0xd399('0x5'),inlineBase64());_0x3c7d32[_0xd399('0x6')](_0x1a8103,function(_0x21fc13,_0x5e0976){if(_0x21fc13){_0x41d2a4(_0x21fc13[_0xd399('0x7')]());}else{_0x2cd883(_0x5e0976);}});});};EmailSmtp[_0xd399('0x8')]['verify']=function(_0x4073f3){return new Promise(function(_0xae0534,_0xf43906){var _0x49d499=nodemailer[_0xd399('0x3')](_0x4073f3);_0x49d499[_0xd399('0x9')](function(_0x2d2102,_0x58cfcc){if(_0x2d2102){_0xf43906(_0x2d2102[_0xd399('0x7')]());}else{if(_0x58cfcc){_0xae0534(_0x58cfcc);}else{_0xf43906(_0xd399('0xa'));}}});});};module[_0xd399('0xb')]=EmailSmtp;
\ No newline at end of file
index 4d50008..33e4316 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x758a=['%s-%s','now','root','writeFileSync','content','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','format','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','<p>Empty\x20message</p>','Attachments','generateXOAuth2Token','auth=Bearer\x20','utf-8','toString','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','@xcally.com','name','substring','split','length','slice','join','value','pop','isEmpty','generate','html','test','replace','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','originCc','includes','bcc','attachments','type','attachment-'];(function(_0x34ea1e,_0x152007){var _0xcb6be2=function(_0x54004e){while(--_0x54004e){_0x34ea1e['push'](_0x34ea1e['shift']());}};_0xcb6be2(++_0x152007);}(_0x758a,0x182));var _0xa758=function(_0x41773a,_0x4a39d8){_0x41773a=_0x41773a-0x0;var _0x55f9ec=_0x758a[_0x41773a];return _0x55f9ec;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0xa758('0x0'));var fs=require('fs');var path=require(_0xa758('0x1'));var util=require(_0xa758('0x2'));var tnef=require(_0xa758('0x3'));var logger=require(_0xa758('0x4'))(_0xa758('0x5'));var config=require(_0xa758('0x6'));function getAddress(_0x534470){var _0x1c64e=_[_0xa758('0x7')](_0x534470['value']);return _0x1c64e&&_0x1c64e[_0xa758('0x8')]?_0x1c64e[_0xa758('0x8')]:_0xa758('0x9')+random['generate'](0x6)+_0xa758('0xa');}function getFirstName(_0x176e9f){var _0x5329d1=_[_0xa758('0x7')](_0x176e9f['value']);if(_0x5329d1&&_0x5329d1['name']){if(_0x5329d1[_0xa758('0xb')]==_0x5329d1[_0xa758('0x8')]){return _0x5329d1[_0xa758('0xb')][_0xa758('0xc')](0x0,_0x5329d1['name']['indexOf']('@'));}var _0xd80d88=_0x5329d1[_0xa758('0xb')][_0xa758('0xd')](/\s+/);return _0xd80d88[_0xa758('0xe')]>0x1?_0xd80d88[_0xa758('0xf')](0x0,-0x1)[_0xa758('0x10')]('\x20'):_0x5329d1[_0xa758('0xb')];}return'Anonymous';}function getLastName(_0x4966bb){var _0x4beaf7=_[_0xa758('0x7')](_0x4966bb[_0xa758('0x11')]);if(_0x4beaf7&&_0x4beaf7[_0xa758('0xb')]){var _0x1609b3=_0x4beaf7[_0xa758('0xb')][_0xa758('0xd')](/\s+/);return _0x1609b3[_0xa758('0xe')]>0x1?_0x1609b3[_0xa758('0x12')]():'';}return'';}function getMails(_0x3c47e1,_0x3bb9ec){var _0x1557eb='';for(var _0x36803c=0x0;_0x36803c<_0x3bb9ec[_0xa758('0x11')][_0xa758('0xe')];_0x36803c+=0x1){if(_0x3bb9ec[_0xa758('0x11')][_0x36803c][_0xa758('0x8')]!==_0x3c47e1){if(!_[_0xa758('0x13')](_0x1557eb)){_0x1557eb+=',';}_0x1557eb+=_0x3bb9ec[_0xa758('0x11')][_0x36803c][_0xa758('0xb')]||_0x3bb9ec[_0xa758('0x11')][_0x36803c]['address']||'';_0x1557eb+='\x20<';_0x1557eb+=_0x3bb9ec[_0xa758('0x11')][_0x36803c][_0xa758('0x8')]?_0x3bb9ec[_0xa758('0x11')][_0x36803c]['address']:'anonymous'+random[_0xa758('0x14')](0x6)+_0xa758('0xa');_0x1557eb+='>';}}return _0x1557eb;}function parseEmail(_0x45254a,_0x548de6,_0x23ed22){if(_0x548de6[_0xa758('0x15')]){var _0x1cf738=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x1cf738[_0xa758('0x16')](_0x548de6[_0xa758('0x15')])){_0x548de6[_0xa758('0x15')]=_0x548de6[_0xa758('0x15')][_0xa758('0x17')](_0x1cf738,'');}if(_0x548de6[_0xa758('0x15')]['includes']('<img')){var _0x598073=[];_0x548de6['attachments']['forEach'](_0x4e7923=>{_0x598073['push'](_0x4e7923[_0xa758('0x18')]);});var _0x7565df=/<img.*? _SRC(.*?)[^>]+>/g;var _0x33e3bc=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x58feb4=_0x548de6[_0xa758('0x15')][_0xa758('0x17')](_0x33e3bc,_0xa758('0x19'));var _0x53b126=_0x58feb4[_0xa758('0x17')](_0x7565df,_0xa758('0x1a'));for(let _0x2da32f=0x0;_0x2da32f<_0x598073[_0xa758('0xe')];_0x2da32f++){var _0x2f9c24=_0x53b126[_0xa758('0x17')](_0xa758('0x1a'),_0xa758('0x1b')+_0x598073[_0x2da32f]+_0xa758('0x1c'));_0x53b126=_0x2f9c24;}_0x548de6['html']=_0x53b126;}_0x23ed22['body']=_0x548de6['html'];}else{_0x23ed22[_0xa758('0x1d')]=_0x548de6[_0xa758('0x1e')];}if(_0x23ed22[_0xa758('0x1d')]){_0x23ed22[_0xa758('0x1d')]=_0x23ed22['body']['replace'](/<a\s+/gi,_0xa758('0x1f'));}if(_0x548de6['to']){_0x23ed22[_0xa758('0x20')][_0xa758('0x21')]=getMails(null,_0x548de6['to']);var _0x37e9aa=getMails(_0x45254a[_0xa758('0x5')],_0x548de6['to']);if(!_['isEmpty'](_0x37e9aa)){_0x23ed22['message']['cc']+=_0x37e9aa;}}if(_0x548de6['cc']){_0x23ed22[_0xa758('0x20')][_0xa758('0x22')]=getMails(null,_0x548de6['cc']);var _0x171e7d=getMails(_0x45254a[_0xa758('0x5')],_0x548de6['cc']);if(!_[_0xa758('0x13')](_0x171e7d)){if(!_[_0xa758('0x13')](_0x23ed22['message']['cc'])){_0x23ed22[_0xa758('0x20')]['cc']+=',';}_0x23ed22[_0xa758('0x20')]['cc']+=_0x171e7d;}}if(!_[_0xa758('0x23')](_0x23ed22['message'][_0xa758('0x21')],_0x45254a[_0xa758('0x5')])&&!_[_0xa758('0x23')](_0x23ed22['message'][_0xa758('0x22')],_0x45254a[_0xa758('0x5')])){_0x23ed22['message'][_0xa758('0x24')]=_0x45254a['email'];}if(_0x548de6[_0xa758('0x25')]&&_0x548de6['attachments'][_0xa758('0xe')]){_0x23ed22[_0xa758('0x20')]['attach']=_0x548de6[_0xa758('0x25')][_0xa758('0xe')];for(var _0x12d206=0x0,_0x272900,_0x491f3e,_0x3b1351;_0x12d206<_0x548de6[_0xa758('0x25')]['length'];_0x12d206+=0x1){if(_0x548de6[_0xa758('0x25')][_0x12d206][_0xa758('0x26')]==='attachment'){_0x3b1351=_0x548de6[_0xa758('0x25')][_0x12d206][_0xa758('0x18')]||_0xa758('0x27')+_0x12d206;_0x272900=util['format'](_0xa758('0x28'),Date[_0xa758('0x29')](),_0x3b1351);_0x491f3e=path[_0xa758('0x10')](config[_0xa758('0x2a')],'server/files/attachments/',_0x272900);fs[_0xa758('0x2b')](_0x491f3e,_0x548de6[_0xa758('0x25')][_0x12d206][_0xa758('0x2c')]);_0x23ed22[_0xa758('0x20')][_0xa758('0x25')][_0xa758('0x2d')]({'name':_0x3b1351,'basename':_0x272900,'type':_0x548de6[_0xa758('0x25')][_0x12d206][_0xa758('0x2e')],'filepath':_0x491f3e});}}}if(_0x548de6[_0xa758('0x2f')]&&_0x548de6[_0xa758('0x2f')]['length']>0x0){var _0x421f21=[_0xa758('0x30'),_0xa758('0x31'),'Precedence:\x20auto_reply'];for(var _0x1b3bee=0x0;_0x1b3bee<_0x548de6[_0xa758('0x2f')][_0xa758('0xe')];_0x1b3bee++){var _0x4721dc=_['indexOf'](_0x421f21,_0x548de6['headerLines'][_0x1b3bee]['line']);if(_0x4721dc>=0x0){_0x23ed22[_0xa758('0x32')]=!![];}}}return _0x23ed22;}exports[_0xa758('0x33')]=function(_0x193967,_0x58b5bb,_0xe372a4){var _0x18d65b={'from':getAddress(_0x58b5bb[_0xa758('0x34')]),'firstName':getFirstName(_0x58b5bb[_0xa758('0x34')]),'lastName':getLastName(_0x58b5bb['from']),'mapKey':'email','message':{'from':getMails(_0x193967[_0xa758('0x5')],_0x58b5bb['from']),'to':_0x193967[_0xa758('0x5')],'cc':'','subject':_0x58b5bb[_0xa758('0x35')]||'','messageId':_0x58b5bb[_0xa758('0x36')],'inReplyTo':_0x58b5bb[_0xa758('0x37')],'sentAt':moment(_0x58b5bb[_0xa758('0x38')])['format'](_0xa758('0x39')),'attach':![],'attachments':[]}};if(!_0x58b5bb[_0xa758('0x15')]&&!_0x58b5bb[_0xa758('0x1e')]){var _0x4654d8=_[_0xa758('0x3a')](_0x58b5bb['attachments'],{'contentType':_0xa758('0x3b')});if(_0x4654d8[_0xa758('0xe')]){logger[_0xa758('0x3c')](util[_0xa758('0x3d')](_0xa758('0x3e'),_0x58b5bb['messageId']));tnef[_0xa758('0x3f')](_[_0xa758('0x40')](_0x4654d8)[_0xa758('0x2c')],function(_0x113254,_0xbf378c){if(_0xbf378c){_0x58b5bb[_0xa758('0x15')]=_0xbf378c['BodyHTML']||_0xa758('0x41');if(_0xbf378c[_0xa758('0x42')]){for(var _0x33be30=0x0;_0x33be30<_0xbf378c[_0xa758('0x42')][_0xa758('0xe')];_0x33be30++){var _0x392036=_0xbf378c[_0xa758('0x42')][_0x33be30];_0x18d65b[_0xa758('0x20')]['attachments'][_0xa758('0x2d')]({'filename':_0x392036['Title'],'content':Buffer[_0xa758('0x34')](_0x392036['Data'])});}}}_0xe372a4(parseEmail(_0x193967,_0x58b5bb,_0x18d65b));});}else{_0x58b5bb[_0xa758('0x15')]='<p>Empty\x20message</p>';_0xe372a4(parseEmail(_0x193967,_0x58b5bb,_0x18d65b));}}else{_0xe372a4(parseEmail(_0x193967,_0x58b5bb,_0x18d65b));}};exports[_0xa758('0x43')]=function(_0x7fc4ee,_0x4d0fe9){var _0x3e94d7=['user='+(_0x4d0fe9||''),_0xa758('0x44')+_0x7fc4ee,'',''];return Buffer[_0xa758('0x34')](_0x3e94d7[_0xa758('0x10')]('\ 1'),_0xa758('0x45'))[_0xa758('0x46')]('base64');};
\ No newline at end of file
+var _0x93c7=['generate','name','indexOf','split','length','slice','join','Anonymous','test','html','replace','includes','<img','attachments','filename','_SRC','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','<a\x20target=\x22_blank\x22\x20','message','originTo','email','isEmpty','originCc','bcc','attach','type','attachment','attachment-','format','now','root','server/files/attachments/','writeFileSync','push','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','application/ms-tnef','first','content','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','generateXOAuth2Token','user=','utf-8','base64','lodash','randomstring','path','util','../../../config/logger','../../../config/environment','head','value','address','anonymous'];(function(_0x154037,_0x1dd1d9){var _0x208857=function(_0x57ecf3){while(--_0x57ecf3){_0x154037['push'](_0x154037['shift']());}};_0x208857(++_0x1dd1d9);}(_0x93c7,0xc8));var _0x793c=function(_0x4e678e,_0x4b85ed){_0x4e678e=_0x4e678e-0x0;var _0x369606=_0x93c7[_0x4e678e];return _0x369606;};'use strict';var _=require(_0x793c('0x0'));var moment=require('moment');var random=require(_0x793c('0x1'));var fs=require('fs');var path=require(_0x793c('0x2'));var util=require(_0x793c('0x3'));var tnef=require('node-tnef');var logger=require(_0x793c('0x4'))('email');var config=require(_0x793c('0x5'));function getAddress(_0x4d4c0b){var _0x31db3d=_[_0x793c('0x6')](_0x4d4c0b[_0x793c('0x7')]);return _0x31db3d&&_0x31db3d['address']?_0x31db3d[_0x793c('0x8')]:_0x793c('0x9')+random[_0x793c('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x28dae3){var _0x256711=_[_0x793c('0x6')](_0x28dae3[_0x793c('0x7')]);if(_0x256711&&_0x256711[_0x793c('0xb')]){if(_0x256711[_0x793c('0xb')]==_0x256711['address']){return _0x256711[_0x793c('0xb')]['substring'](0x0,_0x256711[_0x793c('0xb')][_0x793c('0xc')]('@'));}var _0x10b9f2=_0x256711[_0x793c('0xb')][_0x793c('0xd')](/\s+/);return _0x10b9f2[_0x793c('0xe')]>0x1?_0x10b9f2[_0x793c('0xf')](0x0,-0x1)[_0x793c('0x10')]('\x20'):_0x256711[_0x793c('0xb')];}return _0x793c('0x11');}function getLastName(_0x26dec9){var _0x1eb07d=_[_0x793c('0x6')](_0x26dec9[_0x793c('0x7')]);if(_0x1eb07d&&_0x1eb07d[_0x793c('0xb')]){var _0x186bd6=_0x1eb07d['name'][_0x793c('0xd')](/\s+/);return _0x186bd6['length']>0x1?_0x186bd6['pop']():'';}return'';}function getMails(_0xccb8bf,_0x27cfbc){var _0x440418='';for(var _0x36b96c=0x0;_0x36b96c<_0x27cfbc['value'][_0x793c('0xe')];_0x36b96c+=0x1){if(_0x27cfbc[_0x793c('0x7')][_0x36b96c][_0x793c('0x8')]!==_0xccb8bf){if(!_['isEmpty'](_0x440418)){_0x440418+=',';}_0x440418+=_0x27cfbc[_0x793c('0x7')][_0x36b96c][_0x793c('0xb')]||_0x27cfbc['value'][_0x36b96c][_0x793c('0x8')]||'';_0x440418+='\x20<';_0x440418+=_0x27cfbc[_0x793c('0x7')][_0x36b96c]['address']?_0x27cfbc['value'][_0x36b96c][_0x793c('0x8')]:_0x793c('0x9')+random['generate'](0x6)+'@xcally.com';_0x440418+='>';}}return _0x440418;}function parseEmail(_0x2ee0e0,_0x372e21,_0x512f72){if(_0x372e21['html']){var _0x18f017=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x18f017[_0x793c('0x12')](_0x372e21[_0x793c('0x13')])){_0x372e21[_0x793c('0x13')]=_0x372e21[_0x793c('0x13')][_0x793c('0x14')](_0x18f017,'');}if(_0x372e21[_0x793c('0x13')][_0x793c('0x15')](_0x793c('0x16'))){var _0x348838=[];_0x372e21[_0x793c('0x17')]['forEach'](_0x2e836a=>{_0x348838['push'](_0x2e836a[_0x793c('0x18')]);});var _0x5682d5=/<img.*? _SRC(.*?)[^>]+>/g;var _0x298dea=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1a8ce0=_0x372e21['html'][_0x793c('0x14')](_0x298dea,_0x793c('0x19'));var _0x58b714=_0x1a8ce0[_0x793c('0x14')](_0x5682d5,'_IMG');for(let _0x20479e=0x0;_0x20479e<_0x348838[_0x793c('0xe')];_0x20479e++){var _0x8778ac=_0x58b714[_0x793c('0x14')]('_IMG',_0x793c('0x1a')+_0x348838[_0x20479e]+_0x793c('0x1b'));_0x58b714=_0x8778ac;}_0x372e21[_0x793c('0x13')]=_0x58b714;}_0x512f72[_0x793c('0x1c')]=_0x372e21[_0x793c('0x13')];}else{_0x512f72[_0x793c('0x1c')]=_0x372e21['textAsHtml'];}if(_0x512f72[_0x793c('0x1c')]){_0x512f72[_0x793c('0x1c')]=_0x512f72['body']['replace'](/<a\s+/gi,_0x793c('0x1d'));}if(_0x372e21['to']){_0x512f72[_0x793c('0x1e')][_0x793c('0x1f')]=getMails(null,_0x372e21['to']);var _0x4ff88e=getMails(_0x2ee0e0[_0x793c('0x20')],_0x372e21['to']);if(!_[_0x793c('0x21')](_0x4ff88e)){_0x512f72['message']['cc']+=_0x4ff88e;}}if(_0x372e21['cc']){_0x512f72[_0x793c('0x1e')][_0x793c('0x22')]=getMails(null,_0x372e21['cc']);var _0x4f39ff=getMails(_0x2ee0e0[_0x793c('0x20')],_0x372e21['cc']);if(!_[_0x793c('0x21')](_0x4f39ff)){if(!_[_0x793c('0x21')](_0x512f72[_0x793c('0x1e')]['cc'])){_0x512f72[_0x793c('0x1e')]['cc']+=',';}_0x512f72[_0x793c('0x1e')]['cc']+=_0x4f39ff;}}if(!_[_0x793c('0x15')](_0x512f72[_0x793c('0x1e')][_0x793c('0x1f')],_0x2ee0e0['email'])&&!_[_0x793c('0x15')](_0x512f72['message'][_0x793c('0x22')],_0x2ee0e0[_0x793c('0x20')])){_0x512f72[_0x793c('0x1e')][_0x793c('0x23')]=_0x2ee0e0['email'];}if(_0x372e21[_0x793c('0x17')]&&_0x372e21['attachments']['length']){_0x512f72[_0x793c('0x1e')][_0x793c('0x24')]=_0x372e21[_0x793c('0x17')][_0x793c('0xe')];for(var _0x289f7d=0x0,_0x420a04,_0x42c90c,_0x57da1d;_0x289f7d<_0x372e21[_0x793c('0x17')][_0x793c('0xe')];_0x289f7d+=0x1){if(_0x372e21[_0x793c('0x17')][_0x289f7d][_0x793c('0x25')]===_0x793c('0x26')){_0x57da1d=_0x372e21[_0x793c('0x17')][_0x289f7d][_0x793c('0x18')]||_0x793c('0x27')+_0x289f7d;_0x420a04=util[_0x793c('0x28')]('%s-%s',Date[_0x793c('0x29')](),_0x57da1d);_0x42c90c=path['join'](config[_0x793c('0x2a')],_0x793c('0x2b'),_0x420a04);fs[_0x793c('0x2c')](_0x42c90c,_0x372e21[_0x793c('0x17')][_0x289f7d]['content']);_0x512f72[_0x793c('0x1e')][_0x793c('0x17')][_0x793c('0x2d')]({'name':_0x57da1d,'basename':_0x420a04,'type':_0x372e21[_0x793c('0x17')][_0x289f7d]['contentType'],'filepath':_0x42c90c});}}}if(_0x372e21[_0x793c('0x2e')]&&_0x372e21['headerLines']['length']>0x0){var _0x245dc0=[_0x793c('0x2f'),_0x793c('0x30'),_0x793c('0x31')];for(var _0x556d9c=0x0;_0x556d9c<_0x372e21[_0x793c('0x2e')]['length'];_0x556d9c++){var _0x10f5c6=_[_0x793c('0xc')](_0x245dc0,_0x372e21[_0x793c('0x2e')][_0x556d9c][_0x793c('0x32')]);if(_0x10f5c6>=0x0){_0x512f72[_0x793c('0x33')]=!![];}}}return _0x512f72;}exports[_0x793c('0x34')]=function(_0x1adb4c,_0x160bd8,_0x16d58c){var _0x7f0c12={'from':getAddress(_0x160bd8[_0x793c('0x35')]),'firstName':getFirstName(_0x160bd8[_0x793c('0x35')]),'lastName':getLastName(_0x160bd8[_0x793c('0x35')]),'mapKey':_0x793c('0x20'),'message':{'from':getMails(_0x1adb4c[_0x793c('0x20')],_0x160bd8['from']),'to':_0x1adb4c[_0x793c('0x20')],'cc':'','subject':_0x160bd8['subject']||'','messageId':_0x160bd8[_0x793c('0x36')],'inReplyTo':_0x160bd8[_0x793c('0x37')],'sentAt':moment(_0x160bd8[_0x793c('0x38')])[_0x793c('0x28')](_0x793c('0x39')),'attach':![],'attachments':[]}};if(!_0x160bd8[_0x793c('0x13')]&&!_0x160bd8[_0x793c('0x3a')]){var _0x53b5a2=_['filter'](_0x160bd8['attachments'],{'contentType':_0x793c('0x3b')});if(_0x53b5a2[_0x793c('0xe')]){logger['info'](util[_0x793c('0x28')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x160bd8[_0x793c('0x36')]));tnef['parseBuffer'](_[_0x793c('0x3c')](_0x53b5a2)[_0x793c('0x3d')],function(_0x3fe5c7,_0x4c2a9d){if(_0x4c2a9d){_0x160bd8[_0x793c('0x13')]=_0x4c2a9d[_0x793c('0x3e')]||_0x793c('0x3f');if(_0x4c2a9d[_0x793c('0x40')]){for(var _0x129859=0x0;_0x129859<_0x4c2a9d['Attachments']['length'];_0x129859++){var _0x18504a=_0x4c2a9d['Attachments'][_0x129859];_0x7f0c12[_0x793c('0x1e')][_0x793c('0x17')][_0x793c('0x2d')]({'filename':_0x18504a[_0x793c('0x41')],'content':Buffer[_0x793c('0x35')](_0x18504a['Data'])});}}}_0x16d58c(parseEmail(_0x1adb4c,_0x160bd8,_0x7f0c12));});}else{_0x160bd8[_0x793c('0x13')]=_0x793c('0x3f');_0x16d58c(parseEmail(_0x1adb4c,_0x160bd8,_0x7f0c12));}}else{_0x16d58c(parseEmail(_0x1adb4c,_0x160bd8,_0x7f0c12));}};exports[_0x793c('0x42')]=function(_0x20a602,_0x30fc19){var _0x498e76=[_0x793c('0x43')+(_0x30fc19||''),'auth=Bearer\x20'+_0x20a602,'',''];return Buffer[_0x793c('0x35')](_0x498e76[_0x793c('0x10')]('\ 1'),_0x793c('0x44'))['toString'](_0x793c('0x45'));};
\ No newline at end of file
index aff26e8..88d3081 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9fc=['Service','key','active','Smtp','exports','name'];(function(_0x1a0139,_0xf3f49b){var _0x111033=function(_0x4ce1ae){while(--_0x4ce1ae){_0x1a0139['push'](_0x1a0139['shift']());}};_0x111033(++_0xf3f49b);}(_0xb9fc,0x1d9));var _0xcb9f=function(_0x423d08,_0x578eac){_0x423d08=_0x423d08-0x0;var _0x48491a=_0xb9fc[_0x423d08];return _0x48491a;};'use strict';var _=require('lodash');function MailAccount(_0x58dfc3){this['id']=_0x58dfc3['id']||0x0;this['name']=_0x58dfc3[_0xcb9f('0x0')]||_0xcb9f('0x1');this[_0xcb9f('0x2')]=_0x58dfc3['key']||'SERV';this['active']=_0x58dfc3[_0xcb9f('0x3')]||![];this['Imap']=_0x58dfc3['Imap']||[];this['Smtp']=_0x58dfc3[_0xcb9f('0x4')]||[];}module[_0xcb9f('0x5')]=MailAccount;
\ No newline at end of file
+var _0x9955=['SERV','Imap','Smtp','exports','lodash','name','Service','key'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x9955,0xb4));var _0x5995=function(_0x1ebaac,_0x5ffa48){_0x1ebaac=_0x1ebaac-0x0;var _0x517866=_0x9955[_0x1ebaac];return _0x517866;};'use strict';var _=require(_0x5995('0x0'));function MailAccount(_0x745af4){this['id']=_0x745af4['id']||0x0;this[_0x5995('0x1')]=_0x745af4[_0x5995('0x1')]||_0x5995('0x2');this[_0x5995('0x3')]=_0x745af4[_0x5995('0x3')]||_0x5995('0x4');this['active']=_0x745af4['active']||![];this[_0x5995('0x5')]=_0x745af4['Imap']||[];this[_0x5995('0x6')]=_0x745af4[_0x5995('0x6')]||[];}module[_0x5995('0x7')]=MailAccount;
\ No newline at end of file
index 436ad2e..765fc8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92cc=['length','isUndefined','merge','lodash','../model/mailAccount','mailAccounts','mapKeys','prototype','mergeFromDatabase','initMailAccounts'];(function(_0x14ce12,_0x3f0dc6){var _0x21819b=function(_0x5e80d9){while(--_0x5e80d9){_0x14ce12['push'](_0x14ce12['shift']());}};_0x21819b(++_0x3f0dc6);}(_0x92cc,0x17f));var _0xc92c=function(_0xaf59e8,_0x53f007){_0xaf59e8=_0xaf59e8-0x0;var _0x4e83b5=_0x92cc[_0xaf59e8];return _0x4e83b5;};'use strict';var _=require(_0xc92c('0x0'));var MailAccount=require(_0xc92c('0x1'));var Realtime=function(){this[_0xc92c('0x2')]={};};function freeIsNotKey(_0x36c966,_0x43ce55,_0x48ee1a){var _0x4f1683=_[_0xc92c('0x3')](_0x36c966,function(_0xf0f6df,_0x184e0b){return _0xf0f6df[_0x48ee1a];});for(var _0x5d535a in _0x43ce55){if(_0x43ce55['hasOwnProperty'](_0x5d535a)){if(!_0x4f1683[_0x5d535a]){delete _0x43ce55[_0x5d535a];}}}}Realtime[_0xc92c('0x4')][_0xc92c('0x5')]=function(_0x270ee3,_0x2c01ff){for(var _0x46b202 in _0x2c01ff){if(_0x270ee3['hasOwnProperty'](_0x46b202)){_0x270ee3[_0x46b202]=_0x2c01ff[_0x46b202];}}};Realtime[_0xc92c('0x4')][_0xc92c('0x6')]=function(){var _0x7083a0=this;return function(_0x4be984){if(_0x4be984){freeIsNotKey(_0x4be984,_0x7083a0[_0xc92c('0x2')],'id');for(var _0x5221d2=0x0,_0x25d2ba={},_0x17cbfd={};_0x5221d2<_0x4be984[_0xc92c('0x7')];_0x5221d2+=0x1){_0x25d2ba=_0x4be984[_0x5221d2];if(_[_0xc92c('0x8')](_0x7083a0['mailAccounts'][_0x25d2ba['id']])){_0x7083a0[_0xc92c('0x2')][_0x25d2ba['id']]=new MailAccount(_0x25d2ba);}else{_[_0xc92c('0x9')](_0x7083a0[_0xc92c('0x2')][_0x25d2ba['id']],_0x25d2ba);}}}return _0x7083a0[_0xc92c('0x2')];};};module['exports']=Realtime;
\ No newline at end of file
+var _0xdb64=['mailAccounts','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','isUndefined','exports','lodash','../model/mailAccount'];(function(_0x29e946,_0x59bdca){var _0x989839=function(_0x4e88bc){while(--_0x4e88bc){_0x29e946['push'](_0x29e946['shift']());}};_0x989839(++_0x59bdca);}(_0xdb64,0xa0));var _0x4db6=function(_0x28cddc,_0x1be16d){_0x28cddc=_0x28cddc-0x0;var _0x5ce855=_0xdb64[_0x28cddc];return _0x5ce855;};'use strict';var _=require(_0x4db6('0x0'));var MailAccount=require(_0x4db6('0x1'));var Realtime=function(){this[_0x4db6('0x2')]={};};function freeIsNotKey(_0x443d75,_0x2a5c64,_0x2ab2b4){var _0x448a0a=_['mapKeys'](_0x443d75,function(_0x190f75,_0x119354){return _0x190f75[_0x2ab2b4];});for(var _0x522bdd in _0x2a5c64){if(_0x2a5c64[_0x4db6('0x3')](_0x522bdd)){if(!_0x448a0a[_0x522bdd]){delete _0x2a5c64[_0x522bdd];}}}}Realtime[_0x4db6('0x4')][_0x4db6('0x5')]=function(_0x572c67,_0x4ec1bb){for(var _0x4b4222 in _0x4ec1bb){if(_0x572c67[_0x4db6('0x3')](_0x4b4222)){_0x572c67[_0x4b4222]=_0x4ec1bb[_0x4b4222];}}};Realtime[_0x4db6('0x4')][_0x4db6('0x6')]=function(){var _0x3630c4=this;return function(_0x5aece3){if(_0x5aece3){freeIsNotKey(_0x5aece3,_0x3630c4['mailAccounts'],'id');for(var _0x2c74a3=0x0,_0x44fe3c={},_0x24c5c4={};_0x2c74a3<_0x5aece3['length'];_0x2c74a3+=0x1){_0x44fe3c=_0x5aece3[_0x2c74a3];if(_[_0x4db6('0x7')](_0x3630c4[_0x4db6('0x2')][_0x44fe3c['id']])){_0x3630c4['mailAccounts'][_0x44fe3c['id']]=new MailAccount(_0x44fe3c);}else{_['merge'](_0x3630c4['mailAccounts'][_0x44fe3c['id']],_0x44fe3c);}}}return _0x3630c4[_0x4db6('0x2')];};};module[_0x4db6('0x8')]=Realtime;
\ No newline at end of file
index 9d6b1b4..8263401 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bd3=['MailServerOut','Smtp','service','NotifyMailAccount','../client','Request','GetMailAccount','email','active','key','TemplateId','MailServerIn','CloudProvider','name','type','data5'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4bd3,0x174));var _0x34bd=function(_0x42fe39,_0x19f622){_0x42fe39=_0x42fe39-0x0;var _0x4ce867=_0x4bd3[_0x42fe39];return _0x4ce867;};'use strict';var client=require(_0x34bd('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x34bd('0x1')](_0x34bd('0x2'),{'options':{'attributes':['id','name','provider','service',_0x34bd('0x3'),_0x34bd('0x4'),_0x34bd('0x5'),'ListId',_0x34bd('0x6')],'raw':![],'include':[{'model':_0x34bd('0x7'),'as':'Imap','include':[{'model':_0x34bd('0x8'),'attributes':['id',_0x34bd('0x9'),'service',_0x34bd('0xa'),_0x34bd('0xb')],'as':_0x34bd('0x8')}]},{'model':_0x34bd('0xc'),'as':_0x34bd('0xd'),'include':[{'model':_0x34bd('0x8'),'attributes':['id','name',_0x34bd('0xe'),_0x34bd('0xa'),_0x34bd('0xb')],'as':_0x34bd('0x8')}]}]},'log':'getMailAccount'});};};exports['notify']=function(_0x3da7a0,_0x5e4ce7){return client['Request'](_0x34bd('0xf'),{'account':{'id':_0x3da7a0},'body':_0x5e4ce7,'log':_0x34bd('0xf')});};
\ No newline at end of file
+var _0x236e=['CloudProvider','name','data5','Smtp','type','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','provider','service','active','key','ListId','TemplateId','MailServerIn','Imap'];(function(_0x437e68,_0x530025){var _0x1a57be=function(_0x488558){while(--_0x488558){_0x437e68['push'](_0x437e68['shift']());}};_0x1a57be(++_0x530025);}(_0x236e,0x148));var _0xe236=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x236e[_0xaa0309];return _0x5de7ce;};'use strict';var client=require(_0xe236('0x0'));exports[_0xe236('0x1')]=function(){return function(){return client[_0xe236('0x2')](_0xe236('0x3'),{'options':{'attributes':['id','name',_0xe236('0x4'),_0xe236('0x5'),'email',_0xe236('0x6'),_0xe236('0x7'),_0xe236('0x8'),_0xe236('0x9')],'raw':![],'include':[{'model':_0xe236('0xa'),'as':_0xe236('0xb'),'include':[{'model':_0xe236('0xc'),'attributes':['id',_0xe236('0xd'),_0xe236('0x5'),'type',_0xe236('0xe')],'as':_0xe236('0xc')}]},{'model':'MailServerOut','as':_0xe236('0xf'),'include':[{'model':_0xe236('0xc'),'attributes':['id',_0xe236('0xd'),_0xe236('0x5'),_0xe236('0x10'),'data5'],'as':_0xe236('0xc')}]}]},'log':_0xe236('0x11')});};};exports[_0xe236('0x12')]=function(_0x1cc961,_0x1ddc4f){return client[_0xe236('0x2')](_0xe236('0x13'),{'account':{'id':_0x1cc961},'body':_0x1ddc4f,'log':_0xe236('0x13')});};
\ No newline at end of file
index 49ee378..38554ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3880=['getSettings','Request','ShowSetting','loginMailFrequency','../client'];(function(_0x2c5f0a,_0x1e65fc){var _0x316fd5=function(_0x58abfb){while(--_0x58abfb){_0x2c5f0a['push'](_0x2c5f0a['shift']());}};_0x316fd5(++_0x1e65fc);}(_0x3880,0x135));var _0x0388=function(_0x28d6db,_0x43a701){_0x28d6db=_0x28d6db-0x0;var _0x3fc907=_0x3880[_0x28d6db];return _0x3fc907;};'use strict';var client=require(_0x0388('0x0'));exports[_0x0388('0x1')]=function(){return client[_0x0388('0x2')](_0x0388('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x0388('0x4')]},'log':'GetSettings'});};
\ No newline at end of file
+var _0xdd97=['Request','ShowSetting','loginMailFrequency','GetSettings','../client','getSettings'];(function(_0x2afffa,_0x480aec){var _0x38efa6=function(_0x4aadc0){while(--_0x4aadc0){_0x2afffa['push'](_0x2afffa['shift']());}};_0x38efa6(++_0x480aec);}(_0xdd97,0xb2));var _0x7dd9=function(_0xf363f0,_0x3b5eeb){_0xf363f0=_0xf363f0-0x0;var _0x55a386=_0xdd97[_0xf363f0];return _0x55a386;};'use strict';var client=require(_0x7dd9('0x0'));exports[_0x7dd9('0x1')]=function(){return client[_0x7dd9('0x2')](_0x7dd9('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7dd9('0x4')]},'log':_0x7dd9('0x5')});};
\ No newline at end of file
index 89e6e60..a6334c3 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_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 75ab44d..ccda0cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71c6=['../../config/socketio','../../routes','once','listening','log','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','port','polling','defaults','redis','adapter','../../config/triggers','default'];(function(_0x4645eb,_0x3a23bd){var _0x31ecea=function(_0x555a73){while(--_0x555a73){_0x4645eb['push'](_0x4645eb['shift']());}};_0x31ecea(++_0x3a23bd);}(_0x71c6,0x16b));var _0x671c=function(_0xe312fd,_0x43138b){_0xe312fd=_0xe312fd-0x0;var _0xef5ecb=_0x71c6[_0xe312fd];return _0xef5ecb;};'use strict';var _=require(_0x671c('0x0'));var http=require(_0x671c('0x1'));var express=require(_0x671c('0x2'));var sticky=require(_0x671c('0x3'));var Redis=require(_0x671c('0x4'));var config=require(_0x671c('0x5'));var app=express();var server=http[_0x671c('0x6')](app);server[_0x671c('0x7')]=0xdbba0;if(sticky['listen'](server,config[_0x671c('0x8')])){var socketio=require('socket.io')(server,{'transports':['websocket',_0x671c('0x9')]});config['redis']=_[_0x671c('0xa')](config[_0x671c('0xb')],{'host':'localhost','port':0x18eb});socketio[_0x671c('0xc')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x671c('0xb')])}));require(_0x671c('0xd'))[_0x671c('0xe')]();require(_0x671c('0xf'))['default'](socketio);require('../../config/express')['default'](app);require(_0x671c('0x10'))[_0x671c('0xe')](app);}else{server[_0x671c('0x11')](_0x671c('0x12'),function(){console[_0x671c('0x13')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x671c('0x8')]);});}exports=module[_0x671c('0x14')]=app;
\ No newline at end of file
+var _0x7c0a=['redis','../../config/triggers','../../config/socketio','default','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','socket.io','websocket','polling','defaults','localhost','socket.io-redis'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0x7c0a,0x64));var _0xa7c0=function(_0x72feaa,_0x470649){_0x72feaa=_0x72feaa-0x0;var _0x132b15=_0x7c0a[_0x72feaa];return _0x132b15;};'use strict';var _=require(_0xa7c0('0x0'));var http=require(_0xa7c0('0x1'));var express=require(_0xa7c0('0x2'));var sticky=require(_0xa7c0('0x3'));var Redis=require(_0xa7c0('0x4'));var config=require(_0xa7c0('0x5'));var app=express();var server=http[_0xa7c0('0x6')](app);server[_0xa7c0('0x7')]=0xdbba0;if(sticky[_0xa7c0('0x8')](server,config['port'])){var socketio=require(_0xa7c0('0x9'))(server,{'transports':[_0xa7c0('0xa'),_0xa7c0('0xb')]});config['redis']=_[_0xa7c0('0xc')](config['redis'],{'host':_0xa7c0('0xd'),'port':0x18eb});socketio['adapter'](require(_0xa7c0('0xe'))({'pubClient':new Redis(config[_0xa7c0('0xf')]),'subClient':new Redis(config[_0xa7c0('0xf')])}));require(_0xa7c0('0x10'))['default']();require(_0xa7c0('0x11'))[_0xa7c0('0x12')](socketio);require('../../config/express')[_0xa7c0('0x12')](app);require(_0xa7c0('0x13'))['default'](app);}else{server['once'](_0xa7c0('0x14'),function(){console[_0xa7c0('0x15')](_0xa7c0('0x16'),config['port']);});}exports=module['exports']=app;
\ No newline at end of file
index 7a6e75d..7ce7c53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd03b=['jayson/promise','bluebird','../../config/logger','routing','client','Request','request','then','debug','rpc','error','message','result','catch','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd03b,0xf0));var _0xbd03=function(_0x17abcb,_0x12fc34){_0x17abcb=_0x17abcb-0x0;var _0x1bfa1a=_0xd03b[_0x17abcb];return _0x1bfa1a;};'use strict';var jayson=require(_0xbd03('0x0'));var BPromise=require(_0xbd03('0x1'));var logger=require(_0xbd03('0x2'))(_0xbd03('0x3'));var client=jayson[_0xbd03('0x4')]['http']({'port':0x2329});client[_0xbd03('0x5')]=function(_0x259f6b,_0x54bca4){return new BPromise(function(_0x3d5687,_0x3c89ce){return client[_0xbd03('0x6')](_0x259f6b,_0x54bca4)[_0xbd03('0x7')](function(_0x4dec4b){logger[_0xbd03('0x8')](_0xbd03('0x9'),_0xbd03('0x3'),_0x259f6b,_0x54bca4,_0x4dec4b);if(_0x4dec4b['error']){logger[_0xbd03('0xa')]('rpc',_0xbd03('0x3'),_0x259f6b,_0x4dec4b[_0xbd03('0xa')][_0xbd03('0xb')],_0x54bca4);return _0x3c89ce(_0x4dec4b[_0xbd03('0xa')][_0xbd03('0xb')]);}else{return _0x3d5687(_0x4dec4b[_0xbd03('0xc')]);}})[_0xbd03('0xd')](function(_0x45805d){logger[_0xbd03('0xa')](_0xbd03('0x9'),_0xbd03('0x3'),_0x259f6b,_0x45805d,_0x54bca4);return _0x3c89ce(_0x45805d);});});};module[_0xbd03('0xe')]=client;
\ No newline at end of file
+var _0xe767=['result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','then','debug','rpc','error','message'];(function(_0xb63d93,_0x1fb747){var _0x27979d=function(_0x55deff){while(--_0x55deff){_0xb63d93['push'](_0xb63d93['shift']());}};_0x27979d(++_0x1fb747);}(_0xe767,0x12f));var _0x7e76=function(_0xc0a8ee,_0x50e8c6){_0xc0a8ee=_0xc0a8ee-0x0;var _0x2cf187=_0xe767[_0xc0a8ee];return _0x2cf187;};'use strict';var jayson=require(_0x7e76('0x0'));var BPromise=require(_0x7e76('0x1'));var logger=require(_0x7e76('0x2'))(_0x7e76('0x3'));var client=jayson[_0x7e76('0x4')][_0x7e76('0x5')]({'port':0x2329});client[_0x7e76('0x6')]=function(_0x259c15,_0x3dac39){return new BPromise(function(_0x52ac7e,_0x3813a7){return client['request'](_0x259c15,_0x3dac39)[_0x7e76('0x7')](function(_0x3aa819){logger[_0x7e76('0x8')](_0x7e76('0x9'),'routing',_0x259c15,_0x3dac39,_0x3aa819);if(_0x3aa819[_0x7e76('0xa')]){logger['error'](_0x7e76('0x9'),_0x7e76('0x3'),_0x259c15,_0x3aa819[_0x7e76('0xa')]['message'],_0x3dac39);return _0x3813a7(_0x3aa819[_0x7e76('0xa')][_0x7e76('0xb')]);}else{return _0x52ac7e(_0x3aa819[_0x7e76('0xc')]);}})[_0x7e76('0xd')](function(_0x143790){logger[_0x7e76('0xa')]('rpc',_0x7e76('0x3'),_0x259c15,_0x143790,_0x3dac39);return _0x3813a7(_0x143790);});});};module[_0x7e76('0xe')]=client;
\ No newline at end of file
index 3902cc1..f99e7f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7814=['getFaxQueues','initWhatsappQueues','catch','log','bluebird','./server','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/faxQueue','resolve','getAgents','then','getIntervals','initIntervals','getChatQueues','getSmsQueues','initSmsQueues'];(function(_0x128a79,_0x19f331){var _0x2ff426=function(_0x57ffc1){while(--_0x57ffc1){_0x128a79['push'](_0x128a79['shift']());}};_0x2ff426(++_0x19f331);}(_0x7814,0x112));var _0x4781=function(_0xc74be1,_0x1c2148){_0xc74be1=_0xc74be1-0x0;var _0x98aa2b=_0x7814[_0xc74be1];return _0x98aa2b;};'use strict';var BPromise=require(_0x4781('0x0'));var server=require(_0x4781('0x1'));var Realtime=require('./realtime');var user=require(_0x4781('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x4781('0x3'));var chatQueue=require(_0x4781('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x4781('0x5'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x4781('0x6')]()['then'](user[_0x4781('0x7')]())[_0x4781('0x8')](realtime['initAgents']())[_0x4781('0x8')](interval[_0x4781('0x9')]())[_0x4781('0x8')](realtime[_0x4781('0xa')]())['then'](openchannelQueue['getOpenchannelQueues']())[_0x4781('0x8')](realtime['initOpenchannelQueues']())[_0x4781('0x8')](chatQueue[_0x4781('0xb')]())[_0x4781('0x8')](realtime['initChatQueues']())[_0x4781('0x8')](smsQueue[_0x4781('0xc')]())[_0x4781('0x8')](realtime[_0x4781('0xd')]())[_0x4781('0x8')](mailQueue['getMailQueues']())[_0x4781('0x8')](realtime['initMailQueues']())[_0x4781('0x8')](faxQueue[_0x4781('0xe')]())['then'](realtime['initFaxQueues']())['then'](whatsappQueue['getWhatsappQueues']())[_0x4781('0x8')](realtime[_0x4781('0xf')]())[_0x4781('0x8')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x4781('0x8')](function(_0x5c1703){return initRealtime();})[_0x4781('0x8')](function(_0x3cfb1b){return setInterval(initRealtime,0x1388);})[_0x4781('0x10')](function(_0x8a68da){console[_0x4781('0x11')](_0x8a68da);});}main();
\ No newline at end of file
+var _0xb59c=['resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue'];(function(_0x1a37e1,_0x47ade7){var _0x1c9d90=function(_0x3ce099){while(--_0x3ce099){_0x1a37e1['push'](_0x1a37e1['shift']());}};_0x1c9d90(++_0x47ade7);}(_0xb59c,0xe9));var _0xcb59=function(_0x59f044,_0x2377ff){_0x59f044=_0x59f044-0x0;var _0x24540d=_0xb59c[_0x59f044];return _0x24540d;};'use strict';var BPromise=require(_0xcb59('0x0'));var server=require(_0xcb59('0x1'));var Realtime=require(_0xcb59('0x2'));var user=require('./rpc/user');var interval=require(_0xcb59('0x3'));var openchannelQueue=require(_0xcb59('0x4'));var chatQueue=require(_0xcb59('0x5'));var smsQueue=require(_0xcb59('0x6'));var mailQueue=require(_0xcb59('0x7'));var faxQueue=require(_0xcb59('0x8'));var whatsappQueue=require(_0xcb59('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xcb59('0xa')]()['then'](user[_0xcb59('0xb')]())[_0xcb59('0xc')](realtime[_0xcb59('0xd')]())[_0xcb59('0xc')](interval[_0xcb59('0xe')]())['then'](realtime[_0xcb59('0xf')]())[_0xcb59('0xc')](openchannelQueue[_0xcb59('0x10')]())[_0xcb59('0xc')](realtime[_0xcb59('0x11')]())['then'](chatQueue['getChatQueues']())['then'](realtime[_0xcb59('0x12')]())['then'](smsQueue[_0xcb59('0x13')]())[_0xcb59('0xc')](realtime[_0xcb59('0x14')]())[_0xcb59('0xc')](mailQueue['getMailQueues']())[_0xcb59('0xc')](realtime[_0xcb59('0x15')]())[_0xcb59('0xc')](faxQueue[_0xcb59('0x16')]())['then'](realtime['initFaxQueues']())[_0xcb59('0xc')](whatsappQueue[_0xcb59('0x17')]())[_0xcb59('0xc')](realtime['initWhatsappQueues']())[_0xcb59('0xc')](function(){return realtime;});}function main(){return server[_0xcb59('0x18')](realtime)['then'](function(_0x4fda0d){return initRealtime();})[_0xcb59('0xc')](function(_0x1d8ac6){return setInterval(initRealtime,0x1388);})[_0xcb59('0x19')](function(_0x303faa){console[_0xcb59('0x1a')](_0x303faa);});}main();
\ No newline at end of file
index 66af936..399228a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0xef9ce7,_0xf7dd76){var _0xbd3b50=function(_0x49fa56){while(--_0x49fa56){_0xef9ce7['push'](_0xef9ce7['shift']());}};_0xbd3b50(++_0xf7dd76);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine;
\ No newline at end of file
+var _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(_0x2ed6ae,_0x4f257d){var _0x2461a0=function(_0x29a292){while(--_0x29a292){_0x2ed6ae['push'](_0x2ed6ae['shift']());}};_0x2461a0(++_0x4f257d);}(_0x814b,0x1a2));var _0xb814=function(_0x21d0c3,_0x16c71c){_0x21d0c3=_0x21d0c3-0x0;var _0x4df18e=_0x814b[_0x21d0c3];return _0x4df18e;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine;
\ No newline at end of file
index 48da0cf..76734af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f5a=['message','result','catch','sendMailMessage','SendMail','bluebird','client','request','then','error'];(function(_0x335534,_0x139827){var _0x5380c5=function(_0x21069a){while(--_0x21069a){_0x335534['push'](_0x335534['shift']());}};_0x5380c5(++_0x139827);}(_0x1f5a,0xb9));var _0xa1f5=function(_0x36d752,_0x12da3e){_0x36d752=_0x36d752-0x0;var _0x193308=_0x1f5a[_0x36d752];return _0x193308;};'use strict';var BPromise=require(_0xa1f5('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xa1f5('0x1')]['http']({'port':0x232b});function request(_0x464dde,_0x1a5bd6){return new BPromise(function(_0x3d88c3,_0x5aacf6){return client[_0xa1f5('0x2')](_0x464dde,_0x1a5bd6)[_0xa1f5('0x3')](function(_0x2c5603){if(_0x2c5603[_0xa1f5('0x4')]){return _0x5aacf6(_0x2c5603[_0xa1f5('0x4')][_0xa1f5('0x5')]);}else{return _0x3d88c3(_0x2c5603[_0xa1f5('0x6')]);}})[_0xa1f5('0x7')](function(_0x212152){return _0x5aacf6(_0x212152);});});}exports[_0xa1f5('0x8')]=function(_0x2ed595,_0x17364f){return request(_0xa1f5('0x9'),{'account':_0x2ed595,'message':_0x17364f});};
\ No newline at end of file
+var _0x5e44=['message','result','catch','SendMail','bluebird','jayson/promise','client','http','then','error'];(function(_0x584d70,_0x46f08d){var _0x2fbf77=function(_0x124a62){while(--_0x124a62){_0x584d70['push'](_0x584d70['shift']());}};_0x2fbf77(++_0x46f08d);}(_0x5e44,0x126));var _0x45e4=function(_0xae02ae,_0x27f26f){_0xae02ae=_0xae02ae-0x0;var _0x36a9d7=_0x5e44[_0xae02ae];return _0x36a9d7;};'use strict';var BPromise=require(_0x45e4('0x0'));var jayson=require(_0x45e4('0x1'));var client=jayson[_0x45e4('0x2')][_0x45e4('0x3')]({'port':0x232b});function request(_0xc36f4a,_0x3d1bd9){return new BPromise(function(_0xf2391,_0x2ae95e){return client['request'](_0xc36f4a,_0x3d1bd9)[_0x45e4('0x4')](function(_0x41359d){if(_0x41359d['error']){return _0x2ae95e(_0x41359d[_0x45e4('0x5')][_0x45e4('0x6')]);}else{return _0xf2391(_0x41359d[_0x45e4('0x7')]);}})[_0x45e4('0x8')](function(_0x170f73){return _0x2ae95e(_0x170f73);});});}exports['sendMailMessage']=function(_0x3f28f3,_0x42690f){return request(_0x45e4('0x9'),{'account':_0x3f28f3,'message':_0x42690f});};
\ No newline at end of file
index e9d10ba..a277f27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc21=['whatsapp','length','Status','StatusTime','toNumber','format','chatStatusTime','mailStatusTime','mailCurrentCapacity','openchannelStatus','busy','busyQueue','exports','moment','ioredis','redis','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','md5','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','mail','chat','openchannel','fax'];(function(_0x578493,_0x5a49cf){var _0x29f74b=function(_0x2abd78){while(--_0x2abd78){_0x578493['push'](_0x578493['shift']());}};_0x29f74b(++_0x5a49cf);}(_0xcc21,0xb8));var _0x1cc2=function(_0x46399a,_0x108f44){_0x46399a=_0x46399a-0x0;var _0x3f97ca=_0xcc21[_0x46399a];return _0x3f97ca;};'use strict';var _=require('lodash');var moment=require(_0x1cc2('0x0'));var md5=require('md5');var Redis=require(_0x1cc2('0x1'));var config=require('../../../config/environment');config[_0x1cc2('0x2')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1cc2('0x3'))(new Redis(config[_0x1cc2('0x2')]));function Agent(_0x10986f){this['id']=_0x10986f['id']||0x0;this['name']=_0x10986f[_0x1cc2('0x4')]||'';this[_0x1cc2('0x5')]=_0x10986f[_0x1cc2('0x5')]||!![];this[_0x1cc2('0x6')]=_0x10986f[_0x1cc2('0x6')]||![];this[_0x1cc2('0x7')]=_0x10986f['chatPause']||![];this[_0x1cc2('0x8')]=_0x10986f[_0x1cc2('0x8')]||![];this[_0x1cc2('0x9')]=_0x10986f[_0x1cc2('0x9')]||![];this['smsPause']=_0x10986f[_0x1cc2('0xa')]||![];this[_0x1cc2('0xb')]=_0x10986f[_0x1cc2('0xb')]||![];this[_0x1cc2('0xc')]=_0x1cc2('0xd');this['chatStatusTime']=0x0;this[_0x1cc2('0xe')]=_0x10986f[_0x1cc2('0xe')]||0x0;this[_0x1cc2('0xf')]=0x0;this[_0x1cc2('0x10')]=_0x1cc2('0xd');this['mailStatusTime']=0x0;this[_0x1cc2('0x11')]=_0x10986f[_0x1cc2('0x11')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x1cc2('0x12')]='unknown';this[_0x1cc2('0x13')]=0x0;this['faxCapacity']=_0x10986f[_0x1cc2('0x14')]||0x0;this[_0x1cc2('0x15')]=0x0;this[_0x1cc2('0x16')]='unknown';this[_0x1cc2('0x17')]=0x0;this[_0x1cc2('0x18')]=_0x10986f[_0x1cc2('0x18')]||0x0;this[_0x1cc2('0x19')]=0x0;this['whatsappStatus']=_0x1cc2('0xd');this[_0x1cc2('0x1a')]=0x0;this[_0x1cc2('0x1b')]=_0x10986f[_0x1cc2('0x1b')]||0x0;this[_0x1cc2('0x1c')]=0x0;this['openchannelStatus']='unknown';this[_0x1cc2('0x1d')]=0x0;this[_0x1cc2('0x1e')]=_0x10986f[_0x1cc2('0x1e')]||0x0;this[_0x1cc2('0x1f')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x1cc2('0x20')]='';this[_0x1cc2('0x21')]();}Agent[_0x1cc2('0x22')][_0x1cc2('0x23')]=function(_0x45657d){if(this[_0x45657d+_0x1cc2('0x24')]>0x0){if(this[_0x45657d+_0x1cc2('0x25')]>0x0&&this[_0x45657d+'CurrentCapacity']>=this[_0x45657d+_0x1cc2('0x25')]){return _0x1cc2('0x26');}else{return'working';}}else{return _0x1cc2('0x27');}};Agent[_0x1cc2('0x22')][_0x1cc2('0x21')]=function(){var _0x156181=[_0x1cc2('0x28'),_0x1cc2('0x29'),_0x1cc2('0x2a'),_0x1cc2('0x2b'),'sms',_0x1cc2('0x2c')];for(var _0x1e6c05=0x0;_0x1e6c05<_0x156181[_0x1cc2('0x2d')];_0x1e6c05+=0x1){var _0x4d248b=this['getChannelStatus'](_0x156181[_0x1e6c05]);if(this[_0x156181[_0x1e6c05]+_0x1cc2('0x2e')]!==_0x4d248b){this[_0x156181[_0x1e6c05]+_0x1cc2('0x2f')]=_[_0x1cc2('0x30')](moment()[_0x1cc2('0x31')]('x'));}this[_0x156181[_0x1e6c05]+_0x1cc2('0x2e')]=_0x4d248b;}var _0x2e2010={'id':this['id'],'name':this['name'],'online':this[_0x1cc2('0x5')],'voicePause':this[_0x1cc2('0x6')],'chatPause':this[_0x1cc2('0x7')],'mailPause':this[_0x1cc2('0x8')],'smsPause':this[_0x1cc2('0xa')],'faxPause':this['faxPause'],'openchannelPause':this[_0x1cc2('0xb')],'chatStatus':this[_0x1cc2('0xc')],'chatStatusTime':this[_0x1cc2('0x32')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x1cc2('0xf')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x1cc2('0x33')],'mailCapacity':this[_0x1cc2('0x11')],'mailCurrentCapacity':this[_0x1cc2('0x34')],'faxStatus':this[_0x1cc2('0x12')],'faxStatusTime':this[_0x1cc2('0x13')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x1cc2('0x15')],'smsStatus':this[_0x1cc2('0x16')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x1cc2('0x19')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x1cc2('0x1a')],'whatsappCapacity':this[_0x1cc2('0x1b')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x1cc2('0x35')],'openchannelStatusTime':this[_0x1cc2('0x1d')],'openchannelCapacity':this[_0x1cc2('0x1e')],'openchannelCurrentCapacity':this[_0x1cc2('0x1f')],'busy':this[_0x1cc2('0x36')],'busyQueue':this[_0x1cc2('0x37')]};var _0x2213dd=md5(JSON['stringify'](_0x2e2010));if(this[_0x1cc2('0x20')]!==_0x2213dd){this[_0x1cc2('0x20')]=_0x2213dd;io['emit']('user:save',_0x2e2010);}};module[_0x1cc2('0x38')]=Agent;
\ No newline at end of file
+var _0xd866=['user:save','exports','lodash','moment','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','mail','chat','openchannel','fax','sms','whatsapp','length','toNumber','format','Status','openchannelPause','faxCapacity','smsCurrentCapacity','stringify','emit'];(function(_0x5e2732,_0x16335b){var _0x421b80=function(_0x684b0b){while(--_0x684b0b){_0x5e2732['push'](_0x5e2732['shift']());}};_0x421b80(++_0x16335b);}(_0xd866,0xbf));var _0x6d86=function(_0x4b8980,_0x2559d8){_0x4b8980=_0x4b8980-0x0;var _0x2e93b4=_0xd866[_0x4b8980];return _0x2e93b4;};'use strict';var _=require(_0x6d86('0x0'));var moment=require(_0x6d86('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x6d86('0x2'));config[_0x6d86('0x3')]=_[_0x6d86('0x4')](config[_0x6d86('0x3')],{'host':_0x6d86('0x5'),'port':0x18eb});var io=require(_0x6d86('0x6'))(new Redis(config[_0x6d86('0x3')]));function Agent(_0x49cb6f){this['id']=_0x49cb6f['id']||0x0;this['name']=_0x49cb6f[_0x6d86('0x7')]||'';this[_0x6d86('0x8')]=_0x49cb6f[_0x6d86('0x8')]||!![];this[_0x6d86('0x9')]=_0x49cb6f[_0x6d86('0x9')]||![];this[_0x6d86('0xa')]=_0x49cb6f['chatPause']||![];this[_0x6d86('0xb')]=_0x49cb6f[_0x6d86('0xb')]||![];this[_0x6d86('0xc')]=_0x49cb6f[_0x6d86('0xc')]||![];this[_0x6d86('0xd')]=_0x49cb6f[_0x6d86('0xd')]||![];this['openchannelPause']=_0x49cb6f['openchannelPause']||![];this[_0x6d86('0xe')]='unknown';this[_0x6d86('0xf')]=0x0;this[_0x6d86('0x10')]=_0x49cb6f[_0x6d86('0x10')]||0x0;this[_0x6d86('0x11')]=0x0;this[_0x6d86('0x12')]=_0x6d86('0x13');this[_0x6d86('0x14')]=0x0;this[_0x6d86('0x15')]=_0x49cb6f[_0x6d86('0x15')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x6d86('0x16')]=_0x6d86('0x13');this[_0x6d86('0x17')]=0x0;this['faxCapacity']=_0x49cb6f['faxCapacity']||0x0;this[_0x6d86('0x18')]=0x0;this[_0x6d86('0x19')]='unknown';this[_0x6d86('0x1a')]=0x0;this[_0x6d86('0x1b')]=_0x49cb6f[_0x6d86('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x6d86('0x1c')]=_0x6d86('0x13');this[_0x6d86('0x1d')]=0x0;this[_0x6d86('0x1e')]=_0x49cb6f['whatsappCapacity']||0x0;this[_0x6d86('0x1f')]=0x0;this[_0x6d86('0x20')]=_0x6d86('0x13');this[_0x6d86('0x21')]=0x0;this[_0x6d86('0x22')]=_0x49cb6f[_0x6d86('0x22')]||0x0;this[_0x6d86('0x23')]=0x0;this[_0x6d86('0x24')]=![];this[_0x6d86('0x25')]=undefined;this[_0x6d86('0x26')]='';this[_0x6d86('0x27')]();}Agent[_0x6d86('0x28')][_0x6d86('0x29')]=function(_0x4fb0d7){if(this[_0x4fb0d7+_0x6d86('0x2a')]>0x0){if(this[_0x4fb0d7+_0x6d86('0x2b')]>0x0&&this[_0x4fb0d7+_0x6d86('0x2a')]>=this[_0x4fb0d7+_0x6d86('0x2b')]){return _0x6d86('0x2c');}else{return'working';}}else{return _0x6d86('0x2d');}};Agent['prototype']['updateRealtime']=function(){var _0x263551=[_0x6d86('0x2e'),_0x6d86('0x2f'),_0x6d86('0x30'),_0x6d86('0x31'),_0x6d86('0x32'),_0x6d86('0x33')];for(var _0x4eeade=0x0;_0x4eeade<_0x263551[_0x6d86('0x34')];_0x4eeade+=0x1){var _0x3f3ff1=this[_0x6d86('0x29')](_0x263551[_0x4eeade]);if(this[_0x263551[_0x4eeade]+'Status']!==_0x3f3ff1){this[_0x263551[_0x4eeade]+'StatusTime']=_[_0x6d86('0x35')](moment()[_0x6d86('0x36')]('x'));}this[_0x263551[_0x4eeade]+_0x6d86('0x37')]=_0x3f3ff1;}var _0x2bec0d={'id':this['id'],'name':this['name'],'online':this[_0x6d86('0x8')],'voicePause':this[_0x6d86('0x9')],'chatPause':this[_0x6d86('0xa')],'mailPause':this[_0x6d86('0xb')],'smsPause':this[_0x6d86('0xd')],'faxPause':this[_0x6d86('0xc')],'openchannelPause':this[_0x6d86('0x38')],'chatStatus':this[_0x6d86('0xe')],'chatStatusTime':this[_0x6d86('0xf')],'chatCapacity':this[_0x6d86('0x10')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x6d86('0x14')],'mailCapacity':this[_0x6d86('0x15')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x6d86('0x16')],'faxStatusTime':this[_0x6d86('0x17')],'faxCapacity':this[_0x6d86('0x39')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x6d86('0x19')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x6d86('0x3a')],'whatsappStatus':this[_0x6d86('0x1c')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x6d86('0x1e')],'whatsappCurrentCapacity':this[_0x6d86('0x1f')],'openchannelStatus':this[_0x6d86('0x20')],'openchannelStatusTime':this[_0x6d86('0x21')],'openchannelCapacity':this[_0x6d86('0x22')],'openchannelCurrentCapacity':this[_0x6d86('0x23')],'busy':this['busy'],'busyQueue':this[_0x6d86('0x25')]};var _0x4d94c0=md5(JSON[_0x6d86('0x3b')](_0x2bec0d));if(this['md5']!==_0x4d94c0){this[_0x6d86('0x26')]=_0x4d94c0;io[_0x6d86('0x3c')](_0x6d86('0x3d'),_0x2bec0d);}};module[_0x6d86('0x3e')]=Agent;
\ No newline at end of file
index 3fefa9a..9595b8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32d7=['timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','paused','available','stringify','format','emit','exports','md5','ioredis','../../../config/environment','defaults','redis','name'];(function(_0x1c9a8d,_0x35d23c){var _0x1e5399=function(_0x712083){while(--_0x712083){_0x1c9a8d['push'](_0x1c9a8d['shift']());}};_0x1e5399(++_0x35d23c);}(_0x32d7,0xf4));var _0x732d=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0x32d7[_0x412e27];return _0x53da42;};'use strict';var _=require('lodash');var md5=require(_0x732d('0x0'));var util=require('util');var Redis=require(_0x732d('0x1'));var config=require(_0x732d('0x2'));config['redis']=_[_0x732d('0x3')](config[_0x732d('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x732d('0x4')]));function ChatQueue(_0x33b7a8){this['id']=_0x33b7a8['id']||0x0;this[_0x732d('0x5')]=_0x33b7a8[_0x732d('0x5')]||'';this[_0x732d('0x6')]=_0x33b7a8[_0x732d('0x6')]||0xa;this[_0x732d('0x7')]=_0x33b7a8['strategy']||_0x732d('0x8');this[_0x732d('0x9')]=_0x33b7a8[_0x732d('0x9')];this[_0x732d('0xa')]={};this['waiting']=0x0;this[_0x732d('0x0')]='';this[_0x732d('0xb')]();this[_0x732d('0xc')]();}ChatQueue[_0x732d('0xd')][_0x732d('0xb')]=function(){var _0x4b719a=this[_0x732d('0xa')][_0x732d('0xe')];this[_0x732d('0xa')]=_[_0x732d('0xf')](this['Agents'],'id');this[_0x732d('0xa')][_0x732d('0xe')]=_0x4b719a;};ChatQueue[_0x732d('0xd')][_0x732d('0xc')]=function(){this[_0x732d('0x10')]=0x0;this['paused']=0x0;for(var _0x3ca1fc=0x0;_0x3ca1fc<this[_0x732d('0x9')][_0x732d('0x11')];_0x3ca1fc+=0x1){if(this[_0x732d('0x9')][_0x3ca1fc][_0x732d('0x12')]){this['loggedIn']+=0x1;}if(this[_0x732d('0x9')][_0x3ca1fc]['chatPause']){this[_0x732d('0x13')]+=0x1;}}this[_0x732d('0x14')]=this[_0x732d('0x10')]-this[_0x732d('0x13')];this['available']=this[_0x732d('0x14')]>=0x0?this['available']:0x0;var _0x896f66={'id':this['id'],'available':this[_0x732d('0x14')],'loggedIn':this[_0x732d('0x10')],'name':this[_0x732d('0x5')],'paused':this[_0x732d('0x13')],'waiting':this['waiting']};var _0xf982eb=md5(JSON[_0x732d('0x15')](_0x896f66));if(this['md5']!==_0xf982eb){this[_0x732d('0x0')]=_0xf982eb;io['to'](util[_0x732d('0x16')]('chat:queue:%s',_0x896f66[_0x732d('0x5')]))[_0x732d('0x17')]('chat_queue:save',_0x896f66);}};module[_0x732d('0x18')]=ChatQueue;
\ No newline at end of file
+var _0x74a6=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','online','available','format','chat:queue:%s','emit','exports','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name'];(function(_0x57408b,_0xb7cbc5){var _0x31a897=function(_0x5810ac){while(--_0x5810ac){_0x57408b['push'](_0x57408b['shift']());}};_0x31a897(++_0xb7cbc5);}(_0x74a6,0x1e7));var _0x674a=function(_0x2dc343,_0xf015a2){_0x2dc343=_0x2dc343-0x0;var _0x51eac5=_0x74a6[_0x2dc343];return _0x51eac5;};'use strict';var _=require('lodash');var md5=require(_0x674a('0x0'));var util=require('util');var Redis=require(_0x674a('0x1'));var config=require(_0x674a('0x2'));config[_0x674a('0x3')]=_['defaults'](config[_0x674a('0x3')],{'host':_0x674a('0x4'),'port':0x18eb});var io=require(_0x674a('0x5'))(new Redis(config['redis']));function ChatQueue(_0x2392a9){this['id']=_0x2392a9['id']||0x0;this[_0x674a('0x6')]=_0x2392a9[_0x674a('0x6')]||'';this[_0x674a('0x7')]=_0x2392a9[_0x674a('0x7')]||0xa;this[_0x674a('0x8')]=_0x2392a9[_0x674a('0x8')]||_0x674a('0x9');this[_0x674a('0xa')]=_0x2392a9[_0x674a('0xa')];this[_0x674a('0xb')]={};this[_0x674a('0xc')]=0x0;this[_0x674a('0x0')]='';this[_0x674a('0xd')]();this['updateRealtime']();}ChatQueue[_0x674a('0xe')]['updateRouting']=function(){var _0x19ee1f=this[_0x674a('0xb')][_0x674a('0xf')];this[_0x674a('0xb')]=_[_0x674a('0x10')](this[_0x674a('0xa')],'id');this[_0x674a('0xb')][_0x674a('0xf')]=_0x19ee1f;};ChatQueue['prototype'][_0x674a('0x11')]=function(){this[_0x674a('0x12')]=0x0;this[_0x674a('0x13')]=0x0;for(var _0x354be3=0x0;_0x354be3<this[_0x674a('0xa')]['length'];_0x354be3+=0x1){if(this[_0x674a('0xa')][_0x354be3][_0x674a('0x14')]){this[_0x674a('0x12')]+=0x1;}if(this['Agents'][_0x354be3]['chatPause']){this['paused']+=0x1;}}this[_0x674a('0x15')]=this['loggedIn']-this['paused'];this[_0x674a('0x15')]=this[_0x674a('0x15')]>=0x0?this['available']:0x0;var _0x4e4505={'id':this['id'],'available':this[_0x674a('0x15')],'loggedIn':this[_0x674a('0x12')],'name':this[_0x674a('0x6')],'paused':this[_0x674a('0x13')],'waiting':this[_0x674a('0xc')]};var _0x1dc31e=md5(JSON['stringify'](_0x4e4505));if(this[_0x674a('0x0')]!==_0x1dc31e){this[_0x674a('0x0')]=_0x1dc31e;io['to'](util[_0x674a('0x16')](_0x674a('0x17'),_0x4e4505[_0x674a('0x6')]))[_0x674a('0x18')]('chat_queue:save',_0x4e4505);}};module[_0x674a('0x19')]=ChatQueue;
\ No newline at end of file
index dd5526a..18f4395 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ec5=['format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','loggedIn','paused','online','faxPause','available','stringify'];(function(_0x4f6c15,_0x219816){var _0x1c4224=function(_0xb6a547){while(--_0xb6a547){_0x4f6c15['push'](_0x4f6c15['shift']());}};_0x1c4224(++_0x219816);}(_0x6ec5,0x1f2));var _0x56ec=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6ec5[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x56ec('0x0'));var md5=require(_0x56ec('0x1'));var util=require(_0x56ec('0x2'));var Redis=require(_0x56ec('0x3'));var config=require('../../../config/environment');config[_0x56ec('0x4')]=_[_0x56ec('0x5')](config[_0x56ec('0x4')],{'host':_0x56ec('0x6'),'port':0x18eb});var io=require(_0x56ec('0x7'))(new Redis(config[_0x56ec('0x4')]));function FaxQueue(_0xe79c0c){this['id']=_0xe79c0c['id']||0x0;this[_0x56ec('0x8')]=_0xe79c0c['name']||'';this[_0x56ec('0x9')]=_0xe79c0c[_0x56ec('0x9')]||0xa;this[_0x56ec('0xa')]=_0xe79c0c[_0x56ec('0xa')]||'beepall';this[_0x56ec('0xb')]=_0xe79c0c[_0x56ec('0xb')];this[_0x56ec('0xc')]={};this[_0x56ec('0xd')]=0x0;this[_0x56ec('0x1')]='';this[_0x56ec('0xe')]();this['updateRealtime']();}FaxQueue['prototype'][_0x56ec('0xe')]=function(){var _0x57643e=this[_0x56ec('0xc')][_0x56ec('0xf')];this[_0x56ec('0xc')]=_[_0x56ec('0x10')](this[_0x56ec('0xb')],'id');this[_0x56ec('0xc')][_0x56ec('0xf')]=_0x57643e;};FaxQueue[_0x56ec('0x11')]['updateRealtime']=function(){this[_0x56ec('0x12')]=0x0;this[_0x56ec('0x13')]=0x0;for(var _0x1df9ca=0x0;_0x1df9ca<this[_0x56ec('0xb')]['length'];_0x1df9ca+=0x1){if(this[_0x56ec('0xb')][_0x1df9ca][_0x56ec('0x14')]){this[_0x56ec('0x12')]+=0x1;}if(this[_0x56ec('0xb')][_0x1df9ca][_0x56ec('0x15')]){this[_0x56ec('0x13')]+=0x1;}}this[_0x56ec('0x16')]=this[_0x56ec('0x12')]-this['paused'];this[_0x56ec('0x16')]=this[_0x56ec('0x16')]>=0x0?this[_0x56ec('0x16')]:0x0;var _0x2101e1={'id':this['id'],'available':this[_0x56ec('0x16')],'loggedIn':this[_0x56ec('0x12')],'name':this[_0x56ec('0x8')],'paused':this[_0x56ec('0x13')],'waiting':this[_0x56ec('0xd')]};var _0x5d66da=md5(JSON[_0x56ec('0x17')](_0x2101e1));if(this['md5']!==_0x5d66da){this['md5']=_0x5d66da;io['to'](util[_0x56ec('0x18')](_0x56ec('0x19'),_0x2101e1[_0x56ec('0x8')]))[_0x56ec('0x1a')](_0x56ec('0x1b'),_0x2101e1);}};module[_0x56ec('0x1c')]=FaxQueue;
\ No newline at end of file
+var _0x9883=['fax:queue:%s','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','localhost','socket.io-emitter','redis','name','timeout','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','online','paused','available'];(function(_0x46b96a,_0x19ca9a){var _0x444620=function(_0x27bad9){while(--_0x27bad9){_0x46b96a['push'](_0x46b96a['shift']());}};_0x444620(++_0x19ca9a);}(_0x9883,0xf3));var _0x3988=function(_0x47b47c,_0x56a4da){_0x47b47c=_0x47b47c-0x0;var _0x5a4ac5=_0x9883[_0x47b47c];return _0x5a4ac5;};'use strict';var _=require(_0x3988('0x0'));var md5=require(_0x3988('0x1'));var util=require(_0x3988('0x2'));var Redis=require(_0x3988('0x3'));var config=require(_0x3988('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0x3988('0x5'),'port':0x18eb});var io=require(_0x3988('0x6'))(new Redis(config[_0x3988('0x7')]));function FaxQueue(_0x3764ad){this['id']=_0x3764ad['id']||0x0;this[_0x3988('0x8')]=_0x3764ad['name']||'';this[_0x3988('0x9')]=_0x3764ad['timeout']||0xa;this['strategy']=_0x3764ad['strategy']||'beepall';this[_0x3988('0xa')]=_0x3764ad[_0x3988('0xa')];this[_0x3988('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0x3988('0xc')]();this[_0x3988('0xd')]();}FaxQueue[_0x3988('0xe')][_0x3988('0xc')]=function(){var _0x376573=this[_0x3988('0xb')]['_rr'];this[_0x3988('0xb')]=_[_0x3988('0xf')](this['Agents'],'id');this['mapAgentsId'][_0x3988('0x10')]=_0x376573;};FaxQueue[_0x3988('0xe')][_0x3988('0xd')]=function(){this[_0x3988('0x11')]=0x0;this['paused']=0x0;for(var _0x87d12d=0x0;_0x87d12d<this[_0x3988('0xa')]['length'];_0x87d12d+=0x1){if(this[_0x3988('0xa')][_0x87d12d][_0x3988('0x12')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x87d12d]['faxPause']){this[_0x3988('0x13')]+=0x1;}}this[_0x3988('0x14')]=this[_0x3988('0x11')]-this[_0x3988('0x13')];this['available']=this[_0x3988('0x14')]>=0x0?this[_0x3988('0x14')]:0x0;var _0x3d2868={'id':this['id'],'available':this[_0x3988('0x14')],'loggedIn':this[_0x3988('0x11')],'name':this['name'],'paused':this[_0x3988('0x13')],'waiting':this['waiting']};var _0x5351c8=md5(JSON['stringify'](_0x3d2868));if(this[_0x3988('0x1')]!==_0x5351c8){this['md5']=_0x5351c8;io['to'](util['format'](_0x3988('0x15'),_0x3d2868[_0x3988('0x8')]))['emit'](_0x3988('0x16'),_0x3d2868);}};module[_0x3988('0x17')]=FaxQueue;
\ No newline at end of file
index 731b819..831adec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1784=['name','Intervals'];(function(_0x81ac6c,_0x1cf87c){var _0x442c04=function(_0x5f38b7){while(--_0x5f38b7){_0x81ac6c['push'](_0x81ac6c['shift']());}};_0x442c04(++_0x1cf87c);}(_0x1784,0x110));var _0x4178=function(_0x48788c,_0x22c6cf){_0x48788c=_0x48788c-0x0;var _0x111b0f=_0x1784[_0x48788c];return _0x111b0f;};'use strict';function Interval(_0x47df35){this['id']=_0x47df35['id']||0x0;this['name']=_0x47df35[_0x4178('0x0')]||'';this[_0x4178('0x1')]=_0x47df35['Intervals']||{};}module['exports']=Interval;
\ No newline at end of file
+var _0xd6b5=['exports','name','Intervals'];(function(_0x245852,_0x3170a4){var _0xcf70ce=function(_0x1c5a1f){while(--_0x1c5a1f){_0x245852['push'](_0x245852['shift']());}};_0xcf70ce(++_0x3170a4);}(_0xd6b5,0x19c));var _0x5d6b=function(_0x52df21,_0x234152){_0x52df21=_0x52df21-0x0;var _0xe9624a=_0xd6b5[_0x52df21];return _0xe9624a;};'use strict';function Interval(_0x2635b4){this['id']=_0x2635b4['id']||0x0;this[_0x5d6b('0x0')]=_0x2635b4[_0x5d6b('0x0')]||'';this[_0x5d6b('0x1')]=_0x2635b4[_0x5d6b('0x1')]||{};}module[_0x5d6b('0x2')]=Interval;
\ No newline at end of file
index ec61e06..a8f966f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x569f=['mailPause','paused','loggedIn','available','stringify','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','length','online'];(function(_0x3d7012,_0x110509){var _0x194fcc=function(_0x19c181){while(--_0x19c181){_0x3d7012['push'](_0x3d7012['shift']());}};_0x194fcc(++_0x110509);}(_0x569f,0x171));var _0xf569=function(_0x271a95,_0x4d2a07){_0x271a95=_0x271a95-0x0;var _0x3fa489=_0x569f[_0x271a95];return _0x3fa489;};'use strict';var _=require(_0xf569('0x0'));var md5=require(_0xf569('0x1'));var util=require(_0xf569('0x2'));var Redis=require(_0xf569('0x3'));var config=require('../../../config/environment');config[_0xf569('0x4')]=_[_0xf569('0x5')](config['redis'],{'host':_0xf569('0x6'),'port':0x18eb});var io=require(_0xf569('0x7'))(new Redis(config[_0xf569('0x4')]));function MailQueue(_0x226097){this['id']=_0x226097['id']||0x0;this[_0xf569('0x8')]=_0x226097[_0xf569('0x8')]||'';this[_0xf569('0x9')]=_0x226097['timeout']||0xa;this[_0xf569('0xa')]=_0x226097['strategy']||_0xf569('0xb');this['Agents']=_0x226097[_0xf569('0xc')];this['mapAgentsId']={};this[_0xf569('0xd')]=0x0;this[_0xf569('0x1')]='';this[_0xf569('0xe')]();this[_0xf569('0xf')]();}MailQueue[_0xf569('0x10')]['updateRouting']=function(){var _0x47c41b=this[_0xf569('0x11')][_0xf569('0x12')];this['mapAgentsId']=_['map'](this[_0xf569('0xc')],'id');this[_0xf569('0x11')][_0xf569('0x12')]=_0x47c41b;};MailQueue[_0xf569('0x10')][_0xf569('0xf')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x3117b8=0x0;_0x3117b8<this[_0xf569('0xc')][_0xf569('0x13')];_0x3117b8+=0x1){if(this[_0xf569('0xc')][_0x3117b8][_0xf569('0x14')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x3117b8][_0xf569('0x15')]){this[_0xf569('0x16')]+=0x1;}}this['available']=this[_0xf569('0x17')]-this[_0xf569('0x16')];this[_0xf569('0x18')]=this[_0xf569('0x18')]>=0x0?this[_0xf569('0x18')]:0x0;var _0x487add={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf569('0x17')],'name':this[_0xf569('0x8')],'paused':this[_0xf569('0x16')],'waiting':this[_0xf569('0xd')]};var _0x5eaf50=md5(JSON[_0xf569('0x19')](_0x487add));if(this[_0xf569('0x1')]!==_0x5eaf50){this[_0xf569('0x1')]=_0x5eaf50;io['to'](util[_0xf569('0x1a')](_0xf569('0x1b'),_0x487add[_0xf569('0x8')]))['emit'](_0xf569('0x1c'),_0x487add);}};module[_0xf569('0x1d')]=MailQueue;
\ No newline at end of file
+var _0xff75=['length','online','mailPause','available','stringify','md5','mail:queue:%s','emit','mail_queue:save','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused'];(function(_0x292320,_0x58199b){var _0x1587b7=function(_0x30d803){while(--_0x30d803){_0x292320['push'](_0x292320['shift']());}};_0x1587b7(++_0x58199b);}(_0xff75,0x1ad));var _0x5ff7=function(_0x14fa25,_0x3b25ad){_0x14fa25=_0x14fa25-0x0;var _0x2de8d1=_0xff75[_0x14fa25];return _0x2de8d1;};'use strict';var _=require(_0x5ff7('0x0'));var md5=require('md5');var util=require(_0x5ff7('0x1'));var Redis=require(_0x5ff7('0x2'));var config=require(_0x5ff7('0x3'));config['redis']=_[_0x5ff7('0x4')](config[_0x5ff7('0x5')],{'host':_0x5ff7('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x3973f0){this['id']=_0x3973f0['id']||0x0;this[_0x5ff7('0x7')]=_0x3973f0[_0x5ff7('0x7')]||'';this[_0x5ff7('0x8')]=_0x3973f0[_0x5ff7('0x8')]||0xa;this[_0x5ff7('0x9')]=_0x3973f0[_0x5ff7('0x9')]||_0x5ff7('0xa');this['Agents']=_0x3973f0[_0x5ff7('0xb')];this[_0x5ff7('0xc')]={};this[_0x5ff7('0xd')]=0x0;this['md5']='';this[_0x5ff7('0xe')]();this[_0x5ff7('0xf')]();}MailQueue[_0x5ff7('0x10')][_0x5ff7('0xe')]=function(){var _0xf50682=this['mapAgentsId']['_rr'];this[_0x5ff7('0xc')]=_[_0x5ff7('0x11')](this['Agents'],'id');this[_0x5ff7('0xc')][_0x5ff7('0x12')]=_0xf50682;};MailQueue[_0x5ff7('0x10')][_0x5ff7('0xf')]=function(){this[_0x5ff7('0x13')]=0x0;this[_0x5ff7('0x14')]=0x0;for(var _0x473718=0x0;_0x473718<this[_0x5ff7('0xb')][_0x5ff7('0x15')];_0x473718+=0x1){if(this[_0x5ff7('0xb')][_0x473718][_0x5ff7('0x16')]){this[_0x5ff7('0x13')]+=0x1;}if(this[_0x5ff7('0xb')][_0x473718][_0x5ff7('0x17')]){this[_0x5ff7('0x14')]+=0x1;}}this[_0x5ff7('0x18')]=this[_0x5ff7('0x13')]-this[_0x5ff7('0x14')];this['available']=this[_0x5ff7('0x18')]>=0x0?this[_0x5ff7('0x18')]:0x0;var _0x4fb86b={'id':this['id'],'available':this[_0x5ff7('0x18')],'loggedIn':this[_0x5ff7('0x13')],'name':this[_0x5ff7('0x7')],'paused':this[_0x5ff7('0x14')],'waiting':this['waiting']};var _0x209af6=md5(JSON[_0x5ff7('0x19')](_0x4fb86b));if(this[_0x5ff7('0x1a')]!==_0x209af6){this['md5']=_0x209af6;io['to'](util['format'](_0x5ff7('0x1b'),_0x4fb86b[_0x5ff7('0x7')]))[_0x5ff7('0x1c')](_0x5ff7('0x1d'),_0x4fb86b);}};module['exports']=MailQueue;
\ No newline at end of file
index 26a5bb6..8bcb0ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x7a54,0x106));var _0x47a5=function(_0x2ef4b5,_0x4e3727){_0x2ef4b5=_0x2ef4b5-0x0;var _0x1c9b9b=_0x7a54[_0x2ef4b5];return _0x1c9b9b;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25<this[_0x47a5('0x10')][_0x47a5('0x14')];_0x139f25+=0x1){if(this[_0x47a5('0x10')][_0x139f25]['online']){this[_0x47a5('0x12')]+=0x1;}if(this[_0x47a5('0x10')][_0x139f25][_0x47a5('0x15')]){this[_0x47a5('0x13')]+=0x1;}}this[_0x47a5('0x16')]=this['loggedIn']-this['paused'];this[_0x47a5('0x16')]=this['available']>=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue;
\ No newline at end of file
+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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x326f,0xd1));var _0xf326=function(_0x546859,_0x2f7cfc){_0x546859=_0x546859-0x0;var _0x36a2ce=_0x326f[_0x546859];return _0x36a2ce;};'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
index 7994b08..2449920 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','smsPause'];(function(_0x232eca,_0x1c5dd3){var _0x1b4a9c=function(_0x55704e){while(--_0x55704e){_0x232eca['push'](_0x232eca['shift']());}};_0x1b4a9c(++_0x1c5dd3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function SmsQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}SmsQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};SmsQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227<this[_0x0a9e('0xf')][_0x0a9e('0x13')];_0x2b4227+=0x1){if(this[_0x0a9e('0xf')][_0x2b4227]['online']){this[_0x0a9e('0x11')]+=0x1;}if(this['Agents'][_0x2b4227][_0x0a9e('0x14')]){this['paused']+=0x1;}}this[_0x0a9e('0x15')]=this[_0x0a9e('0x11')]-this['paused'];this[_0x0a9e('0x15')]=this['available']>=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('sms:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('sms_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=SmsQueue;
\ No newline at end of file
+var _0xfa2b=['strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x12db8e,_0x6428c3){var _0x206ebd=function(_0x3946e){while(--_0x3946e){_0x12db8e['push'](_0x12db8e['shift']());}};_0x206ebd(++_0x6428c3);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x1dffbb,_0x5583e4){_0x1dffbb=_0x1dffbb-0x0;var _0x4a12e6=_0xfa2b[_0x1dffbb];return _0x4a12e6;};'use strict';var _=require(_0xbfa2('0x0'));var md5=require(_0xbfa2('0x1'));var util=require(_0xbfa2('0x2'));var Redis=require(_0xbfa2('0x3'));var config=require(_0xbfa2('0x4'));config[_0xbfa2('0x5')]=_[_0xbfa2('0x6')](config[_0xbfa2('0x5')],{'host':_0xbfa2('0x7'),'port':0x18eb});var io=require(_0xbfa2('0x8'))(new Redis(config[_0xbfa2('0x5')]));function SmsQueue(_0x2e8f3b){this['id']=_0x2e8f3b['id']||0x0;this[_0xbfa2('0x9')]=_0x2e8f3b[_0xbfa2('0x9')]||'';this[_0xbfa2('0xa')]=_0x2e8f3b[_0xbfa2('0xa')]||0xa;this['strategy']=_0x2e8f3b[_0xbfa2('0xb')]||'beepall';this[_0xbfa2('0xc')]=_0x2e8f3b[_0xbfa2('0xc')];this[_0xbfa2('0xd')]={};this[_0xbfa2('0xe')]=0x0;this[_0xbfa2('0x1')]='';this[_0xbfa2('0xf')]();this[_0xbfa2('0x10')]();}SmsQueue[_0xbfa2('0x11')][_0xbfa2('0xf')]=function(){var _0x4e0f1e=this['mapAgentsId']['_rr'];this[_0xbfa2('0xd')]=_[_0xbfa2('0x12')](this[_0xbfa2('0xc')],'id');this[_0xbfa2('0xd')][_0xbfa2('0x13')]=_0x4e0f1e;};SmsQueue[_0xbfa2('0x11')]['updateRealtime']=function(){this[_0xbfa2('0x14')]=0x0;this[_0xbfa2('0x15')]=0x0;for(var _0x458653=0x0;_0x458653<this[_0xbfa2('0xc')][_0xbfa2('0x16')];_0x458653+=0x1){if(this['Agents'][_0x458653][_0xbfa2('0x17')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x458653][_0xbfa2('0x18')]){this['paused']+=0x1;}}this['available']=this[_0xbfa2('0x14')]-this[_0xbfa2('0x15')];this['available']=this[_0xbfa2('0x19')]>=0x0?this[_0xbfa2('0x19')]:0x0;var _0x28fe6f={'id':this['id'],'available':this[_0xbfa2('0x19')],'loggedIn':this[_0xbfa2('0x14')],'name':this[_0xbfa2('0x9')],'paused':this[_0xbfa2('0x15')],'waiting':this['waiting']};var _0xb805f7=md5(JSON[_0xbfa2('0x1a')](_0x28fe6f));if(this[_0xbfa2('0x1')]!==_0xb805f7){this['md5']=_0xb805f7;io['to'](util[_0xbfa2('0x1b')](_0xbfa2('0x1c'),_0x28fe6f['name']))[_0xbfa2('0x1d')]('sms_queue:save',_0x28fe6f);}};module['exports']=SmsQueue;
\ No newline at end of file
index cb86bf1..d353d17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35e6=['Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','online','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','name','timeout','strategy','beepall'];(function(_0xd5a842,_0x3bef1f){var _0xcedd84=function(_0x1b0965){while(--_0x1b0965){_0xd5a842['push'](_0xd5a842['shift']());}};_0xcedd84(++_0x3bef1f);}(_0x35e6,0x134));var _0x635e=function(_0x26f9b2,_0x22227f){_0x26f9b2=_0x26f9b2-0x0;var _0x28b3ff=_0x35e6[_0x26f9b2];return _0x28b3ff;};'use strict';var _=require(_0x635e('0x0'));var md5=require(_0x635e('0x1'));var util=require(_0x635e('0x2'));var Redis=require(_0x635e('0x3'));var config=require(_0x635e('0x4'));config[_0x635e('0x5')]=_[_0x635e('0x6')](config[_0x635e('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x635e('0x5')]));function WhatsappQueue(_0x5ebb6a){this['id']=_0x5ebb6a['id']||0x0;this['name']=_0x5ebb6a[_0x635e('0x7')]||'';this[_0x635e('0x8')]=_0x5ebb6a[_0x635e('0x8')]||0xa;this[_0x635e('0x9')]=_0x5ebb6a[_0x635e('0x9')]||_0x635e('0xa');this[_0x635e('0xb')]=_0x5ebb6a['Agents'];this[_0x635e('0xc')]={};this[_0x635e('0xd')]=0x0;this[_0x635e('0x1')]='';this['updateRouting']();this[_0x635e('0xe')]();}WhatsappQueue[_0x635e('0xf')][_0x635e('0x10')]=function(){var _0x366904=this['mapAgentsId'][_0x635e('0x11')];this[_0x635e('0xc')]=_[_0x635e('0x12')](this[_0x635e('0xb')],'id');this[_0x635e('0xc')][_0x635e('0x11')]=_0x366904;};WhatsappQueue[_0x635e('0xf')]['updateRealtime']=function(){this[_0x635e('0x13')]=0x0;this[_0x635e('0x14')]=0x0;for(var _0x5704c2=0x0;_0x5704c2<this['Agents'][_0x635e('0x15')];_0x5704c2+=0x1){if(this[_0x635e('0xb')][_0x5704c2][_0x635e('0x16')]){this[_0x635e('0x13')]+=0x1;}if(this[_0x635e('0xb')][_0x5704c2]['whatsappPause']){this['paused']+=0x1;}}this[_0x635e('0x17')]=this[_0x635e('0x13')]-this['paused'];this['available']=this[_0x635e('0x17')]>=0x0?this[_0x635e('0x17')]:0x0;var _0x473195={'id':this['id'],'available':this[_0x635e('0x17')],'loggedIn':this[_0x635e('0x13')],'name':this[_0x635e('0x7')],'paused':this[_0x635e('0x14')],'waiting':this[_0x635e('0xd')]};var _0x8ff411=md5(JSON[_0x635e('0x18')](_0x473195));if(this[_0x635e('0x1')]!==_0x8ff411){this[_0x635e('0x1')]=_0x8ff411;io['to'](util[_0x635e('0x19')](_0x635e('0x1a'),_0x473195[_0x635e('0x7')]))[_0x635e('0x1b')](_0x635e('0x1c'),_0x473195);}};module['exports']=WhatsappQueue;
\ No newline at end of file
+var _0x4503=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','_rr','mapAgentsId','map','paused','length','online','loggedIn','whatsappPause','available','waiting','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis'];(function(_0x43c267,_0x1801ea){var _0x4e0338=function(_0x49fad0){while(--_0x49fad0){_0x43c267['push'](_0x43c267['shift']());}};_0x4e0338(++_0x1801ea);}(_0x4503,0x95));var _0x3450=function(_0x77a7d9,_0x14a3fc){_0x77a7d9=_0x77a7d9-0x0;var _0x226269=_0x4503[_0x77a7d9];return _0x226269;};'use strict';var _=require(_0x3450('0x0'));var md5=require(_0x3450('0x1'));var util=require(_0x3450('0x2'));var Redis=require(_0x3450('0x3'));var config=require(_0x3450('0x4'));config[_0x3450('0x5')]=_['defaults'](config[_0x3450('0x5')],{'host':_0x3450('0x6'),'port':0x18eb});var io=require(_0x3450('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x5148d4){this['id']=_0x5148d4['id']||0x0;this[_0x3450('0x8')]=_0x5148d4[_0x3450('0x8')]||'';this[_0x3450('0x9')]=_0x5148d4[_0x3450('0x9')]||0xa;this[_0x3450('0xa')]=_0x5148d4[_0x3450('0xa')]||_0x3450('0xb');this[_0x3450('0xc')]=_0x5148d4[_0x3450('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x3450('0x1')]='';this[_0x3450('0xd')]();this[_0x3450('0xe')]();}WhatsappQueue[_0x3450('0xf')][_0x3450('0xd')]=function(){var _0x36ec52=this['mapAgentsId'][_0x3450('0x10')];this[_0x3450('0x11')]=_[_0x3450('0x12')](this[_0x3450('0xc')],'id');this[_0x3450('0x11')]['_rr']=_0x36ec52;};WhatsappQueue[_0x3450('0xf')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x3450('0x13')]=0x0;for(var _0x460fb=0x0;_0x460fb<this['Agents'][_0x3450('0x14')];_0x460fb+=0x1){if(this[_0x3450('0xc')][_0x460fb][_0x3450('0x15')]){this[_0x3450('0x16')]+=0x1;}if(this[_0x3450('0xc')][_0x460fb][_0x3450('0x17')]){this[_0x3450('0x13')]+=0x1;}}this['available']=this['loggedIn']-this[_0x3450('0x13')];this['available']=this[_0x3450('0x18')]>=0x0?this[_0x3450('0x18')]:0x0;var _0x4288d7={'id':this['id'],'available':this[_0x3450('0x18')],'loggedIn':this[_0x3450('0x16')],'name':this[_0x3450('0x8')],'paused':this[_0x3450('0x13')],'waiting':this[_0x3450('0x19')]};var _0x3a0b38=md5(JSON[_0x3450('0x1a')](_0x4288d7));if(this['md5']!==_0x3a0b38){this[_0x3450('0x1')]=_0x3a0b38;io['to'](util[_0x3450('0x1b')](_0x3450('0x1c'),_0x4288d7['name']))['emit'](_0x3450('0x1d'),_0x4288d7);}};module[_0x3450('0x1e')]=WhatsappQueue;
\ No newline at end of file
index 75930f3..83428a8 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(_0x426ef9,_0x17b1f4){var _0x1cbe78=function(_0x143e69){while(--_0x143e69){_0x426ef9['push'](_0x426ef9['shift']());}};_0x1cbe78(++_0x17b1f4);}(_0xb10b,0x12a));var _0xbb10=function(_0x2657f7,_0x15c229){_0x2657f7=_0x2657f7-0x0;var _0x6d956=_0xb10b[_0x2657f7];return _0x6d956;};'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(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 592d34f..352d1f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x970b=['Request','AddTagsToChatInteraction','addTagsToChatInteraction','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x2fa121,_0xec2882){var _0x1d7a1f=function(_0x393d05){while(--_0x393d05){_0x2fa121['push'](_0x2fa121['shift']());}};_0x1d7a1f(++_0xec2882);}(_0x970b,0x7b));var _0xb970=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x970b[_0x26f702];return _0x11417d;};'use strict';var client=require('../client');exports['update']=function(_0x213709,_0x4d3774){return client['Request'](_0xb970('0x0'),{'body':_0x4d3774,'options':{'where':{'id':_0x213709}},'log':_0xb970('0x1')});};exports[_0xb970('0x2')]=function(_0x354116,_0x52f3f3){return client[_0xb970('0x3')](_0xb970('0x4'),{'body':_0x52f3f3,'options':{'where':{'id':_0x354116}},'log':_0xb970('0x5')});};
\ No newline at end of file
+var _0xadeb=['addTagsToChatInteraction','update','Request','AddTagsToChatInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadeb,0x115));var _0xbade=function(_0x1c549c,_0x3e44be){_0x1c549c=_0x1c549c-0x0;var _0x5d8040=_0xadeb[_0x1c549c];return _0x5d8040;};'use strict';var client=require('../client');exports[_0xbade('0x0')]=function(_0x14174b,_0x36f568){return client[_0xbade('0x1')]('UpdateChatInteraction',{'body':_0x36f568,'options':{'where':{'id':_0x14174b}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x1d69c7,_0x5999a4){return client['Request'](_0xbade('0x2'),{'body':_0x5999a4,'options':{'where':{'id':_0x1d69c7}},'log':_0xbade('0x3')});};
\ No newline at end of file
index 7fe9fcb..62cb174 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa7=['createChatMessage','../client','create'];(function(_0x514f8c,_0x149740){var _0x3fbf72=function(_0x55bb5a){while(--_0x55bb5a){_0x514f8c['push'](_0x514f8c['shift']());}};_0x3fbf72(++_0x149740);}(_0x6aa7,0x1ed));var _0x76aa=function(_0x3c2032,_0x2866ff){_0x3c2032=_0x3c2032-0x0;var _0x1d0027=_0x6aa7[_0x3c2032];return _0x1d0027;};'use strict';var client=require(_0x76aa('0x0'));exports[_0x76aa('0x1')]=function(_0x3b3af4){return client['Request']('CreateChatMessage',{'body':_0x3b3af4,'log':_0x76aa('0x2')});};
\ No newline at end of file
+var _0x6622=['create','createChatMessage','../client'];(function(_0x4216ad,_0x2a4fe6){var _0x2e571e=function(_0x2a672f){while(--_0x2a672f){_0x4216ad['push'](_0x4216ad['shift']());}};_0x2e571e(++_0x2a4fe6);}(_0x6622,0x155));var _0x2662=function(_0x31e584,_0x4d9f7f){_0x31e584=_0x31e584-0x0;var _0x5686d0=_0x6622[_0x31e584];return _0x5686d0;};'use strict';var client=require(_0x2662('0x0'));exports[_0x2662('0x1')]=function(_0x53993f){return client['Request']('CreateChatMessage',{'body':_0x53993f,'log':_0x2662('0x2')});};
\ No newline at end of file
index 89f263b..61ebd21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3a7=['getChatQueues','Request','GetChatQueue','name','timeout','strategy','User','Agents','online'];(function(_0x1353e8,_0x27a8bb){var _0x116132=function(_0x1e9d98){while(--_0x1e9d98){_0x1353e8['push'](_0x1353e8['shift']());}};_0x116132(++_0x27a8bb);}(_0xf3a7,0x99));var _0x7f3a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf3a7[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports[_0x7f3a('0x0')]=function(){return function(){return client[_0x7f3a('0x1')](_0x7f3a('0x2'),{'options':{'raw':![],'attributes':['id',_0x7f3a('0x3'),_0x7f3a('0x4'),_0x7f3a('0x5')],'include':[{'model':_0x7f3a('0x6'),'as':_0x7f3a('0x7'),'attributes':['id',_0x7f3a('0x3'),_0x7f3a('0x8'),'chatPause']}]},'log':_0x7f3a('0x0')});};};
\ No newline at end of file
+var _0xf3be=['Request','GetChatQueue','timeout','online','chatPause','../client','getChatQueues'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xf3be,0x1e1));var _0xef3b=function(_0x50d4c2,_0x5ee069){_0x50d4c2=_0x50d4c2-0x0;var _0x1f4759=_0xf3be[_0x50d4c2];return _0x1f4759;};'use strict';var client=require(_0xef3b('0x0'));exports[_0xef3b('0x1')]=function(){return function(){return client[_0xef3b('0x2')](_0xef3b('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xef3b('0x4'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0xef3b('0x5'),_0xef3b('0x6')]}]},'log':'getChatQueues'});};};
\ No newline at end of file
index f057add..1ed9b09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ec2=['../client','create','CreateChatQueueReport','Request','UpdateChatQueueReport','DESC'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ec2,0x15c));var _0x27ec=function(_0x336062,_0x3e1936){_0x336062=_0x336062-0x0;var _0x52d055=_0x7ec2[_0x336062];return _0x52d055;};'use strict';var client=require(_0x27ec('0x0'));exports[_0x27ec('0x1')]=function(_0x29b076){return client['Request'](_0x27ec('0x2'),{'body':_0x29b076,'log':_0x27ec('0x2')});};exports['update']=function(_0x45b293,_0x340231){return client[_0x27ec('0x3')](_0x27ec('0x4'),{'body':_0x340231,'options':{'where':{'uniqueid':_0x45b293},'order':[['id',_0x27ec('0x5')]],'limit':0x1},'log':_0x27ec('0x4')});};
\ No newline at end of file
+var _0xd3d1=['create','CreateChatQueueReport','update','Request','UpdateChatQueueReport','DESC','../client'];(function(_0x3a49b5,_0x2b6904){var _0x4a3201=function(_0x2745f0){while(--_0x2745f0){_0x3a49b5['push'](_0x3a49b5['shift']());}};_0x4a3201(++_0x2b6904);}(_0xd3d1,0x172));var _0x1d3d=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xd3d1[_0x3e5086];return _0xfeb102;};'use strict';var client=require(_0x1d3d('0x0'));exports[_0x1d3d('0x1')]=function(_0x49043e){return client['Request'](_0x1d3d('0x2'),{'body':_0x49043e,'log':_0x1d3d('0x2')});};exports[_0x1d3d('0x3')]=function(_0xfd3615,_0x41a806){return client[_0x1d3d('0x4')](_0x1d3d('0x5'),{'body':_0x41a806,'options':{'where':{'uniqueid':_0xfd3615},'order':[['id',_0x1d3d('0x6')]],'limit':0x1},'log':_0x1d3d('0x5')});};
\ No newline at end of file
index 07fe2c1..5bdae3d 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(_0x5ed624,_0x322f34){var _0x59bfba=function(_0x2a6464){while(--_0x2a6464){_0x5ed624['push'](_0x5ed624['shift']());}};_0x59bfba(++_0x322f34);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_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(_0x367bad,_0x1eea19){var _0x3a99d3=function(_0x403c33){while(--_0x403c33){_0x367bad['push'](_0x367bad['shift']());}};_0x3a99d3(++_0x1eea19);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
index 7611594..553ddfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bd7=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x5eb294,_0x5b52ba){var _0xd139fd=function(_0x52e319){while(--_0x52e319){_0x5eb294['push'](_0x5eb294['shift']());}};_0xd139fd(++_0x5b52ba);}(_0x3bd7,0x196));var _0x73bd=function(_0x507965,_0x4944f4){_0x507965=_0x507965-0x0;var _0x3608fc=_0x3bd7[_0x507965];return _0x3608fc;};'use strict';var client=require(_0x73bd('0x0'));exports[_0x73bd('0x1')]=function(_0x3ab0d7){return client[_0x73bd('0x2')](_0x73bd('0x3'),{'body':_0x3ab0d7,'log':_0x73bd('0x4')});};
\ No newline at end of file
+var _0x533f=['create','CreateFaxMessage','../client'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x533f,0x1d6));var _0xf533=function(_0x53afe9,_0x2c9f40){_0x53afe9=_0x53afe9-0x0;var _0x396396=_0x533f[_0x53afe9];return _0x396396;};'use strict';var client=require(_0xf533('0x0'));exports[_0xf533('0x1')]=function(_0x4a00b5){return client['Request'](_0xf533('0x2'),{'body':_0x4a00b5,'log':'createFaxMessage'});};
\ No newline at end of file
index 3df2b47..70daefc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6606=['User','Agents','name','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','timeout','strategy'];(function(_0x34fb5c,_0x47d527){var _0x1d6804=function(_0x112b5c){while(--_0x112b5c){_0x34fb5c['push'](_0x34fb5c['shift']());}};_0x1d6804(++_0x47d527);}(_0x6606,0xe1));var _0x6660=function(_0x2d3906,_0x14de5a){_0x2d3906=_0x2d3906-0x0;var _0x59e341=_0x6606[_0x2d3906];return _0x59e341;};'use strict';var client=require(_0x6660('0x0'));exports[_0x6660('0x1')]=function(){return function(){return client[_0x6660('0x2')](_0x6660('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x6660('0x4'),_0x6660('0x5')],'include':[{'model':_0x6660('0x6'),'as':_0x6660('0x7'),'attributes':['id',_0x6660('0x8'),_0x6660('0x9'),_0x6660('0xa')]}]},'log':'getFaxQueues'});};};
\ No newline at end of file
+var _0xfa70=['../client','getFaxQueues','Request','GetFaxQueue','name','strategy','Agents','faxPause'];(function(_0x59e1df,_0x1ceada){var _0x1b37c0=function(_0x4b7472){while(--_0x4b7472){_0x59e1df['push'](_0x59e1df['shift']());}};_0x1b37c0(++_0x1ceada);}(_0xfa70,0x160));var _0x0fa7=function(_0x12d121,_0x1ef59d){_0x12d121=_0x12d121-0x0;var _0x1af836=_0xfa70[_0x12d121];return _0x1af836;};'use strict';var client=require(_0x0fa7('0x0'));exports[_0x0fa7('0x1')]=function(){return function(){return client[_0x0fa7('0x2')](_0x0fa7('0x3'),{'options':{'raw':![],'attributes':['id',_0x0fa7('0x4'),'timeout',_0x0fa7('0x5')],'include':[{'model':'User','as':_0x0fa7('0x6'),'attributes':['id',_0x0fa7('0x4'),'online',_0x0fa7('0x7')]}]},'log':'getFaxQueues'});};};
\ No newline at end of file
index c7a17d0..63ac316 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebd1=['Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','create'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xebd1,0x18f));var _0x1ebd=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0xebd1[_0x5beda8];return _0x2aa042;};'use strict';var client=require('../client');exports[_0x1ebd('0x0')]=function(_0x5ec98a){return client[_0x1ebd('0x1')](_0x1ebd('0x2'),{'body':_0x5ec98a,'log':_0x1ebd('0x2')});};exports[_0x1ebd('0x3')]=function(_0x233f7a,_0x5b5b9d){return client[_0x1ebd('0x1')](_0x1ebd('0x4'),{'body':_0x5b5b9d,'options':{'where':{'uniqueid':_0x233f7a},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
+var _0xb7e9=['Request','CreateFaxQueueReport','update','DESC','UpdateFaxQueueReport','../client','create'];(function(_0x31661f,_0x41dcb0){var _0x41e0df=function(_0xe27ec3){while(--_0xe27ec3){_0x31661f['push'](_0x31661f['shift']());}};_0x41e0df(++_0x41dcb0);}(_0xb7e9,0x67));var _0x9b7e=function(_0x531ec4,_0x203380){_0x531ec4=_0x531ec4-0x0;var _0x43fd6f=_0xb7e9[_0x531ec4];return _0x43fd6f;};'use strict';var client=require(_0x9b7e('0x0'));exports[_0x9b7e('0x1')]=function(_0x352fc2){return client[_0x9b7e('0x2')]('CreateFaxQueueReport',{'body':_0x352fc2,'log':_0x9b7e('0x3')});};exports[_0x9b7e('0x4')]=function(_0x557b89,_0x53af8b){return client[_0x9b7e('0x2')]('UpdateFaxQueueReport',{'body':_0x53af8b,'options':{'where':{'uniqueid':_0x557b89},'order':[['id',_0x9b7e('0x5')]],'limit':0x1},'log':_0x9b7e('0x6')});};
\ No newline at end of file
index 10e7a48..6b56479 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5651=['Request','GetInterval','Interval','Intervals','name','interval','../client','getIntervals'];(function(_0x13f284,_0x5cc963){var _0x14766a=function(_0x27ad35){while(--_0x27ad35){_0x13f284['push'](_0x13f284['shift']());}};_0x14766a(++_0x5cc963);}(_0x5651,0xc6));var _0x1565=function(_0x6173fc,_0x32aadf){_0x6173fc=_0x6173fc-0x0;var _0x965fbe=_0x5651[_0x6173fc];return _0x965fbe;};'use strict';var client=require(_0x1565('0x0'));exports[_0x1565('0x1')]=function(){return function(){return client[_0x1565('0x2')](_0x1565('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x1565('0x4'),'as':_0x1565('0x5'),'attributes':['id',_0x1565('0x6'),_0x1565('0x7')]}]},'log':'getIntervals'});};};
\ No newline at end of file
+var _0x0592=['name','Interval','getIntervals','Request'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0x0592,0x9a));var _0x2059=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0592[_0xfae23b];return _0x200640;};'use strict';var client=require('../client');exports[_0x2059('0x0')]=function(){return function(){return client[_0x2059('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2059('0x2')],'include':[{'model':_0x2059('0x3'),'as':'Intervals','attributes':['id',_0x2059('0x2'),'interval']}]},'log':_0x2059('0x0')});};};
\ No newline at end of file
index ec9d527..a7b666e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1399=['UpdateMailInteraction','updateMailInteraction','addTags','Request','../client','update'];(function(_0x2192fd,_0x1e653a){var _0x2b0581=function(_0x3f18c6){while(--_0x3f18c6){_0x2192fd['push'](_0x2192fd['shift']());}};_0x2b0581(++_0x1e653a);}(_0x1399,0x16c));var _0x9139=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0x1399[_0x367e5b];return _0x4b909e;};'use strict';var client=require(_0x9139('0x0'));exports[_0x9139('0x1')]=function(_0x5740a9,_0x474911){return client['Request'](_0x9139('0x2'),{'body':_0x474911,'options':{'where':{'id':_0x5740a9}},'log':_0x9139('0x3')});};exports[_0x9139('0x4')]=function(_0x28f155,_0x251798){return client[_0x9139('0x5')]('AddTagsToMailInteraction',{'body':_0x251798,'options':{'where':{'id':_0x28f155}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
+var _0x5464=['update','Request','updateMailInteraction','AddTagsToMailInteraction','../client'];(function(_0x4de441,_0x2ead4f){var _0x244809=function(_0x121310){while(--_0x121310){_0x4de441['push'](_0x4de441['shift']());}};_0x244809(++_0x2ead4f);}(_0x5464,0x15d));var _0x4546=function(_0x2a88c3,_0x866537){_0x2a88c3=_0x2a88c3-0x0;var _0x386992=_0x5464[_0x2a88c3];return _0x386992;};'use strict';var client=require(_0x4546('0x0'));exports[_0x4546('0x1')]=function(_0x159e14,_0x4f33fd){return client[_0x4546('0x2')]('UpdateMailInteraction',{'body':_0x4f33fd,'options':{'where':{'id':_0x159e14}},'log':_0x4546('0x3')});};exports['addTags']=function(_0x320c4d,_0x396a1d){return client[_0x4546('0x2')](_0x4546('0x4'),{'body':_0x396a1d,'options':{'where':{'id':_0x320c4d}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index 909b41a..b5d2696 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b61=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x4b61,0x1e9));var _0x14b6=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4b61[_0x4b369d];return _0x571a98;};'use strict';var client=require(_0x14b6('0x0'));exports[_0x14b6('0x1')]=function(_0x385b84){return client[_0x14b6('0x2')](_0x14b6('0x3'),{'body':_0x385b84,'log':_0x14b6('0x4')});};
\ No newline at end of file
+var _0xd07e=['createMailMessage','../client','create','Request'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0xd07e,0x14d));var _0xed07=function(_0x4d8b33,_0x5c04f0){_0x4d8b33=_0x4d8b33-0x0;var _0x1e757a=_0xd07e[_0x4d8b33];return _0x1e757a;};'use strict';var client=require(_0xed07('0x0'));exports[_0xed07('0x1')]=function(_0xfe1ba6){return client[_0xed07('0x2')]('CreateMailMessage',{'body':_0xfe1ba6,'log':_0xed07('0x3')});};
\ No newline at end of file
index 18abf52..91c4ed4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c04=['../client','Request','GetMailQueue','timeout','strategy','name','online','mailPause'];(function(_0x421b4f,_0x363b8e){var _0xb6e65b=function(_0x269b0a){while(--_0x269b0a){_0x421b4f['push'](_0x421b4f['shift']());}};_0xb6e65b(++_0x363b8e);}(_0x7c04,0x120));var _0x47c0=function(_0x212e2f,_0x4a3476){_0x212e2f=_0x212e2f-0x0;var _0x379583=_0x7c04[_0x212e2f];return _0x379583;};'use strict';var client=require(_0x47c0('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x47c0('0x1')](_0x47c0('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x47c0('0x3'),_0x47c0('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x47c0('0x5'),_0x47c0('0x6'),_0x47c0('0x7')]}]},'log':'getMailQueues'});};};
\ No newline at end of file
+var _0x081a=['name','online','mailPause','getMailQueues','../client','Request','Agents'];(function(_0x2f4c84,_0x48a2c2){var _0x3dfb36=function(_0x330ac4){while(--_0x330ac4){_0x2f4c84['push'](_0x2f4c84['shift']());}};_0x3dfb36(++_0x48a2c2);}(_0x081a,0xeb));var _0xa081=function(_0xb98825,_0x554182){_0xb98825=_0xb98825-0x0;var _0x451d90=_0x081a[_0xb98825];return _0x451d90;};'use strict';var client=require(_0xa081('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xa081('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':'User','as':_0xa081('0x2'),'attributes':['id',_0xa081('0x3'),_0xa081('0x4'),_0xa081('0x5')]}]},'log':_0xa081('0x6')});};};
\ No newline at end of file
index 56eecbc..91194e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x162b=['UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport','update','DESC'];(function(_0xb119da,_0x42d325){var _0x3ecb48=function(_0x361539){while(--_0x361539){_0xb119da['push'](_0xb119da['shift']());}};_0x3ecb48(++_0x42d325);}(_0x162b,0x17b));var _0xb162=function(_0x42c06b,_0x28cb52){_0x42c06b=_0x42c06b-0x0;var _0x3a84dd=_0x162b[_0x42c06b];return _0x3a84dd;};'use strict';var client=require(_0xb162('0x0'));exports[_0xb162('0x1')]=function(_0x17bdb){return client[_0xb162('0x2')](_0xb162('0x3'),{'body':_0x17bdb,'log':'CreateMailQueueReport'});};exports[_0xb162('0x4')]=function(_0x3572a3,_0x1446c8){return client['Request']('UpdateMailQueueReport',{'body':_0x1446c8,'options':{'where':{'uniqueid':_0x3572a3},'order':[['id',_0xb162('0x5')]],'limit':0x1},'log':_0xb162('0x6')});};
\ No newline at end of file
+var _0x0231=['../client','create','Request','CreateMailQueueReport'];(function(_0x2db3ec,_0x51390e){var _0x3599f7=function(_0x2dab32){while(--_0x2dab32){_0x2db3ec['push'](_0x2db3ec['shift']());}};_0x3599f7(++_0x51390e);}(_0x0231,0x1ec));var _0x1023=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x0231[_0x4b2863];return _0x567d67;};'use strict';var client=require(_0x1023('0x0'));exports[_0x1023('0x1')]=function(_0x450da7){return client[_0x1023('0x2')](_0x1023('0x3'),{'body':_0x450da7,'log':_0x1023('0x3')});};exports['update']=function(_0x50a5a6,_0x5bf7fc){return client[_0x1023('0x2')]('UpdateMailQueueReport',{'body':_0x5bf7fc,'options':{'where':{'uniqueid':_0x50a5a6},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
index 808d491..ea2e585 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32ba=['addTagsToChatInteraction','../client','update','Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0x32ba,0x143));var _0xa32b=function(_0x21ecc8,_0x2bdead){_0x21ecc8=_0x21ecc8-0x0;var _0x510c1d=_0x32ba[_0x21ecc8];return _0x510c1d;};'use strict';var client=require(_0xa32b('0x0'));exports[_0xa32b('0x1')]=function(_0x44f2f5,_0x53a487){return client[_0xa32b('0x2')]('UpdateOpenchannelInteraction',{'body':_0x53a487,'options':{'where':{'id':_0x44f2f5}},'log':_0xa32b('0x3')});};exports[_0xa32b('0x4')]=function(_0x47890a,_0x519114){return client[_0xa32b('0x2')](_0xa32b('0x5'),{'body':_0x519114,'options':{'where':{'id':_0x47890a}},'log':_0xa32b('0x6')});};
\ No newline at end of file
+var _0x5138=['Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x5138,0x173));var _0x8513=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0x5138[_0x3a6e4b];return _0x36572d;};'use strict';var client=require(_0x8513('0x0'));exports[_0x8513('0x1')]=function(_0x552400,_0x3c57bc){return client['Request'](_0x8513('0x2'),{'body':_0x3c57bc,'options':{'where':{'id':_0x552400}},'log':_0x8513('0x3')});};exports[_0x8513('0x4')]=function(_0x219517,_0x243339){return client[_0x8513('0x5')](_0x8513('0x6'),{'body':_0x243339,'options':{'where':{'id':_0x219517}},'log':_0x8513('0x7')});};
\ No newline at end of file
index 0f9c836..710a92f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97c5=['createOpenchannelMessage','../client','Request','CreateOpenchannelMessage'];(function(_0x443046,_0x346ca1){var _0x488b3f=function(_0x4e4381){while(--_0x4e4381){_0x443046['push'](_0x443046['shift']());}};_0x488b3f(++_0x346ca1);}(_0x97c5,0x1a1));var _0x597c=function(_0x5a3e80,_0x56b92a){_0x5a3e80=_0x5a3e80-0x0;var _0x586d44=_0x97c5[_0x5a3e80];return _0x586d44;};'use strict';var client=require(_0x597c('0x0'));exports['create']=function(_0x5a8c47){return client[_0x597c('0x1')](_0x597c('0x2'),{'body':_0x5a8c47,'log':_0x597c('0x3')});};
\ No newline at end of file
+var _0xbe03=['CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x130bab,_0x470b73){var _0x232619=function(_0x36d041){while(--_0x36d041){_0x130bab['push'](_0x130bab['shift']());}};_0x232619(++_0x470b73);}(_0xbe03,0x185));var _0x3be0=function(_0xc826ca,_0x19ed72){_0xc826ca=_0xc826ca-0x0;var _0x1e16f0=_0xbe03[_0xc826ca];return _0x1e16f0;};'use strict';var client=require(_0x3be0('0x0'));exports['create']=function(_0x370381){return client['Request'](_0x3be0('0x1'),{'body':_0x370381,'log':_0x3be0('0x2')});};
\ No newline at end of file
index 4b61a5e..fe15691 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4e7=['Agents','online','openchannelPause','getOpenchannelQueues','GetOpenchannelQueue','name','timeout','strategy'];(function(_0x1d65e5,_0x22b4ea){var _0x1d4552=function(_0x4e1f71){while(--_0x4e1f71){_0x1d65e5['push'](_0x1d65e5['shift']());}};_0x1d4552(++_0x22b4ea);}(_0xd4e7,0x1ab));var _0x7d4e=function(_0x161150,_0x17cd81){_0x161150=_0x161150-0x0;var _0x2cba96=_0xd4e7[_0x161150];return _0x2cba96;};'use strict';var client=require('../client');exports[_0x7d4e('0x0')]=function(){return function(){return client['Request'](_0x7d4e('0x1'),{'options':{'raw':![],'attributes':['id',_0x7d4e('0x2'),_0x7d4e('0x3'),_0x7d4e('0x4')],'include':[{'model':'User','as':_0x7d4e('0x5'),'attributes':['id','name',_0x7d4e('0x6'),_0x7d4e('0x7')]}]},'log':_0x7d4e('0x0')});};};
\ No newline at end of file
+var _0xc66c=['GetOpenchannelQueue','name','timeout','strategy','User','Agents','getOpenchannelQueues','../client'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xc66c,0x77));var _0xcc66=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xc66c[_0x2f5ac5];return _0x37c9a8;};'use strict';var client=require(_0xcc66('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client['Request'](_0xcc66('0x1'),{'options':{'raw':![],'attributes':['id',_0xcc66('0x2'),_0xcc66('0x3'),_0xcc66('0x4')],'include':[{'model':_0xcc66('0x5'),'as':_0xcc66('0x6'),'attributes':['id','name','online','openchannelPause']}]},'log':_0xcc66('0x7')});};};
\ No newline at end of file
index a5ce07a..8bff197 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5193=['DESC','../client','create','CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport'];(function(_0x2357c1,_0x5f8fdb){var _0x4dc463=function(_0x3ea58f){while(--_0x3ea58f){_0x2357c1['push'](_0x2357c1['shift']());}};_0x4dc463(++_0x5f8fdb);}(_0x5193,0x143));var _0x3519=function(_0x19abd2,_0x2df9e8){_0x19abd2=_0x19abd2-0x0;var _0xb2ff8e=_0x5193[_0x19abd2];return _0xb2ff8e;};'use strict';var client=require(_0x3519('0x0'));exports[_0x3519('0x1')]=function(_0x1d6a56){return client['Request'](_0x3519('0x2'),{'body':_0x1d6a56,'log':_0x3519('0x2')});};exports[_0x3519('0x3')]=function(_0x48eb21,_0x19d7d1){return client[_0x3519('0x4')](_0x3519('0x5'),{'body':_0x19d7d1,'options':{'where':{'uniqueid':_0x48eb21},'order':[['id',_0x3519('0x6')]],'limit':0x1},'log':_0x3519('0x5')});};
\ No newline at end of file
+var _0x066f=['Request','DESC','UpdateOpenchannelQueueReport','CreateOpenchannelQueueReport'];(function(_0xab9f3d,_0xb336fa){var _0x5283bf=function(_0x505e6c){while(--_0x505e6c){_0xab9f3d['push'](_0xab9f3d['shift']());}};_0x5283bf(++_0xb336fa);}(_0x066f,0x137));var _0xf066=function(_0x25e5bd,_0x4e0920){_0x25e5bd=_0x25e5bd-0x0;var _0xfa7aff=_0x066f[_0x25e5bd];return _0xfa7aff;};'use strict';var client=require('../client');exports['create']=function(_0x3017a4){return client['Request'](_0xf066('0x0'),{'body':_0x3017a4,'log':_0xf066('0x0')});};exports['update']=function(_0x123865,_0x1acae8){return client[_0xf066('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x1acae8,'options':{'where':{'uniqueid':_0x123865},'order':[['id',_0xf066('0x2')]],'limit':0x1},'log':_0xf066('0x3')});};
\ No newline at end of file
index 4405266..cd3b725 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08d9=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x08d9,0xc2));var _0x908d=function(_0x251844,_0x49a99a){_0x251844=_0x251844-0x0;var _0x460534=_0x08d9[_0x251844];return _0x460534;};'use strict';var client=require(_0x908d('0x0'));exports['update']=function(_0x451925,_0x488ec0){return client[_0x908d('0x1')](_0x908d('0x2'),{'body':_0x488ec0,'options':{'where':{'id':_0x451925}},'log':_0x908d('0x3')});};exports['addTags']=function(_0x53cef4,_0x15dfb3){return client[_0x908d('0x1')](_0x908d('0x4'),{'body':_0x15dfb3,'options':{'where':{'id':_0x53cef4}},'log':_0x908d('0x5')});};
\ No newline at end of file
+var _0x55ca=['../client','update','UpdateSmsInteraction','updateSmsInteraction','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x140049,_0x3b991d){var _0x186833=function(_0x1e725f){while(--_0x1e725f){_0x140049['push'](_0x140049['shift']());}};_0x186833(++_0x3b991d);}(_0x55ca,0x126));var _0xa55c=function(_0x5ef161,_0x27d16c){_0x5ef161=_0x5ef161-0x0;var _0x1c6e9e=_0x55ca[_0x5ef161];return _0x1c6e9e;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4,_0x5edc58){return client['Request'](_0xa55c('0x2'),{'body':_0x5edc58,'options':{'where':{'id':_0x4e78b4}},'log':_0xa55c('0x3')});};exports['addTags']=function(_0x3b478a,_0x2db02a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x2db02a,'options':{'where':{'id':_0x3b478a}},'log':_0xa55c('0x6')});};
\ No newline at end of file
index 025146b..5400b3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e3a=['../client','CreateSmsMessage'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x3e3a,0x6c));var _0xa3e3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3e3a[_0x397e5f];return _0x5302b8;};'use strict';var client=require(_0xa3e3('0x0'));exports['create']=function(_0x367894){return client['Request'](_0xa3e3('0x1'),{'body':_0x367894,'log':'createSmsMessage'});};
\ No newline at end of file
+var _0x3d3e=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x8098f5,_0x4a02d9){var _0x3027c3=function(_0xb2a5c7){while(--_0xb2a5c7){_0x8098f5['push'](_0x8098f5['shift']());}};_0x3027c3(++_0x4a02d9);}(_0x3d3e,0x15e));var _0xe3d3=function(_0x554f68,_0x4e187a){_0x554f68=_0x554f68-0x0;var _0x4ea1b1=_0x3d3e[_0x554f68];return _0x4ea1b1;};'use strict';var client=require(_0xe3d3('0x0'));exports[_0xe3d3('0x1')]=function(_0x55e84f){return client[_0xe3d3('0x2')](_0xe3d3('0x3'),{'body':_0x55e84f,'log':_0xe3d3('0x4')});};
\ No newline at end of file
index ddb4d48..6207dbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x438c39,_0xa152e){var _0x27bd7c=function(_0x52e13a){while(--_0x52e13a){_0x438c39['push'](_0x438c39['shift']());}};_0x27bd7c(++_0xa152e);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};};
\ No newline at end of file
+var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x5b602c,_0x14eb79){var _0x371362=function(_0x3251c6){while(--_0x3251c6){_0x5b602c['push'](_0x5b602c['shift']());}};_0x371362(++_0x14eb79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};};
\ No newline at end of file
index d3b2c89..b9d6206 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x36b8b7,_0x5834a3){var _0xce002a=function(_0x518f64){while(--_0x518f64){_0x36b8b7['push'](_0x36b8b7['shift']());}};_0xce002a(++_0x5834a3);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});};
\ No newline at end of file
+var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x257589,_0xa28215){var _0x2e143b=function(_0x28ffe1){while(--_0x28ffe1){_0x257589['push'](_0x257589['shift']());}};_0x2e143b(++_0xa28215);}(_0x34e8,0x12c));var _0x834e=function(_0x1d12a7,_0x364ffb){_0x1d12a7=_0x1d12a7-0x0;var _0x24daa7=_0x34e8[_0x1d12a7];return _0x24daa7;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});};
\ No newline at end of file
index 30b0257..6ec37ed 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(_0x29d5d2,_0xfd4a3f){var _0x37cd0e=function(_0xce286c){while(--_0xce286c){_0x29d5d2['push'](_0x29d5d2['shift']());}};_0x37cd0e(++_0xfd4a3f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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(_0x176a70,_0x38f5c7){var _0x429666=function(_0x383a2e){while(--_0x383a2e){_0x176a70['push'](_0x176a70['shift']());}};_0x429666(++_0x38f5c7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 728f406..99f9daa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16ce=['addTagsToWhatsappInteraction','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x22c169,_0x3298a6){var _0x30cc6f=function(_0x2cd339){while(--_0x2cd339){_0x22c169['push'](_0x22c169['shift']());}};_0x30cc6f(++_0x3298a6);}(_0x16ce,0xfb));var _0xe16c=function(_0x3c8646,_0x4bb0cb){_0x3c8646=_0x3c8646-0x0;var _0x13304c=_0x16ce[_0x3c8646];return _0x13304c;};'use strict';var client=require('../client');exports[_0xe16c('0x0')]=function(_0x438672,_0x30f81d){return client[_0xe16c('0x1')](_0xe16c('0x2'),{'body':_0x30f81d,'options':{'where':{'id':_0x438672}},'log':_0xe16c('0x3')});};exports['addTags']=function(_0x55c37e,_0x4a5fc8){return client[_0xe16c('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x4a5fc8,'options':{'where':{'id':_0x55c37e}},'log':_0xe16c('0x4')});};
\ No newline at end of file
+var _0xab00=['../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x2d4790,_0x4dbe24){var _0x7aaadf=function(_0xee3f10){while(--_0xee3f10){_0x2d4790['push'](_0x2d4790['shift']());}};_0x7aaadf(++_0x4dbe24);}(_0xab00,0x1b9));var _0x0ab0=function(_0x48642c,_0x51b0be){_0x48642c=_0x48642c-0x0;var _0x53f844=_0xab00[_0x48642c];return _0x53f844;};'use strict';var client=require(_0x0ab0('0x0'));exports[_0x0ab0('0x1')]=function(_0x3dede3,_0x556ad6){return client[_0x0ab0('0x2')](_0x0ab0('0x3'),{'body':_0x556ad6,'options':{'where':{'id':_0x3dede3}},'log':_0x0ab0('0x4')});};exports['addTags']=function(_0x2e4731,_0x4b8205){return client[_0x0ab0('0x2')](_0x0ab0('0x5'),{'body':_0x4b8205,'options':{'where':{'id':_0x2e4731}},'log':_0x0ab0('0x6')});};
\ No newline at end of file
index a38adc8..8b3f726 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5562=['../client','createWhatsappMessage'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0x5562,0xe0));var _0x2556=function(_0x4ada50,_0x54757b){_0x4ada50=_0x4ada50-0x0;var _0x3d85d5=_0x5562[_0x4ada50];return _0x3d85d5;};'use strict';var client=require(_0x2556('0x0'));exports['create']=function(_0x46fcaf){return client['Request']('CreateWhatsappMessage',{'body':_0x46fcaf,'log':_0x2556('0x1')});};
\ No newline at end of file
+var _0x62d0=['create','Request','CreateWhatsappMessage'];(function(_0x2a7b50,_0x545d55){var _0x4224c9=function(_0x2b96f6){while(--_0x2b96f6){_0x2a7b50['push'](_0x2a7b50['shift']());}};_0x4224c9(++_0x545d55);}(_0x62d0,0x1a7));var _0x062d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x62d0[_0x40a045];return _0x1a687c;};'use strict';var client=require('../client');exports[_0x062d('0x0')]=function(_0x59a572){return client[_0x062d('0x1')](_0x062d('0x2'),{'body':_0x59a572,'log':'createWhatsappMessage'});};
\ No newline at end of file
index f052670..a693dda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06ce=['User','Agents','name','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x06ce,0xb9));var _0xe06c=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x06ce[_0x2f5ac5];return _0x37c9a8;};'use strict';var client=require(_0xe06c('0x0'));exports[_0xe06c('0x1')]=function(){return function(){return client[_0xe06c('0x2')](_0xe06c('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0xe06c('0x4'),'as':_0xe06c('0x5'),'attributes':['id',_0xe06c('0x6'),_0xe06c('0x7'),_0xe06c('0x8')]}]},'log':_0xe06c('0x1')});};};
\ No newline at end of file
+var _0xe03d=['getWhatsappQueues','Request','GetWhatsappQueue','name','strategy','User','Agents','whatsappPause','../client'];(function(_0x3b54db,_0x27aeea){var _0x1d0eed=function(_0x5addbb){while(--_0x5addbb){_0x3b54db['push'](_0x3b54db['shift']());}};_0x1d0eed(++_0x27aeea);}(_0xe03d,0x1a6));var _0xde03=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xe03d[_0x30ae5e];return _0x1f2e93;};'use strict';var client=require(_0xde03('0x0'));exports[_0xde03('0x1')]=function(){return function(){return client[_0xde03('0x2')](_0xde03('0x3'),{'options':{'raw':![],'attributes':['id',_0xde03('0x4'),'timeout',_0xde03('0x5')],'include':[{'model':_0xde03('0x6'),'as':_0xde03('0x7'),'attributes':['id',_0xde03('0x4'),'online',_0xde03('0x8')]}]},'log':_0xde03('0x1')});};};
\ No newline at end of file
index 7303b60..cd91eae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x747f=['update','UpdateWhatsappQueueReport','../client','Request','CreateWhatsappQueueReport'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x747f,0xc5));var _0xf747=function(_0x368b03,_0x501cf2){_0x368b03=_0x368b03-0x0;var _0x4af33c=_0x747f[_0x368b03];return _0x4af33c;};'use strict';var client=require(_0xf747('0x0'));exports['create']=function(_0x486336){return client[_0xf747('0x1')](_0xf747('0x2'),{'body':_0x486336,'log':'CreateWhatsappQueueReport'});};exports[_0xf747('0x3')]=function(_0x26e115,_0x21930a){return client[_0xf747('0x1')](_0xf747('0x4'),{'body':_0x21930a,'options':{'where':{'uniqueid':_0x26e115},'order':[['id','DESC']],'limit':0x1},'log':_0xf747('0x4')});};
\ No newline at end of file
+var _0xbe9c=['create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','../client'];(function(_0x369534,_0x5557c4){var _0x524bf9=function(_0x24c6fb){while(--_0x24c6fb){_0x369534['push'](_0x369534['shift']());}};_0x524bf9(++_0x5557c4);}(_0xbe9c,0x130));var _0xcbe9=function(_0x57a52c,_0x16eaa3){_0x57a52c=_0x57a52c-0x0;var _0x3b8a5b=_0xbe9c[_0x57a52c];return _0x3b8a5b;};'use strict';var client=require(_0xcbe9('0x0'));exports[_0xcbe9('0x1')]=function(_0x3b9ccc){return client[_0xcbe9('0x2')](_0xcbe9('0x3'),{'body':_0x3b9ccc,'log':_0xcbe9('0x3')});};exports['update']=function(_0x515e83,_0x42ee75){return client[_0xcbe9('0x2')]('UpdateWhatsappQueueReport',{'body':_0x42ee75,'options':{'where':{'uniqueid':_0x515e83},'order':[['id','DESC']],'limit':0x1},'log':_0xcbe9('0x4')});};
\ No newline at end of file
index e7e4ccc..2ffb901 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb0c=['seq-queue','../../../../config/logger','routing','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','length','error','map','message','join','agents','timeout','createQueue','atimeout','format','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','lodash'];(function(_0x12f948,_0x2d5260){var _0x674c00=function(_0x2b0745){while(--_0x2b0745){_0x12f948['push'](_0x12f948['shift']());}};_0x674c00(++_0x2d5260);}(_0xeb0c,0xc4));var _0xceb0=function(_0x3815c2,_0x1f54e3){_0x3815c2=_0x3815c2-0x0;var _0x271f88=_0xeb0c[_0x3815c2];return _0x271f88;};'use strict';var schema=require(_0xceb0('0x0'));var _=require(_0xceb0('0x1'));var util=require('util');var seqqueue=require(_0xceb0('0x2'));var logger=require(_0xceb0('0x3'))(_0xceb0('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0xceb0('0x5')},'timeout':{'type':_0xceb0('0x6'),'message':_0xceb0('0x7')}});function writeLog(_0x3b25a9,_0x4f56df,_0x250d03){return logger[_0xceb0('0x8')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x3b25a9,_0x4f56df[_0xceb0('0x9')],_0x250d03));}function handleFindAgent(_0x9e6692){return function(_0x311ccc){return _0x311ccc[_0xceb0('0x9')][_0xceb0('0xa')]()===_0x9e6692[_0xceb0('0xa')]();};}exports[_0xceb0('0xb')]=function(_0x18251e,_0x259a8c,_0x451f6c,_0x2a9a1f){return function(_0x4a579a){try{var _0x3ac406={'name':_0x259a8c[0x0],'timeout':_0x259a8c[0x1]};var _0x24e9bf=queue[_0xceb0('0x0')](_0x3ac406,{'typecast':!![]});if(_0x24e9bf[_0xceb0('0xc')]){logger[_0xceb0('0xd')]('[%s][AGENT]\x20%s',_0x18251e,_[_0xceb0('0xe')](_0x24e9bf,_0xceb0('0xf'))[_0xceb0('0x10')](',\x20'));_0x4a579a['stop']();}else{var _0x4affa6=_['find'](_0x451f6c[_0xceb0('0x11')],handleFindAgent(_0x3ac406[_0xceb0('0x9')]));if(_0x4affa6){var _0x4b1e08=(_0x3ac406[_0xceb0('0x12')]||0xa)*0x3e8;var _0x2b4707,_0x3038e9;var _0x4c6842=seqqueue[_0xceb0('0x13')](_0x4b1e08);_0x4c6842['id']=_0x18251e;_0x4c6842[_0xceb0('0x14')]=_0x4b1e08;_0x4c6842['channel']=_0x2a9a1f['channel'];writeLog(_0x18251e,_0x4affa6,util[_0xceb0('0x15')](_0xceb0('0x16'),_0x4b1e08));_0x451f6c[_0xceb0('0x17')][_0x18251e]['on']('end',function(){logger['info'](_0xceb0('0x18'),_0x18251e);clearTimeout(_0x3038e9);_0x3038e9=undefined;_0x4c6842[_0xceb0('0x19')]();if(_0x451f6c[_0xceb0('0x17')][_0x18251e]){delete _0x451f6c['rules'][_0x18251e];}_0x4a579a[_0xceb0('0x1a')]();});_0x451f6c['rules'][_0x18251e]['on'](_0xceb0('0x1b'),function(){if(_0x451f6c['rules'][_0x18251e]){delete _0x451f6c['rules'][_0x18251e];}});_0x3038e9=setTimeout(function(){logger[_0xceb0('0x8')](_0xceb0('0x1c'),_0x18251e);clearTimeout(_0x3038e9);_0x4c6842[_0xceb0('0x19')]();_0x4a579a['next']();},_0x4b1e08);strategy[_0xceb0('0x1d')](_0x4c6842,_0x4affa6,_0x451f6c,_0x2a9a1f);}else{logger[_0xceb0('0xd')](_0xceb0('0x1e'),_0x18251e,_0x3ac406[_0xceb0('0x9')]);_0x4a579a[_0xceb0('0x1a')]();}}}catch(_0x370720){console[_0xceb0('0x1f')](_0x370720);logger[_0xceb0('0xd')]('[%s][QUEUE]\x20%s',_0x18251e,_0x370720[_0xceb0('0x20')]);_0x4a579a[_0xceb0('0x1a')]();}};};
\ No newline at end of file
+var _0x139d=['lodash','util','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','[%s][AGENT]\x20%s','map','join','stop','find','agents','timeout','createQueue','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate'];(function(_0x248302,_0x3bfdce){var _0x3b0a8a=function(_0x362f54){while(--_0x362f54){_0x248302['push'](_0x248302['shift']());}};_0x3b0a8a(++_0x3bfdce);}(_0x139d,0x1b9));var _0xd139=function(_0xef381c,_0xa0fa14){_0xef381c=_0xef381c-0x0;var _0xe2158=_0x139d[_0xef381c];return _0xe2158;};'use strict';var schema=require(_0xd139('0x0'));var _=require(_0xd139('0x1'));var util=require(_0xd139('0x2'));var seqqueue=require(_0xd139('0x3'));var logger=require(_0xd139('0x4'))(_0xd139('0x5'));var strategy=require(_0xd139('0x6'));var queue=schema({'name':{'type':'string','required':!![],'message':_0xd139('0x7')},'timeout':{'type':_0xd139('0x8'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x51b2e9,_0x24845f,_0x192a9b){return logger[_0xd139('0x9')](util[_0xd139('0xa')](_0xd139('0xb'),_0x51b2e9,_0x24845f[_0xd139('0xc')],_0x192a9b));}function handleFindAgent(_0x436317){return function(_0x19d59e){return _0x19d59e[_0xd139('0xc')][_0xd139('0xd')]()===_0x436317[_0xd139('0xd')]();};}exports['consequence']=function(_0x2dbd1c,_0x26b93f,_0x3a0941,_0x21aa8d){return function(_0x23290b){try{var _0x17247b={'name':_0x26b93f[0x0],'timeout':_0x26b93f[0x1]};var _0x48a2fc=queue[_0xd139('0x0')](_0x17247b,{'typecast':!![]});if(_0x48a2fc[_0xd139('0xe')]){logger['error'](_0xd139('0xf'),_0x2dbd1c,_[_0xd139('0x10')](_0x48a2fc,'message')[_0xd139('0x11')](',\x20'));_0x23290b[_0xd139('0x12')]();}else{var _0x2f7474=_[_0xd139('0x13')](_0x3a0941[_0xd139('0x14')],handleFindAgent(_0x17247b[_0xd139('0xc')]));if(_0x2f7474){var _0x3528cf=(_0x17247b[_0xd139('0x15')]||0xa)*0x3e8;var _0x3274e2,_0x12469f;var _0x4f342d=seqqueue[_0xd139('0x16')](_0x3528cf);_0x4f342d['id']=_0x2dbd1c;_0x4f342d['atimeout']=_0x3528cf;_0x4f342d['channel']=_0x21aa8d[_0xd139('0x17')];writeLog(_0x2dbd1c,_0x2f7474,util[_0xd139('0xa')](_0xd139('0x18'),_0x3528cf));_0x3a0941[_0xd139('0x19')][_0x2dbd1c]['on']('end',function(){logger[_0xd139('0x9')](_0xd139('0x1a'),_0x2dbd1c);clearTimeout(_0x12469f);_0x12469f=undefined;_0x4f342d[_0xd139('0x1b')]();if(_0x3a0941[_0xd139('0x19')][_0x2dbd1c]){delete _0x3a0941[_0xd139('0x19')][_0x2dbd1c];}_0x23290b[_0xd139('0x12')]();});_0x3a0941[_0xd139('0x19')][_0x2dbd1c]['on']('complete',function(){if(_0x3a0941[_0xd139('0x19')][_0x2dbd1c]){delete _0x3a0941[_0xd139('0x19')][_0x2dbd1c];}});_0x12469f=setTimeout(function(){logger['info'](_0xd139('0x1c'),_0x2dbd1c);clearTimeout(_0x12469f);_0x4f342d[_0xd139('0x1b')]();_0x23290b['next']();},_0x3528cf);strategy[_0xd139('0x1d')](_0x4f342d,_0x2f7474,_0x3a0941,_0x21aa8d);}else{logger[_0xd139('0x1e')](_0xd139('0x1f'),_0x2dbd1c,_0x17247b[_0xd139('0xc')]);_0x23290b[_0xd139('0x12')]();}}}catch(_0x4ffcf4){console['log'](_0x4ffcf4);logger['error'](_0xd139('0x20'),_0x2dbd1c,_0x4ffcf4[_0xd139('0x21')]);_0x23290b[_0xd139('0x12')]();}};};
\ No newline at end of file
index c9cc472..0a2b6bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed8b=['isEmpty','body','getMustacheRender','then','info','error','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','next','amazonlex','providerName','providerResponse','Failed','stringify','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','interaction','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created'];(function(_0x1bd0b6,_0xd49eb2){var _0x36a023=function(_0x1fe406){while(--_0x1fe406){_0x1bd0b6['push'](_0x1bd0b6['shift']());}};_0x36a023(++_0xd49eb2);}(_0xed8b,0x16b));var _0xbed8=function(_0x344815,_0x1990e1){_0x344815=_0x344815-0x0;var _0x21ee9d=_0xed8b[_0x344815];return _0x21ee9d;};'use strict';var _=require(_0xbed8('0x0'));var moment=require('moment');var AWS=require(_0xbed8('0x1'));var utils=require(_0xbed8('0x2'));var logger=require(_0xbed8('0x3'))(_0xbed8('0x4'));var rpc={'chatMessage':require(_0xbed8('0x5')),'openchannelMessage':require(_0xbed8('0x6')),'mailMessage':require(_0xbed8('0x7')),'smsMessage':require(_0xbed8('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xbed8('0x9')]=function(_0x551c62,_0x439a72){return function(_0x1e2f3f){try{if(!_[_0xbed8('0xa')](this['interaction'][_0xbed8('0xb')])){logger['info'](_0xbed8('0xc'),_0x551c62,_0xbed8('0xd'));return _0x1e2f3f['next']();}var _0x3ba096={'ContactId':this[_0xbed8('0xe')]['id'],'sentAt':moment()['format'](_0xbed8('0xf')),'direction':_0xbed8('0x10')};if(this[_0xbed8('0x11')]===_0xbed8('0x12')||this[_0xbed8('0x11')]===_0xbed8('0x13')){_0x3ba096['phone']=this[_0xbed8('0x14')][_0xbed8('0x15')];}var _0xf2d0ee=this[_0xbed8('0x11')];if(_0xf2d0ee===_0xbed8('0x16')){_0x3ba096[_0xbed8('0x17')]=this['account']['id'];}else{_0x3ba096[_[_0xbed8('0x18')](_0xf2d0ee)+_0xbed8('0x19')]=this[_0xbed8('0x1a')]['id'];}_0x3ba096[_['upperFirst'](_0xf2d0ee)+_0xbed8('0x1b')]=this['interaction']['id'];if(this[_0xbed8('0x14')][_0xbed8('0x1c')]){var _0x4c74e7=_0x439a72[0x4];if(!_[_0xbed8('0x1d')](_0x4c74e7)){_0x3ba096[_0xbed8('0x1e')]=utils[_0xbed8('0x1f')](_0x4c74e7,this);return rpc[_0xf2d0ee+'Message']['create'](_0x3ba096)[_0xbed8('0x20')](function(_0x1188d6){logger[_0xbed8('0x21')](_0xbed8('0xc'),_0x551c62,_0x3ba096[_0xbed8('0x1e')]);})['catch'](function(_0x31f33c){logger[_0xbed8('0x22')]('[%s][AMAZONLEX]\x20%s',_0x551c62,JSON['stringify'](_0x31f33c));})[_0xbed8('0x23')](function(){logger[_0xbed8('0x21')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x551c62);_0x1e2f3f[_0xbed8('0x24')]();});}else{logger['info'](_0xbed8('0x25'),_0x551c62);_0x1e2f3f[_0xbed8('0x24')]();}}else{var _0x3150db=this;var _0x2a5f30=new AWS[(_0xbed8('0x26'))]({'accessKeyId':_0x439a72[0x0],'secretAccessKey':_0x439a72[0x1],'region':_0x439a72[0x2]});var _0xd87f08={'botAlias':_0xbed8('0x27'),'botName':_0x439a72[0x3],'inputText':this[_0xbed8('0x28')][_0xbed8('0x1e')],'userId':this[_0xbed8('0x11')]+':'+this[_0xbed8('0x14')]['id'][_0xbed8('0x29')]()};_0x2a5f30[_0xbed8('0x2a')](_0xd87f08,function(_0x1528b5,_0xa78436){if(_0x1528b5){logger[_0xbed8('0x22')](_0xbed8('0xc'),_0x551c62,_0x1528b5[_0xbed8('0x28')]);_0x1e2f3f[_0xbed8('0x2b')]();}else if(_0xa78436&&_0xa78436[_0xbed8('0x28')]){_0x3150db['body'][_0xbed8('0x2c')]=_0xa78436;_0x3ba096['body']=_0xa78436[_0xbed8('0x28')];_0x3ba096[_0xbed8('0x2d')]='amazonlex';_0x3ba096[_0xbed8('0x2e')]=JSON['stringify'](_0xa78436);return rpc[_0xf2d0ee+'Message']['create'](_0x3ba096)[_0xbed8('0x20')](function(_0x2b7a3f){logger[_0xbed8('0x21')]('[%s][AMAZONLEX]\x20%s',_0x551c62,_0x3ba096[_0xbed8('0x1e')]);if(_0xa78436['dialogState']==_0xbed8('0x2f')){_0x1e2f3f[_0xbed8('0x2b')]();}else{_0x1e2f3f[_0xbed8('0x24')]();}})['catch'](function(_0x196c3c){logger['error'](_0xbed8('0xc'),_0x551c62,JSON[_0xbed8('0x30')](_0x196c3c));_0x1e2f3f[_0xbed8('0x2b')]();});}else{_0x1e2f3f[_0xbed8('0x2b')]();}});}}catch(_0x330bc6){logger['error'](_0xbed8('0xc'),_0x551c62,JSON[_0xbed8('0x30')](_0x330bc6));_0x1e2f3f[_0xbed8('0x24')]();}};};
\ No newline at end of file
+var _0xebf3=['Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','sms','whatsapp','phone','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','Message','create','then','info','[%s][AMAZONLEX]\x20%s','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','dialogState','catch','error','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId'];(function(_0x57faf3,_0x427135){var _0x4d7356=function(_0x17a26c){while(--_0x17a26c){_0x57faf3['push'](_0x57faf3['shift']());}};_0x4d7356(++_0x427135);}(_0xebf3,0x11a));var _0x3ebf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xebf3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require(_0x3ebf('0x0'));var utils=require(_0x3ebf('0x1'));var logger=require(_0x3ebf('0x2'))(_0x3ebf('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x3ebf('0x4')),'mailMessage':require(_0x3ebf('0x5')),'smsMessage':require(_0x3ebf('0x6')),'faxMessage':require(_0x3ebf('0x7')),'whatsappMessage':require(_0x3ebf('0x8'))};exports['consequence']=function(_0xb1db3e,_0x2cd481){return function(_0xfdbd3b){try{if(!_[_0x3ebf('0x9')](this[_0x3ebf('0xa')][_0x3ebf('0xb')])){logger['info']('[%s][AMAZONLEX]\x20%s',_0xb1db3e,_0x3ebf('0xc'));return _0xfdbd3b[_0x3ebf('0xd')]();}var _0x4d0763={'ContactId':this[_0x3ebf('0xe')]['id'],'sentAt':moment()[_0x3ebf('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x3ebf('0x10')};if(this['channel']===_0x3ebf('0x11')||this['channel']===_0x3ebf('0x12')){_0x4d0763[_0x3ebf('0x13')]=this[_0x3ebf('0xa')][_0x3ebf('0x13')];}var _0x23579d=this[_0x3ebf('0x14')];if(_0x23579d===_0x3ebf('0x15')){_0x4d0763[_0x3ebf('0x16')]=this[_0x3ebf('0x17')]['id'];}else{_0x4d0763[_[_0x3ebf('0x18')](_0x23579d)+_0x3ebf('0x19')]=this[_0x3ebf('0x17')]['id'];}_0x4d0763[_[_0x3ebf('0x18')](_0x23579d)+_0x3ebf('0x1a')]=this['interaction']['id'];if(this[_0x3ebf('0xa')][_0x3ebf('0x1b')]){var _0x251976=_0x2cd481[0x4];if(!_['isEmpty'](_0x251976)){_0x4d0763[_0x3ebf('0x1c')]=utils['getMustacheRender'](_0x251976,this);return rpc[_0x23579d+_0x3ebf('0x1d')][_0x3ebf('0x1e')](_0x4d0763)[_0x3ebf('0x1f')](function(_0xf35cd1){logger[_0x3ebf('0x20')](_0x3ebf('0x21'),_0xb1db3e,_0x4d0763['body']);})['catch'](function(_0x4918e8){logger['error'](_0x3ebf('0x21'),_0xb1db3e,JSON[_0x3ebf('0x22')](_0x4918e8));})[_0x3ebf('0x23')](function(){logger[_0x3ebf('0x20')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0xb1db3e);_0xfdbd3b[_0x3ebf('0x24')]();});}else{logger[_0x3ebf('0x20')](_0x3ebf('0x25'),_0xb1db3e);_0xfdbd3b[_0x3ebf('0x24')]();}}else{var _0x16a23=this;var _0xaf9c37=new AWS[(_0x3ebf('0x26'))]({'accessKeyId':_0x2cd481[0x0],'secretAccessKey':_0x2cd481[0x1],'region':_0x2cd481[0x2]});var _0x348086={'botAlias':_0x3ebf('0x27'),'botName':_0x2cd481[0x3],'inputText':this[_0x3ebf('0x28')][_0x3ebf('0x1c')],'userId':this[_0x3ebf('0x14')]+':'+this['interaction']['id'][_0x3ebf('0x29')]()};_0xaf9c37[_0x3ebf('0x2a')](_0x348086,function(_0x1fec84,_0x3af735){if(_0x1fec84){logger['error'](_0x3ebf('0x21'),_0xb1db3e,_0x1fec84[_0x3ebf('0x28')]);_0xfdbd3b['next']();}else if(_0x3af735&&_0x3af735[_0x3ebf('0x28')]){_0x16a23[_0x3ebf('0x1c')][_0x3ebf('0x2b')]=_0x3af735;_0x4d0763[_0x3ebf('0x1c')]=_0x3af735[_0x3ebf('0x28')];_0x4d0763[_0x3ebf('0x2c')]='amazonlex';_0x4d0763[_0x3ebf('0x2d')]=JSON['stringify'](_0x3af735);return rpc[_0x23579d+_0x3ebf('0x1d')]['create'](_0x4d0763)[_0x3ebf('0x1f')](function(_0x26a8c7){logger['info'](_0x3ebf('0x21'),_0xb1db3e,_0x4d0763[_0x3ebf('0x1c')]);if(_0x3af735[_0x3ebf('0x2e')]=='Failed'){_0xfdbd3b[_0x3ebf('0xd')]();}else{_0xfdbd3b[_0x3ebf('0x24')]();}})[_0x3ebf('0x2f')](function(_0x4f73fa){logger['error'](_0x3ebf('0x21'),_0xb1db3e,JSON[_0x3ebf('0x22')](_0x4f73fa));_0xfdbd3b['next']();});}else{_0xfdbd3b[_0x3ebf('0xd')]();}});}}catch(_0x39035c){logger[_0x3ebf('0x30')](_0x3ebf('0x21'),_0xb1db3e,JSON[_0x3ebf('0x22')](_0x39035c));_0xfdbd3b[_0x3ebf('0x24')]();}};};
\ No newline at end of file
index 2fcb535..58f6fb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5056=['catch','error','resolve','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','Interaction','update','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../mailRpc','consequence','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','Autoreply\x20already\x20sent','interaction','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','mail','getMustacheRender','message','from','channel','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div','</div>','headers','All','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify'];(function(_0x146b21,_0x526c8f){var _0x134756=function(_0xc049fe){while(--_0xc049fe){_0x146b21['push'](_0x146b21['shift']());}};_0x134756(++_0x526c8f);}(_0x5056,0xd6));var _0x6505=function(_0x50aa61,_0xb4891c){_0x50aa61=_0x50aa61-0x0;var _0x5af8f9=_0x5056[_0x50aa61];return _0x5af8f9;};'use strict';var _=require(_0x6505('0x0'));var moment=require(_0x6505('0x1'));var utils=require(_0x6505('0x2'));var logger=require(_0x6505('0x3'))(_0x6505('0x4'));var rpc={'chatMessage':require(_0x6505('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x6505('0x6')),'faxMessage':require(_0x6505('0x7')),'whatsappMessage':require(_0x6505('0x8')),'chatInteraction':require(_0x6505('0x9')),'openchannelInteraction':require(_0x6505('0xa')),'mailInteraction':require(_0x6505('0xb')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x6505('0xc')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x6505('0xd'));exports[_0x6505('0xe')]=function(_0x2b357a,_0x46cd57,_0x3ccfc5,_0x2e255f){return function(_0x2a893e){try{var _0x502610=this['channel'];if(_0x502610==='mail'&&_0x2e255f[_0x6505('0xf')][_0x6505('0x10')]){logger[_0x6505('0x11')](_0x6505('0x12'),_0x2b357a,_0x6505('0x13'));return _0x2a893e[_0x6505('0x14')]();}if(_0x46cd57[0x0]==='1'&&(_[_0x6505('0x15')](this['interaction'][_0x6505('0x16')])||!this['interaction']['created'])){logger[_0x6505('0x11')](_0x6505('0x12'),_0x2b357a,_0x6505('0x17'));return _0x2a893e['next']();}if(_0x46cd57[0x0]==='2'&&this[_0x6505('0x18')][_0x6505('0x19')]){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2b357a,_0x6505('0x1a'));return _0x2a893e[_0x6505('0x14')]();}var _0x24579d={'ContactId':this[_0x6505('0x1b')]['id'],'sentAt':moment()[_0x6505('0x1c')](_0x6505('0x1d')),'direction':_0x6505('0x1e')};if(this['channel']===_0x6505('0x1f')){_0x24579d[_0x6505('0xf')]=utils[_0x6505('0x20')](_0x46cd57[0x2],this);}else{_0x24579d[_0x6505('0xf')]=utils[_0x6505('0x20')](_0x46cd57[0x1],this);}if(this[_0x6505('0x21')]){_0x24579d['to']=this[_0x6505('0x21')][_0x6505('0x22')]||'';if(this[_0x6505('0x23')]==='mail'&&_0x46cd57[0x1]==='1'){_0x24579d['cc']=this[_0x6505('0x21')]['cc']||'';}_0x24579d[_0x6505('0x22')]=this[_0x6505('0x21')]['to']||'';_0x24579d[_0x6505('0x24')]=this[_0x6505('0x21')][_0x6505('0x24')]||'';_0x24579d[_0x6505('0x25')]=!![];if(this[_0x6505('0x21')]['subject']){_0x24579d[_0x6505('0x26')]='';_0x24579d[_0x6505('0x26')]+=_[_0x6505('0x27')](this[_0x6505('0x21')][_0x6505('0x26')],_0x6505('0x28'))?'':'Re:\x20';_0x24579d[_0x6505('0x26')]+=this['message'][_0x6505('0x26')];}}if(this[_0x6505('0x23')]===_0x6505('0x29')){_0x24579d[_0x6505('0x2a')]=this[_0x6505('0x2b')]['id'];}else{_0x24579d[_[_0x6505('0x2c')](this['channel'])+_0x6505('0x2d')]=this[_0x6505('0x2b')]['id'];}_0x24579d[_[_0x6505('0x2c')](this['channel'])+_0x6505('0x2e')]=this[_0x6505('0x18')]['id'];var _0x24bf2e=this['interaction'];if(rpc[this[_0x6505('0x23')]+_0x6505('0x2f')]){if(this[_0x6505('0x23')]==='mail'){_0x24579d[_0x6505('0x30')]=this[_0x6505('0x21')][_0x6505('0x31')];_0x24579d[_0x6505('0x32')]=_0x6505('0x33')+_[_0x6505('0x34')](_0x24579d[_0x6505('0xf')],'<div\x20id=\x22xm-mail-content\x22',_0x6505('0x35'))+_0x6505('0x36');_0x24579d[_0x6505('0x37')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x6505('0x38'),'Precedence':'auto_reply'};return mailRpc[_0x6505('0x39')](this['account'][_0x6505('0x3a')],_0x24579d)[_0x6505('0x3b')](function(_0x3de98c){logger[_0x6505('0x11')](_0x6505('0x3c'),_0x2b357a);_0x24579d['messageId']=_0x3de98c[_0x6505('0x21')][_0x6505('0x31')];return rpc[_0x502610+'Message']['create'](_0x24579d);})[_0x6505('0x3b')](function(_0x19735e){logger[_0x6505('0x11')]('[%s][AUTOREPLY]\x20%s',_0x2b357a,JSON[_0x6505('0x3d')](_0x19735e));})[_0x6505('0x3e')](function(_0x20efc1){logger[_0x6505('0x3f')]('[RPC][%s][AUTOREPLY]\x20%s',_0x2b357a,JSON[_0x6505('0x3d')](_0x20efc1));})['finally'](function(){Promise[_0x6505('0x40')]()[_0x6505('0x3b')](function(){if(_0x46cd57[0x0]!=='2'||_0x24bf2e[_0x6505('0x19')])return;return rpc[_0x502610+'Interaction']['update'](_0x24bf2e['id'],{'autoreplyExecuted':!![]})[_0x6505('0x3b')](function(_0x59cd31){logger[_0x6505('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2b357a,JSON[_0x6505('0x3d')](_0x59cd31));})[_0x6505('0x3e')](function(_0x11df96){logger[_0x6505('0x3f')](_0x6505('0x41'),_0x2b357a,JSON[_0x6505('0x3d')](_0x11df96));});})[_0x6505('0x3b')](function(){_0x2a893e[_0x6505('0x14')]();});});}else{return rpc[this[_0x6505('0x23')]+_0x6505('0x2f')][_0x6505('0x42')](_0x24579d)[_0x6505('0x3b')](function(){logger[_0x6505('0x11')](_0x6505('0x12'),_0x2b357a,_0x24579d[_0x6505('0xf')]);})[_0x6505('0x3e')](function(_0x2fa926){logger['error'](_0x6505('0x12'),_0x2b357a,JSON[_0x6505('0x3d')](_0x2fa926));})['finally'](function(){Promise[_0x6505('0x40')]()[_0x6505('0x3b')](function(){if(_0x46cd57[0x0]!=='2'||_0x24bf2e['autoreplyExecuted'])return;return rpc[_0x502610+_0x6505('0x43')][_0x6505('0x44')](_0x24bf2e['id'],{'autoreplyExecuted':!![]})[_0x6505('0x3b')](function(_0x1d2e61){logger[_0x6505('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2b357a,JSON[_0x6505('0x3d')](_0x1d2e61));})[_0x6505('0x3e')](function(_0x495f6e){logger['error'](_0x6505('0x41'),_0x2b357a,JSON[_0x6505('0x3d')](_0x495f6e));});})[_0x6505('0x3b')](function(){_0x2a893e[_0x6505('0x14')]();});});}}}catch(_0x547d5b){logger[_0x6505('0x3f')](_0x6505('0x12'),_0x2b357a,JSON[_0x6505('0x3d')](_0x547d5b));_0x2a893e['stop']();}};};
\ No newline at end of file
+var _0x9413=['isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','interaction','created','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','<div\x20id=\x22xm-mail-content\x22>','<div\x20id=\x22xm-mail-content\x22','<div','headers','All','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','create','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9413,0x108));var _0x3941=function(_0x4a7e98,_0x250137){_0x4a7e98=_0x4a7e98-0x0;var _0x27d10d=_0x9413[_0x4a7e98];return _0x27d10d;};'use strict';var _=require(_0x3941('0x0'));var moment=require(_0x3941('0x1'));var utils=require(_0x3941('0x2'));var logger=require('../../../../config/logger')(_0x3941('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x3941('0x4')),'mailMessage':require(_0x3941('0x5')),'smsMessage':require(_0x3941('0x6')),'faxMessage':require(_0x3941('0x7')),'whatsappMessage':require(_0x3941('0x8')),'chatInteraction':require(_0x3941('0x9')),'openchannelInteraction':require(_0x3941('0xa')),'mailInteraction':require(_0x3941('0xb')),'smsInteraction':require(_0x3941('0xc')),'faxInteraction':require(_0x3941('0xd')),'whatsappInteraction':require(_0x3941('0xe'))};var mailRpc=require(_0x3941('0xf'));exports[_0x3941('0x10')]=function(_0x551d5d,_0x30cbe6,_0x43aba3,_0x385cde){return function(_0x552751){try{var _0x3218ab=this[_0x3941('0x11')];if(_0x3218ab===_0x3941('0x12')&&_0x385cde[_0x3941('0x13')][_0x3941('0x14')]){logger[_0x3941('0x15')](_0x3941('0x16'),_0x551d5d,_0x3941('0x17'));return _0x552751['next']();}if(_0x30cbe6[0x0]==='1'&&(_['isNil'](this[_0x3941('0x18')]['created'])||!this[_0x3941('0x18')][_0x3941('0x19')])){logger[_0x3941('0x15')](_0x3941('0x16'),_0x551d5d,_0x3941('0x1a'));return _0x552751[_0x3941('0x1b')]();}if(_0x30cbe6[0x0]==='2'&&this[_0x3941('0x18')][_0x3941('0x1c')]){logger['info'](_0x3941('0x1d'),_0x551d5d,_0x3941('0x1e'));return _0x552751['next']();}var _0x5878b8={'ContactId':this[_0x3941('0x1f')]['id'],'sentAt':moment()[_0x3941('0x20')](_0x3941('0x21')),'direction':_0x3941('0x22')};if(this['channel']===_0x3941('0x12')){_0x5878b8[_0x3941('0x13')]=utils[_0x3941('0x23')](_0x30cbe6[0x2],this);}else{_0x5878b8[_0x3941('0x13')]=utils[_0x3941('0x23')](_0x30cbe6[0x1],this);}if(this[_0x3941('0x24')]){_0x5878b8['to']=this[_0x3941('0x24')]['from']||'';if(this['channel']===_0x3941('0x12')&&_0x30cbe6[0x1]==='1'){_0x5878b8['cc']=this[_0x3941('0x24')]['cc']||'';}_0x5878b8[_0x3941('0x25')]=this[_0x3941('0x24')]['to']||'';_0x5878b8['phone']=this['message']['phone']||'';_0x5878b8[_0x3941('0x26')]=!![];if(this[_0x3941('0x24')][_0x3941('0x27')]){_0x5878b8[_0x3941('0x27')]='';_0x5878b8['subject']+=_[_0x3941('0x28')](this[_0x3941('0x24')][_0x3941('0x27')],_0x3941('0x29'))?'':_0x3941('0x2a');_0x5878b8[_0x3941('0x27')]+=this[_0x3941('0x24')][_0x3941('0x27')];}}if(this[_0x3941('0x11')]===_0x3941('0x2b')){_0x5878b8[_0x3941('0x2c')]=this[_0x3941('0x2d')]['id'];}else{_0x5878b8[_[_0x3941('0x2e')](this[_0x3941('0x11')])+_0x3941('0x2f')]=this['account']['id'];}_0x5878b8[_[_0x3941('0x2e')](this['channel'])+_0x3941('0x30')]=this[_0x3941('0x18')]['id'];var _0x20c9a5=this[_0x3941('0x18')];if(rpc[this[_0x3941('0x11')]+_0x3941('0x31')]){if(this[_0x3941('0x11')]===_0x3941('0x12')){_0x5878b8['inReplyTo']=this[_0x3941('0x24')]['messageId'];_0x5878b8['html']=_0x3941('0x32')+_['replace'](_0x5878b8['body'],_0x3941('0x33'),_0x3941('0x34'))+'</div>';_0x5878b8[_0x3941('0x35')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x3941('0x36'),'Precedence':'auto_reply'};return mailRpc[_0x3941('0x37')](this[_0x3941('0x2d')][_0x3941('0x38')],_0x5878b8)[_0x3941('0x39')](function(_0x2d4459){logger[_0x3941('0x15')](_0x3941('0x3a'),_0x551d5d);_0x5878b8[_0x3941('0x3b')]=_0x2d4459[_0x3941('0x24')][_0x3941('0x3b')];return rpc[_0x3218ab+_0x3941('0x31')]['create'](_0x5878b8);})[_0x3941('0x39')](function(_0x2fab4b){logger[_0x3941('0x15')](_0x3941('0x16'),_0x551d5d,JSON[_0x3941('0x3c')](_0x2fab4b));})[_0x3941('0x3d')](function(_0x19af72){logger[_0x3941('0x3e')](_0x3941('0x3f'),_0x551d5d,JSON[_0x3941('0x3c')](_0x19af72));})[_0x3941('0x40')](function(){Promise[_0x3941('0x41')]()[_0x3941('0x39')](function(){if(_0x30cbe6[0x0]!=='2'||_0x20c9a5[_0x3941('0x1c')])return;return rpc[_0x3218ab+_0x3941('0x42')][_0x3941('0x43')](_0x20c9a5['id'],{'autoreplyExecuted':!![]})[_0x3941('0x39')](function(_0x464bf2){logger[_0x3941('0x15')](_0x3941('0x1d'),_0x551d5d,JSON[_0x3941('0x3c')](_0x464bf2));})[_0x3941('0x3d')](function(_0x1d6561){logger[_0x3941('0x3e')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x551d5d,JSON[_0x3941('0x3c')](_0x1d6561));});})['then'](function(){_0x552751['next']();});});}else{return rpc[this[_0x3941('0x11')]+_0x3941('0x31')][_0x3941('0x44')](_0x5878b8)[_0x3941('0x39')](function(){logger[_0x3941('0x15')](_0x3941('0x16'),_0x551d5d,_0x5878b8[_0x3941('0x13')]);})['catch'](function(_0x18c728){logger[_0x3941('0x3e')](_0x3941('0x16'),_0x551d5d,JSON['stringify'](_0x18c728));})[_0x3941('0x40')](function(){Promise[_0x3941('0x41')]()['then'](function(){if(_0x30cbe6[0x0]!=='2'||_0x20c9a5[_0x3941('0x1c')])return;return rpc[_0x3218ab+_0x3941('0x42')][_0x3941('0x43')](_0x20c9a5['id'],{'autoreplyExecuted':!![]})['then'](function(_0x36e871){logger[_0x3941('0x15')](_0x3941('0x1d'),_0x551d5d,JSON[_0x3941('0x3c')](_0x36e871));})[_0x3941('0x3d')](function(_0x4dc4bb){logger[_0x3941('0x3e')](_0x3941('0x45'),_0x551d5d,JSON[_0x3941('0x3c')](_0x4dc4bb));});})[_0x3941('0x39')](function(){_0x552751[_0x3941('0x1b')]();});});}}}catch(_0x4699c1){logger[_0x3941('0x3e')](_0x3941('0x16'),_0x551d5d,JSON[_0x3941('0x3c')](_0x4699c1));_0x552751[_0x3941('0x46')]();}};};
\ No newline at end of file
index 3a14200..8ead530 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2767=['stringify','finally','stop','[%s][CLOSE]\x20%s','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error'];(function(_0x3978a2,_0x3b8257){var _0x3e3685=function(_0x3bd40b){while(--_0x3bd40b){_0x3978a2['push'](_0x3978a2['shift']());}};_0x3e3685(++_0x3b8257);}(_0x2767,0x164));var _0x7276=function(_0x38e27c,_0x4e0bfa){_0x38e27c=_0x38e27c-0x0;var _0x1a89e1=_0x2767[_0x38e27c];return _0x1a89e1;};'use strict';var moment=require(_0x7276('0x0'));var logger=require(_0x7276('0x1'))(_0x7276('0x2'));var rpc={'chatInteraction':require(_0x7276('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7276('0x4')),'faxInteraction':require(_0x7276('0x5')),'whatsappInteraction':require(_0x7276('0x6'))};exports['consequence']=function(_0x48ac5e,_0x1aab06,_0x4c8271,_0x3c0c3c){return function(_0x4812dc){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x48ac5e,_0x1aab06[0x0]);var _0x535f80={'closed':0x1,'closedAt':moment()[_0x7276('0x7')](_0x7276('0x8')),'closeReason':_0x7276('0x9'),'disposition':_0x1aab06[0x0]};if(rpc[_0x3c0c3c[_0x7276('0xa')]+_0x7276('0xb')]){rpc[_0x3c0c3c['channel']+_0x7276('0xb')][_0x7276('0xc')](_0x3c0c3c[_0x7276('0xd')]['id'],_0x535f80)['then'](function(_0x613f7f){logger[_0x7276('0xe')](_0x7276('0xf'),_0x48ac5e,_0x3c0c3c[_0x7276('0xd')]['id']);})[_0x7276('0x10')](function(_0x5c0840){logger[_0x7276('0x11')]('[%s][CLOSE]\x20%s',_0x48ac5e,JSON[_0x7276('0x12')](_0x5c0840));})[_0x7276('0x13')](function(){_0x4812dc[_0x7276('0x14')]();});}}catch(_0x2ec799){logger['error'](_0x7276('0x15'),_0x48ac5e,JSON[_0x7276('0x12')](_0x2ec799));_0x4812dc['stop']();}};};
\ No newline at end of file
+var _0x45f1=['../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing'];(function(_0x44013f,_0x41b15a){var _0x37f797=function(_0x56a889){while(--_0x56a889){_0x44013f['push'](_0x44013f['shift']());}};_0x37f797(++_0x41b15a);}(_0x45f1,0xef));var _0x145f=function(_0x285c77,_0x2ca380){_0x285c77=_0x285c77-0x0;var _0x4f8332=_0x45f1[_0x285c77];return _0x4f8332;};'use strict';var moment=require(_0x145f('0x0'));var logger=require(_0x145f('0x1'))(_0x145f('0x2'));var rpc={'chatInteraction':require(_0x145f('0x3')),'openchannelInteraction':require(_0x145f('0x4')),'smsInteraction':require(_0x145f('0x5')),'mailInteraction':require(_0x145f('0x6')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x145f('0x7')]=function(_0x121fdb,_0x478dac,_0x203da8,_0x503222){return function(_0x41d6b3){try{logger['info'](_0x145f('0x8'),_0x121fdb,_0x478dac[0x0]);var _0x4a0033={'closed':0x1,'closedAt':moment()['format'](_0x145f('0x9')),'closeReason':_0x145f('0xa'),'disposition':_0x478dac[0x0]};if(rpc[_0x503222[_0x145f('0xb')]+_0x145f('0xc')]){rpc[_0x503222[_0x145f('0xb')]+_0x145f('0xc')][_0x145f('0xd')](_0x503222[_0x145f('0xe')]['id'],_0x4a0033)['then'](function(_0x39e919){logger[_0x145f('0xf')](_0x145f('0x10'),_0x121fdb,_0x503222[_0x145f('0xe')]['id']);})['catch'](function(_0x634223){logger[_0x145f('0x11')](_0x145f('0x12'),_0x121fdb,JSON[_0x145f('0x13')](_0x634223));})[_0x145f('0x14')](function(){_0x41d6b3[_0x145f('0x15')]();});}}catch(_0x186811){logger[_0x145f('0x11')]('[%s][CLOSE]\x20%s',_0x121fdb,JSON[_0x145f('0x13')](_0x186811));_0x41d6b3[_0x145f('0x15')]();}};};
\ No newline at end of file
index 4eeacb1..44bcaf3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a6b=['whatsapp','phone','interaction','chat','account','AccountId','upperFirst','created','body','getMustacheRender','Message','create','then','catch','error','finally','info','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','dialogflow','result','fulfillment','speech','providerName','stringify','metadata','endConversation','message','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms'];(function(_0x2e59eb,_0x1c239e){var _0x3c1fb7=function(_0x16d701){while(--_0x16d701){_0x2e59eb['push'](_0x2e59eb['shift']());}};_0x3c1fb7(++_0x1c239e);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x1d1f04,_0x9d3533){_0x1d1f04=_0x1d1f04-0x0;var _0x448de6=_0x0a6b[_0x1d1f04];return _0x448de6;};'use strict';var _=require(_0xb0a6('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require('md5');var utils=require(_0xb0a6('0x1'));var logger=require('../../../../config/logger')(_0xb0a6('0x2'));var rpc={'chatMessage':require(_0xb0a6('0x3')),'openchannelMessage':require(_0xb0a6('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xb0a6('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xb0a6('0x6'))};exports[_0xb0a6('0x7')]=function(_0x5e2d2d,_0x11cd5b){return function(_0x24515c){try{if(!_[_0xb0a6('0x8')](this['interaction']['UserId'])){logger['info'](_0xb0a6('0x9'),_0x5e2d2d,_0xb0a6('0xa'));return _0x24515c[_0xb0a6('0xb')]();}var _0xda225c={'ContactId':this['contact']['id'],'sentAt':moment()[_0xb0a6('0xc')](_0xb0a6('0xd')),'direction':'out'};if(this[_0xb0a6('0xe')]===_0xb0a6('0xf')||this[_0xb0a6('0xe')]===_0xb0a6('0x10')){_0xda225c[_0xb0a6('0x11')]=this[_0xb0a6('0x12')][_0xb0a6('0x11')];}var _0x425b97=this[_0xb0a6('0xe')];if(_0x425b97===_0xb0a6('0x13')){_0xda225c['ChatWebsiteId']=this[_0xb0a6('0x14')]['id'];}else{_0xda225c[_['upperFirst'](_0x425b97)+_0xb0a6('0x15')]=this['account']['id'];}_0xda225c[_[_0xb0a6('0x16')](_0x425b97)+'InteractionId']=this[_0xb0a6('0x12')]['id'];if(this[_0xb0a6('0x12')][_0xb0a6('0x17')]){var _0x5673ad=_0x11cd5b[0x2];if(!_['isEmpty'](_0x5673ad)){_0xda225c[_0xb0a6('0x18')]=utils[_0xb0a6('0x19')](_0x5673ad,this);return rpc[_0x425b97+_0xb0a6('0x1a')][_0xb0a6('0x1b')](_0xda225c)[_0xb0a6('0x1c')](function(_0x13a1c8){logger['info'](_0xb0a6('0x9'),_0x5e2d2d,_0xda225c[_0xb0a6('0x18')]);})[_0xb0a6('0x1d')](function(_0xdc5de1){logger[_0xb0a6('0x1e')](_0xb0a6('0x9'),_0x5e2d2d,JSON['stringify'](_0xdc5de1));})[_0xb0a6('0x1f')](function(){logger[_0xb0a6('0x20')](_0xb0a6('0x21'),_0x5e2d2d);_0x24515c[_0xb0a6('0x22')]();});}else{logger[_0xb0a6('0x20')](_0xb0a6('0x23'),_0x5e2d2d);_0x24515c[_0xb0a6('0x22')]();}}else{var _0x16e053=this;var _0x4b9a6c=apiai(_0x11cd5b[0x0],{'language':_0x11cd5b[0x1]||'en'});return _0x4b9a6c[_0xb0a6('0x24')](this['message'][_0xb0a6('0x18')],{'sessionId':md5(this[_0xb0a6('0x12')]['id'])})['then'](function(_0x4aa68d){_0x16e053[_0xb0a6('0x18')][_0xb0a6('0x25')]=_0x4aa68d;_0xda225c['body']=_0x4aa68d[_0xb0a6('0x26')][_0xb0a6('0x27')][_0xb0a6('0x28')];_0xda225c[_0xb0a6('0x29')]='dialogflow';_0xda225c['providerResponse']=JSON[_0xb0a6('0x2a')](_0x4aa68d);return rpc[_0x425b97+_0xb0a6('0x1a')][_0xb0a6('0x1b')](_0xda225c)['then'](function(_0x23bec3){logger[_0xb0a6('0x20')](_0xb0a6('0x9'),_0x5e2d2d,_0xda225c[_0xb0a6('0x18')]);if(_0x4aa68d[_0xb0a6('0x26')][_0xb0a6('0x2b')][_0xb0a6('0x2c')]){_0x24515c[_0xb0a6('0xb')]();}else{_0x24515c[_0xb0a6('0x22')]();}})['catch'](function(_0x12d683){logger[_0xb0a6('0x1e')](_0xb0a6('0x9'),_0x5e2d2d,JSON['stringify'](_0x12d683));_0x24515c[_0xb0a6('0xb')]();});})['catch'](function(_0x131e46){logger[_0xb0a6('0x1e')](_0xb0a6('0x9'),_0x5e2d2d,_0x131e46[_0xb0a6('0x2d')]);_0x24515c[_0xb0a6('0xb')]();});}}catch(_0x2584ce){logger[_0xb0a6('0x1e')](_0xb0a6('0x9'),_0x5e2d2d,JSON[_0xb0a6('0x2a')](_0x2584ce));_0x24515c[_0xb0a6('0x22')]();}};};
\ No newline at end of file
+var _0x31af=['info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','[%s][DIALOGFLOW]\x20%s','body','catch','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','result','fulfillment','endConversation','error','stop','lodash','moment','apiai-promise','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId'];(function(_0x393867,_0x202473){var _0x2a0fed=function(_0x258aa6){while(--_0x258aa6){_0x393867['push'](_0x393867['shift']());}};_0x2a0fed(++_0x202473);}(_0x31af,0xde));var _0xf31a=function(_0x47d606,_0x186291){_0x47d606=_0x47d606-0x0;var _0x248774=_0x31af[_0x47d606];return _0x248774;};'use strict';var _=require(_0xf31a('0x0'));var moment=require(_0xf31a('0x1'));var apiai=require(_0xf31a('0x2'));var md5=require('md5');var utils=require('./utils');var logger=require(_0xf31a('0x3'))('routing');var rpc={'chatMessage':require(_0xf31a('0x4')),'openchannelMessage':require(_0xf31a('0x5')),'mailMessage':require(_0xf31a('0x6')),'smsMessage':require(_0xf31a('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xf31a('0x8'))};exports[_0xf31a('0x9')]=function(_0x405926,_0x1dc7cc){return function(_0x47b7a1){try{if(!_[_0xf31a('0xa')](this[_0xf31a('0xb')][_0xf31a('0xc')])){logger[_0xf31a('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x405926,_0xf31a('0xe'));return _0x47b7a1[_0xf31a('0xf')]();}var _0xcff55c={'ContactId':this[_0xf31a('0x10')]['id'],'sentAt':moment()[_0xf31a('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xf31a('0x12')};if(this[_0xf31a('0x13')]===_0xf31a('0x14')||this[_0xf31a('0x13')]==='whatsapp'){_0xcff55c[_0xf31a('0x15')]=this[_0xf31a('0xb')]['phone'];}var _0x355f32=this[_0xf31a('0x13')];if(_0x355f32===_0xf31a('0x16')){_0xcff55c[_0xf31a('0x17')]=this[_0xf31a('0x18')]['id'];}else{_0xcff55c[_[_0xf31a('0x19')](_0x355f32)+_0xf31a('0x1a')]=this[_0xf31a('0x18')]['id'];}_0xcff55c[_[_0xf31a('0x19')](_0x355f32)+_0xf31a('0x1b')]=this[_0xf31a('0xb')]['id'];if(this[_0xf31a('0xb')][_0xf31a('0x1c')]){var _0xccfd8b=_0x1dc7cc[0x2];if(!_[_0xf31a('0x1d')](_0xccfd8b)){_0xcff55c['body']=utils[_0xf31a('0x1e')](_0xccfd8b,this);return rpc[_0x355f32+_0xf31a('0x1f')][_0xf31a('0x20')](_0xcff55c)[_0xf31a('0x21')](function(_0x4c3589){logger[_0xf31a('0xd')](_0xf31a('0x22'),_0x405926,_0xcff55c[_0xf31a('0x23')]);})[_0xf31a('0x24')](function(_0x18a97c){logger['error'](_0xf31a('0x22'),_0x405926,JSON[_0xf31a('0x25')](_0x18a97c));})['finally'](function(){logger[_0xf31a('0xd')](_0xf31a('0x26'),_0x405926);_0x47b7a1['stop']();});}else{logger[_0xf31a('0xd')](_0xf31a('0x27'),_0x405926);_0x47b7a1['stop']();}}else{var _0x5724b3=this;var _0x534317=apiai(_0x1dc7cc[0x0],{'language':_0x1dc7cc[0x1]||'en'});return _0x534317[_0xf31a('0x28')](this[_0xf31a('0x29')]['body'],{'sessionId':md5(this[_0xf31a('0xb')]['id'])})[_0xf31a('0x21')](function(_0x5d08ee){_0x5724b3[_0xf31a('0x23')]['dialogflow']=_0x5d08ee;_0xcff55c['body']=_0x5d08ee[_0xf31a('0x2a')][_0xf31a('0x2b')]['speech'];_0xcff55c['providerName']='dialogflow';_0xcff55c['providerResponse']=JSON[_0xf31a('0x25')](_0x5d08ee);return rpc[_0x355f32+_0xf31a('0x1f')][_0xf31a('0x20')](_0xcff55c)['then'](function(_0x2281c5){logger[_0xf31a('0xd')](_0xf31a('0x22'),_0x405926,_0xcff55c[_0xf31a('0x23')]);if(_0x5d08ee[_0xf31a('0x2a')]['metadata'][_0xf31a('0x2c')]){_0x47b7a1[_0xf31a('0xf')]();}else{_0x47b7a1['stop']();}})['catch'](function(_0x203f28){logger[_0xf31a('0x2d')]('[%s][DIALOGFLOW]\x20%s',_0x405926,JSON[_0xf31a('0x25')](_0x203f28));_0x47b7a1[_0xf31a('0xf')]();});})[_0xf31a('0x24')](function(_0x5385ba){logger[_0xf31a('0x2d')](_0xf31a('0x22'),_0x405926,_0x5385ba[_0xf31a('0x29')]);_0x47b7a1[_0xf31a('0xf')]();});}}catch(_0xbddc3b){logger[_0xf31a('0x2d')]('[%s][DIALOGFLOW]\x20%s',_0x405926,JSON[_0xf31a('0x25')](_0xbddc3b));_0x47b7a1[_0xf31a('0x2e')]();}};};
\ No newline at end of file
index 7891566..ed23d47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f91=['isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','SessionsClient','sessionPath','detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_INTENTNAME','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerName','dialogflowV2','push','fulfillmentText','all','message','lodash','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify'];(function(_0x5c463f,_0x198cc7){var _0x207f7a=function(_0x4746b6){while(--_0x4746b6){_0x5c463f['push'](_0x5c463f['shift']());}};_0x207f7a(++_0x198cc7);}(_0x4f91,0x101));var _0x14f9=function(_0xf97aad,_0x255c66){_0xf97aad=_0xf97aad-0x0;var _0x4f4543=_0x4f91[_0xf97aad];return _0x4f4543;};'use strict';var _=require(_0x14f9('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x14f9('0x1'));var moment=require(_0x14f9('0x2'));var Promise=require(_0x14f9('0x3'));var logger=require(_0x14f9('0x4'))(_0x14f9('0x5'));var utils=require(_0x14f9('0x6'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x14f9('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x14f9('0x8')),'faxMessage':require(_0x14f9('0x9')),'whatsappMessage':require(_0x14f9('0xa'))};function createMessage(_0x59d417,_0x30b366,_0x33e591,_0x413fbc){return new Promise(function(_0x575a86,_0x277b2f){var _0x9d07cc=_[_0x14f9('0xb')](_0x33e591);_0x9d07cc['body']=_0x413fbc;return rpc[_0x30b366+_0x14f9('0xc')][_0x14f9('0xd')](_0x9d07cc)[_0x14f9('0xe')](function(){logger['info'](_0x14f9('0xf'),_0x59d417,_0x9d07cc['body']);_0x575a86();})[_0x14f9('0x10')](function(_0x3b883){logger[_0x14f9('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x59d417,JSON[_0x14f9('0x12')](_0x3b883));_0x277b2f(_0x3b883);});});}exports['consequence']=function(_0x3256c0,_0x38ee0a){return function(_0x5c75ad){try{if(!_[_0x14f9('0x13')](this[_0x14f9('0x14')][_0x14f9('0x15')])){logger[_0x14f9('0x16')](_0x14f9('0xf'),_0x3256c0,_0x14f9('0x17'));return _0x5c75ad[_0x14f9('0x18')]();}var _0x1be694={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x14f9('0x19')),'direction':_0x14f9('0x1a')};if(this[_0x14f9('0x1b')]===_0x14f9('0x1c')||this['channel']===_0x14f9('0x1d')){_0x1be694['phone']=this[_0x14f9('0x14')][_0x14f9('0x1e')];}var _0x5d28d6=this[_0x14f9('0x1b')];if(_0x5d28d6===_0x14f9('0x1f')){_0x1be694[_0x14f9('0x20')]=this[_0x14f9('0x21')]['id'];}else{_0x1be694[_[_0x14f9('0x22')](_0x5d28d6)+_0x14f9('0x23')]=this[_0x14f9('0x21')]['id'];}_0x1be694[_[_0x14f9('0x22')](_0x5d28d6)+'InteractionId']=this[_0x14f9('0x14')]['id'];if(this[_0x14f9('0x14')][_0x14f9('0x24')]){var _0xd486cf=_0x38ee0a[0x4];if(!_[_0x14f9('0x25')](_0xd486cf)){_0x1be694[_0x14f9('0x26')]=utils['getMustacheRender'](_0xd486cf,this);return rpc[_0x5d28d6+'Message']['create'](_0x1be694)[_0x14f9('0xe')](function(_0xedf071){logger[_0x14f9('0x16')](_0x14f9('0xf'),_0x3256c0,_0x1be694[_0x14f9('0x26')]);})['catch'](function(_0x128a64){logger[_0x14f9('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x3256c0,JSON[_0x14f9('0x12')](_0x128a64));})[_0x14f9('0x27')](function(){logger[_0x14f9('0x16')](_0x14f9('0x28'),_0x3256c0);_0x5c75ad['stop']();});}else{logger[_0x14f9('0x16')](_0x14f9('0x29'),_0x3256c0);_0x5c75ad[_0x14f9('0x2a')]();}}else{var _0x334d2d=this;var _0x311c93=_0x38ee0a[0x2]['replace'](/\\n/g,'\x0a');var _0x533835={'credentials':{'private_key':_0x311c93,'client_email':_0x38ee0a[0x1]}};var _0x41d49b=new dialogflow[(_0x14f9('0x2b'))](_0x533835);var _0x2cad9=_0x41d49b[_0x14f9('0x2c')](_0x38ee0a[0x0],md5(_0x334d2d['interaction']['id']));var _0x2f3221={'session':_0x2cad9,'queryInput':{'text':{'text':_0x334d2d['message']['body'],'languageCode':_0x38ee0a[0x3]||'en'}}};return _0x41d49b[_0x14f9('0x2d')](_0x2f3221)['then'](function(_0x3f20f9){if(_0x3f20f9&&_0x3f20f9[_0x14f9('0x2e')]){_0x334d2d['body']['dialogflowV2']=_0x3f20f9;var _0x40a05a=_0x3f20f9[0x0];var _0x21e9d6=_0x40a05a[_0x14f9('0x2f')][_0x14f9('0x30')]&&_0x40a05a[_0x14f9('0x2f')]['diagnosticInfo'][_0x14f9('0x31')]?_0x40a05a[_0x14f9('0x2f')][_0x14f9('0x30')][_0x14f9('0x31')][_0x14f9('0x32')]['boolValue']:![];_0x334d2d[_0x14f9('0x26')][_0x14f9('0x33')]=_0x40a05a[_0x14f9('0x2f')][_0x14f9('0x34')];_0x334d2d['body'][_0x14f9('0x35')]=_0x40a05a[_0x14f9('0x2f')]['allRequiredParamsPresent'];_0x334d2d[_0x14f9('0x26')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x40a05a[_0x14f9('0x2f')][_0x14f9('0x30')]&&_0x40a05a['queryResult'][_0x14f9('0x30')][_0x14f9('0x31')]?_0x40a05a[_0x14f9('0x2f')][_0x14f9('0x30')][_0x14f9('0x31')][_0x14f9('0x32')]['boolValue']:![];_0x334d2d['body'][_0x14f9('0x36')]=_0x40a05a['queryResult']['intent']['name'];_0x334d2d[_0x14f9('0x26')][_0x14f9('0x37')]=_0x40a05a['queryResult'][_0x14f9('0x38')]['displayName'];_0x334d2d[_0x14f9('0x26')][_0x14f9('0x39')]=_0x40a05a[_0x14f9('0x2f')]['intent'][_0x14f9('0x3a')];_0x334d2d[_0x14f9('0x26')]['DIALOGFLOWV2_LANGUAGECODE']=_0x40a05a[_0x14f9('0x2f')][_0x14f9('0x3b')];_0x334d2d['body'][_0x14f9('0x3c')]=_0x40a05a['queryResult'][_0x14f9('0x3d')];_0x334d2d['body']['DIALOGFLOWV2_SCORE']=_0x40a05a[_0x14f9('0x2f')][_0x14f9('0x3e')];_0x1be694[_0x14f9('0x3f')]=_0x14f9('0x40');_0x1be694['providerResponse']=JSON['stringify'](_0x3f20f9);var _0x5da210=[];for(var _0x9a7066=0x0;_0x9a7066<_0x3f20f9[_0x14f9('0x2e')];_0x9a7066++){var _0x17531d=_0x3f20f9[_0x9a7066];if(_0x17531d&&_0x17531d['queryResult']&&_0x17531d[_0x14f9('0x2f')]['fulfillmentText']){_0x5da210[_0x14f9('0x41')](createMessage(_0x3256c0,_0x5d28d6,_0x1be694,_0x17531d[_0x14f9('0x2f')][_0x14f9('0x42')]));}}return Promise[_0x14f9('0x43')](_0x5da210)[_0x14f9('0xe')](function(){if(_0x21e9d6){_0x5c75ad[_0x14f9('0x18')]();}else{_0x5c75ad[_0x14f9('0x2a')]();}})[_0x14f9('0x10')](function(_0xbc7a8e){logger[_0x14f9('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x3256c0,JSON[_0x14f9('0x12')](_0xbc7a8e));_0x5c75ad[_0x14f9('0x18')]();});}})[_0x14f9('0x10')](function(_0xfd59aa){logger[_0x14f9('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x3256c0,_0xfd59aa[_0x14f9('0x44')]);_0x5c75ad[_0x14f9('0x18')]();});}}catch(_0x2c3494){logger[_0x14f9('0x11')](_0x14f9('0xf'),_0x3256c0,JSON[_0x14f9('0x12')](_0x2c3494));_0x5c75ad[_0x14f9('0x2a')]();}};};
\ No newline at end of file
+var _0xfa12=['../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','isNil','interaction','UserId','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','message','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_INTENTNAME','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerResponse','fulfillmentText','push','lodash','dialogflow','md5'];(function(_0x207d2f,_0x44400f){var _0x3c3498=function(_0x57fdfb){while(--_0x57fdfb){_0x207d2f['push'](_0x207d2f['shift']());}};_0x3c3498(++_0x44400f);}(_0xfa12,0x1bd));var _0x2fa1=function(_0x43aa42,_0x349364){_0x43aa42=_0x43aa42-0x0;var _0x292011=_0xfa12[_0x43aa42];return _0x292011;};'use strict';var _=require(_0x2fa1('0x0'));var dialogflow=require(_0x2fa1('0x1'));var md5=require(_0x2fa1('0x2'));var moment=require('moment');var Promise=require('bluebird');var logger=require(_0x2fa1('0x3'))(_0x2fa1('0x4'));var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2fa1('0x5')),'mailMessage':require(_0x2fa1('0x6')),'smsMessage':require(_0x2fa1('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x2fa1('0x8'))};function createMessage(_0x5d5fb4,_0xfa25d9,_0x1adece,_0x3ee801){return new Promise(function(_0x370571,_0x1c2df0){var _0x45db27=_['clone'](_0x1adece);_0x45db27[_0x2fa1('0x9')]=_0x3ee801;return rpc[_0xfa25d9+_0x2fa1('0xa')][_0x2fa1('0xb')](_0x45db27)[_0x2fa1('0xc')](function(){logger[_0x2fa1('0xd')](_0x2fa1('0xe'),_0x5d5fb4,_0x45db27[_0x2fa1('0x9')]);_0x370571();})[_0x2fa1('0xf')](function(_0x527ab9){logger[_0x2fa1('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x5d5fb4,JSON[_0x2fa1('0x11')](_0x527ab9));_0x1c2df0(_0x527ab9);});});}exports['consequence']=function(_0x44a525,_0x174cb5){return function(_0x17298e){try{if(!_[_0x2fa1('0x12')](this[_0x2fa1('0x13')][_0x2fa1('0x14')])){logger['info'](_0x2fa1('0xe'),_0x44a525,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x17298e[_0x2fa1('0x15')]();}var _0x1be9ea={'ContactId':this['contact']['id'],'sentAt':moment()[_0x2fa1('0x16')](_0x2fa1('0x17')),'direction':_0x2fa1('0x18')};if(this[_0x2fa1('0x19')]===_0x2fa1('0x1a')||this['channel']==='whatsapp'){_0x1be9ea[_0x2fa1('0x1b')]=this['interaction'][_0x2fa1('0x1b')];}var _0x383968=this[_0x2fa1('0x19')];if(_0x383968==='chat'){_0x1be9ea[_0x2fa1('0x1c')]=this[_0x2fa1('0x1d')]['id'];}else{_0x1be9ea[_['upperFirst'](_0x383968)+_0x2fa1('0x1e')]=this[_0x2fa1('0x1d')]['id'];}_0x1be9ea[_[_0x2fa1('0x1f')](_0x383968)+_0x2fa1('0x20')]=this['interaction']['id'];if(this[_0x2fa1('0x13')]['created']){var _0x2ffe87=_0x174cb5[0x4];if(!_['isEmpty'](_0x2ffe87)){_0x1be9ea['body']=utils[_0x2fa1('0x21')](_0x2ffe87,this);return rpc[_0x383968+'Message'][_0x2fa1('0xb')](_0x1be9ea)[_0x2fa1('0xc')](function(_0x35c18c){logger[_0x2fa1('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x44a525,_0x1be9ea[_0x2fa1('0x9')]);})[_0x2fa1('0xf')](function(_0x3e5147){logger[_0x2fa1('0x10')](_0x2fa1('0xe'),_0x44a525,JSON['stringify'](_0x3e5147));})[_0x2fa1('0x22')](function(){logger[_0x2fa1('0xd')](_0x2fa1('0x23'),_0x44a525);_0x17298e[_0x2fa1('0x24')]();});}else{logger[_0x2fa1('0xd')](_0x2fa1('0x25'),_0x44a525);_0x17298e[_0x2fa1('0x24')]();}}else{var _0xe2416a=this;var _0x1a60b9=_0x174cb5[0x2]['replace'](/\\n/g,'\x0a');var _0x38eae4={'credentials':{'private_key':_0x1a60b9,'client_email':_0x174cb5[0x1]}};var _0x4dd643=new dialogflow[(_0x2fa1('0x26'))](_0x38eae4);var _0x29875f=_0x4dd643['sessionPath'](_0x174cb5[0x0],md5(_0xe2416a[_0x2fa1('0x13')]['id']));var _0x2551ef={'session':_0x29875f,'queryInput':{'text':{'text':_0xe2416a[_0x2fa1('0x27')]['body'],'languageCode':_0x174cb5[0x3]||'en'}}};return _0x4dd643['detectIntent'](_0x2551ef)['then'](function(_0x499b40){if(_0x499b40&&_0x499b40[_0x2fa1('0x28')]){_0xe2416a['body'][_0x2fa1('0x29')]=_0x499b40;var _0x2cdfed=_0x499b40[0x0];var _0x385c65=_0x2cdfed[_0x2fa1('0x2a')][_0x2fa1('0x2b')]&&_0x2cdfed[_0x2fa1('0x2a')][_0x2fa1('0x2b')][_0x2fa1('0x2c')]?_0x2cdfed[_0x2fa1('0x2a')][_0x2fa1('0x2b')][_0x2fa1('0x2c')][_0x2fa1('0x2d')][_0x2fa1('0x2e')]:![];_0xe2416a[_0x2fa1('0x9')][_0x2fa1('0x2f')]=_0x2cdfed['queryResult'][_0x2fa1('0x30')];_0xe2416a[_0x2fa1('0x9')][_0x2fa1('0x31')]=_0x2cdfed['queryResult'][_0x2fa1('0x32')];_0xe2416a[_0x2fa1('0x9')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x2cdfed[_0x2fa1('0x2a')][_0x2fa1('0x2b')]&&_0x2cdfed['queryResult'][_0x2fa1('0x2b')][_0x2fa1('0x2c')]?_0x2cdfed[_0x2fa1('0x2a')]['diagnosticInfo']['fields']['end_conversation'][_0x2fa1('0x2e')]:![];_0xe2416a['body'][_0x2fa1('0x33')]=_0x2cdfed[_0x2fa1('0x2a')]['intent']['name'];_0xe2416a[_0x2fa1('0x9')][_0x2fa1('0x34')]=_0x2cdfed['queryResult'][_0x2fa1('0x35')]['displayName'];_0xe2416a[_0x2fa1('0x9')][_0x2fa1('0x36')]=_0x2cdfed['queryResult'][_0x2fa1('0x35')][_0x2fa1('0x37')];_0xe2416a['body'][_0x2fa1('0x38')]=_0x2cdfed[_0x2fa1('0x2a')][_0x2fa1('0x39')];_0xe2416a['body'][_0x2fa1('0x3a')]=_0x2cdfed['queryResult'][_0x2fa1('0x3b')];_0xe2416a['body']['DIALOGFLOWV2_SCORE']=_0x2cdfed['queryResult'][_0x2fa1('0x3c')];_0x1be9ea['providerName']=_0x2fa1('0x29');_0x1be9ea[_0x2fa1('0x3d')]=JSON['stringify'](_0x499b40);var _0x1288a1=[];for(var _0x369fd6=0x0;_0x369fd6<_0x499b40[_0x2fa1('0x28')];_0x369fd6++){var _0x136191=_0x499b40[_0x369fd6];if(_0x136191&&_0x136191['queryResult']&&_0x136191['queryResult'][_0x2fa1('0x3e')]){_0x1288a1[_0x2fa1('0x3f')](createMessage(_0x44a525,_0x383968,_0x1be9ea,_0x136191['queryResult'][_0x2fa1('0x3e')]));}}return Promise['all'](_0x1288a1)[_0x2fa1('0xc')](function(){if(_0x385c65){_0x17298e[_0x2fa1('0x15')]();}else{_0x17298e['stop']();}})['catch'](function(_0x3c42e8){logger['error'](_0x2fa1('0xe'),_0x44a525,JSON[_0x2fa1('0x11')](_0x3c42e8));_0x17298e[_0x2fa1('0x15')]();});}})['catch'](function(_0x52a431){logger[_0x2fa1('0x10')](_0x2fa1('0xe'),_0x44a525,_0x52a431[_0x2fa1('0x27')]);_0x17298e[_0x2fa1('0x15')]();});}}catch(_0x1c8ea7){logger['error'](_0x2fa1('0xe'),_0x44a525,JSON[_0x2fa1('0x11')](_0x1c8ea7));_0x17298e[_0x2fa1('0x24')]();}};};
\ No newline at end of file
index 10260a4..ac02ee4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9c4=['html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','error','map','message','join','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','rules','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','validate','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd9c4,0x120));var _0x4d9c=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0xd9c4[_0x1d5400];return _0x21d9fe;};'use strict';var schema=require(_0x4d9c('0x0'));var _=require(_0x4d9c('0x1'));var htmlToText=require(_0x4d9c('0x2'));var utils=require(_0x4d9c('0x3'));var logger=require(_0x4d9c('0x4'))(_0x4d9c('0x5'));var gotoif=schema({'condition':{'type':_0x4d9c('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x4d9c('0x7'),'message':_0x4d9c('0x8')},'priorityFalse':{'type':_0x4d9c('0x7'),'message':_0x4d9c('0x9')}});exports[_0x4d9c('0xa')]=function(_0x5f2f9f,_0x44d374){return function(_0x44d00c){try{var _0x4cd1bd={'condition':htmlToText[_0x4d9c('0xb')](utils[_0x4d9c('0xc')](_0x44d374[0x0],this),{'wordwrap':![]})[_0x4d9c('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x44d374[0x1],'priorityFalse':_0x44d374[0x2]};var _0x183854=gotoif[_0x4d9c('0x0')](_0x4cd1bd,{'typecast':!![]});if(_0x183854['length']){logger[_0x4d9c('0xe')]('[%s][GOTOIF]\x20%s',_0x5f2f9f,_[_0x4d9c('0xf')](_0x183854,_0x4d9c('0x10'))[_0x4d9c('0x11')](',\x20'));_0x44d00c['stop']();}else{try{var _0x27ba51=eval('('+_0x4cd1bd['condition']+')');var _0x5b5cae=_0x27ba51?_0x4cd1bd[_0x4d9c('0x12')]:_0x4cd1bd[_0x4d9c('0x13')];logger[_0x4d9c('0x14')](_0x4d9c('0x15'),_0x5f2f9f,_0x4cd1bd[_0x4d9c('0x16')],_0x27ba51,_0x5b5cae||_0x4d9c('0x17'));if(_0x5b5cae){var _0x21535e=_[_0x4d9c('0x18')](_0x44d00c[_0x4d9c('0x19')](),{'p':_0x5b5cae});if(_0x21535e>=0x0){logger[_0x4d9c('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x5f2f9f,_0x5b5cae||'next',_0x21535e);_0x44d00c['next'](_0x21535e);}else{logger[_0x4d9c('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x5f2f9f,_0x5b5cae||_0x4d9c('0x17'));_0x44d00c[_0x4d9c('0x1a')]();}}else{_0x44d00c[_0x4d9c('0x17')]();}}catch(_0x5f2363){logger[_0x4d9c('0xe')](_0x4d9c('0x1b'),_0x5f2f9f,_0x5f2363['message']);_0x44d00c[_0x4d9c('0x1a')]();}}}catch(_0x1f3c53){logger['error'](_0x4d9c('0x1c'),_0x5f2f9f,JSON['stringify'](_0x1f3c53));_0x44d00c[_0x4d9c('0x1a')]();}};};
\ No newline at end of file
+var _0x26fb=['condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','length','[%s][GOTOIF]\x20%s','map','message','join','condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','html-to-text','../../../../config/logger','routing','string'];(function(_0x3ba1c0,_0xbe8e7a){var _0x3fc721=function(_0x3c5e94){while(--_0x3c5e94){_0x3ba1c0['push'](_0x3ba1c0['shift']());}};_0x3fc721(++_0xbe8e7a);}(_0x26fb,0xe5));var _0xb26f=function(_0x38185a,_0x2f3522){_0x38185a=_0x38185a-0x0;var _0x3e531b=_0x26fb[_0x38185a];return _0x3e531b;};'use strict';var schema=require(_0xb26f('0x0'));var _=require('lodash');var htmlToText=require(_0xb26f('0x1'));var utils=require('./utils');var logger=require(_0xb26f('0x2'))(_0xb26f('0x3'));var gotoif=schema({'condition':{'type':_0xb26f('0x4'),'required':!![],'message':_0xb26f('0x5')},'priorityTrue':{'type':'number','message':_0xb26f('0x6')},'priorityFalse':{'type':'number','message':_0xb26f('0x7')}});exports['consequence']=function(_0x592ed0,_0x2c65df){return function(_0x1501c9){try{var _0x104578={'condition':htmlToText[_0xb26f('0x8')](utils['getMustacheRender'](_0x2c65df[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2c65df[0x1],'priorityFalse':_0x2c65df[0x2]};var _0x5436bf=gotoif[_0xb26f('0x0')](_0x104578,{'typecast':!![]});if(_0x5436bf[_0xb26f('0x9')]){logger['error'](_0xb26f('0xa'),_0x592ed0,_[_0xb26f('0xb')](_0x5436bf,_0xb26f('0xc'))[_0xb26f('0xd')](',\x20'));_0x1501c9['stop']();}else{try{var _0x207ea9=eval('('+_0x104578[_0xb26f('0xe')]+')');var _0x4ff980=_0x207ea9?_0x104578[_0xb26f('0xf')]:_0x104578['priorityFalse'];logger[_0xb26f('0x10')](_0xb26f('0x11'),_0x592ed0,_0x104578['condition'],_0x207ea9,_0x4ff980||'next');if(_0x4ff980){var _0x416f36=_['findIndex'](_0x1501c9[_0xb26f('0x12')](),{'p':_0x4ff980});if(_0x416f36>=0x0){logger[_0xb26f('0x10')](_0xb26f('0x13'),_0x592ed0,_0x4ff980||_0xb26f('0x14'),_0x416f36);_0x1501c9[_0xb26f('0x14')](_0x416f36);}else{logger['info'](_0xb26f('0x15'),_0x592ed0,_0x4ff980||_0xb26f('0x14'));_0x1501c9[_0xb26f('0x16')]();}}else{_0x1501c9[_0xb26f('0x14')]();}}catch(_0x5eff4b){logger[_0xb26f('0x17')](_0xb26f('0x18'),_0x592ed0,_0x5eff4b[_0xb26f('0xc')]);_0x1501c9[_0xb26f('0x16')]();}}}catch(_0x5c53d7){logger[_0xb26f('0x17')](_0xb26f('0xa'),_0x592ed0,JSON[_0xb26f('0x19')](_0x5c53d7));_0x1501c9[_0xb26f('0x16')]();}};};
\ No newline at end of file
index 3b26d2a..a93af1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa760=['number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','lodash','../../../../config/logger','routing'];(function(_0x31ba0e,_0x54cd4a){var _0x34b1f6=function(_0x45d05e){while(--_0x45d05e){_0x31ba0e['push'](_0x31ba0e['shift']());}};_0x34b1f6(++_0x54cd4a);}(_0xa760,0x75));var _0x0a76=function(_0x4bf793,_0x404922){_0x4bf793=_0x4bf793-0x0;var _0x55a44b=_0xa760[_0x4bf793];return _0x55a44b;};'use strict';var schema=require('validate');var _=require(_0x0a76('0x0'));var logger=require(_0x0a76('0x1'))(_0x0a76('0x2'));var gotop=schema({'priority':{'type':_0x0a76('0x3'),'required':!![],'message':_0x0a76('0x4')}});exports[_0x0a76('0x5')]=function(_0x59f65b,_0x405d4d){return function(_0x46f1ac){try{var _0x58e7e8={'priority':_0x405d4d[0x0]};var _0x2da092=gotop[_0x0a76('0x6')](_0x58e7e8,{'typecast':!![]});if(_0x2da092[_0x0a76('0x7')]){logger[_0x0a76('0x8')](_0x0a76('0x9'),_0x59f65b,_['map'](_0x2da092,_0x0a76('0xa'))[_0x0a76('0xb')](',\x20'));_0x46f1ac[_0x0a76('0xc')]();}else{logger[_0x0a76('0xd')](_0x0a76('0xe'),_0x59f65b,_0x58e7e8[_0x0a76('0xf')]);if(_0x58e7e8['priority']){var _0x2c88f7=_[_0x0a76('0x10')](_0x46f1ac[_0x0a76('0x11')](),{'p':_0x58e7e8[_0x0a76('0xf')]});if(_0x2c88f7>=0x0){logger[_0x0a76('0xd')](_0x0a76('0x12'),_0x59f65b,_0x58e7e8['priority']||_0x0a76('0x13'),_0x2c88f7);_0x46f1ac[_0x0a76('0x13')](_0x2c88f7);}else{logger[_0x0a76('0xd')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x59f65b,_0x58e7e8[_0x0a76('0xf')]||_0x0a76('0x13'));_0x46f1ac[_0x0a76('0xc')]();}}else{_0x46f1ac[_0x0a76('0x13')]();}}}catch(_0x5f331c){logger[_0x0a76('0x8')](_0x0a76('0x9'),_0x59f65b,JSON['stringify'](_0x5f331c));_0x46f1ac[_0x0a76('0xc')]();}};};
\ No newline at end of file
+var _0x0d1e=['routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','priority','findIndex','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0x0d1e,0x1d3));var _0xe0d1=function(_0x58cd35,_0x537e68){_0x58cd35=_0x58cd35-0x0;var _0x4a3aac=_0x0d1e[_0x58cd35];return _0x4a3aac;};'use strict';var schema=require(_0xe0d1('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0xe0d1('0x1'));var gotop=schema({'priority':{'type':_0xe0d1('0x2'),'required':!![],'message':_0xe0d1('0x3')}});exports[_0xe0d1('0x4')]=function(_0x2b4c9e,_0x3135d3){return function(_0x434b42){try{var _0x201c8a={'priority':_0x3135d3[0x0]};var _0x3b63d3=gotop[_0xe0d1('0x0')](_0x201c8a,{'typecast':!![]});if(_0x3b63d3[_0xe0d1('0x5')]){logger[_0xe0d1('0x6')](_0xe0d1('0x7'),_0x2b4c9e,_[_0xe0d1('0x8')](_0x3b63d3,_0xe0d1('0x9'))[_0xe0d1('0xa')](',\x20'));_0x434b42[_0xe0d1('0xb')]();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x2b4c9e,_0x201c8a['priority']);if(_0x201c8a[_0xe0d1('0xc')]){var _0x22bfca=_[_0xe0d1('0xd')](_0x434b42['rules'](),{'p':_0x201c8a[_0xe0d1('0xc')]});if(_0x22bfca>=0x0){logger[_0xe0d1('0xe')](_0xe0d1('0xf'),_0x2b4c9e,_0x201c8a[_0xe0d1('0xc')]||'next',_0x22bfca);_0x434b42[_0xe0d1('0x10')](_0x22bfca);}else{logger[_0xe0d1('0xe')](_0xe0d1('0x11'),_0x2b4c9e,_0x201c8a['priority']||_0xe0d1('0x10'));_0x434b42[_0xe0d1('0xb')]();}}else{_0x434b42[_0xe0d1('0x10')]();}}}catch(_0x5f5246){logger[_0xe0d1('0x6')](_0xe0d1('0x7'),_0x2b4c9e,JSON['stringify'](_0x5f5246));_0x434b42['stop']();}};};
\ No newline at end of file
index 860516e..b737261 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcdd=['next','catch','error','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body'];(function(_0x5a2e58,_0x1865cb){var _0x1e6f1e=function(_0x107abe){while(--_0x107abe){_0x5a2e58['push'](_0x5a2e58['shift']());}};_0x1e6f1e(++_0x1865cb);}(_0xfcdd,0x18a));var _0xdfcd=function(_0x3bea37,_0x1ec76d){_0x3bea37=_0x3bea37-0x0;var _0x83ee5a=_0xfcdd[_0x3bea37];return _0x83ee5a;};'use strict';var _=require(_0xdfcd('0x0'));var utils=require(_0xdfcd('0x1'));var logger=require(_0xdfcd('0x2'))(_0xdfcd('0x3'));var rpc={'chatMessage':require(_0xdfcd('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xdfcd('0x5')),'whatsappMessage':require(_0xdfcd('0x6'))};exports[_0xdfcd('0x7')]=function(_0x4fa03d,_0x13a96c){return function(_0x2ad358){try{var _0x3fa276={'body':utils[_0xdfcd('0x8')](_0x13a96c[0x0],this),'ContactId':this[_0xdfcd('0x9')]['id']};if(this[_0xdfcd('0xa')]===_0xdfcd('0xb')){_0x3fa276[_0xdfcd('0xc')]=this['account']['id'];}else{_0x3fa276[_[_0xdfcd('0xd')](this[_0xdfcd('0xa')])+_0xdfcd('0xe')]=this['account']['id'];}_0x3fa276[_[_0xdfcd('0xd')](this[_0xdfcd('0xa')])+_0xdfcd('0xf')]=this[_0xdfcd('0x10')]['id'];if(rpc[this[_0xdfcd('0xa')]+_0xdfcd('0x11')]){return rpc[this[_0xdfcd('0xa')]+'Message']['create'](_0x3fa276)[_0xdfcd('0x12')](function(_0x1388b3){logger[_0xdfcd('0x13')](_0xdfcd('0x14'),_0x4fa03d,_0x3fa276[_0xdfcd('0x15')]);_0x2ad358[_0xdfcd('0x16')]();})[_0xdfcd('0x17')](function(_0x37a33d){logger[_0xdfcd('0x18')](_0xdfcd('0x14'),_0x4fa03d,JSON['stringify'](_0x37a33d));_0x2ad358[_0xdfcd('0x19')]();});}}catch(_0x43b775){logger[_0xdfcd('0x18')](_0xdfcd('0x14'),_0x4fa03d,JSON['stringify'](_0x43b775));_0x2ad358['stop']();}};};
\ No newline at end of file
+var _0x3f77=['../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','next','error','stop','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x346e46,_0x52301a){var _0x5a24ff=function(_0x5d4807){while(--_0x5d4807){_0x346e46['push'](_0x346e46['shift']());}};_0x5a24ff(++_0x52301a);}(_0x3f77,0xa0));var _0x73f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f77[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x73f7('0x0'));var utils=require(_0x73f7('0x1'));var logger=require(_0x73f7('0x2'))(_0x73f7('0x3'));var rpc={'chatMessage':require(_0x73f7('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x73f7('0x5')),'smsMessage':require(_0x73f7('0x6')),'faxMessage':require(_0x73f7('0x7')),'whatsappMessage':require(_0x73f7('0x8'))};exports['consequence']=function(_0x39ce19,_0x39693a){return function(_0x4fc442){try{var _0x49f742={'body':utils[_0x73f7('0x9')](_0x39693a[0x0],this),'ContactId':this[_0x73f7('0xa')]['id']};if(this[_0x73f7('0xb')]===_0x73f7('0xc')){_0x49f742[_0x73f7('0xd')]=this[_0x73f7('0xe')]['id'];}else{_0x49f742[_['upperFirst'](this[_0x73f7('0xb')])+_0x73f7('0xf')]=this['account']['id'];}_0x49f742[_[_0x73f7('0x10')](this[_0x73f7('0xb')])+_0x73f7('0x11')]=this[_0x73f7('0x12')]['id'];if(rpc[this[_0x73f7('0xb')]+_0x73f7('0x13')]){return rpc[this[_0x73f7('0xb')]+_0x73f7('0x13')]['create'](_0x49f742)[_0x73f7('0x14')](function(_0x35b5ec){logger[_0x73f7('0x15')](_0x73f7('0x16'),_0x39ce19,_0x49f742[_0x73f7('0x17')]);_0x4fc442[_0x73f7('0x18')]();})['catch'](function(_0x5920ce){logger[_0x73f7('0x19')](_0x73f7('0x16'),_0x39ce19,JSON['stringify'](_0x5920ce));_0x4fc442[_0x73f7('0x1a')]();});}}catch(_0x5f3d20){logger[_0x73f7('0x19')](_0x73f7('0x16'),_0x39ce19,JSON[_0x73f7('0x1b')](_0x5f3d20));_0x4fc442['stop']();}};};
\ No newline at end of file
index 0164e4a..a40265c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4cd=['getMustacheRender','next','error','stringify','./utils','routing','consequence','info','[%s][NOOP]\x20%s'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xc4cd,0x112));var _0xdc4c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4cd[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0xdc4c('0x0'));var logger=require('../../../../config/logger')(_0xdc4c('0x1'));exports[_0xdc4c('0x2')]=function(_0x260033,_0x79dbc4){return function(_0x4d7324){try{logger[_0xdc4c('0x3')](_0xdc4c('0x4'),_0x260033,utils[_0xdc4c('0x5')](_0x79dbc4[0x0],this));_0x4d7324[_0xdc4c('0x6')]();}catch(_0x1a0903){logger[_0xdc4c('0x7')](_0xdc4c('0x4'),_0x260033,JSON[_0xdc4c('0x8')](_0x1a0903));_0x4d7324['stop']();}};};
\ No newline at end of file
+var _0x9178=['./utils','routing','consequence','[%s][NOOP]\x20%s','getMustacheRender','error','stop'];(function(_0x4ffed9,_0x4ddfe2){var _0x746f9d=function(_0x7e20e7){while(--_0x7e20e7){_0x4ffed9['push'](_0x4ffed9['shift']());}};_0x746f9d(++_0x4ddfe2);}(_0x9178,0xa8));var _0x8917=function(_0x39d860,_0x37b2b4){_0x39d860=_0x39d860-0x0;var _0x2618fc=_0x9178[_0x39d860];return _0x2618fc;};'use strict';var utils=require(_0x8917('0x0'));var logger=require('../../../../config/logger')(_0x8917('0x1'));exports[_0x8917('0x2')]=function(_0x1d8bb1,_0x632fb0){return function(_0x29489f){try{logger['info'](_0x8917('0x3'),_0x1d8bb1,utils[_0x8917('0x4')](_0x632fb0[0x0],this));_0x29489f['next']();}catch(_0xb7fe98){logger[_0x8917('0x5')]('[%s][NOOP]\x20%s',_0x1d8bb1,JSON['stringify'](_0xb7fe98));_0x29489f[_0x8917('0x6')]();}};};
\ No newline at end of file
index 2424a9c..9843a31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73b6=['pick','%s:queue:%s','save','remove','../../rpc/mailQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','info','name','QueueReport','create','catch','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','Queues','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','next','strategy','rrmemory','beepall','log','stack','validate','util','seq-queue','moment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions'];(function(_0xb7c6df,_0x36b73e){var _0x1b5f9d=function(_0x2375eb){while(--_0x2375eb){_0xb7c6df['push'](_0xb7c6df['shift']());}};_0x1b5f9d(++_0x36b73e);}(_0x73b6,0xce));var _0x673b=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x73b6[_0x4154a6];return _0x3b2786;};'use strict';var schema=require(_0x673b('0x0'));var _=require('lodash');var util=require(_0x673b('0x1'));var seqqueue=require(_0x673b('0x2'));var moment=require(_0x673b('0x3'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x673b('0x4'))(_0x673b('0x5'));var strategy=require(_0x673b('0x6'));config[_0x673b('0x7')]=_[_0x673b('0x8')](config[_0x673b('0x7')],{'host':_0x673b('0x9'),'port':0x18eb});var io=require(_0x673b('0xa'))(new Redis(config['redis']));var attributes=['id',_0x673b('0xb'),_0x673b('0xc'),'queue',_0x673b('0xd'),_0x673b('0xe')];function emit(_0xd2630,_0x105b35,_0x278767){io['to'](_0xd2630)[_0x673b('0xf')](_0x105b35,_0x278767);}function emitChannelQueueInteraction(_0x6f28a8,_0x27dfa4,_0x5b9631,_0x369296,_0x3b9fae,_0x534a61,_0x83b6,_0x5d422d){var _0x877ef4=_[_0x673b('0x10')](_0x5b9631);_0x877ef4['queue_id']=_0x5d422d;_0x877ef4['queue']=_0x27dfa4;_0x877ef4[_0x673b('0xc')]=_0x369296;_0x877ef4['id']=_0x3b9fae;if(_0x534a61){_0x83b6[util[_0x673b('0x11')](_0x673b('0x12'),_0x6f28a8)][_0x3b9fae]=_[_0x673b('0x13')](_0x877ef4,attributes);}else{delete _0x83b6[util['format']('%sQueuesWaitingInteractions',_0x6f28a8)][_0x3b9fae];}emit(util[_0x673b('0x11')](_0x673b('0x14'),_0x6f28a8,_0x27dfa4),util[_0x673b('0x11')]('%s_queue_waiting_interaction:%s',_0x6f28a8,_0x534a61?_0x673b('0x15'):_0x673b('0x16')),_[_0x673b('0x13')](_0x877ef4,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x673b('0x17')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x673b('0x18')),'whatsappQueueReport':require(_0x673b('0x19'))};var queue=schema({'name':{'type':_0x673b('0x1a'),'required':!![],'message':_0x673b('0x1b')},'timeout':{'type':'number','message':_0x673b('0x1c')}});function startRouting(_0x421f28,_0x1a55e1,_0x2c1593,_0x1bd488){if(_0x421f28&&_0x1a55e1&&_0x2c1593){_0x1a55e1[_0x673b('0x1d')]+=0x1;var _0xc9fc6b={'uniqueid':_0x421f28,'from':_0x2c1593[_0x673b('0x1e')]?_0x2c1593[_0x673b('0x1e')][_0x673b('0xd')]:'','joinAt':moment()[_0x673b('0x11')](_0x673b('0x1f')),'ContactId':_0x2c1593['contact']?_0x2c1593[_0x673b('0x20')]['id']:null,'ListId':_0x2c1593[_0x673b('0x21')]?_0x2c1593['list']['id']:null};_0xc9fc6b[_[_0x673b('0x22')](_0x2c1593[_0x673b('0x23')])+_0x673b('0x24')]=_0x1a55e1['id']||null;_0xc9fc6b[_['upperFirst'](_0x2c1593[_0x673b('0x23')])+_0x673b('0x25')]=_0x2c1593[_0x673b('0x26')]?_0x2c1593[_0x673b('0x26')]['id']:null;_0xc9fc6b[_[_0x673b('0x22')](_0x2c1593[_0x673b('0x23')])+_0x673b('0x27')]=_0x2c1593[_0x673b('0x28')]?_0x2c1593['message']['id']:null;_0xc9fc6b[_[_0x673b('0x22')](_0x2c1593['channel'])+(_0x2c1593[_0x673b('0x23')]!==_0x673b('0x29')?'AccountId':'WebsiteId')]=_0x2c1593[_0x673b('0xc')]?_0x2c1593['account']['id']:null;logger[_0x673b('0x2a')](util[_0x673b('0x11')]('[%s][START:QUEUE][NAME:%s]',_0x421f28,_0x1a55e1[_0x673b('0x2b')]));emitChannelQueueInteraction(_0x2c1593['channel'],_0x1a55e1[_0x673b('0x2b')],_0xc9fc6b,_0x2c1593[_0x673b('0xc')][_0x673b('0x2b')],_0x2c1593[_0x673b('0x28')]['id'],!![],_0x1bd488,_0x1a55e1['id']);if(rpc[_0x2c1593[_0x673b('0x23')]+_0x673b('0x2c')]){return rpc[_0x2c1593[_0x673b('0x23')]+_0x673b('0x2c')][_0x673b('0x2d')](_0xc9fc6b)[_0x673b('0x2e')](function(_0x5a6fb1){logger['error'](_0x673b('0x2f'));});}}}function stopRouting(_0x55a197,_0x133f23,_0xc5a789,_0x277910){if(_0x55a197&&_0x133f23){_0x133f23[_0x673b('0x1d')]-=0x1;var _0x3564cc={'leaveAt':moment()[_0x673b('0x11')](_0x673b('0x1f')),'acceptAt':moment()[_0x673b('0x11')](_0x673b('0x1f')),'reason':_0x673b('0x30')};logger[_0x673b('0x2a')](util[_0x673b('0x11')](_0x673b('0x31'),_0x55a197,_0x133f23[_0x673b('0x2b')]));emitChannelQueueInteraction(_0xc5a789[_0x673b('0x23')],_0x133f23[_0x673b('0x2b')],_0xc5a789[_0x673b('0x1e')],_0xc5a789['account'][_0x673b('0x2b')],_0xc5a789[_0x673b('0x28')]['id'],![],_0x277910,_0x133f23['id']);if(rpc[_0xc5a789[_0x673b('0x23')]+_0x673b('0x2c')]){return rpc[_0xc5a789[_0x673b('0x23')]+_0x673b('0x2c')][_0x673b('0x32')](_0x55a197,_0x3564cc)[_0x673b('0x2e')](function(_0x1ab2f9){logger[_0x673b('0x33')](_0x673b('0x34'));});}}}function endRouting(_0x30e086,_0x7d248e,_0x180df3,_0x122def){if(_0x30e086&&_0x7d248e){_0x7d248e[_0x673b('0x1d')]-=0x1;var _0x23be05={'leaveAt':moment()[_0x673b('0x11')](_0x673b('0x1f')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x673b('0x35')};logger[_0x673b('0x2a')](util['format'](_0x673b('0x36'),_0x30e086,_0x7d248e['name']));emitChannelQueueInteraction(_0x180df3[_0x673b('0x23')],_0x7d248e[_0x673b('0x2b')],_0x180df3['body'],_0x180df3[_0x673b('0xc')]['name'],_0x180df3[_0x673b('0x28')]['id'],![],_0x122def);if(rpc[_0x180df3[_0x673b('0x23')]+'QueueReport']){return rpc[_0x180df3[_0x673b('0x23')]+'QueueReport'][_0x673b('0x32')](_0x30e086,_0x23be05)[_0x673b('0x2e')](function(_0x1464e7){logger['error'](_0x673b('0x34'));});}}}function handleFindQueue(_0x1306f1){return function(_0x11d87b){return _0x11d87b[_0x673b('0x2b')]['toLowerCase']()===_0x1306f1[_0x673b('0x37')]();};}exports[_0x673b('0x38')]=function(_0x30c2ec,_0x4e95b9,_0x12bbe1,_0x1f90b0){return function(_0x5cbec5){try{var _0x5ee487={'name':_0x4e95b9[0x0],'timeout':_0x4e95b9[0x1]};var _0x2f6acb=queue[_0x673b('0x0')](_0x5ee487,{'typecast':!![]});if(_0x2f6acb[_0x673b('0x39')]){logger['error'](_0x673b('0x3a'),_0x30c2ec,_[_0x673b('0x3b')](_0x2f6acb,_0x673b('0x28'))[_0x673b('0x3c')](',\x20'));_0x5cbec5[_0x673b('0x3d')]();}else{var _0x25e646=_['find'](_0x12bbe1[_0x1f90b0[_0x673b('0x23')]+_0x673b('0x3e')],handleFindQueue(_0x5ee487[_0x673b('0x2b')]));if(_0x25e646){startRouting(_0x30c2ec,_0x25e646,_0x1f90b0,_0x12bbe1);var _0x2ffdf7=(_0x25e646['timeout']||0xa)*0x3e8;var _0x582d32=(_0x5ee487['timeout']||0x14)*0x3e8;var _0x51d234,_0x1c1e3f;if(_0x2ffdf7>_0x582d32){_0x582d32=_0x2ffdf7;}var _0x4c52de=seqqueue['createQueue'](_0x2ffdf7);_0x4c52de['id']=_0x30c2ec;_0x4c52de['atimeout']=_0x2ffdf7;_0x4c52de[_0x673b('0x3f')]=_0x582d32;_0x4c52de[_0x673b('0x23')]=_0x1f90b0[_0x673b('0x23')];_0x12bbe1['rules'][_0x30c2ec]['on'](_0x673b('0x40'),function(){logger[_0x673b('0x2a')](_0x673b('0x41'),_0x30c2ec);stopRouting(_0x30c2ec,_0x25e646,_0x1f90b0,_0x12bbe1);clearTimeout(_0x51d234);_0x51d234=undefined;_0x4c52de[_0x673b('0x42')](!![]);if(_0x12bbe1[_0x673b('0x43')][_0x30c2ec]){delete _0x12bbe1[_0x673b('0x43')][_0x30c2ec];}_0x5cbec5[_0x673b('0x3d')]();});_0x12bbe1['rules'][_0x30c2ec]['on'](_0x673b('0x44'),function(){if(_0x12bbe1[_0x673b('0x43')][_0x30c2ec]){delete _0x12bbe1[_0x673b('0x43')][_0x30c2ec];}});_0x51d234=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x30c2ec);endRouting(_0x30c2ec,_0x25e646,_0x1f90b0,_0x12bbe1);clearTimeout(_0x51d234);_0x4c52de['close'](!![]);_0x5cbec5[_0x673b('0x45')]();},_0x582d32);switch(_0x25e646[_0x673b('0x46')]){case _0x673b('0x47'):strategy[_0x673b('0x47')](_0x4c52de,_0x25e646,_0x12bbe1,_0x1f90b0);break;default:strategy[_0x673b('0x48')](_0x4c52de,_0x25e646,_0x12bbe1,_0x1f90b0);}}else{logger[_0x673b('0x33')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x30c2ec,_0x5ee487['name']);_0x5cbec5[_0x673b('0x3d')]();}}}catch(_0x925314){console[_0x673b('0x49')](_0x925314);logger[_0x673b('0x33')](_0x673b('0x3a'),_0x30c2ec,_0x925314[_0x673b('0x4a')]);_0x5cbec5[_0x673b('0x3d')]();}};};
\ No newline at end of file
+var _0xfce8=['socket.io-emitter','queue_id','account','from','clone','queue','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','chat','AccountId','WebsiteId','info','name','message','QueueReport','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','validate','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost'];(function(_0x55dba9,_0x5897b1){var _0x5a5fd1=function(_0x4e3f2a){while(--_0x4e3f2a){_0x55dba9['push'](_0x55dba9['shift']());}};_0x5a5fd1(++_0x5897b1);}(_0xfce8,0x13c));var _0x8fce=function(_0x482bac,_0x2ad787){_0x482bac=_0x482bac-0x0;var _0x35d510=_0xfce8[_0x482bac];return _0x35d510;};'use strict';var schema=require(_0x8fce('0x0'));var _=require('lodash');var util=require(_0x8fce('0x1'));var seqqueue=require(_0x8fce('0x2'));var moment=require(_0x8fce('0x3'));var Redis=require(_0x8fce('0x4'));var config=require(_0x8fce('0x5'));var logger=require(_0x8fce('0x6'))(_0x8fce('0x7'));var strategy=require(_0x8fce('0x8'));config[_0x8fce('0x9')]=_[_0x8fce('0xa')](config[_0x8fce('0x9')],{'host':_0x8fce('0xb'),'port':0x18eb});var io=require(_0x8fce('0xc'))(new Redis(config['redis']));var attributes=['id',_0x8fce('0xd'),_0x8fce('0xe'),'queue',_0x8fce('0xf'),'joinAt'];function emit(_0x442612,_0x2f862e,_0x577bab){io['to'](_0x442612)['emit'](_0x2f862e,_0x577bab);}function emitChannelQueueInteraction(_0x3f2601,_0x9277ae,_0x36a42b,_0x221218,_0x289324,_0x23892a,_0x1787cb,_0xf6ee01){var _0x37c7be=_[_0x8fce('0x10')](_0x36a42b);_0x37c7be['queue_id']=_0xf6ee01;_0x37c7be[_0x8fce('0x11')]=_0x9277ae;_0x37c7be['account']=_0x221218;_0x37c7be['id']=_0x289324;if(_0x23892a){_0x1787cb[util[_0x8fce('0x12')](_0x8fce('0x13'),_0x3f2601)][_0x289324]=_[_0x8fce('0x14')](_0x37c7be,attributes);}else{delete _0x1787cb[util[_0x8fce('0x12')](_0x8fce('0x13'),_0x3f2601)][_0x289324];}emit(util[_0x8fce('0x12')](_0x8fce('0x15'),_0x3f2601,_0x9277ae),util[_0x8fce('0x12')](_0x8fce('0x16'),_0x3f2601,_0x23892a?_0x8fce('0x17'):_0x8fce('0x18')),_[_0x8fce('0x14')](_0x37c7be,attributes));}var rpc={'openchannelQueueReport':require(_0x8fce('0x19')),'mailQueueReport':require(_0x8fce('0x1a')),'chatQueueReport':require(_0x8fce('0x1b')),'smsQueueReport':require(_0x8fce('0x1c')),'faxQueueReport':require(_0x8fce('0x1d')),'whatsappQueueReport':require(_0x8fce('0x1e'))};var queue=schema({'name':{'type':_0x8fce('0x1f'),'required':!![],'message':_0x8fce('0x20')},'timeout':{'type':'number','message':_0x8fce('0x21')}});function startRouting(_0x5e6754,_0x65c9a7,_0x417dd4,_0x45565d){if(_0x5e6754&&_0x65c9a7&&_0x417dd4){_0x65c9a7[_0x8fce('0x22')]+=0x1;var _0x42c502={'uniqueid':_0x5e6754,'from':_0x417dd4[_0x8fce('0x23')]?_0x417dd4['body'][_0x8fce('0xf')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x417dd4[_0x8fce('0x24')]?_0x417dd4[_0x8fce('0x24')]['id']:null,'ListId':_0x417dd4['list']?_0x417dd4[_0x8fce('0x25')]['id']:null};_0x42c502[_[_0x8fce('0x26')](_0x417dd4[_0x8fce('0x27')])+_0x8fce('0x28')]=_0x65c9a7['id']||null;_0x42c502[_[_0x8fce('0x26')](_0x417dd4[_0x8fce('0x27')])+_0x8fce('0x29')]=_0x417dd4['interaction']?_0x417dd4[_0x8fce('0x2a')]['id']:null;_0x42c502[_[_0x8fce('0x26')](_0x417dd4[_0x8fce('0x27')])+_0x8fce('0x2b')]=_0x417dd4['message']?_0x417dd4['message']['id']:null;_0x42c502[_[_0x8fce('0x26')](_0x417dd4['channel'])+(_0x417dd4['channel']!==_0x8fce('0x2c')?_0x8fce('0x2d'):_0x8fce('0x2e'))]=_0x417dd4[_0x8fce('0xe')]?_0x417dd4['account']['id']:null;logger[_0x8fce('0x2f')](util[_0x8fce('0x12')]('[%s][START:QUEUE][NAME:%s]',_0x5e6754,_0x65c9a7[_0x8fce('0x30')]));emitChannelQueueInteraction(_0x417dd4[_0x8fce('0x27')],_0x65c9a7[_0x8fce('0x30')],_0x42c502,_0x417dd4['account']['name'],_0x417dd4[_0x8fce('0x31')]['id'],!![],_0x45565d,_0x65c9a7['id']);if(rpc[_0x417dd4[_0x8fce('0x27')]+_0x8fce('0x32')]){return rpc[_0x417dd4[_0x8fce('0x27')]+_0x8fce('0x32')][_0x8fce('0x33')](_0x42c502)[_0x8fce('0x34')](function(_0x45b6d5){logger[_0x8fce('0x35')](_0x8fce('0x36'));});}}}function stopRouting(_0x2b4c63,_0x505b2f,_0x4735a4,_0x40e3bb){if(_0x2b4c63&&_0x505b2f){_0x505b2f['waiting']-=0x1;var _0x449166={'leaveAt':moment()[_0x8fce('0x12')](_0x8fce('0x37')),'acceptAt':moment()[_0x8fce('0x12')](_0x8fce('0x37')),'reason':_0x8fce('0x38')};logger['info'](util[_0x8fce('0x12')](_0x8fce('0x39'),_0x2b4c63,_0x505b2f[_0x8fce('0x30')]));emitChannelQueueInteraction(_0x4735a4[_0x8fce('0x27')],_0x505b2f[_0x8fce('0x30')],_0x4735a4['body'],_0x4735a4[_0x8fce('0xe')]['name'],_0x4735a4[_0x8fce('0x31')]['id'],![],_0x40e3bb,_0x505b2f['id']);if(rpc[_0x4735a4[_0x8fce('0x27')]+_0x8fce('0x32')]){return rpc[_0x4735a4[_0x8fce('0x27')]+_0x8fce('0x32')][_0x8fce('0x3a')](_0x2b4c63,_0x449166)[_0x8fce('0x34')](function(_0x7730ad){logger[_0x8fce('0x35')](_0x8fce('0x3b'));});}}}function endRouting(_0x39c8eb,_0x288cf9,_0x150854,_0x24d596){if(_0x39c8eb&&_0x288cf9){_0x288cf9[_0x8fce('0x22')]-=0x1;var _0x149e57={'leaveAt':moment()['format'](_0x8fce('0x37')),'exitAt':moment()[_0x8fce('0x12')](_0x8fce('0x37')),'reason':_0x8fce('0x3c')};logger['info'](util[_0x8fce('0x12')](_0x8fce('0x3d'),_0x39c8eb,_0x288cf9[_0x8fce('0x30')]));emitChannelQueueInteraction(_0x150854[_0x8fce('0x27')],_0x288cf9['name'],_0x150854[_0x8fce('0x23')],_0x150854['account'][_0x8fce('0x30')],_0x150854[_0x8fce('0x31')]['id'],![],_0x24d596);if(rpc[_0x150854[_0x8fce('0x27')]+'QueueReport']){return rpc[_0x150854[_0x8fce('0x27')]+_0x8fce('0x32')][_0x8fce('0x3a')](_0x39c8eb,_0x149e57)[_0x8fce('0x34')](function(_0x50a656){logger[_0x8fce('0x35')](_0x8fce('0x3b'));});}}}function handleFindQueue(_0x35acb2){return function(_0x16f15d){return _0x16f15d[_0x8fce('0x30')][_0x8fce('0x3e')]()===_0x35acb2[_0x8fce('0x3e')]();};}exports[_0x8fce('0x3f')]=function(_0x4836ac,_0x214373,_0x51b8fe,_0x297963){return function(_0x3d0be2){try{var _0x216dc6={'name':_0x214373[0x0],'timeout':_0x214373[0x1]};var _0x5811ab=queue['validate'](_0x216dc6,{'typecast':!![]});if(_0x5811ab[_0x8fce('0x40')]){logger[_0x8fce('0x35')](_0x8fce('0x41'),_0x4836ac,_['map'](_0x5811ab,_0x8fce('0x31'))[_0x8fce('0x42')](',\x20'));_0x3d0be2[_0x8fce('0x43')]();}else{var _0x2cdf4a=_[_0x8fce('0x44')](_0x51b8fe[_0x297963[_0x8fce('0x27')]+_0x8fce('0x45')],handleFindQueue(_0x216dc6[_0x8fce('0x30')]));if(_0x2cdf4a){startRouting(_0x4836ac,_0x2cdf4a,_0x297963,_0x51b8fe);var _0x2b20d9=(_0x2cdf4a['timeout']||0xa)*0x3e8;var _0x262982=(_0x216dc6[_0x8fce('0x3c')]||0x14)*0x3e8;var _0x5a13df,_0x5e86ac;if(_0x2b20d9>_0x262982){_0x262982=_0x2b20d9;}var _0x5d4881=seqqueue['createQueue'](_0x2b20d9);_0x5d4881['id']=_0x4836ac;_0x5d4881[_0x8fce('0x46')]=_0x2b20d9;_0x5d4881['qtimeout']=_0x262982;_0x5d4881[_0x8fce('0x27')]=_0x297963[_0x8fce('0x27')];_0x51b8fe[_0x8fce('0x47')][_0x4836ac]['on'](_0x8fce('0x48'),function(){logger[_0x8fce('0x2f')](_0x8fce('0x49'),_0x4836ac);stopRouting(_0x4836ac,_0x2cdf4a,_0x297963,_0x51b8fe);clearTimeout(_0x5a13df);_0x5a13df=undefined;_0x5d4881[_0x8fce('0x4a')](!![]);if(_0x51b8fe[_0x8fce('0x47')][_0x4836ac]){delete _0x51b8fe[_0x8fce('0x47')][_0x4836ac];}_0x3d0be2[_0x8fce('0x43')]();});_0x51b8fe[_0x8fce('0x47')][_0x4836ac]['on'](_0x8fce('0x4b'),function(){if(_0x51b8fe[_0x8fce('0x47')][_0x4836ac]){delete _0x51b8fe['rules'][_0x4836ac];}});_0x5a13df=setTimeout(function(){logger[_0x8fce('0x2f')](_0x8fce('0x4c'),_0x4836ac);endRouting(_0x4836ac,_0x2cdf4a,_0x297963,_0x51b8fe);clearTimeout(_0x5a13df);_0x5d4881['close'](!![]);_0x3d0be2['next']();},_0x262982);switch(_0x2cdf4a[_0x8fce('0x4d')]){case _0x8fce('0x4e'):strategy['rrmemory'](_0x5d4881,_0x2cdf4a,_0x51b8fe,_0x297963);break;default:strategy[_0x8fce('0x4f')](_0x5d4881,_0x2cdf4a,_0x51b8fe,_0x297963);}}else{logger[_0x8fce('0x35')](_0x8fce('0x50'),_0x4836ac,_0x216dc6[_0x8fce('0x30')]);_0x3d0be2[_0x8fce('0x43')]();}}}catch(_0x1291e7){console[_0x8fce('0x51')](_0x1291e7);logger[_0x8fce('0x35')]('[%s][QUEUE]\x20%s',_0x4836ac,_0x1291e7['stack']);_0x3d0be2[_0x8fce('0x43')]();}};};
\ No newline at end of file
index 9c3f82b..e6a8a93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2015=['squeue','handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','push','debug','agent','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busy','busyQueue','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','exports','uuid','./util','../../../../../config/logger','routing','notificationId'];(function(_0x2148db,_0x5d75f5){var _0x3a436e=function(_0x356228){while(--_0x356228){_0x2148db['push'](_0x2148db['shift']());}};_0x3a436e(++_0x5d75f5);}(_0x2015,0xf3));var _0x5201=function(_0x34e3d9,_0x4ee0be){_0x34e3d9=_0x34e3d9-0x0;var _0x450b69=_0x2015[_0x34e3d9];return _0x450b69;};'use strict';var _=require('lodash');var uuid=require(_0x5201('0x0'));var util=require(_0x5201('0x1'));var logger=require(_0x5201('0x2'))(_0x5201('0x3'));var Agent=function(_0x3faeff,_0x36931e,_0x4f7ee3,_0x4bb47b){this[_0x5201('0x4')]=uuid['v4']();this[_0x5201('0x5')]=_0x3faeff;this['agent']=_0x36931e;this['realtime']=_0x4f7ee3;this[_0x5201('0x3')]=_0x4bb47b;this[_0x5201('0x5')]['push'](this[_0x5201('0x6')]['bind'](this),this[_0x5201('0x7')][_0x5201('0x8')](this));this[_0x5201('0x5')]['on'](_0x5201('0x9'),this[_0x5201('0x7')][_0x5201('0x8')](this));this[_0x5201('0x5')]['on'](_0x5201('0xa'),this[_0x5201('0xb')][_0x5201('0x8')](this));};Agent[_0x5201('0xc')][_0x5201('0xd')]=function(){this[_0x5201('0x5')][_0x5201('0xd')](this[_0x5201('0x6')][_0x5201('0x8')](this),this[_0x5201('0x7')][_0x5201('0x8')](this));};Agent[_0x5201('0xc')][_0x5201('0xb')]=function(){this[_0x5201('0x7')](!![]);};Agent[_0x5201('0xc')][_0x5201('0x6')]=function(){logger[_0x5201('0xe')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x5201('0x5')]['id'],this[_0x5201('0xf')]['id']);if(_['isNil'](this[_0x5201('0x10')][_0x5201('0x11')][this[_0x5201('0xf')]['id']])){logger[_0x5201('0xe')](_0x5201('0x12'),this[_0x5201('0x5')]['id'],this[_0x5201('0xf')]['id']);setTimeout(this[_0x5201('0xd')][_0x5201('0x8')](this),0x3e8);}else{if(this[_0x5201('0x3')][_0x5201('0x13')]||util['isAgentAvailable'](this[_0x5201('0x5')]['id'],this[_0x5201('0x10')][_0x5201('0x11')][this[_0x5201('0xf')]['id']],this['squeue'][_0x5201('0x14')],![])){this['realtime']['agents'][this[_0x5201('0xf')]['id']][_0x5201('0x15')]=!![];this[_0x5201('0x10')]['agents'][this['agent']['id']][_0x5201('0x16')]=undefined;util['showNotification'](this[_0x5201('0x4')],this[_0x5201('0x5')]['id'],this['realtime'][_0x5201('0x11')][this[_0x5201('0xf')]['id']],null,this[_0x5201('0x3')]);util[_0x5201('0x17')](this[_0x5201('0x5')]['id'],this[_0x5201('0x10')][_0x5201('0x11')][this['agent']['id']],_0x5201('0x18')+(this[_0x5201('0x3')][_0x5201('0x13')]?_0x5201('0x19'):''));}else{logger[_0x5201('0xe')](_0x5201('0x1a'),this['squeue']['id'],this[_0x5201('0xf')]['id']);setTimeout(this[_0x5201('0xd')][_0x5201('0x8')](this),0x3e8);}}};Agent[_0x5201('0xc')][_0x5201('0x7')]=function(_0x23a251){if(_[_0x5201('0x1b')](this[_0x5201('0x10')][_0x5201('0x11')][this[_0x5201('0xf')]['id']])){return logger['debug'](_0x5201('0x12'),this[_0x5201('0x5')]['id'],this[_0x5201('0xf')]['id']);}else{logger[_0x5201('0xe')](_0x5201('0x1c'),this['squeue']['id'],this[_0x5201('0xf')]['id']);util['hideNotification'](this[_0x5201('0x4')],this[_0x5201('0x5')]['id'],this[_0x5201('0x10')][_0x5201('0x11')][this[_0x5201('0xf')]['id']],null,this[_0x5201('0x3')]);this[_0x5201('0x10')][_0x5201('0x11')][this[_0x5201('0xf')]['id']][_0x5201('0x15')]=![];this[_0x5201('0x10')][_0x5201('0x11')][this[_0x5201('0xf')]['id']][_0x5201('0x16')]=undefined;util[_0x5201('0x17')](this[_0x5201('0x5')]['id'],this[_0x5201('0x10')][_0x5201('0x11')][this[_0x5201('0xf')]['id']],_0x23a251?_0x5201('0x1d'):'TIMEOUT');}if(!_0x23a251){setTimeout(this['push'][_0x5201('0x8')](this),0x3e8);}};function agent(_0x5a5a54,_0x46fbe0,_0x57244c,_0x54614a){return new Agent(_0x5a5a54,_0x46fbe0,_0x57244c,_0x54614a);}module[_0x5201('0x1e')]=agent;
\ No newline at end of file
+var _0x73ea=['STOP','TIMEOUT','exports','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','realtime','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','push','debug','[%s][AGENT]\x20try\x20with\x20%s','agent','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil'];(function(_0x480f34,_0x2f37df){var _0x245d27=function(_0x5e5b9e){while(--_0x5e5b9e){_0x480f34['push'](_0x480f34['shift']());}};_0x245d27(++_0x2f37df);}(_0x73ea,0x135));var _0xa73e=function(_0x23f5c0,_0x85936){_0x23f5c0=_0x23f5c0-0x0;var _0x346feb=_0x73ea[_0x23f5c0];return _0x346feb;};'use strict';var _=require(_0xa73e('0x0'));var uuid=require(_0xa73e('0x1'));var util=require('./util');var logger=require(_0xa73e('0x2'))(_0xa73e('0x3'));var Agent=function(_0x53a529,_0x15b7ba,_0x35f95c,_0x506919){this[_0xa73e('0x4')]=uuid['v4']();this[_0xa73e('0x5')]=_0x53a529;this['agent']=_0x15b7ba;this[_0xa73e('0x6')]=_0x35f95c;this[_0xa73e('0x3')]=_0x506919;this[_0xa73e('0x5')]['push'](this[_0xa73e('0x7')][_0xa73e('0x8')](this),this['handleTimeout']['bind'](this));this[_0xa73e('0x5')]['on'](_0xa73e('0x9'),this[_0xa73e('0xa')][_0xa73e('0x8')](this));this['squeue']['on'](_0xa73e('0xb'),this[_0xa73e('0xc')][_0xa73e('0x8')](this));};Agent[_0xa73e('0xd')][_0xa73e('0xe')]=function(){this[_0xa73e('0x5')][_0xa73e('0xe')](this[_0xa73e('0x7')]['bind'](this),this[_0xa73e('0xa')][_0xa73e('0x8')](this));};Agent[_0xa73e('0xd')][_0xa73e('0xc')]=function(){this[_0xa73e('0xa')](!![]);};Agent[_0xa73e('0xd')]['handleRun']=function(){logger[_0xa73e('0xf')](_0xa73e('0x10'),this['squeue']['id'],this[_0xa73e('0x11')]['id']);if(_['isNil'](this[_0xa73e('0x6')][_0xa73e('0x12')][this[_0xa73e('0x11')]['id']])){logger[_0xa73e('0xf')](_0xa73e('0x13'),this[_0xa73e('0x5')]['id'],this[_0xa73e('0x11')]['id']);setTimeout(this[_0xa73e('0xe')]['bind'](this),0x3e8);}else{if(this[_0xa73e('0x3')][_0xa73e('0x14')]||util[_0xa73e('0x15')](this[_0xa73e('0x5')]['id'],this[_0xa73e('0x6')][_0xa73e('0x12')][this['agent']['id']],this['squeue'][_0xa73e('0x16')],![])){this[_0xa73e('0x6')]['agents'][this[_0xa73e('0x11')]['id']][_0xa73e('0x17')]=!![];this[_0xa73e('0x6')][_0xa73e('0x12')][this['agent']['id']][_0xa73e('0x18')]=undefined;util[_0xa73e('0x19')](this[_0xa73e('0x4')],this[_0xa73e('0x5')]['id'],this[_0xa73e('0x6')][_0xa73e('0x12')][this[_0xa73e('0x11')]['id']],null,this['routing']);util[_0xa73e('0x1a')](this[_0xa73e('0x5')]['id'],this[_0xa73e('0x6')][_0xa73e('0x12')][this[_0xa73e('0x11')]['id']],_0xa73e('0x1b')+(this['routing']['forcedOwnership']?_0xa73e('0x1c'):''));}else{logger[_0xa73e('0xf')](_0xa73e('0x1d'),this[_0xa73e('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xa73e('0xe')]['bind'](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0x584199){if(_[_0xa73e('0x1e')](this[_0xa73e('0x6')]['agents'][this[_0xa73e('0x11')]['id']])){return logger[_0xa73e('0xf')](_0xa73e('0x13'),this[_0xa73e('0x5')]['id'],this[_0xa73e('0x11')]['id']);}else{logger[_0xa73e('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xa73e('0x5')]['id'],this[_0xa73e('0x11')]['id']);util['hideNotification'](this[_0xa73e('0x4')],this['squeue']['id'],this[_0xa73e('0x6')][_0xa73e('0x12')][this[_0xa73e('0x11')]['id']],null,this[_0xa73e('0x3')]);this[_0xa73e('0x6')][_0xa73e('0x12')][this[_0xa73e('0x11')]['id']][_0xa73e('0x17')]=![];this[_0xa73e('0x6')][_0xa73e('0x12')][this[_0xa73e('0x11')]['id']]['busyQueue']=undefined;util['writeLog'](this[_0xa73e('0x5')]['id'],this[_0xa73e('0x6')]['agents'][this[_0xa73e('0x11')]['id']],_0x584199?_0xa73e('0x1f'):_0xa73e('0x20'));}if(!_0x584199){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x131bb0,_0x501959,_0x8bdcca,_0x3521aa){return new Agent(_0x131bb0,_0x501959,_0x8bdcca,_0x3521aa);}module[_0xa73e('0x21')]=agent;
\ No newline at end of file
index b70dcd8..eee5647 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9000=['Agents','length','realtime','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','RINGING','busyQueue','name','showNotification','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','busy','exports','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','queue','push','handleRun','bind','timeout','handleTimeout','drained','prototype','isNil'];(function(_0x32c1db,_0x2b5513){var _0x3f3a1b=function(_0x3f1c4a){while(--_0x3f1c4a){_0x32c1db['push'](_0x32c1db['shift']());}};_0x3f3a1b(++_0x2b5513);}(_0x9000,0x19e));var _0x0900=function(_0x1220dc,_0x448145){_0x1220dc=_0x1220dc-0x0;var _0x264ada=_0x9000[_0x1220dc];return _0x264ada;};'use strict';var _=require(_0x0900('0x0'));var uuid=require(_0x0900('0x1'));var util=require('./util');var logger=require(_0x0900('0x2'))(_0x0900('0x3'));var Beepall=function(_0x12afb6,_0x3f1b03,_0x23ed8e,_0x15d123){this[_0x0900('0x4')]=uuid['v4']();this[_0x0900('0x5')]=_0x12afb6;this[_0x0900('0x6')]=_0x3f1b03;this['realtime']=_0x23ed8e;this[_0x0900('0x3')]=_0x15d123;this['squeue'][_0x0900('0x7')](this[_0x0900('0x8')][_0x0900('0x9')](this),this['handleTimeout']['bind'](this));this[_0x0900('0x5')]['on'](_0x0900('0xa'),this[_0x0900('0xb')][_0x0900('0x9')](this));this[_0x0900('0x5')]['on'](_0x0900('0xc'),this['handleDrained'][_0x0900('0x9')](this));};Beepall[_0x0900('0xd')][_0x0900('0x7')]=function(){this[_0x0900('0x5')][_0x0900('0x7')](this[_0x0900('0x8')][_0x0900('0x9')](this),this[_0x0900('0xb')][_0x0900('0x9')](this));};Beepall[_0x0900('0xd')]['handleDrained']=function(){this[_0x0900('0xb')](!![]);};Beepall[_0x0900('0xd')]['handleRun']=function(){var _0x52bb65=!![];if(!_[_0x0900('0xe')](this['queue'])&&!_[_0x0900('0xe')](this['queue'][_0x0900('0xf')])&&this[_0x0900('0x6')][_0x0900('0xf')][_0x0900('0x10')]>0x0){for(var _0x4bbe8f=0x0,_0x54bff1;_0x4bbe8f<this[_0x0900('0x6')][_0x0900('0xf')][_0x0900('0x10')];_0x4bbe8f+=0x1){_0x54bff1=this[_0x0900('0x6')]['Agents'][_0x4bbe8f]['id'];if(_[_0x0900('0xe')](this[_0x0900('0x11')][_0x0900('0x12')][_0x54bff1])){logger[_0x0900('0x13')](_0x0900('0x14'),this[_0x0900('0x5')]['id'],_0x54bff1);}else{if(util[_0x0900('0x15')](this[_0x0900('0x5')]['id'],this['realtime']['agents'][_0x54bff1],this[_0x0900('0x5')]['channel'],!![])){_0x52bb65=![];util[_0x0900('0x16')](this['squeue']['id'],this[_0x0900('0x11')][_0x0900('0x12')][_0x54bff1],_0x0900('0x17'));this['realtime'][_0x0900('0x12')][_0x54bff1]['busy']=!![];this[_0x0900('0x11')][_0x0900('0x12')][_0x54bff1][_0x0900('0x18')]=this[_0x0900('0x6')][_0x0900('0x19')];util[_0x0900('0x1a')](this[_0x0900('0x4')],this['squeue']['id'],this[_0x0900('0x11')][_0x0900('0x12')][_0x54bff1],this[_0x0900('0x6')],this['routing']);}}}if(_0x52bb65){logger[_0x0900('0x13')]('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this['squeue']['id']);setTimeout(this[_0x0900('0x7')][_0x0900('0x9')](this),0x3e8);}}else{logger['debug'](_0x0900('0x1b'),this['squeue']['id']);setTimeout(this[_0x0900('0x7')][_0x0900('0x9')](this),0x3e8);}};Beepall[_0x0900('0xd')][_0x0900('0xb')]=function(_0x3fbd95){if(!_[_0x0900('0xe')](this['queue'])&&!_[_0x0900('0xe')](this['queue'][_0x0900('0xf')])){for(var _0x2d3ec4=0x0,_0x1a13d6;_0x2d3ec4<this['queue'][_0x0900('0xf')][_0x0900('0x10')];_0x2d3ec4+=0x1){_0x1a13d6=this[_0x0900('0x6')][_0x0900('0xf')][_0x2d3ec4]['id'];if(_['isNil'](this[_0x0900('0x11')]['agents'][_0x1a13d6])){logger[_0x0900('0x13')](_0x0900('0x14'),this[_0x0900('0x5')]['id'],_0x1a13d6);}else{util[_0x0900('0x1c')](this[_0x0900('0x4')],this[_0x0900('0x5')]['id'],this['realtime'][_0x0900('0x12')][_0x1a13d6],this[_0x0900('0x6')],this[_0x0900('0x3')]);util['writeLog'](this[_0x0900('0x5')]['id'],this[_0x0900('0x11')][_0x0900('0x12')][_0x1a13d6],_0x3fbd95?_0x0900('0x1d'):_0x0900('0x1e'));this[_0x0900('0x11')][_0x0900('0x12')][_0x1a13d6][_0x0900('0x1f')]=![];this['realtime']['agents'][_0x1a13d6]['busyQueue']=undefined;}}}if(!_0x3fbd95){setTimeout(this[_0x0900('0x7')][_0x0900('0x9')](this),0x3e8);}};function beepall(_0x2ffc42,_0x50532f,_0x53bbaf,_0xb1b0ef){return new Beepall(_0x2ffc42,_0x50532f,_0x53bbaf,_0xb1b0ef);}module[_0x0900('0x20')]=beepall;
\ No newline at end of file
+var _0xd5b6=['debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','isNil','length','Agents','realtime','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','showNotification'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xd5b6,0x73));var _0x6d5b=function(_0x354fd6,_0x1d629b){_0x354fd6=_0x354fd6-0x0;var _0x45e7eb=_0xd5b6[_0x354fd6];return _0x45e7eb;};'use strict';var _=require(_0x6d5b('0x0'));var uuid=require(_0x6d5b('0x1'));var util=require(_0x6d5b('0x2'));var logger=require(_0x6d5b('0x3'))(_0x6d5b('0x4'));var Beepall=function(_0x3d9bc9,_0x162442,_0x3fb583,_0x558202){this[_0x6d5b('0x5')]=uuid['v4']();this[_0x6d5b('0x6')]=_0x3d9bc9;this[_0x6d5b('0x7')]=_0x162442;this['realtime']=_0x3fb583;this[_0x6d5b('0x4')]=_0x558202;this[_0x6d5b('0x6')][_0x6d5b('0x8')](this[_0x6d5b('0x9')]['bind'](this),this['handleTimeout'][_0x6d5b('0xa')](this));this[_0x6d5b('0x6')]['on'](_0x6d5b('0xb'),this[_0x6d5b('0xc')][_0x6d5b('0xa')](this));this[_0x6d5b('0x6')]['on'](_0x6d5b('0xd'),this[_0x6d5b('0xe')][_0x6d5b('0xa')](this));};Beepall[_0x6d5b('0xf')][_0x6d5b('0x8')]=function(){this[_0x6d5b('0x6')][_0x6d5b('0x8')](this[_0x6d5b('0x9')][_0x6d5b('0xa')](this),this[_0x6d5b('0xc')][_0x6d5b('0xa')](this));};Beepall[_0x6d5b('0xf')]['handleDrained']=function(){this[_0x6d5b('0xc')](!![]);};Beepall[_0x6d5b('0xf')][_0x6d5b('0x9')]=function(){var _0x3a4ca5=!![];if(!_[_0x6d5b('0x10')](this['queue'])&&!_[_0x6d5b('0x10')](this[_0x6d5b('0x7')]['Agents'])&&this[_0x6d5b('0x7')]['Agents'][_0x6d5b('0x11')]>0x0){for(var _0x4dfd99=0x0,_0x52350c;_0x4dfd99<this['queue'][_0x6d5b('0x12')][_0x6d5b('0x11')];_0x4dfd99+=0x1){_0x52350c=this[_0x6d5b('0x7')]['Agents'][_0x4dfd99]['id'];if(_[_0x6d5b('0x10')](this[_0x6d5b('0x13')][_0x6d5b('0x14')][_0x52350c])){logger['debug'](_0x6d5b('0x15'),this['squeue']['id'],_0x52350c);}else{if(util[_0x6d5b('0x16')](this[_0x6d5b('0x6')]['id'],this[_0x6d5b('0x13')]['agents'][_0x52350c],this[_0x6d5b('0x6')][_0x6d5b('0x17')],!![])){_0x3a4ca5=![];util[_0x6d5b('0x18')](this[_0x6d5b('0x6')]['id'],this[_0x6d5b('0x13')][_0x6d5b('0x14')][_0x52350c],_0x6d5b('0x19'));this[_0x6d5b('0x13')][_0x6d5b('0x14')][_0x52350c][_0x6d5b('0x1a')]=!![];this[_0x6d5b('0x13')][_0x6d5b('0x14')][_0x52350c][_0x6d5b('0x1b')]=this[_0x6d5b('0x7')]['name'];util[_0x6d5b('0x1c')](this['notificationId'],this[_0x6d5b('0x6')]['id'],this[_0x6d5b('0x13')][_0x6d5b('0x14')][_0x52350c],this[_0x6d5b('0x7')],this[_0x6d5b('0x4')]);}}}if(_0x3a4ca5){logger[_0x6d5b('0x1d')](_0x6d5b('0x1e'),this[_0x6d5b('0x6')]['id']);setTimeout(this[_0x6d5b('0x8')][_0x6d5b('0xa')](this),0x3e8);}}else{logger[_0x6d5b('0x1d')](_0x6d5b('0x1f'),this[_0x6d5b('0x6')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}};Beepall['prototype'][_0x6d5b('0xc')]=function(_0x1acc3a){if(!_[_0x6d5b('0x10')](this['queue'])&&!_[_0x6d5b('0x10')](this[_0x6d5b('0x7')]['Agents'])){for(var _0x47ebfe=0x0,_0x4fce9f;_0x47ebfe<this[_0x6d5b('0x7')][_0x6d5b('0x12')][_0x6d5b('0x11')];_0x47ebfe+=0x1){_0x4fce9f=this[_0x6d5b('0x7')]['Agents'][_0x47ebfe]['id'];if(_['isNil'](this[_0x6d5b('0x13')]['agents'][_0x4fce9f])){logger[_0x6d5b('0x1d')](_0x6d5b('0x15'),this[_0x6d5b('0x6')]['id'],_0x4fce9f);}else{util[_0x6d5b('0x20')](this[_0x6d5b('0x5')],this[_0x6d5b('0x6')]['id'],this[_0x6d5b('0x13')][_0x6d5b('0x14')][_0x4fce9f],this['queue'],this[_0x6d5b('0x4')]);util[_0x6d5b('0x18')](this[_0x6d5b('0x6')]['id'],this[_0x6d5b('0x13')][_0x6d5b('0x14')][_0x4fce9f],_0x1acc3a?_0x6d5b('0x21'):_0x6d5b('0x22'));this[_0x6d5b('0x13')]['agents'][_0x4fce9f][_0x6d5b('0x1a')]=![];this[_0x6d5b('0x13')][_0x6d5b('0x14')][_0x4fce9f][_0x6d5b('0x1b')]=undefined;}}}if(!_0x1acc3a){setTimeout(this[_0x6d5b('0x8')][_0x6d5b('0xa')](this),0x3e8);}};function beepall(_0x5b1842,_0x5051b3,_0x40d95e,_0x39c419){return new Beepall(_0x5b1842,_0x5051b3,_0x40d95e,_0x39c419);}module[_0x6d5b('0x23')]=beepall;
\ No newline at end of file
index f87ed30..049da0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76aa=['./rrmemory','./agent'];(function(_0x3df2e5,_0x5c76d6){var _0x5ebb6b=function(_0x39c836){while(--_0x39c836){_0x3df2e5['push'](_0x3df2e5['shift']());}};_0x5ebb6b(++_0x5c76d6);}(_0x76aa,0xf2));var _0xa76a=function(_0xceb95e,_0x34be54){_0xceb95e=_0xceb95e-0x0;var _0xac7ced=_0x76aa[_0xceb95e];return _0xac7ced;};'use strict';module['exports']={'rrmemory':require(_0xa76a('0x0')),'beepall':require('./beepall'),'agent':require(_0xa76a('0x1'))};
\ No newline at end of file
+var _0xcf23=['exports','./rrmemory','./beepall','./agent'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xcf23,0x74));var _0x3cf2=function(_0x725dd3,_0x4d7cf3){_0x725dd3=_0x725dd3-0x0;var _0x112421=_0xcf23[_0x725dd3];return _0x112421;};'use strict';module[_0x3cf2('0x0')]={'rrmemory':require(_0x3cf2('0x1')),'beepall':require(_0x3cf2('0x2')),'agent':require(_0x3cf2('0x3'))};
\ No newline at end of file
index 8a192de..c3e613a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab00=['routing','squeue','queue','realtime','intervals','handleRun','bind','timeout','handleDrained','prototype','push','handleTimeout','handleCheckReject','isAgentAvailable','agentId','channel','[%s][QUEUE]\x20available\x20again\x20%s','done','mapAgentsId','debug','[%s][QUEUE]\x20try\x20with\x20%s','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','busyQueue','name','showNotification','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','notificationId','TIMEOUT','exports','lodash','uuid','./util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xab00,0x1b9));var _0x0ab0=function(_0x11037d,_0x145dc7){_0x11037d=_0x11037d-0x0;var _0x375122=_0xab00[_0x11037d];return _0x375122;};'use strict';var rr=require('rr');var _=require(_0x0ab0('0x0'));var uuid=require(_0x0ab0('0x1'));var util=require(_0x0ab0('0x2'));var logger=require('../../../../../config/logger')(_0x0ab0('0x3'));var RRMemory=function(_0xeef6f,_0x5a0631,_0x4d440a,_0x2e4731){this['notificationId']=uuid['v4']();this[_0x0ab0('0x4')]=_0xeef6f;this[_0x0ab0('0x5')]=_0x5a0631;this[_0x0ab0('0x6')]=_0x4d440a;this[_0x0ab0('0x3')]=_0x2e4731;this[_0x0ab0('0x7')]={};this[_0x0ab0('0x4')]['push'](this[_0x0ab0('0x8')][_0x0ab0('0x9')](this),this['handleTimeout'][_0x0ab0('0x9')](this),this['module']);this[_0x0ab0('0x4')]['on'](_0x0ab0('0xa'),this['handleTimeout']['bind'](this));this['squeue']['on']('drained',this[_0x0ab0('0xb')]['bind'](this));};RRMemory[_0x0ab0('0xc')][_0x0ab0('0xd')]=function(){this['squeue'][_0x0ab0('0xd')](this[_0x0ab0('0x8')][_0x0ab0('0x9')](this),this[_0x0ab0('0xe')][_0x0ab0('0x9')](this));};RRMemory[_0x0ab0('0xc')][_0x0ab0('0xb')]=function(){this[_0x0ab0('0xe')](!![]);};RRMemory[_0x0ab0('0xc')][_0x0ab0('0xf')]=function(_0x28f26d){if(util[_0x0ab0('0x10')](this['squeue']['id'],this['realtime']['agents'][this[_0x0ab0('0x11')]],this[_0x0ab0('0x4')][_0x0ab0('0x12')],!![])){logger['debug'](_0x0ab0('0x13'),this['squeue']['id'],this['agentId']);clearInterval(this['intervals'][this[_0x0ab0('0x11')]]);_0x28f26d[_0x0ab0('0x14')]();setTimeout(this[_0x0ab0('0xd')][_0x0ab0('0x9')](this),0x3e8);}};RRMemory[_0x0ab0('0xc')][_0x0ab0('0x8')]=function(_0x8b50a2){this['agentId']=rr(this['queue'][_0x0ab0('0x15')]);logger[_0x0ab0('0x16')](_0x0ab0('0x17'),this['squeue']['id'],this[_0x0ab0('0x11')]);if(_['isNil'](this[_0x0ab0('0x6')][_0x0ab0('0x18')][this[_0x0ab0('0x11')]])){logger[_0x0ab0('0x16')](_0x0ab0('0x19'),this[_0x0ab0('0x4')]['id'],this[_0x0ab0('0x11')]);_0x8b50a2['done']();setTimeout(this[_0x0ab0('0xd')][_0x0ab0('0x9')](this),0x3e8);}else{if(util[_0x0ab0('0x10')](this['squeue']['id'],this[_0x0ab0('0x6')][_0x0ab0('0x18')][this[_0x0ab0('0x11')]],this['squeue'][_0x0ab0('0x12')],!![])){this[_0x0ab0('0x6')][_0x0ab0('0x18')][this[_0x0ab0('0x11')]][_0x0ab0('0x1a')]=!![];this['realtime'][_0x0ab0('0x18')][this['agentId']][_0x0ab0('0x1b')]=this[_0x0ab0('0x5')][_0x0ab0('0x1c')];util[_0x0ab0('0x1d')](this['notificationId'],this[_0x0ab0('0x4')]['id'],this['realtime'][_0x0ab0('0x18')][this[_0x0ab0('0x11')]],this[_0x0ab0('0x5')],this[_0x0ab0('0x3')]);util[_0x0ab0('0x1e')](this[_0x0ab0('0x4')]['id'],this[_0x0ab0('0x6')][_0x0ab0('0x18')][this[_0x0ab0('0x11')]],_0x0ab0('0x1f'));this[_0x0ab0('0x7')][this[_0x0ab0('0x11')]]=setInterval(this['handleCheckReject'][_0x0ab0('0x9')](this,_0x8b50a2),0x3e8);}else{logger[_0x0ab0('0x16')](_0x0ab0('0x20'),this[_0x0ab0('0x4')]['id'],this[_0x0ab0('0x11')]);_0x8b50a2[_0x0ab0('0x14')]();setTimeout(this['push']['bind'](this),0x3e8);}}};RRMemory[_0x0ab0('0xc')][_0x0ab0('0xe')]=function(_0x2efb55){logger[_0x0ab0('0x16')](_0x0ab0('0x21'),this[_0x0ab0('0x4')]['id'],this[_0x0ab0('0x11')]);if(_['isNil'](this[_0x0ab0('0x6')][_0x0ab0('0x18')][this[_0x0ab0('0x11')]])){logger[_0x0ab0('0x16')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x0ab0('0x4')]['id'],this['agentId']);}else{clearInterval(this[_0x0ab0('0x7')][this['agentId']]);util['hideNotification'](this[_0x0ab0('0x22')],this['squeue']['id'],this[_0x0ab0('0x6')][_0x0ab0('0x18')][this[_0x0ab0('0x11')]],this[_0x0ab0('0x5')],this[_0x0ab0('0x3')]);util[_0x0ab0('0x1e')](this[_0x0ab0('0x4')]['id'],this['realtime']['agents'][this['agentId']],_0x0ab0('0x23'));this[_0x0ab0('0x6')][_0x0ab0('0x18')][this['agentId']]['busy']=![];this[_0x0ab0('0x6')][_0x0ab0('0x18')][this[_0x0ab0('0x11')]][_0x0ab0('0x1b')]=undefined;}if(!_0x2efb55){setTimeout(this[_0x0ab0('0xd')][_0x0ab0('0x9')](this),0x3e8);}};function rrmemory(_0x5a8791,_0x30383f,_0x5bec84,_0x542c44){return new RRMemory(_0x5a8791,_0x30383f,_0x5bec84,_0x542c44);}module[_0x0ab0('0x24')]=rrmemory;
\ No newline at end of file
+var _0xbd9e=['agentId','channel','debug','[%s][QUEUE]\x20available\x20again\x20%s','done','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','busyQueue','queue','name','showNotification','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','exports','./util','routing','squeue','realtime','intervals','push','handleRun','handleTimeout','bind','module','timeout','drained','prototype','handleCheckReject','isAgentAvailable','agents'];(function(_0x8e8ca7,_0x5a5e07){var _0x561381=function(_0x2f4bda){while(--_0x2f4bda){_0x8e8ca7['push'](_0x8e8ca7['shift']());}};_0x561381(++_0x5a5e07);}(_0xbd9e,0x108));var _0xebd9=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xbd9e[_0x618414];return _0x21c19a;};'use strict';var rr=require('rr');var _=require('lodash');var uuid=require('uuid');var util=require(_0xebd9('0x0'));var logger=require('../../../../../config/logger')(_0xebd9('0x1'));var RRMemory=function(_0x44a01e,_0x27b3de,_0xe84f9e,_0x2f5d3e){this['notificationId']=uuid['v4']();this[_0xebd9('0x2')]=_0x44a01e;this['queue']=_0x27b3de;this[_0xebd9('0x3')]=_0xe84f9e;this[_0xebd9('0x1')]=_0x2f5d3e;this[_0xebd9('0x4')]={};this[_0xebd9('0x2')][_0xebd9('0x5')](this[_0xebd9('0x6')]['bind'](this),this[_0xebd9('0x7')][_0xebd9('0x8')](this),this[_0xebd9('0x9')]);this[_0xebd9('0x2')]['on'](_0xebd9('0xa'),this['handleTimeout'][_0xebd9('0x8')](this));this['squeue']['on'](_0xebd9('0xb'),this['handleDrained'][_0xebd9('0x8')](this));};RRMemory[_0xebd9('0xc')]['push']=function(){this[_0xebd9('0x2')][_0xebd9('0x5')](this['handleRun'][_0xebd9('0x8')](this),this[_0xebd9('0x7')][_0xebd9('0x8')](this));};RRMemory[_0xebd9('0xc')]['handleDrained']=function(){this[_0xebd9('0x7')](!![]);};RRMemory[_0xebd9('0xc')][_0xebd9('0xd')]=function(_0x1b57e3){if(util[_0xebd9('0xe')](this[_0xebd9('0x2')]['id'],this[_0xebd9('0x3')][_0xebd9('0xf')][this[_0xebd9('0x10')]],this[_0xebd9('0x2')][_0xebd9('0x11')],!![])){logger[_0xebd9('0x12')](_0xebd9('0x13'),this[_0xebd9('0x2')]['id'],this['agentId']);clearInterval(this[_0xebd9('0x4')][this[_0xebd9('0x10')]]);_0x1b57e3[_0xebd9('0x14')]();setTimeout(this['push'][_0xebd9('0x8')](this),0x3e8);}};RRMemory['prototype'][_0xebd9('0x6')]=function(_0x474ed8){this['agentId']=rr(this['queue']['mapAgentsId']);logger[_0xebd9('0x12')](_0xebd9('0x15'),this[_0xebd9('0x2')]['id'],this['agentId']);if(_[_0xebd9('0x16')](this[_0xebd9('0x3')][_0xebd9('0xf')][this[_0xebd9('0x10')]])){logger[_0xebd9('0x12')](_0xebd9('0x17'),this['squeue']['id'],this[_0xebd9('0x10')]);_0x474ed8[_0xebd9('0x14')]();setTimeout(this['push']['bind'](this),0x3e8);}else{if(util[_0xebd9('0xe')](this[_0xebd9('0x2')]['id'],this[_0xebd9('0x3')][_0xebd9('0xf')][this['agentId']],this[_0xebd9('0x2')][_0xebd9('0x11')],!![])){this[_0xebd9('0x3')][_0xebd9('0xf')][this['agentId']][_0xebd9('0x18')]=!![];this['realtime']['agents'][this[_0xebd9('0x10')]][_0xebd9('0x19')]=this[_0xebd9('0x1a')][_0xebd9('0x1b')];util[_0xebd9('0x1c')](this['notificationId'],this['squeue']['id'],this['realtime'][_0xebd9('0xf')][this[_0xebd9('0x10')]],this[_0xebd9('0x1a')],this[_0xebd9('0x1')]);util[_0xebd9('0x1d')](this[_0xebd9('0x2')]['id'],this[_0xebd9('0x3')][_0xebd9('0xf')][this[_0xebd9('0x10')]],_0xebd9('0x1e'));this[_0xebd9('0x4')][this[_0xebd9('0x10')]]=setInterval(this['handleCheckReject'][_0xebd9('0x8')](this,_0x474ed8),0x3e8);}else{logger['debug'](_0xebd9('0x1f'),this[_0xebd9('0x2')]['id'],this['agentId']);_0x474ed8['done']();setTimeout(this[_0xebd9('0x5')][_0xebd9('0x8')](this),0x3e8);}}};RRMemory[_0xebd9('0xc')][_0xebd9('0x7')]=function(_0x179cd3){logger[_0xebd9('0x12')](_0xebd9('0x20'),this[_0xebd9('0x2')]['id'],this['agentId']);if(_[_0xebd9('0x16')](this[_0xebd9('0x3')][_0xebd9('0xf')][this[_0xebd9('0x10')]])){logger[_0xebd9('0x12')](_0xebd9('0x17'),this[_0xebd9('0x2')]['id'],this[_0xebd9('0x10')]);}else{clearInterval(this[_0xebd9('0x4')][this['agentId']]);util[_0xebd9('0x21')](this['notificationId'],this[_0xebd9('0x2')]['id'],this[_0xebd9('0x3')][_0xebd9('0xf')][this[_0xebd9('0x10')]],this['queue'],this[_0xebd9('0x1')]);util[_0xebd9('0x1d')](this['squeue']['id'],this[_0xebd9('0x3')][_0xebd9('0xf')][this[_0xebd9('0x10')]],'TIMEOUT');this[_0xebd9('0x3')]['agents'][this[_0xebd9('0x10')]][_0xebd9('0x18')]=![];this['realtime'][_0xebd9('0xf')][this[_0xebd9('0x10')]][_0xebd9('0x19')]=undefined;}if(!_0x179cd3){setTimeout(this['push'][_0xebd9('0x8')](this),0x3e8);}};function rrmemory(_0x55de0f,_0xcbbf54,_0x43eefb,_0x2c4f60){return new RRMemory(_0x55de0f,_0xcbbf54,_0x43eefb,_0x2c4f60);}module[_0xebd9('0x22')]=rrmemory;
\ No newline at end of file
index ee7ee89..125cd7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa7=['hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','redis','defaults','format','user:%s','emit','user:save','split','\x20interaction','name','account','notificationSound','notificationShake','body','queue','msg','notificationTemplate','error','[%s][QUEUE]\x20%s','message','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','BUSY','online','OFFLINE','Pause','PAUSE'];(function(_0x2c3f08,_0x380f2b){var _0x4ea2ab=function(_0x4b198a){while(--_0x4b198a){_0x2c3f08['push'](_0x2c3f08['shift']());}};_0x4ea2ab(++_0x380f2b);}(_0x6aa7,0x178));var _0x76aa=function(_0x59206f,_0x1c921a){_0x59206f=_0x59206f-0x0;var _0x933e19=_0x6aa7[_0x59206f];return _0x933e19;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var utils=require(_0x76aa('0x1'));var Redis=require(_0x76aa('0x2'));var config=require(_0x76aa('0x3'));var logger=require(_0x76aa('0x4'))('routing');config[_0x76aa('0x5')]=_[_0x76aa('0x6')](config[_0x76aa('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x76aa('0x5')]));function sendNotification(_0x4d53f6,_0x32dee5,_0x36d12b,_0xa9b695,_0x56d6bc,_0x3dae33){io['to'](util[_0x76aa('0x7')](_0x76aa('0x8'),_0xa9b695['name']))[_0x76aa('0x9')](_0x76aa('0xa'),_0xa9b695);var _0x41643a=_0x3dae33||{};var _0x16cb50=_0x36d12b[_0x76aa('0xb')]('.');var _0x128435={'uniqueid':_0x32dee5,'channel':_0x16cb50[0x0],'id':_0x16cb50[0x1],'title':_0x16cb50[0x0]+_0x76aa('0xc'),'interactionId':_0x16cb50[0x2],'queue':_0x56d6bc?_0x56d6bc[_0x76aa('0xd')]:null,'sound':_0x41643a[_0x76aa('0xe')][_0x76aa('0xf')],'shake':_0x41643a['account'][_0x76aa('0x10')]};try{if(!_0x41643a['body']){_0x41643a[_0x76aa('0x11')]={};}if(_0x56d6bc){_0x41643a[_0x76aa('0x11')][_0x76aa('0x12')]=_0x56d6bc;}else if(_0x41643a[_0x76aa('0x11')][_0x76aa('0x12')]){delete _0x41643a['body']['queue'];}_0x128435[_0x76aa('0x13')]=utils['getMustacheRender'](_0x41643a[_0x76aa('0xe')][_0x76aa('0x14')],_0x41643a);}catch(_0x5cf594){_0x128435[_0x76aa('0x13')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x76aa('0x15')](util['format'](_0x76aa('0x16'),_0x32dee5,_0x5cf594[_0x76aa('0x17')]));}io['to'](util[_0x76aa('0x7')](_0x76aa('0x8'),_0xa9b695[_0x76aa('0xd')]))[_0x76aa('0x9')](util['format']('notification:%s',_0x4d53f6?_0x76aa('0x18'):_0x76aa('0x19')),_0x128435);}function writeLog(_0xf0711,_0x15b931,_0x15109b){return logger[_0x76aa('0x1a')](util[_0x76aa('0x7')](_0x76aa('0x1b'),_0xf0711,_0x15b931[_0x76aa('0xd')],_0x15109b));}exports['isAgentAvailable']=function(_0x39ac5a,_0x21064c,_0x338a6b,_0x5b3f55){if(_0x21064c[_0x76aa('0x1c')]){writeLog(_0x39ac5a,_0x21064c,_0x76aa('0x1d'));return![];}if(!_0x21064c[_0x76aa('0x1e')]){writeLog(_0x39ac5a,_0x21064c,_0x76aa('0x1f'));return![];}if(_0x21064c[_0x338a6b+_0x76aa('0x20')]){writeLog(_0x39ac5a,_0x21064c,_0x76aa('0x21'));return![];}if(_0x5b3f55&&_0x21064c[_0x76aa('0x22')](_0x338a6b+_0x76aa('0x23'))&&_0x21064c[_0x76aa('0x22')](_0x338a6b+_0x76aa('0x24'))){if(_0x21064c[_0x338a6b+_0x76aa('0x23')]>0x0&&_0x21064c[_0x338a6b+_0x76aa('0x24')]>=_0x21064c[_0x338a6b+_0x76aa('0x23')]){writeLog(_0x39ac5a,_0x21064c,_0x338a6b['toUpperCase']()+_0x76aa('0x25'));return![];}}return!![];};exports[_0x76aa('0x26')]=function(_0x25c614,_0x2e7ab4,_0xa1e6,_0x2f9316,_0x25a803){return sendNotification(!![],_0x25c614,_0x2e7ab4,_0xa1e6,_0x2f9316,_0x25a803);};exports[_0x76aa('0x27')]=function(_0xd12a99,_0x1bdc3d,_0x545b06,_0x3fcb7f,_0x5a8030){return sendNotification(![],_0xd12a99,_0x1bdc3d,_0x545b06,_0x3fcb7f,_0x5a8030);};exports[_0x76aa('0x28')]=writeLog;
\ No newline at end of file
+var _0x7da7=['routing','defaults','redis','socket.io-emitter','format','user:%s','emit','user:save','split','\x20interaction','name','notificationSound','account','notificationShake','body','queue','msg','I\x20can\x27t\x20render\x20your\x20template','error','notification:%s','save','remove','debug','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','lodash','util','../utils','../../../../../config/logger'];(function(_0x3f1cf8,_0x152b8d){var _0x1b8cee=function(_0x2ed931){while(--_0x2ed931){_0x3f1cf8['push'](_0x3f1cf8['shift']());}};_0x1b8cee(++_0x152b8d);}(_0x7da7,0x10d));var _0x77da=function(_0x9d14e3,_0x5a6072){_0x9d14e3=_0x9d14e3-0x0;var _0x19bf32=_0x7da7[_0x9d14e3];return _0x19bf32;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var utils=require(_0x77da('0x2'));var Redis=require('ioredis');var config=require('../../../../../config/environment');var logger=require(_0x77da('0x3'))(_0x77da('0x4'));config['redis']=_[_0x77da('0x5')](config[_0x77da('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x77da('0x7'))(new Redis(config[_0x77da('0x6')]));function sendNotification(_0x47da81,_0x30afe0,_0x47cf1d,_0x1191de,_0x13992e,_0x37c5ab){io['to'](util[_0x77da('0x8')](_0x77da('0x9'),_0x1191de['name']))[_0x77da('0xa')](_0x77da('0xb'),_0x1191de);var _0x172d7f=_0x37c5ab||{};var _0x5ea12f=_0x47cf1d[_0x77da('0xc')]('.');var _0x1ab717={'uniqueid':_0x30afe0,'channel':_0x5ea12f[0x0],'id':_0x5ea12f[0x1],'title':_0x5ea12f[0x0]+_0x77da('0xd'),'interactionId':_0x5ea12f[0x2],'queue':_0x13992e?_0x13992e[_0x77da('0xe')]:null,'sound':_0x172d7f['account'][_0x77da('0xf')],'shake':_0x172d7f[_0x77da('0x10')][_0x77da('0x11')]};try{if(!_0x172d7f['body']){_0x172d7f['body']={};}if(_0x13992e){_0x172d7f[_0x77da('0x12')][_0x77da('0x13')]=_0x13992e;}else if(_0x172d7f['body'][_0x77da('0x13')]){delete _0x172d7f[_0x77da('0x12')][_0x77da('0x13')];}_0x1ab717[_0x77da('0x14')]=utils['getMustacheRender'](_0x172d7f[_0x77da('0x10')]['notificationTemplate'],_0x172d7f);}catch(_0x29cd7b){_0x1ab717[_0x77da('0x14')]=_0x77da('0x15');logger[_0x77da('0x16')](util['format']('[%s][QUEUE]\x20%s',_0x30afe0,_0x29cd7b['message']));}io['to'](util['format'](_0x77da('0x9'),_0x1191de[_0x77da('0xe')]))[_0x77da('0xa')](util[_0x77da('0x8')](_0x77da('0x17'),_0x47da81?_0x77da('0x18'):_0x77da('0x19')),_0x1ab717);}function writeLog(_0x3b6dde,_0x544104,_0x492063){return logger[_0x77da('0x1a')](util[_0x77da('0x8')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x3b6dde,_0x544104[_0x77da('0xe')],_0x492063));}exports[_0x77da('0x1b')]=function(_0x24aa8a,_0x5ab79a,_0x58270c,_0x3e6cfe){if(_0x5ab79a['busy']){writeLog(_0x24aa8a,_0x5ab79a,_0x77da('0x1c'));return![];}if(!_0x5ab79a[_0x77da('0x1d')]){writeLog(_0x24aa8a,_0x5ab79a,_0x77da('0x1e'));return![];}if(_0x5ab79a[_0x58270c+_0x77da('0x1f')]){writeLog(_0x24aa8a,_0x5ab79a,_0x77da('0x20'));return![];}if(_0x3e6cfe&&_0x5ab79a[_0x77da('0x21')](_0x58270c+_0x77da('0x22'))&&_0x5ab79a['hasOwnProperty'](_0x58270c+'CurrentCapacity')){if(_0x5ab79a[_0x58270c+_0x77da('0x22')]>0x0&&_0x5ab79a[_0x58270c+_0x77da('0x23')]>=_0x5ab79a[_0x58270c+_0x77da('0x22')]){writeLog(_0x24aa8a,_0x5ab79a,_0x58270c[_0x77da('0x24')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x77da('0x25')]=function(_0x167240,_0x470c9f,_0x36115b,_0x446ae7,_0x5997b6){return sendNotification(!![],_0x167240,_0x470c9f,_0x36115b,_0x446ae7,_0x5997b6);};exports[_0x77da('0x26')]=function(_0x3e090d,_0x1f2279,_0x2913f7,_0x496ecd,_0x5b4638){return sendNotification(![],_0x3e090d,_0x1f2279,_0x2913f7,_0x496ecd,_0x5b4638);};exports['writeLog']=writeLog;
\ No newline at end of file
index e864835..497292d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ac6=['routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger'];(function(_0x5e720a,_0x4b762b){var _0x32f766=function(_0x1871d0){while(--_0x1871d0){_0x5e720a['push'](_0x5e720a['shift']());}};_0x32f766(++_0x4b762b);}(_0x3ac6,0xeb));var _0x63ac=function(_0x163e15,_0xb61086){_0x163e15=_0x163e15-0x0;var _0x1d5b16=_0x3ac6[_0x163e15];return _0x1d5b16;};'use strict';var schema=require(_0x63ac('0x0'));var sh=require(_0x63ac('0x1'));var _=require(_0x63ac('0x2'));var utils=require(_0x63ac('0x3'));var logger=require(_0x63ac('0x4'))(_0x63ac('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0x63ac('0x6')}});exports[_0x63ac('0x7')]=function(_0x23006a,_0x45f194){return function(_0x4ef7cc){try{var _0x196003={'command':_0x45f194[0x0]};var _0x5e791b=system[_0x63ac('0x0')](_0x196003,{'typecast':!![]});if(_0x5e791b['length']){logger[_0x63ac('0x8')](_0x63ac('0x9'),_0x23006a,_[_0x63ac('0xa')](_0x5e791b,'message')[_0x63ac('0xb')](',\x20'));logger[_0x63ac('0xc')](_0x63ac('0xd'),_0x23006a);_0x4ef7cc[_0x63ac('0xe')]();}else{var _0x55037b=this;var _0x4f01bf=utils[_0x63ac('0xf')](_0x45f194[0x0],this);logger[_0x63ac('0xc')](_0x63ac('0x10'),_0x23006a,_0x4f01bf);sh['exec'](_[_0x63ac('0x11')](_0x4f01bf),function(_0x598caf,_0x3588c8){logger[_0x63ac('0xc')](_0x63ac('0x12'),_0x23006a,_0x598caf);if(_0x598caf==0x0){var _0x17bc74=_0x3588c8[_0x63ac('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x45f194[0x1])||_['isEmpty'](_0x45f194[0x1])){logger[_0x63ac('0xc')]('[%s][SYSTEM]\x20no\x20variable',_0x23006a);_0x55037b[_0x63ac('0x14')][_0x45f194[0x1]]=_0x17bc74;}else{logger[_0x63ac('0xc')](_0x63ac('0x15'),_0x23006a,_0x45f194[0x1],_0x17bc74);_0x55037b[_0x63ac('0x14')][_0x45f194[0x1]]=_0x17bc74;}}_0x4ef7cc[_0x63ac('0xe')]();});}}catch(_0x27f098){logger[_0x63ac('0x8')](_0x63ac('0x9'),_0x23006a,_[_0x63ac('0x16')](_0x27f098)?JSON[_0x63ac('0x17')](_0x27f098):_0x27f098);logger[_0x63ac('0xc')](_0x63ac('0xd'),_0x23006a);_0x4ef7cc[_0x63ac('0xe')]();}};};
\ No newline at end of file
+var _0x982c=['stringify','shelljs','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject'];(function(_0x49ebb4,_0x56551d){var _0x3368da=function(_0x2b0914){while(--_0x2b0914){_0x49ebb4['push'](_0x49ebb4['shift']());}};_0x3368da(++_0x56551d);}(_0x982c,0xd9));var _0xc982=function(_0x25f4c1,_0x55bd7b){_0x25f4c1=_0x25f4c1-0x0;var _0x5ec585=_0x982c[_0x25f4c1];return _0x5ec585;};'use strict';var schema=require('validate');var sh=require(_0xc982('0x0'));var _=require('lodash');var utils=require('./utils');var logger=require(_0xc982('0x1'))(_0xc982('0x2'));var system=schema({'command':{'type':'string','required':!![],'message':_0xc982('0x3')}});exports[_0xc982('0x4')]=function(_0x2be21b,_0x52bf5d){return function(_0x42e462){try{var _0x56b56f={'command':_0x52bf5d[0x0]};var _0x5ad398=system[_0xc982('0x5')](_0x56b56f,{'typecast':!![]});if(_0x5ad398[_0xc982('0x6')]){logger[_0xc982('0x7')](_0xc982('0x8'),_0x2be21b,_['map'](_0x5ad398,_0xc982('0x9'))[_0xc982('0xa')](',\x20'));logger[_0xc982('0xb')](_0xc982('0xc'),_0x2be21b);_0x42e462[_0xc982('0xd')]();}else{var _0x44237d=this;var _0x5ad870=utils[_0xc982('0xe')](_0x52bf5d[0x0],this);logger[_0xc982('0xb')](_0xc982('0xf'),_0x2be21b,_0x5ad870);sh['exec'](_['trim'](_0x5ad870),function(_0x302c5f,_0xa14be9){logger['info'](_0xc982('0x10'),_0x2be21b,_0x302c5f);if(_0x302c5f==0x0){var _0x198359=_0xa14be9[_0xc982('0x11')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x52bf5d[0x1])||_[_0xc982('0x12')](_0x52bf5d[0x1])){logger['info'](_0xc982('0x13'),_0x2be21b);_0x44237d[_0xc982('0x14')][_0x52bf5d[0x1]]=_0x198359;}else{logger[_0xc982('0xb')](_0xc982('0x15'),_0x2be21b,_0x52bf5d[0x1],_0x198359);_0x44237d[_0xc982('0x14')][_0x52bf5d[0x1]]=_0x198359;}}_0x42e462[_0xc982('0xd')]();});}}catch(_0x54ee37){logger[_0xc982('0x7')](_0xc982('0x8'),_0x2be21b,_[_0xc982('0x16')](_0x54ee37)?JSON[_0xc982('0x17')](_0x54ee37):_0x54ee37);logger[_0xc982('0xb')](_0xc982('0xc'),_0x2be21b);_0x42e462[_0xc982('0xd')]();}};};
\ No newline at end of file
index 14693fe..15be849 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f26=['validate','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','consequence','length','[%s][TAG]\x20%s','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','addTags','channel','catch','error','stringify','finally','isObject'];(function(_0x7bf86b,_0x29c0d5){var _0x39e4c3=function(_0x307591){while(--_0x307591){_0x7bf86b['push'](_0x7bf86b['shift']());}};_0x39e4c3(++_0x29c0d5);}(_0x0f26,0x1a2));var _0x60f2=function(_0x16ad55,_0x27ed7d){_0x16ad55=_0x16ad55-0x0;var _0x259e0e=_0x0f26[_0x16ad55];return _0x259e0e;};'use strict';var schema=require(_0x60f2('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x60f2('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x60f2('0x2')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x60f2('0x3')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x60f2('0x4'))(_0x60f2('0x5'));var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x60f2('0x6')]=function(_0x17aadd,_0x3276cd,_0x44e760,_0x2eb0ff){return function(_0x36e1e2){try{var _0xfb416e={'tag':_0x3276cd[0x0]};var _0x2d366b=tag[_0x60f2('0x0')](_0xfb416e,{'typecast':!![]});if(_0x2d366b[_0x60f2('0x7')]){logger['error'](_0x60f2('0x8'),_0x17aadd,_[_0x60f2('0x9')](_0x2d366b,_0x60f2('0xa'))['join'](',\x20'));logger[_0x60f2('0xb')](_0x60f2('0xc'),_0x17aadd);_0x36e1e2[_0x60f2('0xd')]();}else{var _0x599d68={'ids':[_0x3276cd[0x0]]};if(rpc[_0x2eb0ff['channel']+_0x60f2('0xe')]){rpc[_0x2eb0ff['channel']+'Interaction'][_0x60f2('0xf')](_0x2eb0ff['interaction']['id'],_0x599d68)['then'](function(_0x4a4d79){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x17aadd,_0x3276cd[0x1],_0x2eb0ff[_0x60f2('0x10')],_0x2eb0ff['interaction']['id']);})[_0x60f2('0x11')](function(_0x116098){logger[_0x60f2('0x12')](_0x60f2('0x8'),_0x17aadd,JSON[_0x60f2('0x13')](_0x116098));logger[_0x60f2('0xb')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x17aadd);})[_0x60f2('0x14')](function(){_0x36e1e2[_0x60f2('0xd')]();});}}}catch(_0x4d0189){logger[_0x60f2('0x12')]('[%s][TAG]\x20%s',_0x17aadd,_[_0x60f2('0x15')](_0x4d0189)?JSON[_0x60f2('0x13')](_0x4d0189):_0x4d0189);logger[_0x60f2('0xb')](_0x60f2('0xc'),_0x17aadd);_0x36e1e2[_0x60f2('0xd')]();}};};
\ No newline at end of file
+var _0x7e26=['number','consequence','length','error','map','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','finally','isObject','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing'];(function(_0x31568f,_0x243c8b){var _0x1f3c68=function(_0x46f6a1){while(--_0x46f6a1){_0x31568f['push'](_0x31568f['shift']());}};_0x1f3c68(++_0x243c8b);}(_0x7e26,0xa0));var _0x67e2=function(_0xd86f22,_0x29ead5){_0xd86f22=_0xd86f22-0x0;var _0x4e1393=_0x7e26[_0xd86f22];return _0x4e1393;};'use strict';var schema=require(_0x67e2('0x0'));var _=require(_0x67e2('0x1'));var rpc={'chatInteraction':require(_0x67e2('0x2')),'openchannelInteraction':require(_0x67e2('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x67e2('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x67e2('0x5'))};var logger=require(_0x67e2('0x6'))(_0x67e2('0x7'));var tag=schema({'tag':{'type':_0x67e2('0x8'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x67e2('0x9')]=function(_0x2dc6e4,_0x319c00,_0x1e2296,_0x31d180){return function(_0xe8bd7f){try{var _0x5b9c32={'tag':_0x319c00[0x0]};var _0xfbb795=tag[_0x67e2('0x0')](_0x5b9c32,{'typecast':!![]});if(_0xfbb795[_0x67e2('0xa')]){logger[_0x67e2('0xb')]('[%s][TAG]\x20%s',_0x2dc6e4,_[_0x67e2('0xc')](_0xfbb795,'message')[_0x67e2('0xd')](',\x20'));logger['info'](_0x67e2('0xe'),_0x2dc6e4);_0xe8bd7f[_0x67e2('0xf')]();}else{var _0xf997e6={'ids':[_0x319c00[0x0]]};if(rpc[_0x31d180[_0x67e2('0x10')]+_0x67e2('0x11')]){rpc[_0x31d180[_0x67e2('0x10')]+_0x67e2('0x11')][_0x67e2('0x12')](_0x31d180[_0x67e2('0x13')]['id'],_0xf997e6)[_0x67e2('0x14')](function(_0x8163ac){logger[_0x67e2('0x15')](_0x67e2('0x16'),_0x2dc6e4,_0x319c00[0x1],_0x31d180['channel'],_0x31d180[_0x67e2('0x13')]['id']);})[_0x67e2('0x17')](function(_0x4cfb74){logger['error'](_0x67e2('0x18'),_0x2dc6e4,JSON['stringify'](_0x4cfb74));logger[_0x67e2('0x15')](_0x67e2('0xe'),_0x2dc6e4);})[_0x67e2('0x19')](function(){_0xe8bd7f['next']();});}}}catch(_0x19d225){logger[_0x67e2('0xb')](_0x67e2('0x18'),_0x2dc6e4,_[_0x67e2('0x1a')](_0x19d225)?JSON[_0x67e2('0x1b')](_0x19d225):_0x19d225);logger[_0x67e2('0x15')](_0x67e2('0xe'),_0x2dc6e4);_0xe8bd7f['next']();}};};
\ No newline at end of file
index f4d57ef..85f1ac1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda02=['result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','info','../../../../config/logger','lodash','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','login','params','stringify','utf8','POST','application/json-rpc','then','parse'];(function(_0x4b60f4,_0x6973b9){var _0xb98280=function(_0x27e6f1){while(--_0x27e6f1){_0x4b60f4['push'](_0x4b60f4['shift']());}};_0xb98280(++_0x6973b9);}(_0xda02,0x19d));var _0x2da0=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0xda02[_0xd0a847];return _0x2536ec;};'use strict';var rp=require('request-promise');var logger=require(_0x2da0('0x0'))('routing');var _=require(_0x2da0('0x1'));var arr=[];exports['consequence']=function(_0x64d919,_0x52eca1){return function(_0x4cb91a){var _0x3722fd=_0x52eca1[0xa];var _0x5b8aac=_0x52eca1[0xb];var _0x2fceab=_0x52eca1[0xc];var _0x2bcb01=_0x52eca1[0xd];var _0x5cb5d7=_0x52eca1[0xe];var _0x24fcf2=_0x52eca1[0xf][_0x2da0('0x2')](/\n/g,_0x2da0('0x3'));var _0x2c29dc=_0x52eca1[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x2da0('0x4')](_0x5b8aac)){arr[_0x2da0('0x5')](_0x5b8aac);var _0x4d4705=_0x52eca1[0x3];var _0x72ac34=_0x52eca1[0x4];var _0x2449ef=_0x52eca1[0x1];var _0x522a6e=_0x52eca1[0x0];var _0x598444={};_0x598444[_0x2da0('0x6')]=_0x52eca1[0x8]+_0x2da0('0x7')+_0x2fceab+'|'+_0x3722fd+'|'+_0x2bcb01+'|'+_0x5b8aac+'|'+_0x5cb5d7;_0x598444[_0x2da0('0x8')]=_0x52eca1[0x7]+_0x2da0('0x7')+_0x2fceab+'|'+_0x3722fd+'|'+_0x2bcb01+'|'+_0x5b8aac+'|'+_0x5cb5d7+'|'+_0x24fcf2+'|'+_0x2c29dc;_0x598444[_0x2da0('0x9')]=_0x52eca1[0x9];var _0x4fa5bb={};_0x4fa5bb[_0x2da0('0xa')]=_0x2da0('0xb');_0x4fa5bb[_0x2da0('0xc')]=_0x2da0('0xd');var _0x22ce6a=[];_0x22ce6a[_0x2da0('0x5')](_0x52eca1[0x2]);_0x22ce6a[_0x2da0('0x5')](_0x52eca1[0x5]);_0x22ce6a['push'](_0x52eca1[0x6]);_0x4fa5bb[_0x2da0('0xe')]=_0x22ce6a;_0x4fa5bb['id']=0x1;var _0x12d8f3=JSON[_0x2da0('0xf')](_0x4fa5bb);var _0x4af874={'encoding':_0x2da0('0x10'),'method':_0x2da0('0x11'),'timeout':0x2710,'url':_0x4d4705,'headers':{'Content-Type':_0x2da0('0x12')},'body':_0x12d8f3};return rp(_0x4af874)[_0x2da0('0x13')](function(_0x10bd4f){const _0x33496f=JSON[_0x2da0('0x14')](_0x10bd4f);if(!_0x33496f[_0x2da0('0x15')][_0x2da0('0x16')]){throw new Error(_0x2da0('0x17'));}var _0x478710=_0x5b8aac;var _0xdbb7c3=_0x2da0('0x18')+_0x2449ef+_0x2da0('0x19')+_0x522a6e+_0x2da0('0x1a')+_0x478710+'&data='+JSON[_0x2da0('0xf')](_0x598444);var _0x585055=_0x72ac34+'?'+_0xdbb7c3;return rp(_0x585055);})[_0x2da0('0x13')](function(_0x337c95){logger['info'](_0x2da0('0x1b'),_0x64d919,_0x337c95);_0x4cb91a[_0x2da0('0x1c')]();})['catch'](function(_0x433668){logger[_0x2da0('0x1d')]('[%s][TVOX]\x20%s',_0x64d919,_['isObject'](_0x433668)?JSON['stringify'](_0x433668):_0x433668);_0x4cb91a[_0x2da0('0x1c')]();});}else{logger[_0x2da0('0x1e')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x64d919);_0x4cb91a['next']();}};};
\ No newline at end of file
+var _0xab01=['stringify','utf8','POST','application/json-rpc','then','parse','result','logged','channelId=','&serviceId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','isObject','info','next','request-promise','routing','lodash','consequence','replace','push','urlOnAnswer','urlOnRing','2.0'];(function(_0x214266,_0x1f6f52){var _0x568f75=function(_0x541904){while(--_0x541904){_0x214266['push'](_0x214266['shift']());}};_0x568f75(++_0x1f6f52);}(_0xab01,0xad));var _0x1ab0=function(_0x3d27ba,_0x2671a3){_0x3d27ba=_0x3d27ba-0x0;var _0xf01885=_0xab01[_0x3d27ba];return _0xf01885;};'use strict';var rp=require(_0x1ab0('0x0'));var logger=require('../../../../config/logger')(_0x1ab0('0x1'));var _=require(_0x1ab0('0x2'));var arr=[];exports[_0x1ab0('0x3')]=function(_0x5dba7d,_0x35dff0){return function(_0x5c19cf){var _0xff632e=_0x35dff0[0xa];var _0x1466b5=_0x35dff0[0xb];var _0x541630=_0x35dff0[0xc];var _0x730124=_0x35dff0[0xd];var _0x2ebd83=_0x35dff0[0xe];var _0x2f3168=_0x35dff0[0xf][_0x1ab0('0x4')](/\n/g,'\x20-\x20');var _0x33457b=_0x35dff0[0x10][_0x1ab0('0x4')](/\n/g,'\x20');if(!arr['includes'](_0x1466b5)){arr[_0x1ab0('0x5')](_0x1466b5);var _0x1d9bfc=_0x35dff0[0x3];var _0x18b448=_0x35dff0[0x4];var _0x4ea921=_0x35dff0[0x1];var _0x6a8b83=_0x35dff0[0x0];var _0x57fd09={};_0x57fd09[_0x1ab0('0x6')]=_0x35dff0[0x8]+'?params='+_0x541630+'|'+_0xff632e+'|'+_0x730124+'|'+_0x1466b5+'|'+_0x2ebd83;_0x57fd09[_0x1ab0('0x7')]=_0x35dff0[0x7]+'?params='+_0x541630+'|'+_0xff632e+'|'+_0x730124+'|'+_0x1466b5+'|'+_0x2ebd83+'|'+_0x2f3168+'|'+_0x33457b;_0x57fd09['title']=_0x35dff0[0x9];var _0x4aaa99={};_0x4aaa99['jsonrpc']=_0x1ab0('0x8');_0x4aaa99['method']='login';var _0x343d75=[];_0x343d75[_0x1ab0('0x5')](_0x35dff0[0x2]);_0x343d75[_0x1ab0('0x5')](_0x35dff0[0x5]);_0x343d75[_0x1ab0('0x5')](_0x35dff0[0x6]);_0x4aaa99['params']=_0x343d75;_0x4aaa99['id']=0x1;var _0x49fea2=JSON[_0x1ab0('0x9')](_0x4aaa99);var _0x2106f4={'encoding':_0x1ab0('0xa'),'method':_0x1ab0('0xb'),'timeout':0x2710,'url':_0x1d9bfc,'headers':{'Content-Type':_0x1ab0('0xc')},'body':_0x49fea2};return rp(_0x2106f4)[_0x1ab0('0xd')](function(_0x3488f2){const _0x2d2101=JSON[_0x1ab0('0xe')](_0x3488f2);if(!_0x2d2101[_0x1ab0('0xf')][_0x1ab0('0x10')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x2a31d5=_0x1466b5;var _0x533906=_0x1ab0('0x11')+_0x4ea921+_0x1ab0('0x12')+_0x6a8b83+'&sessionId='+_0x2a31d5+_0x1ab0('0x13')+JSON[_0x1ab0('0x9')](_0x57fd09);var _0x59d0c0=_0x18b448+'?'+_0x533906;return rp(_0x59d0c0);})['then'](function(_0x137be4){logger['info'](_0x1ab0('0x14'),_0x5dba7d,_0x137be4);_0x5c19cf['stop']();})[_0x1ab0('0x15')](function(_0x34aefd){logger[_0x1ab0('0x16')]('[%s][TVOX]\x20%s',_0x5dba7d,_[_0x1ab0('0x17')](_0x34aefd)?JSON[_0x1ab0('0x9')](_0x34aefd):_0x34aefd);_0x5c19cf['stop']();});}else{logger[_0x1ab0('0x18')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x5dba7d);_0x5c19cf[_0x1ab0('0x19')]();}};};
\ No newline at end of file
index ddc11f9..e25bd03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x447284,_0x50151f){var _0x1f2cc3=function(_0x252451){while(--_0x252451){_0x447284['push'](_0x447284['shift']());}};_0x1f2cc3(++_0x50151f);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}};
\ No newline at end of file
+var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x1b8f79,_0x57ff23){var _0x5701fc=function(_0x44e046){while(--_0x44e046){_0x1b8f79['push'](_0x1b8f79['shift']());}};_0x5701fc(++_0x57ff23);}(_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 143b8df..4010570 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ce1=['matchPath','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','busy','agents','busyQueue','emit','QueueReport','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','values','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','uuid','./applications/utils','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','%s.%s.%s','IntervalId','Intervals','map','interval','isNil','rules','message','interaction','isArray','applications','length','app','.js','toLowerCase','autoreply','appdata','channel','push','slice','join','dialogflow','split','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify'];(function(_0x4b45bc,_0x2193ca){var _0x11d660=function(_0x2d3500){while(--_0x2d3500){_0x4b45bc['push'](_0x4b45bc['shift']());}};_0x11d660(++_0x2193ca);}(_0x2ce1,0x8b));var _0x12ce=function(_0x14ecac,_0x3fd6d2){_0x14ecac=_0x14ecac-0x0;var _0x37d2ef=_0x2ce1[_0x14ecac];return _0x37d2ef;};'use strict';var _=require('lodash');var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0x12ce('0x0'));var BPromise=require(_0x12ce('0x1'));var uuid=require(_0x12ce('0x2'));var utils=require(_0x12ce('0x3'));var config=require('../../../config/environment');var logger=require(_0x12ce('0x4'))(_0x12ce('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x12ce('0x6')),'chatQueueReport':require(_0x12ce('0x7')),'smsQueueReport':require(_0x12ce('0x8')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x12ce('0x9'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x21ef24,_0x276bce,_0x3dc12e){return util['format'](_0x12ce('0xa'),_0x21ef24,_0x276bce||0x0,_0x3dc12e||0x0);}function getIntervals(_0x23b72f,_0x3e1ee9){var _0x1bf7f1=[];if(!_['isNil'](_0x3e1ee9[_0x12ce('0xb')])&&!_['isNil'](_0x23b72f[_0x3e1ee9[_0x12ce('0xb')]])&&!_['isNil'](_0x23b72f[_0x3e1ee9['IntervalId']][_0x12ce('0xc')])){_0x1bf7f1=_[_0x12ce('0xd')](_0x23b72f[_0x3e1ee9[_0x12ce('0xb')]][_0x12ce('0xc')],_0x12ce('0xe'));}else if(!_[_0x12ce('0xf')](_0x3e1ee9['interval'])){_0x1bf7f1=[_0x3e1ee9[_0x12ce('0xe')]];}return _0x1bf7f1;}exports['listen']=function(_0x12bcf2){_0x12bcf2[_0x12ce('0x10')]={};return new BPromise(function(_0x302e3e,_0x4e3d27){var _0x2171d2={'Start':function(_0x288cff){var _0x2ac396=this;return new Promise(function(_0x39e4ec,_0x134831){if(_0x288cff){try{var _0x188408=[];var _0x56a72a=getId(_0x288cff['channel'],_0x288cff[_0x12ce('0x11')]?_0x288cff['message']['id']:0x0,_0x288cff[_0x12ce('0x12')]?_0x288cff[_0x12ce('0x12')]['id']:0x0);if(_0x288cff['applications']&&_[_0x12ce('0x13')](_0x288cff['applications'])&&_0x288cff[_0x12ce('0x14')]['length']){for(var _0xe24a11=0x0;_0xe24a11<_0x288cff['applications'][_0x12ce('0x15')];_0xe24a11+=0x1){var _0x4f5eab=_0x288cff[_0x12ce('0x14')][_0xe24a11];if(fs['existsSync'](path['join'](__dirname,_0x12ce('0x14'),_0x4f5eab[_0x12ce('0x16')]+_0x12ce('0x17')))){var _0x31656e=[];switch(_0x4f5eab['app'][_0x12ce('0x18')]()){case _0x12ce('0x19'):var _0x57e920=_0x4f5eab[_0x12ce('0x1a')]['split'](',');if(_0x288cff[_0x12ce('0x1b')]==='mail'){_0x31656e[_0x12ce('0x1c')](_0x57e920[0x0]);_0x31656e[_0x12ce('0x1c')](_0x57e920[0x1]);_0x31656e[_0x12ce('0x1c')](_0x57e920[_0x12ce('0x1d')](0x2,_0x57e920[_0x12ce('0x15')])[_0x12ce('0x1e')](','));}else{_0x31656e[_0x12ce('0x1c')](_0x57e920[0x0]);_0x31656e[_0x12ce('0x1c')](_0x57e920['slice'](0x1,_0x57e920['length'])[_0x12ce('0x1e')](','));}break;case _0x12ce('0x1f'):var _0x10232e=_0x4f5eab[_0x12ce('0x1a')]['split'](',');_0x31656e[_0x12ce('0x1c')](_0x10232e[0x0]);_0x31656e[_0x12ce('0x1c')](_0x10232e[0x1]);_0x31656e[_0x12ce('0x1c')](_0x10232e[_0x12ce('0x1d')](0x2,_0x10232e['length'])[_0x12ce('0x1e')](','));break;case'dialogflowv2':var _0x3ac1e3=_0x4f5eab[_0x12ce('0x1a')]['split'](',');_0x31656e[_0x12ce('0x1c')](_0x3ac1e3[0x0]);_0x31656e[_0x12ce('0x1c')](_0x3ac1e3[0x1]);_0x31656e[_0x12ce('0x1c')](_0x3ac1e3[0x2]);_0x31656e[_0x12ce('0x1c')](_0x3ac1e3[0x3]);_0x31656e[_0x12ce('0x1c')](_0x3ac1e3[_0x12ce('0x1d')](0x4,_0x3ac1e3[_0x12ce('0x15')])[_0x12ce('0x1e')](','));break;case'amazonlex':var _0x2f29fc=_0x4f5eab[_0x12ce('0x1a')][_0x12ce('0x20')](',');_0x31656e[_0x12ce('0x1c')](_0x2f29fc[0x0]);_0x31656e[_0x12ce('0x1c')](_0x2f29fc[0x1]);_0x31656e['push'](_0x2f29fc[0x2]);_0x31656e[_0x12ce('0x1c')](_0x2f29fc[0x3]);_0x31656e[_0x12ce('0x1c')](_0x2f29fc['slice'](0x4,_0x2f29fc['length'])['join'](','));break;case _0x12ce('0x11'):_0x31656e[_0x12ce('0x1c')](_0x4f5eab[_0x12ce('0x1a')]);break;case _0x12ce('0x21'):_0x31656e[_0x12ce('0x1c')](_0x4f5eab[_0x12ce('0x22')]);_0x31656e['push'](_0x4f5eab[_0x12ce('0x1a')]);break;case _0x12ce('0x23'):var _0xef41f2=utils[_0x12ce('0x24')](_0x288cff[_0x12ce('0x25')][_0x12ce('0x26')],_0x288cff);var _0x6c46d2=_0x4f5eab[_0x12ce('0x1a')]['split'](',');_0x31656e[_0x12ce('0x1c')](_0x6c46d2[0x0]);_0x31656e[_0x12ce('0x1c')](_0x6c46d2[0x1]);_0x31656e[_0x12ce('0x1c')](_0x6c46d2[0x2]);_0x31656e['push'](_0x6c46d2[0x3]);_0x31656e[_0x12ce('0x1c')](_0x6c46d2[0x4]);_0x31656e[_0x12ce('0x1c')](_0x6c46d2[0x5]);_0x31656e[_0x12ce('0x1c')](_0x6c46d2[0x6]);_0x31656e['push'](_0x6c46d2[0x7]);_0x31656e[_0x12ce('0x1c')](_0x6c46d2[0x8]);_0x31656e['push'](_0x6c46d2[0x9]);_0x31656e['push'](_0x6c46d2[0xa]);_0x31656e[_0x12ce('0x1c')](_0x288cff['interaction']['id']);_0x31656e[_0x12ce('0x1c')](_0x288cff[_0x12ce('0x11')]['id']);_0x31656e[_0x12ce('0x1c')](_0x4f5eab['ChatWebsiteId']);_0x31656e[_0x12ce('0x1c')](_0x288cff[_0x12ce('0x12')][_0x12ce('0x27')]);_0x31656e[_0x12ce('0x1c')](_0x288cff[_0x12ce('0x28')][_0x12ce('0x28')]);_0x31656e['push'](_0xef41f2);break;default:_0x31656e=_['isNil'](_0x4f5eab['appdata'])?[]:_0x4f5eab[_0x12ce('0x1a')][_0x12ce('0x20')](',');}var _0x26fd9e={'id':util['format'](_0x12ce('0x29'),_0x56a72a,_0x4f5eab['id'],_0x4f5eab[_0x12ce('0x16')]),'condition':require(_0x12ce('0x2a'))[_0x12ce('0x2b')](_0x56a72a,getIntervals(_0x12bcf2[_0x12ce('0x2c')],_0x4f5eab),_0x12bcf2),'consequence':require(_0x12ce('0x2d')+_0x4f5eab['app'])[_0x12ce('0x2e')](_0x56a72a,_0x31656e,_0x12bcf2,_0x288cff),'p':_0x4f5eab[_0x12ce('0x2f')]||0x0};logger[_0x12ce('0x30')]('Push\x20new\x20rule',_0x26fd9e['id'],_0x12ce('0x31'),getIntervals(_0x12bcf2[_0x12ce('0x2c')],_0x4f5eab)[_0x12ce('0x1e')]('\x20|\x20'));_0x188408['push'](_0x26fd9e);}else{logger[_0x12ce('0x32')](_0x12ce('0x33'),path[_0x12ce('0x1e')](__dirname,'applications',_0x4f5eab[_0x12ce('0x16')]+_0x12ce('0x17')));}}_0x12bcf2[_0x12ce('0x10')][_0x56a72a]=new RuleEngine(_0x188408);_0x12bcf2[_0x12ce('0x10')][_0x56a72a][_0x12ce('0x34')](_0x288cff,function(_0x43dced){logger[_0x12ce('0x30')](_0x12ce('0x35'),JSON[_0x12ce('0x36')](_0x43dced[_0x12ce('0x37')]));if(_0x12bcf2[_0x12ce('0x10')][_0x56a72a]){_0x12bcf2['rules'][_0x56a72a]['emit'](_0x12ce('0x38'));}});return _0x39e4ec({'code':0xc8,'message':_0x288cff});}else{logger[_0x12ce('0x30')](_0x12ce('0x39'));return _0x39e4ec({'code':0xc8,'message':_0x288cff});}}catch(_0x51beb0){logger['error'](_0x51beb0['stack']);return _0x134831(_0x2ac396[_0x12ce('0x32')](0x1f4,_0x51beb0));}}return _0x134831(_0x12ce('0x3a'));});},'AcceptMessage':function(_0x17d419){var _0x1982b4=this;return new Promise(function(_0x2f11a4,_0x21044f){if(_0x17d419[_0x12ce('0x3b')]&&_0x17d419['agent']['id']){if(_0x12bcf2['agents'][_0x17d419[_0x12ce('0x3b')]['id']]){_0x12bcf2['agents'][_0x17d419[_0x12ce('0x3b')]['id']][_0x12ce('0x3c')]=![];_0x12bcf2[_0x12ce('0x3d')][_0x17d419[_0x12ce('0x3b')]['id']][_0x12ce('0x3e')]=undefined;}}if(_0x17d419[_0x12ce('0x11')]&&_0x17d419['message']['id']){try{var _0xfc17ea=getId(_0x17d419['channel'],_0x17d419[_0x12ce('0x11')]?_0x17d419[_0x12ce('0x11')]['id']:0x0,_0x17d419[_0x12ce('0x12')]?_0x17d419[_0x12ce('0x12')]['id']:0x0);if(_0x12bcf2[_0x12ce('0x10')][_0xfc17ea]){_0x12bcf2[_0x12ce('0x10')][_0xfc17ea][_0x12ce('0x3f')]('end');if(rpc[_0x17d419['channel']+_0x12ce('0x40')]){rpc[_0x17d419[_0x12ce('0x1b')]+'QueueReport']['update'](_0xfc17ea,{'UserId':_0x17d419[_0x12ce('0x11')][_0x12ce('0x41')]})[_0x12ce('0x42')](function(_0x3f5eef){logger[_0x12ce('0x32')](_0x12ce('0x43'));});}}return _0x2f11a4({'code':0xc8,'message':_0x17d419});}catch(_0x148500){logger[_0x12ce('0x32')](_0x148500[_0x12ce('0x44')]);return _0x21044f(_0x1982b4[_0x12ce('0x32')](0x1f4,_0x148500));}}logger[_0x12ce('0x32')](_0x12ce('0x45'));return _0x21044f(_0x1982b4[_0x12ce('0x32')](0x1f4,_0x12ce('0x45')));});},'RejectMessage':function(_0x455f03){var _0x4a4595=this;return new Promise(function(_0x4c4a5c,_0x497187){if(_0x455f03[_0x12ce('0x3b')]&&_0x455f03['agent']['id']){try{if(_0x12bcf2[_0x12ce('0x3d')][_0x455f03[_0x12ce('0x3b')]['id']]){_0x12bcf2['agents'][_0x455f03[_0x12ce('0x3b')]['id']][_0x12ce('0x3c')]=![];_0x12bcf2[_0x12ce('0x3d')][_0x455f03[_0x12ce('0x3b')]['id']][_0x12ce('0x3e')]=undefined;}return _0x4c4a5c({'code':0xc8,'message':_0x455f03});}catch(_0x12e627){logger[_0x12ce('0x32')](_0x12e627[_0x12ce('0x44')]);return _0x497187(_0x4a4595[_0x12ce('0x32')](0x1f4,_0x12e627));}}logger['error'](_0x12ce('0x45'));return _0x497187(_0x4a4595[_0x12ce('0x32')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x40d7c7){var _0x3430c0=this;return new Promise(function(_0x31fc53,_0x4a7a68){if(_0x40d7c7[_0x12ce('0x1b')]&&_0x40d7c7[_0x12ce('0x12')]&&_0x40d7c7['interaction']['id']){try{var _0x32e105=getId(_0x40d7c7[_0x12ce('0x1b')],_0x40d7c7[_0x12ce('0x11')]?_0x40d7c7[_0x12ce('0x11')]['id']:0x0,_0x40d7c7[_0x12ce('0x12')]?_0x40d7c7['interaction']['id']:0x0);if(_0x12bcf2[_0x12ce('0x10')][_0x32e105]){_0x12bcf2[_0x12ce('0x10')][_0x32e105][_0x12ce('0x3f')]('end');}return _0x31fc53({'code':0xc8,'message':_0x40d7c7});}catch(_0x3a730b){logger['error'](_0x3a730b['stack']);return _0x4a7a68(_0x3430c0['error'](0x1f4,_0x3a730b));}}logger['error'](_0x12ce('0x45'));return _0x4a7a68(_0x3430c0[_0x12ce('0x32')](0x1f4,_0x12ce('0x45')));});},'AgentCapacity':function(_0xbac09c){var _0x449df4=this;return new Promise(function(_0x56e276,_0x4d0775){if(_0x12bcf2[_0x12ce('0x3d')][_0x12ce('0x46')](_0xbac09c['id'])){for(var _0x31a04b in _0xbac09c[_0x12ce('0x47')]){if(_0xbac09c[_0x12ce('0x47')][_0x12ce('0x46')](_0x31a04b)){if(_0x12bcf2[_0x12ce('0x3d')][_0xbac09c['id']]['hasOwnProperty'](_0x31a04b+_0x12ce('0x48'))){_0x12bcf2[_0x12ce('0x3d')][_0xbac09c['id']][_0x31a04b+_0x12ce('0x48')]=parseInt(_0xbac09c['capacity'][_0x31a04b],0xa);}}}_0x12bcf2[_0x12ce('0x3d')][_0xbac09c['id']][_0x12ce('0x49')]();return _0x56e276({'code':0xc8,'message':_0x12bcf2['agents'][_0xbac09c['id']]});}else{return _0x4d0775(_0x449df4[_0x12ce('0x32')](0x1f4,_0x12ce('0x4a')));}});},'Agents':function(_0x532539){return new Promise(function(_0x49b911,_0x26b343){var _0x5c2e63=_['values'](_0x12bcf2[_0x12ce('0x3d')]);_0x49b911({'count':_0x5c2e63['length'],'rows':_0x5c2e63});});},'ChatQueues':function(_0x259f20){return new Promise(function(_0x3ffcdf,_0x153954){var _0x5ec96e=[];for(var _0x1d79ff in _0x12bcf2[_0x12ce('0x4b')]){if(_0x12bcf2[_0x12ce('0x4b')][_0x12ce('0x46')](_0x1d79ff)){var _0x5d7ebc=_0x12bcf2[_0x12ce('0x4b')][_0x1d79ff];var _0x5b0fe7={'id':_0x5d7ebc['id'],'available':_0x5d7ebc[_0x12ce('0x4c')],'loggedIn':_0x5d7ebc[_0x12ce('0x4d')],'name':_0x5d7ebc['name'],'paused':_0x5d7ebc[_0x12ce('0x4e')],'waiting':_0x5d7ebc[_0x12ce('0x4f')]};_0x5ec96e[_0x12ce('0x1c')](_0x5b0fe7);}}_0x3ffcdf({'count':_0x5ec96e[_0x12ce('0x15')],'rows':_0x5ec96e});});},'MailQueues':function(_0x1ab419){return new Promise(function(_0x127c2d,_0x32fd96){var _0x230425=[];for(var _0x3bad0d in _0x12bcf2[_0x12ce('0x50')]){if(_0x12bcf2[_0x12ce('0x50')][_0x12ce('0x46')](_0x3bad0d)){var _0x427e39=_0x12bcf2['mailQueues'][_0x3bad0d];var _0x17f3af={'id':_0x427e39['id'],'available':_0x427e39[_0x12ce('0x4c')],'loggedIn':_0x427e39['loggedIn'],'name':_0x427e39[_0x12ce('0x51')],'paused':_0x427e39['paused'],'waiting':_0x427e39[_0x12ce('0x4f')]};_0x230425[_0x12ce('0x1c')](_0x17f3af);}}_0x127c2d({'count':_0x230425[_0x12ce('0x15')],'rows':_0x230425});});},'OpenchannelQueues':function(_0x17a3ae){return new Promise(function(_0x360c80,_0x12d8d5){var _0x5d934b=[];for(var _0x7fe407 in _0x12bcf2[_0x12ce('0x52')]){if(_0x12bcf2[_0x12ce('0x52')][_0x12ce('0x46')](_0x7fe407)){var _0x572aec=_0x12bcf2['openchannelQueues'][_0x7fe407];var _0x2ab52b={'id':_0x572aec['id'],'available':_0x572aec['available'],'loggedIn':_0x572aec[_0x12ce('0x4d')],'name':_0x572aec[_0x12ce('0x51')],'paused':_0x572aec[_0x12ce('0x4e')],'waiting':_0x572aec[_0x12ce('0x4f')]};_0x5d934b['push'](_0x2ab52b);}}_0x360c80({'count':_0x5d934b['length'],'rows':_0x5d934b});});},'SmsQueues':function(_0x90f4f8){return new Promise(function(_0x132235,_0x3b6747){var _0x2f9453=[];for(var _0x3d7cb5 in _0x12bcf2[_0x12ce('0x53')]){if(_0x12bcf2[_0x12ce('0x53')]['hasOwnProperty'](_0x3d7cb5)){var _0x27b312=_0x12bcf2[_0x12ce('0x53')][_0x3d7cb5];var _0x1d353a={'id':_0x27b312['id'],'available':_0x27b312[_0x12ce('0x4c')],'loggedIn':_0x27b312[_0x12ce('0x4d')],'name':_0x27b312[_0x12ce('0x51')],'paused':_0x27b312[_0x12ce('0x4e')],'waiting':_0x27b312[_0x12ce('0x4f')]};_0x2f9453[_0x12ce('0x1c')](_0x1d353a);}}_0x132235({'count':_0x2f9453[_0x12ce('0x15')],'rows':_0x2f9453});});},'FaxQueues':function(_0x2c488d){return new Promise(function(_0x4ac85a,_0x4df713){var _0x408f7e=[];for(var _0x2fe6f4 in _0x12bcf2['faxQueues']){if(_0x12bcf2[_0x12ce('0x54')][_0x12ce('0x46')](_0x2fe6f4)){var _0xc801cd=_0x12bcf2[_0x12ce('0x54')][_0x2fe6f4];var _0x2d7665={'id':_0xc801cd['id'],'available':_0xc801cd[_0x12ce('0x4c')],'loggedIn':_0xc801cd[_0x12ce('0x4d')],'name':_0xc801cd[_0x12ce('0x51')],'paused':_0xc801cd['paused'],'waiting':_0xc801cd[_0x12ce('0x4f')]};_0x408f7e[_0x12ce('0x1c')](_0x2d7665);}}_0x4ac85a({'count':_0x408f7e[_0x12ce('0x15')],'rows':_0x408f7e});});},'WhatsappQueues':function(_0x2c0f57){return new Promise(function(_0x3aa4a8,_0x41bc51){var _0x21afcb=[];for(var _0x4ce319 in _0x12bcf2[_0x12ce('0x55')]){if(_0x12bcf2[_0x12ce('0x55')][_0x12ce('0x46')](_0x4ce319)){var _0x7a3c81=_0x12bcf2['whatsappQueues'][_0x4ce319];var _0x237793={'id':_0x7a3c81['id'],'available':_0x7a3c81[_0x12ce('0x4c')],'loggedIn':_0x7a3c81[_0x12ce('0x4d')],'name':_0x7a3c81[_0x12ce('0x51')],'paused':_0x7a3c81['paused'],'waiting':_0x7a3c81[_0x12ce('0x4f')]};_0x21afcb['push'](_0x237793);}}_0x3aa4a8({'count':_0x21afcb['length'],'rows':_0x21afcb});});},'ChatQueuesWaitingInteractions':function(_0xcafea9){return new Promise(function(_0x3f50f9,_0x128049){var _0x5c926c=_['values'](_0x12bcf2[_0x12ce('0x56')]);_0x3f50f9({'count':_0x5c926c[_0x12ce('0x15')],'rows':_0x5c926c});});},'MailQueuesWaitingInteractions':function(_0x36edc4){return new Promise(function(_0x2aefe4,_0xe960be){var _0x3ddc17=_[_0x12ce('0x57')](_0x12bcf2['mailQueuesWaitingInteractions']);_0x2aefe4({'count':_0x3ddc17['length'],'rows':_0x3ddc17});});},'OpenchannelQueuesWaitingInteractions':function(_0x1c439a){return new Promise(function(_0x4d3980,_0x2d8e83){var _0x240e95=_['values'](_0x12bcf2[_0x12ce('0x58')]);_0x4d3980({'count':_0x240e95[_0x12ce('0x15')],'rows':_0x240e95});});},'SmsQueuesWaitingInteractions':function(_0x5bf370){return new Promise(function(_0x294982,_0x7f61c){var _0x316d75=_[_0x12ce('0x57')](_0x12bcf2[_0x12ce('0x59')]);_0x294982({'count':_0x316d75['length'],'rows':_0x316d75});});},'FaxQueuesWaitingInteractions':function(_0x44b106){return new Promise(function(_0x4facd8,_0x55bc1e){var _0xf97227=_[_0x12ce('0x57')](_0x12bcf2[_0x12ce('0x5a')]);_0x4facd8({'count':_0xf97227[_0x12ce('0x15')],'rows':_0xf97227});});},'WhatsappQueuesWaitingInteractions':function(_0xb86d7d){return new Promise(function(_0x294aee,_0x4bc3db){var _0x1f0221=_[_0x12ce('0x57')](_0x12bcf2[_0x12ce('0x5b')]);_0x294aee({'count':_0x1f0221[_0x12ce('0x15')],'rows':_0x1f0221});});}};var _0x3a2e9a=jayson['server'](_0x2171d2)[_0x12ce('0x5c')]();_0x3a2e9a['on'](_0x12ce('0x32'),function(_0x4157e3){logger[_0x12ce('0x32')](JSON[_0x12ce('0x36')](_0x4157e3));return _0x4e3d27(_0x4157e3);});_0x3a2e9a['listen'](0x232c,_0x12ce('0x5d'),function(){console[_0x12ce('0x5e')](_0x12ce('0x5f'),0x232c);return _0x302e3e(_0x12ce('0x60')+0x232c);});});};
\ No newline at end of file
+var _0x0f69=['../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','interval','listen','rules','channel','message','interaction','isArray','applications','length','existsSync','app','autoreply','appdata','split','mail','push','slice','join','dialogflowv2','tag','TagId','tvox','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','condition','consequence','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','info','Applications\x20executed','stringify','matchPath','emit','stack','agents','agent','busy','busyQueue','end','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','log','RPC\x20listening\x20on\x20port:','path','bluebird','uuid','../../../config/environment','../../../config/logger'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x0f69,0x173));var _0x90f6=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x0f69[_0x51020b];return _0x371e47;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0x90f6('0x0'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x90f6('0x1'));var uuid=require(_0x90f6('0x2'));var utils=require('./applications/utils');var config=require(_0x90f6('0x3'));var logger=require(_0x90f6('0x4'))('routing');var rpc={'openchannelQueueReport':require(_0x90f6('0x5')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x90f6('0x6')),'smsQueueReport':require(_0x90f6('0x7')),'faxQueueReport':require(_0x90f6('0x8')),'whatsappQueueReport':require(_0x90f6('0x9'))};var RuleEngine=require(_0x90f6('0xa'));function getId(_0x42044f,_0x488b53,_0x33c6f8){return util[_0x90f6('0xb')](_0x90f6('0xc'),_0x42044f,_0x488b53||0x0,_0x33c6f8||0x0);}function getIntervals(_0x94b08c,_0x2db1dc){var _0x2c7664=[];if(!_['isNil'](_0x2db1dc[_0x90f6('0xd')])&&!_[_0x90f6('0xe')](_0x94b08c[_0x2db1dc['IntervalId']])&&!_[_0x90f6('0xe')](_0x94b08c[_0x2db1dc['IntervalId']][_0x90f6('0xf')])){_0x2c7664=_['map'](_0x94b08c[_0x2db1dc['IntervalId']][_0x90f6('0xf')],'interval');}else if(!_[_0x90f6('0xe')](_0x2db1dc[_0x90f6('0x10')])){_0x2c7664=[_0x2db1dc[_0x90f6('0x10')]];}return _0x2c7664;}exports[_0x90f6('0x11')]=function(_0x47fd3c){_0x47fd3c[_0x90f6('0x12')]={};return new BPromise(function(_0x5b10af,_0x5d7ab9){var _0x36803b={'Start':function(_0x598737){var _0x85ba42=this;return new Promise(function(_0x16d692,_0x18ae4b){if(_0x598737){try{var _0x2844bd=[];var _0x3b4d5d=getId(_0x598737[_0x90f6('0x13')],_0x598737[_0x90f6('0x14')]?_0x598737['message']['id']:0x0,_0x598737[_0x90f6('0x15')]?_0x598737[_0x90f6('0x15')]['id']:0x0);if(_0x598737['applications']&&_[_0x90f6('0x16')](_0x598737[_0x90f6('0x17')])&&_0x598737[_0x90f6('0x17')][_0x90f6('0x18')]){for(var _0x3e6dc0=0x0;_0x3e6dc0<_0x598737[_0x90f6('0x17')][_0x90f6('0x18')];_0x3e6dc0+=0x1){var _0x47def2=_0x598737[_0x90f6('0x17')][_0x3e6dc0];if(fs[_0x90f6('0x19')](path['join'](__dirname,'applications',_0x47def2[_0x90f6('0x1a')]+'.js'))){var _0x480cd5=[];switch(_0x47def2[_0x90f6('0x1a')]['toLowerCase']()){case _0x90f6('0x1b'):var _0x9c4fd=_0x47def2[_0x90f6('0x1c')][_0x90f6('0x1d')](',');if(_0x598737[_0x90f6('0x13')]===_0x90f6('0x1e')){_0x480cd5['push'](_0x9c4fd[0x0]);_0x480cd5[_0x90f6('0x1f')](_0x9c4fd[0x1]);_0x480cd5['push'](_0x9c4fd[_0x90f6('0x20')](0x2,_0x9c4fd[_0x90f6('0x18')])[_0x90f6('0x21')](','));}else{_0x480cd5[_0x90f6('0x1f')](_0x9c4fd[0x0]);_0x480cd5[_0x90f6('0x1f')](_0x9c4fd[_0x90f6('0x20')](0x1,_0x9c4fd[_0x90f6('0x18')])[_0x90f6('0x21')](','));}break;case'dialogflow':var _0x4553e3=_0x47def2['appdata']['split'](',');_0x480cd5['push'](_0x4553e3[0x0]);_0x480cd5[_0x90f6('0x1f')](_0x4553e3[0x1]);_0x480cd5[_0x90f6('0x1f')](_0x4553e3['slice'](0x2,_0x4553e3[_0x90f6('0x18')])[_0x90f6('0x21')](','));break;case _0x90f6('0x22'):var _0x55fce4=_0x47def2[_0x90f6('0x1c')][_0x90f6('0x1d')](',');_0x480cd5[_0x90f6('0x1f')](_0x55fce4[0x0]);_0x480cd5[_0x90f6('0x1f')](_0x55fce4[0x1]);_0x480cd5[_0x90f6('0x1f')](_0x55fce4[0x2]);_0x480cd5[_0x90f6('0x1f')](_0x55fce4[0x3]);_0x480cd5[_0x90f6('0x1f')](_0x55fce4[_0x90f6('0x20')](0x4,_0x55fce4['length'])['join'](','));break;case'amazonlex':var _0x540390=_0x47def2[_0x90f6('0x1c')]['split'](',');_0x480cd5[_0x90f6('0x1f')](_0x540390[0x0]);_0x480cd5[_0x90f6('0x1f')](_0x540390[0x1]);_0x480cd5['push'](_0x540390[0x2]);_0x480cd5['push'](_0x540390[0x3]);_0x480cd5['push'](_0x540390[_0x90f6('0x20')](0x4,_0x540390[_0x90f6('0x18')])[_0x90f6('0x21')](','));break;case _0x90f6('0x14'):_0x480cd5[_0x90f6('0x1f')](_0x47def2[_0x90f6('0x1c')]);break;case _0x90f6('0x23'):_0x480cd5['push'](_0x47def2[_0x90f6('0x24')]);_0x480cd5[_0x90f6('0x1f')](_0x47def2[_0x90f6('0x1c')]);break;case _0x90f6('0x25'):var _0x2e5147=utils['getMustacheRender'](_0x598737[_0x90f6('0x26')][_0x90f6('0x27')],_0x598737);var _0xfb0c7e=_0x47def2[_0x90f6('0x1c')][_0x90f6('0x1d')](',');_0x480cd5[_0x90f6('0x1f')](_0xfb0c7e[0x0]);_0x480cd5[_0x90f6('0x1f')](_0xfb0c7e[0x1]);_0x480cd5['push'](_0xfb0c7e[0x2]);_0x480cd5[_0x90f6('0x1f')](_0xfb0c7e[0x3]);_0x480cd5[_0x90f6('0x1f')](_0xfb0c7e[0x4]);_0x480cd5[_0x90f6('0x1f')](_0xfb0c7e[0x5]);_0x480cd5[_0x90f6('0x1f')](_0xfb0c7e[0x6]);_0x480cd5[_0x90f6('0x1f')](_0xfb0c7e[0x7]);_0x480cd5[_0x90f6('0x1f')](_0xfb0c7e[0x8]);_0x480cd5[_0x90f6('0x1f')](_0xfb0c7e[0x9]);_0x480cd5[_0x90f6('0x1f')](_0xfb0c7e[0xa]);_0x480cd5[_0x90f6('0x1f')](_0x598737[_0x90f6('0x15')]['id']);_0x480cd5[_0x90f6('0x1f')](_0x598737[_0x90f6('0x14')]['id']);_0x480cd5[_0x90f6('0x1f')](_0x47def2['ChatWebsiteId']);_0x480cd5[_0x90f6('0x1f')](_0x598737[_0x90f6('0x15')][_0x90f6('0x28')]);_0x480cd5[_0x90f6('0x1f')](_0x598737[_0x90f6('0x29')][_0x90f6('0x29')]);_0x480cd5['push'](_0x2e5147);break;default:_0x480cd5=_['isNil'](_0x47def2[_0x90f6('0x1c')])?[]:_0x47def2[_0x90f6('0x1c')][_0x90f6('0x1d')](',');}var _0x56e654={'id':util[_0x90f6('0xb')](_0x90f6('0x2a'),_0x3b4d5d,_0x47def2['id'],_0x47def2['app']),'condition':require(_0x90f6('0x2b'))[_0x90f6('0x2c')](_0x3b4d5d,getIntervals(_0x47fd3c['intervals'],_0x47def2),_0x47fd3c),'consequence':require('./applications/'+_0x47def2['app'])[_0x90f6('0x2d')](_0x3b4d5d,_0x480cd5,_0x47fd3c,_0x598737),'p':_0x47def2['priority']||0x0};logger['info'](_0x90f6('0x2e'),_0x56e654['id'],_0x90f6('0x2f'),getIntervals(_0x47fd3c['intervals'],_0x47def2)['join'](_0x90f6('0x30')));_0x2844bd[_0x90f6('0x1f')](_0x56e654);}else{logger[_0x90f6('0x31')](_0x90f6('0x32'),path[_0x90f6('0x21')](__dirname,_0x90f6('0x17'),_0x47def2[_0x90f6('0x1a')]+_0x90f6('0x33')));}}_0x47fd3c[_0x90f6('0x12')][_0x3b4d5d]=new RuleEngine(_0x2844bd);_0x47fd3c[_0x90f6('0x12')][_0x3b4d5d][_0x90f6('0x34')](_0x598737,function(_0x8a6da2){logger[_0x90f6('0x35')](_0x90f6('0x36'),JSON[_0x90f6('0x37')](_0x8a6da2[_0x90f6('0x38')]));if(_0x47fd3c[_0x90f6('0x12')][_0x3b4d5d]){_0x47fd3c['rules'][_0x3b4d5d][_0x90f6('0x39')]('complete');}});return _0x16d692({'code':0xc8,'message':_0x598737});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x16d692({'code':0xc8,'message':_0x598737});}}catch(_0x35316d){logger[_0x90f6('0x31')](_0x35316d[_0x90f6('0x3a')]);return _0x18ae4b(_0x85ba42['error'](0x1f4,_0x35316d));}}return _0x18ae4b('routing\x20is\x20empty');});},'AcceptMessage':function(_0x32eace){var _0x120e5f=this;return new Promise(function(_0x40dbb4,_0x2dd66d){if(_0x32eace['agent']&&_0x32eace['agent']['id']){if(_0x47fd3c[_0x90f6('0x3b')][_0x32eace['agent']['id']]){_0x47fd3c['agents'][_0x32eace[_0x90f6('0x3c')]['id']][_0x90f6('0x3d')]=![];_0x47fd3c['agents'][_0x32eace[_0x90f6('0x3c')]['id']][_0x90f6('0x3e')]=undefined;}}if(_0x32eace['message']&&_0x32eace[_0x90f6('0x14')]['id']){try{var _0xa75b0b=getId(_0x32eace[_0x90f6('0x13')],_0x32eace[_0x90f6('0x14')]?_0x32eace[_0x90f6('0x14')]['id']:0x0,_0x32eace[_0x90f6('0x15')]?_0x32eace[_0x90f6('0x15')]['id']:0x0);if(_0x47fd3c[_0x90f6('0x12')][_0xa75b0b]){_0x47fd3c[_0x90f6('0x12')][_0xa75b0b][_0x90f6('0x39')](_0x90f6('0x3f'));if(rpc[_0x32eace[_0x90f6('0x13')]+_0x90f6('0x40')]){rpc[_0x32eace[_0x90f6('0x13')]+'QueueReport'][_0x90f6('0x41')](_0xa75b0b,{'UserId':_0x32eace[_0x90f6('0x14')]['UserId']})[_0x90f6('0x42')](function(_0x84b36f){logger[_0x90f6('0x31')](_0x90f6('0x43'));});}}return _0x40dbb4({'code':0xc8,'message':_0x32eace});}catch(_0x482b67){logger['error'](_0x482b67[_0x90f6('0x3a')]);return _0x2dd66d(_0x120e5f[_0x90f6('0x31')](0x1f4,_0x482b67));}}logger[_0x90f6('0x31')](_0x90f6('0x44'));return _0x2dd66d(_0x120e5f[_0x90f6('0x31')](0x1f4,_0x90f6('0x44')));});},'RejectMessage':function(_0x3f52f8){var _0x3721f9=this;return new Promise(function(_0x231d58,_0x2ec301){if(_0x3f52f8['agent']&&_0x3f52f8[_0x90f6('0x3c')]['id']){try{if(_0x47fd3c[_0x90f6('0x3b')][_0x3f52f8['agent']['id']]){_0x47fd3c[_0x90f6('0x3b')][_0x3f52f8['agent']['id']][_0x90f6('0x3d')]=![];_0x47fd3c['agents'][_0x3f52f8['agent']['id']][_0x90f6('0x3e')]=undefined;}return _0x231d58({'code':0xc8,'message':_0x3f52f8});}catch(_0x4de5be){logger['error'](_0x4de5be['stack']);return _0x2ec301(_0x3721f9[_0x90f6('0x31')](0x1f4,_0x4de5be));}}logger[_0x90f6('0x31')](_0x90f6('0x44'));return _0x2ec301(_0x3721f9[_0x90f6('0x31')](0x1f4,_0x90f6('0x44')));});},'AbandonInteraction':function(_0x3b1a7a){var _0x700a50=this;return new Promise(function(_0x4756a2,_0x312ff1){if(_0x3b1a7a[_0x90f6('0x13')]&&_0x3b1a7a[_0x90f6('0x15')]&&_0x3b1a7a[_0x90f6('0x15')]['id']){try{var _0x2df236=getId(_0x3b1a7a[_0x90f6('0x13')],_0x3b1a7a[_0x90f6('0x14')]?_0x3b1a7a[_0x90f6('0x14')]['id']:0x0,_0x3b1a7a['interaction']?_0x3b1a7a['interaction']['id']:0x0);if(_0x47fd3c[_0x90f6('0x12')][_0x2df236]){_0x47fd3c[_0x90f6('0x12')][_0x2df236][_0x90f6('0x39')](_0x90f6('0x3f'));}return _0x4756a2({'code':0xc8,'message':_0x3b1a7a});}catch(_0x26bb97){logger[_0x90f6('0x31')](_0x26bb97['stack']);return _0x312ff1(_0x700a50[_0x90f6('0x31')](0x1f4,_0x26bb97));}}logger['error'](_0x90f6('0x44'));return _0x312ff1(_0x700a50['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x10d7d3){var _0x24ef68=this;return new Promise(function(_0x1e5cdc,_0x6ad30d){if(_0x47fd3c[_0x90f6('0x3b')][_0x90f6('0x45')](_0x10d7d3['id'])){for(var _0x336061 in _0x10d7d3[_0x90f6('0x46')]){if(_0x10d7d3['capacity']['hasOwnProperty'](_0x336061)){if(_0x47fd3c['agents'][_0x10d7d3['id']]['hasOwnProperty'](_0x336061+'CurrentCapacity')){_0x47fd3c[_0x90f6('0x3b')][_0x10d7d3['id']][_0x336061+'CurrentCapacity']=parseInt(_0x10d7d3['capacity'][_0x336061],0xa);}}}_0x47fd3c[_0x90f6('0x3b')][_0x10d7d3['id']][_0x90f6('0x47')]();return _0x1e5cdc({'code':0xc8,'message':_0x47fd3c['agents'][_0x10d7d3['id']]});}else{return _0x6ad30d(_0x24ef68['error'](0x1f4,_0x90f6('0x48')));}});},'Agents':function(_0x178a8f){return new Promise(function(_0x3577b5,_0x4792f3){var _0x219307=_[_0x90f6('0x49')](_0x47fd3c[_0x90f6('0x3b')]);_0x3577b5({'count':_0x219307[_0x90f6('0x18')],'rows':_0x219307});});},'ChatQueues':function(_0x4bd463){return new Promise(function(_0x30e8e2,_0x2e87d5){var _0x2bd185=[];for(var _0x54fa22 in _0x47fd3c[_0x90f6('0x4a')]){if(_0x47fd3c['chatQueues'][_0x90f6('0x45')](_0x54fa22)){var _0x3c3592=_0x47fd3c[_0x90f6('0x4a')][_0x54fa22];var _0x189947={'id':_0x3c3592['id'],'available':_0x3c3592[_0x90f6('0x4b')],'loggedIn':_0x3c3592[_0x90f6('0x4c')],'name':_0x3c3592[_0x90f6('0x4d')],'paused':_0x3c3592[_0x90f6('0x4e')],'waiting':_0x3c3592[_0x90f6('0x4f')]};_0x2bd185[_0x90f6('0x1f')](_0x189947);}}_0x30e8e2({'count':_0x2bd185[_0x90f6('0x18')],'rows':_0x2bd185});});},'MailQueues':function(_0xa1fb96){return new Promise(function(_0x1e009a,_0x327856){var _0x26d94a=[];for(var _0x41de9f in _0x47fd3c[_0x90f6('0x50')]){if(_0x47fd3c['mailQueues'][_0x90f6('0x45')](_0x41de9f)){var _0x2e2cbf=_0x47fd3c[_0x90f6('0x50')][_0x41de9f];var _0x370315={'id':_0x2e2cbf['id'],'available':_0x2e2cbf[_0x90f6('0x4b')],'loggedIn':_0x2e2cbf[_0x90f6('0x4c')],'name':_0x2e2cbf['name'],'paused':_0x2e2cbf[_0x90f6('0x4e')],'waiting':_0x2e2cbf[_0x90f6('0x4f')]};_0x26d94a[_0x90f6('0x1f')](_0x370315);}}_0x1e009a({'count':_0x26d94a[_0x90f6('0x18')],'rows':_0x26d94a});});},'OpenchannelQueues':function(_0x3a1d28){return new Promise(function(_0x5eccd2,_0x57e033){var _0x29f0fc=[];for(var _0x5e39dc in _0x47fd3c[_0x90f6('0x51')]){if(_0x47fd3c['openchannelQueues']['hasOwnProperty'](_0x5e39dc)){var _0x5e78fa=_0x47fd3c[_0x90f6('0x51')][_0x5e39dc];var _0x2fce32={'id':_0x5e78fa['id'],'available':_0x5e78fa[_0x90f6('0x4b')],'loggedIn':_0x5e78fa['loggedIn'],'name':_0x5e78fa[_0x90f6('0x4d')],'paused':_0x5e78fa['paused'],'waiting':_0x5e78fa['waiting']};_0x29f0fc[_0x90f6('0x1f')](_0x2fce32);}}_0x5eccd2({'count':_0x29f0fc[_0x90f6('0x18')],'rows':_0x29f0fc});});},'SmsQueues':function(_0x537d42){return new Promise(function(_0x2442b0,_0x47c3eb){var _0x112d76=[];for(var _0x4a6836 in _0x47fd3c[_0x90f6('0x52')]){if(_0x47fd3c[_0x90f6('0x52')]['hasOwnProperty'](_0x4a6836)){var _0x2822df=_0x47fd3c['smsQueues'][_0x4a6836];var _0x1dfe1b={'id':_0x2822df['id'],'available':_0x2822df['available'],'loggedIn':_0x2822df[_0x90f6('0x4c')],'name':_0x2822df[_0x90f6('0x4d')],'paused':_0x2822df['paused'],'waiting':_0x2822df[_0x90f6('0x4f')]};_0x112d76['push'](_0x1dfe1b);}}_0x2442b0({'count':_0x112d76['length'],'rows':_0x112d76});});},'FaxQueues':function(_0x13b757){return new Promise(function(_0x1ceb20,_0x6b583a){var _0x59ec98=[];for(var _0x3d0357 in _0x47fd3c['faxQueues']){if(_0x47fd3c[_0x90f6('0x53')]['hasOwnProperty'](_0x3d0357)){var _0x32d5be=_0x47fd3c[_0x90f6('0x53')][_0x3d0357];var _0x1b8b45={'id':_0x32d5be['id'],'available':_0x32d5be[_0x90f6('0x4b')],'loggedIn':_0x32d5be['loggedIn'],'name':_0x32d5be[_0x90f6('0x4d')],'paused':_0x32d5be[_0x90f6('0x4e')],'waiting':_0x32d5be['waiting']};_0x59ec98['push'](_0x1b8b45);}}_0x1ceb20({'count':_0x59ec98[_0x90f6('0x18')],'rows':_0x59ec98});});},'WhatsappQueues':function(_0x1df5a8){return new Promise(function(_0x3e8ea8,_0x48b972){var _0x52ec78=[];for(var _0x47811f in _0x47fd3c[_0x90f6('0x54')]){if(_0x47fd3c[_0x90f6('0x54')][_0x90f6('0x45')](_0x47811f)){var _0x4e0bcb=_0x47fd3c[_0x90f6('0x54')][_0x47811f];var _0x13e4e9={'id':_0x4e0bcb['id'],'available':_0x4e0bcb['available'],'loggedIn':_0x4e0bcb[_0x90f6('0x4c')],'name':_0x4e0bcb[_0x90f6('0x4d')],'paused':_0x4e0bcb[_0x90f6('0x4e')],'waiting':_0x4e0bcb[_0x90f6('0x4f')]};_0x52ec78[_0x90f6('0x1f')](_0x13e4e9);}}_0x3e8ea8({'count':_0x52ec78[_0x90f6('0x18')],'rows':_0x52ec78});});},'ChatQueuesWaitingInteractions':function(_0x8b497d){return new Promise(function(_0x753698,_0x306d90){var _0x481e55=_[_0x90f6('0x49')](_0x47fd3c[_0x90f6('0x55')]);_0x753698({'count':_0x481e55[_0x90f6('0x18')],'rows':_0x481e55});});},'MailQueuesWaitingInteractions':function(_0x220d85){return new Promise(function(_0x50495c,_0x3cfd47){var _0x3e4cc9=_['values'](_0x47fd3c[_0x90f6('0x56')]);_0x50495c({'count':_0x3e4cc9[_0x90f6('0x18')],'rows':_0x3e4cc9});});},'OpenchannelQueuesWaitingInteractions':function(_0x1668de){return new Promise(function(_0x578b35,_0x48c9c0){var _0x18bc72=_['values'](_0x47fd3c[_0x90f6('0x57')]);_0x578b35({'count':_0x18bc72[_0x90f6('0x18')],'rows':_0x18bc72});});},'SmsQueuesWaitingInteractions':function(_0xa4aea9){return new Promise(function(_0x46e5aa,_0x1b3e34){var _0x4e3fda=_[_0x90f6('0x49')](_0x47fd3c[_0x90f6('0x58')]);_0x46e5aa({'count':_0x4e3fda['length'],'rows':_0x4e3fda});});},'FaxQueuesWaitingInteractions':function(_0x53f0b3){return new Promise(function(_0x28b201,_0x32534f){var _0x222acc=_[_0x90f6('0x49')](_0x47fd3c[_0x90f6('0x59')]);_0x28b201({'count':_0x222acc[_0x90f6('0x18')],'rows':_0x222acc});});},'WhatsappQueuesWaitingInteractions':function(_0x332da9){return new Promise(function(_0x31ea6f,_0x5ad1af){var _0x37ee12=_[_0x90f6('0x49')](_0x47fd3c[_0x90f6('0x5a')]);_0x31ea6f({'count':_0x37ee12['length'],'rows':_0x37ee12});});}};var _0x36941e=jayson[_0x90f6('0x5b')](_0x36803b)['http']();_0x36941e['on'](_0x90f6('0x31'),function(_0x2fd1f8){logger['error'](JSON['stringify'](_0x2fd1f8));return _0x5d7ab9(_0x2fd1f8);});_0x36941e[_0x90f6('0x11')](0x232c,'127.0.0.1',function(){console[_0x90f6('0x5c')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x5b10af(_0x90f6('0x5d')+0x232c);});});};
\ No newline at end of file
index ab1c337..04b63c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7779=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','request','then','error','message','result','catch','rules','info'];(function(_0x22b6e5,_0x2819c8){var _0x1c21e5=function(_0x18a52c){while(--_0x18a52c){_0x22b6e5['push'](_0x22b6e5['shift']());}};_0x1c21e5(++_0x2819c8);}(_0x7779,0x1a4));var _0x9777=function(_0x9f27a3,_0x3716d9){_0x9f27a3=_0x9f27a3-0x0;var _0x1e712e=_0x7779[_0x9f27a3];return _0x1e712e;};'use strict';var util=require('util');var BPromise=require(_0x9777('0x0'));var jayson=require(_0x9777('0x1'));var _=require(_0x9777('0x2'));var logger=require(_0x9777('0x3'))(_0x9777('0x4'));var client=jayson[_0x9777('0x5')]['http']({'port':0x232a});function request(_0x37c834,_0x2cf9c9){return new BPromise(function(_0x36758f,_0x3e2be9){return client[_0x9777('0x6')](_0x37c834,_0x2cf9c9)[_0x9777('0x7')](function(_0x1ae683){if(_0x1ae683[_0x9777('0x8')]){return _0x3e2be9(_0x1ae683['error'][_0x9777('0x9')]);}else{return _0x36758f(_0x1ae683[_0x9777('0xa')]);}})[_0x9777('0xb')](function(_0x2d87c7){return _0x3e2be9(_0x2d87c7);});});}exports['condition']=function(_0x53b6a1,_0x154468,_0x403b3a){return function(_0x1e7cfe){if(_0x403b3a[_0x9777('0xc')]&&!_0x403b3a[_0x9777('0xc')][_0x53b6a1]){logger[_0x9777('0xd')](_0x9777('0xe'),_0x53b6a1);return _0x1e7cfe[_0x9777('0xf')]();}var _0x15386c=[];for(var _0x56261c=0x0;_0x56261c<_0x154468[_0x9777('0x10')];_0x56261c+=0x1){_0x15386c[_0x9777('0x11')](request(_0x9777('0x12'),{'command':util[_0x9777('0x13')]('iftime\x20%s',_0x154468[_0x56261c])})['then'](function(_0x1c423e){return _0x1c423e&&_0x1c423e['message']&&_0x1c423e[_0x9777('0x9')][_0x9777('0x14')](_0x9777('0x15'))>=0x0?!![]:![];})[_0x9777('0xb')](function(_0x180e8f){logger[_0x9777('0x8')](_0x9777('0x16'),_0x53b6a1,_0x154468[_0x56261c]);}));}BPromise[_0x9777('0x17')](_0x15386c)[_0x9777('0x7')](function(_0x5b28e6){var _0x514d56=_[_0x9777('0x18')](_0x5b28e6);logger[_0x9777('0xd')](_0x9777('0x19'),_0x53b6a1,_0x154468[_0x9777('0x1a')](_0x9777('0x1b')),_0x514d56);_0x1e7cfe[_0x9777('0x1c')](_0x514d56);})[_0x9777('0xb')](function(_0x5d5a57){console[_0x9777('0x1d')](_0x5d5a57);logger[_0x9777('0x8')](_0x9777('0x19'),_0x53b6a1,_0x154468[_0x9777('0x1a')](_0x9777('0x1b')),_0x5d5a57[_0x9777('0x1e')]);_0x1e7cfe['stop']();});};};
\ No newline at end of file
+var _0xda71=['log','\x20|\x20','stack','stop','util','bluebird','jayson/promise','lodash','routing','client','http','request','then','error','message','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','push','format','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join'];(function(_0x276671,_0x193f44){var _0x36c326=function(_0x44f57e){while(--_0x44f57e){_0x276671['push'](_0x276671['shift']());}};_0x36c326(++_0x193f44);}(_0xda71,0x19a));var _0x1da7=function(_0x659e3c,_0x456f35){_0x659e3c=_0x659e3c-0x0;var _0x24fa19=_0xda71[_0x659e3c];return _0x24fa19;};'use strict';var util=require(_0x1da7('0x0'));var BPromise=require(_0x1da7('0x1'));var jayson=require(_0x1da7('0x2'));var _=require(_0x1da7('0x3'));var logger=require('../../../config/logger')(_0x1da7('0x4'));var client=jayson[_0x1da7('0x5')][_0x1da7('0x6')]({'port':0x232a});function request(_0x1a2ff7,_0x4fe212){return new BPromise(function(_0x155b73,_0x2477d3){return client[_0x1da7('0x7')](_0x1a2ff7,_0x4fe212)[_0x1da7('0x8')](function(_0xe7cc73){if(_0xe7cc73[_0x1da7('0x9')]){return _0x2477d3(_0xe7cc73[_0x1da7('0x9')][_0x1da7('0xa')]);}else{return _0x155b73(_0xe7cc73[_0x1da7('0xb')]);}})[_0x1da7('0xc')](function(_0x5aa9ff){return _0x2477d3(_0x5aa9ff);});});}exports['condition']=function(_0x3cd850,_0x54ab1b,_0x52dcc5){return function(_0x4aefdf){if(_0x52dcc5[_0x1da7('0xd')]&&!_0x52dcc5[_0x1da7('0xd')][_0x3cd850]){logger[_0x1da7('0xe')](_0x1da7('0xf'),_0x3cd850);return _0x4aefdf['stop']();}var _0x2d831f=[];for(var _0x90dcc0=0x0;_0x90dcc0<_0x54ab1b['length'];_0x90dcc0+=0x1){_0x2d831f[_0x1da7('0x10')](request('Command',{'command':util[_0x1da7('0x11')](_0x1da7('0x12'),_0x54ab1b[_0x90dcc0])})[_0x1da7('0x8')](function(_0x5d551b){return _0x5d551b&&_0x5d551b['message']&&_0x5d551b[_0x1da7('0xa')]['indexOf'](_0x1da7('0x13'))>=0x0?!![]:![];})[_0x1da7('0xc')](function(_0x5dc773){logger['error'](_0x1da7('0x14'),_0x3cd850,_0x54ab1b[_0x90dcc0]);}));}BPromise[_0x1da7('0x15')](_0x2d831f)[_0x1da7('0x8')](function(_0x3c97d0){var _0x4e547c=_[_0x1da7('0x16')](_0x3c97d0);logger['info'](_0x1da7('0x17'),_0x3cd850,_0x54ab1b[_0x1da7('0x18')]('\x20|\x20'),_0x4e547c);_0x4aefdf['when'](_0x4e547c);})[_0x1da7('0xc')](function(_0x5998d3){console[_0x1da7('0x19')](_0x5998d3);logger[_0x1da7('0x9')](_0x1da7('0x17'),_0x3cd850,_0x54ab1b[_0x1da7('0x18')](_0x1da7('0x1a')),_0x5998d3[_0x1da7('0x1b')]);_0x4aefdf[_0x1da7('0x1c')]();});};};
\ No newline at end of file
index 0727198..a17e44f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb74=['timeout','reason','holdtime','ringtime','talktime','push','error','includes','debug','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','agentcomplete','agentcompleteAt','diffTime','agentconnectAt','complete','[%s][agents][agentcomplete]','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','calleridnum','calleridname','ATTENDED','transfertargetuniqueid','clone','[%s][agents][attendedtransfer]','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','agent','lodash','util','./utils','info','format','uniqueid','channel','queue','membername','interface','connectedlinenum','getVoiceQueueByName','type','agentacw','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb74,0xe3));var _0x4eb7=function(_0x17cfc1,_0x6646ca){_0x17cfc1=_0x17cfc1-0x0;var _0x15ac65=_0xeb74[_0x17cfc1];return _0x15ac65;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var utils=require(_0x4eb7('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x9b674c,_0x2b5a60){utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x9b674c[_0x4eb7('0x5')],_0x9b674c[_0x4eb7('0x6')],_0x9b674c[_0x4eb7('0x7')],_0x9b674c[_0x4eb7('0x8')],_0x9b674c[_0x4eb7('0x9')],_0x9b674c['calleridnum'],_0x9b674c[_0x4eb7('0xa')],_0x9b674c['lastevent']));if(_0x9b674c[_0x4eb7('0x7')]){utils[_0x4eb7('0xb')](_0x9b674c['queue'])['then'](function(_0xe07330){if(_0xe07330){_0x9b674c[_0x4eb7('0xc')]=_0xe07330['type'];_0x9b674c[_0x4eb7('0xd')]=_0x9b674c['agentcomplete']?_0xe07330[_0x4eb7('0xe')]:![];_0x9b674c[_0x4eb7('0xf')]=_0x9b674c[_0x4eb7('0xd')]?_0xe07330['acwTimeout']:0x0;}utils[_0x4eb7('0x10')](_0x4eb7('0x11'),_0x9b674c);});}else{utils[_0x4eb7('0x10')](_0x4eb7('0x11'),_0x9b674c);}if(_0x2b5a60){delete transfers[_0x9b674c[_0x4eb7('0x5')]];}else{delete agents[_0x9b674c[_0x4eb7('0x12')]];}}exports[_0x4eb7('0x13')]=function(_0x4c27a4){try{utils['debug'](util['format'](_0x4eb7('0x14'),_0x4c27a4['uniqueid']),_0x4c27a4);agents[_0x4c27a4[_0x4eb7('0x12')]]=_0x4c27a4;agents[_0x4c27a4[_0x4eb7('0x12')]][_0x4eb7('0x15')]=utils[_0x4eb7('0x16')]();agents[_0x4c27a4[_0x4eb7('0x12')]][_0x4eb7('0x17')]=_0x4eb7('0x18');agents[_0x4c27a4[_0x4eb7('0x12')]][_0x4eb7('0xa')]=null;agents[_0x4c27a4[_0x4eb7('0x12')]]['connectedlinename']=null;utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x19'),_0x4c27a4[_0x4eb7('0x5')],agents[_0x4c27a4[_0x4eb7('0x12')]][_0x4eb7('0x8')],_0x4c27a4[_0x4eb7('0x12')]));}catch(_0x16c024){utils['error'](util[_0x4eb7('0x4')](_0x4eb7('0x14'),_0x4c27a4[_0x4eb7('0x5')]),_0x16c024);}};exports[_0x4eb7('0x1a')]=function(_0x32f0f5){try{if(!_[_0x4eb7('0x1b')](agents[_0x32f0f5[_0x4eb7('0x12')]])){utils['debug'](util[_0x4eb7('0x4')](_0x4eb7('0x1c'),_0x32f0f5[_0x4eb7('0x5')]),_0x32f0f5);utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x1d'),_0x32f0f5[_0x4eb7('0x5')],agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x8')],_0x32f0f5[_0x4eb7('0x12')]));agents[_0x32f0f5['destuniqueid']][_0x4eb7('0x1a')]=!![];agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x1e')]=utils[_0x4eb7('0x16')]();agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x17')]=_0x4eb7('0x1f');agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x20')]=_0x4eb7('0x1f');agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x21')]=_0x32f0f5[_0x4eb7('0x22')]?parseInt(_0x32f0f5[_0x4eb7('0x22')])/0x3e8:0x0;agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x23')]=0x0;unanswered[_0x4eb7('0x24')](_0x32f0f5[_0x4eb7('0x12')]);}}catch(_0x33a2c1){utils[_0x4eb7('0x25')](util[_0x4eb7('0x4')](_0x4eb7('0x1c'),_0x32f0f5[_0x4eb7('0x5')]),_0x33a2c1);}};exports['queuecallerabandon']=function(_0x34515c){try{_['forIn'](agents,function(_0x446872,_0x13f71a){if(_0x446872[_0x4eb7('0x5')]==_0x34515c[_0x4eb7('0x5')]&&!_[_0x4eb7('0x26')](unanswered,_0x446872[_0x4eb7('0x12')])){utils[_0x4eb7('0x27')](util[_0x4eb7('0x4')](_0x4eb7('0x28'),_0x34515c['uniqueid']),_0x34515c);utils[_0x4eb7('0x3')](util['format'](_0x4eb7('0x29'),_0x34515c[_0x4eb7('0x5')],_0x446872['membername'],_0x446872['destuniqueid']));_0x446872[_0x4eb7('0x1a')]=!![];_0x446872[_0x4eb7('0x1e')]=utils[_0x4eb7('0x16')]();_0x446872[_0x4eb7('0x17')]='abandoned';_0x446872[_0x4eb7('0x20')]=_0x4eb7('0x2a');_0x446872[_0x4eb7('0x21')]=_0x34515c[_0x4eb7('0x21')];_0x446872[_0x4eb7('0x23')]=0x0;writeDB(_0x446872);}});}catch(_0x5ab58d){utils[_0x4eb7('0x25')](util[_0x4eb7('0x4')](_0x4eb7('0x28'),_0x34515c['uniqueid']),_0x5ab58d);}};exports[_0x4eb7('0x2b')]=function(_0xe1cc8f){try{if(agents[_0xe1cc8f[_0x4eb7('0x12')]]){utils['debug'](util[_0x4eb7('0x4')]('[%s][agents][agentconnect]',_0xe1cc8f[_0x4eb7('0x5')]),_0xe1cc8f);utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x2c'),_0xe1cc8f['uniqueid'],agents[_0xe1cc8f[_0x4eb7('0x12')]][_0x4eb7('0x8')],_0xe1cc8f[_0x4eb7('0x12')]));agents[_0xe1cc8f[_0x4eb7('0x12')]]['agentconnectAt']=utils['now']();agents[_0xe1cc8f['destuniqueid']][_0x4eb7('0xa')]=_0xe1cc8f[_0x4eb7('0xa')];agents[_0xe1cc8f[_0x4eb7('0x12')]][_0x4eb7('0x2d')]=_0xe1cc8f[_0x4eb7('0x2d')];agents[_0xe1cc8f[_0x4eb7('0x12')]][_0x4eb7('0x21')]=_0xe1cc8f[_0x4eb7('0x22')];agents[_0xe1cc8f[_0x4eb7('0x12')]][_0x4eb7('0x17')]='connect';_[_0x4eb7('0x2e')](agents,function(_0x38218f,_0xe04d76){if(_0x38218f[_0x4eb7('0x12')]!=_0xe1cc8f[_0x4eb7('0x12')]&&_0x38218f[_0x4eb7('0x5')]==_0xe1cc8f[_0x4eb7('0x5')]){_0x38218f[_0x4eb7('0x23')]=0x0;_0x38218f[_0x4eb7('0x21')]=_0xe1cc8f[_0x4eb7('0x22')];_0x38218f[_0x4eb7('0x1a')]=!![];_0x38218f[_0x4eb7('0x1e')]=utils[_0x4eb7('0x16')]();_0x38218f[_0x4eb7('0x17')]=_0x4eb7('0x2f');_0x38218f[_0x4eb7('0x20')]=_0x4eb7('0x2f');_0x38218f[_0x4eb7('0x30')]=_0xe1cc8f[_0x4eb7('0x12')];_0x38218f[_0x4eb7('0x31')]=_0xe1cc8f['membername'];writeDB(_0x38218f);}});}}catch(_0x2fd5c2){utils[_0x4eb7('0x25')](util[_0x4eb7('0x4')](_0x4eb7('0x32'),_0xe1cc8f[_0x4eb7('0x5')]),_0x2fd5c2);}};exports[_0x4eb7('0x33')]=function(_0x3cd9e5){try{if(!_[_0x4eb7('0x1b')](agents[_0x3cd9e5[_0x4eb7('0x12')]])){utils['debug'](util[_0x4eb7('0x4')]('[%s][agents][agentcomplete]',_0x3cd9e5[_0x4eb7('0x5')]),_0x3cd9e5);utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3cd9e5[_0x4eb7('0x5')],agents[_0x3cd9e5[_0x4eb7('0x12')]][_0x4eb7('0x8')],_0x3cd9e5[_0x4eb7('0x12')]));agents[_0x3cd9e5['destuniqueid']][_0x4eb7('0x33')]=!![];agents[_0x3cd9e5['destuniqueid']][_0x4eb7('0x34')]=utils[_0x4eb7('0x16')]();agents[_0x3cd9e5[_0x4eb7('0x12')]][_0x4eb7('0x23')]=utils[_0x4eb7('0x35')](agents[_0x3cd9e5['destuniqueid']]['agentcompleteAt'],agents[_0x3cd9e5[_0x4eb7('0x12')]][_0x4eb7('0x36')]);agents[_0x3cd9e5[_0x4eb7('0x12')]][_0x4eb7('0x20')]=_0x3cd9e5[_0x4eb7('0x20')];agents[_0x3cd9e5['destuniqueid']][_0x4eb7('0x17')]=_0x4eb7('0x37');writeDB(agents[_0x3cd9e5['destuniqueid']]);}}catch(_0x22e09c){utils[_0x4eb7('0x25')](util['format'](_0x4eb7('0x38'),_0x3cd9e5[_0x4eb7('0x5')]),_0x22e09c);}};exports[_0x4eb7('0x39')]=function(_0x5774d5){try{if(!_[_0x4eb7('0x1b')](agents[_0x5774d5['transfereruniqueid']])){utils['debug'](util[_0x4eb7('0x4')](_0x4eb7('0x3a'),_0x5774d5[_0x4eb7('0x5')]),_0x5774d5);utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x3b'),_0x5774d5[_0x4eb7('0x5')],agents[_0x5774d5[_0x4eb7('0x3c')]][_0x4eb7('0x8')],agents[_0x5774d5[_0x4eb7('0x3c')]][_0x4eb7('0x5')]));agents[_0x5774d5[_0x4eb7('0x3c')]][_0x4eb7('0x3d')]=!![];agents[_0x5774d5[_0x4eb7('0x3c')]][_0x4eb7('0x3e')]=_0x4eb7('0x3f');agents[_0x5774d5[_0x4eb7('0x3c')]][_0x4eb7('0x40')]=_0x5774d5[_0x4eb7('0x41')];agents[_0x5774d5[_0x4eb7('0x3c')]]['transferuniqueid']=agents[_0x5774d5[_0x4eb7('0x3c')]]['uniqueid'];}}catch(_0x4db5f7){utils[_0x4eb7('0x25')](util[_0x4eb7('0x4')](_0x4eb7('0x3a'),_0x5774d5[_0x4eb7('0x5')]),_0x4db5f7);}};exports[_0x4eb7('0x42')]=function(_0x553736){try{utils['debug'](util[_0x4eb7('0x4')]('[%s][agents][attendedtransfer]',_0x553736[_0x4eb7('0x43')]),_0x553736);if(_0x553736[_0x4eb7('0x43')]==_0x553736[_0x4eb7('0x44')]){if(!_[_0x4eb7('0x1b')](agents[_0x553736['secondtransfereruniqueid']])){utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x45'),_0x553736[_0x4eb7('0x43')],agents[_0x553736['secondtransfereruniqueid']][_0x4eb7('0x8')]));agents[_0x553736[_0x4eb7('0x46')]]['transfer']=!![];agents[_0x553736[_0x4eb7('0x46')]][_0x4eb7('0x3e')]='ATTENDED';agents[_0x553736[_0x4eb7('0x46')]]['transferexten']=_0x553736[_0x4eb7('0x47')];agents[_0x553736['secondtransfereruniqueid']][_0x4eb7('0x48')]=_0x553736[_0x4eb7('0x43')];}if(_0x553736[_0x4eb7('0x49')]&&agents[_0x553736[_0x4eb7('0x49')]]){agents[_0x553736[_0x4eb7('0x49')]][_0x4eb7('0x4a')]=0x1;transfers[_0x553736['transfereeuniqueid']]=_['clone'](agents[_0x553736[_0x4eb7('0x49')]]);transfers[_0x553736[_0x4eb7('0x49')]][_0x4eb7('0x4b')]=agents[_0x553736[_0x4eb7('0x46')]]['calleridnum'];transfers[_0x553736[_0x4eb7('0x49')]][_0x4eb7('0x4c')]=agents[_0x553736['secondtransfereruniqueid']][_0x4eb7('0x4c')];transfers[_0x553736[_0x4eb7('0x49')]][_0x4eb7('0x15')]=utils[_0x4eb7('0x16')]();transfers[_0x553736[_0x4eb7('0x49')]][_0x4eb7('0x36')]=utils[_0x4eb7('0x16')]();transfers[_0x553736['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x553736[_0x4eb7('0x49')]]['agententerreason']=0x2;}}else if(_0x553736[_0x4eb7('0x46')]==_0x553736['secondtransfererlinkedid']){if(!_[_0x4eb7('0x1b')](agents[_0x553736['origtransfereruniqueid']])){utils['info'](util[_0x4eb7('0x4')](_0x4eb7('0x45'),_0x553736['origtransfereruniqueid'],agents[_0x553736[_0x4eb7('0x43')]]['membername']));agents[_0x553736[_0x4eb7('0x43')]][_0x4eb7('0x3d')]=!![];agents[_0x553736['origtransfereruniqueid']][_0x4eb7('0x3e')]=_0x4eb7('0x4d');agents[_0x553736['origtransfereruniqueid']]['transferexten']=_0x553736['secondtransfererexten'];agents[_0x553736['origtransfereruniqueid']][_0x4eb7('0x48')]=_0x553736['secondtransfereruniqueid'];}if(_0x553736[_0x4eb7('0x4e')]&&agents[_0x553736[_0x4eb7('0x4e')]]){agents[_0x553736['transfertargetuniqueid']][_0x4eb7('0x4a')]=0x1;transfers[_0x553736[_0x4eb7('0x4e')]]=_[_0x4eb7('0x4f')](agents[_0x553736[_0x4eb7('0x4e')]]);transfers[_0x553736[_0x4eb7('0x4e')]][_0x4eb7('0x4b')]=agents[_0x553736['origtransfereruniqueid']]['calleridnum'];transfers[_0x553736['transfertargetuniqueid']][_0x4eb7('0x4c')]=agents[_0x553736[_0x4eb7('0x43')]][_0x4eb7('0x4c')];transfers[_0x553736[_0x4eb7('0x4e')]][_0x4eb7('0x15')]=utils['now']();transfers[_0x553736['transfertargetuniqueid']][_0x4eb7('0x36')]=utils[_0x4eb7('0x16')]();transfers[_0x553736[_0x4eb7('0x4e')]][_0x4eb7('0x21')]=0x0;transfers[_0x553736[_0x4eb7('0x4e')]]['agententerreason']=0x2;}}}catch(_0x439861){utils[_0x4eb7('0x25')](util[_0x4eb7('0x4')](_0x4eb7('0x50'),_0x553736['origtransfereruniqueid']),_0x439861);}};exports['hangup']=function(_0x3bcbd1){try{utils[_0x4eb7('0x27')](util['format'](_0x4eb7('0x51'),_0x3bcbd1['uniqueid']),_0x3bcbd1);if(agents[_0x3bcbd1[_0x4eb7('0x5')]]&&agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x20')]===_0x4eb7('0x1f')){if(_0x3bcbd1['cause']==='21'){agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x20')]=_0x4eb7('0x52');agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x17')]=_0x4eb7('0x52');}utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x53'),_0x3bcbd1[_0x4eb7('0x5')],agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x8')],agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x20')],agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x17')]));writeDB(agents[_0x3bcbd1[_0x4eb7('0x5')]]);var _0x31e6d2=unanswered[_0x4eb7('0x54')](_0x3bcbd1['uniqueid']);if(_0x31e6d2>-0x1){unanswered['splice'](_0x31e6d2,0x1);}}if(transfers[_0x3bcbd1[_0x4eb7('0x5')]]){transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x33')]=!![];transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x34')]=utils[_0x4eb7('0x16')]();transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x23')]=utils['diffTime'](transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x34')],transfers[_0x3bcbd1[_0x4eb7('0x5')]]['agentconnectAt']);transfers[_0x3bcbd1['uniqueid']][_0x4eb7('0x20')]=_0x4eb7('0x55');transfers[_0x3bcbd1[_0x4eb7('0x5')]]['lastevent']='complete';utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x53'),_0x3bcbd1[_0x4eb7('0x5')],transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x8')],transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x20')],transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x17')]));writeDB(transfers[_0x3bcbd1[_0x4eb7('0x5')]],!![]);}if(agents[_0x3bcbd1[_0x4eb7('0x5')]]&&agents[_0x3bcbd1['uniqueid']]['agentconnectAt']){agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x33')]=!![];agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x34')]=utils[_0x4eb7('0x16')]();agents[_0x3bcbd1[_0x4eb7('0x5')]]['talktime']=utils['diffTime'](agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x34')],agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x36')]);agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x20')]=agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x3d')]?_0x4eb7('0x3d'):_0x4eb7('0x55');agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x17')]=_0x4eb7('0x37');utils[_0x4eb7('0x3')](util['format'](_0x4eb7('0x53'),_0x3bcbd1[_0x4eb7('0x5')],agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x8')],agents[_0x3bcbd1['uniqueid']][_0x4eb7('0x20')],agents[_0x3bcbd1[_0x4eb7('0x5')]]['lastevent']));writeDB(agents[_0x3bcbd1[_0x4eb7('0x5')]]);}}catch(_0x2448a1){utils[_0x4eb7('0x25')](util['format'](_0x4eb7('0x51'),_0x3bcbd1[_0x4eb7('0x5')]),_0x2448a1);}};
\ No newline at end of file
+var _0x1d2d=['called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','isNil','[%s][agents][agentringnoanswer]','info','agentringnoanswer','now','timeout','reason','holdtime','ringtime','push','error','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','talktime','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','[%s][agents][attendedtransfer]\x20agent:%s','transfertargetuniqueid','hangup','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','format','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','CreateVoiceAgentReport','request','uniqueid','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','lastevent'];(function(_0x5783ad,_0x153b25){var _0x3b5f59=function(_0x46ed1b){while(--_0x46ed1b){_0x5783ad['push'](_0x5783ad['shift']());}};_0x3b5f59(++_0x153b25);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x391993,_0x3d8b06){_0x391993=_0x391993-0x0;var _0x589037=_0x1d2d[_0x391993];return _0x589037;};'use strict';var _=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var utils=require(_0xd1d2('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0xd275bc,_0x3401a9){utils['info'](util[_0xd1d2('0x3')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0xd275bc['uniqueid'],_0xd275bc[_0xd1d2('0x4')],_0xd275bc[_0xd1d2('0x5')],_0xd275bc[_0xd1d2('0x6')],_0xd275bc[_0xd1d2('0x7')],_0xd275bc[_0xd1d2('0x8')],_0xd275bc[_0xd1d2('0x9')],_0xd275bc['lastevent']));if(_0xd275bc[_0xd1d2('0x5')]){utils[_0xd1d2('0xa')](_0xd275bc[_0xd1d2('0x5')])[_0xd1d2('0xb')](function(_0xdba345){if(_0xdba345){_0xd275bc[_0xd1d2('0xc')]=_0xdba345[_0xd1d2('0xc')];_0xd275bc[_0xd1d2('0xd')]=_0xd275bc[_0xd1d2('0xe')]?_0xdba345[_0xd1d2('0xf')]:![];_0xd275bc[_0xd1d2('0x10')]=_0xd275bc[_0xd1d2('0xd')]?_0xdba345[_0xd1d2('0x11')]:0x0;}utils['request'](_0xd1d2('0x12'),_0xd275bc);});}else{utils[_0xd1d2('0x13')](_0xd1d2('0x12'),_0xd275bc);}if(_0x3401a9){delete transfers[_0xd275bc[_0xd1d2('0x14')]];}else{delete agents[_0xd275bc[_0xd1d2('0x15')]];}}exports[_0xd1d2('0x16')]=function(_0x2df8a5){try{utils[_0xd1d2('0x17')](util[_0xd1d2('0x3')](_0xd1d2('0x18'),_0x2df8a5['uniqueid']),_0x2df8a5);agents[_0x2df8a5[_0xd1d2('0x15')]]=_0x2df8a5;agents[_0x2df8a5[_0xd1d2('0x15')]][_0xd1d2('0x19')]=utils['now']();agents[_0x2df8a5[_0xd1d2('0x15')]][_0xd1d2('0x1a')]=_0xd1d2('0x1b');agents[_0x2df8a5[_0xd1d2('0x15')]][_0xd1d2('0x9')]=null;agents[_0x2df8a5[_0xd1d2('0x15')]][_0xd1d2('0x1c')]=null;utils['info'](util['format'](_0xd1d2('0x1d'),_0x2df8a5['uniqueid'],agents[_0x2df8a5[_0xd1d2('0x15')]][_0xd1d2('0x6')],_0x2df8a5[_0xd1d2('0x15')]));}catch(_0x40d3dd){utils['error'](util['format'](_0xd1d2('0x18'),_0x2df8a5['uniqueid']),_0x40d3dd);}};exports['agentringnoanswer']=function(_0x1ab67c){try{if(!_[_0xd1d2('0x1e')](agents[_0x1ab67c[_0xd1d2('0x15')]])){utils[_0xd1d2('0x17')](util['format'](_0xd1d2('0x1f'),_0x1ab67c[_0xd1d2('0x14')]),_0x1ab67c);utils[_0xd1d2('0x20')](util['format']('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x1ab67c[_0xd1d2('0x14')],agents[_0x1ab67c[_0xd1d2('0x15')]][_0xd1d2('0x6')],_0x1ab67c[_0xd1d2('0x15')]));agents[_0x1ab67c[_0xd1d2('0x15')]][_0xd1d2('0x21')]=!![];agents[_0x1ab67c[_0xd1d2('0x15')]]['agentringnoanswerAt']=utils[_0xd1d2('0x22')]();agents[_0x1ab67c[_0xd1d2('0x15')]][_0xd1d2('0x1a')]=_0xd1d2('0x23');agents[_0x1ab67c[_0xd1d2('0x15')]][_0xd1d2('0x24')]=_0xd1d2('0x23');agents[_0x1ab67c[_0xd1d2('0x15')]][_0xd1d2('0x25')]=_0x1ab67c[_0xd1d2('0x26')]?parseInt(_0x1ab67c[_0xd1d2('0x26')])/0x3e8:0x0;agents[_0x1ab67c['destuniqueid']]['talktime']=0x0;unanswered[_0xd1d2('0x27')](_0x1ab67c[_0xd1d2('0x15')]);}}catch(_0x1e6072){utils[_0xd1d2('0x28')](util[_0xd1d2('0x3')]('[%s][agents][agentringnoanswer]',_0x1ab67c[_0xd1d2('0x14')]),_0x1e6072);}};exports[_0xd1d2('0x29')]=function(_0x383947){try{_['forIn'](agents,function(_0x19db00,_0x1db17f){if(_0x19db00[_0xd1d2('0x14')]==_0x383947['uniqueid']&&!_[_0xd1d2('0x2a')](unanswered,_0x19db00[_0xd1d2('0x15')])){utils[_0xd1d2('0x17')](util[_0xd1d2('0x3')](_0xd1d2('0x2b'),_0x383947[_0xd1d2('0x14')]),_0x383947);utils[_0xd1d2('0x20')](util[_0xd1d2('0x3')](_0xd1d2('0x2c'),_0x383947[_0xd1d2('0x14')],_0x19db00[_0xd1d2('0x6')],_0x19db00[_0xd1d2('0x15')]));_0x19db00[_0xd1d2('0x21')]=!![];_0x19db00[_0xd1d2('0x2d')]=utils[_0xd1d2('0x22')]();_0x19db00[_0xd1d2('0x1a')]=_0xd1d2('0x2e');_0x19db00[_0xd1d2('0x24')]='abandoned';_0x19db00[_0xd1d2('0x25')]=_0x383947[_0xd1d2('0x25')];_0x19db00[_0xd1d2('0x2f')]=0x0;writeDB(_0x19db00);}});}catch(_0x573d27){utils[_0xd1d2('0x28')](util['format']('[%s][agents][queuecallerabandon]',_0x383947[_0xd1d2('0x14')]),_0x573d27);}};exports[_0xd1d2('0x30')]=function(_0x1702be){try{if(agents[_0x1702be[_0xd1d2('0x15')]]){utils[_0xd1d2('0x17')](util[_0xd1d2('0x3')]('[%s][agents][agentconnect]',_0x1702be[_0xd1d2('0x14')]),_0x1702be);utils[_0xd1d2('0x20')](util['format'](_0xd1d2('0x31'),_0x1702be[_0xd1d2('0x14')],agents[_0x1702be[_0xd1d2('0x15')]][_0xd1d2('0x6')],_0x1702be['destuniqueid']));agents[_0x1702be['destuniqueid']][_0xd1d2('0x32')]=utils['now']();agents[_0x1702be['destuniqueid']]['connectedlinenum']=_0x1702be[_0xd1d2('0x9')];agents[_0x1702be['destuniqueid']][_0xd1d2('0x1c')]=_0x1702be['connectedlinename'];agents[_0x1702be['destuniqueid']]['holdtime']=_0x1702be[_0xd1d2('0x26')];agents[_0x1702be[_0xd1d2('0x15')]][_0xd1d2('0x1a')]=_0xd1d2('0x33');_[_0xd1d2('0x34')](agents,function(_0xb5bec2,_0x178f8b){if(_0xb5bec2[_0xd1d2('0x15')]!=_0x1702be[_0xd1d2('0x15')]&&_0xb5bec2[_0xd1d2('0x14')]==_0x1702be[_0xd1d2('0x14')]){_0xb5bec2[_0xd1d2('0x2f')]=0x0;_0xb5bec2[_0xd1d2('0x25')]=_0x1702be[_0xd1d2('0x26')];_0xb5bec2['agentringnoanswer']=!![];_0xb5bec2['agentringnoanswerAt']=utils[_0xd1d2('0x22')]();_0xb5bec2[_0xd1d2('0x1a')]=_0xd1d2('0x35');_0xb5bec2['reason']='answered_elsewhere';_0xb5bec2[_0xd1d2('0x36')]=_0x1702be[_0xd1d2('0x15')];_0xb5bec2['answeredelsewheremembername']=_0x1702be[_0xd1d2('0x6')];writeDB(_0xb5bec2);}});}}catch(_0x4c5d49){utils['error'](util[_0xd1d2('0x3')]('[%s][agents][agentconnect]',_0x1702be['uniqueid']),_0x4c5d49);}};exports[_0xd1d2('0xe')]=function(_0x320fa4){try{if(!_[_0xd1d2('0x1e')](agents[_0x320fa4['destuniqueid']])){utils[_0xd1d2('0x17')](util[_0xd1d2('0x3')](_0xd1d2('0x37'),_0x320fa4[_0xd1d2('0x14')]),_0x320fa4);utils['info'](util[_0xd1d2('0x3')](_0xd1d2('0x38'),_0x320fa4['uniqueid'],agents[_0x320fa4[_0xd1d2('0x15')]]['membername'],_0x320fa4[_0xd1d2('0x15')]));agents[_0x320fa4[_0xd1d2('0x15')]][_0xd1d2('0xe')]=!![];agents[_0x320fa4[_0xd1d2('0x15')]][_0xd1d2('0x39')]=utils['now']();agents[_0x320fa4['destuniqueid']][_0xd1d2('0x2f')]=utils[_0xd1d2('0x3a')](agents[_0x320fa4['destuniqueid']][_0xd1d2('0x39')],agents[_0x320fa4[_0xd1d2('0x15')]][_0xd1d2('0x32')]);agents[_0x320fa4[_0xd1d2('0x15')]][_0xd1d2('0x24')]=_0x320fa4[_0xd1d2('0x24')];agents[_0x320fa4[_0xd1d2('0x15')]]['lastevent']=_0xd1d2('0x3b');writeDB(agents[_0x320fa4[_0xd1d2('0x15')]]);}}catch(_0x5594f5){utils[_0xd1d2('0x28')](util[_0xd1d2('0x3')]('[%s][agents][agentcomplete]',_0x320fa4['uniqueid']),_0x5594f5);}};exports[_0xd1d2('0x3c')]=function(_0x182ea8){try{if(!_['isNil'](agents[_0x182ea8[_0xd1d2('0x3d')]])){utils[_0xd1d2('0x17')](util[_0xd1d2('0x3')](_0xd1d2('0x3e'),_0x182ea8[_0xd1d2('0x14')]),_0x182ea8);utils['info'](util['format'](_0xd1d2('0x3f'),_0x182ea8['uniqueid'],agents[_0x182ea8[_0xd1d2('0x3d')]][_0xd1d2('0x6')],agents[_0x182ea8['transfereruniqueid']][_0xd1d2('0x14')]));agents[_0x182ea8[_0xd1d2('0x3d')]]['transfer']=!![];agents[_0x182ea8['transfereruniqueid']][_0xd1d2('0x40')]=_0xd1d2('0x41');agents[_0x182ea8[_0xd1d2('0x3d')]][_0xd1d2('0x42')]=_0x182ea8[_0xd1d2('0x43')];agents[_0x182ea8[_0xd1d2('0x3d')]][_0xd1d2('0x44')]=agents[_0x182ea8[_0xd1d2('0x3d')]][_0xd1d2('0x14')];}}catch(_0x5e15cb){utils[_0xd1d2('0x28')](util['format']('[%s][agents][blindtransfer]',_0x182ea8[_0xd1d2('0x14')]),_0x5e15cb);}};exports[_0xd1d2('0x45')]=function(_0x2cde6b){try{utils[_0xd1d2('0x17')](util[_0xd1d2('0x3')](_0xd1d2('0x46'),_0x2cde6b[_0xd1d2('0x47')]),_0x2cde6b);if(_0x2cde6b[_0xd1d2('0x47')]==_0x2cde6b[_0xd1d2('0x48')]){if(!_[_0xd1d2('0x1e')](agents[_0x2cde6b[_0xd1d2('0x49')]])){utils[_0xd1d2('0x20')](util[_0xd1d2('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x2cde6b['origtransfereruniqueid'],agents[_0x2cde6b[_0xd1d2('0x49')]][_0xd1d2('0x6')]));agents[_0x2cde6b[_0xd1d2('0x49')]][_0xd1d2('0x4a')]=!![];agents[_0x2cde6b[_0xd1d2('0x49')]][_0xd1d2('0x40')]=_0xd1d2('0x4b');agents[_0x2cde6b[_0xd1d2('0x49')]][_0xd1d2('0x42')]=_0x2cde6b[_0xd1d2('0x4c')];agents[_0x2cde6b[_0xd1d2('0x49')]]['transferuniqueid']=_0x2cde6b['origtransfereruniqueid'];}if(_0x2cde6b[_0xd1d2('0x4d')]&&agents[_0x2cde6b[_0xd1d2('0x4d')]]){agents[_0x2cde6b[_0xd1d2('0x4d')]][_0xd1d2('0x4e')]=0x1;transfers[_0x2cde6b['transfereeuniqueid']]=_[_0xd1d2('0x4f')](agents[_0x2cde6b[_0xd1d2('0x4d')]]);transfers[_0x2cde6b[_0xd1d2('0x4d')]][_0xd1d2('0x8')]=agents[_0x2cde6b[_0xd1d2('0x49')]][_0xd1d2('0x8')];transfers[_0x2cde6b[_0xd1d2('0x4d')]]['calleridname']=agents[_0x2cde6b[_0xd1d2('0x49')]][_0xd1d2('0x50')];transfers[_0x2cde6b[_0xd1d2('0x4d')]]['agentcalledAt']=utils['now']();transfers[_0x2cde6b[_0xd1d2('0x4d')]][_0xd1d2('0x32')]=utils[_0xd1d2('0x22')]();transfers[_0x2cde6b[_0xd1d2('0x4d')]]['holdtime']=0x0;transfers[_0x2cde6b[_0xd1d2('0x4d')]][_0xd1d2('0x4e')]=0x2;}}else if(_0x2cde6b[_0xd1d2('0x49')]==_0x2cde6b['secondtransfererlinkedid']){if(!_[_0xd1d2('0x1e')](agents[_0x2cde6b[_0xd1d2('0x47')]])){utils['info'](util[_0xd1d2('0x3')](_0xd1d2('0x51'),_0x2cde6b[_0xd1d2('0x47')],agents[_0x2cde6b[_0xd1d2('0x47')]]['membername']));agents[_0x2cde6b[_0xd1d2('0x47')]][_0xd1d2('0x4a')]=!![];agents[_0x2cde6b[_0xd1d2('0x47')]][_0xd1d2('0x40')]=_0xd1d2('0x4b');agents[_0x2cde6b['origtransfereruniqueid']]['transferexten']=_0x2cde6b['secondtransfererexten'];agents[_0x2cde6b['origtransfereruniqueid']]['transferuniqueid']=_0x2cde6b[_0xd1d2('0x49')];}if(_0x2cde6b[_0xd1d2('0x52')]&&agents[_0x2cde6b[_0xd1d2('0x52')]]){agents[_0x2cde6b['transfertargetuniqueid']][_0xd1d2('0x4e')]=0x1;transfers[_0x2cde6b[_0xd1d2('0x52')]]=_[_0xd1d2('0x4f')](agents[_0x2cde6b['transfertargetuniqueid']]);transfers[_0x2cde6b[_0xd1d2('0x52')]][_0xd1d2('0x8')]=agents[_0x2cde6b[_0xd1d2('0x47')]][_0xd1d2('0x8')];transfers[_0x2cde6b[_0xd1d2('0x52')]][_0xd1d2('0x50')]=agents[_0x2cde6b['origtransfereruniqueid']][_0xd1d2('0x50')];transfers[_0x2cde6b[_0xd1d2('0x52')]]['agentcalledAt']=utils['now']();transfers[_0x2cde6b[_0xd1d2('0x52')]][_0xd1d2('0x32')]=utils[_0xd1d2('0x22')]();transfers[_0x2cde6b[_0xd1d2('0x52')]]['holdtime']=0x0;transfers[_0x2cde6b[_0xd1d2('0x52')]][_0xd1d2('0x4e')]=0x2;}}}catch(_0x3ebf2e){utils[_0xd1d2('0x28')](util['format'](_0xd1d2('0x46'),_0x2cde6b[_0xd1d2('0x47')]),_0x3ebf2e);}};exports[_0xd1d2('0x53')]=function(_0x572b55){try{utils[_0xd1d2('0x17')](util[_0xd1d2('0x3')]('[%s][agents][hangup]',_0x572b55[_0xd1d2('0x14')]),_0x572b55);if(agents[_0x572b55[_0xd1d2('0x14')]]&&agents[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x24')]===_0xd1d2('0x23')){if(_0x572b55['cause']==='21'){agents[_0x572b55[_0xd1d2('0x14')]]['reason']='rejected';agents[_0x572b55['uniqueid']]['lastevent']=_0xd1d2('0x54');}utils['info'](util[_0xd1d2('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x572b55[_0xd1d2('0x14')],agents[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x6')],agents[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x24')],agents[_0x572b55[_0xd1d2('0x14')]]['lastevent']));writeDB(agents[_0x572b55[_0xd1d2('0x14')]]);var _0x25d042=unanswered[_0xd1d2('0x55')](_0x572b55[_0xd1d2('0x14')]);if(_0x25d042>-0x1){unanswered[_0xd1d2('0x56')](_0x25d042,0x1);}}if(transfers[_0x572b55[_0xd1d2('0x14')]]){transfers[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0xe')]=!![];transfers[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x39')]=utils['now']();transfers[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x2f')]=utils[_0xd1d2('0x3a')](transfers[_0x572b55[_0xd1d2('0x14')]]['agentcompleteAt'],transfers[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x32')]);transfers[_0x572b55[_0xd1d2('0x14')]]['reason']=_0xd1d2('0x57');transfers[_0x572b55[_0xd1d2('0x14')]]['lastevent']='complete';utils[_0xd1d2('0x20')](util[_0xd1d2('0x3')](_0xd1d2('0x58'),_0x572b55[_0xd1d2('0x14')],transfers[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x6')],transfers[_0x572b55[_0xd1d2('0x14')]]['reason'],transfers[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x1a')]));writeDB(transfers[_0x572b55[_0xd1d2('0x14')]],!![]);}if(agents[_0x572b55[_0xd1d2('0x14')]]&&agents[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x32')]){agents[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0xe')]=!![];agents[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x39')]=utils[_0xd1d2('0x22')]();agents[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x2f')]=utils[_0xd1d2('0x3a')](agents[_0x572b55['uniqueid']][_0xd1d2('0x39')],agents[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x32')]);agents[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x24')]=agents[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x4a')]?_0xd1d2('0x4a'):_0xd1d2('0x57');agents[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x1a')]=_0xd1d2('0x3b');utils[_0xd1d2('0x20')](util['format'](_0xd1d2('0x58'),_0x572b55[_0xd1d2('0x14')],agents[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x6')],agents[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x24')],agents[_0x572b55[_0xd1d2('0x14')]][_0xd1d2('0x1a')]));writeDB(agents[_0x572b55[_0xd1d2('0x14')]]);}}catch(_0x59c11a){utils[_0xd1d2('0x28')](util[_0xd1d2('0x3')]('[%s][agents][hangup]',_0x572b55[_0xd1d2('0x14')]),_0x59c11a);}};
\ No newline at end of file
index 6b2b0b6..e5cb974 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf8c=['[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr','split','substring','lastIndexOf','includes','noop','execif','set','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','transfereeuniqueid','info','queue','membername','calleridnum','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','recording','newchannel','debug','linkedid','channel','OutgoingSpoolFailed','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','channelstate','format','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','secondtransfererchannel','destinationchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid'];(function(_0x1da8fa,_0xaa843d){var _0x391a2c=function(_0x4fecf4){while(--_0x4fecf4){_0x1da8fa['push'](_0x1da8fa['shift']());}};_0x391a2c(++_0xaa843d);}(_0xcf8c,0xf0));var _0xccf8=function(_0x27a4a3,_0x5e2ef1){_0x27a4a3=_0x27a4a3-0x0;var _0x7d6da7=_0xcf8c[_0x27a4a3];return _0x7d6da7;};'use strict';var _=require(_0xccf8('0x0'));var util=require(_0xccf8('0x1'));var utils=require(_0xccf8('0x2'));var transfers=require(_0xccf8('0x3'));var dispositions=[_0xccf8('0x4'),_0xccf8('0x5'),'FAILED','NO\x20ANSWER',_0xccf8('0x4'),_0xccf8('0x4'),_0xccf8('0x6'),_0xccf8('0x7'),_0xccf8('0x5'),_0xccf8('0x5'),_0xccf8('0x5')];var channels={};function writeDB(_0x25b4da){var _0x3c7887;if(transfers['blinds'][_0x25b4da['uniqueid']]){_0x3c7887=_0x25b4da[_0xccf8('0x8')];_0x25b4da[_0xccf8('0x8')]=transfers[_0xccf8('0x9')][_0x25b4da[_0xccf8('0x8')]][_0xccf8('0xa')];}utils[_0xccf8('0xb')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x25b4da[_0xccf8('0x8')],_0x25b4da['channel'],_0x25b4da[_0xccf8('0xc')],_0x25b4da[_0xccf8('0xd')],_0x25b4da['interface'],_0x25b4da[_0xccf8('0xe')],_0x25b4da['connectedlinenum'],_0x25b4da['lastevent']));if(_0x25b4da[_0xccf8('0xf')]){utils[_0xccf8('0x10')](_0x25b4da[_0xccf8('0xf')])[_0xccf8('0x11')](function(_0x1cab2b){if(_0x1cab2b){_0x25b4da['UserId']=_0x1cab2b['id'];}utils[_0xccf8('0x12')]('CreateVoiceCallReport',_0x25b4da);});}else{utils['request'](_0xccf8('0x13'),_0x25b4da);}if(channels[_0x25b4da[_0xccf8('0x8')]]){delete channels[_0x25b4da[_0xccf8('0x8')]];}else if(_0x3c7887&&channels[_0x3c7887]){if(!transfers[_0xccf8('0x9')][_0x3c7887][_0xccf8('0x14')])delete transfers[_0xccf8('0x9')][_0x3c7887];delete channels[_0x3c7887];}}exports[_0xccf8('0x15')]=function(_0x393267){try{utils[_0xccf8('0x16')](util['format']('[%s][calls][newchannel]',_0x393267[_0xccf8('0x8')]),_0x393267);if(_0x393267[_0xccf8('0x8')]==_0x393267[_0xccf8('0x17')]&&_0x393267[_0xccf8('0x18')]!=_0xccf8('0x19')){utils[_0xccf8('0xb')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x393267[_0xccf8('0x8')],_0x393267[_0xccf8('0x1a')],_0x393267[_0xccf8('0x1b')]));channels[_0x393267[_0xccf8('0x8')]]={'uniqueid':_0x393267['uniqueid'],'accountcode':_0x393267[_0xccf8('0xf')],'source':_0x393267[_0xccf8('0xe')],'destination':_0x393267[_0xccf8('0x1b')],'destinationcontext':_0x393267[_0xccf8('0x1a')],'channel':_0x393267['channel'],'starttime':utils[_0xccf8('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xccf8('0x4'),'amaflags':_0xccf8('0x1d')};}}catch(_0x5ef377){utils[_0xccf8('0x1e')](util['format']('[%s][calls][newchannel]',_0x393267[_0xccf8('0x8')]),_0x5ef377);}};exports[_0xccf8('0x1f')]=function(_0x2a79da){try{utils[_0xccf8('0x16')](util['format'](_0xccf8('0x20'),_0x2a79da[_0xccf8('0x8')]),_0x2a79da);if(!_['isNil'](channels[_0x2a79da[_0xccf8('0x8')]])&&_0x2a79da[_0xccf8('0x21')]==0x6){utils['info'](util[_0xccf8('0x22')](_0xccf8('0x23'),_0x2a79da['uniqueid'],_0x2a79da[_0xccf8('0x1a')],_0x2a79da[_0xccf8('0x18')]));if(_[_0xccf8('0x24')](channels[_0x2a79da[_0xccf8('0x8')]][_0xccf8('0x25')])){channels[_0x2a79da[_0xccf8('0x8')]][_0xccf8('0x25')]=utils[_0xccf8('0x1c')]();}}else if(!_[_0xccf8('0x24')](channels[_0x2a79da[_0xccf8('0x17')]])&&_0x2a79da[_0xccf8('0x21')]==0x6&&_0x2a79da['context']!=_0xccf8('0x26')){utils[_0xccf8('0xb')](util[_0xccf8('0x22')](_0xccf8('0x27'),_0x2a79da[_0xccf8('0x8')],_0x2a79da[_0xccf8('0x17')],_0x2a79da[_0xccf8('0x1a')],_0x2a79da[_0xccf8('0x18')]));channels[_0x2a79da[_0xccf8('0x17')]][_0xccf8('0xf')]=_0x2a79da[_0xccf8('0xf')];channels[_0x2a79da[_0xccf8('0x17')]]['destinationchannel']=_0x2a79da[_0xccf8('0x18')];if(_[_0xccf8('0x24')](channels[_0x2a79da[_0xccf8('0x17')]][_0xccf8('0x28')])){channels[_0x2a79da[_0xccf8('0x17')]][_0xccf8('0x28')]=utils[_0xccf8('0x1c')]();}channels[_0x2a79da[_0xccf8('0x17')]][_0xccf8('0x29')]=dispositions[_[_0xccf8('0x2a')](_0x2a79da['channelstate'])]||_0xccf8('0x6');}}catch(_0x5eac4f){utils[_0xccf8('0x1e')](util[_0xccf8('0x22')]('[%s][calls][newstate]',_0x2a79da[_0xccf8('0x8')]),_0x5eac4f);}};exports['hangup']=function(_0x3c42fe){try{if(!_['isNil'](channels[_0x3c42fe[_0xccf8('0x8')]])){utils[_0xccf8('0x16')](util[_0xccf8('0x22')](_0xccf8('0x2b'),_0x3c42fe[_0xccf8('0x8')]),_0x3c42fe);if(_['isNil'](channels[_0x3c42fe[_0xccf8('0x8')]][_0xccf8('0x2c')])){channels[_0x3c42fe['uniqueid']][_0xccf8('0x2c')]=_0x3c42fe[_0xccf8('0x2d')]+'\x20<'+_0x3c42fe['calleridnum']+'>';}utils['info'](util[_0xccf8('0x22')](_0xccf8('0x2e'),_0x3c42fe['uniqueid'],channels[_0x3c42fe[_0xccf8('0x8')]][_0xccf8('0x2c')],_0x3c42fe['cause-txt']));channels[_0x3c42fe[_0xccf8('0x8')]][_0xccf8('0x2f')]=utils[_0xccf8('0x1c')]();channels[_0x3c42fe['uniqueid']][_0xccf8('0x30')]=utils[_0xccf8('0x31')](channels[_0x3c42fe[_0xccf8('0x8')]][_0xccf8('0x2f')],channels[_0x3c42fe['uniqueid']][_0xccf8('0x32')]);channels[_0x3c42fe[_0xccf8('0x8')]][_0xccf8('0x33')]=channels[_0x3c42fe[_0xccf8('0x8')]][_0xccf8('0x28')]?utils[_0xccf8('0x31')](channels[_0x3c42fe['uniqueid']][_0xccf8('0x2f')],channels[_0x3c42fe[_0xccf8('0x8')]]['answertime']):0x0;writeDB(channels[_0x3c42fe[_0xccf8('0x8')]]);}}catch(_0x37608d){utils['error'](util[_0xccf8('0x22')](_0xccf8('0x2b'),_0x3c42fe[_0xccf8('0x8')]),_0x37608d);}};exports[_0xccf8('0x34')]=function(_0x3e9eb3){try{if(!_[_0xccf8('0x24')](channels[_0x3e9eb3['localtwolinkedid']])){utils[_0xccf8('0x16')](util[_0xccf8('0x22')](_0xccf8('0x35'),_0x3e9eb3[_0xccf8('0x36')]),_0x3e9eb3);if(channels[_0x3e9eb3[_0xccf8('0x37')]]['channel']==_0x3e9eb3[_0xccf8('0x38')]){utils[_0xccf8('0xb')](util[_0xccf8('0x22')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x3e9eb3[_0xccf8('0x36')],_0x3e9eb3[_0xccf8('0x37')],_0x3e9eb3[_0xccf8('0x39')]));channels[_0x3e9eb3[_0xccf8('0x37')]][_0xccf8('0x3a')]=_0x3e9eb3[_0xccf8('0x39')];channels[_0x3e9eb3[_0xccf8('0x37')]][_0xccf8('0x3b')]=_0xccf8('0x3c');}else if(channels[_0x3e9eb3[_0xccf8('0x37')]][_0xccf8('0x18')]=_0x3e9eb3[_0xccf8('0x3d')]){utils[_0xccf8('0xb')](util['format'](_0xccf8('0x3e'),_0x3e9eb3[_0xccf8('0x36')],_0x3e9eb3[_0xccf8('0x37')],_0x3e9eb3['origtransfererchannel']));channels[_0x3e9eb3[_0xccf8('0x37')]]['destinationchannel']=_0x3e9eb3[_0xccf8('0x3f')];channels[_0x3e9eb3['localtwolinkedid']][_0xccf8('0x3b')]=_0xccf8('0x3c');}}}catch(_0x1d5b7d){utils[_0xccf8('0x1e')](util['format']('[%s][calls][attendedtransfer]',_0x3e9eb3[_0xccf8('0x36')]),_0x1d5b7d);}};exports['musiconholdstart']=function(_0x5ef222){try{if(!_[_0xccf8('0x24')](channels[_0x5ef222[_0xccf8('0x8')]])){utils[_0xccf8('0x16')](util[_0xccf8('0x22')](_0xccf8('0x40'),_0x5ef222[_0xccf8('0x8')]),_0x5ef222);channels[_0x5ef222[_0xccf8('0x8')]][_0xccf8('0x41')]=utils['now']();utils[_0xccf8('0xb')](util[_0xccf8('0x22')](_0xccf8('0x42'),_0x5ef222['uniqueid'],channels[_0x5ef222[_0xccf8('0x8')]]['musiconholdstartAt']));}}catch(_0x30eeb1){utils['error'](util[_0xccf8('0x22')](_0xccf8('0x40'),_0x5ef222['uniqueid']),_0x30eeb1);}};exports[_0xccf8('0x43')]=function(_0x21c7e5){try{if(!_[_0xccf8('0x24')](channels[_0x21c7e5['uniqueid']])){utils[_0xccf8('0x16')](util[_0xccf8('0x22')](_0xccf8('0x44'),_0x21c7e5['uniqueid']),_0x21c7e5);if(!_[_0xccf8('0x24')](channels[_0x21c7e5[_0xccf8('0x8')]][_0xccf8('0x41')])){channels[_0x21c7e5['uniqueid']]['mohtime']+=utils[_0xccf8('0x31')](utils['now'](),channels[_0x21c7e5['uniqueid']]['musiconholdstartAt']);utils[_0xccf8('0xb')](util[_0xccf8('0x22')](_0xccf8('0x45'),_0x21c7e5[_0xccf8('0x8')],channels[_0x21c7e5[_0xccf8('0x8')]][_0xccf8('0x46')]));delete channels[_0x21c7e5[_0xccf8('0x8')]][_0xccf8('0x41')];}}}catch(_0x4d9f20){utils['error'](util[_0xccf8('0x22')](_0xccf8('0x44'),_0x21c7e5[_0xccf8('0x8')]),_0x4d9f20);}};exports[_0xccf8('0x47')]=function(_0x2ed9f4){try{if(!_[_0xccf8('0x24')](channels[_0x2ed9f4[_0xccf8('0x8')]])){utils[_0xccf8('0x16')](util[_0xccf8('0x22')](_0xccf8('0x48'),_0x2ed9f4[_0xccf8('0x8')]),_0x2ed9f4);if(!_['isNil'](_0x2ed9f4[_0xccf8('0x49')][_0xccf8('0x4a')])){utils['info'](util[_0xccf8('0x22')](_0xccf8('0x4b'),_0x2ed9f4['uniqueid'],_0x2ed9f4[_0xccf8('0x4c')]));channels[_0x2ed9f4[_0xccf8('0x8')]][_0xccf8('0x4d')]=_0x2ed9f4['value'];}if(!_[_0xccf8('0x24')](_0x2ed9f4['variable'][_0xccf8('0x4e')])){utils[_0xccf8('0xb')](util[_0xccf8('0x22')](_0xccf8('0x4f'),_0x2ed9f4[_0xccf8('0x8')],_0x2ed9f4['value']));channels[_0x2ed9f4[_0xccf8('0x8')]]['destination']=_0x2ed9f4[_0xccf8('0x4c')];channels[_0x2ed9f4['uniqueid']][_0xccf8('0x2c')]='\x22'+_0x2ed9f4[_0xccf8('0x4c')]+'\x22\x20<'+_0x2ed9f4[_0xccf8('0x4c')]+'>';}if(!_[_0xccf8('0x24')](_0x2ed9f4[_0xccf8('0x49')][_0xccf8('0x50')])||!_[_0xccf8('0x24')](_0x2ed9f4[_0xccf8('0x49')]['xmd-callerid'])){utils[_0xccf8('0xb')](util[_0xccf8('0x22')](_0xccf8('0x51'),_0x2ed9f4['uniqueid'],!_['isNil'](_0x2ed9f4['variable']['xmd-callerid-preview'])?_0xccf8('0x50'):_0xccf8('0x52'),_0x2ed9f4[_0xccf8('0x4c')]));channels[_0x2ed9f4[_0xccf8('0x8')]][_0xccf8('0x2c')]=_0x2ed9f4['value'];}if(!_[_0xccf8('0x24')](_0x2ed9f4[_0xccf8('0x49')][_0xccf8('0x53')])||!_[_0xccf8('0x24')](_0x2ed9f4[_0xccf8('0x49')]['xmcs-queue'])){utils[_0xccf8('0xb')](util['format'](_0xccf8('0x51'),_0x2ed9f4[_0xccf8('0x8')],!_[_0xccf8('0x24')](_0x2ed9f4['variable']['xmd-queue'])?'xmd-queue':_0xccf8('0x54'),_0x2ed9f4[_0xccf8('0x4c')]));channels[_0x2ed9f4['uniqueid']]['lastapplication']=_0xccf8('0x55');channels[_0x2ed9f4['uniqueid']][_0xccf8('0x56')]=_0x2ed9f4[_0xccf8('0x4c')];channels[_0x2ed9f4['uniqueid']][_0xccf8('0xc')]=!![];}if(!_[_0xccf8('0x24')](_0x2ed9f4[_0xccf8('0x49')][_0xccf8('0x57')])){utils[_0xccf8('0xb')](util['format'](_0xccf8('0x58'),_0x2ed9f4[_0xccf8('0x8')],_0x2ed9f4['value']));channels[_0x2ed9f4[_0xccf8('0x8')]][_0xccf8('0x59')]=_0x2ed9f4['value'];}if(!_[_0xccf8('0x24')](_0x2ed9f4['variable']['xmd-cdrtype'])){utils[_0xccf8('0xb')](util[_0xccf8('0x22')](_0xccf8('0x5a'),_0x2ed9f4['uniqueid'],_0x2ed9f4[_0xccf8('0x4c')]));channels[_0x2ed9f4[_0xccf8('0x8')]][_0xccf8('0x5b')]=_0x2ed9f4['value'];}if(!_[_0xccf8('0x24')](_0x2ed9f4[_0xccf8('0x49')][_0xccf8('0x5c')])){utils['info'](util['format'](_0xccf8('0x5d'),_0x2ed9f4[_0xccf8('0x8')],_0x2ed9f4[_0xccf8('0x4c')]));channels[_0x2ed9f4['uniqueid']][_0xccf8('0x5e')]=_0x2ed9f4[_0xccf8('0x4c')];}if(!_['isNil'](_0x2ed9f4['variable'][_0xccf8('0x5f')])){utils[_0xccf8('0xb')](util[_0xccf8('0x22')](_0xccf8('0x60'),_0x2ed9f4[_0xccf8('0x8')],_0x2ed9f4[_0xccf8('0x4c')]));channels[_0x2ed9f4[_0xccf8('0x8')]][_0xccf8('0x5f')]=_0x2ed9f4[_0xccf8('0x4c')];}}}catch(_0x2a1088){utils[_0xccf8('0x1e')](util[_0xccf8('0x22')]('[%s][calls][varset]',_0x2ed9f4[_0xccf8('0x8')]),_0x2a1088);}};exports[_0xccf8('0x61')]=function(_0x10ae74){try{if(!_[_0xccf8('0x24')](channels[_0x10ae74['uniqueid']])){utils[_0xccf8('0x16')](util['format'](_0xccf8('0x62'),_0x10ae74[_0xccf8('0x8')]),_0x10ae74);utils[_0xccf8('0xb')](util[_0xccf8('0x22')](_0xccf8('0x63'),_0x10ae74[_0xccf8('0x8')],_0x10ae74[_0xccf8('0x64')],_0x10ae74[_0xccf8('0x65')]));if(_0x10ae74['application'][_0xccf8('0x66')]()=='set'&&_['startsWith'](_0x10ae74[_0xccf8('0x65')][_0xccf8('0x66')](),_0xccf8('0x67'))){var _0x28615f=_0x10ae74['appdata'][_0xccf8('0x68')]('=');var _0x14d9dd=_0x28615f[0x0][_0xccf8('0x69')](_0x28615f[0x0][_0xccf8('0x6a')]('(')+0x1,_0x28615f[0x0][_0xccf8('0x6a')](')'));var _0x475ed4=_0x28615f[0x1];channels[_0x10ae74['uniqueid']][_0x14d9dd]=_0x475ed4;}if(!_[_0xccf8('0x6b')](['hangup',_0xccf8('0x6c'),_0xccf8('0x6d'),_0xccf8('0x6e'),_0xccf8('0x6f')],_0x10ae74[_0xccf8('0x64')][_0xccf8('0x66')]())){channels[_0x10ae74[_0xccf8('0x8')]]['lastapplication']=_0x10ae74[_0xccf8('0x64')];channels[_0x10ae74[_0xccf8('0x8')]][_0xccf8('0x56')]=_0x10ae74[_0xccf8('0x65')];}}}catch(_0x5435fb){utils['error'](util[_0xccf8('0x22')](_0xccf8('0x62'),_0x10ae74['uniqueid']),_0x5435fb);}};
\ No newline at end of file
+var _0x63f1=['[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','value','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmcs-queue','xmd-queue','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','set','startsWith','split','lastIndexOf','includes','hangup','noop','execif','gotoif','lastapplication','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','channel','queue','interface','calleridnum','connectedlinenum','lastevent','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','error','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','starttime','diffTime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','variable','xmd-originatecalleridnum','source','xmd-phone'];(function(_0x303d6d,_0x42aa3a){var _0x3e258d=function(_0x32aa79){while(--_0x32aa79){_0x303d6d['push'](_0x303d6d['shift']());}};_0x3e258d(++_0x42aa3a);}(_0x63f1,0x1da));var _0x163f=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x63f1[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x163f('0x0'));var util=require(_0x163f('0x1'));var utils=require('./utils');var transfers=require(_0x163f('0x2'));var dispositions=['NO\x20ANSWER',_0x163f('0x3'),_0x163f('0x3'),'NO\x20ANSWER',_0x163f('0x4'),_0x163f('0x4'),_0x163f('0x5'),_0x163f('0x6'),_0x163f('0x3'),_0x163f('0x3'),_0x163f('0x3')];var channels={};function writeDB(_0x366f8f){var _0x59813b;if(transfers[_0x163f('0x7')][_0x366f8f[_0x163f('0x8')]]){_0x59813b=_0x366f8f[_0x163f('0x8')];_0x366f8f[_0x163f('0x8')]=transfers['blinds'][_0x366f8f[_0x163f('0x8')]][_0x163f('0x9')];}utils[_0x163f('0xa')](util[_0x163f('0xb')](_0x163f('0xc'),_0x366f8f['uniqueid'],_0x366f8f[_0x163f('0xd')],_0x366f8f[_0x163f('0xe')],_0x366f8f['membername'],_0x366f8f[_0x163f('0xf')],_0x366f8f[_0x163f('0x10')],_0x366f8f[_0x163f('0x11')],_0x366f8f[_0x163f('0x12')]));if(_0x366f8f['accountcode']){utils[_0x163f('0x13')](_0x366f8f[_0x163f('0x14')])[_0x163f('0x15')](function(_0x26635d){if(_0x26635d){_0x366f8f[_0x163f('0x16')]=_0x26635d['id'];}utils[_0x163f('0x17')](_0x163f('0x18'),_0x366f8f);});}else{utils[_0x163f('0x17')](_0x163f('0x18'),_0x366f8f);}if(channels[_0x366f8f['uniqueid']]){delete channels[_0x366f8f[_0x163f('0x8')]];}else if(_0x59813b&&channels[_0x59813b]){if(!transfers[_0x163f('0x7')][_0x59813b][_0x163f('0x19')])delete transfers[_0x163f('0x7')][_0x59813b];delete channels[_0x59813b];}}exports[_0x163f('0x1a')]=function(_0x4cd976){try{utils[_0x163f('0x1b')](util[_0x163f('0xb')]('[%s][calls][newchannel]',_0x4cd976[_0x163f('0x8')]),_0x4cd976);if(_0x4cd976[_0x163f('0x8')]==_0x4cd976[_0x163f('0x1c')]&&_0x4cd976[_0x163f('0xd')]!=_0x163f('0x1d')){utils[_0x163f('0xa')](util['format'](_0x163f('0x1e'),_0x4cd976[_0x163f('0x8')],_0x4cd976['context'],_0x4cd976[_0x163f('0x1f')]));channels[_0x4cd976['uniqueid']]={'uniqueid':_0x4cd976[_0x163f('0x8')],'accountcode':_0x4cd976[_0x163f('0x14')],'source':_0x4cd976[_0x163f('0x10')],'destination':_0x4cd976[_0x163f('0x1f')],'destinationcontext':_0x4cd976[_0x163f('0x20')],'channel':_0x4cd976[_0x163f('0xd')],'starttime':utils[_0x163f('0x21')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x163f('0x22')};}}catch(_0x55a1ff){utils['error'](util[_0x163f('0xb')]('[%s][calls][newchannel]',_0x4cd976[_0x163f('0x8')]),_0x55a1ff);}};exports[_0x163f('0x23')]=function(_0x1986c1){try{utils[_0x163f('0x1b')](util[_0x163f('0xb')](_0x163f('0x24'),_0x1986c1[_0x163f('0x8')]),_0x1986c1);if(!_[_0x163f('0x25')](channels[_0x1986c1[_0x163f('0x8')]])&&_0x1986c1['channelstate']==0x6){utils[_0x163f('0xa')](util[_0x163f('0xb')](_0x163f('0x26'),_0x1986c1['uniqueid'],_0x1986c1[_0x163f('0x20')],_0x1986c1[_0x163f('0xd')]));if(_[_0x163f('0x25')](channels[_0x1986c1[_0x163f('0x8')]][_0x163f('0x27')])){channels[_0x1986c1[_0x163f('0x8')]][_0x163f('0x27')]=utils[_0x163f('0x21')]();}}else if(!_['isNil'](channels[_0x1986c1['linkedid']])&&_0x1986c1[_0x163f('0x28')]==0x6&&_0x1986c1[_0x163f('0x20')]!=_0x163f('0x29')){utils[_0x163f('0xa')](util['format'](_0x163f('0x2a'),_0x1986c1[_0x163f('0x8')],_0x1986c1[_0x163f('0x1c')],_0x1986c1[_0x163f('0x20')],_0x1986c1[_0x163f('0xd')]));channels[_0x1986c1[_0x163f('0x1c')]][_0x163f('0x14')]=_0x1986c1['accountcode'];channels[_0x1986c1[_0x163f('0x1c')]][_0x163f('0x2b')]=_0x1986c1['channel'];if(_['isNil'](channels[_0x1986c1[_0x163f('0x1c')]][_0x163f('0x2c')])){channels[_0x1986c1[_0x163f('0x1c')]][_0x163f('0x2c')]=utils['now']();}channels[_0x1986c1[_0x163f('0x1c')]][_0x163f('0x2d')]=dispositions[_[_0x163f('0x2e')](_0x1986c1[_0x163f('0x28')])]||_0x163f('0x5');}}catch(_0x4906ee){utils[_0x163f('0x2f')](util['format'](_0x163f('0x24'),_0x1986c1[_0x163f('0x8')]),_0x4906ee);}};exports['hangup']=function(_0x21852b){try{if(!_[_0x163f('0x25')](channels[_0x21852b['uniqueid']])){utils[_0x163f('0x1b')](util['format']('[%s][calls][hangup]',_0x21852b[_0x163f('0x8')]),_0x21852b);if(_[_0x163f('0x25')](channels[_0x21852b[_0x163f('0x8')]][_0x163f('0x30')])){channels[_0x21852b[_0x163f('0x8')]][_0x163f('0x30')]=_0x21852b[_0x163f('0x31')]+'\x20<'+_0x21852b[_0x163f('0x10')]+'>';}utils[_0x163f('0xa')](util[_0x163f('0xb')](_0x163f('0x32'),_0x21852b['uniqueid'],channels[_0x21852b[_0x163f('0x8')]]['callerid'],_0x21852b[_0x163f('0x33')]));channels[_0x21852b[_0x163f('0x8')]]['endtime']=utils['now']();channels[_0x21852b[_0x163f('0x8')]]['duration']=utils['diffTime'](channels[_0x21852b[_0x163f('0x8')]][_0x163f('0x34')],channels[_0x21852b['uniqueid']][_0x163f('0x35')]);channels[_0x21852b[_0x163f('0x8')]]['billableseconds']=channels[_0x21852b['uniqueid']][_0x163f('0x2c')]?utils[_0x163f('0x36')](channels[_0x21852b['uniqueid']]['endtime'],channels[_0x21852b[_0x163f('0x8')]][_0x163f('0x2c')]):0x0;writeDB(channels[_0x21852b[_0x163f('0x8')]]);}}catch(_0x3fc2a6){utils[_0x163f('0x2f')](util[_0x163f('0xb')](_0x163f('0x37'),_0x21852b[_0x163f('0x8')]),_0x3fc2a6);}};exports[_0x163f('0x38')]=function(_0x5dc296){try{if(!_['isNil'](channels[_0x5dc296[_0x163f('0x39')]])){utils[_0x163f('0x1b')](util['format'](_0x163f('0x3a'),_0x5dc296[_0x163f('0x3b')]),_0x5dc296);if(channels[_0x5dc296[_0x163f('0x39')]][_0x163f('0xd')]==_0x5dc296['transfereechannel']){utils[_0x163f('0xa')](util[_0x163f('0xb')](_0x163f('0x3c'),_0x5dc296[_0x163f('0x3b')],_0x5dc296[_0x163f('0x39')],_0x5dc296['secondtransfererchannel']));channels[_0x5dc296[_0x163f('0x39')]][_0x163f('0x2b')]=_0x5dc296['secondtransfererchannel'];channels[_0x5dc296[_0x163f('0x39')]][_0x163f('0x3d')]=_0x163f('0x3e');}else if(channels[_0x5dc296[_0x163f('0x39')]][_0x163f('0xd')]=_0x5dc296[_0x163f('0x3f')]){utils[_0x163f('0xa')](util['format'](_0x163f('0x3c'),_0x5dc296[_0x163f('0x3b')],_0x5dc296[_0x163f('0x39')],_0x5dc296['origtransfererchannel']));channels[_0x5dc296['localtwolinkedid']][_0x163f('0x2b')]=_0x5dc296[_0x163f('0x40')];channels[_0x5dc296[_0x163f('0x39')]][_0x163f('0x3d')]=_0x163f('0x3e');}}}catch(_0xb5c05a){utils[_0x163f('0x2f')](util[_0x163f('0xb')]('[%s][calls][attendedtransfer]',_0x5dc296[_0x163f('0x3b')]),_0xb5c05a);}};exports[_0x163f('0x41')]=function(_0x3bbf9f){try{if(!_[_0x163f('0x25')](channels[_0x3bbf9f['uniqueid']])){utils[_0x163f('0x1b')](util[_0x163f('0xb')]('[%s][calls][musiconholdstart]',_0x3bbf9f[_0x163f('0x8')]),_0x3bbf9f);channels[_0x3bbf9f['uniqueid']][_0x163f('0x42')]=utils['now']();utils['info'](util['format'](_0x163f('0x43'),_0x3bbf9f[_0x163f('0x8')],channels[_0x3bbf9f['uniqueid']][_0x163f('0x42')]));}}catch(_0x3776ad){utils[_0x163f('0x2f')](util[_0x163f('0xb')]('[%s][calls][musiconholdstart]',_0x3bbf9f[_0x163f('0x8')]),_0x3776ad);}};exports[_0x163f('0x44')]=function(_0x5ead57){try{if(!_[_0x163f('0x25')](channels[_0x5ead57[_0x163f('0x8')]])){utils['debug'](util['format'](_0x163f('0x45'),_0x5ead57[_0x163f('0x8')]),_0x5ead57);if(!_['isNil'](channels[_0x5ead57[_0x163f('0x8')]]['musiconholdstartAt'])){channels[_0x5ead57[_0x163f('0x8')]][_0x163f('0x46')]+=utils['diffTime'](utils['now'](),channels[_0x5ead57[_0x163f('0x8')]][_0x163f('0x42')]);utils[_0x163f('0xa')](util[_0x163f('0xb')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x5ead57['uniqueid'],channels[_0x5ead57[_0x163f('0x8')]][_0x163f('0x46')]));delete channels[_0x5ead57[_0x163f('0x8')]][_0x163f('0x42')];}}}catch(_0x1b988f){utils[_0x163f('0x2f')](util[_0x163f('0xb')](_0x163f('0x45'),_0x5ead57[_0x163f('0x8')]),_0x1b988f);}};exports[_0x163f('0x47')]=function(_0x895bda){try{if(!_[_0x163f('0x25')](channels[_0x895bda[_0x163f('0x8')]])){utils[_0x163f('0x1b')](util[_0x163f('0xb')]('[%s][calls][varset]',_0x895bda[_0x163f('0x8')]),_0x895bda);if(!_[_0x163f('0x25')](_0x895bda[_0x163f('0x48')][_0x163f('0x49')])){utils[_0x163f('0xa')](util[_0x163f('0xb')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x895bda['uniqueid'],_0x895bda['value']));channels[_0x895bda['uniqueid']][_0x163f('0x4a')]=_0x895bda['value'];}if(!_[_0x163f('0x25')](_0x895bda[_0x163f('0x48')][_0x163f('0x4b')])){utils['info'](util[_0x163f('0xb')](_0x163f('0x4c'),_0x895bda[_0x163f('0x8')],_0x895bda[_0x163f('0x4d')]));channels[_0x895bda['uniqueid']]['destination']=_0x895bda[_0x163f('0x4d')];channels[_0x895bda['uniqueid']][_0x163f('0x30')]='\x22'+_0x895bda[_0x163f('0x4d')]+'\x22\x20<'+_0x895bda['value']+'>';}if(!_['isNil'](_0x895bda[_0x163f('0x48')]['xmd-callerid-preview'])||!_['isNil'](_0x895bda[_0x163f('0x48')][_0x163f('0x4e')])){utils[_0x163f('0xa')](util[_0x163f('0xb')](_0x163f('0x4f'),_0x895bda['uniqueid'],!_[_0x163f('0x25')](_0x895bda['variable'][_0x163f('0x50')])?_0x163f('0x50'):'xmd-callerid',_0x895bda[_0x163f('0x4d')]));channels[_0x895bda[_0x163f('0x8')]][_0x163f('0x30')]=_0x895bda[_0x163f('0x4d')];}if(!_[_0x163f('0x25')](_0x895bda[_0x163f('0x48')]['xmd-queue'])||!_['isNil'](_0x895bda[_0x163f('0x48')][_0x163f('0x51')])){utils['info'](util[_0x163f('0xb')](_0x163f('0x4f'),_0x895bda[_0x163f('0x8')],!_[_0x163f('0x25')](_0x895bda[_0x163f('0x48')][_0x163f('0x52')])?_0x163f('0x52'):_0x163f('0x51'),_0x895bda[_0x163f('0x4d')]));channels[_0x895bda[_0x163f('0x8')]]['lastapplication']=_0x163f('0x53');channels[_0x895bda[_0x163f('0x8')]][_0x163f('0x54')]=_0x895bda[_0x163f('0x4d')];channels[_0x895bda[_0x163f('0x8')]][_0x163f('0xe')]=!![];}if(!_[_0x163f('0x25')](_0x895bda[_0x163f('0x48')][_0x163f('0x55')])){utils[_0x163f('0xa')](util[_0x163f('0xb')](_0x163f('0x56'),_0x895bda['uniqueid'],_0x895bda[_0x163f('0x4d')]));channels[_0x895bda[_0x163f('0x8')]]['ContactId']=_0x895bda['value'];}if(!_[_0x163f('0x25')](_0x895bda[_0x163f('0x48')][_0x163f('0x57')])){utils[_0x163f('0xa')](util[_0x163f('0xb')](_0x163f('0x58'),_0x895bda['uniqueid'],_0x895bda['value']));channels[_0x895bda[_0x163f('0x8')]][_0x163f('0x59')]=_0x895bda[_0x163f('0x4d')];}if(!_[_0x163f('0x25')](_0x895bda[_0x163f('0x48')][_0x163f('0x5a')])){utils['info'](util[_0x163f('0xb')](_0x163f('0x5b'),_0x895bda[_0x163f('0x8')],_0x895bda[_0x163f('0x4d')]));channels[_0x895bda[_0x163f('0x8')]][_0x163f('0x5c')]=_0x895bda[_0x163f('0x4d')];}if(!_[_0x163f('0x25')](_0x895bda[_0x163f('0x48')]['sipcallid'])){utils['info'](util[_0x163f('0xb')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x895bda[_0x163f('0x8')],_0x895bda[_0x163f('0x4d')]));channels[_0x895bda[_0x163f('0x8')]][_0x163f('0x5d')]=_0x895bda[_0x163f('0x4d')];}}}catch(_0x2167c1){utils[_0x163f('0x2f')](util['format'](_0x163f('0x5e'),_0x895bda[_0x163f('0x8')]),_0x2167c1);}};exports[_0x163f('0x5f')]=function(_0x2aa651){try{if(!_[_0x163f('0x25')](channels[_0x2aa651[_0x163f('0x8')]])){utils[_0x163f('0x1b')](util[_0x163f('0xb')](_0x163f('0x60'),_0x2aa651[_0x163f('0x8')]),_0x2aa651);utils[_0x163f('0xa')](util[_0x163f('0xb')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x2aa651['uniqueid'],_0x2aa651[_0x163f('0x61')],_0x2aa651[_0x163f('0x62')]));if(_0x2aa651['application'][_0x163f('0x63')]()==_0x163f('0x64')&&_[_0x163f('0x65')](_0x2aa651[_0x163f('0x62')]['toLowerCase'](),'cdr')){var _0x47d3b6=_0x2aa651['appdata'][_0x163f('0x66')]('=');var _0x2bddce=_0x47d3b6[0x0]['substring'](_0x47d3b6[0x0][_0x163f('0x67')]('(')+0x1,_0x47d3b6[0x0][_0x163f('0x67')](')'));var _0x1e9645=_0x47d3b6[0x1];channels[_0x2aa651['uniqueid']][_0x2bddce]=_0x1e9645;}if(!_[_0x163f('0x68')]([_0x163f('0x69'),_0x163f('0x6a'),_0x163f('0x6b'),_0x163f('0x64'),_0x163f('0x6c')],_0x2aa651[_0x163f('0x61')][_0x163f('0x63')]())){channels[_0x2aa651[_0x163f('0x8')]][_0x163f('0x6d')]=_0x2aa651[_0x163f('0x61')];channels[_0x2aa651[_0x163f('0x8')]]['lastdata']=_0x2aa651[_0x163f('0x62')];}}}catch(_0x3f57ff){utils[_0x163f('0x2f')](util[_0x163f('0xb')]('[%s][calls][newexten]',_0x2aa651[_0x163f('0x8')]),_0x3f57ff);}};
\ No newline at end of file
index e9d822f..7169171 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x244e=['info','[core]\x20connected','shutdown','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils'];(function(_0x199a4a,_0x3ef461){var _0x4d23f1=function(_0x251e73){while(--_0x251e73){_0x199a4a['push'](_0x199a4a['shift']());}};_0x4d23f1(++_0x3ef461);}(_0x244e,0x1e9));var _0xe244=function(_0x2fa14b,_0x3ef2ce){_0x2fa14b=_0x2fa14b-0x0;var _0x41e07d=_0x244e[_0x2fa14b];return _0x41e07d;};'use strict';var utils=require(_0xe244('0x0'));exports['connect']=function(){utils[_0xe244('0x1')](_0xe244('0x2'));};exports[_0xe244('0x3')]=function(){utils[_0xe244('0x1')]('[core]\x20shutdown');};exports['fullybooted']=function(){utils[_0xe244('0x1')](_0xe244('0x4'));};exports[_0xe244('0x5')]=function(_0x23bbea){utils[_0xe244('0x5')](_0xe244('0x6'),_0x23bbea);};exports[_0xe244('0x7')]=function(){utils[_0xe244('0x1')](_0xe244('0x8'));};exports[_0xe244('0x9')]=function(_0x5c96e6){};
\ No newline at end of file
+var _0x4866=['fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','connect','info','shutdown','[core]\x20shutdown'];(function(_0x856e86,_0x3f9c40){var _0x586a43=function(_0x433704){while(--_0x433704){_0x856e86['push'](_0x856e86['shift']());}};_0x586a43(++_0x3f9c40);}(_0x4866,0x149));var _0x6486=function(_0x32b30c,_0x2d5ec8){_0x32b30c=_0x32b30c-0x0;var _0xcfc212=_0x4866[_0x32b30c];return _0xcfc212;};'use strict';var utils=require('./utils');exports[_0x6486('0x0')]=function(){utils[_0x6486('0x1')]('[core]\x20connected');};exports[_0x6486('0x2')]=function(){utils[_0x6486('0x1')](_0x6486('0x3'));};exports[_0x6486('0x4')]=function(){utils[_0x6486('0x1')](_0x6486('0x5'));};exports['error']=function(_0x4bbc79){utils[_0x6486('0x6')](_0x6486('0x7'),_0x4bbc79);};exports[_0x6486('0x8')]=function(){utils[_0x6486('0x1')]('[core]\x20close');};exports['managerevent']=function(_0x3d87ad){};
\ No newline at end of file
index dde4d1b..f8fa81f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x166a=['dialend','[%s][dials][dialend]','dialstatus','ANSWER','assign','answertime','now','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','diffTime','endtime','holdtime','billableseconds','lodash','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','debug','[%s][dials][newexten]','application','appdata','toLowerCase','startsWith','cdr(routeid)','split','varset','[%s][dials][varset]','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','starttime','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x166a,0x9b));var _0xa166=function(_0x37e627,_0x157bae){_0x37e627=_0x37e627-0x0;var _0x82481e=_0x166a[_0x37e627];return _0x82481e;};'use strict';var _=require(_0xa166('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x396ceb){utils[_0xa166('0x1')](util[_0xa166('0x2')](_0xa166('0x3'),_0x396ceb[_0xa166('0x4')],_0x396ceb[_0xa166('0x5')],_0x396ceb[_0xa166('0x6')],_0x396ceb[_0xa166('0x7')],_0x396ceb[_0xa166('0x8')],_0x396ceb['dialstatus']));utils['request']('CreateVoiceDialReport',_0x396ceb);delete dials[_0x396ceb['uniqueid']];}exports['newexten']=function(_0xc6e11d){try{utils[_0xa166('0x9')](util[_0xa166('0x2')](_0xa166('0xa'),_0xc6e11d[_0xa166('0x4')]),_0xc6e11d);utils[_0xa166('0x1')](util[_0xa166('0x2')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0xc6e11d[_0xa166('0x4')],_0xc6e11d[_0xa166('0xb')],_0xc6e11d[_0xa166('0xc')]));if(_0xc6e11d['application'][_0xa166('0xd')]()=='set'&&_[_0xa166('0xe')](_0xc6e11d[_0xa166('0xc')][_0xa166('0xd')](),_0xa166('0xf'))){var _0x33af9e=_0xc6e11d['appdata'][_0xa166('0x10')]('=');dials[_0xc6e11d[_0xa166('0x4')]]={'routeId':_0x33af9e[0x1]};}}catch(_0x4aca83){utils['error'](util['format'](_0xa166('0xa'),_0xc6e11d['uniqueid']),_0x4aca83);}};exports[_0xa166('0x11')]=function(_0xf4460a){try{utils['debug'](util[_0xa166('0x2')](_0xa166('0x12'),_0xf4460a['uniqueid']),_0xf4460a);if(!_[_0xa166('0x13')](_0xf4460a[_0xa166('0x14')]['outboundrouteid'])){utils[_0xa166('0x1')](util['format'](_0xa166('0x15'),_0xf4460a[_0xa166('0x4')],_0xf4460a[_0xa166('0x16')]));dials[_0xf4460a[_0xa166('0x4')]]={'routeId':_0xf4460a[_0xa166('0x16')]};}}catch(_0x349c25){utils[_0xa166('0x17')](util['format'](_0xa166('0x12'),_0xf4460a[_0xa166('0x4')]),_0x349c25);}};exports[_0xa166('0x18')]=function(_0x290a63){try{if(!_[_0xa166('0x13')](dials[_0x290a63[_0xa166('0x4')]])){utils['debug'](util[_0xa166('0x2')]('[%s][dials][dialbegin]',_0x290a63['uniqueid']),_0x290a63);dials[_0x290a63[_0xa166('0x4')]]=_['assign'](dials[_0x290a63[_0xa166('0x4')]],_0x290a63);dials[_0x290a63[_0xa166('0x4')]][_0xa166('0x19')]=utils['now']();dials[_0x290a63[_0xa166('0x4')]][_0xa166('0x1a')]='called';utils['info'](util[_0xa166('0x2')](_0xa166('0x1b'),_0x290a63[_0xa166('0x4')],dials[_0x290a63[_0xa166('0x4')]][_0xa166('0x19')]));}}catch(_0x3a77fd){utils[_0xa166('0x17')](util[_0xa166('0x2')](_0xa166('0x1c'),_0x290a63[_0xa166('0x4')]),_0x3a77fd);}};exports[_0xa166('0x1d')]=function(_0x266a53){try{if(!_[_0xa166('0x13')](dials[_0x266a53['uniqueid']])){utils['debug'](util[_0xa166('0x2')](_0xa166('0x1e'),_0x266a53[_0xa166('0x4')]),_0x266a53);dials[_0x266a53[_0xa166('0x4')]][_0xa166('0x1f')]=_0x266a53[_0xa166('0x1f')];if(_0x266a53['dialstatus']==_0xa166('0x20')){dials[_0x266a53[_0xa166('0x4')]]=_[_0xa166('0x21')](dials[_0x266a53[_0xa166('0x4')]],_0x266a53);dials[_0x266a53[_0xa166('0x4')]][_0xa166('0x22')]=utils[_0xa166('0x23')]();dials[_0x266a53['uniqueid']][_0xa166('0x1a')]='connect';utils[_0xa166('0x1')](util[_0xa166('0x2')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x266a53[_0xa166('0x4')],_0x266a53[_0xa166('0x1f')],dials[_0x266a53['uniqueid']][_0xa166('0x22')]));}else{utils[_0xa166('0x1')](util[_0xa166('0x2')]('[%s][dials][dialend]\x20dialstatus:%s',_0x266a53[_0xa166('0x4')],_0x266a53[_0xa166('0x1f')]));}}}catch(_0x4a815d){utils[_0xa166('0x17')](util['format']('[%s][dials][dialend]',_0x266a53['uniqueid']),_0x4a815d);}};exports[_0xa166('0x24')]=function(_0x2742f7){try{if(!_[_0xa166('0x13')](dials[_0x2742f7[_0xa166('0x4')]])){utils[_0xa166('0x9')](util[_0xa166('0x2')](_0xa166('0x25'),_0x2742f7[_0xa166('0x4')]),_0x2742f7);utils['info'](util[_0xa166('0x2')](_0xa166('0x26'),_0x2742f7[_0xa166('0x4')],_0x2742f7[_0xa166('0x7')],_0x2742f7[_0xa166('0x27')],_0x2742f7[_0xa166('0x28')]));dials[_0x2742f7[_0xa166('0x4')]]=_[_0xa166('0x21')](dials[_0x2742f7['uniqueid']],{'endtime':utils[_0xa166('0x23')](),'lastevent':'complete'});dials[_0x2742f7[_0xa166('0x4')]][_0xa166('0x29')]=utils[_0xa166('0x2a')](dials[_0x2742f7[_0xa166('0x4')]][_0xa166('0x2b')],dials[_0x2742f7[_0xa166('0x4')]]['starttime']);dials[_0x2742f7['uniqueid']][_0xa166('0x2c')]=utils['diffTime'](dials[_0x2742f7['uniqueid']][_0xa166('0x22')]||dials[_0x2742f7[_0xa166('0x4')]][_0xa166('0x2b')],dials[_0x2742f7[_0xa166('0x4')]][_0xa166('0x19')]);dials[_0x2742f7[_0xa166('0x4')]][_0xa166('0x2d')]=dials[_0x2742f7[_0xa166('0x4')]][_0xa166('0x22')]?utils[_0xa166('0x2a')](dials[_0x2742f7[_0xa166('0x4')]][_0xa166('0x2b')],dials[_0x2742f7[_0xa166('0x4')]][_0xa166('0x22')]):0x0;writeDB(dials[_0x2742f7[_0xa166('0x4')]]);}}catch(_0x54e42d){utils[_0xa166('0x17')](util[_0xa166('0x2')](_0xa166('0x25'),_0x2742f7['uniqueid']),_0x54e42d);}};
\ No newline at end of file
+var _0xb119=['cdr(routeid)','split','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','ANSWER','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','error','hangup','[%s][dials][hangup]','calleridname','cause-txt','duration','diffTime','endtime','holdtime','lodash','util','./utils','info','format','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','uniqueid','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith'];(function(_0x728ab6,_0x3986f0){var _0x942e4c=function(_0x53c734){while(--_0x53c734){_0x728ab6['push'](_0x728ab6['shift']());}};_0x942e4c(++_0x3986f0);}(_0xb119,0x12e));var _0x9b11=function(_0x29de96,_0x42cc38){_0x29de96=_0x29de96-0x0;var _0x1b9352=_0xb119[_0x29de96];return _0x1b9352;};'use strict';var _=require(_0x9b11('0x0'));var util=require(_0x9b11('0x1'));var utils=require(_0x9b11('0x2'));var dials={};function writeDB(_0x56e042){utils[_0x9b11('0x3')](util[_0x9b11('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x56e042['uniqueid'],_0x56e042[_0x9b11('0x5')],_0x56e042[_0x9b11('0x6')],_0x56e042[_0x9b11('0x7')],_0x56e042[_0x9b11('0x8')],_0x56e042[_0x9b11('0x9')]));utils[_0x9b11('0xa')](_0x9b11('0xb'),_0x56e042);delete dials[_0x56e042['uniqueid']];}exports[_0x9b11('0xc')]=function(_0x4e7150){try{utils[_0x9b11('0xd')](util[_0x9b11('0x4')](_0x9b11('0xe'),_0x4e7150[_0x9b11('0xf')]),_0x4e7150);utils['info'](util['format'](_0x9b11('0x10'),_0x4e7150['uniqueid'],_0x4e7150[_0x9b11('0x11')],_0x4e7150[_0x9b11('0x12')]));if(_0x4e7150[_0x9b11('0x11')][_0x9b11('0x13')]()==_0x9b11('0x14')&&_[_0x9b11('0x15')](_0x4e7150['appdata']['toLowerCase'](),_0x9b11('0x16'))){var _0x2ea767=_0x4e7150[_0x9b11('0x12')][_0x9b11('0x17')]('=');dials[_0x4e7150['uniqueid']]={'routeId':_0x2ea767[0x1]};}}catch(_0x2d0d62){utils['error'](util['format']('[%s][dials][newexten]',_0x4e7150[_0x9b11('0xf')]),_0x2d0d62);}};exports[_0x9b11('0x18')]=function(_0x557471){try{utils[_0x9b11('0xd')](util[_0x9b11('0x4')](_0x9b11('0x19'),_0x557471['uniqueid']),_0x557471);if(!_[_0x9b11('0x1a')](_0x557471[_0x9b11('0x1b')][_0x9b11('0x1c')])){utils[_0x9b11('0x3')](util[_0x9b11('0x4')](_0x9b11('0x1d'),_0x557471[_0x9b11('0xf')],_0x557471[_0x9b11('0x1e')]));dials[_0x557471[_0x9b11('0xf')]]={'routeId':_0x557471[_0x9b11('0x1e')]};}}catch(_0x26c5da){utils['error'](util[_0x9b11('0x4')](_0x9b11('0x19'),_0x557471[_0x9b11('0xf')]),_0x26c5da);}};exports[_0x9b11('0x1f')]=function(_0x58132b){try{if(!_['isNil'](dials[_0x58132b['uniqueid']])){utils[_0x9b11('0xd')](util['format'](_0x9b11('0x20'),_0x58132b[_0x9b11('0xf')]),_0x58132b);dials[_0x58132b[_0x9b11('0xf')]]=_[_0x9b11('0x21')](dials[_0x58132b[_0x9b11('0xf')]],_0x58132b);dials[_0x58132b[_0x9b11('0xf')]]['starttime']=utils[_0x9b11('0x22')]();dials[_0x58132b['uniqueid']][_0x9b11('0x23')]=_0x9b11('0x24');utils[_0x9b11('0x3')](util[_0x9b11('0x4')](_0x9b11('0x25'),_0x58132b[_0x9b11('0xf')],dials[_0x58132b[_0x9b11('0xf')]][_0x9b11('0x26')]));}}catch(_0xe6618b){utils['error'](util['format'](_0x9b11('0x20'),_0x58132b[_0x9b11('0xf')]),_0xe6618b);}};exports[_0x9b11('0x27')]=function(_0x217387){try{if(!_[_0x9b11('0x1a')](dials[_0x217387[_0x9b11('0xf')]])){utils[_0x9b11('0xd')](util[_0x9b11('0x4')](_0x9b11('0x28'),_0x217387[_0x9b11('0xf')]),_0x217387);dials[_0x217387[_0x9b11('0xf')]][_0x9b11('0x9')]=_0x217387['dialstatus'];if(_0x217387[_0x9b11('0x9')]==_0x9b11('0x29')){dials[_0x217387[_0x9b11('0xf')]]=_[_0x9b11('0x21')](dials[_0x217387[_0x9b11('0xf')]],_0x217387);dials[_0x217387[_0x9b11('0xf')]]['answertime']=utils[_0x9b11('0x22')]();dials[_0x217387['uniqueid']]['lastevent']=_0x9b11('0x2a');utils[_0x9b11('0x3')](util[_0x9b11('0x4')](_0x9b11('0x2b'),_0x217387[_0x9b11('0xf')],_0x217387[_0x9b11('0x9')],dials[_0x217387[_0x9b11('0xf')]][_0x9b11('0x2c')]));}else{utils[_0x9b11('0x3')](util[_0x9b11('0x4')]('[%s][dials][dialend]\x20dialstatus:%s',_0x217387['uniqueid'],_0x217387[_0x9b11('0x9')]));}}}catch(_0x31c039){utils[_0x9b11('0x2d')](util[_0x9b11('0x4')](_0x9b11('0x28'),_0x217387[_0x9b11('0xf')]),_0x31c039);}};exports[_0x9b11('0x2e')]=function(_0x2356fa){try{if(!_['isNil'](dials[_0x2356fa[_0x9b11('0xf')]])){utils[_0x9b11('0xd')](util[_0x9b11('0x4')](_0x9b11('0x2f'),_0x2356fa[_0x9b11('0xf')]),_0x2356fa);utils['info'](util[_0x9b11('0x4')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x2356fa['uniqueid'],_0x2356fa[_0x9b11('0x7')],_0x2356fa[_0x9b11('0x30')],_0x2356fa[_0x9b11('0x31')]));dials[_0x2356fa[_0x9b11('0xf')]]=_[_0x9b11('0x21')](dials[_0x2356fa[_0x9b11('0xf')]],{'endtime':utils[_0x9b11('0x22')](),'lastevent':'complete'});dials[_0x2356fa[_0x9b11('0xf')]][_0x9b11('0x32')]=utils[_0x9b11('0x33')](dials[_0x2356fa[_0x9b11('0xf')]][_0x9b11('0x34')],dials[_0x2356fa[_0x9b11('0xf')]][_0x9b11('0x26')]);dials[_0x2356fa[_0x9b11('0xf')]][_0x9b11('0x35')]=utils['diffTime'](dials[_0x2356fa[_0x9b11('0xf')]][_0x9b11('0x2c')]||dials[_0x2356fa[_0x9b11('0xf')]][_0x9b11('0x34')],dials[_0x2356fa[_0x9b11('0xf')]]['starttime']);dials[_0x2356fa[_0x9b11('0xf')]]['billableseconds']=dials[_0x2356fa[_0x9b11('0xf')]][_0x9b11('0x2c')]?utils[_0x9b11('0x33')](dials[_0x2356fa[_0x9b11('0xf')]][_0x9b11('0x34')],dials[_0x2356fa[_0x9b11('0xf')]][_0x9b11('0x2c')]):0x0;writeDB(dials[_0x2356fa[_0x9b11('0xf')]]);}}catch(_0x178e04){utils[_0x9b11('0x2d')](util['format'](_0x9b11('0x2f'),_0x2356fa[_0x9b11('0xf')]),_0x178e04);}};
\ No newline at end of file
index 52063a2..244da46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4377=['connect','shutdown','fullybooted','error','close','debug','format','[%s][index][devicestatechange]','devicestatechange','device','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','[%s][index][dialend]','asterisk-manager','../../config/environment','util','xdr','disabled','env','local','asterisk','port','username','password','keepConnected','info','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller'];(function(_0x296cc7,_0x514c16){var _0x1edb51=function(_0x5c82d0){while(--_0x5c82d0){_0x296cc7['push'](_0x296cc7['shift']());}};_0x1edb51(++_0x514c16);}(_0x4377,0x101));var _0x7437=function(_0x226860,_0x5aff5d){_0x226860=_0x226860-0x0;var _0x5aabef=_0x4377[_0x226860];return _0x5aabef;};var AsteriskManager=require(_0x7437('0x0'));var config=require(_0x7437('0x1'));var utils=require('./utils');var util=require(_0x7437('0x2'));var isXDREnabled=config[_0x7437('0x3')]&&config[_0x7437('0x3')][_0x7437('0x4')]?!config[_0x7437('0x3')][_0x7437('0x4')]:!![];var isProduction=config[_0x7437('0x5')]==='production'||![];var isLocalAsterisk=config[_0x7437('0x3')]&&config['xdr'][_0x7437('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x7437('0x7')][_0x7437('0x8')],config['asterisk']['ip'],config['asterisk'][_0x7437('0x9')],config[_0x7437('0x7')][_0x7437('0xa')],!![]);ami[_0x7437('0xb')]();if(!isXDREnabled){utils[_0x7437('0xc')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils['info']('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require(_0x7437('0xd'));var queues=require(_0x7437('0xe'));var recordings=require(_0x7437('0xf'));var members=require(_0x7437('0x10'));var dials=require(_0x7437('0x11'));var transfers=require('./transfers.controller');var core=require(_0x7437('0x12'));ami['on']('connect',core[_0x7437('0x13')]);ami['on']('shutdown',core[_0x7437('0x14')]);ami['on'](_0x7437('0x15'),core['fullybooted']);ami['on']('error',core[_0x7437('0x16')]);ami['on'](_0x7437('0x17'),core[_0x7437('0x17')]);ami['on']('managerevent',core['managerevent']);ami['on']('devicestatechange',function(_0x236026){try{utils[_0x7437('0x18')](util[_0x7437('0x19')](_0x7437('0x1a'),_0x236026['device']),_0x236026);members[_0x7437('0x1b')](_0x236026);}catch(_0x72d8be){utils[_0x7437('0x16')](util[_0x7437('0x19')](_0x7437('0x1a'),_0x236026[_0x7437('0x1c')]),_0x72d8be);}});ami['on'](_0x7437('0x1d'),function(_0x35572f){try{utils[_0x7437('0x18')](util[_0x7437('0x19')](_0x7437('0x1e'),_0x35572f[_0x7437('0x1f')]),_0x35572f);agents[_0x7437('0x1d')](_0x35572f);}catch(_0xa5f96){utils[_0x7437('0x16')](util[_0x7437('0x19')]('[%s][index][agentcalled]',_0x35572f[_0x7437('0x1f')]),_0xa5f96);}});ami['on']('agentringnoanswer',function(_0x437c4d){try{utils[_0x7437('0x18')](util[_0x7437('0x19')](_0x7437('0x20'),_0x437c4d[_0x7437('0x1f')]),_0x437c4d);agents[_0x7437('0x21')](_0x437c4d);}catch(_0x3af450){utils[_0x7437('0x16')](util['format']('[%s][index][agentringnoanswer]',_0x437c4d[_0x7437('0x1f')]),_0x3af450);}});ami['on'](_0x7437('0x22'),function(_0x2c7cf1){try{utils[_0x7437('0x18')](util[_0x7437('0x19')](_0x7437('0x23'),_0x2c7cf1[_0x7437('0x1f')]),_0x2c7cf1);agents[_0x7437('0x22')](_0x2c7cf1);queues[_0x7437('0x22')](_0x2c7cf1);}catch(_0x4c17cc){utils['error'](util['format']('[%s][index][agentconnect]',_0x2c7cf1[_0x7437('0x1f')]),_0x4c17cc);}});ami['on'](_0x7437('0x24'),function(_0x5dc4e8){try{utils['debug'](util[_0x7437('0x19')](_0x7437('0x25'),_0x5dc4e8['uniqueid']),_0x5dc4e8);agents[_0x7437('0x24')](_0x5dc4e8);queues[_0x7437('0x24')](_0x5dc4e8);members[_0x7437('0x24')](_0x5dc4e8);}catch(_0x129117){utils[_0x7437('0x16')](util[_0x7437('0x19')](_0x7437('0x25'),_0x5dc4e8[_0x7437('0x1f')]),_0x129117);}});ami['on'](_0x7437('0x26'),function(_0x3a306e){try{utils[_0x7437('0x18')](util[_0x7437('0x19')](_0x7437('0x27'),_0x3a306e[_0x7437('0x1f')]),_0x3a306e);agents[_0x7437('0x26')](_0x3a306e);queues[_0x7437('0x26')](_0x3a306e);}catch(_0x4a8dc7){utils[_0x7437('0x16')](util['format'](_0x7437('0x27'),_0x3a306e[_0x7437('0x1f')]),_0x4a8dc7);}});ami['on'](_0x7437('0x28'),function(_0x38560f){try{utils[_0x7437('0x18')](util[_0x7437('0x19')]('[%s][index][queuecallerjoin]',_0x38560f[_0x7437('0x1f')]),_0x38560f);queues[_0x7437('0x28')](_0x38560f);recordings[_0x7437('0x28')](_0x38560f);}catch(_0x2654bd){utils[_0x7437('0x16')](util['format'](_0x7437('0x29'),_0x38560f[_0x7437('0x1f')]),_0x2654bd);}});ami['on'](_0x7437('0x2a'),function(_0x537e98){try{utils[_0x7437('0x18')](util[_0x7437('0x19')](_0x7437('0x2b'),_0x537e98[_0x7437('0x1f')]),_0x537e98);queues[_0x7437('0x2a')](_0x537e98);}catch(_0x10c476){utils[_0x7437('0x16')](util['format']('[%s][index][queuecallerleave]',_0x537e98[_0x7437('0x1f')]),_0x10c476);}});ami['on'](_0x7437('0x2c'),function(_0xfc4d66){try{utils[_0x7437('0x18')](util[_0x7437('0x19')](_0x7437('0x2d'),_0xfc4d66[_0x7437('0x1f')]),_0xfc4d66);queues[_0x7437('0x2c')](_0xfc4d66);calls[_0x7437('0x2c')](_0xfc4d66);}catch(_0x5313d0){utils[_0x7437('0x16')](util[_0x7437('0x19')]('[%s][index][musiconholdstart]',_0xfc4d66[_0x7437('0x1f')]),_0x5313d0);}});ami['on']('musiconholdstop',function(_0x6c345){try{utils['debug'](util['format']('[%s][index][musiconholdstop]',_0x6c345[_0x7437('0x1f')]),_0x6c345);queues[_0x7437('0x2e')](_0x6c345);calls[_0x7437('0x2e')](_0x6c345);}catch(_0x42b246){utils[_0x7437('0x16')](util[_0x7437('0x19')](_0x7437('0x2f'),_0x6c345[_0x7437('0x1f')]),_0x42b246);}});ami['on'](_0x7437('0x30'),function(_0x50e7ee){try{utils['debug'](util['format'](_0x7437('0x31'),_0x50e7ee[_0x7437('0x1f')]),_0x50e7ee);calls[_0x7437('0x30')](_0x50e7ee);recordings[_0x7437('0x30')](_0x50e7ee);}catch(_0x1d7d9f){utils[_0x7437('0x16')](util[_0x7437('0x19')]('[%s][index][newstate]',_0x50e7ee[_0x7437('0x1f')]),_0x1d7d9f);}});ami['on'](_0x7437('0x32'),function(_0x211c73){try{utils[_0x7437('0x18')](util[_0x7437('0x19')](_0x7437('0x33'),_0x211c73[_0x7437('0x1f')]),_0x211c73);calls[_0x7437('0x32')](_0x211c73);recordings[_0x7437('0x32')](_0x211c73);dials[_0x7437('0x32')](_0x211c73);agents[_0x7437('0x32')](_0x211c73);queues[_0x7437('0x32')](_0x211c73);}catch(_0x56f6c8){utils[_0x7437('0x16')](util[_0x7437('0x19')](_0x7437('0x33'),_0x211c73[_0x7437('0x1f')]),_0x56f6c8);}});ami['on'](_0x7437('0x34'),function(_0x5c384e){try{utils[_0x7437('0x18')](util[_0x7437('0x19')](_0x7437('0x35'),_0x5c384e[_0x7437('0x1f')]),_0x5c384e);members['cdr'](_0x5c384e);}catch(_0x2558b4){utils[_0x7437('0x16')](util['format']('[%s][index][cdr]',_0x5c384e[_0x7437('0x1f')]),_0x2558b4);}});ami['on'](_0x7437('0x36'),function(_0x5a66a7){try{utils[_0x7437('0x18')](util['format'](_0x7437('0x37'),_0x5a66a7['uniqueid']),_0x5a66a7);queues[_0x7437('0x36')](_0x5a66a7);agents[_0x7437('0x36')](_0x5a66a7);transfers[_0x7437('0x36')](_0x5a66a7);recordings['blindtransfer'](_0x5a66a7);}catch(_0x42cc34){utils['error'](util[_0x7437('0x19')](_0x7437('0x37'),_0x5a66a7[_0x7437('0x1f')]),_0x42cc34);}});ami['on'](_0x7437('0x38'),function(_0x1c919d){try{utils[_0x7437('0x18')](util['format'](_0x7437('0x39'),_0x1c919d[_0x7437('0x3a')]),_0x1c919d);queues['attendedtransfer'](_0x1c919d);transfers[_0x7437('0x38')](_0x1c919d);agents[_0x7437('0x38')](_0x1c919d);calls[_0x7437('0x38')](_0x1c919d);}catch(_0x4fc4fc){utils[_0x7437('0x16')](util[_0x7437('0x19')](_0x7437('0x39'),_0x1c919d['origtransfereruniqueid']),_0x4fc4fc);}});ami['on'](_0x7437('0x3b'),function(_0x2cad4f){try{utils[_0x7437('0x18')](util[_0x7437('0x19')](_0x7437('0x3c'),_0x2cad4f[_0x7437('0x1f')]),_0x2cad4f);queues['varset'](_0x2cad4f);recordings[_0x7437('0x3b')](_0x2cad4f);calls[_0x7437('0x3b')](_0x2cad4f);dials[_0x7437('0x3b')](_0x2cad4f);}catch(_0x5cdc06){utils[_0x7437('0x16')](util[_0x7437('0x19')](_0x7437('0x3c'),_0x2cad4f[_0x7437('0x1f')]),_0x5cdc06);}});ami['on']('newexten',function(_0x91ff3c){try{utils['debug'](util[_0x7437('0x19')](_0x7437('0x3d'),_0x91ff3c[_0x7437('0x1f')]),_0x91ff3c);calls[_0x7437('0x3e')](_0x91ff3c);recordings[_0x7437('0x3e')](_0x91ff3c);dials[_0x7437('0x3e')](_0x91ff3c);}catch(_0x38ba7e){utils[_0x7437('0x16')](util['format'](_0x7437('0x3d'),_0x91ff3c[_0x7437('0x1f')]),_0x38ba7e);}});ami['on'](_0x7437('0x3f'),function(_0x1ee322){try{utils['debug'](util[_0x7437('0x19')](_0x7437('0x40'),_0x1ee322[_0x7437('0x1f')]),_0x1ee322);calls['newchannel'](_0x1ee322);recordings[_0x7437('0x3f')](_0x1ee322);}catch(_0x5d2d47){utils[_0x7437('0x16')](util[_0x7437('0x19')](_0x7437('0x40'),_0x1ee322['uniqueid']),_0x5d2d47);}});ami['on']('dialbegin',function(_0x1aee34){try{utils[_0x7437('0x18')](util[_0x7437('0x19')](_0x7437('0x41'),_0x1aee34['uniqueid']),_0x1aee34);dials[_0x7437('0x42')](_0x1aee34);}catch(_0x333c04){utils['error'](util[_0x7437('0x19')](_0x7437('0x43'),_0x1aee34[_0x7437('0x1f')]),_0x333c04);}});ami['on']('dialend',function(_0x579c8b){try{utils['debug'](util[_0x7437('0x19')]('[%s][index][dialend]',_0x579c8b[_0x7437('0x1f')]),_0x579c8b);dials['dialend'](_0x579c8b);}catch(_0x2b6e6e){utils['error'](util[_0x7437('0x19')](_0x7437('0x44'),_0x579c8b[_0x7437('0x1f')]),_0x2b6e6e);}});}
\ No newline at end of file
+var _0x1e40=['keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','error','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','util','xdr','disabled','env','asterisk','username','password'];(function(_0x4bd3f8,_0x1b71ee){var _0x3c65ea=function(_0x47ff31){while(--_0x47ff31){_0x4bd3f8['push'](_0x4bd3f8['shift']());}};_0x3c65ea(++_0x1b71ee);}(_0x1e40,0x83));var _0x01e4=function(_0x1e86a9,_0x281305){_0x1e86a9=_0x1e86a9-0x0;var _0x290e0b=_0x1e40[_0x1e86a9];return _0x290e0b;};var AsteriskManager=require('asterisk-manager');var config=require(_0x01e4('0x0'));var utils=require(_0x01e4('0x1'));var util=require(_0x01e4('0x2'));var isXDREnabled=config[_0x01e4('0x3')]&&config[_0x01e4('0x3')][_0x01e4('0x4')]?!config[_0x01e4('0x3')][_0x01e4('0x4')]:!![];var isProduction=config[_0x01e4('0x5')]==='production'||![];var isLocalAsterisk=config['xdr']&&config['xdr']['local']===!![]||![];var ami=new AsteriskManager(config[_0x01e4('0x6')]['port'],config['asterisk']['ip'],config['asterisk'][_0x01e4('0x7')],config[_0x01e4('0x6')][_0x01e4('0x8')],!![]);ami[_0x01e4('0x9')]();if(!isXDREnabled){utils['info'](_0x01e4('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x01e4('0xb')](_0x01e4('0xc'));}else{var agents=require('./agents.controller');var calls=require(_0x01e4('0xd'));var queues=require(_0x01e4('0xe'));var recordings=require(_0x01e4('0xf'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0x01e4('0x10'));var core=require(_0x01e4('0x11'));ami['on']('connect',core[_0x01e4('0x12')]);ami['on'](_0x01e4('0x13'),core['shutdown']);ami['on'](_0x01e4('0x14'),core[_0x01e4('0x14')]);ami['on']('error',core['error']);ami['on'](_0x01e4('0x15'),core[_0x01e4('0x15')]);ami['on'](_0x01e4('0x16'),core[_0x01e4('0x16')]);ami['on'](_0x01e4('0x17'),function(_0x40ffb5){try{utils[_0x01e4('0x18')](util[_0x01e4('0x19')](_0x01e4('0x1a'),_0x40ffb5[_0x01e4('0x1b')]),_0x40ffb5);members[_0x01e4('0x17')](_0x40ffb5);}catch(_0x2643df){utils[_0x01e4('0x1c')](util[_0x01e4('0x19')](_0x01e4('0x1a'),_0x40ffb5[_0x01e4('0x1b')]),_0x2643df);}});ami['on'](_0x01e4('0x1d'),function(_0x5cd78d){try{utils[_0x01e4('0x18')](util['format'](_0x01e4('0x1e'),_0x5cd78d[_0x01e4('0x1f')]),_0x5cd78d);agents['agentcalled'](_0x5cd78d);}catch(_0x1230a1){utils[_0x01e4('0x1c')](util[_0x01e4('0x19')]('[%s][index][agentcalled]',_0x5cd78d[_0x01e4('0x1f')]),_0x1230a1);}});ami['on']('agentringnoanswer',function(_0x32aab9){try{utils[_0x01e4('0x18')](util[_0x01e4('0x19')](_0x01e4('0x20'),_0x32aab9[_0x01e4('0x1f')]),_0x32aab9);agents[_0x01e4('0x21')](_0x32aab9);}catch(_0x109bed){utils[_0x01e4('0x1c')](util[_0x01e4('0x19')](_0x01e4('0x20'),_0x32aab9[_0x01e4('0x1f')]),_0x109bed);}});ami['on'](_0x01e4('0x22'),function(_0x34bd3a){try{utils[_0x01e4('0x18')](util[_0x01e4('0x19')]('[%s][index][agentconnect]',_0x34bd3a[_0x01e4('0x1f')]),_0x34bd3a);agents[_0x01e4('0x22')](_0x34bd3a);queues[_0x01e4('0x22')](_0x34bd3a);}catch(_0x4fd695){utils[_0x01e4('0x1c')](util[_0x01e4('0x19')](_0x01e4('0x23'),_0x34bd3a[_0x01e4('0x1f')]),_0x4fd695);}});ami['on'](_0x01e4('0x24'),function(_0x32ea46){try{utils[_0x01e4('0x18')](util[_0x01e4('0x19')](_0x01e4('0x25'),_0x32ea46[_0x01e4('0x1f')]),_0x32ea46);agents[_0x01e4('0x24')](_0x32ea46);queues[_0x01e4('0x24')](_0x32ea46);members[_0x01e4('0x24')](_0x32ea46);}catch(_0x2f607d){utils[_0x01e4('0x1c')](util['format'](_0x01e4('0x25'),_0x32ea46[_0x01e4('0x1f')]),_0x2f607d);}});ami['on'](_0x01e4('0x26'),function(_0x451897){try{utils[_0x01e4('0x18')](util[_0x01e4('0x19')](_0x01e4('0x27'),_0x451897[_0x01e4('0x1f')]),_0x451897);agents[_0x01e4('0x26')](_0x451897);queues[_0x01e4('0x26')](_0x451897);}catch(_0x47fdc5){utils[_0x01e4('0x1c')](util[_0x01e4('0x19')](_0x01e4('0x27'),_0x451897['uniqueid']),_0x47fdc5);}});ami['on']('queuecallerjoin',function(_0x285faf){try{utils[_0x01e4('0x18')](util[_0x01e4('0x19')](_0x01e4('0x28'),_0x285faf[_0x01e4('0x1f')]),_0x285faf);queues[_0x01e4('0x29')](_0x285faf);recordings[_0x01e4('0x29')](_0x285faf);}catch(_0x4f2a2e){utils[_0x01e4('0x1c')](util[_0x01e4('0x19')](_0x01e4('0x28'),_0x285faf[_0x01e4('0x1f')]),_0x4f2a2e);}});ami['on'](_0x01e4('0x2a'),function(_0x7291f9){try{utils['debug'](util[_0x01e4('0x19')](_0x01e4('0x2b'),_0x7291f9[_0x01e4('0x1f')]),_0x7291f9);queues[_0x01e4('0x2a')](_0x7291f9);}catch(_0x12532e){utils[_0x01e4('0x1c')](util[_0x01e4('0x19')](_0x01e4('0x2b'),_0x7291f9[_0x01e4('0x1f')]),_0x12532e);}});ami['on']('musiconholdstart',function(_0x1a4153){try{utils[_0x01e4('0x18')](util[_0x01e4('0x19')](_0x01e4('0x2c'),_0x1a4153['uniqueid']),_0x1a4153);queues[_0x01e4('0x2d')](_0x1a4153);calls[_0x01e4('0x2d')](_0x1a4153);}catch(_0x558e4e){utils[_0x01e4('0x1c')](util[_0x01e4('0x19')](_0x01e4('0x2c'),_0x1a4153[_0x01e4('0x1f')]),_0x558e4e);}});ami['on'](_0x01e4('0x2e'),function(_0x10011c){try{utils[_0x01e4('0x18')](util[_0x01e4('0x19')]('[%s][index][musiconholdstop]',_0x10011c['uniqueid']),_0x10011c);queues['musiconholdstop'](_0x10011c);calls[_0x01e4('0x2e')](_0x10011c);}catch(_0x48d9cd){utils[_0x01e4('0x1c')](util[_0x01e4('0x19')](_0x01e4('0x2f'),_0x10011c[_0x01e4('0x1f')]),_0x48d9cd);}});ami['on'](_0x01e4('0x30'),function(_0x27e7ed){try{utils[_0x01e4('0x18')](util[_0x01e4('0x19')](_0x01e4('0x31'),_0x27e7ed[_0x01e4('0x1f')]),_0x27e7ed);calls[_0x01e4('0x30')](_0x27e7ed);recordings[_0x01e4('0x30')](_0x27e7ed);}catch(_0x46f788){utils['error'](util['format'](_0x01e4('0x31'),_0x27e7ed[_0x01e4('0x1f')]),_0x46f788);}});ami['on']('hangup',function(_0x106a02){try{utils['debug'](util[_0x01e4('0x19')](_0x01e4('0x32'),_0x106a02['uniqueid']),_0x106a02);calls[_0x01e4('0x33')](_0x106a02);recordings['hangup'](_0x106a02);dials[_0x01e4('0x33')](_0x106a02);agents[_0x01e4('0x33')](_0x106a02);queues[_0x01e4('0x33')](_0x106a02);}catch(_0x44ba09){utils[_0x01e4('0x1c')](util['format'](_0x01e4('0x32'),_0x106a02[_0x01e4('0x1f')]),_0x44ba09);}});ami['on']('cdr',function(_0x3680dd){try{utils[_0x01e4('0x18')](util[_0x01e4('0x19')]('[%s][index][cdr]',_0x3680dd[_0x01e4('0x1f')]),_0x3680dd);members[_0x01e4('0x34')](_0x3680dd);}catch(_0x5b0e5b){utils[_0x01e4('0x1c')](util['format'](_0x01e4('0x35'),_0x3680dd[_0x01e4('0x1f')]),_0x5b0e5b);}});ami['on'](_0x01e4('0x36'),function(_0x4f3744){try{utils[_0x01e4('0x18')](util[_0x01e4('0x19')](_0x01e4('0x37'),_0x4f3744['uniqueid']),_0x4f3744);queues[_0x01e4('0x36')](_0x4f3744);agents[_0x01e4('0x36')](_0x4f3744);transfers['blindtransfer'](_0x4f3744);recordings['blindtransfer'](_0x4f3744);}catch(_0x370fe8){utils[_0x01e4('0x1c')](util[_0x01e4('0x19')](_0x01e4('0x37'),_0x4f3744[_0x01e4('0x1f')]),_0x370fe8);}});ami['on'](_0x01e4('0x38'),function(_0x4c97c9){try{utils[_0x01e4('0x18')](util['format'](_0x01e4('0x39'),_0x4c97c9[_0x01e4('0x3a')]),_0x4c97c9);queues[_0x01e4('0x38')](_0x4c97c9);transfers[_0x01e4('0x38')](_0x4c97c9);agents[_0x01e4('0x38')](_0x4c97c9);calls[_0x01e4('0x38')](_0x4c97c9);}catch(_0x3f7e9d){utils['error'](util[_0x01e4('0x19')](_0x01e4('0x39'),_0x4c97c9[_0x01e4('0x3a')]),_0x3f7e9d);}});ami['on'](_0x01e4('0x3b'),function(_0x4e0a82){try{utils[_0x01e4('0x18')](util[_0x01e4('0x19')](_0x01e4('0x3c'),_0x4e0a82[_0x01e4('0x1f')]),_0x4e0a82);queues['varset'](_0x4e0a82);recordings[_0x01e4('0x3b')](_0x4e0a82);calls['varset'](_0x4e0a82);dials[_0x01e4('0x3b')](_0x4e0a82);}catch(_0x25b54f){utils[_0x01e4('0x1c')](util[_0x01e4('0x19')](_0x01e4('0x3c'),_0x4e0a82['uniqueid']),_0x25b54f);}});ami['on']('newexten',function(_0x2aba4b){try{utils[_0x01e4('0x18')](util['format'](_0x01e4('0x3d'),_0x2aba4b[_0x01e4('0x1f')]),_0x2aba4b);calls[_0x01e4('0x3e')](_0x2aba4b);recordings['newexten'](_0x2aba4b);dials['newexten'](_0x2aba4b);}catch(_0x3e2363){utils['error'](util[_0x01e4('0x19')](_0x01e4('0x3d'),_0x2aba4b[_0x01e4('0x1f')]),_0x3e2363);}});ami['on'](_0x01e4('0x3f'),function(_0x164bce){try{utils[_0x01e4('0x18')](util[_0x01e4('0x19')]('[%s][index][newchannel]',_0x164bce[_0x01e4('0x1f')]),_0x164bce);calls['newchannel'](_0x164bce);recordings[_0x01e4('0x3f')](_0x164bce);}catch(_0x2b3288){utils[_0x01e4('0x1c')](util[_0x01e4('0x19')](_0x01e4('0x40'),_0x164bce[_0x01e4('0x1f')]),_0x2b3288);}});ami['on'](_0x01e4('0x41'),function(_0x3ef5e4){try{utils[_0x01e4('0x18')](util['format'](_0x01e4('0x42'),_0x3ef5e4[_0x01e4('0x1f')]),_0x3ef5e4);dials[_0x01e4('0x41')](_0x3ef5e4);}catch(_0x319981){utils[_0x01e4('0x1c')](util[_0x01e4('0x19')](_0x01e4('0x43'),_0x3ef5e4['uniqueid']),_0x319981);}});ami['on'](_0x01e4('0x44'),function(_0x3a6bb2){try{utils['debug'](util[_0x01e4('0x19')](_0x01e4('0x45'),_0x3a6bb2[_0x01e4('0x1f')]),_0x3a6bb2);dials[_0x01e4('0x44')](_0x3a6bb2);}catch(_0x10be52){utils[_0x01e4('0x1c')](util[_0x01e4('0x19')](_0x01e4('0x45'),_0x3a6bb2[_0x01e4('0x1f')]),_0x10be52);}});}
\ No newline at end of file
index 45c726e..6b893f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92f0=['some','startsWith','debug','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','INUSE','voice','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','queue','assign','cdr','data1','source','data3','destination','destinationchannel','type','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','[%s][members][cdr]','util','./utils','Queue:','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','name','internal','request','CreateMemberReport','split','then','catch','error','format','[%s][members][writeDB]'];(function(_0x560448,_0x2c1082){var _0x550276=function(_0x37e949){while(--_0x37e949){_0x560448['push'](_0x560448['shift']());}};_0x550276(++_0x2c1082);}(_0x92f0,0x10d));var _0x092f=function(_0x2b57fc,_0x4b3658){_0x2b57fc=_0x2b57fc-0x0;var _0x5bf238=_0x92f0[_0x2b57fc];return _0x5bf238;};'use strict';var _=require('lodash');var util=require(_0x092f('0x0'));var utils=require(_0x092f('0x1'));var members={};var exclude=['Local/_attended@transfer',_0x092f('0x2')];function writeDB(_0x2530d4){utils['info'](util['format'](_0x092f('0x3'),_0x2530d4[_0x092f('0x4')],_0x2530d4[_0x092f('0x5')],_0x2530d4[_0x092f('0x6')],_0x2530d4[_0x092f('0x7')],_0x2530d4[_0x092f('0x8')],_0x2530d4['type']));if(_0x2530d4[_0x092f('0x5')]){utils['getUserByInterface'](_0x2530d4[_0x092f('0x5')])['then'](function(_0x30c479){if(_0x30c479){_0x2530d4['membername']=_0x30c479[_0x092f('0x9')];_0x2530d4['internal']=_0x30c479[_0x092f('0xa')];utils[_0x092f('0xb')](_0x092f('0xc'),_0x2530d4);}else{utils['getUserByName'](_0x2530d4[_0x092f('0x5')][_0x092f('0xd')]('/')[0x1])[_0x092f('0xe')](function(_0xbe6f12){if(_0xbe6f12){_0x2530d4[_0x092f('0x8')]=_0xbe6f12['name'];_0x2530d4[_0x092f('0xa')]=_0xbe6f12[_0x092f('0xa')];utils['request'](_0x092f('0xc'),_0x2530d4);}});}})[_0x092f('0xf')](function(_0x33f761){utils[_0x092f('0x10')](util[_0x092f('0x11')](_0x092f('0x12'),_0x2530d4[_0x092f('0x4')]),_0x33f761);});}delete members[_0x2530d4[_0x092f('0x5')]];}function startsWith(_0x4e4d0f,_0x352456){return _[_0x092f('0x13')](_0x4e4d0f,function(_0x33b0c0){return _[_0x092f('0x14')](_0x352456,_0x33b0c0);});}exports['devicestatechange']=function(_0x530214){try{utils[_0x092f('0x15')](util[_0x092f('0x11')](_0x092f('0x16'),members[_0x530214[_0x092f('0x17')]]?members[_0x530214[_0x092f('0x17')]]['uniqueid']:_0x530214['device']),_0x530214);utils[_0x092f('0x18')](util[_0x092f('0x11')](_0x092f('0x19'),members[_0x530214[_0x092f('0x17')]]?members[_0x530214[_0x092f('0x17')]]['uniqueid']:_0x530214[_0x092f('0x17')],_0x530214['state'],_0x530214['device']));switch(_0x530214['state']){case _0x092f('0x1a'):case'BUSY':if(!startsWith(exclude,_0x530214['device'])){members[_0x530214[_0x092f('0x17')]]={'channel':_0x092f('0x1b'),'interface':_0x530214[_0x092f('0x17')],'type':'TALKING','enterAt':utils[_0x092f('0x1c')](),'role':'agent'};}break;case _0x092f('0x1d'):if(!_[_0x092f('0x1e')](members[_0x530214[_0x092f('0x17')]])){members[_0x530214[_0x092f('0x17')]][_0x092f('0x1f')]=utils[_0x092f('0x1c')]();members[_0x530214[_0x092f('0x17')]][_0x092f('0x20')]=utils[_0x092f('0x21')](members[_0x530214[_0x092f('0x17')]][_0x092f('0x1f')],members[_0x530214[_0x092f('0x17')]][_0x092f('0x22')]);if(members[_0x530214[_0x092f('0x17')]]['uniqueid']){writeDB(members[_0x530214[_0x092f('0x17')]]);}}break;default:break;}}catch(_0x459140){utils['error'](util[_0x092f('0x11')]('[%s][members][devicestatechange]',members[_0x530214['device']]?members[_0x530214[_0x092f('0x17')]][_0x092f('0x4')]:_0x530214[_0x092f('0x17')]),_0x459140);}};exports[_0x092f('0x23')]=function(_0x4c9cd0){try{if(!_[_0x092f('0x1e')](members[_0x4c9cd0['interface']])){utils[_0x092f('0x15')](util[_0x092f('0x11')](_0x092f('0x24'),_0x4c9cd0[_0x092f('0x4')]),_0x4c9cd0);utils[_0x092f('0x18')](util[_0x092f('0x11')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x4c9cd0['uniqueid'],_0x4c9cd0['interface'],_0x4c9cd0[_0x092f('0x25')]));members[_0x4c9cd0['interface']]=_[_0x092f('0x26')](members[_0x4c9cd0['interface']],{'data4':_0x4c9cd0[_0x092f('0x25')],'uniqueid':_0x4c9cd0[_0x092f('0x4')]});}}catch(_0x5a0b57){utils[_0x092f('0x10')](util['format'](_0x092f('0x24'),_0x4c9cd0[_0x092f('0x4')]),_0x5a0b57);}};exports[_0x092f('0x27')]=function(_0x2f697f){try{utils[_0x092f('0x15')](util[_0x092f('0x11')]('[%s][members][cdr]',_0x2f697f[_0x092f('0x4')]),_0x2f697f);if(_0x2f697f[_0x092f('0x6')]){var _0x3beaad=_0x2f697f[_0x092f('0x6')]['split']('-')[0x0];if(!_[_0x092f('0x1e')](members[_0x3beaad])){members[_0x3beaad]=_[_0x092f('0x26')](members[_0x3beaad],{'data1':members[_0x3beaad][_0x092f('0x28')]||_0x2f697f['type'],'data2':members[_0x3beaad][_0x092f('0x7')]||_0x2f697f[_0x092f('0x29')],'data3':members[_0x3beaad][_0x092f('0x2a')]||_0x2f697f[_0x092f('0x2b')],'uniqueid':members[_0x3beaad][_0x092f('0x4')]||_0x2f697f[_0x092f('0x4')]});utils[_0x092f('0x18')](util[_0x092f('0x11')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x2f697f['uniqueid'],members[_0x3beaad][_0x092f('0x28')],members[_0x3beaad]['data2'],members[_0x3beaad][_0x092f('0x2a')]));if(members[_0x3beaad][_0x092f('0x1f')]){writeDB(members[_0x3beaad]);}}}if(_0x2f697f[_0x092f('0x2c')]){var _0x284017=_0x2f697f[_0x092f('0x2c')][_0x092f('0xd')]('-')[0x0];if(!_['isNil'](members[_0x284017])){members[_0x284017]=_[_0x092f('0x26')](members[_0x284017],{'data1':members[_0x284017][_0x092f('0x28')]||_0x2f697f[_0x092f('0x2d')],'data2':members[_0x284017][_0x092f('0x7')]||_0x2f697f[_0x092f('0x29')],'data3':members[_0x284017][_0x092f('0x2a')]||_0x2f697f[_0x092f('0x2b')],'uniqueid':members[_0x284017][_0x092f('0x4')]||_0x2f697f[_0x092f('0x4')]});utils[_0x092f('0x18')](util['format'](_0x092f('0x2e'),_0x2f697f['uniqueid'],members[_0x284017]['data1'],members[_0x284017]['data2'],members[_0x284017][_0x092f('0x2a')]));if(members[_0x284017][_0x092f('0x1f')]){writeDB(members[_0x284017]);}}}}catch(_0x428c3e){utils[_0x092f('0x10')](util[_0x092f('0x11')](_0x092f('0x2f'),_0x2f697f[_0x092f('0x4')]),_0x428c3e);}};
\ No newline at end of file
+var _0x537f=['CreateMemberReport','getUserByName','split','then','error','[%s][members][writeDB]','uniqueid','some','startsWith','[%s][members][devicestatechange]','device','state','INUSE','voice','agent','NOT_INUSE','isNil','exitAt','now','duration','diffTime','enterAt','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]','channel','data3','data1','destinationchannel','assign','source','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','data2','membername','type','getUserByInterface','name','internal','request'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x537f,0x1c4));var _0xf537=function(_0x4d9afa,_0xf1ba34){_0x4d9afa=_0x4d9afa-0x0;var _0x8d1495=_0x537f[_0x4d9afa];return _0x8d1495;};'use strict';var _=require(_0xf537('0x0'));var util=require(_0xf537('0x1'));var utils=require(_0xf537('0x2'));var members={};var exclude=[_0xf537('0x3'),_0xf537('0x4')];function writeDB(_0x5c3bc3){utils[_0xf537('0x5')](util[_0xf537('0x6')](_0xf537('0x7'),_0x5c3bc3['uniqueid'],_0x5c3bc3[_0xf537('0x8')],_0x5c3bc3['channel'],_0x5c3bc3[_0xf537('0x9')],_0x5c3bc3[_0xf537('0xa')],_0x5c3bc3[_0xf537('0xb')]));if(_0x5c3bc3[_0xf537('0x8')]){utils[_0xf537('0xc')](_0x5c3bc3['interface'])['then'](function(_0x6d099a){if(_0x6d099a){_0x5c3bc3[_0xf537('0xa')]=_0x6d099a[_0xf537('0xd')];_0x5c3bc3[_0xf537('0xe')]=_0x6d099a[_0xf537('0xe')];utils[_0xf537('0xf')](_0xf537('0x10'),_0x5c3bc3);}else{utils[_0xf537('0x11')](_0x5c3bc3[_0xf537('0x8')][_0xf537('0x12')]('/')[0x1])[_0xf537('0x13')](function(_0x41eba1){if(_0x41eba1){_0x5c3bc3[_0xf537('0xa')]=_0x41eba1['name'];_0x5c3bc3[_0xf537('0xe')]=_0x41eba1[_0xf537('0xe')];utils['request'](_0xf537('0x10'),_0x5c3bc3);}});}})['catch'](function(_0x2a1b3c){utils[_0xf537('0x14')](util[_0xf537('0x6')](_0xf537('0x15'),_0x5c3bc3[_0xf537('0x16')]),_0x2a1b3c);});}delete members[_0x5c3bc3['interface']];}function startsWith(_0x14a917,_0x53595b){return _[_0xf537('0x17')](_0x14a917,function(_0x3060d2){return _[_0xf537('0x18')](_0x53595b,_0x3060d2);});}exports['devicestatechange']=function(_0x276f94){try{utils['debug'](util[_0xf537('0x6')](_0xf537('0x19'),members[_0x276f94['device']]?members[_0x276f94[_0xf537('0x1a')]][_0xf537('0x16')]:_0x276f94['device']),_0x276f94);utils[_0xf537('0x5')](util[_0xf537('0x6')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x276f94[_0xf537('0x1a')]]?members[_0x276f94['device']][_0xf537('0x16')]:_0x276f94[_0xf537('0x1a')],_0x276f94[_0xf537('0x1b')],_0x276f94['device']));switch(_0x276f94['state']){case _0xf537('0x1c'):case'BUSY':if(!startsWith(exclude,_0x276f94[_0xf537('0x1a')])){members[_0x276f94[_0xf537('0x1a')]]={'channel':_0xf537('0x1d'),'interface':_0x276f94[_0xf537('0x1a')],'type':'TALKING','enterAt':utils['now'](),'role':_0xf537('0x1e')};}break;case _0xf537('0x1f'):if(!_[_0xf537('0x20')](members[_0x276f94[_0xf537('0x1a')]])){members[_0x276f94[_0xf537('0x1a')]][_0xf537('0x21')]=utils[_0xf537('0x22')]();members[_0x276f94['device']][_0xf537('0x23')]=utils[_0xf537('0x24')](members[_0x276f94[_0xf537('0x1a')]][_0xf537('0x21')],members[_0x276f94['device']][_0xf537('0x25')]);if(members[_0x276f94[_0xf537('0x1a')]][_0xf537('0x16')]){writeDB(members[_0x276f94[_0xf537('0x1a')]]);}}break;default:break;}}catch(_0x46d0c5){utils['error'](util[_0xf537('0x6')](_0xf537('0x19'),members[_0x276f94[_0xf537('0x1a')]]?members[_0x276f94['device']]['uniqueid']:_0x276f94[_0xf537('0x1a')]),_0x46d0c5);}};exports[_0xf537('0x26')]=function(_0x21e9c7){try{if(!_[_0xf537('0x20')](members[_0x21e9c7[_0xf537('0x8')]])){utils[_0xf537('0x27')](util[_0xf537('0x6')](_0xf537('0x28'),_0x21e9c7[_0xf537('0x16')]),_0x21e9c7);utils['info'](util[_0xf537('0x6')](_0xf537('0x29'),_0x21e9c7[_0xf537('0x16')],_0x21e9c7[_0xf537('0x8')],_0x21e9c7['queue']));members[_0x21e9c7[_0xf537('0x8')]]=_['assign'](members[_0x21e9c7[_0xf537('0x8')]],{'data4':_0x21e9c7[_0xf537('0x2a')],'uniqueid':_0x21e9c7['uniqueid']});}}catch(_0xf632b9){utils[_0xf537('0x14')](util[_0xf537('0x6')](_0xf537('0x28'),_0x21e9c7[_0xf537('0x16')]),_0xf632b9);}};exports[_0xf537('0x2b')]=function(_0x347dda){try{utils[_0xf537('0x27')](util[_0xf537('0x6')](_0xf537('0x2c'),_0x347dda[_0xf537('0x16')]),_0x347dda);if(_0x347dda[_0xf537('0x2d')]){var _0x490384=_0x347dda[_0xf537('0x2d')]['split']('-')[0x0];if(!_[_0xf537('0x20')](members[_0x490384])){members[_0x490384]=_['assign'](members[_0x490384],{'data1':members[_0x490384]['data1']||_0x347dda[_0xf537('0xb')],'data2':members[_0x490384]['data2']||_0x347dda['source'],'data3':members[_0x490384][_0xf537('0x2e')]||_0x347dda['destination'],'uniqueid':members[_0x490384][_0xf537('0x16')]||_0x347dda[_0xf537('0x16')]});utils['info'](util[_0xf537('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x347dda['uniqueid'],members[_0x490384][_0xf537('0x2f')],members[_0x490384][_0xf537('0x9')],members[_0x490384][_0xf537('0x2e')]));if(members[_0x490384][_0xf537('0x21')]){writeDB(members[_0x490384]);}}}if(_0x347dda['destinationchannel']){var _0x44d917=_0x347dda[_0xf537('0x30')][_0xf537('0x12')]('-')[0x0];if(!_[_0xf537('0x20')](members[_0x44d917])){members[_0x44d917]=_[_0xf537('0x31')](members[_0x44d917],{'data1':members[_0x44d917][_0xf537('0x2f')]||_0x347dda['type'],'data2':members[_0x44d917][_0xf537('0x9')]||_0x347dda[_0xf537('0x32')],'data3':members[_0x44d917][_0xf537('0x2e')]||_0x347dda['destination'],'uniqueid':members[_0x44d917][_0xf537('0x16')]||_0x347dda['uniqueid']});utils[_0xf537('0x5')](util[_0xf537('0x6')](_0xf537('0x33'),_0x347dda[_0xf537('0x16')],members[_0x44d917][_0xf537('0x2f')],members[_0x44d917][_0xf537('0x9')],members[_0x44d917][_0xf537('0x2e')]));if(members[_0x44d917][_0xf537('0x21')]){writeDB(members[_0x44d917]);}}}}catch(_0xfaf9e4){utils[_0xf537('0x14')](util[_0xf537('0x6')]('[%s][members][cdr]',_0x347dda['uniqueid']),_0xfaf9e4);}};
\ No newline at end of file
index c3bc8ac..4e0d61a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fb7=['queuecallerjoinAt','position','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','[%s][queues][blindtransfer]','transfertype','BLIND','extension','transfereeuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','ATTENDED','transferexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','now','error','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','name','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','diffTime'];(function(_0x37897a,_0x1a355a){var _0x2701fb=function(_0x545c7e){while(--_0x545c7e){_0x37897a['push'](_0x37897a['shift']());}};_0x2701fb(++_0x1a355a);}(_0x1fb7,0x171));var _0x71fb=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0x1fb7[_0x296923];return _0x29af70;};'use strict';var _=require(_0x71fb('0x0'));var util=require(_0x71fb('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x1f5d04){utils['info'](util[_0x71fb('0x2')](_0x71fb('0x3'),_0x1f5d04[_0x71fb('0x4')],_0x1f5d04[_0x71fb('0x5')],_0x1f5d04[_0x71fb('0x6')],_0x1f5d04[_0x71fb('0x7')],_0x1f5d04[_0x71fb('0x8')],_0x1f5d04[_0x71fb('0x9')],_0x1f5d04[_0x71fb('0xa')]));if(_0x1f5d04[_0x71fb('0x6')]){utils['getVoiceQueueByName'](_0x1f5d04[_0x71fb('0x6')])['then'](function(_0x143018){if(_0x143018){_0x1f5d04['type']=_0x143018[_0x71fb('0xb')];}utils[_0x71fb('0xc')](_0x71fb('0xd'),_0x1f5d04);});}else{utils[_0x71fb('0xc')]('CreateVoiceQueueReport',_0x1f5d04);}if(_0x1f5d04[_0x71fb('0xe')]){delete queues[_0x1f5d04[_0x71fb('0xe')]];}else{delete queues[_0x1f5d04[_0x71fb('0x4')]];}}exports[_0x71fb('0xf')]=function(_0x8435a7){try{utils[_0x71fb('0x10')](util[_0x71fb('0x2')](_0x71fb('0x11'),_0x8435a7[_0x71fb('0x4')]),_0x8435a7);utils[_0x71fb('0x12')](util['format'](_0x71fb('0x13'),_0x8435a7[_0x71fb('0x4')],_0x8435a7[_0x71fb('0x6')],_0x8435a7['position']));queues[_0x8435a7[_0x71fb('0x4')]]=_[_0x71fb('0x14')](_0x8435a7,{'originalposition':_0x8435a7['position'],'queuecallerjoinAt':utils[_0x71fb('0x15')](),'mohtime':0x0});}catch(_0x2bff96){utils[_0x71fb('0x16')](util[_0x71fb('0x2')](_0x71fb('0x11'),_0x8435a7['uniqueid']),_0x2bff96);}};exports['hangup']=function(_0x4127a6){try{if(!_[_0x71fb('0x17')](queues[_0x4127a6[_0x71fb('0x4')]])){utils[_0x71fb('0x10')](util['format']('[%s][queues][hangup]',_0x4127a6['uniqueid']),_0x4127a6);if(queues[_0x4127a6[_0x71fb('0x4')]][_0x71fb('0x18')]){if(!queues[_0x4127a6['uniqueid']][_0x71fb('0x19')]&&!queues[_0x4127a6[_0x71fb('0x4')]][_0x71fb('0x1a')]){queues[_0x4127a6['uniqueid']][_0x71fb('0x1b')]=!![];queues[_0x4127a6[_0x71fb('0x4')]]['queuecallercompleteAt']=utils[_0x71fb('0x15')]();queues[_0x4127a6['uniqueid']][_0x71fb('0xa')]='COMPLETEDBYAGENT';}utils[_0x71fb('0x12')](util[_0x71fb('0x2')](_0x71fb('0x1c'),_0x4127a6['uniqueid'],queues[_0x4127a6['uniqueid']]['name'],queues[_0x4127a6[_0x71fb('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x4127a6[_0x71fb('0x4')]]);}else if(queues[_0x4127a6[_0x71fb('0x4')]][_0x71fb('0xe')]){utils['info'](util['format'](_0x71fb('0x1d'),_0x4127a6[_0x71fb('0x4')],queues[_0x4127a6['uniqueid']]['name'],queues[_0x4127a6[_0x71fb('0x4')]][_0x71fb('0xe')]));queues[queues[_0x4127a6['uniqueid']][_0x71fb('0xe')]]=queues[_0x4127a6['uniqueid']];queues[queues[_0x4127a6[_0x71fb('0x4')]][_0x71fb('0xe')]]['queuecallerenterreason']=0x2;delete queues[_0x4127a6[_0x71fb('0x4')]];}}}catch(_0x3fd94d){utils['error'](util[_0x71fb('0x2')](_0x71fb('0x1e'),_0x4127a6[_0x71fb('0x4')]),_0x3fd94d);}};exports[_0x71fb('0x1f')]=function(_0xde3c26){try{utils[_0x71fb('0x10')](util[_0x71fb('0x2')](_0x71fb('0x20'),_0xde3c26[_0x71fb('0x4')]),_0xde3c26);if(!_[_0x71fb('0x17')](_0xde3c26[_0x71fb('0x21')][_0x71fb('0x22')])&&_0xde3c26[_0x71fb('0x23')]['toUpperCase']()!=='CONTINUE'){if(!_[_0x71fb('0x17')](queues[_0xde3c26[_0x71fb('0x4')]])){queues[_0xde3c26[_0x71fb('0x4')]][_0x71fb('0x19')]=![];queues[_0xde3c26[_0x71fb('0x4')]]['queuecallerabandonAt']=null;queues[_0xde3c26['uniqueid']][_0x71fb('0x1a')]=!![];queues[_0xde3c26[_0x71fb('0x4')]]['queuecallerexitAt']=utils[_0x71fb('0x15')]();queues[_0xde3c26[_0x71fb('0x4')]][_0x71fb('0xa')]=_0xde3c26[_0x71fb('0x23')][_0x71fb('0x24')]();utils[_0x71fb('0x12')](util[_0x71fb('0x2')](_0x71fb('0x25'),_0xde3c26[_0x71fb('0x4')],queues[_0xde3c26[_0x71fb('0x4')]]['name'],_0xde3c26[_0x71fb('0x23')],queues[_0xde3c26['uniqueid']][_0x71fb('0xa')]));writeDB(queues[_0xde3c26['uniqueid']]);}}else if(!_['isNil'](_0xde3c26['variable'][_0x71fb('0x26')])){if(!_['isNil'](queues[_0xde3c26[_0x71fb('0x4')]])&&!queues[_0xde3c26[_0x71fb('0x4')]][_0x71fb('0x19')]){queues[_0xde3c26[_0x71fb('0x4')]][_0x71fb('0x19')]=![];queues[_0xde3c26[_0x71fb('0x4')]][_0x71fb('0x27')]=null;queues[_0xde3c26[_0x71fb('0x4')]][_0x71fb('0x1a')]=!![];queues[_0xde3c26[_0x71fb('0x4')]][_0x71fb('0x28')]=utils[_0x71fb('0x15')]();queues[_0xde3c26[_0x71fb('0x4')]][_0x71fb('0xa')]='EXITWITHKEY';utils[_0x71fb('0x12')](util[_0x71fb('0x2')](_0x71fb('0x29'),_0xde3c26[_0x71fb('0x4')],queues[_0xde3c26['uniqueid']][_0x71fb('0x2a')],_0xde3c26[_0x71fb('0x23')],queues[_0xde3c26[_0x71fb('0x4')]][_0x71fb('0xa')]));}}}catch(_0x185aad){utils['error'](util[_0x71fb('0x2')]('[%s][queues][varset]',_0xde3c26['uniqueid']),_0x185aad);}};exports['queuecallerabandon']=function(_0x1d2240){try{if(!_['isNil'](queues[_0x1d2240[_0x71fb('0x4')]])){utils[_0x71fb('0x10')](util[_0x71fb('0x2')](_0x71fb('0x2b'),_0x1d2240[_0x71fb('0x4')]),_0x1d2240);queues[_0x1d2240[_0x71fb('0x4')]]['queuecallerexit']=![];queues[_0x1d2240[_0x71fb('0x4')]][_0x71fb('0x28')]=null;queues[_0x1d2240['uniqueid']][_0x71fb('0x19')]=!![];queues[_0x1d2240[_0x71fb('0x4')]][_0x71fb('0x27')]=utils['now']();queues[_0x1d2240['uniqueid']][_0x71fb('0xa')]=_0x71fb('0x2c');utils[_0x71fb('0x12')](util['format'](_0x71fb('0x2d'),_0x1d2240[_0x71fb('0x4')],queues[_0x1d2240['uniqueid']][_0x71fb('0x2a')],queues[_0x1d2240[_0x71fb('0x4')]][_0x71fb('0xa')]));}}catch(_0x1caff8){utils[_0x71fb('0x16')](util[_0x71fb('0x2')]('[%s][queues][queuecallerabandon]',_0x1d2240['uniqueid']),_0x1caff8);}};exports['queuecallerleave']=function(_0xf0feb9){try{if(!_[_0x71fb('0x17')](queues[_0xf0feb9[_0x71fb('0x4')]])){utils[_0x71fb('0x10')](util['format']('[%s][queues][queuecallerleave]',_0xf0feb9['uniqueid']),_0xf0feb9);utils[_0x71fb('0x12')](util['format'](_0x71fb('0x2e'),_0xf0feb9[_0x71fb('0x4')],queues[_0xf0feb9['uniqueid']]['name'],_0xf0feb9[_0x71fb('0x2f')],_0xf0feb9[_0x71fb('0x30')]));queues[_0xf0feb9[_0x71fb('0x4')]][_0x71fb('0x31')]=!![];queues[_0xf0feb9['uniqueid']][_0x71fb('0x18')]=utils[_0x71fb('0x15')]();queues[_0xf0feb9['uniqueid']]['holdtime']=utils[_0x71fb('0x32')](queues[_0xf0feb9[_0x71fb('0x4')]]['queuecallerleaveAt'],queues[_0xf0feb9[_0x71fb('0x4')]][_0x71fb('0x33')]);queues[_0xf0feb9[_0x71fb('0x4')]][_0x71fb('0x34')]=_0xf0feb9[_0x71fb('0x34')];queues[_0xf0feb9[_0x71fb('0x4')]]['count']=_0xf0feb9['count'];queues[_0xf0feb9[_0x71fb('0x4')]][_0x71fb('0x2f')]=_0xf0feb9[_0x71fb('0x2f')];queues[_0xf0feb9[_0x71fb('0x4')]][_0x71fb('0x30')]=_0xf0feb9[_0x71fb('0x30')];}}catch(_0x402c2a){utils[_0x71fb('0x16')](util[_0x71fb('0x2')](_0x71fb('0x35'),_0xf0feb9[_0x71fb('0x4')]),_0x402c2a);}};exports['agentconnect']=function(_0x1b489a){try{if(!_['isNil'](queues[_0x1b489a[_0x71fb('0x4')]])){utils[_0x71fb('0x10')](util[_0x71fb('0x2')](_0x71fb('0x36'),_0x1b489a['uniqueid']),_0x1b489a);utils[_0x71fb('0x12')](util[_0x71fb('0x2')](_0x71fb('0x37'),_0x1b489a[_0x71fb('0x4')],queues[_0x1b489a[_0x71fb('0x4')]][_0x71fb('0x2a')],_0x1b489a[_0x71fb('0x38')],_0x1b489a[_0x71fb('0x39')]));queues[_0x1b489a[_0x71fb('0x4')]]['queuecallerabandon']=![];queues[_0x1b489a[_0x71fb('0x4')]][_0x71fb('0x19')]=![];queues[_0x1b489a[_0x71fb('0x4')]][_0x71fb('0x27')]=null;queues[_0x1b489a['uniqueid']]['queuecallerexit']=![];queues[_0x1b489a[_0x71fb('0x4')]][_0x71fb('0xa')]=null;queues[_0x1b489a[_0x71fb('0x4')]][_0x71fb('0x28')]=null;queues[_0x1b489a[_0x71fb('0x4')]][_0x71fb('0x3a')]=!![];queues[_0x1b489a[_0x71fb('0x4')]][_0x71fb('0x9')]=_0x1b489a['destaccountcode'];queues[_0x1b489a[_0x71fb('0x4')]]['lastAssignedTo']=_0x1b489a['membername'];}}catch(_0xd6100b){utils[_0x71fb('0x16')](util['format'](_0x71fb('0x36'),_0x1b489a[_0x71fb('0x4')]),_0xd6100b);}};exports[_0x71fb('0x3b')]=function(_0x1c1f30){try{if(!_['isNil'](queues[_0x1c1f30[_0x71fb('0x4')]])){if(queues[_0x1c1f30['uniqueid']][_0x71fb('0x18')]){utils['debug'](util['format']('[%s][queues][agentcomplete]',_0x1c1f30[_0x71fb('0x4')]),_0x1c1f30);queues[_0x1c1f30[_0x71fb('0x4')]][_0x71fb('0x19')]=![];queues[_0x1c1f30[_0x71fb('0x4')]][_0x71fb('0x19')]=![];queues[_0x1c1f30[_0x71fb('0x4')]][_0x71fb('0x27')]=null;queues[_0x1c1f30[_0x71fb('0x4')]][_0x71fb('0x1a')]=![];queues[_0x1c1f30[_0x71fb('0x4')]][_0x71fb('0x28')]=null;queues[_0x1c1f30[_0x71fb('0x4')]][_0x71fb('0x3a')]=!![];queues[_0x1c1f30[_0x71fb('0x4')]]['lastAssignedTo']=_0x1c1f30[_0x71fb('0x38')];queues[_0x1c1f30[_0x71fb('0x4')]]['queuecallercomplete']=!![];queues[_0x1c1f30[_0x71fb('0x4')]][_0x71fb('0x3c')]=utils[_0x71fb('0x15')]();if(_0x1c1f30[_0x71fb('0x3d')]==_0x71fb('0x3e')){if(!queues[_0x1c1f30[_0x71fb('0x4')]]['transfer']){queues[_0x1c1f30[_0x71fb('0x4')]][_0x71fb('0xa')]=_0x71fb('0x3f');}}else{queues[_0x1c1f30[_0x71fb('0x4')]][_0x71fb('0xa')]=_0x71fb('0x40')+_0x1c1f30[_0x71fb('0x3d')][_0x71fb('0x24')]();}utils[_0x71fb('0x12')](util[_0x71fb('0x2')](_0x71fb('0x41'),_0x1c1f30[_0x71fb('0x4')],queues[_0x1c1f30[_0x71fb('0x4')]][_0x71fb('0x2a')],_0x1c1f30['membername'],queues[_0x1c1f30[_0x71fb('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x1c1f30[_0x71fb('0x4')]]);}}}catch(_0x2ee867){utils[_0x71fb('0x16')](util[_0x71fb('0x2')](_0x71fb('0x42'),_0x1c1f30['uniqueid']),_0x2ee867);}};exports[_0x71fb('0x43')]=function(_0x48cfc0){try{if(!_[_0x71fb('0x17')](queues[_0x48cfc0['transfereeuniqueid']])){utils[_0x71fb('0x10')](util[_0x71fb('0x2')](_0x71fb('0x44'),_0x48cfc0[_0x71fb('0x4')]),_0x48cfc0);queues[_0x48cfc0['transfereeuniqueid']][_0x71fb('0x3e')]=!![];queues[_0x48cfc0['transfereeuniqueid']][_0x71fb('0x45')]=_0x71fb('0x46');queues[_0x48cfc0['transfereeuniqueid']]['transferexten']=_0x48cfc0[_0x71fb('0x47')];queues[_0x48cfc0[_0x71fb('0x48')]]['transferuniqueid']=_0x48cfc0[_0x71fb('0x48')];queues[_0x48cfc0[_0x71fb('0x48')]][_0x71fb('0xa')]=_0x71fb('0x49');utils[_0x71fb('0x12')](util[_0x71fb('0x2')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x48cfc0['uniqueid'],queues[_0x48cfc0[_0x71fb('0x48')]][_0x71fb('0x2a')],_0x48cfc0['transfereeuniqueid'],_0x48cfc0[_0x71fb('0x47')]));}}catch(_0x333e17){utils['error'](util['format']('[%s][queues][blindtransfer]',_0x48cfc0[_0x71fb('0x4')]),_0x333e17);}};exports[_0x71fb('0x4a')]=function(_0x3d3fe3){try{utils[_0x71fb('0x10')](util[_0x71fb('0x2')]('[%s][queues][attendedtransfer]',_0x3d3fe3['origtransfereruniqueid']),_0x3d3fe3);if(_0x3d3fe3[_0x71fb('0x4b')]==_0x3d3fe3[_0x71fb('0x4c')]){if(!_[_0x71fb('0x17')](queues[_0x3d3fe3['secondtransfererlinkedid']])){utils[_0x71fb('0x12')](util[_0x71fb('0x2')](_0x71fb('0x4d'),_0x3d3fe3[_0x71fb('0x4b')],queues[_0x3d3fe3[_0x71fb('0x4e')]][_0x71fb('0x2a')],_0x3d3fe3['origtransfererexten']));queues[_0x3d3fe3[_0x71fb('0x4e')]][_0x71fb('0x3e')]=!![];queues[_0x3d3fe3[_0x71fb('0x4e')]][_0x71fb('0x45')]=_0x71fb('0x4f');queues[_0x3d3fe3['secondtransfererlinkedid']][_0x71fb('0x50')]=_0x3d3fe3['origtransfererexten'];queues[_0x3d3fe3[_0x71fb('0x4e')]][_0x71fb('0x51')]=_0x3d3fe3[_0x71fb('0x4b')];queues[_0x3d3fe3[_0x71fb('0x4e')]][_0x71fb('0xa')]=_0x71fb('0x52');}if(!_[_0x71fb('0x17')](queues[_0x3d3fe3[_0x71fb('0x4c')]])){if(_0x3d3fe3[_0x71fb('0x53')]&&queues[_0x3d3fe3[_0x71fb('0x53')]]){queues[_0x3d3fe3[_0x71fb('0x53')]][_0x71fb('0x54')]=0x1;queues[_0x3d3fe3['transfereeuniqueid']]=_[_0x71fb('0x55')](queues[_0x3d3fe3[_0x71fb('0x53')]]);queues[_0x3d3fe3[_0x71fb('0x48')]][_0x71fb('0xe')]=_0x3d3fe3[_0x71fb('0x56')];queues[_0x3d3fe3[_0x71fb('0x48')]]['queuecallerenterreason']=0x2;queues[_0x3d3fe3[_0x71fb('0x48')]]['calleridnum']=queues[_0x3d3fe3[_0x71fb('0x4e')]]['calleridnum'];queues[_0x3d3fe3['transfereeuniqueid']]['calleridname']=queues[_0x3d3fe3['secondtransfererlinkedid']]['calleridname'];queues[_0x3d3fe3[_0x71fb('0x48')]]['queuecallerjoinAt']=utils[_0x71fb('0x15')]();queues[_0x3d3fe3[_0x71fb('0x48')]]['queuecallerleaveAt']=utils['now']();queues[_0x3d3fe3[_0x71fb('0x48')]][_0x71fb('0x57')]=0x0;queues[_0x3d3fe3[_0x71fb('0x48')]][_0x71fb('0x58')]=0x0;utils[_0x71fb('0x12')](util[_0x71fb('0x2')](_0x71fb('0x59'),_0x3d3fe3[_0x71fb('0x4b')],queues[_0x3d3fe3[_0x71fb('0x48')]][_0x71fb('0x2a')],queues[_0x3d3fe3[_0x71fb('0x48')]][_0x71fb('0x8')],queues[_0x3d3fe3[_0x71fb('0x48')]][_0x71fb('0x5a')]));}else{utils[_0x71fb('0x12')](util[_0x71fb('0x2')](_0x71fb('0x5b'),_0x3d3fe3['origtransfereruniqueid'],queues[_0x3d3fe3['origtransfererlinkedid']][_0x71fb('0x2a')],_0x3d3fe3[_0x71fb('0x4e')]));queues[_0x3d3fe3['origtransfererlinkedid']][_0x71fb('0xe')]=_0x3d3fe3[_0x71fb('0x4e')];}}}else if(_0x3d3fe3[_0x71fb('0x5c')]==_0x3d3fe3[_0x71fb('0x4e')]){if(!_[_0x71fb('0x17')](queues[_0x3d3fe3[_0x71fb('0x4c')]])){utils['info'](util[_0x71fb('0x2')](_0x71fb('0x5d'),_0x3d3fe3[_0x71fb('0x4b')],queues[_0x3d3fe3[_0x71fb('0x4c')]][_0x71fb('0x2a')],_0x3d3fe3[_0x71fb('0x5c')],_0x3d3fe3['secondtransfererexten']));queues[_0x3d3fe3[_0x71fb('0x4c')]][_0x71fb('0x3e')]=!![];queues[_0x3d3fe3['origtransfererlinkedid']]['transfertype']=_0x71fb('0x4f');queues[_0x3d3fe3[_0x71fb('0x4c')]][_0x71fb('0x50')]=_0x3d3fe3[_0x71fb('0x5e')];queues[_0x3d3fe3['origtransfererlinkedid']][_0x71fb('0x51')]=_0x3d3fe3['secondtransfereruniqueid'];queues[_0x3d3fe3['origtransfererlinkedid']][_0x71fb('0xa')]='ATTENDEDTRANSFER';}if(!_[_0x71fb('0x17')](queues[_0x3d3fe3['secondtransfererlinkedid']])){if(_0x3d3fe3[_0x71fb('0x5f')]&&queues[_0x3d3fe3['transfertargetlinkedid']]){queues[_0x3d3fe3['transfertargetlinkedid']][_0x71fb('0x54')]=0x1;queues[_0x3d3fe3[_0x71fb('0x56')]]=_[_0x71fb('0x55')](queues[_0x3d3fe3[_0x71fb('0x5f')]]);queues[_0x3d3fe3['transfertargetuniqueid']][_0x71fb('0xe')]=_0x3d3fe3[_0x71fb('0x56')];queues[_0x3d3fe3['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x3d3fe3[_0x71fb('0x56')]][_0x71fb('0x8')]=queues[_0x3d3fe3['origtransfererlinkedid']][_0x71fb('0x8')];queues[_0x3d3fe3[_0x71fb('0x56')]]['calleridname']=queues[_0x3d3fe3[_0x71fb('0x4c')]][_0x71fb('0x5a')];queues[_0x3d3fe3['transfertargetuniqueid']][_0x71fb('0x33')]=utils['now']();queues[_0x3d3fe3['transfertargetuniqueid']][_0x71fb('0x18')]=utils[_0x71fb('0x15')]();queues[_0x3d3fe3['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x3d3fe3[_0x71fb('0x56')]][_0x71fb('0x58')]=0x0;utils['info'](util[_0x71fb('0x2')](_0x71fb('0x60'),_0x3d3fe3[_0x71fb('0x4b')],queues[_0x3d3fe3['transfertargetuniqueid']][_0x71fb('0x2a')],queues[_0x3d3fe3[_0x71fb('0x56')]][_0x71fb('0xe')],queues[_0x3d3fe3[_0x71fb('0x56')]][_0x71fb('0x8')],queues[_0x3d3fe3[_0x71fb('0x56')]][_0x71fb('0x5a')]));}else{utils[_0x71fb('0x12')](util[_0x71fb('0x2')](_0x71fb('0x5b'),_0x3d3fe3['origtransfereruniqueid'],queues[_0x3d3fe3[_0x71fb('0x4e')]][_0x71fb('0x2a')],_0x3d3fe3[_0x71fb('0x4c')]));queues[_0x3d3fe3[_0x71fb('0x4e')]][_0x71fb('0xe')]=_0x3d3fe3['origtransfererlinkedid'];}}}}catch(_0x2d70a4){utils[_0x71fb('0x16')](util[_0x71fb('0x2')](_0x71fb('0x61'),_0x3d3fe3[_0x71fb('0x4b')]),_0x2d70a4);}};exports[_0x71fb('0x62')]=function(_0x199a30){try{if(!_[_0x71fb('0x17')](queues[_0x199a30[_0x71fb('0x4')]])){utils[_0x71fb('0x10')](util[_0x71fb('0x2')](_0x71fb('0x63'),_0x199a30[_0x71fb('0x4')]),_0x199a30);queues[_0x199a30[_0x71fb('0x4')]][_0x71fb('0x64')]=utils[_0x71fb('0x15')]();utils[_0x71fb('0x12')](util[_0x71fb('0x2')](_0x71fb('0x65'),_0x199a30[_0x71fb('0x4')],queues[_0x199a30[_0x71fb('0x4')]][_0x71fb('0x2a')],queues[_0x199a30[_0x71fb('0x4')]][_0x71fb('0x64')]));}}catch(_0x428490){utils[_0x71fb('0x16')](util[_0x71fb('0x2')](_0x71fb('0x63'),_0x199a30[_0x71fb('0x4')]),_0x428490);}};exports[_0x71fb('0x66')]=function(_0x2c144c){try{if(!_[_0x71fb('0x17')](queues[_0x2c144c[_0x71fb('0x4')]])){if(!_['isNil'](queues[_0x2c144c['uniqueid']][_0x71fb('0x64')])){utils[_0x71fb('0x10')](util['format'](_0x71fb('0x67'),_0x2c144c[_0x71fb('0x4')]),_0x2c144c);queues[_0x2c144c[_0x71fb('0x4')]][_0x71fb('0x58')]+=utils[_0x71fb('0x32')](utils['now'](),queues[_0x2c144c['uniqueid']][_0x71fb('0x64')]);utils[_0x71fb('0x12')](util[_0x71fb('0x2')](_0x71fb('0x68'),_0x2c144c[_0x71fb('0x4')],queues[_0x2c144c['uniqueid']][_0x71fb('0x2a')],queues[_0x2c144c['uniqueid']][_0x71fb('0x58')]));delete queues[_0x2c144c[_0x71fb('0x4')]]['musiconholdstartAt'];}}}catch(_0x337dea){utils['error'](util[_0x71fb('0x2')](_0x71fb('0x67'),_0x2c144c[_0x71fb('0x4')]),_0x337dea);}};
\ No newline at end of file
+var _0x5e10=['./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexitAt','EXITWITHKEY','error','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','membername','agentcomplete','[%s][queues][agentcomplete]','assigned','transfer','TRANSFER','reason','[%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','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','origtransfererexten','secondtransfererlinkedid','ATTENDED','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5e10,0x12d));var _0x05e1=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0x5e10[_0x5756c6];return _0x4b5806;};'use strict';var _=require(_0x05e1('0x0'));var util=require(_0x05e1('0x1'));var utils=require(_0x05e1('0x2'));var queues={};function writeDB(_0x400c1c){utils['info'](util[_0x05e1('0x3')](_0x05e1('0x4'),_0x400c1c[_0x05e1('0x5')],_0x400c1c[_0x05e1('0x6')],_0x400c1c['queue'],_0x400c1c[_0x05e1('0x7')],_0x400c1c[_0x05e1('0x8')],_0x400c1c[_0x05e1('0x9')],_0x400c1c['queuecallerexitreason']));if(_0x400c1c[_0x05e1('0xa')]){utils[_0x05e1('0xb')](_0x400c1c['queue'])[_0x05e1('0xc')](function(_0x2106b8){if(_0x2106b8){_0x400c1c['type']=_0x2106b8[_0x05e1('0xd')];}utils[_0x05e1('0xe')](_0x05e1('0xf'),_0x400c1c);});}else{utils[_0x05e1('0xe')](_0x05e1('0xf'),_0x400c1c);}if(_0x400c1c[_0x05e1('0x10')]){delete queues[_0x400c1c[_0x05e1('0x10')]];}else{delete queues[_0x400c1c[_0x05e1('0x5')]];}}exports[_0x05e1('0x11')]=function(_0x11fda1){try{utils[_0x05e1('0x12')](util[_0x05e1('0x3')](_0x05e1('0x13'),_0x11fda1[_0x05e1('0x5')]),_0x11fda1);utils[_0x05e1('0x14')](util[_0x05e1('0x3')](_0x05e1('0x15'),_0x11fda1[_0x05e1('0x5')],_0x11fda1[_0x05e1('0xa')],_0x11fda1[_0x05e1('0x16')]));queues[_0x11fda1[_0x05e1('0x5')]]=_['assign'](_0x11fda1,{'originalposition':_0x11fda1['position'],'queuecallerjoinAt':utils[_0x05e1('0x17')](),'mohtime':0x0});}catch(_0x2568e5){utils['error'](util[_0x05e1('0x3')]('[%s][queues][queuecallerjoin]',_0x11fda1[_0x05e1('0x5')]),_0x2568e5);}};exports[_0x05e1('0x18')]=function(_0x4a1388){try{if(!_[_0x05e1('0x19')](queues[_0x4a1388[_0x05e1('0x5')]])){utils['debug'](util['format']('[%s][queues][hangup]',_0x4a1388[_0x05e1('0x5')]),_0x4a1388);if(queues[_0x4a1388['uniqueid']][_0x05e1('0x1a')]){if(!queues[_0x4a1388[_0x05e1('0x5')]][_0x05e1('0x1b')]&&!queues[_0x4a1388[_0x05e1('0x5')]][_0x05e1('0x1c')]){queues[_0x4a1388[_0x05e1('0x5')]][_0x05e1('0x1d')]=!![];queues[_0x4a1388[_0x05e1('0x5')]][_0x05e1('0x1e')]=utils[_0x05e1('0x17')]();queues[_0x4a1388[_0x05e1('0x5')]][_0x05e1('0x1f')]='COMPLETEDBYAGENT';}utils[_0x05e1('0x14')](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x4a1388[_0x05e1('0x5')],queues[_0x4a1388[_0x05e1('0x5')]]['name'],queues[_0x4a1388[_0x05e1('0x5')]][_0x05e1('0x1f')]));writeDB(queues[_0x4a1388[_0x05e1('0x5')]]);}else if(queues[_0x4a1388[_0x05e1('0x5')]]['transfereduniqueid']){utils[_0x05e1('0x14')](util[_0x05e1('0x3')](_0x05e1('0x20'),_0x4a1388[_0x05e1('0x5')],queues[_0x4a1388[_0x05e1('0x5')]][_0x05e1('0x21')],queues[_0x4a1388[_0x05e1('0x5')]][_0x05e1('0x10')]));queues[queues[_0x4a1388[_0x05e1('0x5')]]['transfereduniqueid']]=queues[_0x4a1388[_0x05e1('0x5')]];queues[queues[_0x4a1388[_0x05e1('0x5')]][_0x05e1('0x10')]][_0x05e1('0x22')]=0x2;delete queues[_0x4a1388['uniqueid']];}}}catch(_0x1e2455){utils['error'](util[_0x05e1('0x3')]('[%s][queues][hangup]',_0x4a1388[_0x05e1('0x5')]),_0x1e2455);}};exports['varset']=function(_0xd44f36){try{utils[_0x05e1('0x12')](util[_0x05e1('0x3')](_0x05e1('0x23'),_0xd44f36['uniqueid']),_0xd44f36);if(!_[_0x05e1('0x19')](_0xd44f36[_0x05e1('0x24')]['queuestatus'])&&_0xd44f36[_0x05e1('0x25')][_0x05e1('0x26')]()!==_0x05e1('0x27')){if(!_[_0x05e1('0x19')](queues[_0xd44f36['uniqueid']])){queues[_0xd44f36[_0x05e1('0x5')]][_0x05e1('0x1b')]=![];queues[_0xd44f36[_0x05e1('0x5')]][_0x05e1('0x28')]=null;queues[_0xd44f36[_0x05e1('0x5')]]['queuecallerexit']=!![];queues[_0xd44f36[_0x05e1('0x5')]]['queuecallerexitAt']=utils[_0x05e1('0x17')]();queues[_0xd44f36[_0x05e1('0x5')]]['queuecallerexitreason']=_0xd44f36[_0x05e1('0x25')]['toUpperCase']();utils[_0x05e1('0x14')](util[_0x05e1('0x3')](_0x05e1('0x29'),_0xd44f36[_0x05e1('0x5')],queues[_0xd44f36['uniqueid']][_0x05e1('0x21')],_0xd44f36[_0x05e1('0x25')],queues[_0xd44f36[_0x05e1('0x5')]]['queuecallerexitreason']));writeDB(queues[_0xd44f36[_0x05e1('0x5')]]);}}else if(!_[_0x05e1('0x19')](_0xd44f36[_0x05e1('0x24')][_0x05e1('0x2a')])){if(!_[_0x05e1('0x19')](queues[_0xd44f36['uniqueid']])&&!queues[_0xd44f36['uniqueid']]['queuecallerabandon']){queues[_0xd44f36[_0x05e1('0x5')]][_0x05e1('0x1b')]=![];queues[_0xd44f36[_0x05e1('0x5')]][_0x05e1('0x28')]=null;queues[_0xd44f36['uniqueid']][_0x05e1('0x1c')]=!![];queues[_0xd44f36[_0x05e1('0x5')]][_0x05e1('0x2b')]=utils['now']();queues[_0xd44f36[_0x05e1('0x5')]][_0x05e1('0x1f')]=_0x05e1('0x2c');utils[_0x05e1('0x14')](util[_0x05e1('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0xd44f36['uniqueid'],queues[_0xd44f36[_0x05e1('0x5')]][_0x05e1('0x21')],_0xd44f36[_0x05e1('0x25')],queues[_0xd44f36[_0x05e1('0x5')]][_0x05e1('0x1f')]));}}}catch(_0x42167c){utils[_0x05e1('0x2d')](util[_0x05e1('0x3')](_0x05e1('0x23'),_0xd44f36[_0x05e1('0x5')]),_0x42167c);}};exports[_0x05e1('0x1b')]=function(_0x419c59){try{if(!_[_0x05e1('0x19')](queues[_0x419c59['uniqueid']])){utils[_0x05e1('0x12')](util['format'](_0x05e1('0x2e'),_0x419c59['uniqueid']),_0x419c59);queues[_0x419c59[_0x05e1('0x5')]][_0x05e1('0x1c')]=![];queues[_0x419c59['uniqueid']][_0x05e1('0x2b')]=null;queues[_0x419c59[_0x05e1('0x5')]][_0x05e1('0x1b')]=!![];queues[_0x419c59['uniqueid']][_0x05e1('0x28')]=utils[_0x05e1('0x17')]();queues[_0x419c59[_0x05e1('0x5')]][_0x05e1('0x1f')]='ABANDONED';utils['info'](util['format'](_0x05e1('0x2f'),_0x419c59['uniqueid'],queues[_0x419c59[_0x05e1('0x5')]][_0x05e1('0x21')],queues[_0x419c59[_0x05e1('0x5')]][_0x05e1('0x1f')]));}}catch(_0x1e4fef){utils[_0x05e1('0x2d')](util[_0x05e1('0x3')](_0x05e1('0x2e'),_0x419c59['uniqueid']),_0x1e4fef);}};exports[_0x05e1('0x30')]=function(_0xdc8deb){try{if(!_[_0x05e1('0x19')](queues[_0xdc8deb[_0x05e1('0x5')]])){utils['debug'](util[_0x05e1('0x3')](_0x05e1('0x31'),_0xdc8deb[_0x05e1('0x5')]),_0xdc8deb);utils[_0x05e1('0x14')](util[_0x05e1('0x3')](_0x05e1('0x32'),_0xdc8deb[_0x05e1('0x5')],queues[_0xdc8deb[_0x05e1('0x5')]][_0x05e1('0x21')],_0xdc8deb[_0x05e1('0x33')],_0xdc8deb['connectedlinename']));queues[_0xdc8deb[_0x05e1('0x5')]][_0x05e1('0x30')]=!![];queues[_0xdc8deb[_0x05e1('0x5')]][_0x05e1('0x1a')]=utils[_0x05e1('0x17')]();queues[_0xdc8deb[_0x05e1('0x5')]][_0x05e1('0x34')]=utils[_0x05e1('0x35')](queues[_0xdc8deb[_0x05e1('0x5')]]['queuecallerleaveAt'],queues[_0xdc8deb[_0x05e1('0x5')]]['queuecallerjoinAt']);queues[_0xdc8deb[_0x05e1('0x5')]][_0x05e1('0x16')]=_0xdc8deb['position'];queues[_0xdc8deb['uniqueid']][_0x05e1('0x36')]=_0xdc8deb[_0x05e1('0x36')];queues[_0xdc8deb[_0x05e1('0x5')]]['connectedlinenum']=_0xdc8deb['connectedlinenum'];queues[_0xdc8deb[_0x05e1('0x5')]][_0x05e1('0x37')]=_0xdc8deb[_0x05e1('0x37')];}}catch(_0x332b02){utils[_0x05e1('0x2d')](util[_0x05e1('0x3')](_0x05e1('0x31'),_0xdc8deb[_0x05e1('0x5')]),_0x332b02);}};exports[_0x05e1('0x38')]=function(_0x147c1e){try{if(!_['isNil'](queues[_0x147c1e[_0x05e1('0x5')]])){utils[_0x05e1('0x12')](util[_0x05e1('0x3')](_0x05e1('0x39'),_0x147c1e['uniqueid']),_0x147c1e);utils[_0x05e1('0x14')](util['format'](_0x05e1('0x3a'),_0x147c1e['uniqueid'],queues[_0x147c1e[_0x05e1('0x5')]]['name'],_0x147c1e['membername'],_0x147c1e[_0x05e1('0x3b')]));queues[_0x147c1e[_0x05e1('0x5')]][_0x05e1('0x1b')]=![];queues[_0x147c1e[_0x05e1('0x5')]][_0x05e1('0x1b')]=![];queues[_0x147c1e['uniqueid']][_0x05e1('0x28')]=null;queues[_0x147c1e[_0x05e1('0x5')]][_0x05e1('0x1c')]=![];queues[_0x147c1e[_0x05e1('0x5')]][_0x05e1('0x1f')]=null;queues[_0x147c1e[_0x05e1('0x5')]]['queuecallerexitAt']=null;queues[_0x147c1e[_0x05e1('0x5')]]['assigned']=!![];queues[_0x147c1e[_0x05e1('0x5')]][_0x05e1('0x9')]=_0x147c1e[_0x05e1('0x3b')];queues[_0x147c1e['uniqueid']]['lastAssignedTo']=_0x147c1e[_0x05e1('0x3c')];}}catch(_0x2dd6e6){utils['error'](util[_0x05e1('0x3')]('[%s][queues][agentconnect]',_0x147c1e[_0x05e1('0x5')]),_0x2dd6e6);}};exports[_0x05e1('0x3d')]=function(_0x167289){try{if(!_[_0x05e1('0x19')](queues[_0x167289['uniqueid']])){if(queues[_0x167289[_0x05e1('0x5')]][_0x05e1('0x1a')]){utils[_0x05e1('0x12')](util['format'](_0x05e1('0x3e'),_0x167289[_0x05e1('0x5')]),_0x167289);queues[_0x167289['uniqueid']][_0x05e1('0x1b')]=![];queues[_0x167289[_0x05e1('0x5')]][_0x05e1('0x1b')]=![];queues[_0x167289[_0x05e1('0x5')]][_0x05e1('0x28')]=null;queues[_0x167289['uniqueid']][_0x05e1('0x1c')]=![];queues[_0x167289[_0x05e1('0x5')]][_0x05e1('0x2b')]=null;queues[_0x167289[_0x05e1('0x5')]][_0x05e1('0x3f')]=!![];queues[_0x167289[_0x05e1('0x5')]][_0x05e1('0x7')]=_0x167289[_0x05e1('0x3c')];queues[_0x167289[_0x05e1('0x5')]][_0x05e1('0x1d')]=!![];queues[_0x167289['uniqueid']][_0x05e1('0x1e')]=utils[_0x05e1('0x17')]();if(_0x167289['reason']=='transfer'){if(!queues[_0x167289['uniqueid']][_0x05e1('0x40')]){queues[_0x167289[_0x05e1('0x5')]][_0x05e1('0x1f')]=_0x05e1('0x41');}}else{queues[_0x167289['uniqueid']][_0x05e1('0x1f')]='COMPLETEDBY'+_0x167289[_0x05e1('0x42')]['toUpperCase']();}utils['info'](util[_0x05e1('0x3')](_0x05e1('0x43'),_0x167289['uniqueid'],queues[_0x167289['uniqueid']][_0x05e1('0x21')],_0x167289[_0x05e1('0x3c')],queues[_0x167289[_0x05e1('0x5')]][_0x05e1('0x1f')]));writeDB(queues[_0x167289[_0x05e1('0x5')]]);}}}catch(_0x1df912){utils[_0x05e1('0x2d')](util['format'](_0x05e1('0x3e'),_0x167289['uniqueid']),_0x1df912);}};exports['blindtransfer']=function(_0x5541f4){try{if(!_[_0x05e1('0x19')](queues[_0x5541f4[_0x05e1('0x44')]])){utils[_0x05e1('0x12')](util[_0x05e1('0x3')](_0x05e1('0x45'),_0x5541f4[_0x05e1('0x5')]),_0x5541f4);queues[_0x5541f4[_0x05e1('0x44')]][_0x05e1('0x40')]=!![];queues[_0x5541f4[_0x05e1('0x44')]][_0x05e1('0x46')]=_0x05e1('0x47');queues[_0x5541f4[_0x05e1('0x44')]][_0x05e1('0x48')]=_0x5541f4[_0x05e1('0x49')];queues[_0x5541f4[_0x05e1('0x44')]][_0x05e1('0x4a')]=_0x5541f4['transfereeuniqueid'];queues[_0x5541f4['transfereeuniqueid']][_0x05e1('0x1f')]=_0x05e1('0x4b');utils['info'](util[_0x05e1('0x3')](_0x05e1('0x4c'),_0x5541f4[_0x05e1('0x5')],queues[_0x5541f4[_0x05e1('0x44')]][_0x05e1('0x21')],_0x5541f4[_0x05e1('0x44')],_0x5541f4[_0x05e1('0x49')]));}}catch(_0xd4df5d){utils[_0x05e1('0x2d')](util['format'](_0x05e1('0x45'),_0x5541f4[_0x05e1('0x5')]),_0xd4df5d);}};exports['attendedtransfer']=function(_0x43af43){try{utils[_0x05e1('0x12')](util[_0x05e1('0x3')](_0x05e1('0x4d'),_0x43af43[_0x05e1('0x4e')]),_0x43af43);if(_0x43af43[_0x05e1('0x4e')]==_0x43af43[_0x05e1('0x4f')]){if(!_[_0x05e1('0x19')](queues[_0x43af43['secondtransfererlinkedid']])){utils[_0x05e1('0x14')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x43af43['origtransfereruniqueid'],queues[_0x43af43['secondtransfererlinkedid']][_0x05e1('0x21')],_0x43af43[_0x05e1('0x50')]));queues[_0x43af43[_0x05e1('0x51')]]['transfer']=!![];queues[_0x43af43[_0x05e1('0x51')]]['transfertype']=_0x05e1('0x52');queues[_0x43af43[_0x05e1('0x51')]][_0x05e1('0x48')]=_0x43af43[_0x05e1('0x50')];queues[_0x43af43[_0x05e1('0x51')]][_0x05e1('0x4a')]=_0x43af43[_0x05e1('0x4e')];queues[_0x43af43[_0x05e1('0x51')]][_0x05e1('0x1f')]='ATTENDEDTRANSFER';}if(!_[_0x05e1('0x19')](queues[_0x43af43[_0x05e1('0x4f')]])){if(_0x43af43[_0x05e1('0x53')]&&queues[_0x43af43[_0x05e1('0x53')]]){queues[_0x43af43['transfereelinkedid']][_0x05e1('0x22')]=0x1;queues[_0x43af43[_0x05e1('0x44')]]=_[_0x05e1('0x54')](queues[_0x43af43[_0x05e1('0x53')]]);queues[_0x43af43[_0x05e1('0x44')]]['transfereduniqueid']=_0x43af43[_0x05e1('0x55')];queues[_0x43af43['transfereeuniqueid']][_0x05e1('0x22')]=0x2;queues[_0x43af43['transfereeuniqueid']][_0x05e1('0x8')]=queues[_0x43af43[_0x05e1('0x51')]][_0x05e1('0x8')];queues[_0x43af43['transfereeuniqueid']][_0x05e1('0x56')]=queues[_0x43af43[_0x05e1('0x51')]][_0x05e1('0x56')];queues[_0x43af43['transfereeuniqueid']][_0x05e1('0x57')]=utils[_0x05e1('0x17')]();queues[_0x43af43[_0x05e1('0x44')]][_0x05e1('0x1a')]=utils[_0x05e1('0x17')]();queues[_0x43af43[_0x05e1('0x44')]]['holdtime']=0x0;queues[_0x43af43[_0x05e1('0x44')]][_0x05e1('0x58')]=0x0;utils[_0x05e1('0x14')](util['format'](_0x05e1('0x59'),_0x43af43[_0x05e1('0x4e')],queues[_0x43af43[_0x05e1('0x44')]][_0x05e1('0x21')],queues[_0x43af43[_0x05e1('0x44')]][_0x05e1('0x8')],queues[_0x43af43[_0x05e1('0x44')]][_0x05e1('0x56')]));}else{utils['info'](util[_0x05e1('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x43af43[_0x05e1('0x4e')],queues[_0x43af43[_0x05e1('0x4f')]][_0x05e1('0x21')],_0x43af43[_0x05e1('0x51')]));queues[_0x43af43[_0x05e1('0x4f')]][_0x05e1('0x10')]=_0x43af43['secondtransfererlinkedid'];}}}else if(_0x43af43[_0x05e1('0x5a')]==_0x43af43[_0x05e1('0x51')]){if(!_[_0x05e1('0x19')](queues[_0x43af43[_0x05e1('0x4f')]])){utils[_0x05e1('0x14')](util[_0x05e1('0x3')](_0x05e1('0x5b'),_0x43af43[_0x05e1('0x4e')],queues[_0x43af43[_0x05e1('0x4f')]][_0x05e1('0x21')],_0x43af43['secondtransfereruniqueid'],_0x43af43['secondtransfererexten']));queues[_0x43af43[_0x05e1('0x4f')]][_0x05e1('0x40')]=!![];queues[_0x43af43['origtransfererlinkedid']][_0x05e1('0x46')]=_0x05e1('0x52');queues[_0x43af43[_0x05e1('0x4f')]][_0x05e1('0x48')]=_0x43af43[_0x05e1('0x5c')];queues[_0x43af43[_0x05e1('0x4f')]][_0x05e1('0x4a')]=_0x43af43[_0x05e1('0x5a')];queues[_0x43af43[_0x05e1('0x4f')]][_0x05e1('0x1f')]=_0x05e1('0x5d');}if(!_[_0x05e1('0x19')](queues[_0x43af43[_0x05e1('0x51')]])){if(_0x43af43[_0x05e1('0x5e')]&&queues[_0x43af43[_0x05e1('0x5e')]]){queues[_0x43af43[_0x05e1('0x5e')]]['queuecallerenterreason']=0x1;queues[_0x43af43['transfertargetuniqueid']]=_[_0x05e1('0x54')](queues[_0x43af43[_0x05e1('0x5e')]]);queues[_0x43af43[_0x05e1('0x55')]]['transfereduniqueid']=_0x43af43['transfertargetuniqueid'];queues[_0x43af43[_0x05e1('0x55')]][_0x05e1('0x22')]=0x2;queues[_0x43af43['transfertargetuniqueid']]['calleridnum']=queues[_0x43af43[_0x05e1('0x4f')]]['calleridnum'];queues[_0x43af43['transfertargetuniqueid']][_0x05e1('0x56')]=queues[_0x43af43[_0x05e1('0x4f')]][_0x05e1('0x56')];queues[_0x43af43[_0x05e1('0x55')]]['queuecallerjoinAt']=utils[_0x05e1('0x17')]();queues[_0x43af43[_0x05e1('0x55')]]['queuecallerleaveAt']=utils['now']();queues[_0x43af43[_0x05e1('0x55')]][_0x05e1('0x34')]=0x0;queues[_0x43af43[_0x05e1('0x55')]][_0x05e1('0x58')]=0x0;utils[_0x05e1('0x14')](util[_0x05e1('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x43af43[_0x05e1('0x4e')],queues[_0x43af43[_0x05e1('0x55')]][_0x05e1('0x21')],queues[_0x43af43['transfertargetuniqueid']][_0x05e1('0x10')],queues[_0x43af43[_0x05e1('0x55')]][_0x05e1('0x8')],queues[_0x43af43[_0x05e1('0x55')]][_0x05e1('0x56')]));}else{utils['info'](util[_0x05e1('0x3')](_0x05e1('0x5f'),_0x43af43[_0x05e1('0x4e')],queues[_0x43af43[_0x05e1('0x51')]][_0x05e1('0x21')],_0x43af43[_0x05e1('0x4f')]));queues[_0x43af43[_0x05e1('0x51')]][_0x05e1('0x10')]=_0x43af43['origtransfererlinkedid'];}}}}catch(_0x2f9247){utils[_0x05e1('0x2d')](util[_0x05e1('0x3')](_0x05e1('0x4d'),_0x43af43[_0x05e1('0x4e')]),_0x2f9247);}};exports[_0x05e1('0x60')]=function(_0x24b6fa){try{if(!_[_0x05e1('0x19')](queues[_0x24b6fa['uniqueid']])){utils[_0x05e1('0x12')](util[_0x05e1('0x3')]('[%s][queues][musiconholdstart]',_0x24b6fa[_0x05e1('0x5')]),_0x24b6fa);queues[_0x24b6fa[_0x05e1('0x5')]][_0x05e1('0x61')]=utils['now']();utils[_0x05e1('0x14')](util[_0x05e1('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x24b6fa[_0x05e1('0x5')],queues[_0x24b6fa[_0x05e1('0x5')]][_0x05e1('0x21')],queues[_0x24b6fa['uniqueid']][_0x05e1('0x61')]));}}catch(_0x5b881f){utils[_0x05e1('0x2d')](util[_0x05e1('0x3')]('[%s][queues][musiconholdstart]',_0x24b6fa['uniqueid']),_0x5b881f);}};exports[_0x05e1('0x62')]=function(_0x3ff914){try{if(!_['isNil'](queues[_0x3ff914[_0x05e1('0x5')]])){if(!_[_0x05e1('0x19')](queues[_0x3ff914[_0x05e1('0x5')]][_0x05e1('0x61')])){utils[_0x05e1('0x12')](util[_0x05e1('0x3')]('[%s][queues][musiconholdstop]',_0x3ff914[_0x05e1('0x5')]),_0x3ff914);queues[_0x3ff914[_0x05e1('0x5')]]['mohtime']+=utils[_0x05e1('0x35')](utils[_0x05e1('0x17')](),queues[_0x3ff914[_0x05e1('0x5')]]['musiconholdstartAt']);utils[_0x05e1('0x14')](util['format'](_0x05e1('0x63'),_0x3ff914[_0x05e1('0x5')],queues[_0x3ff914['uniqueid']]['name'],queues[_0x3ff914[_0x05e1('0x5')]][_0x05e1('0x58')]));delete queues[_0x3ff914['uniqueid']][_0x05e1('0x61')];}}}catch(_0x4d0846){utils[_0x05e1('0x2d')](util[_0x05e1('0x3')](_0x05e1('0x64'),_0x3ff914[_0x05e1('0x5')]),_0x4d0846);}};
\ No newline at end of file
index 586e3d0..6d171b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6b6=['membername','name','UserId','request','CreateVoiceRecording','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','[%s][recordings][newchannel]','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','linkedid','transfer','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','.WAV','find','monitors','push','[%s][recordings][varset]','[%s][recordings][hangup]','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','format','blinds','uniqueid','accountcode','then'];(function(_0x1b9435,_0x4f0a1a){var _0x7e12ae=function(_0xbb8d23){while(--_0xbb8d23){_0x1b9435['push'](_0x1b9435['shift']());}};_0x7e12ae(++_0x4f0a1a);}(_0xf6b6,0x83));var _0x6f6b=function(_0x2d4b81,_0x1348d3){_0x2d4b81=_0x2d4b81-0x0;var _0x1ed9b4=_0xf6b6[_0x2d4b81];return _0x1ed9b4;};'use strict';var _=require(_0x6f6b('0x0'));var util=require(_0x6f6b('0x1'));var utils=require(_0x6f6b('0x2'));var transfers=require(_0x6f6b('0x3'));var recordings={};function writeDB(_0x4d8dad){var _0x4c8fce;utils['info'](util[_0x6f6b('0x4')]('[%s][recordings][writeDB]',_0x4d8dad['uniqueid']));if(transfers[_0x6f6b('0x5')][_0x4d8dad[_0x6f6b('0x6')]]){_0x4c8fce=_0x4d8dad[_0x6f6b('0x6')];_0x4d8dad[_0x6f6b('0x6')]=transfers[_0x6f6b('0x5')][_0x4d8dad[_0x6f6b('0x6')]]['transfereeuniqueid'];}if(_0x4d8dad[_0x6f6b('0x7')]){utils['getUserByInternal'](_0x4d8dad[_0x6f6b('0x7')])[_0x6f6b('0x8')](function(_0x5cb84f){if(_0x5cb84f){_0x4d8dad[_0x6f6b('0x9')]=_0x5cb84f[_0x6f6b('0xa')];_0x4d8dad[_0x6f6b('0xb')]=_0x5cb84f['id'];}utils[_0x6f6b('0xc')](_0x6f6b('0xd'),_0x4d8dad);});}else{utils['request'](_0x6f6b('0xd'),_0x4d8dad);}if(_0x4c8fce)delete transfers[_0x6f6b('0x5')][_0x4c8fce];}exports['newchannel']=function(_0x25275a){try{utils['debug'](util[_0x6f6b('0x4')]('[%s][recordings][newchannel]',_0x25275a[_0x6f6b('0x6')]),_0x25275a);if(_0x25275a[_0x6f6b('0x6')]==_0x25275a['linkedid']){utils[_0x6f6b('0xe')](util[_0x6f6b('0x4')](_0x6f6b('0xf'),_0x25275a[_0x6f6b('0x6')],_0x25275a[_0x6f6b('0x10')],_0x25275a[_0x6f6b('0x11')]));recordings[_0x25275a[_0x6f6b('0x6')]]={'uniqueid':_0x25275a['uniqueid'],'accountcode':_0x25275a['accountcode'],'exten':_0x25275a[_0x6f6b('0x11')],'context':_0x25275a[_0x6f6b('0x10')],'channel':_0x25275a['channel'],'monitors':[]};}}catch(_0x41ee3f){utils[_0x6f6b('0x12')](util[_0x6f6b('0x4')](_0x6f6b('0x13'),_0x25275a[_0x6f6b('0x6')]),_0x41ee3f);}};exports[_0x6f6b('0x14')]=function(_0x3da4e4){try{utils[_0x6f6b('0x15')](util[_0x6f6b('0x4')](_0x6f6b('0x16'),_0x3da4e4[_0x6f6b('0x6')]),_0x3da4e4);if(!_[_0x6f6b('0x17')](recordings[_0x3da4e4['uniqueid']])&&_0x3da4e4[_0x6f6b('0x18')]==0x6){utils[_0x6f6b('0xe')](util[_0x6f6b('0x4')](_0x6f6b('0x19'),_0x3da4e4[_0x6f6b('0x6')],_0x3da4e4[_0x6f6b('0x10')],_0x3da4e4[_0x6f6b('0x1a')]));}else if(!_[_0x6f6b('0x17')](recordings[_0x3da4e4[_0x6f6b('0x1b')]])&&_0x3da4e4[_0x6f6b('0x18')]==0x6&&_0x3da4e4[_0x6f6b('0x10')]!=_0x6f6b('0x1c')){utils[_0x6f6b('0xe')](util[_0x6f6b('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x3da4e4[_0x6f6b('0x6')],_0x3da4e4['linkedid'],_0x3da4e4[_0x6f6b('0x10')],_0x3da4e4[_0x6f6b('0x1a')]));recordings[_0x3da4e4[_0x6f6b('0x1b')]][_0x6f6b('0x7')]=_0x3da4e4[_0x6f6b('0x7')];}}catch(_0x4cc0ed){utils[_0x6f6b('0x12')](util[_0x6f6b('0x4')](_0x6f6b('0x16'),_0x3da4e4[_0x6f6b('0x6')]),_0x4cc0ed);}};exports['varset']=function(_0x234386){try{if(!_['isNil'](_0x234386['variable'])&&!_['isNil'](_0x234386[_0x6f6b('0x1d')][_0x6f6b('0x1e')])){utils['debug'](util[_0x6f6b('0x4')]('[%s][recordings][varset]',_0x234386['uniqueid']),_0x234386);utils[_0x6f6b('0xe')](util[_0x6f6b('0x4')](_0x6f6b('0x1f'),_0x234386[_0x6f6b('0x6')],_0x234386[_0x6f6b('0x1d')],_0x234386[_0x6f6b('0x20')]));if(_['endsWith'](_0x234386[_0x6f6b('0x20')],'.wav49')){_0x234386[_0x6f6b('0x20')]=_0x234386[_0x6f6b('0x20')]['replace'](_0x6f6b('0x21'),_0x6f6b('0x22'));}if(recordings[_0x234386[_0x6f6b('0x1b')]]){var _0x434aa6=_[_0x6f6b('0x23')](recordings[_0x234386[_0x6f6b('0x1b')]][_0x6f6b('0x24')],{'value':_0x234386[_0x6f6b('0x20')]});if(_[_0x6f6b('0x17')](_0x434aa6)){recordings[_0x234386['linkedid']][_0x6f6b('0x24')][_0x6f6b('0x25')]({'value':_0x234386[_0x6f6b('0x20')]});}}}}catch(_0x11842c){utils['error'](util[_0x6f6b('0x4')](_0x6f6b('0x26'),_0x234386[_0x6f6b('0x6')]),_0x11842c);}};exports['hangup']=function(_0x458e42){try{if(!_['isNil'](recordings[_0x458e42[_0x6f6b('0x6')]])){utils[_0x6f6b('0x15')](util[_0x6f6b('0x4')](_0x6f6b('0x27'),_0x458e42[_0x6f6b('0x6')]),_0x458e42);utils[_0x6f6b('0xe')](util[_0x6f6b('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x458e42[_0x6f6b('0x6')],_0x458e42[_0x6f6b('0x28')],_0x458e42['calleridname'],_0x458e42['cause-txt']));recordings[_0x458e42[_0x6f6b('0x6')]][_0x6f6b('0x28')]=_0x458e42[_0x6f6b('0x28')];recordings[_0x458e42[_0x6f6b('0x6')]][_0x6f6b('0x29')]=_0x458e42[_0x6f6b('0x29')];recordings[_0x458e42[_0x6f6b('0x6')]][_0x6f6b('0x2a')]=_0x458e42['connectedlinenum'];recordings[_0x458e42[_0x6f6b('0x6')]][_0x6f6b('0x2b')]=_0x458e42['connectedlinename'];if(recordings[_0x458e42['uniqueid']]['type']==_0x6f6b('0x2c')&&recordings[_0x458e42[_0x6f6b('0x6')]][_0x6f6b('0x7')]){recordings[_0x458e42[_0x6f6b('0x6')]][_0x6f6b('0x2a')]=recordings[_0x458e42[_0x6f6b('0x6')]][_0x6f6b('0x7')];recordings[_0x458e42[_0x6f6b('0x6')]][_0x6f6b('0x2b')]='';}recordings[_0x458e42[_0x6f6b('0x6')]][_0x6f6b('0x24')][_0x6f6b('0x2d')](function(_0x3d6bdb){var _0x442566=_[_0x6f6b('0x2e')](recordings[_0x458e42[_0x6f6b('0x6')]]);_0x442566[_0x6f6b('0x20')]=_0x3d6bdb[_0x6f6b('0x20')];writeDB(_0x442566);});delete recordings[_0x458e42[_0x6f6b('0x6')]];}}catch(_0x5956f9){utils[_0x6f6b('0x12')](util[_0x6f6b('0x4')](_0x6f6b('0x27'),_0x458e42['uniqueid']),_0x5956f9);}};exports[_0x6f6b('0x2f')]=function(_0x336adb){try{if(!_[_0x6f6b('0x17')](recordings[_0x336adb[_0x6f6b('0x6')]])){utils[_0x6f6b('0x15')](util[_0x6f6b('0x4')](_0x6f6b('0x30'),_0x336adb[_0x6f6b('0x6')]),_0x336adb);utils['info'](util[_0x6f6b('0x4')](_0x6f6b('0x31'),_0x336adb['uniqueid'],_0x336adb['application'],_0x336adb[_0x6f6b('0x32')]));if(_0x336adb[_0x6f6b('0x33')][_0x6f6b('0x34')]()==_0x6f6b('0x35')&&_[_0x6f6b('0x36')](_0x336adb[_0x6f6b('0x32')][_0x6f6b('0x34')](),_0x6f6b('0x37'))){var _0x2a6eec=_0x336adb[_0x6f6b('0x32')][_0x6f6b('0x38')]('=');var _0x1505fc=_0x2a6eec[0x0]['substring'](_0x2a6eec[0x0][_0x6f6b('0x39')]('(')+0x1,_0x2a6eec[0x0][_0x6f6b('0x39')](')'));var _0x45d683=_0x2a6eec[0x1];recordings[_0x336adb[_0x6f6b('0x6')]][_0x1505fc]=_0x45d683;}}}catch(_0x1b73c0){utils[_0x6f6b('0x12')](util[_0x6f6b('0x4')](_0x6f6b('0x30'),_0x336adb['uniqueid']),_0x1b73c0);}};exports[_0x6f6b('0x3a')]=function(_0x491240){try{if(!_[_0x6f6b('0x17')](recordings[_0x491240[_0x6f6b('0x6')]])){utils[_0x6f6b('0x15')](util[_0x6f6b('0x4')]('[%s][recordings][queuecallerjoin]',_0x491240[_0x6f6b('0x6')]),_0x491240);utils[_0x6f6b('0xe')](util[_0x6f6b('0x4')](_0x6f6b('0x3b'),_0x491240[_0x6f6b('0x6')],_0x491240[_0x6f6b('0x3c')]));recordings[_0x491240[_0x6f6b('0x6')]][_0x6f6b('0x3c')]=_0x491240[_0x6f6b('0x3c')];}}catch(_0x920bff){utils[_0x6f6b('0x12')](util['format'](_0x6f6b('0x3d'),_0x491240['uniqueid']),_0x920bff);}};exports[_0x6f6b('0x3e')]=function(_0x3bd0dd){try{utils[_0x6f6b('0x15')](util['format'](_0x6f6b('0x3f'),_0x3bd0dd[_0x6f6b('0x6')]),_0x3bd0dd);utils['info'](util[_0x6f6b('0x4')](_0x6f6b('0x40'),_0x3bd0dd[_0x6f6b('0x6')],_0x3bd0dd['transferercalleridnum'],_0x3bd0dd[_0x6f6b('0x41')],_0x3bd0dd[_0x6f6b('0x42')],_0x3bd0dd[_0x6f6b('0x43')]));if(recordings[_0x3bd0dd['transfereruniqueid']]&&transfers[_0x6f6b('0x5')][_0x3bd0dd[_0x6f6b('0x44')]]){transfers[_0x6f6b('0x5')][_0x3bd0dd[_0x6f6b('0x44')]][_0x6f6b('0x45')]=!![];}}catch(_0x1deee8){utils[_0x6f6b('0x12')](util[_0x6f6b('0x4')](_0x6f6b('0x3f'),_0x3bd0dd['uniqueid']),_0x1deee8);}};
\ No newline at end of file
+var _0x69f2=['./transfers.controller','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','UserId','CreateVoiceRecording','request','newchannel','[%s][recordings][newchannel]','linkedid','info','context','exten','channel','error','newstate','debug','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','find','monitors','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','substring','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','util','./utils'];(function(_0x144049,_0x4e6ccf){var _0x517caa=function(_0x7416b8){while(--_0x7416b8){_0x144049['push'](_0x144049['shift']());}};_0x517caa(++_0x4e6ccf);}(_0x69f2,0x189));var _0x269f=function(_0x4a0822,_0x124cbf){_0x4a0822=_0x4a0822-0x0;var _0x35d46d=_0x69f2[_0x4a0822];return _0x35d46d;};'use strict';var _=require(_0x269f('0x0'));var util=require(_0x269f('0x1'));var utils=require(_0x269f('0x2'));var transfers=require(_0x269f('0x3'));var recordings={};function writeDB(_0xd25e03){var _0x14d84f;utils['info'](util[_0x269f('0x4')](_0x269f('0x5'),_0xd25e03['uniqueid']));if(transfers[_0x269f('0x6')][_0xd25e03[_0x269f('0x7')]]){_0x14d84f=_0xd25e03[_0x269f('0x7')];_0xd25e03[_0x269f('0x7')]=transfers['blinds'][_0xd25e03['uniqueid']][_0x269f('0x8')];}if(_0xd25e03[_0x269f('0x9')]){utils[_0x269f('0xa')](_0xd25e03[_0x269f('0x9')])[_0x269f('0xb')](function(_0x807925){if(_0x807925){_0xd25e03['membername']=_0x807925['name'];_0xd25e03[_0x269f('0xc')]=_0x807925['id'];}utils['request'](_0x269f('0xd'),_0xd25e03);});}else{utils[_0x269f('0xe')](_0x269f('0xd'),_0xd25e03);}if(_0x14d84f)delete transfers[_0x269f('0x6')][_0x14d84f];}exports[_0x269f('0xf')]=function(_0x1a36c2){try{utils['debug'](util[_0x269f('0x4')](_0x269f('0x10'),_0x1a36c2[_0x269f('0x7')]),_0x1a36c2);if(_0x1a36c2['uniqueid']==_0x1a36c2[_0x269f('0x11')]){utils[_0x269f('0x12')](util[_0x269f('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x1a36c2[_0x269f('0x7')],_0x1a36c2[_0x269f('0x13')],_0x1a36c2[_0x269f('0x14')]));recordings[_0x1a36c2[_0x269f('0x7')]]={'uniqueid':_0x1a36c2[_0x269f('0x7')],'accountcode':_0x1a36c2['accountcode'],'exten':_0x1a36c2[_0x269f('0x14')],'context':_0x1a36c2[_0x269f('0x13')],'channel':_0x1a36c2[_0x269f('0x15')],'monitors':[]};}}catch(_0x15e5d5){utils[_0x269f('0x16')](util['format'](_0x269f('0x10'),_0x1a36c2[_0x269f('0x7')]),_0x15e5d5);}};exports[_0x269f('0x17')]=function(_0x40789d){try{utils[_0x269f('0x18')](util['format']('[%s][recordings][newstate]',_0x40789d[_0x269f('0x7')]),_0x40789d);if(!_[_0x269f('0x19')](recordings[_0x40789d[_0x269f('0x7')]])&&_0x40789d[_0x269f('0x1a')]==0x6){utils[_0x269f('0x12')](util['format'](_0x269f('0x1b'),_0x40789d[_0x269f('0x7')],_0x40789d[_0x269f('0x13')],_0x40789d[_0x269f('0x15')]));}else if(!_[_0x269f('0x19')](recordings[_0x40789d[_0x269f('0x11')]])&&_0x40789d[_0x269f('0x1a')]==0x6&&_0x40789d[_0x269f('0x13')]!='transfer'){utils[_0x269f('0x12')](util[_0x269f('0x4')](_0x269f('0x1c'),_0x40789d[_0x269f('0x7')],_0x40789d[_0x269f('0x11')],_0x40789d['context'],_0x40789d[_0x269f('0x15')]));recordings[_0x40789d['linkedid']][_0x269f('0x9')]=_0x40789d[_0x269f('0x9')];}}catch(_0x1a91ec){utils[_0x269f('0x16')](util[_0x269f('0x4')]('[%s][recordings][newstate]',_0x40789d['uniqueid']),_0x1a91ec);}};exports[_0x269f('0x1d')]=function(_0x2024b4){try{if(!_[_0x269f('0x19')](_0x2024b4['variable'])&&!_['isNil'](_0x2024b4[_0x269f('0x1e')][_0x269f('0x1f')])){utils[_0x269f('0x18')](util[_0x269f('0x4')](_0x269f('0x20'),_0x2024b4['uniqueid']),_0x2024b4);utils[_0x269f('0x12')](util[_0x269f('0x4')](_0x269f('0x21'),_0x2024b4[_0x269f('0x7')],_0x2024b4[_0x269f('0x1e')],_0x2024b4[_0x269f('0x22')]));if(_[_0x269f('0x23')](_0x2024b4[_0x269f('0x22')],'.wav49')){_0x2024b4[_0x269f('0x22')]=_0x2024b4[_0x269f('0x22')]['replace'](_0x269f('0x24'),_0x269f('0x25'));}if(recordings[_0x2024b4[_0x269f('0x11')]]){var _0x5cffab=_[_0x269f('0x26')](recordings[_0x2024b4[_0x269f('0x11')]][_0x269f('0x27')],{'value':_0x2024b4[_0x269f('0x22')]});if(_[_0x269f('0x19')](_0x5cffab)){recordings[_0x2024b4[_0x269f('0x11')]][_0x269f('0x27')]['push']({'value':_0x2024b4[_0x269f('0x22')]});}}}}catch(_0x28035d){utils[_0x269f('0x16')](util[_0x269f('0x4')](_0x269f('0x20'),_0x2024b4['uniqueid']),_0x28035d);}};exports['hangup']=function(_0x11b951){try{if(!_[_0x269f('0x19')](recordings[_0x11b951[_0x269f('0x7')]])){utils[_0x269f('0x18')](util[_0x269f('0x4')](_0x269f('0x28'),_0x11b951[_0x269f('0x7')]),_0x11b951);utils[_0x269f('0x12')](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x11b951['uniqueid'],_0x11b951[_0x269f('0x29')],_0x11b951[_0x269f('0x2a')],_0x11b951[_0x269f('0x2b')]));recordings[_0x11b951[_0x269f('0x7')]][_0x269f('0x29')]=_0x11b951[_0x269f('0x29')];recordings[_0x11b951[_0x269f('0x7')]][_0x269f('0x2a')]=_0x11b951['calleridname'];recordings[_0x11b951[_0x269f('0x7')]][_0x269f('0x2c')]=_0x11b951[_0x269f('0x2c')];recordings[_0x11b951['uniqueid']][_0x269f('0x2d')]=_0x11b951[_0x269f('0x2d')];if(recordings[_0x11b951['uniqueid']][_0x269f('0x2e')]=='outbound'&&recordings[_0x11b951[_0x269f('0x7')]]['accountcode']){recordings[_0x11b951[_0x269f('0x7')]][_0x269f('0x2c')]=recordings[_0x11b951[_0x269f('0x7')]][_0x269f('0x9')];recordings[_0x11b951[_0x269f('0x7')]][_0x269f('0x2d')]='';}recordings[_0x11b951[_0x269f('0x7')]]['monitors']['forEach'](function(_0x45051b){var _0x1eb7a2=_[_0x269f('0x2f')](recordings[_0x11b951['uniqueid']]);_0x1eb7a2[_0x269f('0x22')]=_0x45051b['value'];writeDB(_0x1eb7a2);});delete recordings[_0x11b951[_0x269f('0x7')]];}}catch(_0x4e26e1){utils['error'](util[_0x269f('0x4')](_0x269f('0x28'),_0x11b951[_0x269f('0x7')]),_0x4e26e1);}};exports['newexten']=function(_0xcd2acb){try{if(!_[_0x269f('0x19')](recordings[_0xcd2acb[_0x269f('0x7')]])){utils[_0x269f('0x18')](util[_0x269f('0x4')](_0x269f('0x30'),_0xcd2acb[_0x269f('0x7')]),_0xcd2acb);utils[_0x269f('0x12')](util[_0x269f('0x4')](_0x269f('0x31'),_0xcd2acb[_0x269f('0x7')],_0xcd2acb[_0x269f('0x32')],_0xcd2acb[_0x269f('0x33')]));if(_0xcd2acb[_0x269f('0x32')][_0x269f('0x34')]()==_0x269f('0x35')&&_['startsWith'](_0xcd2acb[_0x269f('0x33')][_0x269f('0x34')](),_0x269f('0x36'))){var _0x2cb796=_0xcd2acb[_0x269f('0x33')]['split']('=');var _0x3474b8=_0x2cb796[0x0][_0x269f('0x37')](_0x2cb796[0x0]['lastIndexOf']('(')+0x1,_0x2cb796[0x0]['lastIndexOf'](')'));var _0x5c39c5=_0x2cb796[0x1];recordings[_0xcd2acb[_0x269f('0x7')]][_0x3474b8]=_0x5c39c5;}}}catch(_0x279ea2){utils[_0x269f('0x16')](util[_0x269f('0x4')]('[%s][recordings][newexten]',_0xcd2acb[_0x269f('0x7')]),_0x279ea2);}};exports[_0x269f('0x38')]=function(_0xa158bd){try{if(!_['isNil'](recordings[_0xa158bd[_0x269f('0x7')]])){utils[_0x269f('0x18')](util['format'](_0x269f('0x39'),_0xa158bd[_0x269f('0x7')]),_0xa158bd);utils[_0x269f('0x12')](util[_0x269f('0x4')](_0x269f('0x3a'),_0xa158bd[_0x269f('0x7')],_0xa158bd[_0x269f('0x3b')]));recordings[_0xa158bd[_0x269f('0x7')]][_0x269f('0x3b')]=_0xa158bd[_0x269f('0x3b')];}}catch(_0x106d65){utils[_0x269f('0x16')](util[_0x269f('0x4')](_0x269f('0x39'),_0xa158bd[_0x269f('0x7')]),_0x106d65);}};exports[_0x269f('0x3c')]=function(_0x2ab946){try{utils[_0x269f('0x18')](util['format'](_0x269f('0x3d'),_0x2ab946[_0x269f('0x7')]),_0x2ab946);utils[_0x269f('0x12')](util[_0x269f('0x4')](_0x269f('0x3e'),_0x2ab946['uniqueid'],_0x2ab946['transferercalleridnum'],_0x2ab946['transferercalleridname'],_0x2ab946[_0x269f('0x3f')],_0x2ab946[_0x269f('0x40')]));if(recordings[_0x2ab946[_0x269f('0x41')]]&&transfers[_0x269f('0x6')][_0x2ab946[_0x269f('0x41')]]){transfers['blinds'][_0x2ab946[_0x269f('0x41')]]['recording']=!![];}}catch(_0x420ece){utils['error'](util[_0x269f('0x4')](_0x269f('0x3d'),_0x2ab946[_0x269f('0x7')]),_0x420ece);}};
\ No newline at end of file
index 5e2b338..08cece5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11b5=['secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransferercontext','isNil','transfereechannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','util','./utils','info','[%s][transfers][writeDB]\x20type:%s','type','attended','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','format','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum','transfereecalleridnum','blind','transfereruniqueid','error','[%s][transfers][attendedtransfer]','origtransfereruniqueid','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel'];(function(_0x45339a,_0x15494c){var _0x27d7db=function(_0x129fda){while(--_0x129fda){_0x45339a['push'](_0x45339a['shift']());}};_0x27d7db(++_0x15494c);}(_0x11b5,0x82));var _0x511b=function(_0x58e2fb,_0x45b9f2){_0x58e2fb=_0x58e2fb-0x0;var _0xd178bf=_0x11b5[_0x58e2fb];return _0xd178bf;};'use strict';var _=require('lodash');var util=require(_0x511b('0x0'));var utils=require(_0x511b('0x1'));function writeDB(_0x263a57){utils[_0x511b('0x2')](util['format'](_0x511b('0x3'),_0x263a57[_0x511b('0x4')]===_0x511b('0x5')?_0x263a57['origtransfereruniqueid']:_0x263a57['uniqueid'],_0x263a57[_0x511b('0x4')]));utils[_0x511b('0x6')](_0x511b('0x7'),_0x263a57);}exports[_0x511b('0x8')]={};exports[_0x511b('0x9')]=function(_0x16446b){try{utils[_0x511b('0xa')](util[_0x511b('0xb')]('[%s][transfers][blindtransfer]',_0x16446b['uniqueid']),_0x16446b);utils['info'](util[_0x511b('0xb')](_0x511b('0xc'),_0x16446b[_0x511b('0xd')],_0x16446b[_0x511b('0xe')],_0x16446b['transferercalleridname'],_0x16446b[_0x511b('0xf')],_0x16446b['transfereecalleridname']));_0x16446b[_0x511b('0x4')]=_0x511b('0x10');exports[_0x511b('0x8')][_0x16446b[_0x511b('0x11')]]=_0x16446b;writeDB(_0x16446b);}catch(_0x5352b2){utils[_0x511b('0x12')](util[_0x511b('0xb')]('[%s][transfers][blindtransfer]',_0x16446b[_0x511b('0xd')]),_0x5352b2);}};exports['attendedtransfer']=function(_0xce11b3){try{utils[_0x511b('0xa')](util[_0x511b('0xb')](_0x511b('0x13'),_0xce11b3[_0x511b('0x14')]),_0xce11b3);utils['info'](util[_0x511b('0xb')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xce11b3[_0x511b('0x14')],_0xce11b3[_0x511b('0x15')],_0xce11b3[_0x511b('0x16')],_0xce11b3[_0x511b('0x17')],_0xce11b3['transfertargetcalleridname']));_0xce11b3=_[_0x511b('0x18')](_0xce11b3,{'transfererchannel':_0xce11b3[_0x511b('0x19')],'transferercalleridnum':_0xce11b3[_0x511b('0x15')],'transferercalleridname':_0xce11b3[_0x511b('0x16')],'transfererconnectedlinenum':_0xce11b3[_0x511b('0x1a')],'transfererconnectedlinename':_0xce11b3[_0x511b('0x1b')],'transfereraccountcode':_0xce11b3['origtransfereraccountcode'],'transferercontext':_0xce11b3[_0x511b('0x1c')],'transfererexten':_0xce11b3[_0x511b('0x1d')],'transfererlinkedid':_0xce11b3['origtransfererlinkedid'],'context':_0xce11b3[_0x511b('0x1e')],'extension':_0xce11b3['origtransfererexten'],'type':'attended'});if(_[_0x511b('0x1f')](_0xce11b3[_0x511b('0x20')])){_0xce11b3=_[_0x511b('0x18')](_0xce11b3,{'transfereechannel':_0xce11b3['transfertargetchannel'],'transfereecalleridnum':_0xce11b3[_0x511b('0x17')],'transfereecalleridname':_0xce11b3[_0x511b('0x21')],'transfereeconnectedlinenum':_0xce11b3[_0x511b('0x22')],'transfereeconnectedlinename':_0xce11b3[_0x511b('0x23')],'transfereeaccountcode':_0xce11b3[_0x511b('0x24')],'transfereecontext':_0xce11b3[_0x511b('0x25')],'transfereeexten':_0xce11b3['transfertargetexten'],'transfereelinkedid':_0xce11b3[_0x511b('0x26')]});}writeDB(_0xce11b3);}catch(_0x43292c){utils['error'](util['format'](_0x511b('0x13'),_0xce11b3[_0x511b('0x14')]),_0x43292c);}};
\ No newline at end of file
+var _0x27d8=['format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetexten','util','./utils','info','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x27d8,0x18f));var _0x827d=function(_0x55c1f0,_0x4f574f){_0x55c1f0=_0x55c1f0-0x0;var _0x1530fa=_0x27d8[_0x55c1f0];return _0x1530fa;};'use strict';var _=require('lodash');var util=require(_0x827d('0x0'));var utils=require(_0x827d('0x1'));function writeDB(_0x3ef5bf){utils[_0x827d('0x2')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x3ef5bf[_0x827d('0x3')]===_0x827d('0x4')?_0x3ef5bf[_0x827d('0x5')]:_0x3ef5bf[_0x827d('0x6')],_0x3ef5bf[_0x827d('0x3')]));utils[_0x827d('0x7')](_0x827d('0x8'),_0x3ef5bf);}exports[_0x827d('0x9')]={};exports[_0x827d('0xa')]=function(_0x205428){try{utils['debug'](util[_0x827d('0xb')](_0x827d('0xc'),_0x205428[_0x827d('0x6')]),_0x205428);utils['info'](util[_0x827d('0xb')](_0x827d('0xd'),_0x205428[_0x827d('0x6')],_0x205428[_0x827d('0xe')],_0x205428[_0x827d('0xf')],_0x205428[_0x827d('0x10')],_0x205428[_0x827d('0x11')]));_0x205428['type']=_0x827d('0x12');exports['blinds'][_0x205428['transfereruniqueid']]=_0x205428;writeDB(_0x205428);}catch(_0x51fd15){utils[_0x827d('0x13')](util[_0x827d('0xb')](_0x827d('0xc'),_0x205428['uniqueid']),_0x51fd15);}};exports[_0x827d('0x14')]=function(_0x44e7f4){try{utils[_0x827d('0x15')](util[_0x827d('0xb')](_0x827d('0x16'),_0x44e7f4['origtransfereruniqueid']),_0x44e7f4);utils[_0x827d('0x2')](util[_0x827d('0xb')](_0x827d('0x17'),_0x44e7f4[_0x827d('0x5')],_0x44e7f4[_0x827d('0x18')],_0x44e7f4[_0x827d('0x19')],_0x44e7f4[_0x827d('0x1a')],_0x44e7f4[_0x827d('0x1b')]));_0x44e7f4=_['assign'](_0x44e7f4,{'transfererchannel':_0x44e7f4[_0x827d('0x1c')],'transferercalleridnum':_0x44e7f4[_0x827d('0x18')],'transferercalleridname':_0x44e7f4['origtransferercalleridname'],'transfererconnectedlinenum':_0x44e7f4['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x44e7f4[_0x827d('0x1d')],'transfereraccountcode':_0x44e7f4[_0x827d('0x1e')],'transferercontext':_0x44e7f4[_0x827d('0x1f')],'transfererexten':_0x44e7f4['secondtransfererexten'],'transfererlinkedid':_0x44e7f4[_0x827d('0x20')],'context':_0x44e7f4[_0x827d('0x21')],'extension':_0x44e7f4[_0x827d('0x22')],'type':'attended'});if(_[_0x827d('0x23')](_0x44e7f4[_0x827d('0x24')])){_0x44e7f4=_['assign'](_0x44e7f4,{'transfereechannel':_0x44e7f4[_0x827d('0x25')],'transfereecalleridnum':_0x44e7f4[_0x827d('0x1a')],'transfereecalleridname':_0x44e7f4['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x44e7f4[_0x827d('0x26')],'transfereeconnectedlinename':_0x44e7f4['transfertargetconnectedlinename'],'transfereeaccountcode':_0x44e7f4[_0x827d('0x27')],'transfereecontext':_0x44e7f4['transfertargetcontext'],'transfereeexten':_0x44e7f4[_0x827d('0x28')],'transfereelinkedid':_0x44e7f4['transfertargetlinkedid']});}writeDB(_0x44e7f4);}catch(_0x5266ad){utils[_0x827d('0x13')](util[_0x827d('0xb')](_0x827d('0x16'),_0x44e7f4[_0x827d('0x5')]),_0x5266ad);}};
\ No newline at end of file
index db8fbd3..78ee2dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d1=['[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','client','http','../../config/logger','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','[utils][getUser]\x20where:%s','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s'];(function(_0x3a12da,_0x2ea7da){var _0x4124ca=function(_0x56b165){while(--_0x56b165){_0x3a12da['push'](_0x3a12da['shift']());}};_0x4124ca(++_0x2ea7da);}(_0xd6d1,0x14a));var _0x1d6d=function(_0x2db787,_0xce6e2b){_0x2db787=_0x2db787-0x0;var _0x44ae4b=_0xd6d1[_0x2db787];return _0x44ae4b;};'use strict';var BPromise=require(_0x1d6d('0x0'));var jayson=require(_0x1d6d('0x1'));var moment=require('moment');var util=require('util');var client=jayson[_0x1d6d('0x2')][_0x1d6d('0x3')]({'port':0x2329});var logger=require(_0x1d6d('0x4'))(_0x1d6d('0x5'));exports[_0x1d6d('0x6')]=function(_0x293359,_0xf9a65f){logger['info'](_0x293359,_0xf9a65f?util['inspect'](_0xf9a65f,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0xeeaa5f,_0x2f12b2){logger[_0x1d6d('0x7')](_0xeeaa5f,_0x2f12b2?util[_0x1d6d('0x8')](_0x2f12b2,{'showHidden':![],'depth':null}):'');};exports[_0x1d6d('0x9')]=function(_0x10bf3f,_0x377bc0){logger[_0x1d6d('0x9')](_0x10bf3f,_0x377bc0?util['inspect'](_0x377bc0,{'showHidden':![],'depth':null}):'');};exports[_0x1d6d('0xa')]=function(_0x34431e,_0x47ac1e){return client[_0x1d6d('0xa')](_0x34431e,{'body':_0x47ac1e})[_0x1d6d('0xb')](function(_0x2e9da3){logger[_0x1d6d('0x7')](_0x1d6d('0xc'),_0x34431e,_0x2e9da3?util[_0x1d6d('0x8')](_0x2e9da3,{'showHidden':![],'depth':null}):'');})[_0x1d6d('0xd')](function(_0x1fa352){logger['error']('[utils][request]\x20name:%s',_0x34431e,_0x1fa352?util[_0x1d6d('0x8')](_0x1fa352,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4630f3){return client['request'](_0x1d6d('0xe'),{'options':{'raw':!![],'attributes':['id',_0x1d6d('0xf'),_0x1d6d('0x10'),'interface'],'where':_0x4630f3,'limit':0x1}})[_0x1d6d('0xb')](function(_0xea9dc0){logger[_0x1d6d('0x7')](_0x1d6d('0x11'),JSON['stringify'](_0x4630f3),_0xea9dc0?util['inspect'](_0xea9dc0,{'showHidden':![],'depth':null}):'');return _0xea9dc0[_0x1d6d('0x12')][_0x1d6d('0x13')]?_0xea9dc0[_0x1d6d('0x12')][0x0]:null;});}exports[_0x1d6d('0x14')]=function(_0x40588c){return new BPromise(function(_0x44cf87,_0x3c55c0){if(_0x40588c){return getUser({'internal':_0x40588c})[_0x1d6d('0xb')](function(_0x7ddd59){logger[_0x1d6d('0x6')](_0x1d6d('0x15'),_0x40588c,_0x7ddd59?_0x1d6d('0x16'):_0x1d6d('0x17'));return _0x44cf87(_0x7ddd59);})['catch'](function(_0x3f5c55){logger['error'](_0x1d6d('0x18'),_0x3f5c55?util[_0x1d6d('0x8')](_0x3f5c55,{'showHidden':![],'depth':null}):'');return _0x44cf87(null);});}return _0x44cf87(null);});};exports[_0x1d6d('0x19')]=function(_0x5c42b7){return new BPromise(function(_0x2f3c2c,_0x26294e){if(_0x5c42b7){return getUser({'interface':_0x5c42b7})[_0x1d6d('0xb')](function(_0x354284){logger[_0x1d6d('0x6')](_0x1d6d('0x1a'),_0x5c42b7,_0x354284?_0x1d6d('0x16'):_0x1d6d('0x17'));return _0x2f3c2c(_0x354284);})['catch'](function(_0x3d8668){logger[_0x1d6d('0x9')](_0x1d6d('0x1b'),_0x3d8668?util[_0x1d6d('0x8')](_0x3d8668,{'showHidden':![],'depth':null}):'');return _0x2f3c2c(null);});}return _0x2f3c2c(null);});};exports[_0x1d6d('0x1c')]=function(_0x341f2d){return new BPromise(function(_0x413591,_0x3e6b0f){if(_0x341f2d){return getUser({'name':_0x341f2d})[_0x1d6d('0xb')](function(_0x54ade8){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x341f2d,_0x54ade8?_0x1d6d('0x16'):_0x1d6d('0x17'));return _0x413591(_0x54ade8);})[_0x1d6d('0xd')](function(_0xc44cef){logger[_0x1d6d('0x9')](_0x1d6d('0x1d'),_0xc44cef?util[_0x1d6d('0x8')](_0xc44cef,{'showHidden':![],'depth':null}):'');return _0x413591(null);});}return _0x413591(null);});};exports[_0x1d6d('0x1e')]=function(_0x3f05ea){return new BPromise(function(_0x10e3fe,_0x34c576){if(_0x3f05ea){return client['request'](_0x1d6d('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x1d6d('0x10'),_0x1d6d('0x20'),_0x1d6d('0x21'),_0x1d6d('0x22')],'where':{'name':_0x3f05ea},'limit':0x1}})[_0x1d6d('0xb')](function(_0x140d20){logger[_0x1d6d('0x7')](_0x1d6d('0x23'),_0x3f05ea,_0x140d20?util[_0x1d6d('0x8')](_0x140d20,{'showHidden':![],'depth':null}):'');logger[_0x1d6d('0x6')](_0x1d6d('0x24'),_0x3f05ea,_0x140d20?_0x1d6d('0x16'):_0x1d6d('0x17'));return _0x10e3fe(_0x140d20[_0x1d6d('0x12')]['length']?_0x140d20['result'][0x0]:null);})['catch'](function(_0xb0478f){logger[_0x1d6d('0x9')](_0x1d6d('0x25'),_0xb0478f?util[_0x1d6d('0x8')](_0xb0478f,{'showHidden':![],'depth':null}):'');return _0x10e3fe(null);});}return _0x10e3fe(null);});};exports[_0x1d6d('0x26')]=function(_0x14b497,_0x3d3965){return moment(_0x14b497)[_0x1d6d('0x27')](_0x3d3965,_0x1d6d('0x28'))[_0x1d6d('0x29')](_0x1d6d('0x2a'));};exports[_0x1d6d('0x2b')]=function(_0x1cff45,_0x168173){return moment(_0x1cff45)[_0x1d6d('0x2c')](_0x168173,_0x1d6d('0x28'))['format'](_0x1d6d('0x2a'));};exports[_0x1d6d('0x2d')]=function(_0x2ea12a,_0x194d8c){return moment(_0x2ea12a)[_0x1d6d('0x2e')](moment(_0x194d8c),'seconds');};exports[_0x1d6d('0x2f')]=function(_0x4db489,_0x18123e){return parseInt(_0x4db489,0xa)+parseInt(_0x18123e,0xa);};exports[_0x1d6d('0x30')]=function(){return moment()[_0x1d6d('0x29')](_0x1d6d('0x2a'));};exports[_0x1d6d('0x31')]=function(_0x2c783a,_0x35ca9e){if(_0x35ca9e){return moment(_0x2c783a)[_0x1d6d('0x31')](_0x35ca9e);}return!![];};exports['isBefore']=function(_0x277b84,_0x435173){if(_0x435173){return moment(_0x277b84)[_0x1d6d('0x32')](_0x435173);}else if(_0x277b84){return!![];}return![];};
\ No newline at end of file
+var _0xb234=['catch','[utils][request]\x20name:%s','GetUser','internal','name','debug','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','info','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','diff','sumTime','now','format','isAfter','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','inspect','error','request','then'];(function(_0x9926ac,_0x3ac741){var _0x182339=function(_0x517afd){while(--_0x517afd){_0x9926ac['push'](_0x9926ac['shift']());}};_0x182339(++_0x3ac741);}(_0xb234,0x13f));var _0x4b23=function(_0x23e7cb,_0x43d9e2){_0x23e7cb=_0x23e7cb-0x0;var _0xb020e9=_0xb234[_0x23e7cb];return _0xb020e9;};'use strict';var BPromise=require(_0x4b23('0x0'));var jayson=require(_0x4b23('0x1'));var moment=require('moment');var util=require(_0x4b23('0x2'));var client=jayson[_0x4b23('0x3')][_0x4b23('0x4')]({'port':0x2329});var logger=require(_0x4b23('0x5'))('xdr');exports['info']=function(_0x36c95e,_0xf90d41){logger['info'](_0x36c95e,_0xf90d41?util[_0x4b23('0x6')](_0xf90d41,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x34a49f,_0x56c650){logger['debug'](_0x34a49f,_0x56c650?util[_0x4b23('0x6')](_0x56c650,{'showHidden':![],'depth':null}):'');};exports[_0x4b23('0x7')]=function(_0x50f321,_0x359991){logger[_0x4b23('0x7')](_0x50f321,_0x359991?util['inspect'](_0x359991,{'showHidden':![],'depth':null}):'');};exports[_0x4b23('0x8')]=function(_0x5daa80,_0x27b828){return client[_0x4b23('0x8')](_0x5daa80,{'body':_0x27b828})[_0x4b23('0x9')](function(_0x10bf79){logger['debug']('[utils][request]\x20name:%s',_0x5daa80,_0x10bf79?util['inspect'](_0x10bf79,{'showHidden':![],'depth':null}):'');})[_0x4b23('0xa')](function(_0x1a6f01){logger[_0x4b23('0x7')](_0x4b23('0xb'),_0x5daa80,_0x1a6f01?util[_0x4b23('0x6')](_0x1a6f01,{'showHidden':![],'depth':null}):'');});};function getUser(_0x149e95){return client[_0x4b23('0x8')](_0x4b23('0xc'),{'options':{'raw':!![],'attributes':['id',_0x4b23('0xd'),_0x4b23('0xe'),'interface'],'where':_0x149e95,'limit':0x1}})[_0x4b23('0x9')](function(_0x260aca){logger[_0x4b23('0xf')](_0x4b23('0x10'),JSON[_0x4b23('0x11')](_0x149e95),_0x260aca?util['inspect'](_0x260aca,{'showHidden':![],'depth':null}):'');return _0x260aca[_0x4b23('0x12')][_0x4b23('0x13')]?_0x260aca[_0x4b23('0x12')][0x0]:null;});}exports[_0x4b23('0x14')]=function(_0x2ae8ef){return new BPromise(function(_0x26f7ad,_0x56673a){if(_0x2ae8ef){return getUser({'internal':_0x2ae8ef})[_0x4b23('0x9')](function(_0x1d48bd){logger[_0x4b23('0x15')](_0x4b23('0x16'),_0x2ae8ef,_0x1d48bd?_0x4b23('0x17'):_0x4b23('0x18'));return _0x26f7ad(_0x1d48bd);})[_0x4b23('0xa')](function(_0x2bbce4){logger['error']('[utils][getUserByInternal]',_0x2bbce4?util[_0x4b23('0x6')](_0x2bbce4,{'showHidden':![],'depth':null}):'');return _0x26f7ad(null);});}return _0x26f7ad(null);});};exports[_0x4b23('0x19')]=function(_0x19544b){return new BPromise(function(_0x286e6f,_0x22e288){if(_0x19544b){return getUser({'interface':_0x19544b})[_0x4b23('0x9')](function(_0xc5d2df){logger[_0x4b23('0x15')](_0x4b23('0x1a'),_0x19544b,_0xc5d2df?_0x4b23('0x17'):'notfound');return _0x286e6f(_0xc5d2df);})[_0x4b23('0xa')](function(_0x505fd4){logger[_0x4b23('0x7')](_0x4b23('0x1b'),_0x505fd4?util['inspect'](_0x505fd4,{'showHidden':![],'depth':null}):'');return _0x286e6f(null);});}return _0x286e6f(null);});};exports[_0x4b23('0x1c')]=function(_0x125b18){return new BPromise(function(_0x5331c2,_0x56c123){if(_0x125b18){return getUser({'name':_0x125b18})[_0x4b23('0x9')](function(_0xc01968){logger[_0x4b23('0x15')](_0x4b23('0x1d'),_0x125b18,_0xc01968?'found':_0x4b23('0x18'));return _0x5331c2(_0xc01968);})[_0x4b23('0xa')](function(_0x2f73bd){logger[_0x4b23('0x7')]('[utils][getUserByName]',_0x2f73bd?util[_0x4b23('0x6')](_0x2f73bd,{'showHidden':![],'depth':null}):'');return _0x5331c2(null);});}return _0x5331c2(null);});};exports[_0x4b23('0x1e')]=function(_0x3ae265){return new BPromise(function(_0x58bdc1,_0x3f6df2){if(_0x3ae265){return client[_0x4b23('0x8')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x4b23('0xe'),'type',_0x4b23('0x1f'),_0x4b23('0x20')],'where':{'name':_0x3ae265},'limit':0x1}})[_0x4b23('0x9')](function(_0x32a409){logger[_0x4b23('0xf')]('[utils][getVoiceQueueByName]\x20name:%s',_0x3ae265,_0x32a409?util[_0x4b23('0x6')](_0x32a409,{'showHidden':![],'depth':null}):'');logger[_0x4b23('0x15')](_0x4b23('0x21'),_0x3ae265,_0x32a409?_0x4b23('0x17'):'notfound');return _0x58bdc1(_0x32a409[_0x4b23('0x12')][_0x4b23('0x13')]?_0x32a409['result'][0x0]:null);})['catch'](function(_0x105414){logger['error'](_0x4b23('0x22'),_0x105414?util['inspect'](_0x105414,{'showHidden':![],'depth':null}):'');return _0x58bdc1(null);});}return _0x58bdc1(null);});};exports[_0x4b23('0x23')]=function(_0x323589,_0x3ff24f){return moment(_0x323589)[_0x4b23('0x24')](_0x3ff24f,_0x4b23('0x25'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x4b23('0x26')]=function(_0x15c721,_0x3d54a3){return moment(_0x15c721)[_0x4b23('0x27')](_0x3d54a3,_0x4b23('0x25'))['format'](_0x4b23('0x28'));};exports['diffTime']=function(_0x3667b6,_0x296a36){return moment(_0x3667b6)[_0x4b23('0x29')](moment(_0x296a36),_0x4b23('0x25'));};exports[_0x4b23('0x2a')]=function(_0x235595,_0x3add0a){return parseInt(_0x235595,0xa)+parseInt(_0x3add0a,0xa);};exports[_0x4b23('0x2b')]=function(){return moment()[_0x4b23('0x2c')](_0x4b23('0x28'));};exports[_0x4b23('0x2d')]=function(_0x50fdd8,_0x306d19){if(_0x306d19){return moment(_0x50fdd8)[_0x4b23('0x2d')](_0x306d19);}return!![];};exports[_0x4b23('0x2e')]=function(_0x79f973,_0x18db78){if(_0x18db78){return moment(_0x79f973)['isBefore'](_0x18db78);}else if(_0x79f973){return!![];}return![];};
\ No newline at end of file
index dec03fa..817a884 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b96=['responseTime','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','url','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','util','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then','user','no-user','data','timestamp','catch','api','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','format','method','headers','x-forwarded-for','statusCode'];(function(_0x41b872,_0x4c4ef9){var _0x439768=function(_0x1aba7d){while(--_0x1aba7d){_0x41b872['push'](_0x41b872['shift']());}};_0x439768(++_0x4c4ef9);}(_0x0b96,0x1a1));var _0x60b9=function(_0x2e53e1,_0x12aed1){_0x2e53e1=_0x2e53e1-0x0;var _0x3a23de=_0x0b96[_0x2e53e1];return _0x3a23de;};var fs=require(_0x60b9('0x0'));var _=require(_0x60b9('0x1'));var ewinston=require(_0x60b9('0x2'));var path=require(_0x60b9('0x3'));var util=require(_0x60b9('0x4'));var fileLogger=require('./loggers')['fileLogger'];var safeTemplate=require('./safe-template')[_0x60b9('0x5')];var maskSensitiveData=require(_0x60b9('0x6'))[_0x60b9('0x7')];function ClientSideLogger(){function _0x4b2d0c(_0x3d3b8b){var _0x265088=path[_0x60b9('0x8')](_0x60b9('0x9'),_0x60b9('0xa'),_0x60b9('0xb'));var _0x39a6a9=path['join'](_0x60b9('0xc'),_0x3d3b8b[_0x60b9('0xd')]+'-'+_0x3d3b8b[_0x60b9('0xe')]);return fs[_0x60b9('0xf')](path['join'](_0x265088,_0x39a6a9))['then'](function(){var _0x417fbb=fileLogger(_0x60b9('0xc'),path[_0x60b9('0x8')](_0x265088,_0x39a6a9));return _0x417fbb;})['catch'](function(_0x36bd87){throw _0x36bd87;});}this[_0x60b9('0xa')]=function(_0x8138ff,_0x4742ba,_0xc3e498,_0x2eedd3){return _0x4b2d0c(_0x8138ff['user'])[_0x60b9('0x10')](function(_0x4b8eb8){var _0x42a12d=_0x4b8eb8[_0x4742ba];return _0x42a12d;})['then'](function(_0x9cfc1e){var _0x437016=_0x8138ff['user']?_0x8138ff[_0x60b9('0x11')]['id']:_0x60b9('0x12');var _0x5b059c=_0x2eedd3[_0x60b9('0x13')];var _0x10d190=_0x2eedd3[_0x60b9('0x14')];var _0x1ab502=new Date(Number(_0x10d190));return _0x9cfc1e(_0x437016,_0x1ab502,_0xc3e498,_0x5b059c);})[_0x60b9('0x15')](function(_0x1b6141){fileLogger('client')['error'](_0x1b6141);});};}function setupLoggers(_0x3cafe8){return new Promise(function(_0x1de197){var _0xd41ff1=new ClientSideLogger();var _0x467c96=fileLogger(_0x60b9('0x16'));var _0x31312b=fileLogger('auth');_0x3cafe8['set']('client-side-logger',_0xd41ff1);_0x3cafe8[_0x60b9('0x17')](ewinston[_0x60b9('0x18')]({'winstonInstance':_0x467c96,'meta':![],'statusLevels':!![],'msg':function(_0x46e430,_0x4cda58){var _0x1f8da1=_0x60b9('0x19');if(!_[_0x60b9('0x1a')](_0x46e430['body'])){_0x1f8da1+=_0x60b9('0x1b');var _0x2480c4=_0x46e430['body'];maskSensitiveData(_0x2480c4);}return safeTemplate(util[_0x60b9('0x1c')](_0x1f8da1,_0x46e430[_0x60b9('0x1d')],_0x46e430['headers']['x-forwarded-for']?_0x46e430[_0x60b9('0x1e')][_0x60b9('0x1f')]:_0x46e430['connection']['remoteAddress']||_0x46e430['ip'],_0x46e430['url'],_0x4cda58[_0x60b9('0x20')],_0x4cda58[_0x60b9('0x21')],_0x46e430[_0x60b9('0x11')]?_0x46e430['user']['id']:null,_0x46e430[_0x60b9('0x11')]?_0x46e430[_0x60b9('0x11')]['name']:null,_0x46e430[_0x60b9('0x11')]?_0x46e430[_0x60b9('0x11')]['role']:null,_0x2480c4?util['inspect'](_0x2480c4,![],null):''));}}));_0x3cafe8[_0x60b9('0x17')](ewinston[_0x60b9('0x18')]({'winstonInstance':_0x31312b,'meta':![],'statusLevels':!![],'msg':function(_0x5cce7c,_0x520dcb){var _0x23a755=_0x60b9('0x22');if(_0x5cce7c[_0x60b9('0x23')]&&_0x5cce7c[_0x60b9('0x23')][_0x60b9('0x24')]&&_0x5cce7c[_0x60b9('0x23')][_0x60b9('0x25')]){_0x23a755=_0x60b9('0x26');}return util[_0x60b9('0x1c')](_0x23a755,_0x5cce7c[_0x60b9('0x1d')],_0x5cce7c[_0x60b9('0x1e')][_0x60b9('0x1f')]?_0x5cce7c[_0x60b9('0x1e')][_0x60b9('0x1f')]:_0x5cce7c['connection'][_0x60b9('0x27')]||_0x5cce7c['ip'],_0x5cce7c[_0x60b9('0x28')],_0x520dcb[_0x60b9('0x20')],_0x520dcb[_0x60b9('0x21')],_0x5cce7c['user']?_0x5cce7c[_0x60b9('0x11')]['id']:null,_0x5cce7c['user']?_0x5cce7c[_0x60b9('0x11')][_0x60b9('0xe')]:null,_0x5cce7c[_0x60b9('0x11')]?_0x5cce7c[_0x60b9('0x11')]['role']:null,_0x5cce7c[_0x60b9('0x23')]&&_0x5cce7c[_0x60b9('0x23')]['device']?_0x5cce7c[_0x60b9('0x23')]['device']:_0x60b9('0x29'),_0x5cce7c[_0x60b9('0x23')]&&_0x5cce7c[_0x60b9('0x23')]['agent_id']?_0x5cce7c[_0x60b9('0x23')][_0x60b9('0x25')]:'',_0x5cce7c['body']&&_0x5cce7c[_0x60b9('0x23')][_0x60b9('0x2a')]?_0x5cce7c['body'][_0x60b9('0x2a')]:'');},'ignoreRoute':function(_0x4869d6){var _0x1f8974=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1f8974[_0x60b9('0x2b')](_0x4869d6['url']);}}));return _0x1de197();});}exports[_0x60b9('0x2c')]=setupLoggers;
\ No newline at end of file
+var _0xd2b4=['client-side-logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','join','/var','log','role','name','ensureDir','then','user','no-user','timestamp','catch','error','api','set'];(function(_0x50e638,_0x5d488d){var _0x50399c=function(_0x9b5704){while(--_0x9b5704){_0x50e638['push'](_0x50e638['shift']());}};_0x50399c(++_0x5d488d);}(_0xd2b4,0xa1));var _0x4d2b=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xd2b4[_0x1caf6a];return _0x1bf493;};var fs=require(_0x4d2b('0x0'));var _=require(_0x4d2b('0x1'));var ewinston=require(_0x4d2b('0x2'));var path=require(_0x4d2b('0x3'));var util=require(_0x4d2b('0x4'));var fileLogger=require(_0x4d2b('0x5'))[_0x4d2b('0x6')];var safeTemplate=require(_0x4d2b('0x7'))[_0x4d2b('0x8')];var maskSensitiveData=require('./mask-sensitive-data')['maskSensitiveData'];function ClientSideLogger(){function _0x519f91(_0x229849){var _0x4abd7b=path[_0x4d2b('0x9')](_0x4d2b('0xa'),_0x4d2b('0xb'),'xcally');var _0x3b6a50=path[_0x4d2b('0x9')]('client',_0x229849[_0x4d2b('0xc')]+'-'+_0x229849[_0x4d2b('0xd')]);return fs[_0x4d2b('0xe')](path['join'](_0x4abd7b,_0x3b6a50))[_0x4d2b('0xf')](function(){var _0x48fbfa=fileLogger('client',path[_0x4d2b('0x9')](_0x4abd7b,_0x3b6a50));return _0x48fbfa;})['catch'](function(_0xd0d6f2){throw _0xd0d6f2;});}this['log']=function(_0x464d54,_0x107493,_0x144f38,_0x412175){return _0x519f91(_0x464d54[_0x4d2b('0x10')])['then'](function(_0x52e890){var _0x11e4ef=_0x52e890[_0x107493];return _0x11e4ef;})[_0x4d2b('0xf')](function(_0x567f99){var _0x1f3bd9=_0x464d54[_0x4d2b('0x10')]?_0x464d54[_0x4d2b('0x10')]['id']:_0x4d2b('0x11');var _0x1761e7=_0x412175['data'];var _0x532e48=_0x412175[_0x4d2b('0x12')];var _0x2ed55c=new Date(Number(_0x532e48));return _0x567f99(_0x1f3bd9,_0x2ed55c,_0x144f38,_0x1761e7);})[_0x4d2b('0x13')](function(_0x21adf4){fileLogger('client')[_0x4d2b('0x14')](_0x21adf4);});};}function setupLoggers(_0x50ac72){return new Promise(function(_0x9c341c){var _0x45e103=new ClientSideLogger();var _0x482dd7=fileLogger(_0x4d2b('0x15'));var _0x385091=fileLogger('auth');_0x50ac72[_0x4d2b('0x16')](_0x4d2b('0x17'),_0x45e103);_0x50ac72['use'](ewinston['logger']({'winstonInstance':_0x482dd7,'meta':![],'statusLevels':!![],'msg':function(_0x430130,_0x28949b){var _0x195885=_0x4d2b('0x18');if(!_['isEmpty'](_0x430130[_0x4d2b('0x19')])){_0x195885+=_0x4d2b('0x1a');var _0x201fbf=_0x430130['body'];maskSensitiveData(_0x201fbf);}return safeTemplate(util[_0x4d2b('0x1b')](_0x195885,_0x430130[_0x4d2b('0x1c')],_0x430130[_0x4d2b('0x1d')][_0x4d2b('0x1e')]?_0x430130[_0x4d2b('0x1d')][_0x4d2b('0x1e')]:_0x430130[_0x4d2b('0x1f')][_0x4d2b('0x20')]||_0x430130['ip'],_0x430130[_0x4d2b('0x21')],_0x28949b[_0x4d2b('0x22')],_0x28949b[_0x4d2b('0x23')],_0x430130[_0x4d2b('0x10')]?_0x430130[_0x4d2b('0x10')]['id']:null,_0x430130[_0x4d2b('0x10')]?_0x430130[_0x4d2b('0x10')][_0x4d2b('0xd')]:null,_0x430130[_0x4d2b('0x10')]?_0x430130[_0x4d2b('0x10')]['role']:null,_0x201fbf?util['inspect'](_0x201fbf,![],null):''));}}));_0x50ac72[_0x4d2b('0x24')](ewinston[_0x4d2b('0x25')]({'winstonInstance':_0x385091,'meta':![],'statusLevels':!![],'msg':function(_0x5dbcf8,_0x1fbed0){var _0x3b6713=_0x4d2b('0x26');if(_0x5dbcf8[_0x4d2b('0x19')]&&_0x5dbcf8[_0x4d2b('0x19')][_0x4d2b('0x27')]&&_0x5dbcf8[_0x4d2b('0x19')][_0x4d2b('0x28')]){_0x3b6713=_0x4d2b('0x29');}return util[_0x4d2b('0x1b')](_0x3b6713,_0x5dbcf8[_0x4d2b('0x1c')],_0x5dbcf8['headers'][_0x4d2b('0x1e')]?_0x5dbcf8[_0x4d2b('0x1d')][_0x4d2b('0x1e')]:_0x5dbcf8['connection'][_0x4d2b('0x20')]||_0x5dbcf8['ip'],_0x5dbcf8[_0x4d2b('0x21')],_0x1fbed0[_0x4d2b('0x22')],_0x1fbed0['responseTime'],_0x5dbcf8[_0x4d2b('0x10')]?_0x5dbcf8[_0x4d2b('0x10')]['id']:null,_0x5dbcf8['user']?_0x5dbcf8[_0x4d2b('0x10')]['name']:null,_0x5dbcf8['user']?_0x5dbcf8[_0x4d2b('0x10')][_0x4d2b('0xc')]:null,_0x5dbcf8[_0x4d2b('0x19')]&&_0x5dbcf8['body'][_0x4d2b('0x27')]?_0x5dbcf8[_0x4d2b('0x19')][_0x4d2b('0x27')]:_0x4d2b('0x2a'),_0x5dbcf8[_0x4d2b('0x19')]&&_0x5dbcf8[_0x4d2b('0x19')][_0x4d2b('0x28')]?_0x5dbcf8[_0x4d2b('0x19')][_0x4d2b('0x28')]:'',_0x5dbcf8['body']&&_0x5dbcf8[_0x4d2b('0x19')][_0x4d2b('0x2b')]?_0x5dbcf8[_0x4d2b('0x19')][_0x4d2b('0x2b')]:'');},'ignoreRoute':function(_0x4e0efd){var _0x2809ee=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2809ee[_0x4d2b('0x2c')](_0x4e0efd['url']);}}));return _0x9c341c();});}exports[_0x4d2b('0x2d')]=setupLoggers;
\ No newline at end of file
index bdcf5b0..1e80856 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f9c=['message','replace','{{{','toUpperCase','}}}','keys','meta','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','Logger','transports','Console','File','%s-%s','error','warn','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','info','red','white','bold\x20white','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log'];(function(_0xcd067a,_0x3c9298){var _0x1d545f=function(_0x40a993){while(--_0x40a993){_0xcd067a['push'](_0xcd067a['shift']());}};_0x1d545f(++_0x3c9298);}(_0x8f9c,0xa7));var _0xc8f9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8f9c[_0x2641f9];return _0x585741;};'use strict';var path=require(_0xc8f9('0x0'));var util=require(_0xc8f9('0x1'));var moment=require(_0xc8f9('0x2'));var winston=require(_0xc8f9('0x3'));var config=require(_0xc8f9('0x4'));var debugLevel=config[_0xc8f9('0x5')]?config[_0xc8f9('0x5')]['toLowerCase']():_0xc8f9('0x6');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':_0xc8f9('0x7'),'warn':'bold\x20yellow','info':_0xc8f9('0x8'),'print':_0xc8f9('0x9'),'success':'bold\x20green','http':'gray','verbose':_0xc8f9('0xa'),'debug':_0xc8f9('0xb'),'silly':_0xc8f9('0xc')};winston[_0xc8f9('0xd')](XC_LOG_COLORS);function getLogFileName(_0xc8a2dd,_0x32ea41,_0x42be5b){var _0x187515=_0xc8a2dd||_0xc8f9('0xe');return path[_0xc8f9('0xf')](_0x187515,util[_0xc8f9('0x10')](_0xc8f9('0x11'),_0x32ea41,_0x42be5b));}function formatter(_0x3077fb,_0x59910f){_0x59910f[_0xc8f9('0x12')]=_0x59910f[_0xc8f9('0x12')][_0xc8f9('0x13')](/@@{/g,_0xc8f9('0x14'))[_0xc8f9('0x13')](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0xc8f9('0x13')](/}@/g,'}}');return util[_0xc8f9('0x10')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x59910f['level'][_0xc8f9('0x15')](),_0x3077fb,_0x59910f[_0xc8f9('0x12')]);}function fileFormat(_0x4a2b94,_0x5c821e){_0x5c821e[_0xc8f9('0x12')]=_0x5c821e[_0xc8f9('0x12')][_0xc8f9('0x13')](/@@{/g,_0xc8f9('0x14'))[_0xc8f9('0x13')](/}@@/g,_0xc8f9('0x16'))[_0xc8f9('0x13')](/@{/g,'{{')[_0xc8f9('0x13')](/}@/g,'}}');var _0x39ca8e=_0x5c821e['meta']&&Object[_0xc8f9('0x17')](_0x5c821e[_0xc8f9('0x18')])['length']?'\x0a\x09'+JSON[_0xc8f9('0x19')](_0x5c821e[_0xc8f9('0x18')]):'';return util['format'](_0xc8f9('0x1a'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x5c821e[_0xc8f9('0x1b')]['toUpperCase'](),_0x4a2b94,_0x5c821e[_0xc8f9('0x12')],_0x39ca8e);}function consoleLogger(){var _0x290dab=new winston[(_0xc8f9('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc8f9('0x1d'))][(_0xc8f9('0x1e'))]({'level':'warn','json':![],'formatter':function(_0x29f161){return formatter('',_0x29f161);}})]});return _0x290dab;}function fileLogger(_0x27fdc4,_0x11630b){var _0x365f69=new winston[(_0xc8f9('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc8f9('0x1d'))][(_0xc8f9('0x1f'))]({'name':util['format'](_0xc8f9('0x20'),_0x27fdc4,_0xc8f9('0x21')),'filename':getLogFileName(_0x11630b,_0x27fdc4,_0xc8f9('0x21')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x260831){return fileFormat(_0x27fdc4,_0x260831);}}),new winston[(_0xc8f9('0x1d'))][(_0xc8f9('0x1f'))]({'name':util['format']('%s-%s',_0x27fdc4,debugLevel),'filename':getLogFileName(_0x11630b,_0x27fdc4,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x21c7c9){return fileFormat(_0x27fdc4,_0x21c7c9);}}),new winston['transports']['Console']({'level':_0xc8f9('0x22'),'json':![],'formatter':function(_0x5e1930){return fileFormat(_0x27fdc4,_0x5e1930);}})]});return _0x365f69;}exports[_0xc8f9('0x23')]=consoleLogger;exports[_0xc8f9('0x24')]=fileLogger;
\ No newline at end of file
+var _0xdb4d=['level','toUpperCase','keys','meta','length','stringify','transports','warn','Logger','File','error','%s-%s','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','info','redBG\x20white','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x375325,_0x57a850){var _0x228f57=function(_0x2ad744){while(--_0x2ad744){_0x375325['push'](_0x375325['shift']());}};_0x228f57(++_0x57a850);}(_0xdb4d,0x1c6));var _0xddb4=function(_0xff659,_0x17edfa){_0xff659=_0xff659-0x0;var _0x1b61af=_0xdb4d[_0xff659];return _0x1b61af;};'use strict';var path=require(_0xddb4('0x0'));var util=require(_0xddb4('0x1'));var moment=require(_0xddb4('0x2'));var winston=require(_0xddb4('0x3'));var config=require(_0xddb4('0x4'));var debugLevel=config[_0xddb4('0x5')]?config[_0xddb4('0x5')]['toLowerCase']():_0xddb4('0x6');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':_0xddb4('0x7'),'error':'red','warn':_0xddb4('0x8'),'info':_0xddb4('0x9'),'print':_0xddb4('0xa'),'success':_0xddb4('0xb'),'http':_0xddb4('0xc'),'verbose':_0xddb4('0xd'),'debug':_0xddb4('0xe'),'silly':_0xddb4('0xf')};winston[_0xddb4('0x10')](XC_LOG_COLORS);function getLogFileName(_0x5096a3,_0x5c7a81,_0x3580d5){var _0x15d349=_0x5096a3||_0xddb4('0x11');return path[_0xddb4('0x12')](_0x15d349,util[_0xddb4('0x13')]('%s-%s.log',_0x5c7a81,_0x3580d5));}function formatter(_0x56ce54,_0x2eeac4){_0x2eeac4[_0xddb4('0x14')]=_0x2eeac4[_0xddb4('0x14')]['replace'](/@@{/g,_0xddb4('0x15'))[_0xddb4('0x16')](/}@@/g,_0xddb4('0x17'))[_0xddb4('0x16')](/@{/g,'{{')[_0xddb4('0x16')](/}@/g,'}}');return util['format'](_0xddb4('0x18'),moment()[_0xddb4('0x13')](_0xddb4('0x19')),_0x2eeac4[_0xddb4('0x1a')][_0xddb4('0x1b')](),_0x56ce54,_0x2eeac4[_0xddb4('0x14')]);}function fileFormat(_0x5d4b7b,_0x5f0af5){_0x5f0af5[_0xddb4('0x14')]=_0x5f0af5['message'][_0xddb4('0x16')](/@@{/g,_0xddb4('0x15'))[_0xddb4('0x16')](/}@@/g,_0xddb4('0x17'))[_0xddb4('0x16')](/@{/g,'{{')[_0xddb4('0x16')](/}@/g,'}}');var _0x518870=_0x5f0af5['meta']&&Object[_0xddb4('0x1c')](_0x5f0af5[_0xddb4('0x1d')])[_0xddb4('0x1e')]?'\x0a\x09'+JSON[_0xddb4('0x1f')](_0x5f0af5[_0xddb4('0x1d')]):'';return util[_0xddb4('0x13')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0xddb4('0x13')](_0xddb4('0x19')),_0x5f0af5['level'][_0xddb4('0x1b')](),_0x5d4b7b,_0x5f0af5[_0xddb4('0x14')],_0x518870);}function consoleLogger(){var _0x2ce33d=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xddb4('0x20'))]['Console']({'level':_0xddb4('0x21'),'json':![],'formatter':function(_0x12a2b8){return formatter('',_0x12a2b8);}})]});return _0x2ce33d;}function fileLogger(_0x1fc380,_0x2ae346){var _0xc564fa=new winston[(_0xddb4('0x22'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xddb4('0x20'))][(_0xddb4('0x23'))]({'name':util[_0xddb4('0x13')]('%s-%s',_0x1fc380,_0xddb4('0x24')),'filename':getLogFileName(_0x2ae346,_0x1fc380,'error'),'level':_0xddb4('0x24'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x57d4c2){return fileFormat(_0x1fc380,_0x57d4c2);}}),new winston['transports'][(_0xddb4('0x23'))]({'name':util['format'](_0xddb4('0x25'),_0x1fc380,debugLevel),'filename':getLogFileName(_0x2ae346,_0x1fc380,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x465233){return fileFormat(_0x1fc380,_0x465233);}}),new winston[(_0xddb4('0x20'))]['Console']({'level':'warn','json':![],'formatter':function(_0x26031e){return fileFormat(_0x1fc380,_0x26031e);}})]});return _0xc564fa;}exports[_0xddb4('0x26')]=consoleLogger;exports[_0xddb4('0x27')]=fileLogger;
\ No newline at end of file
index 7d80586..399fd9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','exports','maskSensitiveData','lodash','username','password','newPassword','firstName','lastName','street','phone','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xdb28,0x106));var _0x8db2=function(_0x42cd2b,_0x12e457){_0x42cd2b=_0x42cd2b-0x0;var _0xcdb999=_0xdb28[_0x42cd2b];return _0xcdb999;};var _=require(_0x8db2('0x0'));var sensitiveFields=[_0x8db2('0x1'),_0x8db2('0x2'),_0x8db2('0x3'),'apiKey',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'fax',_0x8db2('0x9'),_0x8db2('0xa'),'clientSecret','securityToken',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'authToken',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'calleridname',_0x8db2('0x15'),_0x8db2('0x16'),'vidaooApiKey',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'user','pass',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21')];function maskSensitiveData(_0x2f177a){const _0x3c96a7=/(?!^)[\s\S](?!$)/g;if(_[_0x8db2('0x22')](_0x2f177a)){for(const _0x16c8c2 in _0x2f177a){if(_['isArray'](_0x2f177a[_0x16c8c2])){for(let _0x13b0f5=0x0;_0x13b0f5<_0x2f177a[_0x16c8c2][_0x8db2('0x23')];_0x13b0f5++){maskSensitiveData(_0x2f177a[_0x16c8c2][_0x13b0f5]);}}else if(_['isPlainObject'](_0x2f177a[_0x16c8c2])){maskSensitiveData(_0x2f177a[_0x16c8c2]);}else if(_[_0x8db2('0x24')](_0x2f177a[_0x16c8c2])){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](/{{{/g,_0x8db2('0x26'))[_0x8db2('0x25')](/}}}/g,_0x8db2('0x27'))[_0x8db2('0x25')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x16c8c2)){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](_0x3c96a7,'*');}}}}}module[_0x8db2('0x28')][_0x8db2('0x29')]=maskSensitiveData;
\ No newline at end of file
+var _0x5f2f=['tenantId','token','channelSecret','accessTokenSecret','authToken','consumerKey','membername','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','lodash','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','clientSecret','securityToken','code'];(function(_0x261864,_0x41e96b){var _0x3472ae=function(_0x492509){while(--_0x492509){_0x261864['push'](_0x261864['shift']());}};_0x3472ae(++_0x41e96b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x54855d,_0x243e02){_0x54855d=_0x54855d-0x0;var _0x31e792=_0x5f2f[_0x54855d];return _0x31e792;};var _=require(_0xf5f2('0x0'));var sensitiveFields=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3'),_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),_0xf5f2('0x7'),'phone','mobile',_0xf5f2('0x8'),_0xf5f2('0x9'),_0xf5f2('0xa'),_0xf5f2('0xb'),_0xf5f2('0xc'),_0xf5f2('0xd'),'accessKey',_0xf5f2('0xe'),_0xf5f2('0xf'),_0xf5f2('0x10'),'accessToken',_0xf5f2('0x11'),_0xf5f2('0x12'),_0xf5f2('0x13'),'consumerSecret',_0xf5f2('0x14'),'calleridname','calleridnum',_0xf5f2('0x15'),_0xf5f2('0x16'),'clientEmail',_0xf5f2('0x17'),_0xf5f2('0x18'),_0xf5f2('0x19'),_0xf5f2('0x1a'),_0xf5f2('0x1b'),_0xf5f2('0x1c'),'accountSid',_0xf5f2('0x1d'),_0xf5f2('0x1e'),_0xf5f2('0x1f'),_0xf5f2('0x20'),_0xf5f2('0x21')];function maskSensitiveData(_0x4d97fc){const _0xafe430=/(?!^)[\s\S](?!$)/g;if(_[_0xf5f2('0x22')](_0x4d97fc)){for(const _0x17d656 in _0x4d97fc){if(_[_0xf5f2('0x23')](_0x4d97fc[_0x17d656])){for(let _0x23e23a=0x0;_0x23e23a<_0x4d97fc[_0x17d656][_0xf5f2('0x24')];_0x23e23a++){maskSensitiveData(_0x4d97fc[_0x17d656][_0x23e23a]);}}else if(_[_0xf5f2('0x22')](_0x4d97fc[_0x17d656])){maskSensitiveData(_0x4d97fc[_0x17d656]);}else if(_[_0xf5f2('0x25')](_0x4d97fc[_0x17d656])){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](/{{{/g,_0xf5f2('0x27'))[_0xf5f2('0x26')](/}}}/g,_0xf5f2('0x28'))[_0xf5f2('0x26')](/{{/g,'@{')[_0xf5f2('0x26')](/}}/g,'}@');if(_[_0xf5f2('0x29')](sensitiveFields,_0x17d656)){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](_0xafe430,'*');}}}}}module[_0xf5f2('0x2a')]['maskSensitiveData']=maskSensitiveData;
\ No newline at end of file
index 36b50ec..7bad089 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x955f=['map','isPlainObject','keys','reduce','exports','lodash','{\x20{\x20','\x20}\x20}','string'];(function(_0x35cfdb,_0x4a6020){var _0x181d0a=function(_0x14f83f){while(--_0x14f83f){_0x35cfdb['push'](_0x35cfdb['shift']());}};_0x181d0a(++_0x4a6020);}(_0x955f,0x1eb));var _0xf955=function(_0x327087,_0x159975){_0x327087=_0x327087-0x0;var _0x4f5b1e=_0x955f[_0x327087];return _0x4f5b1e;};var _=require(_0xf955('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x471baa){return _0x471baa==='{{'?_0xf955('0x1'):_0xf955('0x2');}function safeTemplate(_0x2834f7){var _0x585f6e=_0x2834f7;if(typeof _0x2834f7===_0xf955('0x3')){_0x585f6e=_0x2834f7['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x2834f7)){_0x585f6e=_0x2834f7[_0xf955('0x4')](function(_0x5a20bc){return safeTemplate(_0x5a20bc);});}else if(_[_0xf955('0x5')](_0x2834f7)){_0x585f6e=Object[_0xf955('0x6')](_0x2834f7)[_0xf955('0x7')](function(_0x59d5b3,_0x18432f){_0x59d5b3[_0x18432f]=safeTemplate(_0x2834f7[_0x18432f]);return _0x59d5b3;},{});}return _0x585f6e;}module[_0xf955('0x8')]['safeTemplate']=safeTemplate;
\ No newline at end of file
+var _0x1a85=['{\x20{\x20','\x20}\x20}','replace','isArray','map','isPlainObject','reduce','exports'];(function(_0x250843,_0x2ecdcd){var _0x177854=function(_0x1151e0){while(--_0x1151e0){_0x250843['push'](_0x250843['shift']());}};_0x177854(++_0x2ecdcd);}(_0x1a85,0x178));var _0x51a8=function(_0xa201ee,_0x37da32){_0xa201ee=_0xa201ee-0x0;var _0x3e104d=_0x1a85[_0xa201ee];return _0x3e104d;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x54a0db){return _0x54a0db==='{{'?_0x51a8('0x0'):_0x51a8('0x1');}function safeTemplate(_0x43e22a){var _0x498466=_0x43e22a;if(typeof _0x43e22a==='string'){_0x498466=_0x43e22a[_0x51a8('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x51a8('0x3')](_0x43e22a)){_0x498466=_0x43e22a[_0x51a8('0x4')](function(_0x48a21b){return safeTemplate(_0x48a21b);});}else if(_[_0x51a8('0x5')](_0x43e22a)){_0x498466=Object['keys'](_0x43e22a)[_0x51a8('0x6')](function(_0x5cf430,_0x331117){_0x5cf430[_0x331117]=safeTemplate(_0x43e22a[_0x331117]);return _0x5cf430;},{});}return _0x498466;}module[_0x51a8('0x7')]['safeTemplate']=safeTemplate;
\ No newline at end of file